[
  {
    "path": ".gitignore",
    "content": "# built application files\n*.apk\n*.ap_\n\n# files for the dex VM\n*.dex\n\n# Java class files\n*.class\n\n# Mobile Tools for Java (J2ME)\n.mtj.tmp/\n\n\n# generated files\nbin/\nobj\nobj/local\ngen/\nbin/dexedLibs\nbin/res\nbin/*.xml\nbin/classes\nbin/res\nbin/jarlist.cache\n*.cache\n\n# Local configuration file (sdk path, etc)\nlocal.properties\n\n# Eclipse project files\n.classpath\n.project\n\n# Proguard folder generated by Eclipse\nproguard/\n\n# Intellij project files\n*.iml\n*.ipr\n*.iws\n\n# Gradle\n.gradle/\n.gradle\nbuild/\nbuild\n\n# gedit\n*~\n\n.idea/*.xml\n!.idea/codeStyleSettings.xml\n!.idea/copyright/*.xml\n!.idea/fileColors.xml\n!.idea/encodings.xml\n!.idea/gradle.xml\n!.idea/runConfigurations/*.xml\n\n!.idea/inspectionProfiles/*.xml\n.idea/inspectionProfiles/profiles_settings.xml\n\n!.idea/scopes/*.xml\n.idea/scopes/scope_settings.xml\n\n!.idea/templateLanguages.xml\n!.idea/vcs.xml\nprofiles_settings.xml\n.idea/libraries\nlibuvccamera/src/main/libs\n.idea/copyright\n.idea/scopes\n.idea/caches\n.idea/codeStyles\n"
  },
  {
    "path": ".idea/encodings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"Encoding\">\n    <file url=\"PROJECT\" charset=\"UTF-8\" />\n  </component>\n</project>"
  },
  {
    "path": ".idea/gradle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleSettings\">\n    <option name=\"linkedExternalProjectsSettings\">\n      <GradleProjectSettings>\n        <option name=\"distributionType\" value=\"DEFAULT_WRAPPED\" />\n        <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n        <option name=\"gradleHome\" value=\"$APPLICATION_HOME_DIR$/gradle/gradle-2.14.1\" />\n        <option name=\"modules\">\n          <set>\n            <option value=\"$PROJECT_DIR$\" />\n            <option value=\"$PROJECT_DIR$/libuvccamera\" />\n            <option value=\"$PROJECT_DIR$/usbCameraCommon\" />\n            <option value=\"$PROJECT_DIR$/usbCameraTest\" />\n            <option value=\"$PROJECT_DIR$/usbCameraTest0\" />\n            <option value=\"$PROJECT_DIR$/usbCameraTest2\" />\n            <option value=\"$PROJECT_DIR$/usbCameraTest3\" />\n            <option value=\"$PROJECT_DIR$/usbCameraTest4\" />\n            <option value=\"$PROJECT_DIR$/usbCameraTest5\" />\n            <option value=\"$PROJECT_DIR$/usbCameraTest6\" />\n            <option value=\"$PROJECT_DIR$/usbCameraTest7\" />\n            <option value=\"$PROJECT_DIR$/usbCameraTest8\" />\n          </set>\n        </option>\n        <option name=\"resolveModulePerSourceSet\" value=\"false\" />\n      </GradleProjectSettings>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/inspectionProfiles/Project_Default.xml",
    "content": "<component name=\"InspectionProjectProfileManager\">\n  <profile version=\"1.0\">\n    <option name=\"myName\" value=\"Project Default\" />\n    <inspection_tool class=\"Anonymous2MethodRef\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"CanBeFinal\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\">\n      <option name=\"REPORT_CLASSES\" value=\"false\" />\n      <option name=\"REPORT_METHODS\" value=\"false\" />\n      <option name=\"REPORT_FIELDS\" value=\"true\" />\n    </inspection_tool>\n    <inspection_tool class=\"CaughtExceptionImmediatelyRethrown\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"CodeBlock2Expr\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"ConstantConditionalExpression\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"ConstantConditions\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\">\n      <option name=\"SUGGEST_NULLABLE_ANNOTATIONS\" value=\"false\" />\n      <option name=\"DONT_REPORT_TRUE_ASSERT_STATEMENTS\" value=\"false\" />\n    </inspection_tool>\n    <inspection_tool class=\"ConstantIfStatement\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"ContinueOrBreakFromFinallyBlock\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"Convert2Diamond\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"Convert2Lambda\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"Convert2MethodRef\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"Convert2streamapi\" enabled=\"false\" level=\"WEAK WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"DialogTitleCapitalization\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"EmptyCatchBlock\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\">\n      <option name=\"m_includeComments\" value=\"true\" />\n      <option name=\"m_ignoreTestCases\" value=\"true\" />\n      <option name=\"m_ignoreIgnoreParameter\" value=\"true\" />\n    </inspection_tool>\n    <inspection_tool class=\"EmptyFinallyBlock\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"EmptyMethod\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"EmptyTryBlock\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"FinalPrivateMethod\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"FinalStaticMethod\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"FinallyBlockCannotCompleteNormally\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"ForCanBeForeach\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\">\n      <option name=\"REPORT_INDEXED_LOOP\" value=\"false\" />\n      <option name=\"ignoreUntypedCollections\" value=\"false\" />\n    </inspection_tool>\n    <inspection_tool class=\"IfCanBeSwitch\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\">\n      <option name=\"minimumBranches\" value=\"3\" />\n      <option name=\"suggestIntSwitches\" value=\"false\" />\n      <option name=\"suggestEnumSwitches\" value=\"false\" />\n    </inspection_tool>\n    <inspection_tool class=\"InfiniteLoopStatement\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"JavaDoc\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\">\n      <option name=\"TOP_LEVEL_CLASS_OPTIONS\">\n        <value>\n          <option name=\"ACCESS_JAVADOC_REQUIRED_FOR\" value=\"none\" />\n          <option name=\"REQUIRED_TAGS\" value=\"\" />\n        </value>\n      </option>\n      <option name=\"INNER_CLASS_OPTIONS\">\n        <value>\n          <option name=\"ACCESS_JAVADOC_REQUIRED_FOR\" value=\"none\" />\n          <option name=\"REQUIRED_TAGS\" value=\"\" />\n        </value>\n      </option>\n      <option name=\"METHOD_OPTIONS\">\n        <value>\n          <option name=\"ACCESS_JAVADOC_REQUIRED_FOR\" value=\"none\" />\n          <option name=\"REQUIRED_TAGS\" value=\"@return@param@throws or @exception\" />\n        </value>\n      </option>\n      <option name=\"FIELD_OPTIONS\">\n        <value>\n          <option name=\"ACCESS_JAVADOC_REQUIRED_FOR\" value=\"none\" />\n          <option name=\"REQUIRED_TAGS\" value=\"\" />\n        </value>\n      </option>\n      <option name=\"IGNORE_DEPRECATED\" value=\"false\" />\n      <option name=\"IGNORE_JAVADOC_PERIOD\" value=\"true\" />\n      <option name=\"IGNORE_DUPLICATED_THROWS\" value=\"false\" />\n      <option name=\"IGNORE_POINT_TO_ITSELF\" value=\"false\" />\n      <option name=\"myAdditionalJavadocTags\" value=\"\" />\n    </inspection_tool>\n    <inspection_tool class=\"JniMissingFunction\" enabled=\"false\" level=\"ERROR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"LoggerInitializedWithForeignClass\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\">\n      <option name=\"loggerClassName\" value=\"org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger\" />\n      <option name=\"loggerFactoryMethodName\" value=\"getLogger,getLogger,getLog,getLogger\" />\n    </inspection_tool>\n    <inspection_tool class=\"LoopStatementsThatDontLoop\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"ReturnFromFinallyBlock\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"SafeVarargsDetector\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"ThrowFromFinallyBlock\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"TryFinallyCanBeTryWithResources\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"TryWithIdenticalCatches\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"UnnecessaryEnumModifier\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"UnnecessaryInterfaceModifier\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"UnnecessaryLabelOnBreakStatement\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"UnnecessaryLabelOnContinueStatement\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"UnnecessaryLocalVariable\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\">\n      <option name=\"m_ignoreImmediatelyReturnedVariables\" value=\"false\" />\n      <option name=\"m_ignoreAnnotatedVariables\" value=\"false\" />\n    </inspection_tool>\n    <inspection_tool class=\"UnnecessaryModuleDependencyInspection\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"UnusedLabel\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"UnusedParameters\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"UnusedReturnValue\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"WeakerAccess\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\">\n      <option name=\"SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS\" value=\"true\" />\n      <option name=\"SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES\" value=\"true\" />\n      <option name=\"SUGGEST_PRIVATE_FOR_INNERS\" value=\"false\" />\n    </inspection_tool>\n    <inspection_tool class=\"WhileCanBeForeach\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"unused\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\">\n      <option name=\"LOCAL_VARIABLE\" value=\"true\" />\n      <option name=\"FIELD\" value=\"true\" />\n      <option name=\"METHOD\" value=\"true\" />\n      <option name=\"CLASS\" value=\"true\" />\n      <option name=\"PARAMETER\" value=\"true\" />\n      <option name=\"REPORT_PARAMETER_FOR_PUBLIC_METHODS\" value=\"true\" />\n      <option name=\"ADD_MAINS_TO_ENTRIES\" value=\"true\" />\n      <option name=\"ADD_APPLET_TO_ENTRIES\" value=\"true\" />\n      <option name=\"ADD_SERVLET_TO_ENTRIES\" value=\"true\" />\n      <option name=\"ADD_NONJAVA_TO_ENTRIES\" value=\"true\" />\n    </inspection_tool>\n  </profile>\n</component>"
  },
  {
    "path": ".idea/vcs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping directory=\"\" vcs=\"Git\" />\n  </component>\n</project>"
  },
  {
    "path": "README.md",
    "content": "UVCCamera\n=========\n\nlibrary and sample to access to UVC web camera on non-rooted Android device\n\nCopyright (c) 2014-2017 saki t_saki@serenegiant.com\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\nAll files in the folder are under this Apache License, Version 2.0.\nFiles in the jni/libjpeg, jni/libusb and jin/libuvc folders may have a different license,\nsee the respective files.\n\nHow to compile library  \n=========\nThe Gradle build system will build the entire project, including the NDK parts. If you want to build with Gradle build system,\n\n1. make directory on your favorite place (this directory is parent directory of `UVCCamera` project).\n2. change directory into the directory.\n3. clone this repository with `git  clone https://github.com/saki4510t/UVCCamera.git`\n4. change directory into `UVCCamera` directory with `cd UVCCamera`\n5. build library with all sample projects using `gradle build`\n\nIt will takes several minutes to build. Now you can see apks in each `{sample project}/build/outputs/apks` directory.  \nOr if you want to install and try all sample projects on your device, run `gradle installDebug`.  \n\nNote: Just make sure that `local.properties` contains the paths for `sdk.dir` and `ndk.dir`. Or you can set them as enviroment variables of you shell. On some system, you may need add `JAVA_HOME` envairoment valiable that points to JDK directory.  \n\nIf you want to use Android Studio(unfortunately NDK supporting on Android Studio is very poor though),\n1. make directory on your favorite place (this directory is parent directory of `UVCCamera` project).\n2. change directory into the directory.\n3. clone this repository with `git  clone https://github.com/saki4510t/UVCCamera.git`\n4. start Android Studio and open the cloned repository using `Open an existing Android Studio project`\n5. Android Studio raise some errors but just ignore now. Android Studio generate `local.properties` file. Please open `local.properties` and add `ndk.dir` key to the end of the file. The contents of the file looks like this.\n```\nsdk.dir={path to Android SDK on your storage}\nndk.dir={path to Android SDK on your storage}\n```\nPlease replace actual path to SDK and NDK on your storage.  \nOf course you can make `local.properties` by manually instead of using automatically generated ones by Android Studio.\n6. Synchronize project\n7. execute `Make project` from `Build` menu.\n\nIf you want to use build-in VCS on Android Studio, use `Check out project from Version Control` from `https://github.com/saki4510t/UVCCamera.git`. After cloning, Android Studio ask you open the project but don't open now. Instead open the project using `Open an existing Android Studio project`. Other procedures are same as above.\n\nIf you still need to use Eclipse or if you don't want to use Gradle with some reason, you can build suing `ndk-build` command.\n\n1. make directory on your favorite place.\n2. change directory into the directory.\n3. clone this repository with `git  clone https://github.com/saki4510t/UVCCamera.git`\n4. change directory into `{UVCCamera}/libuvccamera/build/src/main/jni` directory.\n5. run `ndk-build`\n6. resulted shared libraries are available under `{UVCCamera}/libuvccamera/build/src/main/libs` directory and copy them into your project with directories by manually.\n7. copy files under `{UVCCamera}/libuvccamera/build/src/main/java` into your project source directory by manually.\n\nHow to use\n=========\nPlease see sample project and/or our web site(but sorry web site is Japanese only).\nThese sample projects are IntelliJ projects, as is the library.\nThis library works on at least Android 3.1 or later(API >= 12), but Android 4.0(API >= 14)\nor later is better. USB host function must be required.\nIf you want to try on Android 3.1, you will need some modification(need to remove\nsetPreviewTexture method in UVCCamera.java etc.), but we have not confirm whether the sample\nproject run on Android 3.1 yet.\nSome sample projects need API>=18 though.\n\n### 2014/07/25\nAdd some modification to the library and new sample project named \"USBCameraTest2\".\nThis new sample project demonstrate how to capture movie using frame data from\nUVC camera with MediaCodec and MediaMuxer.\nNew sample requires at least Android 4.3(API>=18).\nThis limitation does not come from the library itself but from the limitation of\nMediaMuxer and MediaCodec#createInputSurface.\n\n### 2014/09/01\nAdd new sample project named `USBCameraTest3`\nThis new sample project demonstrate how to capture audio and movie simultaneously\nusing frame data from UVC camera and internal mic with MediaCodec and MediaMuxer.\nThis new sample includes still image capturing as png file.(you can easily change to\nsave as jpeg) This sample also requires at least Android 4.3(API>=18).\nThis limitation does not come from the library itself but from the limitation of\nMediaMuxer and MediaCodec#createInputSurface.\n\n### 2014/11/16\nAdd new sample project named `USBCameraTest4`\nThis new sample project mainly demonstrate how to use offscreen rendering\nand record movie without any display.\nThe communication with camera execute as Service and continue working\neven if you stop app. If you stop camera communication, click \"stop service\" button.\n\n### 2014/12/17\nAdd bulk transfer mode and update sample projects.\n\n### 2015/01/12\nAdd wiki page, [HowTo](https://github.com/saki4510t/UVCCamera/wiki/howto \"HowTo\")\n\n### 2015/01/22\nAdd method to adjust preview resolution and frame data mode.\n\n### 2015/02/12\nAdd IFrameCallback interface to get frame data as ByteArray\nand new sample project `USBCameraTest5` to demonstrate how to use the callback method.\n\n### 2015/02/18\nAdd `libUVCCamera` as a library project(source code is almost same as previous release except Android.mk).\nAll files and directories under `library` directory is deprecated.\n\n### 2015/05/25\nlibraryProject branch merged to master.\n\n### 2015/05/30\nFixed the issue that DeviceFilter class could not work well when providing venderID, productID etc.\n\n### 2015/06/03\nAdd new sample project named `USBCameraTest6`\nThis new sample project mainly demonstrate how to show video images on two TextureView simultaneously, side by side.\n\n### 2015/06/10\nFixed the issue of pixel format is wrong when NV21 mode on calling IFrameCallback#onFrame(U and V plane was swapped) and added YUV420SP mode.\n\n### 2015/06/11\nImprove the issue of `USBCameraTest4` that fails to connect/disconnect.\n\n### 2015/07/19\nAdd new methods to get/set camera features like brightness, contrast etc.  \nAdd new method to get supported resolution from camera as json format.  \n\n### 2015/08/17\nAdd new sample project `USBCameraTest7` to demonstrate how to use two camera at the same time.  \n\n### 2015/09/20\nFixed the issue that building native libraries fail on Windows.\n\n### 2015/10/30\nMerge pull request(add status and button callback). Thanks Alexey Pelykh.\n\n### 2015/12/16\nAdd feature so that user can request fps range from Java code when negotiating with camera. Actual resulted fps depends on each UVC camera. Currently there is no way to get resulted fps(will add on future).\n\n### 2016/03/01\nupdate minoru001 branch, experimentaly support streo camera.\n\n### 2016/06/18\nreplace libjpeg-turbo 1.4.0 with 1.5.0\n\n### 2016/11/17\napply bandwidth factor setting of usbcameratest7 on master branch\n\n### 2016/11/21\nNow this repository supports Android N(7.x) and dynamic permission model of Android N and later.\n\n### 2017/01/16\nAdd new sample app `usbCameraTest8` to show how to set/get uvc control like brightness \n\n### 2017/04/17\nAdd new sample app on [OpenCVwithUVC](https://github.com/saki4510t/OpenCVwithUVC.git) repository.\nThis shows the way to pass video images from UVC into `cv::Mat` (after optional applying video effect by OpenGL|ES) and execute image processing by `OpenCV`.\n"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\nbuildscript {\n    repositories {\n//\t\tgoogle()\n\t\tmaven { url 'https://maven.google.com' }\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:3.1.4'\n    }\n}\n\nallprojects {\n    repositories {\n//    \tgoogle()\n\t\tmaven { url 'https://maven.google.com' }\n\t\tjcenter()\n\t\tmaven { url 'http://raw.github.com/saki4510t/libcommon/master/repository/' }\n    }\n}\n\ntask clean(type: Delete) {\n\tdelete rootProject.buildDir\n}\n\next {\n\tsupportLibVersion = '27.1.1'  // variable that can be referenced to keep support libs consistent\n\tcommonLibVersion= '2.12.4'\n\tversionBuildTool = '27.0.3'\n\tversionCompiler = 27\n\tversionTarget = 27\n\tversionNameString = '1.0.0'\n\tjavaSourceCompatibility = JavaVersion.VERSION_1_8\n\tjavaTargetCompatibility = JavaVersion.VERSION_1_8\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Tue Oct 02 16:16:11 JST 2018\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-4.4-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\norg.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\norg.gradle.parallel=true"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# For Cygwin, ensure paths are in UNIX format before anything is touched.\nif $cygwin ; then\n    [ -n \"$JAVA_HOME\" ] && JAVA_HOME=`cygpath --unix \"$JAVA_HOME\"`\nfi\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >&-\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >&-\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windowz variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\ngoto execute\r\n\r\n:4NT_args\r\n@rem Get arguments from the 4NT Shell from JP Software\r\nset CMD_LINE_ARGS=%$\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "libuvccamera/build.gradle",
    "content": "apply plugin: 'com.android.library'\n/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\nimport org.apache.tools.ant.taskdefs.condition.Os\n\nandroid {\n\tcompileSdkVersion versionCompiler\n\tbuildToolsVersion versionBuildTool\n\n\tcompileOptions {\n\t\tsourceCompatibility javaSourceCompatibility\n\t\ttargetCompatibility javaTargetCompatibility\n\t}\n\n    defaultConfig {\n        minSdkVersion 14\n\t\ttargetSdkVersion versionTarget\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'\n        }\n    }\n\tsourceSets {\n\t\tmain {\n\t\t\tjniLibs.srcDir 'src/main/libs'\n\t\t\tjni.srcDirs = []\n\t\t}\n\t}\n}\n\ntasks.withType(JavaCompile) {\n\tcompileTask -> compileTask.dependsOn ndkBuild\n}\n\nString getNdkBuildPath() {\n\tProperties properties = new Properties()\n\tproperties.load(project.rootProject.file('local.properties').newDataInputStream())\n\tdef ndkBuildingDir = properties.getProperty(\"ndk.dir\")\n\tdef ndkBuildPath = ndkBuildingDir\n\tif (Os.isFamily(Os.FAMILY_WINDOWS)) {\n\t\tndkBuildPath = ndkBuildingDir + '/ndk-build.cmd'\n\t} else {\n\t\tndkBuildPath = ndkBuildingDir + '/ndk-build'\n\t}\n\treturn ndkBuildPath\n}\n\ntask ndkBuild(type: Exec, description: 'Compile JNI source via NDK') {\n\tprintln('executing ndkBuild')\n\tdef ndkBuildPath = getNdkBuildPath();\n\tcommandLine ndkBuildPath, '-j8', '-C', file('src/main').absolutePath\n}\n\ntask ndkClean(type: Exec, description: 'clean JNI libraries') {\n\tprintln('executing ndkBuild clean')\n\tdef ndkBuildPath = getNdkBuildPath();\n\tcommandLine ndkBuildPath, 'clean', '-C', file('src/main').absolutePath\n}\n\nclean.dependsOn 'ndkClean'\n\ndependencies {\n    implementation fileTree(dir: new File(buildDir, 'libs'), include: '*.jar')\n\n\timplementation \"com.android.support:support-v4:${supportLibVersion}\"\n\timplementation \"com.android.support:support-annotations:${supportLibVersion}\"\n\n\timplementation(\"com.serenegiant:common:${commonLibVersion}\") {\n\t\texclude module: 'support-v4'\n\t}\n}\n"
  },
  {
    "path": "libuvccamera/src/main/AndroidManifest.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.serenegiant.uvccamera\"\n    android:versionCode=\"2\"\n    android:versionName=\"1.1\" >\n\n    <uses-sdk\n        android:minSdkVersion=\"14\"\n        android:targetSdkVersion=\"22\" />\n\n</manifest>\n"
  },
  {
    "path": "libuvccamera/src/main/java/com/serenegiant/common/BaseActivity.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.common;\n\nimport android.Manifest;\nimport android.annotation.SuppressLint;\nimport android.content.pm.PackageManager;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.os.Looper;\nimport android.support.annotation.NonNull;\nimport android.support.annotation.StringRes;\nimport android.support.v7.app.AppCompatActivity;\nimport android.util.Log;\nimport android.widget.Toast;\n\nimport com.serenegiant.dialog.MessageDialogFragmentV4;\nimport com.serenegiant.utils.BuildCheck;\nimport com.serenegiant.utils.HandlerThreadHandler;\nimport com.serenegiant.utils.PermissionCheck;\n\n/**\n * Created by saki on 2016/11/18.\n *\n */\npublic class BaseActivity extends AppCompatActivity\n\timplements MessageDialogFragmentV4.MessageDialogListener {\n\n\tprivate static boolean DEBUG = false;\t// FIXME 実働時はfalseにセットすること\n\tprivate static final String TAG = BaseActivity.class.getSimpleName();\n\n\t/** UI操作のためのHandler */\n\tprivate final Handler mUIHandler = new Handler(Looper.getMainLooper());\n\tprivate final Thread mUiThread = mUIHandler.getLooper().getThread();\n\t/** ワーカースレッド上で処理するためのHandler */\n\tprivate Handler mWorkerHandler;\n\tprivate long mWorkerThreadID = -1;\n\n\t@Override\n\tprotected void onCreate(final Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\t// ワーカースレッドを生成\n\t\tif (mWorkerHandler == null) {\n\t\t\tmWorkerHandler = HandlerThreadHandler.createHandler(TAG);\n\t\t\tmWorkerThreadID = mWorkerHandler.getLooper().getThread().getId();\n\t\t}\n\t}\n\n\t@Override\n\tprotected void onPause() {\n\t\tclearToast();\n\t\tsuper.onPause();\n\t}\n\n\t@Override\n\tprotected synchronized void onDestroy() {\n\t\t// ワーカースレッドを破棄\n\t\tif (mWorkerHandler != null) {\n\t\t\ttry {\n\t\t\t\tmWorkerHandler.getLooper().quit();\n\t\t\t} catch (final Exception e) {\n\t\t\t\t//\n\t\t\t}\n\t\t\tmWorkerHandler = null;\n\t\t}\n\t\tsuper.onDestroy();\n\t}\n\n//================================================================================\n\t/**\n\t * UIスレッドでRunnableを実行するためのヘルパーメソッド\n\t * @param task\n\t * @param duration\n\t */\n\tpublic final void runOnUiThread(final Runnable task, final long duration) {\n\t\tif (task == null) return;\n\t\tmUIHandler.removeCallbacks(task);\n\t\tif ((duration > 0) || Thread.currentThread() != mUiThread) {\n\t\t\tmUIHandler.postDelayed(task, duration);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\ttask.run();\n\t\t\t} catch (final Exception e) {\n\t\t\t\tLog.w(TAG, e);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * UIスレッド上で指定したRunnableが実行待ちしていれば実行待ちを解除する\n\t * @param task\n\t */\n\tpublic final void removeFromUiThread(final Runnable task) {\n\t\tif (task == null) return;\n\t\tmUIHandler.removeCallbacks(task);\n\t}\n\n\t/**\n\t * ワーカースレッド上で指定したRunnableを実行する\n\t * 未実行の同じRunnableがあればキャンセルされる(後から指定した方のみ実行される)\n\t * @param task\n\t * @param delayMillis\n\t */\n\tprotected final synchronized void queueEvent(final Runnable task, final long delayMillis) {\n\t\tif ((task == null) || (mWorkerHandler == null)) return;\n\t\ttry {\n\t\t\tmWorkerHandler.removeCallbacks(task);\n\t\t\tif (delayMillis > 0) {\n\t\t\t\tmWorkerHandler.postDelayed(task, delayMillis);\n\t\t\t} else if (mWorkerThreadID == Thread.currentThread().getId()) {\n\t\t\t\ttask.run();\n\t\t\t} else {\n\t\t\t\tmWorkerHandler.post(task);\n\t\t\t}\n\t\t} catch (final Exception e) {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\t/**\n\t * 指定したRunnableをワーカースレッド上で実行予定であればキャンセルする\n\t * @param task\n\t */\n\tprotected final synchronized void removeEvent(final Runnable task) {\n\t\tif (task == null) return;\n\t\ttry {\n\t\t\tmWorkerHandler.removeCallbacks(task);\n\t\t} catch (final Exception e) {\n\t\t\t// ignore\n\t\t}\n\t}\n\n//================================================================================\n\tprivate Toast mToast;\n\t/**\n\t * Toastでメッセージを表示\n\t * @param msg\n\t */\n\tprotected void showToast(@StringRes final int msg, final Object... args) {\n\t\tremoveFromUiThread(mShowToastTask);\n\t\tmShowToastTask = new ShowToastTask(msg, args);\n\t\trunOnUiThread(mShowToastTask, 0);\n\t}\n\n\t/**\n\t * Toastが表示されていればキャンセルする\n\t */\n\tprotected void clearToast() {\n\t\tremoveFromUiThread(mShowToastTask);\n\t\tmShowToastTask = null;\n\t\ttry {\n\t\t\tif (mToast != null) {\n\t\t\t\tmToast.cancel();\n\t\t\t\tmToast = null;\n\t\t\t}\n\t\t} catch (final Exception e) {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\tprivate ShowToastTask mShowToastTask;\n\tprivate final class ShowToastTask implements Runnable {\n\t\tfinal int msg;\n\t\tfinal Object args;\n\t\tprivate ShowToastTask(@StringRes final int msg, final Object... args) {\n\t\t\tthis.msg = msg;\n\t\t\tthis.args = args;\n\t\t}\n\n\t\t@Override\n\t\tpublic void run() {\n\t\t\ttry {\n\t\t\t\tif (mToast != null) {\n\t\t\t\t\tmToast.cancel();\n\t\t\t\t\tmToast = null;\n\t\t\t\t}\n\t\t\t\tfinal String _msg = (args != null) ? getString(msg, args) : getString(msg);\n\t\t\t\tmToast = Toast.makeText(BaseActivity.this, _msg, Toast.LENGTH_SHORT);\n\t\t\t\tmToast.show();\n\t\t\t} catch (final Exception e) {\n\t\t\t\t// ignore\n\t\t\t}\n\t\t}\n\t}\n\n//================================================================================\n\t/**\n\t * MessageDialogFragmentメッセージダイアログからのコールバックリスナー\n\t * @param dialog\n\t * @param requestCode\n\t * @param permissions\n\t * @param result\n\t */\n\t@SuppressLint(\"NewApi\")\n\t@Override\n\tpublic void onMessageDialogResult(final MessageDialogFragmentV4 dialog, final int requestCode, final String[] permissions, final boolean result) {\n\t\tif (result) {\n\t\t\t// メッセージダイアログでOKを押された時はパーミッション要求する\n\t\t\tif (BuildCheck.isMarshmallow()) {\n\t\t\t\trequestPermissions(permissions, requestCode);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// メッセージダイアログでキャンセルされた時とAndroid6でない時は自前でチェックして#checkPermissionResultを呼び出す\n\t\tfor (final String permission: permissions) {\n\t\t\tcheckPermissionResult(requestCode, permission, PermissionCheck.hasPermission(this, permission));\n\t\t}\n\t}\n\n\t/**\n\t * パーミッション要求結果を受け取るためのメソッド\n\t * @param requestCode\n\t * @param permissions\n\t * @param grantResults\n\t */\n\t@Override\n\tpublic void onRequestPermissionsResult(final int requestCode, @NonNull final String[] permissions, @NonNull final int[] grantResults) {\n\t\tsuper.onRequestPermissionsResult(requestCode, permissions, grantResults);\t// 何もしてないけど一応呼んどく\n\t\tfinal int n = Math.min(permissions.length, grantResults.length);\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tcheckPermissionResult(requestCode, permissions[i], grantResults[i] == PackageManager.PERMISSION_GRANTED);\n\t\t}\n\t}\n\n\t/**\n\t * パーミッション要求の結果をチェック\n\t * ここではパーミッションを取得できなかった時にToastでメッセージ表示するだけ\n\t * @param requestCode\n\t * @param permission\n\t * @param result\n\t */\n\tprotected void checkPermissionResult(final int requestCode, final String permission, final boolean result) {\n\t\t// パーミッションがないときにはメッセージを表示する\n\t\tif (!result && (permission != null)) {\n\t\t\tif (Manifest.permission.RECORD_AUDIO.equals(permission)) {\n\t\t\t\tshowToast(R.string.permission_audio);\n\t\t\t}\n\t\t\tif (Manifest.permission.WRITE_EXTERNAL_STORAGE.equals(permission)) {\n\t\t\t\tshowToast(R.string.permission_ext_storage);\n\t\t\t}\n\t\t\tif (Manifest.permission.INTERNET.equals(permission)) {\n\t\t\t\tshowToast(R.string.permission_network);\n\t\t\t}\n\t\t}\n\t}\n\n\t// 動的パーミッション要求時の要求コード\n\tprotected static final int REQUEST_PERMISSION_WRITE_EXTERNAL_STORAGE = 0x12345;\n\tprotected static final int REQUEST_PERMISSION_AUDIO_RECORDING = 0x234567;\n\tprotected static final int REQUEST_PERMISSION_NETWORK = 0x345678;\n\tprotected static final int REQUEST_PERMISSION_CAMERA = 0x537642;\n\n\t/**\n\t * 外部ストレージへの書き込みパーミッションが有るかどうかをチェック\n\t * なければ説明ダイアログを表示する\n\t * @return true 外部ストレージへの書き込みパーミッションが有る\n\t */\n\tprotected boolean checkPermissionWriteExternalStorage() {\n\t\tif (!PermissionCheck.hasWriteExternalStorage(this)) {\n\t\t\tMessageDialogFragmentV4.showDialog(this, REQUEST_PERMISSION_WRITE_EXTERNAL_STORAGE,\n\t\t\t\tR.string.permission_title, R.string.permission_ext_storage_request,\n\t\t\t\tnew String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE});\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * 録音のパーミッションが有るかどうかをチェック\n\t * なければ説明ダイアログを表示する\n\t * @return true 録音のパーミッションが有る\n\t */\n\tprotected boolean checkPermissionAudio() {\n\t\tif (!PermissionCheck.hasAudio(this)) {\n\t\t\tMessageDialogFragmentV4.showDialog(this, REQUEST_PERMISSION_AUDIO_RECORDING,\n\t\t\t\tR.string.permission_title, R.string.permission_audio_recording_request,\n\t\t\t\tnew String[]{Manifest.permission.RECORD_AUDIO});\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * ネットワークアクセスのパーミッションが有るかどうかをチェック\n\t * なければ説明ダイアログを表示する\n\t * @return true ネットワークアクセスのパーミッションが有る\n\t */\n\tprotected boolean checkPermissionNetwork() {\n\t\tif (!PermissionCheck.hasNetwork(this)) {\n\t\t\tMessageDialogFragmentV4.showDialog(this, REQUEST_PERMISSION_NETWORK,\n\t\t\t\tR.string.permission_title, R.string.permission_network_request,\n\t\t\t\tnew String[]{Manifest.permission.INTERNET});\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * カメラアクセスのパーミッションがあるかどうかをチェック\n\t * なければ説明ダイアログを表示する\n\t * @return true カメラアクセスのパーミッションが有る\n\t */\n\tprotected boolean checkPermissionCamera() {\n\t\tif (!PermissionCheck.hasCamera(this)) {\n\t\t\tMessageDialogFragmentV4.showDialog(this, REQUEST_PERMISSION_CAMERA,\n\t\t\t\tR.string.permission_title, R.string.permission_camera_request,\n\t\t\t\tnew String[]{Manifest.permission.CAMERA});\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n}\n"
  },
  {
    "path": "libuvccamera/src/main/java/com/serenegiant/common/BaseFragment.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.common;\n\nimport android.Manifest;\nimport android.annotation.SuppressLint;\nimport android.app.Fragment;\nimport android.content.pm.PackageManager;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.os.Looper;\nimport android.support.annotation.NonNull;\nimport android.support.annotation.StringRes;\nimport android.util.Log;\nimport android.widget.Toast;\n\nimport com.serenegiant.dialog.MessageDialogFragment;\nimport com.serenegiant.utils.BuildCheck;\nimport com.serenegiant.utils.HandlerThreadHandler;\nimport com.serenegiant.utils.PermissionCheck;\n\n/**\n * Created by saki on 2016/11/19.\n *\n */\npublic class BaseFragment extends Fragment\n\timplements MessageDialogFragment.MessageDialogListener {\n\n\tprivate static boolean DEBUG = false;\t// FIXME 実働時はfalseにセットすること\n\tprivate static final String TAG = BaseFragment.class.getSimpleName();\n\n\t/** UI操作のためのHandler */\n\tprivate final Handler mUIHandler = new Handler(Looper.getMainLooper());\n\tprivate final Thread mUiThread = mUIHandler.getLooper().getThread();\n\t/** ワーカースレッド上で処理するためのHandler */\n\tprivate Handler mWorkerHandler;\n\tprivate long mWorkerThreadID = -1;\n\n\tpublic BaseFragment() {\n\t\tsuper();\n\t}\n\n\t@Override\n\tpublic void onCreate(final Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\t// ワーカースレッドを生成\n\t\tif (mWorkerHandler == null) {\n\t\t\tmWorkerHandler = HandlerThreadHandler.createHandler(TAG);\n\t\t\tmWorkerThreadID = mWorkerHandler.getLooper().getThread().getId();\n\t\t}\n\t}\n\n\t@Override\n\tpublic void onPause() {\n\t\tclearToast();\n\t\tsuper.onPause();\n\t}\n\n\t@Override\n\tpublic synchronized void onDestroy() {\n\t\t// ワーカースレッドを破棄\n\t\tif (mWorkerHandler != null) {\n\t\t\ttry {\n\t\t\t\tmWorkerHandler.getLooper().quit();\n\t\t\t} catch (final Exception e) {\n\t\t\t\t//\n\t\t\t}\n\t\t\tmWorkerHandler = null;\n\t\t}\n\t\tsuper.onDestroy();\n\t}\n\n//================================================================================\n\t/**\n\t * UIスレッドでRunnableを実行するためのヘルパーメソッド\n\t * @param task\n\t * @param duration\n\t */\n\tpublic final void runOnUiThread(final Runnable task, final long duration) {\n\t\tif (task == null) return;\n\t\tmUIHandler.removeCallbacks(task);\n\t\tif ((duration > 0) || Thread.currentThread() != mUiThread) {\n\t\t\tmUIHandler.postDelayed(task, duration);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\ttask.run();\n\t\t\t} catch (final Exception e) {\n\t\t\t\tLog.w(TAG, e);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * UIスレッド上で指定したRunnableが実行待ちしていれば実行待ちを解除する\n\t * @param task\n\t */\n\tpublic final void removeFromUiThread(final Runnable task) {\n\t\tif (task == null) return;\n\t\tmUIHandler.removeCallbacks(task);\n\t}\n\n\t/**\n\t * ワーカースレッド上で指定したRunnableを実行する\n\t * 未実行の同じRunnableがあればキャンセルされる(後から指定した方のみ実行される)\n\t * @param task\n\t * @param delayMillis\n\t */\n\tprotected final synchronized void queueEvent(final Runnable task, final long delayMillis) {\n\t\tif ((task == null) || (mWorkerHandler == null)) return;\n\t\ttry {\n\t\t\tmWorkerHandler.removeCallbacks(task);\n\t\t\tif (delayMillis > 0) {\n\t\t\t\tmWorkerHandler.postDelayed(task, delayMillis);\n\t\t\t} else if (mWorkerThreadID == Thread.currentThread().getId()) {\n\t\t\t\ttask.run();\n\t\t\t} else {\n\t\t\t\tmWorkerHandler.post(task);\n\t\t\t}\n\t\t} catch (final Exception e) {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\t/**\n\t * 指定したRunnableをワーカースレッド上で実行予定であればキャンセルする\n\t * @param task\n\t */\n\tprotected final synchronized void removeEvent(final Runnable task) {\n\t\tif (task == null) return;\n\t\ttry {\n\t\t\tmWorkerHandler.removeCallbacks(task);\n\t\t} catch (final Exception e) {\n\t\t\t// ignore\n\t\t}\n\t}\n\n//================================================================================\n\tprivate Toast mToast;\n\t/**\n\t * Toastでメッセージを表示\n\t * @param msg\n\t */\n\tprotected void showToast(@StringRes final int msg, final Object... args) {\n\t\tremoveFromUiThread(mShowToastTask);\n\t\tmShowToastTask = new ShowToastTask(msg, args);\n\t\trunOnUiThread(mShowToastTask, 0);\n\t}\n\n\t/**\n\t * Toastが表示されていればキャンセルする\n\t */\n\tprotected void clearToast() {\n\t\tremoveFromUiThread(mShowToastTask);\n\t\tmShowToastTask = null;\n\t\ttry {\n\t\t\tif (mToast != null) {\n\t\t\t\tmToast.cancel();\n\t\t\t\tmToast = null;\n\t\t\t}\n\t\t} catch (final Exception e) {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\tprivate ShowToastTask mShowToastTask;\n\tprivate final class ShowToastTask implements Runnable {\n\t\tfinal int msg;\n\t\tfinal Object args;\n\t\tprivate ShowToastTask(@StringRes final int msg, final Object... args) {\n\t\t\tthis.msg = msg;\n\t\t\tthis.args = args;\n\t\t}\n\n\t\t@Override\n\t\tpublic void run() {\n\t\t\ttry {\n\t\t\t\tif (mToast != null) {\n\t\t\t\t\tmToast.cancel();\n\t\t\t\t\tmToast = null;\n\t\t\t\t}\n\t\t\t\tif (args != null) {\n\t\t\t\t\tfinal String _msg = getString(msg, args);\n\t\t\t\t\tmToast = Toast.makeText(getActivity(), _msg, Toast.LENGTH_SHORT);\n\t\t\t\t} else {\n\t\t\t\t\tmToast = Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT);\n\t\t\t\t}\n\t\t\t\tmToast.show();\n\t\t\t} catch (final Exception e) {\n\t\t\t\t// ignore\n\t\t\t}\n\t\t}\n\t}\n\n//================================================================================\n\t/**\n\t * MessageDialogFragmentメッセージダイアログからのコールバックリスナー\n\t * @param dialog\n\t * @param requestCode\n\t * @param permissions\n\t * @param result\n\t */\n\t@SuppressLint(\"NewApi\")\n\t@Override\n\tpublic void onMessageDialogResult(final MessageDialogFragment dialog, final int requestCode, final String[] permissions, final boolean result) {\n\t\tif (result) {\n\t\t\t// メッセージダイアログでOKを押された時はパーミッション要求する\n\t\t\tif (BuildCheck.isMarshmallow()) {\n\t\t\t\trequestPermissions(permissions, requestCode);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// メッセージダイアログでキャンセルされた時とAndroid6でない時は自前でチェックして#checkPermissionResultを呼び出す\n\t\tfor (final String permission: permissions) {\n\t\t\tcheckPermissionResult(requestCode, permission, PermissionCheck.hasPermission(getActivity(), permission));\n\t\t}\n\t}\n\n\t/**\n\t * パーミッション要求結果を受け取るためのメソッド\n\t * @param requestCode\n\t * @param permissions\n\t * @param grantResults\n\t */\n\t@Override\n\tpublic void onRequestPermissionsResult(final int requestCode, @NonNull final String[] permissions, @NonNull final int[] grantResults) {\n\t\tsuper.onRequestPermissionsResult(requestCode, permissions, grantResults);\t// 何もしてないけど一応呼んどく\n\t\tfinal int n = Math.min(permissions.length, grantResults.length);\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tcheckPermissionResult(requestCode, permissions[i], grantResults[i] == PackageManager.PERMISSION_GRANTED);\n\t\t}\n\t}\n\n\t/**\n\t * パーミッション要求の結果をチェック\n\t * ここではパーミッションを取得できなかった時にToastでメッセージ表示するだけ\n\t * @param requestCode\n\t * @param permission\n\t * @param result\n\t */\n\tprotected void checkPermissionResult(final int requestCode, final String permission, final boolean result) {\n\t\t// パーミッションがないときにはメッセージを表示する\n\t\tif (!result && (permission != null)) {\n\t\t\tif (Manifest.permission.RECORD_AUDIO.equals(permission)) {\n\t\t\t\tshowToast(com.serenegiant.common.R.string.permission_audio);\n\t\t\t}\n\t\t\tif (Manifest.permission.WRITE_EXTERNAL_STORAGE.equals(permission)) {\n\t\t\t\tshowToast(com.serenegiant.common.R.string.permission_ext_storage);\n\t\t\t}\n\t\t\tif (Manifest.permission.INTERNET.equals(permission)) {\n\t\t\t\tshowToast(com.serenegiant.common.R.string.permission_network);\n\t\t\t}\n\t\t}\n\t}\n\n\t// 動的パーミッション要求時の要求コード\n\tprotected static final int REQUEST_PERMISSION_WRITE_EXTERNAL_STORAGE = 0x12345;\n\tprotected static final int REQUEST_PERMISSION_AUDIO_RECORDING = 0x234567;\n\tprotected static final int REQUEST_PERMISSION_NETWORK = 0x345678;\n\tprotected static final int REQUEST_PERMISSION_CAMERA = 0x537642;\n\n\t/**\n\t * 外部ストレージへの書き込みパーミッションが有るかどうかをチェック\n\t * なければ説明ダイアログを表示する\n\t * @return true 外部ストレージへの書き込みパーミッションが有る\n\t */\n\tprotected boolean checkPermissionWriteExternalStorage() {\n\t\tif (!PermissionCheck.hasWriteExternalStorage(getActivity())) {\n\t\t\tMessageDialogFragment.showDialog(this, REQUEST_PERMISSION_WRITE_EXTERNAL_STORAGE,\n\t\t\t\tcom.serenegiant.common.R.string.permission_title, com.serenegiant.common.R.string.permission_ext_storage_request,\n\t\t\t\tnew String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE});\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * 録音のパーミッションが有るかどうかをチェック\n\t * なければ説明ダイアログを表示する\n\t * @return true 録音のパーミッションが有る\n\t */\n\tprotected boolean checkPermissionAudio() {\n\t\tif (!PermissionCheck.hasAudio(getActivity())) {\n\t\t\tMessageDialogFragment.showDialog(this, REQUEST_PERMISSION_AUDIO_RECORDING,\n\t\t\t\tcom.serenegiant.common.R.string.permission_title, com.serenegiant.common.R.string.permission_audio_recording_request,\n\t\t\t\tnew String[]{Manifest.permission.RECORD_AUDIO});\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * ネットワークアクセスのパーミッションが有るかどうかをチェック\n\t * なければ説明ダイアログを表示する\n\t * @return true ネットワークアクセスのパーミッションが有る\n\t */\n\tprotected boolean checkPermissionNetwork() {\n\t\tif (!PermissionCheck.hasNetwork(getActivity())) {\n\t\t\tMessageDialogFragment.showDialog(this, REQUEST_PERMISSION_NETWORK,\n\t\t\t\tcom.serenegiant.common.R.string.permission_title, com.serenegiant.common.R.string.permission_network_request,\n\t\t\t\tnew String[]{Manifest.permission.INTERNET});\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * カメラアクセスのパーミッションがあるかどうかをチェック\n\t * なければ説明ダイアログを表示する\n\t * @return true カメラアクセスのパーミッションが有る\n\t */\n\tprotected boolean checkPermissionCamera() {\n\t\tif (!PermissionCheck.hasCamera(getActivity())) {\n\t\t\tMessageDialogFragment.showDialog(this, REQUEST_PERMISSION_CAMERA,\n\t\t\t\tcom.serenegiant.common.R.string.permission_title, com.serenegiant.common.R.string.permission_camera_request,\n\t\t\t\tnew String[]{Manifest.permission.CAMERA});\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n}\n"
  },
  {
    "path": "libuvccamera/src/main/java/com/serenegiant/common/BaseService.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.common;\n\nimport android.app.Service;\nimport android.os.Handler;\nimport android.os.Looper;\nimport android.util.Log;\n\nimport com.serenegiant.utils.HandlerThreadHandler;\n\npublic abstract class BaseService extends Service {\n\tprivate static boolean DEBUG = false;\t// FIXME 実働時はfalseにセットすること\n\tprivate static final String TAG = BaseService.class.getSimpleName();\n\n\t/** UI操作のためのHandler */\n\tprivate final Handler mUIHandler = new Handler(Looper.getMainLooper());\n\tprivate final Thread mUiThread = mUIHandler.getLooper().getThread();\n\t/** ワーカースレッド上で処理するためのHandler */\n\tprivate Handler mWorkerHandler;\n\tprivate long mWorkerThreadID = -1;\n\n\t@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t// ワーカースレッドを生成\n\t\tif (mWorkerHandler == null) {\n\t\t\tmWorkerHandler = HandlerThreadHandler.createHandler(TAG);\n\t\t\tmWorkerThreadID = mWorkerHandler.getLooper().getThread().getId();\n\t\t}\n\t}\n\n\t@Override\n\tpublic synchronized void onDestroy() {\n\t\t// ワーカースレッドを破棄\n\t\tif (mWorkerHandler != null) {\n\t\t\ttry {\n\t\t\t\tmWorkerHandler.getLooper().quit();\n\t\t\t} catch (final Exception e) {\n\t\t\t\t//\n\t\t\t}\n\t\t\tmWorkerHandler = null;\n\t\t}\n\t\tsuper.onDestroy();\n\t}\n\n//================================================================================\n\t/**\n\t * UIスレッドでRunnableを実行するためのヘルパーメソッド\n\t * @param task\n\t * @param duration\n\t */\n\tpublic final void runOnUiThread(final Runnable task, final long duration) {\n\t\tif (task == null) return;\n\t\tmUIHandler.removeCallbacks(task);\n\t\tif ((duration > 0) || Thread.currentThread() != mUiThread) {\n\t\t\tmUIHandler.postDelayed(task, duration);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\ttask.run();\n\t\t\t} catch (final Exception e) {\n\t\t\t\tLog.w(TAG, e);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * UIスレッド上で指定したRunnableが実行待ちしていれば実行待ちを解除する\n\t * @param task\n\t */\n\tpublic final void removeFromUiThread(final Runnable task) {\n\t\tif (task == null) return;\n\t\tmUIHandler.removeCallbacks(task);\n\t}\n\n\t/**\n\t * ワーカースレッド上で指定したRunnableを実行する\n\t * 未実行の同じRunnableがあればキャンセルされる(後から指定した方のみ実行される)\n\t * @param task\n\t * @param delayMillis\n\t */\n\tprotected final synchronized void queueEvent(final Runnable task, final long delayMillis) {\n\t\tif ((task == null) || (mWorkerHandler == null)) return;\n\t\ttry {\n\t\t\tmWorkerHandler.removeCallbacks(task);\n\t\t\tif (delayMillis > 0) {\n\t\t\t\tmWorkerHandler.postDelayed(task, delayMillis);\n\t\t\t} else if (mWorkerThreadID == Thread.currentThread().getId()) {\n\t\t\t\ttask.run();\n\t\t\t} else {\n\t\t\t\tmWorkerHandler.post(task);\n\t\t\t}\n\t\t} catch (final Exception e) {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\t/**\n\t * 指定したRunnableをワーカースレッド上で実行予定であればキャンセルする\n\t * @param task\n\t */\n\tprotected final synchronized void removeEvent(final Runnable task) {\n\t\tif (task == null) return;\n\t\ttry {\n\t\t\tmWorkerHandler.removeCallbacks(task);\n\t\t} catch (final Exception e) {\n\t\t\t// ignore\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "libuvccamera/src/main/java/com/serenegiant/usb/CameraDialog.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usb;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport android.app.Activity;\nimport android.app.AlertDialog;\nimport android.app.Dialog;\nimport android.app.DialogFragment;\nimport android.content.Context;\nimport android.content.DialogInterface;\nimport android.hardware.usb.UsbDevice;\nimport android.os.Bundle;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.view.ViewGroup;\nimport android.widget.BaseAdapter;\nimport android.widget.Button;\nimport android.widget.CheckedTextView;\nimport android.widget.Spinner;\n\nimport com.serenegiant.usb.DeviceFilter;\nimport com.serenegiant.usb.USBMonitor;\n\nimport com.serenegiant.uvccamera.R;\n\npublic class CameraDialog extends DialogFragment {\n\tprivate static final String TAG = CameraDialog.class.getSimpleName();\n\n\tpublic interface CameraDialogParent {\n\t\tpublic USBMonitor getUSBMonitor();\n\t\tpublic void onDialogResult(boolean canceled);\n\t}\n\t\n\t/**\n\t * Helper method\n\t * @param parent FragmentActivity\n\t * @return\n\t */\n\tpublic static CameraDialog showDialog(final Activity parent/* add parameters here if you need */) {\n\t\tCameraDialog dialog = newInstance(/* add parameters here if you need */);\n\t\ttry {\n\t\t\tdialog.show(parent.getFragmentManager(), TAG);\n\t\t} catch (final IllegalStateException e) {\n\t\t\tdialog = null;\n\t\t}\n    \treturn dialog;\n\t}\n\n\tpublic static CameraDialog newInstance(/* add parameters here if you need */) {\n\t\tfinal CameraDialog dialog = new CameraDialog();\n\t\tfinal Bundle args = new Bundle();\n\t\t// add parameters here if you need\n\t\tdialog.setArguments(args);\n\t\treturn dialog;\n\t}\n\n\tprotected USBMonitor mUSBMonitor;\n\tprivate Spinner mSpinner;\n\tprivate DeviceListAdapter mDeviceListAdapter;\n\n\tpublic CameraDialog(/* no arguments */) {\n\t\t// Fragment need default constructor\n\t}\n\n\t@SuppressWarnings(\"deprecation\")\n\t@Override\n\tpublic void onAttach(final Activity activity) {\n\t\tsuper.onAttach(activity);\n       if (mUSBMonitor == null)\n        try {\n    \t\tmUSBMonitor = ((CameraDialogParent)activity).getUSBMonitor();\n        } catch (final ClassCastException e) {\n    \t} catch (final NullPointerException e) {\n        }\n\t\tif (mUSBMonitor == null) {\n        \tthrow new ClassCastException(activity.toString() + \" must implement CameraDialogParent#getUSBController\");\n\t\t}\n\t}\n\n\t@Override\n    public void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tif (savedInstanceState == null)\n\t\t\tsavedInstanceState = getArguments();\n\t}\n\n\t@Override\n\tpublic void onSaveInstanceState(final Bundle saveInstanceState) {\n\t\tfinal Bundle args = getArguments();\n\t\tif (args != null)\n\t\t\tsaveInstanceState.putAll(args);\n\t\tsuper.onSaveInstanceState(saveInstanceState);\n\t}\n\n\t@Override\n    public Dialog onCreateDialog(final Bundle savedInstanceState) {\n\t\tfinal AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n\t\tbuilder.setView(initView());\n    \tbuilder.setTitle(R.string.select);\n\t    builder.setPositiveButton(android.R.string.ok, mOnDialogClickListener);\n\t    builder.setNegativeButton(android.R.string.cancel , mOnDialogClickListener);\n\t    builder.setNeutralButton(R.string.refresh, null);\n\t    final Dialog dialog = builder.create();\n\t    dialog.setCancelable(true);\n\t    dialog.setCanceledOnTouchOutside(true);\n        return dialog;\n\t}\n\n\t/**\n\t * create view that this fragment shows\n\t * @return\n\t */\n\tprivate final View initView() {\n\t\tfinal View rootView = getActivity().getLayoutInflater().inflate(R.layout.dialog_camera, null);\n\t\tmSpinner = (Spinner)rootView.findViewById(R.id.spinner1);\n\t\tfinal View empty = rootView.findViewById(android.R.id.empty);\n\t\tmSpinner.setEmptyView(empty);\n\t\treturn rootView;\n\t}\n\n\n\t@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\t\tupdateDevices();\n\t    final Button button = (Button)getDialog().findViewById(android.R.id.button3);\n\t    if (button != null) {\n\t    \tbutton.setOnClickListener(mOnClickListener);\n\t    }\n\t}\n\n\tprivate final OnClickListener mOnClickListener = new OnClickListener() {\n\t\t@Override\n\t\tpublic void onClick(final View v) {\n\t\t\tswitch (v.getId()) {\n\t\t\tcase android.R.id.button3:\n\t\t\t\tupdateDevices();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate final DialogInterface.OnClickListener mOnDialogClickListener = new DialogInterface.OnClickListener() {\n\t\t@Override\n\t\tpublic void onClick(final DialogInterface dialog, final int which) {\n\t\t\tswitch (which) {\n\t\t\tcase DialogInterface.BUTTON_POSITIVE:\n\t\t\t\tfinal Object item = mSpinner.getSelectedItem();\n\t\t\t\tif (item instanceof UsbDevice) {\n\t\t\t\t\tmUSBMonitor.requestPermission((UsbDevice)item);\n\t\t\t\t\t((CameraDialogParent)getActivity()).onDialogResult(false);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase DialogInterface.BUTTON_NEGATIVE:\n\t\t\t\t((CameraDialogParent)getActivity()).onDialogResult(true);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\t@Override\n\tpublic void onCancel(final DialogInterface dialog) {\n\t\t((CameraDialogParent)getActivity()).onDialogResult(true);\n\t\tsuper.onCancel(dialog);\n\t}\n\n\tpublic void updateDevices() {\n//\t\tmUSBMonitor.dumpDevices();\n\t\tfinal List<DeviceFilter> filter = DeviceFilter.getDeviceFilters(getActivity(), R.xml.device_filter);\n\t\tmDeviceListAdapter = new DeviceListAdapter(getActivity(), mUSBMonitor.getDeviceList(filter.get(0)));\n\t\tmSpinner.setAdapter(mDeviceListAdapter);\n\t}\n\n\tprivate static final class DeviceListAdapter extends BaseAdapter {\n\n\t\tprivate final LayoutInflater mInflater;\n\t\tprivate final List<UsbDevice> mList;\n\n\t\tpublic DeviceListAdapter(final Context context, final List<UsbDevice>list) {\n\t\t\tmInflater = LayoutInflater.from(context);\n\t\t\tmList = list != null ? list : new ArrayList<UsbDevice>();\n\t\t}\n\n\t\t@Override\n\t\tpublic int getCount() {\n\t\t\treturn mList.size();\n\t\t}\n\n\t\t@Override\n\t\tpublic UsbDevice getItem(final int position) {\n\t\t\tif ((position >= 0) && (position < mList.size()))\n\t\t\t\treturn mList.get(position);\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\n\t\t@Override\n\t\tpublic long getItemId(final int position) {\n\t\t\treturn position;\n\t\t}\n\n\t\t@Override\n\t\tpublic View getView(final int position, View convertView, final ViewGroup parent) {\n\t\t\tif (convertView == null) {\n\t\t\t\tconvertView = mInflater.inflate(R.layout.listitem_device, parent, false);\n\t\t\t}\n\t\t\tif (convertView instanceof CheckedTextView) {\n\t\t\t\tfinal UsbDevice device = getItem(position);\n\t\t\t\t((CheckedTextView)convertView).setText(\n\t\t\t\t\tString.format(\"UVC Camera:(%x:%x:%s)\", device.getVendorId(), device.getProductId(), device.getDeviceName()));\n\t\t\t}\n\t\t\treturn convertView;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "libuvccamera/src/main/java/com/serenegiant/usb/DeviceFilter.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usb;\n\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.xmlpull.v1.XmlPullParser;\nimport org.xmlpull.v1.XmlPullParserException;\n\nimport android.content.Context;\nimport android.content.res.Resources.NotFoundException;\nimport android.hardware.usb.UsbDevice;\nimport android.hardware.usb.UsbInterface;\nimport android.text.TextUtils;\nimport android.util.Log;\n\npublic final class DeviceFilter {\n\n\tprivate static final String TAG = \"DeviceFilter\";\n\n\t// USB Vendor ID (or -1 for unspecified)\n\tpublic final int mVendorId;\n\t// USB Product ID (or -1 for unspecified)\n\tpublic final int mProductId;\n\t// USB device or interface class (or -1 for unspecified)\n\tpublic final int mClass;\n\t// USB device subclass (or -1 for unspecified)\n\tpublic final int mSubclass;\n\t// USB device protocol (or -1 for unspecified)\n\tpublic final int mProtocol;\n\t// USB device manufacturer name string (or null for unspecified)\n\tpublic final String mManufacturerName;\n\t// USB device product name string (or null for unspecified)\n\tpublic final String mProductName;\n\t// USB device serial number string (or null for unspecified)\n\tpublic final String mSerialNumber;\n\t// set true if specific device(s) should exclude\n\tpublic final boolean isExclude;\n\n\tpublic DeviceFilter(final int vid, final int pid, final int clasz, final int subclass,\n\t\t\tfinal int protocol, final String manufacturer, final String product, final String serialNum) {\n\t\tthis(vid, pid, clasz, subclass, protocol, manufacturer, product, serialNum, false);\n\t}\n\n\tpublic DeviceFilter(final int vid, final int pid, final int clasz, final int subclass,\n\t\t\tfinal int protocol, final String manufacturer, final String product, final String serialNum, final boolean isExclude) {\n\t\tmVendorId = vid;\n\t\tmProductId = pid;\n\t\tmClass = clasz;\n\t\tmSubclass = subclass;\n\t\tmProtocol = protocol;\n\t\tmManufacturerName = manufacturer;\n\t\tmProductName = product;\n\t\tmSerialNumber = serialNum;\n\t\tthis.isExclude = isExclude;\n/*\t\tLog.i(TAG, String.format(\"vendorId=0x%04x,productId=0x%04x,class=0x%02x,subclass=0x%02x,protocol=0x%02x\",\n\t\t\tmVendorId, mProductId, mClass, mSubclass, mProtocol)); */\n\t}\n\n\tpublic DeviceFilter(final UsbDevice device) {\n\t\tthis(device, false);\n\t}\n\n\tpublic DeviceFilter(final UsbDevice device, final boolean isExclude) {\n\t\tmVendorId = device.getVendorId();\n\t\tmProductId = device.getProductId();\n\t\tmClass = device.getDeviceClass();\n\t\tmSubclass = device.getDeviceSubclass();\n\t\tmProtocol = device.getDeviceProtocol();\n\t\tmManufacturerName = null;\t// device.getManufacturerName();\n\t\tmProductName = null;\t\t// device.getProductName();\n\t\tmSerialNumber = null;\t\t// device.getSerialNumber();\n\t\tthis.isExclude = isExclude;\n/*\t\tLog.i(TAG, String.format(\"vendorId=0x%04x,productId=0x%04x,class=0x%02x,subclass=0x%02x,protocol=0x%02x\",\n\t\t\tmVendorId, mProductId, mClass, mSubclass, mProtocol)); */\n\t}\n\n\t/**\n\t * 指定したxmlリソースからDeviceFilterリストを生成する\n\t * @param context\n\t * @param deviceFilterXmlId\n\t * @return\n\t */\n\tpublic static List<DeviceFilter> getDeviceFilters(final Context context, final int deviceFilterXmlId) {\n\t\tfinal XmlPullParser parser = context.getResources().getXml(deviceFilterXmlId);\n\t\tfinal List<DeviceFilter> deviceFilters = new ArrayList<DeviceFilter>();\n\t\ttry {\n\t\t\tint eventType = parser.getEventType();\n\t\t\twhile (eventType != XmlPullParser.END_DOCUMENT) {\n\t            if (eventType == XmlPullParser.START_TAG) {\n\t\t\t\t\tfinal DeviceFilter deviceFilter = readEntryOne(context, parser);\n\t\t\t\t\tif (deviceFilter != null) {\n\t\t\t\t\t\tdeviceFilters.add(deviceFilter);\n\t\t\t\t\t}\n\t            }\n\t\t\t\teventType = parser.next();\n\t\t\t}\n\t\t} catch (final XmlPullParserException e) {\n\t\t\tLog.d(TAG, \"XmlPullParserException\", e);\n\t\t} catch (final IOException e) {\n\t\t\tLog.d(TAG, \"IOException\", e);\n\t\t}\n\n\t\treturn Collections.unmodifiableList(deviceFilters);\n\t}\n\n\t/**\n\t * read as integer values with default value from xml(w/o exception throws)\n\t * resource integer id is also resolved into integer\n\t * @param parser\n\t * @param namespace\n\t * @param name\n\t * @param defaultValue\n\t * @return\n\t */\n\tprivate static final int getAttributeInteger(final Context context, final XmlPullParser parser, final String namespace, final String name, final int defaultValue) {\n\t\tint result = defaultValue;\n\t\ttry {\n\t\t\tString v = parser.getAttributeValue(namespace, name);\n\t\t\tif (!TextUtils.isEmpty(v) && v.startsWith(\"@\")) {\n\t\t\t\tfinal String r = v.substring(1);\n\t\t\t\tfinal int resId = context.getResources().getIdentifier(r, null, context.getPackageName());\n\t\t\t\tif (resId > 0) {\n\t\t\t\t\tresult = context.getResources().getInteger(resId);\n\t\t\t\t}\n\t\t\t} else {\n                int radix = 10;\n                if (v != null && v.length() > 2 && v.charAt(0) == '0' &&\n                    (v.charAt(1) == 'x' || v.charAt(1) == 'X')) {\n                    // allow hex values starting with 0x or 0X\n                    radix = 16;\n                    v = v.substring(2);\n                }\n\t\t\t\tresult = Integer.parseInt(v, radix);\n\t\t\t}\n\t\t} catch (final NotFoundException e) {\n\t\t\tresult = defaultValue;\n\t\t} catch (final NumberFormatException e) {\n\t\t\tresult = defaultValue;\n\t\t} catch (final NullPointerException e) {\n\t\t\tresult = defaultValue;\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * read as boolean values with default value from xml(w/o exception throws)\n\t * resource boolean id is also resolved into boolean\n\t * if the value is zero, return false, if the value is non-zero integer, return true\n\t * @param context\n\t * @param parser\n\t * @param namespace\n\t * @param name\n\t * @param defaultValue\n\t * @return\n\t */\n\tprivate static final boolean getAttributeBoolean(final Context context, final XmlPullParser parser, final String namespace, final String name, final boolean defaultValue) {\n\t\tboolean result = defaultValue;\n\t\ttry {\n\t\t\tString v = parser.getAttributeValue(namespace, name);\n\t\t\tif (\"TRUE\".equalsIgnoreCase(v)) {\n\t\t\t\tresult = true;\n\t\t\t} else if (\"FALSE\".equalsIgnoreCase(v)) {\n\t\t\t\tresult = false;\n\t\t\t} else if (!TextUtils.isEmpty(v) && v.startsWith(\"@\")) {\n\t\t\t\tfinal String r = v.substring(1);\n\t\t\t\tfinal int resId = context.getResources().getIdentifier(r, null, context.getPackageName());\n\t\t\t\tif (resId > 0) {\n\t\t\t\t\tresult = context.getResources().getBoolean(resId);\n\t\t\t\t}\n\t\t\t} else {\n                int radix = 10;\n                if (v != null && v.length() > 2 && v.charAt(0) == '0' &&\n                    (v.charAt(1) == 'x' || v.charAt(1) == 'X')) {\n                    // allow hex values starting with 0x or 0X\n                    radix = 16;\n                    v = v.substring(2);\n                }\n\t\t\t\tfinal int val = Integer.parseInt(v, radix);\n\t\t\t\tresult = val != 0;\n\t\t\t}\n\t\t} catch (final NotFoundException e) {\n\t\t\tresult = defaultValue;\n\t\t} catch (final NumberFormatException e) {\n\t\t\tresult = defaultValue;\n\t\t} catch (final NullPointerException e) {\n\t\t\tresult = defaultValue;\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * read as String attribute with default value from xml(w/o exception throws)\n\t * resource string id is also resolved into string\n\t * @param parser\n\t * @param namespace\n\t * @param name\n\t * @param defaultValue\n\t * @return\n\t */\n\tprivate static final String getAttributeString(final Context context, final XmlPullParser parser, final String namespace, final String name, final String defaultValue) {\n\t\tString result = defaultValue;\n\t\ttry {\n\t\t\tresult = parser.getAttributeValue(namespace, name);\n\t\t\tif (result == null)\n\t\t\t\tresult = defaultValue;\n\t\t\tif (!TextUtils.isEmpty(result) && result.startsWith(\"@\")) {\n\t\t\t\tfinal String r = result.substring(1);\n\t\t\t\tfinal int resId = context.getResources().getIdentifier(r, null, context.getPackageName());\n\t\t\t\tif (resId > 0)\n\t\t\t\t\tresult = context.getResources().getString(resId);\n\t\t\t}\n\t\t} catch (final NotFoundException e) {\n\t\t\tresult = defaultValue;\n\t\t} catch (final NumberFormatException e) {\n\t\t\tresult = defaultValue;\n\t\t} catch (final NullPointerException e) {\n\t\t\tresult = defaultValue;\n\t\t}\n\t\treturn result;\n\t}\n\n\tpublic static DeviceFilter readEntryOne(final Context context, final XmlPullParser parser)\n\t\t\tthrows XmlPullParserException, IOException {\n\t\tint vendorId = -1;\n\t\tint productId = -1;\n\t\tint deviceClass = -1;\n\t\tint deviceSubclass = -1;\n\t\tint deviceProtocol = -1;\n\t\tboolean exclude = false;\n\t\tString manufacturerName = null;\n\t\tString productName = null;\n\t\tString serialNumber = null;\n\t\tboolean hasValue = false;\n\n\t\tString tag;\n        int eventType = parser.getEventType();\n        while (eventType != XmlPullParser.END_DOCUMENT) {\n        \ttag = parser.getName();\n        \tif (!TextUtils.isEmpty(tag) && (tag.equalsIgnoreCase(\"usb-device\"))) {\n        \t\tif (eventType == XmlPullParser.START_TAG) {\n        \t\t\thasValue = true;\n\t\t\t\t\tvendorId = getAttributeInteger(context, parser, null, \"vendor-id\", -1);\n        \t\t\tif (vendorId == -1) {\n        \t\t\t\tvendorId = getAttributeInteger(context, parser, null, \"vendorId\", -1);\n        \t\t\t\tif (vendorId == -1)\n                \t\t\tvendorId = getAttributeInteger(context, parser, null, \"venderId\", -1);\n        \t\t\t}\n    \t\t\t\tproductId = getAttributeInteger(context, parser, null, \"product-id\", -1);\n        \t\t\tif (productId == -1)\n            \t\t\tproductId = getAttributeInteger(context, parser, null, \"productId\", -1);\n        \t\t\tdeviceClass = getAttributeInteger(context, parser, null, \"class\", -1);\n        \t\t\tdeviceSubclass = getAttributeInteger(context, parser, null, \"subclass\", -1);\n        \t\t\tdeviceProtocol = getAttributeInteger(context, parser, null, \"protocol\", -1);\n        \t\t\tmanufacturerName = getAttributeString(context, parser, null, \"manufacturer-name\", null);\n        \t\t\tif (TextUtils.isEmpty(manufacturerName))\n        \t\t\t\tmanufacturerName = getAttributeString(context, parser, null, \"manufacture\", null);\n        \t\t\tproductName = getAttributeString(context, parser, null, \"product-name\", null);\n        \t\t\tif (TextUtils.isEmpty(productName))\n        \t\t\t\tproductName = getAttributeString(context, parser, null, \"product\", null);\n        \t\t\tserialNumber = getAttributeString(context, parser, null, \"serial-number\", null);\n        \t\t\tif (TextUtils.isEmpty(serialNumber))\n            \t\t\tserialNumber = getAttributeString(context, parser, null, \"serial\", null);\n\t\t\t\t\texclude = getAttributeBoolean(context, parser, null, \"exclude\", false);\n        \t\t} else if (eventType == XmlPullParser.END_TAG) {\n        \t\t\tif (hasValue) {\n\t        \t\t\treturn new DeviceFilter(vendorId, productId, deviceClass,\n\t        \t\t\t\t\tdeviceSubclass, deviceProtocol, manufacturerName, productName,\n\t        \t\t\t\t\tserialNumber, exclude);\n        \t\t\t}\n        \t\t}\n        \t}\n        \teventType = parser.next();\n        }\n        return null;\n\t}\n\n/*\tpublic void write(XmlSerializer serializer) throws IOException {\n\t\tserializer.startTag(null, \"usb-device\");\n\t\tif (mVendorId != -1) {\n\t\t\tserializer\n\t\t\t\t\t.attribute(null, \"vendor-id\", Integer.toString(mVendorId));\n\t\t}\n\t\tif (mProductId != -1) {\n\t\t\tserializer.attribute(null, \"product-id\",\n\t\t\t\t\tInteger.toString(mProductId));\n\t\t}\n\t\tif (mClass != -1) {\n\t\t\tserializer.attribute(null, \"class\", Integer.toString(mClass));\n\t\t}\n\t\tif (mSubclass != -1) {\n\t\t\tserializer.attribute(null, \"subclass\", Integer.toString(mSubclass));\n\t\t}\n\t\tif (mProtocol != -1) {\n\t\t\tserializer.attribute(null, \"protocol\", Integer.toString(mProtocol));\n\t\t}\n\t\tif (mManufacturerName != null) {\n\t\t\tserializer.attribute(null, \"manufacturer-name\", mManufacturerName);\n\t\t}\n\t\tif (mProductName != null) {\n\t\t\tserializer.attribute(null, \"product-name\", mProductName);\n\t\t}\n\t\tif (mSerialNumber != null) {\n\t\t\tserializer.attribute(null, \"serial-number\", mSerialNumber);\n\t\t}\n\t\tserializer.attribute(null, \"serial-number\", Boolean.toString(isExclude));\n\t\tserializer.endTag(null, \"usb-device\");\n\t} */\n\n\t/**\n\t * 指定したクラス・サブクラス・プロトコルがこのDeviceFilterとマッチするかどうかを返す\n\t * mExcludeフラグは別途#isExcludeか自前でチェックすること\n\t * @param clasz\n\t * @param subclass\n\t * @param protocol\n\t * @return\n\t */\n\tprivate boolean matches(final int clasz, final int subclass, final int protocol) {\n\t\treturn ((mClass == -1 || clasz == mClass)\n\t\t\t\t&& (mSubclass == -1 || subclass == mSubclass) && (mProtocol == -1 || protocol == mProtocol));\n\t}\n\n\t/**\n\t * 指定したUsbDeviceがこのDeviceFilterにマッチするかどうかを返す\n\t * mExcludeフラグは別途#isExcludeか自前でチェックすること\n\t * @param device\n\t * @return\n\t */\n\tpublic boolean matches(final UsbDevice device) {\n\t\tif (mVendorId != -1 && device.getVendorId() != mVendorId) {\n\t\t\treturn false;\n\t\t}\n\t\tif (mProductId != -1 && device.getProductId() != mProductId) {\n\t\t\treturn false;\n\t\t}\n/*\t\tif (mManufacturerName != null && device.getManufacturerName() == null)\n\t\t\treturn false;\n\t\tif (mProductName != null && device.getProductName() == null)\n\t\t\treturn false;\n\t\tif (mSerialNumber != null && device.getSerialNumber() == null)\n\t\t\treturn false;\n\t\tif (mManufacturerName != null && device.getManufacturerName() != null\n\t\t\t\t&& !mManufacturerName.equals(device.getManufacturerName()))\n\t\t\treturn false;\n\t\tif (mProductName != null && device.getProductName() != null\n\t\t\t\t&& !mProductName.equals(device.getProductName()))\n\t\t\treturn false;\n\t\tif (mSerialNumber != null && device.getSerialNumber() != null\n\t\t\t\t&& !mSerialNumber.equals(device.getSerialNumber()))\n\t\t\treturn false; */\n\n\t\t// check device class/subclass/protocol\n\t\tif (matches(device.getDeviceClass(), device.getDeviceSubclass(), device.getDeviceProtocol())) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if device doesn't match, check the interfaces\n\t\tfinal int count = device.getInterfaceCount();\n\t\tfor (int i = 0; i < count; i++) {\n\t\t\tfinal UsbInterface intf = device.getInterface(i);\n\t\t\tif (matches(intf.getInterfaceClass(), intf.getInterfaceSubclass(), intf.getInterfaceProtocol())) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * このDeviceFilterに一致してかつmExcludeがtrueならtrueを返す\n\t * @param device\n\t * @return\n\t */\n\tpublic boolean isExclude(final UsbDevice device) {\n\t\treturn isExclude && matches(device);\n\t}\n\n\t/**\n\t * これって要らんかも, equalsでできる気が\n\t * @param f\n\t * @return\n\t */\n\tpublic boolean matches(final DeviceFilter f) {\n\t\tif (isExclude != f.isExclude) {\n\t\t\treturn false;\n\t\t}\n\t\tif (mVendorId != -1 && f.mVendorId != mVendorId) {\n\t\t\treturn false;\n\t\t}\n\t\tif (mProductId != -1 && f.mProductId != mProductId) {\n\t\t\treturn false;\n\t\t}\n\t\tif (f.mManufacturerName != null && mManufacturerName == null) {\n\t\t\treturn false;\n\t\t}\n\t\tif (f.mProductName != null && mProductName == null) {\n\t\t\treturn false;\n\t\t}\n\t\tif (f.mSerialNumber != null && mSerialNumber == null) {\n\t\t\treturn false;\n\t\t}\n\t\tif (mManufacturerName != null && f.mManufacturerName != null\n\t\t\t\t&& !mManufacturerName.equals(f.mManufacturerName)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (mProductName != null && f.mProductName != null\n\t\t\t\t&& !mProductName.equals(f.mProductName)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (mSerialNumber != null && f.mSerialNumber != null\n\t\t\t\t&& !mSerialNumber.equals(f.mSerialNumber)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// check device class/subclass/protocol\n\t\treturn matches(f.mClass, f.mSubclass, f.mProtocol);\n\t}\n\n\t@Override\n\tpublic boolean equals(final Object obj) {\n\t\t// can't compare if we have wildcard strings\n\t\tif (mVendorId == -1 || mProductId == -1 || mClass == -1\n\t\t\t\t|| mSubclass == -1 || mProtocol == -1) {\n\t\t\treturn false;\n\t\t}\n\t\tif (obj instanceof DeviceFilter) {\n\t\t\tfinal DeviceFilter filter = (DeviceFilter) obj;\n\n\t\t\tif (filter.mVendorId != mVendorId\n\t\t\t\t\t|| filter.mProductId != mProductId\n\t\t\t\t\t|| filter.mClass != mClass || filter.mSubclass != mSubclass\n\t\t\t\t\t|| filter.mProtocol != mProtocol) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ((filter.mManufacturerName != null && mManufacturerName == null)\n\t\t\t\t\t|| (filter.mManufacturerName == null && mManufacturerName != null)\n\t\t\t\t\t|| (filter.mProductName != null && mProductName == null)\n\t\t\t\t\t|| (filter.mProductName == null && mProductName != null)\n\t\t\t\t\t|| (filter.mSerialNumber != null && mSerialNumber == null)\n\t\t\t\t\t|| (filter.mSerialNumber == null && mSerialNumber != null)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ((filter.mManufacturerName != null && mManufacturerName != null && !mManufacturerName\n\t\t\t\t\t.equals(filter.mManufacturerName))\n\t\t\t\t\t|| (filter.mProductName != null && mProductName != null && !mProductName\n\t\t\t\t\t\t\t.equals(filter.mProductName))\n\t\t\t\t\t|| (filter.mSerialNumber != null && mSerialNumber != null && !mSerialNumber\n\t\t\t\t\t\t\t.equals(filter.mSerialNumber))) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn (filter.isExclude != isExclude);\n\t\t}\n\t\tif (obj instanceof UsbDevice) {\n\t\t\tfinal UsbDevice device = (UsbDevice) obj;\n\t\t\tif (isExclude\n\t\t\t\t\t|| (device.getVendorId() != mVendorId)\n\t\t\t\t\t|| (device.getProductId() != mProductId)\n\t\t\t\t\t|| (device.getDeviceClass() != mClass)\n\t\t\t\t\t|| (device.getDeviceSubclass() != mSubclass)\n\t\t\t\t\t|| (device.getDeviceProtocol() != mProtocol) ) {\n\t\t\t\treturn false;\n\t\t\t}\n/*\t\t\tif ((mManufacturerName != null && device.getManufacturerName() == null)\n\t\t\t\t\t|| (mManufacturerName == null && device\n\t\t\t\t\t\t\t.getManufacturerName() != null)\n\t\t\t\t\t|| (mProductName != null && device.getProductName() == null)\n\t\t\t\t\t|| (mProductName == null && device.getProductName() != null)\n\t\t\t\t\t|| (mSerialNumber != null && device.getSerialNumber() == null)\n\t\t\t\t\t|| (mSerialNumber == null && device.getSerialNumber() != null)) {\n\t\t\t\treturn (false);\n\t\t\t} */\n/*\t\t\tif ((device.getManufacturerName() != null && !mManufacturerName\n\t\t\t\t\t.equals(device.getManufacturerName()))\n\t\t\t\t\t|| (device.getProductName() != null && !mProductName\n\t\t\t\t\t\t\t.equals(device.getProductName()))\n\t\t\t\t\t|| (device.getSerialNumber() != null && !mSerialNumber\n\t\t\t\t\t\t\t.equals(device.getSerialNumber()))) {\n\t\t\t\treturn (false);\n\t\t\t} */\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic int hashCode() {\n\t\treturn (((mVendorId << 16) | mProductId) ^ ((mClass << 16)\n\t\t\t\t| (mSubclass << 8) | mProtocol));\n\t}\n\n\t@Override\n\tpublic String toString() {\n\t\treturn \"DeviceFilter[mVendorId=\" + mVendorId + \",mProductId=\"\n\t\t\t+ mProductId + \",mClass=\" + mClass + \",mSubclass=\" + mSubclass\n\t\t\t+ \",mProtocol=\" + mProtocol\n\t\t\t+ \",mManufacturerName=\" + mManufacturerName\n\t\t\t+ \",mProductName=\" + mProductName\n\t\t\t+ \",mSerialNumber=\" + mSerialNumber\n\t\t\t+ \",isExclude=\" + isExclude\n\t\t\t+ \"]\";\n\t}\n\n}\n"
  },
  {
    "path": "libuvccamera/src/main/java/com/serenegiant/usb/IButtonCallback.java",
    "content": "package com.serenegiant.usb;\n\npublic interface IButtonCallback {\n    void onButton(int button, int state);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/java/com/serenegiant/usb/IFrameCallback.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usb;\n\nimport java.nio.ByteBuffer;\n/**\n * Callback interface for UVCCamera class\n * If you need frame data as ByteBuffer, you can use this callback interface with UVCCamera#setFrameCallback\n */\npublic interface IFrameCallback {\n\t/**\n\t * This method is called from native library via JNI on the same thread as UVCCamera#startCapture.\n\t * You can use both UVCCamera#startCapture and #setFrameCallback\n\t * but it is better to use either for better performance.\n\t * You can also pass pixel format type to UVCCamera#setFrameCallback for this method.\n\t * Some frames may drops if this method takes a time.\n\t * When you use some color format like NV21, this library never execute color space conversion,\n\t * just execute pixel format conversion. If you want to get same result as on screen, please try to\n\t * consider to get images via texture(SurfaceTexture) and read pixel buffer from it using OpenGL|ES2/3\n\t * instead of using IFrameCallback(this way is much efficient in most case than using IFrameCallback).\n\t * @param frame this is direct ByteBuffer from JNI layer and you should handle it's byte order and limitation.\n\t */\n\tpublic void onFrame(ByteBuffer frame);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/java/com/serenegiant/usb/IStatusCallback.java",
    "content": "package com.serenegiant.usb;\n\nimport java.nio.ByteBuffer;\n\npublic interface IStatusCallback {\n    void onStatus(int statusClass, int event, int selector, int statusAttribute, ByteBuffer data);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/java/com/serenegiant/usb/Size.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usb;\n\nimport java.util.Locale;\n\nimport android.os.Parcel;\nimport android.os.Parcelable;\n\npublic class Size implements Parcelable {\n\t//\n\t/**\n\t * native側のuvc_raw_format_tの値, こっちは主にlibuvc用\n\t * 9999 is still image\n\t */\n\tpublic int type;\n\t/**\n\t * native側のraw_frame_tの値, androusb用,\n\t * libuvcは対応していない\n\t */\n\tpublic int frame_type;\n\tpublic int index;\n\tpublic int width;\n\tpublic int height;\n\tpublic int frameIntervalType;\n\tpublic int frameIntervalIndex;\n\tpublic int[] intervals;\n\t// ここ以下はframeIntervalTypeとintervalsから#updateFrameRateで計算する\n\tpublic float[] fps;\n\tprivate String frameRates;\n\n\t/**\n\t * コンストラクタ\n\t * @param _type native側のraw_format_tの値, ただし9999は静止画\n\t * @param _frame_type native側のraw_frame_tの値\n\t * @param _index\n\t * @param _width\n\t * @param _height\n\t */\n\tpublic Size(final int _type, final int _frame_type, final int _index, final int _width, final int _height) {\n\t\ttype = _type;\n\t\tframe_type = _frame_type;\n\t\tindex = _index;\n\t\twidth = _width;\n\t\theight = _height;\n\t\tframeIntervalType = -1;\n\t\tframeIntervalIndex = 0;\n\t\tintervals = null;\n\t\tupdateFrameRate();\n\t}\n\n\t/**\n\t * コンストラクタ\n\t * @param _type native側のraw_format_tの値, ただし9999は静止画\n\t * @param _frame_type native側のraw_frame_tの値\n\t * @param _index\n\t * @param _width\n\t * @param _height\n\t * @param _min_intervals\n\t * @param _max_intervals\n\t */\n\tpublic Size(final int _type, final int _frame_type, final int _index, final int _width, final int _height, final int _min_intervals, final int _max_intervals, final int _step) {\n\t\ttype = _type;\n\t\tframe_type = _frame_type;\n\t\tindex = _index;\n\t\twidth = _width;\n\t\theight = _height;\n\t\tframeIntervalType = 0;\n\t\tframeIntervalIndex = 0;\n\t\tintervals = new int[3];\n\t\tintervals[0] = _min_intervals;\n\t\tintervals[1] = _max_intervals;\n\t\tintervals[2] = _step;\n\t\tupdateFrameRate();\n\t}\n\n\t/**\n\t * コンストラクタ\n\t * @param _type native側のraw_format_tの値, ただし9999は静止画\n\t * @param _frame_type native側のraw_frame_tの値\n\t * @param _index\n\t * @param _width\n\t * @param _height\n     * @param _intervals\n     */\n\tpublic Size(final int _type, final int _frame_type, final int _index, final int _width, final int _height, final int[] _intervals) {\n\t\ttype = _type;\n\t\tframe_type = _frame_type;\n\t\tindex = _index;\n\t\twidth = _width;\n\t\theight = _height;\n\t\tfinal int n = _intervals != null ? _intervals.length : -1;\n\t\tif (n > 0) {\n\t\t\tframeIntervalType = n;\n\t\t\tintervals = new int[n];\n\t\t\tSystem.arraycopy(_intervals, 0, intervals, 0, n);\n\t\t} else {\n\t\t\tframeIntervalType = -1;\n\t\t\tintervals = null;\n\t\t}\n\t\tframeIntervalIndex = 0;\n\t\tupdateFrameRate();\n\t}\n\n\t/**\n\t * コピーコンストラクタ\n\t * @param other\n\t */\n\tpublic Size(final Size other) {\n\t\ttype = other.type;\n\t\tframe_type = other.frame_type;\n\t\tindex = other.index;\n\t\twidth = other.width;\n\t\theight = other.height;\n\t\tframeIntervalType = other.frameIntervalType;\n\t\tframeIntervalIndex = other.frameIntervalIndex;\n\t\tfinal int n = other.intervals != null ? other.intervals.length : -1;\n\t\tif (n > 0) {\n\t\t\tintervals = new int[n];\n\t\t\tSystem.arraycopy(other.intervals, 0, intervals, 0, n);\n\t\t} else {\n\t\t\tintervals = null;\n\t\t}\n\t\tupdateFrameRate();\n\t}\n\n\tprivate Size(final Parcel source) {\n\t\t// 読み取り順はwriteToParcelでの書き込み順と同じでないとダメ\n\t\ttype = source.readInt();\n\t\tframe_type = source.readInt();\n\t\tindex = source.readInt();\n\t\twidth = source.readInt();\n\t\theight = source.readInt();\n\t\tframeIntervalType = source.readInt();\n\t\tframeIntervalIndex = source.readInt();\n\t\tif (frameIntervalType >= 0) {\n\t\t\tif (frameIntervalType > 0) {\n\t\t\t\tintervals = new int[frameIntervalType];\n\t\t\t} else {\n\t\t\t\tintervals = new int[3];\n\t\t\t}\n\t\t\tsource.readIntArray(intervals);\n\t\t} else {\n\t\t\tintervals = null;\n\t\t}\n\t\tupdateFrameRate();\n\t}\n\n\tpublic Size set(final Size other) {\n\t\tif (other != null) {\n\t\t\ttype = other.type;\n\t\t\tframe_type = other.frame_type;\n\t\t\tindex = other.index;\n\t\t\twidth = other.width;\n\t\t\theight = other.height;\n\t\t\tframeIntervalType = other.frameIntervalType;\n\t\t\tframeIntervalIndex = other.frameIntervalIndex;\n\t\t\tfinal int n = other.intervals != null ? other.intervals.length : -1;\n\t\t\tif (n > 0) {\n\t\t\t\tintervals = new int[n];\n\t\t\t\tSystem.arraycopy(other.intervals, 0, intervals, 0, n);\n\t\t\t} else {\n\t\t\t\tintervals = null;\n\t\t\t}\n\t\t\tupdateFrameRate();\n\t\t}\n\t\treturn this;\n\t}\n\n\tpublic float getCurrentFrameRate() throws IllegalStateException {\n\t\tfinal int n = fps != null ? fps.length : 0;\n\t\tif ((frameIntervalIndex >= 0) && (frameIntervalIndex < n)) {\n\t\t\treturn fps[frameIntervalIndex];\n\t\t}\n\t\tthrow new IllegalStateException(\"unknown frame rate or not ready\");\n\t}\n\n\tpublic void setCurrentFrameRate(final float frameRate) {\n\t\t// 一番近いのを選ぶ\n\t\tint index = -1;\n\t\tfinal int n = fps != null ? fps.length : 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (fps[i] <= frameRate) {\n\t\t\t\tindex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tframeIntervalIndex = index;\n\t}\n\n\t@Override\n\tpublic int describeContents() {\n\t\treturn 0;\n\t}\n\n\t@Override\n\tpublic void writeToParcel(final Parcel dest, final int flags) {\n\t\tdest.writeInt(type);\n\t\tdest.writeInt(frame_type);\n\t\tdest.writeInt(index);\n\t\tdest.writeInt(width);\n\t\tdest.writeInt(height);\n\t\tdest.writeInt(frameIntervalType);\n\t\tdest.writeInt(frameIntervalIndex);\n\t\tif (intervals != null) {\n\t\t\tdest.writeIntArray(intervals);\n\t\t}\n\t}\n\n\tpublic void updateFrameRate() {\n\t\tfinal int n = frameIntervalType;\n\t\tif (n > 0) {\n\t\t\tfps = new float[n];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tfinal float _fps = fps[i] = 10000000.0f / intervals[i];\n\t\t\t}\n\t\t} else if (n == 0) {\n\t\t\ttry {\n\t\t\t\tfinal int min = Math.min(intervals[0], intervals[1]);\n\t\t\t\tfinal int max = Math.max(intervals[0], intervals[1]);\n\t\t\t\tfinal int step = intervals[2];\n\t\t\t\tif (step > 0) {\n\t\t\t\t\tint m = 0;\n\t\t\t\t\tfor (int i = min; i <= max; i+= step) { m++; }\n\t\t\t\t\tfps = new float[m];\n\t\t\t\t\tm = 0;\n\t\t\t\t\tfor (int i = min; i <= max; i+= step) {\n\t\t\t\t\t\tfinal float _fps = fps[m++] = 10000000.0f / i;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfinal float max_fps = 10000000.0f / min;\n\t\t\t\t\tint m = 0;\n\t\t\t\t\tfor (float fps = 10000000.0f / min; fps <= max_fps; fps += 1.0f) { m++; }\n\t\t\t\t\tfps = new float[m];\n\t\t\t\t\tm = 0;\n\t\t\t\t\tfor (float fps = 10000000.0f / min; fps <= max_fps; fps += 1.0f) {\n\t\t\t\t\t\tthis.fps[m++] = fps;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (final Exception e) {\n\t\t\t\t// ignore, なんでかminとmaxが0になってるんちゃうかな\n\t\t\t\tfps = null;\n\t\t\t}\n\t\t}\n\t\tfinal int m = fps != null ? fps.length : 0;\n\t\tfinal StringBuilder sb = new StringBuilder();\n\t\tsb.append(\"[\");\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tsb.append(String.format(Locale.US, \"%4.1f\", fps[i]));\n\t\t\tif (i < m-1) {\n\t\t\t\tsb.append(\",\");\n\t\t\t}\n\t\t}\n\t\tsb.append(\"]\");\n\t\tframeRates = sb.toString();\n\t\tif (frameIntervalIndex > m) {\n\t\t\tframeIntervalIndex = 0;\n\t\t}\n\t}\n\n\t@Override\n\tpublic String toString() {\n\t\tfloat frame_rate = 0.0f;\n\t\ttry {\n\t\t\tframe_rate = getCurrentFrameRate();\n\t\t} catch (final Exception e) {\n\t\t}\n\t\treturn String.format(Locale.US, \"Size(%dx%d@%4.1f,type:%d,frame:%d,index:%d,%s)\", width, height, frame_rate, type, frame_type, index, frameRates);\n\t}\n\n\tpublic static final Creator<Size> CREATOR = new Parcelable.Creator<Size>() {\n\t\t@Override\n\t\tpublic Size createFromParcel(final Parcel source) {\n\t\t\treturn new Size(source);\n\t\t}\n\t\t@Override\n\t\tpublic Size[] newArray(final int size) {\n\t\t\treturn new Size[size];\n\t\t}\n\t};\n}\n"
  },
  {
    "path": "libuvccamera/src/main/java/com/serenegiant/usb/USBMonitor.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usb;\n\nimport java.io.UnsupportedEncodingException;\nimport java.lang.ref.WeakReference;\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Locale;\nimport java.util.Set;\nimport java.util.concurrent.ConcurrentHashMap;\n\nimport android.annotation.SuppressLint;\nimport android.app.PendingIntent;\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.IntentFilter;\nimport android.hardware.usb.UsbDevice;\nimport android.hardware.usb.UsbDeviceConnection;\nimport android.hardware.usb.UsbInterface;\nimport android.hardware.usb.UsbManager;\nimport android.os.Handler;\nimport android.text.TextUtils;\nimport android.util.Log;\nimport android.util.SparseArray;\n\nimport com.serenegiant.utils.BuildCheck;\nimport com.serenegiant.utils.HandlerThreadHandler;\n\npublic final class USBMonitor {\n\n\tprivate static final boolean DEBUG = false;\t// TODO set false on production\n\tprivate static final String TAG = \"USBMonitor\";\n\n\tprivate static final String ACTION_USB_PERMISSION_BASE = \"com.serenegiant.USB_PERMISSION.\";\n\tprivate final String ACTION_USB_PERMISSION = ACTION_USB_PERMISSION_BASE + hashCode();\n\n\tpublic static final String ACTION_USB_DEVICE_ATTACHED = \"android.hardware.usb.action.USB_DEVICE_ATTACHED\";\n\n\t/**\n\t * openしているUsbControlBlock\n\t */\n\tprivate final ConcurrentHashMap<UsbDevice, UsbControlBlock> mCtrlBlocks = new ConcurrentHashMap<UsbDevice, UsbControlBlock>();\n\tprivate final SparseArray<WeakReference<UsbDevice>> mHasPermissions = new SparseArray<WeakReference<UsbDevice>>();\n\n\tprivate final WeakReference<Context> mWeakContext;\n\tprivate final UsbManager mUsbManager;\n\tprivate final OnDeviceConnectListener mOnDeviceConnectListener;\n\tprivate PendingIntent mPermissionIntent = null;\n\tprivate List<DeviceFilter> mDeviceFilters = new ArrayList<DeviceFilter>();\n\n\t/**\n\t * コールバックをワーカースレッドで呼び出すためのハンドラー\n\t */\n\tprivate final Handler mAsyncHandler;\n\tprivate volatile boolean destroyed;\n\t/**\n\t * USB機器の状態変更時のコールバックリスナー\n\t */\n\tpublic interface OnDeviceConnectListener {\n\t\t/**\n\t\t * called when device attached\n\t\t * @param device\n\t\t */\n\t\tpublic void onAttach(UsbDevice device);\n\t\t/**\n\t\t * called when device dettach(after onDisconnect)\n\t\t * @param device\n\t\t */\n\t\tpublic void onDettach(UsbDevice device);\n\t\t/**\n\t\t * called after device opend\n\t\t * @param device\n\t\t * @param ctrlBlock\n\t\t * @param createNew\n\t\t */\n\t\tpublic void onConnect(UsbDevice device, UsbControlBlock ctrlBlock, boolean createNew);\n\t\t/**\n\t\t * called when USB device removed or its power off (this callback is called after device closing)\n\t\t * @param device\n\t\t * @param ctrlBlock\n\t\t */\n\t\tpublic void onDisconnect(UsbDevice device, UsbControlBlock ctrlBlock);\n\t\t/**\n\t\t * called when canceled or could not get permission from user\n\t\t * @param device\n\t\t */\n\t\tpublic void onCancel(UsbDevice device);\n\t}\n\n\tpublic USBMonitor(final Context context, final OnDeviceConnectListener listener) {\n\t\tif (DEBUG) Log.v(TAG, \"USBMonitor:Constructor\");\n\t\tif (listener == null)\n\t\t\tthrow new IllegalArgumentException(\"OnDeviceConnectListener should not null.\");\n\t\tmWeakContext = new WeakReference<Context>(context);\n\t\tmUsbManager = (UsbManager)context.getSystemService(Context.USB_SERVICE);\n\t\tmOnDeviceConnectListener = listener;\n\t\tmAsyncHandler = HandlerThreadHandler.createHandler(TAG);\n\t\tdestroyed = false;\n\t\tif (DEBUG) Log.v(TAG, \"USBMonitor:mUsbManager=\" + mUsbManager);\n\t}\n\n\t/**\n\t * Release all related resources,\n\t * never reuse again\n\t */\n\tpublic void destroy() {\n\t\tif (DEBUG) Log.i(TAG, \"destroy:\");\n\t\tunregister();\n\t\tif (!destroyed) {\n\t\t\tdestroyed = true;\n\t\t\t// モニターしているUSB機器を全てcloseする\n\t\t\tfinal Set<UsbDevice> keys = mCtrlBlocks.keySet();\n\t\t\tif (keys != null) {\n\t\t\t\tUsbControlBlock ctrlBlock;\n\t\t\t\ttry {\n\t\t\t\t\tfor (final UsbDevice key: keys) {\n\t\t\t\t\t\tctrlBlock = mCtrlBlocks.remove(key);\n\t\t\t\t\t\tif (ctrlBlock != null) {\n\t\t\t\t\t\t\tctrlBlock.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tLog.e(TAG, \"destroy:\", e);\n\t\t\t\t}\n\t\t\t}\n\t\t\tmCtrlBlocks.clear();\n\t\t\ttry {\n\t\t\t\tmAsyncHandler.getLooper().quit();\n\t\t\t} catch (final Exception e) {\n\t\t\t\tLog.e(TAG, \"destroy:\", e);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * register BroadcastReceiver to monitor USB events\n\t * @throws IllegalStateException\n\t */\n\tpublic synchronized void register() throws IllegalStateException {\n\t\tif (destroyed) throw new IllegalStateException(\"already destroyed\");\n\t\tif (mPermissionIntent == null) {\n\t\t\tif (DEBUG) Log.i(TAG, \"register:\");\n\t\t\tfinal Context context = mWeakContext.get();\n\t\t\tif (context != null) {\n\t\t\t\tmPermissionIntent = PendingIntent.getBroadcast(context, 0, new Intent(ACTION_USB_PERMISSION), 0);\n\t\t\t\tfinal IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION);\n\t\t\t\t// ACTION_USB_DEVICE_ATTACHED never comes on some devices so it should not be added here\n\t\t\t\tfilter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);\n\t\t\t\tcontext.registerReceiver(mUsbReceiver, filter);\n\t\t\t}\n\t\t\t// start connection check\n\t\t\tmDeviceCounts = 0;\n\t\t\tmAsyncHandler.postDelayed(mDeviceCheckRunnable, 1000);\n\t\t}\n\t}\n\n\t/**\n\t * unregister BroadcastReceiver\n\t * @throws IllegalStateException\n\t */\n\tpublic synchronized void unregister() throws IllegalStateException {\n\t\t// 接続チェック用Runnableを削除\n\t\tmDeviceCounts = 0;\n\t\tif (!destroyed) {\n\t\t\tmAsyncHandler.removeCallbacks(mDeviceCheckRunnable);\n\t\t}\n\t\tif (mPermissionIntent != null) {\n//\t\t\tif (DEBUG) Log.i(TAG, \"unregister:\");\n\t\t\tfinal Context context = mWeakContext.get();\n\t\t\ttry {\n\t\t\t\tif (context != null) {\n\t\t\t\t\tcontext.unregisterReceiver(mUsbReceiver);\n\t\t\t\t}\n\t\t\t} catch (final Exception e) {\n\t\t\t\tLog.w(TAG, e);\n\t\t\t}\n\t\t\tmPermissionIntent = null;\n\t\t}\n\t}\n\n\tpublic synchronized boolean isRegistered() {\n\t\treturn !destroyed && (mPermissionIntent != null);\n\t}\n\n\t/**\n\t * set device filter\n\t * @param filter\n\t * @throws IllegalStateException\n\t */\n\tpublic void setDeviceFilter(final DeviceFilter filter) throws IllegalStateException {\n\t\tif (destroyed) throw new IllegalStateException(\"already destroyed\");\n\t\tmDeviceFilters.clear();\n\t\tmDeviceFilters.add(filter);\n\t}\n\n\t/**\n\t * デバイスフィルターを追加\n\t * @param filter\n\t * @throws IllegalStateException\n\t */\n\tpublic void addDeviceFilter(final DeviceFilter filter) throws IllegalStateException {\n\t\tif (destroyed) throw new IllegalStateException(\"already destroyed\");\n\t\tmDeviceFilters.add(filter);\n\t}\n\n\t/**\n\t * デバイスフィルターを削除\n\t * @param filter\n\t * @throws IllegalStateException\n\t */\n\tpublic void removeDeviceFilter(final DeviceFilter filter) throws IllegalStateException {\n\t\tif (destroyed) throw new IllegalStateException(\"already destroyed\");\n\t\tmDeviceFilters.remove(filter);\n\t}\n\n\t/**\n\t * set device filters\n\t * @param filters\n\t * @throws IllegalStateException\n\t */\n\tpublic void setDeviceFilter(final List<DeviceFilter> filters) throws IllegalStateException {\n\t\tif (destroyed) throw new IllegalStateException(\"already destroyed\");\n\t\tmDeviceFilters.clear();\n\t\tmDeviceFilters.addAll(filters);\n\t}\n\n\t/**\n\t * add device filters\n\t * @param filters\n\t * @throws IllegalStateException\n\t */\n\tpublic void addDeviceFilter(final List<DeviceFilter> filters) throws IllegalStateException {\n\t\tif (destroyed) throw new IllegalStateException(\"already destroyed\");\n\t\tmDeviceFilters.addAll(filters);\n\t}\n\n\t/**\n\t * remove device filters\n\t * @param filters\n\t */\n\tpublic void removeDeviceFilter(final List<DeviceFilter> filters) throws IllegalStateException {\n\t\tif (destroyed) throw new IllegalStateException(\"already destroyed\");\n\t\tmDeviceFilters.removeAll(filters);\n\t}\n\n\t/**\n\t * return the number of connected USB devices that matched device filter\n\t * @return\n\t * @throws IllegalStateException\n\t */\n\tpublic int getDeviceCount() throws IllegalStateException {\n\t\tif (destroyed) throw new IllegalStateException(\"already destroyed\");\n\t\treturn getDeviceList().size();\n\t}\n\n\t/**\n\t * return device list, return empty list if no device matched\n\t * @return\n\t * @throws IllegalStateException\n\t */\n\tpublic List<UsbDevice> getDeviceList() throws IllegalStateException {\n\t\tif (destroyed) throw new IllegalStateException(\"already destroyed\");\n\t\treturn getDeviceList(mDeviceFilters);\n\t}\n\n\t/**\n\t * return device list, return empty list if no device matched\n\t * @param filters\n\t * @return\n\t * @throws IllegalStateException\n\t */\n\tpublic List<UsbDevice> getDeviceList(final List<DeviceFilter> filters) throws IllegalStateException {\n\t\tif (destroyed) throw new IllegalStateException(\"already destroyed\");\n\t\tfinal HashMap<String, UsbDevice> deviceList = mUsbManager.getDeviceList();\n\t\tfinal List<UsbDevice> result = new ArrayList<UsbDevice>();\n\t\tif (deviceList != null) {\n\t\t\tif ((filters == null) || filters.isEmpty()) {\n\t\t\t\tresult.addAll(deviceList.values());\n\t\t\t} else {\n\t\t\t\tfor (final UsbDevice device: deviceList.values() ) {\n\t\t\t\t\tfor (final DeviceFilter filter: filters) {\n\t\t\t\t\t\tif ((filter != null) && filter.matches(device)) {\n\t\t\t\t\t\t\t// when filter matches\n\t\t\t\t\t\t\tif (!filter.isExclude) {\n\t\t\t\t\t\t\t\tresult.add(device);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * return device list, return empty list if no device matched\n\t * @param filter\n\t * @return\n\t * @throws IllegalStateException\n\t */\n\tpublic List<UsbDevice> getDeviceList(final DeviceFilter filter) throws IllegalStateException {\n\t\tif (destroyed) throw new IllegalStateException(\"already destroyed\");\n\t\tfinal HashMap<String, UsbDevice> deviceList = mUsbManager.getDeviceList();\n\t\tfinal List<UsbDevice> result = new ArrayList<UsbDevice>();\n\t\tif (deviceList != null) {\n\t\t\tfor (final UsbDevice device: deviceList.values() ) {\n\t\t\t\tif ((filter == null) || (filter.matches(device) && !filter.isExclude)) {\n\t\t\t\t\tresult.add(device);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * get USB device list, without filter\n\t * @return\n\t * @throws IllegalStateException\n\t */\n\tpublic Iterator<UsbDevice> getDevices() throws IllegalStateException {\n\t\tif (destroyed) throw new IllegalStateException(\"already destroyed\");\n\t\tIterator<UsbDevice> iterator = null;\n\t\tfinal HashMap<String, UsbDevice> list = mUsbManager.getDeviceList();\n\t\tif (list != null)\n\t\t\titerator = list.values().iterator();\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * output device list to LogCat\n\t */\n\tpublic final void dumpDevices() {\n\t\tfinal HashMap<String, UsbDevice> list = mUsbManager.getDeviceList();\n\t\tif (list != null) {\n\t\t\tfinal Set<String> keys = list.keySet();\n\t\t\tif (keys != null && keys.size() > 0) {\n\t\t\t\tfinal StringBuilder sb = new StringBuilder();\n\t\t\t\tfor (final String key: keys) {\n\t\t\t\t\tfinal UsbDevice device = list.get(key);\n\t\t\t\t\tfinal int num_interface = device != null ? device.getInterfaceCount() : 0;\n\t\t\t\t\tsb.setLength(0);\n\t\t\t\t\tfor (int i = 0; i < num_interface; i++) {\n\t\t\t\t\t\tsb.append(String.format(Locale.US, \"interface%d:%s\", i, device.getInterface(i).toString()));\n\t\t\t\t\t}\n\t\t\t\t\tLog.i(TAG, \"key=\" + key + \":\" + device + \":\" + sb.toString());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tLog.i(TAG, \"no device\");\n\t\t\t}\n\t\t} else {\n\t\t\tLog.i(TAG, \"no device\");\n\t\t}\n\t}\n\n\t/**\n\t * return whether the specific Usb device has permission\n\t * @param device\n\t * @return true: 指定したUsbDeviceにパーミッションがある\n\t * @throws IllegalStateException\n\t */\n\tpublic final boolean hasPermission(final UsbDevice device) throws IllegalStateException {\n\t\tif (destroyed) throw new IllegalStateException(\"already destroyed\");\n\t\treturn updatePermission(device, device != null && mUsbManager.hasPermission(device));\n\t}\n\n\t/**\n\t * 内部で保持しているパーミッション状態を更新\n\t * @param device\n\t * @param hasPermission\n\t * @return hasPermission\n\t */\n\tprivate boolean updatePermission(final UsbDevice device, final boolean hasPermission) {\n\t\tfinal int deviceKey = getDeviceKey(device, true);\n\t\tsynchronized (mHasPermissions) {\n\t\t\tif (hasPermission) {\n\t\t\t\tif (mHasPermissions.get(deviceKey) == null) {\n\t\t\t\t\tmHasPermissions.put(deviceKey, new WeakReference<UsbDevice>(device));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmHasPermissions.remove(deviceKey);\n\t\t\t}\n\t\t}\n\t\treturn hasPermission;\n\t}\n\n\t/**\n\t * request permission to access to USB device\n\t * @param device\n\t * @return true if fail to request permission\n\t */\n\tpublic synchronized boolean requestPermission(final UsbDevice device) {\n//\t\tif (DEBUG) Log.v(TAG, \"requestPermission:device=\" + device);\n\t\tboolean result = false;\n\t\tif (isRegistered()) {\n\t\t\tif (device != null) {\n\t\t\t\tif (mUsbManager.hasPermission(device)) {\n\t\t\t\t\t// call onConnect if app already has permission\n\t\t\t\t\tprocessConnect(device);\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// パーミッションがなければ要求する\n\t\t\t\t\t\tmUsbManager.requestPermission(device, mPermissionIntent);\n\t\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\t\t// Android5.1.xのGALAXY系でandroid.permission.sec.MDM_APP_MGMTという意味不明の例外生成するみたい\n\t\t\t\t\t\tLog.w(TAG, e);\n\t\t\t\t\t\tprocessCancel(device);\n\t\t\t\t\t\tresult = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tprocessCancel(device);\n\t\t\t\tresult = true;\n\t\t\t}\n\t\t} else {\n\t\t\tprocessCancel(device);\n\t\t\tresult = true;\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * 指定したUsbDeviceをopenする\n\t * @param device\n\t * @return\n\t * @throws SecurityException パーミッションがなければSecurityExceptionを投げる\n\t */\n\tpublic UsbControlBlock openDevice(final UsbDevice device) throws SecurityException {\n\t\tif (hasPermission(device)) {\n\t\t\tUsbControlBlock result = mCtrlBlocks.get(device);\n\t\t\tif (result == null) {\n\t\t\t\tresult = new UsbControlBlock(USBMonitor.this, device);    // この中でopenDeviceする\n\t\t\t\tmCtrlBlocks.put(device, result);\n\t\t\t}\n\t\t\treturn result;\n\t\t} else {\n\t\t\tthrow new SecurityException(\"has no permission\");\n\t\t}\n\t}\n\n\t/**\n\t * BroadcastReceiver for USB permission\n\t */\n\tprivate final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() {\n\n\t\t@Override\n\t\tpublic void onReceive(final Context context, final Intent intent) {\n\t\t\tif (destroyed) return;\n\t\t\tfinal String action = intent.getAction();\n\t\t\tif (ACTION_USB_PERMISSION.equals(action)) {\n\t\t\t\t// when received the result of requesting USB permission\n\t\t\t\tsynchronized (USBMonitor.this) {\n\t\t\t\t\tfinal UsbDevice device = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);\n\t\t\t\t\tif (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) {\n\t\t\t\t\t\tif (device != null) {\n\t\t\t\t\t\t\t// get permission, call onConnect\n\t\t\t\t\t\t\tprocessConnect(device);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// failed to get permission\n\t\t\t\t\t\tprocessCancel(device);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (UsbManager.ACTION_USB_DEVICE_ATTACHED.equals(action)) {\n\t\t\t\tfinal UsbDevice device = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);\n\t\t\t\tupdatePermission(device, hasPermission(device));\n\t\t\t\tprocessAttach(device);\n\t\t\t} else if (UsbManager.ACTION_USB_DEVICE_DETACHED.equals(action)) {\n\t\t\t\t// when device removed\n\t\t\t\tfinal UsbDevice device = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);\n\t\t\t\tif (device != null) {\n\t\t\t\t\tUsbControlBlock ctrlBlock = mCtrlBlocks.remove(device);\n\t\t\t\t\tif (ctrlBlock != null) {\n\t\t\t\t\t\t// cleanup\n\t\t\t\t\t\tctrlBlock.close();\n\t\t\t\t\t}\n\t\t\t\t\tmDeviceCounts = 0;\n\t\t\t\t\tprocessDettach(device);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t/** number of connected & detected devices */\n\tprivate volatile int mDeviceCounts = 0;\n\t/**\n\t * periodically check connected devices and if it changed, call onAttach\n\t */\n\tprivate final Runnable mDeviceCheckRunnable = new Runnable() {\n\t\t@Override\n\t\tpublic void run() {\n\t\t\tif (destroyed) return;\n\t\t\tfinal List<UsbDevice> devices = getDeviceList();\n\t\t\tfinal int n = devices.size();\n\t\t\tfinal int hasPermissionCounts;\n\t\t\tfinal int m;\n\t\t\tsynchronized (mHasPermissions) {\n\t\t\t\thasPermissionCounts = mHasPermissions.size();\n\t\t\t\tmHasPermissions.clear();\n\t\t\t\tfor (final UsbDevice device: devices) {\n\t\t\t\t\thasPermission(device);\n\t\t\t\t}\n\t\t\t\tm = mHasPermissions.size();\n\t\t\t}\n\t\t\tif ((n > mDeviceCounts) || (m > hasPermissionCounts)) {\n\t\t\t\tmDeviceCounts = n;\n\t\t\t\tif (mOnDeviceConnectListener != null) {\n\t\t\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\t\t\tfinal UsbDevice device = devices.get(i);\n\t\t\t\t\t\tmAsyncHandler.post(new Runnable() {\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tmOnDeviceConnectListener.onAttach(device);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tmAsyncHandler.postDelayed(this, 2000);\t// confirm every 2 seconds\n\t\t}\n\t};\n\n\t/**\n\t * open specific USB device\n\t * @param device\n\t */\n\tprivate final void processConnect(final UsbDevice device) {\n\t\tif (destroyed) return;\n\t\tupdatePermission(device, true);\n\t\tmAsyncHandler.post(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tif (DEBUG) Log.v(TAG, \"processConnect:device=\" + device);\n\t\t\t\tUsbControlBlock ctrlBlock;\n\t\t\t\tfinal boolean createNew;\n\t\t\t\tctrlBlock = mCtrlBlocks.get(device);\n\t\t\t\tif (ctrlBlock == null) {\n\t\t\t\t\tctrlBlock = new UsbControlBlock(USBMonitor.this, device);\n\t\t\t\t\tmCtrlBlocks.put(device, ctrlBlock);\n\t\t\t\t\tcreateNew = true;\n\t\t\t\t} else {\n\t\t\t\t\tcreateNew = false;\n\t\t\t\t}\n\t\t\t\tif (mOnDeviceConnectListener != null) {\n\t\t\t\t\tmOnDeviceConnectListener.onConnect(device, ctrlBlock, createNew);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate final void processCancel(final UsbDevice device) {\n\t\tif (destroyed) return;\n\t\tif (DEBUG) Log.v(TAG, \"processCancel:\");\n\t\tupdatePermission(device, false);\n\t\tif (mOnDeviceConnectListener != null) {\n\t\t\tmAsyncHandler.post(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tmOnDeviceConnectListener.onCancel(device);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate final void processAttach(final UsbDevice device) {\n\t\tif (destroyed) return;\n\t\tif (DEBUG) Log.v(TAG, \"processAttach:\");\n\t\tif (mOnDeviceConnectListener != null) {\n\t\t\tmAsyncHandler.post(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tmOnDeviceConnectListener.onAttach(device);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate final void processDettach(final UsbDevice device) {\n\t\tif (destroyed) return;\n\t\tif (DEBUG) Log.v(TAG, \"processDettach:\");\n\t\tif (mOnDeviceConnectListener != null) {\n\t\t\tmAsyncHandler.post(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tmOnDeviceConnectListener.onDettach(device);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * USB機器毎の設定保存用にデバイスキー名を生成する。\n\t * ベンダーID, プロダクトID, デバイスクラス, デバイスサブクラス, デバイスプロトコルから生成\n\t * 同種の製品だと同じキー名になるので注意\n\t * @param device nullなら空文字列を返す\n\t * @return\n\t */\n\tpublic static final String getDeviceKeyName(final UsbDevice device) {\n\t\treturn getDeviceKeyName(device, null, false);\n\t}\n\n\t/**\n\t * USB機器毎の設定保存用にデバイスキー名を生成する。\n\t * useNewAPI=falseで同種の製品だと同じデバイスキーになるので注意\n\t * @param device\n\t * @param useNewAPI\n\t * @return\n\t */\n\tpublic static final String getDeviceKeyName(final UsbDevice device, final boolean useNewAPI) {\n\t\treturn getDeviceKeyName(device, null, useNewAPI);\n\t}\n\t/**\n\t * USB機器毎の設定保存用にデバイスキー名を生成する。この機器名をHashMapのキーにする\n\t * UsbDeviceがopenしている時のみ有効\n\t * ベンダーID, プロダクトID, デバイスクラス, デバイスサブクラス, デバイスプロトコルから生成\n\t * serialがnullや空文字でなければserialを含めたデバイスキー名を生成する\n\t * useNewAPI=trueでAPIレベルを満たしていればマニュファクチャ名, バージョン, コンフィギュレーションカウントも使う\n\t * @param device nullなら空文字列を返す\n\t * @param serial\tUsbDeviceConnection#getSerialで取得したシリアル番号を渡す, nullでuseNewAPI=trueでAPI>=21なら内部で取得\n\t * @param useNewAPI API>=21またはAPI>=23のみで使用可能なメソッドも使用する(ただし機器によってはnullが返ってくるので有効かどうかは機器による)\n\t * @return\n\t */\n\t@SuppressLint(\"NewApi\")\n\tpublic static final String getDeviceKeyName(final UsbDevice device, final String serial, final boolean useNewAPI) {\n\t\tif (device == null) return \"\";\n\t\tfinal StringBuilder sb = new StringBuilder();\n\t\tsb.append(device.getVendorId());\t\t\tsb.append(\"#\");\t// API >= 12\n\t\tsb.append(device.getProductId());\t\t\tsb.append(\"#\");\t// API >= 12\n\t\tsb.append(device.getDeviceClass());\t\t\tsb.append(\"#\");\t// API >= 12\n\t\tsb.append(device.getDeviceSubclass());\t\tsb.append(\"#\");\t// API >= 12\n\t\tsb.append(device.getDeviceProtocol());\t\t\t\t\t\t// API >= 12\n\t\tif (!TextUtils.isEmpty(serial)) {\n\t\t\tsb.append(\"#\");\tsb.append(serial);\n\t\t}\n\t\tif (useNewAPI && BuildCheck.isAndroid5()) {\n\t\t\tsb.append(\"#\");\n\t\t\tif (TextUtils.isEmpty(serial)) {\n\t\t\t\tsb.append(device.getSerialNumber());\tsb.append(\"#\");\t// API >= 21\n\t\t\t}\n\t\t\tsb.append(device.getManufacturerName());\tsb.append(\"#\");\t// API >= 21\n\t\t\tsb.append(device.getConfigurationCount());\tsb.append(\"#\");\t// API >= 21\n\t\t\tif (BuildCheck.isMarshmallow()) {\n\t\t\t\tsb.append(device.getVersion());\t\t\tsb.append(\"#\");\t// API >= 23\n\t\t\t}\n\t\t}\n//\t\tif (DEBUG) Log.v(TAG, \"getDeviceKeyName:\" + sb.toString());\n\t\treturn sb.toString();\n\t}\n\n\t/**\n\t * デバイスキーを整数として取得\n\t * getDeviceKeyNameで得られる文字列のhasCodeを取得\n\t * ベンダーID, プロダクトID, デバイスクラス, デバイスサブクラス, デバイスプロトコルから生成\n\t * 同種の製品だと同じデバイスキーになるので注意\n\t * @param device nullなら0を返す\n\t * @return\n\t */\n\tpublic static final int getDeviceKey(final UsbDevice device) {\n\t\treturn device != null ? getDeviceKeyName(device, null, false).hashCode() : 0;\n\t}\n\n\t/**\n\t * デバイスキーを整数として取得\n\t * getDeviceKeyNameで得られる文字列のhasCodeを取得\n\t * useNewAPI=falseで同種の製品だと同じデバイスキーになるので注意\n\t * @param device\n\t * @param useNewAPI\n\t * @return\n\t */\n\tpublic static final int getDeviceKey(final UsbDevice device, final boolean useNewAPI) {\n\t\treturn device != null ? getDeviceKeyName(device, null, useNewAPI).hashCode() : 0;\n\t}\n\n\t/**\n\t * デバイスキーを整数として取得\n\t * getDeviceKeyNameで得られる文字列のhasCodeを取得\n\t * serialがnullでuseNewAPI=falseで同種の製品だと同じデバイスキーになるので注意\n\t * @param device nullなら0を返す\n\t * @param serial UsbDeviceConnection#getSerialで取得したシリアル番号を渡す, nullでuseNewAPI=trueでAPI>=21なら内部で取得\n\t * @param useNewAPI API>=21またはAPI>=23のみで使用可能なメソッドも使用する(ただし機器によってはnullが返ってくるので有効かどうかは機器による)\n\t * @return\n\t */\n\tpublic static final int getDeviceKey(final UsbDevice device, final String serial, final boolean useNewAPI) {\n\t\treturn device != null ? getDeviceKeyName(device, serial, useNewAPI).hashCode() : 0;\n\t}\n\n\tpublic static class UsbDeviceInfo {\n\t\tpublic String usb_version;\n\t\tpublic String manufacturer;\n\t\tpublic String product;\n\t\tpublic String version;\n\t\tpublic String serial;\n\n\t\tprivate void clear() {\n\t\t\tusb_version = manufacturer = product = version = serial = null;\n\t\t}\n\n\t\t@Override\n\t\tpublic String toString() {\n\t\t\treturn String.format(\"UsbDevice:usb_version=%s,manufacturer=%s,product=%s,version=%s,serial=%s\",\n\t\t\t\tusb_version != null ? usb_version : \"\",\n\t\t\t\tmanufacturer != null ? manufacturer : \"\",\n\t\t\t\tproduct != null ? product : \"\",\n\t\t\t\tversion != null ? version : \"\",\n\t\t\t\tserial != null ? serial : \"\");\n\t\t}\n\t}\n\n\tprivate static final int USB_DIR_OUT = 0;\n\tprivate static final int USB_DIR_IN = 0x80;\n\tprivate static final int USB_TYPE_MASK = (0x03 << 5);\n\tprivate static final int USB_TYPE_STANDARD = (0x00 << 5);\n\tprivate static final int USB_TYPE_CLASS = (0x01 << 5);\n\tprivate static final int USB_TYPE_VENDOR = (0x02 << 5);\n\tprivate static final int USB_TYPE_RESERVED = (0x03 << 5);\n\tprivate static final int USB_RECIP_MASK = 0x1f;\n\tprivate static final int USB_RECIP_DEVICE = 0x00;\n\tprivate static final int USB_RECIP_INTERFACE = 0x01;\n\tprivate static final int USB_RECIP_ENDPOINT = 0x02;\n\tprivate static final int USB_RECIP_OTHER = 0x03;\n\tprivate static final int USB_RECIP_PORT = 0x04;\n\tprivate static final int USB_RECIP_RPIPE = 0x05;\n\tprivate static final int USB_REQ_GET_STATUS = 0x00;\n\tprivate static final int USB_REQ_CLEAR_FEATURE = 0x01;\n\tprivate static final int USB_REQ_SET_FEATURE = 0x03;\n\tprivate static final int USB_REQ_SET_ADDRESS = 0x05;\n\tprivate static final int USB_REQ_GET_DESCRIPTOR = 0x06;\n\tprivate static final int USB_REQ_SET_DESCRIPTOR = 0x07;\n\tprivate static final int USB_REQ_GET_CONFIGURATION = 0x08;\n\tprivate static final int USB_REQ_SET_CONFIGURATION = 0x09;\n\tprivate static final int USB_REQ_GET_INTERFACE = 0x0A;\n\tprivate static final int USB_REQ_SET_INTERFACE = 0x0B;\n\tprivate static final int USB_REQ_SYNCH_FRAME = 0x0C;\n\tprivate static final int USB_REQ_SET_SEL = 0x30;\n\tprivate static final int USB_REQ_SET_ISOCH_DELAY = 0x31;\n\tprivate static final int USB_REQ_SET_ENCRYPTION = 0x0D;\n\tprivate static final int USB_REQ_GET_ENCRYPTION = 0x0E;\n\tprivate static final int USB_REQ_RPIPE_ABORT = 0x0E;\n\tprivate static final int USB_REQ_SET_HANDSHAKE = 0x0F;\n\tprivate static final int USB_REQ_RPIPE_RESET = 0x0F;\n\tprivate static final int USB_REQ_GET_HANDSHAKE = 0x10;\n\tprivate static final int USB_REQ_SET_CONNECTION = 0x11;\n\tprivate static final int USB_REQ_SET_SECURITY_DATA = 0x12;\n\tprivate static final int USB_REQ_GET_SECURITY_DATA = 0x13;\n\tprivate static final int USB_REQ_SET_WUSB_DATA = 0x14;\n\tprivate static final int USB_REQ_LOOPBACK_DATA_WRITE = 0x15;\n\tprivate static final int USB_REQ_LOOPBACK_DATA_READ = 0x16;\n\tprivate static final int USB_REQ_SET_INTERFACE_DS = 0x17;\n\n\tprivate static final int USB_REQ_STANDARD_DEVICE_SET = (USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE);\t\t// 0x10\n\tprivate static final int USB_REQ_STANDARD_DEVICE_GET = (USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE);\t\t\t// 0x90\n\tprivate static final int USB_REQ_STANDARD_INTERFACE_SET = (USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_INTERFACE);\t// 0x11\n\tprivate static final int USB_REQ_STANDARD_INTERFACE_GET = (USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE);\t// 0x91\n\tprivate static final int USB_REQ_STANDARD_ENDPOINT_SET = (USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT);\t// 0x12\n\tprivate static final int USB_REQ_STANDARD_ENDPOINT_GET = (USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_ENDPOINT);\t\t// 0x92\n\n\tprivate static final int USB_REQ_CS_DEVICE_SET  = (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_DEVICE);\t\t\t\t// 0x20\n\tprivate static final int USB_REQ_CS_DEVICE_GET = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_DEVICE);\t\t\t\t\t// 0xa0\n\tprivate static final int USB_REQ_CS_INTERFACE_SET = (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE);\t\t\t// 0x21\n\tprivate static final int USB_REQ_CS_INTERFACE_GET = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE);\t\t\t// 0xa1\n\tprivate static final int USB_REQ_CS_ENDPOINT_SET = (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_ENDPOINT);\t\t\t\t// 0x22\n\tprivate static final int USB_REQ_CS_ENDPOINT_GET = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_ENDPOINT);\t\t\t\t// 0xa2\n\n\tprivate static final int USB_REQ_VENDER_DEVICE_SET = (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_DEVICE);\t\t\t\t// 0x40\n\tprivate static final int USB_REQ_VENDER_DEVICE_GET = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_DEVICE);\t\t\t\t// 0xc0\n\tprivate static final int USB_REQ_VENDER_INTERFACE_SET = (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE);\t\t// 0x41\n\tprivate static final int USB_REQ_VENDER_INTERFACE_GET = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE);\t\t// 0xc1\n\tprivate static final int USB_REQ_VENDER_ENDPOINT_SET = (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_ENDPOINT);\t\t\t// 0x42\n\tprivate static final int USB_REQ_VENDER_ENDPOINT_GET = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_ENDPOINT);\t\t\t// 0xc2\n\n\tprivate static final int USB_DT_DEVICE = 0x01;\n\tprivate static final int USB_DT_CONFIG = 0x02;\n\tprivate static final int USB_DT_STRING = 0x03;\n\tprivate static final int USB_DT_INTERFACE = 0x04;\n\tprivate static final int USB_DT_ENDPOINT = 0x05;\n\tprivate static final int USB_DT_DEVICE_QUALIFIER = 0x06;\n\tprivate static final int USB_DT_OTHER_SPEED_CONFIG = 0x07;\n\tprivate static final int USB_DT_INTERFACE_POWER = 0x08;\n\tprivate static final int USB_DT_OTG = 0x09;\n\tprivate static final int USB_DT_DEBUG = 0x0a;\n\tprivate static final int USB_DT_INTERFACE_ASSOCIATION = 0x0b;\n\tprivate static final int USB_DT_SECURITY = 0x0c;\n\tprivate static final int USB_DT_KEY = 0x0d;\n\tprivate static final int USB_DT_ENCRYPTION_TYPE = 0x0e;\n\tprivate static final int USB_DT_BOS = 0x0f;\n\tprivate static final int USB_DT_DEVICE_CAPABILITY = 0x10;\n\tprivate static final int USB_DT_WIRELESS_ENDPOINT_COMP = 0x11;\n\tprivate static final int USB_DT_WIRE_ADAPTER = 0x21;\n\tprivate static final int USB_DT_RPIPE = 0x22;\n\tprivate static final int USB_DT_CS_RADIO_CONTROL = 0x23;\n\tprivate static final int USB_DT_PIPE_USAGE = 0x24;\n\tprivate static final int USB_DT_SS_ENDPOINT_COMP = 0x30;\n\tprivate static final int USB_DT_CS_DEVICE = (USB_TYPE_CLASS | USB_DT_DEVICE);\n\tprivate static final int USB_DT_CS_CONFIG = (USB_TYPE_CLASS | USB_DT_CONFIG);\n\tprivate static final int USB_DT_CS_STRING = (USB_TYPE_CLASS | USB_DT_STRING);\n\tprivate static final int USB_DT_CS_INTERFACE = (USB_TYPE_CLASS | USB_DT_INTERFACE);\n\tprivate static final int USB_DT_CS_ENDPOINT = (USB_TYPE_CLASS | USB_DT_ENDPOINT);\n\tprivate static final int USB_DT_DEVICE_SIZE = 18;\n\n\t/**\n\t * 指定したIDのStringディスクリプタから文字列を取得する。取得できなければnull\n\t * @param connection\n\t * @param id\n\t * @param languageCount\n\t * @param languages\n\t * @return\n\t */\n\tprivate static String getString(final UsbDeviceConnection connection, final int id, final int languageCount, final byte[] languages) {\n\t\tfinal byte[] work = new byte[256];\n\t\tString result = null;\n\t\tfor (int i = 1; i <= languageCount; i++) {\n\t\t\tint ret = connection.controlTransfer(\n\t\t\t\tUSB_REQ_STANDARD_DEVICE_GET, // USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE\n\t\t\t\tUSB_REQ_GET_DESCRIPTOR,\n\t\t\t\t(USB_DT_STRING << 8) | id, languages[i], work, 256, 0);\n\t\t\tif ((ret > 2) && (work[0] == ret) && (work[1] == USB_DT_STRING)) {\n\t\t\t\t// skip first two bytes(bLength & bDescriptorType), and copy the rest to the string\n\t\t\t\ttry {\n\t\t\t\t\tresult = new String(work, 2, ret - 2, \"UTF-16LE\");\n\t\t\t\t\tif (!\"Љ\".equals(result)) {\t// 変なゴミが返ってくる時がある\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = null;\n\t\t\t\t\t}\n\t\t\t\t} catch (final UnsupportedEncodingException e) {\n\t\t\t\t\t// ignore\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * ベンダー名・製品名・バージョン・シリアルを取得する\n\t * @param device\n\t * @return\n\t */\n\tpublic UsbDeviceInfo getDeviceInfo(final UsbDevice device) {\n\t\treturn updateDeviceInfo(mUsbManager, device, null);\n\t}\n\n\t/**\n\t * ベンダー名・製品名・バージョン・シリアルを取得する\n\t * #updateDeviceInfo(final UsbManager, final UsbDevice, final UsbDeviceInfo)のヘルパーメソッド\n\t * @param context\n\t * @param device\n\t * @return\n\t */\n\tpublic static UsbDeviceInfo getDeviceInfo(final Context context, final UsbDevice device) {\n\t\treturn updateDeviceInfo((UsbManager)context.getSystemService(Context.USB_SERVICE), device, new UsbDeviceInfo());\n\t}\n\n\t/**\n\t * ベンダー名・製品名・バージョン・シリアルを取得する\n\t * @param manager\n\t * @param device\n\t * @param _info\n\t * @return\n\t */\n\tpublic static UsbDeviceInfo updateDeviceInfo(final UsbManager manager, final UsbDevice device, final UsbDeviceInfo _info) {\n\t\tfinal UsbDeviceInfo info = _info != null ? _info : new UsbDeviceInfo();\n\t\tinfo.clear();\n\n\t\tif (device != null) {\n\t\t\tif (BuildCheck.isLollipop()) {\n\t\t\t\tinfo.manufacturer = device.getManufacturerName();\n\t\t\t\tinfo.product = device.getProductName();\n\t\t\t\tinfo.serial = device.getSerialNumber();\n\t\t\t}\n\t\t\tif (BuildCheck.isMarshmallow()) {\n\t\t\t\tinfo.usb_version = device.getVersion();\n\t\t\t}\n\t\t\tif ((manager != null) && manager.hasPermission(device)) {\n\t\t\t\tfinal UsbDeviceConnection connection = manager.openDevice(device);\n\t\t\t\tfinal byte[] desc = connection.getRawDescriptors();\n\n\t\t\t\tif (TextUtils.isEmpty(info.usb_version)) {\n\t\t\t\t\tinfo.usb_version = String.format(\"%x.%02x\", ((int)desc[3] & 0xff), ((int)desc[2] & 0xff));\n\t\t\t\t}\n\t\t\t\tif (TextUtils.isEmpty(info.version)) {\n\t\t\t\t\tinfo.version = String.format(\"%x.%02x\", ((int)desc[13] & 0xff), ((int)desc[12] & 0xff));\n\t\t\t\t}\n\t\t\t\tif (TextUtils.isEmpty(info.serial)) {\n\t\t\t\t\tinfo.serial = connection.getSerial();\n\t\t\t\t}\n\n\t\t\t\tfinal byte[] languages = new byte[256];\n\t\t\t\tint languageCount = 0;\n\t\t\t\t// controlTransfer(int requestType, int request, int value, int index, byte[] buffer, int length, int timeout)\n\t\t\t\ttry {\n\t\t\t\t\tint result = connection.controlTransfer(\n\t\t\t\t\t\tUSB_REQ_STANDARD_DEVICE_GET, // USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE\n\t    \t\t\t\tUSB_REQ_GET_DESCRIPTOR,\n\t    \t\t\t\t(USB_DT_STRING << 8) | 0, 0, languages, 256, 0);\n\t\t\t\t\tif (result > 0) {\n\t        \t\t\tlanguageCount = (result - 2) / 2;\n\t\t\t\t\t}\n\t\t\t\t\tif (languageCount > 0) {\n\t\t\t\t\t\tif (TextUtils.isEmpty(info.manufacturer)) {\n\t\t\t\t\t\t\tinfo.manufacturer = getString(connection, desc[14], languageCount, languages);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (TextUtils.isEmpty(info.product)) {\n\t\t\t\t\t\t\tinfo.product = getString(connection, desc[15], languageCount, languages);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (TextUtils.isEmpty(info.serial)) {\n\t\t\t\t\t\t\tinfo.serial = getString(connection, desc[16], languageCount, languages);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tconnection.close();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (TextUtils.isEmpty(info.manufacturer)) {\n\t\t\t\tinfo.manufacturer = USBVendorId.vendorName(device.getVendorId());\n\t\t\t}\n\t\t\tif (TextUtils.isEmpty(info.manufacturer)) {\n\t\t\t\tinfo.manufacturer = String.format(\"%04x\", device.getVendorId());\n\t\t\t}\n\t\t\tif (TextUtils.isEmpty(info.product)) {\n\t\t\t\tinfo.product = String.format(\"%04x\", device.getProductId());\n\t\t\t}\n\t\t}\n\t\treturn info;\n\t}\n\n\t/**\n\t * control class\n\t * never reuse the instance when it closed\n\t */\n\tpublic static final class UsbControlBlock implements Cloneable {\n\t\tprivate final WeakReference<USBMonitor> mWeakMonitor;\n\t\tprivate final WeakReference<UsbDevice> mWeakDevice;\n\t\tprotected UsbDeviceConnection mConnection;\n\t\tprotected final UsbDeviceInfo mInfo;\n\t\tprivate final int mBusNum;\n\t\tprivate final int mDevNum;\n\t\tprivate final SparseArray<SparseArray<UsbInterface>> mInterfaces = new SparseArray<SparseArray<UsbInterface>>();\n\n\t\t/**\n\t\t * this class needs permission to access USB device before constructing\n\t\t * @param monitor\n\t\t * @param device\n\t\t */\n\t\tprivate UsbControlBlock(final USBMonitor monitor, final UsbDevice device) {\n\t\t\tif (DEBUG) Log.i(TAG, \"UsbControlBlock:constructor\");\n\t\t\tmWeakMonitor = new WeakReference<USBMonitor>(monitor);\n\t\t\tmWeakDevice = new WeakReference<UsbDevice>(device);\n\t\t\tmConnection = monitor.mUsbManager.openDevice(device);\n\t\t\tmInfo = updateDeviceInfo(monitor.mUsbManager, device, null);\n\t\t\tfinal String name = device.getDeviceName();\n\t\t\tfinal String[] v = !TextUtils.isEmpty(name) ? name.split(\"/\") : null;\n\t\t\tint busnum = 0;\n\t\t\tint devnum = 0;\n\t\t\tif (v != null) {\n\t\t\t\tbusnum = Integer.parseInt(v[v.length-2]);\n\t\t\t\tdevnum = Integer.parseInt(v[v.length-1]);\n\t\t\t}\n\t\t\tmBusNum = busnum;\n\t\t\tmDevNum = devnum;\n//\t\t\tif (DEBUG) {\n\t\t\t\tif (mConnection != null) {\n\t\t\t\t\tfinal int desc = mConnection.getFileDescriptor();\n\t\t\t\t\tfinal byte[] rawDesc = mConnection.getRawDescriptors();\n\t\t\t\t\tLog.i(TAG, String.format(Locale.US, \"name=%s,desc=%d,busnum=%d,devnum=%d,rawDesc=\", name, desc, busnum, devnum) + rawDesc);\n\t\t\t\t} else {\n\t\t\t\t\tLog.e(TAG, \"could not connect to device \" + name);\n\t\t\t\t}\n//\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * copy constructor\n\t\t * @param src\n\t\t * @throws IllegalStateException\n\t\t */\n\t\tprivate UsbControlBlock(final UsbControlBlock src) throws IllegalStateException {\n\t\t\tfinal USBMonitor monitor = src.getUSBMonitor();\n\t\t\tfinal UsbDevice device = src.getDevice();\n\t\t\tif (device == null) {\n\t\t\t\tthrow new IllegalStateException(\"device may already be removed\");\n\t\t\t}\n\t\t\tmConnection = monitor.mUsbManager.openDevice(device);\n\t\t\tif (mConnection == null) {\n\t\t\t\tthrow new IllegalStateException(\"device may already be removed or have no permission\");\n\t\t\t}\n\t\t\tmInfo = updateDeviceInfo(monitor.mUsbManager, device, null);\n\t\t\tmWeakMonitor = new WeakReference<USBMonitor>(monitor);\n\t\t\tmWeakDevice = new WeakReference<UsbDevice>(device);\n\t\t\tmBusNum = src.mBusNum;\n\t\t\tmDevNum = src.mDevNum;\n\t\t\t// FIXME USBMonitor.mCtrlBlocksに追加する(今はHashMapなので追加すると置き換わってしまうのでだめ, ListかHashMapにListをぶら下げる?)\n\t\t}\n\n\t\t/**\n\t\t * duplicate by clone\n\t\t * need permission\n\t\t * USBMonitor never handle cloned UsbControlBlock, you should release it after using it.\n\t\t * @return\n\t\t * @throws CloneNotSupportedException\n\t\t */\n\t\t@Override\n\t\tpublic UsbControlBlock clone() throws CloneNotSupportedException {\n\t\t\tfinal UsbControlBlock ctrlblock;\n\t\t\ttry {\n\t\t\t\tctrlblock = new UsbControlBlock(this);\n\t\t\t} catch (final IllegalStateException e) {\n\t\t\t\tthrow new CloneNotSupportedException(e.getMessage());\n\t\t\t}\n\t\t\treturn ctrlblock;\n\t\t}\n\n\t\tpublic USBMonitor getUSBMonitor() {\n\t\t\treturn mWeakMonitor.get();\n\t\t}\n\n\t\tpublic final UsbDevice getDevice() {\n\t\t\treturn mWeakDevice.get();\n\t\t}\n\n\t\t/**\n\t\t * get device name\n\t\t * @return\n\t\t */\n\t\tpublic String getDeviceName() {\n\t\t\tfinal UsbDevice device = mWeakDevice.get();\n\t\t\treturn device != null ? device.getDeviceName() : \"\";\n\t\t}\n\n\t\t/**\n\t\t * get device id\n\t\t * @return\n\t\t */\n\t\tpublic int getDeviceId() {\n\t\t\tfinal UsbDevice device = mWeakDevice.get();\n\t\t\treturn device != null ? device.getDeviceId() : 0;\n\t\t}\n\n\t\t/**\n\t\t * get device key string\n\t\t * @return same value if the devices has same vendor id, product id, device class, device subclass and device protocol\n\t\t */\n\t\tpublic String getDeviceKeyName() {\n\t\t\treturn USBMonitor.getDeviceKeyName(mWeakDevice.get());\n\t\t}\n\n\t\t/**\n\t\t * get device key string\n\t\t * @param useNewAPI if true, try to use serial number\n\t\t * @return\n\t\t * @throws IllegalStateException\n\t\t */\n\t\tpublic String getDeviceKeyName(final boolean useNewAPI) throws IllegalStateException {\n\t\t\tif (useNewAPI) checkConnection();\n\t\t\treturn USBMonitor.getDeviceKeyName(mWeakDevice.get(), mInfo.serial, useNewAPI);\n\t\t}\n\n\t\t/**\n\t\t * get device key\n\t\t * @return\n\t\t * @throws IllegalStateException\n\t\t */\n\t\tpublic int getDeviceKey() throws IllegalStateException {\n\t\t\tcheckConnection();\n\t\t\treturn USBMonitor.getDeviceKey(mWeakDevice.get());\n\t\t}\n\n\t\t/**\n\t\t * get device key\n\t\t * @param useNewAPI if true, try to use serial number\n\t\t * @return\n\t\t * @throws IllegalStateException\n\t\t */\n\t\tpublic int getDeviceKey(final boolean useNewAPI) throws IllegalStateException {\n\t\t\tif (useNewAPI) checkConnection();\n\t\t\treturn USBMonitor.getDeviceKey(mWeakDevice.get(), mInfo.serial, useNewAPI);\n\t\t}\n\n\t\t/**\n\t\t * get device key string\n\t\t * if device has serial number, use it\n\t\t * @return\n\t\t */\n\t\tpublic String getDeviceKeyNameWithSerial() {\n\t\t\treturn USBMonitor.getDeviceKeyName(mWeakDevice.get(), mInfo.serial, false);\n\t\t}\n\n\t\t/**\n\t\t * get device key\n\t\t * if device has serial number, use it\n\t\t * @return\n\t\t */\n\t\tpublic int getDeviceKeyWithSerial() {\n\t\t\treturn getDeviceKeyNameWithSerial().hashCode();\n\t\t}\n\n\t\t/**\n\t\t * get UsbDeviceConnection\n\t\t * @return\n\t\t */\n\t\tpublic synchronized UsbDeviceConnection getConnection() {\n\t\t\treturn mConnection;\n\t\t}\n\n\t\t/**\n\t\t * get file descriptor to access USB device\n\t\t * @return\n\t\t * @throws IllegalStateException\n\t\t */\n\t\tpublic synchronized int getFileDescriptor() throws IllegalStateException {\n\t\t\tcheckConnection();\n\t\t\treturn mConnection.getFileDescriptor();\n\t\t}\n\n\t\t/**\n\t\t * get raw descriptor for the USB device\n\t\t * @return\n\t\t * @throws IllegalStateException\n\t\t */\n\t\tpublic synchronized byte[] getRawDescriptors() throws IllegalStateException {\n\t\t\tcheckConnection();\n\t\t\treturn mConnection.getRawDescriptors();\n\t\t}\n\n\t\t/**\n\t\t * get vendor id\n\t\t * @return\n\t\t */\n\t\tpublic int getVenderId() {\n\t\t\tfinal UsbDevice device = mWeakDevice.get();\n\t\t\treturn device != null ? device.getVendorId() : 0;\n\t\t}\n\n\t\t/**\n\t\t * get product id\n\t\t * @return\n\t\t */\n\t\tpublic int getProductId() {\n\t\t\tfinal UsbDevice device = mWeakDevice.get();\n\t\t\treturn device != null ? device.getProductId() : 0;\n\t\t}\n\n\t\t/**\n\t\t * get version string of USB\n\t\t * @return\n\t\t */\n\t\tpublic String getUsbVersion() {\n\t\t\treturn mInfo.usb_version;\n\t\t}\n\n\t\t/**\n\t\t * get manufacture\n\t\t * @return\n\t\t */\n\t\tpublic String getManufacture() {\n\t\t\treturn mInfo.manufacturer;\n\t\t}\n\n\t\t/**\n\t\t * get product name\n\t\t * @return\n\t\t */\n\t\tpublic String getProductName() {\n\t\t\treturn mInfo.product;\n\t\t}\n\n\t\t/**\n\t\t * get version\n\t\t * @return\n\t\t */\n\t\tpublic String getVersion() {\n\t\t\treturn mInfo.version;\n\t\t}\n\n\t\t/**\n\t\t * get serial number\n\t\t * @return\n\t\t */\n\t\tpublic String getSerial() {\n\t\t\treturn mInfo.serial;\n\t\t}\n\n\t\tpublic int getBusNum() {\n\t\t\treturn mBusNum;\n\t\t}\n\n\t\tpublic int getDevNum() {\n\t\t\treturn mDevNum;\n\t\t}\n\n\t\t/**\n\t\t * get interface\n\t\t * @param interface_id\n\t\t * @throws IllegalStateException\n\t\t */\n\t\tpublic synchronized UsbInterface getInterface(final int interface_id) throws IllegalStateException {\n\t\t\treturn getInterface(interface_id, 0);\n\t\t}\n\n\t\t/**\n\t\t * get interface\n\t\t * @param interface_id\n\t\t * @param altsetting\n\t\t * @return\n\t\t * @throws IllegalStateException\n\t\t */\n\t\tpublic synchronized UsbInterface getInterface(final int interface_id, final int altsetting) throws IllegalStateException {\n\t\t\tcheckConnection();\n\t\t\tSparseArray<UsbInterface> intfs = mInterfaces.get(interface_id);\n\t\t\tif (intfs == null) {\n\t\t\t\tintfs = new SparseArray<UsbInterface>();\n\t\t\t\tmInterfaces.put(interface_id, intfs);\n\t\t\t}\n\t\t\tUsbInterface intf = intfs.get(altsetting);\n\t\t\tif (intf == null) {\n\t\t\t\tfinal UsbDevice device = mWeakDevice.get();\n\t\t\t\tfinal int n = device.getInterfaceCount();\n\t\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\t\tfinal UsbInterface temp = device.getInterface(i);\n\t\t\t\t\tif ((temp.getId() == interface_id) && (temp.getAlternateSetting() == altsetting)) {\n\t\t\t\t\t\tintf = temp;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (intf != null) {\n\t\t\t\t\tintfs.append(altsetting, intf);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn intf;\n\t\t}\n\n\t\t/**\n\t\t * open specific interface\n\t\t * @param intf\n\t\t */\n\t\tpublic synchronized void claimInterface(final UsbInterface intf) {\n\t\t\tclaimInterface(intf, true);\n\t\t}\n\n\t\tpublic synchronized void claimInterface(final UsbInterface intf, final boolean force) {\n\t\t\tcheckConnection();\n\t\t\tmConnection.claimInterface(intf, force);\n\t\t}\n\n\t\t/**\n\t\t * close interface\n\t\t * @param intf\n\t\t * @throws IllegalStateException\n\t\t */\n\t\tpublic synchronized void releaseInterface(final UsbInterface intf) throws IllegalStateException {\n\t\t\tcheckConnection();\n\t\t\tfinal SparseArray<UsbInterface> intfs = mInterfaces.get(intf.getId());\n\t\t\tif (intfs != null) {\n\t\t\t\tfinal int index = intfs.indexOfValue(intf);\n\t\t\t\tintfs.removeAt(index);\n\t\t\t\tif (intfs.size() == 0) {\n\t\t\t\t\tmInterfaces.remove(intf.getId());\n\t\t\t\t}\n\t\t\t}\n\t\t\tmConnection.releaseInterface(intf);\n\t\t}\n\n\t\t/**\n\t\t * Close device\n\t\t * This also close interfaces if they are opened in Java side\n\t\t */\n\t\tpublic synchronized void close() {\n\t\t\tif (DEBUG) Log.i(TAG, \"UsbControlBlock#close:\");\n\n\t\t\tif (mConnection != null) {\n\t\t\t\tfinal int n = mInterfaces.size();\n\t\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\t\tfinal SparseArray<UsbInterface> intfs = mInterfaces.valueAt(i);\n\t\t\t\t\tif (intfs != null) {\n\t\t\t\t\t\tfinal int m = intfs.size();\n\t\t\t\t\t\tfor (int j = 0; j < m; j++) {\n\t\t\t\t\t\t\tfinal UsbInterface intf = intfs.valueAt(j);\n\t\t\t\t\t\t\tmConnection.releaseInterface(intf);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tintfs.clear();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmInterfaces.clear();\n\t\t\t\tmConnection.close();\n\t\t\t\tmConnection = null;\n\t\t\t\tfinal USBMonitor monitor = mWeakMonitor.get();\n\t\t\t\tif (monitor != null) {\n\t\t\t\t\tif (monitor.mOnDeviceConnectListener != null) {\n\t\t\t\t\t\tmonitor.mOnDeviceConnectListener.onDisconnect(mWeakDevice.get(), UsbControlBlock.this);\n\t\t\t\t\t}\n\t\t\t\t\tmonitor.mCtrlBlocks.remove(getDevice());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean equals(final Object o) {\n\t\t\tif (o == null) return false;\n\t\t\tif (o instanceof UsbControlBlock) {\n\t\t\t\tfinal UsbDevice device = ((UsbControlBlock) o).getDevice();\n\t\t\t\treturn device == null ? mWeakDevice.get() == null\n\t\t\t\t\t\t: device.equals(mWeakDevice.get());\n\t\t\t} else if (o instanceof UsbDevice) {\n\t\t\t\treturn o.equals(mWeakDevice.get());\n\t\t\t}\n\t\t\treturn super.equals(o);\n\t\t}\n\n//\t\t@Override\n//\t\tprotected void finalize() throws Throwable {\n///\t\t\tclose();\n//\t\t\tsuper.finalize();\n//\t\t}\n\n\t\tprivate synchronized void checkConnection() throws IllegalStateException {\n\t\t\tif (mConnection == null) {\n\t\t\t\tthrow new IllegalStateException(\"already closed\");\n\t\t\t}\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "libuvccamera/src/main/java/com/serenegiant/usb/USBVendorId.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usb;\n\nimport android.util.SparseArray;\n\npublic class USBVendorId {\n\tprivate static final SparseArray<String> IDS = new SparseArray<String>();\n\n\tpublic static String vendorName(final int vendor_id) {\n\t\treturn IDS.get(vendor_id);\n\t}\n\n\tstatic {\n\t\tIDS.put(10006, \"YUEN DA ELECTRONIC PRODUCTS FACTORY\");\n\t\tIDS.put(10013, \"Gionee Communication Equipment Co., Ltd. ShenZhen\");\n\t\tIDS.put(10022, \"Universal Electronics Inc. (dba: TVIEW)\");\n\t\tIDS.put(1003, \"Atmel Corporation\");\n\t\tIDS.put(1006, \"Mitsumi\");\n\t\tIDS.put(1008, \"HP Inc.\");\n\t\tIDS.put(10112, \"M31 Technology Corp.\");\n\t\tIDS.put(10113, \"Liteconn Co., Ltd.\");\n\t\tIDS.put(10121, \"Suzhou WEIJU Electronics Technology Co., Ltd.\");\n\t\tIDS.put(10144, \"Mondokey Limited\");\n\t\tIDS.put(10149, \"Advantest Corporation\");\n\t\tIDS.put(10150, \"iRobot Corporation\");\n\t\tIDS.put(1020, \"Elitegroup Computer Systems\");\n\t\tIDS.put(1021, \"Xilinx Inc.\");\n\t\tIDS.put(10226, \"Sibridge Tech.\");\n\t\tIDS.put(1026, \"ALi Corporation\");\n\t\tIDS.put(1027, \"Future Technology Devices International Limited\");\n\t\tIDS.put(10275, \"Dongguan Jiumutong Industry Co., Ltd.\");\n\t\tIDS.put(10289, \"Power Integrations\");\n\t\tIDS.put(10291, \"Oculus VR, Inc.\");\n\t\tIDS.put(10300, \"HIGH TEK HARNESS ENTERPRISE CO., LTD.\");\n\t\tIDS.put(10316, \"Full in Hope Co., Ltd.\");\n\t\tIDS.put(1032, \"Quanta Computer Inc.\");\n\t\tIDS.put(10329, \"Viconn Technology (HK) Co., Ltd.\");\n\t\tIDS.put(1033, \"NEC Corporation\");\n\t\tIDS.put(1035, \"Weltrend Semiconductor\");\n\t\tIDS.put(1037, \"VIA Technologies, Inc.\");\n\t\tIDS.put(10374, \"Seeed Technology Co., Ltd.\");\n\t\tIDS.put(10375, \"Specwerkz\");\n\t\tIDS.put(1038, \"MCCI Corporation\");\n\t\tIDS.put(10398, \"Esselte Leitz GmbH & Co. KG\");\n\t\tIDS.put(10406, \"E-SEEK Inc.\");\n\t\tIDS.put(1041, \"BUFFALO INC.\");\n\t\tIDS.put(10423, \"Pleora Technologies Inc.\");\n\t\tIDS.put(10431, \"Vitetech Int'l Co., Ltd.\");\n\t\tIDS.put(1044, \"Giga-Byte Technology Co., Ltd.\");\n\t\tIDS.put(10446, \"Changzhou Shi Wujin Miqi East Electronic Co., Ltd.\");\n\t\tIDS.put(10457, \"Shenzhen Ourconn Technology Co., Ltd.\");\n\t\tIDS.put(10458, \"G.SKILL Int'l Enterprice Co., Ltd.\");\n\t\tIDS.put(1046, \"Nuvoton Technology Corp.\");\n\t\tIDS.put(10466, \"Surplus Electronic Technology Co., Ltd.\");\n\t\tIDS.put(10470, \"BIAMP SYSTEMS\");\n\t\tIDS.put(10509, \"IBCONN Technologies (Shenzhen) Co., Ltd.\");\n\t\tIDS.put(10510, \"Fugoo Inc.\");\n\t\tIDS.put(10519, \"Pan Xin Precision Electronics Co., Ltd.\");\n\t\tIDS.put(10530, \"Dongguan Digi-in Digital Technology Co., Ltd.\");\n\t\tIDS.put(1054, \"Creative Labs\");\n\t\tIDS.put(10540, \"GENUSION, Inc.\");\n\t\tIDS.put(10544, \"Ineda Systems Inc.\");\n\t\tIDS.put(10545, \"Jolla Ltd.\");\n\t\tIDS.put(10546, \"Peraso Technologies, Inc.\");\n\t\tIDS.put(10549, \"Nanjing Magewell Electronics Co., Ltd.\");\n\t\tIDS.put(10560, \"Shenzhen Yiwanda Electronics Co., Ltd.\");\n\t\tIDS.put(1057, \"Nokia Corporation\");\n\t\tIDS.put(10575, \"Dollar Connection Ltd.\");\n\t\tIDS.put(10595, \"BIO-key International, Inc.\");\n\t\tIDS.put(1060, \"Microchip-SMSC\");\n\t\tIDS.put(10603, \"Xacti Corporation\");\n\t\tIDS.put(10615, \"Shenzhen Zowee Technology Co., Ltd.\");\n\t\tIDS.put(10643, \"ADPlaus Technology Limited\");\n\t\tIDS.put(10646, \"Unwired Technology\");\n\t\tIDS.put(1065, \"Cirrus Logic Inc.\");\n\t\tIDS.put(10657, \"Union Electric Plug & Connector Corp.\");\n\t\tIDS.put(10674, \"Canova Tech\");\n\t\tIDS.put(10685, \"Silicon Works\");\n\t\tIDS.put(10695, \"HANRICO ANFU ELECTRONICS CO., LTD.\");\n\t\tIDS.put(10700, \"Kodak Alaris\");\n\t\tIDS.put(10702, \"JGR Optics Inc.\");\n\t\tIDS.put(10703, \"Richtek Technology Corporation\");\n\t\tIDS.put(10705, \"Binatone Electronics Int. Ltd.\");\n\t\tIDS.put(1071, \"Molex Inc.\");\n\t\tIDS.put(10715, \"Shenzhen iBoard Technology Co., Ltd.\");\n\t\tIDS.put(10719, \"SMIT(HK) Limited\");\n\t\tIDS.put(1072, \"Fujitsu Component Limited\");\n\t\tIDS.put(10725, \"Dongguan Kechenda Electronic Technology Co., Ltd.\");\n\t\tIDS.put(10726, \"Fengshun Peiying Electro-Acoustic Co., Ltd.\");\n\t\tIDS.put(10744, \"MD ELEKTRONIK GmbH\");\n\t\tIDS.put(10749, \"Bad Elf, LLC\");\n\t\tIDS.put(10770, \"Vreo Limited\");\n\t\tIDS.put(10772, \"Kanex\");\n\t\tIDS.put(10781, \"Oxford Nanopore Technologies\");\n\t\tIDS.put(10782, \"Obsidian Technology\");\n\t\tIDS.put(10783, \"Lucent Trans Electronics Co., Ltd.\");\n\t\tIDS.put(10784, \"GUOGUANG GROUP CO., LTD.\");\n\t\tIDS.put(10788, \"CNPLUS\");\n\t\tIDS.put(10789, \"Fourstar Group\");\n\t\tIDS.put(10790, \"Tragant International Co., Ltd.\");\n\t\tIDS.put(10791, \"DongGuan LianGang Optoelectronic Technology Co., Ltd.\");\n\t\tIDS.put(10797, \"Atrust Computer Corp.\");\n\t\tIDS.put(10798, \"VIA Alliance Semiconductor Co., Ltd.\");\n\t\tIDS.put(10799, \"BSUN Electronics Co., Ltd.\");\n\t\tIDS.put(1080, \"Advanced Micro Devices\");\n\t\tIDS.put(10807, \"RTD Embedded Technologies, Inc.\");\n\t\tIDS.put(10816, \"Shenzhen Choseal Industrial Co., Ltd.\");\n\t\tIDS.put(10817, \"Canyon Semiconductor\");\n\t\tIDS.put(10818, \"Spectra7 Microsystems Corp.\");\n\t\tIDS.put(10821, \"Meizu Technology Co., Ltd.\");\n\t\tIDS.put(10822, \"Hubei Yingtong Telecommunication Cable Inc.\");\n\t\tIDS.put(10829, \"Wilder Technologies\");\n\t\tIDS.put(10837, \"Diodes Inc.\");\n\t\tIDS.put(10846, \"DuPont\");\n\t\tIDS.put(1085, \"Lexmark International Inc.\");\n\t\tIDS.put(10852, \"Zhejiang Songcheng Electronics Co., Ltd.\");\n\t\tIDS.put(10859, \"VSN Mobil\");\n\t\tIDS.put(10875, \"Bellwether Electronic Corp.\");\n\t\tIDS.put(10878, \"VAIO Corporation\");\n\t\tIDS.put(10879, \"Perixx Computer GmbH\");\n\t\tIDS.put(10885, \"HANK ELECTRONICS CO., LTD\");\n\t\tIDS.put(10892, \"Sonnet Technologies, Inc.\");\n\t\tIDS.put(10893, \"Keysight Technologies Inc.\");\n\t\tIDS.put(10895, \"Manutronics Vietnam Joint Stock Company\");\n\t\tIDS.put(10900, \"G2 Touch Co., Ltd.\");\n\t\tIDS.put(10902, \"Micromax Informatics Ltd\");\n\t\tIDS.put(10910, \"SEIKO SOLUTIONS Inc.\");\n\t\tIDS.put(10912, \"Casco Products Corp.\");\n\t\tIDS.put(10922, \"Virtium Technology, Inc.\");\n\t\tIDS.put(10923, \"Field and Company LLC, dba Leef USA\");\n\t\tIDS.put(10928, \"GM Global Technology Operations LLC\");\n\t\tIDS.put(10931, \"Key Asic Inc.\");\n\t\tIDS.put(10943, \"Revolabs, Inc.\");\n\t\tIDS.put(10945, \"Lattice Semiconductor Corp\");\n\t\tIDS.put(10947, \"Foshan Nanhai Saga Audio Equipment Co., Ltd.\");\n\t\tIDS.put(10957, \"Silergy Corp.\");\n\t\tIDS.put(10963, \"Shenzhen Hali-Power Industrial Co., Ltd.\");\n\t\tIDS.put(10971, \"I-PEX (Dai-ichi Seiko)\");\n\t\tIDS.put(10973, \"SEE-PLUS INDUSTRIAL LTD.\");\n\t\tIDS.put(10990, \"Adapt-IP Company\");\n\t\tIDS.put(10997, \"Libratone A/S\");\n\t\tIDS.put(10999, \"Shenzhen Hazens Automotive Electronics (SZ) Co., Ltd.\");\n\t\tIDS.put(11000, \"Jiangsu Toppower Automotive Electronics Co., Ltd.\");\n\t\tIDS.put(11001, \"Drapho Electronics Technology Co., Ltd.\");\n\t\tIDS.put(1102, \"Alps Electric Co., Ltd.\");\n\t\tIDS.put(11022, \"Le Shi Zhi Xin Electronic Technology (Tian Jin) Limited\");\n\t\tIDS.put(11024, \"Cardiac Insight, Inc.\");\n\t\tIDS.put(11028, \"EverPro Technologies Company, Ltd.\");\n\t\tIDS.put(11029, \"Rosenberger Hochfrequenztechnik\");\n\t\tIDS.put(11035, \"Dongguan City Sanji Electronics Co., Ltd.\");\n\t\tIDS.put(11037, \"Lintes Technology Co., Ltd.\");\n\t\tIDS.put(11039, \"KinnexA, Inc.\");\n\t\tIDS.put(11042, \"Metra Electronics Corp.\");\n\t\tIDS.put(11044, \"KeepKey, LLC\");\n\t\tIDS.put(11047, \"FluxData Incorporated\");\n\t\tIDS.put(1105, \"Texas Instruments\");\n\t\tIDS.put(11061, \"Assem Technology Co., Ltd.\");\n\t\tIDS.put(11062, \"Dongguan City Jianghan Electronics Co., Ltd.\");\n\t\tIDS.put(11063, \"Huizhou Desay SV Automotive Co., Ltd.\");\n\t\tIDS.put(11064, \"Ningbo Rixing Electronics Co., Ltd.\");\n\t\tIDS.put(11069, \"GuangDong YuanFeng Automotive Electroics Co., Ltd.\");\n\t\tIDS.put(11080, \"Sounding Audio Industrial Limited\");\n\t\tIDS.put(11082, \"Yueqing Huaxin Electronic Co., Ltd.\");\n\t\tIDS.put(11098, \"Universal Audio, Inc.\");\n\t\tIDS.put(11111, \"Lifesize, Inc.\");\n\t\tIDS.put(11123, \"Pioneer DJ Corporation\");\n\t\tIDS.put(11124, \"Embedded Intelligence, Inc.\");\n\t\tIDS.put(11125, \"New Matter\");\n\t\tIDS.put(11126, \"Shanghai Wingtech Electronic Technology Co., Ltd.\");\n\t\tIDS.put(11127, \"Epiphan Systems Inc.\");\n\t\tIDS.put(11130, \"Spin Master Far East Ltd.\");\n\t\tIDS.put(11131, \"Gigaset Digital Technology (Shenzhen) Co., Ltd.\");\n\t\tIDS.put(11132, \"Noveltek Semiconductor Corp.\");\n\t\tIDS.put(11139, \"Silicon Line GmbH\");\n\t\tIDS.put(11140, \"Ever Win International Corp.\");\n\t\tIDS.put(11144, \"Socionext Inc.\");\n\t\tIDS.put(11145, \"Ugreen Group Limited\");\n\t\tIDS.put(11146, \"Shanghai Pateo Electronic Equipment Mfg. Co., Ltd.\");\n\t\tIDS.put(1115, \"Renesas Electronics Corp.\");\n\t\tIDS.put(11154, \"i-BLADES, Inc.\");\n\t\tIDS.put(11155, \"Altia Systems Inc.\");\n\t\tIDS.put(11156, \"ShenZhen Baoyuanda Electronics Co., Ltd.\");\n\t\tIDS.put(11157, \"iST - Integrated Service Technology Inc.\");\n\t\tIDS.put(11158, \"HYUNDAI MOBIS Co., Ltd.\");\n\t\tIDS.put(11161, \"360fly, Inc.\");\n\t\tIDS.put(11162, \"HUIZHOU CHENG SHUO HARDWARE PLASTIC CO., LTD.\");\n\t\tIDS.put(11163, \"Zhongshan Aute Electronics Technology Co., Ltd.\");\n\t\tIDS.put(11164, \"Guangdong King Link Industrial Co., Ltd.\");\n\t\tIDS.put(11167, \"Scietera Technologies, Inc.\");\n\t\tIDS.put(11168, \"InVue Security Products\");\n\t\tIDS.put(11169, \"I-Sheng Electric Wire & Cable Co., Ltd.\");\n\t\tIDS.put(11170, \"China Daheng Group Inc Beijing Image Vision Tech Branch\");\n\t\tIDS.put(11171, \"Shenzhen FeiTianXia Technology Ltd.\");\n\t\tIDS.put(11172, \"Shenzhen HengJia New Energy Auto Part Co., Ltd.\");\n\t\tIDS.put(11175, \"77 Elektronika Kft.\");\n\t\tIDS.put(11176, \"YUDU EASON ELECTRONIC CO., LTD.\");\n\t\tIDS.put(1118, \"Microsoft Corporation\");\n\t\tIDS.put(11181, \"XIN JI (SHENZHEN) COMPUTER PARTS CO., LTD.\");\n\t\tIDS.put(11189, \"Silk ID Systems\");\n\t\tIDS.put(11190, \"3D Imaging & Simulations Corp. (3DISC)\");\n\t\tIDS.put(11191, \"Dongguan ChengXiang Industrial Co., Ltd.\");\n\t\tIDS.put(11192, \"OCC (Zhuhai) Electronic Co., Ltd.\");\n\t\tIDS.put(11194, \"Sinseader Electronic Co., Ltd.\");\n\t\tIDS.put(11195, \"DONGGUAN YELLOWKNIFE Industrial Co., Ltd.\");\n\t\tIDS.put(11197, \"RF Creations Ltd.\");\n\t\tIDS.put(11198, \"Chengyi Semiconductors (Shanghai) Co., Ltd.\");\n\t\tIDS.put(11199, \"Shenzhen Shinning Electronic Co., Ltd.\");\n\t\tIDS.put(11200, \"Shenzhen WFD Electronics Co., Ltd.\");\n\t\tIDS.put(11201, \"Dongguan Sino Syncs Industrial Co., Ltd.\");\n\t\tIDS.put(11202, \"JNTC Co., Ltd.\");\n\t\tIDS.put(11208, \"DONGGUAN POLIXIN ELECTRIC CO., LTD.\");\n\t\tIDS.put(11209, \"Tama Electric (Suzhou) Co., Ltd.\");\n\t\tIDS.put(1121, \"Primax Electronics\");\n\t\tIDS.put(11210, \"Exvision, Inc.\");\n\t\tIDS.put(11216, \"mophie, LLC\");\n\t\tIDS.put(11219, \"Dongguan ULT-unite electronic technology co., LTD\");\n\t\tIDS.put(11220, \"JL Audio, Inc.\");\n\t\tIDS.put(11221, \"Cable Matters Inc.\");\n\t\tIDS.put(11222, \"CoroWare, Inc.\");\n\t\tIDS.put(11229, \"Charm Sciences Inc.\");\n\t\tIDS.put(1123, \"EATON\");\n\t\tIDS.put(11230, \"Pickering Interfaces Limited\");\n\t\tIDS.put(11231, \"Hangzhou Hikvision Digital Technology Co., Ltd.\");\n\t\tIDS.put(11232, \"FULLINK ELECTRONICS TECHNOLOGY (SZ) LTD\");\n\t\tIDS.put(11233, \"AutoChips Inc.\");\n\t\tIDS.put(11234, \"Electric Connector Technology Co., Ltd.\");\n\t\tIDS.put(11237, \"LELTEK\");\n\t\tIDS.put(11238, \"Dongguan KaiWin Electronics Co., Ltd.\");\n\t\tIDS.put(11239, \"BEFS Co., Ltd.\");\n\t\tIDS.put(11240, \"Archisite, Inc.\");\n\t\tIDS.put(11241, \"Magneti Marelli S.p.A Electr BL\");\n\t\tIDS.put(11246, \"Ventev Mobile\");\n\t\tIDS.put(11247, \"Quanta Storage Inc.\");\n\t\tIDS.put(11248, \"Tech-Top Technology Limited\");\n\t\tIDS.put(11253, \"Shenzhen YOOBAO Technology Co., Ltd.\");\n\t\tIDS.put(11254, \"Shenzhen Sinotek Technology Co., Ltd.\");\n\t\tIDS.put(11255, \"KEYW\");\n\t\tIDS.put(11256, \"Visual Land Inc.\");\n\t\tIDS.put(11264, \"MEEM SL Ltd\");\n\t\tIDS.put(11265, \"Dongguan Arin Electronics Technology Co., Ltd.\");\n\t\tIDS.put(11266, \"DongGuan City JianNuo Electronics Co., Ltd.\");\n\t\tIDS.put(11268, \"Shenzhen XOX Electronics Co., Ltd.\");\n\t\tIDS.put(11269, \"Protop International Inc.\");\n\t\tIDS.put(11270, \"Microsemi Semiconductor (US) Inc.\");\n\t\tIDS.put(11271, \"Webcloak LLC\");\n\t\tIDS.put(11272, \"INVECAS INC.\");\n\t\tIDS.put(11274, \"ATANS Technology Inc.\");\n\t\tIDS.put(11275, \"Triple Win Precision Technology Co., Ltd.\");\n\t\tIDS.put(11276, \"IC Realtech\");\n\t\tIDS.put(11277, \"Embrava Pty Ltd\");\n\t\tIDS.put(1128, \"Wieson Technologies Co., Ltd.\");\n\t\tIDS.put(11280, \"Sinotronics Co., Ltd.\");\n\t\tIDS.put(11281, \"ALLBEST ELECTRONICS TECHNOLOGY CO., LTD.\");\n\t\tIDS.put(11282, \"Shenzhen Xin Kai Feng Electronics Factory\");\n\t\tIDS.put(11283, \"MOST WELL Technology Corp.\");\n\t\tIDS.put(11284, \"Buffalo Memory Co., Ltd.\");\n\t\tIDS.put(11285, \"Xentris Wireless\");\n\t\tIDS.put(11286, \"Priferential Accessories Ltd\");\n\t\tIDS.put(11289, \"Sunlike Technology Co., Ltd.\");\n\t\tIDS.put(11290, \"Young Fast Optoelectronics Co., Ltd.\");\n\t\tIDS.put(11291, \"ISAW Camera Inc\");\n\t\tIDS.put(11298, \"Qanba USA, LLC\");\n\t\tIDS.put(11299, \"Super Micro Computer Inc.\");\n\t\tIDS.put(11302, \"Micromax International Corporation\");\n\t\tIDS.put(11304, \"Granite River Labs Japan Ltd.\");\n\t\tIDS.put(11305, \"Coagent Enterprise Limited\");\n\t\tIDS.put(11306, \"LEIA Inc.\");\n\t\tIDS.put(11309, \"Shenzhen Ebull Technology Limited\");\n\t\tIDS.put(1131, \"American Megatrends\");\n\t\tIDS.put(11310, \"Hualun Technology Co., Ltd.\");\n\t\tIDS.put(11311, \"Sensel, Inc.\");\n\t\tIDS.put(11319, \"Shenzhen Adition Audio Science & Technology Co., Ltd.\");\n\t\tIDS.put(11320, \"Goldenconn Electronics Technology (Suzhou) Co., Ltd.\");\n\t\tIDS.put(11321, \"JIB Electronics Technology Co., Ltd.\");\n\t\tIDS.put(11322, \"Changzhou Shinco Automotive Electronics Co., Ltd.\");\n\t\tIDS.put(11323, \"Shenzhen Hangsheng Electronics Corp., Ltd.\");\n\t\tIDS.put(11324, \"Beartooth Radio, Inc.\");\n\t\tIDS.put(11325, \"Audience, A Knowles Company\");\n\t\tIDS.put(11327, \"Nextbit Systems, Inc.\");\n\t\tIDS.put(11328, \"Leadtrend\");\n\t\tIDS.put(11329, \"Adaptertek Technology Co., Ltd.\");\n\t\tIDS.put(1133, \"Logitech Inc.\");\n\t\tIDS.put(11330, \"Feature Integration Technology Inc.\");\n\t\tIDS.put(11331, \"Avegant Corporation\");\n\t\tIDS.put(11335, \"Chunghsin International Electronics Co., Ltd.\");\n\t\tIDS.put(11336, \"Delphi Electrical Centers (Shanghai) Co., Ltd.\");\n\t\tIDS.put(11341, \"VVETEK DOO\");\n\t\tIDS.put(11347, \"Huizhou Foryou General Electronics Co., Ltd.\");\n\t\tIDS.put(11348, \"LifeWatch Technologies Ltd.\");\n\t\tIDS.put(11349, \"Magicleap\");\n\t\tIDS.put(11355, \"Dongguan City Shenglan Electronics Co., LTD.\");\n\t\tIDS.put(11356, \"Neusoft Corporation\");\n\t\tIDS.put(11357, \"SIP Simya Electronics Technology Co., Ltd.\");\n\t\tIDS.put(11358, \"GNSD Automotive Co., Ltd.\");\n\t\tIDS.put(11359, \"YOODS Co., Ltd.\");\n\t\tIDS.put(11360, \"Sirin Mobile Technologies AG\");\n\t\tIDS.put(11361, \"Jadmam Corporation dba: Boytone\");\n\t\tIDS.put(11373, \"Gibson Innovations\");\n\t\tIDS.put(11374, \"Shen Zhen Xian Shuo Technology Co. LTD\");\n\t\tIDS.put(11375, \"PST Eletronica LTDA\");\n\t\tIDS.put(11376, \"PERI, Inc.\");\n\t\tIDS.put(11377, \"Bozhou BoTong Information Technology Co., Ltd.\");\n\t\tIDS.put(11383, \"Profindustry GmbH\");\n\t\tIDS.put(11384, \"BRAGI GmbH\");\n\t\tIDS.put(11385, \"WAWGD, Inc. (DBA: Foresight Sports)\");\n\t\tIDS.put(11390, \"Dongguan Allpass Electronic Co., Ltd.\");\n\t\tIDS.put(11391, \"SHENZHEN D-VITEC INDUSTRIAL CO., LTD.\");\n\t\tIDS.put(11392, \"motomobile AG\");\n\t\tIDS.put(11393, \"Indie Semiconductor\");\n\t\tIDS.put(11397, \"Audientes\");\n\t\tIDS.put(11403, \"Huizhou Dehong Technology Co., Ltd.\");\n\t\tIDS.put(11404, \"PowerCenter Technology Limited\");\n\t\tIDS.put(11405, \"Mizco International, Inc.\");\n\t\tIDS.put(11408, \"I. AM. PLUS, LLC\");\n\t\tIDS.put(11409, \"Corigine, Inc.\");\n\t\tIDS.put(11410, \"Ningbo Yinzhou Shengke Electronics Co., Ltd.\");\n\t\tIDS.put(11417, \"Prusa Research s.r.o.\");\n\t\tIDS.put(11423, \"e-Smart Systems Pvt. Ltd.\");\n\t\tIDS.put(11424, \"Leagtech Jiangxi Electronic Co., Ltd.\");\n\t\tIDS.put(11425, \"Dongguan Yujia Electronics Technology Co., Ltd.\");\n\t\tIDS.put(11426, \"GuangZhou MingPing Electronics Technology\");\n\t\tIDS.put(11427, \"DJI Technology Co., Ltd.\");\n\t\tIDS.put(11428, \"Shenzhen Alex Technology Co., Ltd.\");\n\t\tIDS.put(11433, \"JITS TECHNOLOGY CO., LIMITED\");\n\t\tIDS.put(11434, \"LIVV Brand llc\");\n\t\tIDS.put(11444, \"Ava Enterprises, Inc. dba: Boss Audio Systems\");\n\t\tIDS.put(11448, \"Shenzhen Sydixon Electronic Technology Co., Ltd.\");\n\t\tIDS.put(11449, \"On-Bright Electronics (Shanghai) Co., Ltd.\");\n\t\tIDS.put(11450, \"Dongguan Puxu Industrial Co., Ltd.\");\n\t\tIDS.put(11451, \"Shenzhen Soling Indusrtial Co., Ltd.\");\n\t\tIDS.put(11453, \"EGGCYTE, INC.\");\n\t\tIDS.put(11455, \"Donggguan Yuhua Electronic Co., Ltd.\");\n\t\tIDS.put(11456, \"Hangzhou Zero Zero Technology Co., Ltd.\");\n\t\tIDS.put(11462, \"Prodigy Technovations Pvt Ltd\");\n\t\tIDS.put(11463, \"EmergiTech, Inc\");\n\t\tIDS.put(11464, \"Hewlett Packard Enterprise\");\n\t\tIDS.put(11465, \"Monolithic Power Systems Inc.\");\n\t\tIDS.put(11467, \"USB Memory Direct\");\n\t\tIDS.put(11468, \"Silicon Mitus Inc.\");\n\t\tIDS.put(11472, \"Technics Global Electronics & JCE Co., Ltd.\");\n\t\tIDS.put(11478, \"Immersive Media\");\n\t\tIDS.put(11479, \"Cosemi Technologies Inc.\");\n\t\tIDS.put(11481, \"Cambrionix Ltd\");\n\t\tIDS.put(11482, \"CXUN Co. Ltd.\");\n\t\tIDS.put(11483, \"China Tsp Inc\");\n\t\tIDS.put(11490, \"Yanfeng Visteon (Chongqing) Automotive Electronics Co\");\n\t\tIDS.put(11491, \"Alcorlink Corp.\");\n\t\tIDS.put(11492, \"ISBC Ltd.\");\n\t\tIDS.put(11493, \"InX8 Inc dba: AKiTiO\");\n\t\tIDS.put(11494, \"SDAN Tecchnology Co., Ltd.\");\n\t\tIDS.put(11495, \"Lemobile Information Technology (Beijing) Co., Ltd.\");\n\t\tIDS.put(11496, \"GongGuan HWX Electronic Technology Co., Ltd.\");\n\t\tIDS.put(11497, \"Suzhu Jingshi Electronic Technology Co., Ltd.\");\n\t\tIDS.put(11498, \"Zhong Shan City Richsound Electronic Industrial Ltd.\");\n\t\tIDS.put(11499, \"Dongguang Kangbang Electronics Co., Ltd.\");\n\t\tIDS.put(1151, \"Plantronics, Inc.\");\n\t\tIDS.put(1154, \"Kyocera Corporation\");\n\t\tIDS.put(1155, \"STMicroelectronics\");\n\t\tIDS.put(1161, \"Foxconn / Hon Hai\");\n\t\tIDS.put(1165, \"ITE Tech Inc.\");\n\t\tIDS.put(1177, \"Yamaha Corporation\");\n\t\tIDS.put(1188, \"Hitachi, Ltd.\");\n\t\tIDS.put(1191, \"Visioneer\");\n\t\tIDS.put(1193, \"Canon Inc.\");\n\t\tIDS.put(1200, \"Nikon Corporation\");\n\t\tIDS.put(1201, \"Pan International\");\n\t\tIDS.put(1204, \"Cypress Semiconductor\");\n\t\tIDS.put(1205, \"ROHM Co., Ltd.\");\n\t\tIDS.put(1207, \"Compal Electronics, Inc.\");\n\t\tIDS.put(1208, \"Seiko Epson Corp.\");\n\t\tIDS.put(1211, \"I-O Data Device, Inc.\");\n\t\tIDS.put(1221, \"Fujitsu Ltd.\");\n\t\tIDS.put(1227, \"FUJIFILM Corporation\");\n\t\tIDS.put(1238, \"Mentor Graphics\");\n\t\tIDS.put(1240, \"Microchip Technology Inc.\");\n\t\tIDS.put(1241, \"Holtek Semiconductor, Inc.\");\n\t\tIDS.put(1242, \"Panasonic Corporation\");\n\t\tIDS.put(1245, \"Sharp Corporation\");\n\t\tIDS.put(1250, \"Exar Corporation\");\n\t\tIDS.put(1254, \"Identiv, Inc.\");\n\t\tIDS.put(1256, \"Samsung Electronics Co., Ltd.\");\n\t\tIDS.put(1260, \"Tokyo Electron Device Limited\");\n\t\tIDS.put(1266, \"Chicony Electronics Co., Ltd.\");\n\t\tIDS.put(1271, \"Newnex Technology Corp.\");\n\t\tIDS.put(1273, \"Brother Industries, Ltd.\");\n\t\tIDS.put(1276, \"SUNPLUS TECHNOLOGY CO., LTD.\");\n\t\tIDS.put(1278, \"PFU Limited\");\n\t\tIDS.put(1281, \"Fujikura/DDK\");\n\t\tIDS.put(1282, \"Acer, Inc.\");\n\t\tIDS.put(1287, \"Hosiden Corporation\");\n\t\tIDS.put(1293, \"Belkin International, Inc.\");\n\t\tIDS.put(1300, \"FCI Electronics\");\n\t\tIDS.put(1302, \"Longwell Electronics/Longwell Company\");\n\t\tIDS.put(1305, \"Star Micronics Co., LTD\");\n\t\tIDS.put(1309, \"American Power Conversion\");\n\t\tIDS.put(1314, \"ACON, Advanced-Connectek, Inc.\");\n\t\tIDS.put(1343, \"Synopsys, Inc.\");\n\t\tIDS.put(1356, \"Sony Corporation\");\n\t\tIDS.put(1360, \"Fuji Xerox Co., Ltd.\");\n\t\tIDS.put(1367, \"ATEN International Co. Ltd.\");\n\t\tIDS.put(1369, \"Cadence Design Systems, Inc.\");\n\t\tIDS.put(1386, \"WACOM Co., Ltd.\");\n\t\tIDS.put(1389, \"EIZO Corporation\");\n\t\tIDS.put(1390, \"Elecom Co., Ltd.\");\n\t\tIDS.put(1394, \"Conexant Systems, Inc.\");\n\t\tIDS.put(1398, \"BAFO/Quality Computer Accessories\");\n\t\tIDS.put(1403, \"Y-E Data, Inc.\");\n\t\tIDS.put(1404, \"AVM GmbH\");\n\t\tIDS.put(1410, \"Roland Corporation\");\n\t\tIDS.put(1412, \"RATOC Systems, Inc.\");\n\t\tIDS.put(1419, \"Infineon Technologies\");\n\t\tIDS.put(1423, \"Alcor Micro, Corp.\");\n\t\tIDS.put(1424, \"OMRON Corporation\");\n\t\tIDS.put(1447, \"Bose Corporation\");\n\t\tIDS.put(1449, \"OmniVision Technologies, Inc.\");\n\t\tIDS.put(1452, \"Apple\");\n\t\tIDS.put(1453, \"Y.C. Cable U.S.A., Inc\");\n\t\tIDS.put(14627, \"National Instruments\");\n\t\tIDS.put(1470, \"Tyco Electronics Corp., a TE Connectivity Ltd. company\");\n\t\tIDS.put(1473, \"MegaChips Corporation\");\n\t\tIDS.put(1478, \"Qualcomm, Inc\");\n\t\tIDS.put(1480, \"Foxlink/Cheng Uei Precision Industry Co., Ltd.\");\n\t\tIDS.put(1482, \"Ricoh Company Ltd.\");\n\t\tIDS.put(1498, \"Microtek International Inc.\");\n\t\tIDS.put(1504, \"Symbol Technologies\");\n\t\tIDS.put(1507, \"Genesys Logic, Inc.\");\n\t\tIDS.put(1509, \"Fuji Electric Co., Ltd.\");\n\t\tIDS.put(1525, \"Unixtar Technology Inc.\");\n\t\tIDS.put(1529, \"Datalogic ADC\");\n\t\tIDS.put(1535, \"LeCroy Corporation\");\n\t\tIDS.put(1539, \"Novatek Microelectronics Corp.\");\n\t\tIDS.put(1545, \"SMK Manufacturing Inc.\");\n\t\tIDS.put(1551, \"Joinsoon Electronics Mfg. Co., Ltd.\");\n\t\tIDS.put(1555, \"TransAct Technologies Incorporated\");\n\t\tIDS.put(1561, \"Seiko Instruments Inc.\");\n\t\tIDS.put(1582, \"JPC/MAIN SUPER Inc.\");\n\t\tIDS.put(1583, \"Sin Sheng Terminal & Machine Inc.\");\n\t\tIDS.put(1593, \"Chrontel, Inc.\");\n\t\tIDS.put(1611, \"Analog Devices, Inc. Development Tools\");\n\t\tIDS.put(1612, \"Ji-Haw Industrial Co., Ltd\");\n\t\tIDS.put(1614, \"Suyin Corporation\");\n\t\tIDS.put(1621, \"Space Shuttle Hi-Tech Co.,Ltd.\");\n\t\tIDS.put(1622, \"Glory Mark Electronic Ltd.\");\n\t\tIDS.put(1623, \"Tekcon Electronics Corp.\");\n\t\tIDS.put(1624, \"Sigma Designs, Inc.\");\n\t\tIDS.put(1631, \"Good Way Technology Co., Ltd. & GWC technology Inc\");\n\t\tIDS.put(1632, \"TSAY-E (BVI) International Inc.\");\n\t\tIDS.put(1633, \"Hamamatsu Photonics K.K.\");\n\t\tIDS.put(1642, \"Total Technologies, Ltd.\");\n\t\tIDS.put(1659, \"Prolific Technology, Inc.\");\n\t\tIDS.put(16700, \"Dell Inc.\");\n\t\tIDS.put(1680, \"Golden Bridge Electech Inc.\");\n\t\tIDS.put(1689, \"Tektronix, Inc.\");\n\t\tIDS.put(1690, \"Askey Computer Corporation\");\n\t\tIDS.put(1709, \"Greatland Electronics Taiwan Ltd.\");\n\t\tIDS.put(1710, \"Eurofins Digital Testing Belgium\");\n\t\tIDS.put(1720, \"Pixela Corporation\");\n\t\tIDS.put(1724, \"Oki Data Corporation\");\n\t\tIDS.put(1727, \"Leoco Corporation\");\n\t\tIDS.put(1732, \"Bizlink Technology, Inc.\");\n\t\tIDS.put(1736, \"SIIG, Inc.\");\n\t\tIDS.put(1747, \"Mitsubishi Electric Corporation\");\n\t\tIDS.put(1758, \"Heisei Technology Co., Ltd.\");\n\t\tIDS.put(1802, \"Oki Electric Industry Co., Ltd.\");\n\t\tIDS.put(1805, \"Comoss Electronic Co., Ltd.\");\n\t\tIDS.put(1809, \"Magic Control Technology Corp.\");\n\t\tIDS.put(1816, \"Imation Corp.\");\n\t\tIDS.put(1838, \"Sunix Co., Ltd.\");\n\t\tIDS.put(1846, \"Lorom Industrial Co., Ltd.\");\n\t\tIDS.put(1848, \"Mad Catz, Inc.\");\n\t\tIDS.put(1899, \"HID Global GmbH\");\n\t\tIDS.put(1901, \"Denso Corporation\");\n\t\tIDS.put(1913, \"Fairchild Semiconductor\");\n\t\tIDS.put(1921, \"SanDisk Corporation\");\n\t\tIDS.put(1937, \"Copartner Technology Corporation\");\n\t\tIDS.put(1954, \"National Technical Systems\");\n\t\tIDS.put(1971, \"Plustek, Inc.\");\n\t\tIDS.put(1972, \"OLYMPUS CORPORATION\");\n\t\tIDS.put(1975, \"TIME Interconnect Ltd.\");\n\t\tIDS.put(1994, \"AVerMedia Technologies, Inc.\");\n\t\tIDS.put(1999, \"Casio Computer Co., Ltd.\");\n\t\tIDS.put(2015, \"David Electronics Company, Ltd.\");\n\t\tIDS.put(2039, \"Century Corporation\");\n\t\tIDS.put(2058, \"Evermuch Technology Co., Ltd.\");\n\t\tIDS.put(2101, \"Action Star Enterprise Co., Ltd.\");\n\t\tIDS.put(2112, \"Argosy Research Inc.\");\n\t\tIDS.put(2122, \"Wipro Limited\");\n\t\tIDS.put(2159, \"MEC IMEX INC/HPT\");\n\t\tIDS.put(2205, \"Icron Technologies Corporation\");\n\t\tIDS.put(2247, \"TAI TWUN ENTERPRISE CO., LTD.\");\n\t\tIDS.put(2276, \"Pioneer Corporation\");\n\t\tIDS.put(2278, \"Gemalto SA\");\n\t\tIDS.put(2310, \"FARADAY Technology Corp.\");\n\t\tIDS.put(2313, \"Audio-Technica Corp.\");\n\t\tIDS.put(2316, \"Silicon Motion, Inc. - Taiwan\");\n\t\tIDS.put(2334, \"Garmin International\");\n\t\tIDS.put(2352, \"Toshiba Corporation\");\n\t\tIDS.put(2362, \"Pixart Imaging, Inc.\");\n\t\tIDS.put(2363, \"Plextor LLC\");\n\t\tIDS.put(2366, \"J.S.T. Mfg. Co., Ltd.\");\n\t\tIDS.put(2385, \"Kingston Technology Company\");\n\t\tIDS.put(2389, \"NVIDIA\");\n\t\tIDS.put(2395, \"Medialogic Corporation\");\n\t\tIDS.put(2397, \"Polycom, Inc.\");\n\t\tIDS.put(2468, \"Contech Research, Inc.\");\n\t\tIDS.put(2472, \"Lin Shiung Enterprise Co., Ltd.\");\n\t\tIDS.put(2475, \"Japan Cash Machine Co., Ltd.\");\n\t\tIDS.put(2498, \"NISCA Corporation\");\n\t\tIDS.put(2511, \"Electronics Testing Center, Taiwan\");\n\t\tIDS.put(2522, \"A-FOUR TECH CO., LTD.\");\n\t\tIDS.put(2555, \"Altera\");\n\t\tIDS.put(2578, \"Cambridge Silicon Radio Ltd.\");\n\t\tIDS.put(2583, \"HOYA Corporation\");\n\t\tIDS.put(2631, \"Hirose Electric Co., Ltd.\");\n\t\tIDS.put(2636, \"COMPUTEX Co., Ltd.\");\n\t\tIDS.put(2640, \"Mimaki Engineering Co., Ltd.\");\n\t\tIDS.put(2652, \"Broadcom Corp.\");\n\t\tIDS.put(2667, \"Green House Co., Ltd.\");\n\t\tIDS.put(2702, \"Japan Aviation Electronics Industry Ltd. (JAE)\");\n\t\tIDS.put(2727, \"Wincor Nixdorf GmbH & Co KG\");\n\t\tIDS.put(2733, \"Rohde & Schwarz GmbH & Co. KG\");\n\t\tIDS.put(2787, \"Allion Labs, Inc.\");\n\t\tIDS.put(2821, \"ASUSTek Computer Inc.\");\n\t\tIDS.put(2849, \"Yokogawa Electric Corporation\");\n\t\tIDS.put(2851, \"Pan-Asia Electronics Co., Ltd.\");\n\t\tIDS.put(2894, \"Musical Electronics Ltd.\");\n\t\tIDS.put(2907, \"Anritsu Corporation\");\n\t\tIDS.put(2922, \"Maxim Integrated Products\");\n\t\tIDS.put(2965, \"ASIX Electronics Corporation\");\n\t\tIDS.put(2967, \"O2Micro, Inc.\");\n\t\tIDS.put(3010, \"Seagate Technology LLC\");\n\t\tIDS.put(3034, \"Realtek Semiconductor Corp.\");\n\t\tIDS.put(3035, \"Ericsson AB\");\n\t\tIDS.put(3044, \"Elka International Ltd.\");\n\t\tIDS.put(3056, \"Pace Micro Technology PLC\");\n\t\tIDS.put(3108, \"Taiyo Yuden Co., Ltd.\");\n\t\tIDS.put(3129, \"Aeroflex\");\n\t\tIDS.put(3132, \"Radius Co., Ltd.\");\n\t\tIDS.put(3141, \"Sonix Technology Co., Ltd.\");\n\t\tIDS.put(3158, \"Billion Bright (HK) Corporation Limited\");\n\t\tIDS.put(3161, \"Dong Guan Shinko Wire Co., Ltd.\");\n\t\tIDS.put(3170, \"Chant Sincere Co., Ltd\");\n\t\tIDS.put(3190, \"Solid State System Co., Ltd.\");\n\t\tIDS.put(3209, \"Honda Tsushin Kogyo Co., Ltd\");\n\t\tIDS.put(3245, \"Motorola Solutions\");\n\t\tIDS.put(3255, \"Singatron Enterprise Co. Ltd.\");\n\t\tIDS.put(3268, \"emsys Embedded Systems GmbH\");\n\t\tIDS.put(32902, \"Intel Corporation\");\n\t\tIDS.put(3294, \"Z-Com INC.\");\n\t\tIDS.put(3313, \"e-CONN ELECTRONIC CO., LTD.\");\n\t\tIDS.put(3314, \"ENE Technology Inc.\");\n\t\tIDS.put(3351, \"NALTEC, Inc.\");\n\t\tIDS.put(3402, \"NF Corporation\");\n\t\tIDS.put(3403, \"Grape Systems Inc.\");\n\t\tIDS.put(3409, \"Volex (Asia) Pte Ltd\");\n\t\tIDS.put(3425, \"MEILU ELECTRONICS (SHENZHEN) CO., LTD.\");\n\t\tIDS.put(3441, \"Hirakawa Hewtech Corp.\");\n\t\tIDS.put(3452, \"Taiwan Line Tek Electronic Co., Ltd.\");\n\t\tIDS.put(3463, \"Dolby Laboratories Inc.\");\n\t\tIDS.put(3468, \"C-MEDIA ELECTRONICS INC.\");\n\t\tIDS.put(3472, \"Sure-Fire Electrical Corporation\");\n\t\tIDS.put(3495, \"IOGEAR, Inc.\");\n\t\tIDS.put(3504, \"Micro-Star International Co., Ltd.\");\n\t\tIDS.put(3537, \"Contek Electronics Co., Ltd.\");\n\t\tIDS.put(3540, \"Custom Engineering SPA\");\n\t\tIDS.put(3641, \"Smart Modular Technologies, Inc.\");\n\t\tIDS.put(3658, \"Shenzhen Bao Hing Electric Wire & Cable Mfr. Co.\");\n\t\tIDS.put(3673, \"Bourns, Inc.\");\n\t\tIDS.put(3690, \"Megawin Technology Co., Ltd.\");\n\t\tIDS.put(3698, \"Hsi-Chin Electronics Co., Ltd.\");\n\t\tIDS.put(3714, \"Ching Tai Electric Wire & Cable Co., Ltd.\");\n\t\tIDS.put(3724, \"Well Force Electronic Co., Ltd\");\n\t\tIDS.put(3725, \"MediaTek Inc.\");\n\t\tIDS.put(3728, \"CRU\");\n\t\tIDS.put(3744, \"Ours Technology Inc.\");\n\t\tIDS.put(3762, \"Y-S ELECTRONIC CO., LTD.\");\n\t\tIDS.put(3778, \"Sweetray Industrial Ltd.\");\n\t\tIDS.put(3779, \"Axell Corporation\");\n\t\tIDS.put(3782, \"InnoVISION Multimedia Limited\");\n\t\tIDS.put(3790, \"TaiSol Electronics Co., Ltd.\");\n\t\tIDS.put(3812, \"Sunrich Technology (H.K.) Ltd.\");\n\t\tIDS.put(3868, \"Funai Electric Co., Ltd.\");\n\t\tIDS.put(3873, \"IOI Technology Corporation\");\n\t\tIDS.put(3890, \"YFC-BonEagle Electric Co., Ltd.\");\n\t\tIDS.put(3896, \"Nien-Yi Industrial Corp.\");\n\t\tIDS.put(3916, \"WORLDWIDE CABLE OPTO CORP.\");\n\t\tIDS.put(3923, \"Taiyo Cable (Dongguan) Co. Ltd.\");\n\t\tIDS.put(3924, \"Kawai Musical Instruments Mfg. Co., Ltd.\");\n\t\tIDS.put(3936, \"GuangZhou Chief Tech Electronic Technology Co. Ltd.\");\n\t\tIDS.put(3944, \"UQUEST, LTD.\");\n\t\tIDS.put(3991, \"CviLux Corporation\");\n\t\tIDS.put(4003, \"Chief Land Electronic Co., Ltd.\");\n\t\tIDS.put(4046, \"Sony Mobile Communications\");\n\t\tIDS.put(4087, \"CHI SHING COMPUTER ACCESSORIES CO., LTD.\");\n\t\tIDS.put(4096, \"Speed Tech Corp.\");\n\t\tIDS.put(4100, \"LG Electronics Inc.\");\n\t\tIDS.put(4101, \"Apacer Technology Inc.\");\n\t\tIDS.put(4134, \"Newly Corporation\");\n\t\tIDS.put(4168, \"Targus Group International\");\n\t\tIDS.put(4172, \"AMCO TEC International Inc.\");\n\t\tIDS.put(4183, \"ON Semiconductor\");\n\t\tIDS.put(4184, \"Western Digital Technologies, Inc.\");\n\t\tIDS.put(4227, \"CANON ELECTRONICS INC.\");\n\t\tIDS.put(4235, \"Grand-tek Technology Co., Ltd.\");\n\t\tIDS.put(4236, \"Robert Bosch GmbH\");\n\t\tIDS.put(4238, \"Lotes Co., Ltd.\");\n\t\tIDS.put(4266, \"Cables To Go\");\n\t\tIDS.put(4267, \"Universal Global Scientific Industrial Co., Ltd.\");\n\t\tIDS.put(4292, \"Silicon Laboratories, Inc.\");\n\t\tIDS.put(4301, \"Kycon Inc.\");\n\t\tIDS.put(4362, \"Moxa Inc.\");\n\t\tIDS.put(4370, \"Golden Bright (Sichuan) Electronic Technology Co Ltd\");\n\t\tIDS.put(4382, \"VSO ELECTRONICS CO., LTD.\");\n\t\tIDS.put(4398, \"Master Hill Electric Wire and Cable Co., Ltd.\");\n\t\tIDS.put(4477, \"Santa Electronic Inc.\");\n\t\tIDS.put(4505, \"Sierra Wireless Inc.\");\n\t\tIDS.put(4522, \"GlobalMedia Group, LLC\");\n\t\tIDS.put(4528, \"ATECH FLASH TECHNOLOGY\");\n\t\tIDS.put(4643, \"SKYCABLE ENTERPRISE CO., LTD.\");\n\t\tIDS.put(4703, \"ADATA Technology Co., Ltd.\");\n\t\tIDS.put(4716, \"Aristocrat Technologies\");\n\t\tIDS.put(4717, \"Bel Stewart\");\n\t\tIDS.put(4742, \"MARVELL SEMICONDUCTOR, INC.\");\n\t\tIDS.put(4756, \"RISO KAGAKU CORP.\");\n\t\tIDS.put(4792, \"Zhejiang Xinya Electronic Technology Co., Ltd.\");\n\t\tIDS.put(4817, \"Huawei Technologies Co., Ltd.\");\n\t\tIDS.put(4823, \"Better Holdings (HK) Limited\");\n\t\tIDS.put(4907, \"Konica Minolta, Inc.\");\n\t\tIDS.put(4925, \"Jasco Products Company\");\n\t\tIDS.put(4989, \"Pericom Semiconductor Corp.\");\n\t\tIDS.put(5008, \"TomTom International B.V.\");\n\t\tIDS.put(5075, \"AzureWave Technologies, Inc.\");\n\t\tIDS.put(5117, \"Initio Corporation\");\n\t\tIDS.put(5118, \"Phison Electronics Corp.\");\n\t\tIDS.put(5134, \"Telechips, Inc.\");\n\t\tIDS.put(5145, \"ABILITY ENTERPRISE CO., LTD.\");\n\t\tIDS.put(5148, \"Leviton Manufacturing\");\n\t\tIDS.put(5271, \"Panstrong Company Ltd.\");\n\t\tIDS.put(5293, \"CTK Corporation\");\n\t\tIDS.put(5296, \"StarTech.com Ltd.\");\n\t\tIDS.put(5376, \"Ellisys\");\n\t\tIDS.put(5404, \"VeriSilicon Holdings Co., Ltd.\");\n\t\tIDS.put(5421, \"JMicron Technology Corp.\");\n\t\tIDS.put(5422, \"HLDS (Hitachi-LG Data Storage, Inc.)\");\n\t\tIDS.put(5440, \"Phihong Technology Co., Ltd.\");\n\t\tIDS.put(5451, \"PNY Technologies Inc.\");\n\t\tIDS.put(5453, \"Rapid Conn, Connect County Holdings Bhd\");\n\t\tIDS.put(5454, \"D & M Holdings, Inc.\");\n\t\tIDS.put(5480, \"Sunf Pu Technology Co., Ltd\");\n\t\tIDS.put(5488, \"ALLTOP TECHNOLOGY CO., LTD.\");\n\t\tIDS.put(5510, \"Palconn Technology Co., Ltd.\");\n\t\tIDS.put(5528, \"Kunshan Guoji Electronics Co., Ltd.\");\n\t\tIDS.put(5546, \"DongGuan Ya Lian Electronics Co., Ltd.\");\n\t\tIDS.put(5645, \"Samtec\");\n\t\tIDS.put(5694, \"HongLin Electronics Co., Ltd.\");\n\t\tIDS.put(5753, \"Total Phase\");\n\t\tIDS.put(5766, \"ZOOM Corporation\");\n\t\tIDS.put(5836, \"silex technology, Inc.\");\n\t\tIDS.put(5946, \"F. Hoffmann-La Roche AG\");\n\t\tIDS.put(5960, \"MQP Electronics Ltd.\");\n\t\tIDS.put(5964, \"ASMedia Technology Inc.\");\n\t\tIDS.put(5998, \"UD electronic corp.\");\n\t\tIDS.put(6001, \"Shenzhen Alex Connector Co., Ltd.\");\n\t\tIDS.put(6002, \"System Level Solutions, Inc.\");\n\t\tIDS.put(6018, \"Spreadtrum Hong Kong Limited\");\n\t\tIDS.put(6024, \"ShenZhen Litkconn Technology Co., Ltd.\");\n\t\tIDS.put(6053, \"Advanced Connection Technology Inc.\");\n\t\tIDS.put(6095, \"Hip Hing Cable & Plug Mfy. Ltd.\");\n\t\tIDS.put(6121, \"DisplayLink (UK) Ltd.\");\n\t\tIDS.put(6127, \"Lenovo\");\n\t\tIDS.put(6133, \"K.K. Rocky\");\n\t\tIDS.put(6160, \"Wanshih Electronic Co., Ltd.\");\n\t\tIDS.put(6185, \"Dongguan YuQiu Electronics Co., Ltd.\");\n\t\tIDS.put(6193, \"Gwo Jinn Industries Co., Ltd.\");\n\t\tIDS.put(6297, \"Linkiss Co., Ltd.\");\n\t\tIDS.put(6353, \"Google Inc.\");\n\t\tIDS.put(6394, \"Kuang Ying Computer Equipment Co., Ltd.\");\n\t\tIDS.put(6421, \"Nordic Semiconductor ASA\");\n\t\tIDS.put(6448, \"Shenzhen Xianhe Technology Co., Ltd.\");\n\t\tIDS.put(6449, \"Ningbo Broad Telecommunication Co., Ltd.\");\n\t\tIDS.put(6470, \"Irisguard UK Ltd\");\n\t\tIDS.put(6473, \"Lab126\");\n\t\tIDS.put(6481, \"Hyperstone GmbH\");\n\t\tIDS.put(6487, \"BIOS Corporation\");\n\t\tIDS.put(6626, \"Solomon Systech Limited\");\n\t\tIDS.put(6639, \"Pak Heng Technology (Shenzhen) Co., Ltd.\");\n\t\tIDS.put(6655, \"Best Buy China Ltd.\");\n\t\tIDS.put(6666, \"USB-IF non-workshop\");\n\t\tIDS.put(6709, \"Artesyn Technologies Inc.\");\n\t\tIDS.put(6720, \"TERMINUS TECHNOLOGY INC.\");\n\t\tIDS.put(6766, \"Global Unichip Corp.\");\n\t\tIDS.put(6786, \"Proconn Technology Co., Ltd.\");\n\t\tIDS.put(6794, \"Simula Technology Inc.\");\n\t\tIDS.put(6795, \"SGS Taiwan Ltd.\");\n\t\tIDS.put(6830, \"Johnson Component & Equipments Co., Ltd.\");\n\t\tIDS.put(6834, \"Allied Vision Technologies GmbH\");\n\t\tIDS.put(6859, \"Salcomp Plc\");\n\t\tIDS.put(6865, \"Desan Wire Co., Ltd.\");\n\t\tIDS.put(6944, \"MStar Semiconductor, Inc.\");\n\t\tIDS.put(6984, \"Plastron Precision Co., Ltd.\");\n\t\tIDS.put(7013, \"The Hong Kong Standards and Testing Centre Ltd.\");\n\t\tIDS.put(7048, \"ShenMing Electron (Dong Guan) Co., Ltd.\");\n\t\tIDS.put(7086, \"Vuzix Corporation\");\n\t\tIDS.put(7108, \"Ford Motor Co.\");\n\t\tIDS.put(7118, \"Contac Cable Industrial Limited\");\n\t\tIDS.put(7119, \"Sunplus Innovation Technology Inc.\");\n\t\tIDS.put(7120, \"Hangzhou Riyue Electronics Co., Ltd.\");\n\t\tIDS.put(7158, \"Orient Semiconductor Electronics, Ltd.\");\n\t\tIDS.put(7207, \"SHENZHEN DNS INDUSTRIES CO., LTD.\");\n\t\tIDS.put(7217, \"LS Mtron Ltd.\");\n\t\tIDS.put(7229, \"NONIN MEDICAL INC.\");\n\t\tIDS.put(7275, \"Philips & Lite-ON Digital Solutions Corporation\");\n\t\tIDS.put(7310, \"ASTRON INTERNATIONAL CORP.\");\n\t\tIDS.put(7320, \"ALPINE ELECTRONICS, INC.\");\n\t\tIDS.put(7347, \"Aces Electronics Co., Ltd.\");\n\t\tIDS.put(7348, \"OPEX CORPORATION\");\n\t\tIDS.put(7390, \"Telecommunications Technology Association (TTA)\");\n\t\tIDS.put(7434, \"Visteon Corporation\");\n\t\tIDS.put(7465, \"Horng Tong Enterprise Co., Ltd.\");\n\t\tIDS.put(7501, \"Pegatron Corporation\");\n\t\tIDS.put(7516, \"Fresco Logic Inc.\");\n\t\tIDS.put(7529, \"Walta Electronic Co., Ltd.\");\n\t\tIDS.put(7543, \"Yueqing Changling Electronic Instrument Corp., Ltd.\");\n\t\tIDS.put(7584, \"Parade Technologies, Inc.\");\n\t\tIDS.put(7647, \"L&T Technology Services\");\n\t\tIDS.put(7649, \"Actions Microelectronics Co., Ltd.\");\n\t\tIDS.put(7666, \"China Telecommunication Technology Labs - Terminals\");\n\t\tIDS.put(7668, \"SHEN ZHEN FORMAN PRECISION INDUSTRY CO., LTD.\");\n\t\tIDS.put(7682, \"GLOBEMASTER TECHNOLOGIES CO., LTD.\");\n\t\tIDS.put(7696, \"Point Grey Research Inc.\");\n\t\tIDS.put(7751, \"HUNG TA H.T.ENTERPRISE CO., LTD.\");\n\t\tIDS.put(7758, \"Etron Technology, Inc.\");\n\t\tIDS.put(7795, \"COMLINK ELECTRONICS CO., LTD.\");\n\t\tIDS.put(7818, \"HIBEST Electronic (DongGuan) Co., Ltd.\");\n\t\tIDS.put(7825, \"Other World Computing\");\n\t\tIDS.put(7863, \"WIN WIN PRECISION INDUSTRIAL CO., LTD.\");\n\t\tIDS.put(7879, \"Gefen Inc.\");\n\t\tIDS.put(7881, \"MOSER BAER INDIA LIMITED\");\n\t\tIDS.put(7898, \"AIRTIES WIRELESS NETWORKS\");\n\t\tIDS.put(7956, \"Astoria Networks GmbH\");\n\t\tIDS.put(7969, \"Scosche Industries\");\n\t\tIDS.put(7976, \"Cal-Comp Electronics & Communications\");\n\t\tIDS.put(7977, \"Analogix Semiconductor, Inc.\");\n\t\tIDS.put(7989, \"Amphenol ShouhMin Industry (ShenZhen) Co., Ltd\");\n\t\tIDS.put(7996, \"Chang Yang Electronics Company Ltd.\");\n\t\tIDS.put(8073, \"Dongguan Goldconn Electronics Co., Ltd.\");\n\t\tIDS.put(8074, \"Morning Star Industrial Co., Ltd.\");\n\t\tIDS.put(8117, \"Unify Software and Solutions GmbH & Co. KG\");\n\t\tIDS.put(8137, \"NXP Semiconductors\");\n\t\tIDS.put(8181, \"Changzhou Wujin BEST Electronic Cables Co., Ltd.\");\n\t\tIDS.put(8205, \"Belkin Electronic (Changzhou) Co., Ltd.\");\n\t\tIDS.put(8220, \"Freeport Resources Enterprises Corp.\");\n\t\tIDS.put(8222, \"Qingdao Haier Telecom Co., Ltd.\");\n\t\tIDS.put(8284, \"Shenzhen Tronixin Electronics Co., Ltd.\");\n\t\tIDS.put(8294, \"Unicorn Electronics Components Co., Ltd.\");\n\t\tIDS.put(8334, \"Luxshare-ICT\");\n\t\tIDS.put(8341, \"CE LINK LIMITED\");\n\t\tIDS.put(8342, \"Microconn Electronic Co., Ltd.\");\n\t\tIDS.put(8367, \"Shenzhen CARVE Electronics Co., Ltd.\");\n\t\tIDS.put(8382, \"BURY GmbH & Co. KG\");\n\t\tIDS.put(8384, \"FENGHUA KINGSUN CO., LTD.\");\n\t\tIDS.put(8386, \"Sumitomo Electric Ind., Ltd., Optical Comm. R&D Lab\");\n\t\tIDS.put(8439, \"XIMEA s.r.o.\");\n\t\tIDS.put(8457, \"VIA Labs, Inc.\");\n\t\tIDS.put(8492, \"Shenzhen Linoya Electronic Co., Ltd.\");\n\t\tIDS.put(8494, \"Amphenol AssembleTech (Xiamen) Co., Ltd.\");\n\t\tIDS.put(8524, \"Y Soft Corporation\");\n\t\tIDS.put(8550, \"JVC KENWOOD Corporation\");\n\t\tIDS.put(8564, \"Transcend Information, Inc.\");\n\t\tIDS.put(8566, \"TMC/Allion Test Labs\");\n\t\tIDS.put(8613, \"Genesis Technology USA, Inc.\");\n\t\tIDS.put(8627, \"Dongguan Teconn Electronics Technology Co., Ltd.\");\n\t\tIDS.put(8644, \"Netcom Technology (HK) Limited\");\n\t\tIDS.put(8659, \"Compupack Technology Co., Ltd.\");\n\t\tIDS.put(8667, \"G-Max Technology Co., Ltd.\");\n\t\tIDS.put(8679, \"Sagemcom Broadband SAS\");\n\t\tIDS.put(8695, \"Wuerth-Elektronik eiSos GmbH & Co. KG\");\n\t\tIDS.put(8707, \"Shin Shin Co., Ltd.\");\n\t\tIDS.put(8709, \"3eYamaichi Electronics Co., Ltd.\");\n\t\tIDS.put(8710, \"Wiretek International Investment Ltd.\");\n\t\tIDS.put(8711, \"Fuzhou Rockchip Electronics Co., Ltd.\");\n\t\tIDS.put(8752, \"Plugable Technologies\");\n\t\tIDS.put(8756, \"T-CONN PRECISION CORPORATION\");\n\t\tIDS.put(8831, \"Granite River Labs\");\n\t\tIDS.put(8842, \"Hotron Precision Electronic Ind. Corp.\");\n\t\tIDS.put(8875, \"Trigence Semiconductor, Inc.\");\n\t\tIDS.put(8888, \"Motorola Mobility Inc.\");\n\t\tIDS.put(8904, \"Karming Electronic (Shenzhen) Co., Ltd.\");\n\t\tIDS.put(8981, \"Avery Design Systems, Inc.\");\n\t\tIDS.put(8993, \"iKingdom Corp. (d.b.a. iConnectivity)\");\n\t\tIDS.put(9051, \"KangXiang Electronic Co., Ltd.\");\n\t\tIDS.put(9068, \"ZheJiang Chunsheng Electronics Co., Ltd.\");\n\t\tIDS.put(9130, \"DOK (HK) Trading Limited\");\n\t\tIDS.put(9132, \"Marunix Electron Limited\");\n\t\tIDS.put(9165, \"Avconn Precise Connector Co., Ltd.\");\n\t\tIDS.put(9184, \"BitifEye Digital Test Solutions GmbH\");\n\t\tIDS.put(9205, \"Speed Conn Co., Ltd.\");\n\t\tIDS.put(9222, \"INSIDE Secure\");\n\t\tIDS.put(9292, \"Minebea Co., Ltd.\");\n\t\tIDS.put(9299, \"BAANTO\");\n\t\tIDS.put(9338, \"Suzhou Jutze Technologies Co., Ltd\");\n\t\tIDS.put(9355, \"DONGGUAN SYNCONN PRECISION INDUSTRY CO. LTD.\");\n\t\tIDS.put(9382, \"Shenzhen Pangngai Industrial Co., Ltd.\");\n\t\tIDS.put(9422, \"Shenzhen Deren Electronic Co., Ltd.\");\n\t\tIDS.put(9424, \"Smith Micro Software, Inc.\");\n\t\tIDS.put(9453, \"ZEN FACTORY GROUP (ASIA) LTD.\");\n\t\tIDS.put(9481, \"Chain-In Electronic Co., Ltd.\");\n\t\tIDS.put(9514, \"SUZHOU KELI TECHNOLOGY DEVELOPMENT CO., LTD.\");\n\t\tIDS.put(9515, \"TOP Exactitude Industry (ShenZhen) Co., Ltd.\");\n\t\tIDS.put(9525, \"ShenZhen Hogend Precision Technology Co., Ltd.\");\n\t\tIDS.put(9527, \"Norel Systems Ltd.\");\n\t\tIDS.put(9556, \"ASSA ABLOY AB\");\n\t\tIDS.put(9575, \"DongGuan LongTao Electronic Co., Ltd.\");\n\t\tIDS.put(9577, \"DongGuan City MingJi Electronics Co., Ltd.\");\n\t\tIDS.put(9589, \"Weida Hi-Tech Co., Ltd.\");\n\t\tIDS.put(9593, \"Dongguan Wisechamp Electronic Co., Ltd.\");\n\t\tIDS.put(9613, \"Sequans Communications\");\n\t\tIDS.put(9636, \"ALGOLTEK, INC.\");\n\t\tIDS.put(9651, \"DongGuan Elinke Industrial Co., Ltd.\");\n\t\tIDS.put(9679, \"Corning Optical Communications LLC\");\n\t\tIDS.put(9714, \"Dongguan Jinyue Electronics Co., Ltd.\");\n\t\tIDS.put(9723, \"RICOH IMAGING COMPANY, LTD.\");\n\t\tIDS.put(9742, \"DongGuan HYX Industrial Co., Ltd.\");\n\t\tIDS.put(9753, \"Advanced Silicon SA\");\n\t\tIDS.put(9756, \"EISST Limited\");\n\t\tIDS.put(9771, \"YTOP Electronics Technical (Kunshan) Co., Ltd.\");\n\t\tIDS.put(9841, \"Innovative Logic\");\n\t\tIDS.put(9842, \"GoPro\");\n\t\tIDS.put(9846, \"Basler AG\");\n\t\tIDS.put(9851, \"Palpilot International Corp.\");\n\t\tIDS.put(9896, \"UNIREX CORPORATION\");\n\t\tIDS.put(9917, \"Integral Memory Plc.\");\n\t\tIDS.put(9973, \"Morning Star Digital Connector Co., Ltd.\");\n\t\tIDS.put(9984, \"MITACHI CO., LTD.\");\n\t\tIDS.put(9999, \"HGST, a Western Digital Company\");\n\t}\n}\n"
  },
  {
    "path": "libuvccamera/src/main/java/com/serenegiant/usb/UVCCamera.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usb;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.json.JSONArray;\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\nimport android.graphics.SurfaceTexture;\nimport android.hardware.usb.UsbDevice;\nimport android.text.TextUtils;\nimport android.util.Log;\nimport android.view.Surface;\nimport android.view.SurfaceHolder;\n\nimport com.serenegiant.usb.USBMonitor.UsbControlBlock;\n\npublic class UVCCamera {\n\tprivate static final boolean DEBUG = false;\t// TODO set false when releasing\n\tprivate static final String TAG = UVCCamera.class.getSimpleName();\n\tprivate static final String DEFAULT_USBFS = \"/dev/bus/usb\";\n\n\tpublic static final int DEFAULT_PREVIEW_WIDTH = 640;\n\tpublic static final int DEFAULT_PREVIEW_HEIGHT = 480;\n\tpublic static final int DEFAULT_PREVIEW_MODE = 0;\n\tpublic static final int DEFAULT_PREVIEW_MIN_FPS = 1;\n\tpublic static final int DEFAULT_PREVIEW_MAX_FPS = 30;\n\tpublic static final float DEFAULT_BANDWIDTH = 1.0f;\n\n\tpublic static final int FRAME_FORMAT_YUYV = 0;\n\tpublic static final int FRAME_FORMAT_MJPEG = 1;\n\n\tpublic static final int PIXEL_FORMAT_RAW = 0;\n\tpublic static final int PIXEL_FORMAT_YUV = 1;\n\tpublic static final int PIXEL_FORMAT_RGB565 = 2;\n\tpublic static final int PIXEL_FORMAT_RGBX = 3;\n\tpublic static final int PIXEL_FORMAT_YUV420SP = 4;\n\tpublic static final int PIXEL_FORMAT_NV21 = 5;\t\t// = YVU420SemiPlanar\n\n\t//--------------------------------------------------------------------------------\n    public static final int\tCTRL_SCANNING\t\t= 0x00000001;\t// D0:  Scanning Mode\n    public static final int CTRL_AE\t\t\t\t= 0x00000002;\t// D1:  Auto-Exposure Mode\n    public static final int CTRL_AE_PRIORITY\t= 0x00000004;\t// D2:  Auto-Exposure Priority\n    public static final int CTRL_AE_ABS\t\t\t= 0x00000008;\t// D3:  Exposure Time (Absolute)\n    public static final int CTRL_AR_REL\t\t\t= 0x00000010;\t// D4:  Exposure Time (Relative)\n    public static final int CTRL_FOCUS_ABS\t\t= 0x00000020;\t// D5:  Focus (Absolute)\n    public static final int CTRL_FOCUS_REL\t\t= 0x00000040;\t// D6:  Focus (Relative)\n    public static final int CTRL_IRIS_ABS\t\t= 0x00000080;\t// D7:  Iris (Absolute)\n    public static final int CTRL_IRIS_REL\t\t= 0x00000100;\t// D8:  Iris (Relative)\n    public static final int CTRL_ZOOM_ABS\t\t= 0x00000200;\t// D9:  Zoom (Absolute)\n    public static final int CTRL_ZOOM_REL\t\t= 0x00000400;\t// D10: Zoom (Relative)\n    public static final int CTRL_PANTILT_ABS\t= 0x00000800;\t// D11: PanTilt (Absolute)\n    public static final int CTRL_PANTILT_REL\t= 0x00001000;\t// D12: PanTilt (Relative)\n    public static final int CTRL_ROLL_ABS\t\t= 0x00002000;\t// D13: Roll (Absolute)\n    public static final int CTRL_ROLL_REL\t\t= 0x00004000;\t// D14: Roll (Relative)\n    public static final int CTRL_FOCUS_AUTO\t\t= 0x00020000;\t// D17: Focus, Auto\n    public static final int CTRL_PRIVACY\t\t= 0x00040000;\t// D18: Privacy\n    public static final int CTRL_FOCUS_SIMPLE\t= 0x00080000;\t// D19: Focus, Simple\n    public static final int CTRL_WINDOW\t\t\t= 0x00100000;\t// D20: Window\n\n    public static final int PU_BRIGHTNESS\t\t= 0x80000001;\t// D0: Brightness\n    public static final int PU_CONTRAST\t\t\t= 0x80000002;\t// D1: Contrast\n    public static final int PU_HUE\t\t\t\t= 0x80000004;\t// D2: Hue\n    public static final int PU_SATURATION\t\t= 0x80000008;\t// D3: Saturation\n    public static final int PU_SHARPNESS\t\t= 0x80000010;\t// D4: Sharpness\n    public static final int PU_GAMMA\t\t\t= 0x80000020;\t// D5: Gamma\n    public static final int PU_WB_TEMP\t\t\t= 0x80000040;\t// D6: White Balance Temperature\n    public static final int PU_WB_COMPO\t\t\t= 0x80000080;\t// D7: White Balance Component\n    public static final int PU_BACKLIGHT\t\t= 0x80000100;\t// D8: Backlight Compensation\n    public static final int PU_GAIN\t\t\t\t= 0x80000200;\t// D9: Gain\n    public static final int PU_POWER_LF\t\t\t= 0x80000400;\t// D10: Power Line Frequency\n    public static final int PU_HUE_AUTO\t\t\t= 0x80000800;\t// D11: Hue, Auto\n    public static final int PU_WB_TEMP_AUTO\t\t= 0x80001000;\t// D12: White Balance Temperature, Auto\n    public static final int PU_WB_COMPO_AUTO\t= 0x80002000;\t// D13: White Balance Component, Auto\n    public static final int PU_DIGITAL_MULT\t\t= 0x80004000;\t// D14: Digital Multiplier\n    public static final int PU_DIGITAL_LIMIT\t= 0x80008000;\t// D15: Digital Multiplier Limit\n    public static final int PU_AVIDEO_STD\t\t= 0x80010000;\t// D16: Analog Video Standard\n    public static final int PU_AVIDEO_LOCK\t\t= 0x80020000;\t// D17: Analog Video Lock Status\n    public static final int PU_CONTRAST_AUTO\t= 0x80040000;\t// D18: Contrast, Auto\n\n\t// uvc_status_class from libuvc.h\n\tpublic static final int STATUS_CLASS_CONTROL = 0x10;\n\tpublic static final int STATUS_CLASS_CONTROL_CAMERA = 0x11;\n\tpublic static final int STATUS_CLASS_CONTROL_PROCESSING = 0x12;\n\n\t// uvc_status_attribute from libuvc.h\n\tpublic static final int STATUS_ATTRIBUTE_VALUE_CHANGE = 0x00;\n\tpublic static final int STATUS_ATTRIBUTE_INFO_CHANGE = 0x01;\n\tpublic static final int STATUS_ATTRIBUTE_FAILURE_CHANGE = 0x02;\n\tpublic static final int STATUS_ATTRIBUTE_UNKNOWN = 0xff;\n\n\tprivate static boolean isLoaded;\n\tstatic {\n\t\tif (!isLoaded) {\n\t\t\tSystem.loadLibrary(\"jpeg-turbo1500\");\n\t\t\tSystem.loadLibrary(\"usb100\");\n\t\t\tSystem.loadLibrary(\"uvc\");\n\t\t\tSystem.loadLibrary(\"UVCCamera\");\n\t\t\tisLoaded = true;\n\t\t}\n\t}\n\n\tprivate UsbControlBlock mCtrlBlock;\n    protected long mControlSupports;\t\t\t// カメラコントロールでサポートしている機能フラグ\n    protected long mProcSupports;\t\t\t\t// プロセッシングユニットでサポートしている機能フラグ\n    protected int mCurrentFrameFormat = FRAME_FORMAT_MJPEG;\n\tprotected int mCurrentWidth = DEFAULT_PREVIEW_WIDTH, mCurrentHeight = DEFAULT_PREVIEW_HEIGHT;\n\tprotected float mCurrentBandwidthFactor = DEFAULT_BANDWIDTH;\n    protected String mSupportedSize;\n    protected List<Size> mCurrentSizeList;\n\t// these fields from here are accessed from native code and do not change name and remove\n    protected long mNativePtr;\n    protected int mScanningModeMin, mScanningModeMax, mScanningModeDef;\n    protected int mExposureModeMin, mExposureModeMax, mExposureModeDef;\n    protected int mExposurePriorityMin, mExposurePriorityMax, mExposurePriorityDef;\n    protected int mExposureMin, mExposureMax, mExposureDef;\n    protected int mAutoFocusMin, mAutoFocusMax, mAutoFocusDef;\n    protected int mFocusMin, mFocusMax, mFocusDef;\n    protected int mFocusRelMin, mFocusRelMax, mFocusRelDef;\n    protected int mFocusSimpleMin, mFocusSimpleMax, mFocusSimpleDef;\n    protected int mIrisMin, mIrisMax, mIrisDef;\n    protected int mIrisRelMin, mIrisRelMax, mIrisRelDef;\n    protected int mPanMin, mPanMax, mPanDef;\n    protected int mTiltMin, mTiltMax, mTiltDef;\n    protected int mRollMin, mRollMax, mRollDef;\n    protected int mPanRelMin, mPanRelMax, mPanRelDef;\n    protected int mTiltRelMin, mTiltRelMax, mTiltRelDef;\n    protected int mRollRelMin, mRollRelMax, mRollRelDef;\n    protected int mPrivacyMin, mPrivacyMax, mPrivacyDef;\n    protected int mAutoWhiteBlanceMin, mAutoWhiteBlanceMax, mAutoWhiteBlanceDef;\n    protected int mAutoWhiteBlanceCompoMin, mAutoWhiteBlanceCompoMax, mAutoWhiteBlanceCompoDef;\n    protected int mWhiteBlanceMin, mWhiteBlanceMax, mWhiteBlanceDef;\n    protected int mWhiteBlanceCompoMin, mWhiteBlanceCompoMax, mWhiteBlanceCompoDef;\n    protected int mWhiteBlanceRelMin, mWhiteBlanceRelMax, mWhiteBlanceRelDef;\n    protected int mBacklightCompMin, mBacklightCompMax, mBacklightCompDef;\n    protected int mBrightnessMin, mBrightnessMax, mBrightnessDef;\n    protected int mContrastMin, mContrastMax, mContrastDef;\n    protected int mSharpnessMin, mSharpnessMax, mSharpnessDef;\n    protected int mGainMin, mGainMax, mGainDef;\n    protected int mGammaMin, mGammaMax, mGammaDef;\n    protected int mSaturationMin, mSaturationMax, mSaturationDef;\n    protected int mHueMin, mHueMax, mHueDef;\n    protected int mZoomMin, mZoomMax, mZoomDef;\n    protected int mZoomRelMin, mZoomRelMax, mZoomRelDef;\n    protected int mPowerlineFrequencyMin, mPowerlineFrequencyMax, mPowerlineFrequencyDef;\n    protected int mMultiplierMin, mMultiplierMax, mMultiplierDef;\n    protected int mMultiplierLimitMin, mMultiplierLimitMax, mMultiplierLimitDef;\n    protected int mAnalogVideoStandardMin, mAnalogVideoStandardMax, mAnalogVideoStandardDef;\n    protected int mAnalogVideoLockStateMin, mAnalogVideoLockStateMax, mAnalogVideoLockStateDef;\n    // until here\n    /**\n     * the sonctructor of this class should be call within the thread that has a looper\n     * (UI thread or a thread that called Looper.prepare)\n     */\n    public UVCCamera() {\n    \tmNativePtr = nativeCreate();\n    \tmSupportedSize = null;\n\t}\n\n    /**\n     * connect to a UVC camera\n     * USB permission is necessary before this method is called\n     * @param ctrlBlock\n     */\n    public synchronized void open(final UsbControlBlock ctrlBlock) {\n    \tint result;\n    \ttry {\n\t\t\tmCtrlBlock = ctrlBlock.clone();\n\t\t\tresult = nativeConnect(mNativePtr,\n\t\t\t\tmCtrlBlock.getVenderId(), mCtrlBlock.getProductId(),\n\t\t\t\tmCtrlBlock.getFileDescriptor(),\n\t\t\t\tmCtrlBlock.getBusNum(),\n\t\t\t\tmCtrlBlock.getDevNum(),\n\t\t\t\tgetUSBFSName(mCtrlBlock));\n\t\t} catch (final Exception e) {\n\t\t\tLog.w(TAG, e);\n\t\t\tresult = -1;\n\t\t}\n\t\tif (result != 0) {\n\t\t\tthrow new UnsupportedOperationException(\"open failed:result=\" + result);\n\t\t}\n    \tif (mNativePtr != 0 && TextUtils.isEmpty(mSupportedSize)) {\n    \t\tmSupportedSize = nativeGetSupportedSize(mNativePtr);\n    \t}\n\t\tnativeSetPreviewSize(mNativePtr, DEFAULT_PREVIEW_WIDTH, DEFAULT_PREVIEW_HEIGHT,\n\t\t\tDEFAULT_PREVIEW_MIN_FPS, DEFAULT_PREVIEW_MAX_FPS, DEFAULT_PREVIEW_MODE, DEFAULT_BANDWIDTH);\n    }\n\n\t/**\n\t * set status callback\n\t * @param callback\n\t */\n\tpublic void setStatusCallback(final IStatusCallback callback) {\n\t\tif (mNativePtr != 0) {\n\t\t\tnativeSetStatusCallback(mNativePtr, callback);\n\t\t}\n\t}\n\n\t/**\n\t * set button callback\n\t * @param callback\n\t */\n\tpublic void setButtonCallback(final IButtonCallback callback) {\n\t\tif (mNativePtr != 0) {\n\t\t\tnativeSetButtonCallback(mNativePtr, callback);\n\t\t}\n\t}\n\n    /**\n     * close and release UVC camera\n     */\n    public synchronized void close() {\n    \tstopPreview();\n    \tif (mNativePtr != 0) {\n    \t\tnativeRelease(mNativePtr);\n//    \t\tmNativePtr = 0;\t// nativeDestroyを呼ぶのでここでクリアしちゃダメ\n    \t}\n    \tif (mCtrlBlock != null) {\n\t\t\tmCtrlBlock.close();\n   \t\t\tmCtrlBlock = null;\n\t\t}\n\t\tmControlSupports = mProcSupports = 0;\n\t\tmCurrentFrameFormat = -1;\n\t\tmCurrentBandwidthFactor = 0;\n\t\tmSupportedSize = null;\n\t\tmCurrentSizeList = null;\n    \tif (DEBUG) Log.v(TAG, \"close:finished\");\n    }\n\n\tpublic UsbDevice getDevice() {\n\t\treturn mCtrlBlock != null ? mCtrlBlock.getDevice() : null;\n\t}\n\n\tpublic String getDeviceName(){\n\t\treturn mCtrlBlock != null ? mCtrlBlock.getDeviceName() : null;\n\t}\n\n\tpublic UsbControlBlock getUsbControlBlock() {\n\t\treturn mCtrlBlock;\n\t}\n\n\tpublic synchronized String getSupportedSize() {\n    \treturn !TextUtils.isEmpty(mSupportedSize) ? mSupportedSize : (mSupportedSize = nativeGetSupportedSize(mNativePtr));\n    }\n\n\tpublic Size getPreviewSize() {\n\t\tSize result = null;\n\t\tfinal List<Size> list = getSupportedSizeList();\n\t\tfor (final Size sz: list) {\n\t\t\tif ((sz.width == mCurrentWidth)\n\t\t\t\t|| (sz.height == mCurrentHeight)) {\n\t\t\t\tresult =sz;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\t\n\t/**\n\t * Set preview size and preview mode\n\t * @param width\n\t   @param height\n\t */\n\tpublic void setPreviewSize(final int width, final int height) {\n\t\tsetPreviewSize(width, height, DEFAULT_PREVIEW_MIN_FPS, DEFAULT_PREVIEW_MAX_FPS, mCurrentFrameFormat, mCurrentBandwidthFactor);\n\t}\n\n\t/**\n\t * Set preview size and preview mode\n\t * @param width\n\t * @param height\n\t * @param frameFormat either FRAME_FORMAT_YUYV(0) or FRAME_FORMAT_MJPEG(1)\n\t */\n\tpublic void setPreviewSize(final int width, final int height, final int frameFormat) {\n\t\tsetPreviewSize(width, height, DEFAULT_PREVIEW_MIN_FPS, DEFAULT_PREVIEW_MAX_FPS, frameFormat, mCurrentBandwidthFactor);\n\t}\n\t\n\t/**\n\t * Set preview size and preview mode\n\t * @param width\n\t   @param height\n\t   @param frameFormat either FRAME_FORMAT_YUYV(0) or FRAME_FORMAT_MJPEG(1)\n\t   @param bandwidth [0.0f,1.0f]\n\t */\n\tpublic void setPreviewSize(final int width, final int height, final int frameFormat, final float bandwidth) {\n\t\tsetPreviewSize(width, height, DEFAULT_PREVIEW_MIN_FPS, DEFAULT_PREVIEW_MAX_FPS, frameFormat, bandwidth);\n\t}\n\n\t/**\n\t * Set preview size and preview mode\n\t * @param width\n\t * @param height\n\t * @param min_fps\n\t * @param max_fps\n\t * @param frameFormat either FRAME_FORMAT_YUYV(0) or FRAME_FORMAT_MJPEG(1)\n\t * @param bandwidthFactor\n\t */\n\tpublic void setPreviewSize(final int width, final int height, final int min_fps, final int max_fps, final int frameFormat, final float bandwidthFactor) {\n\t\tif ((width == 0) || (height == 0))\n\t\t\tthrow new IllegalArgumentException(\"invalid preview size\");\n\t\tif (mNativePtr != 0) {\n\t\t\tfinal int result = nativeSetPreviewSize(mNativePtr, width, height, min_fps, max_fps, frameFormat, bandwidthFactor);\n\t\t\tif (result != 0)\n\t\t\t\tthrow new IllegalArgumentException(\"Failed to set preview size\");\n\t\t\tmCurrentFrameFormat = frameFormat;\n\t\t\tmCurrentWidth = width;\n\t\t\tmCurrentHeight = height;\n\t\t\tmCurrentBandwidthFactor = bandwidthFactor;\n\t\t}\n\t}\n\n\tpublic List<Size> getSupportedSizeList() {\n\t\tfinal int type = (mCurrentFrameFormat > 0) ? 6 : 4;\n\t\treturn getSupportedSize(type, mSupportedSize);\n\t}\n\n\tpublic static List<Size> getSupportedSize(final int type, final String supportedSize) {\n\t\tfinal List<Size> result = new ArrayList<Size>();\n\t\tif (!TextUtils.isEmpty(supportedSize))\n\t\ttry {\n\t\t\tfinal JSONObject json = new JSONObject(supportedSize);\n\t\t\tfinal JSONArray formats = json.getJSONArray(\"formats\");\n\t\t\tfinal int format_nums = formats.length();\n\t\t\tfor (int i = 0; i < format_nums; i++) {\n\t\t\t\tfinal JSONObject format = formats.getJSONObject(i);\n\t\t\t\tif(format.has(\"type\") && format.has(\"size\")) {\n\t\t\t\t\tfinal int format_type = format.getInt(\"type\");\n\t\t\t\t\tif ((format_type == type) || (type == -1)) {\n\t\t\t\t\t\taddSize(format, format_type, 0, result);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (final JSONException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}\n\n\tprivate static final void addSize(final JSONObject format, final int formatType, final int frameType, final List<Size> size_list) throws JSONException {\n\t\tfinal JSONArray size = format.getJSONArray(\"size\");\n\t\tfinal int size_nums = size.length();\n\t\tfor (int j = 0; j < size_nums; j++) {\n\t\t\tfinal String[] sz = size.getString(j).split(\"x\");\n\t\t\ttry {\n\t\t\t\tsize_list.add(new Size(formatType, frameType, j, Integer.parseInt(sz[0]), Integer.parseInt(sz[1])));\n\t\t\t} catch (final Exception e) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n    /**\n     * set preview surface with SurfaceHolder</br>\n     * you can use SurfaceHolder came from SurfaceView/GLSurfaceView\n     * @param holder\n     */\n    public synchronized void setPreviewDisplay(final SurfaceHolder holder) {\n   \t\tnativeSetPreviewDisplay(mNativePtr, holder.getSurface());\n    }\n\n    /**\n     * set preview surface with SurfaceTexture.\n     * this method require API >= 14\n     * @param texture\n     */\n    public synchronized void setPreviewTexture(final SurfaceTexture texture) {\t// API >= 11\n    \tfinal Surface surface = new Surface(texture);\t// XXX API >= 14\n    \tnativeSetPreviewDisplay(mNativePtr, surface);\n    }\n\n    /**\n     * set preview surface with Surface\n     * @param surface\n     */\n    public synchronized void setPreviewDisplay(final Surface surface) {\n    \tnativeSetPreviewDisplay(mNativePtr, surface);\n    }\n\n    /**\n     * set frame callback\n     * @param callback\n     * @param pixelFormat\n     */\n    public void setFrameCallback(final IFrameCallback callback, final int pixelFormat) {\n    \tif (mNativePtr != 0) {\n        \tnativeSetFrameCallback(mNativePtr, callback, pixelFormat);\n    \t}\n    }\n\n    /**\n     * start preview\n     */\n    public synchronized void startPreview() {\n    \tif (mCtrlBlock != null) {\n    \t\tnativeStartPreview(mNativePtr);\n    \t}\n    }\n\n    /**\n     * stop preview\n     */\n    public synchronized void stopPreview() {\n    \tsetFrameCallback(null, 0);\n    \tif (mCtrlBlock != null) {\n    \t\tnativeStopPreview(mNativePtr);\n    \t}\n    }\n\n    /**\n     * destroy UVCCamera object\n     */\n    public synchronized void destroy() {\n    \tclose();\n    \tif (mNativePtr != 0) {\n    \t\tnativeDestroy(mNativePtr);\n    \t\tmNativePtr = 0;\n    \t}\n    }\n\n    // wrong result may return when you call this just after camera open.\n    // it is better to wait several hundreads millseconds.\n\tpublic boolean checkSupportFlag(final long flag) {\n    \tupdateCameraParams();\n    \tif ((flag & 0x80000000) == 0x80000000)\n    \t\treturn ((mProcSupports & flag) == (flag & 0x7ffffffF));\n    \telse\n    \t\treturn (mControlSupports & flag) == flag;\n    }\n\n//================================================================================\n\tpublic synchronized void setAutoFocus(final boolean autoFocus) {\n    \tif (mNativePtr != 0) {\n    \t\tnativeSetAutoFocus(mNativePtr, autoFocus);\n    \t}\n    }\n\n\tpublic synchronized boolean getAutoFocus() {\n    \tboolean result = true;\n    \tif (mNativePtr != 0) {\n    \t\tresult = nativeGetAutoFocus(mNativePtr) > 0;\n    \t}\n    \treturn result;\n    }\n//================================================================================\n    /**\n     * @param focus [%]\n     */\n\tpublic synchronized void setFocus(final int focus) {\n    \tif (mNativePtr != 0) {\n \t\t   final float range = Math.abs(mFocusMax - mFocusMin);\n \t\t   if (range > 0)\n \t\t\t   nativeSetFocus(mNativePtr, (int)(focus / 100.f * range) + mFocusMin);\n    \t}\n    }\n\n    /**\n     * @param focus_abs\n     * @return focus[%]\n     */\n\tpublic synchronized int getFocus(final int focus_abs) {\n\t   int result = 0;\n\t   if (mNativePtr != 0) {\n\t\t   nativeUpdateFocusLimit(mNativePtr);\n\t\t   final float range = Math.abs(mFocusMax - mFocusMin);\n\t\t   if (range > 0) {\n\t\t\t   result = (int)((focus_abs - mFocusMin) * 100.f / range);\n\t\t   }\n\t   }\n\t   return result;\n\t}\n\n    /**\n     * @return focus[%]\n     */\n\tpublic synchronized int getFocus() {\n    \treturn getFocus(nativeGetFocus(mNativePtr));\n    }\n\n\tpublic synchronized void resetFocus() {\n    \tif (mNativePtr != 0) {\n    \t\tnativeSetFocus(mNativePtr, mFocusDef);\n    \t}\n    }\n\n//================================================================================\n\tpublic synchronized void setAutoWhiteBlance(final boolean autoWhiteBlance) {\n    \tif (mNativePtr != 0) {\n    \t\tnativeSetAutoWhiteBlance(mNativePtr, autoWhiteBlance);\n    \t}\n    }\n\n\tpublic synchronized boolean getAutoWhiteBlance() {\n    \tboolean result = true;\n    \tif (mNativePtr != 0) {\n    \t\tresult = nativeGetAutoWhiteBlance(mNativePtr) > 0;\n    \t}\n    \treturn result;\n    }\n\n//================================================================================\n    /**\n     * @param whiteBlance [%]\n     */\n\tpublic synchronized void setWhiteBlance(final int whiteBlance) {\n    \tif (mNativePtr != 0) {\n \t\t   final float range = Math.abs(mWhiteBlanceMax - mWhiteBlanceMin);\n \t\t   if (range > 0)\n \t\t\t   nativeSetWhiteBlance(mNativePtr, (int)(whiteBlance / 100.f * range) + mWhiteBlanceMin);\n    \t}\n    }\n\n    /**\n     * @param whiteBlance_abs\n     * @return whiteBlance[%]\n     */\n\tpublic synchronized int getWhiteBlance(final int whiteBlance_abs) {\n\t   int result = 0;\n\t   if (mNativePtr != 0) {\n\t\t   nativeUpdateWhiteBlanceLimit(mNativePtr);\n\t\t   final float range = Math.abs(mWhiteBlanceMax - mWhiteBlanceMin);\n\t\t   if (range > 0) {\n\t\t\t   result = (int)((whiteBlance_abs - mWhiteBlanceMin) * 100.f / range);\n\t\t   }\n\t   }\n\t   return result;\n\t}\n\n    /**\n     * @return white blance[%]\n     */\n\tpublic synchronized int getWhiteBlance() {\n    \treturn getFocus(nativeGetWhiteBlance(mNativePtr));\n    }\n\n\tpublic synchronized void resetWhiteBlance() {\n    \tif (mNativePtr != 0) {\n    \t\tnativeSetWhiteBlance(mNativePtr, mWhiteBlanceDef);\n    \t}\n    }\n//================================================================================\n    /**\n     * @param brightness [%]\n     */\n\tpublic synchronized void setBrightness(final int brightness) {\n    \tif (mNativePtr != 0) {\n \t\t   final float range = Math.abs(mBrightnessMax - mBrightnessMin);\n \t\t   if (range > 0)\n \t\t\t   nativeSetBrightness(mNativePtr, (int)(brightness / 100.f * range) + mBrightnessMin);\n    \t}\n    }\n\n    /**\n     * @param brightness_abs\n     * @return brightness[%]\n     */\n\tpublic synchronized int getBrightness(final int brightness_abs) {\n\t   int result = 0;\n\t   if (mNativePtr != 0) {\n\t\t   nativeUpdateBrightnessLimit(mNativePtr);\n\t\t   final float range = Math.abs(mBrightnessMax - mBrightnessMin);\n\t\t   if (range > 0) {\n\t\t\t   result = (int)((brightness_abs - mBrightnessMin) * 100.f / range);\n\t\t   }\n\t   }\n\t   return result;\n\t}\n\n    /**\n     * @return brightness[%]\n     */\n\tpublic synchronized int getBrightness() {\n    \treturn getBrightness(nativeGetBrightness(mNativePtr));\n    }\n\n\tpublic synchronized void resetBrightness() {\n    \tif (mNativePtr != 0) {\n    \t\tnativeSetBrightness(mNativePtr, mBrightnessDef);\n    \t}\n    }\n\n//================================================================================\n    /**\n     * @param contrast [%]\n     */\n\tpublic synchronized void setContrast(final int contrast) {\n    \tif (mNativePtr != 0) {\n    \t\tnativeUpdateContrastLimit(mNativePtr);\n\t    \tfinal float range = Math.abs(mContrastMax - mContrastMin);\n\t    \tif (range > 0)\n\t    \t\tnativeSetContrast(mNativePtr, (int)(contrast / 100.f * range) + mContrastMin);\n    \t}\n    }\n\n    /**\n     * @param contrast_abs\n     * @return contrast[%]\n     */\n\tpublic synchronized int getContrast(final int contrast_abs) {\n\t   int result = 0;\n\t   if (mNativePtr != 0) {\n\t\t   final float range = Math.abs(mContrastMax - mContrastMin);\n\t\t   if (range > 0) {\n\t\t\t   result = (int)((contrast_abs - mContrastMin) * 100.f / range);\n\t\t   }\n\t   }\n\t   return result;\n\t}\n\n    /**\n     * @return contrast[%]\n     */\n\tpublic synchronized int getContrast() {\n    \treturn getContrast(nativeGetContrast(mNativePtr));\n    }\n\n\tpublic synchronized void resetContrast() {\n    \tif (mNativePtr != 0) {\n    \t\tnativeSetContrast(mNativePtr, mContrastDef);\n    \t}\n    }\n\n//================================================================================\n    /**\n     * @param sharpness [%]\n     */\n\tpublic synchronized void setSharpness(final int sharpness) {\n    \tif (mNativePtr != 0) {\n \t\t   final float range = Math.abs(mSharpnessMax - mSharpnessMin);\n \t\t   if (range > 0)\n \t\t\t   nativeSetSharpness(mNativePtr, (int)(sharpness / 100.f * range) + mSharpnessMin);\n    \t}\n    }\n\n    /**\n     * @param sharpness_abs\n     * @return sharpness[%]\n     */\n\tpublic synchronized int getSharpness(final int sharpness_abs) {\n\t   int result = 0;\n\t   if (mNativePtr != 0) {\n\t\t   nativeUpdateSharpnessLimit(mNativePtr);\n\t\t   final float range = Math.abs(mSharpnessMax - mSharpnessMin);\n\t\t   if (range > 0) {\n\t\t\t   result = (int)((sharpness_abs - mSharpnessMin) * 100.f / range);\n\t\t   }\n\t   }\n\t   return result;\n\t}\n\n    /**\n     * @return sharpness[%]\n     */\n\tpublic synchronized int getSharpness() {\n    \treturn getSharpness(nativeGetSharpness(mNativePtr));\n    }\n\n\tpublic synchronized void resetSharpness() {\n    \tif (mNativePtr != 0) {\n    \t\tnativeSetSharpness(mNativePtr, mSharpnessDef);\n    \t}\n    }\n//================================================================================\n    /**\n     * @param gain [%]\n     */\n\tpublic synchronized void setGain(final int gain) {\n    \tif (mNativePtr != 0) {\n \t\t   final float range = Math.abs(mGainMax - mGainMin);\n \t\t   if (range > 0)\n \t\t\t   nativeSetGain(mNativePtr, (int)(gain / 100.f * range) + mGainMin);\n    \t}\n    }\n\n    /**\n     * @param gain_abs\n     * @return gain[%]\n     */\n\tpublic synchronized int getGain(final int gain_abs) {\n\t   int result = 0;\n\t   if (mNativePtr != 0) {\n\t\t   nativeUpdateGainLimit(mNativePtr);\n\t\t   final float range = Math.abs(mGainMax - mGainMin);\n\t\t   if (range > 0) {\n\t\t\t   result = (int)((gain_abs - mGainMin) * 100.f / range);\n\t\t   }\n\t   }\n\t   return result;\n\t}\n\n    /**\n     * @return gain[%]\n     */\n\tpublic synchronized int getGain() {\n    \treturn getGain(nativeGetGain(mNativePtr));\n    }\n\n\tpublic synchronized void resetGain() {\n    \tif (mNativePtr != 0) {\n    \t\tnativeSetGain(mNativePtr, mGainDef);\n    \t}\n    }\n\n//================================================================================\n    /**\n     * @param gamma [%]\n     */\n\tpublic synchronized void setGamma(final int gamma) {\n    \tif (mNativePtr != 0) {\n \t\t   final float range = Math.abs(mGammaMax - mGammaMin);\n \t\t   if (range > 0)\n \t\t\t   nativeSetGamma(mNativePtr, (int)(gamma / 100.f * range) + mGammaMin);\n    \t}\n    }\n\n    /**\n     * @param gamma_abs\n     * @return gamma[%]\n     */\n\tpublic synchronized int getGamma(final int gamma_abs) {\n\t   int result = 0;\n\t   if (mNativePtr != 0) {\n\t\t   nativeUpdateGammaLimit(mNativePtr);\n\t\t   final float range = Math.abs(mGammaMax - mGammaMin);\n\t\t   if (range > 0) {\n\t\t\t   result = (int)((gamma_abs - mGammaMin) * 100.f / range);\n\t\t   }\n\t   }\n\t   return result;\n\t}\n\n    /**\n     * @return gamma[%]\n     */\n\tpublic synchronized int getGamma() {\n    \treturn getGamma(nativeGetGamma(mNativePtr));\n    }\n\n\tpublic synchronized void resetGamma() {\n    \tif (mNativePtr != 0) {\n    \t\tnativeSetGamma(mNativePtr, mGammaDef);\n    \t}\n    }\n\n//================================================================================\n    /**\n     * @param saturation [%]\n     */\n\tpublic synchronized void setSaturation(final int saturation) {\n    \tif (mNativePtr != 0) {\n \t\t   final float range = Math.abs(mSaturationMax - mSaturationMin);\n \t\t   if (range > 0)\n \t\t\t   nativeSetSaturation(mNativePtr, (int)(saturation / 100.f * range) + mSaturationMin);\n    \t}\n    }\n\n    /**\n     * @param saturation_abs\n     * @return saturation[%]\n     */\n\tpublic synchronized int getSaturation(final int saturation_abs) {\n\t   int result = 0;\n\t   if (mNativePtr != 0) {\n\t\t   nativeUpdateSaturationLimit(mNativePtr);\n\t\t   final float range = Math.abs(mSaturationMax - mSaturationMin);\n\t\t   if (range > 0) {\n\t\t\t   result = (int)((saturation_abs - mSaturationMin) * 100.f / range);\n\t\t   }\n\t   }\n\t   return result;\n\t}\n\n    /**\n     * @return saturation[%]\n     */\n\tpublic synchronized int getSaturation() {\n    \treturn getSaturation(nativeGetSaturation(mNativePtr));\n    }\n\n\tpublic synchronized void resetSaturation() {\n    \tif (mNativePtr != 0) {\n    \t\tnativeSetSaturation(mNativePtr, mSaturationDef);\n    \t}\n    }\n//================================================================================\n    /**\n     * @param hue [%]\n     */\n\tpublic synchronized void setHue(final int hue) {\n    \tif (mNativePtr != 0) {\n \t\t   final float range = Math.abs(mHueMax - mHueMin);\n \t\t   if (range > 0)\n \t\t\t   nativeSetHue(mNativePtr, (int)(hue / 100.f * range) + mHueMin);\n    \t}\n    }\n\n    /**\n     * @param hue_abs\n     * @return hue[%]\n     */\n\tpublic synchronized int getHue(final int hue_abs) {\n\t   int result = 0;\n\t   if (mNativePtr != 0) {\n\t\t   nativeUpdateHueLimit(mNativePtr);\n\t\t   final float range = Math.abs(mHueMax - mHueMin);\n\t\t   if (range > 0) {\n\t\t\t   result = (int)((hue_abs - mHueMin) * 100.f / range);\n\t\t   }\n\t   }\n\t   return result;\n\t}\n\n    /**\n     * @return hue[%]\n     */\n\tpublic synchronized int getHue() {\n    \treturn getHue(nativeGetHue(mNativePtr));\n    }\n\n\tpublic synchronized void resetHue() {\n    \tif (mNativePtr != 0) {\n    \t\tnativeSetHue(mNativePtr, mSaturationDef);\n    \t}\n    }\n\n//================================================================================\n\tpublic void setPowerlineFrequency(final int frequency) {\n    \tif (mNativePtr != 0)\n    \t\tnativeSetPowerlineFrequency(mNativePtr, frequency);\n    }\n\n\tpublic int getPowerlineFrequency() {\n    \treturn nativeGetPowerlineFrequency(mNativePtr);\n    }\n\n//================================================================================\n    /**\n     * this may not work well with some combination of camera and device\n     * @param zoom [%]\n     */\n\tpublic synchronized void setZoom(final int zoom) {\n    \tif (mNativePtr != 0) {\n \t\t   final float range = Math.abs(mZoomMax - mZoomMin);\n \t\t   if (range > 0) {\n \t\t\t   final int z = (int)(zoom / 100.f * range) + mZoomMin;\n// \t\t\t   Log.d(TAG, \"setZoom:zoom=\" + zoom + \" ,value=\" + z);\n \t\t\t   nativeSetZoom(mNativePtr, z);\n \t\t   }\n    \t}\n    }\n\n    /**\n     * @param zoom_abs\n     * @return zoom[%]\n     */\n\tpublic synchronized int getZoom(final int zoom_abs) {\n\t   int result = 0;\n\t   if (mNativePtr != 0) {\n\t\t   nativeUpdateZoomLimit(mNativePtr);\n\t\t   final float range = Math.abs(mZoomMax - mZoomMin);\n\t\t   if (range > 0) {\n\t\t\t   result = (int)((zoom_abs - mZoomMin) * 100.f / range);\n\t\t   }\n\t   }\n\t   return result;\n\t}\n\n    /**\n     * @return zoom[%]\n     */\n\tpublic synchronized int getZoom() {\n    \treturn getZoom(nativeGetZoom(mNativePtr));\n    }\n\n\tpublic synchronized void resetZoom() {\n    \tif (mNativePtr != 0) {\n    \t\tnativeSetZoom(mNativePtr, mZoomDef);\n    \t}\n    }\n\n//================================================================================\n\tpublic synchronized void updateCameraParams() {\n    \tif (mNativePtr != 0) {\n    \t\tif ((mControlSupports == 0) || (mProcSupports == 0)) {\n        \t\t// サポートしている機能フラグを取得\n    \t\t\tif (mControlSupports == 0)\n    \t\t\t\tmControlSupports = nativeGetCtrlSupports(mNativePtr);\n    \t\t\tif (mProcSupports == 0)\n    \t\t\t\tmProcSupports = nativeGetProcSupports(mNativePtr);\n    \t    \t// 設定値を取得\n    \t    \tif ((mControlSupports != 0) && (mProcSupports != 0)) {\n\t    \t    \tnativeUpdateBrightnessLimit(mNativePtr);\n\t    \t    \tnativeUpdateContrastLimit(mNativePtr);\n\t    \t    \tnativeUpdateSharpnessLimit(mNativePtr);\n\t    \t    \tnativeUpdateGainLimit(mNativePtr);\n\t    \t    \tnativeUpdateGammaLimit(mNativePtr);\n\t    \t    \tnativeUpdateSaturationLimit(mNativePtr);\n\t    \t    \tnativeUpdateHueLimit(mNativePtr);\n\t    \t    \tnativeUpdateZoomLimit(mNativePtr);\n\t    \t    \tnativeUpdateWhiteBlanceLimit(mNativePtr);\n\t    \t    \tnativeUpdateFocusLimit(mNativePtr);\n    \t    \t}\n    \t    \tif (DEBUG) {\n\t\t\t\t\tdumpControls(mControlSupports);\n\t\t\t\t\tdumpProc(mProcSupports);\n\t\t\t\t\tLog.v(TAG, String.format(\"Brightness:min=%d,max=%d,def=%d\", mBrightnessMin, mBrightnessMax, mBrightnessDef));\n\t\t\t\t\tLog.v(TAG, String.format(\"Contrast:min=%d,max=%d,def=%d\", mContrastMin, mContrastMax, mContrastDef));\n\t\t\t\t\tLog.v(TAG, String.format(\"Sharpness:min=%d,max=%d,def=%d\", mSharpnessMin, mSharpnessMax, mSharpnessDef));\n\t\t\t\t\tLog.v(TAG, String.format(\"Gain:min=%d,max=%d,def=%d\", mGainMin, mGainMax, mGainDef));\n\t\t\t\t\tLog.v(TAG, String.format(\"Gamma:min=%d,max=%d,def=%d\", mGammaMin, mGammaMax, mGammaDef));\n\t\t\t\t\tLog.v(TAG, String.format(\"Saturation:min=%d,max=%d,def=%d\", mSaturationMin, mSaturationMax, mSaturationDef));\n\t\t\t\t\tLog.v(TAG, String.format(\"Hue:min=%d,max=%d,def=%d\", mHueMin, mHueMax, mHueDef));\n\t\t\t\t\tLog.v(TAG, String.format(\"Zoom:min=%d,max=%d,def=%d\", mZoomMin, mZoomMax, mZoomDef));\n\t\t\t\t\tLog.v(TAG, String.format(\"WhiteBlance:min=%d,max=%d,def=%d\", mWhiteBlanceMin, mWhiteBlanceMax, mWhiteBlanceDef));\n\t\t\t\t\tLog.v(TAG, String.format(\"Focus:min=%d,max=%d,def=%d\", mFocusMin, mFocusMax, mFocusDef));\n\t\t\t\t}\n\t\t\t}\n    \t} else {\n    \t\tmControlSupports = mProcSupports = 0;\n    \t}\n    }\n\n    private static final String[] SUPPORTS_CTRL = {\n    \t\"D0:  Scanning Mode\",\n    \t\"D1:  Auto-Exposure Mode\",\n    \t\"D2:  Auto-Exposure Priority\",\n    \t\"D3:  Exposure Time (Absolute)\",\n    \t\"D4:  Exposure Time (Relative)\",\n    \t\"D5:  Focus (Absolute)\",\n    \t\"D6:  Focus (Relative)\",\n    \t\"D7:  Iris (Absolute)\",\n    \t\"D8:  Iris (Relative)\",\n    \t\"D9:  Zoom (Absolute)\",\n    \t\"D10: Zoom (Relative)\",\n    \t\"D11: PanTilt (Absolute)\",\n    \t\"D12: PanTilt (Relative)\",\n    \t\"D13: Roll (Absolute)\",\n    \t\"D14: Roll (Relative)\",\n\t\t\"D15: Reserved\",\n\t\t\"D16: Reserved\",\n\t\t\"D17: Focus, Auto\",\n\t\t\"D18: Privacy\",\n\t\t\"D19: Focus, Simple\",\n\t\t\"D20: Window\",\n\t\t\"D21: Region of Interest\",\n\t\t\"D22: Reserved, set to zero\",\n\t\t\"D23: Reserved, set to zero\",\n    };\n\n    private static final String[] SUPPORTS_PROC = {\n\t\t\"D0: Brightness\",\n\t\t\"D1: Contrast\",\n\t\t\"D2: Hue\",\n\t\t\"D3: Saturation\",\n\t\t\"D4: Sharpness\",\n\t\t\"D5: Gamma\",\n\t\t\"D6: White Balance Temperature\",\n\t\t\"D7: White Balance Component\",\n\t\t\"D8: Backlight Compensation\",\n\t\t\"D9: Gain\",\n\t\t\"D10: Power Line Frequency\",\n\t\t\"D11: Hue, Auto\",\n\t\t\"D12: White Balance Temperature, Auto\",\n\t\t\"D13: White Balance Component, Auto\",\n\t\t\"D14: Digital Multiplier\",\n\t\t\"D15: Digital Multiplier Limit\",\n\t\t\"D16: Analog Video Standard\",\n\t\t\"D17: Analog Video Lock Status\",\n\t\t\"D18: Contrast, Auto\",\n\t\t\"D19: Reserved. Set to zero\",\n\t\t\"D20: Reserved. Set to zero\",\n\t\t\"D21: Reserved. Set to zero\",\n\t\t\"D22: Reserved. Set to zero\",\n\t\t\"D23: Reserved. Set to zero\",\n\t};\n\n    private static final void dumpControls(final long controlSupports) {\n    \tLog.i(TAG, String.format(\"controlSupports=%x\", controlSupports));\n    \tfor (int i = 0; i < SUPPORTS_CTRL.length; i++) {\n    \t\tLog.i(TAG, SUPPORTS_CTRL[i] + ((controlSupports & (0x1 << i)) != 0 ? \"=enabled\" : \"=disabled\"));\n    \t}\n    }\n\n\tprivate static final void dumpProc(final long procSupports) {\n    \tLog.i(TAG, String.format(\"procSupports=%x\", procSupports));\n    \tfor (int i = 0; i < SUPPORTS_PROC.length; i++) {\n    \t\tLog.i(TAG, SUPPORTS_PROC[i] + ((procSupports & (0x1 << i)) != 0 ? \"=enabled\" : \"=disabled\"));\n    \t}\n    }\n\n\tprivate final String getUSBFSName(final UsbControlBlock ctrlBlock) {\n\t\tString result = null;\n\t\tfinal String name = ctrlBlock.getDeviceName();\n\t\tfinal String[] v = !TextUtils.isEmpty(name) ? name.split(\"/\") : null;\n\t\tif ((v != null) && (v.length > 2)) {\n\t\t\tfinal StringBuilder sb = new StringBuilder(v[0]);\n\t\t\tfor (int i = 1; i < v.length - 2; i++)\n\t\t\t\tsb.append(\"/\").append(v[i]);\n\t\t\tresult = sb.toString();\n\t\t}\n\t\tif (TextUtils.isEmpty(result)) {\n\t\t\tLog.w(TAG, \"failed to get USBFS path, try to use default path:\" + name);\n\t\t\tresult = DEFAULT_USBFS;\n\t\t}\n\t\treturn result;\n\t}\n\n    // #nativeCreate and #nativeDestroy are not static methods.\n    private final native long nativeCreate();\n    private final native void nativeDestroy(final long id_camera);\n\n    private final native int nativeConnect(long id_camera, int venderId, int productId, int fileDescriptor, int busNum, int devAddr, String usbfs);\n    private static final native int nativeRelease(final long id_camera);\n\n\tprivate static final native int nativeSetStatusCallback(final long mNativePtr, final IStatusCallback callback);\n\tprivate static final native int nativeSetButtonCallback(final long mNativePtr, final IButtonCallback callback);\n\n    private static final native int nativeSetPreviewSize(final long id_camera, final int width, final int height, final int min_fps, final int max_fps, final int mode, final float bandwidth);\n    private static final native String nativeGetSupportedSize(final long id_camera);\n    private static final native int nativeStartPreview(final long id_camera);\n    private static final native int nativeStopPreview(final long id_camera);\n    private static final native int nativeSetPreviewDisplay(final long id_camera, final Surface surface);\n    private static final native int nativeSetFrameCallback(final long mNativePtr, final IFrameCallback callback, final int pixelFormat);\n\n//**********************************************************************\n    /**\n     * start movie capturing(this should call while previewing)\n     * @param surface\n     */\n    public void startCapture(final Surface surface) {\n    \tif (mCtrlBlock != null && surface != null) {\n    \t\tnativeSetCaptureDisplay(mNativePtr, surface);\n    \t} else\n    \t\tthrow new NullPointerException(\"startCapture\");\n    }\n\n    /**\n     * stop movie capturing\n     */\n    public void stopCapture() {\n    \tif (mCtrlBlock != null) {\n    \t\tnativeSetCaptureDisplay(mNativePtr, null);\n    \t}\n    }\n    private static final native int nativeSetCaptureDisplay(final long id_camera, final Surface surface);\n\n    private static final native long nativeGetCtrlSupports(final long id_camera);\n    private static final native long nativeGetProcSupports(final long id_camera);\n\n    private final native int nativeUpdateScanningModeLimit(final long id_camera);\n    private static final native int nativeSetScanningMode(final long id_camera, final int scanning_mode);\n    private static final native int nativeGetScanningMode(final long id_camera);\n\n\tprivate final native int nativeUpdateExposureModeLimit(final long id_camera);\n    private static final native int nativeSetExposureMode(final long id_camera, final int exposureMode);\n    private static final native int nativeGetExposureMode(final long id_camera);\n\n\tprivate final native int nativeUpdateExposurePriorityLimit(final long id_camera);\n    private static final native int nativeSetExposurePriority(final long id_camera, final int priority);\n    private static final native int nativeGetExposurePriority(final long id_camera);\n\n\tprivate final native int nativeUpdateExposureLimit(final long id_camera);\n    private static final native int nativeSetExposure(final long id_camera, final int exposure);\n    private static final native int nativeGetExposure(final long id_camera);\n\n\tprivate final native int nativeUpdateExposureRelLimit(final long id_camera);\n    private static final native int nativeSetExposureRel(final long id_camera, final int exposure_rel);\n    private static final native int nativeGetExposureRel(final long id_camera);\n\n\tprivate final native int nativeUpdateAutoFocusLimit(final long id_camera);\n    private static final native int nativeSetAutoFocus(final long id_camera, final boolean autofocus);\n    private static final native int nativeGetAutoFocus(final long id_camera);\n\n    private final native int nativeUpdateFocusLimit(final long id_camera);\n    private static final native int nativeSetFocus(final long id_camera, final int focus);\n    private static final native int nativeGetFocus(final long id_camera);\n\n    private final native int nativeUpdateFocusRelLimit(final long id_camera);\n    private static final native int nativeSetFocusRel(final long id_camera, final int focus_rel);\n    private static final native int nativeGetFocusRel(final long id_camera);\n\n    private final native int nativeUpdateIrisLimit(final long id_camera);\n    private static final native int nativeSetIris(final long id_camera, final int iris);\n    private static final native int nativeGetIris(final long id_camera);\n\n    private final native int nativeUpdateIrisRelLimit(final long id_camera);\n    private static final native int nativeSetIrisRel(final long id_camera, final int iris_rel);\n    private static final native int nativeGetIrisRel(final long id_camera);\n\n    private final native int nativeUpdatePanLimit(final long id_camera);\n    private static final native int nativeSetPan(final long id_camera, final int pan);\n    private static final native int nativeGetPan(final long id_camera);\n\n    private final native int nativeUpdatePanRelLimit(final long id_camera);\n    private static final native int nativeSetPanRel(final long id_camera, final int pan_rel);\n    private static final native int nativeGetPanRel(final long id_camera);\n\n    private final native int nativeUpdateTiltLimit(final long id_camera);\n    private static final native int nativeSetTilt(final long id_camera, final int tilt);\n    private static final native int nativeGetTilt(final long id_camera);\n\n    private final native int nativeUpdateTiltRelLimit(final long id_camera);\n    private static final native int nativeSetTiltRel(final long id_camera, final int tilt_rel);\n    private static final native int nativeGetTiltRel(final long id_camera);\n\n    private final native int nativeUpdateRollLimit(final long id_camera);\n    private static final native int nativeSetRoll(final long id_camera, final int roll);\n    private static final native int nativeGetRoll(final long id_camera);\n\n    private final native int nativeUpdateRollRelLimit(final long id_camera);\n    private static final native int nativeSetRollRel(final long id_camera, final int roll_rel);\n    private static final native int nativeGetRollRel(final long id_camera);\n\n\tprivate final native int nativeUpdateAutoWhiteBlanceLimit(final long id_camera);\n    private static final native int nativeSetAutoWhiteBlance(final long id_camera, final boolean autoWhiteBlance);\n    private static final native int nativeGetAutoWhiteBlance(final long id_camera);\n\n    private final native int nativeUpdateAutoWhiteBlanceCompoLimit(final long id_camera);\n    private static final native int nativeSetAutoWhiteBlanceCompo(final long id_camera, final boolean autoWhiteBlanceCompo);\n    private static final native int nativeGetAutoWhiteBlanceCompo(final long id_camera);\n\n\tprivate final native int nativeUpdateWhiteBlanceLimit(final long id_camera);\n    private static final native int nativeSetWhiteBlance(final long id_camera, final int whiteBlance);\n    private static final native int nativeGetWhiteBlance(final long id_camera);\n\n\tprivate final native int nativeUpdateWhiteBlanceCompoLimit(final long id_camera);\n    private static final native int nativeSetWhiteBlanceCompo(final long id_camera, final int whiteBlance_compo);\n    private static final native int nativeGetWhiteBlanceCompo(final long id_camera);\n\n\tprivate final native int nativeUpdateBacklightCompLimit(final long id_camera);\n    private static final native int nativeSetBacklightComp(final long id_camera, final int backlight_comp);\n    private static final native int nativeGetBacklightComp(final long id_camera);\n\n\tprivate final native int nativeUpdateBrightnessLimit(final long id_camera);\n    private static final native int nativeSetBrightness(final long id_camera, final int brightness);\n    private static final native int nativeGetBrightness(final long id_camera);\n\n    private final native int nativeUpdateContrastLimit(final long id_camera);\n    private static final native int nativeSetContrast(final long id_camera, final int contrast);\n    private static final native int nativeGetContrast(final long id_camera);\n\n\tprivate final native int nativeUpdateAutoContrastLimit(final long id_camera);\n    private static final native int nativeSetAutoContrast(final long id_camera, final boolean autocontrast);\n    private static final native int nativeGetAutoContrast(final long id_camera);\n\n\tprivate final native int nativeUpdateSharpnessLimit(final long id_camera);\n    private static final native int nativeSetSharpness(final long id_camera, final int sharpness);\n    private static final native int nativeGetSharpness(final long id_camera);\n\n    private final native int nativeUpdateGainLimit(final long id_camera);\n    private static final native int nativeSetGain(final long id_camera, final int gain);\n    private static final native int nativeGetGain(final long id_camera);\n\n    private final native int nativeUpdateGammaLimit(final long id_camera);\n    private static final native int nativeSetGamma(final long id_camera, final int gamma);\n    private static final native int nativeGetGamma(final long id_camera);\n\n    private final native int nativeUpdateSaturationLimit(final long id_camera);\n    private static final native int nativeSetSaturation(final long id_camera, final int saturation);\n    private static final native int nativeGetSaturation(final long id_camera);\n\n    private final native int nativeUpdateHueLimit(final long id_camera);\n    private static final native int nativeSetHue(final long id_camera, final int hue);\n    private static final native int nativeGetHue(final long id_camera);\n\n\tprivate final native int nativeUpdateAutoHueLimit(final long id_camera);\n\tprivate static final native int nativeSetAutoHue(final long id_camera, final boolean autohue);\n\tprivate static final native int nativeGetAutoHue(final long id_camera);\n\n\tprivate final native int nativeUpdatePowerlineFrequencyLimit(final long id_camera);\n    private static final native int nativeSetPowerlineFrequency(final long id_camera, final int frequency);\n    private static final native int nativeGetPowerlineFrequency(final long id_camera);\n\n    private final native int nativeUpdateZoomLimit(final long id_camera);\n    private static final native int nativeSetZoom(final long id_camera, final int zoom);\n    private static final native int nativeGetZoom(final long id_camera);\n\n    private final native int nativeUpdateZoomRelLimit(final long id_camera);\n    private static final native int nativeSetZoomRel(final long id_camera, final int zoom_rel);\n    private static final native int nativeGetZoomRel(final long id_camera);\n\n    private final native int nativeUpdateDigitalMultiplierLimit(final long id_camera);\n    private static final native int nativeSetDigitalMultiplier(final long id_camera, final int multiplier);\n    private static final native int nativeGetDigitalMultiplier(final long id_camera);\n\n\tprivate final native int nativeUpdateDigitalMultiplierLimitLimit(final long id_camera);\n    private static final native int nativeSetDigitalMultiplierLimit(final long id_camera, final int multiplier_limit);\n    private static final native int nativeGetDigitalMultiplierLimit(final long id_camera);\n\n\tprivate final native int nativeUpdateAnalogVideoStandardLimit(final long id_camera);\n    private static final native int nativeSetAnalogVideoStandard(final long id_camera, final int standard);\n    private static final native int nativeGetAnalogVideoStandard(final long id_camera);\n\n\tprivate final native int nativeUpdateAnalogVideoLockStateLimit(final long id_camera);\n    private static final native int nativeSetAnalogVideoLoackState(final long id_camera, final int state);\n    private static final native int nativeGetAnalogVideoLoackState(final long id_camera);\n\n\tprivate final native int nativeUpdatePrivacyLimit(final long id_camera);\n    private static final native int nativeSetPrivacy(final long id_camera, final boolean privacy);\n    private static final native int nativeGetPrivacy(final long id_camera);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/Android.mk",
    "content": "#include $(call all-subdir-makefiles)\nPROJ_PATH\t:= $(call my-dir)\ninclude $(CLEAR_VARS)\ninclude $(PROJ_PATH)/UVCCamera/Android.mk\ninclude $(PROJ_PATH)/libjpeg-turbo-1.5.0/Android.mk\ninclude $(PROJ_PATH)/libusb/android/jni/Android.mk\ninclude $(PROJ_PATH)/libuvc/android/jni/Android.mk"
  },
  {
    "path": "libuvccamera/src/main/jni/Application.mk",
    "content": "#/*\n# * UVCCamera\n# * library and sample to access to UVC web camera on non-rooted Android device\n# * \n# * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n# * \n# * File name: Application.mk\n# * \n# * Licensed under the Apache License, Version 2.0 (the \"License\");\n# * you may not use this file except in compliance with the License.\n# *  You may obtain a copy of the License at\n# * \n# *     http://www.apache.org/licenses/LICENSE-2.0\n# * \n# *  Unless required by applicable law or agreed to in writing, software\n# *  distributed under the License is distributed on an \"AS IS\" BASIS,\n# *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# *  See the License for the specific language governing permissions and\n# *  limitations under the License.\n# * \n# * All files in the folder are under this Apache License, Version 2.0.\n# * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n#*/\n\n# This is just for mips, if you really needs MSA, un-comment and build with GCC.\n# Note: Supporting GCC on NDK is already deprecated and GCC will be removed from NDK soon.\n#NDK_TOOLCHAIN_VERSION := 4.9\n\nAPP_PLATFORM := android-14\nAPP_ABI := armeabi armeabi-v7a x86 mips\n#APP_OPTIM := debug\nAPP_OPTIM := release\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/Android.mk",
    "content": "#/*\n# * UVCCamera\n# * library and sample to access to UVC web camera on non-rooted Android device\n# * \n# * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n# * \n# * File name: Android.mk\n# * \n# * Licensed under the Apache License, Version 2.0 (the \"License\");\n# * you may not use this file except in compliance with the License.\n# *  You may obtain a copy of the License at\n# * \n# *     http://www.apache.org/licenses/LICENSE-2.0\n# * \n# *  Unless required by applicable law or agreed to in writing, software\n# *  distributed under the License is distributed on an \"AS IS\" BASIS,\n# *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# *  See the License for the specific language governing permissions and\n# *  limitations under the License.\n# * \n# * All files in the folder are under this Apache License, Version 2.0.\n# * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n#*/\n\n######################################################################\n# Make shared library libUVCCamera.so\n######################################################################\nLOCAL_PATH\t:= $(call my-dir)\ninclude $(CLEAR_VARS)\n\n######################################################################\n# Make shared library libUVCCamera.so\n######################################################################\nCFLAGS := -Werror\n\nLOCAL_C_INCLUDES := \\\n\t\t$(LOCAL_PATH)/ \\\n\t\t$(LOCAL_PATH)/../ \\\n\t\t$(LOCAL_PATH)/../rapidjson/include \\\n\nLOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%)\nLOCAL_CFLAGS += -DANDROID_NDK\nLOCAL_CFLAGS += -DLOG_NDEBUG\nLOCAL_CFLAGS += -DACCESS_RAW_DESCRIPTORS\nLOCAL_CFLAGS += -O3 -fstrict-aliasing -fprefetch-loop-arrays\n\nLOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -ldl\nLOCAL_LDLIBS += -llog\nLOCAL_LDLIBS += -landroid\n\nLOCAL_SHARED_LIBRARIES += usb100 uvc\n\nLOCAL_ARM_MODE := arm\n\nLOCAL_SRC_FILES := \\\n\t\t_onload.cpp \\\n\t\tutilbase.cpp \\\n\t\tUVCCamera.cpp \\\n\t\tUVCPreview.cpp \\\n\t\tUVCButtonCallback.cpp \\\n\t\tUVCStatusCallback.cpp \\\n\t\tParameters.cpp \\\n\t\tserenegiant_usb_UVCCamera.cpp\n\nLOCAL_MODULE    := UVCCamera\ninclude $(BUILD_SHARED_LIBRARY)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/Parameters.cpp",
    "content": "/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n * File name: Parameters.cpp\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n*/\n#define LOG_TAG \"Parameters\"\n\n#include \"Parameters.h\"\n#include \"rapidjson/rapidjson.h\"\n#include \"rapidjson/stringbuffer.h\"\n#include \"rapidjson/writer.h\"\n#include \"libuvc/libuvc_internal.h\"\n\nusing namespace rapidjson;\n\nstatic void write(Writer<StringBuffer> &writer, const char *key, const char *value) {\n\twriter.String(key);\n\twriter.String(value);\n}\n\nstatic void write(Writer<StringBuffer> &writer, const char *key, uint16_t value) {\n\twriter.String(key);\n\twriter.Uint(value);\n}\n\nstatic void write(Writer<StringBuffer> &writer, const char *key, int32_t value) {\n\twriter.String(key);\n\twriter.Int(value);\n}\n\nstatic void write(Writer<StringBuffer> &writer, const char *key, uint32_t value) {\n\twriter.String(key);\n\twriter.Uint(value);\n}\n\nstatic void write(Writer<StringBuffer> &writer, const char *key, int64_t value) {\n\twriter.String(key);\n\twriter.Int64(value);\n}\n\nstatic void write(Writer<StringBuffer> &writer, const char *key, uint64_t value) {\n\twriter.String(key);\n\twriter.Uint64(value);\n}\n\nstatic const char *_uvc_name_for_format_subtype(uint8_t subtype) {\n\tswitch (subtype) {\n\tcase UVC_VS_FORMAT_UNCOMPRESSED:\n\t\treturn \"UncompressedFormat\";\n\tcase UVC_VS_FORMAT_MJPEG:\n\t\treturn \"MJPEGFormat\";\n\tdefault:\n\t\treturn \"Unknown\";\n\t}\n}\n\n#define\tINDEX\t\t\t\t\t\t\"index\"\n#define TYPE\t\t\t\t\t\t\"type\"\n#define SUBTYPE\t\t\t\t\t\t\"subType\"\n#define WIDTH\t\t\t\t\t\t\"width\"\n#define HEIGHT\t\t\t\t\t\t\"height\"\n#define\tVALUE\t\t\t\t\t\t\"value\"\n#define DETAIL\t\t\t\t\t\t\"detail\"\n\n#define DESCRIPTION\t\t\t\t\t\"description\"\n#define DESC_SUBTYPE\t\t\t\tSUBTYPE\n#define\tDESC_VENDERID\t\t\t\t\"venderId\"\n#define\tDESC_PRODUCTID\t\t\t\t\"productId\"\n#define\tDESC_SERIALNUMBER\t\t\t\"serialNumber\"\n#define DESC_MANIFUCTURE\t\t\t\"manifuctureName\"\n#define DESC_PRODUCT\t\t\t\t\"productName\"\n#define DESC_UVC\t\t\t\t\t\"uvc\"\n#define DESC_VIDEO_CONTROL\t\t\t\"videoControl\"\n#define DESC_INTERFACES\t\t\t\t\"interfaces\"\n\n#define INTERFACE_TYPE \t\t\t\tTYPE\n#define INTERFACE_TYPE_VIDEOSTREAM\t\"videoStreaming\"\n#define INTERFACE_TYPE_AUDIOSTREAM\t\"audioStreaming\"\n#define INTERFACE_INDEX\t\t\t\tINDEX\n#define INTERFACE_ENDPOINT_ADDR\t\t\"endpointAddress\"\n\n#define\tFORMATS\t\t\t\t\t\t\"formats\"\n#define FORMAT_INDEX\t\t\t\tINDEX\n#define FORMAT_NAME\t\t\t\t\t\"format\"\n#define FORMAT_DETAIL\t\t\t\tDETAIL\n#define FORMAT_BITS_PER_PIXEL\t\t\"bitsPerPixel\"\n#define FORMAT_GUID\t\t\t\t\t\"GUID\"\n#define FORMAT_DEFAULT_FRAME_INDEX\t\"defaultFrameIndex\"\n#define FORMAT_ASPECTRATIO_X\t\t\"aspectRatioX\"\n#define FORMAT_ASPECTRATIO_Y\t\t\"aspectRatioY\"\n#define FORMAT_INTERLACE_FLAGS\t\t\"interlaceFlags\"\n#define FORMAT_COPY_PROTECT\t\t\t\"copyProtect\"\n#define FORMAT_FRAMEDESCRIPTORS\t\t\"frameDescriptors\"\n\n#define FRAME_INDEX\t\t\t\t\tINDEX\n#define FRAME_CAPABILITIES\t\t\t\"capabilities\"\n#define\tFRAME_WIDTH\t\t\t\t\tWIDTH\n#define\tFRAME_HEIGHT\t\t\t\tHEIGHT\n#define FRAME_BITRATE_MIN\t\t\t\"minBitRate\"\n#define FRAME_BITRATE_MAX\t\t\t\"maxBitRate\"\n#define FRAME_FRAMEBUFFERSIZE_MAX\t\"maxFrameBufferSize\"\n#define FRAME_INTERVAL_DEFAULT\t\t\"defaultFrameInterval\"\n#define FRAME_FPS_DEFAULT\t\t\t\"defaultFps\"\n#define FRAME_INTERVALS\t\t\t\t\"intervals\"\n#define FRAME_INTERVAL_INDEX\t\tINDEX\n#define FRAME_INTERVAL_VALUE\t\tVALUE\n#define FRAME_INTERVAL_FPS\t\t\t\"fps\"\n#define FRAME_INTERVAL_MIN\t\t\t\"minFrameInterval\"\n#define FRAME_INTERVAL_MAX\t\t\t\"maxFrameInterval\"\n#define FRAME_INTERVAL_STEP\t\t\t\"frameIntervalStep\"\n\nstatic void writerFormat(Writer<StringBuffer> &writer, uvc_format_desc_t *fmt_desc) {\n\tuvc_frame_desc_t *frame_desc;\n\tchar work[256];\n\n\twriter.String(FORMAT_DETAIL);\n\twriter.StartObject();\n\t{\n\t\twrite(writer, FORMAT_BITS_PER_PIXEL, fmt_desc->bBitsPerPixel);\n\t\tsprintf(work,\n\t\t\t\"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\",\n\t\t\t\tfmt_desc->guidFormat[0], fmt_desc->guidFormat[1],\n\t\t\t\tfmt_desc->guidFormat[2], fmt_desc->guidFormat[3],\n\t\t\t\tfmt_desc->guidFormat[4], fmt_desc->guidFormat[5],\n\t\t\t\tfmt_desc->guidFormat[6], fmt_desc->guidFormat[7],\n\t\t\t\tfmt_desc->guidFormat[8], fmt_desc->guidFormat[9],\n\t\t\t\tfmt_desc->guidFormat[10], fmt_desc->guidFormat[11],\n\t\t\t\tfmt_desc->guidFormat[12], fmt_desc->guidFormat[13],\n\t\t\t\tfmt_desc->guidFormat[14], fmt_desc->guidFormat[15]);\n\t\twrite(writer, FORMAT_GUID, work);\n\t\twrite(writer, FORMAT_DEFAULT_FRAME_INDEX, fmt_desc->bDefaultFrameIndex);\n\t\twrite(writer, FORMAT_ASPECTRATIO_X, fmt_desc->bAspectRatioX);\n\t\twrite(writer, FORMAT_ASPECTRATIO_Y, fmt_desc->bAspectRatioY);\n\t\twrite(writer, FORMAT_INTERLACE_FLAGS, fmt_desc->bmInterlaceFlags);\n\t\twrite(writer, FORMAT_COPY_PROTECT, fmt_desc->bCopyProtect);\n\n\t\twriter.String(FORMAT_FRAMEDESCRIPTORS);\n\t\twriter.StartArray();\n\t\tDL_FOREACH(fmt_desc->frame_descs, frame_desc)\n\t\t{\n\t\t\tuint32_t *interval_ptr;\n\n\t\t\twriter.StartObject();\n\t\t\t{\n\t\t\t\twrite(writer, FRAME_INDEX, frame_desc->bFrameIndex);\n\t\t\t\twrite(writer, FRAME_CAPABILITIES, frame_desc->bmCapabilities);\n\t\t\t\twrite(writer, FRAME_WIDTH, frame_desc->wWidth);\n\t\t\t\twrite(writer, FRAME_HEIGHT, frame_desc->wHeight);\n\t\t\t\twrite(writer, FRAME_BITRATE_MIN, frame_desc->dwMinBitRate);\n\t\t\t\twrite(writer, FRAME_BITRATE_MAX, frame_desc->dwMaxBitRate);\n\t\t\t\twrite(writer, FRAME_FRAMEBUFFERSIZE_MAX, frame_desc->dwMaxVideoFrameBufferSize);\n\t\t\t\twrite(writer, FRAME_INTERVAL_DEFAULT, frame_desc->dwDefaultFrameInterval);\n\t\t\t\twrite(writer, FRAME_FPS_DEFAULT, 10000000 / frame_desc->dwDefaultFrameInterval);\n\n\t\t\t\tif (frame_desc->intervals) {\n\t\t\t\t\twriter.String(FRAME_INTERVALS);\n\t\t\t\t\twriter.StartArray();\n\t\t\t\t\tfor (interval_ptr = frame_desc->intervals; *interval_ptr; ++interval_ptr) {\n\t\t\t\t\t\twriter.StartObject();\n\t\t\t\t\t\twrite(writer, FRAME_INTERVAL_INDEX, (int ) (interval_ptr - frame_desc->intervals));\n\t\t\t\t\t\twrite(writer, FRAME_INTERVAL_VALUE, *interval_ptr);\n\t\t\t\t\t\twrite(writer, FRAME_INTERVAL_FPS, 10000000 / *interval_ptr);\n\t\t\t\t\t\twriter.EndObject();\n\t\t\t\t\t}\n\t\t\t\t\twriter.EndArray();\n\t\t\t\t} else {\n\t\t\t\t\t// 最小fps\n\t\t\t\t\twriter.String(FRAME_INTERVAL_MIN);\n\t\t\t\t\twriter.StartObject();\n\t\t\t\t\t{\n\t\t\t\t\t\twrite(writer, FRAME_INTERVAL_INDEX, frame_desc->dwMinFrameInterval);\n\t\t\t\t\t\twrite(writer, FRAME_INTERVAL_VALUE, frame_desc->dwMinFrameInterval);\n\t\t\t\t\t\twrite(writer, FRAME_INTERVAL_FPS, 10000000 / frame_desc->dwMinFrameInterval);\n\t\t\t\t\t}\n\t\t\t\t\twriter.EndObject();\n\t\t\t\t\t// 最大fps\n\t\t\t\t\twriter.String(FRAME_INTERVAL_MAX);\n\t\t\t\t\twriter.StartObject();\n\t\t\t\t\t{\n\t\t\t\t\t\twrite(writer, FRAME_INTERVAL_INDEX, frame_desc->dwMaxFrameInterval);\n\t\t\t\t\t\twrite(writer, FRAME_INTERVAL_VALUE, frame_desc->dwMaxFrameInterval);\n\t\t\t\t\t\twrite(writer, FRAME_INTERVAL_FPS, 10000000 / frame_desc->dwMaxFrameInterval);\n\t\t\t\t\t}\n\t\t\t\t\twriter.EndObject();\n\t\t\t\t\tif (frame_desc->dwFrameIntervalStep) {\n\t\t\t\t\t\t// fpsステップ\n\t\t\t\t\t\twriter.String(FRAME_INTERVAL_STEP);\n\t\t\t\t\t\twriter.StartObject();\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twrite(writer, FRAME_INTERVAL_INDEX, frame_desc->dwFrameIntervalStep);\n\t\t\t\t\t\t\twrite(writer, FRAME_INTERVAL_VALUE, frame_desc->dwFrameIntervalStep);\n\t\t\t\t\t\t\twrite(writer, FRAME_INTERVAL_FPS, 10000000 / frame_desc->dwFrameIntervalStep);\n\t\t\t\t\t\t}\n\t\t\t\t\t\twriter.EndObject();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\twriter.EndObject();\n\t\t}\n\t\twriter.EndArray();\t// end of FORMAT_FRAMEDESCRIPTORS\n\t}\n\twriter.EndObject();\t// end of FORMAT_DETAIL\n}\n\nstatic void writerFormatDescriptions(Writer<StringBuffer> &writer, uvc_streaming_interface_t *stream_if) {\n\n\tuvc_format_desc_t *fmt_desc;\n\tint i;\n\n\twriter.String(FORMATS);\n\twriter.StartArray();\n\tDL_FOREACH(stream_if->format_descs, fmt_desc)\n\t{\n\t\twriter.StartObject();\n\t\t{\n\t\t\twrite(writer, FORMAT_INDEX, fmt_desc->bFormatIndex);\n\t\t\twrite(writer, DESC_SUBTYPE, fmt_desc->bDescriptorSubtype);\n\t\t\twrite(writer, FORMAT_NAME, _uvc_name_for_format_subtype(fmt_desc->bDescriptorSubtype));\n\t\t\tswitch (fmt_desc->bDescriptorSubtype) {\n\t\t\tcase UVC_VS_FORMAT_UNCOMPRESSED:\n\t\t\tcase UVC_VS_FORMAT_MJPEG:\n\t\t\t\twriterFormat(writer, fmt_desc);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\twriter.EndObject();\n\t}\n\twriter.EndArray();\t// end of FORMATS\n}\n\nUVCDiags::UVCDiags() {}\nUVCDiags::~UVCDiags() {};\n\nchar *UVCDiags::getDescriptions(const uvc_device_handle_t *deviceHandle) {\n\tStringBuffer buffer;\n\tWriter<StringBuffer> writer(buffer);\n\tchar work[256];\n\n\tENTER();\n\twriter.StartObject();\n\t{\n\t\twriter.String(DESCRIPTION);\n\t\twriter.StartObject();\n\t\t{\n\t\t\tuvc_device_descriptor_t *desc;\n\t\t\tuvc_get_device_descriptor(deviceHandle->dev, &desc);\n\t\t\twrite(writer, DESC_VENDERID, desc->idVendor);\n\t\t\twrite(writer, DESC_PRODUCTID, desc->idProduct);\n\t\t\twrite(writer, DESC_SERIALNUMBER, desc->serialNumber ? desc->serialNumber : \"[none]\");\n\t\t\twrite(writer, DESC_MANIFUCTURE, desc->manufacturer ? desc->manufacturer : \"[unknown]\");\n//\t\t\twrite(writer, DESC_PRODUCT, desc->product ? desc->product : \"UVC Camera\");\n\t\t\tif (desc->product)\n\t\t\t\twrite(writer, DESC_PRODUCT, desc->product);\n\t\t\telse {\n\t\t\t\tsprintf(work, \"UVC Camera (%x:%x)\", desc->idVendor, desc->idProduct);\n\t\t\t\twrite(writer, DESC_PRODUCT, work);\n\t\t\t}\n\t\t\tuvc_free_device_descriptor(desc);\n\n\t\t\tif (deviceHandle->info->ctrl_if.bcdUVC) {\n\t\t\t\twriter.String(DESC_UVC);\n\t\t\t\twriter.StartObject();\n\t\t\t\t{\n\t\t\t\t\twrite(writer, DESC_VIDEO_CONTROL, deviceHandle->info->ctrl_if.bcdUVC);\n\n\t\t\t\t\twriter.String(DESC_INTERFACES);\n\t\t\t\t\twriter.StartArray();\n\t\t\t\t\t{\n\t\t\t\t\t\tassert(deviceHandle->info->stream_ifs);\n\t\t\t\t\t\tuvc_streaming_interface_t *stream_if;\n\t\t\t\t\t\tint stream_idx = 0;\n\n\t\t\t\t\t\tDL_FOREACH(deviceHandle->info->stream_ifs, stream_if)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t++stream_idx;\n\t\t\t\t\t\t\twriter.StartObject();\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twrite(writer, INTERFACE_TYPE, INTERFACE_TYPE_VIDEOSTREAM);\n\t\t\t\t\t\t\t\twrite(writer, INTERFACE_INDEX, stream_idx);\n\t\t\t\t\t\t\t\twrite(writer, INTERFACE_ENDPOINT_ADDR, stream_if->bEndpointAddress);\n\t\t\t\t\t\t\t\twriterFormatDescriptions(writer, stream_if);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twriter.EndObject();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\twriter.EndArray();\t// end of DESC_INTERFACES\n\t\t\t\t}\n\t\t\t\twriter.EndObject();\t// end of DESC_UVC\n\t\t\t}\n\t\t\t// XXX other interfaces\n\t\t}\n\t\twriter.EndObject();\t// end of DESCRIPTION\n\t}\n\twriter.EndObject();\n\tRETURN(strdup(buffer.GetString()), char *);\n}\n\nchar *UVCDiags::getCurrentStream(const uvc_stream_ctrl_t *ctrl) {\n\tStringBuffer buffer;\n\tWriter<StringBuffer> writer(buffer);\n\n\tENTER();\n\twriter.StartObject();\n\t{\n\t\twrite(writer, \"hint\", ctrl->bmHint);\n\t\twrite(writer, \"formatIndex\", ctrl->bFormatIndex);\n\t\twrite(writer, \"frameIndex\", ctrl->bFrameIndex);\n\t\twrite(writer, \"frameInterval\", ctrl->dwFrameInterval);\n\t\twrite(writer, \"keyFrameRate\", ctrl->wKeyFrameRate);\n\t\twrite(writer, \"frameRate\", ctrl->wPFrameRate);\n\t\twrite(writer, \"compQuality\", ctrl->wCompQuality);\n\t\twrite(writer, \"compWindowSize\", ctrl->wCompWindowSize);\n\t\twrite(writer, \"delay\", ctrl->wDelay);\n\t\twrite(writer, \"maxVideoFrameSize\", ctrl->dwMaxVideoFrameSize);\n\t\twrite(writer, \"maxPayloadTransferSize\", ctrl->dwMaxPayloadTransferSize);\n\t\twrite(writer, \"interfaceNumber\", ctrl->bInterfaceNumber);\n\t}\n\twriter.EndObject();\n\tRETURN(strdup(buffer.GetString()), char *);\n}\n\nchar *UVCDiags::getSupportedSize(const uvc_device_handle_t *deviceHandle) {\n\tStringBuffer buffer;\n\tWriter<StringBuffer> writer(buffer);\n\tchar buf[256];\n\n\tENTER();\n\twriter.StartObject();\n\t{\n\t\tif (deviceHandle->info->stream_ifs) {\n\t\t\tuvc_streaming_interface_t *stream_if;\n\t\t\tint stream_idx = 0;\n\n\t\t\twriter.String(\"formats\");\n\t\t\twriter.StartArray();\n\t\t\tDL_FOREACH(deviceHandle->info->stream_ifs, stream_if)\n\t\t\t{\n\t\t\t\t++stream_idx;\n\t\t\t\tuvc_format_desc_t *fmt_desc;\n\t\t\t\tuvc_frame_desc_t *frame_desc;\n\t\t\t\tDL_FOREACH(stream_if->format_descs, fmt_desc)\n\t\t\t\t{\n\t\t\t\t\twriter.StartObject();\n\t\t\t\t\t{\n\t\t\t\t\t\tswitch (fmt_desc->bDescriptorSubtype) {\n\t\t\t\t\t\tcase UVC_VS_FORMAT_UNCOMPRESSED:\n\t\t\t\t\t\tcase UVC_VS_FORMAT_MJPEG:\n\t\t\t\t\t\t\twrite(writer, \"index\", fmt_desc->bFormatIndex);\n\t\t\t\t\t\t\twrite(writer, \"type\", fmt_desc->bDescriptorSubtype);\n\t\t\t\t\t\t\twrite(writer, \"default\", fmt_desc->bDefaultFrameIndex);\n\t\t\t\t\t\t\twriter.String(\"size\");\n\t\t\t\t\t\t\twriter.StartArray();\n\t\t\t\t\t\t\tDL_FOREACH(fmt_desc->frame_descs, frame_desc)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tsnprintf(buf, sizeof(buf), \"%dx%d\", frame_desc->wWidth, frame_desc->wHeight);\n\t\t\t\t\t\t\t\tbuf[sizeof(buf)-1] = '\\0';\n\t\t\t\t\t\t\t\twriter.String(buf);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twriter.EndArray();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\twriter.EndObject();\n\t\t\t\t}\n\t\t\t}\n\t\t\twriter.EndArray();\n\t\t\t// FIXME still image is not supported now\n\t\t}\n\t}\n\twriter.EndObject();\n\tRETURN(strdup(buffer.GetString()), char *);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/Parameters.h",
    "content": "/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2015-2017 saki t_saki@serenegiant.com\n *\n * File name: Parameters.h\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n*/\n#ifndef PARAMETERS_H_\n#define PARAMETERS_H_\n\n#pragma interface\n\n#include \"libUVCCamera.h\"\n\nclass UVCDiags {\nprivate:\npublic:\n\tUVCDiags();\n\t~UVCDiags();\n\tchar *getDescriptions(const uvc_device_handle_t *deviceHandle);\n\tchar *getCurrentStream(const uvc_stream_ctrl_t *ctrl);\n\tchar *getSupportedSize(const uvc_device_handle_t *deviceHandle);\n};\n\n#endif /* PARAMETERS_H_ */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/UVCButtonCallback.cpp",
    "content": "#include <stdlib.h>\n#include <linux/time.h>\n#include <unistd.h>\n#include \"utilbase.h\"\n#include \"UVCButtonCallback.h\"\n#include \"libuvc_internal.h\"\n\n#define\tLOCAL_DEBUG 0\n\nUVCButtonCallback::UVCButtonCallback(uvc_device_handle_t *devh)\n:\tmDeviceHandle(devh),\n\tmButtonCallbackObj(NULL) {\n\n\tENTER();\n\tpthread_mutex_init(&button_mutex, NULL);\n\n\tuvc_set_button_callback(mDeviceHandle, uvc_button_callback, (void *)this);\n\tEXIT();\n}\n\nUVCButtonCallback::~UVCButtonCallback() {\n\n\tENTER();\n\tpthread_mutex_destroy(&button_mutex);\n\tEXIT();\n}\n\nint UVCButtonCallback::setCallback(JNIEnv *env, jobject button_callback_obj) {\n\t\n\tENTER();\n\tpthread_mutex_lock(&button_mutex);\n\t{\n\t\tif (!env->IsSameObject(mButtonCallbackObj, button_callback_obj)) {\n\t\t\tibuttoncallback_fields.onButton = NULL;\n\t\t\tif (mButtonCallbackObj) {\n\t\t\t\tenv->DeleteGlobalRef(mButtonCallbackObj);\n\t\t\t}\n\t\t\tmButtonCallbackObj = button_callback_obj;\n\t\t\tif (button_callback_obj) {\n\t\t\t\t// get method IDs of Java object for callback\n\t\t\t\tjclass clazz = env->GetObjectClass(button_callback_obj);\n\t\t\t\tif (LIKELY(clazz)) {\n\t\t\t\t\tibuttoncallback_fields.onButton = env->GetMethodID(clazz,\n\t\t\t\t\t\t\"onButton\",\t\"(II)V\");\n\t\t\t\t} else {\n\t\t\t\t\tLOGW(\"failed to get object class\");\n\t\t\t\t}\n\t\t\t\tenv->ExceptionClear();\n\t\t\t\tif (!ibuttoncallback_fields.onButton) {\n\t\t\t\t\tLOGE(\"Can't find IButtonCallback#onButton\");\n\t\t\t\t\tenv->DeleteGlobalRef(button_callback_obj);\n\t\t\t\t\tmButtonCallbackObj = button_callback_obj = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tpthread_mutex_unlock(&button_mutex);\n\tRETURN(0, int);\n}\n\nvoid UVCButtonCallback::notifyButtonCallback(JNIEnv* env, int button, int state) {\n\n\tpthread_mutex_lock(&button_mutex);\n\t{\n\t\tif (mButtonCallbackObj) {\n\t\t\tenv->CallVoidMethod(mButtonCallbackObj, ibuttoncallback_fields.onButton, button, state);\n\t\t\tenv->ExceptionClear();\n\t\t}\n\t}\n\tpthread_mutex_unlock(&button_mutex);\n}\n\nvoid UVCButtonCallback::uvc_button_callback(int button, int state, void *user_ptr) {\n\n\tUVCButtonCallback *buttonCallback = reinterpret_cast<UVCButtonCallback *>(user_ptr);\n\n\tJavaVM *vm = getVM();\n\tJNIEnv *env;\n\t// attach to JavaVM\n\tvm->AttachCurrentThread(&env, NULL);\n\n\tbuttonCallback->notifyButtonCallback(env, button, state);\n\t\n\tvm->DetachCurrentThread();\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/UVCButtonCallback.h",
    "content": "#ifndef UVCBUTTONCALLBACK_H_\n#define UVCBUTTONCALLBACK_H_\n\n#include \"libUVCCamera.h\"\n#include <pthread.h>\n#include <android/native_window.h>\n#include \"objectarray.h\"\n\n#pragma interface\n\n// for callback to Java object\ntypedef struct {\n\tjmethodID onButton;\n} Fields_ibuttoncallback;\n\nclass UVCButtonCallback {\nprivate:\n\tuvc_device_handle_t *mDeviceHandle;\n \tpthread_mutex_t button_mutex;\n \tjobject mButtonCallbackObj;\n \tFields_ibuttoncallback ibuttoncallback_fields;\n \tvoid notifyButtonCallback(JNIEnv *env, int button, int state);\n \tstatic void uvc_button_callback(int button, int state, void *user_ptr);\npublic:\n\tUVCButtonCallback(uvc_device_handle_t *devh);\n\t~UVCButtonCallback();\n\n\tint setCallback(JNIEnv *env, jobject button_callback_obj);\n};\n\n#endif /* UVCBUTTONCALLBACK_H_ */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/UVCCamera.cpp",
    "content": "/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n * File name: UVCCamera.cpp\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n*/\n\n#define LOG_TAG \"UVCCamera\"\n#if 1\t// デバッグ情報を出さない時1\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// LOGV/LOGD/MARKを出力しない時\n\t\t#endif\n\t#undef USE_LOGALL\t\t\t// 指定したLOGxだけを出力\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n\t#undef NDEBUG\n\t#define GET_RAW_DESCRIPTOR\n#endif\n\n//**********************************************************************\n//\n//**********************************************************************\n#include <stdlib.h>\n#include <linux/time.h>\n#include <unistd.h>\n#include <string.h>\n#include \"UVCCamera.h\"\n#include \"Parameters.h\"\n#include \"libuvc_internal.h\"\n\n#define\tLOCAL_DEBUG 0\n\n//**********************************************************************\n//\n//**********************************************************************\n/**\n * コンストラクタ\n */\nUVCCamera::UVCCamera()\n:\tmFd(0),\n\tmUsbFs(NULL),\n\tmContext(NULL),\n\tmDevice(NULL),\n\tmDeviceHandle(NULL),\n\tmStatusCallback(NULL),\n\tmButtonCallback(NULL),\n\tmPreview(NULL),\n\tmCtrlSupports(0),\n\tmPUSupports(0) {\n\n\tENTER();\n\tclearCameraParams();\n\tEXIT();\n}\n\n/**\n * デストラクタ\n */\nUVCCamera::~UVCCamera() {\n\tENTER();\n\trelease();\n\tif (mContext) {\n\t\tuvc_exit(mContext);\n\t\tmContext = NULL;\n\t}\n\tif (mUsbFs) {\n\t\tfree(mUsbFs);\n\t\tmUsbFs = NULL;\n\t}\n\tEXIT();\n}\n\nvoid UVCCamera::clearCameraParams() {\n\tmCtrlSupports = mPUSupports = 0;\n\tmScanningMode.min = mScanningMode.max = mScanningMode.def = 0;\n\tmExposureMode.min = mExposureMode.max = mExposureMode.def = 0;\n\tmExposurePriority.min = mExposurePriority.max = mExposurePriority.def = 0;\n\tmExposureAbs.min = mExposureAbs.max = mExposureAbs.def = 0;\n\tmAutoFocus.min = mAutoFocus.max = mAutoFocus.def = 0;\n\tmAutoWhiteBlance.min = mAutoWhiteBlance.max = mAutoWhiteBlance.def = 0;\n\tmWhiteBlance.min = mWhiteBlance.max = mWhiteBlance.def = 0;\n\tmAutoWhiteBlanceCompo.min = mAutoWhiteBlanceCompo.max = mAutoWhiteBlanceCompo.def = 0;\n\tmWhiteBlanceCompo.min = mWhiteBlanceCompo.max = mWhiteBlanceCompo.def = 0;\n\tmBacklightComp.min = mBacklightComp.max = mBacklightComp.def = 0;\n\tmBrightness.min = mBrightness.max = mBrightness.def = 0;\n\tmContrast.min = mContrast.max = mContrast.def = 0;\n\tmAutoContrast.min = mAutoContrast.max = mAutoContrast.def = 0;\n\tmSharpness.min = mSharpness.max = mSharpness.def = 0;\n\tmGain.min = mGain.max = mGain.def = 0;\n\tmGamma.min = mGamma.max = mGamma.def = 0;\n\tmSaturation.min = mSaturation.max = mSaturation.def = 0;\n\tmHue.min = mHue.max = mHue.def = 0;\n\tmAutoHue.min = mAutoHue.max = mAutoHue.def = 0;\n\tmZoom.min = mZoom.max = mZoom.def = 0;\n\tmZoomRel.min = mZoomRel.max = mZoomRel.def = 0;\n\tmFocus.min = mFocus.max = mFocus.def = 0;\n\tmFocusRel.min = mFocusRel.max = mFocusRel.def = 0;\n\tmFocusSimple.min = mFocusSimple.max = mFocusSimple.def = 0;\n\tmIris.min = mIris.max = mIris.def = 0;\n\tmIrisRel.min = mIrisRel.max = mIrisRel.def = 0;\n\tmPan.min = mPan.max = mPan.def = 0; mPan.current = -1;\n\tmTilt.min = mTilt.max = mTilt.def = 0; mTilt.current = -1;\n\tmRoll.min = mRoll.max = mRoll.def = 0;\n\tmPanRel.min = mPanRel.max = mPanRel.def = 0; mPanRel.current = -1;\n\tmTiltRel.min = mTiltRel.max = mTiltRel.def = 0; mTiltRel.current = -1;\n\tmRollRel.min = mRollRel.max = mRollRel.def = 0;\n\tmPrivacy.min = mPrivacy.max = mPrivacy.def = 0;\n\tmPowerlineFrequency.min = mPowerlineFrequency.max = mPowerlineFrequency.def = 0;\n\tmMultiplier.min = mMultiplier.max = mMultiplier.def = 0;\n\tmMultiplierLimit.min = mMultiplierLimit.max = mMultiplierLimit.def = 0;\n\tmAnalogVideoStandard.min = mAnalogVideoStandard.max = mAnalogVideoStandard.def = 0;\n\tmAnalogVideoLockState.min = mAnalogVideoLockState.max = mAnalogVideoLockState.def = 0;\n}\n\n//======================================================================\n/**\n * カメラへ接続する\n */\nint UVCCamera::connect(int vid, int pid, int fd, int busnum, int devaddr, const char *usbfs) {\n\tENTER();\n\tuvc_error_t result = UVC_ERROR_BUSY;\n\tif (!mDeviceHandle && fd) {\n\t\tif (mUsbFs)\n\t\t\tfree(mUsbFs);\n\t\tmUsbFs = strdup(usbfs);\n\t\tif (UNLIKELY(!mContext)) {\n\t\t\tresult = uvc_init2(&mContext, NULL, mUsbFs);\n//\t\t\tlibusb_set_debug(mContext->usb_ctx, LIBUSB_LOG_LEVEL_DEBUG);\n\t\t\tif (UNLIKELY(result < 0)) {\n\t\t\t\tLOGD(\"failed to init libuvc\");\n\t\t\t\tRETURN(result, int);\n\t\t\t}\n\t\t}\n\t\t// カメラ機能フラグをクリア\n\t\tclearCameraParams();\n\t\tfd = dup(fd);\n\t\t// 指定したvid,idを持つデバイスを検索, 見つかれば0を返してmDeviceに見つかったデバイスをセットする(既に1回uvc_ref_deviceを呼んである)\n//\t\tresult = uvc_find_device2(mContext, &mDevice, vid, pid, NULL, fd);\n\t\tresult = uvc_get_device_with_fd(mContext, &mDevice, vid, pid, NULL, fd, busnum, devaddr);\n\t\tif (LIKELY(!result)) {\n\t\t\t// カメラのopen処理\n\t\t\tresult = uvc_open(mDevice, &mDeviceHandle);\n\t\t\tif (LIKELY(!result)) {\n\t\t\t\t// open出来た時\n#if LOCAL_DEBUG\n\t\t\t\tuvc_print_diag(mDeviceHandle, stderr);\n#endif\n\t\t\t\tmFd = fd;\n\t\t\t\tmStatusCallback = new UVCStatusCallback(mDeviceHandle);\n\t\t\t\tmButtonCallback = new UVCButtonCallback(mDeviceHandle);\n\t\t\t\tmPreview = new UVCPreview(mDeviceHandle);\n\t\t\t} else {\n\t\t\t\t// open出来なかった時\n\t\t\t\tLOGE(\"could not open camera:err=%d\", result);\n\t\t\t\tuvc_unref_device(mDevice);\n//\t\t\t\tSAFE_DELETE(mDevice);\t// 参照カウンタが0ならuvc_unref_deviceでmDeviceがfreeされるから不要 XXX クラッシュ, 既に破棄されているのを再度破棄しようとしたからみたい\n\t\t\t\tmDevice = NULL;\n\t\t\t\tmDeviceHandle = NULL;\n\t\t\t\tclose(fd);\n\t\t\t}\n\t\t} else {\n\t\t\tLOGE(\"could not find camera:err=%d\", result);\n\t\t\tclose(fd);\n\t\t}\n\t} else {\n\t\t// カメラが既にopenしている時\n\t\tLOGW(\"camera is already opened. you should release first\");\n\t}\n\tRETURN(result, int);\n}\n\n// カメラを開放する\nint UVCCamera::release() {\n\tENTER();\n\tstopPreview();\n\t// カメラのclose処理\n\tif (LIKELY(mDeviceHandle)) {\n\t\tMARK(\"カメラがopenしていたら開放する\");\n\t\t// ステータスコールバックオブジェクトを破棄\n\t\tSAFE_DELETE(mStatusCallback);\n\t\tSAFE_DELETE(mButtonCallback);\n\t\t// プレビューオブジェクトを破棄\n\t\tSAFE_DELETE(mPreview);\n\t\t// カメラをclose\n\t\tuvc_close(mDeviceHandle);\n\t\tmDeviceHandle = NULL;\n\t}\n\tif (LIKELY(mDevice)) {\n\t\tMARK(\"カメラを開放\");\n\t\tuvc_unref_device(mDevice);\n\t\tmDevice = NULL;\n\t}\n\t// カメラ機能フラグをクリア\n\tclearCameraParams();\n\tif (mUsbFs) {\n\t\tclose(mFd);\n\t\tmFd = 0;\n\t\tfree(mUsbFs);\n\t\tmUsbFs = NULL;\n\t}\n\tRETURN(0, int);\n}\n\nint UVCCamera::setStatusCallback(JNIEnv *env, jobject status_callback_obj) {\n\tENTER();\n\tint result = EXIT_FAILURE;\n\tif (mStatusCallback) {\n\t\tresult = mStatusCallback->setCallback(env, status_callback_obj);\n\t}\n\tRETURN(result, int);\n}\n\nint UVCCamera::setButtonCallback(JNIEnv *env, jobject button_callback_obj) {\n\tENTER();\n\tint result = EXIT_FAILURE;\n\tif (mButtonCallback) {\n\t\tresult = mButtonCallback->setCallback(env, button_callback_obj);\n\t}\n\tRETURN(result, int);\n}\n\nchar *UVCCamera::getSupportedSize() {\n\tENTER();\n\tif (mDeviceHandle) {\n\t\tUVCDiags params;\n\t\tRETURN(params.getSupportedSize(mDeviceHandle), char *)\n\t}\n\tRETURN(NULL, char *);\n}\n\nint UVCCamera::setPreviewSize(int width, int height, int min_fps, int max_fps, int mode, float bandwidth) {\n\tENTER();\n\tint result = EXIT_FAILURE;\n\tif (mPreview) {\n\t\tresult = mPreview->setPreviewSize(width, height, min_fps, max_fps, mode, bandwidth);\n\t}\n\tRETURN(result, int);\n}\n\nint UVCCamera::setPreviewDisplay(ANativeWindow *preview_window) {\n\tENTER();\n\tint result = EXIT_FAILURE;\n\tif (mPreview) {\n\t\tresult = mPreview->setPreviewDisplay(preview_window);\n\t}\n\tRETURN(result, int);\n}\n\nint UVCCamera::setFrameCallback(JNIEnv *env, jobject frame_callback_obj, int pixel_format) {\n\tENTER();\n\tint result = EXIT_FAILURE;\n\tif (mPreview) {\n\t\tresult = mPreview->setFrameCallback(env, frame_callback_obj, pixel_format);\n\t}\n\tRETURN(result, int);\n}\n\nint UVCCamera::startPreview() {\n\tENTER();\n\n\tint result = EXIT_FAILURE;\n\tif (mDeviceHandle) {\n\t\treturn mPreview->startPreview();\n\t}\n\tRETURN(result, int);\n}\n\nint UVCCamera::stopPreview() {\n\tENTER();\n\tif (LIKELY(mPreview)) {\n\t\tmPreview->stopPreview();\n\t}\n\tRETURN(0, int);\n}\n\nint UVCCamera::setCaptureDisplay(ANativeWindow *capture_window) {\n\tENTER();\n\tint result = EXIT_FAILURE;\n\tif (mPreview) {\n\t\tresult = mPreview->setCaptureDisplay(capture_window);\n\t}\n\tRETURN(result, int);\n}\n\n//======================================================================\n// カメラのサポートしているコントロール機能を取得する\nint UVCCamera::getCtrlSupports(uint64_t *supports) {\n\tENTER();\n\tuvc_error_t ret = UVC_ERROR_NOT_FOUND;\n\tif (LIKELY(mDeviceHandle)) {\n\t\tif (!mCtrlSupports) {\n\t\t\t// 何個あるのかわからへんねんけど、試した感じは１個みたいやからとりあえず先頭のを返す\n\t\t\tconst uvc_input_terminal_t *input_terminals = uvc_get_input_terminals(mDeviceHandle);\n\t\t\tconst uvc_input_terminal_t *it;\n\t\t\tDL_FOREACH(input_terminals, it)\n\t\t\t{\n\t\t\t\tif (it) {\n\t\t\t\t\tmCtrlSupports = it->bmControls;\n\t\t\t\t\tMARK(\"getCtrlSupports=%lx\", (unsigned long)mCtrlSupports);\n\t\t\t\t\tret = UVC_SUCCESS;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else\n\t\t\tret = UVC_SUCCESS;\n\t}\n\tif (supports)\n\t\t*supports = mCtrlSupports;\n\tRETURN(ret, int);\n}\n\nint UVCCamera::getProcSupports(uint64_t *supports) {\n\tENTER();\n\tuvc_error_t ret = UVC_ERROR_NOT_FOUND;\n\tif (LIKELY(mDeviceHandle)) {\n\t\tif (!mPUSupports) {\n\t\t\t// 何個あるのかわからへんねんけど、試した感じは１個みたいやからとりあえず先頭のを返す\n\t\t\tconst uvc_processing_unit_t *proc_units = uvc_get_processing_units(mDeviceHandle);\n\t\t\tconst uvc_processing_unit_t *pu;\n\t\t\tDL_FOREACH(proc_units, pu)\n\t\t\t{\n\t\t\t\tif (pu) {\n\t\t\t\t\tmPUSupports = pu->bmControls;\n\t\t\t\t\tMARK(\"getProcSupports=%lx\", (unsigned long)mPUSupports);\n\t\t\t\t\tret = UVC_SUCCESS;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else\n\t\t\tret = UVC_SUCCESS;\n\t}\n\tif (supports)\n\t\t*supports = mPUSupports;\n\tRETURN(ret, int);\n}\n\n//======================================================================\n#define CTRL_BRIGHTNESS\t\t0\n#define CTRL_CONTRAST\t\t1\n#define\tCTRL_SHARPNESS\t\t2\n#define CTRL_GAIN\t\t\t3\n#define CTRL_WHITEBLANCE\t4\n#define CTRL_FOCUS\t\t\t5\n\nstatic uvc_error_t update_ctrl_values(uvc_device_handle_t *devh, control_value_t &values,\n\tparamget_func_i16 get_func) {\n\n\tENTER();\n\n\tuvc_error_t ret = UVC_SUCCESS;\n\tif (!values.min && !values.max) {\n\t\tint16_t value;\n\t\tret = get_func(devh, &value, UVC_GET_MIN);\n\t\tif (LIKELY(!ret)) {\n\t\t\tvalues.min = value;\n\t\t\tLOGV(\"update_params:min value=%d,min=%d\", value, values.min);\n\t\t\tret = get_func(devh, &value, UVC_GET_MAX);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\tvalues.max = value;\n\t\t\t\tLOGV(\"update_params:max value=%d,max=%d\", value, values.max);\n\t\t\t\tret = get_func(devh, &value, UVC_GET_DEF);\n\t\t\t\tif (LIKELY(!ret)) {\n\t\t\t\t\tvalues.def = value;\n\t\t\t\t\tLOGV(\"update_params:def value=%d,def=%d\", value, values.def);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (UNLIKELY(ret)) {\n\t\tLOGD(\"update_params failed:err=%d\", ret);\n\t}\n\tRETURN(ret, uvc_error_t);\n}\n\nstatic uvc_error_t update_ctrl_values(uvc_device_handle_t *devh, control_value_t &values,\n\tparamget_func_u16 get_func) {\n\n\tENTER();\n\n\tuvc_error_t ret = UVC_SUCCESS;\n\tif (!values.min && !values.max) {\n\t\tuint16_t value;\n\t\tret = get_func(devh, &value, UVC_GET_MIN);\n\t\tif (LIKELY(!ret)) {\n\t\t\tvalues.min = value;\n\t\t\tLOGV(\"update_params:min value=%d,min=%d\", value, values.min);\n\t\t\tret = get_func(devh, &value, UVC_GET_MAX);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\tvalues.max = value;\n\t\t\t\tLOGV(\"update_params:max value=%d,max=%d\", value, values.max);\n\t\t\t\tret = get_func(devh, &value, UVC_GET_DEF);\n\t\t\t\tif (LIKELY(!ret)) {\n\t\t\t\t\tvalues.def = value;\n\t\t\t\t\tLOGV(\"update_params:def value=%d,def=%d\", value, values.def);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (UNLIKELY(ret)) {\n\t\tLOGD(\"update_params failed:err=%d\", ret);\n\t}\n\tRETURN(ret, uvc_error_t);\n}\n\nstatic uvc_error_t update_ctrl_values(uvc_device_handle_t *devh, control_value_t &values,\n\tparamget_func_i8 get_func) {\n\n\tENTER();\n\n\tuvc_error_t ret = UVC_SUCCESS;\n\tif (!values.min && !values.max) {\n\t\tint8_t value;\n\t\tret = get_func(devh, &value, UVC_GET_MIN);\n\t\tif (LIKELY(!ret)) {\n\t\t\tvalues.min = value;\n\t\t\tLOGV(\"update_params:min value=%d,min=%d\", value, values.min);\n\t\t\tret = get_func(devh, &value, UVC_GET_MAX);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\tvalues.max = value;\n\t\t\t\tLOGV(\"update_params:max value=%d,max=%d\", value, values.max);\n\t\t\t\tret = get_func(devh, &value, UVC_GET_DEF);\n\t\t\t\tif (LIKELY(!ret)) {\n\t\t\t\t\tvalues.def = value;\n\t\t\t\t\tLOGV(\"update_params:def value=%d,def=%d\", value, values.def);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (UNLIKELY(ret)) {\n\t\tLOGD(\"update_params failed:err=%d\", ret);\n\t}\n\tRETURN(ret, uvc_error_t);\n}\n\nstatic uvc_error_t update_ctrl_values(uvc_device_handle_t *devh, control_value_t &values,\n\tparamget_func_u8 get_func) {\n\n\tENTER();\n\n\tuvc_error_t ret = UVC_SUCCESS;\n\tif (!values.min && !values.max) {\n\t\tuint8_t value;\n\t\tret = get_func(devh, &value, UVC_GET_MIN);\n\t\tif (LIKELY(!ret)) {\n\t\t\tvalues.min = value;\n\t\t\tLOGV(\"update_params:min value=%d,min=%d\", value, values.min);\n\t\t\tret = get_func(devh, &value, UVC_GET_MAX);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\tvalues.max = value;\n\t\t\t\tLOGV(\"update_params:max value=%d,max=%d\", value, values.max);\n\t\t\t\tret = get_func(devh, &value, UVC_GET_DEF);\n\t\t\t\tif (LIKELY(!ret)) {\n\t\t\t\t\tvalues.def = value;\n\t\t\t\t\tLOGV(\"update_params:def value=%d,def=%d\", value, values.def);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (UNLIKELY(ret)) {\n\t\tLOGD(\"update_params failed:err=%d\", ret);\n\t}\n\tRETURN(ret, uvc_error_t);\n}\n\nstatic uvc_error_t update_ctrl_values(uvc_device_handle_t *devh, control_value_t &values,\n\tparamget_func_u8u8 get_func) {\n\n\tENTER();\n\n\tuvc_error_t ret = UVC_SUCCESS;\n\tif (!values.min && !values.max) {\n\t\tuint8_t value1, value2;\n\t\tret = get_func(devh, &value1, &value2, UVC_GET_MIN);\n\t\tif (LIKELY(!ret)) {\n\t\t\tvalues.min = (value1 << 8) + value2;\n\t\t\tLOGV(\"update_params:min value1=%d,value2=%d,min=%d\", value1, value2, values.min);\n\t\t\tret = get_func(devh, &value1, &value2, UVC_GET_MAX);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\tvalues.max = (value1 << 8) + value2;\n\t\t\t\tLOGV(\"update_params:max value1=%d,value2=%d,max=%d\", value1, value2, values.max);\n\t\t\t\tret = get_func(devh, &value1, &value2, UVC_GET_DEF);\n\t\t\t\tif (LIKELY(!ret)) {\n\t\t\t\t\tvalues.def = (value1 << 8) + value2;\n\t\t\t\t\tLOGV(\"update_params:def value1=%d,value2=%ddef=%d\", value1, value2, values.def);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (UNLIKELY(ret)) {\n\t\tLOGD(\"update_params failed:err=%d\", ret);\n\t}\n\tRETURN(ret, uvc_error_t);\n}\n\nstatic uvc_error_t update_ctrl_values(uvc_device_handle_t *devh, control_value_t &values,\n\tparamget_func_i8u8 get_func) {\n\n\tENTER();\n\n\tuvc_error_t ret = UVC_SUCCESS;\n\tif (!values.min && !values.max) {\n\t\tint8_t value1;\n\t\tuint8_t value2;\n\t\tret = get_func(devh, &value1, &value2, UVC_GET_MIN);\n\t\tif (LIKELY(!ret)) {\n\t\t\tvalues.min = (value1 << 8) + value2;\n\t\t\tLOGV(\"update_params:min value1=%d,value2=%d,min=%d\", value1, value2, values.min);\n\t\t\tret = get_func(devh, &value1, &value2, UVC_GET_MAX);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\tvalues.max = (value1 << 8) + value2;\n\t\t\t\tLOGV(\"update_params:max value1=%d,value2=%d,max=%d\", value1, value2, values.max);\n\t\t\t\tret = get_func(devh, &value1, &value2, UVC_GET_DEF);\n\t\t\t\tif (LIKELY(!ret)) {\n\t\t\t\t\tvalues.def = (value1 << 8) + value2;\n\t\t\t\t\tLOGV(\"update_params:def value1=%d,value2=%ddef=%d\", value1, value2, values.def);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (UNLIKELY(ret)) {\n\t\tLOGD(\"update_params failed:err=%d\", ret);\n\t}\n\tRETURN(ret, uvc_error_t);\n}\n\nstatic uvc_error_t update_ctrl_values(uvc_device_handle_t *devh, control_value_t &values,\n\tparamget_func_i8u8u8 get_func) {\n\n\tENTER();\n\n\tuvc_error_t ret = UVC_SUCCESS;\n\tif (!values.min && !values.max) {\n\t\tint8_t value1;\n\t\tuint8_t value2;\n\t\tuint8_t value3;\n\t\tret = get_func(devh, &value1, &value2, &value3, UVC_GET_MIN);\n\t\tif (LIKELY(!ret)) {\n\t\t\tvalues.min = (value1 << 16) + (value2 <<8) +value3;\n\t\t\tLOGV(\"update_params:min value1=%d,value2=%d,value3=%d,min=%d\", value1, value2, value3, values.min);\n\t\t\tret = get_func(devh, &value1, &value2, &value3, UVC_GET_MAX);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\tvalues.max = (value1 << 16) + (value2 <<8) +value3;\n\t\t\t\tLOGV(\"update_params:max value1=%d,value2=%d,value3=%d,max=%d\", value1, value2, value3, values.max);\n\t\t\t\tret = get_func(devh, &value1, &value2, &value3, UVC_GET_DEF);\n\t\t\t\tif (LIKELY(!ret)) {\n\t\t\t\t\tvalues.def = (value1 << 16) + (value2 <<8) +value3;\n\t\t\t\t\tLOGV(\"update_params:def value1=%d,value2=%d,value3=%d,def=%d\", value1, value2, value3, values.def);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (UNLIKELY(ret)) {\n\t\tLOGD(\"update_params failed:err=%d\", ret);\n\t}\n\tRETURN(ret, uvc_error_t);\n}\n\nstatic uvc_error_t update_ctrl_values(uvc_device_handle_t *devh, control_value_t &values,\n\tparamget_func_i32 get_func) {\n\n\tENTER();\n\n\tuvc_error_t ret = UVC_SUCCESS;\n\tif (!values.min && !values.max) {\n\t\tint32_t value;\n\t\tret = get_func(devh, &value, UVC_GET_MIN);\n\t\tif (LIKELY(!ret)) {\n\t\t\tvalues.min = value;\n\t\t\tLOGV(\"update_params:min value=%d,min=%d\", value, values.min);\n\t\t\tret = get_func(devh, &value, UVC_GET_MAX);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\tvalues.max = value;\n\t\t\t\tLOGV(\"update_params:max value=%d,max=%d\", value, values.max);\n\t\t\t\tret = get_func(devh, &value, UVC_GET_DEF);\n\t\t\t\tif (LIKELY(!ret)) {\n\t\t\t\t\tvalues.def = value;\n\t\t\t\t\tLOGV(\"update_params:def value=%d,def=%d\", value, values.def);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (UNLIKELY(ret)) {\n\t\tLOGD(\"update_params failed:err=%d\", ret);\n\t}\n\tRETURN(ret, uvc_error_t);\n}\n\nstatic uvc_error_t update_ctrl_values(uvc_device_handle_t *devh, control_value_t &values,\n\tparamget_func_u32 get_func) {\n\n\tENTER();\n\n\tuvc_error_t ret = UVC_SUCCESS;\n\tif (!values.min && !values.max) {\n\t\tuint32_t value;\n\t\tret = get_func(devh, &value, UVC_GET_MIN);\n\t\tif (LIKELY(!ret)) {\n\t\t\tvalues.min = value;\n\t\t\tLOGV(\"update_params:min value=%d,min=%d\", value, values.min);\n\t\t\tret = get_func(devh, &value, UVC_GET_MAX);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\tvalues.max = value;\n\t\t\t\tLOGV(\"update_params:max value=%d,max=%d\", value, values.max);\n\t\t\t\tret = get_func(devh, &value, UVC_GET_DEF);\n\t\t\t\tif (LIKELY(!ret)) {\n\t\t\t\t\tvalues.def = value;\n\t\t\t\t\tLOGV(\"update_params:def value=%d,def=%d\", value, values.def);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (UNLIKELY(ret)) {\n\t\tLOGD(\"update_params failed:err=%d\", ret);\n\t}\n\tRETURN(ret, uvc_error_t);\n}\n\nstatic uvc_error_t update_ctrl_values(uvc_device_handle_t *devh, control_value_t &values1, control_value_t &values2,\n\tparamget_func_i32i32 get_func) {\n\n\tENTER();\n\n\tuvc_error_t ret = UVC_SUCCESS;\n\tif ((!values1.min && !values1.max) ||(!values2.min && !values2.max)) {\n\t\tint32_t value1, value2;\n\t\tret = get_func(devh, &value1, &value2, UVC_GET_MIN);\n\t\tif (LIKELY(!ret)) {\n\t\t\tvalues1.min = value1;\n\t\t\tvalues2.min = value2;\n\t\t\tLOGV(\"update_params:min value1=%d,value2=%d\", value1, value2);\n\t\t\tret = get_func(devh, &value1, &value2, UVC_GET_MAX);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\tvalues1.max = value1;\n\t\t\t\tvalues2.max = value2;\n\t\t\t\tLOGV(\"update_params:max value1=%d,value2=%d\", value1, value2);\n\t\t\t\tret = get_func(devh, &value1, &value2, UVC_GET_DEF);\n\t\t\t\tif (LIKELY(!ret)) {\n\t\t\t\t\tvalues1.def = value1;\n\t\t\t\t\tvalues2.def = value2;\n\t\t\t\t\tLOGV(\"update_params:def value1=%d,value2=%d\", value1, value2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (UNLIKELY(ret)) {\n\t\tLOGD(\"update_params failed:err=%d\", ret);\n\t}\n\tRETURN(ret, uvc_error_t);\n}\n\n#define UPDATE_CTRL_VALUES(VAL,FUNC) \\\n\tret = update_ctrl_values(mDeviceHandle, VAL, FUNC); \\\n\tif (LIKELY(!ret)) { \\\n\t\tmin = VAL.min; \\\n\t\tmax = VAL.max; \\\n\t\tdef = VAL.def; \\\n\t} else { \\\n\t\tMARK(\"failed to UPDATE_CTRL_VALUES\"); \\\n\t} \\\n\n/**\n * カメラコントロール設定の下請け\n */\nint UVCCamera::internalSetCtrlValue(control_value_t &values, int8_t value,\n\t\tparamget_func_i8 get_func, paramset_func_i8 set_func) {\n\tint ret = update_ctrl_values(mDeviceHandle, values, get_func);\n\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\tvalue = value < values.min\n\t\t\t? values.min\n\t\t\t: (value > values.max ? values.max : value);\n\t\tset_func(mDeviceHandle, value);\n\t}\n\tRETURN(ret, int);\n}\n\nint UVCCamera::internalSetCtrlValue(control_value_t &values, uint8_t value,\n\t\tparamget_func_u8 get_func, paramset_func_u8 set_func) {\n\tint ret = update_ctrl_values(mDeviceHandle, values, get_func);\n\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\tvalue = value < values.min\n\t\t\t? values.min\n\t\t\t: (value > values.max ? values.max : value);\n\t\tset_func(mDeviceHandle, value);\n\t}\n\tRETURN(ret, int);\n}\n\nint UVCCamera::internalSetCtrlValue(control_value_t &values, uint8_t value1, uint8_t value2,\n\t\tparamget_func_u8u8 get_func, paramset_func_u8u8 set_func) {\n\tint ret = update_ctrl_values(mDeviceHandle, values, get_func);\n\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\tuint8_t v1min = (uint8_t)((values.min >> 8) & 0xff);\n\t\tuint8_t v2min = (uint8_t)(values.min & 0xff);\n\t\tuint8_t v1max = (uint8_t)((values.max >> 8) & 0xff);\n\t\tuint8_t v2max = (uint8_t)(values.max & 0xff);\n\t\tvalue1 = value1 < v1min\n\t\t\t? v1min\n\t\t\t: (value1 > v1max ? v1max : value1); \n\t\tvalue2 = value2 < v2min\n\t\t\t? v2min\n\t\t\t: (value2 > v2max ? v2max : value2); \n\t\tset_func(mDeviceHandle, value1, value2);\n\t}\n\tRETURN(ret, int);\n}\n\nint UVCCamera::internalSetCtrlValue(control_value_t &values, int8_t value1, uint8_t value2,\n\t\tparamget_func_i8u8 get_func, paramset_func_i8u8 set_func) {\n\tint ret = update_ctrl_values(mDeviceHandle, values, get_func);\n\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\tint8_t v1min = (int8_t)((values.min >> 8) & 0xff);\n\t\tuint8_t v2min = (uint8_t)(values.min & 0xff);\n\t\tint8_t v1max = (int8_t)((values.max >> 8) & 0xff);\n\t\tuint8_t v2max = (uint8_t)(values.max & 0xff);\n\t\tvalue1 = value1 < v1min\n\t\t\t? v1min\n\t\t\t: (value1 > v1max ? v1max : value1); \n\t\tvalue2 = value2 < v2min\n\t\t\t? v2min\n\t\t\t: (value2 > v2max ? v2max : value2); \n\t\tset_func(mDeviceHandle, value1, value2);\n\t}\n\tRETURN(ret, int);\n}\n\nint UVCCamera::internalSetCtrlValue(control_value_t &values, int8_t value1, uint8_t value2, uint8_t value3,\n\t\tparamget_func_i8u8u8 get_func, paramset_func_i8u8u8 set_func) {\n\tint ret = update_ctrl_values(mDeviceHandle, values, get_func);\n\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\tint8_t v1min = (int8_t)((values.min >> 16) & 0xff);\n\t\tuint8_t v2min = (uint8_t)((values.min >> 8) & 0xff);\n\t\tuint8_t v3min = (uint8_t)(values.min & 0xff);\n\t\tint8_t v1max = (int8_t)((values.max >> 16) & 0xff);\n\t\tuint8_t v2max = (uint8_t)((values.max >> 8) & 0xff);\n\t\tuint8_t v3max = (uint8_t)(values.max & 0xff);\n\t\tvalue1 = value1 < v1min\n\t\t\t? v1min\n\t\t\t: (value1 > v1max ? v1max : value1); \n\t\tvalue2 = value2 < v2min\n\t\t\t? v2min\n\t\t\t: (value2 > v2max ? v2max : value2); \n\t\tvalue3 = value3 < v3min\n\t\t\t? v3min\n\t\t\t: (value3 > v3max ? v3max : value3); \n\t\tset_func(mDeviceHandle, value1, value2, value3);\n\t}\n\tRETURN(ret, int);\n}\n\n/**\n * カメラコントロール設定の下請け\n */\nint UVCCamera::internalSetCtrlValue(control_value_t &values, int16_t value,\n\t\tparamget_func_i16 get_func, paramset_func_i16 set_func) {\n\tint ret = update_ctrl_values(mDeviceHandle, values, get_func);\n\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\tvalue = value < values.min\n\t\t\t? values.min\n\t\t\t: (value > values.max ? values.max : value);\n\t\tset_func(mDeviceHandle, value);\n\t}\n\tRETURN(ret, int);\n}\n\n/**\n * カメラコントロール設定の下請け\n */\nint UVCCamera::internalSetCtrlValue(control_value_t &values, uint16_t value,\n\t\tparamget_func_u16 get_func, paramset_func_u16 set_func) {\n\tint ret = update_ctrl_values(mDeviceHandle, values, get_func);\n\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\tvalue = value < values.min\n\t\t\t? values.min\n\t\t\t: (value > values.max ? values.max : value);\n\t\tset_func(mDeviceHandle, value);\n\t}\n\tRETURN(ret, int);\n}\n\n/**\n * カメラコントロール設定の下請け\n */\nint UVCCamera::internalSetCtrlValue(control_value_t &values, int32_t value,\n\t\tparamget_func_i32 get_func, paramset_func_i32 set_func) {\n\tint ret = update_ctrl_values(mDeviceHandle, values, get_func);\n\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\tvalue = value < values.min\n\t\t\t? values.min\n\t\t\t: (value > values.max ? values.max : value);\n\t\tset_func(mDeviceHandle, value);\n\t}\n\tRETURN(ret, int);\n}\n\n/**\n * カメラコントロール設定の下請け\n */\nint UVCCamera::internalSetCtrlValue(control_value_t &values, uint32_t value,\n\t\tparamget_func_u32 get_func, paramset_func_u32 set_func) {\n\tint ret = update_ctrl_values(mDeviceHandle, values, get_func);\n\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\tvalue = value < values.min\n\t\t\t? values.min\n\t\t\t: (value > values.max ? values.max : value);\n\t\tset_func(mDeviceHandle, value);\n\t}\n\tRETURN(ret, int);\n}\n\n//======================================================================\n// スキャニングモード\nint UVCCamera::updateScanningModeLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & CTRL_SCANNING) {\n\t\tUPDATE_CTRL_VALUES(mScanningMode, uvc_get_scanning_mode);\n\t}\n\tRETURN(ret, int);\n}\n\n// スキャニングモードをセット\nint UVCCamera::setScanningMode(int mode) {\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mCtrlSupports & CTRL_SCANNING)) {\n//\t\tLOGI(\"ae:%d\", mode);\n\t\tr = uvc_set_scanning_mode(mDeviceHandle, mode/* & 0xff*/);\n\t}\n\tRETURN(r, int);\n}\n\n// スキャニングモード設定を取得\nint UVCCamera::getScanningMode() {\n\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mCtrlSupports & CTRL_SCANNING)) {\n\t\tuint8_t mode;\n\t\tr = uvc_get_scanning_mode(mDeviceHandle, &mode, UVC_GET_CUR);\n//\t\tLOGI(\"ae:%d\", mode);\n\t\tif (LIKELY(!r)) {\n\t\t\tr = mode;\n\t\t}\n\t}\n\tRETURN(r, int);\n}\n\n//======================================================================\n// 露出モード\nint UVCCamera::updateExposureModeLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & CTRL_AE) {\n\t\tUPDATE_CTRL_VALUES(mExposureMode, uvc_get_ae_mode);\n\t}\n\tRETURN(ret, int);\n}\n\n// 露出をセット\nint UVCCamera::setExposureMode(int mode) {\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mCtrlSupports & CTRL_AE)) {\n//\t\tLOGI(\"ae:%d\", mode);\n\t\tr = uvc_set_ae_mode(mDeviceHandle, mode/* & 0xff*/);\n\t}\n\tRETURN(r, int);\n}\n\n// 露出設定を取得\nint UVCCamera::getExposureMode() {\n\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mCtrlSupports & CTRL_AE)) {\n\t\tuint8_t mode;\n\t\tr = uvc_get_ae_mode(mDeviceHandle, &mode, UVC_GET_CUR);\n//\t\tLOGI(\"ae:%d\", mode);\n\t\tif (LIKELY(!r)) {\n\t\t\tr = mode;\n\t\t}\n\t}\n\tRETURN(r, int);\n}\n\n//======================================================================\n// 露出優先設定\nint UVCCamera::updateExposurePriorityLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & CTRL_AE_PRIORITY) {\n\t\tUPDATE_CTRL_VALUES(mExposurePriority, uvc_get_ae_priority);\n\t}\n\tRETURN(ret, int);\n}\n\n// 露出優先設定をセット\nint UVCCamera::setExposurePriority(int priority) {\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mCtrlSupports & CTRL_AE_PRIORITY)) {\n//\t\tLOGI(\"ae priority:%d\", priority);\n\t\tr = uvc_set_ae_priority(mDeviceHandle, priority/* & 0xff*/);\n\t}\n\tRETURN(r, int);\n}\n\n// 露出優先設定を取得\nint UVCCamera::getExposurePriority() {\n\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mCtrlSupports & CTRL_AE_PRIORITY)) {\n\t\tuint8_t priority;\n\t\tr = uvc_get_ae_priority(mDeviceHandle, &priority, UVC_GET_CUR);\n//\t\tLOGI(\"ae priority:%d\", priority);\n\t\tif (LIKELY(!r)) {\n\t\t\tr = priority;\n\t\t}\n\t}\n\tRETURN(r, int);\n}\n\n//======================================================================\n// 露出(絶対値)設定\nint UVCCamera::updateExposureLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & CTRL_AE_ABS) {\n\t\tUPDATE_CTRL_VALUES(mExposureAbs, uvc_get_exposure_abs);\n\t}\n\tRETURN(ret, int);\n}\n\n// 露出(絶対値)設定をセット\nint UVCCamera::setExposure(int ae_abs) {\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mCtrlSupports & CTRL_AE_ABS)) {\n//\t\tLOGI(\"ae_abs:%d\", ae_abs);\n\t\tr = uvc_set_exposure_abs(mDeviceHandle, ae_abs/* & 0xff*/);\n\t}\n\tRETURN(r, int);\n}\n\n// 露出(絶対値)設定を取得\nint UVCCamera::getExposure() {\n\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mCtrlSupports & CTRL_AE_ABS)) {\n\t\tint ae_abs;\n\t\tr = uvc_get_exposure_abs(mDeviceHandle, &ae_abs, UVC_GET_CUR);\n//\t\tLOGI(\"ae_abs:%d\", ae_abs);\n\t\tif (LIKELY(!r)) {\n\t\t\tr = ae_abs;\n\t\t}\n\t}\n\tRETURN(r, int);\n}\n\n//======================================================================\n// 露出(相対値)設定\nint UVCCamera::updateExposureRelLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & CTRL_AE_REL) {\n\t\tUPDATE_CTRL_VALUES(mExposureAbs, uvc_get_exposure_rel);\n\t}\n\tRETURN(ret, int);\n}\n\n// 露出(相対値)設定をセット\nint UVCCamera::setExposureRel(int ae_rel) {\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mCtrlSupports & CTRL_AE_REL)) {\n//\t\tLOGI(\"ae_rel:%d\", ae_rel);\n\t\tr = uvc_set_exposure_rel(mDeviceHandle, ae_rel/* & 0xff*/);\n\t}\n\tRETURN(r, int);\n}\n\n// 露出(相対値)設定を取得\nint UVCCamera::getExposureRel() {\n\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mCtrlSupports & CTRL_AE_REL)) {\n\t\tint ae_rel;\n\t\tr = uvc_get_exposure_rel(mDeviceHandle, &ae_rel, UVC_GET_CUR);\n//\t\tLOGI(\"ae_rel:%d\", ae_rel);\n\t\tif (LIKELY(!r)) {\n\t\t\tr = ae_rel;\n\t\t}\n\t}\n\tRETURN(r, int);\n}\n\n//======================================================================\n// オートフォーカス\nint UVCCamera::updateAutoFocusLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & CTRL_FOCUS_AUTO) {\n\t\tUPDATE_CTRL_VALUES(mAutoFocus, uvc_get_focus_auto);\n\t}\n\tRETURN(ret, int);\n}\n\n// オートフォーカスをon/off\nint UVCCamera::setAutoFocus(bool autoFocus) {\n\tENTER();\n\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mCtrlSupports & CTRL_FOCUS_AUTO)) {\n\t\tr = uvc_set_focus_auto(mDeviceHandle, autoFocus);\n\t}\n\tRETURN(r, int);\n}\n\n// オートフォーカスのon/off状態を取得\nbool UVCCamera::getAutoFocus() {\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mCtrlSupports & CTRL_FOCUS_AUTO)) {\n\t\tuint8_t autoFocus;\n\t\tr = uvc_get_focus_auto(mDeviceHandle, &autoFocus, UVC_GET_CUR);\n\t\tif (LIKELY(!r))\n\t\t\tr = autoFocus;\n\t}\n\tRETURN(r, int);\n}\n\n//======================================================================\n// フォーカス(絶対値)調整\nint UVCCamera::updateFocusLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_FOCUS_ABS) {\n\t\tUPDATE_CTRL_VALUES(mFocus, uvc_get_focus_abs);\n\t}\n\tRETURN(ret, int);\n}\n\n// フォーカス(絶対値)を設定\nint UVCCamera::setFocus(int focus) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_FOCUS_ABS) {\n\t\tret = internalSetCtrlValue(mFocus, focus, uvc_get_focus_abs, uvc_set_focus_abs);\n\t}\n\tRETURN(ret, int);\n}\n\n// フォーカス(絶対値)の現在値を取得\nint UVCCamera::getFocus() {\n\tENTER();\n\tif (mCtrlSupports & CTRL_FOCUS_ABS) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mFocus, uvc_get_focus_abs);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tint16_t value;\n\t\t\tret = uvc_get_focus_abs(mDeviceHandle, &value, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn value;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// フォーカス(相対値)調整\nint UVCCamera::updateFocusRelLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_FOCUS_REL) {\n\t\tUPDATE_CTRL_VALUES(mFocusRel, uvc_get_focus_rel);\n\t}\n\tRETURN(ret, int);\n}\n\n// フォーカス(相対値)を設定\nint UVCCamera::setFocusRel(int focus_rel) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_FOCUS_REL) {\n\t\tret = internalSetCtrlValue(mFocusRel, (int8_t)((focus_rel >> 8) & 0xff), (uint8_t)(focus_rel &0xff), uvc_get_focus_rel, uvc_set_focus_rel);\n\t}\n\tRETURN(ret, int);\n}\n\n// フォーカス(相対値)の現在値を取得\nint UVCCamera::getFocusRel() {\n\tENTER();\n\tif (mCtrlSupports & CTRL_FOCUS_REL) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mFocusRel, uvc_get_focus_abs);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tint8_t focus;\n\t\t\tuint8_t speed;\n\t\t\tret = uvc_get_focus_rel(mDeviceHandle, &focus, &speed, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn (focus <<8) + speed;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n/*\n// フォーカス(シンプル)調整\nint UVCCamera::updateFocusSimpleLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_FOCUS_SIMPLE) {\n\t\tUPDATE_CTRL_VALUES(mFocusSimple, uvc_get_focus_simple_range);\n\t}\n\tRETURN(ret, int);\n}\n\n// フォーカス(シンプル)を設定\nint UVCCamera::setFocusSimple(int focus) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_FOCUS_SIMPLE) {\n\t\tret = internalSetCtrlValue(mFocusSimple, focus, uvc_get_focus_simple_range, uvc_set_focus_simple_range);\n\t}\n\tRETURN(ret, int);\n}\n\n// フォーカス(シンプル)の現在値を取得\nint UVCCamera::getFocusSimple() {\n\tENTER();\n\tif (mCtrlSupports & CTRL_FOCUS_SIMPLE) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mFocusSimple, uvc_get_focus_abs);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint8_t value;\n\t\t\tret = uvc_get_focus_simple_range(mDeviceHandle, &value, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn value;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n*/\n\n//======================================================================\n// 絞り(絶対値)調整\nint UVCCamera::updateIrisLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_IRIS_ABS) {\n\t\tUPDATE_CTRL_VALUES(mIris, uvc_get_iris_abs);\n\t}\n\tRETURN(ret, int);\n}\n\n// 絞り(絶対値)を設定\nint UVCCamera::setIris(int iris) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_IRIS_ABS) {\n\t\tret = internalSetCtrlValue(mIris, iris, uvc_get_iris_abs, uvc_set_iris_abs);\n\t}\n\tRETURN(ret, int);\n}\n\n// 絞り(絶対値)の現在値を取得\nint UVCCamera::getIris() {\n\tENTER();\n\tif (mCtrlSupports & CTRL_IRIS_ABS) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mIris, uvc_get_iris_abs);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint16_t value;\n\t\t\tret = uvc_get_iris_abs(mDeviceHandle, &value, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn value;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// 絞り(相対値)調整\nint UVCCamera::updateIrisRelLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_IRIS_REL) {\n\t\tUPDATE_CTRL_VALUES(mIris, uvc_get_iris_rel);\n\t}\n\tRETURN(ret, int);\n}\n\n// 絞り(相対値)を設定\nint UVCCamera::setIrisRel(int iris_rel) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_IRIS_REL) {\n\t\tret = internalSetCtrlValue(mIris, iris_rel, uvc_get_iris_rel, uvc_set_iris_rel);\n\t}\n\tRETURN(ret, int);\n}\n\n// 絞り(相対値)の現在値を取得\nint UVCCamera::getIrisRel() {\n\tENTER();\n\tif (mCtrlSupports & CTRL_IRIS_REL) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mIris, uvc_get_iris_rel);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint8_t iris_rel;\n\t\t\tret = uvc_get_iris_rel(mDeviceHandle, &iris_rel, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn iris_rel;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// Pan(絶対値)調整\nint UVCCamera::updatePanLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_PANTILT_ABS) {\n\t\tupdate_ctrl_values(mDeviceHandle, mPan, mTilt, uvc_get_pantilt_abs);\n\t}\n\tRETURN(ret, int);\n}\n\n// Pan(絶対値)を設定\nint UVCCamera::setPan(int pan) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_PANTILT_ABS) {\n\t\tret = update_ctrl_values(mDeviceHandle, mPan, mTilt, uvc_get_pantilt_abs);\n\t\tif (LIKELY(!ret)) {\n\t\t\tpan = pan < mPan.min\n\t\t\t\t\t? mPan.min\n\t\t\t\t\t: (pan > mPan.max ? mPan.max : pan);\n\t\t\tint tilt = mTilt.current < 0 ? mTilt.def : mTilt.current;\n\t\t\tret = uvc_set_pantilt_abs(mDeviceHandle, pan, tilt);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\tmPan.current = pan;\n\t\t\t\tmTilt.current = tilt;\n\t\t\t}\n\t\t}\n\t}\n\tRETURN(ret, int);\n}\n\n// Pan(絶対値)の現在値を取得\nint UVCCamera::getPan() {\n\tENTER();\n\tif (mCtrlSupports & CTRL_PANTILT_ABS) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mPan, mTilt, uvc_get_pantilt_abs);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tint32_t pan, tilt;\n\t\t\tret = uvc_get_pantilt_abs(mDeviceHandle, &pan, &tilt, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\tmPan.current = pan;\n\t\t\t\tmTilt.current = tilt;\n\t\t\t\treturn pan;\n\t\t\t}\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// Tilt(絶対値)調整\nint UVCCamera::updateTiltLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_PANTILT_ABS) {\n\t\tupdate_ctrl_values(mDeviceHandle, mPan, mTilt, uvc_get_pantilt_abs);\n\t}\n\tRETURN(ret, int);\n}\n\n// Tilt(絶対値)を設定\nint UVCCamera::setTilt(int tilt) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_PANTILT_ABS) {\n\t\tret = update_ctrl_values(mDeviceHandle, mPan, mTilt, uvc_get_pantilt_abs);\n\t\tif (LIKELY(!ret)) {\n\t\t\ttilt = tilt < mTilt.min\n\t\t\t\t\t? mTilt.min\n\t\t\t\t\t: (tilt > mTilt.max ? mTilt.max : tilt);\n\t\t\tint pan = mPan.current < 0 ? mPan.def : mPan.current;\n\t\t\tret = uvc_set_pantilt_abs(mDeviceHandle, pan, tilt);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\tmPan.current = pan;\n\t\t\t\tmTilt.current = tilt;\n\t\t\t}\n\t\t}\n\t}\n\tRETURN(ret, int);\n}\n\n// Tilt(絶対値)の現在値を取得\nint UVCCamera::getTilt() {\n\tENTER();\n\tif (mCtrlSupports & CTRL_PANTILT_ABS) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mPan, mTilt, uvc_get_pantilt_abs);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tint32_t pan, tilt;\n\t\t\tret = uvc_get_pantilt_abs(mDeviceHandle, &pan, &tilt, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\tmPan.current = pan;\n\t\t\t\tmTilt.current = tilt;\n\t\t\t\treturn tilt;\n\t\t\t}\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// Roll(絶対値)調整\nint UVCCamera::updateRollLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_ROLL_ABS) {\n\t\tUPDATE_CTRL_VALUES(mRoll, uvc_get_roll_abs);\n\t}\n\tRETURN(ret, int);\n}\n\n// Roll(絶対値)を設定\nint UVCCamera::setRoll(int roll) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_ROLL_ABS) {\n\t\tret = internalSetCtrlValue(mRoll, roll, uvc_get_roll_abs, uvc_set_roll_abs);\n\t}\n\tRETURN(ret, int);\n}\n\n// Roll(絶対値)の現在値を取得\nint UVCCamera::getRoll() {\n\tENTER();\n\tif (mCtrlSupports & CTRL_ROLL_ABS) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mRoll, uvc_get_roll_abs);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tint16_t roll;\n\t\t\tret = uvc_get_roll_abs(mDeviceHandle, &roll, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\tmRoll.current = roll;\n\t\t\t\treturn roll;\n\t\t\t}\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\nint UVCCamera::updatePanRelLimit(int &min, int &max, int &def) {\n\tENTER();\n\t// FIXME not implemented yet\n\tRETURN(UVC_ERROR_ACCESS, int);\n}\n\nint UVCCamera::setPanRel(int pan_rel) {\n\tENTER();\n\t// FIXME not implemented yet\n\tRETURN(UVC_ERROR_ACCESS, int);\n}\n\nint UVCCamera::getPanRel() {\n\tENTER();\n\t// FIXME not implemented yet\n\tRETURN(UVC_ERROR_ACCESS, int);\n}\n\t\n//======================================================================\nint UVCCamera::updateTiltRelLimit(int &min, int &max, int &def) {\n\tENTER();\n\t// FIXME not implemented yet\n\tRETURN(UVC_ERROR_ACCESS, int);\n}\n\nint UVCCamera::setTiltRel(int tilt_rel) {\n\tENTER();\n\t// FIXME not implemented yet\n\tRETURN(UVC_ERROR_ACCESS, int);\n}\n\nint UVCCamera::getTiltRel() {\n\tENTER();\n\t// FIXME not implemented yet\n\tRETURN(UVC_ERROR_ACCESS, int);\n}\n\t\n//======================================================================\nint UVCCamera::updateRollRelLimit(int &min, int &max, int &def) {\n\tENTER();\n\t// FIXME not implemented yet\n\tRETURN(UVC_ERROR_ACCESS, int);\n}\n\nint UVCCamera::setRollRel(int roll_rel) {\n\tENTER();\n\t// FIXME not implemented yet\n\tRETURN(UVC_ERROR_ACCESS, int);\n}\n\nint UVCCamera::getRollRel() {\n\tENTER();\n\t// FIXME not implemented yet\n\tRETURN(UVC_ERROR_ACCESS, int);\n}\n\n//======================================================================\n// プライバシーモード\nint UVCCamera::updatePrivacyLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_PRIVACY) {\n\t\tUPDATE_CTRL_VALUES(mPrivacy, uvc_get_focus_abs);\n\t}\n\tRETURN(ret, int);\n}\n\n// プライバシーモードを設定\nint UVCCamera::setPrivacy(int privacy) {\n\tENTER();\n\tint ret = UVC_ERROR_ACCESS;\n\tif (mCtrlSupports & CTRL_PRIVACY) {\n\t\tret = internalSetCtrlValue(mPrivacy, privacy, uvc_get_privacy, uvc_set_privacy);\n\t}\n\tRETURN(ret, int);\n}\n\n// プライバシーモードの現在値を取得\nint UVCCamera::getPrivacy() {\n\tENTER();\n\tif (mCtrlSupports & CTRL_PRIVACY) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mPrivacy, uvc_get_privacy);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint8_t privacy;\n\t\t\tret = uvc_get_privacy(mDeviceHandle, &privacy, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn privacy;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n/*\n// DigitalWindow\nint UVCCamera::updateDigitalWindowLimit(...not defined...) {\n\tENTER();\n\t// FIXME not implemented yet\n\tRETURN(UVC_ERROR_ACCESS, int);\n}\n\n// DigitalWindowを設定\nint UVCCamera::setDigitalWindow(int top, int reft, int bottom, int right) {\n\tENTER();\n\t// FIXME not implemented yet\n\tRETURN(UVC_ERROR_ACCESS, int);\n}\n\n// DigitalWindowの現在値を取得\nint UVCCamera::getDigitalWindow(int &top, int &reft, int &bottom, int &right) {\n\tENTER();\n\t// FIXME not implemented yet\n\tRETURN(UVC_ERROR_ACCESS, int);\n}\n*/\n\n//======================================================================\n/*\n// DigitalRoi\nint UVCCamera::updateDigitalRoiLimit(...not defined...) {\n\tENTER();\n\t// FIXME not implemented yet\n\tRETURN(UVC_ERROR_ACCESS, int);\n}\n\n// DigitalRoiを設定\nint UVCCamera::setDigitalRoi(int top, int reft, int bottom, int right) {\n\tENTER();\n\t// FIXME not implemented yet\n\tRETURN(UVC_ERROR_ACCESS, int);\n}\n\n// DigitalRoiの現在値を取得\nint UVCCamera::getDigitalRoi(int &top, int &reft, int &bottom, int &right) {\n\tENTER();\n\t// FIXME not implemented yet\n\tRETURN(UVC_ERROR_ACCESS, int);\n}\n*/\n\n//======================================================================\n// backlight_compensation\nint UVCCamera::updateBacklightCompLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_BACKLIGHT) {\n\t\tUPDATE_CTRL_VALUES(mBacklightComp, uvc_get_backlight_compensation);\n\t}\n\tRETURN(ret, int);\n}\n\n// backlight_compensationを設定\nint UVCCamera::setBacklightComp(int backlight) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_BACKLIGHT) {\n\t\tret = internalSetCtrlValue(mBacklightComp, backlight, uvc_get_backlight_compensation, uvc_set_backlight_compensation);\n\t}\n\tRETURN(ret, int);\n}\n\n// backlight_compensationの現在値を取得\nint UVCCamera::getBacklightComp() {\n\tENTER();\n\tif (mPUSupports & PU_BACKLIGHT) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mBacklightComp, uvc_get_backlight_compensation);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tint16_t value;\n\t\t\tret = uvc_get_backlight_compensation(mDeviceHandle, &value, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn value;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n\n//======================================================================\n// 明るさ\nint UVCCamera::updateBrightnessLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_BRIGHTNESS) {\n\t\tUPDATE_CTRL_VALUES(mBrightness, uvc_get_brightness);\n\t}\n\tRETURN(ret, int);\n}\n\nint UVCCamera::setBrightness(int brightness) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_BRIGHTNESS) {\n\t\tret = internalSetCtrlValue(mBrightness, brightness, uvc_get_brightness, uvc_set_brightness);\n\t}\n\tRETURN(ret, int);\n}\n\n// 明るさの現在値を取得\nint UVCCamera::getBrightness() {\n\tENTER();\n\tif (mPUSupports & PU_BRIGHTNESS) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mBrightness, uvc_get_brightness);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tint16_t value;\n\t\t\tret = uvc_get_brightness(mDeviceHandle, &value, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn value;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// コントラスト調整\nint UVCCamera::updateContrastLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_CONTRAST) {\n\t\tUPDATE_CTRL_VALUES(mContrast, uvc_get_contrast);\n\t}\n\tRETURN(ret, int);\n}\n\n// コントラストを設定\nint UVCCamera::setContrast(uint16_t contrast) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_CONTRAST) {\n\t\tret = internalSetCtrlValue(mContrast, contrast, uvc_get_contrast, uvc_set_contrast);\n\t}\n\tRETURN(ret, int);\n}\n\n// コントラストの現在値を取得\nint UVCCamera::getContrast() {\n\tENTER();\n\tif (mPUSupports & PU_CONTRAST) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mContrast, uvc_get_contrast);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint16_t value;\n\t\t\tret = uvc_get_contrast(mDeviceHandle, &value, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn value;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// オートコントラスト\nint UVCCamera::updateAutoContrastLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_CONTRAST_AUTO) {\n\t\tUPDATE_CTRL_VALUES(mAutoFocus, uvc_get_contrast_auto);\n\t}\n\tRETURN(ret, int);\n}\n\n// オートコントラストをon/off\nint UVCCamera::setAutoContrast(bool autoContrast) {\n\tENTER();\n\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mPUSupports & PU_CONTRAST_AUTO)) {\n\t\tr = uvc_set_contrast_auto(mDeviceHandle, autoContrast);\n\t}\n\tRETURN(r, int);\n}\n\n// オートコントラストのon/off状態を取得\nbool UVCCamera::getAutoContrast() {\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mPUSupports & PU_CONTRAST_AUTO)) {\n\t\tuint8_t autoContrast;\n\t\tr = uvc_get_contrast_auto(mDeviceHandle, &autoContrast, UVC_GET_CUR);\n\t\tif (LIKELY(!r))\n\t\t\tr = autoContrast;\n\t}\n\tRETURN(r, int);\n}\n\n//======================================================================\n// シャープネス調整\nint UVCCamera::updateSharpnessLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_SHARPNESS) {\n\t\tUPDATE_CTRL_VALUES(mSharpness, uvc_get_sharpness);\n\t}\n\tRETURN(ret, int);\n}\n\n// シャープネスを設定\nint UVCCamera::setSharpness(int sharpness) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_SHARPNESS) {\n\t\tret = internalSetCtrlValue(mSharpness, sharpness, uvc_get_sharpness, uvc_set_sharpness);\n\t}\n\tRETURN(ret, int);\n}\n\n// シャープネスの現在値を取得\nint UVCCamera::getSharpness() {\n\tENTER();\n\tif (mPUSupports & PU_SHARPNESS) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mSharpness, uvc_get_sharpness);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint16_t value;\n\t\t\tret = uvc_get_sharpness(mDeviceHandle, &value, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn value;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// ゲイン調整\nint UVCCamera::updateGainLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_GAIN) {\n\t\tUPDATE_CTRL_VALUES(mGain, uvc_get_gain)\n\t}\n\tRETURN(ret, int);\n}\n\n// ゲインを設定\nint UVCCamera::setGain(int gain) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_GAIN) {\n//\t\tLOGI(\"gain:%d\", gain);\n\t\tret = internalSetCtrlValue(mGain, gain, uvc_get_gain, uvc_set_gain);\n\t}\n\tRETURN(ret, int);\n}\n\n// ゲインの現在値を取得\nint UVCCamera::getGain() {\n\tENTER();\n\tif (mPUSupports & PU_GAIN) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mGain, uvc_get_gain);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint16_t value;\n\t\t\tret = uvc_get_gain(mDeviceHandle, &value, UVC_GET_CUR);\n//\t\t\tLOGI(\"gain:%d\", value);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn value;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// オートホワイトバランス(temp)\nint UVCCamera::updateAutoWhiteBlanceLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_WB_TEMP_AUTO) {\n\t\tUPDATE_CTRL_VALUES(mAutoWhiteBlance, uvc_get_white_balance_temperature_auto);\n\t}\n\tRETURN(ret, int);\n}\n\n// オートホワイトバランス(temp)をon/off\nint UVCCamera::setAutoWhiteBlance(bool autoWhiteBlance) {\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mPUSupports & PU_WB_TEMP_AUTO)) {\n\t\tr = uvc_set_white_balance_temperature_auto(mDeviceHandle, autoWhiteBlance);\n\t}\n\tRETURN(r, int);\n}\n\n// オートホワイトバランス(temp)のon/off状態を取得\nbool UVCCamera::getAutoWhiteBlance() {\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mPUSupports & PU_WB_TEMP_AUTO)) {\n\t\tuint8_t autoWhiteBlance;\n\t\tr = uvc_get_white_balance_temperature_auto(mDeviceHandle, &autoWhiteBlance, UVC_GET_CUR);\n\t\tif (LIKELY(!r))\n\t\t\tr = autoWhiteBlance;\n\t}\n\tRETURN(r, int);\n}\n\n//======================================================================\n// オートホワイトバランス(compo)\nint UVCCamera::updateAutoWhiteBlanceCompoLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_WB_COMPO_AUTO) {\n\t\tUPDATE_CTRL_VALUES(mAutoWhiteBlanceCompo, uvc_get_white_balance_component_auto);\n\t}\n\tRETURN(ret, int);\n}\n\n// オートホワイトバランス(compo)をon/off\nint UVCCamera::setAutoWhiteBlanceCompo(bool autoWhiteBlanceCompo) {\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mPUSupports & PU_WB_COMPO_AUTO)) {\n\t\tr = uvc_set_white_balance_component_auto(mDeviceHandle, autoWhiteBlanceCompo);\n\t}\n\tRETURN(r, int);\n}\n\n// オートホワイトバランス(compo)のon/off状態を取得\nbool UVCCamera::getAutoWhiteBlanceCompo() {\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mPUSupports & PU_WB_COMPO_AUTO)) {\n\t\tuint8_t autoWhiteBlanceCompo;\n\t\tr = uvc_get_white_balance_component_auto(mDeviceHandle, &autoWhiteBlanceCompo, UVC_GET_CUR);\n\t\tif (LIKELY(!r))\n\t\t\tr = autoWhiteBlanceCompo;\n\t}\n\tRETURN(r, int);\n}\n\n//======================================================================\n// ホワイトバランス色温度調整\nint UVCCamera::updateWhiteBlanceLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_WB_TEMP) {\n\t\tUPDATE_CTRL_VALUES(mWhiteBlance, uvc_get_white_balance_temperature)\n\t}\n\tRETURN(ret, int);\n}\n\n// ホワイトバランス色温度を設定\nint UVCCamera::setWhiteBlance(int white_blance) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_WB_TEMP) {\n\t\tret = internalSetCtrlValue(mWhiteBlance, white_blance,\n\t\t\tuvc_get_white_balance_temperature, uvc_set_white_balance_temperature);\n\t}\n\tRETURN(ret, int);\n}\n\n// ホワイトバランス色温度の現在値を取得\nint UVCCamera::getWhiteBlance() {\n\tENTER();\n\tif (mPUSupports & PU_WB_TEMP) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mWhiteBlance, uvc_get_white_balance_temperature);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint16_t value;\n\t\t\tret = uvc_get_white_balance_temperature(mDeviceHandle, &value, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn value;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// ホワイトバランスcompo調整\nint UVCCamera::updateWhiteBlanceCompoLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_WB_COMPO) {\n\t\tUPDATE_CTRL_VALUES(mWhiteBlanceCompo, uvc_get_white_balance_component)\n\t}\n\tRETURN(ret, int);\n}\n\n// ホワイトバランスcompoを設定\nint UVCCamera::setWhiteBlanceCompo(int white_blance_compo) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_WB_COMPO) {\n\t\tret = internalSetCtrlValue(mWhiteBlanceCompo, white_blance_compo,\n\t\t\tuvc_get_white_balance_component, uvc_set_white_balance_component);\n\t}\n\tRETURN(ret, int);\n}\n\n// ホワイトバランスcompoの現在値を取得\nint UVCCamera::getWhiteBlanceCompo() {\n\tENTER();\n\tif (mPUSupports & PU_WB_COMPO) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mWhiteBlanceCompo, uvc_get_white_balance_component);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint32_t white_blance_compo;\n\t\t\tret = uvc_get_white_balance_component(mDeviceHandle, &white_blance_compo, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn white_blance_compo;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// ガンマ調整\nint UVCCamera::updateGammaLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_GAMMA) {\n\t\tUPDATE_CTRL_VALUES(mGamma, uvc_get_gamma)\n\t}\n\tRETURN(ret, int);\n}\n\n// ガンマを設定\nint UVCCamera::setGamma(int gamma) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_GAMMA) {\n//\t\tLOGI(\"gamma:%d\", gamma);\n\t\tret = internalSetCtrlValue(mGamma, gamma, uvc_get_gamma, uvc_set_gamma);\n\t}\n\tRETURN(ret, int);\n}\n\n// ガンマの現在値を取得\nint UVCCamera::getGamma() {\n\tENTER();\n\tif (mPUSupports & PU_GAMMA) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mGamma, uvc_get_gamma);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint16_t value;\n\t\t\tret = uvc_get_gamma(mDeviceHandle, &value, UVC_GET_CUR);\n//\t\t\tLOGI(\"gamma:%d\", ret);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn value;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// 彩度調整\nint UVCCamera::updateSaturationLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_SATURATION) {\n\t\tUPDATE_CTRL_VALUES(mSaturation, uvc_get_saturation)\n\t}\n\tRETURN(ret, int);\n}\n\n// 彩度を設定\nint UVCCamera::setSaturation(int saturation) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_SATURATION) {\n\t\tret = internalSetCtrlValue(mSaturation, saturation, uvc_get_saturation, uvc_set_saturation);\n\t}\n\tRETURN(ret, int);\n}\n\n// 彩度の現在値を取得\nint UVCCamera::getSaturation() {\n\tENTER();\n\tif (mPUSupports & PU_SATURATION) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mSaturation, uvc_get_saturation);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint16_t value;\n\t\t\tret = uvc_get_saturation(mDeviceHandle, &value, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn value;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// 色相調整\nint UVCCamera::updateHueLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_HUE) {\n\t\tUPDATE_CTRL_VALUES(mHue, uvc_get_hue)\n\t}\n\tRETURN(ret, int);\n}\n\n// 色相を設定\nint UVCCamera::setHue(int hue) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_HUE) {\n\t\tret = internalSetCtrlValue(mHue, hue, uvc_get_hue, uvc_set_hue);\n\t}\n\tRETURN(ret, int);\n}\n\n// 色相の現在値を取得\nint UVCCamera::getHue() {\n\tENTER();\n\tif (mPUSupports & PU_HUE) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mHue, uvc_get_hue);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tint16_t value;\n\t\t\tret = uvc_get_hue(mDeviceHandle, &value, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn value;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// オート色相\nint UVCCamera::updateAutoHueLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_HUE_AUTO) {\n\t\tUPDATE_CTRL_VALUES(mAutoHue, uvc_get_hue_auto);\n\t}\n\tRETURN(ret, int);\n}\n\n// オート色相をon/off\nint UVCCamera::setAutoHue(bool autoHue) {\n\tENTER();\n\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mPUSupports & PU_HUE_AUTO)) {\n\t\tr = uvc_set_hue_auto(mDeviceHandle, autoHue);\n\t}\n\tRETURN(r, int);\n}\n\n// オート色相のon/off状態を取得\nbool UVCCamera::getAutoHue() {\n\tENTER();\n\tint r = UVC_ERROR_ACCESS;\n\tif LIKELY((mDeviceHandle) && (mPUSupports & PU_HUE_AUTO)) {\n\t\tuint8_t autoHue;\n\t\tr = uvc_get_hue_auto(mDeviceHandle, &autoHue, UVC_GET_CUR);\n\t\tif (LIKELY(!r))\n\t\t\tr = autoHue;\n\t}\n\tRETURN(r, int);\n}\n\n//======================================================================\n// 電源周波数によるチラつき補正\nint UVCCamera::updatePowerlineFrequencyLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mCtrlSupports & PU_POWER_LF) {\n\t\tUPDATE_CTRL_VALUES(mPowerlineFrequency, uvc_get_powerline_freqency)\n\t}\n\tRETURN(ret, int);\n}\n\n// 電源周波数によるチラつき補正を設定\nint UVCCamera::setPowerlineFrequency(int frequency) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_POWER_LF) {\n\t\tif (frequency < 0) {\n\t\t\tuint8_t value;\n\t\t\tret = uvc_get_powerline_freqency(mDeviceHandle, &value, UVC_GET_DEF);\n\t\t\tif LIKELY(ret)\n\t\t\t\tfrequency = value;\n\t\t\telse\n\t\t\t\tRETURN(ret, int);\n\t\t}\n\t\tLOGD(\"frequency:%d\", frequency);\n\t\tret = uvc_set_powerline_freqency(mDeviceHandle, frequency);\n\t}\n\n\tRETURN(ret, int);\n}\n\n// 電源周波数によるチラつき補正値を取得\nint UVCCamera::getPowerlineFrequency() {\n\tENTER();\n\tif (mPUSupports & PU_POWER_LF) {\n\t\tuint8_t value;\n\t\tint ret = uvc_get_powerline_freqency(mDeviceHandle, &value, UVC_GET_CUR);\n\t\tLOGD(\"frequency:%d\", ret);\n\t\tif (LIKELY(!ret))\n\t\t\treturn value;\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// ズーム(abs)調整\nint UVCCamera::updateZoomLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mCtrlSupports & CTRL_ZOOM_ABS) {\n\t\tUPDATE_CTRL_VALUES(mZoom, uvc_get_zoom_abs)\n\t}\n\tRETURN(ret, int);\n}\n\n// ズーム(abs)を設定\nint UVCCamera::setZoom(int zoom) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mCtrlSupports & CTRL_ZOOM_ABS) {\n\t\tret = internalSetCtrlValue(mZoom, zoom, uvc_get_zoom_abs, uvc_set_zoom_abs);\n\t}\n\tRETURN(ret, int);\n}\n\n// ズーム(abs)の現在値を取得\nint UVCCamera::getZoom() {\n\tENTER();\n\tif (mCtrlSupports & CTRL_ZOOM_ABS) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mZoom, uvc_get_zoom_abs);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint16_t value;\n\t\t\tret = uvc_get_zoom_abs(mDeviceHandle, &value, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn value;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// ズーム(相対値)調整\nint UVCCamera::updateZoomRelLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mCtrlSupports & CTRL_ZOOM_REL) {\n\t\tUPDATE_CTRL_VALUES(mZoomRel, uvc_get_zoom_rel)\n\t}\n\tRETURN(ret, int);\n}\n\n// ズーム(相対値)を設定\nint UVCCamera::setZoomRel(int zoom) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mCtrlSupports & CTRL_ZOOM_REL) {\n\t\tret = internalSetCtrlValue(mZoomRel,\n\t\t\t(int8_t)((zoom >> 16) & 0xff), (uint8_t)((zoom >> 8) & 0xff), (uint8_t)(zoom & 0xff),\n\t\t\tuvc_get_zoom_rel, uvc_set_zoom_rel);\n\t}\n\tRETURN(ret, int);\n}\n\n// ズーム(相対値)の現在値を取得\nint UVCCamera::getZoomRel() {\n\tENTER();\n\tif (mCtrlSupports & CTRL_ZOOM_REL) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mZoomRel, uvc_get_zoom_rel);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tint8_t zoom;\n\t\t\tuint8_t isdigital;\n\t\t\tuint8_t speed;\n\t\t\tret = uvc_get_zoom_rel(mDeviceHandle, &zoom, &isdigital, &speed, UVC_GET_CUR);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn (zoom << 16) +(isdigital << 8) + speed;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// digital multiplier調整\nint UVCCamera::updateDigitalMultiplierLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_DIGITAL_MULT) {\n\t\tUPDATE_CTRL_VALUES(mMultiplier, uvc_get_digital_multiplier)\n\t}\n\tRETURN(ret, int);\n}\n\n// digital multiplierを設定\nint UVCCamera::setDigitalMultiplier(int multiplier) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_DIGITAL_MULT) {\n//\t\tLOGI(\"multiplier:%d\", multiplier);\n\t\tret = internalSetCtrlValue(mMultiplier, multiplier, uvc_get_digital_multiplier, uvc_set_digital_multiplier);\n\t}\n\tRETURN(ret, int);\n}\n\n// digital multiplierの現在値を取得\nint UVCCamera::getDigitalMultiplier() {\n\tENTER();\n\tif (mPUSupports & PU_DIGITAL_MULT) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mMultiplier, uvc_get_digital_multiplier);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint16_t multiplier;\n\t\t\tret = uvc_get_digital_multiplier(mDeviceHandle, &multiplier, UVC_GET_CUR);\n//\t\t\tLOGI(\"multiplier:%d\", multiplier);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn multiplier;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// digital multiplier limit調整\nint UVCCamera::updateDigitalMultiplierLimitLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_DIGITAL_LIMIT) {\n\t\tUPDATE_CTRL_VALUES(mMultiplierLimit, uvc_get_digital_multiplier_limit)\n\t}\n\tRETURN(ret, int);\n}\n\n// digital multiplier limitを設定\nint UVCCamera::setDigitalMultiplierLimit(int multiplier_limit) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_DIGITAL_LIMIT) {\n//\t\tLOGI(\"multiplier limit:%d\", multiplier_limit);\n\t\tret = internalSetCtrlValue(mMultiplierLimit, multiplier_limit, uvc_get_digital_multiplier_limit, uvc_set_digital_multiplier_limit);\n\t}\n\tRETURN(ret, int);\n}\n\n// digital multiplier limitの現在値を取得\nint UVCCamera::getDigitalMultiplierLimit() {\n\tENTER();\n\tif (mPUSupports & PU_DIGITAL_LIMIT) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mMultiplierLimit, uvc_get_digital_multiplier_limit);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint16_t multiplier_limit;\n\t\t\tret = uvc_get_digital_multiplier_limit(mDeviceHandle, &multiplier_limit, UVC_GET_CUR);\n//\t\t\tLOGI(\"multiplier_limit:%d\", multiplier_limit);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn multiplier_limit;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// AnalogVideoStandard\nint UVCCamera::updateAnalogVideoStandardLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_AVIDEO_STD) {\n\t\tUPDATE_CTRL_VALUES(mAnalogVideoStandard, uvc_get_analog_video_standard)\n\t}\n\tRETURN(ret, int);\n}\n\nint UVCCamera::setAnalogVideoStandard(int standard) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_AVIDEO_STD) {\n//\t\tLOGI(\"standard:%d\", standard);\n\t\tret = internalSetCtrlValue(mAnalogVideoStandard, standard, uvc_get_analog_video_standard, uvc_set_analog_video_standard);\n\t}\n\tRETURN(ret, int);\n}\n\nint UVCCamera::getAnalogVideoStandard() {\n\tENTER();\n\tif (mPUSupports & PU_AVIDEO_STD) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mAnalogVideoStandard, uvc_get_analog_video_standard);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint8_t standard;\n\t\t\tret = uvc_get_analog_video_standard(mDeviceHandle, &standard, UVC_GET_CUR);\n//\t\t\tLOGI(\"standard:%d\", standard);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn standard;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//======================================================================\n// AnalogVideoLoackStatus\nint UVCCamera::updateAnalogVideoLockStateLimit(int &min, int &max, int &def) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_AVIDEO_LOCK) {\n\t\tUPDATE_CTRL_VALUES(mAnalogVideoLockState, uvc_get_analog_video_lockstate)\n\t}\n\tRETURN(ret, int);\n}\n\nint UVCCamera::setAnalogVideoLockState(int state) {\n\tENTER();\n\tint ret = UVC_ERROR_IO;\n\tif (mPUSupports & PU_AVIDEO_LOCK) {\n//\t\tLOGI(\"status:%d\", status);\n\t\tret = internalSetCtrlValue(mAnalogVideoLockState, state, uvc_get_analog_video_lockstate, uvc_set_analog_video_lockstate);\n\t}\n\tRETURN(ret, int);\n}\n\nint UVCCamera::getAnalogVideoLockState() {\n\tENTER();\n\tif (mPUSupports & PU_AVIDEO_LOCK) {\n\t\tint ret = update_ctrl_values(mDeviceHandle, mAnalogVideoLockState, uvc_get_analog_video_lockstate);\n\t\tif (LIKELY(!ret)) {\t// 正常に最小・最大値を取得出来た時\n\t\t\tuint8_t status;\n\t\t\tret = uvc_get_analog_video_lockstate(mDeviceHandle, &status, UVC_GET_CUR);\n//\t\t\tLOGI(\"status:%d\", status);\n\t\t\tif (LIKELY(!ret))\n\t\t\t\treturn status;\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/UVCCamera.h",
    "content": "/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n * File name: UVCCamera.h\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n*/\n\n#pragma interface\n\n#ifndef UVCCAMERA_H_\n#define UVCCAMERA_H_\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <pthread.h>\n#include <android/native_window.h>\n#include \"UVCStatusCallback.h\"\n#include \"UVCButtonCallback.h\"\n#include \"UVCPreview.h\"\n\n#define\tCTRL_SCANNING\t\t0x000001\t// D0:  Scanning Mode\n#define\tCTRL_AE\t\t\t\t0x000002\t// D1:  Auto-Exposure Mode\n#define\tCTRL_AE_PRIORITY\t0x000004\t// D2:  Auto-Exposure Priority\n#define\tCTRL_AE_ABS\t\t\t0x000008\t// D3:  Exposure Time (Absolute)\n#define\tCTRL_AE_REL\t\t\t0x000010\t// D4:  Exposure Time (Relative)\n#define CTRL_FOCUS_ABS    \t0x000020\t// D5:  Focus (Absolute)\n#define CTRL_FOCUS_REL\t\t0x000040\t// D6:  Focus (Relative)\n#define CTRL_IRIS_ABS\t\t0x000080\t// D7:  Iris (Absolute)\n#define\tCTRL_IRIS_REL\t\t0x000100\t// D8:  Iris (Relative)\n#define\tCTRL_ZOOM_ABS\t\t0x000200\t// D9:  Zoom (Absolute)\n#define CTRL_ZOOM_REL\t\t0x000400\t// D10: Zoom (Relative)\n#define\tCTRL_PANTILT_ABS\t0x000800\t// D11: PanTilt (Absolute)\n#define CTRL_PANTILT_REL\t0x001000\t// D12: PanTilt (Relative)\n#define CTRL_ROLL_ABS\t\t0x002000\t// D13: Roll (Absolute)\n#define CTRL_ROLL_REL\t\t0x004000\t// D14: Roll (Relative)\n//#define CTRL_D15\t\t\t0x008000\t// D15: Reserved\n//#define CTRL_D16\t\t\t0x010000\t// D16: Reserved\n#define CTRL_FOCUS_AUTO\t\t0x020000\t// D17: Focus, Auto\n#define CTRL_PRIVACY\t\t0x040000\t// D18: Privacy\n#define CTRL_FOCUS_SIMPLE\t0x080000\t// D19: Focus, Simple\n#define CTRL_WINDOW\t\t\t0x100000\t// D20: Window\n\n#define PU_BRIGHTNESS\t\t0x000001\t// D0: Brightness\n#define PU_CONTRAST\t\t\t0x000002\t// D1: Contrast\n#define PU_HUE\t\t\t\t0x000004\t// D2: Hue\n#define\tPU_SATURATION\t\t0x000008\t// D3: Saturation\n#define PU_SHARPNESS\t\t0x000010\t// D4: Sharpness\n#define PU_GAMMA\t\t\t0x000020\t// D5: Gamma\n#define\tPU_WB_TEMP\t\t\t0x000040\t// D6: White Balance Temperature\n#define\tPU_WB_COMPO\t\t\t0x000080\t// D7: White Balance Component\n#define\tPU_BACKLIGHT\t\t0x000100\t// D8: Backlight Compensation\n#define PU_GAIN\t\t\t\t0x000200\t// D9: Gain\n#define PU_POWER_LF\t\t\t0x000400\t// D10: Power Line Frequency\n#define PU_HUE_AUTO\t\t\t0x000800\t// D11: Hue, Auto\n#define PU_WB_TEMP_AUTO\t\t0x001000\t// D12: White Balance Temperature, Auto\n#define PU_WB_COMPO_AUTO\t0x002000\t// D13: White Balance Component, Auto\n#define PU_DIGITAL_MULT\t\t0x004000\t// D14: Digital Multiplier\n#define PU_DIGITAL_LIMIT\t0x008000\t// D15: Digital Multiplier Limit\n#define PU_AVIDEO_STD\t\t0x010000\t// D16: Analog Video Standard\n#define PU_AVIDEO_LOCK\t\t0x020000\t// D17: Analog Video Lock Status\n#define PU_CONTRAST_AUTO\t0x040000\t// D18: Contrast, Auto\n\ntypedef struct control_value {\n\tint res;\t// unused\n\tint min;\n\tint max;\n\tint def;\n\tint current;\n} control_value_t;\n\ntypedef uvc_error_t (*paramget_func_i8)(uvc_device_handle_t *devh, int8_t *value, enum uvc_req_code req_code);\ntypedef uvc_error_t (*paramget_func_i16)(uvc_device_handle_t *devh, int16_t *value, enum uvc_req_code req_code);\ntypedef uvc_error_t (*paramget_func_i32)(uvc_device_handle_t *devh, int32_t *value, enum uvc_req_code req_code);\ntypedef uvc_error_t (*paramget_func_u8)(uvc_device_handle_t *devh, uint8_t *value, enum uvc_req_code req_code);\ntypedef uvc_error_t (*paramget_func_u16)(uvc_device_handle_t *devh, uint16_t *value, enum uvc_req_code req_code);\ntypedef uvc_error_t (*paramget_func_u32)(uvc_device_handle_t *devh, uint32_t *value, enum uvc_req_code req_code);\ntypedef uvc_error_t (*paramget_func_u8u8)(uvc_device_handle_t *devh, uint8_t *value1, uint8_t *value2, enum uvc_req_code req_code);\ntypedef uvc_error_t (*paramget_func_i8u8)(uvc_device_handle_t *devh, int8_t *value1, uint8_t *value2, enum uvc_req_code req_code);\ntypedef uvc_error_t (*paramget_func_i8u8u8)(uvc_device_handle_t *devh, int8_t *value1, uint8_t *value2, uint8_t *value3, enum uvc_req_code req_code);\ntypedef uvc_error_t (*paramget_func_i32i32)(uvc_device_handle_t *devh, int32_t *value1, int32_t *value2, enum uvc_req_code req_code);\n\ntypedef uvc_error_t (*paramset_func_i8)(uvc_device_handle_t *devh, int8_t value);\ntypedef uvc_error_t (*paramset_func_i16)(uvc_device_handle_t *devh, int16_t value);\ntypedef uvc_error_t (*paramset_func_i32)(uvc_device_handle_t *devh, int32_t value);\ntypedef uvc_error_t (*paramset_func_u8)(uvc_device_handle_t *devh, uint8_t value);\ntypedef uvc_error_t (*paramset_func_u16)(uvc_device_handle_t *devh, uint16_t value);\ntypedef uvc_error_t (*paramset_func_u32)(uvc_device_handle_t *devh, uint32_t value);\ntypedef uvc_error_t (*paramset_func_u8u8)(uvc_device_handle_t *devh, uint8_t value1, uint8_t value2);\ntypedef uvc_error_t (*paramset_func_i8u8)(uvc_device_handle_t *devh, int8_t value1, uint8_t value2);\ntypedef uvc_error_t (*paramset_func_i8u8u8)(uvc_device_handle_t *devh, int8_t value1, uint8_t value2, uint8_t value3);\ntypedef uvc_error_t (*paramset_func_i32i32)(uvc_device_handle_t *devh, int32_t value1, int32_t value2);\n\nclass UVCCamera {\n\tchar *mUsbFs;\n\tuvc_context_t *mContext;\n\tint mFd;\n\tuvc_device_t *mDevice;\n\tuvc_device_handle_t *mDeviceHandle;\n\tUVCStatusCallback *mStatusCallback;\n\tUVCButtonCallback *mButtonCallback;\n\t// プレビュー用\n\tUVCPreview *mPreview;\n\tuint64_t mCtrlSupports;\n\tuint64_t mPUSupports;\n\tcontrol_value_t mScanningMode;\n\tcontrol_value_t mExposureMode;\n\tcontrol_value_t mExposurePriority;\n\tcontrol_value_t mExposureAbs;\n\tcontrol_value_t mAutoFocus;\n\tcontrol_value_t mAutoWhiteBlance;\n\tcontrol_value_t mAutoWhiteBlanceCompo;\n\tcontrol_value_t mWhiteBlance;\n\tcontrol_value_t mWhiteBlanceCompo;\n\tcontrol_value_t mBacklightComp;\n\tcontrol_value_t mBrightness;\n\tcontrol_value_t mContrast;\n\tcontrol_value_t mAutoContrast;\n\tcontrol_value_t mSharpness;\n\tcontrol_value_t mGain;\n\tcontrol_value_t mGamma;\n\tcontrol_value_t mSaturation;\n\tcontrol_value_t mHue;\n\tcontrol_value_t mAutoHue;\n\tcontrol_value_t mZoom;\n\tcontrol_value_t mZoomRel;\n\tcontrol_value_t mFocus;\n\tcontrol_value_t mFocusRel;\n\tcontrol_value_t mFocusSimple;\n\tcontrol_value_t mIris;\n\tcontrol_value_t mIrisRel;\n\tcontrol_value_t mPan;\n\tcontrol_value_t mTilt;\n\tcontrol_value_t mRoll;\n\tcontrol_value_t mPanRel;\n\tcontrol_value_t mTiltRel;\n\tcontrol_value_t mRollRel;\n\tcontrol_value_t mPrivacy;\n\tcontrol_value_t mPowerlineFrequency;\n\tcontrol_value_t mMultiplier;\n\tcontrol_value_t mMultiplierLimit;\n\tcontrol_value_t mAnalogVideoStandard;\n\tcontrol_value_t mAnalogVideoLockState;\n\n\tvoid clearCameraParams();\n\tint internalSetCtrlValue(control_value_t &values, int8_t value,\n\t\tparamget_func_i8 get_func, paramset_func_i8 set_func);\n\tint internalSetCtrlValue(control_value_t &values, uint8_t value,\n\t\tparamget_func_u8 get_func, paramset_func_u8 set_func);\n\tint internalSetCtrlValue(control_value_t &values, uint8_t value1, uint8_t value2,\n\t\tparamget_func_u8u8 get_func, paramset_func_u8u8 set_func);\n\tint internalSetCtrlValue(control_value_t &values, int8_t value1, uint8_t value2,\n\t\tparamget_func_i8u8 get_func, paramset_func_i8u8 set_func);\n\tint internalSetCtrlValue(control_value_t &values, int8_t value1, uint8_t value2, uint8_t value3,\n\t\tparamget_func_i8u8u8 get_func, paramset_func_i8u8u8 set_func);\n\tint internalSetCtrlValue(control_value_t &values, int16_t value,\n\t\tparamget_func_i16 get_func, paramset_func_i16 set_func);\n\tint internalSetCtrlValue(control_value_t &values, uint16_t value,\n\t\tparamget_func_u16 get_func, paramset_func_u16 set_func);\n\tint internalSetCtrlValue(control_value_t &values, int32_t value,\n\t\tparamget_func_i32 get_func, paramset_func_i32 set_func);\n\tint internalSetCtrlValue(control_value_t &values, uint32_t value,\n\t\tparamget_func_u32 get_func, paramset_func_u32 set_func);\npublic:\n\tUVCCamera();\n\t~UVCCamera();\n\n\tint connect(int vid, int pid, int fd, int busnum, int devaddr, const char *usbfs);\n\tint release();\n\n\tint setStatusCallback(JNIEnv *env, jobject status_callback_obj);\n\tint setButtonCallback(JNIEnv *env, jobject button_callback_obj);\n\n\tchar *getSupportedSize();\n\tint setPreviewSize(int width, int height, int min_fps, int max_fps, int mode, float bandwidth = DEFAULT_BANDWIDTH);\n\tint setPreviewDisplay(ANativeWindow *preview_window);\n\tint setFrameCallback(JNIEnv *env, jobject frame_callback_obj, int pixel_format);\n\tint startPreview();\n\tint stopPreview();\n\tint setCaptureDisplay(ANativeWindow *capture_window);\n\n\tint getCtrlSupports(uint64_t *supports);\n\tint getProcSupports(uint64_t *supports);\n\n\tint updateScanningModeLimit(int &min, int &max, int &def);\n\tint setScanningMode(int mode);\n\tint getScanningMode();\n\t\n\tint updateExposureModeLimit(int &min, int &max, int &def);\n\tint setExposureMode(int mode);\n\tint getExposureMode();\n\n\tint updateExposurePriorityLimit(int &min, int &max, int &def);\n\tint setExposurePriority(int priority);\n\tint getExposurePriority();\n\t\n\tint updateExposureLimit(int &min, int &max, int &def);\n\tint setExposure(int ae_abs);\n\tint getExposure();\n\t\n\tint updateExposureRelLimit(int &min, int &max, int &def);\n\tint setExposureRel(int ae_rel);\n\tint getExposureRel();\n\t\n\tint updateAutoFocusLimit(int &min, int &max, int &def);\n\tint setAutoFocus(bool autoFocus);\n\tbool getAutoFocus();\n\n\tint updateFocusLimit(int &min, int &max, int &def);\n\tint setFocus(int focus);\n\tint getFocus();\n\n\tint updateFocusRelLimit(int &min, int &max, int &def);\n\tint setFocusRel(int focus);\n\tint getFocusRel();\n\t\n/*\tint updateFocusSimpleLimit(int &min, int &max, int &def);\n\tint setFocusSimple(int focus);\n\tint getFocusSimple(); */\n\t\n\tint updateIrisLimit(int &min, int &max, int &def);\n\tint setIris(int iris);\n\tint getIris();\n\t\n\tint updateIrisRelLimit(int &min, int &max, int &def);\n\tint setIrisRel(int iris);\n\tint getIrisRel();\n\t\n\tint updatePanLimit(int &min, int &max, int &def);\n\tint setPan(int pan);\n\tint getPan();\n\t\n\tint updateTiltLimit(int &min, int &max, int &def);\n\tint setTilt(int tilt);\n\tint getTilt();\n\t\n\tint updateRollLimit(int &min, int &max, int &def);\n\tint setRoll(int roll);\n\tint getRoll();\n\t\n\tint updatePanRelLimit(int &min, int &max, int &def);\n\tint setPanRel(int pan_rel);\n\tint getPanRel();\n\t\n\tint updateTiltRelLimit(int &min, int &max, int &def);\n\tint setTiltRel(int tilt_rel);\n\tint getTiltRel();\n\t\n\tint updateRollRelLimit(int &min, int &max, int &def);\n\tint setRollRel(int roll_rel);\n\tint getRollRel();\n\t\n\tint updatePrivacyLimit(int &min, int &max, int &def);\n\tint setPrivacy(int privacy);\n\tint getPrivacy();\n\t\n\tint updateAutoWhiteBlanceLimit(int &min, int &max, int &def);\n\tint setAutoWhiteBlance(bool autoWhiteBlance);\n\tbool getAutoWhiteBlance();\n\n\tint updateAutoWhiteBlanceCompoLimit(int &min, int &max, int &def);\n\tint setAutoWhiteBlanceCompo(bool autoWhiteBlanceCompo);\n\tbool getAutoWhiteBlanceCompo();\n\t\n\tint updateWhiteBlanceLimit(int &min, int &max, int &def);\n\tint setWhiteBlance(int temp);\n\tint getWhiteBlance();\n\n\tint updateWhiteBlanceCompoLimit(int &min, int &max, int &def);\n\tint setWhiteBlanceCompo(int white_blance_compo);\n\tint getWhiteBlanceCompo();\n\t\n\tint updateBacklightCompLimit(int &min, int &max, int &def);\n\tint setBacklightComp(int backlight);\n\tint getBacklightComp();\n\t\n\tint updateBrightnessLimit(int &min, int &max, int &def);\n\tint setBrightness(int brightness);\n\tint getBrightness();\n\n\tint updateContrastLimit(int &min, int &max, int &def);\n\tint setContrast(uint16_t contrast);\n\tint getContrast();\n\n\tint updateAutoContrastLimit(int &min, int &max, int &def);\n\tint setAutoContrast(bool autoFocus);\n\tbool getAutoContrast();\n\n\tint updateSharpnessLimit(int &min, int &max, int &def);\n\tint setSharpness(int sharpness);\n\tint getSharpness();\n\n\tint updateGainLimit(int &min, int &max, int &def);\n\tint setGain(int gain);\n\tint getGain();\n\n\tint updateGammaLimit(int &min, int &max, int &def);\n\tint setGamma(int gamma);\n\tint getGamma();\n\n\tint updateSaturationLimit(int &min, int &max, int &def);\n\tint setSaturation(int saturation);\n\tint getSaturation();\n\n\tint updateHueLimit(int &min, int &max, int &def);\n\tint setHue(int hue);\n\tint getHue();\n\n\tint updateAutoHueLimit(int &min, int &max, int &def);\n\tint setAutoHue(bool autoFocus);\n\tbool getAutoHue();\n\t\n\tint updatePowerlineFrequencyLimit(int &min, int &max, int &def);\n\tint setPowerlineFrequency(int frequency);\n\tint getPowerlineFrequency();\n\n\tint updateZoomLimit(int &min, int &max, int &def);\n\tint setZoom(int zoom);\n\tint getZoom();\n\t\n\tint updateZoomRelLimit(int &min, int &max, int &def);\n\tint setZoomRel(int zoom);\n\tint getZoomRel();\n\t\n\tint updateDigitalMultiplierLimit(int &min, int &max, int &def);\n\tint setDigitalMultiplier(int multiplier);\n\tint getDigitalMultiplier();\n\t\n\tint updateDigitalMultiplierLimitLimit(int &min, int &max, int &def);\n\tint setDigitalMultiplierLimit(int multiplier_limit);\n\tint getDigitalMultiplierLimit();\n\t\n\tint updateAnalogVideoStandardLimit(int &min, int &max, int &def);\n\tint setAnalogVideoStandard(int standard);\n\tint getAnalogVideoStandard();\n\t\n\tint updateAnalogVideoLockStateLimit(int &min, int &max, int &def);\n\tint setAnalogVideoLockState(int status);\n\tint getAnalogVideoLockState();\n};\n\n#endif /* UVCCAMERA_H_ */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/UVCPreview.cpp",
    "content": "/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n * File name: UVCPreview.cpp\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n*/\n\n#include <stdlib.h>\n#include <linux/time.h>\n#include <unistd.h>\n\n#if 1\t// set 1 if you don't need debug log\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// w/o LOGV/LOGD/MARK\n\t#endif\n\t#undef USE_LOGALL\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n//\t#undef NDEBUG\n#endif\n\n#include \"utilbase.h\"\n#include \"UVCPreview.h\"\n#include \"libuvc_internal.h\"\n\n#define\tLOCAL_DEBUG 0\n#define MAX_FRAME 4\n#define PREVIEW_PIXEL_BYTES 4\t// RGBA/RGBX\n#define FRAME_POOL_SZ MAX_FRAME + 2\n\nUVCPreview::UVCPreview(uvc_device_handle_t *devh)\n:\tmPreviewWindow(NULL),\n\tmCaptureWindow(NULL),\n\tmDeviceHandle(devh),\n\trequestWidth(DEFAULT_PREVIEW_WIDTH),\n\trequestHeight(DEFAULT_PREVIEW_HEIGHT),\n\trequestMinFps(DEFAULT_PREVIEW_FPS_MIN),\n\trequestMaxFps(DEFAULT_PREVIEW_FPS_MAX),\n\trequestMode(DEFAULT_PREVIEW_MODE),\n\trequestBandwidth(DEFAULT_BANDWIDTH),\n\tframeWidth(DEFAULT_PREVIEW_WIDTH),\n\tframeHeight(DEFAULT_PREVIEW_HEIGHT),\n\tframeBytes(DEFAULT_PREVIEW_WIDTH * DEFAULT_PREVIEW_HEIGHT * 2),\t// YUYV\n\tframeMode(0),\n\tpreviewBytes(DEFAULT_PREVIEW_WIDTH * DEFAULT_PREVIEW_HEIGHT * PREVIEW_PIXEL_BYTES),\n\tpreviewFormat(WINDOW_FORMAT_RGBA_8888),\n\tmIsRunning(false),\n\tmIsCapturing(false),\n\tcaptureQueu(NULL),\n\tmFrameCallbackObj(NULL),\n\tmFrameCallbackFunc(NULL),\n\tcallbackPixelBytes(2) {\n\n\tENTER();\n\tpthread_cond_init(&preview_sync, NULL);\n\tpthread_mutex_init(&preview_mutex, NULL);\n//\n\tpthread_cond_init(&capture_sync, NULL);\n\tpthread_mutex_init(&capture_mutex, NULL);\n//\t\n\tpthread_mutex_init(&pool_mutex, NULL);\n\tEXIT();\n}\n\nUVCPreview::~UVCPreview() {\n\n\tENTER();\n\tif (mPreviewWindow)\n\t\tANativeWindow_release(mPreviewWindow);\n\tmPreviewWindow = NULL;\n\tif (mCaptureWindow)\n\t\tANativeWindow_release(mCaptureWindow);\n\tmCaptureWindow = NULL;\n\tclearPreviewFrame();\n\tclearCaptureFrame();\n\tclear_pool();\n\tpthread_mutex_destroy(&preview_mutex);\n\tpthread_cond_destroy(&preview_sync);\n\tpthread_mutex_destroy(&capture_mutex);\n\tpthread_cond_destroy(&capture_sync);\n\tpthread_mutex_destroy(&pool_mutex);\n\tEXIT();\n}\n\n/**\n * get uvc_frame_t from frame pool\n * if pool is empty, create new frame\n * this function does not confirm the frame size\n * and you may need to confirm the size\n */\nuvc_frame_t *UVCPreview::get_frame(size_t data_bytes) {\n\tuvc_frame_t *frame = NULL;\n\tpthread_mutex_lock(&pool_mutex);\n\t{\n\t\tif (!mFramePool.isEmpty()) {\n\t\t\tframe = mFramePool.last();\n\t\t}\n\t}\n\tpthread_mutex_unlock(&pool_mutex);\n\tif UNLIKELY(!frame) {\n\t\tLOGW(\"allocate new frame\");\n\t\tframe = uvc_allocate_frame(data_bytes);\n\t}\n\treturn frame;\n}\n\nvoid UVCPreview::recycle_frame(uvc_frame_t *frame) {\n\tpthread_mutex_lock(&pool_mutex);\n\tif (LIKELY(mFramePool.size() < FRAME_POOL_SZ)) {\n\t\tmFramePool.put(frame);\n\t\tframe = NULL;\n\t}\n\tpthread_mutex_unlock(&pool_mutex);\n\tif (UNLIKELY(frame)) {\n\t\tuvc_free_frame(frame);\n\t}\n}\n\n\nvoid UVCPreview::init_pool(size_t data_bytes) {\n\tENTER();\n\n\tclear_pool();\n\tpthread_mutex_lock(&pool_mutex);\n\t{\n\t\tfor (int i = 0; i < FRAME_POOL_SZ; i++) {\n\t\t\tmFramePool.put(uvc_allocate_frame(data_bytes));\n\t\t}\n\t}\n\tpthread_mutex_unlock(&pool_mutex);\n\n\tEXIT();\n}\n\nvoid UVCPreview::clear_pool() {\n\tENTER();\n\n\tpthread_mutex_lock(&pool_mutex);\n\t{\n\t\tconst int n = mFramePool.size();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tuvc_free_frame(mFramePool[i]);\n\t\t}\n\t\tmFramePool.clear();\n\t}\n\tpthread_mutex_unlock(&pool_mutex);\n\tEXIT();\n}\n\ninline const bool UVCPreview::isRunning() const {return mIsRunning; }\n\nint UVCPreview::setPreviewSize(int width, int height, int min_fps, int max_fps, int mode, float bandwidth) {\n\tENTER();\n\t\n\tint result = 0;\n\tif ((requestWidth != width) || (requestHeight != height) || (requestMode != mode)) {\n\t\trequestWidth = width;\n\t\trequestHeight = height;\n\t\trequestMinFps = min_fps;\n\t\trequestMaxFps = max_fps;\n\t\trequestMode = mode;\n\t\trequestBandwidth = bandwidth;\n\n\t\tuvc_stream_ctrl_t ctrl;\n\t\tresult = uvc_get_stream_ctrl_format_size_fps(mDeviceHandle, &ctrl,\n\t\t\t!requestMode ? UVC_FRAME_FORMAT_YUYV : UVC_FRAME_FORMAT_MJPEG,\n\t\t\trequestWidth, requestHeight, requestMinFps, requestMaxFps);\n\t}\n\t\n\tRETURN(result, int);\n}\n\nint UVCPreview::setPreviewDisplay(ANativeWindow *preview_window) {\n\tENTER();\n\tpthread_mutex_lock(&preview_mutex);\n\t{\n\t\tif (mPreviewWindow != preview_window) {\n\t\t\tif (mPreviewWindow)\n\t\t\t\tANativeWindow_release(mPreviewWindow);\n\t\t\tmPreviewWindow = preview_window;\n\t\t\tif (LIKELY(mPreviewWindow)) {\n\t\t\t\tANativeWindow_setBuffersGeometry(mPreviewWindow,\n\t\t\t\t\tframeWidth, frameHeight, previewFormat);\n\t\t\t}\n\t\t}\n\t}\n\tpthread_mutex_unlock(&preview_mutex);\n\tRETURN(0, int);\n}\n\nint UVCPreview::setFrameCallback(JNIEnv *env, jobject frame_callback_obj, int pixel_format) {\n\t\n\tENTER();\n\tpthread_mutex_lock(&capture_mutex);\n\t{\n\t\tif (isRunning() && isCapturing()) {\n\t\t\tmIsCapturing = false;\n\t\t\tif (mFrameCallbackObj) {\n\t\t\t\tpthread_cond_signal(&capture_sync);\n\t\t\t\tpthread_cond_wait(&capture_sync, &capture_mutex);\t// wait finishing capturing\n\t\t\t}\n\t\t}\n\t\tif (!env->IsSameObject(mFrameCallbackObj, frame_callback_obj))\t{\n\t\t\tiframecallback_fields.onFrame = NULL;\n\t\t\tif (mFrameCallbackObj) {\n\t\t\t\tenv->DeleteGlobalRef(mFrameCallbackObj);\n\t\t\t}\n\t\t\tmFrameCallbackObj = frame_callback_obj;\n\t\t\tif (frame_callback_obj) {\n\t\t\t\t// get method IDs of Java object for callback\n\t\t\t\tjclass clazz = env->GetObjectClass(frame_callback_obj);\n\t\t\t\tif (LIKELY(clazz)) {\n\t\t\t\t\tiframecallback_fields.onFrame = env->GetMethodID(clazz,\n\t\t\t\t\t\t\"onFrame\",\t\"(Ljava/nio/ByteBuffer;)V\");\n\t\t\t\t} else {\n\t\t\t\t\tLOGW(\"failed to get object class\");\n\t\t\t\t}\n\t\t\t\tenv->ExceptionClear();\n\t\t\t\tif (!iframecallback_fields.onFrame) {\n\t\t\t\t\tLOGE(\"Can't find IFrameCallback#onFrame\");\n\t\t\t\t\tenv->DeleteGlobalRef(frame_callback_obj);\n\t\t\t\t\tmFrameCallbackObj = frame_callback_obj = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (frame_callback_obj) {\n\t\t\tmPixelFormat = pixel_format;\n\t\t\tcallbackPixelFormatChanged();\n\t\t}\n\t}\n\tpthread_mutex_unlock(&capture_mutex);\n\tRETURN(0, int);\n}\n\nvoid UVCPreview::callbackPixelFormatChanged() {\n\tmFrameCallbackFunc = NULL;\n\tconst size_t sz = requestWidth * requestHeight;\n\tswitch (mPixelFormat) {\n\t  case PIXEL_FORMAT_RAW:\n\t\tLOGI(\"PIXEL_FORMAT_RAW:\");\n\t\tcallbackPixelBytes = sz * 2;\n\t\tbreak;\n\t  case PIXEL_FORMAT_YUV:\n\t\tLOGI(\"PIXEL_FORMAT_YUV:\");\n\t\tcallbackPixelBytes = sz * 2;\n\t\tbreak;\n\t  case PIXEL_FORMAT_RGB565:\n\t\tLOGI(\"PIXEL_FORMAT_RGB565:\");\n\t\tmFrameCallbackFunc = uvc_any2rgb565;\n\t\tcallbackPixelBytes = sz * 2;\n\t\tbreak;\n\t  case PIXEL_FORMAT_RGBX:\n\t\tLOGI(\"PIXEL_FORMAT_RGBX:\");\n\t\tmFrameCallbackFunc = uvc_any2rgbx;\n\t\tcallbackPixelBytes = sz * 4;\n\t\tbreak;\n\t  case PIXEL_FORMAT_YUV20SP:\n\t\tLOGI(\"PIXEL_FORMAT_YUV20SP:\");\n\t\tmFrameCallbackFunc = uvc_yuyv2iyuv420SP;\n\t\tcallbackPixelBytes = (sz * 3) / 2;\n\t\tbreak;\n\t  case PIXEL_FORMAT_NV21:\n\t\tLOGI(\"PIXEL_FORMAT_NV21:\");\n\t\tmFrameCallbackFunc = uvc_yuyv2yuv420SP;\n\t\tcallbackPixelBytes = (sz * 3) / 2;\n\t\tbreak;\n\t}\n}\n\nvoid UVCPreview::clearDisplay() {\n\tENTER();\n\n\tANativeWindow_Buffer buffer;\n\tpthread_mutex_lock(&capture_mutex);\n\t{\n\t\tif (LIKELY(mCaptureWindow)) {\n\t\t\tif (LIKELY(ANativeWindow_lock(mCaptureWindow, &buffer, NULL) == 0)) {\n\t\t\t\tuint8_t *dest = (uint8_t *)buffer.bits;\n\t\t\t\tconst size_t bytes = buffer.width * PREVIEW_PIXEL_BYTES;\n\t\t\t\tconst int stride = buffer.stride * PREVIEW_PIXEL_BYTES;\n\t\t\t\tfor (int i = 0; i < buffer.height; i++) {\n\t\t\t\t\tmemset(dest, 0, bytes);\n\t\t\t\t\tdest += stride;\n\t\t\t\t}\n\t\t\t\tANativeWindow_unlockAndPost(mCaptureWindow);\n\t\t\t}\n\t\t}\n\t}\n\tpthread_mutex_unlock(&capture_mutex);\n\tpthread_mutex_lock(&preview_mutex);\n\t{\n\t\tif (LIKELY(mPreviewWindow)) {\n\t\t\tif (LIKELY(ANativeWindow_lock(mPreviewWindow, &buffer, NULL) == 0)) {\n\t\t\t\tuint8_t *dest = (uint8_t *)buffer.bits;\n\t\t\t\tconst size_t bytes = buffer.width * PREVIEW_PIXEL_BYTES;\n\t\t\t\tconst int stride = buffer.stride * PREVIEW_PIXEL_BYTES;\n\t\t\t\tfor (int i = 0; i < buffer.height; i++) {\n\t\t\t\t\tmemset(dest, 0, bytes);\n\t\t\t\t\tdest += stride;\n\t\t\t\t}\n\t\t\t\tANativeWindow_unlockAndPost(mPreviewWindow);\n\t\t\t}\n\t\t}\n\t}\n\tpthread_mutex_unlock(&preview_mutex);\n\n\tEXIT();\n}\n\nint UVCPreview::startPreview() {\n\tENTER();\n\n\tint result = EXIT_FAILURE;\n\tif (!isRunning()) {\n\t\tmIsRunning = true;\n\t\tpthread_mutex_lock(&preview_mutex);\n\t\t{\n\t\t\tif (LIKELY(mPreviewWindow)) {\n\t\t\t\tresult = pthread_create(&preview_thread, NULL, preview_thread_func, (void *)this);\n\t\t\t}\n\t\t}\n\t\tpthread_mutex_unlock(&preview_mutex);\n\t\tif (UNLIKELY(result != EXIT_SUCCESS)) {\n\t\t\tLOGW(\"UVCCamera::window does not exist/already running/could not create thread etc.\");\n\t\t\tmIsRunning = false;\n\t\t\tpthread_mutex_lock(&preview_mutex);\n\t\t\t{\n\t\t\t\tpthread_cond_signal(&preview_sync);\n\t\t\t}\n\t\t\tpthread_mutex_unlock(&preview_mutex);\n\t\t}\n\t}\n\tRETURN(result, int);\n}\n\nint UVCPreview::stopPreview() {\n\tENTER();\n\tbool b = isRunning();\n\tif (LIKELY(b)) {\n\t\tmIsRunning = false;\n\t\tpthread_cond_signal(&preview_sync);\n\t\tpthread_cond_signal(&capture_sync);\n\t\tif (pthread_join(capture_thread, NULL) != EXIT_SUCCESS) {\n\t\t\tLOGW(\"UVCPreview::terminate capture thread: pthread_join failed\");\n\t\t}\n\t\tif (pthread_join(preview_thread, NULL) != EXIT_SUCCESS) {\n\t\t\tLOGW(\"UVCPreview::terminate preview thread: pthread_join failed\");\n\t\t}\n\t\tclearDisplay();\n\t}\n\tclearPreviewFrame();\n\tclearCaptureFrame();\n\tpthread_mutex_lock(&preview_mutex);\n\tif (mPreviewWindow) {\n\t\tANativeWindow_release(mPreviewWindow);\n\t\tmPreviewWindow = NULL;\n\t}\n\tpthread_mutex_unlock(&preview_mutex);\n\tpthread_mutex_lock(&capture_mutex);\n\tif (mCaptureWindow) {\n\t\tANativeWindow_release(mCaptureWindow);\n\t\tmCaptureWindow = NULL;\n\t}\n\tpthread_mutex_unlock(&capture_mutex);\n\tRETURN(0, int);\n}\n\n//**********************************************************************\n//\n//**********************************************************************\nvoid UVCPreview::uvc_preview_frame_callback(uvc_frame_t *frame, void *vptr_args) {\n\tUVCPreview *preview = reinterpret_cast<UVCPreview *>(vptr_args);\n\tif UNLIKELY(!preview->isRunning() || !frame || !frame->frame_format || !frame->data || !frame->data_bytes) return;\n\tif (UNLIKELY(\n\t\t((frame->frame_format != UVC_FRAME_FORMAT_MJPEG) && (frame->actual_bytes < preview->frameBytes))\n\t\t|| (frame->width != preview->frameWidth) || (frame->height != preview->frameHeight) )) {\n\n#if LOCAL_DEBUG\n\t\tLOGD(\"broken frame!:format=%d,actual_bytes=%d/%d(%d,%d/%d,%d)\",\n\t\t\tframe->frame_format, frame->actual_bytes, preview->frameBytes,\n\t\t\tframe->width, frame->height, preview->frameWidth, preview->frameHeight);\n#endif\n\t\treturn;\n\t}\n\tif (LIKELY(preview->isRunning())) {\n\t\tuvc_frame_t *copy = preview->get_frame(frame->data_bytes);\n\t\tif (UNLIKELY(!copy)) {\n#if LOCAL_DEBUG\n\t\t\tLOGE(\"uvc_callback:unable to allocate duplicate frame!\");\n#endif\n\t\t\treturn;\n\t\t}\n\t\tuvc_error_t ret = uvc_duplicate_frame(frame, copy);\n\t\tif (UNLIKELY(ret)) {\n\t\t\tpreview->recycle_frame(copy);\n\t\t\treturn;\n\t\t}\n\t\tpreview->addPreviewFrame(copy);\n\t}\n}\n\nvoid UVCPreview::addPreviewFrame(uvc_frame_t *frame) {\n\n\tpthread_mutex_lock(&preview_mutex);\n\tif (isRunning() && (previewFrames.size() < MAX_FRAME)) {\n\t\tpreviewFrames.put(frame);\n\t\tframe = NULL;\n\t\tpthread_cond_signal(&preview_sync);\n\t}\n\tpthread_mutex_unlock(&preview_mutex);\n\tif (frame) {\n\t\trecycle_frame(frame);\n\t}\n}\n\nuvc_frame_t *UVCPreview::waitPreviewFrame() {\n\tuvc_frame_t *frame = NULL;\n\tpthread_mutex_lock(&preview_mutex);\n\t{\n\t\tif (!previewFrames.size()) {\n\t\t\tpthread_cond_wait(&preview_sync, &preview_mutex);\n\t\t}\n\t\tif (LIKELY(isRunning() && previewFrames.size() > 0)) {\n\t\t\tframe = previewFrames.remove(0);\n\t\t}\n\t}\n\tpthread_mutex_unlock(&preview_mutex);\n\treturn frame;\n}\n\nvoid UVCPreview::clearPreviewFrame() {\n\tpthread_mutex_lock(&preview_mutex);\n\t{\n\t\tfor (int i = 0; i < previewFrames.size(); i++)\n\t\t\trecycle_frame(previewFrames[i]);\n\t\tpreviewFrames.clear();\n\t}\n\tpthread_mutex_unlock(&preview_mutex);\n}\n\nvoid *UVCPreview::preview_thread_func(void *vptr_args) {\n\tint result;\n\n\tENTER();\n\tUVCPreview *preview = reinterpret_cast<UVCPreview *>(vptr_args);\n\tif (LIKELY(preview)) {\n\t\tuvc_stream_ctrl_t ctrl;\n\t\tresult = preview->prepare_preview(&ctrl);\n\t\tif (LIKELY(!result)) {\n\t\t\tpreview->do_preview(&ctrl);\n\t\t}\n\t}\n\tPRE_EXIT();\n\tpthread_exit(NULL);\n}\n\nint UVCPreview::prepare_preview(uvc_stream_ctrl_t *ctrl) {\n\tuvc_error_t result;\n\n\tENTER();\n\tresult = uvc_get_stream_ctrl_format_size_fps(mDeviceHandle, ctrl,\n\t\t!requestMode ? UVC_FRAME_FORMAT_YUYV : UVC_FRAME_FORMAT_MJPEG,\n\t\trequestWidth, requestHeight, requestMinFps, requestMaxFps\n\t);\n\tif (LIKELY(!result)) {\n#if LOCAL_DEBUG\n\t\tuvc_print_stream_ctrl(ctrl, stderr);\n#endif\n\t\tuvc_frame_desc_t *frame_desc;\n\t\tresult = uvc_get_frame_desc(mDeviceHandle, ctrl, &frame_desc);\n\t\tif (LIKELY(!result)) {\n\t\t\tframeWidth = frame_desc->wWidth;\n\t\t\tframeHeight = frame_desc->wHeight;\n\t\t\tLOGI(\"frameSize=(%d,%d)@%s\", frameWidth, frameHeight, (!requestMode ? \"YUYV\" : \"MJPEG\"));\n\t\t\tpthread_mutex_lock(&preview_mutex);\n\t\t\tif (LIKELY(mPreviewWindow)) {\n\t\t\t\tANativeWindow_setBuffersGeometry(mPreviewWindow,\n\t\t\t\t\tframeWidth, frameHeight, previewFormat);\n\t\t\t}\n\t\t\tpthread_mutex_unlock(&preview_mutex);\n\t\t} else {\n\t\t\tframeWidth = requestWidth;\n\t\t\tframeHeight = requestHeight;\n\t\t}\n\t\tframeMode = requestMode;\n\t\tframeBytes = frameWidth * frameHeight * (!requestMode ? 2 : 4);\n\t\tpreviewBytes = frameWidth * frameHeight * PREVIEW_PIXEL_BYTES;\n\t} else {\n\t\tLOGE(\"could not negotiate with camera:err=%d\", result);\n\t}\n\tRETURN(result, int);\n}\n\nvoid UVCPreview::do_preview(uvc_stream_ctrl_t *ctrl) {\n\tENTER();\n\n\tuvc_frame_t *frame = NULL;\n\tuvc_frame_t *frame_mjpeg = NULL;\n\tuvc_error_t result = uvc_start_streaming_bandwidth(\n\t\tmDeviceHandle, ctrl, uvc_preview_frame_callback, (void *)this, requestBandwidth, 0);\n\n\tif (LIKELY(!result)) {\n\t\tclearPreviewFrame();\n\t\tpthread_create(&capture_thread, NULL, capture_thread_func, (void *)this);\n\n#if LOCAL_DEBUG\n\t\tLOGI(\"Streaming...\");\n#endif\n\t\tif (frameMode) {\n\t\t\t// MJPEG mode\n\t\t\tfor ( ; LIKELY(isRunning()) ; ) {\n\t\t\t\tframe_mjpeg = waitPreviewFrame();\n\t\t\t\tif (LIKELY(frame_mjpeg)) {\n\t\t\t\t\tframe = get_frame(frame_mjpeg->width * frame_mjpeg->height * 2);\n\t\t\t\t\tresult = uvc_mjpeg2yuyv(frame_mjpeg, frame);   // MJPEG => yuyv\n\t\t\t\t\trecycle_frame(frame_mjpeg);\n\t\t\t\t\tif (LIKELY(!result)) {\n\t\t\t\t\t\tframe = draw_preview_one(frame, &mPreviewWindow, uvc_any2rgbx, 4);\n\t\t\t\t\t\taddCaptureFrame(frame);\n\t\t\t\t\t} else {\n\t\t\t\t\t\trecycle_frame(frame);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// yuvyv mode\n\t\t\tfor ( ; LIKELY(isRunning()) ; ) {\n\t\t\t\tframe = waitPreviewFrame();\n\t\t\t\tif (LIKELY(frame)) {\n\t\t\t\t\tframe = draw_preview_one(frame, &mPreviewWindow, uvc_any2rgbx, 4);\n\t\t\t\t\taddCaptureFrame(frame);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpthread_cond_signal(&capture_sync);\n#if LOCAL_DEBUG\n\t\tLOGI(\"preview_thread_func:wait for all callbacks complete\");\n#endif\n\t\tuvc_stop_streaming(mDeviceHandle);\n#if LOCAL_DEBUG\n\t\tLOGI(\"Streaming finished\");\n#endif\n\t} else {\n\t\tuvc_perror(result, \"failed start_streaming\");\n\t}\n\n\tEXIT();\n}\n\nstatic void copyFrame(const uint8_t *src, uint8_t *dest, const int width, int height, const int stride_src, const int stride_dest) {\n\tconst int h8 = height % 8;\n\tfor (int i = 0; i < h8; i++) {\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t}\n\tfor (int i = 0; i < height; i += 8) {\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t}\n}\n\n\n// transfer specific frame data to the Surface(ANativeWindow)\nint copyToSurface(uvc_frame_t *frame, ANativeWindow **window) {\n\t// ENTER();\n\tint result = 0;\n\tif (LIKELY(*window)) {\n\t\tANativeWindow_Buffer buffer;\n\t\tif (LIKELY(ANativeWindow_lock(*window, &buffer, NULL) == 0)) {\n\t\t\t// source = frame data\n\t\t\tconst uint8_t *src = (uint8_t *)frame->data;\n\t\t\tconst int src_w = frame->width * PREVIEW_PIXEL_BYTES;\n\t\t\tconst int src_step = frame->width * PREVIEW_PIXEL_BYTES;\n\t\t\t// destination = Surface(ANativeWindow)\n\t\t\tuint8_t *dest = (uint8_t *)buffer.bits;\n\t\t\tconst int dest_w = buffer.width * PREVIEW_PIXEL_BYTES;\n\t\t\tconst int dest_step = buffer.stride * PREVIEW_PIXEL_BYTES;\n\t\t\t// use lower transfer bytes\n\t\t\tconst int w = src_w < dest_w ? src_w : dest_w;\n\t\t\t// use lower height\n\t\t\tconst int h = frame->height < buffer.height ? frame->height : buffer.height;\n\t\t\t// transfer from frame data to the Surface\n\t\t\tcopyFrame(src, dest, w, h, src_step, dest_step);\n\t\t\tANativeWindow_unlockAndPost(*window);\n\t\t} else {\n\t\t\tresult = -1;\n\t\t}\n\t} else {\n\t\tresult = -1;\n\t}\n\treturn result; //RETURN(result, int);\n}\n\n// changed to return original frame instead of returning converted frame even if convert_func is not null.\nuvc_frame_t *UVCPreview::draw_preview_one(uvc_frame_t *frame, ANativeWindow **window, convFunc_t convert_func, int pixcelBytes) {\n\t// ENTER();\n\n\tint b = 0;\n\tpthread_mutex_lock(&preview_mutex);\n\t{\n\t\tb = *window != NULL;\n\t}\n\tpthread_mutex_unlock(&preview_mutex);\n\tif (LIKELY(b)) {\n\t\tuvc_frame_t *converted;\n\t\tif (convert_func) {\n\t\t\tconverted = get_frame(frame->width * frame->height * pixcelBytes);\n\t\t\tif LIKELY(converted) {\n\t\t\t\tb = convert_func(frame, converted);\n\t\t\t\tif (!b) {\n\t\t\t\t\tpthread_mutex_lock(&preview_mutex);\n\t\t\t\t\tcopyToSurface(converted, window);\n\t\t\t\t\tpthread_mutex_unlock(&preview_mutex);\n\t\t\t\t} else {\n\t\t\t\t\tLOGE(\"failed converting\");\n\t\t\t\t}\n\t\t\t\trecycle_frame(converted);\n\t\t\t}\n\t\t} else {\n\t\t\tpthread_mutex_lock(&preview_mutex);\n\t\t\tcopyToSurface(frame, window);\n\t\t\tpthread_mutex_unlock(&preview_mutex);\n\t\t}\n\t}\n\treturn frame; //RETURN(frame, uvc_frame_t *);\n}\n\n//======================================================================\n//\n//======================================================================\ninline const bool UVCPreview::isCapturing() const { return mIsCapturing; }\n\nint UVCPreview::setCaptureDisplay(ANativeWindow *capture_window) {\n\tENTER();\n\tpthread_mutex_lock(&capture_mutex);\n\t{\n\t\tif (isRunning() && isCapturing()) {\n\t\t\tmIsCapturing = false;\n\t\t\tif (mCaptureWindow) {\n\t\t\t\tpthread_cond_signal(&capture_sync);\n\t\t\t\tpthread_cond_wait(&capture_sync, &capture_mutex);\t// wait finishing capturing\n\t\t\t}\n\t\t}\n\t\tif (mCaptureWindow != capture_window) {\n\t\t\t// release current Surface if already assigned.\n\t\t\tif (UNLIKELY(mCaptureWindow))\n\t\t\t\tANativeWindow_release(mCaptureWindow);\n\t\t\tmCaptureWindow = capture_window;\n\t\t\t// if you use Surface came from MediaCodec#createInputSurface\n\t\t\t// you could not change window format at least when you use\n\t\t\t// ANativeWindow_lock / ANativeWindow_unlockAndPost\n\t\t\t// to write frame data to the Surface...\n\t\t\t// So we need check here.\n\t\t\tif (mCaptureWindow) {\n\t\t\t\tint32_t window_format = ANativeWindow_getFormat(mCaptureWindow);\n\t\t\t\tif ((window_format != WINDOW_FORMAT_RGB_565)\n\t\t\t\t\t&& (previewFormat == WINDOW_FORMAT_RGB_565)) {\n\t\t\t\t\tLOGE(\"window format mismatch, cancelled movie capturing.\");\n\t\t\t\t\tANativeWindow_release(mCaptureWindow);\n\t\t\t\t\tmCaptureWindow = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tpthread_mutex_unlock(&capture_mutex);\n\tRETURN(0, int);\n}\n\nvoid UVCPreview::addCaptureFrame(uvc_frame_t *frame) {\n\tpthread_mutex_lock(&capture_mutex);\n\tif (LIKELY(isRunning())) {\n\t\t// keep only latest one\n\t\tif (captureQueu) {\n\t\t\trecycle_frame(captureQueu);\n\t\t}\n\t\tcaptureQueu = frame;\n\t\tpthread_cond_broadcast(&capture_sync);\n\t}\n\tpthread_mutex_unlock(&capture_mutex);\n}\n\n/**\n * get frame data for capturing, if not exist, block and wait\n */\nuvc_frame_t *UVCPreview::waitCaptureFrame() {\n\tuvc_frame_t *frame = NULL;\n\tpthread_mutex_lock(&capture_mutex);\n\t{\n\t\tif (!captureQueu) {\n\t\t\tpthread_cond_wait(&capture_sync, &capture_mutex);\n\t\t}\n\t\tif (LIKELY(isRunning() && captureQueu)) {\n\t\t\tframe = captureQueu;\n\t\t\tcaptureQueu = NULL;\n\t\t}\n\t}\n\tpthread_mutex_unlock(&capture_mutex);\n\treturn frame;\n}\n\n/**\n * clear drame data for capturing\n */\nvoid UVCPreview::clearCaptureFrame() {\n\tpthread_mutex_lock(&capture_mutex);\n\t{\n\t\tif (captureQueu)\n\t\t\trecycle_frame(captureQueu);\n\t\tcaptureQueu = NULL;\n\t}\n\tpthread_mutex_unlock(&capture_mutex);\n}\n\n//======================================================================\n/*\n * thread function\n * @param vptr_args pointer to UVCPreview instance\n */\n// static\nvoid *UVCPreview::capture_thread_func(void *vptr_args) {\n\tint result;\n\n\tENTER();\n\tUVCPreview *preview = reinterpret_cast<UVCPreview *>(vptr_args);\n\tif (LIKELY(preview)) {\n\t\tJavaVM *vm = getVM();\n\t\tJNIEnv *env;\n\t\t// attach to JavaVM\n\t\tvm->AttachCurrentThread(&env, NULL);\n\t\tpreview->do_capture(env);\t// never return until finish previewing\n\t\t// detach from JavaVM\n\t\tvm->DetachCurrentThread();\n\t\tMARK(\"DetachCurrentThread\");\n\t}\n\tPRE_EXIT();\n\tpthread_exit(NULL);\n}\n\n/**\n * the actual function for capturing\n */\nvoid UVCPreview::do_capture(JNIEnv *env) {\n\n\tENTER();\n\n\tclearCaptureFrame();\n\tcallbackPixelFormatChanged();\n\tfor (; isRunning() ;) {\n\t\tmIsCapturing = true;\n\t\tif (mCaptureWindow) {\n\t\t\tdo_capture_surface(env);\n\t\t} else {\n\t\t\tdo_capture_idle_loop(env);\n\t\t}\n\t\tpthread_cond_broadcast(&capture_sync);\n\t}\t// end of for (; isRunning() ;)\n\tEXIT();\n}\n\nvoid UVCPreview::do_capture_idle_loop(JNIEnv *env) {\n\tENTER();\n\t\n\tfor (; isRunning() && isCapturing() ;) {\n\t\tdo_capture_callback(env, waitCaptureFrame());\n\t}\n\t\n\tEXIT();\n}\n\n/**\n * write frame data to Surface for capturing\n */\nvoid UVCPreview::do_capture_surface(JNIEnv *env) {\n\tENTER();\n\n\tuvc_frame_t *frame = NULL;\n\tuvc_frame_t *converted = NULL;\n\tchar *local_picture_path;\n\n\tfor (; isRunning() && isCapturing() ;) {\n\t\tframe = waitCaptureFrame();\n\t\tif (LIKELY(frame)) {\n\t\t\t// frame data is always YUYV format.\n\t\t\tif LIKELY(isCapturing()) {\n\t\t\t\tif (UNLIKELY(!converted)) {\n\t\t\t\t\tconverted = get_frame(previewBytes);\n\t\t\t\t}\n\t\t\t\tif (LIKELY(converted)) {\n\t\t\t\t\tint b = uvc_any2rgbx(frame, converted);\n\t\t\t\t\tif (!b) {\n\t\t\t\t\t\tif (LIKELY(mCaptureWindow)) {\n\t\t\t\t\t\t\tcopyToSurface(converted, &mCaptureWindow);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tdo_capture_callback(env, frame);\n\t\t}\n\t}\n\tif (converted) {\n\t\trecycle_frame(converted);\n\t}\n\tif (mCaptureWindow) {\n\t\tANativeWindow_release(mCaptureWindow);\n\t\tmCaptureWindow = NULL;\n\t}\n\n\tEXIT();\n}\n\n/**\n* call IFrameCallback#onFrame if needs\n */\nvoid UVCPreview::do_capture_callback(JNIEnv *env, uvc_frame_t *frame) {\n\tENTER();\n\n\tif (LIKELY(frame)) {\n\t\tuvc_frame_t *callback_frame = frame;\n\t\tif (mFrameCallbackObj) {\n\t\t\tif (mFrameCallbackFunc) {\n\t\t\t\tcallback_frame = get_frame(callbackPixelBytes);\n\t\t\t\tif (LIKELY(callback_frame)) {\n\t\t\t\t\tint b = mFrameCallbackFunc(frame, callback_frame);\n\t\t\t\t\trecycle_frame(frame);\n\t\t\t\t\tif (UNLIKELY(b)) {\n\t\t\t\t\t\tLOGW(\"failed to convert for callback frame\");\n\t\t\t\t\t\tgoto SKIP;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tLOGW(\"failed to allocate for callback frame\");\n\t\t\t\t\tcallback_frame = frame;\n\t\t\t\t\tgoto SKIP;\n\t\t\t\t}\n\t\t\t}\n\t\t\tjobject buf = env->NewDirectByteBuffer(callback_frame->data, callbackPixelBytes);\n\t\t\tenv->CallVoidMethod(mFrameCallbackObj, iframecallback_fields.onFrame, buf);\n\t\t\tenv->ExceptionClear();\n\t\t\tenv->DeleteLocalRef(buf);\n\t\t}\n SKIP:\n\t\trecycle_frame(callback_frame);\n\t}\n\tEXIT();\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/UVCPreview.h",
    "content": "/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n * File name: UVCPreview.h\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n*/\n\n#ifndef UVCPREVIEW_H_\n#define UVCPREVIEW_H_\n\n#include \"libUVCCamera.h\"\n#include <pthread.h>\n#include <android/native_window.h>\n#include \"objectarray.h\"\n\n#pragma interface\n\n#define DEFAULT_PREVIEW_WIDTH 640\n#define DEFAULT_PREVIEW_HEIGHT 480\n#define DEFAULT_PREVIEW_FPS_MIN 1\n#define DEFAULT_PREVIEW_FPS_MAX 30\n#define DEFAULT_PREVIEW_MODE 0\n#define DEFAULT_BANDWIDTH 1.0f\n\ntypedef uvc_error_t (*convFunc_t)(uvc_frame_t *in, uvc_frame_t *out);\n\n#define PIXEL_FORMAT_RAW 0\t\t// same as PIXEL_FORMAT_YUV\n#define PIXEL_FORMAT_YUV 1\n#define PIXEL_FORMAT_RGB565 2\n#define PIXEL_FORMAT_RGBX 3\n#define PIXEL_FORMAT_YUV20SP 4\n#define PIXEL_FORMAT_NV21 5\t\t// YVU420SemiPlanar\n\n// for callback to Java object\ntypedef struct {\n\tjmethodID onFrame;\n} Fields_iframecallback;\n\nclass UVCPreview {\nprivate:\n\tuvc_device_handle_t *mDeviceHandle;\n\tANativeWindow *mPreviewWindow;\n\tvolatile bool mIsRunning;\n\tint requestWidth, requestHeight, requestMode;\n\tint requestMinFps, requestMaxFps;\n\tfloat requestBandwidth;\n\tint frameWidth, frameHeight;\n\tint frameMode;\n\tsize_t frameBytes;\n\tpthread_t preview_thread;\n\tpthread_mutex_t preview_mutex;\n\tpthread_cond_t preview_sync;\n\tObjectArray<uvc_frame_t *> previewFrames;\n\tint previewFormat;\n\tsize_t previewBytes;\n//\n\tvolatile bool mIsCapturing;\n\tANativeWindow *mCaptureWindow;\n\tpthread_t capture_thread;\n\tpthread_mutex_t capture_mutex;\n\tpthread_cond_t capture_sync;\n\tuvc_frame_t *captureQueu;\t\t\t// keep latest frame\n\tjobject mFrameCallbackObj;\n\tconvFunc_t mFrameCallbackFunc;\n\tFields_iframecallback iframecallback_fields;\n\tint mPixelFormat;\n\tsize_t callbackPixelBytes;\n// improve performance by reducing memory allocation\n\tpthread_mutex_t pool_mutex;\n\tObjectArray<uvc_frame_t *> mFramePool;\n\tuvc_frame_t *get_frame(size_t data_bytes);\n\tvoid recycle_frame(uvc_frame_t *frame);\n\tvoid init_pool(size_t data_bytes);\n\tvoid clear_pool();\n//\n\tvoid clearDisplay();\n\tstatic void uvc_preview_frame_callback(uvc_frame_t *frame, void *vptr_args);\n\tvoid addPreviewFrame(uvc_frame_t *frame);\n\tuvc_frame_t *waitPreviewFrame();\n\tvoid clearPreviewFrame();\n\tstatic void *preview_thread_func(void *vptr_args);\n\tint prepare_preview(uvc_stream_ctrl_t *ctrl);\n\tvoid do_preview(uvc_stream_ctrl_t *ctrl);\n\tuvc_frame_t *draw_preview_one(uvc_frame_t *frame, ANativeWindow **window, convFunc_t func, int pixelBytes);\n//\n\tvoid addCaptureFrame(uvc_frame_t *frame);\n\tuvc_frame_t *waitCaptureFrame();\n\tvoid clearCaptureFrame();\n\tstatic void *capture_thread_func(void *vptr_args);\n\tvoid do_capture(JNIEnv *env);\n\tvoid do_capture_surface(JNIEnv *env);\n\tvoid do_capture_idle_loop(JNIEnv *env);\n\tvoid do_capture_callback(JNIEnv *env, uvc_frame_t *frame);\n\tvoid callbackPixelFormatChanged();\npublic:\n\tUVCPreview(uvc_device_handle_t *devh);\n\t~UVCPreview();\n\n\tinline const bool isRunning() const;\n\tint setPreviewSize(int width, int height, int min_fps, int max_fps, int mode, float bandwidth = 1.0f);\n\tint setPreviewDisplay(ANativeWindow *preview_window);\n\tint setFrameCallback(JNIEnv *env, jobject frame_callback_obj, int pixel_format);\n\tint startPreview();\n\tint stopPreview();\n\tinline const bool isCapturing() const;\n\tint setCaptureDisplay(ANativeWindow *capture_window);\n};\n\n#endif /* UVCPREVIEW_H_ */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/UVCStatusCallback.cpp",
    "content": "#include <stdlib.h>\n#include <linux/time.h>\n#include <unistd.h>\n#include \"utilbase.h\"\n#include \"UVCStatusCallback.h\"\n#include \"libuvc_internal.h\"\n\n#define\tLOCAL_DEBUG 0\n\nUVCStatusCallback::UVCStatusCallback(uvc_device_handle_t *devh)\n:\tmDeviceHandle(devh),\n\tmStatusCallbackObj(NULL) {\n\n\tENTER();\n\tpthread_mutex_init(&status_mutex, NULL);\n\n\tuvc_set_status_callback(mDeviceHandle, uvc_status_callback, (void *)this);\n\tEXIT();\n}\n\nUVCStatusCallback::~UVCStatusCallback() {\n\n\tENTER();\n\tpthread_mutex_destroy(&status_mutex);\n\tEXIT();\n}\n\nint UVCStatusCallback::setCallback(JNIEnv *env, jobject status_callback_obj) {\n\t\n\tENTER();\n\tpthread_mutex_lock(&status_mutex);\n\t{\n\t\tif (!env->IsSameObject(mStatusCallbackObj, status_callback_obj)) {\n\t\t\tistatuscallback_fields.onStatus = NULL;\n\t\t\tif (mStatusCallbackObj) {\n\t\t\t\tenv->DeleteGlobalRef(mStatusCallbackObj);\n\t\t\t}\n\t\t\tmStatusCallbackObj = status_callback_obj;\n\t\t\tif (status_callback_obj) {\n\t\t\t\t// get method IDs of Java object for callback\n\t\t\t\tjclass clazz = env->GetObjectClass(status_callback_obj);\n\t\t\t\tif (LIKELY(clazz)) {\n\t\t\t\t\tistatuscallback_fields.onStatus = env->GetMethodID(clazz,\n\t\t\t\t\t\t\"onStatus\",\t\"(IIIILjava/nio/ByteBuffer;)V\");\n\t\t\t\t} else {\n\t\t\t\t\tLOGW(\"failed to get object class\");\n\t\t\t\t}\n\t\t\t\tenv->ExceptionClear();\n\t\t\t\tif (!istatuscallback_fields.onStatus) {\n\t\t\t\t\tLOGE(\"Can't find IStatusCallback#onStatus\");\n\t\t\t\t\tenv->DeleteGlobalRef(status_callback_obj);\n\t\t\t\t\tmStatusCallbackObj = status_callback_obj = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tpthread_mutex_unlock(&status_mutex);\n\tRETURN(0, int);\n}\n\nvoid UVCStatusCallback::notifyStatusCallback(JNIEnv* env, uvc_status_class status_class, int event, int selector, uvc_status_attribute status_attribute, void *data, size_t data_len) {\n\n\tpthread_mutex_lock(&status_mutex);\n\t{\n\t\tif (mStatusCallbackObj) {\n\t\t\tjobject buf = env->NewDirectByteBuffer(data, data_len);\n\t\t\tenv->CallVoidMethod(mStatusCallbackObj, istatuscallback_fields.onStatus, (int)status_class, event, selector, (int)status_attribute, buf);\n\t\t\tenv->ExceptionClear();\n\t\t\tenv->DeleteLocalRef(buf);\n\t\t}\n\t}\n\tpthread_mutex_unlock(&status_mutex);\n}\n\nvoid UVCStatusCallback::uvc_status_callback(uvc_status_class status_class, int event, int selector, uvc_status_attribute status_attribute, void *data, size_t data_len, void *user_ptr) {\n\n\tUVCStatusCallback *statusCallback = reinterpret_cast<UVCStatusCallback *>(user_ptr);\n\n\tJavaVM *vm = getVM();\n\tJNIEnv *env;\n\t// attach to JavaVM\n\tvm->AttachCurrentThread(&env, NULL);\n\n\tstatusCallback->notifyStatusCallback(env, status_class, event, selector, status_attribute, data, data_len);\n\t\n\tvm->DetachCurrentThread();\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/UVCStatusCallback.h",
    "content": "#ifndef UVCSTATUSCALLBACK_H_\n#define UVCSTATUSCALLBACK_H_\n\n#include \"libUVCCamera.h\"\n#include <pthread.h>\n#include <android/native_window.h>\n#include \"objectarray.h\"\n\n#pragma interface\n\n// for callback to Java object\ntypedef struct {\n\tjmethodID onStatus;\n} Fields_istatuscallback;\n\nclass UVCStatusCallback {\nprivate:\n\tuvc_device_handle_t *mDeviceHandle;\n \tpthread_mutex_t status_mutex;\n \tjobject mStatusCallbackObj;\n \tFields_istatuscallback istatuscallback_fields;\n \tvoid notifyStatusCallback(JNIEnv *env, uvc_status_class status_class, int event, int selector, uvc_status_attribute status_attribute, void *data, size_t data_len);\n \tstatic void uvc_status_callback(uvc_status_class status_class, int event, int selector, uvc_status_attribute status_attribute, void *data, size_t data_len, void *user_ptr);\npublic:\n\tUVCStatusCallback(uvc_device_handle_t *devh);\n\t~UVCStatusCallback();\n\n\tint setCallback(JNIEnv *env, jobject status_callback_obj);\n};\n\n#endif /* UVCSTATUSCALLBACK_H_ */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/_onload.cpp",
    "content": "/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n * File name: _onload.cpp\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n*/\n\n#include \"_onload.h\"\n#include \"utilbase.h\"\n\n#define LOCAL_DEBUG 0\n\nextern int register_uvccamera(JNIEnv *env);\n\njint JNI_OnLoad(JavaVM *vm, void *reserved) {\n#if LOCAL_DEBUG\n    LOGD(\"JNI_OnLoad\");\n#endif\n\n    JNIEnv *env;\n    if (vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK) {\n        return JNI_ERR;\n    }\n    // register native methods\n    int result = register_uvccamera(env);\n\tsetVM(vm);\n#if LOCAL_DEBUG\n    LOGD(\"JNI_OnLoad:finshed:result=%d\", result);\n#endif\n    return JNI_VERSION_1_6;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/_onload.h",
    "content": "/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n * File name: _onload.h\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n*/\n\n#ifndef ONLOAD_H_\n#define ONLOAD_H_\n\n#pragma interface\n\n#include <jni.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\njint JNI_OnLoad(JavaVM *vm, void *reserved);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* ONLOAD_H_ */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/libUVCCamera.h",
    "content": "/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n * File name: libUVCCamera.h\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n*/\n\n#ifndef LIBUVCCAMERA_H_\n#define LIBUVCCAMERA_H_\n\n#include <jni.h>\n#include \"libusb.h\"\n#include \"libuvc.h\"\n#include \"utilbase.h\"\n\n#endif /* LIBUVCCAMERA_H_ */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/objectarray.h",
    "content": "/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n * File name: objectarray.h\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n*/\n\n#ifndef OBJECTARRAY_H_\n#define OBJECTARRAY_H_\n\n#include \"utilbase.h\"\n\ntemplate <class T>\nclass ObjectArray {\nprivate:\n\tT *m_elements;\n\tconst int min_size;\n\tint m_max_size;\n\tint m_size;\npublic:\n\tObjectArray(int initial_capacity = 2)\n\t\t: m_elements(new T[initial_capacity]),\n\t\t  m_max_size(initial_capacity),\n\t\t  m_size(0),\n\t\t  min_size(initial_capacity) {\n\t}\n\n\t~ObjectArray() { SAFE_DELETE_ARRAY(m_elements); }\n\tvoid size(int new_size) {\n\t\tif (new_size != capacity()) {\n\t\t\tT *new_elements = new T[new_size];\n\t\t\tLOG_ASSERT(new_elements, \"out of memory:size=%d,capacity=%d\", new_size, m_max_size);\n\t\t\tconst int n = (new_size < capacity()) ? new_size : capacity();\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tnew_elements[i] = m_elements[i];\n\t\t\t}\n\t\t\tSAFE_DELETE_ARRAY(m_elements);\n\t\t\tm_elements = new_elements;\n\t\t\tm_max_size = new_size;\n\t\t\tm_size = (m_size < new_size) ? m_size : new_size;\n\t\t}\n\t}\n\n\tinline int size() const { return m_size; }\n\tinline bool isEmpty() const { return (m_size < 1); }\n\tinline int capacity() const { return m_max_size; }\n\tinline T &operator[](int index) { return m_elements[index]; }\n\tinline const T &operator[](int index) const { return m_elements[index]; }\n\tint put(T object) {\n\t\tif LIKELY(object) {\n\t\t\tif UNLIKELY(size() >= capacity()) {\n\t\t\t\tsize(capacity() ? capacity() * 2 : 2);\n\t\t\t}\n\t\t\tm_elements[m_size++] = object;\n\t\t}\n\t\treturn m_size;\n\t}\n\t/**\n\t * remove T which posisioned on index\n\t */\n\tT remove(int index) {\n\t\tT obj = m_elements[index];\n\t\tfor (int i = index; i < m_size - 1; i++) {\n\t\t\tm_elements[i] = m_elements[i+1];\n\t\t}\n\t\tm_size--;\n\t\treturn obj;\n\t}\n\t/**\n\t * search the T object and remove if exist\n\t */\n\tvoid removeObject(T object) {\n\t\tfor (int i = 0; i < size(); i++) {\n\t\t\tif (m_elements[i] == object) {\n\t\t\t\tremove(i);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * get last T and remove from this array ¥\n\t * this is faster than remove(size()-1)\n\t */\n\tinline T last() {\n\t\tif LIKELY(m_size > 0)\n\t\t\treturn m_elements[--m_size];\n\t\telse\n\t\t\treturn NULL;\n\t}\n\t/**\n\t * search the T object and return it's index\n\t * if the T is not in this array, return -1\n\t */\n\tint getIndex(const T object) {\n\t\tint result = -1;\n\t\tfor (int i = 0; i < size(); i++) {\n\t\t\tif (m_elements[i] == object) {\n\t\t\t\tresult = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * clear the T array but never delete actual T instance\n\t */\n\tinline void clear() {\n\t\tsize(min_size);\n\t\tm_size = 0;\n\t}\n};\n\n#endif\t// OBJECTARRAY_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/AbstractBufferedPipeline.cpp",
    "content": "//\n// Created by saki on 15/11/05.\n//\n\n#if 1\t// set 1 if you don't need debug message\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// ignore LOGV/LOGD/MARK\n\t#endif\n\t#undef USE_LOGALL\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n\t#undef NDEBUG\t\t// depends on definition in Android.mk and Application.mk\n#endif\n\n#include \"utilbase.h\"\n#include \"AbstractBufferedPipeline.h\"\n\n/*public*/\nAbstractBufferedPipeline::AbstractBufferedPipeline(const int &_max_buffer_num, const int &_init_pool_num,\n\tconst size_t &_default_frame_size, const bool &drop_frames_when_buffer_empty)\n:\tIPipeline(_default_frame_size),\n\tmax_buffer_num(_max_buffer_num),\n\tinit_pool_num(_init_pool_num),\n\tdrop_frames(drop_frames_when_buffer_empty),\n\ttotal_frame_num(0)\n{\n\tENTER();\n\n\tEXIT();\n}\n\n/*public*/\nAbstractBufferedPipeline::~AbstractBufferedPipeline() {\n\tENTER();\n\n\trelease();\n\tsetState(PIPELINE_STATE_UNINITIALIZED);\n\n\tEXIT();\n}\n\n/*public*/\nint AbstractBufferedPipeline::release() {\n\tENTER();\n\n\tsetState(PIPELINE_STATE_RELEASING);\n\tstop();\n\tclear_frames();\n\tclear_pool();\n\tsetState(PIPELINE_STATE_UNINITIALIZED);\n\n\tRETURN(0, int);\n}\n\n/*public*/\nint AbstractBufferedPipeline::start() {\n\tENTER();\n\n\tint result = EXIT_FAILURE;\n\tif (!isRunning()) {\n\t\tmIsRunning = true;\n\t\tsetState(PIPELINE_STATE_STARTING);\n\t\tbuffer_mutex.lock();\n\t\t{\n\t\t\tresult = pthread_create(&handler_thread, NULL, handler_thread_func, (void *) this);\n\t\t}\n\t\tbuffer_mutex.unlock();\n\t\tif (UNLIKELY(result != EXIT_SUCCESS)) {\n\t\t\tLOGW(\"AbstractBufferedPipeline::already running/could not create thread etc.\");\n\t\t\tsetState(PIPELINE_STATE_INITIALIZED);\n\t\t\tmIsRunning = false;\n\t\t\tbuffer_mutex.lock();\n\t\t\t{\n\t\t\t\tpool_sync.broadcast();\n\t\t\t\tbuffer_sync.broadcast();\n\t\t\t}\n\t\t\tbuffer_mutex.unlock();\n\t\t}\n\t}\n\tRETURN(result, int);\n}\n\n/*public*/\nint AbstractBufferedPipeline::stop() {\n\tENTER();\n\n\tbool b = isRunning();\n\tif (LIKELY(b)) {\n\t\tsetState(PIPELINE_STATE_STOPPING);\n\t\tmIsRunning = false;\n\t\tpool_sync.broadcast();\n\t\tbuffer_sync.broadcast();\n\t\tLOGD(\"pthread_join:handler_thread\");\n\t\tif (pthread_join(handler_thread, NULL) != EXIT_SUCCESS) {\n\t\t\tLOGW(\"PublisherPipeline::terminate publisher thread: pthread_join failed\");\n\t\t}\n\t\tsetState(PIPELINE_STATE_INITIALIZED);\n\t\tLOGD(\"handler_thread finished\");\n\t}\n\tclear_frames();\n\n\tRETURN(0, int);\n}\n\n/*public*/\nint AbstractBufferedPipeline::queueFrame(uvc_frame_t *frame) {\n\tENTER();\n\n\tint ret = UVC_ERROR_OTHER;\n\tif (LIKELY(frame)) {\n\t\t// get empty frame from frame pool\n\t\tuvc_frame_t *copy = get_frame(frame->data_bytes);\n\t\tif (UNLIKELY(!copy)) {\n\t\t\tLOGD(\"buffer pool is empty and exceeds the limit, drop frame\");\n\t\t\tRETURN(UVC_ERROR_NO_MEM, int);\n\t\t}\n\t\t// duplicate frame buffer and pass copy to publisher\n\t\tret = uvc_duplicate_frame(frame, copy);\n\t\tif (LIKELY(!ret)) {\n\t\t\tret = add_frame(copy);\n\t\t} else {\n\t\t\tLOGW(\"uvc_duplicate_frame failed:%d\", ret);\n\t\t\trecycle_frame(copy);\n\t\t}\n\t}\n\n\tRETURN(ret, int);\n}\n\n//********************************************************************************\n//\n//********************************************************************************\n/**\n * get uvc_frame_t from frame pool\n * if pool is empty, create new frame\n * this function does not confirm the frame size\n * and you may need to confirm the size\n */\nuvc_frame_t *AbstractBufferedPipeline::get_frame(const size_t &data_bytes) {\n\tuvc_frame_t *frame = NULL;\n\tMutex::Autolock lock(pool_mutex);\n\n\tif (UNLIKELY(frame_pool.empty() && (total_frame_num < max_buffer_num))) {\n\t\tuint32_t n = total_frame_num * 2;\n\t\tif (n > max_buffer_num) {\n\t\t\tn = max_buffer_num;\n\t\t}\n\t\tn -= total_frame_num;\n\t\tif (LIKELY(n > 0)) {\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tframe = uvc_allocate_frame(data_bytes);\n\t\t\t\ttotal_frame_num++;\n\t\t\t}\n\t\t\tLOGW(\"allocate new frame:%d\", total_frame_num);\n\t\t} else {\n\t\t\tLOGW(\"number of allocated frame exceeds limit\");\n\t\t}\n\t}\n\tif (UNLIKELY(frame_pool.empty() && !drop_frames)) {\n\t\t// if pool is empty and need to block(avoid dropping frames), wait frame recycling.\n\t\tfor (; mIsRunning && frame_pool.empty() ; ) {\n\t\t\tpool_sync.wait(pool_mutex);\n\t\t}\n\t}\n\tif (!frame_pool.empty()) {\n\t\tframe = frame_pool.front();\n\t\tframe_pool.pop_front();\n\t}\n\n\treturn frame;\n}\n\nvoid AbstractBufferedPipeline::recycle_frame(uvc_frame_t *frame) {\n\tENTER();\n\n\tif (LIKELY(frame)) {\n\t\tMutex::Autolock lock(pool_mutex);\n\t\tif (LIKELY(frame_pool.size() < max_buffer_num)) {\n\t\t\tframe_pool.push_back(frame);\n\t\t\tframe = NULL;\n\t\t}\n\t\tif (UNLIKELY(frame)) {\n\t\t\t// if pool overflowed\n\t\t\ttotal_frame_num--;\n\t\t\tuvc_free_frame(frame);\n\t\t}\n\t\tpool_sync.signal();\n\t}\n\n\tEXIT();\n}\n\nvoid AbstractBufferedPipeline::init_pool(const size_t &data_bytes) {\n\tENTER();\n\n\tuvc_frame_t *frame = NULL;\n\n\tclear_pool();\n\tpool_mutex.lock();\n\t{\n\n\t\tsize_t frame_sz = data_bytes / 4;\t// expects 25%, this will be able to much lower\n\t\tif (!frame_sz) {\n\t\t\tframe_sz = DEFAULT_FRAME_SZ;\n\t\t}\n\t\tfor (uint32_t i = 0; i < init_pool_num; i++) {\n\t\t\tframe = uvc_allocate_frame(frame_sz);\n\t\t\tif (LIKELY(frame)) {\n\t\t\t\tframe_pool.push_back(frame);\n\t\t\t\ttotal_frame_num++;\n\t\t\t} else {\n\t\t\t\tLOGW(\"failed to allocate new frame:%d\", total_frame_num);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tpool_mutex.unlock();\n\n\tEXIT();\n}\n\nvoid AbstractBufferedPipeline::clear_pool() {\n\tENTER();\n\n\tMutex::Autolock lock(pool_mutex);\n\n\tfor (auto iter = frame_pool.begin(); iter != frame_pool.end(); iter++) {\n\t\ttotal_frame_num--;\n\t\tuvc_free_frame(*iter);\n\t}\n\tframe_pool.clear();\n\tEXIT();\n}\n\n//********************************************************************************\n//\n//********************************************************************************\n\nvoid AbstractBufferedPipeline::clear_frames() {\n\tMutex::Autolock lock(buffer_mutex);\n\n\tfor (auto iter = frame_buffers.begin(); iter != frame_buffers.end(); iter++) {\n\t\trecycle_frame(*iter);\n\t}\n\tframe_buffers.clear();\n}\n\nint AbstractBufferedPipeline::add_frame(uvc_frame_t *frame) {\n\tENTER();\n\n\tbuffer_mutex.lock();\n\t{\n\t\t// FIXME as current implementation, transferring frame data on my device is slower than that coming from UVC camera... just drop them now\n\t\tif (frame_buffers.size() > max_buffer_num) {\n\t\t\t// erase old frames\n\t\t\tint cnt = 0;\n\t\t\tfor (auto iter = frame_buffers.begin();\n\t\t\t\t (iter != frame_buffers.end()) && (cnt < 5); iter++, cnt++) {\n\t\t\t\trecycle_frame(*iter);\n\t\t\t\titer = frame_buffers.erase(iter);\n\t\t\t}\n\t\t\tLOGW(\"droped frame data\");\n\t\t}\n\t\tif (isRunning() && (frame_buffers.size() < max_buffer_num)) {\n\t\t\tframe_buffers.push_back(frame);\n\t\t\tframe = NULL;\n\t\t}\n\t\tbuffer_sync.signal();\n\t}\n\tbuffer_mutex.unlock();\n\tif (frame) {\n\t\trecycle_frame(frame);\n\t}\n\n\tRETURN(0, int);\n}\n\nuvc_frame_t *AbstractBufferedPipeline::wait_frame() {\n\tuvc_frame_t *frame = NULL;\n\n\tMutex::Autolock lock(buffer_mutex);\n\n\tif (!frame_buffers.size()) {\n\t\tbuffer_sync.wait(buffer_mutex);\n\t}\n\tif (LIKELY(isRunning() && frame_buffers.size() > 0)) {\n\t\tframe = frame_buffers.front();\n\t\tframe_buffers.pop_front();\n\t}\n\treturn frame;\n}\n\nuint32_t AbstractBufferedPipeline::get_frame_count() {\n\tENTER();\n\n\tMutex::Autolock lock(buffer_mutex);\n\tuint32_t result = frame_buffers.size();\n\n\tRETURN(result, uint32_t);\n}\n\n//********************************************************************************\n//\n//********************************************************************************\nvoid *AbstractBufferedPipeline::handler_thread_func(void *vptr_args) {\n\n\tENTER();\n\tAbstractBufferedPipeline *pipeline = reinterpret_cast<AbstractBufferedPipeline *>(vptr_args);\n\tif (LIKELY(pipeline)) {\n\t\tpipeline->do_loop();\n\t}\n\tPRE_EXIT();\n\tpthread_exit(NULL);\n}\n\nvoid AbstractBufferedPipeline::do_loop() {\n\tENTER();\n\n\tclear_frames();\n\tinit_pool(default_frame_size);\n\n\ton_start();\n\tsetState(PIPELINE_STATE_RUNNING);\n\tfor ( ; LIKELY(isRunning()) ; ) {\n\t\tuvc_frame_t *frame = wait_frame();\n\t\tif ((LIKELY(frame))) {\n\t\t\ttry {\n\t\t\t\tif (!handle_frame(frame)) {\n\t\t\t\t\tchain_frame(frame);\n\t\t\t\t}\n\t\t\t} catch (...) {\n\t\t\t\tLOGE(\"exception\");\n\t\t\t}\n\t\t\trecycle_frame(frame);\n\t\t}\n\t}\n\tsetState(PIPELINE_STATE_STOPPING);\n\tmIsRunning = false;\n\ton_stop();\n\tsetState(PIPELINE_STATE_INITIALIZED);\n\n\tEXIT();\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/AbstractBufferedPipeline.h",
    "content": "//\n// Created by saki on 15/11/05.\n//\n\n#ifndef PUPILMOBILE_ABSTRACTBUFFEREDPIPELINE_H\n#define PUPILMOBILE_ABSTRACTBUFFEREDPIPELINE_H\n\n#include <stdlib.h>\n#include <pthread.h>\n#include <list>\n#include \"Mutex.h\"\n#include \"Condition.h\"\n\n#include \"libUVCCamera.h\"\n#include \"IPipeline.h\"\n\n#pragma interface\n\n#define DEFAULT_INIT_FRAME_POOL_SZ 2\n#define DEFAULT_MAX_FRAME_NUM 8\n\nusing namespace android;\n\nclass AbstractBufferedPipeline;\n\nclass AbstractBufferedPipeline : virtual public IPipeline {\nprivate:\n\tconst uint32_t max_buffer_num;\n\tconst uint32_t init_pool_num;\n\tconst bool drop_frames;\n\tvolatile uint32_t total_frame_num;\n\n// frame buffer pool to improve performance by reducing memory allocation\n\tmutable Mutex pool_mutex;\n\tCondition pool_sync;\n\tstd::list<uvc_frame_t *> frame_pool;\n// frame buffers\n\tpthread_t handler_thread;\n\tmutable Mutex buffer_mutex;\n\tCondition buffer_sync;\n\tstd::list<uvc_frame_t *> frame_buffers;\n\tstatic void *handler_thread_func(void *vptr_args);\n\nprotected:\n// frame buffer pool\n\tuvc_frame_t *get_frame(const size_t &data_bytes);\n\tvoid recycle_frame(uvc_frame_t *frame);\n\tvoid init_pool(const size_t &data_bytes);\n\tvoid clear_pool();\n// frame buffers\n\tvoid clear_frames();\n\tint add_frame(uvc_frame_t *frame);\n\tuvc_frame_t *wait_frame();\n\tuint32_t get_frame_count();\n\tvirtual void do_loop();\n\tvirtual void on_start() = 0;\n\tvirtual void on_stop() = 0;\n\tvirtual int handle_frame(uvc_frame_t *frame) = 0;\npublic:\n\tAbstractBufferedPipeline(const int &_max_buffer_num = DEFAULT_MAX_FRAME_NUM, const int &init_pool_num = DEFAULT_INIT_FRAME_POOL_SZ,\n\t\tconst size_t &default_frame_size = DEFAULT_FRAME_SZ, const bool &drop_frames_when_buffer_empty = true);\n\tvirtual ~AbstractBufferedPipeline();\n\tvirtual int release();\n\tvirtual int start();\n\tvirtual int stop();\n\tvirtual int queueFrame(uvc_frame_t *frame);\n};\n\n\n#endif //PUPILMOBILE_ABSTRACTBUFFEREDPIPELINE_H\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/CallbackPipeline.cpp",
    "content": "//\n// Created by saki on 15/11/07.\n//\n\n#if 1\t// set 1 if you don't need debug message\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// ignore LOGV/LOGD/MARK\n\t#endif\n\t#undef USE_LOGALL\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n\t#undef NDEBUG\t\t// depends on definition in Android.mk and Application.mk\n#endif\n\n#include \"utilbase.h\"\n#include \"common_utils.h\"\n#include \"libUVCCamera.h\"\n\n#include \"pipeline_helper.h\"\n#include \"IPipeline.h\"\n#include \"CallbackPipeline.h\"\n\n#define INIT_FRAME_POOL_SZ 2\n#define MAX_FRAME_NUM 8\n\nCallbackPipeline::CallbackPipeline(const size_t &_data_bytes)\n:\tCaptureBasePipeline(MAX_FRAME_NUM, INIT_FRAME_POOL_SZ, _data_bytes),\n\tmFrameCallbackFunc(NULL),\n\tcallbackPixelBytes(0)\n{\n\tENTER();\n\n\tsetState(PIPELINE_STATE_INITIALIZED);\n\n\tEXIT();\n}\n\nCallbackPipeline::~CallbackPipeline() {\n\tENTER();\n\n\tEXIT();\n}\n\nint CallbackPipeline::setFrameCallback(JNIEnv *env, jobject frame_callback_obj, int pixel_format) {\n\n\tENTER();\n\tMutex::Autolock lock(capture_mutex);\n\n\tif (isRunning() && isCapturing()) {\n\t\tmIsCapturing = false;\n\t\tif (mFrameCallbackObj) {\n\t\t\tcapture_sync.signal();\n\t\t\tcapture_sync.wait(capture_mutex);\t// wait finishing capturing\n\t\t}\n\t}\n\tif (!env->IsSameObject(mFrameCallbackObj, frame_callback_obj))\t{\n\t\tiframecallback_fields.onFrame = NULL;\n\t\tif (mFrameCallbackObj) {\n\t\t\tenv->DeleteGlobalRef(mFrameCallbackObj);\n\t\t}\n\t\tmFrameCallbackObj = frame_callback_obj;\n\t\tif (frame_callback_obj) {\n\t\t\t// get method IDs of Java object for callback\n\t\t\tjclass clazz = env->GetObjectClass(frame_callback_obj);\n\t\t\tif (LIKELY(clazz)) {\n\t\t\t\tiframecallback_fields.onFrame = env->GetMethodID(clazz,\n\t\t\t\t\t\"onFrame\",\t\"(Ljava/nio/ByteBuffer;)V\");\n\t\t\t} else {\n\t\t\t\tLOGW(\"failed to get object class\");\n\t\t\t}\n\t\t\tenv->ExceptionClear();\n\t\t\tif (!iframecallback_fields.onFrame) {\n\t\t\t\tLOGE(\"Can't find IFrameCallback#onFrame\");\n\t\t\t\tenv->DeleteGlobalRef(frame_callback_obj);\n\t\t\t\tmFrameCallbackObj = frame_callback_obj = NULL;\n\t\t\t}\n\t\t}\n\t}\n\tif (frame_callback_obj) {\n\t\tmPixelFormat = pixel_format;\n\t}\n\tRETURN(0, int);\n}\n\nvoid CallbackPipeline::callbackPixelFormatChanged(const uint32_t &width, const uint32_t &height) {\n\tmFrameCallbackFunc = NULL;\n\tconst size_t sz = width * height;\n\tswitch (mPixelFormat) {\n\t  case PIXEL_FORMAT_RAW:\n\t\tLOGI(\"PIXEL_FORMAT_RAW:\");\n\t\tcallbackPixelBytes = sz * 2;\n\t\tbreak;\n\t  case PIXEL_FORMAT_YUV:\n\t\tLOGI(\"PIXEL_FORMAT_YUV:\");\n\t\tmFrameCallbackFunc = uvc_any2yuyv;\n\t\tcallbackPixelBytes = sz * 2;\n\t\tbreak;\n\t  case PIXEL_FORMAT_RGB565:\n\t\tLOGI(\"PIXEL_FORMAT_RGB565:\");\n\t\tmFrameCallbackFunc = uvc_any2rgb565;\n\t\tcallbackPixelBytes = sz * 2;\n\t\tbreak;\n\t  case PIXEL_FORMAT_RGBX:\n\t\tLOGI(\"PIXEL_FORMAT_RGBX:\");\n\t\tmFrameCallbackFunc = uvc_any2rgbx;\n\t\tcallbackPixelBytes = sz * 4;\n\t\tbreak;\n\t  case PIXEL_FORMAT_YUV20SP:\n\t\tLOGI(\"PIXEL_FORMAT_YUV20SP:\");\n\t\tmFrameCallbackFunc = uvc_any2yuv420SP;\n\t\tcallbackPixelBytes = (sz * 3) / 2;\n\t\tbreak;\n\t  case PIXEL_FORMAT_NV21:\n\t\tLOGI(\"PIXEL_FORMAT_NV21:\");\n\t\tmFrameCallbackFunc = uvc_any2iyuv420SP;\n\t\tcallbackPixelBytes = (sz * 3) / 2;\n\t\tbreak;\n\t}\n}\n\nvoid CallbackPipeline::do_capture(JNIEnv *env) {\n\tENTER();\n\n\tuvc_frame_t *frame;\n\tuvc_frame_t *temp = get_frame(default_frame_size);\n\tuvc_frame_t *callback_frame;\n\tuint32_t width = 0, height = 0;\n\tsize_t sz = default_frame_size;\n\n\tif (LIKELY(temp)) {\n\t\tfor (; isRunning() && isCapturing();) {\n\t\t\tframe = waitCaptureFrame();\n\t\t\tif ((LIKELY(frame))) {\n\t\t\t\tif (UNLIKELY((width != frame->width) || (height != frame->height))) {\n\t\t\t\t\twidth = frame->width;\n\t\t\t\t\theight = frame->height;\n\t\t\t\t\tcallbackPixelFormatChanged(width, height);\n\t\t\t\t\tuvc_ensure_frame_size(temp, callbackPixelBytes);\n\t\t\t\t\tsz = callbackPixelBytes;\n\t\t\t\t}\n\t\t\t\tif (mFrameCallbackObj) {\n\t\t\t\t\tcallback_frame = frame;\n\t\t\t\t\tsz = frame->actual_bytes;\n\t\t\t\t\tif (mFrameCallbackFunc) {\n\t\t\t\t\t\tcallback_frame = temp;\n\t\t\t\t\t\tsz = callbackPixelBytes;\n\t\t\t\t\t\tint b = mFrameCallbackFunc(frame, temp);\n\t\t\t\t\t\tif (UNLIKELY(b)) {\n\t\t\t\t\t\t\tLOGW(\"failed to convert to callback frame\");\n\t\t\t\t\t\t\tgoto SKIP;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tjobject buf = env->NewDirectByteBuffer(callback_frame->data, callbackPixelBytes);\n\t\t\t\t\tenv->CallVoidMethod(mFrameCallbackObj, iframecallback_fields.onFrame, buf);\n\t\t\t\t\tenv->ExceptionClear();\n\t\t\t\t\tenv->DeleteLocalRef(buf);\n\t\t\t\t}\nSKIP:\n\t\t\t\trecycle_frame(frame);\n\t\t\t}\n\t\t}\n\t\trecycle_frame(temp);\n\t}\n\n\tEXIT();\n}\n\n//**********************************************************************\n//\n//**********************************************************************\nstatic ID_TYPE nativeCreate(JNIEnv *env, jobject thiz) {\n\n\tENTER();\n\tCallbackPipeline *pipeline = new CallbackPipeline();\n\tsetField_long(env, thiz, \"mNativePtr\", reinterpret_cast<ID_TYPE>(pipeline));\n\tRETURN(reinterpret_cast<ID_TYPE>(pipeline), ID_TYPE);\n}\n\nstatic void nativeDestroy(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\tsetField_long(env, thiz, \"mNativePtr\", 0);\n\tCallbackPipeline *pipeline = reinterpret_cast<CallbackPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tpipeline->release();\n\t\tSAFE_DELETE(pipeline);\n\t}\n\tEXIT();\n}\n\nstatic jint nativeGetState(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\tjint result = 0;\n\tCallbackPipeline *pipeline = reinterpret_cast<CallbackPipeline *>(id_pipeline);\n\tif (pipeline) {\n\t\tresult = pipeline->getState();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetPipeline(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline, jobject pipeline_obj) {\n\n\tENTER();\n\tjint result = JNI_ERR;\n\tCallbackPipeline *pipeline = reinterpret_cast<CallbackPipeline *>(id_pipeline);\n\tif (pipeline) {\n\t\tIPipeline *pipeline = getPipeline(env, pipeline_obj);\n\t\tresult = pipeline->setPipeline(pipeline);\n\t}\n\n\tRETURN(result, jint);\n}\n\nstatic jint nativeStart(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\n\tint result = JNI_ERR;\n\tCallbackPipeline *pipeline = reinterpret_cast<CallbackPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tresult = pipeline->start();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeStop(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tCallbackPipeline *pipeline = reinterpret_cast<CallbackPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tresult = pipeline->stop();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetFrameCallback(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline, jobject jIFrameCallback, jint pixel_format) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tCallbackPipeline *pipeline = reinterpret_cast<CallbackPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tjobject frame_callback_obj = env->NewGlobalRef(jIFrameCallback);\n\t\tresult = pipeline->setFrameCallback(env, frame_callback_obj, pixel_format);\n\t}\n\tRETURN(result, jint);\n}\n\n//**********************************************************************\n//\n//**********************************************************************\nstatic JNINativeMethod methods[] = {\n\t{ \"nativeCreate\",\t\t\t\t\t\"()J\", (void *) nativeCreate },\n\t{ \"nativeDestroy\",\t\t\t\t\t\"(J)V\", (void *) nativeDestroy },\n\n\t{ \"nativeGetState\",\t\t\t\t\t\"(J)I\", (void *) nativeGetState },\n\t{ \"nativeSetPipeline\",\t\t\t\t\"(JLcom/serenegiant/usb/IPipeline;)I\", (void *) nativeSetPipeline },\n\n\t{ \"nativeStart\",\t\t\t\t\t\"(J)I\", (void *) nativeStart },\n\t{ \"nativeStop\",\t\t\t\t\t\t\"(J)I\", (void *) nativeStop },\n\n\t{ \"nativeSetFrameCallback\",\t\t\t\"(JLcom/serenegiant/usb/IFrameCallback;I)I\", (void *) nativeSetFrameCallback },\n};\n\nint register_callback_pipeline(JNIEnv *env) {\n\tLOGV(\"register_callback_pipeline:\");\n\tif (registerNativeMethods(env,\n\t\t\"com/serenegiant/usb/FrameCallbackPipeline\",\n\t\tmethods, NUM_ARRAY_ELEMENTS(methods)) < 0) {\n\t\treturn -1;\n\t}\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/CallbackPipeline.h",
    "content": "//\n// Created by saki on 15/11/07.\n//\n\n#ifndef PUPILMOBILE_CALLBACKPIPELINE_H\n#define PUPILMOBILE_CALLBACKPIPELINE_H\n\n#include \"libUVCCamera.h\"\n#include \"CaptureBasePipeline.h\"\n\nclass CallbackPipeline : virtual public CaptureBasePipeline {\nprivate:\n\tjobject mFrameCallbackObj;\n\tconvFunc_t mFrameCallbackFunc;\n\tFields_iframecallback iframecallback_fields;\n\tint mPixelFormat;\n\tsize_t callbackPixelBytes;\n\tvoid callbackPixelFormatChanged(const uint32_t &width, const uint32_t &height);\nprotected:\n\tvirtual void do_capture(JNIEnv *env);\npublic:\n\tCallbackPipeline(const size_t &_data_bytes = DEFAULT_FRAME_SZ);\n\tvirtual ~CallbackPipeline();\n\tint setFrameCallback(JNIEnv *env, jobject frame_callback_obj, int pixel_format);\n};\n\n#endif //PUPILMOBILE_CALLBACKPIPELINE_H\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/CaptureBasePipeline.cpp",
    "content": "//\n// Created by saki on 15/11/07.\n//\n\n#if 1\t// set 1 if you don't need debug message\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// ignore LOGV/LOGD/MARK\n\t#endif\n\t#undef USE_LOGALL\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n\t#undef NDEBUG\t\t// depends on definition in Android.mk and Application.mk\n#endif\n\n#include \"utilbase.h\"\n#include \"common_utils.h\"\n\n#include \"CaptureBasePipeline.h\"\n\n#define INIT_FRAME_POOL_SZ 2\n#define MAX_FRAME_NUM 8\n\nCaptureBasePipeline::CaptureBasePipeline(const size_t &_data_bytes)\n:\tAbstractBufferedPipeline(MAX_FRAME_NUM, INIT_FRAME_POOL_SZ, _data_bytes),\n\tmIsCapturing(false),\n\tcaptureQueue(NULL),\n\tframeWidth(0),\n\tframeHeight(0)\n{\n\tENTER();\n\n\tEXIT();\n}\n\nCaptureBasePipeline::CaptureBasePipeline(const int &_max_buffer_num, const int &init_pool_num, const size_t &default_frame_size)\n:\tAbstractBufferedPipeline(_max_buffer_num, init_pool_num, default_frame_size),\n\tmIsCapturing(false),\n\tcaptureQueue(NULL),\n\tframeWidth(0),\n\tframeHeight(0)\n{\n\tENTER();\n\n\tEXIT();\n}\n\n\nCaptureBasePipeline::~CaptureBasePipeline() {\n\tENTER();\n\n\tclearCaptureFrame();\n\n\tEXIT();\n}\n\n//********************************************************************************\n//\n//********************************************************************************\nconst bool CaptureBasePipeline::isCapturing() const { return mIsCapturing; }\n\n/**\n * clear frame data for capturing\n */\nvoid CaptureBasePipeline::clearCaptureFrame() {\n\tMutex::Autolock lock(capture_mutex);\n\n\tif (captureQueue)\n\t\trecycle_frame(captureQueue);\n\tcaptureQueue = NULL;\n}\n\nvoid CaptureBasePipeline::addCaptureFrame(uvc_frame_t *frame) {\n//\tENTER();\n\n\tMutex::Autolock lock(capture_mutex);\n\n\t// keep only latest one\n\tif (captureQueue) {\n\t\trecycle_frame(captureQueue);\n\t\tcaptureQueue = NULL;\n\t}\n\tif (LIKELY(isRunning())) {\n\t\tcaptureQueue = frame;\n\t\tcapture_sync.signal();\n\t} else {\n\t\trecycle_frame(frame);\n\t}\n\n//\tEXIT();\n}\n\n/**\n * get frame data for capturing, if not exist, block and wait\n */\nuvc_frame_t *CaptureBasePipeline::waitCaptureFrame() {\n\tuvc_frame_t *frame = NULL;\n\tMutex::Autolock lock(capture_mutex);\n\n\tif (!captureQueue) {\n\t\tcapture_sync.wait(capture_mutex);\n\t}\n\tif (LIKELY(isRunning() && captureQueue)) {\n\t\tframe = captureQueue;\n\t\tcaptureQueue = NULL;\n\t}\n\treturn frame;\n}\n\n/* override protected */\nvoid CaptureBasePipeline::on_start() {\n\tENTER();\n\n\tmIsCapturing = true;\n\tpthread_create(&capture_thread, NULL, capture_thread_func, (void *)this);\n\n\tEXIT();\n}\n\n/* override protected */\nvoid CaptureBasePipeline::on_stop() {\n\tENTER();\n\n\tmIsCapturing = false;\n\tcapture_sync.broadcast();\n\tif (pthread_join(capture_thread, NULL) != EXIT_SUCCESS) {\n\t\tLOGW(\"UVCCameraControl::terminate capture thread: pthread_join failed\");\n\t}\n\tclearCaptureFrame();\n\n\tEXIT();\n}\n\n/* override protected */\nint CaptureBasePipeline::handle_frame(uvc_frame_t *frame) {\n//\tENTER();\n\n\tif (LIKELY(frame)) {\n\t\t// get empty frame from frame pool\n\t\tuvc_frame_t *copy = get_frame(frame->data_bytes);\n\t\tif (LIKELY(copy)) {\n\t\t\t// duplicate frame buffer and pass copy\n\t\t\tuvc_error_t ret = uvc_duplicate_frame(frame, copy);\n\t\t\tif (LIKELY(!ret)) {\n\t\t\t\taddCaptureFrame(copy);\n\t\t\t} else {\n\t\t\t\tLOGW(\"uvc_duplicate_frame failed:%d\", ret);\n\t\t\t\trecycle_frame(copy);\n\t\t\t}\n\t\t} else {\n\t\t\tLOGW(\"buffer pool is empty and exceeds the limit, drop frame\");\n\t\t}\n\t}\n\n\treturn 0; // \tRETURN(0, int);\n}\n\n/*\n * thread function\n * @param vptr_args pointer to UVCCameraControl instance\n */\n// static\nvoid *CaptureBasePipeline::capture_thread_func(void *vptr_args) {\n\n\tENTER();\n\n\tCaptureBasePipeline *pipeline = reinterpret_cast<CaptureBasePipeline *>(vptr_args);\n\tif (LIKELY(pipeline)) {\n\t\tJavaVM *vm = getVM();\n\t\tJNIEnv *env;\n\t\t// attach to JavaVM\n\t\tvm->AttachCurrentThread(&env, NULL);\n\t\tpipeline->internal_do_capture(env);\t// never return until finish streaming\n\t\t// detach from JavaVM\n\t\tvm->DetachCurrentThread();\n\t\tMARK(\"DetachCurrentThread\");\n\t}\n\n\tPRE_EXIT();\n\tpthread_exit(NULL);\n}\n\n/**\n * the actual function for capturing\n */\nvoid CaptureBasePipeline::internal_do_capture(JNIEnv *env) {\n\n\tENTER();\n\n\tclearCaptureFrame();\n\tfor (; isRunning() ;) {\n\t\tmIsCapturing = true;\n\t\tdo_capture(env);\n\t\tcapture_sync.broadcast();\n\t}\t// end of for (; isRunning() ;)\n\n\tEXIT();\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/CaptureBasePipeline.h",
    "content": "//\n// Created by saki on 15/11/07.\n//\n\n#ifndef PUPILMOBILE_CAPTUREBASEPIPELINE_H\n#define PUPILMOBILE_CAPTUREBASEPIPELINE_H\n\n#include \"Mutex.h\"\n#include \"Condition.h\"\n\n#include \"libUVCCamera.h\"\n#include \"AbstractBufferedPipeline.h\"\n\nusing namespace android;\n\nclass CaptureBasePipeline : virtual public AbstractBufferedPipeline {\nprivate:\n\tstatic void *capture_thread_func(void *vptr_args);\n\tvoid internal_do_capture(JNIEnv *env);\nprotected:\n\tvolatile bool mIsCapturing;\n\tmutable Mutex capture_mutex;\n\tCondition capture_sync;\n\tpthread_t capture_thread;\n\tuvc_frame_t *captureQueue;\t\t\t// keep latest one frame only\n\tuint32_t frameWidth;\n\tuint32_t frameHeight;\n\tvoid clearCaptureFrame();\n\tvoid addCaptureFrame(uvc_frame_t *frame);\n\tuvc_frame_t *waitCaptureFrame();\n\n\tvirtual void on_start();\n\tvirtual void on_stop();\n\tvirtual int handle_frame(uvc_frame_t *frame);\n\tvirtual void do_capture(JNIEnv *env) = 0;\npublic:\n\tCaptureBasePipeline(const size_t &_data_bytes = DEFAULT_FRAME_SZ);\n\tCaptureBasePipeline(const int &_max_buffer_num = DEFAULT_MAX_FRAME_NUM, const int &init_pool_num = DEFAULT_INIT_FRAME_POOL_SZ, const size_t &default_frame_size = DEFAULT_FRAME_SZ);\n\tvirtual ~CaptureBasePipeline();\n\tconst bool isCapturing() const;\n};\n\n\n#endif //PUPILMOBILE_CAPTUREBASEPIPELINE_H\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/ConvertPipeline.cpp",
    "content": "//\n// Created by saki on 15/11/05.\n//\n\n#if 1\t// set 1 if you don't need debug message\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// ignore LOGV/LOGD/MARK\n\t#endif\n\t#undef USE_LOGALL\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n\t#undef NDEBUG\t\t// depends on definition in Android.mk and Application.mk\n#endif\n\n#include \"utilbase.h\"\n#include \"common_utils.h\"\n\n#include \"libUVCCamera.h\"\n#include \"pipeline_helper.h\"\n#include \"IPipeline.h\"\n#include \"ConvertPipeline.h\"\n\n#define INIT_FRAME_POOL_SZ 2\n#define MAX_FRAME_NUM 8\n\n/* public */\nConvertPipeline::ConvertPipeline(const size_t &_data_bytes, const int &_target_pixel_format)\n:\tAbstractBufferedPipeline(MAX_FRAME_NUM, INIT_FRAME_POOL_SZ, _data_bytes),\n\ttarget_pixel_format(_target_pixel_format),\n\tmFrameConvFunc(NULL)\n{\n\tENTER();\n\n\tupdateConvFunc();\n\tsetState(PIPELINE_STATE_INITIALIZED);\n\n\tEXIT();\n}\n\n/* public */\nConvertPipeline::~ConvertPipeline() {\n\tENTER();\n\n\tEXIT();\n}\n\nvoid ConvertPipeline::updateConvFunc() {\n\tENTER();\n\n\tMutex::Autolock lock(pipeline_mutex);\n\tmFrameConvFunc = NULL;\n\tswitch (target_pixel_format) {\n\t\tcase PIXEL_FORMAT_RAW:\n\t\t\tLOGI(\"PIXEL_FORMAT_RAW:\");\n\t\t\tbreak;\n\t\tcase PIXEL_FORMAT_YUV:\n\t\t\tLOGI(\"PIXEL_FORMAT_YUV:\");\n\t\t\tmFrameConvFunc = uvc_any2yuyv;\n\t\t\tbreak;\n\t\tcase PIXEL_FORMAT_RGB565:\n\t\t\tLOGI(\"PIXEL_FORMAT_RGB565:\");\n\t\t\tmFrameConvFunc = uvc_any2rgb565;\n\t\t\tbreak;\n\t\tcase PIXEL_FORMAT_RGBX:\n\t\t\tLOGI(\"PIXEL_FORMAT_RGBX:\");\n\t\t\tmFrameConvFunc = uvc_any2rgbx;\n\t\t\tbreak;\n\t\tcase PIXEL_FORMAT_YUV20SP:\n\t\t\tLOGI(\"PIXEL_FORMAT_YUV20SP:\");\n\t\t\tmFrameConvFunc = uvc_any2yuv420SP;\n\t\t\tbreak;\n\t\tcase PIXEL_FORMAT_NV21:\n\t\t\tLOGI(\"PIXEL_FORMAT_NV21:\");\n\t\t\tmFrameConvFunc = uvc_any2iyuv420SP;\n\t\t\tbreak;\n\t}\n\n\tEXIT();\n};\n\nvoid ConvertPipeline::on_start() {\n\tENTER();\n\n\tupdateConvFunc();\n\n\tEXIT();\n}\n\nvoid ConvertPipeline::on_stop() {\n\tENTER();\n\n\tEXIT();\n}\n\nint ConvertPipeline::handle_frame(uvc_frame_t *frame) {\n\tENTER();\n\n\tMutex::Autolock lock(pipeline_mutex);\n\n\tif (next_pipeline) {\n\t\tuvc_frame_t *copy = frame;\n\t\tif (mFrameConvFunc) {\n\t\t\tcopy = get_frame(frame->actual_bytes);\n\t\t\tif (LIKELY(copy)) {\n\t\t\t\tconst uvc_error_t r = mFrameConvFunc(frame, copy);\n\t\t\t\tif (UNLIKELY(r)) {\n\t\t\t\t\tLOGW(\"failed to convert:%d\", r);\n\t\t\t\t\trecycle_frame(copy);\n\t\t\t\t\tcopy = frame;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tnext_pipeline->queueFrame(copy);\n\t}\n\n\tRETURN(1, int);\n}\n\n//**********************************************************************\n//\n//**********************************************************************\nstatic ID_TYPE nativeCreate(JNIEnv *env, jobject thiz, jint pixel_format) {\n\n\tENTER();\n\tConvertPipeline *pipeline = new ConvertPipeline(DEFAULT_FRAME_SZ, pixel_format);\n\tsetField_long(env, thiz, \"mNativePtr\", reinterpret_cast<ID_TYPE>(pipeline));\n\tRETURN(reinterpret_cast<ID_TYPE>(pipeline), ID_TYPE);\n}\n\nstatic void nativeDestroy(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\tsetField_long(env, thiz, \"mNativePtr\", 0);\n\tConvertPipeline *pipeline = reinterpret_cast<ConvertPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tpipeline->release();\n\t\tSAFE_DELETE(pipeline);\n\t}\n\tEXIT();\n}\n\nstatic jint nativeGetState(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\tjint result = 0;\n\tConvertPipeline *pipeline = reinterpret_cast<ConvertPipeline *>(id_pipeline);\n\tif (pipeline) {\n\t\tresult = pipeline->getState();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetPipeline(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline, jobject pipeline_obj) {\n\n\tENTER();\n\tjint result = JNI_ERR;\n\tConvertPipeline *pipeline = reinterpret_cast<ConvertPipeline *>(id_pipeline);\n\tif (pipeline) {\n\t\tIPipeline *target_pipeline = getPipeline(env, pipeline_obj);\n\t\tresult = pipeline->setPipeline(target_pipeline);\n\t}\n\n\tRETURN(result, jint);\n}\n\nstatic jint nativeStart(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\n\tint result = JNI_ERR;\n\tConvertPipeline *pipeline = reinterpret_cast<ConvertPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tresult = pipeline->start();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeStop(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tConvertPipeline *pipeline = reinterpret_cast<ConvertPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tresult = pipeline->stop();\n\t}\n\tRETURN(result, jint);\n}\n\n//**********************************************************************\n//\n//**********************************************************************\nstatic JNINativeMethod methods[] = {\n\t{ \"nativeCreate\",\t\t\t\t\t\"(I)J\", (void *) nativeCreate },\n\t{ \"nativeDestroy\",\t\t\t\t\t\"(J)V\", (void *) nativeDestroy },\n\n\t{ \"nativeGetState\",\t\t\t\t\t\"(J)I\", (void *) nativeGetState },\n\t{ \"nativeSetPipeline\",\t\t\t\t\"(JLcom/serenegiant/usb/IPipeline;)I\", (void *) nativeSetPipeline },\n\n\t{ \"nativeStart\",\t\t\t\t\t\"(J)I\", (void *) nativeStart },\n\t{ \"nativeStop\",\t\t\t\t\t\t\"(J)I\", (void *) nativeStop },\n\n};\n\nint register_convert_pipeline(JNIEnv *env) {\n\tLOGV(\"register_convert_pipeline:\");\n\tif (registerNativeMethods(env,\n\t\t\"com/serenegiant/usb/ConvertPipeline\",\n\t\tmethods, NUM_ARRAY_ELEMENTS(methods)) < 0) {\n\t\treturn -1;\n\t}\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/ConvertPipeline.h",
    "content": "//\n// Created by saki on 15/11/05.\n//\n\n#ifndef PUPILMOBILE_CONVERTPIPELINE_H\n#define PUPILMOBILE_CONVERTPIPELINE_H\n\n#include \"libUVCCamera.h\"\n#include \"AbstractBufferedPipeline.h\"\n\nclass ConvertPipeline : virtual public AbstractBufferedPipeline {\nprivate:\n\tconst int target_pixel_format;\n\tconvFunc_t mFrameConvFunc;\n\tvoid updateConvFunc();\nprotected:\n\tvirtual void on_start();\n\tvirtual void on_stop();\n\tvirtual int handle_frame(uvc_frame_t *frame);\npublic:\n\tConvertPipeline(const size_t &_data_bytes, const int &target_pixel_format = PIXEL_FORMAT_RAW);\n\tvirtual ~ConvertPipeline();\n};\n\n\n#endif //PUPILMOBILE_CONVERTPIPELINE_H\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/DistributePipeline.cpp",
    "content": "//\n// Created by saki on 15/11/25.\n//\n\n#include \"utilbase.h\"\n#include \"common_utils.h\"\n#include \"libUVCCamera.h\"\n\n#include \"pipeline_helper.h\"\n#include \"IPipeline.h\"\n#include \"DistributePipeline.h\"\n\nDistributePipeline::DistributePipeline(const int &_max_buffer_num, const int &init_pool_num,\n\t\tconst size_t &default_frame_size, const bool &drop_frames_when_buffer_empty)\n:\tAbstractBufferedPipeline(_max_buffer_num, init_pool_num, default_frame_size, drop_frames_when_buffer_empty)\n{\n\tENTER();\n\n\tsetState(PIPELINE_STATE_INITIALIZED);\n\n\tEXIT();\n}\n\nDistributePipeline::~DistributePipeline() {\n\tENTER();\n\n\tMutex::Autolock lock(pipeline_mutex);\n\n\tpipelines.clear();\n\n\tEXIT();\n}\n\nvoid DistributePipeline::on_start() {\n\tENTER();\n\tEXIT();\n}\n\nvoid DistributePipeline::on_stop() {\n\tENTER();\n\tEXIT();\n}\n\nint DistributePipeline::handle_frame(uvc_frame_t *frame) {\n\tENTER();\n\n\tMutex::Autolock lock(pipeline_mutex);\n\n\tfor (auto iter = pipelines.begin(); iter != pipelines.end(); iter++) {\n\t\t(*iter)->queueFrame(frame);\n\t}\n\n\tRETURN(0, int);\n}\n\nint DistributePipeline::addPipeline(IPipeline *pipeline) {\n\tENTER();\n\n\tif (pipeline) {\n\t\tMutex::Autolock lock(pipeline_mutex);\n\t\tpipelines.push_back(pipeline);\n\t}\n\n\tRETURN(0, int);\n}\n\nint DistributePipeline::removePipeline(IPipeline *pipeline) {\n\tENTER();\n\n\tif (pipeline) {\n\t\tMutex::Autolock lock(pipeline_mutex);\n\n\t\tfor (auto iter = pipelines.begin(); iter != pipelines.end(); ) {\n\t\t\tif (*iter == pipeline) {\n\t\t\t\titer = pipelines.erase(iter);\n\t\t\t} else {\n\t\t\t\titer++;\n\t\t\t}\n\t\t}\n\t}\n\n\tRETURN(0, int);\n}\n\n//**********************************************************************\n//\n//**********************************************************************\nstatic ID_TYPE nativeCreate(JNIEnv *env, jobject thiz) {\n\n\tENTER();\n\tDistributePipeline *pipeline = new DistributePipeline();\n\tsetField_long(env, thiz, \"mNativePtr\", reinterpret_cast<ID_TYPE>(pipeline));\n\tRETURN(reinterpret_cast<ID_TYPE>(pipeline), ID_TYPE);\n}\n\nstatic void nativeDestroy(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\tsetField_long(env, thiz, \"mNativePtr\", 0);\n\tDistributePipeline *pipeline = reinterpret_cast<DistributePipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tpipeline->release();\n\t\tSAFE_DELETE(pipeline);\n\t}\n\tEXIT();\n}\n\nstatic jint nativeGetState(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\tjint result = 0;\n\tDistributePipeline *pipeline = reinterpret_cast<DistributePipeline *>(id_pipeline);\n\tif (pipeline) {\n\t\tresult = pipeline->getState();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetPipeline(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline, jobject pipeline_obj) {\n\n\tENTER();\n\tjint result = JNI_ERR;\n\tDistributePipeline *pipeline = reinterpret_cast<DistributePipeline *>(id_pipeline);\n\tif (pipeline) {\n\t\tIPipeline *target_pipeline = getPipeline(env, pipeline_obj);\n\t\tresult = pipeline->setPipeline(target_pipeline);\n\t}\n\n\tRETURN(result, jint);\n}\n\nstatic jint nativeAddPipeline(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline, jobject pipeline_obj) {\n\n\tENTER();\n\tjint result = JNI_ERR;\n\tDistributePipeline *pipeline = reinterpret_cast<DistributePipeline *>(id_pipeline);\n\tif (pipeline) {\n\t\tIPipeline *target_pipeline = getPipeline(env, pipeline_obj);\n\t\tresult = pipeline->addPipeline(target_pipeline);\n\t}\n\n\tRETURN(result, jint);\n}\n\nstatic jint nativeRemovePipeline(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline, jobject pipeline_obj) {\n\n\tENTER();\n\tjint result = JNI_ERR;\n\tDistributePipeline *pipeline = reinterpret_cast<DistributePipeline *>(id_pipeline);\n\tif (pipeline) {\n\t\tIPipeline *target_pipeline = getPipeline(env, pipeline_obj);\n\t\tresult = pipeline->removePipeline(target_pipeline);\n\t}\n\n\tRETURN(result, jint);\n}\n\nstatic jint nativeStart(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\n\tint result = JNI_ERR;\n\tDistributePipeline *pipeline = reinterpret_cast<DistributePipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tresult = pipeline->start();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeStop(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tDistributePipeline *pipeline = reinterpret_cast<DistributePipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tresult = pipeline->stop();\n\t}\n\tRETURN(result, jint);\n}\n\n//**********************************************************************\n//\n//**********************************************************************\nstatic JNINativeMethod methods[] = {\n\t{ \"nativeCreate\",\t\t\t\t\t\"()J\", (void *) nativeCreate },\n\t{ \"nativeDestroy\",\t\t\t\t\t\"(J)V\", (void *) nativeDestroy },\n\n\t{ \"nativeGetState\",\t\t\t\t\t\"(J)I\", (void *) nativeGetState },\n\t{ \"nativeSetPipeline\",\t\t\t\t\"(JLcom/serenegiant/usb/IPipeline;)I\", (void *) nativeSetPipeline },\n\t{ \"nativeAddPipeline\",\t\t\t\t\"(JLcom/serenegiant/usb/IPipeline;)I\", (void *) nativeAddPipeline },\n\t{ \"nativeRemovePipeline\",\t\t\t\"(JLcom/serenegiant/usb/IPipeline;)I\", (void *) nativeRemovePipeline },\n\n\t{ \"nativeStart\",\t\t\t\t\t\"(J)I\", (void *) nativeStart },\n\t{ \"nativeStop\",\t\t\t\t\t\t\"(J)I\", (void *) nativeStop },\n};\n\nint register_distribute_pipeline(JNIEnv *env) {\n\tLOGV(\"register_distribute_pipeline:\");\n\tif (registerNativeMethods(env,\n\t\t\"com/serenegiant/usb/DistributePipeline\",\n\t\tmethods, NUM_ARRAY_ELEMENTS(methods)) < 0) {\n\t\treturn -1;\n\t}\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/DistributePipeline.h",
    "content": "//\n// Created by saki on 15/11/25.\n//\n\n#ifndef PUPILMOBILE_DISTRIBUTEPIPELINE_H\n#define PUPILMOBILE_DISTRIBUTEPIPELINE_H\n\n#include \"AbstractBufferedPipeline.h\"\n\n#pragma interface\n\nclass DistributePipeline : virtual public AbstractBufferedPipeline {\nprivate:\n\tstd::list<IPipeline *> pipelines;\nprotected:\n\tvirtual void on_start();\n\tvirtual void on_stop();\n\tvirtual int handle_frame(uvc_frame_t *frame);\npublic:\n\tDistributePipeline(const int &_max_buffer_num = DEFAULT_MAX_FRAME_NUM, const int &init_pool_num = DEFAULT_INIT_FRAME_POOL_SZ,\n\t\t\tconst size_t &default_frame_size = DEFAULT_FRAME_SZ, const bool &drop_frames_when_buffer_empty = true);\n\tvirtual ~DistributePipeline();\n\tvirtual int addPipeline(IPipeline *pipeline);\n\tvirtual int removePipeline(IPipeline *pipeline);\n};\n\n#endif //PUPILMOBILE_DISTRIBUTEPIPELINE_H\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/IPipeline.cpp",
    "content": "//\n// Created by saki on 15/11/05.\n//\n\n#if 1\t// set 1 if you don't need debug message\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// ignore LOGV/LOGD/MARK\n\t#endif\n\t#undef USE_LOGALL\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n\t#undef NDEBUG\t\t// depends on definition in Android.mk and Application.mk\n#endif\n\n#include <stdlib.h>\n\n#include \"utilbase.h\"\n#include \"common_utils.h\"\n\n#include \"libUVCCamera.h\"\n#include \"pipeline_helper.h\"\n#include \"IPipeline.h\"\n\n/*public*/\nIPipeline::IPipeline(const size_t &_default_frame_size)\n:\tstate(PIPELINE_STATE_UNINITIALIZED),\n\tmIsRunning(false),\n\tdefault_frame_size(_default_frame_size),\n\tnext_pipeline(NULL)\n{\n\tENTER();\n\n\tEXIT();\n}\n\n/*public*/\nIPipeline::~IPipeline() {\n\tENTER();\n\n\tEXIT();\n}\n\n/*public*/\nconst bool IPipeline::isRunning() const { return (mIsRunning); };\n\n/*public*/\nconst pipeline_state_t IPipeline::getState() const { return (state); };\n\n/*protected*/\nvoid IPipeline::setState(const pipeline_state_t &new_state) { state = new_state; }\n\n/*public*/\nint IPipeline::setPipeline(IPipeline *pipeline) {\n\tENTER();\n\n\tMutex::Autolock lock(pipeline_mutex);\n\n\t// XXX do I need to delete next_pipeline if it is not NULL?\n\tnext_pipeline = pipeline;\n\n\tRETURN(0, int);\n}\n\n/**\n * set frame to next_pipeline\n * if you don't need this, override this function\n */\nint IPipeline::chain_frame(uvc_frame_t *frame) {\n\tENTER();\n\n\tint result = -1;\n\tMutex::Autolock lock(pipeline_mutex);\n\n\tif (next_pipeline) {\n\t\tnext_pipeline->queueFrame(frame);\n\t\tresult = 0;\n\t}\n\n\tRETURN(result, int);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/IPipeline.h",
    "content": "//\n// Created by saki on 15/11/05.\n//\n\n#ifndef PUPILMOBILE_IPIPELINE_H\n#define PUPILMOBILE_IPIPELINE_H\n\n#include <stdlib.h>\n#include <pthread.h>\n#include \"Mutex.h\"\n\n#include \"libUVCCamera.h\"\n\n#pragma interface\n\nusing namespace android;\n\n#define DEFAULT_FRAME_SZ 1024\n\ntypedef enum pipeline_type {\n\tPIPELINE_TYPE_SIMPLE_BUFFERED = 0,\n\tPIPELINE_TYPE_SQLITE_BUFFERED = 10,\n\tPIPELINE_TYPE_UVC_CONTROL = 100,\n\tPIPELINE_TYPE_CALLBACK = 200,\n\tPIPELINE_TYPE_CONVERT = 300,\n\tPIPELINE_TYPE_PREVIEW = 400,\n\tPIPELINE_TYPE_PUBLISHER = 500,\n\tPIPELINE_TYPE_DISTRIBUTE = 600,\n} pipeline_type_t;\n\ntypedef enum _pipeline_state {\n\tPIPELINE_STATE_UNINITIALIZED = 0,\n\tPIPELINE_STATE_RELEASING = 10,\n\tPIPELINE_STATE_INITIALIZED = 20,\n\tPIPELINE_STATE_STARTING = 30,\n\tPIPELINE_STATE_RUNNING = 40,\n\tPIPELINE_STATE_STOPPING = 50,\n} pipeline_state_t;\n\nclass IPipeline;\n\nclass IPipeline {\nprivate:\n\tvolatile pipeline_state_t state;\n\t// force inhibiting copy/assignment\n\tIPipeline(const IPipeline &src);\n\tvoid operator =(const IPipeline &src);\nprotected:\n\tvolatile bool mIsRunning;\n\tconst size_t default_frame_size;\n\tmutable Mutex pipeline_mutex;\n\tIPipeline *next_pipeline;\n\tvoid setState(const pipeline_state_t &new_state);\n\t/**\n\t * if handle_frame return 0, handler_thread call this function\n\t * set frame to next pipeline\n\t * this may block caller thread while the pipeline is full\n\t * @return 0: success queueing, other: failed\n\t */\n\tvirtual int chain_frame(uvc_frame_t *frame);\npublic:\n\tIPipeline(const size_t &default_frame_size = DEFAULT_FRAME_SZ);\n\tvirtual ~IPipeline();\n\tconst pipeline_state_t getState() const;\n\tconst bool isRunning() const;\n\tvirtual int setPipeline(IPipeline *pipeline);\n\tvirtual int release() { return 0; };\n\tvirtual int start() { return 0; };\n\tvirtual int stop() { return 0; };\n\tvirtual int queueFrame(uvc_frame_t *frame) = 0;\n};\n\n\n#endif //PUPILMOBILE_IPIPELINE_H\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/PreviewPipeline.cpp",
    "content": "//\n// Created by saki on 15/11/06.\n//\n\n#if 1\t// set 1 if you don't need debug message\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// ignore LOGV/LOGD/MARK\n\t#endif\n\t#undef USE_LOGALL\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n\t#undef NDEBUG\t\t// depends on definition in Android.mk and Application.mk\n#endif\n\n#include <android/native_window_jni.h>\n\n#include \"utilbase.h\"\n#include \"common_utils.h\"\n\n#include \"libUVCCamera.h\"\n#include \"pipeline_helper.h\"\n#include \"IPipeline.h\"\n#include \"PreviewPipeline.h\"\n\n#define INIT_FRAME_POOL_SZ 2\n#define MAX_FRAME_NUM 32\t// max approx. 1sec\n\n#define CAPTURE_PIXEL_BYTES 2\t// RGB565\n\nPreviewPipeline::PreviewPipeline(const size_t &_data_bytes)\n:\tCaptureBasePipeline(MAX_FRAME_NUM, INIT_FRAME_POOL_SZ, _data_bytes),\n\tmCaptureWindow(NULL)\n{\n\tENTER();\n\n\tsetState(PIPELINE_STATE_INITIALIZED);\n\n\tEXIT();\n}\n\nPreviewPipeline::~PreviewPipeline() {\n\tENTER();\n\n\tif (mCaptureWindow) {\n\t\tANativeWindow_release(mCaptureWindow);\n\t}\n\tmCaptureWindow = NULL;\n\tclearCaptureFrame();\n\n\tEXIT();\n}\n\n//********************************************************************************\n//\n//********************************************************************************\nstatic void copyFrame(const uint8_t *src, uint8_t *dest, const int width, int height, const int stride_src, const int stride_dest) {\n\tconst int h8 = height % 8;\n\tfor (int i = 0; i < h8; i++) {\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t}\n\tfor (int i = 0; i < height; i += 8) {\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t\tmemcpy(dest, src, width);\n\t\tdest += stride_dest; src += stride_src;\n\t}\n}\n\n\n// transfer specific frame data to the Surface(ANativeWindow)\nstatic int copyToSurface(uvc_frame_t *frame, ANativeWindow **window) {\n//\tENTER();\n\tint result = 0;\n\tif (LIKELY(*window)) {\n\t\tANativeWindow_Buffer buffer;\n\t\tif (LIKELY(ANativeWindow_lock(*window, &buffer, NULL) == 0)) {\n\t\t\t// source = frame data\n\t\t\tconst uint8_t *src = (uint8_t *)frame->data;\n\t\t\tconst int src_w = frame->width * CAPTURE_PIXEL_BYTES;\n\t\t\tconst int src_step = frame->width * CAPTURE_PIXEL_BYTES;\n\t\t\t// destination = Surface(ANativeWindow)\n\t\t\tuint8_t *dest = (uint8_t *)buffer.bits;\n\t\t\tconst int dest_w = buffer.width * CAPTURE_PIXEL_BYTES;\n\t\t\tconst int dest_step = buffer.stride * CAPTURE_PIXEL_BYTES;\n\t\t\t// use lower transfer bytes\n\t\t\tconst int w = src_w < dest_w ? src_w : dest_w;\n\t\t\t// use lower height\n\t\t\tconst int h = frame->height < buffer.height ? frame->height : buffer.height;\n\t\t\t// transfer from frame data to the Surface\n\t\t\tcopyFrame(src, dest, w, h, src_step, dest_step);\n\t\t\tANativeWindow_unlockAndPost(*window);\n\t\t} else {\n\t\t\tresult = -1;\n\t\t}\n\t} else {\n\t\tresult = -1;\n\t}\n\treturn result; //RETURN(result, int);\n}\n\n//********************************************************************************\n//\n//********************************************************************************\nint PreviewPipeline::setCaptureDisplay(ANativeWindow *capture_window) {\n\tENTER();\n\tLOGI(\"setCaptureDisplay:%p\", capture_window);\n\n\tMutex::Autolock lock(capture_mutex);\n\n\tif (isRunning() && isCapturing()) {\n\t\tmIsCapturing = false;\n\t\tif (mCaptureWindow) {\n\t\t\tLOGD(\"wait for finishing capture loop\");\n\t\t\tcapture_sync.broadcast();\n\t\t\tcapture_sync.wait(capture_mutex);\t// wait finishing capturing\n\t\t}\n\t}\n\tif (mCaptureWindow != capture_window) {\n\t\t// release current Surface if already assigned.\n\t\tif (UNLIKELY(mCaptureWindow)) {\n\t\t\tLOGD(\"ANativeWindow_release\");\n\t\t\tANativeWindow_release(mCaptureWindow);\n\t\t}\n\t\tmCaptureWindow = capture_window;\n\t}\n\n\tRETURN(0, int);\n}\n\n/**\n * the actual function for capturing\n */\nvoid PreviewPipeline::do_capture(JNIEnv *env) {\n\n//\tENTER();\n\n\tuvc_frame_t *frame = NULL;\n\tuvc_frame_t *rgb565 = get_frame(default_frame_size);\n\n\tif (LIKELY(rgb565)) {\n\t\tfor (; isRunning() && isCapturing() ;) {\n\t\t\tframe = waitCaptureFrame();\n\t\t\tif (LIKELY(frame)) {\n\t\t\t\tif (LIKELY(isCapturing())) {\n\t\t\t\t\tconst bool need_update_geometry = (frame->width != frameWidth) || (frame->height != frameHeight);\n\t\t\t\t\tcapture_mutex.lock();\n\t\t\t\t\t{\n\t\t\t\t\t\tANativeWindow *window = mCaptureWindow;\t// local cache\n\t\t\t\t\t\tif (LIKELY(window)) {\n\t\t\t\t\t\t\tif (UNLIKELY(need_update_geometry)) {\n\t\t\t\t\t\t\t\tframeWidth = frame->width;\n\t\t\t\t\t\t\t\tframeHeight = frame->height;\n\t\t\t\t\t\t\t\tLOGD(\"ANativeWindow_setBuffersGeometry:(%dx%d)\", frameWidth, frameHeight);\n\t\t\t\t\t\t\t\tANativeWindow_setBuffersGeometry(window,\n\t\t\t\t\t\t\t\t\tframeWidth, frameHeight, WINDOW_FORMAT_RGB_565);\n\t\t\t\t\t\t\t\t// if you use Surface came from MediaCodec#createInputSurface\n\t\t\t\t\t\t\t\t// you could not change window format at least when you use\n\t\t\t\t\t\t\t\t// ANativeWindow_lock / ANativeWindow_unlockAndPost\n\t\t\t\t\t\t\t\t// to write frame data to the Surface...you should use RGBX8888 instead\n\t\t\t\t\t\t\t\t// So we need check here.\n\t\t\t\t\t\t\t\tint32_t window_format = ANativeWindow_getFormat(window);\n\t\t\t\t\t\t\t\tif (window_format != WINDOW_FORMAT_RGB_565) {\n\t\t\t\t\t\t\t\t\tLOGE(\"window format mismatch, cancelled movie capturing.\");\n\t\t\t\t\t\t\t\t\tANativeWindow_release(window);\n\t\t\t\t\t\t\t\t\twindow = mCaptureWindow = NULL;\n\t\t\t\t\t\t\t\t\tframeWidth = frameHeight = 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (LIKELY(window)) {\n\t\t\t\t\t\t\t\tint b = uvc_any2rgb565(frame, rgb565);\n\t\t\t\t\t\t\t\tif (LIKELY(!b)) {\n\t\t\t\t\t\t\t\t\tcopyToSurface(rgb565, &window);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tLOGE(\"failed to convert frame: err=%d\", b);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcapture_mutex.unlock();\n\t\t\t\t}\n\t\t\t\trecycle_frame(frame);\n\t\t\t}\n\t\t}\n\t}\n\tif (rgb565) {\n\t\trecycle_frame(rgb565);\n\t}\n\tcapture_mutex.lock();\n\t{\n\t\tif (mCaptureWindow) {\n\t\t\tANativeWindow_release(mCaptureWindow);\n\t\t\tmCaptureWindow = NULL;\n\t\t}\n\t}\n\tcapture_mutex.unlock();\n//\tEXIT();\n}\n\n//**********************************************************************\n//\n//**********************************************************************\nstatic ID_TYPE nativeCreate(JNIEnv *env, jobject thiz) {\n\n\tENTER();\n\tPreviewPipeline *pipeline = new PreviewPipeline();\n\tsetField_long(env, thiz, \"mNativePtr\", reinterpret_cast<ID_TYPE>(pipeline));\n\tRETURN(reinterpret_cast<ID_TYPE>(pipeline), ID_TYPE);\n}\n\nstatic void nativeDestroy(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\tsetField_long(env, thiz, \"mNativePtr\", 0);\n\tPreviewPipeline *pipeline = reinterpret_cast<PreviewPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tpipeline->release();\n\t\tSAFE_DELETE(pipeline);\n\t}\n\tEXIT();\n}\n\nstatic jint nativeGetState(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\tjint result = 0;\n\tPreviewPipeline *pipeline = reinterpret_cast<PreviewPipeline *>(id_pipeline);\n\tif (pipeline) {\n\t\tresult = pipeline->getState();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetPipeline(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline, jobject pipeline_obj) {\n\n\tENTER();\n\tjint result = JNI_ERR;\n\tPreviewPipeline *pipeline = reinterpret_cast<PreviewPipeline *>(id_pipeline);\n\tif (pipeline) {\n\t\tIPipeline *target_pipeline = getPipeline(env, pipeline_obj);\n\t\tresult = pipeline->setPipeline(target_pipeline);\n\t}\n\n\tRETURN(result, jint);\n}\n\nstatic jint nativeStart(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\n\tint result = JNI_ERR;\n\tPreviewPipeline *pipeline = reinterpret_cast<PreviewPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tresult = pipeline->start();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeStop(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tPreviewPipeline *pipeline = reinterpret_cast<PreviewPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tresult = pipeline->stop();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetCaptureDisplay(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline, jobject jSurface) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tPreviewPipeline *pipeline = reinterpret_cast<PreviewPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tANativeWindow *capture_window = jSurface ? ANativeWindow_fromSurface(env, jSurface) : NULL;\n\t\tresult = pipeline->setCaptureDisplay(capture_window);\n\t}\n\tRETURN(result, jint);\n}\n\n//**********************************************************************\n//\n//**********************************************************************\nstatic JNINativeMethod methods[] = {\n\t{ \"nativeCreate\",\t\t\t\t\t\"()J\", (void *) nativeCreate },\n\t{ \"nativeDestroy\",\t\t\t\t\t\"(J)V\", (void *) nativeDestroy },\n\n\t{ \"nativeGetState\",\t\t\t\t\t\"(J)I\", (void *) nativeGetState },\n\t{ \"nativeSetPipeline\",\t\t\t\t\"(JLcom/serenegiant/usb/IPipeline;)I\", (void *) nativeSetPipeline },\n\n\t{ \"nativeStart\",\t\t\t\t\t\"(J)I\", (void *) nativeStart },\n\t{ \"nativeStop\",\t\t\t\t\t\t\"(J)I\", (void *) nativeStop },\n\n\t{ \"nativeSetCaptureDisplay\",\t\t\"(JLandroid/view/Surface;)I\", (void *) nativeSetCaptureDisplay },\n\n};\n\nint register_preview_pipeline(JNIEnv *env) {\n\tLOGV(\"register_preview_pipeline:\");\n\tif (registerNativeMethods(env,\n\t\t\"com/serenegiant/usb/PreviewPipeline\",\n\t\tmethods, NUM_ARRAY_ELEMENTS(methods)) < 0) {\n\t\treturn -1;\n\t}\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/PreviewPipeline.h",
    "content": "//\n// Created by saki on 15/11/06.\n//\n\n#ifndef PUPILMOBILE_PREVIEWPIPELINE_H\n#define PUPILMOBILE_PREVIEWPIPELINE_H\n\n#include <android/native_window.h>\n\n#include \"libUVCCamera.h\"\n#include \"CaptureBasePipeline.h\"\n\nclass PreviewPipeline : virtual public CaptureBasePipeline {\nprivate:\n\tANativeWindow *mCaptureWindow;\nprotected:\n\tvirtual void do_capture(JNIEnv *env);\npublic:\n\tPreviewPipeline(const size_t &_data_bytes = DEFAULT_FRAME_SZ);\n\tvirtual ~PreviewPipeline();\n\tint setCaptureDisplay(ANativeWindow *capture_window);\n};\n\n\n#endif //PUPILMOBILE_PREVIEWPIPELINE_H\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/PublisherPipeline.cpp",
    "content": "//\n// Created by saki on 15/10/06.\n//\n\n#define MEAS_TIME 0\n\n#if 1\t// set 1 if you don't need debug message\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// ignore LOGV/LOGD/MARK\n\t#endif\n\t#undef USE_LOGALL\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n\t#undef NDEBUG\t\t// depends on definition in Android.mk and Application.mk\n#endif\n\n#if MEAS_TIME\n#define MEAS_TIME_INIT\tnsecs_t _meas_time_ = 0; int _meas_count_ = 0;\n#define MEAS_TIME_START\tconst nsecs_t _meas_t_ = systemTime();\n#define MEAS_TIME_STOP \\\n\t_meas_time_ += (systemTime() - _meas_t_); \\\n\tif UNLIKELY((++_meas_count_ % 100) == 0) { \\\n\t\tconst float d = _meas_time_ / (1000000.f * _meas_count_); \\\n\t\tLOGI(\"meas time=%5.2f[msec]\", d); \\\n\t}\n#else\n#define MEAS_TIME_INIT\n#define MEAS_TIME_START\n#define MEAS_TIME_STOP\n#endif\n\n#include <stdlib.h>\n#include <linux/time.h>\n#include <unistd.h>\n\n#include \"utilbase.h\"\n#include \"common_utils.h\"\n\n#include \"libUVCCamera.h\"\n#include \"endian_unaligned.h\"\n\n#include \"pipeline_helper.h\"\n#include \"PublisherPipeline.h\"\n#include \"pupilmobile_defs.h\"\n\n#define INIT_FRAME_POOL_SZ 2\n#define MAX_FRAME_NUM 8\n#define RETRY_INTERVALS_US 25000\n\n/* public */\nPublisherPipeline::PublisherPipeline(const size_t &_data_bytes, const char *addr, const char *_subscription_id)\n:\tAbstractBufferedPipeline(MAX_FRAME_NUM, INIT_FRAME_POOL_SZ, _data_bytes),\n\thost(addr),\n\tsubscription_id(_subscription_id),\n\tdata_bytes(_data_bytes),\n\tcontext(NULL),\n\tpublisher(NULL)\n{\n\tENTER();\n\n\tsetState(PIPELINE_STATE_INITIALIZED);\n\n\tEXIT();\n}\n\n/* public */\nPublisherPipeline::PublisherPipeline(const char *addr, const char *_subscription_id)\n:\tPublisherPipeline(DEFAULT_FRAME_SZ, addr, _subscription_id)\n{\n}\n\n/* public */\nPublisherPipeline::~PublisherPipeline() {\n\tENTER();\n\n\tLOGI(\"destructor finished\");\n\n\tEXIT();\n}\n\n/*public*/\nint PublisherPipeline::queueFrame(uvc_frame_t *frame) {\n//\tENTER();\n\n\tint result = AbstractBufferedPipeline::queueFrame(frame);\n\tchain_frame(frame);\n\n\treturn result; // \tRETURN(result, int);\n}\n\n//********************************************************************************\n//\n//********************************************************************************\n/**\n * build transfer header.\n * all multi bytes fields are little endian.\n */\nstatic void build_header(publish_header_t &header, uvc_frame_t *frame) {\n\t// build header\n\tswitch (frame->frame_format) {\n\tcase UVC_FRAME_FORMAT_YUYV:\n\t\theader.format_le = htole32(VIDEO_FRAME_FORMAT_YUYV);\n\t\tbreak;\n\tcase UVC_FRAME_FORMAT_MJPEG:\n\t\theader.format_le = htole32(VIDEO_FRAME_FORMAT_MJPEG);\n\t\tbreak;\n//\tcase UVC_FRAME_FORMAT_H264:\t// XXX this definition does not exist now\n//\t\theader.format_le = htole32(VIDEO_FRAME_FORMAT_H264);\n//\t\tbreak;\n\tdefault:\n\t\theader.format_le = htole32(VIDEO_FRAME_FORMAT_UNKNOWN);\n\t}\n\theader.width_le = htole32(frame->width);\n\theader.height_le = htole32(frame->height);\n\theader.sequence_le = htole32(frame->sequence);\n//\theader.presentation_time_us_le = htole64(systemTime() / 1000);\n\theader.presentation_time_us_le = htole64(nsecs_t(frame->capture_time.tv_sec)*1000000LL + nsecs_t(frame->capture_time.tv_usec));\n\theader.data_bytes_le = htole32(frame->actual_bytes);\n}\n\n/* override protected */\nvoid PublisherPipeline::on_start() {\n\tENTER();\n\n\tMutex::Autolock lock(publisher_mutex);\n\n\tcontext = new zmq::context_t();\n\tpublisher = new zmq::socket_t(*context, ZMQ_PAIR/*ZMQ_PUB*/);\n\tLOGV(\"set timeout value\");\n\tpublisher->setsockopt(ZMQ_SNDTIMEO, 1000);\n\tpublisher->setsockopt(ZMQ_LINGER, 100);\n\tLOGV(\"bind\");\n\tpublisher->bind(host.c_str());\n\n\tEXIT();\n}\n\n/* override protected */\nvoid PublisherPipeline::on_stop() {\n\tENTER();\n\n\tMutex::Autolock lock(publisher_mutex);\n\tLOGI(\"on_stop:finished\");\n\tLOGI(\"stop publisher zmq::socket\");\n\tif (publisher) {\n\t\tpublisher->close();\n\t\tSAFE_DELETE(publisher);\n\t}\n\tLOGI(\"stop publisher zmq::context\");\n\tif (context) {\n\t\tcontext->close();\n\t\tSAFE_DELETE(context);\n\t}\n\tLOGI(\"on_stop:finished\");\n\n\tEXIT();\n}\n\n/* override protected */\nint PublisherPipeline::handle_frame(uvc_frame_t *frame) {\n//\tENTER();\n\n\t// local cache\n\tconst int sub_sz = subscription_id.size();\n\tconst char *sub_str = subscription_id.c_str();\n//\tLOGD(\"sub_str=%s,sub_sz=%d\", sub_str, sub_sz);\n\n\tpublish_header_t header;\n\t// create payload\n\tzmq::message_t payload(frame->actual_bytes + sizeof(publish_header_t));\n\t// copy header to payload\n\tbuild_header(header, frame);\n\tmemcpy(payload.data(), &header, sizeof(publish_header_t));\n\t// copy frame data to payload\n\tmemcpy(((uint8_t *)payload.data()) + sizeof(publish_header_t), frame->data, frame->actual_bytes);\n/*\n* zmq::socket_t#send(backed by zmq_msg_send of libzmq) just add message to the internal queue.\n* and we can't know how many entries we can send without exceeding queue\n* and we also can't know when the queue exceed/overflow and message disappeared.\n* As my current test result, if the subscribing speed is slower than publisher\n* or bandwidth of network is not enough, zmq drops messages periodically without any error.\n* Even worse, queueing to zmq socket always success and no error.\n* As I can see the API and source code of zmq, there are no way to handle this now.\n* Only one way is receive number of subscribed frames from subscriber via other connection\n* and wait for publishing if the difference between number of publishing frames\n* and number of subscribed frames become bigger than the limit.\n* Unfortunately this way only works well if only one subscriber exist.\n* If we actually need to handle this issue, I assume it will be better to use other protocol\n* or make own protocol that supports handshake instead of using zmq.\n*\n* 1280x720p:\n* Nexus7(2013, Android5.1.1) => 11n(2.4GHz) => router => 11n(5Ghz) => Nexus9(Android5.1.1) : OK\n* Nexus7(2013, Android5.1.1) => 11n(2.4GHz) => router => 11n(2.4GHz) => GALAXY S5(Android5.0) : NG, slow, periodically drops frames.\n* Nexus9(Android5.1.1) => 11n(5GHz) => router => 11n(2.4GHz) => GALAXY S5(Android5.0) : OK\n* Nexus9(Android5.1.1) => 11n(5GHz) => router => 11n(2.4GHz) => MemoPad7(Android4.4.2) : NG, sometimes become slow, periodically drops frames.\n* GALAXY S5(Android5.0) => 11n(2.4GHz) => router => 11n(5Ghz) => Nexus9(Android5.1.1) : OK\n* GALAXY S5(Android5.0) => 11n(2.4GHz) => router => 11n(2.4Ghz) => GALAXY note2(Android4.4.2) : NG, slow, periodically drops frames.\n* saki\n*/\n\tfor ( ; LIKELY(isRunning()) ; ) {\n\t\ttry {\n\t\t\t// set subscribe id\n\t\t\tif ((LIKELY(publisher->send(sub_str, sub_sz, ZMQ_SNDMORE)))) {\n\t\t\t\t// send payload\n\t\t\t\tif (LIKELY(publisher->send(payload))) {\n\t\t\t\t\t// success to send\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tLOGD(\"failed to send\");\n\t\t\tusleep(RETRY_INTERVALS_US);\n\t\t} catch (zmq::error_t e) {\n\t\t\t// when error occur other than EAGAIN\n\t\t\tLOGW(\"failed to send:%d\", e.num());\n\t\t\tbreak;\n\t\t} catch (...) {\n\t\t\tLOGW(\"publishing error\");\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn 1; // RETURN(1, int);\n}\n\n//********************************************************************************\n//\n//********************************************************************************\nstatic ID_TYPE nativeCreate(JNIEnv *env, jobject thiz,\n\tjstring publisher_addr_str, jstring subscription_id_str) {\n\n\tENTER();\n\n\tconst char *c_addr = env->GetStringUTFChars(publisher_addr_str, JNI_FALSE);\n\tconst char *c_sub_id = env->GetStringUTFChars(subscription_id_str, JNI_FALSE);\n\tPublisherPipeline *pipeline = new PublisherPipeline(DEFAULT_FRAME_SZ, c_addr, c_sub_id);\n\tenv->ReleaseStringUTFChars(publisher_addr_str, c_addr);\n\tenv->ReleaseStringUTFChars(subscription_id_str, c_sub_id);\n\tsetField_long(env, thiz, \"mNativePtr\", reinterpret_cast<ID_TYPE>(pipeline));\n\n\tRETURN(reinterpret_cast<ID_TYPE>(pipeline), ID_TYPE);\n}\n\nstatic void nativeDestroy(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\tsetField_long(env, thiz, \"mNativePtr\", 0);\n\tPublisherPipeline *pipeline = reinterpret_cast<PublisherPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tpipeline->release();\n\t\tSAFE_DELETE(pipeline);\n\t}\n\tEXIT();\n}\n\nstatic jint nativeGetState(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\tjint result = 0;\n\tPublisherPipeline *pipeline = reinterpret_cast<PublisherPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tresult = pipeline->getState();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetPipeline(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline, jobject pipeline_obj) {\n\n\tENTER();\n\tjint result = JNI_ERR;\n\tPublisherPipeline *pipeline = reinterpret_cast<PublisherPipeline *>(id_pipeline);\n\tif (pipeline) {\n\t\tIPipeline *target_pipeline = getPipeline(env, pipeline_obj);\n\t\tresult = pipeline->setPipeline(target_pipeline);\n\t}\n\n\tRETURN(result, jint);\n}\n\nstatic jint nativeStart(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\n\tint result = JNI_ERR;\n\tPublisherPipeline *pipeline = reinterpret_cast<PublisherPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tresult = pipeline->start();\n\t}\n\n\tRETURN(result, jint);\n}\n\nstatic jint nativeStop(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\n\tjint result = JNI_ERR;\n\tPublisherPipeline *pipeline = reinterpret_cast<PublisherPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tresult = pipeline->stop();\n\t}\n\n\tRETURN(result, jint);\n}\n\n//================================================================================\nstatic JNINativeMethod methods_publisher_pipeline[] = {\n\t{ \"nativeCreate\", \t\t\"(Ljava/lang/String;Ljava/lang/String;)J\", (void *) nativeCreate},\n\t{ \"nativeDestroy\",\t\t\"(J)V\", (void *) nativeDestroy},\n\t{ \"nativeSetPipeline\",\t\"(JLcom/serenegiant/usb/IPipeline;)I\", (void *) nativeSetPipeline },\n\n\t{ \"nativeGetState\",\t\t\"(J)I\", (void *) nativeGetState },\n\t{ \"nativeStart\",\t\t\"(J)I\", (void *) nativeStart },\n\t{ \"nativeStop\",\t\t\t\"(J)I\", (void *) nativeStop },\n};\n\nint register_publisher_pipeline(JNIEnv *env) {\n\tLOGV(\"register PublisherPipeline:\");\n\tif (registerNativeMethods(env,\n\t\t\"com/serenegiant/usb/PublisherPipeline\",\n\t\tmethods_publisher_pipeline, NUM_ARRAY_ELEMENTS(methods_publisher_pipeline)) < 0) {\n\t\treturn -1;\n\t}\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/PublisherPipeline.h",
    "content": "//\n// Created by saki on 15/10/06.\n//\n\n#ifndef PUPILMOBILE_PUBLISHER_PIPELINE_H\n#define PUPILMOBILE_PUBLISHER_PIPELINE_H\n\n#pragma interface\n\n#include <string>\n#include \"Mutex.h\"\n#include \"Timers.h\"\n#include \"zmq.hpp\"\n\n#include \"pupilmobile_defs.h\"\n#include \"AbstractBufferedPipeline.h\"\n\nusing namespace android;\n\nclass PublisherPipeline : virtual public AbstractBufferedPipeline {\nprivate:\nprotected:\n\tconst std::string host;\n\tconst std::string subscription_id;\n\tsize_t data_bytes;\n\tzmq::context_t *context;\n\tzmq::socket_t *publisher;\n\tmutable Mutex publisher_mutex;\n\tvirtual void on_start();\n\tvirtual void on_stop();\n\tvirtual int handle_frame(uvc_frame_t *frame);\npublic:\n\tPublisherPipeline(const size_t &_data_bytes = DEFAULT_FRAME_SZ, const char *addr = NULL, const char *subscription_id = NULL);\n\tPublisherPipeline(const char *addr, const char *subscription_id);\n\tvirtual ~PublisherPipeline();\n\tvirtual int queueFrame(uvc_frame_t *frame);\n};\n\n#endif //PUPILMOBILE_PUBLISHER_PIPELINE_H\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/SQLiteBufferedPipeline.cpp",
    "content": "//\n// Created by saki on 15/11/09.\n//\n\n#if 1\t// set 1 if you don't need debug message\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// ignore LOGV/LOGD/MARK\n\t#endif\n\t#undef USE_LOGALL\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n\t#undef NDEBUG\t\t// depends on definition in Android.mk and Application.mk\n#endif\n\n#include <vector>\n\n#include \"utilbase.h\"\n#include \"common_utils.h\"\n\n#include \"libUVCCamera.h\"\n#include \"pipeline_helper.h\"\n#include \"IPipeline.h\"\n#include \"Timers.h\"\n#include \"SQLiteBufferedPipeline.h\"\n\n#define CHECK_INTERVAL_NSEC 5000000000LL\t// every 5sec\n#define TABLE_NAME \"backend\"\n#define INSERT_FIELDS \"dtime, format, width, height, sequence, data_bytes, data\"\n#define ALL_FIELDS \"id, dtime, format, width, height, sequence, data_bytes, data\"\n\n/*public*/\nSQLiteBufferedPipeline::SQLiteBufferedPipeline(const char *database_name, const bool &clear_table)\n:\tIPipeline(0),db(NULL),\n\tsql_insert_one(NULL),\n\tsql_query_oldest_10(NULL),\n\tsql_delete_one(NULL),\n\tsql_delete_older(NULL),\n\tsql_count(NULL)\n{\n\tENTER();\n\n\tdb = new sqlite3pp::database(database_name);\n\t// 0:id, 1:dtime, 2:format, 3:width, 4:height, 5:sequence, 6:data_bytes, 7:data\n\tsqlite3pp::command cmd(*db,\n\t\t\"CREATE TABLE IF NOT EXISTS \" TABLE_NAME \" (\"\n\t    \"id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, \"\n\t\t\"dtime INTEGER NOT NULL UNIQUE, \"\n\t\t\"format INTEGER NOT NULL, \"\n\t\t\"width INTEGER NOT NULL, \"\n\t\t\"height INTEGER NOT NULL, \"\n\t\t\"sequence INTEGER NOT NULL, \"\n\t\t\"data_bytes INTEGER NOT NULL, \"\n\t\t\"data BLOB NOT NULL\"\n\t\t\");\"\n\t);\n\tcmd.execute();\n\n\tif (clear_table) {\n\t\tclear();\n\t}\n\t// sqlite3pp::statement and it's descendants that accessing table can only create when the specific table already exists.\n\tsql_insert_one = new sqlite3pp::command(*db, \"INSERT INTO \" TABLE_NAME\n\t\t\" (\" INSERT_FIELDS \") VALUES (?, ?, ?, ?, ?, ?, ?);\");\n\tsql_query_oldest_10 = new sqlite3pp::query(*db, \"SELECT \" ALL_FIELDS \" FROM \" TABLE_NAME \" ORDER BY dtime LIMIT 10;\");\n\tsql_delete_one = new sqlite3pp::command(*db, \"DELETE FROM \" TABLE_NAME \" WHERE (id=?);\");\n\tsql_delete_older = new sqlite3pp::command(*db, \"DELETE FROM \" TABLE_NAME \" WHERE (dtime<?);\");\n\tsql_count = new sqlite3pp::query(*db, \"SELECT count(id) FROM \" TABLE_NAME \";\");\n\n\tsetState(PIPELINE_STATE_INITIALIZED);\n\tEXIT();\n}\n\n/*public*/\nSQLiteBufferedPipeline::~SQLiteBufferedPipeline() {\n\tENTER();\n\n\tLOGD(\"deleting sql_count\");\n\tif (sql_count) {\n\t\tsql_count->finish();\n\t\tSAFE_DELETE(sql_count);\n\t}\n\tLOGD(\"deleting sql_delete_older\");\n\tif (sql_delete_older) {\n\t\tsql_delete_older->finish();\n\t\tSAFE_DELETE(sql_delete_older);\n\t}\n\tLOGD(\"deleting sql_delete_one\");\n\tif (sql_delete_one) {\n\t\tsql_delete_one->finish();\n\t\tSAFE_DELETE(sql_delete_one);\n\t}\n\tLOGD(\"deleting sql_query_oldest_10\");\n\tif (sql_query_oldest_10) {\n\t\tsql_query_oldest_10->finish();\n\t\tSAFE_DELETE(sql_query_oldest_10);\n\t}\n\tLOGD(\"deleting sql_insert_one\");\n\tif (sql_insert_one) {\n\t\tsql_insert_one->finish();\n\t\tSAFE_DELETE(sql_insert_one);\n\t}\n\tLOGD(\"deleting db\");\n\tif (db) {\n\t\tdb->disconnect();\n\t\tSAFE_DELETE(db);\n\t}\n\n\tEXIT();\n};\n\n/*public*/\nint SQLiteBufferedPipeline::release() {\n\tENTER();\n\n\tsetState(PIPELINE_STATE_RELEASING);\n\tstop();\n\n\tRETURN(0, int);\n}\n\n/*public*/\nint SQLiteBufferedPipeline::start() {\n\tENTER();\n\n\tint result = EXIT_FAILURE;\n\tif (!isRunning()) {\n\t\tLOGD(\"start handler thread\");\n\t\tsetState(PIPELINE_STATE_STARTING);\n\t\tmIsRunning = true;\n\t\tresult = pthread_create(&handler_thread, NULL, handler_thread_func, (void *) this);\n\t\tif (UNLIKELY(result != EXIT_SUCCESS)) {\n\t\t\tLOGW(\"PublisherPipeline::already running/could not create thread etc.\");\n\t\t\tsetState(PIPELINE_STATE_INITIALIZED);\n\t\t\tmIsRunning = false;\n\t\t\thandler_sync.signal();\n\t\t}\n\t}\n\tRETURN(result, int);\n}\n\n/*public*/\nint SQLiteBufferedPipeline::stop() {\n\tENTER();\n\tbool b = isRunning();\n\tif (LIKELY(b)) {\n\t\tLOGD(\"waiting SQLiteBufferedPipeline thread\");\n\t\tsetState(PIPELINE_STATE_STOPPING);\n\t\tmIsRunning = false;\n\t\thandler_sync.broadcast();\n\t\tif (pthread_join(handler_thread, NULL) != EXIT_SUCCESS) {\n\t\t\tLOGW(\"SQLiteBufferedPipeline::terminate SQLiteBufferedPipeline thread: pthread_join failed\");\n\t\t}\n\t\tLOGD(\"SQLiteBufferedPipeline thread finished\");\n\t}\n\tRETURN(0, int);\n}\n\n/*public*/\nint SQLiteBufferedPipeline::queueFrame(uvc_frame_t *frame) {\n\tENTER();\n\n\tuvc_error_t ret = UVC_ERROR_OTHER;\n\tMutex::Autolock lock(handler_mutex);\n\n\tif (LIKELY(frame && isRunning())) {\n\t\t// FIXME if the number of record exceeds specific limit, need to delete old records or drop newer frames\n\t\t// FIXME otherwise device storage will become empty at some point.\n\t\ttry {\n\t\t\tsql_insert_one->reset();\n\t\t\tsql_insert_one->bind(1, nsecs_t(frame->capture_time.tv_sec) * 1000000LL +\n\t\t\t\t\t\t\t\tnsecs_t(frame->capture_time.tv_usec));\n\t\t\tsql_insert_one->bind(2, (int) frame->frame_format);\n\t\t\tsql_insert_one->bind(3, (int) frame->width);\n\t\t\tsql_insert_one->bind(4, (int) frame->height);\n\t\t\tsql_insert_one->bind(5, (int) frame->sequence);\n\t\t\tsql_insert_one->bind(6, (int) frame->actual_bytes);\n\t\t\tsql_insert_one->bind(7, (void *) frame->data, frame->actual_bytes, false);\n\t\t\tsql_insert_one->execute();\n\t\t\tret = UVC_SUCCESS;\n\t\t} catch (...) {\n\t\t\tLOGW(\"failed insert frame\");\n\t\t}\n\t\thandler_sync.broadcast();\n\t}\n\n\tRETURN(ret, int);\n}\n\n/*public*/\nvoid SQLiteBufferedPipeline::clear() {\n\tENTER();\n\n\tsqlite3pp::command sql_truncate(*db, \"TRUNCATE TABLE \" TABLE_NAME \";\");\n\tsql_truncate.execute();\n\n\tEXIT();\n}\n\n/**\n * delete record(s) older than specific dtime.\n * if you want to delete all record(s), use clear instead\n */\n/*protected*/\nint SQLiteBufferedPipeline::delete_older(const nsecs_t &dtime) {\n\tENTER();\n\n#ifndef NDEBUG\n\tLOGI(\"before=%d\", getCount());\n#endif\n\tint result = -1;\n\ttry {\n\t\tsql_delete_older->reset();\n\t\tsql_delete_older->bind(1, dtime);\n\t\tsql_delete_older->execute();\n\t\tresult = 0;\n\t} catch (...) {\n\t\tLOGW(\"failed to delete older:%lld\", dtime);\n\t}\n\n#ifndef NDEBUG\n\tLOGI(\"after=%d\", getCount());\n#endif\n\n\tRETURN(result, int);\n}\n\n/*protected*/\nint SQLiteBufferedPipeline::purge_older(const nsecs_t &limit_rel_nsec) {\n\tENTER();\n\n\tint result = -1;\n\n\tif (LIKELY(limit_rel_nsec)) {\n\t\tresult = delete_older(systemTime() - limit_rel_nsec);\n\t}\n\n\tRETURN(result, int);\n}\n\nint SQLiteBufferedPipeline::getCount() {\n\tENTER();\n\n\tint result = 0;\n\tif (LIKELY(sql_count)) {\n\t\tsql_count->reset();\n\t\tfor (auto iter = sql_count->begin(); iter != sql_count->end(); ++iter) {\n\t\t\tresult = (*iter).get<int>(0);\n\t\t\tbreak;\t// sql_count statement always return only one record and this will s redundant.\n\t\t}\n\t}\n\n\tRETURN(result, int);\n}\n\n/*private*/\nvoid *SQLiteBufferedPipeline::handler_thread_func(void *vptr_args) {\n\n\tENTER();\n\tSQLiteBufferedPipeline *pipeline = reinterpret_cast<SQLiteBufferedPipeline *>(vptr_args);\n\tif (LIKELY(pipeline)) {\n\t\tpipeline->do_loop();\n\t}\n\tPRE_EXIT();\n\tpthread_exit(NULL);\n}\n\n/*private*/\nvoid SQLiteBufferedPipeline::do_loop() {\n\tENTER();\n\n\tstd::vector<int> queued_ids;\n\tstruct timespec ts, ws;\n\tts.tv_sec = 5; ts.tv_nsec = 0;\t// wait maximum 5 sec\n//\tws.tv_sec = 0; ws.tv_nsec = 3000000;\t// 3msec\n\tuvc_frame_t *frame = uvc_allocate_frame(DEFAULT_FRAME_SZ);\n\tif (LIKELY(frame)) {\n\t\tsetState(PIPELINE_STATE_RUNNING);\n\t\tnsecs_t prev_time = systemTime();\n\t\tfor (; LIKELY(isRunning());) {\n\t\t\thandler_mutex.lock();\n\t\t\t{\n\t\t\t\t// wait for new arriving frame data\n\t\t\t\thandler_sync.waitRelative(handler_mutex, 3000000);\n\t\t\t}\n\t\t\thandler_mutex.unlock();\n\n\t\t\tif (LIKELY(isRunning())) {\n\n\t\t\t\tif (next_pipeline) {\n\t\t\t\t\tqueued_ids.clear();\n\t\t\t\t\tfor (auto iter = sql_query_oldest_10->begin(); iter != sql_query_oldest_10->end(); ++iter) {\n\t\t\t\t\t\tif (UNLIKELY(!isRunning())) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// 0:id, 1:dtime, 2:format, 3:width, 4:height, 5:sequence, 6:data_bytes, 7:data\n\t\t\t\t\t\tconst int64_t id = (*iter).get<int64_t>(0);\t// XXX int64_t(long long int) may be better\n\t\t\t\t\t\tconst nsecs_t dtime = (*iter).get <nsecs_t> (1);\n\t\t\t\t\t\tconst uvc_frame_format format = (uvc_frame_format)(*iter).get<int>(2);\n\t\t\t\t\t\tconst uint32_t width = (uint32_t)(*iter).get<int>(3);\n\t\t\t\t\t\tconst uint32_t height = (uint32_t)(*iter).get<int>(4);\n\t\t\t\t\t\tconst uint32_t sequence = (uint32_t)((*iter).get <int> (5));\n\t\t\t\t\t\tconst size_t actual_bytes = (size_t)(*iter).get<int>(6);\n\t\t\t\t\t\tconst void *data = (*iter).get<const void *>(7);\n\t\t\t\t\t\tif (LIKELY(!uvc_ensure_frame_size(frame, actual_bytes))) {\n\t\t\t\t\t\t\tframe->capture_time.tv_sec = dtime / 1000000LL;\n\t\t\t\t\t\t\tframe->capture_time.tv_usec = dtime % 1000000LL;\n\t\t\t\t\t\t\tframe->frame_format = format;\n\t\t\t\t\t\t\tframe->width = width;\n\t\t\t\t\t\t\tframe->height = height;\n\t\t\t\t\t\t\tframe->sequence = sequence;\n\t\t\t\t\t\t\tframe->actual_bytes = actual_bytes;\n\t\t\t\t\t\t\tmemcpy(frame->data, data, actual_bytes);\n\t\t\t\t\t\t\tif (!chain_frame(frame)) {\n\t\t\t\t\t\t\t\t// if queueing success, delete the record\n\t\t\t\t\t\t\t\tqueued_ids.push_back(id);\n//\t\t\t\t\t\t\t\tLOGI(\"chain_frame:%lld,%lld,(%d,%d),actual_bytes=%d\", id, dtime, width, height, actual_bytes);\n\t\t\t\t\t\t\t\tif (iter != sql_query_oldest_10->end()) {\n\t\t\t\t\t\t\t\t\t// wait several msecs here if the record is not a last one, otherwise after pipeline will exceed buffer and drop frame(s)\n\t\t\t\t\t\t\t\t\thandler_mutex.lock();\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\thandler_sync.waitRelative(handler_mutex, 5000000000L);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\thandler_mutex.unlock();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tLOGW(\"uvc_ensure_frame_size failed:%lld,%lld,(%d,%d),actual_bytes=%d\", id, dtime, width, height, actual_bytes);\n\t\t\t\t\t\t}\n\t\t\t\t\t} // end of for\n\t\t\t\t\t// delete chained record(s) if exist\n\t\t\t\t\tsqlite3pp::transaction xct(*db);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfor (auto iter = queued_ids.begin(); iter != queued_ids.end(); iter++) {\n\t\t\t\t\t\t\tsql_delete_one->reset();\n\t\t\t\t\t\t\tsql_delete_one->bind(1, *iter);\n\t\t\t\t\t\t\tsql_delete_one->execute();\n\t\t\t\t\t\t}\n\t\t\t\t\t\txct.commit();\n\t\t\t\t\t} catch (std::exception &e) {\n\t\t\t\t\t\tLOGI(\"exception: failed to delate\");\n\t\t\t\t\t\txct.rollback();    // this may redundant\n\t\t\t\t\t}\n\t\t\t\t} // end of if (next_pipeline)\n\t\t\t\tif (UNLIKELY(systemTime() > prev_time + CHECK_INTERVAL_NSEC)) {\n\t\t\t\t\tprev_time = systemTime();\n\t\t\t\t\tpurge_older();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsetState(PIPELINE_STATE_STOPPING);\n\t\tuvc_free_frame(frame);\n\t} else {\n\t\tLOGW(\"uvc_allocate_frame failed\");\n\t}\n\tsetState(PIPELINE_STATE_INITIALIZED);\n\tmIsRunning = false;\n\n\tEXIT();\n}\n\n//********************************************************************************\n//\n//********************************************************************************\nstatic ID_TYPE nativeCreate(JNIEnv *env, jobject thiz,\n\tjstring database_path_str, jboolean clear_table) {\n\n\tENTER();\n\n\tconst char *c_database_path = env->GetStringUTFChars(database_path_str, JNI_FALSE);\n\tSQLiteBufferedPipeline *pipeline = NULL;\n\ttry {\n\t\tpipeline = new SQLiteBufferedPipeline(c_database_path, clear_table);\n\t} catch (...) {\n\t\tLOGW(\"failed to create SQLiteBufferedPipeline\");\n\t}\n\tenv->ReleaseStringUTFChars(database_path_str, c_database_path);\n\n\tsetField_long(env, thiz, \"mNativePtr\", reinterpret_cast<ID_TYPE>(pipeline));\n\tRETURN(reinterpret_cast<ID_TYPE>(pipeline), ID_TYPE);\n}\n\nstatic void nativeDestroy(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\tsetField_long(env, thiz, \"mNativePtr\", 0);\n\tSQLiteBufferedPipeline *pipeline = reinterpret_cast<SQLiteBufferedPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tpipeline->release();\n\t\tSAFE_DELETE(pipeline);\n\t}\n\tEXIT();\n}\n\nstatic jint nativeGetState(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\tjint result = 0;\n\tSQLiteBufferedPipeline *pipeline = reinterpret_cast<SQLiteBufferedPipeline *>(id_pipeline);\n\tif (pipeline) {\n\t\tresult = pipeline->getState();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetPipeline(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline, jobject pipeline_obj) {\n\n\tENTER();\n\tjint result = JNI_ERR;\n\tSQLiteBufferedPipeline *pipeline = reinterpret_cast<SQLiteBufferedPipeline *>(id_pipeline);\n\tif (pipeline) {\n\t\tIPipeline *target_pipeline = getPipeline(env, pipeline_obj);\n\t\tresult = pipeline->setPipeline(target_pipeline);\n\t}\n\n\tRETURN(result, jint);\n}\n\nstatic jint nativeStart(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\n\tint result = JNI_ERR;\n\tSQLiteBufferedPipeline *pipeline = reinterpret_cast<SQLiteBufferedPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tresult = pipeline->start();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeStop(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tSQLiteBufferedPipeline *pipeline = reinterpret_cast<SQLiteBufferedPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tresult = pipeline->stop();\n\t}\n\tRETURN(result, jint);\n}\n\n//**********************************************************************\n//\n//**********************************************************************\nstatic JNINativeMethod methods[] = {\n\t{\"nativeCreate\", \"(Ljava/lang/String;Z)J\", (void *) nativeCreate},\n\t{ \"nativeDestroy\",\t\t\t\t\t\"(J)V\", (void *) nativeDestroy },\n\n\t{ \"nativeGetState\",\t\t\t\t\t\"(J)I\", (void *) nativeGetState },\n\t{ \"nativeSetPipeline\",\t\t\t\t\"(JLcom/serenegiant/usb/IPipeline;)I\", (void *) nativeSetPipeline },\n\n\t{ \"nativeStart\",\t\t\t\t\t\"(J)I\", (void *) nativeStart },\n\t{ \"nativeStop\",\t\t\t\t\t\t\"(J)I\", (void *) nativeStop },\n\n};\n\nint register_sqlite_buffered_pipeline(JNIEnv *env) {\n\tLOGV(\"register PublisherPipeline:\");\n\tif (registerNativeMethods(env,\n\t\t\"com/serenegiant/usb/SQLiteBufferedPipeline\",\n\t\tmethods, NUM_ARRAY_ELEMENTS(methods)) < 0) {\n\t\treturn -1;\n\t}\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/SQLiteBufferedPipeline.h",
    "content": "//\n// Created by saki on 15/11/09.\n//\n\n#ifndef PUPILMOBILE_SQLITEBUFFEREDPIPELINE_H\n#define PUPILMOBILE_SQLITEBUFFEREDPIPELINE_H\n\n#include <stdlib.h>\n#include <pthread.h>\n#include <list>\n#include <string>\n#include \"Mutex.h\"\n#include \"Condition.h\"\n\n#include \"libUVCCamera.h\"\n#include \"IPipeline.h\"\n#include \"sqlite3pp.h\"\n\n#pragma interface\n\nusing namespace android;\n\n#define DTIME_LIMIT_NSEC 30000000000LL\t\t// 30sec\n\nclass SQLiteBufferedPipeline : virtual public IPipeline {\nprivate:\n\tsqlite3pp::database *db;\n\t// precompile statements\n\tsqlite3pp::command *sql_insert_one;\n\tsqlite3pp::query *sql_query_oldest_10;\n\tsqlite3pp::command *sql_delete_one;\n\tsqlite3pp::command *sql_delete_older;\n\tsqlite3pp::query *sql_count;\n\n\tpthread_t handler_thread;\n\tmutable Mutex handler_mutex;\n\tCondition handler_sync;\n\tstatic void *handler_thread_func(void *vptr_args);\n\tvoid do_loop();\nprotected:\n\tint getCount();\n\t/**\n\t * delete record(s) older than specific dtime.\n\t * if you want to delete all record(s), use clear instead\n\t */\n\tint delete_older(const nsecs_t &dtime);\n\t/** helper of delete_older */\n\tint purge_older(const nsecs_t &limit_rel_nsec = DTIME_LIMIT_NSEC);\npublic:\n\tSQLiteBufferedPipeline(const char *database_name, const bool &clear = false);\n\tvirtual ~SQLiteBufferedPipeline();\n\tvirtual int release();\n\tvirtual int start();\n\tvirtual int stop();\n\tvirtual int queueFrame(uvc_frame_t *frame);\n\tvirtual void clear();\n};\n\n\n#endif //PUPILMOBILE_SQLITEBUFFEREDPIPELINE_H\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/SimpleBufferedPipeline.cpp",
    "content": "//\n// Created by saki on 15/11/23.\n//\n\n#include \"utilbase.h\"\n#include \"common_utils.h\"\n\n#include \"libUVCCamera.h\"\n#include \"pipeline_helper.h\"\n#include \"IPipeline.h\"\n#include \"SimpleBufferedPipeline.h\"\n\nSimpleBufferedPipeline::SimpleBufferedPipeline(const int &_max_buffer_num, const int &init_pool_num,\n\t\tconst size_t &default_frame_size, const bool &drop_frames_when_buffer_empty)\n:\tAbstractBufferedPipeline(_max_buffer_num, init_pool_num, default_frame_size, drop_frames_when_buffer_empty)\n{\n\tENTER();\n\n\tsetState(PIPELINE_STATE_INITIALIZED);\n\n\tEXIT();\n}\n\nSimpleBufferedPipeline::~SimpleBufferedPipeline() {\n\tENTER();\n\tEXIT();\n}\n\nvoid SimpleBufferedPipeline::on_start() {\n\tENTER();\n\tEXIT();\n}\n\nvoid SimpleBufferedPipeline::on_stop() {\n\tENTER();\n\tEXIT();\n}\n\nint SimpleBufferedPipeline::handle_frame(uvc_frame_t *frame) {\n\tENTER();\n\n\tRETURN(0, int);\n}\n\n//**********************************************************************\n//\n//**********************************************************************\nstatic ID_TYPE nativeCreate(JNIEnv *env, jobject thiz) {\n\n\tENTER();\n\tSimpleBufferedPipeline *pipeline = new SimpleBufferedPipeline();\n\tsetField_long(env, thiz, \"mNativePtr\", reinterpret_cast<ID_TYPE>(pipeline));\n\tRETURN(reinterpret_cast<ID_TYPE>(pipeline), ID_TYPE);\n}\n\nstatic void nativeDestroy(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\tsetField_long(env, thiz, \"mNativePtr\", 0);\n\tSimpleBufferedPipeline *pipeline = reinterpret_cast<SimpleBufferedPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tpipeline->release();\n\t\tSAFE_DELETE(pipeline);\n\t}\n\tEXIT();\n}\n\nstatic jint nativeGetState(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\tjint result = 0;\n\tSimpleBufferedPipeline *pipeline = reinterpret_cast<SimpleBufferedPipeline *>(id_pipeline);\n\tif (pipeline) {\n\t\tresult = pipeline->getState();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetPipeline(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline, jobject pipeline_obj) {\n\n\tENTER();\n\tjint result = JNI_ERR;\n\tSimpleBufferedPipeline *pipeline = reinterpret_cast<SimpleBufferedPipeline *>(id_pipeline);\n\tif (pipeline) {\n\t\tIPipeline *target_pipeline = getPipeline(env, pipeline_obj);\n\t\tresult = pipeline->setPipeline(target_pipeline);\n\t}\n\n\tRETURN(result, jint);\n}\n\nstatic jint nativeStart(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tENTER();\n\n\tint result = JNI_ERR;\n\tSimpleBufferedPipeline *pipeline = reinterpret_cast<SimpleBufferedPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tresult = pipeline->start();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeStop(JNIEnv *env, jobject thiz,\n\tID_TYPE id_pipeline) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tSimpleBufferedPipeline *pipeline = reinterpret_cast<SimpleBufferedPipeline *>(id_pipeline);\n\tif (LIKELY(pipeline)) {\n\t\tresult = pipeline->stop();\n\t}\n\tRETURN(result, jint);\n}\n\n//**********************************************************************\n//\n//**********************************************************************\nstatic JNINativeMethod methods[] = {\n\t{ \"nativeCreate\",\t\t\t\t\t\"()J\", (void *) nativeCreate },\n\t{ \"nativeDestroy\",\t\t\t\t\t\"(J)V\", (void *) nativeDestroy },\n\n\t{ \"nativeGetState\",\t\t\t\t\t\"(J)I\", (void *) nativeGetState },\n\t{ \"nativeSetPipeline\",\t\t\t\t\"(JLcom/serenegiant/usb/IPipeline;)I\", (void *) nativeSetPipeline },\n\n\t{ \"nativeStart\",\t\t\t\t\t\"(J)I\", (void *) nativeStart },\n\t{ \"nativeStop\",\t\t\t\t\t\t\"(J)I\", (void *) nativeStop },\n};\n\nint register_simple_buffered_pipeline(JNIEnv *env) {\n\tLOGV(\"register_simple_buffered_pipeline:\");\n\tif (registerNativeMethods(env,\n\t\t\"com/serenegiant/usb/SimpleBufferedPipeline\",\n\t\tmethods, NUM_ARRAY_ELEMENTS(methods)) < 0) {\n\t\treturn -1;\n\t}\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/SimpleBufferedPipeline.h",
    "content": "//\n// Created by saki on 15/11/23.\n//\n\n#ifndef PUPILMOBILE_SIMPLEBUFFEREDPIPELINE_H\n#define PUPILMOBILE_SIMPLEBUFFEREDPIPELINE_H\n\n#include \"AbstractBufferedPipeline.h\"\n\nclass SimpleBufferedPipeline : virtual public AbstractBufferedPipeline {\nprotected:\n\tvirtual void on_start();\n\tvirtual void on_stop();\n\tvirtual int handle_frame(uvc_frame_t *frame);\npublic:\n\tSimpleBufferedPipeline(const int &_max_buffer_num = DEFAULT_MAX_FRAME_NUM, const int &init_pool_num = DEFAULT_INIT_FRAME_POOL_SZ,\n\t\t\tconst size_t &default_frame_size = DEFAULT_FRAME_SZ, const bool &drop_frames_when_buffer_empty = true);\n\tvirtual ~SimpleBufferedPipeline();\n};\n\n\n#endif //PUPILMOBILE_SIMPLEBUFFEREDPIPELINE_H\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/pipeline_helper.cpp",
    "content": "//\n// Created by saki on 15/11/12.\n//\n\n#include \"utilbase.h\"\n#include \"Timers.h\"\n#include \"SimpleBufferedPipeline.h\"\n#include \"SQLiteBufferedPipeline.h\"\n#include \"UVCCameraControl.h\"\n#include \"CallbackPipeline.h\"\n#include \"ConvertPipeline.h\"\n#include \"PreviewPipeline.h\"\n#include \"PublisherPipeline.h\"\n#include \"DistributePipeline.h\"\n#include \"pipeline_helper.h\"\n\nIPipeline *getPipeline(JNIEnv *env, jobject pipeline_obj) {\n\tENTER();\n\n\tif (!pipeline_obj) return NULL;\n\tID_TYPE id_pipeline = getField_long(env, pipeline_obj, \"mNativePtr\");\n\tjint type = getField_int(env, pipeline_obj, \"mType\");\n\tenv->ExceptionClear();\n\tIPipeline *result = NULL;\n\tswitch (type) {\n\t\tcase PIPELINE_TYPE_SIMPLE_BUFFERED:\n\t\t\tresult = reinterpret_cast<SimpleBufferedPipeline *>(id_pipeline);\n\t\t\tbreak;\n\t\tcase PIPELINE_TYPE_SQLITE_BUFFERED:\n\t\t\tresult = reinterpret_cast<SQLiteBufferedPipeline *>(id_pipeline);\n\t\t\tbreak;\n\t\tcase PIPELINE_TYPE_UVC_CONTROL:\n\t\t\tresult = reinterpret_cast<UVCCameraControl *>(id_pipeline);\n\t\t\tbreak;\n\t\tcase PIPELINE_TYPE_CALLBACK:\n\t\t\tresult = reinterpret_cast<CallbackPipeline *>(id_pipeline);\n\t\t\tbreak;\n\t\tcase PIPELINE_TYPE_CONVERT:\n\t\t\tresult = reinterpret_cast<ConvertPipeline *>(id_pipeline);\n\t\t\tbreak;\n\t\tcase PIPELINE_TYPE_PREVIEW:\n\t\t\tresult = reinterpret_cast<PreviewPipeline *>(id_pipeline);\n\t\t\tbreak;\n\t\tcase PIPELINE_TYPE_PUBLISHER:\n\t\t\tresult = reinterpret_cast<PublisherPipeline *>(id_pipeline);\n\t\t\tbreak;\n\t\tcase PIPELINE_TYPE_DISTRIBUTE:\n\t\t\tresult = reinterpret_cast<DistributePipeline *>(id_pipeline);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tresult = NULL;\n\t\t\tbreak;\n\t}\n\n\tRETURN(result, IPipeline *);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/pipeline/pipeline_helper.h",
    "content": "//\n// Created by saki on 15/11/12.\n//\n\n#ifndef PUPILMOBILE_PIPELINE_HELPER_H_H\n#define PUPILMOBILE_PIPELINE_HELPER_H_H\n\n#include \"common_utils.h\"\n\n#include \"IPipeline.h\"\n\nIPipeline *getPipeline(JNIEnv *env, jobject pipeline_obj);\n\n#endif //PUPILMOBILE_PIPELINE_HELPER_H_H\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/serenegiant_usb_UVCCamera.cpp",
    "content": "/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n * File name: serenegiant_usb_UVCCamera.cpp\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n*/\n\n#if 1\t// デバッグ情報を出さない時\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// LOGV/LOGD/MARKを出力しない時\n\t\t#endif\n\t#undef USE_LOGALL\t\t\t// 指定したLOGxだけを出力\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n\t#undef NDEBUG\n#endif\n\n#include <jni.h>\n#include <android/native_window_jni.h>\n\n#include \"libUVCCamera.h\"\n#include \"UVCCamera.h\"\n\n/**\n * set the value into the long field\n * @param env: this param should not be null\n * @param bullet_obj: this param should not be null\n * @param field_name\n * @params val\n */\nstatic jlong setField_long(JNIEnv *env, jobject java_obj, const char *field_name, jlong val) {\n#if LOCAL_DEBUG\n\tLOGV(\"setField_long:\");\n#endif\n\n\tjclass clazz = env->GetObjectClass(java_obj);\n\tjfieldID field = env->GetFieldID(clazz, field_name, \"J\");\n\tif (LIKELY(field))\n\t\tenv->SetLongField(java_obj, field, val);\n\telse {\n\t\tLOGE(\"__setField_long:field '%s' not found\", field_name);\n\t}\n#ifdef ANDROID_NDK\n\tenv->DeleteLocalRef(clazz);\n#endif\n\treturn val;\n}\n\n/**\n * @param env: this param should not be null\n * @param bullet_obj: this param should not be null\n */\nstatic jlong __setField_long(JNIEnv *env, jobject java_obj, jclass clazz, const char *field_name, jlong val) {\n#if LOCAL_DEBUG\n\tLOGV(\"__setField_long:\");\n#endif\n\n\tjfieldID field = env->GetFieldID(clazz, field_name, \"J\");\n\tif (LIKELY(field))\n\t\tenv->SetLongField(java_obj, field, val);\n\telse {\n\t\tLOGE(\"__setField_long:field '%s' not found\", field_name);\n\t}\n\treturn val;\n}\n\n/**\n * @param env: this param should not be null\n * @param bullet_obj: this param should not be null\n */\njint __setField_int(JNIEnv *env, jobject java_obj, jclass clazz, const char *field_name, jint val) {\n\tLOGV(\"__setField_int:\");\n\n\tjfieldID id = env->GetFieldID(clazz, field_name, \"I\");\n\tif (LIKELY(id))\n\t\tenv->SetIntField(java_obj, id, val);\n\telse {\n\t\tLOGE(\"__setField_int:field '%s' not found\", field_name);\n\t\tenv->ExceptionClear();\t// clear java.lang.NoSuchFieldError exception\n\t}\n\treturn val;\n}\n\n/**\n * set the value into int field\n * @param env: this param should not be null\n * @param java_obj: this param should not be null\n * @param field_name\n * @params val\n */\njint setField_int(JNIEnv *env, jobject java_obj, const char *field_name, jint val) {\n\tLOGV(\"setField_int:\");\n\n\tjclass clazz = env->GetObjectClass(java_obj);\n\t__setField_int(env, java_obj, clazz, field_name, val);\n#ifdef ANDROID_NDK\n\tenv->DeleteLocalRef(clazz);\n#endif\n\treturn val;\n}\n\nstatic ID_TYPE nativeCreate(JNIEnv *env, jobject thiz) {\n\n\tENTER();\n\tUVCCamera *camera = new UVCCamera();\n\tsetField_long(env, thiz, \"mNativePtr\", reinterpret_cast<ID_TYPE>(camera));\n\tRETURN(reinterpret_cast<ID_TYPE>(camera), ID_TYPE);\n}\n\n// native側のカメラオブジェクトを破棄\nstatic void nativeDestroy(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tENTER();\n\tsetField_long(env, thiz, \"mNativePtr\", 0);\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tSAFE_DELETE(camera);\n\t}\n\tEXIT();\n}\n\n//======================================================================\n// カメラへ接続\nstatic jint nativeConnect(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera,\n\tjint vid, jint pid, jint fd,\n\tjint busNum, jint devAddr, jstring usbfs_str) {\n\n\tENTER();\n\tint result = JNI_ERR;\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tconst char *c_usbfs = env->GetStringUTFChars(usbfs_str, JNI_FALSE);\n\tif (LIKELY(camera && (fd > 0))) {\n//\t\tlibusb_set_debug(NULL, LIBUSB_LOG_LEVEL_DEBUG);\n\t\tresult =  camera->connect(vid, pid, fd, busNum, devAddr, c_usbfs);\n\t}\n\tenv->ReleaseStringUTFChars(usbfs_str, c_usbfs);\n\tRETURN(result, jint);\n}\n\n// カメラとの接続を解除\nstatic jint nativeRelease(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tENTER();\n\tint result = JNI_ERR;\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->release();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\nstatic jint nativeSetStatusCallback(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jobject jIStatusCallback) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tjobject status_callback_obj = env->NewGlobalRef(jIStatusCallback);\n\t\tresult = camera->setStatusCallback(env, status_callback_obj);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetButtonCallback(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jobject jIButtonCallback) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tjobject button_callback_obj = env->NewGlobalRef(jIButtonCallback);\n\t\tresult = camera->setButtonCallback(env, button_callback_obj);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jobject nativeGetSupportedSize(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tENTER();\n\tjstring result = NULL;\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tchar *c_str = camera->getSupportedSize();\n\t\tif (LIKELY(c_str)) {\n\t\t\tresult = env->NewStringUTF(c_str);\n\t\t\tfree(c_str);\n\t\t}\n\t}\n\tRETURN(result, jobject);\n}\n\n//======================================================================\n// プレビュー画面の大きさをセット\nstatic jint nativeSetPreviewSize(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint width, jint height, jint min_fps, jint max_fps, jint mode, jfloat bandwidth) {\n\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\treturn camera->setPreviewSize(width, height, min_fps, max_fps, mode, bandwidth);\n\t}\n\tRETURN(JNI_ERR, jint);\n}\n\nstatic jint nativeStartPreview(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\treturn camera->startPreview();\n\t}\n\tRETURN(JNI_ERR, jint);\n}\n\n// プレビューを停止\nstatic jint nativeStopPreview(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->stopPreview();\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetPreviewDisplay(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jobject jSurface) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tANativeWindow *preview_window = jSurface ? ANativeWindow_fromSurface(env, jSurface) : NULL;\n\t\tresult = camera->setPreviewDisplay(preview_window);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetFrameCallback(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jobject jIFrameCallback, jint pixel_format) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tjobject frame_callback_obj = env->NewGlobalRef(jIFrameCallback);\n\t\tresult = camera->setFrameCallback(env, frame_callback_obj, pixel_format);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetCaptureDisplay(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jobject jSurface) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tANativeWindow *capture_window = jSurface ? ANativeWindow_fromSurface(env, jSurface) : NULL;\n\t\tresult = camera->setCaptureDisplay(capture_window);\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// カメラコントロールでサポートしている機能を取得する\nstatic jlong nativeGetCtrlSupports(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjlong result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tuint64_t supports;\n\t\tint r = camera->getCtrlSupports(&supports);\n\t\tif (!r)\n\t\t\tresult = supports;\n\t}\n\tRETURN(result, jlong);\n}\n\n// プロセッシングユニットでサポートしている機能を取得する\nstatic jlong nativeGetProcSupports(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjlong result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tuint64_t supports;\n\t\tint r = camera->getProcSupports(&supports);\n\t\tif (!r)\n\t\t\tresult = supports;\n\t}\n\tRETURN(result, jlong);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateScanningModeLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateScanningModeLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mScanningModeMin\", min);\n\t\t\tsetField_int(env, thiz, \"mScanningModeMax\", max);\n\t\t\tsetField_int(env, thiz, \"mScanningModeDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetScanningMode(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint scanningMode) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setScanningMode(scanningMode);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetScanningMode(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getScanningMode();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateExposureModeLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateExposureModeLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mExposureModeMin\", min);\n\t\t\tsetField_int(env, thiz, \"mExposureModeMax\", max);\n\t\t\tsetField_int(env, thiz, \"mExposureModeDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetExposureMode(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, int exposureMode) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setExposureMode(exposureMode);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetExposureMode(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getExposureMode();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateExposurePriorityLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateExposurePriorityLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mExposurePriorityMin\", min);\n\t\t\tsetField_int(env, thiz, \"mExposurePriorityMax\", max);\n\t\t\tsetField_int(env, thiz, \"mExposurePriorityDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetExposurePriority(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, int priority) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setExposurePriority(priority);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetExposurePriority(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getExposurePriority();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateExposureLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateExposureLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mExposureMin\", min);\n\t\t\tsetField_int(env, thiz, \"mExposureMax\", max);\n\t\t\tsetField_int(env, thiz, \"mExposureDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetExposure(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, int exposure) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setExposure(exposure);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetExposure(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getExposure();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateExposureRelLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateExposureRelLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mExposureRelMin\", min);\n\t\t\tsetField_int(env, thiz, \"mExposureRelMax\", max);\n\t\t\tsetField_int(env, thiz, \"mExposureRelDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetExposureRel(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint exposure_rel) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setExposureRel(exposure_rel);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetExposureRel(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getExposureRel();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateAutoFocusLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateAutoFocusLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mAutoFocusMin\", min);\n\t\t\tsetField_int(env, thiz, \"mAutoFocusMax\", max);\n\t\t\tsetField_int(env, thiz, \"mAutoFocusDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetAutoFocus(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jboolean autofocus) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setAutoFocus(autofocus);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetAutoFocus(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getAutoFocus();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateAutoWhiteBlanceLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateAutoWhiteBlanceLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mAutoWhiteBlanceMin\", min);\n\t\t\tsetField_int(env, thiz, \"mAutoWhiteBlanceMax\", max);\n\t\t\tsetField_int(env, thiz, \"mAutoWhiteBlanceDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetAutoWhiteBlance(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jboolean autofocus) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setAutoWhiteBlance(autofocus);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetAutoWhiteBlance(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getAutoWhiteBlance();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateAutoWhiteBlanceCompoLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateAutoWhiteBlanceCompoLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mAutoWhiteBlanceCompoMin\", min);\n\t\t\tsetField_int(env, thiz, \"mAutoWhiteBlanceCompoMax\", max);\n\t\t\tsetField_int(env, thiz, \"mAutoWhiteBlanceCompoDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetAutoWhiteBlanceCompo(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jboolean autofocus_compo) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setAutoWhiteBlanceCompo(autofocus_compo);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetAutoWhiteBlanceCompo(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getAutoWhiteBlanceCompo();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateBrightnessLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateBrightnessLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mBrightnessMin\", min);\n\t\t\tsetField_int(env, thiz, \"mBrightnessMax\", max);\n\t\t\tsetField_int(env, thiz, \"mBrightnessDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetBrightness(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint brightness) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setBrightness(brightness);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetBrightness(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getBrightness();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateFocusLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateFocusLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mFocusMin\", min);\n\t\t\tsetField_int(env, thiz, \"mFocusMax\", max);\n\t\t\tsetField_int(env, thiz, \"mFocusDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetFocus(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint focus) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setFocus(focus);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetFocus(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getFocus();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateFocusRelLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateFocusRelLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mFocusRelMin\", min);\n\t\t\tsetField_int(env, thiz, \"mFocusRelMax\", max);\n\t\t\tsetField_int(env, thiz, \"mFocusRelDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetFocusRel(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint focus_rel) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setFocusRel(focus_rel);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetFocusRel(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getFocusRel();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateIrisLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateIrisLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mIrisMin\", min);\n\t\t\tsetField_int(env, thiz, \"mIrisMax\", max);\n\t\t\tsetField_int(env, thiz, \"mIrisDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetIris(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint iris) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setIris(iris);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetIris(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getIris();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateIrisRelLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateIrisRelLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mIrisRelMin\", min);\n\t\t\tsetField_int(env, thiz, \"mIrisRelMax\", max);\n\t\t\tsetField_int(env, thiz, \"mIrisRelDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetIrisRel(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint iris_rel) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setIrisRel(iris_rel);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetIrisRel(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getIrisRel();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdatePanLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updatePanLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mPanMin\", min);\n\t\t\tsetField_int(env, thiz, \"mPanMax\", max);\n\t\t\tsetField_int(env, thiz, \"mPanDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetPan(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint pan) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setPan(pan);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetPan(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getPan();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateTiltLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateTiltLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mTiltMin\", min);\n\t\t\tsetField_int(env, thiz, \"mTiltMax\", max);\n\t\t\tsetField_int(env, thiz, \"mTiltDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetTilt(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint tilt) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setTilt(tilt);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetTilt(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getTilt();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateRollLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateRollLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mRollMin\", min);\n\t\t\tsetField_int(env, thiz, \"mRollMax\", max);\n\t\t\tsetField_int(env, thiz, \"mRollDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetRoll(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint roll) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setRoll(roll);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetRoll(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getRoll();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdatePanRelLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updatePanRelLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mPanRelMin\", min);\n\t\t\tsetField_int(env, thiz, \"mPanRelMax\", max);\n\t\t\tsetField_int(env, thiz, \"mPanRelDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetPanRel(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint pan_rel) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setPanRel(pan_rel);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetPanRel(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getPanRel();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateTiltRelLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateTiltRelLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mTiltRelMin\", min);\n\t\t\tsetField_int(env, thiz, \"mTiltRelMax\", max);\n\t\t\tsetField_int(env, thiz, \"mTiltRelDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetTiltRel(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint tilt_rel) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setTiltRel(tilt_rel);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetTiltRel(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getTiltRel();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateRollRelLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateRollRelLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mRollRelMin\", min);\n\t\t\tsetField_int(env, thiz, \"mRollRelMax\", max);\n\t\t\tsetField_int(env, thiz, \"mRollRelDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetRollRel(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint roll_rel) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setRollRel(roll_rel);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetRollRel(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getRollRel();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateContrastLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateContrastLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mContrastMin\", min);\n\t\t\tsetField_int(env, thiz, \"mContrastMax\", max);\n\t\t\tsetField_int(env, thiz, \"mContrastDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetContrast(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint contrast) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setContrast(contrast);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetContrast(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getContrast();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java method correspond to this function should not be a static mathod\nstatic jint nativeUpdateAutoContrastLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateAutoContrastLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mAutoContrastMin\", min);\n\t\t\tsetField_int(env, thiz, \"mAutoContrastMax\", max);\n\t\t\tsetField_int(env, thiz, \"mAutoContrastDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetAutoContrast(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jboolean autocontrast) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setAutoContrast(autocontrast);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetAutoContrast(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getAutoContrast();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateSharpnessLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateSharpnessLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mSharpnessMin\", min);\n\t\t\tsetField_int(env, thiz, \"mSharpnessMax\", max);\n\t\t\tsetField_int(env, thiz, \"mSharpnessDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetSharpness(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint sharpness) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setSharpness(sharpness);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetSharpness(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getSharpness();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateGainLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateGainLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mGainMin\", min);\n\t\t\tsetField_int(env, thiz, \"mGainMax\", max);\n\t\t\tsetField_int(env, thiz, \"mGainDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetGain(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint gain) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setGain(gain);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetGain(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getGain();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateGammaLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateGammaLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mGammaMin\", min);\n\t\t\tsetField_int(env, thiz, \"mGammaMax\", max);\n\t\t\tsetField_int(env, thiz, \"mGammaDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetGamma(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint gamma) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setGamma(gamma);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetGamma(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getGamma();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateWhiteBlanceLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateWhiteBlanceLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mWhiteBlanceMin\", min);\n\t\t\tsetField_int(env, thiz, \"mWhiteBlanceMax\", max);\n\t\t\tsetField_int(env, thiz, \"mWhiteBlanceDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetWhiteBlance(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint whiteBlance) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setWhiteBlance(whiteBlance);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetWhiteBlance(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getWhiteBlance();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateWhiteBlanceCompoLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateWhiteBlanceCompoLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mWhiteBlanceCompoMin\", min);\n\t\t\tsetField_int(env, thiz, \"mWhiteBlanceCompoMax\", max);\n\t\t\tsetField_int(env, thiz, \"mWhiteBlanceCompoDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetWhiteBlanceCompo(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint whiteBlance_compo) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setWhiteBlanceCompo(whiteBlance_compo);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetWhiteBlanceCompo(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getWhiteBlanceCompo();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateBacklightCompLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateBacklightCompLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mBacklightCompMin\", min);\n\t\t\tsetField_int(env, thiz, \"mBacklightCompMax\", max);\n\t\t\tsetField_int(env, thiz, \"mBacklightCompDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetBacklightComp(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint backlight_comp) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setBacklightComp(backlight_comp);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetBacklightComp(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getBacklightComp();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateSaturationLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateSaturationLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mSaturationMin\", min);\n\t\t\tsetField_int(env, thiz, \"mSaturationMax\", max);\n\t\t\tsetField_int(env, thiz, \"mSaturationDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetSaturation(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint saturation) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setSaturation(saturation);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetSaturation(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getSaturation();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateHueLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateHueLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mHueMin\", min);\n\t\t\tsetField_int(env, thiz, \"mHueMax\", max);\n\t\t\tsetField_int(env, thiz, \"mHueDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetHue(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint hue) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setHue(hue);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetHue(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getHue();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java method correspond to this function should not be a static mathod\nstatic jint nativeUpdateAutoHueLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateAutoHueLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mAutoHueMin\", min);\n\t\t\tsetField_int(env, thiz, \"mAutoHueMax\", max);\n\t\t\tsetField_int(env, thiz, \"mAutoHueDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetAutoHue(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jboolean autohue) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setAutoHue(autohue);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetAutoHue(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getAutoHue();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdatePowerlineFrequencyLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updatePowerlineFrequencyLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mPowerlineFrequencyMin\", min);\n\t\t\tsetField_int(env, thiz, \"mPowerlineFrequencyMax\", max);\n\t\t\tsetField_int(env, thiz, \"mPowerlineFrequencyDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetPowerlineFrequency(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint frequency) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setPowerlineFrequency(frequency);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetPowerlineFrequency(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getPowerlineFrequency();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateZoomLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateZoomLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mZoomMin\", min);\n\t\t\tsetField_int(env, thiz, \"mZoomMax\", max);\n\t\t\tsetField_int(env, thiz, \"mZoomDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetZoom(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint zoom) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setZoom(zoom);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetZoom(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getZoom();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateZoomRelLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateZoomRelLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mZoomRelMin\", min);\n\t\t\tsetField_int(env, thiz, \"mZoomRelMax\", max);\n\t\t\tsetField_int(env, thiz, \"mZoomRelDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetZoomRel(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint zoom_rel) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setZoomRel(zoom_rel);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetZoomRel(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getZoomRel();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateDigitalMultiplierLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateDigitalMultiplierLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mDigitalMultiplierMin\", min);\n\t\t\tsetField_int(env, thiz, \"mDigitalMultiplierMax\", max);\n\t\t\tsetField_int(env, thiz, \"mDigitalMultiplierDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetDigitalMultiplier(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint multiplier) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setDigitalMultiplier(multiplier);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetDigitalMultiplier(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getDigitalMultiplier();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateDigitalMultiplierLimitLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateDigitalMultiplierLimitLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mDigitalMultiplierLimitMin\", min);\n\t\t\tsetField_int(env, thiz, \"mDigitalMultiplierLimitMax\", max);\n\t\t\tsetField_int(env, thiz, \"mDigitalMultiplierLimitDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetDigitalMultiplierLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint multiplier_limit) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setDigitalMultiplierLimit(multiplier_limit);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetDigitalMultiplierLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getDigitalMultiplierLimit();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateAnalogVideoStandardLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateAnalogVideoStandardLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mAnalogVideoStandardMin\", min);\n\t\t\tsetField_int(env, thiz, \"mAnalogVideoStandardMax\", max);\n\t\t\tsetField_int(env, thiz, \"mAnalogVideoStandardDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetAnalogVideoStandard(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint standard) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setAnalogVideoStandard(standard);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetAnalogVideoStandard(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getAnalogVideoStandard();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java mnethod correspond to this function should not be a static mathod\nstatic jint nativeUpdateAnalogVideoLockStateLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updateAnalogVideoLockStateLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mAnalogVideoLockStateMin\", min);\n\t\t\tsetField_int(env, thiz, \"mAnalogVideoLockStateMax\", max);\n\t\t\tsetField_int(env, thiz, \"mAnalogVideoLockStateDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetAnalogVideoLockState(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jint state) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setAnalogVideoLockState(state);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetAnalogVideoLockState(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = 0;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getAnalogVideoLockState();\n\t}\n\tRETURN(result, jint);\n}\n\n//======================================================================\n// Java method correspond to this function should not be a static mathod\nstatic jint nativeUpdatePrivacyLimit(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tint min, max, def;\n\t\tresult = camera->updatePrivacyLimit(min, max, def);\n\t\tif (!result) {\n\t\t\t// Java側へ書き込む\n\t\t\tsetField_int(env, thiz, \"mPrivacyMin\", min);\n\t\t\tsetField_int(env, thiz, \"mPrivacyMax\", max);\n\t\t\tsetField_int(env, thiz, \"mPrivacyDef\", def);\n\t\t}\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeSetPrivacy(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera, jboolean privacy) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->setPrivacy(privacy ? 1: 0);\n\t}\n\tRETURN(result, jint);\n}\n\nstatic jint nativeGetPrivacy(JNIEnv *env, jobject thiz,\n\tID_TYPE id_camera) {\n\n\tjint result = JNI_ERR;\n\tENTER();\n\tUVCCamera *camera = reinterpret_cast<UVCCamera *>(id_camera);\n\tif (LIKELY(camera)) {\n\t\tresult = camera->getPrivacy();\n\t}\n\tRETURN(result, jint);\n}\n\n//**********************************************************************\n//\n//**********************************************************************\njint registerNativeMethods(JNIEnv* env, const char *class_name, JNINativeMethod *methods, int num_methods) {\n\tint result = 0;\n\n\tjclass clazz = env->FindClass(class_name);\n\tif (LIKELY(clazz)) {\n\t\tint result = env->RegisterNatives(clazz, methods, num_methods);\n\t\tif (UNLIKELY(result < 0)) {\n\t\t\tLOGE(\"registerNativeMethods failed(class=%s)\", class_name);\n\t\t}\n\t} else {\n\t\tLOGE(\"registerNativeMethods: class'%s' not found\", class_name);\n\t}\n\treturn result;\n}\n\nstatic JNINativeMethod methods[] = {\n\t{ \"nativeCreate\",\t\t\t\t\t\"()J\", (void *) nativeCreate },\n\t{ \"nativeDestroy\",\t\t\t\t\t\"(J)V\", (void *) nativeDestroy },\n\t//\n\t{ \"nativeConnect\",\t\t\t\t\t\"(JIIIIILjava/lang/String;)I\", (void *) nativeConnect },\n\t{ \"nativeRelease\",\t\t\t\t\t\"(J)I\", (void *) nativeRelease },\n\n\t{ \"nativeSetStatusCallback\",\t\t\"(JLcom/serenegiant/usb/IStatusCallback;)I\", (void *) nativeSetStatusCallback },\n\t{ \"nativeSetButtonCallback\",\t\t\"(JLcom/serenegiant/usb/IButtonCallback;)I\", (void *) nativeSetButtonCallback },\n\n\t{ \"nativeGetSupportedSize\",\t\t\t\"(J)Ljava/lang/String;\", (void *) nativeGetSupportedSize },\n\t{ \"nativeSetPreviewSize\",\t\t\t\"(JIIIIIF)I\", (void *) nativeSetPreviewSize },\n\t{ \"nativeStartPreview\",\t\t\t\t\"(J)I\", (void *) nativeStartPreview },\n\t{ \"nativeStopPreview\",\t\t\t\t\"(J)I\", (void *) nativeStopPreview },\n\t{ \"nativeSetPreviewDisplay\",\t\t\"(JLandroid/view/Surface;)I\", (void *) nativeSetPreviewDisplay },\n\t{ \"nativeSetFrameCallback\",\t\t\t\"(JLcom/serenegiant/usb/IFrameCallback;I)I\", (void *) nativeSetFrameCallback },\n\n\t{ \"nativeSetCaptureDisplay\",\t\t\"(JLandroid/view/Surface;)I\", (void *) nativeSetCaptureDisplay },\n\n\t{ \"nativeGetCtrlSupports\",\t\t\t\"(J)J\", (void *) nativeGetCtrlSupports },\n\t{ \"nativeGetProcSupports\",\t\t\t\"(J)J\", (void *) nativeGetProcSupports },\n\n\t{ \"nativeUpdateScanningModeLimit\",\t\"(J)I\", (void *) nativeUpdateScanningModeLimit },\n\t{ \"nativeSetScanningMode\",\t\t\t\"(JI)I\", (void *) nativeSetScanningMode },\n\t{ \"nativeGetScanningMode\",\t\t\t\"(J)I\", (void *) nativeGetScanningMode },\n\t\t\t\n\t{ \"nativeUpdateExposureModeLimit\",\t\"(J)I\", (void *) nativeUpdateExposureModeLimit },\n\t{ \"nativeSetExposureMode\",\t\t\t\"(JI)I\", (void *) nativeSetExposureMode },\n\t{ \"nativeGetExposureMode\",\t\t\t\"(J)I\", (void *) nativeGetExposureMode },\n\n\t{ \"nativeUpdateExposurePriorityLimit\",\"(J)I\", (void *) nativeUpdateExposurePriorityLimit },\n\t{ \"nativeSetExposurePriority\",\t\t\"(JI)I\", (void *) nativeSetExposurePriority },\n\t{ \"nativeGetExposurePriority\",\t\t\"(J)I\", (void *) nativeGetExposurePriority },\n\t\t\t\n\t{ \"nativeUpdateExposureLimit\",\t\t\"(J)I\", (void *) nativeUpdateExposureLimit },\n\t{ \"nativeSetExposure\",\t\t\t\t\"(JI)I\", (void *) nativeSetExposure },\n\t{ \"nativeGetExposure\",\t\t\t\t\"(J)I\", (void *) nativeGetExposure },\n\t\t\t\n\t{ \"nativeUpdateExposureRelLimit\",\t\"(J)I\", (void *) nativeUpdateExposureRelLimit },\n\t{ \"nativeSetExposureRel\",\t\t\t\"(JI)I\", (void *) nativeSetExposureRel },\n\t{ \"nativeGetExposureRel\",\t\t\t\"(J)I\", (void *) nativeGetExposureRel },\n\t\t\t\n\t{ \"nativeUpdateAutoFocusLimit\",\t\t\"(J)I\", (void *) nativeUpdateAutoFocusLimit },\n\t{ \"nativeSetAutoFocus\",\t\t\t\t\"(JZ)I\", (void *) nativeSetAutoFocus },\n\t{ \"nativeGetAutoFocus\",\t\t\t\t\"(J)I\", (void *) nativeGetAutoFocus },\n\n\t{ \"nativeUpdateFocusLimit\",\t\t\t\"(J)I\", (void *) nativeUpdateFocusLimit },\n\t{ \"nativeSetFocus\",\t\t\t\t\t\"(JI)I\", (void *) nativeSetFocus },\n\t{ \"nativeGetFocus\",\t\t\t\t\t\"(J)I\", (void *) nativeGetFocus },\n\n\t{ \"nativeUpdateFocusRelLimit\",\t\t\"(J)I\", (void *) nativeUpdateFocusRelLimit },\n\t{ \"nativeSetFocusRel\",\t\t\t\t\"(JI)I\", (void *) nativeSetFocusRel },\n\t{ \"nativeGetFocusRel\",\t\t\t\t\"(J)I\", (void *) nativeGetFocusRel },\n\t\n//\t{ \"nativeUpdateFocusSimpleLimit\",\t\"(J)I\", (void *) nativeUpdateFocusSimpleLimit },\n//\t{ \"nativeSetFocusSimple\",\t\t\t\"(JI)I\", (void *) nativeSetFocusSimple },\n//\t{ \"nativeGetFocusSimple\",\t\t\t\"(J)I\", (void *) nativeGetFocusSimple },\n\t\t\t\n\t{ \"nativeUpdateIrisLimit\",\t\t\t\"(J)I\", (void *) nativeUpdateIrisLimit },\n\t{ \"nativeSetIris\",\t\t\t\t\t\"(JI)I\", (void *) nativeSetIris },\n\t{ \"nativeGetIris\",\t\t\t\t\t\"(J)I\", (void *) nativeGetIris },\n\t\n\t{ \"nativeUpdateIrisRelLimit\",\t\t\"(J)I\", (void *) nativeUpdateIrisRelLimit },\n\t{ \"nativeSetIrisRel\",\t\t\t\t\"(JI)I\", (void *) nativeSetIrisRel },\n\t{ \"nativeGetIrisRel\",\t\t\t\t\"(J)I\", (void *) nativeGetIrisRel },\n\t\n\t{ \"nativeUpdatePanLimit\",\t\t\t\"(J)I\", (void *) nativeUpdatePanLimit },\n\t{ \"nativeSetPan\",\t\t\t\t\t\"(JI)I\", (void *) nativeSetPan },\n\t{ \"nativeGetPan\",\t\t\t\t\t\"(J)I\", (void *) nativeGetPan },\n\t\n\t{ \"nativeUpdateTiltLimit\",\t\t\t\"(J)I\", (void *) nativeUpdateTiltLimit },\n\t{ \"nativeSetTilt\",\t\t\t\t\t\"(JI)I\", (void *) nativeSetTilt },\n\t{ \"nativeGetTilt\",\t\t\t\t\t\"(J)I\", (void *) nativeGetTilt },\n\t\n\t{ \"nativeUpdateRollLimit\",\t\t\t\"(J)I\", (void *) nativeUpdateRollLimit },\n\t{ \"nativeSetRoll\",\t\t\t\t\t\"(JI)I\", (void *) nativeSetRoll },\n\t{ \"nativeGetRoll\",\t\t\t\t\t\"(J)I\", (void *) nativeGetRoll },\n\t\n\t{ \"nativeUpdatePanRelLimit\",\t\t\"(J)I\", (void *) nativeUpdatePanRelLimit },\n\t{ \"nativeSetPanRel\",\t\t\t\t\"(JI)I\", (void *) nativeSetPanRel },\n\t{ \"nativeGetPanRel\",\t\t\t\t\"(J)I\", (void *) nativeGetPanRel },\n\t\n\t{ \"nativeUpdateTiltRelLimit\",\t\t\"(J)I\", (void *) nativeUpdateTiltRelLimit },\n\t{ \"nativeSetTiltRel\",\t\t\t\t\"(JI)I\", (void *) nativeSetTiltRel },\n\t{ \"nativeGetTiltRel\",\t\t\t\t\"(J)I\", (void *) nativeGetTiltRel },\n\t\n\t{ \"nativeUpdateRollRelLimit\",\t\t\"(J)I\", (void *) nativeUpdateRollRelLimit },\n\t{ \"nativeSetRollRel\",\t\t\t\t\"(JI)I\", (void *) nativeSetRollRel },\n\t{ \"nativeGetRollRel\",\t\t\t\t\"(J)I\", (void *) nativeGetRollRel },\n\t\n\t{ \"nativeUpdateAutoWhiteBlanceLimit\",\"(J)I\", (void *) nativeUpdateAutoWhiteBlanceLimit },\n\t{ \"nativeSetAutoWhiteBlance\",\t\t\"(JZ)I\", (void *) nativeSetAutoWhiteBlance },\n\t{ \"nativeGetAutoWhiteBlance\",\t\t\"(J)I\", (void *) nativeGetAutoWhiteBlance },\n\n\t{ \"nativeUpdateAutoWhiteBlanceCompoLimit\",\"(J)I\", (void *) nativeUpdateAutoWhiteBlanceCompoLimit },\n\t{ \"nativeSetAutoWhiteBlanceCompo\",\t\t\"(JZ)I\", (void *) nativeSetAutoWhiteBlanceCompo },\n\t{ \"nativeGetAutoWhiteBlanceCompo\",\t\t\"(J)I\", (void *) nativeGetAutoWhiteBlanceCompo },\n\t\n\t{ \"nativeUpdateWhiteBlanceLimit\",\t\"(J)I\", (void *) nativeUpdateWhiteBlanceLimit },\n\t{ \"nativeSetWhiteBlance\",\t\t\t\"(JI)I\", (void *) nativeSetWhiteBlance },\n\t{ \"nativeGetWhiteBlance\",\t\t\t\"(J)I\", (void *) nativeGetWhiteBlance },\n\n\t{ \"nativeUpdateWhiteBlanceCompoLimit\",\"(J)I\", (void *) nativeUpdateWhiteBlanceCompoLimit },\n\t{ \"nativeSetWhiteBlanceCompo\",\t\t\"(JI)I\", (void *) nativeSetWhiteBlanceCompo },\n\t{ \"nativeGetWhiteBlanceCompo\",\t\t\"(J)I\", (void *) nativeGetWhiteBlanceCompo },\n\t\n\t{ \"nativeUpdateBacklightCompLimit\",\t\"(J)I\", (void *) nativeUpdateBacklightCompLimit },\n\t{ \"nativeSetBacklightComp\",\t\t\t\"(JI)I\", (void *) nativeSetBacklightComp },\n\t{ \"nativeGetBacklightComp\",\t\t\t\"(J)I\", (void *) nativeGetBacklightComp },\n\n\t{ \"nativeUpdateBrightnessLimit\",\t\"(J)I\", (void *) nativeUpdateBrightnessLimit },\n\t{ \"nativeSetBrightness\",\t\t\t\"(JI)I\", (void *) nativeSetBrightness },\n\t{ \"nativeGetBrightness\",\t\t\t\"(J)I\", (void *) nativeGetBrightness },\n\n\t{ \"nativeUpdateContrastLimit\",\t\t\"(J)I\", (void *) nativeUpdateContrastLimit },\n\t{ \"nativeSetContrast\",\t\t\t\t\"(JI)I\", (void *) nativeSetContrast },\n\t{ \"nativeGetContrast\",\t\t\t\t\"(J)I\", (void *) nativeGetContrast },\n\n\t{ \"nativeUpdateAutoContrastLimit\",\t\"(J)I\", (void *) nativeUpdateAutoContrastLimit },\n\t{ \"nativeSetAutoContrast\",\t\t\t\"(JZ)I\", (void *) nativeSetAutoContrast },\n\t{ \"nativeGetAutoContrast\",\t\t\t\"(J)I\", (void *) nativeGetAutoContrast },\n\n\t{ \"nativeUpdateSharpnessLimit\",\t\t\"(J)I\", (void *) nativeUpdateSharpnessLimit },\n\t{ \"nativeSetSharpness\",\t\t\t\t\"(JI)I\", (void *) nativeSetSharpness },\n\t{ \"nativeGetSharpness\",\t\t\t\t\"(J)I\", (void *) nativeGetSharpness },\n\n\t{ \"nativeUpdateGainLimit\",\t\t\t\"(J)I\", (void *) nativeUpdateGainLimit },\n\t{ \"nativeSetGain\",\t\t\t\t\t\"(JI)I\", (void *) nativeSetGain },\n\t{ \"nativeGetGain\",\t\t\t\t\t\"(J)I\", (void *) nativeGetGain },\n\n\t{ \"nativeUpdateGammaLimit\",\t\t\t\"(J)I\", (void *) nativeUpdateGammaLimit },\n\t{ \"nativeSetGamma\",\t\t\t\t\t\"(JI)I\", (void *) nativeSetGamma },\n\t{ \"nativeGetGamma\",\t\t\t\t\t\"(J)I\", (void *) nativeGetGamma },\n\n\t{ \"nativeUpdateSaturationLimit\",\t\"(J)I\", (void *) nativeUpdateSaturationLimit },\n\t{ \"nativeSetSaturation\",\t\t\t\"(JI)I\", (void *) nativeSetSaturation },\n\t{ \"nativeGetSaturation\",\t\t\t\"(J)I\", (void *) nativeGetSaturation },\n\n\t{ \"nativeUpdateHueLimit\",\t\t\t\"(J)I\", (void *) nativeUpdateHueLimit },\n\t{ \"nativeSetHue\",\t\t\t\t\t\"(JI)I\", (void *) nativeSetHue },\n\t{ \"nativeGetHue\",\t\t\t\t\t\"(J)I\", (void *) nativeGetHue },\n\n\t{ \"nativeUpdateAutoHueLimit\",\t\t\"(J)I\", (void *) nativeUpdateAutoHueLimit },\n\t{ \"nativeSetAutoHue\",\t\t\t\t\"(JZ)I\", (void *) nativeSetAutoHue },\n\t{ \"nativeGetAutoHue\",\t\t\t\t\"(J)I\", (void *) nativeGetAutoHue },\n\t\t\t\n\t{ \"nativeUpdatePowerlineFrequencyLimit\",\"(J)I\", (void *) nativeUpdatePowerlineFrequencyLimit },\n\t{ \"nativeSetPowerlineFrequency\",\t\"(JI)I\", (void *) nativeSetPowerlineFrequency },\n\t{ \"nativeGetPowerlineFrequency\",\t\"(J)I\", (void *) nativeGetPowerlineFrequency },\n\n\t{ \"nativeUpdateZoomLimit\",\t\t\t\"(J)I\", (void *) nativeUpdateZoomLimit },\n\t{ \"nativeSetZoom\",\t\t\t\t\t\"(JI)I\", (void *) nativeSetZoom },\n\t{ \"nativeGetZoom\",\t\t\t\t\t\"(J)I\", (void *) nativeGetZoom },\n\t\n\t{ \"nativeUpdateZoomRelLimit\",\t\t\"(J)I\", (void *) nativeUpdateZoomRelLimit },\n\t{ \"nativeSetZoomRel\",\t\t\t\t\"(JI)I\", (void *) nativeSetZoomRel },\n\t{ \"nativeGetZoomRel\",\t\t\t\t\"(J)I\", (void *) nativeGetZoomRel },\n\t\n\t{ \"nativeUpdateDigitalMultiplierLimit\",\"(J)I\", (void *) nativeUpdateDigitalMultiplierLimit },\n\t{ \"nativeSetDigitalMultiplier\",\"(JI)I\", (void *) nativeSetDigitalMultiplier },\n\t{ \"nativeGetDigitalMultiplier\",\"(J)I\", (void *) nativeGetDigitalMultiplier },\n\t\n\t{ \"nativeUpdateDigitalMultiplierLimitLimit\",\"(J)I\", (void *) nativeUpdateDigitalMultiplierLimitLimit },\n\t{ \"nativeSetDigitalMultiplierLimit\",\"(JI)I\", (void *) nativeSetDigitalMultiplierLimit },\n\t{ \"nativeGetDigitalMultiplierLimit\",\"(J)I\", (void *) nativeGetDigitalMultiplierLimit },\n\t\n\t{ \"nativeUpdateAnalogVideoStandardLimit\",\"(J)I\", (void *) nativeUpdateAnalogVideoStandardLimit },\n\t{ \"nativeSetAnalogVideoStandard\",\t\t\"(JI)I\", (void *) nativeSetAnalogVideoStandard },\n\t{ \"nativeGetAnalogVideoStandard\",\t\t\"(J)I\", (void *) nativeGetAnalogVideoStandard },\n\t\n\t{ \"nativeUpdateAnalogVideoLockStateLimit\",\"(J)I\", (void *) nativeUpdateAnalogVideoLockStateLimit },\n\t{ \"nativeSetAnalogVideoLoackState\",\t\"(JI)I\", (void *) nativeSetAnalogVideoLockState },\n\t{ \"nativeGetAnalogVideoLoackState\",\t\"(J)I\", (void *) nativeGetAnalogVideoLockState },\n\t\n\t{ \"nativeUpdatePrivacyLimit\",\t\t\"(J)I\", (void *) nativeUpdatePrivacyLimit },\n\t{ \"nativeSetPrivacy\",\t\t\t\t\"(JZ)I\", (void *) nativeSetPrivacy },\n\t{ \"nativeGetPrivacy\",\t\t\t\t\"(J)I\", (void *) nativeGetPrivacy },\n};\n\nint register_uvccamera(JNIEnv *env) {\n\tLOGV(\"register_uvccamera:\");\n\tif (registerNativeMethods(env,\n\t\t\"com/serenegiant/usb/UVCCamera\",\n\t\tmethods, NUM_ARRAY_ELEMENTS(methods)) < 0) {\n\t\treturn -1;\n\t}\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/UVCCamera/utilbase.cpp",
    "content": "/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n * File name: utilbase.cpp\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n*/\n\n#include \"utilbase.h\"\n\nstatic JavaVM *savedVm;\n\nvoid setVM(JavaVM *vm) {\n\tsavedVm = vm;\n}\n\nJavaVM *getVM() {\n\treturn savedVm;\n}\n\nJNIEnv *getEnv() {\n    JNIEnv *env = NULL;\n    if (savedVm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK) {\n    \tenv = NULL;\n    }\n    return env;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/Android.mk",
    "content": "#/*\n# * UVCCamera\n# * library and sample to access to UVC web camera on non-rooted Android device\n# * \n# * Copyright (c) 2015-2017 saki t_saki@serenegiant.com\n# * \n# * File name: Android.mk\n# * \n# * Licensed under the Apache License, Version 2.0 (the \"License\");\n# * you may not use this file except in compliance with the License.\n# *  You may obtain a copy of the License at\n# * \n# *     http://www.apache.org/licenses/LICENSE-2.0\n# * \n# *  Unless required by applicable law or agreed to in writing, software\n# *  distributed under the License is distributed on an \"AS IS\" BASIS,\n# *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# *  See the License for the specific language governing permissions and\n# *  limitations under the License.\n# * \n# * All files in the folder are under this Apache License, Version 2.0.\n# * Files in the jni/libjpeg-turbo1500, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n#*/\n######################################################################\n# libjpeg-turbo1500_static.a\n######################################################################\nLOCAL_PATH\t\t:= $(call my-dir)\ninclude $(CLEAR_VARS)\n\n# CFLAGS := -Werror\n\n#生成するモジュール名\nLOCAL_MODULE    := jpeg-turbo1500_static\n\n#インクルードファイルのパスを指定\nLOCAL_C_INCLUDES := \\\n        $(LOCAL_PATH)/ \\\n        $(LOCAL_PATH)/include \\\n        $(LOCAL_PATH)/simd \\\n\nLOCAL_EXPORT_C_INCLUDES := \\\n\t\t$(LOCAL_PATH)/ \\\n        $(LOCAL_PATH)/include \\\n        $(LOCAL_PATH)/simd \\\n\n#コンパイラのオプションフラグを指定\nLOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%)\nLOCAL_CFLAGS += -DANDROID_NDK\n\n#リンクするライブラリを指定(静的モジュールにする時は不要)\n#LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -ldl\t# to avoid NDK issue(no need for static library)\n\n#このモジュールを外部モジュールとしてリンクする時のライブラリを指定\n\nLOCAL_ARM_MODE := arm\n\nLOCAL_ASMFLAGS += -DELF\n\n# コンパイル・リンクするソースファイル\n\nLOCAL_SRC_FILES += \\\n\tjcapimin.c \\\n\tjcapistd.c \\\n\tjccoefct.c \\\n\tjccolor.c \\\n\tjcdctmgr.c \\\n\tjchuff.c \\\n\tjcinit.c \\\n\tjcmainct.c \\\n\tjcmarker.c \\\n\tjcmaster.c \\\n\tjcomapi.c \\\n\tjcparam.c \\\n\tjcphuff.c \\\n\tjcprepct.c \\\n\tjcsample.c \\\n\tjctrans.c \\\n\tjdapimin.c \\\n\tjdapistd.c \\\n\tjdatadst.c \\\n\tjdatasrc.c \\\n\tjdcoefct.c \\\n\tjdcolor.c \\\n\tjddctmgr.c \\\n\tjdhuff.c \\\n\tjdinput.c \\\n\tjdmainct.c \\\n\tjdmarker.c \\\n\tjdmaster.c \\\n\tjdmerge.c \\\n\tjdphuff.c \\\n\tjdpostct.c \\\n\tjdsample.c \\\n\tjdtrans.c \\\n\tjerror.c \\\n\tjfdctflt.c \\\n\tjfdctfst.c \\\n\tjfdctint.c \\\n\tjidctflt.c \\\n\tjidctfst.c \\\n\tjidctint.c \\\n\tjidctred.c \\\n\tjquant1.c \\\n\tjquant2.c \\\n\tjutils.c \\\n\tjmemmgr.c \\\n\tjmemnobs.c \\\n\nLOCAL_SRC_FILES += \\\n\tjaricom.c \\\n\tjcarith.c \\\n\tjdarith.c \\\n\nLOCAL_SRC_FILES += \\\n\tturbojpeg.c \\\n\ttransupp.c \\\n\tjdatadst-tj.c \\\n\tjdatasrc-tj.c \\\n\nifeq ($(TARGET_ARCH_ABI),armeabi)\n#NEONを有効にする時\n#LOCAL_ARM_NEON := true\nLOCAL_SRC_FILES += simd/jsimd_arm.c simd/jsimd_arm_neon.S\n\nLOCAL_CFLAGS += \\\n\t-DSIZEOF_SIZE_T=4 \\\n\nelse ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)\n#NEONを有効にする時\n#LOCAL_ARM_NEON := true\nLOCAL_SRC_FILES += simd/jsimd_arm.c simd/jsimd_arm_neon.S\n\nLOCAL_CFLAGS += \\\n\t-DSIZEOF_SIZE_T=4 \\\n\nelse ifeq ($(TARGET_ARCH_ABI),arm64-v8a)\n#NEONを有効にする時\n#LOCAL_ARM_NEON := true\nLOCAL_SRC_FILES += simd/jsimd_arm64.c simd/jsimd_arm64_neon.S\n\nLOCAL_CFLAGS += \\\n\t-DSIZEOF_SIZE_T=8 \\\n\nelse ifeq ($(TARGET_ARCH_ABI),x86_64)\nLOCAL_SRC_FILES += \\\n\tsimd/jsimd_x86_64.c \\\n\tsimd/jfdctflt-sse-64.asm \\\n\tsimd/jccolor-sse2-64.asm \\\n\tsimd/jcgray-sse2-64.asm \\\n\tsimd/jcsample-sse2-64.asm \\\n\tsimd/jdcolor-sse2-64.asm \\\n\tsimd/jdmerge-sse2-64.asm \\\n\tsimd/jdsample-sse2-64.asm \\\n\tsimd/jfdctfst-sse2-64.asm \\\n\tsimd/jfdctint-sse2-64.asm \\\n\tsimd/jidctflt-sse2-64.asm \\\n\tsimd/jidctfst-sse2-64.asm \\\n\tsimd/jidctint-sse2-64.asm \\\n\tsimd/jidctred-sse2-64.asm \\\n\tsimd/jquantf-sse2-64.asm \\\n\tsimd/jquanti-sse2-64.asm \\\n\tsimd/jchuff-sse2-64.asm \\\n\nLOCAL_CFLAGS += \\\n\t-DSIZEOF_SIZE_T=8 \\\n\nLOCAL_ASMFLAGS += -D__x86_64__\n\nelse ifeq ($(TARGET_ARCH_ABI),x86)\n\nLOCAL_SRC_FILES += \\\n\tsimd/jsimd_i386.c \\\n\tsimd/jsimdcpu.asm \\\n\tsimd/jfdctflt-3dn.asm \\\n\tsimd/jidctflt-3dn.asm \\\n\tsimd/jquant-3dn.asm \\\n\tsimd/jccolor-mmx.asm \\\n\tsimd/jcgray-mmx.asm \\\n\tsimd/jcsample-mmx.asm \\\n\tsimd/jdcolor-mmx.asm \\\n\tsimd/jdmerge-mmx.asm \\\n\tsimd/jdsample-mmx.asm \\\n\tsimd/jfdctfst-mmx.asm \\\n\tsimd/jfdctint-mmx.asm \\\n\tsimd/jidctfst-mmx.asm \\\n\tsimd/jidctint-mmx.asm \\\n\tsimd/jidctred-mmx.asm \\\n\tsimd/jquant-mmx.asm \\\n\tsimd/jfdctflt-sse.asm \\\n\tsimd/jidctflt-sse.asm \\\n\tsimd/jquant-sse.asm \\\n\tsimd/jccolor-sse2.asm \\\n\tsimd/jcgray-sse2.asm \\\n\tsimd/jcsample-sse2.asm \\\n\tsimd/jdcolor-sse2.asm \\\n\tsimd/jdmerge-sse2.asm \\\n\tsimd/jdsample-sse2.asm \\\n\tsimd/jfdctfst-sse2.asm \\\n\tsimd/jfdctint-sse2.asm \\\n\tsimd/jidctflt-sse2.asm \\\n\tsimd/jidctfst-sse2.asm \\\n\tsimd/jidctint-sse2.asm \\\n\tsimd/jidctred-sse2.asm \\\n\tsimd/jquantf-sse2.asm \\\n\tsimd/jquanti-sse2.asm \\\n\tsimd/jchuff-sse2.asm \\\n\nLOCAL_CFLAGS += \\\n\t-DSIZEOF_SIZE_T=4 \\\n\nelse ifeq ($(TARGET_ARCH_ABI),mips)\n\n# Unfortunately it seems Clang in NDK(at least until r14)\n# does not support SIMD for mips(MSA) correctly now.\n# If you really needs MSA, try `NDK_TOOLCHAIN_VERSION := 4.9` in Application.mk\n# with r13b/r14 (so that you can build libraries with GCC),\n# but I don't recommend because supporting GCC on NDK is already deprecated\n# and GCC will bre removed from NDK soon.\n\nifeq ($(NDK_TOOLCHAIN_VERSION),clang)\n\n#disable MSA\n\nLOCAL_SRC_FILES += \\\n\tjsimd_none.c\n\nelse\n\nLOCAL_SRC_FILES += \\\n\tsimd/jsimd_mips.c \\\n\tsimd/jsimd_mips_dspr2.S \\\n\nendif\n\nLOCAL_CFLAGS += \\\n\t-DSIZEOF_SIZE_T=4 \\\n\nelse\nLOCAL_SRC_FILES += jsimd_none.c\n\nendif\n\n# simd/jsimd.h simd/jcolsamp.inc simd/jsimdcfg.inc.h simd/jsimdext.inc simd/jdct.inc\n#\tjsimdext.inc jcolsamp.inc jdct.inc \\\n\nLOCAL_CPPFLAGS += -Wno-incompatible-pointer-types\n\nLOCAL_DISABLE_FATAL_LINKER_WARNINGS := true\n\n# 静的ライブラリとしてビルド\ninclude $(BUILD_STATIC_LIBRARY)\n\n######################################################################\n# jpeg-turbo1500.so\n######################################################################\ninclude $(CLEAR_VARS)\nLOCAL_EXPORT_C_INCLUDES := \\\n\t\t$(LOCAL_PATH)/\n\nLOCAL_DISABLE_FATAL_LINKER_WARNINGS := true\n\nLOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -ldl\t# to avoid NDK issue(no need for static library)\n\nLOCAL_WHOLE_STATIC_LIBRARIES = jpeg-turbo1500_static\n\nLOCAL_MODULE := jpeg-turbo1500\ninclude $(BUILD_SHARED_LIBRARY)\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/BUILDING.md",
    "content": "Building on Un*x Platforms (including Cygwin and OS X)\n=======================================================\n\n\nBuild Requirements\n------------------\n\n- autoconf 2.56 or later\n- automake 1.7 or later\n- libtool 1.4 or later\n  * If using Xcode 4.3 or later on OS X, autoconf and automake are no longer\n    provided.  The easiest way to obtain them is from\n    [MacPorts](http://www.MacPorts.org).\n\n- NASM or YASM (if building x86 or x86-64 SIMD extensions)\n  * If using NASM, 0.98, or 2.01 or later is required for an x86 build (0.99\n    and 2.00 do not work properly with libjpeg-turbo's x86 SIMD code.)\n  * If using NASM, 2.00 or later is required for an x86-64 build.\n  * If using NASM, 2.07 or later (except 2.11.08) is required for an x86-64\n    Mac build (2.11.08 does not work properly with libjpeg-turbo's x86-64 SIMD\n    code when building macho64 objects.)  NASM or YASM can be obtained from\n    [MacPorts](http://www.macports.org/).\n\n  The binary RPMs released by the NASM project do not work on older Linux\n  systems, such as Red Hat Enterprise Linux 4.  On such systems, you can\n   easily build and install NASM from a source RPM by downloading one of the\n  SRPMs from\n\n  <http://www.nasm.us/pub/nasm/releasebuilds>\n\n  and executing the following as root:\n\n        ARCH=`uname -m`\n        rpmbuild --rebuild nasm-{version}.src.rpm\n        rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-{version}.$ARCH.rpm\n\n  NOTE: the NASM build will fail if texinfo is not installed.\n\n- GCC v4.1 (or later) or clang recommended for best performance\n\n- If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is\n  required.  Some systems, such as Solaris 10 and later and Red Hat Enterprise\n  Linux 5 and later, have this pre-installed.  On OS X 10.5 and 10.6, it will\n  be necessary to install the Java Developer Package, which can be downloaded\n  from <http://developer.apple.com/downloads> (Apple ID required.)  For other\n  systems, you can obtain the Oracle Java Development Kit from\n  <http://www.java.com>.\n\n\nOut-of-Tree Builds\n------------------\n\nBinary objects, libraries, and executables are generated in the same directory\nfrom which `configure` was executed (the \"binary directory\"), and this\ndirectory need not necessarily be the same as the libjpeg-turbo source\ndirectory.  You can create multiple independent binary directories, in which\ndifferent versions of libjpeg-turbo can be built from the same source tree\nusing different compilers or settings.  In the sections below,\n*{build_directory}* refers to the binary directory, whereas\n*{source_directory}* refers to the libjpeg-turbo source directory.  For in-tree\nbuilds, these directories are the same.\n\n\nBuilding libjpeg-turbo\n----------------------\n\nThe following procedure will build libjpeg-turbo on Linux, FreeBSD, Cygwin, and\nSolaris/x86 systems (on Solaris, this generates a 32-bit library.  See below\nfor 64-bit build instructions.)\n\n    cd {source_directory}\n    autoreconf -fiv\n    cd {build_directory}\n    sh {source_directory}/configure [additional configure flags]\n    make\n\nNOTE: Running autoreconf in the source directory is not necessary if building\nlibjpeg-turbo from one of the official release tarballs.\n\nThis will generate the following files under .libs/:\n\n**libjpeg.a**  \nStatic link library for the libjpeg API\n\n**libjpeg.so.{version}** (Linux, Unix)  \n**libjpeg.{version}.dylib** (OS X)  \n**cygjpeg-{version}.dll** (Cygwin)  \nShared library for the libjpeg API\n\nBy default, *{version}* is 62.1.0, 7.1.0, or 8.0.2, depending on whether\nlibjpeg v6b (default), v7, or v8 emulation is enabled.  If using Cygwin,\n*{version}* is 62, 7, or 8.\n\n**libjpeg.so** (Linux, Unix)  \n**libjpeg.dylib** (OS X)  \nDevelopment symlink for the libjpeg API\n\n**libjpeg.dll.a** (Cygwin)  \nImport library for the libjpeg API\n\n**libturbojpeg.a**  \nStatic link library for the TurboJPEG API\n\n**libturbojpeg.so.0.1.0** (Linux, Unix)  \n**libturbojpeg.0.1.0.dylib** (OS X)  \n**cygturbojpeg-0.dll** (Cygwin)  \nShared library for the TurboJPEG API\n\n**libturbojpeg.so** (Linux, Unix)  \n**libturbojpeg.dylib** (OS X)  \nDevelopment symlink for the TurboJPEG API\n\n**libturbojpeg.dll.a** (Cygwin)  \nImport library for the TurboJPEG API\n\n\n### libjpeg v7 or v8 API/ABI Emulation\n\nAdd `--with-jpeg7` to the `configure` command line to build a version of\nlibjpeg-turbo that is API/ABI-compatible with libjpeg v7.  Add `--with-jpeg8`\nto the `configure` command to build a version of libjpeg-turbo that is\nAPI/ABI-compatible with libjpeg v8.  See [README.md](README.md) for more\ninformation on libjpeg v7 and v8 emulation.\n\n\n### In-Memory Source/Destination Managers\n\nWhen using libjpeg v6b or v7 API/ABI emulation, add `--without-mem-srcdst` to\nthe `configure` command line to build a version of libjpeg-turbo that lacks the\n`jpeg_mem_src()` and `jpeg_mem_dest()` functions.  These functions were not\npart of the original libjpeg v6b and v7 APIs, so removing them ensures strict\nconformance with those APIs.  See [README.md](README.md) for more information.\n\n\n### Arithmetic Coding Support\n\nSince the patent on arithmetic coding has expired, this functionality has been\nincluded in this release of libjpeg-turbo.  libjpeg-turbo's implementation is\nbased on the implementation in libjpeg v8, but it works when emulating libjpeg\nv7 or v6b as well.  The default is to enable both arithmetic encoding and\ndecoding, but those who have philosophical objections to arithmetic coding can\nadd `--without-arith-enc` or `--without-arith-dec` to the `configure` command\nline to disable encoding or decoding (respectively.)\n\n\n### TurboJPEG Java Wrapper\n\nAdd `--with-java` to the `configure` command line to incorporate an optional\nJava Native Interface wrapper into the TurboJPEG shared library and build the\nJava front-end classes to support it.  This allows the TurboJPEG shared library\nto be used directly from Java applications.  See [java/README](java/README) for\nmore details.\n\nYou can set the `JAVAC`, `JAR`, and `JAVA` configure variables to specify\nalternate commands for javac, jar, and java (respectively.)  You can also\nset the `JAVACFLAGS` configure variable to specify arguments that should be\npassed to the Java compiler when building the front-end classes, and\n`JNI_CFLAGS` to specify arguments that should be passed to the C compiler when\nbuilding the JNI wrapper.  Run `configure --help` for more details.\n\n\nInstalling libjpeg-turbo\n------------------------\n\nIf you intend to install these libraries and the associated header files, then\nreplace 'make' in the instructions above with\n\n    make install prefix={base dir} libdir={library directory}\n\nFor example,\n\n    make install prefix=/usr/local libdir=/usr/local/lib64\n\nwill install the header files in /usr/local/include and the library files in\n/usr/local/lib64.  If `prefix` and `libdir` are not specified, then the default\nis to install the header files in /opt/libjpeg-turbo/include and the library\nfiles in /opt/libjpeg-turbo/lib32 (32-bit) or /opt/libjpeg-turbo/lib64\n(64-bit.)\n\nNOTE: You can specify a prefix of /usr and a libdir of, for instance,\n/usr/lib64 to overwrite the system's version of libjpeg.  If you do this,\nhowever, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before\noverwriting it.  It is recommended that you instead install libjpeg-turbo into\na non-system directory and manipulate the `LD_LIBRARY_PATH` or create symlinks\nto force applications to use libjpeg-turbo instead of libjpeg.  See\n[README.md](README.md) for more information.\n\n\nBuild Recipes\n-------------\n\n\n### 32-bit Build on 64-bit Linux\n\nAdd\n\n    --host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32\n\nto the `configure` command line.\n\n\n### 64-bit Build on 64-bit OS X\n\nAdd\n\n    --host x86_64-apple-darwin NASM=/opt/local/bin/nasm\n\nto the `configure` command line.  NASM 2.07 or later from MacPorts must be\ninstalled.\n\n\n### 32-bit Build on 64-bit OS X\n\nAdd\n\n    --host i686-apple-darwin CFLAGS='-O3 -m32' LDFLAGS=-m32\n\nto the `configure` command line.\n\n\n### 64-bit Backward-Compatible Build on 64-bit OS X\n\nAdd\n\n    --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \\\n      CFLAGS='-mmacosx-version-min=10.5 -O3' \\\n      LDFLAGS='-mmacosx-version-min=10.5'\n\nto the `configure` command line.  NASM 2.07 or later from MacPorts must be\ninstalled.\n\n\n### 32-bit Backward-Compatible Build on OS X\n\nAdd\n\n    --host i686-apple-darwin \\\n      CFLAGS='-mmacosx-version-min=10.5 -O3 -m32' \\\n      LDFLAGS='-mmacosx-version-min=10.5 -m32'\n\nto the `configure` command line.\n\n\n### 64-bit Build on 64-bit Solaris\n\nAdd\n\n    --host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64\n\nto the `configure` command line.\n\n\n### 32-bit Build on 64-bit FreeBSD\n\nAdd\n\n    --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \\\n      LDFLAGS='-B/usr/lib32'\n\nto the `configure` command line.  NASM 2.07 or later from FreeBSD ports must be\ninstalled.\n\n\n### Oracle Solaris Studio\n\nAdd\n\n    CC=cc\n\nto the `configure` command line.  libjpeg-turbo will automatically be built\nwith the maximum optimization level (-xO5) unless you override `CFLAGS`.\n\nTo build a 64-bit version of libjpeg-turbo using Oracle Solaris Studio, add\n\n    --host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64\n\nto the `configure` command line.\n\n\n### MinGW Build on Cygwin\n\nUse CMake (see recipes below)\n\n\nARM Support\n-----------\n\nThis release of libjpeg-turbo can use ARM NEON SIMD instructions to accelerate\nJPEG compression/decompression by approximately 2-4x on ARMv7 and later\nplatforms.  If libjpeg-turbo is configured on an ARM Linux platform, then the\nbuild system will automatically include the NEON SIMD routines, if they are\nsupported.  Build instructions for other ARM-based platforms follow.\n\n\n### Building libjpeg-turbo for iOS\n\niOS platforms, such as the iPhone and iPad, use ARM processors, some of which\nsupport NEON instructions.  Additional steps are required in order to build\nlibjpeg-turbo for these platforms.\n\n\n#### Additional build requirements\n\n- [gas-preprocessor.pl]\n  (https://raw.githubusercontent.com/libjpeg-turbo/gas-preprocessor/master/gas-preprocessor.pl)\n  should be installed in your `PATH`.\n\n\n#### ARM 32-bit Build (Xcode 4.6.x and earlier, LLVM-GCC)\n\nSet the following shell variables for simplicity:\n\n  *Xcode 4.2 and earlier*\n\n    IOS_PLATFORMDIR=/Developer/Platforms/iPhoneOS.platform`\n\n  *Xcode 4.3 and later*\n\n    IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform\n\n  *All Xcode versions*\n\n    IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk\n    IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2\n\n  *ARMv6 (code will run on all iOS devices, not SIMD-accelerated)*  \n  [NOTE: Requires Xcode 4.4.x or earlier]\n\n    IOS_CFLAGS=\"-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp\"\n\n  *ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer)*\n\n    IOS_CFLAGS=\"-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon\"\n\n  *ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer)*  \n  [NOTE: Requires Xcode 4.5 or later]\n\n    IOS_CFLAGS=\"-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon\"\n\nFollow the procedure under \"Building libjpeg-turbo\" above, adding\n\n    --host arm-apple-darwin10 \\\n      CC=\"$IOS_GCC\" LD=\"$IOS_GCC\" \\\n      CFLAGS=\"-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS\" \\\n      LDFLAGS=\"-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS\"\n\nto the `configure` command line.\n\n\n#### ARM 32-bit Build (Xcode 5.0.x and later, Clang)\n\nSet the following shell variables for simplicity:\n\n    IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform\n    IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk\n    IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang\n\n  *ARMv7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer)*\n\n    IOS_CFLAGS=\"-arch armv7\"\n\n  *ARMv7s (code will run on iPhone 5/iPad 4th Generation and newer)*\n\n    IOS_CFLAGS=\"-arch armv7s\"\n\nFollow the procedure under \"Building libjpeg-turbo\" above, adding\n\n    --host arm-apple-darwin10 \\\n      CC=\"$IOS_GCC\" LD=\"$IOS_GCC\" \\\n      CFLAGS=\"-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS\" \\\n      LDFLAGS=\"-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS\" \\\n      CCASFLAGS=\"-no-integrated-as $IOS_CFLAGS\"\n\nto the `configure` command line.\n\n\n#### ARMv8 64-bit Build (Xcode 5.0.x and later, Clang)\n\nCode will run on iPhone 5S/iPad Mini 2/iPad Air and newer.\n\nSet the following shell variables for simplicity:\n\n    IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform\n    IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk\n    IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang\n    IOS_CFLAGS=\"-arch arm64\"\n\nFollow the procedure under \"Building libjpeg-turbo\" above, adding\n\n    --host aarch64-apple-darwin \\\n      CC=\"$IOS_GCC\" LD=\"$IOS_GCC\" \\\n      CFLAGS=\"-isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS\" \\\n      LDFLAGS=\"-isysroot $IOS_SYSROOT $IOS_CFLAGS\"\n\nto the `configure` command line.\n\n\nNOTE:  You can also add `-miphoneos-version-min={version}` to `$IOS_CFLAGS`\nabove in order to support older versions of iOS than the default version\nsupported by the SDK.\n\nOnce built, lipo can be used to combine the ARMv6, v7, v7s, and/or v8 variants\ninto a universal library.\n\n\n### Building libjpeg-turbo for Android\n\nBuilding libjpeg-turbo for Android platforms requires the\n{Android NDK}(https://developer.android.com/tools/sdk/ndk)\nand autotools.  The following is a general recipe script that can be modified for your specific needs.\n\n    # Set these variables to suit your needs\n    NDK_PATH={full path to the \"ndk\" directory-- for example, /opt/android/ndk}\n    BUILD_PLATFORM={the platform name for the NDK package you installed--\n      for example, \"windows-x86\" or \"linux-x86_64\" or \"darwin-x86_64\"}\n    TOOLCHAIN_VERSION={\"4.8\", \"4.9\", \"clang3.5\", etc.  This corresponds to a\n      toolchain directory under ${NDK_PATH}/toolchains/.}\n    ANDROID_VERSION={The minimum version of Android to support-- for example,\n      \"16\", \"19\", etc.  \"21\" or later is required for a 64-bit build.}\n\n    # 32-bit ARMv7 build\n    HOST=arm-linux-androideabi\n    SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm\n    ANDROID_CFLAGS=\"-march=armv7-a -mfloat-abi=softfp -fprefetch-loop-arrays \\\n      --sysroot=${SYSROOT}\"\n\n    # 64-bit ARMv8 build\n    HOST=aarch64-linux-android\n    SYSROOT=${NDK_PATH}/platforms/android-${ANDROID_VERSION}/arch-arm64\n    ANDROID_CFLAGS=\"--sysroot=${SYSROOT}\"\n\n    TOOLCHAIN=${NDK_PATH}/toolchains/${HOST}-${TOOLCHAIN_VERSION}/prebuilt/${BUILD_PLATFORM}\n    ANDROID_INCLUDES=\"-I${SYSROOT}/usr/include -I${TOOLCHAIN}/include\"\n    export CPP=${TOOLCHAIN}/bin/${HOST}-cpp\n    export AR=${TOOLCHAIN}/bin/${HOST}-ar\n    export AS=${TOOLCHAIN}/bin/${HOST}-as\n    export NM=${TOOLCHAIN}/bin/${HOST}-nm\n    export CC=${TOOLCHAIN}/bin/${HOST}-gcc\n    export LD=${TOOLCHAIN}/bin/${HOST}-ld\n    export RANLIB=${TOOLCHAIN}/bin/${HOST}-ranlib\n    export OBJDUMP=${TOOLCHAIN}/bin/${HOST}-objdump\n    export STRIP=${TOOLCHAIN}/bin/${HOST}-strip\n    cd {build_directory}\n    sh {source_directory}/configure --host=${HOST} \\\n      CFLAGS=\"${ANDROID_INCLUDES} ${ANDROID_CFLAGS} -O3 -fPIE\" \\\n      CPPFLAGS=\"${ANDROID_INCLUDES} ${ANDROID_CFLAGS}\" \\\n      LDFLAGS=\"${ANDROID_CFLAGS} -pie\" --with-simd ${1+\"$@\"}\n    make\n\nIf building for Android 4.0.x (API level < 16) or earlier, remove `-fPIE` from\n`CFLAGS` and `-pie` from `LDFLAGS`.\n\n\nBuilding on Windows (Visual C++ or MinGW)\n=========================================\n\n\nBuild Requirements\n------------------\n\n- [CMake](http://www.cmake.org) v2.8.11 or later\n\n- [NASM](http://www.nasm.us) or [YASM](http://yasm.tortall.net)\n  * If using NASM, 0.98 or later is required for an x86 build.\n  * If using NASM, 2.05 or later is required for an x86-64 build.\n  * nasm.exe/yasm.exe should be in your `PATH`.\n\n- Microsoft Visual C++ 2005 or later\n\n  If you don't already have Visual C++, then the easiest way to get it is by\n  installing the\n  [Windows SDK](http://msdn.microsoft.com/en-us/windows/bb980924.aspx).\n  The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and\n  everything necessary to build libjpeg-turbo.\n\n  * You can also use Microsoft Visual Studio Express/Community Edition, which\n    is a free download.  (NOTE: versions prior to 2012 can only be used to\n    build 32-bit code.)\n  * If you intend to build libjpeg-turbo from the command line, then add the\n    appropriate compiler and SDK directories to the `INCLUDE`, `LIB`, and\n    `PATH` environment variables.  This is generally accomplished by\n    executing `vcvars32.bat` or `vcvars64.bat` and `SetEnv.cmd`.\n    `vcvars32.bat` and `vcvars64.bat` are part of Visual C++ and are located in\n    the same directory as the compiler.  `SetEnv.cmd` is part of the Windows\n    SDK.  You can pass optional arguments to `SetEnv.cmd` to specify a 32-bit\n    or 64-bit build environment.\n\n   ... OR ...\n\n- MinGW\n\n  [MinGW-builds](http://sourceforge.net/projects/mingwbuilds/) or\n  [tdm-gcc](http://tdm-gcc.tdragon.net/) recommended if building on a Windows\n  machine.  Both distributions install a Start Menu link that can be used to\n  launch a command prompt with the appropriate compiler paths automatically\n  set.\n\n- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required.  This\n  can be downloaded from <http://www.java.com>.\n\n\nOut-of-Tree Builds\n------------------\n\nBinary objects, libraries, and executables are generated in the same directory\nfrom which `cmake` was executed (the \"binary directory\"), and this directory\nneed not necessarily be the same as the libjpeg-turbo source directory.  You\ncan create multiple independent binary directories, in which different versions\nof libjpeg-turbo can be built from the same source tree using different\ncompilers or settings.  In the sections below, *{build_directory}* refers to\nthe binary directory, whereas *{source_directory}* refers to the libjpeg-turbo\nsource directory.  For in-tree builds, these directories are the same.\n\n\nBuilding libjpeg-turbo\n----------------------\n\n\n### Visual C++ (Command Line)\n\n    cd {build_directory}\n    cmake -G \"NMake Makefiles\" -DCMAKE_BUILD_TYPE=Release {source_directory}\n    nmake\n\nThis will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending\non which version of cl.exe is in the `PATH`.\n\nThe following files will be generated under *{build_directory}*:\n\n**jpeg-static.lib**  \nStatic link library for the libjpeg API\n\n**sharedlib/jpeg{version}.dll**  \nDLL for the libjpeg API\n\n**sharedlib/jpeg.lib**  \nImport library for the libjpeg API\n\n**turbojpeg-static.lib**  \nStatic link library for the TurboJPEG API\n\n**turbojpeg.dll**  \nDLL for the TurboJPEG API\n\n**turbojpeg.lib**  \nImport library for the TurboJPEG API\n\n*{version}* is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or\nv8 emulation is enabled.\n\n\n### Visual C++ (IDE)\n\nChoose the appropriate CMake generator option for your version of Visual Studio\n(run `cmake` with no arguments for a list of available generators.)  For\ninstance:\n\n    cd {build_directory}\n    cmake -G \"Visual Studio 10\" {source_directory}\n\nNOTE:  Add \"Win64\" to the generator name (for example, \"Visual Studio 10\nWin64\") to build a 64-bit version of libjpeg-turbo.  Recent versions of CMake\nno longer document that.  A separate build directory must be used for 32-bit\nand 64-bit builds.\n\nYou can then open ALL_BUILD.vcproj in Visual Studio and build one of the\nconfigurations in that project (\"Debug\", \"Release\", etc.) to generate a full\nbuild of libjpeg-turbo.\n\nThis will generate the following files under *{build_directory}*:\n\n**{configuration}/jpeg-static.lib**  \nStatic link library for the libjpeg API\n\n**sharedlib/{configuration}/jpeg{version}.dll**  \nDLL for the libjpeg API\n\n**sharedlib/{configuration}/jpeg.lib**  \nImport library for the libjpeg API\n\n**{configuration}/turbojpeg-static.lib**  \nStatic link library for the TurboJPEG API\n\n**{configuration}/turbojpeg.dll**  \nDLL for the TurboJPEG API\n\n**{configuration}/turbojpeg.lib**  \nImport library for the TurboJPEG API\n\n*{configuration}* is Debug, Release, RelWithDebInfo, or MinSizeRel, depending\non the configuration you built in the IDE, and *{version}* is 62, 7, or 8,\ndepending on whether libjpeg v6b (default), v7, or v8 emulation is enabled.\n\n\n### MinGW\n\nNOTE: This assumes that you are building on a Windows machine.  If you are\ncross-compiling on a Linux/Unix machine, then see \"Build Recipes\" below.\n\n    cd {build_directory}\n    cmake -G \"MinGW Makefiles\" {source_directory}\n    mingw32-make\n\nThis will generate the following files under *{build_directory}*:\n\n**libjpeg.a**  \nStatic link library for the libjpeg API\n\n**sharedlib/libjpeg-{version}.dll**  \nDLL for the libjpeg API\n\n**sharedlib/libjpeg.dll.a**  \nImport library for the libjpeg API\n\n**libturbojpeg.a**  \nStatic link library for the TurboJPEG API\n\n**libturbojpeg.dll**  \nDLL for the TurboJPEG API\n\n**libturbojpeg.dll.a**  \nImport library for the TurboJPEG API\n\n*{version}* is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or\nv8 emulation is enabled.\n\n\n### Debug Build\n\nAdd `-DCMAKE_BUILD_TYPE=Debug` to the `cmake` command line.  Or, if building\nwith NMake, remove `-DCMAKE_BUILD_TYPE=Release` (Debug builds are the default\nwith NMake.)\n\n\n### libjpeg v7 or v8 API/ABI Emulation\n\nAdd `-DWITH_JPEG7=1` to the `cmake` command line to build a version of\nlibjpeg-turbo that is API/ABI-compatible with libjpeg v7.  Add `-DWITH_JPEG8=1`\nto the `cmake` command line to build a version of libjpeg-turbo that is\nAPI/ABI-compatible with libjpeg v8.  See [README.md](README.md) for more\ninformation on libjpeg v7 and v8 emulation.\n\n\n### In-Memory Source/Destination Managers\n\nWhen using libjpeg v6b or v7 API/ABI emulation, add `-DWITH_MEM_SRCDST=0` to\nthe `cmake` command line to build a version of libjpeg-turbo that lacks the\n`jpeg_mem_src()` and `jpeg_mem_dest()` functions.  These functions were not\npart of the original libjpeg v6b and v7 APIs, so removing them ensures strict\nconformance with those APIs.  See [README.md](README.md) for more information.\n\n\n### Arithmetic Coding Support\n\nSince the patent on arithmetic coding has expired, this functionality has been\nincluded in this release of libjpeg-turbo.  libjpeg-turbo's implementation is\nbased on the implementation in libjpeg v8, but it works when emulating libjpeg\nv7 or v6b as well.  The default is to enable both arithmetic encoding and\ndecoding, but those who have philosophical objections to arithmetic coding can\nadd `-DWITH_ARITH_ENC=0` or `-DWITH_ARITH_DEC=0` to the `cmake` command line to\ndisable encoding or decoding (respectively.)\n\n\n### TurboJPEG Java Wrapper\n\nAdd `-DWITH_JAVA=1` to the `cmake` command line to incorporate an optional Java\nNative Interface wrapper into the TurboJPEG shared library and build the Java\nfront-end classes to support it.  This allows the TurboJPEG shared library to\nbe used directly from Java applications.  See [java/README](java/README) for\nmore details.\n\nYou can set the `Java_JAVAC_EXECUTABLE`, `Java_JAVA_EXECUTABLE`, and\n`Java_JAR_EXECUTABLE` CMake variables to specify alternate commands or\nlocations for javac, jar, and java (respectively.)  You can also set the\n`JAVACFLAGS` CMake variable to specify arguments that should be passed to the\nJava compiler when building the front-end classes.\n\n\nInstalling libjpeg-turbo\n------------------------\n\nYou can use the build system to install libjpeg-turbo into a directory of your\nchoosing (as opposed to creating an installer.)  To do this, add:\n\n    -DCMAKE_INSTALL_PREFIX={install_directory}\n\nto the cmake command line.\n\nFor example,\n\n    cmake -G \"NMake Makefiles\" -DCMAKE_BUILD_TYPE=Release \\\n      -DCMAKE_INSTALL_PREFIX=c:\\libjpeg-turbo {source_directory}\n    nmake install\n\nwill install the header files in c:\\libjpeg-turbo\\include, the library files\nin c:\\libjpeg-turbo\\lib, the DLL's in c:\\libjpeg-turbo\\bin, and the\ndocumentation in c:\\libjpeg-turbo\\doc.\n\n\nBuild Recipes\n-------------\n\n\n### 64-bit MinGW Build on Cygwin\n\n    cd {build_directory}\n    CC=/usr/bin/x86_64-w64-mingw32-gcc \\\n      cmake -G \"Unix Makefiles\" -DCMAKE_SYSTEM_NAME=Windows \\\n      -DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres.exe \\\n      {source_directory}\n    make\n\nThis produces a 64-bit build of libjpeg-turbo that does not depend on\ncygwin1.dll or other Cygwin DLL's.  The mingw64-x86\\_64-gcc-core and\nmingw64-x86\\_64-gcc-g++ packages (and their dependencies) must be installed.\n\n\n### 32-bit MinGW Build on Cygwin\n\n     cd {build_directory}\n     CC=/usr/bin/i686-w64-mingw32-gcc \\\n       cmake -G \"Unix Makefiles\" -DCMAKE_SYSTEM_NAME=Windows \\\n       -DCMAKE_RC_COMPILER=/usr/bin/i686-w64-mingw32-windres.exe \\\n       {source_directory}\n     make\n\nThis produces a 32-bit build of libjpeg-turbo that does not depend on\ncygwin1.dll or other Cygwin DLL's.  The mingw64-i686-gcc-core and\nmingw64-i686-gcc-g++ packages (and their dependencies) must be installed.\n\n\n### MinGW Build on Linux\n\n    cd {build_directory}\n    CC={mingw_binary_path}/i686-pc-mingw32-gcc \\\n      cmake -G \"Unix Makefiles\" -DCMAKE_SYSTEM_NAME=Windows \\\n      -DCMAKE_RC_COMPILER={mingw_binary_path}/i686-pc-mingw32-windres \\\n      -DCMAKE_AR={mingw_binary_path}/i686-pc-mingw32-ar \\\n      -DCMAKE_RANLIB={mingw_binary_path}/i686-pc-mingw32-ranlib \\\n      {source_directory}\n    make\n\n\nCreating Release Packages\n=========================\n\nThe following commands can be used to create various types of release packages:\n\n\nUnix/Linux\n----------\n\n    make rpm\n\nCreate Red Hat-style binary RPM package.  Requires RPM v4 or later.\n\n    make srpm\n\nThis runs `make dist` to create a pristine source tarball, then creates a\nRed Hat-style source RPM package from the tarball.  Requires RPM v4 or later.\n\n    make deb\n\nCreate Debian-style binary package.  Requires dpkg.\n\n    make dmg\n\nCreate Macintosh package/disk image.  This requires pkgbuild and\nproductbuild, which are installed by default on OS X 10.7 and later and which\ncan be obtained by installing Xcode 3.2.6 (with the \"Unix Development\"\noption) on OS X 10.6.  Packages built in this manner can be installed on OS X\n10.5 and later, but they must be built on OS X 10.6 or later.\n\n    make udmg [BUILDDIR32={32-bit build directory}]\n\nOn 64-bit OS X systems, this creates a Macintosh package and disk image that\ncontains universal i386/x86-64 binaries.  You should first configure a 32-bit\nout-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree\nbuild, then run `make udmg` from the 64-bit build directory.  The build\nsystem will look for the 32-bit build under *{source_directory}*/osxx86 by\ndefault, but you can override this by setting the `BUILDDIR32` variable on the\nmake command line as shown above.\n\n    make iosdmg [BUILDDIR32={32-bit build directory}] \\\n      [BUILDDIRARMV6={ARMv6 build directory}] \\\n      [BUILDDIRARMV7={ARMv7 build directory}] \\\n      [BUILDDIRARMV7S={ARMv7s build directory}] \\\n      [BUILDDIRARMV8={ARMv8 build directory}]\n\nOn OS X systems, this creates a Macintosh package and disk image in which the\nlibjpeg-turbo static libraries contain ARM architectures necessary to build\niOS applications.  If building on an x86-64 system, the binaries will also\ncontain the i386 architecture, as with `make udmg` above.  You should first\nconfigure ARMv6, ARMv7, ARMv7s, and/or ARMv8 out-of-tree builds of\nlibjpeg-turbo (see \"Building libjpeg-turbo for iOS\" above.)  If you are\nbuilding an x86-64 version of libjpeg-turbo, you should configure a 32-bit\nout-of-tree build as well.  Next, build libjpeg-turbo as you would normally,\nusing an out-of-tree build.  When it is built, run `make iosdmg` from the\nbuild directory.  The build system will look for the ARMv6 build under\n*{source_directory}*/iosarmv6 by default, the ARMv7 build under\n*{source_directory}*/iosarmv7 by default, the ARMv7s build under\n*{source_directory}*/iosarmv7s by default, the ARMv8 build under\n*{source_directory}*/iosarmv8 by default, and (if applicable) the 32-bit build\nunder *{source_directory}*/osxx86 by default, but you can override this by\nsetting the `BUILDDIR32`, `BUILDDIRARMV6`, `BUILDDIRARMV7`, `BUILDDIRARMV7S`,\nand/or `BUILDDIRARMV8` variables on the `make` command line as shown above.\n\nNOTE: If including an ARMv8 build in the package, then you may need to use\nXcode's version of lipo instead of the operating system's.  To do this, pass\nan argument of `LIPO=\"xcrun lipo\"` on the make command line.\n\n    make cygwinpkg\n\nBuild a Cygwin binary package.\n\n\nWindows\n-------\n\nIf using NMake:\n\n    cd {build_directory}\n    nmake installer\n\nIf using MinGW:\n\n    cd {build_directory}\n    make installer\n\nIf using the Visual Studio IDE, build the \"installer\" project.\n\nThe installer package (libjpeg-turbo[-gcc][64].exe) will be located under\n*{build_directory}*.  If building using the Visual Studio IDE, then the\ninstaller package will be located in a subdirectory with the same name as the\nconfiguration you built (such as *{build_directory}*\\Debug\\ or\n*{build_directory}*\\Release\\).\n\nBuilding a Windows installer requires the Nullsoft Install System\n(http://nsis.sourceforge.net/.)  makensis.exe should be in your `PATH`.\n\n\nRegression testing\n==================\n\nThe most common way to test libjpeg-turbo is by invoking `make test` on\nUnix/Linux platforms or `ctest` on Windows platforms, once the build has\ncompleted.  This runs a series of tests to ensure that mathematical\ncompatibility has been maintained between libjpeg-turbo and libjpeg v6b.  This\nalso invokes the TurboJPEG unit tests, which ensure that the colorspace\nextensions, YUV encoding, decompression scaling, and other features of the\nTurboJPEG C and Java APIs are working properly (and, by extension, that the\nequivalent features of the underlying libjpeg API are also working.)\n\nInvoking `make testclean` or `nmake testclean` (if using NMake) or building\nthe 'testclean' target (if using the Visual Studio IDE) will clean up the\noutput images generated by `make test`.\n\nOn Unix/Linux platforms, more extensive tests of the TurboJPEG C and Java\nwrappers can be run by invoking `make tjtest`.  These extended TurboJPEG tests\nessentially iterate through all of the available features of the TurboJPEG APIs\nthat are not covered by the TurboJPEG unit tests (this includes the lossless\ntransform options) and compare the images generated by each feature to images\ngenerated using the equivalent feature in the libjpeg API.  The extended\nTurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers,\nnot in the underlying libjpeg API library.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/CMakeLists.txt",
    "content": "#\n# Setup\n#\n\ncmake_minimum_required(VERSION 2.8.11)\n# Use LINK_INTERFACE_LIBRARIES instead of INTERFACE_LINK_LIBRARIES\nif(POLICY CMP0022)\n  cmake_policy(SET CMP0022 OLD)\nendif()\n\nproject(libjpeg-turbo C)\nset(VERSION 1.5.0)\nstring(REPLACE \".\" \";\" VERSION_TRIPLET ${VERSION})\nlist(GET VERSION_TRIPLET 0 VERSION_MAJOR)\nlist(GET VERSION_TRIPLET 1 VERSION_MINOR)\nlist(GET VERSION_TRIPLET 2 VERSION_REVISION)\nfunction(pad_number NUMBER OUTPUT_LEN)\n  string(LENGTH \"${${NUMBER}}\" INPUT_LEN)\n  if(INPUT_LEN LESS OUTPUT_LEN)\n    math(EXPR ZEROES \"${OUTPUT_LEN} - ${INPUT_LEN} - 1\")\n    set(NUM ${${NUMBER}})\n    foreach(C RANGE ${ZEROES})\n      set(NUM \"0${NUM}\")\n    endforeach()\n    set(${NUMBER} ${NUM} PARENT_SCOPE)\n  endif()\nendfunction()\npad_number(VERSION_MINOR 3)\npad_number(VERSION_REVISION 3)\nset(LIBJPEG_TURBO_VERSION_NUMBER ${VERSION_MAJOR}${VERSION_MINOR}${VERSION_REVISION})\n\nif(NOT WIN32)\n  message(FATAL_ERROR \"Platform not supported by this build system.  Use autotools instead.\")\nendif()\n\nstring(TIMESTAMP BUILD \"%Y%m%d\")\n\n# This does nothing except when using MinGW.  CMAKE_BUILD_TYPE has no meaning\n# in Visual Studio, and it always defaults to Debug when using NMake.\nif(NOT CMAKE_BUILD_TYPE)\n  set(CMAKE_BUILD_TYPE Release)\nendif()\n\nmessage(STATUS \"CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}\")\n\n# This only works if building from the command line.  There is currently no way\n# to set a variable's value based on the build type when using Visual Studio.\nif(CMAKE_BUILD_TYPE STREQUAL \"Debug\")\n  set(BUILD \"${BUILD}d\")\nendif()\n\nmessage(STATUS \"VERSION = ${VERSION}, BUILD = ${BUILD}\")\n\noption(WITH_SIMD \"Include SIMD extensions\" TRUE)\noption(WITH_ARITH_ENC \"Include arithmetic encoding support when emulating the libjpeg v6b API/ABI\" TRUE)\noption(WITH_ARITH_DEC \"Include arithmetic decoding support when emulating the libjpeg v6b API/ABI\" TRUE)\noption(WITH_JPEG7 \"Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)\" FALSE)\noption(WITH_JPEG8 \"Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)\" FALSE)\noption(WITH_MEM_SRCDST \"Include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI\" TRUE)\noption(WITH_TURBOJPEG \"Include the TurboJPEG wrapper library and associated test programs\" TRUE)\noption(WITH_JAVA \"Build Java wrapper for the TurboJPEG library\" FALSE)\noption(WITH_12BIT \"Encode/decode JPEG images with 12-bit samples (implies WITH_SIMD=0 WITH_TURBOJPEG=0 WITH_ARITH_ENC=0 WITH_ARITH_DEC=0)\" FALSE)\noption(ENABLE_STATIC \"Build static libraries\" TRUE)\noption(ENABLE_SHARED \"Build shared libraries\" TRUE)\n\nif(WITH_12BIT)\n  set(WITH_SIMD FALSE)\n  set(WITH_TURBOJPEG FALSE)\n  set(WITH_JAVA FALSE)\n  set(WITH_ARITH_ENC FALSE)\n  set(WITH_ARITH_DEC FALSE)\n  set(BITS_IN_JSAMPLE 12)\n  message(STATUS \"12-bit JPEG support enabled\")\nelse()\n  set(BITS_IN_JSAMPLE 8)\nendif()\n\nif(WITH_JPEG8 OR WITH_JPEG7)\n  set(WITH_ARITH_ENC 1)\n  set(WITH_ARITH_DEC 1)\nendif()\nif(WITH_JPEG8)\n  set(WITH_MEM_SRCDST 1)\nendif()\n\nif(WITH_ARITH_ENC)\n  set(C_ARITH_CODING_SUPPORTED 1)\n  message(STATUS \"Arithmetic encoding support enabled\")\nelse()\n  message(STATUS \"Arithmetic encoding support disabled\")\nendif()\n\nif(WITH_ARITH_DEC)\n  set(D_ARITH_CODING_SUPPORTED 1)\n  message(STATUS \"Arithmetic decoding support enabled\")\nelse()\n  message(STATUS \"Arithmetic decoding support disabled\")\nendif()\n\nif(WITH_TURBOJPEG)\n  message(STATUS \"TurboJPEG C wrapper enabled\")\nelse()\n  message(STATUS \"TurboJPEG C wrapper disabled\")\nendif()\n\nif(WITH_JAVA)\n  message(STATUS \"TurboJPEG Java wrapper enabled\")\nelse()\n  message(STATUS \"TurboJPEG Java wrapper disabled\")\nendif()\n\nset(SO_AGE 0)\nif(WITH_MEM_SRCDST)\n  set(SO_AGE 1)\nendif()\n\nset(JPEG_LIB_VERSION 62)\nset(DLL_VERSION ${JPEG_LIB_VERSION})\nset(FULLVERSION ${DLL_VERSION}.${SO_AGE}.0)\nif(WITH_JPEG8)\n  set(JPEG_LIB_VERSION 80)\n  set(DLL_VERSION 8)\n  set(FULLVERSION ${DLL_VERSION}.0.2)\n  message(STATUS \"Emulating libjpeg v8 API/ABI\")\nelseif(WITH_JPEG7)\n  set(JPEG_LIB_VERSION 70)\n  set(DLL_VERSION 7)\n  set(FULLVERSION ${DLL_VERSION}.${SO_AGE}.0)\n  message(STATUS \"Emulating libjpeg v7 API/ABI\")\nendif(WITH_JPEG8)\n\nif(WITH_MEM_SRCDST)\n  set(MEM_SRCDST_SUPPORTED 1)\n  message(STATUS \"In-memory source/destination managers enabled\")\nelse()\n  message(STATUS \"In-memory source/destination managers disabled\")\nendif()\n\nif(MSVC)\n  option(WITH_CRT_DLL\n    \"Link all libjpeg-turbo libraries and executables with the C run-time DLL (msvcr*.dll) instead of the static C run-time library (libcmt*.lib.)  The default is to use the C run-time DLL only with the libraries and executables that need it.\"\n    FALSE)\n  if(NOT WITH_CRT_DLL)\n    # Use the static C library for all build types\n    foreach(var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE\n      CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)\n      if(${var} MATCHES \"/MD\")\n        string(REGEX REPLACE \"/MD\" \"/MT\" ${var} \"${${var}}\")\n      endif()\n    endforeach()\n  endif()\n  add_definitions(-W3 -wd4996)\nendif()\n\n# Detect whether compiler is 64-bit\nif(MSVC AND CMAKE_CL_64)\n  set(SIMD_X86_64 1)\n  set(64BIT 1)\nelseif(CMAKE_SIZEOF_VOID_P MATCHES 8)\n  set(SIMD_X86_64 1)\n  set(64BIT 1)\nendif()\n\nif(64BIT)\n  message(STATUS \"64-bit build\")\nelse()\n  message(STATUS \"32-bit build\")\nendif()\n\nif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)\n  if(MSVC)\n    set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_PROJECT_NAME})\n  else()\n    set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_PROJECT_NAME}-gcc)\n  endif()\n  if(64BIT)\n    set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_INSTALL_PREFIX_DEFAULT}64)\n  endif()\n  set(CMAKE_INSTALL_PREFIX \"c:/${CMAKE_INSTALL_PREFIX_DEFAULT}\" CACHE PATH\n    \"Directory into which to install libjpeg-turbo (default: c:/${CMAKE_INSTALL_PREFIX_DEFAULT})\"\n    FORCE)\nendif()\n\nmessage(STATUS \"Install directory = ${CMAKE_INSTALL_PREFIX}\")\n\nconfigure_file(win/jconfig.h.in jconfig.h)\nconfigure_file(win/jconfigint.h.in jconfigint.h)\n\ninclude_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})\n\nstring(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)\n\nset(EFFECTIVE_C_FLAGS \"${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UC}}\")\nmessage(STATUS \"Compiler flags = ${EFFECTIVE_C_FLAGS}\")\n\nset(EFFECTIVE_LD_FLAGS \"${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_UC}}\")\nmessage(STATUS \"Linker flags = ${EFFECTIVE_LD_FLAGS}\")\n\nif(WITH_JAVA)\n  find_package(Java)\n  find_package(JNI)\n  if(DEFINED JAVACFLAGS)\n    message(STATUS \"Java compiler flags = ${JAVACFLAGS}\")\n  endif()\nendif()\n\n\n#\n# Targets\n#\n\nset(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c\n  jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c\n  jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c\n  jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c\n  jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c\n  jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c\n  jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)\n\nif(WITH_ARITH_ENC OR WITH_ARITH_DEC)\n  set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c)\nendif()\n\nif(WITH_ARITH_ENC)\n  set(JPEG_SOURCES ${JPEG_SOURCES} jcarith.c)\nendif()\n\nif(WITH_ARITH_DEC)\n  set(JPEG_SOURCES ${JPEG_SOURCES} jdarith.c)\nendif()\n\nif(WITH_SIMD)\n  add_definitions(-DWITH_SIMD)\n  add_subdirectory(simd)\n  if(SIMD_X86_64)\n    set(JPEG_SOURCES ${JPEG_SOURCES} simd/jsimd_x86_64.c)\n  else()\n    set(JPEG_SOURCES ${JPEG_SOURCES} simd/jsimd_i386.c)\n  endif()\n  # This tells CMake that the \"source\" files haven't been generated yet\n  set_source_files_properties(${SIMD_OBJS} PROPERTIES GENERATED 1)\nelse()\n  set(JPEG_SOURCES ${JPEG_SOURCES} jsimd_none.c)\n  message(STATUS \"Not using SIMD acceleration\")\nendif()\n\nif(WITH_JAVA)\n  add_subdirectory(java)\n  set(ENABLE_SHARED TRUE)\nendif()\n\nif(ENABLE_SHARED)\n  add_subdirectory(sharedlib)\nendif()\n\nif(ENABLE_STATIC OR WITH_TURBOJPEG)\n  add_library(jpeg-static STATIC ${JPEG_SOURCES} ${SIMD_OBJS})\n  if(NOT MSVC)\n    set_target_properties(jpeg-static PROPERTIES OUTPUT_NAME jpeg)\n  endif()\n  if(WITH_SIMD)\n    add_dependencies(jpeg-static simd)\n  endif()\nendif()\n\nif(WITH_TURBOJPEG)\n  set(TURBOJPEG_SOURCES turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c)\n  if(WITH_JAVA)\n    set(TURBOJPEG_SOURCES ${TURBOJPEG_SOURCES} turbojpeg-jni.c)\n    include_directories(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})\n  endif()\n\n  if(ENABLE_SHARED)\n    add_library(turbojpeg SHARED ${TURBOJPEG_SOURCES})\n    set_target_properties(turbojpeg PROPERTIES DEFINE_SYMBOL DLLDEFINE)\n    if(MINGW)\n      set_target_properties(turbojpeg PROPERTIES LINK_FLAGS -Wl,--kill-at)\n    endif()\n    target_link_libraries(turbojpeg jpeg-static)\n    set_target_properties(turbojpeg PROPERTIES LINK_INTERFACE_LIBRARIES \"\")\n\n    add_executable(tjunittest tjunittest.c tjutil.c)\n    target_link_libraries(tjunittest turbojpeg)\n\n    add_executable(tjbench tjbench.c bmp.c tjutil.c rdbmp.c rdppm.c wrbmp.c\n      wrppm.c)\n    target_link_libraries(tjbench turbojpeg jpeg-static)\n    set_property(TARGET tjbench PROPERTY COMPILE_FLAGS\n      \"-DBMP_SUPPORTED -DPPM_SUPPORTED\")\n  endif()\n\n  if(ENABLE_STATIC)\n    add_library(turbojpeg-static STATIC ${JPEG_SOURCES} ${SIMD_OBJS}\n      turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c)\n    if(NOT MSVC)\n      set_target_properties(turbojpeg-static PROPERTIES OUTPUT_NAME turbojpeg)\n    endif()\n    if(WITH_SIMD)\n      add_dependencies(turbojpeg-static simd)\n    endif()\n\n    add_executable(tjunittest-static tjunittest.c tjutil.c)\n    target_link_libraries(tjunittest-static turbojpeg-static)\n\n    add_executable(tjbench-static tjbench.c bmp.c tjutil.c rdbmp.c rdppm.c\n      wrbmp.c wrppm.c)\n    target_link_libraries(tjbench-static turbojpeg-static jpeg-static)\n    set_property(TARGET tjbench-static PROPERTY COMPILE_FLAGS\n      \"-DBMP_SUPPORTED -DPPM_SUPPORTED\")\n  endif()\nendif()\n\nif(WITH_12BIT)\n  set(COMPILE_FLAGS \"-DGIF_SUPPORTED -DPPM_SUPPORTED -DUSE_SETMODE\")\nelse()\n  set(COMPILE_FLAGS \"-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE\")\n  set(CJPEG_BMP_SOURCES rdbmp.c rdtarga.c)\n  set(DJPEG_BMP_SOURCES wrbmp.c wrtarga.c)\nendif()\n\nif(ENABLE_STATIC)\n  add_executable(cjpeg-static cjpeg.c cdjpeg.c rdgif.c rdppm.c rdswitch.c\n    ${CJPEG_BMP_SOURCES})\n  set_property(TARGET cjpeg-static PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})\n  target_link_libraries(cjpeg-static jpeg-static)\n\n  add_executable(djpeg-static djpeg.c cdjpeg.c rdcolmap.c rdswitch.c wrgif.c\n    wrppm.c ${DJPEG_BMP_SOURCES})\n  set_property(TARGET djpeg-static PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})\n  target_link_libraries(djpeg-static jpeg-static)\n\n  add_executable(jpegtran-static jpegtran.c cdjpeg.c rdswitch.c transupp.c)\n  target_link_libraries(jpegtran-static jpeg-static)\n  set_property(TARGET jpegtran-static PROPERTY COMPILE_FLAGS \"-DUSE_SETMODE\")\nendif()\n\nadd_executable(rdjpgcom rdjpgcom.c)\n\nadd_executable(wrjpgcom wrjpgcom.c)\n\n\n#\n# Tests\n#\n\nadd_subdirectory(md5)\n\nif(MSVC_IDE)\n  set(OBJDIR \"\\${CTEST_CONFIGURATION_TYPE}/\")\nelse()\n  set(OBJDIR \"\")\nendif()\n\nenable_testing()\n\nif(WITH_12BIT)\n  set(TESTORIG testorig12.jpg)\n  set(MD5_JPEG_RGB_ISLOW 9620f424569594bb9242b48498ad801f)\n  set(MD5_PPM_RGB_ISLOW f3301d2219783b8b3d942b7239fa50c0)\n  set(MD5_JPEG_422_IFAST_OPT 7322e3bd2f127f7de4b40d4480ce60e4)\n  set(MD5_PPM_422_IFAST 79807fa552899e66a04708f533e16950)\n  set(MD5_PPM_422M_IFAST 07737bfe8a7c1c87aaa393a0098d16b0)\n  set(MD5_JPEG_420_IFAST_Q100_PROG a1da220b5604081863a504297ed59e55)\n  set(MD5_PPM_420_Q100_IFAST 1b3730122709f53d007255e8dfd3305e)\n  set(MD5_PPM_420M_Q100_IFAST 980a1a3c5bf9510022869d30b7d26566)\n  set(MD5_JPEG_GRAY_ISLOW 235c90707b16e2e069f37c888b2636d9)\n  set(MD5_PPM_GRAY_ISLOW 7213c10af507ad467da5578ca5ee1fca)\n  set(MD5_PPM_GRAY_ISLOW_RGB e96ee81c30a6ed422d466338bd3de65d)\n  set(MD5_JPEG_420S_IFAST_OPT 7af8e60be4d9c227ec63ac9b6630855e)\n  set(MD5_JPEG_3x2_FLOAT_PROG a8c17daf77b457725ec929e215b603f8)\n  set(MD5_PPM_3x2_FLOAT 42876ab9e5c2f76a87d08db5fbd57956)\n  set(MD5_PPM_420M_ISLOW_2_1 4ca6be2a6f326ff9eaab63e70a8259c0)\n  set(MD5_PPM_420M_ISLOW_15_8 12aa9f9534c1b3d7ba047322226365eb)\n  set(MD5_PPM_420M_ISLOW_13_8 f7e22817c7b25e1393e4ec101e9d4e96)\n  set(MD5_PPM_420M_ISLOW_11_8 800a16f9f4dc9b293197bfe11be10a82)\n  set(MD5_PPM_420M_ISLOW_9_8 06b7a92a9bc69f4dc36ec40f1937d55c)\n  set(MD5_PPM_420M_ISLOW_7_8 3ec444a14a4ab4eab88ffc49c48eca43)\n  set(MD5_PPM_420M_ISLOW_3_4 3e726b7ea872445b19437d1c1d4f0d93)\n  set(MD5_PPM_420M_ISLOW_5_8 a8a771abdc94301d20ffac119b2caccd)\n  set(MD5_PPM_420M_ISLOW_1_2 b419124dd5568b085787234866102866)\n  set(MD5_PPM_420M_ISLOW_3_8 343d19015531b7bbe746124127244fa8)\n  set(MD5_PPM_420M_ISLOW_1_4 35fd59d866e44659edfa3c18db2a3edb)\n  set(MD5_PPM_420M_ISLOW_1_8 ccaed48ac0aedefda5d4abe4013f4ad7)\n  set(MD5_PPM_420_ISLOW_SKIP15_31 86664cd9dc956536409e44e244d20a97)\n  set(MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 452a21656115a163029cfba5c04fa76a)\n  set(MD5_PPM_444_ISLOW_SKIP1_6 ef63901f71ef7a75cd78253fc0914f84)\n  set(MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 15b173fb5872d9575572fbcc1b05956f)\n  set(MD5_JPEG_CROP cdb35ff4b4519392690ea040c56ea99c)\nelse()\n  set(TESTORIG testorig.jpg)\n  set(MD5_JPEG_RGB_ISLOW 768e970dd57b340ff1b83c9d3d47c77b)\n  set(MD5_PPM_RGB_ISLOW 00a257f5393fef8821f2b88ac7421291)\n  set(MD5_BMP_RGB_ISLOW_565 f07d2e75073e4bb10f6c6f4d36e2e3be)\n  set(MD5_BMP_RGB_ISLOW_565D 4cfa0928ef3e6bb626d7728c924cfda4)\n  set(MD5_JPEG_422_IFAST_OPT 2540287b79d913f91665e660303ab2c8)\n  set(MD5_PPM_422_IFAST 35bd6b3f833bad23de82acea847129fa)\n  set(MD5_PPM_422M_IFAST 8dbc65323d62cca7c91ba02dd1cfa81d)\n  set(MD5_BMP_422M_IFAST_565 3294bd4d9a1f2b3d08ea6020d0db7065)\n  set(MD5_BMP_422M_IFAST_565D da98c9c7b6039511be4a79a878a9abc1)\n  set(MD5_JPEG_420_IFAST_Q100_PROG 990cbe0329c882420a2094da7e5adade)\n  set(MD5_PPM_420_Q100_IFAST 5a732542015c278ff43635e473a8a294)\n  set(MD5_PPM_420M_Q100_IFAST ff692ee9323a3b424894862557c092f1)\n  set(MD5_JPEG_GRAY_ISLOW 72b51f894b8f4a10b3ee3066770aa38d)\n  set(MD5_PPM_GRAY_ISLOW 8d3596c56eace32f205deccc229aa5ed)\n  set(MD5_PPM_GRAY_ISLOW_RGB 116424ac07b79e5e801f00508eab48ec)\n  set(MD5_BMP_GRAY_ISLOW_565 12f78118e56a2f48b966f792fedf23cc)\n  set(MD5_BMP_GRAY_ISLOW_565D bdbbd616441a24354c98553df5dc82db)\n  set(MD5_JPEG_420S_IFAST_OPT 388708217ac46273ca33086b22827ed8)\n  if(WITH_SIMD)\n    set(MD5_JPEG_3x2_FLOAT_PROG 343e3f8caf8af5986ebaf0bdc13b5c71)\n    set(MD5_PPM_3x2_FLOAT 1a75f36e5904d6fc3a85a43da9ad89bb)\n  else()\n    set(MD5_JPEG_3x2_FLOAT_PROG 9bca803d2042bd1eb03819e2bf92b3e5)\n    set(MD5_PPM_3x2_FLOAT f6bfab038438ed8f5522fbd33595dcdc)\n  endif()\n  set(MD5_JPEG_420_ISLOW_ARI e986fb0a637a8d833d96e8a6d6d84ea1)\n  set(MD5_JPEG_444_ISLOW_PROGARI 0a8f1c8f66e113c3cf635df0a475a617)\n  set(MD5_PPM_420M_IFAST_ARI 72b59a99bcf1de24c5b27d151bde2437)\n  set(MD5_JPEG_420_ISLOW 9a68f56bc76e466aa7e52f415d0f4a5f)\n  set(MD5_PPM_420M_ISLOW_2_1 9f9de8c0612f8d06869b960b05abf9c9)\n  set(MD5_PPM_420M_ISLOW_15_8 b6875bc070720b899566cc06459b63b7)\n  set(MD5_PPM_420M_ISLOW_13_8 bc3452573c8152f6ae552939ee19f82f)\n  set(MD5_PPM_420M_ISLOW_11_8 d8cc73c0aaacd4556569b59437ba00a5)\n  set(MD5_PPM_420M_ISLOW_9_8 d25e61bc7eac0002f5b393aa223747b6)\n  set(MD5_PPM_420M_ISLOW_7_8 ddb564b7c74a09494016d6cd7502a946)\n  set(MD5_PPM_420M_ISLOW_3_4 8ed8e68808c3fbc4ea764fc9d2968646)\n  set(MD5_PPM_420M_ISLOW_5_8 a3363274999da2366a024efae6d16c9b)\n  set(MD5_PPM_420M_ISLOW_1_2 e692a315cea26b988c8e8b29a5dbcd81)\n  set(MD5_PPM_420M_ISLOW_3_8 79eca9175652ced755155c90e785a996)\n  set(MD5_PPM_420M_ISLOW_1_4 79cd778f8bf1a117690052cacdd54eca)\n  set(MD5_PPM_420M_ISLOW_1_8 391b3d4aca640c8567d6f8745eb2142f)\n  set(MD5_BMP_420_ISLOW_256 4980185e3776e89bd931736e1cddeee6)\n  set(MD5_BMP_420_ISLOW_565 bf9d13e16c4923b92e1faa604d7922cb)\n  set(MD5_BMP_420_ISLOW_565D 6bde71526acc44bcff76f696df8638d2)\n  set(MD5_BMP_420M_ISLOW_565 8dc0185245353cfa32ad97027342216f)\n  set(MD5_BMP_420M_ISLOW_565D d1be3a3339166255e76fa50a0d70d73e)\n  set(MD5_PPM_420_ISLOW_SKIP15_31 c4c65c1e43d7275cd50328a61e6534f0)\n  set(MD5_PPM_420_ISLOW_ARI_SKIP16_139 087c6b123db16ac00cb88c5b590bb74a)\n  set(MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 26eb36ccc7d1f0cb80cdabb0ac8b5d99)\n  set(MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4 886c6775af22370257122f8b16207e6d)\n  set(MD5_PPM_444_ISLOW_SKIP1_6 5606f86874cf26b8fcee1117a0a436a6)\n  set(MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 db87dc7ce26bcdc7a6b56239ce2b9d6c)\n  set(MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0 cb57b32bd6d03e35432362f7bf184b6d)\n  set(MD5_JPEG_CROP b4197f377e621c4e9b1d20471432610d)\nendif()\n\nif(WITH_JAVA)\n  add_test(TJUnitTest\n    ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar\n      -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}\n      TJUnitTest)\n  add_test(TJUnitTest-yuv\n    ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar\n      -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}\n      TJUnitTest -yuv)\n  add_test(TJUnitTest-yuv-nopad\n    ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar\n      -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}\n      TJUnitTest -yuv -noyuvpad)\n  add_test(TJUnitTest-bi\n    ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar\n      -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}\n      TJUnitTest -bi)\n  add_test(TJUnitTest-bi-yuv\n    ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar\n      -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}\n      TJUnitTest -bi -yuv)\n  add_test(TJUnitTest-bi-yuv-nopad\n    ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar\n      -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR}\n      TJUnitTest -bi -yuv -noyuvpad)\nendif()\n\nset(TEST_LIBTYPES \"\")\nif(ENABLE_SHARED)\n  set(TEST_LIBTYPES ${TEST_LIBTYPES} shared)\nendif()\nif(ENABLE_STATIC)\n  set(TEST_LIBTYPES ${TEST_LIBTYPES} static)\nendif()\n\nset(TESTIMAGES ${CMAKE_SOURCE_DIR}/testimages)\nset(MD5CMP ${CMAKE_CURRENT_BINARY_DIR}/md5/md5cmp)\nif(CMAKE_CROSSCOMPILING)\n  file(RELATIVE_PATH TESTIMAGES ${CMAKE_CURRENT_BINARY_DIR} ${TESTIMAGES})\n  file(RELATIVE_PATH MD5CMP ${CMAKE_CURRENT_BINARY_DIR} ${MD5CMP})\nendif()\n\nforeach(libtype ${TEST_LIBTYPES})\n  if(libtype STREQUAL \"shared\")\n    set(dir sharedlib/)\n  else()\n    set(dir \"\")\n    set(suffix -static)\n  endif()\n  if(WITH_TURBOJPEG)\n    add_test(tjunittest${suffix} tjunittest${suffix})\n    add_test(tjunittest${suffix}-alloc tjunittest${suffix} -alloc)\n    add_test(tjunittest${suffix}-yuv tjunittest${suffix} -yuv)\n    add_test(tjunittest${suffix}-yuv-alloc tjunittest${suffix} -yuv -alloc)\n    add_test(tjunittest${suffix}-yuv-nopad tjunittest${suffix} -yuv -noyuvpad)\n  endif()\n\n  # These tests are carefully chosen to provide full coverage of as many of the\n  # underlying algorithms as possible (including all of the SIMD-accelerated\n  # ones.)\n\n  # CC: null  SAMP: fullsize  FDCT: islow  ENT: huff\n  add_test(cjpeg${suffix}-rgb-islow\n    ${dir}cjpeg${suffix} -rgb -dct int\n      -outfile testout_rgb_islow.jpg ${TESTIMAGES}/testorig.ppm)\n  add_test(cjpeg${suffix}-rgb-islow-cmp\n    ${MD5CMP} ${MD5_JPEG_RGB_ISLOW} testout_rgb_islow.jpg)\n\n  # CC: null  SAMP: fullsize  IDCT: islow  ENT: huff\n  add_test(djpeg${suffix}-rgb-islow\n    ${dir}djpeg${suffix} -dct int -ppm\n      -outfile testout_rgb_islow.ppm testout_rgb_islow.jpg)\n  add_test(djpeg${suffix}-rgb-islow-cmp\n    ${MD5CMP} ${MD5_PPM_RGB_ISLOW} testout_rgb_islow.ppm)\n\n  if(NOT WITH_12BIT)\n    # CC: RGB->RGB565  SAMP: fullsize  IDCT: islow  ENT: huff\n    add_test(djpeg${suffix}-rgb-islow-565\n      ${dir}djpeg${suffix} -dct int -rgb565 -dither none -bmp\n        -outfile testout_rgb_islow_565.bmp testout_rgb_islow.jpg)\n    add_test(djpeg${suffix}-rgb-islow-565-cmp\n      ${MD5CMP} ${MD5_BMP_RGB_ISLOW_565} testout_rgb_islow_565.bmp)\n\n    # CC: RGB->RGB565 (dithered)  SAMP: fullsize  IDCT: islow  ENT: huff\n    add_test(djpeg${suffix}-rgb-islow-565D\n      ${dir}djpeg${suffix} -dct int -rgb565 -bmp\n        -outfile testout_rgb_islow_565D.bmp testout_rgb_islow.jpg)\n    add_test(djpeg${suffix}-rgb-islow-565D-cmp\n      ${MD5CMP} ${MD5_BMP_RGB_ISLOW_565D} testout_rgb_islow_565D.bmp)\n  endif()\n\n  # CC: RGB->YCC  SAMP: fullsize/h2v1  FDCT: ifast  ENT: 2-pass huff\n  add_test(cjpeg${suffix}-422-ifast-opt\n    ${dir}cjpeg${suffix} -sample 2x1 -dct fast -opt\n      -outfile testout_422_ifast_opt.jpg ${TESTIMAGES}/testorig.ppm)\n  add_test(cjpeg${suffix}-422-ifast-opt-cmp\n    ${MD5CMP} ${MD5_JPEG_422_IFAST_OPT} testout_422_ifast_opt.jpg)\n\n  # CC: YCC->RGB  SAMP: fullsize/h2v1 fancy  IDCT: ifast  ENT: huff\n  add_test(djpeg${suffix}-422-ifast\n    ${dir}djpeg${suffix} -dct fast\n      -outfile testout_422_ifast.ppm testout_422_ifast_opt.jpg)\n  add_test(djpeg${suffix}-422-ifast-cmp\n    ${MD5CMP} ${MD5_PPM_422_IFAST} testout_422_ifast.ppm)\n\n  # CC: YCC->RGB  SAMP: h2v1 merged  IDCT: ifast  ENT: huff\n  add_test(djpeg${suffix}-422m-ifast\n    ${dir}djpeg${suffix} -dct fast -nosmooth\n      -outfile testout_422m_ifast.ppm testout_422_ifast_opt.jpg)\n  add_test(djpeg${suffix}-422m-ifast-cmp\n    ${MD5CMP} ${MD5_PPM_422M_IFAST} testout_422m_ifast.ppm)\n\n  if(NOT WITH_12BIT)\n    # CC: YCC->RGB565  SAMP: h2v1 merged  IDCT: ifast  ENT: huff\n    add_test(djpeg${suffix}-422m-ifast-565\n      ${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -dither none -bmp\n        -outfile testout_422m_ifast_565.bmp testout_422_ifast_opt.jpg)\n    add_test(djpeg${suffix}-422m-ifast-565-cmp\n      ${MD5CMP} ${MD5_BMP_422M_IFAST_565} testout_422m_ifast_565.bmp)\n\n    # CC: YCC->RGB565 (dithered)  SAMP: h2v1 merged  IDCT: ifast  ENT: huff\n    add_test(djpeg${suffix}-422m-ifast-565D\n      ${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -bmp\n        -outfile testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg)\n    add_test(djpeg${suffix}-422m-ifast-565D-cmp\n      ${MD5CMP} ${MD5_BMP_422M_IFAST_565D} testout_422m_ifast_565D.bmp)\n  endif()\n\n  # CC: RGB->YCC  SAMP: fullsize/h2v2  FDCT: ifast  ENT: prog huff\n  add_test(cjpeg${suffix}-420-q100-ifast-prog\n    ${dir}cjpeg${suffix} -sample 2x2 -quality 100 -dct fast -prog\n      -outfile testout_420_q100_ifast_prog.jpg ${TESTIMAGES}/testorig.ppm)\n  add_test(cjpeg${suffix}-420-q100-ifast-prog-cmp\n    ${MD5CMP} ${MD5_JPEG_420_IFAST_Q100_PROG} testout_420_q100_ifast_prog.jpg)\n\n  # CC: YCC->RGB  SAMP: fullsize/h2v2 fancy  IDCT: ifast  ENT: prog huff\n  add_test(djpeg${suffix}-420-q100-ifast-prog\n    ${dir}djpeg${suffix} -dct fast\n      -outfile testout_420_q100_ifast.ppm testout_420_q100_ifast_prog.jpg)\n  add_test(djpeg${suffix}-420-q100-ifast-prog-cmp\n    ${MD5CMP} ${MD5_PPM_420_Q100_IFAST} testout_420_q100_ifast.ppm)\n\n  # CC: YCC->RGB  SAMP: h2v2 merged  IDCT: ifast  ENT: prog huff\n  add_test(djpeg${suffix}-420m-q100-ifast-prog\n    ${dir}djpeg${suffix} -dct fast -nosmooth\n      -outfile testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg)\n  add_test(djpeg${suffix}-420m-q100-ifast-prog-cmp\n    ${MD5CMP} ${MD5_PPM_420M_Q100_IFAST} testout_420m_q100_ifast.ppm)\n\n  # CC: RGB->Gray  SAMP: fullsize  FDCT: islow  ENT: huff\n  add_test(cjpeg${suffix}-gray-islow\n    ${dir}cjpeg${suffix} -gray -dct int\n      -outfile testout_gray_islow.jpg ${TESTIMAGES}/testorig.ppm)\n  add_test(cjpeg${suffix}-gray-islow-cmp\n    ${MD5CMP} ${MD5_JPEG_GRAY_ISLOW} testout_gray_islow.jpg)\n\n  # CC: Gray->Gray  SAMP: fullsize  IDCT: islow  ENT: huff\n  add_test(djpeg${suffix}-gray-islow\n    ${dir}djpeg${suffix} -dct int\n      -outfile testout_gray_islow.ppm testout_gray_islow.jpg)\n  add_test(djpeg${suffix}-gray-islow-cmp\n    ${MD5CMP} ${MD5_PPM_GRAY_ISLOW} testout_gray_islow.ppm)\n\n  # CC: Gray->RGB  SAMP: fullsize  IDCT: islow  ENT: huff\n  add_test(djpeg${suffix}-gray-islow-rgb\n    ${dir}djpeg${suffix} -dct int -rgb\n      -outfile testout_gray_islow_rgb.ppm testout_gray_islow.jpg)\n  add_test(djpeg${suffix}-gray-islow-rgb-cmp\n    ${MD5CMP} ${MD5_PPM_GRAY_ISLOW_RGB} testout_gray_islow_rgb.ppm)\n\n  if(NOT WITH_12BIT)\n    # CC: Gray->RGB565  SAMP: fullsize  IDCT: islow  ENT: huff\n    add_test(djpeg${suffix}-gray-islow-565\n      ${dir}djpeg${suffix} -dct int -rgb565 -dither none -bmp\n        -outfile testout_gray_islow_565.bmp testout_gray_islow.jpg)\n    add_test(djpeg${suffix}-gray-islow-565-cmp\n      ${MD5CMP} ${MD5_BMP_GRAY_ISLOW_565} testout_gray_islow_565.bmp)\n\n    # CC: Gray->RGB565 (dithered)  SAMP: fullsize  IDCT: islow  ENT: huff\n    add_test(djpeg${suffix}-gray-islow-565D\n      ${dir}djpeg${suffix} -dct int -rgb565 -bmp\n        -outfile testout_gray_islow_565D.bmp testout_gray_islow.jpg)\n    add_test(djpeg${suffix}-gray-islow-565D-cmp\n      ${MD5CMP} ${MD5_BMP_GRAY_ISLOW_565D} testout_gray_islow_565D.bmp)\n  endif()\n\n  # CC: RGB->YCC  SAMP: fullsize smooth/h2v2 smooth  FDCT: islow\n  # ENT: 2-pass huff\n  add_test(cjpeg${suffix}-420s-ifast-opt\n    ${dir}cjpeg${suffix} -sample 2x2 -smooth 1 -dct int -opt\n      -outfile testout_420s_ifast_opt.jpg ${TESTIMAGES}/testorig.ppm)\n  add_test(cjpeg${suffix}-420s-ifast-opt-cmp\n    ${MD5CMP} ${MD5_JPEG_420S_IFAST_OPT} testout_420s_ifast_opt.jpg)\n\n  # CC: RGB->YCC  SAMP: fullsize/int  FDCT: float  ENT: prog huff\n  add_test(cjpeg${suffix}-3x2-float-prog\n    ${dir}cjpeg${suffix} -sample 3x2 -dct float -prog\n      -outfile testout_3x2_float_prog.jpg ${TESTIMAGES}/testorig.ppm)\n  add_test(cjpeg${suffix}-3x2-float-prog-cmp\n    ${MD5CMP} ${MD5_JPEG_3x2_FLOAT_PROG} testout_3x2_float_prog.jpg)\n\n  # CC: YCC->RGB  SAMP: fullsize/int  IDCT: float  ENT: prog huff\n  add_test(djpeg${suffix}-3x2-float-prog\n    ${dir}djpeg${suffix} -dct float\n      -outfile testout_3x2_float.ppm testout_3x2_float_prog.jpg)\n  add_test(djpeg${suffix}-3x2-float-prog-cmp\n    ${MD5CMP} ${MD5_PPM_3x2_FLOAT} testout_3x2_float.ppm)\n\n  if(WITH_ARITH_ENC)\n    # CC: YCC->RGB  SAMP: fullsize/h2v2  FDCT: islow  ENT: arith\n    add_test(cjpeg${suffix}-420-islow-ari\n      ${dir}cjpeg${suffix} -dct int -arithmetic\n        -outfile testout_420_islow_ari.jpg ${TESTIMAGES}/testorig.ppm)\n    add_test(cjpeg${suffix}-420-islow-ari-cmp\n      ${MD5CMP} ${MD5_JPEG_420_ISLOW_ARI} testout_420_islow_ari.jpg)\n\n    add_test(jpegtran${suffix}-420-islow-ari\n      ${dir}jpegtran${suffix} -arithmetic\n        -outfile testout_420_islow_ari.jpg ${TESTIMAGES}/testimgint.jpg)\n    add_test(jpegtran${suffix}-420-islow-ari-cmp\n      ${MD5CMP} ${MD5_JPEG_420_ISLOW_ARI} testout_420_islow_ari.jpg)\n\n    # CC: YCC->RGB  SAMP: fullsize  FDCT: islow  ENT: prog arith\n    add_test(cjpeg${suffix}-444-islow-progari\n      ${dir}cjpeg${suffix} -sample 1x1 -dct int -prog -arithmetic\n        -outfile testout_444_islow_progari.jpg ${TESTIMAGES}/testorig.ppm)\n    add_test(cjpeg${suffix}-444-islow-progari-cmp\n      ${MD5CMP} ${MD5_JPEG_444_ISLOW_PROGARI} testout_444_islow_progari.jpg)\n  endif()\n\n  if(WITH_ARITH_DEC)\n    # CC: RGB->YCC  SAMP: h2v2 merged  IDCT: ifast  ENT: arith\n    add_test(djpeg${suffix}-420m-ifast-ari\n      ${dir}djpeg${suffix} -fast -ppm\n        -outfile testout_420m_ifast_ari.ppm ${TESTIMAGES}/testimgari.jpg)\n    add_test(djpeg${suffix}-420m-ifast-ari-cmp\n      ${MD5CMP} ${MD5_PPM_420M_IFAST_ARI} testout_420m_ifast_ari.ppm)\n\n    add_test(jpegtran${suffix}-420-islow\n      ${dir}jpegtran${suffix}\n        -outfile testout_420_islow.jpg ${TESTIMAGES}/testimgari.jpg)\n    add_test(jpegtran${suffix}-420-islow-cmp\n      ${MD5CMP} ${MD5_JPEG_420_ISLOW} testout_420_islow.jpg)\n  endif()\n\n  # 2/1--   CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 16x16 islow  ENT: huff\n  # 15/8--  CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 15x15 islow  ENT: huff\n  # 13/8--  CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 13x13 islow  ENT: huff\n  # 11/8--  CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 11x11 islow  ENT: huff\n  # 9/8--   CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 9x9 islow  ENT: huff\n  # 7/8--   CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 7x7 islow/14x14 islow\n  #         ENT: huff\n  # 3/4--   CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 6x6 islow/12x12 islow\n  #         ENT: huff\n  # 5/8--   CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 5x5 islow/10x10 islow\n  #         ENT: huff\n  # 1/2--   CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 4x4 islow/8x8 islow\n  #         ENT: huff\n  # 3/8--   CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 3x3 islow/6x6 islow\n  #         ENT: huff\n  # 1/4--   CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 2x2 islow/4x4 islow\n  #         ENT: huff\n  # 1/8--   CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 1x1 islow/2x2 islow\n  #         ENT: huff\n  foreach(scale 2_1 15_8 13_8 11_8 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8)\n    string(REGEX REPLACE \"_\" \"/\" scalearg ${scale})\n    add_test(djpeg${suffix}-420m-islow-${scale}\n      ${dir}djpeg${suffix} -dct int -scale ${scalearg} -nosmooth -ppm\n        -outfile testout_420m_islow_${scale}.ppm ${TESTIMAGES}/${TESTORIG})\n    add_test(djpeg${suffix}-420m-islow-${scale}-cmp\n      ${MD5CMP} ${MD5_PPM_420M_ISLOW_${scale}} testout_420m_islow_${scale}.ppm)\n  endforeach()\n\n  if(NOT WITH_12BIT)\n    # CC: YCC->RGB (dithered)  SAMP: h2v2 fancy  IDCT: islow  ENT: huff\n    add_test(djpeg${suffix}-420-islow-256\n      ${dir}djpeg${suffix} -dct int -colors 256 -bmp\n        -outfile testout_420_islow_256.bmp ${TESTIMAGES}/${TESTORIG})\n    add_test(djpeg${suffix}-420-islow-256-cmp\n      ${MD5CMP} ${MD5_BMP_420_ISLOW_256} testout_420_islow_256.bmp)\n\n    # CC: YCC->RGB565  SAMP: h2v2 fancy  IDCT: islow  ENT: huff\n    add_test(djpeg${suffix}-420-islow-565\n      ${dir}djpeg${suffix} -dct int -rgb565 -dither none -bmp\n        -outfile testout_420_islow_565.bmp ${TESTIMAGES}/${TESTORIG})\n    add_test(djpeg${suffix}-420-islow-565-cmp\n      ${MD5CMP} ${MD5_BMP_420_ISLOW_565} testout_420_islow_565.bmp)\n\n    # CC: YCC->RGB565 (dithered)  SAMP: h2v2 fancy  IDCT: islow  ENT: huff\n    add_test(djpeg${suffix}-420-islow-565D\n      ${dir}djpeg${suffix} -dct int -rgb565 -bmp\n        -outfile testout_420_islow_565D.bmp ${TESTIMAGES}/${TESTORIG})\n    add_test(djpeg${suffix}-420-islow-565D-cmp\n      ${MD5CMP} ${MD5_BMP_420_ISLOW_565D} testout_420_islow_565D.bmp)\n\n    # CC: YCC->RGB565  SAMP: h2v2 merged  IDCT: islow  ENT: huff\n    add_test(djpeg${suffix}-420m-islow-565\n      ${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -dither none -bmp\n        -outfile testout_420m_islow_565.bmp ${TESTIMAGES}/${TESTORIG})\n    add_test(djpeg${suffix}-420m-islow-565-cmp\n      ${MD5CMP} ${MD5_BMP_420M_ISLOW_565} testout_420m_islow_565.bmp)\n\n    # CC: YCC->RGB565 (dithered)  SAMP: h2v2 merged  IDCT: islow  ENT: huff\n    add_test(djpeg${suffix}-420m-islow-565D\n      ${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -bmp\n        -outfile testout_420m_islow_565D.bmp ${TESTIMAGES}/${TESTORIG})\n    add_test(djpeg${suffix}-420m-islow-565D-cmp\n      ${MD5CMP} ${MD5_BMP_420M_ISLOW_565D} testout_420m_islow_565D.bmp)\n  endif()\n\n  # Partial decode tests.  These tests are designed to cover all of the\n  # possible code paths in jpeg_skip_scanlines().\n\n  # Context rows: Yes  Intra-iMCU row: Yes  iMCU row prefetch: No   ENT: huff\n  add_test(djpeg${suffix}-420-islow-skip15_31\n    ${dir}djpeg${suffix} -dct int -skip 15,31 -ppm\n      -outfile testout_420_islow_skip15,31.ppm ${TESTIMAGES}/${TESTORIG})\n  add_test(djpeg${suffix}-420-islow-skip15_31-cmp\n    ${MD5CMP} ${MD5_PPM_420_ISLOW_SKIP15_31} testout_420_islow_skip15,31.ppm)\n\n  # Context rows: Yes  Intra-iMCU row: No   iMCU row prefetch: Yes  ENT: arith\n  if(WITH_ARITH_DEC)\n    add_test(djpeg${suffix}-420-islow-ari-skip16_139\n      ${dir}djpeg${suffix} -dct int -skip 16,139 -ppm\n        -outfile testout_420_islow_ari_skip16,139.ppm\n        ${TESTIMAGES}/testimgari.jpg)\n    add_test(djpeg${suffix}-420-islow-ari_skip16_139-cmp\n      ${MD5CMP} ${MD5_PPM_420_ISLOW_ARI_SKIP16_139}\n        testout_420_islow_ari_skip16,139.ppm)\n  endif()\n\n  # Context rows: Yes  Intra-iMCU row: No   iMCU row prefetch: No   ENT: prog huff\n  add_test(cjpeg${suffix}-420-islow-prog\n    ${dir}cjpeg${suffix} -dct int -prog\n      -outfile testout_420_islow_prog.jpg ${TESTIMAGES}/testorig.ppm)\n  add_test(djpeg${suffix}-420-islow-prog-crop62x62_71_71\n    ${dir}djpeg${suffix} -dct int -crop 62x62+71+71 -ppm\n      -outfile testout_420_islow_prog_crop62x62,71,71.ppm\n      testout_420_islow_prog.jpg)\n  add_test(djpeg${suffix}-420-islow-prog-crop62x62_71_71-cmp\n    ${MD5CMP} ${MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71}\n      testout_420_islow_prog_crop62x62,71,71.ppm)\n\n  # Context rows: Yes  Intra-iMCU row: No   iMCU row prefetch: No   ENT: arith\n  if(WITH_ARITH_DEC)\n    add_test(djpeg${suffix}-420-islow-ari-crop53x53_4_4\n      ${dir}djpeg${suffix} -dct int -crop 53x53+4+4 -ppm\n        -outfile testout_420_islow_ari_crop53x53,4,4.ppm\n        ${TESTIMAGES}/testimgari.jpg)\n    add_test(djpeg${suffix}-420-islow-ari-crop53x53_4_4-cmp\n      ${MD5CMP} ${MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4}\n        testout_420_islow_ari_crop53x53,4,4.ppm)\n  endif()\n\n  # Context rows: No   Intra-iMCU row: Yes  ENT: huff\n  add_test(cjpeg${suffix}-444-islow\n    ${dir}cjpeg${suffix} -dct int -sample 1x1\n      -outfile testout_444_islow.jpg ${TESTIMAGES}/testorig.ppm)\n  add_test(djpeg${suffix}-444-islow-skip1_6\n    ${dir}djpeg${suffix} -dct int -skip 1,6 -ppm\n      -outfile testout_444_islow_skip1,6.ppm testout_444_islow.jpg)\n  add_test(djpeg${suffix}-444-islow-skip1_6-cmp\n    ${MD5CMP} ${MD5_PPM_444_ISLOW_SKIP1_6} testout_444_islow_skip1,6.ppm)\n\n  # Context rows: No   Intra-iMCU row: No   ENT: prog huff\n  add_test(cjpeg${suffix}-444-islow-prog\n    ${dir}cjpeg${suffix} -dct int -prog -sample 1x1\n      -outfile testout_444_islow_prog.jpg ${TESTIMAGES}/testorig.ppm)\n  add_test(djpeg${suffix}-444-islow-prog-crop98x98_13_13\n    ${dir}djpeg${suffix} -dct int -crop 98x98+13+13 -ppm\n      -outfile testout_444_islow_prog_crop98x98,13,13.ppm\n      testout_444_islow_prog.jpg)\n  add_test(djpeg${suffix}-444-islow-prog_crop98x98_13_13-cmp\n    ${MD5CMP} ${MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13}\n      testout_444_islow_prog_crop98x98,13,13.ppm)\n\n  # Context rows: No   Intra-iMCU row: No   ENT: arith\n  if(WITH_ARITH_ENC)\n    add_test(cjpeg${suffix}-444-islow-ari\n      ${dir}cjpeg${suffix} -dct int -arithmetic -sample 1x1\n        -outfile testout_444_islow_ari.jpg ${TESTIMAGES}/testorig.ppm)\n    if(WITH_ARITH_DEC)\n      add_test(djpeg${suffix}-444-islow-ari-crop37x37_0_0\n        ${dir}djpeg${suffix} -dct int -crop 37x37+0+0 -ppm\n          -outfile testout_444_islow_ari_crop37x37,0,0.ppm\n          testout_444_islow_ari.jpg)\n      add_test(djpeg${suffix}-444-islow-ari-crop37x37_0_0-cmp\n        ${MD5CMP} ${MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0}\n          testout_444_islow_ari_crop37x37,0,0.ppm)\n    endif()\n  endif()\n\n  add_test(jpegtran${suffix}-crop\n    ${dir}jpegtran${suffix} -crop 120x90+20+50 -transpose -perfect\n      -outfile testout_crop.jpg ${TESTIMAGES}/${TESTORIG})\n  add_test(jpegtran${suffix}-crop-cmp\n    ${MD5CMP} ${MD5_JPEG_CROP} testout_crop.jpg)\n\nendforeach()\n\nadd_custom_target(testclean COMMAND ${MD5CMP} -P\n  ${CMAKE_SOURCE_DIR}/cmakescripts/testclean.cmake)\n\n\n#\n# Installer\n#\n\nif(MSVC)\n  set(INST_PLATFORM \"Visual C++\")\n  set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-vc)\n  set(INST_REG_NAME ${CMAKE_PROJECT_NAME})\nelseif(MINGW)\n  set(INST_PLATFORM GCC)\n  set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-gcc)\n  set(INST_REG_NAME ${CMAKE_PROJECT_NAME}-gcc)\n  set(INST_DEFS -DGCC)\nendif()\n\nif(64BIT)\n  set(INST_PLATFORM \"${INST_PLATFORM} 64-bit\")\n  set(INST_NAME ${INST_NAME}64)\n  set(INST_REG_NAME ${INST_DIR}64)\n  set(INST_DEFS ${INST_DEFS} -DWIN64)\nendif()\n\nif(WITH_JAVA)\n  set(INST_DEFS ${INST_DEFS} -DJAVA)\nendif()\n\nif(MSVC_IDE)\n  set(INST_DEFS ${INST_DEFS} \"-DBUILDDIR=${CMAKE_CFG_INTDIR}\\\\\")\nelse()\n  set(INST_DEFS ${INST_DEFS} \"-DBUILDDIR=\")\nendif()\n\nSTRING(REGEX REPLACE \"/\" \"\\\\\\\\\" INST_DIR ${CMAKE_INSTALL_PREFIX})\n\nconfigure_file(release/libjpeg-turbo.nsi.in libjpeg-turbo.nsi @ONLY)\n\nif(WITH_JAVA)\n  set(JAVA_DEPEND java)\nendif()\nadd_custom_target(installer\n  makensis -nocd ${INST_DEFS} libjpeg-turbo.nsi\n  DEPENDS jpeg jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom\n    cjpeg djpeg jpegtran tjbench ${JAVA_DEPEND}\n  SOURCES libjpeg-turbo.nsi)\n\nif(WITH_TURBOJPEG)\n  if(ENABLE_SHARED)\n    install(TARGETS turbojpeg tjbench\n      ARCHIVE DESTINATION lib\n      LIBRARY DESTINATION lib\n      RUNTIME DESTINATION bin)\n  endif()\n  if(ENABLE_STATIC)\n    install(TARGETS turbojpeg-static ARCHIVE DESTINATION lib)\n    if(NOT ENABLE_SHARED)\n      install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/tjbench-static.exe\n        DESTINATION bin RENAME tjbench.exe)\n    endif()\n  endif()\n  install(FILES ${CMAKE_SOURCE_DIR}/turbojpeg.h DESTINATION include)\nendif()\n\nif(ENABLE_STATIC)\n  install(TARGETS jpeg-static ARCHIVE DESTINATION lib)\n  if(NOT ENABLE_SHARED)\n    install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cjpeg-static.exe\n      DESTINATION bin RENAME cjpeg.exe)\n    install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/djpeg-static.exe\n      DESTINATION bin RENAME djpeg.exe)\n    install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/jpegtran-static.exe\n      DESTINATION bin RENAME jpegtran.exe)\n  endif()\nendif()\n\ninstall(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION bin)\n\ninstall(FILES ${CMAKE_SOURCE_DIR}/README.ijg ${CMAKE_SOURCE_DIR}/README.md\n  ${CMAKE_SOURCE_DIR}/example.c ${CMAKE_SOURCE_DIR}/libjpeg.txt\n  ${CMAKE_SOURCE_DIR}/structure.txt ${CMAKE_SOURCE_DIR}/usage.txt\n  ${CMAKE_SOURCE_DIR}/wizard.txt\n  DESTINATION doc)\n\ninstall(FILES ${CMAKE_BINARY_DIR}/jconfig.h ${CMAKE_SOURCE_DIR}/jerror.h\n  ${CMAKE_SOURCE_DIR}/jmorecfg.h ${CMAKE_SOURCE_DIR}/jpeglib.h\n  DESTINATION include)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/ChangeLog.md",
    "content": "1.5.0\n=====\n\n### Significant changes relative to 1.5 beta1:\n\n1. Fixed an issue whereby a malformed motion-JPEG frame could cause the \"fast\npath\" of libjpeg-turbo's Huffman decoder to read from uninitialized memory.\n\n2. Added libjpeg-turbo version and build information to the global string table\nof the libjpeg and TurboJPEG API libraries.  This is a common practice in other\ninfrastructure libraries, such as OpenSSL and libpng, because it makes it easy\nto examine an application binary and determine which version of the library the\napplication was linked against.\n\n3. Fixed a couple of issues in the PPM reader that would cause buffer overruns\nin cjpeg if one of the values in a binary PPM/PGM input file exceeded the\nmaximum value defined in the file's header.  libjpeg-turbo 1.4.2 already\nincluded a similar fix for ASCII PPM/PGM files.  Note that these issues were\nnot security bugs, since they were confined to the cjpeg program and did not\naffect any of the libjpeg-turbo libraries.\n\n4. Fixed an issue whereby attempting to decompress a JPEG file with a corrupt\nheader using the `tjDecompressToYUV2()` function would cause the function to\nabort without returning an error and, under certain circumstances, corrupt the\nstack.  This only occurred if `tjDecompressToYUV2()` was called prior to\ncalling `tjDecompressHeader3()`, or if the return value from\n`tjDecompressHeader3()` was ignored (both cases represent incorrect usage of\nthe TurboJPEG API.)\n\n5. Fixed an issue in the ARM 32-bit SIMD-accelerated Huffman encoder that\nprevented the code from assembling properly with clang.\n\n6. The `jpeg_stdio_src()`, `jpeg_mem_src()`, `jpeg_stdio_dest()`, and\n`jpeg_mem_dest()` functions in the libjpeg API will now throw an error if a\nsource/destination manager has already been assigned to the compress or\ndecompress object by a different function or by the calling program.  This\nprevents these functions from attempting to reuse a source/destination manager\nstructure that was allocated elsewhere, because there is no way to ensure that\nit would be big enough to accommodate the new source/destination manager.\n\n\n1.4.90 (1.5 beta1)\n==================\n\n### Significant changes relative to 1.4.2:\n\n1. Added full SIMD acceleration for PowerPC platforms using AltiVec VMX\n(128-bit SIMD) instructions.  Although the performance of libjpeg-turbo on\nPowerPC was already good, due to the increased number of registers available\nto the compiler vs. x86, it was still possible to speed up compression by about\n3-4x and decompression by about 2-2.5x (relative to libjpeg v6b) through the\nuse of AltiVec instructions.\n\n2. Added two new libjpeg API functions (`jpeg_skip_scanlines()` and\n`jpeg_crop_scanline()`) that can be used to partially decode a JPEG image.  See\n[libjpeg.txt](libjpeg.txt) for more details.\n\n3. The TJCompressor and TJDecompressor classes in the TurboJPEG Java API now\nimplement the Closeable interface, so those classes can be used with a\ntry-with-resources statement.\n\n4. The TurboJPEG Java classes now throw unchecked idiomatic exceptions\n(IllegalArgumentException, IllegalStateException) for unrecoverable errors\ncaused by incorrect API usage, and those classes throw a new checked exception\ntype (TJException) for errors that are passed through from the C library.\n\n5. Source buffers for the TurboJPEG C API functions, as well as the\n`jpeg_mem_src()` function in the libjpeg API, are now declared as const\npointers.  This facilitates passing read-only buffers to those functions and\nensures the caller that the source buffer will not be modified.  This should\nnot create any backward API or ABI incompatibilities with prior libjpeg-turbo\nreleases.\n\n6. The MIPS DSPr2 SIMD code can now be compiled to support either FR=0 or FR=1\nFPUs.\n\n7. Fixed additional negative left shifts and other issues reported by the GCC\nand Clang undefined behavior sanitizers.  Most of these issues affected only\n32-bit code, and none of them was known to pose a security threat, but removing\nthe warnings makes it easier to detect actual security issues, should they\narise in the future.\n\n8. Removed the unnecessary `.arch` directive from the ARM64 NEON SIMD code.\nThis directive was preventing the code from assembling using the clang\nintegrated assembler.\n\n9. Fixed a regression caused by 1.4.1[6] that prevented 32-bit and 64-bit\nlibjpeg-turbo RPMs from being installed simultaneously on recent Red Hat/Fedora\ndistributions.  This was due to the addition of a macro in jconfig.h that\nallows the Huffman codec to determine the word size at compile time.  Since\nthat macro differs between 32-bit and 64-bit builds, this caused a conflict\nbetween the i386 and x86_64 RPMs (any differing files, other than executables,\nare not allowed when 32-bit and 64-bit RPMs are installed simultaneously.)\nSince the macro is used only internally, it has been moved into jconfigint.h.\n\n10. The x86-64 SIMD code can now be disabled at run time by setting the\n`JSIMD_FORCENONE` environment variable to `1` (the other SIMD implementations\nalready had this capability.)\n\n11. Added a new command-line argument to TJBench (`-nowrite`) that prevents the\nbenchmark from outputting any images.  This removes any potential operating\nsystem overhead that might be caused by lazy writes to disk and thus improves\nthe consistency of the performance measurements.\n\n12. Added SIMD acceleration for Huffman encoding on SSE2-capable x86 and x86-64\nplatforms.  This speeds up the compression of full-color JPEGs by about 10-15%\non average (relative to libjpeg-turbo 1.4.x) when using modern Intel and AMD\nCPUs.  Additionally, this works around an issue in the clang optimizer that\nprevents it (as of this writing) from achieving the same performance as GCC\nwhen compiling the C version of the Huffman encoder\n(<https://llvm.org/bugs/show_bug.cgi?id=16035>).  For the purposes of\nbenchmarking or regression testing, SIMD-accelerated Huffman encoding can be\ndisabled by setting the `JSIMD_NOHUFFENC` environment variable to `1`.\n\n13. Added ARM 64-bit (ARMv8) NEON SIMD implementations of the commonly-used\ncompression algorithms (including the slow integer forward DCT and h2v2 & h2v1\ndownsampling algorithms, which are not accelerated in the 32-bit NEON\nimplementation.)  This speeds up the compression of full-color JPEGs by about\n75% on average on a Cavium ThunderX processor and by about 2-2.5x on average on\nCortex-A53 and Cortex-A57 cores.\n\n14. Added SIMD acceleration for Huffman encoding on NEON-capable ARM 32-bit\nand 64-bit platforms.\n\n    For 32-bit code, this speeds up the compression of full-color JPEGs by\nabout 30% on average on a typical iOS device (iPhone 4S, Cortex-A9) and by\nabout 6-7% on average on a typical Android device (Nexus 5X, Cortex-A53 and\nCortex-A57), relative to libjpeg-turbo 1.4.x.  Note that the larger speedup\nunder iOS is due to the fact that iOS builds use LLVM, which does not optimize\nthe C Huffman encoder as well as GCC does.\n\n    For 64-bit code, NEON-accelerated Huffman encoding speeds up the\ncompression of full-color JPEGs by about 40% on average on a typical iOS device\n(iPhone 5S, Apple A7) and by about 7-8% on average on a typical Android device\n(Nexus 5X, Cortex-A53 and Cortex-A57), in addition to the speedup described in\n[13] above.\n\n    For the purposes of benchmarking or regression testing, SIMD-accelerated\nHuffman encoding can be disabled by setting the `JSIMD_NOHUFFENC` environment\nvariable to `1`.\n\n15. pkg-config (.pc) scripts are now included for both the libjpeg and\nTurboJPEG API libraries on Un*x systems.  Note that if a project's build system\nrelies on these scripts, then it will not be possible to build that project\nwith libjpeg or with a prior version of libjpeg-turbo.\n\n16. Optimized the ARM 64-bit (ARMv8) NEON SIMD decompression routines to\nimprove performance on CPUs with in-order pipelines.  This speeds up the\ndecompression of full-color JPEGs by nearly 2x on average on a Cavium ThunderX\nprocessor and by about 15% on average on a Cortex-A53 core.\n\n17. Fixed an issue in the accelerated Huffman decoder that could have caused\nthe decoder to read past the end of the input buffer when a malformed,\nspecially-crafted JPEG image was being decompressed.  In prior versions of\nlibjpeg-turbo, the accelerated Huffman decoder was invoked (in most cases) only\nif there were > 128 bytes of data in the input buffer.  However, it is possible\nto construct a JPEG image in which a single Huffman block is over 430 bytes\nlong, so this version of libjpeg-turbo activates the accelerated Huffman\ndecoder only if there are > 512 bytes of data in the input buffer.\n\n18. Fixed a memory leak in tjunittest encountered when running the program\nwith the `-yuv` option.\n\n\n1.4.2\n=====\n\n### Significant changes relative to 1.4.1:\n\n1. Fixed an issue whereby cjpeg would segfault if a Windows bitmap with a\nnegative width or height was used as an input image (Windows bitmaps can have\na negative height if they are stored in top-down order, but such files are\nrare and not supported by libjpeg-turbo.)\n\n2. Fixed an issue whereby, under certain circumstances, libjpeg-turbo would\nincorrectly encode certain JPEG images when quality=100 and the fast integer\nforward DCT were used.  This was known to cause `make test` to fail when the\nlibrary was built with `-march=haswell` on x86 systems.\n\n3. Fixed an issue whereby libjpeg-turbo would crash when built with the latest\n& greatest development version of the Clang/LLVM compiler.  This was caused by\nan x86-64 ABI conformance issue in some of libjpeg-turbo's 64-bit SSE2 SIMD\nroutines.  Those routines were incorrectly using a 64-bit `mov` instruction to\ntransfer a 32-bit JDIMENSION argument, whereas the x86-64 ABI allows the upper\n(unused) 32 bits of a 32-bit argument's register to be undefined.  The new\nClang/LLVM optimizer uses load combining to transfer multiple adjacent 32-bit\nstructure members into a single 64-bit register, and this exposed the ABI\nconformance issue.\n\n4. Fixed a bug in the MIPS DSPr2 4:2:0 \"plain\" (non-fancy and non-merged)\nupsampling routine that caused a buffer overflow (and subsequent segfault) when\ndecompressing a 4:2:0 JPEG image whose scaled output width was less than 16\npixels.  The \"plain\" upsampling routines are normally only used when\ndecompressing a non-YCbCr JPEG image, but they are also used when decompressing\na JPEG image whose scaled output height is 1.\n\n5. Fixed various negative left shifts and other issues reported by the GCC and\nClang undefined behavior sanitizers.  None of these was known to pose a\nsecurity threat, but removing the warnings makes it easier to detect actual\nsecurity issues, should they arise in the future.\n\n\n1.4.1\n=====\n\n### Significant changes relative to 1.4.0:\n\n1. tjbench now properly handles CMYK/YCCK JPEG files.  Passing an argument of\n`-cmyk` (instead of, for instance, `-rgb`) will cause tjbench to internally\nconvert the source bitmap to CMYK prior to compression, to generate YCCK JPEG\nfiles, and to internally convert the decompressed CMYK pixels back to RGB after\ndecompression (the latter is done automatically if a CMYK or YCCK JPEG is\npassed to tjbench as a source image.)  The CMYK<->RGB conversion operation is\nnot benchmarked.  NOTE: The quick & dirty CMYK<->RGB conversions that tjbench\nuses are suitable for testing only.  Proper conversion between CMYK and RGB\nrequires a color management system.\n\n2. `make test` now performs additional bitwise regression tests using tjbench,\nmainly for the purpose of testing compression from/decompression to a subregion\nof a larger image buffer.\n\n3. `make test` no longer tests the regression of the floating point DCT/IDCT\nby default, since the results of those tests can vary if the algorithms in\nquestion are not implemented using SIMD instructions on a particular platform.\nSee the comments in [Makefile.am](Makefile.am) for information on how to\nre-enable the tests and to specify an expected result for them based on the\nparticulars of your platform.\n\n4. The NULL color conversion routines have been significantly optimized,\nwhich speeds up the compression of RGB and CMYK JPEGs by 5-20% when using\n64-bit code and 0-3% when using 32-bit code, and the decompression of those\nimages by 10-30% when using 64-bit code and 3-12% when using 32-bit code.\n\n5. Fixed an \"illegal instruction\" error that occurred when djpeg from a\nSIMD-enabled libjpeg-turbo MIPS build was executed with the `-nosmooth` option\non a MIPS machine that lacked DSPr2 support.  The MIPS SIMD routines for h2v1\nand h2v2 merged upsampling were not properly checking for the existence of\nDSPr2.\n\n6. Performance has been improved significantly on 64-bit non-Linux and\nnon-Windows platforms (generally 10-20% faster compression and 5-10% faster\ndecompression.)  Due to an oversight, the 64-bit version of the accelerated\nHuffman codec was not being compiled in when libjpeg-turbo was built on\nplatforms other than Windows or Linux.  Oops.\n\n7. Fixed an extremely rare bug in the Huffman encoder that caused 64-bit\nbuilds of libjpeg-turbo to incorrectly encode a few specific test images when\nquality=98, an optimized Huffman table, and the slow integer forward DCT were\nused.\n\n8. The Windows (CMake) build system now supports building only static or only\nshared libraries.  This is accomplished by adding either `-DENABLE_STATIC=0` or\n`-DENABLE_SHARED=0` to the CMake command line.\n\n9. TurboJPEG API functions will now return an error code if a warning is\ntriggered in the underlying libjpeg API.  For instance, if a JPEG file is\ncorrupt, the TurboJPEG decompression functions will attempt to decompress\nas much of the image as possible, but those functions will now return -1 to\nindicate that the decompression was not entirely successful.\n\n10. Fixed a bug in the MIPS DSPr2 4:2:2 fancy upsampling routine that caused a\nbuffer overflow (and subsequent segfault) when decompressing a 4:2:2 JPEG image\nin which the right-most MCU was 5 or 6 pixels wide.\n\n\n1.4.0\n=====\n\n### Significant changes relative to 1.4 beta1:\n\n1. Fixed a build issue on OS X PowerPC platforms (md5cmp failed to build\nbecause OS X does not provide the `le32toh()` and `htole32()` functions.)\n\n2. The non-SIMD RGB565 color conversion code did not work correctly on big\nendian machines.  This has been fixed.\n\n3. Fixed an issue in `tjPlaneSizeYUV()` whereby it would erroneously return 1\ninstead of -1 if `componentID` was > 0 and `subsamp` was `TJSAMP_GRAY`.\n\n3. Fixed an issue in `tjBufSizeYUV2()` whereby it would erroneously return 0\ninstead of -1 if `width` was < 1.\n\n5. The Huffman encoder now uses `clz` and `bsr` instructions for bit counting\non ARM64 platforms (see 1.4 beta1[5].)\n\n6. The `close()` method in the TJCompressor and TJDecompressor Java classes is\nnow idempotent.  Previously, that method would call the native `tjDestroy()`\nfunction even if the TurboJPEG instance had already been destroyed.  This\ncaused an exception to be thrown during finalization, if the `close()` method\nhad already been called.  The exception was caught, but it was still an\nexpensive operation.\n\n7. The TurboJPEG API previously generated an error (`Could not determine\nsubsampling type for JPEG image`) when attempting to decompress grayscale JPEG\nimages that were compressed with a sampling factor other than 1 (for instance,\nwith `cjpeg -grayscale -sample 2x2`).  Subsampling technically has no meaning\nwith grayscale JPEGs, and thus the horizontal and vertical sampling factors\nfor such images are ignored by the decompressor.  However, the TurboJPEG API\nwas being too rigid and was expecting the sampling factors to be equal to 1\nbefore it treated the image as a grayscale JPEG.\n\n8. cjpeg, djpeg, and jpegtran now accept an argument of `-version`, which will\nprint the library version and exit.\n\n9. Referring to 1.4 beta1[15], another extremely rare circumstance was\ndiscovered under which the Huffman encoder's local buffer can be overrun\nwhen a buffered destination manager is being used and an\nextremely-high-frequency block (basically junk image data) is being encoded.\nEven though the Huffman local buffer was increased from 128 bytes to 136 bytes\nto address the previous issue, the new issue caused even the larger buffer to\nbe overrun.  Further analysis reveals that, in the absolute worst case (such as\nsetting alternating AC coefficients to 32767 and -32768 in the JPEG scanning\norder), the Huffman encoder can produce encoded blocks that approach double the\nsize of the unencoded blocks.  Thus, the Huffman local buffer was increased to\n256 bytes, which should prevent any such issue from re-occurring in the future.\n\n10. The new `tjPlaneSizeYUV()`, `tjPlaneWidth()`, and `tjPlaneHeight()`\nfunctions were not actually usable on any platform except OS X and Windows,\nbecause those functions were not included in the libturbojpeg mapfile.  This\nhas been fixed.\n\n11. Restored the `JPP()`, `JMETHOD()`, and `FAR` macros in the libjpeg-turbo\nheader files.  The `JPP()` and `JMETHOD()` macros were originally implemented\nin libjpeg as a way of supporting non-ANSI compilers that lacked support for\nprototype parameters.  libjpeg-turbo has never supported such compilers, but\nsome software packages still use the macros to define their own prototypes.\nSimilarly, libjpeg-turbo has never supported MS-DOS and other platforms that\nhave far symbols, but some software packages still use the `FAR` macro.  A\npretty good argument can be made that this is a bad practice on the part of the\nsoftware in question, but since this affects more than one package, it's just\neasier to fix it here.\n\n12. Fixed issues that were preventing the ARM 64-bit SIMD code from compiling\nfor iOS, and included an ARMv8 architecture in all of the binaries installed by\nthe \"official\" libjpeg-turbo SDK for OS X.\n\n\n1.3.90 (1.4 beta1)\n==================\n\n### Significant changes relative to 1.3.1:\n\n1. New features in the TurboJPEG API:\n\n     - YUV planar images can now be generated with an arbitrary line padding\n(previously only 4-byte padding, which was compatible with X Video, was\nsupported.)\n     - The decompress-to-YUV function has been extended to support image\nscaling.\n     - JPEG images can now be compressed from YUV planar source images.\n     - YUV planar images can now be decoded into RGB or grayscale images.\n     - 4:1:1 subsampling is now supported.  This is mainly included for\ncompatibility, since 4:1:1 is not fully accelerated in libjpeg-turbo and has no\nsignificant advantages relative to 4:2:0.\n     - CMYK images are now supported.  This feature allows CMYK source images\nto be compressed to YCCK JPEGs and YCCK or CMYK JPEGs to be decompressed to\nCMYK destination images.  Conversion between CMYK/YCCK and RGB or YUV images is\nnot supported.  Such conversion requires a color management system and is thus\nout of scope for a codec library.\n     - The handling of YUV images in the Java API has been significantly\nrefactored and should now be much more intuitive.\n     - The Java API now supports encoding a YUV image from an arbitrary\nposition in a large image buffer.\n     - All of the YUV functions now have a corresponding function that operates\non separate image planes instead of a unified image buffer.  This allows for\ncompressing/decoding from or decompressing/encoding to a subregion of a larger\nYUV image.  It also allows for handling YUV formats that swap the order of the\nU and V planes.\n\n2. Added SIMD acceleration for DSPr2-capable MIPS platforms.  This speeds up\nthe compression of full-color JPEGs by 70-80% on such platforms and\ndecompression by 25-35%.\n\n3. If an application attempts to decompress a Huffman-coded JPEG image whose\nheader does not contain Huffman tables, libjpeg-turbo will now insert the\ndefault Huffman tables.  In order to save space, many motion JPEG video frames\nare encoded without the default Huffman tables, so these frames can now be\nsuccessfully decompressed by libjpeg-turbo without additional work on the part\nof the application.  An application can still override the Huffman tables, for\ninstance to re-use tables from a previous frame of the same video.\n\n4. The Mac packaging system now uses pkgbuild and productbuild rather than\nPackageMaker (which is obsolete and no longer supported.)  This means that\nOS X 10.6 \"Snow Leopard\" or later must be used when packaging libjpeg-turbo,\nalthough the packages produced can be installed on OS X 10.5 \"Leopard\" or\nlater.  OS X 10.4 \"Tiger\" is no longer supported.\n\n5. The Huffman encoder now uses `clz` and `bsr` instructions for bit counting\non ARM platforms rather than a lookup table.  This reduces the memory footprint\nby 64k, which may be important for some mobile applications.  Out of four\nAndroid devices that were tested, two demonstrated a small overall performance\nloss (~3-4% on average) with ARMv6 code and a small gain (also ~3-4%) with\nARMv7 code when enabling this new feature, but the other two devices\ndemonstrated a significant overall performance gain with both ARMv6 and ARMv7\ncode (~10-20%) when enabling the feature.  Actual mileage may vary.\n\n6. Worked around an issue with Visual C++ 2010 and later that caused incorrect\npixels to be generated when decompressing a JPEG image to a 256-color bitmap,\nif compiler optimization was enabled when libjpeg-turbo was built.  This caused\nthe regression tests to fail when doing a release build under Visual C++ 2010\nand later.\n\n7. Improved the accuracy and performance of the non-SIMD implementation of the\nfloating point inverse DCT (using code borrowed from libjpeg v8a and later.)\nThe accuracy of this implementation now matches the accuracy of the SSE/SSE2\nimplementation.  Note, however, that the floating point DCT/IDCT algorithms are\nmainly a legacy feature.  They generally do not produce significantly better\naccuracy than the slow integer DCT/IDCT algorithms, and they are quite a bit\nslower.\n\n8. Added a new output colorspace (`JCS_RGB565`) to the libjpeg API that allows\nfor decompressing JPEG images into RGB565 (16-bit) pixels.  If dithering is not\nused, then this code path is SIMD-accelerated on ARM platforms.\n\n9. Numerous obsolete features, such as support for non-ANSI compilers and\nsupport for the MS-DOS memory model, were removed from the libjpeg code,\ngreatly improving its readability and making it easier to maintain and extend.\n\n10. Fixed a segfault that occurred when calling `output_message()` with\n`msg_code` set to `JMSG_COPYRIGHT`.\n\n11. Fixed an issue whereby wrjpgcom was allowing comments longer than 65k\ncharacters to be passed on the command line, which was causing it to generate\nincorrect JPEG files.\n\n12. Fixed a bug in the build system that was causing the Windows version of\nwrjpgcom to be built using the rdjpgcom source code.\n\n13. Restored 12-bit-per-component JPEG support.  A 12-bit version of\nlibjpeg-turbo can now be built by passing an argument of `--with-12bit` to\nconfigure (Unix) or `-DWITH_12BIT=1` to cmake (Windows.)  12-bit JPEG support\nis included only for convenience.  Enabling this feature disables all of the\nperformance features in libjpeg-turbo, as well as arithmetic coding and the\nTurboJPEG API.  The resulting library still contains the other libjpeg-turbo\nfeatures (such as the colorspace extensions), but in general, it performs no\nfaster than libjpeg v6b.\n\n14. Added ARM 64-bit SIMD acceleration for the YCC-to-RGB color conversion\nand IDCT algorithms (both are used during JPEG decompression.)  For unknown\nreasons (probably related to clang), this code cannot currently be compiled for\niOS.\n\n15. Fixed an extremely rare bug that could cause the Huffman encoder's local\nbuffer to overrun when a very high-frequency MCU is compressed using quality\n100 and no subsampling, and when the JPEG output buffer is being dynamically\nresized by the destination manager.  This issue was so rare that, even with a\ntest program specifically designed to make the bug occur (by injecting random\nhigh-frequency YUV data into the compressor), it was reproducible only once in\nabout every 25 million iterations.\n\n16. Fixed an oversight in the TurboJPEG C wrapper:  if any of the JPEG\ncompression functions was called repeatedly with the same\nautomatically-allocated destination buffer, then TurboJPEG would erroneously\nassume that the `jpegSize` parameter was equal to the size of the buffer, when\nin fact that parameter was probably equal to the size of the most recently\ncompressed JPEG image.  If the size of the previous JPEG image was not as large\nas the current JPEG image, then TurboJPEG would unnecessarily reallocate the\ndestination buffer.\n\n\n1.3.1\n=====\n\n### Significant changes relative to 1.3.0:\n\n1. On Un*x systems, `make install` now installs the libjpeg-turbo libraries\ninto /opt/libjpeg-turbo/lib32 by default on any 32-bit system, not just x86,\nand into /opt/libjpeg-turbo/lib64 by default on any 64-bit system, not just\nx86-64.  You can override this by overriding either the `prefix` or `libdir`\nconfigure variables.\n\n2. The Windows installer now places a copy of the TurboJPEG DLLs in the same\ndirectory as the rest of the libjpeg-turbo binaries.  This was mainly done\nto support TurboVNC 1.3, which bundles the DLLs in its Windows installation.\nWhen using a 32-bit version of CMake on 64-bit Windows, it is impossible to\naccess the c:\\WINDOWS\\system32 directory, which made it impossible for the\nTurboVNC build scripts to bundle the 64-bit TurboJPEG DLL.\n\n3. Fixed a bug whereby attempting to encode a progressive JPEG with arithmetic\nentropy coding (by passing arguments of `-progressive -arithmetic` to cjpeg or\njpegtran, for instance) would result in an error, `Requested feature was\nomitted at compile time`.\n\n4. Fixed a couple of issues whereby malformed JPEG images would cause\nlibjpeg-turbo to use uninitialized memory during decompression.\n\n5. Fixed an error (`Buffer passed to JPEG library is too small`) that occurred\nwhen calling the TurboJPEG YUV encoding function with a very small (< 5x5)\nsource image, and added a unit test to check for this error.\n\n6. The Java classes should now build properly under Visual Studio 2010 and\nlater.\n\n7. Fixed an issue that prevented SRPMs generated using the in-tree packaging\ntools from being rebuilt on certain newer Linux distributions.\n\n8. Numerous minor fixes to eliminate compilation and build/packaging system\nwarnings, fix cosmetic issues, improve documentation clarity, and other general\nsource cleanup.\n\n\n1.3.0\n=====\n\n### Significant changes relative to 1.3 beta1:\n\n1. `make test` now works properly on FreeBSD, and it no longer requires the\nmd5sum executable to be present on other Un*x platforms.\n\n2. Overhauled the packaging system:\n\n     - To avoid conflict with vendor-supplied libjpeg-turbo packages, the\nofficial RPMs and DEBs for libjpeg-turbo have been renamed to\n\"libjpeg-turbo-official\".\n     - The TurboJPEG libraries are now located under /opt/libjpeg-turbo in the\nofficial Linux and Mac packages, to avoid conflict with vendor-supplied\npackages and also to streamline the packaging system.\n     - Release packages are now created with the directory structure defined\nby the configure variables `prefix`, `bindir`, `libdir`, etc. (Un\\*x) or by the\n`CMAKE_INSTALL_PREFIX` variable (Windows.)  The exception is that the docs are\nalways located under the system default documentation directory on Un\\*x and\nMac systems, and on Windows, the TurboJPEG DLL is always located in the Windows\nsystem directory.\n     - To avoid confusion, official libjpeg-turbo packages on Linux/Unix\nplatforms (except for Mac) will always install the 32-bit libraries in\n/opt/libjpeg-turbo/lib32 and the 64-bit libraries in /opt/libjpeg-turbo/lib64.\n     - Fixed an issue whereby, in some cases, the libjpeg-turbo executables on\nUn*x systems were not properly linking with the shared libraries installed by\nthe same package.\n     - Fixed an issue whereby building the \"installer\" target on Windows when\n`WITH_JAVA=1` would fail if the TurboJPEG JAR had not been previously built.\n     - Building the \"install\" target on Windows now installs files into the\nsame places that the installer does.\n\n3. Fixed a Huffman encoder bug that prevented I/O suspension from working\nproperly.\n\n\n1.2.90 (1.3 beta1)\n==================\n\n### Significant changes relative to 1.2.1:\n\n1. Added support for additional scaling factors (3/8, 5/8, 3/4, 7/8, 9/8, 5/4,\n11/8, 3/2, 13/8, 7/4, 15/8, and 2) when decompressing.  Note that the IDCT will\nnot be SIMD-accelerated when using any of these new scaling factors.\n\n2. The TurboJPEG dynamic library is now versioned.  It was not strictly\nnecessary to do so, because TurboJPEG uses versioned symbols, and if a function\nchanges in an ABI-incompatible way, that function is renamed and a legacy\nfunction is provided to maintain backward compatibility.  However, certain\nLinux distro maintainers have a policy against accepting any library that isn't\nversioned.\n\n3. Extended the TurboJPEG Java API so that it can be used to compress a JPEG\nimage from and decompress a JPEG image to an arbitrary position in a large\nimage buffer.\n\n4. The `tjDecompressToYUV()` function now supports the `TJFLAG_FASTDCT` flag.\n\n5. The 32-bit supplementary package for amd64 Debian systems now provides\nsymlinks in /usr/lib/i386-linux-gnu for the TurboJPEG libraries in /usr/lib32.\nThis allows those libraries to be used on MultiArch-compatible systems (such as\nUbuntu 11 and later) without setting the linker path.\n\n6. The TurboJPEG Java wrapper should now find the JNI library on Mac systems\nwithout having to pass `-Djava.library.path=/usr/lib` to java.\n\n7. TJBench has been ported to Java to provide a convenient way of validating\nthe performance of the TurboJPEG Java API.  It can be run with\n`java -cp turbojpeg.jar TJBench`.\n\n8. cjpeg can now be used to generate JPEG files with the RGB colorspace\n(feature ported from jpeg-8d.)\n\n9. The width and height in the `-crop` argument passed to jpegtran can now be\nsuffixed with `f` to indicate that, when the upper left corner of the cropping\nregion is automatically moved to the nearest iMCU boundary, the bottom right\ncorner should be moved by the same amount.  In other words, this feature causes\njpegtran to strictly honor the specified width/height rather than the specified\nbottom right corner (feature ported from jpeg-8d.)\n\n10. JPEG files using the RGB colorspace can now be decompressed into grayscale\nimages (feature ported from jpeg-8d.)\n\n11. Fixed a regression caused by 1.2.1[7] whereby the build would fail with\nmultiple \"Mismatch in operand sizes\" errors when attempting to build the x86\nSIMD code with NASM 0.98.\n\n12. The in-memory source/destination managers (`jpeg_mem_src()` and\n`jpeg_mem_dest()`) are now included by default when building libjpeg-turbo with\nlibjpeg v6b or v7 emulation, so that programs can take advantage of these\nfunctions without requiring the use of the backward-incompatible libjpeg v8\nABI.  The \"age number\" of the libjpeg-turbo library on Un*x systems has been\nincremented by 1 to reflect this.  You can disable this feature with a\nconfigure/CMake switch in order to retain strict API/ABI compatibility with the\nlibjpeg v6b or v7 API/ABI (or with previous versions of libjpeg-turbo.)  See\n[README.md](README.md) for more details.\n\n13. Added ARMv7s architecture to libjpeg.a and libturbojpeg.a in the official\nlibjpeg-turbo binary package for OS X, so that those libraries can be used to\nbuild applications that leverage the faster CPUs in the iPhone 5 and iPad 4.\n\n\n1.2.1\n=====\n\n### Significant changes relative to 1.2.0:\n\n1. Creating or decoding a JPEG file that uses the RGB colorspace should now\nproperly work when the input or output colorspace is one of the libjpeg-turbo\ncolorspace extensions.\n\n2. When libjpeg-turbo was built without SIMD support and merged (non-fancy)\nupsampling was used along with an alpha-enabled colorspace during\ndecompression, the unused byte of the decompressed pixels was not being set to\n0xFF.  This has been fixed.  TJUnitTest has also been extended to test for the\ncorrect behavior of the colorspace extensions when merged upsampling is used.\n\n3. Fixed a bug whereby the libjpeg-turbo SSE2 SIMD code would not preserve the\nupper 64 bits of xmm6 and xmm7 on Win64 platforms, which violated the Win64\ncalling conventions.\n\n4. Fixed a regression caused by 1.2.0[6] whereby decompressing corrupt JPEG\nimages (specifically, images in which the component count was erroneously set\nto a large value) would cause libjpeg-turbo to segfault.\n\n5. Worked around a severe performance issue with \"Bobcat\" (AMD Embedded APU)\nprocessors.  The `MASKMOVDQU` instruction, which was used by the libjpeg-turbo\nSSE2 SIMD code, is apparently implemented in microcode on AMD processors, and\nit is painfully slow on Bobcat processors in particular.  Eliminating the use\nof this instruction improved performance by an order of magnitude on Bobcat\nprocessors and by a small amount (typically 5%) on AMD desktop processors.\n\n6. Added SIMD acceleration for performing 4:2:2 upsampling on NEON-capable ARM\nplatforms.  This speeds up the decompression of 4:2:2 JPEGs by 20-25% on such\nplatforms.\n\n7. Fixed a regression caused by 1.2.0[2] whereby, on Linux/x86 platforms\nrunning the 32-bit SSE2 SIMD code in libjpeg-turbo, decompressing a 4:2:0 or\n4:2:2 JPEG image into a 32-bit (RGBX, BGRX, etc.) buffer without using fancy\nupsampling would produce several incorrect columns of pixels at the right-hand\nside of the output image if each row in the output image was not evenly\ndivisible by 16 bytes.\n\n8. Fixed an issue whereby attempting to build the SIMD extensions with Xcode\n4.3 on OS X platforms would cause NASM to return numerous errors of the form\n\"'%define' expects a macro identifier\".\n\n9. Added flags to the TurboJPEG API that allow the caller to force the use of\neither the fast or the accurate DCT/IDCT algorithms in the underlying codec.\n\n\n1.2.0\n=====\n\n### Significant changes relative to 1.2 beta1:\n\n1. Fixed build issue with YASM on Unix systems (the libjpeg-turbo build system\nwas not adding the current directory to the assembler include path, so YASM\nwas not able to find jsimdcfg.inc.)\n\n2. Fixed out-of-bounds read in SSE2 SIMD code that occurred when decompressing\na JPEG image to a bitmap buffer whose size was not a multiple of 16 bytes.\nThis was more of an annoyance than an actual bug, since it did not cause any\nactual run-time problems, but the issue showed up when running libjpeg-turbo in\nvalgrind.  See <http://crbug.com/72399> for more information.\n\n3. Added a compile-time macro (`LIBJPEG_TURBO_VERSION`) that can be used to\ncheck the version of libjpeg-turbo against which an application was compiled.\n\n4. Added new RGBA/BGRA/ABGR/ARGB colorspace extension constants (libjpeg API)\nand pixel formats (TurboJPEG API), which allow applications to specify that,\nwhen decompressing to a 4-component RGB buffer, the unused byte should be set\nto 0xFF so that it can be interpreted as an opaque alpha channel.\n\n5. Fixed regression issue whereby DevIL failed to build against libjpeg-turbo\nbecause libjpeg-turbo's distributed version of jconfig.h contained an `INLINE`\nmacro, which conflicted with a similar macro in DevIL.  This macro is used only\ninternally when building libjpeg-turbo, so it was moved into config.h.\n\n6. libjpeg-turbo will now correctly decompress erroneous CMYK/YCCK JPEGs whose\nK component is assigned a component ID of 1 instead of 4.  Although these files\nare in violation of the spec, other JPEG implementations handle them\ncorrectly.\n\n7. Added ARMv6 and ARMv7 architectures to libjpeg.a and libturbojpeg.a in\nthe official libjpeg-turbo binary package for OS X, so that those libraries can\nbe used to build both OS X and iOS applications.\n\n\n1.1.90 (1.2 beta1)\n==================\n\n### Significant changes relative to 1.1.1:\n\n1. Added a Java wrapper for the TurboJPEG API.  See [java/README](java/README)\nfor more details.\n\n2. The TurboJPEG API can now be used to scale down images during\ndecompression.\n\n3. Added SIMD routines for RGB-to-grayscale color conversion, which\nsignificantly improves the performance of grayscale JPEG compression from an\nRGB source image.\n\n4. Improved the performance of the C color conversion routines, which are used\non platforms for which SIMD acceleration is not available.\n\n5. Added a function to the TurboJPEG API that performs lossless transforms.\nThis function is implemented using the same back end as jpegtran, but it\nperforms transcoding entirely in memory and allows multiple transforms and/or\ncrop operations to be batched together, so the source coefficients only need to\nbe read once.  This is useful when generating image tiles from a single source\nJPEG.\n\n6. Added tests for the new TurboJPEG scaled decompression and lossless\ntransform features to tjbench (the TurboJPEG benchmark, formerly called\n\"jpgtest\".)\n\n7. Added support for 4:4:0 (transposed 4:2:2) subsampling in TurboJPEG, which\nwas necessary in order for it to read 4:2:2 JPEG files that had been losslessly\ntransposed or rotated 90 degrees.\n\n8. All legacy VirtualGL code has been re-factored, and this has allowed\nlibjpeg-turbo, in its entirety, to be re-licensed under a BSD-style license.\n\n9. libjpeg-turbo can now be built with YASM.\n\n10. Added SIMD acceleration for ARM Linux and iOS platforms that support\nNEON instructions.\n\n11. Refactored the TurboJPEG C API and documented it using Doxygen.  The\nTurboJPEG 1.2 API uses pixel formats to define the size and component order of\nthe uncompressed source/destination images, and it includes a more efficient\nversion of `TJBUFSIZE()` that computes a worst-case JPEG size based on the\nlevel of chrominance subsampling.  The refactored implementation of the\nTurboJPEG API now uses the libjpeg memory source and destination managers,\nwhich allows the TurboJPEG compressor to grow the JPEG buffer as necessary.\n\n12. Eliminated errors in the output of jpegtran on Windows that occurred when\nthe application was invoked using I/O redirection\n(`jpegtran <input.jpg >output.jpg`.)\n\n13. The inclusion of libjpeg v7 and v8 emulation as well as arithmetic coding\nsupport in libjpeg-turbo v1.1.0 introduced several new error constants in\njerror.h, and these were mistakenly enabled for all emulation modes, causing\nthe error enum in libjpeg-turbo to sometimes have different values than the\nsame enum in libjpeg.  This represents an ABI incompatibility, and it caused\nproblems with rare applications that took specific action based on a particular\nerror value.  The fix was to include the new error constants conditionally\nbased on whether libjpeg v7 or v8 emulation was enabled.\n\n14. Fixed an issue whereby Windows applications that used libjpeg-turbo would\nfail to compile if the Windows system headers were included before jpeglib.h.\nThis issue was caused by a conflict in the definition of the INT32 type.\n\n15. Fixed 32-bit supplementary package for amd64 Debian systems, which was\nbroken by enhancements to the packaging system in 1.1.\n\n16. When decompressing a JPEG image using an output colorspace of\n`JCS_EXT_RGBX`, `JCS_EXT_BGRX`, `JCS_EXT_XBGR`, or `JCS_EXT_XRGB`,\nlibjpeg-turbo will now set the unused byte to 0xFF, which allows applications\nto interpret that byte as an alpha channel (0xFF = opaque).\n\n\n1.1.1\n=====\n\n### Significant changes relative to 1.1.0:\n\n1. Fixed a 1-pixel error in row 0, column 21 of the luminance plane generated\nby `tjEncodeYUV()`.\n\n2. libjpeg-turbo's accelerated Huffman decoder previously ignored unexpected\nmarkers found in the middle of the JPEG data stream during decompression.  It\nwill now hand off decoding of a particular block to the unaccelerated Huffman\ndecoder if an unexpected marker is found, so that the unaccelerated Huffman\ndecoder can generate an appropriate warning.\n\n3. Older versions of MinGW64 prefixed symbol names with underscores by\ndefault, which differed from the behavior of 64-bit Visual C++.  MinGW64 1.0\nhas adopted the behavior of 64-bit Visual C++ as the default, so to accommodate\nthis, the libjpeg-turbo SIMD function names are no longer prefixed with an\nunderscore when building with MinGW64.  This means that, when building\nlibjpeg-turbo with older versions of MinGW64, you will now have to add\n`-fno-leading-underscore` to the `CFLAGS`.\n\n4. Fixed a regression bug in the NSIS script that caused the Windows installer\nbuild to fail when using the Visual Studio IDE.\n\n5. Fixed a bug in `jpeg_read_coefficients()` whereby it would not initialize\n`cinfo->image_width` and `cinfo->image_height` if libjpeg v7 or v8 emulation\nwas enabled.  This specifically caused the jpegoptim program to fail if it was\nlinked against a version of libjpeg-turbo that was built with libjpeg v7 or v8\nemulation.\n\n6. Eliminated excessive I/O overhead that occurred when reading BMP files in\ncjpeg.\n\n7. Eliminated errors in the output of cjpeg on Windows that occurred when the\napplication was invoked using I/O redirection (`cjpeg <inputfile >output.jpg`.)\n\n\n1.1.0\n=====\n\n### Significant changes relative to 1.1 beta1:\n\n1. The algorithm used by the SIMD quantization function cannot produce correct\nresults when the JPEG quality is >= 98 and the fast integer forward DCT is\nused.  Thus, the non-SIMD quantization function is now used for those cases,\nand libjpeg-turbo should now produce identical output to libjpeg v6b in all\ncases.\n\n2. Despite the above, the fast integer forward DCT still degrades somewhat for\nJPEG qualities greater than 95, so the TurboJPEG wrapper will now automatically\nuse the slow integer forward DCT when generating JPEG images of quality 96 or\ngreater.  This reduces compression performance by as much as 15% for these\nhigh-quality images but is necessary to ensure that the images are perceptually\nlossless.  It also ensures that the library can avoid the performance pitfall\ncreated by [1].\n\n3. Ported jpgtest.cxx to pure C to avoid the need for a C++ compiler.\n\n4. Fixed visual artifacts in grayscale JPEG compression caused by a typo in\nthe RGB-to-luminance lookup tables.\n\n5. The Windows distribution packages now include the libjpeg run-time programs\n(cjpeg, etc.)\n\n6. All packages now include jpgtest.\n\n7. The TurboJPEG dynamic library now uses versioned symbols.\n\n8. Added two new TurboJPEG API functions, `tjEncodeYUV()` and\n`tjDecompressToYUV()`, to replace the somewhat hackish `TJ_YUV` flag.\n\n\n1.0.90 (1.1 beta1)\n==================\n\n### Significant changes relative to 1.0.1:\n\n1. Added emulation of the libjpeg v7 and v8 APIs and ABIs.  See\n[README.md](README.md) for more details.  This feature was sponsored by\nCamTrace SAS.\n\n2. Created a new CMake-based build system for the Visual C++ and MinGW builds.\n\n3. Grayscale bitmaps can now be compressed from/decompressed to using the\nTurboJPEG API.\n\n4. jpgtest can now be used to test decompression performance with existing\nJPEG images.\n\n5. If the default install prefix (/opt/libjpeg-turbo) is used, then\n`make install` now creates /opt/libjpeg-turbo/lib32 and\n/opt/libjpeg-turbo/lib64 sym links to duplicate the behavior of the binary\npackages.\n\n6. All symbols in the libjpeg-turbo dynamic library are now versioned, even\nwhen the library is built with libjpeg v6b emulation.\n\n7. Added arithmetic encoding and decoding support (can be disabled with\nconfigure or CMake options)\n\n8. Added a `TJ_YUV` flag to the TurboJPEG API, which causes both the compressor\nand decompressor to output planar YUV images.\n\n9. Added an extended version of `tjDecompressHeader()` to the TurboJPEG API,\nwhich allows the caller to determine the type of subsampling used in a JPEG\nimage.\n\n10. Added further protections against invalid Huffman codes.\n\n\n1.0.1\n=====\n\n### Significant changes relative to 1.0.0:\n\n1. The Huffman decoder will now handle erroneous Huffman codes (for instance,\nfrom a corrupt JPEG image.)  Previously, these would cause libjpeg-turbo to\ncrash under certain circumstances.\n\n2. Fixed typo in SIMD dispatch routines that was causing 4:2:2 upsampling to\nbe used instead of 4:2:0 when decompressing JPEG images using SSE2 code.\n\n3. The configure script will now automatically determine whether the\n`INCOMPLETE_TYPES_BROKEN` macro should be defined.\n\n\n1.0.0\n=====\n\n### Significant changes relative to 0.0.93:\n\n1. 2983700: Further FreeBSD build tweaks (no longer necessary to specify\n`--host` when configuring on a 64-bit system)\n\n2. Created symlinks in the Unix/Linux packages so that the TurboJPEG\ninclude file can always be found in /opt/libjpeg-turbo/include, the 32-bit\nstatic libraries can always be found in /opt/libjpeg-turbo/lib32, and the\n64-bit static libraries can always be found in /opt/libjpeg-turbo/lib64.\n\n3. The Unix/Linux distribution packages now include the libjpeg run-time\nprograms (cjpeg, etc.) and man pages.\n\n4. Created a 32-bit supplementary package for amd64 Debian systems, which\ncontains just the 32-bit libjpeg-turbo libraries.\n\n5. Moved the libraries from */lib32 to */lib in the i386 Debian package.\n\n6. Include distribution package for Cygwin\n\n7. No longer necessary to specify `--without-simd` on non-x86 architectures,\nand unit tests now work on those architectures.\n\n\n0.0.93\n======\n\n### Significant changes since 0.0.91:\n\n1. 2982659: Fixed x86-64 build on FreeBSD systems\n\n2. 2988188: Added support for Windows 64-bit systems\n\n\n0.0.91\n======\n\n### Significant changes relative to 0.0.90:\n\n1. Added documentation to .deb packages\n\n2. 2968313: Fixed data corruption issues when decompressing large JPEG images\nand/or using buffered I/O with the libjpeg-turbo decompressor\n\n\n0.0.90\n======\n\nInitial release\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/LICENSE.md",
    "content": "libjpeg-turbo Licenses\n======================\n\nlibjpeg-turbo is covered by three compatible BSD-style open source licenses:\n\n- The IJG (Independent JPEG Group) License, which is listed in\n  [README.ijg](README.ijg)\n\n  This license applies to the libjpeg API library and associated programs\n  (any code inherited from libjpeg, and any modifications to that code.)\n\n- The Modified (3-clause) BSD License, which is listed in\n  [turbojpeg.c](turbojpeg.c)\n\n  This license covers the TurboJPEG API library and associated programs.\n\n- The zlib License, which is listed in [simd/jsimdext.inc](simd/jsimdext.inc)\n\n  This license is a subset of the other two, and it covers the libjpeg-turbo\n  SIMD extensions.\n\n\nComplying with the libjpeg-turbo Licenses\n=========================================\n\nThis section provides a roll-up of the libjpeg-turbo licensing terms, to the\nbest of our understanding.\n\n1.  If you are distributing a modified version of the libjpeg-turbo source,\n    then:\n\n    1.  You cannot alter or remove any existing copyright or license notices\n        from the source.\n\n        **Origin**\n        - Clause 1 of the IJG License\n        - Clause 1 of the Modified BSD License\n        - Clauses 1 and 3 of the zlib License\n\n    2.  You must add your own copyright notice to the header of each source\n        file you modified, so others can tell that you modified that file (if\n        there is not an existing copyright header in that file, then you can\n        simply add a notice stating that you modified the file.)\n\n        **Origin**\n        - Clause 1 of the IJG License\n        - Clause 2 of the zlib License\n\n    3.  You must include the IJG README file, and you must not alter any of the\n        copyright or license text in that file.\n\n        **Origin**\n        - Clause 1 of the IJG License\n\n2.  If you are distributing only libjpeg-turbo binaries without the source, or\n    if you are distributing an application that statically links with\n    libjpeg-turbo, then:\n\n    1.  Your product documentation must include a message stating:\n\n        This software is based in part on the work of the Independent JPEG\n        Group.\n\n        **Origin**\n        - Clause 2 of the IJG license\n\n    2.  If your binary distribution includes or uses the TurboJPEG API, then\n        your product documentation must include the text of the Modified BSD\n        License.\n\n        **Origin**\n        - Clause 2 of the Modified BSD License\n\n3.  You cannot use the name of the IJG or The libjpeg-turbo Project or the\n    contributors thereof in advertising, publicity, etc.\n\n    **Origin**\n    - IJG License\n    - Clause 3 of the Modified BSD License\n\n4.  The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be\n    free of defects, nor do we accept any liability for undesirable\n    consequences resulting from your use of the software.\n\n    **Origin**\n    - IJG License\n    - Modified BSD License\n    - zlib License\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/Makefile.am",
    "content": "lib_LTLIBRARIES = libjpeg.la\nlibjpeg_la_LDFLAGS = -version-info ${LIBTOOL_CURRENT}:${SO_MINOR_VERSION}:${SO_AGE} -no-undefined\ninclude_HEADERS = jerror.h jmorecfg.h jpeglib.h\n\nif WITH_TURBOJPEG\nlib_LTLIBRARIES += libturbojpeg.la\nlibturbojpeg_la_LDFLAGS = -version-info 1:0:1 -no-undefined\ninclude_HEADERS += turbojpeg.h\nendif\n\nnodist_include_HEADERS = jconfig.h\n\npkgconfigdir = $(libdir)/pkgconfig\npkgconfig_DATA = pkgscripts/libjpeg.pc pkgscripts/libturbojpeg.pc\n\nHDRS = jchuff.h jdct.h jdhuff.h jerror.h jinclude.h jmemsys.h jmorecfg.h \\\n\tjpegint.h jpeglib.h jversion.h jsimd.h jsimddct.h jpegcomp.h \\\n\tjpeg_nbits_table.h\n\nlibjpeg_la_SOURCES = $(HDRS) jcapimin.c jcapistd.c jccoefct.c jccolor.c \\\n\tjcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \\\n\tjcomapi.c jcparam.c jcphuff.c jcprepct.c jcsample.c jctrans.c \\\n\tjdapimin.c jdapistd.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \\\n\tjddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \\\n\tjdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c \\\n\tjfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c \\\n\tjidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c\n\nif WITH_ARITH\nlibjpeg_la_SOURCES += jaricom.c\nendif\n\nif WITH_ARITH_ENC\nlibjpeg_la_SOURCES += jcarith.c\nendif\n\nif WITH_ARITH_DEC\nlibjpeg_la_SOURCES += jdarith.c\nendif\n\n\nSUBDIRS = java\n\n\nif WITH_TURBOJPEG\n\nlibturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpeg.c turbojpeg.h \\\n\ttransupp.c transupp.h jdatadst-tj.c jdatasrc-tj.c\n\nif WITH_JAVA\n\nlibturbojpeg_la_SOURCES += turbojpeg-jni.c\nlibturbojpeg_la_CFLAGS = ${JNI_CFLAGS}\nTJMAPFILE = turbojpeg-mapfile.jni\n\nelse\n\nTJMAPFILE = turbojpeg-mapfile\n\nendif\n\nlibturbojpeg_la_SOURCES += $(TJMAPFILE)\n\nif VERSION_SCRIPT\nlibturbojpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)$(srcdir)/$(TJMAPFILE)\nendif\n\nendif\n\n\nif VERSION_SCRIPT\nlibjpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)libjpeg.map\nendif\n\n\nif WITH_SIMD\n\nSUBDIRS += simd\nlibjpeg_la_LIBADD = simd/libsimd.la\nlibturbojpeg_la_LIBADD = simd/libsimd.la\n\nelse\n\nlibjpeg_la_SOURCES += jsimd_none.c\n\nendif\n\n\nbin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom\nnoinst_PROGRAMS = jcstest\n\n\nif WITH_TURBOJPEG\n\nbin_PROGRAMS += tjbench\n\nnoinst_PROGRAMS += tjunittest\n\ntjbench_SOURCES = tjbench.c bmp.h bmp.c tjutil.h tjutil.c rdbmp.c rdppm.c \\\n\twrbmp.c wrppm.c\n\ntjbench_LDADD = libturbojpeg.la libjpeg.la -lm\n\ntjbench_CFLAGS = -DBMP_SUPPORTED -DPPM_SUPPORTED\n\ntjunittest_SOURCES = tjunittest.c tjutil.h tjutil.c\n\ntjunittest_LDADD = libturbojpeg.la\n\nendif\n\n\ncjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdgif.c rdppm.c rdswitch.c\nif WITH_12BIT\nelse\ncjpeg_SOURCES += rdbmp.c rdtarga.c\nendif\n\ncjpeg_LDADD = libjpeg.la\n\ncjpeg_CFLAGS = -DGIF_SUPPORTED -DPPM_SUPPORTED\nif WITH_12BIT\nelse\ncjpeg_CFLAGS += -DBMP_SUPPORTED -DTARGA_SUPPORTED\nendif\n\ndjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \\\n\twrgif.c wrppm.c\nif WITH_12BIT\nelse\ndjpeg_SOURCES += wrbmp.c wrtarga.c\nendif\n\ndjpeg_LDADD = libjpeg.la\n\ndjpeg_CFLAGS = -DGIF_SUPPORTED -DPPM_SUPPORTED\nif WITH_12BIT\nelse\ndjpeg_CFLAGS += -DBMP_SUPPORTED -DTARGA_SUPPORTED\nendif\n\njpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c transupp.h\n\njpegtran_LDADD = libjpeg.la\n\nrdjpgcom_SOURCES = rdjpgcom.c\n\nrdjpgcom_LDADD = libjpeg.la\n\nwrjpgcom_SOURCES = wrjpgcom.c\n\nwrjpgcom_LDADD = libjpeg.la\n\njcstest_SOURCES = jcstest.c\n\njcstest_LDADD = libjpeg.la\n\ndist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1\n\nDOCS= coderules.txt jconfig.txt change.log rdrle.c wrrle.c BUILDING.md \\\n\tChangeLog.md\n\ndist_doc_DATA = README.ijg README.md libjpeg.txt structure.txt usage.txt \\\n\twizard.txt LICENSE.md\n\nexampledir = $(docdir)\ndist_example_DATA = example.c\n\n\nEXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \\\n\tsharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \\\n\tdoxygen-extra.css jccolext.c jdcolext.c jdcol565.c jdmrgext.c jdmrg565.c \\\n\tjstdhuff.c jdcoefct.h jdmainct.h jdmaster.h jdsample.h wrppm.h \\\n\tmd5/CMakeLists.txt\n\ndist-hook:\n\trm -rf `find $(distdir) -name .svn`\n\n\nSUBDIRS += md5\n\nif WITH_12BIT\n\nTESTORIG = testorig12.jpg\nMD5_JPEG_RGB_ISLOW = 9620f424569594bb9242b48498ad801f\nMD5_PPM_RGB_ISLOW = f3301d2219783b8b3d942b7239fa50c0\nMD5_JPEG_422_IFAST_OPT = 7322e3bd2f127f7de4b40d4480ce60e4\nMD5_PPM_422_IFAST = 79807fa552899e66a04708f533e16950\nMD5_PPM_422M_IFAST = 07737bfe8a7c1c87aaa393a0098d16b0\nMD5_JPEG_420_IFAST_Q100_PROG = a1da220b5604081863a504297ed59e55\nMD5_PPM_420_Q100_IFAST = 1b3730122709f53d007255e8dfd3305e\nMD5_PPM_420M_Q100_IFAST = 980a1a3c5bf9510022869d30b7d26566\nMD5_JPEG_GRAY_ISLOW = 235c90707b16e2e069f37c888b2636d9\nMD5_PPM_GRAY_ISLOW = 7213c10af507ad467da5578ca5ee1fca\nMD5_PPM_GRAY_ISLOW_RGB = e96ee81c30a6ed422d466338bd3de65d\nMD5_JPEG_420S_IFAST_OPT = 7af8e60be4d9c227ec63ac9b6630855e\nMD5_JPEG_3x2_FLOAT_PROG_SSE = a8c17daf77b457725ec929e215b603f8\nMD5_PPM_3x2_FLOAT_SSE = 42876ab9e5c2f76a87d08db5fbd57956\nMD5_JPEG_3x2_FLOAT_PROG_32BIT = a8c17daf77b457725ec929e215b603f8\nMD5_PPM_3x2_FLOAT_32BIT = 42876ab9e5c2f76a87d08db5fbd57956\nMD5_PPM_3x2_FLOAT_64BIT = d6fbc71153b3d8ded484dbc17c7b9cf4\nMD5_JPEG_3x2_IFAST_PROG = 1396cc2b7185cfe943d408c9d305339e\nMD5_PPM_3x2_IFAST = 3975985ef6eeb0a2cdc58daa651ccc00\nMD5_PPM_420M_ISLOW_2_1 = 4ca6be2a6f326ff9eaab63e70a8259c0\nMD5_PPM_420M_ISLOW_15_8 = 12aa9f9534c1b3d7ba047322226365eb\nMD5_PPM_420M_ISLOW_13_8 = f7e22817c7b25e1393e4ec101e9d4e96\nMD5_PPM_420M_ISLOW_11_8 = 800a16f9f4dc9b293197bfe11be10a82\nMD5_PPM_420M_ISLOW_9_8 = 06b7a92a9bc69f4dc36ec40f1937d55c\nMD5_PPM_420M_ISLOW_7_8 = 3ec444a14a4ab4eab88ffc49c48eca43\nMD5_PPM_420M_ISLOW_3_4 = 3e726b7ea872445b19437d1c1d4f0d93\nMD5_PPM_420M_ISLOW_5_8 = a8a771abdc94301d20ffac119b2caccd\nMD5_PPM_420M_ISLOW_1_2 = b419124dd5568b085787234866102866\nMD5_PPM_420M_ISLOW_3_8 = 343d19015531b7bbe746124127244fa8\nMD5_PPM_420M_ISLOW_1_4 = 35fd59d866e44659edfa3c18db2a3edb\nMD5_PPM_420M_ISLOW_1_8 = ccaed48ac0aedefda5d4abe4013f4ad7\nMD5_PPM_420_ISLOW_SKIP15_31 = 86664cd9dc956536409e44e244d20a97\nMD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 = 452a21656115a163029cfba5c04fa76a\nMD5_PPM_444_ISLOW_SKIP1_6 = ef63901f71ef7a75cd78253fc0914f84\nMD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 = 15b173fb5872d9575572fbcc1b05956f\nMD5_JPEG_CROP = cdb35ff4b4519392690ea040c56ea99c\n\nelse\n\nTESTORIG = testorig.jpg\nMD5_JPEG_RGB_ISLOW = 768e970dd57b340ff1b83c9d3d47c77b\nMD5_PPM_RGB_ISLOW = 00a257f5393fef8821f2b88ac7421291\nMD5_BMP_RGB_ISLOW_565 = f07d2e75073e4bb10f6c6f4d36e2e3be\nMD5_BMP_RGB_ISLOW_565D = 4cfa0928ef3e6bb626d7728c924cfda4\nMD5_JPEG_422_IFAST_OPT = 2540287b79d913f91665e660303ab2c8\nMD5_PPM_422_IFAST = 35bd6b3f833bad23de82acea847129fa\nMD5_PPM_422M_IFAST = 8dbc65323d62cca7c91ba02dd1cfa81d\nMD5_BMP_422M_IFAST_565 = 3294bd4d9a1f2b3d08ea6020d0db7065\nMD5_BMP_422M_IFAST_565D = da98c9c7b6039511be4a79a878a9abc1\nMD5_JPEG_420_IFAST_Q100_PROG = 990cbe0329c882420a2094da7e5adade\nMD5_PPM_420_Q100_IFAST = 5a732542015c278ff43635e473a8a294\nMD5_PPM_420M_Q100_IFAST = ff692ee9323a3b424894862557c092f1\nMD5_JPEG_GRAY_ISLOW = 72b51f894b8f4a10b3ee3066770aa38d\nMD5_PPM_GRAY_ISLOW = 8d3596c56eace32f205deccc229aa5ed\nMD5_PPM_GRAY_ISLOW_RGB = 116424ac07b79e5e801f00508eab48ec\nMD5_BMP_GRAY_ISLOW_565 = 12f78118e56a2f48b966f792fedf23cc\nMD5_BMP_GRAY_ISLOW_565D = bdbbd616441a24354c98553df5dc82db\nMD5_JPEG_420S_IFAST_OPT = 388708217ac46273ca33086b22827ed8\n# See README.md for more details on why this next bit is necessary.\nMD5_JPEG_3x2_FLOAT_PROG_SSE = 343e3f8caf8af5986ebaf0bdc13b5c71\nMD5_PPM_3x2_FLOAT_SSE = 1a75f36e5904d6fc3a85a43da9ad89bb\nMD5_JPEG_3x2_FLOAT_PROG_32BIT = 9bca803d2042bd1eb03819e2bf92b3e5\nMD5_PPM_3x2_FLOAT_32BIT = f6bfab038438ed8f5522fbd33595dcdc\nMD5_PPM_3x2_FLOAT_64BIT = 0e917a34193ef976b679a6b069b1be26\nMD5_JPEG_3x2_IFAST_PROG = 1ee5d2c1a77f2da495f993c8c7cceca5\nMD5_PPM_3x2_IFAST = fd283664b3b49127984af0a7f118fccd\nMD5_JPEG_420_ISLOW_ARI = e986fb0a637a8d833d96e8a6d6d84ea1\nMD5_JPEG_444_ISLOW_PROGARI = 0a8f1c8f66e113c3cf635df0a475a617\nMD5_PPM_420M_IFAST_ARI = 72b59a99bcf1de24c5b27d151bde2437\nMD5_JPEG_420_ISLOW = 9a68f56bc76e466aa7e52f415d0f4a5f\nMD5_PPM_420M_ISLOW_2_1 = 9f9de8c0612f8d06869b960b05abf9c9\nMD5_PPM_420M_ISLOW_15_8 = b6875bc070720b899566cc06459b63b7\nMD5_PPM_420M_ISLOW_13_8 = bc3452573c8152f6ae552939ee19f82f\nMD5_PPM_420M_ISLOW_11_8 = d8cc73c0aaacd4556569b59437ba00a5\nMD5_PPM_420M_ISLOW_9_8 = d25e61bc7eac0002f5b393aa223747b6\nMD5_PPM_420M_ISLOW_7_8 = ddb564b7c74a09494016d6cd7502a946\nMD5_PPM_420M_ISLOW_3_4 = 8ed8e68808c3fbc4ea764fc9d2968646\nMD5_PPM_420M_ISLOW_5_8 = a3363274999da2366a024efae6d16c9b\nMD5_PPM_420M_ISLOW_1_2 = e692a315cea26b988c8e8b29a5dbcd81\nMD5_PPM_420M_ISLOW_3_8 = 79eca9175652ced755155c90e785a996\nMD5_PPM_420M_ISLOW_1_4 = 79cd778f8bf1a117690052cacdd54eca\nMD5_PPM_420M_ISLOW_1_8 = 391b3d4aca640c8567d6f8745eb2142f\nMD5_BMP_420_ISLOW_256 = 4980185e3776e89bd931736e1cddeee6\nMD5_BMP_420_ISLOW_565 = bf9d13e16c4923b92e1faa604d7922cb\nMD5_BMP_420_ISLOW_565D = 6bde71526acc44bcff76f696df8638d2\nMD5_BMP_420M_ISLOW_565 = 8dc0185245353cfa32ad97027342216f\nMD5_BMP_420M_ISLOW_565D =d1be3a3339166255e76fa50a0d70d73e\nMD5_PPM_420_ISLOW_SKIP15_31 = c4c65c1e43d7275cd50328a61e6534f0\nMD5_PPM_420_ISLOW_ARI_SKIP16_139 = 087c6b123db16ac00cb88c5b590bb74a\nMD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 = 26eb36ccc7d1f0cb80cdabb0ac8b5d99\nMD5_PPM_420_ISLOW_ARI_CROP53x53_4_4 = 886c6775af22370257122f8b16207e6d\nMD5_PPM_444_ISLOW_SKIP1_6 = 5606f86874cf26b8fcee1117a0a436a6\nMD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 = db87dc7ce26bcdc7a6b56239ce2b9d6c\nMD5_PPM_444_ISLOW_ARI_CROP37x37_0_0 = cb57b32bd6d03e35432362f7bf184b6d\nMD5_JPEG_CROP = b4197f377e621c4e9b1d20471432610d\n\nendif\n\n.PHONY: test\ntest: tjquicktest tjbittest bittest\n\nif CROSS_COMPILING\ntjquicktest: testclean\nelse\ntjquicktest: testclean all\nendif\n\nif WITH_TURBOJPEG\nif WITH_JAVA\n\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest\n\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -bi\n\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv\n\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -noyuvpad\n\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -bi\n\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -bi -noyuvpad\nendif\n\t./tjunittest\n\t./tjunittest -alloc\n\t./tjunittest -yuv\n\t./tjunittest -yuv -alloc\n\t./tjunittest -yuv -noyuvpad\nendif\n\techo GREAT SUCCESS!\n\nif CROSS_COMPILING\ntjbittest: testclean\nelse\ntjbittest: testclean all\nendif\n\nif WITH_TURBOJPEG\n\nMD5_PPM_GRAY_TILE = 89d3ca21213d9d864b50b4e4e7de4ca6\nMD5_PPM_420_8x8_TILE = 847fceab15c5b7b911cb986cf0f71de3\nMD5_PPM_420_16x16_TILE = ca45552a93687e078f7137cc4126a7b0\nMD5_PPM_420_32x32_TILE = d8676f1d6b68df358353bba9844f4a00\nMD5_PPM_420_64x64_TILE = 4e4c1a3d7ea4bace4f868bcbe83b7050\nMD5_PPM_420_128x128_TILE = f24c3429c52265832beab9df72a0ceae\nMD5_PPM_420M_8x8_TILE = bc25320e1f4c31ce2e610e43e9fd173c\nMD5_PPM_420M_TILE = 75ffdf14602258c5c189522af57fa605\nMD5_PPM_422_8x8_TILE = d83dacd9fc73b0a6f10c09acad64eb1e\nMD5_PPM_422_16x16_TILE = 35077fb610d72dd743b1eb0cbcfe10fb\nMD5_PPM_422_32x32_TILE = e6902ed8a449ecc0f0d6f2bf945f65f7\nMD5_PPM_422_64x64_TILE = 2b4502a8f316cedbde1da7bce3d2231e\nMD5_PPM_422_128x128_TILE = f0b5617d578f5e13c8eee215d64d4877\nMD5_PPM_422M_8x8_TILE = 828941d7f41cd6283abd6beffb7fd51d\nMD5_PPM_422M_TILE = e877ae1324c4a280b95376f7f018172f\nMD5_PPM_444_TILE = 7964e41e67cfb8d0a587c0aa4798f9c3\n\n# Test compressing from/decompressing to an arbitrary subregion of a larger\n# image buffer\n\tcp $(srcdir)/testimages/testorig.ppm testout_tile.ppm\n\t./tjbench testout_tile.ppm 95 -rgb -quiet -tile -benchtime 0.01 >/dev/null 2>&1\n\tfor i in 8 16 32 64 128; do \\\n\t\tmd5/md5cmp $(MD5_PPM_GRAY_TILE) testout_tile_GRAY_Q95_$$i\\x$$i.ppm; \\\n\tdone\n\tmd5/md5cmp $(MD5_PPM_420_8x8_TILE) testout_tile_420_Q95_8x8.ppm\n\tmd5/md5cmp $(MD5_PPM_420_16x16_TILE) testout_tile_420_Q95_16x16.ppm\n\tmd5/md5cmp $(MD5_PPM_420_32x32_TILE) testout_tile_420_Q95_32x32.ppm\n\tmd5/md5cmp $(MD5_PPM_420_64x64_TILE) testout_tile_420_Q95_64x64.ppm\n\tmd5/md5cmp $(MD5_PPM_420_128x128_TILE) testout_tile_420_Q95_128x128.ppm\n\tmd5/md5cmp $(MD5_PPM_422_8x8_TILE) testout_tile_422_Q95_8x8.ppm\n\tmd5/md5cmp $(MD5_PPM_422_16x16_TILE) testout_tile_422_Q95_16x16.ppm\n\tmd5/md5cmp $(MD5_PPM_422_32x32_TILE) testout_tile_422_Q95_32x32.ppm\n\tmd5/md5cmp $(MD5_PPM_422_64x64_TILE) testout_tile_422_Q95_64x64.ppm\n\tmd5/md5cmp $(MD5_PPM_422_128x128_TILE) testout_tile_422_Q95_128x128.ppm\n\tfor i in 8 16 32 64 128; do \\\n\t\tmd5/md5cmp $(MD5_PPM_444_TILE) testout_tile_444_Q95_$$i\\x$$i.ppm; \\\n\tdone\n\trm -f testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_*\n\n\t./tjbench testout_tile.ppm 95 -rgb -fastupsample -quiet -tile -benchtime 0.01 >/dev/null 2>&1\n\tmd5/md5cmp $(MD5_PPM_420M_8x8_TILE) testout_tile_420_Q95_8x8.ppm\n\tfor i in 16 32 64 128; do \\\n\t\tmd5/md5cmp $(MD5_PPM_420M_TILE) testout_tile_420_Q95_$$i\\x$$i.ppm; \\\n\tdone\n\tmd5/md5cmp $(MD5_PPM_422M_8x8_TILE) testout_tile_422_Q95_8x8.ppm\n\tfor i in 16 32 64 128; do \\\n\t\tmd5/md5cmp $(MD5_PPM_422M_TILE) testout_tile_422_Q95_$$i\\x$$i.ppm; \\\n\tdone\n\trm -f testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_* testout_tile.ppm\n\techo GREAT SUCCESS!\n\nendif\n\nif CROSS_COMPILING\nbittest: testclean\nelse\nbittest: testclean all\nendif\n\n# These tests are carefully crafted to provide full coverage of as many of the\n# underlying algorithms as possible (including all of the SIMD-accelerated\n# ones.)\n\n# CC: null  SAMP: fullsize  FDCT: islow  ENT: huff\n\t./cjpeg -rgb -dct int -outfile testout_rgb_islow.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_RGB_ISLOW) testout_rgb_islow.jpg\n# CC: null  SAMP: fullsize  IDCT: islow  ENT: huff\n\t./djpeg -dct int -ppm -outfile testout_rgb_islow.ppm testout_rgb_islow.jpg\n\tmd5/md5cmp $(MD5_PPM_RGB_ISLOW) testout_rgb_islow.ppm\n\trm -f testout_rgb_islow.ppm\nif WITH_12BIT\n\trm -f testout_rgb_islow.jpg\nelse\n# CC: RGB->RGB565  SAMP: fullsize  IDCT: islow  ENT: huff\n\t./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_rgb_islow_565.bmp testout_rgb_islow.jpg\n\tmd5/md5cmp $(MD5_BMP_RGB_ISLOW_565) testout_rgb_islow_565.bmp\n\trm -f testout_rgb_islow_565.bmp\n# CC: RGB->RGB565 (dithered)  SAMP: fullsize  IDCT: islow  ENT: huff\n\t./djpeg -dct int -rgb565 -bmp -outfile testout_rgb_islow_565D.bmp testout_rgb_islow.jpg\n\tmd5/md5cmp $(MD5_BMP_RGB_ISLOW_565D) testout_rgb_islow_565D.bmp\n\trm -f testout_rgb_islow_565D.bmp testout_rgb_islow.jpg\nendif\n\n# CC: RGB->YCC  SAMP: fullsize/h2v1  FDCT: ifast  ENT: 2-pass huff\n\t./cjpeg -sample 2x1 -dct fast -opt -outfile testout_422_ifast_opt.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_422_IFAST_OPT) testout_422_ifast_opt.jpg\n# CC: YCC->RGB  SAMP: fullsize/h2v1 fancy  IDCT: ifast  ENT: huff\n\t./djpeg -dct fast -outfile testout_422_ifast.ppm testout_422_ifast_opt.jpg\n\tmd5/md5cmp $(MD5_PPM_422_IFAST) testout_422_ifast.ppm\n\trm -f testout_422_ifast.ppm\n# CC: YCC->RGB  SAMP: h2v1 merged  IDCT: ifast  ENT: huff\n\t./djpeg -dct fast -nosmooth -outfile testout_422m_ifast.ppm testout_422_ifast_opt.jpg\n\tmd5/md5cmp $(MD5_PPM_422M_IFAST) testout_422m_ifast.ppm\n\trm -f testout_422m_ifast.ppm\nif WITH_12BIT\n\trm -f testout_422_ifast_opt.jpg\nelse\n# CC: YCC->RGB565  SAMP: h2v1 merged  IDCT: ifast  ENT: huff\n\t./djpeg -dct int -nosmooth -rgb565 -dither none -bmp -outfile testout_422m_ifast_565.bmp testout_422_ifast_opt.jpg\n\tmd5/md5cmp $(MD5_BMP_422M_IFAST_565) testout_422m_ifast_565.bmp\n\trm -f testout_422m_ifast_565.bmp\n# CC: YCC->RGB565 (dithered)  SAMP: h2v1 merged  IDCT: ifast  ENT: huff\n\t./djpeg -dct int -nosmooth -rgb565 -bmp -outfile testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg\n\tmd5/md5cmp $(MD5_BMP_422M_IFAST_565D) testout_422m_ifast_565D.bmp\n\trm -f testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg\nendif\n\n# CC: RGB->YCC  SAMP: fullsize/h2v2  FDCT: ifast  ENT: prog huff\n\t./cjpeg -sample 2x2 -quality 100 -dct fast -prog -outfile testout_420_q100_ifast_prog.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_420_IFAST_Q100_PROG) testout_420_q100_ifast_prog.jpg\n# CC: YCC->RGB  SAMP: fullsize/h2v2 fancy  IDCT: ifast  ENT: prog huff\n\t./djpeg -dct fast -outfile testout_420_q100_ifast.ppm testout_420_q100_ifast_prog.jpg\n\tmd5/md5cmp $(MD5_PPM_420_Q100_IFAST) testout_420_q100_ifast.ppm\n\trm -f testout_420_q100_ifast.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: ifast  ENT: prog huff\n\t./djpeg -dct fast -nosmooth -outfile testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg\n\tmd5/md5cmp $(MD5_PPM_420M_Q100_IFAST) testout_420m_q100_ifast.ppm\n\trm -f testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg\n\n# CC: RGB->Gray  SAMP: fullsize  FDCT: islow  ENT: huff\n\t./cjpeg -gray -dct int -outfile testout_gray_islow.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_GRAY_ISLOW) testout_gray_islow.jpg\n# CC: Gray->Gray  SAMP: fullsize  IDCT: islow  ENT: huff\n\t./djpeg -dct int -outfile testout_gray_islow.ppm testout_gray_islow.jpg\n\tmd5/md5cmp $(MD5_PPM_GRAY_ISLOW) testout_gray_islow.ppm\n\trm -f testout_gray_islow.ppm\n# CC: Gray->RGB  SAMP: fullsize  IDCT: islow  ENT: huff\n\t./djpeg -dct int -rgb -outfile testout_gray_islow_rgb.ppm testout_gray_islow.jpg\n\tmd5/md5cmp $(MD5_PPM_GRAY_ISLOW_RGB) testout_gray_islow_rgb.ppm\n\trm -f testout_gray_islow_rgb.ppm\nif WITH_12BIT\n\trm -f testout_gray_islow.jpg\nelse\n# CC: Gray->RGB565  SAMP: fullsize  IDCT: islow  ENT: huff\n\t./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_gray_islow_565.bmp testout_gray_islow.jpg\n\tmd5/md5cmp $(MD5_BMP_GRAY_ISLOW_565) testout_gray_islow_565.bmp\n\trm -f testout_gray_islow_565.bmp\n# CC: Gray->RGB565 (dithered)  SAMP: fullsize  IDCT: islow  ENT: huff\n\t./djpeg -dct int -rgb565 -bmp -outfile testout_gray_islow_565D.bmp testout_gray_islow.jpg\n\tmd5/md5cmp $(MD5_BMP_GRAY_ISLOW_565D) testout_gray_islow_565D.bmp\n\trm -f testout_gray_islow_565D.bmp testout_gray_islow.jpg\nendif\n\n# CC: RGB->YCC  SAMP: fullsize smooth/h2v2 smooth  FDCT: islow\n# ENT: 2-pass huff\n\t./cjpeg -sample 2x2 -smooth 1 -dct int -opt -outfile testout_420s_ifast_opt.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_420S_IFAST_OPT) testout_420s_ifast_opt.jpg\n\trm -f testout_420s_ifast_opt.jpg\n\n# The output of the floating point tests is not validated by default, because\n# the output differs depending on the type of floating point math used, and\n# this is only deterministic if the DCT/IDCT are implemented using SIMD\n# instructions on a particular platform.  Pass one of the following on the make\n# command line to validate the floating point tests against one of the expected\n# results:\n#\n# FLOATTEST=sse  validate against the expected results from the libjpeg-turbo\n#                SSE SIMD extensions\n# FLOATTEST=32bit  validate against the expected results from the C code\n#                  when running on a 32-bit FPU (or when SSE is being used for\n#                  floating point math, which is generally the default with\n#                  x86-64 compilers)\n# FLOATTEST=64bit  validate against the exepected results from the C code\n#                  when running on a 64-bit FPU\n\n# CC: RGB->YCC  SAMP: fullsize/int  FDCT: float  ENT: prog huff\n\t./cjpeg -sample 3x2 -dct float -prog -outfile testout_3x2_float_prog.jpg $(srcdir)/testimages/testorig.ppm\n\tif [ \"${FLOATTEST}\" = \"sse\" ]; then \\\n\t\tmd5/md5cmp $(MD5_JPEG_3x2_FLOAT_PROG_SSE) testout_3x2_float_prog.jpg; \\\n\telif [ \"${FLOATTEST}\" = \"32bit\" -o \"${FLOATTEST}\" = \"64bit\" ]; then \\\n\t\tmd5/md5cmp $(MD5_JPEG_3x2_FLOAT_PROG_32BIT) testout_3x2_float_prog.jpg; \\\n\tfi\n# CC: YCC->RGB  SAMP: fullsize/int  IDCT: float  ENT: prog huff\n\t./djpeg -dct float -outfile testout_3x2_float.ppm testout_3x2_float_prog.jpg\n\tif [ \"${FLOATTEST}\" = \"sse\" ]; then \\\n\t\tmd5/md5cmp $(MD5_PPM_3x2_FLOAT_SSE) testout_3x2_float.ppm; \\\n\telif [ \"${FLOATTEST}\" = \"32bit\" ]; then \\\n\t\tmd5/md5cmp $(MD5_PPM_3x2_FLOAT_32BIT) testout_3x2_float.ppm; \\\n\telif [ \"${FLOATTEST}\" = \"64bit\" ]; then \\\n\t\tmd5/md5cmp $(MD5_PPM_3x2_FLOAT_64BIT) testout_3x2_float.ppm; \\\n\tfi\n\trm -f testout_3x2_float.ppm testout_3x2_float_prog.jpg\n\n# CC: RGB->YCC  SAMP: fullsize/int  FDCT: ifast  ENT: prog huff\n\t./cjpeg -sample 3x2 -dct fast -prog -outfile testout_3x2_ifast_prog.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_3x2_IFAST_PROG) testout_3x2_ifast_prog.jpg\n# CC: YCC->RGB  SAMP: fullsize/int  IDCT: ifast  ENT: prog huff\n\t./djpeg -dct fast -outfile testout_3x2_ifast.ppm testout_3x2_ifast_prog.jpg\n\tmd5/md5cmp $(MD5_PPM_3x2_IFAST) testout_3x2_ifast.ppm\n\trm -f testout_3x2_ifast.ppm testout_3x2_ifast_prog.jpg\n\nif WITH_ARITH_ENC\n# CC: YCC->RGB  SAMP: fullsize/h2v2  FDCT: islow  ENT: arith\n\t./cjpeg -dct int -arithmetic -outfile testout_420_islow_ari.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_420_ISLOW_ARI) testout_420_islow_ari.jpg\n\trm -f testout_420_islow_ari.jpg\n\t./jpegtran -arithmetic -outfile testout_420_islow_ari.jpg $(srcdir)/testimages/testimgint.jpg\n\tmd5/md5cmp $(MD5_JPEG_420_ISLOW_ARI) testout_420_islow_ari.jpg\n\trm -f testout_420_islow_ari.jpg\n# CC: YCC->RGB  SAMP: fullsize  FDCT: islow  ENT: prog arith\n\t./cjpeg -sample 1x1 -dct int -prog -arithmetic -outfile testout_444_islow_progari.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_444_ISLOW_PROGARI) testout_444_islow_progari.jpg\n\trm -f testout_444_islow_progari.jpg\nendif\nif WITH_ARITH_DEC\n# CC: RGB->YCC  SAMP: h2v2 merged  IDCT: ifast  ENT: arith\n\t./djpeg -fast -ppm -outfile testout_420m_ifast_ari.ppm $(srcdir)/testimages/testimgari.jpg\n\tmd5/md5cmp $(MD5_PPM_420M_IFAST_ARI) testout_420m_ifast_ari.ppm\n\trm -f testout_420m_ifast_ari.ppm\n\t./jpegtran -outfile testout_420_islow.jpg $(srcdir)/testimages/testimgari.jpg\n\tmd5/md5cmp $(MD5_JPEG_420_ISLOW) testout_420_islow.jpg\n\trm -f testout_420_islow.jpg\nendif\n\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 16x16 islow  ENT: huff\n\t./djpeg -dct int -scale 2/1 -nosmooth -ppm -outfile testout_420m_islow_2_1.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_2_1) testout_420m_islow_2_1.ppm\n\trm -f testout_420m_islow_2_1.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 15x15 islow  ENT: huff\n\t./djpeg -dct int -scale 15/8 -nosmooth -ppm -outfile testout_420m_islow_15_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_15_8) testout_420m_islow_15_8.ppm\n\trm -f testout_420m_islow_15_8.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 13x13 islow  ENT: huff\n\t./djpeg -dct int -scale 13/8 -nosmooth -ppm -outfile testout_420m_islow_13_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_13_8) testout_420m_islow_13_8.ppm\n\trm -f testout_420m_islow_13_8.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 11x11 islow  ENT: huff\n\t./djpeg -dct int -scale 11/8 -nosmooth -ppm -outfile testout_420m_islow_11_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_11_8) testout_420m_islow_11_8.ppm\n\trm -f testout_420m_islow_11_8.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 9x9 islow  ENT: huff\n\t./djpeg -dct int -scale 9/8 -nosmooth -ppm -outfile testout_420m_islow_9_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_9_8) testout_420m_islow_9_8.ppm\n\trm -f testout_420m_islow_9_8.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 7x7 islow/14x14 islow  ENT: huff\n\t./djpeg -dct int -scale 7/8 -nosmooth -ppm -outfile testout_420m_islow_7_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_7_8) testout_420m_islow_7_8.ppm\n\trm -f testout_420m_islow_7_8.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 6x6 islow/12x12 islow  ENT: huff\n\t./djpeg -dct int -scale 3/4 -nosmooth -ppm -outfile testout_420m_islow_3_4.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_3_4) testout_420m_islow_3_4.ppm\n\trm -f testout_420m_islow_3_4.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 5x5 islow/10x10 islow  ENT: huff\n\t./djpeg -dct int -scale 5/8 -nosmooth -ppm -outfile testout_420m_islow_5_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_5_8) testout_420m_islow_5_8.ppm\n\trm -f testout_420m_islow_5_8.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 4x4 islow/8x8 islow  ENT: huff\n\t./djpeg -dct int -scale 1/2 -nosmooth -ppm -outfile testout_420m_islow_1_2.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_1_2) testout_420m_islow_1_2.ppm\n\trm -f testout_420m_islow_1_2.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 3x3 islow/6x6 islow  ENT: huff\n\t./djpeg -dct int -scale 3/8 -nosmooth -ppm -outfile testout_420m_islow_3_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_3_8) testout_420m_islow_3_8.ppm\n\trm -f testout_420m_islow_3_8.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 2x2 islow/4x4 islow  ENT: huff\n\t./djpeg -dct int -scale 1/4 -nosmooth -ppm -outfile testout_420m_islow_1_4.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_1_4) testout_420m_islow_1_4.ppm\n\trm -f testout_420m_islow_1_4.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 1x1 islow/2x2 islow  ENT: huff\n\t./djpeg -dct int -scale 1/8 -nosmooth -ppm -outfile testout_420m_islow_1_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_1_8) testout_420m_islow_1_8.ppm\n\trm -f testout_420m_islow_1_8.ppm\nif WITH_12BIT\nelse\n# CC: YCC->RGB (dithered)  SAMP: h2v2 fancy  IDCT: islow  ENT: huff\n\t./djpeg -dct int -colors 256 -bmp -outfile testout_420_islow_256.bmp $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_BMP_420_ISLOW_256) testout_420_islow_256.bmp\n\trm -f testout_420_islow_256.bmp\n# CC: YCC->RGB565  SAMP: h2v2 fancy  IDCT: islow  ENT: huff\n\t./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_420_islow_565.bmp $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_BMP_420_ISLOW_565) testout_420_islow_565.bmp\n\trm -f testout_420_islow_565.bmp\n# CC: YCC->RGB565 (dithered)  SAMP: h2v2 fancy  IDCT: islow  ENT: huff\n\t./djpeg -dct int -rgb565 -bmp -outfile testout_420_islow_565D.bmp $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_BMP_420_ISLOW_565D) testout_420_islow_565D.bmp\n\trm -f testout_420_islow_565D.bmp\n# CC: YCC->RGB565  SAMP: h2v2 merged  IDCT: islow  ENT: huff\n\t./djpeg -dct int -nosmooth -rgb565 -dither none -bmp -outfile testout_420m_islow_565.bmp $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_BMP_420M_ISLOW_565) testout_420m_islow_565.bmp\n\trm -f testout_420m_islow_565.bmp\n# CC: YCC->RGB565 (dithered)  SAMP: h2v2 merged  IDCT: islow  ENT: huff\n\t./djpeg -dct int -nosmooth -rgb565 -bmp -outfile testout_420m_islow_565D.bmp $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_BMP_420M_ISLOW_565D) testout_420m_islow_565D.bmp\n\trm -f testout_420m_islow_565D.bmp\nendif\n\n# Partial decode tests.  These tests are designed to cover all of the possible\n# code paths in jpeg_skip_scanlines().\n\n# Context rows: Yes  Intra-iMCU row: Yes  iMCU row prefetch: No   ENT: huff\n\t./djpeg -dct int -skip 15,31 -ppm -outfile testout_420_islow_skip15,31.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420_ISLOW_SKIP15_31) testout_420_islow_skip15,31.ppm\n\trm -f testout_420_islow_skip15,31.ppm\n# Context rows: Yes  Intra-iMCU row: No   iMCU row prefetch: Yes  ENT: arith\nif WITH_ARITH_DEC\n\t./djpeg -dct int -skip 16,139 -ppm -outfile testout_420_islow_ari_skip16,139.ppm $(srcdir)/testimages/testimgari.jpg\n\tmd5/md5cmp $(MD5_PPM_420_ISLOW_ARI_SKIP16_139) testout_420_islow_ari_skip16,139.ppm\n\trm -f testout_420_islow_ari_skip16,139.ppm\nendif\n# Context rows: Yes  Intra-iMCU row: No   iMCU row prefetch: No   ENT: prog huff\n\t./cjpeg -dct int -prog -outfile testout_420_islow_prog.jpg $(srcdir)/testimages/testorig.ppm\n\t./djpeg -dct int -crop 62x62+71+71 -ppm -outfile testout_420_islow_prog_crop62x62,71,71.ppm testout_420_islow_prog.jpg\n\tmd5/md5cmp $(MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71) testout_420_islow_prog_crop62x62,71,71.ppm\n\trm -f testout_420_islow_prog_crop62x62,71,71.ppm testout_420_islow_prog.jpg\n# Context rows: Yes  Intra-iMCU row: No   iMCU row prefetch: No   ENT: arith\nif WITH_ARITH_DEC\n\t./djpeg -dct int -crop 53x53+4+4 -ppm -outfile testout_420_islow_ari_crop53x53,4,4.ppm $(srcdir)/testimages/testimgari.jpg\n\tmd5/md5cmp $(MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4) testout_420_islow_ari_crop53x53,4,4.ppm\n\trm -f testout_420_islow_ari_crop53x53,4,4.ppm\nendif\n# Context rows: No   Intra-iMCU row: Yes  ENT: huff\n\t./cjpeg -dct int -sample 1x1 -outfile testout_444_islow.jpg $(srcdir)/testimages/testorig.ppm\n\t./djpeg -dct int -skip 1,6 -ppm -outfile testout_444_islow_skip1,6.ppm testout_444_islow.jpg\n\tmd5/md5cmp $(MD5_PPM_444_ISLOW_SKIP1_6) testout_444_islow_skip1,6.ppm\n\trm -f testout_444_islow_skip1,6.ppm testout_444_islow.jpg\n# Context rows: No   Intra-iMCU row: No   ENT: prog huff\n\t./cjpeg -dct int -prog -sample 1x1 -outfile testout_444_islow_prog.jpg $(srcdir)/testimages/testorig.ppm\n\t./djpeg -dct int -crop 98x98+13+13 -ppm -outfile testout_444_islow_prog_crop98x98,13,13.ppm testout_444_islow_prog.jpg\n\tmd5/md5cmp $(MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13) testout_444_islow_prog_crop98x98,13,13.ppm\n\trm -f testout_444_islow_prog_crop98x98,13,13.ppm testout_444_islow_prog.jpg\n# Context rows: No   Intra-iMCU row: No   ENT: arith\nif WITH_ARITH_ENC\n\t./cjpeg -dct int -arithmetic -sample 1x1 -outfile testout_444_islow_ari.jpg $(srcdir)/testimages/testorig.ppm\nif WITH_ARITH_DEC\n\t./djpeg -dct int -crop 37x37+0+0 -ppm -outfile testout_444_islow_ari_crop37x37,0,0.ppm testout_444_islow_ari.jpg\n\tmd5/md5cmp $(MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0) testout_444_islow_ari_crop37x37,0,0.ppm\n\trm -f testout_444_islow_ari_crop37x37,0,0.ppm\nendif\n\trm -f testout_444_islow_ari.jpg\nendif\n\n\t./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testout_crop.jpg $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_JPEG_CROP) testout_crop.jpg\n\trm -f testout_crop.jpg\n\techo GREAT SUCCESS!\n\n\ntestclean:\n\trm -f testout*\n\trm -f *_GRAY_*.bmp\n\trm -f *_GRAY_*.png\n\trm -f *_GRAY_*.ppm\n\trm -f *_GRAY_*.jpg\n\trm -f *_GRAY.yuv\n\trm -f *_420_*.bmp\n\trm -f *_420_*.png\n\trm -f *_420_*.ppm\n\trm -f *_420_*.jpg\n\trm -f *_420.yuv\n\trm -f *_422_*.bmp\n\trm -f *_422_*.png\n\trm -f *_422_*.ppm\n\trm -f *_422_*.jpg\n\trm -f *_422.yuv\n\trm -f *_444_*.bmp\n\trm -f *_444_*.png\n\trm -f *_444_*.ppm\n\trm -f *_444_*.jpg\n\trm -f *_444.yuv\n\trm -f *_440_*.bmp\n\trm -f *_440_*.png\n\trm -f *_440_*.ppm\n\trm -f *_440_*.jpg\n\trm -f *_440.yuv\n\trm -f *_411_*.bmp\n\trm -f *_411_*.png\n\trm -f *_411_*.ppm\n\trm -f *_411_*.jpg\n\trm -f *_411.yuv\n\n\ntjtest:\n\tsh ./tjbenchtest\n\tsh ./tjbenchtest -alloc\n\tsh ./tjbenchtest -yuv\n\tsh ./tjbenchtest -yuv -alloc\nif WITH_JAVA\n\tsh ./tjbenchtest.java\n\tsh ./tjbenchtest.java -yuv\nendif\n\n\npkgscripts/libjpeg-turbo.spec: pkgscripts/libjpeg-turbo.spec.tmpl\n\tcat pkgscripts/libjpeg-turbo.spec.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__bindir}@$(bindir)@g | sed s@%{__datadir}@$(datadir)@g | \\\n\t\tsed s@%{__docdir}@$(docdir)@g | sed s@%{__includedir}@$(includedir)@g | \\\n\t\tsed s@%{__libdir}@$(libdir)@g | sed s@%{__mandir}@$(mandir)@g \\\n\t\t> pkgscripts/libjpeg-turbo.spec\n\nrpm: all pkgscripts/libjpeg-turbo.spec\n\tTMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \\\n\tmkdir -p $$TMPDIR/RPMS; \\\n\tln -fs `pwd` $$TMPDIR/BUILD; \\\n\trm -f ${PKGNAME}-${VERSION}.${RPMARCH}.rpm; \\\n\trpmbuild -bb --define \"_blddir $$TMPDIR/buildroot\"  \\\n\t\t--define \"_topdir $$TMPDIR\" \\\n\t\t--target ${RPMARCH} pkgscripts/libjpeg-turbo.spec; \\\n\tcp $$TMPDIR/RPMS/${RPMARCH}/${PKGNAME}-${VERSION}-${BUILD}.${RPMARCH}.rpm \\\n\t\t${PKGNAME}-${VERSION}.${RPMARCH}.rpm; \\\n\trm -rf $$TMPDIR\n\nsrpm: dist-gzip pkgscripts/libjpeg-turbo.spec\n\tTMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \\\n\tmkdir -p $$TMPDIR/RPMS; \\\n\tmkdir -p $$TMPDIR/SRPMS; \\\n\tmkdir -p $$TMPDIR/BUILD; \\\n\tmkdir -p $$TMPDIR/SOURCES; \\\n\tmkdir -p $$TMPDIR/SPECS; \\\n\trm -f ${PKGNAME}-${VERSION}.src.rpm; \\\n\tcp ${PACKAGE_NAME}-${VERSION}.tar.gz $$TMPDIR/SOURCES; \\\n\tcat pkgscripts/libjpeg-turbo.spec | sed s/%{_blddir}/%{_tmppath}/g \\\n\t\t| sed s/#--\\>//g \\\n\t\t> $$TMPDIR/SPECS/libjpeg-turbo.spec; \\\n\trpmbuild -bs --define \"_topdir $$TMPDIR\" $$TMPDIR/SPECS/libjpeg-turbo.spec; \\\n\tcp $$TMPDIR/SRPMS/${PKGNAME}-${VERSION}-${BUILD}.src.rpm \\\n\t\t${PKGNAME}-${VERSION}.src.rpm; \\\n\trm -rf $$TMPDIR\n\npkgscripts/makedpkg: pkgscripts/makedpkg.tmpl\n\tcat pkgscripts/makedpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__docdir}@$(docdir)@g | sed s@%{__libdir}@$(libdir)@g \\\n\t\t> pkgscripts/makedpkg\n\ndeb: all pkgscripts/makedpkg\n\tsh pkgscripts/makedpkg\n\npkgscripts/uninstall: pkgscripts/uninstall.tmpl\n\tcat pkgscripts/uninstall.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__bindir}@$(bindir)@g | sed s@%{__datadir}@$(datadir)@g | \\\n\t\tsed s@%{__includedir}@$(includedir)@g | sed s@%{__libdir}@$(libdir)@g | \\\n\t\tsed s@%{__mandir}@$(mandir)@g > pkgscripts/uninstall\n\npkgscripts/makemacpkg: pkgscripts/makemacpkg.tmpl\n\tcat pkgscripts/makemacpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__bindir}@$(bindir)@g | sed s@%{__docdir}@$(docdir)@g | \\\n\t\tsed s@%{__libdir}@$(libdir)@g > pkgscripts/makemacpkg\n\nif X86_64\n\nudmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n\tsh pkgscripts/makemacpkg -build32 ${BUILDDIR32}\n\niosdmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n\tsh pkgscripts/makemacpkg -build32 ${BUILDDIR32} -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S} -buildarmv8 ${BUILDDIRARMV8} -lipo \"${LIPO}\"\n\nelse\n\niosdmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n\tsh pkgscripts/makemacpkg -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S} -buildarmv8 ${BUILDDIRARMV8} -lipo \"${LIPO}\"\n\nendif\n\ndmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n\tsh pkgscripts/makemacpkg\n\npkgscripts/makecygwinpkg: pkgscripts/makecygwinpkg.tmpl\n\tcat pkgscripts/makecygwinpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__docdir}@$(docdir)@g | sed s@%{__libdir}@$(libdir)@g \\\n\t\t> pkgscripts/makecygwinpkg\n\ncygwinpkg: all pkgscripts/makecygwinpkg\n\tsh pkgscripts/makecygwinpkg\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/Makefile.in",
    "content": "# Makefile.in generated by automake 1.15 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2014 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\n\n\n\nVPATH = @srcdir@\nam__is_gnu_make = { \\\n  if test -z '$(MAKELEVEL)'; then \\\n    false; \\\n  elif test -n '$(MAKE_HOST)'; then \\\n    true; \\\n  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \\\n    true; \\\n  else \\\n    false; \\\n  fi; \\\n}\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nbuild_triplet = @build@\nhost_triplet = @host@\n@WITH_TURBOJPEG_TRUE@am__append_1 = libturbojpeg.la\n@WITH_TURBOJPEG_TRUE@am__append_2 = turbojpeg.h\n@WITH_ARITH_TRUE@am__append_3 = jaricom.c\n@WITH_ARITH_ENC_TRUE@am__append_4 = jcarith.c\n@WITH_ARITH_DEC_TRUE@am__append_5 = jdarith.c\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@am__append_6 = turbojpeg-jni.c\n@VERSION_SCRIPT_TRUE@@WITH_TURBOJPEG_TRUE@am__append_7 = $(VERSION_SCRIPT_FLAG)$(srcdir)/$(TJMAPFILE)\n@VERSION_SCRIPT_TRUE@am__append_8 = $(VERSION_SCRIPT_FLAG)libjpeg.map\n@WITH_SIMD_TRUE@am__append_9 = simd\n@WITH_SIMD_FALSE@am__append_10 = jsimd_none.c\nbin_PROGRAMS = cjpeg$(EXEEXT) djpeg$(EXEEXT) jpegtran$(EXEEXT) \\\n\trdjpgcom$(EXEEXT) wrjpgcom$(EXEEXT) $(am__EXEEXT_1)\nnoinst_PROGRAMS = jcstest$(EXEEXT) $(am__EXEEXT_2)\n@WITH_TURBOJPEG_TRUE@am__append_11 = tjbench\n@WITH_TURBOJPEG_TRUE@am__append_12 = tjunittest\n@WITH_12BIT_FALSE@am__append_13 = rdbmp.c rdtarga.c\n@WITH_12BIT_FALSE@am__append_14 = -DBMP_SUPPORTED -DTARGA_SUPPORTED\n@WITH_12BIT_FALSE@am__append_15 = wrbmp.c wrtarga.c\n@WITH_12BIT_FALSE@am__append_16 = -DBMP_SUPPORTED -DTARGA_SUPPORTED\nsubdir = .\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \\\n\t$(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nDIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \\\n\t$(am__configure_deps) $(dist_doc_DATA) $(dist_example_DATA) \\\n\t$(am__include_HEADERS_DIST) $(am__DIST_COMMON)\nam__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \\\n configure.lineno config.status.lineno\nmkinstalldirs = $(install_sh) -d\nCONFIG_HEADER = config.h jconfig.h jconfigint.h\nCONFIG_CLEAN_FILES = pkgscripts/libjpeg-turbo.spec.tmpl \\\n\tpkgscripts/makecygwinpkg.tmpl pkgscripts/makedpkg.tmpl \\\n\tpkgscripts/makemacpkg.tmpl pkgscripts/uninstall.tmpl \\\n\tpkgscripts/libjpeg.pc pkgscripts/libturbojpeg.pc tjbenchtest \\\n\ttjbenchtest.java tjexampletest libjpeg.map\nCONFIG_CLEAN_VPATH_FILES =\nam__vpath_adj_setup = srcdirstrip=`echo \"$(srcdir)\" | sed 's|.|.|g'`;\nam__vpath_adj = case $$p in \\\n    $(srcdir)/*) f=`echo \"$$p\" | sed \"s|^$$srcdirstrip/||\"`;; \\\n    *) f=$$p;; \\\n  esac;\nam__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;\nam__install_max = 40\nam__nobase_strip_setup = \\\n  srcdirstrip=`echo \"$(srcdir)\" | sed 's/[].[^$$\\\\*|]/\\\\\\\\&/g'`\nam__nobase_strip = \\\n  for p in $$list; do echo \"$$p\"; done | sed -e \"s|$$srcdirstrip/||\"\nam__nobase_list = $(am__nobase_strip_setup); \\\n  for p in $$list; do echo \"$$p $$p\"; done | \\\n  sed \"s| $$srcdirstrip/| |;\"' / .*\\//!s/ .*/ ./; s,\\( .*\\)/[^/]*$$,\\1,' | \\\n  $(AWK) 'BEGIN { files[\".\"] = \"\" } { files[$$2] = files[$$2] \" \" $$1; \\\n    if (++n[$$2] == $(am__install_max)) \\\n      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = \"\" } } \\\n    END { for (dir in files) print dir, files[dir] }'\nam__base_list = \\\n  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\\n/ /g' | \\\n  sed '$$!N;$$!N;$$!N;$$!N;s/\\n/ /g'\nam__uninstall_files_from_dir = { \\\n  test -z \"$$files\" \\\n    || { test ! -d \"$$dir\" && test ! -f \"$$dir\" && test ! -r \"$$dir\"; } \\\n    || { echo \" ( cd '$$dir' && rm -f\" $$files \")\"; \\\n         $(am__cd) \"$$dir\" && rm -f $$files; }; \\\n  }\nam__installdirs = \"$(DESTDIR)$(libdir)\" \"$(DESTDIR)$(bindir)\" \\\n\t\"$(DESTDIR)$(man1dir)\" \"$(DESTDIR)$(docdir)\" \\\n\t\"$(DESTDIR)$(exampledir)\" \"$(DESTDIR)$(pkgconfigdir)\" \\\n\t\"$(DESTDIR)$(includedir)\" \"$(DESTDIR)$(includedir)\"\nLTLIBRARIES = $(lib_LTLIBRARIES)\n@WITH_SIMD_TRUE@libjpeg_la_DEPENDENCIES = simd/libsimd.la\nam__libjpeg_la_SOURCES_DIST = jchuff.h jdct.h jdhuff.h jerror.h \\\n\tjinclude.h jmemsys.h jmorecfg.h jpegint.h jpeglib.h jversion.h \\\n\tjsimd.h jsimddct.h jpegcomp.h jpeg_nbits_table.h jcapimin.c \\\n\tjcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c jcinit.c \\\n\tjcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c \\\n\tjcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \\\n\tjdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \\\n\tjdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \\\n\tjdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \\\n\tjfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c \\\n\tjquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c jaricom.c \\\n\tjcarith.c jdarith.c jsimd_none.c\nam__objects_1 =\n@WITH_ARITH_TRUE@am__objects_2 = jaricom.lo\n@WITH_ARITH_ENC_TRUE@am__objects_3 = jcarith.lo\n@WITH_ARITH_DEC_TRUE@am__objects_4 = jdarith.lo\n@WITH_SIMD_FALSE@am__objects_5 = jsimd_none.lo\nam_libjpeg_la_OBJECTS = $(am__objects_1) jcapimin.lo jcapistd.lo \\\n\tjccoefct.lo jccolor.lo jcdctmgr.lo jchuff.lo jcinit.lo \\\n\tjcmainct.lo jcmarker.lo jcmaster.lo jcomapi.lo jcparam.lo \\\n\tjcphuff.lo jcprepct.lo jcsample.lo jctrans.lo jdapimin.lo \\\n\tjdapistd.lo jdatadst.lo jdatasrc.lo jdcoefct.lo jdcolor.lo \\\n\tjddctmgr.lo jdhuff.lo jdinput.lo jdmainct.lo jdmarker.lo \\\n\tjdmaster.lo jdmerge.lo jdphuff.lo jdpostct.lo jdsample.lo \\\n\tjdtrans.lo jerror.lo jfdctflt.lo jfdctfst.lo jfdctint.lo \\\n\tjidctflt.lo jidctfst.lo jidctint.lo jidctred.lo jquant1.lo \\\n\tjquant2.lo jutils.lo jmemmgr.lo jmemnobs.lo $(am__objects_2) \\\n\t$(am__objects_3) $(am__objects_4) $(am__objects_5)\nlibjpeg_la_OBJECTS = $(am_libjpeg_la_OBJECTS)\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nam__v_lt_1 = \nlibjpeg_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n\t$(libjpeg_la_LDFLAGS) $(LDFLAGS) -o $@\n@WITH_SIMD_TRUE@libturbojpeg_la_DEPENDENCIES = simd/libsimd.la\nam__libturbojpeg_la_SOURCES_DIST = jchuff.h jdct.h jdhuff.h jerror.h \\\n\tjinclude.h jmemsys.h jmorecfg.h jpegint.h jpeglib.h jversion.h \\\n\tjsimd.h jsimddct.h jpegcomp.h jpeg_nbits_table.h jcapimin.c \\\n\tjcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c jcinit.c \\\n\tjcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c \\\n\tjcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \\\n\tjdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \\\n\tjdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \\\n\tjdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \\\n\tjfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c \\\n\tjquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c jaricom.c \\\n\tjcarith.c jdarith.c jsimd_none.c turbojpeg.c turbojpeg.h \\\n\ttransupp.c transupp.h jdatadst-tj.c jdatasrc-tj.c \\\n\tturbojpeg-jni.c turbojpeg-mapfile turbojpeg-mapfile.jni\n@WITH_ARITH_TRUE@am__objects_6 = libturbojpeg_la-jaricom.lo\n@WITH_ARITH_ENC_TRUE@am__objects_7 = libturbojpeg_la-jcarith.lo\n@WITH_ARITH_DEC_TRUE@am__objects_8 = libturbojpeg_la-jdarith.lo\n@WITH_SIMD_FALSE@am__objects_9 = libturbojpeg_la-jsimd_none.lo\nam__objects_10 = $(am__objects_1) libturbojpeg_la-jcapimin.lo \\\n\tlibturbojpeg_la-jcapistd.lo libturbojpeg_la-jccoefct.lo \\\n\tlibturbojpeg_la-jccolor.lo libturbojpeg_la-jcdctmgr.lo \\\n\tlibturbojpeg_la-jchuff.lo libturbojpeg_la-jcinit.lo \\\n\tlibturbojpeg_la-jcmainct.lo libturbojpeg_la-jcmarker.lo \\\n\tlibturbojpeg_la-jcmaster.lo libturbojpeg_la-jcomapi.lo \\\n\tlibturbojpeg_la-jcparam.lo libturbojpeg_la-jcphuff.lo \\\n\tlibturbojpeg_la-jcprepct.lo libturbojpeg_la-jcsample.lo \\\n\tlibturbojpeg_la-jctrans.lo libturbojpeg_la-jdapimin.lo \\\n\tlibturbojpeg_la-jdapistd.lo libturbojpeg_la-jdatadst.lo \\\n\tlibturbojpeg_la-jdatasrc.lo libturbojpeg_la-jdcoefct.lo \\\n\tlibturbojpeg_la-jdcolor.lo libturbojpeg_la-jddctmgr.lo \\\n\tlibturbojpeg_la-jdhuff.lo libturbojpeg_la-jdinput.lo \\\n\tlibturbojpeg_la-jdmainct.lo libturbojpeg_la-jdmarker.lo \\\n\tlibturbojpeg_la-jdmaster.lo libturbojpeg_la-jdmerge.lo \\\n\tlibturbojpeg_la-jdphuff.lo libturbojpeg_la-jdpostct.lo \\\n\tlibturbojpeg_la-jdsample.lo libturbojpeg_la-jdtrans.lo \\\n\tlibturbojpeg_la-jerror.lo libturbojpeg_la-jfdctflt.lo \\\n\tlibturbojpeg_la-jfdctfst.lo libturbojpeg_la-jfdctint.lo \\\n\tlibturbojpeg_la-jidctflt.lo libturbojpeg_la-jidctfst.lo \\\n\tlibturbojpeg_la-jidctint.lo libturbojpeg_la-jidctred.lo \\\n\tlibturbojpeg_la-jquant1.lo libturbojpeg_la-jquant2.lo \\\n\tlibturbojpeg_la-jutils.lo libturbojpeg_la-jmemmgr.lo \\\n\tlibturbojpeg_la-jmemnobs.lo $(am__objects_6) $(am__objects_7) \\\n\t$(am__objects_8) $(am__objects_9)\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@am__objects_11 = libturbojpeg_la-turbojpeg-jni.lo\n@WITH_TURBOJPEG_TRUE@am_libturbojpeg_la_OBJECTS = $(am__objects_10) \\\n@WITH_TURBOJPEG_TRUE@\tlibturbojpeg_la-turbojpeg.lo \\\n@WITH_TURBOJPEG_TRUE@\tlibturbojpeg_la-transupp.lo \\\n@WITH_TURBOJPEG_TRUE@\tlibturbojpeg_la-jdatadst-tj.lo \\\n@WITH_TURBOJPEG_TRUE@\tlibturbojpeg_la-jdatasrc-tj.lo \\\n@WITH_TURBOJPEG_TRUE@\t$(am__objects_11) $(am__objects_1)\nlibturbojpeg_la_OBJECTS = $(am_libturbojpeg_la_OBJECTS)\nlibturbojpeg_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \\\n\t$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \\\n\t$(libturbojpeg_la_CFLAGS) $(CFLAGS) $(libturbojpeg_la_LDFLAGS) \\\n\t$(LDFLAGS) -o $@\n@WITH_TURBOJPEG_TRUE@am_libturbojpeg_la_rpath = -rpath $(libdir)\n@WITH_TURBOJPEG_TRUE@am__EXEEXT_1 = tjbench$(EXEEXT)\n@WITH_TURBOJPEG_TRUE@am__EXEEXT_2 = tjunittest$(EXEEXT)\nPROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)\nam__cjpeg_SOURCES_DIST = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdgif.c \\\n\trdppm.c rdswitch.c rdbmp.c rdtarga.c\n@WITH_12BIT_FALSE@am__objects_12 = cjpeg-rdbmp.$(OBJEXT) \\\n@WITH_12BIT_FALSE@\tcjpeg-rdtarga.$(OBJEXT)\nam_cjpeg_OBJECTS = cjpeg-cdjpeg.$(OBJEXT) cjpeg-cjpeg.$(OBJEXT) \\\n\tcjpeg-rdgif.$(OBJEXT) cjpeg-rdppm.$(OBJEXT) \\\n\tcjpeg-rdswitch.$(OBJEXT) $(am__objects_12)\ncjpeg_OBJECTS = $(am_cjpeg_OBJECTS)\ncjpeg_DEPENDENCIES = libjpeg.la\ncjpeg_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(cjpeg_CFLAGS) $(CFLAGS) \\\n\t$(AM_LDFLAGS) $(LDFLAGS) -o $@\nam__djpeg_SOURCES_DIST = cdjpeg.h cderror.h cdjpeg.c djpeg.c \\\n\trdcolmap.c rdswitch.c wrgif.c wrppm.c wrbmp.c wrtarga.c\n@WITH_12BIT_FALSE@am__objects_13 = djpeg-wrbmp.$(OBJEXT) \\\n@WITH_12BIT_FALSE@\tdjpeg-wrtarga.$(OBJEXT)\nam_djpeg_OBJECTS = djpeg-cdjpeg.$(OBJEXT) djpeg-djpeg.$(OBJEXT) \\\n\tdjpeg-rdcolmap.$(OBJEXT) djpeg-rdswitch.$(OBJEXT) \\\n\tdjpeg-wrgif.$(OBJEXT) djpeg-wrppm.$(OBJEXT) $(am__objects_13)\ndjpeg_OBJECTS = $(am_djpeg_OBJECTS)\ndjpeg_DEPENDENCIES = libjpeg.la\ndjpeg_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(djpeg_CFLAGS) $(CFLAGS) \\\n\t$(AM_LDFLAGS) $(LDFLAGS) -o $@\nam_jcstest_OBJECTS = jcstest.$(OBJEXT)\njcstest_OBJECTS = $(am_jcstest_OBJECTS)\njcstest_DEPENDENCIES = libjpeg.la\nam_jpegtran_OBJECTS = jpegtran.$(OBJEXT) rdswitch.$(OBJEXT) \\\n\tcdjpeg.$(OBJEXT) transupp.$(OBJEXT)\njpegtran_OBJECTS = $(am_jpegtran_OBJECTS)\njpegtran_DEPENDENCIES = libjpeg.la\nam_rdjpgcom_OBJECTS = rdjpgcom.$(OBJEXT)\nrdjpgcom_OBJECTS = $(am_rdjpgcom_OBJECTS)\nrdjpgcom_DEPENDENCIES = libjpeg.la\nam__tjbench_SOURCES_DIST = tjbench.c bmp.h bmp.c tjutil.h tjutil.c \\\n\trdbmp.c rdppm.c wrbmp.c wrppm.c\n@WITH_TURBOJPEG_TRUE@am_tjbench_OBJECTS = tjbench-tjbench.$(OBJEXT) \\\n@WITH_TURBOJPEG_TRUE@\ttjbench-bmp.$(OBJEXT) \\\n@WITH_TURBOJPEG_TRUE@\ttjbench-tjutil.$(OBJEXT) \\\n@WITH_TURBOJPEG_TRUE@\ttjbench-rdbmp.$(OBJEXT) \\\n@WITH_TURBOJPEG_TRUE@\ttjbench-rdppm.$(OBJEXT) \\\n@WITH_TURBOJPEG_TRUE@\ttjbench-wrbmp.$(OBJEXT) \\\n@WITH_TURBOJPEG_TRUE@\ttjbench-wrppm.$(OBJEXT)\ntjbench_OBJECTS = $(am_tjbench_OBJECTS)\n@WITH_TURBOJPEG_TRUE@tjbench_DEPENDENCIES = libturbojpeg.la libjpeg.la\ntjbench_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(tjbench_CFLAGS) \\\n\t$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@\nam__tjunittest_SOURCES_DIST = tjunittest.c tjutil.h tjutil.c\n@WITH_TURBOJPEG_TRUE@am_tjunittest_OBJECTS = tjunittest.$(OBJEXT) \\\n@WITH_TURBOJPEG_TRUE@\ttjutil.$(OBJEXT)\ntjunittest_OBJECTS = $(am_tjunittest_OBJECTS)\n@WITH_TURBOJPEG_TRUE@tjunittest_DEPENDENCIES = libturbojpeg.la\nam_wrjpgcom_OBJECTS = wrjpgcom.$(OBJEXT)\nwrjpgcom_OBJECTS = $(am_wrjpgcom_OBJECTS)\nwrjpgcom_DEPENDENCIES = libjpeg.la\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nDEFAULT_INCLUDES = -I.@am__isrc@\ndepcomp = $(SHELL) $(top_srcdir)/depcomp\nam__depfiles_maybe = depfiles\nam__mv = mv -f\nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nLTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \\\n\t$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \\\n\t$(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC      \" $@;\nam__v_CC_1 = \nCCLD = $(CC)\nLINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n\t$(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD    \" $@;\nam__v_CCLD_1 = \nSOURCES = $(libjpeg_la_SOURCES) $(libturbojpeg_la_SOURCES) \\\n\t$(cjpeg_SOURCES) $(djpeg_SOURCES) $(jcstest_SOURCES) \\\n\t$(jpegtran_SOURCES) $(rdjpgcom_SOURCES) $(tjbench_SOURCES) \\\n\t$(tjunittest_SOURCES) $(wrjpgcom_SOURCES)\nDIST_SOURCES = $(am__libjpeg_la_SOURCES_DIST) \\\n\t$(am__libturbojpeg_la_SOURCES_DIST) $(am__cjpeg_SOURCES_DIST) \\\n\t$(am__djpeg_SOURCES_DIST) $(jcstest_SOURCES) \\\n\t$(jpegtran_SOURCES) $(rdjpgcom_SOURCES) \\\n\t$(am__tjbench_SOURCES_DIST) $(am__tjunittest_SOURCES_DIST) \\\n\t$(wrjpgcom_SOURCES)\nRECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \\\n\tctags-recursive dvi-recursive html-recursive info-recursive \\\n\tinstall-data-recursive install-dvi-recursive \\\n\tinstall-exec-recursive install-html-recursive \\\n\tinstall-info-recursive install-pdf-recursive \\\n\tinstall-ps-recursive install-recursive installcheck-recursive \\\n\tinstalldirs-recursive pdf-recursive ps-recursive \\\n\ttags-recursive uninstall-recursive\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nman1dir = $(mandir)/man1\nNROFF = nroff\nMANS = $(dist_man1_MANS)\nDATA = $(dist_doc_DATA) $(dist_example_DATA) $(pkgconfig_DATA)\nam__include_HEADERS_DIST = jerror.h jmorecfg.h jpeglib.h turbojpeg.h\nHEADERS = $(include_HEADERS) $(nodist_include_HEADERS)\nRECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive\t\\\n  distclean-recursive maintainer-clean-recursive\nam__recursive_targets = \\\n  $(RECURSIVE_TARGETS) \\\n  $(RECURSIVE_CLEAN_TARGETS) \\\n  $(am__extra_recursive_targets)\nAM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \\\n\tcscope distdir dist dist-all distcheck\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \\\n\t$(LISP)config.h.in jconfig.h.in jconfigint.h.in\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nCSCOPE = cscope\nDIST_SUBDIRS = java simd md5\nam__DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.in \\\n\t$(srcdir)/config.h.in $(srcdir)/jconfig.h.in \\\n\t$(srcdir)/jconfigint.h.in $(srcdir)/libjpeg.map.in \\\n\t$(srcdir)/tjbenchtest.in $(srcdir)/tjbenchtest.java.in \\\n\t$(srcdir)/tjexampletest.in \\\n\t$(top_srcdir)/release/libjpeg-turbo.spec.in \\\n\t$(top_srcdir)/release/libjpeg.pc.in \\\n\t$(top_srcdir)/release/libturbojpeg.pc.in \\\n\t$(top_srcdir)/release/makecygwinpkg.in \\\n\t$(top_srcdir)/release/makedpkg.in \\\n\t$(top_srcdir)/release/makemacpkg.in \\\n\t$(top_srcdir)/release/uninstall.in ar-lib compile config.guess \\\n\tconfig.sub depcomp install-sh ltmain.sh missing\nDISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)\ndistdir = $(PACKAGE)-$(VERSION)\ntop_distdir = $(distdir)\nam__remove_distdir = \\\n  if test -d \"$(distdir)\"; then \\\n    find \"$(distdir)\" -type d ! -perm -200 -exec chmod u+w {} ';' \\\n      && rm -rf \"$(distdir)\" \\\n      || { sleep 5 && rm -rf \"$(distdir)\"; }; \\\n  else :; fi\nam__post_remove_distdir = $(am__remove_distdir)\nam__relativize = \\\n  dir0=`pwd`; \\\n  sed_first='s,^\\([^/]*\\)/.*$$,\\1,'; \\\n  sed_rest='s,^[^/]*/*,,'; \\\n  sed_last='s,^.*/\\([^/]*\\)$$,\\1,'; \\\n  sed_butlast='s,/*[^/]*$$,,'; \\\n  while test -n \"$$dir1\"; do \\\n    first=`echo \"$$dir1\" | sed -e \"$$sed_first\"`; \\\n    if test \"$$first\" != \".\"; then \\\n      if test \"$$first\" = \"..\"; then \\\n        dir2=`echo \"$$dir0\" | sed -e \"$$sed_last\"`/\"$$dir2\"; \\\n        dir0=`echo \"$$dir0\" | sed -e \"$$sed_butlast\"`; \\\n      else \\\n        first2=`echo \"$$dir2\" | sed -e \"$$sed_first\"`; \\\n        if test \"$$first2\" = \"$$first\"; then \\\n          dir2=`echo \"$$dir2\" | sed -e \"$$sed_rest\"`; \\\n        else \\\n          dir2=\"../$$dir2\"; \\\n        fi; \\\n        dir0=\"$$dir0\"/\"$$first\"; \\\n      fi; \\\n    fi; \\\n    dir1=`echo \"$$dir1\" | sed -e \"$$sed_rest\"`; \\\n  done; \\\n  reldir=\"$$dir2\"\nDIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2\nGZIP_ENV = --best\nDIST_TARGETS = dist-bzip2 dist-gzip\ndistuninstallcheck_listfiles = find . -type f -print\nam__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \\\n  | sed 's|^\\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'\ndistcleancheck_listfiles = find . -type f -print\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nBUILD = @BUILD@\nCC = @CC@\nCCAS = @CCAS@\nCCASDEPMODE = @CCASDEPMODE@\nCCASFLAGS = @CCASFLAGS@\nCCDEPMODE = @CCDEPMODE@\nCFLAGS = @CFLAGS@\nCPP = @CPP@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEBARCH = @DEBARCH@\nDEFS = @DEFS@\nDEPDIR = @DEPDIR@\nDLLTOOL = @DLLTOOL@\nDSYMUTIL = @DSYMUTIL@\nDUMPBIN = @DUMPBIN@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEGREP = @EGREP@\nEXEEXT = @EXEEXT@\nFGREP = @FGREP@\nGREP = @GREP@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nJAR = @JAR@\nJAVA = @JAVA@\nJAVAC = @JAVAC@\nJAVACFLAGS = @JAVACFLAGS@\nJAVA_RPM_CONTENTS_1 = @JAVA_RPM_CONTENTS_1@\nJAVA_RPM_CONTENTS_2 = @JAVA_RPM_CONTENTS_2@\nJNI_CFLAGS = @JNI_CFLAGS@\nJPEG_LIB_VERSION = @JPEG_LIB_VERSION@\nJPEG_LIB_VERSION_DECIMAL = @JPEG_LIB_VERSION_DECIMAL@\nLD = @LD@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLIBTOOL = @LIBTOOL@\nLIBTOOL_CURRENT = @LIBTOOL_CURRENT@\nLIPO = @LIPO@\nLN_S = @LN_S@\nLTLIBOBJS = @LTLIBOBJS@\nLT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@\nMAKEINFO = @MAKEINFO@\nMANIFEST_TOOL = @MANIFEST_TOOL@\nMEM_SRCDST_FUNCTIONS = @MEM_SRCDST_FUNCTIONS@\nMKDIR_P = @MKDIR_P@\nNAFLAGS = @NAFLAGS@\nNASM = @NASM@\nNM = @NM@\nNMEDIT = @NMEDIT@\nOBJDUMP = @OBJDUMP@\nOBJEXT = @OBJEXT@\nOTOOL = @OTOOL@\nOTOOL64 = @OTOOL64@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nPKGNAME = @PKGNAME@\nPKG_CONFIG = @PKG_CONFIG@\nRANLIB = @RANLIB@\nRPMARCH = @RPMARCH@\nRPM_CONFIG_ARGS = @RPM_CONFIG_ARGS@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSO_AGE = @SO_AGE@\nSO_MAJOR_VERSION = @SO_MAJOR_VERSION@\nSO_MINOR_VERSION = @SO_MINOR_VERSION@\nSTRIP = @STRIP@\nVERSION = @VERSION@\nVERSION_SCRIPT_FLAG = @VERSION_SCRIPT_FLAG@\nWITH_JAVA = @WITH_JAVA@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_AR = @ac_ct_AR@\nac_ct_CC = @ac_ct_CC@\nac_ct_DUMPBIN = @ac_ct_DUMPBIN@\nam__include = @am__include@\nam__leading_dot = @am__leading_dot@\nam__quote = @am__quote@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild = @build@\nbuild_alias = @build_alias@\nbuild_cpu = @build_cpu@\nbuild_os = @build_os@\nbuild_vendor = @build_vendor@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost = @host@\nhost_alias = @host_alias@\nhost_cpu = @host_cpu@\nhost_os = @host_os@\nhost_vendor = @host_vendor@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nlib_LTLIBRARIES = libjpeg.la $(am__append_1)\nlibjpeg_la_LDFLAGS = -version-info \\\n\t${LIBTOOL_CURRENT}:${SO_MINOR_VERSION}:${SO_AGE} -no-undefined \\\n\t$(am__append_8)\ninclude_HEADERS = jerror.h jmorecfg.h jpeglib.h $(am__append_2)\n@WITH_TURBOJPEG_TRUE@libturbojpeg_la_LDFLAGS = -version-info 1:0:1 \\\n@WITH_TURBOJPEG_TRUE@\t-no-undefined $(am__append_7)\nnodist_include_HEADERS = jconfig.h\npkgconfigdir = $(libdir)/pkgconfig\npkgconfig_DATA = pkgscripts/libjpeg.pc pkgscripts/libturbojpeg.pc\nHDRS = jchuff.h jdct.h jdhuff.h jerror.h jinclude.h jmemsys.h jmorecfg.h \\\n\tjpegint.h jpeglib.h jversion.h jsimd.h jsimddct.h jpegcomp.h \\\n\tjpeg_nbits_table.h\n\nlibjpeg_la_SOURCES = $(HDRS) jcapimin.c jcapistd.c jccoefct.c \\\n\tjccolor.c jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c \\\n\tjcmaster.c jcomapi.c jcparam.c jcphuff.c jcprepct.c jcsample.c \\\n\tjctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c \\\n\tjdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c \\\n\tjdmarker.c jdmaster.c jdmerge.c jdphuff.c jdpostct.c \\\n\tjdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c jfdctint.c \\\n\tjidctflt.c jidctfst.c jidctint.c jidctred.c jquant1.c \\\n\tjquant2.c jutils.c jmemmgr.c jmemnobs.c $(am__append_3) \\\n\t$(am__append_4) $(am__append_5) $(am__append_10)\nSUBDIRS = java $(am__append_9) md5\n@WITH_TURBOJPEG_TRUE@libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) \\\n@WITH_TURBOJPEG_TRUE@\tturbojpeg.c turbojpeg.h transupp.c \\\n@WITH_TURBOJPEG_TRUE@\ttransupp.h jdatadst-tj.c jdatasrc-tj.c \\\n@WITH_TURBOJPEG_TRUE@\t$(am__append_6) $(TJMAPFILE)\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@libturbojpeg_la_CFLAGS = ${JNI_CFLAGS}\n@WITH_JAVA_FALSE@@WITH_TURBOJPEG_TRUE@TJMAPFILE = turbojpeg-mapfile\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@TJMAPFILE = turbojpeg-mapfile.jni\n@WITH_SIMD_TRUE@libjpeg_la_LIBADD = simd/libsimd.la\n@WITH_SIMD_TRUE@libturbojpeg_la_LIBADD = simd/libsimd.la\n@WITH_TURBOJPEG_TRUE@tjbench_SOURCES = tjbench.c bmp.h bmp.c tjutil.h tjutil.c rdbmp.c rdppm.c \\\n@WITH_TURBOJPEG_TRUE@\twrbmp.c wrppm.c\n\n@WITH_TURBOJPEG_TRUE@tjbench_LDADD = libturbojpeg.la libjpeg.la -lm\n@WITH_TURBOJPEG_TRUE@tjbench_CFLAGS = -DBMP_SUPPORTED -DPPM_SUPPORTED\n@WITH_TURBOJPEG_TRUE@tjunittest_SOURCES = tjunittest.c tjutil.h tjutil.c\n@WITH_TURBOJPEG_TRUE@tjunittest_LDADD = libturbojpeg.la\ncjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdgif.c rdppm.c \\\n\trdswitch.c $(am__append_13)\ncjpeg_LDADD = libjpeg.la\ncjpeg_CFLAGS = -DGIF_SUPPORTED -DPPM_SUPPORTED $(am__append_14)\ndjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c \\\n\trdswitch.c wrgif.c wrppm.c $(am__append_15)\ndjpeg_LDADD = libjpeg.la\ndjpeg_CFLAGS = -DGIF_SUPPORTED -DPPM_SUPPORTED $(am__append_16)\njpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c transupp.h\njpegtran_LDADD = libjpeg.la\nrdjpgcom_SOURCES = rdjpgcom.c\nrdjpgcom_LDADD = libjpeg.la\nwrjpgcom_SOURCES = wrjpgcom.c\nwrjpgcom_LDADD = libjpeg.la\njcstest_SOURCES = jcstest.c\njcstest_LDADD = libjpeg.la\ndist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1\nDOCS = coderules.txt jconfig.txt change.log rdrle.c wrrle.c BUILDING.md \\\n\tChangeLog.md\n\ndist_doc_DATA = README.ijg README.md libjpeg.txt structure.txt usage.txt \\\n\twizard.txt LICENSE.md\n\nexampledir = $(docdir)\ndist_example_DATA = example.c\nEXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \\\n\tsharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \\\n\tdoxygen-extra.css jccolext.c jdcolext.c jdcol565.c jdmrgext.c jdmrg565.c \\\n\tjstdhuff.c jdcoefct.h jdmainct.h jdmaster.h jdsample.h wrppm.h \\\n\tmd5/CMakeLists.txt\n\n@WITH_12BIT_FALSE@TESTORIG = testorig.jpg\n@WITH_12BIT_TRUE@TESTORIG = testorig12.jpg\n@WITH_12BIT_FALSE@MD5_JPEG_RGB_ISLOW = 768e970dd57b340ff1b83c9d3d47c77b\n@WITH_12BIT_TRUE@MD5_JPEG_RGB_ISLOW = 9620f424569594bb9242b48498ad801f\n@WITH_12BIT_FALSE@MD5_PPM_RGB_ISLOW = 00a257f5393fef8821f2b88ac7421291\n@WITH_12BIT_TRUE@MD5_PPM_RGB_ISLOW = f3301d2219783b8b3d942b7239fa50c0\n@WITH_12BIT_FALSE@MD5_JPEG_422_IFAST_OPT = 2540287b79d913f91665e660303ab2c8\n@WITH_12BIT_TRUE@MD5_JPEG_422_IFAST_OPT = 7322e3bd2f127f7de4b40d4480ce60e4\n@WITH_12BIT_FALSE@MD5_PPM_422_IFAST = 35bd6b3f833bad23de82acea847129fa\n@WITH_12BIT_TRUE@MD5_PPM_422_IFAST = 79807fa552899e66a04708f533e16950\n@WITH_12BIT_FALSE@MD5_PPM_422M_IFAST = 8dbc65323d62cca7c91ba02dd1cfa81d\n@WITH_12BIT_TRUE@MD5_PPM_422M_IFAST = 07737bfe8a7c1c87aaa393a0098d16b0\n@WITH_12BIT_FALSE@MD5_JPEG_420_IFAST_Q100_PROG = 990cbe0329c882420a2094da7e5adade\n@WITH_12BIT_TRUE@MD5_JPEG_420_IFAST_Q100_PROG = a1da220b5604081863a504297ed59e55\n@WITH_12BIT_FALSE@MD5_PPM_420_Q100_IFAST = 5a732542015c278ff43635e473a8a294\n@WITH_12BIT_TRUE@MD5_PPM_420_Q100_IFAST = 1b3730122709f53d007255e8dfd3305e\n@WITH_12BIT_FALSE@MD5_PPM_420M_Q100_IFAST = ff692ee9323a3b424894862557c092f1\n@WITH_12BIT_TRUE@MD5_PPM_420M_Q100_IFAST = 980a1a3c5bf9510022869d30b7d26566\n@WITH_12BIT_FALSE@MD5_JPEG_GRAY_ISLOW = 72b51f894b8f4a10b3ee3066770aa38d\n@WITH_12BIT_TRUE@MD5_JPEG_GRAY_ISLOW = 235c90707b16e2e069f37c888b2636d9\n@WITH_12BIT_FALSE@MD5_PPM_GRAY_ISLOW = 8d3596c56eace32f205deccc229aa5ed\n@WITH_12BIT_TRUE@MD5_PPM_GRAY_ISLOW = 7213c10af507ad467da5578ca5ee1fca\n@WITH_12BIT_FALSE@MD5_PPM_GRAY_ISLOW_RGB = 116424ac07b79e5e801f00508eab48ec\n@WITH_12BIT_TRUE@MD5_PPM_GRAY_ISLOW_RGB = e96ee81c30a6ed422d466338bd3de65d\n@WITH_12BIT_FALSE@MD5_JPEG_420S_IFAST_OPT = 388708217ac46273ca33086b22827ed8\n@WITH_12BIT_TRUE@MD5_JPEG_420S_IFAST_OPT = 7af8e60be4d9c227ec63ac9b6630855e\n# See README.md for more details on why this next bit is necessary.\n@WITH_12BIT_FALSE@MD5_JPEG_3x2_FLOAT_PROG_SSE = 343e3f8caf8af5986ebaf0bdc13b5c71\n@WITH_12BIT_TRUE@MD5_JPEG_3x2_FLOAT_PROG_SSE = a8c17daf77b457725ec929e215b603f8\n@WITH_12BIT_FALSE@MD5_PPM_3x2_FLOAT_SSE = 1a75f36e5904d6fc3a85a43da9ad89bb\n@WITH_12BIT_TRUE@MD5_PPM_3x2_FLOAT_SSE = 42876ab9e5c2f76a87d08db5fbd57956\n@WITH_12BIT_FALSE@MD5_JPEG_3x2_FLOAT_PROG_32BIT = 9bca803d2042bd1eb03819e2bf92b3e5\n@WITH_12BIT_TRUE@MD5_JPEG_3x2_FLOAT_PROG_32BIT = a8c17daf77b457725ec929e215b603f8\n@WITH_12BIT_FALSE@MD5_PPM_3x2_FLOAT_32BIT = f6bfab038438ed8f5522fbd33595dcdc\n@WITH_12BIT_TRUE@MD5_PPM_3x2_FLOAT_32BIT = 42876ab9e5c2f76a87d08db5fbd57956\n@WITH_12BIT_FALSE@MD5_PPM_3x2_FLOAT_64BIT = 0e917a34193ef976b679a6b069b1be26\n@WITH_12BIT_TRUE@MD5_PPM_3x2_FLOAT_64BIT = d6fbc71153b3d8ded484dbc17c7b9cf4\n@WITH_12BIT_FALSE@MD5_JPEG_3x2_IFAST_PROG = 1ee5d2c1a77f2da495f993c8c7cceca5\n@WITH_12BIT_TRUE@MD5_JPEG_3x2_IFAST_PROG = 1396cc2b7185cfe943d408c9d305339e\n@WITH_12BIT_FALSE@MD5_PPM_3x2_IFAST = fd283664b3b49127984af0a7f118fccd\n@WITH_12BIT_TRUE@MD5_PPM_3x2_IFAST = 3975985ef6eeb0a2cdc58daa651ccc00\n@WITH_12BIT_FALSE@MD5_PPM_420M_ISLOW_2_1 = 9f9de8c0612f8d06869b960b05abf9c9\n@WITH_12BIT_TRUE@MD5_PPM_420M_ISLOW_2_1 = 4ca6be2a6f326ff9eaab63e70a8259c0\n@WITH_12BIT_FALSE@MD5_PPM_420M_ISLOW_15_8 = b6875bc070720b899566cc06459b63b7\n@WITH_12BIT_TRUE@MD5_PPM_420M_ISLOW_15_8 = 12aa9f9534c1b3d7ba047322226365eb\n@WITH_12BIT_FALSE@MD5_PPM_420M_ISLOW_13_8 = bc3452573c8152f6ae552939ee19f82f\n@WITH_12BIT_TRUE@MD5_PPM_420M_ISLOW_13_8 = f7e22817c7b25e1393e4ec101e9d4e96\n@WITH_12BIT_FALSE@MD5_PPM_420M_ISLOW_11_8 = d8cc73c0aaacd4556569b59437ba00a5\n@WITH_12BIT_TRUE@MD5_PPM_420M_ISLOW_11_8 = 800a16f9f4dc9b293197bfe11be10a82\n@WITH_12BIT_FALSE@MD5_PPM_420M_ISLOW_9_8 = d25e61bc7eac0002f5b393aa223747b6\n@WITH_12BIT_TRUE@MD5_PPM_420M_ISLOW_9_8 = 06b7a92a9bc69f4dc36ec40f1937d55c\n@WITH_12BIT_FALSE@MD5_PPM_420M_ISLOW_7_8 = ddb564b7c74a09494016d6cd7502a946\n@WITH_12BIT_TRUE@MD5_PPM_420M_ISLOW_7_8 = 3ec444a14a4ab4eab88ffc49c48eca43\n@WITH_12BIT_FALSE@MD5_PPM_420M_ISLOW_3_4 = 8ed8e68808c3fbc4ea764fc9d2968646\n@WITH_12BIT_TRUE@MD5_PPM_420M_ISLOW_3_4 = 3e726b7ea872445b19437d1c1d4f0d93\n@WITH_12BIT_FALSE@MD5_PPM_420M_ISLOW_5_8 = a3363274999da2366a024efae6d16c9b\n@WITH_12BIT_TRUE@MD5_PPM_420M_ISLOW_5_8 = a8a771abdc94301d20ffac119b2caccd\n@WITH_12BIT_FALSE@MD5_PPM_420M_ISLOW_1_2 = e692a315cea26b988c8e8b29a5dbcd81\n@WITH_12BIT_TRUE@MD5_PPM_420M_ISLOW_1_2 = b419124dd5568b085787234866102866\n@WITH_12BIT_FALSE@MD5_PPM_420M_ISLOW_3_8 = 79eca9175652ced755155c90e785a996\n@WITH_12BIT_TRUE@MD5_PPM_420M_ISLOW_3_8 = 343d19015531b7bbe746124127244fa8\n@WITH_12BIT_FALSE@MD5_PPM_420M_ISLOW_1_4 = 79cd778f8bf1a117690052cacdd54eca\n@WITH_12BIT_TRUE@MD5_PPM_420M_ISLOW_1_4 = 35fd59d866e44659edfa3c18db2a3edb\n@WITH_12BIT_FALSE@MD5_PPM_420M_ISLOW_1_8 = 391b3d4aca640c8567d6f8745eb2142f\n@WITH_12BIT_TRUE@MD5_PPM_420M_ISLOW_1_8 = ccaed48ac0aedefda5d4abe4013f4ad7\n@WITH_12BIT_FALSE@MD5_PPM_420_ISLOW_SKIP15_31 = c4c65c1e43d7275cd50328a61e6534f0\n@WITH_12BIT_TRUE@MD5_PPM_420_ISLOW_SKIP15_31 = 86664cd9dc956536409e44e244d20a97\n@WITH_12BIT_FALSE@MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 = 26eb36ccc7d1f0cb80cdabb0ac8b5d99\n@WITH_12BIT_TRUE@MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 = 452a21656115a163029cfba5c04fa76a\n@WITH_12BIT_FALSE@MD5_PPM_444_ISLOW_SKIP1_6 = 5606f86874cf26b8fcee1117a0a436a6\n@WITH_12BIT_TRUE@MD5_PPM_444_ISLOW_SKIP1_6 = ef63901f71ef7a75cd78253fc0914f84\n@WITH_12BIT_FALSE@MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 = db87dc7ce26bcdc7a6b56239ce2b9d6c\n@WITH_12BIT_TRUE@MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 = 15b173fb5872d9575572fbcc1b05956f\n@WITH_12BIT_FALSE@MD5_JPEG_CROP = b4197f377e621c4e9b1d20471432610d\n@WITH_12BIT_TRUE@MD5_JPEG_CROP = cdb35ff4b4519392690ea040c56ea99c\n@WITH_12BIT_FALSE@MD5_BMP_RGB_ISLOW_565 = f07d2e75073e4bb10f6c6f4d36e2e3be\n@WITH_12BIT_FALSE@MD5_BMP_RGB_ISLOW_565D = 4cfa0928ef3e6bb626d7728c924cfda4\n@WITH_12BIT_FALSE@MD5_BMP_422M_IFAST_565 = 3294bd4d9a1f2b3d08ea6020d0db7065\n@WITH_12BIT_FALSE@MD5_BMP_422M_IFAST_565D = da98c9c7b6039511be4a79a878a9abc1\n@WITH_12BIT_FALSE@MD5_BMP_GRAY_ISLOW_565 = 12f78118e56a2f48b966f792fedf23cc\n@WITH_12BIT_FALSE@MD5_BMP_GRAY_ISLOW_565D = bdbbd616441a24354c98553df5dc82db\n@WITH_12BIT_FALSE@MD5_JPEG_420_ISLOW_ARI = e986fb0a637a8d833d96e8a6d6d84ea1\n@WITH_12BIT_FALSE@MD5_JPEG_444_ISLOW_PROGARI = 0a8f1c8f66e113c3cf635df0a475a617\n@WITH_12BIT_FALSE@MD5_PPM_420M_IFAST_ARI = 72b59a99bcf1de24c5b27d151bde2437\n@WITH_12BIT_FALSE@MD5_JPEG_420_ISLOW = 9a68f56bc76e466aa7e52f415d0f4a5f\n@WITH_12BIT_FALSE@MD5_BMP_420_ISLOW_256 = 4980185e3776e89bd931736e1cddeee6\n@WITH_12BIT_FALSE@MD5_BMP_420_ISLOW_565 = bf9d13e16c4923b92e1faa604d7922cb\n@WITH_12BIT_FALSE@MD5_BMP_420_ISLOW_565D = 6bde71526acc44bcff76f696df8638d2\n@WITH_12BIT_FALSE@MD5_BMP_420M_ISLOW_565 = 8dc0185245353cfa32ad97027342216f\n@WITH_12BIT_FALSE@MD5_BMP_420M_ISLOW_565D = d1be3a3339166255e76fa50a0d70d73e\n@WITH_12BIT_FALSE@MD5_PPM_420_ISLOW_ARI_SKIP16_139 = 087c6b123db16ac00cb88c5b590bb74a\n@WITH_12BIT_FALSE@MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4 = 886c6775af22370257122f8b16207e6d\n@WITH_12BIT_FALSE@MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0 = cb57b32bd6d03e35432362f7bf184b6d\n@WITH_TURBOJPEG_TRUE@MD5_PPM_GRAY_TILE = 89d3ca21213d9d864b50b4e4e7de4ca6\n@WITH_TURBOJPEG_TRUE@MD5_PPM_420_8x8_TILE = 847fceab15c5b7b911cb986cf0f71de3\n@WITH_TURBOJPEG_TRUE@MD5_PPM_420_16x16_TILE = ca45552a93687e078f7137cc4126a7b0\n@WITH_TURBOJPEG_TRUE@MD5_PPM_420_32x32_TILE = d8676f1d6b68df358353bba9844f4a00\n@WITH_TURBOJPEG_TRUE@MD5_PPM_420_64x64_TILE = 4e4c1a3d7ea4bace4f868bcbe83b7050\n@WITH_TURBOJPEG_TRUE@MD5_PPM_420_128x128_TILE = f24c3429c52265832beab9df72a0ceae\n@WITH_TURBOJPEG_TRUE@MD5_PPM_420M_8x8_TILE = bc25320e1f4c31ce2e610e43e9fd173c\n@WITH_TURBOJPEG_TRUE@MD5_PPM_420M_TILE = 75ffdf14602258c5c189522af57fa605\n@WITH_TURBOJPEG_TRUE@MD5_PPM_422_8x8_TILE = d83dacd9fc73b0a6f10c09acad64eb1e\n@WITH_TURBOJPEG_TRUE@MD5_PPM_422_16x16_TILE = 35077fb610d72dd743b1eb0cbcfe10fb\n@WITH_TURBOJPEG_TRUE@MD5_PPM_422_32x32_TILE = e6902ed8a449ecc0f0d6f2bf945f65f7\n@WITH_TURBOJPEG_TRUE@MD5_PPM_422_64x64_TILE = 2b4502a8f316cedbde1da7bce3d2231e\n@WITH_TURBOJPEG_TRUE@MD5_PPM_422_128x128_TILE = f0b5617d578f5e13c8eee215d64d4877\n@WITH_TURBOJPEG_TRUE@MD5_PPM_422M_8x8_TILE = 828941d7f41cd6283abd6beffb7fd51d\n@WITH_TURBOJPEG_TRUE@MD5_PPM_422M_TILE = e877ae1324c4a280b95376f7f018172f\n@WITH_TURBOJPEG_TRUE@MD5_PPM_444_TILE = 7964e41e67cfb8d0a587c0aa4798f9c3\nall: config.h jconfig.h jconfigint.h\n\t$(MAKE) $(AM_MAKEFLAGS) all-recursive\n\n.SUFFIXES:\n.SUFFIXES: .c .lo .o .obj\nam--refresh: Makefile\n\t@:\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \\\n\t      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \\\n\t\t&& exit 0; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    echo ' $(SHELL) ./config.status'; \\\n\t    $(SHELL) ./config.status;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\t$(SHELL) ./config.status --recheck\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\t$(am__cd) $(srcdir) && $(AUTOCONF)\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\t$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)\n$(am__aclocal_m4_deps):\n\nconfig.h: stamp-h1\n\t@test -f $@ || rm -f stamp-h1\n\t@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1\n\nstamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status\n\t@rm -f stamp-h1\n\tcd $(top_builddir) && $(SHELL) ./config.status config.h\n$(srcdir)/config.h.in:  $(am__configure_deps) \n\t($(am__cd) $(top_srcdir) && $(AUTOHEADER))\n\trm -f stamp-h1\n\ttouch $@\n\njconfig.h: stamp-h2\n\t@test -f $@ || rm -f stamp-h2\n\t@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2\n\nstamp-h2: $(srcdir)/jconfig.h.in $(top_builddir)/config.status\n\t@rm -f stamp-h2\n\tcd $(top_builddir) && $(SHELL) ./config.status jconfig.h\n\njconfigint.h: stamp-h3\n\t@test -f $@ || rm -f stamp-h3\n\t@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h3\n\nstamp-h3: $(srcdir)/jconfigint.h.in $(top_builddir)/config.status\n\t@rm -f stamp-h3\n\tcd $(top_builddir) && $(SHELL) ./config.status jconfigint.h\n\ndistclean-hdr:\n\t-rm -f config.h stamp-h1 jconfig.h stamp-h2 jconfigint.h stamp-h3\npkgscripts/libjpeg-turbo.spec.tmpl: $(top_builddir)/config.status $(top_srcdir)/release/libjpeg-turbo.spec.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\npkgscripts/makecygwinpkg.tmpl: $(top_builddir)/config.status $(top_srcdir)/release/makecygwinpkg.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\npkgscripts/makedpkg.tmpl: $(top_builddir)/config.status $(top_srcdir)/release/makedpkg.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\npkgscripts/makemacpkg.tmpl: $(top_builddir)/config.status $(top_srcdir)/release/makemacpkg.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\npkgscripts/uninstall.tmpl: $(top_builddir)/config.status $(top_srcdir)/release/uninstall.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\npkgscripts/libjpeg.pc: $(top_builddir)/config.status $(top_srcdir)/release/libjpeg.pc.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\npkgscripts/libturbojpeg.pc: $(top_builddir)/config.status $(top_srcdir)/release/libturbojpeg.pc.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\ntjbenchtest: $(top_builddir)/config.status $(srcdir)/tjbenchtest.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\ntjbenchtest.java: $(top_builddir)/config.status $(srcdir)/tjbenchtest.java.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\ntjexampletest: $(top_builddir)/config.status $(srcdir)/tjexampletest.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\nlibjpeg.map: $(top_builddir)/config.status $(srcdir)/libjpeg.map.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\n\ninstall-libLTLIBRARIES: $(lib_LTLIBRARIES)\n\t@$(NORMAL_INSTALL)\n\t@list='$(lib_LTLIBRARIES)'; test -n \"$(libdir)\" || list=; \\\n\tlist2=; for p in $$list; do \\\n\t  if test -f $$p; then \\\n\t    list2=\"$$list2 $$p\"; \\\n\t  else :; fi; \\\n\tdone; \\\n\ttest -z \"$$list2\" || { \\\n\t  echo \" $(MKDIR_P) '$(DESTDIR)$(libdir)'\"; \\\n\t  $(MKDIR_P) \"$(DESTDIR)$(libdir)\" || exit 1; \\\n\t  echo \" $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'\"; \\\n\t  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 \"$(DESTDIR)$(libdir)\"; \\\n\t}\n\nuninstall-libLTLIBRARIES:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(lib_LTLIBRARIES)'; test -n \"$(libdir)\" || list=; \\\n\tfor p in $$list; do \\\n\t  $(am__strip_dir) \\\n\t  echo \" $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'\"; \\\n\t  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f \"$(DESTDIR)$(libdir)/$$f\"; \\\n\tdone\n\nclean-libLTLIBRARIES:\n\t-test -z \"$(lib_LTLIBRARIES)\" || rm -f $(lib_LTLIBRARIES)\n\t@list='$(lib_LTLIBRARIES)'; \\\n\tlocs=`for p in $$list; do echo $$p; done | \\\n\t      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \\\n\t      sort -u`; \\\n\ttest -z \"$$locs\" || { \\\n\t  echo rm -f $${locs}; \\\n\t  rm -f $${locs}; \\\n\t}\n\nlibjpeg.la: $(libjpeg_la_OBJECTS) $(libjpeg_la_DEPENDENCIES) $(EXTRA_libjpeg_la_DEPENDENCIES) \n\t$(AM_V_CCLD)$(libjpeg_la_LINK) -rpath $(libdir) $(libjpeg_la_OBJECTS) $(libjpeg_la_LIBADD) $(LIBS)\n\nlibturbojpeg.la: $(libturbojpeg_la_OBJECTS) $(libturbojpeg_la_DEPENDENCIES) $(EXTRA_libturbojpeg_la_DEPENDENCIES) \n\t$(AM_V_CCLD)$(libturbojpeg_la_LINK) $(am_libturbojpeg_la_rpath) $(libturbojpeg_la_OBJECTS) $(libturbojpeg_la_LIBADD) $(LIBS)\ninstall-binPROGRAMS: $(bin_PROGRAMS)\n\t@$(NORMAL_INSTALL)\n\t@list='$(bin_PROGRAMS)'; test -n \"$(bindir)\" || list=; \\\n\tif test -n \"$$list\"; then \\\n\t  echo \" $(MKDIR_P) '$(DESTDIR)$(bindir)'\"; \\\n\t  $(MKDIR_P) \"$(DESTDIR)$(bindir)\" || exit 1; \\\n\tfi; \\\n\tfor p in $$list; do echo \"$$p $$p\"; done | \\\n\tsed 's/$(EXEEXT)$$//' | \\\n\twhile read p p1; do if test -f $$p \\\n\t || test -f $$p1 \\\n\t  ; then echo \"$$p\"; echo \"$$p\"; else :; fi; \\\n\tdone | \\\n\tsed -e 'p;s,.*/,,;n;h' \\\n\t    -e 's|.*|.|' \\\n\t    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \\\n\tsed 'N;N;N;s,\\n, ,g' | \\\n\t$(AWK) 'BEGIN { files[\".\"] = \"\"; dirs[\".\"] = 1 } \\\n\t  { d=$$3; if (dirs[d] != 1) { print \"d\", d; dirs[d] = 1 } \\\n\t    if ($$2 == $$4) files[d] = files[d] \" \" $$1; \\\n\t    else { print \"f\", $$3 \"/\" $$4, $$1; } } \\\n\t  END { for (d in files) print \"f\", d, files[d] }' | \\\n\twhile read type dir files; do \\\n\t    if test \"$$dir\" = .; then dir=; else dir=/$$dir; fi; \\\n\t    test -z \"$$files\" || { \\\n\t    echo \" $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'\"; \\\n\t    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files \"$(DESTDIR)$(bindir)$$dir\" || exit $$?; \\\n\t    } \\\n\t; done\n\nuninstall-binPROGRAMS:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(bin_PROGRAMS)'; test -n \"$(bindir)\" || list=; \\\n\tfiles=`for p in $$list; do echo \"$$p\"; done | \\\n\t  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \\\n\t      -e 's/$$/$(EXEEXT)/' \\\n\t`; \\\n\ttest -n \"$$list\" || exit 0; \\\n\techo \" ( cd '$(DESTDIR)$(bindir)' && rm -f\" $$files \")\"; \\\n\tcd \"$(DESTDIR)$(bindir)\" && rm -f $$files\n\nclean-binPROGRAMS:\n\t@list='$(bin_PROGRAMS)'; test -n \"$$list\" || exit 0; \\\n\techo \" rm -f\" $$list; \\\n\trm -f $$list || exit $$?; \\\n\ttest -n \"$(EXEEXT)\" || exit 0; \\\n\tlist=`for p in $$list; do echo \"$$p\"; done | sed 's/$(EXEEXT)$$//'`; \\\n\techo \" rm -f\" $$list; \\\n\trm -f $$list\n\nclean-noinstPROGRAMS:\n\t@list='$(noinst_PROGRAMS)'; test -n \"$$list\" || exit 0; \\\n\techo \" rm -f\" $$list; \\\n\trm -f $$list || exit $$?; \\\n\ttest -n \"$(EXEEXT)\" || exit 0; \\\n\tlist=`for p in $$list; do echo \"$$p\"; done | sed 's/$(EXEEXT)$$//'`; \\\n\techo \" rm -f\" $$list; \\\n\trm -f $$list\n\ncjpeg$(EXEEXT): $(cjpeg_OBJECTS) $(cjpeg_DEPENDENCIES) $(EXTRA_cjpeg_DEPENDENCIES) \n\t@rm -f cjpeg$(EXEEXT)\n\t$(AM_V_CCLD)$(cjpeg_LINK) $(cjpeg_OBJECTS) $(cjpeg_LDADD) $(LIBS)\n\ndjpeg$(EXEEXT): $(djpeg_OBJECTS) $(djpeg_DEPENDENCIES) $(EXTRA_djpeg_DEPENDENCIES) \n\t@rm -f djpeg$(EXEEXT)\n\t$(AM_V_CCLD)$(djpeg_LINK) $(djpeg_OBJECTS) $(djpeg_LDADD) $(LIBS)\n\njcstest$(EXEEXT): $(jcstest_OBJECTS) $(jcstest_DEPENDENCIES) $(EXTRA_jcstest_DEPENDENCIES) \n\t@rm -f jcstest$(EXEEXT)\n\t$(AM_V_CCLD)$(LINK) $(jcstest_OBJECTS) $(jcstest_LDADD) $(LIBS)\n\njpegtran$(EXEEXT): $(jpegtran_OBJECTS) $(jpegtran_DEPENDENCIES) $(EXTRA_jpegtran_DEPENDENCIES) \n\t@rm -f jpegtran$(EXEEXT)\n\t$(AM_V_CCLD)$(LINK) $(jpegtran_OBJECTS) $(jpegtran_LDADD) $(LIBS)\n\nrdjpgcom$(EXEEXT): $(rdjpgcom_OBJECTS) $(rdjpgcom_DEPENDENCIES) $(EXTRA_rdjpgcom_DEPENDENCIES) \n\t@rm -f rdjpgcom$(EXEEXT)\n\t$(AM_V_CCLD)$(LINK) $(rdjpgcom_OBJECTS) $(rdjpgcom_LDADD) $(LIBS)\n\ntjbench$(EXEEXT): $(tjbench_OBJECTS) $(tjbench_DEPENDENCIES) $(EXTRA_tjbench_DEPENDENCIES) \n\t@rm -f tjbench$(EXEEXT)\n\t$(AM_V_CCLD)$(tjbench_LINK) $(tjbench_OBJECTS) $(tjbench_LDADD) $(LIBS)\n\ntjunittest$(EXEEXT): $(tjunittest_OBJECTS) $(tjunittest_DEPENDENCIES) $(EXTRA_tjunittest_DEPENDENCIES) \n\t@rm -f tjunittest$(EXEEXT)\n\t$(AM_V_CCLD)$(LINK) $(tjunittest_OBJECTS) $(tjunittest_LDADD) $(LIBS)\n\nwrjpgcom$(EXEEXT): $(wrjpgcom_OBJECTS) $(wrjpgcom_DEPENDENCIES) $(EXTRA_wrjpgcom_DEPENDENCIES) \n\t@rm -f wrjpgcom$(EXEEXT)\n\t$(AM_V_CCLD)$(LINK) $(wrjpgcom_OBJECTS) $(wrjpgcom_LDADD) $(LIBS)\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdjpeg.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg-cdjpeg.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg-cjpeg.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg-rdbmp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg-rdgif.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg-rdppm.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg-rdswitch.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg-rdtarga.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-cdjpeg.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-djpeg.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-rdcolmap.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-rdswitch.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-wrbmp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-wrgif.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-wrppm.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-wrtarga.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jaricom.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapimin.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapistd.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcarith.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccoefct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccolor.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcdctmgr.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jchuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcinit.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmainct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmarker.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmaster.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcomapi.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcparam.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcphuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcprepct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcsample.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcstest.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jctrans.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapimin.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapistd.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdarith.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatadst.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatasrc.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcoefct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcolor.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jddctmgr.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdhuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdinput.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmainct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmarker.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmaster.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmerge.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdphuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdpostct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdsample.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdtrans.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jerror.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctflt.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctfst.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctint.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctflt.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctfst.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctint.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctred.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jmemmgr.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jmemnobs.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpegtran.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant1.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant2.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsimd_none.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jutils.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jaricom.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcapimin.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcapistd.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcarith.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jccoefct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jccolor.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcdctmgr.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jchuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcinit.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcmainct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcmarker.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcmaster.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcomapi.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcparam.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcphuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcprepct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcsample.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jctrans.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdapimin.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdapistd.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdarith.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdatadst-tj.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdatadst.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdatasrc-tj.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdatasrc.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdcoefct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdcolor.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jddctmgr.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdhuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdinput.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdmainct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdmarker.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdmaster.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdmerge.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdphuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdpostct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdsample.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdtrans.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jerror.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jfdctflt.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jfdctfst.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jfdctint.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jidctflt.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jidctfst.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jidctint.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jidctred.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jmemmgr.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jmemnobs.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jquant1.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jquant2.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jsimd_none.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jutils.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-transupp.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-turbojpeg-jni.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-turbojpeg.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdjpgcom.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdswitch.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjbench-bmp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjbench-rdbmp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjbench-rdppm.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjbench-tjbench.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjbench-tjutil.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjbench-wrbmp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjbench-wrppm.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjunittest.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjutil.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transupp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrjpgcom.Po@am__quote@\n\n.c.o:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\n.c.lo:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<\n\nlibturbojpeg_la-jcapimin.lo: jcapimin.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcapimin.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jcapimin.Tpo -c -o libturbojpeg_la-jcapimin.lo `test -f 'jcapimin.c' || echo '$(srcdir)/'`jcapimin.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jcapimin.Tpo $(DEPDIR)/libturbojpeg_la-jcapimin.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jcapimin.c' object='libturbojpeg_la-jcapimin.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcapimin.lo `test -f 'jcapimin.c' || echo '$(srcdir)/'`jcapimin.c\n\nlibturbojpeg_la-jcapistd.lo: jcapistd.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcapistd.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jcapistd.Tpo -c -o libturbojpeg_la-jcapistd.lo `test -f 'jcapistd.c' || echo '$(srcdir)/'`jcapistd.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jcapistd.Tpo $(DEPDIR)/libturbojpeg_la-jcapistd.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jcapistd.c' object='libturbojpeg_la-jcapistd.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcapistd.lo `test -f 'jcapistd.c' || echo '$(srcdir)/'`jcapistd.c\n\nlibturbojpeg_la-jccoefct.lo: jccoefct.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jccoefct.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jccoefct.Tpo -c -o libturbojpeg_la-jccoefct.lo `test -f 'jccoefct.c' || echo '$(srcdir)/'`jccoefct.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jccoefct.Tpo $(DEPDIR)/libturbojpeg_la-jccoefct.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jccoefct.c' object='libturbojpeg_la-jccoefct.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jccoefct.lo `test -f 'jccoefct.c' || echo '$(srcdir)/'`jccoefct.c\n\nlibturbojpeg_la-jccolor.lo: jccolor.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jccolor.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jccolor.Tpo -c -o libturbojpeg_la-jccolor.lo `test -f 'jccolor.c' || echo '$(srcdir)/'`jccolor.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jccolor.Tpo $(DEPDIR)/libturbojpeg_la-jccolor.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jccolor.c' object='libturbojpeg_la-jccolor.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jccolor.lo `test -f 'jccolor.c' || echo '$(srcdir)/'`jccolor.c\n\nlibturbojpeg_la-jcdctmgr.lo: jcdctmgr.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcdctmgr.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jcdctmgr.Tpo -c -o libturbojpeg_la-jcdctmgr.lo `test -f 'jcdctmgr.c' || echo '$(srcdir)/'`jcdctmgr.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jcdctmgr.Tpo $(DEPDIR)/libturbojpeg_la-jcdctmgr.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jcdctmgr.c' object='libturbojpeg_la-jcdctmgr.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcdctmgr.lo `test -f 'jcdctmgr.c' || echo '$(srcdir)/'`jcdctmgr.c\n\nlibturbojpeg_la-jchuff.lo: jchuff.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jchuff.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jchuff.Tpo -c -o libturbojpeg_la-jchuff.lo `test -f 'jchuff.c' || echo '$(srcdir)/'`jchuff.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jchuff.Tpo $(DEPDIR)/libturbojpeg_la-jchuff.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jchuff.c' object='libturbojpeg_la-jchuff.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jchuff.lo `test -f 'jchuff.c' || echo '$(srcdir)/'`jchuff.c\n\nlibturbojpeg_la-jcinit.lo: jcinit.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcinit.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jcinit.Tpo -c -o libturbojpeg_la-jcinit.lo `test -f 'jcinit.c' || echo '$(srcdir)/'`jcinit.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jcinit.Tpo $(DEPDIR)/libturbojpeg_la-jcinit.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jcinit.c' object='libturbojpeg_la-jcinit.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcinit.lo `test -f 'jcinit.c' || echo '$(srcdir)/'`jcinit.c\n\nlibturbojpeg_la-jcmainct.lo: jcmainct.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcmainct.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jcmainct.Tpo -c -o libturbojpeg_la-jcmainct.lo `test -f 'jcmainct.c' || echo '$(srcdir)/'`jcmainct.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jcmainct.Tpo $(DEPDIR)/libturbojpeg_la-jcmainct.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jcmainct.c' object='libturbojpeg_la-jcmainct.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcmainct.lo `test -f 'jcmainct.c' || echo '$(srcdir)/'`jcmainct.c\n\nlibturbojpeg_la-jcmarker.lo: jcmarker.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcmarker.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jcmarker.Tpo -c -o libturbojpeg_la-jcmarker.lo `test -f 'jcmarker.c' || echo '$(srcdir)/'`jcmarker.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jcmarker.Tpo $(DEPDIR)/libturbojpeg_la-jcmarker.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jcmarker.c' object='libturbojpeg_la-jcmarker.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcmarker.lo `test -f 'jcmarker.c' || echo '$(srcdir)/'`jcmarker.c\n\nlibturbojpeg_la-jcmaster.lo: jcmaster.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcmaster.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jcmaster.Tpo -c -o libturbojpeg_la-jcmaster.lo `test -f 'jcmaster.c' || echo '$(srcdir)/'`jcmaster.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jcmaster.Tpo $(DEPDIR)/libturbojpeg_la-jcmaster.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jcmaster.c' object='libturbojpeg_la-jcmaster.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcmaster.lo `test -f 'jcmaster.c' || echo '$(srcdir)/'`jcmaster.c\n\nlibturbojpeg_la-jcomapi.lo: jcomapi.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcomapi.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jcomapi.Tpo -c -o libturbojpeg_la-jcomapi.lo `test -f 'jcomapi.c' || echo '$(srcdir)/'`jcomapi.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jcomapi.Tpo $(DEPDIR)/libturbojpeg_la-jcomapi.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jcomapi.c' object='libturbojpeg_la-jcomapi.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcomapi.lo `test -f 'jcomapi.c' || echo '$(srcdir)/'`jcomapi.c\n\nlibturbojpeg_la-jcparam.lo: jcparam.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcparam.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jcparam.Tpo -c -o libturbojpeg_la-jcparam.lo `test -f 'jcparam.c' || echo '$(srcdir)/'`jcparam.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jcparam.Tpo $(DEPDIR)/libturbojpeg_la-jcparam.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jcparam.c' object='libturbojpeg_la-jcparam.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcparam.lo `test -f 'jcparam.c' || echo '$(srcdir)/'`jcparam.c\n\nlibturbojpeg_la-jcphuff.lo: jcphuff.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcphuff.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jcphuff.Tpo -c -o libturbojpeg_la-jcphuff.lo `test -f 'jcphuff.c' || echo '$(srcdir)/'`jcphuff.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jcphuff.Tpo $(DEPDIR)/libturbojpeg_la-jcphuff.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jcphuff.c' object='libturbojpeg_la-jcphuff.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcphuff.lo `test -f 'jcphuff.c' || echo '$(srcdir)/'`jcphuff.c\n\nlibturbojpeg_la-jcprepct.lo: jcprepct.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcprepct.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jcprepct.Tpo -c -o libturbojpeg_la-jcprepct.lo `test -f 'jcprepct.c' || echo '$(srcdir)/'`jcprepct.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jcprepct.Tpo $(DEPDIR)/libturbojpeg_la-jcprepct.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jcprepct.c' object='libturbojpeg_la-jcprepct.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcprepct.lo `test -f 'jcprepct.c' || echo '$(srcdir)/'`jcprepct.c\n\nlibturbojpeg_la-jcsample.lo: jcsample.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcsample.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jcsample.Tpo -c -o libturbojpeg_la-jcsample.lo `test -f 'jcsample.c' || echo '$(srcdir)/'`jcsample.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jcsample.Tpo $(DEPDIR)/libturbojpeg_la-jcsample.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jcsample.c' object='libturbojpeg_la-jcsample.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcsample.lo `test -f 'jcsample.c' || echo '$(srcdir)/'`jcsample.c\n\nlibturbojpeg_la-jctrans.lo: jctrans.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jctrans.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jctrans.Tpo -c -o libturbojpeg_la-jctrans.lo `test -f 'jctrans.c' || echo '$(srcdir)/'`jctrans.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jctrans.Tpo $(DEPDIR)/libturbojpeg_la-jctrans.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jctrans.c' object='libturbojpeg_la-jctrans.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jctrans.lo `test -f 'jctrans.c' || echo '$(srcdir)/'`jctrans.c\n\nlibturbojpeg_la-jdapimin.lo: jdapimin.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdapimin.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdapimin.Tpo -c -o libturbojpeg_la-jdapimin.lo `test -f 'jdapimin.c' || echo '$(srcdir)/'`jdapimin.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdapimin.Tpo $(DEPDIR)/libturbojpeg_la-jdapimin.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdapimin.c' object='libturbojpeg_la-jdapimin.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdapimin.lo `test -f 'jdapimin.c' || echo '$(srcdir)/'`jdapimin.c\n\nlibturbojpeg_la-jdapistd.lo: jdapistd.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdapistd.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdapistd.Tpo -c -o libturbojpeg_la-jdapistd.lo `test -f 'jdapistd.c' || echo '$(srcdir)/'`jdapistd.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdapistd.Tpo $(DEPDIR)/libturbojpeg_la-jdapistd.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdapistd.c' object='libturbojpeg_la-jdapistd.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdapistd.lo `test -f 'jdapistd.c' || echo '$(srcdir)/'`jdapistd.c\n\nlibturbojpeg_la-jdatadst.lo: jdatadst.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdatadst.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdatadst.Tpo -c -o libturbojpeg_la-jdatadst.lo `test -f 'jdatadst.c' || echo '$(srcdir)/'`jdatadst.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdatadst.Tpo $(DEPDIR)/libturbojpeg_la-jdatadst.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdatadst.c' object='libturbojpeg_la-jdatadst.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdatadst.lo `test -f 'jdatadst.c' || echo '$(srcdir)/'`jdatadst.c\n\nlibturbojpeg_la-jdatasrc.lo: jdatasrc.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdatasrc.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdatasrc.Tpo -c -o libturbojpeg_la-jdatasrc.lo `test -f 'jdatasrc.c' || echo '$(srcdir)/'`jdatasrc.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdatasrc.Tpo $(DEPDIR)/libturbojpeg_la-jdatasrc.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdatasrc.c' object='libturbojpeg_la-jdatasrc.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdatasrc.lo `test -f 'jdatasrc.c' || echo '$(srcdir)/'`jdatasrc.c\n\nlibturbojpeg_la-jdcoefct.lo: jdcoefct.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdcoefct.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdcoefct.Tpo -c -o libturbojpeg_la-jdcoefct.lo `test -f 'jdcoefct.c' || echo '$(srcdir)/'`jdcoefct.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdcoefct.Tpo $(DEPDIR)/libturbojpeg_la-jdcoefct.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdcoefct.c' object='libturbojpeg_la-jdcoefct.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdcoefct.lo `test -f 'jdcoefct.c' || echo '$(srcdir)/'`jdcoefct.c\n\nlibturbojpeg_la-jdcolor.lo: jdcolor.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdcolor.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdcolor.Tpo -c -o libturbojpeg_la-jdcolor.lo `test -f 'jdcolor.c' || echo '$(srcdir)/'`jdcolor.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdcolor.Tpo $(DEPDIR)/libturbojpeg_la-jdcolor.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdcolor.c' object='libturbojpeg_la-jdcolor.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdcolor.lo `test -f 'jdcolor.c' || echo '$(srcdir)/'`jdcolor.c\n\nlibturbojpeg_la-jddctmgr.lo: jddctmgr.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jddctmgr.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jddctmgr.Tpo -c -o libturbojpeg_la-jddctmgr.lo `test -f 'jddctmgr.c' || echo '$(srcdir)/'`jddctmgr.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jddctmgr.Tpo $(DEPDIR)/libturbojpeg_la-jddctmgr.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jddctmgr.c' object='libturbojpeg_la-jddctmgr.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jddctmgr.lo `test -f 'jddctmgr.c' || echo '$(srcdir)/'`jddctmgr.c\n\nlibturbojpeg_la-jdhuff.lo: jdhuff.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdhuff.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdhuff.Tpo -c -o libturbojpeg_la-jdhuff.lo `test -f 'jdhuff.c' || echo '$(srcdir)/'`jdhuff.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdhuff.Tpo $(DEPDIR)/libturbojpeg_la-jdhuff.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdhuff.c' object='libturbojpeg_la-jdhuff.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdhuff.lo `test -f 'jdhuff.c' || echo '$(srcdir)/'`jdhuff.c\n\nlibturbojpeg_la-jdinput.lo: jdinput.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdinput.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdinput.Tpo -c -o libturbojpeg_la-jdinput.lo `test -f 'jdinput.c' || echo '$(srcdir)/'`jdinput.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdinput.Tpo $(DEPDIR)/libturbojpeg_la-jdinput.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdinput.c' object='libturbojpeg_la-jdinput.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdinput.lo `test -f 'jdinput.c' || echo '$(srcdir)/'`jdinput.c\n\nlibturbojpeg_la-jdmainct.lo: jdmainct.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdmainct.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdmainct.Tpo -c -o libturbojpeg_la-jdmainct.lo `test -f 'jdmainct.c' || echo '$(srcdir)/'`jdmainct.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdmainct.Tpo $(DEPDIR)/libturbojpeg_la-jdmainct.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdmainct.c' object='libturbojpeg_la-jdmainct.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdmainct.lo `test -f 'jdmainct.c' || echo '$(srcdir)/'`jdmainct.c\n\nlibturbojpeg_la-jdmarker.lo: jdmarker.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdmarker.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdmarker.Tpo -c -o libturbojpeg_la-jdmarker.lo `test -f 'jdmarker.c' || echo '$(srcdir)/'`jdmarker.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdmarker.Tpo $(DEPDIR)/libturbojpeg_la-jdmarker.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdmarker.c' object='libturbojpeg_la-jdmarker.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdmarker.lo `test -f 'jdmarker.c' || echo '$(srcdir)/'`jdmarker.c\n\nlibturbojpeg_la-jdmaster.lo: jdmaster.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdmaster.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdmaster.Tpo -c -o libturbojpeg_la-jdmaster.lo `test -f 'jdmaster.c' || echo '$(srcdir)/'`jdmaster.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdmaster.Tpo $(DEPDIR)/libturbojpeg_la-jdmaster.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdmaster.c' object='libturbojpeg_la-jdmaster.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdmaster.lo `test -f 'jdmaster.c' || echo '$(srcdir)/'`jdmaster.c\n\nlibturbojpeg_la-jdmerge.lo: jdmerge.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdmerge.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdmerge.Tpo -c -o libturbojpeg_la-jdmerge.lo `test -f 'jdmerge.c' || echo '$(srcdir)/'`jdmerge.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdmerge.Tpo $(DEPDIR)/libturbojpeg_la-jdmerge.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdmerge.c' object='libturbojpeg_la-jdmerge.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdmerge.lo `test -f 'jdmerge.c' || echo '$(srcdir)/'`jdmerge.c\n\nlibturbojpeg_la-jdphuff.lo: jdphuff.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdphuff.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdphuff.Tpo -c -o libturbojpeg_la-jdphuff.lo `test -f 'jdphuff.c' || echo '$(srcdir)/'`jdphuff.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdphuff.Tpo $(DEPDIR)/libturbojpeg_la-jdphuff.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdphuff.c' object='libturbojpeg_la-jdphuff.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdphuff.lo `test -f 'jdphuff.c' || echo '$(srcdir)/'`jdphuff.c\n\nlibturbojpeg_la-jdpostct.lo: jdpostct.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdpostct.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdpostct.Tpo -c -o libturbojpeg_la-jdpostct.lo `test -f 'jdpostct.c' || echo '$(srcdir)/'`jdpostct.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdpostct.Tpo $(DEPDIR)/libturbojpeg_la-jdpostct.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdpostct.c' object='libturbojpeg_la-jdpostct.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdpostct.lo `test -f 'jdpostct.c' || echo '$(srcdir)/'`jdpostct.c\n\nlibturbojpeg_la-jdsample.lo: jdsample.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdsample.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdsample.Tpo -c -o libturbojpeg_la-jdsample.lo `test -f 'jdsample.c' || echo '$(srcdir)/'`jdsample.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdsample.Tpo $(DEPDIR)/libturbojpeg_la-jdsample.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdsample.c' object='libturbojpeg_la-jdsample.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdsample.lo `test -f 'jdsample.c' || echo '$(srcdir)/'`jdsample.c\n\nlibturbojpeg_la-jdtrans.lo: jdtrans.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdtrans.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdtrans.Tpo -c -o libturbojpeg_la-jdtrans.lo `test -f 'jdtrans.c' || echo '$(srcdir)/'`jdtrans.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdtrans.Tpo $(DEPDIR)/libturbojpeg_la-jdtrans.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdtrans.c' object='libturbojpeg_la-jdtrans.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdtrans.lo `test -f 'jdtrans.c' || echo '$(srcdir)/'`jdtrans.c\n\nlibturbojpeg_la-jerror.lo: jerror.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jerror.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jerror.Tpo -c -o libturbojpeg_la-jerror.lo `test -f 'jerror.c' || echo '$(srcdir)/'`jerror.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jerror.Tpo $(DEPDIR)/libturbojpeg_la-jerror.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jerror.c' object='libturbojpeg_la-jerror.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jerror.lo `test -f 'jerror.c' || echo '$(srcdir)/'`jerror.c\n\nlibturbojpeg_la-jfdctflt.lo: jfdctflt.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jfdctflt.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jfdctflt.Tpo -c -o libturbojpeg_la-jfdctflt.lo `test -f 'jfdctflt.c' || echo '$(srcdir)/'`jfdctflt.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jfdctflt.Tpo $(DEPDIR)/libturbojpeg_la-jfdctflt.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jfdctflt.c' object='libturbojpeg_la-jfdctflt.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jfdctflt.lo `test -f 'jfdctflt.c' || echo '$(srcdir)/'`jfdctflt.c\n\nlibturbojpeg_la-jfdctfst.lo: jfdctfst.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jfdctfst.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jfdctfst.Tpo -c -o libturbojpeg_la-jfdctfst.lo `test -f 'jfdctfst.c' || echo '$(srcdir)/'`jfdctfst.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jfdctfst.Tpo $(DEPDIR)/libturbojpeg_la-jfdctfst.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jfdctfst.c' object='libturbojpeg_la-jfdctfst.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jfdctfst.lo `test -f 'jfdctfst.c' || echo '$(srcdir)/'`jfdctfst.c\n\nlibturbojpeg_la-jfdctint.lo: jfdctint.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jfdctint.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jfdctint.Tpo -c -o libturbojpeg_la-jfdctint.lo `test -f 'jfdctint.c' || echo '$(srcdir)/'`jfdctint.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jfdctint.Tpo $(DEPDIR)/libturbojpeg_la-jfdctint.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jfdctint.c' object='libturbojpeg_la-jfdctint.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jfdctint.lo `test -f 'jfdctint.c' || echo '$(srcdir)/'`jfdctint.c\n\nlibturbojpeg_la-jidctflt.lo: jidctflt.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jidctflt.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jidctflt.Tpo -c -o libturbojpeg_la-jidctflt.lo `test -f 'jidctflt.c' || echo '$(srcdir)/'`jidctflt.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jidctflt.Tpo $(DEPDIR)/libturbojpeg_la-jidctflt.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jidctflt.c' object='libturbojpeg_la-jidctflt.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jidctflt.lo `test -f 'jidctflt.c' || echo '$(srcdir)/'`jidctflt.c\n\nlibturbojpeg_la-jidctfst.lo: jidctfst.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jidctfst.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jidctfst.Tpo -c -o libturbojpeg_la-jidctfst.lo `test -f 'jidctfst.c' || echo '$(srcdir)/'`jidctfst.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jidctfst.Tpo $(DEPDIR)/libturbojpeg_la-jidctfst.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jidctfst.c' object='libturbojpeg_la-jidctfst.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jidctfst.lo `test -f 'jidctfst.c' || echo '$(srcdir)/'`jidctfst.c\n\nlibturbojpeg_la-jidctint.lo: jidctint.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jidctint.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jidctint.Tpo -c -o libturbojpeg_la-jidctint.lo `test -f 'jidctint.c' || echo '$(srcdir)/'`jidctint.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jidctint.Tpo $(DEPDIR)/libturbojpeg_la-jidctint.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jidctint.c' object='libturbojpeg_la-jidctint.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jidctint.lo `test -f 'jidctint.c' || echo '$(srcdir)/'`jidctint.c\n\nlibturbojpeg_la-jidctred.lo: jidctred.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jidctred.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jidctred.Tpo -c -o libturbojpeg_la-jidctred.lo `test -f 'jidctred.c' || echo '$(srcdir)/'`jidctred.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jidctred.Tpo $(DEPDIR)/libturbojpeg_la-jidctred.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jidctred.c' object='libturbojpeg_la-jidctred.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jidctred.lo `test -f 'jidctred.c' || echo '$(srcdir)/'`jidctred.c\n\nlibturbojpeg_la-jquant1.lo: jquant1.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jquant1.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jquant1.Tpo -c -o libturbojpeg_la-jquant1.lo `test -f 'jquant1.c' || echo '$(srcdir)/'`jquant1.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jquant1.Tpo $(DEPDIR)/libturbojpeg_la-jquant1.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jquant1.c' object='libturbojpeg_la-jquant1.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jquant1.lo `test -f 'jquant1.c' || echo '$(srcdir)/'`jquant1.c\n\nlibturbojpeg_la-jquant2.lo: jquant2.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jquant2.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jquant2.Tpo -c -o libturbojpeg_la-jquant2.lo `test -f 'jquant2.c' || echo '$(srcdir)/'`jquant2.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jquant2.Tpo $(DEPDIR)/libturbojpeg_la-jquant2.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jquant2.c' object='libturbojpeg_la-jquant2.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jquant2.lo `test -f 'jquant2.c' || echo '$(srcdir)/'`jquant2.c\n\nlibturbojpeg_la-jutils.lo: jutils.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jutils.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jutils.Tpo -c -o libturbojpeg_la-jutils.lo `test -f 'jutils.c' || echo '$(srcdir)/'`jutils.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jutils.Tpo $(DEPDIR)/libturbojpeg_la-jutils.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jutils.c' object='libturbojpeg_la-jutils.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jutils.lo `test -f 'jutils.c' || echo '$(srcdir)/'`jutils.c\n\nlibturbojpeg_la-jmemmgr.lo: jmemmgr.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jmemmgr.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jmemmgr.Tpo -c -o libturbojpeg_la-jmemmgr.lo `test -f 'jmemmgr.c' || echo '$(srcdir)/'`jmemmgr.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jmemmgr.Tpo $(DEPDIR)/libturbojpeg_la-jmemmgr.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jmemmgr.c' object='libturbojpeg_la-jmemmgr.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jmemmgr.lo `test -f 'jmemmgr.c' || echo '$(srcdir)/'`jmemmgr.c\n\nlibturbojpeg_la-jmemnobs.lo: jmemnobs.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jmemnobs.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jmemnobs.Tpo -c -o libturbojpeg_la-jmemnobs.lo `test -f 'jmemnobs.c' || echo '$(srcdir)/'`jmemnobs.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jmemnobs.Tpo $(DEPDIR)/libturbojpeg_la-jmemnobs.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jmemnobs.c' object='libturbojpeg_la-jmemnobs.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jmemnobs.lo `test -f 'jmemnobs.c' || echo '$(srcdir)/'`jmemnobs.c\n\nlibturbojpeg_la-jaricom.lo: jaricom.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jaricom.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jaricom.Tpo -c -o libturbojpeg_la-jaricom.lo `test -f 'jaricom.c' || echo '$(srcdir)/'`jaricom.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jaricom.Tpo $(DEPDIR)/libturbojpeg_la-jaricom.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jaricom.c' object='libturbojpeg_la-jaricom.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jaricom.lo `test -f 'jaricom.c' || echo '$(srcdir)/'`jaricom.c\n\nlibturbojpeg_la-jcarith.lo: jcarith.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcarith.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jcarith.Tpo -c -o libturbojpeg_la-jcarith.lo `test -f 'jcarith.c' || echo '$(srcdir)/'`jcarith.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jcarith.Tpo $(DEPDIR)/libturbojpeg_la-jcarith.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jcarith.c' object='libturbojpeg_la-jcarith.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcarith.lo `test -f 'jcarith.c' || echo '$(srcdir)/'`jcarith.c\n\nlibturbojpeg_la-jdarith.lo: jdarith.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdarith.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdarith.Tpo -c -o libturbojpeg_la-jdarith.lo `test -f 'jdarith.c' || echo '$(srcdir)/'`jdarith.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdarith.Tpo $(DEPDIR)/libturbojpeg_la-jdarith.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdarith.c' object='libturbojpeg_la-jdarith.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdarith.lo `test -f 'jdarith.c' || echo '$(srcdir)/'`jdarith.c\n\nlibturbojpeg_la-jsimd_none.lo: jsimd_none.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jsimd_none.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jsimd_none.Tpo -c -o libturbojpeg_la-jsimd_none.lo `test -f 'jsimd_none.c' || echo '$(srcdir)/'`jsimd_none.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jsimd_none.Tpo $(DEPDIR)/libturbojpeg_la-jsimd_none.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jsimd_none.c' object='libturbojpeg_la-jsimd_none.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jsimd_none.lo `test -f 'jsimd_none.c' || echo '$(srcdir)/'`jsimd_none.c\n\nlibturbojpeg_la-turbojpeg.lo: turbojpeg.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-turbojpeg.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-turbojpeg.Tpo -c -o libturbojpeg_la-turbojpeg.lo `test -f 'turbojpeg.c' || echo '$(srcdir)/'`turbojpeg.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-turbojpeg.Tpo $(DEPDIR)/libturbojpeg_la-turbojpeg.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='turbojpeg.c' object='libturbojpeg_la-turbojpeg.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-turbojpeg.lo `test -f 'turbojpeg.c' || echo '$(srcdir)/'`turbojpeg.c\n\nlibturbojpeg_la-transupp.lo: transupp.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-transupp.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-transupp.Tpo -c -o libturbojpeg_la-transupp.lo `test -f 'transupp.c' || echo '$(srcdir)/'`transupp.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-transupp.Tpo $(DEPDIR)/libturbojpeg_la-transupp.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='transupp.c' object='libturbojpeg_la-transupp.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-transupp.lo `test -f 'transupp.c' || echo '$(srcdir)/'`transupp.c\n\nlibturbojpeg_la-jdatadst-tj.lo: jdatadst-tj.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdatadst-tj.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdatadst-tj.Tpo -c -o libturbojpeg_la-jdatadst-tj.lo `test -f 'jdatadst-tj.c' || echo '$(srcdir)/'`jdatadst-tj.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdatadst-tj.Tpo $(DEPDIR)/libturbojpeg_la-jdatadst-tj.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdatadst-tj.c' object='libturbojpeg_la-jdatadst-tj.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdatadst-tj.lo `test -f 'jdatadst-tj.c' || echo '$(srcdir)/'`jdatadst-tj.c\n\nlibturbojpeg_la-jdatasrc-tj.lo: jdatasrc-tj.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdatasrc-tj.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-jdatasrc-tj.Tpo -c -o libturbojpeg_la-jdatasrc-tj.lo `test -f 'jdatasrc-tj.c' || echo '$(srcdir)/'`jdatasrc-tj.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-jdatasrc-tj.Tpo $(DEPDIR)/libturbojpeg_la-jdatasrc-tj.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdatasrc-tj.c' object='libturbojpeg_la-jdatasrc-tj.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdatasrc-tj.lo `test -f 'jdatasrc-tj.c' || echo '$(srcdir)/'`jdatasrc-tj.c\n\nlibturbojpeg_la-turbojpeg-jni.lo: turbojpeg-jni.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-turbojpeg-jni.lo -MD -MP -MF $(DEPDIR)/libturbojpeg_la-turbojpeg-jni.Tpo -c -o libturbojpeg_la-turbojpeg-jni.lo `test -f 'turbojpeg-jni.c' || echo '$(srcdir)/'`turbojpeg-jni.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libturbojpeg_la-turbojpeg-jni.Tpo $(DEPDIR)/libturbojpeg_la-turbojpeg-jni.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='turbojpeg-jni.c' object='libturbojpeg_la-turbojpeg-jni.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-turbojpeg-jni.lo `test -f 'turbojpeg-jni.c' || echo '$(srcdir)/'`turbojpeg-jni.c\n\ncjpeg-cdjpeg.o: cdjpeg.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-cdjpeg.o -MD -MP -MF $(DEPDIR)/cjpeg-cdjpeg.Tpo -c -o cjpeg-cdjpeg.o `test -f 'cdjpeg.c' || echo '$(srcdir)/'`cdjpeg.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/cjpeg-cdjpeg.Tpo $(DEPDIR)/cjpeg-cdjpeg.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='cdjpeg.c' object='cjpeg-cdjpeg.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-cdjpeg.o `test -f 'cdjpeg.c' || echo '$(srcdir)/'`cdjpeg.c\n\ncjpeg-cdjpeg.obj: cdjpeg.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-cdjpeg.obj -MD -MP -MF $(DEPDIR)/cjpeg-cdjpeg.Tpo -c -o cjpeg-cdjpeg.obj `if test -f 'cdjpeg.c'; then $(CYGPATH_W) 'cdjpeg.c'; else $(CYGPATH_W) '$(srcdir)/cdjpeg.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/cjpeg-cdjpeg.Tpo $(DEPDIR)/cjpeg-cdjpeg.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='cdjpeg.c' object='cjpeg-cdjpeg.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-cdjpeg.obj `if test -f 'cdjpeg.c'; then $(CYGPATH_W) 'cdjpeg.c'; else $(CYGPATH_W) '$(srcdir)/cdjpeg.c'; fi`\n\ncjpeg-cjpeg.o: cjpeg.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-cjpeg.o -MD -MP -MF $(DEPDIR)/cjpeg-cjpeg.Tpo -c -o cjpeg-cjpeg.o `test -f 'cjpeg.c' || echo '$(srcdir)/'`cjpeg.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/cjpeg-cjpeg.Tpo $(DEPDIR)/cjpeg-cjpeg.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='cjpeg.c' object='cjpeg-cjpeg.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-cjpeg.o `test -f 'cjpeg.c' || echo '$(srcdir)/'`cjpeg.c\n\ncjpeg-cjpeg.obj: cjpeg.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-cjpeg.obj -MD -MP -MF $(DEPDIR)/cjpeg-cjpeg.Tpo -c -o cjpeg-cjpeg.obj `if test -f 'cjpeg.c'; then $(CYGPATH_W) 'cjpeg.c'; else $(CYGPATH_W) '$(srcdir)/cjpeg.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/cjpeg-cjpeg.Tpo $(DEPDIR)/cjpeg-cjpeg.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='cjpeg.c' object='cjpeg-cjpeg.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-cjpeg.obj `if test -f 'cjpeg.c'; then $(CYGPATH_W) 'cjpeg.c'; else $(CYGPATH_W) '$(srcdir)/cjpeg.c'; fi`\n\ncjpeg-rdgif.o: rdgif.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdgif.o -MD -MP -MF $(DEPDIR)/cjpeg-rdgif.Tpo -c -o cjpeg-rdgif.o `test -f 'rdgif.c' || echo '$(srcdir)/'`rdgif.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/cjpeg-rdgif.Tpo $(DEPDIR)/cjpeg-rdgif.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdgif.c' object='cjpeg-rdgif.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdgif.o `test -f 'rdgif.c' || echo '$(srcdir)/'`rdgif.c\n\ncjpeg-rdgif.obj: rdgif.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdgif.obj -MD -MP -MF $(DEPDIR)/cjpeg-rdgif.Tpo -c -o cjpeg-rdgif.obj `if test -f 'rdgif.c'; then $(CYGPATH_W) 'rdgif.c'; else $(CYGPATH_W) '$(srcdir)/rdgif.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/cjpeg-rdgif.Tpo $(DEPDIR)/cjpeg-rdgif.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdgif.c' object='cjpeg-rdgif.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdgif.obj `if test -f 'rdgif.c'; then $(CYGPATH_W) 'rdgif.c'; else $(CYGPATH_W) '$(srcdir)/rdgif.c'; fi`\n\ncjpeg-rdppm.o: rdppm.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdppm.o -MD -MP -MF $(DEPDIR)/cjpeg-rdppm.Tpo -c -o cjpeg-rdppm.o `test -f 'rdppm.c' || echo '$(srcdir)/'`rdppm.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/cjpeg-rdppm.Tpo $(DEPDIR)/cjpeg-rdppm.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdppm.c' object='cjpeg-rdppm.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdppm.o `test -f 'rdppm.c' || echo '$(srcdir)/'`rdppm.c\n\ncjpeg-rdppm.obj: rdppm.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdppm.obj -MD -MP -MF $(DEPDIR)/cjpeg-rdppm.Tpo -c -o cjpeg-rdppm.obj `if test -f 'rdppm.c'; then $(CYGPATH_W) 'rdppm.c'; else $(CYGPATH_W) '$(srcdir)/rdppm.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/cjpeg-rdppm.Tpo $(DEPDIR)/cjpeg-rdppm.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdppm.c' object='cjpeg-rdppm.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdppm.obj `if test -f 'rdppm.c'; then $(CYGPATH_W) 'rdppm.c'; else $(CYGPATH_W) '$(srcdir)/rdppm.c'; fi`\n\ncjpeg-rdswitch.o: rdswitch.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdswitch.o -MD -MP -MF $(DEPDIR)/cjpeg-rdswitch.Tpo -c -o cjpeg-rdswitch.o `test -f 'rdswitch.c' || echo '$(srcdir)/'`rdswitch.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/cjpeg-rdswitch.Tpo $(DEPDIR)/cjpeg-rdswitch.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdswitch.c' object='cjpeg-rdswitch.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdswitch.o `test -f 'rdswitch.c' || echo '$(srcdir)/'`rdswitch.c\n\ncjpeg-rdswitch.obj: rdswitch.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdswitch.obj -MD -MP -MF $(DEPDIR)/cjpeg-rdswitch.Tpo -c -o cjpeg-rdswitch.obj `if test -f 'rdswitch.c'; then $(CYGPATH_W) 'rdswitch.c'; else $(CYGPATH_W) '$(srcdir)/rdswitch.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/cjpeg-rdswitch.Tpo $(DEPDIR)/cjpeg-rdswitch.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdswitch.c' object='cjpeg-rdswitch.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdswitch.obj `if test -f 'rdswitch.c'; then $(CYGPATH_W) 'rdswitch.c'; else $(CYGPATH_W) '$(srcdir)/rdswitch.c'; fi`\n\ncjpeg-rdbmp.o: rdbmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdbmp.o -MD -MP -MF $(DEPDIR)/cjpeg-rdbmp.Tpo -c -o cjpeg-rdbmp.o `test -f 'rdbmp.c' || echo '$(srcdir)/'`rdbmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/cjpeg-rdbmp.Tpo $(DEPDIR)/cjpeg-rdbmp.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdbmp.c' object='cjpeg-rdbmp.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdbmp.o `test -f 'rdbmp.c' || echo '$(srcdir)/'`rdbmp.c\n\ncjpeg-rdbmp.obj: rdbmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdbmp.obj -MD -MP -MF $(DEPDIR)/cjpeg-rdbmp.Tpo -c -o cjpeg-rdbmp.obj `if test -f 'rdbmp.c'; then $(CYGPATH_W) 'rdbmp.c'; else $(CYGPATH_W) '$(srcdir)/rdbmp.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/cjpeg-rdbmp.Tpo $(DEPDIR)/cjpeg-rdbmp.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdbmp.c' object='cjpeg-rdbmp.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdbmp.obj `if test -f 'rdbmp.c'; then $(CYGPATH_W) 'rdbmp.c'; else $(CYGPATH_W) '$(srcdir)/rdbmp.c'; fi`\n\ncjpeg-rdtarga.o: rdtarga.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdtarga.o -MD -MP -MF $(DEPDIR)/cjpeg-rdtarga.Tpo -c -o cjpeg-rdtarga.o `test -f 'rdtarga.c' || echo '$(srcdir)/'`rdtarga.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/cjpeg-rdtarga.Tpo $(DEPDIR)/cjpeg-rdtarga.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdtarga.c' object='cjpeg-rdtarga.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdtarga.o `test -f 'rdtarga.c' || echo '$(srcdir)/'`rdtarga.c\n\ncjpeg-rdtarga.obj: rdtarga.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdtarga.obj -MD -MP -MF $(DEPDIR)/cjpeg-rdtarga.Tpo -c -o cjpeg-rdtarga.obj `if test -f 'rdtarga.c'; then $(CYGPATH_W) 'rdtarga.c'; else $(CYGPATH_W) '$(srcdir)/rdtarga.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/cjpeg-rdtarga.Tpo $(DEPDIR)/cjpeg-rdtarga.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdtarga.c' object='cjpeg-rdtarga.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdtarga.obj `if test -f 'rdtarga.c'; then $(CYGPATH_W) 'rdtarga.c'; else $(CYGPATH_W) '$(srcdir)/rdtarga.c'; fi`\n\ndjpeg-cdjpeg.o: cdjpeg.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-cdjpeg.o -MD -MP -MF $(DEPDIR)/djpeg-cdjpeg.Tpo -c -o djpeg-cdjpeg.o `test -f 'cdjpeg.c' || echo '$(srcdir)/'`cdjpeg.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-cdjpeg.Tpo $(DEPDIR)/djpeg-cdjpeg.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='cdjpeg.c' object='djpeg-cdjpeg.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-cdjpeg.o `test -f 'cdjpeg.c' || echo '$(srcdir)/'`cdjpeg.c\n\ndjpeg-cdjpeg.obj: cdjpeg.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-cdjpeg.obj -MD -MP -MF $(DEPDIR)/djpeg-cdjpeg.Tpo -c -o djpeg-cdjpeg.obj `if test -f 'cdjpeg.c'; then $(CYGPATH_W) 'cdjpeg.c'; else $(CYGPATH_W) '$(srcdir)/cdjpeg.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-cdjpeg.Tpo $(DEPDIR)/djpeg-cdjpeg.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='cdjpeg.c' object='djpeg-cdjpeg.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-cdjpeg.obj `if test -f 'cdjpeg.c'; then $(CYGPATH_W) 'cdjpeg.c'; else $(CYGPATH_W) '$(srcdir)/cdjpeg.c'; fi`\n\ndjpeg-djpeg.o: djpeg.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-djpeg.o -MD -MP -MF $(DEPDIR)/djpeg-djpeg.Tpo -c -o djpeg-djpeg.o `test -f 'djpeg.c' || echo '$(srcdir)/'`djpeg.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-djpeg.Tpo $(DEPDIR)/djpeg-djpeg.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='djpeg.c' object='djpeg-djpeg.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-djpeg.o `test -f 'djpeg.c' || echo '$(srcdir)/'`djpeg.c\n\ndjpeg-djpeg.obj: djpeg.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-djpeg.obj -MD -MP -MF $(DEPDIR)/djpeg-djpeg.Tpo -c -o djpeg-djpeg.obj `if test -f 'djpeg.c'; then $(CYGPATH_W) 'djpeg.c'; else $(CYGPATH_W) '$(srcdir)/djpeg.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-djpeg.Tpo $(DEPDIR)/djpeg-djpeg.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='djpeg.c' object='djpeg-djpeg.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-djpeg.obj `if test -f 'djpeg.c'; then $(CYGPATH_W) 'djpeg.c'; else $(CYGPATH_W) '$(srcdir)/djpeg.c'; fi`\n\ndjpeg-rdcolmap.o: rdcolmap.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-rdcolmap.o -MD -MP -MF $(DEPDIR)/djpeg-rdcolmap.Tpo -c -o djpeg-rdcolmap.o `test -f 'rdcolmap.c' || echo '$(srcdir)/'`rdcolmap.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-rdcolmap.Tpo $(DEPDIR)/djpeg-rdcolmap.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdcolmap.c' object='djpeg-rdcolmap.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-rdcolmap.o `test -f 'rdcolmap.c' || echo '$(srcdir)/'`rdcolmap.c\n\ndjpeg-rdcolmap.obj: rdcolmap.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-rdcolmap.obj -MD -MP -MF $(DEPDIR)/djpeg-rdcolmap.Tpo -c -o djpeg-rdcolmap.obj `if test -f 'rdcolmap.c'; then $(CYGPATH_W) 'rdcolmap.c'; else $(CYGPATH_W) '$(srcdir)/rdcolmap.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-rdcolmap.Tpo $(DEPDIR)/djpeg-rdcolmap.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdcolmap.c' object='djpeg-rdcolmap.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-rdcolmap.obj `if test -f 'rdcolmap.c'; then $(CYGPATH_W) 'rdcolmap.c'; else $(CYGPATH_W) '$(srcdir)/rdcolmap.c'; fi`\n\ndjpeg-rdswitch.o: rdswitch.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-rdswitch.o -MD -MP -MF $(DEPDIR)/djpeg-rdswitch.Tpo -c -o djpeg-rdswitch.o `test -f 'rdswitch.c' || echo '$(srcdir)/'`rdswitch.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-rdswitch.Tpo $(DEPDIR)/djpeg-rdswitch.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdswitch.c' object='djpeg-rdswitch.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-rdswitch.o `test -f 'rdswitch.c' || echo '$(srcdir)/'`rdswitch.c\n\ndjpeg-rdswitch.obj: rdswitch.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-rdswitch.obj -MD -MP -MF $(DEPDIR)/djpeg-rdswitch.Tpo -c -o djpeg-rdswitch.obj `if test -f 'rdswitch.c'; then $(CYGPATH_W) 'rdswitch.c'; else $(CYGPATH_W) '$(srcdir)/rdswitch.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-rdswitch.Tpo $(DEPDIR)/djpeg-rdswitch.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdswitch.c' object='djpeg-rdswitch.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-rdswitch.obj `if test -f 'rdswitch.c'; then $(CYGPATH_W) 'rdswitch.c'; else $(CYGPATH_W) '$(srcdir)/rdswitch.c'; fi`\n\ndjpeg-wrgif.o: wrgif.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrgif.o -MD -MP -MF $(DEPDIR)/djpeg-wrgif.Tpo -c -o djpeg-wrgif.o `test -f 'wrgif.c' || echo '$(srcdir)/'`wrgif.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-wrgif.Tpo $(DEPDIR)/djpeg-wrgif.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='wrgif.c' object='djpeg-wrgif.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrgif.o `test -f 'wrgif.c' || echo '$(srcdir)/'`wrgif.c\n\ndjpeg-wrgif.obj: wrgif.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrgif.obj -MD -MP -MF $(DEPDIR)/djpeg-wrgif.Tpo -c -o djpeg-wrgif.obj `if test -f 'wrgif.c'; then $(CYGPATH_W) 'wrgif.c'; else $(CYGPATH_W) '$(srcdir)/wrgif.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-wrgif.Tpo $(DEPDIR)/djpeg-wrgif.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='wrgif.c' object='djpeg-wrgif.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrgif.obj `if test -f 'wrgif.c'; then $(CYGPATH_W) 'wrgif.c'; else $(CYGPATH_W) '$(srcdir)/wrgif.c'; fi`\n\ndjpeg-wrppm.o: wrppm.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrppm.o -MD -MP -MF $(DEPDIR)/djpeg-wrppm.Tpo -c -o djpeg-wrppm.o `test -f 'wrppm.c' || echo '$(srcdir)/'`wrppm.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-wrppm.Tpo $(DEPDIR)/djpeg-wrppm.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='wrppm.c' object='djpeg-wrppm.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrppm.o `test -f 'wrppm.c' || echo '$(srcdir)/'`wrppm.c\n\ndjpeg-wrppm.obj: wrppm.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrppm.obj -MD -MP -MF $(DEPDIR)/djpeg-wrppm.Tpo -c -o djpeg-wrppm.obj `if test -f 'wrppm.c'; then $(CYGPATH_W) 'wrppm.c'; else $(CYGPATH_W) '$(srcdir)/wrppm.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-wrppm.Tpo $(DEPDIR)/djpeg-wrppm.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='wrppm.c' object='djpeg-wrppm.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrppm.obj `if test -f 'wrppm.c'; then $(CYGPATH_W) 'wrppm.c'; else $(CYGPATH_W) '$(srcdir)/wrppm.c'; fi`\n\ndjpeg-wrbmp.o: wrbmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrbmp.o -MD -MP -MF $(DEPDIR)/djpeg-wrbmp.Tpo -c -o djpeg-wrbmp.o `test -f 'wrbmp.c' || echo '$(srcdir)/'`wrbmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-wrbmp.Tpo $(DEPDIR)/djpeg-wrbmp.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='wrbmp.c' object='djpeg-wrbmp.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrbmp.o `test -f 'wrbmp.c' || echo '$(srcdir)/'`wrbmp.c\n\ndjpeg-wrbmp.obj: wrbmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrbmp.obj -MD -MP -MF $(DEPDIR)/djpeg-wrbmp.Tpo -c -o djpeg-wrbmp.obj `if test -f 'wrbmp.c'; then $(CYGPATH_W) 'wrbmp.c'; else $(CYGPATH_W) '$(srcdir)/wrbmp.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-wrbmp.Tpo $(DEPDIR)/djpeg-wrbmp.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='wrbmp.c' object='djpeg-wrbmp.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrbmp.obj `if test -f 'wrbmp.c'; then $(CYGPATH_W) 'wrbmp.c'; else $(CYGPATH_W) '$(srcdir)/wrbmp.c'; fi`\n\ndjpeg-wrtarga.o: wrtarga.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrtarga.o -MD -MP -MF $(DEPDIR)/djpeg-wrtarga.Tpo -c -o djpeg-wrtarga.o `test -f 'wrtarga.c' || echo '$(srcdir)/'`wrtarga.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-wrtarga.Tpo $(DEPDIR)/djpeg-wrtarga.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='wrtarga.c' object='djpeg-wrtarga.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrtarga.o `test -f 'wrtarga.c' || echo '$(srcdir)/'`wrtarga.c\n\ndjpeg-wrtarga.obj: wrtarga.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrtarga.obj -MD -MP -MF $(DEPDIR)/djpeg-wrtarga.Tpo -c -o djpeg-wrtarga.obj `if test -f 'wrtarga.c'; then $(CYGPATH_W) 'wrtarga.c'; else $(CYGPATH_W) '$(srcdir)/wrtarga.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/djpeg-wrtarga.Tpo $(DEPDIR)/djpeg-wrtarga.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='wrtarga.c' object='djpeg-wrtarga.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrtarga.obj `if test -f 'wrtarga.c'; then $(CYGPATH_W) 'wrtarga.c'; else $(CYGPATH_W) '$(srcdir)/wrtarga.c'; fi`\n\ntjbench-tjbench.o: tjbench.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-tjbench.o -MD -MP -MF $(DEPDIR)/tjbench-tjbench.Tpo -c -o tjbench-tjbench.o `test -f 'tjbench.c' || echo '$(srcdir)/'`tjbench.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/tjbench-tjbench.Tpo $(DEPDIR)/tjbench-tjbench.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='tjbench.c' object='tjbench-tjbench.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-tjbench.o `test -f 'tjbench.c' || echo '$(srcdir)/'`tjbench.c\n\ntjbench-tjbench.obj: tjbench.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-tjbench.obj -MD -MP -MF $(DEPDIR)/tjbench-tjbench.Tpo -c -o tjbench-tjbench.obj `if test -f 'tjbench.c'; then $(CYGPATH_W) 'tjbench.c'; else $(CYGPATH_W) '$(srcdir)/tjbench.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/tjbench-tjbench.Tpo $(DEPDIR)/tjbench-tjbench.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='tjbench.c' object='tjbench-tjbench.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-tjbench.obj `if test -f 'tjbench.c'; then $(CYGPATH_W) 'tjbench.c'; else $(CYGPATH_W) '$(srcdir)/tjbench.c'; fi`\n\ntjbench-bmp.o: bmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-bmp.o -MD -MP -MF $(DEPDIR)/tjbench-bmp.Tpo -c -o tjbench-bmp.o `test -f 'bmp.c' || echo '$(srcdir)/'`bmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/tjbench-bmp.Tpo $(DEPDIR)/tjbench-bmp.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='bmp.c' object='tjbench-bmp.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-bmp.o `test -f 'bmp.c' || echo '$(srcdir)/'`bmp.c\n\ntjbench-bmp.obj: bmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-bmp.obj -MD -MP -MF $(DEPDIR)/tjbench-bmp.Tpo -c -o tjbench-bmp.obj `if test -f 'bmp.c'; then $(CYGPATH_W) 'bmp.c'; else $(CYGPATH_W) '$(srcdir)/bmp.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/tjbench-bmp.Tpo $(DEPDIR)/tjbench-bmp.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='bmp.c' object='tjbench-bmp.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-bmp.obj `if test -f 'bmp.c'; then $(CYGPATH_W) 'bmp.c'; else $(CYGPATH_W) '$(srcdir)/bmp.c'; fi`\n\ntjbench-tjutil.o: tjutil.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-tjutil.o -MD -MP -MF $(DEPDIR)/tjbench-tjutil.Tpo -c -o tjbench-tjutil.o `test -f 'tjutil.c' || echo '$(srcdir)/'`tjutil.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/tjbench-tjutil.Tpo $(DEPDIR)/tjbench-tjutil.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='tjutil.c' object='tjbench-tjutil.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-tjutil.o `test -f 'tjutil.c' || echo '$(srcdir)/'`tjutil.c\n\ntjbench-tjutil.obj: tjutil.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-tjutil.obj -MD -MP -MF $(DEPDIR)/tjbench-tjutil.Tpo -c -o tjbench-tjutil.obj `if test -f 'tjutil.c'; then $(CYGPATH_W) 'tjutil.c'; else $(CYGPATH_W) '$(srcdir)/tjutil.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/tjbench-tjutil.Tpo $(DEPDIR)/tjbench-tjutil.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='tjutil.c' object='tjbench-tjutil.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-tjutil.obj `if test -f 'tjutil.c'; then $(CYGPATH_W) 'tjutil.c'; else $(CYGPATH_W) '$(srcdir)/tjutil.c'; fi`\n\ntjbench-rdbmp.o: rdbmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-rdbmp.o -MD -MP -MF $(DEPDIR)/tjbench-rdbmp.Tpo -c -o tjbench-rdbmp.o `test -f 'rdbmp.c' || echo '$(srcdir)/'`rdbmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/tjbench-rdbmp.Tpo $(DEPDIR)/tjbench-rdbmp.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdbmp.c' object='tjbench-rdbmp.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-rdbmp.o `test -f 'rdbmp.c' || echo '$(srcdir)/'`rdbmp.c\n\ntjbench-rdbmp.obj: rdbmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-rdbmp.obj -MD -MP -MF $(DEPDIR)/tjbench-rdbmp.Tpo -c -o tjbench-rdbmp.obj `if test -f 'rdbmp.c'; then $(CYGPATH_W) 'rdbmp.c'; else $(CYGPATH_W) '$(srcdir)/rdbmp.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/tjbench-rdbmp.Tpo $(DEPDIR)/tjbench-rdbmp.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdbmp.c' object='tjbench-rdbmp.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-rdbmp.obj `if test -f 'rdbmp.c'; then $(CYGPATH_W) 'rdbmp.c'; else $(CYGPATH_W) '$(srcdir)/rdbmp.c'; fi`\n\ntjbench-rdppm.o: rdppm.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-rdppm.o -MD -MP -MF $(DEPDIR)/tjbench-rdppm.Tpo -c -o tjbench-rdppm.o `test -f 'rdppm.c' || echo '$(srcdir)/'`rdppm.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/tjbench-rdppm.Tpo $(DEPDIR)/tjbench-rdppm.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdppm.c' object='tjbench-rdppm.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-rdppm.o `test -f 'rdppm.c' || echo '$(srcdir)/'`rdppm.c\n\ntjbench-rdppm.obj: rdppm.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-rdppm.obj -MD -MP -MF $(DEPDIR)/tjbench-rdppm.Tpo -c -o tjbench-rdppm.obj `if test -f 'rdppm.c'; then $(CYGPATH_W) 'rdppm.c'; else $(CYGPATH_W) '$(srcdir)/rdppm.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/tjbench-rdppm.Tpo $(DEPDIR)/tjbench-rdppm.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='rdppm.c' object='tjbench-rdppm.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-rdppm.obj `if test -f 'rdppm.c'; then $(CYGPATH_W) 'rdppm.c'; else $(CYGPATH_W) '$(srcdir)/rdppm.c'; fi`\n\ntjbench-wrbmp.o: wrbmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-wrbmp.o -MD -MP -MF $(DEPDIR)/tjbench-wrbmp.Tpo -c -o tjbench-wrbmp.o `test -f 'wrbmp.c' || echo '$(srcdir)/'`wrbmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/tjbench-wrbmp.Tpo $(DEPDIR)/tjbench-wrbmp.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='wrbmp.c' object='tjbench-wrbmp.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-wrbmp.o `test -f 'wrbmp.c' || echo '$(srcdir)/'`wrbmp.c\n\ntjbench-wrbmp.obj: wrbmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-wrbmp.obj -MD -MP -MF $(DEPDIR)/tjbench-wrbmp.Tpo -c -o tjbench-wrbmp.obj `if test -f 'wrbmp.c'; then $(CYGPATH_W) 'wrbmp.c'; else $(CYGPATH_W) '$(srcdir)/wrbmp.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/tjbench-wrbmp.Tpo $(DEPDIR)/tjbench-wrbmp.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='wrbmp.c' object='tjbench-wrbmp.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-wrbmp.obj `if test -f 'wrbmp.c'; then $(CYGPATH_W) 'wrbmp.c'; else $(CYGPATH_W) '$(srcdir)/wrbmp.c'; fi`\n\ntjbench-wrppm.o: wrppm.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-wrppm.o -MD -MP -MF $(DEPDIR)/tjbench-wrppm.Tpo -c -o tjbench-wrppm.o `test -f 'wrppm.c' || echo '$(srcdir)/'`wrppm.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/tjbench-wrppm.Tpo $(DEPDIR)/tjbench-wrppm.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='wrppm.c' object='tjbench-wrppm.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-wrppm.o `test -f 'wrppm.c' || echo '$(srcdir)/'`wrppm.c\n\ntjbench-wrppm.obj: wrppm.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-wrppm.obj -MD -MP -MF $(DEPDIR)/tjbench-wrppm.Tpo -c -o tjbench-wrppm.obj `if test -f 'wrppm.c'; then $(CYGPATH_W) 'wrppm.c'; else $(CYGPATH_W) '$(srcdir)/wrppm.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/tjbench-wrppm.Tpo $(DEPDIR)/tjbench-wrppm.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='wrppm.c' object='tjbench-wrppm.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-wrppm.obj `if test -f 'wrppm.c'; then $(CYGPATH_W) 'wrppm.c'; else $(CYGPATH_W) '$(srcdir)/wrppm.c'; fi`\n\nmostlyclean-libtool:\n\t-rm -f *.lo\n\nclean-libtool:\n\t-rm -rf .libs _libs\n\ndistclean-libtool:\n\t-rm -f libtool config.lt\ninstall-man1: $(dist_man1_MANS)\n\t@$(NORMAL_INSTALL)\n\t@list1='$(dist_man1_MANS)'; \\\n\tlist2=''; \\\n\ttest -n \"$(man1dir)\" \\\n\t  && test -n \"`echo $$list1$$list2`\" \\\n\t  || exit 0; \\\n\techo \" $(MKDIR_P) '$(DESTDIR)$(man1dir)'\"; \\\n\t$(MKDIR_P) \"$(DESTDIR)$(man1dir)\" || exit 1; \\\n\t{ for i in $$list1; do echo \"$$i\"; done;  \\\n\tif test -n \"$$list2\"; then \\\n\t  for i in $$list2; do echo \"$$i\"; done \\\n\t    | sed -n '/\\.1[a-z]*$$/p'; \\\n\tfi; \\\n\t} | while read p; do \\\n\t  if test -f $$p; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t  echo \"$$d$$p\"; echo \"$$p\"; \\\n\tdone | \\\n\tsed -e 'n;s,.*/,,;p;h;s,.*\\.,,;s,^[^1][0-9a-z]*$$,1,;x' \\\n\t      -e 's,\\.[0-9a-z]*$$,,;$(transform);G;s,\\n,.,' | \\\n\tsed 'N;N;s,\\n, ,g' | { \\\n\tlist=; while read file base inst; do \\\n\t  if test \"$$base\" = \"$$inst\"; then list=\"$$list $$file\"; else \\\n\t    echo \" $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'\"; \\\n\t    $(INSTALL_DATA) \"$$file\" \"$(DESTDIR)$(man1dir)/$$inst\" || exit $$?; \\\n\t  fi; \\\n\tdone; \\\n\tfor i in $$list; do echo \"$$i\"; done | $(am__base_list) | \\\n\twhile read files; do \\\n\t  test -z \"$$files\" || { \\\n\t    echo \" $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'\"; \\\n\t    $(INSTALL_DATA) $$files \"$(DESTDIR)$(man1dir)\" || exit $$?; }; \\\n\tdone; }\n\nuninstall-man1:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(dist_man1_MANS)'; test -n \"$(man1dir)\" || exit 0; \\\n\tfiles=`{ for i in $$list; do echo \"$$i\"; done; \\\n\t} | sed -e 's,.*/,,;h;s,.*\\.,,;s,^[^1][0-9a-z]*$$,1,;x' \\\n\t      -e 's,\\.[0-9a-z]*$$,,;$(transform);G;s,\\n,.,'`; \\\n\tdir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)\ninstall-dist_docDATA: $(dist_doc_DATA)\n\t@$(NORMAL_INSTALL)\n\t@list='$(dist_doc_DATA)'; test -n \"$(docdir)\" || list=; \\\n\tif test -n \"$$list\"; then \\\n\t  echo \" $(MKDIR_P) '$(DESTDIR)$(docdir)'\"; \\\n\t  $(MKDIR_P) \"$(DESTDIR)$(docdir)\" || exit 1; \\\n\tfi; \\\n\tfor p in $$list; do \\\n\t  if test -f \"$$p\"; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t  echo \"$$d$$p\"; \\\n\tdone | $(am__base_list) | \\\n\twhile read files; do \\\n\t  echo \" $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'\"; \\\n\t  $(INSTALL_DATA) $$files \"$(DESTDIR)$(docdir)\" || exit $$?; \\\n\tdone\n\nuninstall-dist_docDATA:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(dist_doc_DATA)'; test -n \"$(docdir)\" || list=; \\\n\tfiles=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \\\n\tdir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)\ninstall-dist_exampleDATA: $(dist_example_DATA)\n\t@$(NORMAL_INSTALL)\n\t@list='$(dist_example_DATA)'; test -n \"$(exampledir)\" || list=; \\\n\tif test -n \"$$list\"; then \\\n\t  echo \" $(MKDIR_P) '$(DESTDIR)$(exampledir)'\"; \\\n\t  $(MKDIR_P) \"$(DESTDIR)$(exampledir)\" || exit 1; \\\n\tfi; \\\n\tfor p in $$list; do \\\n\t  if test -f \"$$p\"; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t  echo \"$$d$$p\"; \\\n\tdone | $(am__base_list) | \\\n\twhile read files; do \\\n\t  echo \" $(INSTALL_DATA) $$files '$(DESTDIR)$(exampledir)'\"; \\\n\t  $(INSTALL_DATA) $$files \"$(DESTDIR)$(exampledir)\" || exit $$?; \\\n\tdone\n\nuninstall-dist_exampleDATA:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(dist_example_DATA)'; test -n \"$(exampledir)\" || list=; \\\n\tfiles=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \\\n\tdir='$(DESTDIR)$(exampledir)'; $(am__uninstall_files_from_dir)\ninstall-pkgconfigDATA: $(pkgconfig_DATA)\n\t@$(NORMAL_INSTALL)\n\t@list='$(pkgconfig_DATA)'; test -n \"$(pkgconfigdir)\" || list=; \\\n\tif test -n \"$$list\"; then \\\n\t  echo \" $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'\"; \\\n\t  $(MKDIR_P) \"$(DESTDIR)$(pkgconfigdir)\" || exit 1; \\\n\tfi; \\\n\tfor p in $$list; do \\\n\t  if test -f \"$$p\"; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t  echo \"$$d$$p\"; \\\n\tdone | $(am__base_list) | \\\n\twhile read files; do \\\n\t  echo \" $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'\"; \\\n\t  $(INSTALL_DATA) $$files \"$(DESTDIR)$(pkgconfigdir)\" || exit $$?; \\\n\tdone\n\nuninstall-pkgconfigDATA:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(pkgconfig_DATA)'; test -n \"$(pkgconfigdir)\" || list=; \\\n\tfiles=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \\\n\tdir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)\ninstall-includeHEADERS: $(include_HEADERS)\n\t@$(NORMAL_INSTALL)\n\t@list='$(include_HEADERS)'; test -n \"$(includedir)\" || list=; \\\n\tif test -n \"$$list\"; then \\\n\t  echo \" $(MKDIR_P) '$(DESTDIR)$(includedir)'\"; \\\n\t  $(MKDIR_P) \"$(DESTDIR)$(includedir)\" || exit 1; \\\n\tfi; \\\n\tfor p in $$list; do \\\n\t  if test -f \"$$p\"; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t  echo \"$$d$$p\"; \\\n\tdone | $(am__base_list) | \\\n\twhile read files; do \\\n\t  echo \" $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'\"; \\\n\t  $(INSTALL_HEADER) $$files \"$(DESTDIR)$(includedir)\" || exit $$?; \\\n\tdone\n\nuninstall-includeHEADERS:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(include_HEADERS)'; test -n \"$(includedir)\" || list=; \\\n\tfiles=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \\\n\tdir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)\ninstall-nodist_includeHEADERS: $(nodist_include_HEADERS)\n\t@$(NORMAL_INSTALL)\n\t@list='$(nodist_include_HEADERS)'; test -n \"$(includedir)\" || list=; \\\n\tif test -n \"$$list\"; then \\\n\t  echo \" $(MKDIR_P) '$(DESTDIR)$(includedir)'\"; \\\n\t  $(MKDIR_P) \"$(DESTDIR)$(includedir)\" || exit 1; \\\n\tfi; \\\n\tfor p in $$list; do \\\n\t  if test -f \"$$p\"; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t  echo \"$$d$$p\"; \\\n\tdone | $(am__base_list) | \\\n\twhile read files; do \\\n\t  echo \" $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'\"; \\\n\t  $(INSTALL_HEADER) $$files \"$(DESTDIR)$(includedir)\" || exit $$?; \\\n\tdone\n\nuninstall-nodist_includeHEADERS:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(nodist_include_HEADERS)'; test -n \"$(includedir)\" || list=; \\\n\tfiles=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \\\n\tdir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)\n\n# This directory's subdirectories are mostly independent; you can cd\n# into them and run 'make' without going through this Makefile.\n# To change the values of 'make' variables: instead of editing Makefiles,\n# (1) if the variable is set in 'config.status', edit 'config.status'\n#     (which will cause the Makefiles to be regenerated when you run 'make');\n# (2) otherwise, pass the desired values on the 'make' command line.\n$(am__recursive_targets):\n\t@fail=; \\\n\tif $(am__make_keepgoing); then \\\n\t  failcom='fail=yes'; \\\n\telse \\\n\t  failcom='exit 1'; \\\n\tfi; \\\n\tdot_seen=no; \\\n\ttarget=`echo $@ | sed s/-recursive//`; \\\n\tcase \"$@\" in \\\n\t  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \\\n\t  *) list='$(SUBDIRS)' ;; \\\n\tesac; \\\n\tfor subdir in $$list; do \\\n\t  echo \"Making $$target in $$subdir\"; \\\n\t  if test \"$$subdir\" = \".\"; then \\\n\t    dot_seen=yes; \\\n\t    local_target=\"$$target-am\"; \\\n\t  else \\\n\t    local_target=\"$$target\"; \\\n\t  fi; \\\n\t  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \\\n\t  || eval $$failcom; \\\n\tdone; \\\n\tif test \"$$dot_seen\" = \"no\"; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) \"$$target-am\" || exit 1; \\\n\tfi; test -z \"$$fail\"\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-recursive\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\tif ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \\\n\t  include_option=--etags-include; \\\n\t  empty_fix=.; \\\n\telse \\\n\t  include_option=--include; \\\n\t  empty_fix=; \\\n\tfi; \\\n\tlist='$(SUBDIRS)'; for subdir in $$list; do \\\n\t  if test \"$$subdir\" = .; then :; else \\\n\t    test ! -f $$subdir/TAGS || \\\n\t      set \"$$@\" \"$$include_option=$$here/$$subdir/TAGS\"; \\\n\t  fi; \\\n\tdone; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-recursive\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscope: cscope.files\n\ttest ! -s cscope.files \\\n\t  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)\nclean-cscope:\n\t-rm -f cscope.files\ncscope.files: clean-cscope cscopelist\ncscopelist: cscopelist-recursive\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\n\t-rm -f cscope.out cscope.in.out cscope.po.out cscope.files\n\ndistdir: $(DISTFILES)\n\t$(am__remove_distdir)\n\ttest -d \"$(distdir)\" || mkdir \"$(distdir)\"\n\t@srcdirstrip=`echo \"$(srcdir)\" | sed 's/[].[^$$\\\\*]/\\\\\\\\&/g'`; \\\n\ttopsrcdirstrip=`echo \"$(top_srcdir)\" | sed 's/[].[^$$\\\\*]/\\\\\\\\&/g'`; \\\n\tlist='$(DISTFILES)'; \\\n\t  dist_files=`for file in $$list; do echo $$file; done | \\\n\t  sed -e \"s|^$$srcdirstrip/||;t\" \\\n\t      -e \"s|^$$topsrcdirstrip/|$(top_builddir)/|;t\"`; \\\n\tcase $$dist_files in \\\n\t  */*) $(MKDIR_P) `echo \"$$dist_files\" | \\\n\t\t\t   sed '/\\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \\\n\t\t\t   sort -u` ;; \\\n\tesac; \\\n\tfor file in $$dist_files; do \\\n\t  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n\t  if test -d $$d/$$file; then \\\n\t    dir=`echo \"/$$file\" | sed -e 's,/[^/]*$$,,'`; \\\n\t    if test -d \"$(distdir)/$$file\"; then \\\n\t      find \"$(distdir)/$$file\" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n\t    fi; \\\n\t    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n\t      cp -fpR $(srcdir)/$$file \"$(distdir)$$dir\" || exit 1; \\\n\t      find \"$(distdir)/$$file\" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n\t    fi; \\\n\t    cp -fpR $$d/$$file \"$(distdir)$$dir\" || exit 1; \\\n\t  else \\\n\t    test -f \"$(distdir)/$$file\" \\\n\t    || cp -p $$d/$$file \"$(distdir)/$$file\" \\\n\t    || exit 1; \\\n\t  fi; \\\n\tdone\n\t@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \\\n\t  if test \"$$subdir\" = .; then :; else \\\n\t    $(am__make_dryrun) \\\n\t      || test -d \"$(distdir)/$$subdir\" \\\n\t      || $(MKDIR_P) \"$(distdir)/$$subdir\" \\\n\t      || exit 1; \\\n\t    dir1=$$subdir; dir2=\"$(distdir)/$$subdir\"; \\\n\t    $(am__relativize); \\\n\t    new_distdir=$$reldir; \\\n\t    dir1=$$subdir; dir2=\"$(top_distdir)\"; \\\n\t    $(am__relativize); \\\n\t    new_top_distdir=$$reldir; \\\n\t    echo \" (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=\"$$new_top_distdir\" distdir=\"$$new_distdir\" \\\\\"; \\\n\t    echo \"     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)\"; \\\n\t    ($(am__cd) $$subdir && \\\n\t      $(MAKE) $(AM_MAKEFLAGS) \\\n\t        top_distdir=\"$$new_top_distdir\" \\\n\t        distdir=\"$$new_distdir\" \\\n\t\tam__remove_distdir=: \\\n\t\tam__skip_length_check=: \\\n\t\tam__skip_mode_fix=: \\\n\t        distdir) \\\n\t      || exit 1; \\\n\t  fi; \\\n\tdone\n\t$(MAKE) $(AM_MAKEFLAGS) \\\n\t  top_distdir=\"$(top_distdir)\" distdir=\"$(distdir)\" \\\n\t  dist-hook\n\t-test -n \"$(am__skip_mode_fix)\" \\\n\t|| find \"$(distdir)\" -type d ! -perm -755 \\\n\t\t-exec chmod u+rwx,go+rx {} \\; -o \\\n\t  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \\; -o \\\n\t  ! -type d ! -perm -400 -exec chmod a+r {} \\; -o \\\n\t  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \\; \\\n\t|| chmod -R a+r \"$(distdir)\"\ndist-gzip: distdir\n\ttardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz\n\t$(am__post_remove_distdir)\ndist-bzip2: distdir\n\ttardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2\n\t$(am__post_remove_distdir)\n\ndist-lzip: distdir\n\ttardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz\n\t$(am__post_remove_distdir)\n\ndist-xz: distdir\n\ttardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz\n\t$(am__post_remove_distdir)\n\ndist-tarZ: distdir\n\t@echo WARNING: \"Support for distribution archives compressed with\" \\\n\t\t       \"legacy program 'compress' is deprecated.\" >&2\n\t@echo WARNING: \"It will be removed altogether in Automake 2.0\" >&2\n\ttardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z\n\t$(am__post_remove_distdir)\n\ndist-shar: distdir\n\t@echo WARNING: \"Support for shar distribution archives is\" \\\n\t               \"deprecated.\" >&2\n\t@echo WARNING: \"It will be removed altogether in Automake 2.0\" >&2\n\tshar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz\n\t$(am__post_remove_distdir)\n\ndist-zip: distdir\n\t-rm -f $(distdir).zip\n\tzip -rq $(distdir).zip $(distdir)\n\t$(am__post_remove_distdir)\n\ndist dist-all:\n\t$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'\n\t$(am__post_remove_distdir)\n\n# This target untars the dist file and tries a VPATH configuration.  Then\n# it guarantees that the distribution is self-contained by making another\n# tarfile.\ndistcheck: dist\n\tcase '$(DIST_ARCHIVES)' in \\\n\t*.tar.gz*) \\\n\t  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\\\n\t*.tar.bz2*) \\\n\t  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\\\n\t*.tar.lz*) \\\n\t  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\\\n\t*.tar.xz*) \\\n\t  xz -dc $(distdir).tar.xz | $(am__untar) ;;\\\n\t*.tar.Z*) \\\n\t  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\\\n\t*.shar.gz*) \\\n\t  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\\\n\t*.zip*) \\\n\t  unzip $(distdir).zip ;;\\\n\tesac\n\tchmod -R a-w $(distdir)\n\tchmod u+w $(distdir)\n\tmkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst\n\tchmod a-w $(distdir)\n\ttest -d $(distdir)/_build || exit 0; \\\n\tdc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\\\/]:[\\\\/],/,'` \\\n\t  && dc_destdir=\"$${TMPDIR-/tmp}/am-dc-$$$$/\" \\\n\t  && am__cwd=`pwd` \\\n\t  && $(am__cd) $(distdir)/_build/sub \\\n\t  && ../../configure \\\n\t    $(AM_DISTCHECK_CONFIGURE_FLAGS) \\\n\t    $(DISTCHECK_CONFIGURE_FLAGS) \\\n\t    --srcdir=../.. --prefix=\"$$dc_install_base\" \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) dvi \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) check \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) install \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) installcheck \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) uninstall \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir=\"$$dc_install_base\" \\\n\t        distuninstallcheck \\\n\t  && chmod -R a-w \"$$dc_install_base\" \\\n\t  && ({ \\\n\t       (cd ../.. && umask 077 && mkdir \"$$dc_destdir\") \\\n\t       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR=\"$$dc_destdir\" install \\\n\t       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR=\"$$dc_destdir\" uninstall \\\n\t       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR=\"$$dc_destdir\" \\\n\t            distuninstallcheck_dir=\"$$dc_destdir\" distuninstallcheck; \\\n\t      } || { rm -rf \"$$dc_destdir\"; exit 1; }) \\\n\t  && rm -rf \"$$dc_destdir\" \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) dist \\\n\t  && rm -rf $(DIST_ARCHIVES) \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \\\n\t  && cd \"$$am__cwd\" \\\n\t  || exit 1\n\t$(am__post_remove_distdir)\n\t@(echo \"$(distdir) archives ready for distribution: \"; \\\n\t  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \\\n\t  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'\ndistuninstallcheck:\n\t@test -n '$(distuninstallcheck_dir)' || { \\\n\t  echo 'ERROR: trying to run $@ with an empty' \\\n\t       '$$(distuninstallcheck_dir)' >&2; \\\n\t  exit 1; \\\n\t}; \\\n\t$(am__cd) '$(distuninstallcheck_dir)' || { \\\n\t  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \\\n\t  exit 1; \\\n\t}; \\\n\ttest `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \\\n\t   || { echo \"ERROR: files left after uninstall:\" ; \\\n\t        if test -n \"$(DESTDIR)\"; then \\\n\t          echo \"  (check DESTDIR support)\"; \\\n\t        fi ; \\\n\t        $(distuninstallcheck_listfiles) ; \\\n\t        exit 1; } >&2\ndistcleancheck: distclean\n\t@if test '$(srcdir)' = . ; then \\\n\t  echo \"ERROR: distcleancheck can only run from a VPATH build\" ; \\\n\t  exit 1 ; \\\n\tfi\n\t@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \\\n\t  || { echo \"ERROR: files left in build directory after distclean:\" ; \\\n\t       $(distcleancheck_listfiles) ; \\\n\t       exit 1; } >&2\ncheck-am: all-am\ncheck: check-recursive\nall-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) \\\n\t\tconfig.h jconfig.h jconfigint.h\ninstall-binPROGRAMS: install-libLTLIBRARIES\n\ninstalldirs: installdirs-recursive\ninstalldirs-am:\n\tfor dir in \"$(DESTDIR)$(libdir)\" \"$(DESTDIR)$(bindir)\" \"$(DESTDIR)$(man1dir)\" \"$(DESTDIR)$(docdir)\" \"$(DESTDIR)$(exampledir)\" \"$(DESTDIR)$(pkgconfigdir)\" \"$(DESTDIR)$(includedir)\" \"$(DESTDIR)$(includedir)\"; do \\\n\t  test -z \"$$dir\" || $(MKDIR_P) \"$$dir\"; \\\n\tdone\ninstall: install-recursive\ninstall-exec: install-exec-recursive\ninstall-data: install-data-recursive\nuninstall: uninstall-recursive\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-recursive\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-recursive\n\nclean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \\\n\tclean-libtool clean-noinstPROGRAMS mostlyclean-am\n\ndistclean: distclean-recursive\n\t-rm -f $(am__CONFIG_DISTCLEAN_FILES)\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-hdr distclean-libtool distclean-tags\n\ndvi: dvi-recursive\n\ndvi-am:\n\nhtml: html-recursive\n\nhtml-am:\n\ninfo: info-recursive\n\ninfo-am:\n\ninstall-data-am: install-dist_docDATA install-dist_exampleDATA \\\n\tinstall-includeHEADERS install-man \\\n\tinstall-nodist_includeHEADERS install-pkgconfigDATA\n\ninstall-dvi: install-dvi-recursive\n\ninstall-dvi-am:\n\ninstall-exec-am: install-binPROGRAMS install-libLTLIBRARIES\n\ninstall-html: install-html-recursive\n\ninstall-html-am:\n\ninstall-info: install-info-recursive\n\ninstall-info-am:\n\ninstall-man: install-man1\n\ninstall-pdf: install-pdf-recursive\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-recursive\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-recursive\n\t-rm -f $(am__CONFIG_DISTCLEAN_FILES)\n\t-rm -rf $(top_srcdir)/autom4te.cache\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-recursive\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n\tmostlyclean-libtool\n\npdf: pdf-recursive\n\npdf-am:\n\nps: ps-recursive\n\nps-am:\n\nuninstall-am: uninstall-binPROGRAMS uninstall-dist_docDATA \\\n\tuninstall-dist_exampleDATA uninstall-includeHEADERS \\\n\tuninstall-libLTLIBRARIES uninstall-man \\\n\tuninstall-nodist_includeHEADERS uninstall-pkgconfigDATA\n\nuninstall-man: uninstall-man1\n\n.MAKE: $(am__recursive_targets) all install-am install-strip\n\n.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \\\n\tam--refresh check check-am clean clean-binPROGRAMS \\\n\tclean-cscope clean-generic clean-libLTLIBRARIES clean-libtool \\\n\tclean-noinstPROGRAMS cscope cscopelist-am ctags ctags-am dist \\\n\tdist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \\\n\tdist-tarZ dist-xz dist-zip distcheck distclean \\\n\tdistclean-compile distclean-generic distclean-hdr \\\n\tdistclean-libtool distclean-tags distcleancheck distdir \\\n\tdistuninstallcheck dvi dvi-am html html-am info info-am \\\n\tinstall install-am install-binPROGRAMS install-data \\\n\tinstall-data-am install-dist_docDATA install-dist_exampleDATA \\\n\tinstall-dvi install-dvi-am install-exec install-exec-am \\\n\tinstall-html install-html-am install-includeHEADERS \\\n\tinstall-info install-info-am install-libLTLIBRARIES \\\n\tinstall-man install-man1 install-nodist_includeHEADERS \\\n\tinstall-pdf install-pdf-am install-pkgconfigDATA install-ps \\\n\tinstall-ps-am install-strip installcheck installcheck-am \\\n\tinstalldirs installdirs-am maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \\\n\ttags tags-am uninstall uninstall-am uninstall-binPROGRAMS \\\n\tuninstall-dist_docDATA uninstall-dist_exampleDATA \\\n\tuninstall-includeHEADERS uninstall-libLTLIBRARIES \\\n\tuninstall-man uninstall-man1 uninstall-nodist_includeHEADERS \\\n\tuninstall-pkgconfigDATA\n\n.PRECIOUS: Makefile\n\n\ndist-hook:\n\trm -rf `find $(distdir) -name .svn`\n\n.PHONY: test\ntest: tjquicktest tjbittest bittest\n\n@CROSS_COMPILING_TRUE@tjquicktest: testclean\n@CROSS_COMPILING_FALSE@tjquicktest: testclean all\n\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -bi\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -noyuvpad\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -bi\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -bi -noyuvpad\n@WITH_TURBOJPEG_TRUE@\t./tjunittest\n@WITH_TURBOJPEG_TRUE@\t./tjunittest -alloc\n@WITH_TURBOJPEG_TRUE@\t./tjunittest -yuv\n@WITH_TURBOJPEG_TRUE@\t./tjunittest -yuv -alloc\n@WITH_TURBOJPEG_TRUE@\t./tjunittest -yuv -noyuvpad\n\techo GREAT SUCCESS!\n\n@CROSS_COMPILING_TRUE@tjbittest: testclean\n@CROSS_COMPILING_FALSE@tjbittest: testclean all\n\n# Test compressing from/decompressing to an arbitrary subregion of a larger\n# image buffer\n@WITH_TURBOJPEG_TRUE@\tcp $(srcdir)/testimages/testorig.ppm testout_tile.ppm\n@WITH_TURBOJPEG_TRUE@\t./tjbench testout_tile.ppm 95 -rgb -quiet -tile -benchtime 0.01 >/dev/null 2>&1\n@WITH_TURBOJPEG_TRUE@\tfor i in 8 16 32 64 128; do \\\n@WITH_TURBOJPEG_TRUE@\t\tmd5/md5cmp $(MD5_PPM_GRAY_TILE) testout_tile_GRAY_Q95_$$i\\x$$i.ppm; \\\n@WITH_TURBOJPEG_TRUE@\tdone\n@WITH_TURBOJPEG_TRUE@\tmd5/md5cmp $(MD5_PPM_420_8x8_TILE) testout_tile_420_Q95_8x8.ppm\n@WITH_TURBOJPEG_TRUE@\tmd5/md5cmp $(MD5_PPM_420_16x16_TILE) testout_tile_420_Q95_16x16.ppm\n@WITH_TURBOJPEG_TRUE@\tmd5/md5cmp $(MD5_PPM_420_32x32_TILE) testout_tile_420_Q95_32x32.ppm\n@WITH_TURBOJPEG_TRUE@\tmd5/md5cmp $(MD5_PPM_420_64x64_TILE) testout_tile_420_Q95_64x64.ppm\n@WITH_TURBOJPEG_TRUE@\tmd5/md5cmp $(MD5_PPM_420_128x128_TILE) testout_tile_420_Q95_128x128.ppm\n@WITH_TURBOJPEG_TRUE@\tmd5/md5cmp $(MD5_PPM_422_8x8_TILE) testout_tile_422_Q95_8x8.ppm\n@WITH_TURBOJPEG_TRUE@\tmd5/md5cmp $(MD5_PPM_422_16x16_TILE) testout_tile_422_Q95_16x16.ppm\n@WITH_TURBOJPEG_TRUE@\tmd5/md5cmp $(MD5_PPM_422_32x32_TILE) testout_tile_422_Q95_32x32.ppm\n@WITH_TURBOJPEG_TRUE@\tmd5/md5cmp $(MD5_PPM_422_64x64_TILE) testout_tile_422_Q95_64x64.ppm\n@WITH_TURBOJPEG_TRUE@\tmd5/md5cmp $(MD5_PPM_422_128x128_TILE) testout_tile_422_Q95_128x128.ppm\n@WITH_TURBOJPEG_TRUE@\tfor i in 8 16 32 64 128; do \\\n@WITH_TURBOJPEG_TRUE@\t\tmd5/md5cmp $(MD5_PPM_444_TILE) testout_tile_444_Q95_$$i\\x$$i.ppm; \\\n@WITH_TURBOJPEG_TRUE@\tdone\n@WITH_TURBOJPEG_TRUE@\trm -f testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_*\n\n@WITH_TURBOJPEG_TRUE@\t./tjbench testout_tile.ppm 95 -rgb -fastupsample -quiet -tile -benchtime 0.01 >/dev/null 2>&1\n@WITH_TURBOJPEG_TRUE@\tmd5/md5cmp $(MD5_PPM_420M_8x8_TILE) testout_tile_420_Q95_8x8.ppm\n@WITH_TURBOJPEG_TRUE@\tfor i in 16 32 64 128; do \\\n@WITH_TURBOJPEG_TRUE@\t\tmd5/md5cmp $(MD5_PPM_420M_TILE) testout_tile_420_Q95_$$i\\x$$i.ppm; \\\n@WITH_TURBOJPEG_TRUE@\tdone\n@WITH_TURBOJPEG_TRUE@\tmd5/md5cmp $(MD5_PPM_422M_8x8_TILE) testout_tile_422_Q95_8x8.ppm\n@WITH_TURBOJPEG_TRUE@\tfor i in 16 32 64 128; do \\\n@WITH_TURBOJPEG_TRUE@\t\tmd5/md5cmp $(MD5_PPM_422M_TILE) testout_tile_422_Q95_$$i\\x$$i.ppm; \\\n@WITH_TURBOJPEG_TRUE@\tdone\n@WITH_TURBOJPEG_TRUE@\trm -f testout_tile_GRAY_* testout_tile_420_* testout_tile_422_* testout_tile_444_* testout_tile.ppm\n@WITH_TURBOJPEG_TRUE@\techo GREAT SUCCESS!\n\n@CROSS_COMPILING_TRUE@bittest: testclean\n@CROSS_COMPILING_FALSE@bittest: testclean all\n\n# These tests are carefully crafted to provide full coverage of as many of the\n# underlying algorithms as possible (including all of the SIMD-accelerated\n# ones.)\n\n# CC: null  SAMP: fullsize  FDCT: islow  ENT: huff\n\t./cjpeg -rgb -dct int -outfile testout_rgb_islow.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_RGB_ISLOW) testout_rgb_islow.jpg\n# CC: null  SAMP: fullsize  IDCT: islow  ENT: huff\n\t./djpeg -dct int -ppm -outfile testout_rgb_islow.ppm testout_rgb_islow.jpg\n\tmd5/md5cmp $(MD5_PPM_RGB_ISLOW) testout_rgb_islow.ppm\n\trm -f testout_rgb_islow.ppm\n@WITH_12BIT_TRUE@\trm -f testout_rgb_islow.jpg\n# CC: RGB->RGB565  SAMP: fullsize  IDCT: islow  ENT: huff\n@WITH_12BIT_FALSE@\t./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_rgb_islow_565.bmp testout_rgb_islow.jpg\n@WITH_12BIT_FALSE@\tmd5/md5cmp $(MD5_BMP_RGB_ISLOW_565) testout_rgb_islow_565.bmp\n@WITH_12BIT_FALSE@\trm -f testout_rgb_islow_565.bmp\n# CC: RGB->RGB565 (dithered)  SAMP: fullsize  IDCT: islow  ENT: huff\n@WITH_12BIT_FALSE@\t./djpeg -dct int -rgb565 -bmp -outfile testout_rgb_islow_565D.bmp testout_rgb_islow.jpg\n@WITH_12BIT_FALSE@\tmd5/md5cmp $(MD5_BMP_RGB_ISLOW_565D) testout_rgb_islow_565D.bmp\n@WITH_12BIT_FALSE@\trm -f testout_rgb_islow_565D.bmp testout_rgb_islow.jpg\n\n# CC: RGB->YCC  SAMP: fullsize/h2v1  FDCT: ifast  ENT: 2-pass huff\n\t./cjpeg -sample 2x1 -dct fast -opt -outfile testout_422_ifast_opt.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_422_IFAST_OPT) testout_422_ifast_opt.jpg\n# CC: YCC->RGB  SAMP: fullsize/h2v1 fancy  IDCT: ifast  ENT: huff\n\t./djpeg -dct fast -outfile testout_422_ifast.ppm testout_422_ifast_opt.jpg\n\tmd5/md5cmp $(MD5_PPM_422_IFAST) testout_422_ifast.ppm\n\trm -f testout_422_ifast.ppm\n# CC: YCC->RGB  SAMP: h2v1 merged  IDCT: ifast  ENT: huff\n\t./djpeg -dct fast -nosmooth -outfile testout_422m_ifast.ppm testout_422_ifast_opt.jpg\n\tmd5/md5cmp $(MD5_PPM_422M_IFAST) testout_422m_ifast.ppm\n\trm -f testout_422m_ifast.ppm\n@WITH_12BIT_TRUE@\trm -f testout_422_ifast_opt.jpg\n# CC: YCC->RGB565  SAMP: h2v1 merged  IDCT: ifast  ENT: huff\n@WITH_12BIT_FALSE@\t./djpeg -dct int -nosmooth -rgb565 -dither none -bmp -outfile testout_422m_ifast_565.bmp testout_422_ifast_opt.jpg\n@WITH_12BIT_FALSE@\tmd5/md5cmp $(MD5_BMP_422M_IFAST_565) testout_422m_ifast_565.bmp\n@WITH_12BIT_FALSE@\trm -f testout_422m_ifast_565.bmp\n# CC: YCC->RGB565 (dithered)  SAMP: h2v1 merged  IDCT: ifast  ENT: huff\n@WITH_12BIT_FALSE@\t./djpeg -dct int -nosmooth -rgb565 -bmp -outfile testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg\n@WITH_12BIT_FALSE@\tmd5/md5cmp $(MD5_BMP_422M_IFAST_565D) testout_422m_ifast_565D.bmp\n@WITH_12BIT_FALSE@\trm -f testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg\n\n# CC: RGB->YCC  SAMP: fullsize/h2v2  FDCT: ifast  ENT: prog huff\n\t./cjpeg -sample 2x2 -quality 100 -dct fast -prog -outfile testout_420_q100_ifast_prog.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_420_IFAST_Q100_PROG) testout_420_q100_ifast_prog.jpg\n# CC: YCC->RGB  SAMP: fullsize/h2v2 fancy  IDCT: ifast  ENT: prog huff\n\t./djpeg -dct fast -outfile testout_420_q100_ifast.ppm testout_420_q100_ifast_prog.jpg\n\tmd5/md5cmp $(MD5_PPM_420_Q100_IFAST) testout_420_q100_ifast.ppm\n\trm -f testout_420_q100_ifast.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: ifast  ENT: prog huff\n\t./djpeg -dct fast -nosmooth -outfile testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg\n\tmd5/md5cmp $(MD5_PPM_420M_Q100_IFAST) testout_420m_q100_ifast.ppm\n\trm -f testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg\n\n# CC: RGB->Gray  SAMP: fullsize  FDCT: islow  ENT: huff\n\t./cjpeg -gray -dct int -outfile testout_gray_islow.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_GRAY_ISLOW) testout_gray_islow.jpg\n# CC: Gray->Gray  SAMP: fullsize  IDCT: islow  ENT: huff\n\t./djpeg -dct int -outfile testout_gray_islow.ppm testout_gray_islow.jpg\n\tmd5/md5cmp $(MD5_PPM_GRAY_ISLOW) testout_gray_islow.ppm\n\trm -f testout_gray_islow.ppm\n# CC: Gray->RGB  SAMP: fullsize  IDCT: islow  ENT: huff\n\t./djpeg -dct int -rgb -outfile testout_gray_islow_rgb.ppm testout_gray_islow.jpg\n\tmd5/md5cmp $(MD5_PPM_GRAY_ISLOW_RGB) testout_gray_islow_rgb.ppm\n\trm -f testout_gray_islow_rgb.ppm\n@WITH_12BIT_TRUE@\trm -f testout_gray_islow.jpg\n# CC: Gray->RGB565  SAMP: fullsize  IDCT: islow  ENT: huff\n@WITH_12BIT_FALSE@\t./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_gray_islow_565.bmp testout_gray_islow.jpg\n@WITH_12BIT_FALSE@\tmd5/md5cmp $(MD5_BMP_GRAY_ISLOW_565) testout_gray_islow_565.bmp\n@WITH_12BIT_FALSE@\trm -f testout_gray_islow_565.bmp\n# CC: Gray->RGB565 (dithered)  SAMP: fullsize  IDCT: islow  ENT: huff\n@WITH_12BIT_FALSE@\t./djpeg -dct int -rgb565 -bmp -outfile testout_gray_islow_565D.bmp testout_gray_islow.jpg\n@WITH_12BIT_FALSE@\tmd5/md5cmp $(MD5_BMP_GRAY_ISLOW_565D) testout_gray_islow_565D.bmp\n@WITH_12BIT_FALSE@\trm -f testout_gray_islow_565D.bmp testout_gray_islow.jpg\n\n# CC: RGB->YCC  SAMP: fullsize smooth/h2v2 smooth  FDCT: islow\n# ENT: 2-pass huff\n\t./cjpeg -sample 2x2 -smooth 1 -dct int -opt -outfile testout_420s_ifast_opt.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_420S_IFAST_OPT) testout_420s_ifast_opt.jpg\n\trm -f testout_420s_ifast_opt.jpg\n\n# The output of the floating point tests is not validated by default, because\n# the output differs depending on the type of floating point math used, and\n# this is only deterministic if the DCT/IDCT are implemented using SIMD\n# instructions on a particular platform.  Pass one of the following on the make\n# command line to validate the floating point tests against one of the expected\n# results:\n#\n# FLOATTEST=sse  validate against the expected results from the libjpeg-turbo\n#                SSE SIMD extensions\n# FLOATTEST=32bit  validate against the expected results from the C code\n#                  when running on a 32-bit FPU (or when SSE is being used for\n#                  floating point math, which is generally the default with\n#                  x86-64 compilers)\n# FLOATTEST=64bit  validate against the exepected results from the C code\n#                  when running on a 64-bit FPU\n\n# CC: RGB->YCC  SAMP: fullsize/int  FDCT: float  ENT: prog huff\n\t./cjpeg -sample 3x2 -dct float -prog -outfile testout_3x2_float_prog.jpg $(srcdir)/testimages/testorig.ppm\n\tif [ \"${FLOATTEST}\" = \"sse\" ]; then \\\n\t\tmd5/md5cmp $(MD5_JPEG_3x2_FLOAT_PROG_SSE) testout_3x2_float_prog.jpg; \\\n\telif [ \"${FLOATTEST}\" = \"32bit\" -o \"${FLOATTEST}\" = \"64bit\" ]; then \\\n\t\tmd5/md5cmp $(MD5_JPEG_3x2_FLOAT_PROG_32BIT) testout_3x2_float_prog.jpg; \\\n\tfi\n# CC: YCC->RGB  SAMP: fullsize/int  IDCT: float  ENT: prog huff\n\t./djpeg -dct float -outfile testout_3x2_float.ppm testout_3x2_float_prog.jpg\n\tif [ \"${FLOATTEST}\" = \"sse\" ]; then \\\n\t\tmd5/md5cmp $(MD5_PPM_3x2_FLOAT_SSE) testout_3x2_float.ppm; \\\n\telif [ \"${FLOATTEST}\" = \"32bit\" ]; then \\\n\t\tmd5/md5cmp $(MD5_PPM_3x2_FLOAT_32BIT) testout_3x2_float.ppm; \\\n\telif [ \"${FLOATTEST}\" = \"64bit\" ]; then \\\n\t\tmd5/md5cmp $(MD5_PPM_3x2_FLOAT_64BIT) testout_3x2_float.ppm; \\\n\tfi\n\trm -f testout_3x2_float.ppm testout_3x2_float_prog.jpg\n\n# CC: RGB->YCC  SAMP: fullsize/int  FDCT: ifast  ENT: prog huff\n\t./cjpeg -sample 3x2 -dct fast -prog -outfile testout_3x2_ifast_prog.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_3x2_IFAST_PROG) testout_3x2_ifast_prog.jpg\n# CC: YCC->RGB  SAMP: fullsize/int  IDCT: ifast  ENT: prog huff\n\t./djpeg -dct fast -outfile testout_3x2_ifast.ppm testout_3x2_ifast_prog.jpg\n\tmd5/md5cmp $(MD5_PPM_3x2_IFAST) testout_3x2_ifast.ppm\n\trm -f testout_3x2_ifast.ppm testout_3x2_ifast_prog.jpg\n\n# CC: YCC->RGB  SAMP: fullsize/h2v2  FDCT: islow  ENT: arith\n@WITH_ARITH_ENC_TRUE@\t./cjpeg -dct int -arithmetic -outfile testout_420_islow_ari.jpg $(srcdir)/testimages/testorig.ppm\n@WITH_ARITH_ENC_TRUE@\tmd5/md5cmp $(MD5_JPEG_420_ISLOW_ARI) testout_420_islow_ari.jpg\n@WITH_ARITH_ENC_TRUE@\trm -f testout_420_islow_ari.jpg\n@WITH_ARITH_ENC_TRUE@\t./jpegtran -arithmetic -outfile testout_420_islow_ari.jpg $(srcdir)/testimages/testimgint.jpg\n@WITH_ARITH_ENC_TRUE@\tmd5/md5cmp $(MD5_JPEG_420_ISLOW_ARI) testout_420_islow_ari.jpg\n@WITH_ARITH_ENC_TRUE@\trm -f testout_420_islow_ari.jpg\n# CC: YCC->RGB  SAMP: fullsize  FDCT: islow  ENT: prog arith\n@WITH_ARITH_ENC_TRUE@\t./cjpeg -sample 1x1 -dct int -prog -arithmetic -outfile testout_444_islow_progari.jpg $(srcdir)/testimages/testorig.ppm\n@WITH_ARITH_ENC_TRUE@\tmd5/md5cmp $(MD5_JPEG_444_ISLOW_PROGARI) testout_444_islow_progari.jpg\n@WITH_ARITH_ENC_TRUE@\trm -f testout_444_islow_progari.jpg\n# CC: RGB->YCC  SAMP: h2v2 merged  IDCT: ifast  ENT: arith\n@WITH_ARITH_DEC_TRUE@\t./djpeg -fast -ppm -outfile testout_420m_ifast_ari.ppm $(srcdir)/testimages/testimgari.jpg\n@WITH_ARITH_DEC_TRUE@\tmd5/md5cmp $(MD5_PPM_420M_IFAST_ARI) testout_420m_ifast_ari.ppm\n@WITH_ARITH_DEC_TRUE@\trm -f testout_420m_ifast_ari.ppm\n@WITH_ARITH_DEC_TRUE@\t./jpegtran -outfile testout_420_islow.jpg $(srcdir)/testimages/testimgari.jpg\n@WITH_ARITH_DEC_TRUE@\tmd5/md5cmp $(MD5_JPEG_420_ISLOW) testout_420_islow.jpg\n@WITH_ARITH_DEC_TRUE@\trm -f testout_420_islow.jpg\n\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 16x16 islow  ENT: huff\n\t./djpeg -dct int -scale 2/1 -nosmooth -ppm -outfile testout_420m_islow_2_1.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_2_1) testout_420m_islow_2_1.ppm\n\trm -f testout_420m_islow_2_1.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 15x15 islow  ENT: huff\n\t./djpeg -dct int -scale 15/8 -nosmooth -ppm -outfile testout_420m_islow_15_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_15_8) testout_420m_islow_15_8.ppm\n\trm -f testout_420m_islow_15_8.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 13x13 islow  ENT: huff\n\t./djpeg -dct int -scale 13/8 -nosmooth -ppm -outfile testout_420m_islow_13_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_13_8) testout_420m_islow_13_8.ppm\n\trm -f testout_420m_islow_13_8.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 11x11 islow  ENT: huff\n\t./djpeg -dct int -scale 11/8 -nosmooth -ppm -outfile testout_420m_islow_11_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_11_8) testout_420m_islow_11_8.ppm\n\trm -f testout_420m_islow_11_8.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 9x9 islow  ENT: huff\n\t./djpeg -dct int -scale 9/8 -nosmooth -ppm -outfile testout_420m_islow_9_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_9_8) testout_420m_islow_9_8.ppm\n\trm -f testout_420m_islow_9_8.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 7x7 islow/14x14 islow  ENT: huff\n\t./djpeg -dct int -scale 7/8 -nosmooth -ppm -outfile testout_420m_islow_7_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_7_8) testout_420m_islow_7_8.ppm\n\trm -f testout_420m_islow_7_8.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 6x6 islow/12x12 islow  ENT: huff\n\t./djpeg -dct int -scale 3/4 -nosmooth -ppm -outfile testout_420m_islow_3_4.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_3_4) testout_420m_islow_3_4.ppm\n\trm -f testout_420m_islow_3_4.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 5x5 islow/10x10 islow  ENT: huff\n\t./djpeg -dct int -scale 5/8 -nosmooth -ppm -outfile testout_420m_islow_5_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_5_8) testout_420m_islow_5_8.ppm\n\trm -f testout_420m_islow_5_8.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 4x4 islow/8x8 islow  ENT: huff\n\t./djpeg -dct int -scale 1/2 -nosmooth -ppm -outfile testout_420m_islow_1_2.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_1_2) testout_420m_islow_1_2.ppm\n\trm -f testout_420m_islow_1_2.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 3x3 islow/6x6 islow  ENT: huff\n\t./djpeg -dct int -scale 3/8 -nosmooth -ppm -outfile testout_420m_islow_3_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_3_8) testout_420m_islow_3_8.ppm\n\trm -f testout_420m_islow_3_8.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 2x2 islow/4x4 islow  ENT: huff\n\t./djpeg -dct int -scale 1/4 -nosmooth -ppm -outfile testout_420m_islow_1_4.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_1_4) testout_420m_islow_1_4.ppm\n\trm -f testout_420m_islow_1_4.ppm\n# CC: YCC->RGB  SAMP: h2v2 merged  IDCT: 1x1 islow/2x2 islow  ENT: huff\n\t./djpeg -dct int -scale 1/8 -nosmooth -ppm -outfile testout_420m_islow_1_8.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420M_ISLOW_1_8) testout_420m_islow_1_8.ppm\n\trm -f testout_420m_islow_1_8.ppm\n# CC: YCC->RGB (dithered)  SAMP: h2v2 fancy  IDCT: islow  ENT: huff\n@WITH_12BIT_FALSE@\t./djpeg -dct int -colors 256 -bmp -outfile testout_420_islow_256.bmp $(srcdir)/testimages/$(TESTORIG)\n@WITH_12BIT_FALSE@\tmd5/md5cmp $(MD5_BMP_420_ISLOW_256) testout_420_islow_256.bmp\n@WITH_12BIT_FALSE@\trm -f testout_420_islow_256.bmp\n# CC: YCC->RGB565  SAMP: h2v2 fancy  IDCT: islow  ENT: huff\n@WITH_12BIT_FALSE@\t./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_420_islow_565.bmp $(srcdir)/testimages/$(TESTORIG)\n@WITH_12BIT_FALSE@\tmd5/md5cmp $(MD5_BMP_420_ISLOW_565) testout_420_islow_565.bmp\n@WITH_12BIT_FALSE@\trm -f testout_420_islow_565.bmp\n# CC: YCC->RGB565 (dithered)  SAMP: h2v2 fancy  IDCT: islow  ENT: huff\n@WITH_12BIT_FALSE@\t./djpeg -dct int -rgb565 -bmp -outfile testout_420_islow_565D.bmp $(srcdir)/testimages/$(TESTORIG)\n@WITH_12BIT_FALSE@\tmd5/md5cmp $(MD5_BMP_420_ISLOW_565D) testout_420_islow_565D.bmp\n@WITH_12BIT_FALSE@\trm -f testout_420_islow_565D.bmp\n# CC: YCC->RGB565  SAMP: h2v2 merged  IDCT: islow  ENT: huff\n@WITH_12BIT_FALSE@\t./djpeg -dct int -nosmooth -rgb565 -dither none -bmp -outfile testout_420m_islow_565.bmp $(srcdir)/testimages/$(TESTORIG)\n@WITH_12BIT_FALSE@\tmd5/md5cmp $(MD5_BMP_420M_ISLOW_565) testout_420m_islow_565.bmp\n@WITH_12BIT_FALSE@\trm -f testout_420m_islow_565.bmp\n# CC: YCC->RGB565 (dithered)  SAMP: h2v2 merged  IDCT: islow  ENT: huff\n@WITH_12BIT_FALSE@\t./djpeg -dct int -nosmooth -rgb565 -bmp -outfile testout_420m_islow_565D.bmp $(srcdir)/testimages/$(TESTORIG)\n@WITH_12BIT_FALSE@\tmd5/md5cmp $(MD5_BMP_420M_ISLOW_565D) testout_420m_islow_565D.bmp\n@WITH_12BIT_FALSE@\trm -f testout_420m_islow_565D.bmp\n\n# Partial decode tests.  These tests are designed to cover all of the possible\n# code paths in jpeg_skip_scanlines().\n\n# Context rows: Yes  Intra-iMCU row: Yes  iMCU row prefetch: No   ENT: huff\n\t./djpeg -dct int -skip 15,31 -ppm -outfile testout_420_islow_skip15,31.ppm $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_PPM_420_ISLOW_SKIP15_31) testout_420_islow_skip15,31.ppm\n\trm -f testout_420_islow_skip15,31.ppm\n# Context rows: Yes  Intra-iMCU row: No   iMCU row prefetch: Yes  ENT: arith\n@WITH_ARITH_DEC_TRUE@\t./djpeg -dct int -skip 16,139 -ppm -outfile testout_420_islow_ari_skip16,139.ppm $(srcdir)/testimages/testimgari.jpg\n@WITH_ARITH_DEC_TRUE@\tmd5/md5cmp $(MD5_PPM_420_ISLOW_ARI_SKIP16_139) testout_420_islow_ari_skip16,139.ppm\n@WITH_ARITH_DEC_TRUE@\trm -f testout_420_islow_ari_skip16,139.ppm\n# Context rows: Yes  Intra-iMCU row: No   iMCU row prefetch: No   ENT: prog huff\n\t./cjpeg -dct int -prog -outfile testout_420_islow_prog.jpg $(srcdir)/testimages/testorig.ppm\n\t./djpeg -dct int -crop 62x62+71+71 -ppm -outfile testout_420_islow_prog_crop62x62,71,71.ppm testout_420_islow_prog.jpg\n\tmd5/md5cmp $(MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71) testout_420_islow_prog_crop62x62,71,71.ppm\n\trm -f testout_420_islow_prog_crop62x62,71,71.ppm testout_420_islow_prog.jpg\n# Context rows: Yes  Intra-iMCU row: No   iMCU row prefetch: No   ENT: arith\n@WITH_ARITH_DEC_TRUE@\t./djpeg -dct int -crop 53x53+4+4 -ppm -outfile testout_420_islow_ari_crop53x53,4,4.ppm $(srcdir)/testimages/testimgari.jpg\n@WITH_ARITH_DEC_TRUE@\tmd5/md5cmp $(MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4) testout_420_islow_ari_crop53x53,4,4.ppm\n@WITH_ARITH_DEC_TRUE@\trm -f testout_420_islow_ari_crop53x53,4,4.ppm\n# Context rows: No   Intra-iMCU row: Yes  ENT: huff\n\t./cjpeg -dct int -sample 1x1 -outfile testout_444_islow.jpg $(srcdir)/testimages/testorig.ppm\n\t./djpeg -dct int -skip 1,6 -ppm -outfile testout_444_islow_skip1,6.ppm testout_444_islow.jpg\n\tmd5/md5cmp $(MD5_PPM_444_ISLOW_SKIP1_6) testout_444_islow_skip1,6.ppm\n\trm -f testout_444_islow_skip1,6.ppm testout_444_islow.jpg\n# Context rows: No   Intra-iMCU row: No   ENT: prog huff\n\t./cjpeg -dct int -prog -sample 1x1 -outfile testout_444_islow_prog.jpg $(srcdir)/testimages/testorig.ppm\n\t./djpeg -dct int -crop 98x98+13+13 -ppm -outfile testout_444_islow_prog_crop98x98,13,13.ppm testout_444_islow_prog.jpg\n\tmd5/md5cmp $(MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13) testout_444_islow_prog_crop98x98,13,13.ppm\n\trm -f testout_444_islow_prog_crop98x98,13,13.ppm testout_444_islow_prog.jpg\n# Context rows: No   Intra-iMCU row: No   ENT: arith\n@WITH_ARITH_ENC_TRUE@\t./cjpeg -dct int -arithmetic -sample 1x1 -outfile testout_444_islow_ari.jpg $(srcdir)/testimages/testorig.ppm\n@WITH_ARITH_DEC_TRUE@@WITH_ARITH_ENC_TRUE@\t./djpeg -dct int -crop 37x37+0+0 -ppm -outfile testout_444_islow_ari_crop37x37,0,0.ppm testout_444_islow_ari.jpg\n@WITH_ARITH_DEC_TRUE@@WITH_ARITH_ENC_TRUE@\tmd5/md5cmp $(MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0) testout_444_islow_ari_crop37x37,0,0.ppm\n@WITH_ARITH_DEC_TRUE@@WITH_ARITH_ENC_TRUE@\trm -f testout_444_islow_ari_crop37x37,0,0.ppm\n@WITH_ARITH_ENC_TRUE@\trm -f testout_444_islow_ari.jpg\n\n\t./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testout_crop.jpg $(srcdir)/testimages/$(TESTORIG)\n\tmd5/md5cmp $(MD5_JPEG_CROP) testout_crop.jpg\n\trm -f testout_crop.jpg\n\techo GREAT SUCCESS!\n\ntestclean:\n\trm -f testout*\n\trm -f *_GRAY_*.bmp\n\trm -f *_GRAY_*.png\n\trm -f *_GRAY_*.ppm\n\trm -f *_GRAY_*.jpg\n\trm -f *_GRAY.yuv\n\trm -f *_420_*.bmp\n\trm -f *_420_*.png\n\trm -f *_420_*.ppm\n\trm -f *_420_*.jpg\n\trm -f *_420.yuv\n\trm -f *_422_*.bmp\n\trm -f *_422_*.png\n\trm -f *_422_*.ppm\n\trm -f *_422_*.jpg\n\trm -f *_422.yuv\n\trm -f *_444_*.bmp\n\trm -f *_444_*.png\n\trm -f *_444_*.ppm\n\trm -f *_444_*.jpg\n\trm -f *_444.yuv\n\trm -f *_440_*.bmp\n\trm -f *_440_*.png\n\trm -f *_440_*.ppm\n\trm -f *_440_*.jpg\n\trm -f *_440.yuv\n\trm -f *_411_*.bmp\n\trm -f *_411_*.png\n\trm -f *_411_*.ppm\n\trm -f *_411_*.jpg\n\trm -f *_411.yuv\n\ntjtest:\n\tsh ./tjbenchtest\n\tsh ./tjbenchtest -alloc\n\tsh ./tjbenchtest -yuv\n\tsh ./tjbenchtest -yuv -alloc\n@WITH_JAVA_TRUE@\tsh ./tjbenchtest.java\n@WITH_JAVA_TRUE@\tsh ./tjbenchtest.java -yuv\n\npkgscripts/libjpeg-turbo.spec: pkgscripts/libjpeg-turbo.spec.tmpl\n\tcat pkgscripts/libjpeg-turbo.spec.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__bindir}@$(bindir)@g | sed s@%{__datadir}@$(datadir)@g | \\\n\t\tsed s@%{__docdir}@$(docdir)@g | sed s@%{__includedir}@$(includedir)@g | \\\n\t\tsed s@%{__libdir}@$(libdir)@g | sed s@%{__mandir}@$(mandir)@g \\\n\t\t> pkgscripts/libjpeg-turbo.spec\n\nrpm: all pkgscripts/libjpeg-turbo.spec\n\tTMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \\\n\tmkdir -p $$TMPDIR/RPMS; \\\n\tln -fs `pwd` $$TMPDIR/BUILD; \\\n\trm -f ${PKGNAME}-${VERSION}.${RPMARCH}.rpm; \\\n\trpmbuild -bb --define \"_blddir $$TMPDIR/buildroot\"  \\\n\t\t--define \"_topdir $$TMPDIR\" \\\n\t\t--target ${RPMARCH} pkgscripts/libjpeg-turbo.spec; \\\n\tcp $$TMPDIR/RPMS/${RPMARCH}/${PKGNAME}-${VERSION}-${BUILD}.${RPMARCH}.rpm \\\n\t\t${PKGNAME}-${VERSION}.${RPMARCH}.rpm; \\\n\trm -rf $$TMPDIR\n\nsrpm: dist-gzip pkgscripts/libjpeg-turbo.spec\n\tTMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \\\n\tmkdir -p $$TMPDIR/RPMS; \\\n\tmkdir -p $$TMPDIR/SRPMS; \\\n\tmkdir -p $$TMPDIR/BUILD; \\\n\tmkdir -p $$TMPDIR/SOURCES; \\\n\tmkdir -p $$TMPDIR/SPECS; \\\n\trm -f ${PKGNAME}-${VERSION}.src.rpm; \\\n\tcp ${PACKAGE_NAME}-${VERSION}.tar.gz $$TMPDIR/SOURCES; \\\n\tcat pkgscripts/libjpeg-turbo.spec | sed s/%{_blddir}/%{_tmppath}/g \\\n\t\t| sed s/#--\\>//g \\\n\t\t> $$TMPDIR/SPECS/libjpeg-turbo.spec; \\\n\trpmbuild -bs --define \"_topdir $$TMPDIR\" $$TMPDIR/SPECS/libjpeg-turbo.spec; \\\n\tcp $$TMPDIR/SRPMS/${PKGNAME}-${VERSION}-${BUILD}.src.rpm \\\n\t\t${PKGNAME}-${VERSION}.src.rpm; \\\n\trm -rf $$TMPDIR\n\npkgscripts/makedpkg: pkgscripts/makedpkg.tmpl\n\tcat pkgscripts/makedpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__docdir}@$(docdir)@g | sed s@%{__libdir}@$(libdir)@g \\\n\t\t> pkgscripts/makedpkg\n\ndeb: all pkgscripts/makedpkg\n\tsh pkgscripts/makedpkg\n\npkgscripts/uninstall: pkgscripts/uninstall.tmpl\n\tcat pkgscripts/uninstall.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__bindir}@$(bindir)@g | sed s@%{__datadir}@$(datadir)@g | \\\n\t\tsed s@%{__includedir}@$(includedir)@g | sed s@%{__libdir}@$(libdir)@g | \\\n\t\tsed s@%{__mandir}@$(mandir)@g > pkgscripts/uninstall\n\npkgscripts/makemacpkg: pkgscripts/makemacpkg.tmpl\n\tcat pkgscripts/makemacpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__bindir}@$(bindir)@g | sed s@%{__docdir}@$(docdir)@g | \\\n\t\tsed s@%{__libdir}@$(libdir)@g > pkgscripts/makemacpkg\n\n@X86_64_TRUE@udmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n@X86_64_TRUE@\tsh pkgscripts/makemacpkg -build32 ${BUILDDIR32}\n\n@X86_64_TRUE@iosdmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n@X86_64_TRUE@\tsh pkgscripts/makemacpkg -build32 ${BUILDDIR32} -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S} -buildarmv8 ${BUILDDIRARMV8} -lipo \"${LIPO}\"\n\n@X86_64_FALSE@iosdmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n@X86_64_FALSE@\tsh pkgscripts/makemacpkg -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S} -buildarmv8 ${BUILDDIRARMV8} -lipo \"${LIPO}\"\n\ndmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n\tsh pkgscripts/makemacpkg\n\npkgscripts/makecygwinpkg: pkgscripts/makecygwinpkg.tmpl\n\tcat pkgscripts/makecygwinpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__docdir}@$(docdir)@g | sed s@%{__libdir}@$(libdir)@g \\\n\t\t> pkgscripts/makecygwinpkg\n\ncygwinpkg: all pkgscripts/makecygwinpkg\n\tsh pkgscripts/makecygwinpkg\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/README.ijg",
    "content": "libjpeg-turbo note:  This file has been modified by The libjpeg-turbo Project\nto include only information relevant to libjpeg-turbo, to wordsmith certain\nsections, and to remove impolitic language that existed in the libjpeg v8\nREADME.  It is included only for reference.  Please see README.md for\ninformation specific to libjpeg-turbo.\n\n\nThe Independent JPEG Group's JPEG software\n==========================================\n\nThis distribution contains a release of the Independent JPEG Group's free JPEG\nsoftware.  You are welcome to redistribute this software and to use it for any\npurpose, subject to the conditions under LEGAL ISSUES, below.\n\nThis software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,\nBill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,\nJulian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,\nand other members of the Independent JPEG Group.\n\nIJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee\n(also known as JPEG, together with ITU-T SG16).\n\n\nDOCUMENTATION ROADMAP\n=====================\n\nThis file contains the following sections:\n\nOVERVIEW            General description of JPEG and the IJG software.\nLEGAL ISSUES        Copyright, lack of warranty, terms of distribution.\nREFERENCES          Where to learn more about JPEG.\nARCHIVE LOCATIONS   Where to find newer versions of this software.\nFILE FORMAT WARS    Software *not* to get.\nTO DO               Plans for future IJG releases.\n\nOther documentation files in the distribution are:\n\nUser documentation:\n  usage.txt         Usage instructions for cjpeg, djpeg, jpegtran,\n                    rdjpgcom, and wrjpgcom.\n  *.1               Unix-style man pages for programs (same info as usage.txt).\n  wizard.txt        Advanced usage instructions for JPEG wizards only.\n  change.log        Version-to-version change highlights.\nProgrammer and internal documentation:\n  libjpeg.txt       How to use the JPEG library in your own programs.\n  example.c         Sample code for calling the JPEG library.\n  structure.txt     Overview of the JPEG library's internal structure.\n  coderules.txt     Coding style rules --- please read if you contribute code.\n\nPlease read at least usage.txt.  Some information can also be found in the JPEG\nFAQ (Frequently Asked Questions) article.  See ARCHIVE LOCATIONS below to find\nout where to obtain the FAQ article.\n\nIf you want to understand how the JPEG code works, we suggest reading one or\nmore of the REFERENCES, then looking at the documentation files (in roughly\nthe order listed) before diving into the code.\n\n\nOVERVIEW\n========\n\nThis package contains C software to implement JPEG image encoding, decoding,\nand transcoding.  JPEG (pronounced \"jay-peg\") is a standardized compression\nmethod for full-color and grayscale images.  JPEG's strong suit is compressing\nphotographic images or other types of images that have smooth color and\nbrightness transitions between neighboring pixels.  Images with sharp lines or\nother abrupt features may not compress well with JPEG, and a higher JPEG\nquality may have to be used to avoid visible compression artifacts with such\nimages.\n\nJPEG is lossy, meaning that the output pixels are not necessarily identical to\nthe input pixels.  However, on photographic content and other \"smooth\" images,\nvery good compression ratios can be obtained with no visible compression\nartifacts, and extremely high compression ratios are possible if you are\nwilling to sacrifice image quality (by reducing the \"quality\" setting in the\ncompressor.)\n\nThis software implements JPEG baseline, extended-sequential, and progressive\ncompression processes.  Provision is made for supporting all variants of these\nprocesses, although some uncommon parameter settings aren't implemented yet.\nWe have made no provision for supporting the hierarchical or lossless\nprocesses defined in the standard.\n\nWe provide a set of library routines for reading and writing JPEG image files,\nplus two sample applications \"cjpeg\" and \"djpeg\", which use the library to\nperform conversion between JPEG and some other popular image file formats.\nThe library is intended to be reused in other applications.\n\nIn order to support file conversion and viewing software, we have included\nconsiderable functionality beyond the bare JPEG coding/decoding capability;\nfor example, the color quantization modules are not strictly part of JPEG\ndecoding, but they are essential for output to colormapped file formats or\ncolormapped displays.  These extra functions can be compiled out of the\nlibrary if not required for a particular application.\n\nWe have also included \"jpegtran\", a utility for lossless transcoding between\ndifferent JPEG processes, and \"rdjpgcom\" and \"wrjpgcom\", two simple\napplications for inserting and extracting textual comments in JFIF files.\n\nThe emphasis in designing this software has been on achieving portability and\nflexibility, while also making it fast enough to be useful.  In particular,\nthe software is not intended to be read as a tutorial on JPEG.  (See the\nREFERENCES section for introductory material.)  Rather, it is intended to\nbe reliable, portable, industrial-strength code.  We do not claim to have\nachieved that goal in every aspect of the software, but we strive for it.\n\nWe welcome the use of this software as a component of commercial products.\nNo royalty is required, but we do ask for an acknowledgement in product\ndocumentation, as described under LEGAL ISSUES.\n\n\nLEGAL ISSUES\n============\n\nIn plain English:\n\n1. We don't promise that this software works.  (But if you find any bugs,\n   please let us know!)\n2. You can use this software for whatever you want.  You don't have to pay us.\n3. You may not pretend that you wrote this software.  If you use it in a\n   program, you must acknowledge somewhere in your documentation that\n   you've used the IJG code.\n\nIn legalese:\n\nThe authors make NO WARRANTY or representation, either express or implied,\nwith respect to this software, its quality, accuracy, merchantability, or\nfitness for a particular purpose.  This software is provided \"AS IS\", and you,\nits user, assume the entire risk as to its quality and accuracy.\n\nThis software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.\nAll Rights Reserved except as specified below.\n\nPermission is hereby granted to use, copy, modify, and distribute this\nsoftware (or portions thereof) for any purpose, without fee, subject to these\nconditions:\n(1) If any part of the source code for this software is distributed, then this\nREADME file must be included, with this copyright and no-warranty notice\nunaltered; and any additions, deletions, or changes to the original files\nmust be clearly indicated in accompanying documentation.\n(2) If only executable code is distributed, then the accompanying\ndocumentation must state that \"this software is based in part on the work of\nthe Independent JPEG Group\".\n(3) Permission for use of this software is granted only if the user accepts\nfull responsibility for any undesirable consequences; the authors accept\nNO LIABILITY for damages of any kind.\n\nThese conditions apply to any software derived from or based on the IJG code,\nnot just to the unmodified library.  If you use our work, you ought to\nacknowledge us.\n\nPermission is NOT granted for the use of any IJG author's name or company name\nin advertising or publicity relating to this software or products derived from\nit.  This software may be referred to only as \"the Independent JPEG Group's\nsoftware\".\n\nWe specifically permit and encourage the use of this software as the basis of\ncommercial products, provided that all warranty or liability claims are\nassumed by the product vendor.\n\n\nThe Unix configuration script \"configure\" was produced with GNU Autoconf.\nIt is copyright by the Free Software Foundation but is freely distributable.\nThe same holds for its supporting scripts (config.guess, config.sub,\nltmain.sh).  Another support script, install-sh, is copyright by X Consortium\nbut is also freely distributable.\n\nThe IJG distribution formerly included code to read and write GIF files.\nTo avoid entanglement with the Unisys LZW patent (now expired), GIF reading\nsupport has been removed altogether, and the GIF writer has been simplified\nto produce \"uncompressed GIFs\".  This technique does not use the LZW\nalgorithm; the resulting GIF files are larger than usual, but are readable\nby all standard GIF decoders.\n\nWe are required to state that\n    \"The Graphics Interchange Format(c) is the Copyright property of\n    CompuServe Incorporated.  GIF(sm) is a Service Mark property of\n    CompuServe Incorporated.\"\n\n\nREFERENCES\n==========\n\nWe recommend reading one or more of these references before trying to\nunderstand the innards of the JPEG software.\n\nThe best short technical introduction to the JPEG compression algorithm is\n\tWallace, Gregory K.  \"The JPEG Still Picture Compression Standard\",\n\tCommunications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.\n(Adjacent articles in that issue discuss MPEG motion picture compression,\napplications of JPEG, and related topics.)  If you don't have the CACM issue\nhandy, a PDF file containing a revised version of Wallace's article is\navailable at http://www.ijg.org/files/Wallace.JPEG.pdf.  The file (actually\na preprint for an article that appeared in IEEE Trans. Consumer Electronics)\nomits the sample images that appeared in CACM, but it includes corrections\nand some added material.  Note: the Wallace article is copyright ACM and IEEE,\nand it may not be used for commercial purposes.\n\nA somewhat less technical, more leisurely introduction to JPEG can be found in\n\"The Data Compression Book\" by Mark Nelson and Jean-loup Gailly, published by\nM&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1.  This book provides\ngood explanations and example C code for a multitude of compression methods\nincluding JPEG.  It is an excellent source if you are comfortable reading C\ncode but don't know much about data compression in general.  The book's JPEG\nsample code is far from industrial-strength, but when you are ready to look\nat a full implementation, you've got one here...\n\nThe best currently available description of JPEG is the textbook \"JPEG Still\nImage Data Compression Standard\" by William B. Pennebaker and Joan L.\nMitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.\nPrice US$59.95, 638 pp.  The book includes the complete text of the ISO JPEG\nstandards (DIS 10918-1 and draft DIS 10918-2).\n\nThe original JPEG standard is divided into two parts, Part 1 being the actual\nspecification, while Part 2 covers compliance testing methods.  Part 1 is\ntitled \"Digital Compression and Coding of Continuous-tone Still Images,\nPart 1: Requirements and guidelines\" and has document numbers ISO/IEC IS\n10918-1, ITU-T T.81.  Part 2 is titled \"Digital Compression and Coding of\nContinuous-tone Still Images, Part 2: Compliance testing\" and has document\nnumbers ISO/IEC IS 10918-2, ITU-T T.83.\n\nThe JPEG standard does not specify all details of an interchangeable file\nformat.  For the omitted details we follow the \"JFIF\" conventions, revision\n1.02.  JFIF 1.02 has been adopted as an Ecma International Technical Report\nand thus received a formal publication status.  It is available as a free\ndownload in PDF format from\nhttp://www.ecma-international.org/publications/techreports/E-TR-098.htm.\nA PostScript version of the JFIF document is available at\nhttp://www.ijg.org/files/jfif.ps.gz.  There is also a plain text version at\nhttp://www.ijg.org/files/jfif.txt.gz, but it is missing the figures.\n\nThe TIFF 6.0 file format specification can be obtained by FTP from\nftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz.  The JPEG incorporation scheme\nfound in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.\nIJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).\nInstead, we recommend the JPEG design proposed by TIFF Technical Note #2\n(Compression tag 7).  Copies of this Note can be obtained from\nhttp://www.ijg.org/files/.  It is expected that the next revision\nof the TIFF spec will replace the 6.0 JPEG design with the Note's design.\nAlthough IJG's own code does not support TIFF/JPEG, the free libtiff library\nuses our library to implement TIFF/JPEG per the Note.\n\n\nARCHIVE LOCATIONS\n=================\n\nThe \"official\" archive site for this software is www.ijg.org.\nThe most recent released version can always be found there in\ndirectory \"files\".\n\nThe JPEG FAQ (Frequently Asked Questions) article is a source of some\ngeneral information about JPEG.\nIt is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/\nand other news.answers archive sites, including the official news.answers\narchive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.\nIf you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu\nwith body\n\tsend usenet/news.answers/jpeg-faq/part1\n\tsend usenet/news.answers/jpeg-faq/part2\n\n\nFILE FORMAT WARS\n================\n\nThe ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together\nwith ITU-T SG16) currently promotes different formats containing the name\n\"JPEG\" which are incompatible with original DCT-based JPEG.  IJG therefore does\nnot support these formats (see REFERENCES).  Indeed, one of the original\nreasons for developing this free software was to help force convergence on\ncommon, interoperable format standards for JPEG files.\nDon't use an incompatible file format!\n(In any case, our decoder will remain capable of reading existing JPEG\nimage files indefinitely.)\n\n\nTO DO\n=====\n\nPlease send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/README.md",
    "content": "Background\n==========\n\nlibjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,\nNEON, AltiVec) to accelerate baseline JPEG compression and decompression on\nx86, x86-64, ARM, and PowerPC systems.  On such systems, libjpeg-turbo is\ngenerally 2-6x as fast as libjpeg, all else being equal.  On other types of\nsystems, libjpeg-turbo can still outperform libjpeg by a significant amount, by\nvirtue of its highly-optimized Huffman coding routines.  In many cases, the\nperformance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.\n\nlibjpeg-turbo implements both the traditional libjpeg API as well as the less\npowerful but more straightforward TurboJPEG API.  libjpeg-turbo also features\ncolorspace extensions that allow it to compress from/decompress to 32-bit and\nbig-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java\ninterface.\n\nlibjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated\nderivative of libjpeg v6b developed by Miyasaka Masaru.  The TigerVNC and\nVirtualGL projects made numerous enhancements to the codec in 2009, and in\nearly 2010, libjpeg-turbo spun off into an independent project, with the goal\nof making high-speed JPEG compression/decompression technology available to a\nbroader range of users and developers.\n\n\nLicense\n=======\n\nlibjpeg-turbo is covered by three compatible BSD-style open source licenses.\nRefer to [LICENSE.md](LICENSE.md) for a roll-up of license terms.\n\n\nBuilding libjpeg-turbo\n======================\n\nRefer to [BUILDING.md](BUILDING.md) for complete instructions.\n\n\nUsing libjpeg-turbo\n===================\n\nlibjpeg-turbo includes two APIs that can be used to compress and decompress\nJPEG images:\n\n- **TurboJPEG API**  \n  This API provides an easy-to-use interface for compressing and decompressing\n  JPEG images in memory.  It also provides some functionality that would not be\n  straightforward to achieve using the underlying libjpeg API, such as\n  generating planar YUV images and performing multiple simultaneous lossless\n  transforms on an image.  The Java interface for libjpeg-turbo is written on\n  top of the TurboJPEG API.\n\n- **libjpeg API**  \n  This is the de facto industry-standard API for compressing and decompressing\n  JPEG images.  It is more difficult to use than the TurboJPEG API but also\n  more powerful.  The libjpeg API implementation in libjpeg-turbo is both\n  API/ABI-compatible and mathematically compatible with libjpeg v6b.  It can\n  also optionally be configured to be API/ABI-compatible with libjpeg v7 and v8\n  (see below.)\n\nThere is no significant performance advantage to either API when both are used\nto perform similar operations.\n\nColorspace Extensions\n---------------------\n\nlibjpeg-turbo includes extensions that allow JPEG images to be compressed\ndirectly from (and decompressed directly to) buffers that use BGR, BGRX,\nRGBX, XBGR, and XRGB pixel ordering.  This is implemented with ten new\ncolorspace constants:\n\n    JCS_EXT_RGB   /* red/green/blue */\n    JCS_EXT_RGBX  /* red/green/blue/x */\n    JCS_EXT_BGR   /* blue/green/red */\n    JCS_EXT_BGRX  /* blue/green/red/x */\n    JCS_EXT_XBGR  /* x/blue/green/red */\n    JCS_EXT_XRGB  /* x/red/green/blue */\n    JCS_EXT_RGBA  /* red/green/blue/alpha */\n    JCS_EXT_BGRA  /* blue/green/red/alpha */\n    JCS_EXT_ABGR  /* alpha/blue/green/red */\n    JCS_EXT_ARGB  /* alpha/red/green/blue */\n\nSetting `cinfo.in_color_space` (compression) or `cinfo.out_color_space`\n(decompression) to one of these values will cause libjpeg-turbo to read the\nred, green, and blue values from (or write them to) the appropriate position in\nthe pixel when compressing from/decompressing to an RGB buffer.\n\nYour application can check for the existence of these extensions at compile\ntime with:\n\n    #ifdef JCS_EXTENSIONS\n\nAt run time, attempting to use these extensions with a libjpeg implementation\nthat does not support them will result in a \"Bogus input colorspace\" error.\nApplications can trap this error in order to test whether run-time support is\navailable for the colorspace extensions.\n\nWhen using the RGBX, BGRX, XBGR, and XRGB colorspaces during decompression, the\nX byte is undefined, and in order to ensure the best performance, libjpeg-turbo\ncan set that byte to whatever value it wishes.  If an application expects the X\nbyte to be used as an alpha channel, then it should specify `JCS_EXT_RGBA`,\n`JCS_EXT_BGRA`, `JCS_EXT_ABGR`, or `JCS_EXT_ARGB`.  When these colorspace\nconstants are used, the X byte is guaranteed to be 0xFF, which is interpreted\nas opaque.\n\nYour application can check for the existence of the alpha channel colorspace\nextensions at compile time with:\n\n    #ifdef JCS_ALPHA_EXTENSIONS\n\n[jcstest.c](jcstest.c), located in the libjpeg-turbo source tree, demonstrates\nhow to check for the existence of the colorspace extensions at compile time and\nrun time.\n\nlibjpeg v7 and v8 API/ABI Emulation\n-----------------------------------\n\nWith libjpeg v7 and v8, new features were added that necessitated extending the\ncompression and decompression structures.  Unfortunately, due to the exposed\nnature of those structures, extending them also necessitated breaking backward\nABI compatibility with previous libjpeg releases.  Thus, programs that were\nbuilt to use libjpeg v7 or v8 did not work with libjpeg-turbo, since it is\nbased on the libjpeg v6b code base.  Although libjpeg v7 and v8 are not\nas widely used as v6b, enough programs (including a few Linux distros) made\nthe switch that there was a demand to emulate the libjpeg v7 and v8 ABIs\nin libjpeg-turbo.  It should be noted, however, that this feature was added\nprimarily so that applications that had already been compiled to use libjpeg\nv7+ could take advantage of accelerated baseline JPEG encoding/decoding\nwithout recompiling.  libjpeg-turbo does not claim to support all of the\nlibjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all\ncases (see below.)\n\nBy passing an argument of `--with-jpeg7` or `--with-jpeg8` to `configure`, or\nan argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you can build a\nversion of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so that\nprograms that are built against libjpeg v7 or v8 can be run with libjpeg-turbo.\nThe following section describes which libjpeg v7+ features are supported and\nwhich aren't.\n\n### Support for libjpeg v7 and v8 Features\n\n#### Fully supported\n\n- **libjpeg: IDCT scaling extensions in decompressor**  \n  libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8,\n  1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4\n  and 1/2 are SIMD-accelerated.)\n\n- **libjpeg: Arithmetic coding**\n\n- **libjpeg: In-memory source and destination managers**  \n  See notes below.\n\n- **cjpeg: Separate quality settings for luminance and chrominance**  \n  Note that the libpjeg v7+ API was extended to accommodate this feature only\n  for convenience purposes.  It has always been possible to implement this\n  feature with libjpeg v6b (see rdswitch.c for an example.)\n\n- **cjpeg: 32-bit BMP support**\n\n- **cjpeg: `-rgb` option**\n\n- **jpegtran: Lossless cropping**\n\n- **jpegtran: `-perfect` option**\n\n- **jpegtran: Forcing width/height when performing lossless crop**\n\n- **rdjpgcom: `-raw` option**\n\n- **rdjpgcom: Locale awareness**\n\n\n#### Not supported\n\nNOTE:  As of this writing, extensive research has been conducted into the\nusefulness of DCT scaling as a means of data reduction and SmartScale as a\nmeans of quality improvement.  The reader is invited to peruse the research at\n<http://www.libjpeg-turbo.org/About/SmartScale> and draw his/her own conclusions,\nbut it is the general belief of our project that these features have not\ndemonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.\n\n- **libjpeg: DCT scaling in compressor**  \n  `cinfo.scale_num` and `cinfo.scale_denom` are silently ignored.\n  There is no technical reason why DCT scaling could not be supported when\n  emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see\n  below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and\n  8/9 would be available, which is of limited usefulness.\n\n- **libjpeg: SmartScale**  \n  `cinfo.block_size` is silently ignored.\n  SmartScale is an extension to the JPEG format that allows for DCT block\n  sizes other than 8x8.  Providing support for this new format would be\n  feasible (particularly without full acceleration.)  However, until/unless\n  the format becomes either an official industry standard or, at minimum, an\n  accepted solution in the community, we are hesitant to implement it, as\n  there is no sense of whether or how it might change in the future.  It is\n  our belief that SmartScale has not demonstrated sufficient usefulness as a\n  lossless format nor as a means of quality enhancement, and thus our primary\n  interest in providing this feature would be as a means of supporting\n  additional DCT scaling factors.\n\n- **libjpeg: Fancy downsampling in compressor**  \n  `cinfo.do_fancy_downsampling` is silently ignored.\n  This requires the DCT scaling feature, which is not supported.\n\n- **jpegtran: Scaling**  \n  This requires both the DCT scaling and SmartScale features, which are not\n  supported.\n\n- **Lossless RGB JPEG files**  \n  This requires the SmartScale feature, which is not supported.\n\n### What About libjpeg v9?\n\nlibjpeg v9 introduced yet another field to the JPEG compression structure\n(`color_transform`), thus making the ABI backward incompatible with that of\nlibjpeg v8.  This new field was introduced solely for the purpose of supporting\nlossless SmartScale encoding.  Furthermore, there was actually no reason to\nextend the API in this manner, as the color transform could have just as easily\nbeen activated by way of a new JPEG colorspace constant, thus preserving\nbackward ABI compatibility.\n\nOur research (see link above) has shown that lossless SmartScale does not\ngenerally accomplish anything that can't already be accomplished better with\nexisting, standard lossless formats.  Therefore, at this time it is our belief\nthat there is not sufficient technical justification for software projects to\nupgrade from libjpeg v8 to libjpeg v9, and thus there is not sufficient\nechnical justification for us to emulate the libjpeg v9 ABI.\n\nIn-Memory Source/Destination Managers\n-------------------------------------\n\nBy default, libjpeg-turbo 1.3 and later includes the `jpeg_mem_src()` and\n`jpeg_mem_dest()` functions, even when not emulating the libjpeg v8 API/ABI.\nPreviously, it was necessary to build libjpeg-turbo from source with libjpeg v8\nAPI/ABI emulation in order to use the in-memory source/destination managers,\nbut several projects requested that those functions be included when emulating\nthe libjpeg v6b API/ABI as well.  This allows the use of those functions by\nprograms that need them, without breaking ABI compatibility for programs that\ndon't, and it allows those functions to be provided in the \"official\"\nlibjpeg-turbo binaries.\n\nThose who are concerned about maintaining strict conformance with the libjpeg\nv6b or v7 API can pass an argument of `--without-mem-srcdst` to `configure` or\nan argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to building\nlibjpeg-turbo.  This will restore the pre-1.3 behavior, in which\n`jpeg_mem_src()` and `jpeg_mem_dest()` are only included when emulating the\nlibjpeg v8 API/ABI.\n\nOn Un*x systems, including the in-memory source/destination managers changes\nthe dynamic library version from 62.0.0 to 62.1.0 if using libjpeg v6b API/ABI\nemulation and from 7.0.0 to 7.1.0 if using libjpeg v7 API/ABI emulation.\n\nNote that, on most Un*x systems, the dynamic linker will not look for a\nfunction in a library until that function is actually used.  Thus, if a program\nis built against libjpeg-turbo 1.3+ and uses `jpeg_mem_src()` or\n`jpeg_mem_dest()`, that program will not fail if run against an older version\nof libjpeg-turbo or against libjpeg v7- until the program actually tries to\ncall `jpeg_mem_src()` or `jpeg_mem_dest()`.  Such is not the case on Windows.\nIf a program is built against the libjpeg-turbo 1.3+ DLL and uses\n`jpeg_mem_src()` or `jpeg_mem_dest()`, then it must use the libjpeg-turbo 1.3+\nDLL at run time.\n\nBoth cjpeg and djpeg have been extended to allow testing the in-memory\nsource/destination manager functions.  See their respective man pages for more\ndetails.\n\n\nMathematical Compatibility\n==========================\n\nFor the most part, libjpeg-turbo should produce identical output to libjpeg\nv6b.  The one exception to this is when using the floating point DCT/IDCT, in\nwhich case the outputs of libjpeg v6b and libjpeg-turbo can differ for the\nfollowing reasons:\n\n- The SSE/SSE2 floating point DCT implementation in libjpeg-turbo is ever so\n  slightly more accurate than the implementation in libjpeg v6b, but not by\n  any amount perceptible to human vision (generally in the range of 0.01 to\n  0.08 dB gain in PNSR.)\n\n- When not using the SIMD extensions, libjpeg-turbo uses the more accurate\n  (and slightly faster) floating point IDCT algorithm introduced in libjpeg\n  v8a as opposed to the algorithm used in libjpeg v6b.  It should be noted,\n  however, that this algorithm basically brings the accuracy of the floating\n  point IDCT in line with the accuracy of the slow integer IDCT.  The floating\n  point DCT/IDCT algorithms are mainly a legacy feature, and they do not\n  produce significantly more accuracy than the slow integer algorithms (to put\n  numbers on this, the typical difference in PNSR between the two algorithms\n  is less than 0.10 dB, whereas changing the quality level by 1 in the upper\n  range of the quality scale is typically more like a 1.0 dB difference.)\n\n- If the floating point algorithms in libjpeg-turbo are not implemented using\n  SIMD instructions on a particular platform, then the accuracy of the\n  floating point DCT/IDCT can depend on the compiler settings.\n\nWhile libjpeg-turbo does emulate the libjpeg v8 API/ABI, under the hood it is\nstill using the same algorithms as libjpeg v6b, so there are several specific\ncases in which libjpeg-turbo cannot be expected to produce the same output as\nlibjpeg v8:\n\n- When decompressing using scaling factors of 1/2 and 1/4, because libjpeg v8\n  implements those scaling algorithms differently than libjpeg v6b does, and\n  libjpeg-turbo's SIMD extensions are based on the libjpeg v6b behavior.\n\n- When using chrominance subsampling, because libjpeg v8 implements this\n  with its DCT/IDCT scaling algorithms rather than with a separate\n  downsampling/upsampling algorithm.  In our testing, the subsampled/upsampled\n  output of libjpeg v8 is less accurate than that of libjpeg v6b for this\n  reason.\n\n- When decompressing using a scaling factor > 1 and merged (AKA \"non-fancy\" or\n  \"non-smooth\") chrominance upsampling, because libjpeg v8 does not support\n  merged upsampling with scaling factors > 1.\n\n\nPerformance Pitfalls\n====================\n\nRestart Markers\n---------------\n\nThe optimized Huffman decoder in libjpeg-turbo does not handle restart markers\nin a way that makes the rest of the libjpeg infrastructure happy, so it is\nnecessary to use the slow Huffman decoder when decompressing a JPEG image that\nhas restart markers.  This can cause the decompression performance to drop by\nas much as 20%, but the performance will still be much greater than that of\nlibjpeg.  Many consumer packages, such as PhotoShop, use restart markers when\ngenerating JPEG images, so images generated by those programs will experience\nthis issue.\n\nFast Integer Forward DCT at High Quality Levels\n-----------------------------------------------\n\nThe algorithm used by the SIMD-accelerated quantization function cannot produce\ncorrect results whenever the fast integer forward DCT is used along with a JPEG\nquality of 98-100.  Thus, libjpeg-turbo must use the non-SIMD quantization\nfunction in those cases.  This causes performance to drop by as much as 40%.\nIt is therefore strongly advised that you use the slow integer forward DCT\nwhenever encoding images with a JPEG quality of 98 or higher.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/acinclude.m4",
    "content": "# AC_PROG_NASM\n# --------------------------\n# Check that NASM exists and determine flags\nAC_DEFUN([AC_PROG_NASM],[\n\nAC_ARG_VAR(NASM, [NASM command (used to build the x86/x86-64 SIMD code)])\nif test \"x$NASM\" = \"x\"; then\n  AC_CHECK_PROGS(NASM, [nasm nasmw yasm])\n  test -z \"$NASM\" && AC_MSG_ERROR([no nasm (Netwide Assembler) found])\nfi\n\nAC_MSG_CHECKING([for object file format of host system])\ncase \"$host_os\" in\n  cygwin* | mingw* | pw32* | interix*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='Win64-COFF'\n        ;;\n      *)\n        objfmt='Win32-COFF'\n        ;;\n    esac\n  ;;\n  msdosdjgpp* | go32*)\n    objfmt='COFF'\n  ;;\n  os2-emx*)\t\t\t# not tested\n    objfmt='MSOMF'\t\t# obj\n  ;;\n  linux*coff* | linux*oldld*)\n    objfmt='COFF'\t\t# ???\n  ;;\n  linux*aout*)\n    objfmt='a.out'\n  ;;\n  linux*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='ELF64'\n        ;;\n      *)\n        objfmt='ELF'\n        ;;\n    esac\n  ;;\n  kfreebsd* | freebsd* | netbsd* | openbsd*)\n    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then\n      objfmt='BSD-a.out'\n    else\n      case \"$host_cpu\" in\n        x86_64 | amd64)\n          objfmt='ELF64'\n          ;;\n        *)\n          objfmt='ELF'\n          ;;\n      esac\n    fi\n  ;;\n  solaris* | sunos* | sysv* | sco*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='ELF64'\n        ;;\n      *)\n        objfmt='ELF'\n        ;;\n    esac\n  ;;\n  darwin* | rhapsody* | nextstep* | openstep* | macos*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='Mach-O64'\n        ;;\n      *)\n        objfmt='Mach-O'\n        ;;\n    esac\n  ;;\n  *)\n    objfmt='ELF ?'\n  ;;\nesac\n\nAC_MSG_RESULT([$objfmt])\nif test \"$objfmt\" = 'ELF ?'; then\n  objfmt='ELF'\n  AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])\nfi\n\nAC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])\ncase \"$objfmt\" in\n  MSOMF)      NAFLAGS='-fobj -DOBJ32';;\n  Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;\n  Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;\n  COFF)       NAFLAGS='-fcoff -DCOFF';;\n  a.out)      NAFLAGS='-faout -DAOUT';;\n  BSD-a.out)  NAFLAGS='-faoutb -DAOUT';;\n  ELF)        NAFLAGS='-felf -DELF';;\n  ELF64)      NAFLAGS='-felf64 -DELF -D__x86_64__';;\n  RDF)        NAFLAGS='-frdf -DRDF';;\n  Mach-O)     NAFLAGS='-fmacho -DMACHO';;\n  Mach-O64)   NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;\nesac\nAC_MSG_RESULT([$NAFLAGS])\nAC_SUBST([NAFLAGS])\n\nAC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])\ncat > conftest.asm <<EOF\n[%line __oline__ \"configure\"\n        section .text\n        global  _main,main\n_main:\nmain:   xor     eax,eax\n        ret\n]EOF\ntry_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'\nif AC_TRY_EVAL(try_nasm) && test -s conftest.o; then\n  AC_MSG_RESULT(yes)\nelse\n  echo \"configure: failed program was:\" >&AC_FD_CC\n  cat conftest.asm >&AC_FD_CC\n  rm -rf conftest*\n  AC_MSG_RESULT(no)\n  AC_MSG_ERROR([installation or configuration problem: assembler cannot create object files.])\nfi\n\nAC_MSG_CHECKING([whether the linker accepts assembler output])\ntry_nasm='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.o $LIBS 1>&AC_FD_CC'\nif AC_TRY_EVAL(try_nasm) && test -s conftest${ac_exeext}; then\n  rm -rf conftest*\n  AC_MSG_RESULT(yes)\nelse\n  rm -rf conftest*\n  AC_MSG_RESULT(no)\n  AC_MSG_ERROR([configuration problem: maybe object file format mismatch.])\nfi\n\n])\n\n# AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE\n# --------------------------\n# Test whether the assembler is suitable and supports NEON instructions\nAC_DEFUN([AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE],[\n  ac_good_gnu_arm_assembler=no\n  ac_save_CC=\"$CC\"\n  ac_save_CFLAGS=\"$CFLAGS\"\n  CFLAGS=\"$CCASFLAGS -x assembler-with-cpp\"\n  CC=\"$CCAS\"\n  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[\n    .text\n    .fpu neon\n    .arch armv7a\n    .object_arch armv4\n    .arm\n    pld [r0]\n    vmovn.u16 d0, q0]])], ac_good_gnu_arm_assembler=yes)\n\n  ac_use_gas_preprocessor=no\n  if test \"x$ac_good_gnu_arm_assembler\" = \"xno\" ; then\n    CC=\"gas-preprocessor.pl $CCAS\"\n    AC_COMPILE_IFELSE([AC_LANG_SOURCE([[\n      .text\n      .fpu neon\n      .arch armv7a\n      .object_arch armv4\n      .arm\n      pld [r0]\n      vmovn.u16 d0, q0]])], ac_use_gas_preprocessor=yes)\n  fi\n  CFLAGS=\"$ac_save_CFLAGS\"\n  CC=\"$ac_save_CC\"\n\n  if test \"x$ac_use_gas_preprocessor\" = \"xyes\" ; then\n    CCAS=\"gas-preprocessor.pl $CCAS\"\n    AC_SUBST([CCAS])\n    ac_good_gnu_arm_assembler=yes\n  fi\n\n  if test \"x$ac_good_gnu_arm_assembler\" = \"xyes\" ; then\n    $1\n  else\n    $2\n  fi\n])\n\n# AC_CHECK_COMPATIBLE_MIPSEL_ASSEMBLER_IFELSE\n# --------------------------\n# Test whether the assembler is suitable and supports MIPS instructions\nAC_DEFUN([AC_CHECK_COMPATIBLE_MIPS_ASSEMBLER_IFELSE],[\n  have_mips_dspr2=no\n  ac_save_CFLAGS=\"$CFLAGS\"\n  CFLAGS=\"$CCASFLAGS -mdspr2\"\n\n  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[\n\n  int main ()\n  {\n    int c = 0, a = 0, b = 0;\n    __asm__ __volatile__ (\n        \"precr.qb.ph %[c], %[a], %[b]          \\n\\t\"\n        : [c] \"=r\" (c)\n        : [a] \"r\" (a), [b] \"r\" (b)\n    );\n    return c;\n  }\n  ]])], have_mips_dspr2=yes)\n  CFLAGS=$ac_save_CFLAGS\n\n  if test \"x$have_mips_dspr2\" = \"xyes\" ; then\n    $1\n  else\n    $2\n  fi\n])\n\nAC_DEFUN([AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE],[\n  ac_good_gnu_arm_assembler=no\n  ac_save_CC=\"$CC\"\n  ac_save_CFLAGS=\"$CFLAGS\"\n  CFLAGS=\"$CCASFLAGS -x assembler-with-cpp\"\n  CC=\"$CCAS\"\n  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[\n    .text\n    MYVAR .req x0\n    movi v0.16b, #100\n    mov MYVAR, #100\n    .unreq MYVAR]])], ac_good_gnu_arm_assembler=yes)\n\n  ac_use_gas_preprocessor=no\n  if test \"x$ac_good_gnu_arm_assembler\" = \"xno\" ; then\n    CC=\"gas-preprocessor.pl $CCAS\"\n    AC_COMPILE_IFELSE([AC_LANG_SOURCE([[\n      .text\n      MYVAR .req x0\n      movi v0.16b, #100\n      mov MYVAR, #100\n      .unreq MYVAR]])], ac_use_gas_preprocessor=yes)\n  fi\n  CFLAGS=\"$ac_save_CFLAGS\"\n  CC=\"$ac_save_CC\"\n\n  if test \"x$ac_use_gas_preprocessor\" = \"xyes\" ; then\n    CCAS=\"gas-preprocessor.pl $CCAS\"\n    AC_SUBST([CCAS])\n    ac_good_gnu_arm_assembler=yes\n  fi\n\n  if test \"x$ac_good_gnu_arm_assembler\" = \"xyes\" ; then\n    $1\n  else\n    $2\n  fi\n])\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/aclocal.m4",
    "content": "# generated automatically by aclocal 1.15 -*- Autoconf -*-\n\n# Copyright (C) 1996-2014 Free Software Foundation, Inc.\n\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\nm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])\nm4_ifndef([AC_AUTOCONF_VERSION],\n  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl\nm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,\n[m4_warning([this file was generated for autoconf 2.69.\nYou have another version of autoconf.  It may work, but is not guaranteed to.\nIf you have problems, you may need to regenerate the build system entirely.\nTo do so, use the procedure documented by the package, typically 'autoreconf'.])])\n\n# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-\n# \n# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\n# PKG_PROG_PKG_CONFIG([MIN-VERSION])\n# ----------------------------------\nAC_DEFUN([PKG_PROG_PKG_CONFIG],\n[m4_pattern_forbid([^_?PKG_[A-Z_]+$])\nm4_pattern_allow([^PKG_CONFIG(_PATH)?$])\nAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl\nif test \"x$ac_cv_env_PKG_CONFIG_set\" != \"xset\"; then\n\tAC_PATH_TOOL([PKG_CONFIG], [pkg-config])\nfi\nif test -n \"$PKG_CONFIG\"; then\n\t_pkg_min_version=m4_default([$1], [0.9.0])\n\tAC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])\n\tif $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then\n\t\tAC_MSG_RESULT([yes])\n\telse\n\t\tAC_MSG_RESULT([no])\n\t\tPKG_CONFIG=\"\"\n\tfi\n\t\t\nfi[]dnl\n])# PKG_PROG_PKG_CONFIG\n\n# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])\n#\n# Check to see whether a particular set of modules exists.  Similar\n# to PKG_CHECK_MODULES(), but does not set variables or print errors.\n#\n#\n# Similar to PKG_CHECK_MODULES, make sure that the first instance of\n# this or PKG_CHECK_MODULES is called, or make sure to call\n# PKG_CHECK_EXISTS manually\n# --------------------------------------------------------------\nAC_DEFUN([PKG_CHECK_EXISTS],\n[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl\nif test -n \"$PKG_CONFIG\" && \\\n    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors \"$1\"]); then\n  m4_ifval([$2], [$2], [:])\nm4_ifvaln([$3], [else\n  $3])dnl\nfi])\n\n\n# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])\n# ---------------------------------------------\nm4_define([_PKG_CONFIG],\n[if test -n \"$PKG_CONFIG\"; then\n    if test -n \"$$1\"; then\n        pkg_cv_[]$1=\"$$1\"\n    else\n        PKG_CHECK_EXISTS([$3],\n                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 \"$3\" 2>/dev/null`],\n\t\t\t [pkg_failed=yes])\n    fi\nelse\n\tpkg_failed=untried\nfi[]dnl\n])# _PKG_CONFIG\n\n# _PKG_SHORT_ERRORS_SUPPORTED\n# -----------------------------\nAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],\n[AC_REQUIRE([PKG_PROG_PKG_CONFIG])\nif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then\n        _pkg_short_errors_supported=yes\nelse\n        _pkg_short_errors_supported=no\nfi[]dnl\n])# _PKG_SHORT_ERRORS_SUPPORTED\n\n\n# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],\n# [ACTION-IF-NOT-FOUND])\n#\n#\n# Note that if there is a possibility the first call to\n# PKG_CHECK_MODULES might not happen, you should be sure to include an\n# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac\n#\n#\n# --------------------------------------------------------------\nAC_DEFUN([PKG_CHECK_MODULES],\n[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl\nAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl\nAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl\n\npkg_failed=no\nAC_MSG_CHECKING([for $1])\n\n_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])\n_PKG_CONFIG([$1][_LIBS], [libs], [$2])\n\nm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS\nand $1[]_LIBS to avoid the need to call pkg-config.\nSee the pkg-config man page for more details.])\n\nif test $pkg_failed = yes; then\n        _PKG_SHORT_ERRORS_SUPPORTED\n        if test $_pkg_short_errors_supported = yes; then\n\t        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors \"$2\"`\n        else \n\t        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors \"$2\"`\n        fi\n\t# Put the nasty error message in config.log where it belongs\n\techo \"$$1[]_PKG_ERRORS\" >&AS_MESSAGE_LOG_FD\n\n\tifelse([$4], , [AC_MSG_ERROR(dnl\n[Package requirements ($2) were not met:\n\n$$1_PKG_ERRORS\n\nConsider adjusting the PKG_CONFIG_PATH environment variable if you\ninstalled software in a non-standard prefix.\n\n_PKG_TEXT\n])],\n\t\t[AC_MSG_RESULT([no])\n                $4])\nelif test $pkg_failed = untried; then\n\tifelse([$4], , [AC_MSG_FAILURE(dnl\n[The pkg-config script could not be found or is too old.  Make sure it\nis in your PATH or set the PKG_CONFIG environment variable to the full\npath to pkg-config.\n\n_PKG_TEXT\n\nTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],\n\t\t[$4])\nelse\n\t$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS\n\t$1[]_LIBS=$pkg_cv_[]$1[]_LIBS\n        AC_MSG_RESULT([yes])\n\tifelse([$3], , :, [$3])\nfi[]dnl\n])# PKG_CHECK_MODULES\n\n# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-\n#\n#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.\n#   Written by Gordon Matzigkeit, 1996\n#\n# This file is free software; the Free Software Foundation gives\n# unlimited permission to copy and/or distribute it, with or without\n# modifications, as long as this notice is preserved.\n\nm4_define([_LT_COPYING], [dnl\n# Copyright (C) 2014 Free Software Foundation, Inc.\n# This is free software; see the source for copying conditions.  There is NO\n# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n# GNU Libtool is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of of the License, or\n# (at your option) any later version.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program or library that is built\n# using GNU Libtool, you may include this file under the  same\n# distribution terms that you use for the rest of that program.\n#\n# GNU Libtool is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n])\n\n# serial 58 LT_INIT\n\n\n# LT_PREREQ(VERSION)\n# ------------------\n# Complain and exit if this libtool version is less that VERSION.\nm4_defun([LT_PREREQ],\n[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,\n       [m4_default([$3],\n\t\t   [m4_fatal([Libtool version $1 or higher is required],\n\t\t             63)])],\n       [$2])])\n\n\n# _LT_CHECK_BUILDDIR\n# ------------------\n# Complain if the absolute build directory name contains unusual characters\nm4_defun([_LT_CHECK_BUILDDIR],\n[case `pwd` in\n  *\\ * | *\\\t*)\n    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;\nesac\n])\n\n\n# LT_INIT([OPTIONS])\n# ------------------\nAC_DEFUN([LT_INIT],\n[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK\nAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl\nAC_BEFORE([$0], [LT_LANG])dnl\nAC_BEFORE([$0], [LT_OUTPUT])dnl\nAC_BEFORE([$0], [LTDL_INIT])dnl\nm4_require([_LT_CHECK_BUILDDIR])dnl\n\ndnl Autoconf doesn't catch unexpanded LT_ macros by default:\nm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl\nm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl\ndnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4\ndnl unless we require an AC_DEFUNed macro:\nAC_REQUIRE([LTOPTIONS_VERSION])dnl\nAC_REQUIRE([LTSUGAR_VERSION])dnl\nAC_REQUIRE([LTVERSION_VERSION])dnl\nAC_REQUIRE([LTOBSOLETE_VERSION])dnl\nm4_require([_LT_PROG_LTMAIN])dnl\n\n_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])\n\ndnl Parse OPTIONS\n_LT_SET_OPTIONS([$0], [$1])\n\n# This can be used to rebuild libtool when needed\nLIBTOOL_DEPS=$ltmain\n\n# Always use our own libtool.\nLIBTOOL='$(SHELL) $(top_builddir)/libtool'\nAC_SUBST(LIBTOOL)dnl\n\n_LT_SETUP\n\n# Only expand once:\nm4_define([LT_INIT])\n])# LT_INIT\n\n# Old names:\nAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])\nAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_PROG_LIBTOOL], [])\ndnl AC_DEFUN([AM_PROG_LIBTOOL], [])\n\n\n# _LT_PREPARE_CC_BASENAME\n# -----------------------\nm4_defun([_LT_PREPARE_CC_BASENAME], [\n# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.\nfunc_cc_basename ()\n{\n    for cc_temp in @S|@*\"\"; do\n      case $cc_temp in\n        compile | *[[\\\\/]]compile | ccache | *[[\\\\/]]ccache ) ;;\n        distcc | *[[\\\\/]]distcc | purify | *[[\\\\/]]purify ) ;;\n        \\-*) ;;\n        *) break;;\n      esac\n    done\n    func_cc_basename_result=`$ECHO \"$cc_temp\" | $SED \"s%.*/%%; s%^$host_alias-%%\"`\n}\n])# _LT_PREPARE_CC_BASENAME\n\n\n# _LT_CC_BASENAME(CC)\n# -------------------\n# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,\n# but that macro is also expanded into generated libtool script, which\n# arranges for $SED and $ECHO to be set by different means.\nm4_defun([_LT_CC_BASENAME],\n[m4_require([_LT_PREPARE_CC_BASENAME])dnl\nAC_REQUIRE([_LT_DECL_SED])dnl\nAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl\nfunc_cc_basename $1\ncc_basename=$func_cc_basename_result\n])\n\n\n# _LT_FILEUTILS_DEFAULTS\n# ----------------------\n# It is okay to use these file commands and assume they have been set\n# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.\nm4_defun([_LT_FILEUTILS_DEFAULTS],\n[: ${CP=\"cp -f\"}\n: ${MV=\"mv -f\"}\n: ${RM=\"rm -f\"}\n])# _LT_FILEUTILS_DEFAULTS\n\n\n# _LT_SETUP\n# ---------\nm4_defun([_LT_SETUP],\n[AC_REQUIRE([AC_CANONICAL_HOST])dnl\nAC_REQUIRE([AC_CANONICAL_BUILD])dnl\nAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl\nAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl\n\n_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl\ndnl\n_LT_DECL([], [host_alias], [0], [The host system])dnl\n_LT_DECL([], [host], [0])dnl\n_LT_DECL([], [host_os], [0])dnl\ndnl\n_LT_DECL([], [build_alias], [0], [The build system])dnl\n_LT_DECL([], [build], [0])dnl\n_LT_DECL([], [build_os], [0])dnl\ndnl\nAC_REQUIRE([AC_PROG_CC])dnl\nAC_REQUIRE([LT_PATH_LD])dnl\nAC_REQUIRE([LT_PATH_NM])dnl\ndnl\nAC_REQUIRE([AC_PROG_LN_S])dnl\ntest -z \"$LN_S\" && LN_S=\"ln -s\"\n_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl\ndnl\nAC_REQUIRE([LT_CMD_MAX_LEN])dnl\n_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally \"o\")])dnl\n_LT_DECL([], [exeext], [0], [Executable file suffix (normally \"\")])dnl\ndnl\nm4_require([_LT_FILEUTILS_DEFAULTS])dnl\nm4_require([_LT_CHECK_SHELL_FEATURES])dnl\nm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl\nm4_require([_LT_CMD_RELOAD])dnl\nm4_require([_LT_CHECK_MAGIC_METHOD])dnl\nm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl\nm4_require([_LT_CMD_OLD_ARCHIVE])dnl\nm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl\nm4_require([_LT_WITH_SYSROOT])dnl\nm4_require([_LT_CMD_TRUNCATE])dnl\n\n_LT_CONFIG_LIBTOOL_INIT([\n# See if we are running on zsh, and set the options that allow our\n# commands through without removal of \\ escapes INIT.\nif test -n \"\\${ZSH_VERSION+set}\"; then\n   setopt NO_GLOB_SUBST\nfi\n])\nif test -n \"${ZSH_VERSION+set}\"; then\n   setopt NO_GLOB_SUBST\nfi\n\n_LT_CHECK_OBJDIR\n\nm4_require([_LT_TAG_COMPILER])dnl\n\ncase $host_os in\naix3*)\n  # AIX sometimes has problems with the GCC collect2 program.  For some\n  # reason, if we set the COLLECT_NAMES environment variable, the problems\n  # vanish in a puff of smoke.\n  if test set != \"${COLLECT_NAMES+set}\"; then\n    COLLECT_NAMES=\n    export COLLECT_NAMES\n  fi\n  ;;\nesac\n\n# Global variables:\nofile=libtool\ncan_build_shared=yes\n\n# All known linkers require a '.a' archive for static linking (except MSVC,\n# which needs '.lib').\nlibext=a\n\nwith_gnu_ld=$lt_cv_prog_gnu_ld\n\nold_CC=$CC\nold_CFLAGS=$CFLAGS\n\n# Set sane defaults for various variables\ntest -z \"$CC\" && CC=cc\ntest -z \"$LTCC\" && LTCC=$CC\ntest -z \"$LTCFLAGS\" && LTCFLAGS=$CFLAGS\ntest -z \"$LD\" && LD=ld\ntest -z \"$ac_objext\" && ac_objext=o\n\n_LT_CC_BASENAME([$compiler])\n\n# Only perform the check for file, if the check method requires it\ntest -z \"$MAGIC_CMD\" && MAGIC_CMD=file\ncase $deplibs_check_method in\nfile_magic*)\n  if test \"$file_magic_cmd\" = '$MAGIC_CMD'; then\n    _LT_PATH_MAGIC\n  fi\n  ;;\nesac\n\n# Use C for the default configuration in the libtool script\nLT_SUPPORTED_TAG([CC])\n_LT_LANG_C_CONFIG\n_LT_LANG_DEFAULT_CONFIG\n_LT_CONFIG_COMMANDS\n])# _LT_SETUP\n\n\n# _LT_PREPARE_SED_QUOTE_VARS\n# --------------------------\n# Define a few sed substitution that help us do robust quoting.\nm4_defun([_LT_PREPARE_SED_QUOTE_VARS],\n[# Backslashify metacharacters that are still active within\n# double-quoted strings.\nsed_quote_subst='s/\\([[\"`$\\\\]]\\)/\\\\\\1/g'\n\n# Same as above, but do not quote variable references.\ndouble_quote_subst='s/\\([[\"`\\\\]]\\)/\\\\\\1/g'\n\n# Sed substitution to delay expansion of an escaped shell variable in a\n# double_quote_subst'ed string.\ndelay_variable_subst='s/\\\\\\\\\\\\\\\\\\\\\\$/\\\\\\\\\\\\$/g'\n\n# Sed substitution to delay expansion of an escaped single quote.\ndelay_single_quote_subst='s/'\\''/'\\'\\\\\\\\\\\\\\'\\''/g'\n\n# Sed substitution to avoid accidental globbing in evaled expressions\nno_glob_subst='s/\\*/\\\\\\*/g'\n])\n\n# _LT_PROG_LTMAIN\n# ---------------\n# Note that this code is called both from 'configure', and 'config.status'\n# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,\n# 'config.status' has no value for ac_aux_dir unless we are using Automake,\n# so we pass a copy along to make sure it has a sensible value anyway.\nm4_defun([_LT_PROG_LTMAIN],\n[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl\n_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])\nltmain=$ac_aux_dir/ltmain.sh\n])# _LT_PROG_LTMAIN\n\n\n\n# So that we can recreate a full libtool script including additional\n# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS\n# in macros and then make a single call at the end using the 'libtool'\n# label.\n\n\n# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])\n# ----------------------------------------\n# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.\nm4_define([_LT_CONFIG_LIBTOOL_INIT],\n[m4_ifval([$1],\n          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],\n                     [$1\n])])])\n\n# Initialize.\nm4_define([_LT_OUTPUT_LIBTOOL_INIT])\n\n\n# _LT_CONFIG_LIBTOOL([COMMANDS])\n# ------------------------------\n# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.\nm4_define([_LT_CONFIG_LIBTOOL],\n[m4_ifval([$1],\n          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],\n                     [$1\n])])])\n\n# Initialize.\nm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])\n\n\n# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])\n# -----------------------------------------------------\nm4_defun([_LT_CONFIG_SAVE_COMMANDS],\n[_LT_CONFIG_LIBTOOL([$1])\n_LT_CONFIG_LIBTOOL_INIT([$2])\n])\n\n\n# _LT_FORMAT_COMMENT([COMMENT])\n# -----------------------------\n# Add leading comment marks to the start of each line, and a trailing\n# full-stop to the whole comment if one is not present already.\nm4_define([_LT_FORMAT_COMMENT],\n[m4_ifval([$1], [\nm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],\n              [['`$\\]], [\\\\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])\n)])\n\n\n\n\n\n# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])\n# -------------------------------------------------------------------\n# CONFIGNAME is the name given to the value in the libtool script.\n# VARNAME is the (base) name used in the configure script.\n# VALUE may be 0, 1 or 2 for a computed quote escaped value based on\n# VARNAME.  Any other value will be used directly.\nm4_define([_LT_DECL],\n[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],\n    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],\n\t[m4_ifval([$1], [$1], [$2])])\n    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])\n    m4_ifval([$4],\n\t[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])\n    lt_dict_add_subkey([lt_decl_dict], [$2],\n\t[tagged?], [m4_ifval([$5], [yes], [no])])])\n])\n\n\n# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])\n# --------------------------------------------------------\nm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])\n\n\n# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])\n# ------------------------------------------------\nm4_define([lt_decl_tag_varnames],\n[_lt_decl_filter([tagged?], [yes], $@)])\n\n\n# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])\n# ---------------------------------------------------------\nm4_define([_lt_decl_filter],\n[m4_case([$#],\n  [0], [m4_fatal([$0: too few arguments: $#])],\n  [1], [m4_fatal([$0: too few arguments: $#: $1])],\n  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],\n  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],\n  [lt_dict_filter([lt_decl_dict], $@)])[]dnl\n])\n\n\n# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])\n# --------------------------------------------------\nm4_define([lt_decl_quote_varnames],\n[_lt_decl_filter([value], [1], $@)])\n\n\n# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])\n# ---------------------------------------------------\nm4_define([lt_decl_dquote_varnames],\n[_lt_decl_filter([value], [2], $@)])\n\n\n# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])\n# ---------------------------------------------------\nm4_define([lt_decl_varnames_tagged],\n[m4_assert([$# <= 2])dnl\n_$0(m4_quote(m4_default([$1], [[, ]])),\n    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),\n    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])\nm4_define([_lt_decl_varnames_tagged],\n[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])\n\n\n# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])\n# ------------------------------------------------\nm4_define([lt_decl_all_varnames],\n[_$0(m4_quote(m4_default([$1], [[, ]])),\n     m4_if([$2], [],\n\t   m4_quote(lt_decl_varnames),\n\tm4_quote(m4_shift($@))))[]dnl\n])\nm4_define([_lt_decl_all_varnames],\n[lt_join($@, lt_decl_varnames_tagged([$1],\n\t\t\tlt_decl_tag_varnames([[, ]], m4_shift($@))))dnl\n])\n\n\n# _LT_CONFIG_STATUS_DECLARE([VARNAME])\n# ------------------------------------\n# Quote a variable value, and forward it to 'config.status' so that its\n# declaration there will have the same value as in 'configure'.  VARNAME\n# must have a single quote delimited value for this to work.\nm4_define([_LT_CONFIG_STATUS_DECLARE],\n[$1='`$ECHO \"$][$1\" | $SED \"$delay_single_quote_subst\"`'])\n\n\n# _LT_CONFIG_STATUS_DECLARATIONS\n# ------------------------------\n# We delimit libtool config variables with single quotes, so when\n# we write them to config.status, we have to be sure to quote all\n# embedded single quotes properly.  In configure, this macro expands\n# each variable declared with _LT_DECL (and _LT_TAGDECL) into:\n#\n#    <var>='`$ECHO \"$<var>\" | $SED \"$delay_single_quote_subst\"`'\nm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],\n[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),\n    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])\n\n\n# _LT_LIBTOOL_TAGS\n# ----------------\n# Output comment and list of tags supported by the script\nm4_defun([_LT_LIBTOOL_TAGS],\n[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl\navailable_tags='_LT_TAGS'dnl\n])\n\n\n# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])\n# -----------------------------------\n# Extract the dictionary values for VARNAME (optionally with TAG) and\n# expand to a commented shell variable setting:\n#\n#    # Some comment about what VAR is for.\n#    visible_name=$lt_internal_name\nm4_define([_LT_LIBTOOL_DECLARE],\n[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],\n\t\t\t\t\t   [description])))[]dnl\nm4_pushdef([_libtool_name],\n    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl\nm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),\n    [0], [_libtool_name=[$]$1],\n    [1], [_libtool_name=$lt_[]$1],\n    [2], [_libtool_name=$lt_[]$1],\n    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl\nm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl\n])\n\n\n# _LT_LIBTOOL_CONFIG_VARS\n# -----------------------\n# Produce commented declarations of non-tagged libtool config variables\n# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'\n# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG\n# section) are produced by _LT_LIBTOOL_TAG_VARS.\nm4_defun([_LT_LIBTOOL_CONFIG_VARS],\n[m4_foreach([_lt_var],\n    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),\n    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])\n\n\n# _LT_LIBTOOL_TAG_VARS(TAG)\n# -------------------------\nm4_define([_LT_LIBTOOL_TAG_VARS],\n[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),\n    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])\n\n\n# _LT_TAGVAR(VARNAME, [TAGNAME])\n# ------------------------------\nm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])\n\n\n# _LT_CONFIG_COMMANDS\n# -------------------\n# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of\n# variables for single and double quote escaping we saved from calls\n# to _LT_DECL, we can put quote escaped variables declarations\n# into 'config.status', and then the shell code to quote escape them in\n# for loops in 'config.status'.  Finally, any additional code accumulated\n# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.\nm4_defun([_LT_CONFIG_COMMANDS],\n[AC_PROVIDE_IFELSE([LT_OUTPUT],\n\tdnl If the libtool generation code has been placed in $CONFIG_LT,\n\tdnl instead of duplicating it all over again into config.status,\n\tdnl then we will have config.status run $CONFIG_LT later, so it\n\tdnl needs to know what name is stored there:\n        [AC_CONFIG_COMMANDS([libtool],\n            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],\n    dnl If the libtool generation code is destined for config.status,\n    dnl expand the accumulated commands and init code now:\n    [AC_CONFIG_COMMANDS([libtool],\n        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])\n])#_LT_CONFIG_COMMANDS\n\n\n# Initialize.\nm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],\n[\n\n# The HP-UX ksh and POSIX shell print the target directory to stdout\n# if CDPATH is set.\n(unset CDPATH) >/dev/null 2>&1 && unset CDPATH\n\nsed_quote_subst='$sed_quote_subst'\ndouble_quote_subst='$double_quote_subst'\ndelay_variable_subst='$delay_variable_subst'\n_LT_CONFIG_STATUS_DECLARATIONS\nLTCC='$LTCC'\nLTCFLAGS='$LTCFLAGS'\ncompiler='$compiler_DEFAULT'\n\n# A function that is used when there is no print builtin or printf.\nfunc_fallback_echo ()\n{\n  eval 'cat <<_LTECHO_EOF\n\\$[]1\n_LTECHO_EOF'\n}\n\n# Quote evaled strings.\nfor var in lt_decl_all_varnames([[ \\\n]], lt_decl_quote_varnames); do\n    case \\`eval \\\\\\\\\\$ECHO \\\\\\\\\"\"\\\\\\\\\\$\\$var\"\\\\\\\\\"\\` in\n    *[[\\\\\\\\\\\\\\`\\\\\"\\\\\\$]]*)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\`\\\\\\$ECHO \\\\\"\\\\\\$\\$var\\\\\" | \\\\\\$SED \\\\\"\\\\\\$sed_quote_subst\\\\\"\\\\\\`\\\\\\\\\\\\\"\" ## exclude from sc_prohibit_nested_quotes\n      ;;\n    *)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\$\\$var\\\\\\\\\\\\\"\"\n      ;;\n    esac\ndone\n\n# Double-quote double-evaled strings.\nfor var in lt_decl_all_varnames([[ \\\n]], lt_decl_dquote_varnames); do\n    case \\`eval \\\\\\\\\\$ECHO \\\\\\\\\"\"\\\\\\\\\\$\\$var\"\\\\\\\\\"\\` in\n    *[[\\\\\\\\\\\\\\`\\\\\"\\\\\\$]]*)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\`\\\\\\$ECHO \\\\\"\\\\\\$\\$var\\\\\" | \\\\\\$SED -e \\\\\"\\\\\\$double_quote_subst\\\\\" -e \\\\\"\\\\\\$sed_quote_subst\\\\\" -e \\\\\"\\\\\\$delay_variable_subst\\\\\"\\\\\\`\\\\\\\\\\\\\"\" ## exclude from sc_prohibit_nested_quotes\n      ;;\n    *)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\$\\$var\\\\\\\\\\\\\"\"\n      ;;\n    esac\ndone\n\n_LT_OUTPUT_LIBTOOL_INIT\n])\n\n# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])\n# ------------------------------------\n# Generate a child script FILE with all initialization necessary to\n# reuse the environment learned by the parent script, and make the\n# file executable.  If COMMENT is supplied, it is inserted after the\n# '#!' sequence but before initialization text begins.  After this\n# macro, additional text can be appended to FILE to form the body of\n# the child script.  The macro ends with non-zero status if the\n# file could not be fully written (such as if the disk is full).\nm4_ifdef([AS_INIT_GENERATED],\n[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],\n[m4_defun([_LT_GENERATED_FILE_INIT],\n[m4_require([AS_PREPARE])]dnl\n[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl\n[lt_write_fail=0\ncat >$1 <<_ASEOF || lt_write_fail=1\n#! $SHELL\n# Generated by $as_me.\n$2\nSHELL=\\${CONFIG_SHELL-$SHELL}\nexport SHELL\n_ASEOF\ncat >>$1 <<\\_ASEOF || lt_write_fail=1\nAS_SHELL_SANITIZE\n_AS_PREPARE\nexec AS_MESSAGE_FD>&1\n_ASEOF\ntest 0 = \"$lt_write_fail\" && chmod +x $1[]dnl\nm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT\n\n# LT_OUTPUT\n# ---------\n# This macro allows early generation of the libtool script (before\n# AC_OUTPUT is called), incase it is used in configure for compilation\n# tests.\nAC_DEFUN([LT_OUTPUT],\n[: ${CONFIG_LT=./config.lt}\nAC_MSG_NOTICE([creating $CONFIG_LT])\n_LT_GENERATED_FILE_INIT([\"$CONFIG_LT\"],\n[# Run this file to recreate a libtool stub with the current configuration.])\n\ncat >>\"$CONFIG_LT\" <<\\_LTEOF\nlt_cl_silent=false\nexec AS_MESSAGE_LOG_FD>>config.log\n{\n  echo\n  AS_BOX([Running $as_me.])\n} >&AS_MESSAGE_LOG_FD\n\nlt_cl_help=\"\\\n'$as_me' creates a local libtool stub from the current configuration,\nfor use in further configure time tests before the real libtool is\ngenerated.\n\nUsage: $[0] [[OPTIONS]]\n\n  -h, --help      print this help, then exit\n  -V, --version   print version number, then exit\n  -q, --quiet     do not print progress messages\n  -d, --debug     don't remove temporary files\n\nReport bugs to <bug-libtool@gnu.org>.\"\n\nlt_cl_version=\"\\\nm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl\nm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])\nconfigured by $[0], generated by m4_PACKAGE_STRING.\n\nCopyright (C) 2011 Free Software Foundation, Inc.\nThis config.lt script is free software; the Free Software Foundation\ngives unlimited permision to copy, distribute and modify it.\"\n\nwhile test 0 != $[#]\ndo\n  case $[1] in\n    --version | --v* | -V )\n      echo \"$lt_cl_version\"; exit 0 ;;\n    --help | --h* | -h )\n      echo \"$lt_cl_help\"; exit 0 ;;\n    --debug | --d* | -d )\n      debug=: ;;\n    --quiet | --q* | --silent | --s* | -q )\n      lt_cl_silent=: ;;\n\n    -*) AC_MSG_ERROR([unrecognized option: $[1]\nTry '$[0] --help' for more information.]) ;;\n\n    *) AC_MSG_ERROR([unrecognized argument: $[1]\nTry '$[0] --help' for more information.]) ;;\n  esac\n  shift\ndone\n\nif $lt_cl_silent; then\n  exec AS_MESSAGE_FD>/dev/null\nfi\n_LTEOF\n\ncat >>\"$CONFIG_LT\" <<_LTEOF\n_LT_OUTPUT_LIBTOOL_COMMANDS_INIT\n_LTEOF\n\ncat >>\"$CONFIG_LT\" <<\\_LTEOF\nAC_MSG_NOTICE([creating $ofile])\n_LT_OUTPUT_LIBTOOL_COMMANDS\nAS_EXIT(0)\n_LTEOF\nchmod +x \"$CONFIG_LT\"\n\n# configure is writing to config.log, but config.lt does its own redirection,\n# appending to config.log, which fails on DOS, as config.log is still kept\n# open by configure.  Here we exec the FD to /dev/null, effectively closing\n# config.log, so it can be properly (re)opened and appended to by config.lt.\nlt_cl_success=:\ntest yes = \"$silent\" &&\n  lt_config_lt_args=\"$lt_config_lt_args --quiet\"\nexec AS_MESSAGE_LOG_FD>/dev/null\n$SHELL \"$CONFIG_LT\" $lt_config_lt_args || lt_cl_success=false\nexec AS_MESSAGE_LOG_FD>>config.log\n$lt_cl_success || AS_EXIT(1)\n])# LT_OUTPUT\n\n\n# _LT_CONFIG(TAG)\n# ---------------\n# If TAG is the built-in tag, create an initial libtool script with a\n# default configuration from the untagged config vars.  Otherwise add code\n# to config.status for appending the configuration named by TAG from the\n# matching tagged config vars.\nm4_defun([_LT_CONFIG],\n[m4_require([_LT_FILEUTILS_DEFAULTS])dnl\n_LT_CONFIG_SAVE_COMMANDS([\n  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl\n  m4_if(_LT_TAG, [C], [\n    # See if we are running on zsh, and set the options that allow our\n    # commands through without removal of \\ escapes.\n    if test -n \"${ZSH_VERSION+set}\"; then\n      setopt NO_GLOB_SUBST\n    fi\n\n    cfgfile=${ofile}T\n    trap \"$RM \\\"$cfgfile\\\"; exit 1\" 1 2 15\n    $RM \"$cfgfile\"\n\n    cat <<_LT_EOF >> \"$cfgfile\"\n#! $SHELL\n# Generated automatically by $as_me ($PACKAGE) $VERSION\n# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:\n# NOTE: Changes made to this file will be lost: look at ltmain.sh.\n\n# Provide generalized library-building support services.\n# Written by Gordon Matzigkeit, 1996\n\n_LT_COPYING\n_LT_LIBTOOL_TAGS\n\n# Configured defaults for sys_lib_dlsearch_path munging.\n: \\${LT_SYS_LIBRARY_PATH=\"$configure_time_lt_sys_library_path\"}\n\n# ### BEGIN LIBTOOL CONFIG\n_LT_LIBTOOL_CONFIG_VARS\n_LT_LIBTOOL_TAG_VARS\n# ### END LIBTOOL CONFIG\n\n_LT_EOF\n\n    cat <<'_LT_EOF' >> \"$cfgfile\"\n\n# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE\n\n_LT_PREPARE_MUNGE_PATH_LIST\n_LT_PREPARE_CC_BASENAME\n\n# ### END FUNCTIONS SHARED WITH CONFIGURE\n\n_LT_EOF\n\n  case $host_os in\n  aix3*)\n    cat <<\\_LT_EOF >> \"$cfgfile\"\n# AIX sometimes has problems with the GCC collect2 program.  For some\n# reason, if we set the COLLECT_NAMES environment variable, the problems\n# vanish in a puff of smoke.\nif test set != \"${COLLECT_NAMES+set}\"; then\n  COLLECT_NAMES=\n  export COLLECT_NAMES\nfi\n_LT_EOF\n    ;;\n  esac\n\n  _LT_PROG_LTMAIN\n\n  # We use sed instead of cat because bash on DJGPP gets confused if\n  # if finds mixed CR/LF and LF-only lines.  Since sed operates in\n  # text mode, it properly converts lines to CR/LF.  This bash problem\n  # is reportedly fixed, but why not run on old versions too?\n  sed '$q' \"$ltmain\" >> \"$cfgfile\" \\\n     || (rm -f \"$cfgfile\"; exit 1)\n\n   mv -f \"$cfgfile\" \"$ofile\" ||\n    (rm -f \"$ofile\" && cp \"$cfgfile\" \"$ofile\" && rm -f \"$cfgfile\")\n  chmod +x \"$ofile\"\n],\n[cat <<_LT_EOF >> \"$ofile\"\n\ndnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded\ndnl in a comment (ie after a #).\n# ### BEGIN LIBTOOL TAG CONFIG: $1\n_LT_LIBTOOL_TAG_VARS(_LT_TAG)\n# ### END LIBTOOL TAG CONFIG: $1\n_LT_EOF\n])dnl /m4_if\n],\n[m4_if([$1], [], [\n    PACKAGE='$PACKAGE'\n    VERSION='$VERSION'\n    RM='$RM'\n    ofile='$ofile'], [])\n])dnl /_LT_CONFIG_SAVE_COMMANDS\n])# _LT_CONFIG\n\n\n# LT_SUPPORTED_TAG(TAG)\n# ---------------------\n# Trace this macro to discover what tags are supported by the libtool\n# --tag option, using:\n#    autoconf --trace 'LT_SUPPORTED_TAG:$1'\nAC_DEFUN([LT_SUPPORTED_TAG], [])\n\n\n# C support is built-in for now\nm4_define([_LT_LANG_C_enabled], [])\nm4_define([_LT_TAGS], [])\n\n\n# LT_LANG(LANG)\n# -------------\n# Enable libtool support for the given language if not already enabled.\nAC_DEFUN([LT_LANG],\n[AC_BEFORE([$0], [LT_OUTPUT])dnl\nm4_case([$1],\n  [C],\t\t\t[_LT_LANG(C)],\n  [C++],\t\t[_LT_LANG(CXX)],\n  [Go],\t\t\t[_LT_LANG(GO)],\n  [Java],\t\t[_LT_LANG(GCJ)],\n  [Fortran 77],\t\t[_LT_LANG(F77)],\n  [Fortran],\t\t[_LT_LANG(FC)],\n  [Windows Resource],\t[_LT_LANG(RC)],\n  [m4_ifdef([_LT_LANG_]$1[_CONFIG],\n    [_LT_LANG($1)],\n    [m4_fatal([$0: unsupported language: \"$1\"])])])dnl\n])# LT_LANG\n\n\n# _LT_LANG(LANGNAME)\n# ------------------\nm4_defun([_LT_LANG],\n[m4_ifdef([_LT_LANG_]$1[_enabled], [],\n  [LT_SUPPORTED_TAG([$1])dnl\n  m4_append([_LT_TAGS], [$1 ])dnl\n  m4_define([_LT_LANG_]$1[_enabled], [])dnl\n  _LT_LANG_$1_CONFIG($1)])dnl\n])# _LT_LANG\n\n\nm4_ifndef([AC_PROG_GO], [\n# NOTE: This macro has been submitted for inclusion into   #\n#  GNU Autoconf as AC_PROG_GO.  When it is available in    #\n#  a released version of Autoconf we should remove this    #\n#  macro and use it instead.                               #\nm4_defun([AC_PROG_GO],\n[AC_LANG_PUSH(Go)dnl\nAC_ARG_VAR([GOC],     [Go compiler command])dnl\nAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl\n_AC_ARG_VAR_LDFLAGS()dnl\nAC_CHECK_TOOL(GOC, gccgo)\nif test -z \"$GOC\"; then\n  if test -n \"$ac_tool_prefix\"; then\n    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])\n  fi\nfi\nif test -z \"$GOC\"; then\n  AC_CHECK_PROG(GOC, gccgo, gccgo, false)\nfi\n])#m4_defun\n])#m4_ifndef\n\n\n# _LT_LANG_DEFAULT_CONFIG\n# -----------------------\nm4_defun([_LT_LANG_DEFAULT_CONFIG],\n[AC_PROVIDE_IFELSE([AC_PROG_CXX],\n  [LT_LANG(CXX)],\n  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])\n\nAC_PROVIDE_IFELSE([AC_PROG_F77],\n  [LT_LANG(F77)],\n  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])\n\nAC_PROVIDE_IFELSE([AC_PROG_FC],\n  [LT_LANG(FC)],\n  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])\n\ndnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal\ndnl pulling things in needlessly.\nAC_PROVIDE_IFELSE([AC_PROG_GCJ],\n  [LT_LANG(GCJ)],\n  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],\n    [LT_LANG(GCJ)],\n    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],\n      [LT_LANG(GCJ)],\n      [m4_ifdef([AC_PROG_GCJ],\n\t[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])\n       m4_ifdef([A][M_PROG_GCJ],\n\t[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])\n       m4_ifdef([LT_PROG_GCJ],\n\t[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])\n\nAC_PROVIDE_IFELSE([AC_PROG_GO],\n  [LT_LANG(GO)],\n  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])\n\nAC_PROVIDE_IFELSE([LT_PROG_RC],\n  [LT_LANG(RC)],\n  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])\n])# _LT_LANG_DEFAULT_CONFIG\n\n# Obsolete macros:\nAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])\nAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])\nAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])\nAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])\nAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_CXX], [])\ndnl AC_DEFUN([AC_LIBTOOL_F77], [])\ndnl AC_DEFUN([AC_LIBTOOL_FC], [])\ndnl AC_DEFUN([AC_LIBTOOL_GCJ], [])\ndnl AC_DEFUN([AC_LIBTOOL_RC], [])\n\n\n# _LT_TAG_COMPILER\n# ----------------\nm4_defun([_LT_TAG_COMPILER],\n[AC_REQUIRE([AC_PROG_CC])dnl\n\n_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl\n_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl\n_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl\n_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl\n\n# If no C compiler was specified, use CC.\nLTCC=${LTCC-\"$CC\"}\n\n# If no C compiler flags were specified, use CFLAGS.\nLTCFLAGS=${LTCFLAGS-\"$CFLAGS\"}\n\n# Allow CC to be a program name with arguments.\ncompiler=$CC\n])# _LT_TAG_COMPILER\n\n\n# _LT_COMPILER_BOILERPLATE\n# ------------------------\n# Check for compiler boilerplate output or warnings with\n# the simple compiler test code.\nm4_defun([_LT_COMPILER_BOILERPLATE],\n[m4_require([_LT_DECL_SED])dnl\nac_outfile=conftest.$ac_objext\necho \"$lt_simple_compile_test_code\" >conftest.$ac_ext\neval \"$ac_compile\" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err\n_lt_compiler_boilerplate=`cat conftest.err`\n$RM conftest*\n])# _LT_COMPILER_BOILERPLATE\n\n\n# _LT_LINKER_BOILERPLATE\n# ----------------------\n# Check for linker boilerplate output or warnings with\n# the simple link test code.\nm4_defun([_LT_LINKER_BOILERPLATE],\n[m4_require([_LT_DECL_SED])dnl\nac_outfile=conftest.$ac_objext\necho \"$lt_simple_link_test_code\" >conftest.$ac_ext\neval \"$ac_link\" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err\n_lt_linker_boilerplate=`cat conftest.err`\n$RM -r conftest*\n])# _LT_LINKER_BOILERPLATE\n\n# _LT_REQUIRED_DARWIN_CHECKS\n# -------------------------\nm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[\n  case $host_os in\n    rhapsody* | darwin*)\n    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])\n    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])\n    AC_CHECK_TOOL([LIPO], [lipo], [:])\n    AC_CHECK_TOOL([OTOOL], [otool], [:])\n    AC_CHECK_TOOL([OTOOL64], [otool64], [:])\n    _LT_DECL([], [DSYMUTIL], [1],\n      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])\n    _LT_DECL([], [NMEDIT], [1],\n      [Tool to change global to local symbols on Mac OS X])\n    _LT_DECL([], [LIPO], [1],\n      [Tool to manipulate fat objects and archives on Mac OS X])\n    _LT_DECL([], [OTOOL], [1],\n      [ldd/readelf like tool for Mach-O binaries on Mac OS X])\n    _LT_DECL([], [OTOOL64], [1],\n      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])\n\n    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],\n      [lt_cv_apple_cc_single_mod=no\n      if test -z \"$LT_MULTI_MODULE\"; then\n\t# By default we will add the -single_module flag. You can override\n\t# by either setting the environment variable LT_MULTI_MODULE\n\t# non-empty at configure time, or by adding -multi_module to the\n\t# link flags.\n\trm -rf libconftest.dylib*\n\techo \"int foo(void){return 1;}\" > conftest.c\n\techo \"$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \\\n-dynamiclib -Wl,-single_module conftest.c\" >&AS_MESSAGE_LOG_FD\n\t$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \\\n\t  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err\n        _lt_result=$?\n\t# If there is a non-empty error log, and \"single_module\"\n\t# appears in it, assume the flag caused a linker warning\n        if test -s conftest.err && $GREP single_module conftest.err; then\n\t  cat conftest.err >&AS_MESSAGE_LOG_FD\n\t# Otherwise, if the output was created with a 0 exit code from\n\t# the compiler, it worked.\n\telif test -f libconftest.dylib && test 0 = \"$_lt_result\"; then\n\t  lt_cv_apple_cc_single_mod=yes\n\telse\n\t  cat conftest.err >&AS_MESSAGE_LOG_FD\n\tfi\n\trm -rf libconftest.dylib*\n\trm -f conftest.*\n      fi])\n\n    AC_CACHE_CHECK([for -exported_symbols_list linker flag],\n      [lt_cv_ld_exported_symbols_list],\n      [lt_cv_ld_exported_symbols_list=no\n      save_LDFLAGS=$LDFLAGS\n      echo \"_main\" > conftest.sym\n      LDFLAGS=\"$LDFLAGS -Wl,-exported_symbols_list,conftest.sym\"\n      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],\n\t[lt_cv_ld_exported_symbols_list=yes],\n\t[lt_cv_ld_exported_symbols_list=no])\n\tLDFLAGS=$save_LDFLAGS\n    ])\n\n    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],\n      [lt_cv_ld_force_load=no\n      cat > conftest.c << _LT_EOF\nint forced_loaded() { return 2;}\n_LT_EOF\n      echo \"$LTCC $LTCFLAGS -c -o conftest.o conftest.c\" >&AS_MESSAGE_LOG_FD\n      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD\n      echo \"$AR cru libconftest.a conftest.o\" >&AS_MESSAGE_LOG_FD\n      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD\n      echo \"$RANLIB libconftest.a\" >&AS_MESSAGE_LOG_FD\n      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD\n      cat > conftest.c << _LT_EOF\nint main() { return 0;}\n_LT_EOF\n      echo \"$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a\" >&AS_MESSAGE_LOG_FD\n      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err\n      _lt_result=$?\n      if test -s conftest.err && $GREP force_load conftest.err; then\n\tcat conftest.err >&AS_MESSAGE_LOG_FD\n      elif test -f conftest && test 0 = \"$_lt_result\" && $GREP forced_load conftest >/dev/null 2>&1; then\n\tlt_cv_ld_force_load=yes\n      else\n\tcat conftest.err >&AS_MESSAGE_LOG_FD\n      fi\n        rm -f conftest.err libconftest.a conftest conftest.c\n        rm -rf conftest.dSYM\n    ])\n    case $host_os in\n    rhapsody* | darwin1.[[012]])\n      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;\n    darwin1.*)\n      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;\n    darwin*) # darwin 5.x on\n      # if running on 10.5 or later, the deployment target defaults\n      # to the OS version, if on x86, and 10.4, the deployment\n      # target defaults to 10.4. Don't you love it?\n      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in\n\t10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)\n\t  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;\n\t10.[[012]][[,.]]*)\n\t  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;\n\t10.*)\n\t  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;\n      esac\n    ;;\n  esac\n    if test yes = \"$lt_cv_apple_cc_single_mod\"; then\n      _lt_dar_single_mod='$single_module'\n    fi\n    if test yes = \"$lt_cv_ld_exported_symbols_list\"; then\n      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'\n    else\n      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'\n    fi\n    if test : != \"$DSYMUTIL\" && test no = \"$lt_cv_ld_force_load\"; then\n      _lt_dsymutil='~$DSYMUTIL $lib || :'\n    else\n      _lt_dsymutil=\n    fi\n    ;;\n  esac\n])\n\n\n# _LT_DARWIN_LINKER_FEATURES([TAG])\n# ---------------------------------\n# Checks for linker and compiler features on darwin\nm4_defun([_LT_DARWIN_LINKER_FEATURES],\n[\n  m4_require([_LT_REQUIRED_DARWIN_CHECKS])\n  _LT_TAGVAR(archive_cmds_need_lc, $1)=no\n  _LT_TAGVAR(hardcode_direct, $1)=no\n  _LT_TAGVAR(hardcode_automatic, $1)=yes\n  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported\n  if test yes = \"$lt_cv_ld_force_load\"; then\n    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\\\"\\\"; do test  -n \\\"$conv\\\" && new_convenience=\\\"$new_convenience $wl-force_load,$conv\\\"; done; func_echo_all \\\"$new_convenience\\\"`'\n    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],\n                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])\n  else\n    _LT_TAGVAR(whole_archive_flag_spec, $1)=''\n  fi\n  _LT_TAGVAR(link_all_deplibs, $1)=yes\n  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined\n  case $cc_basename in\n     ifort*|nagfor*) _lt_dar_can_shared=yes ;;\n     *) _lt_dar_can_shared=$GCC ;;\n  esac\n  if test yes = \"$_lt_dar_can_shared\"; then\n    output_verbose_link_cmd=func_echo_all\n    _LT_TAGVAR(archive_cmds, $1)=\"\\$CC -dynamiclib \\$allow_undefined_flag -o \\$lib \\$libobjs \\$deplibs \\$compiler_flags -install_name \\$rpath/\\$soname \\$verstring $_lt_dar_single_mod$_lt_dsymutil\"\n    _LT_TAGVAR(module_cmds, $1)=\"\\$CC \\$allow_undefined_flag -o \\$lib -bundle \\$libobjs \\$deplibs \\$compiler_flags$_lt_dsymutil\"\n    _LT_TAGVAR(archive_expsym_cmds, $1)=\"sed 's|^|_|' < \\$export_symbols > \\$output_objdir/\\$libname-symbols.expsym~\\$CC -dynamiclib \\$allow_undefined_flag -o \\$lib \\$libobjs \\$deplibs \\$compiler_flags -install_name \\$rpath/\\$soname \\$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil\"\n    _LT_TAGVAR(module_expsym_cmds, $1)=\"sed -e 's|^|_|' < \\$export_symbols > \\$output_objdir/\\$libname-symbols.expsym~\\$CC \\$allow_undefined_flag -o \\$lib -bundle \\$libobjs \\$deplibs \\$compiler_flags$_lt_dar_export_syms$_lt_dsymutil\"\n    m4_if([$1], [CXX],\n[   if test yes != \"$lt_cv_apple_cc_single_mod\"; then\n      _LT_TAGVAR(archive_cmds, $1)=\"\\$CC -r -keep_private_externs -nostdlib -o \\$lib-master.o \\$libobjs~\\$CC -dynamiclib \\$allow_undefined_flag -o \\$lib \\$lib-master.o \\$deplibs \\$compiler_flags -install_name \\$rpath/\\$soname \\$verstring$_lt_dsymutil\"\n      _LT_TAGVAR(archive_expsym_cmds, $1)=\"sed 's|^|_|' < \\$export_symbols > \\$output_objdir/\\$libname-symbols.expsym~\\$CC -r -keep_private_externs -nostdlib -o \\$lib-master.o \\$libobjs~\\$CC -dynamiclib \\$allow_undefined_flag -o \\$lib \\$lib-master.o \\$deplibs \\$compiler_flags -install_name \\$rpath/\\$soname \\$verstring$_lt_dar_export_syms$_lt_dsymutil\"\n    fi\n],[])\n  else\n  _LT_TAGVAR(ld_shlibs, $1)=no\n  fi\n])\n\n# _LT_SYS_MODULE_PATH_AIX([TAGNAME])\n# ----------------------------------\n# Links a minimal program and checks the executable\n# for the system default hardcoded library path. In most cases,\n# this is /usr/lib:/lib, but when the MPI compilers are used\n# the location of the communication and MPI libs are included too.\n# If we don't find anything, use the default library path according\n# to the aix ld manual.\n# Store the results from the different compilers for each TAGNAME.\n# Allow to override them for all tags through lt_cv_aix_libpath.\nm4_defun([_LT_SYS_MODULE_PATH_AIX],\n[m4_require([_LT_DECL_SED])dnl\nif test set = \"${lt_cv_aix_libpath+set}\"; then\n  aix_libpath=$lt_cv_aix_libpath\nelse\n  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],\n  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[\n  lt_aix_libpath_sed='[\n      /Import File Strings/,/^$/ {\n\t  /^0/ {\n\t      s/^0  *\\([^ ]*\\) *$/\\1/\n\t      p\n\t  }\n      }]'\n  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e \"$lt_aix_libpath_sed\"`\n  # Check for a 64-bit object if we didn't find anything.\n  if test -z \"$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])\"; then\n    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e \"$lt_aix_libpath_sed\"`\n  fi],[])\n  if test -z \"$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])\"; then\n    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib\n  fi\n  ])\n  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])\nfi\n])# _LT_SYS_MODULE_PATH_AIX\n\n\n# _LT_SHELL_INIT(ARG)\n# -------------------\nm4_define([_LT_SHELL_INIT],\n[m4_divert_text([M4SH-INIT], [$1\n])])# _LT_SHELL_INIT\n\n\n\n# _LT_PROG_ECHO_BACKSLASH\n# -----------------------\n# Find how we can fake an echo command that does not interpret backslash.\n# In particular, with Autoconf 2.60 or later we add some code to the start\n# of the generated configure script that will find a shell with a builtin\n# printf (that we can use as an echo command).\nm4_defun([_LT_PROG_ECHO_BACKSLASH],\n[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\nECHO=$ECHO$ECHO$ECHO$ECHO$ECHO\nECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO\n\nAC_MSG_CHECKING([how to print strings])\n# Test print first, because it will be a builtin if present.\nif test \"X`( print -r -- -n ) 2>/dev/null`\" = X-n && \\\n   test \"X`print -r -- $ECHO 2>/dev/null`\" = \"X$ECHO\"; then\n  ECHO='print -r --'\nelif test \"X`printf %s $ECHO 2>/dev/null`\" = \"X$ECHO\"; then\n  ECHO='printf %s\\n'\nelse\n  # Use this function as a fallback that always works.\n  func_fallback_echo ()\n  {\n    eval 'cat <<_LTECHO_EOF\n$[]1\n_LTECHO_EOF'\n  }\n  ECHO='func_fallback_echo'\nfi\n\n# func_echo_all arg...\n# Invoke $ECHO with all args, space-separated.\nfunc_echo_all ()\n{\n    $ECHO \"$*\"\n}\n\ncase $ECHO in\n  printf*) AC_MSG_RESULT([printf]) ;;\n  print*) AC_MSG_RESULT([print -r]) ;;\n  *) AC_MSG_RESULT([cat]) ;;\nesac\n\nm4_ifdef([_AS_DETECT_SUGGESTED],\n[_AS_DETECT_SUGGESTED([\n  test -n \"${ZSH_VERSION+set}${BASH_VERSION+set}\" || (\n    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\n    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO\n    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO\n    PATH=/empty FPATH=/empty; export PATH FPATH\n    test \"X`printf %s $ECHO`\" = \"X$ECHO\" \\\n      || test \"X`print -r -- $ECHO`\" = \"X$ECHO\" )])])\n\n_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])\n_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])\n])# _LT_PROG_ECHO_BACKSLASH\n\n\n# _LT_WITH_SYSROOT\n# ----------------\nAC_DEFUN([_LT_WITH_SYSROOT],\n[AC_MSG_CHECKING([for sysroot])\nAC_ARG_WITH([sysroot],\n[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],\n  [Search for dependent libraries within DIR (or the compiler's sysroot\n   if not specified).])],\n[], [with_sysroot=no])\n\ndnl lt_sysroot will always be passed unquoted.  We quote it here\ndnl in case the user passed a directory name.\nlt_sysroot=\ncase $with_sysroot in #(\n yes)\n   if test yes = \"$GCC\"; then\n     lt_sysroot=`$CC --print-sysroot 2>/dev/null`\n   fi\n   ;; #(\n /*)\n   lt_sysroot=`echo \"$with_sysroot\" | sed -e \"$sed_quote_subst\"`\n   ;; #(\n no|'')\n   ;; #(\n *)\n   AC_MSG_RESULT([$with_sysroot])\n   AC_MSG_ERROR([The sysroot must be an absolute path.])\n   ;;\nesac\n\n AC_MSG_RESULT([${lt_sysroot:-no}])\n_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl\n[dependent libraries, and where our libraries should be installed.])])\n\n# _LT_ENABLE_LOCK\n# ---------------\nm4_defun([_LT_ENABLE_LOCK],\n[AC_ARG_ENABLE([libtool-lock],\n  [AS_HELP_STRING([--disable-libtool-lock],\n    [avoid locking (might break parallel builds)])])\ntest no = \"$enable_libtool_lock\" || enable_libtool_lock=yes\n\n# Some flags need to be propagated to the compiler or linker for good\n# libtool support.\ncase $host in\nia64-*-hpux*)\n  # Find out what ABI is being produced by ac_compile, and set mode\n  # options accordingly.\n  echo 'int i;' > conftest.$ac_ext\n  if AC_TRY_EVAL(ac_compile); then\n    case `/usr/bin/file conftest.$ac_objext` in\n      *ELF-32*)\n\tHPUX_IA64_MODE=32\n\t;;\n      *ELF-64*)\n\tHPUX_IA64_MODE=64\n\t;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\n*-*-irix6*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.\n  echo '[#]line '$LINENO' \"configure\"' > conftest.$ac_ext\n  if AC_TRY_EVAL(ac_compile); then\n    if test yes = \"$lt_cv_prog_gnu_ld\"; then\n      case `/usr/bin/file conftest.$ac_objext` in\n\t*32-bit*)\n\t  LD=\"${LD-ld} -melf32bsmip\"\n\t  ;;\n\t*N32*)\n\t  LD=\"${LD-ld} -melf32bmipn32\"\n\t  ;;\n\t*64-bit*)\n\t  LD=\"${LD-ld} -melf64bmip\"\n\t;;\n      esac\n    else\n      case `/usr/bin/file conftest.$ac_objext` in\n\t*32-bit*)\n\t  LD=\"${LD-ld} -32\"\n\t  ;;\n\t*N32*)\n\t  LD=\"${LD-ld} -n32\"\n\t  ;;\n\t*64-bit*)\n\t  LD=\"${LD-ld} -64\"\n\t  ;;\n      esac\n    fi\n  fi\n  rm -rf conftest*\n  ;;\n\nmips64*-*linux*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.\n  echo '[#]line '$LINENO' \"configure\"' > conftest.$ac_ext\n  if AC_TRY_EVAL(ac_compile); then\n    emul=elf\n    case `/usr/bin/file conftest.$ac_objext` in\n      *32-bit*)\n\temul=\"${emul}32\"\n\t;;\n      *64-bit*)\n\temul=\"${emul}64\"\n\t;;\n    esac\n    case `/usr/bin/file conftest.$ac_objext` in\n      *MSB*)\n\temul=\"${emul}btsmip\"\n\t;;\n      *LSB*)\n\temul=\"${emul}ltsmip\"\n\t;;\n    esac\n    case `/usr/bin/file conftest.$ac_objext` in\n      *N32*)\n\temul=\"${emul}n32\"\n\t;;\n    esac\n    LD=\"${LD-ld} -m $emul\"\n  fi\n  rm -rf conftest*\n  ;;\n\nx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \\\ns390*-*linux*|s390*-*tpf*|sparc*-*linux*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.  Note that the listed cases only cover the\n  # situations where additional linker options are needed (such as when\n  # doing 32-bit compilation for a host where ld defaults to 64-bit, or\n  # vice versa); the common cases where no linker options are needed do\n  # not appear in the list.\n  echo 'int i;' > conftest.$ac_ext\n  if AC_TRY_EVAL(ac_compile); then\n    case `/usr/bin/file conftest.o` in\n      *32-bit*)\n\tcase $host in\n\t  x86_64-*kfreebsd*-gnu)\n\t    LD=\"${LD-ld} -m elf_i386_fbsd\"\n\t    ;;\n\t  x86_64-*linux*)\n\t    case `/usr/bin/file conftest.o` in\n\t      *x86-64*)\n\t\tLD=\"${LD-ld} -m elf32_x86_64\"\n\t\t;;\n\t      *)\n\t\tLD=\"${LD-ld} -m elf_i386\"\n\t\t;;\n\t    esac\n\t    ;;\n\t  powerpc64le-*linux*)\n\t    LD=\"${LD-ld} -m elf32lppclinux\"\n\t    ;;\n\t  powerpc64-*linux*)\n\t    LD=\"${LD-ld} -m elf32ppclinux\"\n\t    ;;\n\t  s390x-*linux*)\n\t    LD=\"${LD-ld} -m elf_s390\"\n\t    ;;\n\t  sparc64-*linux*)\n\t    LD=\"${LD-ld} -m elf32_sparc\"\n\t    ;;\n\tesac\n\t;;\n      *64-bit*)\n\tcase $host in\n\t  x86_64-*kfreebsd*-gnu)\n\t    LD=\"${LD-ld} -m elf_x86_64_fbsd\"\n\t    ;;\n\t  x86_64-*linux*)\n\t    LD=\"${LD-ld} -m elf_x86_64\"\n\t    ;;\n\t  powerpcle-*linux*)\n\t    LD=\"${LD-ld} -m elf64lppc\"\n\t    ;;\n\t  powerpc-*linux*)\n\t    LD=\"${LD-ld} -m elf64ppc\"\n\t    ;;\n\t  s390*-*linux*|s390*-*tpf*)\n\t    LD=\"${LD-ld} -m elf64_s390\"\n\t    ;;\n\t  sparc*-*linux*)\n\t    LD=\"${LD-ld} -m elf64_sparc\"\n\t    ;;\n\tesac\n\t;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\n\n*-*-sco3.2v5*)\n  # On SCO OpenServer 5, we need -belf to get full-featured binaries.\n  SAVE_CFLAGS=$CFLAGS\n  CFLAGS=\"$CFLAGS -belf\"\n  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,\n    [AC_LANG_PUSH(C)\n     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])\n     AC_LANG_POP])\n  if test yes != \"$lt_cv_cc_needs_belf\"; then\n    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf\n    CFLAGS=$SAVE_CFLAGS\n  fi\n  ;;\n*-*solaris*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.\n  echo 'int i;' > conftest.$ac_ext\n  if AC_TRY_EVAL(ac_compile); then\n    case `/usr/bin/file conftest.o` in\n    *64-bit*)\n      case $lt_cv_prog_gnu_ld in\n      yes*)\n        case $host in\n        i?86-*-solaris*|x86_64-*-solaris*)\n          LD=\"${LD-ld} -m elf_x86_64\"\n          ;;\n        sparc*-*-solaris*)\n          LD=\"${LD-ld} -m elf64_sparc\"\n          ;;\n        esac\n        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.\n        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then\n          LD=${LD-ld}_sol2\n        fi\n        ;;\n      *)\n\tif ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then\n\t  LD=\"${LD-ld} -64\"\n\tfi\n\t;;\n      esac\n      ;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\nesac\n\nneed_locks=$enable_libtool_lock\n])# _LT_ENABLE_LOCK\n\n\n# _LT_PROG_AR\n# -----------\nm4_defun([_LT_PROG_AR],\n[AC_CHECK_TOOLS(AR, [ar], false)\n: ${AR=ar}\n: ${AR_FLAGS=cru}\n_LT_DECL([], [AR], [1], [The archiver])\n_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])\n\nAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],\n  [lt_cv_ar_at_file=no\n   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],\n     [echo conftest.$ac_objext > conftest.lst\n      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'\n      AC_TRY_EVAL([lt_ar_try])\n      if test 0 -eq \"$ac_status\"; then\n\t# Ensure the archiver fails upon bogus file names.\n\trm -f conftest.$ac_objext libconftest.a\n\tAC_TRY_EVAL([lt_ar_try])\n\tif test 0 -ne \"$ac_status\"; then\n          lt_cv_ar_at_file=@\n        fi\n      fi\n      rm -f conftest.* libconftest.a\n     ])\n  ])\n\nif test no = \"$lt_cv_ar_at_file\"; then\n  archiver_list_spec=\nelse\n  archiver_list_spec=$lt_cv_ar_at_file\nfi\n_LT_DECL([], [archiver_list_spec], [1],\n  [How to feed a file listing to the archiver])\n])# _LT_PROG_AR\n\n\n# _LT_CMD_OLD_ARCHIVE\n# -------------------\nm4_defun([_LT_CMD_OLD_ARCHIVE],\n[_LT_PROG_AR\n\nAC_CHECK_TOOL(STRIP, strip, :)\ntest -z \"$STRIP\" && STRIP=:\n_LT_DECL([], [STRIP], [1], [A symbol stripping program])\n\nAC_CHECK_TOOL(RANLIB, ranlib, :)\ntest -z \"$RANLIB\" && RANLIB=:\n_LT_DECL([], [RANLIB], [1],\n    [Commands used to install an old-style archive])\n\n# Determine commands to create old-style static archives.\nold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'\nold_postinstall_cmds='chmod 644 $oldlib'\nold_postuninstall_cmds=\n\nif test -n \"$RANLIB\"; then\n  case $host_os in\n  bitrig* | openbsd*)\n    old_postinstall_cmds=\"$old_postinstall_cmds~\\$RANLIB -t \\$tool_oldlib\"\n    ;;\n  *)\n    old_postinstall_cmds=\"$old_postinstall_cmds~\\$RANLIB \\$tool_oldlib\"\n    ;;\n  esac\n  old_archive_cmds=\"$old_archive_cmds~\\$RANLIB \\$tool_oldlib\"\nfi\n\ncase $host_os in\n  darwin*)\n    lock_old_archive_extraction=yes ;;\n  *)\n    lock_old_archive_extraction=no ;;\nesac\n_LT_DECL([], [old_postinstall_cmds], [2])\n_LT_DECL([], [old_postuninstall_cmds], [2])\n_LT_TAGDECL([], [old_archive_cmds], [2],\n    [Commands used to build an old-style archive])\n_LT_DECL([], [lock_old_archive_extraction], [0],\n    [Whether to use a lock for old archive extraction])\n])# _LT_CMD_OLD_ARCHIVE\n\n\n# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,\n#\t\t[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])\n# ----------------------------------------------------------------\n# Check whether the given compiler option works\nAC_DEFUN([_LT_COMPILER_OPTION],\n[m4_require([_LT_FILEUTILS_DEFAULTS])dnl\nm4_require([_LT_DECL_SED])dnl\nAC_CACHE_CHECK([$1], [$2],\n  [$2=no\n   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])\n   echo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n   lt_compiler_flag=\"$3\"  ## exclude from sc_useless_quotes_in_assignment\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   # The option is referenced via a variable to avoid confusing sed.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}\\{0,1\\} :&$lt_compiler_flag :; t' \\\n   -e 's: [[^ ]]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:$LINENO: $lt_compile\\\"\" >&AS_MESSAGE_LOG_FD)\n   (eval \"$lt_compile\" 2>conftest.err)\n   ac_status=$?\n   cat conftest.err >&AS_MESSAGE_LOG_FD\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&AS_MESSAGE_LOG_FD\n   if (exit $ac_status) && test -s \"$ac_outfile\"; then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings other than the usual output.\n     $ECHO \"$_lt_compiler_boilerplate\" | $SED '/^$/d' >conftest.exp\n     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2\n     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then\n       $2=yes\n     fi\n   fi\n   $RM conftest*\n])\n\nif test yes = \"[$]$2\"; then\n    m4_if([$5], , :, [$5])\nelse\n    m4_if([$6], , :, [$6])\nfi\n])# _LT_COMPILER_OPTION\n\n# Old name:\nAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])\n\n\n# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,\n#                  [ACTION-SUCCESS], [ACTION-FAILURE])\n# ----------------------------------------------------\n# Check whether the given linker option works\nAC_DEFUN([_LT_LINKER_OPTION],\n[m4_require([_LT_FILEUTILS_DEFAULTS])dnl\nm4_require([_LT_DECL_SED])dnl\nAC_CACHE_CHECK([$1], [$2],\n  [$2=no\n   save_LDFLAGS=$LDFLAGS\n   LDFLAGS=\"$LDFLAGS $3\"\n   echo \"$lt_simple_link_test_code\" > conftest.$ac_ext\n   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then\n     # The linker can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test -s conftest.err; then\n       # Append any errors to the config.log.\n       cat conftest.err 1>&AS_MESSAGE_LOG_FD\n       $ECHO \"$_lt_linker_boilerplate\" | $SED '/^$/d' > conftest.exp\n       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2\n       if diff conftest.exp conftest.er2 >/dev/null; then\n         $2=yes\n       fi\n     else\n       $2=yes\n     fi\n   fi\n   $RM -r conftest*\n   LDFLAGS=$save_LDFLAGS\n])\n\nif test yes = \"[$]$2\"; then\n    m4_if([$4], , :, [$4])\nelse\n    m4_if([$5], , :, [$5])\nfi\n])# _LT_LINKER_OPTION\n\n# Old name:\nAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])\n\n\n# LT_CMD_MAX_LEN\n#---------------\nAC_DEFUN([LT_CMD_MAX_LEN],\n[AC_REQUIRE([AC_CANONICAL_HOST])dnl\n# find the maximum length of command line arguments\nAC_MSG_CHECKING([the maximum length of command line arguments])\nAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl\n  i=0\n  teststring=ABCD\n\n  case $build_os in\n  msdosdjgpp*)\n    # On DJGPP, this test can blow up pretty badly due to problems in libc\n    # (any single argument exceeding 2000 bytes causes a buffer overrun\n    # during glob expansion).  Even if it were fixed, the result of this\n    # check would be larger than it should be.\n    lt_cv_sys_max_cmd_len=12288;    # 12K is about right\n    ;;\n\n  gnu*)\n    # Under GNU Hurd, this test is not required because there is\n    # no limit to the length of command line arguments.\n    # Libtool will interpret -1 as no limit whatsoever\n    lt_cv_sys_max_cmd_len=-1;\n    ;;\n\n  cygwin* | mingw* | cegcc*)\n    # On Win9x/ME, this test blows up -- it succeeds, but takes\n    # about 5 minutes as the teststring grows exponentially.\n    # Worse, since 9x/ME are not pre-emptively multitasking,\n    # you end up with a \"frozen\" computer, even though with patience\n    # the test eventually succeeds (with a max line length of 256k).\n    # Instead, let's just punt: use the minimum linelength reported by\n    # all of the supported platforms: 8192 (on NT/2K/XP).\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n  mint*)\n    # On MiNT this can take a long time and run out of memory.\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n  amigaos*)\n    # On AmigaOS with pdksh, this test takes hours, literally.\n    # So we just punt and use a minimum line length of 8192.\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)\n    # This has been around since 386BSD, at least.  Likely further.\n    if test -x /sbin/sysctl; then\n      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`\n    elif test -x /usr/sbin/sysctl; then\n      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`\n    else\n      lt_cv_sys_max_cmd_len=65536\t# usable default for all BSDs\n    fi\n    # And add a safety zone\n    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\/ 4`\n    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\* 3`\n    ;;\n\n  interix*)\n    # We know the value 262144 and hardcode it with a safety zone (like BSD)\n    lt_cv_sys_max_cmd_len=196608\n    ;;\n\n  os2*)\n    # The test takes a long time on OS/2.\n    lt_cv_sys_max_cmd_len=8192\n    ;;\n\n  osf*)\n    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure\n    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not\n    # nice to cause kernel panics so lets avoid the loop below.\n    # First set a reasonable default.\n    lt_cv_sys_max_cmd_len=16384\n    #\n    if test -x /sbin/sysconfig; then\n      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in\n        *1*) lt_cv_sys_max_cmd_len=-1 ;;\n      esac\n    fi\n    ;;\n  sco3.2v5*)\n    lt_cv_sys_max_cmd_len=102400\n    ;;\n  sysv5* | sco5v6* | sysv4.2uw2*)\n    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`\n    if test -n \"$kargmax\"; then\n      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[\t ]]//'`\n    else\n      lt_cv_sys_max_cmd_len=32768\n    fi\n    ;;\n  *)\n    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`\n    if test -n \"$lt_cv_sys_max_cmd_len\" && \\\n       test undefined != \"$lt_cv_sys_max_cmd_len\"; then\n      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\/ 4`\n      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\* 3`\n    else\n      # Make teststring a little bigger before we do anything with it.\n      # a 1K string should be a reasonable start.\n      for i in 1 2 3 4 5 6 7 8; do\n        teststring=$teststring$teststring\n      done\n      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}\n      # If test is not a shell built-in, we'll probably end up computing a\n      # maximum length that is only half of the actual maximum length, but\n      # we can't tell.\n      while { test X`env echo \"$teststring$teststring\" 2>/dev/null` \\\n\t         = \"X$teststring$teststring\"; } >/dev/null 2>&1 &&\n\t      test 17 != \"$i\" # 1/2 MB should be enough\n      do\n        i=`expr $i + 1`\n        teststring=$teststring$teststring\n      done\n      # Only check the string length outside the loop.\n      lt_cv_sys_max_cmd_len=`expr \"X$teststring\" : \".*\" 2>&1`\n      teststring=\n      # Add a significant safety factor because C++ compilers can tack on\n      # massive amounts of additional arguments before passing them to the\n      # linker.  It appears as though 1/2 is a usable value.\n      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\/ 2`\n    fi\n    ;;\n  esac\n])\nif test -n \"$lt_cv_sys_max_cmd_len\"; then\n  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)\nelse\n  AC_MSG_RESULT(none)\nfi\nmax_cmd_len=$lt_cv_sys_max_cmd_len\n_LT_DECL([], [max_cmd_len], [0],\n    [What is the maximum length of a command?])\n])# LT_CMD_MAX_LEN\n\n# Old name:\nAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])\n\n\n# _LT_HEADER_DLFCN\n# ----------------\nm4_defun([_LT_HEADER_DLFCN],\n[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl\n])# _LT_HEADER_DLFCN\n\n\n# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,\n#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)\n# ----------------------------------------------------------------\nm4_defun([_LT_TRY_DLOPEN_SELF],\n[m4_require([_LT_HEADER_DLFCN])dnl\nif test yes = \"$cross_compiling\"; then :\n  [$4]\nelse\n  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2\n  lt_status=$lt_dlunknown\n  cat > conftest.$ac_ext <<_LT_EOF\n[#line $LINENO \"configure\"\n#include \"confdefs.h\"\n\n#if HAVE_DLFCN_H\n#include <dlfcn.h>\n#endif\n\n#include <stdio.h>\n\n#ifdef RTLD_GLOBAL\n#  define LT_DLGLOBAL\t\tRTLD_GLOBAL\n#else\n#  ifdef DL_GLOBAL\n#    define LT_DLGLOBAL\t\tDL_GLOBAL\n#  else\n#    define LT_DLGLOBAL\t\t0\n#  endif\n#endif\n\n/* We may have to define LT_DLLAZY_OR_NOW in the command line if we\n   find out it does not work in some platform. */\n#ifndef LT_DLLAZY_OR_NOW\n#  ifdef RTLD_LAZY\n#    define LT_DLLAZY_OR_NOW\t\tRTLD_LAZY\n#  else\n#    ifdef DL_LAZY\n#      define LT_DLLAZY_OR_NOW\t\tDL_LAZY\n#    else\n#      ifdef RTLD_NOW\n#        define LT_DLLAZY_OR_NOW\tRTLD_NOW\n#      else\n#        ifdef DL_NOW\n#          define LT_DLLAZY_OR_NOW\tDL_NOW\n#        else\n#          define LT_DLLAZY_OR_NOW\t0\n#        endif\n#      endif\n#    endif\n#  endif\n#endif\n\n/* When -fvisibility=hidden is used, assume the code has been annotated\n   correspondingly for the symbols needed.  */\n#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))\nint fnord () __attribute__((visibility(\"default\")));\n#endif\n\nint fnord () { return 42; }\nint main ()\n{\n  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);\n  int status = $lt_dlunknown;\n\n  if (self)\n    {\n      if (dlsym (self,\"fnord\"))       status = $lt_dlno_uscore;\n      else\n        {\n\t  if (dlsym( self,\"_fnord\"))  status = $lt_dlneed_uscore;\n          else puts (dlerror ());\n\t}\n      /* dlclose (self); */\n    }\n  else\n    puts (dlerror ());\n\n  return status;\n}]\n_LT_EOF\n  if AC_TRY_EVAL(ac_link) && test -s \"conftest$ac_exeext\" 2>/dev/null; then\n    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null\n    lt_status=$?\n    case x$lt_status in\n      x$lt_dlno_uscore) $1 ;;\n      x$lt_dlneed_uscore) $2 ;;\n      x$lt_dlunknown|x*) $3 ;;\n    esac\n  else :\n    # compilation failed\n    $3\n  fi\nfi\nrm -fr conftest*\n])# _LT_TRY_DLOPEN_SELF\n\n\n# LT_SYS_DLOPEN_SELF\n# ------------------\nAC_DEFUN([LT_SYS_DLOPEN_SELF],\n[m4_require([_LT_HEADER_DLFCN])dnl\nif test yes != \"$enable_dlopen\"; then\n  enable_dlopen=unknown\n  enable_dlopen_self=unknown\n  enable_dlopen_self_static=unknown\nelse\n  lt_cv_dlopen=no\n  lt_cv_dlopen_libs=\n\n  case $host_os in\n  beos*)\n    lt_cv_dlopen=load_add_on\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n    ;;\n\n  mingw* | pw32* | cegcc*)\n    lt_cv_dlopen=LoadLibrary\n    lt_cv_dlopen_libs=\n    ;;\n\n  cygwin*)\n    lt_cv_dlopen=dlopen\n    lt_cv_dlopen_libs=\n    ;;\n\n  darwin*)\n    # if libdl is installed we need to link against it\n    AC_CHECK_LIB([dl], [dlopen],\n\t\t[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[\n    lt_cv_dlopen=dyld\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n    ])\n    ;;\n\n  tpf*)\n    # Don't try to run any link tests for TPF.  We know it's impossible\n    # because TPF is a cross-compiler, and we know how we open DSOs.\n    lt_cv_dlopen=dlopen\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=no\n    ;;\n\n  *)\n    AC_CHECK_FUNC([shl_load],\n\t  [lt_cv_dlopen=shl_load],\n      [AC_CHECK_LIB([dld], [shl_load],\n\t    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],\n\t[AC_CHECK_FUNC([dlopen],\n\t      [lt_cv_dlopen=dlopen],\n\t  [AC_CHECK_LIB([dl], [dlopen],\n\t\t[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],\n\t    [AC_CHECK_LIB([svld], [dlopen],\n\t\t  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],\n\t      [AC_CHECK_LIB([dld], [dld_link],\n\t\t    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])\n\t      ])\n\t    ])\n\t  ])\n\t])\n      ])\n    ;;\n  esac\n\n  if test no = \"$lt_cv_dlopen\"; then\n    enable_dlopen=no\n  else\n    enable_dlopen=yes\n  fi\n\n  case $lt_cv_dlopen in\n  dlopen)\n    save_CPPFLAGS=$CPPFLAGS\n    test yes = \"$ac_cv_header_dlfcn_h\" && CPPFLAGS=\"$CPPFLAGS -DHAVE_DLFCN_H\"\n\n    save_LDFLAGS=$LDFLAGS\n    wl=$lt_prog_compiler_wl eval LDFLAGS=\\\"\\$LDFLAGS $export_dynamic_flag_spec\\\"\n\n    save_LIBS=$LIBS\n    LIBS=\"$lt_cv_dlopen_libs $LIBS\"\n\n    AC_CACHE_CHECK([whether a program can dlopen itself],\n\t  lt_cv_dlopen_self, [dnl\n\t  _LT_TRY_DLOPEN_SELF(\n\t    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,\n\t    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)\n    ])\n\n    if test yes = \"$lt_cv_dlopen_self\"; then\n      wl=$lt_prog_compiler_wl eval LDFLAGS=\\\"\\$LDFLAGS $lt_prog_compiler_static\\\"\n      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],\n\t  lt_cv_dlopen_self_static, [dnl\n\t  _LT_TRY_DLOPEN_SELF(\n\t    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,\n\t    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)\n      ])\n    fi\n\n    CPPFLAGS=$save_CPPFLAGS\n    LDFLAGS=$save_LDFLAGS\n    LIBS=$save_LIBS\n    ;;\n  esac\n\n  case $lt_cv_dlopen_self in\n  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;\n  *) enable_dlopen_self=unknown ;;\n  esac\n\n  case $lt_cv_dlopen_self_static in\n  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;\n  *) enable_dlopen_self_static=unknown ;;\n  esac\nfi\n_LT_DECL([dlopen_support], [enable_dlopen], [0],\n\t [Whether dlopen is supported])\n_LT_DECL([dlopen_self], [enable_dlopen_self], [0],\n\t [Whether dlopen of programs is supported])\n_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],\n\t [Whether dlopen of statically linked programs is supported])\n])# LT_SYS_DLOPEN_SELF\n\n# Old name:\nAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])\n\n\n# _LT_COMPILER_C_O([TAGNAME])\n# ---------------------------\n# Check to see if options -c and -o are simultaneously supported by compiler.\n# This macro does not hard code the compiler like AC_PROG_CC_C_O.\nm4_defun([_LT_COMPILER_C_O],\n[m4_require([_LT_DECL_SED])dnl\nm4_require([_LT_FILEUTILS_DEFAULTS])dnl\nm4_require([_LT_TAG_COMPILER])dnl\nAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],\n  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],\n  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no\n   $RM -r conftest 2>/dev/null\n   mkdir conftest\n   cd conftest\n   mkdir out\n   echo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n   lt_compiler_flag=\"-o out/conftest2.$ac_objext\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}\\{0,1\\} :&$lt_compiler_flag :; t' \\\n   -e 's: [[^ ]]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:$LINENO: $lt_compile\\\"\" >&AS_MESSAGE_LOG_FD)\n   (eval \"$lt_compile\" 2>out/conftest.err)\n   ac_status=$?\n   cat out/conftest.err >&AS_MESSAGE_LOG_FD\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&AS_MESSAGE_LOG_FD\n   if (exit $ac_status) && test -s out/conftest2.$ac_objext\n   then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     $ECHO \"$_lt_compiler_boilerplate\" | $SED '/^$/d' > out/conftest.exp\n     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2\n     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then\n       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes\n     fi\n   fi\n   chmod u+w . 2>&AS_MESSAGE_LOG_FD\n   $RM conftest*\n   # SGI C++ compiler will create directory out/ii_files/ for\n   # template instantiation\n   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files\n   $RM out/* && rmdir out\n   cd ..\n   $RM -r conftest\n   $RM conftest*\n])\n_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],\n\t[Does compiler simultaneously support -c and -o options?])\n])# _LT_COMPILER_C_O\n\n\n# _LT_COMPILER_FILE_LOCKS([TAGNAME])\n# ----------------------------------\n# Check to see if we can do hard links to lock some files if needed\nm4_defun([_LT_COMPILER_FILE_LOCKS],\n[m4_require([_LT_ENABLE_LOCK])dnl\nm4_require([_LT_FILEUTILS_DEFAULTS])dnl\n_LT_COMPILER_C_O([$1])\n\nhard_links=nottested\nif test no = \"$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)\" && test no != \"$need_locks\"; then\n  # do not overwrite the value of need_locks provided by the user\n  AC_MSG_CHECKING([if we can lock with hard links])\n  hard_links=yes\n  $RM conftest*\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  touch conftest.a\n  ln conftest.a conftest.b 2>&5 || hard_links=no\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  AC_MSG_RESULT([$hard_links])\n  if test no = \"$hard_links\"; then\n    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])\n    need_locks=warn\n  fi\nelse\n  need_locks=no\nfi\n_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])\n])# _LT_COMPILER_FILE_LOCKS\n\n\n# _LT_CHECK_OBJDIR\n# ----------------\nm4_defun([_LT_CHECK_OBJDIR],\n[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],\n[rm -f .libs 2>/dev/null\nmkdir .libs 2>/dev/null\nif test -d .libs; then\n  lt_cv_objdir=.libs\nelse\n  # MS-DOS does not allow filenames that begin with a dot.\n  lt_cv_objdir=_libs\nfi\nrmdir .libs 2>/dev/null])\nobjdir=$lt_cv_objdir\n_LT_DECL([], [objdir], [0],\n         [The name of the directory that contains temporary libtool files])dnl\nm4_pattern_allow([LT_OBJDIR])dnl\nAC_DEFINE_UNQUOTED([LT_OBJDIR], \"$lt_cv_objdir/\",\n  [Define to the sub-directory where libtool stores uninstalled libraries.])\n])# _LT_CHECK_OBJDIR\n\n\n# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])\n# --------------------------------------\n# Check hardcoding attributes.\nm4_defun([_LT_LINKER_HARDCODE_LIBPATH],\n[AC_MSG_CHECKING([how to hardcode library paths into programs])\n_LT_TAGVAR(hardcode_action, $1)=\nif test -n \"$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\" ||\n   test -n \"$_LT_TAGVAR(runpath_var, $1)\" ||\n   test yes = \"$_LT_TAGVAR(hardcode_automatic, $1)\"; then\n\n  # We can hardcode non-existent directories.\n  if test no != \"$_LT_TAGVAR(hardcode_direct, $1)\" &&\n     # If the only mechanism to avoid hardcoding is shlibpath_var, we\n     # have to relink, otherwise we might link with an installed library\n     # when we should be linking with a yet-to-be-installed one\n     ## test no != \"$_LT_TAGVAR(hardcode_shlibpath_var, $1)\" &&\n     test no != \"$_LT_TAGVAR(hardcode_minus_L, $1)\"; then\n    # Linking always hardcodes the temporary library directory.\n    _LT_TAGVAR(hardcode_action, $1)=relink\n  else\n    # We can link without hardcoding, and we can hardcode nonexisting dirs.\n    _LT_TAGVAR(hardcode_action, $1)=immediate\n  fi\nelse\n  # We cannot hardcode anything, or else we can only hardcode existing\n  # directories.\n  _LT_TAGVAR(hardcode_action, $1)=unsupported\nfi\nAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])\n\nif test relink = \"$_LT_TAGVAR(hardcode_action, $1)\" ||\n   test yes = \"$_LT_TAGVAR(inherit_rpath, $1)\"; then\n  # Fast installation is not supported\n  enable_fast_install=no\nelif test yes = \"$shlibpath_overrides_runpath\" ||\n     test no = \"$enable_shared\"; then\n  # Fast installation is not necessary\n  enable_fast_install=needless\nfi\n_LT_TAGDECL([], [hardcode_action], [0],\n    [How to hardcode a shared library path into an executable])\n])# _LT_LINKER_HARDCODE_LIBPATH\n\n\n# _LT_CMD_STRIPLIB\n# ----------------\nm4_defun([_LT_CMD_STRIPLIB],\n[m4_require([_LT_DECL_EGREP])\nstriplib=\nold_striplib=\nAC_MSG_CHECKING([whether stripping libraries is possible])\nif test -n \"$STRIP\" && $STRIP -V 2>&1 | $GREP \"GNU strip\" >/dev/null; then\n  test -z \"$old_striplib\" && old_striplib=\"$STRIP --strip-debug\"\n  test -z \"$striplib\" && striplib=\"$STRIP --strip-unneeded\"\n  AC_MSG_RESULT([yes])\nelse\n# FIXME - insert some real tests, host_os isn't really good enough\n  case $host_os in\n  darwin*)\n    if test -n \"$STRIP\"; then\n      striplib=\"$STRIP -x\"\n      old_striplib=\"$STRIP -S\"\n      AC_MSG_RESULT([yes])\n    else\n      AC_MSG_RESULT([no])\n    fi\n    ;;\n  *)\n    AC_MSG_RESULT([no])\n    ;;\n  esac\nfi\n_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])\n_LT_DECL([], [striplib], [1])\n])# _LT_CMD_STRIPLIB\n\n\n# _LT_PREPARE_MUNGE_PATH_LIST\n# ---------------------------\n# Make sure func_munge_path_list() is defined correctly.\nm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],\n[[# func_munge_path_list VARIABLE PATH\n# -----------------------------------\n# VARIABLE is name of variable containing _space_ separated list of\n# directories to be munged by the contents of PATH, which is string\n# having a format:\n# \"DIR[:DIR]:\"\n#       string \"DIR[ DIR]\" will be prepended to VARIABLE\n# \":DIR[:DIR]\"\n#       string \"DIR[ DIR]\" will be appended to VARIABLE\n# \"DIRP[:DIRP]::[DIRA:]DIRA\"\n#       string \"DIRP[ DIRP]\" will be prepended to VARIABLE and string\n#       \"DIRA[ DIRA]\" will be appended to VARIABLE\n# \"DIR[:DIR]\"\n#       VARIABLE will be replaced by \"DIR[ DIR]\"\nfunc_munge_path_list ()\n{\n    case x@S|@2 in\n    x)\n        ;;\n    *:)\n        eval @S|@1=\\\"`$ECHO @S|@2 | $SED 's/:/ /g'` \\@S|@@S|@1\\\"\n        ;;\n    x:*)\n        eval @S|@1=\\\"\\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\\\"\n        ;;\n    *::*)\n        eval @S|@1=\\\"\\@S|@@S|@1\\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\\\"\n        eval @S|@1=\\\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\\ \\@S|@@S|@1\\\"\n        ;;\n    *)\n        eval @S|@1=\\\"`$ECHO @S|@2 | $SED 's/:/ /g'`\\\"\n        ;;\n    esac\n}\n]])# _LT_PREPARE_PATH_LIST\n\n\n# _LT_SYS_DYNAMIC_LINKER([TAG])\n# -----------------------------\n# PORTME Fill in your ld.so characteristics\nm4_defun([_LT_SYS_DYNAMIC_LINKER],\n[AC_REQUIRE([AC_CANONICAL_HOST])dnl\nm4_require([_LT_DECL_EGREP])dnl\nm4_require([_LT_FILEUTILS_DEFAULTS])dnl\nm4_require([_LT_DECL_OBJDUMP])dnl\nm4_require([_LT_DECL_SED])dnl\nm4_require([_LT_CHECK_SHELL_FEATURES])dnl\nm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl\nAC_MSG_CHECKING([dynamic linker characteristics])\nm4_if([$1],\n\t[], [\nif test yes = \"$GCC\"; then\n  case $host_os in\n    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;\n    *) lt_awk_arg='/^libraries:/' ;;\n  esac\n  case $host_os in\n    mingw* | cegcc*) lt_sed_strip_eq='s|=\\([[A-Za-z]]:\\)|\\1|g' ;;\n    *) lt_sed_strip_eq='s|=/|/|g' ;;\n  esac\n  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e \"s/^libraries://\" -e $lt_sed_strip_eq`\n  case $lt_search_path_spec in\n  *\\;*)\n    # if the path contains \";\" then we assume it to be the separator\n    # otherwise default to the standard path separator (i.e. \":\") - it is\n    # assumed that no part of a normal pathname contains \";\" but that should\n    # okay in the real world where \";\" in dirpaths is itself problematic.\n    lt_search_path_spec=`$ECHO \"$lt_search_path_spec\" | $SED 's/;/ /g'`\n    ;;\n  *)\n    lt_search_path_spec=`$ECHO \"$lt_search_path_spec\" | $SED \"s/$PATH_SEPARATOR/ /g\"`\n    ;;\n  esac\n  # Ok, now we have the path, separated by spaces, we can step through it\n  # and add multilib dir if necessary...\n  lt_tmp_lt_search_path_spec=\n  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`\n  # ...but if some path component already ends with the multilib dir we assume\n  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).\n  case \"$lt_multi_os_dir; $lt_search_path_spec \" in\n  \"/; \"* | \"/.; \"* | \"/./; \"* | *\"$lt_multi_os_dir \"* | *\"$lt_multi_os_dir/ \"*)\n    lt_multi_os_dir=\n    ;;\n  esac\n  for lt_sys_path in $lt_search_path_spec; do\n    if test -d \"$lt_sys_path$lt_multi_os_dir\"; then\n      lt_tmp_lt_search_path_spec=\"$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir\"\n    elif test -n \"$lt_multi_os_dir\"; then\n      test -d \"$lt_sys_path\" && \\\n\tlt_tmp_lt_search_path_spec=\"$lt_tmp_lt_search_path_spec $lt_sys_path\"\n    fi\n  done\n  lt_search_path_spec=`$ECHO \"$lt_tmp_lt_search_path_spec\" | awk '\nBEGIN {RS = \" \"; FS = \"/|\\n\";} {\n  lt_foo = \"\";\n  lt_count = 0;\n  for (lt_i = NF; lt_i > 0; lt_i--) {\n    if ($lt_i != \"\" && $lt_i != \".\") {\n      if ($lt_i == \"..\") {\n        lt_count++;\n      } else {\n        if (lt_count == 0) {\n          lt_foo = \"/\" $lt_i lt_foo;\n        } else {\n          lt_count--;\n        }\n      }\n    }\n  }\n  if (lt_foo != \"\") { lt_freq[[lt_foo]]++; }\n  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }\n}'`\n  # AWK program above erroneously prepends '/' to C:/dos/paths\n  # for these hosts.\n  case $host_os in\n    mingw* | cegcc*) lt_search_path_spec=`$ECHO \"$lt_search_path_spec\" |\\\n      $SED 's|/\\([[A-Za-z]]:\\)|\\1|g'` ;;\n  esac\n  sys_lib_search_path_spec=`$ECHO \"$lt_search_path_spec\" | $lt_NL2SP`\nelse\n  sys_lib_search_path_spec=\"/lib /usr/lib /usr/local/lib\"\nfi])\nlibrary_names_spec=\nlibname_spec='lib$name'\nsoname_spec=\nshrext_cmds=.so\npostinstall_cmds=\npostuninstall_cmds=\nfinish_cmds=\nfinish_eval=\nshlibpath_var=\nshlibpath_overrides_runpath=unknown\nversion_type=none\ndynamic_linker=\"$host_os ld.so\"\nsys_lib_dlsearch_path_spec=\"/lib /usr/lib\"\nneed_lib_prefix=unknown\nhardcode_into_libs=no\n\n# when you set need_version to no, make sure it does not cause -set_version\n# flags to be left without arguments\nneed_version=unknown\n\nAC_ARG_VAR([LT_SYS_LIBRARY_PATH],\n[User-defined run-time library search path.])\n\ncase $host_os in\naix3*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'\n  shlibpath_var=LIBPATH\n\n  # AIX 3 has no versioning support, so we append a major version to the name.\n  soname_spec='$libname$release$shared_ext$major'\n  ;;\n\naix[[4-9]]*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  hardcode_into_libs=yes\n  if test ia64 = \"$host_cpu\"; then\n    # AIX 5 supports IA64\n    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'\n    shlibpath_var=LD_LIBRARY_PATH\n  else\n    # With GCC up to 2.95.x, collect2 would create an import file\n    # for dependence libraries.  The import file would start with\n    # the line '#! .'.  This would cause the generated library to\n    # depend on '.', always an invalid library.  This was fixed in\n    # development snapshots of GCC prior to 3.0.\n    case $host_os in\n      aix4 | aix4.[[01]] | aix4.[[01]].*)\n      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'\n\t   echo ' yes '\n\t   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then\n\t:\n      else\n\tcan_build_shared=no\n      fi\n      ;;\n    esac\n    # Using Import Files as archive members, it is possible to support\n    # filename-based versioning of shared library archives on AIX. While\n    # this would work for both with and without runtime linking, it will\n    # prevent static linking of such archives. So we do filename-based\n    # shared library versioning with .so extension only, which is used\n    # when both runtime linking and shared linking is enabled.\n    # Unfortunately, runtime linking may impact performance, so we do\n    # not want this to be the default eventually. Also, we use the\n    # versioned .so libs for executables only if there is the -brtl\n    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.\n    # To allow for filename-based versioning support, we need to create\n    # libNAME.so.V as an archive file, containing:\n    # *) an Import File, referring to the versioned filename of the\n    #    archive as well as the shared archive member, telling the\n    #    bitwidth (32 or 64) of that shared object, and providing the\n    #    list of exported symbols of that shared object, eventually\n    #    decorated with the 'weak' keyword\n    # *) the shared object with the F_LOADONLY flag set, to really avoid\n    #    it being seen by the linker.\n    # At run time we better use the real file rather than another symlink,\n    # but for link time we create the symlink libNAME.so -> libNAME.so.V\n\n    case $with_aix_soname,$aix_use_runtimelinking in\n    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct\n    # soname into executable. Probably we can add versioning support to\n    # collect2, so additional links can be useful in future.\n    aix,yes) # traditional libtool\n      dynamic_linker='AIX unversionable lib.so'\n      # If using run time linking (on AIX 4.2 or later) use lib<name>.so\n      # instead of lib<name>.a to let people know that these are not\n      # typical AIX shared libraries.\n      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n      ;;\n    aix,no) # traditional AIX only\n      dynamic_linker='AIX lib.a[(]lib.so.V[)]'\n      # We preserve .a as extension for shared libraries through AIX4.2\n      # and later when we are not doing run time linking.\n      library_names_spec='$libname$release.a $libname.a'\n      soname_spec='$libname$release$shared_ext$major'\n      ;;\n    svr4,*) # full svr4 only\n      dynamic_linker=\"AIX lib.so.V[(]$shared_archive_member_spec.o[)]\"\n      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'\n      # We do not specify a path in Import Files, so LIBPATH fires.\n      shlibpath_overrides_runpath=yes\n      ;;\n    *,yes) # both, prefer svr4\n      dynamic_linker=\"AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]\"\n      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'\n      # unpreferred sharedlib libNAME.a needs extra handling\n      postinstall_cmds='test -n \"$linkname\" || linkname=\"$realname\"~func_stripname \"\" \".so\" \"$linkname\"~$install_shared_prog \"$dir/$func_stripname_result.$libext\" \"$destdir/$func_stripname_result.$libext\"~test -z \"$tstripme\" || test -z \"$striplib\" || $striplib \"$destdir/$func_stripname_result.$libext\"'\n      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname \"\" \".so\" \"$n\"~test \"$func_stripname_result\" = \"$n\" || func_append rmfiles \" $odir/$func_stripname_result.$libext\"'\n      # We do not specify a path in Import Files, so LIBPATH fires.\n      shlibpath_overrides_runpath=yes\n      ;;\n    *,no) # both, prefer aix\n      dynamic_linker=\"AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]\"\n      library_names_spec='$libname$release.a $libname.a'\n      soname_spec='$libname$release$shared_ext$major'\n      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling\n      postinstall_cmds='test -z \"$dlname\" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z \"$tstripme\" || test -z \"$striplib\" || $striplib $destdir/$dlname~test -n \"$linkname\" || linkname=$realname~func_stripname \"\" \".a\" \"$linkname\"~(cd \"$destdir\" && $LN_S -f $dlname $func_stripname_result.so)'\n      postuninstall_cmds='test -z \"$dlname\" || func_append rmfiles \" $odir/$dlname\"~for n in $old_library $library_names; do :; done~func_stripname \"\" \".a\" \"$n\"~func_append rmfiles \" $odir/$func_stripname_result.so\"'\n      ;;\n    esac\n    shlibpath_var=LIBPATH\n  fi\n  ;;\n\namigaos*)\n  case $host_cpu in\n  powerpc)\n    # Since July 2007 AmigaOS4 officially supports .so libraries.\n    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    ;;\n  m68k)\n    library_names_spec='$libname.ixlibrary $libname.a'\n    # Create ${libname}_ixlibrary.a entries in /sys/libs.\n    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all \"$lib\" | $SED '\\''s%^.*/\\([[^/]]*\\)\\.ixlibrary$%\\1%'\\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show \"cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a\"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'\n    ;;\n  esac\n  ;;\n\nbeos*)\n  library_names_spec='$libname$shared_ext'\n  dynamic_linker=\"$host_os ld.so\"\n  shlibpath_var=LIBRARY_PATH\n  ;;\n\nbsdi[[45]]*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib\"\n  sys_lib_dlsearch_path_spec=\"/shlib /usr/lib /usr/local/lib\"\n  # the default ld.so.conf also contains /usr/contrib/lib and\n  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow\n  # libtool to hard-code these into programs\n  ;;\n\ncygwin* | mingw* | pw32* | cegcc*)\n  version_type=windows\n  shrext_cmds=.dll\n  need_version=no\n  need_lib_prefix=no\n\n  case $GCC,$cc_basename in\n  yes,*)\n    # gcc\n    library_names_spec='$libname.dll.a'\n    # DLL is installed to $(libdir)/../bin by postinstall_cmds\n    postinstall_cmds='base_file=`basename \\$file`~\n      dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\$base_file'\\''i; echo \\$dlname'\\''`~\n      dldir=$destdir/`dirname \\$dlpath`~\n      test -d \\$dldir || mkdir -p \\$dldir~\n      $install_prog $dir/$dlname \\$dldir/$dlname~\n      chmod a+x \\$dldir/$dlname~\n      if test -n '\\''$stripme'\\'' && test -n '\\''$striplib'\\''; then\n        eval '\\''$striplib \\$dldir/$dlname'\\'' || exit \\$?;\n      fi'\n    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; echo \\$dlname'\\''`~\n      dlpath=$dir/\\$dldll~\n       $RM \\$dlpath'\n    shlibpath_overrides_runpath=yes\n\n    case $host_os in\n    cygwin*)\n      # Cygwin DLLs use 'cyg' prefix rather than 'lib'\n      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'\nm4_if([$1], [],[\n      sys_lib_search_path_spec=\"$sys_lib_search_path_spec /usr/lib/w32api\"])\n      ;;\n    mingw* | cegcc*)\n      # MinGW DLLs use traditional 'lib' prefix\n      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'\n      ;;\n    pw32*)\n      # pw32 DLLs use 'pw' prefix rather than 'lib'\n      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'\n      ;;\n    esac\n    dynamic_linker='Win32 ld.exe'\n    ;;\n\n  *,cl*)\n    # Native MSVC\n    libname_spec='$name'\n    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'\n    library_names_spec='$libname.dll.lib'\n\n    case $build_os in\n    mingw*)\n      sys_lib_search_path_spec=\n      lt_save_ifs=$IFS\n      IFS=';'\n      for lt_path in $LIB\n      do\n        IFS=$lt_save_ifs\n        # Let DOS variable expansion print the short 8.3 style file name.\n        lt_path=`cd \"$lt_path\" 2>/dev/null && cmd //C \"for %i in (\".\") do @echo %~si\"`\n        sys_lib_search_path_spec=\"$sys_lib_search_path_spec $lt_path\"\n      done\n      IFS=$lt_save_ifs\n      # Convert to MSYS style.\n      sys_lib_search_path_spec=`$ECHO \"$sys_lib_search_path_spec\" | sed -e 's|\\\\\\\\|/|g' -e 's| \\\\([[a-zA-Z]]\\\\):| /\\\\1|g' -e 's|^ ||'`\n      ;;\n    cygwin*)\n      # Convert to unix form, then to dos form, then back to unix form\n      # but this time dos style (no spaces!) so that the unix form looks\n      # like /cygdrive/c/PROGRA~1:/cygdr...\n      sys_lib_search_path_spec=`cygpath --path --unix \"$LIB\"`\n      sys_lib_search_path_spec=`cygpath --path --dos \"$sys_lib_search_path_spec\" 2>/dev/null`\n      sys_lib_search_path_spec=`cygpath --path --unix \"$sys_lib_search_path_spec\" | $SED -e \"s/$PATH_SEPARATOR/ /g\"`\n      ;;\n    *)\n      sys_lib_search_path_spec=$LIB\n      if $ECHO \"$sys_lib_search_path_spec\" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then\n        # It is most probably a Windows format PATH.\n        sys_lib_search_path_spec=`$ECHO \"$sys_lib_search_path_spec\" | $SED -e 's/;/ /g'`\n      else\n        sys_lib_search_path_spec=`$ECHO \"$sys_lib_search_path_spec\" | $SED -e \"s/$PATH_SEPARATOR/ /g\"`\n      fi\n      # FIXME: find the short name or the path components, as spaces are\n      # common. (e.g. \"Program Files\" -> \"PROGRA~1\")\n      ;;\n    esac\n\n    # DLL is installed to $(libdir)/../bin by postinstall_cmds\n    postinstall_cmds='base_file=`basename \\$file`~\n      dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\$base_file'\\''i; echo \\$dlname'\\''`~\n      dldir=$destdir/`dirname \\$dlpath`~\n      test -d \\$dldir || mkdir -p \\$dldir~\n      $install_prog $dir/$dlname \\$dldir/$dlname'\n    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; echo \\$dlname'\\''`~\n      dlpath=$dir/\\$dldll~\n       $RM \\$dlpath'\n    shlibpath_overrides_runpath=yes\n    dynamic_linker='Win32 link.exe'\n    ;;\n\n  *)\n    # Assume MSVC wrapper\n    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'\n    dynamic_linker='Win32 ld.exe'\n    ;;\n  esac\n  # FIXME: first we should search . and the directory the executable is in\n  shlibpath_var=PATH\n  ;;\n\ndarwin* | rhapsody*)\n  dynamic_linker=\"$host_os dyld\"\n  version_type=darwin\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'\n  soname_spec='$libname$release$major$shared_ext'\n  shlibpath_overrides_runpath=yes\n  shlibpath_var=DYLD_LIBRARY_PATH\n  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'\nm4_if([$1], [],[\n  sys_lib_search_path_spec=\"$sys_lib_search_path_spec /usr/local/lib\"])\n  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'\n  ;;\n\ndgux*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\nfreebsd* | dragonfly*)\n  # DragonFly does not have aout.  When/if they implement a new\n  # versioning mechanism, adjust this.\n  if test -x /usr/bin/objformat; then\n    objformat=`/usr/bin/objformat`\n  else\n    case $host_os in\n    freebsd[[23]].*) objformat=aout ;;\n    *) objformat=elf ;;\n    esac\n  fi\n  version_type=freebsd-$objformat\n  case $version_type in\n    freebsd-elf*)\n      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n      soname_spec='$libname$release$shared_ext$major'\n      need_version=no\n      need_lib_prefix=no\n      ;;\n    freebsd-*)\n      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n      need_version=yes\n      ;;\n  esac\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_os in\n  freebsd2.*)\n    shlibpath_overrides_runpath=yes\n    ;;\n  freebsd3.[[01]]* | freebsdelf3.[[01]]*)\n    shlibpath_overrides_runpath=yes\n    hardcode_into_libs=yes\n    ;;\n  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \\\n  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)\n    shlibpath_overrides_runpath=no\n    hardcode_into_libs=yes\n    ;;\n  *) # from 4.6 on, and DragonFly\n    shlibpath_overrides_runpath=yes\n    hardcode_into_libs=yes\n    ;;\n  esac\n  ;;\n\nhaiku*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  dynamic_linker=\"$host_os runtime_loader\"\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'\n  hardcode_into_libs=yes\n  ;;\n\nhpux9* | hpux10* | hpux11*)\n  # Give a soname corresponding to the major version so that dld.sl refuses to\n  # link against other versions.\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  case $host_cpu in\n  ia64*)\n    shrext_cmds='.so'\n    hardcode_into_libs=yes\n    dynamic_linker=\"$host_os dld.so\"\n    shlibpath_var=LD_LIBRARY_PATH\n    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    if test 32 = \"$HPUX_IA64_MODE\"; then\n      sys_lib_search_path_spec=\"/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib\"\n      sys_lib_dlsearch_path_spec=/usr/lib/hpux32\n    else\n      sys_lib_search_path_spec=\"/usr/lib/hpux64 /usr/local/lib/hpux64\"\n      sys_lib_dlsearch_path_spec=/usr/lib/hpux64\n    fi\n    ;;\n  hppa*64*)\n    shrext_cmds='.sl'\n    hardcode_into_libs=yes\n    dynamic_linker=\"$host_os dld.sl\"\n    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH\n    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    sys_lib_search_path_spec=\"/usr/lib/pa20_64 /usr/ccs/lib/pa20_64\"\n    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n    ;;\n  *)\n    shrext_cmds='.sl'\n    dynamic_linker=\"$host_os dld.sl\"\n    shlibpath_var=SHLIB_PATH\n    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    ;;\n  esac\n  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...\n  postinstall_cmds='chmod 555 $lib'\n  # or fails outright, so override atomically:\n  install_override_mode=555\n  ;;\n\ninterix[[3-9]]*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  ;;\n\nirix5* | irix6* | nonstopux*)\n  case $host_os in\n    nonstopux*) version_type=nonstopux ;;\n    *)\n\tif test yes = \"$lt_cv_prog_gnu_ld\"; then\n\t\tversion_type=linux # correct to gnu/linux during the next big refactor\n\telse\n\t\tversion_type=irix\n\tfi ;;\n  esac\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='$libname$release$shared_ext$major'\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'\n  case $host_os in\n  irix5* | nonstopux*)\n    libsuff= shlibsuff=\n    ;;\n  *)\n    case $LD in # libtool.m4 will add one of these switches to LD\n    *-32|*\"-32 \"|*-melf32bsmip|*\"-melf32bsmip \")\n      libsuff= shlibsuff= libmagic=32-bit;;\n    *-n32|*\"-n32 \"|*-melf32bmipn32|*\"-melf32bmipn32 \")\n      libsuff=32 shlibsuff=N32 libmagic=N32;;\n    *-64|*\"-64 \"|*-melf64bmip|*\"-melf64bmip \")\n      libsuff=64 shlibsuff=64 libmagic=64-bit;;\n    *) libsuff= shlibsuff= libmagic=never-match;;\n    esac\n    ;;\n  esac\n  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH\n  shlibpath_overrides_runpath=no\n  sys_lib_search_path_spec=\"/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff\"\n  sys_lib_dlsearch_path_spec=\"/usr/lib$libsuff /lib$libsuff\"\n  hardcode_into_libs=yes\n  ;;\n\n# No shared lib support for Linux oldld, aout, or coff.\nlinux*oldld* | linux*aout* | linux*coff*)\n  dynamic_linker=no\n  ;;\n\nlinux*android*)\n  version_type=none # Android doesn't support versioned libraries.\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext'\n  soname_spec='$libname$release$shared_ext'\n  finish_cmds=\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n\n  # This implies no fast_install, which is unacceptable.\n  # Some rework will be needed to allow for fast_install\n  # before this can be enabled.\n  hardcode_into_libs=yes\n\n  dynamic_linker='Android linker'\n  # Don't embed -rpath directories since the linker doesn't support them.\n  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n  ;;\n\n# This must be glibc/ELF.\nlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -n $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n\n  # Some binutils ld are patched to set DT_RUNPATH\n  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],\n    [lt_cv_shlibpath_overrides_runpath=no\n    save_LDFLAGS=$LDFLAGS\n    save_libdir=$libdir\n    eval \"libdir=/foo; wl=\\\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\\\"; \\\n\t LDFLAGS=\\\"\\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\\\"\"\n    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],\n      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep \"RUNPATH.*$libdir\" >/dev/null],\n\t [lt_cv_shlibpath_overrides_runpath=yes])])\n    LDFLAGS=$save_LDFLAGS\n    libdir=$save_libdir\n    ])\n  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath\n\n  # This implies no fast_install, which is unacceptable.\n  # Some rework will be needed to allow for fast_install\n  # before this can be enabled.\n  hardcode_into_libs=yes\n\n  # Ideally, we could use ldconfig to report *all* directores which are\n  # searched for libraries, however this is still not possible.  Aside from not\n  # being certain /sbin/ldconfig is available, command\n  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,\n  # even though it is searched at run-time.  Try to do the best guess by\n  # appending ld.so.conf contents (and includes) to the search path.\n  if test -f /etc/ld.so.conf; then\n    lt_ld_extra=`awk '/^include / { system(sprintf(\"cd /etc; cat %s 2>/dev/null\", \\[$]2)); skip = 1; } { if (!skip) print \\[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[\t ]*hwcap[\t ]/d;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/\"//g;/^$/d' | tr '\\n' ' '`\n    sys_lib_dlsearch_path_spec=\"/lib /usr/lib $lt_ld_extra\"\n  fi\n\n  # We used to test for /lib/ld.so.1 and disable shared libraries on\n  # powerpc, because MkLinux only supported shared libraries with the\n  # GNU dynamic linker.  Since this was broken with cross compilers,\n  # most powerpc-linux boxes support dynamic linking these days and\n  # people can always --disable-shared, the test was removed, and we\n  # assume the GNU/Linux dynamic linker is in use.\n  dynamic_linker='GNU/Linux ld.so'\n  ;;\n\nnetbsd*)\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n    finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n    dynamic_linker='NetBSD (a.out) ld.so'\n  else\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    dynamic_linker='NetBSD ld.elf_so'\n  fi\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  ;;\n\nnewsos6)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\n*nto* | *qnx*)\n  version_type=qnx\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='ldqnx.so'\n  ;;\n\nopenbsd* | bitrig*)\n  version_type=sunos\n  sys_lib_dlsearch_path_spec=/usr/lib\n  need_lib_prefix=no\n  if test -z \"`echo __ELF__ | $CC -E - | $GREP __ELF__`\"; then\n    need_version=no\n  else\n    need_version=yes\n  fi\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\nos2*)\n  libname_spec='$name'\n  version_type=windows\n  shrext_cmds=.dll\n  need_version=no\n  need_lib_prefix=no\n  # OS/2 can only load a DLL with a base name of 8 characters or less.\n  soname_spec='`test -n \"$os2dllname\" && libname=\"$os2dllname\";\n    v=$($ECHO $release$versuffix | tr -d .-);\n    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);\n    $ECHO $n$v`$shared_ext'\n  library_names_spec='${libname}_dll.$libext'\n  dynamic_linker='OS/2 ld.exe'\n  shlibpath_var=BEGINLIBPATH\n  sys_lib_search_path_spec=\"/lib /usr/lib /usr/local/lib\"\n  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n  postinstall_cmds='base_file=`basename \\$file`~\n    dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\$base_file'\\''i; $ECHO \\$dlname'\\''`~\n    dldir=$destdir/`dirname \\$dlpath`~\n    test -d \\$dldir || mkdir -p \\$dldir~\n    $install_prog $dir/$dlname \\$dldir/$dlname~\n    chmod a+x \\$dldir/$dlname~\n    if test -n '\\''$stripme'\\'' && test -n '\\''$striplib'\\''; then\n      eval '\\''$striplib \\$dldir/$dlname'\\'' || exit \\$?;\n    fi'\n  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; $ECHO \\$dlname'\\''`~\n    dlpath=$dir/\\$dldll~\n    $RM \\$dlpath'\n  ;;\n\nosf3* | osf4* | osf5*)\n  version_type=osf\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='$libname$release$shared_ext$major'\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib\"\n  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n  ;;\n\nrdos*)\n  dynamic_linker=no\n  ;;\n\nsolaris*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  # ldd complains unless libraries are executable\n  postinstall_cmds='chmod +x $lib'\n  ;;\n\nsunos4*)\n  version_type=sunos\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/usr/etc\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  if test yes = \"$with_gnu_ld\"; then\n    need_lib_prefix=no\n  fi\n  need_version=yes\n  ;;\n\nsysv4 | sysv4.3*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_vendor in\n    sni)\n      shlibpath_overrides_runpath=no\n      need_lib_prefix=no\n      runpath_var=LD_RUN_PATH\n      ;;\n    siemens)\n      need_lib_prefix=no\n      ;;\n    motorola)\n      need_lib_prefix=no\n      need_version=no\n      shlibpath_overrides_runpath=no\n      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'\n      ;;\n  esac\n  ;;\n\nsysv4*MP*)\n  if test -d /usr/nec; then\n    version_type=linux # correct to gnu/linux during the next big refactor\n    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'\n    soname_spec='$libname$shared_ext.$major'\n    shlibpath_var=LD_LIBRARY_PATH\n  fi\n  ;;\n\nsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)\n  version_type=sco\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  if test yes = \"$with_gnu_ld\"; then\n    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'\n  else\n    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'\n    case $host_os in\n      sco3.2v5*)\n        sys_lib_search_path_spec=\"$sys_lib_search_path_spec /lib\"\n\t;;\n    esac\n  fi\n  sys_lib_dlsearch_path_spec='/usr/lib'\n  ;;\n\ntpf*)\n  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  ;;\n\nuts4*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\n*)\n  dynamic_linker=no\n  ;;\nesac\nAC_MSG_RESULT([$dynamic_linker])\ntest no = \"$dynamic_linker\" && can_build_shared=no\n\nvariables_saved_for_relink=\"PATH $shlibpath_var $runpath_var\"\nif test yes = \"$GCC\"; then\n  variables_saved_for_relink=\"$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH\"\nfi\n\nif test set = \"${lt_cv_sys_lib_search_path_spec+set}\"; then\n  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec\nfi\n\nif test set = \"${lt_cv_sys_lib_dlsearch_path_spec+set}\"; then\n  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec\nfi\n\n# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...\nconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec\n\n# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code\nfunc_munge_path_list sys_lib_dlsearch_path_spec \"$LT_SYS_LIBRARY_PATH\"\n\n# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool\nconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH\n\n_LT_DECL([], [variables_saved_for_relink], [1],\n    [Variables whose values should be saved in libtool wrapper scripts and\n    restored at link time])\n_LT_DECL([], [need_lib_prefix], [0],\n    [Do we need the \"lib\" prefix for modules?])\n_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])\n_LT_DECL([], [version_type], [0], [Library versioning type])\n_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])\n_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])\n_LT_DECL([], [shlibpath_overrides_runpath], [0],\n    [Is shlibpath searched before the hard-coded library search path?])\n_LT_DECL([], [libname_spec], [1], [Format of library name prefix])\n_LT_DECL([], [library_names_spec], [1],\n    [[List of archive names.  First name is the real one, the rest are links.\n    The last name is the one that the linker finds with -lNAME]])\n_LT_DECL([], [soname_spec], [1],\n    [[The coded name of the library, if different from the real name]])\n_LT_DECL([], [install_override_mode], [1],\n    [Permission mode override for installation of shared libraries])\n_LT_DECL([], [postinstall_cmds], [2],\n    [Command to use after installation of a shared archive])\n_LT_DECL([], [postuninstall_cmds], [2],\n    [Command to use after uninstallation of a shared archive])\n_LT_DECL([], [finish_cmds], [2],\n    [Commands used to finish a libtool library installation in a directory])\n_LT_DECL([], [finish_eval], [1],\n    [[As \"finish_cmds\", except a single script fragment to be evaled but\n    not shown]])\n_LT_DECL([], [hardcode_into_libs], [0],\n    [Whether we should hardcode library paths into libraries])\n_LT_DECL([], [sys_lib_search_path_spec], [2],\n    [Compile-time system search path for libraries])\n_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],\n    [Detected run-time system search path for libraries])\n_LT_DECL([], [configure_time_lt_sys_library_path], [2],\n    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])\n])# _LT_SYS_DYNAMIC_LINKER\n\n\n# _LT_PATH_TOOL_PREFIX(TOOL)\n# --------------------------\n# find a file program that can recognize shared library\nAC_DEFUN([_LT_PATH_TOOL_PREFIX],\n[m4_require([_LT_DECL_EGREP])dnl\nAC_MSG_CHECKING([for $1])\nAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,\n[case $MAGIC_CMD in\n[[\\\\/*] |  ?:[\\\\/]*])\n  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.\n  ;;\n*)\n  lt_save_MAGIC_CMD=$MAGIC_CMD\n  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR\ndnl $ac_dummy forces splitting on constant user-supplied paths.\ndnl POSIX.2 word splitting is done only on the output of word expansions,\ndnl not every word.  This closes a longstanding sh security hole.\n  ac_dummy=\"m4_if([$2], , $PATH, [$2])\"\n  for ac_dir in $ac_dummy; do\n    IFS=$lt_save_ifs\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f \"$ac_dir/$1\"; then\n      lt_cv_path_MAGIC_CMD=$ac_dir/\"$1\"\n      if test -n \"$file_magic_test_file\"; then\n\tcase $deplibs_check_method in\n\t\"file_magic \"*)\n\t  file_magic_regex=`expr \"$deplibs_check_method\" : \"file_magic \\(.*\\)\"`\n\t  MAGIC_CMD=$lt_cv_path_MAGIC_CMD\n\t  if eval $file_magic_cmd \\$file_magic_test_file 2> /dev/null |\n\t    $EGREP \"$file_magic_regex\" > /dev/null; then\n\t    :\n\t  else\n\t    cat <<_LT_EOF 1>&2\n\n*** Warning: the command libtool uses to detect shared libraries,\n*** $file_magic_cmd, produces output that libtool cannot recognize.\n*** The result is that libtool may fail to recognize shared libraries\n*** as such.  This will affect the creation of libtool libraries that\n*** depend on shared libraries, but programs linked with such libtool\n*** libraries will work regardless of this problem.  Nevertheless, you\n*** may want to report the problem to your system manager and/or to\n*** bug-libtool@gnu.org\n\n_LT_EOF\n\t  fi ;;\n\tesac\n      fi\n      break\n    fi\n  done\n  IFS=$lt_save_ifs\n  MAGIC_CMD=$lt_save_MAGIC_CMD\n  ;;\nesac])\nMAGIC_CMD=$lt_cv_path_MAGIC_CMD\nif test -n \"$MAGIC_CMD\"; then\n  AC_MSG_RESULT($MAGIC_CMD)\nelse\n  AC_MSG_RESULT(no)\nfi\n_LT_DECL([], [MAGIC_CMD], [0],\n\t [Used to examine libraries when file_magic_cmd begins with \"file\"])dnl\n])# _LT_PATH_TOOL_PREFIX\n\n# Old name:\nAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])\n\n\n# _LT_PATH_MAGIC\n# --------------\n# find a file program that can recognize a shared library\nm4_defun([_LT_PATH_MAGIC],\n[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)\nif test -z \"$lt_cv_path_MAGIC_CMD\"; then\n  if test -n \"$ac_tool_prefix\"; then\n    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)\n  else\n    MAGIC_CMD=:\n  fi\nfi\n])# _LT_PATH_MAGIC\n\n\n# LT_PATH_LD\n# ----------\n# find the pathname to the GNU or non-GNU linker\nAC_DEFUN([LT_PATH_LD],\n[AC_REQUIRE([AC_PROG_CC])dnl\nAC_REQUIRE([AC_CANONICAL_HOST])dnl\nAC_REQUIRE([AC_CANONICAL_BUILD])dnl\nm4_require([_LT_DECL_SED])dnl\nm4_require([_LT_DECL_EGREP])dnl\nm4_require([_LT_PROG_ECHO_BACKSLASH])dnl\n\nAC_ARG_WITH([gnu-ld],\n    [AS_HELP_STRING([--with-gnu-ld],\n\t[assume the C compiler uses GNU ld @<:@default=no@:>@])],\n    [test no = \"$withval\" || with_gnu_ld=yes],\n    [with_gnu_ld=no])dnl\n\nac_prog=ld\nif test yes = \"$GCC\"; then\n  # Check if gcc -print-prog-name=ld gives a path.\n  AC_MSG_CHECKING([for ld used by $CC])\n  case $host in\n  *-*-mingw*)\n    # gcc leaves a trailing carriage return, which upsets mingw\n    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\\015'` ;;\n  *)\n    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;\n  esac\n  case $ac_prog in\n    # Accept absolute paths.\n    [[\\\\/]]* | ?:[[\\\\/]]*)\n      re_direlt='/[[^/]][[^/]]*/\\.\\./'\n      # Canonicalize the pathname of ld\n      ac_prog=`$ECHO \"$ac_prog\"| $SED 's%\\\\\\\\%/%g'`\n      while $ECHO \"$ac_prog\" | $GREP \"$re_direlt\" > /dev/null 2>&1; do\n\tac_prog=`$ECHO $ac_prog| $SED \"s%$re_direlt%/%\"`\n      done\n      test -z \"$LD\" && LD=$ac_prog\n      ;;\n  \"\")\n    # If it fails, then pretend we aren't using GCC.\n    ac_prog=ld\n    ;;\n  *)\n    # If it is relative, then search for the first ld in PATH.\n    with_gnu_ld=unknown\n    ;;\n  esac\nelif test yes = \"$with_gnu_ld\"; then\n  AC_MSG_CHECKING([for GNU ld])\nelse\n  AC_MSG_CHECKING([for non-GNU ld])\nfi\nAC_CACHE_VAL(lt_cv_path_LD,\n[if test -z \"$LD\"; then\n  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR\n  for ac_dir in $PATH; do\n    IFS=$lt_save_ifs\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f \"$ac_dir/$ac_prog\" || test -f \"$ac_dir/$ac_prog$ac_exeext\"; then\n      lt_cv_path_LD=$ac_dir/$ac_prog\n      # Check to see if the program is GNU ld.  I'd rather use --version,\n      # but apparently some variants of GNU ld only accept -v.\n      # Break only if it was the GNU/non-GNU ld that we prefer.\n      case `\"$lt_cv_path_LD\" -v 2>&1 </dev/null` in\n      *GNU* | *'with BFD'*)\n\ttest no != \"$with_gnu_ld\" && break\n\t;;\n      *)\n\ttest yes != \"$with_gnu_ld\" && break\n\t;;\n      esac\n    fi\n  done\n  IFS=$lt_save_ifs\nelse\n  lt_cv_path_LD=$LD # Let the user override the test with a path.\nfi])\nLD=$lt_cv_path_LD\nif test -n \"$LD\"; then\n  AC_MSG_RESULT($LD)\nelse\n  AC_MSG_RESULT(no)\nfi\ntest -z \"$LD\" && AC_MSG_ERROR([no acceptable ld found in \\$PATH])\n_LT_PATH_LD_GNU\nAC_SUBST([LD])\n\n_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])\n])# LT_PATH_LD\n\n# Old names:\nAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])\nAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AM_PROG_LD], [])\ndnl AC_DEFUN([AC_PROG_LD], [])\n\n\n# _LT_PATH_LD_GNU\n#- --------------\nm4_defun([_LT_PATH_LD_GNU],\n[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,\n[# I'd rather use --version here, but apparently some GNU lds only accept -v.\ncase `$LD -v 2>&1 </dev/null` in\n*GNU* | *'with BFD'*)\n  lt_cv_prog_gnu_ld=yes\n  ;;\n*)\n  lt_cv_prog_gnu_ld=no\n  ;;\nesac])\nwith_gnu_ld=$lt_cv_prog_gnu_ld\n])# _LT_PATH_LD_GNU\n\n\n# _LT_CMD_RELOAD\n# --------------\n# find reload flag for linker\n#   -- PORTME Some linkers may need a different reload flag.\nm4_defun([_LT_CMD_RELOAD],\n[AC_CACHE_CHECK([for $LD option to reload object files],\n  lt_cv_ld_reload_flag,\n  [lt_cv_ld_reload_flag='-r'])\nreload_flag=$lt_cv_ld_reload_flag\ncase $reload_flag in\n\"\" | \" \"*) ;;\n*) reload_flag=\" $reload_flag\" ;;\nesac\nreload_cmds='$LD$reload_flag -o $output$reload_objs'\ncase $host_os in\n  cygwin* | mingw* | pw32* | cegcc*)\n    if test yes != \"$GCC\"; then\n      reload_cmds=false\n    fi\n    ;;\n  darwin*)\n    if test yes = \"$GCC\"; then\n      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'\n    else\n      reload_cmds='$LD$reload_flag -o $output$reload_objs'\n    fi\n    ;;\nesac\n_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl\n_LT_TAGDECL([], [reload_cmds], [2])dnl\n])# _LT_CMD_RELOAD\n\n\n# _LT_PATH_DD\n# -----------\n# find a working dd\nm4_defun([_LT_PATH_DD],\n[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],\n[printf 0123456789abcdef0123456789abcdef >conftest.i\ncat conftest.i conftest.i >conftest2.i\n: ${lt_DD:=$DD}\nAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],\n[if \"$ac_path_lt_DD\" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then\n  cmp -s conftest.i conftest.out \\\n  && ac_cv_path_lt_DD=\"$ac_path_lt_DD\" ac_path_lt_DD_found=:\nfi])\nrm -f conftest.i conftest2.i conftest.out])\n])# _LT_PATH_DD\n\n\n# _LT_CMD_TRUNCATE\n# ----------------\n# find command to truncate a binary pipe\nm4_defun([_LT_CMD_TRUNCATE],\n[m4_require([_LT_PATH_DD])\nAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],\n[printf 0123456789abcdef0123456789abcdef >conftest.i\ncat conftest.i conftest.i >conftest2.i\nlt_cv_truncate_bin=\nif \"$ac_cv_path_lt_DD\" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then\n  cmp -s conftest.i conftest.out \\\n  && lt_cv_truncate_bin=\"$ac_cv_path_lt_DD bs=4096 count=1\"\nfi\nrm -f conftest.i conftest2.i conftest.out\ntest -z \"$lt_cv_truncate_bin\" && lt_cv_truncate_bin=\"$SED -e 4q\"])\n_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],\n  [Command to truncate a binary pipe])\n])# _LT_CMD_TRUNCATE\n\n\n# _LT_CHECK_MAGIC_METHOD\n# ----------------------\n# how to check for library dependencies\n#  -- PORTME fill in with the dynamic library characteristics\nm4_defun([_LT_CHECK_MAGIC_METHOD],\n[m4_require([_LT_DECL_EGREP])\nm4_require([_LT_DECL_OBJDUMP])\nAC_CACHE_CHECK([how to recognize dependent libraries],\nlt_cv_deplibs_check_method,\n[lt_cv_file_magic_cmd='$MAGIC_CMD'\nlt_cv_file_magic_test_file=\nlt_cv_deplibs_check_method='unknown'\n# Need to set the preceding variable on all platforms that support\n# interlibrary dependencies.\n# 'none' -- dependencies not supported.\n# 'unknown' -- same as none, but documents that we really don't know.\n# 'pass_all' -- all dependencies passed with no checks.\n# 'test_compile' -- check by making test program.\n# 'file_magic [[regex]]' -- check by looking for files in library path\n# that responds to the $file_magic_cmd with a given extended regex.\n# If you have 'file' or equivalent on your system and you're not sure\n# whether 'pass_all' will *always* work, you probably want this one.\n\ncase $host_os in\naix[[4-9]]*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nbeos*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nbsdi[[45]]*)\n  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'\n  lt_cv_file_magic_cmd='/usr/bin/file -L'\n  lt_cv_file_magic_test_file=/shlib/libc.so\n  ;;\n\ncygwin*)\n  # func_win32_libid is a shell function defined in ltmain.sh\n  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'\n  lt_cv_file_magic_cmd='func_win32_libid'\n  ;;\n\nmingw* | pw32*)\n  # Base MSYS/MinGW do not provide the 'file' command needed by\n  # func_win32_libid shell function, so use a weaker test based on 'objdump',\n  # unless we find 'file', for example because we are cross-compiling.\n  if ( file / ) >/dev/null 2>&1; then\n    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'\n    lt_cv_file_magic_cmd='func_win32_libid'\n  else\n    # Keep this pattern in sync with the one in func_win32_libid.\n    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'\n    lt_cv_file_magic_cmd='$OBJDUMP -f'\n  fi\n  ;;\n\ncegcc*)\n  # use the weaker test based on 'objdump'. See mingw*.\n  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'\n  lt_cv_file_magic_cmd='$OBJDUMP -f'\n  ;;\n\ndarwin* | rhapsody*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nfreebsd* | dragonfly*)\n  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then\n    case $host_cpu in\n    i*86 )\n      # Not sure whether the presence of OpenBSD here was a mistake.\n      # Let's accept both of them until this is cleared up.\n      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'\n      lt_cv_file_magic_cmd=/usr/bin/file\n      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`\n      ;;\n    esac\n  else\n    lt_cv_deplibs_check_method=pass_all\n  fi\n  ;;\n\nhaiku*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nhpux10.20* | hpux11*)\n  lt_cv_file_magic_cmd=/usr/bin/file\n  case $host_cpu in\n  ia64*)\n    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'\n    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so\n    ;;\n  hppa*64*)\n    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\\.[0-9]']\n    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl\n    ;;\n  *)\n    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\\.[[0-9]]) shared library'\n    lt_cv_file_magic_test_file=/usr/lib/libc.sl\n    ;;\n  esac\n  ;;\n\ninterix[[3-9]]*)\n  # PIC code is broken on Interix 3.x, that's why |\\.a not |_pic\\.a here\n  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\\.so|\\.a)$'\n  ;;\n\nirix5* | irix6* | nonstopux*)\n  case $LD in\n  *-32|*\"-32 \") libmagic=32-bit;;\n  *-n32|*\"-n32 \") libmagic=N32;;\n  *-64|*\"-64 \") libmagic=64-bit;;\n  *) libmagic=never-match;;\n  esac\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\n# This must be glibc/ELF.\nlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nnetbsd*)\n  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then\n    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\\.so\\.[[0-9]]+\\.[[0-9]]+|_pic\\.a)$'\n  else\n    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\\.so|_pic\\.a)$'\n  fi\n  ;;\n\nnewos6*)\n  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'\n  lt_cv_file_magic_cmd=/usr/bin/file\n  lt_cv_file_magic_test_file=/usr/lib/libnls.so\n  ;;\n\n*nto* | *qnx*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nopenbsd* | bitrig*)\n  if test -z \"`echo __ELF__ | $CC -E - | $GREP __ELF__`\"; then\n    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\\.so\\.[[0-9]]+\\.[[0-9]]+|\\.so|_pic\\.a)$'\n  else\n    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\\.so\\.[[0-9]]+\\.[[0-9]]+|_pic\\.a)$'\n  fi\n  ;;\n\nosf3* | osf4* | osf5*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nrdos*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsolaris*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsysv4 | sysv4.3*)\n  case $host_vendor in\n  motorola)\n    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'\n    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`\n    ;;\n  ncr)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  sequent)\n    lt_cv_file_magic_cmd='/bin/file'\n    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'\n    ;;\n  sni)\n    lt_cv_file_magic_cmd='/bin/file'\n    lt_cv_deplibs_check_method=\"file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib\"\n    lt_cv_file_magic_test_file=/lib/libc.so\n    ;;\n  siemens)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  pc)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  esac\n  ;;\n\ntpf*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\nos2*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\nesac\n])\n\nfile_magic_glob=\nwant_nocaseglob=no\nif test \"$build\" = \"$host\"; then\n  case $host_os in\n  mingw* | pw32*)\n    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then\n      want_nocaseglob=yes\n    else\n      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e \"s/\\(..\\)/s\\/[[\\1]]\\/[[\\1]]\\/g;/g\"`\n    fi\n    ;;\n  esac\nfi\n\nfile_magic_cmd=$lt_cv_file_magic_cmd\ndeplibs_check_method=$lt_cv_deplibs_check_method\ntest -z \"$deplibs_check_method\" && deplibs_check_method=unknown\n\n_LT_DECL([], [deplibs_check_method], [1],\n    [Method to check whether dependent libraries are shared objects])\n_LT_DECL([], [file_magic_cmd], [1],\n    [Command to use when deplibs_check_method = \"file_magic\"])\n_LT_DECL([], [file_magic_glob], [1],\n    [How to find potential files when deplibs_check_method = \"file_magic\"])\n_LT_DECL([], [want_nocaseglob], [1],\n    [Find potential files using nocaseglob when deplibs_check_method = \"file_magic\"])\n])# _LT_CHECK_MAGIC_METHOD\n\n\n# LT_PATH_NM\n# ----------\n# find the pathname to a BSD- or MS-compatible name lister\nAC_DEFUN([LT_PATH_NM],\n[AC_REQUIRE([AC_PROG_CC])dnl\nAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,\n[if test -n \"$NM\"; then\n  # Let the user override the test.\n  lt_cv_path_NM=$NM\nelse\n  lt_nm_to_check=${ac_tool_prefix}nm\n  if test -n \"$ac_tool_prefix\" && test \"$build\" = \"$host\"; then\n    lt_nm_to_check=\"$lt_nm_to_check nm\"\n  fi\n  for lt_tmp_nm in $lt_nm_to_check; do\n    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR\n    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do\n      IFS=$lt_save_ifs\n      test -z \"$ac_dir\" && ac_dir=.\n      tmp_nm=$ac_dir/$lt_tmp_nm\n      if test -f \"$tmp_nm\" || test -f \"$tmp_nm$ac_exeext\"; then\n\t# Check to see if the nm accepts a BSD-compat flag.\n\t# Adding the 'sed 1q' prevents false positives on HP-UX, which says:\n\t#   nm: unknown option \"B\" ignored\n\t# Tru64's nm complains that /dev/null is an invalid object file\n\t# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty\n\tcase $build_os in\n\tmingw*) lt_bad_file=conftest.nm/nofile ;;\n\t*) lt_bad_file=/dev/null ;;\n\tesac\n\tcase `\"$tmp_nm\" -B $lt_bad_file 2>&1 | sed '1q'` in\n\t*$lt_bad_file* | *'Invalid file or object type'*)\n\t  lt_cv_path_NM=\"$tmp_nm -B\"\n\t  break 2\n\t  ;;\n\t*)\n\t  case `\"$tmp_nm\" -p /dev/null 2>&1 | sed '1q'` in\n\t  */dev/null*)\n\t    lt_cv_path_NM=\"$tmp_nm -p\"\n\t    break 2\n\t    ;;\n\t  *)\n\t    lt_cv_path_NM=${lt_cv_path_NM=\"$tmp_nm\"} # keep the first match, but\n\t    continue # so that we can try to find one that supports BSD flags\n\t    ;;\n\t  esac\n\t  ;;\n\tesac\n      fi\n    done\n    IFS=$lt_save_ifs\n  done\n  : ${lt_cv_path_NM=no}\nfi])\nif test no != \"$lt_cv_path_NM\"; then\n  NM=$lt_cv_path_NM\nelse\n  # Didn't find any BSD compatible name lister, look for dumpbin.\n  if test -n \"$DUMPBIN\"; then :\n    # Let the user override the test.\n  else\n    AC_CHECK_TOOLS(DUMPBIN, [dumpbin \"link -dump\"], :)\n    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in\n    *COFF*)\n      DUMPBIN=\"$DUMPBIN -symbols -headers\"\n      ;;\n    *)\n      DUMPBIN=:\n      ;;\n    esac\n  fi\n  AC_SUBST([DUMPBIN])\n  if test : != \"$DUMPBIN\"; then\n    NM=$DUMPBIN\n  fi\nfi\ntest -z \"$NM\" && NM=nm\nAC_SUBST([NM])\n_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl\n\nAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],\n  [lt_cv_nm_interface=\"BSD nm\"\n  echo \"int some_variable = 0;\" > conftest.$ac_ext\n  (eval echo \"\\\"\\$as_me:$LINENO: $ac_compile\\\"\" >&AS_MESSAGE_LOG_FD)\n  (eval \"$ac_compile\" 2>conftest.err)\n  cat conftest.err >&AS_MESSAGE_LOG_FD\n  (eval echo \"\\\"\\$as_me:$LINENO: $NM \\\\\\\"conftest.$ac_objext\\\\\\\"\\\"\" >&AS_MESSAGE_LOG_FD)\n  (eval \"$NM \\\"conftest.$ac_objext\\\"\" 2>conftest.err > conftest.out)\n  cat conftest.err >&AS_MESSAGE_LOG_FD\n  (eval echo \"\\\"\\$as_me:$LINENO: output\\\"\" >&AS_MESSAGE_LOG_FD)\n  cat conftest.out >&AS_MESSAGE_LOG_FD\n  if $GREP 'External.*some_variable' conftest.out > /dev/null; then\n    lt_cv_nm_interface=\"MS dumpbin\"\n  fi\n  rm -f conftest*])\n])# LT_PATH_NM\n\n# Old names:\nAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])\nAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AM_PROG_NM], [])\ndnl AC_DEFUN([AC_PROG_NM], [])\n\n# _LT_CHECK_SHAREDLIB_FROM_LINKLIB\n# --------------------------------\n# how to determine the name of the shared library\n# associated with a specific link library.\n#  -- PORTME fill in with the dynamic library characteristics\nm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],\n[m4_require([_LT_DECL_EGREP])\nm4_require([_LT_DECL_OBJDUMP])\nm4_require([_LT_DECL_DLLTOOL])\nAC_CACHE_CHECK([how to associate runtime and link libraries],\nlt_cv_sharedlib_from_linklib_cmd,\n[lt_cv_sharedlib_from_linklib_cmd='unknown'\n\ncase $host_os in\ncygwin* | mingw* | pw32* | cegcc*)\n  # two different shell functions defined in ltmain.sh;\n  # decide which one to use based on capabilities of $DLLTOOL\n  case `$DLLTOOL --help 2>&1` in\n  *--identify-strict*)\n    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib\n    ;;\n  *)\n    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback\n    ;;\n  esac\n  ;;\n*)\n  # fallback: assume linklib IS sharedlib\n  lt_cv_sharedlib_from_linklib_cmd=$ECHO\n  ;;\nesac\n])\nsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd\ntest -z \"$sharedlib_from_linklib_cmd\" && sharedlib_from_linklib_cmd=$ECHO\n\n_LT_DECL([], [sharedlib_from_linklib_cmd], [1],\n    [Command to associate shared and link libraries])\n])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB\n\n\n# _LT_PATH_MANIFEST_TOOL\n# ----------------------\n# locate the manifest tool\nm4_defun([_LT_PATH_MANIFEST_TOOL],\n[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)\ntest -z \"$MANIFEST_TOOL\" && MANIFEST_TOOL=mt\nAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],\n  [lt_cv_path_mainfest_tool=no\n  echo \"$as_me:$LINENO: $MANIFEST_TOOL '-?'\" >&AS_MESSAGE_LOG_FD\n  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out\n  cat conftest.err >&AS_MESSAGE_LOG_FD\n  if $GREP 'Manifest Tool' conftest.out > /dev/null; then\n    lt_cv_path_mainfest_tool=yes\n  fi\n  rm -f conftest*])\nif test yes != \"$lt_cv_path_mainfest_tool\"; then\n  MANIFEST_TOOL=:\nfi\n_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl\n])# _LT_PATH_MANIFEST_TOOL\n\n\n# _LT_DLL_DEF_P([FILE])\n# ---------------------\n# True iff FILE is a Windows DLL '.def' file.\n# Keep in sync with func_dll_def_p in the libtool script\nAC_DEFUN([_LT_DLL_DEF_P],\n[dnl\n  test DEF = \"`$SED -n dnl\n    -e '\\''s/^[[\t ]]*//'\\'' dnl Strip leading whitespace\n    -e '\\''/^\\(;.*\\)*$/d'\\'' dnl      Delete empty lines and comments\n    -e '\\''s/^\\(EXPORTS\\|LIBRARY\\)\\([[\t ]].*\\)*$/DEF/p'\\'' dnl\n    -e q dnl                          Only consider the first \"real\" line\n    $1`\" dnl\n])# _LT_DLL_DEF_P\n\n\n# LT_LIB_M\n# --------\n# check for math library\nAC_DEFUN([LT_LIB_M],\n[AC_REQUIRE([AC_CANONICAL_HOST])dnl\nLIBM=\ncase $host in\n*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)\n  # These system don't have libm, or don't need it\n  ;;\n*-ncr-sysv4.3*)\n  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)\n  AC_CHECK_LIB(m, cos, LIBM=\"$LIBM -lm\")\n  ;;\n*)\n  AC_CHECK_LIB(m, cos, LIBM=-lm)\n  ;;\nesac\nAC_SUBST([LIBM])\n])# LT_LIB_M\n\n# Old name:\nAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_CHECK_LIBM], [])\n\n\n# _LT_COMPILER_NO_RTTI([TAGNAME])\n# -------------------------------\nm4_defun([_LT_COMPILER_NO_RTTI],\n[m4_require([_LT_TAG_COMPILER])dnl\n\n_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=\n\nif test yes = \"$GCC\"; then\n  case $cc_basename in\n  nvcc*)\n    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;\n  *)\n    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;\n  esac\n\n  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],\n    lt_cv_prog_compiler_rtti_exceptions,\n    [-fno-rtti -fno-exceptions], [],\n    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=\"$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions\"])\nfi\n_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],\n\t[Compiler flag to turn off builtin functions])\n])# _LT_COMPILER_NO_RTTI\n\n\n# _LT_CMD_GLOBAL_SYMBOLS\n# ----------------------\nm4_defun([_LT_CMD_GLOBAL_SYMBOLS],\n[AC_REQUIRE([AC_CANONICAL_HOST])dnl\nAC_REQUIRE([AC_PROG_CC])dnl\nAC_REQUIRE([AC_PROG_AWK])dnl\nAC_REQUIRE([LT_PATH_NM])dnl\nAC_REQUIRE([LT_PATH_LD])dnl\nm4_require([_LT_DECL_SED])dnl\nm4_require([_LT_DECL_EGREP])dnl\nm4_require([_LT_TAG_COMPILER])dnl\n\n# Check for command to grab the raw symbol name followed by C symbol from nm.\nAC_MSG_CHECKING([command to parse $NM output from $compiler object])\nAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],\n[\n# These are sane defaults that work on at least a few old systems.\n# [They come from Ultrix.  What could be older than Ultrix?!! ;)]\n\n# Character class describing NM global symbol codes.\nsymcode='[[BCDEGRST]]'\n\n# Regexp to match symbols that can be accessed directly from C.\nsympat='\\([[_A-Za-z]][[_A-Za-z0-9]]*\\)'\n\n# Define system-specific variables.\ncase $host_os in\naix*)\n  symcode='[[BCDT]]'\n  ;;\ncygwin* | mingw* | pw32* | cegcc*)\n  symcode='[[ABCDGISTW]]'\n  ;;\nhpux*)\n  if test ia64 = \"$host_cpu\"; then\n    symcode='[[ABCDEGRST]]'\n  fi\n  ;;\nirix* | nonstopux*)\n  symcode='[[BCDEGRST]]'\n  ;;\nosf*)\n  symcode='[[BCDEGQRST]]'\n  ;;\nsolaris*)\n  symcode='[[BDRT]]'\n  ;;\nsco3.2v5*)\n  symcode='[[DT]]'\n  ;;\nsysv4.2uw2*)\n  symcode='[[DT]]'\n  ;;\nsysv5* | sco5v6* | unixware* | OpenUNIX*)\n  symcode='[[ABDT]]'\n  ;;\nsysv4)\n  symcode='[[DFNSTU]]'\n  ;;\nesac\n\n# If we're using GNU nm, then use its standard symbol codes.\ncase `$NM -V 2>&1` in\n*GNU* | *'with BFD'*)\n  symcode='[[ABCDGIRSTW]]' ;;\nesac\n\nif test \"$lt_cv_nm_interface\" = \"MS dumpbin\"; then\n  # Gets list of data symbols to import.\n  lt_cv_sys_global_symbol_to_import=\"sed -n -e 's/^I .* \\(.*\\)$/\\1/p'\"\n  # Adjust the below global symbol transforms to fixup imported variables.\n  lt_cdecl_hook=\" -e 's/^I .* \\(.*\\)$/extern __declspec(dllimport) char \\1;/p'\"\n  lt_c_name_hook=\" -e 's/^I .* \\(.*\\)$/  {\\\"\\1\\\", (void *) 0},/p'\"\n  lt_c_name_lib_hook=\"\\\n  -e 's/^I .* \\(lib.*\\)$/  {\\\"\\1\\\", (void *) 0},/p'\\\n  -e 's/^I .* \\(.*\\)$/  {\\\"lib\\1\\\", (void *) 0},/p'\"\nelse\n  # Disable hooks by default.\n  lt_cv_sys_global_symbol_to_import=\n  lt_cdecl_hook=\n  lt_c_name_hook=\n  lt_c_name_lib_hook=\nfi\n\n# Transform an extracted symbol line into a proper C declaration.\n# Some systems (esp. on ia64) link data and code symbols differently,\n# so use this general approach.\nlt_cv_sys_global_symbol_to_cdecl=\"sed -n\"\\\n$lt_cdecl_hook\\\n\" -e 's/^T .* \\(.*\\)$/extern int \\1();/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(.*\\)$/extern char \\1;/p'\"\n\n# Transform an extracted symbol line into symbol name and symbol address\nlt_cv_sys_global_symbol_to_c_name_address=\"sed -n\"\\\n$lt_c_name_hook\\\n\" -e 's/^: \\(.*\\) .*$/  {\\\"\\1\\\", (void *) 0},/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(.*\\)$/  {\\\"\\1\\\", (void *) \\&\\1},/p'\"\n\n# Transform an extracted symbol line into symbol name with lib prefix and\n# symbol address.\nlt_cv_sys_global_symbol_to_c_name_address_lib_prefix=\"sed -n\"\\\n$lt_c_name_lib_hook\\\n\" -e 's/^: \\(.*\\) .*$/  {\\\"\\1\\\", (void *) 0},/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(lib.*\\)$/  {\\\"\\1\\\", (void *) \\&\\1},/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(.*\\)$/  {\\\"lib\\1\\\", (void *) \\&\\1},/p'\"\n\n# Handle CRLF in mingw tool chain\nopt_cr=\ncase $build_os in\nmingw*)\n  opt_cr=`$ECHO 'x\\{0,1\\}' | tr x '\\015'` # option cr in regexp\n  ;;\nesac\n\n# Try without a prefix underscore, then with it.\nfor ac_symprfx in \"\" \"_\"; do\n\n  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.\n  symxfrm=\"\\\\1 $ac_symprfx\\\\2 \\\\2\"\n\n  # Write the raw and C identifiers.\n  if test \"$lt_cv_nm_interface\" = \"MS dumpbin\"; then\n    # Fake it for dumpbin and say T for any non-static function,\n    # D for any global variable and I for any imported variable.\n    # Also find C++ and __fastcall symbols from MSVC++,\n    # which start with @ or ?.\n    lt_cv_sys_global_symbol_pipe=\"$AWK ['\"\\\n\"     {last_section=section; section=\\$ 3};\"\\\n\"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};\"\\\n\"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};\"\\\n\"     /^ *Symbol name *: /{split(\\$ 0,sn,\\\":\\\"); si=substr(sn[2],2)};\"\\\n\"     /^ *Type *: code/{print \\\"T\\\",si,substr(si,length(prfx))};\"\\\n\"     /^ *Type *: data/{print \\\"I\\\",si,substr(si,length(prfx))};\"\\\n\"     \\$ 0!~/External *\\|/{next};\"\\\n\"     / 0+ UNDEF /{next}; / UNDEF \\([^|]\\)*()/{next};\"\\\n\"     {if(hide[section]) next};\"\\\n\"     {f=\\\"D\\\"}; \\$ 0~/\\(\\).*\\|/{f=\\\"T\\\"};\"\\\n\"     {split(\\$ 0,a,/\\||\\r/); split(a[2],s)};\"\\\n\"     s[1]~/^[@?]/{print f,s[1],s[1]; next};\"\\\n\"     s[1]~prfx {split(s[1],t,\\\"@\\\"); print f,t[1],substr(t[1],length(prfx))}\"\\\n\"     ' prfx=^$ac_symprfx]\"\n  else\n    lt_cv_sys_global_symbol_pipe=\"sed -n -e 's/^.*[[\t ]]\\($symcode$symcode*\\)[[\t ]][[\t ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'\"\n  fi\n  lt_cv_sys_global_symbol_pipe=\"$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'\"\n\n  # Check to see that the pipe works correctly.\n  pipe_works=no\n\n  rm -f conftest*\n  cat > conftest.$ac_ext <<_LT_EOF\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nchar nm_test_var;\nvoid nm_test_func(void);\nvoid nm_test_func(void){}\n#ifdef __cplusplus\n}\n#endif\nint main(){nm_test_var='a';nm_test_func();return(0);}\n_LT_EOF\n\n  if AC_TRY_EVAL(ac_compile); then\n    # Now try to grab the symbols.\n    nlist=conftest.nm\n    if AC_TRY_EVAL(NM conftest.$ac_objext \\| \"$lt_cv_sys_global_symbol_pipe\" \\> $nlist) && test -s \"$nlist\"; then\n      # Try sorting and uniquifying the output.\n      if sort \"$nlist\" | uniq > \"$nlist\"T; then\n\tmv -f \"$nlist\"T \"$nlist\"\n      else\n\trm -f \"$nlist\"T\n      fi\n\n      # Make sure that we snagged all the symbols we need.\n      if $GREP ' nm_test_var$' \"$nlist\" >/dev/null; then\n\tif $GREP ' nm_test_func$' \"$nlist\" >/dev/null; then\n\t  cat <<_LT_EOF > conftest.$ac_ext\n/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */\n#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE\n/* DATA imports from DLLs on WIN32 can't be const, because runtime\n   relocations are performed -- see ld's documentation on pseudo-relocs.  */\n# define LT@&t@_DLSYM_CONST\n#elif defined __osf__\n/* This system does not cope well with relocations in const data.  */\n# define LT@&t@_DLSYM_CONST\n#else\n# define LT@&t@_DLSYM_CONST const\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n_LT_EOF\n\t  # Now generate the symbol file.\n\t  eval \"$lt_cv_sys_global_symbol_to_cdecl\"' < \"$nlist\" | $GREP -v main >> conftest.$ac_ext'\n\n\t  cat <<_LT_EOF >> conftest.$ac_ext\n\n/* The mapping between symbol names and symbols.  */\nLT@&t@_DLSYM_CONST struct {\n  const char *name;\n  void       *address;\n}\nlt__PROGRAM__LTX_preloaded_symbols[[]] =\n{\n  { \"@PROGRAM@\", (void *) 0 },\n_LT_EOF\n\t  $SED \"s/^$symcode$symcode* .* \\(.*\\)$/  {\\\"\\1\\\", (void *) \\&\\1},/\" < \"$nlist\" | $GREP -v main >> conftest.$ac_ext\n\t  cat <<\\_LT_EOF >> conftest.$ac_ext\n  {0, (void *) 0}\n};\n\n/* This works around a problem in FreeBSD linker */\n#ifdef FREEBSD_WORKAROUND\nstatic const void *lt_preloaded_setup() {\n  return lt__PROGRAM__LTX_preloaded_symbols;\n}\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n_LT_EOF\n\t  # Now try linking the two files.\n\t  mv conftest.$ac_objext conftstm.$ac_objext\n\t  lt_globsym_save_LIBS=$LIBS\n\t  lt_globsym_save_CFLAGS=$CFLAGS\n\t  LIBS=conftstm.$ac_objext\n\t  CFLAGS=\"$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)\"\n\t  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then\n\t    pipe_works=yes\n\t  fi\n\t  LIBS=$lt_globsym_save_LIBS\n\t  CFLAGS=$lt_globsym_save_CFLAGS\n\telse\n\t  echo \"cannot find nm_test_func in $nlist\" >&AS_MESSAGE_LOG_FD\n\tfi\n      else\n\techo \"cannot find nm_test_var in $nlist\" >&AS_MESSAGE_LOG_FD\n      fi\n    else\n      echo \"cannot run $lt_cv_sys_global_symbol_pipe\" >&AS_MESSAGE_LOG_FD\n    fi\n  else\n    echo \"$progname: failed program was:\" >&AS_MESSAGE_LOG_FD\n    cat conftest.$ac_ext >&5\n  fi\n  rm -rf conftest* conftst*\n\n  # Do not use the global_symbol_pipe unless it works.\n  if test yes = \"$pipe_works\"; then\n    break\n  else\n    lt_cv_sys_global_symbol_pipe=\n  fi\ndone\n])\nif test -z \"$lt_cv_sys_global_symbol_pipe\"; then\n  lt_cv_sys_global_symbol_to_cdecl=\nfi\nif test -z \"$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl\"; then\n  AC_MSG_RESULT(failed)\nelse\n  AC_MSG_RESULT(ok)\nfi\n\n# Response file support.\nif test \"$lt_cv_nm_interface\" = \"MS dumpbin\"; then\n  nm_file_list_spec='@'\nelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then\n  nm_file_list_spec='@'\nfi\n\n_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],\n    [Take the output of nm and produce a listing of raw symbols and C names])\n_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],\n    [Transform the output of nm in a proper C declaration])\n_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],\n    [Transform the output of nm into a list of symbols to manually relocate])\n_LT_DECL([global_symbol_to_c_name_address],\n    [lt_cv_sys_global_symbol_to_c_name_address], [1],\n    [Transform the output of nm in a C name address pair])\n_LT_DECL([global_symbol_to_c_name_address_lib_prefix],\n    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],\n    [Transform the output of nm in a C name address pair when lib prefix is needed])\n_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],\n    [The name lister interface])\n_LT_DECL([], [nm_file_list_spec], [1],\n    [Specify filename containing input files for $NM])\n]) # _LT_CMD_GLOBAL_SYMBOLS\n\n\n# _LT_COMPILER_PIC([TAGNAME])\n# ---------------------------\nm4_defun([_LT_COMPILER_PIC],\n[m4_require([_LT_TAG_COMPILER])dnl\n_LT_TAGVAR(lt_prog_compiler_wl, $1)=\n_LT_TAGVAR(lt_prog_compiler_pic, $1)=\n_LT_TAGVAR(lt_prog_compiler_static, $1)=\n\nm4_if([$1], [CXX], [\n  # C++ specific cases for pic, static, wl, etc.\n  if test yes = \"$GXX\"; then\n    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n\n    case $host_os in\n    aix*)\n      # All AIX code is PIC.\n      if test ia64 = \"$host_cpu\"; then\n\t# AIX 5 now supports IA64 processor\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      fi\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n      ;;\n\n    amigaos*)\n      case $host_cpu in\n      powerpc)\n            # see comment about AmigaOS4 .so support\n            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n        ;;\n      m68k)\n            # FIXME: we need at least 68020 code to build shared libraries, but\n            # adding the '-m68020' flag to GCC prevents building anything better,\n            # like '-m68040'.\n            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'\n        ;;\n      esac\n      ;;\n\n    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)\n      # PIC is the default for these OSes.\n      ;;\n    mingw* | cygwin* | os2* | pw32* | cegcc*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      # Although the cygwin gcc ignores -fPIC, still need this for old-style\n      # (--disable-auto-import) libraries\n      m4_if([$1], [GCJ], [],\n\t[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])\n      case $host_os in\n      os2*)\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'\n\t;;\n      esac\n      ;;\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'\n      ;;\n    *djgpp*)\n      # DJGPP does not support shared libraries at all\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)=\n      ;;\n    haiku*)\n      # PIC is the default for Haiku.\n      # The \"-static\" flag exists, but is broken.\n      _LT_TAGVAR(lt_prog_compiler_static, $1)=\n      ;;\n    interix[[3-9]]*)\n      # Interix 3.x gcc -fpic/-fPIC options generate broken code.\n      # Instead, we relocate shared libraries at runtime.\n      ;;\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic\n      fi\n      ;;\n    hpux*)\n      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit\n      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag\n      # sets the default TLS model and affects inlining.\n      case $host_cpu in\n      hppa*64*)\n\t;;\n      *)\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t;;\n      esac\n      ;;\n    *qnx* | *nto*)\n      # QNX uses GNU C++, but need to define -shared option too, otherwise\n      # it will coredump.\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'\n      ;;\n    *)\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n      ;;\n    esac\n  else\n    case $host_os in\n      aix[[4-9]]*)\n\t# All AIX code is PIC.\n\tif test ia64 = \"$host_cpu\"; then\n\t  # AIX 5 now supports IA64 processor\n\t  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\telse\n\t  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'\n\tfi\n\t;;\n      chorus*)\n\tcase $cc_basename in\n\tcxch68*)\n\t  # Green Hills C++ Compiler\n\t  # _LT_TAGVAR(lt_prog_compiler_static, $1)=\"--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a\"\n\t  ;;\n\tesac\n\t;;\n      mingw* | cygwin* | os2* | pw32* | cegcc*)\n\t# This hack is so that the source file can tell whether it is being\n\t# built for inclusion in a dll (and should export symbols for example).\n\tm4_if([$1], [GCJ], [],\n\t  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])\n\t;;\n      dgux*)\n\tcase $cc_basename in\n\t  ec++*)\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t    ;;\n\t  ghcx*)\n\t    # Green Hills C++ Compiler\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      freebsd* | dragonfly*)\n\t# FreeBSD uses GNU C++\n\t;;\n      hpux9* | hpux10* | hpux11*)\n\tcase $cc_basename in\n\t  CC*)\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'\n\t    if test ia64 != \"$host_cpu\"; then\n\t      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'\n\t    fi\n\t    ;;\n\t  aCC*)\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'\n\t    case $host_cpu in\n\t    hppa*64*|ia64*)\n\t      # +Z the default\n\t      ;;\n\t    *)\n\t      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'\n\t      ;;\n\t    esac\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      interix*)\n\t# This is c89, which is MS Visual C++ (no shared libs)\n\t# Anyone wants to do a port?\n\t;;\n      irix5* | irix6* | nonstopux*)\n\tcase $cc_basename in\n\t  CC*)\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n\t    # CC pic flag -KPIC is the default.\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n\tcase $cc_basename in\n\t  KCC*)\n\t    # KAI C++ Compiler\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t    ;;\n\t  ecpc* )\n\t    # old Intel C++ for x86_64, which still supported -KPIC.\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n\t    ;;\n\t  icpc* )\n\t    # Intel C++, used to be incompatible with GCC.\n\t    # ICC 10 doesn't accept -KPIC any more.\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n\t    ;;\n\t  pgCC* | pgcpp*)\n\t    # Portland Group C++ compiler\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t    ;;\n\t  cxx*)\n\t    # Compaq C++\n\t    # Make sure the PIC flag is empty.  It appears that all Alpha\n\t    # Linux and Compaq Tru64 Unix objects are PIC.\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)=\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n\t    ;;\n\t  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)\n\t    # IBM XL 8.0, 9.0 on PPC and BlueGene\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'\n\t    ;;\n\t  *)\n\t    case `$CC -V 2>&1 | sed 5q` in\n\t    *Sun\\ C*)\n\t      # Sun C++ 5.9\n\t      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '\n\t      ;;\n\t    esac\n\t    ;;\n\tesac\n\t;;\n      lynxos*)\n\t;;\n      m88k*)\n\t;;\n      mvs*)\n\tcase $cc_basename in\n\t  cxx*)\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      netbsd*)\n\t;;\n      *qnx* | *nto*)\n        # QNX uses GNU C++, but need to define -shared option too, otherwise\n        # it will coredump.\n        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'\n        ;;\n      osf3* | osf4* | osf5*)\n\tcase $cc_basename in\n\t  KCC*)\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'\n\t    ;;\n\t  RCC*)\n\t    # Rational C++ 2.4.1\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'\n\t    ;;\n\t  cxx*)\n\t    # Digital/Compaq C++\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    # Make sure the PIC flag is empty.  It appears that all Alpha\n\t    # Linux and Compaq Tru64 Unix objects are PIC.\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)=\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      psos*)\n\t;;\n      solaris*)\n\tcase $cc_basename in\n\t  CC* | sunCC*)\n\t    # Sun C++ 4.2, 5.x and Centerline C++\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '\n\t    ;;\n\t  gcx*)\n\t    # Green Hills C++ Compiler\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      sunos4*)\n\tcase $cc_basename in\n\t  CC*)\n\t    # Sun C++ 4.x\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t    ;;\n\t  lcc*)\n\t    # Lucid\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)\n\tcase $cc_basename in\n\t  CC*)\n\t    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t    ;;\n\tesac\n\t;;\n      tandem*)\n\tcase $cc_basename in\n\t  NCC*)\n\t    # NonStop-UX NCC 3.20\n\t    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      vxworks*)\n\t;;\n      *)\n\t_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no\n\t;;\n    esac\n  fi\n],\n[\n  if test yes = \"$GCC\"; then\n    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n\n    case $host_os in\n      aix*)\n      # All AIX code is PIC.\n      if test ia64 = \"$host_cpu\"; then\n\t# AIX 5 now supports IA64 processor\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      fi\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n      ;;\n\n    amigaos*)\n      case $host_cpu in\n      powerpc)\n            # see comment about AmigaOS4 .so support\n            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n        ;;\n      m68k)\n            # FIXME: we need at least 68020 code to build shared libraries, but\n            # adding the '-m68020' flag to GCC prevents building anything better,\n            # like '-m68040'.\n            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'\n        ;;\n      esac\n      ;;\n\n    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)\n      # PIC is the default for these OSes.\n      ;;\n\n    mingw* | cygwin* | pw32* | os2* | cegcc*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      # Although the cygwin gcc ignores -fPIC, still need this for old-style\n      # (--disable-auto-import) libraries\n      m4_if([$1], [GCJ], [],\n\t[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])\n      case $host_os in\n      os2*)\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'\n\t;;\n      esac\n      ;;\n\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'\n      ;;\n\n    haiku*)\n      # PIC is the default for Haiku.\n      # The \"-static\" flag exists, but is broken.\n      _LT_TAGVAR(lt_prog_compiler_static, $1)=\n      ;;\n\n    hpux*)\n      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit\n      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag\n      # sets the default TLS model and affects inlining.\n      case $host_cpu in\n      hppa*64*)\n\t# +Z the default\n\t;;\n      *)\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t;;\n      esac\n      ;;\n\n    interix[[3-9]]*)\n      # Interix 3.x gcc -fpic/-fPIC options generate broken code.\n      # Instead, we relocate shared libraries at runtime.\n      ;;\n\n    msdosdjgpp*)\n      # Just because we use GCC doesn't mean we suddenly get shared libraries\n      # on systems that don't support them.\n      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no\n      enable_shared=no\n      ;;\n\n    *nto* | *qnx*)\n      # QNX uses GNU C++, but need to define -shared option too, otherwise\n      # it will coredump.\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic\n      fi\n      ;;\n\n    *)\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n      ;;\n    esac\n\n    case $cc_basename in\n    nvcc*) # Cuda Compiler Driver 2.2\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '\n      if test -n \"$_LT_TAGVAR(lt_prog_compiler_pic, $1)\"; then\n        _LT_TAGVAR(lt_prog_compiler_pic, $1)=\"-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)\"\n      fi\n      ;;\n    esac\n  else\n    # PORTME Check for flag to pass linker flags through the system compiler.\n    case $host_os in\n    aix*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      if test ia64 = \"$host_cpu\"; then\n\t# AIX 5 now supports IA64 processor\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      else\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'\n      fi\n      ;;\n\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'\n      case $cc_basename in\n      nagfor*)\n        # NAG Fortran compiler\n        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'\n        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'\n        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n        ;;\n      esac\n      ;;\n\n    mingw* | cygwin* | pw32* | os2* | cegcc*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      m4_if([$1], [GCJ], [],\n\t[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])\n      case $host_os in\n      os2*)\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'\n\t;;\n      esac\n      ;;\n\n    hpux9* | hpux10* | hpux11*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but\n      # not for PA HP-UX.\n      case $host_cpu in\n      hppa*64*|ia64*)\n\t# +Z the default\n\t;;\n      *)\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'\n\t;;\n      esac\n      # Is there a better lt_prog_compiler_static that works with the bundled CC?\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      # PIC (with -KPIC) is the default.\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n      ;;\n\n    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n      case $cc_basename in\n      # old Intel for x86_64, which still supported -KPIC.\n      ecc*)\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n        ;;\n      # icc used to be incompatible with GCC.\n      # ICC 10 doesn't accept -KPIC any more.\n      icc* | ifort*)\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n        ;;\n      # Lahey Fortran 8.1.\n      lf95*)\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'\n\t;;\n      nagfor*)\n\t# NAG Fortran compiler\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t;;\n      tcc*)\n\t# Fabrice Bellard et al's Tiny C Compiler\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n\t;;\n      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)\n        # Portland Group compilers (*not* the Pentium gcc compiler,\n\t# which looks to be a dead project)\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n        ;;\n      ccc*)\n        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n        # All Alpha code is PIC.\n        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n        ;;\n      xl* | bgxl* | bgf* | mpixl*)\n\t# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'\n\t;;\n      *)\n\tcase `$CC -V 2>&1 | sed 5q` in\n\t*Sun\\ Ceres\\ Fortran* | *Sun*Fortran*\\ [[1-7]].* | *Sun*Fortran*\\ 8.[[0-3]]*)\n\t  # Sun Fortran 8.3 passes all unrecognized flags to the linker\n\t  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''\n\t  ;;\n\t*Sun\\ F* | *Sun*Fortran*)\n\t  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '\n\t  ;;\n\t*Sun\\ C*)\n\t  # Sun C 5.9\n\t  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t  ;;\n        *Intel*\\ [[CF]]*Compiler*)\n\t  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'\n\t  ;;\n\t*Portland\\ Group*)\n\t  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'\n\t  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t  ;;\n\tesac\n\t;;\n      esac\n      ;;\n\n    newsos6)\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      ;;\n\n    *nto* | *qnx*)\n      # QNX uses GNU C++, but need to define -shared option too, otherwise\n      # it will coredump.\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'\n      ;;\n\n    osf3* | osf4* | osf5*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      # All OSF/1 code is PIC.\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n      ;;\n\n    rdos*)\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n      ;;\n\n    solaris*)\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      case $cc_basename in\n      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;\n      *)\n\t_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;\n      esac\n      ;;\n\n    sunos4*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      ;;\n\n    sysv4 | sysv4.2uw2* | sysv4.3*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\t_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'\n\t_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      fi\n      ;;\n\n    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      ;;\n\n    unicos*)\n      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no\n      ;;\n\n    uts4*)\n      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'\n      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      ;;\n\n    *)\n      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no\n      ;;\n    esac\n  fi\n])\ncase $host_os in\n  # For platforms that do not support PIC, -DPIC is meaningless:\n  *djgpp*)\n    _LT_TAGVAR(lt_prog_compiler_pic, $1)=\n    ;;\n  *)\n    _LT_TAGVAR(lt_prog_compiler_pic, $1)=\"$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])\"\n    ;;\nesac\n\nAC_CACHE_CHECK([for $compiler option to produce PIC],\n  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],\n  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])\n_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)\n\n#\n# Check to make sure the PIC flag actually works.\n#\nif test -n \"$_LT_TAGVAR(lt_prog_compiler_pic, $1)\"; then\n  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],\n    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],\n    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],\n    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in\n     \"\" | \" \"*) ;;\n     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=\" $_LT_TAGVAR(lt_prog_compiler_pic, $1)\" ;;\n     esac],\n    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=\n     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])\nfi\n_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],\n\t[Additional compiler flags for building library objects])\n\n_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],\n\t[How to pass a linker flag through the compiler])\n#\n# Check to make sure the static flag actually works.\n#\nwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\\\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\\\"\n_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],\n  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),\n  $lt_tmp_static_flag,\n  [],\n  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])\n_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],\n\t[Compiler flag to prevent dynamic linking])\n])# _LT_COMPILER_PIC\n\n\n# _LT_LINKER_SHLIBS([TAGNAME])\n# ----------------------------\n# See if the linker supports building shared libraries.\nm4_defun([_LT_LINKER_SHLIBS],\n[AC_REQUIRE([LT_PATH_LD])dnl\nAC_REQUIRE([LT_PATH_NM])dnl\nm4_require([_LT_PATH_MANIFEST_TOOL])dnl\nm4_require([_LT_FILEUTILS_DEFAULTS])dnl\nm4_require([_LT_DECL_EGREP])dnl\nm4_require([_LT_DECL_SED])dnl\nm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl\nm4_require([_LT_TAG_COMPILER])dnl\nAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])\nm4_if([$1], [CXX], [\n  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']\n  case $host_os in\n  aix[[4-9]]*)\n    # If we're using GNU nm, then we don't want the \"-C\" option.\n    # -C means demangle to GNU nm, but means don't demangle to AIX nm.\n    # Without the \"-l\" option, or with the \"-B\" option, AIX nm treats\n    # weak defined symbols like other global defined symbols, whereas\n    # GNU nm marks them as \"W\".\n    # While the 'weak' keyword is ignored in the Export File, we need\n    # it in the Import File for the 'aix-soname' feature, so we have\n    # to replace the \"-B\" option with \"-P\" for AIX nm.\n    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then\n      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\\''{ if (((\\$ 2 == \"T\") || (\\$ 2 == \"D\") || (\\$ 2 == \"B\") || (\\$ 2 == \"W\")) && ([substr](\\$ 3,1,1) != \".\")) { if (\\$ 2 == \"W\") { print \\$ 3 \" weak\" } else { print \\$ 3 } } }'\\'' | sort -u > $export_symbols'\n    else\n      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\\''s/B\\([[^B]]*\\)$/P\\1/'\\''` -PCpgl $libobjs $convenience | awk '\\''{ if (((\\$ 2 == \"T\") || (\\$ 2 == \"D\") || (\\$ 2 == \"B\") || (\\$ 2 == \"W\") || (\\$ 2 == \"V\") || (\\$ 2 == \"Z\")) && ([substr](\\$ 1,1,1) != \".\")) { if ((\\$ 2 == \"W\") || (\\$ 2 == \"V\") || (\\$ 2 == \"Z\")) { print \\$ 1 \" weak\" } else { print \\$ 1 } } }'\\'' | sort -u > $export_symbols'\n    fi\n    ;;\n  pw32*)\n    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds\n    ;;\n  cygwin* | mingw* | cegcc*)\n    case $cc_basename in\n    cl*)\n      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'\n      ;;\n    *)\n      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\\([[^ ]]*\\)/\\1 DATA/;s/^.*[[ ]]__nm__\\([[^ ]]*\\)[[ ]][[^ ]]*/\\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\\'' | sort | uniq > $export_symbols'\n      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']\n      ;;\n    esac\n    ;;\n  *)\n    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n    ;;\n  esac\n], [\n  runpath_var=\n  _LT_TAGVAR(allow_undefined_flag, $1)=\n  _LT_TAGVAR(always_export_symbols, $1)=no\n  _LT_TAGVAR(archive_cmds, $1)=\n  _LT_TAGVAR(archive_expsym_cmds, $1)=\n  _LT_TAGVAR(compiler_needs_object, $1)=no\n  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no\n  _LT_TAGVAR(export_dynamic_flag_spec, $1)=\n  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n  _LT_TAGVAR(hardcode_automatic, $1)=no\n  _LT_TAGVAR(hardcode_direct, $1)=no\n  _LT_TAGVAR(hardcode_direct_absolute, $1)=no\n  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=\n  _LT_TAGVAR(hardcode_libdir_separator, $1)=\n  _LT_TAGVAR(hardcode_minus_L, $1)=no\n  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported\n  _LT_TAGVAR(inherit_rpath, $1)=no\n  _LT_TAGVAR(link_all_deplibs, $1)=unknown\n  _LT_TAGVAR(module_cmds, $1)=\n  _LT_TAGVAR(module_expsym_cmds, $1)=\n  _LT_TAGVAR(old_archive_from_new_cmds, $1)=\n  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=\n  _LT_TAGVAR(thread_safe_flag_spec, $1)=\n  _LT_TAGVAR(whole_archive_flag_spec, $1)=\n  # include_expsyms should be a list of space-separated symbols to be *always*\n  # included in the symbol list\n  _LT_TAGVAR(include_expsyms, $1)=\n  # exclude_expsyms can be an extended regexp of symbols to exclude\n  # it will be wrapped by ' (' and ')$', so one must not match beginning or\n  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',\n  # as well as any symbol that contains 'd'.\n  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']\n  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out\n  # platforms (ab)use it in PIC code, but their linkers get confused if\n  # the symbol is explicitly referenced.  Since portable code cannot\n  # rely on this symbol name, it's probably fine to never include it in\n  # preloaded symbol tables.\n  # Exclude shared library initialization/finalization symbols.\ndnl Note also adjust exclude_expsyms for C++ above.\n  extract_expsyms_cmds=\n\n  case $host_os in\n  cygwin* | mingw* | pw32* | cegcc*)\n    # FIXME: the MSVC++ port hasn't been tested in a loooong time\n    # When not using gcc, we currently assume that we are using\n    # Microsoft Visual C++.\n    if test yes != \"$GCC\"; then\n      with_gnu_ld=no\n    fi\n    ;;\n  interix*)\n    # we just hope/assume this is gcc and not c89 (= MSVC++)\n    with_gnu_ld=yes\n    ;;\n  openbsd* | bitrig*)\n    with_gnu_ld=no\n    ;;\n  esac\n\n  _LT_TAGVAR(ld_shlibs, $1)=yes\n\n  # On some targets, GNU ld is compatible enough with the native linker\n  # that we're better off using the native interface for both.\n  lt_use_gnu_ld_interface=no\n  if test yes = \"$with_gnu_ld\"; then\n    case $host_os in\n      aix*)\n\t# The AIX port of GNU ld has always aspired to compatibility\n\t# with the native linker.  However, as the warning in the GNU ld\n\t# block says, versions before 2.19.5* couldn't really create working\n\t# shared libraries, regardless of the interface used.\n\tcase `$LD -v 2>&1` in\n\t  *\\ \\(GNU\\ Binutils\\)\\ 2.19.5*) ;;\n\t  *\\ \\(GNU\\ Binutils\\)\\ 2.[[2-9]]*) ;;\n\t  *\\ \\(GNU\\ Binutils\\)\\ [[3-9]]*) ;;\n\t  *)\n\t    lt_use_gnu_ld_interface=yes\n\t    ;;\n\tesac\n\t;;\n      *)\n\tlt_use_gnu_ld_interface=yes\n\t;;\n    esac\n  fi\n\n  if test yes = \"$lt_use_gnu_ld_interface\"; then\n    # If archive_cmds runs LD, not CC, wlarc should be empty\n    wlarc='$wl'\n\n    # Set some defaults for GNU ld with shared library support. These\n    # are reset later if shared libraries are not supported. Putting them\n    # here allows them to be overridden if necessary.\n    runpath_var=LD_RUN_PATH\n    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'\n    # ancient GNU ld didn't support --whole-archive et. al.\n    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then\n      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'\n    else\n      _LT_TAGVAR(whole_archive_flag_spec, $1)=\n    fi\n    supports_anon_versioning=no\n    case `$LD -v | $SED -e 's/([^)]\\+)\\s\\+//' 2>&1` in\n      *GNU\\ gold*) supports_anon_versioning=yes ;;\n      *\\ [[01]].* | *\\ 2.[[0-9]].* | *\\ 2.10.*) ;; # catch versions < 2.11\n      *\\ 2.11.93.0.2\\ *) supports_anon_versioning=yes ;; # RH7.3 ...\n      *\\ 2.11.92.0.12\\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...\n      *\\ 2.11.*) ;; # other 2.11 versions\n      *) supports_anon_versioning=yes ;;\n    esac\n\n    # See if GNU ld supports shared libraries.\n    case $host_os in\n    aix[[3-9]]*)\n      # On AIX/PPC, the GNU linker is very broken\n      if test ia64 != \"$host_cpu\"; then\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n\tcat <<_LT_EOF 1>&2\n\n*** Warning: the GNU linker, at least up to release 2.19, is reported\n*** to be unable to reliably create shared libraries on AIX.\n*** Therefore, libtool is disabling shared libraries support.  If you\n*** really care for shared libraries, you may want to install binutils\n*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.\n*** You will then need to restart the configuration process.\n\n_LT_EOF\n      fi\n      ;;\n\n    amigaos*)\n      case $host_cpu in\n      powerpc)\n            # see comment about AmigaOS4 .so support\n            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n            _LT_TAGVAR(archive_expsym_cmds, $1)=''\n        ;;\n      m68k)\n            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO \"#define NAME $libname\" > $output_objdir/a2ixlibrary.data~$ECHO \"#define LIBRARY_ID 1\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define VERSION $major\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define REVISION $revision\" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'\n            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n            _LT_TAGVAR(hardcode_minus_L, $1)=yes\n        ;;\n      esac\n      ;;\n\n    beos*)\n      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\t_LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n\t# Joseph Beckenbach <jrb3@best.com> says some releases of gcc\n\t# support --undefined.  This deserves some investigation.  FIXME\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n      else\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n\n    cygwin* | mingw* | pw32* | cegcc*)\n      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,\n      # as there is no search path for DLLs.\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'\n      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n      _LT_TAGVAR(always_export_symbols, $1)=no\n      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\\([[^ ]]*\\)/\\1 DATA/;s/^.*[[ ]]__nm__\\([[^ ]]*\\)[[ ]][[^ ]]*/\\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\\'' | sort | uniq > $export_symbols'\n      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']\n\n      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then\n        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'\n\t# If the export-symbols file already is a .def file, use it as\n\t# is; otherwise, prepend EXPORTS...\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then\n          cp $export_symbols $output_objdir/$soname.def;\n        else\n          echo EXPORTS > $output_objdir/$soname.def;\n          cat $export_symbols >> $output_objdir/$soname.def;\n        fi~\n        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'\n      else\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n\n    haiku*)\n      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n      _LT_TAGVAR(link_all_deplibs, $1)=yes\n      ;;\n\n    os2*)\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_TAGVAR(hardcode_minus_L, $1)=yes\n      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n      shrext_cmds=.dll\n      _LT_TAGVAR(archive_cmds, $1)='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\temxexp $libobjs | $SED /\"_DLL_InitTerm\"/d >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\tprefix_cmds=\"$SED\"~\n\tif test EXPORTS = \"`$SED 1q $export_symbols`\"; then\n\t  prefix_cmds=\"$prefix_cmds -e 1d\";\n\tfi~\n\tprefix_cmds=\"$prefix_cmds -e \\\"s/^\\(.*\\)$/_\\1/g\\\"\"~\n\tcat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'\n      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n      ;;\n\n    interix[[3-9]]*)\n      _LT_TAGVAR(hardcode_direct, $1)=no\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.\n      # Instead, shared libraries are loaded at an image base (0x10000000 by\n      # default) and relocated if they conflict, which is a slow very memory\n      # consuming and fragmenting process.  To avoid this, we pick a random,\n      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link\n      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.\n      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \\* 262144 + 1342177280` -o $lib'\n      _LT_TAGVAR(archive_expsym_cmds, $1)='sed \"s|^|_|\" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \\* 262144 + 1342177280` -o $lib'\n      ;;\n\n    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)\n      tmp_diet=no\n      if test linux-dietlibc = \"$host_os\"; then\n\tcase $cc_basename in\n\t  diet\\ *) tmp_diet=yes;;\t# linux-dietlibc with static linking (!diet-dyn)\n\tesac\n      fi\n      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \\\n\t && test no = \"$tmp_diet\"\n      then\n\ttmp_addflag=' $pic_flag'\n\ttmp_sharedflag='-shared'\n\tcase $cc_basename,$host_cpu in\n        pgcc*)\t\t\t\t# Portland Group C compiler\n\t  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\\\"\\\"; do test  -n \\\"$conv\\\" && new_convenience=\\\"$new_convenience,$conv\\\"; done; func_echo_all \\\"$new_convenience\\\"` $wl--no-whole-archive'\n\t  tmp_addflag=' $pic_flag'\n\t  ;;\n\tpgf77* | pgf90* | pgf95* | pgfortran*)\n\t\t\t\t\t# Portland Group f77 and f90 compilers\n\t  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\\\"\\\"; do test  -n \\\"$conv\\\" && new_convenience=\\\"$new_convenience,$conv\\\"; done; func_echo_all \\\"$new_convenience\\\"` $wl--no-whole-archive'\n\t  tmp_addflag=' $pic_flag -Mnomain' ;;\n\tecc*,ia64* | icc*,ia64*)\t# Intel C compiler on ia64\n\t  tmp_addflag=' -i_dynamic' ;;\n\tefc*,ia64* | ifort*,ia64*)\t# Intel Fortran compiler on ia64\n\t  tmp_addflag=' -i_dynamic -nofor_main' ;;\n\tifc* | ifort*)\t\t\t# Intel Fortran compiler\n\t  tmp_addflag=' -nofor_main' ;;\n\tlf95*)\t\t\t\t# Lahey Fortran 8.1\n\t  _LT_TAGVAR(whole_archive_flag_spec, $1)=\n\t  tmp_sharedflag='--shared' ;;\n        nagfor*)                        # NAGFOR 5.3\n          tmp_sharedflag='-Wl,-shared' ;;\n\txl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)\n\t  tmp_sharedflag='-qmkshrobj'\n\t  tmp_addflag= ;;\n\tnvcc*)\t# Cuda Compiler Driver 2.2\n\t  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\\\"\\\"; do test  -n \\\"$conv\\\" && new_convenience=\\\"$new_convenience,$conv\\\"; done; func_echo_all \\\"$new_convenience\\\"` $wl--no-whole-archive'\n\t  _LT_TAGVAR(compiler_needs_object, $1)=yes\n\t  ;;\n\tesac\n\tcase `$CC -V 2>&1 | sed 5q` in\n\t*Sun\\ C*)\t\t\t# Sun C 5.9\n\t  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\\\"\\\"; do test -z \\\"$conv\\\" || new_convenience=\\\"$new_convenience,$conv\\\"; done; func_echo_all \\\"$new_convenience\\\"` $wl--no-whole-archive'\n\t  _LT_TAGVAR(compiler_needs_object, $1)=yes\n\t  tmp_sharedflag='-G' ;;\n\t*Sun\\ F*)\t\t\t# Sun Fortran 8.3\n\t  tmp_sharedflag='-G' ;;\n\tesac\n\t_LT_TAGVAR(archive_cmds, $1)='$CC '\"$tmp_sharedflag\"\"$tmp_addflag\"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\n        if test yes = \"$supports_anon_versioning\"; then\n          _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $output_objdir/$libname.ver~\n            cat $export_symbols | sed -e \"s/\\(.*\\)/\\1;/\" >> $output_objdir/$libname.ver~\n            echo \"local: *; };\" >> $output_objdir/$libname.ver~\n            $CC '\"$tmp_sharedflag\"\"$tmp_addflag\"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'\n        fi\n\n\tcase $cc_basename in\n\ttcc*)\n\t  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'\n\t  ;;\n\txlf* | bgf* | bgxlf* | mpixlf*)\n\t  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself\n\t  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n\t  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'\n\t  if test yes = \"$supports_anon_versioning\"; then\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $output_objdir/$libname.ver~\n              cat $export_symbols | sed -e \"s/\\(.*\\)/\\1;/\" >> $output_objdir/$libname.ver~\n              echo \"local: *; };\" >> $output_objdir/$libname.ver~\n              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'\n\t  fi\n\t  ;;\n\tesac\n      else\n        _LT_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n\n    netbsd*)\n      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then\n\t_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'\n\twlarc=\n      else\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n      fi\n      ;;\n\n    solaris*)\n      if $LD -v 2>&1 | $GREP 'BFD 2\\.8' > /dev/null; then\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n\tcat <<_LT_EOF 1>&2\n\n*** Warning: The releases 2.8.* of the GNU linker cannot reliably\n*** create shared libraries on Solaris systems.  Therefore, libtool\n*** is disabling shared libraries support.  We urge you to upgrade GNU\n*** binutils to release 2.9.1 or newer.  Another option is to modify\n*** your PATH or compiler configuration so that the native linker is\n*** used, and then restart.\n\n_LT_EOF\n      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n      else\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n\n    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)\n      case `$LD -v 2>&1` in\n        *\\ [[01]].* | *\\ 2.[[0-9]].* | *\\ 2.1[[0-5]].*)\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n\tcat <<_LT_EOF 1>&2\n\n*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot\n*** reliably create shared libraries on SCO systems.  Therefore, libtool\n*** is disabling shared libraries support.  We urge you to upgrade GNU\n*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify\n*** your PATH or compiler configuration so that the native linker is\n*** used, and then restart.\n\n_LT_EOF\n\t;;\n\t*)\n\t  # For security reasons, it is highly recommended that you always\n\t  # use absolute paths for naming shared libraries, and exclude the\n\t  # DT_RUNPATH tag from executables and libraries.  But doing so\n\t  # requires that you compile everything twice, which is a pain.\n\t  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n\t  else\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t  fi\n\t;;\n      esac\n      ;;\n\n    sunos4*)\n      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      wlarc=\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    *)\n      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n      else\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n    esac\n\n    if test no = \"$_LT_TAGVAR(ld_shlibs, $1)\"; then\n      runpath_var=\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)=\n      _LT_TAGVAR(whole_archive_flag_spec, $1)=\n    fi\n  else\n    # PORTME fill in a description of your system's linker (not GNU ld)\n    case $host_os in\n    aix3*)\n      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n      _LT_TAGVAR(always_export_symbols, $1)=yes\n      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'\n      # Note: this linker hardcodes the directories in LIBPATH if there\n      # are no directories specified by -L.\n      _LT_TAGVAR(hardcode_minus_L, $1)=yes\n      if test yes = \"$GCC\" && test -z \"$lt_prog_compiler_static\"; then\n\t# Neither direct hardcoding nor static linking is supported with a\n\t# broken collect2.\n\t_LT_TAGVAR(hardcode_direct, $1)=unsupported\n      fi\n      ;;\n\n    aix[[4-9]]*)\n      if test ia64 = \"$host_cpu\"; then\n\t# On IA64, the linker does run time linking by default, so we don't\n\t# have to do anything special.\n\taix_use_runtimelinking=no\n\texp_sym_flag='-Bexport'\n\tno_entry_flag=\n      else\n\t# If we're using GNU nm, then we don't want the \"-C\" option.\n\t# -C means demangle to GNU nm, but means don't demangle to AIX nm.\n\t# Without the \"-l\" option, or with the \"-B\" option, AIX nm treats\n\t# weak defined symbols like other global defined symbols, whereas\n\t# GNU nm marks them as \"W\".\n\t# While the 'weak' keyword is ignored in the Export File, we need\n\t# it in the Import File for the 'aix-soname' feature, so we have\n\t# to replace the \"-B\" option with \"-P\" for AIX nm.\n\tif $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then\n\t  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\\''{ if (((\\$ 2 == \"T\") || (\\$ 2 == \"D\") || (\\$ 2 == \"B\") || (\\$ 2 == \"W\")) && ([substr](\\$ 3,1,1) != \".\")) { if (\\$ 2 == \"W\") { print \\$ 3 \" weak\" } else { print \\$ 3 } } }'\\'' | sort -u > $export_symbols'\n\telse\n\t  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\\''s/B\\([[^B]]*\\)$/P\\1/'\\''` -PCpgl $libobjs $convenience | awk '\\''{ if (((\\$ 2 == \"T\") || (\\$ 2 == \"D\") || (\\$ 2 == \"B\") || (\\$ 2 == \"W\") || (\\$ 2 == \"V\") || (\\$ 2 == \"Z\")) && ([substr](\\$ 1,1,1) != \".\")) { if ((\\$ 2 == \"W\") || (\\$ 2 == \"V\") || (\\$ 2 == \"Z\")) { print \\$ 1 \" weak\" } else { print \\$ 1 } } }'\\'' | sort -u > $export_symbols'\n\tfi\n\taix_use_runtimelinking=no\n\n\t# Test if we are trying to use run time linking or normal\n\t# AIX style linking. If -brtl is somewhere in LDFLAGS, we\n\t# have runtime linking enabled, and use it for executables.\n\t# For shared libraries, we enable/disable runtime linking\n\t# depending on the kind of the shared library created -\n\t# when \"with_aix_soname,aix_use_runtimelinking\" is:\n\t# \"aix,no\"   lib.a(lib.so.V) shared, rtl:no,  for executables\n\t# \"aix,yes\"  lib.so          shared, rtl:yes, for executables\n\t#            lib.a           static archive\n\t# \"both,no\"  lib.so.V(shr.o) shared, rtl:yes\n\t#            lib.a(lib.so.V) shared, rtl:no,  for executables\n\t# \"both,yes\" lib.so.V(shr.o) shared, rtl:yes, for executables\n\t#            lib.a(lib.so.V) shared, rtl:no\n\t# \"svr4,*\"   lib.so.V(shr.o) shared, rtl:yes, for executables\n\t#            lib.a           static archive\n\tcase $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)\n\t  for ld_flag in $LDFLAGS; do\n\t  if (test x-brtl = \"x$ld_flag\" || test x-Wl,-brtl = \"x$ld_flag\"); then\n\t    aix_use_runtimelinking=yes\n\t    break\n\t  fi\n\t  done\n\t  if test svr4,no = \"$with_aix_soname,$aix_use_runtimelinking\"; then\n\t    # With aix-soname=svr4, we create the lib.so.V shared archives only,\n\t    # so we don't have lib.a shared libs to link our executables.\n\t    # We have to force runtime linking in this case.\n\t    aix_use_runtimelinking=yes\n\t    LDFLAGS=\"$LDFLAGS -Wl,-brtl\"\n\t  fi\n\t  ;;\n\tesac\n\n\texp_sym_flag='-bexport'\n\tno_entry_flag='-bnoentry'\n      fi\n\n      # When large executables or shared objects are built, AIX ld can\n      # have problems creating the table of contents.  If linking a library\n      # or program results in \"error TOC overflow\" add -mminimal-toc to\n      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not\n      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.\n\n      _LT_TAGVAR(archive_cmds, $1)=''\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes\n      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'\n      _LT_TAGVAR(link_all_deplibs, $1)=yes\n      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'\n      case $with_aix_soname,$aix_use_runtimelinking in\n      aix,*) ;; # traditional, no import file\n      svr4,* | *,yes) # use import file\n\t# The Import File defines what to hardcode.\n\t_LT_TAGVAR(hardcode_direct, $1)=no\n\t_LT_TAGVAR(hardcode_direct_absolute, $1)=no\n\t;;\n      esac\n\n      if test yes = \"$GCC\"; then\n\tcase $host_os in aix4.[[012]]|aix4.[[012]].*)\n\t# We only want to do this on AIX 4.2 and lower, the check\n\t# below for broken collect2 doesn't work under 4.3+\n\t  collect2name=`$CC -print-prog-name=collect2`\n\t  if test -f \"$collect2name\" &&\n\t   strings \"$collect2name\" | $GREP resolve_lib_name >/dev/null\n\t  then\n\t  # We have reworked collect2\n\t  :\n\t  else\n\t  # We have old collect2\n\t  _LT_TAGVAR(hardcode_direct, $1)=unsupported\n\t  # It fails to find uninstalled libraries when the uninstalled\n\t  # path is not listed in the libpath.  Setting hardcode_minus_L\n\t  # to unsupported forces relinking\n\t  _LT_TAGVAR(hardcode_minus_L, $1)=yes\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n\t  _LT_TAGVAR(hardcode_libdir_separator, $1)=\n\t  fi\n\t  ;;\n\tesac\n\tshared_flag='-shared'\n\tif test yes = \"$aix_use_runtimelinking\"; then\n\t  shared_flag=\"$shared_flag \"'$wl-G'\n\tfi\n\t# Need to ensure runtime linking is disabled for the traditional\n\t# shared library, or the linker may eventually find shared libraries\n\t# /with/ Import File - we do not want to mix them.\n\tshared_flag_aix='-shared'\n\tshared_flag_svr4='-shared $wl-G'\n      else\n\t# not using gcc\n\tif test ia64 = \"$host_cpu\"; then\n\t# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release\n\t# chokes on -Wl,-G. The following line is correct:\n\t  shared_flag='-G'\n\telse\n\t  if test yes = \"$aix_use_runtimelinking\"; then\n\t    shared_flag='$wl-G'\n\t  else\n\t    shared_flag='$wl-bM:SRE'\n\t  fi\n\t  shared_flag_aix='$wl-bM:SRE'\n\t  shared_flag_svr4='$wl-G'\n\tfi\n      fi\n\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'\n      # It seems that -bexpall does not export symbols beginning with\n      # underscore (_), so it is better to generate a list of symbols to export.\n      _LT_TAGVAR(always_export_symbols, $1)=yes\n      if test aix,yes = \"$with_aix_soname,$aix_use_runtimelinking\"; then\n\t# Warning - without using the other runtime loading flags (-brtl),\n\t# -berok will link without error, but may produce a broken library.\n\t_LT_TAGVAR(allow_undefined_flag, $1)='-berok'\n        # Determine the default libpath from the value encoded in an\n        # empty executable.\n        _LT_SYS_MODULE_PATH_AIX([$1])\n        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'\"$aix_libpath\"\n        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n \"$allow_undefined_flag\"; then func_echo_all \"$wl$allow_undefined_flag\"; else :; fi` $wl'$exp_sym_flag:\\$export_symbols' '$shared_flag\n      else\n\tif test ia64 = \"$host_cpu\"; then\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'\n\t  _LT_TAGVAR(allow_undefined_flag, $1)=\"-z nodefs\"\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)=\"\\$CC $shared_flag\"' -o $output_objdir/$soname $libobjs $deplibs '\"\\$wl$no_entry_flag\"' $compiler_flags $wl$allow_undefined_flag '\"\\$wl$exp_sym_flag:\\$export_symbols\"\n\telse\n\t # Determine the default libpath from the value encoded in an\n\t # empty executable.\n\t _LT_SYS_MODULE_PATH_AIX([$1])\n\t _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'\"$aix_libpath\"\n\t  # Warning - without using the other run time loading flags,\n\t  # -berok will link without error, but may produce a broken library.\n\t  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'\n\t  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'\n\t  if test yes = \"$with_gnu_ld\"; then\n\t    # We only use this code for GNU lds that support --whole-archive.\n\t    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'\n\t  else\n\t    # Exported symbols can be pulled into shared objects from archives\n\t    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'\n\t  fi\n\t  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'\n\t  # -brtl affects multiple linker settings, -berok does not and is overridden later\n\t  compiler_flags_filtered='`func_echo_all \"$compiler_flags \" | $SED -e \"s%-brtl\\\\([[, ]]\\\\)%-berok\\\\1%g\"`'\n\t  if test svr4 != \"$with_aix_soname\"; then\n\t    # This is similar to how AIX traditionally builds its shared libraries.\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)=\"$_LT_TAGVAR(archive_expsym_cmds, $1)\"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'\n\t  fi\n\t  if test aix != \"$with_aix_soname\"; then\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)=\"$_LT_TAGVAR(archive_expsym_cmds, $1)\"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all \"#! $soname($shared_archive_member_spec.o)\"; if test shr_64 = \"$shared_archive_member_spec\"; then func_echo_all \"# 64\"; else func_echo_all \"# 32\"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'\n\t  else\n\t    # used by -dlpreopen to get the symbols\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)=\"$_LT_TAGVAR(archive_expsym_cmds, $1)\"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'\n\t  fi\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)=\"$_LT_TAGVAR(archive_expsym_cmds, $1)\"'~$RM -r $output_objdir/$realname.d'\n\tfi\n      fi\n      ;;\n\n    amigaos*)\n      case $host_cpu in\n      powerpc)\n            # see comment about AmigaOS4 .so support\n            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n            _LT_TAGVAR(archive_expsym_cmds, $1)=''\n        ;;\n      m68k)\n            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO \"#define NAME $libname\" > $output_objdir/a2ixlibrary.data~$ECHO \"#define LIBRARY_ID 1\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define VERSION $major\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define REVISION $revision\" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'\n            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n            _LT_TAGVAR(hardcode_minus_L, $1)=yes\n        ;;\n      esac\n      ;;\n\n    bsdi[[45]]*)\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic\n      ;;\n\n    cygwin* | mingw* | pw32* | cegcc*)\n      # When not using gcc, we currently assume that we are using\n      # Microsoft Visual C++.\n      # hardcode_libdir_flag_spec is actually meaningless, as there is\n      # no search path for DLLs.\n      case $cc_basename in\n      cl*)\n\t# Native MSVC\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '\n\t_LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n\t_LT_TAGVAR(always_export_symbols, $1)=yes\n\t_LT_TAGVAR(file_list_spec, $1)='@'\n\t# Tell ltmain to make .lib files, not .a files.\n\tlibext=lib\n\t# Tell ltmain to make .dll files, not .so files.\n\tshrext_cmds=.dll\n\t# FIXME: Setting linknames here is a bad hack.\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:\"$tool_output_objdir$libname.dll.lib\"~linknames='\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then\n            cp \"$export_symbols\" \"$output_objdir/$soname.def\";\n            echo \"$tool_output_objdir$soname.def\" > \"$output_objdir/$soname.exp\";\n          else\n            $SED -e '\\''s/^/-link -EXPORT:/'\\'' < $export_symbols > $output_objdir/$soname.exp;\n          fi~\n          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs \"@$tool_output_objdir$soname.exp\" -Wl,-DLL,-IMPLIB:\"$tool_output_objdir$libname.dll.lib\"~\n          linknames='\n\t# The linker will not automatically build a static lib if we build a DLL.\n\t# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'\n\t_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n\t_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'\n\t_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\\([[^ ]]*\\)/\\1,DATA/'\\'' | $SED -e '\\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\\'' | sort | uniq > $export_symbols'\n\t# Don't use ranlib\n\t_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'\n\t_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile=\"@OUTPUT@\"~\n          lt_tool_outputfile=\"@TOOL_OUTPUT@\"~\n          case $lt_outputfile in\n            *.exe|*.EXE) ;;\n            *)\n              lt_outputfile=$lt_outputfile.exe\n              lt_tool_outputfile=$lt_tool_outputfile.exe\n              ;;\n          esac~\n          if test : != \"$MANIFEST_TOOL\" && test -f \"$lt_outputfile.manifest\"; then\n            $MANIFEST_TOOL -manifest \"$lt_tool_outputfile.manifest\" -outputresource:\"$lt_tool_outputfile\" || exit 1;\n            $RM \"$lt_outputfile.manifest\";\n          fi'\n\t;;\n      *)\n\t# Assume MSVC wrapper\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '\n\t_LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n\t# Tell ltmain to make .lib files, not .a files.\n\tlibext=lib\n\t# Tell ltmain to make .dll files, not .so files.\n\tshrext_cmds=.dll\n\t# FIXME: Setting linknames here is a bad hack.\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all \"$deplibs\" | $SED '\\''s/ -lc$//'\\''` -link -dll~linknames='\n\t# The linker will automatically build a .lib file if we build a DLL.\n\t_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'\n\t# FIXME: Should let the user specify the lib program.\n\t_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'\n\t_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n\t;;\n      esac\n      ;;\n\n    darwin* | rhapsody*)\n      _LT_DARWIN_LINKER_FEATURES($1)\n      ;;\n\n    dgux*)\n      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor\n    # support.  Future versions do this automatically, but an explicit c++rt0.o\n    # does not break anything, and helps significantly (at the cost of a little\n    # extra space).\n    freebsd2.2*)\n      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    # Unfortunately, older versions of FreeBSD 2 do not have this feature.\n    freebsd2.*)\n      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_minus_L, $1)=yes\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.\n    freebsd* | dragonfly*)\n      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    hpux9*)\n      if test yes = \"$GCC\"; then\n\t_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test \"x$output_objdir/$soname\" = \"x$lib\" || mv $output_objdir/$soname $lib'\n      else\n\t_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test \"x$output_objdir/$soname\" = \"x$lib\" || mv $output_objdir/$soname $lib'\n      fi\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'\n      _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n\n      # hardcode_minus_L: Not really in the search PATH,\n      # but as the default location of the library.\n      _LT_TAGVAR(hardcode_minus_L, $1)=yes\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n      ;;\n\n    hpux10*)\n      if test yes,no = \"$GCC,$with_gnu_ld\"; then\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\t_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'\n      fi\n      if test no = \"$with_gnu_ld\"; then\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'\n\t_LT_TAGVAR(hardcode_libdir_separator, $1)=:\n\t_LT_TAGVAR(hardcode_direct, $1)=yes\n\t_LT_TAGVAR(hardcode_direct_absolute, $1)=yes\n\t_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n\t# hardcode_minus_L: Not really in the search PATH,\n\t# but as the default location of the library.\n\t_LT_TAGVAR(hardcode_minus_L, $1)=yes\n      fi\n      ;;\n\n    hpux11*)\n      if test yes,no = \"$GCC,$with_gnu_ld\"; then\n\tcase $host_cpu in\n\thppa*64*)\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tia64*)\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\t*)\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tesac\n      else\n\tcase $host_cpu in\n\thppa*64*)\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tia64*)\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\t*)\n\tm4_if($1, [], [\n\t  # Older versions of the 11.00 compiler do not understand -b yet\n\t  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)\n\t  _LT_LINKER_OPTION([if $CC understands -b],\n\t    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],\n\t    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],\n\t    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],\n\t  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])\n\t  ;;\n\tesac\n      fi\n      if test no = \"$with_gnu_ld\"; then\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'\n\t_LT_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\tcase $host_cpu in\n\thppa*64*|ia64*)\n\t  _LT_TAGVAR(hardcode_direct, $1)=no\n\t  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\t  ;;\n\t*)\n\t  _LT_TAGVAR(hardcode_direct, $1)=yes\n\t  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes\n\t  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n\n\t  # hardcode_minus_L: Not really in the search PATH,\n\t  # but as the default location of the library.\n\t  _LT_TAGVAR(hardcode_minus_L, $1)=yes\n\t  ;;\n\tesac\n      fi\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      if test yes = \"$GCC\"; then\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n \"$verstring\" && func_echo_all \"$wl-set_version $wl$verstring\"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'\n\t# Try to use the -exported_symbol ld option, if it does not\n\t# work, assume that -exports_file does not work either and\n\t# implicitly export all symbols.\n\t# This should be the same for all languages, so no per-tag cache variable.\n\tAC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],\n\t  [lt_cv_irix_exported_symbol],\n\t  [save_LDFLAGS=$LDFLAGS\n\t   LDFLAGS=\"$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null\"\n\t   AC_LINK_IFELSE(\n\t     [AC_LANG_SOURCE(\n\t        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],\n\t\t\t      [C++], [[int foo (void) { return 0; }]],\n\t\t\t      [Fortran 77], [[\n      subroutine foo\n      end]],\n\t\t\t      [Fortran], [[\n      subroutine foo\n      end]])])],\n\t      [lt_cv_irix_exported_symbol=yes],\n\t      [lt_cv_irix_exported_symbol=no])\n           LDFLAGS=$save_LDFLAGS])\n\tif test yes = \"$lt_cv_irix_exported_symbol\"; then\n          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n \"$verstring\" && func_echo_all \"$wl-set_version $wl$verstring\"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'\n\tfi\n      else\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n \"$verstring\" && func_echo_all \"-set_version $verstring\"` -update_registry $output_objdir/so_locations -o $lib'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n \"$verstring\" && func_echo_all \"-set_version $verstring\"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'\n      fi\n      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n      _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n      _LT_TAGVAR(inherit_rpath, $1)=yes\n      _LT_TAGVAR(link_all_deplibs, $1)=yes\n      ;;\n\n    linux*)\n      case $cc_basename in\n      tcc*)\n\t# Fabrice Bellard et al's Tiny C Compiler\n\t_LT_TAGVAR(ld_shlibs, $1)=yes\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t;;\n      esac\n      ;;\n\n    netbsd*)\n      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then\n\t_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out\n      else\n\t_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF\n      fi\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    newsos6)\n      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n      _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    *nto* | *qnx*)\n      ;;\n\n    openbsd* | bitrig*)\n      if test -f /usr/libexec/ld.so; then\n\t_LT_TAGVAR(hardcode_direct, $1)=yes\n\t_LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\t_LT_TAGVAR(hardcode_direct_absolute, $1)=yes\n\tif test -z \"`echo __ELF__ | $CC -E - | $GREP __ELF__`\"; then\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n\t  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n\telse\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n\tfi\n      else\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n\n    os2*)\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_TAGVAR(hardcode_minus_L, $1)=yes\n      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n      shrext_cmds=.dll\n      _LT_TAGVAR(archive_cmds, $1)='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\temxexp $libobjs | $SED /\"_DLL_InitTerm\"/d >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\tprefix_cmds=\"$SED\"~\n\tif test EXPORTS = \"`$SED 1q $export_symbols`\"; then\n\t  prefix_cmds=\"$prefix_cmds -e 1d\";\n\tfi~\n\tprefix_cmds=\"$prefix_cmds -e \\\"s/^\\(.*\\)$/_\\1/g\\\"\"~\n\tcat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'\n      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n      ;;\n\n    osf3*)\n      if test yes = \"$GCC\"; then\n\t_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\\*'\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n \"$verstring\" && func_echo_all \"$wl-set_version $wl$verstring\"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'\n      else\n\t_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \\*'\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n \"$verstring\" && func_echo_all \"-set_version $verstring\"` -update_registry $output_objdir/so_locations -o $lib'\n      fi\n      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n      _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n      ;;\n\n    osf4* | osf5*)\t# as osf3* with the addition of -msym flag\n      if test yes = \"$GCC\"; then\n\t_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\\*'\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n \"$verstring\" && func_echo_all \"$wl-set_version $wl$verstring\"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n      else\n\t_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \\*'\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n \"$verstring\" && func_echo_all \"-set_version $verstring\"` -update_registry $output_objdir/so_locations -o $lib'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf \"%s %s\\\\n\" -exported_symbol \"\\$i\" >> $lib.exp; done; printf \"%s\\\\n\" \"-hidden\">> $lib.exp~\n          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n \"$verstring\" && $ECHO \"-set_version $verstring\"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'\n\n\t# Both c and cxx compiler support -rpath directly\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'\n      fi\n      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'\n      _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n      ;;\n\n    solaris*)\n      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'\n      if test yes = \"$GCC\"; then\n\twlarc='$wl'\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'\n      else\n\tcase `$CC -V 2>&1` in\n\t*\"Compilers 5.0\"*)\n\t  wlarc=''\n\t  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'\n\t  ;;\n\t*)\n\t  wlarc='$wl'\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'\n\t  ;;\n\tesac\n      fi\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      case $host_os in\n      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;\n      *)\n\t# The compiler driver will combine and reorder linker options,\n\t# but understands '-z linker_flag'.  GCC discards it without '$wl',\n\t# but is careful enough not to reorder.\n\t# Supported since Solaris 2.6 (maybe 2.5.1?)\n\tif test yes = \"$GCC\"; then\n\t  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'\n\telse\n\t  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'\n\tfi\n\t;;\n      esac\n      _LT_TAGVAR(link_all_deplibs, $1)=yes\n      ;;\n\n    sunos4*)\n      if test sequent = \"$host_vendor\"; then\n\t# Use $CC to link under sequent, because it throws in some extra .o\n\t# files that make .init and .fini sections work.\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\t_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'\n      fi\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_TAGVAR(hardcode_direct, $1)=yes\n      _LT_TAGVAR(hardcode_minus_L, $1)=yes\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    sysv4)\n      case $host_vendor in\n\tsni)\n\t  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???\n\t;;\n\tsiemens)\n\t  ## LD is ld it makes a PLAMLIB\n\t  ## CC just makes a GrossModule.\n\t  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'\n\t  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'\n\t  _LT_TAGVAR(hardcode_direct, $1)=no\n        ;;\n\tmotorola)\n\t  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie\n\t;;\n      esac\n      runpath_var='LD_RUN_PATH'\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    sysv4.3*)\n      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\t_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t_LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\trunpath_var=LD_RUN_PATH\n\thardcode_runpath_var=yes\n\t_LT_TAGVAR(ld_shlibs, $1)=yes\n      fi\n      ;;\n\n    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)\n      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'\n      _LT_TAGVAR(archive_cmds_need_lc, $1)=no\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      runpath_var='LD_RUN_PATH'\n\n      if test yes = \"$GCC\"; then\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      fi\n      ;;\n\n    sysv5* | sco3.2v5* | sco5v6*)\n      # Note: We CANNOT use -z defs as we might desire, because we do not\n      # link with -lc, and that would cause any symbols used from libc to\n      # always be unresolved, which means just about no library would\n      # ever link correctly.  If we're not using GNU ld we use -z text\n      # though, which does catch some bad symbols but isn't as heavy-handed\n      # as -z defs.\n      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'\n      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'\n      _LT_TAGVAR(archive_cmds_need_lc, $1)=no\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'\n      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'\n      _LT_TAGVAR(link_all_deplibs, $1)=yes\n      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'\n      runpath_var='LD_RUN_PATH'\n\n      if test yes = \"$GCC\"; then\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      fi\n      ;;\n\n    uts4*)\n      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    *)\n      _LT_TAGVAR(ld_shlibs, $1)=no\n      ;;\n    esac\n\n    if test sni = \"$host_vendor\"; then\n      case $host in\n      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)\n\t_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'\n\t;;\n      esac\n    fi\n  fi\n])\nAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])\ntest no = \"$_LT_TAGVAR(ld_shlibs, $1)\" && can_build_shared=no\n\n_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld\n\n_LT_DECL([], [libext], [0], [Old archive suffix (normally \"a\")])dnl\n_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally \".so\")])dnl\n_LT_DECL([], [extract_expsyms_cmds], [2],\n    [The commands to extract the exported symbol list from a shared archive])\n\n#\n# Do we need to explicitly link libc?\n#\ncase \"x$_LT_TAGVAR(archive_cmds_need_lc, $1)\" in\nx|xyes)\n  # Assume -lc should be added\n  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes\n\n  if test yes,yes = \"$GCC,$enable_shared\"; then\n    case $_LT_TAGVAR(archive_cmds, $1) in\n    *'~'*)\n      # FIXME: we may have to deal with multi-command sequences.\n      ;;\n    '$CC '*)\n      # Test whether the compiler implicitly links with -lc since on some\n      # systems, -lgcc has to come before -lc. If gcc already passes -lc\n      # to ld, don't add -lc before -lgcc.\n      AC_CACHE_CHECK([whether -lc should be explicitly linked in],\n\t[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),\n\t[$RM conftest*\n\techo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n\tif AC_TRY_EVAL(ac_compile) 2>conftest.err; then\n\t  soname=conftest\n\t  lib=conftest\n\t  libobjs=conftest.$ac_objext\n\t  deplibs=\n\t  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)\n\t  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)\n\t  compiler_flags=-v\n\t  linker_flags=-v\n\t  verstring=\n\t  output_objdir=.\n\t  libname=conftest\n\t  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)\n\t  _LT_TAGVAR(allow_undefined_flag, $1)=\n\t  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\\>\\&1 \\| $GREP \\\" -lc \\\" \\>/dev/null 2\\>\\&1)\n\t  then\n\t    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no\n\t  else\n\t    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes\n\t  fi\n\t  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag\n\telse\n\t  cat conftest.err 1>&5\n\tfi\n\t$RM conftest*\n\t])\n      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)\n      ;;\n    esac\n  fi\n  ;;\nesac\n\n_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],\n    [Whether or not to add -lc for building shared libraries])\n_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],\n    [enable_shared_with_static_runtimes], [0],\n    [Whether or not to disallow shared libs when runtime libs are static])\n_LT_TAGDECL([], [export_dynamic_flag_spec], [1],\n    [Compiler flag to allow reflexive dlopens])\n_LT_TAGDECL([], [whole_archive_flag_spec], [1],\n    [Compiler flag to generate shared objects directly from archives])\n_LT_TAGDECL([], [compiler_needs_object], [1],\n    [Whether the compiler copes with passing no objects directly])\n_LT_TAGDECL([], [old_archive_from_new_cmds], [2],\n    [Create an old-style archive from a shared archive])\n_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],\n    [Create a temporary old-style archive to link instead of a shared archive])\n_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])\n_LT_TAGDECL([], [archive_expsym_cmds], [2])\n_LT_TAGDECL([], [module_cmds], [2],\n    [Commands used to build a loadable module if different from building\n    a shared archive.])\n_LT_TAGDECL([], [module_expsym_cmds], [2])\n_LT_TAGDECL([], [with_gnu_ld], [1],\n    [Whether we are building with GNU ld or not])\n_LT_TAGDECL([], [allow_undefined_flag], [1],\n    [Flag that allows shared libraries with undefined symbols to be built])\n_LT_TAGDECL([], [no_undefined_flag], [1],\n    [Flag that enforces no undefined symbols])\n_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],\n    [Flag to hardcode $libdir into a binary during linking.\n    This must work even if $libdir does not exist])\n_LT_TAGDECL([], [hardcode_libdir_separator], [1],\n    [Whether we need a single \"-rpath\" flag with a separated argument])\n_LT_TAGDECL([], [hardcode_direct], [0],\n    [Set to \"yes\" if using DIR/libNAME$shared_ext during linking hardcodes\n    DIR into the resulting binary])\n_LT_TAGDECL([], [hardcode_direct_absolute], [0],\n    [Set to \"yes\" if using DIR/libNAME$shared_ext during linking hardcodes\n    DIR into the resulting binary and the resulting library dependency is\n    \"absolute\", i.e impossible to change by setting $shlibpath_var if the\n    library is relocated])\n_LT_TAGDECL([], [hardcode_minus_L], [0],\n    [Set to \"yes\" if using the -LDIR flag during linking hardcodes DIR\n    into the resulting binary])\n_LT_TAGDECL([], [hardcode_shlibpath_var], [0],\n    [Set to \"yes\" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR\n    into the resulting binary])\n_LT_TAGDECL([], [hardcode_automatic], [0],\n    [Set to \"yes\" if building a shared library automatically hardcodes DIR\n    into the library and all subsequent libraries and executables linked\n    against it])\n_LT_TAGDECL([], [inherit_rpath], [0],\n    [Set to yes if linker adds runtime paths of dependent libraries\n    to runtime path list])\n_LT_TAGDECL([], [link_all_deplibs], [0],\n    [Whether libtool must link a program against all its dependency libraries])\n_LT_TAGDECL([], [always_export_symbols], [0],\n    [Set to \"yes\" if exported symbols are required])\n_LT_TAGDECL([], [export_symbols_cmds], [2],\n    [The commands to list exported symbols])\n_LT_TAGDECL([], [exclude_expsyms], [1],\n    [Symbols that should not be listed in the preloaded symbols])\n_LT_TAGDECL([], [include_expsyms], [1],\n    [Symbols that must always be exported])\n_LT_TAGDECL([], [prelink_cmds], [2],\n    [Commands necessary for linking programs (against libraries) with templates])\n_LT_TAGDECL([], [postlink_cmds], [2],\n    [Commands necessary for finishing linking programs])\n_LT_TAGDECL([], [file_list_spec], [1],\n    [Specify filename containing input files])\ndnl FIXME: Not yet implemented\ndnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],\ndnl    [Compiler flag to generate thread safe objects])\n])# _LT_LINKER_SHLIBS\n\n\n# _LT_LANG_C_CONFIG([TAG])\n# ------------------------\n# Ensure that the configuration variables for a C compiler are suitably\n# defined.  These variables are subsequently used by _LT_CONFIG to write\n# the compiler configuration to 'libtool'.\nm4_defun([_LT_LANG_C_CONFIG],\n[m4_require([_LT_DECL_EGREP])dnl\nlt_save_CC=$CC\nAC_LANG_PUSH(C)\n\n# Source file extension for C test sources.\nac_ext=c\n\n# Object file extension for compiled C test sources.\nobjext=o\n_LT_TAGVAR(objext, $1)=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"int some_variable = 0;\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code='int main(){return(0);}'\n\n_LT_TAG_COMPILER\n# Save the default compiler, since it gets overwritten when the other\n# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.\ncompiler_DEFAULT=$CC\n\n# save warnings/boilerplate of simple test code\n_LT_COMPILER_BOILERPLATE\n_LT_LINKER_BOILERPLATE\n\nif test -n \"$compiler\"; then\n  _LT_COMPILER_NO_RTTI($1)\n  _LT_COMPILER_PIC($1)\n  _LT_COMPILER_C_O($1)\n  _LT_COMPILER_FILE_LOCKS($1)\n  _LT_LINKER_SHLIBS($1)\n  _LT_SYS_DYNAMIC_LINKER($1)\n  _LT_LINKER_HARDCODE_LIBPATH($1)\n  LT_SYS_DLOPEN_SELF\n  _LT_CMD_STRIPLIB\n\n  # Report what library types will actually be built\n  AC_MSG_CHECKING([if libtool supports shared libraries])\n  AC_MSG_RESULT([$can_build_shared])\n\n  AC_MSG_CHECKING([whether to build shared libraries])\n  test no = \"$can_build_shared\" && enable_shared=no\n\n  # On AIX, shared libraries and static libraries use the same namespace, and\n  # are all built from PIC.\n  case $host_os in\n  aix3*)\n    test yes = \"$enable_shared\" && enable_static=no\n    if test -n \"$RANLIB\"; then\n      archive_cmds=\"$archive_cmds~\\$RANLIB \\$lib\"\n      postinstall_cmds='$RANLIB $lib'\n    fi\n    ;;\n\n  aix[[4-9]]*)\n    if test ia64 != \"$host_cpu\"; then\n      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in\n      yes,aix,yes) ;;\t\t\t# shared object as lib.so file only\n      yes,svr4,*) ;;\t\t\t# shared object as lib.so archive member only\n      yes,*) enable_static=no ;;\t# shared object in lib.a archive as well\n      esac\n    fi\n    ;;\n  esac\n  AC_MSG_RESULT([$enable_shared])\n\n  AC_MSG_CHECKING([whether to build static libraries])\n  # Make sure either enable_shared or enable_static is yes.\n  test yes = \"$enable_shared\" || enable_static=yes\n  AC_MSG_RESULT([$enable_static])\n\n  _LT_CONFIG($1)\nfi\nAC_LANG_POP\nCC=$lt_save_CC\n])# _LT_LANG_C_CONFIG\n\n\n# _LT_LANG_CXX_CONFIG([TAG])\n# --------------------------\n# Ensure that the configuration variables for a C++ compiler are suitably\n# defined.  These variables are subsequently used by _LT_CONFIG to write\n# the compiler configuration to 'libtool'.\nm4_defun([_LT_LANG_CXX_CONFIG],\n[m4_require([_LT_FILEUTILS_DEFAULTS])dnl\nm4_require([_LT_DECL_EGREP])dnl\nm4_require([_LT_PATH_MANIFEST_TOOL])dnl\nif test -n \"$CXX\" && ( test no != \"$CXX\" &&\n    ( (test g++ = \"$CXX\" && `g++ -v >/dev/null 2>&1` ) ||\n    (test g++ != \"$CXX\"))); then\n  AC_PROG_CXXCPP\nelse\n  _lt_caught_CXX_error=yes\nfi\n\nAC_LANG_PUSH(C++)\n_LT_TAGVAR(archive_cmds_need_lc, $1)=no\n_LT_TAGVAR(allow_undefined_flag, $1)=\n_LT_TAGVAR(always_export_symbols, $1)=no\n_LT_TAGVAR(archive_expsym_cmds, $1)=\n_LT_TAGVAR(compiler_needs_object, $1)=no\n_LT_TAGVAR(export_dynamic_flag_spec, $1)=\n_LT_TAGVAR(hardcode_direct, $1)=no\n_LT_TAGVAR(hardcode_direct_absolute, $1)=no\n_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=\n_LT_TAGVAR(hardcode_libdir_separator, $1)=\n_LT_TAGVAR(hardcode_minus_L, $1)=no\n_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported\n_LT_TAGVAR(hardcode_automatic, $1)=no\n_LT_TAGVAR(inherit_rpath, $1)=no\n_LT_TAGVAR(module_cmds, $1)=\n_LT_TAGVAR(module_expsym_cmds, $1)=\n_LT_TAGVAR(link_all_deplibs, $1)=unknown\n_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds\n_LT_TAGVAR(reload_flag, $1)=$reload_flag\n_LT_TAGVAR(reload_cmds, $1)=$reload_cmds\n_LT_TAGVAR(no_undefined_flag, $1)=\n_LT_TAGVAR(whole_archive_flag_spec, $1)=\n_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no\n\n# Source file extension for C++ test sources.\nac_ext=cpp\n\n# Object file extension for compiled C++ test sources.\nobjext=o\n_LT_TAGVAR(objext, $1)=$objext\n\n# No sense in running all these tests if we already determined that\n# the CXX compiler isn't working.  Some variables (like enable_shared)\n# are currently assumed to apply to all compilers on this platform,\n# and will be corrupted by setting them based on a non-working compiler.\nif test yes != \"$_lt_caught_CXX_error\"; then\n  # Code to be used in simple compile tests\n  lt_simple_compile_test_code=\"int some_variable = 0;\"\n\n  # Code to be used in simple link tests\n  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'\n\n  # ltmain only uses $CC for tagged configurations so make sure $CC is set.\n  _LT_TAG_COMPILER\n\n  # save warnings/boilerplate of simple test code\n  _LT_COMPILER_BOILERPLATE\n  _LT_LINKER_BOILERPLATE\n\n  # Allow CC to be a program name with arguments.\n  lt_save_CC=$CC\n  lt_save_CFLAGS=$CFLAGS\n  lt_save_LD=$LD\n  lt_save_GCC=$GCC\n  GCC=$GXX\n  lt_save_with_gnu_ld=$with_gnu_ld\n  lt_save_path_LD=$lt_cv_path_LD\n  if test -n \"${lt_cv_prog_gnu_ldcxx+set}\"; then\n    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx\n  else\n    $as_unset lt_cv_prog_gnu_ld\n  fi\n  if test -n \"${lt_cv_path_LDCXX+set}\"; then\n    lt_cv_path_LD=$lt_cv_path_LDCXX\n  else\n    $as_unset lt_cv_path_LD\n  fi\n  test -z \"${LDCXX+set}\" || LD=$LDCXX\n  CC=${CXX-\"c++\"}\n  CFLAGS=$CXXFLAGS\n  compiler=$CC\n  _LT_TAGVAR(compiler, $1)=$CC\n  _LT_CC_BASENAME([$compiler])\n\n  if test -n \"$compiler\"; then\n    # We don't want -fno-exception when compiling C++ code, so set the\n    # no_builtin_flag separately\n    if test yes = \"$GXX\"; then\n      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'\n    else\n      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=\n    fi\n\n    if test yes = \"$GXX\"; then\n      # Set up default GNU C++ configuration\n\n      LT_PATH_LD\n\n      # Check if GNU C++ uses GNU ld as the underlying linker, since the\n      # archiving commands below assume that GNU ld is being used.\n      if test yes = \"$with_gnu_ld\"; then\n        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'\n        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n\n        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'\n\n        # If archive_cmds runs LD, not CC, wlarc should be empty\n        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to\n        #     investigate it a little bit more. (MM)\n        wlarc='$wl'\n\n        # ancient GNU ld didn't support --whole-archive et. al.\n        if eval \"`$CC -print-prog-name=ld` --help 2>&1\" |\n\t  $GREP 'no-whole-archive' > /dev/null; then\n          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'\n        else\n          _LT_TAGVAR(whole_archive_flag_spec, $1)=\n        fi\n      else\n        with_gnu_ld=no\n        wlarc=\n\n        # A generic and very simple default shared library creation\n        # command for GNU C++ for the case where it uses the native\n        # linker, instead of GNU ld.  If possible, this setting should\n        # overridden to take advantage of the native linker features on\n        # the platform it is being used on.\n        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'\n      fi\n\n      # Commands to make compiler produce verbose output that lists\n      # what \"hidden\" libraries, object files and flags are used when\n      # linking a shared library.\n      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v \"^Configured with:\" | $GREP \"\\-L\"'\n\n    else\n      GXX=no\n      with_gnu_ld=no\n      wlarc=\n    fi\n\n    # PORTME: fill in a description of your system's C++ link characteristics\n    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])\n    _LT_TAGVAR(ld_shlibs, $1)=yes\n    case $host_os in\n      aix3*)\n        # FIXME: insert proper C++ library support\n        _LT_TAGVAR(ld_shlibs, $1)=no\n        ;;\n      aix[[4-9]]*)\n        if test ia64 = \"$host_cpu\"; then\n          # On IA64, the linker does run time linking by default, so we don't\n          # have to do anything special.\n          aix_use_runtimelinking=no\n          exp_sym_flag='-Bexport'\n          no_entry_flag=\n        else\n          aix_use_runtimelinking=no\n\n          # Test if we are trying to use run time linking or normal\n          # AIX style linking. If -brtl is somewhere in LDFLAGS, we\n          # have runtime linking enabled, and use it for executables.\n          # For shared libraries, we enable/disable runtime linking\n          # depending on the kind of the shared library created -\n          # when \"with_aix_soname,aix_use_runtimelinking\" is:\n          # \"aix,no\"   lib.a(lib.so.V) shared, rtl:no,  for executables\n          # \"aix,yes\"  lib.so          shared, rtl:yes, for executables\n          #            lib.a           static archive\n          # \"both,no\"  lib.so.V(shr.o) shared, rtl:yes\n          #            lib.a(lib.so.V) shared, rtl:no,  for executables\n          # \"both,yes\" lib.so.V(shr.o) shared, rtl:yes, for executables\n          #            lib.a(lib.so.V) shared, rtl:no\n          # \"svr4,*\"   lib.so.V(shr.o) shared, rtl:yes, for executables\n          #            lib.a           static archive\n          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)\n\t    for ld_flag in $LDFLAGS; do\n\t      case $ld_flag in\n\t      *-brtl*)\n\t        aix_use_runtimelinking=yes\n\t        break\n\t        ;;\n\t      esac\n\t    done\n\t    if test svr4,no = \"$with_aix_soname,$aix_use_runtimelinking\"; then\n\t      # With aix-soname=svr4, we create the lib.so.V shared archives only,\n\t      # so we don't have lib.a shared libs to link our executables.\n\t      # We have to force runtime linking in this case.\n\t      aix_use_runtimelinking=yes\n\t      LDFLAGS=\"$LDFLAGS -Wl,-brtl\"\n\t    fi\n\t    ;;\n          esac\n\n          exp_sym_flag='-bexport'\n          no_entry_flag='-bnoentry'\n        fi\n\n        # When large executables or shared objects are built, AIX ld can\n        # have problems creating the table of contents.  If linking a library\n        # or program results in \"error TOC overflow\" add -mminimal-toc to\n        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not\n        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.\n\n        _LT_TAGVAR(archive_cmds, $1)=''\n        _LT_TAGVAR(hardcode_direct, $1)=yes\n        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes\n        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'\n        _LT_TAGVAR(link_all_deplibs, $1)=yes\n        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'\n        case $with_aix_soname,$aix_use_runtimelinking in\n        aix,*) ;;\t# no import file\n        svr4,* | *,yes) # use import file\n          # The Import File defines what to hardcode.\n          _LT_TAGVAR(hardcode_direct, $1)=no\n          _LT_TAGVAR(hardcode_direct_absolute, $1)=no\n          ;;\n        esac\n\n        if test yes = \"$GXX\"; then\n          case $host_os in aix4.[[012]]|aix4.[[012]].*)\n          # We only want to do this on AIX 4.2 and lower, the check\n          # below for broken collect2 doesn't work under 4.3+\n\t  collect2name=`$CC -print-prog-name=collect2`\n\t  if test -f \"$collect2name\" &&\n\t     strings \"$collect2name\" | $GREP resolve_lib_name >/dev/null\n\t  then\n\t    # We have reworked collect2\n\t    :\n\t  else\n\t    # We have old collect2\n\t    _LT_TAGVAR(hardcode_direct, $1)=unsupported\n\t    # It fails to find uninstalled libraries when the uninstalled\n\t    # path is not listed in the libpath.  Setting hardcode_minus_L\n\t    # to unsupported forces relinking\n\t    _LT_TAGVAR(hardcode_minus_L, $1)=yes\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n\t    _LT_TAGVAR(hardcode_libdir_separator, $1)=\n\t  fi\n          esac\n          shared_flag='-shared'\n\t  if test yes = \"$aix_use_runtimelinking\"; then\n\t    shared_flag=$shared_flag' $wl-G'\n\t  fi\n\t  # Need to ensure runtime linking is disabled for the traditional\n\t  # shared library, or the linker may eventually find shared libraries\n\t  # /with/ Import File - we do not want to mix them.\n\t  shared_flag_aix='-shared'\n\t  shared_flag_svr4='-shared $wl-G'\n        else\n          # not using gcc\n          if test ia64 = \"$host_cpu\"; then\n\t  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release\n\t  # chokes on -Wl,-G. The following line is correct:\n\t  shared_flag='-G'\n          else\n\t    if test yes = \"$aix_use_runtimelinking\"; then\n\t      shared_flag='$wl-G'\n\t    else\n\t      shared_flag='$wl-bM:SRE'\n\t    fi\n\t    shared_flag_aix='$wl-bM:SRE'\n\t    shared_flag_svr4='$wl-G'\n          fi\n        fi\n\n        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'\n        # It seems that -bexpall does not export symbols beginning with\n        # underscore (_), so it is better to generate a list of symbols to\n\t# export.\n        _LT_TAGVAR(always_export_symbols, $1)=yes\n\tif test aix,yes = \"$with_aix_soname,$aix_use_runtimelinking\"; then\n          # Warning - without using the other runtime loading flags (-brtl),\n          # -berok will link without error, but may produce a broken library.\n          # The \"-G\" linker flag allows undefined symbols.\n          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'\n          # Determine the default libpath from the value encoded in an empty\n          # executable.\n          _LT_SYS_MODULE_PATH_AIX([$1])\n          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'\"$aix_libpath\"\n\n          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n \"$allow_undefined_flag\"; then func_echo_all \"$wl$allow_undefined_flag\"; else :; fi` $wl'$exp_sym_flag:\\$export_symbols' '$shared_flag\n        else\n          if test ia64 = \"$host_cpu\"; then\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'\n\t    _LT_TAGVAR(allow_undefined_flag, $1)=\"-z nodefs\"\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)=\"\\$CC $shared_flag\"' -o $output_objdir/$soname $libobjs $deplibs '\"\\$wl$no_entry_flag\"' $compiler_flags $wl$allow_undefined_flag '\"\\$wl$exp_sym_flag:\\$export_symbols\"\n          else\n\t    # Determine the default libpath from the value encoded in an\n\t    # empty executable.\n\t    _LT_SYS_MODULE_PATH_AIX([$1])\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'\"$aix_libpath\"\n\t    # Warning - without using the other run time loading flags,\n\t    # -berok will link without error, but may produce a broken library.\n\t    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'\n\t    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'\n\t    if test yes = \"$with_gnu_ld\"; then\n\t      # We only use this code for GNU lds that support --whole-archive.\n\t      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'\n\t    else\n\t      # Exported symbols can be pulled into shared objects from archives\n\t      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'\n\t    fi\n\t    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'\n\t    # -brtl affects multiple linker settings, -berok does not and is overridden later\n\t    compiler_flags_filtered='`func_echo_all \"$compiler_flags \" | $SED -e \"s%-brtl\\\\([[, ]]\\\\)%-berok\\\\1%g\"`'\n\t    if test svr4 != \"$with_aix_soname\"; then\n\t      # This is similar to how AIX traditionally builds its shared\n\t      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.\n\t      _LT_TAGVAR(archive_expsym_cmds, $1)=\"$_LT_TAGVAR(archive_expsym_cmds, $1)\"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'\n\t    fi\n\t    if test aix != \"$with_aix_soname\"; then\n\t      _LT_TAGVAR(archive_expsym_cmds, $1)=\"$_LT_TAGVAR(archive_expsym_cmds, $1)\"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all \"#! $soname($shared_archive_member_spec.o)\"; if test shr_64 = \"$shared_archive_member_spec\"; then func_echo_all \"# 64\"; else func_echo_all \"# 32\"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'\n\t    else\n\t      # used by -dlpreopen to get the symbols\n\t      _LT_TAGVAR(archive_expsym_cmds, $1)=\"$_LT_TAGVAR(archive_expsym_cmds, $1)\"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'\n\t    fi\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)=\"$_LT_TAGVAR(archive_expsym_cmds, $1)\"'~$RM -r $output_objdir/$realname.d'\n          fi\n        fi\n        ;;\n\n      beos*)\n\tif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\t  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n\t  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc\n\t  # support --undefined.  This deserves some investigation.  FIXME\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\telse\n\t  _LT_TAGVAR(ld_shlibs, $1)=no\n\tfi\n\t;;\n\n      chorus*)\n        case $cc_basename in\n          *)\n\t  # FIXME: insert proper C++ library support\n\t  _LT_TAGVAR(ld_shlibs, $1)=no\n\t  ;;\n        esac\n        ;;\n\n      cygwin* | mingw* | pw32* | cegcc*)\n\tcase $GXX,$cc_basename in\n\t,cl* | no,cl*)\n\t  # Native MSVC\n\t  # hardcode_libdir_flag_spec is actually meaningless, as there is\n\t  # no search path for DLLs.\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '\n\t  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n\t  _LT_TAGVAR(always_export_symbols, $1)=yes\n\t  _LT_TAGVAR(file_list_spec, $1)='@'\n\t  # Tell ltmain to make .lib files, not .a files.\n\t  libext=lib\n\t  # Tell ltmain to make .dll files, not .so files.\n\t  shrext_cmds=.dll\n\t  # FIXME: Setting linknames here is a bad hack.\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:\"$tool_output_objdir$libname.dll.lib\"~linknames='\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then\n              cp \"$export_symbols\" \"$output_objdir/$soname.def\";\n              echo \"$tool_output_objdir$soname.def\" > \"$output_objdir/$soname.exp\";\n            else\n              $SED -e '\\''s/^/-link -EXPORT:/'\\'' < $export_symbols > $output_objdir/$soname.exp;\n            fi~\n            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs \"@$tool_output_objdir$soname.exp\" -Wl,-DLL,-IMPLIB:\"$tool_output_objdir$libname.dll.lib\"~\n            linknames='\n\t  # The linker will not automatically build a static lib if we build a DLL.\n\t  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'\n\t  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n\t  # Don't use ranlib\n\t  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'\n\t  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile=\"@OUTPUT@\"~\n            lt_tool_outputfile=\"@TOOL_OUTPUT@\"~\n            case $lt_outputfile in\n              *.exe|*.EXE) ;;\n              *)\n                lt_outputfile=$lt_outputfile.exe\n                lt_tool_outputfile=$lt_tool_outputfile.exe\n                ;;\n            esac~\n            func_to_tool_file \"$lt_outputfile\"~\n            if test : != \"$MANIFEST_TOOL\" && test -f \"$lt_outputfile.manifest\"; then\n              $MANIFEST_TOOL -manifest \"$lt_tool_outputfile.manifest\" -outputresource:\"$lt_tool_outputfile\" || exit 1;\n              $RM \"$lt_outputfile.manifest\";\n            fi'\n\t  ;;\n\t*)\n\t  # g++\n\t  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,\n\t  # as there is no search path for DLLs.\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n\t  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'\n\t  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n\t  _LT_TAGVAR(always_export_symbols, $1)=no\n\t  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n\n\t  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'\n\t    # If the export-symbols file already is a .def file, use it as\n\t    # is; otherwise, prepend EXPORTS...\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then\n              cp $export_symbols $output_objdir/$soname.def;\n            else\n              echo EXPORTS > $output_objdir/$soname.def;\n              cat $export_symbols >> $output_objdir/$soname.def;\n            fi~\n            $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'\n\t  else\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t  fi\n\t  ;;\n\tesac\n\t;;\n      darwin* | rhapsody*)\n        _LT_DARWIN_LINKER_FEATURES($1)\n\t;;\n\n      os2*)\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n\t_LT_TAGVAR(hardcode_minus_L, $1)=yes\n\t_LT_TAGVAR(allow_undefined_flag, $1)=unsupported\n\tshrext_cmds=.dll\n\t_LT_TAGVAR(archive_cmds, $1)='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t  $ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t  $ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t  $ECHO EXPORTS >> $output_objdir/$libname.def~\n\t  emxexp $libobjs | $SED /\"_DLL_InitTerm\"/d >> $output_objdir/$libname.def~\n\t  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\t  emximp -o $lib $output_objdir/$libname.def'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t  $ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t  $ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t  $ECHO EXPORTS >> $output_objdir/$libname.def~\n\t  prefix_cmds=\"$SED\"~\n\t  if test EXPORTS = \"`$SED 1q $export_symbols`\"; then\n\t    prefix_cmds=\"$prefix_cmds -e 1d\";\n\t  fi~\n\t  prefix_cmds=\"$prefix_cmds -e \\\"s/^\\(.*\\)$/_\\1/g\\\"\"~\n\t  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~\n\t  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\t  emximp -o $lib $output_objdir/$libname.def'\n\t_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'\n\t_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n\t;;\n\n      dgux*)\n        case $cc_basename in\n          ec++*)\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n          ghcx*)\n\t    # Green Hills C++ Compiler\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n          *)\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n        esac\n        ;;\n\n      freebsd2.*)\n        # C++ shared libraries reported to be fairly broken before\n\t# switch to ELF\n        _LT_TAGVAR(ld_shlibs, $1)=no\n        ;;\n\n      freebsd-elf*)\n        _LT_TAGVAR(archive_cmds_need_lc, $1)=no\n        ;;\n\n      freebsd* | dragonfly*)\n        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF\n        # conventions\n        _LT_TAGVAR(ld_shlibs, $1)=yes\n        ;;\n\n      haiku*)\n        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n        _LT_TAGVAR(link_all_deplibs, $1)=yes\n        ;;\n\n      hpux9*)\n        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'\n        _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n        _LT_TAGVAR(hardcode_direct, $1)=yes\n        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,\n\t\t\t\t             # but as the default\n\t\t\t\t             # location of the library.\n\n        case $cc_basename in\n          CC*)\n            # FIXME: insert proper C++ library support\n            _LT_TAGVAR(ld_shlibs, $1)=no\n            ;;\n          aCC*)\n            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test \"x$output_objdir/$soname\" = \"x$lib\" || mv $output_objdir/$soname $lib'\n            # Commands to make compiler produce verbose output that lists\n            # what \"hidden\" libraries, object files and flags are used when\n            # linking a shared library.\n            #\n            # There doesn't appear to be a way to prevent this compiler from\n            # explicitly linking system object files so we need to strip them\n            # from the output so that they don't get included in the library\n            # dependencies.\n            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP \"\\-L\"`; list= ; for z in $templist; do case $z in conftest.$objext) list=\"$list $z\";; *.$objext);; *) list=\"$list $z\";;esac; done; func_echo_all \"$list\"'\n            ;;\n          *)\n            if test yes = \"$GXX\"; then\n              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test \"x$output_objdir/$soname\" = \"x$lib\" || mv $output_objdir/$soname $lib'\n            else\n              # FIXME: insert proper C++ library support\n              _LT_TAGVAR(ld_shlibs, $1)=no\n            fi\n            ;;\n        esac\n        ;;\n\n      hpux10*|hpux11*)\n        if test no = \"$with_gnu_ld\"; then\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'\n\t  _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n\n          case $host_cpu in\n            hppa*64*|ia64*)\n              ;;\n            *)\n\t      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n              ;;\n          esac\n        fi\n        case $host_cpu in\n          hppa*64*|ia64*)\n            _LT_TAGVAR(hardcode_direct, $1)=no\n            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n            ;;\n          *)\n            _LT_TAGVAR(hardcode_direct, $1)=yes\n            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes\n            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,\n\t\t\t\t\t         # but as the default\n\t\t\t\t\t         # location of the library.\n            ;;\n        esac\n\n        case $cc_basename in\n          CC*)\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n          aCC*)\n\t    case $host_cpu in\n\t      hppa*64*)\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t        ;;\n\t      ia64*)\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t        ;;\n\t      *)\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t        ;;\n\t    esac\n\t    # Commands to make compiler produce verbose output that lists\n\t    # what \"hidden\" libraries, object files and flags are used when\n\t    # linking a shared library.\n\t    #\n\t    # There doesn't appear to be a way to prevent this compiler from\n\t    # explicitly linking system object files so we need to strip them\n\t    # from the output so that they don't get included in the library\n\t    # dependencies.\n\t    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP \"\\-L\"`; list= ; for z in $templist; do case $z in conftest.$objext) list=\"$list $z\";; *.$objext);; *) list=\"$list $z\";;esac; done; func_echo_all \"$list\"'\n\t    ;;\n          *)\n\t    if test yes = \"$GXX\"; then\n\t      if test no = \"$with_gnu_ld\"; then\n\t        case $host_cpu in\n\t          hppa*64*)\n\t            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t            ;;\n\t          ia64*)\n\t            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t            ;;\n\t          *)\n\t            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t            ;;\n\t        esac\n\t      fi\n\t    else\n\t      # FIXME: insert proper C++ library support\n\t      _LT_TAGVAR(ld_shlibs, $1)=no\n\t    fi\n\t    ;;\n        esac\n        ;;\n\n      interix[[3-9]]*)\n\t_LT_TAGVAR(hardcode_direct, $1)=no\n\t_LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n\t_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n\t# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.\n\t# Instead, shared libraries are loaded at an image base (0x10000000 by\n\t# default) and relocated if they conflict, which is a slow very memory\n\t# consuming and fragmenting process.  To avoid this, we pick a random,\n\t# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link\n\t# time.  Moving up from 0x10000000 also allows more sbrk(2) space.\n\t_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \\* 262144 + 1342177280` -o $lib'\n\t_LT_TAGVAR(archive_expsym_cmds, $1)='sed \"s|^|_|\" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \\* 262144 + 1342177280` -o $lib'\n\t;;\n      irix5* | irix6*)\n        case $cc_basename in\n          CC*)\n\t    # SGI C++\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n \"$verstring\" && func_echo_all \"-set_version $verstring\"` -update_registry $output_objdir/so_locations -o $lib'\n\n\t    # Archives containing C++ object files must be created using\n\t    # \"CC -ar\", where \"CC\" is the IRIX C++ compiler.  This is\n\t    # necessary to make sure instantiated templates are included\n\t    # in the archive.\n\t    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'\n\t    ;;\n          *)\n\t    if test yes = \"$GXX\"; then\n\t      if test no = \"$with_gnu_ld\"; then\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n \"$verstring\" && func_echo_all \"$wl-set_version $wl$verstring\"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'\n\t      else\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n \"$verstring\" && func_echo_all \"$wl-set_version $wl$verstring\"` -o $lib'\n\t      fi\n\t    fi\n\t    _LT_TAGVAR(link_all_deplibs, $1)=yes\n\t    ;;\n        esac\n        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n        _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n        _LT_TAGVAR(inherit_rpath, $1)=yes\n        ;;\n\n      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n        case $cc_basename in\n          KCC*)\n\t    # Kuck and Associates, Inc. (KAI) C++ Compiler\n\n\t    # KCC will only create a shared library if the output file\n\t    # ends with \".so\" (or \".sl\" for HP-UX), so rename the library\n\t    # to its proper name (with version) after linking.\n\t    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\\''s/\\([[^()0-9A-Za-z{}]]\\)/\\\\\\\\\\1/g'\\''`; templib=`echo $lib | $SED -e \"s/\\$tempext\\..*/.so/\"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \\$templib; mv \\$templib $lib'\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\\''s/\\([[^()0-9A-Za-z{}]]\\)/\\\\\\\\\\1/g'\\''`; templib=`echo $lib | $SED -e \"s/\\$tempext\\..*/.so/\"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \\$templib $wl-retain-symbols-file,$export_symbols; mv \\$templib $lib'\n\t    # Commands to make compiler produce verbose output that lists\n\t    # what \"hidden\" libraries, object files and flags are used when\n\t    # linking a shared library.\n\t    #\n\t    # There doesn't appear to be a way to prevent this compiler from\n\t    # explicitly linking system object files so we need to strip them\n\t    # from the output so that they don't get included in the library\n\t    # dependencies.\n\t    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP \"ld\"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list=\"$list $z\";; *.$objext);; *) list=\"$list $z\";;esac; done; func_echo_all \"$list\"'\n\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n\t    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'\n\n\t    # Archives containing C++ object files must be created using\n\t    # \"CC -Bstatic\", where \"CC\" is the KAI C++ compiler.\n\t    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'\n\t    ;;\n\t  icpc* | ecpc* )\n\t    # Intel C++\n\t    with_gnu_ld=yes\n\t    # version 8.0 and above of icpc choke on multiply defined symbols\n\t    # if we add $predep_objects and $postdep_objects, however 7.1 and\n\t    # earlier do not add the objects themselves.\n\t    case `$CC -V 2>&1` in\n\t      *\"Version 7.\"*)\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'\n\t\t_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n\t\t;;\n\t      *)  # Version 8.0 or newer\n\t        tmp_idyn=\n\t        case $host_cpu in\n\t\t  ia64*) tmp_idyn=' -i_dynamic';;\n\t\tesac\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'\"$tmp_idyn\"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\t\t_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'\"$tmp_idyn\"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n\t\t;;\n\t    esac\n\t    _LT_TAGVAR(archive_cmds_need_lc, $1)=no\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n\t    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'\n\t    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'\n\t    ;;\n          pgCC* | pgcpp*)\n            # Portland Group C++ compiler\n\t    case `$CC -V` in\n\t    *pgCC\\ [[1-5]].* | *pgcpp\\ [[1-5]].*)\n\t      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~\n               rm -rf $tpldir~\n               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~\n               compile_command=\"$compile_command `find $tpldir -name \\*.o | sort | $NL2SP`\"'\n\t      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~\n                rm -rf $tpldir~\n                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~\n                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \\*.o | sort | $NL2SP`~\n                $RANLIB $oldlib'\n\t      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~\n                rm -rf $tpldir~\n                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~\n                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \\*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'\n\t      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~\n                rm -rf $tpldir~\n                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~\n                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \\*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n\t      ;;\n\t    *) # Version 6 and above use weak symbols\n\t      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'\n\t      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n\t      ;;\n\t    esac\n\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'\n\t    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'\n\t    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\\\"\\\"; do test  -n \\\"$conv\\\" && new_convenience=\\\"$new_convenience,$conv\\\"; done; func_echo_all \\\"$new_convenience\\\"` $wl--no-whole-archive'\n            ;;\n\t  cxx*)\n\t    # Compaq C++\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-retain-symbols-file $wl$export_symbols'\n\n\t    runpath_var=LD_RUN_PATH\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'\n\t    _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\t    # Commands to make compiler produce verbose output that lists\n\t    # what \"hidden\" libraries, object files and flags are used when\n\t    # linking a shared library.\n\t    #\n\t    # There doesn't appear to be a way to prevent this compiler from\n\t    # explicitly linking system object files so we need to strip them\n\t    # from the output so that they don't get included in the library\n\t    # dependencies.\n\t    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP \"ld\"`; templist=`func_echo_all \"$templist\" | $SED \"s/\\(^.*ld.*\\)\\( .*ld .*$\\)/\\1/\"`; list= ; for z in $templist; do case $z in conftest.$objext) list=\"$list $z\";; *.$objext);; *) list=\"$list $z\";;esac; done; func_echo_all \"X$list\" | $Xsed'\n\t    ;;\n\t  xl* | mpixl* | bgxl*)\n\t    # IBM XL 8.0 on PPC, with GNU ld\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n\t    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\t    if test yes = \"$supports_anon_versioning\"; then\n\t      _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $output_objdir/$libname.ver~\n                cat $export_symbols | sed -e \"s/\\(.*\\)/\\1;/\" >> $output_objdir/$libname.ver~\n                echo \"local: *; };\" >> $output_objdir/$libname.ver~\n                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'\n\t    fi\n\t    ;;\n\t  *)\n\t    case `$CC -V 2>&1 | sed 5q` in\n\t    *Sun\\ C*)\n\t      # Sun C++ 5.9\n\t      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'\n\t      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'\n\t      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n\t      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\\\"\\\"; do test -z \\\"$conv\\\" || new_convenience=\\\"$new_convenience,$conv\\\"; done; func_echo_all \\\"$new_convenience\\\"` $wl--no-whole-archive'\n\t      _LT_TAGVAR(compiler_needs_object, $1)=yes\n\n\t      # Not sure whether something based on\n\t      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1\n\t      # would be better.\n\t      output_verbose_link_cmd='func_echo_all'\n\n\t      # Archives containing C++ object files must be created using\n\t      # \"CC -xar\", where \"CC\" is the Sun C++ compiler.  This is\n\t      # necessary to make sure instantiated templates are included\n\t      # in the archive.\n\t      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'\n\t      ;;\n\t    esac\n\t    ;;\n\tesac\n\t;;\n\n      lynxos*)\n        # FIXME: insert proper C++ library support\n\t_LT_TAGVAR(ld_shlibs, $1)=no\n\t;;\n\n      m88k*)\n        # FIXME: insert proper C++ library support\n        _LT_TAGVAR(ld_shlibs, $1)=no\n\t;;\n\n      mvs*)\n        case $cc_basename in\n          cxx*)\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n\t  *)\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n\tesac\n\t;;\n\n      netbsd*)\n        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then\n\t  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'\n\t  wlarc=\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n\t  _LT_TAGVAR(hardcode_direct, $1)=yes\n\t  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\tfi\n\t# Workaround some broken pre-1.5 toolchains\n\toutput_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e \"s:-lgcc -lc -lgcc::\"'\n\t;;\n\n      *nto* | *qnx*)\n        _LT_TAGVAR(ld_shlibs, $1)=yes\n\t;;\n\n      openbsd* | bitrig*)\n\tif test -f /usr/libexec/ld.so; then\n\t  _LT_TAGVAR(hardcode_direct, $1)=yes\n\t  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\t  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'\n\t  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n\t  if test -z \"`echo __ELF__ | $CC -E - | grep __ELF__`\"; then\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'\n\t    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'\n\t    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'\n\t  fi\n\t  output_verbose_link_cmd=func_echo_all\n\telse\n\t  _LT_TAGVAR(ld_shlibs, $1)=no\n\tfi\n\t;;\n\n      osf3* | osf4* | osf5*)\n        case $cc_basename in\n          KCC*)\n\t    # Kuck and Associates, Inc. (KAI) C++ Compiler\n\n\t    # KCC will only create a shared library if the output file\n\t    # ends with \".so\" (or \".sl\" for HP-UX), so rename the library\n\t    # to its proper name (with version) after linking.\n\t    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\\''s/\\([[^()0-9A-Za-z{}]]\\)/\\\\\\\\\\1/g'\\''`; templib=`echo \"$lib\" | $SED -e \"s/\\$tempext\\..*/.so/\"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \\$templib; mv \\$templib $lib'\n\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'\n\t    _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\t    # Archives containing C++ object files must be created using\n\t    # the KAI C++ compiler.\n\t    case $host in\n\t      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;\n\t      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;\n\t    esac\n\t    ;;\n          RCC*)\n\t    # Rational C++ 2.4.1\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n          cxx*)\n\t    case $host in\n\t      osf3*)\n\t        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\\*'\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n \"$verstring\" && func_echo_all \"$wl-set_version $verstring\"` -update_registry $output_objdir/so_locations -o $lib'\n\t        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n\t\t;;\n\t      *)\n\t        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \\*'\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n \"$verstring\" && func_echo_all \"-set_version $verstring\"` -update_registry $output_objdir/so_locations -o $lib'\n\t        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf \"%s %s\\\\n\" -exported_symbol \"\\$i\" >> $lib.exp; done~\n                  echo \"-hidden\">> $lib.exp~\n                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n \"$verstring\" && $ECHO \"-set_version $verstring\"` -update_registry $output_objdir/so_locations -o $lib~\n                  $RM $lib.exp'\n\t        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'\n\t\t;;\n\t    esac\n\n\t    _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\t    # Commands to make compiler produce verbose output that lists\n\t    # what \"hidden\" libraries, object files and flags are used when\n\t    # linking a shared library.\n\t    #\n\t    # There doesn't appear to be a way to prevent this compiler from\n\t    # explicitly linking system object files so we need to strip them\n\t    # from the output so that they don't get included in the library\n\t    # dependencies.\n\t    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP \"ld\" | $GREP -v \"ld:\"`; templist=`func_echo_all \"$templist\" | $SED \"s/\\(^.*ld.*\\)\\( .*ld.*$\\)/\\1/\"`; list= ; for z in $templist; do case $z in conftest.$objext) list=\"$list $z\";; *.$objext);; *) list=\"$list $z\";;esac; done; func_echo_all \"$list\"'\n\t    ;;\n\t  *)\n\t    if test yes,no = \"$GXX,$with_gnu_ld\"; then\n\t      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\\*'\n\t      case $host in\n\t        osf3*)\n\t          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n \"$verstring\" && func_echo_all \"$wl-set_version $wl$verstring\"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'\n\t\t  ;;\n\t        *)\n\t          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n \"$verstring\" && func_echo_all \"$wl-set_version $wl$verstring\"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'\n\t\t  ;;\n\t      esac\n\n\t      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'\n\t      _LT_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\t      # Commands to make compiler produce verbose output that lists\n\t      # what \"hidden\" libraries, object files and flags are used when\n\t      # linking a shared library.\n\t      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v \"^Configured with:\" | $GREP \"\\-L\"'\n\n\t    else\n\t      # FIXME: insert proper C++ library support\n\t      _LT_TAGVAR(ld_shlibs, $1)=no\n\t    fi\n\t    ;;\n        esac\n        ;;\n\n      psos*)\n        # FIXME: insert proper C++ library support\n        _LT_TAGVAR(ld_shlibs, $1)=no\n        ;;\n\n      sunos4*)\n        case $cc_basename in\n          CC*)\n\t    # Sun C++ 4.x\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n          lcc*)\n\t    # Lucid\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n          *)\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n        esac\n        ;;\n\n      solaris*)\n        case $cc_basename in\n          CC* | sunCC*)\n\t    # Sun C++ 4.2, 5.x and Centerline C++\n            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes\n\t    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n              $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'\n\n\t    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n\t    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\t    case $host_os in\n\t      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;\n\t      *)\n\t\t# The compiler driver will combine and reorder linker options,\n\t\t# but understands '-z linker_flag'.\n\t        # Supported since Solaris 2.6 (maybe 2.5.1?)\n\t\t_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'\n\t        ;;\n\t    esac\n\t    _LT_TAGVAR(link_all_deplibs, $1)=yes\n\n\t    output_verbose_link_cmd='func_echo_all'\n\n\t    # Archives containing C++ object files must be created using\n\t    # \"CC -xar\", where \"CC\" is the Sun C++ compiler.  This is\n\t    # necessary to make sure instantiated templates are included\n\t    # in the archive.\n\t    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'\n\t    ;;\n          gcx*)\n\t    # Green Hills C++ Compiler\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'\n\n\t    # The C++ compiler must be used to create the archive.\n\t    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'\n\t    ;;\n          *)\n\t    # GNU C++ compiler with Solaris linker\n\t    if test yes,no = \"$GXX,$with_gnu_ld\"; then\n\t      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'\n\t      if $CC --version | $GREP -v '^2\\.7' > /dev/null; then\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'\n\t        _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'\n\n\t        # Commands to make compiler produce verbose output that lists\n\t        # what \"hidden\" libraries, object files and flags are used when\n\t        # linking a shared library.\n\t        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v \"^Configured with:\" | $GREP \"\\-L\"'\n\t      else\n\t        # g++ 2.7 appears to require '-G' NOT '-shared' on this\n\t        # platform.\n\t        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'\n\t        _LT_TAGVAR(archive_expsym_cmds, $1)='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'\n\n\t        # Commands to make compiler produce verbose output that lists\n\t        # what \"hidden\" libraries, object files and flags are used when\n\t        # linking a shared library.\n\t        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v \"^Configured with:\" | $GREP \"\\-L\"'\n\t      fi\n\n\t      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'\n\t      case $host_os in\n\t\tsolaris2.[[0-5]] | solaris2.[[0-5]].*) ;;\n\t\t*)\n\t\t  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'\n\t\t  ;;\n\t      esac\n\t    fi\n\t    ;;\n        esac\n        ;;\n\n    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)\n      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'\n      _LT_TAGVAR(archive_cmds_need_lc, $1)=no\n      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n      runpath_var='LD_RUN_PATH'\n\n      case $cc_basename in\n        CC*)\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\t*)\n\t  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n      esac\n      ;;\n\n      sysv5* | sco3.2v5* | sco5v6*)\n\t# Note: We CANNOT use -z defs as we might desire, because we do not\n\t# link with -lc, and that would cause any symbols used from libc to\n\t# always be unresolved, which means just about no library would\n\t# ever link correctly.  If we're not using GNU ld we use -z text\n\t# though, which does catch some bad symbols but isn't as heavy-handed\n\t# as -z defs.\n\t_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'\n\t_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'\n\t_LT_TAGVAR(archive_cmds_need_lc, $1)=no\n\t_LT_TAGVAR(hardcode_shlibpath_var, $1)=no\n\t_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'\n\t_LT_TAGVAR(hardcode_libdir_separator, $1)=':'\n\t_LT_TAGVAR(link_all_deplibs, $1)=yes\n\t_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'\n\trunpath_var='LD_RUN_PATH'\n\n\tcase $cc_basename in\n          CC*)\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~\n              '\"$_LT_TAGVAR(old_archive_cmds, $1)\"\n\t    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~\n              '\"$_LT_TAGVAR(reload_cmds, $1)\"\n\t    ;;\n\t  *)\n\t    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t    ;;\n\tesac\n      ;;\n\n      tandem*)\n        case $cc_basename in\n          NCC*)\n\t    # NonStop-UX NCC 3.20\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n          *)\n\t    # FIXME: insert proper C++ library support\n\t    _LT_TAGVAR(ld_shlibs, $1)=no\n\t    ;;\n        esac\n        ;;\n\n      vxworks*)\n        # FIXME: insert proper C++ library support\n        _LT_TAGVAR(ld_shlibs, $1)=no\n        ;;\n\n      *)\n        # FIXME: insert proper C++ library support\n        _LT_TAGVAR(ld_shlibs, $1)=no\n        ;;\n    esac\n\n    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])\n    test no = \"$_LT_TAGVAR(ld_shlibs, $1)\" && can_build_shared=no\n\n    _LT_TAGVAR(GCC, $1)=$GXX\n    _LT_TAGVAR(LD, $1)=$LD\n\n    ## CAVEAT EMPTOR:\n    ## There is no encapsulation within the following macros, do not change\n    ## the running order or otherwise move them around unless you know exactly\n    ## what you are doing...\n    _LT_SYS_HIDDEN_LIBDEPS($1)\n    _LT_COMPILER_PIC($1)\n    _LT_COMPILER_C_O($1)\n    _LT_COMPILER_FILE_LOCKS($1)\n    _LT_LINKER_SHLIBS($1)\n    _LT_SYS_DYNAMIC_LINKER($1)\n    _LT_LINKER_HARDCODE_LIBPATH($1)\n\n    _LT_CONFIG($1)\n  fi # test -n \"$compiler\"\n\n  CC=$lt_save_CC\n  CFLAGS=$lt_save_CFLAGS\n  LDCXX=$LD\n  LD=$lt_save_LD\n  GCC=$lt_save_GCC\n  with_gnu_ld=$lt_save_with_gnu_ld\n  lt_cv_path_LDCXX=$lt_cv_path_LD\n  lt_cv_path_LD=$lt_save_path_LD\n  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld\n  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld\nfi # test yes != \"$_lt_caught_CXX_error\"\n\nAC_LANG_POP\n])# _LT_LANG_CXX_CONFIG\n\n\n# _LT_FUNC_STRIPNAME_CNF\n# ----------------------\n# func_stripname_cnf prefix suffix name\n# strip PREFIX and SUFFIX off of NAME.\n# PREFIX and SUFFIX must not contain globbing or regex special\n# characters, hashes, percent signs, but SUFFIX may contain a leading\n# dot (in which case that matches only a dot).\n#\n# This function is identical to the (non-XSI) version of func_stripname,\n# except this one can be used by m4 code that may be executed by configure,\n# rather than the libtool script.\nm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl\nAC_REQUIRE([_LT_DECL_SED])\nAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])\nfunc_stripname_cnf ()\n{\n  case @S|@2 in\n  .*) func_stripname_result=`$ECHO \"@S|@3\" | $SED \"s%^@S|@1%%; s%\\\\\\\\@S|@2\\$%%\"`;;\n  *)  func_stripname_result=`$ECHO \"@S|@3\" | $SED \"s%^@S|@1%%; s%@S|@2\\$%%\"`;;\n  esac\n} # func_stripname_cnf\n])# _LT_FUNC_STRIPNAME_CNF\n\n\n# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])\n# ---------------------------------\n# Figure out \"hidden\" library dependencies from verbose\n# compiler output when linking a shared library.\n# Parse the compiler output and extract the necessary\n# objects, libraries and library flags.\nm4_defun([_LT_SYS_HIDDEN_LIBDEPS],\n[m4_require([_LT_FILEUTILS_DEFAULTS])dnl\nAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl\n# Dependencies to place before and after the object being linked:\n_LT_TAGVAR(predep_objects, $1)=\n_LT_TAGVAR(postdep_objects, $1)=\n_LT_TAGVAR(predeps, $1)=\n_LT_TAGVAR(postdeps, $1)=\n_LT_TAGVAR(compiler_lib_search_path, $1)=\n\ndnl we can't use the lt_simple_compile_test_code here,\ndnl because it contains code intended for an executable,\ndnl not a library.  It's possible we should let each\ndnl tag define a new lt_????_link_test_code variable,\ndnl but it's only used here...\nm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF\nint a;\nvoid foo (void) { a = 0; }\n_LT_EOF\n], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF\nclass Foo\n{\npublic:\n  Foo (void) { a = 0; }\nprivate:\n  int a;\n};\n_LT_EOF\n], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF\n      subroutine foo\n      implicit none\n      integer*4 a\n      a=0\n      return\n      end\n_LT_EOF\n], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF\n      subroutine foo\n      implicit none\n      integer a\n      a=0\n      return\n      end\n_LT_EOF\n], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF\npublic class foo {\n  private int a;\n  public void bar (void) {\n    a = 0;\n  }\n};\n_LT_EOF\n], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF\npackage foo\nfunc foo() {\n}\n_LT_EOF\n])\n\n_lt_libdeps_save_CFLAGS=$CFLAGS\ncase \"$CC $CFLAGS \" in #(\n*\\ -flto*\\ *) CFLAGS=\"$CFLAGS -fno-lto\" ;;\n*\\ -fwhopr*\\ *) CFLAGS=\"$CFLAGS -fno-whopr\" ;;\n*\\ -fuse-linker-plugin*\\ *) CFLAGS=\"$CFLAGS -fno-use-linker-plugin\" ;;\nesac\n\ndnl Parse the compiler output and extract the necessary\ndnl objects, libraries and library flags.\nif AC_TRY_EVAL(ac_compile); then\n  # Parse the compiler output and extract the necessary\n  # objects, libraries and library flags.\n\n  # Sentinel used to keep track of whether or not we are before\n  # the conftest object file.\n  pre_test_object_deps_done=no\n\n  for p in `eval \"$output_verbose_link_cmd\"`; do\n    case $prev$p in\n\n    -L* | -R* | -l*)\n       # Some compilers place space between \"-{L,R}\" and the path.\n       # Remove the space.\n       if test x-L = \"$p\" ||\n          test x-R = \"$p\"; then\n\t prev=$p\n\t continue\n       fi\n\n       # Expand the sysroot to ease extracting the directories later.\n       if test -z \"$prev\"; then\n         case $p in\n         -L*) func_stripname_cnf '-L' '' \"$p\"; prev=-L; p=$func_stripname_result ;;\n         -R*) func_stripname_cnf '-R' '' \"$p\"; prev=-R; p=$func_stripname_result ;;\n         -l*) func_stripname_cnf '-l' '' \"$p\"; prev=-l; p=$func_stripname_result ;;\n         esac\n       fi\n       case $p in\n       =*) func_stripname_cnf '=' '' \"$p\"; p=$lt_sysroot$func_stripname_result ;;\n       esac\n       if test no = \"$pre_test_object_deps_done\"; then\n\t case $prev in\n\t -L | -R)\n\t   # Internal compiler library paths should come after those\n\t   # provided the user.  The postdeps already come after the\n\t   # user supplied libs so there is no need to process them.\n\t   if test -z \"$_LT_TAGVAR(compiler_lib_search_path, $1)\"; then\n\t     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p\n\t   else\n\t     _LT_TAGVAR(compiler_lib_search_path, $1)=\"${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p\"\n\t   fi\n\t   ;;\n\t # The \"-l\" case would never come before the object being\n\t # linked, so don't bother handling this case.\n\t esac\n       else\n\t if test -z \"$_LT_TAGVAR(postdeps, $1)\"; then\n\t   _LT_TAGVAR(postdeps, $1)=$prev$p\n\t else\n\t   _LT_TAGVAR(postdeps, $1)=\"${_LT_TAGVAR(postdeps, $1)} $prev$p\"\n\t fi\n       fi\n       prev=\n       ;;\n\n    *.lto.$objext) ;; # Ignore GCC LTO objects\n    *.$objext)\n       # This assumes that the test object file only shows up\n       # once in the compiler output.\n       if test \"$p\" = \"conftest.$objext\"; then\n\t pre_test_object_deps_done=yes\n\t continue\n       fi\n\n       if test no = \"$pre_test_object_deps_done\"; then\n\t if test -z \"$_LT_TAGVAR(predep_objects, $1)\"; then\n\t   _LT_TAGVAR(predep_objects, $1)=$p\n\t else\n\t   _LT_TAGVAR(predep_objects, $1)=\"$_LT_TAGVAR(predep_objects, $1) $p\"\n\t fi\n       else\n\t if test -z \"$_LT_TAGVAR(postdep_objects, $1)\"; then\n\t   _LT_TAGVAR(postdep_objects, $1)=$p\n\t else\n\t   _LT_TAGVAR(postdep_objects, $1)=\"$_LT_TAGVAR(postdep_objects, $1) $p\"\n\t fi\n       fi\n       ;;\n\n    *) ;; # Ignore the rest.\n\n    esac\n  done\n\n  # Clean up.\n  rm -f a.out a.exe\nelse\n  echo \"libtool.m4: error: problem compiling $1 test program\"\nfi\n\n$RM -f confest.$objext\nCFLAGS=$_lt_libdeps_save_CFLAGS\n\n# PORTME: override above test on systems where it is broken\nm4_if([$1], [CXX],\n[case $host_os in\ninterix[[3-9]]*)\n  # Interix 3.5 installs completely hosed .la files for C++, so rather than\n  # hack all around it, let's just trust \"g++\" to DTRT.\n  _LT_TAGVAR(predep_objects,$1)=\n  _LT_TAGVAR(postdep_objects,$1)=\n  _LT_TAGVAR(postdeps,$1)=\n  ;;\nesac\n])\n\ncase \" $_LT_TAGVAR(postdeps, $1) \" in\n*\" -lc \"*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;\nesac\n _LT_TAGVAR(compiler_lib_search_dirs, $1)=\nif test -n \"${_LT_TAGVAR(compiler_lib_search_path, $1)}\"; then\n _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo \" ${_LT_TAGVAR(compiler_lib_search_path, $1)}\" | $SED -e 's! -L! !g' -e 's!^ !!'`\nfi\n_LT_TAGDECL([], [compiler_lib_search_dirs], [1],\n    [The directories searched by this compiler when creating a shared library])\n_LT_TAGDECL([], [predep_objects], [1],\n    [Dependencies to place before and after the objects being linked to\n    create a shared library])\n_LT_TAGDECL([], [postdep_objects], [1])\n_LT_TAGDECL([], [predeps], [1])\n_LT_TAGDECL([], [postdeps], [1])\n_LT_TAGDECL([], [compiler_lib_search_path], [1],\n    [The library search path used internally by the compiler when linking\n    a shared library])\n])# _LT_SYS_HIDDEN_LIBDEPS\n\n\n# _LT_LANG_F77_CONFIG([TAG])\n# --------------------------\n# Ensure that the configuration variables for a Fortran 77 compiler are\n# suitably defined.  These variables are subsequently used by _LT_CONFIG\n# to write the compiler configuration to 'libtool'.\nm4_defun([_LT_LANG_F77_CONFIG],\n[AC_LANG_PUSH(Fortran 77)\nif test -z \"$F77\" || test no = \"$F77\"; then\n  _lt_disable_F77=yes\nfi\n\n_LT_TAGVAR(archive_cmds_need_lc, $1)=no\n_LT_TAGVAR(allow_undefined_flag, $1)=\n_LT_TAGVAR(always_export_symbols, $1)=no\n_LT_TAGVAR(archive_expsym_cmds, $1)=\n_LT_TAGVAR(export_dynamic_flag_spec, $1)=\n_LT_TAGVAR(hardcode_direct, $1)=no\n_LT_TAGVAR(hardcode_direct_absolute, $1)=no\n_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=\n_LT_TAGVAR(hardcode_libdir_separator, $1)=\n_LT_TAGVAR(hardcode_minus_L, $1)=no\n_LT_TAGVAR(hardcode_automatic, $1)=no\n_LT_TAGVAR(inherit_rpath, $1)=no\n_LT_TAGVAR(module_cmds, $1)=\n_LT_TAGVAR(module_expsym_cmds, $1)=\n_LT_TAGVAR(link_all_deplibs, $1)=unknown\n_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds\n_LT_TAGVAR(reload_flag, $1)=$reload_flag\n_LT_TAGVAR(reload_cmds, $1)=$reload_cmds\n_LT_TAGVAR(no_undefined_flag, $1)=\n_LT_TAGVAR(whole_archive_flag_spec, $1)=\n_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no\n\n# Source file extension for f77 test sources.\nac_ext=f\n\n# Object file extension for compiled f77 test sources.\nobjext=o\n_LT_TAGVAR(objext, $1)=$objext\n\n# No sense in running all these tests if we already determined that\n# the F77 compiler isn't working.  Some variables (like enable_shared)\n# are currently assumed to apply to all compilers on this platform,\n# and will be corrupted by setting them based on a non-working compiler.\nif test yes != \"$_lt_disable_F77\"; then\n  # Code to be used in simple compile tests\n  lt_simple_compile_test_code=\"\\\n      subroutine t\n      return\n      end\n\"\n\n  # Code to be used in simple link tests\n  lt_simple_link_test_code=\"\\\n      program t\n      end\n\"\n\n  # ltmain only uses $CC for tagged configurations so make sure $CC is set.\n  _LT_TAG_COMPILER\n\n  # save warnings/boilerplate of simple test code\n  _LT_COMPILER_BOILERPLATE\n  _LT_LINKER_BOILERPLATE\n\n  # Allow CC to be a program name with arguments.\n  lt_save_CC=$CC\n  lt_save_GCC=$GCC\n  lt_save_CFLAGS=$CFLAGS\n  CC=${F77-\"f77\"}\n  CFLAGS=$FFLAGS\n  compiler=$CC\n  _LT_TAGVAR(compiler, $1)=$CC\n  _LT_CC_BASENAME([$compiler])\n  GCC=$G77\n  if test -n \"$compiler\"; then\n    AC_MSG_CHECKING([if libtool supports shared libraries])\n    AC_MSG_RESULT([$can_build_shared])\n\n    AC_MSG_CHECKING([whether to build shared libraries])\n    test no = \"$can_build_shared\" && enable_shared=no\n\n    # On AIX, shared libraries and static libraries use the same namespace, and\n    # are all built from PIC.\n    case $host_os in\n      aix3*)\n        test yes = \"$enable_shared\" && enable_static=no\n        if test -n \"$RANLIB\"; then\n          archive_cmds=\"$archive_cmds~\\$RANLIB \\$lib\"\n          postinstall_cmds='$RANLIB $lib'\n        fi\n        ;;\n      aix[[4-9]]*)\n\tif test ia64 != \"$host_cpu\"; then\n\t  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in\n\t  yes,aix,yes) ;;\t\t# shared object as lib.so file only\n\t  yes,svr4,*) ;;\t\t# shared object as lib.so archive member only\n\t  yes,*) enable_static=no ;;\t# shared object in lib.a archive as well\n\t  esac\n\tfi\n        ;;\n    esac\n    AC_MSG_RESULT([$enable_shared])\n\n    AC_MSG_CHECKING([whether to build static libraries])\n    # Make sure either enable_shared or enable_static is yes.\n    test yes = \"$enable_shared\" || enable_static=yes\n    AC_MSG_RESULT([$enable_static])\n\n    _LT_TAGVAR(GCC, $1)=$G77\n    _LT_TAGVAR(LD, $1)=$LD\n\n    ## CAVEAT EMPTOR:\n    ## There is no encapsulation within the following macros, do not change\n    ## the running order or otherwise move them around unless you know exactly\n    ## what you are doing...\n    _LT_COMPILER_PIC($1)\n    _LT_COMPILER_C_O($1)\n    _LT_COMPILER_FILE_LOCKS($1)\n    _LT_LINKER_SHLIBS($1)\n    _LT_SYS_DYNAMIC_LINKER($1)\n    _LT_LINKER_HARDCODE_LIBPATH($1)\n\n    _LT_CONFIG($1)\n  fi # test -n \"$compiler\"\n\n  GCC=$lt_save_GCC\n  CC=$lt_save_CC\n  CFLAGS=$lt_save_CFLAGS\nfi # test yes != \"$_lt_disable_F77\"\n\nAC_LANG_POP\n])# _LT_LANG_F77_CONFIG\n\n\n# _LT_LANG_FC_CONFIG([TAG])\n# -------------------------\n# Ensure that the configuration variables for a Fortran compiler are\n# suitably defined.  These variables are subsequently used by _LT_CONFIG\n# to write the compiler configuration to 'libtool'.\nm4_defun([_LT_LANG_FC_CONFIG],\n[AC_LANG_PUSH(Fortran)\n\nif test -z \"$FC\" || test no = \"$FC\"; then\n  _lt_disable_FC=yes\nfi\n\n_LT_TAGVAR(archive_cmds_need_lc, $1)=no\n_LT_TAGVAR(allow_undefined_flag, $1)=\n_LT_TAGVAR(always_export_symbols, $1)=no\n_LT_TAGVAR(archive_expsym_cmds, $1)=\n_LT_TAGVAR(export_dynamic_flag_spec, $1)=\n_LT_TAGVAR(hardcode_direct, $1)=no\n_LT_TAGVAR(hardcode_direct_absolute, $1)=no\n_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=\n_LT_TAGVAR(hardcode_libdir_separator, $1)=\n_LT_TAGVAR(hardcode_minus_L, $1)=no\n_LT_TAGVAR(hardcode_automatic, $1)=no\n_LT_TAGVAR(inherit_rpath, $1)=no\n_LT_TAGVAR(module_cmds, $1)=\n_LT_TAGVAR(module_expsym_cmds, $1)=\n_LT_TAGVAR(link_all_deplibs, $1)=unknown\n_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds\n_LT_TAGVAR(reload_flag, $1)=$reload_flag\n_LT_TAGVAR(reload_cmds, $1)=$reload_cmds\n_LT_TAGVAR(no_undefined_flag, $1)=\n_LT_TAGVAR(whole_archive_flag_spec, $1)=\n_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no\n\n# Source file extension for fc test sources.\nac_ext=${ac_fc_srcext-f}\n\n# Object file extension for compiled fc test sources.\nobjext=o\n_LT_TAGVAR(objext, $1)=$objext\n\n# No sense in running all these tests if we already determined that\n# the FC compiler isn't working.  Some variables (like enable_shared)\n# are currently assumed to apply to all compilers on this platform,\n# and will be corrupted by setting them based on a non-working compiler.\nif test yes != \"$_lt_disable_FC\"; then\n  # Code to be used in simple compile tests\n  lt_simple_compile_test_code=\"\\\n      subroutine t\n      return\n      end\n\"\n\n  # Code to be used in simple link tests\n  lt_simple_link_test_code=\"\\\n      program t\n      end\n\"\n\n  # ltmain only uses $CC for tagged configurations so make sure $CC is set.\n  _LT_TAG_COMPILER\n\n  # save warnings/boilerplate of simple test code\n  _LT_COMPILER_BOILERPLATE\n  _LT_LINKER_BOILERPLATE\n\n  # Allow CC to be a program name with arguments.\n  lt_save_CC=$CC\n  lt_save_GCC=$GCC\n  lt_save_CFLAGS=$CFLAGS\n  CC=${FC-\"f95\"}\n  CFLAGS=$FCFLAGS\n  compiler=$CC\n  GCC=$ac_cv_fc_compiler_gnu\n\n  _LT_TAGVAR(compiler, $1)=$CC\n  _LT_CC_BASENAME([$compiler])\n\n  if test -n \"$compiler\"; then\n    AC_MSG_CHECKING([if libtool supports shared libraries])\n    AC_MSG_RESULT([$can_build_shared])\n\n    AC_MSG_CHECKING([whether to build shared libraries])\n    test no = \"$can_build_shared\" && enable_shared=no\n\n    # On AIX, shared libraries and static libraries use the same namespace, and\n    # are all built from PIC.\n    case $host_os in\n      aix3*)\n        test yes = \"$enable_shared\" && enable_static=no\n        if test -n \"$RANLIB\"; then\n          archive_cmds=\"$archive_cmds~\\$RANLIB \\$lib\"\n          postinstall_cmds='$RANLIB $lib'\n        fi\n        ;;\n      aix[[4-9]]*)\n\tif test ia64 != \"$host_cpu\"; then\n\t  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in\n\t  yes,aix,yes) ;;\t\t# shared object as lib.so file only\n\t  yes,svr4,*) ;;\t\t# shared object as lib.so archive member only\n\t  yes,*) enable_static=no ;;\t# shared object in lib.a archive as well\n\t  esac\n\tfi\n        ;;\n    esac\n    AC_MSG_RESULT([$enable_shared])\n\n    AC_MSG_CHECKING([whether to build static libraries])\n    # Make sure either enable_shared or enable_static is yes.\n    test yes = \"$enable_shared\" || enable_static=yes\n    AC_MSG_RESULT([$enable_static])\n\n    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu\n    _LT_TAGVAR(LD, $1)=$LD\n\n    ## CAVEAT EMPTOR:\n    ## There is no encapsulation within the following macros, do not change\n    ## the running order or otherwise move them around unless you know exactly\n    ## what you are doing...\n    _LT_SYS_HIDDEN_LIBDEPS($1)\n    _LT_COMPILER_PIC($1)\n    _LT_COMPILER_C_O($1)\n    _LT_COMPILER_FILE_LOCKS($1)\n    _LT_LINKER_SHLIBS($1)\n    _LT_SYS_DYNAMIC_LINKER($1)\n    _LT_LINKER_HARDCODE_LIBPATH($1)\n\n    _LT_CONFIG($1)\n  fi # test -n \"$compiler\"\n\n  GCC=$lt_save_GCC\n  CC=$lt_save_CC\n  CFLAGS=$lt_save_CFLAGS\nfi # test yes != \"$_lt_disable_FC\"\n\nAC_LANG_POP\n])# _LT_LANG_FC_CONFIG\n\n\n# _LT_LANG_GCJ_CONFIG([TAG])\n# --------------------------\n# Ensure that the configuration variables for the GNU Java Compiler compiler\n# are suitably defined.  These variables are subsequently used by _LT_CONFIG\n# to write the compiler configuration to 'libtool'.\nm4_defun([_LT_LANG_GCJ_CONFIG],\n[AC_REQUIRE([LT_PROG_GCJ])dnl\nAC_LANG_SAVE\n\n# Source file extension for Java test sources.\nac_ext=java\n\n# Object file extension for compiled Java test sources.\nobjext=o\n_LT_TAGVAR(objext, $1)=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"class foo {}\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'\n\n# ltmain only uses $CC for tagged configurations so make sure $CC is set.\n_LT_TAG_COMPILER\n\n# save warnings/boilerplate of simple test code\n_LT_COMPILER_BOILERPLATE\n_LT_LINKER_BOILERPLATE\n\n# Allow CC to be a program name with arguments.\nlt_save_CC=$CC\nlt_save_CFLAGS=$CFLAGS\nlt_save_GCC=$GCC\nGCC=yes\nCC=${GCJ-\"gcj\"}\nCFLAGS=$GCJFLAGS\ncompiler=$CC\n_LT_TAGVAR(compiler, $1)=$CC\n_LT_TAGVAR(LD, $1)=$LD\n_LT_CC_BASENAME([$compiler])\n\n# GCJ did not exist at the time GCC didn't implicitly link libc in.\n_LT_TAGVAR(archive_cmds_need_lc, $1)=no\n\n_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds\n_LT_TAGVAR(reload_flag, $1)=$reload_flag\n_LT_TAGVAR(reload_cmds, $1)=$reload_cmds\n\nif test -n \"$compiler\"; then\n  _LT_COMPILER_NO_RTTI($1)\n  _LT_COMPILER_PIC($1)\n  _LT_COMPILER_C_O($1)\n  _LT_COMPILER_FILE_LOCKS($1)\n  _LT_LINKER_SHLIBS($1)\n  _LT_LINKER_HARDCODE_LIBPATH($1)\n\n  _LT_CONFIG($1)\nfi\n\nAC_LANG_RESTORE\n\nGCC=$lt_save_GCC\nCC=$lt_save_CC\nCFLAGS=$lt_save_CFLAGS\n])# _LT_LANG_GCJ_CONFIG\n\n\n# _LT_LANG_GO_CONFIG([TAG])\n# --------------------------\n# Ensure that the configuration variables for the GNU Go compiler\n# are suitably defined.  These variables are subsequently used by _LT_CONFIG\n# to write the compiler configuration to 'libtool'.\nm4_defun([_LT_LANG_GO_CONFIG],\n[AC_REQUIRE([LT_PROG_GO])dnl\nAC_LANG_SAVE\n\n# Source file extension for Go test sources.\nac_ext=go\n\n# Object file extension for compiled Go test sources.\nobjext=o\n_LT_TAGVAR(objext, $1)=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"package main; func main() { }\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code='package main; func main() { }'\n\n# ltmain only uses $CC for tagged configurations so make sure $CC is set.\n_LT_TAG_COMPILER\n\n# save warnings/boilerplate of simple test code\n_LT_COMPILER_BOILERPLATE\n_LT_LINKER_BOILERPLATE\n\n# Allow CC to be a program name with arguments.\nlt_save_CC=$CC\nlt_save_CFLAGS=$CFLAGS\nlt_save_GCC=$GCC\nGCC=yes\nCC=${GOC-\"gccgo\"}\nCFLAGS=$GOFLAGS\ncompiler=$CC\n_LT_TAGVAR(compiler, $1)=$CC\n_LT_TAGVAR(LD, $1)=$LD\n_LT_CC_BASENAME([$compiler])\n\n# Go did not exist at the time GCC didn't implicitly link libc in.\n_LT_TAGVAR(archive_cmds_need_lc, $1)=no\n\n_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds\n_LT_TAGVAR(reload_flag, $1)=$reload_flag\n_LT_TAGVAR(reload_cmds, $1)=$reload_cmds\n\nif test -n \"$compiler\"; then\n  _LT_COMPILER_NO_RTTI($1)\n  _LT_COMPILER_PIC($1)\n  _LT_COMPILER_C_O($1)\n  _LT_COMPILER_FILE_LOCKS($1)\n  _LT_LINKER_SHLIBS($1)\n  _LT_LINKER_HARDCODE_LIBPATH($1)\n\n  _LT_CONFIG($1)\nfi\n\nAC_LANG_RESTORE\n\nGCC=$lt_save_GCC\nCC=$lt_save_CC\nCFLAGS=$lt_save_CFLAGS\n])# _LT_LANG_GO_CONFIG\n\n\n# _LT_LANG_RC_CONFIG([TAG])\n# -------------------------\n# Ensure that the configuration variables for the Windows resource compiler\n# are suitably defined.  These variables are subsequently used by _LT_CONFIG\n# to write the compiler configuration to 'libtool'.\nm4_defun([_LT_LANG_RC_CONFIG],\n[AC_REQUIRE([LT_PROG_RC])dnl\nAC_LANG_SAVE\n\n# Source file extension for RC test sources.\nac_ext=rc\n\n# Object file extension for compiled RC test sources.\nobjext=o\n_LT_TAGVAR(objext, $1)=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code='sample MENU { MENUITEM \"&Soup\", 100, CHECKED }'\n\n# Code to be used in simple link tests\nlt_simple_link_test_code=$lt_simple_compile_test_code\n\n# ltmain only uses $CC for tagged configurations so make sure $CC is set.\n_LT_TAG_COMPILER\n\n# save warnings/boilerplate of simple test code\n_LT_COMPILER_BOILERPLATE\n_LT_LINKER_BOILERPLATE\n\n# Allow CC to be a program name with arguments.\nlt_save_CC=$CC\nlt_save_CFLAGS=$CFLAGS\nlt_save_GCC=$GCC\nGCC=\nCC=${RC-\"windres\"}\nCFLAGS=\ncompiler=$CC\n_LT_TAGVAR(compiler, $1)=$CC\n_LT_CC_BASENAME([$compiler])\n_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes\n\nif test -n \"$compiler\"; then\n  :\n  _LT_CONFIG($1)\nfi\n\nGCC=$lt_save_GCC\nAC_LANG_RESTORE\nCC=$lt_save_CC\nCFLAGS=$lt_save_CFLAGS\n])# _LT_LANG_RC_CONFIG\n\n\n# LT_PROG_GCJ\n# -----------\nAC_DEFUN([LT_PROG_GCJ],\n[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],\n  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],\n    [AC_CHECK_TOOL(GCJ, gcj,)\n      test set = \"${GCJFLAGS+set}\" || GCJFLAGS=\"-g -O2\"\n      AC_SUBST(GCJFLAGS)])])[]dnl\n])\n\n# Old name:\nAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([LT_AC_PROG_GCJ], [])\n\n\n# LT_PROG_GO\n# ----------\nAC_DEFUN([LT_PROG_GO],\n[AC_CHECK_TOOL(GOC, gccgo,)\n])\n\n\n# LT_PROG_RC\n# ----------\nAC_DEFUN([LT_PROG_RC],\n[AC_CHECK_TOOL(RC, windres,)\n])\n\n# Old name:\nAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([LT_AC_PROG_RC], [])\n\n\n# _LT_DECL_EGREP\n# --------------\n# If we don't have a new enough Autoconf to choose the best grep\n# available, choose the one first in the user's PATH.\nm4_defun([_LT_DECL_EGREP],\n[AC_REQUIRE([AC_PROG_EGREP])dnl\nAC_REQUIRE([AC_PROG_FGREP])dnl\ntest -z \"$GREP\" && GREP=grep\n_LT_DECL([], [GREP], [1], [A grep program that handles long lines])\n_LT_DECL([], [EGREP], [1], [An ERE matcher])\n_LT_DECL([], [FGREP], [1], [A literal string matcher])\ndnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too\nAC_SUBST([GREP])\n])\n\n\n# _LT_DECL_OBJDUMP\n# --------------\n# If we don't have a new enough Autoconf to choose the best objdump\n# available, choose the one first in the user's PATH.\nm4_defun([_LT_DECL_OBJDUMP],\n[AC_CHECK_TOOL(OBJDUMP, objdump, false)\ntest -z \"$OBJDUMP\" && OBJDUMP=objdump\n_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])\nAC_SUBST([OBJDUMP])\n])\n\n# _LT_DECL_DLLTOOL\n# ----------------\n# Ensure DLLTOOL variable is set.\nm4_defun([_LT_DECL_DLLTOOL],\n[AC_CHECK_TOOL(DLLTOOL, dlltool, false)\ntest -z \"$DLLTOOL\" && DLLTOOL=dlltool\n_LT_DECL([], [DLLTOOL], [1], [DLL creation program])\nAC_SUBST([DLLTOOL])\n])\n\n# _LT_DECL_SED\n# ------------\n# Check for a fully-functional sed program, that truncates\n# as few characters as possible.  Prefer GNU sed if found.\nm4_defun([_LT_DECL_SED],\n[AC_PROG_SED\ntest -z \"$SED\" && SED=sed\nXsed=\"$SED -e 1s/^X//\"\n_LT_DECL([], [SED], [1], [A sed program that does not truncate output])\n_LT_DECL([], [Xsed], [\"\\$SED -e 1s/^X//\"],\n    [Sed that helps us avoid accidentally triggering echo(1) options like -n])\n])# _LT_DECL_SED\n\nm4_ifndef([AC_PROG_SED], [\n# NOTE: This macro has been submitted for inclusion into   #\n#  GNU Autoconf as AC_PROG_SED.  When it is available in   #\n#  a released version of Autoconf we should remove this    #\n#  macro and use it instead.                               #\n\nm4_defun([AC_PROG_SED],\n[AC_MSG_CHECKING([for a sed that does not truncate output])\nAC_CACHE_VAL(lt_cv_path_SED,\n[# Loop through the user's path and test for sed and gsed.\n# Then use that list of sed's as ones to test for truncation.\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for lt_ac_prog in sed gsed; do\n    for ac_exec_ext in '' $ac_executable_extensions; do\n      if $as_executable_p \"$as_dir/$lt_ac_prog$ac_exec_ext\"; then\n        lt_ac_sed_list=\"$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext\"\n      fi\n    done\n  done\ndone\nIFS=$as_save_IFS\nlt_ac_max=0\nlt_ac_count=0\n# Add /usr/xpg4/bin/sed as it is typically found on Solaris\n# along with /bin/sed that truncates output.\nfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do\n  test ! -f \"$lt_ac_sed\" && continue\n  cat /dev/null > conftest.in\n  lt_ac_count=0\n  echo $ECHO_N \"0123456789$ECHO_C\" >conftest.in\n  # Check for GNU sed and select it if it is found.\n  if \"$lt_ac_sed\" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then\n    lt_cv_path_SED=$lt_ac_sed\n    break\n  fi\n  while true; do\n    cat conftest.in conftest.in >conftest.tmp\n    mv conftest.tmp conftest.in\n    cp conftest.in conftest.nl\n    echo >>conftest.nl\n    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break\n    cmp -s conftest.out conftest.nl || break\n    # 10000 chars as input seems more than enough\n    test 10 -lt \"$lt_ac_count\" && break\n    lt_ac_count=`expr $lt_ac_count + 1`\n    if test \"$lt_ac_count\" -gt \"$lt_ac_max\"; then\n      lt_ac_max=$lt_ac_count\n      lt_cv_path_SED=$lt_ac_sed\n    fi\n  done\ndone\n])\nSED=$lt_cv_path_SED\nAC_SUBST([SED])\nAC_MSG_RESULT([$SED])\n])#AC_PROG_SED\n])#m4_ifndef\n\n# Old name:\nAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([LT_AC_PROG_SED], [])\n\n\n# _LT_CHECK_SHELL_FEATURES\n# ------------------------\n# Find out whether the shell is Bourne or XSI compatible,\n# or has some other useful features.\nm4_defun([_LT_CHECK_SHELL_FEATURES],\n[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then\n  lt_unset=unset\nelse\n  lt_unset=false\nfi\n_LT_DECL([], [lt_unset], [0], [whether the shell understands \"unset\"])dnl\n\n# test EBCDIC or ASCII\ncase `echo X|tr X '\\101'` in\n A) # ASCII based system\n    # \\n is not interpreted correctly by Solaris 8 /usr/ucb/tr\n  lt_SP2NL='tr \\040 \\012'\n  lt_NL2SP='tr \\015\\012 \\040\\040'\n  ;;\n *) # EBCDIC based system\n  lt_SP2NL='tr \\100 \\n'\n  lt_NL2SP='tr \\r\\n \\100\\100'\n  ;;\nesac\n_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl\n_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl\n])# _LT_CHECK_SHELL_FEATURES\n\n\n# _LT_PATH_CONVERSION_FUNCTIONS\n# -----------------------------\n# Determine what file name conversion functions should be used by\n# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed\n# for certain cross-compile configurations and native mingw.\nm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],\n[AC_REQUIRE([AC_CANONICAL_HOST])dnl\nAC_REQUIRE([AC_CANONICAL_BUILD])dnl\nAC_MSG_CHECKING([how to convert $build file names to $host format])\nAC_CACHE_VAL(lt_cv_to_host_file_cmd,\n[case $host in\n  *-*-mingw* )\n    case $build in\n      *-*-mingw* ) # actually msys\n        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32\n        ;;\n      *-*-cygwin* )\n        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32\n        ;;\n      * ) # otherwise, assume *nix\n        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32\n        ;;\n    esac\n    ;;\n  *-*-cygwin* )\n    case $build in\n      *-*-mingw* ) # actually msys\n        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin\n        ;;\n      *-*-cygwin* )\n        lt_cv_to_host_file_cmd=func_convert_file_noop\n        ;;\n      * ) # otherwise, assume *nix\n        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin\n        ;;\n    esac\n    ;;\n  * ) # unhandled hosts (and \"normal\" native builds)\n    lt_cv_to_host_file_cmd=func_convert_file_noop\n    ;;\nesac\n])\nto_host_file_cmd=$lt_cv_to_host_file_cmd\nAC_MSG_RESULT([$lt_cv_to_host_file_cmd])\n_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],\n         [0], [convert $build file names to $host format])dnl\n\nAC_MSG_CHECKING([how to convert $build file names to toolchain format])\nAC_CACHE_VAL(lt_cv_to_tool_file_cmd,\n[#assume ordinary cross tools, or native build.\nlt_cv_to_tool_file_cmd=func_convert_file_noop\ncase $host in\n  *-*-mingw* )\n    case $build in\n      *-*-mingw* ) # actually msys\n        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32\n        ;;\n    esac\n    ;;\nesac\n])\nto_tool_file_cmd=$lt_cv_to_tool_file_cmd\nAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])\n_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],\n         [0], [convert $build files to toolchain format])dnl\n])# _LT_PATH_CONVERSION_FUNCTIONS\n\n# Helper functions for option handling.                    -*- Autoconf -*-\n#\n#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software\n#   Foundation, Inc.\n#   Written by Gary V. Vaughan, 2004\n#\n# This file is free software; the Free Software Foundation gives\n# unlimited permission to copy and/or distribute it, with or without\n# modifications, as long as this notice is preserved.\n\n# serial 8 ltoptions.m4\n\n# This is to help aclocal find these macros, as it can't see m4_define.\nAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])\n\n\n# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)\n# ------------------------------------------\nm4_define([_LT_MANGLE_OPTION],\n[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])\n\n\n# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)\n# ---------------------------------------\n# Set option OPTION-NAME for macro MACRO-NAME, and if there is a\n# matching handler defined, dispatch to it.  Other OPTION-NAMEs are\n# saved as a flag.\nm4_define([_LT_SET_OPTION],\n[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl\nm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),\n        _LT_MANGLE_DEFUN([$1], [$2]),\n    [m4_warning([Unknown $1 option '$2'])])[]dnl\n])\n\n\n# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])\n# ------------------------------------------------------------\n# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.\nm4_define([_LT_IF_OPTION],\n[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])\n\n\n# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)\n# -------------------------------------------------------\n# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME\n# are set.\nm4_define([_LT_UNLESS_OPTIONS],\n[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),\n\t    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),\n\t\t      [m4_define([$0_found])])])[]dnl\nm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3\n])[]dnl\n])\n\n\n# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)\n# ----------------------------------------\n# OPTION-LIST is a space-separated list of Libtool options associated\n# with MACRO-NAME.  If any OPTION has a matching handler declared with\n# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about\n# the unknown option and exit.\nm4_defun([_LT_SET_OPTIONS],\n[# Set options\nm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),\n    [_LT_SET_OPTION([$1], _LT_Option)])\n\nm4_if([$1],[LT_INIT],[\n  dnl\n  dnl Simply set some default values (i.e off) if boolean options were not\n  dnl specified:\n  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no\n  ])\n  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no\n  ])\n  dnl\n  dnl If no reference was made to various pairs of opposing options, then\n  dnl we run the default mode handler for the pair.  For example, if neither\n  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared\n  dnl archives by default:\n  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])\n  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])\n  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])\n  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],\n\t\t   [_LT_ENABLE_FAST_INSTALL])\n  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],\n\t\t   [_LT_WITH_AIX_SONAME([aix])])\n  ])\n])# _LT_SET_OPTIONS\n\n\n\n# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)\n# -----------------------------------------\nm4_define([_LT_MANGLE_DEFUN],\n[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])\n\n\n# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)\n# -----------------------------------------------\nm4_define([LT_OPTION_DEFINE],\n[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl\n])# LT_OPTION_DEFINE\n\n\n# dlopen\n# ------\nLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes\n])\n\nAU_DEFUN([AC_LIBTOOL_DLOPEN],\n[_LT_SET_OPTION([LT_INIT], [dlopen])\nAC_DIAGNOSE([obsolete],\n[$0: Remove this warning and the call to _LT_SET_OPTION when you\nput the 'dlopen' option into LT_INIT's first parameter.])\n])\n\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])\n\n\n# win32-dll\n# ---------\n# Declare package support for building win32 dll's.\nLT_OPTION_DEFINE([LT_INIT], [win32-dll],\n[enable_win32_dll=yes\n\ncase $host in\n*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)\n  AC_CHECK_TOOL(AS, as, false)\n  AC_CHECK_TOOL(DLLTOOL, dlltool, false)\n  AC_CHECK_TOOL(OBJDUMP, objdump, false)\n  ;;\nesac\n\ntest -z \"$AS\" && AS=as\n_LT_DECL([], [AS],      [1], [Assembler program])dnl\n\ntest -z \"$DLLTOOL\" && DLLTOOL=dlltool\n_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl\n\ntest -z \"$OBJDUMP\" && OBJDUMP=objdump\n_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl\n])# win32-dll\n\nAU_DEFUN([AC_LIBTOOL_WIN32_DLL],\n[AC_REQUIRE([AC_CANONICAL_HOST])dnl\n_LT_SET_OPTION([LT_INIT], [win32-dll])\nAC_DIAGNOSE([obsolete],\n[$0: Remove this warning and the call to _LT_SET_OPTION when you\nput the 'win32-dll' option into LT_INIT's first parameter.])\n])\n\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])\n\n\n# _LT_ENABLE_SHARED([DEFAULT])\n# ----------------------------\n# implement the --enable-shared flag, and supports the 'shared' and\n# 'disable-shared' LT_INIT options.\n# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.\nm4_define([_LT_ENABLE_SHARED],\n[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl\nAC_ARG_ENABLE([shared],\n    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],\n\t[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],\n    [p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_shared=yes ;;\n    no) enable_shared=no ;;\n    *)\n      enable_shared=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for pkg in $enableval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_shared=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac],\n    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)\n\n    _LT_DECL([build_libtool_libs], [enable_shared], [0],\n\t[Whether or not to build shared libraries])\n])# _LT_ENABLE_SHARED\n\nLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])\nLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])\n\n# Old names:\nAC_DEFUN([AC_ENABLE_SHARED],\n[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])\n])\n\nAC_DEFUN([AC_DISABLE_SHARED],\n[_LT_SET_OPTION([LT_INIT], [disable-shared])\n])\n\nAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])\nAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])\n\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AM_ENABLE_SHARED], [])\ndnl AC_DEFUN([AM_DISABLE_SHARED], [])\n\n\n\n# _LT_ENABLE_STATIC([DEFAULT])\n# ----------------------------\n# implement the --enable-static flag, and support the 'static' and\n# 'disable-static' LT_INIT options.\n# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.\nm4_define([_LT_ENABLE_STATIC],\n[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl\nAC_ARG_ENABLE([static],\n    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],\n\t[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],\n    [p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_static=yes ;;\n    no) enable_static=no ;;\n    *)\n     enable_static=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for pkg in $enableval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_static=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac],\n    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)\n\n    _LT_DECL([build_old_libs], [enable_static], [0],\n\t[Whether or not to build static libraries])\n])# _LT_ENABLE_STATIC\n\nLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])\nLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])\n\n# Old names:\nAC_DEFUN([AC_ENABLE_STATIC],\n[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])\n])\n\nAC_DEFUN([AC_DISABLE_STATIC],\n[_LT_SET_OPTION([LT_INIT], [disable-static])\n])\n\nAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])\nAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])\n\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AM_ENABLE_STATIC], [])\ndnl AC_DEFUN([AM_DISABLE_STATIC], [])\n\n\n\n# _LT_ENABLE_FAST_INSTALL([DEFAULT])\n# ----------------------------------\n# implement the --enable-fast-install flag, and support the 'fast-install'\n# and 'disable-fast-install' LT_INIT options.\n# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.\nm4_define([_LT_ENABLE_FAST_INSTALL],\n[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl\nAC_ARG_ENABLE([fast-install],\n    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],\n    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],\n    [p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_fast_install=yes ;;\n    no) enable_fast_install=no ;;\n    *)\n      enable_fast_install=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for pkg in $enableval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_fast_install=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac],\n    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)\n\n_LT_DECL([fast_install], [enable_fast_install], [0],\n\t [Whether or not to optimize for fast installation])dnl\n])# _LT_ENABLE_FAST_INSTALL\n\nLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])\nLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])\n\n# Old names:\nAU_DEFUN([AC_ENABLE_FAST_INSTALL],\n[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])\nAC_DIAGNOSE([obsolete],\n[$0: Remove this warning and the call to _LT_SET_OPTION when you put\nthe 'fast-install' option into LT_INIT's first parameter.])\n])\n\nAU_DEFUN([AC_DISABLE_FAST_INSTALL],\n[_LT_SET_OPTION([LT_INIT], [disable-fast-install])\nAC_DIAGNOSE([obsolete],\n[$0: Remove this warning and the call to _LT_SET_OPTION when you put\nthe 'disable-fast-install' option into LT_INIT's first parameter.])\n])\n\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])\ndnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])\n\n\n# _LT_WITH_AIX_SONAME([DEFAULT])\n# ----------------------------------\n# implement the --with-aix-soname flag, and support the `aix-soname=aix'\n# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT\n# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.\nm4_define([_LT_WITH_AIX_SONAME],\n[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl\nshared_archive_member_spec=\ncase $host,$enable_shared in\npower*-*-aix[[5-9]]*,yes)\n  AC_MSG_CHECKING([which variant of shared library versioning to provide])\n  AC_ARG_WITH([aix-soname],\n    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],\n      [shared library versioning (aka \"SONAME\") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],\n    [case $withval in\n    aix|svr4|both)\n      ;;\n    *)\n      AC_MSG_ERROR([Unknown argument to --with-aix-soname])\n      ;;\n    esac\n    lt_cv_with_aix_soname=$with_aix_soname],\n    [AC_CACHE_VAL([lt_cv_with_aix_soname],\n      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)\n    with_aix_soname=$lt_cv_with_aix_soname])\n  AC_MSG_RESULT([$with_aix_soname])\n  if test aix != \"$with_aix_soname\"; then\n    # For the AIX way of multilib, we name the shared archive member\n    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',\n    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.\n    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,\n    # the AIX toolchain works better with OBJECT_MODE set (default 32).\n    if test 64 = \"${OBJECT_MODE-32}\"; then\n      shared_archive_member_spec=shr_64\n    else\n      shared_archive_member_spec=shr\n    fi\n  fi\n  ;;\n*)\n  with_aix_soname=aix\n  ;;\nesac\n\n_LT_DECL([], [shared_archive_member_spec], [0],\n    [Shared archive member basename, for filename based shared library versioning on AIX])dnl\n])# _LT_WITH_AIX_SONAME\n\nLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])\nLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])\nLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])\n\n\n# _LT_WITH_PIC([MODE])\n# --------------------\n# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'\n# LT_INIT options.\n# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.\nm4_define([_LT_WITH_PIC],\n[AC_ARG_WITH([pic],\n    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],\n\t[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],\n    [lt_p=${PACKAGE-default}\n    case $withval in\n    yes|no) pic_mode=$withval ;;\n    *)\n      pic_mode=default\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for lt_pkg in $withval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$lt_pkg\" = \"X$lt_p\"; then\n\t  pic_mode=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac],\n    [pic_mode=m4_default([$1], [default])])\n\n_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl\n])# _LT_WITH_PIC\n\nLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])\nLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])\n\n# Old name:\nAU_DEFUN([AC_LIBTOOL_PICMODE],\n[_LT_SET_OPTION([LT_INIT], [pic-only])\nAC_DIAGNOSE([obsolete],\n[$0: Remove this warning and the call to _LT_SET_OPTION when you\nput the 'pic-only' option into LT_INIT's first parameter.])\n])\n\ndnl aclocal-1.4 backwards compatibility:\ndnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])\n\n\nm4_define([_LTDL_MODE], [])\nLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],\n\t\t [m4_define([_LTDL_MODE], [nonrecursive])])\nLT_OPTION_DEFINE([LTDL_INIT], [recursive],\n\t\t [m4_define([_LTDL_MODE], [recursive])])\nLT_OPTION_DEFINE([LTDL_INIT], [subproject],\n\t\t [m4_define([_LTDL_MODE], [subproject])])\n\nm4_define([_LTDL_TYPE], [])\nLT_OPTION_DEFINE([LTDL_INIT], [installable],\n\t\t [m4_define([_LTDL_TYPE], [installable])])\nLT_OPTION_DEFINE([LTDL_INIT], [convenience],\n\t\t [m4_define([_LTDL_TYPE], [convenience])])\n\n# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-\n#\n# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software\n# Foundation, Inc.\n# Written by Gary V. Vaughan, 2004\n#\n# This file is free software; the Free Software Foundation gives\n# unlimited permission to copy and/or distribute it, with or without\n# modifications, as long as this notice is preserved.\n\n# serial 6 ltsugar.m4\n\n# This is to help aclocal find these macros, as it can't see m4_define.\nAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])\n\n\n# lt_join(SEP, ARG1, [ARG2...])\n# -----------------------------\n# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their\n# associated separator.\n# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier\n# versions in m4sugar had bugs.\nm4_define([lt_join],\n[m4_if([$#], [1], [],\n       [$#], [2], [[$2]],\n       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])\nm4_define([_lt_join],\n[m4_if([$#$2], [2], [],\n       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])\n\n\n# lt_car(LIST)\n# lt_cdr(LIST)\n# ------------\n# Manipulate m4 lists.\n# These macros are necessary as long as will still need to support\n# Autoconf-2.59, which quotes differently.\nm4_define([lt_car], [[$1]])\nm4_define([lt_cdr],\n[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],\n       [$#], 1, [],\n       [m4_dquote(m4_shift($@))])])\nm4_define([lt_unquote], $1)\n\n\n# lt_append(MACRO-NAME, STRING, [SEPARATOR])\n# ------------------------------------------\n# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.\n# Note that neither SEPARATOR nor STRING are expanded; they are appended\n# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).\n# No SEPARATOR is output if MACRO-NAME was previously undefined (different\n# than defined and empty).\n#\n# This macro is needed until we can rely on Autoconf 2.62, since earlier\n# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.\nm4_define([lt_append],\n[m4_define([$1],\n\t   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])\n\n\n\n# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])\n# ----------------------------------------------------------\n# Produce a SEP delimited list of all paired combinations of elements of\n# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list\n# has the form PREFIXmINFIXSUFFIXn.\n# Needed until we can rely on m4_combine added in Autoconf 2.62.\nm4_define([lt_combine],\n[m4_if(m4_eval([$# > 3]), [1],\n       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl\n[[m4_foreach([_Lt_prefix], [$2],\n\t     [m4_foreach([_Lt_suffix],\n\t\t]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,\n\t[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])\n\n\n# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])\n# -----------------------------------------------------------------------\n# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited\n# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.\nm4_define([lt_if_append_uniq],\n[m4_ifdef([$1],\n\t  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],\n\t\t [lt_append([$1], [$2], [$3])$4],\n\t\t [$5])],\n\t  [lt_append([$1], [$2], [$3])$4])])\n\n\n# lt_dict_add(DICT, KEY, VALUE)\n# -----------------------------\nm4_define([lt_dict_add],\n[m4_define([$1($2)], [$3])])\n\n\n# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)\n# --------------------------------------------\nm4_define([lt_dict_add_subkey],\n[m4_define([$1($2:$3)], [$4])])\n\n\n# lt_dict_fetch(DICT, KEY, [SUBKEY])\n# ----------------------------------\nm4_define([lt_dict_fetch],\n[m4_ifval([$3],\n\tm4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),\n    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])\n\n\n# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])\n# -----------------------------------------------------------------\nm4_define([lt_if_dict_fetch],\n[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],\n\t[$5],\n    [$6])])\n\n\n# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])\n# --------------------------------------------------------------\nm4_define([lt_dict_filter],\n[m4_if([$5], [], [],\n  [lt_join(m4_quote(m4_default([$4], [[, ]])),\n           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),\n\t\t      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl\n])\n\n# ltversion.m4 -- version numbers\t\t\t-*- Autoconf -*-\n#\n#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.\n#   Written by Scott James Remnant, 2004\n#\n# This file is free software; the Free Software Foundation gives\n# unlimited permission to copy and/or distribute it, with or without\n# modifications, as long as this notice is preserved.\n\n# @configure_input@\n\n# serial 4179 ltversion.m4\n# This file is part of GNU Libtool\n\nm4_define([LT_PACKAGE_VERSION], [2.4.6])\nm4_define([LT_PACKAGE_REVISION], [2.4.6])\n\nAC_DEFUN([LTVERSION_VERSION],\n[macro_version='2.4.6'\nmacro_revision='2.4.6'\n_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])\n_LT_DECL(, macro_revision, 0)\n])\n\n# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-\n#\n#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software\n#   Foundation, Inc.\n#   Written by Scott James Remnant, 2004.\n#\n# This file is free software; the Free Software Foundation gives\n# unlimited permission to copy and/or distribute it, with or without\n# modifications, as long as this notice is preserved.\n\n# serial 5 lt~obsolete.m4\n\n# These exist entirely to fool aclocal when bootstrapping libtool.\n#\n# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),\n# which have later been changed to m4_define as they aren't part of the\n# exported API, or moved to Autoconf or Automake where they belong.\n#\n# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN\n# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us\n# using a macro with the same name in our local m4/libtool.m4 it'll\n# pull the old libtool.m4 in (it doesn't see our shiny new m4_define\n# and doesn't know about Autoconf macros at all.)\n#\n# So we provide this file, which has a silly filename so it's always\n# included after everything else.  This provides aclocal with the\n# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything\n# because those macros already exist, or will be overwritten later.\n# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.\n#\n# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.\n# Yes, that means every name once taken will need to remain here until\n# we give up compatibility with versions before 1.7, at which point\n# we need to keep only those names which we still refer to.\n\n# This is to help aclocal find these macros, as it can't see m4_define.\nAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])\n\nm4_ifndef([AC_LIBTOOL_LINKER_OPTION],\t[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])\nm4_ifndef([AC_PROG_EGREP],\t\t[AC_DEFUN([AC_PROG_EGREP])])\nm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],\t[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])\nm4_ifndef([_LT_AC_SHELL_INIT],\t\t[AC_DEFUN([_LT_AC_SHELL_INIT])])\nm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],\t[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])\nm4_ifndef([_LT_PROG_LTMAIN],\t\t[AC_DEFUN([_LT_PROG_LTMAIN])])\nm4_ifndef([_LT_AC_TAGVAR],\t\t[AC_DEFUN([_LT_AC_TAGVAR])])\nm4_ifndef([AC_LTDL_ENABLE_INSTALL],\t[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])\nm4_ifndef([AC_LTDL_PREOPEN],\t\t[AC_DEFUN([AC_LTDL_PREOPEN])])\nm4_ifndef([_LT_AC_SYS_COMPILER],\t[AC_DEFUN([_LT_AC_SYS_COMPILER])])\nm4_ifndef([_LT_AC_LOCK],\t\t[AC_DEFUN([_LT_AC_LOCK])])\nm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],\t[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])\nm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],\t[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])\nm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],\t[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])\nm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])\nm4_ifndef([AC_LIBTOOL_OBJDIR],\t\t[AC_DEFUN([AC_LIBTOOL_OBJDIR])])\nm4_ifndef([AC_LTDL_OBJDIR],\t\t[AC_DEFUN([AC_LTDL_OBJDIR])])\nm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])\nm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],\t[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])\nm4_ifndef([AC_PATH_MAGIC],\t\t[AC_DEFUN([AC_PATH_MAGIC])])\nm4_ifndef([AC_PROG_LD_GNU],\t\t[AC_DEFUN([AC_PROG_LD_GNU])])\nm4_ifndef([AC_PROG_LD_RELOAD_FLAG],\t[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])\nm4_ifndef([AC_DEPLIBS_CHECK_METHOD],\t[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])\nm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])\nm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])\nm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])\nm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],\t[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])\nm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],\t[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])\nm4_ifndef([LT_AC_PROG_EGREP],\t\t[AC_DEFUN([LT_AC_PROG_EGREP])])\nm4_ifndef([LT_AC_PROG_SED],\t\t[AC_DEFUN([LT_AC_PROG_SED])])\nm4_ifndef([_LT_CC_BASENAME],\t\t[AC_DEFUN([_LT_CC_BASENAME])])\nm4_ifndef([_LT_COMPILER_BOILERPLATE],\t[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])\nm4_ifndef([_LT_LINKER_BOILERPLATE],\t[AC_DEFUN([_LT_LINKER_BOILERPLATE])])\nm4_ifndef([_AC_PROG_LIBTOOL],\t\t[AC_DEFUN([_AC_PROG_LIBTOOL])])\nm4_ifndef([AC_LIBTOOL_SETUP],\t\t[AC_DEFUN([AC_LIBTOOL_SETUP])])\nm4_ifndef([_LT_AC_CHECK_DLFCN],\t\t[AC_DEFUN([_LT_AC_CHECK_DLFCN])])\nm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],\t[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])\nm4_ifndef([_LT_AC_TAGCONFIG],\t\t[AC_DEFUN([_LT_AC_TAGCONFIG])])\nm4_ifndef([AC_DISABLE_FAST_INSTALL],\t[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])\nm4_ifndef([_LT_AC_LANG_CXX],\t\t[AC_DEFUN([_LT_AC_LANG_CXX])])\nm4_ifndef([_LT_AC_LANG_F77],\t\t[AC_DEFUN([_LT_AC_LANG_F77])])\nm4_ifndef([_LT_AC_LANG_GCJ],\t\t[AC_DEFUN([_LT_AC_LANG_GCJ])])\nm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],\t[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])\nm4_ifndef([_LT_AC_LANG_C_CONFIG],\t[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])\nm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],\t[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])\nm4_ifndef([_LT_AC_LANG_CXX_CONFIG],\t[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])\nm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],\t[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])\nm4_ifndef([_LT_AC_LANG_F77_CONFIG],\t[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])\nm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],\t[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])\nm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],\t[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])\nm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],\t[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])\nm4_ifndef([_LT_AC_LANG_RC_CONFIG],\t[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])\nm4_ifndef([AC_LIBTOOL_CONFIG],\t\t[AC_DEFUN([AC_LIBTOOL_CONFIG])])\nm4_ifndef([_LT_AC_FILE_LTDLL_C],\t[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])\nm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],\t[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])\nm4_ifndef([_LT_AC_PROG_CXXCPP],\t\t[AC_DEFUN([_LT_AC_PROG_CXXCPP])])\nm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],\t[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])\nm4_ifndef([_LT_PROG_ECHO_BACKSLASH],\t[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])\nm4_ifndef([_LT_PROG_F77],\t\t[AC_DEFUN([_LT_PROG_F77])])\nm4_ifndef([_LT_PROG_FC],\t\t[AC_DEFUN([_LT_PROG_FC])])\nm4_ifndef([_LT_PROG_CXX],\t\t[AC_DEFUN([_LT_PROG_CXX])])\n\n# Copyright (C) 2002-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_AUTOMAKE_VERSION(VERSION)\n# ----------------------------\n# Automake X.Y traces this macro to ensure aclocal.m4 has been\n# generated from the m4 files accompanying Automake X.Y.\n# (This private macro should not be called outside this file.)\nAC_DEFUN([AM_AUTOMAKE_VERSION],\n[am__api_version='1.15'\ndnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to\ndnl require some minimum version.  Point them to the right macro.\nm4_if([$1], [1.15], [],\n      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl\n])\n\n# _AM_AUTOCONF_VERSION(VERSION)\n# -----------------------------\n# aclocal traces this macro to find the Autoconf version.\n# This is a private macro too.  Using m4_define simplifies\n# the logic in aclocal, which can simply ignore this definition.\nm4_define([_AM_AUTOCONF_VERSION], [])\n\n# AM_SET_CURRENT_AUTOMAKE_VERSION\n# -------------------------------\n# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.\n# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.\nAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],\n[AM_AUTOMAKE_VERSION([1.15])dnl\nm4_ifndef([AC_AUTOCONF_VERSION],\n  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl\n_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])\n\n# Copyright (C) 2011-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_PROG_AR([ACT-IF-FAIL])\n# -------------------------\n# Try to determine the archiver interface, and trigger the ar-lib wrapper\n# if it is needed.  If the detection of archiver interface fails, run\n# ACT-IF-FAIL (default is to abort configure with a proper error message).\nAC_DEFUN([AM_PROG_AR],\n[AC_BEFORE([$0], [LT_INIT])dnl\nAC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl\nAC_REQUIRE([AM_AUX_DIR_EXPAND])dnl\nAC_REQUIRE_AUX_FILE([ar-lib])dnl\nAC_CHECK_TOOLS([AR], [ar lib \"link -lib\"], [false])\n: ${AR=ar}\n\nAC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],\n  [AC_LANG_PUSH([C])\n   am_cv_ar_interface=ar\n   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],\n     [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'\n      AC_TRY_EVAL([am_ar_try])\n      if test \"$ac_status\" -eq 0; then\n        am_cv_ar_interface=ar\n      else\n        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'\n        AC_TRY_EVAL([am_ar_try])\n        if test \"$ac_status\" -eq 0; then\n          am_cv_ar_interface=lib\n        else\n          am_cv_ar_interface=unknown\n        fi\n      fi\n      rm -f conftest.lib libconftest.a\n     ])\n   AC_LANG_POP([C])])\n\ncase $am_cv_ar_interface in\nar)\n  ;;\nlib)\n  # Microsoft lib, so override with the ar-lib wrapper script.\n  # FIXME: It is wrong to rewrite AR.\n  # But if we don't then we get into trouble of one sort or another.\n  # A longer-term fix would be to have automake use am__AR in this case,\n  # and then we could set am__AR=\"$am_aux_dir/ar-lib \\$(AR)\" or something\n  # similar.\n  AR=\"$am_aux_dir/ar-lib $AR\"\n  ;;\nunknown)\n  m4_default([$1],\n             [AC_MSG_ERROR([could not determine $AR interface])])\n  ;;\nesac\nAC_SUBST([AR])dnl\n])\n\n# Figure out how to run the assembler.                      -*- Autoconf -*-\n\n# Copyright (C) 2001-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_PROG_AS\n# ----------\nAC_DEFUN([AM_PROG_AS],\n[# By default we simply use the C compiler to build assembly code.\nAC_REQUIRE([AC_PROG_CC])\ntest \"${CCAS+set}\" = set || CCAS=$CC\ntest \"${CCASFLAGS+set}\" = set || CCASFLAGS=$CFLAGS\nAC_ARG_VAR([CCAS],      [assembler compiler command (defaults to CC)])\nAC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])\n_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl\n])\n\n# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-\n\n# Copyright (C) 2001-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets\n# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to\n# '$srcdir', '$srcdir/..', or '$srcdir/../..'.\n#\n# Of course, Automake must honor this variable whenever it calls a\n# tool from the auxiliary directory.  The problem is that $srcdir (and\n# therefore $ac_aux_dir as well) can be either absolute or relative,\n# depending on how configure is run.  This is pretty annoying, since\n# it makes $ac_aux_dir quite unusable in subdirectories: in the top\n# source directory, any form will work fine, but in subdirectories a\n# relative path needs to be adjusted first.\n#\n# $ac_aux_dir/missing\n#    fails when called from a subdirectory if $ac_aux_dir is relative\n# $top_srcdir/$ac_aux_dir/missing\n#    fails if $ac_aux_dir is absolute,\n#    fails when called from a subdirectory in a VPATH build with\n#          a relative $ac_aux_dir\n#\n# The reason of the latter failure is that $top_srcdir and $ac_aux_dir\n# are both prefixed by $srcdir.  In an in-source build this is usually\n# harmless because $srcdir is '.', but things will broke when you\n# start a VPATH build or use an absolute $srcdir.\n#\n# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,\n# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:\n#   am_aux_dir='\\$(top_srcdir)/'`expr \"$ac_aux_dir\" : \"$srcdir//*\\(.*\\)\"`\n# and then we would define $MISSING as\n#   MISSING=\"\\${SHELL} $am_aux_dir/missing\"\n# This will work as long as MISSING is not called from configure, because\n# unfortunately $(top_srcdir) has no meaning in configure.\n# However there are other variables, like CC, which are often used in\n# configure, and could therefore not use this \"fixed\" $ac_aux_dir.\n#\n# Another solution, used here, is to always expand $ac_aux_dir to an\n# absolute PATH.  The drawback is that using absolute paths prevent a\n# configured tree to be moved without reconfiguration.\n\nAC_DEFUN([AM_AUX_DIR_EXPAND],\n[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl\n# Expand $ac_aux_dir to an absolute path.\nam_aux_dir=`cd \"$ac_aux_dir\" && pwd`\n])\n\n# AM_CONDITIONAL                                            -*- Autoconf -*-\n\n# Copyright (C) 1997-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_CONDITIONAL(NAME, SHELL-CONDITION)\n# -------------------------------------\n# Define a conditional.\nAC_DEFUN([AM_CONDITIONAL],\n[AC_PREREQ([2.52])dnl\n m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],\n       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl\nAC_SUBST([$1_TRUE])dnl\nAC_SUBST([$1_FALSE])dnl\n_AM_SUBST_NOTMAKE([$1_TRUE])dnl\n_AM_SUBST_NOTMAKE([$1_FALSE])dnl\nm4_define([_AM_COND_VALUE_$1], [$2])dnl\nif $2; then\n  $1_TRUE=\n  $1_FALSE='#'\nelse\n  $1_TRUE='#'\n  $1_FALSE=\nfi\nAC_CONFIG_COMMANDS_PRE(\n[if test -z \"${$1_TRUE}\" && test -z \"${$1_FALSE}\"; then\n  AC_MSG_ERROR([[conditional \"$1\" was never defined.\nUsually this means the macro was only invoked conditionally.]])\nfi])])\n\n# Copyright (C) 1999-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n\n# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be\n# written in clear, in which case automake, when reading aclocal.m4,\n# will think it sees a *use*, and therefore will trigger all it's\n# C support machinery.  Also note that it means that autoscan, seeing\n# CC etc. in the Makefile, will ask for an AC_PROG_CC use...\n\n\n# _AM_DEPENDENCIES(NAME)\n# ----------------------\n# See how the compiler implements dependency checking.\n# NAME is \"CC\", \"CXX\", \"OBJC\", \"OBJCXX\", \"UPC\", or \"GJC\".\n# We try a few techniques and use that to set a single cache variable.\n#\n# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was\n# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular\n# dependency, and given that the user is not expected to run this macro,\n# just rely on AC_PROG_CC.\nAC_DEFUN([_AM_DEPENDENCIES],\n[AC_REQUIRE([AM_SET_DEPDIR])dnl\nAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl\nAC_REQUIRE([AM_MAKE_INCLUDE])dnl\nAC_REQUIRE([AM_DEP_TRACK])dnl\n\nm4_if([$1], [CC],   [depcc=\"$CC\"   am_compiler_list=],\n      [$1], [CXX],  [depcc=\"$CXX\"  am_compiler_list=],\n      [$1], [OBJC], [depcc=\"$OBJC\" am_compiler_list='gcc3 gcc'],\n      [$1], [OBJCXX], [depcc=\"$OBJCXX\" am_compiler_list='gcc3 gcc'],\n      [$1], [UPC],  [depcc=\"$UPC\"  am_compiler_list=],\n      [$1], [GCJ],  [depcc=\"$GCJ\"  am_compiler_list='gcc3 gcc'],\n                    [depcc=\"$$1\"   am_compiler_list=])\n\nAC_CACHE_CHECK([dependency style of $depcc],\n               [am_cv_$1_dependencies_compiler_type],\n[if test -z \"$AMDEP_TRUE\" && test -f \"$am_depcomp\"; then\n  # We make a subdir and do the tests there.  Otherwise we can end up\n  # making bogus files that we don't know about and never remove.  For\n  # instance it was reported that on HP-UX the gcc test will end up\n  # making a dummy file named 'D' -- because '-MD' means \"put the output\n  # in D\".\n  rm -rf conftest.dir\n  mkdir conftest.dir\n  # Copy depcomp to subdir because otherwise we won't find it if we're\n  # using a relative directory.\n  cp \"$am_depcomp\" conftest.dir\n  cd conftest.dir\n  # We will build objects and dependencies in a subdirectory because\n  # it helps to detect inapplicable dependency modes.  For instance\n  # both Tru64's cc and ICC support -MD to output dependencies as a\n  # side effect of compilation, but ICC will put the dependencies in\n  # the current directory while Tru64 will put them in the object\n  # directory.\n  mkdir sub\n\n  am_cv_$1_dependencies_compiler_type=none\n  if test \"$am_compiler_list\" = \"\"; then\n     am_compiler_list=`sed -n ['s/^#*\\([a-zA-Z0-9]*\\))$/\\1/p'] < ./depcomp`\n  fi\n  am__universal=false\n  m4_case([$1], [CC],\n    [case \" $depcc \" in #(\n     *\\ -arch\\ *\\ -arch\\ *) am__universal=true ;;\n     esac],\n    [CXX],\n    [case \" $depcc \" in #(\n     *\\ -arch\\ *\\ -arch\\ *) am__universal=true ;;\n     esac])\n\n  for depmode in $am_compiler_list; do\n    # Setup a source with many dependencies, because some compilers\n    # like to wrap large dependency lists on column 80 (with \\), and\n    # we should not choose a depcomp mode which is confused by this.\n    #\n    # We need to recreate these files for each test, as the compiler may\n    # overwrite some of them when testing with obscure command lines.\n    # This happens at least with the AIX C compiler.\n    : > sub/conftest.c\n    for i in 1 2 3 4 5 6; do\n      echo '#include \"conftst'$i'.h\"' >> sub/conftest.c\n      # Using \": > sub/conftst$i.h\" creates only sub/conftst1.h with\n      # Solaris 10 /bin/sh.\n      echo '/* dummy */' > sub/conftst$i.h\n    done\n    echo \"${am__include} ${am__quote}sub/conftest.Po${am__quote}\" > confmf\n\n    # We check with '-c' and '-o' for the sake of the \"dashmstdout\"\n    # mode.  It turns out that the SunPro C++ compiler does not properly\n    # handle '-M -o', and we need to detect this.  Also, some Intel\n    # versions had trouble with output in subdirs.\n    am__obj=sub/conftest.${OBJEXT-o}\n    am__minus_obj=\"-o $am__obj\"\n    case $depmode in\n    gcc)\n      # This depmode causes a compiler race in universal mode.\n      test \"$am__universal\" = false || continue\n      ;;\n    nosideeffect)\n      # After this tag, mechanisms are not by side-effect, so they'll\n      # only be used when explicitly requested.\n      if test \"x$enable_dependency_tracking\" = xyes; then\n\tcontinue\n      else\n\tbreak\n      fi\n      ;;\n    msvc7 | msvc7msys | msvisualcpp | msvcmsys)\n      # This compiler won't grok '-c -o', but also, the minuso test has\n      # not run yet.  These depmodes are late enough in the game, and\n      # so weak that their functioning should not be impacted.\n      am__obj=conftest.${OBJEXT-o}\n      am__minus_obj=\n      ;;\n    none) break ;;\n    esac\n    if depmode=$depmode \\\n       source=sub/conftest.c object=$am__obj \\\n       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \\\n       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \\\n         >/dev/null 2>conftest.err &&\n       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&\n       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then\n      # icc doesn't choke on unknown options, it will just issue warnings\n      # or remarks (even with -Werror).  So we grep stderr for any message\n      # that says an option was ignored or not supported.\n      # When given -MP, icc 7.0 and 7.1 complain thusly:\n      #   icc: Command line warning: ignoring option '-M'; no argument required\n      # The diagnosis changed in icc 8.0:\n      #   icc: Command line remark: option '-MP' not supported\n      if (grep 'ignoring option' conftest.err ||\n          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else\n        am_cv_$1_dependencies_compiler_type=$depmode\n        break\n      fi\n    fi\n  done\n\n  cd ..\n  rm -rf conftest.dir\nelse\n  am_cv_$1_dependencies_compiler_type=none\nfi\n])\nAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])\nAM_CONDITIONAL([am__fastdep$1], [\n  test \"x$enable_dependency_tracking\" != xno \\\n  && test \"$am_cv_$1_dependencies_compiler_type\" = gcc3])\n])\n\n\n# AM_SET_DEPDIR\n# -------------\n# Choose a directory name for dependency files.\n# This macro is AC_REQUIREd in _AM_DEPENDENCIES.\nAC_DEFUN([AM_SET_DEPDIR],\n[AC_REQUIRE([AM_SET_LEADING_DOT])dnl\nAC_SUBST([DEPDIR], [\"${am__leading_dot}deps\"])dnl\n])\n\n\n# AM_DEP_TRACK\n# ------------\nAC_DEFUN([AM_DEP_TRACK],\n[AC_ARG_ENABLE([dependency-tracking], [dnl\nAS_HELP_STRING(\n  [--enable-dependency-tracking],\n  [do not reject slow dependency extractors])\nAS_HELP_STRING(\n  [--disable-dependency-tracking],\n  [speeds up one-time build])])\nif test \"x$enable_dependency_tracking\" != xno; then\n  am_depcomp=\"$ac_aux_dir/depcomp\"\n  AMDEPBACKSLASH='\\'\n  am__nodep='_no'\nfi\nAM_CONDITIONAL([AMDEP], [test \"x$enable_dependency_tracking\" != xno])\nAC_SUBST([AMDEPBACKSLASH])dnl\n_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl\nAC_SUBST([am__nodep])dnl\n_AM_SUBST_NOTMAKE([am__nodep])dnl\n])\n\n# Generate code to set up dependency tracking.              -*- Autoconf -*-\n\n# Copyright (C) 1999-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n\n# _AM_OUTPUT_DEPENDENCY_COMMANDS\n# ------------------------------\nAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],\n[{\n  # Older Autoconf quotes --file arguments for eval, but not when files\n  # are listed without --file.  Let's play safe and only enable the eval\n  # if we detect the quoting.\n  case $CONFIG_FILES in\n  *\\'*) eval set x \"$CONFIG_FILES\" ;;\n  *)   set x $CONFIG_FILES ;;\n  esac\n  shift\n  for mf\n  do\n    # Strip MF so we end up with the name of the file.\n    mf=`echo \"$mf\" | sed -e 's/:.*$//'`\n    # Check whether this is an Automake generated Makefile or not.\n    # We used to match only the files named 'Makefile.in', but\n    # some people rename them; so instead we look at the file content.\n    # Grep'ing the first line is not enough: some people post-process\n    # each Makefile.in and add a new line on top of each file to say so.\n    # Grep'ing the whole file is not good either: AIX grep has a line\n    # limit of 2048, but all sed's we know have understand at least 4000.\n    if sed -n 's,^#.*generated by automake.*,X,p' \"$mf\" | grep X >/dev/null 2>&1; then\n      dirpart=`AS_DIRNAME(\"$mf\")`\n    else\n      continue\n    fi\n    # Extract the definition of DEPDIR, am__include, and am__quote\n    # from the Makefile without running 'make'.\n    DEPDIR=`sed -n 's/^DEPDIR = //p' < \"$mf\"`\n    test -z \"$DEPDIR\" && continue\n    am__include=`sed -n 's/^am__include = //p' < \"$mf\"`\n    test -z \"$am__include\" && continue\n    am__quote=`sed -n 's/^am__quote = //p' < \"$mf\"`\n    # Find all dependency output files, they are included files with\n    # $(DEPDIR) in their names.  We invoke sed twice because it is the\n    # simplest approach to changing $(DEPDIR) to its actual value in the\n    # expansion.\n    for file in `sed -n \"\n      s/^$am__include $am__quote\\(.*(DEPDIR).*\\)$am__quote\"'$/\\1/p' <\"$mf\" | \\\n\t sed -e 's/\\$(DEPDIR)/'\"$DEPDIR\"'/g'`; do\n      # Make sure the directory exists.\n      test -f \"$dirpart/$file\" && continue\n      fdir=`AS_DIRNAME([\"$file\"])`\n      AS_MKDIR_P([$dirpart/$fdir])\n      # echo \"creating $dirpart/$file\"\n      echo '# dummy' > \"$dirpart/$file\"\n    done\n  done\n}\n])# _AM_OUTPUT_DEPENDENCY_COMMANDS\n\n\n# AM_OUTPUT_DEPENDENCY_COMMANDS\n# -----------------------------\n# This macro should only be invoked once -- use via AC_REQUIRE.\n#\n# This code is only required when automatic dependency tracking\n# is enabled.  FIXME.  This creates each '.P' file that we will\n# need in order to bootstrap the dependency handling code.\nAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],\n[AC_CONFIG_COMMANDS([depfiles],\n     [test x\"$AMDEP_TRUE\" != x\"\" || _AM_OUTPUT_DEPENDENCY_COMMANDS],\n     [AMDEP_TRUE=\"$AMDEP_TRUE\" ac_aux_dir=\"$ac_aux_dir\"])\n])\n\n# Do all the work for Automake.                             -*- Autoconf -*-\n\n# Copyright (C) 1996-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This macro actually does too much.  Some checks are only needed if\n# your package does certain things.  But this isn't really a big deal.\n\ndnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.\nm4_define([AC_PROG_CC],\nm4_defn([AC_PROG_CC])\n[_AM_PROG_CC_C_O\n])\n\n# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])\n# AM_INIT_AUTOMAKE([OPTIONS])\n# -----------------------------------------------\n# The call with PACKAGE and VERSION arguments is the old style\n# call (pre autoconf-2.50), which is being phased out.  PACKAGE\n# and VERSION should now be passed to AC_INIT and removed from\n# the call to AM_INIT_AUTOMAKE.\n# We support both call styles for the transition.  After\n# the next Automake release, Autoconf can make the AC_INIT\n# arguments mandatory, and then we can depend on a new Autoconf\n# release and drop the old call support.\nAC_DEFUN([AM_INIT_AUTOMAKE],\n[AC_PREREQ([2.65])dnl\ndnl Autoconf wants to disallow AM_ names.  We explicitly allow\ndnl the ones we care about.\nm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl\nAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl\nAC_REQUIRE([AC_PROG_INSTALL])dnl\nif test \"`cd $srcdir && pwd`\" != \"`pwd`\"; then\n  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output\n  # is not polluted with repeated \"-I.\"\n  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl\n  # test to see if srcdir already configured\n  if test -f $srcdir/config.status; then\n    AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])\n  fi\nfi\n\n# test whether we have cygpath\nif test -z \"$CYGPATH_W\"; then\n  if (cygpath --version) >/dev/null 2>/dev/null; then\n    CYGPATH_W='cygpath -w'\n  else\n    CYGPATH_W=echo\n  fi\nfi\nAC_SUBST([CYGPATH_W])\n\n# Define the identity of the package.\ndnl Distinguish between old-style and new-style calls.\nm4_ifval([$2],\n[AC_DIAGNOSE([obsolete],\n             [$0: two- and three-arguments forms are deprecated.])\nm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl\n AC_SUBST([PACKAGE], [$1])dnl\n AC_SUBST([VERSION], [$2])],\n[_AM_SET_OPTIONS([$1])dnl\ndnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.\nm4_if(\n  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),\n  [ok:ok],,\n  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl\n AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl\n AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl\n\n_AM_IF_OPTION([no-define],,\n[AC_DEFINE_UNQUOTED([PACKAGE], [\"$PACKAGE\"], [Name of package])\n AC_DEFINE_UNQUOTED([VERSION], [\"$VERSION\"], [Version number of package])])dnl\n\n# Some tools Automake needs.\nAC_REQUIRE([AM_SANITY_CHECK])dnl\nAC_REQUIRE([AC_ARG_PROGRAM])dnl\nAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])\nAM_MISSING_PROG([AUTOCONF], [autoconf])\nAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])\nAM_MISSING_PROG([AUTOHEADER], [autoheader])\nAM_MISSING_PROG([MAKEINFO], [makeinfo])\nAC_REQUIRE([AM_PROG_INSTALL_SH])dnl\nAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl\nAC_REQUIRE([AC_PROG_MKDIR_P])dnl\n# For better backward compatibility.  To be removed once Automake 1.9.x\n# dies out for good.  For more background, see:\n# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>\n# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>\nAC_SUBST([mkdir_p], ['$(MKDIR_P)'])\n# We need awk for the \"check\" target (and possibly the TAP driver).  The\n# system \"awk\" is bad on some platforms.\nAC_REQUIRE([AC_PROG_AWK])dnl\nAC_REQUIRE([AC_PROG_MAKE_SET])dnl\nAC_REQUIRE([AM_SET_LEADING_DOT])dnl\n_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],\n\t      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],\n\t\t\t     [_AM_PROG_TAR([v7])])])\n_AM_IF_OPTION([no-dependencies],,\n[AC_PROVIDE_IFELSE([AC_PROG_CC],\n\t\t  [_AM_DEPENDENCIES([CC])],\n\t\t  [m4_define([AC_PROG_CC],\n\t\t\t     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl\nAC_PROVIDE_IFELSE([AC_PROG_CXX],\n\t\t  [_AM_DEPENDENCIES([CXX])],\n\t\t  [m4_define([AC_PROG_CXX],\n\t\t\t     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl\nAC_PROVIDE_IFELSE([AC_PROG_OBJC],\n\t\t  [_AM_DEPENDENCIES([OBJC])],\n\t\t  [m4_define([AC_PROG_OBJC],\n\t\t\t     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl\nAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],\n\t\t  [_AM_DEPENDENCIES([OBJCXX])],\n\t\t  [m4_define([AC_PROG_OBJCXX],\n\t\t\t     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl\n])\nAC_REQUIRE([AM_SILENT_RULES])dnl\ndnl The testsuite driver may need to know about EXEEXT, so add the\ndnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This\ndnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.\nAC_CONFIG_COMMANDS_PRE(dnl\n[m4_provide_if([_AM_COMPILER_EXEEXT],\n  [AM_CONDITIONAL([am__EXEEXT], [test -n \"$EXEEXT\"])])])dnl\n\n# POSIX will say in a future version that running \"rm -f\" with no argument\n# is OK; and we want to be able to make that assumption in our Makefile\n# recipes.  So use an aggressive probe to check that the usage we want is\n# actually supported \"in the wild\" to an acceptable degree.\n# See automake bug#10828.\n# To make any issue more visible, cause the running configure to be aborted\n# by default if the 'rm' program in use doesn't match our expectations; the\n# user can still override this though.\nif rm -f && rm -fr && rm -rf; then : OK; else\n  cat >&2 <<'END'\nOops!\n\nYour 'rm' program seems unable to run without file operands specified\non the command line, even when the '-f' option is present.  This is contrary\nto the behaviour of most rm programs out there, and not conforming with\nthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>\n\nPlease tell bug-automake@gnu.org about your system, including the value\nof your $PATH and any error possibly output before this message.  This\ncan help us improve future automake versions.\n\nEND\n  if test x\"$ACCEPT_INFERIOR_RM_PROGRAM\" = x\"yes\"; then\n    echo 'Configuration will proceed anyway, since you have set the' >&2\n    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to \"yes\"' >&2\n    echo >&2\n  else\n    cat >&2 <<'END'\nAborting the configuration process, to ensure you take notice of the issue.\n\nYou can download and install GNU coreutils to get an 'rm' implementation\nthat behaves properly: <http://www.gnu.org/software/coreutils/>.\n\nIf you want to complete the configuration process using your problematic\n'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM\nto \"yes\", and re-run configure.\n\nEND\n    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])\n  fi\nfi\ndnl The trailing newline in this macro's definition is deliberate, for\ndnl backward compatibility and to allow trailing 'dnl'-style comments\ndnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.\n])\n\ndnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not\ndnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further\ndnl mangled by Autoconf and run in a shell conditional statement.\nm4_define([_AC_COMPILER_EXEEXT],\nm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])\n\n# When config.status generates a header, we must update the stamp-h file.\n# This file resides in the same directory as the config header\n# that is generated.  The stamp files are numbered to have different names.\n\n# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the\n# loop where config.status creates the headers, so we can generate\n# our stamp files there.\nAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],\n[# Compute $1's index in $config_headers.\n_am_arg=$1\n_am_stamp_count=1\nfor _am_header in $config_headers :; do\n  case $_am_header in\n    $_am_arg | $_am_arg:* )\n      break ;;\n    * )\n      _am_stamp_count=`expr $_am_stamp_count + 1` ;;\n  esac\ndone\necho \"timestamp for $_am_arg\" >`AS_DIRNAME([\"$_am_arg\"])`/stamp-h[]$_am_stamp_count])\n\n# Copyright (C) 2001-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_PROG_INSTALL_SH\n# ------------------\n# Define $install_sh.\nAC_DEFUN([AM_PROG_INSTALL_SH],\n[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl\nif test x\"${install_sh+set}\" != xset; then\n  case $am_aux_dir in\n  *\\ * | *\\\t*)\n    install_sh=\"\\${SHELL} '$am_aux_dir/install-sh'\" ;;\n  *)\n    install_sh=\"\\${SHELL} $am_aux_dir/install-sh\"\n  esac\nfi\nAC_SUBST([install_sh])])\n\n# Copyright (C) 2003-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# Check whether the underlying file-system supports filenames\n# with a leading dot.  For instance MS-DOS doesn't.\nAC_DEFUN([AM_SET_LEADING_DOT],\n[rm -rf .tst 2>/dev/null\nmkdir .tst 2>/dev/null\nif test -d .tst; then\n  am__leading_dot=.\nelse\n  am__leading_dot=_\nfi\nrmdir .tst 2>/dev/null\nAC_SUBST([am__leading_dot])])\n\n# Check to see how 'make' treats includes.\t            -*- Autoconf -*-\n\n# Copyright (C) 2001-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_MAKE_INCLUDE()\n# -----------------\n# Check to see how make treats includes.\nAC_DEFUN([AM_MAKE_INCLUDE],\n[am_make=${MAKE-make}\ncat > confinc << 'END'\nam__doit:\n\t@echo this is the am__doit target\n.PHONY: am__doit\nEND\n# If we don't find an include directive, just comment out the code.\nAC_MSG_CHECKING([for style of include used by $am_make])\nam__include=\"#\"\nam__quote=\n_am_result=none\n# First try GNU make style include.\necho \"include confinc\" > confmf\n# Ignore all kinds of additional output from 'make'.\ncase `$am_make -s -f confmf 2> /dev/null` in #(\n*the\\ am__doit\\ target*)\n  am__include=include\n  am__quote=\n  _am_result=GNU\n  ;;\nesac\n# Now try BSD make style include.\nif test \"$am__include\" = \"#\"; then\n   echo '.include \"confinc\"' > confmf\n   case `$am_make -s -f confmf 2> /dev/null` in #(\n   *the\\ am__doit\\ target*)\n     am__include=.include\n     am__quote=\"\\\"\"\n     _am_result=BSD\n     ;;\n   esac\nfi\nAC_SUBST([am__include])\nAC_SUBST([am__quote])\nAC_MSG_RESULT([$_am_result])\nrm -f confinc confmf\n])\n\n# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-\n\n# Copyright (C) 1997-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_MISSING_PROG(NAME, PROGRAM)\n# ------------------------------\nAC_DEFUN([AM_MISSING_PROG],\n[AC_REQUIRE([AM_MISSING_HAS_RUN])\n$1=${$1-\"${am_missing_run}$2\"}\nAC_SUBST($1)])\n\n# AM_MISSING_HAS_RUN\n# ------------------\n# Define MISSING if not defined so far and test if it is modern enough.\n# If it is, set am_missing_run to use it, otherwise, to nothing.\nAC_DEFUN([AM_MISSING_HAS_RUN],\n[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl\nAC_REQUIRE_AUX_FILE([missing])dnl\nif test x\"${MISSING+set}\" != xset; then\n  case $am_aux_dir in\n  *\\ * | *\\\t*)\n    MISSING=\"\\${SHELL} \\\"$am_aux_dir/missing\\\"\" ;;\n  *)\n    MISSING=\"\\${SHELL} $am_aux_dir/missing\" ;;\n  esac\nfi\n# Use eval to expand $SHELL\nif eval \"$MISSING --is-lightweight\"; then\n  am_missing_run=\"$MISSING \"\nelse\n  am_missing_run=\n  AC_MSG_WARN(['missing' script is too old or missing])\nfi\n])\n\n# Helper functions for option handling.                     -*- Autoconf -*-\n\n# Copyright (C) 2001-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# _AM_MANGLE_OPTION(NAME)\n# -----------------------\nAC_DEFUN([_AM_MANGLE_OPTION],\n[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])\n\n# _AM_SET_OPTION(NAME)\n# --------------------\n# Set option NAME.  Presently that only means defining a flag for this option.\nAC_DEFUN([_AM_SET_OPTION],\n[m4_define(_AM_MANGLE_OPTION([$1]), [1])])\n\n# _AM_SET_OPTIONS(OPTIONS)\n# ------------------------\n# OPTIONS is a space-separated list of Automake options.\nAC_DEFUN([_AM_SET_OPTIONS],\n[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])\n\n# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])\n# -------------------------------------------\n# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.\nAC_DEFUN([_AM_IF_OPTION],\n[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])\n\n# Copyright (C) 1999-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# _AM_PROG_CC_C_O\n# ---------------\n# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC\n# to automatically call this.\nAC_DEFUN([_AM_PROG_CC_C_O],\n[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl\nAC_REQUIRE_AUX_FILE([compile])dnl\nAC_LANG_PUSH([C])dnl\nAC_CACHE_CHECK(\n  [whether $CC understands -c and -o together],\n  [am_cv_prog_cc_c_o],\n  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])\n  # Make sure it works both with $CC and with simple cc.\n  # Following AC_PROG_CC_C_O, we do the test twice because some\n  # compilers refuse to overwrite an existing .o file with -o,\n  # though they will create one.\n  am_cv_prog_cc_c_o=yes\n  for am_i in 1 2; do\n    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \\\n         && test -f conftest2.$ac_objext; then\n      : OK\n    else\n      am_cv_prog_cc_c_o=no\n      break\n    fi\n  done\n  rm -f core conftest*\n  unset am_i])\nif test \"$am_cv_prog_cc_c_o\" != yes; then\n   # Losing compiler, so override with the script.\n   # FIXME: It is wrong to rewrite CC.\n   # But if we don't then we get into trouble of one sort or another.\n   # A longer-term fix would be to have automake use am__CC in this case,\n   # and then we could set am__CC=\"\\$(top_srcdir)/compile \\$(CC)\"\n   CC=\"$am_aux_dir/compile $CC\"\nfi\nAC_LANG_POP([C])])\n\n# For backward compatibility.\nAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])\n\n# Copyright (C) 2001-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_RUN_LOG(COMMAND)\n# -------------------\n# Run COMMAND, save the exit status in ac_status, and log it.\n# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)\nAC_DEFUN([AM_RUN_LOG],\n[{ echo \"$as_me:$LINENO: $1\" >&AS_MESSAGE_LOG_FD\n   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD\n   ac_status=$?\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&AS_MESSAGE_LOG_FD\n   (exit $ac_status); }])\n\n# Check to make sure that the build environment is sane.    -*- Autoconf -*-\n\n# Copyright (C) 1996-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_SANITY_CHECK\n# ---------------\nAC_DEFUN([AM_SANITY_CHECK],\n[AC_MSG_CHECKING([whether build environment is sane])\n# Reject unsafe characters in $srcdir or the absolute working directory\n# name.  Accept space and tab only in the latter.\nam_lf='\n'\ncase `pwd` in\n  *[[\\\\\\\"\\#\\$\\&\\'\\`$am_lf]]*)\n    AC_MSG_ERROR([unsafe absolute working directory name]);;\nesac\ncase $srcdir in\n  *[[\\\\\\\"\\#\\$\\&\\'\\`$am_lf\\ \\\t]]*)\n    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;\nesac\n\n# Do 'set' in a subshell so we don't clobber the current shell's\n# arguments.  Must try -L first in case configure is actually a\n# symlink; some systems play weird games with the mod time of symlinks\n# (eg FreeBSD returns the mod time of the symlink's containing\n# directory).\nif (\n   am_has_slept=no\n   for am_try in 1 2; do\n     echo \"timestamp, slept: $am_has_slept\" > conftest.file\n     set X `ls -Lt \"$srcdir/configure\" conftest.file 2> /dev/null`\n     if test \"$[*]\" = \"X\"; then\n\t# -L didn't work.\n\tset X `ls -t \"$srcdir/configure\" conftest.file`\n     fi\n     if test \"$[*]\" != \"X $srcdir/configure conftest.file\" \\\n\t&& test \"$[*]\" != \"X conftest.file $srcdir/configure\"; then\n\n\t# If neither matched, then we have a broken ls.  This can happen\n\t# if, for instance, CONFIG_SHELL is bash and it inherits a\n\t# broken ls alias from the environment.  This has actually\n\t# happened.  Such a system could not be considered \"sane\".\n\tAC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken\n  alias in your environment])\n     fi\n     if test \"$[2]\" = conftest.file || test $am_try -eq 2; then\n       break\n     fi\n     # Just in case.\n     sleep 1\n     am_has_slept=yes\n   done\n   test \"$[2]\" = conftest.file\n   )\nthen\n   # Ok.\n   :\nelse\n   AC_MSG_ERROR([newly created file is older than distributed files!\nCheck your system clock])\nfi\nAC_MSG_RESULT([yes])\n# If we didn't sleep, we still need to ensure time stamps of config.status and\n# generated files are strictly newer.\nam_sleep_pid=\nif grep 'slept: no' conftest.file >/dev/null 2>&1; then\n  ( sleep 1 ) &\n  am_sleep_pid=$!\nfi\nAC_CONFIG_COMMANDS_PRE(\n  [AC_MSG_CHECKING([that generated files are newer than configure])\n   if test -n \"$am_sleep_pid\"; then\n     # Hide warnings about reused PIDs.\n     wait $am_sleep_pid 2>/dev/null\n   fi\n   AC_MSG_RESULT([done])])\nrm -f conftest.file\n])\n\n# Copyright (C) 2009-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_SILENT_RULES([DEFAULT])\n# --------------------------\n# Enable less verbose build rules; with the default set to DEFAULT\n# (\"yes\" being less verbose, \"no\" or empty being verbose).\nAC_DEFUN([AM_SILENT_RULES],\n[AC_ARG_ENABLE([silent-rules], [dnl\nAS_HELP_STRING(\n  [--enable-silent-rules],\n  [less verbose build output (undo: \"make V=1\")])\nAS_HELP_STRING(\n  [--disable-silent-rules],\n  [verbose build output (undo: \"make V=0\")])dnl\n])\ncase $enable_silent_rules in @%:@ (((\n  yes) AM_DEFAULT_VERBOSITY=0;;\n   no) AM_DEFAULT_VERBOSITY=1;;\n    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;\nesac\ndnl\ndnl A few 'make' implementations (e.g., NonStop OS and NextStep)\ndnl do not support nested variable expansions.\ndnl See automake bug#9928 and bug#10237.\nam_make=${MAKE-make}\nAC_CACHE_CHECK([whether $am_make supports nested variables],\n   [am_cv_make_support_nested_variables],\n   [if AS_ECHO([['TRUE=$(BAR$(V))\nBAR0=false\nBAR1=true\nV=1\nam__doit:\n\t@$(TRUE)\n.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then\n  am_cv_make_support_nested_variables=yes\nelse\n  am_cv_make_support_nested_variables=no\nfi])\nif test $am_cv_make_support_nested_variables = yes; then\n  dnl Using '$V' instead of '$(V)' breaks IRIX make.\n  AM_V='$(V)'\n  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'\nelse\n  AM_V=$AM_DEFAULT_VERBOSITY\n  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY\nfi\nAC_SUBST([AM_V])dnl\nAM_SUBST_NOTMAKE([AM_V])dnl\nAC_SUBST([AM_DEFAULT_V])dnl\nAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl\nAC_SUBST([AM_DEFAULT_VERBOSITY])dnl\nAM_BACKSLASH='\\'\nAC_SUBST([AM_BACKSLASH])dnl\n_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl\n])\n\n# Copyright (C) 2001-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# AM_PROG_INSTALL_STRIP\n# ---------------------\n# One issue with vendor 'install' (even GNU) is that you can't\n# specify the program used to strip binaries.  This is especially\n# annoying in cross-compiling environments, where the build's strip\n# is unlikely to handle the host's binaries.\n# Fortunately install-sh will honor a STRIPPROG variable, so we\n# always use install-sh in \"make install-strip\", and initialize\n# STRIPPROG with the value of the STRIP variable (set by the user).\nAC_DEFUN([AM_PROG_INSTALL_STRIP],\n[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl\n# Installed binaries are usually stripped using 'strip' when the user\n# run \"make install-strip\".  However 'strip' might not be the right\n# tool to use in cross-compilation environments, therefore Automake\n# will honor the 'STRIP' environment variable to overrule this program.\ndnl Don't test for $cross_compiling = yes, because it might be 'maybe'.\nif test \"$cross_compiling\" != no; then\n  AC_CHECK_TOOL([STRIP], [strip], :)\nfi\nINSTALL_STRIP_PROGRAM=\"\\$(install_sh) -c -s\"\nAC_SUBST([INSTALL_STRIP_PROGRAM])])\n\n# Copyright (C) 2006-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# _AM_SUBST_NOTMAKE(VARIABLE)\n# ---------------------------\n# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.\n# This macro is traced by Automake.\nAC_DEFUN([_AM_SUBST_NOTMAKE])\n\n# AM_SUBST_NOTMAKE(VARIABLE)\n# --------------------------\n# Public sister of _AM_SUBST_NOTMAKE.\nAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])\n\n# Check how to create a tarball.                            -*- Autoconf -*-\n\n# Copyright (C) 2004-2014 Free Software Foundation, Inc.\n#\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# _AM_PROG_TAR(FORMAT)\n# --------------------\n# Check how to create a tarball in format FORMAT.\n# FORMAT should be one of 'v7', 'ustar', or 'pax'.\n#\n# Substitute a variable $(am__tar) that is a command\n# writing to stdout a FORMAT-tarball containing the directory\n# $tardir.\n#     tardir=directory && $(am__tar) > result.tar\n#\n# Substitute a variable $(am__untar) that extract such\n# a tarball read from stdin.\n#     $(am__untar) < result.tar\n#\nAC_DEFUN([_AM_PROG_TAR],\n[# Always define AMTAR for backward compatibility.  Yes, it's still used\n# in the wild :-(  We should find a proper way to deprecate it ...\nAC_SUBST([AMTAR], ['$${TAR-tar}'])\n\n# We'll loop over all known methods to create a tar archive until one works.\n_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'\n\nm4_if([$1], [v7],\n  [am__tar='$${TAR-tar} chof - \"$$tardir\"' am__untar='$${TAR-tar} xf -'],\n\n  [m4_case([$1],\n    [ustar],\n     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.\n      # There is notably a 21 bits limit for the UID and the GID.  In fact,\n      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343\n      # and bug#13588).\n      am_max_uid=2097151 # 2^21 - 1\n      am_max_gid=$am_max_uid\n      # The $UID and $GID variables are not portable, so we need to resort\n      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls\n      # below are definitely unexpected, so allow the users to see them\n      # (that is, avoid stderr redirection).\n      am_uid=`id -u || echo unknown`\n      am_gid=`id -g || echo unknown`\n      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])\n      if test $am_uid -le $am_max_uid; then\n         AC_MSG_RESULT([yes])\n      else\n         AC_MSG_RESULT([no])\n         _am_tools=none\n      fi\n      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])\n      if test $am_gid -le $am_max_gid; then\n         AC_MSG_RESULT([yes])\n      else\n        AC_MSG_RESULT([no])\n        _am_tools=none\n      fi],\n\n  [pax],\n    [],\n\n  [m4_fatal([Unknown tar format])])\n\n  AC_MSG_CHECKING([how to create a $1 tar archive])\n\n  # Go ahead even if we have the value already cached.  We do so because we\n  # need to set the values for the 'am__tar' and 'am__untar' variables.\n  _am_tools=${am_cv_prog_tar_$1-$_am_tools}\n\n  for _am_tool in $_am_tools; do\n    case $_am_tool in\n    gnutar)\n      for _am_tar in tar gnutar gtar; do\n        AM_RUN_LOG([$_am_tar --version]) && break\n      done\n      am__tar=\"$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - \"'\"$$tardir\"'\n      am__tar_=\"$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - \"'\"$tardir\"'\n      am__untar=\"$_am_tar -xf -\"\n      ;;\n    plaintar)\n      # Must skip GNU tar: if it does not support --format= it doesn't create\n      # ustar tarball either.\n      (tar --version) >/dev/null 2>&1 && continue\n      am__tar='tar chf - \"$$tardir\"'\n      am__tar_='tar chf - \"$tardir\"'\n      am__untar='tar xf -'\n      ;;\n    pax)\n      am__tar='pax -L -x $1 -w \"$$tardir\"'\n      am__tar_='pax -L -x $1 -w \"$tardir\"'\n      am__untar='pax -r'\n      ;;\n    cpio)\n      am__tar='find \"$$tardir\" -print | cpio -o -H $1 -L'\n      am__tar_='find \"$tardir\" -print | cpio -o -H $1 -L'\n      am__untar='cpio -i -H $1 -d'\n      ;;\n    none)\n      am__tar=false\n      am__tar_=false\n      am__untar=false\n      ;;\n    esac\n\n    # If the value was cached, stop now.  We just wanted to have am__tar\n    # and am__untar set.\n    test -n \"${am_cv_prog_tar_$1}\" && break\n\n    # tar/untar a dummy directory, and stop if the command works.\n    rm -rf conftest.dir\n    mkdir conftest.dir\n    echo GrepMe > conftest.dir/file\n    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])\n    rm -rf conftest.dir\n    if test -s conftest.tar; then\n      AM_RUN_LOG([$am__untar <conftest.tar])\n      AM_RUN_LOG([cat conftest.dir/file])\n      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break\n    fi\n  done\n  rm -rf conftest.dir\n\n  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])\n  AC_MSG_RESULT([$am_cv_prog_tar_$1])])\n\nAC_SUBST([am__tar])\nAC_SUBST([am__untar])\n]) # _AM_PROG_TAR\n\nm4_include([acinclude.m4])\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/ar-lib",
    "content": "#! /bin/sh\n# Wrapper for Microsoft lib.exe\n\nme=ar-lib\nscriptversion=2012-03-01.08; # UTC\n\n# Copyright (C) 2010-2014 Free Software Foundation, Inc.\n# Written by Peter Rosin <peda@lysator.liu.se>.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\n# This file is maintained in Automake, please report\n# bugs to <bug-automake@gnu.org> or send patches to\n# <automake-patches@gnu.org>.\n\n\n# func_error message\nfunc_error ()\n{\n  echo \"$me: $1\" 1>&2\n  exit 1\n}\n\nfile_conv=\n\n# func_file_conv build_file\n# Convert a $build file to $host form and store it in $file\n# Currently only supports Windows hosts.\nfunc_file_conv ()\n{\n  file=$1\n  case $file in\n    / | /[!/]*) # absolute file, and not a UNC file\n      if test -z \"$file_conv\"; then\n\t# lazily determine how to convert abs files\n\tcase `uname -s` in\n\t  MINGW*)\n\t    file_conv=mingw\n\t    ;;\n\t  CYGWIN*)\n\t    file_conv=cygwin\n\t    ;;\n\t  *)\n\t    file_conv=wine\n\t    ;;\n\tesac\n      fi\n      case $file_conv in\n\tmingw)\n\t  file=`cmd //C echo \"$file \" | sed -e 's/\"\\(.*\\) \" *$/\\1/'`\n\t  ;;\n\tcygwin)\n\t  file=`cygpath -m \"$file\" || echo \"$file\"`\n\t  ;;\n\twine)\n\t  file=`winepath -w \"$file\" || echo \"$file\"`\n\t  ;;\n      esac\n      ;;\n  esac\n}\n\n# func_at_file at_file operation archive\n# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE\n# for each of them.\n# When interpreting the content of the @FILE, do NOT use func_file_conv,\n# since the user would need to supply preconverted file names to\n# binutils ar, at least for MinGW.\nfunc_at_file ()\n{\n  operation=$2\n  archive=$3\n  at_file_contents=`cat \"$1\"`\n  eval set x \"$at_file_contents\"\n  shift\n\n  for member\n  do\n    $AR -NOLOGO $operation:\"$member\" \"$archive\" || exit $?\n  done\n}\n\ncase $1 in\n  '')\n     func_error \"no command.  Try '$0 --help' for more information.\"\n     ;;\n  -h | --h*)\n    cat <<EOF\nUsage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]\n\nMembers may be specified in a file named with @FILE.\nEOF\n    exit $?\n    ;;\n  -v | --v*)\n    echo \"$me, version $scriptversion\"\n    exit $?\n    ;;\nesac\n\nif test $# -lt 3; then\n  func_error \"you must specify a program, an action and an archive\"\nfi\n\nAR=$1\nshift\nwhile :\ndo\n  if test $# -lt 2; then\n    func_error \"you must specify a program, an action and an archive\"\n  fi\n  case $1 in\n    -lib | -LIB \\\n    | -ltcg | -LTCG \\\n    | -machine* | -MACHINE* \\\n    | -subsystem* | -SUBSYSTEM* \\\n    | -verbose | -VERBOSE \\\n    | -wx* | -WX* )\n      AR=\"$AR $1\"\n      shift\n      ;;\n    *)\n      action=$1\n      shift\n      break\n      ;;\n  esac\ndone\norig_archive=$1\nshift\nfunc_file_conv \"$orig_archive\"\narchive=$file\n\n# strip leading dash in $action\naction=${action#-}\n\ndelete=\nextract=\nlist=\nquick=\nreplace=\nindex=\ncreate=\n\nwhile test -n \"$action\"\ndo\n  case $action in\n    d*) delete=yes  ;;\n    x*) extract=yes ;;\n    t*) list=yes    ;;\n    q*) quick=yes   ;;\n    r*) replace=yes ;;\n    s*) index=yes   ;;\n    S*)             ;; # the index is always updated implicitly\n    c*) create=yes  ;;\n    u*)             ;; # TODO: don't ignore the update modifier\n    v*)             ;; # TODO: don't ignore the verbose modifier\n    *)\n      func_error \"unknown action specified\"\n      ;;\n  esac\n  action=${action#?}\ndone\n\ncase $delete$extract$list$quick$replace,$index in\n  yes,* | ,yes)\n    ;;\n  yesyes*)\n    func_error \"more than one action specified\"\n    ;;\n  *)\n    func_error \"no action specified\"\n    ;;\nesac\n\nif test -n \"$delete\"; then\n  if test ! -f \"$orig_archive\"; then\n    func_error \"archive not found\"\n  fi\n  for member\n  do\n    case $1 in\n      @*)\n        func_at_file \"${1#@}\" -REMOVE \"$archive\"\n        ;;\n      *)\n        func_file_conv \"$1\"\n        $AR -NOLOGO -REMOVE:\"$file\" \"$archive\" || exit $?\n        ;;\n    esac\n  done\n\nelif test -n \"$extract\"; then\n  if test ! -f \"$orig_archive\"; then\n    func_error \"archive not found\"\n  fi\n  if test $# -gt 0; then\n    for member\n    do\n      case $1 in\n        @*)\n          func_at_file \"${1#@}\" -EXTRACT \"$archive\"\n          ;;\n        *)\n          func_file_conv \"$1\"\n          $AR -NOLOGO -EXTRACT:\"$file\" \"$archive\" || exit $?\n          ;;\n      esac\n    done\n  else\n    $AR -NOLOGO -LIST \"$archive\" | sed -e 's/\\\\/\\\\\\\\/g' | while read member\n    do\n      $AR -NOLOGO -EXTRACT:\"$member\" \"$archive\" || exit $?\n    done\n  fi\n\nelif test -n \"$quick$replace\"; then\n  if test ! -f \"$orig_archive\"; then\n    if test -z \"$create\"; then\n      echo \"$me: creating $orig_archive\"\n    fi\n    orig_archive=\n  else\n    orig_archive=$archive\n  fi\n\n  for member\n  do\n    case $1 in\n    @*)\n      func_file_conv \"${1#@}\"\n      set x \"$@\" \"@$file\"\n      ;;\n    *)\n      func_file_conv \"$1\"\n      set x \"$@\" \"$file\"\n      ;;\n    esac\n    shift\n    shift\n  done\n\n  if test -n \"$orig_archive\"; then\n    $AR -NOLOGO -OUT:\"$archive\" \"$orig_archive\" \"$@\" || exit $?\n  else\n    $AR -NOLOGO -OUT:\"$archive\" \"$@\" || exit $?\n  fi\n\nelif test -n \"$list\"; then\n  if test ! -f \"$orig_archive\"; then\n    func_error \"archive not found\"\n  fi\n  $AR -NOLOGO -LIST \"$archive\" || exit $?\nfi\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/bmp.c",
    "content": "/*\n * Copyright (C)2011, 2015 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include <stdio.h>\n#include <string.h>\n#include <setjmp.h>\n#include <errno.h>\n#include \"cdjpeg.h\"\n#include <jpeglib.h>\n#include <jpegint.h>\n#include \"tjutil.h\"\n#include \"bmp.h\"\n\n\n/* This duplicates the functionality of the VirtualGL bitmap library using\n   the components from cjpeg and djpeg */\n\n\n/* Error handling (based on example in example.c) */\n\nstatic char errStr[JMSG_LENGTH_MAX]=\"No error\";\n\nstruct my_error_mgr\n{\n\tstruct jpeg_error_mgr pub;\n\tjmp_buf setjmp_buffer;\n};\ntypedef struct my_error_mgr *my_error_ptr;\n\nstatic void my_error_exit(j_common_ptr cinfo)\n{\n\tmy_error_ptr myerr=(my_error_ptr)cinfo->err;\n\t(*cinfo->err->output_message)(cinfo);\n\tlongjmp(myerr->setjmp_buffer, 1);\n}\n\n/* Based on output_message() in jerror.c */\n\nstatic void my_output_message(j_common_ptr cinfo)\n{\n\t(*cinfo->err->format_message)(cinfo, errStr);\n}\n\n#define _throw(m) {snprintf(errStr, JMSG_LENGTH_MAX, \"%s\", m);  \\\n\tretval=-1;  goto bailout;}\n#define _throwunix(m) {snprintf(errStr, JMSG_LENGTH_MAX, \"%s\\n%s\", m,  \\\n\tstrerror(errno));  retval=-1;  goto bailout;}\n\n\nstatic void pixelconvert(unsigned char *srcbuf, int srcpf, int srcbottomup,\n\tunsigned char *dstbuf, int dstpf, int dstbottomup, int w, int h)\n{\n\tunsigned char *srcrowptr=srcbuf, *srccolptr;\n\tint srcps=tjPixelSize[srcpf];\n\tint srcstride=srcbottomup? -w*srcps:w*srcps;\n\tunsigned char *dstrowptr=dstbuf, *dstcolptr;\n\tint dstps=tjPixelSize[dstpf];\n\tint dststride=dstbottomup? -w*dstps:w*dstps;\n\tint row, col;\n\n\tif(srcbottomup) srcrowptr=&srcbuf[w*srcps*(h-1)];\n\tif(dstbottomup) dstrowptr=&dstbuf[w*dstps*(h-1)];\n\n\t/* NOTE: These quick & dirty CMYK<->RGB conversion routines are for testing\n\t   purposes only.  Properly converting between CMYK and RGB requires a color\n\t   management system. */\n\n\tif(dstpf==TJPF_CMYK)\n\t{\n\t\tfor(row=0; row<h; row++, srcrowptr+=srcstride, dstrowptr+=dststride)\n\t\t{\n\t\t\tfor(col=0, srccolptr=srcrowptr, dstcolptr=dstrowptr;\n\t\t\t\tcol<w; col++, srccolptr+=srcps)\n\t\t\t{\n\t\t\t\tdouble c=1.0-((double)(srccolptr[tjRedOffset[srcpf]])/255.);\n\t\t\t\tdouble m=1.0-((double)(srccolptr[tjGreenOffset[srcpf]])/255.);\n\t\t\t\tdouble y=1.0-((double)(srccolptr[tjBlueOffset[srcpf]])/255.);\n\t\t\t\tdouble k=min(min(c,m),min(y,1.0));\n\t\t\t\tif(k==1.0) c=m=y=0.0;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tc=(c-k)/(1.0-k);\n\t\t\t\t\tm=(m-k)/(1.0-k);\n\t\t\t\t\ty=(y-k)/(1.0-k);\n\t\t\t\t}\n\t\t\t\tif(c>1.0) c=1.0;  if(c<0.) c=0.;\n\t\t\t\tif(m>1.0) m=1.0;  if(m<0.) m=0.;\n\t\t\t\tif(y>1.0) y=1.0;  if(y<0.) y=0.;\n\t\t\t\tif(k>1.0) k=1.0;  if(k<0.) k=0.;\n\t\t\t\t*dstcolptr++=(unsigned char)(255.0-c*255.0+0.5);\n\t\t\t\t*dstcolptr++=(unsigned char)(255.0-m*255.0+0.5);\n\t\t\t\t*dstcolptr++=(unsigned char)(255.0-y*255.0+0.5);\n\t\t\t\t*dstcolptr++=(unsigned char)(255.0-k*255.0+0.5);\n\t\t\t}\n\t\t}\n\t}\n\telse if(srcpf==TJPF_CMYK)\n\t{\n\t\tfor(row=0; row<h; row++, srcrowptr+=srcstride, dstrowptr+=dststride)\n\t\t{\n\t\t\tfor(col=0, srccolptr=srcrowptr, dstcolptr=dstrowptr;\n\t\t\t\tcol<w; col++, dstcolptr+=dstps)\n\t\t\t{\n\t\t\t\tdouble c=(double)(*srccolptr++);\n\t\t\t\tdouble m=(double)(*srccolptr++);\n\t\t\t\tdouble y=(double)(*srccolptr++);\n\t\t\t\tdouble k=(double)(*srccolptr++);\n\t\t\t\tdouble r=c*k/255.;\n\t\t\t\tdouble g=m*k/255.;\n\t\t\t\tdouble b=y*k/255.;\n\t\t\t\tif(r>255.0) r=255.0;  if(r<0.) r=0.;\n\t\t\t\tif(g>255.0) g=255.0;  if(g<0.) g=0.;\n\t\t\t\tif(b>255.0) b=255.0;  if(b<0.) b=0.;\n\t\t\t\tdstcolptr[tjRedOffset[dstpf]]=(unsigned char)(r+0.5);\n\t\t\t\tdstcolptr[tjGreenOffset[dstpf]]=(unsigned char)(g+0.5);\n\t\t\t\tdstcolptr[tjBlueOffset[dstpf]]=(unsigned char)(b+0.5);\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\tfor(row=0; row<h; row++, srcrowptr+=srcstride, dstrowptr+=dststride)\n\t\t{\n\t\t\tfor(col=0, srccolptr=srcrowptr, dstcolptr=dstrowptr;\n\t\t\t\tcol<w; col++, srccolptr+=srcps, dstcolptr+=dstps)\n\t\t\t{\n\t\t\t\tdstcolptr[tjRedOffset[dstpf]]=srccolptr[tjRedOffset[srcpf]];\n\t\t\t\tdstcolptr[tjGreenOffset[dstpf]]=srccolptr[tjGreenOffset[srcpf]];\n\t\t\t\tdstcolptr[tjBlueOffset[dstpf]]=srccolptr[tjBlueOffset[srcpf]];\n\t\t\t}\n\t\t}\n\t}\n}\n\n\nint loadbmp(char *filename, unsigned char **buf, int *w, int *h,\n\tint dstpf, int bottomup)\n{\n\tint retval=0, dstps, srcpf, tempc;\n\tstruct jpeg_compress_struct cinfo;\n\tstruct my_error_mgr jerr;\n\tcjpeg_source_ptr src;\n\tFILE *file=NULL;\n\n\tmemset(&cinfo, 0, sizeof(struct jpeg_compress_struct));\n\n\tif(!filename || !buf || !w || !h || dstpf<0 || dstpf>=TJ_NUMPF)\n\t\t_throw(\"loadbmp(): Invalid argument\");\n\n\tif((file=fopen(filename, \"rb\"))==NULL)\n\t\t_throwunix(\"loadbmp(): Cannot open input file\");\n\n\tcinfo.err=jpeg_std_error(&jerr.pub);\n\tjerr.pub.error_exit=my_error_exit;\n\tjerr.pub.output_message=my_output_message;\n\n\tif(setjmp(jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;  goto bailout;\n\t}\n\n\tjpeg_create_compress(&cinfo);\n\tif((tempc=getc(file))<0 || ungetc(tempc, file)==EOF)\n\t\t_throwunix(\"loadbmp(): Could not read input file\")\n\telse if(tempc==EOF) _throw(\"loadbmp(): Input file contains no data\");\n\n\tif(tempc=='B')\n\t{\n\t\tif((src=jinit_read_bmp(&cinfo))==NULL)\n\t\t\t_throw(\"loadbmp(): Could not initialize bitmap loader\");\n\t}\n\telse if(tempc=='P')\n\t{\n\t\tif((src=jinit_read_ppm(&cinfo))==NULL)\n\t\t\t_throw(\"loadbmp(): Could not initialize bitmap loader\");\n\t}\n\telse _throw(\"loadbmp(): Unsupported file type\");\n\n\tsrc->input_file=file;\n\t(*src->start_input)(&cinfo, src);\n\t(*cinfo.mem->realize_virt_arrays)((j_common_ptr)&cinfo);\n\n\t*w=cinfo.image_width;  *h=cinfo.image_height;\n\n\tif(cinfo.input_components==1 && cinfo.in_color_space==JCS_RGB)\n\t\tsrcpf=TJPF_GRAY;\n\telse srcpf=TJPF_RGB;\n\n\tdstps=tjPixelSize[dstpf];\n\tif((*buf=(unsigned char *)malloc((*w)*(*h)*dstps))==NULL)\n\t\t_throw(\"loadbmp(): Memory allocation failure\");\n\n\twhile(cinfo.next_scanline<cinfo.image_height)\n\t{\n\t\tint i, nlines=(*src->get_pixel_rows)(&cinfo, src);\n\t\tfor(i=0; i<nlines; i++)\n\t\t{\n\t\t\tunsigned char *outbuf;  int row;\n\t\t\trow=cinfo.next_scanline+i;\n\t\t\tif(bottomup) outbuf=&(*buf)[((*h)-row-1)*(*w)*dstps];\n\t\t\telse outbuf=&(*buf)[row*(*w)*dstps];\n\t\t\tpixelconvert(src->buffer[i], srcpf, 0, outbuf, dstpf, bottomup, *w,\n\t\t\t\tnlines);\n\t\t}\n\t\tcinfo.next_scanline+=nlines;\n\t}\n\n\t(*src->finish_input)(&cinfo, src);\n\n\tbailout:\n\tjpeg_destroy_compress(&cinfo);\n\tif(file) fclose(file);\n\tif(retval<0 && buf && *buf) {free(*buf);  *buf=NULL;}\n\treturn retval;\n}\n\n\nint savebmp(char *filename, unsigned char *buf, int w, int h, int srcpf,\n\tint bottomup)\n{\n\tint retval=0, srcps, dstpf;\n\tstruct jpeg_decompress_struct dinfo;\n\tstruct my_error_mgr jerr;\n\tdjpeg_dest_ptr dst;\n\tFILE *file=NULL;\n\tchar *ptr=NULL;\n\n\tmemset(&dinfo, 0, sizeof(struct jpeg_decompress_struct));\n\n\tif(!filename || !buf || w<1 || h<1 || srcpf<0 || srcpf>=TJ_NUMPF)\n\t\t_throw(\"savebmp(): Invalid argument\");\n\n\tif((file=fopen(filename, \"wb\"))==NULL)\n\t\t_throwunix(\"savebmp(): Cannot open output file\");\n\n\tdinfo.err=jpeg_std_error(&jerr.pub);\n\tjerr.pub.error_exit=my_error_exit;\n\tjerr.pub.output_message=my_output_message;\n\n\tif(setjmp(jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;  goto bailout;\n\t}\n\n\tjpeg_create_decompress(&dinfo);\n\tif(srcpf==TJPF_GRAY)\n\t{\n\t\tdinfo.out_color_components=dinfo.output_components=1;\n\t\tdinfo.out_color_space=JCS_GRAYSCALE;\n\t}\n\telse\n\t{\n\t\tdinfo.out_color_components=dinfo.output_components=3;\n\t\tdinfo.out_color_space=JCS_RGB;\n\t}\n\tdinfo.image_width=w;  dinfo.image_height=h;\n\tdinfo.global_state=DSTATE_READY;\n\tdinfo.scale_num=dinfo.scale_denom=1;\n\n\tptr=strrchr(filename, '.');\n\tif(ptr && !strcasecmp(ptr, \".bmp\"))\n\t{\n\t\tif((dst=jinit_write_bmp(&dinfo, 0))==NULL)\n\t\t\t_throw(\"savebmp(): Could not initialize bitmap writer\");\n\t}\n\telse\n\t{\n\t\tif((dst=jinit_write_ppm(&dinfo))==NULL)\n\t\t\t_throw(\"savebmp(): Could not initialize PPM writer\");\n\t}\n\n\tdst->output_file=file;\n\t(*dst->start_output)(&dinfo, dst);\n\t(*dinfo.mem->realize_virt_arrays)((j_common_ptr)&dinfo);\n\n\tif(srcpf==TJPF_GRAY) dstpf=srcpf;\n\telse dstpf=TJPF_RGB;\n\tsrcps=tjPixelSize[srcpf];\n\n\twhile(dinfo.output_scanline<dinfo.output_height)\n\t{\n\t\tint i, nlines=dst->buffer_height;\n\t\tfor(i=0; i<nlines; i++)\n\t\t{\n\t\t\tunsigned char *inbuf;  int row;\n\t\t\trow=dinfo.output_scanline+i;\n\t\t\tif(bottomup) inbuf=&buf[(h-row-1)*w*srcps];\n\t\t\telse inbuf=&buf[row*w*srcps];\n\t\t\tpixelconvert(inbuf, srcpf, bottomup, dst->buffer[i], dstpf, 0, w,\n\t\t\t\tnlines);\n\t\t}\n\t\t(*dst->put_pixel_rows)(&dinfo, dst, nlines);\n\t\tdinfo.output_scanline+=nlines;\n\t}\n\n\t(*dst->finish_output)(&dinfo, dst);\n\n\tbailout:\n\tjpeg_destroy_decompress(&dinfo);\n\tif(file) fclose(file);\n\treturn retval;\n}\n\nconst char *bmpgeterr(void)\n{\n\treturn errStr;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/bmp.h",
    "content": "/*\n * Copyright (C)2011 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef __BMP_H__\n#define __BMP_H__\n\n#include \"./turbojpeg.h\"\n\nint loadbmp(char *filename, unsigned char **buf, int *w, int *h, int pf,\n\tint bottomup);\n\nint savebmp(char *filename, unsigned char *buf, int w, int h, int pf,\n\tint bottomup);\n\nconst char *bmpgeterr(void);\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/cderror.h",
    "content": "/*\n * cderror.h\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * Modified 2009 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file defines the error and message codes for the cjpeg/djpeg\n * applications.  These strings are not needed as part of the JPEG library\n * proper.\n * Edit this file to add new codes, or to translate the message strings to\n * some other language.\n */\n\n/*\n * To define the enum list of message codes, include this file without\n * defining macro JMESSAGE.  To create a message string table, include it\n * again with a suitable JMESSAGE definition (see jerror.c for an example).\n */\n#ifndef JMESSAGE\n#ifndef CDERROR_H\n#define CDERROR_H\n/* First time through, define the enum list */\n#define JMAKE_ENUM_LIST\n#else\n/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */\n#define JMESSAGE(code,string)\n#endif /* CDERROR_H */\n#endif /* JMESSAGE */\n\n#ifdef JMAKE_ENUM_LIST\n\ntypedef enum {\n\n#define JMESSAGE(code,string)   code ,\n\n#endif /* JMAKE_ENUM_LIST */\n\nJMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */\n\n#ifdef BMP_SUPPORTED\nJMESSAGE(JERR_BMP_BADCMAP, \"Unsupported BMP colormap format\")\nJMESSAGE(JERR_BMP_BADDEPTH, \"Only 8- and 24-bit BMP files are supported\")\nJMESSAGE(JERR_BMP_BADHEADER, \"Invalid BMP file: bad header length\")\nJMESSAGE(JERR_BMP_BADPLANES, \"Invalid BMP file: biPlanes not equal to 1\")\nJMESSAGE(JERR_BMP_COLORSPACE, \"BMP output must be grayscale or RGB\")\nJMESSAGE(JERR_BMP_COMPRESSED, \"Sorry, compressed BMPs not yet supported\")\nJMESSAGE(JERR_BMP_EMPTY, \"Empty BMP image\")\nJMESSAGE(JERR_BMP_NOT, \"Not a BMP file - does not start with BM\")\nJMESSAGE(JTRC_BMP, \"%ux%u 24-bit BMP image\")\nJMESSAGE(JTRC_BMP_MAPPED, \"%ux%u 8-bit colormapped BMP image\")\nJMESSAGE(JTRC_BMP_OS2, \"%ux%u 24-bit OS2 BMP image\")\nJMESSAGE(JTRC_BMP_OS2_MAPPED, \"%ux%u 8-bit colormapped OS2 BMP image\")\n#endif /* BMP_SUPPORTED */\n\n#ifdef GIF_SUPPORTED\nJMESSAGE(JERR_GIF_BUG, \"GIF output got confused\")\nJMESSAGE(JERR_GIF_CODESIZE, \"Bogus GIF codesize %d\")\nJMESSAGE(JERR_GIF_COLORSPACE, \"GIF output must be grayscale or RGB\")\nJMESSAGE(JERR_GIF_IMAGENOTFOUND, \"Too few images in GIF file\")\nJMESSAGE(JERR_GIF_NOT, \"Not a GIF file\")\nJMESSAGE(JTRC_GIF, \"%ux%ux%d GIF image\")\nJMESSAGE(JTRC_GIF_BADVERSION,\n         \"Warning: unexpected GIF version number '%c%c%c'\")\nJMESSAGE(JTRC_GIF_EXTENSION, \"Ignoring GIF extension block of type 0x%02x\")\nJMESSAGE(JTRC_GIF_NONSQUARE, \"Caution: nonsquare pixels in input\")\nJMESSAGE(JWRN_GIF_BADDATA, \"Corrupt data in GIF file\")\nJMESSAGE(JWRN_GIF_CHAR, \"Bogus char 0x%02x in GIF file, ignoring\")\nJMESSAGE(JWRN_GIF_ENDCODE, \"Premature end of GIF image\")\nJMESSAGE(JWRN_GIF_NOMOREDATA, \"Ran out of GIF bits\")\n#endif /* GIF_SUPPORTED */\n\n#ifdef PPM_SUPPORTED\nJMESSAGE(JERR_PPM_COLORSPACE, \"PPM output must be grayscale or RGB\")\nJMESSAGE(JERR_PPM_NONNUMERIC, \"Nonnumeric data in PPM file\")\nJMESSAGE(JERR_PPM_TOOLARGE, \"Integer value too large in PPM file\")\nJMESSAGE(JERR_PPM_NOT, \"Not a PPM/PGM file\")\nJMESSAGE(JTRC_PGM, \"%ux%u PGM image\")\nJMESSAGE(JTRC_PGM_TEXT, \"%ux%u text PGM image\")\nJMESSAGE(JTRC_PPM, \"%ux%u PPM image\")\nJMESSAGE(JTRC_PPM_TEXT, \"%ux%u text PPM image\")\n#endif /* PPM_SUPPORTED */\n\n#ifdef RLE_SUPPORTED\nJMESSAGE(JERR_RLE_BADERROR, \"Bogus error code from RLE library\")\nJMESSAGE(JERR_RLE_COLORSPACE, \"RLE output must be grayscale or RGB\")\nJMESSAGE(JERR_RLE_DIMENSIONS, \"Image dimensions (%ux%u) too large for RLE\")\nJMESSAGE(JERR_RLE_EMPTY, \"Empty RLE file\")\nJMESSAGE(JERR_RLE_EOF, \"Premature EOF in RLE header\")\nJMESSAGE(JERR_RLE_MEM, \"Insufficient memory for RLE header\")\nJMESSAGE(JERR_RLE_NOT, \"Not an RLE file\")\nJMESSAGE(JERR_RLE_TOOMANYCHANNELS, \"Cannot handle %d output channels for RLE\")\nJMESSAGE(JERR_RLE_UNSUPPORTED, \"Cannot handle this RLE setup\")\nJMESSAGE(JTRC_RLE, \"%ux%u full-color RLE file\")\nJMESSAGE(JTRC_RLE_FULLMAP, \"%ux%u full-color RLE file with map of length %d\")\nJMESSAGE(JTRC_RLE_GRAY, \"%ux%u grayscale RLE file\")\nJMESSAGE(JTRC_RLE_MAPGRAY, \"%ux%u grayscale RLE file with map of length %d\")\nJMESSAGE(JTRC_RLE_MAPPED, \"%ux%u colormapped RLE file with map of length %d\")\n#endif /* RLE_SUPPORTED */\n\n#ifdef TARGA_SUPPORTED\nJMESSAGE(JERR_TGA_BADCMAP, \"Unsupported Targa colormap format\")\nJMESSAGE(JERR_TGA_BADPARMS, \"Invalid or unsupported Targa file\")\nJMESSAGE(JERR_TGA_COLORSPACE, \"Targa output must be grayscale or RGB\")\nJMESSAGE(JTRC_TGA, \"%ux%u RGB Targa image\")\nJMESSAGE(JTRC_TGA_GRAY, \"%ux%u grayscale Targa image\")\nJMESSAGE(JTRC_TGA_MAPPED, \"%ux%u colormapped Targa image\")\n#else\nJMESSAGE(JERR_TGA_NOTCOMP, \"Targa support was not compiled\")\n#endif /* TARGA_SUPPORTED */\n\nJMESSAGE(JERR_BAD_CMAP_FILE,\n         \"Color map file is invalid or of unsupported format\")\nJMESSAGE(JERR_TOO_MANY_COLORS,\n         \"Output file format cannot handle %d colormap entries\")\nJMESSAGE(JERR_UNGETC_FAILED, \"ungetc failed\")\n#ifdef TARGA_SUPPORTED\nJMESSAGE(JERR_UNKNOWN_FORMAT,\n         \"Unrecognized input file format --- perhaps you need -targa\")\n#else\nJMESSAGE(JERR_UNKNOWN_FORMAT, \"Unrecognized input file format\")\n#endif\nJMESSAGE(JERR_UNSUPPORTED_FORMAT, \"Unsupported output file format\")\n\n#ifdef JMAKE_ENUM_LIST\n\n  JMSG_LASTADDONCODE\n} ADDON_MESSAGE_CODE;\n\n#undef JMAKE_ENUM_LIST\n#endif /* JMAKE_ENUM_LIST */\n\n/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */\n#undef JMESSAGE\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/cdjpeg.c",
    "content": "/*\n * cdjpeg.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains common support routines used by the IJG application\n * programs (cjpeg, djpeg, jpegtran).\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n#include <ctype.h>              /* to declare isupper(), tolower() */\n#ifdef USE_SETMODE\n#include <fcntl.h>              /* to declare setmode()'s parameter macros */\n/* If you have setmode() but not <io.h>, just delete this line: */\n#include <io.h>                 /* to declare setmode() */\n#endif\n\n\n/*\n * Optional progress monitor: display a percent-done figure on stderr.\n */\n\n#ifdef PROGRESS_REPORT\n\nMETHODDEF(void)\nprogress_monitor (j_common_ptr cinfo)\n{\n  cd_progress_ptr prog = (cd_progress_ptr) cinfo->progress;\n  int total_passes = prog->pub.total_passes + prog->total_extra_passes;\n  int percent_done = (int) (prog->pub.pass_counter*100L/prog->pub.pass_limit);\n\n  if (percent_done != prog->percent_done) {\n    prog->percent_done = percent_done;\n    if (total_passes > 1) {\n      fprintf(stderr, \"\\rPass %d/%d: %3d%% \",\n              prog->pub.completed_passes + prog->completed_extra_passes + 1,\n              total_passes, percent_done);\n    } else {\n      fprintf(stderr, \"\\r %3d%% \", percent_done);\n    }\n    fflush(stderr);\n  }\n}\n\n\nGLOBAL(void)\nstart_progress_monitor (j_common_ptr cinfo, cd_progress_ptr progress)\n{\n  /* Enable progress display, unless trace output is on */\n  if (cinfo->err->trace_level == 0) {\n    progress->pub.progress_monitor = progress_monitor;\n    progress->completed_extra_passes = 0;\n    progress->total_extra_passes = 0;\n    progress->percent_done = -1;\n    cinfo->progress = &progress->pub;\n  }\n}\n\n\nGLOBAL(void)\nend_progress_monitor (j_common_ptr cinfo)\n{\n  /* Clear away progress display */\n  if (cinfo->err->trace_level == 0) {\n    fprintf(stderr, \"\\r                \\r\");\n    fflush(stderr);\n  }\n}\n\n#endif\n\n\n/*\n * Case-insensitive matching of possibly-abbreviated keyword switches.\n * keyword is the constant keyword (must be lower case already),\n * minchars is length of minimum legal abbreviation.\n */\n\nGLOBAL(boolean)\nkeymatch (char *arg, const char *keyword, int minchars)\n{\n  register int ca, ck;\n  register int nmatched = 0;\n\n  while ((ca = *arg++) != '\\0') {\n    if ((ck = *keyword++) == '\\0')\n      return FALSE;             /* arg longer than keyword, no good */\n    if (isupper(ca))            /* force arg to lcase (assume ck is already) */\n      ca = tolower(ca);\n    if (ca != ck)\n      return FALSE;             /* no good */\n    nmatched++;                 /* count matched characters */\n  }\n  /* reached end of argument; fail if it's too short for unique abbrev */\n  if (nmatched < minchars)\n    return FALSE;\n  return TRUE;                  /* A-OK */\n}\n\n\n/*\n * Routines to establish binary I/O mode for stdin and stdout.\n * Non-Unix systems often require some hacking to get out of text mode.\n */\n\nGLOBAL(FILE *)\nread_stdin (void)\n{\n  FILE * input_file = stdin;\n\n#ifdef USE_SETMODE              /* need to hack file mode? */\n  setmode(fileno(stdin), O_BINARY);\n#endif\n#ifdef USE_FDOPEN               /* need to re-open in binary mode? */\n  if ((input_file = fdopen(fileno(stdin), READ_BINARY)) == NULL) {\n    fprintf(stderr, \"Cannot reopen stdin\\n\");\n    exit(EXIT_FAILURE);\n  }\n#endif\n  return input_file;\n}\n\n\nGLOBAL(FILE *)\nwrite_stdout (void)\n{\n  FILE * output_file = stdout;\n\n#ifdef USE_SETMODE              /* need to hack file mode? */\n  setmode(fileno(stdout), O_BINARY);\n#endif\n#ifdef USE_FDOPEN               /* need to re-open in binary mode? */\n  if ((output_file = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) {\n    fprintf(stderr, \"Cannot reopen stdout\\n\");\n    exit(EXIT_FAILURE);\n  }\n#endif\n  return output_file;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/cdjpeg.h",
    "content": "/*\n * cdjpeg.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains common declarations for the sample applications\n * cjpeg and djpeg.  It is NOT used by the core JPEG library.\n */\n\n#define JPEG_CJPEG_DJPEG        /* define proper options in jconfig.h */\n#define JPEG_INTERNAL_OPTIONS   /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jerror.h\"             /* get library error codes too */\n#include \"cderror.h\"            /* get application-specific error codes */\n\n\n/*\n * Object interface for cjpeg's source file decoding modules\n */\n\ntypedef struct cjpeg_source_struct *cjpeg_source_ptr;\n\nstruct cjpeg_source_struct {\n  void (*start_input) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo);\n  JDIMENSION (*get_pixel_rows) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo);\n  void (*finish_input) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo);\n\n  FILE *input_file;\n\n  JSAMPARRAY buffer;\n  JDIMENSION buffer_height;\n};\n\n\n/*\n * Object interface for djpeg's output file encoding modules\n */\n\ntypedef struct djpeg_dest_struct *djpeg_dest_ptr;\n\nstruct djpeg_dest_struct {\n  /* start_output is called after jpeg_start_decompress finishes.\n   * The color map will be ready at this time, if one is needed.\n   */\n  void (*start_output) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo);\n  /* Emit the specified number of pixel rows from the buffer. */\n  void (*put_pixel_rows) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n                          JDIMENSION rows_supplied);\n  /* Finish up at the end of the image. */\n  void (*finish_output) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo);\n\n  /* Target file spec; filled in by djpeg.c after object is created. */\n  FILE *output_file;\n\n  /* Output pixel-row buffer.  Created by module init or start_output.\n   * Width is cinfo->output_width * cinfo->output_components;\n   * height is buffer_height.\n   */\n  JSAMPARRAY buffer;\n  JDIMENSION buffer_height;\n};\n\n\n/*\n * cjpeg/djpeg may need to perform extra passes to convert to or from\n * the source/destination file format.  The JPEG library does not know\n * about these passes, but we'd like them to be counted by the progress\n * monitor.  We use an expanded progress monitor object to hold the\n * additional pass count.\n */\n\nstruct cdjpeg_progress_mgr {\n  struct jpeg_progress_mgr pub; /* fields known to JPEG library */\n  int completed_extra_passes;   /* extra passes completed */\n  int total_extra_passes;       /* total extra */\n  /* last printed percentage stored here to avoid multiple printouts */\n  int percent_done;\n};\n\ntypedef struct cdjpeg_progress_mgr *cd_progress_ptr;\n\n\n/* Module selection routines for I/O modules. */\n\nEXTERN(cjpeg_source_ptr) jinit_read_bmp (j_compress_ptr cinfo);\nEXTERN(djpeg_dest_ptr) jinit_write_bmp (j_decompress_ptr cinfo,\n                                        boolean is_os2);\nEXTERN(cjpeg_source_ptr) jinit_read_gif (j_compress_ptr cinfo);\nEXTERN(djpeg_dest_ptr) jinit_write_gif (j_decompress_ptr cinfo);\nEXTERN(cjpeg_source_ptr) jinit_read_ppm (j_compress_ptr cinfo);\nEXTERN(djpeg_dest_ptr) jinit_write_ppm (j_decompress_ptr cinfo);\nEXTERN(cjpeg_source_ptr) jinit_read_rle (j_compress_ptr cinfo);\nEXTERN(djpeg_dest_ptr) jinit_write_rle (j_decompress_ptr cinfo);\nEXTERN(cjpeg_source_ptr) jinit_read_targa (j_compress_ptr cinfo);\nEXTERN(djpeg_dest_ptr) jinit_write_targa (j_decompress_ptr cinfo);\n\n/* cjpeg support routines (in rdswitch.c) */\n\nEXTERN(boolean) read_quant_tables (j_compress_ptr cinfo, char *filename,\n                                   boolean force_baseline);\nEXTERN(boolean) read_scan_script (j_compress_ptr cinfo, char *filename);\nEXTERN(boolean) set_quality_ratings (j_compress_ptr cinfo, char *arg,\n                                     boolean force_baseline);\nEXTERN(boolean) set_quant_slots (j_compress_ptr cinfo, char *arg);\nEXTERN(boolean) set_sample_factors (j_compress_ptr cinfo, char *arg);\n\n/* djpeg support routines (in rdcolmap.c) */\n\nEXTERN(void) read_color_map (j_decompress_ptr cinfo, FILE *infile);\n\n/* common support routines (in cdjpeg.c) */\n\nEXTERN(void) enable_signal_catcher (j_common_ptr cinfo);\nEXTERN(void) start_progress_monitor (j_common_ptr cinfo,\n                                     cd_progress_ptr progress);\nEXTERN(void) end_progress_monitor (j_common_ptr cinfo);\nEXTERN(boolean) keymatch (char *arg, const char *keyword, int minchars);\nEXTERN(FILE *) read_stdin (void);\nEXTERN(FILE *) write_stdout (void);\n\n/* miscellaneous useful macros */\n\n#ifdef DONT_USE_B_MODE          /* define mode parameters for fopen() */\n#define READ_BINARY     \"r\"\n#define WRITE_BINARY    \"w\"\n#else\n#define READ_BINARY     \"rb\"\n#define WRITE_BINARY    \"wb\"\n#endif\n\n#ifndef EXIT_FAILURE            /* define exit() codes if not provided */\n#define EXIT_FAILURE  1\n#endif\n#ifndef EXIT_SUCCESS\n#define EXIT_SUCCESS  0\n#endif\n#ifndef EXIT_WARNING\n#define EXIT_WARNING  2\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/change.log",
    "content": "libjpeg-turbo note:  This file has been modified by The libjpeg-turbo Project\nto include only information relevant to libjpeg-turbo.  It is included only for\nreference.  Please see ChangeLog.md for information specific to libjpeg-turbo.\n\n\nCHANGE LOG for Independent JPEG Group's JPEG software\n\n\nVersion 9b  17-Jan-2016\n-----------------------\n\nDocument 'f' specifier for jpegtran -crop specification.\nThank to Michele Martone for suggestion.\n\n\nVersion 9  13-Jan-2013\n----------------------\n\nAdd remark for jpeg_mem_dest() in jdatadst.c.\nThank to Elie-Gregoire Khoury for the hint.\n\nCorrect argument type in format string, avoid compiler warnings.\nThank to Vincent Torri for hint.\n\n\nVersion 8d  15-Jan-2012\n-----------------------\n\nAdd cjpeg -rgb option to create RGB JPEG files.\nUsing this switch suppresses the conversion from RGB\ncolorspace input to the default YCbCr JPEG colorspace.\nThank to Michael Koch for the initial suggestion.\n\nAdd option to disable the region adjustment in the transupp crop code.\nThank to Jeffrey Friedl for the suggestion.\n\n\nVersion 8b  16-May-2010\n-----------------------\n\nRepair problem in new memory source manager with corrupt JPEG data.\nThank to Ted Campbell and Samuel Chun for the report.\n\n\nVersion 8a  28-Feb-2010\n-----------------------\n\nWriting tables-only datastreams via jpeg_write_tables works again.\n\nSupport 32-bit BMPs (RGB image with Alpha channel) for read in cjpeg.\nThank to Brett Blackham for the suggestion.\n\n\nVersion 8  10-Jan-2010\n----------------------\n\nAdd sanity check in BMP reader module to avoid cjpeg crash for empty input\nimage (thank to Isaev Ildar of ISP RAS, Moscow, RU for reporting this error).\n\nAdd data source and destination managers for read from and write to\nmemory buffers.  New API functions jpeg_mem_src and jpeg_mem_dest.\nThank to Roberto Boni from Italy for the suggestion.\n\n\nVersion 7  27-Jun-2009\n----------------------\n\nNew scaled DCTs implemented.\ndjpeg now supports scalings N/8 with all N from 1 to 16.\n\ncjpeg -quality option has been extended for support of separate quality\nsettings for luminance and chrominance (or in general, for every provided\nquantization table slot).\nNew API function jpeg_default_qtables() and q_scale_factor array in library.\n\nSupport arithmetic entropy encoding and decoding.\nAdded files jaricom.c, jcarith.c, jdarith.c.\n\njpegtran has a new \"lossless\" cropping feature.\n\nImplement -perfect option in jpegtran, new API function\njtransform_perfect_transform() in transupp. (DP 204_perfect.dpatch)\n\nBetter error messages for jpegtran fopen failure.\n(DP 203_jpegtran_errmsg.dpatch)\n\nFix byte order issue with 16bit PPM/PGM files in rdppm.c/wrppm.c:\naccording to Netpbm, the de facto standard implementation of the PNM formats,\nthe most significant byte is first. (DP 203_rdppm.dpatch)\n\nAdd -raw option to rdjpgcom not to mangle the output.\n(DP 205_rdjpgcom_raw.dpatch)\n\nMake rdjpgcom locale aware. (DP 201_rdjpgcom_locale.dpatch)\n\nAdd extern \"C\" to jpeglib.h.\nThis avoids the need to put extern \"C\" { ... } around #include \"jpeglib.h\"\nin your C++ application.  Defining the symbol DONT_USE_EXTERN_C in the\nconfiguration prevents this. (DP 202_jpeglib.h_c++.dpatch)\n\n\nVersion 6b  27-Mar-1998\n-----------------------\n\njpegtran has new features for lossless image transformations (rotation\nand flipping) as well as \"lossless\" reduction to grayscale.\n\njpegtran now copies comments by default; it has a -copy switch to enable\ncopying all APPn blocks as well, or to suppress comments.  (Formerly it\nalways suppressed comments and APPn blocks.)  jpegtran now also preserves\nJFIF version and resolution information.\n\nNew decompressor library feature: COM and APPn markers found in the input\nfile can be saved in memory for later use by the application.  (Before,\nyou had to code this up yourself with a custom marker processor.)\n\nThere is an unused field \"void * client_data\" now in compress and decompress\nparameter structs; this may be useful in some applications.\n\nJFIF version number information is now saved by the decoder and accepted by\nthe encoder.  jpegtran uses this to copy the source file's version number,\nto ensure \"jpegtran -copy all\" won't create bogus files that contain JFXX\nextensions but claim to be version 1.01.  Applications that generate their\nown JFXX extension markers also (finally) have a supported way to cause the\nencoder to emit JFIF version number 1.02.\n\ndjpeg's trace mode reports JFIF 1.02 thumbnail images as such, rather\nthan as unknown APP0 markers.\n\nIn -verbose mode, djpeg and rdjpgcom will try to print the contents of\nAPP12 markers as text.  Some digital cameras store useful text information\nin APP12 markers.\n\nHandling of truncated data streams is more robust: blocks beyond the one in\nwhich the error occurs will be output as uniform gray, or left unchanged\nif decoding a progressive JPEG.  The appearance no longer depends on the\nHuffman tables being used.\n\nHuffman tables are checked for validity much more carefully than before.\n\nTo avoid the Unisys LZW patent, djpeg's GIF output capability has been\nchanged to produce \"uncompressed GIFs\", and cjpeg's GIF input capability\nhas been removed altogether.  We're not happy about it either, but there\nseems to be no good alternative.\n\nThe configure script now supports building libjpeg as a shared library\non many flavors of Unix (all the ones that GNU libtool knows how to\nbuild shared libraries for).  Use \"./configure --enable-shared\" to\ntry this out.\n\nNew jconfig file and makefiles for Microsoft Visual C++ and Developer Studio.\nAlso, a jconfig file and a build script for Metrowerks CodeWarrior\non Apple Macintosh.  makefile.dj has been updated for DJGPP v2, and there\nare miscellaneous other minor improvements in the makefiles.\n\njmemmac.c now knows how to create temporary files following Mac System 7\nconventions.\n\ndjpeg's -map switch is now able to read raw-format PPM files reliably.\n\ncjpeg -progressive -restart no longer generates any unnecessary DRI markers.\n\nMultiple calls to jpeg_simple_progression for a single JPEG object\nno longer leak memory.\n\n\nVersion 6a  7-Feb-96\n--------------------\n\nLibrary initialization sequence modified to detect version mismatches\nand struct field packing mismatches between library and calling application.\nThis change requires applications to be recompiled, but does not require\nany application source code change.\n\nAll routine declarations changed to the style \"GLOBAL(type) name ...\",\nthat is, GLOBAL, LOCAL, METHODDEF, EXTERN are now macros taking the\nroutine's return type as an argument.  This makes it possible to add\nMicrosoft-style linkage keywords to all the routines by changing just\nthese macros.  Note that any application code that was using these macros\nwill have to be changed.\n\nDCT coefficient quantization tables are now stored in normal array order\nrather than zigzag order.  Application code that calls jpeg_add_quant_table,\nor otherwise manipulates quantization tables directly, will need to be\nchanged.  If you need to make such code work with either older or newer\nversions of the library, a test like \"#if JPEG_LIB_VERSION >= 61\" is\nrecommended.\n\ndjpeg's trace capability now dumps DQT tables in natural order, not zigzag\norder.  This allows the trace output to be made into a \"-qtables\" file\nmore easily.\n\nNew system-dependent memory manager module for use on Apple Macintosh.\n\nFix bug in cjpeg's -smooth option: last one or two scanlines would be\nduplicates of the prior line unless the image height mod 16 was 1 or 2.\n\nRepair minor problems in VMS, BCC, MC6 makefiles.\n\nNew configure script based on latest GNU Autoconf.\n\nCorrect the list of include files needed by MetroWerks C for ccommand().\n\nNumerous small documentation updates.\n\n\nVersion 6  2-Aug-95\n-------------------\n\nProgressive JPEG support: library can read and write full progressive JPEG\nfiles.  A \"buffered image\" mode supports incremental decoding for on-the-fly\ndisplay of progressive images.  Simply recompiling an existing IJG-v5-based\ndecoder with v6 should allow it to read progressive files, though of course\nwithout any special progressive display.\n\nNew \"jpegtran\" application performs lossless transcoding between different\nJPEG formats; primarily, it can be used to convert baseline to progressive\nJPEG and vice versa.  In support of jpegtran, the library now allows lossless\nreading and writing of JPEG files as DCT coefficient arrays.  This ability\nmay be of use in other applications.\n\nNotes for programmers:\n* We changed jpeg_start_decompress() to be able to suspend; this makes all\ndecoding modes available to suspending-input applications.  However,\nexisting applications that use suspending input will need to be changed\nto check the return value from jpeg_start_decompress().  You don't need to\ndo anything if you don't use a suspending data source.\n* We changed the interface to the virtual array routines: access_virt_array\nroutines now take a count of the number of rows to access this time.  The\nlast parameter to request_virt_array routines is now interpreted as the\nmaximum number of rows that may be accessed at once, but not necessarily\nthe height of every access.\n\n\nVersion 5b  15-Mar-95\n---------------------\n\nCorrect bugs with grayscale images having v_samp_factor > 1.\n\njpeg_write_raw_data() now supports output suspension.\n\nCorrect bugs in \"configure\" script for case of compiling in\na directory other than the one containing the source files.\n\nRepair bug in jquant1.c: sometimes didn't use as many colors as it could.\n\nBorland C makefile and jconfig file work under either MS-DOS or OS/2.\n\nMiscellaneous improvements to documentation.\n\n\nVersion 5a  7-Dec-94\n--------------------\n\nChanged color conversion roundoff behavior so that grayscale values are\nrepresented exactly.  (This causes test image files to change.)\n\nMake ordered dither use 16x16 instead of 4x4 pattern for a small quality\nimprovement.\n\nNew configure script based on latest GNU Autoconf.\nFix configure script to handle CFLAGS correctly.\nRename *.auto files to *.cfg, so that configure script still works if\nfile names have been truncated for DOS.\n\nFix bug in rdbmp.c: didn't allow for extra data between header and image.\n\nModify rdppm.c/wrppm.c to handle 2-byte raw PPM/PGM formats for 12-bit data.\n\nFix several bugs in rdrle.c.\n\nNEED_SHORT_EXTERNAL_NAMES option was broken.\n\nRevise jerror.h/jerror.c for more flexibility in message table.\n\nRepair oversight in jmemname.c NO_MKTEMP case: file could be there\nbut unreadable.\n\n\nVersion 5  24-Sep-94\n--------------------\n\nVersion 5 represents a nearly complete redesign and rewrite of the IJG\nsoftware.  Major user-visible changes include:\n  * Automatic configuration simplifies installation for most Unix systems.\n  * A range of speed vs. image quality tradeoffs are supported.\n    This includes resizing of an image during decompression: scaling down\n    by a factor of 1/2, 1/4, or 1/8 is handled very efficiently.\n  * New programs rdjpgcom and wrjpgcom allow insertion and extraction\n    of text comments in a JPEG file.\n\nThe application programmer's interface to the library has changed completely.\nNotable improvements include:\n  * We have eliminated the use of callback routines for handling the\n    uncompressed image data.  The application now sees the library as a\n    set of routines that it calls to read or write image data on a\n    scanline-by-scanline basis.\n  * The application image data is represented in a conventional interleaved-\n    pixel format, rather than as a separate array for each color channel.\n    This can save a copying step in many programs.\n  * The handling of compressed data has been cleaned up: the application can\n    supply routines to source or sink the compressed data.  It is possible to\n    suspend processing on source/sink buffer overrun, although this is not\n    supported in all operating modes.\n  * All static state has been eliminated from the library, so that multiple\n    instances of compression or decompression can be active concurrently.\n  * JPEG abbreviated datastream formats are supported, ie, quantization and\n    Huffman tables can be stored separately from the image data.\n  * And not only that, but the documentation of the library has improved\n    considerably!\n\n\nThe last widely used release before the version 5 rewrite was version 4A of\n18-Feb-93.  Change logs before that point have been discarded, since they\nare not of much interest after the rewrite.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/cjpeg.1",
    "content": ".TH CJPEG 1 \"17 February 2016\"\n.SH NAME\ncjpeg \\- compress an image file to a JPEG file\n.SH SYNOPSIS\n.B cjpeg\n[\n.I options\n]\n[\n.I filename\n]\n.LP\n.SH DESCRIPTION\n.LP\n.B cjpeg\ncompresses the named image file, or the standard input if no file is\nnamed, and produces a JPEG/JFIF file on the standard output.\nThe currently supported input file formats are: PPM (PBMPLUS color\nformat), PGM (PBMPLUS grayscale format), BMP, Targa, and RLE (Utah Raster\nToolkit format).  (RLE is supported only if the URT library is available.)\n.SH OPTIONS\nAll switch names may be abbreviated; for example,\n.B \\-grayscale\nmay be written\n.B \\-gray\nor\n.BR \\-gr .\nMost of the \"basic\" switches can be abbreviated to as little as one letter.\nUpper and lower case are equivalent (thus\n.B \\-BMP\nis the same as\n.BR \\-bmp ).\nBritish spellings are also accepted (e.g.,\n.BR \\-greyscale ),\nthough for brevity these are not mentioned below.\n.PP\nThe basic switches are:\n.TP\n.BI \\-quality \" N[,...]\"\nScale quantization tables to adjust image quality.  Quality is 0 (worst) to\n100 (best); default is 75.  (See below for more info.)\n.TP\n.B \\-grayscale\nCreate monochrome JPEG file from color input.  Be sure to use this switch when\ncompressing a grayscale BMP file, because\n.B cjpeg\nisn't bright enough to notice whether a BMP file uses only shades of gray.\nBy saying\n.BR \\-grayscale ,\nyou'll get a smaller JPEG file that takes less time to process.\n.TP\n.B \\-rgb\nCreate RGB JPEG file.\nUsing this switch suppresses the conversion from RGB\ncolorspace input to the default YCbCr JPEG colorspace.\n.TP\n.B \\-optimize\nPerform optimization of entropy encoding parameters.  Without this, default\nencoding parameters are used.\n.B \\-optimize\nusually makes the JPEG file a little smaller, but\n.B cjpeg\nruns somewhat slower and needs much more memory.  Image quality and speed of\ndecompression are unaffected by\n.BR \\-optimize .\n.TP\n.B \\-progressive\nCreate progressive JPEG file (see below).\n.TP\n.B \\-targa\nInput file is Targa format.  Targa files that contain an \"identification\"\nfield will not be automatically recognized by\n.BR cjpeg ;\nfor such files you must specify\n.B \\-targa\nto make\n.B cjpeg\ntreat the input as Targa format.\nFor most Targa files, you won't need this switch.\n.PP\nThe\n.B \\-quality\nswitch lets you trade off compressed file size against quality of the\nreconstructed image: the higher the quality setting, the larger the JPEG file,\nand the closer the output image will be to the original input.  Normally you\nwant to use the lowest quality setting (smallest file) that decompresses into\nsomething visually indistinguishable from the original image.  For this\npurpose the quality setting should generally be between 50 and 95 (the default\nis 75) for photographic images.  If you see defects at\n.B \\-quality\n75, then go up 5 or 10 counts at a time until you are happy with the output\nimage.  (The optimal setting will vary from one image to another.)\n.PP\n.B \\-quality\n100 will generate a quantization table of all 1's, minimizing loss in the\nquantization step (but there is still information loss in subsampling, as well\nas roundoff error.)  For most images, specifying a quality value above\nabout 95 will increase the size of the compressed file dramatically, and while\nthe quality gain from these higher quality values is measurable (using metrics\nsuch as PSNR or SSIM), it is rarely perceivable by human vision.\n.PP\nIn the other direction, quality values below 50 will produce very small files\nof low image quality.  Settings around 5 to 10 might be useful in preparing an\nindex of a large image library, for example.  Try\n.B \\-quality\n2 (or so) for some amusing Cubist effects.  (Note: quality\nvalues below about 25 generate 2-byte quantization tables, which are\nconsidered optional in the JPEG standard.\n.B cjpeg\nemits a warning message when you give such a quality value, because some\nother JPEG programs may be unable to decode the resulting file.  Use\n.B \\-baseline\nif you need to ensure compatibility at low quality values.)\n.PP\nThe \\fB-quality\\fR option has been extended in this version of \\fBcjpeg\\fR to\nsupport separate quality settings for luminance and chrominance (or, in\ngeneral, separate settings for every quantization table slot.)  The principle\nis the same as chrominance subsampling:  since the human eye is more sensitive\nto spatial changes in brightness than spatial changes in color, the chrominance\ncomponents can be quantized more than the luminance components without\nincurring any visible image quality loss.  However, unlike subsampling, this\nfeature reduces data in the frequency domain instead of the spatial domain,\nwhich allows for more fine-grained control.  This option is useful in\nquality-sensitive applications, for which the artifacts generated by\nsubsampling may be unacceptable.\n.PP\nThe \\fB-quality\\fR option accepts a comma-separated list of parameters, which\nrespectively refer to the quality levels that should be assigned to the\nquantization table slots.  If there are more q-table slots than parameters,\nthen the last parameter is replicated.  Thus, if only one quality parameter is\ngiven, this is used for both luminance and chrominance (slots 0 and 1,\nrespectively), preserving the legacy behavior of cjpeg v6b and prior.\nMore (or customized) quantization tables can be set with the \\fB-qtables\\fR\noption and assigned to components with the \\fB-qslots\\fR option (see the\n\"wizard\" switches below.)\n.PP\nJPEG files generated with separate luminance and chrominance quality are fully\ncompliant with standard JPEG decoders.\n.PP\n.BR CAUTION:\nFor this setting to be useful, be sure to pass an argument of \\fB-sample 1x1\\fR\nto \\fBcjpeg\\fR to disable chrominance subsampling.  Otherwise, the default\nsubsampling level (2x2, AKA \"4:2:0\") will be used.\n.PP\nThe\n.B \\-progressive\nswitch creates a \"progressive JPEG\" file.  In this type of JPEG file, the data\nis stored in multiple scans of increasing quality.  If the file is being\ntransmitted over a slow communications link, the decoder can use the first\nscan to display a low-quality image very quickly, and can then improve the\ndisplay with each subsequent scan.  The final image is exactly equivalent to a\nstandard JPEG file of the same quality setting, and the total file size is\nabout the same --- often a little smaller.\n.PP\nSwitches for advanced users:\n.TP\n.B \\-arithmetic\nUse arithmetic coding.\n.B Caution:\narithmetic coded JPEG is not yet widely implemented, so many decoders will be\nunable to view an arithmetic coded JPEG file at all.\n.TP\n.B \\-dct int\nUse integer DCT method (default).\n.TP\n.B \\-dct fast\nUse fast integer DCT (less accurate).\nIn libjpeg-turbo, the fast method is generally about 5-15% faster than the int\nmethod when using the x86/x86-64 SIMD extensions (results may vary with other\nSIMD implementations, or when using libjpeg-turbo without SIMD extensions.)\nFor quality levels of 90 and below, there should be little or no perceptible\ndifference between the two algorithms.  For quality levels above 90, however,\nthe difference between the fast and the int methods becomes more pronounced.\nWith quality=97, for instance, the fast method incurs generally about a 1-3 dB\nloss (in PSNR) relative to the int method, but this can be larger for some\nimages.  Do not use the fast method with quality levels above 97.  The\nalgorithm often degenerates at quality=98 and above and can actually produce a\nmore lossy image than if lower quality levels had been used.  Also, in\nlibjpeg-turbo, the fast method is not fully accelerated for quality levels\nabove 97, so it will be slower than the int method.\n.TP\n.B \\-dct float\nUse floating-point DCT method.\nThe float method is mainly a legacy feature.  It does not produce significantly\nmore accurate results than the int method, and it is much slower.  The float\nmethod may also give different results on different machines due to varying\nroundoff behavior, whereas the integer methods should give the same results on\nall machines.\n.TP\n.BI \\-restart \" N\"\nEmit a JPEG restart marker every N MCU rows, or every N MCU blocks if \"B\" is\nattached to the number.\n.B \\-restart 0\n(the default) means no restart markers.\n.TP\n.BI \\-smooth \" N\"\nSmooth the input image to eliminate dithering noise.  N, ranging from 1 to\n100, indicates the strength of smoothing.  0 (the default) means no smoothing.\n.TP\n.BI \\-maxmemory \" N\"\nSet limit for amount of memory to use in processing large images.  Value is\nin thousands of bytes, or millions of bytes if \"M\" is attached to the\nnumber.  For example,\n.B \\-max 4m\nselects 4000000 bytes.  If more space is needed, temporary files will be used.\n.TP\n.BI \\-outfile \" name\"\nSend output image to the named file, not to standard output.\n.TP\n.BI \\-memdst\nCompress to memory instead of a file.  This feature was implemented mainly as a\nway of testing the in-memory destination manager (jpeg_mem_dest()), but it is\nalso useful for benchmarking, since it reduces the I/O overhead.\n.TP\n.B \\-verbose\nEnable debug printout.  More\n.BR \\-v 's\ngive more output.  Also, version information is printed at startup.\n.TP\n.B \\-debug\nSame as\n.BR \\-verbose .\n.TP\n.B \\-version\nPrint version information and exit.\n.PP\nThe\n.B \\-restart\noption inserts extra markers that allow a JPEG decoder to resynchronize after\na transmission error.  Without restart markers, any damage to a compressed\nfile will usually ruin the image from the point of the error to the end of the\nimage; with restart markers, the damage is usually confined to the portion of\nthe image up to the next restart marker.  Of course, the restart markers\noccupy extra space.  We recommend\n.B \\-restart 1\nfor images that will be transmitted across unreliable networks such as Usenet.\n.PP\nThe\n.B \\-smooth\noption filters the input to eliminate fine-scale noise.  This is often useful\nwhen converting dithered images to JPEG: a moderate smoothing factor of 10 to\n50 gets rid of dithering patterns in the input file, resulting in a smaller\nJPEG file and a better-looking image.  Too large a smoothing factor will\nvisibly blur the image, however.\n.PP\nSwitches for wizards:\n.TP\n.B \\-baseline\nForce baseline-compatible quantization tables to be generated.  This clamps\nquantization values to 8 bits even at low quality settings.  (This switch is\npoorly named, since it does not ensure that the output is actually baseline\nJPEG.  For example, you can use\n.B \\-baseline\nand\n.B \\-progressive\ntogether.)\n.TP\n.BI \\-qtables \" file\"\nUse the quantization tables given in the specified text file.\n.TP\n.BI \\-qslots \" N[,...]\"\nSelect which quantization table to use for each color component.\n.TP\n.BI \\-sample \" HxV[,...]\"\nSet JPEG sampling factors for each color component.\n.TP\n.BI \\-scans \" file\"\nUse the scan script given in the specified text file.\n.PP\nThe \"wizard\" switches are intended for experimentation with JPEG.  If you\ndon't know what you are doing, \\fBdon't use them\\fR.  These switches are\ndocumented further in the file wizard.txt.\n.SH EXAMPLES\n.LP\nThis example compresses the PPM file foo.ppm with a quality factor of\n60 and saves the output as foo.jpg:\n.IP\n.B cjpeg \\-quality\n.I 60 foo.ppm\n.B >\n.I foo.jpg\n.SH HINTS\nColor GIF files are not the ideal input for JPEG; JPEG is really intended for\ncompressing full-color (24-bit) images.  In particular, don't try to convert\ncartoons, line drawings, and other images that have only a few distinct\ncolors.  GIF works great on these, JPEG does not.  If you want to convert a\nGIF to JPEG, you should experiment with\n.BR cjpeg 's\n.B \\-quality\nand\n.B \\-smooth\noptions to get a satisfactory conversion.\n.B \\-smooth 10\nor so is often helpful.\n.PP\nAvoid running an image through a series of JPEG compression/decompression\ncycles.  Image quality loss will accumulate; after ten or so cycles the image\nmay be noticeably worse than it was after one cycle.  It's best to use a\nlossless format while manipulating an image, then convert to JPEG format when\nyou are ready to file the image away.\n.PP\nThe\n.B \\-optimize\noption to\n.B cjpeg\nis worth using when you are making a \"final\" version for posting or archiving.\nIt's also a win when you are using low quality settings to make very small\nJPEG files; the percentage improvement is often a lot more than it is on\nlarger files.  (At present,\n.B \\-optimize\nmode is always selected when generating progressive JPEG files.)\n.SH ENVIRONMENT\n.TP\n.B JPEGMEM\nIf this environment variable is set, its value is the default memory limit.\nThe value is specified as described for the\n.B \\-maxmemory\nswitch.\n.B JPEGMEM\noverrides the default value specified when the program was compiled, and\nitself is overridden by an explicit\n.BR \\-maxmemory .\n.SH SEE ALSO\n.BR djpeg (1),\n.BR jpegtran (1),\n.BR rdjpgcom (1),\n.BR wrjpgcom (1)\n.br\n.BR ppm (5),\n.BR pgm (5)\n.br\nWallace, Gregory K.  \"The JPEG Still Picture Compression Standard\",\nCommunications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.\n.SH AUTHOR\nIndependent JPEG Group\n.PP\nThis file was modified by The libjpeg-turbo Project to include only information\nrelevant to libjpeg-turbo, to wordsmith certain sections, and to describe\nfeatures not present in libjpeg.\n.SH ISSUES\nSupport for GIF input files was removed in cjpeg v6b due to concerns over\nthe Unisys LZW patent.  Although this patent expired in 2006, cjpeg still\nlacks GIF support, for these historical reasons.  (Conversion of GIF files to\nJPEG is usually a bad idea anyway, since GIF is a 256-color format.)\n.PP\nNot all variants of BMP and Targa file formats are supported.\n.PP\nThe\n.B \\-targa\nswitch is not a bug, it's a feature.  (It would be a bug if the Targa format\ndesigners had not been clueless.)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/cjpeg.c",
    "content": "/*\n * cjpeg.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2003-2011 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, 2013-2014, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains a command-line user interface for the JPEG compressor.\n * It should work on any system with Unix- or MS-DOS-style command lines.\n *\n * Two different command line styles are permitted, depending on the\n * compile-time switch TWO_FILE_COMMANDLINE:\n *      cjpeg [options]  inputfile outputfile\n *      cjpeg [options]  [inputfile]\n * In the second style, output is always to standard output, which you'd\n * normally redirect to a file or pipe to some other program.  Input is\n * either from a named file or from standard input (typically redirected).\n * The second style is convenient on Unix but is unhelpful on systems that\n * don't support pipes.  Also, you MUST use the first style if your system\n * doesn't do binary I/O to stdin/stdout.\n * To simplify script writing, the \"-outfile\" switch is provided.  The syntax\n *      cjpeg [options]  -outfile outputfile  inputfile\n * works regardless of which command line style is used.\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n#include \"jversion.h\"           /* for version message */\n#include \"jconfigint.h\"\n\n#ifdef USE_CCOMMAND             /* command-line reader for Macintosh */\n#ifdef __MWERKS__\n#include <SIOUX.h>              /* Metrowerks needs this */\n#include <console.h>            /* ... and this */\n#endif\n#ifdef THINK_C\n#include <console.h>            /* Think declares it here */\n#endif\n#endif\n\n\n/* Create the add-on message string table. */\n\n#define JMESSAGE(code,string)   string ,\n\nstatic const char * const cdjpeg_message_table[] = {\n#include \"cderror.h\"\n  NULL\n};\n\n\n/*\n * This routine determines what format the input file is,\n * and selects the appropriate input-reading module.\n *\n * To determine which family of input formats the file belongs to,\n * we may look only at the first byte of the file, since C does not\n * guarantee that more than one character can be pushed back with ungetc.\n * Looking at additional bytes would require one of these approaches:\n *     1) assume we can fseek() the input file (fails for piped input);\n *     2) assume we can push back more than one character (works in\n *        some C implementations, but unportable);\n *     3) provide our own buffering (breaks input readers that want to use\n *        stdio directly, such as the RLE library);\n * or  4) don't put back the data, and modify the input_init methods to assume\n *        they start reading after the start of file (also breaks RLE library).\n * #1 is attractive for MS-DOS but is untenable on Unix.\n *\n * The most portable solution for file types that can't be identified by their\n * first byte is to make the user tell us what they are.  This is also the\n * only approach for \"raw\" file types that contain only arbitrary values.\n * We presently apply this method for Targa files.  Most of the time Targa\n * files start with 0x00, so we recognize that case.  Potentially, however,\n * a Targa file could start with any byte value (byte 0 is the length of the\n * seldom-used ID field), so we provide a switch to force Targa input mode.\n */\n\nstatic boolean is_targa;        /* records user -targa switch */\n\n\nLOCAL(cjpeg_source_ptr)\nselect_file_type (j_compress_ptr cinfo, FILE *infile)\n{\n  int c;\n\n  if (is_targa) {\n#ifdef TARGA_SUPPORTED\n    return jinit_read_targa(cinfo);\n#else\n    ERREXIT(cinfo, JERR_TGA_NOTCOMP);\n#endif\n  }\n\n  if ((c = getc(infile)) == EOF)\n    ERREXIT(cinfo, JERR_INPUT_EMPTY);\n  if (ungetc(c, infile) == EOF)\n    ERREXIT(cinfo, JERR_UNGETC_FAILED);\n\n  switch (c) {\n#ifdef BMP_SUPPORTED\n  case 'B':\n    return jinit_read_bmp(cinfo);\n#endif\n#ifdef GIF_SUPPORTED\n  case 'G':\n    return jinit_read_gif(cinfo);\n#endif\n#ifdef PPM_SUPPORTED\n  case 'P':\n    return jinit_read_ppm(cinfo);\n#endif\n#ifdef RLE_SUPPORTED\n  case 'R':\n    return jinit_read_rle(cinfo);\n#endif\n#ifdef TARGA_SUPPORTED\n  case 0x00:\n    return jinit_read_targa(cinfo);\n#endif\n  default:\n    ERREXIT(cinfo, JERR_UNKNOWN_FORMAT);\n    break;\n  }\n\n  return NULL;                  /* suppress compiler warnings */\n}\n\n\n/*\n * Argument-parsing code.\n * The switch parser is designed to be useful with DOS-style command line\n * syntax, ie, intermixed switches and file names, where only the switches\n * to the left of a given file name affect processing of that file.\n * The main program in this file doesn't actually use this capability...\n */\n\n\nstatic const char *progname;    /* program name for error messages */\nstatic char *outfilename;       /* for -outfile switch */\nboolean memdst;                 /* for -memdst switch */\n\n\nLOCAL(void)\nusage (void)\n/* complain about bad command line */\n{\n  fprintf(stderr, \"usage: %s [switches] \", progname);\n#ifdef TWO_FILE_COMMANDLINE\n  fprintf(stderr, \"inputfile outputfile\\n\");\n#else\n  fprintf(stderr, \"[inputfile]\\n\");\n#endif\n\n  fprintf(stderr, \"Switches (names may be abbreviated):\\n\");\n  fprintf(stderr, \"  -quality N[,...]   Compression quality (0..100; 5-95 is most useful range,\\n\");\n  fprintf(stderr, \"                     default is 75)\\n\");\n  fprintf(stderr, \"  -grayscale     Create monochrome JPEG file\\n\");\n  fprintf(stderr, \"  -rgb           Create RGB JPEG file\\n\");\n#ifdef ENTROPY_OPT_SUPPORTED\n  fprintf(stderr, \"  -optimize      Optimize Huffman table (smaller file, but slow compression)\\n\");\n#endif\n#ifdef C_PROGRESSIVE_SUPPORTED\n  fprintf(stderr, \"  -progressive   Create progressive JPEG file\\n\");\n#endif\n#ifdef TARGA_SUPPORTED\n  fprintf(stderr, \"  -targa         Input file is Targa format (usually not needed)\\n\");\n#endif\n  fprintf(stderr, \"Switches for advanced users:\\n\");\n#ifdef C_ARITH_CODING_SUPPORTED\n  fprintf(stderr, \"  -arithmetic    Use arithmetic coding\\n\");\n#endif\n#ifdef DCT_ISLOW_SUPPORTED\n  fprintf(stderr, \"  -dct int       Use integer DCT method%s\\n\",\n          (JDCT_DEFAULT == JDCT_ISLOW ? \" (default)\" : \"\"));\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n  fprintf(stderr, \"  -dct fast      Use fast integer DCT (less accurate)%s\\n\",\n          (JDCT_DEFAULT == JDCT_IFAST ? \" (default)\" : \"\"));\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n  fprintf(stderr, \"  -dct float     Use floating-point DCT method%s\\n\",\n          (JDCT_DEFAULT == JDCT_FLOAT ? \" (default)\" : \"\"));\n#endif\n  fprintf(stderr, \"  -restart N     Set restart interval in rows, or in blocks with B\\n\");\n#ifdef INPUT_SMOOTHING_SUPPORTED\n  fprintf(stderr, \"  -smooth N      Smooth dithered input (N=1..100 is strength)\\n\");\n#endif\n  fprintf(stderr, \"  -maxmemory N   Maximum memory to use (in kbytes)\\n\");\n  fprintf(stderr, \"  -outfile name  Specify name for output file\\n\");\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n  fprintf(stderr, \"  -memdst        Compress to memory instead of file (useful for benchmarking)\\n\");\n#endif\n  fprintf(stderr, \"  -verbose  or  -debug   Emit debug output\\n\");\n  fprintf(stderr, \"  -version       Print version information and exit\\n\");\n  fprintf(stderr, \"Switches for wizards:\\n\");\n  fprintf(stderr, \"  -baseline      Force baseline quantization tables\\n\");\n  fprintf(stderr, \"  -qtables file  Use quantization tables given in file\\n\");\n  fprintf(stderr, \"  -qslots N[,...]    Set component quantization tables\\n\");\n  fprintf(stderr, \"  -sample HxV[,...]  Set component sampling factors\\n\");\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n  fprintf(stderr, \"  -scans file    Create multi-scan JPEG per script file\\n\");\n#endif\n  exit(EXIT_FAILURE);\n}\n\n\nLOCAL(int)\nparse_switches (j_compress_ptr cinfo, int argc, char **argv,\n                int last_file_arg_seen, boolean for_real)\n/* Parse optional switches.\n * Returns argv[] index of first file-name argument (== argc if none).\n * Any file names with indexes <= last_file_arg_seen are ignored;\n * they have presumably been processed in a previous iteration.\n * (Pass 0 for last_file_arg_seen on the first or only iteration.)\n * for_real is FALSE on the first (dummy) pass; we may skip any expensive\n * processing.\n */\n{\n  int argn;\n  char *arg;\n  boolean force_baseline;\n  boolean simple_progressive;\n  char *qualityarg = NULL;      /* saves -quality parm if any */\n  char *qtablefile = NULL;      /* saves -qtables filename if any */\n  char *qslotsarg = NULL;       /* saves -qslots parm if any */\n  char *samplearg = NULL;       /* saves -sample parm if any */\n  char *scansarg = NULL;        /* saves -scans parm if any */\n\n  /* Set up default JPEG parameters. */\n\n  force_baseline = FALSE;       /* by default, allow 16-bit quantizers */\n  simple_progressive = FALSE;\n  is_targa = FALSE;\n  outfilename = NULL;\n  memdst = FALSE;\n  cinfo->err->trace_level = 0;\n\n  /* Scan command line options, adjust parameters */\n\n  for (argn = 1; argn < argc; argn++) {\n    arg = argv[argn];\n    if (*arg != '-') {\n      /* Not a switch, must be a file name argument */\n      if (argn <= last_file_arg_seen) {\n        outfilename = NULL;     /* -outfile applies to just one input file */\n        continue;               /* ignore this name if previously processed */\n      }\n      break;                    /* else done parsing switches */\n    }\n    arg++;                      /* advance past switch marker character */\n\n    if (keymatch(arg, \"arithmetic\", 1)) {\n      /* Use arithmetic coding. */\n#ifdef C_ARITH_CODING_SUPPORTED\n      cinfo->arith_code = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, arithmetic coding not supported\\n\",\n              progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"baseline\", 1)) {\n      /* Force baseline-compatible output (8-bit quantizer values). */\n      force_baseline = TRUE;\n\n    } else if (keymatch(arg, \"dct\", 2)) {\n      /* Select DCT algorithm. */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (keymatch(argv[argn], \"int\", 1)) {\n        cinfo->dct_method = JDCT_ISLOW;\n      } else if (keymatch(argv[argn], \"fast\", 2)) {\n        cinfo->dct_method = JDCT_IFAST;\n      } else if (keymatch(argv[argn], \"float\", 2)) {\n        cinfo->dct_method = JDCT_FLOAT;\n      } else\n        usage();\n\n    } else if (keymatch(arg, \"debug\", 1) || keymatch(arg, \"verbose\", 1)) {\n      /* Enable debug printouts. */\n      /* On first -d, print version identification */\n      static boolean printed_version = FALSE;\n\n      if (! printed_version) {\n        fprintf(stderr, \"%s version %s (build %s)\\n\",\n                PACKAGE_NAME, VERSION, BUILD);\n        fprintf(stderr, \"%s\\n\\n\", JCOPYRIGHT);\n        fprintf(stderr, \"Emulating The Independent JPEG Group's software, version %s\\n\\n\",\n                JVERSION);\n        printed_version = TRUE;\n      }\n      cinfo->err->trace_level++;\n\n    } else if (keymatch(arg, \"version\", 4)) {\n      fprintf(stderr, \"%s version %s (build %s)\\n\",\n              PACKAGE_NAME, VERSION, BUILD);\n      exit(EXIT_SUCCESS);\n\n    } else if (keymatch(arg, \"grayscale\", 2) || keymatch(arg, \"greyscale\",2)) {\n      /* Force a monochrome JPEG file to be generated. */\n      jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);\n\n    } else if (keymatch(arg, \"rgb\", 3)) {\n      /* Force an RGB JPEG file to be generated. */\n      jpeg_set_colorspace(cinfo, JCS_RGB);\n\n    } else if (keymatch(arg, \"maxmemory\", 3)) {\n      /* Maximum memory in Kb (or Mb with 'm'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n        usage();\n      if (ch == 'm' || ch == 'M')\n        lval *= 1000L;\n      cinfo->mem->max_memory_to_use = lval * 1000L;\n\n    } else if (keymatch(arg, \"optimize\", 1) || keymatch(arg, \"optimise\", 1)) {\n      /* Enable entropy parm optimization. */\n#ifdef ENTROPY_OPT_SUPPORTED\n      cinfo->optimize_coding = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, entropy optimization was not compiled in\\n\",\n              progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"outfile\", 4)) {\n      /* Set output file name. */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      outfilename = argv[argn]; /* save it away for later use */\n\n    } else if (keymatch(arg, \"progressive\", 1)) {\n      /* Select simple progressive mode. */\n#ifdef C_PROGRESSIVE_SUPPORTED\n      simple_progressive = TRUE;\n      /* We must postpone execution until num_components is known. */\n#else\n      fprintf(stderr, \"%s: sorry, progressive output was not compiled in\\n\",\n              progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"memdst\", 2)) {\n      /* Use in-memory destination manager */\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n      memdst = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, in-memory destination manager was not compiled in\\n\",\n              progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"quality\", 1)) {\n      /* Quality ratings (quantization table scaling factors). */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      qualityarg = argv[argn];\n\n    } else if (keymatch(arg, \"qslots\", 2)) {\n      /* Quantization table slot numbers. */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      qslotsarg = argv[argn];\n      /* Must delay setting qslots until after we have processed any\n       * colorspace-determining switches, since jpeg_set_colorspace sets\n       * default quant table numbers.\n       */\n\n    } else if (keymatch(arg, \"qtables\", 2)) {\n      /* Quantization tables fetched from file. */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      qtablefile = argv[argn];\n      /* We postpone actually reading the file in case -quality comes later. */\n\n    } else if (keymatch(arg, \"restart\", 1)) {\n      /* Restart interval in MCU rows (or in MCUs with 'b'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n        usage();\n      if (lval < 0 || lval > 65535L)\n        usage();\n      if (ch == 'b' || ch == 'B') {\n        cinfo->restart_interval = (unsigned int) lval;\n        cinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */\n      } else {\n        cinfo->restart_in_rows = (int) lval;\n        /* restart_interval will be computed during startup */\n      }\n\n    } else if (keymatch(arg, \"sample\", 2)) {\n      /* Set sampling factors. */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      samplearg = argv[argn];\n      /* Must delay setting sample factors until after we have processed any\n       * colorspace-determining switches, since jpeg_set_colorspace sets\n       * default sampling factors.\n       */\n\n    } else if (keymatch(arg, \"scans\", 4)) {\n      /* Set scan script. */\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      scansarg = argv[argn];\n      /* We must postpone reading the file in case -progressive appears. */\n#else\n      fprintf(stderr, \"%s: sorry, multi-scan output was not compiled in\\n\",\n              progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"smooth\", 2)) {\n      /* Set input smoothing factor. */\n      int val;\n\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (sscanf(argv[argn], \"%d\", &val) != 1)\n        usage();\n      if (val < 0 || val > 100)\n        usage();\n      cinfo->smoothing_factor = val;\n\n    } else if (keymatch(arg, \"targa\", 1)) {\n      /* Input file is Targa format. */\n      is_targa = TRUE;\n\n    } else {\n      usage();                  /* bogus switch */\n    }\n  }\n\n  /* Post-switch-scanning cleanup */\n\n  if (for_real) {\n\n    /* Set quantization tables for selected quality. */\n    /* Some or all may be overridden if -qtables is present. */\n    if (qualityarg != NULL)     /* process -quality if it was present */\n      if (! set_quality_ratings(cinfo, qualityarg, force_baseline))\n        usage();\n\n    if (qtablefile != NULL)     /* process -qtables if it was present */\n      if (! read_quant_tables(cinfo, qtablefile, force_baseline))\n        usage();\n\n    if (qslotsarg != NULL)      /* process -qslots if it was present */\n      if (! set_quant_slots(cinfo, qslotsarg))\n        usage();\n\n    if (samplearg != NULL)      /* process -sample if it was present */\n      if (! set_sample_factors(cinfo, samplearg))\n        usage();\n\n#ifdef C_PROGRESSIVE_SUPPORTED\n    if (simple_progressive)     /* process -progressive; -scans can override */\n      jpeg_simple_progression(cinfo);\n#endif\n\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n    if (scansarg != NULL)       /* process -scans if it was present */\n      if (! read_scan_script(cinfo, scansarg))\n        usage();\n#endif\n  }\n\n  return argn;                  /* return index of next arg (file name) */\n}\n\n\n/*\n * The main program.\n */\n\nint\nmain (int argc, char **argv)\n{\n  struct jpeg_compress_struct cinfo;\n  struct jpeg_error_mgr jerr;\n#ifdef PROGRESS_REPORT\n  struct cdjpeg_progress_mgr progress;\n#endif\n  int file_index;\n  cjpeg_source_ptr src_mgr;\n  FILE *input_file;\n  FILE *output_file = NULL;\n  unsigned char *outbuffer = NULL;\n  unsigned long outsize = 0;\n  JDIMENSION num_scanlines;\n\n  /* On Mac, fetch a command line. */\n#ifdef USE_CCOMMAND\n  argc = ccommand(&argv);\n#endif\n\n  progname = argv[0];\n  if (progname == NULL || progname[0] == 0)\n    progname = \"cjpeg\";         /* in case C library doesn't provide it */\n\n  /* Initialize the JPEG compression object with default error handling. */\n  cinfo.err = jpeg_std_error(&jerr);\n  jpeg_create_compress(&cinfo);\n  /* Add some application-specific error messages (from cderror.h) */\n  jerr.addon_message_table = cdjpeg_message_table;\n  jerr.first_addon_message = JMSG_FIRSTADDONCODE;\n  jerr.last_addon_message = JMSG_LASTADDONCODE;\n\n  /* Initialize JPEG parameters.\n   * Much of this may be overridden later.\n   * In particular, we don't yet know the input file's color space,\n   * but we need to provide some value for jpeg_set_defaults() to work.\n   */\n\n  cinfo.in_color_space = JCS_RGB; /* arbitrary guess */\n  jpeg_set_defaults(&cinfo);\n\n  /* Scan command line to find file names.\n   * It is convenient to use just one switch-parsing routine, but the switch\n   * values read here are ignored; we will rescan the switches after opening\n   * the input file.\n   */\n\n  file_index = parse_switches(&cinfo, argc, argv, 0, FALSE);\n\n#ifdef TWO_FILE_COMMANDLINE\n  if (!memdst) {\n    /* Must have either -outfile switch or explicit output file name */\n    if (outfilename == NULL) {\n      if (file_index != argc-2) {\n        fprintf(stderr, \"%s: must name one input and one output file\\n\",\n                progname);\n        usage();\n      }\n      outfilename = argv[file_index+1];\n    } else {\n      if (file_index != argc-1) {\n        fprintf(stderr, \"%s: must name one input and one output file\\n\",\n                progname);\n        usage();\n      }\n    }\n  }\n#else\n  /* Unix style: expect zero or one file name */\n  if (file_index < argc-1) {\n    fprintf(stderr, \"%s: only one input file\\n\", progname);\n    usage();\n  }\n#endif /* TWO_FILE_COMMANDLINE */\n\n  /* Open the input file. */\n  if (file_index < argc) {\n    if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[file_index]);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default input file is stdin */\n    input_file = read_stdin();\n  }\n\n  /* Open the output file. */\n  if (outfilename != NULL) {\n    if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, outfilename);\n      exit(EXIT_FAILURE);\n    }\n  } else if (!memdst) {\n    /* default output file is stdout */\n    output_file = write_stdout();\n  }\n\n#ifdef PROGRESS_REPORT\n  start_progress_monitor((j_common_ptr) &cinfo, &progress);\n#endif\n\n  /* Figure out the input file format, and set up to read it. */\n  src_mgr = select_file_type(&cinfo, input_file);\n  src_mgr->input_file = input_file;\n\n  /* Read the input file header to obtain file size & colorspace. */\n  (*src_mgr->start_input) (&cinfo, src_mgr);\n\n  /* Now that we know input colorspace, fix colorspace-dependent defaults */\n  jpeg_default_colorspace(&cinfo);\n\n  /* Adjust default compression parameters by re-parsing the options */\n  file_index = parse_switches(&cinfo, argc, argv, 0, TRUE);\n\n  /* Specify data destination for compression */\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n  if (memdst)\n    jpeg_mem_dest(&cinfo, &outbuffer, &outsize);\n  else\n#endif\n    jpeg_stdio_dest(&cinfo, output_file);\n\n  /* Start compressor */\n  jpeg_start_compress(&cinfo, TRUE);\n\n  /* Process data */\n  while (cinfo.next_scanline < cinfo.image_height) {\n    num_scanlines = (*src_mgr->get_pixel_rows) (&cinfo, src_mgr);\n    (void) jpeg_write_scanlines(&cinfo, src_mgr->buffer, num_scanlines);\n  }\n\n  /* Finish compression and release memory */\n  (*src_mgr->finish_input) (&cinfo, src_mgr);\n  jpeg_finish_compress(&cinfo);\n  jpeg_destroy_compress(&cinfo);\n\n  /* Close files, if we opened them */\n  if (input_file != stdin)\n    fclose(input_file);\n  if (output_file != stdout && output_file != NULL)\n    fclose(output_file);\n\n#ifdef PROGRESS_REPORT\n  end_progress_monitor((j_common_ptr) &cinfo);\n#endif\n\n  if (memdst) {\n    fprintf(stderr, \"Compressed size:  %lu bytes\\n\", outsize);\n    if (outbuffer != NULL)\n      free(outbuffer);\n  }\n\n  /* All done. */\n  exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);\n  return 0;                     /* suppress no-return-value warnings */\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/cmakescripts/testclean.cmake",
    "content": "file(GLOB FILES\n  testout*\n  *_GRAY_*.bmp\n  *_GRAY_*.png\n  *_GRAY_*.ppm\n  *_GRAY_*.jpg\n  *_GRAY.yuv\n  *_420_*.bmp\n  *_420_*.png\n  *_420_*.ppm\n  *_420_*.jpg\n  *_420.yuv\n  *_422_*.bmp\n  *_422_*.png\n  *_422_*.ppm\n  *_422_*.jpg\n  *_422.yuv\n  *_444_*.bmp\n  *_444_*.png\n  *_444_*.ppm\n  *_444_*.jpg\n  *_444.yuv\n  *_440_*.bmp\n  *_440_*.png\n  *_440_*.ppm\n  *_440_*.jpg\n  *_440.yuv)\n\nif(NOT FILES STREQUAL \"\")\n  message(STATUS \"Removing test files\")\n  file(REMOVE ${FILES})\nelse()\n  message(STATUS \"No files to remove\")\nendif()\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/coderules.txt",
    "content": "IJG JPEG LIBRARY:  CODING RULES\n\nThis file was part of the Independent JPEG Group's software:\nCopyright (C) 1991-1996, Thomas G. Lane.\nIt was modified by The libjpeg-turbo Project to include only information\nrelevant to libjpeg-turbo.\nFor conditions of distribution and use, see the accompanying README.ijg file.\n\n\nSince numerous people will be contributing code and bug fixes, it's important\nto establish a common coding style.  The goal of using similar coding styles\nis much more important than the details of just what that style is.\n\nIn general we follow the recommendations of \"Recommended C Style and Coding\nStandards\" revision 6.1 (Cannon et al. as modified by Spencer, Keppel and\nBrader).  This document is available in the IJG FTP archive (see\njpeg/doc/cstyle.ms.tbl.Z, or cstyle.txt.Z for those without nroff/tbl).\n\nBlock comments should be laid out thusly:\n\n/*\n *  Block comments in this style.\n */\n\nWe indent statements in K&R style, e.g.,\n        if (test) {\n          then-part;\n        } else {\n          else-part;\n        }\nwith two spaces per indentation level.  (This indentation convention is\nhandled automatically by GNU Emacs and many other text editors.)\n\nMulti-word names should be written in lower case with underscores, e.g.,\nmulti_word_name (not multiWordName).  Preprocessor symbols and enum constants\nare similar but upper case (MULTI_WORD_NAME).  Names should be unique within\nthe first fifteen characters.\n\nNote that each function definition must begin with GLOBAL(type), LOCAL(type),\nor METHODDEF(type).  These macros expand to \"static type\" or just \"type\" as\nappropriate.  They provide a readable indication of the routine's usage and\ncan readily be changed for special needs.  (For instance, special linkage\nkeywords can be inserted for use in Windows DLLs.)\n\nA similar solution is used for external function declarations (see the EXTERN\nmacro.)\n\n\nThe JPEG library is intended to be used within larger programs.  Furthermore,\nwe want it to be reentrant so that it can be used by applications that process\nmultiple images concurrently.  The following rules support these requirements:\n\n1. Avoid direct use of file I/O, \"malloc\", error report printouts, etc;\npass these through the common routines provided.\n\n2. Minimize global namespace pollution.  Functions should be declared static\nwherever possible.  (Note that our method-based calling conventions help this\na lot: in many modules only the initialization function will ever need to be\ncalled directly, so only that function need be externally visible.)  All\nglobal function names should begin with \"jpeg_\".\n\n3. Don't use global variables; anything that must be used in another module\nshould be in the common data structures.\n\n4. Don't use static variables except for read-only constant tables.  Variables\nthat should be private to a module can be placed into private structures (see\nthe system architecture document, structure.txt).\n\n5. Source file names should begin with \"j\" for files that are part of the\nlibrary proper; source files that are not part of the library, such as cjpeg.c\nand djpeg.c, do not begin with \"j\".  Keep compression and decompression code in\nseparate source files --- some applications may want only one half of the\nlibrary.\n\nNote: these rules (particularly #4) are not followed religiously in the\nmodules that are used in cjpeg/djpeg but are not part of the JPEG library\nproper.  Those modules are not really intended to be used in other\napplications.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/compile",
    "content": "#! /bin/sh\n# Wrapper for compilers which do not understand '-c -o'.\n\nscriptversion=2012-10-14.11; # UTC\n\n# Copyright (C) 1999-2014 Free Software Foundation, Inc.\n# Written by Tom Tromey <tromey@cygnus.com>.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\n# This file is maintained in Automake, please report\n# bugs to <bug-automake@gnu.org> or send patches to\n# <automake-patches@gnu.org>.\n\nnl='\n'\n\n# We need space, tab and new line, in precisely that order.  Quoting is\n# there to prevent tools from complaining about whitespace usage.\nIFS=\" \"\"\t$nl\"\n\nfile_conv=\n\n# func_file_conv build_file lazy\n# Convert a $build file to $host form and store it in $file\n# Currently only supports Windows hosts. If the determined conversion\n# type is listed in (the comma separated) LAZY, no conversion will\n# take place.\nfunc_file_conv ()\n{\n  file=$1\n  case $file in\n    / | /[!/]*) # absolute file, and not a UNC file\n      if test -z \"$file_conv\"; then\n\t# lazily determine how to convert abs files\n\tcase `uname -s` in\n\t  MINGW*)\n\t    file_conv=mingw\n\t    ;;\n\t  CYGWIN*)\n\t    file_conv=cygwin\n\t    ;;\n\t  *)\n\t    file_conv=wine\n\t    ;;\n\tesac\n      fi\n      case $file_conv/,$2, in\n\t*,$file_conv,*)\n\t  ;;\n\tmingw/*)\n\t  file=`cmd //C echo \"$file \" | sed -e 's/\"\\(.*\\) \" *$/\\1/'`\n\t  ;;\n\tcygwin/*)\n\t  file=`cygpath -m \"$file\" || echo \"$file\"`\n\t  ;;\n\twine/*)\n\t  file=`winepath -w \"$file\" || echo \"$file\"`\n\t  ;;\n      esac\n      ;;\n  esac\n}\n\n# func_cl_dashL linkdir\n# Make cl look for libraries in LINKDIR\nfunc_cl_dashL ()\n{\n  func_file_conv \"$1\"\n  if test -z \"$lib_path\"; then\n    lib_path=$file\n  else\n    lib_path=\"$lib_path;$file\"\n  fi\n  linker_opts=\"$linker_opts -LIBPATH:$file\"\n}\n\n# func_cl_dashl library\n# Do a library search-path lookup for cl\nfunc_cl_dashl ()\n{\n  lib=$1\n  found=no\n  save_IFS=$IFS\n  IFS=';'\n  for dir in $lib_path $LIB\n  do\n    IFS=$save_IFS\n    if $shared && test -f \"$dir/$lib.dll.lib\"; then\n      found=yes\n      lib=$dir/$lib.dll.lib\n      break\n    fi\n    if test -f \"$dir/$lib.lib\"; then\n      found=yes\n      lib=$dir/$lib.lib\n      break\n    fi\n    if test -f \"$dir/lib$lib.a\"; then\n      found=yes\n      lib=$dir/lib$lib.a\n      break\n    fi\n  done\n  IFS=$save_IFS\n\n  if test \"$found\" != yes; then\n    lib=$lib.lib\n  fi\n}\n\n# func_cl_wrapper cl arg...\n# Adjust compile command to suit cl\nfunc_cl_wrapper ()\n{\n  # Assume a capable shell\n  lib_path=\n  shared=:\n  linker_opts=\n  for arg\n  do\n    if test -n \"$eat\"; then\n      eat=\n    else\n      case $1 in\n\t-o)\n\t  # configure might choose to run compile as 'compile cc -o foo foo.c'.\n\t  eat=1\n\t  case $2 in\n\t    *.o | *.[oO][bB][jJ])\n\t      func_file_conv \"$2\"\n\t      set x \"$@\" -Fo\"$file\"\n\t      shift\n\t      ;;\n\t    *)\n\t      func_file_conv \"$2\"\n\t      set x \"$@\" -Fe\"$file\"\n\t      shift\n\t      ;;\n\t  esac\n\t  ;;\n\t-I)\n\t  eat=1\n\t  func_file_conv \"$2\" mingw\n\t  set x \"$@\" -I\"$file\"\n\t  shift\n\t  ;;\n\t-I*)\n\t  func_file_conv \"${1#-I}\" mingw\n\t  set x \"$@\" -I\"$file\"\n\t  shift\n\t  ;;\n\t-l)\n\t  eat=1\n\t  func_cl_dashl \"$2\"\n\t  set x \"$@\" \"$lib\"\n\t  shift\n\t  ;;\n\t-l*)\n\t  func_cl_dashl \"${1#-l}\"\n\t  set x \"$@\" \"$lib\"\n\t  shift\n\t  ;;\n\t-L)\n\t  eat=1\n\t  func_cl_dashL \"$2\"\n\t  ;;\n\t-L*)\n\t  func_cl_dashL \"${1#-L}\"\n\t  ;;\n\t-static)\n\t  shared=false\n\t  ;;\n\t-Wl,*)\n\t  arg=${1#-Wl,}\n\t  save_ifs=\"$IFS\"; IFS=','\n\t  for flag in $arg; do\n\t    IFS=\"$save_ifs\"\n\t    linker_opts=\"$linker_opts $flag\"\n\t  done\n\t  IFS=\"$save_ifs\"\n\t  ;;\n\t-Xlinker)\n\t  eat=1\n\t  linker_opts=\"$linker_opts $2\"\n\t  ;;\n\t-*)\n\t  set x \"$@\" \"$1\"\n\t  shift\n\t  ;;\n\t*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)\n\t  func_file_conv \"$1\"\n\t  set x \"$@\" -Tp\"$file\"\n\t  shift\n\t  ;;\n\t*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])\n\t  func_file_conv \"$1\" mingw\n\t  set x \"$@\" \"$file\"\n\t  shift\n\t  ;;\n\t*)\n\t  set x \"$@\" \"$1\"\n\t  shift\n\t  ;;\n      esac\n    fi\n    shift\n  done\n  if test -n \"$linker_opts\"; then\n    linker_opts=\"-link$linker_opts\"\n  fi\n  exec \"$@\" $linker_opts\n  exit 1\n}\n\neat=\n\ncase $1 in\n  '')\n     echo \"$0: No command.  Try '$0 --help' for more information.\" 1>&2\n     exit 1;\n     ;;\n  -h | --h*)\n    cat <<\\EOF\nUsage: compile [--help] [--version] PROGRAM [ARGS]\n\nWrapper for compilers which do not understand '-c -o'.\nRemove '-o dest.o' from ARGS, run PROGRAM with the remaining\narguments, and rename the output as expected.\n\nIf you are trying to build a whole package this is not the\nright script to run: please start by reading the file 'INSTALL'.\n\nReport bugs to <bug-automake@gnu.org>.\nEOF\n    exit $?\n    ;;\n  -v | --v*)\n    echo \"compile $scriptversion\"\n    exit $?\n    ;;\n  cl | *[/\\\\]cl | cl.exe | *[/\\\\]cl.exe )\n    func_cl_wrapper \"$@\"      # Doesn't return...\n    ;;\nesac\n\nofile=\ncfile=\n\nfor arg\ndo\n  if test -n \"$eat\"; then\n    eat=\n  else\n    case $1 in\n      -o)\n\t# configure might choose to run compile as 'compile cc -o foo foo.c'.\n\t# So we strip '-o arg' only if arg is an object.\n\teat=1\n\tcase $2 in\n\t  *.o | *.obj)\n\t    ofile=$2\n\t    ;;\n\t  *)\n\t    set x \"$@\" -o \"$2\"\n\t    shift\n\t    ;;\n\tesac\n\t;;\n      *.c)\n\tcfile=$1\n\tset x \"$@\" \"$1\"\n\tshift\n\t;;\n      *)\n\tset x \"$@\" \"$1\"\n\tshift\n\t;;\n    esac\n  fi\n  shift\ndone\n\nif test -z \"$ofile\" || test -z \"$cfile\"; then\n  # If no '-o' option was seen then we might have been invoked from a\n  # pattern rule where we don't need one.  That is ok -- this is a\n  # normal compilation that the losing compiler can handle.  If no\n  # '.c' file was seen then we are probably linking.  That is also\n  # ok.\n  exec \"$@\"\nfi\n\n# Name of file we expect compiler to create.\ncofile=`echo \"$cfile\" | sed 's|^.*[\\\\/]||; s|^[a-zA-Z]:||; s/\\.c$/.o/'`\n\n# Create the lock directory.\n# Note: use '[/\\\\:.-]' here to ensure that we don't use the same name\n# that we are using for the .o file.  Also, base the name on the expected\n# object file name, since that is what matters with a parallel build.\nlockdir=`echo \"$cofile\" | sed -e 's|[/\\\\:.-]|_|g'`.d\nwhile true; do\n  if mkdir \"$lockdir\" >/dev/null 2>&1; then\n    break\n  fi\n  sleep 1\ndone\n# FIXME: race condition here if user kills between mkdir and trap.\ntrap \"rmdir '$lockdir'; exit 1\" 1 2 15\n\n# Run the compile.\n\"$@\"\nret=$?\n\nif test -f \"$cofile\"; then\n  test \"$cofile\" = \"$ofile\" || mv \"$cofile\" \"$ofile\"\nelif test -f \"${cofile}bj\"; then\n  test \"${cofile}bj\" = \"$ofile\" || mv \"${cofile}bj\" \"$ofile\"\nfi\n\nrmdir \"$lockdir\"\nexit $ret\n\n# Local Variables:\n# mode: shell-script\n# sh-indentation: 2\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-time-zone: \"UTC\"\n# time-stamp-end: \"; # UTC\"\n# End:\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/config.guess",
    "content": "#! /bin/sh\n# Attempt to guess a canonical system name.\n#   Copyright 1992-2014 Free Software Foundation, Inc.\n\ntimestamp='2014-11-04'\n\n# This file is free software; you can redistribute it and/or modify it\n# under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, see <http://www.gnu.org/licenses/>.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that\n# program.  This Exception is an additional permission under section 7\n# of the GNU General Public License, version 3 (\"GPLv3\").\n#\n# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.\n#\n# You can get the latest version of this script from:\n# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD\n#\n# Please send patches to <config-patches@gnu.org>.\n\n\nme=`echo \"$0\" | sed -e 's,.*/,,'`\n\nusage=\"\\\nUsage: $0 [OPTION]\n\nOutput the configuration name of the system \\`$me' is run on.\n\nOperation modes:\n  -h, --help         print this help, then exit\n  -t, --time-stamp   print date of last modification, then exit\n  -v, --version      print version number, then exit\n\nReport bugs and patches to <config-patches@gnu.org>.\"\n\nversion=\"\\\nGNU config.guess ($timestamp)\n\nOriginally written by Per Bothner.\nCopyright 1992-2014 Free Software Foundation, Inc.\n\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\"\n\nhelp=\"\nTry \\`$me --help' for more information.\"\n\n# Parse command line\nwhile test $# -gt 0 ; do\n  case $1 in\n    --time-stamp | --time* | -t )\n       echo \"$timestamp\" ; exit ;;\n    --version | -v )\n       echo \"$version\" ; exit ;;\n    --help | --h* | -h )\n       echo \"$usage\"; exit ;;\n    -- )     # Stop option processing\n       shift; break ;;\n    - )\t# Use stdin as input.\n       break ;;\n    -* )\n       echo \"$me: invalid option $1$help\" >&2\n       exit 1 ;;\n    * )\n       break ;;\n  esac\ndone\n\nif test $# != 0; then\n  echo \"$me: too many arguments$help\" >&2\n  exit 1\nfi\n\ntrap 'exit 1' 1 2 15\n\n# CC_FOR_BUILD -- compiler used by this script. Note that the use of a\n# compiler to aid in system detection is discouraged as it requires\n# temporary files to be created and, as you can see below, it is a\n# headache to deal with in a portable fashion.\n\n# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still\n# use `HOST_CC' if defined, but it is deprecated.\n\n# Portable tmp directory creation inspired by the Autoconf team.\n\nset_cc_for_build='\ntrap \"exitcode=\\$?; (rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null) && exit \\$exitcode\" 0 ;\ntrap \"rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null; exit 1\" 1 2 13 15 ;\n: ${TMPDIR=/tmp} ;\n { tmp=`(umask 077 && mktemp -d \"$TMPDIR/cgXXXXXX\") 2>/dev/null` && test -n \"$tmp\" && test -d \"$tmp\" ; } ||\n { test -n \"$RANDOM\" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||\n { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo \"Warning: creating insecure temp directory\" >&2 ; } ||\n { echo \"$me: cannot create a temporary directory in $TMPDIR\" >&2 ; exit 1 ; } ;\ndummy=$tmp/dummy ;\ntmpfiles=\"$dummy.c $dummy.o $dummy.rel $dummy\" ;\ncase $CC_FOR_BUILD,$HOST_CC,$CC in\n ,,)    echo \"int x;\" > $dummy.c ;\n\tfor c in cc gcc c89 c99 ; do\n\t  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then\n\t     CC_FOR_BUILD=\"$c\"; break ;\n\t  fi ;\n\tdone ;\n\tif test x\"$CC_FOR_BUILD\" = x ; then\n\t  CC_FOR_BUILD=no_compiler_found ;\n\tfi\n\t;;\n ,,*)   CC_FOR_BUILD=$CC ;;\n ,*,*)  CC_FOR_BUILD=$HOST_CC ;;\nesac ; set_cc_for_build= ;'\n\n# This is needed to find uname on a Pyramid OSx when run in the BSD universe.\n# (ghazi@noc.rutgers.edu 1994-08-24)\nif (test -f /.attbin/uname) >/dev/null 2>&1 ; then\n\tPATH=$PATH:/.attbin ; export PATH\nfi\n\nUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown\nUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown\nUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown\nUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown\n\ncase \"${UNAME_SYSTEM}\" in\nLinux|GNU|GNU/*)\n\t# If the system lacks a compiler, then just pick glibc.\n\t# We could probably try harder.\n\tLIBC=gnu\n\n\teval $set_cc_for_build\n\tcat <<-EOF > $dummy.c\n\t#include <features.h>\n\t#if defined(__UCLIBC__)\n\tLIBC=uclibc\n\t#elif defined(__dietlibc__)\n\tLIBC=dietlibc\n\t#else\n\tLIBC=gnu\n\t#endif\n\tEOF\n\teval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`\n\t;;\nesac\n\n# Note: order is significant - the case branches are not exclusive.\n\ncase \"${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}\" in\n    *:NetBSD:*:*)\n\t# NetBSD (nbsd) targets should (where applicable) match one or\n\t# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,\n\t# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently\n\t# switched to ELF, *-*-netbsd* would select the old\n\t# object file format.  This provides both forward\n\t# compatibility and a consistent mechanism for selecting the\n\t# object file format.\n\t#\n\t# Note: NetBSD doesn't particularly care about the vendor\n\t# portion of the name.  We always set it to \"unknown\".\n\tsysctl=\"sysctl -n hw.machine_arch\"\n\tUNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \\\n\t    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    armeb) machine=armeb-unknown ;;\n\t    arm*) machine=arm-unknown ;;\n\t    sh3el) machine=shl-unknown ;;\n\t    sh3eb) machine=sh-unknown ;;\n\t    sh5el) machine=sh5le-unknown ;;\n\t    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;\n\tesac\n\t# The Operating System including object format, if it has switched\n\t# to ELF recently, or will in the future.\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    arm*|i386|m68k|ns32k|sh3*|sparc|vax)\n\t\teval $set_cc_for_build\n\t\tif echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t\t\t| grep -q __ELF__\n\t\tthen\n\t\t    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).\n\t\t    # Return netbsd for either.  FIX?\n\t\t    os=netbsd\n\t\telse\n\t\t    os=netbsdelf\n\t\tfi\n\t\t;;\n\t    *)\n\t\tos=netbsd\n\t\t;;\n\tesac\n\t# The OS release\n\t# Debian GNU/NetBSD machines have a different userland, and\n\t# thus, need a distinct triplet. However, they do not need\n\t# kernel version information, so it can be replaced with a\n\t# suitable tag, in the style of linux-gnu.\n\tcase \"${UNAME_VERSION}\" in\n\t    Debian*)\n\t\trelease='-gnu'\n\t\t;;\n\t    *)\n\t\trelease=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\\./'`\n\t\t;;\n\tesac\n\t# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:\n\t# contains redundant information, the shorter form:\n\t# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.\n\techo \"${machine}-${os}${release}\"\n\texit ;;\n    *:Bitrig:*:*)\n\tUNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`\n\techo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}\n\texit ;;\n    *:OpenBSD:*:*)\n\tUNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`\n\techo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}\n\texit ;;\n    *:ekkoBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}\n\texit ;;\n    *:SolidBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}\n\texit ;;\n    macppc:MirBSD:*:*)\n\techo powerpc-unknown-mirbsd${UNAME_RELEASE}\n\texit ;;\n    *:MirBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}\n\texit ;;\n    alpha:OSF1:*:*)\n\tcase $UNAME_RELEASE in\n\t*4.0)\n\t\tUNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`\n\t\t;;\n\t*5.*)\n\t\tUNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`\n\t\t;;\n\tesac\n\t# According to Compaq, /usr/sbin/psrinfo has been available on\n\t# OSF/1 and Tru64 systems produced since 1995.  I hope that\n\t# covers most systems running today.  This code pipes the CPU\n\t# types through head -n 1, so we only detect the type of CPU 0.\n\tALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \\(.*\\) processor.*$/\\1/p' | head -n 1`\n\tcase \"$ALPHA_CPU_TYPE\" in\n\t    \"EV4 (21064)\")\n\t\tUNAME_MACHINE=\"alpha\" ;;\n\t    \"EV4.5 (21064)\")\n\t\tUNAME_MACHINE=\"alpha\" ;;\n\t    \"LCA4 (21066/21068)\")\n\t\tUNAME_MACHINE=\"alpha\" ;;\n\t    \"EV5 (21164)\")\n\t\tUNAME_MACHINE=\"alphaev5\" ;;\n\t    \"EV5.6 (21164A)\")\n\t\tUNAME_MACHINE=\"alphaev56\" ;;\n\t    \"EV5.6 (21164PC)\")\n\t\tUNAME_MACHINE=\"alphapca56\" ;;\n\t    \"EV5.7 (21164PC)\")\n\t\tUNAME_MACHINE=\"alphapca57\" ;;\n\t    \"EV6 (21264)\")\n\t\tUNAME_MACHINE=\"alphaev6\" ;;\n\t    \"EV6.7 (21264A)\")\n\t\tUNAME_MACHINE=\"alphaev67\" ;;\n\t    \"EV6.8CB (21264C)\")\n\t\tUNAME_MACHINE=\"alphaev68\" ;;\n\t    \"EV6.8AL (21264B)\")\n\t\tUNAME_MACHINE=\"alphaev68\" ;;\n\t    \"EV6.8CX (21264D)\")\n\t\tUNAME_MACHINE=\"alphaev68\" ;;\n\t    \"EV6.9A (21264/EV69A)\")\n\t\tUNAME_MACHINE=\"alphaev69\" ;;\n\t    \"EV7 (21364)\")\n\t\tUNAME_MACHINE=\"alphaev7\" ;;\n\t    \"EV7.9 (21364A)\")\n\t\tUNAME_MACHINE=\"alphaev79\" ;;\n\tesac\n\t# A Pn.n version is a patched version.\n\t# A Vn.n version is a released version.\n\t# A Tn.n version is a released field test version.\n\t# A Xn.n version is an unreleased experimental baselevel.\n\t# 1.2 uses \"1.2\" for uname -r.\n\techo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`\n\t# Reset EXIT trap before exiting to avoid spurious non-zero exit code.\n\texitcode=$?\n\ttrap '' 0\n\texit $exitcode ;;\n    Alpha\\ *:Windows_NT*:*)\n\t# How do we know it's Interix rather than the generic POSIX subsystem?\n\t# Should we change UNAME_MACHINE based on the output of uname instead\n\t# of the specific Alpha model?\n\techo alpha-pc-interix\n\texit ;;\n    21064:Windows_NT:50:3)\n\techo alpha-dec-winnt3.5\n\texit ;;\n    Amiga*:UNIX_System_V:4.0:*)\n\techo m68k-unknown-sysv4\n\texit ;;\n    *:[Aa]miga[Oo][Ss]:*:*)\n\techo ${UNAME_MACHINE}-unknown-amigaos\n\texit ;;\n    *:[Mm]orph[Oo][Ss]:*:*)\n\techo ${UNAME_MACHINE}-unknown-morphos\n\texit ;;\n    *:OS/390:*:*)\n\techo i370-ibm-openedition\n\texit ;;\n    *:z/VM:*:*)\n\techo s390-ibm-zvmoe\n\texit ;;\n    *:OS400:*:*)\n\techo powerpc-ibm-os400\n\texit ;;\n    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)\n\techo arm-acorn-riscix${UNAME_RELEASE}\n\texit ;;\n    arm*:riscos:*:*|arm*:RISCOS:*:*)\n\techo arm-unknown-riscos\n\texit ;;\n    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)\n\techo hppa1.1-hitachi-hiuxmpp\n\texit ;;\n    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)\n\t# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.\n\tif test \"`(/bin/universe) 2>/dev/null`\" = att ; then\n\t\techo pyramid-pyramid-sysv3\n\telse\n\t\techo pyramid-pyramid-bsd\n\tfi\n\texit ;;\n    NILE*:*:*:dcosx)\n\techo pyramid-pyramid-svr4\n\texit ;;\n    DRS?6000:unix:4.0:6*)\n\techo sparc-icl-nx6\n\texit ;;\n    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)\n\tcase `/usr/bin/uname -p` in\n\t    sparc) echo sparc-icl-nx7; exit ;;\n\tesac ;;\n    s390x:SunOS:*:*)\n\techo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4H:SunOS:5.*:*)\n\techo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)\n\techo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)\n\techo i386-pc-auroraux${UNAME_RELEASE}\n\texit ;;\n    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)\n\teval $set_cc_for_build\n\tSUN_ARCH=\"i386\"\n\t# If there is a compiler, see if it is configured for 64-bit objects.\n\t# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.\n\t# This test works for both compilers.\n\tif [ \"$CC_FOR_BUILD\" != 'no_compiler_found' ]; then\n\t    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \\\n\t\t(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \\\n\t\tgrep IS_64BIT_ARCH >/dev/null\n\t    then\n\t\tSUN_ARCH=\"x86_64\"\n\t    fi\n\tfi\n\techo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4*:SunOS:6*:*)\n\t# According to config.sub, this is the proper way to canonicalize\n\t# SunOS6.  Hard to guess exactly what SunOS6 will be like, but\n\t# it's likely to be more like Solaris than SunOS4.\n\techo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4*:SunOS:*:*)\n\tcase \"`/usr/bin/arch -k`\" in\n\t    Series*|S4*)\n\t\tUNAME_RELEASE=`uname -v`\n\t\t;;\n\tesac\n\t# Japanese Language versions have a version number like `4.1.3-JL'.\n\techo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`\n\texit ;;\n    sun3*:SunOS:*:*)\n\techo m68k-sun-sunos${UNAME_RELEASE}\n\texit ;;\n    sun*:*:4.2BSD:*)\n\tUNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`\n\ttest \"x${UNAME_RELEASE}\" = \"x\" && UNAME_RELEASE=3\n\tcase \"`/bin/arch`\" in\n\t    sun3)\n\t\techo m68k-sun-sunos${UNAME_RELEASE}\n\t\t;;\n\t    sun4)\n\t\techo sparc-sun-sunos${UNAME_RELEASE}\n\t\t;;\n\tesac\n\texit ;;\n    aushp:SunOS:*:*)\n\techo sparc-auspex-sunos${UNAME_RELEASE}\n\texit ;;\n    # The situation for MiNT is a little confusing.  The machine name\n    # can be virtually everything (everything which is not\n    # \"atarist\" or \"atariste\" at least should have a processor\n    # > m68000).  The system name ranges from \"MiNT\" over \"FreeMiNT\"\n    # to the lowercase version \"mint\" (or \"freemint\").  Finally\n    # the system name \"TOS\" denotes a system which is actually not\n    # MiNT.  But MiNT is downward compatible to TOS, so this should\n    # be no problem.\n    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n\texit ;;\n    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n\texit ;;\n    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n\texit ;;\n    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)\n\techo m68k-milan-mint${UNAME_RELEASE}\n\texit ;;\n    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)\n\techo m68k-hades-mint${UNAME_RELEASE}\n\texit ;;\n    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)\n\techo m68k-unknown-mint${UNAME_RELEASE}\n\texit ;;\n    m68k:machten:*:*)\n\techo m68k-apple-machten${UNAME_RELEASE}\n\texit ;;\n    powerpc:machten:*:*)\n\techo powerpc-apple-machten${UNAME_RELEASE}\n\texit ;;\n    RISC*:Mach:*:*)\n\techo mips-dec-mach_bsd4.3\n\texit ;;\n    RISC*:ULTRIX:*:*)\n\techo mips-dec-ultrix${UNAME_RELEASE}\n\texit ;;\n    VAX*:ULTRIX*:*:*)\n\techo vax-dec-ultrix${UNAME_RELEASE}\n\texit ;;\n    2020:CLIX:*:* | 2430:CLIX:*:*)\n\techo clipper-intergraph-clix${UNAME_RELEASE}\n\texit ;;\n    mips:*:*:UMIPS | mips:*:*:RISCos)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n#ifdef __cplusplus\n#include <stdio.h>  /* for printf() prototype */\n\tint main (int argc, char *argv[]) {\n#else\n\tint main (argc, argv) int argc; char *argv[]; {\n#endif\n\t#if defined (host_mips) && defined (MIPSEB)\n\t#if defined (SYSTYPE_SYSV)\n\t  printf (\"mips-mips-riscos%ssysv\\n\", argv[1]); exit (0);\n\t#endif\n\t#if defined (SYSTYPE_SVR4)\n\t  printf (\"mips-mips-riscos%ssvr4\\n\", argv[1]); exit (0);\n\t#endif\n\t#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)\n\t  printf (\"mips-mips-riscos%sbsd\\n\", argv[1]); exit (0);\n\t#endif\n\t#endif\n\t  exit (-1);\n\t}\nEOF\n\t$CC_FOR_BUILD -o $dummy $dummy.c &&\n\t  dummyarg=`echo \"${UNAME_RELEASE}\" | sed -n 's/\\([0-9]*\\).*/\\1/p'` &&\n\t  SYSTEM_NAME=`$dummy $dummyarg` &&\n\t    { echo \"$SYSTEM_NAME\"; exit; }\n\techo mips-mips-riscos${UNAME_RELEASE}\n\texit ;;\n    Motorola:PowerMAX_OS:*:*)\n\techo powerpc-motorola-powermax\n\texit ;;\n    Motorola:*:4.3:PL8-*)\n\techo powerpc-harris-powermax\n\texit ;;\n    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)\n\techo powerpc-harris-powermax\n\texit ;;\n    Night_Hawk:Power_UNIX:*:*)\n\techo powerpc-harris-powerunix\n\texit ;;\n    m88k:CX/UX:7*:*)\n\techo m88k-harris-cxux7\n\texit ;;\n    m88k:*:4*:R4*)\n\techo m88k-motorola-sysv4\n\texit ;;\n    m88k:*:3*:R3*)\n\techo m88k-motorola-sysv3\n\texit ;;\n    AViiON:dgux:*:*)\n\t# DG/UX returns AViiON for all architectures\n\tUNAME_PROCESSOR=`/usr/bin/uname -p`\n\tif [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]\n\tthen\n\t    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \\\n\t       [ ${TARGET_BINARY_INTERFACE}x = x ]\n\t    then\n\t\techo m88k-dg-dgux${UNAME_RELEASE}\n\t    else\n\t\techo m88k-dg-dguxbcs${UNAME_RELEASE}\n\t    fi\n\telse\n\t    echo i586-dg-dgux${UNAME_RELEASE}\n\tfi\n\texit ;;\n    M88*:DolphinOS:*:*)\t# DolphinOS (SVR3)\n\techo m88k-dolphin-sysv3\n\texit ;;\n    M88*:*:R3*:*)\n\t# Delta 88k system running SVR3\n\techo m88k-motorola-sysv3\n\texit ;;\n    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)\n\techo m88k-tektronix-sysv3\n\texit ;;\n    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)\n\techo m68k-tektronix-bsd\n\texit ;;\n    *:IRIX*:*:*)\n\techo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`\n\texit ;;\n    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.\n\techo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id\n\texit ;;               # Note that: echo \"'`uname -s`'\" gives 'AIX '\n    i*86:AIX:*:*)\n\techo i386-ibm-aix\n\texit ;;\n    ia64:AIX:*:*)\n\tif [ -x /usr/bin/oslevel ] ; then\n\t\tIBM_REV=`/usr/bin/oslevel`\n\telse\n\t\tIBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}\n\tfi\n\techo ${UNAME_MACHINE}-ibm-aix${IBM_REV}\n\texit ;;\n    *:AIX:2:3)\n\tif grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then\n\t\teval $set_cc_for_build\n\t\tsed 's/^\t\t//' << EOF >$dummy.c\n\t\t#include <sys/systemcfg.h>\n\n\t\tmain()\n\t\t\t{\n\t\t\tif (!__power_pc())\n\t\t\t\texit(1);\n\t\t\tputs(\"powerpc-ibm-aix3.2.5\");\n\t\t\texit(0);\n\t\t\t}\nEOF\n\t\tif $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`\n\t\tthen\n\t\t\techo \"$SYSTEM_NAME\"\n\t\telse\n\t\t\techo rs6000-ibm-aix3.2.5\n\t\tfi\n\telif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then\n\t\techo rs6000-ibm-aix3.2.4\n\telse\n\t\techo rs6000-ibm-aix3.2\n\tfi\n\texit ;;\n    *:AIX:*:[4567])\n\tIBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`\n\tif /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then\n\t\tIBM_ARCH=rs6000\n\telse\n\t\tIBM_ARCH=powerpc\n\tfi\n\tif [ -x /usr/bin/lslpp ] ; then\n\t\tIBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |\n\t\t\t   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`\n\telse\n\t\tIBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}\n\tfi\n\techo ${IBM_ARCH}-ibm-aix${IBM_REV}\n\texit ;;\n    *:AIX:*:*)\n\techo rs6000-ibm-aix\n\texit ;;\n    ibmrt:4.4BSD:*|romp-ibm:BSD:*)\n\techo romp-ibm-bsd4.4\n\texit ;;\n    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and\n\techo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to\n\texit ;;                             # report: romp-ibm BSD 4.3\n    *:BOSX:*:*)\n\techo rs6000-bull-bosx\n\texit ;;\n    DPX/2?00:B.O.S.:*:*)\n\techo m68k-bull-sysv3\n\texit ;;\n    9000/[34]??:4.3bsd:1.*:*)\n\techo m68k-hp-bsd\n\texit ;;\n    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)\n\techo m68k-hp-bsd4.4\n\texit ;;\n    9000/[34678]??:HP-UX:*:*)\n\tHPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`\n\tcase \"${UNAME_MACHINE}\" in\n\t    9000/31? )            HP_ARCH=m68000 ;;\n\t    9000/[34]?? )         HP_ARCH=m68k ;;\n\t    9000/[678][0-9][0-9])\n\t\tif [ -x /usr/bin/getconf ]; then\n\t\t    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`\n\t\t    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`\n\t\t    case \"${sc_cpu_version}\" in\n\t\t      523) HP_ARCH=\"hppa1.0\" ;; # CPU_PA_RISC1_0\n\t\t      528) HP_ARCH=\"hppa1.1\" ;; # CPU_PA_RISC1_1\n\t\t      532)                      # CPU_PA_RISC2_0\n\t\t\tcase \"${sc_kernel_bits}\" in\n\t\t\t  32) HP_ARCH=\"hppa2.0n\" ;;\n\t\t\t  64) HP_ARCH=\"hppa2.0w\" ;;\n\t\t\t  '') HP_ARCH=\"hppa2.0\" ;;   # HP-UX 10.20\n\t\t\tesac ;;\n\t\t    esac\n\t\tfi\n\t\tif [ \"${HP_ARCH}\" = \"\" ]; then\n\t\t    eval $set_cc_for_build\n\t\t    sed 's/^\t\t//' << EOF >$dummy.c\n\n\t\t#define _HPUX_SOURCE\n\t\t#include <stdlib.h>\n\t\t#include <unistd.h>\n\n\t\tint main ()\n\t\t{\n\t\t#if defined(_SC_KERNEL_BITS)\n\t\t    long bits = sysconf(_SC_KERNEL_BITS);\n\t\t#endif\n\t\t    long cpu  = sysconf (_SC_CPU_VERSION);\n\n\t\t    switch (cpu)\n\t\t\t{\n\t\t\tcase CPU_PA_RISC1_0: puts (\"hppa1.0\"); break;\n\t\t\tcase CPU_PA_RISC1_1: puts (\"hppa1.1\"); break;\n\t\t\tcase CPU_PA_RISC2_0:\n\t\t#if defined(_SC_KERNEL_BITS)\n\t\t\t    switch (bits)\n\t\t\t\t{\n\t\t\t\tcase 64: puts (\"hppa2.0w\"); break;\n\t\t\t\tcase 32: puts (\"hppa2.0n\"); break;\n\t\t\t\tdefault: puts (\"hppa2.0\"); break;\n\t\t\t\t} break;\n\t\t#else  /* !defined(_SC_KERNEL_BITS) */\n\t\t\t    puts (\"hppa2.0\"); break;\n\t\t#endif\n\t\t\tdefault: puts (\"hppa1.0\"); break;\n\t\t\t}\n\t\t    exit (0);\n\t\t}\nEOF\n\t\t    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`\n\t\t    test -z \"$HP_ARCH\" && HP_ARCH=hppa\n\t\tfi ;;\n\tesac\n\tif [ ${HP_ARCH} = \"hppa2.0w\" ]\n\tthen\n\t    eval $set_cc_for_build\n\n\t    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating\n\t    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler\n\t    # generating 64-bit code.  GNU and HP use different nomenclature:\n\t    #\n\t    # $ CC_FOR_BUILD=cc ./config.guess\n\t    # => hppa2.0w-hp-hpux11.23\n\t    # $ CC_FOR_BUILD=\"cc +DA2.0w\" ./config.guess\n\t    # => hppa64-hp-hpux11.23\n\n\t    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |\n\t\tgrep -q __LP64__\n\t    then\n\t\tHP_ARCH=\"hppa2.0w\"\n\t    else\n\t\tHP_ARCH=\"hppa64\"\n\t    fi\n\tfi\n\techo ${HP_ARCH}-hp-hpux${HPUX_REV}\n\texit ;;\n    ia64:HP-UX:*:*)\n\tHPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`\n\techo ia64-hp-hpux${HPUX_REV}\n\texit ;;\n    3050*:HI-UX:*:*)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n\t#include <unistd.h>\n\tint\n\tmain ()\n\t{\n\t  long cpu = sysconf (_SC_CPU_VERSION);\n\t  /* The order matters, because CPU_IS_HP_MC68K erroneously returns\n\t     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct\n\t     results, however.  */\n\t  if (CPU_IS_PA_RISC (cpu))\n\t    {\n\t      switch (cpu)\n\t\t{\n\t\t  case CPU_PA_RISC1_0: puts (\"hppa1.0-hitachi-hiuxwe2\"); break;\n\t\t  case CPU_PA_RISC1_1: puts (\"hppa1.1-hitachi-hiuxwe2\"); break;\n\t\t  case CPU_PA_RISC2_0: puts (\"hppa2.0-hitachi-hiuxwe2\"); break;\n\t\t  default: puts (\"hppa-hitachi-hiuxwe2\"); break;\n\t\t}\n\t    }\n\t  else if (CPU_IS_HP_MC68K (cpu))\n\t    puts (\"m68k-hitachi-hiuxwe2\");\n\t  else puts (\"unknown-hitachi-hiuxwe2\");\n\t  exit (0);\n\t}\nEOF\n\t$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&\n\t\t{ echo \"$SYSTEM_NAME\"; exit; }\n\techo unknown-hitachi-hiuxwe2\n\texit ;;\n    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )\n\techo hppa1.1-hp-bsd\n\texit ;;\n    9000/8??:4.3bsd:*:*)\n\techo hppa1.0-hp-bsd\n\texit ;;\n    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)\n\techo hppa1.0-hp-mpeix\n\texit ;;\n    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )\n\techo hppa1.1-hp-osf\n\texit ;;\n    hp8??:OSF1:*:*)\n\techo hppa1.0-hp-osf\n\texit ;;\n    i*86:OSF1:*:*)\n\tif [ -x /usr/sbin/sysversion ] ; then\n\t    echo ${UNAME_MACHINE}-unknown-osf1mk\n\telse\n\t    echo ${UNAME_MACHINE}-unknown-osf1\n\tfi\n\texit ;;\n    parisc*:Lites*:*:*)\n\techo hppa1.1-hp-lites\n\texit ;;\n    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)\n\techo c1-convex-bsd\n\texit ;;\n    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)\n\tif getsysinfo -f scalar_acc\n\tthen echo c32-convex-bsd\n\telse echo c2-convex-bsd\n\tfi\n\texit ;;\n    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)\n\techo c34-convex-bsd\n\texit ;;\n    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)\n\techo c38-convex-bsd\n\texit ;;\n    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)\n\techo c4-convex-bsd\n\texit ;;\n    CRAY*Y-MP:*:*:*)\n\techo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*[A-Z]90:*:*:*)\n\techo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \\\n\t| sed -e 's/CRAY.*\\([A-Z]90\\)/\\1/' \\\n\t      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \\\n\t      -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*TS:*:*:*)\n\techo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*T3E:*:*:*)\n\techo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*SV1:*:*:*)\n\techo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    *:UNICOS/mp:*:*)\n\techo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)\n\tFUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`\n\tFUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\\///'`\n\tFUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`\n\techo \"${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n\texit ;;\n    5000:UNIX_System_V:4.*:*)\n\tFUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\\///'`\n\tFUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`\n\techo \"sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n\texit ;;\n    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\\ Embedded/OS:*:*)\n\techo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}\n\texit ;;\n    sparc*:BSD/OS:*:*)\n\techo sparc-unknown-bsdi${UNAME_RELEASE}\n\texit ;;\n    *:BSD/OS:*:*)\n\techo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}\n\texit ;;\n    *:FreeBSD:*:*)\n\tUNAME_PROCESSOR=`/usr/bin/uname -p`\n\tcase ${UNAME_PROCESSOR} in\n\t    amd64)\n\t\techo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;\n\t    *)\n\t\techo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;\n\tesac\n\texit ;;\n    i*:CYGWIN*:*)\n\techo ${UNAME_MACHINE}-pc-cygwin\n\texit ;;\n    *:MINGW64*:*)\n\techo ${UNAME_MACHINE}-pc-mingw64\n\texit ;;\n    *:MINGW*:*)\n\techo ${UNAME_MACHINE}-pc-mingw32\n\texit ;;\n    *:MSYS*:*)\n\techo ${UNAME_MACHINE}-pc-msys\n\texit ;;\n    i*:windows32*:*)\n\t# uname -m includes \"-pc\" on this system.\n\techo ${UNAME_MACHINE}-mingw32\n\texit ;;\n    i*:PW*:*)\n\techo ${UNAME_MACHINE}-pc-pw32\n\texit ;;\n    *:Interix*:*)\n\tcase ${UNAME_MACHINE} in\n\t    x86)\n\t\techo i586-pc-interix${UNAME_RELEASE}\n\t\texit ;;\n\t    authenticamd | genuineintel | EM64T)\n\t\techo x86_64-unknown-interix${UNAME_RELEASE}\n\t\texit ;;\n\t    IA64)\n\t\techo ia64-unknown-interix${UNAME_RELEASE}\n\t\texit ;;\n\tesac ;;\n    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)\n\techo i${UNAME_MACHINE}-pc-mks\n\texit ;;\n    8664:Windows_NT:*)\n\techo x86_64-pc-mks\n\texit ;;\n    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)\n\t# How do we know it's Interix rather than the generic POSIX subsystem?\n\t# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we\n\t# UNAME_MACHINE based on the output of uname instead of i386?\n\techo i586-pc-interix\n\texit ;;\n    i*:UWIN*:*)\n\techo ${UNAME_MACHINE}-pc-uwin\n\texit ;;\n    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)\n\techo x86_64-unknown-cygwin\n\texit ;;\n    p*:CYGWIN*:*)\n\techo powerpcle-unknown-cygwin\n\texit ;;\n    prep*:SunOS:5.*:*)\n\techo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    *:GNU:*:*)\n\t# the GNU system\n\techo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`\n\texit ;;\n    *:GNU/*:*:*)\n\t# other systems with GNU libc and userland\n\techo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}\n\texit ;;\n    i*86:Minix:*:*)\n\techo ${UNAME_MACHINE}-pc-minix\n\texit ;;\n    aarch64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    aarch64_be:Linux:*:*)\n\tUNAME_MACHINE=aarch64_be\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    alpha:Linux:*:*)\n\tcase `sed -n '/^cpu model/s/^.*: \\(.*\\)/\\1/p' < /proc/cpuinfo` in\n\t  EV5)   UNAME_MACHINE=alphaev5 ;;\n\t  EV56)  UNAME_MACHINE=alphaev56 ;;\n\t  PCA56) UNAME_MACHINE=alphapca56 ;;\n\t  PCA57) UNAME_MACHINE=alphapca56 ;;\n\t  EV6)   UNAME_MACHINE=alphaev6 ;;\n\t  EV67)  UNAME_MACHINE=alphaev67 ;;\n\t  EV68*) UNAME_MACHINE=alphaev68 ;;\n\tesac\n\tobjdump --private-headers /bin/sh | grep -q ld.so.1\n\tif test \"$?\" = 0 ; then LIBC=\"gnulibc1\" ; fi\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    arc:Linux:*:* | arceb:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    arm*:Linux:*:*)\n\teval $set_cc_for_build\n\tif echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t    | grep -q __ARM_EABI__\n\tthen\n\t    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\telse\n\t    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t\t| grep -q __ARM_PCS_VFP\n\t    then\n\t\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi\n\t    else\n\t\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf\n\t    fi\n\tfi\n\texit ;;\n    avr32*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    cris:Linux:*:*)\n\techo ${UNAME_MACHINE}-axis-linux-${LIBC}\n\texit ;;\n    crisv32:Linux:*:*)\n\techo ${UNAME_MACHINE}-axis-linux-${LIBC}\n\texit ;;\n    frv:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    hexagon:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    i*86:Linux:*:*)\n\techo ${UNAME_MACHINE}-pc-linux-${LIBC}\n\texit ;;\n    ia64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    m32r*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    m68*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    mips:Linux:*:* | mips64:Linux:*:*)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n\t#undef CPU\n\t#undef ${UNAME_MACHINE}\n\t#undef ${UNAME_MACHINE}el\n\t#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)\n\tCPU=${UNAME_MACHINE}el\n\t#else\n\t#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)\n\tCPU=${UNAME_MACHINE}\n\t#else\n\tCPU=\n\t#endif\n\t#endif\nEOF\n\teval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`\n\ttest x\"${CPU}\" != x && { echo \"${CPU}-unknown-linux-${LIBC}\"; exit; }\n\t;;\n    openrisc*:Linux:*:*)\n\techo or1k-unknown-linux-${LIBC}\n\texit ;;\n    or32:Linux:*:* | or1k*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    padre:Linux:*:*)\n\techo sparc-unknown-linux-${LIBC}\n\texit ;;\n    parisc64:Linux:*:* | hppa64:Linux:*:*)\n\techo hppa64-unknown-linux-${LIBC}\n\texit ;;\n    parisc:Linux:*:* | hppa:Linux:*:*)\n\t# Look for CPU level\n\tcase `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in\n\t  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;\n\t  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;\n\t  *)    echo hppa-unknown-linux-${LIBC} ;;\n\tesac\n\texit ;;\n    ppc64:Linux:*:*)\n\techo powerpc64-unknown-linux-${LIBC}\n\texit ;;\n    ppc:Linux:*:*)\n\techo powerpc-unknown-linux-${LIBC}\n\texit ;;\n    ppc64le:Linux:*:*)\n\techo powerpc64le-unknown-linux-${LIBC}\n\texit ;;\n    ppcle:Linux:*:*)\n\techo powerpcle-unknown-linux-${LIBC}\n\texit ;;\n    s390:Linux:*:* | s390x:Linux:*:*)\n\techo ${UNAME_MACHINE}-ibm-linux-${LIBC}\n\texit ;;\n    sh64*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    sh*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    sparc:Linux:*:* | sparc64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    tile*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    vax:Linux:*:*)\n\techo ${UNAME_MACHINE}-dec-linux-${LIBC}\n\texit ;;\n    x86_64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    xtensa*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    i*86:DYNIX/ptx:4*:*)\n\t# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.\n\t# earlier versions are messed up and put the nodename in both\n\t# sysname and nodename.\n\techo i386-sequent-sysv4\n\texit ;;\n    i*86:UNIX_SV:4.2MP:2.*)\n\t# Unixware is an offshoot of SVR4, but it has its own version\n\t# number series starting with 2...\n\t# I am not positive that other SVR4 systems won't match this,\n\t# I just have to hope.  -- rms.\n\t# Use sysv4.2uw... so that sysv4* matches it.\n\techo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}\n\texit ;;\n    i*86:OS/2:*:*)\n\t# If we were able to find `uname', then EMX Unix compatibility\n\t# is probably installed.\n\techo ${UNAME_MACHINE}-pc-os2-emx\n\texit ;;\n    i*86:XTS-300:*:STOP)\n\techo ${UNAME_MACHINE}-unknown-stop\n\texit ;;\n    i*86:atheos:*:*)\n\techo ${UNAME_MACHINE}-unknown-atheos\n\texit ;;\n    i*86:syllable:*:*)\n\techo ${UNAME_MACHINE}-pc-syllable\n\texit ;;\n    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)\n\techo i386-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    i*86:*DOS:*:*)\n\techo ${UNAME_MACHINE}-pc-msdosdjgpp\n\texit ;;\n    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)\n\tUNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\\/MP$//'`\n\tif grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then\n\t\techo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}\n\telse\n\t\techo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}\n\tfi\n\texit ;;\n    i*86:*:5:[678]*)\n\t# UnixWare 7.x, OpenUNIX and OpenServer 6.\n\tcase `/bin/uname -X | grep \"^Machine\"` in\n\t    *486*)\t     UNAME_MACHINE=i486 ;;\n\t    *Pentium)\t     UNAME_MACHINE=i586 ;;\n\t    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;\n\tesac\n\techo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}\n\texit ;;\n    i*86:*:3.2:*)\n\tif test -f /usr/options/cb.name; then\n\t\tUNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`\n\t\techo ${UNAME_MACHINE}-pc-isc$UNAME_REL\n\telif /bin/uname -X 2>/dev/null >/dev/null ; then\n\t\tUNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`\n\t\t(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486\n\t\t(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i586\n\t\t(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i686\n\t\t(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i686\n\t\techo ${UNAME_MACHINE}-pc-sco$UNAME_REL\n\telse\n\t\techo ${UNAME_MACHINE}-pc-sysv32\n\tfi\n\texit ;;\n    pc:*:*:*)\n\t# Left here for compatibility:\n\t# uname -m prints for DJGPP always 'pc', but it prints nothing about\n\t# the processor, so we play safe by assuming i586.\n\t# Note: whatever this is, it MUST be the same as what config.sub\n\t# prints for the \"djgpp\" host, or else GDB configury will decide that\n\t# this is a cross-build.\n\techo i586-pc-msdosdjgpp\n\texit ;;\n    Intel:Mach:3*:*)\n\techo i386-pc-mach3\n\texit ;;\n    paragon:*:*:*)\n\techo i860-intel-osf1\n\texit ;;\n    i860:*:4.*:*) # i860-SVR4\n\tif grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then\n\t  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4\n\telse # Add other i860-SVR4 vendors below as they are discovered.\n\t  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4\n\tfi\n\texit ;;\n    mini*:CTIX:SYS*5:*)\n\t# \"miniframe\"\n\techo m68010-convergent-sysv\n\texit ;;\n    mc68k:UNIX:SYSTEM5:3.51m)\n\techo m68k-convergent-sysv\n\texit ;;\n    M680?0:D-NIX:5.3:*)\n\techo m68k-diab-dnix\n\texit ;;\n    M68*:*:R3V[5678]*:*)\n\ttest -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;\n    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)\n\tOS_REL=''\n\ttest -r /etc/.relid \\\n\t&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \\([0-9][0-9]\\).*/\\1/p' < /etc/.relid`\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }\n\t/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \\\n\t  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;\n    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t  && { echo i486-ncr-sysv4; exit; } ;;\n    NCR*:*:4.2:* | MPRAS*:*:4.2:*)\n\tOS_REL='.3'\n\ttest -r /etc/.relid \\\n\t    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \\([0-9][0-9]\\).*/\\1/p' < /etc/.relid`\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }\n\t/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \\\n\t    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }\n\t/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \\\n\t    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;\n    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)\n\techo m68k-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    mc68030:UNIX_System_V:4.*:*)\n\techo m68k-atari-sysv4\n\texit ;;\n    TSUNAMI:LynxOS:2.*:*)\n\techo sparc-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    rs6000:LynxOS:2.*:*)\n\techo rs6000-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)\n\techo powerpc-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    SM[BE]S:UNIX_SV:*:*)\n\techo mips-dde-sysv${UNAME_RELEASE}\n\texit ;;\n    RM*:ReliantUNIX-*:*:*)\n\techo mips-sni-sysv4\n\texit ;;\n    RM*:SINIX-*:*:*)\n\techo mips-sni-sysv4\n\texit ;;\n    *:SINIX-*:*:*)\n\tif uname -p 2>/dev/null >/dev/null ; then\n\t\tUNAME_MACHINE=`(uname -p) 2>/dev/null`\n\t\techo ${UNAME_MACHINE}-sni-sysv4\n\telse\n\t\techo ns32k-sni-sysv\n\tfi\n\texit ;;\n    PENTIUM:*:4.0*:*)\t# Unisys `ClearPath HMP IX 4000' SVR4/MP effort\n\t\t\t# says <Richard.M.Bartel@ccMail.Census.GOV>\n\techo i586-unisys-sysv4\n\texit ;;\n    *:UNIX_System_V:4*:FTX*)\n\t# From Gerald Hewes <hewes@openmarket.com>.\n\t# How about differentiating between stratus architectures? -djm\n\techo hppa1.1-stratus-sysv4\n\texit ;;\n    *:*:*:FTX*)\n\t# From seanf@swdc.stratus.com.\n\techo i860-stratus-sysv4\n\texit ;;\n    i*86:VOS:*:*)\n\t# From Paul.Green@stratus.com.\n\techo ${UNAME_MACHINE}-stratus-vos\n\texit ;;\n    *:VOS:*:*)\n\t# From Paul.Green@stratus.com.\n\techo hppa1.1-stratus-vos\n\texit ;;\n    mc68*:A/UX:*:*)\n\techo m68k-apple-aux${UNAME_RELEASE}\n\texit ;;\n    news*:NEWS-OS:6*:*)\n\techo mips-sony-newsos6\n\texit ;;\n    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)\n\tif [ -d /usr/nec ]; then\n\t\techo mips-nec-sysv${UNAME_RELEASE}\n\telse\n\t\techo mips-unknown-sysv${UNAME_RELEASE}\n\tfi\n\texit ;;\n    BeBox:BeOS:*:*)\t# BeOS running on hardware made by Be, PPC only.\n\techo powerpc-be-beos\n\texit ;;\n    BeMac:BeOS:*:*)\t# BeOS running on Mac or Mac clone, PPC only.\n\techo powerpc-apple-beos\n\texit ;;\n    BePC:BeOS:*:*)\t# BeOS running on Intel PC compatible.\n\techo i586-pc-beos\n\texit ;;\n    BePC:Haiku:*:*)\t# Haiku running on Intel PC compatible.\n\techo i586-pc-haiku\n\texit ;;\n    x86_64:Haiku:*:*)\n\techo x86_64-unknown-haiku\n\texit ;;\n    SX-4:SUPER-UX:*:*)\n\techo sx4-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-5:SUPER-UX:*:*)\n\techo sx5-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-6:SUPER-UX:*:*)\n\techo sx6-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-7:SUPER-UX:*:*)\n\techo sx7-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-8:SUPER-UX:*:*)\n\techo sx8-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-8R:SUPER-UX:*:*)\n\techo sx8r-nec-superux${UNAME_RELEASE}\n\texit ;;\n    Power*:Rhapsody:*:*)\n\techo powerpc-apple-rhapsody${UNAME_RELEASE}\n\texit ;;\n    *:Rhapsody:*:*)\n\techo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}\n\texit ;;\n    *:Darwin:*:*)\n\tUNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown\n\teval $set_cc_for_build\n\tif test \"$UNAME_PROCESSOR\" = unknown ; then\n\t    UNAME_PROCESSOR=powerpc\n\tfi\n\tif test `echo \"$UNAME_RELEASE\" | sed -e 's/\\..*//'` -le 10 ; then\n\t    if [ \"$CC_FOR_BUILD\" != 'no_compiler_found' ]; then\n\t\tif (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \\\n\t\t    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \\\n\t\t    grep IS_64BIT_ARCH >/dev/null\n\t\tthen\n\t\t    case $UNAME_PROCESSOR in\n\t\t\ti386) UNAME_PROCESSOR=x86_64 ;;\n\t\t\tpowerpc) UNAME_PROCESSOR=powerpc64 ;;\n\t\t    esac\n\t\tfi\n\t    fi\n\telif test \"$UNAME_PROCESSOR\" = i386 ; then\n\t    # Avoid executing cc on OS X 10.9, as it ships with a stub\n\t    # that puts up a graphical alert prompting to install\n\t    # developer tools.  Any system running Mac OS X 10.7 or\n\t    # later (Darwin 11 and later) is required to have a 64-bit\n\t    # processor. This is not true of the ARM version of Darwin\n\t    # that Apple uses in portable devices.\n\t    UNAME_PROCESSOR=x86_64\n\tfi\n\techo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}\n\texit ;;\n    *:procnto*:*:* | *:QNX:[0123456789]*:*)\n\tUNAME_PROCESSOR=`uname -p`\n\tif test \"$UNAME_PROCESSOR\" = \"x86\"; then\n\t\tUNAME_PROCESSOR=i386\n\t\tUNAME_MACHINE=pc\n\tfi\n\techo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}\n\texit ;;\n    *:QNX:*:4*)\n\techo i386-pc-qnx\n\texit ;;\n    NEO-?:NONSTOP_KERNEL:*:*)\n\techo neo-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    NSE-*:NONSTOP_KERNEL:*:*)\n\techo nse-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    NSR-?:NONSTOP_KERNEL:*:*)\n\techo nsr-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    *:NonStop-UX:*:*)\n\techo mips-compaq-nonstopux\n\texit ;;\n    BS2000:POSIX*:*:*)\n\techo bs2000-siemens-sysv\n\texit ;;\n    DS/*:UNIX_System_V:*:*)\n\techo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}\n\texit ;;\n    *:Plan9:*:*)\n\t# \"uname -m\" is not consistent, so use $cputype instead. 386\n\t# is converted to i386 for consistency with other x86\n\t# operating systems.\n\tif test \"$cputype\" = \"386\"; then\n\t    UNAME_MACHINE=i386\n\telse\n\t    UNAME_MACHINE=\"$cputype\"\n\tfi\n\techo ${UNAME_MACHINE}-unknown-plan9\n\texit ;;\n    *:TOPS-10:*:*)\n\techo pdp10-unknown-tops10\n\texit ;;\n    *:TENEX:*:*)\n\techo pdp10-unknown-tenex\n\texit ;;\n    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)\n\techo pdp10-dec-tops20\n\texit ;;\n    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)\n\techo pdp10-xkl-tops20\n\texit ;;\n    *:TOPS-20:*:*)\n\techo pdp10-unknown-tops20\n\texit ;;\n    *:ITS:*:*)\n\techo pdp10-unknown-its\n\texit ;;\n    SEI:*:*:SEIUX)\n\techo mips-sei-seiux${UNAME_RELEASE}\n\texit ;;\n    *:DragonFly:*:*)\n\techo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`\n\texit ;;\n    *:*VMS:*:*)\n\tUNAME_MACHINE=`(uname -p) 2>/dev/null`\n\tcase \"${UNAME_MACHINE}\" in\n\t    A*) echo alpha-dec-vms ; exit ;;\n\t    I*) echo ia64-dec-vms ; exit ;;\n\t    V*) echo vax-dec-vms ; exit ;;\n\tesac ;;\n    *:XENIX:*:SysV)\n\techo i386-pc-xenix\n\texit ;;\n    i*86:skyos:*:*)\n\techo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'\n\texit ;;\n    i*86:rdos:*:*)\n\techo ${UNAME_MACHINE}-pc-rdos\n\texit ;;\n    i*86:AROS:*:*)\n\techo ${UNAME_MACHINE}-pc-aros\n\texit ;;\n    x86_64:VMkernel:*:*)\n\techo ${UNAME_MACHINE}-unknown-esx\n\texit ;;\nesac\n\ncat >&2 <<EOF\n$0: unable to guess system type\n\nThis script, last modified $timestamp, has failed to recognize\nthe operating system you are using. It is advised that you\ndownload the most up to date version of the config scripts from\n\n  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD\nand\n  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD\n\nIf the version you run ($0) is already up to date, please\nsend the following data and any information you think might be\npertinent to <config-patches@gnu.org> in order to provide the needed\ninformation to handle your system.\n\nconfig.guess timestamp = $timestamp\n\nuname -m = `(uname -m) 2>/dev/null || echo unknown`\nuname -r = `(uname -r) 2>/dev/null || echo unknown`\nuname -s = `(uname -s) 2>/dev/null || echo unknown`\nuname -v = `(uname -v) 2>/dev/null || echo unknown`\n\n/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`\n/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`\n\nhostinfo               = `(hostinfo) 2>/dev/null`\n/bin/universe          = `(/bin/universe) 2>/dev/null`\n/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`\n/bin/arch              = `(/bin/arch) 2>/dev/null`\n/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`\n/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`\n\nUNAME_MACHINE = ${UNAME_MACHINE}\nUNAME_RELEASE = ${UNAME_RELEASE}\nUNAME_SYSTEM  = ${UNAME_SYSTEM}\nUNAME_VERSION = ${UNAME_VERSION}\nEOF\n\nexit 1\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"timestamp='\"\n# time-stamp-format: \"%:y-%02m-%02d\"\n# time-stamp-end: \"'\"\n# End:\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/config.h.in",
    "content": "/* config.h.in.  Generated from configure.ac by autoheader.  */\n\n/* use 8 or 12 */\n#undef BITS_IN_JSAMPLE\n\n/* libjpeg-turbo build number */\n#undef BUILD\n\n/* Support arithmetic encoding */\n#undef C_ARITH_CODING_SUPPORTED\n\n/* Support arithmetic decoding */\n#undef D_ARITH_CODING_SUPPORTED\n\n/* Define to 1 if you have the <dlfcn.h> header file. */\n#undef HAVE_DLFCN_H\n\n/* Define to 1 if you have the <inttypes.h> header file. */\n#undef HAVE_INTTYPES_H\n\n/* Define to 1 if you have the <jni.h> header file. */\n#undef HAVE_JNI_H\n\n/* Define to 1 if you have the <locale.h> header file. */\n#undef HAVE_LOCALE_H\n\n/* Define to 1 if you have the `memcpy' function. */\n#undef HAVE_MEMCPY\n\n/* Define to 1 if you have the <memory.h> header file. */\n#undef HAVE_MEMORY_H\n\n/* Define to 1 if you have the `memset' function. */\n#undef HAVE_MEMSET\n\n/* Define to 1 if you have the <stddef.h> header file. */\n#undef HAVE_STDDEF_H\n\n/* Define to 1 if you have the <stdint.h> header file. */\n#undef HAVE_STDINT_H\n\n/* Define to 1 if you have the <stdlib.h> header file. */\n#undef HAVE_STDLIB_H\n\n/* Define to 1 if you have the <strings.h> header file. */\n#undef HAVE_STRINGS_H\n\n/* Define to 1 if you have the <string.h> header file. */\n#undef HAVE_STRING_H\n\n/* Define to 1 if you have the <sys/stat.h> header file. */\n#undef HAVE_SYS_STAT_H\n\n/* Define to 1 if you have the <sys/types.h> header file. */\n#undef HAVE_SYS_TYPES_H\n\n/* Define to 1 if you have the <unistd.h> header file. */\n#undef HAVE_UNISTD_H\n\n/* Define to 1 if the system has the type `unsigned char'. */\n#undef HAVE_UNSIGNED_CHAR\n\n/* Define to 1 if the system has the type `unsigned short'. */\n#undef HAVE_UNSIGNED_SHORT\n\n/* Compiler does not support pointers to undefined structures. */\n#undef INCOMPLETE_TYPES_BROKEN\n\n/* How to obtain function inlining. */\n#undef INLINE\n\n/* libjpeg API version */\n#undef JPEG_LIB_VERSION\n\n/* libjpeg-turbo version */\n#undef LIBJPEG_TURBO_VERSION\n\n/* libjpeg-turbo version in integer form */\n#undef LIBJPEG_TURBO_VERSION_NUMBER\n\n/* Define to the sub-directory where libtool stores uninstalled libraries. */\n#undef LT_OBJDIR\n\n/* Support in-memory source/destination managers */\n#undef MEM_SRCDST_SUPPORTED\n\n/* Define if you have BSD-like bzero and bcopy in <strings.h> rather than\n   memset/memcpy in <string.h>. */\n#undef NEED_BSD_STRINGS\n\n/* Define if you need to include <sys/types.h> to get size_t. */\n#undef NEED_SYS_TYPES_H\n\n/* Name of package */\n#undef PACKAGE\n\n/* Define to the address where bug reports for this package should be sent. */\n#undef PACKAGE_BUGREPORT\n\n/* Define to the full name of this package. */\n#undef PACKAGE_NAME\n\n/* Define to the full name and version of this package. */\n#undef PACKAGE_STRING\n\n/* Define to the one symbol short name of this package. */\n#undef PACKAGE_TARNAME\n\n/* Define to the home page for this package. */\n#undef PACKAGE_URL\n\n/* Define to the version of this package. */\n#undef PACKAGE_VERSION\n\n/* Define if your (broken) compiler shifts signed values as if they were\n   unsigned. */\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n/* The size of `size_t', as computed by sizeof. */\n#undef SIZEOF_SIZE_T\n\n/* Define to 1 if you have the ANSI C header files. */\n#undef STDC_HEADERS\n\n/* Version number of package */\n#undef VERSION\n\n/* Use accelerated SIMD routines. */\n#undef WITH_SIMD\n\n/* Define to 1 if type `char' is unsigned and you are not using gcc.  */\n#ifndef __CHAR_UNSIGNED__\n# undef __CHAR_UNSIGNED__\n#endif\n\n/* Define to empty if `const' does not conform to ANSI C. */\n#undef const\n\n/* Define to `__inline__' or `__inline' if that's what the C compiler\n   calls it, or to nothing if 'inline' is not supported under any name.  */\n#ifndef __cplusplus\n#undef inline\n#endif\n\n/* Define to `unsigned int' if <sys/types.h> does not define. */\n#undef size_t\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/config.sub",
    "content": "#! /bin/sh\n# Configuration validation subroutine script.\n#   Copyright 1992-2014 Free Software Foundation, Inc.\n\ntimestamp='2014-12-03'\n\n# This file is free software; you can redistribute it and/or modify it\n# under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, see <http://www.gnu.org/licenses/>.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that\n# program.  This Exception is an additional permission under section 7\n# of the GNU General Public License, version 3 (\"GPLv3\").\n\n\n# Please send patches to <config-patches@gnu.org>.\n#\n# Configuration subroutine to validate and canonicalize a configuration type.\n# Supply the specified configuration type as an argument.\n# If it is invalid, we print an error message on stderr and exit with code 1.\n# Otherwise, we print the canonical config type on stdout and succeed.\n\n# You can get the latest version of this script from:\n# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD\n\n# This file is supposed to be the same for all GNU packages\n# and recognize all the CPU types, system types and aliases\n# that are meaningful with *any* GNU software.\n# Each package is responsible for reporting which valid configurations\n# it does not support.  The user should be able to distinguish\n# a failure to support a valid configuration from a meaningless\n# configuration.\n\n# The goal of this file is to map all the various variations of a given\n# machine specification into a single specification in the form:\n#\tCPU_TYPE-MANUFACTURER-OPERATING_SYSTEM\n# or in some cases, the newer four-part form:\n#\tCPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM\n# It is wrong to echo any other type of specification.\n\nme=`echo \"$0\" | sed -e 's,.*/,,'`\n\nusage=\"\\\nUsage: $0 [OPTION] CPU-MFR-OPSYS\n       $0 [OPTION] ALIAS\n\nCanonicalize a configuration name.\n\nOperation modes:\n  -h, --help         print this help, then exit\n  -t, --time-stamp   print date of last modification, then exit\n  -v, --version      print version number, then exit\n\nReport bugs and patches to <config-patches@gnu.org>.\"\n\nversion=\"\\\nGNU config.sub ($timestamp)\n\nCopyright 1992-2014 Free Software Foundation, Inc.\n\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\"\n\nhelp=\"\nTry \\`$me --help' for more information.\"\n\n# Parse command line\nwhile test $# -gt 0 ; do\n  case $1 in\n    --time-stamp | --time* | -t )\n       echo \"$timestamp\" ; exit ;;\n    --version | -v )\n       echo \"$version\" ; exit ;;\n    --help | --h* | -h )\n       echo \"$usage\"; exit ;;\n    -- )     # Stop option processing\n       shift; break ;;\n    - )\t# Use stdin as input.\n       break ;;\n    -* )\n       echo \"$me: invalid option $1$help\"\n       exit 1 ;;\n\n    *local*)\n       # First pass through any local machine types.\n       echo $1\n       exit ;;\n\n    * )\n       break ;;\n  esac\ndone\n\ncase $# in\n 0) echo \"$me: missing argument$help\" >&2\n    exit 1;;\n 1) ;;\n *) echo \"$me: too many arguments$help\" >&2\n    exit 1;;\nesac\n\n# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).\n# Here we must recognize all the valid KERNEL-OS combinations.\nmaybe_os=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\2/'`\ncase $maybe_os in\n  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \\\n  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \\\n  knetbsd*-gnu* | netbsd*-gnu* | \\\n  kopensolaris*-gnu* | \\\n  storm-chaos* | os2-emx* | rtmk-nova*)\n    os=-$maybe_os\n    basic_machine=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\1/'`\n    ;;\n  android-linux)\n    os=-linux-android\n    basic_machine=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\1/'`-unknown\n    ;;\n  *)\n    basic_machine=`echo $1 | sed 's/-[^-]*$//'`\n    if [ $basic_machine != $1 ]\n    then os=`echo $1 | sed 's/.*-/-/'`\n    else os=; fi\n    ;;\nesac\n\n### Let's recognize common machines as not being operating systems so\n### that things like config.sub decstation-3100 work.  We also\n### recognize some manufacturers as not being operating systems, so we\n### can provide default operating systems below.\ncase $os in\n\t-sun*os*)\n\t\t# Prevent following clause from handling this invalid input.\n\t\t;;\n\t-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \\\n\t-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \\\n\t-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \\\n\t-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\\\n\t-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \\\n\t-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \\\n\t-apple | -axis | -knuth | -cray | -microblaze*)\n\t\tos=\n\t\tbasic_machine=$1\n\t\t;;\n\t-bluegene*)\n\t\tos=-cnk\n\t\t;;\n\t-sim | -cisco | -oki | -wec | -winbond)\n\t\tos=\n\t\tbasic_machine=$1\n\t\t;;\n\t-scout)\n\t\t;;\n\t-wrs)\n\t\tos=-vxworks\n\t\tbasic_machine=$1\n\t\t;;\n\t-chorusos*)\n\t\tos=-chorusos\n\t\tbasic_machine=$1\n\t\t;;\n\t-chorusrdb)\n\t\tos=-chorusrdb\n\t\tbasic_machine=$1\n\t\t;;\n\t-hiux*)\n\t\tos=-hiuxwe2\n\t\t;;\n\t-sco6)\n\t\tos=-sco5v6\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco5)\n\t\tos=-sco3.2v5\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco4)\n\t\tos=-sco3.2v4\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco3.2.[4-9]*)\n\t\tos=`echo $os | sed -e 's/sco3.2./sco3.2v/'`\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco3.2v[4-9]*)\n\t\t# Don't forget version if it is 3.2v4 or newer.\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco5v6*)\n\t\t# Don't forget version if it is 3.2v4 or newer.\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco*)\n\t\tos=-sco3.2v2\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-udk*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-isc)\n\t\tos=-isc2.2\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-clix*)\n\t\tbasic_machine=clipper-intergraph\n\t\t;;\n\t-isc*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-lynx*178)\n\t\tos=-lynxos178\n\t\t;;\n\t-lynx*5)\n\t\tos=-lynxos5\n\t\t;;\n\t-lynx*)\n\t\tos=-lynxos\n\t\t;;\n\t-ptx*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`\n\t\t;;\n\t-windowsnt*)\n\t\tos=`echo $os | sed -e 's/windowsnt/winnt/'`\n\t\t;;\n\t-psos*)\n\t\tos=-psos\n\t\t;;\n\t-mint | -mint[0-9]*)\n\t\tbasic_machine=m68k-atari\n\t\tos=-mint\n\t\t;;\nesac\n\n# Decode aliases for certain CPU-COMPANY combinations.\ncase $basic_machine in\n\t# Recognize the basic CPU types without company name.\n\t# Some are omitted here because they have special meanings below.\n\t1750a | 580 \\\n\t| a29k \\\n\t| aarch64 | aarch64_be \\\n\t| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \\\n\t| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \\\n\t| am33_2.0 \\\n\t| arc | arceb \\\n\t| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \\\n\t| avr | avr32 \\\n\t| be32 | be64 \\\n\t| bfin \\\n\t| c4x | c8051 | clipper \\\n\t| d10v | d30v | dlx | dsp16xx \\\n\t| epiphany \\\n\t| fido | fr30 | frv \\\n\t| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \\\n\t| hexagon \\\n\t| i370 | i860 | i960 | ia64 \\\n\t| ip2k | iq2000 \\\n\t| k1om \\\n\t| le32 | le64 \\\n\t| lm32 \\\n\t| m32c | m32r | m32rle | m68000 | m68k | m88k \\\n\t| maxq | mb | microblaze | microblazeel | mcore | mep | metag \\\n\t| mips | mipsbe | mipseb | mipsel | mipsle \\\n\t| mips16 \\\n\t| mips64 | mips64el \\\n\t| mips64octeon | mips64octeonel \\\n\t| mips64orion | mips64orionel \\\n\t| mips64r5900 | mips64r5900el \\\n\t| mips64vr | mips64vrel \\\n\t| mips64vr4100 | mips64vr4100el \\\n\t| mips64vr4300 | mips64vr4300el \\\n\t| mips64vr5000 | mips64vr5000el \\\n\t| mips64vr5900 | mips64vr5900el \\\n\t| mipsisa32 | mipsisa32el \\\n\t| mipsisa32r2 | mipsisa32r2el \\\n\t| mipsisa32r6 | mipsisa32r6el \\\n\t| mipsisa64 | mipsisa64el \\\n\t| mipsisa64r2 | mipsisa64r2el \\\n\t| mipsisa64r6 | mipsisa64r6el \\\n\t| mipsisa64sb1 | mipsisa64sb1el \\\n\t| mipsisa64sr71k | mipsisa64sr71kel \\\n\t| mipsr5900 | mipsr5900el \\\n\t| mipstx39 | mipstx39el \\\n\t| mn10200 | mn10300 \\\n\t| moxie \\\n\t| mt \\\n\t| msp430 \\\n\t| nds32 | nds32le | nds32be \\\n\t| nios | nios2 | nios2eb | nios2el \\\n\t| ns16k | ns32k \\\n\t| open8 | or1k | or1knd | or32 \\\n\t| pdp10 | pdp11 | pj | pjl \\\n\t| powerpc | powerpc64 | powerpc64le | powerpcle \\\n\t| pyramid \\\n\t| riscv32 | riscv64 \\\n\t| rl78 | rx \\\n\t| score \\\n\t| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \\\n\t| sh64 | sh64le \\\n\t| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \\\n\t| sparcv8 | sparcv9 | sparcv9b | sparcv9v \\\n\t| spu \\\n\t| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \\\n\t| ubicom32 \\\n\t| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \\\n\t| visium \\\n\t| we32k \\\n\t| x86 | xc16x | xstormy16 | xtensa \\\n\t| z8k | z80)\n\t\tbasic_machine=$basic_machine-unknown\n\t\t;;\n\tc54x)\n\t\tbasic_machine=tic54x-unknown\n\t\t;;\n\tc55x)\n\t\tbasic_machine=tic55x-unknown\n\t\t;;\n\tc6x)\n\t\tbasic_machine=tic6x-unknown\n\t\t;;\n\tleon|leon[3-9])\n\t\tbasic_machine=sparc-$basic_machine\n\t\t;;\n\tm6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-none\n\t\t;;\n\tm88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)\n\t\t;;\n\tms1)\n\t\tbasic_machine=mt-unknown\n\t\t;;\n\n\tstrongarm | thumb | xscale)\n\t\tbasic_machine=arm-unknown\n\t\t;;\n\txgate)\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-none\n\t\t;;\n\txscaleeb)\n\t\tbasic_machine=armeb-unknown\n\t\t;;\n\n\txscaleel)\n\t\tbasic_machine=armel-unknown\n\t\t;;\n\n\t# We use `pc' rather than `unknown'\n\t# because (1) that's what they normally are, and\n\t# (2) the word \"unknown\" tends to confuse beginning users.\n\ti*86 | x86_64)\n\t  basic_machine=$basic_machine-pc\n\t  ;;\n\t# Object if more than one company name word.\n\t*-*-*)\n\t\techo Invalid configuration \\`$1\\': machine \\`$basic_machine\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\n\t# Recognize the basic CPU types with company name.\n\t580-* \\\n\t| a29k-* \\\n\t| aarch64-* | aarch64_be-* \\\n\t| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \\\n\t| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \\\n\t| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \\\n\t| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \\\n\t| avr-* | avr32-* \\\n\t| be32-* | be64-* \\\n\t| bfin-* | bs2000-* \\\n\t| c[123]* | c30-* | [cjt]90-* | c4x-* \\\n\t| c8051-* | clipper-* | craynv-* | cydra-* \\\n\t| d10v-* | d30v-* | dlx-* \\\n\t| elxsi-* \\\n\t| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \\\n\t| h8300-* | h8500-* \\\n\t| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \\\n\t| hexagon-* \\\n\t| i*86-* | i860-* | i960-* | ia64-* \\\n\t| ip2k-* | iq2000-* \\\n\t| k1om-* \\\n\t| le32-* | le64-* \\\n\t| lm32-* \\\n\t| m32c-* | m32r-* | m32rle-* \\\n\t| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \\\n\t| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \\\n\t| microblaze-* | microblazeel-* \\\n\t| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \\\n\t| mips16-* \\\n\t| mips64-* | mips64el-* \\\n\t| mips64octeon-* | mips64octeonel-* \\\n\t| mips64orion-* | mips64orionel-* \\\n\t| mips64r5900-* | mips64r5900el-* \\\n\t| mips64vr-* | mips64vrel-* \\\n\t| mips64vr4100-* | mips64vr4100el-* \\\n\t| mips64vr4300-* | mips64vr4300el-* \\\n\t| mips64vr5000-* | mips64vr5000el-* \\\n\t| mips64vr5900-* | mips64vr5900el-* \\\n\t| mipsisa32-* | mipsisa32el-* \\\n\t| mipsisa32r2-* | mipsisa32r2el-* \\\n\t| mipsisa32r6-* | mipsisa32r6el-* \\\n\t| mipsisa64-* | mipsisa64el-* \\\n\t| mipsisa64r2-* | mipsisa64r2el-* \\\n\t| mipsisa64r6-* | mipsisa64r6el-* \\\n\t| mipsisa64sb1-* | mipsisa64sb1el-* \\\n\t| mipsisa64sr71k-* | mipsisa64sr71kel-* \\\n\t| mipsr5900-* | mipsr5900el-* \\\n\t| mipstx39-* | mipstx39el-* \\\n\t| mmix-* \\\n\t| mt-* \\\n\t| msp430-* \\\n\t| nds32-* | nds32le-* | nds32be-* \\\n\t| nios-* | nios2-* | nios2eb-* | nios2el-* \\\n\t| none-* | np1-* | ns16k-* | ns32k-* \\\n\t| open8-* \\\n\t| or1k*-* \\\n\t| orion-* \\\n\t| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \\\n\t| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \\\n\t| pyramid-* \\\n\t| rl78-* | romp-* | rs6000-* | rx-* \\\n\t| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \\\n\t| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \\\n\t| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \\\n\t| sparclite-* \\\n\t| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \\\n\t| tahoe-* \\\n\t| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \\\n\t| tile*-* \\\n\t| tron-* \\\n\t| ubicom32-* \\\n\t| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \\\n\t| vax-* \\\n\t| visium-* \\\n\t| we32k-* \\\n\t| x86-* | x86_64-* | xc16x-* | xps100-* \\\n\t| xstormy16-* | xtensa*-* \\\n\t| ymp-* \\\n\t| z8k-* | z80-*)\n\t\t;;\n\t# Recognize the basic CPU types without company name, with glob match.\n\txtensa*)\n\t\tbasic_machine=$basic_machine-unknown\n\t\t;;\n\t# Recognize the various machine names and aliases which stand\n\t# for a CPU type and a company and sometimes even an OS.\n\t386bsd)\n\t\tbasic_machine=i386-unknown\n\t\tos=-bsd\n\t\t;;\n\t3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)\n\t\tbasic_machine=m68000-att\n\t\t;;\n\t3b*)\n\t\tbasic_machine=we32k-att\n\t\t;;\n\ta29khif)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tabacus)\n\t\tbasic_machine=abacus-unknown\n\t\t;;\n\tadobe68k)\n\t\tbasic_machine=m68010-adobe\n\t\tos=-scout\n\t\t;;\n\talliant | fx80)\n\t\tbasic_machine=fx80-alliant\n\t\t;;\n\taltos | altos3068)\n\t\tbasic_machine=m68k-altos\n\t\t;;\n\tam29k)\n\t\tbasic_machine=a29k-none\n\t\tos=-bsd\n\t\t;;\n\tamd64)\n\t\tbasic_machine=x86_64-pc\n\t\t;;\n\tamd64-*)\n\t\tbasic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tamdahl)\n\t\tbasic_machine=580-amdahl\n\t\tos=-sysv\n\t\t;;\n\tamiga | amiga-*)\n\t\tbasic_machine=m68k-unknown\n\t\t;;\n\tamigaos | amigados)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-amigaos\n\t\t;;\n\tamigaunix | amix)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-sysv4\n\t\t;;\n\tapollo68)\n\t\tbasic_machine=m68k-apollo\n\t\tos=-sysv\n\t\t;;\n\tapollo68bsd)\n\t\tbasic_machine=m68k-apollo\n\t\tos=-bsd\n\t\t;;\n\taros)\n\t\tbasic_machine=i386-pc\n\t\tos=-aros\n\t\t;;\n\taux)\n\t\tbasic_machine=m68k-apple\n\t\tos=-aux\n\t\t;;\n\tbalance)\n\t\tbasic_machine=ns32k-sequent\n\t\tos=-dynix\n\t\t;;\n\tblackfin)\n\t\tbasic_machine=bfin-unknown\n\t\tos=-linux\n\t\t;;\n\tblackfin-*)\n\t\tbasic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=-linux\n\t\t;;\n\tbluegene*)\n\t\tbasic_machine=powerpc-ibm\n\t\tos=-cnk\n\t\t;;\n\tc54x-*)\n\t\tbasic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tc55x-*)\n\t\tbasic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tc6x-*)\n\t\tbasic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tc90)\n\t\tbasic_machine=c90-cray\n\t\tos=-unicos\n\t\t;;\n\tcegcc)\n\t\tbasic_machine=arm-unknown\n\t\tos=-cegcc\n\t\t;;\n\tconvex-c1)\n\t\tbasic_machine=c1-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c2)\n\t\tbasic_machine=c2-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c32)\n\t\tbasic_machine=c32-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c34)\n\t\tbasic_machine=c34-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c38)\n\t\tbasic_machine=c38-convex\n\t\tos=-bsd\n\t\t;;\n\tcray | j90)\n\t\tbasic_machine=j90-cray\n\t\tos=-unicos\n\t\t;;\n\tcraynv)\n\t\tbasic_machine=craynv-cray\n\t\tos=-unicosmp\n\t\t;;\n\tcr16 | cr16-*)\n\t\tbasic_machine=cr16-unknown\n\t\tos=-elf\n\t\t;;\n\tcrds | unos)\n\t\tbasic_machine=m68k-crds\n\t\t;;\n\tcrisv32 | crisv32-* | etraxfs*)\n\t\tbasic_machine=crisv32-axis\n\t\t;;\n\tcris | cris-* | etrax*)\n\t\tbasic_machine=cris-axis\n\t\t;;\n\tcrx)\n\t\tbasic_machine=crx-unknown\n\t\tos=-elf\n\t\t;;\n\tda30 | da30-*)\n\t\tbasic_machine=m68k-da30\n\t\t;;\n\tdecstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)\n\t\tbasic_machine=mips-dec\n\t\t;;\n\tdecsystem10* | dec10*)\n\t\tbasic_machine=pdp10-dec\n\t\tos=-tops10\n\t\t;;\n\tdecsystem20* | dec20*)\n\t\tbasic_machine=pdp10-dec\n\t\tos=-tops20\n\t\t;;\n\tdelta | 3300 | motorola-3300 | motorola-delta \\\n\t      | 3300-motorola | delta-motorola)\n\t\tbasic_machine=m68k-motorola\n\t\t;;\n\tdelta88)\n\t\tbasic_machine=m88k-motorola\n\t\tos=-sysv3\n\t\t;;\n\tdicos)\n\t\tbasic_machine=i686-pc\n\t\tos=-dicos\n\t\t;;\n\tdjgpp)\n\t\tbasic_machine=i586-pc\n\t\tos=-msdosdjgpp\n\t\t;;\n\tdpx20 | dpx20-*)\n\t\tbasic_machine=rs6000-bull\n\t\tos=-bosx\n\t\t;;\n\tdpx2* | dpx2*-bull)\n\t\tbasic_machine=m68k-bull\n\t\tos=-sysv3\n\t\t;;\n\tebmon29k)\n\t\tbasic_machine=a29k-amd\n\t\tos=-ebmon\n\t\t;;\n\telxsi)\n\t\tbasic_machine=elxsi-elxsi\n\t\tos=-bsd\n\t\t;;\n\tencore | umax | mmax)\n\t\tbasic_machine=ns32k-encore\n\t\t;;\n\tes1800 | OSE68k | ose68k | ose | OSE)\n\t\tbasic_machine=m68k-ericsson\n\t\tos=-ose\n\t\t;;\n\tfx2800)\n\t\tbasic_machine=i860-alliant\n\t\t;;\n\tgenix)\n\t\tbasic_machine=ns32k-ns\n\t\t;;\n\tgmicro)\n\t\tbasic_machine=tron-gmicro\n\t\tos=-sysv\n\t\t;;\n\tgo32)\n\t\tbasic_machine=i386-pc\n\t\tos=-go32\n\t\t;;\n\th3050r* | hiux*)\n\t\tbasic_machine=hppa1.1-hitachi\n\t\tos=-hiuxwe2\n\t\t;;\n\th8300hms)\n\t\tbasic_machine=h8300-hitachi\n\t\tos=-hms\n\t\t;;\n\th8300xray)\n\t\tbasic_machine=h8300-hitachi\n\t\tos=-xray\n\t\t;;\n\th8500hms)\n\t\tbasic_machine=h8500-hitachi\n\t\tos=-hms\n\t\t;;\n\tharris)\n\t\tbasic_machine=m88k-harris\n\t\tos=-sysv3\n\t\t;;\n\thp300-*)\n\t\tbasic_machine=m68k-hp\n\t\t;;\n\thp300bsd)\n\t\tbasic_machine=m68k-hp\n\t\tos=-bsd\n\t\t;;\n\thp300hpux)\n\t\tbasic_machine=m68k-hp\n\t\tos=-hpux\n\t\t;;\n\thp3k9[0-9][0-9] | hp9[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thp9k2[0-9][0-9] | hp9k31[0-9])\n\t\tbasic_machine=m68000-hp\n\t\t;;\n\thp9k3[2-9][0-9])\n\t\tbasic_machine=m68k-hp\n\t\t;;\n\thp9k6[0-9][0-9] | hp6[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thp9k7[0-79][0-9] | hp7[0-79][0-9])\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k78[0-9] | hp78[0-9])\n\t\t# FIXME: really hppa2.0-hp\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)\n\t\t# FIXME: really hppa2.0-hp\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[0-9][13679] | hp8[0-9][13679])\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[0-9][0-9] | hp8[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thppa-next)\n\t\tos=-nextstep3\n\t\t;;\n\thppaosf)\n\t\tbasic_machine=hppa1.1-hp\n\t\tos=-osf\n\t\t;;\n\thppro)\n\t\tbasic_machine=hppa1.1-hp\n\t\tos=-proelf\n\t\t;;\n\ti370-ibm* | ibm*)\n\t\tbasic_machine=i370-ibm\n\t\t;;\n\ti*86v32)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv32\n\t\t;;\n\ti*86v4*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv4\n\t\t;;\n\ti*86v)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv\n\t\t;;\n\ti*86sol2)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-solaris2\n\t\t;;\n\ti386mach)\n\t\tbasic_machine=i386-mach\n\t\tos=-mach\n\t\t;;\n\ti386-vsta | vsta)\n\t\tbasic_machine=i386-unknown\n\t\tos=-vsta\n\t\t;;\n\tiris | iris4d)\n\t\tbasic_machine=mips-sgi\n\t\tcase $os in\n\t\t    -irix*)\n\t\t\t;;\n\t\t    *)\n\t\t\tos=-irix4\n\t\t\t;;\n\t\tesac\n\t\t;;\n\tisi68 | isi)\n\t\tbasic_machine=m68k-isi\n\t\tos=-sysv\n\t\t;;\n\tleon-*|leon[3-9]-*)\n\t\tbasic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`\n\t\t;;\n\tm68knommu)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-linux\n\t\t;;\n\tm68knommu-*)\n\t\tbasic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=-linux\n\t\t;;\n\tm88k-omron*)\n\t\tbasic_machine=m88k-omron\n\t\t;;\n\tmagnum | m3230)\n\t\tbasic_machine=mips-mips\n\t\tos=-sysv\n\t\t;;\n\tmerlin)\n\t\tbasic_machine=ns32k-utek\n\t\tos=-sysv\n\t\t;;\n\tmicroblaze*)\n\t\tbasic_machine=microblaze-xilinx\n\t\t;;\n\tmingw64)\n\t\tbasic_machine=x86_64-pc\n\t\tos=-mingw64\n\t\t;;\n\tmingw32)\n\t\tbasic_machine=i686-pc\n\t\tos=-mingw32\n\t\t;;\n\tmingw32ce)\n\t\tbasic_machine=arm-unknown\n\t\tos=-mingw32ce\n\t\t;;\n\tminiframe)\n\t\tbasic_machine=m68000-convergent\n\t\t;;\n\t*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)\n\t\tbasic_machine=m68k-atari\n\t\tos=-mint\n\t\t;;\n\tmips3*-*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`\n\t\t;;\n\tmips3*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown\n\t\t;;\n\tmonitor)\n\t\tbasic_machine=m68k-rom68k\n\t\tos=-coff\n\t\t;;\n\tmorphos)\n\t\tbasic_machine=powerpc-unknown\n\t\tos=-morphos\n\t\t;;\n\tmoxiebox)\n\t\tbasic_machine=moxie-unknown\n\t\tos=-moxiebox\n\t\t;;\n\tmsdos)\n\t\tbasic_machine=i386-pc\n\t\tos=-msdos\n\t\t;;\n\tms1-*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`\n\t\t;;\n\tmsys)\n\t\tbasic_machine=i686-pc\n\t\tos=-msys\n\t\t;;\n\tmvs)\n\t\tbasic_machine=i370-ibm\n\t\tos=-mvs\n\t\t;;\n\tnacl)\n\t\tbasic_machine=le32-unknown\n\t\tos=-nacl\n\t\t;;\n\tncr3000)\n\t\tbasic_machine=i486-ncr\n\t\tos=-sysv4\n\t\t;;\n\tnetbsd386)\n\t\tbasic_machine=i386-unknown\n\t\tos=-netbsd\n\t\t;;\n\tnetwinder)\n\t\tbasic_machine=armv4l-rebel\n\t\tos=-linux\n\t\t;;\n\tnews | news700 | news800 | news900)\n\t\tbasic_machine=m68k-sony\n\t\tos=-newsos\n\t\t;;\n\tnews1000)\n\t\tbasic_machine=m68030-sony\n\t\tos=-newsos\n\t\t;;\n\tnews-3600 | risc-news)\n\t\tbasic_machine=mips-sony\n\t\tos=-newsos\n\t\t;;\n\tnecv70)\n\t\tbasic_machine=v70-nec\n\t\tos=-sysv\n\t\t;;\n\tnext | m*-next )\n\t\tbasic_machine=m68k-next\n\t\tcase $os in\n\t\t    -nextstep* )\n\t\t\t;;\n\t\t    -ns2*)\n\t\t      os=-nextstep2\n\t\t\t;;\n\t\t    *)\n\t\t      os=-nextstep3\n\t\t\t;;\n\t\tesac\n\t\t;;\n\tnh3000)\n\t\tbasic_machine=m68k-harris\n\t\tos=-cxux\n\t\t;;\n\tnh[45]000)\n\t\tbasic_machine=m88k-harris\n\t\tos=-cxux\n\t\t;;\n\tnindy960)\n\t\tbasic_machine=i960-intel\n\t\tos=-nindy\n\t\t;;\n\tmon960)\n\t\tbasic_machine=i960-intel\n\t\tos=-mon960\n\t\t;;\n\tnonstopux)\n\t\tbasic_machine=mips-compaq\n\t\tos=-nonstopux\n\t\t;;\n\tnp1)\n\t\tbasic_machine=np1-gould\n\t\t;;\n\tneo-tandem)\n\t\tbasic_machine=neo-tandem\n\t\t;;\n\tnse-tandem)\n\t\tbasic_machine=nse-tandem\n\t\t;;\n\tnsr-tandem)\n\t\tbasic_machine=nsr-tandem\n\t\t;;\n\top50n-* | op60c-*)\n\t\tbasic_machine=hppa1.1-oki\n\t\tos=-proelf\n\t\t;;\n\topenrisc | openrisc-*)\n\t\tbasic_machine=or32-unknown\n\t\t;;\n\tos400)\n\t\tbasic_machine=powerpc-ibm\n\t\tos=-os400\n\t\t;;\n\tOSE68000 | ose68000)\n\t\tbasic_machine=m68000-ericsson\n\t\tos=-ose\n\t\t;;\n\tos68k)\n\t\tbasic_machine=m68k-none\n\t\tos=-os68k\n\t\t;;\n\tpa-hitachi)\n\t\tbasic_machine=hppa1.1-hitachi\n\t\tos=-hiuxwe2\n\t\t;;\n\tparagon)\n\t\tbasic_machine=i860-intel\n\t\tos=-osf\n\t\t;;\n\tparisc)\n\t\tbasic_machine=hppa-unknown\n\t\tos=-linux\n\t\t;;\n\tparisc-*)\n\t\tbasic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=-linux\n\t\t;;\n\tpbd)\n\t\tbasic_machine=sparc-tti\n\t\t;;\n\tpbb)\n\t\tbasic_machine=m68k-tti\n\t\t;;\n\tpc532 | pc532-*)\n\t\tbasic_machine=ns32k-pc532\n\t\t;;\n\tpc98)\n\t\tbasic_machine=i386-pc\n\t\t;;\n\tpc98-*)\n\t\tbasic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentium | p5 | k5 | k6 | nexgen | viac3)\n\t\tbasic_machine=i586-pc\n\t\t;;\n\tpentiumpro | p6 | 6x86 | athlon | athlon_*)\n\t\tbasic_machine=i686-pc\n\t\t;;\n\tpentiumii | pentium2 | pentiumiii | pentium3)\n\t\tbasic_machine=i686-pc\n\t\t;;\n\tpentium4)\n\t\tbasic_machine=i786-pc\n\t\t;;\n\tpentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)\n\t\tbasic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentiumpro-* | p6-* | 6x86-* | athlon-*)\n\t\tbasic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)\n\t\tbasic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentium4-*)\n\t\tbasic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpn)\n\t\tbasic_machine=pn-gould\n\t\t;;\n\tpower)\tbasic_machine=power-ibm\n\t\t;;\n\tppc | ppcbe)\tbasic_machine=powerpc-unknown\n\t\t;;\n\tppc-* | ppcbe-*)\n\t\tbasic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppcle | powerpclittle | ppc-le | powerpc-little)\n\t\tbasic_machine=powerpcle-unknown\n\t\t;;\n\tppcle-* | powerpclittle-*)\n\t\tbasic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppc64)\tbasic_machine=powerpc64-unknown\n\t\t;;\n\tppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppc64le | powerpc64little | ppc64-le | powerpc64-little)\n\t\tbasic_machine=powerpc64le-unknown\n\t\t;;\n\tppc64le-* | powerpc64little-*)\n\t\tbasic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tps2)\n\t\tbasic_machine=i386-ibm\n\t\t;;\n\tpw32)\n\t\tbasic_machine=i586-unknown\n\t\tos=-pw32\n\t\t;;\n\trdos | rdos64)\n\t\tbasic_machine=x86_64-pc\n\t\tos=-rdos\n\t\t;;\n\trdos32)\n\t\tbasic_machine=i386-pc\n\t\tos=-rdos\n\t\t;;\n\trom68k)\n\t\tbasic_machine=m68k-rom68k\n\t\tos=-coff\n\t\t;;\n\trm[46]00)\n\t\tbasic_machine=mips-siemens\n\t\t;;\n\trtpc | rtpc-*)\n\t\tbasic_machine=romp-ibm\n\t\t;;\n\ts390 | s390-*)\n\t\tbasic_machine=s390-ibm\n\t\t;;\n\ts390x | s390x-*)\n\t\tbasic_machine=s390x-ibm\n\t\t;;\n\tsa29200)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tsb1)\n\t\tbasic_machine=mipsisa64sb1-unknown\n\t\t;;\n\tsb1el)\n\t\tbasic_machine=mipsisa64sb1el-unknown\n\t\t;;\n\tsde)\n\t\tbasic_machine=mipsisa32-sde\n\t\tos=-elf\n\t\t;;\n\tsei)\n\t\tbasic_machine=mips-sei\n\t\tos=-seiux\n\t\t;;\n\tsequent)\n\t\tbasic_machine=i386-sequent\n\t\t;;\n\tsh)\n\t\tbasic_machine=sh-hitachi\n\t\tos=-hms\n\t\t;;\n\tsh5el)\n\t\tbasic_machine=sh5le-unknown\n\t\t;;\n\tsh64)\n\t\tbasic_machine=sh64-unknown\n\t\t;;\n\tsparclite-wrs | simso-wrs)\n\t\tbasic_machine=sparclite-wrs\n\t\tos=-vxworks\n\t\t;;\n\tsps7)\n\t\tbasic_machine=m68k-bull\n\t\tos=-sysv2\n\t\t;;\n\tspur)\n\t\tbasic_machine=spur-unknown\n\t\t;;\n\tst2000)\n\t\tbasic_machine=m68k-tandem\n\t\t;;\n\tstratus)\n\t\tbasic_machine=i860-stratus\n\t\tos=-sysv4\n\t\t;;\n\tstrongarm-* | thumb-*)\n\t\tbasic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tsun2)\n\t\tbasic_machine=m68000-sun\n\t\t;;\n\tsun2os3)\n\t\tbasic_machine=m68000-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun2os4)\n\t\tbasic_machine=m68000-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun3os3)\n\t\tbasic_machine=m68k-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun3os4)\n\t\tbasic_machine=m68k-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun4os3)\n\t\tbasic_machine=sparc-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun4os4)\n\t\tbasic_machine=sparc-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun4sol2)\n\t\tbasic_machine=sparc-sun\n\t\tos=-solaris2\n\t\t;;\n\tsun3 | sun3-*)\n\t\tbasic_machine=m68k-sun\n\t\t;;\n\tsun4)\n\t\tbasic_machine=sparc-sun\n\t\t;;\n\tsun386 | sun386i | roadrunner)\n\t\tbasic_machine=i386-sun\n\t\t;;\n\tsv1)\n\t\tbasic_machine=sv1-cray\n\t\tos=-unicos\n\t\t;;\n\tsymmetry)\n\t\tbasic_machine=i386-sequent\n\t\tos=-dynix\n\t\t;;\n\tt3e)\n\t\tbasic_machine=alphaev5-cray\n\t\tos=-unicos\n\t\t;;\n\tt90)\n\t\tbasic_machine=t90-cray\n\t\tos=-unicos\n\t\t;;\n\ttile*)\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-linux-gnu\n\t\t;;\n\ttx39)\n\t\tbasic_machine=mipstx39-unknown\n\t\t;;\n\ttx39el)\n\t\tbasic_machine=mipstx39el-unknown\n\t\t;;\n\ttoad1)\n\t\tbasic_machine=pdp10-xkl\n\t\tos=-tops20\n\t\t;;\n\ttower | tower-32)\n\t\tbasic_machine=m68k-ncr\n\t\t;;\n\ttpf)\n\t\tbasic_machine=s390x-ibm\n\t\tos=-tpf\n\t\t;;\n\tudi29k)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tultra3)\n\t\tbasic_machine=a29k-nyu\n\t\tos=-sym1\n\t\t;;\n\tv810 | necv810)\n\t\tbasic_machine=v810-nec\n\t\tos=-none\n\t\t;;\n\tvaxv)\n\t\tbasic_machine=vax-dec\n\t\tos=-sysv\n\t\t;;\n\tvms)\n\t\tbasic_machine=vax-dec\n\t\tos=-vms\n\t\t;;\n\tvpp*|vx|vx-*)\n\t\tbasic_machine=f301-fujitsu\n\t\t;;\n\tvxworks960)\n\t\tbasic_machine=i960-wrs\n\t\tos=-vxworks\n\t\t;;\n\tvxworks68)\n\t\tbasic_machine=m68k-wrs\n\t\tos=-vxworks\n\t\t;;\n\tvxworks29k)\n\t\tbasic_machine=a29k-wrs\n\t\tos=-vxworks\n\t\t;;\n\tw65*)\n\t\tbasic_machine=w65-wdc\n\t\tos=-none\n\t\t;;\n\tw89k-*)\n\t\tbasic_machine=hppa1.1-winbond\n\t\tos=-proelf\n\t\t;;\n\txbox)\n\t\tbasic_machine=i686-pc\n\t\tos=-mingw32\n\t\t;;\n\txps | xps100)\n\t\tbasic_machine=xps100-honeywell\n\t\t;;\n\txscale-* | xscalee[bl]-*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`\n\t\t;;\n\tymp)\n\t\tbasic_machine=ymp-cray\n\t\tos=-unicos\n\t\t;;\n\tz8k-*-coff)\n\t\tbasic_machine=z8k-unknown\n\t\tos=-sim\n\t\t;;\n\tz80-*-coff)\n\t\tbasic_machine=z80-unknown\n\t\tos=-sim\n\t\t;;\n\tnone)\n\t\tbasic_machine=none-none\n\t\tos=-none\n\t\t;;\n\n# Here we handle the default manufacturer of certain CPU types.  It is in\n# some cases the only manufacturer, in others, it is the most popular.\n\tw89k)\n\t\tbasic_machine=hppa1.1-winbond\n\t\t;;\n\top50n)\n\t\tbasic_machine=hppa1.1-oki\n\t\t;;\n\top60c)\n\t\tbasic_machine=hppa1.1-oki\n\t\t;;\n\tromp)\n\t\tbasic_machine=romp-ibm\n\t\t;;\n\tmmix)\n\t\tbasic_machine=mmix-knuth\n\t\t;;\n\trs6000)\n\t\tbasic_machine=rs6000-ibm\n\t\t;;\n\tvax)\n\t\tbasic_machine=vax-dec\n\t\t;;\n\tpdp10)\n\t\t# there are many clones, so DEC is not a safe bet\n\t\tbasic_machine=pdp10-unknown\n\t\t;;\n\tpdp11)\n\t\tbasic_machine=pdp11-dec\n\t\t;;\n\twe32k)\n\t\tbasic_machine=we32k-att\n\t\t;;\n\tsh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)\n\t\tbasic_machine=sh-unknown\n\t\t;;\n\tsparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)\n\t\tbasic_machine=sparc-sun\n\t\t;;\n\tcydra)\n\t\tbasic_machine=cydra-cydrome\n\t\t;;\n\torion)\n\t\tbasic_machine=orion-highlevel\n\t\t;;\n\torion105)\n\t\tbasic_machine=clipper-highlevel\n\t\t;;\n\tmac | mpw | mac-mpw)\n\t\tbasic_machine=m68k-apple\n\t\t;;\n\tpmac | pmac-mpw)\n\t\tbasic_machine=powerpc-apple\n\t\t;;\n\t*-unknown)\n\t\t# Make sure to match an already-canonicalized machine name.\n\t\t;;\n\t*)\n\t\techo Invalid configuration \\`$1\\': machine \\`$basic_machine\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\nesac\n\n# Here we canonicalize certain aliases for manufacturers.\ncase $basic_machine in\n\t*-digital*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`\n\t\t;;\n\t*-commodore*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`\n\t\t;;\n\t*)\n\t\t;;\nesac\n\n# Decode manufacturer-specific aliases for certain operating systems.\n\nif [ x\"$os\" != x\"\" ]\nthen\ncase $os in\n\t# First match some system type aliases\n\t# that might get confused with valid system types.\n\t# -solaris* is a basic system type, with this one exception.\n\t-auroraux)\n\t\tos=-auroraux\n\t\t;;\n\t-solaris1 | -solaris1.*)\n\t\tos=`echo $os | sed -e 's|solaris1|sunos4|'`\n\t\t;;\n\t-solaris)\n\t\tos=-solaris2\n\t\t;;\n\t-svr4*)\n\t\tos=-sysv4\n\t\t;;\n\t-unixware*)\n\t\tos=-sysv4.2uw\n\t\t;;\n\t-gnu/linux*)\n\t\tos=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`\n\t\t;;\n\t# First accept the basic system types.\n\t# The portable systems comes first.\n\t# Each alternative MUST END IN A *, to match a version number.\n\t# -sysv* is not here because it comes later, after sysvr4.\n\t-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \\\n\t      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\\\n\t      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \\\n\t      | -sym* | -kopensolaris* | -plan9* \\\n\t      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \\\n\t      | -aos* | -aros* \\\n\t      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \\\n\t      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \\\n\t      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \\\n\t      | -bitrig* | -openbsd* | -solidbsd* \\\n\t      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \\\n\t      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \\\n\t      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \\\n\t      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \\\n\t      | -chorusos* | -chorusrdb* | -cegcc* \\\n\t      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \\\n\t      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \\\n\t      | -linux-newlib* | -linux-musl* | -linux-uclibc* \\\n\t      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \\\n\t      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \\\n\t      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \\\n\t      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \\\n\t      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \\\n\t      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \\\n\t      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \\\n\t      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)\n\t# Remember, each alternative MUST END IN *, to match a version number.\n\t\t;;\n\t-qnx*)\n\t\tcase $basic_machine in\n\t\t    x86-* | i*86-*)\n\t\t\t;;\n\t\t    *)\n\t\t\tos=-nto$os\n\t\t\t;;\n\t\tesac\n\t\t;;\n\t-nto-qnx*)\n\t\t;;\n\t-nto*)\n\t\tos=`echo $os | sed -e 's|nto|nto-qnx|'`\n\t\t;;\n\t-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \\\n\t      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \\\n\t      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)\n\t\t;;\n\t-mac*)\n\t\tos=`echo $os | sed -e 's|mac|macos|'`\n\t\t;;\n\t-linux-dietlibc)\n\t\tos=-linux-dietlibc\n\t\t;;\n\t-linux*)\n\t\tos=`echo $os | sed -e 's|linux|linux-gnu|'`\n\t\t;;\n\t-sunos5*)\n\t\tos=`echo $os | sed -e 's|sunos5|solaris2|'`\n\t\t;;\n\t-sunos6*)\n\t\tos=`echo $os | sed -e 's|sunos6|solaris3|'`\n\t\t;;\n\t-opened*)\n\t\tos=-openedition\n\t\t;;\n\t-os400*)\n\t\tos=-os400\n\t\t;;\n\t-wince*)\n\t\tos=-wince\n\t\t;;\n\t-osfrose*)\n\t\tos=-osfrose\n\t\t;;\n\t-osf*)\n\t\tos=-osf\n\t\t;;\n\t-utek*)\n\t\tos=-bsd\n\t\t;;\n\t-dynix*)\n\t\tos=-bsd\n\t\t;;\n\t-acis*)\n\t\tos=-aos\n\t\t;;\n\t-atheos*)\n\t\tos=-atheos\n\t\t;;\n\t-syllable*)\n\t\tos=-syllable\n\t\t;;\n\t-386bsd)\n\t\tos=-bsd\n\t\t;;\n\t-ctix* | -uts*)\n\t\tos=-sysv\n\t\t;;\n\t-nova*)\n\t\tos=-rtmk-nova\n\t\t;;\n\t-ns2 )\n\t\tos=-nextstep2\n\t\t;;\n\t-nsk*)\n\t\tos=-nsk\n\t\t;;\n\t# Preserve the version number of sinix5.\n\t-sinix5.*)\n\t\tos=`echo $os | sed -e 's|sinix|sysv|'`\n\t\t;;\n\t-sinix*)\n\t\tos=-sysv4\n\t\t;;\n\t-tpf*)\n\t\tos=-tpf\n\t\t;;\n\t-triton*)\n\t\tos=-sysv3\n\t\t;;\n\t-oss*)\n\t\tos=-sysv3\n\t\t;;\n\t-svr4)\n\t\tos=-sysv4\n\t\t;;\n\t-svr3)\n\t\tos=-sysv3\n\t\t;;\n\t-sysvr4)\n\t\tos=-sysv4\n\t\t;;\n\t# This must come after -sysvr4.\n\t-sysv*)\n\t\t;;\n\t-ose*)\n\t\tos=-ose\n\t\t;;\n\t-es1800*)\n\t\tos=-ose\n\t\t;;\n\t-xenix)\n\t\tos=-xenix\n\t\t;;\n\t-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)\n\t\tos=-mint\n\t\t;;\n\t-aros*)\n\t\tos=-aros\n\t\t;;\n\t-zvmoe)\n\t\tos=-zvmoe\n\t\t;;\n\t-dicos*)\n\t\tos=-dicos\n\t\t;;\n\t-nacl*)\n\t\t;;\n\t-none)\n\t\t;;\n\t*)\n\t\t# Get rid of the `-' at the beginning of $os.\n\t\tos=`echo $os | sed 's/[^-]*-//'`\n\t\techo Invalid configuration \\`$1\\': system \\`$os\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\nesac\nelse\n\n# Here we handle the default operating systems that come with various machines.\n# The value should be what the vendor currently ships out the door with their\n# machine or put another way, the most popular os provided with the machine.\n\n# Note that if you're going to try to match \"-MANUFACTURER\" here (say,\n# \"-sun\"), then you have to tell the case statement up towards the top\n# that MANUFACTURER isn't an operating system.  Otherwise, code above\n# will signal an error saying that MANUFACTURER isn't an operating\n# system, and we'll never get to this point.\n\ncase $basic_machine in\n\tscore-*)\n\t\tos=-elf\n\t\t;;\n\tspu-*)\n\t\tos=-elf\n\t\t;;\n\t*-acorn)\n\t\tos=-riscix1.2\n\t\t;;\n\tarm*-rebel)\n\t\tos=-linux\n\t\t;;\n\tarm*-semi)\n\t\tos=-aout\n\t\t;;\n\tc4x-* | tic4x-*)\n\t\tos=-coff\n\t\t;;\n\tc8051-*)\n\t\tos=-elf\n\t\t;;\n\thexagon-*)\n\t\tos=-elf\n\t\t;;\n\ttic54x-*)\n\t\tos=-coff\n\t\t;;\n\ttic55x-*)\n\t\tos=-coff\n\t\t;;\n\ttic6x-*)\n\t\tos=-coff\n\t\t;;\n\t# This must come before the *-dec entry.\n\tpdp10-*)\n\t\tos=-tops20\n\t\t;;\n\tpdp11-*)\n\t\tos=-none\n\t\t;;\n\t*-dec | vax-*)\n\t\tos=-ultrix4.2\n\t\t;;\n\tm68*-apollo)\n\t\tos=-domain\n\t\t;;\n\ti386-sun)\n\t\tos=-sunos4.0.2\n\t\t;;\n\tm68000-sun)\n\t\tos=-sunos3\n\t\t;;\n\tm68*-cisco)\n\t\tos=-aout\n\t\t;;\n\tmep-*)\n\t\tos=-elf\n\t\t;;\n\tmips*-cisco)\n\t\tos=-elf\n\t\t;;\n\tmips*-*)\n\t\tos=-elf\n\t\t;;\n\tor32-*)\n\t\tos=-coff\n\t\t;;\n\t*-tti)\t# must be before sparc entry or we get the wrong os.\n\t\tos=-sysv3\n\t\t;;\n\tsparc-* | *-sun)\n\t\tos=-sunos4.1.1\n\t\t;;\n\t*-be)\n\t\tos=-beos\n\t\t;;\n\t*-haiku)\n\t\tos=-haiku\n\t\t;;\n\t*-ibm)\n\t\tos=-aix\n\t\t;;\n\t*-knuth)\n\t\tos=-mmixware\n\t\t;;\n\t*-wec)\n\t\tos=-proelf\n\t\t;;\n\t*-winbond)\n\t\tos=-proelf\n\t\t;;\n\t*-oki)\n\t\tos=-proelf\n\t\t;;\n\t*-hp)\n\t\tos=-hpux\n\t\t;;\n\t*-hitachi)\n\t\tos=-hiux\n\t\t;;\n\ti860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)\n\t\tos=-sysv\n\t\t;;\n\t*-cbm)\n\t\tos=-amigaos\n\t\t;;\n\t*-dg)\n\t\tos=-dgux\n\t\t;;\n\t*-dolphin)\n\t\tos=-sysv3\n\t\t;;\n\tm68k-ccur)\n\t\tos=-rtu\n\t\t;;\n\tm88k-omron*)\n\t\tos=-luna\n\t\t;;\n\t*-next )\n\t\tos=-nextstep\n\t\t;;\n\t*-sequent)\n\t\tos=-ptx\n\t\t;;\n\t*-crds)\n\t\tos=-unos\n\t\t;;\n\t*-ns)\n\t\tos=-genix\n\t\t;;\n\ti370-*)\n\t\tos=-mvs\n\t\t;;\n\t*-next)\n\t\tos=-nextstep3\n\t\t;;\n\t*-gould)\n\t\tos=-sysv\n\t\t;;\n\t*-highlevel)\n\t\tos=-bsd\n\t\t;;\n\t*-encore)\n\t\tos=-bsd\n\t\t;;\n\t*-sgi)\n\t\tos=-irix\n\t\t;;\n\t*-siemens)\n\t\tos=-sysv4\n\t\t;;\n\t*-masscomp)\n\t\tos=-rtu\n\t\t;;\n\tf30[01]-fujitsu | f700-fujitsu)\n\t\tos=-uxpv\n\t\t;;\n\t*-rom68k)\n\t\tos=-coff\n\t\t;;\n\t*-*bug)\n\t\tos=-coff\n\t\t;;\n\t*-apple)\n\t\tos=-macos\n\t\t;;\n\t*-atari*)\n\t\tos=-mint\n\t\t;;\n\t*)\n\t\tos=-none\n\t\t;;\nesac\nfi\n\n# Here we handle the case where we know the os, and the CPU type, but not the\n# manufacturer.  We pick the logical manufacturer.\nvendor=unknown\ncase $basic_machine in\n\t*-unknown)\n\t\tcase $os in\n\t\t\t-riscix*)\n\t\t\t\tvendor=acorn\n\t\t\t\t;;\n\t\t\t-sunos*)\n\t\t\t\tvendor=sun\n\t\t\t\t;;\n\t\t\t-cnk*|-aix*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-beos*)\n\t\t\t\tvendor=be\n\t\t\t\t;;\n\t\t\t-hpux*)\n\t\t\t\tvendor=hp\n\t\t\t\t;;\n\t\t\t-mpeix*)\n\t\t\t\tvendor=hp\n\t\t\t\t;;\n\t\t\t-hiux*)\n\t\t\t\tvendor=hitachi\n\t\t\t\t;;\n\t\t\t-unos*)\n\t\t\t\tvendor=crds\n\t\t\t\t;;\n\t\t\t-dgux*)\n\t\t\t\tvendor=dg\n\t\t\t\t;;\n\t\t\t-luna*)\n\t\t\t\tvendor=omron\n\t\t\t\t;;\n\t\t\t-genix*)\n\t\t\t\tvendor=ns\n\t\t\t\t;;\n\t\t\t-mvs* | -opened*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-os400*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-ptx*)\n\t\t\t\tvendor=sequent\n\t\t\t\t;;\n\t\t\t-tpf*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-vxsim* | -vxworks* | -windiss*)\n\t\t\t\tvendor=wrs\n\t\t\t\t;;\n\t\t\t-aux*)\n\t\t\t\tvendor=apple\n\t\t\t\t;;\n\t\t\t-hms*)\n\t\t\t\tvendor=hitachi\n\t\t\t\t;;\n\t\t\t-mpw* | -macos*)\n\t\t\t\tvendor=apple\n\t\t\t\t;;\n\t\t\t-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)\n\t\t\t\tvendor=atari\n\t\t\t\t;;\n\t\t\t-vos*)\n\t\t\t\tvendor=stratus\n\t\t\t\t;;\n\t\tesac\n\t\tbasic_machine=`echo $basic_machine | sed \"s/unknown/$vendor/\"`\n\t\t;;\nesac\n\necho $basic_machine$os\nexit\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"timestamp='\"\n# time-stamp-format: \"%:y-%02m-%02d\"\n# time-stamp-end: \"'\"\n# End:\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/configure",
    "content": "#! /bin/sh\n# Guess values for system-dependent variables and create Makefiles.\n# Generated by GNU Autoconf 2.69 for libjpeg-turbo 1.5.0.\n#\n#\n# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.\n#\n#\n# This configure script is free software; the Free Software Foundation\n# gives unlimited permission to copy, distribute and modify it.\n## -------------------- ##\n## M4sh Initialization. ##\n## -------------------- ##\n\n# Be more Bourne compatible\nDUALCASE=1; export DUALCASE # for MKS sh\nif test -n \"${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :\n  emulate sh\n  NULLCMD=:\n  # Pre-4.2 versions of Zsh do word splitting on ${1+\"$@\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '${1+\"$@\"}'='\"$@\"'\n  setopt NO_GLOB_SUBST\nelse\n  case `(set -o) 2>/dev/null` in #(\n  *posix*) :\n    set -o posix ;; #(\n  *) :\n     ;;\nesac\nfi\n\n\nas_nl='\n'\nexport as_nl\n# Printing a long string crashes Solaris 7 /usr/bin/printf.\nas_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\nas_echo=$as_echo$as_echo$as_echo$as_echo$as_echo\nas_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo\n# Prefer a ksh shell builtin over an external printf program on Solaris,\n# but without wasting forks for bash or zsh.\nif test -z \"$BASH_VERSION$ZSH_VERSION\" \\\n    && (test \"X`print -r -- $as_echo`\" = \"X$as_echo\") 2>/dev/null; then\n  as_echo='print -r --'\n  as_echo_n='print -rn --'\nelif (test \"X`printf %s $as_echo`\" = \"X$as_echo\") 2>/dev/null; then\n  as_echo='printf %s\\n'\n  as_echo_n='printf %s'\nelse\n  if test \"X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`\" = \"X-n $as_echo\"; then\n    as_echo_body='eval /usr/ucb/echo -n \"$1$as_nl\"'\n    as_echo_n='/usr/ucb/echo -n'\n  else\n    as_echo_body='eval expr \"X$1\" : \"X\\\\(.*\\\\)\"'\n    as_echo_n_body='eval\n      arg=$1;\n      case $arg in #(\n      *\"$as_nl\"*)\n\texpr \"X$arg\" : \"X\\\\(.*\\\\)$as_nl\";\n\targ=`expr \"X$arg\" : \".*$as_nl\\\\(.*\\\\)\"`;;\n      esac;\n      expr \"X$arg\" : \"X\\\\(.*\\\\)\" | tr -d \"$as_nl\"\n    '\n    export as_echo_n_body\n    as_echo_n='sh -c $as_echo_n_body as_echo'\n  fi\n  export as_echo_body\n  as_echo='sh -c $as_echo_body as_echo'\nfi\n\n# The user is always right.\nif test \"${PATH_SEPARATOR+set}\" != set; then\n  PATH_SEPARATOR=:\n  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {\n    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||\n      PATH_SEPARATOR=';'\n  }\nfi\n\n\n# IFS\n# We need space, tab and new line, in precisely that order.  Quoting is\n# there to prevent editors from complaining about space-tab.\n# (If _AS_PATH_WALK were called with IFS unset, it would disable word\n# splitting by setting IFS to empty value.)\nIFS=\" \"\"\t$as_nl\"\n\n# Find who we are.  Look in the path if we contain no directory separator.\nas_myself=\ncase $0 in #((\n  *[\\\\/]* ) as_myself=$0 ;;\n  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    test -r \"$as_dir/$0\" && as_myself=$as_dir/$0 && break\n  done\nIFS=$as_save_IFS\n\n     ;;\nesac\n# We did not find ourselves, most probably we were run as `sh COMMAND'\n# in which case we are not to be found in the path.\nif test \"x$as_myself\" = x; then\n  as_myself=$0\nfi\nif test ! -f \"$as_myself\"; then\n  $as_echo \"$as_myself: error: cannot find myself; rerun with an absolute file name\" >&2\n  exit 1\nfi\n\n# Unset variables that we do not need and which cause bugs (e.g. in\n# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the \"|| exit 1\"\n# suppresses any \"Segmentation fault\" message there.  '((' could\n# trigger a bug in pdksh 5.2.14.\nfor as_var in BASH_ENV ENV MAIL MAILPATH\ndo eval test x\\${$as_var+set} = xset \\\n  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :\ndone\nPS1='$ '\nPS2='> '\nPS4='+ '\n\n# NLS nuisances.\nLC_ALL=C\nexport LC_ALL\nLANGUAGE=C\nexport LANGUAGE\n\n# CDPATH.\n(unset CDPATH) >/dev/null 2>&1 && unset CDPATH\n\n# Use a proper internal environment variable to ensure we don't fall\n  # into an infinite loop, continuously re-executing ourselves.\n  if test x\"${_as_can_reexec}\" != xno && test \"x$CONFIG_SHELL\" != x; then\n    _as_can_reexec=no; export _as_can_reexec;\n    # We cannot yet assume a decent shell, so we have to provide a\n# neutralization value for shells without unset; and this also\n# works around shells that cannot unset nonexistent variables.\n# Preserve -v and -x to the replacement shell.\nBASH_ENV=/dev/null\nENV=/dev/null\n(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV\ncase $- in # ((((\n  *v*x* | *x*v* ) as_opts=-vx ;;\n  *v* ) as_opts=-v ;;\n  *x* ) as_opts=-x ;;\n  * ) as_opts= ;;\nesac\nexec $CONFIG_SHELL $as_opts \"$as_myself\" ${1+\"$@\"}\n# Admittedly, this is quite paranoid, since all the known shells bail\n# out after a failed `exec'.\n$as_echo \"$0: could not re-execute with $CONFIG_SHELL\" >&2\nas_fn_exit 255\n  fi\n  # We don't want this to propagate to other subprocesses.\n          { _as_can_reexec=; unset _as_can_reexec;}\nif test \"x$CONFIG_SHELL\" = x; then\n  as_bourne_compatible=\"if test -n \\\"\\${ZSH_VERSION+set}\\\" && (emulate sh) >/dev/null 2>&1; then :\n  emulate sh\n  NULLCMD=:\n  # Pre-4.2 versions of Zsh do word splitting on \\${1+\\\"\\$@\\\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '\\${1+\\\"\\$@\\\"}'='\\\"\\$@\\\"'\n  setopt NO_GLOB_SUBST\nelse\n  case \\`(set -o) 2>/dev/null\\` in #(\n  *posix*) :\n    set -o posix ;; #(\n  *) :\n     ;;\nesac\nfi\n\"\n  as_required=\"as_fn_return () { (exit \\$1); }\nas_fn_success () { as_fn_return 0; }\nas_fn_failure () { as_fn_return 1; }\nas_fn_ret_success () { return 0; }\nas_fn_ret_failure () { return 1; }\n\nexitcode=0\nas_fn_success || { exitcode=1; echo as_fn_success failed.; }\nas_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }\nas_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }\nas_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }\nif ( set x; as_fn_ret_success y && test x = \\\"\\$1\\\" ); then :\n\nelse\n  exitcode=1; echo positional parameters were not saved.\nfi\ntest x\\$exitcode = x0 || exit 1\ntest -x / || exit 1\"\n  as_suggested=\"  as_lineno_1=\";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested\" as_lineno_1a=\\$LINENO\n  as_lineno_2=\";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested\" as_lineno_2a=\\$LINENO\n  eval 'test \\\"x\\$as_lineno_1'\\$as_run'\\\" != \\\"x\\$as_lineno_2'\\$as_run'\\\" &&\n  test \\\"x\\`expr \\$as_lineno_1'\\$as_run' + 1\\`\\\" = \\\"x\\$as_lineno_2'\\$as_run'\\\"' || exit 1\n\n  test -n \\\"\\${ZSH_VERSION+set}\\${BASH_VERSION+set}\\\" || (\n    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\n    ECHO=\\$ECHO\\$ECHO\\$ECHO\\$ECHO\\$ECHO\n    ECHO=\\$ECHO\\$ECHO\\$ECHO\\$ECHO\\$ECHO\\$ECHO\n    PATH=/empty FPATH=/empty; export PATH FPATH\n    test \\\"X\\`printf %s \\$ECHO\\`\\\" = \\\"X\\$ECHO\\\" \\\\\n      || test \\\"X\\`print -r -- \\$ECHO\\`\\\" = \\\"X\\$ECHO\\\" ) || exit 1\ntest \\$(( 1 + 1 )) = 2 || exit 1\"\n  if (eval \"$as_required\") 2>/dev/null; then :\n  as_have_required=yes\nelse\n  as_have_required=no\nfi\n  if test x$as_have_required = xyes && (eval \"$as_suggested\") 2>/dev/null; then :\n\nelse\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nas_found=false\nfor as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  as_found=:\n  case $as_dir in #(\n\t /*)\n\t   for as_base in sh bash ksh sh5; do\n\t     # Try only shells that exist, to save several forks.\n\t     as_shell=$as_dir/$as_base\n\t     if { test -f \"$as_shell\" || test -f \"$as_shell.exe\"; } &&\n\t\t    { $as_echo \"$as_bourne_compatible\"\"$as_required\" | as_run=a \"$as_shell\"; } 2>/dev/null; then :\n  CONFIG_SHELL=$as_shell as_have_required=yes\n\t\t   if { $as_echo \"$as_bourne_compatible\"\"$as_suggested\" | as_run=a \"$as_shell\"; } 2>/dev/null; then :\n  break 2\nfi\nfi\n\t   done;;\n       esac\n  as_found=false\ndone\n$as_found || { if { test -f \"$SHELL\" || test -f \"$SHELL.exe\"; } &&\n\t      { $as_echo \"$as_bourne_compatible\"\"$as_required\" | as_run=a \"$SHELL\"; } 2>/dev/null; then :\n  CONFIG_SHELL=$SHELL as_have_required=yes\nfi; }\nIFS=$as_save_IFS\n\n\n      if test \"x$CONFIG_SHELL\" != x; then :\n  export CONFIG_SHELL\n             # We cannot yet assume a decent shell, so we have to provide a\n# neutralization value for shells without unset; and this also\n# works around shells that cannot unset nonexistent variables.\n# Preserve -v and -x to the replacement shell.\nBASH_ENV=/dev/null\nENV=/dev/null\n(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV\ncase $- in # ((((\n  *v*x* | *x*v* ) as_opts=-vx ;;\n  *v* ) as_opts=-v ;;\n  *x* ) as_opts=-x ;;\n  * ) as_opts= ;;\nesac\nexec $CONFIG_SHELL $as_opts \"$as_myself\" ${1+\"$@\"}\n# Admittedly, this is quite paranoid, since all the known shells bail\n# out after a failed `exec'.\n$as_echo \"$0: could not re-execute with $CONFIG_SHELL\" >&2\nexit 255\nfi\n\n    if test x$as_have_required = xno; then :\n  $as_echo \"$0: This script requires a shell more modern than all\"\n  $as_echo \"$0: the shells that I found on your system.\"\n  if test x${ZSH_VERSION+set} = xset ; then\n    $as_echo \"$0: In particular, zsh $ZSH_VERSION has bugs and should\"\n    $as_echo \"$0: be upgraded to zsh 4.3.4 or later.\"\n  else\n    $as_echo \"$0: Please tell bug-autoconf@gnu.org about your system,\n$0: including any error possibly output before this\n$0: message. Then install a modern shell, or manually run\n$0: the script under such a shell if you do have one.\"\n  fi\n  exit 1\nfi\nfi\nfi\nSHELL=${CONFIG_SHELL-/bin/sh}\nexport SHELL\n# Unset more variables known to interfere with behavior of common tools.\nCLICOLOR_FORCE= GREP_OPTIONS=\nunset CLICOLOR_FORCE GREP_OPTIONS\n\n## --------------------- ##\n## M4sh Shell Functions. ##\n## --------------------- ##\n# as_fn_unset VAR\n# ---------------\n# Portably unset VAR.\nas_fn_unset ()\n{\n  { eval $1=; unset $1;}\n}\nas_unset=as_fn_unset\n\n# as_fn_set_status STATUS\n# -----------------------\n# Set $? to STATUS, without forking.\nas_fn_set_status ()\n{\n  return $1\n} # as_fn_set_status\n\n# as_fn_exit STATUS\n# -----------------\n# Exit the shell with STATUS, even in a \"trap 0\" or \"set -e\" context.\nas_fn_exit ()\n{\n  set +e\n  as_fn_set_status $1\n  exit $1\n} # as_fn_exit\n\n# as_fn_mkdir_p\n# -------------\n# Create \"$as_dir\" as a directory, including parents if necessary.\nas_fn_mkdir_p ()\n{\n\n  case $as_dir in #(\n  -*) as_dir=./$as_dir;;\n  esac\n  test -d \"$as_dir\" || eval $as_mkdir_p || {\n    as_dirs=\n    while :; do\n      case $as_dir in #(\n      *\\'*) as_qdir=`$as_echo \"$as_dir\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;; #'(\n      *) as_qdir=$as_dir;;\n      esac\n      as_dirs=\"'$as_qdir' $as_dirs\"\n      as_dir=`$as_dirname -- \"$as_dir\" ||\n$as_expr X\"$as_dir\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_dir\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X\"$as_dir\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n      test -d \"$as_dir\" && break\n    done\n    test -z \"$as_dirs\" || eval \"mkdir $as_dirs\"\n  } || test -d \"$as_dir\" || as_fn_error $? \"cannot create directory $as_dir\"\n\n\n} # as_fn_mkdir_p\n\n# as_fn_executable_p FILE\n# -----------------------\n# Test if FILE is an executable regular file.\nas_fn_executable_p ()\n{\n  test -f \"$1\" && test -x \"$1\"\n} # as_fn_executable_p\n# as_fn_append VAR VALUE\n# ----------------------\n# Append the text in VALUE to the end of the definition contained in VAR. Take\n# advantage of any shell optimizations that allow amortized linear growth over\n# repeated appends, instead of the typical quadratic growth present in naive\n# implementations.\nif (eval \"as_var=1; as_var+=2; test x\\$as_var = x12\") 2>/dev/null; then :\n  eval 'as_fn_append ()\n  {\n    eval $1+=\\$2\n  }'\nelse\n  as_fn_append ()\n  {\n    eval $1=\\$$1\\$2\n  }\nfi # as_fn_append\n\n# as_fn_arith ARG...\n# ------------------\n# Perform arithmetic evaluation on the ARGs, and store the result in the\n# global $as_val. Take advantage of shells that can avoid forks. The arguments\n# must be portable across $(()) and expr.\nif (eval \"test \\$(( 1 + 1 )) = 2\") 2>/dev/null; then :\n  eval 'as_fn_arith ()\n  {\n    as_val=$(( $* ))\n  }'\nelse\n  as_fn_arith ()\n  {\n    as_val=`expr \"$@\" || test $? -eq 1`\n  }\nfi # as_fn_arith\n\n\n# as_fn_error STATUS ERROR [LINENO LOG_FD]\n# ----------------------------------------\n# Output \"`basename $0`: error: ERROR\" to stderr. If LINENO and LOG_FD are\n# provided, also output the error to LOG_FD, referencing LINENO. Then exit the\n# script with STATUS, using 1 if that was 0.\nas_fn_error ()\n{\n  as_status=$1; test $as_status -eq 0 && as_status=1\n  if test \"$4\"; then\n    as_lineno=${as_lineno-\"$3\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n    $as_echo \"$as_me:${as_lineno-$LINENO}: error: $2\" >&$4\n  fi\n  $as_echo \"$as_me: error: $2\" >&2\n  as_fn_exit $as_status\n} # as_fn_error\n\nif expr a : '\\(a\\)' >/dev/null 2>&1 &&\n   test \"X`expr 00001 : '.*\\(...\\)'`\" = X001; then\n  as_expr=expr\nelse\n  as_expr=false\nfi\n\nif (basename -- /) >/dev/null 2>&1 && test \"X`basename -- / 2>&1`\" = \"X/\"; then\n  as_basename=basename\nelse\n  as_basename=false\nfi\n\nif (as_dir=`dirname -- /` && test \"X$as_dir\" = X/) >/dev/null 2>&1; then\n  as_dirname=dirname\nelse\n  as_dirname=false\nfi\n\nas_me=`$as_basename -- \"$0\" ||\n$as_expr X/\"$0\" : '.*/\\([^/][^/]*\\)/*$' \\| \\\n\t X\"$0\" : 'X\\(//\\)$' \\| \\\n\t X\"$0\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X/\"$0\" |\n    sed '/^.*\\/\\([^/][^/]*\\)\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n\n# Avoid depending upon Character Ranges.\nas_cr_letters='abcdefghijklmnopqrstuvwxyz'\nas_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'\nas_cr_Letters=$as_cr_letters$as_cr_LETTERS\nas_cr_digits='0123456789'\nas_cr_alnum=$as_cr_Letters$as_cr_digits\n\n\n  as_lineno_1=$LINENO as_lineno_1a=$LINENO\n  as_lineno_2=$LINENO as_lineno_2a=$LINENO\n  eval 'test \"x$as_lineno_1'$as_run'\" != \"x$as_lineno_2'$as_run'\" &&\n  test \"x`expr $as_lineno_1'$as_run' + 1`\" = \"x$as_lineno_2'$as_run'\"' || {\n  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)\n  sed -n '\n    p\n    /[$]LINENO/=\n  ' <$as_myself |\n    sed '\n      s/[$]LINENO.*/&-/\n      t lineno\n      b\n      :lineno\n      N\n      :loop\n      s/[$]LINENO\\([^'$as_cr_alnum'_].*\\n\\)\\(.*\\)/\\2\\1\\2/\n      t loop\n      s/-\\n.*//\n    ' >$as_me.lineno &&\n  chmod +x \"$as_me.lineno\" ||\n    { $as_echo \"$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell\" >&2; as_fn_exit 1; }\n\n  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have\n  # already done that, so ensure we don't try to do so again and fall\n  # in an infinite loop.  This has already happened in practice.\n  _as_can_reexec=no; export _as_can_reexec\n  # Don't try to exec as it changes $[0], causing all sort of problems\n  # (the dirname of $[0] is not the place where we might find the\n  # original and so on.  Autoconf is especially sensitive to this).\n  . \"./$as_me.lineno\"\n  # Exit status is that of the last command.\n  exit\n}\n\nECHO_C= ECHO_N= ECHO_T=\ncase `echo -n x` in #(((((\n-n*)\n  case `echo 'xy\\c'` in\n  *c*) ECHO_T='\t';;\t# ECHO_T is single tab character.\n  xy)  ECHO_C='\\c';;\n  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null\n       ECHO_T='\t';;\n  esac;;\n*)\n  ECHO_N='-n';;\nesac\n\nrm -f conf$$ conf$$.exe conf$$.file\nif test -d conf$$.dir; then\n  rm -f conf$$.dir/conf$$.file\nelse\n  rm -f conf$$.dir\n  mkdir conf$$.dir 2>/dev/null\nfi\nif (echo >conf$$.file) 2>/dev/null; then\n  if ln -s conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s='ln -s'\n    # ... but there are two gotchas:\n    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.\n    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.\n    # In both cases, we have to default to `cp -pR'.\n    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||\n      as_ln_s='cp -pR'\n  elif ln conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s=ln\n  else\n    as_ln_s='cp -pR'\n  fi\nelse\n  as_ln_s='cp -pR'\nfi\nrm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file\nrmdir conf$$.dir 2>/dev/null\n\nif mkdir -p . 2>/dev/null; then\n  as_mkdir_p='mkdir -p \"$as_dir\"'\nelse\n  test -d ./-p && rmdir ./-p\n  as_mkdir_p=false\nfi\n\nas_test_x='test -x'\nas_executable_p=as_fn_executable_p\n\n# Sed expression to map a string onto a valid CPP name.\nas_tr_cpp=\"eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'\"\n\n# Sed expression to map a string onto a valid variable name.\nas_tr_sh=\"eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'\"\n\nSHELL=${CONFIG_SHELL-/bin/sh}\n\n\ntest -n \"$DJDIR\" || exec 7<&0 </dev/null\nexec 6>&1\n\n# Name of the host.\n# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,\n# so uname gets run too.\nac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`\n\n#\n# Initializations.\n#\nac_default_prefix=/usr/local\nac_clean_files=\nac_config_libobj_dir=.\nLIBOBJS=\ncross_compiling=no\nsubdirs=\nMFLAGS=\nMAKEFLAGS=\n\n# Identity of this package.\nPACKAGE_NAME='libjpeg-turbo'\nPACKAGE_TARNAME='libjpeg-turbo'\nPACKAGE_VERSION='1.5.0'\nPACKAGE_STRING='libjpeg-turbo 1.5.0'\nPACKAGE_BUGREPORT=''\nPACKAGE_URL=''\n\nac_default_prefix=/opt/libjpeg-turbo\n# Factoring default headers for most tests.\nac_includes_default=\"\\\n#include <stdio.h>\n#ifdef HAVE_SYS_TYPES_H\n# include <sys/types.h>\n#endif\n#ifdef HAVE_SYS_STAT_H\n# include <sys/stat.h>\n#endif\n#ifdef STDC_HEADERS\n# include <stdlib.h>\n# include <stddef.h>\n#else\n# ifdef HAVE_STDLIB_H\n#  include <stdlib.h>\n# endif\n#endif\n#ifdef HAVE_STRING_H\n# if !defined STDC_HEADERS && defined HAVE_MEMORY_H\n#  include <memory.h>\n# endif\n# include <string.h>\n#endif\n#ifdef HAVE_STRINGS_H\n# include <strings.h>\n#endif\n#ifdef HAVE_INTTYPES_H\n# include <inttypes.h>\n#endif\n#ifdef HAVE_STDINT_H\n# include <stdint.h>\n#endif\n#ifdef HAVE_UNISTD_H\n# include <unistd.h>\n#endif\"\n\nac_subst_vars='am__EXEEXT_FALSE\nam__EXEEXT_TRUE\nLTLIBOBJS\nLIBOBJS\nBUILD\nDEBARCH\nRPM_CONFIG_ARGS\nRPMARCH\nPKGNAME\nCROSS_COMPILING_FALSE\nCROSS_COMPILING_TRUE\nWITH_TURBOJPEG_FALSE\nWITH_TURBOJPEG_TRUE\nX86_64_FALSE\nX86_64_TRUE\nSIMD_POWERPC_FALSE\nSIMD_POWERPC_TRUE\nSIMD_MIPS_FALSE\nSIMD_MIPS_TRUE\nSIMD_ARM_64_FALSE\nSIMD_ARM_64_TRUE\nSIMD_ARM_FALSE\nSIMD_ARM_TRUE\nSIMD_X86_64_FALSE\nSIMD_X86_64_TRUE\nSIMD_I386_FALSE\nSIMD_I386_TRUE\nWITH_SSE_FLOAT_DCT_FALSE\nWITH_SSE_FLOAT_DCT_TRUE\nWITH_SIMD_FALSE\nWITH_SIMD_TRUE\nNAFLAGS\nNASM\nJAVA_RPM_CONTENTS_2\nJAVA_RPM_CONTENTS_1\nWITH_JAVA\nWITH_JAVA_FALSE\nWITH_JAVA_TRUE\nJNI_CFLAGS\nJAVA\nJAR\nJAVACFLAGS\nJAVAC\nWITH_12BIT_FALSE\nWITH_12BIT_TRUE\nWITH_ARITH_FALSE\nWITH_ARITH_TRUE\nWITH_ARITH_DEC_FALSE\nWITH_ARITH_DEC_TRUE\nWITH_ARITH_ENC_FALSE\nWITH_ARITH_ENC_TRUE\nVERSION_SCRIPT_FLAG\nVERSION_SCRIPT_FALSE\nVERSION_SCRIPT_TRUE\nMEM_SRCDST_FUNCTIONS\nSO_AGE\nLIBTOOL_CURRENT\nSO_MINOR_VERSION\nSO_MAJOR_VERSION\nJPEG_LIB_VERSION_DECIMAL\nJPEG_LIB_VERSION\nPKG_CONFIG\nLT_SYS_LIBRARY_PATH\nOTOOL64\nOTOOL\nLIPO\nNMEDIT\nDSYMUTIL\nMANIFEST_TOOL\nRANLIB\nDLLTOOL\nOBJDUMP\nLN_S\nNM\nac_ct_DUMPBIN\nDUMPBIN\nLD\nFGREP\nEGREP\nGREP\nSED\nhost_os\nhost_vendor\nhost_cpu\nhost\nbuild_os\nbuild_vendor\nbuild_cpu\nbuild\nLIBTOOL\nam__fastdepCCAS_FALSE\nam__fastdepCCAS_TRUE\nCCASDEPMODE\nCCASFLAGS\nCCAS\nac_ct_AR\nAR\nCPP\nam__fastdepCC_FALSE\nam__fastdepCC_TRUE\nCCDEPMODE\nam__nodep\nAMDEPBACKSLASH\nAMDEP_FALSE\nAMDEP_TRUE\nam__quote\nam__include\nDEPDIR\nOBJEXT\nEXEEXT\nac_ct_CC\nCPPFLAGS\nLDFLAGS\nCFLAGS\nCC\nAM_BACKSLASH\nAM_DEFAULT_VERBOSITY\nAM_DEFAULT_V\nAM_V\nam__untar\nam__tar\nAMTAR\nam__leading_dot\nSET_MAKE\nAWK\nmkdir_p\nMKDIR_P\nINSTALL_STRIP_PROGRAM\nSTRIP\ninstall_sh\nMAKEINFO\nAUTOHEADER\nAUTOMAKE\nAUTOCONF\nACLOCAL\nVERSION\nPACKAGE\nCYGPATH_W\nam__isrc\nINSTALL_DATA\nINSTALL_SCRIPT\nINSTALL_PROGRAM\ntarget_alias\nhost_alias\nbuild_alias\nLIBS\nECHO_T\nECHO_N\nECHO_C\nDEFS\nmandir\nlocaledir\nlibdir\npsdir\npdfdir\ndvidir\nhtmldir\ninfodir\ndocdir\noldincludedir\nincludedir\nlocalstatedir\nsharedstatedir\nsysconfdir\ndatadir\ndatarootdir\nlibexecdir\nsbindir\nbindir\nprogram_transform_name\nprefix\nexec_prefix\nPACKAGE_URL\nPACKAGE_BUGREPORT\nPACKAGE_STRING\nPACKAGE_VERSION\nPACKAGE_TARNAME\nPACKAGE_NAME\nPATH_SEPARATOR\nSHELL'\nac_subst_files=''\nac_user_opts='\nenable_option_checking\nenable_silent_rules\nenable_dependency_tracking\nenable_shared\nenable_static\nwith_pic\nenable_fast_install\nwith_aix_soname\nwith_gnu_ld\nwith_sysroot\nenable_libtool_lock\nwith_build_date\nwith_jpeg7\nwith_jpeg8\nwith_mem_srcdst\nenable_ld_version_script\nwith_arith_enc\nwith_arith_dec\nwith_12bit\nwith_turbojpeg\nwith_java\nwith_gas_preprocessor\nwith_simd\n'\n      ac_precious_vars='build_alias\nhost_alias\ntarget_alias\nCC\nCFLAGS\nLDFLAGS\nLIBS\nCPPFLAGS\nCPP\nCCAS\nCCASFLAGS\nLT_SYS_LIBRARY_PATH\nPKG_CONFIG\nJPEG_LIB_VERSION\nSO_MAJOR_VERSION\nSO_MINOR_VERSION\nJAVAC\nJAVACFLAGS\nJAR\nJAVA\nJNI_CFLAGS\nNASM\nPKGNAME'\n\n\n# Initialize some variables set by options.\nac_init_help=\nac_init_version=false\nac_unrecognized_opts=\nac_unrecognized_sep=\n# The variables have the same names as the options, with\n# dashes changed to underlines.\ncache_file=/dev/null\nexec_prefix=NONE\nno_create=\nno_recursion=\nprefix=NONE\nprogram_prefix=NONE\nprogram_suffix=NONE\nprogram_transform_name=s,x,x,\nsilent=\nsite=\nsrcdir=\nverbose=\nx_includes=NONE\nx_libraries=NONE\n\n# Installation directory options.\n# These are left unexpanded so users can \"make install exec_prefix=/foo\"\n# and all the variables that are supposed to be based on exec_prefix\n# by default will actually change.\n# Use braces instead of parens because sh, perl, etc. also accept them.\n# (The list follows the same order as the GNU Coding Standards.)\nbindir='${exec_prefix}/bin'\nsbindir='${exec_prefix}/sbin'\nlibexecdir='${exec_prefix}/libexec'\ndatarootdir='${prefix}/share'\ndatadir='${datarootdir}'\nsysconfdir='${prefix}/etc'\nsharedstatedir='${prefix}/com'\nlocalstatedir='${prefix}/var'\nincludedir='${prefix}/include'\noldincludedir='/usr/include'\ndocdir='${datarootdir}/doc/${PACKAGE_TARNAME}'\ninfodir='${datarootdir}/info'\nhtmldir='${docdir}'\ndvidir='${docdir}'\npdfdir='${docdir}'\npsdir='${docdir}'\nlibdir='${exec_prefix}/lib'\nlocaledir='${datarootdir}/locale'\nmandir='${datarootdir}/man'\n\nac_prev=\nac_dashdash=\nfor ac_option\ndo\n  # If the previous option needs an argument, assign it.\n  if test -n \"$ac_prev\"; then\n    eval $ac_prev=\\$ac_option\n    ac_prev=\n    continue\n  fi\n\n  case $ac_option in\n  *=?*) ac_optarg=`expr \"X$ac_option\" : '[^=]*=\\(.*\\)'` ;;\n  *=)   ac_optarg= ;;\n  *)    ac_optarg=yes ;;\n  esac\n\n  # Accept the important Cygnus configure options, so we can diagnose typos.\n\n  case $ac_dashdash$ac_option in\n  --)\n    ac_dashdash=yes ;;\n\n  -bindir | --bindir | --bindi | --bind | --bin | --bi)\n    ac_prev=bindir ;;\n  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)\n    bindir=$ac_optarg ;;\n\n  -build | --build | --buil | --bui | --bu)\n    ac_prev=build_alias ;;\n  -build=* | --build=* | --buil=* | --bui=* | --bu=*)\n    build_alias=$ac_optarg ;;\n\n  -cache-file | --cache-file | --cache-fil | --cache-fi \\\n  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)\n    ac_prev=cache_file ;;\n  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \\\n  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)\n    cache_file=$ac_optarg ;;\n\n  --config-cache | -C)\n    cache_file=config.cache ;;\n\n  -datadir | --datadir | --datadi | --datad)\n    ac_prev=datadir ;;\n  -datadir=* | --datadir=* | --datadi=* | --datad=*)\n    datadir=$ac_optarg ;;\n\n  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \\\n  | --dataroo | --dataro | --datar)\n    ac_prev=datarootdir ;;\n  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \\\n  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)\n    datarootdir=$ac_optarg ;;\n\n  -disable-* | --disable-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*disable-\\(.*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid feature name: $ac_useropt\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`$as_echo \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"enable_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval enable_$ac_useropt=no ;;\n\n  -docdir | --docdir | --docdi | --doc | --do)\n    ac_prev=docdir ;;\n  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)\n    docdir=$ac_optarg ;;\n\n  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)\n    ac_prev=dvidir ;;\n  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)\n    dvidir=$ac_optarg ;;\n\n  -enable-* | --enable-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*enable-\\([^=]*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid feature name: $ac_useropt\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`$as_echo \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"enable_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval enable_$ac_useropt=\\$ac_optarg ;;\n\n  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \\\n  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \\\n  | --exec | --exe | --ex)\n    ac_prev=exec_prefix ;;\n  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \\\n  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \\\n  | --exec=* | --exe=* | --ex=*)\n    exec_prefix=$ac_optarg ;;\n\n  -gas | --gas | --ga | --g)\n    # Obsolete; use --with-gas.\n    with_gas=yes ;;\n\n  -help | --help | --hel | --he | -h)\n    ac_init_help=long ;;\n  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)\n    ac_init_help=recursive ;;\n  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)\n    ac_init_help=short ;;\n\n  -host | --host | --hos | --ho)\n    ac_prev=host_alias ;;\n  -host=* | --host=* | --hos=* | --ho=*)\n    host_alias=$ac_optarg ;;\n\n  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)\n    ac_prev=htmldir ;;\n  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \\\n  | --ht=*)\n    htmldir=$ac_optarg ;;\n\n  -includedir | --includedir | --includedi | --included | --include \\\n  | --includ | --inclu | --incl | --inc)\n    ac_prev=includedir ;;\n  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \\\n  | --includ=* | --inclu=* | --incl=* | --inc=*)\n    includedir=$ac_optarg ;;\n\n  -infodir | --infodir | --infodi | --infod | --info | --inf)\n    ac_prev=infodir ;;\n  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)\n    infodir=$ac_optarg ;;\n\n  -libdir | --libdir | --libdi | --libd)\n    ac_prev=libdir ;;\n  -libdir=* | --libdir=* | --libdi=* | --libd=*)\n    libdir=$ac_optarg ;;\n\n  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \\\n  | --libexe | --libex | --libe)\n    ac_prev=libexecdir ;;\n  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \\\n  | --libexe=* | --libex=* | --libe=*)\n    libexecdir=$ac_optarg ;;\n\n  -localedir | --localedir | --localedi | --localed | --locale)\n    ac_prev=localedir ;;\n  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)\n    localedir=$ac_optarg ;;\n\n  -localstatedir | --localstatedir | --localstatedi | --localstated \\\n  | --localstate | --localstat | --localsta | --localst | --locals)\n    ac_prev=localstatedir ;;\n  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \\\n  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)\n    localstatedir=$ac_optarg ;;\n\n  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)\n    ac_prev=mandir ;;\n  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)\n    mandir=$ac_optarg ;;\n\n  -nfp | --nfp | --nf)\n    # Obsolete; use --without-fp.\n    with_fp=no ;;\n\n  -no-create | --no-create | --no-creat | --no-crea | --no-cre \\\n  | --no-cr | --no-c | -n)\n    no_create=yes ;;\n\n  -no-recursion | --no-recursion | --no-recursio | --no-recursi \\\n  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)\n    no_recursion=yes ;;\n\n  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \\\n  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \\\n  | --oldin | --oldi | --old | --ol | --o)\n    ac_prev=oldincludedir ;;\n  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \\\n  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \\\n  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)\n    oldincludedir=$ac_optarg ;;\n\n  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)\n    ac_prev=prefix ;;\n  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)\n    prefix=$ac_optarg ;;\n\n  -program-prefix | --program-prefix | --program-prefi | --program-pref \\\n  | --program-pre | --program-pr | --program-p)\n    ac_prev=program_prefix ;;\n  -program-prefix=* | --program-prefix=* | --program-prefi=* \\\n  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)\n    program_prefix=$ac_optarg ;;\n\n  -program-suffix | --program-suffix | --program-suffi | --program-suff \\\n  | --program-suf | --program-su | --program-s)\n    ac_prev=program_suffix ;;\n  -program-suffix=* | --program-suffix=* | --program-suffi=* \\\n  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)\n    program_suffix=$ac_optarg ;;\n\n  -program-transform-name | --program-transform-name \\\n  | --program-transform-nam | --program-transform-na \\\n  | --program-transform-n | --program-transform- \\\n  | --program-transform | --program-transfor \\\n  | --program-transfo | --program-transf \\\n  | --program-trans | --program-tran \\\n  | --progr-tra | --program-tr | --program-t)\n    ac_prev=program_transform_name ;;\n  -program-transform-name=* | --program-transform-name=* \\\n  | --program-transform-nam=* | --program-transform-na=* \\\n  | --program-transform-n=* | --program-transform-=* \\\n  | --program-transform=* | --program-transfor=* \\\n  | --program-transfo=* | --program-transf=* \\\n  | --program-trans=* | --program-tran=* \\\n  | --progr-tra=* | --program-tr=* | --program-t=*)\n    program_transform_name=$ac_optarg ;;\n\n  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)\n    ac_prev=pdfdir ;;\n  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)\n    pdfdir=$ac_optarg ;;\n\n  -psdir | --psdir | --psdi | --psd | --ps)\n    ac_prev=psdir ;;\n  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)\n    psdir=$ac_optarg ;;\n\n  -q | -quiet | --quiet | --quie | --qui | --qu | --q \\\n  | -silent | --silent | --silen | --sile | --sil)\n    silent=yes ;;\n\n  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)\n    ac_prev=sbindir ;;\n  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \\\n  | --sbi=* | --sb=*)\n    sbindir=$ac_optarg ;;\n\n  -sharedstatedir | --sharedstatedir | --sharedstatedi \\\n  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \\\n  | --sharedst | --shareds | --shared | --share | --shar \\\n  | --sha | --sh)\n    ac_prev=sharedstatedir ;;\n  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \\\n  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \\\n  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \\\n  | --sha=* | --sh=*)\n    sharedstatedir=$ac_optarg ;;\n\n  -site | --site | --sit)\n    ac_prev=site ;;\n  -site=* | --site=* | --sit=*)\n    site=$ac_optarg ;;\n\n  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)\n    ac_prev=srcdir ;;\n  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)\n    srcdir=$ac_optarg ;;\n\n  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \\\n  | --syscon | --sysco | --sysc | --sys | --sy)\n    ac_prev=sysconfdir ;;\n  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \\\n  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)\n    sysconfdir=$ac_optarg ;;\n\n  -target | --target | --targe | --targ | --tar | --ta | --t)\n    ac_prev=target_alias ;;\n  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)\n    target_alias=$ac_optarg ;;\n\n  -v | -verbose | --verbose | --verbos | --verbo | --verb)\n    verbose=yes ;;\n\n  -version | --version | --versio | --versi | --vers | -V)\n    ac_init_version=: ;;\n\n  -with-* | --with-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*with-\\([^=]*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid package name: $ac_useropt\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`$as_echo \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"with_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval with_$ac_useropt=\\$ac_optarg ;;\n\n  -without-* | --without-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*without-\\(.*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid package name: $ac_useropt\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`$as_echo \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"with_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval with_$ac_useropt=no ;;\n\n  --x)\n    # Obsolete; use --with-x.\n    with_x=yes ;;\n\n  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \\\n  | --x-incl | --x-inc | --x-in | --x-i)\n    ac_prev=x_includes ;;\n  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \\\n  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)\n    x_includes=$ac_optarg ;;\n\n  -x-libraries | --x-libraries | --x-librarie | --x-librari \\\n  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)\n    ac_prev=x_libraries ;;\n  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \\\n  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)\n    x_libraries=$ac_optarg ;;\n\n  -*) as_fn_error $? \"unrecognized option: \\`$ac_option'\nTry \\`$0 --help' for more information\"\n    ;;\n\n  *=*)\n    ac_envvar=`expr \"x$ac_option\" : 'x\\([^=]*\\)='`\n    # Reject names that are not valid shell variable names.\n    case $ac_envvar in #(\n      '' | [0-9]* | *[!_$as_cr_alnum]* )\n      as_fn_error $? \"invalid variable name: \\`$ac_envvar'\" ;;\n    esac\n    eval $ac_envvar=\\$ac_optarg\n    export $ac_envvar ;;\n\n  *)\n    # FIXME: should be removed in autoconf 3.0.\n    $as_echo \"$as_me: WARNING: you should use --build, --host, --target\" >&2\n    expr \"x$ac_option\" : \".*[^-._$as_cr_alnum]\" >/dev/null &&\n      $as_echo \"$as_me: WARNING: invalid host type: $ac_option\" >&2\n    : \"${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}\"\n    ;;\n\n  esac\ndone\n\nif test -n \"$ac_prev\"; then\n  ac_option=--`echo $ac_prev | sed 's/_/-/g'`\n  as_fn_error $? \"missing argument to $ac_option\"\nfi\n\nif test -n \"$ac_unrecognized_opts\"; then\n  case $enable_option_checking in\n    no) ;;\n    fatal) as_fn_error $? \"unrecognized options: $ac_unrecognized_opts\" ;;\n    *)     $as_echo \"$as_me: WARNING: unrecognized options: $ac_unrecognized_opts\" >&2 ;;\n  esac\nfi\n\n# Check all directory arguments for consistency.\nfor ac_var in\texec_prefix prefix bindir sbindir libexecdir datarootdir \\\n\t\tdatadir sysconfdir sharedstatedir localstatedir includedir \\\n\t\toldincludedir docdir infodir htmldir dvidir pdfdir psdir \\\n\t\tlibdir localedir mandir\ndo\n  eval ac_val=\\$$ac_var\n  # Remove trailing slashes.\n  case $ac_val in\n    */ )\n      ac_val=`expr \"X$ac_val\" : 'X\\(.*[^/]\\)' \\| \"X$ac_val\" : 'X\\(.*\\)'`\n      eval $ac_var=\\$ac_val;;\n  esac\n  # Be sure to have absolute directory names.\n  case $ac_val in\n    [\\\\/$]* | ?:[\\\\/]* )  continue;;\n    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;\n  esac\n  as_fn_error $? \"expected an absolute directory name for --$ac_var: $ac_val\"\ndone\n\n# There might be people who depend on the old broken behavior: `$host'\n# used to hold the argument of --host etc.\n# FIXME: To remove some day.\nbuild=$build_alias\nhost=$host_alias\ntarget=$target_alias\n\n# FIXME: To remove some day.\nif test \"x$host_alias\" != x; then\n  if test \"x$build_alias\" = x; then\n    cross_compiling=maybe\n  elif test \"x$build_alias\" != \"x$host_alias\"; then\n    cross_compiling=yes\n  fi\nfi\n\nac_tool_prefix=\ntest -n \"$host_alias\" && ac_tool_prefix=$host_alias-\n\ntest \"$silent\" = yes && exec 6>/dev/null\n\n\nac_pwd=`pwd` && test -n \"$ac_pwd\" &&\nac_ls_di=`ls -di .` &&\nac_pwd_ls_di=`cd \"$ac_pwd\" && ls -di .` ||\n  as_fn_error $? \"working directory cannot be determined\"\ntest \"X$ac_ls_di\" = \"X$ac_pwd_ls_di\" ||\n  as_fn_error $? \"pwd does not report name of working directory\"\n\n\n# Find the source files, if location was not specified.\nif test -z \"$srcdir\"; then\n  ac_srcdir_defaulted=yes\n  # Try the directory containing this script, then the parent directory.\n  ac_confdir=`$as_dirname -- \"$as_myself\" ||\n$as_expr X\"$as_myself\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_myself\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_myself\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_myself\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X\"$as_myself\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n  srcdir=$ac_confdir\n  if test ! -r \"$srcdir/$ac_unique_file\"; then\n    srcdir=..\n  fi\nelse\n  ac_srcdir_defaulted=no\nfi\nif test ! -r \"$srcdir/$ac_unique_file\"; then\n  test \"$ac_srcdir_defaulted\" = yes && srcdir=\"$ac_confdir or ..\"\n  as_fn_error $? \"cannot find sources ($ac_unique_file) in $srcdir\"\nfi\nac_msg=\"sources are in $srcdir, but \\`cd $srcdir' does not work\"\nac_abs_confdir=`(\n\tcd \"$srcdir\" && test -r \"./$ac_unique_file\" || as_fn_error $? \"$ac_msg\"\n\tpwd)`\n# When building in place, set srcdir=.\nif test \"$ac_abs_confdir\" = \"$ac_pwd\"; then\n  srcdir=.\nfi\n# Remove unnecessary trailing slashes from srcdir.\n# Double slashes in file names in object file debugging info\n# mess up M-x gdb in Emacs.\ncase $srcdir in\n*/) srcdir=`expr \"X$srcdir\" : 'X\\(.*[^/]\\)' \\| \"X$srcdir\" : 'X\\(.*\\)'`;;\nesac\nfor ac_var in $ac_precious_vars; do\n  eval ac_env_${ac_var}_set=\\${${ac_var}+set}\n  eval ac_env_${ac_var}_value=\\$${ac_var}\n  eval ac_cv_env_${ac_var}_set=\\${${ac_var}+set}\n  eval ac_cv_env_${ac_var}_value=\\$${ac_var}\ndone\n\n#\n# Report the --help message.\n#\nif test \"$ac_init_help\" = \"long\"; then\n  # Omit some internal or obsolete options to make the list less imposing.\n  # This message is too long to be a string in the A/UX 3.1 sh.\n  cat <<_ACEOF\n\\`configure' configures libjpeg-turbo 1.5.0 to adapt to many kinds of systems.\n\nUsage: $0 [OPTION]... [VAR=VALUE]...\n\nTo assign environment variables (e.g., CC, CFLAGS...), specify them as\nVAR=VALUE.  See below for descriptions of some of the useful variables.\n\nDefaults for the options are specified in brackets.\n\nConfiguration:\n  -h, --help              display this help and exit\n      --help=short        display options specific to this package\n      --help=recursive    display the short help of all the included packages\n  -V, --version           display version information and exit\n  -q, --quiet, --silent   do not print \\`checking ...' messages\n      --cache-file=FILE   cache test results in FILE [disabled]\n  -C, --config-cache      alias for \\`--cache-file=config.cache'\n  -n, --no-create         do not create output files\n      --srcdir=DIR        find the sources in DIR [configure dir or \\`..']\n\nInstallation directories:\n  --prefix=PREFIX         install architecture-independent files in PREFIX\n                          [$ac_default_prefix]\n  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX\n                          [PREFIX]\n\nBy default, \\`make install' will install all the files in\n\\`$ac_default_prefix/bin', \\`$ac_default_prefix/lib' etc.  You can specify\nan installation prefix other than \\`$ac_default_prefix' using \\`--prefix',\nfor instance \\`--prefix=\\$HOME'.\n\nFor better control, use the options below.\n\nFine tuning of the installation directories:\n  --bindir=DIR            user executables [EPREFIX/bin]\n  --sbindir=DIR           system admin executables [EPREFIX/sbin]\n  --libexecdir=DIR        program executables [EPREFIX/libexec]\n  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]\n  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]\n  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]\n  --libdir=DIR            object code libraries [EPREFIX/lib]\n  --includedir=DIR        C header files [PREFIX/include]\n  --oldincludedir=DIR     C header files for non-gcc [/usr/include]\n  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]\n  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]\n  --infodir=DIR           info documentation [DATAROOTDIR/info]\n  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]\n  --mandir=DIR            man documentation [DATAROOTDIR/man]\n  --docdir=DIR            documentation root [DATAROOTDIR/doc/libjpeg-turbo]\n  --htmldir=DIR           html documentation [DOCDIR]\n  --dvidir=DIR            dvi documentation [DOCDIR]\n  --pdfdir=DIR            pdf documentation [DOCDIR]\n  --psdir=DIR             ps documentation [DOCDIR]\n_ACEOF\n\n  cat <<\\_ACEOF\n\nProgram names:\n  --program-prefix=PREFIX            prepend PREFIX to installed program names\n  --program-suffix=SUFFIX            append SUFFIX to installed program names\n  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names\n\nSystem types:\n  --build=BUILD     configure for building on BUILD [guessed]\n  --host=HOST       cross-compile to build programs to run on HOST [BUILD]\n_ACEOF\nfi\n\nif test -n \"$ac_init_help\"; then\n  case $ac_init_help in\n     short | recursive ) echo \"Configuration of libjpeg-turbo 1.5.0:\";;\n   esac\n  cat <<\\_ACEOF\n\nOptional Features:\n  --disable-option-checking  ignore unrecognized --enable/--with options\n  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)\n  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]\n  --enable-silent-rules   less verbose build output (undo: \"make V=1\")\n  --disable-silent-rules  verbose build output (undo: \"make V=0\")\n  --enable-dependency-tracking\n                          do not reject slow dependency extractors\n  --disable-dependency-tracking\n                          speeds up one-time build\n  --enable-shared[=PKGS]  build shared libraries [default=yes]\n  --enable-static[=PKGS]  build static libraries [default=yes]\n  --enable-fast-install[=PKGS]\n                          optimize for fast installation [default=yes]\n  --disable-libtool-lock  avoid locking (might break parallel builds)\n  --disable-ld-version-script\n                          Disable linker version script for libjpeg-turbo\n                          (default is to use linker version script if the\n                          linker supports it)\n\nOptional Packages:\n  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]\n  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)\n  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use\n                          both]\n  --with-aix-soname=aix|svr4|both\n                          shared library versioning (aka \"SONAME\") variant to\n                          provide on AIX, [default=aix].\n  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]\n  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the\n                          compiler's sysroot if not specified).\nUse custom build string to enable reproducible builds (default: YYMMDD)\n  --with-jpeg7            Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo\n                          backward incompatible with libjpeg v6b.)\n  --with-jpeg8            Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo\n                          backward incompatible with libjpeg v6b.)\n  --without-mem-srcdst    Do not include in-memory source/destination manager\n                          functions when emulating the libjpeg v6b or v7\n                          API/ABI\n  --without-arith-enc     Do not include arithmetic encoding support when\n                          emulating the libjpeg v6b API/ABI\n  --without-arith-dec     Do not include arithmetic decoding support when\n                          emulating the libjpeg v6b API/ABI\n  --with-12bit            Encode/decode JPEG images with 12-bit samples\n                          (implies --without-simd --without-turbojpeg\n                          --without-arith-dec --without-arith-enc)\n  --without-turbojpeg     Do not include the TurboJPEG wrapper library and\n                          associated test programs\n  --with-java             Build Java wrapper for the TurboJPEG library\n  --with-gas-preprocessor Force using gas-preprocessor.pl on ARM.\n  --without-simd          Do not include SIMD extensions\n\nSome influential environment variables:\n  CC          C compiler command\n  CFLAGS      C compiler flags\n  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a\n              nonstandard directory <lib dir>\n  LIBS        libraries to pass to the linker, e.g. -l<library>\n  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if\n              you have headers in a nonstandard directory <include dir>\n  CPP         C preprocessor\n  CCAS        assembler compiler command (defaults to CC)\n  CCASFLAGS   assembler compiler flags (defaults to CFLAGS)\n  LT_SYS_LIBRARY_PATH\n              User-defined run-time library search path.\n  PKG_CONFIG  path to pkg-config utility\n  JPEG_LIB_VERSION\n              libjpeg API version (62, 70, or 80)\n  SO_MAJOR_VERSION\n              Major version of the libjpeg-turbo shared library (default is\n              determined by the API version)\n  SO_MINOR_VERSION\n              Minor version of the libjpeg-turbo shared library (default is\n              determined by the API version)\n  JAVAC       Java compiler command (default: javac)\n  JAVACFLAGS  Java compiler flags\n  JAR         Java archive command (default: jar)\n  JAVA        Java runtime command (default: java)\n  JNI_CFLAGS  C compiler flags needed to include jni.h (default:\n              -I/System/Library/Frameworks/JavaVM.framework/Headers on OS X,\n              '-I/usr/java/include -I/usr/java/include/solaris' on Solaris,\n              and '-I/usr/java/default/include\n              -I/usr/java/default/include/linux' on Linux)\n  NASM        NASM command (used to build the x86/x86-64 SIMD code)\n  PKGNAME     distribution package name (default: libjpeg-turbo)\n\nUse these variables to override the choices made by `configure' or to help\nit to find libraries and programs with nonstandard names/locations.\n\nReport bugs to the package provider.\n_ACEOF\nac_status=$?\nfi\n\nif test \"$ac_init_help\" = \"recursive\"; then\n  # If there are subdirs, report their specific --help.\n  for ac_dir in : $ac_subdirs_all; do test \"x$ac_dir\" = x: && continue\n    test -d \"$ac_dir\" ||\n      { cd \"$srcdir\" && ac_pwd=`pwd` && srcdir=. && test -d \"$ac_dir\"; } ||\n      continue\n    ac_builddir=.\n\ncase \"$ac_dir\" in\n.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;\n*)\n  ac_dir_suffix=/`$as_echo \"$ac_dir\" | sed 's|^\\.[\\\\/]||'`\n  # A \"..\" for each directory in $ac_dir_suffix.\n  ac_top_builddir_sub=`$as_echo \"$ac_dir_suffix\" | sed 's|/[^\\\\/]*|/..|g;s|/||'`\n  case $ac_top_builddir_sub in\n  \"\") ac_top_builddir_sub=. ac_top_build_prefix= ;;\n  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;\n  esac ;;\nesac\nac_abs_top_builddir=$ac_pwd\nac_abs_builddir=$ac_pwd$ac_dir_suffix\n# for backward compatibility:\nac_top_builddir=$ac_top_build_prefix\n\ncase $srcdir in\n  .)  # We are building in place.\n    ac_srcdir=.\n    ac_top_srcdir=$ac_top_builddir_sub\n    ac_abs_top_srcdir=$ac_pwd ;;\n  [\\\\/]* | ?:[\\\\/]* )  # Absolute name.\n    ac_srcdir=$srcdir$ac_dir_suffix;\n    ac_top_srcdir=$srcdir\n    ac_abs_top_srcdir=$srcdir ;;\n  *) # Relative name.\n    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix\n    ac_top_srcdir=$ac_top_build_prefix$srcdir\n    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;\nesac\nac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix\n\n    cd \"$ac_dir\" || { ac_status=$?; continue; }\n    # Check for guested configure.\n    if test -f \"$ac_srcdir/configure.gnu\"; then\n      echo &&\n      $SHELL \"$ac_srcdir/configure.gnu\" --help=recursive\n    elif test -f \"$ac_srcdir/configure\"; then\n      echo &&\n      $SHELL \"$ac_srcdir/configure\" --help=recursive\n    else\n      $as_echo \"$as_me: WARNING: no configuration information is in $ac_dir\" >&2\n    fi || ac_status=$?\n    cd \"$ac_pwd\" || { ac_status=$?; break; }\n  done\nfi\n\ntest -n \"$ac_init_help\" && exit $ac_status\nif $ac_init_version; then\n  cat <<\\_ACEOF\nlibjpeg-turbo configure 1.5.0\ngenerated by GNU Autoconf 2.69\n\nCopyright (C) 2012 Free Software Foundation, Inc.\nThis configure script is free software; the Free Software Foundation\ngives unlimited permission to copy, distribute and modify it.\n_ACEOF\n  exit\nfi\n\n## ------------------------ ##\n## Autoconf initialization. ##\n## ------------------------ ##\n\n# ac_fn_c_try_compile LINENO\n# --------------------------\n# Try to compile conftest.$ac_ext, and return whether this succeeded.\nac_fn_c_try_compile ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  rm -f conftest.$ac_objext\n  if { { ac_try=\"$ac_compile\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_compile\") 2>conftest.err\n  ac_status=$?\n  if test -s conftest.err; then\n    grep -v '^ *+' conftest.err >conftest.er1\n    cat conftest.er1 >&5\n    mv -f conftest.er1 conftest.err\n  fi\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && {\n\t test -z \"$ac_c_werror_flag\" ||\n\t test ! -s conftest.err\n       } && test -s conftest.$ac_objext; then :\n  ac_retval=0\nelse\n  $as_echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n\tac_retval=1\nfi\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n  as_fn_set_status $ac_retval\n\n} # ac_fn_c_try_compile\n\n# ac_fn_c_try_cpp LINENO\n# ----------------------\n# Try to preprocess conftest.$ac_ext, and return whether this succeeded.\nac_fn_c_try_cpp ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  if { { ac_try=\"$ac_cpp conftest.$ac_ext\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_cpp conftest.$ac_ext\") 2>conftest.err\n  ac_status=$?\n  if test -s conftest.err; then\n    grep -v '^ *+' conftest.err >conftest.er1\n    cat conftest.er1 >&5\n    mv -f conftest.er1 conftest.err\n  fi\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } > conftest.i && {\n\t test -z \"$ac_c_preproc_warn_flag$ac_c_werror_flag\" ||\n\t test ! -s conftest.err\n       }; then :\n  ac_retval=0\nelse\n  $as_echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n    ac_retval=1\nfi\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n  as_fn_set_status $ac_retval\n\n} # ac_fn_c_try_cpp\n\n# ac_fn_c_try_link LINENO\n# -----------------------\n# Try to link conftest.$ac_ext, and return whether this succeeded.\nac_fn_c_try_link ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  rm -f conftest.$ac_objext conftest$ac_exeext\n  if { { ac_try=\"$ac_link\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link\") 2>conftest.err\n  ac_status=$?\n  if test -s conftest.err; then\n    grep -v '^ *+' conftest.err >conftest.er1\n    cat conftest.er1 >&5\n    mv -f conftest.er1 conftest.err\n  fi\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && {\n\t test -z \"$ac_c_werror_flag\" ||\n\t test ! -s conftest.err\n       } && test -s conftest$ac_exeext && {\n\t test \"$cross_compiling\" = yes ||\n\t test -x conftest$ac_exeext\n       }; then :\n  ac_retval=0\nelse\n  $as_echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n\tac_retval=1\nfi\n  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information\n  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would\n  # interfere with the next link command; also delete a directory that is\n  # left behind by Apple's compiler.  We do this before executing the actions.\n  rm -rf conftest.dSYM conftest_ipa8_conftest.oo\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n  as_fn_set_status $ac_retval\n\n} # ac_fn_c_try_link\n\n# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES\n# -------------------------------------------------------\n# Tests whether HEADER exists and can be compiled using the include files in\n# INCLUDES, setting the cache variable VAR accordingly.\nac_fn_c_check_header_compile ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $2\" >&5\n$as_echo_n \"checking for $2... \" >&6; }\nif eval \\${$3+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\n#include <$2>\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  eval \"$3=yes\"\nelse\n  eval \"$3=no\"\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\neval ac_res=\\$$3\n\t       { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_res\" >&5\n$as_echo \"$ac_res\" >&6; }\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n\n} # ac_fn_c_check_header_compile\n\n# ac_fn_c_try_run LINENO\n# ----------------------\n# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes\n# that executables *can* be run.\nac_fn_c_try_run ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  if { { ac_try=\"$ac_link\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'\n  { { case \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_try\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; }; then :\n  ac_retval=0\nelse\n  $as_echo \"$as_me: program exited with status $ac_status\" >&5\n       $as_echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n       ac_retval=$ac_status\nfi\n  rm -rf conftest.dSYM conftest_ipa8_conftest.oo\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n  as_fn_set_status $ac_retval\n\n} # ac_fn_c_try_run\n\n# ac_fn_c_check_func LINENO FUNC VAR\n# ----------------------------------\n# Tests whether FUNC exists, setting the cache variable VAR accordingly\nac_fn_c_check_func ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $2\" >&5\n$as_echo_n \"checking for $2... \" >&6; }\nif eval \\${$3+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n/* Define $2 to an innocuous variant, in case <limits.h> declares $2.\n   For example, HP-UX 11i <limits.h> declares gettimeofday.  */\n#define $2 innocuous_$2\n\n/* System header to define __stub macros and hopefully few prototypes,\n    which can conflict with char $2 (); below.\n    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n    <limits.h> exists even on freestanding compilers.  */\n\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\n#undef $2\n\n/* Override any GCC internal prototype to avoid an error.\n   Use char because int might match the return type of a GCC\n   builtin and then its argument prototype would still apply.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar $2 ();\n/* The GNU C library defines this for functions which it implements\n    to always fail with ENOSYS.  Some functions are actually named\n    something starting with __ and the normal name is an alias.  */\n#if defined __stub_$2 || defined __stub___$2\nchoke me\n#endif\n\nint\nmain ()\n{\nreturn $2 ();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  eval \"$3=yes\"\nelse\n  eval \"$3=no\"\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nfi\neval ac_res=\\$$3\n\t       { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_res\" >&5\n$as_echo \"$ac_res\" >&6; }\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n\n} # ac_fn_c_check_func\n\n# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES\n# --------------------------------------------\n# Tries to find the compile-time value of EXPR in a program that includes\n# INCLUDES, setting VAR accordingly. Returns whether the value could be\n# computed\nac_fn_c_compute_int ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  if test \"$cross_compiling\" = yes; then\n    # Depending upon the size, compute the lo and hi bounds.\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nint\nmain ()\n{\nstatic int test_array [1 - 2 * !(($2) >= 0)];\ntest_array [0] = 0;\nreturn test_array [0];\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_lo=0 ac_mid=0\n  while :; do\n    cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nint\nmain ()\n{\nstatic int test_array [1 - 2 * !(($2) <= $ac_mid)];\ntest_array [0] = 0;\nreturn test_array [0];\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_hi=$ac_mid; break\nelse\n  as_fn_arith $ac_mid + 1 && ac_lo=$as_val\n\t\t\tif test $ac_lo -le $ac_mid; then\n\t\t\t  ac_lo= ac_hi=\n\t\t\t  break\n\t\t\tfi\n\t\t\tas_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n  done\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nint\nmain ()\n{\nstatic int test_array [1 - 2 * !(($2) < 0)];\ntest_array [0] = 0;\nreturn test_array [0];\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_hi=-1 ac_mid=-1\n  while :; do\n    cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nint\nmain ()\n{\nstatic int test_array [1 - 2 * !(($2) >= $ac_mid)];\ntest_array [0] = 0;\nreturn test_array [0];\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_lo=$ac_mid; break\nelse\n  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val\n\t\t\tif test $ac_mid -le $ac_hi; then\n\t\t\t  ac_lo= ac_hi=\n\t\t\t  break\n\t\t\tfi\n\t\t\tas_fn_arith 2 '*' $ac_mid && ac_mid=$as_val\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n  done\nelse\n  ac_lo= ac_hi=\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n# Binary search between lo and hi bounds.\nwhile test \"x$ac_lo\" != \"x$ac_hi\"; do\n  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nint\nmain ()\n{\nstatic int test_array [1 - 2 * !(($2) <= $ac_mid)];\ntest_array [0] = 0;\nreturn test_array [0];\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_hi=$ac_mid\nelse\n  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\ndone\ncase $ac_lo in #((\n?*) eval \"$3=\\$ac_lo\"; ac_retval=0 ;;\n'') ac_retval=1 ;;\nesac\n  else\n    cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nstatic long int longval () { return $2; }\nstatic unsigned long int ulongval () { return $2; }\n#include <stdio.h>\n#include <stdlib.h>\nint\nmain ()\n{\n\n  FILE *f = fopen (\"conftest.val\", \"w\");\n  if (! f)\n    return 1;\n  if (($2) < 0)\n    {\n      long int i = longval ();\n      if (i != ($2))\n\treturn 1;\n      fprintf (f, \"%ld\", i);\n    }\n  else\n    {\n      unsigned long int i = ulongval ();\n      if (i != ($2))\n\treturn 1;\n      fprintf (f, \"%lu\", i);\n    }\n  /* Do not output a trailing newline, as this causes \\r\\n confusion\n     on some platforms.  */\n  return ferror (f) || fclose (f) != 0;\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_run \"$LINENO\"; then :\n  echo >>conftest.val; read $3 <conftest.val; ac_retval=0\nelse\n  ac_retval=1\nfi\nrm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \\\n  conftest.$ac_objext conftest.beam conftest.$ac_ext\nrm -f conftest.val\n\n  fi\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n  as_fn_set_status $ac_retval\n\n} # ac_fn_c_compute_int\n\n# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES\n# ---------------------------------------------\n# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR\n# accordingly.\nac_fn_c_check_decl ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  as_decl_name=`echo $2|sed 's/ *(.*//'`\n  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared\" >&5\n$as_echo_n \"checking whether $as_decl_name is declared... \" >&6; }\nif eval \\${$3+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nint\nmain ()\n{\n#ifndef $as_decl_name\n#ifdef __cplusplus\n  (void) $as_decl_use;\n#else\n  (void) $as_decl_name;\n#endif\n#endif\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  eval \"$3=yes\"\nelse\n  eval \"$3=no\"\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\neval ac_res=\\$$3\n\t       { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_res\" >&5\n$as_echo \"$ac_res\" >&6; }\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n\n} # ac_fn_c_check_decl\n\n# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES\n# -------------------------------------------------------\n# Tests whether HEADER exists, giving a warning if it cannot be compiled using\n# the include files in INCLUDES and setting the cache variable VAR\n# accordingly.\nac_fn_c_check_header_mongrel ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  if eval \\${$3+:} false; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $2\" >&5\n$as_echo_n \"checking for $2... \" >&6; }\nif eval \\${$3+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nfi\neval ac_res=\\$$3\n\t       { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_res\" >&5\n$as_echo \"$ac_res\" >&6; }\nelse\n  # Is the header compilable?\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking $2 usability\" >&5\n$as_echo_n \"checking $2 usability... \" >&6; }\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\n#include <$2>\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_header_compiler=yes\nelse\n  ac_header_compiler=no\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler\" >&5\n$as_echo \"$ac_header_compiler\" >&6; }\n\n# Is the header present?\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking $2 presence\" >&5\n$as_echo_n \"checking $2 presence... \" >&6; }\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <$2>\n_ACEOF\nif ac_fn_c_try_cpp \"$LINENO\"; then :\n  ac_header_preproc=yes\nelse\n  ac_header_preproc=no\nfi\nrm -f conftest.err conftest.i conftest.$ac_ext\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc\" >&5\n$as_echo \"$ac_header_preproc\" >&6; }\n\n# So?  What about this header?\ncase $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((\n  yes:no: )\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!\" >&5\n$as_echo \"$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!\" >&2;}\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result\" >&5\n$as_echo \"$as_me: WARNING: $2: proceeding with the compiler's result\" >&2;}\n    ;;\n  no:yes:* )\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled\" >&5\n$as_echo \"$as_me: WARNING: $2: present but cannot be compiled\" >&2;}\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?\" >&5\n$as_echo \"$as_me: WARNING: $2:     check for missing prerequisite headers?\" >&2;}\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation\" >&5\n$as_echo \"$as_me: WARNING: $2: see the Autoconf documentation\" >&2;}\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \\\"Present But Cannot Be Compiled\\\"\" >&5\n$as_echo \"$as_me: WARNING: $2:     section \\\"Present But Cannot Be Compiled\\\"\" >&2;}\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result\" >&5\n$as_echo \"$as_me: WARNING: $2: proceeding with the compiler's result\" >&2;}\n    ;;\nesac\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $2\" >&5\n$as_echo_n \"checking for $2... \" >&6; }\nif eval \\${$3+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  eval \"$3=\\$ac_header_compiler\"\nfi\neval ac_res=\\$$3\n\t       { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_res\" >&5\n$as_echo \"$ac_res\" >&6; }\nfi\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n\n} # ac_fn_c_check_header_mongrel\n\n# ac_fn_c_check_type LINENO TYPE VAR INCLUDES\n# -------------------------------------------\n# Tests whether TYPE exists after having included INCLUDES, setting cache\n# variable VAR accordingly.\nac_fn_c_check_type ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $2\" >&5\n$as_echo_n \"checking for $2... \" >&6; }\nif eval \\${$3+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  eval \"$3=no\"\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nint\nmain ()\n{\nif (sizeof ($2))\n\t return 0;\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nint\nmain ()\n{\nif (sizeof (($2)))\n\t    return 0;\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n\nelse\n  eval \"$3=yes\"\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\neval ac_res=\\$$3\n\t       { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_res\" >&5\n$as_echo \"$ac_res\" >&6; }\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n\n} # ac_fn_c_check_type\ncat >config.log <<_ACEOF\nThis file contains any messages produced by compilers while\nrunning configure, to aid debugging if configure makes a mistake.\n\nIt was created by libjpeg-turbo $as_me 1.5.0, which was\ngenerated by GNU Autoconf 2.69.  Invocation command line was\n\n  $ $0 $@\n\n_ACEOF\nexec 5>>config.log\n{\ncat <<_ASUNAME\n## --------- ##\n## Platform. ##\n## --------- ##\n\nhostname = `(hostname || uname -n) 2>/dev/null | sed 1q`\nuname -m = `(uname -m) 2>/dev/null || echo unknown`\nuname -r = `(uname -r) 2>/dev/null || echo unknown`\nuname -s = `(uname -s) 2>/dev/null || echo unknown`\nuname -v = `(uname -v) 2>/dev/null || echo unknown`\n\n/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`\n/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`\n\n/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`\n/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`\n/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`\n/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`\n/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`\n/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`\n/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`\n\n_ASUNAME\n\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    $as_echo \"PATH: $as_dir\"\n  done\nIFS=$as_save_IFS\n\n} >&5\n\ncat >&5 <<_ACEOF\n\n\n## ----------- ##\n## Core tests. ##\n## ----------- ##\n\n_ACEOF\n\n\n# Keep a trace of the command line.\n# Strip out --no-create and --no-recursion so they do not pile up.\n# Strip out --silent because we don't want to record it for future runs.\n# Also quote any args containing shell meta-characters.\n# Make two passes to allow for proper duplicate-argument suppression.\nac_configure_args=\nac_configure_args0=\nac_configure_args1=\nac_must_keep_next=false\nfor ac_pass in 1 2\ndo\n  for ac_arg\n  do\n    case $ac_arg in\n    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;\n    -q | -quiet | --quiet | --quie | --qui | --qu | --q \\\n    | -silent | --silent | --silen | --sile | --sil)\n      continue ;;\n    *\\'*)\n      ac_arg=`$as_echo \"$ac_arg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    esac\n    case $ac_pass in\n    1) as_fn_append ac_configure_args0 \" '$ac_arg'\" ;;\n    2)\n      as_fn_append ac_configure_args1 \" '$ac_arg'\"\n      if test $ac_must_keep_next = true; then\n\tac_must_keep_next=false # Got value, back to normal.\n      else\n\tcase $ac_arg in\n\t  *=* | --config-cache | -C | -disable-* | --disable-* \\\n\t  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \\\n\t  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \\\n\t  | -with-* | --with-* | -without-* | --without-* | --x)\n\t    case \"$ac_configure_args0 \" in\n\t      \"$ac_configure_args1\"*\" '$ac_arg' \"* ) continue ;;\n\t    esac\n\t    ;;\n\t  -* ) ac_must_keep_next=true ;;\n\tesac\n      fi\n      as_fn_append ac_configure_args \" '$ac_arg'\"\n      ;;\n    esac\n  done\ndone\n{ ac_configure_args0=; unset ac_configure_args0;}\n{ ac_configure_args1=; unset ac_configure_args1;}\n\n# When interrupted or exit'd, cleanup temporary files, and complete\n# config.log.  We remove comments because anyway the quotes in there\n# would cause problems or look ugly.\n# WARNING: Use '\\'' to represent an apostrophe within the trap.\n# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.\ntrap 'exit_status=$?\n  # Save into config.log some information that might help in debugging.\n  {\n    echo\n\n    $as_echo \"## ---------------- ##\n## Cache variables. ##\n## ---------------- ##\"\n    echo\n    # The following way of writing the cache mishandles newlines in values,\n(\n  for ac_var in `(set) 2>&1 | sed -n '\\''s/^\\([a-zA-Z_][a-zA-Z0-9_]*\\)=.*/\\1/p'\\''`; do\n    eval ac_val=\\$$ac_var\n    case $ac_val in #(\n    *${as_nl}*)\n      case $ac_var in #(\n      *_cv_*) { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline\" >&5\n$as_echo \"$as_me: WARNING: cache variable $ac_var contains a newline\" >&2;} ;;\n      esac\n      case $ac_var in #(\n      _ | IFS | as_nl) ;; #(\n      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(\n      *) { eval $ac_var=; unset $ac_var;} ;;\n      esac ;;\n    esac\n  done\n  (set) 2>&1 |\n    case $as_nl`(ac_space='\\'' '\\''; set) 2>&1` in #(\n    *${as_nl}ac_space=\\ *)\n      sed -n \\\n\t\"s/'\\''/'\\''\\\\\\\\'\\'''\\''/g;\n\t  s/^\\\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\\\)=\\\\(.*\\\\)/\\\\1='\\''\\\\2'\\''/p\"\n      ;; #(\n    *)\n      sed -n \"/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p\"\n      ;;\n    esac |\n    sort\n)\n    echo\n\n    $as_echo \"## ----------------- ##\n## Output variables. ##\n## ----------------- ##\"\n    echo\n    for ac_var in $ac_subst_vars\n    do\n      eval ac_val=\\$$ac_var\n      case $ac_val in\n      *\\'\\''*) ac_val=`$as_echo \"$ac_val\" | sed \"s/'\\''/'\\''\\\\\\\\\\\\\\\\'\\'''\\''/g\"`;;\n      esac\n      $as_echo \"$ac_var='\\''$ac_val'\\''\"\n    done | sort\n    echo\n\n    if test -n \"$ac_subst_files\"; then\n      $as_echo \"## ------------------- ##\n## File substitutions. ##\n## ------------------- ##\"\n      echo\n      for ac_var in $ac_subst_files\n      do\n\teval ac_val=\\$$ac_var\n\tcase $ac_val in\n\t*\\'\\''*) ac_val=`$as_echo \"$ac_val\" | sed \"s/'\\''/'\\''\\\\\\\\\\\\\\\\'\\'''\\''/g\"`;;\n\tesac\n\t$as_echo \"$ac_var='\\''$ac_val'\\''\"\n      done | sort\n      echo\n    fi\n\n    if test -s confdefs.h; then\n      $as_echo \"## ----------- ##\n## confdefs.h. ##\n## ----------- ##\"\n      echo\n      cat confdefs.h\n      echo\n    fi\n    test \"$ac_signal\" != 0 &&\n      $as_echo \"$as_me: caught signal $ac_signal\"\n    $as_echo \"$as_me: exit $exit_status\"\n  } >&5\n  rm -f core *.core core.conftest.* &&\n    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&\n    exit $exit_status\n' 0\nfor ac_signal in 1 2 13 15; do\n  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal\ndone\nac_signal=0\n\n# confdefs.h avoids OS command line length limits that DEFS can exceed.\nrm -f -r conftest* confdefs.h\n\n$as_echo \"/* confdefs.h */\" > confdefs.h\n\n# Predefined preprocessor variables.\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_NAME \"$PACKAGE_NAME\"\n_ACEOF\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"\n_ACEOF\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_VERSION \"$PACKAGE_VERSION\"\n_ACEOF\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_STRING \"$PACKAGE_STRING\"\n_ACEOF\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"\n_ACEOF\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_URL \"$PACKAGE_URL\"\n_ACEOF\n\n\n# Let the site file select an alternate cache file if it wants to.\n# Prefer an explicitly selected file to automatically selected ones.\nac_site_file1=NONE\nac_site_file2=NONE\nif test -n \"$CONFIG_SITE\"; then\n  # We do not want a PATH search for config.site.\n  case $CONFIG_SITE in #((\n    -*)  ac_site_file1=./$CONFIG_SITE;;\n    */*) ac_site_file1=$CONFIG_SITE;;\n    *)   ac_site_file1=./$CONFIG_SITE;;\n  esac\nelif test \"x$prefix\" != xNONE; then\n  ac_site_file1=$prefix/share/config.site\n  ac_site_file2=$prefix/etc/config.site\nelse\n  ac_site_file1=$ac_default_prefix/share/config.site\n  ac_site_file2=$ac_default_prefix/etc/config.site\nfi\nfor ac_site_file in \"$ac_site_file1\" \"$ac_site_file2\"\ndo\n  test \"x$ac_site_file\" = xNONE && continue\n  if test /dev/null != \"$ac_site_file\" && test -r \"$ac_site_file\"; then\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file\" >&5\n$as_echo \"$as_me: loading site script $ac_site_file\" >&6;}\n    sed 's/^/| /' \"$ac_site_file\" >&5\n    . \"$ac_site_file\" \\\n      || { { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"failed to load site script $ac_site_file\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\n  fi\ndone\n\nif test -r \"$cache_file\"; then\n  # Some versions of bash will fail to source /dev/null (special files\n  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.\n  if test /dev/null != \"$cache_file\" && test -f \"$cache_file\"; then\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: loading cache $cache_file\" >&5\n$as_echo \"$as_me: loading cache $cache_file\" >&6;}\n    case $cache_file in\n      [\\\\/]* | ?:[\\\\/]* ) . \"$cache_file\";;\n      *)                      . \"./$cache_file\";;\n    esac\n  fi\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: creating cache $cache_file\" >&5\n$as_echo \"$as_me: creating cache $cache_file\" >&6;}\n  >$cache_file\nfi\n\n# Check that the precious variables saved in the cache have kept the same\n# value.\nac_cache_corrupted=false\nfor ac_var in $ac_precious_vars; do\n  eval ac_old_set=\\$ac_cv_env_${ac_var}_set\n  eval ac_new_set=\\$ac_env_${ac_var}_set\n  eval ac_old_val=\\$ac_cv_env_${ac_var}_value\n  eval ac_new_val=\\$ac_env_${ac_var}_value\n  case $ac_old_set,$ac_new_set in\n    set,)\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: error: \\`$ac_var' was set to \\`$ac_old_val' in the previous run\" >&5\n$as_echo \"$as_me: error: \\`$ac_var' was set to \\`$ac_old_val' in the previous run\" >&2;}\n      ac_cache_corrupted=: ;;\n    ,set)\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: error: \\`$ac_var' was not set in the previous run\" >&5\n$as_echo \"$as_me: error: \\`$ac_var' was not set in the previous run\" >&2;}\n      ac_cache_corrupted=: ;;\n    ,);;\n    *)\n      if test \"x$ac_old_val\" != \"x$ac_new_val\"; then\n\t# differences in whitespace do not lead to failure.\n\tac_old_val_w=`echo x $ac_old_val`\n\tac_new_val_w=`echo x $ac_new_val`\n\tif test \"$ac_old_val_w\" != \"$ac_new_val_w\"; then\n\t  { $as_echo \"$as_me:${as_lineno-$LINENO}: error: \\`$ac_var' has changed since the previous run:\" >&5\n$as_echo \"$as_me: error: \\`$ac_var' has changed since the previous run:\" >&2;}\n\t  ac_cache_corrupted=:\n\telse\n\t  { $as_echo \"$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \\`$ac_var' since the previous run:\" >&5\n$as_echo \"$as_me: warning: ignoring whitespace changes in \\`$ac_var' since the previous run:\" >&2;}\n\t  eval $ac_var=\\$ac_old_val\n\tfi\n\t{ $as_echo \"$as_me:${as_lineno-$LINENO}:   former value:  \\`$ac_old_val'\" >&5\n$as_echo \"$as_me:   former value:  \\`$ac_old_val'\" >&2;}\n\t{ $as_echo \"$as_me:${as_lineno-$LINENO}:   current value: \\`$ac_new_val'\" >&5\n$as_echo \"$as_me:   current value: \\`$ac_new_val'\" >&2;}\n      fi;;\n  esac\n  # Pass precious variables to config.status.\n  if test \"$ac_new_set\" = set; then\n    case $ac_new_val in\n    *\\'*) ac_arg=$ac_var=`$as_echo \"$ac_new_val\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    *) ac_arg=$ac_var=$ac_new_val ;;\n    esac\n    case \" $ac_configure_args \" in\n      *\" '$ac_arg' \"*) ;; # Avoid dups.  Use of quotes ensures accuracy.\n      *) as_fn_append ac_configure_args \" '$ac_arg'\" ;;\n    esac\n  fi\ndone\nif $ac_cache_corrupted; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build\" >&5\n$as_echo \"$as_me: error: changes in the environment can compromise the build\" >&2;}\n  as_fn_error $? \"run \\`make distclean' and/or \\`rm $cache_file' and start over\" \"$LINENO\" 5\nfi\n## -------------------- ##\n## Main body of script. ##\n## -------------------- ##\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n\n\nam__api_version='1.15'\n\nac_aux_dir=\nfor ac_dir in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"; do\n  if test -f \"$ac_dir/install-sh\"; then\n    ac_aux_dir=$ac_dir\n    ac_install_sh=\"$ac_aux_dir/install-sh -c\"\n    break\n  elif test -f \"$ac_dir/install.sh\"; then\n    ac_aux_dir=$ac_dir\n    ac_install_sh=\"$ac_aux_dir/install.sh -c\"\n    break\n  elif test -f \"$ac_dir/shtool\"; then\n    ac_aux_dir=$ac_dir\n    ac_install_sh=\"$ac_aux_dir/shtool install -c\"\n    break\n  fi\ndone\nif test -z \"$ac_aux_dir\"; then\n  as_fn_error $? \"cannot find install-sh, install.sh, or shtool in \\\"$srcdir\\\" \\\"$srcdir/..\\\" \\\"$srcdir/../..\\\"\" \"$LINENO\" 5\nfi\n\n# These three variables are undocumented and unsupported,\n# and are intended to be withdrawn in a future Autoconf release.\n# They can cause serious problems if a builder's source tree is in a directory\n# whose full name contains unusual characters.\nac_config_guess=\"$SHELL $ac_aux_dir/config.guess\"  # Please don't use this var.\nac_config_sub=\"$SHELL $ac_aux_dir/config.sub\"  # Please don't use this var.\nac_configure=\"$SHELL $ac_aux_dir/configure\"  # Please don't use this var.\n\n\n# Find a good install program.  We prefer a C program (faster),\n# so one script is as good as another.  But avoid the broken or\n# incompatible versions:\n# SysV /etc/install, /usr/sbin/install\n# SunOS /usr/etc/install\n# IRIX /sbin/install\n# AIX /bin/install\n# AmigaOS /C/install, which installs bootblocks on floppy discs\n# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag\n# AFS /usr/afsws/bin/install, which mishandles nonexistent args\n# SVR4 /usr/ucb/install, which tries to use the nonexistent group \"staff\"\n# OS/2's system install, which has a completely different semantic\n# ./install, which can be erroneously created by make from ./install.sh.\n# Reject install programs that cannot install multiple files.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install\" >&5\n$as_echo_n \"checking for a BSD-compatible install... \" >&6; }\nif test -z \"$INSTALL\"; then\nif ${ac_cv_path_install+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    # Account for people who put trailing slashes in PATH elements.\ncase $as_dir/ in #((\n  ./ | .// | /[cC]/* | \\\n  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \\\n  ?:[\\\\/]os2[\\\\/]install[\\\\/]* | ?:[\\\\/]OS2[\\\\/]INSTALL[\\\\/]* | \\\n  /usr/ucb/* ) ;;\n  *)\n    # OSF1 and SCO ODT 3.0 have their own names for install.\n    # Don't use installbsd from OSF since it installs stuff as root\n    # by default.\n    for ac_prog in ginstall scoinst install; do\n      for ac_exec_ext in '' $ac_executable_extensions; do\n\tif as_fn_executable_p \"$as_dir/$ac_prog$ac_exec_ext\"; then\n\t  if test $ac_prog = install &&\n\t    grep dspmsg \"$as_dir/$ac_prog$ac_exec_ext\" >/dev/null 2>&1; then\n\t    # AIX install.  It has an incompatible calling convention.\n\t    :\n\t  elif test $ac_prog = install &&\n\t    grep pwplus \"$as_dir/$ac_prog$ac_exec_ext\" >/dev/null 2>&1; then\n\t    # program-specific install script used by HP pwplus--don't use.\n\t    :\n\t  else\n\t    rm -rf conftest.one conftest.two conftest.dir\n\t    echo one > conftest.one\n\t    echo two > conftest.two\n\t    mkdir conftest.dir\n\t    if \"$as_dir/$ac_prog$ac_exec_ext\" -c conftest.one conftest.two \"`pwd`/conftest.dir\" &&\n\t      test -s conftest.one && test -s conftest.two &&\n\t      test -s conftest.dir/conftest.one &&\n\t      test -s conftest.dir/conftest.two\n\t    then\n\t      ac_cv_path_install=\"$as_dir/$ac_prog$ac_exec_ext -c\"\n\t      break 3\n\t    fi\n\t  fi\n\tfi\n      done\n    done\n    ;;\nesac\n\n  done\nIFS=$as_save_IFS\n\nrm -rf conftest.one conftest.two conftest.dir\n\nfi\n  if test \"${ac_cv_path_install+set}\" = set; then\n    INSTALL=$ac_cv_path_install\n  else\n    # As a last resort, use the slow shell script.  Don't cache a\n    # value for INSTALL within a source directory, because that will\n    # break other packages using the cache if that directory is\n    # removed, or if the value is a relative name.\n    INSTALL=$ac_install_sh\n  fi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $INSTALL\" >&5\n$as_echo \"$INSTALL\" >&6; }\n\n# Use test -z because SunOS4 sh mishandles braces in ${var-val}.\n# It thinks the first close brace ends the variable substitution.\ntest -z \"$INSTALL_PROGRAM\" && INSTALL_PROGRAM='${INSTALL}'\n\ntest -z \"$INSTALL_SCRIPT\" && INSTALL_SCRIPT='${INSTALL}'\n\ntest -z \"$INSTALL_DATA\" && INSTALL_DATA='${INSTALL} -m 644'\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether build environment is sane\" >&5\n$as_echo_n \"checking whether build environment is sane... \" >&6; }\n# Reject unsafe characters in $srcdir or the absolute working directory\n# name.  Accept space and tab only in the latter.\nam_lf='\n'\ncase `pwd` in\n  *[\\\\\\\"\\#\\$\\&\\'\\`$am_lf]*)\n    as_fn_error $? \"unsafe absolute working directory name\" \"$LINENO\" 5;;\nesac\ncase $srcdir in\n  *[\\\\\\\"\\#\\$\\&\\'\\`$am_lf\\ \\\t]*)\n    as_fn_error $? \"unsafe srcdir value: '$srcdir'\" \"$LINENO\" 5;;\nesac\n\n# Do 'set' in a subshell so we don't clobber the current shell's\n# arguments.  Must try -L first in case configure is actually a\n# symlink; some systems play weird games with the mod time of symlinks\n# (eg FreeBSD returns the mod time of the symlink's containing\n# directory).\nif (\n   am_has_slept=no\n   for am_try in 1 2; do\n     echo \"timestamp, slept: $am_has_slept\" > conftest.file\n     set X `ls -Lt \"$srcdir/configure\" conftest.file 2> /dev/null`\n     if test \"$*\" = \"X\"; then\n\t# -L didn't work.\n\tset X `ls -t \"$srcdir/configure\" conftest.file`\n     fi\n     if test \"$*\" != \"X $srcdir/configure conftest.file\" \\\n\t&& test \"$*\" != \"X conftest.file $srcdir/configure\"; then\n\n\t# If neither matched, then we have a broken ls.  This can happen\n\t# if, for instance, CONFIG_SHELL is bash and it inherits a\n\t# broken ls alias from the environment.  This has actually\n\t# happened.  Such a system could not be considered \"sane\".\n\tas_fn_error $? \"ls -t appears to fail.  Make sure there is not a broken\n  alias in your environment\" \"$LINENO\" 5\n     fi\n     if test \"$2\" = conftest.file || test $am_try -eq 2; then\n       break\n     fi\n     # Just in case.\n     sleep 1\n     am_has_slept=yes\n   done\n   test \"$2\" = conftest.file\n   )\nthen\n   # Ok.\n   :\nelse\n   as_fn_error $? \"newly created file is older than distributed files!\nCheck your system clock\" \"$LINENO\" 5\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n# If we didn't sleep, we still need to ensure time stamps of config.status and\n# generated files are strictly newer.\nam_sleep_pid=\nif grep 'slept: no' conftest.file >/dev/null 2>&1; then\n  ( sleep 1 ) &\n  am_sleep_pid=$!\nfi\n\nrm -f conftest.file\n\ntest \"$program_prefix\" != NONE &&\n  program_transform_name=\"s&^&$program_prefix&;$program_transform_name\"\n# Use a double $ so make ignores it.\ntest \"$program_suffix\" != NONE &&\n  program_transform_name=\"s&\\$&$program_suffix&;$program_transform_name\"\n# Double any \\ or $.\n# By default was `s,x,x', remove it if useless.\nac_script='s/[\\\\$]/&&/g;s/;s,x,x,$//'\nprogram_transform_name=`$as_echo \"$program_transform_name\" | sed \"$ac_script\"`\n\n# Expand $ac_aux_dir to an absolute path.\nam_aux_dir=`cd \"$ac_aux_dir\" && pwd`\n\nif test x\"${MISSING+set}\" != xset; then\n  case $am_aux_dir in\n  *\\ * | *\\\t*)\n    MISSING=\"\\${SHELL} \\\"$am_aux_dir/missing\\\"\" ;;\n  *)\n    MISSING=\"\\${SHELL} $am_aux_dir/missing\" ;;\n  esac\nfi\n# Use eval to expand $SHELL\nif eval \"$MISSING --is-lightweight\"; then\n  am_missing_run=\"$MISSING \"\nelse\n  am_missing_run=\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing\" >&5\n$as_echo \"$as_me: WARNING: 'missing' script is too old or missing\" >&2;}\nfi\n\nif test x\"${install_sh+set}\" != xset; then\n  case $am_aux_dir in\n  *\\ * | *\\\t*)\n    install_sh=\"\\${SHELL} '$am_aux_dir/install-sh'\" ;;\n  *)\n    install_sh=\"\\${SHELL} $am_aux_dir/install-sh\"\n  esac\nfi\n\n# Installed binaries are usually stripped using 'strip' when the user\n# run \"make install-strip\".  However 'strip' might not be the right\n# tool to use in cross-compilation environments, therefore Automake\n# will honor the 'STRIP' environment variable to overrule this program.\nif test \"$cross_compiling\" != no; then\n  if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}strip\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}strip; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_STRIP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$STRIP\"; then\n  ac_cv_prog_STRIP=\"$STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_STRIP=\"${ac_tool_prefix}strip\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nSTRIP=$ac_cv_prog_STRIP\nif test -n \"$STRIP\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $STRIP\" >&5\n$as_echo \"$STRIP\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_STRIP\"; then\n  ac_ct_STRIP=$STRIP\n  # Extract the first word of \"strip\", so it can be a program name with args.\nset dummy strip; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_STRIP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_STRIP\"; then\n  ac_cv_prog_ac_ct_STRIP=\"$ac_ct_STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_STRIP=\"strip\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP\nif test -n \"$ac_ct_STRIP\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP\" >&5\n$as_echo \"$ac_ct_STRIP\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_STRIP\" = x; then\n    STRIP=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    STRIP=$ac_ct_STRIP\n  fi\nelse\n  STRIP=\"$ac_cv_prog_STRIP\"\nfi\n\nfi\nINSTALL_STRIP_PROGRAM=\"\\$(install_sh) -c -s\"\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p\" >&5\n$as_echo_n \"checking for a thread-safe mkdir -p... \" >&6; }\nif test -z \"$MKDIR_P\"; then\n  if ${ac_cv_path_mkdir+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_prog in mkdir gmkdir; do\n\t for ac_exec_ext in '' $ac_executable_extensions; do\n\t   as_fn_executable_p \"$as_dir/$ac_prog$ac_exec_ext\" || continue\n\t   case `\"$as_dir/$ac_prog$ac_exec_ext\" --version 2>&1` in #(\n\t     'mkdir (GNU coreutils) '* | \\\n\t     'mkdir (coreutils) '* | \\\n\t     'mkdir (fileutils) '4.1*)\n\t       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext\n\t       break 3;;\n\t   esac\n\t done\n       done\n  done\nIFS=$as_save_IFS\n\nfi\n\n  test -d ./--version && rmdir ./--version\n  if test \"${ac_cv_path_mkdir+set}\" = set; then\n    MKDIR_P=\"$ac_cv_path_mkdir -p\"\n  else\n    # As a last resort, use the slow shell script.  Don't cache a\n    # value for MKDIR_P within a source directory, because that will\n    # break other packages using the cache if that directory is\n    # removed, or if the value is a relative name.\n    MKDIR_P=\"$ac_install_sh -d\"\n  fi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $MKDIR_P\" >&5\n$as_echo \"$MKDIR_P\" >&6; }\n\nfor ac_prog in gawk mawk nawk awk\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_AWK+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$AWK\"; then\n  ac_cv_prog_AWK=\"$AWK\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_AWK=\"$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nAWK=$ac_cv_prog_AWK\nif test -n \"$AWK\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $AWK\" >&5\n$as_echo \"$AWK\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  test -n \"$AWK\" && break\ndone\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \\$(MAKE)\" >&5\n$as_echo_n \"checking whether ${MAKE-make} sets \\$(MAKE)... \" >&6; }\nset x ${MAKE-make}\nac_make=`$as_echo \"$2\" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`\nif eval \\${ac_cv_prog_make_${ac_make}_set+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat >conftest.make <<\\_ACEOF\nSHELL = /bin/sh\nall:\n\t@echo '@@@%%%=$(MAKE)=@@@%%%'\n_ACEOF\n# GNU make sometimes prints \"make[1]: Entering ...\", which would confuse us.\ncase `${MAKE-make} -f conftest.make 2>/dev/null` in\n  *@@@%%%=?*=@@@%%%*)\n    eval ac_cv_prog_make_${ac_make}_set=yes;;\n  *)\n    eval ac_cv_prog_make_${ac_make}_set=no;;\nesac\nrm -f conftest.make\nfi\nif eval test \\$ac_cv_prog_make_${ac_make}_set = yes; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n  SET_MAKE=\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n  SET_MAKE=\"MAKE=${MAKE-make}\"\nfi\n\nrm -rf .tst 2>/dev/null\nmkdir .tst 2>/dev/null\nif test -d .tst; then\n  am__leading_dot=.\nelse\n  am__leading_dot=_\nfi\nrmdir .tst 2>/dev/null\n\n# Check whether --enable-silent-rules was given.\nif test \"${enable_silent_rules+set}\" = set; then :\n  enableval=$enable_silent_rules;\nfi\n\ncase $enable_silent_rules in # (((\n  yes) AM_DEFAULT_VERBOSITY=0;;\n   no) AM_DEFAULT_VERBOSITY=1;;\n    *) AM_DEFAULT_VERBOSITY=1;;\nesac\nam_make=${MAKE-make}\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables\" >&5\n$as_echo_n \"checking whether $am_make supports nested variables... \" >&6; }\nif ${am_cv_make_support_nested_variables+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if $as_echo 'TRUE=$(BAR$(V))\nBAR0=false\nBAR1=true\nV=1\nam__doit:\n\t@$(TRUE)\n.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then\n  am_cv_make_support_nested_variables=yes\nelse\n  am_cv_make_support_nested_variables=no\nfi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables\" >&5\n$as_echo \"$am_cv_make_support_nested_variables\" >&6; }\nif test $am_cv_make_support_nested_variables = yes; then\n    AM_V='$(V)'\n  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'\nelse\n  AM_V=$AM_DEFAULT_VERBOSITY\n  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY\nfi\nAM_BACKSLASH='\\'\n\nif test \"`cd $srcdir && pwd`\" != \"`pwd`\"; then\n  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output\n  # is not polluted with repeated \"-I.\"\n  am__isrc=' -I$(srcdir)'\n  # test to see if srcdir already configured\n  if test -f $srcdir/config.status; then\n    as_fn_error $? \"source directory already configured; run \\\"make distclean\\\" there first\" \"$LINENO\" 5\n  fi\nfi\n\n# test whether we have cygpath\nif test -z \"$CYGPATH_W\"; then\n  if (cygpath --version) >/dev/null 2>/dev/null; then\n    CYGPATH_W='cygpath -w'\n  else\n    CYGPATH_W=echo\n  fi\nfi\n\n\n# Define the identity of the package.\n PACKAGE='libjpeg-turbo'\n VERSION='1.5.0'\n\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE \"$PACKAGE\"\n_ACEOF\n\n\ncat >>confdefs.h <<_ACEOF\n#define VERSION \"$VERSION\"\n_ACEOF\n\n# Some tools Automake needs.\n\nACLOCAL=${ACLOCAL-\"${am_missing_run}aclocal-${am__api_version}\"}\n\n\nAUTOCONF=${AUTOCONF-\"${am_missing_run}autoconf\"}\n\n\nAUTOMAKE=${AUTOMAKE-\"${am_missing_run}automake-${am__api_version}\"}\n\n\nAUTOHEADER=${AUTOHEADER-\"${am_missing_run}autoheader\"}\n\n\nMAKEINFO=${MAKEINFO-\"${am_missing_run}makeinfo\"}\n\n# For better backward compatibility.  To be removed once Automake 1.9.x\n# dies out for good.  For more background, see:\n# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>\n# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>\nmkdir_p='$(MKDIR_P)'\n\n# We need awk for the \"check\" target (and possibly the TAP driver).  The\n# system \"awk\" is bad on some platforms.\n# Always define AMTAR for backward compatibility.  Yes, it's still used\n# in the wild :-(  We should find a proper way to deprecate it ...\nAMTAR='$${TAR-tar}'\n\n\n# We'll loop over all known methods to create a tar archive until one works.\n_am_tools='gnutar  pax cpio none'\n\nam__tar='$${TAR-tar} chof - \"$$tardir\"' am__untar='$${TAR-tar} xf -'\n\n\n\n\n\n\n# POSIX will say in a future version that running \"rm -f\" with no argument\n# is OK; and we want to be able to make that assumption in our Makefile\n# recipes.  So use an aggressive probe to check that the usage we want is\n# actually supported \"in the wild\" to an acceptable degree.\n# See automake bug#10828.\n# To make any issue more visible, cause the running configure to be aborted\n# by default if the 'rm' program in use doesn't match our expectations; the\n# user can still override this though.\nif rm -f && rm -fr && rm -rf; then : OK; else\n  cat >&2 <<'END'\nOops!\n\nYour 'rm' program seems unable to run without file operands specified\non the command line, even when the '-f' option is present.  This is contrary\nto the behaviour of most rm programs out there, and not conforming with\nthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>\n\nPlease tell bug-automake@gnu.org about your system, including the value\nof your $PATH and any error possibly output before this message.  This\ncan help us improve future automake versions.\n\nEND\n  if test x\"$ACCEPT_INFERIOR_RM_PROGRAM\" = x\"yes\"; then\n    echo 'Configuration will proceed anyway, since you have set the' >&2\n    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to \"yes\"' >&2\n    echo >&2\n  else\n    cat >&2 <<'END'\nAborting the configuration process, to ensure you take notice of the issue.\n\nYou can download and install GNU coreutils to get an 'rm' implementation\nthat behaves properly: <http://www.gnu.org/software/coreutils/>.\n\nIf you want to complete the configuration process using your problematic\n'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM\nto \"yes\", and re-run configure.\n\nEND\n    as_fn_error $? \"Your 'rm' program is bad, sorry.\" \"$LINENO\" 5\n  fi\nfi\n\n\n\n# Check whether --enable-silent-rules was given.\nif test \"${enable_silent_rules+set}\" = set; then :\n  enableval=$enable_silent_rules;\nfi\n\ncase $enable_silent_rules in # (((\n  yes) AM_DEFAULT_VERBOSITY=0;;\n   no) AM_DEFAULT_VERBOSITY=1;;\n    *) AM_DEFAULT_VERBOSITY=0;;\nesac\nam_make=${MAKE-make}\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables\" >&5\n$as_echo_n \"checking whether $am_make supports nested variables... \" >&6; }\nif ${am_cv_make_support_nested_variables+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if $as_echo 'TRUE=$(BAR$(V))\nBAR0=false\nBAR1=true\nV=1\nam__doit:\n\t@$(TRUE)\n.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then\n  am_cv_make_support_nested_variables=yes\nelse\n  am_cv_make_support_nested_variables=no\nfi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables\" >&5\n$as_echo \"$am_cv_make_support_nested_variables\" >&6; }\nif test $am_cv_make_support_nested_variables = yes; then\n    AM_V='$(V)'\n  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'\nelse\n  AM_V=$AM_DEFAULT_VERBOSITY\n  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY\nfi\nAM_BACKSLASH='\\'\n\n\n# Checks for programs.\nSAVED_CFLAGS=${CFLAGS}\nSAVED_CPPFLAGS=${CPPFLAGS}\nDEPDIR=\"${am__leading_dot}deps\"\n\nac_config_commands=\"$ac_config_commands depfiles\"\n\n\nam_make=${MAKE-make}\ncat > confinc << 'END'\nam__doit:\n\t@echo this is the am__doit target\n.PHONY: am__doit\nEND\n# If we don't find an include directive, just comment out the code.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make\" >&5\n$as_echo_n \"checking for style of include used by $am_make... \" >&6; }\nam__include=\"#\"\nam__quote=\n_am_result=none\n# First try GNU make style include.\necho \"include confinc\" > confmf\n# Ignore all kinds of additional output from 'make'.\ncase `$am_make -s -f confmf 2> /dev/null` in #(\n*the\\ am__doit\\ target*)\n  am__include=include\n  am__quote=\n  _am_result=GNU\n  ;;\nesac\n# Now try BSD make style include.\nif test \"$am__include\" = \"#\"; then\n   echo '.include \"confinc\"' > confmf\n   case `$am_make -s -f confmf 2> /dev/null` in #(\n   *the\\ am__doit\\ target*)\n     am__include=.include\n     am__quote=\"\\\"\"\n     _am_result=BSD\n     ;;\n   esac\nfi\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $_am_result\" >&5\n$as_echo \"$_am_result\" >&6; }\nrm -f confinc confmf\n\n# Check whether --enable-dependency-tracking was given.\nif test \"${enable_dependency_tracking+set}\" = set; then :\n  enableval=$enable_dependency_tracking;\nfi\n\nif test \"x$enable_dependency_tracking\" != xno; then\n  am_depcomp=\"$ac_aux_dir/depcomp\"\n  AMDEPBACKSLASH='\\'\n  am__nodep='_no'\nfi\n if test \"x$enable_dependency_tracking\" != xno; then\n  AMDEP_TRUE=\n  AMDEP_FALSE='#'\nelse\n  AMDEP_TRUE='#'\n  AMDEP_FALSE=\nfi\n\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}gcc\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}gcc; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"${ac_tool_prefix}gcc\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\n$as_echo \"$CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_CC\"; then\n  ac_ct_CC=$CC\n  # Extract the first word of \"gcc\", so it can be a program name with args.\nset dummy gcc; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"gcc\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC\" >&5\n$as_echo \"$ac_ct_CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_CC\" = x; then\n    CC=\"\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    CC=$ac_ct_CC\n  fi\nelse\n  CC=\"$ac_cv_prog_CC\"\nfi\n\nif test -z \"$CC\"; then\n          if test -n \"$ac_tool_prefix\"; then\n    # Extract the first word of \"${ac_tool_prefix}cc\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}cc; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"${ac_tool_prefix}cc\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\n$as_echo \"$CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  fi\nfi\nif test -z \"$CC\"; then\n  # Extract the first word of \"cc\", so it can be a program name with args.\nset dummy cc; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\n  ac_prog_rejected=no\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    if test \"$as_dir/$ac_word$ac_exec_ext\" = \"/usr/ucb/cc\"; then\n       ac_prog_rejected=yes\n       continue\n     fi\n    ac_cv_prog_CC=\"cc\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nif test $ac_prog_rejected = yes; then\n  # We found a bogon in the path, so make sure we never use it.\n  set dummy $ac_cv_prog_CC\n  shift\n  if test $# != 0; then\n    # We chose a different compiler from the bogus one.\n    # However, it has the same basename, so the bogon will be chosen\n    # first if we set CC to just the basename; use the full file name.\n    shift\n    ac_cv_prog_CC=\"$as_dir/$ac_word${1+' '}$@\"\n  fi\nfi\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\n$as_echo \"$CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$CC\"; then\n  if test -n \"$ac_tool_prefix\"; then\n  for ac_prog in cl.exe\n  do\n    # Extract the first word of \"$ac_tool_prefix$ac_prog\", so it can be a program name with args.\nset dummy $ac_tool_prefix$ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"$ac_tool_prefix$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\n$as_echo \"$CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n    test -n \"$CC\" && break\n  done\nfi\nif test -z \"$CC\"; then\n  ac_ct_CC=$CC\n  for ac_prog in cl.exe\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC\" >&5\n$as_echo \"$ac_ct_CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  test -n \"$ac_ct_CC\" && break\ndone\n\n  if test \"x$ac_ct_CC\" = x; then\n    CC=\"\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    CC=$ac_ct_CC\n  fi\nfi\n\nfi\n\n\ntest -z \"$CC\" && { { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"no acceptable C compiler found in \\$PATH\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\n\n# Provide some information about the compiler.\n$as_echo \"$as_me:${as_lineno-$LINENO}: checking for C compiler version\" >&5\nset X $ac_compile\nac_compiler=$2\nfor ac_option in --version -v -V -qversion; do\n  { { ac_try=\"$ac_compiler $ac_option >&5\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_compiler $ac_option >&5\") 2>conftest.err\n  ac_status=$?\n  if test -s conftest.err; then\n    sed '10a\\\n... rest of stderr output deleted ...\n         10q' conftest.err >conftest.er1\n    cat conftest.er1 >&5\n  fi\n  rm -f conftest.er1 conftest.err\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\ndone\n\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nac_clean_files_save=$ac_clean_files\nac_clean_files=\"$ac_clean_files a.out a.out.dSYM a.exe b.out\"\n# Try to create an executable without -o first, disregard a.out.\n# It will help us diagnose broken compilers, and finding out an intuition\n# of exeext.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether the C compiler works\" >&5\n$as_echo_n \"checking whether the C compiler works... \" >&6; }\nac_link_default=`$as_echo \"$ac_link\" | sed 's/ -o *conftest[^ ]*//'`\n\n# The possible output files:\nac_files=\"a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*\"\n\nac_rmfiles=\nfor ac_file in $ac_files\ndo\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;\n    * ) ac_rmfiles=\"$ac_rmfiles $ac_file\";;\n  esac\ndone\nrm -f $ac_rmfiles\n\nif { { ac_try=\"$ac_link_default\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link_default\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then :\n  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.\n# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'\n# in a Makefile.  We should not override ac_cv_exeext if it was cached,\n# so that the user can short-circuit this test for compilers unknown to\n# Autoconf.\nfor ac_file in $ac_files ''\ndo\n  test -f \"$ac_file\" || continue\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )\n\t;;\n    [ab].out )\n\t# We found the default executable, but exeext='' is most\n\t# certainly right.\n\tbreak;;\n    *.* )\n\tif test \"${ac_cv_exeext+set}\" = set && test \"$ac_cv_exeext\" != no;\n\tthen :; else\n\t   ac_cv_exeext=`expr \"$ac_file\" : '[^.]*\\(\\..*\\)'`\n\tfi\n\t# We set ac_cv_exeext here because the later test for it is not\n\t# safe: cross compilers may not add the suffix if given an `-o'\n\t# argument, so we may need to know it at that point already.\n\t# Even if this section looks crufty: it has the advantage of\n\t# actually working.\n\tbreak;;\n    * )\n\tbreak;;\n  esac\ndone\ntest \"$ac_cv_exeext\" = no && ac_cv_exeext=\n\nelse\n  ac_file=''\nfi\nif test -z \"$ac_file\"; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n$as_echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n{ { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error 77 \"C compiler cannot create executables\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name\" >&5\n$as_echo_n \"checking for C compiler default output file name... \" >&6; }\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_file\" >&5\n$as_echo \"$ac_file\" >&6; }\nac_exeext=$ac_cv_exeext\n\nrm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out\nac_clean_files=$ac_clean_files_save\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for suffix of executables\" >&5\n$as_echo_n \"checking for suffix of executables... \" >&6; }\nif { { ac_try=\"$ac_link\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then :\n  # If both `conftest.exe' and `conftest' are `present' (well, observable)\n# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will\n# work properly (i.e., refer to `conftest.exe'), while it won't with\n# `rm'.\nfor ac_file in conftest.exe conftest conftest.*; do\n  test -f \"$ac_file\" || continue\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;\n    *.* ) ac_cv_exeext=`expr \"$ac_file\" : '[^.]*\\(\\..*\\)'`\n\t  break;;\n    * ) break;;\n  esac\ndone\nelse\n  { { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"cannot compute suffix of executables: cannot compile and link\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\nfi\nrm -f conftest conftest$ac_cv_exeext\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext\" >&5\n$as_echo \"$ac_cv_exeext\" >&6; }\n\nrm -f conftest.$ac_ext\nEXEEXT=$ac_cv_exeext\nac_exeext=$EXEEXT\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdio.h>\nint\nmain ()\n{\nFILE *f = fopen (\"conftest.out\", \"w\");\n return ferror (f) || fclose (f) != 0;\n\n  ;\n  return 0;\n}\n_ACEOF\nac_clean_files=\"$ac_clean_files conftest.out\"\n# Check that the compiler produces executables we can run.  If not, either\n# the compiler is broken, or we cross compile.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling\" >&5\n$as_echo_n \"checking whether we are cross compiling... \" >&6; }\nif test \"$cross_compiling\" != yes; then\n  { { ac_try=\"$ac_link\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n  if { ac_try='./conftest$ac_cv_exeext'\n  { { case \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_try\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; }; then\n    cross_compiling=no\n  else\n    if test \"$cross_compiling\" = maybe; then\n\tcross_compiling=yes\n    else\n\t{ { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"cannot run C compiled programs.\nIf you meant to cross compile, use \\`--host'.\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\n    fi\n  fi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $cross_compiling\" >&5\n$as_echo \"$cross_compiling\" >&6; }\n\nrm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out\nac_clean_files=$ac_clean_files_save\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for suffix of object files\" >&5\n$as_echo_n \"checking for suffix of object files... \" >&6; }\nif ${ac_cv_objext+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.o conftest.obj\nif { { ac_try=\"$ac_compile\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_compile\") 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then :\n  for ac_file in conftest.o conftest.obj conftest.*; do\n  test -f \"$ac_file\" || continue;\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;\n    *) ac_cv_objext=`expr \"$ac_file\" : '.*\\.\\(.*\\)'`\n       break;;\n  esac\ndone\nelse\n  $as_echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n{ { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"cannot compute suffix of object files: cannot compile\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\nfi\nrm -f conftest.$ac_cv_objext conftest.$ac_ext\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext\" >&5\n$as_echo \"$ac_cv_objext\" >&6; }\nOBJEXT=$ac_cv_objext\nac_objext=$OBJEXT\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler\" >&5\n$as_echo_n \"checking whether we are using the GNU C compiler... \" >&6; }\nif ${ac_cv_c_compiler_gnu+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n#ifndef __GNUC__\n       choke me\n#endif\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_compiler_gnu=yes\nelse\n  ac_compiler_gnu=no\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nac_cv_c_compiler_gnu=$ac_compiler_gnu\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu\" >&5\n$as_echo \"$ac_cv_c_compiler_gnu\" >&6; }\nif test $ac_compiler_gnu = yes; then\n  GCC=yes\nelse\n  GCC=\nfi\nac_test_CFLAGS=${CFLAGS+set}\nac_save_CFLAGS=$CFLAGS\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g\" >&5\n$as_echo_n \"checking whether $CC accepts -g... \" >&6; }\nif ${ac_cv_prog_cc_g+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_save_c_werror_flag=$ac_c_werror_flag\n   ac_c_werror_flag=yes\n   ac_cv_prog_cc_g=no\n   CFLAGS=\"-g\"\n   cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_prog_cc_g=yes\nelse\n  CFLAGS=\"\"\n      cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n\nelse\n  ac_c_werror_flag=$ac_save_c_werror_flag\n\t CFLAGS=\"-g\"\n\t cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_prog_cc_g=yes\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n   ac_c_werror_flag=$ac_save_c_werror_flag\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g\" >&5\n$as_echo \"$ac_cv_prog_cc_g\" >&6; }\nif test \"$ac_test_CFLAGS\" = set; then\n  CFLAGS=$ac_save_CFLAGS\nelif test $ac_cv_prog_cc_g = yes; then\n  if test \"$GCC\" = yes; then\n    CFLAGS=\"-g -O2\"\n  else\n    CFLAGS=\"-g\"\n  fi\nelse\n  if test \"$GCC\" = yes; then\n    CFLAGS=\"-O2\"\n  else\n    CFLAGS=\n  fi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89\" >&5\n$as_echo_n \"checking for $CC option to accept ISO C89... \" >&6; }\nif ${ac_cv_prog_cc_c89+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_cv_prog_cc_c89=no\nac_save_CC=$CC\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdarg.h>\n#include <stdio.h>\nstruct stat;\n/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */\nstruct buf { int x; };\nFILE * (*rcsopen) (struct buf *, struct stat *, int);\nstatic char *e (p, i)\n     char **p;\n     int i;\n{\n  return p[i];\n}\nstatic char *f (char * (*g) (char **, int), char **p, ...)\n{\n  char *s;\n  va_list v;\n  va_start (v,p);\n  s = g (p, va_arg (v,int));\n  va_end (v);\n  return s;\n}\n\n/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has\n   function prototypes and stuff, but not '\\xHH' hex character constants.\n   These don't provoke an error unfortunately, instead are silently treated\n   as 'x'.  The following induces an error, until -std is added to get\n   proper ANSI mode.  Curiously '\\x00'!='x' always comes out true, for an\n   array size at least.  It's necessary to write '\\x00'==0 to get something\n   that's true only with -std.  */\nint osf4_cc_array ['\\x00' == 0 ? 1 : -1];\n\n/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters\n   inside strings and character constants.  */\n#define FOO(x) 'x'\nint xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];\n\nint test (int i, double x);\nstruct s1 {int (*f) (int a);};\nstruct s2 {int (*f) (double a);};\nint pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);\nint argc;\nchar **argv;\nint\nmain ()\n{\nreturn f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];\n  ;\n  return 0;\n}\n_ACEOF\nfor ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \\\n\t-Ae \"-Aa -D_HPUX_SOURCE\" \"-Xc -D__EXTENSIONS__\"\ndo\n  CC=\"$ac_save_CC $ac_arg\"\n  if ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_prog_cc_c89=$ac_arg\nfi\nrm -f core conftest.err conftest.$ac_objext\n  test \"x$ac_cv_prog_cc_c89\" != \"xno\" && break\ndone\nrm -f conftest.$ac_ext\nCC=$ac_save_CC\n\nfi\n# AC_CACHE_VAL\ncase \"x$ac_cv_prog_cc_c89\" in\n  x)\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: none needed\" >&5\n$as_echo \"none needed\" >&6; } ;;\n  xno)\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: unsupported\" >&5\n$as_echo \"unsupported\" >&6; } ;;\n  *)\n    CC=\"$CC $ac_cv_prog_cc_c89\"\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89\" >&5\n$as_echo \"$ac_cv_prog_cc_c89\" >&6; } ;;\nesac\nif test \"x$ac_cv_prog_cc_c89\" != xno; then :\n\nfi\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together\" >&5\n$as_echo_n \"checking whether $CC understands -c and -o together... \" >&6; }\nif ${am_cv_prog_cc_c_o+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\n  # Make sure it works both with $CC and with simple cc.\n  # Following AC_PROG_CC_C_O, we do the test twice because some\n  # compilers refuse to overwrite an existing .o file with -o,\n  # though they will create one.\n  am_cv_prog_cc_c_o=yes\n  for am_i in 1 2; do\n    if { echo \"$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext\" >&5\n   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5\n   ac_status=$?\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n   (exit $ac_status); } \\\n         && test -f conftest2.$ac_objext; then\n      : OK\n    else\n      am_cv_prog_cc_c_o=no\n      break\n    fi\n  done\n  rm -f core conftest*\n  unset am_i\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o\" >&5\n$as_echo \"$am_cv_prog_cc_c_o\" >&6; }\nif test \"$am_cv_prog_cc_c_o\" != yes; then\n   # Losing compiler, so override with the script.\n   # FIXME: It is wrong to rewrite CC.\n   # But if we don't then we get into trouble of one sort or another.\n   # A longer-term fix would be to have automake use am__CC in this case,\n   # and then we could set am__CC=\"\\$(top_srcdir)/compile \\$(CC)\"\n   CC=\"$am_aux_dir/compile $CC\"\nfi\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n\ndepcc=\"$CC\"   am_compiler_list=\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc\" >&5\n$as_echo_n \"checking dependency style of $depcc... \" >&6; }\nif ${am_cv_CC_dependencies_compiler_type+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -z \"$AMDEP_TRUE\" && test -f \"$am_depcomp\"; then\n  # We make a subdir and do the tests there.  Otherwise we can end up\n  # making bogus files that we don't know about and never remove.  For\n  # instance it was reported that on HP-UX the gcc test will end up\n  # making a dummy file named 'D' -- because '-MD' means \"put the output\n  # in D\".\n  rm -rf conftest.dir\n  mkdir conftest.dir\n  # Copy depcomp to subdir because otherwise we won't find it if we're\n  # using a relative directory.\n  cp \"$am_depcomp\" conftest.dir\n  cd conftest.dir\n  # We will build objects and dependencies in a subdirectory because\n  # it helps to detect inapplicable dependency modes.  For instance\n  # both Tru64's cc and ICC support -MD to output dependencies as a\n  # side effect of compilation, but ICC will put the dependencies in\n  # the current directory while Tru64 will put them in the object\n  # directory.\n  mkdir sub\n\n  am_cv_CC_dependencies_compiler_type=none\n  if test \"$am_compiler_list\" = \"\"; then\n     am_compiler_list=`sed -n 's/^#*\\([a-zA-Z0-9]*\\))$/\\1/p' < ./depcomp`\n  fi\n  am__universal=false\n  case \" $depcc \" in #(\n     *\\ -arch\\ *\\ -arch\\ *) am__universal=true ;;\n     esac\n\n  for depmode in $am_compiler_list; do\n    # Setup a source with many dependencies, because some compilers\n    # like to wrap large dependency lists on column 80 (with \\), and\n    # we should not choose a depcomp mode which is confused by this.\n    #\n    # We need to recreate these files for each test, as the compiler may\n    # overwrite some of them when testing with obscure command lines.\n    # This happens at least with the AIX C compiler.\n    : > sub/conftest.c\n    for i in 1 2 3 4 5 6; do\n      echo '#include \"conftst'$i'.h\"' >> sub/conftest.c\n      # Using \": > sub/conftst$i.h\" creates only sub/conftst1.h with\n      # Solaris 10 /bin/sh.\n      echo '/* dummy */' > sub/conftst$i.h\n    done\n    echo \"${am__include} ${am__quote}sub/conftest.Po${am__quote}\" > confmf\n\n    # We check with '-c' and '-o' for the sake of the \"dashmstdout\"\n    # mode.  It turns out that the SunPro C++ compiler does not properly\n    # handle '-M -o', and we need to detect this.  Also, some Intel\n    # versions had trouble with output in subdirs.\n    am__obj=sub/conftest.${OBJEXT-o}\n    am__minus_obj=\"-o $am__obj\"\n    case $depmode in\n    gcc)\n      # This depmode causes a compiler race in universal mode.\n      test \"$am__universal\" = false || continue\n      ;;\n    nosideeffect)\n      # After this tag, mechanisms are not by side-effect, so they'll\n      # only be used when explicitly requested.\n      if test \"x$enable_dependency_tracking\" = xyes; then\n\tcontinue\n      else\n\tbreak\n      fi\n      ;;\n    msvc7 | msvc7msys | msvisualcpp | msvcmsys)\n      # This compiler won't grok '-c -o', but also, the minuso test has\n      # not run yet.  These depmodes are late enough in the game, and\n      # so weak that their functioning should not be impacted.\n      am__obj=conftest.${OBJEXT-o}\n      am__minus_obj=\n      ;;\n    none) break ;;\n    esac\n    if depmode=$depmode \\\n       source=sub/conftest.c object=$am__obj \\\n       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \\\n       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \\\n         >/dev/null 2>conftest.err &&\n       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&\n       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then\n      # icc doesn't choke on unknown options, it will just issue warnings\n      # or remarks (even with -Werror).  So we grep stderr for any message\n      # that says an option was ignored or not supported.\n      # When given -MP, icc 7.0 and 7.1 complain thusly:\n      #   icc: Command line warning: ignoring option '-M'; no argument required\n      # The diagnosis changed in icc 8.0:\n      #   icc: Command line remark: option '-MP' not supported\n      if (grep 'ignoring option' conftest.err ||\n          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else\n        am_cv_CC_dependencies_compiler_type=$depmode\n        break\n      fi\n    fi\n  done\n\n  cd ..\n  rm -rf conftest.dir\nelse\n  am_cv_CC_dependencies_compiler_type=none\nfi\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type\" >&5\n$as_echo \"$am_cv_CC_dependencies_compiler_type\" >&6; }\nCCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type\n\n if\n  test \"x$enable_dependency_tracking\" != xno \\\n  && test \"$am_cv_CC_dependencies_compiler_type\" = gcc3; then\n  am__fastdepCC_TRUE=\n  am__fastdepCC_FALSE='#'\nelse\n  am__fastdepCC_TRUE='#'\n  am__fastdepCC_FALSE=\nfi\n\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor\" >&5\n$as_echo_n \"checking how to run the C preprocessor... \" >&6; }\n# On Suns, sometimes $CPP names a directory.\nif test -n \"$CPP\" && test -d \"$CPP\"; then\n  CPP=\nfi\nif test -z \"$CPP\"; then\n  if ${ac_cv_prog_CPP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n      # Double quotes because CPP needs to be expanded\n    for CPP in \"$CC -E\" \"$CC -E -traditional-cpp\" \"/lib/cpp\"\n    do\n      ac_preproc_ok=false\nfor ac_c_preproc_warn_flag in '' yes\ndo\n  # Use a header file that comes with gcc, so configuring glibc\n  # with a fresh cross-compiler works.\n  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n  # <limits.h> exists even on freestanding compilers.\n  # On the NeXT, cc -E runs the code through the compiler's parser,\n  # not just through cpp. \"Syntax error\" is here to catch this case.\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\t\t     Syntax error\n_ACEOF\nif ac_fn_c_try_cpp \"$LINENO\"; then :\n\nelse\n  # Broken: fails on valid input.\ncontinue\nfi\nrm -f conftest.err conftest.i conftest.$ac_ext\n\n  # OK, works on sane cases.  Now check whether nonexistent headers\n  # can be detected and how.\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <ac_nonexistent.h>\n_ACEOF\nif ac_fn_c_try_cpp \"$LINENO\"; then :\n  # Broken: success on invalid input.\ncontinue\nelse\n  # Passes both tests.\nac_preproc_ok=:\nbreak\nfi\nrm -f conftest.err conftest.i conftest.$ac_ext\n\ndone\n# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.\nrm -f conftest.i conftest.err conftest.$ac_ext\nif $ac_preproc_ok; then :\n  break\nfi\n\n    done\n    ac_cv_prog_CPP=$CPP\n\nfi\n  CPP=$ac_cv_prog_CPP\nelse\n  ac_cv_prog_CPP=$CPP\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $CPP\" >&5\n$as_echo \"$CPP\" >&6; }\nac_preproc_ok=false\nfor ac_c_preproc_warn_flag in '' yes\ndo\n  # Use a header file that comes with gcc, so configuring glibc\n  # with a fresh cross-compiler works.\n  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n  # <limits.h> exists even on freestanding compilers.\n  # On the NeXT, cc -E runs the code through the compiler's parser,\n  # not just through cpp. \"Syntax error\" is here to catch this case.\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\t\t     Syntax error\n_ACEOF\nif ac_fn_c_try_cpp \"$LINENO\"; then :\n\nelse\n  # Broken: fails on valid input.\ncontinue\nfi\nrm -f conftest.err conftest.i conftest.$ac_ext\n\n  # OK, works on sane cases.  Now check whether nonexistent headers\n  # can be detected and how.\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <ac_nonexistent.h>\n_ACEOF\nif ac_fn_c_try_cpp \"$LINENO\"; then :\n  # Broken: success on invalid input.\ncontinue\nelse\n  # Passes both tests.\nac_preproc_ok=:\nbreak\nfi\nrm -f conftest.err conftest.i conftest.$ac_ext\n\ndone\n# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.\nrm -f conftest.i conftest.err conftest.$ac_ext\nif $ac_preproc_ok; then :\n\nelse\n  { { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"C preprocessor \\\"$CPP\\\" fails sanity check\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\nfi\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}gcc\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}gcc; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"${ac_tool_prefix}gcc\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\n$as_echo \"$CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_CC\"; then\n  ac_ct_CC=$CC\n  # Extract the first word of \"gcc\", so it can be a program name with args.\nset dummy gcc; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"gcc\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC\" >&5\n$as_echo \"$ac_ct_CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_CC\" = x; then\n    CC=\"\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    CC=$ac_ct_CC\n  fi\nelse\n  CC=\"$ac_cv_prog_CC\"\nfi\n\nif test -z \"$CC\"; then\n          if test -n \"$ac_tool_prefix\"; then\n    # Extract the first word of \"${ac_tool_prefix}cc\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}cc; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"${ac_tool_prefix}cc\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\n$as_echo \"$CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  fi\nfi\nif test -z \"$CC\"; then\n  # Extract the first word of \"cc\", so it can be a program name with args.\nset dummy cc; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\n  ac_prog_rejected=no\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    if test \"$as_dir/$ac_word$ac_exec_ext\" = \"/usr/ucb/cc\"; then\n       ac_prog_rejected=yes\n       continue\n     fi\n    ac_cv_prog_CC=\"cc\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nif test $ac_prog_rejected = yes; then\n  # We found a bogon in the path, so make sure we never use it.\n  set dummy $ac_cv_prog_CC\n  shift\n  if test $# != 0; then\n    # We chose a different compiler from the bogus one.\n    # However, it has the same basename, so the bogon will be chosen\n    # first if we set CC to just the basename; use the full file name.\n    shift\n    ac_cv_prog_CC=\"$as_dir/$ac_word${1+' '}$@\"\n  fi\nfi\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\n$as_echo \"$CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$CC\"; then\n  if test -n \"$ac_tool_prefix\"; then\n  for ac_prog in cl.exe\n  do\n    # Extract the first word of \"$ac_tool_prefix$ac_prog\", so it can be a program name with args.\nset dummy $ac_tool_prefix$ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"$ac_tool_prefix$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\n$as_echo \"$CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n    test -n \"$CC\" && break\n  done\nfi\nif test -z \"$CC\"; then\n  ac_ct_CC=$CC\n  for ac_prog in cl.exe\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_CC+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC\" >&5\n$as_echo \"$ac_ct_CC\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  test -n \"$ac_ct_CC\" && break\ndone\n\n  if test \"x$ac_ct_CC\" = x; then\n    CC=\"\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    CC=$ac_ct_CC\n  fi\nfi\n\nfi\n\n\ntest -z \"$CC\" && { { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error $? \"no acceptable C compiler found in \\$PATH\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\n\n# Provide some information about the compiler.\n$as_echo \"$as_me:${as_lineno-$LINENO}: checking for C compiler version\" >&5\nset X $ac_compile\nac_compiler=$2\nfor ac_option in --version -v -V -qversion; do\n  { { ac_try=\"$ac_compiler $ac_option >&5\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\n$as_echo \"$ac_try_echo\"; } >&5\n  (eval \"$ac_compiler $ac_option >&5\") 2>conftest.err\n  ac_status=$?\n  if test -s conftest.err; then\n    sed '10a\\\n... rest of stderr output deleted ...\n         10q' conftest.err >conftest.er1\n    cat conftest.er1 >&5\n  fi\n  rm -f conftest.er1 conftest.err\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\ndone\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler\" >&5\n$as_echo_n \"checking whether we are using the GNU C compiler... \" >&6; }\nif ${ac_cv_c_compiler_gnu+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n#ifndef __GNUC__\n       choke me\n#endif\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_compiler_gnu=yes\nelse\n  ac_compiler_gnu=no\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nac_cv_c_compiler_gnu=$ac_compiler_gnu\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu\" >&5\n$as_echo \"$ac_cv_c_compiler_gnu\" >&6; }\nif test $ac_compiler_gnu = yes; then\n  GCC=yes\nelse\n  GCC=\nfi\nac_test_CFLAGS=${CFLAGS+set}\nac_save_CFLAGS=$CFLAGS\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g\" >&5\n$as_echo_n \"checking whether $CC accepts -g... \" >&6; }\nif ${ac_cv_prog_cc_g+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_save_c_werror_flag=$ac_c_werror_flag\n   ac_c_werror_flag=yes\n   ac_cv_prog_cc_g=no\n   CFLAGS=\"-g\"\n   cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_prog_cc_g=yes\nelse\n  CFLAGS=\"\"\n      cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n\nelse\n  ac_c_werror_flag=$ac_save_c_werror_flag\n\t CFLAGS=\"-g\"\n\t cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_prog_cc_g=yes\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n   ac_c_werror_flag=$ac_save_c_werror_flag\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g\" >&5\n$as_echo \"$ac_cv_prog_cc_g\" >&6; }\nif test \"$ac_test_CFLAGS\" = set; then\n  CFLAGS=$ac_save_CFLAGS\nelif test $ac_cv_prog_cc_g = yes; then\n  if test \"$GCC\" = yes; then\n    CFLAGS=\"-g -O2\"\n  else\n    CFLAGS=\"-g\"\n  fi\nelse\n  if test \"$GCC\" = yes; then\n    CFLAGS=\"-O2\"\n  else\n    CFLAGS=\n  fi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89\" >&5\n$as_echo_n \"checking for $CC option to accept ISO C89... \" >&6; }\nif ${ac_cv_prog_cc_c89+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_cv_prog_cc_c89=no\nac_save_CC=$CC\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdarg.h>\n#include <stdio.h>\nstruct stat;\n/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */\nstruct buf { int x; };\nFILE * (*rcsopen) (struct buf *, struct stat *, int);\nstatic char *e (p, i)\n     char **p;\n     int i;\n{\n  return p[i];\n}\nstatic char *f (char * (*g) (char **, int), char **p, ...)\n{\n  char *s;\n  va_list v;\n  va_start (v,p);\n  s = g (p, va_arg (v,int));\n  va_end (v);\n  return s;\n}\n\n/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has\n   function prototypes and stuff, but not '\\xHH' hex character constants.\n   These don't provoke an error unfortunately, instead are silently treated\n   as 'x'.  The following induces an error, until -std is added to get\n   proper ANSI mode.  Curiously '\\x00'!='x' always comes out true, for an\n   array size at least.  It's necessary to write '\\x00'==0 to get something\n   that's true only with -std.  */\nint osf4_cc_array ['\\x00' == 0 ? 1 : -1];\n\n/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters\n   inside strings and character constants.  */\n#define FOO(x) 'x'\nint xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];\n\nint test (int i, double x);\nstruct s1 {int (*f) (int a);};\nstruct s2 {int (*f) (double a);};\nint pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);\nint argc;\nchar **argv;\nint\nmain ()\n{\nreturn f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];\n  ;\n  return 0;\n}\n_ACEOF\nfor ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \\\n\t-Ae \"-Aa -D_HPUX_SOURCE\" \"-Xc -D__EXTENSIONS__\"\ndo\n  CC=\"$ac_save_CC $ac_arg\"\n  if ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_prog_cc_c89=$ac_arg\nfi\nrm -f core conftest.err conftest.$ac_objext\n  test \"x$ac_cv_prog_cc_c89\" != \"xno\" && break\ndone\nrm -f conftest.$ac_ext\nCC=$ac_save_CC\n\nfi\n# AC_CACHE_VAL\ncase \"x$ac_cv_prog_cc_c89\" in\n  x)\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: none needed\" >&5\n$as_echo \"none needed\" >&6; } ;;\n  xno)\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: unsupported\" >&5\n$as_echo \"unsupported\" >&6; } ;;\n  *)\n    CC=\"$CC $ac_cv_prog_cc_c89\"\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89\" >&5\n$as_echo \"$ac_cv_prog_cc_c89\" >&6; } ;;\nesac\nif test \"x$ac_cv_prog_cc_c89\" != xno; then :\n\nfi\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together\" >&5\n$as_echo_n \"checking whether $CC understands -c and -o together... \" >&6; }\nif ${am_cv_prog_cc_c_o+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\n  # Make sure it works both with $CC and with simple cc.\n  # Following AC_PROG_CC_C_O, we do the test twice because some\n  # compilers refuse to overwrite an existing .o file with -o,\n  # though they will create one.\n  am_cv_prog_cc_c_o=yes\n  for am_i in 1 2; do\n    if { echo \"$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext\" >&5\n   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5\n   ac_status=$?\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n   (exit $ac_status); } \\\n         && test -f conftest2.$ac_objext; then\n      : OK\n    else\n      am_cv_prog_cc_c_o=no\n      break\n    fi\n  done\n  rm -f core conftest*\n  unset am_i\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o\" >&5\n$as_echo \"$am_cv_prog_cc_c_o\" >&6; }\nif test \"$am_cv_prog_cc_c_o\" != yes; then\n   # Losing compiler, so override with the script.\n   # FIXME: It is wrong to rewrite CC.\n   # But if we don't then we get into trouble of one sort or another.\n   # A longer-term fix would be to have automake use am__CC in this case,\n   # and then we could set am__CC=\"\\$(top_srcdir)/compile \\$(CC)\"\n   CC=\"$am_aux_dir/compile $CC\"\nfi\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n\ndepcc=\"$CC\"   am_compiler_list=\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc\" >&5\n$as_echo_n \"checking dependency style of $depcc... \" >&6; }\nif ${am_cv_CC_dependencies_compiler_type+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -z \"$AMDEP_TRUE\" && test -f \"$am_depcomp\"; then\n  # We make a subdir and do the tests there.  Otherwise we can end up\n  # making bogus files that we don't know about and never remove.  For\n  # instance it was reported that on HP-UX the gcc test will end up\n  # making a dummy file named 'D' -- because '-MD' means \"put the output\n  # in D\".\n  rm -rf conftest.dir\n  mkdir conftest.dir\n  # Copy depcomp to subdir because otherwise we won't find it if we're\n  # using a relative directory.\n  cp \"$am_depcomp\" conftest.dir\n  cd conftest.dir\n  # We will build objects and dependencies in a subdirectory because\n  # it helps to detect inapplicable dependency modes.  For instance\n  # both Tru64's cc and ICC support -MD to output dependencies as a\n  # side effect of compilation, but ICC will put the dependencies in\n  # the current directory while Tru64 will put them in the object\n  # directory.\n  mkdir sub\n\n  am_cv_CC_dependencies_compiler_type=none\n  if test \"$am_compiler_list\" = \"\"; then\n     am_compiler_list=`sed -n 's/^#*\\([a-zA-Z0-9]*\\))$/\\1/p' < ./depcomp`\n  fi\n  am__universal=false\n  case \" $depcc \" in #(\n     *\\ -arch\\ *\\ -arch\\ *) am__universal=true ;;\n     esac\n\n  for depmode in $am_compiler_list; do\n    # Setup a source with many dependencies, because some compilers\n    # like to wrap large dependency lists on column 80 (with \\), and\n    # we should not choose a depcomp mode which is confused by this.\n    #\n    # We need to recreate these files for each test, as the compiler may\n    # overwrite some of them when testing with obscure command lines.\n    # This happens at least with the AIX C compiler.\n    : > sub/conftest.c\n    for i in 1 2 3 4 5 6; do\n      echo '#include \"conftst'$i'.h\"' >> sub/conftest.c\n      # Using \": > sub/conftst$i.h\" creates only sub/conftst1.h with\n      # Solaris 10 /bin/sh.\n      echo '/* dummy */' > sub/conftst$i.h\n    done\n    echo \"${am__include} ${am__quote}sub/conftest.Po${am__quote}\" > confmf\n\n    # We check with '-c' and '-o' for the sake of the \"dashmstdout\"\n    # mode.  It turns out that the SunPro C++ compiler does not properly\n    # handle '-M -o', and we need to detect this.  Also, some Intel\n    # versions had trouble with output in subdirs.\n    am__obj=sub/conftest.${OBJEXT-o}\n    am__minus_obj=\"-o $am__obj\"\n    case $depmode in\n    gcc)\n      # This depmode causes a compiler race in universal mode.\n      test \"$am__universal\" = false || continue\n      ;;\n    nosideeffect)\n      # After this tag, mechanisms are not by side-effect, so they'll\n      # only be used when explicitly requested.\n      if test \"x$enable_dependency_tracking\" = xyes; then\n\tcontinue\n      else\n\tbreak\n      fi\n      ;;\n    msvc7 | msvc7msys | msvisualcpp | msvcmsys)\n      # This compiler won't grok '-c -o', but also, the minuso test has\n      # not run yet.  These depmodes are late enough in the game, and\n      # so weak that their functioning should not be impacted.\n      am__obj=conftest.${OBJEXT-o}\n      am__minus_obj=\n      ;;\n    none) break ;;\n    esac\n    if depmode=$depmode \\\n       source=sub/conftest.c object=$am__obj \\\n       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \\\n       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \\\n         >/dev/null 2>conftest.err &&\n       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&\n       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then\n      # icc doesn't choke on unknown options, it will just issue warnings\n      # or remarks (even with -Werror).  So we grep stderr for any message\n      # that says an option was ignored or not supported.\n      # When given -MP, icc 7.0 and 7.1 complain thusly:\n      #   icc: Command line warning: ignoring option '-M'; no argument required\n      # The diagnosis changed in icc 8.0:\n      #   icc: Command line remark: option '-MP' not supported\n      if (grep 'ignoring option' conftest.err ||\n          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else\n        am_cv_CC_dependencies_compiler_type=$depmode\n        break\n      fi\n    fi\n  done\n\n  cd ..\n  rm -rf conftest.dir\nelse\n  am_cv_CC_dependencies_compiler_type=none\nfi\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type\" >&5\n$as_echo \"$am_cv_CC_dependencies_compiler_type\" >&6; }\nCCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type\n\n if\n  test \"x$enable_dependency_tracking\" != xno \\\n  && test \"$am_cv_CC_dependencies_compiler_type\" = gcc3; then\n  am__fastdepCC_TRUE=\n  am__fastdepCC_FALSE='#'\nelse\n  am__fastdepCC_TRUE='#'\n  am__fastdepCC_FALSE=\nfi\n\n\n\nif test -n \"$ac_tool_prefix\"; then\n  for ac_prog in ar lib \"link -lib\"\n  do\n    # Extract the first word of \"$ac_tool_prefix$ac_prog\", so it can be a program name with args.\nset dummy $ac_tool_prefix$ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_AR+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$AR\"; then\n  ac_cv_prog_AR=\"$AR\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_AR=\"$ac_tool_prefix$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nAR=$ac_cv_prog_AR\nif test -n \"$AR\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $AR\" >&5\n$as_echo \"$AR\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n    test -n \"$AR\" && break\n  done\nfi\nif test -z \"$AR\"; then\n  ac_ct_AR=$AR\n  for ac_prog in ar lib \"link -lib\"\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_AR+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_AR\"; then\n  ac_cv_prog_ac_ct_AR=\"$ac_ct_AR\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_AR=\"$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_AR=$ac_cv_prog_ac_ct_AR\nif test -n \"$ac_ct_AR\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR\" >&5\n$as_echo \"$ac_ct_AR\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  test -n \"$ac_ct_AR\" && break\ndone\n\n  if test \"x$ac_ct_AR\" = x; then\n    AR=\"false\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    AR=$ac_ct_AR\n  fi\nfi\n\n: ${AR=ar}\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface\" >&5\n$as_echo_n \"checking the archiver ($AR) interface... \" >&6; }\nif ${am_cv_ar_interface+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n   am_cv_ar_interface=ar\n   cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\nint some_variable = 0;\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'\n      { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$am_ar_try\\\"\"; } >&5\n  (eval $am_ar_try) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n      if test \"$ac_status\" -eq 0; then\n        am_cv_ar_interface=ar\n      else\n        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5'\n        { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$am_ar_try\\\"\"; } >&5\n  (eval $am_ar_try) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n        if test \"$ac_status\" -eq 0; then\n          am_cv_ar_interface=lib\n        else\n          am_cv_ar_interface=unknown\n        fi\n      fi\n      rm -f conftest.lib libconftest.a\n\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n   ac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface\" >&5\n$as_echo \"$am_cv_ar_interface\" >&6; }\n\ncase $am_cv_ar_interface in\nar)\n  ;;\nlib)\n  # Microsoft lib, so override with the ar-lib wrapper script.\n  # FIXME: It is wrong to rewrite AR.\n  # But if we don't then we get into trouble of one sort or another.\n  # A longer-term fix would be to have automake use am__AR in this case,\n  # and then we could set am__AR=\"$am_aux_dir/ar-lib \\$(AR)\" or something\n  # similar.\n  AR=\"$am_aux_dir/ar-lib $AR\"\n  ;;\nunknown)\n  as_fn_error $? \"could not determine $AR interface\" \"$LINENO\" 5\n  ;;\nesac\n\n# By default we simply use the C compiler to build assembly code.\n\ntest \"${CCAS+set}\" = set || CCAS=$CC\ntest \"${CCASFLAGS+set}\" = set || CCASFLAGS=$CFLAGS\n\n\n\ndepcc=\"$CCAS\"   am_compiler_list=\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc\" >&5\n$as_echo_n \"checking dependency style of $depcc... \" >&6; }\nif ${am_cv_CCAS_dependencies_compiler_type+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -z \"$AMDEP_TRUE\" && test -f \"$am_depcomp\"; then\n  # We make a subdir and do the tests there.  Otherwise we can end up\n  # making bogus files that we don't know about and never remove.  For\n  # instance it was reported that on HP-UX the gcc test will end up\n  # making a dummy file named 'D' -- because '-MD' means \"put the output\n  # in D\".\n  rm -rf conftest.dir\n  mkdir conftest.dir\n  # Copy depcomp to subdir because otherwise we won't find it if we're\n  # using a relative directory.\n  cp \"$am_depcomp\" conftest.dir\n  cd conftest.dir\n  # We will build objects and dependencies in a subdirectory because\n  # it helps to detect inapplicable dependency modes.  For instance\n  # both Tru64's cc and ICC support -MD to output dependencies as a\n  # side effect of compilation, but ICC will put the dependencies in\n  # the current directory while Tru64 will put them in the object\n  # directory.\n  mkdir sub\n\n  am_cv_CCAS_dependencies_compiler_type=none\n  if test \"$am_compiler_list\" = \"\"; then\n     am_compiler_list=`sed -n 's/^#*\\([a-zA-Z0-9]*\\))$/\\1/p' < ./depcomp`\n  fi\n  am__universal=false\n\n\n  for depmode in $am_compiler_list; do\n    # Setup a source with many dependencies, because some compilers\n    # like to wrap large dependency lists on column 80 (with \\), and\n    # we should not choose a depcomp mode which is confused by this.\n    #\n    # We need to recreate these files for each test, as the compiler may\n    # overwrite some of them when testing with obscure command lines.\n    # This happens at least with the AIX C compiler.\n    : > sub/conftest.c\n    for i in 1 2 3 4 5 6; do\n      echo '#include \"conftst'$i'.h\"' >> sub/conftest.c\n      # Using \": > sub/conftst$i.h\" creates only sub/conftst1.h with\n      # Solaris 10 /bin/sh.\n      echo '/* dummy */' > sub/conftst$i.h\n    done\n    echo \"${am__include} ${am__quote}sub/conftest.Po${am__quote}\" > confmf\n\n    # We check with '-c' and '-o' for the sake of the \"dashmstdout\"\n    # mode.  It turns out that the SunPro C++ compiler does not properly\n    # handle '-M -o', and we need to detect this.  Also, some Intel\n    # versions had trouble with output in subdirs.\n    am__obj=sub/conftest.${OBJEXT-o}\n    am__minus_obj=\"-o $am__obj\"\n    case $depmode in\n    gcc)\n      # This depmode causes a compiler race in universal mode.\n      test \"$am__universal\" = false || continue\n      ;;\n    nosideeffect)\n      # After this tag, mechanisms are not by side-effect, so they'll\n      # only be used when explicitly requested.\n      if test \"x$enable_dependency_tracking\" = xyes; then\n\tcontinue\n      else\n\tbreak\n      fi\n      ;;\n    msvc7 | msvc7msys | msvisualcpp | msvcmsys)\n      # This compiler won't grok '-c -o', but also, the minuso test has\n      # not run yet.  These depmodes are late enough in the game, and\n      # so weak that their functioning should not be impacted.\n      am__obj=conftest.${OBJEXT-o}\n      am__minus_obj=\n      ;;\n    none) break ;;\n    esac\n    if depmode=$depmode \\\n       source=sub/conftest.c object=$am__obj \\\n       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \\\n       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \\\n         >/dev/null 2>conftest.err &&\n       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&\n       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then\n      # icc doesn't choke on unknown options, it will just issue warnings\n      # or remarks (even with -Werror).  So we grep stderr for any message\n      # that says an option was ignored or not supported.\n      # When given -MP, icc 7.0 and 7.1 complain thusly:\n      #   icc: Command line warning: ignoring option '-M'; no argument required\n      # The diagnosis changed in icc 8.0:\n      #   icc: Command line remark: option '-MP' not supported\n      if (grep 'ignoring option' conftest.err ||\n          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else\n        am_cv_CCAS_dependencies_compiler_type=$depmode\n        break\n      fi\n    fi\n  done\n\n  cd ..\n  rm -rf conftest.dir\nelse\n  am_cv_CCAS_dependencies_compiler_type=none\nfi\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type\" >&5\n$as_echo \"$am_cv_CCAS_dependencies_compiler_type\" >&6; }\nCCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type\n\n if\n  test \"x$enable_dependency_tracking\" != xno \\\n  && test \"$am_cv_CCAS_dependencies_compiler_type\" = gcc3; then\n  am__fastdepCCAS_TRUE=\n  am__fastdepCCAS_FALSE='#'\nelse\n  am__fastdepCCAS_TRUE='#'\n  am__fastdepCCAS_FALSE=\nfi\n\n\n\n\ncase `pwd` in\n  *\\ * | *\\\t*)\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \\`pwd\\`\" >&5\n$as_echo \"$as_me: WARNING: Libtool does not cope well with whitespace in \\`pwd\\`\" >&2;} ;;\nesac\n\n\n\nmacro_version='2.4.6'\nmacro_revision='2.4.6'\n\n\n\n\n\n\n\n\n\n\n\n\n\nltmain=$ac_aux_dir/ltmain.sh\n\n# Make sure we can run config.sub.\n$SHELL \"$ac_aux_dir/config.sub\" sun4 >/dev/null 2>&1 ||\n  as_fn_error $? \"cannot run $SHELL $ac_aux_dir/config.sub\" \"$LINENO\" 5\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking build system type\" >&5\n$as_echo_n \"checking build system type... \" >&6; }\nif ${ac_cv_build+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_build_alias=$build_alias\ntest \"x$ac_build_alias\" = x &&\n  ac_build_alias=`$SHELL \"$ac_aux_dir/config.guess\"`\ntest \"x$ac_build_alias\" = x &&\n  as_fn_error $? \"cannot guess build type; you must specify one\" \"$LINENO\" 5\nac_cv_build=`$SHELL \"$ac_aux_dir/config.sub\" $ac_build_alias` ||\n  as_fn_error $? \"$SHELL $ac_aux_dir/config.sub $ac_build_alias failed\" \"$LINENO\" 5\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_build\" >&5\n$as_echo \"$ac_cv_build\" >&6; }\ncase $ac_cv_build in\n*-*-*) ;;\n*) as_fn_error $? \"invalid value of canonical build\" \"$LINENO\" 5;;\nesac\nbuild=$ac_cv_build\nac_save_IFS=$IFS; IFS='-'\nset x $ac_cv_build\nshift\nbuild_cpu=$1\nbuild_vendor=$2\nshift; shift\n# Remember, the first character of IFS is used to create $*,\n# except with old shells:\nbuild_os=$*\nIFS=$ac_save_IFS\ncase $build_os in *\\ *) build_os=`echo \"$build_os\" | sed 's/ /-/g'`;; esac\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking host system type\" >&5\n$as_echo_n \"checking host system type... \" >&6; }\nif ${ac_cv_host+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test \"x$host_alias\" = x; then\n  ac_cv_host=$ac_cv_build\nelse\n  ac_cv_host=`$SHELL \"$ac_aux_dir/config.sub\" $host_alias` ||\n    as_fn_error $? \"$SHELL $ac_aux_dir/config.sub $host_alias failed\" \"$LINENO\" 5\nfi\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_host\" >&5\n$as_echo \"$ac_cv_host\" >&6; }\ncase $ac_cv_host in\n*-*-*) ;;\n*) as_fn_error $? \"invalid value of canonical host\" \"$LINENO\" 5;;\nesac\nhost=$ac_cv_host\nac_save_IFS=$IFS; IFS='-'\nset x $ac_cv_host\nshift\nhost_cpu=$1\nhost_vendor=$2\nshift; shift\n# Remember, the first character of IFS is used to create $*,\n# except with old shells:\nhost_os=$*\nIFS=$ac_save_IFS\ncase $host_os in *\\ *) host_os=`echo \"$host_os\" | sed 's/ /-/g'`;; esac\n\n\n# Backslashify metacharacters that are still active within\n# double-quoted strings.\nsed_quote_subst='s/\\([\"`$\\\\]\\)/\\\\\\1/g'\n\n# Same as above, but do not quote variable references.\ndouble_quote_subst='s/\\([\"`\\\\]\\)/\\\\\\1/g'\n\n# Sed substitution to delay expansion of an escaped shell variable in a\n# double_quote_subst'ed string.\ndelay_variable_subst='s/\\\\\\\\\\\\\\\\\\\\\\$/\\\\\\\\\\\\$/g'\n\n# Sed substitution to delay expansion of an escaped single quote.\ndelay_single_quote_subst='s/'\\''/'\\'\\\\\\\\\\\\\\'\\''/g'\n\n# Sed substitution to avoid accidental globbing in evaled expressions\nno_glob_subst='s/\\*/\\\\\\*/g'\n\nECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\nECHO=$ECHO$ECHO$ECHO$ECHO$ECHO\nECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to print strings\" >&5\n$as_echo_n \"checking how to print strings... \" >&6; }\n# Test print first, because it will be a builtin if present.\nif test \"X`( print -r -- -n ) 2>/dev/null`\" = X-n && \\\n   test \"X`print -r -- $ECHO 2>/dev/null`\" = \"X$ECHO\"; then\n  ECHO='print -r --'\nelif test \"X`printf %s $ECHO 2>/dev/null`\" = \"X$ECHO\"; then\n  ECHO='printf %s\\n'\nelse\n  # Use this function as a fallback that always works.\n  func_fallback_echo ()\n  {\n    eval 'cat <<_LTECHO_EOF\n$1\n_LTECHO_EOF'\n  }\n  ECHO='func_fallback_echo'\nfi\n\n# func_echo_all arg...\n# Invoke $ECHO with all args, space-separated.\nfunc_echo_all ()\n{\n    $ECHO \"\"\n}\n\ncase $ECHO in\n  printf*) { $as_echo \"$as_me:${as_lineno-$LINENO}: result: printf\" >&5\n$as_echo \"printf\" >&6; } ;;\n  print*) { $as_echo \"$as_me:${as_lineno-$LINENO}: result: print -r\" >&5\n$as_echo \"print -r\" >&6; } ;;\n  *) { $as_echo \"$as_me:${as_lineno-$LINENO}: result: cat\" >&5\n$as_echo \"cat\" >&6; } ;;\nesac\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output\" >&5\n$as_echo_n \"checking for a sed that does not truncate output... \" >&6; }\nif ${ac_cv_path_SED+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/\n     for ac_i in 1 2 3 4 5 6 7; do\n       ac_script=\"$ac_script$as_nl$ac_script\"\n     done\n     echo \"$ac_script\" 2>/dev/null | sed 99q >conftest.sed\n     { ac_script=; unset ac_script;}\n     if test -z \"$SED\"; then\n  ac_path_SED_found=false\n  # Loop through the user's path and test for each of PROGNAME-LIST\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_prog in sed gsed; do\n    for ac_exec_ext in '' $ac_executable_extensions; do\n      ac_path_SED=\"$as_dir/$ac_prog$ac_exec_ext\"\n      as_fn_executable_p \"$ac_path_SED\" || continue\n# Check for GNU ac_path_SED and select it if it is found.\n  # Check for GNU $ac_path_SED\ncase `\"$ac_path_SED\" --version 2>&1` in\n*GNU*)\n  ac_cv_path_SED=\"$ac_path_SED\" ac_path_SED_found=:;;\n*)\n  ac_count=0\n  $as_echo_n 0123456789 >\"conftest.in\"\n  while :\n  do\n    cat \"conftest.in\" \"conftest.in\" >\"conftest.tmp\"\n    mv \"conftest.tmp\" \"conftest.in\"\n    cp \"conftest.in\" \"conftest.nl\"\n    $as_echo '' >> \"conftest.nl\"\n    \"$ac_path_SED\" -f conftest.sed < \"conftest.nl\" >\"conftest.out\" 2>/dev/null || break\n    diff \"conftest.out\" \"conftest.nl\" >/dev/null 2>&1 || break\n    as_fn_arith $ac_count + 1 && ac_count=$as_val\n    if test $ac_count -gt ${ac_path_SED_max-0}; then\n      # Best one so far, save it but keep looking for a better one\n      ac_cv_path_SED=\"$ac_path_SED\"\n      ac_path_SED_max=$ac_count\n    fi\n    # 10*(2^10) chars as input seems more than enough\n    test $ac_count -gt 10 && break\n  done\n  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;\nesac\n\n      $ac_path_SED_found && break 3\n    done\n  done\n  done\nIFS=$as_save_IFS\n  if test -z \"$ac_cv_path_SED\"; then\n    as_fn_error $? \"no acceptable sed could be found in \\$PATH\" \"$LINENO\" 5\n  fi\nelse\n  ac_cv_path_SED=$SED\nfi\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED\" >&5\n$as_echo \"$ac_cv_path_SED\" >&6; }\n SED=\"$ac_cv_path_SED\"\n  rm -f conftest.sed\n\ntest -z \"$SED\" && SED=sed\nXsed=\"$SED -e 1s/^X//\"\n\n\n\n\n\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e\" >&5\n$as_echo_n \"checking for grep that handles long lines and -e... \" >&6; }\nif ${ac_cv_path_GREP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -z \"$GREP\"; then\n  ac_path_GREP_found=false\n  # Loop through the user's path and test for each of PROGNAME-LIST\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_prog in grep ggrep; do\n    for ac_exec_ext in '' $ac_executable_extensions; do\n      ac_path_GREP=\"$as_dir/$ac_prog$ac_exec_ext\"\n      as_fn_executable_p \"$ac_path_GREP\" || continue\n# Check for GNU ac_path_GREP and select it if it is found.\n  # Check for GNU $ac_path_GREP\ncase `\"$ac_path_GREP\" --version 2>&1` in\n*GNU*)\n  ac_cv_path_GREP=\"$ac_path_GREP\" ac_path_GREP_found=:;;\n*)\n  ac_count=0\n  $as_echo_n 0123456789 >\"conftest.in\"\n  while :\n  do\n    cat \"conftest.in\" \"conftest.in\" >\"conftest.tmp\"\n    mv \"conftest.tmp\" \"conftest.in\"\n    cp \"conftest.in\" \"conftest.nl\"\n    $as_echo 'GREP' >> \"conftest.nl\"\n    \"$ac_path_GREP\" -e 'GREP$' -e '-(cannot match)-' < \"conftest.nl\" >\"conftest.out\" 2>/dev/null || break\n    diff \"conftest.out\" \"conftest.nl\" >/dev/null 2>&1 || break\n    as_fn_arith $ac_count + 1 && ac_count=$as_val\n    if test $ac_count -gt ${ac_path_GREP_max-0}; then\n      # Best one so far, save it but keep looking for a better one\n      ac_cv_path_GREP=\"$ac_path_GREP\"\n      ac_path_GREP_max=$ac_count\n    fi\n    # 10*(2^10) chars as input seems more than enough\n    test $ac_count -gt 10 && break\n  done\n  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;\nesac\n\n      $ac_path_GREP_found && break 3\n    done\n  done\n  done\nIFS=$as_save_IFS\n  if test -z \"$ac_cv_path_GREP\"; then\n    as_fn_error $? \"no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin\" \"$LINENO\" 5\n  fi\nelse\n  ac_cv_path_GREP=$GREP\nfi\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP\" >&5\n$as_echo \"$ac_cv_path_GREP\" >&6; }\n GREP=\"$ac_cv_path_GREP\"\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for egrep\" >&5\n$as_echo_n \"checking for egrep... \" >&6; }\nif ${ac_cv_path_EGREP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1\n   then ac_cv_path_EGREP=\"$GREP -E\"\n   else\n     if test -z \"$EGREP\"; then\n  ac_path_EGREP_found=false\n  # Loop through the user's path and test for each of PROGNAME-LIST\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_prog in egrep; do\n    for ac_exec_ext in '' $ac_executable_extensions; do\n      ac_path_EGREP=\"$as_dir/$ac_prog$ac_exec_ext\"\n      as_fn_executable_p \"$ac_path_EGREP\" || continue\n# Check for GNU ac_path_EGREP and select it if it is found.\n  # Check for GNU $ac_path_EGREP\ncase `\"$ac_path_EGREP\" --version 2>&1` in\n*GNU*)\n  ac_cv_path_EGREP=\"$ac_path_EGREP\" ac_path_EGREP_found=:;;\n*)\n  ac_count=0\n  $as_echo_n 0123456789 >\"conftest.in\"\n  while :\n  do\n    cat \"conftest.in\" \"conftest.in\" >\"conftest.tmp\"\n    mv \"conftest.tmp\" \"conftest.in\"\n    cp \"conftest.in\" \"conftest.nl\"\n    $as_echo 'EGREP' >> \"conftest.nl\"\n    \"$ac_path_EGREP\" 'EGREP$' < \"conftest.nl\" >\"conftest.out\" 2>/dev/null || break\n    diff \"conftest.out\" \"conftest.nl\" >/dev/null 2>&1 || break\n    as_fn_arith $ac_count + 1 && ac_count=$as_val\n    if test $ac_count -gt ${ac_path_EGREP_max-0}; then\n      # Best one so far, save it but keep looking for a better one\n      ac_cv_path_EGREP=\"$ac_path_EGREP\"\n      ac_path_EGREP_max=$ac_count\n    fi\n    # 10*(2^10) chars as input seems more than enough\n    test $ac_count -gt 10 && break\n  done\n  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;\nesac\n\n      $ac_path_EGREP_found && break 3\n    done\n  done\n  done\nIFS=$as_save_IFS\n  if test -z \"$ac_cv_path_EGREP\"; then\n    as_fn_error $? \"no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin\" \"$LINENO\" 5\n  fi\nelse\n  ac_cv_path_EGREP=$EGREP\nfi\n\n   fi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP\" >&5\n$as_echo \"$ac_cv_path_EGREP\" >&6; }\n EGREP=\"$ac_cv_path_EGREP\"\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for fgrep\" >&5\n$as_echo_n \"checking for fgrep... \" >&6; }\nif ${ac_cv_path_FGREP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1\n   then ac_cv_path_FGREP=\"$GREP -F\"\n   else\n     if test -z \"$FGREP\"; then\n  ac_path_FGREP_found=false\n  # Loop through the user's path and test for each of PROGNAME-LIST\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_prog in fgrep; do\n    for ac_exec_ext in '' $ac_executable_extensions; do\n      ac_path_FGREP=\"$as_dir/$ac_prog$ac_exec_ext\"\n      as_fn_executable_p \"$ac_path_FGREP\" || continue\n# Check for GNU ac_path_FGREP and select it if it is found.\n  # Check for GNU $ac_path_FGREP\ncase `\"$ac_path_FGREP\" --version 2>&1` in\n*GNU*)\n  ac_cv_path_FGREP=\"$ac_path_FGREP\" ac_path_FGREP_found=:;;\n*)\n  ac_count=0\n  $as_echo_n 0123456789 >\"conftest.in\"\n  while :\n  do\n    cat \"conftest.in\" \"conftest.in\" >\"conftest.tmp\"\n    mv \"conftest.tmp\" \"conftest.in\"\n    cp \"conftest.in\" \"conftest.nl\"\n    $as_echo 'FGREP' >> \"conftest.nl\"\n    \"$ac_path_FGREP\" FGREP < \"conftest.nl\" >\"conftest.out\" 2>/dev/null || break\n    diff \"conftest.out\" \"conftest.nl\" >/dev/null 2>&1 || break\n    as_fn_arith $ac_count + 1 && ac_count=$as_val\n    if test $ac_count -gt ${ac_path_FGREP_max-0}; then\n      # Best one so far, save it but keep looking for a better one\n      ac_cv_path_FGREP=\"$ac_path_FGREP\"\n      ac_path_FGREP_max=$ac_count\n    fi\n    # 10*(2^10) chars as input seems more than enough\n    test $ac_count -gt 10 && break\n  done\n  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;\nesac\n\n      $ac_path_FGREP_found && break 3\n    done\n  done\n  done\nIFS=$as_save_IFS\n  if test -z \"$ac_cv_path_FGREP\"; then\n    as_fn_error $? \"no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin\" \"$LINENO\" 5\n  fi\nelse\n  ac_cv_path_FGREP=$FGREP\nfi\n\n   fi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP\" >&5\n$as_echo \"$ac_cv_path_FGREP\" >&6; }\n FGREP=\"$ac_cv_path_FGREP\"\n\n\ntest -z \"$GREP\" && GREP=grep\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# Check whether --with-gnu-ld was given.\nif test \"${with_gnu_ld+set}\" = set; then :\n  withval=$with_gnu_ld; test no = \"$withval\" || with_gnu_ld=yes\nelse\n  with_gnu_ld=no\nfi\n\nac_prog=ld\nif test yes = \"$GCC\"; then\n  # Check if gcc -print-prog-name=ld gives a path.\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for ld used by $CC\" >&5\n$as_echo_n \"checking for ld used by $CC... \" >&6; }\n  case $host in\n  *-*-mingw*)\n    # gcc leaves a trailing carriage return, which upsets mingw\n    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\\015'` ;;\n  *)\n    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;\n  esac\n  case $ac_prog in\n    # Accept absolute paths.\n    [\\\\/]* | ?:[\\\\/]*)\n      re_direlt='/[^/][^/]*/\\.\\./'\n      # Canonicalize the pathname of ld\n      ac_prog=`$ECHO \"$ac_prog\"| $SED 's%\\\\\\\\%/%g'`\n      while $ECHO \"$ac_prog\" | $GREP \"$re_direlt\" > /dev/null 2>&1; do\n\tac_prog=`$ECHO $ac_prog| $SED \"s%$re_direlt%/%\"`\n      done\n      test -z \"$LD\" && LD=$ac_prog\n      ;;\n  \"\")\n    # If it fails, then pretend we aren't using GCC.\n    ac_prog=ld\n    ;;\n  *)\n    # If it is relative, then search for the first ld in PATH.\n    with_gnu_ld=unknown\n    ;;\n  esac\nelif test yes = \"$with_gnu_ld\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for GNU ld\" >&5\n$as_echo_n \"checking for GNU ld... \" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for non-GNU ld\" >&5\n$as_echo_n \"checking for non-GNU ld... \" >&6; }\nfi\nif ${lt_cv_path_LD+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -z \"$LD\"; then\n  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR\n  for ac_dir in $PATH; do\n    IFS=$lt_save_ifs\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f \"$ac_dir/$ac_prog\" || test -f \"$ac_dir/$ac_prog$ac_exeext\"; then\n      lt_cv_path_LD=$ac_dir/$ac_prog\n      # Check to see if the program is GNU ld.  I'd rather use --version,\n      # but apparently some variants of GNU ld only accept -v.\n      # Break only if it was the GNU/non-GNU ld that we prefer.\n      case `\"$lt_cv_path_LD\" -v 2>&1 </dev/null` in\n      *GNU* | *'with BFD'*)\n\ttest no != \"$with_gnu_ld\" && break\n\t;;\n      *)\n\ttest yes != \"$with_gnu_ld\" && break\n\t;;\n      esac\n    fi\n  done\n  IFS=$lt_save_ifs\nelse\n  lt_cv_path_LD=$LD # Let the user override the test with a path.\nfi\nfi\n\nLD=$lt_cv_path_LD\nif test -n \"$LD\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $LD\" >&5\n$as_echo \"$LD\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\ntest -z \"$LD\" && as_fn_error $? \"no acceptable ld found in \\$PATH\" \"$LINENO\" 5\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld\" >&5\n$as_echo_n \"checking if the linker ($LD) is GNU ld... \" >&6; }\nif ${lt_cv_prog_gnu_ld+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  # I'd rather use --version here, but apparently some GNU lds only accept -v.\ncase `$LD -v 2>&1 </dev/null` in\n*GNU* | *'with BFD'*)\n  lt_cv_prog_gnu_ld=yes\n  ;;\n*)\n  lt_cv_prog_gnu_ld=no\n  ;;\nesac\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld\" >&5\n$as_echo \"$lt_cv_prog_gnu_ld\" >&6; }\nwith_gnu_ld=$lt_cv_prog_gnu_ld\n\n\n\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)\" >&5\n$as_echo_n \"checking for BSD- or MS-compatible name lister (nm)... \" >&6; }\nif ${lt_cv_path_NM+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$NM\"; then\n  # Let the user override the test.\n  lt_cv_path_NM=$NM\nelse\n  lt_nm_to_check=${ac_tool_prefix}nm\n  if test -n \"$ac_tool_prefix\" && test \"$build\" = \"$host\"; then\n    lt_nm_to_check=\"$lt_nm_to_check nm\"\n  fi\n  for lt_tmp_nm in $lt_nm_to_check; do\n    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR\n    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do\n      IFS=$lt_save_ifs\n      test -z \"$ac_dir\" && ac_dir=.\n      tmp_nm=$ac_dir/$lt_tmp_nm\n      if test -f \"$tmp_nm\" || test -f \"$tmp_nm$ac_exeext\"; then\n\t# Check to see if the nm accepts a BSD-compat flag.\n\t# Adding the 'sed 1q' prevents false positives on HP-UX, which says:\n\t#   nm: unknown option \"B\" ignored\n\t# Tru64's nm complains that /dev/null is an invalid object file\n\t# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty\n\tcase $build_os in\n\tmingw*) lt_bad_file=conftest.nm/nofile ;;\n\t*) lt_bad_file=/dev/null ;;\n\tesac\n\tcase `\"$tmp_nm\" -B $lt_bad_file 2>&1 | sed '1q'` in\n\t*$lt_bad_file* | *'Invalid file or object type'*)\n\t  lt_cv_path_NM=\"$tmp_nm -B\"\n\t  break 2\n\t  ;;\n\t*)\n\t  case `\"$tmp_nm\" -p /dev/null 2>&1 | sed '1q'` in\n\t  */dev/null*)\n\t    lt_cv_path_NM=\"$tmp_nm -p\"\n\t    break 2\n\t    ;;\n\t  *)\n\t    lt_cv_path_NM=${lt_cv_path_NM=\"$tmp_nm\"} # keep the first match, but\n\t    continue # so that we can try to find one that supports BSD flags\n\t    ;;\n\t  esac\n\t  ;;\n\tesac\n      fi\n    done\n    IFS=$lt_save_ifs\n  done\n  : ${lt_cv_path_NM=no}\nfi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM\" >&5\n$as_echo \"$lt_cv_path_NM\" >&6; }\nif test no != \"$lt_cv_path_NM\"; then\n  NM=$lt_cv_path_NM\nelse\n  # Didn't find any BSD compatible name lister, look for dumpbin.\n  if test -n \"$DUMPBIN\"; then :\n    # Let the user override the test.\n  else\n    if test -n \"$ac_tool_prefix\"; then\n  for ac_prog in dumpbin \"link -dump\"\n  do\n    # Extract the first word of \"$ac_tool_prefix$ac_prog\", so it can be a program name with args.\nset dummy $ac_tool_prefix$ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_DUMPBIN+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$DUMPBIN\"; then\n  ac_cv_prog_DUMPBIN=\"$DUMPBIN\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_DUMPBIN=\"$ac_tool_prefix$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nDUMPBIN=$ac_cv_prog_DUMPBIN\nif test -n \"$DUMPBIN\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $DUMPBIN\" >&5\n$as_echo \"$DUMPBIN\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n    test -n \"$DUMPBIN\" && break\n  done\nfi\nif test -z \"$DUMPBIN\"; then\n  ac_ct_DUMPBIN=$DUMPBIN\n  for ac_prog in dumpbin \"link -dump\"\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_DUMPBIN\"; then\n  ac_cv_prog_ac_ct_DUMPBIN=\"$ac_ct_DUMPBIN\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_DUMPBIN=\"$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN\nif test -n \"$ac_ct_DUMPBIN\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN\" >&5\n$as_echo \"$ac_ct_DUMPBIN\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  test -n \"$ac_ct_DUMPBIN\" && break\ndone\n\n  if test \"x$ac_ct_DUMPBIN\" = x; then\n    DUMPBIN=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    DUMPBIN=$ac_ct_DUMPBIN\n  fi\nfi\n\n    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in\n    *COFF*)\n      DUMPBIN=\"$DUMPBIN -symbols -headers\"\n      ;;\n    *)\n      DUMPBIN=:\n      ;;\n    esac\n  fi\n\n  if test : != \"$DUMPBIN\"; then\n    NM=$DUMPBIN\n  fi\nfi\ntest -z \"$NM\" && NM=nm\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface\" >&5\n$as_echo_n \"checking the name lister ($NM) interface... \" >&6; }\nif ${lt_cv_nm_interface+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_nm_interface=\"BSD nm\"\n  echo \"int some_variable = 0;\" > conftest.$ac_ext\n  (eval echo \"\\\"\\$as_me:$LINENO: $ac_compile\\\"\" >&5)\n  (eval \"$ac_compile\" 2>conftest.err)\n  cat conftest.err >&5\n  (eval echo \"\\\"\\$as_me:$LINENO: $NM \\\\\\\"conftest.$ac_objext\\\\\\\"\\\"\" >&5)\n  (eval \"$NM \\\"conftest.$ac_objext\\\"\" 2>conftest.err > conftest.out)\n  cat conftest.err >&5\n  (eval echo \"\\\"\\$as_me:$LINENO: output\\\"\" >&5)\n  cat conftest.out >&5\n  if $GREP 'External.*some_variable' conftest.out > /dev/null; then\n    lt_cv_nm_interface=\"MS dumpbin\"\n  fi\n  rm -f conftest*\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface\" >&5\n$as_echo \"$lt_cv_nm_interface\" >&6; }\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether ln -s works\" >&5\n$as_echo_n \"checking whether ln -s works... \" >&6; }\nLN_S=$as_ln_s\nif test \"$LN_S\" = \"ln -s\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no, using $LN_S\" >&5\n$as_echo \"no, using $LN_S\" >&6; }\nfi\n\n# find the maximum length of command line arguments\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments\" >&5\n$as_echo_n \"checking the maximum length of command line arguments... \" >&6; }\nif ${lt_cv_sys_max_cmd_len+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n    i=0\n  teststring=ABCD\n\n  case $build_os in\n  msdosdjgpp*)\n    # On DJGPP, this test can blow up pretty badly due to problems in libc\n    # (any single argument exceeding 2000 bytes causes a buffer overrun\n    # during glob expansion).  Even if it were fixed, the result of this\n    # check would be larger than it should be.\n    lt_cv_sys_max_cmd_len=12288;    # 12K is about right\n    ;;\n\n  gnu*)\n    # Under GNU Hurd, this test is not required because there is\n    # no limit to the length of command line arguments.\n    # Libtool will interpret -1 as no limit whatsoever\n    lt_cv_sys_max_cmd_len=-1;\n    ;;\n\n  cygwin* | mingw* | cegcc*)\n    # On Win9x/ME, this test blows up -- it succeeds, but takes\n    # about 5 minutes as the teststring grows exponentially.\n    # Worse, since 9x/ME are not pre-emptively multitasking,\n    # you end up with a \"frozen\" computer, even though with patience\n    # the test eventually succeeds (with a max line length of 256k).\n    # Instead, let's just punt: use the minimum linelength reported by\n    # all of the supported platforms: 8192 (on NT/2K/XP).\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n  mint*)\n    # On MiNT this can take a long time and run out of memory.\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n  amigaos*)\n    # On AmigaOS with pdksh, this test takes hours, literally.\n    # So we just punt and use a minimum line length of 8192.\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)\n    # This has been around since 386BSD, at least.  Likely further.\n    if test -x /sbin/sysctl; then\n      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`\n    elif test -x /usr/sbin/sysctl; then\n      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`\n    else\n      lt_cv_sys_max_cmd_len=65536\t# usable default for all BSDs\n    fi\n    # And add a safety zone\n    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\/ 4`\n    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\* 3`\n    ;;\n\n  interix*)\n    # We know the value 262144 and hardcode it with a safety zone (like BSD)\n    lt_cv_sys_max_cmd_len=196608\n    ;;\n\n  os2*)\n    # The test takes a long time on OS/2.\n    lt_cv_sys_max_cmd_len=8192\n    ;;\n\n  osf*)\n    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure\n    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not\n    # nice to cause kernel panics so lets avoid the loop below.\n    # First set a reasonable default.\n    lt_cv_sys_max_cmd_len=16384\n    #\n    if test -x /sbin/sysconfig; then\n      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in\n        *1*) lt_cv_sys_max_cmd_len=-1 ;;\n      esac\n    fi\n    ;;\n  sco3.2v5*)\n    lt_cv_sys_max_cmd_len=102400\n    ;;\n  sysv5* | sco5v6* | sysv4.2uw2*)\n    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`\n    if test -n \"$kargmax\"; then\n      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[\t ]//'`\n    else\n      lt_cv_sys_max_cmd_len=32768\n    fi\n    ;;\n  *)\n    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`\n    if test -n \"$lt_cv_sys_max_cmd_len\" && \\\n       test undefined != \"$lt_cv_sys_max_cmd_len\"; then\n      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\/ 4`\n      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\* 3`\n    else\n      # Make teststring a little bigger before we do anything with it.\n      # a 1K string should be a reasonable start.\n      for i in 1 2 3 4 5 6 7 8; do\n        teststring=$teststring$teststring\n      done\n      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}\n      # If test is not a shell built-in, we'll probably end up computing a\n      # maximum length that is only half of the actual maximum length, but\n      # we can't tell.\n      while { test X`env echo \"$teststring$teststring\" 2>/dev/null` \\\n\t         = \"X$teststring$teststring\"; } >/dev/null 2>&1 &&\n\t      test 17 != \"$i\" # 1/2 MB should be enough\n      do\n        i=`expr $i + 1`\n        teststring=$teststring$teststring\n      done\n      # Only check the string length outside the loop.\n      lt_cv_sys_max_cmd_len=`expr \"X$teststring\" : \".*\" 2>&1`\n      teststring=\n      # Add a significant safety factor because C++ compilers can tack on\n      # massive amounts of additional arguments before passing them to the\n      # linker.  It appears as though 1/2 is a usable value.\n      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\/ 2`\n    fi\n    ;;\n  esac\n\nfi\n\nif test -n \"$lt_cv_sys_max_cmd_len\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len\" >&5\n$as_echo \"$lt_cv_sys_max_cmd_len\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: none\" >&5\n$as_echo \"none\" >&6; }\nfi\nmax_cmd_len=$lt_cv_sys_max_cmd_len\n\n\n\n\n\n\n: ${CP=\"cp -f\"}\n: ${MV=\"mv -f\"}\n: ${RM=\"rm -f\"}\n\nif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then\n  lt_unset=unset\nelse\n  lt_unset=false\nfi\n\n\n\n\n\n# test EBCDIC or ASCII\ncase `echo X|tr X '\\101'` in\n A) # ASCII based system\n    # \\n is not interpreted correctly by Solaris 8 /usr/ucb/tr\n  lt_SP2NL='tr \\040 \\012'\n  lt_NL2SP='tr \\015\\012 \\040\\040'\n  ;;\n *) # EBCDIC based system\n  lt_SP2NL='tr \\100 \\n'\n  lt_NL2SP='tr \\r\\n \\100\\100'\n  ;;\nesac\n\n\n\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format\" >&5\n$as_echo_n \"checking how to convert $build file names to $host format... \" >&6; }\nif ${lt_cv_to_host_file_cmd+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  case $host in\n  *-*-mingw* )\n    case $build in\n      *-*-mingw* ) # actually msys\n        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32\n        ;;\n      *-*-cygwin* )\n        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32\n        ;;\n      * ) # otherwise, assume *nix\n        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32\n        ;;\n    esac\n    ;;\n  *-*-cygwin* )\n    case $build in\n      *-*-mingw* ) # actually msys\n        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin\n        ;;\n      *-*-cygwin* )\n        lt_cv_to_host_file_cmd=func_convert_file_noop\n        ;;\n      * ) # otherwise, assume *nix\n        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin\n        ;;\n    esac\n    ;;\n  * ) # unhandled hosts (and \"normal\" native builds)\n    lt_cv_to_host_file_cmd=func_convert_file_noop\n    ;;\nesac\n\nfi\n\nto_host_file_cmd=$lt_cv_to_host_file_cmd\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd\" >&5\n$as_echo \"$lt_cv_to_host_file_cmd\" >&6; }\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format\" >&5\n$as_echo_n \"checking how to convert $build file names to toolchain format... \" >&6; }\nif ${lt_cv_to_tool_file_cmd+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  #assume ordinary cross tools, or native build.\nlt_cv_to_tool_file_cmd=func_convert_file_noop\ncase $host in\n  *-*-mingw* )\n    case $build in\n      *-*-mingw* ) # actually msys\n        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32\n        ;;\n    esac\n    ;;\nesac\n\nfi\n\nto_tool_file_cmd=$lt_cv_to_tool_file_cmd\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd\" >&5\n$as_echo \"$lt_cv_to_tool_file_cmd\" >&6; }\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files\" >&5\n$as_echo_n \"checking for $LD option to reload object files... \" >&6; }\nif ${lt_cv_ld_reload_flag+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_ld_reload_flag='-r'\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag\" >&5\n$as_echo \"$lt_cv_ld_reload_flag\" >&6; }\nreload_flag=$lt_cv_ld_reload_flag\ncase $reload_flag in\n\"\" | \" \"*) ;;\n*) reload_flag=\" $reload_flag\" ;;\nesac\nreload_cmds='$LD$reload_flag -o $output$reload_objs'\ncase $host_os in\n  cygwin* | mingw* | pw32* | cegcc*)\n    if test yes != \"$GCC\"; then\n      reload_cmds=false\n    fi\n    ;;\n  darwin*)\n    if test yes = \"$GCC\"; then\n      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'\n    else\n      reload_cmds='$LD$reload_flag -o $output$reload_objs'\n    fi\n    ;;\nesac\n\n\n\n\n\n\n\n\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}objdump\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}objdump; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_OBJDUMP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$OBJDUMP\"; then\n  ac_cv_prog_OBJDUMP=\"$OBJDUMP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_OBJDUMP=\"${ac_tool_prefix}objdump\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nOBJDUMP=$ac_cv_prog_OBJDUMP\nif test -n \"$OBJDUMP\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $OBJDUMP\" >&5\n$as_echo \"$OBJDUMP\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_OBJDUMP\"; then\n  ac_ct_OBJDUMP=$OBJDUMP\n  # Extract the first word of \"objdump\", so it can be a program name with args.\nset dummy objdump; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_OBJDUMP\"; then\n  ac_cv_prog_ac_ct_OBJDUMP=\"$ac_ct_OBJDUMP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_OBJDUMP=\"objdump\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP\nif test -n \"$ac_ct_OBJDUMP\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP\" >&5\n$as_echo \"$ac_ct_OBJDUMP\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_OBJDUMP\" = x; then\n    OBJDUMP=\"false\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    OBJDUMP=$ac_ct_OBJDUMP\n  fi\nelse\n  OBJDUMP=\"$ac_cv_prog_OBJDUMP\"\nfi\n\ntest -z \"$OBJDUMP\" && OBJDUMP=objdump\n\n\n\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries\" >&5\n$as_echo_n \"checking how to recognize dependent libraries... \" >&6; }\nif ${lt_cv_deplibs_check_method+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_file_magic_cmd='$MAGIC_CMD'\nlt_cv_file_magic_test_file=\nlt_cv_deplibs_check_method='unknown'\n# Need to set the preceding variable on all platforms that support\n# interlibrary dependencies.\n# 'none' -- dependencies not supported.\n# 'unknown' -- same as none, but documents that we really don't know.\n# 'pass_all' -- all dependencies passed with no checks.\n# 'test_compile' -- check by making test program.\n# 'file_magic [[regex]]' -- check by looking for files in library path\n# that responds to the $file_magic_cmd with a given extended regex.\n# If you have 'file' or equivalent on your system and you're not sure\n# whether 'pass_all' will *always* work, you probably want this one.\n\ncase $host_os in\naix[4-9]*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nbeos*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nbsdi[45]*)\n  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'\n  lt_cv_file_magic_cmd='/usr/bin/file -L'\n  lt_cv_file_magic_test_file=/shlib/libc.so\n  ;;\n\ncygwin*)\n  # func_win32_libid is a shell function defined in ltmain.sh\n  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'\n  lt_cv_file_magic_cmd='func_win32_libid'\n  ;;\n\nmingw* | pw32*)\n  # Base MSYS/MinGW do not provide the 'file' command needed by\n  # func_win32_libid shell function, so use a weaker test based on 'objdump',\n  # unless we find 'file', for example because we are cross-compiling.\n  if ( file / ) >/dev/null 2>&1; then\n    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'\n    lt_cv_file_magic_cmd='func_win32_libid'\n  else\n    # Keep this pattern in sync with the one in func_win32_libid.\n    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'\n    lt_cv_file_magic_cmd='$OBJDUMP -f'\n  fi\n  ;;\n\ncegcc*)\n  # use the weaker test based on 'objdump'. See mingw*.\n  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'\n  lt_cv_file_magic_cmd='$OBJDUMP -f'\n  ;;\n\ndarwin* | rhapsody*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nfreebsd* | dragonfly*)\n  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then\n    case $host_cpu in\n    i*86 )\n      # Not sure whether the presence of OpenBSD here was a mistake.\n      # Let's accept both of them until this is cleared up.\n      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'\n      lt_cv_file_magic_cmd=/usr/bin/file\n      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`\n      ;;\n    esac\n  else\n    lt_cv_deplibs_check_method=pass_all\n  fi\n  ;;\n\nhaiku*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nhpux10.20* | hpux11*)\n  lt_cv_file_magic_cmd=/usr/bin/file\n  case $host_cpu in\n  ia64*)\n    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'\n    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so\n    ;;\n  hppa*64*)\n    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\\.[0-9]'\n    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl\n    ;;\n  *)\n    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\\.[0-9]) shared library'\n    lt_cv_file_magic_test_file=/usr/lib/libc.sl\n    ;;\n  esac\n  ;;\n\ninterix[3-9]*)\n  # PIC code is broken on Interix 3.x, that's why |\\.a not |_pic\\.a here\n  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\\.so|\\.a)$'\n  ;;\n\nirix5* | irix6* | nonstopux*)\n  case $LD in\n  *-32|*\"-32 \") libmagic=32-bit;;\n  *-n32|*\"-n32 \") libmagic=N32;;\n  *-64|*\"-64 \") libmagic=64-bit;;\n  *) libmagic=never-match;;\n  esac\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\n# This must be glibc/ELF.\nlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nnetbsd*)\n  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then\n    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\\.so\\.[0-9]+\\.[0-9]+|_pic\\.a)$'\n  else\n    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\\.so|_pic\\.a)$'\n  fi\n  ;;\n\nnewos6*)\n  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'\n  lt_cv_file_magic_cmd=/usr/bin/file\n  lt_cv_file_magic_test_file=/usr/lib/libnls.so\n  ;;\n\n*nto* | *qnx*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nopenbsd* | bitrig*)\n  if test -z \"`echo __ELF__ | $CC -E - | $GREP __ELF__`\"; then\n    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\\.so\\.[0-9]+\\.[0-9]+|\\.so|_pic\\.a)$'\n  else\n    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\\.so\\.[0-9]+\\.[0-9]+|_pic\\.a)$'\n  fi\n  ;;\n\nosf3* | osf4* | osf5*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nrdos*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsolaris*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsysv4 | sysv4.3*)\n  case $host_vendor in\n  motorola)\n    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'\n    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`\n    ;;\n  ncr)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  sequent)\n    lt_cv_file_magic_cmd='/bin/file'\n    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'\n    ;;\n  sni)\n    lt_cv_file_magic_cmd='/bin/file'\n    lt_cv_deplibs_check_method=\"file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib\"\n    lt_cv_file_magic_test_file=/lib/libc.so\n    ;;\n  siemens)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  pc)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  esac\n  ;;\n\ntpf*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\nos2*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\nesac\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method\" >&5\n$as_echo \"$lt_cv_deplibs_check_method\" >&6; }\n\nfile_magic_glob=\nwant_nocaseglob=no\nif test \"$build\" = \"$host\"; then\n  case $host_os in\n  mingw* | pw32*)\n    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then\n      want_nocaseglob=yes\n    else\n      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e \"s/\\(..\\)/s\\/[\\1]\\/[\\1]\\/g;/g\"`\n    fi\n    ;;\n  esac\nfi\n\nfile_magic_cmd=$lt_cv_file_magic_cmd\ndeplibs_check_method=$lt_cv_deplibs_check_method\ntest -z \"$deplibs_check_method\" && deplibs_check_method=unknown\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}dlltool\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}dlltool; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_DLLTOOL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$DLLTOOL\"; then\n  ac_cv_prog_DLLTOOL=\"$DLLTOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_DLLTOOL=\"${ac_tool_prefix}dlltool\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nDLLTOOL=$ac_cv_prog_DLLTOOL\nif test -n \"$DLLTOOL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $DLLTOOL\" >&5\n$as_echo \"$DLLTOOL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_DLLTOOL\"; then\n  ac_ct_DLLTOOL=$DLLTOOL\n  # Extract the first word of \"dlltool\", so it can be a program name with args.\nset dummy dlltool; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_DLLTOOL\"; then\n  ac_cv_prog_ac_ct_DLLTOOL=\"$ac_ct_DLLTOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_DLLTOOL=\"dlltool\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL\nif test -n \"$ac_ct_DLLTOOL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL\" >&5\n$as_echo \"$ac_ct_DLLTOOL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_DLLTOOL\" = x; then\n    DLLTOOL=\"false\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    DLLTOOL=$ac_ct_DLLTOOL\n  fi\nelse\n  DLLTOOL=\"$ac_cv_prog_DLLTOOL\"\nfi\n\ntest -z \"$DLLTOOL\" && DLLTOOL=dlltool\n\n\n\n\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries\" >&5\n$as_echo_n \"checking how to associate runtime and link libraries... \" >&6; }\nif ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_sharedlib_from_linklib_cmd='unknown'\n\ncase $host_os in\ncygwin* | mingw* | pw32* | cegcc*)\n  # two different shell functions defined in ltmain.sh;\n  # decide which one to use based on capabilities of $DLLTOOL\n  case `$DLLTOOL --help 2>&1` in\n  *--identify-strict*)\n    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib\n    ;;\n  *)\n    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback\n    ;;\n  esac\n  ;;\n*)\n  # fallback: assume linklib IS sharedlib\n  lt_cv_sharedlib_from_linklib_cmd=$ECHO\n  ;;\nesac\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd\" >&5\n$as_echo \"$lt_cv_sharedlib_from_linklib_cmd\" >&6; }\nsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd\ntest -z \"$sharedlib_from_linklib_cmd\" && sharedlib_from_linklib_cmd=$ECHO\n\n\n\n\n\n\n\nif test -n \"$ac_tool_prefix\"; then\n  for ac_prog in ar\n  do\n    # Extract the first word of \"$ac_tool_prefix$ac_prog\", so it can be a program name with args.\nset dummy $ac_tool_prefix$ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_AR+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$AR\"; then\n  ac_cv_prog_AR=\"$AR\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_AR=\"$ac_tool_prefix$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nAR=$ac_cv_prog_AR\nif test -n \"$AR\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $AR\" >&5\n$as_echo \"$AR\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n    test -n \"$AR\" && break\n  done\nfi\nif test -z \"$AR\"; then\n  ac_ct_AR=$AR\n  for ac_prog in ar\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_AR+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_AR\"; then\n  ac_cv_prog_ac_ct_AR=\"$ac_ct_AR\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_AR=\"$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_AR=$ac_cv_prog_ac_ct_AR\nif test -n \"$ac_ct_AR\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR\" >&5\n$as_echo \"$ac_ct_AR\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  test -n \"$ac_ct_AR\" && break\ndone\n\n  if test \"x$ac_ct_AR\" = x; then\n    AR=\"false\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    AR=$ac_ct_AR\n  fi\nfi\n\n: ${AR=ar}\n: ${AR_FLAGS=cru}\n\n\n\n\n\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support\" >&5\n$as_echo_n \"checking for archiver @FILE support... \" >&6; }\nif ${lt_cv_ar_at_file+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_ar_at_file=no\n   cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  echo conftest.$ac_objext > conftest.lst\n      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'\n      { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$lt_ar_try\\\"\"; } >&5\n  (eval $lt_ar_try) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n      if test 0 -eq \"$ac_status\"; then\n\t# Ensure the archiver fails upon bogus file names.\n\trm -f conftest.$ac_objext libconftest.a\n\t{ { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$lt_ar_try\\\"\"; } >&5\n  (eval $lt_ar_try) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n\tif test 0 -ne \"$ac_status\"; then\n          lt_cv_ar_at_file=@\n        fi\n      fi\n      rm -f conftest.* libconftest.a\n\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file\" >&5\n$as_echo \"$lt_cv_ar_at_file\" >&6; }\n\nif test no = \"$lt_cv_ar_at_file\"; then\n  archiver_list_spec=\nelse\n  archiver_list_spec=$lt_cv_ar_at_file\nfi\n\n\n\n\n\n\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}strip\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}strip; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_STRIP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$STRIP\"; then\n  ac_cv_prog_STRIP=\"$STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_STRIP=\"${ac_tool_prefix}strip\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nSTRIP=$ac_cv_prog_STRIP\nif test -n \"$STRIP\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $STRIP\" >&5\n$as_echo \"$STRIP\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_STRIP\"; then\n  ac_ct_STRIP=$STRIP\n  # Extract the first word of \"strip\", so it can be a program name with args.\nset dummy strip; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_STRIP+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_STRIP\"; then\n  ac_cv_prog_ac_ct_STRIP=\"$ac_ct_STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_STRIP=\"strip\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP\nif test -n \"$ac_ct_STRIP\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP\" >&5\n$as_echo \"$ac_ct_STRIP\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_STRIP\" = x; then\n    STRIP=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    STRIP=$ac_ct_STRIP\n  fi\nelse\n  STRIP=\"$ac_cv_prog_STRIP\"\nfi\n\ntest -z \"$STRIP\" && STRIP=:\n\n\n\n\n\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}ranlib\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}ranlib; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_RANLIB+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$RANLIB\"; then\n  ac_cv_prog_RANLIB=\"$RANLIB\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_RANLIB=\"${ac_tool_prefix}ranlib\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nRANLIB=$ac_cv_prog_RANLIB\nif test -n \"$RANLIB\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $RANLIB\" >&5\n$as_echo \"$RANLIB\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_RANLIB\"; then\n  ac_ct_RANLIB=$RANLIB\n  # Extract the first word of \"ranlib\", so it can be a program name with args.\nset dummy ranlib; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_RANLIB+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_RANLIB\"; then\n  ac_cv_prog_ac_ct_RANLIB=\"$ac_ct_RANLIB\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_RANLIB=\"ranlib\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB\nif test -n \"$ac_ct_RANLIB\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB\" >&5\n$as_echo \"$ac_ct_RANLIB\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_RANLIB\" = x; then\n    RANLIB=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    RANLIB=$ac_ct_RANLIB\n  fi\nelse\n  RANLIB=\"$ac_cv_prog_RANLIB\"\nfi\n\ntest -z \"$RANLIB\" && RANLIB=:\n\n\n\n\n\n\n# Determine commands to create old-style static archives.\nold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'\nold_postinstall_cmds='chmod 644 $oldlib'\nold_postuninstall_cmds=\n\nif test -n \"$RANLIB\"; then\n  case $host_os in\n  bitrig* | openbsd*)\n    old_postinstall_cmds=\"$old_postinstall_cmds~\\$RANLIB -t \\$tool_oldlib\"\n    ;;\n  *)\n    old_postinstall_cmds=\"$old_postinstall_cmds~\\$RANLIB \\$tool_oldlib\"\n    ;;\n  esac\n  old_archive_cmds=\"$old_archive_cmds~\\$RANLIB \\$tool_oldlib\"\nfi\n\ncase $host_os in\n  darwin*)\n    lock_old_archive_extraction=yes ;;\n  *)\n    lock_old_archive_extraction=no ;;\nesac\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# If no C compiler was specified, use CC.\nLTCC=${LTCC-\"$CC\"}\n\n# If no C compiler flags were specified, use CFLAGS.\nLTCFLAGS=${LTCFLAGS-\"$CFLAGS\"}\n\n# Allow CC to be a program name with arguments.\ncompiler=$CC\n\n\n# Check for command to grab the raw symbol name followed by C symbol from nm.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object\" >&5\n$as_echo_n \"checking command to parse $NM output from $compiler object... \" >&6; }\nif ${lt_cv_sys_global_symbol_pipe+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n\n# These are sane defaults that work on at least a few old systems.\n# [They come from Ultrix.  What could be older than Ultrix?!! ;)]\n\n# Character class describing NM global symbol codes.\nsymcode='[BCDEGRST]'\n\n# Regexp to match symbols that can be accessed directly from C.\nsympat='\\([_A-Za-z][_A-Za-z0-9]*\\)'\n\n# Define system-specific variables.\ncase $host_os in\naix*)\n  symcode='[BCDT]'\n  ;;\ncygwin* | mingw* | pw32* | cegcc*)\n  symcode='[ABCDGISTW]'\n  ;;\nhpux*)\n  if test ia64 = \"$host_cpu\"; then\n    symcode='[ABCDEGRST]'\n  fi\n  ;;\nirix* | nonstopux*)\n  symcode='[BCDEGRST]'\n  ;;\nosf*)\n  symcode='[BCDEGQRST]'\n  ;;\nsolaris*)\n  symcode='[BDRT]'\n  ;;\nsco3.2v5*)\n  symcode='[DT]'\n  ;;\nsysv4.2uw2*)\n  symcode='[DT]'\n  ;;\nsysv5* | sco5v6* | unixware* | OpenUNIX*)\n  symcode='[ABDT]'\n  ;;\nsysv4)\n  symcode='[DFNSTU]'\n  ;;\nesac\n\n# If we're using GNU nm, then use its standard symbol codes.\ncase `$NM -V 2>&1` in\n*GNU* | *'with BFD'*)\n  symcode='[ABCDGIRSTW]' ;;\nesac\n\nif test \"$lt_cv_nm_interface\" = \"MS dumpbin\"; then\n  # Gets list of data symbols to import.\n  lt_cv_sys_global_symbol_to_import=\"sed -n -e 's/^I .* \\(.*\\)$/\\1/p'\"\n  # Adjust the below global symbol transforms to fixup imported variables.\n  lt_cdecl_hook=\" -e 's/^I .* \\(.*\\)$/extern __declspec(dllimport) char \\1;/p'\"\n  lt_c_name_hook=\" -e 's/^I .* \\(.*\\)$/  {\\\"\\1\\\", (void *) 0},/p'\"\n  lt_c_name_lib_hook=\"\\\n  -e 's/^I .* \\(lib.*\\)$/  {\\\"\\1\\\", (void *) 0},/p'\\\n  -e 's/^I .* \\(.*\\)$/  {\\\"lib\\1\\\", (void *) 0},/p'\"\nelse\n  # Disable hooks by default.\n  lt_cv_sys_global_symbol_to_import=\n  lt_cdecl_hook=\n  lt_c_name_hook=\n  lt_c_name_lib_hook=\nfi\n\n# Transform an extracted symbol line into a proper C declaration.\n# Some systems (esp. on ia64) link data and code symbols differently,\n# so use this general approach.\nlt_cv_sys_global_symbol_to_cdecl=\"sed -n\"\\\n$lt_cdecl_hook\\\n\" -e 's/^T .* \\(.*\\)$/extern int \\1();/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(.*\\)$/extern char \\1;/p'\"\n\n# Transform an extracted symbol line into symbol name and symbol address\nlt_cv_sys_global_symbol_to_c_name_address=\"sed -n\"\\\n$lt_c_name_hook\\\n\" -e 's/^: \\(.*\\) .*$/  {\\\"\\1\\\", (void *) 0},/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(.*\\)$/  {\\\"\\1\\\", (void *) \\&\\1},/p'\"\n\n# Transform an extracted symbol line into symbol name with lib prefix and\n# symbol address.\nlt_cv_sys_global_symbol_to_c_name_address_lib_prefix=\"sed -n\"\\\n$lt_c_name_lib_hook\\\n\" -e 's/^: \\(.*\\) .*$/  {\\\"\\1\\\", (void *) 0},/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(lib.*\\)$/  {\\\"\\1\\\", (void *) \\&\\1},/p'\"\\\n\" -e 's/^$symcode$symcode* .* \\(.*\\)$/  {\\\"lib\\1\\\", (void *) \\&\\1},/p'\"\n\n# Handle CRLF in mingw tool chain\nopt_cr=\ncase $build_os in\nmingw*)\n  opt_cr=`$ECHO 'x\\{0,1\\}' | tr x '\\015'` # option cr in regexp\n  ;;\nesac\n\n# Try without a prefix underscore, then with it.\nfor ac_symprfx in \"\" \"_\"; do\n\n  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.\n  symxfrm=\"\\\\1 $ac_symprfx\\\\2 \\\\2\"\n\n  # Write the raw and C identifiers.\n  if test \"$lt_cv_nm_interface\" = \"MS dumpbin\"; then\n    # Fake it for dumpbin and say T for any non-static function,\n    # D for any global variable and I for any imported variable.\n    # Also find C++ and __fastcall symbols from MSVC++,\n    # which start with @ or ?.\n    lt_cv_sys_global_symbol_pipe=\"$AWK '\"\\\n\"     {last_section=section; section=\\$ 3};\"\\\n\"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};\"\\\n\"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};\"\\\n\"     /^ *Symbol name *: /{split(\\$ 0,sn,\\\":\\\"); si=substr(sn[2],2)};\"\\\n\"     /^ *Type *: code/{print \\\"T\\\",si,substr(si,length(prfx))};\"\\\n\"     /^ *Type *: data/{print \\\"I\\\",si,substr(si,length(prfx))};\"\\\n\"     \\$ 0!~/External *\\|/{next};\"\\\n\"     / 0+ UNDEF /{next}; / UNDEF \\([^|]\\)*()/{next};\"\\\n\"     {if(hide[section]) next};\"\\\n\"     {f=\\\"D\\\"}; \\$ 0~/\\(\\).*\\|/{f=\\\"T\\\"};\"\\\n\"     {split(\\$ 0,a,/\\||\\r/); split(a[2],s)};\"\\\n\"     s[1]~/^[@?]/{print f,s[1],s[1]; next};\"\\\n\"     s[1]~prfx {split(s[1],t,\\\"@\\\"); print f,t[1],substr(t[1],length(prfx))}\"\\\n\"     ' prfx=^$ac_symprfx\"\n  else\n    lt_cv_sys_global_symbol_pipe=\"sed -n -e 's/^.*[\t ]\\($symcode$symcode*\\)[\t ][\t ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'\"\n  fi\n  lt_cv_sys_global_symbol_pipe=\"$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'\"\n\n  # Check to see that the pipe works correctly.\n  pipe_works=no\n\n  rm -f conftest*\n  cat > conftest.$ac_ext <<_LT_EOF\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nchar nm_test_var;\nvoid nm_test_func(void);\nvoid nm_test_func(void){}\n#ifdef __cplusplus\n}\n#endif\nint main(){nm_test_var='a';nm_test_func();return(0);}\n_LT_EOF\n\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_compile\\\"\"; } >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then\n    # Now try to grab the symbols.\n    nlist=conftest.nm\n    if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$NM conftest.$ac_objext \\| \"$lt_cv_sys_global_symbol_pipe\" \\> $nlist\\\"\"; } >&5\n  (eval $NM conftest.$ac_objext \\| \"$lt_cv_sys_global_symbol_pipe\" \\> $nlist) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && test -s \"$nlist\"; then\n      # Try sorting and uniquifying the output.\n      if sort \"$nlist\" | uniq > \"$nlist\"T; then\n\tmv -f \"$nlist\"T \"$nlist\"\n      else\n\trm -f \"$nlist\"T\n      fi\n\n      # Make sure that we snagged all the symbols we need.\n      if $GREP ' nm_test_var$' \"$nlist\" >/dev/null; then\n\tif $GREP ' nm_test_func$' \"$nlist\" >/dev/null; then\n\t  cat <<_LT_EOF > conftest.$ac_ext\n/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */\n#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE\n/* DATA imports from DLLs on WIN32 can't be const, because runtime\n   relocations are performed -- see ld's documentation on pseudo-relocs.  */\n# define LT_DLSYM_CONST\n#elif defined __osf__\n/* This system does not cope well with relocations in const data.  */\n# define LT_DLSYM_CONST\n#else\n# define LT_DLSYM_CONST const\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n_LT_EOF\n\t  # Now generate the symbol file.\n\t  eval \"$lt_cv_sys_global_symbol_to_cdecl\"' < \"$nlist\" | $GREP -v main >> conftest.$ac_ext'\n\n\t  cat <<_LT_EOF >> conftest.$ac_ext\n\n/* The mapping between symbol names and symbols.  */\nLT_DLSYM_CONST struct {\n  const char *name;\n  void       *address;\n}\nlt__PROGRAM__LTX_preloaded_symbols[] =\n{\n  { \"@PROGRAM@\", (void *) 0 },\n_LT_EOF\n\t  $SED \"s/^$symcode$symcode* .* \\(.*\\)$/  {\\\"\\1\\\", (void *) \\&\\1},/\" < \"$nlist\" | $GREP -v main >> conftest.$ac_ext\n\t  cat <<\\_LT_EOF >> conftest.$ac_ext\n  {0, (void *) 0}\n};\n\n/* This works around a problem in FreeBSD linker */\n#ifdef FREEBSD_WORKAROUND\nstatic const void *lt_preloaded_setup() {\n  return lt__PROGRAM__LTX_preloaded_symbols;\n}\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n_LT_EOF\n\t  # Now try linking the two files.\n\t  mv conftest.$ac_objext conftstm.$ac_objext\n\t  lt_globsym_save_LIBS=$LIBS\n\t  lt_globsym_save_CFLAGS=$CFLAGS\n\t  LIBS=conftstm.$ac_objext\n\t  CFLAGS=\"$CFLAGS$lt_prog_compiler_no_builtin_flag\"\n\t  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_link\\\"\"; } >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && test -s conftest$ac_exeext; then\n\t    pipe_works=yes\n\t  fi\n\t  LIBS=$lt_globsym_save_LIBS\n\t  CFLAGS=$lt_globsym_save_CFLAGS\n\telse\n\t  echo \"cannot find nm_test_func in $nlist\" >&5\n\tfi\n      else\n\techo \"cannot find nm_test_var in $nlist\" >&5\n      fi\n    else\n      echo \"cannot run $lt_cv_sys_global_symbol_pipe\" >&5\n    fi\n  else\n    echo \"$progname: failed program was:\" >&5\n    cat conftest.$ac_ext >&5\n  fi\n  rm -rf conftest* conftst*\n\n  # Do not use the global_symbol_pipe unless it works.\n  if test yes = \"$pipe_works\"; then\n    break\n  else\n    lt_cv_sys_global_symbol_pipe=\n  fi\ndone\n\nfi\n\nif test -z \"$lt_cv_sys_global_symbol_pipe\"; then\n  lt_cv_sys_global_symbol_to_cdecl=\nfi\nif test -z \"$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: failed\" >&5\n$as_echo \"failed\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: ok\" >&5\n$as_echo \"ok\" >&6; }\nfi\n\n# Response file support.\nif test \"$lt_cv_nm_interface\" = \"MS dumpbin\"; then\n  nm_file_list_spec='@'\nelif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then\n  nm_file_list_spec='@'\nfi\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for sysroot\" >&5\n$as_echo_n \"checking for sysroot... \" >&6; }\n\n# Check whether --with-sysroot was given.\nif test \"${with_sysroot+set}\" = set; then :\n  withval=$with_sysroot;\nelse\n  with_sysroot=no\nfi\n\n\nlt_sysroot=\ncase $with_sysroot in #(\n yes)\n   if test yes = \"$GCC\"; then\n     lt_sysroot=`$CC --print-sysroot 2>/dev/null`\n   fi\n   ;; #(\n /*)\n   lt_sysroot=`echo \"$with_sysroot\" | sed -e \"$sed_quote_subst\"`\n   ;; #(\n no|'')\n   ;; #(\n *)\n   { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $with_sysroot\" >&5\n$as_echo \"$with_sysroot\" >&6; }\n   as_fn_error $? \"The sysroot must be an absolute path.\" \"$LINENO\" 5\n   ;;\nesac\n\n { $as_echo \"$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}\" >&5\n$as_echo \"${lt_sysroot:-no}\" >&6; }\n\n\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for a working dd\" >&5\n$as_echo_n \"checking for a working dd... \" >&6; }\nif ${ac_cv_path_lt_DD+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  printf 0123456789abcdef0123456789abcdef >conftest.i\ncat conftest.i conftest.i >conftest2.i\n: ${lt_DD:=$DD}\nif test -z \"$lt_DD\"; then\n  ac_path_lt_DD_found=false\n  # Loop through the user's path and test for each of PROGNAME-LIST\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_prog in dd; do\n    for ac_exec_ext in '' $ac_executable_extensions; do\n      ac_path_lt_DD=\"$as_dir/$ac_prog$ac_exec_ext\"\n      as_fn_executable_p \"$ac_path_lt_DD\" || continue\nif \"$ac_path_lt_DD\" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then\n  cmp -s conftest.i conftest.out \\\n  && ac_cv_path_lt_DD=\"$ac_path_lt_DD\" ac_path_lt_DD_found=:\nfi\n      $ac_path_lt_DD_found && break 3\n    done\n  done\n  done\nIFS=$as_save_IFS\n  if test -z \"$ac_cv_path_lt_DD\"; then\n    :\n  fi\nelse\n  ac_cv_path_lt_DD=$lt_DD\nfi\n\nrm -f conftest.i conftest2.i conftest.out\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD\" >&5\n$as_echo \"$ac_cv_path_lt_DD\" >&6; }\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes\" >&5\n$as_echo_n \"checking how to truncate binary pipes... \" >&6; }\nif ${lt_cv_truncate_bin+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  printf 0123456789abcdef0123456789abcdef >conftest.i\ncat conftest.i conftest.i >conftest2.i\nlt_cv_truncate_bin=\nif \"$ac_cv_path_lt_DD\" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then\n  cmp -s conftest.i conftest.out \\\n  && lt_cv_truncate_bin=\"$ac_cv_path_lt_DD bs=4096 count=1\"\nfi\nrm -f conftest.i conftest2.i conftest.out\ntest -z \"$lt_cv_truncate_bin\" && lt_cv_truncate_bin=\"$SED -e 4q\"\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin\" >&5\n$as_echo \"$lt_cv_truncate_bin\" >&6; }\n\n\n\n\n\n\n\n# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.\nfunc_cc_basename ()\n{\n    for cc_temp in $*\"\"; do\n      case $cc_temp in\n        compile | *[\\\\/]compile | ccache | *[\\\\/]ccache ) ;;\n        distcc | *[\\\\/]distcc | purify | *[\\\\/]purify ) ;;\n        \\-*) ;;\n        *) break;;\n      esac\n    done\n    func_cc_basename_result=`$ECHO \"$cc_temp\" | $SED \"s%.*/%%; s%^$host_alias-%%\"`\n}\n\n# Check whether --enable-libtool-lock was given.\nif test \"${enable_libtool_lock+set}\" = set; then :\n  enableval=$enable_libtool_lock;\nfi\n\ntest no = \"$enable_libtool_lock\" || enable_libtool_lock=yes\n\n# Some flags need to be propagated to the compiler or linker for good\n# libtool support.\ncase $host in\nia64-*-hpux*)\n  # Find out what ABI is being produced by ac_compile, and set mode\n  # options accordingly.\n  echo 'int i;' > conftest.$ac_ext\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_compile\\\"\"; } >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then\n    case `/usr/bin/file conftest.$ac_objext` in\n      *ELF-32*)\n\tHPUX_IA64_MODE=32\n\t;;\n      *ELF-64*)\n\tHPUX_IA64_MODE=64\n\t;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\n*-*-irix6*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.\n  echo '#line '$LINENO' \"configure\"' > conftest.$ac_ext\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_compile\\\"\"; } >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then\n    if test yes = \"$lt_cv_prog_gnu_ld\"; then\n      case `/usr/bin/file conftest.$ac_objext` in\n\t*32-bit*)\n\t  LD=\"${LD-ld} -melf32bsmip\"\n\t  ;;\n\t*N32*)\n\t  LD=\"${LD-ld} -melf32bmipn32\"\n\t  ;;\n\t*64-bit*)\n\t  LD=\"${LD-ld} -melf64bmip\"\n\t;;\n      esac\n    else\n      case `/usr/bin/file conftest.$ac_objext` in\n\t*32-bit*)\n\t  LD=\"${LD-ld} -32\"\n\t  ;;\n\t*N32*)\n\t  LD=\"${LD-ld} -n32\"\n\t  ;;\n\t*64-bit*)\n\t  LD=\"${LD-ld} -64\"\n\t  ;;\n      esac\n    fi\n  fi\n  rm -rf conftest*\n  ;;\n\nmips64*-*linux*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.\n  echo '#line '$LINENO' \"configure\"' > conftest.$ac_ext\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_compile\\\"\"; } >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then\n    emul=elf\n    case `/usr/bin/file conftest.$ac_objext` in\n      *32-bit*)\n\temul=\"${emul}32\"\n\t;;\n      *64-bit*)\n\temul=\"${emul}64\"\n\t;;\n    esac\n    case `/usr/bin/file conftest.$ac_objext` in\n      *MSB*)\n\temul=\"${emul}btsmip\"\n\t;;\n      *LSB*)\n\temul=\"${emul}ltsmip\"\n\t;;\n    esac\n    case `/usr/bin/file conftest.$ac_objext` in\n      *N32*)\n\temul=\"${emul}n32\"\n\t;;\n    esac\n    LD=\"${LD-ld} -m $emul\"\n  fi\n  rm -rf conftest*\n  ;;\n\nx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \\\ns390*-*linux*|s390*-*tpf*|sparc*-*linux*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.  Note that the listed cases only cover the\n  # situations where additional linker options are needed (such as when\n  # doing 32-bit compilation for a host where ld defaults to 64-bit, or\n  # vice versa); the common cases where no linker options are needed do\n  # not appear in the list.\n  echo 'int i;' > conftest.$ac_ext\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_compile\\\"\"; } >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then\n    case `/usr/bin/file conftest.o` in\n      *32-bit*)\n\tcase $host in\n\t  x86_64-*kfreebsd*-gnu)\n\t    LD=\"${LD-ld} -m elf_i386_fbsd\"\n\t    ;;\n\t  x86_64-*linux*)\n\t    case `/usr/bin/file conftest.o` in\n\t      *x86-64*)\n\t\tLD=\"${LD-ld} -m elf32_x86_64\"\n\t\t;;\n\t      *)\n\t\tLD=\"${LD-ld} -m elf_i386\"\n\t\t;;\n\t    esac\n\t    ;;\n\t  powerpc64le-*linux*)\n\t    LD=\"${LD-ld} -m elf32lppclinux\"\n\t    ;;\n\t  powerpc64-*linux*)\n\t    LD=\"${LD-ld} -m elf32ppclinux\"\n\t    ;;\n\t  s390x-*linux*)\n\t    LD=\"${LD-ld} -m elf_s390\"\n\t    ;;\n\t  sparc64-*linux*)\n\t    LD=\"${LD-ld} -m elf32_sparc\"\n\t    ;;\n\tesac\n\t;;\n      *64-bit*)\n\tcase $host in\n\t  x86_64-*kfreebsd*-gnu)\n\t    LD=\"${LD-ld} -m elf_x86_64_fbsd\"\n\t    ;;\n\t  x86_64-*linux*)\n\t    LD=\"${LD-ld} -m elf_x86_64\"\n\t    ;;\n\t  powerpcle-*linux*)\n\t    LD=\"${LD-ld} -m elf64lppc\"\n\t    ;;\n\t  powerpc-*linux*)\n\t    LD=\"${LD-ld} -m elf64ppc\"\n\t    ;;\n\t  s390*-*linux*|s390*-*tpf*)\n\t    LD=\"${LD-ld} -m elf64_s390\"\n\t    ;;\n\t  sparc*-*linux*)\n\t    LD=\"${LD-ld} -m elf64_sparc\"\n\t    ;;\n\tesac\n\t;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\n\n*-*-sco3.2v5*)\n  # On SCO OpenServer 5, we need -belf to get full-featured binaries.\n  SAVE_CFLAGS=$CFLAGS\n  CFLAGS=\"$CFLAGS -belf\"\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf\" >&5\n$as_echo_n \"checking whether the C compiler needs -belf... \" >&6; }\nif ${lt_cv_cc_needs_belf+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n     cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  lt_cv_cc_needs_belf=yes\nelse\n  lt_cv_cc_needs_belf=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\n     ac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf\" >&5\n$as_echo \"$lt_cv_cc_needs_belf\" >&6; }\n  if test yes != \"$lt_cv_cc_needs_belf\"; then\n    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf\n    CFLAGS=$SAVE_CFLAGS\n  fi\n  ;;\n*-*solaris*)\n  # Find out what ABI is being produced by ac_compile, and set linker\n  # options accordingly.\n  echo 'int i;' > conftest.$ac_ext\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_compile\\\"\"; } >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; then\n    case `/usr/bin/file conftest.o` in\n    *64-bit*)\n      case $lt_cv_prog_gnu_ld in\n      yes*)\n        case $host in\n        i?86-*-solaris*|x86_64-*-solaris*)\n          LD=\"${LD-ld} -m elf_x86_64\"\n          ;;\n        sparc*-*-solaris*)\n          LD=\"${LD-ld} -m elf64_sparc\"\n          ;;\n        esac\n        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.\n        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then\n          LD=${LD-ld}_sol2\n        fi\n        ;;\n      *)\n\tif ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then\n\t  LD=\"${LD-ld} -64\"\n\tfi\n\t;;\n      esac\n      ;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\nesac\n\nneed_locks=$enable_libtool_lock\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}mt\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}mt; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_MANIFEST_TOOL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$MANIFEST_TOOL\"; then\n  ac_cv_prog_MANIFEST_TOOL=\"$MANIFEST_TOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_MANIFEST_TOOL=\"${ac_tool_prefix}mt\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nMANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL\nif test -n \"$MANIFEST_TOOL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL\" >&5\n$as_echo \"$MANIFEST_TOOL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_MANIFEST_TOOL\"; then\n  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL\n  # Extract the first word of \"mt\", so it can be a program name with args.\nset dummy mt; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_MANIFEST_TOOL\"; then\n  ac_cv_prog_ac_ct_MANIFEST_TOOL=\"$ac_ct_MANIFEST_TOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_MANIFEST_TOOL=\"mt\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL\nif test -n \"$ac_ct_MANIFEST_TOOL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL\" >&5\n$as_echo \"$ac_ct_MANIFEST_TOOL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_MANIFEST_TOOL\" = x; then\n    MANIFEST_TOOL=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL\n  fi\nelse\n  MANIFEST_TOOL=\"$ac_cv_prog_MANIFEST_TOOL\"\nfi\n\ntest -z \"$MANIFEST_TOOL\" && MANIFEST_TOOL=mt\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool\" >&5\n$as_echo_n \"checking if $MANIFEST_TOOL is a manifest tool... \" >&6; }\nif ${lt_cv_path_mainfest_tool+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_path_mainfest_tool=no\n  echo \"$as_me:$LINENO: $MANIFEST_TOOL '-?'\" >&5\n  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out\n  cat conftest.err >&5\n  if $GREP 'Manifest Tool' conftest.out > /dev/null; then\n    lt_cv_path_mainfest_tool=yes\n  fi\n  rm -f conftest*\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool\" >&5\n$as_echo \"$lt_cv_path_mainfest_tool\" >&6; }\nif test yes != \"$lt_cv_path_mainfest_tool\"; then\n  MANIFEST_TOOL=:\nfi\n\n\n\n\n\n\n  case $host_os in\n    rhapsody* | darwin*)\n    if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}dsymutil\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}dsymutil; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_DSYMUTIL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$DSYMUTIL\"; then\n  ac_cv_prog_DSYMUTIL=\"$DSYMUTIL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_DSYMUTIL=\"${ac_tool_prefix}dsymutil\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nDSYMUTIL=$ac_cv_prog_DSYMUTIL\nif test -n \"$DSYMUTIL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL\" >&5\n$as_echo \"$DSYMUTIL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_DSYMUTIL\"; then\n  ac_ct_DSYMUTIL=$DSYMUTIL\n  # Extract the first word of \"dsymutil\", so it can be a program name with args.\nset dummy dsymutil; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_DSYMUTIL\"; then\n  ac_cv_prog_ac_ct_DSYMUTIL=\"$ac_ct_DSYMUTIL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_DSYMUTIL=\"dsymutil\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL\nif test -n \"$ac_ct_DSYMUTIL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL\" >&5\n$as_echo \"$ac_ct_DSYMUTIL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_DSYMUTIL\" = x; then\n    DSYMUTIL=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    DSYMUTIL=$ac_ct_DSYMUTIL\n  fi\nelse\n  DSYMUTIL=\"$ac_cv_prog_DSYMUTIL\"\nfi\n\n    if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}nmedit\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}nmedit; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_NMEDIT+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$NMEDIT\"; then\n  ac_cv_prog_NMEDIT=\"$NMEDIT\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_NMEDIT=\"${ac_tool_prefix}nmedit\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nNMEDIT=$ac_cv_prog_NMEDIT\nif test -n \"$NMEDIT\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $NMEDIT\" >&5\n$as_echo \"$NMEDIT\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_NMEDIT\"; then\n  ac_ct_NMEDIT=$NMEDIT\n  # Extract the first word of \"nmedit\", so it can be a program name with args.\nset dummy nmedit; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_NMEDIT\"; then\n  ac_cv_prog_ac_ct_NMEDIT=\"$ac_ct_NMEDIT\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_NMEDIT=\"nmedit\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT\nif test -n \"$ac_ct_NMEDIT\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT\" >&5\n$as_echo \"$ac_ct_NMEDIT\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_NMEDIT\" = x; then\n    NMEDIT=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    NMEDIT=$ac_ct_NMEDIT\n  fi\nelse\n  NMEDIT=\"$ac_cv_prog_NMEDIT\"\nfi\n\n    if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}lipo\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}lipo; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_LIPO+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$LIPO\"; then\n  ac_cv_prog_LIPO=\"$LIPO\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_LIPO=\"${ac_tool_prefix}lipo\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nLIPO=$ac_cv_prog_LIPO\nif test -n \"$LIPO\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $LIPO\" >&5\n$as_echo \"$LIPO\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_LIPO\"; then\n  ac_ct_LIPO=$LIPO\n  # Extract the first word of \"lipo\", so it can be a program name with args.\nset dummy lipo; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_LIPO+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_LIPO\"; then\n  ac_cv_prog_ac_ct_LIPO=\"$ac_ct_LIPO\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_LIPO=\"lipo\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO\nif test -n \"$ac_ct_LIPO\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO\" >&5\n$as_echo \"$ac_ct_LIPO\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_LIPO\" = x; then\n    LIPO=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    LIPO=$ac_ct_LIPO\n  fi\nelse\n  LIPO=\"$ac_cv_prog_LIPO\"\nfi\n\n    if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}otool\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}otool; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_OTOOL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$OTOOL\"; then\n  ac_cv_prog_OTOOL=\"$OTOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_OTOOL=\"${ac_tool_prefix}otool\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nOTOOL=$ac_cv_prog_OTOOL\nif test -n \"$OTOOL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $OTOOL\" >&5\n$as_echo \"$OTOOL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_OTOOL\"; then\n  ac_ct_OTOOL=$OTOOL\n  # Extract the first word of \"otool\", so it can be a program name with args.\nset dummy otool; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_OTOOL+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_OTOOL\"; then\n  ac_cv_prog_ac_ct_OTOOL=\"$ac_ct_OTOOL\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_OTOOL=\"otool\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL\nif test -n \"$ac_ct_OTOOL\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL\" >&5\n$as_echo \"$ac_ct_OTOOL\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_OTOOL\" = x; then\n    OTOOL=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    OTOOL=$ac_ct_OTOOL\n  fi\nelse\n  OTOOL=\"$ac_cv_prog_OTOOL\"\nfi\n\n    if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}otool64\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}otool64; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_OTOOL64+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$OTOOL64\"; then\n  ac_cv_prog_OTOOL64=\"$OTOOL64\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_OTOOL64=\"${ac_tool_prefix}otool64\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nOTOOL64=$ac_cv_prog_OTOOL64\nif test -n \"$OTOOL64\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $OTOOL64\" >&5\n$as_echo \"$OTOOL64\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_prog_OTOOL64\"; then\n  ac_ct_OTOOL64=$OTOOL64\n  # Extract the first word of \"otool64\", so it can be a program name with args.\nset dummy otool64; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$ac_ct_OTOOL64\"; then\n  ac_cv_prog_ac_ct_OTOOL64=\"$ac_ct_OTOOL64\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_OTOOL64=\"otool64\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64\nif test -n \"$ac_ct_OTOOL64\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64\" >&5\n$as_echo \"$ac_ct_OTOOL64\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_ct_OTOOL64\" = x; then\n    OTOOL64=\":\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    OTOOL64=$ac_ct_OTOOL64\n  fi\nelse\n  OTOOL64=\"$ac_cv_prog_OTOOL64\"\nfi\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag\" >&5\n$as_echo_n \"checking for -single_module linker flag... \" >&6; }\nif ${lt_cv_apple_cc_single_mod+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_apple_cc_single_mod=no\n      if test -z \"$LT_MULTI_MODULE\"; then\n\t# By default we will add the -single_module flag. You can override\n\t# by either setting the environment variable LT_MULTI_MODULE\n\t# non-empty at configure time, or by adding -multi_module to the\n\t# link flags.\n\trm -rf libconftest.dylib*\n\techo \"int foo(void){return 1;}\" > conftest.c\n\techo \"$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \\\n-dynamiclib -Wl,-single_module conftest.c\" >&5\n\t$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \\\n\t  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err\n        _lt_result=$?\n\t# If there is a non-empty error log, and \"single_module\"\n\t# appears in it, assume the flag caused a linker warning\n        if test -s conftest.err && $GREP single_module conftest.err; then\n\t  cat conftest.err >&5\n\t# Otherwise, if the output was created with a 0 exit code from\n\t# the compiler, it worked.\n\telif test -f libconftest.dylib && test 0 = \"$_lt_result\"; then\n\t  lt_cv_apple_cc_single_mod=yes\n\telse\n\t  cat conftest.err >&5\n\tfi\n\trm -rf libconftest.dylib*\n\trm -f conftest.*\n      fi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod\" >&5\n$as_echo \"$lt_cv_apple_cc_single_mod\" >&6; }\n\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag\" >&5\n$as_echo_n \"checking for -exported_symbols_list linker flag... \" >&6; }\nif ${lt_cv_ld_exported_symbols_list+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_ld_exported_symbols_list=no\n      save_LDFLAGS=$LDFLAGS\n      echo \"_main\" > conftest.sym\n      LDFLAGS=\"$LDFLAGS -Wl,-exported_symbols_list,conftest.sym\"\n      cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  lt_cv_ld_exported_symbols_list=yes\nelse\n  lt_cv_ld_exported_symbols_list=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\n\tLDFLAGS=$save_LDFLAGS\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list\" >&5\n$as_echo \"$lt_cv_ld_exported_symbols_list\" >&6; }\n\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag\" >&5\n$as_echo_n \"checking for -force_load linker flag... \" >&6; }\nif ${lt_cv_ld_force_load+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_ld_force_load=no\n      cat > conftest.c << _LT_EOF\nint forced_loaded() { return 2;}\n_LT_EOF\n      echo \"$LTCC $LTCFLAGS -c -o conftest.o conftest.c\" >&5\n      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5\n      echo \"$AR cru libconftest.a conftest.o\" >&5\n      $AR cru libconftest.a conftest.o 2>&5\n      echo \"$RANLIB libconftest.a\" >&5\n      $RANLIB libconftest.a 2>&5\n      cat > conftest.c << _LT_EOF\nint main() { return 0;}\n_LT_EOF\n      echo \"$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a\" >&5\n      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err\n      _lt_result=$?\n      if test -s conftest.err && $GREP force_load conftest.err; then\n\tcat conftest.err >&5\n      elif test -f conftest && test 0 = \"$_lt_result\" && $GREP forced_load conftest >/dev/null 2>&1; then\n\tlt_cv_ld_force_load=yes\n      else\n\tcat conftest.err >&5\n      fi\n        rm -f conftest.err libconftest.a conftest conftest.c\n        rm -rf conftest.dSYM\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load\" >&5\n$as_echo \"$lt_cv_ld_force_load\" >&6; }\n    case $host_os in\n    rhapsody* | darwin1.[012])\n      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;\n    darwin1.*)\n      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;\n    darwin*) # darwin 5.x on\n      # if running on 10.5 or later, the deployment target defaults\n      # to the OS version, if on x86, and 10.4, the deployment\n      # target defaults to 10.4. Don't you love it?\n      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in\n\t10.0,*86*-darwin8*|10.0,*-darwin[91]*)\n\t  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;\n\t10.[012][,.]*)\n\t  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;\n\t10.*)\n\t  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;\n      esac\n    ;;\n  esac\n    if test yes = \"$lt_cv_apple_cc_single_mod\"; then\n      _lt_dar_single_mod='$single_module'\n    fi\n    if test yes = \"$lt_cv_ld_exported_symbols_list\"; then\n      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'\n    else\n      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'\n    fi\n    if test : != \"$DSYMUTIL\" && test no = \"$lt_cv_ld_force_load\"; then\n      _lt_dsymutil='~$DSYMUTIL $lib || :'\n    else\n      _lt_dsymutil=\n    fi\n    ;;\n  esac\n\n# func_munge_path_list VARIABLE PATH\n# -----------------------------------\n# VARIABLE is name of variable containing _space_ separated list of\n# directories to be munged by the contents of PATH, which is string\n# having a format:\n# \"DIR[:DIR]:\"\n#       string \"DIR[ DIR]\" will be prepended to VARIABLE\n# \":DIR[:DIR]\"\n#       string \"DIR[ DIR]\" will be appended to VARIABLE\n# \"DIRP[:DIRP]::[DIRA:]DIRA\"\n#       string \"DIRP[ DIRP]\" will be prepended to VARIABLE and string\n#       \"DIRA[ DIRA]\" will be appended to VARIABLE\n# \"DIR[:DIR]\"\n#       VARIABLE will be replaced by \"DIR[ DIR]\"\nfunc_munge_path_list ()\n{\n    case x$2 in\n    x)\n        ;;\n    *:)\n        eval $1=\\\"`$ECHO $2 | $SED 's/:/ /g'` \\$$1\\\"\n        ;;\n    x:*)\n        eval $1=\\\"\\$$1 `$ECHO $2 | $SED 's/:/ /g'`\\\"\n        ;;\n    *::*)\n        eval $1=\\\"\\$$1\\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\\\"\n        eval $1=\\\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\\ \\$$1\\\"\n        ;;\n    *)\n        eval $1=\\\"`$ECHO $2 | $SED 's/:/ /g'`\\\"\n        ;;\n    esac\n}\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for ANSI C header files\" >&5\n$as_echo_n \"checking for ANSI C header files... \" >&6; }\nif ${ac_cv_header_stdc+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdlib.h>\n#include <stdarg.h>\n#include <string.h>\n#include <float.h>\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_header_stdc=yes\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n\nif test $ac_cv_header_stdc = yes; then\n  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <string.h>\n\n_ACEOF\nif (eval \"$ac_cpp conftest.$ac_ext\") 2>&5 |\n  $EGREP \"memchr\" >/dev/null 2>&1; then :\n\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f conftest*\n\nfi\n\nif test $ac_cv_header_stdc = yes; then\n  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdlib.h>\n\n_ACEOF\nif (eval \"$ac_cpp conftest.$ac_ext\") 2>&5 |\n  $EGREP \"free\" >/dev/null 2>&1; then :\n\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f conftest*\n\nfi\n\nif test $ac_cv_header_stdc = yes; then\n  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.\n  if test \"$cross_compiling\" = yes; then :\n  :\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <ctype.h>\n#include <stdlib.h>\n#if ((' ' & 0x0FF) == 0x020)\n# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')\n# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))\n#else\n# define ISLOWER(c) \\\n\t\t   (('a' <= (c) && (c) <= 'i') \\\n\t\t     || ('j' <= (c) && (c) <= 'r') \\\n\t\t     || ('s' <= (c) && (c) <= 'z'))\n# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))\n#endif\n\n#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))\nint\nmain ()\n{\n  int i;\n  for (i = 0; i < 256; i++)\n    if (XOR (islower (i), ISLOWER (i))\n\t|| toupper (i) != TOUPPER (i))\n      return 2;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_run \"$LINENO\"; then :\n\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \\\n  conftest.$ac_objext conftest.beam conftest.$ac_ext\nfi\n\nfi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc\" >&5\n$as_echo \"$ac_cv_header_stdc\" >&6; }\nif test $ac_cv_header_stdc = yes; then\n\n$as_echo \"#define STDC_HEADERS 1\" >>confdefs.h\n\nfi\n\n# On IRIX 5.3, sys/types and inttypes.h are conflicting.\nfor ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \\\n\t\t  inttypes.h stdint.h unistd.h\ndo :\n  as_ac_Header=`$as_echo \"ac_cv_header_$ac_header\" | $as_tr_sh`\nac_fn_c_check_header_compile \"$LINENO\" \"$ac_header\" \"$as_ac_Header\" \"$ac_includes_default\n\"\nif eval test \\\"x\\$\"$as_ac_Header\"\\\" = x\"yes\"; then :\n  cat >>confdefs.h <<_ACEOF\n#define `$as_echo \"HAVE_$ac_header\" | $as_tr_cpp` 1\n_ACEOF\n\nfi\n\ndone\n\n\nfor ac_header in dlfcn.h\ndo :\n  ac_fn_c_check_header_compile \"$LINENO\" \"dlfcn.h\" \"ac_cv_header_dlfcn_h\" \"$ac_includes_default\n\"\nif test \"x$ac_cv_header_dlfcn_h\" = xyes; then :\n  cat >>confdefs.h <<_ACEOF\n#define HAVE_DLFCN_H 1\n_ACEOF\n\nfi\n\ndone\n\n\n\n\n\n# Set options\n\n\n\n        enable_dlopen=no\n\n\n  enable_win32_dll=no\n\n\n            # Check whether --enable-shared was given.\nif test \"${enable_shared+set}\" = set; then :\n  enableval=$enable_shared; p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_shared=yes ;;\n    no) enable_shared=no ;;\n    *)\n      enable_shared=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for pkg in $enableval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_shared=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac\nelse\n  enable_shared=yes\nfi\n\n\n\n\n\n\n\n\n\n  # Check whether --enable-static was given.\nif test \"${enable_static+set}\" = set; then :\n  enableval=$enable_static; p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_static=yes ;;\n    no) enable_static=no ;;\n    *)\n     enable_static=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for pkg in $enableval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_static=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac\nelse\n  enable_static=yes\nfi\n\n\n\n\n\n\n\n\n\n\n# Check whether --with-pic was given.\nif test \"${with_pic+set}\" = set; then :\n  withval=$with_pic; lt_p=${PACKAGE-default}\n    case $withval in\n    yes|no) pic_mode=$withval ;;\n    *)\n      pic_mode=default\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for lt_pkg in $withval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$lt_pkg\" = \"X$lt_p\"; then\n\t  pic_mode=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac\nelse\n  pic_mode=default\nfi\n\n\n\n\n\n\n\n\n  # Check whether --enable-fast-install was given.\nif test \"${enable_fast_install+set}\" = set; then :\n  enableval=$enable_fast_install; p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_fast_install=yes ;;\n    no) enable_fast_install=no ;;\n    *)\n      enable_fast_install=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,\n      for pkg in $enableval; do\n\tIFS=$lt_save_ifs\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_fast_install=yes\n\tfi\n      done\n      IFS=$lt_save_ifs\n      ;;\n    esac\nelse\n  enable_fast_install=yes\nfi\n\n\n\n\n\n\n\n\n  shared_archive_member_spec=\ncase $host,$enable_shared in\npower*-*-aix[5-9]*,yes)\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide\" >&5\n$as_echo_n \"checking which variant of shared library versioning to provide... \" >&6; }\n\n# Check whether --with-aix-soname was given.\nif test \"${with_aix_soname+set}\" = set; then :\n  withval=$with_aix_soname; case $withval in\n    aix|svr4|both)\n      ;;\n    *)\n      as_fn_error $? \"Unknown argument to --with-aix-soname\" \"$LINENO\" 5\n      ;;\n    esac\n    lt_cv_with_aix_soname=$with_aix_soname\nelse\n  if ${lt_cv_with_aix_soname+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_with_aix_soname=aix\nfi\n\n    with_aix_soname=$lt_cv_with_aix_soname\nfi\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $with_aix_soname\" >&5\n$as_echo \"$with_aix_soname\" >&6; }\n  if test aix != \"$with_aix_soname\"; then\n    # For the AIX way of multilib, we name the shared archive member\n    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',\n    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.\n    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,\n    # the AIX toolchain works better with OBJECT_MODE set (default 32).\n    if test 64 = \"${OBJECT_MODE-32}\"; then\n      shared_archive_member_spec=shr_64\n    else\n      shared_archive_member_spec=shr\n    fi\n  fi\n  ;;\n*)\n  with_aix_soname=aix\n  ;;\nesac\n\n\n\n\n\n\n\n\n\n\n# This can be used to rebuild libtool when needed\nLIBTOOL_DEPS=$ltmain\n\n# Always use our own libtool.\nLIBTOOL='$(SHELL) $(top_builddir)/libtool'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ntest -z \"$LN_S\" && LN_S=\"ln -s\"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nif test -n \"${ZSH_VERSION+set}\"; then\n   setopt NO_GLOB_SUBST\nfi\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for objdir\" >&5\n$as_echo_n \"checking for objdir... \" >&6; }\nif ${lt_cv_objdir+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  rm -f .libs 2>/dev/null\nmkdir .libs 2>/dev/null\nif test -d .libs; then\n  lt_cv_objdir=.libs\nelse\n  # MS-DOS does not allow filenames that begin with a dot.\n  lt_cv_objdir=_libs\nfi\nrmdir .libs 2>/dev/null\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir\" >&5\n$as_echo \"$lt_cv_objdir\" >&6; }\nobjdir=$lt_cv_objdir\n\n\n\n\n\ncat >>confdefs.h <<_ACEOF\n#define LT_OBJDIR \"$lt_cv_objdir/\"\n_ACEOF\n\n\n\n\ncase $host_os in\naix3*)\n  # AIX sometimes has problems with the GCC collect2 program.  For some\n  # reason, if we set the COLLECT_NAMES environment variable, the problems\n  # vanish in a puff of smoke.\n  if test set != \"${COLLECT_NAMES+set}\"; then\n    COLLECT_NAMES=\n    export COLLECT_NAMES\n  fi\n  ;;\nesac\n\n# Global variables:\nofile=libtool\ncan_build_shared=yes\n\n# All known linkers require a '.a' archive for static linking (except MSVC,\n# which needs '.lib').\nlibext=a\n\nwith_gnu_ld=$lt_cv_prog_gnu_ld\n\nold_CC=$CC\nold_CFLAGS=$CFLAGS\n\n# Set sane defaults for various variables\ntest -z \"$CC\" && CC=cc\ntest -z \"$LTCC\" && LTCC=$CC\ntest -z \"$LTCFLAGS\" && LTCFLAGS=$CFLAGS\ntest -z \"$LD\" && LD=ld\ntest -z \"$ac_objext\" && ac_objext=o\n\nfunc_cc_basename $compiler\ncc_basename=$func_cc_basename_result\n\n\n# Only perform the check for file, if the check method requires it\ntest -z \"$MAGIC_CMD\" && MAGIC_CMD=file\ncase $deplibs_check_method in\nfile_magic*)\n  if test \"$file_magic_cmd\" = '$MAGIC_CMD'; then\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file\" >&5\n$as_echo_n \"checking for ${ac_tool_prefix}file... \" >&6; }\nif ${lt_cv_path_MAGIC_CMD+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  case $MAGIC_CMD in\n[\\\\/*] |  ?:[\\\\/]*)\n  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.\n  ;;\n*)\n  lt_save_MAGIC_CMD=$MAGIC_CMD\n  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR\n  ac_dummy=\"/usr/bin$PATH_SEPARATOR$PATH\"\n  for ac_dir in $ac_dummy; do\n    IFS=$lt_save_ifs\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f \"$ac_dir/${ac_tool_prefix}file\"; then\n      lt_cv_path_MAGIC_CMD=$ac_dir/\"${ac_tool_prefix}file\"\n      if test -n \"$file_magic_test_file\"; then\n\tcase $deplibs_check_method in\n\t\"file_magic \"*)\n\t  file_magic_regex=`expr \"$deplibs_check_method\" : \"file_magic \\(.*\\)\"`\n\t  MAGIC_CMD=$lt_cv_path_MAGIC_CMD\n\t  if eval $file_magic_cmd \\$file_magic_test_file 2> /dev/null |\n\t    $EGREP \"$file_magic_regex\" > /dev/null; then\n\t    :\n\t  else\n\t    cat <<_LT_EOF 1>&2\n\n*** Warning: the command libtool uses to detect shared libraries,\n*** $file_magic_cmd, produces output that libtool cannot recognize.\n*** The result is that libtool may fail to recognize shared libraries\n*** as such.  This will affect the creation of libtool libraries that\n*** depend on shared libraries, but programs linked with such libtool\n*** libraries will work regardless of this problem.  Nevertheless, you\n*** may want to report the problem to your system manager and/or to\n*** bug-libtool@gnu.org\n\n_LT_EOF\n\t  fi ;;\n\tesac\n      fi\n      break\n    fi\n  done\n  IFS=$lt_save_ifs\n  MAGIC_CMD=$lt_save_MAGIC_CMD\n  ;;\nesac\nfi\n\nMAGIC_CMD=$lt_cv_path_MAGIC_CMD\nif test -n \"$MAGIC_CMD\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD\" >&5\n$as_echo \"$MAGIC_CMD\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n\n\n\nif test -z \"$lt_cv_path_MAGIC_CMD\"; then\n  if test -n \"$ac_tool_prefix\"; then\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for file\" >&5\n$as_echo_n \"checking for file... \" >&6; }\nif ${lt_cv_path_MAGIC_CMD+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  case $MAGIC_CMD in\n[\\\\/*] |  ?:[\\\\/]*)\n  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.\n  ;;\n*)\n  lt_save_MAGIC_CMD=$MAGIC_CMD\n  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR\n  ac_dummy=\"/usr/bin$PATH_SEPARATOR$PATH\"\n  for ac_dir in $ac_dummy; do\n    IFS=$lt_save_ifs\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f \"$ac_dir/file\"; then\n      lt_cv_path_MAGIC_CMD=$ac_dir/\"file\"\n      if test -n \"$file_magic_test_file\"; then\n\tcase $deplibs_check_method in\n\t\"file_magic \"*)\n\t  file_magic_regex=`expr \"$deplibs_check_method\" : \"file_magic \\(.*\\)\"`\n\t  MAGIC_CMD=$lt_cv_path_MAGIC_CMD\n\t  if eval $file_magic_cmd \\$file_magic_test_file 2> /dev/null |\n\t    $EGREP \"$file_magic_regex\" > /dev/null; then\n\t    :\n\t  else\n\t    cat <<_LT_EOF 1>&2\n\n*** Warning: the command libtool uses to detect shared libraries,\n*** $file_magic_cmd, produces output that libtool cannot recognize.\n*** The result is that libtool may fail to recognize shared libraries\n*** as such.  This will affect the creation of libtool libraries that\n*** depend on shared libraries, but programs linked with such libtool\n*** libraries will work regardless of this problem.  Nevertheless, you\n*** may want to report the problem to your system manager and/or to\n*** bug-libtool@gnu.org\n\n_LT_EOF\n\t  fi ;;\n\tesac\n      fi\n      break\n    fi\n  done\n  IFS=$lt_save_ifs\n  MAGIC_CMD=$lt_save_MAGIC_CMD\n  ;;\nesac\nfi\n\nMAGIC_CMD=$lt_cv_path_MAGIC_CMD\nif test -n \"$MAGIC_CMD\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD\" >&5\n$as_echo \"$MAGIC_CMD\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  else\n    MAGIC_CMD=:\n  fi\nfi\n\n  fi\n  ;;\nesac\n\n# Use C for the default configuration in the libtool script\n\nlt_save_CC=$CC\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n\n# Source file extension for C test sources.\nac_ext=c\n\n# Object file extension for compiled C test sources.\nobjext=o\nobjext=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"int some_variable = 0;\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code='int main(){return(0);}'\n\n\n\n\n\n\n\n# If no C compiler was specified, use CC.\nLTCC=${LTCC-\"$CC\"}\n\n# If no C compiler flags were specified, use CFLAGS.\nLTCFLAGS=${LTCFLAGS-\"$CFLAGS\"}\n\n# Allow CC to be a program name with arguments.\ncompiler=$CC\n\n# Save the default compiler, since it gets overwritten when the other\n# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.\ncompiler_DEFAULT=$CC\n\n# save warnings/boilerplate of simple test code\nac_outfile=conftest.$ac_objext\necho \"$lt_simple_compile_test_code\" >conftest.$ac_ext\neval \"$ac_compile\" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err\n_lt_compiler_boilerplate=`cat conftest.err`\n$RM conftest*\n\nac_outfile=conftest.$ac_objext\necho \"$lt_simple_link_test_code\" >conftest.$ac_ext\neval \"$ac_link\" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err\n_lt_linker_boilerplate=`cat conftest.err`\n$RM -r conftest*\n\n\nif test -n \"$compiler\"; then\n\nlt_prog_compiler_no_builtin_flag=\n\nif test yes = \"$GCC\"; then\n  case $cc_basename in\n  nvcc*)\n    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;\n  *)\n    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;\n  esac\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions\" >&5\n$as_echo_n \"checking if $compiler supports -fno-rtti -fno-exceptions... \" >&6; }\nif ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_prog_compiler_rtti_exceptions=no\n   ac_outfile=conftest.$ac_objext\n   echo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n   lt_compiler_flag=\"-fno-rtti -fno-exceptions\"  ## exclude from sc_useless_quotes_in_assignment\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   # The option is referenced via a variable to avoid confusing sed.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}\\{0,1\\} :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:$LINENO: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>conftest.err)\n   ac_status=$?\n   cat conftest.err >&5\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s \"$ac_outfile\"; then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings other than the usual output.\n     $ECHO \"$_lt_compiler_boilerplate\" | $SED '/^$/d' >conftest.exp\n     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2\n     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then\n       lt_cv_prog_compiler_rtti_exceptions=yes\n     fi\n   fi\n   $RM conftest*\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions\" >&5\n$as_echo \"$lt_cv_prog_compiler_rtti_exceptions\" >&6; }\n\nif test yes = \"$lt_cv_prog_compiler_rtti_exceptions\"; then\n    lt_prog_compiler_no_builtin_flag=\"$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions\"\nelse\n    :\nfi\n\nfi\n\n\n\n\n\n\n  lt_prog_compiler_wl=\nlt_prog_compiler_pic=\nlt_prog_compiler_static=\n\n\n  if test yes = \"$GCC\"; then\n    lt_prog_compiler_wl='-Wl,'\n    lt_prog_compiler_static='-static'\n\n    case $host_os in\n      aix*)\n      # All AIX code is PIC.\n      if test ia64 = \"$host_cpu\"; then\n\t# AIX 5 now supports IA64 processor\n\tlt_prog_compiler_static='-Bstatic'\n      fi\n      lt_prog_compiler_pic='-fPIC'\n      ;;\n\n    amigaos*)\n      case $host_cpu in\n      powerpc)\n            # see comment about AmigaOS4 .so support\n            lt_prog_compiler_pic='-fPIC'\n        ;;\n      m68k)\n            # FIXME: we need at least 68020 code to build shared libraries, but\n            # adding the '-m68020' flag to GCC prevents building anything better,\n            # like '-m68040'.\n            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'\n        ;;\n      esac\n      ;;\n\n    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)\n      # PIC is the default for these OSes.\n      ;;\n\n    mingw* | cygwin* | pw32* | os2* | cegcc*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      # Although the cygwin gcc ignores -fPIC, still need this for old-style\n      # (--disable-auto-import) libraries\n      lt_prog_compiler_pic='-DDLL_EXPORT'\n      case $host_os in\n      os2*)\n\tlt_prog_compiler_static='$wl-static'\n\t;;\n      esac\n      ;;\n\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      lt_prog_compiler_pic='-fno-common'\n      ;;\n\n    haiku*)\n      # PIC is the default for Haiku.\n      # The \"-static\" flag exists, but is broken.\n      lt_prog_compiler_static=\n      ;;\n\n    hpux*)\n      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit\n      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag\n      # sets the default TLS model and affects inlining.\n      case $host_cpu in\n      hppa*64*)\n\t# +Z the default\n\t;;\n      *)\n\tlt_prog_compiler_pic='-fPIC'\n\t;;\n      esac\n      ;;\n\n    interix[3-9]*)\n      # Interix 3.x gcc -fpic/-fPIC options generate broken code.\n      # Instead, we relocate shared libraries at runtime.\n      ;;\n\n    msdosdjgpp*)\n      # Just because we use GCC doesn't mean we suddenly get shared libraries\n      # on systems that don't support them.\n      lt_prog_compiler_can_build_shared=no\n      enable_shared=no\n      ;;\n\n    *nto* | *qnx*)\n      # QNX uses GNU C++, but need to define -shared option too, otherwise\n      # it will coredump.\n      lt_prog_compiler_pic='-fPIC -shared'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\tlt_prog_compiler_pic=-Kconform_pic\n      fi\n      ;;\n\n    *)\n      lt_prog_compiler_pic='-fPIC'\n      ;;\n    esac\n\n    case $cc_basename in\n    nvcc*) # Cuda Compiler Driver 2.2\n      lt_prog_compiler_wl='-Xlinker '\n      if test -n \"$lt_prog_compiler_pic\"; then\n        lt_prog_compiler_pic=\"-Xcompiler $lt_prog_compiler_pic\"\n      fi\n      ;;\n    esac\n  else\n    # PORTME Check for flag to pass linker flags through the system compiler.\n    case $host_os in\n    aix*)\n      lt_prog_compiler_wl='-Wl,'\n      if test ia64 = \"$host_cpu\"; then\n\t# AIX 5 now supports IA64 processor\n\tlt_prog_compiler_static='-Bstatic'\n      else\n\tlt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'\n      fi\n      ;;\n\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      lt_prog_compiler_pic='-fno-common'\n      case $cc_basename in\n      nagfor*)\n        # NAG Fortran compiler\n        lt_prog_compiler_wl='-Wl,-Wl,,'\n        lt_prog_compiler_pic='-PIC'\n        lt_prog_compiler_static='-Bstatic'\n        ;;\n      esac\n      ;;\n\n    mingw* | cygwin* | pw32* | os2* | cegcc*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      lt_prog_compiler_pic='-DDLL_EXPORT'\n      case $host_os in\n      os2*)\n\tlt_prog_compiler_static='$wl-static'\n\t;;\n      esac\n      ;;\n\n    hpux9* | hpux10* | hpux11*)\n      lt_prog_compiler_wl='-Wl,'\n      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but\n      # not for PA HP-UX.\n      case $host_cpu in\n      hppa*64*|ia64*)\n\t# +Z the default\n\t;;\n      *)\n\tlt_prog_compiler_pic='+Z'\n\t;;\n      esac\n      # Is there a better lt_prog_compiler_static that works with the bundled CC?\n      lt_prog_compiler_static='$wl-a ${wl}archive'\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      lt_prog_compiler_wl='-Wl,'\n      # PIC (with -KPIC) is the default.\n      lt_prog_compiler_static='-non_shared'\n      ;;\n\n    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n      case $cc_basename in\n      # old Intel for x86_64, which still supported -KPIC.\n      ecc*)\n\tlt_prog_compiler_wl='-Wl,'\n\tlt_prog_compiler_pic='-KPIC'\n\tlt_prog_compiler_static='-static'\n        ;;\n      # icc used to be incompatible with GCC.\n      # ICC 10 doesn't accept -KPIC any more.\n      icc* | ifort*)\n\tlt_prog_compiler_wl='-Wl,'\n\tlt_prog_compiler_pic='-fPIC'\n\tlt_prog_compiler_static='-static'\n        ;;\n      # Lahey Fortran 8.1.\n      lf95*)\n\tlt_prog_compiler_wl='-Wl,'\n\tlt_prog_compiler_pic='--shared'\n\tlt_prog_compiler_static='--static'\n\t;;\n      nagfor*)\n\t# NAG Fortran compiler\n\tlt_prog_compiler_wl='-Wl,-Wl,,'\n\tlt_prog_compiler_pic='-PIC'\n\tlt_prog_compiler_static='-Bstatic'\n\t;;\n      tcc*)\n\t# Fabrice Bellard et al's Tiny C Compiler\n\tlt_prog_compiler_wl='-Wl,'\n\tlt_prog_compiler_pic='-fPIC'\n\tlt_prog_compiler_static='-static'\n\t;;\n      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)\n        # Portland Group compilers (*not* the Pentium gcc compiler,\n\t# which looks to be a dead project)\n\tlt_prog_compiler_wl='-Wl,'\n\tlt_prog_compiler_pic='-fpic'\n\tlt_prog_compiler_static='-Bstatic'\n        ;;\n      ccc*)\n        lt_prog_compiler_wl='-Wl,'\n        # All Alpha code is PIC.\n        lt_prog_compiler_static='-non_shared'\n        ;;\n      xl* | bgxl* | bgf* | mpixl*)\n\t# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene\n\tlt_prog_compiler_wl='-Wl,'\n\tlt_prog_compiler_pic='-qpic'\n\tlt_prog_compiler_static='-qstaticlink'\n\t;;\n      *)\n\tcase `$CC -V 2>&1 | sed 5q` in\n\t*Sun\\ Ceres\\ Fortran* | *Sun*Fortran*\\ [1-7].* | *Sun*Fortran*\\ 8.[0-3]*)\n\t  # Sun Fortran 8.3 passes all unrecognized flags to the linker\n\t  lt_prog_compiler_pic='-KPIC'\n\t  lt_prog_compiler_static='-Bstatic'\n\t  lt_prog_compiler_wl=''\n\t  ;;\n\t*Sun\\ F* | *Sun*Fortran*)\n\t  lt_prog_compiler_pic='-KPIC'\n\t  lt_prog_compiler_static='-Bstatic'\n\t  lt_prog_compiler_wl='-Qoption ld '\n\t  ;;\n\t*Sun\\ C*)\n\t  # Sun C 5.9\n\t  lt_prog_compiler_pic='-KPIC'\n\t  lt_prog_compiler_static='-Bstatic'\n\t  lt_prog_compiler_wl='-Wl,'\n\t  ;;\n        *Intel*\\ [CF]*Compiler*)\n\t  lt_prog_compiler_wl='-Wl,'\n\t  lt_prog_compiler_pic='-fPIC'\n\t  lt_prog_compiler_static='-static'\n\t  ;;\n\t*Portland\\ Group*)\n\t  lt_prog_compiler_wl='-Wl,'\n\t  lt_prog_compiler_pic='-fpic'\n\t  lt_prog_compiler_static='-Bstatic'\n\t  ;;\n\tesac\n\t;;\n      esac\n      ;;\n\n    newsos6)\n      lt_prog_compiler_pic='-KPIC'\n      lt_prog_compiler_static='-Bstatic'\n      ;;\n\n    *nto* | *qnx*)\n      # QNX uses GNU C++, but need to define -shared option too, otherwise\n      # it will coredump.\n      lt_prog_compiler_pic='-fPIC -shared'\n      ;;\n\n    osf3* | osf4* | osf5*)\n      lt_prog_compiler_wl='-Wl,'\n      # All OSF/1 code is PIC.\n      lt_prog_compiler_static='-non_shared'\n      ;;\n\n    rdos*)\n      lt_prog_compiler_static='-non_shared'\n      ;;\n\n    solaris*)\n      lt_prog_compiler_pic='-KPIC'\n      lt_prog_compiler_static='-Bstatic'\n      case $cc_basename in\n      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)\n\tlt_prog_compiler_wl='-Qoption ld ';;\n      *)\n\tlt_prog_compiler_wl='-Wl,';;\n      esac\n      ;;\n\n    sunos4*)\n      lt_prog_compiler_wl='-Qoption ld '\n      lt_prog_compiler_pic='-PIC'\n      lt_prog_compiler_static='-Bstatic'\n      ;;\n\n    sysv4 | sysv4.2uw2* | sysv4.3*)\n      lt_prog_compiler_wl='-Wl,'\n      lt_prog_compiler_pic='-KPIC'\n      lt_prog_compiler_static='-Bstatic'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\tlt_prog_compiler_pic='-Kconform_pic'\n\tlt_prog_compiler_static='-Bstatic'\n      fi\n      ;;\n\n    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)\n      lt_prog_compiler_wl='-Wl,'\n      lt_prog_compiler_pic='-KPIC'\n      lt_prog_compiler_static='-Bstatic'\n      ;;\n\n    unicos*)\n      lt_prog_compiler_wl='-Wl,'\n      lt_prog_compiler_can_build_shared=no\n      ;;\n\n    uts4*)\n      lt_prog_compiler_pic='-pic'\n      lt_prog_compiler_static='-Bstatic'\n      ;;\n\n    *)\n      lt_prog_compiler_can_build_shared=no\n      ;;\n    esac\n  fi\n\ncase $host_os in\n  # For platforms that do not support PIC, -DPIC is meaningless:\n  *djgpp*)\n    lt_prog_compiler_pic=\n    ;;\n  *)\n    lt_prog_compiler_pic=\"$lt_prog_compiler_pic -DPIC\"\n    ;;\nesac\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC\" >&5\n$as_echo_n \"checking for $compiler option to produce PIC... \" >&6; }\nif ${lt_cv_prog_compiler_pic+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic\" >&5\n$as_echo \"$lt_cv_prog_compiler_pic\" >&6; }\nlt_prog_compiler_pic=$lt_cv_prog_compiler_pic\n\n#\n# Check to make sure the PIC flag actually works.\n#\nif test -n \"$lt_prog_compiler_pic\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works\" >&5\n$as_echo_n \"checking if $compiler PIC flag $lt_prog_compiler_pic works... \" >&6; }\nif ${lt_cv_prog_compiler_pic_works+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_prog_compiler_pic_works=no\n   ac_outfile=conftest.$ac_objext\n   echo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n   lt_compiler_flag=\"$lt_prog_compiler_pic -DPIC\"  ## exclude from sc_useless_quotes_in_assignment\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   # The option is referenced via a variable to avoid confusing sed.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}\\{0,1\\} :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:$LINENO: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>conftest.err)\n   ac_status=$?\n   cat conftest.err >&5\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s \"$ac_outfile\"; then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings other than the usual output.\n     $ECHO \"$_lt_compiler_boilerplate\" | $SED '/^$/d' >conftest.exp\n     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2\n     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then\n       lt_cv_prog_compiler_pic_works=yes\n     fi\n   fi\n   $RM conftest*\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works\" >&5\n$as_echo \"$lt_cv_prog_compiler_pic_works\" >&6; }\n\nif test yes = \"$lt_cv_prog_compiler_pic_works\"; then\n    case $lt_prog_compiler_pic in\n     \"\" | \" \"*) ;;\n     *) lt_prog_compiler_pic=\" $lt_prog_compiler_pic\" ;;\n     esac\nelse\n    lt_prog_compiler_pic=\n     lt_prog_compiler_can_build_shared=no\nfi\n\nfi\n\n\n\n\n\n\n\n\n\n\n\n#\n# Check to make sure the static flag actually works.\n#\nwl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\\\"$lt_prog_compiler_static\\\"\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works\" >&5\n$as_echo_n \"checking if $compiler static flag $lt_tmp_static_flag works... \" >&6; }\nif ${lt_cv_prog_compiler_static_works+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_prog_compiler_static_works=no\n   save_LDFLAGS=$LDFLAGS\n   LDFLAGS=\"$LDFLAGS $lt_tmp_static_flag\"\n   echo \"$lt_simple_link_test_code\" > conftest.$ac_ext\n   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then\n     # The linker can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test -s conftest.err; then\n       # Append any errors to the config.log.\n       cat conftest.err 1>&5\n       $ECHO \"$_lt_linker_boilerplate\" | $SED '/^$/d' > conftest.exp\n       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2\n       if diff conftest.exp conftest.er2 >/dev/null; then\n         lt_cv_prog_compiler_static_works=yes\n       fi\n     else\n       lt_cv_prog_compiler_static_works=yes\n     fi\n   fi\n   $RM -r conftest*\n   LDFLAGS=$save_LDFLAGS\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works\" >&5\n$as_echo \"$lt_cv_prog_compiler_static_works\" >&6; }\n\nif test yes = \"$lt_cv_prog_compiler_static_works\"; then\n    :\nelse\n    lt_prog_compiler_static=\nfi\n\n\n\n\n\n\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext\" >&5\n$as_echo_n \"checking if $compiler supports -c -o file.$ac_objext... \" >&6; }\nif ${lt_cv_prog_compiler_c_o+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_prog_compiler_c_o=no\n   $RM -r conftest 2>/dev/null\n   mkdir conftest\n   cd conftest\n   mkdir out\n   echo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n   lt_compiler_flag=\"-o out/conftest2.$ac_objext\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}\\{0,1\\} :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:$LINENO: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>out/conftest.err)\n   ac_status=$?\n   cat out/conftest.err >&5\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s out/conftest2.$ac_objext\n   then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     $ECHO \"$_lt_compiler_boilerplate\" | $SED '/^$/d' > out/conftest.exp\n     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2\n     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then\n       lt_cv_prog_compiler_c_o=yes\n     fi\n   fi\n   chmod u+w . 2>&5\n   $RM conftest*\n   # SGI C++ compiler will create directory out/ii_files/ for\n   # template instantiation\n   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files\n   $RM out/* && rmdir out\n   cd ..\n   $RM -r conftest\n   $RM conftest*\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o\" >&5\n$as_echo \"$lt_cv_prog_compiler_c_o\" >&6; }\n\n\n\n\n\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext\" >&5\n$as_echo_n \"checking if $compiler supports -c -o file.$ac_objext... \" >&6; }\nif ${lt_cv_prog_compiler_c_o+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_prog_compiler_c_o=no\n   $RM -r conftest 2>/dev/null\n   mkdir conftest\n   cd conftest\n   mkdir out\n   echo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n   lt_compiler_flag=\"-o out/conftest2.$ac_objext\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}\\{0,1\\} :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:$LINENO: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>out/conftest.err)\n   ac_status=$?\n   cat out/conftest.err >&5\n   echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s out/conftest2.$ac_objext\n   then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     $ECHO \"$_lt_compiler_boilerplate\" | $SED '/^$/d' > out/conftest.exp\n     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2\n     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then\n       lt_cv_prog_compiler_c_o=yes\n     fi\n   fi\n   chmod u+w . 2>&5\n   $RM conftest*\n   # SGI C++ compiler will create directory out/ii_files/ for\n   # template instantiation\n   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files\n   $RM out/* && rmdir out\n   cd ..\n   $RM -r conftest\n   $RM conftest*\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o\" >&5\n$as_echo \"$lt_cv_prog_compiler_c_o\" >&6; }\n\n\n\n\nhard_links=nottested\nif test no = \"$lt_cv_prog_compiler_c_o\" && test no != \"$need_locks\"; then\n  # do not overwrite the value of need_locks provided by the user\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links\" >&5\n$as_echo_n \"checking if we can lock with hard links... \" >&6; }\n  hard_links=yes\n  $RM conftest*\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  touch conftest.a\n  ln conftest.a conftest.b 2>&5 || hard_links=no\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $hard_links\" >&5\n$as_echo \"$hard_links\" >&6; }\n  if test no = \"$hard_links\"; then\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe\" >&5\n$as_echo \"$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe\" >&2;}\n    need_locks=warn\n  fi\nelse\n  need_locks=no\nfi\n\n\n\n\n\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries\" >&5\n$as_echo_n \"checking whether the $compiler linker ($LD) supports shared libraries... \" >&6; }\n\n  runpath_var=\n  allow_undefined_flag=\n  always_export_symbols=no\n  archive_cmds=\n  archive_expsym_cmds=\n  compiler_needs_object=no\n  enable_shared_with_static_runtimes=no\n  export_dynamic_flag_spec=\n  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n  hardcode_automatic=no\n  hardcode_direct=no\n  hardcode_direct_absolute=no\n  hardcode_libdir_flag_spec=\n  hardcode_libdir_separator=\n  hardcode_minus_L=no\n  hardcode_shlibpath_var=unsupported\n  inherit_rpath=no\n  link_all_deplibs=unknown\n  module_cmds=\n  module_expsym_cmds=\n  old_archive_from_new_cmds=\n  old_archive_from_expsyms_cmds=\n  thread_safe_flag_spec=\n  whole_archive_flag_spec=\n  # include_expsyms should be a list of space-separated symbols to be *always*\n  # included in the symbol list\n  include_expsyms=\n  # exclude_expsyms can be an extended regexp of symbols to exclude\n  # it will be wrapped by ' (' and ')$', so one must not match beginning or\n  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',\n  # as well as any symbol that contains 'd'.\n  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'\n  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out\n  # platforms (ab)use it in PIC code, but their linkers get confused if\n  # the symbol is explicitly referenced.  Since portable code cannot\n  # rely on this symbol name, it's probably fine to never include it in\n  # preloaded symbol tables.\n  # Exclude shared library initialization/finalization symbols.\n  extract_expsyms_cmds=\n\n  case $host_os in\n  cygwin* | mingw* | pw32* | cegcc*)\n    # FIXME: the MSVC++ port hasn't been tested in a loooong time\n    # When not using gcc, we currently assume that we are using\n    # Microsoft Visual C++.\n    if test yes != \"$GCC\"; then\n      with_gnu_ld=no\n    fi\n    ;;\n  interix*)\n    # we just hope/assume this is gcc and not c89 (= MSVC++)\n    with_gnu_ld=yes\n    ;;\n  openbsd* | bitrig*)\n    with_gnu_ld=no\n    ;;\n  esac\n\n  ld_shlibs=yes\n\n  # On some targets, GNU ld is compatible enough with the native linker\n  # that we're better off using the native interface for both.\n  lt_use_gnu_ld_interface=no\n  if test yes = \"$with_gnu_ld\"; then\n    case $host_os in\n      aix*)\n\t# The AIX port of GNU ld has always aspired to compatibility\n\t# with the native linker.  However, as the warning in the GNU ld\n\t# block says, versions before 2.19.5* couldn't really create working\n\t# shared libraries, regardless of the interface used.\n\tcase `$LD -v 2>&1` in\n\t  *\\ \\(GNU\\ Binutils\\)\\ 2.19.5*) ;;\n\t  *\\ \\(GNU\\ Binutils\\)\\ 2.[2-9]*) ;;\n\t  *\\ \\(GNU\\ Binutils\\)\\ [3-9]*) ;;\n\t  *)\n\t    lt_use_gnu_ld_interface=yes\n\t    ;;\n\tesac\n\t;;\n      *)\n\tlt_use_gnu_ld_interface=yes\n\t;;\n    esac\n  fi\n\n  if test yes = \"$lt_use_gnu_ld_interface\"; then\n    # If archive_cmds runs LD, not CC, wlarc should be empty\n    wlarc='$wl'\n\n    # Set some defaults for GNU ld with shared library support. These\n    # are reset later if shared libraries are not supported. Putting them\n    # here allows them to be overridden if necessary.\n    runpath_var=LD_RUN_PATH\n    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'\n    export_dynamic_flag_spec='$wl--export-dynamic'\n    # ancient GNU ld didn't support --whole-archive et. al.\n    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then\n      whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'\n    else\n      whole_archive_flag_spec=\n    fi\n    supports_anon_versioning=no\n    case `$LD -v | $SED -e 's/(^)\\+)\\s\\+//' 2>&1` in\n      *GNU\\ gold*) supports_anon_versioning=yes ;;\n      *\\ [01].* | *\\ 2.[0-9].* | *\\ 2.10.*) ;; # catch versions < 2.11\n      *\\ 2.11.93.0.2\\ *) supports_anon_versioning=yes ;; # RH7.3 ...\n      *\\ 2.11.92.0.12\\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...\n      *\\ 2.11.*) ;; # other 2.11 versions\n      *) supports_anon_versioning=yes ;;\n    esac\n\n    # See if GNU ld supports shared libraries.\n    case $host_os in\n    aix[3-9]*)\n      # On AIX/PPC, the GNU linker is very broken\n      if test ia64 != \"$host_cpu\"; then\n\tld_shlibs=no\n\tcat <<_LT_EOF 1>&2\n\n*** Warning: the GNU linker, at least up to release 2.19, is reported\n*** to be unable to reliably create shared libraries on AIX.\n*** Therefore, libtool is disabling shared libraries support.  If you\n*** really care for shared libraries, you may want to install binutils\n*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.\n*** You will then need to restart the configuration process.\n\n_LT_EOF\n      fi\n      ;;\n\n    amigaos*)\n      case $host_cpu in\n      powerpc)\n            # see comment about AmigaOS4 .so support\n            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n            archive_expsym_cmds=''\n        ;;\n      m68k)\n            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO \"#define NAME $libname\" > $output_objdir/a2ixlibrary.data~$ECHO \"#define LIBRARY_ID 1\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define VERSION $major\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define REVISION $revision\" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'\n            hardcode_libdir_flag_spec='-L$libdir'\n            hardcode_minus_L=yes\n        ;;\n      esac\n      ;;\n\n    beos*)\n      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\tallow_undefined_flag=unsupported\n\t# Joseph Beckenbach <jrb3@best.com> says some releases of gcc\n\t# support --undefined.  This deserves some investigation.  FIXME\n\tarchive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n      else\n\tld_shlibs=no\n      fi\n      ;;\n\n    cygwin* | mingw* | pw32* | cegcc*)\n      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,\n      # as there is no search path for DLLs.\n      hardcode_libdir_flag_spec='-L$libdir'\n      export_dynamic_flag_spec='$wl--export-all-symbols'\n      allow_undefined_flag=unsupported\n      always_export_symbols=no\n      enable_shared_with_static_runtimes=yes\n      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[BCDGRS][ ]/s/.*[ ]\\([^ ]*\\)/\\1 DATA/;s/^.*[ ]__nm__\\([^ ]*\\)[ ][^ ]*/\\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\\'' | sort | uniq > $export_symbols'\n      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'\n\n      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then\n        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'\n\t# If the export-symbols file already is a .def file, use it as\n\t# is; otherwise, prepend EXPORTS...\n\tarchive_expsym_cmds='if   test DEF = \"`$SED -n     -e '\\''s/^[\t ]*//'\\''     -e '\\''/^\\(;.*\\)*$/d'\\''     -e '\\''s/^\\(EXPORTS\\|LIBRARY\\)\\([\t ].*\\)*$/DEF/p'\\''     -e q     $export_symbols`\" ; then\n          cp $export_symbols $output_objdir/$soname.def;\n        else\n          echo EXPORTS > $output_objdir/$soname.def;\n          cat $export_symbols >> $output_objdir/$soname.def;\n        fi~\n        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'\n      else\n\tld_shlibs=no\n      fi\n      ;;\n\n    haiku*)\n      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n      link_all_deplibs=yes\n      ;;\n\n    os2*)\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_minus_L=yes\n      allow_undefined_flag=unsupported\n      shrext_cmds=.dll\n      archive_cmds='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\temxexp $libobjs | $SED /\"_DLL_InitTerm\"/d >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      archive_expsym_cmds='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\tprefix_cmds=\"$SED\"~\n\tif test EXPORTS = \"`$SED 1q $export_symbols`\"; then\n\t  prefix_cmds=\"$prefix_cmds -e 1d\";\n\tfi~\n\tprefix_cmds=\"$prefix_cmds -e \\\"s/^\\(.*\\)$/_\\1/g\\\"\"~\n\tcat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'\n      enable_shared_with_static_runtimes=yes\n      ;;\n\n    interix[3-9]*)\n      hardcode_direct=no\n      hardcode_shlibpath_var=no\n      hardcode_libdir_flag_spec='$wl-rpath,$libdir'\n      export_dynamic_flag_spec='$wl-E'\n      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.\n      # Instead, shared libraries are loaded at an image base (0x10000000 by\n      # default) and relocated if they conflict, which is a slow very memory\n      # consuming and fragmenting process.  To avoid this, we pick a random,\n      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link\n      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.\n      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \\* 262144 + 1342177280` -o $lib'\n      archive_expsym_cmds='sed \"s|^|_|\" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \\* 262144 + 1342177280` -o $lib'\n      ;;\n\n    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)\n      tmp_diet=no\n      if test linux-dietlibc = \"$host_os\"; then\n\tcase $cc_basename in\n\t  diet\\ *) tmp_diet=yes;;\t# linux-dietlibc with static linking (!diet-dyn)\n\tesac\n      fi\n      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \\\n\t && test no = \"$tmp_diet\"\n      then\n\ttmp_addflag=' $pic_flag'\n\ttmp_sharedflag='-shared'\n\tcase $cc_basename,$host_cpu in\n        pgcc*)\t\t\t\t# Portland Group C compiler\n\t  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\\\"\\\"; do test  -n \\\"$conv\\\" && new_convenience=\\\"$new_convenience,$conv\\\"; done; func_echo_all \\\"$new_convenience\\\"` $wl--no-whole-archive'\n\t  tmp_addflag=' $pic_flag'\n\t  ;;\n\tpgf77* | pgf90* | pgf95* | pgfortran*)\n\t\t\t\t\t# Portland Group f77 and f90 compilers\n\t  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\\\"\\\"; do test  -n \\\"$conv\\\" && new_convenience=\\\"$new_convenience,$conv\\\"; done; func_echo_all \\\"$new_convenience\\\"` $wl--no-whole-archive'\n\t  tmp_addflag=' $pic_flag -Mnomain' ;;\n\tecc*,ia64* | icc*,ia64*)\t# Intel C compiler on ia64\n\t  tmp_addflag=' -i_dynamic' ;;\n\tefc*,ia64* | ifort*,ia64*)\t# Intel Fortran compiler on ia64\n\t  tmp_addflag=' -i_dynamic -nofor_main' ;;\n\tifc* | ifort*)\t\t\t# Intel Fortran compiler\n\t  tmp_addflag=' -nofor_main' ;;\n\tlf95*)\t\t\t\t# Lahey Fortran 8.1\n\t  whole_archive_flag_spec=\n\t  tmp_sharedflag='--shared' ;;\n        nagfor*)                        # NAGFOR 5.3\n          tmp_sharedflag='-Wl,-shared' ;;\n\txl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)\n\t  tmp_sharedflag='-qmkshrobj'\n\t  tmp_addflag= ;;\n\tnvcc*)\t# Cuda Compiler Driver 2.2\n\t  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\\\"\\\"; do test  -n \\\"$conv\\\" && new_convenience=\\\"$new_convenience,$conv\\\"; done; func_echo_all \\\"$new_convenience\\\"` $wl--no-whole-archive'\n\t  compiler_needs_object=yes\n\t  ;;\n\tesac\n\tcase `$CC -V 2>&1 | sed 5q` in\n\t*Sun\\ C*)\t\t\t# Sun C 5.9\n\t  whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\\\"\\\"; do test -z \\\"$conv\\\" || new_convenience=\\\"$new_convenience,$conv\\\"; done; func_echo_all \\\"$new_convenience\\\"` $wl--no-whole-archive'\n\t  compiler_needs_object=yes\n\t  tmp_sharedflag='-G' ;;\n\t*Sun\\ F*)\t\t\t# Sun Fortran 8.3\n\t  tmp_sharedflag='-G' ;;\n\tesac\n\tarchive_cmds='$CC '\"$tmp_sharedflag\"\"$tmp_addflag\"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\n        if test yes = \"$supports_anon_versioning\"; then\n          archive_expsym_cmds='echo \"{ global:\" > $output_objdir/$libname.ver~\n            cat $export_symbols | sed -e \"s/\\(.*\\)/\\1;/\" >> $output_objdir/$libname.ver~\n            echo \"local: *; };\" >> $output_objdir/$libname.ver~\n            $CC '\"$tmp_sharedflag\"\"$tmp_addflag\"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'\n        fi\n\n\tcase $cc_basename in\n\ttcc*)\n\t  export_dynamic_flag_spec='-rdynamic'\n\t  ;;\n\txlf* | bgf* | bgxlf* | mpixlf*)\n\t  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself\n\t  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'\n\t  hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'\n\t  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'\n\t  if test yes = \"$supports_anon_versioning\"; then\n\t    archive_expsym_cmds='echo \"{ global:\" > $output_objdir/$libname.ver~\n              cat $export_symbols | sed -e \"s/\\(.*\\)/\\1;/\" >> $output_objdir/$libname.ver~\n              echo \"local: *; };\" >> $output_objdir/$libname.ver~\n              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'\n\t  fi\n\t  ;;\n\tesac\n      else\n        ld_shlibs=no\n      fi\n      ;;\n\n    netbsd*)\n      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then\n\tarchive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'\n\twlarc=\n      else\n\tarchive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n      fi\n      ;;\n\n    solaris*)\n      if $LD -v 2>&1 | $GREP 'BFD 2\\.8' > /dev/null; then\n\tld_shlibs=no\n\tcat <<_LT_EOF 1>&2\n\n*** Warning: The releases 2.8.* of the GNU linker cannot reliably\n*** create shared libraries on Solaris systems.  Therefore, libtool\n*** is disabling shared libraries support.  We urge you to upgrade GNU\n*** binutils to release 2.9.1 or newer.  Another option is to modify\n*** your PATH or compiler configuration so that the native linker is\n*** used, and then restart.\n\n_LT_EOF\n      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\tarchive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n      else\n\tld_shlibs=no\n      fi\n      ;;\n\n    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)\n      case `$LD -v 2>&1` in\n        *\\ [01].* | *\\ 2.[0-9].* | *\\ 2.1[0-5].*)\n\tld_shlibs=no\n\tcat <<_LT_EOF 1>&2\n\n*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot\n*** reliably create shared libraries on SCO systems.  Therefore, libtool\n*** is disabling shared libraries support.  We urge you to upgrade GNU\n*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify\n*** your PATH or compiler configuration so that the native linker is\n*** used, and then restart.\n\n_LT_EOF\n\t;;\n\t*)\n\t  # For security reasons, it is highly recommended that you always\n\t  # use absolute paths for naming shared libraries, and exclude the\n\t  # DT_RUNPATH tag from executables and libraries.  But doing so\n\t  # requires that you compile everything twice, which is a pain.\n\t  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\t    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'\n\t    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\t    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n\t  else\n\t    ld_shlibs=no\n\t  fi\n\t;;\n      esac\n      ;;\n\n    sunos4*)\n      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      wlarc=\n      hardcode_direct=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    *)\n      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then\n\tarchive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'\n      else\n\tld_shlibs=no\n      fi\n      ;;\n    esac\n\n    if test no = \"$ld_shlibs\"; then\n      runpath_var=\n      hardcode_libdir_flag_spec=\n      export_dynamic_flag_spec=\n      whole_archive_flag_spec=\n    fi\n  else\n    # PORTME fill in a description of your system's linker (not GNU ld)\n    case $host_os in\n    aix3*)\n      allow_undefined_flag=unsupported\n      always_export_symbols=yes\n      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'\n      # Note: this linker hardcodes the directories in LIBPATH if there\n      # are no directories specified by -L.\n      hardcode_minus_L=yes\n      if test yes = \"$GCC\" && test -z \"$lt_prog_compiler_static\"; then\n\t# Neither direct hardcoding nor static linking is supported with a\n\t# broken collect2.\n\thardcode_direct=unsupported\n      fi\n      ;;\n\n    aix[4-9]*)\n      if test ia64 = \"$host_cpu\"; then\n\t# On IA64, the linker does run time linking by default, so we don't\n\t# have to do anything special.\n\taix_use_runtimelinking=no\n\texp_sym_flag='-Bexport'\n\tno_entry_flag=\n      else\n\t# If we're using GNU nm, then we don't want the \"-C\" option.\n\t# -C means demangle to GNU nm, but means don't demangle to AIX nm.\n\t# Without the \"-l\" option, or with the \"-B\" option, AIX nm treats\n\t# weak defined symbols like other global defined symbols, whereas\n\t# GNU nm marks them as \"W\".\n\t# While the 'weak' keyword is ignored in the Export File, we need\n\t# it in the Import File for the 'aix-soname' feature, so we have\n\t# to replace the \"-B\" option with \"-P\" for AIX nm.\n\tif $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then\n\t  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\\''{ if (((\\$ 2 == \"T\") || (\\$ 2 == \"D\") || (\\$ 2 == \"B\") || (\\$ 2 == \"W\")) && (substr(\\$ 3,1,1) != \".\")) { if (\\$ 2 == \"W\") { print \\$ 3 \" weak\" } else { print \\$ 3 } } }'\\'' | sort -u > $export_symbols'\n\telse\n\t  export_symbols_cmds='`func_echo_all $NM | $SED -e '\\''s/B\\([^B]*\\)$/P\\1/'\\''` -PCpgl $libobjs $convenience | awk '\\''{ if (((\\$ 2 == \"T\") || (\\$ 2 == \"D\") || (\\$ 2 == \"B\") || (\\$ 2 == \"W\") || (\\$ 2 == \"V\") || (\\$ 2 == \"Z\")) && (substr(\\$ 1,1,1) != \".\")) { if ((\\$ 2 == \"W\") || (\\$ 2 == \"V\") || (\\$ 2 == \"Z\")) { print \\$ 1 \" weak\" } else { print \\$ 1 } } }'\\'' | sort -u > $export_symbols'\n\tfi\n\taix_use_runtimelinking=no\n\n\t# Test if we are trying to use run time linking or normal\n\t# AIX style linking. If -brtl is somewhere in LDFLAGS, we\n\t# have runtime linking enabled, and use it for executables.\n\t# For shared libraries, we enable/disable runtime linking\n\t# depending on the kind of the shared library created -\n\t# when \"with_aix_soname,aix_use_runtimelinking\" is:\n\t# \"aix,no\"   lib.a(lib.so.V) shared, rtl:no,  for executables\n\t# \"aix,yes\"  lib.so          shared, rtl:yes, for executables\n\t#            lib.a           static archive\n\t# \"both,no\"  lib.so.V(shr.o) shared, rtl:yes\n\t#            lib.a(lib.so.V) shared, rtl:no,  for executables\n\t# \"both,yes\" lib.so.V(shr.o) shared, rtl:yes, for executables\n\t#            lib.a(lib.so.V) shared, rtl:no\n\t# \"svr4,*\"   lib.so.V(shr.o) shared, rtl:yes, for executables\n\t#            lib.a           static archive\n\tcase $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)\n\t  for ld_flag in $LDFLAGS; do\n\t  if (test x-brtl = \"x$ld_flag\" || test x-Wl,-brtl = \"x$ld_flag\"); then\n\t    aix_use_runtimelinking=yes\n\t    break\n\t  fi\n\t  done\n\t  if test svr4,no = \"$with_aix_soname,$aix_use_runtimelinking\"; then\n\t    # With aix-soname=svr4, we create the lib.so.V shared archives only,\n\t    # so we don't have lib.a shared libs to link our executables.\n\t    # We have to force runtime linking in this case.\n\t    aix_use_runtimelinking=yes\n\t    LDFLAGS=\"$LDFLAGS -Wl,-brtl\"\n\t  fi\n\t  ;;\n\tesac\n\n\texp_sym_flag='-bexport'\n\tno_entry_flag='-bnoentry'\n      fi\n\n      # When large executables or shared objects are built, AIX ld can\n      # have problems creating the table of contents.  If linking a library\n      # or program results in \"error TOC overflow\" add -mminimal-toc to\n      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not\n      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.\n\n      archive_cmds=''\n      hardcode_direct=yes\n      hardcode_direct_absolute=yes\n      hardcode_libdir_separator=':'\n      link_all_deplibs=yes\n      file_list_spec='$wl-f,'\n      case $with_aix_soname,$aix_use_runtimelinking in\n      aix,*) ;; # traditional, no import file\n      svr4,* | *,yes) # use import file\n\t# The Import File defines what to hardcode.\n\thardcode_direct=no\n\thardcode_direct_absolute=no\n\t;;\n      esac\n\n      if test yes = \"$GCC\"; then\n\tcase $host_os in aix4.[012]|aix4.[012].*)\n\t# We only want to do this on AIX 4.2 and lower, the check\n\t# below for broken collect2 doesn't work under 4.3+\n\t  collect2name=`$CC -print-prog-name=collect2`\n\t  if test -f \"$collect2name\" &&\n\t   strings \"$collect2name\" | $GREP resolve_lib_name >/dev/null\n\t  then\n\t  # We have reworked collect2\n\t  :\n\t  else\n\t  # We have old collect2\n\t  hardcode_direct=unsupported\n\t  # It fails to find uninstalled libraries when the uninstalled\n\t  # path is not listed in the libpath.  Setting hardcode_minus_L\n\t  # to unsupported forces relinking\n\t  hardcode_minus_L=yes\n\t  hardcode_libdir_flag_spec='-L$libdir'\n\t  hardcode_libdir_separator=\n\t  fi\n\t  ;;\n\tesac\n\tshared_flag='-shared'\n\tif test yes = \"$aix_use_runtimelinking\"; then\n\t  shared_flag=\"$shared_flag \"'$wl-G'\n\tfi\n\t# Need to ensure runtime linking is disabled for the traditional\n\t# shared library, or the linker may eventually find shared libraries\n\t# /with/ Import File - we do not want to mix them.\n\tshared_flag_aix='-shared'\n\tshared_flag_svr4='-shared $wl-G'\n      else\n\t# not using gcc\n\tif test ia64 = \"$host_cpu\"; then\n\t# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release\n\t# chokes on -Wl,-G. The following line is correct:\n\t  shared_flag='-G'\n\telse\n\t  if test yes = \"$aix_use_runtimelinking\"; then\n\t    shared_flag='$wl-G'\n\t  else\n\t    shared_flag='$wl-bM:SRE'\n\t  fi\n\t  shared_flag_aix='$wl-bM:SRE'\n\t  shared_flag_svr4='$wl-G'\n\tfi\n      fi\n\n      export_dynamic_flag_spec='$wl-bexpall'\n      # It seems that -bexpall does not export symbols beginning with\n      # underscore (_), so it is better to generate a list of symbols to export.\n      always_export_symbols=yes\n      if test aix,yes = \"$with_aix_soname,$aix_use_runtimelinking\"; then\n\t# Warning - without using the other runtime loading flags (-brtl),\n\t# -berok will link without error, but may produce a broken library.\n\tallow_undefined_flag='-berok'\n        # Determine the default libpath from the value encoded in an\n        # empty executable.\n        if test set = \"${lt_cv_aix_libpath+set}\"; then\n  aix_libpath=$lt_cv_aix_libpath\nelse\n  if ${lt_cv_aix_libpath_+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n\n  lt_aix_libpath_sed='\n      /Import File Strings/,/^$/ {\n\t  /^0/ {\n\t      s/^0  *\\([^ ]*\\) *$/\\1/\n\t      p\n\t  }\n      }'\n  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e \"$lt_aix_libpath_sed\"`\n  # Check for a 64-bit object if we didn't find anything.\n  if test -z \"$lt_cv_aix_libpath_\"; then\n    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e \"$lt_aix_libpath_sed\"`\n  fi\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\n  if test -z \"$lt_cv_aix_libpath_\"; then\n    lt_cv_aix_libpath_=/usr/lib:/lib\n  fi\n\nfi\n\n  aix_libpath=$lt_cv_aix_libpath_\nfi\n\n        hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'\"$aix_libpath\"\n        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n \"$allow_undefined_flag\"; then func_echo_all \"$wl$allow_undefined_flag\"; else :; fi` $wl'$exp_sym_flag:\\$export_symbols' '$shared_flag\n      else\n\tif test ia64 = \"$host_cpu\"; then\n\t  hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'\n\t  allow_undefined_flag=\"-z nodefs\"\n\t  archive_expsym_cmds=\"\\$CC $shared_flag\"' -o $output_objdir/$soname $libobjs $deplibs '\"\\$wl$no_entry_flag\"' $compiler_flags $wl$allow_undefined_flag '\"\\$wl$exp_sym_flag:\\$export_symbols\"\n\telse\n\t # Determine the default libpath from the value encoded in an\n\t # empty executable.\n\t if test set = \"${lt_cv_aix_libpath+set}\"; then\n  aix_libpath=$lt_cv_aix_libpath\nelse\n  if ${lt_cv_aix_libpath_+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n\n  lt_aix_libpath_sed='\n      /Import File Strings/,/^$/ {\n\t  /^0/ {\n\t      s/^0  *\\([^ ]*\\) *$/\\1/\n\t      p\n\t  }\n      }'\n  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e \"$lt_aix_libpath_sed\"`\n  # Check for a 64-bit object if we didn't find anything.\n  if test -z \"$lt_cv_aix_libpath_\"; then\n    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e \"$lt_aix_libpath_sed\"`\n  fi\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\n  if test -z \"$lt_cv_aix_libpath_\"; then\n    lt_cv_aix_libpath_=/usr/lib:/lib\n  fi\n\nfi\n\n  aix_libpath=$lt_cv_aix_libpath_\nfi\n\n\t hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'\"$aix_libpath\"\n\t  # Warning - without using the other run time loading flags,\n\t  # -berok will link without error, but may produce a broken library.\n\t  no_undefined_flag=' $wl-bernotok'\n\t  allow_undefined_flag=' $wl-berok'\n\t  if test yes = \"$with_gnu_ld\"; then\n\t    # We only use this code for GNU lds that support --whole-archive.\n\t    whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'\n\t  else\n\t    # Exported symbols can be pulled into shared objects from archives\n\t    whole_archive_flag_spec='$convenience'\n\t  fi\n\t  archive_cmds_need_lc=yes\n\t  archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'\n\t  # -brtl affects multiple linker settings, -berok does not and is overridden later\n\t  compiler_flags_filtered='`func_echo_all \"$compiler_flags \" | $SED -e \"s%-brtl\\\\([, ]\\\\)%-berok\\\\1%g\"`'\n\t  if test svr4 != \"$with_aix_soname\"; then\n\t    # This is similar to how AIX traditionally builds its shared libraries.\n\t    archive_expsym_cmds=\"$archive_expsym_cmds\"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'\n\t  fi\n\t  if test aix != \"$with_aix_soname\"; then\n\t    archive_expsym_cmds=\"$archive_expsym_cmds\"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all \"#! $soname($shared_archive_member_spec.o)\"; if test shr_64 = \"$shared_archive_member_spec\"; then func_echo_all \"# 64\"; else func_echo_all \"# 32\"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'\n\t  else\n\t    # used by -dlpreopen to get the symbols\n\t    archive_expsym_cmds=\"$archive_expsym_cmds\"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'\n\t  fi\n\t  archive_expsym_cmds=\"$archive_expsym_cmds\"'~$RM -r $output_objdir/$realname.d'\n\tfi\n      fi\n      ;;\n\n    amigaos*)\n      case $host_cpu in\n      powerpc)\n            # see comment about AmigaOS4 .so support\n            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'\n            archive_expsym_cmds=''\n        ;;\n      m68k)\n            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO \"#define NAME $libname\" > $output_objdir/a2ixlibrary.data~$ECHO \"#define LIBRARY_ID 1\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define VERSION $major\" >> $output_objdir/a2ixlibrary.data~$ECHO \"#define REVISION $revision\" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'\n            hardcode_libdir_flag_spec='-L$libdir'\n            hardcode_minus_L=yes\n        ;;\n      esac\n      ;;\n\n    bsdi[45]*)\n      export_dynamic_flag_spec=-rdynamic\n      ;;\n\n    cygwin* | mingw* | pw32* | cegcc*)\n      # When not using gcc, we currently assume that we are using\n      # Microsoft Visual C++.\n      # hardcode_libdir_flag_spec is actually meaningless, as there is\n      # no search path for DLLs.\n      case $cc_basename in\n      cl*)\n\t# Native MSVC\n\thardcode_libdir_flag_spec=' '\n\tallow_undefined_flag=unsupported\n\talways_export_symbols=yes\n\tfile_list_spec='@'\n\t# Tell ltmain to make .lib files, not .a files.\n\tlibext=lib\n\t# Tell ltmain to make .dll files, not .so files.\n\tshrext_cmds=.dll\n\t# FIXME: Setting linknames here is a bad hack.\n\tarchive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:\"$tool_output_objdir$libname.dll.lib\"~linknames='\n\tarchive_expsym_cmds='if   test DEF = \"`$SED -n     -e '\\''s/^[\t ]*//'\\''     -e '\\''/^\\(;.*\\)*$/d'\\''     -e '\\''s/^\\(EXPORTS\\|LIBRARY\\)\\([\t ].*\\)*$/DEF/p'\\''     -e q     $export_symbols`\" ; then\n            cp \"$export_symbols\" \"$output_objdir/$soname.def\";\n            echo \"$tool_output_objdir$soname.def\" > \"$output_objdir/$soname.exp\";\n          else\n            $SED -e '\\''s/^/-link -EXPORT:/'\\'' < $export_symbols > $output_objdir/$soname.exp;\n          fi~\n          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs \"@$tool_output_objdir$soname.exp\" -Wl,-DLL,-IMPLIB:\"$tool_output_objdir$libname.dll.lib\"~\n          linknames='\n\t# The linker will not automatically build a static lib if we build a DLL.\n\t# _LT_TAGVAR(old_archive_from_new_cmds, )='true'\n\tenable_shared_with_static_runtimes=yes\n\texclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'\n\texport_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[BCDGRS][ ]/s/.*[ ]\\([^ ]*\\)/\\1,DATA/'\\'' | $SED -e '\\''/^[AITW][ ]/s/.*[ ]//'\\'' | sort | uniq > $export_symbols'\n\t# Don't use ranlib\n\told_postinstall_cmds='chmod 644 $oldlib'\n\tpostlink_cmds='lt_outputfile=\"@OUTPUT@\"~\n          lt_tool_outputfile=\"@TOOL_OUTPUT@\"~\n          case $lt_outputfile in\n            *.exe|*.EXE) ;;\n            *)\n              lt_outputfile=$lt_outputfile.exe\n              lt_tool_outputfile=$lt_tool_outputfile.exe\n              ;;\n          esac~\n          if test : != \"$MANIFEST_TOOL\" && test -f \"$lt_outputfile.manifest\"; then\n            $MANIFEST_TOOL -manifest \"$lt_tool_outputfile.manifest\" -outputresource:\"$lt_tool_outputfile\" || exit 1;\n            $RM \"$lt_outputfile.manifest\";\n          fi'\n\t;;\n      *)\n\t# Assume MSVC wrapper\n\thardcode_libdir_flag_spec=' '\n\tallow_undefined_flag=unsupported\n\t# Tell ltmain to make .lib files, not .a files.\n\tlibext=lib\n\t# Tell ltmain to make .dll files, not .so files.\n\tshrext_cmds=.dll\n\t# FIXME: Setting linknames here is a bad hack.\n\tarchive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all \"$deplibs\" | $SED '\\''s/ -lc$//'\\''` -link -dll~linknames='\n\t# The linker will automatically build a .lib file if we build a DLL.\n\told_archive_from_new_cmds='true'\n\t# FIXME: Should let the user specify the lib program.\n\told_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'\n\tenable_shared_with_static_runtimes=yes\n\t;;\n      esac\n      ;;\n\n    darwin* | rhapsody*)\n\n\n  archive_cmds_need_lc=no\n  hardcode_direct=no\n  hardcode_automatic=yes\n  hardcode_shlibpath_var=unsupported\n  if test yes = \"$lt_cv_ld_force_load\"; then\n    whole_archive_flag_spec='`for conv in $convenience\\\"\\\"; do test  -n \\\"$conv\\\" && new_convenience=\\\"$new_convenience $wl-force_load,$conv\\\"; done; func_echo_all \\\"$new_convenience\\\"`'\n\n  else\n    whole_archive_flag_spec=''\n  fi\n  link_all_deplibs=yes\n  allow_undefined_flag=$_lt_dar_allow_undefined\n  case $cc_basename in\n     ifort*|nagfor*) _lt_dar_can_shared=yes ;;\n     *) _lt_dar_can_shared=$GCC ;;\n  esac\n  if test yes = \"$_lt_dar_can_shared\"; then\n    output_verbose_link_cmd=func_echo_all\n    archive_cmds=\"\\$CC -dynamiclib \\$allow_undefined_flag -o \\$lib \\$libobjs \\$deplibs \\$compiler_flags -install_name \\$rpath/\\$soname \\$verstring $_lt_dar_single_mod$_lt_dsymutil\"\n    module_cmds=\"\\$CC \\$allow_undefined_flag -o \\$lib -bundle \\$libobjs \\$deplibs \\$compiler_flags$_lt_dsymutil\"\n    archive_expsym_cmds=\"sed 's|^|_|' < \\$export_symbols > \\$output_objdir/\\$libname-symbols.expsym~\\$CC -dynamiclib \\$allow_undefined_flag -o \\$lib \\$libobjs \\$deplibs \\$compiler_flags -install_name \\$rpath/\\$soname \\$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil\"\n    module_expsym_cmds=\"sed -e 's|^|_|' < \\$export_symbols > \\$output_objdir/\\$libname-symbols.expsym~\\$CC \\$allow_undefined_flag -o \\$lib -bundle \\$libobjs \\$deplibs \\$compiler_flags$_lt_dar_export_syms$_lt_dsymutil\"\n\n  else\n  ld_shlibs=no\n  fi\n\n      ;;\n\n    dgux*)\n      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_shlibpath_var=no\n      ;;\n\n    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor\n    # support.  Future versions do this automatically, but an explicit c++rt0.o\n    # does not break anything, and helps significantly (at the cost of a little\n    # extra space).\n    freebsd2.2*)\n      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'\n      hardcode_libdir_flag_spec='-R$libdir'\n      hardcode_direct=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    # Unfortunately, older versions of FreeBSD 2 do not have this feature.\n    freebsd2.*)\n      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_direct=yes\n      hardcode_minus_L=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.\n    freebsd* | dragonfly*)\n      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n      hardcode_libdir_flag_spec='-R$libdir'\n      hardcode_direct=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    hpux9*)\n      if test yes = \"$GCC\"; then\n\tarchive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test \"x$output_objdir/$soname\" = \"x$lib\" || mv $output_objdir/$soname $lib'\n      else\n\tarchive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test \"x$output_objdir/$soname\" = \"x$lib\" || mv $output_objdir/$soname $lib'\n      fi\n      hardcode_libdir_flag_spec='$wl+b $wl$libdir'\n      hardcode_libdir_separator=:\n      hardcode_direct=yes\n\n      # hardcode_minus_L: Not really in the search PATH,\n      # but as the default location of the library.\n      hardcode_minus_L=yes\n      export_dynamic_flag_spec='$wl-E'\n      ;;\n\n    hpux10*)\n      if test yes,no = \"$GCC,$with_gnu_ld\"; then\n\tarchive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\tarchive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'\n      fi\n      if test no = \"$with_gnu_ld\"; then\n\thardcode_libdir_flag_spec='$wl+b $wl$libdir'\n\thardcode_libdir_separator=:\n\thardcode_direct=yes\n\thardcode_direct_absolute=yes\n\texport_dynamic_flag_spec='$wl-E'\n\t# hardcode_minus_L: Not really in the search PATH,\n\t# but as the default location of the library.\n\thardcode_minus_L=yes\n      fi\n      ;;\n\n    hpux11*)\n      if test yes,no = \"$GCC,$with_gnu_ld\"; then\n\tcase $host_cpu in\n\thppa*64*)\n\t  archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tia64*)\n\t  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\t*)\n\t  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tesac\n      else\n\tcase $host_cpu in\n\thppa*64*)\n\t  archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tia64*)\n\t  archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\t*)\n\n\t  # Older versions of the 11.00 compiler do not understand -b yet\n\t  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)\n\t  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if $CC understands -b\" >&5\n$as_echo_n \"checking if $CC understands -b... \" >&6; }\nif ${lt_cv_prog_compiler__b+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_prog_compiler__b=no\n   save_LDFLAGS=$LDFLAGS\n   LDFLAGS=\"$LDFLAGS -b\"\n   echo \"$lt_simple_link_test_code\" > conftest.$ac_ext\n   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then\n     # The linker can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test -s conftest.err; then\n       # Append any errors to the config.log.\n       cat conftest.err 1>&5\n       $ECHO \"$_lt_linker_boilerplate\" | $SED '/^$/d' > conftest.exp\n       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2\n       if diff conftest.exp conftest.er2 >/dev/null; then\n         lt_cv_prog_compiler__b=yes\n       fi\n     else\n       lt_cv_prog_compiler__b=yes\n     fi\n   fi\n   $RM -r conftest*\n   LDFLAGS=$save_LDFLAGS\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b\" >&5\n$as_echo \"$lt_cv_prog_compiler__b\" >&6; }\n\nif test yes = \"$lt_cv_prog_compiler__b\"; then\n    archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'\nelse\n    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'\nfi\n\n\t  ;;\n\tesac\n      fi\n      if test no = \"$with_gnu_ld\"; then\n\thardcode_libdir_flag_spec='$wl+b $wl$libdir'\n\thardcode_libdir_separator=:\n\n\tcase $host_cpu in\n\thppa*64*|ia64*)\n\t  hardcode_direct=no\n\t  hardcode_shlibpath_var=no\n\t  ;;\n\t*)\n\t  hardcode_direct=yes\n\t  hardcode_direct_absolute=yes\n\t  export_dynamic_flag_spec='$wl-E'\n\n\t  # hardcode_minus_L: Not really in the search PATH,\n\t  # but as the default location of the library.\n\t  hardcode_minus_L=yes\n\t  ;;\n\tesac\n      fi\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      if test yes = \"$GCC\"; then\n\tarchive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n \"$verstring\" && func_echo_all \"$wl-set_version $wl$verstring\"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'\n\t# Try to use the -exported_symbol ld option, if it does not\n\t# work, assume that -exports_file does not work either and\n\t# implicitly export all symbols.\n\t# This should be the same for all languages, so no per-tag cache variable.\n\t{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol\" >&5\n$as_echo_n \"checking whether the $host_os linker accepts -exported_symbol... \" >&6; }\nif ${lt_cv_irix_exported_symbol+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  save_LDFLAGS=$LDFLAGS\n\t   LDFLAGS=\"$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null\"\n\t   cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\nint foo (void) { return 0; }\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  lt_cv_irix_exported_symbol=yes\nelse\n  lt_cv_irix_exported_symbol=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\n           LDFLAGS=$save_LDFLAGS\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol\" >&5\n$as_echo \"$lt_cv_irix_exported_symbol\" >&6; }\n\tif test yes = \"$lt_cv_irix_exported_symbol\"; then\n          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n \"$verstring\" && func_echo_all \"$wl-set_version $wl$verstring\"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'\n\tfi\n      else\n\tarchive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n \"$verstring\" && func_echo_all \"-set_version $verstring\"` -update_registry $output_objdir/so_locations -o $lib'\n\tarchive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n \"$verstring\" && func_echo_all \"-set_version $verstring\"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'\n      fi\n      archive_cmds_need_lc='no'\n      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'\n      hardcode_libdir_separator=:\n      inherit_rpath=yes\n      link_all_deplibs=yes\n      ;;\n\n    linux*)\n      case $cc_basename in\n      tcc*)\n\t# Fabrice Bellard et al's Tiny C Compiler\n\tld_shlibs=yes\n\tarchive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t;;\n      esac\n      ;;\n\n    netbsd*)\n      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then\n\tarchive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out\n      else\n\tarchive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF\n      fi\n      hardcode_libdir_flag_spec='-R$libdir'\n      hardcode_direct=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    newsos6)\n      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_direct=yes\n      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'\n      hardcode_libdir_separator=:\n      hardcode_shlibpath_var=no\n      ;;\n\n    *nto* | *qnx*)\n      ;;\n\n    openbsd* | bitrig*)\n      if test -f /usr/libexec/ld.so; then\n\thardcode_direct=yes\n\thardcode_shlibpath_var=no\n\thardcode_direct_absolute=yes\n\tif test -z \"`echo __ELF__ | $CC -E - | $GREP __ELF__`\"; then\n\t  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'\n\t  hardcode_libdir_flag_spec='$wl-rpath,$libdir'\n\t  export_dynamic_flag_spec='$wl-E'\n\telse\n\t  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t  hardcode_libdir_flag_spec='$wl-rpath,$libdir'\n\tfi\n      else\n\tld_shlibs=no\n      fi\n      ;;\n\n    os2*)\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_minus_L=yes\n      allow_undefined_flag=unsupported\n      shrext_cmds=.dll\n      archive_cmds='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\temxexp $libobjs | $SED /\"_DLL_InitTerm\"/d >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      archive_expsym_cmds='$ECHO \"LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE\" > $output_objdir/$libname.def~\n\t$ECHO \"DESCRIPTION \\\"$libname\\\"\" >> $output_objdir/$libname.def~\n\t$ECHO \"DATA MULTIPLE NONSHARED\" >> $output_objdir/$libname.def~\n\t$ECHO EXPORTS >> $output_objdir/$libname.def~\n\tprefix_cmds=\"$SED\"~\n\tif test EXPORTS = \"`$SED 1q $export_symbols`\"; then\n\t  prefix_cmds=\"$prefix_cmds -e 1d\";\n\tfi~\n\tprefix_cmds=\"$prefix_cmds -e \\\"s/^\\(.*\\)$/_\\1/g\\\"\"~\n\tcat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~\n\t$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~\n\temximp -o $lib $output_objdir/$libname.def'\n      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'\n      enable_shared_with_static_runtimes=yes\n      ;;\n\n    osf3*)\n      if test yes = \"$GCC\"; then\n\tallow_undefined_flag=' $wl-expect_unresolved $wl\\*'\n\tarchive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n \"$verstring\" && func_echo_all \"$wl-set_version $wl$verstring\"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'\n      else\n\tallow_undefined_flag=' -expect_unresolved \\*'\n\tarchive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n \"$verstring\" && func_echo_all \"-set_version $verstring\"` -update_registry $output_objdir/so_locations -o $lib'\n      fi\n      archive_cmds_need_lc='no'\n      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'\n      hardcode_libdir_separator=:\n      ;;\n\n    osf4* | osf5*)\t# as osf3* with the addition of -msym flag\n      if test yes = \"$GCC\"; then\n\tallow_undefined_flag=' $wl-expect_unresolved $wl\\*'\n\tarchive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n \"$verstring\" && func_echo_all \"$wl-set_version $wl$verstring\"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'\n\thardcode_libdir_flag_spec='$wl-rpath $wl$libdir'\n      else\n\tallow_undefined_flag=' -expect_unresolved \\*'\n\tarchive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n \"$verstring\" && func_echo_all \"-set_version $verstring\"` -update_registry $output_objdir/so_locations -o $lib'\n\tarchive_expsym_cmds='for i in `cat $export_symbols`; do printf \"%s %s\\\\n\" -exported_symbol \"\\$i\" >> $lib.exp; done; printf \"%s\\\\n\" \"-hidden\">> $lib.exp~\n          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n \"$verstring\" && $ECHO \"-set_version $verstring\"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'\n\n\t# Both c and cxx compiler support -rpath directly\n\thardcode_libdir_flag_spec='-rpath $libdir'\n      fi\n      archive_cmds_need_lc='no'\n      hardcode_libdir_separator=:\n      ;;\n\n    solaris*)\n      no_undefined_flag=' -z defs'\n      if test yes = \"$GCC\"; then\n\twlarc='$wl'\n\tarchive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'\n\tarchive_expsym_cmds='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'\n      else\n\tcase `$CC -V 2>&1` in\n\t*\"Compilers 5.0\"*)\n\t  wlarc=''\n\t  archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  archive_expsym_cmds='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'\n\t  ;;\n\t*)\n\t  wlarc='$wl'\n\t  archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  archive_expsym_cmds='echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~echo \"local: *; };\" >> $lib.exp~\n            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'\n\t  ;;\n\tesac\n      fi\n      hardcode_libdir_flag_spec='-R$libdir'\n      hardcode_shlibpath_var=no\n      case $host_os in\n      solaris2.[0-5] | solaris2.[0-5].*) ;;\n      *)\n\t# The compiler driver will combine and reorder linker options,\n\t# but understands '-z linker_flag'.  GCC discards it without '$wl',\n\t# but is careful enough not to reorder.\n\t# Supported since Solaris 2.6 (maybe 2.5.1?)\n\tif test yes = \"$GCC\"; then\n\t  whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'\n\telse\n\t  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'\n\tfi\n\t;;\n      esac\n      link_all_deplibs=yes\n      ;;\n\n    sunos4*)\n      if test sequent = \"$host_vendor\"; then\n\t# Use $CC to link under sequent, because it throws in some extra .o\n\t# files that make .init and .fini sections work.\n\tarchive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\tarchive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'\n      fi\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_direct=yes\n      hardcode_minus_L=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    sysv4)\n      case $host_vendor in\n\tsni)\n\t  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  hardcode_direct=yes # is this really true???\n\t;;\n\tsiemens)\n\t  ## LD is ld it makes a PLAMLIB\n\t  ## CC just makes a GrossModule.\n\t  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'\n\t  reload_cmds='$CC -r -o $output$reload_objs'\n\t  hardcode_direct=no\n        ;;\n\tmotorola)\n\t  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  hardcode_direct=no #Motorola manual says yes, but my tests say they lie\n\t;;\n      esac\n      runpath_var='LD_RUN_PATH'\n      hardcode_shlibpath_var=no\n      ;;\n\n    sysv4.3*)\n      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_shlibpath_var=no\n      export_dynamic_flag_spec='-Bexport'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\tarchive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\thardcode_shlibpath_var=no\n\trunpath_var=LD_RUN_PATH\n\thardcode_runpath_var=yes\n\tld_shlibs=yes\n      fi\n      ;;\n\n    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)\n      no_undefined_flag='$wl-z,text'\n      archive_cmds_need_lc=no\n      hardcode_shlibpath_var=no\n      runpath_var='LD_RUN_PATH'\n\n      if test yes = \"$GCC\"; then\n\tarchive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\tarchive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\tarchive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\tarchive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      fi\n      ;;\n\n    sysv5* | sco3.2v5* | sco5v6*)\n      # Note: We CANNOT use -z defs as we might desire, because we do not\n      # link with -lc, and that would cause any symbols used from libc to\n      # always be unresolved, which means just about no library would\n      # ever link correctly.  If we're not using GNU ld we use -z text\n      # though, which does catch some bad symbols but isn't as heavy-handed\n      # as -z defs.\n      no_undefined_flag='$wl-z,text'\n      allow_undefined_flag='$wl-z,nodefs'\n      archive_cmds_need_lc=no\n      hardcode_shlibpath_var=no\n      hardcode_libdir_flag_spec='$wl-R,$libdir'\n      hardcode_libdir_separator=':'\n      link_all_deplibs=yes\n      export_dynamic_flag_spec='$wl-Bexport'\n      runpath_var='LD_RUN_PATH'\n\n      if test yes = \"$GCC\"; then\n\tarchive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\tarchive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\tarchive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n\tarchive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'\n      fi\n      ;;\n\n    uts4*)\n      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_shlibpath_var=no\n      ;;\n\n    *)\n      ld_shlibs=no\n      ;;\n    esac\n\n    if test sni = \"$host_vendor\"; then\n      case $host in\n      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)\n\texport_dynamic_flag_spec='$wl-Blargedynsym'\n\t;;\n      esac\n    fi\n  fi\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ld_shlibs\" >&5\n$as_echo \"$ld_shlibs\" >&6; }\ntest no = \"$ld_shlibs\" && can_build_shared=no\n\nwith_gnu_ld=$with_gnu_ld\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#\n# Do we need to explicitly link libc?\n#\ncase \"x$archive_cmds_need_lc\" in\nx|xyes)\n  # Assume -lc should be added\n  archive_cmds_need_lc=yes\n\n  if test yes,yes = \"$GCC,$enable_shared\"; then\n    case $archive_cmds in\n    *'~'*)\n      # FIXME: we may have to deal with multi-command sequences.\n      ;;\n    '$CC '*)\n      # Test whether the compiler implicitly links with -lc since on some\n      # systems, -lgcc has to come before -lc. If gcc already passes -lc\n      # to ld, don't add -lc before -lgcc.\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in\" >&5\n$as_echo_n \"checking whether -lc should be explicitly linked in... \" >&6; }\nif ${lt_cv_archive_cmds_need_lc+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  $RM conftest*\n\techo \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n\tif { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_compile\\\"\"; } >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } 2>conftest.err; then\n\t  soname=conftest\n\t  lib=conftest\n\t  libobjs=conftest.$ac_objext\n\t  deplibs=\n\t  wl=$lt_prog_compiler_wl\n\t  pic_flag=$lt_prog_compiler_pic\n\t  compiler_flags=-v\n\t  linker_flags=-v\n\t  verstring=\n\t  output_objdir=.\n\t  libname=conftest\n\t  lt_save_allow_undefined_flag=$allow_undefined_flag\n\t  allow_undefined_flag=\n\t  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$archive_cmds 2\\>\\&1 \\| $GREP \\\" -lc \\\" \\>/dev/null 2\\>\\&1\\\"\"; } >&5\n  (eval $archive_cmds 2\\>\\&1 \\| $GREP \\\" -lc \\\" \\>/dev/null 2\\>\\&1) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n\t  then\n\t    lt_cv_archive_cmds_need_lc=no\n\t  else\n\t    lt_cv_archive_cmds_need_lc=yes\n\t  fi\n\t  allow_undefined_flag=$lt_save_allow_undefined_flag\n\telse\n\t  cat conftest.err 1>&5\n\tfi\n\t$RM conftest*\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc\" >&5\n$as_echo \"$lt_cv_archive_cmds_need_lc\" >&6; }\n      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc\n      ;;\n    esac\n  fi\n  ;;\nesac\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics\" >&5\n$as_echo_n \"checking dynamic linker characteristics... \" >&6; }\n\nif test yes = \"$GCC\"; then\n  case $host_os in\n    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;\n    *) lt_awk_arg='/^libraries:/' ;;\n  esac\n  case $host_os in\n    mingw* | cegcc*) lt_sed_strip_eq='s|=\\([A-Za-z]:\\)|\\1|g' ;;\n    *) lt_sed_strip_eq='s|=/|/|g' ;;\n  esac\n  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e \"s/^libraries://\" -e $lt_sed_strip_eq`\n  case $lt_search_path_spec in\n  *\\;*)\n    # if the path contains \";\" then we assume it to be the separator\n    # otherwise default to the standard path separator (i.e. \":\") - it is\n    # assumed that no part of a normal pathname contains \";\" but that should\n    # okay in the real world where \";\" in dirpaths is itself problematic.\n    lt_search_path_spec=`$ECHO \"$lt_search_path_spec\" | $SED 's/;/ /g'`\n    ;;\n  *)\n    lt_search_path_spec=`$ECHO \"$lt_search_path_spec\" | $SED \"s/$PATH_SEPARATOR/ /g\"`\n    ;;\n  esac\n  # Ok, now we have the path, separated by spaces, we can step through it\n  # and add multilib dir if necessary...\n  lt_tmp_lt_search_path_spec=\n  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`\n  # ...but if some path component already ends with the multilib dir we assume\n  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).\n  case \"$lt_multi_os_dir; $lt_search_path_spec \" in\n  \"/; \"* | \"/.; \"* | \"/./; \"* | *\"$lt_multi_os_dir \"* | *\"$lt_multi_os_dir/ \"*)\n    lt_multi_os_dir=\n    ;;\n  esac\n  for lt_sys_path in $lt_search_path_spec; do\n    if test -d \"$lt_sys_path$lt_multi_os_dir\"; then\n      lt_tmp_lt_search_path_spec=\"$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir\"\n    elif test -n \"$lt_multi_os_dir\"; then\n      test -d \"$lt_sys_path\" && \\\n\tlt_tmp_lt_search_path_spec=\"$lt_tmp_lt_search_path_spec $lt_sys_path\"\n    fi\n  done\n  lt_search_path_spec=`$ECHO \"$lt_tmp_lt_search_path_spec\" | awk '\nBEGIN {RS = \" \"; FS = \"/|\\n\";} {\n  lt_foo = \"\";\n  lt_count = 0;\n  for (lt_i = NF; lt_i > 0; lt_i--) {\n    if ($lt_i != \"\" && $lt_i != \".\") {\n      if ($lt_i == \"..\") {\n        lt_count++;\n      } else {\n        if (lt_count == 0) {\n          lt_foo = \"/\" $lt_i lt_foo;\n        } else {\n          lt_count--;\n        }\n      }\n    }\n  }\n  if (lt_foo != \"\") { lt_freq[lt_foo]++; }\n  if (lt_freq[lt_foo] == 1) { print lt_foo; }\n}'`\n  # AWK program above erroneously prepends '/' to C:/dos/paths\n  # for these hosts.\n  case $host_os in\n    mingw* | cegcc*) lt_search_path_spec=`$ECHO \"$lt_search_path_spec\" |\\\n      $SED 's|/\\([A-Za-z]:\\)|\\1|g'` ;;\n  esac\n  sys_lib_search_path_spec=`$ECHO \"$lt_search_path_spec\" | $lt_NL2SP`\nelse\n  sys_lib_search_path_spec=\"/lib /usr/lib /usr/local/lib\"\nfi\nlibrary_names_spec=\nlibname_spec='lib$name'\nsoname_spec=\nshrext_cmds=.so\npostinstall_cmds=\npostuninstall_cmds=\nfinish_cmds=\nfinish_eval=\nshlibpath_var=\nshlibpath_overrides_runpath=unknown\nversion_type=none\ndynamic_linker=\"$host_os ld.so\"\nsys_lib_dlsearch_path_spec=\"/lib /usr/lib\"\nneed_lib_prefix=unknown\nhardcode_into_libs=no\n\n# when you set need_version to no, make sure it does not cause -set_version\n# flags to be left without arguments\nneed_version=unknown\n\n\n\ncase $host_os in\naix3*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'\n  shlibpath_var=LIBPATH\n\n  # AIX 3 has no versioning support, so we append a major version to the name.\n  soname_spec='$libname$release$shared_ext$major'\n  ;;\n\naix[4-9]*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  hardcode_into_libs=yes\n  if test ia64 = \"$host_cpu\"; then\n    # AIX 5 supports IA64\n    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'\n    shlibpath_var=LD_LIBRARY_PATH\n  else\n    # With GCC up to 2.95.x, collect2 would create an import file\n    # for dependence libraries.  The import file would start with\n    # the line '#! .'.  This would cause the generated library to\n    # depend on '.', always an invalid library.  This was fixed in\n    # development snapshots of GCC prior to 3.0.\n    case $host_os in\n      aix4 | aix4.[01] | aix4.[01].*)\n      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'\n\t   echo ' yes '\n\t   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then\n\t:\n      else\n\tcan_build_shared=no\n      fi\n      ;;\n    esac\n    # Using Import Files as archive members, it is possible to support\n    # filename-based versioning of shared library archives on AIX. While\n    # this would work for both with and without runtime linking, it will\n    # prevent static linking of such archives. So we do filename-based\n    # shared library versioning with .so extension only, which is used\n    # when both runtime linking and shared linking is enabled.\n    # Unfortunately, runtime linking may impact performance, so we do\n    # not want this to be the default eventually. Also, we use the\n    # versioned .so libs for executables only if there is the -brtl\n    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.\n    # To allow for filename-based versioning support, we need to create\n    # libNAME.so.V as an archive file, containing:\n    # *) an Import File, referring to the versioned filename of the\n    #    archive as well as the shared archive member, telling the\n    #    bitwidth (32 or 64) of that shared object, and providing the\n    #    list of exported symbols of that shared object, eventually\n    #    decorated with the 'weak' keyword\n    # *) the shared object with the F_LOADONLY flag set, to really avoid\n    #    it being seen by the linker.\n    # At run time we better use the real file rather than another symlink,\n    # but for link time we create the symlink libNAME.so -> libNAME.so.V\n\n    case $with_aix_soname,$aix_use_runtimelinking in\n    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct\n    # soname into executable. Probably we can add versioning support to\n    # collect2, so additional links can be useful in future.\n    aix,yes) # traditional libtool\n      dynamic_linker='AIX unversionable lib.so'\n      # If using run time linking (on AIX 4.2 or later) use lib<name>.so\n      # instead of lib<name>.a to let people know that these are not\n      # typical AIX shared libraries.\n      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n      ;;\n    aix,no) # traditional AIX only\n      dynamic_linker='AIX lib.a(lib.so.V)'\n      # We preserve .a as extension for shared libraries through AIX4.2\n      # and later when we are not doing run time linking.\n      library_names_spec='$libname$release.a $libname.a'\n      soname_spec='$libname$release$shared_ext$major'\n      ;;\n    svr4,*) # full svr4 only\n      dynamic_linker=\"AIX lib.so.V($shared_archive_member_spec.o)\"\n      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'\n      # We do not specify a path in Import Files, so LIBPATH fires.\n      shlibpath_overrides_runpath=yes\n      ;;\n    *,yes) # both, prefer svr4\n      dynamic_linker=\"AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)\"\n      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'\n      # unpreferred sharedlib libNAME.a needs extra handling\n      postinstall_cmds='test -n \"$linkname\" || linkname=\"$realname\"~func_stripname \"\" \".so\" \"$linkname\"~$install_shared_prog \"$dir/$func_stripname_result.$libext\" \"$destdir/$func_stripname_result.$libext\"~test -z \"$tstripme\" || test -z \"$striplib\" || $striplib \"$destdir/$func_stripname_result.$libext\"'\n      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname \"\" \".so\" \"$n\"~test \"$func_stripname_result\" = \"$n\" || func_append rmfiles \" $odir/$func_stripname_result.$libext\"'\n      # We do not specify a path in Import Files, so LIBPATH fires.\n      shlibpath_overrides_runpath=yes\n      ;;\n    *,no) # both, prefer aix\n      dynamic_linker=\"AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)\"\n      library_names_spec='$libname$release.a $libname.a'\n      soname_spec='$libname$release$shared_ext$major'\n      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling\n      postinstall_cmds='test -z \"$dlname\" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z \"$tstripme\" || test -z \"$striplib\" || $striplib $destdir/$dlname~test -n \"$linkname\" || linkname=$realname~func_stripname \"\" \".a\" \"$linkname\"~(cd \"$destdir\" && $LN_S -f $dlname $func_stripname_result.so)'\n      postuninstall_cmds='test -z \"$dlname\" || func_append rmfiles \" $odir/$dlname\"~for n in $old_library $library_names; do :; done~func_stripname \"\" \".a\" \"$n\"~func_append rmfiles \" $odir/$func_stripname_result.so\"'\n      ;;\n    esac\n    shlibpath_var=LIBPATH\n  fi\n  ;;\n\namigaos*)\n  case $host_cpu in\n  powerpc)\n    # Since July 2007 AmigaOS4 officially supports .so libraries.\n    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    ;;\n  m68k)\n    library_names_spec='$libname.ixlibrary $libname.a'\n    # Create ${libname}_ixlibrary.a entries in /sys/libs.\n    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all \"$lib\" | $SED '\\''s%^.*/\\([^/]*\\)\\.ixlibrary$%\\1%'\\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show \"cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a\"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'\n    ;;\n  esac\n  ;;\n\nbeos*)\n  library_names_spec='$libname$shared_ext'\n  dynamic_linker=\"$host_os ld.so\"\n  shlibpath_var=LIBRARY_PATH\n  ;;\n\nbsdi[45]*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib\"\n  sys_lib_dlsearch_path_spec=\"/shlib /usr/lib /usr/local/lib\"\n  # the default ld.so.conf also contains /usr/contrib/lib and\n  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow\n  # libtool to hard-code these into programs\n  ;;\n\ncygwin* | mingw* | pw32* | cegcc*)\n  version_type=windows\n  shrext_cmds=.dll\n  need_version=no\n  need_lib_prefix=no\n\n  case $GCC,$cc_basename in\n  yes,*)\n    # gcc\n    library_names_spec='$libname.dll.a'\n    # DLL is installed to $(libdir)/../bin by postinstall_cmds\n    postinstall_cmds='base_file=`basename \\$file`~\n      dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\$base_file'\\''i; echo \\$dlname'\\''`~\n      dldir=$destdir/`dirname \\$dlpath`~\n      test -d \\$dldir || mkdir -p \\$dldir~\n      $install_prog $dir/$dlname \\$dldir/$dlname~\n      chmod a+x \\$dldir/$dlname~\n      if test -n '\\''$stripme'\\'' && test -n '\\''$striplib'\\''; then\n        eval '\\''$striplib \\$dldir/$dlname'\\'' || exit \\$?;\n      fi'\n    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; echo \\$dlname'\\''`~\n      dlpath=$dir/\\$dldll~\n       $RM \\$dlpath'\n    shlibpath_overrides_runpath=yes\n\n    case $host_os in\n    cygwin*)\n      # Cygwin DLLs use 'cyg' prefix rather than 'lib'\n      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'\n\n      sys_lib_search_path_spec=\"$sys_lib_search_path_spec /usr/lib/w32api\"\n      ;;\n    mingw* | cegcc*)\n      # MinGW DLLs use traditional 'lib' prefix\n      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'\n      ;;\n    pw32*)\n      # pw32 DLLs use 'pw' prefix rather than 'lib'\n      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'\n      ;;\n    esac\n    dynamic_linker='Win32 ld.exe'\n    ;;\n\n  *,cl*)\n    # Native MSVC\n    libname_spec='$name'\n    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'\n    library_names_spec='$libname.dll.lib'\n\n    case $build_os in\n    mingw*)\n      sys_lib_search_path_spec=\n      lt_save_ifs=$IFS\n      IFS=';'\n      for lt_path in $LIB\n      do\n        IFS=$lt_save_ifs\n        # Let DOS variable expansion print the short 8.3 style file name.\n        lt_path=`cd \"$lt_path\" 2>/dev/null && cmd //C \"for %i in (\".\") do @echo %~si\"`\n        sys_lib_search_path_spec=\"$sys_lib_search_path_spec $lt_path\"\n      done\n      IFS=$lt_save_ifs\n      # Convert to MSYS style.\n      sys_lib_search_path_spec=`$ECHO \"$sys_lib_search_path_spec\" | sed -e 's|\\\\\\\\|/|g' -e 's| \\\\([a-zA-Z]\\\\):| /\\\\1|g' -e 's|^ ||'`\n      ;;\n    cygwin*)\n      # Convert to unix form, then to dos form, then back to unix form\n      # but this time dos style (no spaces!) so that the unix form looks\n      # like /cygdrive/c/PROGRA~1:/cygdr...\n      sys_lib_search_path_spec=`cygpath --path --unix \"$LIB\"`\n      sys_lib_search_path_spec=`cygpath --path --dos \"$sys_lib_search_path_spec\" 2>/dev/null`\n      sys_lib_search_path_spec=`cygpath --path --unix \"$sys_lib_search_path_spec\" | $SED -e \"s/$PATH_SEPARATOR/ /g\"`\n      ;;\n    *)\n      sys_lib_search_path_spec=$LIB\n      if $ECHO \"$sys_lib_search_path_spec\" | $GREP ';[c-zC-Z]:/' >/dev/null; then\n        # It is most probably a Windows format PATH.\n        sys_lib_search_path_spec=`$ECHO \"$sys_lib_search_path_spec\" | $SED -e 's/;/ /g'`\n      else\n        sys_lib_search_path_spec=`$ECHO \"$sys_lib_search_path_spec\" | $SED -e \"s/$PATH_SEPARATOR/ /g\"`\n      fi\n      # FIXME: find the short name or the path components, as spaces are\n      # common. (e.g. \"Program Files\" -> \"PROGRA~1\")\n      ;;\n    esac\n\n    # DLL is installed to $(libdir)/../bin by postinstall_cmds\n    postinstall_cmds='base_file=`basename \\$file`~\n      dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\$base_file'\\''i; echo \\$dlname'\\''`~\n      dldir=$destdir/`dirname \\$dlpath`~\n      test -d \\$dldir || mkdir -p \\$dldir~\n      $install_prog $dir/$dlname \\$dldir/$dlname'\n    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; echo \\$dlname'\\''`~\n      dlpath=$dir/\\$dldll~\n       $RM \\$dlpath'\n    shlibpath_overrides_runpath=yes\n    dynamic_linker='Win32 link.exe'\n    ;;\n\n  *)\n    # Assume MSVC wrapper\n    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'\n    dynamic_linker='Win32 ld.exe'\n    ;;\n  esac\n  # FIXME: first we should search . and the directory the executable is in\n  shlibpath_var=PATH\n  ;;\n\ndarwin* | rhapsody*)\n  dynamic_linker=\"$host_os dyld\"\n  version_type=darwin\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'\n  soname_spec='$libname$release$major$shared_ext'\n  shlibpath_overrides_runpath=yes\n  shlibpath_var=DYLD_LIBRARY_PATH\n  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'\n\n  sys_lib_search_path_spec=\"$sys_lib_search_path_spec /usr/local/lib\"\n  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'\n  ;;\n\ndgux*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\nfreebsd* | dragonfly*)\n  # DragonFly does not have aout.  When/if they implement a new\n  # versioning mechanism, adjust this.\n  if test -x /usr/bin/objformat; then\n    objformat=`/usr/bin/objformat`\n  else\n    case $host_os in\n    freebsd[23].*) objformat=aout ;;\n    *) objformat=elf ;;\n    esac\n  fi\n  version_type=freebsd-$objformat\n  case $version_type in\n    freebsd-elf*)\n      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n      soname_spec='$libname$release$shared_ext$major'\n      need_version=no\n      need_lib_prefix=no\n      ;;\n    freebsd-*)\n      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n      need_version=yes\n      ;;\n  esac\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_os in\n  freebsd2.*)\n    shlibpath_overrides_runpath=yes\n    ;;\n  freebsd3.[01]* | freebsdelf3.[01]*)\n    shlibpath_overrides_runpath=yes\n    hardcode_into_libs=yes\n    ;;\n  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \\\n  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)\n    shlibpath_overrides_runpath=no\n    hardcode_into_libs=yes\n    ;;\n  *) # from 4.6 on, and DragonFly\n    shlibpath_overrides_runpath=yes\n    hardcode_into_libs=yes\n    ;;\n  esac\n  ;;\n\nhaiku*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  dynamic_linker=\"$host_os runtime_loader\"\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'\n  hardcode_into_libs=yes\n  ;;\n\nhpux9* | hpux10* | hpux11*)\n  # Give a soname corresponding to the major version so that dld.sl refuses to\n  # link against other versions.\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  case $host_cpu in\n  ia64*)\n    shrext_cmds='.so'\n    hardcode_into_libs=yes\n    dynamic_linker=\"$host_os dld.so\"\n    shlibpath_var=LD_LIBRARY_PATH\n    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    if test 32 = \"$HPUX_IA64_MODE\"; then\n      sys_lib_search_path_spec=\"/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib\"\n      sys_lib_dlsearch_path_spec=/usr/lib/hpux32\n    else\n      sys_lib_search_path_spec=\"/usr/lib/hpux64 /usr/local/lib/hpux64\"\n      sys_lib_dlsearch_path_spec=/usr/lib/hpux64\n    fi\n    ;;\n  hppa*64*)\n    shrext_cmds='.sl'\n    hardcode_into_libs=yes\n    dynamic_linker=\"$host_os dld.sl\"\n    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH\n    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    sys_lib_search_path_spec=\"/usr/lib/pa20_64 /usr/ccs/lib/pa20_64\"\n    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n    ;;\n  *)\n    shrext_cmds='.sl'\n    dynamic_linker=\"$host_os dld.sl\"\n    shlibpath_var=SHLIB_PATH\n    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    ;;\n  esac\n  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...\n  postinstall_cmds='chmod 555 $lib'\n  # or fails outright, so override atomically:\n  install_override_mode=555\n  ;;\n\ninterix[3-9]*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  ;;\n\nirix5* | irix6* | nonstopux*)\n  case $host_os in\n    nonstopux*) version_type=nonstopux ;;\n    *)\n\tif test yes = \"$lt_cv_prog_gnu_ld\"; then\n\t\tversion_type=linux # correct to gnu/linux during the next big refactor\n\telse\n\t\tversion_type=irix\n\tfi ;;\n  esac\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='$libname$release$shared_ext$major'\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'\n  case $host_os in\n  irix5* | nonstopux*)\n    libsuff= shlibsuff=\n    ;;\n  *)\n    case $LD in # libtool.m4 will add one of these switches to LD\n    *-32|*\"-32 \"|*-melf32bsmip|*\"-melf32bsmip \")\n      libsuff= shlibsuff= libmagic=32-bit;;\n    *-n32|*\"-n32 \"|*-melf32bmipn32|*\"-melf32bmipn32 \")\n      libsuff=32 shlibsuff=N32 libmagic=N32;;\n    *-64|*\"-64 \"|*-melf64bmip|*\"-melf64bmip \")\n      libsuff=64 shlibsuff=64 libmagic=64-bit;;\n    *) libsuff= shlibsuff= libmagic=never-match;;\n    esac\n    ;;\n  esac\n  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH\n  shlibpath_overrides_runpath=no\n  sys_lib_search_path_spec=\"/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff\"\n  sys_lib_dlsearch_path_spec=\"/usr/lib$libsuff /lib$libsuff\"\n  hardcode_into_libs=yes\n  ;;\n\n# No shared lib support for Linux oldld, aout, or coff.\nlinux*oldld* | linux*aout* | linux*coff*)\n  dynamic_linker=no\n  ;;\n\nlinux*android*)\n  version_type=none # Android doesn't support versioned libraries.\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext'\n  soname_spec='$libname$release$shared_ext'\n  finish_cmds=\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n\n  # This implies no fast_install, which is unacceptable.\n  # Some rework will be needed to allow for fast_install\n  # before this can be enabled.\n  hardcode_into_libs=yes\n\n  dynamic_linker='Android linker'\n  # Don't embed -rpath directories since the linker doesn't support them.\n  hardcode_libdir_flag_spec='-L$libdir'\n  ;;\n\n# This must be glibc/ELF.\nlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -n $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n\n  # Some binutils ld are patched to set DT_RUNPATH\n  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  lt_cv_shlibpath_overrides_runpath=no\n    save_LDFLAGS=$LDFLAGS\n    save_libdir=$libdir\n    eval \"libdir=/foo; wl=\\\"$lt_prog_compiler_wl\\\"; \\\n\t LDFLAGS=\\\"\\$LDFLAGS $hardcode_libdir_flag_spec\\\"\"\n    cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep \"RUNPATH.*$libdir\" >/dev/null; then :\n  lt_cv_shlibpath_overrides_runpath=yes\nfi\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\n    LDFLAGS=$save_LDFLAGS\n    libdir=$save_libdir\n\nfi\n\n  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath\n\n  # This implies no fast_install, which is unacceptable.\n  # Some rework will be needed to allow for fast_install\n  # before this can be enabled.\n  hardcode_into_libs=yes\n\n  # Ideally, we could use ldconfig to report *all* directores which are\n  # searched for libraries, however this is still not possible.  Aside from not\n  # being certain /sbin/ldconfig is available, command\n  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,\n  # even though it is searched at run-time.  Try to do the best guess by\n  # appending ld.so.conf contents (and includes) to the search path.\n  if test -f /etc/ld.so.conf; then\n    lt_ld_extra=`awk '/^include / { system(sprintf(\"cd /etc; cat %s 2>/dev/null\", \\$2)); skip = 1; } { if (!skip) print \\$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[\t ]*hwcap[\t ]/d;s/[:,\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/\"//g;/^$/d' | tr '\\n' ' '`\n    sys_lib_dlsearch_path_spec=\"/lib /usr/lib $lt_ld_extra\"\n  fi\n\n  # We used to test for /lib/ld.so.1 and disable shared libraries on\n  # powerpc, because MkLinux only supported shared libraries with the\n  # GNU dynamic linker.  Since this was broken with cross compilers,\n  # most powerpc-linux boxes support dynamic linking these days and\n  # people can always --disable-shared, the test was removed, and we\n  # assume the GNU/Linux dynamic linker is in use.\n  dynamic_linker='GNU/Linux ld.so'\n  ;;\n\nnetbsd*)\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n    finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n    dynamic_linker='NetBSD (a.out) ld.so'\n  else\n    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n    soname_spec='$libname$release$shared_ext$major'\n    dynamic_linker='NetBSD ld.elf_so'\n  fi\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  ;;\n\nnewsos6)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\n*nto* | *qnx*)\n  version_type=qnx\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='ldqnx.so'\n  ;;\n\nopenbsd* | bitrig*)\n  version_type=sunos\n  sys_lib_dlsearch_path_spec=/usr/lib\n  need_lib_prefix=no\n  if test -z \"`echo __ELF__ | $CC -E - | $GREP __ELF__`\"; then\n    need_version=no\n  else\n    need_version=yes\n  fi\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\nos2*)\n  libname_spec='$name'\n  version_type=windows\n  shrext_cmds=.dll\n  need_version=no\n  need_lib_prefix=no\n  # OS/2 can only load a DLL with a base name of 8 characters or less.\n  soname_spec='`test -n \"$os2dllname\" && libname=\"$os2dllname\";\n    v=$($ECHO $release$versuffix | tr -d .-);\n    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);\n    $ECHO $n$v`$shared_ext'\n  library_names_spec='${libname}_dll.$libext'\n  dynamic_linker='OS/2 ld.exe'\n  shlibpath_var=BEGINLIBPATH\n  sys_lib_search_path_spec=\"/lib /usr/lib /usr/local/lib\"\n  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n  postinstall_cmds='base_file=`basename \\$file`~\n    dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\$base_file'\\''i; $ECHO \\$dlname'\\''`~\n    dldir=$destdir/`dirname \\$dlpath`~\n    test -d \\$dldir || mkdir -p \\$dldir~\n    $install_prog $dir/$dlname \\$dldir/$dlname~\n    chmod a+x \\$dldir/$dlname~\n    if test -n '\\''$stripme'\\'' && test -n '\\''$striplib'\\''; then\n      eval '\\''$striplib \\$dldir/$dlname'\\'' || exit \\$?;\n    fi'\n  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; $ECHO \\$dlname'\\''`~\n    dlpath=$dir/\\$dldll~\n    $RM \\$dlpath'\n  ;;\n\nosf3* | osf4* | osf5*)\n  version_type=osf\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='$libname$release$shared_ext$major'\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib\"\n  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n  ;;\n\nrdos*)\n  dynamic_linker=no\n  ;;\n\nsolaris*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  # ldd complains unless libraries are executable\n  postinstall_cmds='chmod +x $lib'\n  ;;\n\nsunos4*)\n  version_type=sunos\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/usr/etc\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  if test yes = \"$with_gnu_ld\"; then\n    need_lib_prefix=no\n  fi\n  need_version=yes\n  ;;\n\nsysv4 | sysv4.3*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_vendor in\n    sni)\n      shlibpath_overrides_runpath=no\n      need_lib_prefix=no\n      runpath_var=LD_RUN_PATH\n      ;;\n    siemens)\n      need_lib_prefix=no\n      ;;\n    motorola)\n      need_lib_prefix=no\n      need_version=no\n      shlibpath_overrides_runpath=no\n      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'\n      ;;\n  esac\n  ;;\n\nsysv4*MP*)\n  if test -d /usr/nec; then\n    version_type=linux # correct to gnu/linux during the next big refactor\n    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'\n    soname_spec='$libname$shared_ext.$major'\n    shlibpath_var=LD_LIBRARY_PATH\n  fi\n  ;;\n\nsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)\n  version_type=sco\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  if test yes = \"$with_gnu_ld\"; then\n    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'\n  else\n    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'\n    case $host_os in\n      sco3.2v5*)\n        sys_lib_search_path_spec=\"$sys_lib_search_path_spec /lib\"\n\t;;\n    esac\n  fi\n  sys_lib_dlsearch_path_spec='/usr/lib'\n  ;;\n\ntpf*)\n  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.\n  version_type=linux # correct to gnu/linux during the next big refactor\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  ;;\n\nuts4*)\n  version_type=linux # correct to gnu/linux during the next big refactor\n  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n  soname_spec='$libname$release$shared_ext$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\n*)\n  dynamic_linker=no\n  ;;\nesac\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $dynamic_linker\" >&5\n$as_echo \"$dynamic_linker\" >&6; }\ntest no = \"$dynamic_linker\" && can_build_shared=no\n\nvariables_saved_for_relink=\"PATH $shlibpath_var $runpath_var\"\nif test yes = \"$GCC\"; then\n  variables_saved_for_relink=\"$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH\"\nfi\n\nif test set = \"${lt_cv_sys_lib_search_path_spec+set}\"; then\n  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec\nfi\n\nif test set = \"${lt_cv_sys_lib_dlsearch_path_spec+set}\"; then\n  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec\nfi\n\n# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...\nconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec\n\n# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code\nfunc_munge_path_list sys_lib_dlsearch_path_spec \"$LT_SYS_LIBRARY_PATH\"\n\n# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool\nconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs\" >&5\n$as_echo_n \"checking how to hardcode library paths into programs... \" >&6; }\nhardcode_action=\nif test -n \"$hardcode_libdir_flag_spec\" ||\n   test -n \"$runpath_var\" ||\n   test yes = \"$hardcode_automatic\"; then\n\n  # We can hardcode non-existent directories.\n  if test no != \"$hardcode_direct\" &&\n     # If the only mechanism to avoid hardcoding is shlibpath_var, we\n     # have to relink, otherwise we might link with an installed library\n     # when we should be linking with a yet-to-be-installed one\n     ## test no != \"$_LT_TAGVAR(hardcode_shlibpath_var, )\" &&\n     test no != \"$hardcode_minus_L\"; then\n    # Linking always hardcodes the temporary library directory.\n    hardcode_action=relink\n  else\n    # We can link without hardcoding, and we can hardcode nonexisting dirs.\n    hardcode_action=immediate\n  fi\nelse\n  # We cannot hardcode anything, or else we can only hardcode existing\n  # directories.\n  hardcode_action=unsupported\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $hardcode_action\" >&5\n$as_echo \"$hardcode_action\" >&6; }\n\nif test relink = \"$hardcode_action\" ||\n   test yes = \"$inherit_rpath\"; then\n  # Fast installation is not supported\n  enable_fast_install=no\nelif test yes = \"$shlibpath_overrides_runpath\" ||\n     test no = \"$enable_shared\"; then\n  # Fast installation is not necessary\n  enable_fast_install=needless\nfi\n\n\n\n\n\n\n  if test yes != \"$enable_dlopen\"; then\n  enable_dlopen=unknown\n  enable_dlopen_self=unknown\n  enable_dlopen_self_static=unknown\nelse\n  lt_cv_dlopen=no\n  lt_cv_dlopen_libs=\n\n  case $host_os in\n  beos*)\n    lt_cv_dlopen=load_add_on\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n    ;;\n\n  mingw* | pw32* | cegcc*)\n    lt_cv_dlopen=LoadLibrary\n    lt_cv_dlopen_libs=\n    ;;\n\n  cygwin*)\n    lt_cv_dlopen=dlopen\n    lt_cv_dlopen_libs=\n    ;;\n\n  darwin*)\n    # if libdl is installed we need to link against it\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl\" >&5\n$as_echo_n \"checking for dlopen in -ldl... \" >&6; }\nif ${ac_cv_lib_dl_dlopen+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldl  $LIBS\"\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n/* Override any GCC internal prototype to avoid an error.\n   Use char because int might match the return type of a GCC\n   builtin and then its argument prototype would still apply.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar dlopen ();\nint\nmain ()\n{\nreturn dlopen ();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  ac_cv_lib_dl_dlopen=yes\nelse\n  ac_cv_lib_dl_dlopen=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen\" >&5\n$as_echo \"$ac_cv_lib_dl_dlopen\" >&6; }\nif test \"x$ac_cv_lib_dl_dlopen\" = xyes; then :\n  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl\nelse\n\n    lt_cv_dlopen=dyld\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n\nfi\n\n    ;;\n\n  tpf*)\n    # Don't try to run any link tests for TPF.  We know it's impossible\n    # because TPF is a cross-compiler, and we know how we open DSOs.\n    lt_cv_dlopen=dlopen\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=no\n    ;;\n\n  *)\n    ac_fn_c_check_func \"$LINENO\" \"shl_load\" \"ac_cv_func_shl_load\"\nif test \"x$ac_cv_func_shl_load\" = xyes; then :\n  lt_cv_dlopen=shl_load\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld\" >&5\n$as_echo_n \"checking for shl_load in -ldld... \" >&6; }\nif ${ac_cv_lib_dld_shl_load+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldld  $LIBS\"\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n/* Override any GCC internal prototype to avoid an error.\n   Use char because int might match the return type of a GCC\n   builtin and then its argument prototype would still apply.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar shl_load ();\nint\nmain ()\n{\nreturn shl_load ();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  ac_cv_lib_dld_shl_load=yes\nelse\n  ac_cv_lib_dld_shl_load=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load\" >&5\n$as_echo \"$ac_cv_lib_dld_shl_load\" >&6; }\nif test \"x$ac_cv_lib_dld_shl_load\" = xyes; then :\n  lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld\nelse\n  ac_fn_c_check_func \"$LINENO\" \"dlopen\" \"ac_cv_func_dlopen\"\nif test \"x$ac_cv_func_dlopen\" = xyes; then :\n  lt_cv_dlopen=dlopen\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl\" >&5\n$as_echo_n \"checking for dlopen in -ldl... \" >&6; }\nif ${ac_cv_lib_dl_dlopen+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldl  $LIBS\"\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n/* Override any GCC internal prototype to avoid an error.\n   Use char because int might match the return type of a GCC\n   builtin and then its argument prototype would still apply.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar dlopen ();\nint\nmain ()\n{\nreturn dlopen ();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  ac_cv_lib_dl_dlopen=yes\nelse\n  ac_cv_lib_dl_dlopen=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen\" >&5\n$as_echo \"$ac_cv_lib_dl_dlopen\" >&6; }\nif test \"x$ac_cv_lib_dl_dlopen\" = xyes; then :\n  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld\" >&5\n$as_echo_n \"checking for dlopen in -lsvld... \" >&6; }\nif ${ac_cv_lib_svld_dlopen+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-lsvld  $LIBS\"\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n/* Override any GCC internal prototype to avoid an error.\n   Use char because int might match the return type of a GCC\n   builtin and then its argument prototype would still apply.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar dlopen ();\nint\nmain ()\n{\nreturn dlopen ();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  ac_cv_lib_svld_dlopen=yes\nelse\n  ac_cv_lib_svld_dlopen=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen\" >&5\n$as_echo \"$ac_cv_lib_svld_dlopen\" >&6; }\nif test \"x$ac_cv_lib_svld_dlopen\" = xyes; then :\n  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld\" >&5\n$as_echo_n \"checking for dld_link in -ldld... \" >&6; }\nif ${ac_cv_lib_dld_dld_link+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldld  $LIBS\"\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n/* Override any GCC internal prototype to avoid an error.\n   Use char because int might match the return type of a GCC\n   builtin and then its argument prototype would still apply.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar dld_link ();\nint\nmain ()\n{\nreturn dld_link ();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  ac_cv_lib_dld_dld_link=yes\nelse\n  ac_cv_lib_dld_dld_link=no\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link\" >&5\n$as_echo \"$ac_cv_lib_dld_dld_link\" >&6; }\nif test \"x$ac_cv_lib_dld_dld_link\" = xyes; then :\n  lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld\nfi\n\n\nfi\n\n\nfi\n\n\nfi\n\n\nfi\n\n\nfi\n\n    ;;\n  esac\n\n  if test no = \"$lt_cv_dlopen\"; then\n    enable_dlopen=no\n  else\n    enable_dlopen=yes\n  fi\n\n  case $lt_cv_dlopen in\n  dlopen)\n    save_CPPFLAGS=$CPPFLAGS\n    test yes = \"$ac_cv_header_dlfcn_h\" && CPPFLAGS=\"$CPPFLAGS -DHAVE_DLFCN_H\"\n\n    save_LDFLAGS=$LDFLAGS\n    wl=$lt_prog_compiler_wl eval LDFLAGS=\\\"\\$LDFLAGS $export_dynamic_flag_spec\\\"\n\n    save_LIBS=$LIBS\n    LIBS=\"$lt_cv_dlopen_libs $LIBS\"\n\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself\" >&5\n$as_echo_n \"checking whether a program can dlopen itself... \" >&6; }\nif ${lt_cv_dlopen_self+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  \t  if test yes = \"$cross_compiling\"; then :\n  lt_cv_dlopen_self=cross\nelse\n  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2\n  lt_status=$lt_dlunknown\n  cat > conftest.$ac_ext <<_LT_EOF\n#line $LINENO \"configure\"\n#include \"confdefs.h\"\n\n#if HAVE_DLFCN_H\n#include <dlfcn.h>\n#endif\n\n#include <stdio.h>\n\n#ifdef RTLD_GLOBAL\n#  define LT_DLGLOBAL\t\tRTLD_GLOBAL\n#else\n#  ifdef DL_GLOBAL\n#    define LT_DLGLOBAL\t\tDL_GLOBAL\n#  else\n#    define LT_DLGLOBAL\t\t0\n#  endif\n#endif\n\n/* We may have to define LT_DLLAZY_OR_NOW in the command line if we\n   find out it does not work in some platform. */\n#ifndef LT_DLLAZY_OR_NOW\n#  ifdef RTLD_LAZY\n#    define LT_DLLAZY_OR_NOW\t\tRTLD_LAZY\n#  else\n#    ifdef DL_LAZY\n#      define LT_DLLAZY_OR_NOW\t\tDL_LAZY\n#    else\n#      ifdef RTLD_NOW\n#        define LT_DLLAZY_OR_NOW\tRTLD_NOW\n#      else\n#        ifdef DL_NOW\n#          define LT_DLLAZY_OR_NOW\tDL_NOW\n#        else\n#          define LT_DLLAZY_OR_NOW\t0\n#        endif\n#      endif\n#    endif\n#  endif\n#endif\n\n/* When -fvisibility=hidden is used, assume the code has been annotated\n   correspondingly for the symbols needed.  */\n#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))\nint fnord () __attribute__((visibility(\"default\")));\n#endif\n\nint fnord () { return 42; }\nint main ()\n{\n  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);\n  int status = $lt_dlunknown;\n\n  if (self)\n    {\n      if (dlsym (self,\"fnord\"))       status = $lt_dlno_uscore;\n      else\n        {\n\t  if (dlsym( self,\"_fnord\"))  status = $lt_dlneed_uscore;\n          else puts (dlerror ());\n\t}\n      /* dlclose (self); */\n    }\n  else\n    puts (dlerror ());\n\n  return status;\n}\n_LT_EOF\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_link\\\"\"; } >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && test -s \"conftest$ac_exeext\" 2>/dev/null; then\n    (./conftest; exit; ) >&5 2>/dev/null\n    lt_status=$?\n    case x$lt_status in\n      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;\n      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;\n      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;\n    esac\n  else :\n    # compilation failed\n    lt_cv_dlopen_self=no\n  fi\nfi\nrm -fr conftest*\n\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self\" >&5\n$as_echo \"$lt_cv_dlopen_self\" >&6; }\n\n    if test yes = \"$lt_cv_dlopen_self\"; then\n      wl=$lt_prog_compiler_wl eval LDFLAGS=\\\"\\$LDFLAGS $lt_prog_compiler_static\\\"\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself\" >&5\n$as_echo_n \"checking whether a statically linked program can dlopen itself... \" >&6; }\nif ${lt_cv_dlopen_self_static+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  \t  if test yes = \"$cross_compiling\"; then :\n  lt_cv_dlopen_self_static=cross\nelse\n  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2\n  lt_status=$lt_dlunknown\n  cat > conftest.$ac_ext <<_LT_EOF\n#line $LINENO \"configure\"\n#include \"confdefs.h\"\n\n#if HAVE_DLFCN_H\n#include <dlfcn.h>\n#endif\n\n#include <stdio.h>\n\n#ifdef RTLD_GLOBAL\n#  define LT_DLGLOBAL\t\tRTLD_GLOBAL\n#else\n#  ifdef DL_GLOBAL\n#    define LT_DLGLOBAL\t\tDL_GLOBAL\n#  else\n#    define LT_DLGLOBAL\t\t0\n#  endif\n#endif\n\n/* We may have to define LT_DLLAZY_OR_NOW in the command line if we\n   find out it does not work in some platform. */\n#ifndef LT_DLLAZY_OR_NOW\n#  ifdef RTLD_LAZY\n#    define LT_DLLAZY_OR_NOW\t\tRTLD_LAZY\n#  else\n#    ifdef DL_LAZY\n#      define LT_DLLAZY_OR_NOW\t\tDL_LAZY\n#    else\n#      ifdef RTLD_NOW\n#        define LT_DLLAZY_OR_NOW\tRTLD_NOW\n#      else\n#        ifdef DL_NOW\n#          define LT_DLLAZY_OR_NOW\tDL_NOW\n#        else\n#          define LT_DLLAZY_OR_NOW\t0\n#        endif\n#      endif\n#    endif\n#  endif\n#endif\n\n/* When -fvisibility=hidden is used, assume the code has been annotated\n   correspondingly for the symbols needed.  */\n#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))\nint fnord () __attribute__((visibility(\"default\")));\n#endif\n\nint fnord () { return 42; }\nint main ()\n{\n  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);\n  int status = $lt_dlunknown;\n\n  if (self)\n    {\n      if (dlsym (self,\"fnord\"))       status = $lt_dlno_uscore;\n      else\n        {\n\t  if (dlsym( self,\"_fnord\"))  status = $lt_dlneed_uscore;\n          else puts (dlerror ());\n\t}\n      /* dlclose (self); */\n    }\n  else\n    puts (dlerror ());\n\n  return status;\n}\n_LT_EOF\n  if { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$ac_link\\\"\"; } >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && test -s \"conftest$ac_exeext\" 2>/dev/null; then\n    (./conftest; exit; ) >&5 2>/dev/null\n    lt_status=$?\n    case x$lt_status in\n      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;\n      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;\n      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;\n    esac\n  else :\n    # compilation failed\n    lt_cv_dlopen_self_static=no\n  fi\nfi\nrm -fr conftest*\n\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static\" >&5\n$as_echo \"$lt_cv_dlopen_self_static\" >&6; }\n    fi\n\n    CPPFLAGS=$save_CPPFLAGS\n    LDFLAGS=$save_LDFLAGS\n    LIBS=$save_LIBS\n    ;;\n  esac\n\n  case $lt_cv_dlopen_self in\n  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;\n  *) enable_dlopen_self=unknown ;;\n  esac\n\n  case $lt_cv_dlopen_self_static in\n  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;\n  *) enable_dlopen_self_static=unknown ;;\n  esac\nfi\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nstriplib=\nold_striplib=\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible\" >&5\n$as_echo_n \"checking whether stripping libraries is possible... \" >&6; }\nif test -n \"$STRIP\" && $STRIP -V 2>&1 | $GREP \"GNU strip\" >/dev/null; then\n  test -z \"$old_striplib\" && old_striplib=\"$STRIP --strip-debug\"\n  test -z \"$striplib\" && striplib=\"$STRIP --strip-unneeded\"\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nelse\n# FIXME - insert some real tests, host_os isn't really good enough\n  case $host_os in\n  darwin*)\n    if test -n \"$STRIP\"; then\n      striplib=\"$STRIP -x\"\n      old_striplib=\"$STRIP -S\"\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n    else\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n    fi\n    ;;\n  *)\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n    ;;\n  esac\nfi\n\n\n\n\n\n\n\n\n\n\n\n\n  # Report what library types will actually be built\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries\" >&5\n$as_echo_n \"checking if libtool supports shared libraries... \" >&6; }\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $can_build_shared\" >&5\n$as_echo \"$can_build_shared\" >&6; }\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries\" >&5\n$as_echo_n \"checking whether to build shared libraries... \" >&6; }\n  test no = \"$can_build_shared\" && enable_shared=no\n\n  # On AIX, shared libraries and static libraries use the same namespace, and\n  # are all built from PIC.\n  case $host_os in\n  aix3*)\n    test yes = \"$enable_shared\" && enable_static=no\n    if test -n \"$RANLIB\"; then\n      archive_cmds=\"$archive_cmds~\\$RANLIB \\$lib\"\n      postinstall_cmds='$RANLIB $lib'\n    fi\n    ;;\n\n  aix[4-9]*)\n    if test ia64 != \"$host_cpu\"; then\n      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in\n      yes,aix,yes) ;;\t\t\t# shared object as lib.so file only\n      yes,svr4,*) ;;\t\t\t# shared object as lib.so archive member only\n      yes,*) enable_static=no ;;\t# shared object in lib.a archive as well\n      esac\n    fi\n    ;;\n  esac\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $enable_shared\" >&5\n$as_echo \"$enable_shared\" >&6; }\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether to build static libraries\" >&5\n$as_echo_n \"checking whether to build static libraries... \" >&6; }\n  # Make sure either enable_shared or enable_static is yes.\n  test yes = \"$enable_shared\" || enable_static=yes\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $enable_static\" >&5\n$as_echo \"$enable_static\" >&6; }\n\n\n\n\nfi\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nCC=$lt_save_CC\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        ac_config_commands=\"$ac_config_commands libtool\"\n\n\n\n\n# Only expand once:\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether ln -s works\" >&5\n$as_echo_n \"checking whether ln -s works... \" >&6; }\nLN_S=$as_ln_s\nif test \"$LN_S\" = \"ln -s\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no, using $LN_S\" >&5\n$as_echo \"no, using $LN_S\" >&6; }\nfi\n\n\n\n# Check whether --with-build-date was given.\nif test \"${with_build_date+set}\" = set; then :\n  withval=$with_build_date; BUILD=\"$with_build_date\"\nelse\n  BUILD=`date +%Y%m%d`\nfi\n\n\n\n\nif test \"x$ac_cv_env_PKG_CONFIG_set\" != \"xset\"; then\n\tif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}pkg-config\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}pkg-config; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_path_PKG_CONFIG+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  case $PKG_CONFIG in\n  [\\\\/]* | ?:[\\\\/]*)\n  ac_cv_path_PKG_CONFIG=\"$PKG_CONFIG\" # Let the user override the test with a path.\n  ;;\n  *)\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_path_PKG_CONFIG=\"$as_dir/$ac_word$ac_exec_ext\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\n  ;;\nesac\nfi\nPKG_CONFIG=$ac_cv_path_PKG_CONFIG\nif test -n \"$PKG_CONFIG\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG\" >&5\n$as_echo \"$PKG_CONFIG\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\nfi\nif test -z \"$ac_cv_path_PKG_CONFIG\"; then\n  ac_pt_PKG_CONFIG=$PKG_CONFIG\n  # Extract the first word of \"pkg-config\", so it can be a program name with args.\nset dummy pkg-config; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  case $ac_pt_PKG_CONFIG in\n  [\\\\/]* | ?:[\\\\/]*)\n  ac_cv_path_ac_pt_PKG_CONFIG=\"$ac_pt_PKG_CONFIG\" # Let the user override the test with a path.\n  ;;\n  *)\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_path_ac_pt_PKG_CONFIG=\"$as_dir/$ac_word$ac_exec_ext\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\n  ;;\nesac\nfi\nac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG\nif test -n \"$ac_pt_PKG_CONFIG\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG\" >&5\n$as_echo \"$ac_pt_PKG_CONFIG\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n  if test \"x$ac_pt_PKG_CONFIG\" = x; then\n    PKG_CONFIG=\"\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\n$as_echo \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    PKG_CONFIG=$ac_pt_PKG_CONFIG\n  fi\nelse\n  PKG_CONFIG=\"$ac_cv_path_PKG_CONFIG\"\nfi\n\nfi\nif test -n \"$PKG_CONFIG\"; then\n\t_pkg_min_version=0.9.0\n\t{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version\" >&5\n$as_echo_n \"checking pkg-config is at least version $_pkg_min_version... \" >&6; }\n\tif $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then\n\t\t{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n\telse\n\t\t{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n\t\tPKG_CONFIG=\"\"\n\tfi\n\nfi\n\n# When the prefix is /opt/libjpeg-turbo, we assume that an \"official\" binary is\n# being created, and thus we install things into specific locations.\n\nold_prefix=${prefix}\nif test \"x$prefix\" = \"xNONE\" -a \"x$ac_default_prefix\" != \"x\"; then\n  prefix=$ac_default_prefix\nfi\nDATADIR=`eval echo ${datadir}`\nDATADIR=`eval echo $DATADIR`\nif test \"$DATADIR\" = \"/opt/libjpeg-turbo/share\"; then\n  datadir='${prefix}'\nfi\nDATADIR=`eval echo ${datarootdir}`\nDATADIR=`eval echo $DATADIR`\nif test \"$DATADIR\" = \"/opt/libjpeg-turbo/share\"; then\n  datarootdir='${prefix}'\nfi\nDOCDIR=`eval echo ${docdir}`\nDOCDIR=`eval echo $DOCDIR`\nif test \"$DOCDIR\" = \"/opt/libjpeg-turbo/doc/libjpeg-turbo\"; then\n  docdir='${datadir}/doc'\nfi\n\nold_exec_prefix=${exec_prefix}\nif test \"x$exec_prefix\" = \"xNONE\"; then\n  exec_prefix=${prefix}\nfi\n\n# The cast to long int works around a bug in the HP C Compiler\n# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects\n# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.\n# This bug is HP SR number 8606223364.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking size of size_t\" >&5\n$as_echo_n \"checking size of size_t... \" >&6; }\nif ${ac_cv_sizeof_size_t+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if ac_fn_c_compute_int \"$LINENO\" \"(long int) (sizeof (size_t))\" \"ac_cv_sizeof_size_t\"        \"$ac_includes_default\"; then :\n\nelse\n  if test \"$ac_cv_type_size_t\" = yes; then\n     { { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\nas_fn_error 77 \"cannot compute sizeof (size_t)\nSee \\`config.log' for more details\" \"$LINENO\" 5; }\n   else\n     ac_cv_sizeof_size_t=0\n   fi\nfi\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t\" >&5\n$as_echo \"$ac_cv_sizeof_size_t\" >&6; }\n\n\n\ncat >>confdefs.h <<_ACEOF\n#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t\n_ACEOF\n\n\n\nif test \"x${libdir}\" = 'x${exec_prefix}/lib' -o \"x${libdir}\" = 'x${prefix}/lib'; then\n  LIBDIR=`eval echo ${libdir}`\n  LIBDIR=`eval echo $LIBDIR`\n  if test \"$LIBDIR\" = \"/opt/libjpeg-turbo/lib\"; then\n    case $host_os in\n      darwin*)\n        ;;\n      *)\n        if test \"${ac_cv_sizeof_size_t}\" = \"8\"; then\n          libdir='${exec_prefix}/lib64'\n        elif test \"${ac_cv_sizeof_size_t}\" = \"4\"; then\n          libdir='${exec_prefix}/lib32'\n        fi\n        ;;\n    esac\n  fi\nfi\nexec_prefix=${old_exec_prefix}\nprefix=${old_prefix}\n\n# Check whether compiler supports pointers to undefined structures\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether compiler supports pointers to undefined structures\" >&5\n$as_echo_n \"checking whether compiler supports pointers to undefined structures... \" >&6; }\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n typedef struct undefined_structure *undef_struct_ptr;\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n\n$as_echo \"#define INCOMPLETE_TYPES_BROKEN 1\" >>confdefs.h\n\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n\nif test \"x${GCC}\" = \"xyes\"; then\n  if test \"x${SAVED_CFLAGS}\" = \"x\"; then\n    CFLAGS=-O3\n  fi\n  if test \"x${SAVED_CPPFLAGS}\" = \"x\"; then\n    CPPFLAGS=-Wall\n  fi\nfi\n\nac_fn_c_check_decl \"$LINENO\" \"__SUNPRO_C\" \"ac_cv_have_decl___SUNPRO_C\" \"$ac_includes_default\"\nif test \"x$ac_cv_have_decl___SUNPRO_C\" = xyes; then :\n  SUNCC=\"yes\"\nelse\n  SUNCC=\"no\"\nfi\n\nif test \"x${SUNCC}\" = \"xyes\"; then\n  if test \"x${SAVED_CFLAGS}\" = \"x\"; then\n    CFLAGS=-xO5\n  fi\nfi\n\n# Checks for libraries.\n\n# Checks for header files.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for ANSI C header files\" >&5\n$as_echo_n \"checking for ANSI C header files... \" >&6; }\nif ${ac_cv_header_stdc+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdlib.h>\n#include <stdarg.h>\n#include <string.h>\n#include <float.h>\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_header_stdc=yes\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n\nif test $ac_cv_header_stdc = yes; then\n  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <string.h>\n\n_ACEOF\nif (eval \"$ac_cpp conftest.$ac_ext\") 2>&5 |\n  $EGREP \"memchr\" >/dev/null 2>&1; then :\n\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f conftest*\n\nfi\n\nif test $ac_cv_header_stdc = yes; then\n  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdlib.h>\n\n_ACEOF\nif (eval \"$ac_cpp conftest.$ac_ext\") 2>&5 |\n  $EGREP \"free\" >/dev/null 2>&1; then :\n\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f conftest*\n\nfi\n\nif test $ac_cv_header_stdc = yes; then\n  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.\n  if test \"$cross_compiling\" = yes; then :\n  :\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <ctype.h>\n#include <stdlib.h>\n#if ((' ' & 0x0FF) == 0x020)\n# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')\n# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))\n#else\n# define ISLOWER(c) \\\n\t\t   (('a' <= (c) && (c) <= 'i') \\\n\t\t     || ('j' <= (c) && (c) <= 'r') \\\n\t\t     || ('s' <= (c) && (c) <= 'z'))\n# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))\n#endif\n\n#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))\nint\nmain ()\n{\n  int i;\n  for (i = 0; i < 256; i++)\n    if (XOR (islower (i), ISLOWER (i))\n\t|| toupper (i) != TOUPPER (i))\n      return 2;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_run \"$LINENO\"; then :\n\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \\\n  conftest.$ac_objext conftest.beam conftest.$ac_ext\nfi\n\nfi\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc\" >&5\n$as_echo \"$ac_cv_header_stdc\" >&6; }\nif test $ac_cv_header_stdc = yes; then\n\n$as_echo \"#define STDC_HEADERS 1\" >>confdefs.h\n\nfi\n\nfor ac_header in stddef.h stdlib.h locale.h string.h\ndo :\n  as_ac_Header=`$as_echo \"ac_cv_header_$ac_header\" | $as_tr_sh`\nac_fn_c_check_header_mongrel \"$LINENO\" \"$ac_header\" \"$as_ac_Header\" \"$ac_includes_default\"\nif eval test \\\"x\\$\"$as_ac_Header\"\\\" = x\"yes\"; then :\n  cat >>confdefs.h <<_ACEOF\n#define `$as_echo \"HAVE_$ac_header\" | $as_tr_cpp` 1\n_ACEOF\n\nfi\n\ndone\n\nac_fn_c_check_header_mongrel \"$LINENO\" \"sys/types.h\" \"ac_cv_header_sys_types_h\" \"$ac_includes_default\"\nif test \"x$ac_cv_header_sys_types_h\" = xyes; then :\n\n$as_echo \"#define NEED_SYS_TYPES_H 1\" >>confdefs.h\n\nfi\n\n\n\n# Checks for typedefs, structures, and compiler characteristics.\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const\" >&5\n$as_echo_n \"checking for an ANSI C-conforming const... \" >&6; }\nif ${ac_cv_c_const+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n#ifndef __cplusplus\n  /* Ultrix mips cc rejects this sort of thing.  */\n  typedef int charset[2];\n  const charset cs = { 0, 0 };\n  /* SunOS 4.1.1 cc rejects this.  */\n  char const *const *pcpcc;\n  char **ppc;\n  /* NEC SVR4.0.2 mips cc rejects this.  */\n  struct point {int x, y;};\n  static struct point const zero = {0,0};\n  /* AIX XL C 1.02.0.0 rejects this.\n     It does not let you subtract one const X* pointer from another in\n     an arm of an if-expression whose if-part is not a constant\n     expression */\n  const char *g = \"string\";\n  pcpcc = &g + (g ? g-g : 0);\n  /* HPUX 7.0 cc rejects these. */\n  ++pcpcc;\n  ppc = (char**) pcpcc;\n  pcpcc = (char const *const *) ppc;\n  { /* SCO 3.2v4 cc rejects this sort of thing.  */\n    char tx;\n    char *t = &tx;\n    char const *s = 0 ? (char *) 0 : (char const *) 0;\n\n    *t++ = 0;\n    if (s) return 0;\n  }\n  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */\n    int x[] = {25, 17};\n    const int *foo = &x[0];\n    ++foo;\n  }\n  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */\n    typedef const int *iptr;\n    iptr p = 0;\n    ++p;\n  }\n  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying\n       \"k.c\", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */\n    struct s { int j; const int *ap[3]; } bx;\n    struct s *b = &bx; b->j = 5;\n  }\n  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */\n    const int foo = 10;\n    if (!foo) return 0;\n  }\n  return !cs[0] && !zero.x;\n#endif\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_c_const=yes\nelse\n  ac_cv_c_const=no\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const\" >&5\n$as_echo \"$ac_cv_c_const\" >&6; }\nif test $ac_cv_c_const = no; then\n\n$as_echo \"#define const /**/\" >>confdefs.h\n\nfi\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether char is unsigned\" >&5\n$as_echo_n \"checking whether char is unsigned... \" >&6; }\nif ${ac_cv_c_char_unsigned+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$ac_includes_default\nint\nmain ()\n{\nstatic int test_array [1 - 2 * !(((char) -1) < 0)];\ntest_array [0] = 0;\nreturn test_array [0];\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_c_char_unsigned=no\nelse\n  ac_cv_c_char_unsigned=yes\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned\" >&5\n$as_echo \"$ac_cv_c_char_unsigned\" >&6; }\nif test $ac_cv_c_char_unsigned = yes && test \"$GCC\" != yes; then\n  $as_echo \"#define __CHAR_UNSIGNED__ 1\" >>confdefs.h\n\nfi\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for inline\" >&5\n$as_echo_n \"checking for inline... \" >&6; }\nif ${ac_cv_c_inline+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  ac_cv_c_inline=no\nfor ac_kw in inline __inline__ __inline; do\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#ifndef __cplusplus\ntypedef int foo_t;\nstatic $ac_kw foo_t static_foo () {return 0; }\n$ac_kw foo_t foo () {return 0; }\n#endif\n\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_cv_c_inline=$ac_kw\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n  test \"$ac_cv_c_inline\" != no && break\ndone\n\nfi\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline\" >&5\n$as_echo \"$ac_cv_c_inline\" >&6; }\n\ncase $ac_cv_c_inline in\n  inline | yes) ;;\n  *)\n    case $ac_cv_c_inline in\n      no) ac_val=;;\n      *) ac_val=$ac_cv_c_inline;;\n    esac\n    cat >>confdefs.h <<_ACEOF\n#ifndef __cplusplus\n#define inline $ac_val\n#endif\n_ACEOF\n    ;;\nesac\n\nac_fn_c_check_type \"$LINENO\" \"size_t\" \"ac_cv_type_size_t\" \"$ac_includes_default\"\nif test \"x$ac_cv_type_size_t\" = xyes; then :\n\nelse\n\ncat >>confdefs.h <<_ACEOF\n#define size_t unsigned int\n_ACEOF\n\nfi\n\nac_fn_c_check_type \"$LINENO\" \"unsigned char\" \"ac_cv_type_unsigned_char\" \"$ac_includes_default\"\nif test \"x$ac_cv_type_unsigned_char\" = xyes; then :\n\ncat >>confdefs.h <<_ACEOF\n#define HAVE_UNSIGNED_CHAR 1\n_ACEOF\n\n\nfi\nac_fn_c_check_type \"$LINENO\" \"unsigned short\" \"ac_cv_type_unsigned_short\" \"$ac_includes_default\"\nif test \"x$ac_cv_type_unsigned_short\" = xyes; then :\n\ncat >>confdefs.h <<_ACEOF\n#define HAVE_UNSIGNED_SHORT 1\n_ACEOF\n\n\nfi\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking if right shift is signed\" >&5\n$as_echo_n \"checking if right shift is signed... \" >&6; }\nif test \"$cross_compiling\" = yes; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: Assuming that right shift is signed on target machine.\" >&5\n$as_echo \"Assuming that right shift is signed on target machine.\" >&6; }\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdio.h>\n   int is_shifting_signed (long arg) {\n     long res = arg >> 4;\n\n     if (res == -0x7F7E80CL)\n       return 1; /* right shift is signed */\n\n     /* see if unsigned-shift hack will fix it. */\n     /* we can't just test exact value since it depends on width of long... */\n     res |= (~0L) << (32-4);\n     if (res == -0x7F7E80CL)\n       return 0; /* right shift is unsigned */\n\n     printf(\"Right shift isn't acting as I expect it to.\\n\");\n     printf(\"I fear the JPEG software will not work at all.\\n\\n\");\n     return 0; /* try it with unsigned anyway */\n   }\n   int main (void) {\n     exit(is_shifting_signed(-0x7F7E80B1L));\n   }\n_ACEOF\nif ac_fn_c_try_run \"$LINENO\"; then :\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n\n$as_echo \"#define RIGHT_SHIFT_IS_UNSIGNED 1\" >>confdefs.h\n\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nfi\nrm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \\\n  conftest.$ac_objext conftest.beam conftest.$ac_ext\nfi\n\n\n# Checks for library functions.\nfor ac_func in memset memcpy\ndo :\n  as_ac_var=`$as_echo \"ac_cv_func_$ac_func\" | $as_tr_sh`\nac_fn_c_check_func \"$LINENO\" \"$ac_func\" \"$as_ac_var\"\nif eval test \\\"x\\$\"$as_ac_var\"\\\" = x\"yes\"; then :\n  cat >>confdefs.h <<_ACEOF\n#define `$as_echo \"HAVE_$ac_func\" | $as_tr_cpp` 1\n_ACEOF\n\nelse\n\n$as_echo \"#define NEED_BSD_STRINGS 1\" >>confdefs.h\n\nfi\ndone\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking libjpeg API version\" >&5\n$as_echo_n \"checking libjpeg API version... \" >&6; }\n\nif test \"x$JPEG_LIB_VERSION\" = \"x\"; then\n\n# Check whether --with-jpeg7 was given.\nif test \"${with_jpeg7+set}\" = set; then :\n  withval=$with_jpeg7;\nfi\n\n\n# Check whether --with-jpeg8 was given.\nif test \"${with_jpeg8+set}\" = set; then :\n  withval=$with_jpeg8;\nfi\n\n  if test \"x${with_jpeg8}\" = \"xyes\"; then\n    JPEG_LIB_VERSION=80\n  else\n    if test \"x${with_jpeg7}\" = \"xyes\"; then\n      JPEG_LIB_VERSION=70\n    else\n      JPEG_LIB_VERSION=62\n    fi\n  fi\nfi\nJPEG_LIB_VERSION_DECIMAL=`expr $JPEG_LIB_VERSION / 10`.`expr $JPEG_LIB_VERSION % 10`\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $JPEG_LIB_VERSION_DECIMAL\" >&5\n$as_echo \"$JPEG_LIB_VERSION_DECIMAL\" >&6; }\n\ncat >>confdefs.h <<_ACEOF\n#define JPEG_LIB_VERSION $JPEG_LIB_VERSION\n_ACEOF\n\n\n\n\nif test \"x$SO_MAJOR_VERSION\" = \"x\"; then\n  case \"$JPEG_LIB_VERSION\" in\n    62)  SO_MAJOR_VERSION=$JPEG_LIB_VERSION ;;\n    *)   SO_MAJOR_VERSION=`expr $JPEG_LIB_VERSION / 10` ;;\n  esac\nfi\nif test \"x$SO_MINOR_VERSION\" = \"x\"; then\n  case \"$JPEG_LIB_VERSION\" in\n    80)  SO_MINOR_VERSION=2 ;;\n    *)   SO_MINOR_VERSION=0 ;;\n  esac\nfi\n\nRPM_CONFIG_ARGS=\n\n# Memory source/destination managers\nSO_AGE=1\nMEM_SRCDST_FUNCTIONS=\nif test \"x${with_jpeg8}\" != \"xyes\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether to include in-memory source/destination managers\" >&5\n$as_echo_n \"checking whether to include in-memory source/destination managers... \" >&6; }\n\n# Check whether --with-mem-srcdst was given.\nif test \"${with_mem_srcdst+set}\" = set; then :\n  withval=$with_mem_srcdst;\nfi\n\n  if test \"x$with_mem_srcdst\" != \"xno\"; then\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n\n$as_echo \"#define MEM_SRCDST_SUPPORTED 1\" >>confdefs.h\n\n    SO_AGE=2\n    MEM_SRCDST_FUNCTIONS=\"global:  jpeg_mem_dest;  jpeg_mem_src;\";\n  else\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n    RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-mem-srcdst\"\n  fi\nfi\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking libjpeg shared library version\" >&5\n$as_echo_n \"checking libjpeg shared library version... \" >&6; }\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $SO_MAJOR_VERSION.$SO_AGE.$SO_MINOR_VERSION\" >&5\n$as_echo \"$SO_MAJOR_VERSION.$SO_AGE.$SO_MINOR_VERSION\" >&6; }\nLIBTOOL_CURRENT=`expr $SO_MAJOR_VERSION + $SO_AGE`\n\n\n\n\n\n\n\ncat >>confdefs.h <<_ACEOF\n#define LIBJPEG_TURBO_VERSION $VERSION\n_ACEOF\n\n\n\n\n\n\nVERSION_MAJOR=1\nVERSION_MINOR=5\nVERSION_REVISION=0\nLIBJPEG_TURBO_VERSION_NUMBER=`printf \"%d%03d%03d\" $VERSION_MAJOR $VERSION_MINOR $VERSION_REVISION`\n\ncat >>confdefs.h <<_ACEOF\n#define LIBJPEG_TURBO_VERSION_NUMBER $LIBJPEG_TURBO_VERSION_NUMBER\n_ACEOF\n\n\nVERSION_SCRIPT=yes\n# Check whether --enable-ld-version-script was given.\nif test \"${enable_ld_version_script+set}\" = set; then :\n  enableval=$enable_ld_version_script; VERSION_SCRIPT=$enableval\nfi\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether the linker supports version scripts\" >&5\n$as_echo_n \"checking whether the linker supports version scripts... \" >&6; }\nSAVED_LDFLAGS=\"$LDFLAGS\"\nLDFLAGS=\"$LDFLAGS -Wl,--version-script,conftest.map\"\ncat > conftest.map <<EOF\nVERS_1 {\n  global: *;\n};\nEOF\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  VERSION_SCRIPT_FLAG=-Wl,--version-script,;\n   { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes (GNU style)\" >&5\n$as_echo \"yes (GNU style)\" >&6; }\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nif test \"x$VERSION_SCRIPT_FLAG\" = \"x\"; then\n  LDFLAGS=\"$SAVED_LDFLAGS -Wl,-M,conftest.map\"\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"; then :\n  VERSION_SCRIPT_FLAG=-Wl,-M,;\n     { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes (Sun style)\" >&5\n$as_echo \"yes (Sun style)\" >&6; }\nfi\nrm -f core conftest.err conftest.$ac_objext \\\n    conftest$ac_exeext conftest.$ac_ext\nfi\nif test \"x$VERSION_SCRIPT_FLAG\" = \"x\"; then\n  VERSION_SCRIPT=no\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\nLDFLAGS=\"$SAVED_LDFLAGS\"\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether to use version script when building libjpeg-turbo\" >&5\n$as_echo_n \"checking whether to use version script when building libjpeg-turbo... \" >&6; }\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $VERSION_SCRIPT\" >&5\n$as_echo \"$VERSION_SCRIPT\" >&6; }\n\n if test \"x$VERSION_SCRIPT\" = \"xyes\"; then\n  VERSION_SCRIPT_TRUE=\n  VERSION_SCRIPT_FALSE='#'\nelse\n  VERSION_SCRIPT_TRUE='#'\n  VERSION_SCRIPT_FALSE=\nfi\n\n\n\n# Check for non-broken inline under various spellings\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for inline\" >&5\n$as_echo_n \"checking for inline... \" >&6; }\nljt_cv_inline=\"\"\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n} inline __attribute__((always_inline)) int foo() { return 0; }\nint bar() { return foo();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ljt_cv_inline=\"inline __attribute__((always_inline))\"\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n} __inline__ int foo() { return 0; }\nint bar() { return foo();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ljt_cv_inline=\"__inline__\"\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n} __inline int foo() { return 0; }\nint bar() { return foo();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ljt_cv_inline=\"__inline\"\nelse\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n} inline int foo() { return 0; }\nint bar() { return foo();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ljt_cv_inline=\"inline\"\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ljt_cv_inline\" >&5\n$as_echo \"$ljt_cv_inline\" >&6; }\n\ncat >>confdefs.h <<_ACEOF\n#define INLINE $ljt_cv_inline\n_ACEOF\n\n\n# Arithmetic coding support\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether to include arithmetic encoding support\" >&5\n$as_echo_n \"checking whether to include arithmetic encoding support... \" >&6; }\n\n# Check whether --with-arith-enc was given.\nif test \"${with_arith_enc+set}\" = set; then :\n  withval=$with_arith_enc;\nfi\n\nif test \"x$with_12bit\" = \"xyes\"; then\n  with_arith_enc=no\nfi\nif test \"x${with_jpeg8}\" = \"xyes\" -o \"x${with_jpeg7}\" = \"xyes\"; then\n  with_arith_enc=yes\nfi\nif test \"x$with_arith_enc\" = \"xno\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-arith-enc\"\nelse\n\n$as_echo \"#define C_ARITH_CODING_SUPPORTED 1\" >>confdefs.h\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nfi\n if test \"x$with_arith_enc\" != \"xno\"; then\n  WITH_ARITH_ENC_TRUE=\n  WITH_ARITH_ENC_FALSE='#'\nelse\n  WITH_ARITH_ENC_TRUE='#'\n  WITH_ARITH_ENC_FALSE=\nfi\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether to include arithmetic decoding support\" >&5\n$as_echo_n \"checking whether to include arithmetic decoding support... \" >&6; }\n\n# Check whether --with-arith-dec was given.\nif test \"${with_arith_dec+set}\" = set; then :\n  withval=$with_arith_dec;\nfi\n\nif test \"x$with_12bit\" = \"xyes\"; then\n  with_arith_dec=no\nfi\nif test \"x${with_jpeg8}\" = \"xyes\" -o \"x${with_jpeg7}\" = \"xyes\"; then\n  with_arith_dec=yes\nfi\nif test \"x$with_arith_dec\" = \"xno\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-arith-dec\"\nelse\n\n$as_echo \"#define D_ARITH_CODING_SUPPORTED 1\" >>confdefs.h\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nfi\n if test \"x$with_arith_dec\" != \"xno\"; then\n  WITH_ARITH_DEC_TRUE=\n  WITH_ARITH_DEC_FALSE='#'\nelse\n  WITH_ARITH_DEC_TRUE='#'\n  WITH_ARITH_DEC_FALSE=\nfi\n\n\n if test \"x$with_arith_dec\" != \"xno\" -o \"x$with_arith_enc\" != \"xno\"; then\n  WITH_ARITH_TRUE=\n  WITH_ARITH_FALSE='#'\nelse\n  WITH_ARITH_TRUE='#'\n  WITH_ARITH_FALSE=\nfi\n\n\n# 12-bit component support\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether to use 12-bit samples\" >&5\n$as_echo_n \"checking whether to use 12-bit samples... \" >&6; }\n\n# Check whether --with-12bit was given.\nif test \"${with_12bit+set}\" = set; then :\n  withval=$with_12bit;\nfi\n\nif test \"x$with_12bit\" = \"xyes\"; then\n\n$as_echo \"#define BITS_IN_JSAMPLE 12\" >>confdefs.h\n\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n if test \"x$with_12bit\" = \"xyes\"; then\n  WITH_12BIT_TRUE=\n  WITH_12BIT_FALSE='#'\nelse\n  WITH_12BIT_TRUE='#'\n  WITH_12BIT_FALSE=\nfi\n\n\n# TurboJPEG support\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether to build TurboJPEG C wrapper\" >&5\n$as_echo_n \"checking whether to build TurboJPEG C wrapper... \" >&6; }\n\n# Check whether --with-turbojpeg was given.\nif test \"${with_turbojpeg+set}\" = set; then :\n  withval=$with_turbojpeg;\nfi\n\nif test \"x$with_12bit\" = \"xyes\"; then\n  with_turbojpeg=no\nfi\nif test \"x$with_turbojpeg\" = \"xno\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-turbojpeg\"\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nfi\n\n# Java support\n\nif test \"x$JAVAC\" = \"x\"; then\n  JAVAC=javac\nfi\n\n\n\n\nif test \"x$JAR\" = \"x\"; then\n  JAR=jar\nfi\n\n\nif test \"x$JAVA\" = \"x\"; then\n  JAVA=java\nfi\n\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether to build TurboJPEG Java wrapper\" >&5\n$as_echo_n \"checking whether to build TurboJPEG Java wrapper... \" >&6; }\n\n# Check whether --with-java was given.\nif test \"${with_java+set}\" = set; then :\n  withval=$with_java;\nfi\n\nif test \"x$with_12bit\" = \"xyes\" -o \"x$with_turbojpeg\" = \"xno\"; then\n  with_java=no\nfi\n\nWITH_JAVA=0\nif test \"x$with_java\" = \"xyes\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n\n  case $host_os in\n    darwin*)\n      DEFAULT_JNI_CFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers\n      ;;\n    solaris*)\n      DEFAULT_JNI_CFLAGS='-I/usr/java/include -I/usr/java/include/solaris'\n      ;;\n    linux*)\n      DEFAULT_JNI_CFLAGS='-I/usr/java/default/include -I/usr/java/default/include/linux'\n      ;;\n  esac\n  if test \"x$JNI_CFLAGS\" = \"x\"; then\n    JNI_CFLAGS=$DEFAULT_JNI_CFLAGS\n  fi\n\n  SAVE_CPPFLAGS=${CPPFLAGS}\n  CPPFLAGS=\"${CPPFLAGS} ${JNI_CFLAGS}\"\n  for ac_header in jni.h\ndo :\n  ac_fn_c_check_header_mongrel \"$LINENO\" \"jni.h\" \"ac_cv_header_jni_h\" \"$ac_includes_default\"\nif test \"x$ac_cv_header_jni_h\" = xyes; then :\n  cat >>confdefs.h <<_ACEOF\n#define HAVE_JNI_H 1\n_ACEOF\n DUMMY=1\nelse\n  as_fn_error $? \"Could not find JNI header file\" \"$LINENO\" 5\nfi\n\ndone\n\n  CPPFLAGS=${SAVE_CPPFLAGS}\n\n\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --with-java\"\n  JAVA_RPM_CONTENTS_1='%dir %{_datadir}/classes'\n  JAVA_RPM_CONTENTS_2=%{_datadir}/classes/turbojpeg.jar\n  WITH_JAVA=1\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n if test \"x$with_java\" = \"xyes\"; then\n  WITH_JAVA_TRUE=\n  WITH_JAVA_FALSE='#'\nelse\n  WITH_JAVA_TRUE='#'\n  WITH_JAVA_FALSE=\nfi\n\n\n\n\n\n# optionally force using gas-preprocessor.pl for compatibility testing\n\n# Check whether --with-gas-preprocessor was given.\nif test \"${with_gas_preprocessor+set}\" = set; then :\n  withval=$with_gas_preprocessor;\nfi\n\nif test \"x${with_gas_preprocessor}\" = \"xyes\"; then\n  case $host_os in\n    darwin*)\n      CCAS=\"gas-preprocessor.pl -fix-unreq $CC\"\n      ;;\n    *)\n      CCAS=\"gas-preprocessor.pl -no-fix-unreq $CC\"\n      ;;\n  esac\n\nfi\n\n# SIMD is optional\n\n# Check whether --with-simd was given.\nif test \"${with_simd+set}\" = set; then :\n  withval=$with_simd;\nfi\n\nif test \"x$with_12bit\" = \"xyes\"; then\n  with_simd=no\nfi\nif test \"x${with_simd}\" != \"xno\"; then\n  require_simd=no\n  if test \"x${with_simd}\" = \"xyes\"; then\n    require_simd=yes\n  fi\n  # Check if we're on a supported CPU\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if we have SIMD optimisations for cpu type\" >&5\n$as_echo_n \"checking if we have SIMD optimisations for cpu type... \" >&6; }\n  case \"$host_cpu\" in\n    x86_64 | amd64)\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes (x86_64)\" >&5\n$as_echo \"yes (x86_64)\" >&6; }\n\n\n\nif test \"x$NASM\" = \"x\"; then\n  for ac_prog in nasm nasmw yasm\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_NASM+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$NASM\"; then\n  ac_cv_prog_NASM=\"$NASM\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_NASM=\"$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nNASM=$ac_cv_prog_NASM\nif test -n \"$NASM\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $NASM\" >&5\n$as_echo \"$NASM\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  test -n \"$NASM\" && break\ndone\n\n  test -z \"$NASM\" && as_fn_error $? \"no nasm (Netwide Assembler) found\" \"$LINENO\" 5\nfi\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for object file format of host system\" >&5\n$as_echo_n \"checking for object file format of host system... \" >&6; }\ncase \"$host_os\" in\n  cygwin* | mingw* | pw32* | interix*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='Win64-COFF'\n        ;;\n      *)\n        objfmt='Win32-COFF'\n        ;;\n    esac\n  ;;\n  msdosdjgpp* | go32*)\n    objfmt='COFF'\n  ;;\n  os2-emx*)\t\t\t# not tested\n    objfmt='MSOMF'\t\t# obj\n  ;;\n  linux*coff* | linux*oldld*)\n    objfmt='COFF'\t\t# ???\n  ;;\n  linux*aout*)\n    objfmt='a.out'\n  ;;\n  linux*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='ELF64'\n        ;;\n      *)\n        objfmt='ELF'\n        ;;\n    esac\n  ;;\n  kfreebsd* | freebsd* | netbsd* | openbsd*)\n    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then\n      objfmt='BSD-a.out'\n    else\n      case \"$host_cpu\" in\n        x86_64 | amd64)\n          objfmt='ELF64'\n          ;;\n        *)\n          objfmt='ELF'\n          ;;\n      esac\n    fi\n  ;;\n  solaris* | sunos* | sysv* | sco*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='ELF64'\n        ;;\n      *)\n        objfmt='ELF'\n        ;;\n    esac\n  ;;\n  darwin* | rhapsody* | nextstep* | openstep* | macos*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='Mach-O64'\n        ;;\n      *)\n        objfmt='Mach-O'\n        ;;\n    esac\n  ;;\n  *)\n    objfmt='ELF ?'\n  ;;\nesac\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $objfmt\" >&5\n$as_echo \"$objfmt\" >&6; }\nif test \"$objfmt\" = 'ELF ?'; then\n  objfmt='ELF'\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: unexpected host system. assumed that the format is $objfmt.\" >&5\n$as_echo \"$as_me: WARNING: unexpected host system. assumed that the format is $objfmt.\" >&2;}\nfi\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for object file format specifier (NAFLAGS) \" >&5\n$as_echo_n \"checking for object file format specifier (NAFLAGS) ... \" >&6; }\ncase \"$objfmt\" in\n  MSOMF)      NAFLAGS='-fobj -DOBJ32';;\n  Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;\n  Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;\n  COFF)       NAFLAGS='-fcoff -DCOFF';;\n  a.out)      NAFLAGS='-faout -DAOUT';;\n  BSD-a.out)  NAFLAGS='-faoutb -DAOUT';;\n  ELF)        NAFLAGS='-felf -DELF';;\n  ELF64)      NAFLAGS='-felf64 -DELF -D__x86_64__';;\n  RDF)        NAFLAGS='-frdf -DRDF';;\n  Mach-O)     NAFLAGS='-fmacho -DMACHO';;\n  Mach-O64)   NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;\nesac\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $NAFLAGS\" >&5\n$as_echo \"$NAFLAGS\" >&6; }\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether the assembler ($NASM $NAFLAGS) works\" >&5\n$as_echo_n \"checking whether the assembler ($NASM $NAFLAGS) works... \" >&6; }\ncat > conftest.asm <<EOF\n%line 14747 \"configure\"\n        section .text\n        global  _main,main\n_main:\nmain:   xor     eax,eax\n        ret\nEOF\ntry_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'\nif { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$try_nasm\\\"\"; } >&5\n  (eval $try_nasm) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && test -s conftest.o; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nelse\n  echo \"configure: failed program was:\" >&5\n  cat conftest.asm >&5\n  rm -rf conftest*\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n  as_fn_error $? \"installation or configuration problem: assembler cannot create object files.\" \"$LINENO\" 5\nfi\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether the linker accepts assembler output\" >&5\n$as_echo_n \"checking whether the linker accepts assembler output... \" >&6; }\ntry_nasm='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.o $LIBS 1>&5'\nif { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$try_nasm\\\"\"; } >&5\n  (eval $try_nasm) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && test -s conftest${ac_exeext}; then\n  rm -rf conftest*\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nelse\n  rm -rf conftest*\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n  as_fn_error $? \"configuration problem: maybe object file format mismatch.\" \"$LINENO\" 5\nfi\n\n\n      simd_arch=x86_64\n      ;;\n    i*86 | x86 | ia32)\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes (i386)\" >&5\n$as_echo \"yes (i386)\" >&6; }\n\n\n\nif test \"x$NASM\" = \"x\"; then\n  for ac_prog in nasm nasmw yasm\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\n$as_echo_n \"checking for $ac_word... \" >&6; }\nif ${ac_cv_prog_NASM+:} false; then :\n  $as_echo_n \"(cached) \" >&6\nelse\n  if test -n \"$NASM\"; then\n  ac_cv_prog_NASM=\"$NASM\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_NASM=\"$ac_prog\"\n    $as_echo \"$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi\nfi\nNASM=$ac_cv_prog_NASM\nif test -n \"$NASM\"; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $NASM\" >&5\n$as_echo \"$NASM\" >&6; }\nelse\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\nfi\n\n\n  test -n \"$NASM\" && break\ndone\n\n  test -z \"$NASM\" && as_fn_error $? \"no nasm (Netwide Assembler) found\" \"$LINENO\" 5\nfi\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for object file format of host system\" >&5\n$as_echo_n \"checking for object file format of host system... \" >&6; }\ncase \"$host_os\" in\n  cygwin* | mingw* | pw32* | interix*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='Win64-COFF'\n        ;;\n      *)\n        objfmt='Win32-COFF'\n        ;;\n    esac\n  ;;\n  msdosdjgpp* | go32*)\n    objfmt='COFF'\n  ;;\n  os2-emx*)\t\t\t# not tested\n    objfmt='MSOMF'\t\t# obj\n  ;;\n  linux*coff* | linux*oldld*)\n    objfmt='COFF'\t\t# ???\n  ;;\n  linux*aout*)\n    objfmt='a.out'\n  ;;\n  linux*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='ELF64'\n        ;;\n      *)\n        objfmt='ELF'\n        ;;\n    esac\n  ;;\n  kfreebsd* | freebsd* | netbsd* | openbsd*)\n    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then\n      objfmt='BSD-a.out'\n    else\n      case \"$host_cpu\" in\n        x86_64 | amd64)\n          objfmt='ELF64'\n          ;;\n        *)\n          objfmt='ELF'\n          ;;\n      esac\n    fi\n  ;;\n  solaris* | sunos* | sysv* | sco*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='ELF64'\n        ;;\n      *)\n        objfmt='ELF'\n        ;;\n    esac\n  ;;\n  darwin* | rhapsody* | nextstep* | openstep* | macos*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='Mach-O64'\n        ;;\n      *)\n        objfmt='Mach-O'\n        ;;\n    esac\n  ;;\n  *)\n    objfmt='ELF ?'\n  ;;\nesac\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $objfmt\" >&5\n$as_echo \"$objfmt\" >&6; }\nif test \"$objfmt\" = 'ELF ?'; then\n  objfmt='ELF'\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: unexpected host system. assumed that the format is $objfmt.\" >&5\n$as_echo \"$as_me: WARNING: unexpected host system. assumed that the format is $objfmt.\" >&2;}\nfi\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for object file format specifier (NAFLAGS) \" >&5\n$as_echo_n \"checking for object file format specifier (NAFLAGS) ... \" >&6; }\ncase \"$objfmt\" in\n  MSOMF)      NAFLAGS='-fobj -DOBJ32';;\n  Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;\n  Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;\n  COFF)       NAFLAGS='-fcoff -DCOFF';;\n  a.out)      NAFLAGS='-faout -DAOUT';;\n  BSD-a.out)  NAFLAGS='-faoutb -DAOUT';;\n  ELF)        NAFLAGS='-felf -DELF';;\n  ELF64)      NAFLAGS='-felf64 -DELF -D__x86_64__';;\n  RDF)        NAFLAGS='-frdf -DRDF';;\n  Mach-O)     NAFLAGS='-fmacho -DMACHO';;\n  Mach-O64)   NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;\nesac\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $NAFLAGS\" >&5\n$as_echo \"$NAFLAGS\" >&6; }\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether the assembler ($NASM $NAFLAGS) works\" >&5\n$as_echo_n \"checking whether the assembler ($NASM $NAFLAGS) works... \" >&6; }\ncat > conftest.asm <<EOF\n%line 14948 \"configure\"\n        section .text\n        global  _main,main\n_main:\nmain:   xor     eax,eax\n        ret\nEOF\ntry_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'\nif { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$try_nasm\\\"\"; } >&5\n  (eval $try_nasm) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && test -s conftest.o; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nelse\n  echo \"configure: failed program was:\" >&5\n  cat conftest.asm >&5\n  rm -rf conftest*\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n  as_fn_error $? \"installation or configuration problem: assembler cannot create object files.\" \"$LINENO\" 5\nfi\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking whether the linker accepts assembler output\" >&5\n$as_echo_n \"checking whether the linker accepts assembler output... \" >&6; }\ntry_nasm='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.o $LIBS 1>&5'\nif { { eval echo \"\\\"\\$as_me\\\":${as_lineno-$LINENO}: \\\"$try_nasm\\\"\"; } >&5\n  (eval $try_nasm) 2>&5\n  ac_status=$?\n  $as_echo \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && test -s conftest${ac_exeext}; then\n  rm -rf conftest*\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\nelse\n  rm -rf conftest*\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n  as_fn_error $? \"configuration problem: maybe object file format mismatch.\" \"$LINENO\" 5\nfi\n\n\n      simd_arch=i386\n      ;;\n    arm*)\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes (arm)\" >&5\n$as_echo \"yes (arm)\" >&6; }\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if the assembler is GNU-compatible and can be used\" >&5\n$as_echo_n \"checking if the assembler is GNU-compatible and can be used... \" >&6; }\n\n  ac_good_gnu_arm_assembler=no\n  ac_save_CC=\"$CC\"\n  ac_save_CFLAGS=\"$CFLAGS\"\n  CFLAGS=\"$CCASFLAGS -x assembler-with-cpp\"\n  CC=\"$CCAS\"\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n    .text\n    .fpu neon\n    .arch armv7a\n    .object_arch armv4\n    .arm\n    pld [r0]\n    vmovn.u16 d0, q0\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_good_gnu_arm_assembler=yes\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n\n  ac_use_gas_preprocessor=no\n  if test \"x$ac_good_gnu_arm_assembler\" = \"xno\" ; then\n    CC=\"gas-preprocessor.pl $CCAS\"\n    cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n      .text\n      .fpu neon\n      .arch armv7a\n      .object_arch armv4\n      .arm\n      pld [r0]\n      vmovn.u16 d0, q0\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_use_gas_preprocessor=yes\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n  fi\n  CFLAGS=\"$ac_save_CFLAGS\"\n  CC=\"$ac_save_CC\"\n\n  if test \"x$ac_use_gas_preprocessor\" = \"xyes\" ; then\n    CCAS=\"gas-preprocessor.pl $CCAS\"\n\n    ac_good_gnu_arm_assembler=yes\n  fi\n\n  if test \"x$ac_good_gnu_arm_assembler\" = \"xyes\" ; then\n    if test \"x$ac_use_gas_preprocessor\" = \"xyes\"; then\n           { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes (with gas-preprocessor)\" >&5\n$as_echo \"yes (with gas-preprocessor)\" >&6; }\n         else\n           { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n         fi\n         simd_arch=arm\n  else\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n         with_simd=no\n  fi\n\n      if test \"x${with_simd}\" = \"xno\"; then\n        if test \"x${require_simd}\" = \"xyes\"; then\n          as_fn_error $? \"SIMD support can't be enabled.\" \"$LINENO\" 5\n        else\n          { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: SIMD support can't be enabled.  Performance will suffer.\" >&5\n$as_echo \"$as_me: WARNING: SIMD support can't be enabled.  Performance will suffer.\" >&2;}\n        fi\n      fi\n      ;;\n    aarch64*)\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes (arm64)\" >&5\n$as_echo \"yes (arm64)\" >&6; }\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if the assembler is GNU-compatible and can be used\" >&5\n$as_echo_n \"checking if the assembler is GNU-compatible and can be used... \" >&6; }\n\n  ac_good_gnu_arm_assembler=no\n  ac_save_CC=\"$CC\"\n  ac_save_CFLAGS=\"$CFLAGS\"\n  CFLAGS=\"$CCASFLAGS -x assembler-with-cpp\"\n  CC=\"$CCAS\"\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n    .text\n    MYVAR .req x0\n    movi v0.16b, #100\n    mov MYVAR, #100\n    .unreq MYVAR\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_good_gnu_arm_assembler=yes\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n\n  ac_use_gas_preprocessor=no\n  if test \"x$ac_good_gnu_arm_assembler\" = \"xno\" ; then\n    CC=\"gas-preprocessor.pl $CCAS\"\n    cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n      .text\n      MYVAR .req x0\n      movi v0.16b, #100\n      mov MYVAR, #100\n      .unreq MYVAR\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  ac_use_gas_preprocessor=yes\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n  fi\n  CFLAGS=\"$ac_save_CFLAGS\"\n  CC=\"$ac_save_CC\"\n\n  if test \"x$ac_use_gas_preprocessor\" = \"xyes\" ; then\n    CCAS=\"gas-preprocessor.pl $CCAS\"\n\n    ac_good_gnu_arm_assembler=yes\n  fi\n\n  if test \"x$ac_good_gnu_arm_assembler\" = \"xyes\" ; then\n    if test \"x$ac_use_gas_preprocessor\" = \"xyes\"; then\n           { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes (with gas-preprocessor)\" >&5\n$as_echo \"yes (with gas-preprocessor)\" >&6; }\n         else\n           { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n         fi\n         simd_arch=aarch64\n  else\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n         with_simd=no\n  fi\n\n      if test \"x${with_simd}\" = \"xno\"; then\n        if test \"x${require_simd}\" = \"xyes\"; then\n          as_fn_error $? \"SIMD support can't be enabled.\" \"$LINENO\" 5\n        else\n          { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: SIMD support can't be enabled.  Performance will suffer.\" >&5\n$as_echo \"$as_me: WARNING: SIMD support can't be enabled.  Performance will suffer.\" >&2;}\n        fi\n      fi\n      ;;\n    mips*)\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes (mips)\" >&5\n$as_echo \"yes (mips)\" >&6; }\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: checking if the assembler is GNU-compatible and can be used\" >&5\n$as_echo_n \"checking if the assembler is GNU-compatible and can be used... \" >&6; }\n\n  have_mips_dspr2=no\n  ac_save_CFLAGS=\"$CFLAGS\"\n  CFLAGS=\"$CCASFLAGS -mdspr2\"\n\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n\n  int main ()\n  {\n    int c = 0, a = 0, b = 0;\n    __asm__ __volatile__ (\n        \"precr.qb.ph %[c], %[a], %[b]          \\n\\t\"\n        : [c] \"=r\" (c)\n        : [a] \"r\" (a), [b] \"r\" (b)\n    );\n    return c;\n  }\n\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"; then :\n  have_mips_dspr2=yes\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.$ac_ext\n  CFLAGS=$ac_save_CFLAGS\n\n  if test \"x$have_mips_dspr2\" = \"xyes\" ; then\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n$as_echo \"yes\" >&6; }\n         simd_arch=mips\n  else\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\n$as_echo \"no\" >&6; }\n         with_simd=no\n  fi\n\n      if test \"x${with_simd}\" = \"xno\"; then\n        if test \"x${require_simd}\" = \"xyes\"; then\n          as_fn_error $? \"SIMD support can't be enabled.\" \"$LINENO\" 5\n        else\n          { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: SIMD support can't be enabled.  Performance will suffer.\" >&5\n$as_echo \"$as_me: WARNING: SIMD support can't be enabled.  Performance will suffer.\" >&2;}\n        fi\n      fi\n      ;;\n    powerpc*)\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes (powerpc)\" >&5\n$as_echo \"yes (powerpc)\" >&6; }\n      simd_arch=powerpc\n      ;;\n    *)\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: result: no (\\\"$host_cpu\\\")\" >&5\n$as_echo \"no (\\\"$host_cpu\\\")\" >&6; }\n      with_simd=no;\n      if test \"x${require_simd}\" = \"xyes\"; then\n        as_fn_error $? \"SIMD support not available for this CPU.\" \"$LINENO\" 5\n      else\n        { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: SIMD support not available for this CPU.  Performance will suffer.\" >&5\n$as_echo \"$as_me: WARNING: SIMD support not available for this CPU.  Performance will suffer.\" >&2;}\n      fi\n      ;;\n  esac\n\n  if test \"x${with_simd}\" != \"xno\"; then\n\n$as_echo \"#define WITH_SIMD 1\" >>confdefs.h\n\n  fi\nelse\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-simd\"\nfi\n\n if test \"x$with_simd\" != \"xno\"; then\n  WITH_SIMD_TRUE=\n  WITH_SIMD_FALSE='#'\nelse\n  WITH_SIMD_TRUE='#'\n  WITH_SIMD_FALSE=\nfi\n\n if test \"x$simd_arch\" = \"xx86_64\" -o \"x$simd_arch\" = \"xi386\"; then\n  WITH_SSE_FLOAT_DCT_TRUE=\n  WITH_SSE_FLOAT_DCT_FALSE='#'\nelse\n  WITH_SSE_FLOAT_DCT_TRUE='#'\n  WITH_SSE_FLOAT_DCT_FALSE=\nfi\n\n if test \"x$simd_arch\" = \"xi386\"; then\n  SIMD_I386_TRUE=\n  SIMD_I386_FALSE='#'\nelse\n  SIMD_I386_TRUE='#'\n  SIMD_I386_FALSE=\nfi\n\n if test \"x$simd_arch\" = \"xx86_64\"; then\n  SIMD_X86_64_TRUE=\n  SIMD_X86_64_FALSE='#'\nelse\n  SIMD_X86_64_TRUE='#'\n  SIMD_X86_64_FALSE=\nfi\n\n if test \"x$simd_arch\" = \"xarm\"; then\n  SIMD_ARM_TRUE=\n  SIMD_ARM_FALSE='#'\nelse\n  SIMD_ARM_TRUE='#'\n  SIMD_ARM_FALSE=\nfi\n\n if test \"x$simd_arch\" = \"xaarch64\"; then\n  SIMD_ARM_64_TRUE=\n  SIMD_ARM_64_FALSE='#'\nelse\n  SIMD_ARM_64_TRUE='#'\n  SIMD_ARM_64_FALSE=\nfi\n\n if test \"x$simd_arch\" = \"xmips\"; then\n  SIMD_MIPS_TRUE=\n  SIMD_MIPS_FALSE='#'\nelse\n  SIMD_MIPS_TRUE='#'\n  SIMD_MIPS_FALSE=\nfi\n\n if test \"x$simd_arch\" = \"xpowerpc\"; then\n  SIMD_POWERPC_TRUE=\n  SIMD_POWERPC_FALSE='#'\nelse\n  SIMD_POWERPC_TRUE='#'\n  SIMD_POWERPC_FALSE=\nfi\n\n if test \"x$host_cpu\" = \"xx86_64\" -o \"x$host_cpu\" = \"xamd64\"; then\n  X86_64_TRUE=\n  X86_64_FALSE='#'\nelse\n  X86_64_TRUE='#'\n  X86_64_FALSE=\nfi\n\n if test \"x$with_turbojpeg\" != \"xno\"; then\n  WITH_TURBOJPEG_TRUE=\n  WITH_TURBOJPEG_FALSE='#'\nelse\n  WITH_TURBOJPEG_TRUE='#'\n  WITH_TURBOJPEG_FALSE=\nfi\n\n if test \"x$cross_compiling\" = \"xyes\"; then\n  CROSS_COMPILING_TRUE=\n  CROSS_COMPILING_FALSE='#'\nelse\n  CROSS_COMPILING_TRUE='#'\n  CROSS_COMPILING_FALSE=\nfi\n\n\n\nif test \"x$PKGNAME\" = \"x\"; then\n  PKGNAME=$PACKAGE_NAME\nfi\n\n\ncase \"$host_cpu\" in\n  x86_64)\n    RPMARCH=x86_64\n    DEBARCH=amd64\n    ;;\n  i*86 | x86 | ia32)\n    RPMARCH=i386\n    DEBARCH=i386\n    ;;\n  *)\n    RPMARCH=`uname -m`\n    DEBARCH=$RPMARCH\n    ;;\nesac\n\nif test \"${docdir}\" = \"\"; then\n  docdir=${datadir}/doc\n\nfi\n\n\n\n\n\n\ncat >>confdefs.h <<_ACEOF\n#define BUILD \"$BUILD\"\n_ACEOF\n\n\n# NOTE: autoheader automatically modifies the input file of the first\n# invocation of AC_CONFIG_HEADERS, so we put config.h first to prevent\n# jconfig.h.in from being clobbered.  config.h is used only internally, whereas\n# jconfig.h contains macros that are relevant to external programs (macros that\n# specify which features were built into the library.)\nac_config_headers=\"$ac_config_headers config.h\"\n\nac_config_headers=\"$ac_config_headers jconfig.h\"\n\nac_config_headers=\"$ac_config_headers jconfigint.h\"\n\nac_config_files=\"$ac_config_files pkgscripts/libjpeg-turbo.spec.tmpl:release/libjpeg-turbo.spec.in\"\n\nac_config_files=\"$ac_config_files pkgscripts/makecygwinpkg.tmpl:release/makecygwinpkg.in\"\n\nac_config_files=\"$ac_config_files pkgscripts/makedpkg.tmpl:release/makedpkg.in\"\n\nac_config_files=\"$ac_config_files pkgscripts/makemacpkg.tmpl:release/makemacpkg.in\"\n\nac_config_files=\"$ac_config_files pkgscripts/uninstall.tmpl:release/uninstall.in\"\n\nac_config_files=\"$ac_config_files pkgscripts/libjpeg.pc:release/libjpeg.pc.in\"\n\nac_config_files=\"$ac_config_files pkgscripts/libturbojpeg.pc:release/libturbojpeg.pc.in\"\n\nif test \"x$with_turbojpeg\" != \"xno\"; then\n  ac_config_files=\"$ac_config_files tjbenchtest\"\n\nfi\nif test \"x$with_java\" = \"xyes\"; then\n  ac_config_files=\"$ac_config_files tjbenchtest.java\"\n\n  ac_config_files=\"$ac_config_files tjexampletest\"\n\nfi\nac_config_files=\"$ac_config_files libjpeg.map\"\n\nac_config_files=\"$ac_config_files Makefile simd/Makefile\"\n\nac_config_files=\"$ac_config_files java/Makefile\"\n\nac_config_files=\"$ac_config_files md5/Makefile\"\n\ncat >confcache <<\\_ACEOF\n# This file is a shell script that caches the results of configure\n# tests run on this system so they can be shared between configure\n# scripts and configure runs, see configure's option --config-cache.\n# It is not useful on other systems.  If it contains results you don't\n# want to keep, you may remove or edit it.\n#\n# config.status only pays attention to the cache file if you give it\n# the --recheck option to rerun configure.\n#\n# `ac_cv_env_foo' variables (set or unset) will be overridden when\n# loading this file, other *unset* `ac_cv_foo' will be assigned the\n# following values.\n\n_ACEOF\n\n# The following way of writing the cache mishandles newlines in values,\n# but we know of no workaround that is simple, portable, and efficient.\n# So, we kill variables containing newlines.\n# Ultrix sh set writes to stderr and can't be redirected directly,\n# and sets the high bit in the cache file unless we assign to the vars.\n(\n  for ac_var in `(set) 2>&1 | sed -n 's/^\\([a-zA-Z_][a-zA-Z0-9_]*\\)=.*/\\1/p'`; do\n    eval ac_val=\\$$ac_var\n    case $ac_val in #(\n    *${as_nl}*)\n      case $ac_var in #(\n      *_cv_*) { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline\" >&5\n$as_echo \"$as_me: WARNING: cache variable $ac_var contains a newline\" >&2;} ;;\n      esac\n      case $ac_var in #(\n      _ | IFS | as_nl) ;; #(\n      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(\n      *) { eval $ac_var=; unset $ac_var;} ;;\n      esac ;;\n    esac\n  done\n\n  (set) 2>&1 |\n    case $as_nl`(ac_space=' '; set) 2>&1` in #(\n    *${as_nl}ac_space=\\ *)\n      # `set' does not quote correctly, so add quotes: double-quote\n      # substitution turns \\\\\\\\ into \\\\, and sed turns \\\\ into \\.\n      sed -n \\\n\t\"s/'/'\\\\\\\\''/g;\n\t  s/^\\\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\\\)=\\\\(.*\\\\)/\\\\1='\\\\2'/p\"\n      ;; #(\n    *)\n      # `set' quotes correctly as required by POSIX, so do not add quotes.\n      sed -n \"/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p\"\n      ;;\n    esac |\n    sort\n) |\n  sed '\n     /^ac_cv_env_/b end\n     t clear\n     :clear\n     s/^\\([^=]*\\)=\\(.*[{}].*\\)$/test \"${\\1+set}\" = set || &/\n     t end\n     s/^\\([^=]*\\)=\\(.*\\)$/\\1=${\\1=\\2}/\n     :end' >>confcache\nif diff \"$cache_file\" confcache >/dev/null 2>&1; then :; else\n  if test -w \"$cache_file\"; then\n    if test \"x$cache_file\" != \"x/dev/null\"; then\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: updating cache $cache_file\" >&5\n$as_echo \"$as_me: updating cache $cache_file\" >&6;}\n      if test ! -f \"$cache_file\" || test -h \"$cache_file\"; then\n\tcat confcache >\"$cache_file\"\n      else\n        case $cache_file in #(\n        */* | ?:*)\n\t  mv -f confcache \"$cache_file\"$$ &&\n\t  mv -f \"$cache_file\"$$ \"$cache_file\" ;; #(\n        *)\n\t  mv -f confcache \"$cache_file\" ;;\n\tesac\n      fi\n    fi\n  else\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file\" >&5\n$as_echo \"$as_me: not updating unwritable cache $cache_file\" >&6;}\n  fi\nfi\nrm -f confcache\n\ntest \"x$prefix\" = xNONE && prefix=$ac_default_prefix\n# Let make expand exec_prefix.\ntest \"x$exec_prefix\" = xNONE && exec_prefix='${prefix}'\n\nDEFS=-DHAVE_CONFIG_H\n\nac_libobjs=\nac_ltlibobjs=\nU=\nfor ac_i in : $LIBOBJS; do test \"x$ac_i\" = x: && continue\n  # 1. Remove the extension, and $U if already installed.\n  ac_script='s/\\$U\\././;s/\\.o$//;s/\\.obj$//'\n  ac_i=`$as_echo \"$ac_i\" | sed \"$ac_script\"`\n  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR\n  #    will be set to the directory where LIBOBJS objects are built.\n  as_fn_append ac_libobjs \" \\${LIBOBJDIR}$ac_i\\$U.$ac_objext\"\n  as_fn_append ac_ltlibobjs \" \\${LIBOBJDIR}$ac_i\"'$U.lo'\ndone\nLIBOBJS=$ac_libobjs\n\nLTLIBOBJS=$ac_ltlibobjs\n\n\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure\" >&5\n$as_echo_n \"checking that generated files are newer than configure... \" >&6; }\n   if test -n \"$am_sleep_pid\"; then\n     # Hide warnings about reused PIDs.\n     wait $am_sleep_pid 2>/dev/null\n   fi\n   { $as_echo \"$as_me:${as_lineno-$LINENO}: result: done\" >&5\n$as_echo \"done\" >&6; }\n if test -n \"$EXEEXT\"; then\n  am__EXEEXT_TRUE=\n  am__EXEEXT_FALSE='#'\nelse\n  am__EXEEXT_TRUE='#'\n  am__EXEEXT_FALSE=\nfi\n\nif test -z \"${AMDEP_TRUE}\" && test -z \"${AMDEP_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"AMDEP\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${am__fastdepCC_TRUE}\" && test -z \"${am__fastdepCC_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"am__fastdepCC\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${am__fastdepCC_TRUE}\" && test -z \"${am__fastdepCC_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"am__fastdepCC\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${am__fastdepCCAS_TRUE}\" && test -z \"${am__fastdepCCAS_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"am__fastdepCCAS\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${VERSION_SCRIPT_TRUE}\" && test -z \"${VERSION_SCRIPT_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"VERSION_SCRIPT\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${WITH_ARITH_ENC_TRUE}\" && test -z \"${WITH_ARITH_ENC_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"WITH_ARITH_ENC\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${WITH_ARITH_DEC_TRUE}\" && test -z \"${WITH_ARITH_DEC_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"WITH_ARITH_DEC\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${WITH_ARITH_TRUE}\" && test -z \"${WITH_ARITH_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"WITH_ARITH\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${WITH_12BIT_TRUE}\" && test -z \"${WITH_12BIT_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"WITH_12BIT\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${WITH_JAVA_TRUE}\" && test -z \"${WITH_JAVA_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"WITH_JAVA\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${WITH_SIMD_TRUE}\" && test -z \"${WITH_SIMD_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"WITH_SIMD\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${WITH_SSE_FLOAT_DCT_TRUE}\" && test -z \"${WITH_SSE_FLOAT_DCT_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"WITH_SSE_FLOAT_DCT\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${SIMD_I386_TRUE}\" && test -z \"${SIMD_I386_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"SIMD_I386\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${SIMD_X86_64_TRUE}\" && test -z \"${SIMD_X86_64_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"SIMD_X86_64\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${SIMD_ARM_TRUE}\" && test -z \"${SIMD_ARM_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"SIMD_ARM\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${SIMD_ARM_64_TRUE}\" && test -z \"${SIMD_ARM_64_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"SIMD_ARM_64\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${SIMD_MIPS_TRUE}\" && test -z \"${SIMD_MIPS_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"SIMD_MIPS\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${SIMD_POWERPC_TRUE}\" && test -z \"${SIMD_POWERPC_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"SIMD_POWERPC\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${X86_64_TRUE}\" && test -z \"${X86_64_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"X86_64\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${WITH_TURBOJPEG_TRUE}\" && test -z \"${WITH_TURBOJPEG_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"WITH_TURBOJPEG\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\nif test -z \"${CROSS_COMPILING_TRUE}\" && test -z \"${CROSS_COMPILING_FALSE}\"; then\n  as_fn_error $? \"conditional \\\"CROSS_COMPILING\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" \"$LINENO\" 5\nfi\n\n: \"${CONFIG_STATUS=./config.status}\"\nac_write_fail=0\nac_clean_files_save=$ac_clean_files\nac_clean_files=\"$ac_clean_files $CONFIG_STATUS\"\n{ $as_echo \"$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS\" >&5\n$as_echo \"$as_me: creating $CONFIG_STATUS\" >&6;}\nas_write_fail=0\ncat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1\n#! $SHELL\n# Generated by $as_me.\n# Run this file to recreate the current configuration.\n# Compiler output produced by configure, useful for debugging\n# configure, is in config.log if it exists.\n\ndebug=false\nac_cs_recheck=false\nac_cs_silent=false\n\nSHELL=\\${CONFIG_SHELL-$SHELL}\nexport SHELL\n_ASEOF\ncat >>$CONFIG_STATUS <<\\_ASEOF || as_write_fail=1\n## -------------------- ##\n## M4sh Initialization. ##\n## -------------------- ##\n\n# Be more Bourne compatible\nDUALCASE=1; export DUALCASE # for MKS sh\nif test -n \"${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :\n  emulate sh\n  NULLCMD=:\n  # Pre-4.2 versions of Zsh do word splitting on ${1+\"$@\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '${1+\"$@\"}'='\"$@\"'\n  setopt NO_GLOB_SUBST\nelse\n  case `(set -o) 2>/dev/null` in #(\n  *posix*) :\n    set -o posix ;; #(\n  *) :\n     ;;\nesac\nfi\n\n\nas_nl='\n'\nexport as_nl\n# Printing a long string crashes Solaris 7 /usr/bin/printf.\nas_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\nas_echo=$as_echo$as_echo$as_echo$as_echo$as_echo\nas_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo\n# Prefer a ksh shell builtin over an external printf program on Solaris,\n# but without wasting forks for bash or zsh.\nif test -z \"$BASH_VERSION$ZSH_VERSION\" \\\n    && (test \"X`print -r -- $as_echo`\" = \"X$as_echo\") 2>/dev/null; then\n  as_echo='print -r --'\n  as_echo_n='print -rn --'\nelif (test \"X`printf %s $as_echo`\" = \"X$as_echo\") 2>/dev/null; then\n  as_echo='printf %s\\n'\n  as_echo_n='printf %s'\nelse\n  if test \"X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`\" = \"X-n $as_echo\"; then\n    as_echo_body='eval /usr/ucb/echo -n \"$1$as_nl\"'\n    as_echo_n='/usr/ucb/echo -n'\n  else\n    as_echo_body='eval expr \"X$1\" : \"X\\\\(.*\\\\)\"'\n    as_echo_n_body='eval\n      arg=$1;\n      case $arg in #(\n      *\"$as_nl\"*)\n\texpr \"X$arg\" : \"X\\\\(.*\\\\)$as_nl\";\n\targ=`expr \"X$arg\" : \".*$as_nl\\\\(.*\\\\)\"`;;\n      esac;\n      expr \"X$arg\" : \"X\\\\(.*\\\\)\" | tr -d \"$as_nl\"\n    '\n    export as_echo_n_body\n    as_echo_n='sh -c $as_echo_n_body as_echo'\n  fi\n  export as_echo_body\n  as_echo='sh -c $as_echo_body as_echo'\nfi\n\n# The user is always right.\nif test \"${PATH_SEPARATOR+set}\" != set; then\n  PATH_SEPARATOR=:\n  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {\n    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||\n      PATH_SEPARATOR=';'\n  }\nfi\n\n\n# IFS\n# We need space, tab and new line, in precisely that order.  Quoting is\n# there to prevent editors from complaining about space-tab.\n# (If _AS_PATH_WALK were called with IFS unset, it would disable word\n# splitting by setting IFS to empty value.)\nIFS=\" \"\"\t$as_nl\"\n\n# Find who we are.  Look in the path if we contain no directory separator.\nas_myself=\ncase $0 in #((\n  *[\\\\/]* ) as_myself=$0 ;;\n  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n    test -r \"$as_dir/$0\" && as_myself=$as_dir/$0 && break\n  done\nIFS=$as_save_IFS\n\n     ;;\nesac\n# We did not find ourselves, most probably we were run as `sh COMMAND'\n# in which case we are not to be found in the path.\nif test \"x$as_myself\" = x; then\n  as_myself=$0\nfi\nif test ! -f \"$as_myself\"; then\n  $as_echo \"$as_myself: error: cannot find myself; rerun with an absolute file name\" >&2\n  exit 1\nfi\n\n# Unset variables that we do not need and which cause bugs (e.g. in\n# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the \"|| exit 1\"\n# suppresses any \"Segmentation fault\" message there.  '((' could\n# trigger a bug in pdksh 5.2.14.\nfor as_var in BASH_ENV ENV MAIL MAILPATH\ndo eval test x\\${$as_var+set} = xset \\\n  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :\ndone\nPS1='$ '\nPS2='> '\nPS4='+ '\n\n# NLS nuisances.\nLC_ALL=C\nexport LC_ALL\nLANGUAGE=C\nexport LANGUAGE\n\n# CDPATH.\n(unset CDPATH) >/dev/null 2>&1 && unset CDPATH\n\n\n# as_fn_error STATUS ERROR [LINENO LOG_FD]\n# ----------------------------------------\n# Output \"`basename $0`: error: ERROR\" to stderr. If LINENO and LOG_FD are\n# provided, also output the error to LOG_FD, referencing LINENO. Then exit the\n# script with STATUS, using 1 if that was 0.\nas_fn_error ()\n{\n  as_status=$1; test $as_status -eq 0 && as_status=1\n  if test \"$4\"; then\n    as_lineno=${as_lineno-\"$3\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n    $as_echo \"$as_me:${as_lineno-$LINENO}: error: $2\" >&$4\n  fi\n  $as_echo \"$as_me: error: $2\" >&2\n  as_fn_exit $as_status\n} # as_fn_error\n\n\n# as_fn_set_status STATUS\n# -----------------------\n# Set $? to STATUS, without forking.\nas_fn_set_status ()\n{\n  return $1\n} # as_fn_set_status\n\n# as_fn_exit STATUS\n# -----------------\n# Exit the shell with STATUS, even in a \"trap 0\" or \"set -e\" context.\nas_fn_exit ()\n{\n  set +e\n  as_fn_set_status $1\n  exit $1\n} # as_fn_exit\n\n# as_fn_unset VAR\n# ---------------\n# Portably unset VAR.\nas_fn_unset ()\n{\n  { eval $1=; unset $1;}\n}\nas_unset=as_fn_unset\n# as_fn_append VAR VALUE\n# ----------------------\n# Append the text in VALUE to the end of the definition contained in VAR. Take\n# advantage of any shell optimizations that allow amortized linear growth over\n# repeated appends, instead of the typical quadratic growth present in naive\n# implementations.\nif (eval \"as_var=1; as_var+=2; test x\\$as_var = x12\") 2>/dev/null; then :\n  eval 'as_fn_append ()\n  {\n    eval $1+=\\$2\n  }'\nelse\n  as_fn_append ()\n  {\n    eval $1=\\$$1\\$2\n  }\nfi # as_fn_append\n\n# as_fn_arith ARG...\n# ------------------\n# Perform arithmetic evaluation on the ARGs, and store the result in the\n# global $as_val. Take advantage of shells that can avoid forks. The arguments\n# must be portable across $(()) and expr.\nif (eval \"test \\$(( 1 + 1 )) = 2\") 2>/dev/null; then :\n  eval 'as_fn_arith ()\n  {\n    as_val=$(( $* ))\n  }'\nelse\n  as_fn_arith ()\n  {\n    as_val=`expr \"$@\" || test $? -eq 1`\n  }\nfi # as_fn_arith\n\n\nif expr a : '\\(a\\)' >/dev/null 2>&1 &&\n   test \"X`expr 00001 : '.*\\(...\\)'`\" = X001; then\n  as_expr=expr\nelse\n  as_expr=false\nfi\n\nif (basename -- /) >/dev/null 2>&1 && test \"X`basename -- / 2>&1`\" = \"X/\"; then\n  as_basename=basename\nelse\n  as_basename=false\nfi\n\nif (as_dir=`dirname -- /` && test \"X$as_dir\" = X/) >/dev/null 2>&1; then\n  as_dirname=dirname\nelse\n  as_dirname=false\nfi\n\nas_me=`$as_basename -- \"$0\" ||\n$as_expr X/\"$0\" : '.*/\\([^/][^/]*\\)/*$' \\| \\\n\t X\"$0\" : 'X\\(//\\)$' \\| \\\n\t X\"$0\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X/\"$0\" |\n    sed '/^.*\\/\\([^/][^/]*\\)\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n\n# Avoid depending upon Character Ranges.\nas_cr_letters='abcdefghijklmnopqrstuvwxyz'\nas_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'\nas_cr_Letters=$as_cr_letters$as_cr_LETTERS\nas_cr_digits='0123456789'\nas_cr_alnum=$as_cr_Letters$as_cr_digits\n\nECHO_C= ECHO_N= ECHO_T=\ncase `echo -n x` in #(((((\n-n*)\n  case `echo 'xy\\c'` in\n  *c*) ECHO_T='\t';;\t# ECHO_T is single tab character.\n  xy)  ECHO_C='\\c';;\n  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null\n       ECHO_T='\t';;\n  esac;;\n*)\n  ECHO_N='-n';;\nesac\n\nrm -f conf$$ conf$$.exe conf$$.file\nif test -d conf$$.dir; then\n  rm -f conf$$.dir/conf$$.file\nelse\n  rm -f conf$$.dir\n  mkdir conf$$.dir 2>/dev/null\nfi\nif (echo >conf$$.file) 2>/dev/null; then\n  if ln -s conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s='ln -s'\n    # ... but there are two gotchas:\n    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.\n    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.\n    # In both cases, we have to default to `cp -pR'.\n    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||\n      as_ln_s='cp -pR'\n  elif ln conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s=ln\n  else\n    as_ln_s='cp -pR'\n  fi\nelse\n  as_ln_s='cp -pR'\nfi\nrm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file\nrmdir conf$$.dir 2>/dev/null\n\n\n# as_fn_mkdir_p\n# -------------\n# Create \"$as_dir\" as a directory, including parents if necessary.\nas_fn_mkdir_p ()\n{\n\n  case $as_dir in #(\n  -*) as_dir=./$as_dir;;\n  esac\n  test -d \"$as_dir\" || eval $as_mkdir_p || {\n    as_dirs=\n    while :; do\n      case $as_dir in #(\n      *\\'*) as_qdir=`$as_echo \"$as_dir\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;; #'(\n      *) as_qdir=$as_dir;;\n      esac\n      as_dirs=\"'$as_qdir' $as_dirs\"\n      as_dir=`$as_dirname -- \"$as_dir\" ||\n$as_expr X\"$as_dir\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_dir\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X\"$as_dir\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n      test -d \"$as_dir\" && break\n    done\n    test -z \"$as_dirs\" || eval \"mkdir $as_dirs\"\n  } || test -d \"$as_dir\" || as_fn_error $? \"cannot create directory $as_dir\"\n\n\n} # as_fn_mkdir_p\nif mkdir -p . 2>/dev/null; then\n  as_mkdir_p='mkdir -p \"$as_dir\"'\nelse\n  test -d ./-p && rmdir ./-p\n  as_mkdir_p=false\nfi\n\n\n# as_fn_executable_p FILE\n# -----------------------\n# Test if FILE is an executable regular file.\nas_fn_executable_p ()\n{\n  test -f \"$1\" && test -x \"$1\"\n} # as_fn_executable_p\nas_test_x='test -x'\nas_executable_p=as_fn_executable_p\n\n# Sed expression to map a string onto a valid CPP name.\nas_tr_cpp=\"eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'\"\n\n# Sed expression to map a string onto a valid variable name.\nas_tr_sh=\"eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'\"\n\n\nexec 6>&1\n## ----------------------------------- ##\n## Main body of $CONFIG_STATUS script. ##\n## ----------------------------------- ##\n_ASEOF\ntest $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n# Save the log message, to keep $0 and so on meaningful, and to\n# report actual input values of CONFIG_FILES etc. instead of their\n# values after options handling.\nac_log=\"\nThis file was extended by libjpeg-turbo $as_me 1.5.0, which was\ngenerated by GNU Autoconf 2.69.  Invocation command line was\n\n  CONFIG_FILES    = $CONFIG_FILES\n  CONFIG_HEADERS  = $CONFIG_HEADERS\n  CONFIG_LINKS    = $CONFIG_LINKS\n  CONFIG_COMMANDS = $CONFIG_COMMANDS\n  $ $0 $@\n\non `(hostname || uname -n) 2>/dev/null | sed 1q`\n\"\n\n_ACEOF\n\ncase $ac_config_files in *\"\n\"*) set x $ac_config_files; shift; ac_config_files=$*;;\nesac\n\ncase $ac_config_headers in *\"\n\"*) set x $ac_config_headers; shift; ac_config_headers=$*;;\nesac\n\n\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n# Files that config.status was made for.\nconfig_files=\"$ac_config_files\"\nconfig_headers=\"$ac_config_headers\"\nconfig_commands=\"$ac_config_commands\"\n\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nac_cs_usage=\"\\\n\\`$as_me' instantiates files and other configuration actions\nfrom templates according to the current configuration.  Unless the files\nand actions are specified as TAGs, all are instantiated by default.\n\nUsage: $0 [OPTION]... [TAG]...\n\n  -h, --help       print this help, then exit\n  -V, --version    print version number and configuration settings, then exit\n      --config     print configuration, then exit\n  -q, --quiet, --silent\n                   do not print progress messages\n  -d, --debug      don't remove temporary files\n      --recheck    update $as_me by reconfiguring in the same conditions\n      --file=FILE[:TEMPLATE]\n                   instantiate the configuration file FILE\n      --header=FILE[:TEMPLATE]\n                   instantiate the configuration header FILE\n\nConfiguration files:\n$config_files\n\nConfiguration headers:\n$config_headers\n\nConfiguration commands:\n$config_commands\n\nReport bugs to the package provider.\"\n\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\nac_cs_config=\"`$as_echo \"$ac_configure_args\" | sed 's/^ //; s/[\\\\\"\"\\`\\$]/\\\\\\\\&/g'`\"\nac_cs_version=\"\\\\\nlibjpeg-turbo config.status 1.5.0\nconfigured by $0, generated by GNU Autoconf 2.69,\n  with options \\\\\"\\$ac_cs_config\\\\\"\n\nCopyright (C) 2012 Free Software Foundation, Inc.\nThis config.status script is free software; the Free Software Foundation\ngives unlimited permission to copy, distribute and modify it.\"\n\nac_pwd='$ac_pwd'\nsrcdir='$srcdir'\nINSTALL='$INSTALL'\nMKDIR_P='$MKDIR_P'\nAWK='$AWK'\ntest -n \"\\$AWK\" || AWK=awk\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n# The default lists apply if the user does not specify any file.\nac_need_defaults=:\nwhile test $# != 0\ndo\n  case $1 in\n  --*=?*)\n    ac_option=`expr \"X$1\" : 'X\\([^=]*\\)='`\n    ac_optarg=`expr \"X$1\" : 'X[^=]*=\\(.*\\)'`\n    ac_shift=:\n    ;;\n  --*=)\n    ac_option=`expr \"X$1\" : 'X\\([^=]*\\)='`\n    ac_optarg=\n    ac_shift=:\n    ;;\n  *)\n    ac_option=$1\n    ac_optarg=$2\n    ac_shift=shift\n    ;;\n  esac\n\n  case $ac_option in\n  # Handling of the options.\n  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)\n    ac_cs_recheck=: ;;\n  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )\n    $as_echo \"$ac_cs_version\"; exit ;;\n  --config | --confi | --conf | --con | --co | --c )\n    $as_echo \"$ac_cs_config\"; exit ;;\n  --debug | --debu | --deb | --de | --d | -d )\n    debug=: ;;\n  --file | --fil | --fi | --f )\n    $ac_shift\n    case $ac_optarg in\n    *\\'*) ac_optarg=`$as_echo \"$ac_optarg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    '') as_fn_error $? \"missing file argument\" ;;\n    esac\n    as_fn_append CONFIG_FILES \" '$ac_optarg'\"\n    ac_need_defaults=false;;\n  --header | --heade | --head | --hea )\n    $ac_shift\n    case $ac_optarg in\n    *\\'*) ac_optarg=`$as_echo \"$ac_optarg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    esac\n    as_fn_append CONFIG_HEADERS \" '$ac_optarg'\"\n    ac_need_defaults=false;;\n  --he | --h)\n    # Conflict between --help and --header\n    as_fn_error $? \"ambiguous option: \\`$1'\nTry \\`$0 --help' for more information.\";;\n  --help | --hel | -h )\n    $as_echo \"$ac_cs_usage\"; exit ;;\n  -q | -quiet | --quiet | --quie | --qui | --qu | --q \\\n  | -silent | --silent | --silen | --sile | --sil | --si | --s)\n    ac_cs_silent=: ;;\n\n  # This is an error.\n  -*) as_fn_error $? \"unrecognized option: \\`$1'\nTry \\`$0 --help' for more information.\" ;;\n\n  *) as_fn_append ac_config_targets \" $1\"\n     ac_need_defaults=false ;;\n\n  esac\n  shift\ndone\n\nac_configure_extra_args=\n\nif $ac_cs_silent; then\n  exec 6>/dev/null\n  ac_configure_extra_args=\"$ac_configure_extra_args --silent\"\nfi\n\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\nif \\$ac_cs_recheck; then\n  set X $SHELL '$0' $ac_configure_args \\$ac_configure_extra_args --no-create --no-recursion\n  shift\n  \\$as_echo \"running CONFIG_SHELL=$SHELL \\$*\" >&6\n  CONFIG_SHELL='$SHELL'\n  export CONFIG_SHELL\n  exec \"\\$@\"\nfi\n\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nexec 5>>config.log\n{\n  echo\n  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX\n## Running $as_me. ##\n_ASBOX\n  $as_echo \"$ac_log\"\n} >&5\n\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n#\n# INIT-COMMANDS\n#\nAMDEP_TRUE=\"$AMDEP_TRUE\" ac_aux_dir=\"$ac_aux_dir\"\n\n\n# The HP-UX ksh and POSIX shell print the target directory to stdout\n# if CDPATH is set.\n(unset CDPATH) >/dev/null 2>&1 && unset CDPATH\n\nsed_quote_subst='$sed_quote_subst'\ndouble_quote_subst='$double_quote_subst'\ndelay_variable_subst='$delay_variable_subst'\nmacro_version='`$ECHO \"$macro_version\" | $SED \"$delay_single_quote_subst\"`'\nmacro_revision='`$ECHO \"$macro_revision\" | $SED \"$delay_single_quote_subst\"`'\nenable_shared='`$ECHO \"$enable_shared\" | $SED \"$delay_single_quote_subst\"`'\nenable_static='`$ECHO \"$enable_static\" | $SED \"$delay_single_quote_subst\"`'\npic_mode='`$ECHO \"$pic_mode\" | $SED \"$delay_single_quote_subst\"`'\nenable_fast_install='`$ECHO \"$enable_fast_install\" | $SED \"$delay_single_quote_subst\"`'\nshared_archive_member_spec='`$ECHO \"$shared_archive_member_spec\" | $SED \"$delay_single_quote_subst\"`'\nSHELL='`$ECHO \"$SHELL\" | $SED \"$delay_single_quote_subst\"`'\nECHO='`$ECHO \"$ECHO\" | $SED \"$delay_single_quote_subst\"`'\nPATH_SEPARATOR='`$ECHO \"$PATH_SEPARATOR\" | $SED \"$delay_single_quote_subst\"`'\nhost_alias='`$ECHO \"$host_alias\" | $SED \"$delay_single_quote_subst\"`'\nhost='`$ECHO \"$host\" | $SED \"$delay_single_quote_subst\"`'\nhost_os='`$ECHO \"$host_os\" | $SED \"$delay_single_quote_subst\"`'\nbuild_alias='`$ECHO \"$build_alias\" | $SED \"$delay_single_quote_subst\"`'\nbuild='`$ECHO \"$build\" | $SED \"$delay_single_quote_subst\"`'\nbuild_os='`$ECHO \"$build_os\" | $SED \"$delay_single_quote_subst\"`'\nSED='`$ECHO \"$SED\" | $SED \"$delay_single_quote_subst\"`'\nXsed='`$ECHO \"$Xsed\" | $SED \"$delay_single_quote_subst\"`'\nGREP='`$ECHO \"$GREP\" | $SED \"$delay_single_quote_subst\"`'\nEGREP='`$ECHO \"$EGREP\" | $SED \"$delay_single_quote_subst\"`'\nFGREP='`$ECHO \"$FGREP\" | $SED \"$delay_single_quote_subst\"`'\nLD='`$ECHO \"$LD\" | $SED \"$delay_single_quote_subst\"`'\nNM='`$ECHO \"$NM\" | $SED \"$delay_single_quote_subst\"`'\nLN_S='`$ECHO \"$LN_S\" | $SED \"$delay_single_quote_subst\"`'\nmax_cmd_len='`$ECHO \"$max_cmd_len\" | $SED \"$delay_single_quote_subst\"`'\nac_objext='`$ECHO \"$ac_objext\" | $SED \"$delay_single_quote_subst\"`'\nexeext='`$ECHO \"$exeext\" | $SED \"$delay_single_quote_subst\"`'\nlt_unset='`$ECHO \"$lt_unset\" | $SED \"$delay_single_quote_subst\"`'\nlt_SP2NL='`$ECHO \"$lt_SP2NL\" | $SED \"$delay_single_quote_subst\"`'\nlt_NL2SP='`$ECHO \"$lt_NL2SP\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_to_host_file_cmd='`$ECHO \"$lt_cv_to_host_file_cmd\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_to_tool_file_cmd='`$ECHO \"$lt_cv_to_tool_file_cmd\" | $SED \"$delay_single_quote_subst\"`'\nreload_flag='`$ECHO \"$reload_flag\" | $SED \"$delay_single_quote_subst\"`'\nreload_cmds='`$ECHO \"$reload_cmds\" | $SED \"$delay_single_quote_subst\"`'\nOBJDUMP='`$ECHO \"$OBJDUMP\" | $SED \"$delay_single_quote_subst\"`'\ndeplibs_check_method='`$ECHO \"$deplibs_check_method\" | $SED \"$delay_single_quote_subst\"`'\nfile_magic_cmd='`$ECHO \"$file_magic_cmd\" | $SED \"$delay_single_quote_subst\"`'\nfile_magic_glob='`$ECHO \"$file_magic_glob\" | $SED \"$delay_single_quote_subst\"`'\nwant_nocaseglob='`$ECHO \"$want_nocaseglob\" | $SED \"$delay_single_quote_subst\"`'\nDLLTOOL='`$ECHO \"$DLLTOOL\" | $SED \"$delay_single_quote_subst\"`'\nsharedlib_from_linklib_cmd='`$ECHO \"$sharedlib_from_linklib_cmd\" | $SED \"$delay_single_quote_subst\"`'\nAR='`$ECHO \"$AR\" | $SED \"$delay_single_quote_subst\"`'\nAR_FLAGS='`$ECHO \"$AR_FLAGS\" | $SED \"$delay_single_quote_subst\"`'\narchiver_list_spec='`$ECHO \"$archiver_list_spec\" | $SED \"$delay_single_quote_subst\"`'\nSTRIP='`$ECHO \"$STRIP\" | $SED \"$delay_single_quote_subst\"`'\nRANLIB='`$ECHO \"$RANLIB\" | $SED \"$delay_single_quote_subst\"`'\nold_postinstall_cmds='`$ECHO \"$old_postinstall_cmds\" | $SED \"$delay_single_quote_subst\"`'\nold_postuninstall_cmds='`$ECHO \"$old_postuninstall_cmds\" | $SED \"$delay_single_quote_subst\"`'\nold_archive_cmds='`$ECHO \"$old_archive_cmds\" | $SED \"$delay_single_quote_subst\"`'\nlock_old_archive_extraction='`$ECHO \"$lock_old_archive_extraction\" | $SED \"$delay_single_quote_subst\"`'\nCC='`$ECHO \"$CC\" | $SED \"$delay_single_quote_subst\"`'\nCFLAGS='`$ECHO \"$CFLAGS\" | $SED \"$delay_single_quote_subst\"`'\ncompiler='`$ECHO \"$compiler\" | $SED \"$delay_single_quote_subst\"`'\nGCC='`$ECHO \"$GCC\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_sys_global_symbol_pipe='`$ECHO \"$lt_cv_sys_global_symbol_pipe\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_sys_global_symbol_to_cdecl='`$ECHO \"$lt_cv_sys_global_symbol_to_cdecl\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_sys_global_symbol_to_import='`$ECHO \"$lt_cv_sys_global_symbol_to_import\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_sys_global_symbol_to_c_name_address='`$ECHO \"$lt_cv_sys_global_symbol_to_c_name_address\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO \"$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_nm_interface='`$ECHO \"$lt_cv_nm_interface\" | $SED \"$delay_single_quote_subst\"`'\nnm_file_list_spec='`$ECHO \"$nm_file_list_spec\" | $SED \"$delay_single_quote_subst\"`'\nlt_sysroot='`$ECHO \"$lt_sysroot\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_truncate_bin='`$ECHO \"$lt_cv_truncate_bin\" | $SED \"$delay_single_quote_subst\"`'\nobjdir='`$ECHO \"$objdir\" | $SED \"$delay_single_quote_subst\"`'\nMAGIC_CMD='`$ECHO \"$MAGIC_CMD\" | $SED \"$delay_single_quote_subst\"`'\nlt_prog_compiler_no_builtin_flag='`$ECHO \"$lt_prog_compiler_no_builtin_flag\" | $SED \"$delay_single_quote_subst\"`'\nlt_prog_compiler_pic='`$ECHO \"$lt_prog_compiler_pic\" | $SED \"$delay_single_quote_subst\"`'\nlt_prog_compiler_wl='`$ECHO \"$lt_prog_compiler_wl\" | $SED \"$delay_single_quote_subst\"`'\nlt_prog_compiler_static='`$ECHO \"$lt_prog_compiler_static\" | $SED \"$delay_single_quote_subst\"`'\nlt_cv_prog_compiler_c_o='`$ECHO \"$lt_cv_prog_compiler_c_o\" | $SED \"$delay_single_quote_subst\"`'\nneed_locks='`$ECHO \"$need_locks\" | $SED \"$delay_single_quote_subst\"`'\nMANIFEST_TOOL='`$ECHO \"$MANIFEST_TOOL\" | $SED \"$delay_single_quote_subst\"`'\nDSYMUTIL='`$ECHO \"$DSYMUTIL\" | $SED \"$delay_single_quote_subst\"`'\nNMEDIT='`$ECHO \"$NMEDIT\" | $SED \"$delay_single_quote_subst\"`'\nLIPO='`$ECHO \"$LIPO\" | $SED \"$delay_single_quote_subst\"`'\nOTOOL='`$ECHO \"$OTOOL\" | $SED \"$delay_single_quote_subst\"`'\nOTOOL64='`$ECHO \"$OTOOL64\" | $SED \"$delay_single_quote_subst\"`'\nlibext='`$ECHO \"$libext\" | $SED \"$delay_single_quote_subst\"`'\nshrext_cmds='`$ECHO \"$shrext_cmds\" | $SED \"$delay_single_quote_subst\"`'\nextract_expsyms_cmds='`$ECHO \"$extract_expsyms_cmds\" | $SED \"$delay_single_quote_subst\"`'\narchive_cmds_need_lc='`$ECHO \"$archive_cmds_need_lc\" | $SED \"$delay_single_quote_subst\"`'\nenable_shared_with_static_runtimes='`$ECHO \"$enable_shared_with_static_runtimes\" | $SED \"$delay_single_quote_subst\"`'\nexport_dynamic_flag_spec='`$ECHO \"$export_dynamic_flag_spec\" | $SED \"$delay_single_quote_subst\"`'\nwhole_archive_flag_spec='`$ECHO \"$whole_archive_flag_spec\" | $SED \"$delay_single_quote_subst\"`'\ncompiler_needs_object='`$ECHO \"$compiler_needs_object\" | $SED \"$delay_single_quote_subst\"`'\nold_archive_from_new_cmds='`$ECHO \"$old_archive_from_new_cmds\" | $SED \"$delay_single_quote_subst\"`'\nold_archive_from_expsyms_cmds='`$ECHO \"$old_archive_from_expsyms_cmds\" | $SED \"$delay_single_quote_subst\"`'\narchive_cmds='`$ECHO \"$archive_cmds\" | $SED \"$delay_single_quote_subst\"`'\narchive_expsym_cmds='`$ECHO \"$archive_expsym_cmds\" | $SED \"$delay_single_quote_subst\"`'\nmodule_cmds='`$ECHO \"$module_cmds\" | $SED \"$delay_single_quote_subst\"`'\nmodule_expsym_cmds='`$ECHO \"$module_expsym_cmds\" | $SED \"$delay_single_quote_subst\"`'\nwith_gnu_ld='`$ECHO \"$with_gnu_ld\" | $SED \"$delay_single_quote_subst\"`'\nallow_undefined_flag='`$ECHO \"$allow_undefined_flag\" | $SED \"$delay_single_quote_subst\"`'\nno_undefined_flag='`$ECHO \"$no_undefined_flag\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_libdir_flag_spec='`$ECHO \"$hardcode_libdir_flag_spec\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_libdir_separator='`$ECHO \"$hardcode_libdir_separator\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_direct='`$ECHO \"$hardcode_direct\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_direct_absolute='`$ECHO \"$hardcode_direct_absolute\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_minus_L='`$ECHO \"$hardcode_minus_L\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_shlibpath_var='`$ECHO \"$hardcode_shlibpath_var\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_automatic='`$ECHO \"$hardcode_automatic\" | $SED \"$delay_single_quote_subst\"`'\ninherit_rpath='`$ECHO \"$inherit_rpath\" | $SED \"$delay_single_quote_subst\"`'\nlink_all_deplibs='`$ECHO \"$link_all_deplibs\" | $SED \"$delay_single_quote_subst\"`'\nalways_export_symbols='`$ECHO \"$always_export_symbols\" | $SED \"$delay_single_quote_subst\"`'\nexport_symbols_cmds='`$ECHO \"$export_symbols_cmds\" | $SED \"$delay_single_quote_subst\"`'\nexclude_expsyms='`$ECHO \"$exclude_expsyms\" | $SED \"$delay_single_quote_subst\"`'\ninclude_expsyms='`$ECHO \"$include_expsyms\" | $SED \"$delay_single_quote_subst\"`'\nprelink_cmds='`$ECHO \"$prelink_cmds\" | $SED \"$delay_single_quote_subst\"`'\npostlink_cmds='`$ECHO \"$postlink_cmds\" | $SED \"$delay_single_quote_subst\"`'\nfile_list_spec='`$ECHO \"$file_list_spec\" | $SED \"$delay_single_quote_subst\"`'\nvariables_saved_for_relink='`$ECHO \"$variables_saved_for_relink\" | $SED \"$delay_single_quote_subst\"`'\nneed_lib_prefix='`$ECHO \"$need_lib_prefix\" | $SED \"$delay_single_quote_subst\"`'\nneed_version='`$ECHO \"$need_version\" | $SED \"$delay_single_quote_subst\"`'\nversion_type='`$ECHO \"$version_type\" | $SED \"$delay_single_quote_subst\"`'\nrunpath_var='`$ECHO \"$runpath_var\" | $SED \"$delay_single_quote_subst\"`'\nshlibpath_var='`$ECHO \"$shlibpath_var\" | $SED \"$delay_single_quote_subst\"`'\nshlibpath_overrides_runpath='`$ECHO \"$shlibpath_overrides_runpath\" | $SED \"$delay_single_quote_subst\"`'\nlibname_spec='`$ECHO \"$libname_spec\" | $SED \"$delay_single_quote_subst\"`'\nlibrary_names_spec='`$ECHO \"$library_names_spec\" | $SED \"$delay_single_quote_subst\"`'\nsoname_spec='`$ECHO \"$soname_spec\" | $SED \"$delay_single_quote_subst\"`'\ninstall_override_mode='`$ECHO \"$install_override_mode\" | $SED \"$delay_single_quote_subst\"`'\npostinstall_cmds='`$ECHO \"$postinstall_cmds\" | $SED \"$delay_single_quote_subst\"`'\npostuninstall_cmds='`$ECHO \"$postuninstall_cmds\" | $SED \"$delay_single_quote_subst\"`'\nfinish_cmds='`$ECHO \"$finish_cmds\" | $SED \"$delay_single_quote_subst\"`'\nfinish_eval='`$ECHO \"$finish_eval\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_into_libs='`$ECHO \"$hardcode_into_libs\" | $SED \"$delay_single_quote_subst\"`'\nsys_lib_search_path_spec='`$ECHO \"$sys_lib_search_path_spec\" | $SED \"$delay_single_quote_subst\"`'\nconfigure_time_dlsearch_path='`$ECHO \"$configure_time_dlsearch_path\" | $SED \"$delay_single_quote_subst\"`'\nconfigure_time_lt_sys_library_path='`$ECHO \"$configure_time_lt_sys_library_path\" | $SED \"$delay_single_quote_subst\"`'\nhardcode_action='`$ECHO \"$hardcode_action\" | $SED \"$delay_single_quote_subst\"`'\nenable_dlopen='`$ECHO \"$enable_dlopen\" | $SED \"$delay_single_quote_subst\"`'\nenable_dlopen_self='`$ECHO \"$enable_dlopen_self\" | $SED \"$delay_single_quote_subst\"`'\nenable_dlopen_self_static='`$ECHO \"$enable_dlopen_self_static\" | $SED \"$delay_single_quote_subst\"`'\nold_striplib='`$ECHO \"$old_striplib\" | $SED \"$delay_single_quote_subst\"`'\nstriplib='`$ECHO \"$striplib\" | $SED \"$delay_single_quote_subst\"`'\n\nLTCC='$LTCC'\nLTCFLAGS='$LTCFLAGS'\ncompiler='$compiler_DEFAULT'\n\n# A function that is used when there is no print builtin or printf.\nfunc_fallback_echo ()\n{\n  eval 'cat <<_LTECHO_EOF\n\\$1\n_LTECHO_EOF'\n}\n\n# Quote evaled strings.\nfor var in SHELL \\\nECHO \\\nPATH_SEPARATOR \\\nSED \\\nGREP \\\nEGREP \\\nFGREP \\\nLD \\\nNM \\\nLN_S \\\nlt_SP2NL \\\nlt_NL2SP \\\nreload_flag \\\nOBJDUMP \\\ndeplibs_check_method \\\nfile_magic_cmd \\\nfile_magic_glob \\\nwant_nocaseglob \\\nDLLTOOL \\\nsharedlib_from_linklib_cmd \\\nAR \\\nAR_FLAGS \\\narchiver_list_spec \\\nSTRIP \\\nRANLIB \\\nCC \\\nCFLAGS \\\ncompiler \\\nlt_cv_sys_global_symbol_pipe \\\nlt_cv_sys_global_symbol_to_cdecl \\\nlt_cv_sys_global_symbol_to_import \\\nlt_cv_sys_global_symbol_to_c_name_address \\\nlt_cv_sys_global_symbol_to_c_name_address_lib_prefix \\\nlt_cv_nm_interface \\\nnm_file_list_spec \\\nlt_cv_truncate_bin \\\nlt_prog_compiler_no_builtin_flag \\\nlt_prog_compiler_pic \\\nlt_prog_compiler_wl \\\nlt_prog_compiler_static \\\nlt_cv_prog_compiler_c_o \\\nneed_locks \\\nMANIFEST_TOOL \\\nDSYMUTIL \\\nNMEDIT \\\nLIPO \\\nOTOOL \\\nOTOOL64 \\\nshrext_cmds \\\nexport_dynamic_flag_spec \\\nwhole_archive_flag_spec \\\ncompiler_needs_object \\\nwith_gnu_ld \\\nallow_undefined_flag \\\nno_undefined_flag \\\nhardcode_libdir_flag_spec \\\nhardcode_libdir_separator \\\nexclude_expsyms \\\ninclude_expsyms \\\nfile_list_spec \\\nvariables_saved_for_relink \\\nlibname_spec \\\nlibrary_names_spec \\\nsoname_spec \\\ninstall_override_mode \\\nfinish_eval \\\nold_striplib \\\nstriplib; do\n    case \\`eval \\\\\\\\\\$ECHO \\\\\\\\\"\"\\\\\\\\\\$\\$var\"\\\\\\\\\"\\` in\n    *[\\\\\\\\\\\\\\`\\\\\"\\\\\\$]*)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\`\\\\\\$ECHO \\\\\"\\\\\\$\\$var\\\\\" | \\\\\\$SED \\\\\"\\\\\\$sed_quote_subst\\\\\"\\\\\\`\\\\\\\\\\\\\"\" ## exclude from sc_prohibit_nested_quotes\n      ;;\n    *)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\$\\$var\\\\\\\\\\\\\"\"\n      ;;\n    esac\ndone\n\n# Double-quote double-evaled strings.\nfor var in reload_cmds \\\nold_postinstall_cmds \\\nold_postuninstall_cmds \\\nold_archive_cmds \\\nextract_expsyms_cmds \\\nold_archive_from_new_cmds \\\nold_archive_from_expsyms_cmds \\\narchive_cmds \\\narchive_expsym_cmds \\\nmodule_cmds \\\nmodule_expsym_cmds \\\nexport_symbols_cmds \\\nprelink_cmds \\\npostlink_cmds \\\npostinstall_cmds \\\npostuninstall_cmds \\\nfinish_cmds \\\nsys_lib_search_path_spec \\\nconfigure_time_dlsearch_path \\\nconfigure_time_lt_sys_library_path; do\n    case \\`eval \\\\\\\\\\$ECHO \\\\\\\\\"\"\\\\\\\\\\$\\$var\"\\\\\\\\\"\\` in\n    *[\\\\\\\\\\\\\\`\\\\\"\\\\\\$]*)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\`\\\\\\$ECHO \\\\\"\\\\\\$\\$var\\\\\" | \\\\\\$SED -e \\\\\"\\\\\\$double_quote_subst\\\\\" -e \\\\\"\\\\\\$sed_quote_subst\\\\\" -e \\\\\"\\\\\\$delay_variable_subst\\\\\"\\\\\\`\\\\\\\\\\\\\"\" ## exclude from sc_prohibit_nested_quotes\n      ;;\n    *)\n      eval \"lt_\\$var=\\\\\\\\\\\\\"\\\\\\$\\$var\\\\\\\\\\\\\"\"\n      ;;\n    esac\ndone\n\nac_aux_dir='$ac_aux_dir'\n\n# See if we are running on zsh, and set the options that allow our\n# commands through without removal of \\ escapes INIT.\nif test -n \"\\${ZSH_VERSION+set}\"; then\n   setopt NO_GLOB_SUBST\nfi\n\n\n    PACKAGE='$PACKAGE'\n    VERSION='$VERSION'\n    RM='$RM'\n    ofile='$ofile'\n\n\n\n\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n\n# Handling of arguments.\nfor ac_config_target in $ac_config_targets\ndo\n  case $ac_config_target in\n    \"depfiles\") CONFIG_COMMANDS=\"$CONFIG_COMMANDS depfiles\" ;;\n    \"libtool\") CONFIG_COMMANDS=\"$CONFIG_COMMANDS libtool\" ;;\n    \"config.h\") CONFIG_HEADERS=\"$CONFIG_HEADERS config.h\" ;;\n    \"jconfig.h\") CONFIG_HEADERS=\"$CONFIG_HEADERS jconfig.h\" ;;\n    \"jconfigint.h\") CONFIG_HEADERS=\"$CONFIG_HEADERS jconfigint.h\" ;;\n    \"pkgscripts/libjpeg-turbo.spec.tmpl\") CONFIG_FILES=\"$CONFIG_FILES pkgscripts/libjpeg-turbo.spec.tmpl:release/libjpeg-turbo.spec.in\" ;;\n    \"pkgscripts/makecygwinpkg.tmpl\") CONFIG_FILES=\"$CONFIG_FILES pkgscripts/makecygwinpkg.tmpl:release/makecygwinpkg.in\" ;;\n    \"pkgscripts/makedpkg.tmpl\") CONFIG_FILES=\"$CONFIG_FILES pkgscripts/makedpkg.tmpl:release/makedpkg.in\" ;;\n    \"pkgscripts/makemacpkg.tmpl\") CONFIG_FILES=\"$CONFIG_FILES pkgscripts/makemacpkg.tmpl:release/makemacpkg.in\" ;;\n    \"pkgscripts/uninstall.tmpl\") CONFIG_FILES=\"$CONFIG_FILES pkgscripts/uninstall.tmpl:release/uninstall.in\" ;;\n    \"pkgscripts/libjpeg.pc\") CONFIG_FILES=\"$CONFIG_FILES pkgscripts/libjpeg.pc:release/libjpeg.pc.in\" ;;\n    \"pkgscripts/libturbojpeg.pc\") CONFIG_FILES=\"$CONFIG_FILES pkgscripts/libturbojpeg.pc:release/libturbojpeg.pc.in\" ;;\n    \"tjbenchtest\") CONFIG_FILES=\"$CONFIG_FILES tjbenchtest\" ;;\n    \"tjbenchtest.java\") CONFIG_FILES=\"$CONFIG_FILES tjbenchtest.java\" ;;\n    \"tjexampletest\") CONFIG_FILES=\"$CONFIG_FILES tjexampletest\" ;;\n    \"libjpeg.map\") CONFIG_FILES=\"$CONFIG_FILES libjpeg.map\" ;;\n    \"Makefile\") CONFIG_FILES=\"$CONFIG_FILES Makefile\" ;;\n    \"simd/Makefile\") CONFIG_FILES=\"$CONFIG_FILES simd/Makefile\" ;;\n    \"java/Makefile\") CONFIG_FILES=\"$CONFIG_FILES java/Makefile\" ;;\n    \"md5/Makefile\") CONFIG_FILES=\"$CONFIG_FILES md5/Makefile\" ;;\n\n  *) as_fn_error $? \"invalid argument: \\`$ac_config_target'\" \"$LINENO\" 5;;\n  esac\ndone\n\n\n# If the user did not use the arguments to specify the items to instantiate,\n# then the envvar interface is used.  Set only those that are not.\n# We use the long form for the default assignment because of an extremely\n# bizarre bug on SunOS 4.1.3.\nif $ac_need_defaults; then\n  test \"${CONFIG_FILES+set}\" = set || CONFIG_FILES=$config_files\n  test \"${CONFIG_HEADERS+set}\" = set || CONFIG_HEADERS=$config_headers\n  test \"${CONFIG_COMMANDS+set}\" = set || CONFIG_COMMANDS=$config_commands\nfi\n\n# Have a temporary directory for convenience.  Make it in the build tree\n# simply because there is no reason against having it here, and in addition,\n# creating and moving files from /tmp can sometimes cause problems.\n# Hook for its removal unless debugging.\n# Note that there is a small window in which the directory will not be cleaned:\n# after its creation but before its name has been assigned to `$tmp'.\n$debug ||\n{\n  tmp= ac_tmp=\n  trap 'exit_status=$?\n  : \"${ac_tmp:=$tmp}\"\n  { test ! -d \"$ac_tmp\" || rm -fr \"$ac_tmp\"; } && exit $exit_status\n' 0\n  trap 'as_fn_exit 1' 1 2 13 15\n}\n# Create a (secure) tmp directory for tmp files.\n\n{\n  tmp=`(umask 077 && mktemp -d \"./confXXXXXX\") 2>/dev/null` &&\n  test -d \"$tmp\"\n}  ||\n{\n  tmp=./conf$$-$RANDOM\n  (umask 077 && mkdir \"$tmp\")\n} || as_fn_error $? \"cannot create a temporary directory in .\" \"$LINENO\" 5\nac_tmp=$tmp\n\n# Set up the scripts for CONFIG_FILES section.\n# No need to generate them if there are no CONFIG_FILES.\n# This happens for instance with `./config.status config.h'.\nif test -n \"$CONFIG_FILES\"; then\n\n\nac_cr=`echo X | tr X '\\015'`\n# On cygwin, bash can eat \\r inside `` if the user requested igncr.\n# But we know of no other shell where ac_cr would be empty at this\n# point, so we can use a bashism as a fallback.\nif test \"x$ac_cr\" = x; then\n  eval ac_cr=\\$\\'\\\\r\\'\nfi\nac_cs_awk_cr=`$AWK 'BEGIN { print \"a\\rb\" }' </dev/null 2>/dev/null`\nif test \"$ac_cs_awk_cr\" = \"a${ac_cr}b\"; then\n  ac_cs_awk_cr='\\\\r'\nelse\n  ac_cs_awk_cr=$ac_cr\nfi\n\necho 'BEGIN {' >\"$ac_tmp/subs1.awk\" &&\n_ACEOF\n\n\n{\n  echo \"cat >conf$$subs.awk <<_ACEOF\" &&\n  echo \"$ac_subst_vars\" | sed 's/.*/&!$&$ac_delim/' &&\n  echo \"_ACEOF\"\n} >conf$$subs.sh ||\n  as_fn_error $? \"could not make $CONFIG_STATUS\" \"$LINENO\" 5\nac_delim_num=`echo \"$ac_subst_vars\" | grep -c '^'`\nac_delim='%!_!# '\nfor ac_last_try in false false false false false :; do\n  . ./conf$$subs.sh ||\n    as_fn_error $? \"could not make $CONFIG_STATUS\" \"$LINENO\" 5\n\n  ac_delim_n=`sed -n \"s/.*$ac_delim\\$/X/p\" conf$$subs.awk | grep -c X`\n  if test $ac_delim_n = $ac_delim_num; then\n    break\n  elif $ac_last_try; then\n    as_fn_error $? \"could not make $CONFIG_STATUS\" \"$LINENO\" 5\n  else\n    ac_delim=\"$ac_delim!$ac_delim _$ac_delim!! \"\n  fi\ndone\nrm -f conf$$subs.sh\n\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\ncat >>\"\\$ac_tmp/subs1.awk\" <<\\\\_ACAWK &&\n_ACEOF\nsed -n '\nh\ns/^/S[\"/; s/!.*/\"]=/\np\ng\ns/^[^!]*!//\n:repl\nt repl\ns/'\"$ac_delim\"'$//\nt delim\n:nl\nh\ns/\\(.\\{148\\}\\)..*/\\1/\nt more1\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\\\\n\"\\\\/\np\nn\nb repl\n:more1\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\"\\\\/\np\ng\ns/.\\{148\\}//\nt nl\n:delim\nh\ns/\\(.\\{148\\}\\)..*/\\1/\nt more2\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\"/\np\nb\n:more2\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\"\\\\/\np\ng\ns/.\\{148\\}//\nt delim\n' <conf$$subs.awk | sed '\n/^[^\"\"]/{\n  N\n  s/\\n//\n}\n' >>$CONFIG_STATUS || ac_write_fail=1\nrm -f conf$$subs.awk\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n_ACAWK\ncat >>\"\\$ac_tmp/subs1.awk\" <<_ACAWK &&\n  for (key in S) S_is_set[key] = 1\n  FS = \"\u0007\"\n\n}\n{\n  line = $ 0\n  nfields = split(line, field, \"@\")\n  substed = 0\n  len = length(field[1])\n  for (i = 2; i < nfields; i++) {\n    key = field[i]\n    keylen = length(key)\n    if (S_is_set[key]) {\n      value = S[key]\n      line = substr(line, 1, len) \"\" value \"\" substr(line, len + keylen + 3)\n      len += length(value) + length(field[++i])\n      substed = 1\n    } else\n      len += 1 + keylen\n  }\n\n  print line\n}\n\n_ACAWK\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nif sed \"s/$ac_cr//\" < /dev/null > /dev/null 2>&1; then\n  sed \"s/$ac_cr\\$//; s/$ac_cr/$ac_cs_awk_cr/g\"\nelse\n  cat\nfi < \"$ac_tmp/subs1.awk\" > \"$ac_tmp/subs.awk\" \\\n  || as_fn_error $? \"could not setup config files machinery\" \"$LINENO\" 5\n_ACEOF\n\n# VPATH may cause trouble with some makes, so we remove sole $(srcdir),\n# ${srcdir} and @srcdir@ entries from VPATH if srcdir is \".\", strip leading and\n# trailing colons and then remove the whole line if VPATH becomes empty\n# (actually we leave an empty line to preserve line numbers).\nif test \"x$srcdir\" = x.; then\n  ac_vpsub='/^[\t ]*VPATH[\t ]*=[\t ]*/{\nh\ns///\ns/^/:/\ns/[\t ]*$/:/\ns/:\\$(srcdir):/:/g\ns/:\\${srcdir}:/:/g\ns/:@srcdir@:/:/g\ns/^:*//\ns/:*$//\nx\ns/\\(=[\t ]*\\).*/\\1/\nG\ns/\\n//\ns/^[^=]*=[\t ]*$//\n}'\nfi\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nfi # test -n \"$CONFIG_FILES\"\n\n# Set up the scripts for CONFIG_HEADERS section.\n# No need to generate them if there are no CONFIG_HEADERS.\n# This happens for instance with `./config.status Makefile'.\nif test -n \"$CONFIG_HEADERS\"; then\ncat >\"$ac_tmp/defines.awk\" <<\\_ACAWK ||\nBEGIN {\n_ACEOF\n\n# Transform confdefs.h into an awk script `defines.awk', embedded as\n# here-document in config.status, that substitutes the proper values into\n# config.h.in to produce config.h.\n\n# Create a delimiter string that does not exist in confdefs.h, to ease\n# handling of long lines.\nac_delim='%!_!# '\nfor ac_last_try in false false :; do\n  ac_tt=`sed -n \"/$ac_delim/p\" confdefs.h`\n  if test -z \"$ac_tt\"; then\n    break\n  elif $ac_last_try; then\n    as_fn_error $? \"could not make $CONFIG_HEADERS\" \"$LINENO\" 5\n  else\n    ac_delim=\"$ac_delim!$ac_delim _$ac_delim!! \"\n  fi\ndone\n\n# For the awk script, D is an array of macro values keyed by name,\n# likewise P contains macro parameters if any.  Preserve backslash\n# newline sequences.\n\nac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*\nsed -n '\ns/.\\{148\\}/&'\"$ac_delim\"'/g\nt rset\n:rset\ns/^[\t ]*#[\t ]*define[\t ][\t ]*/ /\nt def\nd\n:def\ns/\\\\$//\nt bsnl\ns/[\"\\\\]/\\\\&/g\ns/^ \\('\"$ac_word_re\"'\\)\\(([^()]*)\\)[\t ]*\\(.*\\)/P[\"\\1\"]=\"\\2\"\\\nD[\"\\1\"]=\" \\3\"/p\ns/^ \\('\"$ac_word_re\"'\\)[\t ]*\\(.*\\)/D[\"\\1\"]=\" \\2\"/p\nd\n:bsnl\ns/[\"\\\\]/\\\\&/g\ns/^ \\('\"$ac_word_re\"'\\)\\(([^()]*)\\)[\t ]*\\(.*\\)/P[\"\\1\"]=\"\\2\"\\\nD[\"\\1\"]=\" \\3\\\\\\\\\\\\n\"\\\\/p\nt cont\ns/^ \\('\"$ac_word_re\"'\\)[\t ]*\\(.*\\)/D[\"\\1\"]=\" \\2\\\\\\\\\\\\n\"\\\\/p\nt cont\nd\n:cont\nn\ns/.\\{148\\}/&'\"$ac_delim\"'/g\nt clear\n:clear\ns/\\\\$//\nt bsnlc\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\"/p\nd\n:bsnlc\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\\\\\\\\\\\\n\"\\\\/p\nb cont\n' <confdefs.h | sed '\ns/'\"$ac_delim\"'/\"\\\\\\\n\"/g' >>$CONFIG_STATUS || ac_write_fail=1\n\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n  for (key in D) D_is_set[key] = 1\n  FS = \"\u0007\"\n}\n/^[\\t ]*#[\\t ]*(define|undef)[\\t ]+$ac_word_re([\\t (]|\\$)/ {\n  line = \\$ 0\n  split(line, arg, \" \")\n  if (arg[1] == \"#\") {\n    defundef = arg[2]\n    mac1 = arg[3]\n  } else {\n    defundef = substr(arg[1], 2)\n    mac1 = arg[2]\n  }\n  split(mac1, mac2, \"(\") #)\n  macro = mac2[1]\n  prefix = substr(line, 1, index(line, defundef) - 1)\n  if (D_is_set[macro]) {\n    # Preserve the white space surrounding the \"#\".\n    print prefix \"define\", macro P[macro] D[macro]\n    next\n  } else {\n    # Replace #undef with comments.  This is necessary, for example,\n    # in the case of _POSIX_SOURCE, which is predefined and required\n    # on some systems where configure will not decide to define it.\n    if (defundef == \"undef\") {\n      print \"/*\", prefix defundef, macro, \"*/\"\n      next\n    }\n  }\n}\n{ print }\n_ACAWK\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n  as_fn_error $? \"could not setup config headers machinery\" \"$LINENO\" 5\nfi # test -n \"$CONFIG_HEADERS\"\n\n\neval set X \"  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS\"\nshift\nfor ac_tag\ndo\n  case $ac_tag in\n  :[FHLC]) ac_mode=$ac_tag; continue;;\n  esac\n  case $ac_mode$ac_tag in\n  :[FHL]*:*);;\n  :L* | :C*:*) as_fn_error $? \"invalid tag \\`$ac_tag'\" \"$LINENO\" 5;;\n  :[FH]-) ac_tag=-:-;;\n  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;\n  esac\n  ac_save_IFS=$IFS\n  IFS=:\n  set x $ac_tag\n  IFS=$ac_save_IFS\n  shift\n  ac_file=$1\n  shift\n\n  case $ac_mode in\n  :L) ac_source=$1;;\n  :[FH])\n    ac_file_inputs=\n    for ac_f\n    do\n      case $ac_f in\n      -) ac_f=\"$ac_tmp/stdin\";;\n      *) # Look for the file first in the build tree, then in the source tree\n\t # (if the path is not absolute).  The absolute path cannot be DOS-style,\n\t # because $ac_f cannot contain `:'.\n\t test -f \"$ac_f\" ||\n\t   case $ac_f in\n\t   [\\\\/$]*) false;;\n\t   *) test -f \"$srcdir/$ac_f\" && ac_f=\"$srcdir/$ac_f\";;\n\t   esac ||\n\t   as_fn_error 1 \"cannot find input file: \\`$ac_f'\" \"$LINENO\" 5;;\n      esac\n      case $ac_f in *\\'*) ac_f=`$as_echo \"$ac_f\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;; esac\n      as_fn_append ac_file_inputs \" '$ac_f'\"\n    done\n\n    # Let's still pretend it is `configure' which instantiates (i.e., don't\n    # use $as_me), people would be surprised to read:\n    #    /* config.h.  Generated by config.status.  */\n    configure_input='Generated from '`\n\t  $as_echo \"$*\" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'\n\t`' by configure.'\n    if test x\"$ac_file\" != x-; then\n      configure_input=\"$ac_file.  $configure_input\"\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: creating $ac_file\" >&5\n$as_echo \"$as_me: creating $ac_file\" >&6;}\n    fi\n    # Neutralize special characters interpreted by sed in replacement strings.\n    case $configure_input in #(\n    *\\&* | *\\|* | *\\\\* )\n       ac_sed_conf_input=`$as_echo \"$configure_input\" |\n       sed 's/[\\\\\\\\&|]/\\\\\\\\&/g'`;; #(\n    *) ac_sed_conf_input=$configure_input;;\n    esac\n\n    case $ac_tag in\n    *:-:* | *:-) cat >\"$ac_tmp/stdin\" \\\n      || as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5 ;;\n    esac\n    ;;\n  esac\n\n  ac_dir=`$as_dirname -- \"$ac_file\" ||\n$as_expr X\"$ac_file\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$ac_file\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$ac_file\" : 'X\\(//\\)$' \\| \\\n\t X\"$ac_file\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X\"$ac_file\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n  as_dir=\"$ac_dir\"; as_fn_mkdir_p\n  ac_builddir=.\n\ncase \"$ac_dir\" in\n.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;\n*)\n  ac_dir_suffix=/`$as_echo \"$ac_dir\" | sed 's|^\\.[\\\\/]||'`\n  # A \"..\" for each directory in $ac_dir_suffix.\n  ac_top_builddir_sub=`$as_echo \"$ac_dir_suffix\" | sed 's|/[^\\\\/]*|/..|g;s|/||'`\n  case $ac_top_builddir_sub in\n  \"\") ac_top_builddir_sub=. ac_top_build_prefix= ;;\n  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;\n  esac ;;\nesac\nac_abs_top_builddir=$ac_pwd\nac_abs_builddir=$ac_pwd$ac_dir_suffix\n# for backward compatibility:\nac_top_builddir=$ac_top_build_prefix\n\ncase $srcdir in\n  .)  # We are building in place.\n    ac_srcdir=.\n    ac_top_srcdir=$ac_top_builddir_sub\n    ac_abs_top_srcdir=$ac_pwd ;;\n  [\\\\/]* | ?:[\\\\/]* )  # Absolute name.\n    ac_srcdir=$srcdir$ac_dir_suffix;\n    ac_top_srcdir=$srcdir\n    ac_abs_top_srcdir=$srcdir ;;\n  *) # Relative name.\n    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix\n    ac_top_srcdir=$ac_top_build_prefix$srcdir\n    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;\nesac\nac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix\n\n\n  case $ac_mode in\n  :F)\n  #\n  # CONFIG_FILE\n  #\n\n  case $INSTALL in\n  [\\\\/$]* | ?:[\\\\/]* ) ac_INSTALL=$INSTALL ;;\n  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;\n  esac\n  ac_MKDIR_P=$MKDIR_P\n  case $MKDIR_P in\n  [\\\\/$]* | ?:[\\\\/]* ) ;;\n  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;\n  esac\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n# If the template does not know about datarootdir, expand it.\n# FIXME: This hack should be removed a few years after 2.60.\nac_datarootdir_hack=; ac_datarootdir_seen=\nac_sed_dataroot='\n/datarootdir/ {\n  p\n  q\n}\n/@datadir@/p\n/@docdir@/p\n/@infodir@/p\n/@localedir@/p\n/@mandir@/p'\ncase `eval \"sed -n \\\"\\$ac_sed_dataroot\\\" $ac_file_inputs\"` in\n*datarootdir*) ac_datarootdir_seen=yes;;\n*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting\" >&5\n$as_echo \"$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting\" >&2;}\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n  ac_datarootdir_hack='\n  s&@datadir@&$datadir&g\n  s&@docdir@&$docdir&g\n  s&@infodir@&$infodir&g\n  s&@localedir@&$localedir&g\n  s&@mandir@&$mandir&g\n  s&\\\\\\${datarootdir}&$datarootdir&g' ;;\nesac\n_ACEOF\n\n# Neutralize VPATH when `$srcdir' = `.'.\n# Shell code in configure.ac might set extrasub.\n# FIXME: do we really want to maintain this feature?\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\nac_sed_extra=\"$ac_vpsub\n$extrasub\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n:t\n/@[a-zA-Z_][a-zA-Z_0-9]*@/!b\ns|@configure_input@|$ac_sed_conf_input|;t t\ns&@top_builddir@&$ac_top_builddir_sub&;t t\ns&@top_build_prefix@&$ac_top_build_prefix&;t t\ns&@srcdir@&$ac_srcdir&;t t\ns&@abs_srcdir@&$ac_abs_srcdir&;t t\ns&@top_srcdir@&$ac_top_srcdir&;t t\ns&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t\ns&@builddir@&$ac_builddir&;t t\ns&@abs_builddir@&$ac_abs_builddir&;t t\ns&@abs_top_builddir@&$ac_abs_top_builddir&;t t\ns&@INSTALL@&$ac_INSTALL&;t t\ns&@MKDIR_P@&$ac_MKDIR_P&;t t\n$ac_datarootdir_hack\n\"\neval sed \\\"\\$ac_sed_extra\\\" \"$ac_file_inputs\" | $AWK -f \"$ac_tmp/subs.awk\" \\\n  >$ac_tmp/out || as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5\n\ntest -z \"$ac_datarootdir_hack$ac_datarootdir_seen\" &&\n  { ac_out=`sed -n '/\\${datarootdir}/p' \"$ac_tmp/out\"`; test -n \"$ac_out\"; } &&\n  { ac_out=`sed -n '/^[\t ]*datarootdir[\t ]*:*=/p' \\\n      \"$ac_tmp/out\"`; test -z \"$ac_out\"; } &&\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \\`datarootdir'\nwhich seems to be undefined.  Please make sure it is defined\" >&5\n$as_echo \"$as_me: WARNING: $ac_file contains a reference to the variable \\`datarootdir'\nwhich seems to be undefined.  Please make sure it is defined\" >&2;}\n\n  rm -f \"$ac_tmp/stdin\"\n  case $ac_file in\n  -) cat \"$ac_tmp/out\" && rm -f \"$ac_tmp/out\";;\n  *) rm -f \"$ac_file\" && mv \"$ac_tmp/out\" \"$ac_file\";;\n  esac \\\n  || as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5\n ;;\n  :H)\n  #\n  # CONFIG_HEADER\n  #\n  if test x\"$ac_file\" != x-; then\n    {\n      $as_echo \"/* $configure_input  */\" \\\n      && eval '$AWK -f \"$ac_tmp/defines.awk\"' \"$ac_file_inputs\"\n    } >\"$ac_tmp/config.h\" \\\n      || as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5\n    if diff \"$ac_file\" \"$ac_tmp/config.h\" >/dev/null 2>&1; then\n      { $as_echo \"$as_me:${as_lineno-$LINENO}: $ac_file is unchanged\" >&5\n$as_echo \"$as_me: $ac_file is unchanged\" >&6;}\n    else\n      rm -f \"$ac_file\"\n      mv \"$ac_tmp/config.h\" \"$ac_file\" \\\n\t|| as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5\n    fi\n  else\n    $as_echo \"/* $configure_input  */\" \\\n      && eval '$AWK -f \"$ac_tmp/defines.awk\"' \"$ac_file_inputs\" \\\n      || as_fn_error $? \"could not create -\" \"$LINENO\" 5\n  fi\n# Compute \"$ac_file\"'s index in $config_headers.\n_am_arg=\"$ac_file\"\n_am_stamp_count=1\nfor _am_header in $config_headers :; do\n  case $_am_header in\n    $_am_arg | $_am_arg:* )\n      break ;;\n    * )\n      _am_stamp_count=`expr $_am_stamp_count + 1` ;;\n  esac\ndone\necho \"timestamp for $_am_arg\" >`$as_dirname -- \"$_am_arg\" ||\n$as_expr X\"$_am_arg\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$_am_arg\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$_am_arg\" : 'X\\(//\\)$' \\| \\\n\t X\"$_am_arg\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X\"$_am_arg\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`/stamp-h$_am_stamp_count\n ;;\n\n  :C)  { $as_echo \"$as_me:${as_lineno-$LINENO}: executing $ac_file commands\" >&5\n$as_echo \"$as_me: executing $ac_file commands\" >&6;}\n ;;\n  esac\n\n\n  case $ac_file$ac_mode in\n    \"depfiles\":C) test x\"$AMDEP_TRUE\" != x\"\" || {\n  # Older Autoconf quotes --file arguments for eval, but not when files\n  # are listed without --file.  Let's play safe and only enable the eval\n  # if we detect the quoting.\n  case $CONFIG_FILES in\n  *\\'*) eval set x \"$CONFIG_FILES\" ;;\n  *)   set x $CONFIG_FILES ;;\n  esac\n  shift\n  for mf\n  do\n    # Strip MF so we end up with the name of the file.\n    mf=`echo \"$mf\" | sed -e 's/:.*$//'`\n    # Check whether this is an Automake generated Makefile or not.\n    # We used to match only the files named 'Makefile.in', but\n    # some people rename them; so instead we look at the file content.\n    # Grep'ing the first line is not enough: some people post-process\n    # each Makefile.in and add a new line on top of each file to say so.\n    # Grep'ing the whole file is not good either: AIX grep has a line\n    # limit of 2048, but all sed's we know have understand at least 4000.\n    if sed -n 's,^#.*generated by automake.*,X,p' \"$mf\" | grep X >/dev/null 2>&1; then\n      dirpart=`$as_dirname -- \"$mf\" ||\n$as_expr X\"$mf\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$mf\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$mf\" : 'X\\(//\\)$' \\| \\\n\t X\"$mf\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X\"$mf\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n    else\n      continue\n    fi\n    # Extract the definition of DEPDIR, am__include, and am__quote\n    # from the Makefile without running 'make'.\n    DEPDIR=`sed -n 's/^DEPDIR = //p' < \"$mf\"`\n    test -z \"$DEPDIR\" && continue\n    am__include=`sed -n 's/^am__include = //p' < \"$mf\"`\n    test -z \"$am__include\" && continue\n    am__quote=`sed -n 's/^am__quote = //p' < \"$mf\"`\n    # Find all dependency output files, they are included files with\n    # $(DEPDIR) in their names.  We invoke sed twice because it is the\n    # simplest approach to changing $(DEPDIR) to its actual value in the\n    # expansion.\n    for file in `sed -n \"\n      s/^$am__include $am__quote\\(.*(DEPDIR).*\\)$am__quote\"'$/\\1/p' <\"$mf\" | \\\n\t sed -e 's/\\$(DEPDIR)/'\"$DEPDIR\"'/g'`; do\n      # Make sure the directory exists.\n      test -f \"$dirpart/$file\" && continue\n      fdir=`$as_dirname -- \"$file\" ||\n$as_expr X\"$file\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$file\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$file\" : 'X\\(//\\)$' \\| \\\n\t X\"$file\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n$as_echo X\"$file\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n      as_dir=$dirpart/$fdir; as_fn_mkdir_p\n      # echo \"creating $dirpart/$file\"\n      echo '# dummy' > \"$dirpart/$file\"\n    done\n  done\n}\n ;;\n    \"libtool\":C)\n\n    # See if we are running on zsh, and set the options that allow our\n    # commands through without removal of \\ escapes.\n    if test -n \"${ZSH_VERSION+set}\"; then\n      setopt NO_GLOB_SUBST\n    fi\n\n    cfgfile=${ofile}T\n    trap \"$RM \\\"$cfgfile\\\"; exit 1\" 1 2 15\n    $RM \"$cfgfile\"\n\n    cat <<_LT_EOF >> \"$cfgfile\"\n#! $SHELL\n# Generated automatically by $as_me ($PACKAGE) $VERSION\n# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:\n# NOTE: Changes made to this file will be lost: look at ltmain.sh.\n\n# Provide generalized library-building support services.\n# Written by Gordon Matzigkeit, 1996\n\n# Copyright (C) 2014 Free Software Foundation, Inc.\n# This is free software; see the source for copying conditions.  There is NO\n# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n# GNU Libtool is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of of the License, or\n# (at your option) any later version.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program or library that is built\n# using GNU Libtool, you may include this file under the  same\n# distribution terms that you use for the rest of that program.\n#\n# GNU Libtool is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n\n# The names of the tagged configurations supported by this script.\navailable_tags=''\n\n# Configured defaults for sys_lib_dlsearch_path munging.\n: \\${LT_SYS_LIBRARY_PATH=\"$configure_time_lt_sys_library_path\"}\n\n# ### BEGIN LIBTOOL CONFIG\n\n# Which release of libtool.m4 was used?\nmacro_version=$macro_version\nmacro_revision=$macro_revision\n\n# Whether or not to build shared libraries.\nbuild_libtool_libs=$enable_shared\n\n# Whether or not to build static libraries.\nbuild_old_libs=$enable_static\n\n# What type of objects to build.\npic_mode=$pic_mode\n\n# Whether or not to optimize for fast installation.\nfast_install=$enable_fast_install\n\n# Shared archive member basename,for filename based shared library versioning on AIX.\nshared_archive_member_spec=$shared_archive_member_spec\n\n# Shell to use when invoking shell scripts.\nSHELL=$lt_SHELL\n\n# An echo program that protects backslashes.\nECHO=$lt_ECHO\n\n# The PATH separator for the build system.\nPATH_SEPARATOR=$lt_PATH_SEPARATOR\n\n# The host system.\nhost_alias=$host_alias\nhost=$host\nhost_os=$host_os\n\n# The build system.\nbuild_alias=$build_alias\nbuild=$build\nbuild_os=$build_os\n\n# A sed program that does not truncate output.\nSED=$lt_SED\n\n# Sed that helps us avoid accidentally triggering echo(1) options like -n.\nXsed=\"\\$SED -e 1s/^X//\"\n\n# A grep program that handles long lines.\nGREP=$lt_GREP\n\n# An ERE matcher.\nEGREP=$lt_EGREP\n\n# A literal string matcher.\nFGREP=$lt_FGREP\n\n# A BSD- or MS-compatible name lister.\nNM=$lt_NM\n\n# Whether we need soft or hard links.\nLN_S=$lt_LN_S\n\n# What is the maximum length of a command?\nmax_cmd_len=$max_cmd_len\n\n# Object file suffix (normally \"o\").\nobjext=$ac_objext\n\n# Executable file suffix (normally \"\").\nexeext=$exeext\n\n# whether the shell understands \"unset\".\nlt_unset=$lt_unset\n\n# turn spaces into newlines.\nSP2NL=$lt_lt_SP2NL\n\n# turn newlines into spaces.\nNL2SP=$lt_lt_NL2SP\n\n# convert \\$build file names to \\$host format.\nto_host_file_cmd=$lt_cv_to_host_file_cmd\n\n# convert \\$build files to toolchain format.\nto_tool_file_cmd=$lt_cv_to_tool_file_cmd\n\n# An object symbol dumper.\nOBJDUMP=$lt_OBJDUMP\n\n# Method to check whether dependent libraries are shared objects.\ndeplibs_check_method=$lt_deplibs_check_method\n\n# Command to use when deplibs_check_method = \"file_magic\".\nfile_magic_cmd=$lt_file_magic_cmd\n\n# How to find potential files when deplibs_check_method = \"file_magic\".\nfile_magic_glob=$lt_file_magic_glob\n\n# Find potential files using nocaseglob when deplibs_check_method = \"file_magic\".\nwant_nocaseglob=$lt_want_nocaseglob\n\n# DLL creation program.\nDLLTOOL=$lt_DLLTOOL\n\n# Command to associate shared and link libraries.\nsharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd\n\n# The archiver.\nAR=$lt_AR\n\n# Flags to create an archive.\nAR_FLAGS=$lt_AR_FLAGS\n\n# How to feed a file listing to the archiver.\narchiver_list_spec=$lt_archiver_list_spec\n\n# A symbol stripping program.\nSTRIP=$lt_STRIP\n\n# Commands used to install an old-style archive.\nRANLIB=$lt_RANLIB\nold_postinstall_cmds=$lt_old_postinstall_cmds\nold_postuninstall_cmds=$lt_old_postuninstall_cmds\n\n# Whether to use a lock for old archive extraction.\nlock_old_archive_extraction=$lock_old_archive_extraction\n\n# A C compiler.\nLTCC=$lt_CC\n\n# LTCC compiler flags.\nLTCFLAGS=$lt_CFLAGS\n\n# Take the output of nm and produce a listing of raw symbols and C names.\nglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe\n\n# Transform the output of nm in a proper C declaration.\nglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl\n\n# Transform the output of nm into a list of symbols to manually relocate.\nglobal_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import\n\n# Transform the output of nm in a C name address pair.\nglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address\n\n# Transform the output of nm in a C name address pair when lib prefix is needed.\nglobal_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix\n\n# The name lister interface.\nnm_interface=$lt_lt_cv_nm_interface\n\n# Specify filename containing input files for \\$NM.\nnm_file_list_spec=$lt_nm_file_list_spec\n\n# The root where to search for dependent libraries,and where our libraries should be installed.\nlt_sysroot=$lt_sysroot\n\n# Command to truncate a binary pipe.\nlt_truncate_bin=$lt_lt_cv_truncate_bin\n\n# The name of the directory that contains temporary libtool files.\nobjdir=$objdir\n\n# Used to examine libraries when file_magic_cmd begins with \"file\".\nMAGIC_CMD=$MAGIC_CMD\n\n# Must we lock files when doing compilation?\nneed_locks=$lt_need_locks\n\n# Manifest tool.\nMANIFEST_TOOL=$lt_MANIFEST_TOOL\n\n# Tool to manipulate archived DWARF debug symbol files on Mac OS X.\nDSYMUTIL=$lt_DSYMUTIL\n\n# Tool to change global to local symbols on Mac OS X.\nNMEDIT=$lt_NMEDIT\n\n# Tool to manipulate fat objects and archives on Mac OS X.\nLIPO=$lt_LIPO\n\n# ldd/readelf like tool for Mach-O binaries on Mac OS X.\nOTOOL=$lt_OTOOL\n\n# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.\nOTOOL64=$lt_OTOOL64\n\n# Old archive suffix (normally \"a\").\nlibext=$libext\n\n# Shared library suffix (normally \".so\").\nshrext_cmds=$lt_shrext_cmds\n\n# The commands to extract the exported symbol list from a shared archive.\nextract_expsyms_cmds=$lt_extract_expsyms_cmds\n\n# Variables whose values should be saved in libtool wrapper scripts and\n# restored at link time.\nvariables_saved_for_relink=$lt_variables_saved_for_relink\n\n# Do we need the \"lib\" prefix for modules?\nneed_lib_prefix=$need_lib_prefix\n\n# Do we need a version for libraries?\nneed_version=$need_version\n\n# Library versioning type.\nversion_type=$version_type\n\n# Shared library runtime path variable.\nrunpath_var=$runpath_var\n\n# Shared library path variable.\nshlibpath_var=$shlibpath_var\n\n# Is shlibpath searched before the hard-coded library search path?\nshlibpath_overrides_runpath=$shlibpath_overrides_runpath\n\n# Format of library name prefix.\nlibname_spec=$lt_libname_spec\n\n# List of archive names.  First name is the real one, the rest are links.\n# The last name is the one that the linker finds with -lNAME\nlibrary_names_spec=$lt_library_names_spec\n\n# The coded name of the library, if different from the real name.\nsoname_spec=$lt_soname_spec\n\n# Permission mode override for installation of shared libraries.\ninstall_override_mode=$lt_install_override_mode\n\n# Command to use after installation of a shared archive.\npostinstall_cmds=$lt_postinstall_cmds\n\n# Command to use after uninstallation of a shared archive.\npostuninstall_cmds=$lt_postuninstall_cmds\n\n# Commands used to finish a libtool library installation in a directory.\nfinish_cmds=$lt_finish_cmds\n\n# As \"finish_cmds\", except a single script fragment to be evaled but\n# not shown.\nfinish_eval=$lt_finish_eval\n\n# Whether we should hardcode library paths into libraries.\nhardcode_into_libs=$hardcode_into_libs\n\n# Compile-time system search path for libraries.\nsys_lib_search_path_spec=$lt_sys_lib_search_path_spec\n\n# Detected run-time system search path for libraries.\nsys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path\n\n# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.\nconfigure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path\n\n# Whether dlopen is supported.\ndlopen_support=$enable_dlopen\n\n# Whether dlopen of programs is supported.\ndlopen_self=$enable_dlopen_self\n\n# Whether dlopen of statically linked programs is supported.\ndlopen_self_static=$enable_dlopen_self_static\n\n# Commands to strip libraries.\nold_striplib=$lt_old_striplib\nstriplib=$lt_striplib\n\n\n# The linker used to build libraries.\nLD=$lt_LD\n\n# How to create reloadable object files.\nreload_flag=$lt_reload_flag\nreload_cmds=$lt_reload_cmds\n\n# Commands used to build an old-style archive.\nold_archive_cmds=$lt_old_archive_cmds\n\n# A language specific compiler.\nCC=$lt_compiler\n\n# Is the compiler the GNU compiler?\nwith_gcc=$GCC\n\n# Compiler flag to turn off builtin functions.\nno_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag\n\n# Additional compiler flags for building library objects.\npic_flag=$lt_lt_prog_compiler_pic\n\n# How to pass a linker flag through the compiler.\nwl=$lt_lt_prog_compiler_wl\n\n# Compiler flag to prevent dynamic linking.\nlink_static_flag=$lt_lt_prog_compiler_static\n\n# Does compiler simultaneously support -c and -o options?\ncompiler_c_o=$lt_lt_cv_prog_compiler_c_o\n\n# Whether or not to add -lc for building shared libraries.\nbuild_libtool_need_lc=$archive_cmds_need_lc\n\n# Whether or not to disallow shared libs when runtime libs are static.\nallow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes\n\n# Compiler flag to allow reflexive dlopens.\nexport_dynamic_flag_spec=$lt_export_dynamic_flag_spec\n\n# Compiler flag to generate shared objects directly from archives.\nwhole_archive_flag_spec=$lt_whole_archive_flag_spec\n\n# Whether the compiler copes with passing no objects directly.\ncompiler_needs_object=$lt_compiler_needs_object\n\n# Create an old-style archive from a shared archive.\nold_archive_from_new_cmds=$lt_old_archive_from_new_cmds\n\n# Create a temporary old-style archive to link instead of a shared archive.\nold_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds\n\n# Commands used to build a shared archive.\narchive_cmds=$lt_archive_cmds\narchive_expsym_cmds=$lt_archive_expsym_cmds\n\n# Commands used to build a loadable module if different from building\n# a shared archive.\nmodule_cmds=$lt_module_cmds\nmodule_expsym_cmds=$lt_module_expsym_cmds\n\n# Whether we are building with GNU ld or not.\nwith_gnu_ld=$lt_with_gnu_ld\n\n# Flag that allows shared libraries with undefined symbols to be built.\nallow_undefined_flag=$lt_allow_undefined_flag\n\n# Flag that enforces no undefined symbols.\nno_undefined_flag=$lt_no_undefined_flag\n\n# Flag to hardcode \\$libdir into a binary during linking.\n# This must work even if \\$libdir does not exist\nhardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec\n\n# Whether we need a single \"-rpath\" flag with a separated argument.\nhardcode_libdir_separator=$lt_hardcode_libdir_separator\n\n# Set to \"yes\" if using DIR/libNAME\\$shared_ext during linking hardcodes\n# DIR into the resulting binary.\nhardcode_direct=$hardcode_direct\n\n# Set to \"yes\" if using DIR/libNAME\\$shared_ext during linking hardcodes\n# DIR into the resulting binary and the resulting library dependency is\n# \"absolute\",i.e impossible to change by setting \\$shlibpath_var if the\n# library is relocated.\nhardcode_direct_absolute=$hardcode_direct_absolute\n\n# Set to \"yes\" if using the -LDIR flag during linking hardcodes DIR\n# into the resulting binary.\nhardcode_minus_L=$hardcode_minus_L\n\n# Set to \"yes\" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR\n# into the resulting binary.\nhardcode_shlibpath_var=$hardcode_shlibpath_var\n\n# Set to \"yes\" if building a shared library automatically hardcodes DIR\n# into the library and all subsequent libraries and executables linked\n# against it.\nhardcode_automatic=$hardcode_automatic\n\n# Set to yes if linker adds runtime paths of dependent libraries\n# to runtime path list.\ninherit_rpath=$inherit_rpath\n\n# Whether libtool must link a program against all its dependency libraries.\nlink_all_deplibs=$link_all_deplibs\n\n# Set to \"yes\" if exported symbols are required.\nalways_export_symbols=$always_export_symbols\n\n# The commands to list exported symbols.\nexport_symbols_cmds=$lt_export_symbols_cmds\n\n# Symbols that should not be listed in the preloaded symbols.\nexclude_expsyms=$lt_exclude_expsyms\n\n# Symbols that must always be exported.\ninclude_expsyms=$lt_include_expsyms\n\n# Commands necessary for linking programs (against libraries) with templates.\nprelink_cmds=$lt_prelink_cmds\n\n# Commands necessary for finishing linking programs.\npostlink_cmds=$lt_postlink_cmds\n\n# Specify filename containing input files.\nfile_list_spec=$lt_file_list_spec\n\n# How to hardcode a shared library path into an executable.\nhardcode_action=$hardcode_action\n\n# ### END LIBTOOL CONFIG\n\n_LT_EOF\n\n    cat <<'_LT_EOF' >> \"$cfgfile\"\n\n# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE\n\n# func_munge_path_list VARIABLE PATH\n# -----------------------------------\n# VARIABLE is name of variable containing _space_ separated list of\n# directories to be munged by the contents of PATH, which is string\n# having a format:\n# \"DIR[:DIR]:\"\n#       string \"DIR[ DIR]\" will be prepended to VARIABLE\n# \":DIR[:DIR]\"\n#       string \"DIR[ DIR]\" will be appended to VARIABLE\n# \"DIRP[:DIRP]::[DIRA:]DIRA\"\n#       string \"DIRP[ DIRP]\" will be prepended to VARIABLE and string\n#       \"DIRA[ DIRA]\" will be appended to VARIABLE\n# \"DIR[:DIR]\"\n#       VARIABLE will be replaced by \"DIR[ DIR]\"\nfunc_munge_path_list ()\n{\n    case x$2 in\n    x)\n        ;;\n    *:)\n        eval $1=\\\"`$ECHO $2 | $SED 's/:/ /g'` \\$$1\\\"\n        ;;\n    x:*)\n        eval $1=\\\"\\$$1 `$ECHO $2 | $SED 's/:/ /g'`\\\"\n        ;;\n    *::*)\n        eval $1=\\\"\\$$1\\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\\\"\n        eval $1=\\\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\\ \\$$1\\\"\n        ;;\n    *)\n        eval $1=\\\"`$ECHO $2 | $SED 's/:/ /g'`\\\"\n        ;;\n    esac\n}\n\n\n# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.\nfunc_cc_basename ()\n{\n    for cc_temp in $*\"\"; do\n      case $cc_temp in\n        compile | *[\\\\/]compile | ccache | *[\\\\/]ccache ) ;;\n        distcc | *[\\\\/]distcc | purify | *[\\\\/]purify ) ;;\n        \\-*) ;;\n        *) break;;\n      esac\n    done\n    func_cc_basename_result=`$ECHO \"$cc_temp\" | $SED \"s%.*/%%; s%^$host_alias-%%\"`\n}\n\n\n# ### END FUNCTIONS SHARED WITH CONFIGURE\n\n_LT_EOF\n\n  case $host_os in\n  aix3*)\n    cat <<\\_LT_EOF >> \"$cfgfile\"\n# AIX sometimes has problems with the GCC collect2 program.  For some\n# reason, if we set the COLLECT_NAMES environment variable, the problems\n# vanish in a puff of smoke.\nif test set != \"${COLLECT_NAMES+set}\"; then\n  COLLECT_NAMES=\n  export COLLECT_NAMES\nfi\n_LT_EOF\n    ;;\n  esac\n\n\nltmain=$ac_aux_dir/ltmain.sh\n\n\n  # We use sed instead of cat because bash on DJGPP gets confused if\n  # if finds mixed CR/LF and LF-only lines.  Since sed operates in\n  # text mode, it properly converts lines to CR/LF.  This bash problem\n  # is reportedly fixed, but why not run on old versions too?\n  sed '$q' \"$ltmain\" >> \"$cfgfile\" \\\n     || (rm -f \"$cfgfile\"; exit 1)\n\n   mv -f \"$cfgfile\" \"$ofile\" ||\n    (rm -f \"$ofile\" && cp \"$cfgfile\" \"$ofile\" && rm -f \"$cfgfile\")\n  chmod +x \"$ofile\"\n\n ;;\n\n  esac\ndone # for ac_tag\n\n\nas_fn_exit 0\n_ACEOF\nac_clean_files=$ac_clean_files_save\n\ntest $ac_write_fail = 0 ||\n  as_fn_error $? \"write failure creating $CONFIG_STATUS\" \"$LINENO\" 5\n\n\n# configure is writing to config.log, and then calls config.status.\n# config.status does its own redirection, appending to config.log.\n# Unfortunately, on DOS this fails, as config.log is still kept open\n# by configure, so config.status won't be able to write to it; its\n# output is simply discarded.  So we exec the FD to /dev/null,\n# effectively closing config.log, so it can be properly (re)opened and\n# appended to by config.status.  When coming back to configure, we\n# need to make the FD available again.\nif test \"$no_create\" != yes; then\n  ac_cs_success=:\n  ac_config_status_args=\n  test \"$silent\" = yes &&\n    ac_config_status_args=\"$ac_config_status_args --quiet\"\n  exec 5>/dev/null\n  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false\n  exec 5>>config.log\n  # Use ||, not &&, to avoid exiting from the if with $? = 1, which\n  # would make configure fail if this is the last instruction.\n  $ac_cs_success || as_fn_exit 1\nfi\nif test -n \"$ac_unrecognized_opts\" && test \"$enable_option_checking\" != no; then\n  { $as_echo \"$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts\" >&5\n$as_echo \"$as_me: WARNING: unrecognized options: $ac_unrecognized_opts\" >&2;}\nfi\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/configure.ac",
    "content": "#                                               -*- Autoconf -*-\n# Process this file with autoconf to produce a configure script.\n\nAC_PREREQ([2.56])\nAC_INIT([libjpeg-turbo], [1.5.0])\n\nAM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])\nAC_PREFIX_DEFAULT(/opt/libjpeg-turbo)\n\nm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])\n\n# Checks for programs.\nSAVED_CFLAGS=${CFLAGS}\nSAVED_CPPFLAGS=${CPPFLAGS}\nAC_PROG_CPP\nAC_PROG_CC\nm4_ifdef([AM_PROG_AR], [AM_PROG_AR])\nAM_PROG_AS\nAM_PROG_CC_C_O\nAC_PROG_INSTALL\nAC_PROG_LIBTOOL\nAC_PROG_LN_S\n\nAC_ARG_WITH([build-date], [Use custom build string to enable reproducible builds (default: YYMMDD)],\n  [BUILD=\"$with_build_date\"],\n  [BUILD=`date +%Y%m%d`])\n\nPKG_PROG_PKG_CONFIG\n\n# When the prefix is /opt/libjpeg-turbo, we assume that an \"official\" binary is\n# being created, and thus we install things into specific locations.\n\nold_prefix=${prefix}\nif test \"x$prefix\" = \"xNONE\" -a \"x$ac_default_prefix\" != \"x\"; then\n  prefix=$ac_default_prefix\nfi\nDATADIR=`eval echo ${datadir}`\nDATADIR=`eval echo $DATADIR`\nif test \"$DATADIR\" = \"/opt/libjpeg-turbo/share\"; then\n  datadir='${prefix}'\nfi\nDATADIR=`eval echo ${datarootdir}`\nDATADIR=`eval echo $DATADIR`\nif test \"$DATADIR\" = \"/opt/libjpeg-turbo/share\"; then\n  datarootdir='${prefix}'\nfi\nDOCDIR=`eval echo ${docdir}`\nDOCDIR=`eval echo $DOCDIR`\nif test \"$DOCDIR\" = \"/opt/libjpeg-turbo/doc/libjpeg-turbo\"; then\n  docdir='${datadir}/doc'\nfi\n\nold_exec_prefix=${exec_prefix}\nif test \"x$exec_prefix\" = \"xNONE\"; then\n  exec_prefix=${prefix}\nfi\n\nAC_CHECK_SIZEOF(size_t)\n\nif test \"x${libdir}\" = 'x${exec_prefix}/lib' -o \"x${libdir}\" = 'x${prefix}/lib'; then\n  LIBDIR=`eval echo ${libdir}`\n  LIBDIR=`eval echo $LIBDIR`\n  if test \"$LIBDIR\" = \"/opt/libjpeg-turbo/lib\"; then\n    case $host_os in\n      darwin*)\n        ;;\n      *)\n        if test \"${ac_cv_sizeof_size_t}\" = \"8\"; then\n          libdir='${exec_prefix}/lib64'\n        elif test \"${ac_cv_sizeof_size_t}\" = \"4\"; then\n          libdir='${exec_prefix}/lib32'\n        fi\n        ;;\n    esac\n  fi\nfi\nexec_prefix=${old_exec_prefix}\nprefix=${old_prefix}\n\n# Check whether compiler supports pointers to undefined structures\nAC_MSG_CHECKING(whether compiler supports pointers to undefined structures)\nAC_TRY_COMPILE([ typedef struct undefined_structure *undef_struct_ptr; ], ,\n  AC_MSG_RESULT(yes),\n  [AC_MSG_RESULT(no)\n   AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1],\n     [Compiler does not support pointers to undefined structures.])])\n\nif test \"x${GCC}\" = \"xyes\"; then\n  if test \"x${SAVED_CFLAGS}\" = \"x\"; then\n    CFLAGS=-O3\n  fi\n  if test \"x${SAVED_CPPFLAGS}\" = \"x\"; then\n    CPPFLAGS=-Wall\n  fi\nfi\n\nAC_CHECK_DECL([__SUNPRO_C], [SUNCC=\"yes\"], [SUNCC=\"no\"])\nif test \"x${SUNCC}\" = \"xyes\"; then\n  if test \"x${SAVED_CFLAGS}\" = \"x\"; then\n    CFLAGS=-xO5\n  fi\nfi\n\n# Checks for libraries.\n\n# Checks for header files.\nAC_HEADER_STDC\nAC_CHECK_HEADERS([stddef.h stdlib.h locale.h string.h])\nAC_CHECK_HEADER([sys/types.h],\n  AC_DEFINE([NEED_SYS_TYPES_H], 1, [Define if you need to include <sys/types.h> to get size_t.]))\n\n# Checks for typedefs, structures, and compiler characteristics.\nAC_C_CONST\nAC_C_CHAR_UNSIGNED\nAC_C_INLINE\nAC_TYPE_SIZE_T\nAC_CHECK_TYPES([unsigned char, unsigned short])\n\nAC_MSG_CHECKING([if right shift is signed])\nAC_TRY_RUN(\n  [#include <stdio.h>\n   int is_shifting_signed (long arg) {\n     long res = arg >> 4;\n\n     if (res == -0x7F7E80CL)\n       return 1; /* right shift is signed */\n\n     /* see if unsigned-shift hack will fix it. */\n     /* we can't just test exact value since it depends on width of long... */\n     res |= (~0L) << (32-4);\n     if (res == -0x7F7E80CL)\n       return 0; /* right shift is unsigned */\n\n     printf(\"Right shift isn't acting as I expect it to.\\n\");\n     printf(\"I fear the JPEG software will not work at all.\\n\\n\");\n     return 0; /* try it with unsigned anyway */\n   }\n   int main (void) {\n     exit(is_shifting_signed(-0x7F7E80B1L));\n   }],\n  [AC_MSG_RESULT(no)\n   AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], 1,\n     [Define if your (broken) compiler shifts signed values as if they were unsigned.])],\n  [AC_MSG_RESULT(yes)],\n  [AC_MSG_RESULT(Assuming that right shift is signed on target machine.)])\n\n# Checks for library functions.\nAC_CHECK_FUNCS([memset memcpy], [],\n  [AC_DEFINE([NEED_BSD_STRINGS], 1,\n     [Define if you have BSD-like bzero and bcopy in <strings.h> rather than memset/memcpy in <string.h>.])])\n\nAC_MSG_CHECKING([libjpeg API version])\nAC_ARG_VAR(JPEG_LIB_VERSION, [libjpeg API version (62, 70, or 80)])\nif test \"x$JPEG_LIB_VERSION\" = \"x\"; then\n  AC_ARG_WITH([jpeg7],\n    AC_HELP_STRING([--with-jpeg7],\n      [Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b.)]))\n  AC_ARG_WITH([jpeg8],\n    AC_HELP_STRING([--with-jpeg8],\n      [Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b.)]))\n  if test \"x${with_jpeg8}\" = \"xyes\"; then\n    JPEG_LIB_VERSION=80\n  else\n    if test \"x${with_jpeg7}\" = \"xyes\"; then\n      JPEG_LIB_VERSION=70\n    else\n      JPEG_LIB_VERSION=62\n    fi\n  fi\nfi\nJPEG_LIB_VERSION_DECIMAL=`expr $JPEG_LIB_VERSION / 10`.`expr $JPEG_LIB_VERSION % 10`\nAC_SUBST(JPEG_LIB_VERSION_DECIMAL)\nAC_MSG_RESULT([$JPEG_LIB_VERSION_DECIMAL])\nAC_DEFINE_UNQUOTED(JPEG_LIB_VERSION, [$JPEG_LIB_VERSION],\n  [libjpeg API version])\n\nAC_ARG_VAR(SO_MAJOR_VERSION,\n  [Major version of the libjpeg-turbo shared library (default is determined by the API version)])\nAC_ARG_VAR(SO_MINOR_VERSION,\n  [Minor version of the libjpeg-turbo shared library (default is determined by the API version)])\nif test \"x$SO_MAJOR_VERSION\" = \"x\"; then\n  case \"$JPEG_LIB_VERSION\" in\n    62)  SO_MAJOR_VERSION=$JPEG_LIB_VERSION ;;\n    *)   SO_MAJOR_VERSION=`expr $JPEG_LIB_VERSION / 10` ;;\n  esac\nfi\nif test \"x$SO_MINOR_VERSION\" = \"x\"; then\n  case \"$JPEG_LIB_VERSION\" in\n    80)  SO_MINOR_VERSION=2 ;;\n    *)   SO_MINOR_VERSION=0 ;;\n  esac\nfi\n\nRPM_CONFIG_ARGS=\n\n# Memory source/destination managers\nSO_AGE=1\nMEM_SRCDST_FUNCTIONS=\nif test \"x${with_jpeg8}\" != \"xyes\"; then\n  AC_MSG_CHECKING([whether to include in-memory source/destination managers])\n  AC_ARG_WITH([mem-srcdst],\n    AC_HELP_STRING([--without-mem-srcdst],\n      [Do not include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI]))\n  if test \"x$with_mem_srcdst\" != \"xno\"; then\n    AC_MSG_RESULT(yes)\n    AC_DEFINE([MEM_SRCDST_SUPPORTED], [1],\n      [Support in-memory source/destination managers])\n    SO_AGE=2\n    MEM_SRCDST_FUNCTIONS=\"global:  jpeg_mem_dest;  jpeg_mem_src;\";\n  else\n    AC_MSG_RESULT(no)\n    RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-mem-srcdst\"\n  fi\nfi\n\nAC_MSG_CHECKING([libjpeg shared library version])\nAC_MSG_RESULT([$SO_MAJOR_VERSION.$SO_AGE.$SO_MINOR_VERSION])\nLIBTOOL_CURRENT=`expr $SO_MAJOR_VERSION + $SO_AGE`\nAC_SUBST(LIBTOOL_CURRENT)\nAC_SUBST(SO_MAJOR_VERSION)\nAC_SUBST(SO_MINOR_VERSION)\nAC_SUBST(SO_AGE)\nAC_SUBST(MEM_SRCDST_FUNCTIONS)\n\nAC_DEFINE_UNQUOTED(LIBJPEG_TURBO_VERSION, [$VERSION], [libjpeg-turbo version])\n\nm4_define(version_triplet,m4_split(AC_PACKAGE_VERSION,[[.]]))\nm4_define(version_major,m4_argn(1,version_triplet))\nm4_define(version_minor,m4_argn(2,version_triplet))\nm4_define(version_revision,m4_argn(3,version_triplet))\nVERSION_MAJOR=version_major\nVERSION_MINOR=version_minor\nVERSION_REVISION=version_revision\nLIBJPEG_TURBO_VERSION_NUMBER=`printf \"%d%03d%03d\" $VERSION_MAJOR $VERSION_MINOR $VERSION_REVISION`\nAC_DEFINE_UNQUOTED(LIBJPEG_TURBO_VERSION_NUMBER, [$LIBJPEG_TURBO_VERSION_NUMBER], [libjpeg-turbo version in integer form])\n\nVERSION_SCRIPT=yes\nAC_ARG_ENABLE([ld-version-script],\n  AS_HELP_STRING([--disable-ld-version-script],\n    [Disable linker version script for libjpeg-turbo (default is to use linker version script if the linker supports it)]),\n  [VERSION_SCRIPT=$enableval], [])\n\nAC_MSG_CHECKING([whether the linker supports version scripts])\nSAVED_LDFLAGS=\"$LDFLAGS\"\nLDFLAGS=\"$LDFLAGS -Wl,--version-script,conftest.map\"\ncat > conftest.map <<EOF\nVERS_1 {\n  global: *;\n};\nEOF\nAC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],\n  [VERSION_SCRIPT_FLAG=-Wl,--version-script,;\n   AC_MSG_RESULT([yes (GNU style)])],\n  [])\nif test \"x$VERSION_SCRIPT_FLAG\" = \"x\"; then\n  LDFLAGS=\"$SAVED_LDFLAGS -Wl,-M,conftest.map\"\n  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],\n    [VERSION_SCRIPT_FLAG=-Wl,-M,;\n     AC_MSG_RESULT([yes (Sun style)])],\n    [])\nfi\nif test \"x$VERSION_SCRIPT_FLAG\" = \"x\"; then\n  VERSION_SCRIPT=no\n  AC_MSG_RESULT(no)\nfi\nLDFLAGS=\"$SAVED_LDFLAGS\"\n\nAC_MSG_CHECKING([whether to use version script when building libjpeg-turbo])\nAC_MSG_RESULT($VERSION_SCRIPT)\n\nAM_CONDITIONAL(VERSION_SCRIPT, test \"x$VERSION_SCRIPT\" = \"xyes\")\nAC_SUBST(VERSION_SCRIPT_FLAG)\n\n# Check for non-broken inline under various spellings\nAC_MSG_CHECKING(for inline)\nljt_cv_inline=\"\"\nAC_TRY_COMPILE(, [} inline __attribute__((always_inline)) int foo() { return 0; }\nint bar() { return foo();], ljt_cv_inline=\"inline __attribute__((always_inline))\",\nAC_TRY_COMPILE(, [} __inline__ int foo() { return 0; }\nint bar() { return foo();], ljt_cv_inline=\"__inline__\",\nAC_TRY_COMPILE(, [} __inline int foo() { return 0; }\nint bar() { return foo();], ljt_cv_inline=\"__inline\",\nAC_TRY_COMPILE(, [} inline int foo() { return 0; }\nint bar() { return foo();], ljt_cv_inline=\"inline\"))))\nAC_MSG_RESULT($ljt_cv_inline)\nAC_DEFINE_UNQUOTED([INLINE],[$ljt_cv_inline],[How to obtain function inlining.])\n\n# Arithmetic coding support\nAC_MSG_CHECKING([whether to include arithmetic encoding support])\nAC_ARG_WITH([arith-enc],\n  AC_HELP_STRING([--without-arith-enc],\n    [Do not include arithmetic encoding support when emulating the libjpeg v6b API/ABI]))\nif test \"x$with_12bit\" = \"xyes\"; then\n  with_arith_enc=no\nfi\nif test \"x${with_jpeg8}\" = \"xyes\" -o \"x${with_jpeg7}\" = \"xyes\"; then\n  with_arith_enc=yes\nfi\nif test \"x$with_arith_enc\" = \"xno\"; then\n  AC_MSG_RESULT(no)\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-arith-enc\"\nelse\n  AC_DEFINE([C_ARITH_CODING_SUPPORTED], [1], [Support arithmetic encoding])\n  AC_MSG_RESULT(yes)\nfi\nAM_CONDITIONAL([WITH_ARITH_ENC], [test \"x$with_arith_enc\" != \"xno\"])\n\nAC_MSG_CHECKING([whether to include arithmetic decoding support])\nAC_ARG_WITH([arith-dec],\n  AC_HELP_STRING([--without-arith-dec],\n    [Do not include arithmetic decoding support when emulating the libjpeg v6b API/ABI]))\nif test \"x$with_12bit\" = \"xyes\"; then\n  with_arith_dec=no\nfi\nif test \"x${with_jpeg8}\" = \"xyes\" -o \"x${with_jpeg7}\" = \"xyes\"; then\n  with_arith_dec=yes\nfi\nif test \"x$with_arith_dec\" = \"xno\"; then\n  AC_MSG_RESULT(no)\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-arith-dec\"\nelse\n  AC_DEFINE([D_ARITH_CODING_SUPPORTED], [1], [Support arithmetic decoding])\n  AC_MSG_RESULT(yes)\nfi\nAM_CONDITIONAL([WITH_ARITH_DEC], [test \"x$with_arith_dec\" != \"xno\"])\n\nAM_CONDITIONAL([WITH_ARITH],\n  [test \"x$with_arith_dec\" != \"xno\" -o \"x$with_arith_enc\" != \"xno\"])\n\n# 12-bit component support\nAC_MSG_CHECKING([whether to use 12-bit samples])\nAC_ARG_WITH([12bit],\n  AC_HELP_STRING([--with-12bit], [Encode/decode JPEG images with 12-bit samples (implies --without-simd --without-turbojpeg --without-arith-dec --without-arith-enc)]))\nif test \"x$with_12bit\" = \"xyes\"; then\n  AC_DEFINE([BITS_IN_JSAMPLE], [12], [use 8 or 12])\n  AC_MSG_RESULT(yes)\nelse\n  AC_MSG_RESULT(no)\nfi\nAM_CONDITIONAL([WITH_12BIT], [test \"x$with_12bit\" = \"xyes\"])\n\n# TurboJPEG support\nAC_MSG_CHECKING([whether to build TurboJPEG C wrapper])\nAC_ARG_WITH([turbojpeg],\n  AC_HELP_STRING([--without-turbojpeg],\n    [Do not include the TurboJPEG wrapper library and associated test programs]))\nif test \"x$with_12bit\" = \"xyes\"; then\n  with_turbojpeg=no\nfi\nif test \"x$with_turbojpeg\" = \"xno\"; then\n  AC_MSG_RESULT(no)\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-turbojpeg\"\nelse\n  AC_MSG_RESULT(yes)\nfi\n\n# Java support\nAC_ARG_VAR(JAVAC, [Java compiler command (default: javac)])\nif test \"x$JAVAC\" = \"x\"; then\n  JAVAC=javac\nfi\nAC_SUBST(JAVAC)\nAC_ARG_VAR(JAVACFLAGS, [Java compiler flags])\nAC_SUBST(JAVACFLAGS)\nAC_ARG_VAR(JAR, [Java archive command (default: jar)])\nif test \"x$JAR\" = \"x\"; then\n  JAR=jar\nfi\nAC_SUBST(JAR)\nAC_ARG_VAR(JAVA, [Java runtime command (default: java)])\nif test \"x$JAVA\" = \"x\"; then\n  JAVA=java\nfi\nAC_SUBST(JAVA)\nAC_ARG_VAR(JNI_CFLAGS,\n  [C compiler flags needed to include jni.h (default: -I/System/Library/Frameworks/JavaVM.framework/Headers on OS X, '-I/usr/java/include -I/usr/java/include/solaris' on Solaris, and '-I/usr/java/default/include -I/usr/java/default/include/linux' on Linux)])\n\nAC_MSG_CHECKING([whether to build TurboJPEG Java wrapper])\nAC_ARG_WITH([java],\n  AC_HELP_STRING([--with-java], [Build Java wrapper for the TurboJPEG library]))\nif test \"x$with_12bit\" = \"xyes\" -o \"x$with_turbojpeg\" = \"xno\"; then\n  with_java=no\nfi\n\nWITH_JAVA=0\nif test \"x$with_java\" = \"xyes\"; then\n  AC_MSG_RESULT(yes)\n\n  case $host_os in\n    darwin*)\n      DEFAULT_JNI_CFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers\n      ;;\n    solaris*)\n      DEFAULT_JNI_CFLAGS='-I/usr/java/include -I/usr/java/include/solaris'\n      ;;\n    linux*)\n      DEFAULT_JNI_CFLAGS='-I/usr/java/default/include -I/usr/java/default/include/linux'\n      ;;\n  esac\n  if test \"x$JNI_CFLAGS\" = \"x\"; then\n    JNI_CFLAGS=$DEFAULT_JNI_CFLAGS\n  fi\n\n  SAVE_CPPFLAGS=${CPPFLAGS}\n  CPPFLAGS=\"${CPPFLAGS} ${JNI_CFLAGS}\"\n  AC_CHECK_HEADERS([jni.h], [DUMMY=1],\n    [AC_MSG_ERROR([Could not find JNI header file])])\n  CPPFLAGS=${SAVE_CPPFLAGS}\n  AC_SUBST(JNI_CFLAGS)\n\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --with-java\"\n  JAVA_RPM_CONTENTS_1='%dir %{_datadir}/classes'\n  JAVA_RPM_CONTENTS_2=%{_datadir}/classes/turbojpeg.jar\n  WITH_JAVA=1\nelse\n  AC_MSG_RESULT(no)\nfi\nAM_CONDITIONAL([WITH_JAVA], [test \"x$with_java\" = \"xyes\"])\nAC_SUBST(WITH_JAVA)\nAC_SUBST(JAVA_RPM_CONTENTS_1)\nAC_SUBST(JAVA_RPM_CONTENTS_2)\n\n# optionally force using gas-preprocessor.pl for compatibility testing\nAC_ARG_WITH([gas-preprocessor],\n  AC_HELP_STRING([--with-gas-preprocessor],\n    [Force using gas-preprocessor.pl on ARM.]))\nif test \"x${with_gas_preprocessor}\" = \"xyes\"; then\n  case $host_os in\n    darwin*)\n      CCAS=\"gas-preprocessor.pl -fix-unreq $CC\"\n      ;;\n    *)\n      CCAS=\"gas-preprocessor.pl -no-fix-unreq $CC\"\n      ;;\n  esac\n  AC_SUBST([CCAS])\nfi\n\n# SIMD is optional\nAC_ARG_WITH([simd],\n  AC_HELP_STRING([--without-simd], [Do not include SIMD extensions]))\nif test \"x$with_12bit\" = \"xyes\"; then\n  with_simd=no\nfi\nif test \"x${with_simd}\" != \"xno\"; then\n  require_simd=no\n  if test \"x${with_simd}\" = \"xyes\"; then\n    require_simd=yes\n  fi\n  # Check if we're on a supported CPU\n  AC_MSG_CHECKING([if we have SIMD optimisations for cpu type])\n  case \"$host_cpu\" in\n    x86_64 | amd64)\n      AC_MSG_RESULT([yes (x86_64)])\n      AC_PROG_NASM\n      simd_arch=x86_64\n      ;;\n    i*86 | x86 | ia32)\n      AC_MSG_RESULT([yes (i386)])\n      AC_PROG_NASM\n      simd_arch=i386\n      ;;\n    arm*)\n      AC_MSG_RESULT([yes (arm)])\n      AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])\n      AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE(\n        [if test \"x$ac_use_gas_preprocessor\" = \"xyes\"; then\n           AC_MSG_RESULT([yes (with gas-preprocessor)])\n         else\n           AC_MSG_RESULT([yes])\n         fi\n         simd_arch=arm],\n        [AC_MSG_RESULT([no])\n         with_simd=no])\n      if test \"x${with_simd}\" = \"xno\"; then\n        if test \"x${require_simd}\" = \"xyes\"; then\n          AC_MSG_ERROR([SIMD support can't be enabled.])\n        else\n          AC_MSG_WARN([SIMD support can't be enabled.  Performance will suffer.])\n        fi\n      fi\n      ;;\n    aarch64*)\n      AC_MSG_RESULT([yes (arm64)])\n      AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])\n      AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE(\n        [if test \"x$ac_use_gas_preprocessor\" = \"xyes\"; then\n           AC_MSG_RESULT([yes (with gas-preprocessor)])\n         else\n           AC_MSG_RESULT([yes])\n         fi\n         simd_arch=aarch64],\n        [AC_MSG_RESULT([no])\n         with_simd=no])\n      if test \"x${with_simd}\" = \"xno\"; then\n        if test \"x${require_simd}\" = \"xyes\"; then\n          AC_MSG_ERROR([SIMD support can't be enabled.])\n        else\n          AC_MSG_WARN([SIMD support can't be enabled.  Performance will suffer.])\n        fi\n      fi\n      ;;\n    mips*)\n      AC_MSG_RESULT([yes (mips)])\n      AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])\n      AC_CHECK_COMPATIBLE_MIPS_ASSEMBLER_IFELSE(\n        [AC_MSG_RESULT([yes])\n         simd_arch=mips],\n        [AC_MSG_RESULT([no])\n         with_simd=no])\n      if test \"x${with_simd}\" = \"xno\"; then\n        if test \"x${require_simd}\" = \"xyes\"; then\n          AC_MSG_ERROR([SIMD support can't be enabled.])\n        else\n          AC_MSG_WARN([SIMD support can't be enabled.  Performance will suffer.])\n        fi\n      fi\n      ;;\n    powerpc*)\n      AC_MSG_RESULT([yes (powerpc)])\n      simd_arch=powerpc\n      ;;\n    *)\n      AC_MSG_RESULT([no (\"$host_cpu\")])\n      with_simd=no;\n      if test \"x${require_simd}\" = \"xyes\"; then\n        AC_MSG_ERROR([SIMD support not available for this CPU.])\n      else\n        AC_MSG_WARN([SIMD support not available for this CPU.  Performance will suffer.])\n      fi\n      ;;\n  esac\n\n  if test \"x${with_simd}\" != \"xno\"; then\n    AC_DEFINE([WITH_SIMD], [1], [Use accelerated SIMD routines.])\n  fi\nelse\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-simd\"\nfi\n\nAM_CONDITIONAL([WITH_SIMD], [test \"x$with_simd\" != \"xno\"])\nAM_CONDITIONAL([WITH_SSE_FLOAT_DCT], [test \"x$simd_arch\" = \"xx86_64\" -o \"x$simd_arch\" = \"xi386\"])\nAM_CONDITIONAL([SIMD_I386], [test \"x$simd_arch\" = \"xi386\"])\nAM_CONDITIONAL([SIMD_X86_64], [test \"x$simd_arch\" = \"xx86_64\"])\nAM_CONDITIONAL([SIMD_ARM], [test \"x$simd_arch\" = \"xarm\"])\nAM_CONDITIONAL([SIMD_ARM_64], [test \"x$simd_arch\" = \"xaarch64\"])\nAM_CONDITIONAL([SIMD_MIPS], [test \"x$simd_arch\" = \"xmips\"])\nAM_CONDITIONAL([SIMD_POWERPC], [test \"x$simd_arch\" = \"xpowerpc\"])\nAM_CONDITIONAL([X86_64], [test \"x$host_cpu\" = \"xx86_64\" -o \"x$host_cpu\" = \"xamd64\"])\nAM_CONDITIONAL([WITH_TURBOJPEG], [test \"x$with_turbojpeg\" != \"xno\"])\nAM_CONDITIONAL([CROSS_COMPILING], [test \"x$cross_compiling\" = \"xyes\"])\n\nAC_ARG_VAR(PKGNAME, [distribution package name (default: libjpeg-turbo)])\nif test \"x$PKGNAME\" = \"x\"; then\n  PKGNAME=$PACKAGE_NAME\nfi\nAC_SUBST(PKGNAME)\n\ncase \"$host_cpu\" in\n  x86_64)\n    RPMARCH=x86_64\n    DEBARCH=amd64\n    ;;\n  i*86 | x86 | ia32)\n    RPMARCH=i386\n    DEBARCH=i386\n    ;;\n  *)\n    RPMARCH=`uname -m`\n    DEBARCH=$RPMARCH\n    ;;\nesac\n\nif test \"${docdir}\" = \"\"; then\n  docdir=${datadir}/doc\n  AC_SUBST(docdir)\nfi\n\nAC_SUBST(RPMARCH)\nAC_SUBST(RPM_CONFIG_ARGS)\nAC_SUBST(DEBARCH)\nAC_SUBST(BUILD)\nAC_DEFINE_UNQUOTED([BUILD], \"$BUILD\", [libjpeg-turbo build number])\n\n# NOTE: autoheader automatically modifies the input file of the first\n# invocation of AC_CONFIG_HEADERS, so we put config.h first to prevent\n# jconfig.h.in from being clobbered.  config.h is used only internally, whereas\n# jconfig.h contains macros that are relevant to external programs (macros that\n# specify which features were built into the library.)\nAC_CONFIG_HEADERS([config.h])\nAC_CONFIG_HEADERS([jconfig.h])\nAC_CONFIG_HEADERS([jconfigint.h])\nAC_CONFIG_FILES([pkgscripts/libjpeg-turbo.spec.tmpl:release/libjpeg-turbo.spec.in])\nAC_CONFIG_FILES([pkgscripts/makecygwinpkg.tmpl:release/makecygwinpkg.in])\nAC_CONFIG_FILES([pkgscripts/makedpkg.tmpl:release/makedpkg.in])\nAC_CONFIG_FILES([pkgscripts/makemacpkg.tmpl:release/makemacpkg.in])\nAC_CONFIG_FILES([pkgscripts/uninstall.tmpl:release/uninstall.in])\nAC_CONFIG_FILES([pkgscripts/libjpeg.pc:release/libjpeg.pc.in])\nAC_CONFIG_FILES([pkgscripts/libturbojpeg.pc:release/libturbojpeg.pc.in])\nif test \"x$with_turbojpeg\" != \"xno\"; then\n  AC_CONFIG_FILES([tjbenchtest])\nfi\nif test \"x$with_java\" = \"xyes\"; then\n  AC_CONFIG_FILES([tjbenchtest.java])\n  AC_CONFIG_FILES([tjexampletest])\nfi\nAC_CONFIG_FILES([libjpeg.map])\nAC_CONFIG_FILES([Makefile simd/Makefile])\nAC_CONFIG_FILES([java/Makefile])\nAC_CONFIG_FILES([md5/Makefile])\nAC_OUTPUT\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/depcomp",
    "content": "#! /bin/sh\n# depcomp - compile a program generating dependencies as side-effects\n\nscriptversion=2013-05-30.07; # UTC\n\n# Copyright (C) 1999-2014 Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\n# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.\n\ncase $1 in\n  '')\n    echo \"$0: No command.  Try '$0 --help' for more information.\" 1>&2\n    exit 1;\n    ;;\n  -h | --h*)\n    cat <<\\EOF\nUsage: depcomp [--help] [--version] PROGRAM [ARGS]\n\nRun PROGRAMS ARGS to compile a file, generating dependencies\nas side-effects.\n\nEnvironment variables:\n  depmode     Dependency tracking mode.\n  source      Source file read by 'PROGRAMS ARGS'.\n  object      Object file output by 'PROGRAMS ARGS'.\n  DEPDIR      directory where to store dependencies.\n  depfile     Dependency file to output.\n  tmpdepfile  Temporary file to use when outputting dependencies.\n  libtool     Whether libtool is used (yes/no).\n\nReport bugs to <bug-automake@gnu.org>.\nEOF\n    exit $?\n    ;;\n  -v | --v*)\n    echo \"depcomp $scriptversion\"\n    exit $?\n    ;;\nesac\n\n# Get the directory component of the given path, and save it in the\n# global variables '$dir'.  Note that this directory component will\n# be either empty or ending with a '/' character.  This is deliberate.\nset_dir_from ()\n{\n  case $1 in\n    */*) dir=`echo \"$1\" | sed -e 's|/[^/]*$|/|'`;;\n      *) dir=;;\n  esac\n}\n\n# Get the suffix-stripped basename of the given path, and save it the\n# global variable '$base'.\nset_base_from ()\n{\n  base=`echo \"$1\" | sed -e 's|^.*/||' -e 's/\\.[^.]*$//'`\n}\n\n# If no dependency file was actually created by the compiler invocation,\n# we still have to create a dummy depfile, to avoid errors with the\n# Makefile \"include basename.Plo\" scheme.\nmake_dummy_depfile ()\n{\n  echo \"#dummy\" > \"$depfile\"\n}\n\n# Factor out some common post-processing of the generated depfile.\n# Requires the auxiliary global variable '$tmpdepfile' to be set.\naix_post_process_depfile ()\n{\n  # If the compiler actually managed to produce a dependency file,\n  # post-process it.\n  if test -f \"$tmpdepfile\"; then\n    # Each line is of the form 'foo.o: dependency.h'.\n    # Do two passes, one to just change these to\n    #   $object: dependency.h\n    # and one to simply output\n    #   dependency.h:\n    # which is needed to avoid the deleted-header problem.\n    { sed -e \"s,^.*\\.[$lower]*:,$object:,\" < \"$tmpdepfile\"\n      sed -e \"s,^.*\\.[$lower]*:[$tab ]*,,\" -e 's,$,:,' < \"$tmpdepfile\"\n    } > \"$depfile\"\n    rm -f \"$tmpdepfile\"\n  else\n    make_dummy_depfile\n  fi\n}\n\n# A tabulation character.\ntab='\t'\n# A newline character.\nnl='\n'\n# Character ranges might be problematic outside the C locale.\n# These definitions help.\nupper=ABCDEFGHIJKLMNOPQRSTUVWXYZ\nlower=abcdefghijklmnopqrstuvwxyz\ndigits=0123456789\nalpha=${upper}${lower}\n\nif test -z \"$depmode\" || test -z \"$source\" || test -z \"$object\"; then\n  echo \"depcomp: Variables source, object and depmode must be set\" 1>&2\n  exit 1\nfi\n\n# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.\ndepfile=${depfile-`echo \"$object\" |\n  sed 's|[^\\\\/]*$|'${DEPDIR-.deps}'/&|;s|\\.\\([^.]*\\)$|.P\\1|;s|Pobj$|Po|'`}\ntmpdepfile=${tmpdepfile-`echo \"$depfile\" | sed 's/\\.\\([^.]*\\)$/.T\\1/'`}\n\nrm -f \"$tmpdepfile\"\n\n# Avoid interferences from the environment.\ngccflag= dashmflag=\n\n# Some modes work just like other modes, but use different flags.  We\n# parameterize here, but still list the modes in the big case below,\n# to make depend.m4 easier to write.  Note that we *cannot* use a case\n# here, because this file can only contain one case statement.\nif test \"$depmode\" = hp; then\n  # HP compiler uses -M and no extra arg.\n  gccflag=-M\n  depmode=gcc\nfi\n\nif test \"$depmode\" = dashXmstdout; then\n  # This is just like dashmstdout with a different argument.\n  dashmflag=-xM\n  depmode=dashmstdout\nfi\n\ncygpath_u=\"cygpath -u -f -\"\nif test \"$depmode\" = msvcmsys; then\n  # This is just like msvisualcpp but w/o cygpath translation.\n  # Just convert the backslash-escaped backslashes to single forward\n  # slashes to satisfy depend.m4\n  cygpath_u='sed s,\\\\\\\\,/,g'\n  depmode=msvisualcpp\nfi\n\nif test \"$depmode\" = msvc7msys; then\n  # This is just like msvc7 but w/o cygpath translation.\n  # Just convert the backslash-escaped backslashes to single forward\n  # slashes to satisfy depend.m4\n  cygpath_u='sed s,\\\\\\\\,/,g'\n  depmode=msvc7\nfi\n\nif test \"$depmode\" = xlc; then\n  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.\n  gccflag=-qmakedep=gcc,-MF\n  depmode=gcc\nfi\n\ncase \"$depmode\" in\ngcc3)\n## gcc 3 implements dependency tracking that does exactly what\n## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like\n## it if -MD -MP comes after the -MF stuff.  Hmm.\n## Unfortunately, FreeBSD c89 acceptance of flags depends upon\n## the command line argument order; so add the flags where they\n## appear in depend2.am.  Note that the slowdown incurred here\n## affects only configure: in makefiles, %FASTDEP% shortcuts this.\n  for arg\n  do\n    case $arg in\n    -c) set fnord \"$@\" -MT \"$object\" -MD -MP -MF \"$tmpdepfile\" \"$arg\" ;;\n    *)  set fnord \"$@\" \"$arg\" ;;\n    esac\n    shift # fnord\n    shift # $arg\n  done\n  \"$@\"\n  stat=$?\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  mv \"$tmpdepfile\" \"$depfile\"\n  ;;\n\ngcc)\n## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.\n## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.\n## (see the conditional assignment to $gccflag above).\n## There are various ways to get dependency output from gcc.  Here's\n## why we pick this rather obscure method:\n## - Don't want to use -MD because we'd like the dependencies to end\n##   up in a subdir.  Having to rename by hand is ugly.\n##   (We might end up doing this anyway to support other compilers.)\n## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like\n##   -MM, not -M (despite what the docs say).  Also, it might not be\n##   supported by the other compilers which use the 'gcc' depmode.\n## - Using -M directly means running the compiler twice (even worse\n##   than renaming).\n  if test -z \"$gccflag\"; then\n    gccflag=-MD,\n  fi\n  \"$@\" -Wp,\"$gccflag$tmpdepfile\"\n  stat=$?\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  rm -f \"$depfile\"\n  echo \"$object : \\\\\" > \"$depfile\"\n  # The second -e expression handles DOS-style file names with drive\n  # letters.\n  sed -e 's/^[^:]*: / /' \\\n      -e 's/^['$alpha']:\\/[^:]*: / /' < \"$tmpdepfile\" >> \"$depfile\"\n## This next piece of magic avoids the \"deleted header file\" problem.\n## The problem is that when a header file which appears in a .P file\n## is deleted, the dependency causes make to die (because there is\n## typically no way to rebuild the header).  We avoid this by adding\n## dummy dependencies for each header file.  Too bad gcc doesn't do\n## this for us directly.\n## Some versions of gcc put a space before the ':'.  On the theory\n## that the space means something, we add a space to the output as\n## well.  hp depmode also adds that space, but also prefixes the VPATH\n## to the object.  Take care to not repeat it in the output.\n## Some versions of the HPUX 10.20 sed can't process this invocation\n## correctly.  Breaking it into two sed invocations is a workaround.\n  tr ' ' \"$nl\" < \"$tmpdepfile\" \\\n    | sed -e 's/^\\\\$//' -e '/^$/d' -e \"s|.*$object$||\" -e '/:$/d' \\\n    | sed -e 's/$/ :/' >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\nhp)\n  # This case exists only to let depend.m4 do its work.  It works by\n  # looking at the text of this script.  This case will never be run,\n  # since it is checked for above.\n  exit 1\n  ;;\n\nsgi)\n  if test \"$libtool\" = yes; then\n    \"$@\" \"-Wp,-MDupdate,$tmpdepfile\"\n  else\n    \"$@\" -MDupdate \"$tmpdepfile\"\n  fi\n  stat=$?\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  rm -f \"$depfile\"\n\n  if test -f \"$tmpdepfile\"; then  # yes, the sourcefile depend on other files\n    echo \"$object : \\\\\" > \"$depfile\"\n    # Clip off the initial element (the dependent).  Don't try to be\n    # clever and replace this with sed code, as IRIX sed won't handle\n    # lines with more than a fixed number of characters (4096 in\n    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;\n    # the IRIX cc adds comments like '#:fec' to the end of the\n    # dependency line.\n    tr ' ' \"$nl\" < \"$tmpdepfile\" \\\n      | sed -e 's/^.*\\.o://' -e 's/#.*$//' -e '/^$/ d' \\\n      | tr \"$nl\" ' ' >> \"$depfile\"\n    echo >> \"$depfile\"\n    # The second pass generates a dummy entry for each header file.\n    tr ' ' \"$nl\" < \"$tmpdepfile\" \\\n      | sed -e 's/^.*\\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \\\n      >> \"$depfile\"\n  else\n    make_dummy_depfile\n  fi\n  rm -f \"$tmpdepfile\"\n  ;;\n\nxlc)\n  # This case exists only to let depend.m4 do its work.  It works by\n  # looking at the text of this script.  This case will never be run,\n  # since it is checked for above.\n  exit 1\n  ;;\n\naix)\n  # The C for AIX Compiler uses -M and outputs the dependencies\n  # in a .u file.  In older versions, this file always lives in the\n  # current directory.  Also, the AIX compiler puts '$object:' at the\n  # start of each line; $object doesn't have directory information.\n  # Version 6 uses the directory in both cases.\n  set_dir_from \"$object\"\n  set_base_from \"$object\"\n  if test \"$libtool\" = yes; then\n    tmpdepfile1=$dir$base.u\n    tmpdepfile2=$base.u\n    tmpdepfile3=$dir.libs/$base.u\n    \"$@\" -Wc,-M\n  else\n    tmpdepfile1=$dir$base.u\n    tmpdepfile2=$dir$base.u\n    tmpdepfile3=$dir$base.u\n    \"$@\" -M\n  fi\n  stat=$?\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile1\" \"$tmpdepfile2\" \"$tmpdepfile3\"\n    exit $stat\n  fi\n\n  for tmpdepfile in \"$tmpdepfile1\" \"$tmpdepfile2\" \"$tmpdepfile3\"\n  do\n    test -f \"$tmpdepfile\" && break\n  done\n  aix_post_process_depfile\n  ;;\n\ntcc)\n  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26\n  # FIXME: That version still under development at the moment of writing.\n  #        Make that this statement remains true also for stable, released\n  #        versions.\n  # It will wrap lines (doesn't matter whether long or short) with a\n  # trailing '\\', as in:\n  #\n  #   foo.o : \\\n  #    foo.c \\\n  #    foo.h \\\n  #\n  # It will put a trailing '\\' even on the last line, and will use leading\n  # spaces rather than leading tabs (at least since its commit 0394caf7\n  # \"Emit spaces for -MD\").\n  \"$@\" -MD -MF \"$tmpdepfile\"\n  stat=$?\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  rm -f \"$depfile\"\n  # Each non-empty line is of the form 'foo.o : \\' or ' dep.h \\'.\n  # We have to change lines of the first kind to '$object: \\'.\n  sed -e \"s|.*:|$object :|\" < \"$tmpdepfile\" > \"$depfile\"\n  # And for each line of the second kind, we have to emit a 'dep.h:'\n  # dummy dependency, to avoid the deleted-header problem.\n  sed -n -e 's|^  *\\(.*\\) *\\\\$|\\1:|p' < \"$tmpdepfile\" >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\n## The order of this option in the case statement is important, since the\n## shell code in configure will try each of these formats in the order\n## listed in this file.  A plain '-MD' option would be understood by many\n## compilers, so we must ensure this comes after the gcc and icc options.\npgcc)\n  # Portland's C compiler understands '-MD'.\n  # Will always output deps to 'file.d' where file is the root name of the\n  # source file under compilation, even if file resides in a subdirectory.\n  # The object file name does not affect the name of the '.d' file.\n  # pgcc 10.2 will output\n  #    foo.o: sub/foo.c sub/foo.h\n  # and will wrap long lines using '\\' :\n  #    foo.o: sub/foo.c ... \\\n  #     sub/foo.h ... \\\n  #     ...\n  set_dir_from \"$object\"\n  # Use the source, not the object, to determine the base name, since\n  # that's sadly what pgcc will do too.\n  set_base_from \"$source\"\n  tmpdepfile=$base.d\n\n  # For projects that build the same source file twice into different object\n  # files, the pgcc approach of using the *source* file root name can cause\n  # problems in parallel builds.  Use a locking strategy to avoid stomping on\n  # the same $tmpdepfile.\n  lockdir=$base.d-lock\n  trap \"\n    echo '$0: caught signal, cleaning up...' >&2\n    rmdir '$lockdir'\n    exit 1\n  \" 1 2 13 15\n  numtries=100\n  i=$numtries\n  while test $i -gt 0; do\n    # mkdir is a portable test-and-set.\n    if mkdir \"$lockdir\" 2>/dev/null; then\n      # This process acquired the lock.\n      \"$@\" -MD\n      stat=$?\n      # Release the lock.\n      rmdir \"$lockdir\"\n      break\n    else\n      # If the lock is being held by a different process, wait\n      # until the winning process is done or we timeout.\n      while test -d \"$lockdir\" && test $i -gt 0; do\n        sleep 1\n        i=`expr $i - 1`\n      done\n    fi\n    i=`expr $i - 1`\n  done\n  trap - 1 2 13 15\n  if test $i -le 0; then\n    echo \"$0: failed to acquire lock after $numtries attempts\" >&2\n    echo \"$0: check lockdir '$lockdir'\" >&2\n    exit 1\n  fi\n\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  rm -f \"$depfile\"\n  # Each line is of the form `foo.o: dependent.h',\n  # or `foo.o: dep1.h dep2.h \\', or ` dep3.h dep4.h \\'.\n  # Do two passes, one to just change these to\n  # `$object: dependent.h' and one to simply `dependent.h:'.\n  sed \"s,^[^:]*:,$object :,\" < \"$tmpdepfile\" > \"$depfile\"\n  # Some versions of the HPUX 10.20 sed can't process this invocation\n  # correctly.  Breaking it into two sed invocations is a workaround.\n  sed 's,^[^:]*: \\(.*\\)$,\\1,;s/^\\\\$//;/^$/d;/:$/d' < \"$tmpdepfile\" \\\n    | sed -e 's/$/ :/' >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\nhp2)\n  # The \"hp\" stanza above does not work with aCC (C++) and HP's ia64\n  # compilers, which have integrated preprocessors.  The correct option\n  # to use with these is +Maked; it writes dependencies to a file named\n  # 'foo.d', which lands next to the object file, wherever that\n  # happens to be.\n  # Much of this is similar to the tru64 case; see comments there.\n  set_dir_from  \"$object\"\n  set_base_from \"$object\"\n  if test \"$libtool\" = yes; then\n    tmpdepfile1=$dir$base.d\n    tmpdepfile2=$dir.libs/$base.d\n    \"$@\" -Wc,+Maked\n  else\n    tmpdepfile1=$dir$base.d\n    tmpdepfile2=$dir$base.d\n    \"$@\" +Maked\n  fi\n  stat=$?\n  if test $stat -ne 0; then\n     rm -f \"$tmpdepfile1\" \"$tmpdepfile2\"\n     exit $stat\n  fi\n\n  for tmpdepfile in \"$tmpdepfile1\" \"$tmpdepfile2\"\n  do\n    test -f \"$tmpdepfile\" && break\n  done\n  if test -f \"$tmpdepfile\"; then\n    sed -e \"s,^.*\\.[$lower]*:,$object:,\" \"$tmpdepfile\" > \"$depfile\"\n    # Add 'dependent.h:' lines.\n    sed -ne '2,${\n               s/^ *//\n               s/ \\\\*$//\n               s/$/:/\n               p\n             }' \"$tmpdepfile\" >> \"$depfile\"\n  else\n    make_dummy_depfile\n  fi\n  rm -f \"$tmpdepfile\" \"$tmpdepfile2\"\n  ;;\n\ntru64)\n  # The Tru64 compiler uses -MD to generate dependencies as a side\n  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.\n  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put\n  # dependencies in 'foo.d' instead, so we check for that too.\n  # Subdirectories are respected.\n  set_dir_from  \"$object\"\n  set_base_from \"$object\"\n\n  if test \"$libtool\" = yes; then\n    # Libtool generates 2 separate objects for the 2 libraries.  These\n    # two compilations output dependencies in $dir.libs/$base.o.d and\n    # in $dir$base.o.d.  We have to check for both files, because\n    # one of the two compilations can be disabled.  We should prefer\n    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is\n    # automatically cleaned when .libs/ is deleted, while ignoring\n    # the former would cause a distcleancheck panic.\n    tmpdepfile1=$dir$base.o.d          # libtool 1.5\n    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.\n    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504\n    \"$@\" -Wc,-MD\n  else\n    tmpdepfile1=$dir$base.d\n    tmpdepfile2=$dir$base.d\n    tmpdepfile3=$dir$base.d\n    \"$@\" -MD\n  fi\n\n  stat=$?\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile1\" \"$tmpdepfile2\" \"$tmpdepfile3\"\n    exit $stat\n  fi\n\n  for tmpdepfile in \"$tmpdepfile1\" \"$tmpdepfile2\" \"$tmpdepfile3\"\n  do\n    test -f \"$tmpdepfile\" && break\n  done\n  # Same post-processing that is required for AIX mode.\n  aix_post_process_depfile\n  ;;\n\nmsvc7)\n  if test \"$libtool\" = yes; then\n    showIncludes=-Wc,-showIncludes\n  else\n    showIncludes=-showIncludes\n  fi\n  \"$@\" $showIncludes > \"$tmpdepfile\"\n  stat=$?\n  grep -v '^Note: including file: ' \"$tmpdepfile\"\n  if test $stat -ne 0; then\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  rm -f \"$depfile\"\n  echo \"$object : \\\\\" > \"$depfile\"\n  # The first sed program below extracts the file names and escapes\n  # backslashes for cygpath.  The second sed program outputs the file\n  # name when reading, but also accumulates all include files in the\n  # hold buffer in order to output them again at the end.  This only\n  # works with sed implementations that can handle large buffers.\n  sed < \"$tmpdepfile\" -n '\n/^Note: including file:  *\\(.*\\)/ {\n  s//\\1/\n  s/\\\\/\\\\\\\\/g\n  p\n}' | $cygpath_u | sort -u | sed -n '\ns/ /\\\\ /g\ns/\\(.*\\)/'\"$tab\"'\\1 \\\\/p\ns/.\\(.*\\) \\\\/\\1:/\nH\n$ {\n  s/.*/'\"$tab\"'/\n  G\n  p\n}' >> \"$depfile\"\n  echo >> \"$depfile\" # make sure the fragment doesn't end with a backslash\n  rm -f \"$tmpdepfile\"\n  ;;\n\nmsvc7msys)\n  # This case exists only to let depend.m4 do its work.  It works by\n  # looking at the text of this script.  This case will never be run,\n  # since it is checked for above.\n  exit 1\n  ;;\n\n#nosideeffect)\n  # This comment above is used by automake to tell side-effect\n  # dependency tracking mechanisms from slower ones.\n\ndashmstdout)\n  # Important note: in order to support this mode, a compiler *must*\n  # always write the preprocessed file to stdout, regardless of -o.\n  \"$@\" || exit $?\n\n  # Remove the call to Libtool.\n  if test \"$libtool\" = yes; then\n    while test \"X$1\" != 'X--mode=compile'; do\n      shift\n    done\n    shift\n  fi\n\n  # Remove '-o $object'.\n  IFS=\" \"\n  for arg\n  do\n    case $arg in\n    -o)\n      shift\n      ;;\n    $object)\n      shift\n      ;;\n    *)\n      set fnord \"$@\" \"$arg\"\n      shift # fnord\n      shift # $arg\n      ;;\n    esac\n  done\n\n  test -z \"$dashmflag\" && dashmflag=-M\n  # Require at least two characters before searching for ':'\n  # in the target name.  This is to cope with DOS-style filenames:\n  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.\n  \"$@\" $dashmflag |\n    sed \"s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |\" > \"$tmpdepfile\"\n  rm -f \"$depfile\"\n  cat < \"$tmpdepfile\" > \"$depfile\"\n  # Some versions of the HPUX 10.20 sed can't process this sed invocation\n  # correctly.  Breaking it into two sed invocations is a workaround.\n  tr ' ' \"$nl\" < \"$tmpdepfile\" \\\n    | sed -e 's/^\\\\$//' -e '/^$/d' -e '/:$/d' \\\n    | sed -e 's/$/ :/' >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\ndashXmstdout)\n  # This case only exists to satisfy depend.m4.  It is never actually\n  # run, as this mode is specially recognized in the preamble.\n  exit 1\n  ;;\n\nmakedepend)\n  \"$@\" || exit $?\n  # Remove any Libtool call\n  if test \"$libtool\" = yes; then\n    while test \"X$1\" != 'X--mode=compile'; do\n      shift\n    done\n    shift\n  fi\n  # X makedepend\n  shift\n  cleared=no eat=no\n  for arg\n  do\n    case $cleared in\n    no)\n      set \"\"; shift\n      cleared=yes ;;\n    esac\n    if test $eat = yes; then\n      eat=no\n      continue\n    fi\n    case \"$arg\" in\n    -D*|-I*)\n      set fnord \"$@\" \"$arg\"; shift ;;\n    # Strip any option that makedepend may not understand.  Remove\n    # the object too, otherwise makedepend will parse it as a source file.\n    -arch)\n      eat=yes ;;\n    -*|$object)\n      ;;\n    *)\n      set fnord \"$@\" \"$arg\"; shift ;;\n    esac\n  done\n  obj_suffix=`echo \"$object\" | sed 's/^.*\\././'`\n  touch \"$tmpdepfile\"\n  ${MAKEDEPEND-makedepend} -o\"$obj_suffix\" -f\"$tmpdepfile\" \"$@\"\n  rm -f \"$depfile\"\n  # makedepend may prepend the VPATH from the source file name to the object.\n  # No need to regex-escape $object, excess matching of '.' is harmless.\n  sed \"s|^.*\\($object *:\\)|\\1|\" \"$tmpdepfile\" > \"$depfile\"\n  # Some versions of the HPUX 10.20 sed can't process the last invocation\n  # correctly.  Breaking it into two sed invocations is a workaround.\n  sed '1,2d' \"$tmpdepfile\" \\\n    | tr ' ' \"$nl\" \\\n    | sed -e 's/^\\\\$//' -e '/^$/d' -e '/:$/d' \\\n    | sed -e 's/$/ :/' >> \"$depfile\"\n  rm -f \"$tmpdepfile\" \"$tmpdepfile\".bak\n  ;;\n\ncpp)\n  # Important note: in order to support this mode, a compiler *must*\n  # always write the preprocessed file to stdout.\n  \"$@\" || exit $?\n\n  # Remove the call to Libtool.\n  if test \"$libtool\" = yes; then\n    while test \"X$1\" != 'X--mode=compile'; do\n      shift\n    done\n    shift\n  fi\n\n  # Remove '-o $object'.\n  IFS=\" \"\n  for arg\n  do\n    case $arg in\n    -o)\n      shift\n      ;;\n    $object)\n      shift\n      ;;\n    *)\n      set fnord \"$@\" \"$arg\"\n      shift # fnord\n      shift # $arg\n      ;;\n    esac\n  done\n\n  \"$@\" -E \\\n    | sed -n -e '/^# [0-9][0-9]* \"\\([^\"]*\\)\".*/ s:: \\1 \\\\:p' \\\n             -e '/^#line [0-9][0-9]* \"\\([^\"]*\\)\".*/ s:: \\1 \\\\:p' \\\n    | sed '$ s: \\\\$::' > \"$tmpdepfile\"\n  rm -f \"$depfile\"\n  echo \"$object : \\\\\" > \"$depfile\"\n  cat < \"$tmpdepfile\" >> \"$depfile\"\n  sed < \"$tmpdepfile\" '/^$/d;s/^ //;s/ \\\\$//;s/$/ :/' >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\nmsvisualcpp)\n  # Important note: in order to support this mode, a compiler *must*\n  # always write the preprocessed file to stdout.\n  \"$@\" || exit $?\n\n  # Remove the call to Libtool.\n  if test \"$libtool\" = yes; then\n    while test \"X$1\" != 'X--mode=compile'; do\n      shift\n    done\n    shift\n  fi\n\n  IFS=\" \"\n  for arg\n  do\n    case \"$arg\" in\n    -o)\n      shift\n      ;;\n    $object)\n      shift\n      ;;\n    \"-Gm\"|\"/Gm\"|\"-Gi\"|\"/Gi\"|\"-ZI\"|\"/ZI\")\n        set fnord \"$@\"\n        shift\n        shift\n        ;;\n    *)\n        set fnord \"$@\" \"$arg\"\n        shift\n        shift\n        ;;\n    esac\n  done\n  \"$@\" -E 2>/dev/null |\n  sed -n '/^#line [0-9][0-9]* \"\\([^\"]*\\)\"/ s::\\1:p' | $cygpath_u | sort -u > \"$tmpdepfile\"\n  rm -f \"$depfile\"\n  echo \"$object : \\\\\" > \"$depfile\"\n  sed < \"$tmpdepfile\" -n -e 's% %\\\\ %g' -e '/^\\(.*\\)$/ s::'\"$tab\"'\\1 \\\\:p' >> \"$depfile\"\n  echo \"$tab\" >> \"$depfile\"\n  sed < \"$tmpdepfile\" -n -e 's% %\\\\ %g' -e '/^\\(.*\\)$/ s::\\1\\::p' >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\nmsvcmsys)\n  # This case exists only to let depend.m4 do its work.  It works by\n  # looking at the text of this script.  This case will never be run,\n  # since it is checked for above.\n  exit 1\n  ;;\n\nnone)\n  exec \"$@\"\n  ;;\n\n*)\n  echo \"Unknown depmode $depmode\" 1>&2\n  exit 1\n  ;;\nesac\n\nexit 0\n\n# Local Variables:\n# mode: shell-script\n# sh-indentation: 2\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-time-zone: \"UTC\"\n# time-stamp-end: \"; # UTC\"\n# End:\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/djpeg.1",
    "content": ".TH DJPEG 1 \"18 February 2016\"\n.SH NAME\ndjpeg \\- decompress a JPEG file to an image file\n.SH SYNOPSIS\n.B djpeg\n[\n.I options\n]\n[\n.I filename\n]\n.LP\n.SH DESCRIPTION\n.LP\n.B djpeg\ndecompresses the named JPEG file, or the standard input if no file is named,\nand produces an image file on the standard output.  PBMPLUS (PPM/PGM), BMP,\nGIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected.\n(RLE is supported only if the URT library is available.)\n.SH OPTIONS\nAll switch names may be abbreviated; for example,\n.B \\-grayscale\nmay be written\n.B \\-gray\nor\n.BR \\-gr .\nMost of the \"basic\" switches can be abbreviated to as little as one letter.\nUpper and lower case are equivalent (thus\n.B \\-BMP\nis the same as\n.BR \\-bmp ).\nBritish spellings are also accepted (e.g.,\n.BR \\-greyscale ),\nthough for brevity these are not mentioned below.\n.PP\nThe basic switches are:\n.TP\n.BI \\-colors \" N\"\nReduce image to at most N colors.  This reduces the number of colors used in\nthe output image, so that it can be displayed on a colormapped display or\nstored in a colormapped file format.  For example, if you have an 8-bit\ndisplay, you'd need to reduce to 256 or fewer colors.\n.TP\n.BI \\-quantize \" N\"\nSame as\n.BR \\-colors .\n.B \\-colors\nis the recommended name,\n.B \\-quantize\nis provided only for backwards compatibility.\n.TP\n.B \\-fast\nSelect recommended processing options for fast, low quality output.  (The\ndefault options are chosen for highest quality output.)  Currently, this is\nequivalent to \\fB\\-dct fast \\-nosmooth \\-onepass \\-dither ordered\\fR.\n.TP\n.B \\-grayscale\nForce grayscale output even if JPEG file is color.  Useful for viewing on\nmonochrome displays; also,\n.B djpeg\nruns noticeably faster in this mode.\n.TP\n.B \\-rgb\nForce RGB output even if JPEG file is grayscale.\n.TP\n.BI \\-scale \" M/N\"\nScale the output image by a factor M/N.  Currently the scale factor must be\nM/8, where M is an integer between 1 and 16 inclusive, or any reduced fraction\nthereof (such as 1/2, 3/4, etc.)  Scaling is handy if the image is larger than\nyour screen; also,\n.B djpeg\nruns much faster when scaling down the output.\n.TP\n.B \\-bmp\nSelect BMP output format (Windows flavor).  8-bit colormapped format is\nemitted if\n.B \\-colors\nor\n.B \\-grayscale\nis specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color\nformat is emitted.\n.TP\n.B \\-gif\nSelect GIF output format.  Since GIF does not support more than 256 colors,\n.B \\-colors 256\nis assumed (unless you specify a smaller number of colors).\n.TP\n.B \\-os2\nSelect BMP output format (OS/2 1.x flavor).  8-bit colormapped format is\nemitted if\n.B \\-colors\nor\n.B \\-grayscale\nis specified, or if the JPEG file is grayscale; otherwise, 24-bit full-color\nformat is emitted.\n.TP\n.B \\-pnm\nSelect PBMPLUS (PPM/PGM) output format (this is the default format).\nPGM is emitted if the JPEG file is grayscale or if\n.B \\-grayscale\nis specified; otherwise PPM is emitted.\n.TP\n.B \\-rle\nSelect RLE output format.  (Requires URT library.)\n.TP\n.B \\-targa\nSelect Targa output format.  Grayscale format is emitted if the JPEG file is\ngrayscale or if\n.B \\-grayscale\nis specified; otherwise, colormapped format is emitted if\n.B \\-colors\nis specified; otherwise, 24-bit full-color format is emitted.\n.PP\nSwitches for advanced users:\n.TP\n.B \\-dct int\nUse integer DCT method (default).\n.TP\n.B \\-dct fast\nUse fast integer DCT (less accurate).\nIn libjpeg-turbo, the fast method is generally about 5-15% faster than the int\nmethod when using the x86/x86-64 SIMD extensions (results may vary with other\nSIMD implementations, or when using libjpeg-turbo without SIMD extensions.)  If\nthe JPEG image was compressed using a quality level of 85 or below, then there\nshould be little or no perceptible difference between the two algorithms.  When\ndecompressing images that were compressed using quality levels above 85,\nhowever, the difference between the fast and int methods becomes more\npronounced.  With images compressed using quality=97, for instance, the fast\nmethod incurs generally about a 4-6 dB loss (in PSNR) relative to the int\nmethod, but this can be larger for some images.  If you can avoid it, do not\nuse the fast method when decompressing images that were compressed using\nquality levels above 97.  The algorithm often degenerates for such images and\ncan actually produce a more lossy output image than if the JPEG image had been\ncompressed using lower quality levels.\n.TP\n.B \\-dct float\nUse floating-point DCT method.\nThe float method is mainly a legacy feature.  It does not produce significantly\nmore accurate results than the int method, and it is much slower.  The float\nmethod may also give different results on different machines due to varying\nroundoff behavior, whereas the integer methods should give the same results on\nall machines.\n.TP\n.B \\-dither fs\nUse Floyd-Steinberg dithering in color quantization.\n.TP\n.B \\-dither ordered\nUse ordered dithering in color quantization.\n.TP\n.B \\-dither none\nDo not use dithering in color quantization.\nBy default, Floyd-Steinberg dithering is applied when quantizing colors; this\nis slow but usually produces the best results.  Ordered dither is a compromise\nbetween speed and quality; no dithering is fast but usually looks awful.  Note\nthat these switches have no effect unless color quantization is being done.\nOrdered dither is only available in\n.B \\-onepass\nmode.\n.TP\n.BI \\-map \" file\"\nQuantize to the colors used in the specified image file.  This is useful for\nproducing multiple files with identical color maps, or for forcing a\npredefined set of colors to be used.  The\n.I file\nmust be a GIF or PPM file. This option overrides\n.B \\-colors\nand\n.BR \\-onepass .\n.TP\n.B \\-nosmooth\nUse a faster, lower-quality upsampling routine.\n.TP\n.B \\-onepass\nUse one-pass instead of two-pass color quantization.  The one-pass method is\nfaster and needs less memory, but it produces a lower-quality image.\n.B \\-onepass\nis ignored unless you also say\n.B \\-colors\n.IR N .\nAlso, the one-pass method is always used for grayscale output (the two-pass\nmethod is no improvement then).\n.TP\n.BI \\-maxmemory \" N\"\nSet limit for amount of memory to use in processing large images.  Value is\nin thousands of bytes, or millions of bytes if \"M\" is attached to the\nnumber.  For example,\n.B \\-max 4m\nselects 4000000 bytes.  If more space is needed, temporary files will be used.\n.TP\n.BI \\-outfile \" name\"\nSend output image to the named file, not to standard output.\n.TP\n.BI \\-memsrc\nLoad input file into memory before decompressing.  This feature was implemented\nmainly as a way of testing the in-memory source manager (jpeg_mem_src().)\n.TP\n.BI \\-skip \" Y0,Y1\"\nDecompress all rows of the JPEG image except those between Y0 and Y1\n(inclusive.)  Note that if decompression scaling is being used, then Y0 and Y1\nare relative to the scaled image dimensions.\n.TP\n.BI \\-crop \" WxH+X+Y\"\nDecompress only a rectangular subregion of the image, starting at point X,Y\nwith width W and height H.  If necessary, X will be shifted left to the nearest\niMCU boundary, and the width will be increased accordingly.  Note that if\ndecompression scaling is being used, then X, Y, W, and H are relative to the\nscaled image dimensions.\n.TP\n.B \\-verbose\nEnable debug printout.  More\n.BR \\-v 's\ngive more output.  Also, version information is printed at startup.\n.TP\n.B \\-debug\nSame as\n.BR \\-verbose .\n.TP\n.B \\-version\nPrint version information and exit.\n.SH EXAMPLES\n.LP\nThis example decompresses the JPEG file foo.jpg, quantizes it to\n256 colors, and saves the output in 8-bit BMP format in foo.bmp:\n.IP\n.B djpeg \\-colors 256 \\-bmp\n.I foo.jpg\n.B >\n.I foo.bmp\n.SH HINTS\nTo get a quick preview of an image, use the\n.B \\-grayscale\nand/or\n.B \\-scale\nswitches.\n.B \\-grayscale \\-scale 1/8\nis the fastest case.\n.PP\nSeveral options are available that trade off image quality to gain speed.\n.B \\-fast\nturns on the recommended settings.\n.PP\n.B \\-dct fast\nand/or\n.B \\-nosmooth\ngain speed at a small sacrifice in quality.\nWhen producing a color-quantized image,\n.B \\-onepass \\-dither ordered\nis fast but much lower quality than the default behavior.\n.B \\-dither none\nmay give acceptable results in two-pass mode, but is seldom tolerable in\none-pass mode.\n.PP\nIf you are fortunate enough to have very fast floating point hardware,\n\\fB\\-dct float\\fR may be even faster than \\fB\\-dct fast\\fR.  But on most\nmachines \\fB\\-dct float\\fR is slower than \\fB\\-dct int\\fR; in this case it is\nnot worth using, because its theoretical accuracy advantage is too small to be\nsignificant in practice.\n.SH ENVIRONMENT\n.TP\n.B JPEGMEM\nIf this environment variable is set, its value is the default memory limit.\nThe value is specified as described for the\n.B \\-maxmemory\nswitch.\n.B JPEGMEM\noverrides the default value specified when the program was compiled, and\nitself is overridden by an explicit\n.BR \\-maxmemory .\n.SH SEE ALSO\n.BR cjpeg (1),\n.BR jpegtran (1),\n.BR rdjpgcom (1),\n.BR wrjpgcom (1)\n.br\n.BR ppm (5),\n.BR pgm (5)\n.br\nWallace, Gregory K.  \"The JPEG Still Picture Compression Standard\",\nCommunications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.\n.SH AUTHOR\nIndependent JPEG Group\n.PP\nThis file was modified by The libjpeg-turbo Project to include only information\nrelevant to libjpeg-turbo, to wordsmith certain sections, and to describe\nfeatures not present in libjpeg.\n.SH ISSUES\nSupport for compressed GIF output files was removed in djpeg v6b due to\nconcerns over the Unisys LZW patent.  Although this patent expired in 2006,\ndjpeg still lacks compressed GIF support, for these historical reasons.\n(Conversion of JPEG files to GIF is usually a bad idea anyway, since GIF is a\n256-color format.)  The uncompressed GIF files that djpeg generates are larger\nthan they should be, but they are readable by standard GIF decoders.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/djpeg.c",
    "content": "/*\n * djpeg.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2013 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010-2011, 2013-2016, D. R. Commander.\n * Copyright (C) 2015, Google, Inc.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains a command-line user interface for the JPEG decompressor.\n * It should work on any system with Unix- or MS-DOS-style command lines.\n *\n * Two different command line styles are permitted, depending on the\n * compile-time switch TWO_FILE_COMMANDLINE:\n *      djpeg [options]  inputfile outputfile\n *      djpeg [options]  [inputfile]\n * In the second style, output is always to standard output, which you'd\n * normally redirect to a file or pipe to some other program.  Input is\n * either from a named file or from standard input (typically redirected).\n * The second style is convenient on Unix but is unhelpful on systems that\n * don't support pipes.  Also, you MUST use the first style if your system\n * doesn't do binary I/O to stdin/stdout.\n * To simplify script writing, the \"-outfile\" switch is provided.  The syntax\n *      djpeg [options]  -outfile outputfile  inputfile\n * works regardless of which command line style is used.\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n#include \"jversion.h\"           /* for version message */\n#include \"jconfigint.h\"\n#include \"wrppm.h\"\n\n#include <ctype.h>              /* to declare isprint() */\n\n#ifdef USE_CCOMMAND             /* command-line reader for Macintosh */\n#ifdef __MWERKS__\n#include <SIOUX.h>              /* Metrowerks needs this */\n#include <console.h>            /* ... and this */\n#endif\n#ifdef THINK_C\n#include <console.h>            /* Think declares it here */\n#endif\n#endif\n\n\n/* Create the add-on message string table. */\n\n#define JMESSAGE(code,string)   string ,\n\nstatic const char * const cdjpeg_message_table[] = {\n#include \"cderror.h\"\n  NULL\n};\n\n\n/*\n * This list defines the known output image formats\n * (not all of which need be supported by a given version).\n * You can change the default output format by defining DEFAULT_FMT;\n * indeed, you had better do so if you undefine PPM_SUPPORTED.\n */\n\ntypedef enum {\n        FMT_BMP,                /* BMP format (Windows flavor) */\n        FMT_GIF,                /* GIF format */\n        FMT_OS2,                /* BMP format (OS/2 flavor) */\n        FMT_PPM,                /* PPM/PGM (PBMPLUS formats) */\n        FMT_RLE,                /* RLE format */\n        FMT_TARGA,              /* Targa format */\n        FMT_TIFF                /* TIFF format */\n} IMAGE_FORMATS;\n\n#ifndef DEFAULT_FMT             /* so can override from CFLAGS in Makefile */\n#define DEFAULT_FMT     FMT_PPM\n#endif\n\nstatic IMAGE_FORMATS requested_fmt;\n\n\n/*\n * Argument-parsing code.\n * The switch parser is designed to be useful with DOS-style command line\n * syntax, ie, intermixed switches and file names, where only the switches\n * to the left of a given file name affect processing of that file.\n * The main program in this file doesn't actually use this capability...\n */\n\n\nstatic const char *progname;    /* program name for error messages */\nstatic char *outfilename;       /* for -outfile switch */\nboolean memsrc;                 /* for -memsrc switch */\nboolean skip, crop;\nJDIMENSION skip_start, skip_end;\nJDIMENSION crop_x, crop_y, crop_width, crop_height;\n#define INPUT_BUF_SIZE  4096\n\n\nLOCAL(void)\nusage (void)\n/* complain about bad command line */\n{\n  fprintf(stderr, \"usage: %s [switches] \", progname);\n#ifdef TWO_FILE_COMMANDLINE\n  fprintf(stderr, \"inputfile outputfile\\n\");\n#else\n  fprintf(stderr, \"[inputfile]\\n\");\n#endif\n\n  fprintf(stderr, \"Switches (names may be abbreviated):\\n\");\n  fprintf(stderr, \"  -colors N      Reduce image to no more than N colors\\n\");\n  fprintf(stderr, \"  -fast          Fast, low-quality processing\\n\");\n  fprintf(stderr, \"  -grayscale     Force grayscale output\\n\");\n  fprintf(stderr, \"  -rgb           Force RGB output\\n\");\n  fprintf(stderr, \"  -rgb565        Force RGB565 output\\n\");\n#ifdef IDCT_SCALING_SUPPORTED\n  fprintf(stderr, \"  -scale M/N     Scale output image by fraction M/N, eg, 1/8\\n\");\n#endif\n#ifdef BMP_SUPPORTED\n  fprintf(stderr, \"  -bmp           Select BMP output format (Windows style)%s\\n\",\n          (DEFAULT_FMT == FMT_BMP ? \" (default)\" : \"\"));\n#endif\n#ifdef GIF_SUPPORTED\n  fprintf(stderr, \"  -gif           Select GIF output format%s\\n\",\n          (DEFAULT_FMT == FMT_GIF ? \" (default)\" : \"\"));\n#endif\n#ifdef BMP_SUPPORTED\n  fprintf(stderr, \"  -os2           Select BMP output format (OS/2 style)%s\\n\",\n          (DEFAULT_FMT == FMT_OS2 ? \" (default)\" : \"\"));\n#endif\n#ifdef PPM_SUPPORTED\n  fprintf(stderr, \"  -pnm           Select PBMPLUS (PPM/PGM) output format%s\\n\",\n          (DEFAULT_FMT == FMT_PPM ? \" (default)\" : \"\"));\n#endif\n#ifdef RLE_SUPPORTED\n  fprintf(stderr, \"  -rle           Select Utah RLE output format%s\\n\",\n          (DEFAULT_FMT == FMT_RLE ? \" (default)\" : \"\"));\n#endif\n#ifdef TARGA_SUPPORTED\n  fprintf(stderr, \"  -targa         Select Targa output format%s\\n\",\n          (DEFAULT_FMT == FMT_TARGA ? \" (default)\" : \"\"));\n#endif\n  fprintf(stderr, \"Switches for advanced users:\\n\");\n#ifdef DCT_ISLOW_SUPPORTED\n  fprintf(stderr, \"  -dct int       Use integer DCT method%s\\n\",\n          (JDCT_DEFAULT == JDCT_ISLOW ? \" (default)\" : \"\"));\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n  fprintf(stderr, \"  -dct fast      Use fast integer DCT (less accurate)%s\\n\",\n          (JDCT_DEFAULT == JDCT_IFAST ? \" (default)\" : \"\"));\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n  fprintf(stderr, \"  -dct float     Use floating-point DCT method%s\\n\",\n          (JDCT_DEFAULT == JDCT_FLOAT ? \" (default)\" : \"\"));\n#endif\n  fprintf(stderr, \"  -dither fs     Use F-S dithering (default)\\n\");\n  fprintf(stderr, \"  -dither none   Don't use dithering in quantization\\n\");\n  fprintf(stderr, \"  -dither ordered  Use ordered dither (medium speed, quality)\\n\");\n#ifdef QUANT_2PASS_SUPPORTED\n  fprintf(stderr, \"  -map FILE      Map to colors used in named image file\\n\");\n#endif\n  fprintf(stderr, \"  -nosmooth      Don't use high-quality upsampling\\n\");\n#ifdef QUANT_1PASS_SUPPORTED\n  fprintf(stderr, \"  -onepass       Use 1-pass quantization (fast, low quality)\\n\");\n#endif\n  fprintf(stderr, \"  -maxmemory N   Maximum memory to use (in kbytes)\\n\");\n  fprintf(stderr, \"  -outfile name  Specify name for output file\\n\");\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n  fprintf(stderr, \"  -memsrc        Load input file into memory before decompressing\\n\");\n#endif\n\n  fprintf(stderr, \"  -skip Y0,Y1    Decompress all rows except those between Y0 and Y1 (inclusive)\\n\");\n  fprintf(stderr, \"  -crop WxH+X+Y  Decompress only a rectangular subregion of the image\\n\");\n  fprintf(stderr, \"  -verbose  or  -debug   Emit debug output\\n\");\n  fprintf(stderr, \"  -version       Print version information and exit\\n\");\n  exit(EXIT_FAILURE);\n}\n\n\nLOCAL(int)\nparse_switches (j_decompress_ptr cinfo, int argc, char **argv,\n                int last_file_arg_seen, boolean for_real)\n/* Parse optional switches.\n * Returns argv[] index of first file-name argument (== argc if none).\n * Any file names with indexes <= last_file_arg_seen are ignored;\n * they have presumably been processed in a previous iteration.\n * (Pass 0 for last_file_arg_seen on the first or only iteration.)\n * for_real is FALSE on the first (dummy) pass; we may skip any expensive\n * processing.\n */\n{\n  int argn;\n  char *arg;\n\n  /* Set up default JPEG parameters. */\n  requested_fmt = DEFAULT_FMT;  /* set default output file format */\n  outfilename = NULL;\n  memsrc = FALSE;\n  skip = FALSE;\n  crop = FALSE;\n  cinfo->err->trace_level = 0;\n\n  /* Scan command line options, adjust parameters */\n\n  for (argn = 1; argn < argc; argn++) {\n    arg = argv[argn];\n    if (*arg != '-') {\n      /* Not a switch, must be a file name argument */\n      if (argn <= last_file_arg_seen) {\n        outfilename = NULL;     /* -outfile applies to just one input file */\n        continue;               /* ignore this name if previously processed */\n      }\n      break;                    /* else done parsing switches */\n    }\n    arg++;                      /* advance past switch marker character */\n\n    if (keymatch(arg, \"bmp\", 1)) {\n      /* BMP output format. */\n      requested_fmt = FMT_BMP;\n\n    } else if (keymatch(arg, \"colors\", 1) || keymatch(arg, \"colours\", 1) ||\n               keymatch(arg, \"quantize\", 1) || keymatch(arg, \"quantise\", 1)) {\n      /* Do color quantization. */\n      int val;\n\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (sscanf(argv[argn], \"%d\", &val) != 1)\n        usage();\n      cinfo->desired_number_of_colors = val;\n      cinfo->quantize_colors = TRUE;\n\n    } else if (keymatch(arg, \"dct\", 2)) {\n      /* Select IDCT algorithm. */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (keymatch(argv[argn], \"int\", 1)) {\n        cinfo->dct_method = JDCT_ISLOW;\n      } else if (keymatch(argv[argn], \"fast\", 2)) {\n        cinfo->dct_method = JDCT_IFAST;\n      } else if (keymatch(argv[argn], \"float\", 2)) {\n        cinfo->dct_method = JDCT_FLOAT;\n      } else\n        usage();\n\n    } else if (keymatch(arg, \"dither\", 2)) {\n      /* Select dithering algorithm. */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (keymatch(argv[argn], \"fs\", 2)) {\n        cinfo->dither_mode = JDITHER_FS;\n      } else if (keymatch(argv[argn], \"none\", 2)) {\n        cinfo->dither_mode = JDITHER_NONE;\n      } else if (keymatch(argv[argn], \"ordered\", 2)) {\n        cinfo->dither_mode = JDITHER_ORDERED;\n      } else\n        usage();\n\n    } else if (keymatch(arg, \"debug\", 1) || keymatch(arg, \"verbose\", 1)) {\n      /* Enable debug printouts. */\n      /* On first -d, print version identification */\n      static boolean printed_version = FALSE;\n\n      if (! printed_version) {\n        fprintf(stderr, \"%s version %s (build %s)\\n\",\n                PACKAGE_NAME, VERSION, BUILD);\n        fprintf(stderr, \"%s\\n\\n\", JCOPYRIGHT);\n        fprintf(stderr, \"Emulating The Independent JPEG Group's software, version %s\\n\\n\",\n                JVERSION);\n        printed_version = TRUE;\n      }\n      cinfo->err->trace_level++;\n\n    } else if (keymatch(arg, \"version\", 4)) {\n      fprintf(stderr, \"%s version %s (build %s)\\n\",\n              PACKAGE_NAME, VERSION, BUILD);\n      exit(EXIT_SUCCESS);\n\n    } else if (keymatch(arg, \"fast\", 1)) {\n      /* Select recommended processing options for quick-and-dirty output. */\n      cinfo->two_pass_quantize = FALSE;\n      cinfo->dither_mode = JDITHER_ORDERED;\n      if (! cinfo->quantize_colors) /* don't override an earlier -colors */\n        cinfo->desired_number_of_colors = 216;\n      cinfo->dct_method = JDCT_FASTEST;\n      cinfo->do_fancy_upsampling = FALSE;\n\n    } else if (keymatch(arg, \"gif\", 1)) {\n      /* GIF output format. */\n      requested_fmt = FMT_GIF;\n\n    } else if (keymatch(arg, \"grayscale\", 2) || keymatch(arg, \"greyscale\",2)) {\n      /* Force monochrome output. */\n      cinfo->out_color_space = JCS_GRAYSCALE;\n\n    } else if (keymatch(arg, \"rgb\", 2)) {\n      /* Force RGB output. */\n      cinfo->out_color_space = JCS_RGB;\n\n    } else if (keymatch(arg, \"rgb565\", 2)) {\n      /* Force RGB565 output. */\n      cinfo->out_color_space = JCS_RGB565;\n\n    } else if (keymatch(arg, \"map\", 3)) {\n      /* Quantize to a color map taken from an input file. */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (for_real) {           /* too expensive to do twice! */\n#ifdef QUANT_2PASS_SUPPORTED    /* otherwise can't quantize to supplied map */\n        FILE *mapfile;\n\n        if ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) {\n          fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[argn]);\n          exit(EXIT_FAILURE);\n        }\n        read_color_map(cinfo, mapfile);\n        fclose(mapfile);\n        cinfo->quantize_colors = TRUE;\n#else\n        ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n      }\n\n    } else if (keymatch(arg, \"maxmemory\", 3)) {\n      /* Maximum memory in Kb (or Mb with 'm'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n        usage();\n      if (ch == 'm' || ch == 'M')\n        lval *= 1000L;\n      cinfo->mem->max_memory_to_use = lval * 1000L;\n\n    } else if (keymatch(arg, \"nosmooth\", 3)) {\n      /* Suppress fancy upsampling */\n      cinfo->do_fancy_upsampling = FALSE;\n\n    } else if (keymatch(arg, \"onepass\", 3)) {\n      /* Use fast one-pass quantization. */\n      cinfo->two_pass_quantize = FALSE;\n\n    } else if (keymatch(arg, \"os2\", 3)) {\n      /* BMP output format (OS/2 flavor). */\n      requested_fmt = FMT_OS2;\n\n    } else if (keymatch(arg, \"outfile\", 4)) {\n      /* Set output file name. */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      outfilename = argv[argn]; /* save it away for later use */\n\n    } else if (keymatch(arg, \"memsrc\", 2)) {\n      /* Use in-memory source manager */\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n      memsrc = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, in-memory source manager was not compiled in\\n\",\n              progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"pnm\", 1) || keymatch(arg, \"ppm\", 1)) {\n      /* PPM/PGM output format. */\n      requested_fmt = FMT_PPM;\n\n    } else if (keymatch(arg, \"rle\", 1)) {\n      /* RLE output format. */\n      requested_fmt = FMT_RLE;\n\n    } else if (keymatch(arg, \"scale\", 2)) {\n      /* Scale the output image by a fraction M/N. */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (sscanf(argv[argn], \"%u/%u\",\n                 &cinfo->scale_num, &cinfo->scale_denom) != 2)\n        usage();\n\n    } else if (keymatch(arg, \"skip\", 2)) {\n      if (++argn >= argc)\n        usage();\n      if (sscanf(argv[argn], \"%u,%u\", &skip_start, &skip_end) != 2 ||\n          skip_start > skip_end)\n        usage();\n      skip = TRUE;\n\n    } else if (keymatch(arg, \"crop\", 2)) {\n      char c;\n      if (++argn >= argc)\n        usage();\n      if (sscanf(argv[argn], \"%u%c%u+%u+%u\", &crop_width, &c, &crop_height,\n                 &crop_x, &crop_y) != 5 ||\n          (c != 'X' && c != 'x') || crop_width < 1 || crop_height < 1)\n        usage();\n      crop = TRUE;\n\n    } else if (keymatch(arg, \"targa\", 1)) {\n      /* Targa output format. */\n      requested_fmt = FMT_TARGA;\n\n    } else {\n      usage();                  /* bogus switch */\n    }\n  }\n\n  return argn;                  /* return index of next arg (file name) */\n}\n\n\n/*\n * Marker processor for COM and interesting APPn markers.\n * This replaces the library's built-in processor, which just skips the marker.\n * We want to print out the marker as text, to the extent possible.\n * Note this code relies on a non-suspending data source.\n */\n\nLOCAL(unsigned int)\njpeg_getc (j_decompress_ptr cinfo)\n/* Read next byte */\n{\n  struct jpeg_source_mgr *datasrc = cinfo->src;\n\n  if (datasrc->bytes_in_buffer == 0) {\n    if (! (*datasrc->fill_input_buffer) (cinfo))\n      ERREXIT(cinfo, JERR_CANT_SUSPEND);\n  }\n  datasrc->bytes_in_buffer--;\n  return GETJOCTET(*datasrc->next_input_byte++);\n}\n\n\nMETHODDEF(boolean)\nprint_text_marker (j_decompress_ptr cinfo)\n{\n  boolean traceit = (cinfo->err->trace_level >= 1);\n  long length;\n  unsigned int ch;\n  unsigned int lastch = 0;\n\n  length = jpeg_getc(cinfo) << 8;\n  length += jpeg_getc(cinfo);\n  length -= 2;                  /* discount the length word itself */\n\n  if (traceit) {\n    if (cinfo->unread_marker == JPEG_COM)\n      fprintf(stderr, \"Comment, length %ld:\\n\", (long) length);\n    else                        /* assume it is an APPn otherwise */\n      fprintf(stderr, \"APP%d, length %ld:\\n\",\n              cinfo->unread_marker - JPEG_APP0, (long) length);\n  }\n\n  while (--length >= 0) {\n    ch = jpeg_getc(cinfo);\n    if (traceit) {\n      /* Emit the character in a readable form.\n       * Nonprintables are converted to \\nnn form,\n       * while \\ is converted to \\\\.\n       * Newlines in CR, CR/LF, or LF form will be printed as one newline.\n       */\n      if (ch == '\\r') {\n        fprintf(stderr, \"\\n\");\n      } else if (ch == '\\n') {\n        if (lastch != '\\r')\n          fprintf(stderr, \"\\n\");\n      } else if (ch == '\\\\') {\n        fprintf(stderr, \"\\\\\\\\\");\n      } else if (isprint(ch)) {\n        putc(ch, stderr);\n      } else {\n        fprintf(stderr, \"\\\\%03o\", ch);\n      }\n      lastch = ch;\n    }\n  }\n\n  if (traceit)\n    fprintf(stderr, \"\\n\");\n\n  return TRUE;\n}\n\n\n/*\n * The main program.\n */\n\nint\nmain (int argc, char **argv)\n{\n  struct jpeg_decompress_struct cinfo;\n  struct jpeg_error_mgr jerr;\n#ifdef PROGRESS_REPORT\n  struct cdjpeg_progress_mgr progress;\n#endif\n  int file_index;\n  djpeg_dest_ptr dest_mgr = NULL;\n  FILE *input_file;\n  FILE *output_file;\n  unsigned char *inbuffer = NULL;\n  unsigned long insize = 0;\n  JDIMENSION num_scanlines;\n\n  /* On Mac, fetch a command line. */\n#ifdef USE_CCOMMAND\n  argc = ccommand(&argv);\n#endif\n\n  progname = argv[0];\n  if (progname == NULL || progname[0] == 0)\n    progname = \"djpeg\";         /* in case C library doesn't provide it */\n\n  /* Initialize the JPEG decompression object with default error handling. */\n  cinfo.err = jpeg_std_error(&jerr);\n  jpeg_create_decompress(&cinfo);\n  /* Add some application-specific error messages (from cderror.h) */\n  jerr.addon_message_table = cdjpeg_message_table;\n  jerr.first_addon_message = JMSG_FIRSTADDONCODE;\n  jerr.last_addon_message = JMSG_LASTADDONCODE;\n\n  /* Insert custom marker processor for COM and APP12.\n   * APP12 is used by some digital camera makers for textual info,\n   * so we provide the ability to display it as text.\n   * If you like, additional APPn marker types can be selected for display,\n   * but don't try to override APP0 or APP14 this way (see libjpeg.txt).\n   */\n  jpeg_set_marker_processor(&cinfo, JPEG_COM, print_text_marker);\n  jpeg_set_marker_processor(&cinfo, JPEG_APP0+12, print_text_marker);\n\n  /* Scan command line to find file names. */\n  /* It is convenient to use just one switch-parsing routine, but the switch\n   * values read here are ignored; we will rescan the switches after opening\n   * the input file.\n   * (Exception: tracing level set here controls verbosity for COM markers\n   * found during jpeg_read_header...)\n   */\n\n  file_index = parse_switches(&cinfo, argc, argv, 0, FALSE);\n\n#ifdef TWO_FILE_COMMANDLINE\n  /* Must have either -outfile switch or explicit output file name */\n  if (outfilename == NULL) {\n    if (file_index != argc-2) {\n      fprintf(stderr, \"%s: must name one input and one output file\\n\",\n              progname);\n      usage();\n    }\n    outfilename = argv[file_index+1];\n  } else {\n    if (file_index != argc-1) {\n      fprintf(stderr, \"%s: must name one input and one output file\\n\",\n              progname);\n      usage();\n    }\n  }\n#else\n  /* Unix style: expect zero or one file name */\n  if (file_index < argc-1) {\n    fprintf(stderr, \"%s: only one input file\\n\", progname);\n    usage();\n  }\n#endif /* TWO_FILE_COMMANDLINE */\n\n  /* Open the input file. */\n  if (file_index < argc) {\n    if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[file_index]);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default input file is stdin */\n    input_file = read_stdin();\n  }\n\n  /* Open the output file. */\n  if (outfilename != NULL) {\n    if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, outfilename);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default output file is stdout */\n    output_file = write_stdout();\n  }\n\n#ifdef PROGRESS_REPORT\n  start_progress_monitor((j_common_ptr) &cinfo, &progress);\n#endif\n\n  /* Specify data source for decompression */\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n  if (memsrc) {\n    size_t nbytes;\n    do {\n      inbuffer = (unsigned char *)realloc(inbuffer, insize + INPUT_BUF_SIZE);\n      if (inbuffer == NULL) {\n        fprintf(stderr, \"%s: memory allocation failure\\n\", progname);\n        exit(EXIT_FAILURE);\n      }\n      nbytes = JFREAD(input_file, &inbuffer[insize], INPUT_BUF_SIZE);\n      if (nbytes < INPUT_BUF_SIZE && ferror(input_file)) {\n        if (file_index < argc)\n          fprintf(stderr, \"%s: can't read from %s\\n\", progname,\n                  argv[file_index]);\n        else\n          fprintf(stderr, \"%s: can't read from stdin\\n\", progname);\n      }\n      insize += (unsigned long)nbytes;\n    } while (nbytes == INPUT_BUF_SIZE);\n    fprintf(stderr, \"Compressed size:  %lu bytes\\n\", insize);\n    jpeg_mem_src(&cinfo, inbuffer, insize);\n  } else\n#endif\n    jpeg_stdio_src(&cinfo, input_file);\n\n  /* Read file header, set default decompression parameters */\n  (void) jpeg_read_header(&cinfo, TRUE);\n\n  /* Adjust default decompression parameters by re-parsing the options */\n  file_index = parse_switches(&cinfo, argc, argv, 0, TRUE);\n\n  /* Initialize the output module now to let it override any crucial\n   * option settings (for instance, GIF wants to force color quantization).\n   */\n  switch (requested_fmt) {\n#ifdef BMP_SUPPORTED\n  case FMT_BMP:\n    dest_mgr = jinit_write_bmp(&cinfo, FALSE);\n    break;\n  case FMT_OS2:\n    dest_mgr = jinit_write_bmp(&cinfo, TRUE);\n    break;\n#endif\n#ifdef GIF_SUPPORTED\n  case FMT_GIF:\n    dest_mgr = jinit_write_gif(&cinfo);\n    break;\n#endif\n#ifdef PPM_SUPPORTED\n  case FMT_PPM:\n    dest_mgr = jinit_write_ppm(&cinfo);\n    break;\n#endif\n#ifdef RLE_SUPPORTED\n  case FMT_RLE:\n    dest_mgr = jinit_write_rle(&cinfo);\n    break;\n#endif\n#ifdef TARGA_SUPPORTED\n  case FMT_TARGA:\n    dest_mgr = jinit_write_targa(&cinfo);\n    break;\n#endif\n  default:\n    ERREXIT(&cinfo, JERR_UNSUPPORTED_FORMAT);\n    break;\n  }\n  dest_mgr->output_file = output_file;\n\n  /* Start decompressor */\n  (void) jpeg_start_decompress(&cinfo);\n\n  /* Skip rows */\n  if (skip) {\n    JDIMENSION tmp;\n\n    /* Check for valid skip_end.  We cannot check this value until after\n     * jpeg_start_decompress() is called.  Note that we have already verified\n     * that skip_start <= skip_end.\n     */\n    if (skip_end > cinfo.output_height - 1) {\n      fprintf(stderr, \"%s: skip region exceeds image height %d\\n\", progname,\n              cinfo.output_height);\n      exit(EXIT_FAILURE);\n    }\n\n    /* Write output file header.  This is a hack to ensure that the destination\n     * manager creates an output image of the proper size.\n     */\n    tmp = cinfo.output_height;\n    cinfo.output_height -= (skip_end - skip_start + 1);\n    (*dest_mgr->start_output) (&cinfo, dest_mgr);\n    cinfo.output_height = tmp;\n\n    /* Process data */\n    while (cinfo.output_scanline < skip_start) {\n      num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,\n                                          dest_mgr->buffer_height);\n      (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);\n    }\n    jpeg_skip_scanlines(&cinfo, skip_end - skip_start + 1);\n    while (cinfo.output_scanline < cinfo.output_height) {\n      num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,\n                                          dest_mgr->buffer_height);\n      (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);\n    }\n\n  /* Decompress a subregion */\n  } else if (crop) {\n    JDIMENSION tmp;\n\n    /* Check for valid crop dimensions.  We cannot check these values until\n     * after jpeg_start_decompress() is called.\n     */\n    if (crop_x + crop_width > cinfo.output_width ||\n        crop_y + crop_height > cinfo.output_height) {\n      fprintf(stderr, \"%s: crop dimensions exceed image dimensions %d x %d\\n\",\n              progname, cinfo.output_width, cinfo.output_height);\n      exit(EXIT_FAILURE);\n    }\n\n    jpeg_crop_scanline(&cinfo, &crop_x, &crop_width);\n    ((ppm_dest_ptr) dest_mgr)->buffer_width = cinfo.output_width *\n                                              cinfo.out_color_components *\n                                              sizeof(JSAMPLE);\n\n    /* Write output file header.  This is a hack to ensure that the destination\n     * manager creates an output image of the proper size.\n     */\n    tmp = cinfo.output_height;\n    cinfo.output_height = crop_height;\n    (*dest_mgr->start_output) (&cinfo, dest_mgr);\n    cinfo.output_height = tmp;\n\n    /* Process data */\n    jpeg_skip_scanlines(&cinfo, crop_y);\n    while (cinfo.output_scanline < crop_y + crop_height) {\n      num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,\n                                          dest_mgr->buffer_height);\n      (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);\n    }\n    jpeg_skip_scanlines(&cinfo, cinfo.output_height - crop_y - crop_height);\n\n  /* Normal full-image decompress */\n  } else {\n    /* Write output file header */\n    (*dest_mgr->start_output) (&cinfo, dest_mgr);\n\n    /* Process data */\n    while (cinfo.output_scanline < cinfo.output_height) {\n      num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,\n                                          dest_mgr->buffer_height);\n      (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);\n    }\n  }\n\n#ifdef PROGRESS_REPORT\n  /* Hack: count final pass as done in case finish_output does an extra pass.\n   * The library won't have updated completed_passes.\n   */\n  progress.pub.completed_passes = progress.pub.total_passes;\n#endif\n\n  /* Finish decompression and release memory.\n   * I must do it in this order because output module has allocated memory\n   * of lifespan JPOOL_IMAGE; it needs to finish before releasing memory.\n   */\n  (*dest_mgr->finish_output) (&cinfo, dest_mgr);\n  (void) jpeg_finish_decompress(&cinfo);\n  jpeg_destroy_decompress(&cinfo);\n\n  /* Close files, if we opened them */\n  if (input_file != stdin)\n    fclose(input_file);\n  if (output_file != stdout)\n    fclose(output_file);\n\n#ifdef PROGRESS_REPORT\n  end_progress_monitor((j_common_ptr) &cinfo);\n#endif\n\n  if (memsrc && inbuffer != NULL)\n    free(inbuffer);\n\n  /* All done. */\n  exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);\n  return 0;                     /* suppress no-return-value warnings */\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/annotated.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\"/>\n<title>TurboJPEG: Data Structures</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n  $(document).ready(function() { searchBox.OnSelectItem(0); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n<link href=\"doxygen-extra.css\" rel=\"stylesheet\" type=\"text/css\"/>\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n  <td style=\"padding-left: 0.5em;\">\n   <div id=\"projectname\">TurboJPEG\n   &#160;<span id=\"projectnumber\">1.5</span>\n   </div>\n  </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.3.1 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n  <div id=\"navrow1\" class=\"tabs\">\n    <ul class=\"tablist\">\n      <li><a href=\"index.html\"><span>Main&#160;Page</span></a></li>\n      <li><a href=\"modules.html\"><span>Modules</span></a></li>\n      <li class=\"current\"><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li>\n        <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n        <span class=\"left\">\n          <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n               onmouseover=\"return searchBox.OnSearchSelectShow()\"\n               onmouseout=\"return searchBox.OnSearchSelectHide()\"\n               alt=\"\"/>\n          <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n               onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n               onblur=\"searchBox.OnSearchFieldFocus(false)\" \n               onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n          </span><span class=\"right\">\n            <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n          </span>\n        </div>\n      </li>\n    </ul>\n  </div>\n  <div id=\"navrow2\" class=\"tabs2\">\n    <ul class=\"tablist\">\n      <li class=\"current\"><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li><a href=\"classes.html\"><span>Data&#160;Structure&#160;Index</span></a></li>\n      <li><a href=\"functions.html\"><span>Data&#160;Fields</span></a></li>\n    </ul>\n  </div>\n</div><!-- top -->\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n     onmouseover=\"return searchBox.OnSearchSelectShow()\"\n     onmouseout=\"return searchBox.OnSearchSelectHide()\"\n     onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n<a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(0)\"><span class=\"SelectionMark\">&#160;</span>All</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(1)\"><span class=\"SelectionMark\">&#160;</span>Data Structures</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(2)\"><span class=\"SelectionMark\">&#160;</span>Functions</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(3)\"><span class=\"SelectionMark\">&#160;</span>Variables</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(4)\"><span class=\"SelectionMark\">&#160;</span>Typedefs</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(5)\"><span class=\"SelectionMark\">&#160;</span>Enumerations</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(6)\"><span class=\"SelectionMark\">&#160;</span>Enumerator</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(7)\"><span class=\"SelectionMark\">&#160;</span>Groups</a></div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n        name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div class=\"header\">\n  <div class=\"headertitle\">\n<div class=\"title\">Data Structures</div>  </div>\n</div><!--header-->\n<div class=\"contents\">\n<div class=\"textblock\">Here are the data structures with brief descriptions:</div><div class=\"directory\">\n<table class=\"directory\">\n<tr id=\"row_0_\" class=\"even\"><td class=\"entry\"><img src=\"ftv2node.png\" alt=\"o\" width=\"16\" height=\"22\" /><img src=\"ftv2cl.png\" alt=\"C\" width=\"24\" height=\"22\" /><a class=\"el\" href=\"structtjregion.html\" target=\"_self\">tjregion</a></td><td class=\"desc\">Cropping region</td></tr>\n<tr id=\"row_1_\"><td class=\"entry\"><img src=\"ftv2node.png\" alt=\"o\" width=\"16\" height=\"22\" /><img src=\"ftv2cl.png\" alt=\"C\" width=\"24\" height=\"22\" /><a class=\"el\" href=\"structtjscalingfactor.html\" target=\"_self\">tjscalingfactor</a></td><td class=\"desc\">Scaling factor</td></tr>\n<tr id=\"row_2_\" class=\"even\"><td class=\"entry\"><img src=\"ftv2lastnode.png\" alt=\"\\\" width=\"16\" height=\"22\" /><img src=\"ftv2cl.png\" alt=\"C\" width=\"24\" height=\"22\" /><a class=\"el\" href=\"structtjtransform.html\" target=\"_self\">tjtransform</a></td><td class=\"desc\">Lossless transform</td></tr>\n</table>\n</div><!-- directory -->\n</div><!-- contents -->\n<!-- start footer part -->\n<hr class=\"footer\"/><address class=\"footer\"><small>\nGenerated by &#160;<a href=\"http://www.doxygen.org/index.html\">\n<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/>\n</a> 1.8.3.1\n</small></address>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/classes.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\"/>\n<title>TurboJPEG: Data Structure Index</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n  $(document).ready(function() { searchBox.OnSelectItem(0); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n<link href=\"doxygen-extra.css\" rel=\"stylesheet\" type=\"text/css\"/>\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n  <td style=\"padding-left: 0.5em;\">\n   <div id=\"projectname\">TurboJPEG\n   &#160;<span id=\"projectnumber\">1.5</span>\n   </div>\n  </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.3.1 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n  <div id=\"navrow1\" class=\"tabs\">\n    <ul class=\"tablist\">\n      <li><a href=\"index.html\"><span>Main&#160;Page</span></a></li>\n      <li><a href=\"modules.html\"><span>Modules</span></a></li>\n      <li class=\"current\"><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li>\n        <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n        <span class=\"left\">\n          <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n               onmouseover=\"return searchBox.OnSearchSelectShow()\"\n               onmouseout=\"return searchBox.OnSearchSelectHide()\"\n               alt=\"\"/>\n          <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n               onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n               onblur=\"searchBox.OnSearchFieldFocus(false)\" \n               onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n          </span><span class=\"right\">\n            <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n          </span>\n        </div>\n      </li>\n    </ul>\n  </div>\n  <div id=\"navrow2\" class=\"tabs2\">\n    <ul class=\"tablist\">\n      <li><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li class=\"current\"><a href=\"classes.html\"><span>Data&#160;Structure&#160;Index</span></a></li>\n      <li><a href=\"functions.html\"><span>Data&#160;Fields</span></a></li>\n    </ul>\n  </div>\n</div><!-- top -->\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n     onmouseover=\"return searchBox.OnSearchSelectShow()\"\n     onmouseout=\"return searchBox.OnSearchSelectHide()\"\n     onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n<a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(0)\"><span class=\"SelectionMark\">&#160;</span>All</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(1)\"><span class=\"SelectionMark\">&#160;</span>Data Structures</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(2)\"><span class=\"SelectionMark\">&#160;</span>Functions</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(3)\"><span class=\"SelectionMark\">&#160;</span>Variables</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(4)\"><span class=\"SelectionMark\">&#160;</span>Typedefs</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(5)\"><span class=\"SelectionMark\">&#160;</span>Enumerations</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(6)\"><span class=\"SelectionMark\">&#160;</span>Enumerator</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(7)\"><span class=\"SelectionMark\">&#160;</span>Groups</a></div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n        name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div class=\"header\">\n  <div class=\"headertitle\">\n<div class=\"title\">Data Structure Index</div>  </div>\n</div><!--header-->\n<div class=\"contents\">\n<div class=\"qindex\"><a class=\"qindex\" href=\"#letter_T\">T</a></div>\n<table style=\"margin: 10px; white-space: nowrap;\" align=\"center\" width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr><td rowspan=\"2\" valign=\"bottom\"><a name=\"letter_T\"></a><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><div class=\"ah\">&#160;&#160;T&#160;&#160;</div></td></tr></table>\n</td><td valign=\"top\"><a class=\"el\" href=\"structtjscalingfactor.html\">tjscalingfactor</a>&#160;&#160;&#160;</td><td valign=\"top\"><a class=\"el\" href=\"structtjtransform.html\">tjtransform</a>&#160;&#160;&#160;</td><td></td></tr>\n<tr><td></td><td></td><td></td></tr>\n<tr><td valign=\"top\"><a class=\"el\" href=\"structtjregion.html\">tjregion</a>&#160;&#160;&#160;</td><td></td><td></td><td></td></tr>\n<tr><td></td><td></td><td></td><td></td></tr>\n</table>\n<div class=\"qindex\"><a class=\"qindex\" href=\"#letter_T\">T</a></div>\n</div><!-- contents -->\n<!-- start footer part -->\n<hr class=\"footer\"/><address class=\"footer\"><small>\nGenerated by &#160;<a href=\"http://www.doxygen.org/index.html\">\n<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/>\n</a> 1.8.3.1\n</small></address>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/doxygen-extra.css",
    "content": "code {\n\tcolor: #4665A2; \n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/doxygen.css",
    "content": "/* The standard CSS for doxygen 1.8.3.1 */\n\nbody, table, div, p, dl {\n\tfont: 400 14px/19px Roboto,sans-serif;\n}\n\n/* @group Heading Levels */\n\nh1.groupheader {\n\tfont-size: 150%;\n}\n\n.title {\n\tfont-size: 150%;\n\tfont-weight: bold;\n\tmargin: 10px 2px;\n}\n\nh2.groupheader {\n\tborder-bottom: 1px solid #879ECB;\n\tcolor: #354C7B;\n\tfont-size: 150%;\n\tfont-weight: normal;\n\tmargin-top: 1.75em;\n\tpadding-top: 8px;\n\tpadding-bottom: 4px;\n\twidth: 100%;\n}\n\nh3.groupheader {\n\tfont-size: 100%;\n}\n\nh1, h2, h3, h4, h5, h6 {\n\t-webkit-transition: text-shadow 0.5s linear;\n\t-moz-transition: text-shadow 0.5s linear;\n\t-ms-transition: text-shadow 0.5s linear;\n\t-o-transition: text-shadow 0.5s linear;\n\ttransition: text-shadow 0.5s linear;\n\tmargin-right: 15px;\n}\n\nh1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow {\n\ttext-shadow: 0 0 15px cyan;\n}\n\ndt {\n\tfont-weight: bold;\n}\n\ndiv.multicol {\n\t-moz-column-gap: 1em;\n\t-webkit-column-gap: 1em;\n\t-moz-column-count: 3;\n\t-webkit-column-count: 3;\n}\n\np.startli, p.startdd, p.starttd {\n\tmargin-top: 2px;\n}\n\np.endli {\n\tmargin-bottom: 0px;\n}\n\np.enddd {\n\tmargin-bottom: 4px;\n}\n\np.endtd {\n\tmargin-bottom: 2px;\n}\n\n/* @end */\n\ncaption {\n\tfont-weight: bold;\n}\n\nspan.legend {\n        font-size: 70%;\n        text-align: center;\n}\n\nh3.version {\n        font-size: 90%;\n        text-align: center;\n}\n\ndiv.qindex, div.navtab{\n\tbackground-color: #EBEFF6;\n\tborder: 1px solid #A3B4D7;\n\ttext-align: center;\n}\n\ndiv.qindex, div.navpath {\n\twidth: 100%;\n\tline-height: 140%;\n}\n\ndiv.navtab {\n\tmargin-right: 15px;\n}\n\n/* @group Link Styling */\n\na {\n\tcolor: #3D578C;\n\tfont-weight: normal;\n\ttext-decoration: none;\n}\n\n.contents a:visited {\n\tcolor: #4665A2;\n}\n\na:hover {\n\ttext-decoration: underline;\n}\n\na.qindex {\n\tfont-weight: bold;\n}\n\na.qindexHL {\n\tfont-weight: bold;\n\tbackground-color: #9CAFD4;\n\tcolor: #ffffff;\n\tborder: 1px double #869DCA;\n}\n\n.contents a.qindexHL:visited {\n        color: #ffffff;\n}\n\na.el {\n\tfont-weight: bold;\n}\n\na.elRef {\n}\n\na.code, a.code:visited {\n\tcolor: #4665A2; \n}\n\na.codeRef, a.codeRef:visited {\n\tcolor: #4665A2; \n}\n\n/* @end */\n\ndl.el {\n\tmargin-left: -1cm;\n}\n\npre.fragment {\n        border: 1px solid #C4CFE5;\n        background-color: #FBFCFD;\n        padding: 4px 6px;\n        margin: 4px 8px 4px 2px;\n        overflow: auto;\n        word-wrap: break-word;\n        font-size:  9pt;\n        line-height: 125%;\n        font-family: monospace, fixed;\n        font-size: 105%;\n}\n\ndiv.fragment {\n        padding: 4px;\n        margin: 4px;\n\tbackground-color: #FBFCFD;\n\tborder: 1px solid #C4CFE5;\n}\n\ndiv.line {\n\tfont-family: monospace, fixed;\n        font-size: 13px;\n\tmin-height: 13px;\n\tline-height: 1.0;\n\ttext-wrap: unrestricted;\n\twhite-space: -moz-pre-wrap; /* Moz */\n\twhite-space: -pre-wrap;     /* Opera 4-6 */\n\twhite-space: -o-pre-wrap;   /* Opera 7 */\n\twhite-space: pre-wrap;      /* CSS3  */\n\tword-wrap: break-word;      /* IE 5.5+ */\n\ttext-indent: -53px;\n\tpadding-left: 53px;\n\tpadding-bottom: 0px;\n\tmargin: 0px;\n\t-webkit-transition-property: background-color, box-shadow;\n\t-webkit-transition-duration: 0.5s;\n\t-moz-transition-property: background-color, box-shadow;\n\t-moz-transition-duration: 0.5s;\n\t-ms-transition-property: background-color, box-shadow;\n\t-ms-transition-duration: 0.5s;\n\t-o-transition-property: background-color, box-shadow;\n\t-o-transition-duration: 0.5s;\n\ttransition-property: background-color, box-shadow;\n\ttransition-duration: 0.5s;\n}\n\ndiv.line.glow {\n\tbackground-color: cyan;\n\tbox-shadow: 0 0 10px cyan;\n}\n\n\nspan.lineno {\n\tpadding-right: 4px;\n\ttext-align: right;\n\tborder-right: 2px solid #0F0;\n\tbackground-color: #E8E8E8;\n        white-space: pre;\n}\nspan.lineno a {\n\tbackground-color: #D8D8D8;\n}\n\nspan.lineno a:hover {\n\tbackground-color: #C8C8C8;\n}\n\ndiv.ah {\n\tbackground-color: black;\n\tfont-weight: bold;\n\tcolor: #ffffff;\n\tmargin-bottom: 3px;\n\tmargin-top: 3px;\n\tpadding: 0.2em;\n\tborder: solid thin #333;\n\tborder-radius: 0.5em;\n\t-webkit-border-radius: .5em;\n\t-moz-border-radius: .5em;\n\tbox-shadow: 2px 2px 3px #999;\n\t-webkit-box-shadow: 2px 2px 3px #999;\n\t-moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;\n\tbackground-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));\n\tbackground-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);\n}\n\ndiv.groupHeader {\n\tmargin-left: 16px;\n\tmargin-top: 12px;\n\tfont-weight: bold;\n}\n\ndiv.groupText {\n\tmargin-left: 16px;\n\tfont-style: italic;\n}\n\nbody {\n\tbackground-color: white;\n\tcolor: black;\n        margin: 0;\n}\n\ndiv.contents {\n\tmargin-top: 10px;\n\tmargin-left: 12px;\n\tmargin-right: 8px;\n}\n\ntd.indexkey {\n\tbackground-color: #EBEFF6;\n\tfont-weight: bold;\n\tborder: 1px solid #C4CFE5;\n\tmargin: 2px 0px 2px 0;\n\tpadding: 2px 10px;\n        white-space: nowrap;\n        vertical-align: top;\n}\n\ntd.indexvalue {\n\tbackground-color: #EBEFF6;\n\tborder: 1px solid #C4CFE5;\n\tpadding: 2px 10px;\n\tmargin: 2px 0px;\n}\n\ntr.memlist {\n\tbackground-color: #EEF1F7;\n}\n\np.formulaDsp {\n\ttext-align: center;\n}\n\nimg.formulaDsp {\n\t\n}\n\nimg.formulaInl {\n\tvertical-align: middle;\n}\n\ndiv.center {\n\ttext-align: center;\n        margin-top: 0px;\n        margin-bottom: 0px;\n        padding: 0px;\n}\n\ndiv.center img {\n\tborder: 0px;\n}\n\naddress.footer {\n\ttext-align: right;\n\tpadding-right: 12px;\n}\n\nimg.footer {\n\tborder: 0px;\n\tvertical-align: middle;\n}\n\n/* @group Code Colorization */\n\nspan.keyword {\n\tcolor: #008000\n}\n\nspan.keywordtype {\n\tcolor: #604020\n}\n\nspan.keywordflow {\n\tcolor: #e08000\n}\n\nspan.comment {\n\tcolor: #800000\n}\n\nspan.preprocessor {\n\tcolor: #806020\n}\n\nspan.stringliteral {\n\tcolor: #002080\n}\n\nspan.charliteral {\n\tcolor: #008080\n}\n\nspan.vhdldigit { \n\tcolor: #ff00ff \n}\n\nspan.vhdlchar { \n\tcolor: #000000 \n}\n\nspan.vhdlkeyword { \n\tcolor: #700070 \n}\n\nspan.vhdllogic { \n\tcolor: #ff0000 \n}\n\nblockquote {\n        background-color: #F7F8FB;\n        border-left: 2px solid #9CAFD4;\n        margin: 0 24px 0 4px;\n        padding: 0 12px 0 16px;\n}\n\n/* @end */\n\n/*\n.search {\n\tcolor: #003399;\n\tfont-weight: bold;\n}\n\nform.search {\n\tmargin-bottom: 0px;\n\tmargin-top: 0px;\n}\n\ninput.search {\n\tfont-size: 75%;\n\tcolor: #000080;\n\tfont-weight: normal;\n\tbackground-color: #e8eef2;\n}\n*/\n\ntd.tiny {\n\tfont-size: 75%;\n}\n\n.dirtab {\n\tpadding: 4px;\n\tborder-collapse: collapse;\n\tborder: 1px solid #A3B4D7;\n}\n\nth.dirtab {\n\tbackground: #EBEFF6;\n\tfont-weight: bold;\n}\n\nhr {\n\theight: 0px;\n\tborder: none;\n\tborder-top: 1px solid #4A6AAA;\n}\n\nhr.footer {\n\theight: 1px;\n}\n\n/* @group Member Descriptions */\n\ntable.memberdecls {\n\tborder-spacing: 0px;\n\tpadding: 0px;\n}\n\n.memberdecls td, .fieldtable tr {\n\t-webkit-transition-property: background-color, box-shadow;\n\t-webkit-transition-duration: 0.5s;\n\t-moz-transition-property: background-color, box-shadow;\n\t-moz-transition-duration: 0.5s;\n\t-ms-transition-property: background-color, box-shadow;\n\t-ms-transition-duration: 0.5s;\n\t-o-transition-property: background-color, box-shadow;\n\t-o-transition-duration: 0.5s;\n\ttransition-property: background-color, box-shadow;\n\ttransition-duration: 0.5s;\n}\n\n.memberdecls td.glow, .fieldtable tr.glow {\n\tbackground-color: cyan;\n\tbox-shadow: 0 0 15px cyan;\n}\n\n.mdescLeft, .mdescRight,\n.memItemLeft, .memItemRight,\n.memTemplItemLeft, .memTemplItemRight, .memTemplParams {\n\tbackground-color: #F9FAFC;\n\tborder: none;\n\tmargin: 4px;\n\tpadding: 1px 0 0 8px;\n}\n\n.mdescLeft, .mdescRight {\n\tpadding: 0px 8px 4px 8px;\n\tcolor: #555;\n}\n\n.memSeparator {\n        border-bottom: 1px solid #DEE4F0;\n        line-height: 1px;\n        margin: 0px;\n        padding: 0px;\n}\n\n.memItemLeft, .memTemplItemLeft {\n        white-space: nowrap;\n}\n\n.memItemRight {\n\twidth: 100%;\n}\n\n.memTemplParams {\n\tcolor: #4665A2;\n        white-space: nowrap;\n\tfont-size: 80%;\n}\n\n/* @end */\n\n/* @group Member Details */\n\n/* Styles for detailed member documentation */\n\n.memtemplate {\n\tfont-size: 80%;\n\tcolor: #4665A2;\n\tfont-weight: normal;\n\tmargin-left: 9px;\n}\n\n.memnav {\n\tbackground-color: #EBEFF6;\n\tborder: 1px solid #A3B4D7;\n\ttext-align: center;\n\tmargin: 2px;\n\tmargin-right: 15px;\n\tpadding: 2px;\n}\n\n.mempage {\n\twidth: 100%;\n}\n\n.memitem {\n\tpadding: 0;\n\tmargin-bottom: 10px;\n\tmargin-right: 5px;\n        -webkit-transition: box-shadow 0.5s linear;\n        -moz-transition: box-shadow 0.5s linear;\n        -ms-transition: box-shadow 0.5s linear;\n        -o-transition: box-shadow 0.5s linear;\n        transition: box-shadow 0.5s linear;\n        display: table !important;\n        width: 100%;\n}\n\n.memitem.glow {\n         box-shadow: 0 0 15px cyan;\n}\n\n.memname {\n        font-weight: bold;\n        margin-left: 6px;\n}\n\n.memname td {\n\tvertical-align: bottom;\n}\n\n.memproto, dl.reflist dt {\n        border-top: 1px solid #A8B8D9;\n        border-left: 1px solid #A8B8D9;\n        border-right: 1px solid #A8B8D9;\n        padding: 6px 0px 6px 0px;\n        color: #253555;\n        font-weight: bold;\n        text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);\n        background-image:url('nav_f.png');\n        background-repeat:repeat-x;\n        background-color: #E2E8F2;\n        /* opera specific markup */\n        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);\n        border-top-right-radius: 4px;\n        border-top-left-radius: 4px;\n        /* firefox specific markup */\n        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;\n        -moz-border-radius-topright: 4px;\n        -moz-border-radius-topleft: 4px;\n        /* webkit specific markup */\n        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);\n        -webkit-border-top-right-radius: 4px;\n        -webkit-border-top-left-radius: 4px;\n\n}\n\n.memdoc, dl.reflist dd {\n        border-bottom: 1px solid #A8B8D9;      \n        border-left: 1px solid #A8B8D9;      \n        border-right: 1px solid #A8B8D9; \n        padding: 6px 10px 2px 10px;\n        background-color: #FBFCFD;\n        border-top-width: 0;\n        background-image:url('nav_g.png');\n        background-repeat:repeat-x;\n        background-color: #FFFFFF;\n        /* opera specific markup */\n        border-bottom-left-radius: 4px;\n        border-bottom-right-radius: 4px;\n        box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);\n        /* firefox specific markup */\n        -moz-border-radius-bottomleft: 4px;\n        -moz-border-radius-bottomright: 4px;\n        -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;\n        /* webkit specific markup */\n        -webkit-border-bottom-left-radius: 4px;\n        -webkit-border-bottom-right-radius: 4px;\n        -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);\n}\n\ndl.reflist dt {\n        padding: 5px;\n}\n\ndl.reflist dd {\n        margin: 0px 0px 10px 0px;\n        padding: 5px;\n}\n\n.paramkey {\n\ttext-align: right;\n}\n\n.paramtype {\n\twhite-space: nowrap;\n}\n\n.paramname {\n\tcolor: #602020;\n\twhite-space: nowrap;\n}\n.paramname em {\n\tfont-style: normal;\n}\n.paramname code {\n        line-height: 14px;\n}\n\n.params, .retval, .exception, .tparams {\n        margin-left: 0px;\n        padding-left: 0px;\n}       \n\n.params .paramname, .retval .paramname {\n        font-weight: bold;\n        vertical-align: top;\n}\n        \n.params .paramtype {\n        font-style: italic;\n        vertical-align: top;\n}       \n        \n.params .paramdir {\n        font-family: \"courier new\",courier,monospace;\n        vertical-align: top;\n}\n\ntable.mlabels {\n\tborder-spacing: 0px;\n}\n\ntd.mlabels-left {\n\twidth: 100%;\n\tpadding: 0px;\n}\n\ntd.mlabels-right {\n\tvertical-align: bottom;\n\tpadding: 0px;\n\twhite-space: nowrap;\n}\n\nspan.mlabels {\n        margin-left: 8px;\n}\n\nspan.mlabel {\n        background-color: #728DC1;\n        border-top:1px solid #5373B4;\n        border-left:1px solid #5373B4;\n        border-right:1px solid #C4CFE5;\n        border-bottom:1px solid #C4CFE5;\n\ttext-shadow: none;\n\tcolor: white;\n\tmargin-right: 4px;\n\tpadding: 2px 3px;\n\tborder-radius: 3px;\n\tfont-size: 7pt;\n\twhite-space: nowrap;\n\tvertical-align: middle;\n}\n\n\n\n/* @end */\n\n/* these are for tree view when not used as main index */\n\ndiv.directory {\n        margin: 10px 0px;\n        border-top: 1px solid #A8B8D9;\n        border-bottom: 1px solid #A8B8D9;\n        width: 100%;\n}\n\n.directory table {\n        border-collapse:collapse;\n}\n\n.directory td {\n        margin: 0px;\n        padding: 0px;\n\tvertical-align: top;\n}\n\n.directory td.entry {\n        white-space: nowrap;\n        padding-right: 6px;\n}\n\n.directory td.entry a {\n        outline:none;\n}\n\n.directory td.entry a img {\n        border: none;\n}\n\n.directory td.desc {\n        width: 100%;\n        padding-left: 6px;\n\tpadding-right: 6px;\n\tpadding-top: 3px;\n\tborder-left: 1px solid rgba(0,0,0,0.05);\n}\n\n.directory tr.even {\n\tpadding-left: 6px;\n\tbackground-color: #F7F8FB;\n}\n\n.directory img {\n\tvertical-align: -30%;\n}\n\n.directory .levels {\n        white-space: nowrap;\n        width: 100%;\n        text-align: right;\n        font-size: 9pt;\n}\n\n.directory .levels span {\n        cursor: pointer;\n        padding-left: 2px;\n        padding-right: 2px;\n\tcolor: #3D578C;\n}\n\ndiv.dynheader {\n        margin-top: 8px;\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-khtml-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n}\n\naddress {\n\tfont-style: normal;\n\tcolor: #2A3D61;\n}\n\ntable.doxtable {\n\tborder-collapse:collapse;\n        margin-top: 4px;\n        margin-bottom: 4px;\n}\n\ntable.doxtable td, table.doxtable th {\n\tborder: 1px solid #2D4068;\n\tpadding: 3px 7px 2px;\n}\n\ntable.doxtable th {\n\tbackground-color: #374F7F;\n\tcolor: #FFFFFF;\n\tfont-size: 110%;\n\tpadding-bottom: 4px;\n\tpadding-top: 5px;\n}\n\ntable.fieldtable {\n        /*width: 100%;*/\n        margin-bottom: 10px;\n        border: 1px solid #A8B8D9;\n        border-spacing: 0px;\n        -moz-border-radius: 4px;\n        -webkit-border-radius: 4px;\n        border-radius: 4px;\n        -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;\n        -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);\n        box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);\n}\n\n.fieldtable td, .fieldtable th {\n        padding: 3px 7px 2px;\n}\n\n.fieldtable td.fieldtype, .fieldtable td.fieldname {\n        white-space: nowrap;\n        border-right: 1px solid #A8B8D9;\n        border-bottom: 1px solid #A8B8D9;\n        vertical-align: top;\n}\n\n.fieldtable td.fieldname {\n        padding-top: 5px;\n}\n\n.fieldtable td.fielddoc {\n        border-bottom: 1px solid #A8B8D9;\n        /*width: 100%;*/\n}\n\n.fieldtable td.fielddoc p:first-child {\n        margin-top: 2px;\n}       \n        \n.fieldtable td.fielddoc p:last-child {\n        margin-bottom: 2px;\n}\n\n.fieldtable tr:last-child td {\n        border-bottom: none;\n}\n\n.fieldtable th {\n        background-image:url('nav_f.png');\n        background-repeat:repeat-x;\n        background-color: #E2E8F2;\n        font-size: 90%;\n        color: #253555;\n        padding-bottom: 4px;\n        padding-top: 5px;\n        text-align:left;\n        -moz-border-radius-topleft: 4px;\n        -moz-border-radius-topright: 4px;\n        -webkit-border-top-left-radius: 4px;\n        -webkit-border-top-right-radius: 4px;\n        border-top-left-radius: 4px;\n        border-top-right-radius: 4px;\n        border-bottom: 1px solid #A8B8D9;\n}\n\n\n.tabsearch {\n\ttop: 0px;\n\tleft: 10px;\n\theight: 36px;\n\tbackground-image: url('tab_b.png');\n\tz-index: 101;\n\toverflow: hidden;\n\tfont-size: 13px;\n}\n\n.navpath ul\n{\n\tfont-size: 11px;\n\tbackground-image:url('tab_b.png');\n\tbackground-repeat:repeat-x;\n\tbackground-position: 0 -5px;\n\theight:30px;\n\tline-height:30px;\n\tcolor:#8AA0CC;\n\tborder:solid 1px #C2CDE4;\n\toverflow:hidden;\n\tmargin:0px;\n\tpadding:0px;\n}\n\n.navpath li\n{\n\tlist-style-type:none;\n\tfloat:left;\n\tpadding-left:10px;\n\tpadding-right:15px;\n\tbackground-image:url('bc_s.png');\n\tbackground-repeat:no-repeat;\n\tbackground-position:right;\n\tcolor:#364D7C;\n}\n\n.navpath li.navelem a\n{\n\theight:32px;\n\tdisplay:block;\n\ttext-decoration: none;\n\toutline: none;\n\tcolor: #283A5D;\n\tfont-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;\n\ttext-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);\n\ttext-decoration: none;        \n}\n\n.navpath li.navelem a:hover\n{\n\tcolor:#6884BD;\n}\n\n.navpath li.footer\n{\n        list-style-type:none;\n        float:right;\n        padding-left:10px;\n        padding-right:15px;\n        background-image:none;\n        background-repeat:no-repeat;\n        background-position:right;\n        color:#364D7C;\n        font-size: 8pt;\n}\n\n\ndiv.summary\n{\n\tfloat: right;\n\tfont-size: 8pt;\n\tpadding-right: 5px;\n\twidth: 50%;\n\ttext-align: right;\n}       \n\ndiv.summary a\n{\n\twhite-space: nowrap;\n}\n\ndiv.ingroups\n{\n\tfont-size: 8pt;\n\twidth: 50%;\n\ttext-align: left;\n}\n\ndiv.ingroups a\n{\n\twhite-space: nowrap;\n}\n\ndiv.header\n{\n        background-image:url('nav_h.png');\n        background-repeat:repeat-x;\n\tbackground-color: #F9FAFC;\n\tmargin:  0px;\n\tborder-bottom: 1px solid #C4CFE5;\n}\n\ndiv.headertitle\n{\n\tpadding: 5px 5px 5px 10px;\n}\n\ndl\n{\n        padding: 0 0 0 10px;\n}\n\n/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */\ndl.section\n{\n\tmargin-left: 0px;\n\tpadding-left: 0px;\n}\n\ndl.note\n{\n        margin-left:-7px;\n        padding-left: 3px;\n        border-left:4px solid;\n        border-color: #D0C000;\n}\n\ndl.warning, dl.attention\n{\n        margin-left:-7px;\n        padding-left: 3px;\n        border-left:4px solid;\n        border-color: #FF0000;\n}\n\ndl.pre, dl.post, dl.invariant\n{\n        margin-left:-7px;\n        padding-left: 3px;\n        border-left:4px solid;\n        border-color: #00D000;\n}\n\ndl.deprecated\n{\n        margin-left:-7px;\n        padding-left: 3px;\n        border-left:4px solid;\n        border-color: #505050;\n}\n\ndl.todo\n{\n        margin-left:-7px;\n        padding-left: 3px;\n        border-left:4px solid;\n        border-color: #00C0E0;\n}\n\ndl.test\n{\n        margin-left:-7px;\n        padding-left: 3px;\n        border-left:4px solid;\n        border-color: #3030E0;\n}\n\ndl.bug\n{\n        margin-left:-7px;\n        padding-left: 3px;\n        border-left:4px solid;\n        border-color: #C08050;\n}\n\ndl.section dd {\n\tmargin-bottom: 6px;\n}\n\n\n#projectlogo\n{\n\ttext-align: center;\n\tvertical-align: bottom;\n\tborder-collapse: separate;\n}\n \n#projectlogo img\n{ \n\tborder: 0px none;\n}\n \n#projectname\n{\n\tfont: 300% Tahoma, Arial,sans-serif;\n\tmargin: 0px;\n\tpadding: 2px 0px;\n}\n    \n#projectbrief\n{\n\tfont: 120% Tahoma, Arial,sans-serif;\n\tmargin: 0px;\n\tpadding: 0px;\n}\n\n#projectnumber\n{\n\tfont: 50% Tahoma, Arial,sans-serif;\n\tmargin: 0px;\n\tpadding: 0px;\n}\n\n#titlearea\n{\n\tpadding: 0px;\n\tmargin: 0px;\n\twidth: 100%;\n\tborder-bottom: 1px solid #5373B4;\n}\n\n.image\n{\n        text-align: center;\n}\n\n.dotgraph\n{\n        text-align: center;\n}\n\n.mscgraph\n{\n        text-align: center;\n}\n\n.caption\n{\n\tfont-weight: bold;\n}\n\ndiv.zoom\n{\n\tborder: 1px solid #90A5CE;\n}\n\ndl.citelist {\n        margin-bottom:50px;\n}\n\ndl.citelist dt {\n        color:#334975;\n        float:left;\n        font-weight:bold;\n        margin-right:10px;\n        padding:5px;\n}\n\ndl.citelist dd {\n        margin:2px 0;\n        padding:5px 0;\n}\n\ndiv.toc {\n        padding: 14px 25px;\n        background-color: #F4F6FA;\n        border: 1px solid #D8DFEE;\n        border-radius: 7px 7px 7px 7px;\n        float: right;\n        height: auto;\n        margin: 0 20px 10px 10px;\n        width: 200px;\n}\n\ndiv.toc li {\n        background: url(\"bdwn.png\") no-repeat scroll 0 5px transparent;\n        font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif;\n        margin-top: 5px;\n        padding-left: 10px;\n        padding-top: 2px;\n}\n\ndiv.toc h3 {\n        font: bold 12px/1.2 Arial,FreeSans,sans-serif;\n\tcolor: #4665A2;\n        border-bottom: 0 none;\n        margin: 0;\n}\n\ndiv.toc ul {\n        list-style: none outside none;\n        border: medium none;\n        padding: 0px;\n}       \n\ndiv.toc li.level1 {\n        margin-left: 0px;\n}\n\ndiv.toc li.level2 {\n        margin-left: 15px;\n}\n\ndiv.toc li.level3 {\n        margin-left: 30px;\n}\n\ndiv.toc li.level4 {\n        margin-left: 45px;\n}\n\n.inherit_header {\n        font-weight: bold;\n        color: gray;\n        cursor: pointer;\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-khtml-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n}\n\n.inherit_header td {\n        padding: 6px 0px 2px 5px;\n}\n\n.inherit {\n        display: none;\n}\n\ntr.heading h2 {\n        margin-top: 12px;\n        margin-bottom: 4px;\n}\n\n@media print\n{\n  #top { display: none; }\n  #side-nav { display: none; }\n  #nav-path { display: none; }\n  body { overflow:visible; }\n  h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }\n  .summary { display: none; }\n  .memitem { page-break-inside: avoid; }\n  #doc-content\n  {\n    margin-left:0 !important;\n    height:auto !important;\n    width:auto !important;\n    overflow:inherit;\n    display:inline;\n  }\n}\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/dynsections.js",
    "content": "function toggleVisibility(linkObj)\n{\n var base = $(linkObj).attr('id');\n var summary = $('#'+base+'-summary');\n var content = $('#'+base+'-content');\n var trigger = $('#'+base+'-trigger');\n var src=$(trigger).attr('src');\n if (content.is(':visible')===true) {\n   content.hide();\n   summary.show();\n   $(linkObj).addClass('closed').removeClass('opened');\n   $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');\n } else {\n   content.show();\n   summary.hide();\n   $(linkObj).removeClass('closed').addClass('opened');\n   $(trigger).attr('src',src.substring(0,src.length-10)+'open.png');\n } \n return false;\n}\n\nfunction updateStripes()\n{\n  $('table.directory tr').\n       removeClass('even').filter(':visible:even').addClass('even');\n}\nfunction toggleLevel(level)\n{\n  $('table.directory tr').each(function(){ \n    var l = this.id.split('_').length-1;\n    var i = $('#img'+this.id.substring(3));\n    var a = $('#arr'+this.id.substring(3));\n    if (l<level+1) {\n      i.attr('src','ftv2folderopen.png');\n      a.attr('src','ftv2mnode.png');\n      $(this).show();\n    } else if (l==level+1) {\n      i.attr('src','ftv2folderclosed.png');\n      a.attr('src','ftv2pnode.png');\n      $(this).show();\n    } else {\n      $(this).hide();\n    }\n  });\n  updateStripes();\n}\n\nfunction toggleFolder(id)\n{\n  //The clicked row\n  var currentRow = $('#row_'+id);\n  var currentRowImages = currentRow.find(\"img\");\n\n  //All rows after the clicked row\n  var rows = currentRow.nextAll(\"tr\");\n\n  //Only match elements AFTER this one (can't hide elements before)\n  var childRows = rows.filter(function() {\n    var re = new RegExp('^row_'+id+'\\\\d+_$', \"i\"); //only one sub\n    return this.id.match(re);\n  });\n\n  //First row is visible we are HIDING\n  if (childRows.filter(':first').is(':visible')===true) {\n    currentRowImages.filter(\"[id^=arr]\").attr('src', 'ftv2pnode.png');\n    currentRowImages.filter(\"[id^=img]\").attr('src', 'ftv2folderclosed.png');\n    rows.filter(\"[id^=row_\"+id+\"]\").hide();\n  } else { //We are SHOWING\n    //All sub images\n    var childImages = childRows.find(\"img\");\n    var childImg = childImages.filter(\"[id^=img]\");\n    var childArr = childImages.filter(\"[id^=arr]\");\n\n    currentRow.find(\"[id^=arr]\").attr('src', 'ftv2mnode.png'); //open row\n    currentRow.find(\"[id^=img]\").attr('src', 'ftv2folderopen.png'); //open row\n    childImg.attr('src','ftv2folderclosed.png'); //children closed\n    childArr.attr('src','ftv2pnode.png'); //children closed\n    childRows.show(); //show all children\n  }\n  updateStripes();\n}\n\n\nfunction toggleInherit(id)\n{\n  var rows = $('tr.inherit.'+id);\n  var img = $('tr.inherit_header.'+id+' img');\n  var src = $(img).attr('src');\n  if (rows.filter(':first').is(':visible')===true) {\n    rows.css('display','none');\n    $(img).attr('src',src.substring(0,src.length-8)+'closed.png');\n  } else {\n    rows.css('display','table-row'); // using show() causes jump in firefox\n    $(img).attr('src',src.substring(0,src.length-10)+'open.png');\n  }\n}\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/functions.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\"/>\n<title>TurboJPEG: Data Fields</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n  $(document).ready(function() { searchBox.OnSelectItem(0); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n<link href=\"doxygen-extra.css\" rel=\"stylesheet\" type=\"text/css\"/>\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n  <td style=\"padding-left: 0.5em;\">\n   <div id=\"projectname\">TurboJPEG\n   &#160;<span id=\"projectnumber\">1.5</span>\n   </div>\n  </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.3.1 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n  <div id=\"navrow1\" class=\"tabs\">\n    <ul class=\"tablist\">\n      <li><a href=\"index.html\"><span>Main&#160;Page</span></a></li>\n      <li><a href=\"modules.html\"><span>Modules</span></a></li>\n      <li class=\"current\"><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li>\n        <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n        <span class=\"left\">\n          <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n               onmouseover=\"return searchBox.OnSearchSelectShow()\"\n               onmouseout=\"return searchBox.OnSearchSelectHide()\"\n               alt=\"\"/>\n          <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n               onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n               onblur=\"searchBox.OnSearchFieldFocus(false)\" \n               onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n          </span><span class=\"right\">\n            <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n          </span>\n        </div>\n      </li>\n    </ul>\n  </div>\n  <div id=\"navrow2\" class=\"tabs2\">\n    <ul class=\"tablist\">\n      <li><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li><a href=\"classes.html\"><span>Data&#160;Structure&#160;Index</span></a></li>\n      <li class=\"current\"><a href=\"functions.html\"><span>Data&#160;Fields</span></a></li>\n    </ul>\n  </div>\n  <div id=\"navrow3\" class=\"tabs2\">\n    <ul class=\"tablist\">\n      <li class=\"current\"><a href=\"functions.html\"><span>All</span></a></li>\n      <li><a href=\"functions_vars.html\"><span>Variables</span></a></li>\n    </ul>\n  </div>\n</div><!-- top -->\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n     onmouseover=\"return searchBox.OnSearchSelectShow()\"\n     onmouseout=\"return searchBox.OnSearchSelectHide()\"\n     onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n<a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(0)\"><span class=\"SelectionMark\">&#160;</span>All</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(1)\"><span class=\"SelectionMark\">&#160;</span>Data Structures</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(2)\"><span class=\"SelectionMark\">&#160;</span>Functions</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(3)\"><span class=\"SelectionMark\">&#160;</span>Variables</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(4)\"><span class=\"SelectionMark\">&#160;</span>Typedefs</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(5)\"><span class=\"SelectionMark\">&#160;</span>Enumerations</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(6)\"><span class=\"SelectionMark\">&#160;</span>Enumerator</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(7)\"><span class=\"SelectionMark\">&#160;</span>Groups</a></div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n        name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div class=\"contents\">\n<div class=\"textblock\">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div><ul>\n<li>customFilter\n: <a class=\"el\" href=\"structtjtransform.html#a43ee1bcdd2a8d7249a756774f78793c1\">tjtransform</a>\n</li>\n<li>data\n: <a class=\"el\" href=\"structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3\">tjtransform</a>\n</li>\n<li>denom\n: <a class=\"el\" href=\"structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3\">tjscalingfactor</a>\n</li>\n<li>h\n: <a class=\"el\" href=\"structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115\">tjregion</a>\n</li>\n<li>num\n: <a class=\"el\" href=\"structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec\">tjscalingfactor</a>\n</li>\n<li>op\n: <a class=\"el\" href=\"structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498\">tjtransform</a>\n</li>\n<li>options\n: <a class=\"el\" href=\"structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6\">tjtransform</a>\n</li>\n<li>r\n: <a class=\"el\" href=\"structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf\">tjtransform</a>\n</li>\n<li>w\n: <a class=\"el\" href=\"structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42\">tjregion</a>\n</li>\n<li>x\n: <a class=\"el\" href=\"structtjregion.html#a4b6a37a93997091b26a75831fa291ad9\">tjregion</a>\n</li>\n<li>y\n: <a class=\"el\" href=\"structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2\">tjregion</a>\n</li>\n</ul>\n</div><!-- contents -->\n<!-- start footer part -->\n<hr class=\"footer\"/><address class=\"footer\"><small>\nGenerated by &#160;<a href=\"http://www.doxygen.org/index.html\">\n<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/>\n</a> 1.8.3.1\n</small></address>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/functions_vars.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\"/>\n<title>TurboJPEG: Data Fields - Variables</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n  $(document).ready(function() { searchBox.OnSelectItem(0); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n<link href=\"doxygen-extra.css\" rel=\"stylesheet\" type=\"text/css\"/>\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n  <td style=\"padding-left: 0.5em;\">\n   <div id=\"projectname\">TurboJPEG\n   &#160;<span id=\"projectnumber\">1.5</span>\n   </div>\n  </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.3.1 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n  <div id=\"navrow1\" class=\"tabs\">\n    <ul class=\"tablist\">\n      <li><a href=\"index.html\"><span>Main&#160;Page</span></a></li>\n      <li><a href=\"modules.html\"><span>Modules</span></a></li>\n      <li class=\"current\"><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li>\n        <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n        <span class=\"left\">\n          <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n               onmouseover=\"return searchBox.OnSearchSelectShow()\"\n               onmouseout=\"return searchBox.OnSearchSelectHide()\"\n               alt=\"\"/>\n          <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n               onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n               onblur=\"searchBox.OnSearchFieldFocus(false)\" \n               onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n          </span><span class=\"right\">\n            <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n          </span>\n        </div>\n      </li>\n    </ul>\n  </div>\n  <div id=\"navrow2\" class=\"tabs2\">\n    <ul class=\"tablist\">\n      <li><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li><a href=\"classes.html\"><span>Data&#160;Structure&#160;Index</span></a></li>\n      <li class=\"current\"><a href=\"functions.html\"><span>Data&#160;Fields</span></a></li>\n    </ul>\n  </div>\n  <div id=\"navrow3\" class=\"tabs2\">\n    <ul class=\"tablist\">\n      <li><a href=\"functions.html\"><span>All</span></a></li>\n      <li class=\"current\"><a href=\"functions_vars.html\"><span>Variables</span></a></li>\n    </ul>\n  </div>\n</div><!-- top -->\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n     onmouseover=\"return searchBox.OnSearchSelectShow()\"\n     onmouseout=\"return searchBox.OnSearchSelectHide()\"\n     onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n<a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(0)\"><span class=\"SelectionMark\">&#160;</span>All</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(1)\"><span class=\"SelectionMark\">&#160;</span>Data Structures</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(2)\"><span class=\"SelectionMark\">&#160;</span>Functions</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(3)\"><span class=\"SelectionMark\">&#160;</span>Variables</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(4)\"><span class=\"SelectionMark\">&#160;</span>Typedefs</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(5)\"><span class=\"SelectionMark\">&#160;</span>Enumerations</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(6)\"><span class=\"SelectionMark\">&#160;</span>Enumerator</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(7)\"><span class=\"SelectionMark\">&#160;</span>Groups</a></div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n        name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div class=\"contents\">\n&#160;<ul>\n<li>customFilter\n: <a class=\"el\" href=\"structtjtransform.html#a43ee1bcdd2a8d7249a756774f78793c1\">tjtransform</a>\n</li>\n<li>data\n: <a class=\"el\" href=\"structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3\">tjtransform</a>\n</li>\n<li>denom\n: <a class=\"el\" href=\"structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3\">tjscalingfactor</a>\n</li>\n<li>h\n: <a class=\"el\" href=\"structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115\">tjregion</a>\n</li>\n<li>num\n: <a class=\"el\" href=\"structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec\">tjscalingfactor</a>\n</li>\n<li>op\n: <a class=\"el\" href=\"structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498\">tjtransform</a>\n</li>\n<li>options\n: <a class=\"el\" href=\"structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6\">tjtransform</a>\n</li>\n<li>r\n: <a class=\"el\" href=\"structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf\">tjtransform</a>\n</li>\n<li>w\n: <a class=\"el\" href=\"structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42\">tjregion</a>\n</li>\n<li>x\n: <a class=\"el\" href=\"structtjregion.html#a4b6a37a93997091b26a75831fa291ad9\">tjregion</a>\n</li>\n<li>y\n: <a class=\"el\" href=\"structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2\">tjregion</a>\n</li>\n</ul>\n</div><!-- contents -->\n<!-- start footer part -->\n<hr class=\"footer\"/><address class=\"footer\"><small>\nGenerated by &#160;<a href=\"http://www.doxygen.org/index.html\">\n<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/>\n</a> 1.8.3.1\n</small></address>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/group___turbo_j_p_e_g.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\"/>\n<title>TurboJPEG: TurboJPEG</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n  $(document).ready(function() { searchBox.OnSelectItem(0); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n<link href=\"doxygen-extra.css\" rel=\"stylesheet\" type=\"text/css\"/>\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n  <td style=\"padding-left: 0.5em;\">\n   <div id=\"projectname\">TurboJPEG\n   &#160;<span id=\"projectnumber\">1.5</span>\n   </div>\n  </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.3.1 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n  <div id=\"navrow1\" class=\"tabs\">\n    <ul class=\"tablist\">\n      <li><a href=\"index.html\"><span>Main&#160;Page</span></a></li>\n      <li><a href=\"modules.html\"><span>Modules</span></a></li>\n      <li><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li>\n        <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n        <span class=\"left\">\n          <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n               onmouseover=\"return searchBox.OnSearchSelectShow()\"\n               onmouseout=\"return searchBox.OnSearchSelectHide()\"\n               alt=\"\"/>\n          <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n               onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n               onblur=\"searchBox.OnSearchFieldFocus(false)\" \n               onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n          </span><span class=\"right\">\n            <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n          </span>\n        </div>\n      </li>\n    </ul>\n  </div>\n</div><!-- top -->\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n     onmouseover=\"return searchBox.OnSearchSelectShow()\"\n     onmouseout=\"return searchBox.OnSearchSelectHide()\"\n     onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n<a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(0)\"><span class=\"SelectionMark\">&#160;</span>All</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(1)\"><span class=\"SelectionMark\">&#160;</span>Data Structures</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(2)\"><span class=\"SelectionMark\">&#160;</span>Functions</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(3)\"><span class=\"SelectionMark\">&#160;</span>Variables</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(4)\"><span class=\"SelectionMark\">&#160;</span>Typedefs</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(5)\"><span class=\"SelectionMark\">&#160;</span>Enumerations</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(6)\"><span class=\"SelectionMark\">&#160;</span>Enumerator</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(7)\"><span class=\"SelectionMark\">&#160;</span>Groups</a></div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n        name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div class=\"header\">\n  <div class=\"summary\">\n<a href=\"#nested-classes\">Data Structures</a> &#124;\n<a href=\"#define-members\">Macros</a> &#124;\n<a href=\"#typedef-members\">Typedefs</a> &#124;\n<a href=\"#enum-members\">Enumerations</a> &#124;\n<a href=\"#func-members\">Functions</a> &#124;\n<a href=\"#var-members\">Variables</a>  </div>\n  <div class=\"headertitle\">\n<div class=\"title\">TurboJPEG</div>  </div>\n</div><!--header-->\n<div class=\"contents\">\n\n<p>TurboJPEG API.  \n<a href=\"#details\">More...</a></p>\n<table class=\"memberdecls\">\n<tr class=\"heading\"><td colspan=\"2\"><h2 class=\"groupheader\"><a name=\"nested-classes\"></a>\nData Structures</h2></td></tr>\n<tr class=\"memitem:\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">struct &#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"structtjscalingfactor.html\">tjscalingfactor</a></td></tr>\n<tr class=\"memdesc:\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Scaling factor.  <a href=\"structtjscalingfactor.html#details\">More...</a><br/></td></tr>\n<tr class=\"separator:\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">struct &#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"structtjregion.html\">tjregion</a></td></tr>\n<tr class=\"memdesc:\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Cropping region.  <a href=\"structtjregion.html#details\">More...</a><br/></td></tr>\n<tr class=\"separator:\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">struct &#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"structtjtransform.html\">tjtransform</a></td></tr>\n<tr class=\"memdesc:\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Lossless transform.  <a href=\"structtjtransform.html#details\">More...</a><br/></td></tr>\n<tr class=\"separator:\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n</table><table class=\"memberdecls\">\n<tr class=\"heading\"><td colspan=\"2\"><h2 class=\"groupheader\"><a name=\"define-members\"></a>\nMacros</h2></td></tr>\n<tr class=\"memitem:ga5ef3d169162ce77ce348e292a0b7477c\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c\">TJ_NUMSAMP</a></td></tr>\n<tr class=\"memdesc:ga5ef3d169162ce77ce348e292a0b7477c\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The number of chrominance subsampling options.  <a href=\"#ga5ef3d169162ce77ce348e292a0b7477c\">More...</a><br/></td></tr>\n<tr class=\"separator:ga5ef3d169162ce77ce348e292a0b7477c\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga7010a4402f54a45ba822ad8675a4655e\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e\">TJ_NUMPF</a></td></tr>\n<tr class=\"memdesc:ga7010a4402f54a45ba822ad8675a4655e\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The number of pixel formats.  <a href=\"#ga7010a4402f54a45ba822ad8675a4655e\">More...</a><br/></td></tr>\n<tr class=\"separator:ga7010a4402f54a45ba822ad8675a4655e\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga39f57a6fb02d9cf32e7b6890099b5a71\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga39f57a6fb02d9cf32e7b6890099b5a71\">TJ_NUMCS</a></td></tr>\n<tr class=\"memdesc:ga39f57a6fb02d9cf32e7b6890099b5a71\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The number of JPEG colorspaces.  <a href=\"#ga39f57a6fb02d9cf32e7b6890099b5a71\">More...</a><br/></td></tr>\n<tr class=\"separator:ga39f57a6fb02d9cf32e7b6890099b5a71\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga72ecf4ebe6eb702d3c6f5ca27455e1ec\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec\">TJFLAG_BOTTOMUP</a></td></tr>\n<tr class=\"memdesc:ga72ecf4ebe6eb702d3c6f5ca27455e1ec\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The uncompressed source/destination image is stored in bottom-up (Windows, OpenGL) order, not top-down (X11) order.  <a href=\"#ga72ecf4ebe6eb702d3c6f5ca27455e1ec\">More...</a><br/></td></tr>\n<tr class=\"separator:ga72ecf4ebe6eb702d3c6f5ca27455e1ec\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga4ee4506c81177a06f77e2504a22efd2d\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga4ee4506c81177a06f77e2504a22efd2d\">TJFLAG_FASTUPSAMPLE</a></td></tr>\n<tr class=\"memdesc:ga4ee4506c81177a06f77e2504a22efd2d\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">When decompressing an image that was compressed using chrominance subsampling, use the fastest chrominance upsampling algorithm available in the underlying codec.  <a href=\"#ga4ee4506c81177a06f77e2504a22efd2d\">More...</a><br/></td></tr>\n<tr class=\"separator:ga4ee4506c81177a06f77e2504a22efd2d\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga8808d403c68b62aaa58a4c1e58e98963\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963\">TJFLAG_NOREALLOC</a></td></tr>\n<tr class=\"memdesc:ga8808d403c68b62aaa58a4c1e58e98963\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Disable buffer (re)allocation.  <a href=\"#ga8808d403c68b62aaa58a4c1e58e98963\">More...</a><br/></td></tr>\n<tr class=\"separator:ga8808d403c68b62aaa58a4c1e58e98963\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gaabce235db80d3f698b27f36cbd453da2\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaabce235db80d3f698b27f36cbd453da2\">TJFLAG_FASTDCT</a></td></tr>\n<tr class=\"memdesc:gaabce235db80d3f698b27f36cbd453da2\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Use the fastest DCT/IDCT algorithm available in the underlying codec.  <a href=\"#gaabce235db80d3f698b27f36cbd453da2\">More...</a><br/></td></tr>\n<tr class=\"separator:gaabce235db80d3f698b27f36cbd453da2\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gacb233cfd722d66d1ccbf48a7de81f0e0\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0\">TJFLAG_ACCURATEDCT</a></td></tr>\n<tr class=\"memdesc:gacb233cfd722d66d1ccbf48a7de81f0e0\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Use the most accurate DCT/IDCT algorithm available in the underlying codec.  <a href=\"#gacb233cfd722d66d1ccbf48a7de81f0e0\">More...</a><br/></td></tr>\n<tr class=\"separator:gacb233cfd722d66d1ccbf48a7de81f0e0\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga0f6dbd18adf38b7d46ac547f0f4d562c\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga0f6dbd18adf38b7d46ac547f0f4d562c\">TJ_NUMXOP</a></td></tr>\n<tr class=\"memdesc:ga0f6dbd18adf38b7d46ac547f0f4d562c\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The number of transform operations.  <a href=\"#ga0f6dbd18adf38b7d46ac547f0f4d562c\">More...</a><br/></td></tr>\n<tr class=\"separator:ga0f6dbd18adf38b7d46ac547f0f4d562c\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga50e03cb5ed115330e212417429600b00\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00\">TJXOPT_PERFECT</a></td></tr>\n<tr class=\"memdesc:ga50e03cb5ed115330e212417429600b00\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">This option will cause <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a\" title=\"Losslessly transform a JPEG image into another JPEG image.\">tjTransform()</a> to return an error if the transform is not perfect.  <a href=\"#ga50e03cb5ed115330e212417429600b00\">More...</a><br/></td></tr>\n<tr class=\"separator:ga50e03cb5ed115330e212417429600b00\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga319826b7eb1583c0595bbe7b95428709\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga319826b7eb1583c0595bbe7b95428709\">TJXOPT_TRIM</a></td></tr>\n<tr class=\"memdesc:ga319826b7eb1583c0595bbe7b95428709\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">This option will cause <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a\" title=\"Losslessly transform a JPEG image into another JPEG image.\">tjTransform()</a> to discard any partial MCU blocks that cannot be transformed.  <a href=\"#ga319826b7eb1583c0595bbe7b95428709\">More...</a><br/></td></tr>\n<tr class=\"separator:ga319826b7eb1583c0595bbe7b95428709\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga9c771a757fc1294add611906b89ab2d2\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2\">TJXOPT_CROP</a></td></tr>\n<tr class=\"memdesc:ga9c771a757fc1294add611906b89ab2d2\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">This option will enable lossless cropping.  <a href=\"#ga9c771a757fc1294add611906b89ab2d2\">More...</a><br/></td></tr>\n<tr class=\"separator:ga9c771a757fc1294add611906b89ab2d2\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga3acee7b48ade1b99e5588736007c2589\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga3acee7b48ade1b99e5588736007c2589\">TJXOPT_GRAY</a></td></tr>\n<tr class=\"memdesc:ga3acee7b48ade1b99e5588736007c2589\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">This option will discard the color data in the input image and produce a grayscale output image.  <a href=\"#ga3acee7b48ade1b99e5588736007c2589\">More...</a><br/></td></tr>\n<tr class=\"separator:ga3acee7b48ade1b99e5588736007c2589\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gafbf992bbf6e006705886333703ffab31\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gafbf992bbf6e006705886333703ffab31\">TJXOPT_NOOUTPUT</a></td></tr>\n<tr class=\"memdesc:gafbf992bbf6e006705886333703ffab31\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">This option will prevent <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a\" title=\"Losslessly transform a JPEG image into another JPEG image.\">tjTransform()</a> from outputting a JPEG image for this particular transform (this can be used in conjunction with a custom filter to capture the transformed DCT coefficients without transcoding them.)  <a href=\"#gafbf992bbf6e006705886333703ffab31\">More...</a><br/></td></tr>\n<tr class=\"separator:gafbf992bbf6e006705886333703ffab31\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga0aba955473315e405295d978f0c16511\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511\">TJPAD</a>(width)</td></tr>\n<tr class=\"memdesc:ga0aba955473315e405295d978f0c16511\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Pad the given width to the nearest 32-bit boundary.  <a href=\"#ga0aba955473315e405295d978f0c16511\">More...</a><br/></td></tr>\n<tr class=\"separator:ga0aba955473315e405295d978f0c16511\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga84878bb65404204743aa18cac02781df\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">#define&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df\">TJSCALED</a>(dimension, scalingFactor)</td></tr>\n<tr class=\"memdesc:ga84878bb65404204743aa18cac02781df\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Compute the scaled value of <code>dimension</code> using the given scaling factor.  <a href=\"#ga84878bb65404204743aa18cac02781df\">More...</a><br/></td></tr>\n<tr class=\"separator:ga84878bb65404204743aa18cac02781df\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n</table><table class=\"memberdecls\">\n<tr class=\"heading\"><td colspan=\"2\"><h2 class=\"groupheader\"><a name=\"typedef-members\"></a>\nTypedefs</h2></td></tr>\n<tr class=\"memitem:gaa29f3189c41be12ec5dee7caec318a31\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">typedef struct <a class=\"el\" href=\"structtjtransform.html\">tjtransform</a>&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaa29f3189c41be12ec5dee7caec318a31\">tjtransform</a></td></tr>\n<tr class=\"memdesc:gaa29f3189c41be12ec5dee7caec318a31\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Lossless transform.  <a href=\"#gaa29f3189c41be12ec5dee7caec318a31\">More...</a><br/></td></tr>\n<tr class=\"separator:gaa29f3189c41be12ec5dee7caec318a31\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga758d2634ecb4949de7815cba621f5763\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">typedef void *&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a></td></tr>\n<tr class=\"memdesc:ga758d2634ecb4949de7815cba621f5763\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">TurboJPEG instance handle.  <a href=\"#ga758d2634ecb4949de7815cba621f5763\">More...</a><br/></td></tr>\n<tr class=\"separator:ga758d2634ecb4949de7815cba621f5763\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n</table><table class=\"memberdecls\">\n<tr class=\"heading\"><td colspan=\"2\"><h2 class=\"groupheader\"><a name=\"enum-members\"></a>\nEnumerations</h2></td></tr>\n<tr class=\"memitem:ga1d047060ea80bb9820d540bb928e9074\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">enum &#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">TJSAMP</a> { <br/>\n&#160;&#160;<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3\">TJSAMP_444</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404\">TJSAMP_422</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737\">TJSAMP_420</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248\">TJSAMP_GRAY</a>, \n<br/>\n&#160;&#160;<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974\">TJSAMP_440</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2\">TJSAMP_411</a>\n<br/>\n }</td></tr>\n<tr class=\"memdesc:ga1d047060ea80bb9820d540bb928e9074\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Chrominance subsampling options.  <a href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">More...</a><br/></td></tr>\n<tr class=\"separator:ga1d047060ea80bb9820d540bb928e9074\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gac916144e26c3817ac514e64ae5d12e2a\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">enum &#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a\">TJPF</a> { <br/>\n&#160;&#160;<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7ce93230bff449518ce387c17e6ed37c\">TJPF_RGB</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aab10624437fb8ef495a0b153e65749839\">TJPF_BGR</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01\">TJPF_RGBX</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8\">TJPF_BGRX</a>, \n<br/>\n&#160;&#160;<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af\">TJPF_XBGR</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84\">TJPF_XRGB</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a\">TJPF_GRAY</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12\">TJPF_RGBA</a>, \n<br/>\n&#160;&#160;<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4\">TJPF_BGRA</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081\">TJPF_ABGR</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c\">TJPF_ARGB</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b\">TJPF_CMYK</a>\n<br/>\n }</td></tr>\n<tr class=\"memdesc:gac916144e26c3817ac514e64ae5d12e2a\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Pixel formats.  <a href=\"group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a\">More...</a><br/></td></tr>\n<tr class=\"separator:gac916144e26c3817ac514e64ae5d12e2a\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga4f83ad3368e0e29d1957be0efa7c3720\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">enum &#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720\">TJCS</a> { <br/>\n&#160;&#160;<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555\">TJCS_RGB</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75\">TJCS_YCbCr</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a\">TJCS_GRAY</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53\">TJCS_CMYK</a>, \n<br/>\n&#160;&#160;<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e\">TJCS_YCCK</a>\n<br/>\n }</td></tr>\n<tr class=\"memdesc:ga4f83ad3368e0e29d1957be0efa7c3720\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">JPEG colorspaces.  <a href=\"group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720\">More...</a><br/></td></tr>\n<tr class=\"separator:ga4f83ad3368e0e29d1957be0efa7c3720\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga2de531af4e7e6c4f124908376b354866\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">enum &#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866\">TJXOP</a> { <br/>\n&#160;&#160;<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27\">TJXOP_NONE</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce\">TJXOP_HFLIP</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a324eddfbec53b7e691f61e56929d0d5d\">TJXOP_VFLIP</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a31060aed199f886afdd417f80499c32d\">TJXOP_TRANSPOSE</a>, \n<br/>\n&#160;&#160;<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4\">TJXOP_TRANSVERSE</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a43b2bbb23bc4bd548422d43fbe9af128\">TJXOP_ROT90</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a140952eb8dd0300accfcc22726d69692\">TJXOP_ROT180</a>, \n<a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a3064ee5dfb7f032df332818587567a08\">TJXOP_ROT270</a>\n<br/>\n }</td></tr>\n<tr class=\"memdesc:ga2de531af4e7e6c4f124908376b354866\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Transform operations for <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a\" title=\"Losslessly transform a JPEG image into another JPEG image.\">tjTransform()</a>  <a href=\"group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866\">More...</a><br/></td></tr>\n<tr class=\"separator:ga2de531af4e7e6c4f124908376b354866\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n</table><table class=\"memberdecls\">\n<tr class=\"heading\"><td colspan=\"2\"><h2 class=\"groupheader\"><a name=\"func-members\"></a>\nFunctions</h2></td></tr>\n<tr class=\"memitem:ga3d10c47fbe4a2489a2b30c931551d01a\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga3d10c47fbe4a2489a2b30c931551d01a\">tjInitCompress</a> (void)</td></tr>\n<tr class=\"memdesc:ga3d10c47fbe4a2489a2b30c931551d01a\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Create a TurboJPEG compressor instance.  <a href=\"#ga3d10c47fbe4a2489a2b30c931551d01a\">More...</a><br/></td></tr>\n<tr class=\"separator:ga3d10c47fbe4a2489a2b30c931551d01a\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gaf38f2ed44bdc88e730e08b632fa6e88e\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT int DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaf38f2ed44bdc88e730e08b632fa6e88e\">tjCompress2</a> (<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags)</td></tr>\n<tr class=\"memdesc:gaf38f2ed44bdc88e730e08b632fa6e88e\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Compress an RGB, grayscale, or CMYK image into a JPEG image.  <a href=\"#gaf38f2ed44bdc88e730e08b632fa6e88e\">More...</a><br/></td></tr>\n<tr class=\"separator:gaf38f2ed44bdc88e730e08b632fa6e88e\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga6f6de375d6ec0020faba627e37e5a060\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT int DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga6f6de375d6ec0020faba627e37e5a060\">tjCompressFromYUV</a> (<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> handle, const unsigned char *srcBuf, int width, int pad, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)</td></tr>\n<tr class=\"memdesc:ga6f6de375d6ec0020faba627e37e5a060\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Compress a YUV planar image into a JPEG image.  <a href=\"#ga6f6de375d6ec0020faba627e37e5a060\">More...</a><br/></td></tr>\n<tr class=\"separator:ga6f6de375d6ec0020faba627e37e5a060\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga0b84c682d8accf097d7a743c965d3464\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT int DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga0b84c682d8accf097d7a743c965d3464\">tjCompressFromYUVPlanes</a> (<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> handle, const unsigned char **srcPlanes, int width, const int *strides, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)</td></tr>\n<tr class=\"memdesc:ga0b84c682d8accf097d7a743c965d3464\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image.  <a href=\"#ga0b84c682d8accf097d7a743c965d3464\">More...</a><br/></td></tr>\n<tr class=\"separator:ga0b84c682d8accf097d7a743c965d3464\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gaccc5bca7f12fcdcc302e6e1c6d4b311b\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT unsigned long DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b\">tjBufSize</a> (int width, int height, int jpegSubsamp)</td></tr>\n<tr class=\"memdesc:gaccc5bca7f12fcdcc302e6e1c6d4b311b\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.  <a href=\"#gaccc5bca7f12fcdcc302e6e1c6d4b311b\">More...</a><br/></td></tr>\n<tr class=\"separator:gaccc5bca7f12fcdcc302e6e1c6d4b311b\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gaf451664a62c1f6c7cc5a6401f32908c9\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT unsigned long DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9\">tjBufSizeYUV2</a> (int width, int pad, int height, int subsamp)</td></tr>\n<tr class=\"memdesc:gaf451664a62c1f6c7cc5a6401f32908c9\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters.  <a href=\"#gaf451664a62c1f6c7cc5a6401f32908c9\">More...</a><br/></td></tr>\n<tr class=\"separator:gaf451664a62c1f6c7cc5a6401f32908c9\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga6f98d977bfa9d167c97172e876ba61e2\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT unsigned long DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2\">tjPlaneSizeYUV</a> (int componentID, int width, int stride, int height, int subsamp)</td></tr>\n<tr class=\"memdesc:ga6f98d977bfa9d167c97172e876ba61e2\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.  <a href=\"#ga6f98d977bfa9d167c97172e876ba61e2\">More...</a><br/></td></tr>\n<tr class=\"separator:ga6f98d977bfa9d167c97172e876ba61e2\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga63fb66bb1e36c74008c4634360becbb1\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga63fb66bb1e36c74008c4634360becbb1\">tjPlaneWidth</a> (int componentID, int width, int subsamp)</td></tr>\n<tr class=\"memdesc:ga63fb66bb1e36c74008c4634360becbb1\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The plane width of a YUV image plane with the given parameters.  <a href=\"#ga63fb66bb1e36c74008c4634360becbb1\">More...</a><br/></td></tr>\n<tr class=\"separator:ga63fb66bb1e36c74008c4634360becbb1\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga1a209696c6a80748f20e134b3c64789f\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1a209696c6a80748f20e134b3c64789f\">tjPlaneHeight</a> (int componentID, int height, int subsamp)</td></tr>\n<tr class=\"memdesc:ga1a209696c6a80748f20e134b3c64789f\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The plane height of a YUV image plane with the given parameters.  <a href=\"#ga1a209696c6a80748f20e134b3c64789f\">More...</a><br/></td></tr>\n<tr class=\"separator:ga1a209696c6a80748f20e134b3c64789f\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gaabe05acd734990053ad1294b5ef239aa\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT int DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaabe05acd734990053ad1294b5ef239aa\">tjEncodeYUV3</a> (<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char *dstBuf, int pad, int subsamp, int flags)</td></tr>\n<tr class=\"memdesc:gaabe05acd734990053ad1294b5ef239aa\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Encode an RGB or grayscale image into a YUV planar image.  <a href=\"#gaabe05acd734990053ad1294b5ef239aa\">More...</a><br/></td></tr>\n<tr class=\"separator:gaabe05acd734990053ad1294b5ef239aa\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga8a65ed3bd12df57c219d46afbc9008f1\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT int DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga8a65ed3bd12df57c219d46afbc9008f1\">tjEncodeYUVPlanes</a> (<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **dstPlanes, int *strides, int subsamp, int flags)</td></tr>\n<tr class=\"memdesc:ga8a65ed3bd12df57c219d46afbc9008f1\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Encode an RGB or grayscale image into separate Y, U (Cb), and V (Cr) image planes.  <a href=\"#ga8a65ed3bd12df57c219d46afbc9008f1\">More...</a><br/></td></tr>\n<tr class=\"separator:ga8a65ed3bd12df57c219d46afbc9008f1\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gae5408179d041e2a2f7199c8283cf649e\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gae5408179d041e2a2f7199c8283cf649e\">tjInitDecompress</a> (void)</td></tr>\n<tr class=\"memdesc:gae5408179d041e2a2f7199c8283cf649e\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Create a TurboJPEG decompressor instance.  <a href=\"#gae5408179d041e2a2f7199c8283cf649e\">More...</a><br/></td></tr>\n<tr class=\"separator:gae5408179d041e2a2f7199c8283cf649e\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga3fced455e504e8ff4fbad28ba94a3020\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT int DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga3fced455e504e8ff4fbad28ba94a3020\">tjDecompressHeader3</a> (<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> handle, const unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height, int *jpegSubsamp, int *jpegColorspace)</td></tr>\n<tr class=\"memdesc:ga3fced455e504e8ff4fbad28ba94a3020\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Retrieve information about a JPEG image without decompressing it.  <a href=\"#ga3fced455e504e8ff4fbad28ba94a3020\">More...</a><br/></td></tr>\n<tr class=\"separator:ga3fced455e504e8ff4fbad28ba94a3020\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga6449044b9af402999ccf52f401333be8\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT <a class=\"el\" href=\"structtjscalingfactor.html\">tjscalingfactor</a> *DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8\">tjGetScalingFactors</a> (int *numscalingfactors)</td></tr>\n<tr class=\"memdesc:ga6449044b9af402999ccf52f401333be8\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of TurboJPEG supports.  <a href=\"#ga6449044b9af402999ccf52f401333be8\">More...</a><br/></td></tr>\n<tr class=\"separator:ga6449044b9af402999ccf52f401333be8\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gad8026a417e16a76313bc0a6c9e8b2ba2\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT int DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad8026a417e16a76313bc0a6c9e8b2ba2\">tjDecompress2</a> (<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> handle, const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>\n<tr class=\"memdesc:gad8026a417e16a76313bc0a6c9e8b2ba2\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Decompress a JPEG image to an RGB, grayscale, or CMYK image.  <a href=\"#gad8026a417e16a76313bc0a6c9e8b2ba2\">More...</a><br/></td></tr>\n<tr class=\"separator:gad8026a417e16a76313bc0a6c9e8b2ba2\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga39e08906528db5a764670ea48d344b09\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT int DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga39e08906528db5a764670ea48d344b09\">tjDecompressToYUV2</a> (<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> handle, const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pad, int height, int flags)</td></tr>\n<tr class=\"memdesc:ga39e08906528db5a764670ea48d344b09\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Decompress a JPEG image to a YUV planar image.  <a href=\"#ga39e08906528db5a764670ea48d344b09\">More...</a><br/></td></tr>\n<tr class=\"separator:ga39e08906528db5a764670ea48d344b09\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga38d0ef90692663b3ffb5b16da2541512\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT int DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga38d0ef90692663b3ffb5b16da2541512\">tjDecompressToYUVPlanes</a> (<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> handle, const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char **dstPlanes, int width, int *strides, int height, int flags)</td></tr>\n<tr class=\"memdesc:ga38d0ef90692663b3ffb5b16da2541512\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Decompress a JPEG image into separate Y, U (Cb), and V (Cr) image planes.  <a href=\"#ga38d0ef90692663b3ffb5b16da2541512\">More...</a><br/></td></tr>\n<tr class=\"separator:ga38d0ef90692663b3ffb5b16da2541512\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga077c61027b875afecd5a1613bf18b3c1\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT int DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga077c61027b875afecd5a1613bf18b3c1\">tjDecodeYUV</a> (<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> handle, const unsigned char *srcBuf, int pad, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>\n<tr class=\"memdesc:ga077c61027b875afecd5a1613bf18b3c1\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Decode a YUV planar image into an RGB or grayscale image.  <a href=\"#ga077c61027b875afecd5a1613bf18b3c1\">More...</a><br/></td></tr>\n<tr class=\"separator:ga077c61027b875afecd5a1613bf18b3c1\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gaf42f19b7a496eb18bdc84fe61ee6d3e2\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT int DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaf42f19b7a496eb18bdc84fe61ee6d3e2\">tjDecodeYUVPlanes</a> (<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> handle, const unsigned char **srcPlanes, const int *strides, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>\n<tr class=\"memdesc:gaf42f19b7a496eb18bdc84fe61ee6d3e2\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Decode a set of Y, U (Cb), and V (Cr) image planes into an RGB or grayscale image.  <a href=\"#gaf42f19b7a496eb18bdc84fe61ee6d3e2\">More...</a><br/></td></tr>\n<tr class=\"separator:gaf42f19b7a496eb18bdc84fe61ee6d3e2\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga3155b775bfbac9dbba869b95a0367902\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga3155b775bfbac9dbba869b95a0367902\">tjInitTransform</a> (void)</td></tr>\n<tr class=\"memdesc:ga3155b775bfbac9dbba869b95a0367902\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Create a new TurboJPEG transformer instance.  <a href=\"#ga3155b775bfbac9dbba869b95a0367902\">More...</a><br/></td></tr>\n<tr class=\"separator:ga3155b775bfbac9dbba869b95a0367902\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gad02cd42b69f193a0623a9c801788df3a\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT int DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a\">tjTransform</a> (<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> handle, const unsigned char *jpegBuf, unsigned long jpegSize, int n, unsigned char **dstBufs, unsigned long *dstSizes, <a class=\"el\" href=\"structtjtransform.html\">tjtransform</a> *transforms, int flags)</td></tr>\n<tr class=\"memdesc:gad02cd42b69f193a0623a9c801788df3a\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Losslessly transform a JPEG image into another JPEG image.  <a href=\"#gad02cd42b69f193a0623a9c801788df3a\">More...</a><br/></td></tr>\n<tr class=\"separator:gad02cd42b69f193a0623a9c801788df3a\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga674adee917b95ad4a896f1ba39e12540\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT int DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga674adee917b95ad4a896f1ba39e12540\">tjDestroy</a> (<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> handle)</td></tr>\n<tr class=\"memdesc:ga674adee917b95ad4a896f1ba39e12540\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Destroy a TurboJPEG compressor, decompressor, or transformer instance.  <a href=\"#ga674adee917b95ad4a896f1ba39e12540\">More...</a><br/></td></tr>\n<tr class=\"separator:ga674adee917b95ad4a896f1ba39e12540\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga5c9234bda6d993cdaffdd89bf81a00ff\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT unsigned char *DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff\">tjAlloc</a> (int bytes)</td></tr>\n<tr class=\"memdesc:ga5c9234bda6d993cdaffdd89bf81a00ff\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Allocate an image buffer for use with TurboJPEG.  <a href=\"#ga5c9234bda6d993cdaffdd89bf81a00ff\">More...</a><br/></td></tr>\n<tr class=\"separator:ga5c9234bda6d993cdaffdd89bf81a00ff\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga8c4a1231dc06a450514c835f6471f137\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT void DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga8c4a1231dc06a450514c835f6471f137\">tjFree</a> (unsigned char *buffer)</td></tr>\n<tr class=\"memdesc:ga8c4a1231dc06a450514c835f6471f137\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Free an image buffer previously allocated by TurboJPEG.  <a href=\"#ga8c4a1231dc06a450514c835f6471f137\">More...</a><br/></td></tr>\n<tr class=\"separator:ga8c4a1231dc06a450514c835f6471f137\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga9af79c908ec131b1ae8d52fe40375abf\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">DLLEXPORT char *DLLCALL&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\">tjGetErrorStr</a> (void)</td></tr>\n<tr class=\"memdesc:ga9af79c908ec131b1ae8d52fe40375abf\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Returns a descriptive error message explaining why the last command failed.  <a href=\"#ga9af79c908ec131b1ae8d52fe40375abf\">More...</a><br/></td></tr>\n<tr class=\"separator:ga9af79c908ec131b1ae8d52fe40375abf\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n</table><table class=\"memberdecls\">\n<tr class=\"heading\"><td colspan=\"2\"><h2 class=\"groupheader\"><a name=\"var-members\"></a>\nVariables</h2></td></tr>\n<tr class=\"memitem:ga9e61e7cd47a15a173283ba94e781308c\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">static const int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c\">tjMCUWidth</a> [<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c\">TJ_NUMSAMP</a>]</td></tr>\n<tr class=\"memdesc:ga9e61e7cd47a15a173283ba94e781308c\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">MCU block width (in pixels) for a given level of chrominance subsampling.  <a href=\"#ga9e61e7cd47a15a173283ba94e781308c\">More...</a><br/></td></tr>\n<tr class=\"separator:ga9e61e7cd47a15a173283ba94e781308c\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gabd247bb9fecb393eca57366feb8327bf\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">static const int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf\">tjMCUHeight</a> [<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c\">TJ_NUMSAMP</a>]</td></tr>\n<tr class=\"memdesc:gabd247bb9fecb393eca57366feb8327bf\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">MCU block height (in pixels) for a given level of chrominance subsampling.  <a href=\"#gabd247bb9fecb393eca57366feb8327bf\">More...</a><br/></td></tr>\n<tr class=\"separator:gabd247bb9fecb393eca57366feb8327bf\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gadd9b446742ac8a3923f7992c7988fea8\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">static const int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gadd9b446742ac8a3923f7992c7988fea8\">tjRedOffset</a> [<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e\">TJ_NUMPF</a>]</td></tr>\n<tr class=\"memdesc:gadd9b446742ac8a3923f7992c7988fea8\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Red offset (in bytes) for a given pixel format.  <a href=\"#gadd9b446742ac8a3923f7992c7988fea8\">More...</a><br/></td></tr>\n<tr class=\"separator:gadd9b446742ac8a3923f7992c7988fea8\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga82d6e35da441112a411da41923c0ba2f\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">static const int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga82d6e35da441112a411da41923c0ba2f\">tjGreenOffset</a> [<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e\">TJ_NUMPF</a>]</td></tr>\n<tr class=\"memdesc:ga82d6e35da441112a411da41923c0ba2f\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Green offset (in bytes) for a given pixel format.  <a href=\"#ga82d6e35da441112a411da41923c0ba2f\">More...</a><br/></td></tr>\n<tr class=\"separator:ga82d6e35da441112a411da41923c0ba2f\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ga84e2e35d3f08025f976ec1ec53693dea\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">static const int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga84e2e35d3f08025f976ec1ec53693dea\">tjBlueOffset</a> [<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e\">TJ_NUMPF</a>]</td></tr>\n<tr class=\"memdesc:ga84e2e35d3f08025f976ec1ec53693dea\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Blue offset (in bytes) for a given pixel format.  <a href=\"#ga84e2e35d3f08025f976ec1ec53693dea\">More...</a><br/></td></tr>\n<tr class=\"separator:ga84e2e35d3f08025f976ec1ec53693dea\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:gad77cf8fe5b2bfd3cb3f53098146abb4c\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">static const int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\">tjPixelSize</a> [<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e\">TJ_NUMPF</a>]</td></tr>\n<tr class=\"memdesc:gad77cf8fe5b2bfd3cb3f53098146abb4c\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Pixel size (in bytes) for a given pixel format.  <a href=\"#gad77cf8fe5b2bfd3cb3f53098146abb4c\">More...</a><br/></td></tr>\n<tr class=\"separator:gad77cf8fe5b2bfd3cb3f53098146abb4c\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n</table>\n<a name=\"details\" id=\"details\"></a><h2 class=\"groupheader\">Detailed Description</h2>\n<p>TurboJPEG API. </p>\n<p>This API provides an interface for generating, decoding, and transforming planar YUV and JPEG images in memory.</p>\n<p><a class=\"anchor\" id=\"YUVnotes\"></a></p>\n<h2>YUV Image Format Notes</h2>\n<p>Technically, the JPEG format uses the YCbCr colorspace (which is technically not a colorspace but a color transform), but per the convention of the digital video community, the TurboJPEG API uses \"YUV\" to refer to an image format consisting of Y, Cb, and Cr image planes.</p>\n<p>Each plane is simply a 2D array of bytes, each byte representing the value of one of the components (Y, Cb, or Cr) at a particular location in the image. The width and height of each plane are determined by the image width, height, and level of chrominance subsampling. The luminance plane width is the image width padded to the nearest multiple of the horizontal subsampling factor (2 in the case of 4:2:0 and 4:2:2, 4 in the case of 4:1:1, 1 in the case of 4:4:4 or grayscale.) Similarly, the luminance plane height is the image height padded to the nearest multiple of the vertical subsampling factor (2 in the case of 4:2:0 or 4:4:0, 1 in the case of 4:4:4 or grayscale.) This is irrespective of any additional padding that may be specified as an argument to the various YUV functions. The chrominance plane width is equal to the luminance plane width divided by the horizontal subsampling factor, and the chrominance plane height is equal to the luminance plane height divided by the vertical subsampling factor.</p>\n<p>For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is used, then the luminance plane would be 36 x 35 bytes, and each of the chrominance planes would be 18 x 35 bytes. If you specify a line padding of 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and each of the chrominance planes would be 20 x 35 bytes. </p>\n<h2 class=\"groupheader\">Macro Definition Documentation</h2>\n<a class=\"anchor\" id=\"ga39f57a6fb02d9cf32e7b6890099b5a71\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJ_NUMCS</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>The number of JPEG colorspaces. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga7010a4402f54a45ba822ad8675a4655e\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJ_NUMPF</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>The number of pixel formats. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga5ef3d169162ce77ce348e292a0b7477c\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJ_NUMSAMP</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>The number of chrominance subsampling options. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga0f6dbd18adf38b7d46ac547f0f4d562c\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJ_NUMXOP</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>The number of transform operations. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gacb233cfd722d66d1ccbf48a7de81f0e0\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJFLAG_ACCURATEDCT</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Use the most accurate DCT/IDCT algorithm available in the underlying codec. </p>\n<p>The default if this flag is not specified is implementation-specific. For example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast algorithm by default when compressing, because this has been shown to have only a very slight effect on accuracy, but it uses the accurate algorithm when decompressing, because this has been shown to have a larger effect. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga72ecf4ebe6eb702d3c6f5ca27455e1ec\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJFLAG_BOTTOMUP</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>The uncompressed source/destination image is stored in bottom-up (Windows, OpenGL) order, not top-down (X11) order. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gaabce235db80d3f698b27f36cbd453da2\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJFLAG_FASTDCT</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Use the fastest DCT/IDCT algorithm available in the underlying codec. </p>\n<p>The default if this flag is not specified is implementation-specific. For example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast algorithm by default when compressing, because this has been shown to have only a very slight effect on accuracy, but it uses the accurate algorithm when decompressing, because this has been shown to have a larger effect. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga4ee4506c81177a06f77e2504a22efd2d\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJFLAG_FASTUPSAMPLE</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>When decompressing an image that was compressed using chrominance subsampling, use the fastest chrominance upsampling algorithm available in the underlying codec. </p>\n<p>The default is to use smooth upsampling, which creates a smooth transition between neighboring chrominance components in order to reduce upsampling artifacts in the decompressed image. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga8808d403c68b62aaa58a4c1e58e98963\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJFLAG_NOREALLOC</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Disable buffer (re)allocation. </p>\n<p>If passed to <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaf38f2ed44bdc88e730e08b632fa6e88e\" title=\"Compress an RGB, grayscale, or CMYK image into a JPEG image.\">tjCompress2()</a> or <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a\" title=\"Losslessly transform a JPEG image into another JPEG image.\">tjTransform()</a>, this flag will cause those functions to generate an error if the JPEG image buffer is invalid or too small rather than attempting to allocate or reallocate that buffer. This reproduces the behavior of earlier versions of TurboJPEG. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga0aba955473315e405295d978f0c16511\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJPAD</td>\n          <td>(</td>\n          <td class=\"paramtype\">&#160;</td>\n          <td class=\"paramname\">width</td><td>)</td>\n          <td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Pad the given width to the nearest 32-bit boundary. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga84878bb65404204743aa18cac02781df\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJSCALED</td>\n          <td>(</td>\n          <td class=\"paramtype\">&#160;</td>\n          <td class=\"paramname\">dimension, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">&#160;</td>\n          <td class=\"paramname\">scalingFactor&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Compute the scaled value of <code>dimension</code> using the given scaling factor. </p>\n<p>This macro performs the integer equivalent of <code>ceil(dimension * scalingFactor)</code>. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga9c771a757fc1294add611906b89ab2d2\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJXOPT_CROP</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>This option will enable lossless cropping. </p>\n<p>See <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a\" title=\"Losslessly transform a JPEG image into another JPEG image.\">tjTransform()</a> for more information. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga3acee7b48ade1b99e5588736007c2589\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJXOPT_GRAY</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>This option will discard the color data in the input image and produce a grayscale output image. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gafbf992bbf6e006705886333703ffab31\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJXOPT_NOOUTPUT</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>This option will prevent <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a\" title=\"Losslessly transform a JPEG image into another JPEG image.\">tjTransform()</a> from outputting a JPEG image for this particular transform (this can be used in conjunction with a custom filter to capture the transformed DCT coefficients without transcoding them.) </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga50e03cb5ed115330e212417429600b00\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJXOPT_PERFECT</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>This option will cause <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a\" title=\"Losslessly transform a JPEG image into another JPEG image.\">tjTransform()</a> to return an error if the transform is not perfect. </p>\n<p>Lossless transforms operate on MCU blocks, whose size depends on the level of chrominance subsampling used (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c\" title=\"MCU block width (in pixels) for a given level of chrominance subsampling.\">tjMCUWidth</a> and <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf\" title=\"MCU block height (in pixels) for a given level of chrominance subsampling.\">tjMCUHeight</a>.) If the image's width or height is not evenly divisible by the MCU block size, then there will be partial MCU blocks on the right and/or bottom edges. It is not possible to move these partial MCU blocks to the top or left of the image, so any transform that would require that is \"imperfect.\" If this option is not specified, then any partial MCU blocks that cannot be transformed will be left in place, which will create odd-looking strips on the right or bottom edge of the image. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga319826b7eb1583c0595bbe7b95428709\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">#define TJXOPT_TRIM</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>This option will cause <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a\" title=\"Losslessly transform a JPEG image into another JPEG image.\">tjTransform()</a> to discard any partial MCU blocks that cannot be transformed. </p>\n\n</div>\n</div>\n<h2 class=\"groupheader\">Typedef Documentation</h2>\n<a class=\"anchor\" id=\"ga758d2634ecb4949de7815cba621f5763\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">typedef void* <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>TurboJPEG instance handle. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gaa29f3189c41be12ec5dee7caec318a31\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">typedef struct <a class=\"el\" href=\"structtjtransform.html\">tjtransform</a>  <a class=\"el\" href=\"structtjtransform.html\">tjtransform</a></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Lossless transform. </p>\n\n</div>\n</div>\n<h2 class=\"groupheader\">Enumeration Type Documentation</h2>\n<a class=\"anchor\" id=\"ga4f83ad3368e0e29d1957be0efa7c3720\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">enum <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720\">TJCS</a></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>JPEG colorspaces. </p>\n<table class=\"fieldtable\">\n<tr><th colspan=\"2\">Enumerator</th></tr><tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555\"></a>TJCS_RGB</em>&nbsp;</td><td class=\"fielddoc\">\n<p>RGB colorspace. </p>\n<p>When compressing the JPEG image, the R, G, and B components in the source image are reordered into image planes, but no colorspace conversion or subsampling is performed. RGB JPEG images can be decompressed to any of the extended RGB pixel formats or grayscale, but they cannot be decompressed to YUV images. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75\"></a>TJCS_YCbCr</em>&nbsp;</td><td class=\"fielddoc\">\n<p>YCbCr colorspace. </p>\n<p>YCbCr is not an absolute colorspace but rather a mathematical transformation of RGB designed solely for storage and transmission. YCbCr images must be converted to RGB before they can actually be displayed. In the YCbCr colorspace, the Y (luminance) component represents the black &amp; white portion of the original image, and the Cb and Cr (chrominance) components represent the color portion of the original image. Originally, the analog equivalent of this transformation allowed the same signal to drive both black &amp; white and color televisions, but JPEG images use YCbCr primarily because it allows the color data to be optionally subsampled for the purposes of reducing bandwidth or disk space. YCbCr is the most common JPEG colorspace, and YCbCr JPEG images can be compressed from and decompressed to any of the extended RGB pixel formats or grayscale, or they can be decompressed to YUV planar images. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a\"></a>TJCS_GRAY</em>&nbsp;</td><td class=\"fielddoc\">\n<p>Grayscale colorspace. </p>\n<p>The JPEG image retains only the luminance data (Y component), and any color data from the source image is discarded. Grayscale JPEG images can be compressed from and decompressed to any of the extended RGB pixel formats or grayscale, or they can be decompressed to YUV planar images. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53\"></a>TJCS_CMYK</em>&nbsp;</td><td class=\"fielddoc\">\n<p>CMYK colorspace. </p>\n<p>When compressing the JPEG image, the C, M, Y, and K components in the source image are reordered into image planes, but no colorspace conversion or subsampling is performed. CMYK JPEG images can only be decompressed to CMYK pixels. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e\"></a>TJCS_YCCK</em>&nbsp;</td><td class=\"fielddoc\">\n<p>YCCK colorspace. </p>\n<p>YCCK (AKA \"YCbCrK\") is not an absolute colorspace but rather a mathematical transformation of CMYK designed solely for storage and transmission. It is to CMYK as YCbCr is to RGB. CMYK pixels can be reversibly transformed into YCCK, and as with YCbCr, the chrominance components in the YCCK pixels can be subsampled without incurring major perceptual loss. YCCK JPEG images can only be compressed from and decompressed to CMYK pixels. </p>\n</td></tr>\n</table>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gac916144e26c3817ac514e64ae5d12e2a\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">enum <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a\">TJPF</a></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Pixel formats. </p>\n<table class=\"fieldtable\">\n<tr><th colspan=\"2\">Enumerator</th></tr><tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"ggac916144e26c3817ac514e64ae5d12e2aa7ce93230bff449518ce387c17e6ed37c\"></a>TJPF_RGB</em>&nbsp;</td><td class=\"fielddoc\">\n<p>RGB pixel format. </p>\n<p>The red, green, and blue components in the image are stored in 3-byte pixels in the order R, G, B from lowest to highest byte address within each pixel. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"ggac916144e26c3817ac514e64ae5d12e2aab10624437fb8ef495a0b153e65749839\"></a>TJPF_BGR</em>&nbsp;</td><td class=\"fielddoc\">\n<p>BGR pixel format. </p>\n<p>The red, green, and blue components in the image are stored in 3-byte pixels in the order B, G, R from lowest to highest byte address within each pixel. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01\"></a>TJPF_RGBX</em>&nbsp;</td><td class=\"fielddoc\">\n<p>RGBX pixel format. </p>\n<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order R, G, B from lowest to highest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8\"></a>TJPF_BGRX</em>&nbsp;</td><td class=\"fielddoc\">\n<p>BGRX pixel format. </p>\n<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order B, G, R from lowest to highest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af\"></a>TJPF_XBGR</em>&nbsp;</td><td class=\"fielddoc\">\n<p>XBGR pixel format. </p>\n<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order R, G, B from highest to lowest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84\"></a>TJPF_XRGB</em>&nbsp;</td><td class=\"fielddoc\">\n<p>XRGB pixel format. </p>\n<p>The red, green, and blue components in the image are stored in 4-byte pixels in the order B, G, R from highest to lowest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a\"></a>TJPF_GRAY</em>&nbsp;</td><td class=\"fielddoc\">\n<p>Grayscale pixel format. </p>\n<p>Each 1-byte pixel represents a luminance (brightness) level from 0 to 255. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12\"></a>TJPF_RGBA</em>&nbsp;</td><td class=\"fielddoc\">\n<p>RGBA pixel format. </p>\n<p>This is the same as <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01\">TJPF_RGBX</a>, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4\"></a>TJPF_BGRA</em>&nbsp;</td><td class=\"fielddoc\">\n<p>BGRA pixel format. </p>\n<p>This is the same as <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8\">TJPF_BGRX</a>, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081\"></a>TJPF_ABGR</em>&nbsp;</td><td class=\"fielddoc\">\n<p>ABGR pixel format. </p>\n<p>This is the same as <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af\">TJPF_XBGR</a>, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c\"></a>TJPF_ARGB</em>&nbsp;</td><td class=\"fielddoc\">\n<p>ARGB pixel format. </p>\n<p>This is the same as <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84\">TJPF_XRGB</a>, except that when decompressing, the X component is guaranteed to be 0xFF, which can be interpreted as an opaque alpha channel. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b\"></a>TJPF_CMYK</em>&nbsp;</td><td class=\"fielddoc\">\n<p>CMYK pixel format. </p>\n<p>Unlike RGB, which is an additive color model used primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive color model used primarily for printing. In the CMYK color model, the value of each color component typically corresponds to an amount of cyan, magenta, yellow, or black ink that is applied to a white background. In order to convert between CMYK and RGB, it is necessary to use a color management system (CMS.) A CMS will attempt to map colors within the printer's gamut to perceptually similar colors in the display's gamut and vice versa, but the mapping is typically not 1:1 or reversible, nor can it be defined with a simple formula. Thus, such a conversion is out of scope for a codec library. However, the TurboJPEG API allows for compressing CMYK pixels into a YCCK JPEG image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e\" title=\"YCCK colorspace.\">TJCS_YCCK</a>) and decompressing YCCK JPEG images into CMYK pixels. </p>\n</td></tr>\n</table>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga1d047060ea80bb9820d540bb928e9074\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">enum <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">TJSAMP</a></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Chrominance subsampling options. </p>\n<p>When pixels are converted from RGB to YCbCr (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75\" title=\"YCbCr colorspace.\">TJCS_YCbCr</a>) or from CMYK to YCCK (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e\" title=\"YCCK colorspace.\">TJCS_YCCK</a>) as part of the JPEG compression process, some of the Cb and Cr (chrominance) components can be discarded or averaged together to produce a smaller image with little perceptible loss of image clarity (the human eye is more sensitive to small changes in brightness than to small changes in color.) This is called \"chrominance subsampling\". </p>\n<table class=\"fieldtable\">\n<tr><th colspan=\"2\">Enumerator</th></tr><tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3\"></a>TJSAMP_444</em>&nbsp;</td><td class=\"fielddoc\">\n<p>4:4:4 chrominance subsampling (no chrominance subsampling). </p>\n<p>The JPEG or YUV image will contain one chrominance component for every pixel in the source image. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404\"></a>TJSAMP_422</em>&nbsp;</td><td class=\"fielddoc\">\n<p>4:2:2 chrominance subsampling. </p>\n<p>The JPEG or YUV image will contain one chrominance component for every 2x1 block of pixels in the source image. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737\"></a>TJSAMP_420</em>&nbsp;</td><td class=\"fielddoc\">\n<p>4:2:0 chrominance subsampling. </p>\n<p>The JPEG or YUV image will contain one chrominance component for every 2x2 block of pixels in the source image. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248\"></a>TJSAMP_GRAY</em>&nbsp;</td><td class=\"fielddoc\">\n<p>Grayscale. </p>\n<p>The JPEG or YUV image will contain no chrominance components. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974\"></a>TJSAMP_440</em>&nbsp;</td><td class=\"fielddoc\">\n<p>4:4:0 chrominance subsampling. </p>\n<p>The JPEG or YUV image will contain one chrominance component for every 1x2 block of pixels in the source image.</p>\n<dl class=\"section note\"><dt>Note</dt><dd>4:4:0 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2\"></a>TJSAMP_411</em>&nbsp;</td><td class=\"fielddoc\">\n<p>4:1:1 chrominance subsampling. </p>\n<p>The JPEG or YUV image will contain one chrominance component for every 4x1 block of pixels in the source image. JPEG images compressed with 4:1:1 subsampling will be almost exactly the same size as those compressed with 4:2:0 subsampling, and in the aggregate, both subsampling methods produce approximately the same perceptual quality. However, 4:1:1 is better able to reproduce sharp horizontal features.</p>\n<dl class=\"section note\"><dt>Note</dt><dd>4:1:1 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>\n</td></tr>\n</table>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga2de531af4e7e6c4f124908376b354866\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">enum <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866\">TJXOP</a></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Transform operations for <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a\" title=\"Losslessly transform a JPEG image into another JPEG image.\">tjTransform()</a> </p>\n<table class=\"fieldtable\">\n<tr><th colspan=\"2\">Enumerator</th></tr><tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27\"></a>TJXOP_NONE</em>&nbsp;</td><td class=\"fielddoc\">\n<p>Do not transform the position of the image pixels. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce\"></a>TJXOP_HFLIP</em>&nbsp;</td><td class=\"fielddoc\">\n<p>Flip (mirror) image horizontally. </p>\n<p>This transform is imperfect if there are any partial MCU blocks on the right edge (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00\" title=\"This option will cause tjTransform() to return an error if the transform is not perfect.\">TJXOPT_PERFECT</a>.) </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga2de531af4e7e6c4f124908376b354866a324eddfbec53b7e691f61e56929d0d5d\"></a>TJXOP_VFLIP</em>&nbsp;</td><td class=\"fielddoc\">\n<p>Flip (mirror) image vertically. </p>\n<p>This transform is imperfect if there are any partial MCU blocks on the bottom edge (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00\" title=\"This option will cause tjTransform() to return an error if the transform is not perfect.\">TJXOPT_PERFECT</a>.) </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga2de531af4e7e6c4f124908376b354866a31060aed199f886afdd417f80499c32d\"></a>TJXOP_TRANSPOSE</em>&nbsp;</td><td class=\"fielddoc\">\n<p>Transpose image (flip/mirror along upper left to lower right axis.) This transform is always perfect. </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4\"></a>TJXOP_TRANSVERSE</em>&nbsp;</td><td class=\"fielddoc\">\n<p>Transverse transpose image (flip/mirror along upper right to lower left axis.) This transform is imperfect if there are any partial MCU blocks in the image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00\" title=\"This option will cause tjTransform() to return an error if the transform is not perfect.\">TJXOPT_PERFECT</a>.) </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga2de531af4e7e6c4f124908376b354866a43b2bbb23bc4bd548422d43fbe9af128\"></a>TJXOP_ROT90</em>&nbsp;</td><td class=\"fielddoc\">\n<p>Rotate image clockwise by 90 degrees. </p>\n<p>This transform is imperfect if there are any partial MCU blocks on the bottom edge (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00\" title=\"This option will cause tjTransform() to return an error if the transform is not perfect.\">TJXOPT_PERFECT</a>.) </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga2de531af4e7e6c4f124908376b354866a140952eb8dd0300accfcc22726d69692\"></a>TJXOP_ROT180</em>&nbsp;</td><td class=\"fielddoc\">\n<p>Rotate image 180 degrees. </p>\n<p>This transform is imperfect if there are any partial MCU blocks in the image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00\" title=\"This option will cause tjTransform() to return an error if the transform is not perfect.\">TJXOPT_PERFECT</a>.) </p>\n</td></tr>\n<tr><td class=\"fieldname\"><em><a class=\"anchor\" id=\"gga2de531af4e7e6c4f124908376b354866a3064ee5dfb7f032df332818587567a08\"></a>TJXOP_ROT270</em>&nbsp;</td><td class=\"fielddoc\">\n<p>Rotate image counter-clockwise by 90 degrees. </p>\n<p>This transform is imperfect if there are any partial MCU blocks on the right edge (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00\" title=\"This option will cause tjTransform() to return an error if the transform is not perfect.\">TJXOPT_PERFECT</a>.) </p>\n</td></tr>\n</table>\n\n</div>\n</div>\n<h2 class=\"groupheader\">Function Documentation</h2>\n<a class=\"anchor\" id=\"ga5c9234bda6d993cdaffdd89bf81a00ff\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT unsigned char* DLLCALL tjAlloc </td>\n          <td>(</td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>bytes</em></td><td>)</td>\n          <td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Allocate an image buffer for use with TurboJPEG. </p>\n<p>You should always use this function to allocate the JPEG destination buffer(s) for <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaf38f2ed44bdc88e730e08b632fa6e88e\" title=\"Compress an RGB, grayscale, or CMYK image into a JPEG image.\">tjCompress2()</a> and <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a\" title=\"Losslessly transform a JPEG image into another JPEG image.\">tjTransform()</a> unless you are disabling automatic buffer (re)allocation (by setting <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963\" title=\"Disable buffer (re)allocation.\">TJFLAG_NOREALLOC</a>.)</p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">bytes</td><td>the number of bytes to allocate</td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>a pointer to a newly-allocated buffer with the specified number of bytes.</dd></dl>\n<dl class=\"section see\"><dt>See Also</dt><dd><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga8c4a1231dc06a450514c835f6471f137\" title=\"Free an image buffer previously allocated by TurboJPEG.\">tjFree()</a> </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gaccc5bca7f12fcdcc302e6e1c6d4b311b\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT unsigned long DLLCALL tjBufSize </td>\n          <td>(</td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>width</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>height</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>jpegSubsamp</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters. </p>\n<p>The number of bytes returned by this function is larger than the size of the uncompressed source image. The reason for this is that the JPEG format uses 16-bit coefficients, and it is thus possible for a very high-quality JPEG image with very high-frequency content to expand rather than compress when converted to the JPEG format. Such images represent a very rare corner case, but since there is no way to predict the size of a JPEG image prior to compression, the corner case has to be handled.</p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">width</td><td>width (in pixels) of the image</td></tr>\n    <tr><td class=\"paramname\">height</td><td>height (in pixels) of the image</td></tr>\n    <tr><td class=\"paramname\">jpegSubsamp</td><td>the level of chrominance subsampling to be used when generating the JPEG image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">Chrominance subsampling options</a>.)</td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>the maximum size of the buffer (in bytes) required to hold the image, or -1 if the arguments are out of bounds. </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gaf451664a62c1f6c7cc5a6401f32908c9\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT unsigned long DLLCALL tjBufSizeYUV2 </td>\n          <td>(</td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>width</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pad</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>height</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>subsamp</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters. </p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">width</td><td>width (in pixels) of the image</td></tr>\n    <tr><td class=\"paramname\">pad</td><td>the width of each line in each plane of the image is padded to the nearest multiple of this number of bytes (must be a power of 2.)</td></tr>\n    <tr><td class=\"paramname\">height</td><td>height (in pixels) of the image</td></tr>\n    <tr><td class=\"paramname\">subsamp</td><td>level of chrominance subsampling in the image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">Chrominance subsampling options</a>.)</td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>the size of the buffer (in bytes) required to hold the image, or -1 if the arguments are out of bounds. </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gaf38f2ed44bdc88e730e08b632fa6e88e\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT int DLLCALL tjCompress2 </td>\n          <td>(</td>\n          <td class=\"paramtype\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a>&#160;</td>\n          <td class=\"paramname\"><em>handle</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">const unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>srcBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>width</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pitch</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>height</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pixelFormat</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned char **&#160;</td>\n          <td class=\"paramname\"><em>jpegBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned long *&#160;</td>\n          <td class=\"paramname\"><em>jpegSize</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>jpegSubsamp</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>jpegQual</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>flags</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Compress an RGB, grayscale, or CMYK image into a JPEG image. </p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>\n    <tr><td class=\"paramname\">srcBuf</td><td>pointer to an image buffer containing RGB, grayscale, or CMYK pixels to be compressed</td></tr>\n    <tr><td class=\"paramname\">width</td><td>width (in pixels) of the source image</td></tr>\n    <tr><td class=\"paramname\">pitch</td><td>bytes per line in the source image. Normally, this should be <code>width * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511\" title=\"Pad the given width to the nearest 32-bit boundary.\">TJPAD</a>(width * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat]</code>.</td></tr>\n    <tr><td class=\"paramname\">height</td><td>height (in pixels) of the source image</td></tr>\n    <tr><td class=\"paramname\">pixelFormat</td><td>pixel format of the source image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a\">Pixel formats</a>.)</td></tr>\n    <tr><td class=\"paramname\">jpegBuf</td><td>address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type=\"1\">\n<li>pre-allocate the JPEG buffer with an arbitrary size using <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff\" title=\"Allocate an image buffer for use with TurboJPEG.\">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>\n<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>\n<li>pre-allocate the buffer to a \"worst case\" size determined by calling <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b\" title=\"The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...\">tjBufSize()</a>. This should ensure that the buffer never has to be re-allocated (setting <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963\" title=\"Disable buffer (re)allocation.\">TJFLAG_NOREALLOC</a> guarantees this.)</li>\n</ol>\nIf you choose option 1, <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963\" title=\"Disable buffer (re)allocation.\">TJFLAG_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>\n    <tr><td class=\"paramname\">jpegSize</td><td>pointer to an unsigned long variable that holds the size of the JPEG image buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG image buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>\n    <tr><td class=\"paramname\">jpegSubsamp</td><td>the level of chrominance subsampling to be used when generating the JPEG image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">Chrominance subsampling options</a>.)</td></tr>\n    <tr><td class=\"paramname\">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best)</td></tr>\n    <tr><td class=\"paramname\">flags</td><td>the bitwise OR of one or more of the <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec\">flags</a></td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga6f6de375d6ec0020faba627e37e5a060\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT int DLLCALL tjCompressFromYUV </td>\n          <td>(</td>\n          <td class=\"paramtype\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a>&#160;</td>\n          <td class=\"paramname\"><em>handle</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">const unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>srcBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>width</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pad</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>height</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>subsamp</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned char **&#160;</td>\n          <td class=\"paramname\"><em>jpegBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned long *&#160;</td>\n          <td class=\"paramname\"><em>jpegSize</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>jpegQual</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>flags</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Compress a YUV planar image into a JPEG image. </p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>\n    <tr><td class=\"paramname\">srcBuf</td><td>pointer to an image buffer containing a YUV planar image to be compressed. The size of this buffer should match the value returned by <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9\" title=\"The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...\">tjBufSizeYUV2()</a> for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to <a class=\"el\" href=\"group___turbo_j_p_e_g.html#YUVnotes\">YUV Image Format Notes</a>.)</td></tr>\n    <tr><td class=\"paramname\">width</td><td>width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c\" title=\"MCU block width (in pixels) for a given level of chrominance subsampling.\">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>\n    <tr><td class=\"paramname\">pad</td><td>the line padding used in the source image. For instance, if each line in each plane of the YUV image is padded to the nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</td></tr>\n    <tr><td class=\"paramname\">height</td><td>height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf\" title=\"MCU block height (in pixels) for a given level of chrominance subsampling.\">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>\n    <tr><td class=\"paramname\">subsamp</td><td>the level of chrominance subsampling used in the source image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">Chrominance subsampling options</a>.)</td></tr>\n    <tr><td class=\"paramname\">jpegBuf</td><td>address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type=\"1\">\n<li>pre-allocate the JPEG buffer with an arbitrary size using <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff\" title=\"Allocate an image buffer for use with TurboJPEG.\">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>\n<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>\n<li>pre-allocate the buffer to a \"worst case\" size determined by calling <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b\" title=\"The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...\">tjBufSize()</a>. This should ensure that the buffer never has to be re-allocated (setting <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963\" title=\"Disable buffer (re)allocation.\">TJFLAG_NOREALLOC</a> guarantees this.)</li>\n</ol>\nIf you choose option 1, <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963\" title=\"Disable buffer (re)allocation.\">TJFLAG_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>\n    <tr><td class=\"paramname\">jpegSize</td><td>pointer to an unsigned long variable that holds the size of the JPEG image buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG image buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>\n    <tr><td class=\"paramname\">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best)</td></tr>\n    <tr><td class=\"paramname\">flags</td><td>the bitwise OR of one or more of the <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec\">flags</a></td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga0b84c682d8accf097d7a743c965d3464\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT int DLLCALL tjCompressFromYUVPlanes </td>\n          <td>(</td>\n          <td class=\"paramtype\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a>&#160;</td>\n          <td class=\"paramname\"><em>handle</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">const unsigned char **&#160;</td>\n          <td class=\"paramname\"><em>srcPlanes</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>width</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">const int *&#160;</td>\n          <td class=\"paramname\"><em>strides</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>height</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>subsamp</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned char **&#160;</td>\n          <td class=\"paramname\"><em>jpegBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned long *&#160;</td>\n          <td class=\"paramname\"><em>jpegSize</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>jpegQual</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>flags</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image. </p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>\n    <tr><td class=\"paramname\">srcPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if compressing a grayscale image) that contain a YUV image to be compressed. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2\" title=\"The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters...\">tjPlaneSizeYUV()</a> for the given image width, height, strides, and level of chrominance subsampling. Refer to <a class=\"el\" href=\"group___turbo_j_p_e_g.html#YUVnotes\">YUV Image Format Notes</a> for more details.</td></tr>\n    <tr><td class=\"paramname\">width</td><td>width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c\" title=\"MCU block width (in pixels) for a given level of chrominance subsampling.\">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>\n    <tr><td class=\"paramname\">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#YUVnotes\">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to specify an arbitrary amount of line padding in each plane or to create a JPEG image from a subregion of a larger YUV planar image.</td></tr>\n    <tr><td class=\"paramname\">height</td><td>height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf\" title=\"MCU block height (in pixels) for a given level of chrominance subsampling.\">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>\n    <tr><td class=\"paramname\">subsamp</td><td>the level of chrominance subsampling used in the source image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">Chrominance subsampling options</a>.)</td></tr>\n    <tr><td class=\"paramname\">jpegBuf</td><td>address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type=\"1\">\n<li>pre-allocate the JPEG buffer with an arbitrary size using <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff\" title=\"Allocate an image buffer for use with TurboJPEG.\">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>\n<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>\n<li>pre-allocate the buffer to a \"worst case\" size determined by calling <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b\" title=\"The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...\">tjBufSize()</a>. This should ensure that the buffer never has to be re-allocated (setting <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963\" title=\"Disable buffer (re)allocation.\">TJFLAG_NOREALLOC</a> guarantees this.)</li>\n</ol>\nIf you choose option 1, <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963\" title=\"Disable buffer (re)allocation.\">TJFLAG_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>\n    <tr><td class=\"paramname\">jpegSize</td><td>pointer to an unsigned long variable that holds the size of the JPEG image buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG image buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>\n    <tr><td class=\"paramname\">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best)</td></tr>\n    <tr><td class=\"paramname\">flags</td><td>the bitwise OR of one or more of the <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec\">flags</a></td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga077c61027b875afecd5a1613bf18b3c1\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT int DLLCALL tjDecodeYUV </td>\n          <td>(</td>\n          <td class=\"paramtype\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a>&#160;</td>\n          <td class=\"paramname\"><em>handle</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">const unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>srcBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pad</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>subsamp</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>dstBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>width</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pitch</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>height</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pixelFormat</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>flags</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Decode a YUV planar image into an RGB or grayscale image. </p>\n<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG decompression process.</p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>\n    <tr><td class=\"paramname\">srcBuf</td><td>pointer to an image buffer containing a YUV planar image to be decoded. The size of this buffer should match the value returned by <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9\" title=\"The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...\">tjBufSizeYUV2()</a> for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to <a class=\"el\" href=\"group___turbo_j_p_e_g.html#YUVnotes\">YUV Image Format Notes</a>.)</td></tr>\n    <tr><td class=\"paramname\">pad</td><td>Use this parameter to specify that the width of each line in each plane of the YUV source image is padded to the nearest multiple of this number of bytes (must be a power of 2.)</td></tr>\n    <tr><td class=\"paramname\">subsamp</td><td>the level of chrominance subsampling used in the YUV source image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">Chrominance subsampling options</a>.)</td></tr>\n    <tr><td class=\"paramname\">dstBuf</td><td>pointer to an image buffer that will receive the decoded image. This buffer should normally be <code>pitch * height</code> bytes in size, but the <code>dstBuf</code> pointer can also be used to decode into a specific region of a larger buffer.</td></tr>\n    <tr><td class=\"paramname\">width</td><td>width (in pixels) of the source and destination images</td></tr>\n    <tr><td class=\"paramname\">pitch</td><td>bytes per line in the destination image. Normally, this should be <code>width * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat]</code> if the destination image is unpadded, or <code><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511\" title=\"Pad the given width to the nearest 32-bit boundary.\">TJPAD</a>(width * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat])</code> if each line of the destination image should be padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat]</code>.</td></tr>\n    <tr><td class=\"paramname\">height</td><td>height (in pixels) of the source and destination images</td></tr>\n    <tr><td class=\"paramname\">pixelFormat</td><td>pixel format of the destination image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a\">Pixel formats</a>.)</td></tr>\n    <tr><td class=\"paramname\">flags</td><td>the bitwise OR of one or more of the <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec\">flags</a></td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gaf42f19b7a496eb18bdc84fe61ee6d3e2\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT int DLLCALL tjDecodeYUVPlanes </td>\n          <td>(</td>\n          <td class=\"paramtype\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a>&#160;</td>\n          <td class=\"paramname\"><em>handle</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">const unsigned char **&#160;</td>\n          <td class=\"paramname\"><em>srcPlanes</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">const int *&#160;</td>\n          <td class=\"paramname\"><em>strides</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>subsamp</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>dstBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>width</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pitch</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>height</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pixelFormat</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>flags</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Decode a set of Y, U (Cb), and V (Cr) image planes into an RGB or grayscale image. </p>\n<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG decompression process.</p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>\n    <tr><td class=\"paramname\">srcPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decoding a grayscale image) that contain a YUV image to be decoded. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2\" title=\"The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters...\">tjPlaneSizeYUV()</a> for the given image width, height, strides, and level of chrominance subsampling. Refer to <a class=\"el\" href=\"group___turbo_j_p_e_g.html#YUVnotes\">YUV Image Format Notes</a> for more details.</td></tr>\n    <tr><td class=\"paramname\">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#YUVnotes\">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to specify an arbitrary amount of line padding in each plane or to decode a subregion of a larger YUV planar image.</td></tr>\n    <tr><td class=\"paramname\">subsamp</td><td>the level of chrominance subsampling used in the YUV source image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">Chrominance subsampling options</a>.)</td></tr>\n    <tr><td class=\"paramname\">dstBuf</td><td>pointer to an image buffer that will receive the decoded image. This buffer should normally be <code>pitch * height</code> bytes in size, but the <code>dstBuf</code> pointer can also be used to decode into a specific region of a larger buffer.</td></tr>\n    <tr><td class=\"paramname\">width</td><td>width (in pixels) of the source and destination images</td></tr>\n    <tr><td class=\"paramname\">pitch</td><td>bytes per line in the destination image. Normally, this should be <code>width * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat]</code> if the destination image is unpadded, or <code><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511\" title=\"Pad the given width to the nearest 32-bit boundary.\">TJPAD</a>(width * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat])</code> if each line of the destination image should be padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat]</code>.</td></tr>\n    <tr><td class=\"paramname\">height</td><td>height (in pixels) of the source and destination images</td></tr>\n    <tr><td class=\"paramname\">pixelFormat</td><td>pixel format of the destination image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a\">Pixel formats</a>.)</td></tr>\n    <tr><td class=\"paramname\">flags</td><td>the bitwise OR of one or more of the <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec\">flags</a></td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gad8026a417e16a76313bc0a6c9e8b2ba2\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT int DLLCALL tjDecompress2 </td>\n          <td>(</td>\n          <td class=\"paramtype\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a>&#160;</td>\n          <td class=\"paramname\"><em>handle</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">const unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>jpegBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned long&#160;</td>\n          <td class=\"paramname\"><em>jpegSize</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>dstBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>width</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pitch</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>height</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pixelFormat</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>flags</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Decompress a JPEG image to an RGB, grayscale, or CMYK image. </p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>\n    <tr><td class=\"paramname\">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress</td></tr>\n    <tr><td class=\"paramname\">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>\n    <tr><td class=\"paramname\">dstBuf</td><td>pointer to an image buffer that will receive the decompressed image. This buffer should normally be <code>pitch * scaledHeight</code> bytes in size, where <code>scaledHeight</code> can be determined by calling <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df\" title=\"Compute the scaled value of dimension using the given scaling factor.\">TJSCALED()</a> with the JPEG image height and one of the scaling factors returned by <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8\" title=\"Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...\">tjGetScalingFactors()</a>. The <code>dstBuf</code> pointer may also be used to decompress into a specific region of a larger buffer.</td></tr>\n    <tr><td class=\"paramname\">width</td><td>desired width (in pixels) of the destination image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size.</td></tr>\n    <tr><td class=\"paramname\">pitch</td><td>bytes per line in the destination image. Normally, this is <code>scaledWidth * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat]</code> if the decompressed image is unpadded, else <code><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511\" title=\"Pad the given width to the nearest 32-bit boundary.\">TJPAD</a>(scaledWidth * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat])</code> if each line of the decompressed image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. (NOTE: <code>scaledWidth</code> can be determined by calling <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df\" title=\"Compute the scaled value of dimension using the given scaling factor.\">TJSCALED()</a> with the JPEG image width and one of the scaling factors returned by <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8\" title=\"Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...\">tjGetScalingFactors()</a>.) You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>scaledWidth * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat]</code>.</td></tr>\n    <tr><td class=\"paramname\">height</td><td>desired height (in pixels) of the destination image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size.</td></tr>\n    <tr><td class=\"paramname\">pixelFormat</td><td>pixel format of the destination image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a\">Pixel formats</a>.)</td></tr>\n    <tr><td class=\"paramname\">flags</td><td>the bitwise OR of one or more of the <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec\">flags</a></td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga3fced455e504e8ff4fbad28ba94a3020\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT int DLLCALL tjDecompressHeader3 </td>\n          <td>(</td>\n          <td class=\"paramtype\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a>&#160;</td>\n          <td class=\"paramname\"><em>handle</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">const unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>jpegBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned long&#160;</td>\n          <td class=\"paramname\"><em>jpegSize</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int *&#160;</td>\n          <td class=\"paramname\"><em>width</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int *&#160;</td>\n          <td class=\"paramname\"><em>height</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int *&#160;</td>\n          <td class=\"paramname\"><em>jpegSubsamp</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int *&#160;</td>\n          <td class=\"paramname\"><em>jpegColorspace</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Retrieve information about a JPEG image without decompressing it. </p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>\n    <tr><td class=\"paramname\">jpegBuf</td><td>pointer to a buffer containing a JPEG image</td></tr>\n    <tr><td class=\"paramname\">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>\n    <tr><td class=\"paramname\">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the JPEG image</td></tr>\n    <tr><td class=\"paramname\">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the JPEG image</td></tr>\n    <tr><td class=\"paramname\">jpegSubsamp</td><td>pointer to an integer variable that will receive the level of chrominance subsampling used when the JPEG image was compressed (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">Chrominance subsampling options</a>.)</td></tr>\n    <tr><td class=\"paramname\">jpegColorspace</td><td>pointer to an integer variable that will receive one of the JPEG colorspace constants, indicating the colorspace of the JPEG image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720\">JPEG colorspaces</a>.)</td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga39e08906528db5a764670ea48d344b09\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT int DLLCALL tjDecompressToYUV2 </td>\n          <td>(</td>\n          <td class=\"paramtype\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a>&#160;</td>\n          <td class=\"paramname\"><em>handle</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">const unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>jpegBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned long&#160;</td>\n          <td class=\"paramname\"><em>jpegSize</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>dstBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>width</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pad</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>height</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>flags</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Decompress a JPEG image to a YUV planar image. </p>\n<p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image.</p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>\n    <tr><td class=\"paramname\">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress</td></tr>\n    <tr><td class=\"paramname\">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>\n    <tr><td class=\"paramname\">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9\" title=\"The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...\">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of subsampling. The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer (refer to <a class=\"el\" href=\"group___turbo_j_p_e_g.html#YUVnotes\">YUV Image Format Notes</a>.)</td></tr>\n    <tr><td class=\"paramname\">width</td><td>desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. If the scaled width is not an even multiple of the MCU block width (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c\" title=\"MCU block width (in pixels) for a given level of chrominance subsampling.\">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>\n    <tr><td class=\"paramname\">pad</td><td>the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, <code>pad</code> should be set to 4.</td></tr>\n    <tr><td class=\"paramname\">height</td><td>desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. If the scaled height is not an even multiple of the MCU block height (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf\" title=\"MCU block height (in pixels) for a given level of chrominance subsampling.\">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>\n    <tr><td class=\"paramname\">flags</td><td>the bitwise OR of one or more of the <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec\">flags</a></td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga38d0ef90692663b3ffb5b16da2541512\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT int DLLCALL tjDecompressToYUVPlanes </td>\n          <td>(</td>\n          <td class=\"paramtype\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a>&#160;</td>\n          <td class=\"paramname\"><em>handle</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">const unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>jpegBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned long&#160;</td>\n          <td class=\"paramname\"><em>jpegSize</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned char **&#160;</td>\n          <td class=\"paramname\"><em>dstPlanes</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>width</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int *&#160;</td>\n          <td class=\"paramname\"><em>strides</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>height</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>flags</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Decompress a JPEG image into separate Y, U (Cb), and V (Cr) image planes. </p>\n<p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image.</p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>\n    <tr><td class=\"paramname\">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress</td></tr>\n    <tr><td class=\"paramname\">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>\n    <tr><td class=\"paramname\">dstPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decompressing a grayscale image) that will receive the YUV image. These planes can be contiguous or non-contiguous in memory. Use <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2\" title=\"The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters...\">tjPlaneSizeYUV()</a> to determine the appropriate size for each plane based on the scaled image width, scaled image height, strides, and level of chrominance subsampling. Refer to <a class=\"el\" href=\"group___turbo_j_p_e_g.html#YUVnotes\">YUV Image Format Notes</a> for more details.</td></tr>\n    <tr><td class=\"paramname\">width</td><td>desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. If the scaled width is not an even multiple of the MCU block width (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c\" title=\"MCU block width (in pixels) for a given level of chrominance subsampling.\">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>\n    <tr><td class=\"paramname\">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the output image. Setting the stride for any plane to 0 is the same as setting it to the scaled plane width (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#YUVnotes\">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective scaled plane widths. You can adjust the strides in order to add an arbitrary amount of line padding to each plane or to decompress the JPEG image into a subregion of a larger YUV planar image.</td></tr>\n    <tr><td class=\"paramname\">height</td><td>desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. If the scaled height is not an even multiple of the MCU block height (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf\" title=\"MCU block height (in pixels) for a given level of chrominance subsampling.\">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>\n    <tr><td class=\"paramname\">flags</td><td>the bitwise OR of one or more of the <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec\">flags</a></td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga674adee917b95ad4a896f1ba39e12540\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT int DLLCALL tjDestroy </td>\n          <td>(</td>\n          <td class=\"paramtype\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a>&#160;</td>\n          <td class=\"paramname\"><em>handle</em></td><td>)</td>\n          <td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Destroy a TurboJPEG compressor, decompressor, or transformer instance. </p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">handle</td><td>a handle to a TurboJPEG compressor, decompressor or transformer instance</td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gaabe05acd734990053ad1294b5ef239aa\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT int DLLCALL tjEncodeYUV3 </td>\n          <td>(</td>\n          <td class=\"paramtype\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a>&#160;</td>\n          <td class=\"paramname\"><em>handle</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">const unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>srcBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>width</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pitch</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>height</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pixelFormat</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>dstBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pad</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>subsamp</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>flags</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Encode an RGB or grayscale image into a YUV planar image. </p>\n<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG compression process.</p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>\n    <tr><td class=\"paramname\">srcBuf</td><td>pointer to an image buffer containing RGB or grayscale pixels to be encoded</td></tr>\n    <tr><td class=\"paramname\">width</td><td>width (in pixels) of the source image</td></tr>\n    <tr><td class=\"paramname\">pitch</td><td>bytes per line in the source image. Normally, this should be <code>width * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511\" title=\"Pad the given width to the nearest 32-bit boundary.\">TJPAD</a>(width * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat]</code>.</td></tr>\n    <tr><td class=\"paramname\">height</td><td>height (in pixels) of the source image</td></tr>\n    <tr><td class=\"paramname\">pixelFormat</td><td>pixel format of the source image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a\">Pixel formats</a>.)</td></tr>\n    <tr><td class=\"paramname\">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9\" title=\"The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...\">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer (refer to <a class=\"el\" href=\"group___turbo_j_p_e_g.html#YUVnotes\">YUV Image Format Notes</a>.)</td></tr>\n    <tr><td class=\"paramname\">pad</td><td>the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, <code>pad</code> should be set to 4.</td></tr>\n    <tr><td class=\"paramname\">subsamp</td><td>the level of chrominance subsampling to be used when generating the YUV image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">Chrominance subsampling options</a>.) To generate images suitable for X Video, <code>subsamp</code> should be set to <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737\">TJSAMP_420</a>. This produces an image compatible with the I420 (AKA \"YUV420P\") format.</td></tr>\n    <tr><td class=\"paramname\">flags</td><td>the bitwise OR of one or more of the <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec\">flags</a></td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga8a65ed3bd12df57c219d46afbc9008f1\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT int DLLCALL tjEncodeYUVPlanes </td>\n          <td>(</td>\n          <td class=\"paramtype\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a>&#160;</td>\n          <td class=\"paramname\"><em>handle</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">const unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>srcBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>width</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pitch</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>height</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>pixelFormat</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned char **&#160;</td>\n          <td class=\"paramname\"><em>dstPlanes</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int *&#160;</td>\n          <td class=\"paramname\"><em>strides</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>subsamp</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>flags</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Encode an RGB or grayscale image into separate Y, U (Cb), and V (Cr) image planes. </p>\n<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG compression process.</p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>\n    <tr><td class=\"paramname\">srcBuf</td><td>pointer to an image buffer containing RGB or grayscale pixels to be encoded</td></tr>\n    <tr><td class=\"paramname\">width</td><td>width (in pixels) of the source image</td></tr>\n    <tr><td class=\"paramname\">pitch</td><td>bytes per line in the source image. Normally, this should be <code>width * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511\" title=\"Pad the given width to the nearest 32-bit boundary.\">TJPAD</a>(width * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c\" title=\"Pixel size (in bytes) for a given pixel format.\">tjPixelSize</a>[pixelFormat]</code>.</td></tr>\n    <tr><td class=\"paramname\">height</td><td>height (in pixels) of the source image</td></tr>\n    <tr><td class=\"paramname\">pixelFormat</td><td>pixel format of the source image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a\">Pixel formats</a>.)</td></tr>\n    <tr><td class=\"paramname\">dstPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if generating a grayscale image) that will receive the encoded image. These planes can be contiguous or non-contiguous in memory. Use <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2\" title=\"The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters...\">tjPlaneSizeYUV()</a> to determine the appropriate size for each plane based on the image width, height, strides, and level of chrominance subsampling. Refer to <a class=\"el\" href=\"group___turbo_j_p_e_g.html#YUVnotes\">YUV Image Format Notes</a> for more details.</td></tr>\n    <tr><td class=\"paramname\">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the output image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#YUVnotes\">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to add an arbitrary amount of line padding to each plane or to encode an RGB or grayscale image into a subregion of a larger YUV planar image.</td></tr>\n    <tr><td class=\"paramname\">subsamp</td><td>the level of chrominance subsampling to be used when generating the YUV image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">Chrominance subsampling options</a>.) To generate images suitable for X Video, <code>subsamp</code> should be set to <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737\">TJSAMP_420</a>. This produces an image compatible with the I420 (AKA \"YUV420P\") format.</td></tr>\n    <tr><td class=\"paramname\">flags</td><td>the bitwise OR of one or more of the <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec\">flags</a></td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga8c4a1231dc06a450514c835f6471f137\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT void DLLCALL tjFree </td>\n          <td>(</td>\n          <td class=\"paramtype\">unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>buffer</em></td><td>)</td>\n          <td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Free an image buffer previously allocated by TurboJPEG. </p>\n<p>You should always use this function to free JPEG destination buffer(s) that were automatically (re)allocated by <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaf38f2ed44bdc88e730e08b632fa6e88e\" title=\"Compress an RGB, grayscale, or CMYK image into a JPEG image.\">tjCompress2()</a> or <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a\" title=\"Losslessly transform a JPEG image into another JPEG image.\">tjTransform()</a> or that were manually allocated using <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff\" title=\"Allocate an image buffer for use with TurboJPEG.\">tjAlloc()</a>.</p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">buffer</td><td>address of the buffer to free</td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section see\"><dt>See Also</dt><dd><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff\" title=\"Allocate an image buffer for use with TurboJPEG.\">tjAlloc()</a> </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga9af79c908ec131b1ae8d52fe40375abf\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT char* DLLCALL tjGetErrorStr </td>\n          <td>(</td>\n          <td class=\"paramtype\">void&#160;</td>\n          <td class=\"paramname\"></td><td>)</td>\n          <td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Returns a descriptive error message explaining why the last command failed. </p>\n<dl class=\"section return\"><dt>Returns</dt><dd>a descriptive error message explaining why the last command failed. </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga6449044b9af402999ccf52f401333be8\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT <a class=\"el\" href=\"structtjscalingfactor.html\">tjscalingfactor</a>* DLLCALL tjGetScalingFactors </td>\n          <td>(</td>\n          <td class=\"paramtype\">int *&#160;</td>\n          <td class=\"paramname\"><em>numscalingfactors</em></td><td>)</td>\n          <td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of TurboJPEG supports. </p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">numscalingfactors</td><td>pointer to an integer variable that will receive the number of elements in the list</td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>a pointer to a list of fractional scaling factors, or NULL if an error is encountered (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga3d10c47fbe4a2489a2b30c931551d01a\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> DLLCALL tjInitCompress </td>\n          <td>(</td>\n          <td class=\"paramtype\">void&#160;</td>\n          <td class=\"paramname\"></td><td>)</td>\n          <td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Create a TurboJPEG compressor instance. </p>\n<dl class=\"section return\"><dt>Returns</dt><dd>a handle to the newly-created instance, or NULL if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gae5408179d041e2a2f7199c8283cf649e\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> DLLCALL tjInitDecompress </td>\n          <td>(</td>\n          <td class=\"paramtype\">void&#160;</td>\n          <td class=\"paramname\"></td><td>)</td>\n          <td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Create a TurboJPEG decompressor instance. </p>\n<dl class=\"section return\"><dt>Returns</dt><dd>a handle to the newly-created instance, or NULL if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga3155b775bfbac9dbba869b95a0367902\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a> DLLCALL tjInitTransform </td>\n          <td>(</td>\n          <td class=\"paramtype\">void&#160;</td>\n          <td class=\"paramname\"></td><td>)</td>\n          <td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Create a new TurboJPEG transformer instance. </p>\n<dl class=\"section return\"><dt>Returns</dt><dd>a handle to the newly-created instance, or NULL if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga1a209696c6a80748f20e134b3c64789f\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT int tjPlaneHeight </td>\n          <td>(</td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>componentID</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>height</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>subsamp</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>The plane height of a YUV image plane with the given parameters. </p>\n<p>Refer to <a class=\"el\" href=\"group___turbo_j_p_e_g.html#YUVnotes\">YUV Image Format Notes</a> for a description of plane height.</p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>\n    <tr><td class=\"paramname\">height</td><td>height (in pixels) of the YUV image</td></tr>\n    <tr><td class=\"paramname\">subsamp</td><td>level of chrominance subsampling in the image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">Chrominance subsampling options</a>.)</td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>the plane height of a YUV image plane with the given parameters, or -1 if the arguments are out of bounds. </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga6f98d977bfa9d167c97172e876ba61e2\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT unsigned long DLLCALL tjPlaneSizeYUV </td>\n          <td>(</td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>componentID</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>width</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>stride</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>height</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>subsamp</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters. </p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>\n    <tr><td class=\"paramname\">width</td><td>width (in pixels) of the YUV image. NOTE: this is the width of the whole image, not the plane width.</td></tr>\n    <tr><td class=\"paramname\">stride</td><td>bytes per line in the image plane. Setting this to 0 is the equivalent of setting it to the plane width.</td></tr>\n    <tr><td class=\"paramname\">height</td><td>height (in pixels) of the YUV image. NOTE: this is the height of the whole image, not the plane height.</td></tr>\n    <tr><td class=\"paramname\">subsamp</td><td>level of chrominance subsampling in the image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">Chrominance subsampling options</a>.)</td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>the size of the buffer (in bytes) required to hold the YUV image plane, or -1 if the arguments are out of bounds. </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga63fb66bb1e36c74008c4634360becbb1\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT int tjPlaneWidth </td>\n          <td>(</td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>componentID</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>width</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>subsamp</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>The plane width of a YUV image plane with the given parameters. </p>\n<p>Refer to <a class=\"el\" href=\"group___turbo_j_p_e_g.html#YUVnotes\">YUV Image Format Notes</a> for a description of plane width.</p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>\n    <tr><td class=\"paramname\">width</td><td>width (in pixels) of the YUV image</td></tr>\n    <tr><td class=\"paramname\">subsamp</td><td>level of chrominance subsampling in the image (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074\">Chrominance subsampling options</a>.)</td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>the plane width of a YUV image plane with the given parameters, or -1 if the arguments are out of bounds. </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gad02cd42b69f193a0623a9c801788df3a\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">DLLEXPORT int DLLCALL tjTransform </td>\n          <td>(</td>\n          <td class=\"paramtype\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763\">tjhandle</a>&#160;</td>\n          <td class=\"paramname\"><em>handle</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">const unsigned char *&#160;</td>\n          <td class=\"paramname\"><em>jpegBuf</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned long&#160;</td>\n          <td class=\"paramname\"><em>jpegSize</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>n</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned char **&#160;</td>\n          <td class=\"paramname\"><em>dstBufs</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">unsigned long *&#160;</td>\n          <td class=\"paramname\"><em>dstSizes</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\"><a class=\"el\" href=\"structtjtransform.html\">tjtransform</a> *&#160;</td>\n          <td class=\"paramname\"><em>transforms</em>, </td>\n        </tr>\n        <tr>\n          <td class=\"paramkey\"></td>\n          <td></td>\n          <td class=\"paramtype\">int&#160;</td>\n          <td class=\"paramname\"><em>flags</em>&#160;</td>\n        </tr>\n        <tr>\n          <td></td>\n          <td>)</td>\n          <td></td><td></td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Losslessly transform a JPEG image into another JPEG image. </p>\n<p>Lossless transforms work by moving the raw DCT coefficients from one JPEG image structure to another without altering the values of the coefficients. While this is typically faster than decompressing the image, transforming it, and re-compressing it, lossless transforms are not free. Each lossless transform requires reading and performing Huffman decoding on all of the coefficients in the source image, regardless of the size of the destination image. Thus, this function provides a means of generating multiple transformed images from the same source or applying multiple transformations simultaneously, in order to eliminate the need to read the source coefficients multiple times.</p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">handle</td><td>a handle to a TurboJPEG transformer instance</td></tr>\n    <tr><td class=\"paramname\">jpegBuf</td><td>pointer to a buffer containing the JPEG source image to transform</td></tr>\n    <tr><td class=\"paramname\">jpegSize</td><td>size of the JPEG source image (in bytes)</td></tr>\n    <tr><td class=\"paramname\">n</td><td>the number of transformed JPEG images to generate</td></tr>\n    <tr><td class=\"paramname\">dstBufs</td><td>pointer to an array of n image buffers. <code>dstBufs[i]</code> will receive a JPEG image that has been transformed using the parameters in <code>transforms[i]</code>. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type=\"1\">\n<li>pre-allocate the JPEG buffer with an arbitrary size using <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff\" title=\"Allocate an image buffer for use with TurboJPEG.\">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>\n<li>set <code>dstBufs[i]</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>\n<li>pre-allocate the buffer to a \"worst case\" size determined by calling <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b\" title=\"The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...\">tjBufSize()</a> with the transformed or cropped width and height. This should ensure that the buffer never has to be re-allocated (setting <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963\" title=\"Disable buffer (re)allocation.\">TJFLAG_NOREALLOC</a> guarantees this.)</li>\n</ol>\nIf you choose option 1, <code>dstSizes[i]</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963\" title=\"Disable buffer (re)allocation.\">TJFLAG_NOREALLOC</a>, you should always check <code>dstBufs[i]</code> upon return from this function, as it may have changed.</td></tr>\n    <tr><td class=\"paramname\">dstSizes</td><td>pointer to an array of n unsigned long variables that will receive the actual sizes (in bytes) of each transformed JPEG image. If <code>dstBufs[i]</code> points to a pre-allocated buffer, then <code>dstSizes[i]</code> should be set to the size of the buffer. Upon return, <code>dstSizes[i]</code> will contain the size of the JPEG image (in bytes.)</td></tr>\n    <tr><td class=\"paramname\">transforms</td><td>pointer to an array of n <a class=\"el\" href=\"structtjtransform.html\" title=\"Lossless transform.\">tjtransform</a> structures, each of which specifies the transform parameters and/or cropping region for the corresponding transformed output image.</td></tr>\n    <tr><td class=\"paramname\">flags</td><td>the bitwise OR of one or more of the <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec\">flags</a></td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf\" title=\"Returns a descriptive error message explaining why the last command failed.\">tjGetErrorStr()</a>.) </dd></dl>\n\n</div>\n</div>\n<h2 class=\"groupheader\">Variable Documentation</h2>\n<a class=\"anchor\" id=\"ga84e2e35d3f08025f976ec1ec53693dea\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n<table class=\"mlabels\">\n  <tr>\n  <td class=\"mlabels-left\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">const int tjBlueOffset[<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e\">TJ_NUMPF</a>]</td>\n        </tr>\n      </table>\n  </td>\n  <td class=\"mlabels-right\">\n<span class=\"mlabels\"><span class=\"mlabel\">static</span></span>  </td>\n  </tr>\n</table>\n</div><div class=\"memdoc\">\n\n<p>Blue offset (in bytes) for a given pixel format. </p>\n<p>This specifies the number of bytes that the Blue component is offset from the start of the pixel. For instance, if a pixel of format TJ_BGRX is stored in <code>char pixel[]</code>, then the blue component will be <code>pixel[tjBlueOffset[TJ_BGRX]]</code>. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga82d6e35da441112a411da41923c0ba2f\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n<table class=\"mlabels\">\n  <tr>\n  <td class=\"mlabels-left\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">const int tjGreenOffset[<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e\">TJ_NUMPF</a>]</td>\n        </tr>\n      </table>\n  </td>\n  <td class=\"mlabels-right\">\n<span class=\"mlabels\"><span class=\"mlabel\">static</span></span>  </td>\n  </tr>\n</table>\n</div><div class=\"memdoc\">\n\n<p>Green offset (in bytes) for a given pixel format. </p>\n<p>This specifies the number of bytes that the green component is offset from the start of the pixel. For instance, if a pixel of format TJ_BGRX is stored in <code>char pixel[]</code>, then the green component will be <code>pixel[tjGreenOffset[TJ_BGRX]]</code>. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gabd247bb9fecb393eca57366feb8327bf\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n<table class=\"mlabels\">\n  <tr>\n  <td class=\"mlabels-left\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">const int tjMCUHeight[<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c\">TJ_NUMSAMP</a>]</td>\n        </tr>\n      </table>\n  </td>\n  <td class=\"mlabels-right\">\n<span class=\"mlabels\"><span class=\"mlabel\">static</span></span>  </td>\n  </tr>\n</table>\n</div><div class=\"memdoc\">\n\n<p>MCU block height (in pixels) for a given level of chrominance subsampling. </p>\n<p>MCU block sizes:</p>\n<ul>\n<li>8x8 for no subsampling or grayscale</li>\n<li>16x8 for 4:2:2</li>\n<li>8x16 for 4:4:0</li>\n<li>16x16 for 4:2:0</li>\n<li>32x8 for 4:1:1 </li>\n</ul>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ga9e61e7cd47a15a173283ba94e781308c\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n<table class=\"mlabels\">\n  <tr>\n  <td class=\"mlabels-left\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">const int tjMCUWidth[<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c\">TJ_NUMSAMP</a>]</td>\n        </tr>\n      </table>\n  </td>\n  <td class=\"mlabels-right\">\n<span class=\"mlabels\"><span class=\"mlabel\">static</span></span>  </td>\n  </tr>\n</table>\n</div><div class=\"memdoc\">\n\n<p>MCU block width (in pixels) for a given level of chrominance subsampling. </p>\n<p>MCU block sizes:</p>\n<ul>\n<li>8x8 for no subsampling or grayscale</li>\n<li>16x8 for 4:2:2</li>\n<li>8x16 for 4:4:0</li>\n<li>16x16 for 4:2:0</li>\n<li>32x8 for 4:1:1 </li>\n</ul>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gad77cf8fe5b2bfd3cb3f53098146abb4c\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n<table class=\"mlabels\">\n  <tr>\n  <td class=\"mlabels-left\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">const int tjPixelSize[<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e\">TJ_NUMPF</a>]</td>\n        </tr>\n      </table>\n  </td>\n  <td class=\"mlabels-right\">\n<span class=\"mlabels\"><span class=\"mlabel\">static</span></span>  </td>\n  </tr>\n</table>\n</div><div class=\"memdoc\">\n\n<p>Pixel size (in bytes) for a given pixel format. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"gadd9b446742ac8a3923f7992c7988fea8\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n<table class=\"mlabels\">\n  <tr>\n  <td class=\"mlabels-left\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">const int tjRedOffset[<a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e\">TJ_NUMPF</a>]</td>\n        </tr>\n      </table>\n  </td>\n  <td class=\"mlabels-right\">\n<span class=\"mlabels\"><span class=\"mlabel\">static</span></span>  </td>\n  </tr>\n</table>\n</div><div class=\"memdoc\">\n\n<p>Red offset (in bytes) for a given pixel format. </p>\n<p>This specifies the number of bytes that the red component is offset from the start of the pixel. For instance, if a pixel of format TJ_BGRX is stored in <code>char pixel[]</code>, then the red component will be <code>pixel[tjRedOffset[TJ_BGRX]]</code>. </p>\n\n</div>\n</div>\n</div><!-- contents -->\n<!-- start footer part -->\n<hr class=\"footer\"/><address class=\"footer\"><small>\nGenerated by &#160;<a href=\"http://www.doxygen.org/index.html\">\n<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/>\n</a> 1.8.3.1\n</small></address>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/index.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\"/>\n<title>TurboJPEG: Main Page</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n  $(document).ready(function() { searchBox.OnSelectItem(0); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n<link href=\"doxygen-extra.css\" rel=\"stylesheet\" type=\"text/css\"/>\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n  <td style=\"padding-left: 0.5em;\">\n   <div id=\"projectname\">TurboJPEG\n   &#160;<span id=\"projectnumber\">1.5</span>\n   </div>\n  </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.3.1 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n  <div id=\"navrow1\" class=\"tabs\">\n    <ul class=\"tablist\">\n      <li class=\"current\"><a href=\"index.html\"><span>Main&#160;Page</span></a></li>\n      <li><a href=\"modules.html\"><span>Modules</span></a></li>\n      <li><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li>\n        <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n        <span class=\"left\">\n          <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n               onmouseover=\"return searchBox.OnSearchSelectShow()\"\n               onmouseout=\"return searchBox.OnSearchSelectHide()\"\n               alt=\"\"/>\n          <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n               onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n               onblur=\"searchBox.OnSearchFieldFocus(false)\" \n               onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n          </span><span class=\"right\">\n            <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n          </span>\n        </div>\n      </li>\n    </ul>\n  </div>\n</div><!-- top -->\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n     onmouseover=\"return searchBox.OnSearchSelectShow()\"\n     onmouseout=\"return searchBox.OnSearchSelectHide()\"\n     onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n<a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(0)\"><span class=\"SelectionMark\">&#160;</span>All</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(1)\"><span class=\"SelectionMark\">&#160;</span>Data Structures</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(2)\"><span class=\"SelectionMark\">&#160;</span>Functions</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(3)\"><span class=\"SelectionMark\">&#160;</span>Variables</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(4)\"><span class=\"SelectionMark\">&#160;</span>Typedefs</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(5)\"><span class=\"SelectionMark\">&#160;</span>Enumerations</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(6)\"><span class=\"SelectionMark\">&#160;</span>Enumerator</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(7)\"><span class=\"SelectionMark\">&#160;</span>Groups</a></div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n        name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div class=\"header\">\n  <div class=\"headertitle\">\n<div class=\"title\">TurboJPEG Documentation</div>  </div>\n</div><!--header-->\n<div class=\"contents\">\n</div><!-- contents -->\n<!-- start footer part -->\n<hr class=\"footer\"/><address class=\"footer\"><small>\nGenerated by &#160;<a href=\"http://www.doxygen.org/index.html\">\n<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/>\n</a> 1.8.3.1\n</small></address>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/jquery.js",
    "content": "/*! jQuery v1.7.1 jquery.com | jquery.org/license */\n(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f(\"<\"+a+\">\").appendTo(b),e=d.css(\"display\");d.remove();if(e===\"none\"||e===\"\"){cl||(cl=c.createElement(\"iframe\"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode===\"CSS1Compat\"?\"<!doctype html>\":\"\")+\"<html><body>\"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,\"display\"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject(\"Microsoft.XMLHTTP\")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h==\"string\"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k===\"*\")k=l;else if(l!==\"*\"&&l!==k){m=l+\" \"+k,n=e[m]||e[\"* \"+k];if(!n){p=b;for(o in e){j=o.split(\" \");if(j[0]===l||j[0]===\"*\"){p=e[j[1]+\" \"+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error(\"No conversion from \"+m.replace(\" \",\" to \")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]===\"*\")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader(\"content-type\"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+\" \"+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+\"[\"+(typeof e==\"object\"||f.isArray(e)?b:\"\")+\"]\",e,c,d)});else if(!c&&b!=null&&typeof b==\"object\")for(var e in b)ca(a+\"[\"+e+\"]\",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l==\"string\"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g[\"*\"]&&(l=b$(a,c,d,e,\"*\",g));return l}function bZ(a){return function(b,c){typeof b!=\"string\"&&(c=b,b=\"*\");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\\+/.test(h),j&&(h=h.substr(1)||\"*\"),i=a[h]=a[h]||[],i[j?\"unshift\":\"push\"](c)}}}function bC(a,b,c){var d=b===\"width\"?a.offsetWidth:a.offsetHeight,e=b===\"width\"?bx:by,g=0,h=e.length;if(d>0){if(c!==\"border\")for(;g<h;g++)c||(d-=parseFloat(f.css(a,\"padding\"+e[g]))||0),c===\"margin\"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,\"border\"+e[g]+\"Width\"))||0;return d+\"px\"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,\"padding\"+e[g]))||0,c!==\"padding\"&&(d+=parseFloat(f.css(a,\"border\"+e[g]+\"Width\"))||0),c===\"margin\"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+\"px\"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:\"script\"}):f.globalEval((b.text||b.textContent||b.innerHTML||\"\").replace(bf,\"/*$0*/\")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement(\"div\");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||\"\").toLowerCase();b===\"input\"?bm(a):b!==\"script\"&&typeof a.getElementsByTagName!=\"undefined\"&&f.grep(a.getElementsByTagName(\"input\"),bm)}function bm(a){if(a.type===\"checkbox\"||a.type===\"radio\")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!=\"undefined\"?a.getElementsByTagName(\"*\"):typeof a.querySelectorAll!=\"undefined\"?a.querySelectorAll(\"*\"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c===\"object\")b.outerHTML=a.outerHTML;else if(c!==\"input\"||a.type!==\"checkbox\"&&a.type!==\"radio\"){if(c===\"option\")b.selected=a.defaultSelected;else if(c===\"input\"||c===\"textarea\")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?\".\":\"\")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,\"table\")?a.getElementsByTagName(\"tbody\")[0]||a.appendChild(a.ownerDocument.createElement(\"tbody\")):a}function U(a){var b=V.split(\"|\"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b==\"string\"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+\"defer\",e=b+\"queue\",g=b+\"mark\",h=f._data(a,d);h&&(c===\"queue\"||!f._data(a,e))&&(c===\"mark\"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b===\"data\"&&f.isEmptyObject(a[b]))continue;if(b!==\"toJSON\")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e=\"data-\"+c.replace(k,\"-$1\").toLowerCase();d=a.getAttribute(e);if(typeof d==\"string\"){try{d=d===\"true\"?!0:d===\"false\"?!1:d===\"null\"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll(\"left\")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\\w\\W]+>)[^>]*$|#([\\w\\-]*)$)/,j=/\\S/,k=/^\\s+/,l=/\\s+$/,m=/^<(\\w+)\\s*\\/?>(?:<\\/\\1>)?$/,n=/^[\\],:{}\\s]*$/,o=/\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g,q=/(?:^|:|,)(?:\\s*\\[)+/g,r=/(webkit)[ \\/]([\\w.]+)/,s=/(opera)(?:.*version)?[ \\/]([\\w.]+)/,t=/(msie) ([\\w.]+)/,u=/(mozilla)(?:.*? rv:([\\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+\"\").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a===\"body\"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a==\"string\"){a.charAt(0)!==\"<\"||a.charAt(a.length-1)!==\">\"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:\"\",jquery:\"1.7.1\",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b===\"find\"?d.selector=this.selector+(this.selector?\" \":\"\")+c:b&&(d.selector=this.selector+\".\"+b+\"(\"+c+\")\");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),\"slice\",F.call(arguments).join(\",\"))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i==\"boolean\"&&(l=i,i=arguments[1]||{},j=2),typeof i!=\"object\"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger(\"ready\").off(\"ready\")}},bindReady:function(){if(!A){A=e.Callbacks(\"once memory\");if(c.readyState===\"complete\")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener(\"DOMContentLoaded\",B,!1),a.addEventListener(\"load\",e.ready,!1);else if(c.attachEvent){c.attachEvent(\"onreadystatechange\",B),a.attachEvent(\"onload\",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)===\"function\"},isArray:Array.isArray||function(a){return e.type(a)===\"array\"},isWindow:function(a){return a&&typeof a==\"object\"&&\"setInterval\"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||\"object\"},isPlainObject:function(a){if(!a||e.type(a)!==\"object\"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,\"constructor\")&&!D.call(a.constructor.prototype,\"isPrototypeOf\"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!=\"string\"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,\"@\").replace(p,\"]\").replace(q,\"\")))return(new Function(\"return \"+b))();e.error(\"Invalid JSON: \"+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,\"text/xml\")):(d=new ActiveXObject(\"Microsoft.XMLDOM\"),d.async=\"false\",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName(\"parsererror\").length)&&e.error(\"Invalid XML: \"+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,\"ms-\").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?\"\":G.call(a)}:function(a){return a==null?\"\":(a+\"\").replace(k,\"\").replace(l,\"\")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d===\"string\"||d===\"function\"||d===\"regexp\"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length==\"number\")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j==\"number\"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c==\"string\"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c==\"object\"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf(\"compatible\")<0&&u.exec(a)||[];return{browser:b[1]||\"\",version:b[2]||\"0\"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each(\"Boolean Number String Function Array Date RegExp Object\".split(\" \"),function(a,b){I[\"[object \"+b+\"]\"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(\" \")&&(k=/^[\\s\\xA0]+/,l=/[\\s\\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener(\"DOMContentLoaded\",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState===\"complete\"&&(c.detachEvent(\"onreadystatechange\",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h===\"array\"?m(g):h===\"function\"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks(\"once memory\"),c=f.Callbacks(\"once memory\"),d=f.Callbacks(\"memory\"),e=\"pending\",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,\"resolve\"],fail:[b,\"reject\"],progress:[c,\"notify\"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function()\n{g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+\"With\"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+\"With\"]=g[j].fireWith;i.done(function(){e=\"resolved\"},c.disable,d.lock).fail(function(){e=\"rejected\"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement(\"div\"),r=c.documentElement;q.setAttribute(\"className\",\"t\"),q.innerHTML=\"   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>\",d=q.getElementsByTagName(\"*\"),e=q.getElementsByTagName(\"a\")[0];if(!d||!d.length||!e)return{};g=c.createElement(\"select\"),h=g.appendChild(c.createElement(\"option\")),i=q.getElementsByTagName(\"input\")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName(\"tbody\").length,htmlSerialize:!!q.getElementsByTagName(\"link\").length,style:/top/.test(e.getAttribute(\"style\")),hrefNormalized:e.getAttribute(\"href\")===\"/a\",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value===\"on\",optSelected:h.selected,getSetAttribute:q.className!==\"t\",enctype:!!c.createElement(\"form\").enctype,html5Clone:c.createElement(\"nav\").cloneNode(!0).outerHTML!==\"<:nav></:nav>\",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent(\"onclick\",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent(\"onclick\")),i=c.createElement(\"input\"),i.value=\"t\",i.setAttribute(\"type\",\"radio\"),b.radioValue=i.value===\"t\",i.setAttribute(\"checked\",\"checked\"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML=\"\",a.getComputedStyle&&(j=c.createElement(\"div\"),j.style.width=\"0\",j.style.marginRight=\"0\",q.style.width=\"2px\",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n=\"on\"+o,p=n in q,p||(q.setAttribute(n,\"return;\"),p=typeof q[n]==\"function\"),b[o+\"Bubbles\"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName(\"body\")[0];!r||(j=1,k=\"position:absolute;top:0;left:0;width:1px;height:1px;margin:0;\",m=\"visibility:hidden;border:0;\",n=\"style='\"+k+\"border:5px solid #000;padding:0;'\",o=\"<div \"+n+\"><div></div></div>\"+\"<table \"+n+\" cellpadding='0' cellspacing='0'>\"+\"<tr><td></td></tr></table>\",a=c.createElement(\"div\"),a.style.cssText=m+\"width:0;height:0;position:static;top:0;margin-top:\"+j+\"px\",r.insertBefore(a,r.firstChild),q=c.createElement(\"div\"),a.appendChild(q),q.innerHTML=\"<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>\",l=q.getElementsByTagName(\"td\"),p=l[0].offsetHeight===0,l[0].style.display=\"\",l[1].style.display=\"none\",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML=\"\",q.style.width=q.style.paddingLeft=\"1px\",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!=\"undefined\"&&(q.style.display=\"inline\",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display=\"\",q.innerHTML=\"<div style='width:4px;'></div>\",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position=\"fixed\",e.style.top=\"20px\",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top=\"\",d.style.overflow=\"hidden\",d.style.position=\"relative\",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\\{.*\\}|\\[.*\\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:\"jQuery\"+(f.fn.jquery+Math.random()).replace(/\\D/g,\"\"),noData:{embed:!0,object:\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c==\"string\",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c===\"events\";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c==\"object\"||typeof c==\"function\")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(\" \")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute(\"classid\")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a==\"undefined\"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],\"parsedAttrs\")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf(\"data-\")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],\"parsedAttrs\",!0)}}return h}if(typeof a==\"object\")return this.each(function(){f.data(this,a)});d=a.split(\".\"),d[1]=d[1]?\".\"+d[1]:\"\";if(c===b){h=this.triggerHandler(\"getData\"+d[1]+\"!\",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler(\"setData\"+d[1]+\"!\",e),f.data(this,a,c),b.triggerHandler(\"changeData\"+d[1]+\"!\",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||\"fx\")+\"mark\",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||\"fx\";var d=c+\"mark\",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,\"mark\"))}},queue:function(a,b,c){var d;if(a){b=(b||\"fx\")+\"queue\",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||\"fx\";var c=f.queue(a,b),d=c.shift(),e={};d===\"inprogress\"&&(d=c.shift()),d&&(b===\"fx\"&&c.unshift(\"inprogress\"),f._data(a,b+\".run\",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+\"queue \"+b+\".run\",!0),n(a,b,\"queue\"))}}),f.fn.extend({queue:function(a,c){typeof a!=\"string\"&&(c=a,a=\"fx\");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a===\"fx\"&&b[0]!==\"inprogress\"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||\"fx\";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||\"fx\",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!=\"string\"&&(c=a,a=b),a=a||\"fx\";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+\"defer\",j=a+\"queue\",k=a+\"mark\",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks(\"once memory\"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\\n\\t\\r]/g,p=/\\s+/,q=/\\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a==\"string\"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=\" \"+e.className+\" \";for(h=0,i=b.length;h<i;h++)~g.indexOf(\" \"+b[h]+\" \")||(g+=b[h]+\" \");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a==\"string\"||a===b){c=(a||\"\").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(\" \"+g.className+\" \").replace(o,\" \");for(i=0,j=c.length;i<j;i++)h=h.replace(\" \"+c[i]+\" \",\" \");g.className=f.trim(h)}else g.className=\"\"}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b==\"boolean\";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c===\"string\"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?\"addClass\":\"removeClass\"](e)}else if(c===\"undefined\"||c===\"boolean\")this.className&&f._data(this,\"__className__\",this.className),this.className=this.className||a===!1?\"\":f._data(this,\"__className__\")||\"\"})},hasClass:function(a){var b=\" \"+a+\" \",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(\" \"+this[c].className+\" \").replace(o,\" \").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h=\"\":typeof h==\"number\"?h+=\"\":f.isArray(h)&&(h=f.map(h,function(a){return a==null?\"\":a+\"\"})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!(\"set\"in c)||c.set(this,h,\"value\")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&\"get\"in c&&(d=c.get(g,\"value\"))!==b)return d;d=g.value;return typeof d==\"string\"?d.replace(q,\"\"):d==null?\"\":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type===\"select-one\";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute(\"disabled\")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,\"optgroup\"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find(\"option\").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute==\"undefined\")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&\"set\"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,\"\"+d);return d}if(h&&\"get\"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,\"\"),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error(\"type property can't be changed\");else if(!f.support.radioValue&&b===\"radio\"&&f.nodeName(a,\"input\")){var c=a.value;a.setAttribute(\"type\",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,\"button\"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,\"button\"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:\"tabIndex\",readonly:\"readOnly\",\"for\":\"htmlFor\",\"class\":\"className\",maxlength:\"maxLength\",cellspacing:\"cellSpacing\",cellpadding:\"cellPadding\",rowspan:\"rowSpan\",colspan:\"colSpan\",usemap:\"useMap\",frameborder:\"frameBorder\",contenteditable:\"contentEditable\"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&\"set\"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&\"get\"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode(\"tabindex\");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!=\"boolean\"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!==\"\":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+\"\"}},f.attrHooks.tabindex.set=w.set,f.each([\"width\",\"height\"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===\"\"){a.setAttribute(b,\"auto\");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===\"\"&&(b=\"false\"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each([\"href\",\"src\",\"width\",\"height\"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=\"\"+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype=\"encoding\"),f.support.checkOn||f.each([\"radio\",\"checkbox\"],function(){f.valHooks[this]={get:function(a){return a.getAttribute(\"value\")===null?\"on\":a.value}}}),f.each([\"radio\",\"checkbox\"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\\.]*)?(?:\\.(.+))?$/,B=/\\bhover(\\.\\S+)?\\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\\w*)(?:#([\\w\\-]+))?(?:\\.([\\w\\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||\"\").toLowerCase(),b[3]=b[3]&&new RegExp(\"(?:^|\\\\s)\"+b[3]+\"(?:\\\\s|$)\"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c[\"class\"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,\"mouseenter$1 mouseleave$1\")};\nf.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!=\"undefined\"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(\" \");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||\"\").split(\".\").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(\".\")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent(\"on\"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||\"\")).split(\" \");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp(\"(^|\\\\.)\"+l.split(\".\").sort().join(\"\\\\.(?:.*\\\\.)?\")+\"(\\\\.|$)\"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d===\"**\"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,[\"events\",\"handle\"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf(\"!\")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(\".\")>=0&&(i=h.split(\".\"),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c==\"object\"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join(\".\"),c.namespace_re=c.namespace?new RegExp(\"(^|\\\\.)\"+i.join(\"\\\\.(?:.*\\\\.)?\")+\"(\\\\.|$)\"):null,o=h.indexOf(\":\")<0?\"on\"+h:\"\";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,\"events\")||{})[c.type]&&f._data(m,\"handle\"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!==\"click\"||!f.nodeName(e,\"a\"))&&f.acceptData(e)&&o&&e[h]&&(h!==\"focus\"&&h!==\"blur\"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,\"events\")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!==\"click\")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:\"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which\".split(\" \"),fixHooks:{},keyHooks:{props:\"char charCode key keyCode\".split(\" \"),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:\"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement\".split(\" \"),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:\"focusin\"},blur:{delegateType:\"focusout\"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent(\"on\"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:\"mouseover\",mouseleave:\"mouseout\"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,\"form\"))return!1;f.event.add(this,\"click._submit keypress._submit\",function(a){var c=a.target,d=f.nodeName(c,\"input\")||f.nodeName(c,\"button\")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,\"submit._submit\",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate(\"submit\",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,\"form\"))return!1;f.event.remove(this,\"._submit\")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type===\"checkbox\"||this.type===\"radio\")f.event.add(this,\"propertychange._change\",function(a){a.originalEvent.propertyName===\"checked\"&&(this._just_changed=!0)}),f.event.add(this,\"click._change\",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate(\"change\",this,a,!0))});return!1}f.event.add(this,\"beforeactivate._change\",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,\"change._change\",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate(\"change\",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!==\"radio\"&&b.type!==\"checkbox\")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,\"._change\");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:\"focusin\",blur:\"focusout\"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a==\"object\"){typeof c!=\"string\"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c==\"string\"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+\".\"+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a==\"object\"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c==\"function\")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||\"**\",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,\"**\"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,\"lastToggle\"+a.guid)||0)%d;f._data(this,\"lastToggle\"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each(\"blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu\".split(\" \"),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!=\"string\"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\\((?:\\([^()]+\\)|[^()]+)+\\)|\\[(?:\\[[^\\[\\]]*\\]|['\"][^'\"]*['\"]|[^\\[\\]'\"]+)+\\]|\\\\.|[^ >+~,(\\[\\\\]+)+|[>+~])(\\s*,\\s*)?((?:.|\\r|\\n)*)/g,d=\"sizcache\"+(Math.random()+\"\").replace(\".\",\"\"),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\\\/g,k=/\\r\\n/g,l=/\\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=\"string\")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(\"\"),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]===\"~\"||w[0]===\"+\")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q=\"\",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)===\"[object Array]\")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!==\"\\\\\"){g[1]=(g[1]||\"\").replace(j,\"\"),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],\"\");break}}}}d||(d=typeof b.getElementsByTagName!=\"undefined\"?b.getElementsByTagName(\"*\"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)===\"\\\\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],\"\");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error(\"Syntax error, unrecognized expression: \"+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e=\"\";if(d){if(d===1||d===9){if(typeof a.textContent==\"string\")return a.textContent;if(typeof a.innerText==\"string\")return a.innerText.replace(k,\"\");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:[\"ID\",\"NAME\",\"TAG\"],match:{ID:/#((?:[\\w\\u00c0-\\uFFFF\\-]|\\\\.)+)/,CLASS:/\\.((?:[\\w\\u00c0-\\uFFFF\\-]|\\\\.)+)/,NAME:/\\[name=['\"]*((?:[\\w\\u00c0-\\uFFFF\\-]|\\\\.)+)['\"]*\\]/,ATTR:/\\[\\s*((?:[\\w\\u00c0-\\uFFFF\\-]|\\\\.)+)\\s*(?:(\\S?=)\\s*(?:(['\"])(.*?)\\3|(#?(?:[\\w\\u00c0-\\uFFFF\\-]|\\\\.)*)|)|)\\s*\\]/,TAG:/^((?:[\\w\\u00c0-\\uFFFF\\*\\-]|\\\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\\(\\s*(even|odd|(?:[+\\-]?\\d+|(?:[+\\-]?\\d*)?n\\s*(?:[+\\-]\\s*\\d+)?))\\s*\\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\))?(?=[^\\-]|$)/,PSEUDO:/:((?:[\\w\\u00c0-\\uFFFF\\-]|\\\\.)+)(?:\\((['\"]?)((?:\\([^\\)]+\\)|[^\\(\\)]*)+)\\2\\))?/},leftMatch:{},attrMap:{\"class\":\"className\",\"for\":\"htmlFor\"},attrHandle:{href:function(a){return a.getAttribute(\"href\")},type:function(a){return a.getAttribute(\"type\")}},relative:{\"+\":function(a,b){var c=typeof b==\"string\",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},\">\":function(a,b){var c,d=typeof b==\"string\",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d\n&&m.filter(b,a,!0)}},\"\":function(a,b,c){var d,f=e++,g=x;typeof b==\"string\"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g(\"parentNode\",b,f,a,d,c)},\"~\":function(a,b,c){var d,f=e++,g=x;typeof b==\"string\"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g(\"previousSibling\",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=\"undefined\"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!=\"undefined\"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute(\"name\")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!=\"undefined\")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=\" \"+a[1].replace(j,\"\")+\" \";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(\" \"+h.className+\" \").replace(/[\\t\\n\\r]/g,\" \").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,\"\")},TAG:function(a,b){return a[1].replace(j,\"\").toLowerCase()},CHILD:function(a){if(a[1]===\"nth\"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\\+|\\s*/g,\"\");var b=/(-?)(\\d*)(?:n([+\\-]?\\d*))?/.exec(a[2]===\"even\"&&\"2n\"||a[2]===\"odd\"&&\"2n+1\"||!/\\D/.test(a[2])&&\"0n+\"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,\"\");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||\"\").replace(j,\"\"),a[2]===\"~=\"&&(a[4]=\" \"+a[4]+\" \");return a},PSEUDO:function(b,c,d,e,f){if(b[1]===\"not\")if((a.exec(b[3])||\"\").length>1||/^\\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!==\"hidden\"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute(\"type\"),c=a.type;return a.nodeName.toLowerCase()===\"input\"&&\"text\"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()===\"input\"&&\"radio\"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()===\"input\"&&\"checkbox\"===a.type},file:function(a){return a.nodeName.toLowerCase()===\"input\"&&\"file\"===a.type},password:function(a){return a.nodeName.toLowerCase()===\"input\"&&\"password\"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b===\"input\"||b===\"button\")&&\"submit\"===a.type},image:function(a){return a.nodeName.toLowerCase()===\"input\"&&\"image\"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b===\"input\"||b===\"button\")&&\"reset\"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b===\"input\"&&\"button\"===a.type||b===\"button\"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e===\"contains\")return(a.textContent||a.innerText||n([a])||\"\").indexOf(b[3])>=0;if(e===\"not\"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case\"only\":case\"first\":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k===\"first\")return!0;l=a;case\"last\":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case\"nth\":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute(\"id\")===b},TAG:function(a,b){return b===\"*\"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(\" \"+(a.className||a.getAttribute(\"class\"))+\" \").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+\"\",f=b[2],g=b[4];return d==null?f===\"!=\":!f&&m.attr?d!=null:f===\"=\"?e===g:f===\"*=\"?e.indexOf(g)>=0:f===\"~=\"?(\" \"+e+\" \").indexOf(g)>=0:g?f===\"!=\"?e!==g:f===\"^=\"?e.indexOf(g)===0:f===\"$=\"?e.substr(e.length-g.length)===g:f===\"|=\"?e===g||e.substr(0,g.length+1)===g+\"-\":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return\"\\\\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\\[]*\\])(?![^\\(]*\\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\\r|\\n)*?)/.source+o.match[r].source.replace(/\\\\(\\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)===\"[object Array]\")Array.prototype.push.apply(d,a);else if(typeof a.length==\"number\")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement(\"div\"),d=\"script\"+(new Date).getTime(),e=c.documentElement;a.innerHTML=\"<a name='\"+d+\"'/>\",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!=\"undefined\"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!=\"undefined\"&&e.getAttributeNode(\"id\").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=\"undefined\"&&a.getAttributeNode(\"id\");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement(\"div\");a.appendChild(c.createComment(\"\")),a.getElementsByTagName(\"*\").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]===\"*\"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML=\"<a href='#'></a>\",a.firstChild&&typeof a.firstChild.getAttribute!=\"undefined\"&&a.firstChild.getAttribute(\"href\")!==\"#\"&&(o.attrHandle.href=function(a){return a.getAttribute(\"href\",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement(\"div\"),d=\"__sizzle__\";b.innerHTML=\"<p class='TEST'></p>\";if(!b.querySelectorAll||b.querySelectorAll(\".TEST\").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\\w+$)|^\\.([\\w\\-]+$)|^#([\\w\\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b===\"body\"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!==\"object\"){var k=e,l=e.getAttribute(\"id\"),n=l||d,p=e.parentNode,q=/^\\s*[+~]/.test(b);l?n=n.replace(/'/g,\"\\\\$&\"):e.setAttribute(\"id\",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll(\"[id='\"+n+\"'] \"+b),f)}catch(r){}finally{l||k.removeAttribute(\"id\")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement(\"div\"),\"div\"),e=!1;try{b.call(c.documentElement,\"[test!='']:sizzle\")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\\=\\s*([^'\"\\]]*)\\s*\\]/g,\"='$1']\");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement(\"div\");a.innerHTML=\"<div class='test e'></div><div class='test'></div>\";if(!!a.getElementsByClassName&&a.getElementsByClassName(\"e\").length!==0){a.lastChild.className=\"e\";if(a.getElementsByClassName(\"e\").length===1)return;o.order.splice(1,0,\"CLASS\"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=\"undefined\"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!==\"HTML\":!1};var y=function(a,b,c){var d,e=[],f=\"\",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,\"\");a=o.relative[a]?a+\"*\":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[\":\"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\\[\\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!=\"string\")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack(\"\",\"find\",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),\"not\",a)},filter:function(a){return this.pushStack(T(this,a,!0),\"filter\",a)},is:function(a){return!!a&&(typeof a==\"string\"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!=\"string\"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,\"closest\",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a==\"string\")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==\"string\"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,\"parentNode\")},parentsUntil:function(a,b,c){return f.dir(a,\"parentNode\",c)},next:function(a){return f.nth(a,2,\"nextSibling\")},prev:function(a){return f.nth(a,2,\"previousSibling\")},nextAll:function(a){return f.dir(a,\"nextSibling\")},prevAll:function(a){return f.dir(a,\"previousSibling\")},nextUntil:function(a,b,c){return f.dir(a,\"nextSibling\",c)},prevUntil:function(a,b,c){return f.dir(a,\"previousSibling\",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,\"iframe\")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d==\"string\"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(\",\"))}}),f.extend({filter:function(a,b,c){c&&(a=\":not(\"+a+\")\");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V=\"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video\",W=/ jQuery\\d+=\"(?:\\d+|null)\"/g,X=/^\\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/ig,Z=/<([\\w:]+)/,$=/<tbody/i,_=/<|&#?\\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp(\"<(?:\"+V+\")\",\"i\"),bd=/checked\\s*(?:[^=]|=\\s*.checked.)/i,be=/\\/(java|ecma)script/i,bf=/^\\s*<!(?:\\[CDATA\\[|\\-\\-)/,bg={option:[1,\"<select multiple='multiple'>\",\"</select>\"],legend:[1,\"<fieldset>\",\"</fieldset>\"],thead:[1,\"<table>\",\"</table>\"],tr:[2,\"<table><tbody>\",\"</tbody></table>\"],td:[3,\"<table><tbody><tr>\",\"</tr></tbody></table>\"],col:[2,\"<table><tbody></tbody><colgroup>\",\"</colgroup></table>\"],area:[1,\"<map>\",\"</map>\"],_default:[0,\"\",\"\"]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,\"div<div>\",\"</div>\"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!=\"object\"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,\"body\")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,\"before\",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,\"after\",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName(\"*\")),\nf.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function()\n{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName(\"*\"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,\"\"):null;if(typeof a==\"string\"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||[\"\",\"\"])[1].toLowerCase()]){a=a.replace(Y,\"<$1></$2>\");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName(\"*\")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!=\"string\"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),\"replaceWith\",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j==\"string\"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,\"tr\");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j==\"string\"&&j.length<512&&i===c&&j.charAt(0)===\"<\"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:\"append\",prependTo:\"prepend\",insertBefore:\"before\",insertAfter:\"after\",replaceAll:\"replaceWith\"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test(\"<\"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement==\"undefined\"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k==\"number\"&&(k+=\"\");if(!k)continue;if(typeof k==\"string\")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,\"<$1></$2>\");var l=(Z.exec(k)||[\"\",\"\"])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement(\"div\");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l===\"table\"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===\"<table>\"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],\"tbody\")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)==\"number\")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],\"script\")&&(!h[j].type||h[j].type.toLowerCase()===\"text/javascript\"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName(\"script\"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\\([^)]*\\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\\d+(?:px)?$/i,bu=/^-?\\d/,bv=/^([\\-+])=([\\-+.\\de]+)/,bw={position:\"absolute\",visibility:\"hidden\",display:\"block\"},bx=[\"Left\",\"Right\"],by=[\"Top\",\"Bottom\"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,\"opacity\",\"opacity\");return c===\"\"?\"1\":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{\"float\":f.support.cssFloat?\"cssFloat\":\"styleFloat\"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&\"get\"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h===\"string\"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h=\"number\");if(d==null||h===\"number\"&&isNaN(d))return;h===\"number\"&&!f.cssNumber[i]&&(d+=\"px\");if(!k||!(\"set\"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c===\"cssFloat\"&&(c=\"float\");if(g&&\"get\"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each([\"height\",\"width\"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+\"px\"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||\"\")?parseFloat(RegExp.$1)/100+\"\":b?\"1\":\"\"},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?\"alpha(opacity=\"+b*100+\")\":\"\",g=d&&d.filter||c.filter||\"\";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,\"\"))===\"\"){c.removeAttribute(\"filter\");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+\" \"+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:\"inline-block\"},function(){b?c=bz(a,\"margin-right\",\"marginRight\"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,\"-$1\").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===\"\"&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b===\"fontSize\"?\"1em\":f||0,f=g.pixelLeft+\"px\",g.left=c,d&&(a.runtimeStyle.left=d));return f===\"\"?\"auto\":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,\"display\"))===\"none\"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\\[\\]$/,bF=/\\r?\\n/g,bG=/#.*$/,bH=/^(.*?):[ \\t]*([^\\r\\n]*)\\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\\-storage|.+\\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\\/\\//,bM=/\\?/,bN=/<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\\w\\+\\.\\-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=[\"*/\"]+[\"*\"];try{bV=e.href}catch(bY){bV=c.createElement(\"a\"),bV.href=\"\",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!=\"string\"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(\" \");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h=\"GET\";c&&(f.isFunction(c)?(d=c,c=b):typeof c==\"object\"&&(c=f.param(c,f.ajaxSettings.traditional),h=\"POST\"));var i=this;f.ajax({url:a,type:h,dataType:\"html\",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f(\"<div>\").append(c.replace(bN,\"\")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,\"\\r\\n\")}}):{name:b.name,value:c.replace(bF,\"\\r\\n\")}}).get()}}),f.each(\"ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend\".split(\" \"),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each([\"get\",\"post\"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,\"script\")},getJSON:function(a,b,c){return f.get(a,b,c,\"json\")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:\"GET\",contentType:\"application/x-www-form-urlencoded\",processData:!0,async:!0,accepts:{xml:\"application/xml, text/xml\",html:\"text/html\",text:\"text/plain\",json:\"application/json, text/javascript\",\"*\":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:\"responseXML\",text:\"responseText\"},converters:{\"* text\":a.String,\"text html\":!0,\"text json\":f.parseJSON,\"text xml\":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||\"\",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader(\"Last-Modified\"))f.lastModified[k]=y;if(z=v.getResponseHeader(\"Etag\"))f.etag[k]=z}if(a===304)w=\"notmodified\",o=!0;else try{r=cc(d,x),w=\"success\",o=!0}catch(A){w=\"parsererror\",u=A}}else{u=w;if(!w||a)w=\"error\",a<0&&(a=0)}v.status=a,v.statusText=\"\"+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger(\"ajax\"+(o?\"Success\":\"Error\"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger(\"ajaxComplete\",[v,d]),--f.active||f.event.trigger(\"ajaxStop\"))}}typeof a==\"object\"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks(\"once memory\"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||\"abort\",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+\"\").replace(bG,\"\").replace(bL,bW[1]+\"//\"),d.dataTypes=f.trim(d.dataType||\"*\").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]===\"http:\"?80:443))==(bW[3]||(bW[1]===\"http:\"?80:443)))),d.data&&d.processData&&typeof d.data!=\"string\"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger(\"ajaxStart\");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?\"&\":\"?\")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,\"$1_=\"+x);d.url=y+(y===d.url?(bM.test(d.url)?\"&\":\"?\")+\"_=\"+x:\"\")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader(\"Content-Type\",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader(\"If-Modified-Since\",f.lastModified[k]),f.etag[k]&&v.setRequestHeader(\"If-None-Match\",f.etag[k])),v.setRequestHeader(\"Accept\",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!==\"*\"?\", \"+bX+\"; q=0.01\":\"\"):d.accepts[\"*\"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,\"No Transport\");else{v.readyState=1,t&&g.trigger(\"ajaxSend\",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort(\"timeout\")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+\"=\"+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join(\"&\").replace(bD,\"+\")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\\=)\\?(&|$)|\\?\\?/i;f.ajaxSetup({jsonp:\"callback\",jsonpCallback:function(){return f.expando+\"_\"+cd++}}),f.ajaxPrefilter(\"json jsonp\",function(b,c,d){var e=b.contentType===\"application/x-www-form-urlencoded\"&&typeof b.data==\"string\";if(b.dataTypes[0]===\"jsonp\"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l=\"$1\"+h+\"$2\";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\\?/.test(j)?\"&\":\"?\")+b.jsonp+\"=\"+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters[\"script json\"]=function(){g||f.error(h+\" was not called\");return g[0]},b.dataTypes[0]=\"json\";return\"script\"}}),f.ajaxSetup({accepts:{script:\"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"},contents:{script:/javascript|ecmascript/},converters:{\"text script\":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter(\"script\",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type=\"GET\",a.global=!1)}),f.ajaxTransport(\"script\",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName(\"head\")[0]||c.documentElement;return{send:function(f,g){d=c.createElement(\"script\"),d.async=\"async\",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,\"success\")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&\"withCredentials\"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c)\n{if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e[\"X-Requested-With\"]&&(e[\"X-Requested-With\"]=\"XMLHttpRequest\");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=\"\"}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\\-]=)?([\\d+.\\-]+)([a-z%]*)$/i,cp,cq=[[\"height\",\"marginTop\",\"marginBottom\",\"paddingTop\",\"paddingBottom\"],[\"width\",\"marginLeft\",\"marginRight\",\"paddingLeft\",\"paddingRight\"],[\"opacity\"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu(\"show\",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,\"olddisplay\")&&e===\"none\"&&(e=d.style.display=\"\"),e===\"\"&&f.css(d,\"display\")===\"none\"&&f._data(d,\"olddisplay\",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===\"\"||e===\"none\")d.style.display=f._data(d,\"olddisplay\")||\"\"}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu(\"hide\",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,\"display\"),e!==\"none\"&&!f._data(d,\"olddisplay\")&&f._data(d,\"olddisplay\",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display=\"none\");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a==\"boolean\";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(\":hidden\");f(this)[b?\"show\":\"hide\"]()}):this.animate(cu(\"toggle\",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(\":hidden\").css(\"opacity\",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(\":hidden\"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||\"swing\";if(h===\"hide\"&&d||h===\"show\"&&!d)return b.complete.call(this);c&&(g===\"height\"||g===\"width\")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,\"display\")===\"inline\"&&f.css(this,\"float\")===\"none\"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)===\"inline\"?this.style.display=\"inline-block\":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow=\"hidden\");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,\"toggle\"+i)||(h===\"toggle\"?d?\"show\":\"hide\":0),o?(f._data(this,\"toggle\"+i,o===\"show\"?\"hide\":\"show\"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?\"\":\"px\"),n!==\"px\"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]===\"-=\"?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,\"\"));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!=\"string\"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||\"fx\",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(\".run\")===b.length-4&&h(this,g,b);else g[b=a+\".run\"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu(\"show\",1),slideUp:cu(\"hide\",1),slideToggle:cu(\"toggle\",1),fadeIn:{opacity:\"show\"},fadeOut:{opacity:\"hide\"},fadeToggle:{opacity:\"toggle\"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a==\"object\"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration==\"number\"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue=\"fx\";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b===\"auto\"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?\"\":\"px\"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,\"fxshow\"+e.prop)===b&&f._data(e.elem,\"fxshow\"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,\"fxshow\"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop===\"width\"||this.prop===\"height\"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,\"fxshow\"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each([\"\",\"X\",\"Y\"],function(a,b){h.style[\"overflow\"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,\"fxshow\"+b,!0),f.removeData(h,\"toggle\"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,\"opacity\",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each([\"width\",\"height\"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;\"getBoundingClientRect\"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position===\"fixed\")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!==\"visible\"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position===\"relative\"||k.position===\"static\")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position===\"fixed\"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,\"marginTop\"))||0,c+=parseFloat(f.css(a,\"marginLeft\"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,\"position\");d===\"static\"&&(a.style.position=\"relative\");var e=f(a),g=e.offset(),h=f.css(a,\"top\"),i=f.css(a,\"left\"),j=(d===\"absolute\"||d===\"fixed\")&&f.inArray(\"auto\",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),\"using\"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,\"marginTop\"))||0,c.left-=parseFloat(f.css(a,\"marginLeft\"))||0,d.top+=parseFloat(f.css(b[0],\"borderTopWidth\"))||0,d.left+=parseFloat(f.css(b[0],\"borderLeftWidth\"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,\"position\")===\"static\")a=a.offsetParent;return a})}}),f.each([\"Left\",\"Top\"],function(a,c){var d=\"scroll\"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?\"pageXOffset\"in g?g[a?\"pageYOffset\":\"pageXOffset\"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each([\"Height\",\"Width\"],function(a,c){var d=c.toLowerCase();f.fn[\"inner\"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,\"padding\")):this[d]():null},f.fn[\"outer\"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?\"margin\":\"border\")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement[\"client\"+c],h=e.document.body;return e.document.compatMode===\"CSS1Compat\"&&g||h&&h[\"client\"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement[\"client\"+c],e.body[\"scroll\"+c],e.documentElement[\"scroll\"+c],e.body[\"offset\"+c],e.documentElement[\"offset\"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a==\"string\"?a:a+\"px\")}}),a.jQuery=a.$=f,typeof define==\"function\"&&define.amd&&define.amd.jQuery&&define(\"jquery\",[],function(){return f})})(window);\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/modules.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\"/>\n<title>TurboJPEG: Modules</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n  $(document).ready(function() { searchBox.OnSelectItem(0); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n<link href=\"doxygen-extra.css\" rel=\"stylesheet\" type=\"text/css\"/>\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n  <td style=\"padding-left: 0.5em;\">\n   <div id=\"projectname\">TurboJPEG\n   &#160;<span id=\"projectnumber\">1.5</span>\n   </div>\n  </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.3.1 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n  <div id=\"navrow1\" class=\"tabs\">\n    <ul class=\"tablist\">\n      <li><a href=\"index.html\"><span>Main&#160;Page</span></a></li>\n      <li class=\"current\"><a href=\"modules.html\"><span>Modules</span></a></li>\n      <li><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li>\n        <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n        <span class=\"left\">\n          <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n               onmouseover=\"return searchBox.OnSearchSelectShow()\"\n               onmouseout=\"return searchBox.OnSearchSelectHide()\"\n               alt=\"\"/>\n          <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n               onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n               onblur=\"searchBox.OnSearchFieldFocus(false)\" \n               onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n          </span><span class=\"right\">\n            <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n          </span>\n        </div>\n      </li>\n    </ul>\n  </div>\n</div><!-- top -->\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n     onmouseover=\"return searchBox.OnSearchSelectShow()\"\n     onmouseout=\"return searchBox.OnSearchSelectHide()\"\n     onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n<a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(0)\"><span class=\"SelectionMark\">&#160;</span>All</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(1)\"><span class=\"SelectionMark\">&#160;</span>Data Structures</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(2)\"><span class=\"SelectionMark\">&#160;</span>Functions</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(3)\"><span class=\"SelectionMark\">&#160;</span>Variables</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(4)\"><span class=\"SelectionMark\">&#160;</span>Typedefs</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(5)\"><span class=\"SelectionMark\">&#160;</span>Enumerations</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(6)\"><span class=\"SelectionMark\">&#160;</span>Enumerator</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(7)\"><span class=\"SelectionMark\">&#160;</span>Groups</a></div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n        name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n<div class=\"header\">\n  <div class=\"headertitle\">\n<div class=\"title\">Modules</div>  </div>\n</div><!--header-->\n<div class=\"contents\">\n<div class=\"textblock\">Here is a list of all modules:</div><div class=\"directory\">\n<table class=\"directory\">\n<tr id=\"row_0_\" class=\"even\"><td class=\"entry\"><img src=\"ftv2lastnode.png\" alt=\"\\\" width=\"16\" height=\"22\" /><a class=\"el\" href=\"group___turbo_j_p_e_g.html\" target=\"_self\">TurboJPEG</a></td><td class=\"desc\">TurboJPEG API</td></tr>\n</table>\n</div><!-- directory -->\n</div><!-- contents -->\n<!-- start footer part -->\n<hr class=\"footer\"/><address class=\"footer\"><small>\nGenerated by &#160;<a href=\"http://www.doxygen.org/index.html\">\n<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/>\n</a> 1.8.3.1\n</small></address>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_63.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"all_63.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_63.js",
    "content": "var searchData=\n[\n  ['customfilter',['customFilter',['../structtjtransform.html#a43ee1bcdd2a8d7249a756774f78793c1',1,'tjtransform']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_64.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"all_64.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_64.js",
    "content": "var searchData=\n[\n  ['data',['data',['../structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3',1,'tjtransform']]],\n  ['denom',['denom',['../structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3',1,'tjscalingfactor']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_68.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"all_68.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_68.js",
    "content": "var searchData=\n[\n  ['h',['h',['../structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115',1,'tjregion']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_6e.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"all_6e.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_6e.js",
    "content": "var searchData=\n[\n  ['num',['num',['../structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec',1,'tjscalingfactor']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_6f.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"all_6f.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_6f.js",
    "content": "var searchData=\n[\n  ['op',['op',['../structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498',1,'tjtransform']]],\n  ['options',['options',['../structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6',1,'tjtransform']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_72.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"all_72.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_72.js",
    "content": "var searchData=\n[\n  ['r',['r',['../structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf',1,'tjtransform']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_74.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"all_74.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_74.js",
    "content": "var searchData=\n[\n  ['tj_5fnumcs',['TJ_NUMCS',['../group___turbo_j_p_e_g.html#ga39f57a6fb02d9cf32e7b6890099b5a71',1,'turbojpeg.h']]],\n  ['tj_5fnumpf',['TJ_NUMPF',['../group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e',1,'turbojpeg.h']]],\n  ['tj_5fnumsamp',['TJ_NUMSAMP',['../group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c',1,'turbojpeg.h']]],\n  ['tj_5fnumxop',['TJ_NUMXOP',['../group___turbo_j_p_e_g.html#ga0f6dbd18adf38b7d46ac547f0f4d562c',1,'turbojpeg.h']]],\n  ['tjalloc',['tjAlloc',['../group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff',1,'turbojpeg.h']]],\n  ['tjblueoffset',['tjBlueOffset',['../group___turbo_j_p_e_g.html#ga84e2e35d3f08025f976ec1ec53693dea',1,'turbojpeg.h']]],\n  ['tjbufsize',['tjBufSize',['../group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b',1,'turbojpeg.h']]],\n  ['tjbufsizeyuv2',['tjBufSizeYUV2',['../group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9',1,'turbojpeg.h']]],\n  ['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaf38f2ed44bdc88e730e08b632fa6e88e',1,'turbojpeg.h']]],\n  ['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga6f6de375d6ec0020faba627e37e5a060',1,'turbojpeg.h']]],\n  ['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#ga0b84c682d8accf097d7a743c965d3464',1,'turbojpeg.h']]],\n  ['tjcs',['TJCS',['../group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720',1,'turbojpeg.h']]],\n  ['tjcs_5fcmyk',['TJCS_CMYK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53',1,'turbojpeg.h']]],\n  ['tjcs_5fgray',['TJCS_GRAY',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a',1,'turbojpeg.h']]],\n  ['tjcs_5frgb',['TJCS_RGB',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555',1,'turbojpeg.h']]],\n  ['tjcs_5fycbcr',['TJCS_YCbCr',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75',1,'turbojpeg.h']]],\n  ['tjcs_5fycck',['TJCS_YCCK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e',1,'turbojpeg.h']]],\n  ['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga077c61027b875afecd5a1613bf18b3c1',1,'turbojpeg.h']]],\n  ['tjdecodeyuvplanes',['tjDecodeYUVPlanes',['../group___turbo_j_p_e_g.html#gaf42f19b7a496eb18bdc84fe61ee6d3e2',1,'turbojpeg.h']]],\n  ['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gad8026a417e16a76313bc0a6c9e8b2ba2',1,'turbojpeg.h']]],\n  ['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#ga3fced455e504e8ff4fbad28ba94a3020',1,'turbojpeg.h']]],\n  ['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga39e08906528db5a764670ea48d344b09',1,'turbojpeg.h']]],\n  ['tjdecompresstoyuvplanes',['tjDecompressToYUVPlanes',['../group___turbo_j_p_e_g.html#ga38d0ef90692663b3ffb5b16da2541512',1,'turbojpeg.h']]],\n  ['tjdestroy',['tjDestroy',['../group___turbo_j_p_e_g.html#ga674adee917b95ad4a896f1ba39e12540',1,'turbojpeg.h']]],\n  ['tjencodeyuv3',['tjEncodeYUV3',['../group___turbo_j_p_e_g.html#gaabe05acd734990053ad1294b5ef239aa',1,'turbojpeg.h']]],\n  ['tjencodeyuvplanes',['tjEncodeYUVPlanes',['../group___turbo_j_p_e_g.html#ga8a65ed3bd12df57c219d46afbc9008f1',1,'turbojpeg.h']]],\n  ['tjflag_5faccuratedct',['TJFLAG_ACCURATEDCT',['../group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0',1,'turbojpeg.h']]],\n  ['tjflag_5fbottomup',['TJFLAG_BOTTOMUP',['../group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec',1,'turbojpeg.h']]],\n  ['tjflag_5ffastdct',['TJFLAG_FASTDCT',['../group___turbo_j_p_e_g.html#gaabce235db80d3f698b27f36cbd453da2',1,'turbojpeg.h']]],\n  ['tjflag_5ffastupsample',['TJFLAG_FASTUPSAMPLE',['../group___turbo_j_p_e_g.html#ga4ee4506c81177a06f77e2504a22efd2d',1,'turbojpeg.h']]],\n  ['tjflag_5fnorealloc',['TJFLAG_NOREALLOC',['../group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963',1,'turbojpeg.h']]],\n  ['tjfree',['tjFree',['../group___turbo_j_p_e_g.html#ga8c4a1231dc06a450514c835f6471f137',1,'turbojpeg.h']]],\n  ['tjgeterrorstr',['tjGetErrorStr',['../group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf',1,'turbojpeg.h']]],\n  ['tjgetscalingfactors',['tjGetScalingFactors',['../group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8',1,'turbojpeg.h']]],\n  ['tjgreenoffset',['tjGreenOffset',['../group___turbo_j_p_e_g.html#ga82d6e35da441112a411da41923c0ba2f',1,'turbojpeg.h']]],\n  ['tjhandle',['tjhandle',['../group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763',1,'turbojpeg.h']]],\n  ['tjinitcompress',['tjInitCompress',['../group___turbo_j_p_e_g.html#ga3d10c47fbe4a2489a2b30c931551d01a',1,'turbojpeg.h']]],\n  ['tjinitdecompress',['tjInitDecompress',['../group___turbo_j_p_e_g.html#gae5408179d041e2a2f7199c8283cf649e',1,'turbojpeg.h']]],\n  ['tjinittransform',['tjInitTransform',['../group___turbo_j_p_e_g.html#ga3155b775bfbac9dbba869b95a0367902',1,'turbojpeg.h']]],\n  ['tjmcuheight',['tjMCUHeight',['../group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf',1,'turbojpeg.h']]],\n  ['tjmcuwidth',['tjMCUWidth',['../group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c',1,'turbojpeg.h']]],\n  ['tjpad',['TJPAD',['../group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511',1,'turbojpeg.h']]],\n  ['tjpf',['TJPF',['../group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a',1,'turbojpeg.h']]],\n  ['tjpf_5fabgr',['TJPF_ABGR',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081',1,'turbojpeg.h']]],\n  ['tjpf_5fargb',['TJPF_ARGB',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c',1,'turbojpeg.h']]],\n  ['tjpf_5fbgr',['TJPF_BGR',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aab10624437fb8ef495a0b153e65749839',1,'turbojpeg.h']]],\n  ['tjpf_5fbgra',['TJPF_BGRA',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4',1,'turbojpeg.h']]],\n  ['tjpf_5fbgrx',['TJPF_BGRX',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8',1,'turbojpeg.h']]],\n  ['tjpf_5fcmyk',['TJPF_CMYK',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b',1,'turbojpeg.h']]],\n  ['tjpf_5fgray',['TJPF_GRAY',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a',1,'turbojpeg.h']]],\n  ['tjpf_5frgb',['TJPF_RGB',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7ce93230bff449518ce387c17e6ed37c',1,'turbojpeg.h']]],\n  ['tjpf_5frgba',['TJPF_RGBA',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12',1,'turbojpeg.h']]],\n  ['tjpf_5frgbx',['TJPF_RGBX',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01',1,'turbojpeg.h']]],\n  ['tjpf_5fxbgr',['TJPF_XBGR',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af',1,'turbojpeg.h']]],\n  ['tjpf_5fxrgb',['TJPF_XRGB',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84',1,'turbojpeg.h']]],\n  ['tjpixelsize',['tjPixelSize',['../group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c',1,'turbojpeg.h']]],\n  ['tjplaneheight',['tjPlaneHeight',['../group___turbo_j_p_e_g.html#ga1a209696c6a80748f20e134b3c64789f',1,'turbojpeg.h']]],\n  ['tjplanesizeyuv',['tjPlaneSizeYUV',['../group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2',1,'turbojpeg.h']]],\n  ['tjplanewidth',['tjPlaneWidth',['../group___turbo_j_p_e_g.html#ga63fb66bb1e36c74008c4634360becbb1',1,'turbojpeg.h']]],\n  ['tjredoffset',['tjRedOffset',['../group___turbo_j_p_e_g.html#gadd9b446742ac8a3923f7992c7988fea8',1,'turbojpeg.h']]],\n  ['tjregion',['tjregion',['../structtjregion.html',1,'']]],\n  ['tjsamp',['TJSAMP',['../group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074',1,'turbojpeg.h']]],\n  ['tjsamp_5f411',['TJSAMP_411',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2',1,'turbojpeg.h']]],\n  ['tjsamp_5f420',['TJSAMP_420',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737',1,'turbojpeg.h']]],\n  ['tjsamp_5f422',['TJSAMP_422',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404',1,'turbojpeg.h']]],\n  ['tjsamp_5f440',['TJSAMP_440',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974',1,'turbojpeg.h']]],\n  ['tjsamp_5f444',['TJSAMP_444',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3',1,'turbojpeg.h']]],\n  ['tjsamp_5fgray',['TJSAMP_GRAY',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248',1,'turbojpeg.h']]],\n  ['tjscaled',['TJSCALED',['../group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df',1,'turbojpeg.h']]],\n  ['tjscalingfactor',['tjscalingfactor',['../structtjscalingfactor.html',1,'']]],\n  ['tjtransform',['tjtransform',['../structtjtransform.html',1,'tjtransform'],['../group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a',1,'tjTransform(tjhandle handle, const unsigned char *jpegBuf, unsigned long jpegSize, int n, unsigned char **dstBufs, unsigned long *dstSizes, tjtransform *transforms, int flags):&#160;turbojpeg.h'],['../group___turbo_j_p_e_g.html#gaa29f3189c41be12ec5dee7caec318a31',1,'tjtransform():&#160;turbojpeg.h']]],\n  ['tjxop',['TJXOP',['../group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866',1,'turbojpeg.h']]],\n  ['tjxop_5fhflip',['TJXOP_HFLIP',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce',1,'turbojpeg.h']]],\n  ['tjxop_5fnone',['TJXOP_NONE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27',1,'turbojpeg.h']]],\n  ['tjxop_5frot180',['TJXOP_ROT180',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a140952eb8dd0300accfcc22726d69692',1,'turbojpeg.h']]],\n  ['tjxop_5frot270',['TJXOP_ROT270',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a3064ee5dfb7f032df332818587567a08',1,'turbojpeg.h']]],\n  ['tjxop_5frot90',['TJXOP_ROT90',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a43b2bbb23bc4bd548422d43fbe9af128',1,'turbojpeg.h']]],\n  ['tjxop_5ftranspose',['TJXOP_TRANSPOSE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a31060aed199f886afdd417f80499c32d',1,'turbojpeg.h']]],\n  ['tjxop_5ftransverse',['TJXOP_TRANSVERSE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4',1,'turbojpeg.h']]],\n  ['tjxop_5fvflip',['TJXOP_VFLIP',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a324eddfbec53b7e691f61e56929d0d5d',1,'turbojpeg.h']]],\n  ['tjxopt_5fcrop',['TJXOPT_CROP',['../group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2',1,'turbojpeg.h']]],\n  ['tjxopt_5fgray',['TJXOPT_GRAY',['../group___turbo_j_p_e_g.html#ga3acee7b48ade1b99e5588736007c2589',1,'turbojpeg.h']]],\n  ['tjxopt_5fnooutput',['TJXOPT_NOOUTPUT',['../group___turbo_j_p_e_g.html#gafbf992bbf6e006705886333703ffab31',1,'turbojpeg.h']]],\n  ['tjxopt_5fperfect',['TJXOPT_PERFECT',['../group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00',1,'turbojpeg.h']]],\n  ['tjxopt_5ftrim',['TJXOPT_TRIM',['../group___turbo_j_p_e_g.html#ga319826b7eb1583c0595bbe7b95428709',1,'turbojpeg.h']]],\n  ['turbojpeg',['TurboJPEG',['../group___turbo_j_p_e_g.html',1,'']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_77.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"all_77.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_77.js",
    "content": "var searchData=\n[\n  ['w',['w',['../structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42',1,'tjregion']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_78.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"all_78.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_78.js",
    "content": "var searchData=\n[\n  ['x',['x',['../structtjregion.html#a4b6a37a93997091b26a75831fa291ad9',1,'tjregion']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_79.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"all_79.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/all_79.js",
    "content": "var searchData=\n[\n  ['y',['y',['../structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2',1,'tjregion']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/classes_74.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"classes_74.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/classes_74.js",
    "content": "var searchData=\n[\n  ['tjregion',['tjregion',['../structtjregion.html',1,'']]],\n  ['tjscalingfactor',['tjscalingfactor',['../structtjscalingfactor.html',1,'']]],\n  ['tjtransform',['tjtransform',['../structtjtransform.html',1,'']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/enums_74.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"enums_74.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/enums_74.js",
    "content": "var searchData=\n[\n  ['tjcs',['TJCS',['../group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720',1,'turbojpeg.h']]],\n  ['tjpf',['TJPF',['../group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a',1,'turbojpeg.h']]],\n  ['tjsamp',['TJSAMP',['../group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074',1,'turbojpeg.h']]],\n  ['tjxop',['TJXOP',['../group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866',1,'turbojpeg.h']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/enumvalues_74.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"enumvalues_74.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/enumvalues_74.js",
    "content": "var searchData=\n[\n  ['tjcs_5fcmyk',['TJCS_CMYK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53',1,'turbojpeg.h']]],\n  ['tjcs_5fgray',['TJCS_GRAY',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a',1,'turbojpeg.h']]],\n  ['tjcs_5frgb',['TJCS_RGB',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555',1,'turbojpeg.h']]],\n  ['tjcs_5fycbcr',['TJCS_YCbCr',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75',1,'turbojpeg.h']]],\n  ['tjcs_5fycck',['TJCS_YCCK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e',1,'turbojpeg.h']]],\n  ['tjpf_5fabgr',['TJPF_ABGR',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081',1,'turbojpeg.h']]],\n  ['tjpf_5fargb',['TJPF_ARGB',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c',1,'turbojpeg.h']]],\n  ['tjpf_5fbgr',['TJPF_BGR',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aab10624437fb8ef495a0b153e65749839',1,'turbojpeg.h']]],\n  ['tjpf_5fbgra',['TJPF_BGRA',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4',1,'turbojpeg.h']]],\n  ['tjpf_5fbgrx',['TJPF_BGRX',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8',1,'turbojpeg.h']]],\n  ['tjpf_5fcmyk',['TJPF_CMYK',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b',1,'turbojpeg.h']]],\n  ['tjpf_5fgray',['TJPF_GRAY',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a',1,'turbojpeg.h']]],\n  ['tjpf_5frgb',['TJPF_RGB',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7ce93230bff449518ce387c17e6ed37c',1,'turbojpeg.h']]],\n  ['tjpf_5frgba',['TJPF_RGBA',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12',1,'turbojpeg.h']]],\n  ['tjpf_5frgbx',['TJPF_RGBX',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01',1,'turbojpeg.h']]],\n  ['tjpf_5fxbgr',['TJPF_XBGR',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af',1,'turbojpeg.h']]],\n  ['tjpf_5fxrgb',['TJPF_XRGB',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84',1,'turbojpeg.h']]],\n  ['tjsamp_5f411',['TJSAMP_411',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2',1,'turbojpeg.h']]],\n  ['tjsamp_5f420',['TJSAMP_420',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737',1,'turbojpeg.h']]],\n  ['tjsamp_5f422',['TJSAMP_422',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404',1,'turbojpeg.h']]],\n  ['tjsamp_5f440',['TJSAMP_440',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974',1,'turbojpeg.h']]],\n  ['tjsamp_5f444',['TJSAMP_444',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3',1,'turbojpeg.h']]],\n  ['tjsamp_5fgray',['TJSAMP_GRAY',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248',1,'turbojpeg.h']]],\n  ['tjxop_5fhflip',['TJXOP_HFLIP',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce',1,'turbojpeg.h']]],\n  ['tjxop_5fnone',['TJXOP_NONE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27',1,'turbojpeg.h']]],\n  ['tjxop_5frot180',['TJXOP_ROT180',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a140952eb8dd0300accfcc22726d69692',1,'turbojpeg.h']]],\n  ['tjxop_5frot270',['TJXOP_ROT270',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a3064ee5dfb7f032df332818587567a08',1,'turbojpeg.h']]],\n  ['tjxop_5frot90',['TJXOP_ROT90',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a43b2bbb23bc4bd548422d43fbe9af128',1,'turbojpeg.h']]],\n  ['tjxop_5ftranspose',['TJXOP_TRANSPOSE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a31060aed199f886afdd417f80499c32d',1,'turbojpeg.h']]],\n  ['tjxop_5ftransverse',['TJXOP_TRANSVERSE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4',1,'turbojpeg.h']]],\n  ['tjxop_5fvflip',['TJXOP_VFLIP',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a324eddfbec53b7e691f61e56929d0d5d',1,'turbojpeg.h']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/functions_74.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"functions_74.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/functions_74.js",
    "content": "var searchData=\n[\n  ['tjalloc',['tjAlloc',['../group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff',1,'turbojpeg.h']]],\n  ['tjbufsize',['tjBufSize',['../group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b',1,'turbojpeg.h']]],\n  ['tjbufsizeyuv2',['tjBufSizeYUV2',['../group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9',1,'turbojpeg.h']]],\n  ['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaf38f2ed44bdc88e730e08b632fa6e88e',1,'turbojpeg.h']]],\n  ['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga6f6de375d6ec0020faba627e37e5a060',1,'turbojpeg.h']]],\n  ['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#ga0b84c682d8accf097d7a743c965d3464',1,'turbojpeg.h']]],\n  ['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga077c61027b875afecd5a1613bf18b3c1',1,'turbojpeg.h']]],\n  ['tjdecodeyuvplanes',['tjDecodeYUVPlanes',['../group___turbo_j_p_e_g.html#gaf42f19b7a496eb18bdc84fe61ee6d3e2',1,'turbojpeg.h']]],\n  ['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gad8026a417e16a76313bc0a6c9e8b2ba2',1,'turbojpeg.h']]],\n  ['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#ga3fced455e504e8ff4fbad28ba94a3020',1,'turbojpeg.h']]],\n  ['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga39e08906528db5a764670ea48d344b09',1,'turbojpeg.h']]],\n  ['tjdecompresstoyuvplanes',['tjDecompressToYUVPlanes',['../group___turbo_j_p_e_g.html#ga38d0ef90692663b3ffb5b16da2541512',1,'turbojpeg.h']]],\n  ['tjdestroy',['tjDestroy',['../group___turbo_j_p_e_g.html#ga674adee917b95ad4a896f1ba39e12540',1,'turbojpeg.h']]],\n  ['tjencodeyuv3',['tjEncodeYUV3',['../group___turbo_j_p_e_g.html#gaabe05acd734990053ad1294b5ef239aa',1,'turbojpeg.h']]],\n  ['tjencodeyuvplanes',['tjEncodeYUVPlanes',['../group___turbo_j_p_e_g.html#ga8a65ed3bd12df57c219d46afbc9008f1',1,'turbojpeg.h']]],\n  ['tjfree',['tjFree',['../group___turbo_j_p_e_g.html#ga8c4a1231dc06a450514c835f6471f137',1,'turbojpeg.h']]],\n  ['tjgeterrorstr',['tjGetErrorStr',['../group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf',1,'turbojpeg.h']]],\n  ['tjgetscalingfactors',['tjGetScalingFactors',['../group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8',1,'turbojpeg.h']]],\n  ['tjinitcompress',['tjInitCompress',['../group___turbo_j_p_e_g.html#ga3d10c47fbe4a2489a2b30c931551d01a',1,'turbojpeg.h']]],\n  ['tjinitdecompress',['tjInitDecompress',['../group___turbo_j_p_e_g.html#gae5408179d041e2a2f7199c8283cf649e',1,'turbojpeg.h']]],\n  ['tjinittransform',['tjInitTransform',['../group___turbo_j_p_e_g.html#ga3155b775bfbac9dbba869b95a0367902',1,'turbojpeg.h']]],\n  ['tjplaneheight',['tjPlaneHeight',['../group___turbo_j_p_e_g.html#ga1a209696c6a80748f20e134b3c64789f',1,'turbojpeg.h']]],\n  ['tjplanesizeyuv',['tjPlaneSizeYUV',['../group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2',1,'turbojpeg.h']]],\n  ['tjplanewidth',['tjPlaneWidth',['../group___turbo_j_p_e_g.html#ga63fb66bb1e36c74008c4634360becbb1',1,'turbojpeg.h']]],\n  ['tjtransform',['tjTransform',['../group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a',1,'turbojpeg.h']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/groups_74.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"groups_74.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/groups_74.js",
    "content": "var searchData=\n[\n  ['turbojpeg',['TurboJPEG',['../group___turbo_j_p_e_g.html',1,'']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/nomatches.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/search.css",
    "content": "/*---------------- Search Box */\n\n#FSearchBox {\n    float: left;\n}\n\n#MSearchBox {\n    white-space : nowrap;\n    position: absolute;\n    float: none;\n    display: inline;\n    margin-top: 8px;\n    right: 0px;\n    width: 170px;\n    z-index: 102;\n    background-color: white;\n}\n\n#MSearchBox .left\n{\n    display:block;\n    position:absolute;\n    left:10px;\n    width:20px;\n    height:19px;\n    background:url('search_l.png') no-repeat;\n    background-position:right;\n}\n\n#MSearchSelect {\n    display:block;\n    position:absolute;\n    width:20px;\n    height:19px;\n}\n\n.left #MSearchSelect {\n    left:4px;\n}\n\n.right #MSearchSelect {\n    right:5px;\n}\n\n#MSearchField {\n    display:block;\n    position:absolute;\n    height:19px;\n    background:url('search_m.png') repeat-x;\n    border:none;\n    width:116px;\n    margin-left:20px;\n    padding-left:4px;\n    color: #909090;\n    outline: none;\n    font: 9pt Arial, Verdana, sans-serif;\n}\n\n#FSearchBox #MSearchField {\n    margin-left:15px;\n}\n\n#MSearchBox .right {\n    display:block;\n    position:absolute;\n    right:10px;\n    top:0px;\n    width:20px;\n    height:19px;\n    background:url('search_r.png') no-repeat;\n    background-position:left;\n}\n\n#MSearchClose {\n    display: none;\n    position: absolute;\n    top: 4px;\n    background : none;\n    border: none;\n    margin: 0px 4px 0px 0px;\n    padding: 0px 0px;\n    outline: none;\n}\n\n.left #MSearchClose {\n    left: 6px;\n}\n\n.right #MSearchClose {\n    right: 2px;\n}\n\n.MSearchBoxActive #MSearchField {\n    color: #000000;\n}\n\n/*---------------- Search filter selection */\n\n#MSearchSelectWindow {\n    display: none;\n    position: absolute;\n    left: 0; top: 0;\n    border: 1px solid #90A5CE;\n    background-color: #F9FAFC;\n    z-index: 1;\n    padding-top: 4px;\n    padding-bottom: 4px;\n    -moz-border-radius: 4px;\n    -webkit-border-top-left-radius: 4px;\n    -webkit-border-top-right-radius: 4px;\n    -webkit-border-bottom-left-radius: 4px;\n    -webkit-border-bottom-right-radius: 4px;\n    -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);\n}\n\n.SelectItem {\n    font: 8pt Arial, Verdana, sans-serif;\n    padding-left:  2px;\n    padding-right: 12px;\n    border: 0px;\n}\n\nspan.SelectionMark {\n    margin-right: 4px;\n    font-family: monospace;\n    outline-style: none;\n    text-decoration: none;\n}\n\na.SelectItem {\n    display: block;\n    outline-style: none;\n    color: #000000; \n    text-decoration: none;\n    padding-left:   6px;\n    padding-right: 12px;\n}\n\na.SelectItem:focus,\na.SelectItem:active {\n    color: #000000; \n    outline-style: none;\n    text-decoration: none;\n}\n\na.SelectItem:hover {\n    color: #FFFFFF;\n    background-color: #3D578C;\n    outline-style: none;\n    text-decoration: none;\n    cursor: pointer;\n    display: block;\n}\n\n/*---------------- Search results window */\n\niframe#MSearchResults {\n    width: 60ex;\n    height: 15em;\n}\n\n#MSearchResultsWindow {\n    display: none;\n    position: absolute;\n    left: 0; top: 0;\n    border: 1px solid #000;\n    background-color: #EEF1F7;\n}\n\n/* ----------------------------------- */\n\n\n#SRIndex {\n    clear:both; \n    padding-bottom: 15px;\n}\n\n.SREntry {\n    font-size: 10pt;\n    padding-left: 1ex;\n}\n\n.SRPage .SREntry {\n    font-size: 8pt;\n    padding: 1px 5px;\n}\n\nbody.SRPage {\n    margin: 5px 2px;\n}\n\n.SRChildren {\n    padding-left: 3ex; padding-bottom: .5em \n}\n\n.SRPage .SRChildren {\n    display: none;\n}\n\n.SRSymbol {\n    font-weight: bold; \n    color: #425E97;\n    font-family: Arial, Verdana, sans-serif;\n    text-decoration: none;\n    outline: none;\n}\n\na.SRScope {\n    display: block;\n    color: #425E97; \n    font-family: Arial, Verdana, sans-serif;\n    text-decoration: none;\n    outline: none;\n}\n\na.SRSymbol:focus, a.SRSymbol:active,\na.SRScope:focus, a.SRScope:active {\n    text-decoration: underline;\n}\n\nspan.SRScope {\n    padding-left: 4px;\n}\n\n.SRPage .SRStatus {\n    padding: 2px 5px;\n    font-size: 8pt;\n    font-style: italic;\n}\n\n.SRResult {\n    display: none;\n}\n\nDIV.searchresults {\n    margin-left: 10px;\n    margin-right: 10px;\n}\n\n/*---------------- External search page results */\n\n.searchresult {\n    background-color: #F0F3F8;\n}\n\n.pages b {\n   color: white;\n   padding: 5px 5px 3px 5px;\n   background-image: url(\"../tab_a.png\");\n   background-repeat: repeat-x;\n   text-shadow: 0 1px 1px #000000;\n}\n\n.pages {\n    line-height: 17px;\n    margin-left: 4px;\n    text-decoration: none;\n}\n\n.hl {\n    font-weight: bold;\n}\n\n#searchresults {\n    margin-bottom: 20px;\n}\n\n.searchpages {\n    margin-top: 10px;\n}\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/search.js",
    "content": "// Search script generated by doxygen\n// Copyright (C) 2009 by Dimitri van Heesch.\n\n// The code in this file is loosly based on main.js, part of Natural Docs,\n// which is Copyright (C) 2003-2008 Greg Valure\n// Natural Docs is licensed under the GPL.\n\nvar indexSectionsWithContent =\n{\n  0: \"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100010000011001010011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\n  1: \"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\n  2: \"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\n  3: \"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100010000011001010011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\n  4: \"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\n  5: \"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\n  6: \"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\n  7: \"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\"\n};\n\nvar indexSectionNames =\n{\n  0: \"all\",\n  1: \"classes\",\n  2: \"functions\",\n  3: \"variables\",\n  4: \"typedefs\",\n  5: \"enums\",\n  6: \"enumvalues\",\n  7: \"groups\"\n};\n\nfunction convertToId(search)\n{\n  var result = '';\n  for (i=0;i<search.length;i++)\n  {\n    var c = search.charAt(i);\n    var cn = c.charCodeAt(0);\n    if (c.match(/[a-z0-9]/))\n    {\n      result+=c;\n    }\n    else if (cn<16) \n    {\n      result+=\"_0\"+cn.toString(16);\n    }\n    else \n    {\n      result+=\"_\"+cn.toString(16);\n    }\n  }\n  return result;\n}\n\nfunction getXPos(item)\n{\n  var x = 0;\n  if (item.offsetWidth)\n  {\n    while (item && item!=document.body)\n    {\n      x   += item.offsetLeft;\n      item = item.offsetParent;\n    }\n  }\n  return x;\n}\n\nfunction getYPos(item)\n{\n  var y = 0;\n  if (item.offsetWidth)\n  {\n     while (item && item!=document.body)\n     {\n       y   += item.offsetTop;\n       item = item.offsetParent;\n     }\n  }\n  return y;\n}\n\n/* A class handling everything associated with the search panel.\n\n   Parameters:\n   name - The name of the global variable that will be \n          storing this instance.  Is needed to be able to set timeouts.\n   resultPath - path to use for external files\n*/\nfunction SearchBox(name, resultsPath, inFrame, label)\n{\n  if (!name || !resultsPath) {  alert(\"Missing parameters to SearchBox.\"); }\n   \n  // ---------- Instance variables\n  this.name                  = name;\n  this.resultsPath           = resultsPath;\n  this.keyTimeout            = 0;\n  this.keyTimeoutLength      = 500;\n  this.closeSelectionTimeout = 300;\n  this.lastSearchValue       = \"\";\n  this.lastResultsPage       = \"\";\n  this.hideTimeout           = 0;\n  this.searchIndex           = 0;\n  this.searchActive          = false;\n  this.insideFrame           = inFrame;\n  this.searchLabel           = label;\n\n  // ----------- DOM Elements\n\n  this.DOMSearchField = function()\n  {  return document.getElementById(\"MSearchField\");  }\n\n  this.DOMSearchSelect = function()\n  {  return document.getElementById(\"MSearchSelect\");  }\n\n  this.DOMSearchSelectWindow = function()\n  {  return document.getElementById(\"MSearchSelectWindow\");  }\n\n  this.DOMPopupSearchResults = function()\n  {  return document.getElementById(\"MSearchResults\");  }\n\n  this.DOMPopupSearchResultsWindow = function()\n  {  return document.getElementById(\"MSearchResultsWindow\");  }\n\n  this.DOMSearchClose = function()\n  {  return document.getElementById(\"MSearchClose\"); }\n\n  this.DOMSearchBox = function()\n  {  return document.getElementById(\"MSearchBox\");  }\n\n  // ------------ Event Handlers\n\n  // Called when focus is added or removed from the search field.\n  this.OnSearchFieldFocus = function(isActive)\n  {\n    this.Activate(isActive);\n  }\n\n  this.OnSearchSelectShow = function()\n  {\n    var searchSelectWindow = this.DOMSearchSelectWindow();\n    var searchField        = this.DOMSearchSelect();\n\n    if (this.insideFrame)\n    {\n      var left = getXPos(searchField);\n      var top  = getYPos(searchField);\n      left += searchField.offsetWidth + 6;\n      top += searchField.offsetHeight;\n\n      // show search selection popup\n      searchSelectWindow.style.display='block';\n      left -= searchSelectWindow.offsetWidth;\n      searchSelectWindow.style.left =  left + 'px';\n      searchSelectWindow.style.top  =  top  + 'px';\n    }\n    else\n    {\n      var left = getXPos(searchField);\n      var top  = getYPos(searchField);\n      top += searchField.offsetHeight;\n\n      // show search selection popup\n      searchSelectWindow.style.display='block';\n      searchSelectWindow.style.left =  left + 'px';\n      searchSelectWindow.style.top  =  top  + 'px';\n    }\n\n    // stop selection hide timer\n    if (this.hideTimeout) \n    {\n      clearTimeout(this.hideTimeout);\n      this.hideTimeout=0;\n    }\n    return false; // to avoid \"image drag\" default event\n  }\n\n  this.OnSearchSelectHide = function()\n  {\n    this.hideTimeout = setTimeout(this.name +\".CloseSelectionWindow()\",\n                                  this.closeSelectionTimeout);\n  }\n\n  // Called when the content of the search field is changed.\n  this.OnSearchFieldChange = function(evt)\n  {\n    if (this.keyTimeout) // kill running timer\n    {\n      clearTimeout(this.keyTimeout);\n      this.keyTimeout = 0;\n    }\n\n    var e  = (evt) ? evt : window.event; // for IE\n    if (e.keyCode==40 || e.keyCode==13)\n    {\n      if (e.shiftKey==1)\n      {\n        this.OnSearchSelectShow();\n        var win=this.DOMSearchSelectWindow(); \n        for (i=0;i<win.childNodes.length;i++)\n        {\n          var child = win.childNodes[i]; // get span within a\n          if (child.className=='SelectItem')\n          {\n            child.focus();\n            return;\n          }\n        }\n        return;\n      }\n      else if (window.frames.MSearchResults.searchResults)\n      {\n        var elem = window.frames.MSearchResults.searchResults.NavNext(0);\n        if (elem) elem.focus();\n      }\n    }\n    else if (e.keyCode==27) // Escape out of the search field\n    {\n      this.DOMSearchField().blur();\n      this.DOMPopupSearchResultsWindow().style.display = 'none';\n      this.DOMSearchClose().style.display = 'none';\n      this.lastSearchValue = '';\n      this.Activate(false);\n      return;\n    }\n\n    // strip whitespaces\n    var searchValue = this.DOMSearchField().value.replace(/ +/g, \"\");\n\n    if (searchValue != this.lastSearchValue) // search value has changed\n    {\n      if (searchValue != \"\") // non-empty search\n      {\n        // set timer for search update\n        this.keyTimeout = setTimeout(this.name + '.Search()',\n                                     this.keyTimeoutLength);\n      }\n      else // empty search field\n      {\n        this.DOMPopupSearchResultsWindow().style.display = 'none';\n        this.DOMSearchClose().style.display = 'none';\n        this.lastSearchValue = '';\n      }\n    }\n  }\n\n  this.SelectItemCount = function(id)\n  {\n    var count=0;\n    var win=this.DOMSearchSelectWindow(); \n    for (i=0;i<win.childNodes.length;i++)\n    {\n      var child = win.childNodes[i]; // get span within a\n      if (child.className=='SelectItem')\n      {\n        count++;\n      }\n    }\n    return count;\n  }\n\n  this.SelectItemSet = function(id)\n  {\n    var i,j=0;\n    var win=this.DOMSearchSelectWindow(); \n    for (i=0;i<win.childNodes.length;i++)\n    {\n      var child = win.childNodes[i]; // get span within a\n      if (child.className=='SelectItem')\n      {\n        var node = child.firstChild;\n        if (j==id)\n        {\n          node.innerHTML='&#8226;';\n        }\n        else\n        {\n          node.innerHTML='&#160;';\n        }\n        j++;\n      }\n    }\n  }\n\n  // Called when an search filter selection is made.\n  // set item with index id as the active item\n  this.OnSelectItem = function(id)\n  {\n    this.searchIndex = id;\n    this.SelectItemSet(id);\n    var searchValue = this.DOMSearchField().value.replace(/ +/g, \"\");\n    if (searchValue!=\"\" && this.searchActive) // something was found -> do a search\n    {\n      this.Search();\n    }\n  }\n\n  this.OnSearchSelectKey = function(evt)\n  {\n    var e = (evt) ? evt : window.event; // for IE\n    if (e.keyCode==40 && this.searchIndex<this.SelectItemCount()) // Down\n    {\n      this.searchIndex++;\n      this.OnSelectItem(this.searchIndex);\n    }\n    else if (e.keyCode==38 && this.searchIndex>0) // Up\n    {\n      this.searchIndex--;\n      this.OnSelectItem(this.searchIndex);\n    }\n    else if (e.keyCode==13 || e.keyCode==27)\n    {\n      this.OnSelectItem(this.searchIndex);\n      this.CloseSelectionWindow();\n      this.DOMSearchField().focus();\n    }\n    return false;\n  }\n\n  // --------- Actions\n\n  // Closes the results window.\n  this.CloseResultsWindow = function()\n  {\n    this.DOMPopupSearchResultsWindow().style.display = 'none';\n    this.DOMSearchClose().style.display = 'none';\n    this.Activate(false);\n  }\n\n  this.CloseSelectionWindow = function()\n  {\n    this.DOMSearchSelectWindow().style.display = 'none';\n  }\n\n  // Performs a search.\n  this.Search = function()\n  {\n    this.keyTimeout = 0;\n\n    // strip leading whitespace\n    var searchValue = this.DOMSearchField().value.replace(/^ +/, \"\");\n\n    var code = searchValue.toLowerCase().charCodeAt(0);\n    var hexCode;\n    if (code<16) \n    {\n      hexCode=\"0\"+code.toString(16);\n    }\n    else \n    {\n      hexCode=code.toString(16);\n    }\n\n    var resultsPage;\n    var resultsPageWithSearch;\n    var hasResultsPage;\n\n    if (indexSectionsWithContent[this.searchIndex].charAt(code) == '1')\n    {\n       resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html';\n       resultsPageWithSearch = resultsPage+'?'+escape(searchValue);\n       hasResultsPage = true;\n    }\n    else // nothing available for this search term\n    {\n       resultsPage = this.resultsPath + '/nomatches.html';\n       resultsPageWithSearch = resultsPage;\n       hasResultsPage = false;\n    }\n\n    window.frames.MSearchResults.location = resultsPageWithSearch;  \n    var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow();\n\n    if (domPopupSearchResultsWindow.style.display!='block')\n    {\n       var domSearchBox = this.DOMSearchBox();\n       this.DOMSearchClose().style.display = 'inline';\n       if (this.insideFrame)\n       {\n         var domPopupSearchResults = this.DOMPopupSearchResults();\n         domPopupSearchResultsWindow.style.position = 'relative';\n         domPopupSearchResultsWindow.style.display  = 'block';\n         var width = document.body.clientWidth - 8; // the -8 is for IE :-(\n         domPopupSearchResultsWindow.style.width    = width + 'px';\n         domPopupSearchResults.style.width          = width + 'px';\n       }\n       else\n       {\n         var domPopupSearchResults = this.DOMPopupSearchResults();\n         var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth;\n         var top  = getYPos(domSearchBox) + 20;  // domSearchBox.offsetHeight + 1;\n         domPopupSearchResultsWindow.style.display = 'block';\n         left -= domPopupSearchResults.offsetWidth;\n         domPopupSearchResultsWindow.style.top     = top  + 'px';\n         domPopupSearchResultsWindow.style.left    = left + 'px';\n       }\n    }\n\n    this.lastSearchValue = searchValue;\n    this.lastResultsPage = resultsPage;\n  }\n\n  // -------- Activation Functions\n\n  // Activates or deactivates the search panel, resetting things to \n  // their default values if necessary. \n  this.Activate = function(isActive)\n  {\n    if (isActive || // open it\n        this.DOMPopupSearchResultsWindow().style.display == 'block' \n       )\n    {\n      this.DOMSearchBox().className = 'MSearchBoxActive';\n\n      var searchField = this.DOMSearchField();\n\n      if (searchField.value == this.searchLabel) // clear \"Search\" term upon entry\n      {  \n        searchField.value = '';  \n        this.searchActive = true;\n      }\n    }\n    else if (!isActive) // directly remove the panel\n    {\n      this.DOMSearchBox().className = 'MSearchBoxInactive';\n      this.DOMSearchField().value   = this.searchLabel;\n      this.searchActive             = false;\n      this.lastSearchValue          = ''\n      this.lastResultsPage          = '';\n    }\n  }\n}\n\n// -----------------------------------------------------------------------\n\n// The class that handles everything on the search results page.\nfunction SearchResults(name)\n{\n    // The number of matches from the last run of <Search()>.\n    this.lastMatchCount = 0;\n    this.lastKey = 0;\n    this.repeatOn = false;\n\n    // Toggles the visibility of the passed element ID.\n    this.FindChildElement = function(id)\n    {\n      var parentElement = document.getElementById(id);\n      var element = parentElement.firstChild;\n\n      while (element && element!=parentElement)\n      {\n        if (element.nodeName == 'DIV' && element.className == 'SRChildren')\n        {\n          return element;\n        }\n\n        if (element.nodeName == 'DIV' && element.hasChildNodes())\n        {  \n           element = element.firstChild;  \n        }\n        else if (element.nextSibling)\n        {  \n           element = element.nextSibling;  \n        }\n        else\n        {\n          do\n          {\n            element = element.parentNode;\n          }\n          while (element && element!=parentElement && !element.nextSibling);\n\n          if (element && element!=parentElement)\n          {  \n            element = element.nextSibling;  \n          }\n        }\n      }\n    }\n\n    this.Toggle = function(id)\n    {\n      var element = this.FindChildElement(id);\n      if (element)\n      {\n        if (element.style.display == 'block')\n        {\n          element.style.display = 'none';\n        }\n        else\n        {\n          element.style.display = 'block';\n        }\n      }\n    }\n\n    // Searches for the passed string.  If there is no parameter,\n    // it takes it from the URL query.\n    //\n    // Always returns true, since other documents may try to call it\n    // and that may or may not be possible.\n    this.Search = function(search)\n    {\n      if (!search) // get search word from URL\n      {\n        search = window.location.search;\n        search = search.substring(1);  // Remove the leading '?'\n        search = unescape(search);\n      }\n\n      search = search.replace(/^ +/, \"\"); // strip leading spaces\n      search = search.replace(/ +$/, \"\"); // strip trailing spaces\n      search = search.toLowerCase();\n      search = convertToId(search);\n\n      var resultRows = document.getElementsByTagName(\"div\");\n      var matches = 0;\n\n      var i = 0;\n      while (i < resultRows.length)\n      {\n        var row = resultRows.item(i);\n        if (row.className == \"SRResult\")\n        {\n          var rowMatchName = row.id.toLowerCase();\n          rowMatchName = rowMatchName.replace(/^sr\\d*_/, ''); // strip 'sr123_'\n\n          if (search.length<=rowMatchName.length && \n             rowMatchName.substr(0, search.length)==search)\n          {\n            row.style.display = 'block';\n            matches++;\n          }\n          else\n          {\n            row.style.display = 'none';\n          }\n        }\n        i++;\n      }\n      document.getElementById(\"Searching\").style.display='none';\n      if (matches == 0) // no results\n      {\n        document.getElementById(\"NoMatches\").style.display='block';\n      }\n      else // at least one result\n      {\n        document.getElementById(\"NoMatches\").style.display='none';\n      }\n      this.lastMatchCount = matches;\n      return true;\n    }\n\n    // return the first item with index index or higher that is visible\n    this.NavNext = function(index)\n    {\n      var focusItem;\n      while (1)\n      {\n        var focusName = 'Item'+index;\n        focusItem = document.getElementById(focusName);\n        if (focusItem && focusItem.parentNode.parentNode.style.display=='block')\n        {\n          break;\n        }\n        else if (!focusItem) // last element\n        {\n          break;\n        }\n        focusItem=null;\n        index++;\n      }\n      return focusItem;\n    }\n\n    this.NavPrev = function(index)\n    {\n      var focusItem;\n      while (1)\n      {\n        var focusName = 'Item'+index;\n        focusItem = document.getElementById(focusName);\n        if (focusItem && focusItem.parentNode.parentNode.style.display=='block')\n        {\n          break;\n        }\n        else if (!focusItem) // last element\n        {\n          break;\n        }\n        focusItem=null;\n        index--;\n      }\n      return focusItem;\n    }\n\n    this.ProcessKeys = function(e)\n    {\n      if (e.type == \"keydown\") \n      {\n        this.repeatOn = false;\n        this.lastKey = e.keyCode;\n      }\n      else if (e.type == \"keypress\")\n      {\n        if (!this.repeatOn)\n        {\n          if (this.lastKey) this.repeatOn = true;\n          return false; // ignore first keypress after keydown\n        }\n      }\n      else if (e.type == \"keyup\")\n      {\n        this.lastKey = 0;\n        this.repeatOn = false;\n      }\n      return this.lastKey!=0;\n    }\n\n    this.Nav = function(evt,itemIndex) \n    {\n      var e  = (evt) ? evt : window.event; // for IE\n      if (e.keyCode==13) return true;\n      if (!this.ProcessKeys(e)) return false;\n\n      if (this.lastKey==38) // Up\n      {\n        var newIndex = itemIndex-1;\n        var focusItem = this.NavPrev(newIndex);\n        if (focusItem)\n        {\n          var child = this.FindChildElement(focusItem.parentNode.parentNode.id);\n          if (child && child.style.display == 'block') // children visible\n          { \n            var n=0;\n            var tmpElem;\n            while (1) // search for last child\n            {\n              tmpElem = document.getElementById('Item'+newIndex+'_c'+n);\n              if (tmpElem)\n              {\n                focusItem = tmpElem;\n              }\n              else // found it!\n              {\n                break;\n              }\n              n++;\n            }\n          }\n        }\n        if (focusItem)\n        {\n          focusItem.focus();\n        }\n        else // return focus to search field\n        {\n           parent.document.getElementById(\"MSearchField\").focus();\n        }\n      }\n      else if (this.lastKey==40) // Down\n      {\n        var newIndex = itemIndex+1;\n        var focusItem;\n        var item = document.getElementById('Item'+itemIndex);\n        var elem = this.FindChildElement(item.parentNode.parentNode.id);\n        if (elem && elem.style.display == 'block') // children visible\n        {\n          focusItem = document.getElementById('Item'+itemIndex+'_c0');\n        }\n        if (!focusItem) focusItem = this.NavNext(newIndex);\n        if (focusItem)  focusItem.focus();\n      }\n      else if (this.lastKey==39) // Right\n      {\n        var item = document.getElementById('Item'+itemIndex);\n        var elem = this.FindChildElement(item.parentNode.parentNode.id);\n        if (elem) elem.style.display = 'block';\n      }\n      else if (this.lastKey==37) // Left\n      {\n        var item = document.getElementById('Item'+itemIndex);\n        var elem = this.FindChildElement(item.parentNode.parentNode.id);\n        if (elem) elem.style.display = 'none';\n      }\n      else if (this.lastKey==27) // Escape\n      {\n        parent.searchBox.CloseResultsWindow();\n        parent.document.getElementById(\"MSearchField\").focus();\n      }\n      else if (this.lastKey==13) // Enter\n      {\n        return true;\n      }\n      return false;\n    }\n\n    this.NavChild = function(evt,itemIndex,childIndex)\n    {\n      var e  = (evt) ? evt : window.event; // for IE\n      if (e.keyCode==13) return true;\n      if (!this.ProcessKeys(e)) return false;\n\n      if (this.lastKey==38) // Up\n      {\n        if (childIndex>0)\n        {\n          var newIndex = childIndex-1;\n          document.getElementById('Item'+itemIndex+'_c'+newIndex).focus();\n        }\n        else // already at first child, jump to parent\n        {\n          document.getElementById('Item'+itemIndex).focus();\n        }\n      }\n      else if (this.lastKey==40) // Down\n      {\n        var newIndex = childIndex+1;\n        var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex);\n        if (!elem) // last child, jump to parent next parent\n        {\n          elem = this.NavNext(itemIndex+1);\n        }\n        if (elem)\n        {\n          elem.focus();\n        } \n      }\n      else if (this.lastKey==27) // Escape\n      {\n        parent.searchBox.CloseResultsWindow();\n        parent.document.getElementById(\"MSearchField\").focus();\n      }\n      else if (this.lastKey==13) // Enter\n      {\n        return true;\n      }\n      return false;\n    }\n}\n\nfunction setKeyActions(elem,action)\n{\n  elem.setAttribute('onkeydown',action);\n  elem.setAttribute('onkeypress',action);\n  elem.setAttribute('onkeyup',action);\n}\n\nfunction setClassAttr(elem,attr)\n{\n  elem.setAttribute('class',attr);\n  elem.setAttribute('className',attr);\n}\n\nfunction createResults()\n{\n  var results = document.getElementById(\"SRResults\");\n  for (var e=0; e<searchData.length; e++)\n  {\n    var id = searchData[e][0];\n    var srResult = document.createElement('div');\n    srResult.setAttribute('id','SR_'+id);\n    setClassAttr(srResult,'SRResult');\n    var srEntry = document.createElement('div');\n    setClassAttr(srEntry,'SREntry');\n    var srLink = document.createElement('a');\n    srLink.setAttribute('id','Item'+e);\n    setKeyActions(srLink,'return searchResults.Nav(event,'+e+')');\n    setClassAttr(srLink,'SRSymbol');\n    srLink.innerHTML = searchData[e][1][0];\n    srEntry.appendChild(srLink);\n    if (searchData[e][1].length==2) // single result\n    {\n      srLink.setAttribute('href',searchData[e][1][1][0]);\n      if (searchData[e][1][1][1])\n      {\n       srLink.setAttribute('target','_parent');\n      }\n      var srScope = document.createElement('span');\n      setClassAttr(srScope,'SRScope');\n      srScope.innerHTML = searchData[e][1][1][2];\n      srEntry.appendChild(srScope);\n    }\n    else // multiple results\n    {\n      srLink.setAttribute('href','javascript:searchResults.Toggle(\"SR_'+id+'\")');\n      var srChildren = document.createElement('div');\n      setClassAttr(srChildren,'SRChildren');\n      for (var c=0; c<searchData[e][1].length-1; c++)\n      {\n        var srChild = document.createElement('a');\n        srChild.setAttribute('id','Item'+e+'_c'+c);\n        setKeyActions(srChild,'return searchResults.NavChild(event,'+e+','+c+')');\n        setClassAttr(srChild,'SRScope');\n        srChild.setAttribute('href',searchData[e][1][c+1][0]);\n        if (searchData[e][1][c+1][1])\n        {\n         srChild.setAttribute('target','_parent');\n        }\n        srChild.innerHTML = searchData[e][1][c+1][2];\n        srChildren.appendChild(srChild);\n      }\n      srEntry.appendChild(srChildren);\n    }\n    srResult.appendChild(srEntry);\n    results.appendChild(srResult);\n  }\n}\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/typedefs_74.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"typedefs_74.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/typedefs_74.js",
    "content": "var searchData=\n[\n  ['tjhandle',['tjhandle',['../group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763',1,'turbojpeg.h']]],\n  ['tjtransform',['tjtransform',['../group___turbo_j_p_e_g.html#gaa29f3189c41be12ec5dee7caec318a31',1,'turbojpeg.h']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_63.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"variables_63.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_63.js",
    "content": "var searchData=\n[\n  ['customfilter',['customFilter',['../structtjtransform.html#a43ee1bcdd2a8d7249a756774f78793c1',1,'tjtransform']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_64.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"variables_64.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_64.js",
    "content": "var searchData=\n[\n  ['data',['data',['../structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3',1,'tjtransform']]],\n  ['denom',['denom',['../structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3',1,'tjscalingfactor']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_68.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"variables_68.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_68.js",
    "content": "var searchData=\n[\n  ['h',['h',['../structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115',1,'tjregion']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_6e.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"variables_6e.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_6e.js",
    "content": "var searchData=\n[\n  ['num',['num',['../structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec',1,'tjscalingfactor']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_6f.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"variables_6f.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_6f.js",
    "content": "var searchData=\n[\n  ['op',['op',['../structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498',1,'tjtransform']]],\n  ['options',['options',['../structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6',1,'tjtransform']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_72.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"variables_72.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_72.js",
    "content": "var searchData=\n[\n  ['r',['r',['../structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf',1,'tjtransform']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_74.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"variables_74.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_74.js",
    "content": "var searchData=\n[\n  ['tjblueoffset',['tjBlueOffset',['../group___turbo_j_p_e_g.html#ga84e2e35d3f08025f976ec1ec53693dea',1,'turbojpeg.h']]],\n  ['tjgreenoffset',['tjGreenOffset',['../group___turbo_j_p_e_g.html#ga82d6e35da441112a411da41923c0ba2f',1,'turbojpeg.h']]],\n  ['tjmcuheight',['tjMCUHeight',['../group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf',1,'turbojpeg.h']]],\n  ['tjmcuwidth',['tjMCUWidth',['../group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c',1,'turbojpeg.h']]],\n  ['tjpixelsize',['tjPixelSize',['../group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c',1,'turbojpeg.h']]],\n  ['tjredoffset',['tjRedOffset',['../group___turbo_j_p_e_g.html#gadd9b446742ac8a3923f7992c7988fea8',1,'turbojpeg.h']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_77.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"variables_77.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_77.js",
    "content": "var searchData=\n[\n  ['w',['w',['../structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42',1,'tjregion']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_78.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"variables_78.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_78.js",
    "content": "var searchData=\n[\n  ['x',['x',['../structtjregion.html#a4b6a37a93997091b26a75831fa291ad9',1,'tjregion']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_79.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html><head><title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"search.css\"/>\n<script type=\"text/javascript\" src=\"variables_79.js\"></script>\n<script type=\"text/javascript\" src=\"search.js\"></script>\n</head>\n<body class=\"SRPage\">\n<div id=\"SRIndex\">\n<div class=\"SRStatus\" id=\"Loading\">Loading...</div>\n<div id=\"SRResults\"></div>\n<script type=\"text/javascript\"><!--\ncreateResults();\n--></script>\n<div class=\"SRStatus\" id=\"Searching\">Searching...</div>\n<div class=\"SRStatus\" id=\"NoMatches\">No Matches</div>\n<script type=\"text/javascript\"><!--\ndocument.getElementById(\"Loading\").style.display=\"none\";\ndocument.getElementById(\"NoMatches\").style.display=\"none\";\nvar searchResults = new SearchResults(\"searchResults\");\nsearchResults.Search();\n--></script>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/search/variables_79.js",
    "content": "var searchData=\n[\n  ['y',['y',['../structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2',1,'tjregion']]]\n];\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/structtjregion.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\"/>\n<title>TurboJPEG: tjregion Struct Reference</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n  $(document).ready(function() { searchBox.OnSelectItem(0); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n<link href=\"doxygen-extra.css\" rel=\"stylesheet\" type=\"text/css\"/>\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n  <td style=\"padding-left: 0.5em;\">\n   <div id=\"projectname\">TurboJPEG\n   &#160;<span id=\"projectnumber\">1.5</span>\n   </div>\n  </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.3.1 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n  <div id=\"navrow1\" class=\"tabs\">\n    <ul class=\"tablist\">\n      <li><a href=\"index.html\"><span>Main&#160;Page</span></a></li>\n      <li><a href=\"modules.html\"><span>Modules</span></a></li>\n      <li class=\"current\"><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li>\n        <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n        <span class=\"left\">\n          <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n               onmouseover=\"return searchBox.OnSearchSelectShow()\"\n               onmouseout=\"return searchBox.OnSearchSelectHide()\"\n               alt=\"\"/>\n          <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n               onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n               onblur=\"searchBox.OnSearchFieldFocus(false)\" \n               onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n          </span><span class=\"right\">\n            <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n          </span>\n        </div>\n      </li>\n    </ul>\n  </div>\n  <div id=\"navrow2\" class=\"tabs2\">\n    <ul class=\"tablist\">\n      <li><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li><a href=\"classes.html\"><span>Data&#160;Structure&#160;Index</span></a></li>\n      <li><a href=\"functions.html\"><span>Data&#160;Fields</span></a></li>\n    </ul>\n  </div>\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n     onmouseover=\"return searchBox.OnSearchSelectShow()\"\n     onmouseout=\"return searchBox.OnSearchSelectHide()\"\n     onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n<a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(0)\"><span class=\"SelectionMark\">&#160;</span>All</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(1)\"><span class=\"SelectionMark\">&#160;</span>Data Structures</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(2)\"><span class=\"SelectionMark\">&#160;</span>Functions</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(3)\"><span class=\"SelectionMark\">&#160;</span>Variables</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(4)\"><span class=\"SelectionMark\">&#160;</span>Typedefs</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(5)\"><span class=\"SelectionMark\">&#160;</span>Enumerations</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(6)\"><span class=\"SelectionMark\">&#160;</span>Enumerator</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(7)\"><span class=\"SelectionMark\">&#160;</span>Groups</a></div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n        name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n</div><!-- top -->\n<div class=\"header\">\n  <div class=\"summary\">\n<a href=\"#pub-attribs\">Data Fields</a>  </div>\n  <div class=\"headertitle\">\n<div class=\"title\">tjregion Struct Reference<div class=\"ingroups\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html\">TurboJPEG</a></div></div>  </div>\n</div><!--header-->\n<div class=\"contents\">\n\n<p>Cropping region.  \n <a href=\"structtjregion.html#details\">More...</a></p>\n\n<p><code>#include &lt;turbojpeg.h&gt;</code></p>\n<table class=\"memberdecls\">\n<tr class=\"heading\"><td colspan=\"2\"><h2 class=\"groupheader\"><a name=\"pub-attribs\"></a>\nData Fields</h2></td></tr>\n<tr class=\"memitem:a4b6a37a93997091b26a75831fa291ad9\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"structtjregion.html#a4b6a37a93997091b26a75831fa291ad9\">x</a></td></tr>\n<tr class=\"memdesc:a4b6a37a93997091b26a75831fa291ad9\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The left boundary of the cropping region.  <a href=\"#a4b6a37a93997091b26a75831fa291ad9\">More...</a><br/></td></tr>\n<tr class=\"separator:a4b6a37a93997091b26a75831fa291ad9\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:a7b3e0c24cfe87acc80e334cafdcf22c2\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2\">y</a></td></tr>\n<tr class=\"memdesc:a7b3e0c24cfe87acc80e334cafdcf22c2\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The upper boundary of the cropping region.  <a href=\"#a7b3e0c24cfe87acc80e334cafdcf22c2\">More...</a><br/></td></tr>\n<tr class=\"separator:a7b3e0c24cfe87acc80e334cafdcf22c2\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ab6eb73ceef584fc23c8c8097926dce42\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42\">w</a></td></tr>\n<tr class=\"memdesc:ab6eb73ceef584fc23c8c8097926dce42\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The width of the cropping region.  <a href=\"#ab6eb73ceef584fc23c8c8097926dce42\">More...</a><br/></td></tr>\n<tr class=\"separator:ab6eb73ceef584fc23c8c8097926dce42\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:aecefc45a26f4d8b60dd4d825c1710115\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115\">h</a></td></tr>\n<tr class=\"memdesc:aecefc45a26f4d8b60dd4d825c1710115\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The height of the cropping region.  <a href=\"#aecefc45a26f4d8b60dd4d825c1710115\">More...</a><br/></td></tr>\n<tr class=\"separator:aecefc45a26f4d8b60dd4d825c1710115\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n</table>\n<a name=\"details\" id=\"details\"></a><h2 class=\"groupheader\">Detailed Description</h2>\n<div class=\"textblock\"><p>Cropping region. </p>\n</div><h2 class=\"groupheader\">Field Documentation</h2>\n<a class=\"anchor\" id=\"aecefc45a26f4d8b60dd4d825c1710115\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">int tjregion::h</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>The height of the cropping region. </p>\n<p>Setting this to 0 is the equivalent of setting it to the height of the source JPEG image - y. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ab6eb73ceef584fc23c8c8097926dce42\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">int tjregion::w</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>The width of the cropping region. </p>\n<p>Setting this to 0 is the equivalent of setting it to the width of the source JPEG image - x. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"a4b6a37a93997091b26a75831fa291ad9\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">int tjregion::x</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>The left boundary of the cropping region. </p>\n<p>This must be evenly divisible by the MCU block width (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c\" title=\"MCU block width (in pixels) for a given level of chrominance subsampling.\">tjMCUWidth</a>.) </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"a7b3e0c24cfe87acc80e334cafdcf22c2\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">int tjregion::y</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>The upper boundary of the cropping region. </p>\n<p>This must be evenly divisible by the MCU block height (see <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf\" title=\"MCU block height (in pixels) for a given level of chrominance subsampling.\">tjMCUHeight</a>.) </p>\n\n</div>\n</div>\n<hr/>The documentation for this struct was generated from the following file:<ul>\n<li>turbojpeg.h</li>\n</ul>\n</div><!-- contents -->\n<!-- start footer part -->\n<hr class=\"footer\"/><address class=\"footer\"><small>\nGenerated by &#160;<a href=\"http://www.doxygen.org/index.html\">\n<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/>\n</a> 1.8.3.1\n</small></address>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/structtjscalingfactor.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\"/>\n<title>TurboJPEG: tjscalingfactor Struct Reference</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n  $(document).ready(function() { searchBox.OnSelectItem(0); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n<link href=\"doxygen-extra.css\" rel=\"stylesheet\" type=\"text/css\"/>\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n  <td style=\"padding-left: 0.5em;\">\n   <div id=\"projectname\">TurboJPEG\n   &#160;<span id=\"projectnumber\">1.5</span>\n   </div>\n  </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.3.1 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n  <div id=\"navrow1\" class=\"tabs\">\n    <ul class=\"tablist\">\n      <li><a href=\"index.html\"><span>Main&#160;Page</span></a></li>\n      <li><a href=\"modules.html\"><span>Modules</span></a></li>\n      <li class=\"current\"><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li>\n        <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n        <span class=\"left\">\n          <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n               onmouseover=\"return searchBox.OnSearchSelectShow()\"\n               onmouseout=\"return searchBox.OnSearchSelectHide()\"\n               alt=\"\"/>\n          <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n               onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n               onblur=\"searchBox.OnSearchFieldFocus(false)\" \n               onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n          </span><span class=\"right\">\n            <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n          </span>\n        </div>\n      </li>\n    </ul>\n  </div>\n  <div id=\"navrow2\" class=\"tabs2\">\n    <ul class=\"tablist\">\n      <li><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li><a href=\"classes.html\"><span>Data&#160;Structure&#160;Index</span></a></li>\n      <li><a href=\"functions.html\"><span>Data&#160;Fields</span></a></li>\n    </ul>\n  </div>\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n     onmouseover=\"return searchBox.OnSearchSelectShow()\"\n     onmouseout=\"return searchBox.OnSearchSelectHide()\"\n     onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n<a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(0)\"><span class=\"SelectionMark\">&#160;</span>All</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(1)\"><span class=\"SelectionMark\">&#160;</span>Data Structures</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(2)\"><span class=\"SelectionMark\">&#160;</span>Functions</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(3)\"><span class=\"SelectionMark\">&#160;</span>Variables</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(4)\"><span class=\"SelectionMark\">&#160;</span>Typedefs</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(5)\"><span class=\"SelectionMark\">&#160;</span>Enumerations</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(6)\"><span class=\"SelectionMark\">&#160;</span>Enumerator</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(7)\"><span class=\"SelectionMark\">&#160;</span>Groups</a></div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n        name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n</div><!-- top -->\n<div class=\"header\">\n  <div class=\"summary\">\n<a href=\"#pub-attribs\">Data Fields</a>  </div>\n  <div class=\"headertitle\">\n<div class=\"title\">tjscalingfactor Struct Reference<div class=\"ingroups\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html\">TurboJPEG</a></div></div>  </div>\n</div><!--header-->\n<div class=\"contents\">\n\n<p>Scaling factor.  \n <a href=\"structtjscalingfactor.html#details\">More...</a></p>\n\n<p><code>#include &lt;turbojpeg.h&gt;</code></p>\n<table class=\"memberdecls\">\n<tr class=\"heading\"><td colspan=\"2\"><h2 class=\"groupheader\"><a name=\"pub-attribs\"></a>\nData Fields</h2></td></tr>\n<tr class=\"memitem:a9b011e57f981ee23083e2c1aa5e640ec\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec\">num</a></td></tr>\n<tr class=\"memdesc:a9b011e57f981ee23083e2c1aa5e640ec\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Numerator.  <a href=\"#a9b011e57f981ee23083e2c1aa5e640ec\">More...</a><br/></td></tr>\n<tr class=\"separator:a9b011e57f981ee23083e2c1aa5e640ec\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:aefbcdf3e9e62274b2d312c695f133ce3\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3\">denom</a></td></tr>\n<tr class=\"memdesc:aefbcdf3e9e62274b2d312c695f133ce3\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Denominator.  <a href=\"#aefbcdf3e9e62274b2d312c695f133ce3\">More...</a><br/></td></tr>\n<tr class=\"separator:aefbcdf3e9e62274b2d312c695f133ce3\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n</table>\n<a name=\"details\" id=\"details\"></a><h2 class=\"groupheader\">Detailed Description</h2>\n<div class=\"textblock\"><p>Scaling factor. </p>\n</div><h2 class=\"groupheader\">Field Documentation</h2>\n<a class=\"anchor\" id=\"aefbcdf3e9e62274b2d312c695f133ce3\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">int tjscalingfactor::denom</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Denominator. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"a9b011e57f981ee23083e2c1aa5e640ec\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">int tjscalingfactor::num</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Numerator. </p>\n\n</div>\n</div>\n<hr/>The documentation for this struct was generated from the following file:<ul>\n<li>turbojpeg.h</li>\n</ul>\n</div><!-- contents -->\n<!-- start footer part -->\n<hr class=\"footer\"/><address class=\"footer\"><small>\nGenerated by &#160;<a href=\"http://www.doxygen.org/index.html\">\n<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/>\n</a> 1.8.3.1\n</small></address>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/structtjtransform.html",
    "content": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.3.1\"/>\n<title>TurboJPEG: tjtransform Struct Reference</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<script type=\"text/javascript\">\n  $(document).ready(function() { searchBox.OnSelectItem(0); });\n</script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n<link href=\"doxygen-extra.css\" rel=\"stylesheet\" type=\"text/css\"/>\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n  <td style=\"padding-left: 0.5em;\">\n   <div id=\"projectname\">TurboJPEG\n   &#160;<span id=\"projectnumber\">1.5</span>\n   </div>\n  </td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.3.1 -->\n<script type=\"text/javascript\">\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n</script>\n  <div id=\"navrow1\" class=\"tabs\">\n    <ul class=\"tablist\">\n      <li><a href=\"index.html\"><span>Main&#160;Page</span></a></li>\n      <li><a href=\"modules.html\"><span>Modules</span></a></li>\n      <li class=\"current\"><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li>\n        <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n        <span class=\"left\">\n          <img id=\"MSearchSelect\" src=\"search/mag_sel.png\"\n               onmouseover=\"return searchBox.OnSearchSelectShow()\"\n               onmouseout=\"return searchBox.OnSearchSelectHide()\"\n               alt=\"\"/>\n          <input type=\"text\" id=\"MSearchField\" value=\"Search\" accesskey=\"S\"\n               onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n               onblur=\"searchBox.OnSearchFieldFocus(false)\" \n               onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n          </span><span class=\"right\">\n            <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\"><img id=\"MSearchCloseImg\" border=\"0\" src=\"search/close.png\" alt=\"\"/></a>\n          </span>\n        </div>\n      </li>\n    </ul>\n  </div>\n  <div id=\"navrow2\" class=\"tabs2\">\n    <ul class=\"tablist\">\n      <li><a href=\"annotated.html\"><span>Data&#160;Structures</span></a></li>\n      <li><a href=\"classes.html\"><span>Data&#160;Structure&#160;Index</span></a></li>\n      <li><a href=\"functions.html\"><span>Data&#160;Fields</span></a></li>\n    </ul>\n  </div>\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n     onmouseover=\"return searchBox.OnSearchSelectShow()\"\n     onmouseout=\"return searchBox.OnSearchSelectHide()\"\n     onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n<a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(0)\"><span class=\"SelectionMark\">&#160;</span>All</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(1)\"><span class=\"SelectionMark\">&#160;</span>Data Structures</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(2)\"><span class=\"SelectionMark\">&#160;</span>Functions</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(3)\"><span class=\"SelectionMark\">&#160;</span>Variables</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(4)\"><span class=\"SelectionMark\">&#160;</span>Typedefs</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(5)\"><span class=\"SelectionMark\">&#160;</span>Enumerations</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(6)\"><span class=\"SelectionMark\">&#160;</span>Enumerator</a><a class=\"SelectItem\" href=\"javascript:void(0)\" onclick=\"searchBox.OnSelectItem(7)\"><span class=\"SelectionMark\">&#160;</span>Groups</a></div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\">\n<iframe src=\"javascript:void(0)\" frameborder=\"0\" \n        name=\"MSearchResults\" id=\"MSearchResults\">\n</iframe>\n</div>\n\n</div><!-- top -->\n<div class=\"header\">\n  <div class=\"summary\">\n<a href=\"#pub-attribs\">Data Fields</a>  </div>\n  <div class=\"headertitle\">\n<div class=\"title\">tjtransform Struct Reference<div class=\"ingroups\"><a class=\"el\" href=\"group___turbo_j_p_e_g.html\">TurboJPEG</a></div></div>  </div>\n</div><!--header-->\n<div class=\"contents\">\n\n<p>Lossless transform.  \n <a href=\"structtjtransform.html#details\">More...</a></p>\n\n<p><code>#include &lt;turbojpeg.h&gt;</code></p>\n<table class=\"memberdecls\">\n<tr class=\"heading\"><td colspan=\"2\"><h2 class=\"groupheader\"><a name=\"pub-attribs\"></a>\nData Fields</h2></td></tr>\n<tr class=\"memitem:ac324e5e442abec8a961e5bf219db12cf\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\"><a class=\"el\" href=\"structtjregion.html\">tjregion</a>&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf\">r</a></td></tr>\n<tr class=\"memdesc:ac324e5e442abec8a961e5bf219db12cf\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Cropping region.  <a href=\"#ac324e5e442abec8a961e5bf219db12cf\">More...</a><br/></td></tr>\n<tr class=\"separator:ac324e5e442abec8a961e5bf219db12cf\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:a2525aab4ba6978a1c273f74fef50e498\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498\">op</a></td></tr>\n<tr class=\"memdesc:a2525aab4ba6978a1c273f74fef50e498\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">One of the <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866\">transform operations</a>.  <a href=\"#a2525aab4ba6978a1c273f74fef50e498\">More...</a><br/></td></tr>\n<tr class=\"separator:a2525aab4ba6978a1c273f74fef50e498\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:ac0e74655baa4402209a21e1ae481c8f6\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">int&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6\">options</a></td></tr>\n<tr class=\"memdesc:ac0e74655baa4402209a21e1ae481c8f6\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">The bitwise OR of one of more of the <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2\">transform options</a>.  <a href=\"#ac0e74655baa4402209a21e1ae481c8f6\">More...</a><br/></td></tr>\n<tr class=\"separator:ac0e74655baa4402209a21e1ae481c8f6\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:a688fe8f1a8ecc12a538d9e561cf338e3\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">void *&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3\">data</a></td></tr>\n<tr class=\"memdesc:a688fe8f1a8ecc12a538d9e561cf338e3\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">Arbitrary data that can be accessed within the body of the callback function.  <a href=\"#a688fe8f1a8ecc12a538d9e561cf338e3\">More...</a><br/></td></tr>\n<tr class=\"separator:a688fe8f1a8ecc12a538d9e561cf338e3\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n<tr class=\"memitem:a43ee1bcdd2a8d7249a756774f78793c1\"><td class=\"memItemLeft\" align=\"right\" valign=\"top\">int(*&#160;</td><td class=\"memItemRight\" valign=\"bottom\"><a class=\"el\" href=\"structtjtransform.html#a43ee1bcdd2a8d7249a756774f78793c1\">customFilter</a> )(short *coeffs, <a class=\"el\" href=\"structtjregion.html\">tjregion</a> arrayRegion, <a class=\"el\" href=\"structtjregion.html\">tjregion</a> planeRegion, int componentIndex, int transformIndex, struct <a class=\"el\" href=\"structtjtransform.html\">tjtransform</a> *transform)</td></tr>\n<tr class=\"memdesc:a43ee1bcdd2a8d7249a756774f78793c1\"><td class=\"mdescLeft\">&#160;</td><td class=\"mdescRight\">A callback function that can be used to modify the DCT coefficients after they are losslessly transformed but before they are transcoded to a new JPEG image.  <a href=\"#a43ee1bcdd2a8d7249a756774f78793c1\">More...</a><br/></td></tr>\n<tr class=\"separator:a43ee1bcdd2a8d7249a756774f78793c1\"><td class=\"memSeparator\" colspan=\"2\">&#160;</td></tr>\n</table>\n<a name=\"details\" id=\"details\"></a><h2 class=\"groupheader\">Detailed Description</h2>\n<div class=\"textblock\"><p>Lossless transform. </p>\n</div><h2 class=\"groupheader\">Field Documentation</h2>\n<a class=\"anchor\" id=\"a43ee1bcdd2a8d7249a756774f78793c1\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">int(* tjtransform::customFilter)(short *coeffs, <a class=\"el\" href=\"structtjregion.html\">tjregion</a> arrayRegion, <a class=\"el\" href=\"structtjregion.html\">tjregion</a> planeRegion, int componentIndex, int transformIndex, struct <a class=\"el\" href=\"structtjtransform.html\">tjtransform</a> *transform)</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>A callback function that can be used to modify the DCT coefficients after they are losslessly transformed but before they are transcoded to a new JPEG image. </p>\n<p>This allows for custom filters or other transformations to be applied in the frequency domain.</p>\n<dl class=\"params\"><dt>Parameters</dt><dd>\n  <table class=\"params\">\n    <tr><td class=\"paramname\">coeffs</td><td>pointer to an array of transformed DCT coefficients. (NOTE: this pointer is not guaranteed to be valid once the callback returns, so applications wishing to hand off the DCT coefficients to another function or library should make a copy of them within the body of the callback.)</td></tr>\n    <tr><td class=\"paramname\">arrayRegion</td><td><a class=\"el\" href=\"structtjregion.html\" title=\"Cropping region.\">tjregion</a> structure containing the width and height of the array pointed to by <code>coeffs</code> as well as its offset relative to the component plane. TurboJPEG implementations may choose to split each component plane into multiple DCT coefficient arrays and call the callback function once for each array.</td></tr>\n    <tr><td class=\"paramname\">planeRegion</td><td><a class=\"el\" href=\"structtjregion.html\" title=\"Cropping region.\">tjregion</a> structure containing the width and height of the component plane to which <code>coeffs</code> belongs</td></tr>\n    <tr><td class=\"paramname\">componentID</td><td>ID number of the component plane to which <code>coeffs</code> belongs (Y, Cb, and Cr have, respectively, ID's of 0, 1, and 2 in typical JPEG images.)</td></tr>\n    <tr><td class=\"paramname\">transformID</td><td>ID number of the transformed image to which <code>coeffs</code> belongs. This is the same as the index of the transform in the <code>transforms</code> array that was passed to <a class=\"el\" href=\"group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a\" title=\"Losslessly transform a JPEG image into another JPEG image.\">tjTransform()</a>.</td></tr>\n    <tr><td class=\"paramname\">transform</td><td>a pointer to a <a class=\"el\" href=\"structtjtransform.html\" title=\"Lossless transform.\">tjtransform</a> structure that specifies the parameters and/or cropping region for this transform</td></tr>\n  </table>\n  </dd>\n</dl>\n<dl class=\"section return\"><dt>Returns</dt><dd>0 if the callback was successful, or -1 if an error occurred. </dd></dl>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"a688fe8f1a8ecc12a538d9e561cf338e3\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">void* tjtransform::data</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Arbitrary data that can be accessed within the body of the callback function. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"a2525aab4ba6978a1c273f74fef50e498\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">int tjtransform::op</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>One of the <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866\">transform operations</a>. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ac0e74655baa4402209a21e1ae481c8f6\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\">int tjtransform::options</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>The bitwise OR of one of more of the <a class=\"el\" href=\"group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2\">transform options</a>. </p>\n\n</div>\n</div>\n<a class=\"anchor\" id=\"ac324e5e442abec8a961e5bf219db12cf\"></a>\n<div class=\"memitem\">\n<div class=\"memproto\">\n      <table class=\"memname\">\n        <tr>\n          <td class=\"memname\"><a class=\"el\" href=\"structtjregion.html\">tjregion</a> tjtransform::r</td>\n        </tr>\n      </table>\n</div><div class=\"memdoc\">\n\n<p>Cropping region. </p>\n\n</div>\n</div>\n<hr/>The documentation for this struct was generated from the following file:<ul>\n<li>turbojpeg.h</li>\n</ul>\n</div><!-- contents -->\n<!-- start footer part -->\n<hr class=\"footer\"/><address class=\"footer\"><small>\nGenerated by &#160;<a href=\"http://www.doxygen.org/index.html\">\n<img class=\"footer\" src=\"doxygen.png\" alt=\"doxygen\"/>\n</a> 1.8.3.1\n</small></address>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doc/html/tabs.css",
    "content": ".tabs, .tabs2, .tabs3 {\n    background-image: url('tab_b.png');\n    width: 100%;\n    z-index: 101;\n    font-size: 13px;\n    font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;\n}\n\n.tabs2 {\n    font-size: 10px;\n}\n.tabs3 {\n    font-size: 9px;\n}\n\n.tablist {\n    margin: 0;\n    padding: 0;\n    display: table;\n}\n\n.tablist li {\n    float: left;\n    display: table-cell;\n    background-image: url('tab_b.png');\n    line-height: 36px;\n    list-style: none;\n}\n\n.tablist a {\n    display: block;\n    padding: 0 20px;\n    font-weight: bold;\n    background-image:url('tab_s.png');\n    background-repeat:no-repeat;\n    background-position:right;\n    color: #283A5D;\n    text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);\n    text-decoration: none;\n    outline: none;\n}\n\n.tabs3 .tablist a {\n    padding: 0 10px;\n}\n\n.tablist a:hover {\n    background-image: url('tab_h.png');\n    background-repeat:repeat-x;\n    color: #fff;\n    text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);\n    text-decoration: none;\n}\n\n.tablist li.current a {\n    background-image: url('tab_a.png');\n    background-repeat:repeat-x;\n    color: #fff;\n    text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doxygen-extra.css",
    "content": "code {\n\tcolor: #4665A2; \n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/doxygen.config",
    "content": "PROJECT_NAME = TurboJPEG\nPROJECT_NUMBER = 1.5\nOUTPUT_DIRECTORY = doc/\nUSE_WINDOWS_ENCODING = NO\nOPTIMIZE_OUTPUT_FOR_C = YES\nWARN_NO_PARAMDOC = YES\nGENERATE_LATEX = NO\nFILE_PATTERNS = turbojpeg.h\nHIDE_UNDOC_MEMBERS = YES\nVERBATIM_HEADERS = NO\nEXTRACT_STATIC = YES\nJAVADOC_AUTOBRIEF = YES\nMAX_INITIALIZER_LINES = 0\nALWAYS_DETAILED_SEC = YES\nHTML_TIMESTAMP = NO\nHTML_EXTRA_STYLESHEET = doxygen-extra.css\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/example.c",
    "content": "/*\n * example.c\n *\n * This file illustrates how to use the IJG code as a subroutine library\n * to read or write JPEG image files.  You should look at this code in\n * conjunction with the documentation file libjpeg.txt.\n *\n * This code will not do anything useful as-is, but it may be helpful as a\n * skeleton for constructing routines that call the JPEG library.\n *\n * We present these routines in the same coding style used in the JPEG code\n * (ANSI function definitions, etc); but you are of course free to code your\n * routines in a different style if you prefer.\n */\n\n#include <stdio.h>\n\n/*\n * Include file for users of JPEG library.\n * You will need to have included system headers that define at least\n * the typedefs FILE and size_t before you can include jpeglib.h.\n * (stdio.h is sufficient on ANSI-conforming systems.)\n * You may also wish to include \"jerror.h\".\n */\n\n#include \"jpeglib.h\"\n\n/*\n * <setjmp.h> is used for the optional error recovery mechanism shown in\n * the second part of the example.\n */\n\n#include <setjmp.h>\n\n\n\n/******************** JPEG COMPRESSION SAMPLE INTERFACE *******************/\n\n/* This half of the example shows how to feed data into the JPEG compressor.\n * We present a minimal version that does not worry about refinements such\n * as error recovery (the JPEG code will just exit() if it gets an error).\n */\n\n\n/*\n * IMAGE DATA FORMATS:\n *\n * The standard input image format is a rectangular array of pixels, with\n * each pixel having the same number of \"component\" values (color channels).\n * Each pixel row is an array of JSAMPLEs (which typically are unsigned chars).\n * If you are working with color data, then the color values for each pixel\n * must be adjacent in the row; for example, R,G,B,R,G,B,R,G,B,... for 24-bit\n * RGB color.\n *\n * For this example, we'll assume that this data structure matches the way\n * our application has stored the image in memory, so we can just pass a\n * pointer to our image buffer.  In particular, let's say that the image is\n * RGB color and is described by:\n */\n\nextern JSAMPLE *image_buffer;   /* Points to large array of R,G,B-order data */\nextern int image_height;        /* Number of rows in image */\nextern int image_width;         /* Number of columns in image */\n\n\n/*\n * Sample routine for JPEG compression.  We assume that the target file name\n * and a compression quality factor are passed in.\n */\n\nGLOBAL(void)\nwrite_JPEG_file (char *filename, int quality)\n{\n  /* This struct contains the JPEG compression parameters and pointers to\n   * working space (which is allocated as needed by the JPEG library).\n   * It is possible to have several such structures, representing multiple\n   * compression/decompression processes, in existence at once.  We refer\n   * to any one struct (and its associated working data) as a \"JPEG object\".\n   */\n  struct jpeg_compress_struct cinfo;\n  /* This struct represents a JPEG error handler.  It is declared separately\n   * because applications often want to supply a specialized error handler\n   * (see the second half of this file for an example).  But here we just\n   * take the easy way out and use the standard error handler, which will\n   * print a message on stderr and call exit() if compression fails.\n   * Note that this struct must live as long as the main JPEG parameter\n   * struct, to avoid dangling-pointer problems.\n   */\n  struct jpeg_error_mgr jerr;\n  /* More stuff */\n  FILE *outfile;                /* target file */\n  JSAMPROW row_pointer[1];      /* pointer to JSAMPLE row[s] */\n  int row_stride;               /* physical row width in image buffer */\n\n  /* Step 1: allocate and initialize JPEG compression object */\n\n  /* We have to set up the error handler first, in case the initialization\n   * step fails.  (Unlikely, but it could happen if you are out of memory.)\n   * This routine fills in the contents of struct jerr, and returns jerr's\n   * address which we place into the link field in cinfo.\n   */\n  cinfo.err = jpeg_std_error(&jerr);\n  /* Now we can initialize the JPEG compression object. */\n  jpeg_create_compress(&cinfo);\n\n  /* Step 2: specify data destination (eg, a file) */\n  /* Note: steps 2 and 3 can be done in either order. */\n\n  /* Here we use the library-supplied code to send compressed data to a\n   * stdio stream.  You can also write your own code to do something else.\n   * VERY IMPORTANT: use \"b\" option to fopen() if you are on a machine that\n   * requires it in order to write binary files.\n   */\n  if ((outfile = fopen(filename, \"wb\")) == NULL) {\n    fprintf(stderr, \"can't open %s\\n\", filename);\n    exit(1);\n  }\n  jpeg_stdio_dest(&cinfo, outfile);\n\n  /* Step 3: set parameters for compression */\n\n  /* First we supply a description of the input image.\n   * Four fields of the cinfo struct must be filled in:\n   */\n  cinfo.image_width = image_width;      /* image width and height, in pixels */\n  cinfo.image_height = image_height;\n  cinfo.input_components = 3;           /* # of color components per pixel */\n  cinfo.in_color_space = JCS_RGB;       /* colorspace of input image */\n  /* Now use the library's routine to set default compression parameters.\n   * (You must set at least cinfo.in_color_space before calling this,\n   * since the defaults depend on the source color space.)\n   */\n  jpeg_set_defaults(&cinfo);\n  /* Now you can set any non-default parameters you wish to.\n   * Here we just illustrate the use of quality (quantization table) scaling:\n   */\n  jpeg_set_quality(&cinfo, quality, TRUE /* limit to baseline-JPEG values */);\n\n  /* Step 4: Start compressor */\n\n  /* TRUE ensures that we will write a complete interchange-JPEG file.\n   * Pass TRUE unless you are very sure of what you're doing.\n   */\n  jpeg_start_compress(&cinfo, TRUE);\n\n  /* Step 5: while (scan lines remain to be written) */\n  /*           jpeg_write_scanlines(...); */\n\n  /* Here we use the library's state variable cinfo.next_scanline as the\n   * loop counter, so that we don't have to keep track ourselves.\n   * To keep things simple, we pass one scanline per call; you can pass\n   * more if you wish, though.\n   */\n  row_stride = image_width * 3; /* JSAMPLEs per row in image_buffer */\n\n  while (cinfo.next_scanline < cinfo.image_height) {\n    /* jpeg_write_scanlines expects an array of pointers to scanlines.\n     * Here the array is only one element long, but you could pass\n     * more than one scanline at a time if that's more convenient.\n     */\n    row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride];\n    (void) jpeg_write_scanlines(&cinfo, row_pointer, 1);\n  }\n\n  /* Step 6: Finish compression */\n\n  jpeg_finish_compress(&cinfo);\n  /* After finish_compress, we can close the output file. */\n  fclose(outfile);\n\n  /* Step 7: release JPEG compression object */\n\n  /* This is an important step since it will release a good deal of memory. */\n  jpeg_destroy_compress(&cinfo);\n\n  /* And we're done! */\n}\n\n\n/*\n * SOME FINE POINTS:\n *\n * In the above loop, we ignored the return value of jpeg_write_scanlines,\n * which is the number of scanlines actually written.  We could get away\n * with this because we were only relying on the value of cinfo.next_scanline,\n * which will be incremented correctly.  If you maintain additional loop\n * variables then you should be careful to increment them properly.\n * Actually, for output to a stdio stream you needn't worry, because\n * then jpeg_write_scanlines will write all the lines passed (or else exit\n * with a fatal error).  Partial writes can only occur if you use a data\n * destination module that can demand suspension of the compressor.\n * (If you don't know what that's for, you don't need it.)\n *\n * If the compressor requires full-image buffers (for entropy-coding\n * optimization or a multi-scan JPEG file), it will create temporary\n * files for anything that doesn't fit within the maximum-memory setting.\n * (Note that temp files are NOT needed if you use the default parameters.)\n * On some systems you may need to set up a signal handler to ensure that\n * temporary files are deleted if the program is interrupted.  See libjpeg.txt.\n *\n * Scanlines MUST be supplied in top-to-bottom order if you want your JPEG\n * files to be compatible with everyone else's.  If you cannot readily read\n * your data in that order, you'll need an intermediate array to hold the\n * image.  See rdtarga.c or rdbmp.c for examples of handling bottom-to-top\n * source data using the JPEG code's internal virtual-array mechanisms.\n */\n\n\n\n/******************** JPEG DECOMPRESSION SAMPLE INTERFACE *******************/\n\n/* This half of the example shows how to read data from the JPEG decompressor.\n * It's a bit more refined than the above, in that we show:\n *   (a) how to modify the JPEG library's standard error-reporting behavior;\n *   (b) how to allocate workspace using the library's memory manager.\n *\n * Just to make this example a little different from the first one, we'll\n * assume that we do not intend to put the whole image into an in-memory\n * buffer, but to send it line-by-line someplace else.  We need a one-\n * scanline-high JSAMPLE array as a work buffer, and we will let the JPEG\n * memory manager allocate it for us.  This approach is actually quite useful\n * because we don't need to remember to deallocate the buffer separately: it\n * will go away automatically when the JPEG object is cleaned up.\n */\n\n\n/*\n * ERROR HANDLING:\n *\n * The JPEG library's standard error handler (jerror.c) is divided into\n * several \"methods\" which you can override individually.  This lets you\n * adjust the behavior without duplicating a lot of code, which you might\n * have to update with each future release.\n *\n * Our example here shows how to override the \"error_exit\" method so that\n * control is returned to the library's caller when a fatal error occurs,\n * rather than calling exit() as the standard error_exit method does.\n *\n * We use C's setjmp/longjmp facility to return control.  This means that the\n * routine which calls the JPEG library must first execute a setjmp() call to\n * establish the return point.  We want the replacement error_exit to do a\n * longjmp().  But we need to make the setjmp buffer accessible to the\n * error_exit routine.  To do this, we make a private extension of the\n * standard JPEG error handler object.  (If we were using C++, we'd say we\n * were making a subclass of the regular error handler.)\n *\n * Here's the extended error handler struct:\n */\n\nstruct my_error_mgr {\n  struct jpeg_error_mgr pub;    /* \"public\" fields */\n\n  jmp_buf setjmp_buffer;        /* for return to caller */\n};\n\ntypedef struct my_error_mgr *my_error_ptr;\n\n/*\n * Here's the routine that will replace the standard error_exit method:\n */\n\nMETHODDEF(void)\nmy_error_exit (j_common_ptr cinfo)\n{\n  /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */\n  my_error_ptr myerr = (my_error_ptr) cinfo->err;\n\n  /* Always display the message. */\n  /* We could postpone this until after returning, if we chose. */\n  (*cinfo->err->output_message) (cinfo);\n\n  /* Return control to the setjmp point */\n  longjmp(myerr->setjmp_buffer, 1);\n}\n\n\n/*\n * Sample routine for JPEG decompression.  We assume that the source file name\n * is passed in.  We want to return 1 on success, 0 on error.\n */\n\n\nGLOBAL(int)\nread_JPEG_file (char *filename)\n{\n  /* This struct contains the JPEG decompression parameters and pointers to\n   * working space (which is allocated as needed by the JPEG library).\n   */\n  struct jpeg_decompress_struct cinfo;\n  /* We use our private extension JPEG error handler.\n   * Note that this struct must live as long as the main JPEG parameter\n   * struct, to avoid dangling-pointer problems.\n   */\n  struct my_error_mgr jerr;\n  /* More stuff */\n  FILE *infile;                 /* source file */\n  JSAMPARRAY buffer;            /* Output row buffer */\n  int row_stride;               /* physical row width in output buffer */\n\n  /* In this example we want to open the input file before doing anything else,\n   * so that the setjmp() error recovery below can assume the file is open.\n   * VERY IMPORTANT: use \"b\" option to fopen() if you are on a machine that\n   * requires it in order to read binary files.\n   */\n\n  if ((infile = fopen(filename, \"rb\")) == NULL) {\n    fprintf(stderr, \"can't open %s\\n\", filename);\n    return 0;\n  }\n\n  /* Step 1: allocate and initialize JPEG decompression object */\n\n  /* We set up the normal JPEG error routines, then override error_exit. */\n  cinfo.err = jpeg_std_error(&jerr.pub);\n  jerr.pub.error_exit = my_error_exit;\n  /* Establish the setjmp return context for my_error_exit to use. */\n  if (setjmp(jerr.setjmp_buffer)) {\n    /* If we get here, the JPEG code has signaled an error.\n     * We need to clean up the JPEG object, close the input file, and return.\n     */\n    jpeg_destroy_decompress(&cinfo);\n    fclose(infile);\n    return 0;\n  }\n  /* Now we can initialize the JPEG decompression object. */\n  jpeg_create_decompress(&cinfo);\n\n  /* Step 2: specify data source (eg, a file) */\n\n  jpeg_stdio_src(&cinfo, infile);\n\n  /* Step 3: read file parameters with jpeg_read_header() */\n\n  (void) jpeg_read_header(&cinfo, TRUE);\n  /* We can ignore the return value from jpeg_read_header since\n   *   (a) suspension is not possible with the stdio data source, and\n   *   (b) we passed TRUE to reject a tables-only JPEG file as an error.\n   * See libjpeg.txt for more info.\n   */\n\n  /* Step 4: set parameters for decompression */\n\n  /* In this example, we don't need to change any of the defaults set by\n   * jpeg_read_header(), so we do nothing here.\n   */\n\n  /* Step 5: Start decompressor */\n\n  (void) jpeg_start_decompress(&cinfo);\n  /* We can ignore the return value since suspension is not possible\n   * with the stdio data source.\n   */\n\n  /* We may need to do some setup of our own at this point before reading\n   * the data.  After jpeg_start_decompress() we have the correct scaled\n   * output image dimensions available, as well as the output colormap\n   * if we asked for color quantization.\n   * In this example, we need to make an output work buffer of the right size.\n   */\n  /* JSAMPLEs per row in output buffer */\n  row_stride = cinfo.output_width * cinfo.output_components;\n  /* Make a one-row-high sample array that will go away when done with image */\n  buffer = (*cinfo.mem->alloc_sarray)\n                ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);\n\n  /* Step 6: while (scan lines remain to be read) */\n  /*           jpeg_read_scanlines(...); */\n\n  /* Here we use the library's state variable cinfo.output_scanline as the\n   * loop counter, so that we don't have to keep track ourselves.\n   */\n  while (cinfo.output_scanline < cinfo.output_height) {\n    /* jpeg_read_scanlines expects an array of pointers to scanlines.\n     * Here the array is only one element long, but you could ask for\n     * more than one scanline at a time if that's more convenient.\n     */\n    (void) jpeg_read_scanlines(&cinfo, buffer, 1);\n    /* Assume put_scanline_someplace wants a pointer and sample count. */\n    put_scanline_someplace(buffer[0], row_stride);\n  }\n\n  /* Step 7: Finish decompression */\n\n  (void) jpeg_finish_decompress(&cinfo);\n  /* We can ignore the return value since suspension is not possible\n   * with the stdio data source.\n   */\n\n  /* Step 8: Release JPEG decompression object */\n\n  /* This is an important step since it will release a good deal of memory. */\n  jpeg_destroy_decompress(&cinfo);\n\n  /* After finish_decompress, we can close the input file.\n   * Here we postpone it until after no more JPEG errors are possible,\n   * so as to simplify the setjmp error logic above.  (Actually, I don't\n   * think that jpeg_destroy can do an error exit, but why assume anything...)\n   */\n  fclose(infile);\n\n  /* At this point you may want to check to see whether any corrupt-data\n   * warnings occurred (test whether jerr.pub.num_warnings is nonzero).\n   */\n\n  /* And we're done! */\n  return 1;\n}\n\n\n/*\n * SOME FINE POINTS:\n *\n * In the above code, we ignored the return value of jpeg_read_scanlines,\n * which is the number of scanlines actually read.  We could get away with\n * this because we asked for only one line at a time and we weren't using\n * a suspending data source.  See libjpeg.txt for more info.\n *\n * We cheated a bit by calling alloc_sarray() after jpeg_start_decompress();\n * we should have done it beforehand to ensure that the space would be\n * counted against the JPEG max_memory setting.  In some systems the above\n * code would risk an out-of-memory error.  However, in general we don't\n * know the output image dimensions before jpeg_start_decompress(), unless we\n * call jpeg_calc_output_dimensions().  See libjpeg.txt for more about this.\n *\n * Scanlines are returned in the same order as they appear in the JPEG file,\n * which is standardly top-to-bottom.  If you must emit data bottom-to-top,\n * you can use one of the virtual arrays provided by the JPEG memory manager\n * to invert the data.  See wrbmp.c for an example.\n *\n * As with compression, some operating modes may require temporary files.\n * On some systems you may need to set up a signal handler to ensure that\n * temporary files are deleted if the program is interrupted.  See libjpeg.txt.\n */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/include/config.h",
    "content": ""
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/include/jconfig.h",
    "content": "/* jconfig.h.  Generated from jconfig.h.in by configure.  */\n/* Version ID for the JPEG library.\n * Might be useful for tests like \"#if JPEG_LIB_VERSION >= 60\".\n */\n#define JPEG_LIB_VERSION 62\n\n/* libjpeg-turbo version */\n#define LIBJPEG_TURBO_VERSION 1.5.0\n\n/* Support arithmetic encoding */\n#define C_ARITH_CODING_SUPPORTED 1\n\n/* Support arithmetic decoding */\n#define D_ARITH_CODING_SUPPORTED 1\n\n/*\n * Define BITS_IN_JSAMPLE as either\n *   8   for 8-bit sample values (the usual setting)\n *   12  for 12-bit sample values\n * Only 8 and 12 are legal data precisions for lossy JPEG according to the\n * JPEG standard, and the IJG code does not support anything else!\n * We do not support run-time selection of data precision, sorry.\n */\n\n#define BITS_IN_JSAMPLE  8      /* use 8 or 12 */\n\n/* Define to 1 if you have the <locale.h> header file. */\n#define HAVE_LOCALE_H 1\n\n/* Define to 1 if you have the <stddef.h> header file. */\n#define HAVE_STDDEF_H 1\n\n/* Define to 1 if you have the <stdlib.h> header file. */\n#define HAVE_STDLIB_H 1\n\n/* Define to 1 if the system has the type `unsigned char'. */\n#define HAVE_UNSIGNED_CHAR 1\n\n/* Define to 1 if the system has the type `unsigned short'. */\n#define HAVE_UNSIGNED_SHORT 1\n\n/* Compiler does not support pointers to undefined structures. */\n/* #undef INCOMPLETE_TYPES_BROKEN */\n\n/* Support in-memory source/destination managers */\n#define MEM_SRCDST_SUPPORTED 1\n\n/* Define if you have BSD-like bzero and bcopy in <strings.h> rather than\n   memset/memcpy in <string.h>. */\n/* #undef NEED_BSD_STRINGS */\n\n/* Define if you need to include <sys/types.h> to get size_t. */\n#define NEED_SYS_TYPES_H 1\n\n/* Define if your (broken) compiler shifts signed values as if they were\n   unsigned. */\n/* #undef RIGHT_SHIFT_IS_UNSIGNED */\n\n/* Use accelerated SIMD routines. */\n#define WITH_SIMD 1\n\n/* Define to 1 if type `char' is unsigned and you are not using gcc.  */\n#ifndef __CHAR_UNSIGNED__\n/* # undef __CHAR_UNSIGNED__ */\n#endif\n\n#define HAVE_DLFCN_H 1\n#define HAVE_INTTYPES_H 1\n#define HAVE_MEMCPY 1\n#define HAVE_MEMORY_H 1\n#define HAVE_MEMSET 1\n#define HAVE_STDINT_H 1\n#define HAVE_STRINGS_H 1\n#define HAVE_STRING_H 1\n#define HAVE_SYS_STAT_H 1\n#define HAVE_SYS_TYPES_H 1\n#define HAVE_UNISTD_H 1\n#define STDC_HEADERS 1\n\n/* Define to empty if `const' does not conform to ANSI C. */\n/* #undef const */\n\n/* Define to `unsigned int' if <sys/types.h> does not define. */\n/* #undef size_t */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/include/jconfigint.h",
    "content": "/* jconfigint.h.  Generated from jconfigint.h.in by configure.  */\n/* libjpeg-turbo build number */\n#define BUILD \"20160617\"\n\n/* How to obtain function inlining. */\n#define INLINE inline __attribute__((always_inline))\n\n/* Define to the full name of this package. */\n#define PACKAGE_NAME \"libjpeg-turbo\"\n\n/* Version number of package */\n#define VERSION \"1.5.0\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/include/jsimdcfg.inc",
    "content": ";\n; Automatically generated include file from jsimdcfg.inc.h\n;\n;\n; -- jpeglib.h\n;\n%define DCTSIZE 8\n%define DCTSIZE2 64\n;\n; -- jmorecfg.h\n;\n%define RGB_RED 0\n%define RGB_GREEN 1\n%define RGB_BLUE 2\n%define RGB_PIXELSIZE 3\n%define EXT_RGB_RED 0\n%define EXT_RGB_GREEN 1\n%define EXT_RGB_BLUE 2\n%define EXT_RGB_PIXELSIZE 3\n%define EXT_RGBX_RED 0\n%define EXT_RGBX_GREEN 1\n%define EXT_RGBX_BLUE 2\n%define EXT_RGBX_PIXELSIZE 4\n%define EXT_BGR_RED 2\n%define EXT_BGR_GREEN 1\n%define EXT_BGR_BLUE 0\n%define EXT_BGR_PIXELSIZE 3\n%define EXT_BGRX_RED 2\n%define EXT_BGRX_GREEN 1\n%define EXT_BGRX_BLUE 0\n%define EXT_BGRX_PIXELSIZE 4\n%define EXT_XBGR_RED 3\n%define EXT_XBGR_GREEN 2\n%define EXT_XBGR_BLUE 1\n%define EXT_XBGR_PIXELSIZE 4\n%define EXT_XRGB_RED 1\n%define EXT_XRGB_GREEN 2\n%define EXT_XRGB_BLUE 3\n%define EXT_XRGB_PIXELSIZE 4\n%define RGBX_FILLER_0XFF 1\n; Representation of a single sample (pixel element value).\n; On this SIMD implementation, this must be 'unsigned char'.\n;\n%define JSAMPLE byte ; unsigned char\n%define SIZEOF_JSAMPLE SIZEOF_BYTE ; sizeof(JSAMPLE)\n%define CENTERJSAMPLE 128\n; Representation of a DCT frequency coefficient.\n; On this SIMD implementation, this must be 'short'.\n;\n%define JCOEF word ; short\n%define SIZEOF_JCOEF SIZEOF_WORD ; sizeof(JCOEF)\n; Datatype used for image dimensions.\n; On this SIMD implementation, this must be 'unsigned int'.\n;\n%define JDIMENSION dword ; unsigned int\n%define SIZEOF_JDIMENSION SIZEOF_DWORD ; sizeof(JDIMENSION)\n%define JSAMPROW POINTER ; JSAMPLE * (jpeglib.h)\n%define JSAMPARRAY POINTER ; JSAMPROW * (jpeglib.h)\n%define JSAMPIMAGE POINTER ; JSAMPARRAY * (jpeglib.h)\n%define JCOEFPTR POINTER ; JCOEF * (jpeglib.h)\n%define SIZEOF_JSAMPROW SIZEOF_POINTER ; sizeof(JSAMPROW)\n%define SIZEOF_JSAMPARRAY SIZEOF_POINTER ; sizeof(JSAMPARRAY)\n%define SIZEOF_JSAMPIMAGE SIZEOF_POINTER ; sizeof(JSAMPIMAGE)\n%define SIZEOF_JCOEFPTR SIZEOF_POINTER ; sizeof(JCOEFPTR)\n;\n; -- jdct.h\n;\n; A forward DCT routine is given a pointer to a work area of type DCTELEM[];\n; the DCT is to be performed in-place in that buffer.\n; To maximize parallelism, Type DCTELEM is changed to short (originally, int).\n;\n%define DCTELEM word ; short\n%define SIZEOF_DCTELEM SIZEOF_WORD ; sizeof(DCTELEM)\n%define float FP32 ; float\n%define SIZEOF_FAST_FLOAT SIZEOF_FP32 ; sizeof(float)\n; To maximize parallelism, Type short is changed to short.\n;\n%define ISLOW_MULT_TYPE word ; must be short\n%define SIZEOF_ISLOW_MULT_TYPE SIZEOF_WORD ; sizeof(ISLOW_MULT_TYPE)\n%define IFAST_MULT_TYPE word ; must be short\n%define SIZEOF_IFAST_MULT_TYPE SIZEOF_WORD ; sizeof(IFAST_MULT_TYPE)\n%define IFAST_SCALE_BITS 2 ; fractional bits in scale factors\n%define FLOAT_MULT_TYPE FP32 ; must be float\n%define SIZEOF_FLOAT_MULT_TYPE SIZEOF_FP32 ; sizeof(FLOAT_MULT_TYPE)\n;\n; -- jsimd.h\n;\n%define JSIMD_NONE 0x00\n%define JSIMD_MMX 0x01\n%define JSIMD_3DNOW 0x02\n%define JSIMD_SSE 0x04\n%define JSIMD_SSE2 0x08\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/install-sh",
    "content": "#!/bin/sh\n# install - install a program, script, or datafile\n\nscriptversion=2013-12-25.23; # UTC\n\n# This originates from X11R5 (mit/util/scripts/install.sh), which was\n# later released in X11R6 (xc/config/util/install.sh) with the\n# following copyright and license.\n#\n# Copyright (C) 1994 X Consortium\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to\n# deal in the Software without restriction, including without limitation the\n# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n# sell copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-\n# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n# Except as contained in this notice, the name of the X Consortium shall not\n# be used in advertising or otherwise to promote the sale, use or other deal-\n# ings in this Software without prior written authorization from the X Consor-\n# tium.\n#\n#\n# FSF changes to this file are in the public domain.\n#\n# Calling this script install-sh is preferred over install.sh, to prevent\n# 'make' implicit rules from creating a file called install from it\n# when there is no Makefile.\n#\n# This script is compatible with the BSD install script, but was written\n# from scratch.\n\ntab='\t'\nnl='\n'\nIFS=\" $tab$nl\"\n\n# Set DOITPROG to \"echo\" to test this script.\n\ndoit=${DOITPROG-}\ndoit_exec=${doit:-exec}\n\n# Put in absolute file names if you don't have them in your path;\n# or use environment vars.\n\nchgrpprog=${CHGRPPROG-chgrp}\nchmodprog=${CHMODPROG-chmod}\nchownprog=${CHOWNPROG-chown}\ncmpprog=${CMPPROG-cmp}\ncpprog=${CPPROG-cp}\nmkdirprog=${MKDIRPROG-mkdir}\nmvprog=${MVPROG-mv}\nrmprog=${RMPROG-rm}\nstripprog=${STRIPPROG-strip}\n\nposix_mkdir=\n\n# Desired mode of installed file.\nmode=0755\n\nchgrpcmd=\nchmodcmd=$chmodprog\nchowncmd=\nmvcmd=$mvprog\nrmcmd=\"$rmprog -f\"\nstripcmd=\n\nsrc=\ndst=\ndir_arg=\ndst_arg=\n\ncopy_on_change=false\nis_target_a_directory=possibly\n\nusage=\"\\\nUsage: $0 [OPTION]... [-T] SRCFILE DSTFILE\n   or: $0 [OPTION]... SRCFILES... DIRECTORY\n   or: $0 [OPTION]... -t DIRECTORY SRCFILES...\n   or: $0 [OPTION]... -d DIRECTORIES...\n\nIn the 1st form, copy SRCFILE to DSTFILE.\nIn the 2nd and 3rd, copy all SRCFILES to DIRECTORY.\nIn the 4th, create DIRECTORIES.\n\nOptions:\n     --help     display this help and exit.\n     --version  display version info and exit.\n\n  -c            (ignored)\n  -C            install only if different (preserve the last data modification time)\n  -d            create directories instead of installing files.\n  -g GROUP      $chgrpprog installed files to GROUP.\n  -m MODE       $chmodprog installed files to MODE.\n  -o USER       $chownprog installed files to USER.\n  -s            $stripprog installed files.\n  -t DIRECTORY  install into DIRECTORY.\n  -T            report an error if DSTFILE is a directory.\n\nEnvironment variables override the default commands:\n  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG\n  RMPROG STRIPPROG\n\"\n\nwhile test $# -ne 0; do\n  case $1 in\n    -c) ;;\n\n    -C) copy_on_change=true;;\n\n    -d) dir_arg=true;;\n\n    -g) chgrpcmd=\"$chgrpprog $2\"\n        shift;;\n\n    --help) echo \"$usage\"; exit $?;;\n\n    -m) mode=$2\n        case $mode in\n          *' '* | *\"$tab\"* | *\"$nl\"* | *'*'* | *'?'* | *'['*)\n            echo \"$0: invalid mode: $mode\" >&2\n            exit 1;;\n        esac\n        shift;;\n\n    -o) chowncmd=\"$chownprog $2\"\n        shift;;\n\n    -s) stripcmd=$stripprog;;\n\n    -t)\n        is_target_a_directory=always\n        dst_arg=$2\n        # Protect names problematic for 'test' and other utilities.\n        case $dst_arg in\n          -* | [=\\(\\)!]) dst_arg=./$dst_arg;;\n        esac\n        shift;;\n\n    -T) is_target_a_directory=never;;\n\n    --version) echo \"$0 $scriptversion\"; exit $?;;\n\n    --) shift\n        break;;\n\n    -*) echo \"$0: invalid option: $1\" >&2\n        exit 1;;\n\n    *)  break;;\n  esac\n  shift\ndone\n\n# We allow the use of options -d and -T together, by making -d\n# take the precedence; this is for compatibility with GNU install.\n\nif test -n \"$dir_arg\"; then\n  if test -n \"$dst_arg\"; then\n    echo \"$0: target directory not allowed when installing a directory.\" >&2\n    exit 1\n  fi\nfi\n\nif test $# -ne 0 && test -z \"$dir_arg$dst_arg\"; then\n  # When -d is used, all remaining arguments are directories to create.\n  # When -t is used, the destination is already specified.\n  # Otherwise, the last argument is the destination.  Remove it from $@.\n  for arg\n  do\n    if test -n \"$dst_arg\"; then\n      # $@ is not empty: it contains at least $arg.\n      set fnord \"$@\" \"$dst_arg\"\n      shift # fnord\n    fi\n    shift # arg\n    dst_arg=$arg\n    # Protect names problematic for 'test' and other utilities.\n    case $dst_arg in\n      -* | [=\\(\\)!]) dst_arg=./$dst_arg;;\n    esac\n  done\nfi\n\nif test $# -eq 0; then\n  if test -z \"$dir_arg\"; then\n    echo \"$0: no input file specified.\" >&2\n    exit 1\n  fi\n  # It's OK to call 'install-sh -d' without argument.\n  # This can happen when creating conditional directories.\n  exit 0\nfi\n\nif test -z \"$dir_arg\"; then\n  if test $# -gt 1 || test \"$is_target_a_directory\" = always; then\n    if test ! -d \"$dst_arg\"; then\n      echo \"$0: $dst_arg: Is not a directory.\" >&2\n      exit 1\n    fi\n  fi\nfi\n\nif test -z \"$dir_arg\"; then\n  do_exit='(exit $ret); exit $ret'\n  trap \"ret=129; $do_exit\" 1\n  trap \"ret=130; $do_exit\" 2\n  trap \"ret=141; $do_exit\" 13\n  trap \"ret=143; $do_exit\" 15\n\n  # Set umask so as not to create temps with too-generous modes.\n  # However, 'strip' requires both read and write access to temps.\n  case $mode in\n    # Optimize common cases.\n    *644) cp_umask=133;;\n    *755) cp_umask=22;;\n\n    *[0-7])\n      if test -z \"$stripcmd\"; then\n        u_plus_rw=\n      else\n        u_plus_rw='% 200'\n      fi\n      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;\n    *)\n      if test -z \"$stripcmd\"; then\n        u_plus_rw=\n      else\n        u_plus_rw=,u+rw\n      fi\n      cp_umask=$mode$u_plus_rw;;\n  esac\nfi\n\nfor src\ndo\n  # Protect names problematic for 'test' and other utilities.\n  case $src in\n    -* | [=\\(\\)!]) src=./$src;;\n  esac\n\n  if test -n \"$dir_arg\"; then\n    dst=$src\n    dstdir=$dst\n    test -d \"$dstdir\"\n    dstdir_status=$?\n  else\n\n    # Waiting for this to be detected by the \"$cpprog $src $dsttmp\" command\n    # might cause directories to be created, which would be especially bad\n    # if $src (and thus $dsttmp) contains '*'.\n    if test ! -f \"$src\" && test ! -d \"$src\"; then\n      echo \"$0: $src does not exist.\" >&2\n      exit 1\n    fi\n\n    if test -z \"$dst_arg\"; then\n      echo \"$0: no destination specified.\" >&2\n      exit 1\n    fi\n    dst=$dst_arg\n\n    # If destination is a directory, append the input filename; won't work\n    # if double slashes aren't ignored.\n    if test -d \"$dst\"; then\n      if test \"$is_target_a_directory\" = never; then\n        echo \"$0: $dst_arg: Is a directory\" >&2\n        exit 1\n      fi\n      dstdir=$dst\n      dst=$dstdir/`basename \"$src\"`\n      dstdir_status=0\n    else\n      dstdir=`dirname \"$dst\"`\n      test -d \"$dstdir\"\n      dstdir_status=$?\n    fi\n  fi\n\n  obsolete_mkdir_used=false\n\n  if test $dstdir_status != 0; then\n    case $posix_mkdir in\n      '')\n        # Create intermediate dirs using mode 755 as modified by the umask.\n        # This is like FreeBSD 'install' as of 1997-10-28.\n        umask=`umask`\n        case $stripcmd.$umask in\n          # Optimize common cases.\n          *[2367][2367]) mkdir_umask=$umask;;\n          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;\n\n          *[0-7])\n            mkdir_umask=`expr $umask + 22 \\\n              - $umask % 100 % 40 + $umask % 20 \\\n              - $umask % 10 % 4 + $umask % 2\n            `;;\n          *) mkdir_umask=$umask,go-w;;\n        esac\n\n        # With -d, create the new directory with the user-specified mode.\n        # Otherwise, rely on $mkdir_umask.\n        if test -n \"$dir_arg\"; then\n          mkdir_mode=-m$mode\n        else\n          mkdir_mode=\n        fi\n\n        posix_mkdir=false\n        case $umask in\n          *[123567][0-7][0-7])\n            # POSIX mkdir -p sets u+wx bits regardless of umask, which\n            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.\n            ;;\n          *)\n            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$\n            trap 'ret=$?; rmdir \"$tmpdir/d\" \"$tmpdir\" 2>/dev/null; exit $ret' 0\n\n            if (umask $mkdir_umask &&\n                exec $mkdirprog $mkdir_mode -p -- \"$tmpdir/d\") >/dev/null 2>&1\n            then\n              if test -z \"$dir_arg\" || {\n                   # Check for POSIX incompatibilities with -m.\n                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or\n                   # other-writable bit of parent directory when it shouldn't.\n                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.\n                   ls_ld_tmpdir=`ls -ld \"$tmpdir\"`\n                   case $ls_ld_tmpdir in\n                     d????-?r-*) different_mode=700;;\n                     d????-?--*) different_mode=755;;\n                     *) false;;\n                   esac &&\n                   $mkdirprog -m$different_mode -p -- \"$tmpdir\" && {\n                     ls_ld_tmpdir_1=`ls -ld \"$tmpdir\"`\n                     test \"$ls_ld_tmpdir\" = \"$ls_ld_tmpdir_1\"\n                   }\n                 }\n              then posix_mkdir=:\n              fi\n              rmdir \"$tmpdir/d\" \"$tmpdir\"\n            else\n              # Remove any dirs left behind by ancient mkdir implementations.\n              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null\n            fi\n            trap '' 0;;\n        esac;;\n    esac\n\n    if\n      $posix_mkdir && (\n        umask $mkdir_umask &&\n        $doit_exec $mkdirprog $mkdir_mode -p -- \"$dstdir\"\n      )\n    then :\n    else\n\n      # The umask is ridiculous, or mkdir does not conform to POSIX,\n      # or it failed possibly due to a race condition.  Create the\n      # directory the slow way, step by step, checking for races as we go.\n\n      case $dstdir in\n        /*) prefix='/';;\n        [-=\\(\\)!]*) prefix='./';;\n        *)  prefix='';;\n      esac\n\n      oIFS=$IFS\n      IFS=/\n      set -f\n      set fnord $dstdir\n      shift\n      set +f\n      IFS=$oIFS\n\n      prefixes=\n\n      for d\n      do\n        test X\"$d\" = X && continue\n\n        prefix=$prefix$d\n        if test -d \"$prefix\"; then\n          prefixes=\n        else\n          if $posix_mkdir; then\n            (umask=$mkdir_umask &&\n             $doit_exec $mkdirprog $mkdir_mode -p -- \"$dstdir\") && break\n            # Don't fail if two instances are running concurrently.\n            test -d \"$prefix\" || exit 1\n          else\n            case $prefix in\n              *\\'*) qprefix=`echo \"$prefix\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;;\n              *) qprefix=$prefix;;\n            esac\n            prefixes=\"$prefixes '$qprefix'\"\n          fi\n        fi\n        prefix=$prefix/\n      done\n\n      if test -n \"$prefixes\"; then\n        # Don't fail if two instances are running concurrently.\n        (umask $mkdir_umask &&\n         eval \"\\$doit_exec \\$mkdirprog $prefixes\") ||\n          test -d \"$dstdir\" || exit 1\n        obsolete_mkdir_used=true\n      fi\n    fi\n  fi\n\n  if test -n \"$dir_arg\"; then\n    { test -z \"$chowncmd\" || $doit $chowncmd \"$dst\"; } &&\n    { test -z \"$chgrpcmd\" || $doit $chgrpcmd \"$dst\"; } &&\n    { test \"$obsolete_mkdir_used$chowncmd$chgrpcmd\" = false ||\n      test -z \"$chmodcmd\" || $doit $chmodcmd $mode \"$dst\"; } || exit 1\n  else\n\n    # Make a couple of temp file names in the proper directory.\n    dsttmp=$dstdir/_inst.$$_\n    rmtmp=$dstdir/_rm.$$_\n\n    # Trap to clean up those temp files at exit.\n    trap 'ret=$?; rm -f \"$dsttmp\" \"$rmtmp\" && exit $ret' 0\n\n    # Copy the file name to the temp name.\n    (umask $cp_umask && $doit_exec $cpprog \"$src\" \"$dsttmp\") &&\n\n    # and set any options; do chmod last to preserve setuid bits.\n    #\n    # If any of these fail, we abort the whole thing.  If we want to\n    # ignore errors from any of these, just make sure not to ignore\n    # errors from the above \"$doit $cpprog $src $dsttmp\" command.\n    #\n    { test -z \"$chowncmd\" || $doit $chowncmd \"$dsttmp\"; } &&\n    { test -z \"$chgrpcmd\" || $doit $chgrpcmd \"$dsttmp\"; } &&\n    { test -z \"$stripcmd\" || $doit $stripcmd \"$dsttmp\"; } &&\n    { test -z \"$chmodcmd\" || $doit $chmodcmd $mode \"$dsttmp\"; } &&\n\n    # If -C, don't bother to copy if it wouldn't change the file.\n    if $copy_on_change &&\n       old=`LC_ALL=C ls -dlL \"$dst\"     2>/dev/null` &&\n       new=`LC_ALL=C ls -dlL \"$dsttmp\"  2>/dev/null` &&\n       set -f &&\n       set X $old && old=:$2:$4:$5:$6 &&\n       set X $new && new=:$2:$4:$5:$6 &&\n       set +f &&\n       test \"$old\" = \"$new\" &&\n       $cmpprog \"$dst\" \"$dsttmp\" >/dev/null 2>&1\n    then\n      rm -f \"$dsttmp\"\n    else\n      # Rename the file to the real destination.\n      $doit $mvcmd -f \"$dsttmp\" \"$dst\" 2>/dev/null ||\n\n      # The rename failed, perhaps because mv can't rename something else\n      # to itself, or perhaps because mv is so ancient that it does not\n      # support -f.\n      {\n        # Now remove or move aside any old file at destination location.\n        # We try this two ways since rm can't unlink itself on some\n        # systems and the destination file might be busy for other\n        # reasons.  In this case, the final cleanup might fail but the new\n        # file should still install successfully.\n        {\n          test ! -f \"$dst\" ||\n          $doit $rmcmd -f \"$dst\" 2>/dev/null ||\n          { $doit $mvcmd -f \"$dst\" \"$rmtmp\" 2>/dev/null &&\n            { $doit $rmcmd -f \"$rmtmp\" 2>/dev/null; :; }\n          } ||\n          { echo \"$0: cannot unlink or rename $dst\" >&2\n            (exit 1); exit 1\n          }\n        } &&\n\n        # Now rename the file to the real destination.\n        $doit $mvcmd \"$dsttmp\" \"$dst\"\n      }\n    fi || exit 1\n\n    trap '' 0\n  fi\ndone\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-time-zone: \"UTC\"\n# time-stamp-end: \"; # UTC\"\n# End:\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jaricom.c",
    "content": "/*\n * jaricom.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Developed 1997-2009 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains probability estimation tables for common use in\n * arithmetic entropy encoding and decoding routines.\n *\n * This data represents Table D.2 in the JPEG spec (ISO/IEC IS 10918-1\n * and CCITT Recommendation ITU-T T.81) and Table 24 in the JBIG spec\n * (ISO/IEC IS 11544 and CCITT Recommendation ITU-T T.82).\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n/* The following #define specifies the packing of the four components\n * into the compact JLONG representation.\n * Note that this formula must match the actual arithmetic encoder\n * and decoder implementation.  The implementation has to be changed\n * if this formula is changed.\n * The current organization is leaned on Markus Kuhn's JBIG\n * implementation (jbig_tab.c).\n */\n\n#define V(i,a,b,c,d) (((JLONG)a << 16) | ((JLONG)c << 8) | ((JLONG)d << 7) | b)\n\nconst JLONG jpeg_aritab[113+1] = {\n/*\n * Index, Qe_Value, Next_Index_LPS, Next_Index_MPS, Switch_MPS\n */\n  V(   0, 0x5a1d,   1,   1, 1 ),\n  V(   1, 0x2586,  14,   2, 0 ),\n  V(   2, 0x1114,  16,   3, 0 ),\n  V(   3, 0x080b,  18,   4, 0 ),\n  V(   4, 0x03d8,  20,   5, 0 ),\n  V(   5, 0x01da,  23,   6, 0 ),\n  V(   6, 0x00e5,  25,   7, 0 ),\n  V(   7, 0x006f,  28,   8, 0 ),\n  V(   8, 0x0036,  30,   9, 0 ),\n  V(   9, 0x001a,  33,  10, 0 ),\n  V(  10, 0x000d,  35,  11, 0 ),\n  V(  11, 0x0006,   9,  12, 0 ),\n  V(  12, 0x0003,  10,  13, 0 ),\n  V(  13, 0x0001,  12,  13, 0 ),\n  V(  14, 0x5a7f,  15,  15, 1 ),\n  V(  15, 0x3f25,  36,  16, 0 ),\n  V(  16, 0x2cf2,  38,  17, 0 ),\n  V(  17, 0x207c,  39,  18, 0 ),\n  V(  18, 0x17b9,  40,  19, 0 ),\n  V(  19, 0x1182,  42,  20, 0 ),\n  V(  20, 0x0cef,  43,  21, 0 ),\n  V(  21, 0x09a1,  45,  22, 0 ),\n  V(  22, 0x072f,  46,  23, 0 ),\n  V(  23, 0x055c,  48,  24, 0 ),\n  V(  24, 0x0406,  49,  25, 0 ),\n  V(  25, 0x0303,  51,  26, 0 ),\n  V(  26, 0x0240,  52,  27, 0 ),\n  V(  27, 0x01b1,  54,  28, 0 ),\n  V(  28, 0x0144,  56,  29, 0 ),\n  V(  29, 0x00f5,  57,  30, 0 ),\n  V(  30, 0x00b7,  59,  31, 0 ),\n  V(  31, 0x008a,  60,  32, 0 ),\n  V(  32, 0x0068,  62,  33, 0 ),\n  V(  33, 0x004e,  63,  34, 0 ),\n  V(  34, 0x003b,  32,  35, 0 ),\n  V(  35, 0x002c,  33,   9, 0 ),\n  V(  36, 0x5ae1,  37,  37, 1 ),\n  V(  37, 0x484c,  64,  38, 0 ),\n  V(  38, 0x3a0d,  65,  39, 0 ),\n  V(  39, 0x2ef1,  67,  40, 0 ),\n  V(  40, 0x261f,  68,  41, 0 ),\n  V(  41, 0x1f33,  69,  42, 0 ),\n  V(  42, 0x19a8,  70,  43, 0 ),\n  V(  43, 0x1518,  72,  44, 0 ),\n  V(  44, 0x1177,  73,  45, 0 ),\n  V(  45, 0x0e74,  74,  46, 0 ),\n  V(  46, 0x0bfb,  75,  47, 0 ),\n  V(  47, 0x09f8,  77,  48, 0 ),\n  V(  48, 0x0861,  78,  49, 0 ),\n  V(  49, 0x0706,  79,  50, 0 ),\n  V(  50, 0x05cd,  48,  51, 0 ),\n  V(  51, 0x04de,  50,  52, 0 ),\n  V(  52, 0x040f,  50,  53, 0 ),\n  V(  53, 0x0363,  51,  54, 0 ),\n  V(  54, 0x02d4,  52,  55, 0 ),\n  V(  55, 0x025c,  53,  56, 0 ),\n  V(  56, 0x01f8,  54,  57, 0 ),\n  V(  57, 0x01a4,  55,  58, 0 ),\n  V(  58, 0x0160,  56,  59, 0 ),\n  V(  59, 0x0125,  57,  60, 0 ),\n  V(  60, 0x00f6,  58,  61, 0 ),\n  V(  61, 0x00cb,  59,  62, 0 ),\n  V(  62, 0x00ab,  61,  63, 0 ),\n  V(  63, 0x008f,  61,  32, 0 ),\n  V(  64, 0x5b12,  65,  65, 1 ),\n  V(  65, 0x4d04,  80,  66, 0 ),\n  V(  66, 0x412c,  81,  67, 0 ),\n  V(  67, 0x37d8,  82,  68, 0 ),\n  V(  68, 0x2fe8,  83,  69, 0 ),\n  V(  69, 0x293c,  84,  70, 0 ),\n  V(  70, 0x2379,  86,  71, 0 ),\n  V(  71, 0x1edf,  87,  72, 0 ),\n  V(  72, 0x1aa9,  87,  73, 0 ),\n  V(  73, 0x174e,  72,  74, 0 ),\n  V(  74, 0x1424,  72,  75, 0 ),\n  V(  75, 0x119c,  74,  76, 0 ),\n  V(  76, 0x0f6b,  74,  77, 0 ),\n  V(  77, 0x0d51,  75,  78, 0 ),\n  V(  78, 0x0bb6,  77,  79, 0 ),\n  V(  79, 0x0a40,  77,  48, 0 ),\n  V(  80, 0x5832,  80,  81, 1 ),\n  V(  81, 0x4d1c,  88,  82, 0 ),\n  V(  82, 0x438e,  89,  83, 0 ),\n  V(  83, 0x3bdd,  90,  84, 0 ),\n  V(  84, 0x34ee,  91,  85, 0 ),\n  V(  85, 0x2eae,  92,  86, 0 ),\n  V(  86, 0x299a,  93,  87, 0 ),\n  V(  87, 0x2516,  86,  71, 0 ),\n  V(  88, 0x5570,  88,  89, 1 ),\n  V(  89, 0x4ca9,  95,  90, 0 ),\n  V(  90, 0x44d9,  96,  91, 0 ),\n  V(  91, 0x3e22,  97,  92, 0 ),\n  V(  92, 0x3824,  99,  93, 0 ),\n  V(  93, 0x32b4,  99,  94, 0 ),\n  V(  94, 0x2e17,  93,  86, 0 ),\n  V(  95, 0x56a8,  95,  96, 1 ),\n  V(  96, 0x4f46, 101,  97, 0 ),\n  V(  97, 0x47e5, 102,  98, 0 ),\n  V(  98, 0x41cf, 103,  99, 0 ),\n  V(  99, 0x3c3d, 104, 100, 0 ),\n  V( 100, 0x375e,  99,  93, 0 ),\n  V( 101, 0x5231, 105, 102, 0 ),\n  V( 102, 0x4c0f, 106, 103, 0 ),\n  V( 103, 0x4639, 107, 104, 0 ),\n  V( 104, 0x415e, 103,  99, 0 ),\n  V( 105, 0x5627, 105, 106, 1 ),\n  V( 106, 0x50e7, 108, 107, 0 ),\n  V( 107, 0x4b85, 109, 103, 0 ),\n  V( 108, 0x5597, 110, 109, 0 ),\n  V( 109, 0x504f, 111, 107, 0 ),\n  V( 110, 0x5a10, 110, 111, 1 ),\n  V( 111, 0x5522, 112, 109, 0 ),\n  V( 112, 0x59eb, 112, 111, 1 ),\n/*\n * This last entry is used for fixed probability estimate of 0.5\n * as recommended in Section 10.3 Table 5 of ITU-T Rec. T.851.\n */\n  V( 113, 0x5a1d, 113, 113, 0 )\n};\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/CMakeLists.txt",
    "content": "set(JAR_FILE turbojpeg.jar)\nset(MANIFEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/MANIFEST.MF)\n\nset(JAVA_CLASSNAMES org/libjpegturbo/turbojpeg/TJ\n  org/libjpegturbo/turbojpeg/TJCompressor\n  org/libjpegturbo/turbojpeg/TJCustomFilter\n  org/libjpegturbo/turbojpeg/TJDecompressor\n  org/libjpegturbo/turbojpeg/TJException\n  org/libjpegturbo/turbojpeg/TJScalingFactor\n  org/libjpegturbo/turbojpeg/TJTransform\n  org/libjpegturbo/turbojpeg/TJTransformer\n  org/libjpegturbo/turbojpeg/YUVImage\n  TJUnitTest\n  TJExample\n  TJBench)\n\nif(MSVC_IDE)\n  set(OBJDIR \"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}\")\nelse()\n  set(OBJDIR ${CMAKE_CURRENT_BINARY_DIR})\nendif()\n\nset(TURBOJPEG_DLL_NAME \"turbojpeg\")\nif(MINGW)\n  set(TURBOJPEG_DLL_NAME \"libturbojpeg\")\nendif()\nconfigure_file(org/libjpegturbo/turbojpeg/TJLoader.java.in\n  ${CMAKE_CURRENT_BINARY_DIR}/org/libjpegturbo/turbojpeg/TJLoader.java)\n\nset(JAVA_SOURCES \"\")\nset(JAVA_CLASSES \"\")\nset(JAVA_CLASSES_FULL \"\")\nforeach(class ${JAVA_CLASSNAMES})\n  set(JAVA_SOURCES ${JAVA_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/${class}.java)\n  set(JAVA_CLASSES ${JAVA_CLASSES} ${class}.class)\n  set(JAVA_CLASSES_FULL ${JAVA_CLASSES_FULL} ${OBJDIR}/${class}.class)\nendforeach()\n\nset(JAVA_SOURCES ${JAVA_SOURCES}\n  ${CMAKE_CURRENT_BINARY_DIR}/org/libjpegturbo/turbojpeg/TJLoader.java)\nset(JAVA_CLASSES ${JAVA_CLASSES}\n  org/libjpegturbo/turbojpeg/TJLoader.class)\nset(JAVA_CLASSES_FULL ${JAVA_CLASSES_FULL}\n  ${OBJDIR}/org/libjpegturbo/turbojpeg/TJLoader.class)\n\nstring(REGEX REPLACE \" \" \";\" JAVACFLAGS \"${JAVACFLAGS}\")\nadd_custom_command(OUTPUT ${JAVA_CLASSES_FULL} DEPENDS ${JAVA_SOURCES}\n  COMMAND ${JAVA_COMPILE} ARGS ${JAVACFLAGS} -d ${OBJDIR} ${JAVA_SOURCES})\n\nadd_custom_command(OUTPUT ${JAR_FILE} DEPENDS ${JAVA_CLASSES_FULL}\n  ${MANIFEST_FILE}\n  COMMAND ${JAVA_ARCHIVE} cfm ${JAR_FILE} ${MANIFEST_FILE} ${JAVA_CLASSES}\n  WORKING_DIRECTORY ${OBJDIR})\n\nadd_custom_target(java ALL DEPENDS ${JAR_FILE})\n\ninstall(FILES ${CMAKE_CURRENT_BINARY_DIR}/${JAR_FILE} DESTINATION classes)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/MANIFEST.MF",
    "content": "Manifest-Version: 1.0\nMain-Class: TJExample\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/Makefile.am",
    "content": "JAVAROOT = .\n\norg/libjpegturbo/turbojpeg/TJLoader.java: $(srcdir)/org/libjpegturbo/turbojpeg/TJLoader.java.tmpl\n\tmkdir -p org/libjpegturbo/turbojpeg; \\\n\tcat $(srcdir)/org/libjpegturbo/turbojpeg/TJLoader.java.tmpl | \\\n\t\tsed s@%{__libdir}@$(libdir)@g > org/libjpegturbo/turbojpeg/TJLoader.java\n\n\nJAVASOURCES = org/libjpegturbo/turbojpeg/TJ.java \\\n\torg/libjpegturbo/turbojpeg/TJCompressor.java \\\n\torg/libjpegturbo/turbojpeg/TJCustomFilter.java \\\n\torg/libjpegturbo/turbojpeg/TJDecompressor.java \\\n\torg/libjpegturbo/turbojpeg/TJException.java \\\n\torg/libjpegturbo/turbojpeg/TJScalingFactor.java \\\n\torg/libjpegturbo/turbojpeg/TJTransform.java \\\n\torg/libjpegturbo/turbojpeg/TJTransformer.java \\\n\torg/libjpegturbo/turbojpeg/YUVImage.java \\\n\tTJExample.java \\\n\tTJUnitTest.java \\\n\tTJBench.java\n\nJNIHEADERS = org_libjpegturbo_turbojpeg_TJ.h \\\n\torg_libjpegturbo_turbojpeg_TJCompressor.h \\\n\torg_libjpegturbo_turbojpeg_TJDecompressor.h \\\n\torg_libjpegturbo_turbojpeg_TJTransformer.h\n\nif WITH_JAVA\n\nnodist_noinst_JAVA = ${JAVASOURCES} org/libjpegturbo/turbojpeg/TJLoader.java\n\nJAVA_CLASSES = org/libjpegturbo/turbojpeg/TJ.class \\\n\torg/libjpegturbo/turbojpeg/TJCompressor.class \\\n\torg/libjpegturbo/turbojpeg/TJCustomFilter.class \\\n\torg/libjpegturbo/turbojpeg/TJDecompressor.class \\\n\torg/libjpegturbo/turbojpeg/TJException.class \\\n\torg/libjpegturbo/turbojpeg/TJLoader.class \\\n\torg/libjpegturbo/turbojpeg/TJScalingFactor.class \\\n\torg/libjpegturbo/turbojpeg/TJTransform.class \\\n\torg/libjpegturbo/turbojpeg/TJTransformer.class \\\n\torg/libjpegturbo/turbojpeg/YUVImage.class \\\n\tTJExample.class \\\n\tTJUnitTest.class \\\n\tTJBench.class\n\nall: all-am turbojpeg.jar\n\nturbojpeg.jar: classnoinst.stamp ${srcdir}/MANIFEST.MF\n\t$(JAR) cfm turbojpeg.jar ${srcdir}/MANIFEST.MF $(JAVA_CLASSES)\n\nclean-local:\n\trm -f turbojpeg.jar\n\ninstall-exec-local: turbojpeg.jar\n\tmkdir -p $(DESTDIR)/$(datadir)/classes\n\t$(INSTALL) -m 644 turbojpeg.jar $(DESTDIR)/$(datadir)/classes/\n\nuninstall-local:\n\trm -f $(DESTDIR)/$(datadir)/classes/turbojpeg.jar\n\tif [ -d $(DESTDIR)/$(datadir)/classes ]; then rmdir $(DESTDIR)/$(datadir)/classes; fi\n\nheaders: all\n\tjavah -d ${srcdir} org.libjpegturbo.turbojpeg.TJ; \\\n\tjavah -d ${srcdir} org.libjpegturbo.turbojpeg.TJCompressor; \\\n\tjavah -d ${srcdir} org.libjpegturbo.turbojpeg.TJDecompressor; \\\n\tjavah -d ${srcdir} org.libjpegturbo.turbojpeg.TJTransformer\n\ndocs: all\n\tmkdir -p ${srcdir}/doc; \\\n\tjavadoc -notimestamp -d ${srcdir}/doc -sourcepath ${srcdir} org.libjpegturbo.turbojpeg\n\nendif\n\nEXTRA_DIST = MANIFEST.MF ${JAVASOURCES} ${JNIHEADERS} doc CMakeLists.txt \\\n\torg/libjpegturbo/turbojpeg/TJLoader.java.tmpl \\\n\torg/libjpegturbo/turbojpeg/TJLoader.java.in\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/Makefile.in",
    "content": "# Makefile.in generated by automake 1.15 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2014 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\nVPATH = @srcdir@\nam__is_gnu_make = { \\\n  if test -z '$(MAKELEVEL)'; then \\\n    false; \\\n  elif test -n '$(MAKE_HOST)'; then \\\n    true; \\\n  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \\\n    true; \\\n  else \\\n    false; \\\n  fi; \\\n}\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nbuild_triplet = @build@\nhost_triplet = @host@\nsubdir = java\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \\\n\t$(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nDIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)\nmkinstalldirs = $(install_sh) -d\nCONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/jconfig.h \\\n\t$(top_builddir)/jconfigint.h\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nSOURCES =\nDIST_SOURCES =\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nCLASSPATH_ENV = CLASSPATH=$(JAVAROOT):$(srcdir)/$(JAVAROOT)$${CLASSPATH:+\":$$CLASSPATH\"}\nam__java_sources = $(nodist_noinst_JAVA)\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\nam__DIST_COMMON = $(srcdir)/Makefile.in README\nDISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nBUILD = @BUILD@\nCC = @CC@\nCCAS = @CCAS@\nCCASDEPMODE = @CCASDEPMODE@\nCCASFLAGS = @CCASFLAGS@\nCCDEPMODE = @CCDEPMODE@\nCFLAGS = @CFLAGS@\nCPP = @CPP@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEBARCH = @DEBARCH@\nDEFS = @DEFS@\nDEPDIR = @DEPDIR@\nDLLTOOL = @DLLTOOL@\nDSYMUTIL = @DSYMUTIL@\nDUMPBIN = @DUMPBIN@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEGREP = @EGREP@\nEXEEXT = @EXEEXT@\nFGREP = @FGREP@\nGREP = @GREP@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nJAR = @JAR@\nJAVA = @JAVA@\nJAVAC = @JAVAC@\nJAVACFLAGS = @JAVACFLAGS@\nJAVA_RPM_CONTENTS_1 = @JAVA_RPM_CONTENTS_1@\nJAVA_RPM_CONTENTS_2 = @JAVA_RPM_CONTENTS_2@\nJNI_CFLAGS = @JNI_CFLAGS@\nJPEG_LIB_VERSION = @JPEG_LIB_VERSION@\nJPEG_LIB_VERSION_DECIMAL = @JPEG_LIB_VERSION_DECIMAL@\nLD = @LD@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLIBTOOL = @LIBTOOL@\nLIBTOOL_CURRENT = @LIBTOOL_CURRENT@\nLIPO = @LIPO@\nLN_S = @LN_S@\nLTLIBOBJS = @LTLIBOBJS@\nLT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@\nMAKEINFO = @MAKEINFO@\nMANIFEST_TOOL = @MANIFEST_TOOL@\nMEM_SRCDST_FUNCTIONS = @MEM_SRCDST_FUNCTIONS@\nMKDIR_P = @MKDIR_P@\nNAFLAGS = @NAFLAGS@\nNASM = @NASM@\nNM = @NM@\nNMEDIT = @NMEDIT@\nOBJDUMP = @OBJDUMP@\nOBJEXT = @OBJEXT@\nOTOOL = @OTOOL@\nOTOOL64 = @OTOOL64@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nPKGNAME = @PKGNAME@\nPKG_CONFIG = @PKG_CONFIG@\nRANLIB = @RANLIB@\nRPMARCH = @RPMARCH@\nRPM_CONFIG_ARGS = @RPM_CONFIG_ARGS@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSO_AGE = @SO_AGE@\nSO_MAJOR_VERSION = @SO_MAJOR_VERSION@\nSO_MINOR_VERSION = @SO_MINOR_VERSION@\nSTRIP = @STRIP@\nVERSION = @VERSION@\nVERSION_SCRIPT_FLAG = @VERSION_SCRIPT_FLAG@\nWITH_JAVA = @WITH_JAVA@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_AR = @ac_ct_AR@\nac_ct_CC = @ac_ct_CC@\nac_ct_DUMPBIN = @ac_ct_DUMPBIN@\nam__include = @am__include@\nam__leading_dot = @am__leading_dot@\nam__quote = @am__quote@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild = @build@\nbuild_alias = @build_alias@\nbuild_cpu = @build_cpu@\nbuild_os = @build_os@\nbuild_vendor = @build_vendor@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost = @host@\nhost_alias = @host_alias@\nhost_cpu = @host_cpu@\nhost_os = @host_os@\nhost_vendor = @host_vendor@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nJAVAROOT = .\nJAVASOURCES = org/libjpegturbo/turbojpeg/TJ.java \\\n\torg/libjpegturbo/turbojpeg/TJCompressor.java \\\n\torg/libjpegturbo/turbojpeg/TJCustomFilter.java \\\n\torg/libjpegturbo/turbojpeg/TJDecompressor.java \\\n\torg/libjpegturbo/turbojpeg/TJException.java \\\n\torg/libjpegturbo/turbojpeg/TJScalingFactor.java \\\n\torg/libjpegturbo/turbojpeg/TJTransform.java \\\n\torg/libjpegturbo/turbojpeg/TJTransformer.java \\\n\torg/libjpegturbo/turbojpeg/YUVImage.java \\\n\tTJExample.java \\\n\tTJUnitTest.java \\\n\tTJBench.java\n\nJNIHEADERS = org_libjpegturbo_turbojpeg_TJ.h \\\n\torg_libjpegturbo_turbojpeg_TJCompressor.h \\\n\torg_libjpegturbo_turbojpeg_TJDecompressor.h \\\n\torg_libjpegturbo_turbojpeg_TJTransformer.h\n\n@WITH_JAVA_TRUE@nodist_noinst_JAVA = ${JAVASOURCES} org/libjpegturbo/turbojpeg/TJLoader.java\n@WITH_JAVA_TRUE@JAVA_CLASSES = org/libjpegturbo/turbojpeg/TJ.class \\\n@WITH_JAVA_TRUE@\torg/libjpegturbo/turbojpeg/TJCompressor.class \\\n@WITH_JAVA_TRUE@\torg/libjpegturbo/turbojpeg/TJCustomFilter.class \\\n@WITH_JAVA_TRUE@\torg/libjpegturbo/turbojpeg/TJDecompressor.class \\\n@WITH_JAVA_TRUE@\torg/libjpegturbo/turbojpeg/TJException.class \\\n@WITH_JAVA_TRUE@\torg/libjpegturbo/turbojpeg/TJLoader.class \\\n@WITH_JAVA_TRUE@\torg/libjpegturbo/turbojpeg/TJScalingFactor.class \\\n@WITH_JAVA_TRUE@\torg/libjpegturbo/turbojpeg/TJTransform.class \\\n@WITH_JAVA_TRUE@\torg/libjpegturbo/turbojpeg/TJTransformer.class \\\n@WITH_JAVA_TRUE@\torg/libjpegturbo/turbojpeg/YUVImage.class \\\n@WITH_JAVA_TRUE@\tTJExample.class \\\n@WITH_JAVA_TRUE@\tTJUnitTest.class \\\n@WITH_JAVA_TRUE@\tTJBench.class\n\nEXTRA_DIST = MANIFEST.MF ${JAVASOURCES} ${JNIHEADERS} doc CMakeLists.txt \\\n\torg/libjpegturbo/turbojpeg/TJLoader.java.tmpl \\\n\torg/libjpegturbo/turbojpeg/TJLoader.java.in\n\nall: all-am\n\n.SUFFIXES:\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign java/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign java/Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nmostlyclean-libtool:\n\t-rm -f *.lo\n\nclean-libtool:\n\t-rm -rf .libs _libs\n\nclassnoinst.stamp: $(am__java_sources)\n\t@list1='$?'; list2=; if test -n \"$$list1\"; then \\\n\t  for p in $$list1; do \\\n\t    if test -f $$p; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t    list2=\"$$list2 $$d$$p\"; \\\n\t  done; \\\n\t  echo '$(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) $(AM_JAVACFLAGS) $(JAVACFLAGS) '\"$$list2\"; \\\n\t  $(CLASSPATH_ENV) $(JAVAC) -d $(JAVAROOT) $(AM_JAVACFLAGS) $(JAVACFLAGS) $$list2; \\\n\telse :; fi\n\techo timestamp > $@\n\nclean-noinstJAVA:\n\t-rm -f *.class classnoinst.stamp\ntags TAGS:\n\nctags CTAGS:\n\ncscope cscopelist:\n\n\ndistdir: $(DISTFILES)\n\t@srcdirstrip=`echo \"$(srcdir)\" | sed 's/[].[^$$\\\\*]/\\\\\\\\&/g'`; \\\n\ttopsrcdirstrip=`echo \"$(top_srcdir)\" | sed 's/[].[^$$\\\\*]/\\\\\\\\&/g'`; \\\n\tlist='$(DISTFILES)'; \\\n\t  dist_files=`for file in $$list; do echo $$file; done | \\\n\t  sed -e \"s|^$$srcdirstrip/||;t\" \\\n\t      -e \"s|^$$topsrcdirstrip/|$(top_builddir)/|;t\"`; \\\n\tcase $$dist_files in \\\n\t  */*) $(MKDIR_P) `echo \"$$dist_files\" | \\\n\t\t\t   sed '/\\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \\\n\t\t\t   sort -u` ;; \\\n\tesac; \\\n\tfor file in $$dist_files; do \\\n\t  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n\t  if test -d $$d/$$file; then \\\n\t    dir=`echo \"/$$file\" | sed -e 's,/[^/]*$$,,'`; \\\n\t    if test -d \"$(distdir)/$$file\"; then \\\n\t      find \"$(distdir)/$$file\" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n\t    fi; \\\n\t    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n\t      cp -fpR $(srcdir)/$$file \"$(distdir)$$dir\" || exit 1; \\\n\t      find \"$(distdir)/$$file\" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n\t    fi; \\\n\t    cp -fpR $$d/$$file \"$(distdir)$$dir\" || exit 1; \\\n\t  else \\\n\t    test -f \"$(distdir)/$$file\" \\\n\t    || cp -p $$d/$$file \"$(distdir)/$$file\" \\\n\t    || exit 1; \\\n\t  fi; \\\n\tdone\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile classnoinst.stamp\ninstalldirs:\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\n@WITH_JAVA_FALSE@uninstall-local:\n@WITH_JAVA_FALSE@install-exec-local:\n@WITH_JAVA_FALSE@clean-local:\nclean: clean-am\n\nclean-am: clean-generic clean-libtool clean-local clean-noinstJAVA \\\n\tmostlyclean-am\n\ndistclean: distclean-am\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-generic\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am: install-exec-local\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-generic mostlyclean-libtool\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am: uninstall-local\n\n.MAKE: install-am install-strip\n\n.PHONY: all all-am check check-am clean clean-generic clean-libtool \\\n\tclean-local clean-noinstJAVA cscopelist-am ctags-am distclean \\\n\tdistclean-generic distclean-libtool distdir dvi dvi-am html \\\n\thtml-am info info-am install install-am install-data \\\n\tinstall-data-am install-dvi install-dvi-am install-exec \\\n\tinstall-exec-am install-exec-local install-html \\\n\tinstall-html-am install-info install-info-am install-man \\\n\tinstall-pdf install-pdf-am install-ps install-ps-am \\\n\tinstall-strip installcheck installcheck-am installdirs \\\n\tmaintainer-clean maintainer-clean-generic mostlyclean \\\n\tmostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \\\n\ttags-am uninstall uninstall-am uninstall-local\n\n.PRECIOUS: Makefile\n\n\norg/libjpegturbo/turbojpeg/TJLoader.java: $(srcdir)/org/libjpegturbo/turbojpeg/TJLoader.java.tmpl\n\tmkdir -p org/libjpegturbo/turbojpeg; \\\n\tcat $(srcdir)/org/libjpegturbo/turbojpeg/TJLoader.java.tmpl | \\\n\t\tsed s@%{__libdir}@$(libdir)@g > org/libjpegturbo/turbojpeg/TJLoader.java\n\n@WITH_JAVA_TRUE@all: all-am turbojpeg.jar\n\n@WITH_JAVA_TRUE@turbojpeg.jar: classnoinst.stamp ${srcdir}/MANIFEST.MF\n@WITH_JAVA_TRUE@\t$(JAR) cfm turbojpeg.jar ${srcdir}/MANIFEST.MF $(JAVA_CLASSES)\n\n@WITH_JAVA_TRUE@clean-local:\n@WITH_JAVA_TRUE@\trm -f turbojpeg.jar\n\n@WITH_JAVA_TRUE@install-exec-local: turbojpeg.jar\n@WITH_JAVA_TRUE@\tmkdir -p $(DESTDIR)/$(datadir)/classes\n@WITH_JAVA_TRUE@\t$(INSTALL) -m 644 turbojpeg.jar $(DESTDIR)/$(datadir)/classes/\n\n@WITH_JAVA_TRUE@uninstall-local:\n@WITH_JAVA_TRUE@\trm -f $(DESTDIR)/$(datadir)/classes/turbojpeg.jar\n@WITH_JAVA_TRUE@\tif [ -d $(DESTDIR)/$(datadir)/classes ]; then rmdir $(DESTDIR)/$(datadir)/classes; fi\n\n@WITH_JAVA_TRUE@headers: all\n@WITH_JAVA_TRUE@\tjavah -d ${srcdir} org.libjpegturbo.turbojpeg.TJ; \\\n@WITH_JAVA_TRUE@\tjavah -d ${srcdir} org.libjpegturbo.turbojpeg.TJCompressor; \\\n@WITH_JAVA_TRUE@\tjavah -d ${srcdir} org.libjpegturbo.turbojpeg.TJDecompressor; \\\n@WITH_JAVA_TRUE@\tjavah -d ${srcdir} org.libjpegturbo.turbojpeg.TJTransformer\n\n@WITH_JAVA_TRUE@docs: all\n@WITH_JAVA_TRUE@\tmkdir -p ${srcdir}/doc; \\\n@WITH_JAVA_TRUE@\tjavadoc -notimestamp -d ${srcdir}/doc -sourcepath ${srcdir} org.libjpegturbo.turbojpeg\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/README",
    "content": "TurboJPEG Java Wrapper\n======================\n\nThe TurboJPEG shared library can optionally be built with a Java Native\nInterface wrapper, which allows the library to be loaded and used directly from\nJava applications.  The Java front end for this is defined in several classes\nlocated under org/libjpegturbo/turbojpeg.  The source code for these Java\nclasses is licensed under a BSD-style license, so the files can be incorporated\ndirectly into both open source and proprietary projects without restriction.  A\nJava archive (JAR) file containing these classes is also shipped with the\n\"official\" distribution packages of libjpeg-turbo.\n\nTJExample.java, which should also be located in the same directory as this\nREADME file, demonstrates how to use the TurboJPEG Java API to compress and\ndecompress JPEG images in memory.\n\n\nPerformance Pitfalls\n--------------------\n\nThe TurboJPEG Java API defines several convenience methods that can allocate\nimage buffers or instantiate classes to hold the result of compress,\ndecompress, or transform operations.  However, if you use these methods, then\nbe mindful of the amount of new data you are creating on the heap.  It may be\nnecessary to manually invoke the garbage collector to prevent heap exhaustion\nor to prevent performance degradation.  Background garbage collection can kill\nperformance, particularly in a multi-threaded environment (Java pauses all\nthreads when the GC runs.)\n\nThe TurboJPEG Java API always gives you the option of pre-allocating your own\nsource and destination buffers, which allows you to re-use those buffers for\ncompressing/decompressing multiple images.  If the image sequence you are\ncompressing or decompressing consists of images of the same size, then\npre-allocating the buffers is recommended.\n\n\nInstallation Directory\n----------------------\n\nThe TurboJPEG Java Wrapper will look for the TurboJPEG JNI library\n(libturbojpeg.so, libturbojpeg.jnilib, or turbojpeg.dll) in the system library\npaths or in any paths specified in LD_LIBRARY_PATH (Un*x), DYLD_LIBRARY_PATH\n(Mac), or PATH (Windows.)  Failing this, on Un*x and Mac systems, the wrapper\nwill look for the JNI library under the library directory configured when\nlibjpeg-turbo was built.  If that library directory is\n/opt/libjpeg-turbo/lib32, then /opt/libjpeg-turbo/lib64 is also searched, and\nvice versa.\n\nIf you installed the JNI library into another directory, then you will need\nto pass an argument of -Djava.library.path={path_to_JNI_library} to java, or\nmanipulate LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, or PATH to include the directory\ncontaining the JNI library.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/TJBench.java",
    "content": "/*\n * Copyright (C)2009-2014, 2016 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport java.io.*;\nimport java.awt.image.*;\nimport javax.imageio.*;\nimport java.util.*;\nimport org.libjpegturbo.turbojpeg.*;\n\nclass TJBench {\n\n  static int flags = 0, quiet = 0, pf = TJ.PF_BGR, yuvpad = 1, warmup = 1;\n  static boolean compOnly, decompOnly, doTile, doYUV, write;\n\n  static final String[] pixFormatStr = {\n    \"RGB\", \"BGR\", \"RGBX\", \"BGRX\", \"XBGR\", \"XRGB\", \"GRAY\"\n  };\n\n  static final String[] subNameLong = {\n    \"4:4:4\", \"4:2:2\", \"4:2:0\", \"GRAY\", \"4:4:0\", \"4:1:1\"\n  };\n\n  static final String[] subName = {\n    \"444\", \"422\", \"420\", \"GRAY\", \"440\", \"411\"\n  };\n\n  static final String[] csName = {\n    \"RGB\", \"YCbCr\", \"GRAY\", \"CMYK\", \"YCCK\"\n  };\n\n  static TJScalingFactor sf;\n  static int xformOp = TJTransform.OP_NONE, xformOpt = 0;\n  static double benchTime = 5.0;\n\n\n  static final double getTime() {\n    return (double)System.nanoTime() / 1.0e9;\n  }\n\n\n  static String formatName(int subsamp, int cs) {\n    if (cs == TJ.CS_YCbCr)\n      return subNameLong[subsamp];\n    else if (cs == TJ.CS_YCCK)\n      return csName[cs] + \" \" + subNameLong[subsamp];\n    else\n      return csName[cs];\n  }\n\n\n  static String sigFig(double val, int figs) {\n    String format;\n    int digitsAfterDecimal = figs - (int)Math.ceil(Math.log10(Math.abs(val)));\n    if (digitsAfterDecimal < 1)\n      format = new String(\"%.0f\");\n    else\n      format = new String(\"%.\" + digitsAfterDecimal + \"f\");\n    return String.format(format, val);\n  }\n\n\n  static byte[] loadImage(String fileName, int[] w, int[] h, int pixelFormat)\n                          throws Exception {\n    BufferedImage img = ImageIO.read(new File(fileName));\n    if (img == null)\n      throw new Exception(\"Could not read \" + fileName);\n    w[0] = img.getWidth();\n    h[0] = img.getHeight();\n    int[] rgb = img.getRGB(0, 0, w[0], h[0], null, 0, w[0]);\n    int ps = TJ.getPixelSize(pixelFormat);\n    int rindex = TJ.getRedOffset(pixelFormat);\n    int gindex = TJ.getGreenOffset(pixelFormat);\n    int bindex = TJ.getBlueOffset(pixelFormat);\n    byte[] dstBuf = new byte[w[0] * h[0] * ps];\n    int pixels = w[0] * h[0], dstPtr = 0, rgbPtr = 0;\n    while (pixels-- > 0) {\n      dstBuf[dstPtr + rindex] = (byte)((rgb[rgbPtr] >> 16) & 0xff);\n      dstBuf[dstPtr + gindex] = (byte)((rgb[rgbPtr] >> 8) & 0xff);\n      dstBuf[dstPtr + bindex] = (byte)(rgb[rgbPtr] & 0xff);\n      dstPtr += ps;\n      rgbPtr++;\n    }\n    return dstBuf;\n  }\n\n\n  static void saveImage(String fileName, byte[] srcBuf, int w, int h,\n                        int pixelFormat) throws Exception {\n    BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);\n    int pixels = w * h, srcPtr = 0;\n    int ps = TJ.getPixelSize(pixelFormat);\n    int rindex = TJ.getRedOffset(pixelFormat);\n    int gindex = TJ.getGreenOffset(pixelFormat);\n    int bindex = TJ.getBlueOffset(pixelFormat);\n    for (int y = 0; y < h; y++) {\n      for (int x = 0; x < w; x++, srcPtr += ps) {\n        int pixel = (srcBuf[srcPtr + rindex] & 0xff) << 16 |\n                    (srcBuf[srcPtr + gindex] & 0xff) << 8 |\n                    (srcBuf[srcPtr + bindex] & 0xff);\n        img.setRGB(x, y, pixel);\n      }\n    }\n    ImageIO.write(img, \"bmp\", new File(fileName));\n  }\n\n\n  /* Decompression test */\n  static void decomp(byte[] srcBuf, byte[][] jpegBuf, int[] jpegSize,\n                     byte[] dstBuf, int w, int h, int subsamp, int jpegQual,\n                     String fileName, int tilew, int tileh) throws Exception {\n    String qualStr = new String(\"\"), sizeStr, tempStr;\n    TJDecompressor tjd;\n    double elapsed, elapsedDecode;\n    int ps = TJ.getPixelSize(pf), i, iter = 0;\n    int scaledw = sf.getScaled(w);\n    int scaledh = sf.getScaled(h);\n    int pitch = scaledw * ps;\n    YUVImage yuvImage = null;\n\n    if (jpegQual > 0)\n      qualStr = new String(\"_Q\" + jpegQual);\n\n    tjd = new TJDecompressor();\n\n    if (dstBuf == null)\n      dstBuf = new byte[pitch * scaledh];\n\n    /* Set the destination buffer to gray so we know whether the decompressor\n       attempted to write to it */\n    Arrays.fill(dstBuf, (byte)127);\n\n    if (doYUV) {\n      int width = doTile ? tilew : scaledw;\n      int height = doTile ? tileh : scaledh;\n      yuvImage = new YUVImage(width, yuvpad, height, subsamp);\n      Arrays.fill(yuvImage.getBuf(), (byte)127);\n    }\n\n    /* Benchmark */\n    iter -= warmup;\n    elapsed = elapsedDecode = 0.0;\n    while (true) {\n      int tile = 0;\n      double start = getTime();\n      for (int y = 0; y < h; y += tileh) {\n        for (int x = 0; x < w; x += tilew, tile++) {\n          int width = doTile ? Math.min(tilew, w - x) : scaledw;\n          int height = doTile ? Math.min(tileh, h - y) : scaledh;\n          tjd.setSourceImage(jpegBuf[tile], jpegSize[tile]);\n          if (doYUV) {\n            yuvImage.setBuf(yuvImage.getBuf(), width, yuvpad, height, subsamp);\n            tjd.decompressToYUV(yuvImage, flags);\n            double startDecode = getTime();\n            tjd.setSourceImage(yuvImage);\n            tjd.decompress(dstBuf, x, y, width, pitch, height, pf, flags);\n            if (iter >= 0)\n              elapsedDecode += getTime() - startDecode;\n          } else\n            tjd.decompress(dstBuf, x, y, width, pitch, height, pf, flags);\n        }\n      }\n      iter++;\n      if (iter >= 1) {\n        elapsed += getTime() - start;\n        if (elapsed >= benchTime)\n          break;\n      }\n    }\n    if(doYUV)\n      elapsed -= elapsedDecode;\n\n    tjd = null;\n    for (i = 0; i < jpegBuf.length; i++)\n      jpegBuf[i] = null;\n    jpegBuf = null;  jpegSize = null;\n    System.gc();\n\n    if (quiet != 0) {\n      System.out.format(\"%-6s%s\",\n        sigFig((double)(w * h) / 1000000. * (double)iter / elapsed, 4),\n        quiet == 2 ? \"\\n\" : \"  \");\n      if (doYUV)\n        System.out.format(\"%s\\n\",\n          sigFig((double)(w * h) / 1000000. * (double)iter / elapsedDecode, 4));\n      else if (quiet != 2)\n        System.out.print(\"\\n\");\n    } else {\n      System.out.format(\"%s --> Frame rate:         %f fps\\n\",\n                        (doYUV ? \"Decomp to YUV\":\"Decompress   \"),\n                        (double)iter / elapsed);\n      System.out.format(\"                  Throughput:         %f Megapixels/sec\\n\",\n                        (double)(w * h) / 1000000. * (double)iter / elapsed);\n      if (doYUV) {\n        System.out.format(\"YUV Decode    --> Frame rate:         %f fps\\n\",\n                          (double)iter / elapsedDecode);\n        System.out.format(\"                  Throughput:         %f Megapixels/sec\\n\",\n                          (double)(w * h) / 1000000. * (double)iter / elapsedDecode);\n      }\n    }\n\n    if (!write) return;\n\n    if (sf.getNum() != 1 || sf.getDenom() != 1)\n      sizeStr = new String(sf.getNum() + \"_\" + sf.getDenom());\n    else if (tilew != w || tileh != h)\n      sizeStr = new String(tilew + \"x\" + tileh);\n    else\n      sizeStr = new String(\"full\");\n    if (decompOnly)\n      tempStr = new String(fileName + \"_\" + sizeStr + \".bmp\");\n    else\n      tempStr = new String(fileName + \"_\" + subName[subsamp] + qualStr +\n                           \"_\" + sizeStr + \".bmp\");\n\n    saveImage(tempStr, dstBuf, scaledw, scaledh, pf);\n    int ndx = tempStr.lastIndexOf('.');\n    tempStr = new String(tempStr.substring(0, ndx) + \"-err.bmp\");\n    if (srcBuf != null && sf.getNum() == 1 && sf.getDenom() == 1) {\n      if (quiet == 0)\n        System.out.println(\"Compression error written to \" + tempStr + \".\");\n      if (subsamp == TJ.SAMP_GRAY) {\n        for (int y = 0, index = 0; y < h; y++, index += pitch) {\n          for (int x = 0, index2 = index; x < w; x++, index2 += ps) {\n            int rindex = index2 + TJ.getRedOffset(pf);\n            int gindex = index2 + TJ.getGreenOffset(pf);\n            int bindex = index2 + TJ.getBlueOffset(pf);\n            int lum = (int)((double)(srcBuf[rindex] & 0xff) * 0.299 +\n                            (double)(srcBuf[gindex] & 0xff) * 0.587 +\n                            (double)(srcBuf[bindex] & 0xff) * 0.114 + 0.5);\n            if (lum > 255) lum = 255;\n            if (lum < 0) lum = 0;\n            dstBuf[rindex] = (byte)Math.abs((dstBuf[rindex] & 0xff) - lum);\n            dstBuf[gindex] = (byte)Math.abs((dstBuf[gindex] & 0xff) - lum);\n            dstBuf[bindex] = (byte)Math.abs((dstBuf[bindex] & 0xff) - lum);\n          }\n        }\n      } else {\n        for (int y = 0; y < h; y++)\n          for (int x = 0; x < w * ps; x++)\n            dstBuf[pitch * y + x] =\n              (byte)Math.abs((dstBuf[pitch * y + x] & 0xff) -\n                             (srcBuf[pitch * y + x] & 0xff));\n      }\n      saveImage(tempStr, dstBuf, w, h, pf);\n    }\n  }\n\n\n  static void fullTest(byte[] srcBuf, int w, int h, int subsamp, int jpegQual,\n                       String fileName) throws Exception {\n    TJCompressor tjc;\n    byte[] tmpBuf;\n    byte[][] jpegBuf;\n    int[] jpegSize;\n    double start, elapsed, elapsedEncode;\n    int totalJpegSize = 0, tilew, tileh, i, iter;\n    int ps = TJ.getPixelSize(pf);\n    int ntilesw = 1, ntilesh = 1, pitch = w * ps;\n    String pfStr = pixFormatStr[pf];\n    YUVImage yuvImage = null;\n\n    tmpBuf = new byte[pitch * h];\n\n    if (quiet == 0)\n      System.out.format(\">>>>>  %s (%s) <--> JPEG %s Q%d  <<<<<\\n\", pfStr,\n        (flags & TJ.FLAG_BOTTOMUP) != 0 ? \"Bottom-up\" : \"Top-down\",\n        subNameLong[subsamp], jpegQual);\n\n    tjc = new TJCompressor();\n\n    for (tilew = doTile ? 8 : w, tileh = doTile ? 8 : h; ;\n         tilew *= 2, tileh *= 2) {\n      if (tilew > w)\n        tilew = w;\n      if (tileh > h)\n        tileh = h;\n      ntilesw = (w + tilew - 1) / tilew;\n      ntilesh = (h + tileh - 1) / tileh;\n\n      jpegBuf = new byte[ntilesw * ntilesh][TJ.bufSize(tilew, tileh, subsamp)];\n      jpegSize = new int[ntilesw * ntilesh];\n\n      /* Compression test */\n      if (quiet == 1)\n        System.out.format(\"%-4s (%s)  %-5s    %-3d   \", pfStr,\n                          (flags & TJ.FLAG_BOTTOMUP) != 0 ? \"BU\" : \"TD\",\n                          subNameLong[subsamp], jpegQual);\n      for (i = 0; i < h; i++)\n        System.arraycopy(srcBuf, w * ps * i, tmpBuf, pitch * i, w * ps);\n      tjc.setJPEGQuality(jpegQual);\n      tjc.setSubsamp(subsamp);\n\n      if (doYUV) {\n        yuvImage = new YUVImage(tilew, yuvpad, tileh, subsamp);\n        Arrays.fill(yuvImage.getBuf(), (byte)127);\n      }\n\n      /* Benchmark */\n      iter = -warmup;\n      elapsed = elapsedEncode = 0.0;\n      while (true) {\n        int tile = 0;\n        totalJpegSize = 0;\n        start = getTime();\n        for (int y = 0; y < h; y += tileh) {\n          for (int x = 0; x < w; x += tilew, tile++) {\n            int width = Math.min(tilew, w - x);\n            int height = Math.min(tileh, h - y);\n            tjc.setSourceImage(srcBuf, x, y, width, pitch, height, pf);\n            if (doYUV) {\n              double startEncode = getTime();\n              yuvImage.setBuf(yuvImage.getBuf(), width, yuvpad, height,\n                              subsamp);\n              tjc.encodeYUV(yuvImage, flags);\n              if (iter >= 0)\n                elapsedEncode += getTime() - startEncode;\n              tjc.setSourceImage(yuvImage);\n            }\n            tjc.compress(jpegBuf[tile], flags);\n            jpegSize[tile] = tjc.getCompressedSize();\n            totalJpegSize += jpegSize[tile];\n          }\n        }\n        iter++;\n        if (iter >= 1) {\n          elapsed += getTime() - start;\n          if (elapsed >= benchTime)\n            break;\n        }\n      }\n      if (doYUV)\n        elapsed -= elapsedEncode;\n\n      if (quiet == 1)\n        System.out.format(\"%-5d  %-5d   \", tilew, tileh);\n      if (quiet != 0) {\n        if (doYUV)\n          System.out.format(\"%-6s%s\",\n            sigFig((double)(w * h) / 1000000. * (double)iter / elapsedEncode, 4),\n            quiet == 2 ? \"\\n\" : \"  \");\n        System.out.format(\"%-6s%s\",\n          sigFig((double)(w * h) / 1000000. * (double)iter / elapsed, 4),\n          quiet == 2 ? \"\\n\" : \"  \");\n        System.out.format(\"%-6s%s\",\n          sigFig((double)(w * h * ps) / (double)totalJpegSize, 4),\n          quiet == 2 ? \"\\n\" : \"  \");\n      } else {\n        System.out.format(\"\\n%s size: %d x %d\\n\", doTile ? \"Tile\" : \"Image\",\n                          tilew, tileh);\n        if (doYUV) {\n          System.out.format(\"Encode YUV    --> Frame rate:         %f fps\\n\",\n                            (double)iter / elapsedEncode);\n          System.out.format(\"                  Output image size:  %d bytes\\n\",\n                            yuvImage.getSize());\n          System.out.format(\"                  Compression ratio:  %f:1\\n\",\n                            (double)(w * h * ps) / (double)yuvImage.getSize());\n          System.out.format(\"                  Throughput:         %f Megapixels/sec\\n\",\n                            (double)(w * h) / 1000000. * (double)iter / elapsedEncode);\n          System.out.format(\"                  Output bit stream:  %f Megabits/sec\\n\",\n            (double)yuvImage.getSize() * 8. / 1000000. * (double)iter / elapsedEncode);\n        }\n        System.out.format(\"%s --> Frame rate:         %f fps\\n\",\n                          doYUV ? \"Comp from YUV\" : \"Compress     \",\n                          (double)iter / elapsed);\n        System.out.format(\"                  Output image size:  %d bytes\\n\",\n                          totalJpegSize);\n        System.out.format(\"                  Compression ratio:  %f:1\\n\",\n                          (double)(w * h * ps) / (double)totalJpegSize);\n        System.out.format(\"                  Throughput:         %f Megapixels/sec\\n\",\n                          (double)(w * h) / 1000000. * (double)iter / elapsed);\n        System.out.format(\"                  Output bit stream:  %f Megabits/sec\\n\",\n          (double)totalJpegSize * 8. / 1000000. * (double)iter / elapsed);\n      }\n      if (tilew == w && tileh == h && write) {\n        String tempStr = fileName + \"_\" + subName[subsamp] + \"_\" + \"Q\" +\n                         jpegQual + \".jpg\";\n        FileOutputStream fos = new FileOutputStream(tempStr);\n        fos.write(jpegBuf[0], 0, jpegSize[0]);\n        fos.close();\n        if (quiet == 0)\n          System.out.println(\"Reference image written to \" + tempStr);\n      }\n\n      /* Decompression test */\n      if (!compOnly)\n        decomp(srcBuf, jpegBuf, jpegSize, tmpBuf, w, h, subsamp, jpegQual,\n               fileName, tilew, tileh);\n\n      if (tilew == w && tileh == h) break;\n    }\n  }\n\n\n  static void decompTest(String fileName) throws Exception {\n    TJTransformer tjt;\n    byte[][] jpegBuf = null;\n    byte[] srcBuf;\n    int[] jpegSize = null;\n    int totalJpegSize;\n    int w = 0, h = 0, subsamp = -1, cs = -1, _w, _h, _tilew, _tileh,\n      _ntilesw, _ntilesh, _subsamp, x, y, iter;\n    int ntilesw = 1, ntilesh = 1;\n    double start, elapsed;\n    int ps = TJ.getPixelSize(pf), tile;\n\n    FileInputStream fis = new FileInputStream(fileName);\n    int srcSize = (int)fis.getChannel().size();\n    srcBuf = new byte[srcSize];\n    fis.read(srcBuf, 0, srcSize);\n    fis.close();\n\n    int index = fileName.lastIndexOf('.');\n    if (index >= 0)\n      fileName = new String(fileName.substring(0, index));\n\n    tjt = new TJTransformer();\n\n    tjt.setSourceImage(srcBuf, srcSize);\n    w = tjt.getWidth();\n    h = tjt.getHeight();\n    subsamp = tjt.getSubsamp();\n    cs = tjt.getColorspace();\n\n    if (quiet == 1) {\n      System.out.println(\"All performance values in Mpixels/sec\\n\");\n      System.out.format(\"Bitmap     JPEG   JPEG     %s  %s   Xform   Comp    Decomp  \",\n                        (doTile ? \"Tile \" : \"Image\"),\n                        (doTile ? \"Tile \" : \"Image\"));\n      if (doYUV)\n        System.out.print(\"Decode\");\n      System.out.print(\"\\n\");\n      System.out.print(\"Format     CS     Subsamp  Width  Height  Perf    Ratio   Perf    \");\n      if (doYUV)\n        System.out.print(\"Perf\");\n      System.out.println(\"\\n\");\n    } else if (quiet == 0)\n      System.out.format(\">>>>>  JPEG %s --> %s (%s)  <<<<<\\n\",\n        formatName(subsamp, cs), pixFormatStr[pf],\n        (flags & TJ.FLAG_BOTTOMUP) != 0 ? \"Bottom-up\" : \"Top-down\");\n\n    for (int tilew = doTile ? 16 : w, tileh = doTile ? 16 : h; ;\n         tilew *= 2, tileh *= 2) {\n      if (tilew > w)\n        tilew = w;\n      if (tileh > h)\n        tileh = h;\n      ntilesw = (w + tilew - 1) / tilew;\n      ntilesh = (h + tileh - 1) / tileh;\n\n      _w = w;  _h = h;  _tilew = tilew;  _tileh = tileh;\n      if (quiet == 0) {\n        System.out.format(\"\\n%s size: %d x %d\", (doTile ? \"Tile\" : \"Image\"),\n                          _tilew, _tileh);\n        if (sf.getNum() != 1 || sf.getDenom() != 1)\n          System.out.format(\" --> %d x %d\", sf.getScaled(_w),\n                            sf.getScaled(_h));\n        System.out.println(\"\");\n      } else if (quiet == 1) {\n        System.out.format(\"%-4s (%s)  %-5s  %-5s    \", pixFormatStr[pf],\n                          (flags & TJ.FLAG_BOTTOMUP) != 0 ? \"BU\" : \"TD\",\n                          csName[cs], subNameLong[subsamp]);\n        System.out.format(\"%-5d  %-5d   \", tilew, tileh);\n      }\n\n      _subsamp = subsamp;\n      if (doTile || xformOp != TJTransform.OP_NONE || xformOpt != 0) {\n        if (xformOp == TJTransform.OP_TRANSPOSE ||\n            xformOp == TJTransform.OP_TRANSVERSE ||\n            xformOp == TJTransform.OP_ROT90 ||\n            xformOp == TJTransform.OP_ROT270) {\n          _w = h;  _h = w;  _tilew = tileh;  _tileh = tilew;\n        }\n\n        if ((xformOpt & TJTransform.OPT_GRAY) != 0)\n          _subsamp = TJ.SAMP_GRAY;\n        if (xformOp == TJTransform.OP_HFLIP ||\n            xformOp == TJTransform.OP_ROT180)\n          _w = _w - (_w % TJ.getMCUWidth(_subsamp));\n        if (xformOp == TJTransform.OP_VFLIP ||\n            xformOp == TJTransform.OP_ROT180)\n          _h = _h - (_h % TJ.getMCUHeight(_subsamp));\n        if (xformOp == TJTransform.OP_TRANSVERSE ||\n            xformOp == TJTransform.OP_ROT90)\n          _w = _w - (_w % TJ.getMCUHeight(_subsamp));\n        if (xformOp == TJTransform.OP_TRANSVERSE ||\n            xformOp == TJTransform.OP_ROT270)\n          _h = _h - (_h % TJ.getMCUWidth(_subsamp));\n        _ntilesw = (_w + _tilew - 1) / _tilew;\n        _ntilesh = (_h + _tileh - 1) / _tileh;\n\n        if (xformOp == TJTransform.OP_TRANSPOSE ||\n            xformOp == TJTransform.OP_TRANSVERSE ||\n            xformOp == TJTransform.OP_ROT90 ||\n            xformOp == TJTransform.OP_ROT270) {\n            if (_subsamp == TJ.SAMP_422)\n              _subsamp = TJ.SAMP_440;\n            else if (_subsamp == TJ.SAMP_440)\n              _subsamp = TJ.SAMP_422;\n        }\n\n        TJTransform[] t = new TJTransform[_ntilesw * _ntilesh];\n        jpegBuf = new byte[_ntilesw * _ntilesh][TJ.bufSize(_tilew, _tileh, subsamp)];\n\n        for (y = 0, tile = 0; y < _h; y += _tileh) {\n          for (x = 0; x < _w; x += _tilew, tile++) {\n            t[tile] = new TJTransform();\n            t[tile].width = Math.min(_tilew, _w - x);\n            t[tile].height = Math.min(_tileh, _h - y);\n            t[tile].x = x;\n            t[tile].y = y;\n            t[tile].op = xformOp;\n            t[tile].options = xformOpt | TJTransform.OPT_TRIM;\n            if ((t[tile].options & TJTransform.OPT_NOOUTPUT) != 0 &&\n                jpegBuf[tile] != null)\n              jpegBuf[tile] = null;\n          }\n        }\n\n        iter = -warmup;\n        elapsed = 0.;\n        while (true) {\n          start = getTime();\n          tjt.transform(jpegBuf, t, flags);\n          jpegSize = tjt.getTransformedSizes();\n          iter++;\n          if (iter >= 1) {\n            elapsed += getTime() - start;\n            if (elapsed >= benchTime)\n              break;\n          }\n        }\n        t = null;\n\n        for (tile = 0, totalJpegSize = 0; tile < _ntilesw * _ntilesh; tile++)\n          totalJpegSize += jpegSize[tile];\n\n        if (quiet != 0) {\n          System.out.format(\"%-6s%s%-6s%s\",\n            sigFig((double)(w * h) / 1000000. / elapsed, 4),\n            quiet == 2 ? \"\\n\" : \"  \",\n            sigFig((double)(w * h * ps) / (double)totalJpegSize, 4),\n            quiet == 2 ? \"\\n\" : \"  \");\n        } else if (quiet == 0) {\n          System.out.format(\"Transform     --> Frame rate:         %f fps\\n\",\n                            1.0 / elapsed);\n          System.out.format(\"                  Output image size:  %d bytes\\n\",\n                            totalJpegSize);\n          System.out.format(\"                  Compression ratio:  %f:1\\n\",\n                            (double)(w * h * ps) / (double)totalJpegSize);\n          System.out.format(\"                  Throughput:         %f Megapixels/sec\\n\",\n                            (double)(w * h) / 1000000. / elapsed);\n          System.out.format(\"                  Output bit stream:  %f Megabits/sec\\n\",\n                            (double)totalJpegSize * 8. / 1000000. / elapsed);\n        }\n      } else {\n        if (quiet == 1)\n          System.out.print(\"N/A     N/A     \");\n        jpegBuf = new byte[1][TJ.bufSize(_tilew, _tileh, subsamp)];\n        jpegSize = new int[1];\n        jpegSize[0] = srcSize;\n        System.arraycopy(srcBuf, 0, jpegBuf[0], 0, srcSize);\n      }\n\n      if (w == tilew)\n        _tilew = _w;\n      if (h == tileh)\n        _tileh = _h;\n      if ((xformOpt & TJTransform.OPT_NOOUTPUT) == 0)\n        decomp(null, jpegBuf, jpegSize, null, _w, _h, _subsamp, 0,\n               fileName, _tilew, _tileh);\n      else if (quiet == 1)\n        System.out.println(\"N/A\");\n\n      jpegBuf = null;\n      jpegSize = null;\n\n      if (tilew == w && tileh == h) break;\n    }\n  }\n\n\n  static void usage() throws Exception {\n    int i;\n    TJScalingFactor[] scalingFactors = TJ.getScalingFactors();\n    int nsf = scalingFactors.length;\n    String className = new TJBench().getClass().getName();\n\n    System.out.println(\"\\nUSAGE: java \" + className);\n    System.out.println(\"       <Inputfile (BMP)> <Quality> [options]\\n\");\n    System.out.println(\"       java \" + className);\n    System.out.println(\"       <Inputfile (JPG)> [options]\\n\");\n    System.out.println(\"Options:\\n\");\n    System.out.println(\"-alloc = Dynamically allocate JPEG image buffers\");\n    System.out.println(\"-bottomup = Test bottom-up compression/decompression\");\n    System.out.println(\"-tile = Test performance of the codec when the image is encoded as separate\");\n    System.out.println(\"     tiles of varying sizes.\");\n    System.out.println(\"-rgb, -bgr, -rgbx, -bgrx, -xbgr, -xrgb =\");\n    System.out.println(\"     Test the specified color conversion path in the codec (default = BGR)\");\n    System.out.println(\"-fastupsample = Use the fastest chrominance upsampling algorithm available in\");\n    System.out.println(\"     the underlying codec\");\n    System.out.println(\"-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying\");\n    System.out.println(\"     codec\");\n    System.out.println(\"-accuratedct = Use the most accurate DCT/IDCT algorithms available in the\");\n    System.out.println(\"     underlying codec\");\n    System.out.println(\"-subsamp <s> = When testing JPEG compression, this option specifies the level\");\n    System.out.println(\"     of chrominance subsampling to use (<s> = 444, 422, 440, 420, 411, or\");\n    System.out.println(\"     GRAY).  The default is to test Grayscale, 4:2:0, 4:2:2, and 4:4:4 in\");\n    System.out.println(\"     sequence.\");\n    System.out.println(\"-quiet = Output results in tabular rather than verbose format\");\n    System.out.println(\"-yuv = Test YUV encoding/decoding functions\");\n    System.out.println(\"-yuvpad <p> = If testing YUV encoding/decoding, this specifies the number of\");\n    System.out.println(\"     bytes to which each row of each plane in the intermediate YUV image is\");\n    System.out.println(\"     padded (default = 1)\");\n    System.out.println(\"-scale M/N = Scale down the width/height of the decompressed JPEG image by a\");\n    System.out.print  (\"     factor of M/N (M/N = \");\n    for (i = 0; i < nsf; i++) {\n      System.out.format(\"%d/%d\", scalingFactors[i].getNum(),\n                        scalingFactors[i].getDenom());\n      if (nsf == 2 && i != nsf - 1)\n        System.out.print(\" or \");\n      else if (nsf > 2) {\n        if (i != nsf - 1)\n          System.out.print(\", \");\n        if (i == nsf - 2)\n          System.out.print(\"or \");\n      }\n      if (i % 8 == 0 && i != 0)\n        System.out.print(\"\\n     \");\n    }\n    System.out.println(\")\");\n    System.out.println(\"-hflip, -vflip, -transpose, -transverse, -rot90, -rot180, -rot270 =\");\n    System.out.println(\"     Perform the corresponding lossless transform prior to\");\n    System.out.println(\"     decompression (these options are mutually exclusive)\");\n    System.out.println(\"-grayscale = Perform lossless grayscale conversion prior to decompression\");\n    System.out.println(\"     test (can be combined with the other transforms above)\");\n    System.out.println(\"-benchtime <t> = Run each benchmark for at least <t> seconds (default = 5.0)\");\n    System.out.println(\"-warmup <w> = Execute each benchmark <w> times to prime the cache before\");\n    System.out.println(\"     taking performance measurements (default = 1)\");\n    System.out.println(\"-componly = Stop after running compression tests.  Do not test decompression.\");\n    System.out.println(\"-nowrite = Do not write reference or output images (improves consistency\");\n    System.out.println(\"     of performance measurements.)\\n\");\n    System.out.println(\"NOTE:  If the quality is specified as a range (e.g. 90-100), a separate\");\n    System.out.println(\"test will be performed for all quality values in the range.\\n\");\n    System.exit(1);\n  }\n\n\n  public static void main(String[] argv) {\n    byte[] srcBuf = null;  int w = 0, h = 0;\n    int minQual = -1, maxQual = -1;\n    int minArg = 1;  int retval = 0;\n    int subsamp = -1;\n\n    try {\n\n      if (argv.length < minArg)\n        usage();\n\n      String tempStr = argv[0].toLowerCase();\n      if (tempStr.endsWith(\".jpg\") || tempStr.endsWith(\".jpeg\"))\n        decompOnly = true;\n\n      System.out.println(\"\");\n\n      if (!decompOnly) {\n        minArg = 2;\n        if (argv.length < minArg)\n          usage();\n        try {\n          minQual = Integer.parseInt(argv[1]);\n        } catch (NumberFormatException e) {}\n        if (minQual < 1 || minQual > 100)\n          throw new Exception(\"Quality must be between 1 and 100.\");\n        int dashIndex = argv[1].indexOf('-');\n        if (dashIndex > 0 && argv[1].length() > dashIndex + 1) {\n          try {\n            maxQual = Integer.parseInt(argv[1].substring(dashIndex + 1));\n          } catch (NumberFormatException e) {}\n        }\n        if (maxQual < 1 || maxQual > 100)\n          maxQual = minQual;\n      }\n\n      if (argv.length > minArg) {\n        for (int i = minArg; i < argv.length; i++) {\n          if (argv[i].equalsIgnoreCase(\"-tile\")) {\n            doTile = true;  xformOpt |= TJTransform.OPT_CROP;\n          }\n          if (argv[i].equalsIgnoreCase(\"-fastupsample\")) {\n            System.out.println(\"Using fast upsampling code\\n\");\n            flags |= TJ.FLAG_FASTUPSAMPLE;\n          }\n          if (argv[i].equalsIgnoreCase(\"-fastdct\")) {\n            System.out.println(\"Using fastest DCT/IDCT algorithm\\n\");\n            flags |= TJ.FLAG_FASTDCT;\n          }\n          if (argv[i].equalsIgnoreCase(\"-accuratedct\")) {\n            System.out.println(\"Using most accurate DCT/IDCT algorithm\\n\");\n            flags |= TJ.FLAG_ACCURATEDCT;\n          }\n          if (argv[i].equalsIgnoreCase(\"-rgb\"))\n            pf = TJ.PF_RGB;\n          if (argv[i].equalsIgnoreCase(\"-rgbx\"))\n            pf = TJ.PF_RGBX;\n          if (argv[i].equalsIgnoreCase(\"-bgr\"))\n            pf = TJ.PF_BGR;\n          if (argv[i].equalsIgnoreCase(\"-bgrx\"))\n            pf = TJ.PF_BGRX;\n          if (argv[i].equalsIgnoreCase(\"-xbgr\"))\n            pf = TJ.PF_XBGR;\n          if (argv[i].equalsIgnoreCase(\"-xrgb\"))\n            pf = TJ.PF_XRGB;\n          if (argv[i].equalsIgnoreCase(\"-bottomup\"))\n            flags |= TJ.FLAG_BOTTOMUP;\n          if (argv[i].equalsIgnoreCase(\"-quiet\"))\n            quiet = 1;\n          if (argv[i].equalsIgnoreCase(\"-qq\"))\n            quiet = 2;\n          if (argv[i].equalsIgnoreCase(\"-scale\") && i < argv.length - 1) {\n            int temp1 = 0, temp2 = 0;\n            boolean match = false, scanned = true;\n            Scanner scanner = new Scanner(argv[++i]).useDelimiter(\"/\");\n            try {\n              temp1 = scanner.nextInt();\n              temp2 = scanner.nextInt();\n            } catch(Exception e) {}\n            if (temp2 <= 0) temp2 = 1;\n            if (temp1 > 0) {\n              TJScalingFactor[] scalingFactors = TJ.getScalingFactors();\n              for (int j = 0; j < scalingFactors.length; j++) {\n                if ((double)temp1 / (double)temp2 ==\n                    (double)scalingFactors[j].getNum() /\n                    (double)scalingFactors[j].getDenom()) {\n                  sf = scalingFactors[j];\n                  match = true;   break;\n                }\n              }\n              if (!match) usage();\n            } else\n              usage();\n          }\n          if (argv[i].equalsIgnoreCase(\"-hflip\"))\n            xformOp = TJTransform.OP_HFLIP;\n          if (argv[i].equalsIgnoreCase(\"-vflip\"))\n            xformOp = TJTransform.OP_VFLIP;\n          if (argv[i].equalsIgnoreCase(\"-transpose\"))\n            xformOp = TJTransform.OP_TRANSPOSE;\n          if (argv[i].equalsIgnoreCase(\"-transverse\"))\n            xformOp = TJTransform.OP_TRANSVERSE;\n          if (argv[i].equalsIgnoreCase(\"-rot90\"))\n            xformOp = TJTransform.OP_ROT90;\n          if (argv[i].equalsIgnoreCase(\"-rot180\"))\n            xformOp = TJTransform.OP_ROT180;\n          if (argv[i].equalsIgnoreCase(\"-rot270\"))\n            xformOp = TJTransform.OP_ROT270;\n          if (argv[i].equalsIgnoreCase(\"-grayscale\"))\n            xformOpt |= TJTransform.OPT_GRAY;\n          if (argv[i].equalsIgnoreCase(\"-nooutput\"))\n            xformOpt |= TJTransform.OPT_NOOUTPUT;\n          if (argv[i].equalsIgnoreCase(\"-benchtime\") && i < argv.length - 1) {\n            double temp = -1;\n            try {\n              temp = Double.parseDouble(argv[++i]);\n            } catch (NumberFormatException e) {}\n            if (temp > 0.0)\n              benchTime = temp;\n            else\n              usage();\n          }\n          if (argv[i].equalsIgnoreCase(\"-yuv\")) {\n            System.out.println(\"Testing YUV planar encoding/decoding\\n\");\n            doYUV = true;\n          }\n          if (argv[i].equalsIgnoreCase(\"-yuvpad\") && i < argv.length - 1) {\n            int temp = 0;\n            try {\n             temp = Integer.parseInt(argv[++i]);\n            } catch (NumberFormatException e) {}\n            if (temp >= 1)\n              yuvpad = temp;\n          }\n          if (argv[i].equalsIgnoreCase(\"-subsamp\") && i < argv.length - 1) {\n            i++;\n            if (argv[i].toUpperCase().startsWith(\"G\"))\n              subsamp = TJ.SAMP_GRAY;\n            else if (argv[i].equals(\"444\"))\n              subsamp = TJ.SAMP_444;\n            else if (argv[i].equals(\"422\"))\n              subsamp = TJ.SAMP_422;\n            else if (argv[i].equals(\"440\"))\n              subsamp = TJ.SAMP_440;\n            else if (argv[i].equals(\"420\"))\n              subsamp = TJ.SAMP_420;\n            else if (argv[i].equals(\"411\"))\n              subsamp = TJ.SAMP_411;\n          }\n          if (argv[i].equalsIgnoreCase(\"-componly\"))\n            compOnly = true;\n          if (argv[i].equalsIgnoreCase(\"-nowrite\"))\n            write = false;\n          if (argv[i].equalsIgnoreCase(\"-warmup\") && i < argv.length - 1) {\n            int temp = -1;\n            try {\n             temp = Integer.parseInt(argv[++i]);\n            } catch (NumberFormatException e) {}\n            if (temp >= 0) {\n              warmup = temp;\n              System.out.format(\"Warmup runs = %d\\n\\n\", warmup);\n            }\n          }\n          if (argv[i].equalsIgnoreCase(\"-?\"))\n            usage();\n        }\n      }\n\n      if (sf == null)\n        sf = new TJScalingFactor(1, 1);\n\n      if ((sf.getNum() != 1 || sf.getDenom() != 1) && doTile) {\n        System.out.println(\"Disabling tiled compression/decompression tests, because those tests do not\");\n        System.out.println(\"work when scaled decompression is enabled.\");\n        doTile = false;\n      }\n\n      if (!decompOnly) {\n        int[] width = new int[1], height = new int[1];\n        srcBuf = loadImage(argv[0], width, height, pf);\n        w = width[0];  h = height[0];\n        int index = -1;\n        if ((index = argv[0].lastIndexOf('.')) >= 0)\n          argv[0] = argv[0].substring(0, index);\n      }\n\n      if (quiet == 1 && !decompOnly) {\n        System.out.println(\"All performance values in Mpixels/sec\\n\");\n        System.out.format(\"Bitmap     JPEG     JPEG  %s  %s   \",\n          (doTile ? \"Tile \" : \"Image\"), (doTile ? \"Tile \" : \"Image\"));\n        if (doYUV)\n          System.out.print(\"Encode  \");\n        System.out.print(\"Comp    Comp    Decomp  \");\n        if (doYUV)\n          System.out.print(\"Decode\");\n        System.out.print(\"\\n\");\n        System.out.print(\"Format     Subsamp  Qual  Width  Height  \");\n        if (doYUV)\n          System.out.print(\"Perf    \");\n        System.out.print(\"Perf    Ratio   Perf    \");\n        if (doYUV)\n          System.out.print(\"Perf\");\n        System.out.println(\"\\n\");\n      }\n\n      if (decompOnly) {\n        decompTest(argv[0]);\n        System.out.println(\"\");\n        System.exit(retval);\n      }\n\n      System.gc();\n      if (subsamp >= 0 && subsamp < TJ.NUMSAMP) {\n        for (int i = maxQual; i >= minQual; i--)\n          fullTest(srcBuf, w, h, subsamp, i, argv[0]);\n        System.out.println(\"\");\n      } else {\n        for (int i = maxQual; i >= minQual; i--)\n          fullTest(srcBuf, w, h, TJ.SAMP_GRAY, i, argv[0]);\n        System.out.println(\"\");\n        System.gc();\n        for (int i = maxQual; i >= minQual; i--)\n          fullTest(srcBuf, w, h, TJ.SAMP_420, i, argv[0]);\n        System.out.println(\"\");\n        System.gc();\n        for (int i = maxQual; i >= minQual; i--)\n          fullTest(srcBuf, w, h, TJ.SAMP_422, i, argv[0]);\n        System.out.println(\"\");\n        System.gc();\n        for (int i = maxQual; i >= minQual; i--)\n          fullTest(srcBuf, w, h, TJ.SAMP_444, i, argv[0]);\n        System.out.println(\"\");\n      }\n\n    } catch (Exception e) {\n      System.out.println(\"ERROR: \" + e.getMessage());\n      e.printStackTrace();\n      retval = -1;\n    }\n\n    System.exit(retval);\n  }\n\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/TJExample.java",
    "content": "/*\n * Copyright (C)2011-2012, 2014-2015 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * This program demonstrates how to compress and decompress JPEG files using\n * the TurboJPEG JNI wrapper\n */\n\nimport java.io.*;\nimport java.awt.*;\nimport java.awt.image.*;\nimport java.nio.*;\nimport javax.imageio.*;\nimport javax.swing.*;\nimport org.libjpegturbo.turbojpeg.*;\n\npublic class TJExample implements TJCustomFilter {\n\n  public static final String classname = new TJExample().getClass().getName();\n\n  private static void usage() throws Exception {\n    System.out.println(\"\\nUSAGE: java \" + classname + \" <Input file> <Output file> [options]\\n\");\n    System.out.println(\"Input and output files can be any image format that the Java Image I/O\");\n    System.out.println(\"extensions understand.  If either filename ends in a .jpg extension, then\");\n    System.out.println(\"TurboJPEG will be used to compress or decompress the file.\\n\");\n    System.out.println(\"Options:\\n\");\n    System.out.println(\"-scale M/N = if the input image is a JPEG file, scale the width/height of the\");\n    System.out.print(\"             output image by a factor of M/N (M/N = \");\n    for (int i = 0; i < sf.length; i++) {\n      System.out.print(sf[i].getNum() + \"/\" + sf[i].getDenom());\n      if (sf.length == 2 && i != sf.length - 1)\n        System.out.print(\" or \");\n      else if (sf.length > 2) {\n        if (i != sf.length - 1)\n          System.out.print(\", \");\n        if (i == sf.length - 2)\n          System.out.print(\"or \");\n      }\n    }\n    System.out.println(\")\\n\");\n    System.out.println(\"-samp <444|422|420|gray> = If the output image is a JPEG file, this specifies\");\n    System.out.println(\"                           the level of chrominance subsampling to use when\");\n    System.out.println(\"                           recompressing it.  Default is to use the same level\");\n    System.out.println(\"                           of subsampling as the input, if the input is a JPEG\");\n    System.out.println(\"                           file, or 4:4:4 otherwise.\\n\");\n    System.out.println(\"-q <1-100> = If the output image is a JPEG file, this specifies the JPEG\");\n    System.out.println(\"             quality to use when recompressing it (default = 95).\\n\");\n    System.out.println(\"-hflip, -vflip, -transpose, -transverse, -rot90, -rot180, -rot270 =\");\n    System.out.println(\"     If the input image is a JPEG file, perform the corresponding lossless\");\n    System.out.println(\"     transform prior to decompression (these options are mutually exclusive)\\n\");\n    System.out.println(\"-grayscale = If the input image is a JPEG file, perform lossless grayscale\");\n    System.out.println(\"     conversion prior to decompression (can be combined with the other\");\n    System.out.println(\"     transforms above)\\n\");\n    System.out.println(\"-crop X,Y,WxH = If the input image is a JPEG file, perform lossless cropping\");\n    System.out.println(\"     prior to decompression.  X,Y specifies the upper left corner of the\");\n    System.out.println(\"     cropping region, and WxH specifies its width and height.  X,Y must be\");\n    System.out.println(\"     evenly divible by the MCU block size (8x8 if the source image was\");\n    System.out.println(\"     compressed using no subsampling or grayscale, or 16x8 for 4:2:2 or 16x16\");\n    System.out.println(\"     for 4:2:0.)\\n\");\n    System.out.println(\"-display = Display output image (Output file need not be specified in this\");\n    System.out.println(\"     case.)\\n\");\n    System.out.println(\"-fastupsample = Use the fastest chrominance upsampling algorithm available in\");\n    System.out.println(\"     the underlying codec\\n\");\n    System.out.println(\"-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying\");\n    System.out.println(\"     codec\\n\");\n    System.out.println(\"-accuratedct = Use the most accurate DCT/IDCT algorithms available in the\");\n    System.out.println(\"     underlying codec\\n\");\n    System.exit(1);\n  }\n\n  private static final String[] sampName = {\n    \"4:4:4\", \"4:2:2\", \"4:2:0\", \"Grayscale\", \"4:4:0\"\n  };\n\n  public static void main(String[] argv) {\n\n    BufferedImage img = null;\n    byte[] bmpBuf = null;\n    TJTransform xform = new TJTransform();\n    int flags = 0;\n\n    try {\n\n      sf = TJ.getScalingFactors();\n\n      if (argv.length < 2) {\n        usage();\n      }\n\n      TJScalingFactor scaleFactor = new TJScalingFactor(1, 1);\n      String inFormat = \"jpg\", outFormat = \"jpg\";\n      int outSubsamp = -1, outQual = 95;\n      boolean display = false;\n\n      if (argv.length > 1) {\n        for (int i = 1; i < argv.length; i++) {\n          if (argv[i].length() < 2)\n            continue;\n          if (argv[i].length() > 2 &&\n              argv[i].substring(0, 3).equalsIgnoreCase(\"-sc\")) {\n            int match = 0;\n            if (i < argv.length - 1) {\n              String[] scaleArg = argv[++i].split(\"/\");\n              if (scaleArg.length == 2) {\n                TJScalingFactor tempsf =\n                  new TJScalingFactor(Integer.parseInt(scaleArg[0]),\n                                      Integer.parseInt(scaleArg[1]));\n                for (int j = 0; j < sf.length; j++) {\n                  if (tempsf.equals(sf[j])) {\n                    scaleFactor = sf[j];\n                    match = 1;\n                    break;\n                  }\n                }\n              }\n            }\n            if (match != 1) usage();\n          }\n          if (argv[i].equalsIgnoreCase(\"-h\") || argv[i].equalsIgnoreCase(\"-?\"))\n            usage();\n          if (argv[i].length() > 2 &&\n              argv[i].substring(0, 3).equalsIgnoreCase(\"-sa\")) {\n            if (i < argv.length - 1) {\n              i++;\n              if (argv[i].substring(0, 1).equalsIgnoreCase(\"g\"))\n                outSubsamp = TJ.SAMP_GRAY;\n              else if (argv[i].equals(\"444\"))\n                outSubsamp = TJ.SAMP_444;\n              else if (argv[i].equals(\"422\"))\n                outSubsamp = TJ.SAMP_422;\n              else if (argv[i].equals(\"420\"))\n                outSubsamp = TJ.SAMP_420;\n              else\n                usage();\n            } else\n              usage();\n          }\n          if (argv[i].substring(0, 2).equalsIgnoreCase(\"-q\")) {\n            if (i < argv.length - 1) {\n              int qual = Integer.parseInt(argv[++i]);\n              if (qual >= 1 && qual <= 100)\n                outQual = qual;\n              else\n                usage();\n            } else\n              usage();\n          }\n          if (argv[i].substring(0, 2).equalsIgnoreCase(\"-g\"))\n            xform.options |= TJTransform.OPT_GRAY;\n          if (argv[i].equalsIgnoreCase(\"-hflip\"))\n            xform.op = TJTransform.OP_HFLIP;\n          if (argv[i].equalsIgnoreCase(\"-vflip\"))\n            xform.op = TJTransform.OP_VFLIP;\n          if (argv[i].equalsIgnoreCase(\"-transpose\"))\n            xform.op = TJTransform.OP_TRANSPOSE;\n          if (argv[i].equalsIgnoreCase(\"-transverse\"))\n            xform.op = TJTransform.OP_TRANSVERSE;\n          if (argv[i].equalsIgnoreCase(\"-rot90\"))\n            xform.op = TJTransform.OP_ROT90;\n          if (argv[i].equalsIgnoreCase(\"-rot180\"))\n            xform.op = TJTransform.OP_ROT180;\n          if (argv[i].equalsIgnoreCase(\"-rot270\"))\n            xform.op = TJTransform.OP_ROT270;\n          if (argv[i].equalsIgnoreCase(\"-custom\"))\n            xform.cf = new TJExample();\n          else if (argv[i].length() > 2 &&\n                   argv[i].substring(0, 2).equalsIgnoreCase(\"-c\")) {\n            if (i >= argv.length - 1)\n              usage();\n            String[] cropArg = argv[++i].split(\",\");\n            if (cropArg.length != 3)\n              usage();\n            String[] dimArg = cropArg[2].split(\"[xX]\");\n            if (dimArg.length != 2)\n              usage();\n            int tempx = Integer.parseInt(cropArg[0]);\n            int tempy = Integer.parseInt(cropArg[1]);\n            int tempw = Integer.parseInt(dimArg[0]);\n            int temph = Integer.parseInt(dimArg[1]);\n            if (tempx < 0 || tempy < 0 || tempw < 0 || temph < 0)\n              usage();\n            xform.x = tempx;\n            xform.y = tempy;\n            xform.width = tempw;\n            xform.height = temph;\n            xform.options |= TJTransform.OPT_CROP;\n          }\n          if (argv[i].substring(0, 2).equalsIgnoreCase(\"-d\"))\n            display = true;\n          if (argv[i].equalsIgnoreCase(\"-fastupsample\")) {\n            System.out.println(\"Using fast upsampling code\");\n            flags |= TJ.FLAG_FASTUPSAMPLE;\n          }\n          if (argv[i].equalsIgnoreCase(\"-fastdct\")) {\n            System.out.println(\"Using fastest DCT/IDCT algorithm\");\n            flags |= TJ.FLAG_FASTDCT;\n          }\n          if (argv[i].equalsIgnoreCase(\"-accuratedct\")) {\n            System.out.println(\"Using most accurate DCT/IDCT algorithm\");\n            flags |= TJ.FLAG_ACCURATEDCT;\n          }\n        }\n      }\n      String[] inFileTokens = argv[0].split(\"\\\\.\");\n      if (inFileTokens.length > 1)\n        inFormat = inFileTokens[inFileTokens.length - 1];\n      String[] outFileTokens;\n      if (display)\n        outFormat = \"bmp\";\n      else {\n        outFileTokens = argv[1].split(\"\\\\.\");\n        if (outFileTokens.length > 1)\n          outFormat = outFileTokens[outFileTokens.length - 1];\n      }\n\n      File file = new File(argv[0]);\n      int width, height;\n\n      if (inFormat.equalsIgnoreCase(\"jpg\")) {\n        FileInputStream fis = new FileInputStream(file);\n        int inputSize = fis.available();\n        if (inputSize < 1) {\n          System.out.println(\"Input file contains no data\");\n          System.exit(1);\n        }\n        byte[] inputBuf = new byte[inputSize];\n        fis.read(inputBuf);\n        fis.close();\n\n        TJDecompressor tjd;\n        if (xform.op != TJTransform.OP_NONE || xform.options != 0 ||\n            xform.cf != null) {\n          TJTransformer tjt = new TJTransformer(inputBuf);\n          TJTransform[] t = new TJTransform[1];\n          t[0] = xform;\n          t[0].options |= TJTransform.OPT_TRIM;\n          TJDecompressor[] tjdx = tjt.transform(t, 0);\n          tjd = tjdx[0];\n        } else\n          tjd = new TJDecompressor(inputBuf);\n\n        width = tjd.getWidth();\n        height = tjd.getHeight();\n        int inSubsamp = tjd.getSubsamp();\n        System.out.println(\"Source Image: \" + width + \" x \" + height +\n                           \" pixels, \" + sampName[inSubsamp] + \" subsampling\");\n        if (outSubsamp < 0)\n          outSubsamp = inSubsamp;\n\n        if (outFormat.equalsIgnoreCase(\"jpg\") &&\n            (xform.op != TJTransform.OP_NONE || xform.options != 0) &&\n            scaleFactor.isOne()) {\n          file = new File(argv[1]);\n          FileOutputStream fos = new FileOutputStream(file);\n          fos.write(tjd.getJPEGBuf(), 0, tjd.getJPEGSize());\n          fos.close();\n          System.exit(0);\n        }\n\n        width = scaleFactor.getScaled(width);\n        height = scaleFactor.getScaled(height);\n\n        if (!outFormat.equalsIgnoreCase(\"jpg\"))\n          img = tjd.decompress(width, height, BufferedImage.TYPE_INT_RGB,\n                               flags);\n        else\n          bmpBuf = tjd.decompress(width, 0, height, TJ.PF_BGRX, flags);\n        tjd.close();\n      } else {\n        img = ImageIO.read(file);\n        if (img == null)\n          throw new Exception(\"Input image type not supported.\");\n        width = img.getWidth();\n        height = img.getHeight();\n        if (outSubsamp < 0) {\n          if (img.getType() == BufferedImage.TYPE_BYTE_GRAY)\n            outSubsamp = TJ.SAMP_GRAY;\n          else\n            outSubsamp = TJ.SAMP_444;\n        }\n      }\n      System.gc();\n      if (!display)\n        System.out.print(\"Dest. Image (\" + outFormat + \"):  \" + width + \" x \" +\n                         height + \" pixels\");\n\n      if (display) {\n        ImageIcon icon = new ImageIcon(img);\n        JLabel label = new JLabel(icon, JLabel.CENTER);\n        JOptionPane.showMessageDialog(null, label, \"Output Image\",\n                                      JOptionPane.PLAIN_MESSAGE);\n      } else if (outFormat.equalsIgnoreCase(\"jpg\")) {\n        System.out.println(\", \" + sampName[outSubsamp] +\n                           \" subsampling, quality = \" + outQual);\n        TJCompressor tjc = new TJCompressor();\n        int jpegSize;\n        byte[] jpegBuf;\n\n        tjc.setSubsamp(outSubsamp);\n        tjc.setJPEGQuality(outQual);\n        if (img != null)\n          tjc.setSourceImage(img, 0, 0, 0, 0);\n        else {\n          tjc.setSourceImage(bmpBuf, 0, 0, width, 0, height, TJ.PF_BGRX);\n        }\n        jpegBuf = tjc.compress(flags);\n        jpegSize = tjc.getCompressedSize();\n        tjc.close();\n\n        file = new File(argv[1]);\n        FileOutputStream fos = new FileOutputStream(file);\n        fos.write(jpegBuf, 0, jpegSize);\n        fos.close();\n      } else {\n        System.out.print(\"\\n\");\n        file = new File(argv[1]);\n        ImageIO.write(img, outFormat, file);\n      }\n\n    } catch(Exception e) {\n      e.printStackTrace();\n      System.exit(-1);\n    }\n  }\n\n  public void customFilter(ShortBuffer coeffBuffer, Rectangle bufferRegion,\n                           Rectangle planeRegion, int componentIndex,\n                           int transformIndex, TJTransform transform)\n                           throws TJException {\n    for (int i = 0; i < bufferRegion.width * bufferRegion.height; i++) {\n      coeffBuffer.put(i, (short)(-coeffBuffer.get(i)));\n    }\n  }\n\n  static TJScalingFactor[] sf = null;\n};\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/TJUnitTest.java",
    "content": "/*\n * Copyright (C)2011-2016 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * This program tests the various code paths in the TurboJPEG JNI Wrapper\n */\n\nimport java.io.*;\nimport java.util.*;\nimport java.awt.image.*;\nimport javax.imageio.*;\nimport java.nio.*;\nimport org.libjpegturbo.turbojpeg.*;\n\npublic class TJUnitTest {\n\n  private static final String classname =\n    new TJUnitTest().getClass().getName();\n\n  private static void usage() {\n    System.out.println(\"\\nUSAGE: java \" + classname + \" [options]\\n\");\n    System.out.println(\"Options:\\n\");\n    System.out.println(\"-yuv = test YUV encoding/decoding support\\n\");\n    System.out.println(\"-noyuvpad = do not pad each line of each Y, U, and V plane to the nearest\\n\");\n    System.out.println(\"            4-byte boundary\\n\");\n    System.out.println(\"-bi = test BufferedImage support\\n\");\n    System.exit(1);\n  }\n\n  private static final String[] subNameLong = {\n    \"4:4:4\", \"4:2:2\", \"4:2:0\", \"GRAY\", \"4:4:0\", \"4:1:1\"\n  };\n  private static final String[] subName = {\n    \"444\", \"422\", \"420\", \"GRAY\", \"440\", \"411\"\n  };\n\n  private static final String[] pixFormatStr = {\n    \"RGB\", \"BGR\", \"RGBX\", \"BGRX\", \"XBGR\", \"XRGB\", \"Grayscale\",\n    \"RGBA\", \"BGRA\", \"ABGR\", \"ARGB\", \"CMYK\"\n  };\n\n  private static final int[] alphaOffset = {\n    -1, -1, -1, -1, -1, -1, -1, 3, 3, 0, 0, -1\n  };\n\n  private static final int[] _3byteFormats = {\n    TJ.PF_RGB, TJ.PF_BGR\n  };\n  private static final int[] _3byteFormatsBI = {\n    BufferedImage.TYPE_3BYTE_BGR\n  };\n  private static final int[] _4byteFormats = {\n    TJ.PF_RGBX, TJ.PF_BGRX, TJ.PF_XBGR, TJ.PF_XRGB, TJ.PF_CMYK\n  };\n  private static final int[] _4byteFormatsBI = {\n    BufferedImage.TYPE_INT_BGR, BufferedImage.TYPE_INT_RGB,\n    BufferedImage.TYPE_4BYTE_ABGR, BufferedImage.TYPE_4BYTE_ABGR_PRE,\n    BufferedImage.TYPE_INT_ARGB, BufferedImage.TYPE_INT_ARGB_PRE\n  };\n  private static final int[] onlyGray = {\n    TJ.PF_GRAY\n  };\n  private static final int[] onlyGrayBI = {\n    BufferedImage.TYPE_BYTE_GRAY\n  };\n  private static final int[] onlyRGB = {\n    TJ.PF_RGB\n  };\n\n  private static boolean doYUV = false;\n  private static int pad = 4;\n  private static boolean bi = false;\n\n  private static int exitStatus = 0;\n\n  private static int biTypePF(int biType) {\n    ByteOrder byteOrder = ByteOrder.nativeOrder();\n    switch(biType) {\n      case BufferedImage.TYPE_3BYTE_BGR:\n        return TJ.PF_BGR;\n      case BufferedImage.TYPE_4BYTE_ABGR:\n      case BufferedImage.TYPE_4BYTE_ABGR_PRE:\n        return TJ.PF_ABGR;\n      case BufferedImage.TYPE_BYTE_GRAY:\n        return TJ.PF_GRAY;\n      case BufferedImage.TYPE_INT_BGR:\n        if (byteOrder == ByteOrder.BIG_ENDIAN)\n          return TJ.PF_XBGR;\n        else\n          return TJ.PF_RGBX;\n      case BufferedImage.TYPE_INT_RGB:\n        if (byteOrder == ByteOrder.BIG_ENDIAN)\n          return TJ.PF_XRGB;\n        else\n          return TJ.PF_BGRX;\n      case BufferedImage.TYPE_INT_ARGB:\n      case BufferedImage.TYPE_INT_ARGB_PRE:\n        if (byteOrder == ByteOrder.BIG_ENDIAN)\n          return TJ.PF_ARGB;\n        else\n          return TJ.PF_BGRA;\n    }\n    return 0;\n  }\n\n  private static String biTypeStr(int biType) {\n    switch(biType) {\n      case BufferedImage.TYPE_3BYTE_BGR:\n        return \"3BYTE_BGR\";\n      case BufferedImage.TYPE_4BYTE_ABGR:\n        return \"4BYTE_ABGR\";\n      case BufferedImage.TYPE_4BYTE_ABGR_PRE:\n        return \"4BYTE_ABGR_PRE\";\n      case BufferedImage.TYPE_BYTE_GRAY:\n        return \"BYTE_GRAY\";\n      case BufferedImage.TYPE_INT_BGR:\n        return \"INT_BGR\";\n      case BufferedImage.TYPE_INT_RGB:\n        return \"INT_RGB\";\n      case BufferedImage.TYPE_INT_ARGB:\n        return \"INT_ARGB\";\n      case BufferedImage.TYPE_INT_ARGB_PRE:\n        return \"INT_ARGB_PRE\";\n    }\n    return \"Unknown\";\n  }\n\n  private static void initBuf(byte[] buf, int w, int pitch, int h, int pf,\n                              int flags) throws Exception {\n    int roffset = TJ.getRedOffset(pf);\n    int goffset = TJ.getGreenOffset(pf);\n    int boffset = TJ.getBlueOffset(pf);\n    int aoffset = alphaOffset[pf];\n    int ps = TJ.getPixelSize(pf);\n    int index, row, col, halfway = 16;\n\n    if (pf == TJ.PF_GRAY) {\n      Arrays.fill(buf, (byte)0);\n      for (row = 0; row < h; row++) {\n        for (col = 0; col < w; col++) {\n          if ((flags & TJ.FLAG_BOTTOMUP) != 0)\n            index = pitch * (h - row - 1) + col;\n          else\n            index = pitch * row + col;\n          if (((row / 8) + (col / 8)) % 2 == 0)\n            buf[index] = (row < halfway) ? (byte)255 : 0;\n          else\n            buf[index] = (row < halfway) ? 76 : (byte)226;\n        }\n      }\n      return;\n    }\n    if (pf == TJ.PF_CMYK) {\n      Arrays.fill(buf, (byte)255);\n      for (row = 0; row < h; row++) {\n        for (col = 0; col < w; col++) {\n          if ((flags & TJ.FLAG_BOTTOMUP) != 0)\n            index = (h - row - 1) * w + col;\n          else\n            index = row * w + col;\n          if (((row / 8) + (col / 8)) % 2 == 0) {\n            if (row >= halfway) buf[index * ps + 3] = 0;\n          } else {\n            buf[index * ps + 2] = 0;\n            if (row < halfway)\n              buf[index * ps + 1] = 0;\n          }\n        }\n      }\n      return;\n    }\n\n    Arrays.fill(buf, (byte)0);\n    for (row = 0; row < h; row++) {\n      for (col = 0; col < w; col++) {\n        if ((flags & TJ.FLAG_BOTTOMUP) != 0)\n          index = pitch * (h - row - 1) + col * ps;\n        else\n          index = pitch * row + col * ps;\n        if (((row / 8) + (col / 8)) % 2 == 0) {\n          if (row < halfway) {\n            buf[index + roffset] = (byte)255;\n            buf[index + goffset] = (byte)255;\n            buf[index + boffset] = (byte)255;\n          }\n        } else {\n          buf[index + roffset] = (byte)255;\n          if (row >= halfway)\n            buf[index + goffset] = (byte)255;\n        }\n        if (aoffset >= 0)\n          buf[index + aoffset] = (byte)255;\n      }\n    }\n  }\n\n  private static void initIntBuf(int[] buf, int w, int pitch, int h, int pf,\n                                 int flags) throws Exception {\n    int rshift = TJ.getRedOffset(pf) * 8;\n    int gshift = TJ.getGreenOffset(pf) * 8;\n    int bshift = TJ.getBlueOffset(pf) * 8;\n    int ashift = alphaOffset[pf] * 8;\n    int index, row, col, halfway = 16;\n\n    Arrays.fill(buf, 0);\n    for (row = 0; row < h; row++) {\n      for (col = 0; col < w; col++) {\n        if ((flags & TJ.FLAG_BOTTOMUP) != 0)\n          index = pitch * (h - row - 1) + col;\n        else\n          index = pitch * row + col;\n        if (((row / 8) + (col / 8)) % 2 == 0) {\n          if (row < halfway) {\n            buf[index] |= (255 << rshift);\n            buf[index] |= (255 << gshift);\n            buf[index] |= (255 << bshift);\n          }\n        } else {\n          buf[index] |= (255 << rshift);\n          if (row >= halfway)\n            buf[index] |= (255 << gshift);\n        }\n        if (ashift >= 0)\n          buf[index] |= (255 << ashift);\n      }\n    }\n  }\n\n  private static void initImg(BufferedImage img, int pf, int flags)\n                              throws Exception {\n    WritableRaster wr = img.getRaster();\n    int imgType = img.getType();\n    if (imgType == BufferedImage.TYPE_INT_RGB ||\n        imgType == BufferedImage.TYPE_INT_BGR ||\n        imgType == BufferedImage.TYPE_INT_ARGB ||\n        imgType == BufferedImage.TYPE_INT_ARGB_PRE) {\n      SinglePixelPackedSampleModel sm =\n        (SinglePixelPackedSampleModel)img.getSampleModel();\n      int pitch = sm.getScanlineStride();\n      DataBufferInt db = (DataBufferInt)wr.getDataBuffer();\n      int[] buf = db.getData();\n      initIntBuf(buf, img.getWidth(), pitch, img.getHeight(), pf, flags);\n    } else {\n      ComponentSampleModel sm = (ComponentSampleModel)img.getSampleModel();\n      int pitch = sm.getScanlineStride();\n      DataBufferByte db = (DataBufferByte)wr.getDataBuffer();\n      byte[] buf = db.getData();\n      initBuf(buf, img.getWidth(), pitch, img.getHeight(), pf, flags);\n    }\n  }\n\n  private static void checkVal(int row, int col, int v, String vname, int cv)\n                               throws Exception {\n    v = (v < 0) ? v + 256 : v;\n    if (v < cv - 1 || v > cv + 1) {\n      throw new Exception(\"Comp. \" + vname + \" at \" + row + \",\" + col +\n                          \" should be \" + cv + \", not \" + v);\n    }\n  }\n\n  private static void checkVal0(int row, int col, int v, String vname)\n                                throws Exception {\n    v = (v < 0) ? v + 256 : v;\n    if (v > 1) {\n      throw new Exception(\"Comp. \" + vname + \" at \" + row + \",\" + col +\n                          \" should be 0, not \" + v);\n    }\n  }\n\n  private static void checkVal255(int row, int col, int v, String vname)\n                                  throws Exception {\n    v = (v < 0) ? v + 256 : v;\n    if (v < 254) {\n      throw new Exception(\"Comp. \" + vname + \" at \" + row + \",\" + col +\n                          \" should be 255, not \" + v);\n    }\n  }\n\n  private static int checkBuf(byte[] buf, int w, int pitch, int h, int pf,\n                              int subsamp, TJScalingFactor sf, int flags)\n                              throws Exception {\n    int roffset = TJ.getRedOffset(pf);\n    int goffset = TJ.getGreenOffset(pf);\n    int boffset = TJ.getBlueOffset(pf);\n    int aoffset = alphaOffset[pf];\n    int ps = TJ.getPixelSize(pf);\n    int index, row, col, retval = 1;\n    int halfway = 16 * sf.getNum() / sf.getDenom();\n    int blockSize = 8 * sf.getNum() / sf.getDenom();\n\n    try {\n\n      if (pf == TJ.PF_CMYK) {\n        for (row = 0; row < h; row++) {\n          for (col = 0; col < w; col++) {\n            if ((flags & TJ.FLAG_BOTTOMUP) != 0)\n              index = (h - row - 1) * w + col;\n            else\n              index = row * w + col;\n            byte c = buf[index * ps];\n            byte m = buf[index * ps + 1];\n            byte y = buf[index * ps + 2];\n            byte k = buf[index * ps + 3];\n            checkVal255(row, col, c, \"C\");\n            if (((row / blockSize) + (col / blockSize)) % 2 == 0) {\n              checkVal255(row, col, m, \"M\");\n              checkVal255(row, col, y, \"Y\");\n              if (row < halfway)\n                checkVal255(row, col, k, \"K\");\n              else\n                checkVal0(row, col, k, \"K\");\n            } else {\n              checkVal0(row, col, y, \"Y\");\n              checkVal255(row, col, k, \"K\");\n              if (row < halfway)\n                checkVal0(row, col, m, \"M\");\n              else\n                checkVal255(row, col, m, \"M\");\n            }\n          }\n        }\n        return 1;\n      }\n\n      for (row = 0; row < halfway; row++) {\n        for (col = 0; col < w; col++) {\n          if ((flags & TJ.FLAG_BOTTOMUP) != 0)\n            index = pitch * (h - row - 1) + col * ps;\n          else\n            index = pitch * row + col * ps;\n          byte r = buf[index + roffset];\n          byte g = buf[index + goffset];\n          byte b = buf[index + boffset];\n          byte a = aoffset >= 0 ? buf[index + aoffset] : (byte)255;\n          if (((row / blockSize) + (col / blockSize)) % 2 == 0) {\n            if (row < halfway) {\n              checkVal255(row, col, r, \"R\");\n              checkVal255(row, col, g, \"G\");\n              checkVal255(row, col, b, \"B\");\n            } else {\n              checkVal0(row, col, r, \"R\");\n              checkVal0(row, col, g, \"G\");\n              checkVal0(row, col, b, \"B\");\n            }\n          } else {\n            if (subsamp == TJ.SAMP_GRAY) {\n              if (row < halfway) {\n                checkVal(row, col, r, \"R\", 76);\n                checkVal(row, col, g, \"G\", 76);\n                checkVal(row, col, b, \"B\", 76);\n              } else {\n                checkVal(row, col, r, \"R\", 226);\n                checkVal(row, col, g, \"G\", 226);\n                checkVal(row, col, b, \"B\", 226);\n              }\n            } else {\n              checkVal255(row, col, r, \"R\");\n              if (row < halfway) {\n                checkVal0(row, col, g, \"G\");\n              } else {\n                checkVal255(row, col, g, \"G\");\n              }\n              checkVal0(row, col, b, \"B\");\n            }\n          }\n          checkVal255(row, col, a, \"A\");\n        }\n      }\n    } catch(Exception e) {\n      System.out.println(\"\\n\" + e.getMessage());\n      retval = 0;\n    }\n\n    if (retval == 0) {\n      for (row = 0; row < h; row++) {\n        for (col = 0; col < w; col++) {\n          if (pf == TJ.PF_CMYK) {\n            int c = buf[pitch * row + col * ps];\n            int m = buf[pitch * row + col * ps + 1];\n            int y = buf[pitch * row + col * ps + 2];\n            int k = buf[pitch * row + col * ps + 3];\n            if (c < 0) c += 256;\n            if (m < 0) m += 256;\n            if (y < 0) y += 256;\n            if (k < 0) k += 256;\n            System.out.format(\"%3d/%3d/%3d/%3d \", c, m, y, k);\n          } else {\n            int r = buf[pitch * row + col * ps + roffset];\n            int g = buf[pitch * row + col * ps + goffset];\n            int b = buf[pitch * row + col * ps + boffset];\n            if (r < 0) r += 256;\n            if (g < 0) g += 256;\n            if (b < 0) b += 256;\n            System.out.format(\"%3d/%3d/%3d \", r, g, b);\n          }\n        }\n        System.out.print(\"\\n\");\n      }\n    }\n    return retval;\n  }\n\n  private static int checkIntBuf(int[] buf, int w, int pitch, int h, int pf,\n                                 int subsamp, TJScalingFactor sf, int flags)\n                                 throws Exception {\n    int rshift = TJ.getRedOffset(pf) * 8;\n    int gshift = TJ.getGreenOffset(pf) * 8;\n    int bshift = TJ.getBlueOffset(pf) * 8;\n    int ashift = alphaOffset[pf] * 8;\n    int index, row, col, retval = 1;\n    int halfway = 16 * sf.getNum() / sf.getDenom();\n    int blockSize = 8 * sf.getNum() / sf.getDenom();\n\n    try {\n      for (row = 0; row < halfway; row++) {\n        for (col = 0; col < w; col++) {\n          if ((flags & TJ.FLAG_BOTTOMUP) != 0)\n            index = pitch * (h - row - 1) + col;\n          else\n            index = pitch * row + col;\n          int r = (buf[index] >> rshift) & 0xFF;\n          int g = (buf[index] >> gshift) & 0xFF;\n          int b = (buf[index] >> bshift) & 0xFF;\n          int a = ashift >= 0 ? (buf[index] >> ashift) & 0xFF : 255;\n          if (((row / blockSize) + (col / blockSize)) % 2 == 0) {\n            if (row < halfway) {\n              checkVal255(row, col, r, \"R\");\n              checkVal255(row, col, g, \"G\");\n              checkVal255(row, col, b, \"B\");\n            } else {\n              checkVal0(row, col, r, \"R\");\n              checkVal0(row, col, g, \"G\");\n              checkVal0(row, col, b, \"B\");\n            }\n          } else {\n            if (subsamp == TJ.SAMP_GRAY) {\n              if (row < halfway) {\n                checkVal(row, col, r, \"R\", 76);\n                checkVal(row, col, g, \"G\", 76);\n                checkVal(row, col, b, \"B\", 76);\n              } else {\n                checkVal(row, col, r, \"R\", 226);\n                checkVal(row, col, g, \"G\", 226);\n                checkVal(row, col, b, \"B\", 226);\n              }\n            } else {\n              checkVal255(row, col, r, \"R\");\n              if (row < halfway) {\n                checkVal0(row, col, g, \"G\");\n              } else {\n                checkVal255(row, col, g, \"G\");\n              }\n              checkVal0(row, col, b, \"B\");\n            }\n          }\n          checkVal255(row, col, a, \"A\");\n        }\n      }\n    } catch(Exception e) {\n      System.out.println(\"\\n\" + e.getMessage());\n      retval = 0;\n    }\n\n    if (retval == 0) {\n      for (row = 0; row < h; row++) {\n        for (col = 0; col < w; col++) {\n          int r = (buf[pitch * row + col] >> rshift) & 0xFF;\n          int g = (buf[pitch * row + col] >> gshift) & 0xFF;\n          int b = (buf[pitch * row + col] >> bshift) & 0xFF;\n          if (r < 0) r += 256;\n          if (g < 0) g += 256;\n          if (b < 0) b += 256;\n          System.out.format(\"%3d/%3d/%3d \", r, g, b);\n        }\n        System.out.print(\"\\n\");\n      }\n    }\n    return retval;\n  }\n\n  private static int checkImg(BufferedImage img, int pf, int subsamp,\n                              TJScalingFactor sf, int flags) throws Exception {\n    WritableRaster wr = img.getRaster();\n    int imgType = img.getType();\n    if (imgType == BufferedImage.TYPE_INT_RGB ||\n        imgType == BufferedImage.TYPE_INT_BGR ||\n        imgType == BufferedImage.TYPE_INT_ARGB ||\n        imgType == BufferedImage.TYPE_INT_ARGB_PRE) {\n      SinglePixelPackedSampleModel sm =\n        (SinglePixelPackedSampleModel)img.getSampleModel();\n      int pitch = sm.getScanlineStride();\n      DataBufferInt db = (DataBufferInt)wr.getDataBuffer();\n      int[] buf = db.getData();\n      return checkIntBuf(buf, img.getWidth(), pitch, img.getHeight(), pf,\n                         subsamp, sf, flags);\n    } else {\n      ComponentSampleModel sm = (ComponentSampleModel)img.getSampleModel();\n      int pitch = sm.getScanlineStride();\n      DataBufferByte db = (DataBufferByte)wr.getDataBuffer();\n      byte[] buf = db.getData();\n      return checkBuf(buf, img.getWidth(), pitch, img.getHeight(), pf, subsamp,\n                      sf, flags);\n    }\n  }\n\n  private static int PAD(int v, int p) {\n    return ((v + (p) - 1) & (~((p) - 1)));\n  }\n\n  private static int checkBufYUV(byte[] buf, int size, int w, int h,\n                                 int subsamp, TJScalingFactor sf)\n                                 throws Exception {\n    int row, col;\n    int hsf = TJ.getMCUWidth(subsamp) / 8, vsf = TJ.getMCUHeight(subsamp) / 8;\n    int pw = PAD(w, hsf), ph = PAD(h, vsf);\n    int cw = pw / hsf, ch = ph / vsf;\n    int ypitch = PAD(pw, pad), uvpitch = PAD(cw, pad);\n    int retval = 1;\n    int correctsize = ypitch * ph +\n                      (subsamp == TJ.SAMP_GRAY ? 0 : uvpitch * ch * 2);\n    int halfway = 16 * sf.getNum() / sf.getDenom();\n    int blockSize = 8 * sf.getNum() / sf.getDenom();\n\n    try {\n      if (size != correctsize)\n        throw new Exception(\"Incorrect size \" + size + \".  Should be \" +\n                            correctsize);\n\n      for (row = 0; row < ph; row++) {\n        for (col = 0; col < pw; col++) {\n          byte y = buf[ypitch * row + col];\n          if (((row / blockSize) + (col / blockSize)) % 2 == 0) {\n            if (row < halfway)\n              checkVal255(row, col, y, \"Y\");\n            else\n              checkVal0(row, col, y, \"Y\");\n          } else {\n            if (row < halfway)\n              checkVal(row, col, y, \"Y\", 76);\n            else\n              checkVal(row, col, y, \"Y\", 226);\n          }\n        }\n      }\n      if (subsamp != TJ.SAMP_GRAY) {\n        halfway = 16 / vsf * sf.getNum() / sf.getDenom();\n        for (row = 0; row < ch; row++) {\n          for (col = 0; col < cw; col++) {\n            byte u = buf[ypitch * ph + (uvpitch * row + col)],\n                 v = buf[ypitch * ph + uvpitch * ch + (uvpitch * row + col)];\n            if (((row * vsf / blockSize) + (col * hsf / blockSize)) % 2 == 0) {\n              checkVal(row, col, u, \"U\", 128);\n              checkVal(row, col, v, \"V\", 128);\n            } else {\n              if (row < halfway) {\n                checkVal(row, col, u, \"U\", 85);\n                checkVal255(row, col, v, \"V\");\n              } else {\n                checkVal0(row, col, u, \"U\");\n                checkVal(row, col, v, \"V\", 149);\n              }\n            }\n          }\n        }\n      }\n    } catch(Exception e) {\n      System.out.println(\"\\n\" + e.getMessage());\n      retval = 0;\n    }\n\n    if (retval == 0) {\n      for (row = 0; row < ph; row++) {\n        for (col = 0; col < pw; col++) {\n          int y = buf[ypitch * row + col];\n          if (y < 0) y += 256;\n          System.out.format(\"%3d \", y);\n        }\n        System.out.print(\"\\n\");\n      }\n      System.out.print(\"\\n\");\n      for (row = 0; row < ch; row++) {\n        for (col = 0; col < cw; col++) {\n          int u = buf[ypitch * ph + (uvpitch * row + col)];\n          if (u < 0) u += 256;\n          System.out.format(\"%3d \", u);\n        }\n        System.out.print(\"\\n\");\n      }\n      System.out.print(\"\\n\");\n      for (row = 0; row < ch; row++) {\n        for (col = 0; col < cw; col++) {\n          int v = buf[ypitch * ph + uvpitch * ch + (uvpitch * row + col)];\n          if (v < 0) v += 256;\n          System.out.format(\"%3d \", v);\n        }\n        System.out.print(\"\\n\");\n      }\n    }\n\n    return retval;\n  }\n\n  private static void writeJPEG(byte[] jpegBuf, int jpegBufSize,\n                                String filename) throws Exception {\n    File file = new File(filename);\n    FileOutputStream fos = new FileOutputStream(file);\n    fos.write(jpegBuf, 0, jpegBufSize);\n    fos.close();\n  }\n\n  private static int compTest(TJCompressor tjc, byte[] dstBuf, int w,\n                              int h, int pf, String baseName, int subsamp,\n                              int jpegQual, int flags) throws Exception {\n    String tempStr;\n    byte[] srcBuf = null;\n    BufferedImage img = null;\n    String pfStr, pfStrLong;\n    String buStr = (flags & TJ.FLAG_BOTTOMUP) != 0 ? \"BU\" : \"TD\";\n    String buStrLong = (flags & TJ.FLAG_BOTTOMUP) != 0 ?\n                       \"Bottom-Up\" : \"Top-Down \";\n    int size = 0, ps, imgType = pf;\n\n    if (bi) {\n      pf = biTypePF(imgType);\n      pfStr = biTypeStr(imgType);\n      pfStrLong = pfStr + \" (\" + pixFormatStr[pf] + \")\";\n    } else {\n      pfStr = pixFormatStr[pf];\n      pfStrLong = pfStr;\n    }\n    ps =  TJ.getPixelSize(pf);\n\n    if (bi) {\n      img = new BufferedImage(w, h, imgType);\n      initImg(img, pf, flags);\n      tempStr = baseName + \"_enc_\" + pfStr + \"_\" + buStr + \"_\" +\n                subName[subsamp] + \"_Q\" + jpegQual + \".png\";\n      File file = new File(tempStr);\n      ImageIO.write(img, \"png\", file);\n      tjc.setSourceImage(img, 0, 0, 0, 0);\n    } else {\n      srcBuf = new byte[w * h * ps + 1];\n      initBuf(srcBuf, w, w * ps, h, pf, flags);\n      tjc.setSourceImage(srcBuf, 0, 0, w, 0, h, pf);\n    }\n    Arrays.fill(dstBuf, (byte)0);\n\n    tjc.setSubsamp(subsamp);\n    tjc.setJPEGQuality(jpegQual);\n    if (doYUV) {\n      System.out.format(\"%s %s -> YUV %s ... \", pfStrLong, buStrLong,\n                        subNameLong[subsamp]);\n      YUVImage yuvImage = tjc.encodeYUV(pad, flags);\n      if (checkBufYUV(yuvImage.getBuf(), yuvImage.getSize(), w, h, subsamp,\n          new TJScalingFactor(1, 1)) == 1)\n        System.out.print(\"Passed.\\n\");\n      else {\n        System.out.print(\"FAILED!\\n\");\n        exitStatus = -1;\n      }\n\n      System.out.format(\"YUV %s %s -> JPEG Q%d ... \", subNameLong[subsamp],\n                        buStrLong, jpegQual);\n      tjc.setSourceImage(yuvImage);\n    } else {\n      System.out.format(\"%s %s -> %s Q%d ... \", pfStrLong, buStrLong,\n                        subNameLong[subsamp], jpegQual);\n    }\n    tjc.compress(dstBuf, flags);\n    size = tjc.getCompressedSize();\n\n    tempStr = baseName + \"_enc_\" + pfStr + \"_\" + buStr + \"_\" +\n              subName[subsamp] + \"_Q\" + jpegQual + \".jpg\";\n    writeJPEG(dstBuf, size, tempStr);\n    System.out.println(\"Done.\\n  Result in \" + tempStr);\n\n    return size;\n  }\n\n  private static void decompTest(TJDecompressor tjd, byte[] jpegBuf,\n                                 int jpegSize, int w, int h, int pf,\n                                 String baseName, int subsamp, int flags,\n                                 TJScalingFactor sf) throws Exception {\n    String pfStr, pfStrLong, tempStr;\n    String buStrLong = (flags & TJ.FLAG_BOTTOMUP) != 0 ?\n                       \"Bottom-Up\" : \"Top-Down \";\n    int scaledWidth = sf.getScaled(w);\n    int scaledHeight = sf.getScaled(h);\n    int temp1, temp2, imgType = pf;\n    BufferedImage img = null;\n    byte[] dstBuf = null;\n\n    if (bi) {\n      pf = biTypePF(imgType);\n      pfStr = biTypeStr(imgType);\n      pfStrLong = pfStr + \" (\" + pixFormatStr[pf] + \")\";\n    } else {\n      pfStr = pixFormatStr[pf];\n      pfStrLong = pfStr;\n    }\n\n    tjd.setSourceImage(jpegBuf, jpegSize);\n    if (tjd.getWidth() != w || tjd.getHeight() != h ||\n        tjd.getSubsamp() != subsamp)\n      throw new Exception(\"Incorrect JPEG header\");\n\n    temp1 = scaledWidth;\n    temp2 = scaledHeight;\n    temp1 = tjd.getScaledWidth(temp1, temp2);\n    temp2 = tjd.getScaledHeight(temp1, temp2);\n    if (temp1 != scaledWidth || temp2 != scaledHeight)\n      throw new Exception(\"Scaled size mismatch\");\n\n    if (doYUV) {\n      System.out.format(\"JPEG -> YUV %s \", subNameLong[subsamp]);\n      if(!sf.isOne())\n        System.out.format(\"%d/%d ... \", sf.getNum(), sf.getDenom());\n      else System.out.print(\"... \");\n      YUVImage yuvImage = tjd.decompressToYUV(scaledWidth, pad, scaledHeight,\n                                              flags);\n      if (checkBufYUV(yuvImage.getBuf(), yuvImage.getSize(), scaledWidth,\n                      scaledHeight, subsamp, sf) == 1)\n        System.out.print(\"Passed.\\n\");\n      else {\n        System.out.print(\"FAILED!\\n\");  exitStatus = -1;\n      }\n\n      System.out.format(\"YUV %s -> %s %s ... \", subNameLong[subsamp],\n                        pfStrLong, buStrLong);\n      tjd.setSourceImage(yuvImage);\n    } else {\n      System.out.format(\"JPEG -> %s %s \", pfStrLong, buStrLong);\n      if(!sf.isOne())\n        System.out.format(\"%d/%d ... \", sf.getNum(), sf.getDenom());\n      else System.out.print(\"... \");\n    }\n    if (bi)\n      img = tjd.decompress(scaledWidth, scaledHeight, imgType, flags);\n    else\n      dstBuf = tjd.decompress(scaledWidth, 0, scaledHeight, pf, flags);\n\n    if (bi) {\n      tempStr = baseName + \"_dec_\" + pfStr + \"_\" +\n                (((flags & TJ.FLAG_BOTTOMUP) != 0) ? \"BU\" : \"TD\") + \"_\" +\n                subName[subsamp] + \"_\" +\n                (double)sf.getNum() / (double)sf.getDenom() + \"x\" + \".png\";\n      File file = new File(tempStr);\n      ImageIO.write(img, \"png\", file);\n    }\n\n    if ((bi && checkImg(img, pf, subsamp, sf, flags) == 1) ||\n        (!bi && checkBuf(dstBuf, scaledWidth,\n                         scaledWidth * TJ.getPixelSize(pf), scaledHeight, pf,\n                         subsamp, sf, flags) == 1))\n      System.out.print(\"Passed.\\n\");\n    else {\n      System.out.print(\"FAILED!\\n\");\n      exitStatus = -1;\n    }\n  }\n\n  private static void decompTest(TJDecompressor tjd, byte[] jpegBuf,\n                                 int jpegSize, int w, int h, int pf,\n                                 String baseName, int subsamp,\n                                 int flags) throws Exception {\n    int i;\n    TJScalingFactor[] sf = TJ.getScalingFactors();\n    for (i = 0; i < sf.length; i++) {\n      int num = sf[i].getNum();\n      int denom = sf[i].getDenom();\n      if (subsamp == TJ.SAMP_444 || subsamp == TJ.SAMP_GRAY ||\n          (subsamp == TJ.SAMP_411 && num == 1 &&\n           (denom == 2 || denom == 1)) ||\n          (subsamp != TJ.SAMP_411 && num == 1 &&\n           (denom == 4 || denom == 2 || denom == 1)))\n        decompTest(tjd, jpegBuf, jpegSize, w, h, pf, baseName, subsamp,\n                   flags, sf[i]);\n    }\n  }\n\n  private static void doTest(int w, int h, int[] formats, int subsamp,\n                             String baseName) throws Exception {\n    TJCompressor tjc = null;\n    TJDecompressor tjd = null;\n    int size;\n    byte[] dstBuf;\n\n    dstBuf = new byte[TJ.bufSize(w, h, subsamp)];\n\n    try {\n      tjc = new TJCompressor();\n      tjd = new TJDecompressor();\n\n      for (int pf : formats) {\n        if (pf < 0) continue;\n        for (int i = 0; i < 2; i++) {\n          int flags = 0;\n          if (subsamp == TJ.SAMP_422 || subsamp == TJ.SAMP_420 ||\n              subsamp == TJ.SAMP_440 || subsamp == TJ.SAMP_411)\n            flags |= TJ.FLAG_FASTUPSAMPLE;\n          if (i == 1)\n            flags |= TJ.FLAG_BOTTOMUP;\n          size = compTest(tjc, dstBuf, w, h, pf, baseName, subsamp, 100,\n                          flags);\n          decompTest(tjd, dstBuf, size, w, h, pf, baseName, subsamp, flags);\n          if (pf >= TJ.PF_RGBX && pf <= TJ.PF_XRGB && !bi) {\n            System.out.print(\"\\n\");\n            decompTest(tjd, dstBuf, size, w, h, pf + (TJ.PF_RGBA - TJ.PF_RGBX),\n                       baseName, subsamp, flags);\n          }\n          System.out.print(\"\\n\");\n        }\n      }\n      System.out.print(\"--------------------\\n\\n\");\n    } catch(Exception e) {\n      if (tjc != null) tjc.close();\n      if (tjd != null) tjd.close();\n      throw e;\n    }\n    if (tjc != null) tjc.close();\n    if (tjd != null) tjd.close();\n  }\n\n  private static void bufSizeTest() throws Exception {\n    int w, h, i, subsamp;\n    byte[] srcBuf, dstBuf = null;\n    YUVImage dstImage = null;\n    TJCompressor tjc = null;\n    Random r = new Random();\n\n    try {\n      tjc = new TJCompressor();\n      System.out.println(\"Buffer size regression test\");\n      for (subsamp = 0; subsamp < TJ.NUMSAMP; subsamp++) {\n        for (w = 1; w < 48; w++) {\n          int maxh = (w == 1) ? 2048 : 48;\n          for (h = 1; h < maxh; h++) {\n            if (h % 100 == 0)\n              System.out.format(\"%04d x %04d\\b\\b\\b\\b\\b\\b\\b\\b\\b\\b\\b\", w, h);\n            srcBuf = new byte[w * h * 4];\n            if (doYUV)\n              dstImage = new YUVImage(w, pad, h, subsamp);\n            else\n              dstBuf = new byte[TJ.bufSize(w, h, subsamp)];\n            for (i = 0; i < w * h * 4; i++) {\n              srcBuf[i] = (byte)(r.nextInt(2) * 255);\n            }\n            tjc.setSourceImage(srcBuf, 0, 0, w, 0, h, TJ.PF_BGRX);\n            tjc.setSubsamp(subsamp);\n            tjc.setJPEGQuality(100);\n            if (doYUV)\n              tjc.encodeYUV(dstImage, 0);\n            else\n              tjc.compress(dstBuf, 0);\n\n            srcBuf = new byte[h * w * 4];\n            if (doYUV)\n              dstImage = new YUVImage(h, pad, w, subsamp);\n            else\n              dstBuf = new byte[TJ.bufSize(h, w, subsamp)];\n            for (i = 0; i < h * w * 4; i++) {\n              srcBuf[i] = (byte)(r.nextInt(2) * 255);\n            }\n            tjc.setSourceImage(srcBuf, 0, 0, h, 0, w, TJ.PF_BGRX);\n            if (doYUV)\n              tjc.encodeYUV(dstImage, 0);\n            else\n              tjc.compress(dstBuf, 0);\n          }\n          dstImage = null;\n          dstBuf = null;\n          System.gc();\n        }\n      }\n      System.out.println(\"Done.      \");\n    } catch(Exception e) {\n      if (tjc != null) tjc.close();\n      throw e;\n    }\n    if (tjc != null) tjc.close();\n  }\n\n  public static void main(String[] argv) {\n    try {\n      String testName = \"javatest\";\n      for (int i = 0; i < argv.length; i++) {\n        if (argv[i].equalsIgnoreCase(\"-yuv\"))\n          doYUV = true;\n        if (argv[i].equalsIgnoreCase(\"-noyuvpad\"))\n          pad = 1;\n        if (argv[i].substring(0, 1).equalsIgnoreCase(\"-h\") ||\n            argv[i].equalsIgnoreCase(\"-?\"))\n          usage();\n        if (argv[i].equalsIgnoreCase(\"-bi\")) {\n          bi = true;\n          testName = \"javabitest\";\n        }\n      }\n      if (doYUV)\n        _4byteFormats[4] = -1;\n      doTest(35, 39, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_444,\n             testName);\n      doTest(39, 41, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_444,\n             testName);\n      doTest(41, 35, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_422,\n             testName);\n      doTest(35, 39, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_422,\n             testName);\n      doTest(39, 41, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_420,\n             testName);\n      doTest(41, 35, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_420,\n             testName);\n      doTest(35, 39, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_440,\n             testName);\n      doTest(39, 41, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_440,\n             testName);\n      doTest(41, 35, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_411,\n             testName);\n      doTest(35, 39, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_411,\n             testName);\n      doTest(39, 41, bi ? onlyGrayBI : onlyGray, TJ.SAMP_GRAY, testName);\n      doTest(41, 35, bi ? _3byteFormatsBI : _3byteFormats, TJ.SAMP_GRAY,\n             testName);\n      _4byteFormats[4] = -1;\n      doTest(35, 39, bi ? _4byteFormatsBI : _4byteFormats, TJ.SAMP_GRAY,\n             testName);\n      if (!bi)\n        bufSizeTest();\n      if (doYUV && !bi) {\n        System.out.print(\"\\n--------------------\\n\\n\");\n        doTest(48, 48, onlyRGB, TJ.SAMP_444, \"javatest_yuv0\");\n        doTest(48, 48, onlyRGB, TJ.SAMP_422, \"javatest_yuv0\");\n        doTest(48, 48, onlyRGB, TJ.SAMP_420, \"javatest_yuv0\");\n        doTest(48, 48, onlyRGB, TJ.SAMP_440, \"javatest_yuv0\");\n        doTest(48, 48, onlyRGB, TJ.SAMP_411, \"javatest_yuv0\");\n        doTest(48, 48, onlyRGB, TJ.SAMP_GRAY, \"javatest_yuv0\");\n        doTest(48, 48, onlyGray, TJ.SAMP_GRAY, \"javatest_yuv0\");\n      }\n    } catch(Exception e) {\n      e.printStackTrace();\n      exitStatus = -1;\n    }\n    System.exit(exitStatus);\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/allclasses-frame.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>All Classes</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<h1 class=\"bar\">All Classes</h1>\n<div class=\"indexContainer\">\n<ul>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">TJ</a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">TJCompressor</a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\" target=\"classFrame\"><i>TJCustomFilter</i></a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">TJDecompressor</a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">TJException</a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">TJScalingFactor</a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">TJTransform</a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">TJTransformer</a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">YUVImage</a></li>\n</ul>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/allclasses-noframe.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>All Classes</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<h1 class=\"bar\">All Classes</h1>\n<div class=\"indexContainer\">\n<ul>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\"><i>TJCustomFilter</i></a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJScalingFactor</a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransformer</a></li>\n<li><a href=\"org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></li>\n</ul>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/constant-values.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>Constant Field Values</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"Constant Field Values\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li><a href=\"org/libjpegturbo/turbojpeg/package-tree.html\">Tree</a></li>\n<li><a href=\"deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"index-all.html\">Index</a></li>\n<li><a href=\"help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"index.html?constant-values.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"constant-values.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h1 title=\"Constant Field Values\" class=\"title\">Constant Field Values</h1>\n<h2 title=\"Contents\">Contents</h2>\n<ul>\n<li><a href=\"#org.libjpegturbo\">org.libjpegturbo.*</a></li>\n</ul>\n</div>\n<div class=\"constantValuesContainer\"><a name=\"org.libjpegturbo\">\n<!--   -->\n</a>\n<h2 title=\"org.libjpegturbo\">org.libjpegturbo.*</h2>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Constant Field Values table, listing constant fields, and values\">\n<caption><span>org.libjpegturbo.turbojpeg.<a href=\"org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th scope=\"col\">Constant Field</th>\n<th class=\"colLast\" scope=\"col\">Value</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.CS_CMYK\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#CS_CMYK\">CS_CMYK</a></code></td>\n<td class=\"colLast\"><code>3</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.CS_GRAY\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#CS_GRAY\">CS_GRAY</a></code></td>\n<td class=\"colLast\"><code>2</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.CS_RGB\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#CS_RGB\">CS_RGB</a></code></td>\n<td class=\"colLast\"><code>0</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.CS_YCbCr\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr\">CS_YCbCr</a></code></td>\n<td class=\"colLast\"><code>1</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.CS_YCCK\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK\">CS_YCCK</a></code></td>\n<td class=\"colLast\"><code>4</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.FLAG_ACCURATEDCT\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT\">FLAG_ACCURATEDCT</a></code></td>\n<td class=\"colLast\"><code>4096</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.FLAG_BOTTOMUP\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\">FLAG_BOTTOMUP</a></code></td>\n<td class=\"colLast\"><code>2</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.FLAG_FASTDCT\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT\">FLAG_FASTDCT</a></code></td>\n<td class=\"colLast\"><code>2048</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.FLAG_FASTUPSAMPLE\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE\">FLAG_FASTUPSAMPLE</a></code></td>\n<td class=\"colLast\"><code>256</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX\">FLAG_FORCEMMX</a></code></td>\n<td class=\"colLast\"><code>8</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE\">FLAG_FORCESSE</a></code></td>\n<td class=\"colLast\"><code>16</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2\">FLAG_FORCESSE2</a></code></td>\n<td class=\"colLast\"><code>32</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3\">FLAG_FORCESSE3</a></code></td>\n<td class=\"colLast\"><code>128</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.NUMCS\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#NUMCS\">NUMCS</a></code></td>\n<td class=\"colLast\"><code>5</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.NUMPF\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#NUMPF\">NUMPF</a></code></td>\n<td class=\"colLast\"><code>12</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.NUMSAMP\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#NUMSAMP\">NUMSAMP</a></code></td>\n<td class=\"colLast\"><code>6</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.PF_ABGR\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR\">PF_ABGR</a></code></td>\n<td class=\"colLast\"><code>9</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.PF_ARGB\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB\">PF_ARGB</a></code></td>\n<td class=\"colLast\"><code>10</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.PF_BGR\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#PF_BGR\">PF_BGR</a></code></td>\n<td class=\"colLast\"><code>1</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.PF_BGRA\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA\">PF_BGRA</a></code></td>\n<td class=\"colLast\"><code>8</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.PF_BGRX\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX\">PF_BGRX</a></code></td>\n<td class=\"colLast\"><code>3</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.PF_CMYK\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#PF_CMYK\">PF_CMYK</a></code></td>\n<td class=\"colLast\"><code>11</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.PF_GRAY\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#PF_GRAY\">PF_GRAY</a></code></td>\n<td class=\"colLast\"><code>6</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.PF_RGB\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#PF_RGB\">PF_RGB</a></code></td>\n<td class=\"colLast\"><code>0</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.PF_RGBA\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA\">PF_RGBA</a></code></td>\n<td class=\"colLast\"><code>7</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.PF_RGBX\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX\">PF_RGBX</a></code></td>\n<td class=\"colLast\"><code>2</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.PF_XBGR\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR\">PF_XBGR</a></code></td>\n<td class=\"colLast\"><code>4</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.PF_XRGB\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB\">PF_XRGB</a></code></td>\n<td class=\"colLast\"><code>5</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.SAMP_411\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#SAMP_411\">SAMP_411</a></code></td>\n<td class=\"colLast\"><code>5</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.SAMP_420\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#SAMP_420\">SAMP_420</a></code></td>\n<td class=\"colLast\"><code>2</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.SAMP_422\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#SAMP_422\">SAMP_422</a></code></td>\n<td class=\"colLast\"><code>1</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.SAMP_440\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#SAMP_440\">SAMP_440</a></code></td>\n<td class=\"colLast\"><code>4</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.SAMP_444\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#SAMP_444\">SAMP_444</a></code></td>\n<td class=\"colLast\"><code>0</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJ.SAMP_GRAY\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJ.html#SAMP_GRAY\">SAMP_GRAY</a></code></td>\n<td class=\"colLast\"><code>3</code></td>\n</tr>\n</tbody>\n</table>\n</li>\n<li class=\"blockList\">\n<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Constant Field Values table, listing constant fields, and values\">\n<caption><span>org.libjpegturbo.turbojpeg.<a href=\"org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th scope=\"col\">Constant Field</th>\n<th class=\"colLast\" scope=\"col\">Value</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJTransform.NUMOP\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html#NUMOP\">NUMOP</a></code></td>\n<td class=\"colLast\"><code>8</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJTransform.OP_HFLIP\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html#OP_HFLIP\">OP_HFLIP</a></code></td>\n<td class=\"colLast\"><code>1</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJTransform.OP_NONE\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html#OP_NONE\">OP_NONE</a></code></td>\n<td class=\"colLast\"><code>0</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJTransform.OP_ROT180\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT180\">OP_ROT180</a></code></td>\n<td class=\"colLast\"><code>6</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJTransform.OP_ROT270\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT270\">OP_ROT270</a></code></td>\n<td class=\"colLast\"><code>7</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJTransform.OP_ROT90\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT90\">OP_ROT90</a></code></td>\n<td class=\"colLast\"><code>5</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSPOSE\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSPOSE\">OP_TRANSPOSE</a></code></td>\n<td class=\"colLast\"><code>3</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSVERSE\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSVERSE\">OP_TRANSVERSE</a></code></td>\n<td class=\"colLast\"><code>4</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJTransform.OP_VFLIP\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html#OP_VFLIP\">OP_VFLIP</a></code></td>\n<td class=\"colLast\"><code>2</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJTransform.OPT_CROP\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP\">OPT_CROP</a></code></td>\n<td class=\"colLast\"><code>4</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJTransform.OPT_GRAY\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html#OPT_GRAY\">OPT_GRAY</a></code></td>\n<td class=\"colLast\"><code>8</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJTransform.OPT_NOOUTPUT\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT\">OPT_NOOUTPUT</a></code></td>\n<td class=\"colLast\"><code>16</code></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJTransform.OPT_PERFECT\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT\">OPT_PERFECT</a></code></td>\n<td class=\"colLast\"><code>1</code></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a name=\"org.libjpegturbo.turbojpeg.TJTransform.OPT_TRIM\">\n<!--   -->\n</a><code>public&nbsp;static&nbsp;final&nbsp;int</code></td>\n<td><code><a href=\"org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM\">OPT_TRIM</a></code></td>\n<td class=\"colLast\"><code>2</code></td>\n</tr>\n</tbody>\n</table>\n</li>\n</ul>\n</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li><a href=\"org/libjpegturbo/turbojpeg/package-tree.html\">Tree</a></li>\n<li><a href=\"deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"index-all.html\">Index</a></li>\n<li><a href=\"help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"index.html?constant-values.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"constant-values.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/deprecated-list.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>Deprecated List</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"Deprecated List\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li><a href=\"org/libjpegturbo/turbojpeg/package-tree.html\">Tree</a></li>\n<li class=\"navBarCell1Rev\">Deprecated</li>\n<li><a href=\"index-all.html\">Index</a></li>\n<li><a href=\"help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"index.html?deprecated-list.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"deprecated-list.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h1 title=\"Deprecated API\" class=\"title\">Deprecated API</h1>\n<h2 title=\"Contents\">Contents</h2>\n<ul>\n<li><a href=\"#field\">Deprecated Fields</a></li>\n<li><a href=\"#method\">Deprecated Methods</a></li>\n<li><a href=\"#constructor\">Deprecated Constructors</a></li>\n</ul>\n</div>\n<div class=\"contentContainer\"><a name=\"field\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Deprecated Fields table, listing deprecated fields, and an explanation\">\n<caption><span>Deprecated Fields</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Field and Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX\">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX</a></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE\">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE</a></td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2\">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2</a></td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3\">org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3</a></td>\n</tr>\n</tbody>\n</table>\n</li>\n</ul>\n<a name=\"method\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Deprecated Methods table, listing deprecated methods, and an explanation\">\n<caption><span>Deprecated Methods</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Method and Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int)\">org.libjpegturbo.turbojpeg.TJ.bufSizeYUV(int, int, int)</a>\n<div class=\"block\"><i>Use <a href=\"org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)\"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20byte[],%20int)\">org.libjpegturbo.turbojpeg.TJCompressor.compress(BufferedImage, byte[], int)</a>\n<div class=\"block\"><i>Use\n <a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)\"><code>TJCompressor.compress(byte[], int)</code></a> instead.</i></div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20int)\">org.libjpegturbo.turbojpeg.TJCompressor.compress(BufferedImage, int)</a>\n<div class=\"block\"><i>Use\n <a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)\"><code>TJCompressor.compress(int)</code></a> instead.</i></div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)\">org.libjpegturbo.turbojpeg.TJDecompressor.decompress(byte[], int, int, int, int, int)</a>\n<div class=\"block\"><i>Use\n <a href=\"org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)\"><code>TJDecompressor.decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)\">org.libjpegturbo.turbojpeg.TJDecompressor.decompressToYUV(byte[], int)</a>\n<div class=\"block\"><i>Use <a href=\"org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)\"><code>TJDecompressor.decompressToYUV(YUVImage, int)</code></a> instead.</i></div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)\">org.libjpegturbo.turbojpeg.TJDecompressor.decompressToYUV(int)</a>\n<div class=\"block\"><i>Use <a href=\"org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)\"><code>TJDecompressor.decompressToYUV(int, int, int, int)</code></a> instead.</i></div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20byte[],%20int)\">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(BufferedImage, byte[], int)</a>\n<div class=\"block\"><i>Use\n <a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)\"><code>TJCompressor.encodeYUV(byte[], int)</code></a> instead.</i></div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20int)\">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(BufferedImage, int)</a>\n<div class=\"block\"><i>Use\n <a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)\"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)\">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(byte[], int)</a>\n<div class=\"block\"><i>Use <a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)\"><code>TJCompressor.encodeYUV(YUVImage, int)</code></a> instead.</i></div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)\">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(int)</a>\n<div class=\"block\"><i>Use <a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)\"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)\">org.libjpegturbo.turbojpeg.TJDecompressor.setJPEGImage(byte[], int)</a>\n<div class=\"block\"><i>Use <a href=\"org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)\"><code>TJDecompressor.setSourceImage(byte[], int)</code></a> instead.</i></div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int)\">org.libjpegturbo.turbojpeg.TJCompressor.setSourceImage(byte[], int, int, int, int)</a>\n<div class=\"block\"><i>Use\n <a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\"><code>TJCompressor.setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>\n</td>\n</tr>\n</tbody>\n</table>\n</li>\n</ul>\n<a name=\"constructor\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Deprecated Constructors table, listing deprecated constructors, and an explanation\">\n<caption><span>Deprecated Constructors</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Constructor and Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colOne\"><a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int)\">org.libjpegturbo.turbojpeg.TJCompressor(byte[], int, int, int, int)</a>\n<div class=\"block\"><i>Use\n <a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\"><code>TJCompressor.TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>\n</td>\n</tr>\n</tbody>\n</table>\n</li>\n</ul>\n</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li><a href=\"org/libjpegturbo/turbojpeg/package-tree.html\">Tree</a></li>\n<li class=\"navBarCell1Rev\">Deprecated</li>\n<li><a href=\"index-all.html\">Index</a></li>\n<li><a href=\"help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"index.html?deprecated-list.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"deprecated-list.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/help-doc.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>API Help</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"API Help\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li><a href=\"org/libjpegturbo/turbojpeg/package-tree.html\">Tree</a></li>\n<li><a href=\"deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"index-all.html\">Index</a></li>\n<li class=\"navBarCell1Rev\">Help</li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"index.html?help-doc.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"help-doc.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h1 class=\"title\">How This API Document Is Organized</h1>\n<div class=\"subTitle\">This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.</div>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h2>Package</h2>\n<p>Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:</p>\n<ul>\n<li>Interfaces (italic)</li>\n<li>Classes</li>\n<li>Enums</li>\n<li>Exceptions</li>\n<li>Errors</li>\n<li>Annotation Types</li>\n</ul>\n</li>\n<li class=\"blockList\">\n<h2>Class/Interface</h2>\n<p>Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:</p>\n<ul>\n<li>Class inheritance diagram</li>\n<li>Direct Subclasses</li>\n<li>All Known Subinterfaces</li>\n<li>All Known Implementing Classes</li>\n<li>Class/interface declaration</li>\n<li>Class/interface description</li>\n</ul>\n<ul>\n<li>Nested Class Summary</li>\n<li>Field Summary</li>\n<li>Constructor Summary</li>\n<li>Method Summary</li>\n</ul>\n<ul>\n<li>Field Detail</li>\n<li>Constructor Detail</li>\n<li>Method Detail</li>\n</ul>\n<p>Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</p>\n</li>\n<li class=\"blockList\">\n<h2>Annotation Type</h2>\n<p>Each annotation type has its own separate page with the following sections:</p>\n<ul>\n<li>Annotation Type declaration</li>\n<li>Annotation Type description</li>\n<li>Required Element Summary</li>\n<li>Optional Element Summary</li>\n<li>Element Detail</li>\n</ul>\n</li>\n<li class=\"blockList\">\n<h2>Enum</h2>\n<p>Each enum has its own separate page with the following sections:</p>\n<ul>\n<li>Enum declaration</li>\n<li>Enum description</li>\n<li>Enum Constant Summary</li>\n<li>Enum Constant Detail</li>\n</ul>\n</li>\n<li class=\"blockList\">\n<h2>Tree (Class Hierarchy)</h2>\n<p>There is a <a href=\"overview-tree.html\">Class Hierarchy</a> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.</p>\n<ul>\n<li>When viewing the Overview page, clicking on \"Tree\" displays the hierarchy for all packages.</li>\n<li>When viewing a particular package, class or interface page, clicking \"Tree\" displays the hierarchy for only that package.</li>\n</ul>\n</li>\n<li class=\"blockList\">\n<h2>Deprecated API</h2>\n<p>The <a href=\"deprecated-list.html\">Deprecated API</a> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</p>\n</li>\n<li class=\"blockList\">\n<h2>Index</h2>\n<p>The <a href=\"index-all.html\">Index</a> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</p>\n</li>\n<li class=\"blockList\">\n<h2>Prev/Next</h2>\n<p>These links take you to the next or previous class, interface, package, or related page.</p>\n</li>\n<li class=\"blockList\">\n<h2>Frames/No Frames</h2>\n<p>These links show and hide the HTML frames.  All pages are available with or without frames.</p>\n</li>\n<li class=\"blockList\">\n<h2>All Classes</h2>\n<p>The <a href=\"allclasses-noframe.html\">All Classes</a> link shows all classes and interfaces except non-static nested types.</p>\n</li>\n<li class=\"blockList\">\n<h2>Serialized Form</h2>\n<p>Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking \"Serialized Form\" in the \"See also\" section of the class description.</p>\n</li>\n<li class=\"blockList\">\n<h2>Constant Field Values</h2>\n<p>The <a href=\"constant-values.html\">Constant Field Values</a> page lists the static final fields and their values.</p>\n</li>\n</ul>\n<em>This help file applies to API documentation generated using the standard doclet.</em></div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li><a href=\"org/libjpegturbo/turbojpeg/package-tree.html\">Tree</a></li>\n<li><a href=\"deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"index-all.html\">Index</a></li>\n<li class=\"navBarCell1Rev\">Help</li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"index.html?help-doc.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"help-doc.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/index-all.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>Index</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"./stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"Index\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"./org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li><a href=\"./org/libjpegturbo/turbojpeg/package-tree.html\">Tree</a></li>\n<li><a href=\"./deprecated-list.html\">Deprecated</a></li>\n<li class=\"navBarCell1Rev\">Index</li>\n<li><a href=\"./help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"./index.html?index-all.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"index-all.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"./allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"contentContainer\"><a href=\"#_B_\">B</a>&nbsp;<a href=\"#_C_\">C</a>&nbsp;<a href=\"#_D_\">D</a>&nbsp;<a href=\"#_E_\">E</a>&nbsp;<a href=\"#_F_\">F</a>&nbsp;<a href=\"#_G_\">G</a>&nbsp;<a href=\"#_H_\">H</a>&nbsp;<a href=\"#_I_\">I</a>&nbsp;<a href=\"#_J_\">J</a>&nbsp;<a href=\"#_N_\">N</a>&nbsp;<a href=\"#_O_\">O</a>&nbsp;<a href=\"#_P_\">P</a>&nbsp;<a href=\"#_S_\">S</a>&nbsp;<a href=\"#_T_\">T</a>&nbsp;<a href=\"#_Y_\">Y</a>&nbsp;<a name=\"_B_\">\n<!--   -->\n</a>\n<h2 class=\"title\">B</h2>\n<dl>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#bufSize(int,%20int,%20int)\">bufSize(int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">Returns the maximum size of the buffer (in bytes) required to hold a JPEG\n image with the given width, height, and level of chrominance subsampling.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)\">bufSizeYUV(int, int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">Returns the size of the buffer (in bytes) required to hold a YUV planar\n image with the given width, height, and level of chrominance subsampling.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int)\">bufSizeYUV(int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>\n<div class=\"block\"><i>Use <a href=\"./org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)\"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>\n</div>\n</dd>\n</dl>\n<a name=\"_C_\">\n<!--   -->\n</a>\n<h2 class=\"title\">C</h2>\n<dl>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#cf\">cf</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">Custom filter instance</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#close()\">close()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\">Free the native structures associated with this compressor instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#close()\">close()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Free the native structures associated with this decompressor instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)\">compress(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\">Compress the uncompressed source image associated with this compressor\n instance and output a JPEG image to the given destination buffer.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)\">compress(int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\">Compress the uncompressed source image associated with this compressor\n instance and return a buffer containing a JPEG image.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20byte[],%20int)\">compress(BufferedImage, byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>\n<div class=\"block\"><i>Use\n <a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)\"><code>TJCompressor.compress(byte[], int)</code></a> instead.</i></div>\n</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20int)\">compress(BufferedImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>\n<div class=\"block\"><i>Use\n <a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)\"><code>TJCompressor.compress(int)</code></a> instead.</i></div>\n</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#CS_CMYK\">CS_CMYK</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">CMYK colorspace.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#CS_GRAY\">CS_GRAY</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">Grayscale colorspace.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#CS_RGB\">CS_RGB</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">RGB colorspace.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr\">CS_YCbCr</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">YCbCr colorspace.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK\">CS_YCCK</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">YCCK colorspace.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCustomFilter.html#customFilter(java.nio.ShortBuffer,%20java.awt.Rectangle,%20java.awt.Rectangle,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJTransform)\">customFilter(ShortBuffer, Rectangle, Rectangle, int, int, TJTransform)</a></span> - Method in interface org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\">TJCustomFilter</a></dt>\n<dd>\n<div class=\"block\">A callback function that can be used to modify the DCT coefficients after\n they are losslessly transformed but before they are transcoded to a new\n JPEG image.</div>\n</dd>\n</dl>\n<a name=\"_D_\">\n<!--   -->\n</a>\n<h2 class=\"title\">D</h2>\n<dl>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)\">decompress(byte[], int, int, int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Decompress the JPEG source image or decode the YUV source image associated\n with this decompressor instance and output a grayscale, RGB, or CMYK image\n to the given destination buffer.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)\">decompress(byte[], int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>\n<div class=\"block\"><i>Use\n <a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)\"><code>TJDecompressor.decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>\n</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int,%20int)\">decompress(int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Decompress the JPEG source image associated with this decompressor\n instance and return a buffer containing the decompressed image.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)\">decompress(int[], int, int, int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Decompress the JPEG source image or decode the YUV source image associated\n with this decompressor instance and output a grayscale, RGB, or CMYK image\n to the given destination buffer.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage,%20int)\">decompress(BufferedImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Decompress the JPEG source image or decode the YUV source image associated\n with this decompressor instance and output a decompressed/decoded image to\n the given <code>BufferedImage</code> instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int)\">decompress(int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Decompress the JPEG source image or decode the YUV source image associated\n with this decompressor instance and return a <code>BufferedImage</code>\n instance containing the decompressed/decoded image.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)\">decompressToYUV(YUVImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Decompress the JPEG source image associated with this decompressor\n instance into a YUV planar image and store it in the given\n <code>YUVImage</code> instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)\">decompressToYUV(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>\n<div class=\"block\"><i>Use <a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)\"><code>TJDecompressor.decompressToYUV(YUVImage, int)</code></a> instead.</i></div>\n</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int[],%20int,%20int)\">decompressToYUV(int, int[], int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Decompress the JPEG source image associated with this decompressor\n instance into a set of Y, U (Cb), and V (Cr) image planes and return a\n <code>YUVImage</code> instance containing the decompressed image planes.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)\">decompressToYUV(int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Decompress the JPEG source image associated with this decompressor\n instance into a unified YUV planar image buffer and return a\n <code>YUVImage</code> instance containing the decompressed image.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)\">decompressToYUV(int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>\n<div class=\"block\"><i>Use <a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)\"><code>TJDecompressor.decompressToYUV(int, int, int, int)</code></a> instead.</i></div>\n</div>\n</dd>\n</dl>\n<a name=\"_E_\">\n<!--   -->\n</a>\n<h2 class=\"title\">E</h2>\n<dl>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)\">encodeYUV(YUVImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\">Encode the uncompressed source image associated with this compressor\n instance into a YUV planar image and store it in the given\n <code>YUVImage</code> instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)\">encodeYUV(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>\n<div class=\"block\"><i>Use <a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)\"><code>TJCompressor.encodeYUV(YUVImage, int)</code></a> instead.</i></div>\n</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)\">encodeYUV(int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\">Encode the uncompressed source image associated with this compressor\n instance into a unified YUV planar image buffer and return a\n <code>YUVImage</code> instance containing the encoded image.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int[],%20int)\">encodeYUV(int[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\">Encode the uncompressed source image associated with this compressor\n instance into separate Y, U (Cb), and V (Cr) image planes and return a\n <code>YUVImage</code> instance containing the encoded image planes.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)\">encodeYUV(int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>\n<div class=\"block\"><i>Use <a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)\"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div>\n</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20byte[],%20int)\">encodeYUV(BufferedImage, byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>\n<div class=\"block\"><i>Use\n <a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)\"><code>TJCompressor.encodeYUV(byte[], int)</code></a> instead.</i></div>\n</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20int)\">encodeYUV(BufferedImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>\n<div class=\"block\"><i>Use\n <a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)\"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div>\n</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJScalingFactor.html#equals(org.libjpegturbo.turbojpeg.TJScalingFactor)\">equals(TJScalingFactor)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJScalingFactor</a></dt>\n<dd>\n<div class=\"block\">Returns true or false, depending on whether this instance and\n <code>other</code> have the same numerator and denominator.</div>\n</dd>\n</dl>\n<a name=\"_F_\">\n<!--   -->\n</a>\n<h2 class=\"title\">F</h2>\n<dl>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#finalize()\">finalize()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()\">finalize()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT\">FLAG_ACCURATEDCT</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">Use the most accurate DCT/IDCT algorithm available in the underlying\n codec.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\">FLAG_BOTTOMUP</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">The uncompressed source/destination image is stored in bottom-up (Windows,\n OpenGL) order, not top-down (X11) order.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT\">FLAG_FASTDCT</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">Use the fastest DCT/IDCT algorithm available in the underlying codec.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE\">FLAG_FASTUPSAMPLE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">When decompressing an image that was compressed using chrominance\n subsampling, use the fastest chrominance upsampling algorithm available in\n the underlying codec.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX\">FLAG_FORCEMMX</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span></div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE\">FLAG_FORCESSE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span></div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2\">FLAG_FORCESSE2</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span></div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3\">FLAG_FORCESSE3</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span></div>\n</dd>\n</dl>\n<a name=\"_G_\">\n<!--   -->\n</a>\n<h2 class=\"title\">G</h2>\n<dl>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#getBlueOffset(int)\">getBlueOffset(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">For the given pixel format, returns the number of bytes that the blue\n component is offset from the start of the pixel.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#getBuf()\">getBuf()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>\n<div class=\"block\">Returns the YUV image buffer (if this image is stored in a unified\n buffer rather than separate image planes.)</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()\">getColorspace()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Returns the colorspace used in the source image (JPEG or YUV) associated\n with this decompressor instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()\">getCompressedSize()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\">Returns the size of the image (in bytes) generated by the most recent\n compress operation.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJScalingFactor.html#getDenom()\">getDenom()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJScalingFactor</a></dt>\n<dd>\n<div class=\"block\">Returns denominator</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#getGreenOffset(int)\">getGreenOffset(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">For the given pixel format, returns the number of bytes that the green\n component is offset from the start of the pixel.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()\">getHeight()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Returns the height of the source image (JPEG or YUV) associated with this\n decompressor instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#getHeight()\">getHeight()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>\n<div class=\"block\">Returns the height of the YUV image (or subregion.)</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()\">getJPEGBuf()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Returns the JPEG image buffer associated with this decompressor instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()\">getJPEGSize()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Returns the size of the JPEG image (in bytes) associated with this\n decompressor instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#getMCUHeight(int)\">getMCUHeight(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">Returns the MCU block height for the given level of chrominance\n subsampling.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#getMCUWidth(int)\">getMCUWidth(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">Returns the MCU block width for the given level of chrominance\n subsampling.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJScalingFactor.html#getNum()\">getNum()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJScalingFactor</a></dt>\n<dd>\n<div class=\"block\">Returns numerator</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#getOffsets()\">getOffsets()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>\n<div class=\"block\">Returns the offsets (in bytes) of each plane within the planes of a larger\n YUV image.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#getPad()\">getPad()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>\n<div class=\"block\">Returns the line padding used in the YUV image buffer (if this image is\n stored in a unified buffer rather than separate image planes.)</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#getPixelSize(int)\">getPixelSize(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">Returns the pixel size (in bytes) for the given pixel format.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#getPlanes()\">getPlanes()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>\n<div class=\"block\">Returns the YUV image planes.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#getRedOffset(int)\">getRedOffset(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">For the given pixel format, returns the number of bytes that the red\n component is offset from the start of the pixel.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)\">getScaled(int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJScalingFactor</a></dt>\n<dd>\n<div class=\"block\">Returns the scaled value of <code>dimension</code>.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)\">getScaledHeight(int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Returns the height of the largest scaled-down image that the TurboJPEG\n decompressor can generate without exceeding the desired image width and\n height.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)\">getScaledWidth(int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Returns the width of the largest scaled-down image that the TurboJPEG\n decompressor can generate without exceeding the desired image width and\n height.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()\">getScalingFactors()</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">Returns a list of fractional scaling factors that the JPEG decompressor in\n this implementation of TurboJPEG supports.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#getSize()\">getSize()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>\n<div class=\"block\">Returns the size (in bytes) of the YUV image buffer (if this image is\n stored in a unified buffer rather than separate image planes.)</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#getStrides()\">getStrides()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>\n<div class=\"block\">Returns the number of bytes per line of each plane in the YUV image.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()\">getSubsamp()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Returns the level of chrominance subsampling used in the source image\n (JPEG or YUV) associated with this decompressor instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#getSubsamp()\">getSubsamp()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>\n<div class=\"block\">Returns the level of chrominance subsampling used in the YUV image.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransformer.html#getTransformedSizes()\">getTransformedSizes()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransformer</a></dt>\n<dd>\n<div class=\"block\">Returns an array containing the sizes of the transformed JPEG images\n generated by the most recent transform operation.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()\">getWidth()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Returns the width of the source image (JPEG or YUV) associated with this\n decompressor instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#getWidth()\">getWidth()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>\n<div class=\"block\">Returns the width of the YUV image (or subregion.)</div>\n</dd>\n</dl>\n<a name=\"_H_\">\n<!--   -->\n</a>\n<h2 class=\"title\">H</h2>\n<dl>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#handle\">handle</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#handle\">handle</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>&nbsp;</dd>\n</dl>\n<a name=\"_I_\">\n<!--   -->\n</a>\n<h2 class=\"title\">I</h2>\n<dl>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJScalingFactor.html#isOne()\">isOne()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJScalingFactor</a></dt>\n<dd>\n<div class=\"block\">Returns true or false, depending on whether this instance is equal to\n 1/1.</div>\n</dd>\n</dl>\n<a name=\"_J_\">\n<!--   -->\n</a>\n<h2 class=\"title\">J</h2>\n<dl>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBuf\">jpegBuf</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize\">jpegBufSize</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegColorspace\">jpegColorspace</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegHeight\">jpegHeight</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegSubsamp\">jpegSubsamp</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegWidth\">jpegWidth</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>&nbsp;</dd>\n</dl>\n<a name=\"_N_\">\n<!--   -->\n</a>\n<h2 class=\"title\">N</h2>\n<dl>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#NUMCS\">NUMCS</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">The number of JPEG colorspaces</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#NUMOP\">NUMOP</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">The number of lossless transform operations</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#NUMPF\">NUMPF</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">The number of pixel formats</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#NUMSAMP\">NUMSAMP</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">The number of chrominance subsampling options</div>\n</dd>\n</dl>\n<a name=\"_O_\">\n<!--   -->\n</a>\n<h2 class=\"title\">O</h2>\n<dl>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#op\">op</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">Transform operation (one of <code>OP_*</code>)</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#OP_HFLIP\">OP_HFLIP</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">Flip (mirror) image horizontally.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#OP_NONE\">OP_NONE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">Do not transform the position of the image pixels.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT180\">OP_ROT180</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">Rotate image 180 degrees.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT270\">OP_ROT270</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">Rotate image counter-clockwise by 90 degrees.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT90\">OP_ROT90</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">Rotate image clockwise by 90 degrees.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSPOSE\">OP_TRANSPOSE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">Transpose image (flip/mirror along upper left to lower right axis).</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSVERSE\">OP_TRANSVERSE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">Transverse transpose image (flip/mirror along upper right to lower left\n axis).</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#OP_VFLIP\">OP_VFLIP</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">Flip (mirror) image vertically.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP\">OPT_CROP</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">This option will enable lossless cropping.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_GRAY\">OPT_GRAY</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">This option will discard the color data in the input image and produce\n a grayscale output image.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT\">OPT_NOOUTPUT</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">This option will prevent <a href=\"./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)\"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this\n particular transform.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT\">OPT_PERFECT</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">This option will cause <a href=\"./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)\"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not\n perfect.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM\">OPT_TRIM</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">This option will discard any partial MCU blocks that cannot be\n transformed.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#options\">options</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">Transform options (bitwise OR of one or more of <code>OPT_*</code>)</div>\n</dd>\n<dt><a href=\"./org/libjpegturbo/turbojpeg/package-summary.html\">org.libjpegturbo.turbojpeg</a> - package org.libjpegturbo.turbojpeg</dt>\n<dd>&nbsp;</dd>\n</dl>\n<a name=\"_P_\">\n<!--   -->\n</a>\n<h2 class=\"title\">P</h2>\n<dl>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR\">PF_ABGR</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">ABGR pixel format.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB\">PF_ARGB</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">ARGB pixel format.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#PF_BGR\">PF_BGR</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">BGR pixel format.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA\">PF_BGRA</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">BGRA pixel format.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX\">PF_BGRX</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">BGRX pixel format.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#PF_CMYK\">PF_CMYK</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">CMYK pixel format.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#PF_GRAY\">PF_GRAY</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">Grayscale pixel format.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#PF_RGB\">PF_RGB</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">RGB pixel format.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA\">PF_RGBA</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">RGBA pixel format.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX\">PF_RGBX</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">RGBX pixel format.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR\">PF_XBGR</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">XBGR pixel format.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB\">PF_XRGB</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">XRGB pixel format.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#planeHeight(int,%20int,%20int)\">planeHeight(int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">Returns the plane height of a YUV image plane with the given parameters.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#planeSizeYUV(int,%20int,%20int,%20int,%20int)\">planeSizeYUV(int, int, int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">Returns the size of the buffer (in bytes) required to hold a YUV image\n plane with the given parameters.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#planeWidth(int,%20int,%20int)\">planeWidth(int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">Returns the plane width of a YUV image plane with the given parameters.</div>\n</dd>\n</dl>\n<a name=\"_S_\">\n<!--   -->\n</a>\n<h2 class=\"title\">S</h2>\n<dl>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#SAMP_411\">SAMP_411</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">4:1:1 chrominance subsampling.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#SAMP_420\">SAMP_420</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">4:2:0 chrominance subsampling.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#SAMP_422\">SAMP_422</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">4:2:2 chrominance subsampling.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#SAMP_440\">SAMP_440</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">4:4:0 chrominance subsampling.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#SAMP_444\">SAMP_444</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">4:4:4 chrominance subsampling (no chrominance subsampling).</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#SAMP_GRAY\">SAMP_GRAY</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>\n<div class=\"block\">Grayscale.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[][],%20int[],%20int,%20int[],%20int,%20int)\">setBuf(byte[][], int[], int, int[], int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>\n<div class=\"block\">Assign a set of image planes to this <code>YUVImage</code> instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[],%20int,%20int,%20int,%20int)\">setBuf(byte[], int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>\n<div class=\"block\">Assign a unified image buffer to this <code>YUVImage</code> instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)\">setJPEGImage(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>\n<div class=\"block\"><i>Use <a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)\"><code>TJDecompressor.setSourceImage(byte[], int)</code></a> instead.</i></div>\n</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#setJPEGQuality(int)\">setJPEGQuality(int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\">Set the JPEG image quality level for subsequent compress operations.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\">setSourceImage(byte[], int, int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\">Associate an uncompressed RGB, grayscale, or CMYK source image with this\n compressor instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int)\">setSourceImage(byte[], int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>\n<div class=\"block\"><i>Use\n <a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\"><code>TJCompressor.setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>\n</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\">setSourceImage(BufferedImage, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\">Associate an uncompressed RGB or grayscale source image with this\n compressor instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)\">setSourceImage(YUVImage)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\">Associate an uncompressed YUV planar source image with this compressor\n instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)\">setSourceImage(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Associate the JPEG image of length <code>imageSize</code> bytes stored in\n <code>jpegImage</code> with this decompressor instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)\">setSourceImage(YUVImage)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Associate the specified YUV planar source image with this decompressor\n instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#setSubsamp(int)\">setSubsamp(int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\">Set the level of chrominance subsampling for subsequent compress/encode\n operations.</div>\n</dd>\n</dl>\n<a name=\"_T_\">\n<!--   -->\n</a>\n<h2 class=\"title\">T</h2>\n<dl>\n<dt><a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJ</span></a> - Class in <a href=\"./org/libjpegturbo/turbojpeg/package-summary.html\">org.libjpegturbo.turbojpeg</a></dt>\n<dd>\n<div class=\"block\">TurboJPEG utility class (cannot be instantiated)</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJ.html#TJ()\">TJ()</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></dt>\n<dd>&nbsp;</dd>\n<dt><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJCompressor</span></a> - Class in <a href=\"./org/libjpegturbo/turbojpeg/package-summary.html\">org.libjpegturbo.turbojpeg</a></dt>\n<dd>\n<div class=\"block\">TurboJPEG compressor</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor()\">TJCompressor()</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\">Create a TurboJPEG compressor instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\">TJCompressor(byte[], int, int, int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\">Create a TurboJPEG compressor instance and associate the uncompressed\n source image stored in <code>srcImage</code> with the newly created\n instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int)\">TJCompressor(byte[], int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>\n<div class=\"block\"><i>Use\n <a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\"><code>TJCompressor.TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>\n</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\">TJCompressor(BufferedImage, int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></dt>\n<dd>\n<div class=\"block\">Create a TurboJPEG compressor instance and associate the uncompressed\n source image stored in <code>srcImage</code> with the newly created\n instance.</div>\n</dd>\n<dt><a href=\"./org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJCustomFilter</span></a> - Interface in <a href=\"./org/libjpegturbo/turbojpeg/package-summary.html\">org.libjpegturbo.turbojpeg</a></dt>\n<dd>\n<div class=\"block\">Custom filter callback interface</div>\n</dd>\n<dt><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJDecompressor</span></a> - Class in <a href=\"./org/libjpegturbo/turbojpeg/package-summary.html\">org.libjpegturbo.turbojpeg</a></dt>\n<dd>\n<div class=\"block\">TurboJPEG decompressor</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor()\">TJDecompressor()</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Create a TurboJPEG decompresssor instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[])\">TJDecompressor(byte[])</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Create a TurboJPEG decompressor instance and associate the JPEG source\n image stored in <code>jpegImage</code> with the newly created instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[],%20int)\">TJDecompressor(byte[], int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Create a TurboJPEG decompressor instance and associate the JPEG source\n image of length <code>imageSize</code> bytes stored in\n <code>jpegImage</code> with the newly created instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(org.libjpegturbo.turbojpeg.YUVImage)\">TJDecompressor(YUVImage)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>\n<div class=\"block\">Create a TurboJPEG decompressor instance and associate the YUV planar\n source image stored in <code>yuvImage</code> with the newly created\n instance.</div>\n</dd>\n<dt><a href=\"./org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJException</span></a> - Exception in <a href=\"./org/libjpegturbo/turbojpeg/package-summary.html\">org.libjpegturbo.turbojpeg</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJException.html#TJException()\">TJException()</a></span> - Constructor for exception org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.String,%20java.lang.Throwable)\">TJException(String, Throwable)</a></span> - Constructor for exception org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.String)\">TJException(String)</a></span> - Constructor for exception org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.Throwable)\">TJException(Throwable)</a></span> - Constructor for exception org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></dt>\n<dd>&nbsp;</dd>\n<dt><a href=\"./org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJScalingFactor</span></a> - Class in <a href=\"./org/libjpegturbo/turbojpeg/package-summary.html\">org.libjpegturbo.turbojpeg</a></dt>\n<dd>\n<div class=\"block\">Fractional scaling factor</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJScalingFactor.html#TJScalingFactor(int,%20int)\">TJScalingFactor(int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJScalingFactor</a></dt>\n<dd>&nbsp;</dd>\n<dt><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJTransform</span></a> - Class in <a href=\"./org/libjpegturbo/turbojpeg/package-summary.html\">org.libjpegturbo.turbojpeg</a></dt>\n<dd>\n<div class=\"block\">Lossless transform parameters</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform()\">TJTransform()</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">Create a new lossless transform instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(int,%20int,%20int,%20int,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)\">TJTransform(int, int, int, int, int, int, TJCustomFilter)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">Create a new lossless transform instance with the given parameters.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(java.awt.Rectangle,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)\">TJTransform(Rectangle, int, int, TJCustomFilter)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></dt>\n<dd>\n<div class=\"block\">Create a new lossless transform instance with the given parameters.</div>\n</dd>\n<dt><a href=\"./org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJTransformer</span></a> - Class in <a href=\"./org/libjpegturbo/turbojpeg/package-summary.html\">org.libjpegturbo.turbojpeg</a></dt>\n<dd>\n<div class=\"block\">TurboJPEG lossless transformer</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer()\">TJTransformer()</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransformer</a></dt>\n<dd>\n<div class=\"block\">Create a TurboJPEG lossless transformer instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[])\">TJTransformer(byte[])</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransformer</a></dt>\n<dd>\n<div class=\"block\">Create a TurboJPEG lossless transformer instance and associate the JPEG\n image stored in <code>jpegImage</code> with the newly created instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[],%20int)\">TJTransformer(byte[], int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransformer</a></dt>\n<dd>\n<div class=\"block\">Create a TurboJPEG lossless transformer instance and associate the JPEG\n image of length <code>imageSize</code> bytes stored in\n <code>jpegImage</code> with the newly created instance.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)\">transform(byte[][], TJTransform[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransformer</a></dt>\n<dd>\n<div class=\"block\">Losslessly transform the JPEG image associated with this transformer\n instance into one or more JPEG images stored in the given destination\n buffers.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(org.libjpegturbo.turbojpeg.TJTransform[],%20int)\">transform(TJTransform[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransformer</a></dt>\n<dd>\n<div class=\"block\">Losslessly transform the JPEG image associated with this transformer\n instance and return an array of <a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>TJDecompressor</code></a> instances, each of\n which has a transformed JPEG image associated with it.</div>\n</dd>\n</dl>\n<a name=\"_Y_\">\n<!--   -->\n</a>\n<h2 class=\"title\">Y</h2>\n<dl>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#yuvHeight\">yuvHeight</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html#yuvImage\">yuvImage</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></dt>\n<dd>&nbsp;</dd>\n<dt><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">YUVImage</span></a> - Class in <a href=\"./org/libjpegturbo/turbojpeg/package-summary.html\">org.libjpegturbo.turbojpeg</a></dt>\n<dd>\n<div class=\"block\">This class encapsulates a YUV planar image and the metadata\n associated with it.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int,%20int[],%20int,%20int)\">YUVImage(int, int[], int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>\n<div class=\"block\">Create a new <code>YUVImage</code> instance backed by separate image\n planes, and allocate memory for the image planes.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int,%20int,%20int,%20int)\">YUVImage(int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>\n<div class=\"block\">Create a new <code>YUVImage</code> instance backed by a unified image\n buffer, and allocate memory for the image buffer.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[][],%20int[],%20int,%20int[],%20int,%20int)\">YUVImage(byte[][], int[], int, int[], int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>\n<div class=\"block\">Create a new <code>YUVImage</code> instance from a set of existing image\n planes.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[],%20int,%20int,%20int,%20int)\">YUVImage(byte[], int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>\n<div class=\"block\">Create a new <code>YUVImage</code> instance from an existing unified image\n buffer.</div>\n</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#yuvOffsets\">yuvOffsets</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#yuvPad\">yuvPad</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#yuvPlanes\">yuvPlanes</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#yuvStrides\">yuvStrides</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#yuvSubsamp\">yuvSubsamp</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>&nbsp;</dd>\n<dt><span class=\"strong\"><a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html#yuvWidth\">yuvWidth</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href=\"./org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></dt>\n<dd>&nbsp;</dd>\n</dl>\n<a href=\"#_B_\">B</a>&nbsp;<a href=\"#_C_\">C</a>&nbsp;<a href=\"#_D_\">D</a>&nbsp;<a href=\"#_E_\">E</a>&nbsp;<a href=\"#_F_\">F</a>&nbsp;<a href=\"#_G_\">G</a>&nbsp;<a href=\"#_H_\">H</a>&nbsp;<a href=\"#_I_\">I</a>&nbsp;<a href=\"#_J_\">J</a>&nbsp;<a href=\"#_N_\">N</a>&nbsp;<a href=\"#_O_\">O</a>&nbsp;<a href=\"#_P_\">P</a>&nbsp;<a href=\"#_S_\">S</a>&nbsp;<a href=\"#_T_\">T</a>&nbsp;<a href=\"#_Y_\">Y</a>&nbsp;</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"./org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li><a href=\"./org/libjpegturbo/turbojpeg/package-tree.html\">Tree</a></li>\n<li><a href=\"./deprecated-list.html\">Deprecated</a></li>\n<li class=\"navBarCell1Rev\">Index</li>\n<li><a href=\"./help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"./index.html?index-all.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"index-all.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"./allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/index.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>Generated Documentation (Untitled)</title>\n<script type=\"text/javascript\">\n    targetPage = \"\" + window.location.search;\n    if (targetPage != \"\" && targetPage != \"undefined\")\n        targetPage = targetPage.substring(1);\n    if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))\n        targetPage = \"undefined\";\n    function validURL(url) {\n        try {\n            url = decodeURIComponent(url);\n        }\n        catch (error) {\n            return false;\n        }\n        var pos = url.indexOf(\".html\");\n        if (pos == -1 || pos != url.length - 5)\n            return false;\n        var allowNumber = false;\n        var allowSep = false;\n        var seenDot = false;\n        for (var i = 0; i < url.length - 5; i++) {\n            var ch = url.charAt(i);\n            if ('a' <= ch && ch <= 'z' ||\n                    'A' <= ch && ch <= 'Z' ||\n                    ch == '$' ||\n                    ch == '_' ||\n                    ch.charCodeAt(0) > 127) {\n                allowNumber = true;\n                allowSep = true;\n            } else if ('0' <= ch && ch <= '9'\n                    || ch == '-') {\n                if (!allowNumber)\n                     return false;\n            } else if (ch == '/' || ch == '.') {\n                if (!allowSep)\n                    return false;\n                allowNumber = false;\n                allowSep = false;\n                if (ch == '.')\n                     seenDot = true;\n                if (ch == '/' && seenDot)\n                     return false;\n            } else {\n                return false;\n            }\n        }\n        return true;\n    }\n    function loadFrames() {\n        if (targetPage != \"\" && targetPage != \"undefined\")\n             top.classFrame.location = top.targetPage;\n    }\n</script>\n</head>\n<frameset cols=\"20%,80%\" title=\"Documentation frame\" onload=\"top.loadFrames()\">\n<frame src=\"allclasses-frame.html\" name=\"packageFrame\" title=\"All classes and interfaces (except non-static nested types)\">\n<frame src=\"org/libjpegturbo/turbojpeg/package-summary.html\" name=\"classFrame\" title=\"Package, class and interface descriptions\" scrolling=\"yes\">\n<noframes>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<h2>Frame Alert</h2>\n<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href=\"org/libjpegturbo/turbojpeg/package-summary.html\">Non-frame version</a>.</p>\n</noframes>\n</frameset>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/org/libjpegturbo/turbojpeg/TJ.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>TJ</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"TJ\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev Class</li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJ.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJ.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li><a href=\"#field_summary\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li><a href=\"#field_detail\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<!-- ======== START OF CLASS DATA ======== -->\n<div class=\"header\">\n<div class=\"subTitle\">org.libjpegturbo.turbojpeg</div>\n<h2 title=\"Class TJ\" class=\"title\">Class TJ</h2>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"inheritance\">\n<li>java.lang.Object</li>\n<li>\n<ul class=\"inheritance\">\n<li>org.libjpegturbo.turbojpeg.TJ</li>\n</ul>\n</li>\n</ul>\n<div class=\"description\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<hr>\n<br>\n<pre>public final class <span class=\"strong\">TJ</span>\nextends java.lang.Object</pre>\n<div class=\"block\">TurboJPEG utility class (cannot be instantiated)</div>\n</li>\n</ul>\n</div>\n<div class=\"summary\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- =========== FIELD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"field_summary\">\n<!--   -->\n</a>\n<h3>Field Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Field Summary table, listing fields, and an explanation\">\n<caption><span>Fields</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Field and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#CS_CMYK\">CS_CMYK</a></strong></code>\n<div class=\"block\">CMYK colorspace.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#CS_GRAY\">CS_GRAY</a></strong></code>\n<div class=\"block\">Grayscale colorspace.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#CS_RGB\">CS_RGB</a></strong></code>\n<div class=\"block\">RGB colorspace.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr\">CS_YCbCr</a></strong></code>\n<div class=\"block\">YCbCr colorspace.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK\">CS_YCCK</a></strong></code>\n<div class=\"block\">YCCK colorspace.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT\">FLAG_ACCURATEDCT</a></strong></code>\n<div class=\"block\">Use the most accurate DCT/IDCT algorithm available in the underlying\n codec.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\">FLAG_BOTTOMUP</a></strong></code>\n<div class=\"block\">The uncompressed source/destination image is stored in bottom-up (Windows,\n OpenGL) order, not top-down (X11) order.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT\">FLAG_FASTDCT</a></strong></code>\n<div class=\"block\">Use the fastest DCT/IDCT algorithm available in the underlying codec.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE\">FLAG_FASTUPSAMPLE</a></strong></code>\n<div class=\"block\">When decompressing an image that was compressed using chrominance\n subsampling, use the fastest chrominance upsampling algorithm available in\n the underlying codec.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX\">FLAG_FORCEMMX</a></strong></code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE\">FLAG_FORCESSE</a></strong></code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2\">FLAG_FORCESSE2</a></strong></code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3\">FLAG_FORCESSE3</a></strong></code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#NUMCS\">NUMCS</a></strong></code>\n<div class=\"block\">The number of JPEG colorspaces</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#NUMPF\">NUMPF</a></strong></code>\n<div class=\"block\">The number of pixel formats</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#NUMSAMP\">NUMSAMP</a></strong></code>\n<div class=\"block\">The number of chrominance subsampling options</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR\">PF_ABGR</a></strong></code>\n<div class=\"block\">ABGR pixel format.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB\">PF_ARGB</a></strong></code>\n<div class=\"block\">ARGB pixel format.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGR\">PF_BGR</a></strong></code>\n<div class=\"block\">BGR pixel format.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA\">PF_BGRA</a></strong></code>\n<div class=\"block\">BGRA pixel format.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX\">PF_BGRX</a></strong></code>\n<div class=\"block\">BGRX pixel format.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_CMYK\">PF_CMYK</a></strong></code>\n<div class=\"block\">CMYK pixel format.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_GRAY\">PF_GRAY</a></strong></code>\n<div class=\"block\">Grayscale pixel format.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB\">PF_RGB</a></strong></code>\n<div class=\"block\">RGB pixel format.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA\">PF_RGBA</a></strong></code>\n<div class=\"block\">RGBA pixel format.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX\">PF_RGBX</a></strong></code>\n<div class=\"block\">RGBX pixel format.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR\">PF_XBGR</a></strong></code>\n<div class=\"block\">XBGR pixel format.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB\">PF_XRGB</a></strong></code>\n<div class=\"block\">XRGB pixel format.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_411\">SAMP_411</a></strong></code>\n<div class=\"block\">4:1:1 chrominance subsampling.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_420\">SAMP_420</a></strong></code>\n<div class=\"block\">4:2:0 chrominance subsampling.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_422\">SAMP_422</a></strong></code>\n<div class=\"block\">4:2:2 chrominance subsampling.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_440\">SAMP_440</a></strong></code>\n<div class=\"block\">4:4:0 chrominance subsampling.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444\">SAMP_444</a></strong></code>\n<div class=\"block\">4:4:4 chrominance subsampling (no chrominance subsampling).</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_GRAY\">SAMP_GRAY</a></strong></code>\n<div class=\"block\">Grayscale.</div>\n</td>\n</tr>\n</table>\n</li>\n</ul>\n<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_summary\">\n<!--   -->\n</a>\n<h3>Constructor Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Constructor Summary table, listing constructors, and an explanation\">\n<caption><span>Constructors</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Constructor and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#TJ()\">TJ</a></strong>()</code>&nbsp;</td>\n</tr>\n</table>\n</li>\n</ul>\n<!-- ========== METHOD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_summary\">\n<!--   -->\n</a>\n<h3>Method Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Method Summary table, listing methods, and an explanation\">\n<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Method and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int,%20int,%20int)\">bufSize</a></strong>(int&nbsp;width,\n       int&nbsp;height,\n       int&nbsp;jpegSubsamp)</code>\n<div class=\"block\">Returns the maximum size of the buffer (in bytes) required to hold a JPEG\n image with the given width, height, and level of chrominance subsampling.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int)\">bufSizeYUV</a></strong>(int&nbsp;width,\n          int&nbsp;height,\n          int&nbsp;subsamp)</code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;\n<div class=\"block\"><i>Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)\"><code>bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>\n</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)\">bufSizeYUV</a></strong>(int&nbsp;width,\n          int&nbsp;pad,\n          int&nbsp;height,\n          int&nbsp;subsamp)</code>\n<div class=\"block\">Returns the size of the buffer (in bytes) required to hold a YUV planar\n image with the given width, height, and level of chrominance subsampling.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#getBlueOffset(int)\">getBlueOffset</a></strong>(int&nbsp;pixelFormat)</code>\n<div class=\"block\">For the given pixel format, returns the number of bytes that the blue\n component is offset from the start of the pixel.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#getGreenOffset(int)\">getGreenOffset</a></strong>(int&nbsp;pixelFormat)</code>\n<div class=\"block\">For the given pixel format, returns the number of bytes that the green\n component is offset from the start of the pixel.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUHeight(int)\">getMCUHeight</a></strong>(int&nbsp;subsamp)</code>\n<div class=\"block\">Returns the MCU block height for the given level of chrominance\n subsampling.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUWidth(int)\">getMCUWidth</a></strong>(int&nbsp;subsamp)</code>\n<div class=\"block\">Returns the MCU block width for the given level of chrominance\n subsampling.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#getPixelSize(int)\">getPixelSize</a></strong>(int&nbsp;pixelFormat)</code>\n<div class=\"block\">Returns the pixel size (in bytes) for the given pixel format.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#getRedOffset(int)\">getRedOffset</a></strong>(int&nbsp;pixelFormat)</code>\n<div class=\"block\">For the given pixel format, returns the number of bytes that the red\n component is offset from the start of the pixel.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static <a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJScalingFactor</a>[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()\">getScalingFactors</a></strong>()</code>\n<div class=\"block\">Returns a list of fractional scaling factors that the JPEG decompressor in\n this implementation of TurboJPEG supports.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#planeHeight(int,%20int,%20int)\">planeHeight</a></strong>(int&nbsp;componentID,\n           int&nbsp;height,\n           int&nbsp;subsamp)</code>\n<div class=\"block\">Returns the plane height of a YUV image plane with the given parameters.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#planeSizeYUV(int,%20int,%20int,%20int,%20int)\">planeSizeYUV</a></strong>(int&nbsp;componentID,\n            int&nbsp;width,\n            int&nbsp;stride,\n            int&nbsp;height,\n            int&nbsp;subsamp)</code>\n<div class=\"block\">Returns the size of the buffer (in bytes) required to hold a YUV image\n plane with the given parameters.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#planeWidth(int,%20int,%20int)\">planeWidth</a></strong>(int&nbsp;componentID,\n          int&nbsp;width,\n          int&nbsp;subsamp)</code>\n<div class=\"block\">Returns the plane width of a YUV image plane with the given parameters.</div>\n</td>\n</tr>\n</table>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"methods_inherited_from_class_java.lang.Object\">\n<!--   -->\n</a>\n<h3>Methods inherited from class&nbsp;java.lang.Object</h3>\n<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"details\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ============ FIELD DETAIL =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"field_detail\">\n<!--   -->\n</a>\n<h3>Field Detail</h3>\n<a name=\"NUMSAMP\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>NUMSAMP</h4>\n<pre>public static final&nbsp;int NUMSAMP</pre>\n<div class=\"block\">The number of chrominance subsampling options</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.NUMSAMP\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"SAMP_444\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>SAMP_444</h4>\n<pre>public static final&nbsp;int SAMP_444</pre>\n<div class=\"block\">4:4:4 chrominance subsampling (no chrominance subsampling).  The JPEG\n or YUV image will contain one chrominance component for every pixel in the\n source image.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_444\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"SAMP_422\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>SAMP_422</h4>\n<pre>public static final&nbsp;int SAMP_422</pre>\n<div class=\"block\">4:2:2 chrominance subsampling.  The JPEG or YUV image will contain one\n chrominance component for every 2x1 block of pixels in the source image.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_422\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"SAMP_420\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>SAMP_420</h4>\n<pre>public static final&nbsp;int SAMP_420</pre>\n<div class=\"block\">4:2:0 chrominance subsampling.  The JPEG or YUV image will contain one\n chrominance component for every 2x2 block of pixels in the source image.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_420\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"SAMP_GRAY\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>SAMP_GRAY</h4>\n<pre>public static final&nbsp;int SAMP_GRAY</pre>\n<div class=\"block\">Grayscale.  The JPEG or YUV image will contain no chrominance components.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_GRAY\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"SAMP_440\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>SAMP_440</h4>\n<pre>public static final&nbsp;int SAMP_440</pre>\n<div class=\"block\">4:4:0 chrominance subsampling.  The JPEG or YUV image will contain one\n chrominance component for every 1x2 block of pixels in the source image.\n Note that 4:4:0 subsampling is not fully accelerated in libjpeg-turbo.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_440\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"SAMP_411\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>SAMP_411</h4>\n<pre>public static final&nbsp;int SAMP_411</pre>\n<div class=\"block\">4:1:1 chrominance subsampling.  The JPEG or YUV image will contain one\n chrominance component for every 4x1 block of pixels in the source image.\n JPEG images compressed with 4:1:1 subsampling will be almost exactly the\n same size as those compressed with 4:2:0 subsampling, and in the\n aggregate, both subsampling methods produce approximately the same\n perceptual quality.  However, 4:1:1 is better able to reproduce sharp\n horizontal features.  Note that 4:1:1 subsampling is not fully accelerated\n in libjpeg-turbo.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_411\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"NUMPF\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>NUMPF</h4>\n<pre>public static final&nbsp;int NUMPF</pre>\n<div class=\"block\">The number of pixel formats</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.NUMPF\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"PF_RGB\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>PF_RGB</h4>\n<pre>public static final&nbsp;int PF_RGB</pre>\n<div class=\"block\">RGB pixel format.  The red, green, and blue components in the image are\n stored in 3-byte pixels in the order R, G, B from lowest to highest byte\n address within each pixel.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_RGB\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"PF_BGR\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>PF_BGR</h4>\n<pre>public static final&nbsp;int PF_BGR</pre>\n<div class=\"block\">BGR pixel format.  The red, green, and blue components in the image are\n stored in 3-byte pixels in the order B, G, R from lowest to highest byte\n address within each pixel.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_BGR\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"PF_RGBX\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>PF_RGBX</h4>\n<pre>public static final&nbsp;int PF_RGBX</pre>\n<div class=\"block\">RGBX pixel format.  The red, green, and blue components in the image are\n stored in 4-byte pixels in the order R, G, B from lowest to highest byte\n address within each pixel.  The X component is ignored when compressing\n and undefined when decompressing.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_RGBX\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"PF_BGRX\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>PF_BGRX</h4>\n<pre>public static final&nbsp;int PF_BGRX</pre>\n<div class=\"block\">BGRX pixel format.  The red, green, and blue components in the image are\n stored in 4-byte pixels in the order B, G, R from lowest to highest byte\n address within each pixel.  The X component is ignored when compressing\n and undefined when decompressing.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_BGRX\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"PF_XBGR\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>PF_XBGR</h4>\n<pre>public static final&nbsp;int PF_XBGR</pre>\n<div class=\"block\">XBGR pixel format.  The red, green, and blue components in the image are\n stored in 4-byte pixels in the order R, G, B from highest to lowest byte\n address within each pixel.  The X component is ignored when compressing\n and undefined when decompressing.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_XBGR\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"PF_XRGB\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>PF_XRGB</h4>\n<pre>public static final&nbsp;int PF_XRGB</pre>\n<div class=\"block\">XRGB pixel format.  The red, green, and blue components in the image are\n stored in 4-byte pixels in the order B, G, R from highest to lowest byte\n address within each pixel.  The X component is ignored when compressing\n and undefined when decompressing.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_XRGB\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"PF_GRAY\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>PF_GRAY</h4>\n<pre>public static final&nbsp;int PF_GRAY</pre>\n<div class=\"block\">Grayscale pixel format.  Each 1-byte pixel represents a luminance\n (brightness) level from 0 to 255.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_GRAY\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"PF_RGBA\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>PF_RGBA</h4>\n<pre>public static final&nbsp;int PF_RGBA</pre>\n<div class=\"block\">RGBA pixel format.  This is the same as <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX\"><code>PF_RGBX</code></a>, except that when\n decompressing, the X byte is guaranteed to be 0xFF, which can be\n interpreted as an opaque alpha channel.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_RGBA\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"PF_BGRA\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>PF_BGRA</h4>\n<pre>public static final&nbsp;int PF_BGRA</pre>\n<div class=\"block\">BGRA pixel format.  This is the same as <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX\"><code>PF_BGRX</code></a>, except that when\n decompressing, the X byte is guaranteed to be 0xFF, which can be\n interpreted as an opaque alpha channel.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_BGRA\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"PF_ABGR\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>PF_ABGR</h4>\n<pre>public static final&nbsp;int PF_ABGR</pre>\n<div class=\"block\">ABGR pixel format.  This is the same as <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR\"><code>PF_XBGR</code></a>, except that when\n decompressing, the X byte is guaranteed to be 0xFF, which can be\n interpreted as an opaque alpha channel.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_ABGR\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"PF_ARGB\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>PF_ARGB</h4>\n<pre>public static final&nbsp;int PF_ARGB</pre>\n<div class=\"block\">ARGB pixel format.  This is the same as <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB\"><code>PF_XRGB</code></a>, except that when\n decompressing, the X byte is guaranteed to be 0xFF, which can be\n interpreted as an opaque alpha channel.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_ARGB\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"PF_CMYK\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>PF_CMYK</h4>\n<pre>public static final&nbsp;int PF_CMYK</pre>\n<div class=\"block\">CMYK pixel format.  Unlike RGB, which is an additive color model used\n primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive\n color model used primarily for printing.  In the CMYK color model, the\n value of each color component typically corresponds to an amount of cyan,\n magenta, yellow, or black ink that is applied to a white background.  In\n order to convert between CMYK and RGB, it is necessary to use a color\n management system (CMS.)  A CMS will attempt to map colors within the\n printer's gamut to perceptually similar colors in the display's gamut and\n vice versa, but the mapping is typically not 1:1 or reversible, nor can it\n be defined with a simple formula.  Thus, such a conversion is out of scope\n for a codec library.  However, the TurboJPEG API allows for compressing\n CMYK pixels into a YCCK JPEG image (see <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK\"><code>CS_YCCK</code></a>) and\n decompressing YCCK JPEG images into CMYK pixels.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_CMYK\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"NUMCS\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>NUMCS</h4>\n<pre>public static final&nbsp;int NUMCS</pre>\n<div class=\"block\">The number of JPEG colorspaces</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.NUMCS\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"CS_RGB\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>CS_RGB</h4>\n<pre>public static final&nbsp;int CS_RGB</pre>\n<div class=\"block\">RGB colorspace.  When compressing the JPEG image, the R, G, and B\n components in the source image are reordered into image planes, but no\n colorspace conversion or subsampling is performed.  RGB JPEG images can be\n decompressed to any of the extended RGB pixel formats or grayscale, but\n they cannot be decompressed to YUV images.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.CS_RGB\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"CS_YCbCr\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>CS_YCbCr</h4>\n<pre>public static final&nbsp;int CS_YCbCr</pre>\n<div class=\"block\">YCbCr colorspace.  YCbCr is not an absolute colorspace but rather a\n mathematical transformation of RGB designed solely for storage and\n transmission.  YCbCr images must be converted to RGB before they can\n actually be displayed.  In the YCbCr colorspace, the Y (luminance)\n component represents the black & white portion of the original image, and\n the Cb and Cr (chrominance) components represent the color portion of the\n original image.  Originally, the analog equivalent of this transformation\n allowed the same signal to drive both black & white and color televisions,\n but JPEG images use YCbCr primarily because it allows the color data to be\n optionally subsampled for the purposes of reducing bandwidth or disk\n space.  YCbCr is the most common JPEG colorspace, and YCbCr JPEG images\n can be compressed from and decompressed to any of the extended RGB pixel\n formats or grayscale, or they can be decompressed to YUV planar images.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.CS_YCbCr\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"CS_GRAY\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>CS_GRAY</h4>\n<pre>public static final&nbsp;int CS_GRAY</pre>\n<div class=\"block\">Grayscale colorspace.  The JPEG image retains only the luminance data (Y\n component), and any color data from the source image is discarded.\n Grayscale JPEG images can be compressed from and decompressed to any of\n the extended RGB pixel formats or grayscale, or they can be decompressed\n to YUV planar images.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.CS_GRAY\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"CS_CMYK\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>CS_CMYK</h4>\n<pre>public static final&nbsp;int CS_CMYK</pre>\n<div class=\"block\">CMYK colorspace.  When compressing the JPEG image, the C, M, Y, and K\n components in the source image are reordered into image planes, but no\n colorspace conversion or subsampling is performed.  CMYK JPEG images can\n only be decompressed to CMYK pixels.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.CS_CMYK\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"CS_YCCK\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>CS_YCCK</h4>\n<pre>public static final&nbsp;int CS_YCCK</pre>\n<div class=\"block\">YCCK colorspace.  YCCK (AKA \"YCbCrK\") is not an absolute colorspace but\n rather a mathematical transformation of CMYK designed solely for storage\n and transmission.  It is to CMYK as YCbCr is to RGB.  CMYK pixels can be\n reversibly transformed into YCCK, and as with YCbCr, the chrominance\n components in the YCCK pixels can be subsampled without incurring major\n perceptual loss.  YCCK JPEG images can only be compressed from and\n decompressed to CMYK pixels.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.CS_YCCK\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"FLAG_BOTTOMUP\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>FLAG_BOTTOMUP</h4>\n<pre>public static final&nbsp;int FLAG_BOTTOMUP</pre>\n<div class=\"block\">The uncompressed source/destination image is stored in bottom-up (Windows,\n OpenGL) order, not top-down (X11) order.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_BOTTOMUP\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"FLAG_FORCEMMX\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>FLAG_FORCEMMX</h4>\n<pre>@Deprecated\npublic static final&nbsp;int FLAG_FORCEMMX</pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"FLAG_FORCESSE\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>FLAG_FORCESSE</h4>\n<pre>@Deprecated\npublic static final&nbsp;int FLAG_FORCESSE</pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"FLAG_FORCESSE2\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>FLAG_FORCESSE2</h4>\n<pre>@Deprecated\npublic static final&nbsp;int FLAG_FORCESSE2</pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"FLAG_FORCESSE3\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>FLAG_FORCESSE3</h4>\n<pre>@Deprecated\npublic static final&nbsp;int FLAG_FORCESSE3</pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"FLAG_FASTUPSAMPLE\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>FLAG_FASTUPSAMPLE</h4>\n<pre>public static final&nbsp;int FLAG_FASTUPSAMPLE</pre>\n<div class=\"block\">When decompressing an image that was compressed using chrominance\n subsampling, use the fastest chrominance upsampling algorithm available in\n the underlying codec.  The default is to use smooth upsampling, which\n creates a smooth transition between neighboring chrominance components in\n order to reduce upsampling artifacts in the decompressed image.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FASTUPSAMPLE\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"FLAG_FASTDCT\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>FLAG_FASTDCT</h4>\n<pre>public static final&nbsp;int FLAG_FASTDCT</pre>\n<div class=\"block\">Use the fastest DCT/IDCT algorithm available in the underlying codec.  The\n default if this flag is not specified is implementation-specific.  For\n example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast\n algorithm by default when compressing, because this has been shown to have\n only a very slight effect on accuracy, but it uses the accurate algorithm\n when decompressing, because this has been shown to have a larger effect.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FASTDCT\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"FLAG_ACCURATEDCT\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>FLAG_ACCURATEDCT</h4>\n<pre>public static final&nbsp;int FLAG_ACCURATEDCT</pre>\n<div class=\"block\">Use the most accurate DCT/IDCT algorithm available in the underlying\n codec.  The default if this flag is not specified is\n implementation-specific.  For example, the implementation of TurboJPEG for\n libjpeg[-turbo] uses the fast algorithm by default when compressing,\n because this has been shown to have only a very slight effect on accuracy,\n but it uses the accurate algorithm when decompressing, because this has\n been shown to have a larger effect.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_ACCURATEDCT\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n</li>\n</ul>\n<!-- ========= CONSTRUCTOR DETAIL ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_detail\">\n<!--   -->\n</a>\n<h3>Constructor Detail</h3>\n<a name=\"TJ()\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>TJ</h4>\n<pre>public&nbsp;TJ()</pre>\n</li>\n</ul>\n</li>\n</ul>\n<!-- ============ METHOD DETAIL ========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_detail\">\n<!--   -->\n</a>\n<h3>Method Detail</h3>\n<a name=\"getMCUWidth(int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getMCUWidth</h4>\n<pre>public static&nbsp;int&nbsp;getMCUWidth(int&nbsp;subsamp)</pre>\n<div class=\"block\">Returns the MCU block width for the given level of chrominance\n subsampling.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>subsamp</code> - the level of chrominance subsampling (one of\n <code>SAMP_*</code>)</dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>the MCU block width for the given level of chrominance\n subsampling.</dd></dl>\n</li>\n</ul>\n<a name=\"getMCUHeight(int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getMCUHeight</h4>\n<pre>public static&nbsp;int&nbsp;getMCUHeight(int&nbsp;subsamp)</pre>\n<div class=\"block\">Returns the MCU block height for the given level of chrominance\n subsampling.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>subsamp</code> - the level of chrominance subsampling (one of\n <code>SAMP_*</code>)</dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>the MCU block height for the given level of chrominance\n subsampling.</dd></dl>\n</li>\n</ul>\n<a name=\"getPixelSize(int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getPixelSize</h4>\n<pre>public static&nbsp;int&nbsp;getPixelSize(int&nbsp;pixelFormat)</pre>\n<div class=\"block\">Returns the pixel size (in bytes) for the given pixel format.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>the pixel size (in bytes) for the given pixel format.</dd></dl>\n</li>\n</ul>\n<a name=\"getRedOffset(int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getRedOffset</h4>\n<pre>public static&nbsp;int&nbsp;getRedOffset(int&nbsp;pixelFormat)</pre>\n<div class=\"block\">For the given pixel format, returns the number of bytes that the red\n component is offset from the start of the pixel.  For instance, if a pixel\n of format <code>TJ.PF_BGRX</code> is stored in <code>char pixel[]</code>,\n then the red component will be\n <code>pixel[TJ.getRedOffset(TJ.PF_BGRX)]</code>.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>the red offset for the given pixel format.</dd></dl>\n</li>\n</ul>\n<a name=\"getGreenOffset(int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getGreenOffset</h4>\n<pre>public static&nbsp;int&nbsp;getGreenOffset(int&nbsp;pixelFormat)</pre>\n<div class=\"block\">For the given pixel format, returns the number of bytes that the green\n component is offset from the start of the pixel.  For instance, if a pixel\n of format <code>TJ.PF_BGRX</code> is stored in <code>char pixel[]</code>,\n then the green component will be\n <code>pixel[TJ.getGreenOffset(TJ.PF_BGRX)]</code>.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>the green offset for the given pixel format.</dd></dl>\n</li>\n</ul>\n<a name=\"getBlueOffset(int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getBlueOffset</h4>\n<pre>public static&nbsp;int&nbsp;getBlueOffset(int&nbsp;pixelFormat)</pre>\n<div class=\"block\">For the given pixel format, returns the number of bytes that the blue\n component is offset from the start of the pixel.  For instance, if a pixel\n of format <code>TJ.PF_BGRX</code> is stored in <code>char pixel[]</code>,\n then the blue component will be\n <code>pixel[TJ.getBlueOffset(TJ.PF_BGRX)]</code>.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>the blue offset for the given pixel format.</dd></dl>\n</li>\n</ul>\n<a name=\"bufSize(int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>bufSize</h4>\n<pre>public static&nbsp;int&nbsp;bufSize(int&nbsp;width,\n          int&nbsp;height,\n          int&nbsp;jpegSubsamp)</pre>\n<div class=\"block\">Returns the maximum size of the buffer (in bytes) required to hold a JPEG\n image with the given width, height, and level of chrominance subsampling.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>width</code> - the width (in pixels) of the JPEG image</dd><dd><code>height</code> - the height (in pixels) of the JPEG image</dd><dd><code>jpegSubsamp</code> - the level of chrominance subsampling to be used when\n generating the JPEG image (one of <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>TJ.SAMP_*</code></a>)</dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>the maximum size of the buffer (in bytes) required to hold a JPEG\n image with the given width, height, and level of chrominance subsampling.</dd></dl>\n</li>\n</ul>\n<a name=\"bufSizeYUV(int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>bufSizeYUV</h4>\n<pre>public static&nbsp;int&nbsp;bufSizeYUV(int&nbsp;width,\n             int&nbsp;pad,\n             int&nbsp;height,\n             int&nbsp;subsamp)</pre>\n<div class=\"block\">Returns the size of the buffer (in bytes) required to hold a YUV planar\n image with the given width, height, and level of chrominance subsampling.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>width</code> - the width (in pixels) of the YUV image</dd><dd><code>pad</code> - the width of each line in each plane of the image is padded to\n the nearest multiple of this number of bytes (must be a power of 2.)</dd><dd><code>height</code> - the height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV\n image (one of <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>TJ.SAMP_*</code></a>)</dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>the size of the buffer (in bytes) required to hold a YUV planar\n image with the given width, height, and level of chrominance subsampling.</dd></dl>\n</li>\n</ul>\n<a name=\"bufSizeYUV(int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>bufSizeYUV</h4>\n<pre>@Deprecated\npublic static&nbsp;int&nbsp;bufSizeYUV(int&nbsp;width,\n                        int&nbsp;height,\n                        int&nbsp;subsamp)</pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)\"><code>bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>\n</li>\n</ul>\n<a name=\"planeSizeYUV(int, int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>planeSizeYUV</h4>\n<pre>public static&nbsp;int&nbsp;planeSizeYUV(int&nbsp;componentID,\n               int&nbsp;width,\n               int&nbsp;stride,\n               int&nbsp;height,\n               int&nbsp;subsamp)</pre>\n<div class=\"block\">Returns the size of the buffer (in bytes) required to hold a YUV image\n plane with the given parameters.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>componentID</code> - ID number of the image plane (0 = Y, 1 = U/Cb,\n 2 = V/Cr)</dd><dd><code>width</code> - width (in pixels) of the YUV image.  NOTE: this is the width\n of the whole image, not the plane width.</dd><dd><code>stride</code> - bytes per line in the image plane.</dd><dd><code>height</code> - height (in pixels) of the YUV image.  NOTE: this is the\n height of the whole image, not the plane height.</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV\n image (one of <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>TJ.SAMP_*</code></a>)</dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>the size of the buffer (in bytes) required to hold a YUV planar\n image with the given parameters.</dd></dl>\n</li>\n</ul>\n<a name=\"planeWidth(int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>planeWidth</h4>\n<pre>public static&nbsp;int&nbsp;planeWidth(int&nbsp;componentID,\n             int&nbsp;width,\n             int&nbsp;subsamp)</pre>\n<div class=\"block\">Returns the plane width of a YUV image plane with the given parameters.\n Refer to <a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>YUVImage</code></a> for a description of plane width.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>componentID</code> - ID number of the image plane (0 = Y, 1 = U/Cb,\n 2 = V/Cr)</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV image\n (one of <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>TJ.SAMP_*</code></a>)</dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>the plane width of a YUV image plane with the given parameters.</dd></dl>\n</li>\n</ul>\n<a name=\"planeHeight(int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>planeHeight</h4>\n<pre>public static&nbsp;int&nbsp;planeHeight(int&nbsp;componentID,\n              int&nbsp;height,\n              int&nbsp;subsamp)</pre>\n<div class=\"block\">Returns the plane height of a YUV image plane with the given parameters.\n Refer to <a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>YUVImage</code></a> for a description of plane height.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>componentID</code> - ID number of the image plane (0 = Y, 1 = U/Cb,\n 2 = V/Cr)</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV image\n (one of <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>TJ.SAMP_*</code></a>)</dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>the plane height of a YUV image plane with the given parameters.</dd></dl>\n</li>\n</ul>\n<a name=\"getScalingFactors()\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>getScalingFactors</h4>\n<pre>public static&nbsp;<a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJScalingFactor</a>[]&nbsp;getScalingFactors()</pre>\n<div class=\"block\">Returns a list of fractional scaling factors that the JPEG decompressor in\n this implementation of TurboJPEG supports.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>a list of fractional scaling factors that the JPEG decompressor in\n this implementation of TurboJPEG supports.</dd></dl>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n<!-- ========= END OF CLASS DATA ========= -->\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev Class</li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJ.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJ.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li><a href=\"#field_summary\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li><a href=\"#field_detail\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>TJCompressor</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"TJCompressor\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJCompressor.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJCompressor.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<!-- ======== START OF CLASS DATA ======== -->\n<div class=\"header\">\n<div class=\"subTitle\">org.libjpegturbo.turbojpeg</div>\n<h2 title=\"Class TJCompressor\" class=\"title\">Class TJCompressor</h2>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"inheritance\">\n<li>java.lang.Object</li>\n<li>\n<ul class=\"inheritance\">\n<li>org.libjpegturbo.turbojpeg.TJCompressor</li>\n</ul>\n</li>\n</ul>\n<div class=\"description\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<dl>\n<dt>All Implemented Interfaces:</dt>\n<dd>java.io.Closeable, java.lang.AutoCloseable</dd>\n</dl>\n<hr>\n<br>\n<pre>public class <span class=\"strong\">TJCompressor</span>\nextends java.lang.Object\nimplements java.io.Closeable</pre>\n<div class=\"block\">TurboJPEG compressor</div>\n</li>\n</ul>\n</div>\n<div class=\"summary\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_summary\">\n<!--   -->\n</a>\n<h3>Constructor Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Constructor Summary table, listing constructors, and an explanation\">\n<caption><span>Constructors</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Constructor and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor()\">TJCompressor</a></strong>()</code>\n<div class=\"block\">Create a TurboJPEG compressor instance.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\">TJCompressor</a></strong>(java.awt.image.BufferedImage&nbsp;srcImage,\n            int&nbsp;x,\n            int&nbsp;y,\n            int&nbsp;width,\n            int&nbsp;height)</code>\n<div class=\"block\">Create a TurboJPEG compressor instance and associate the uncompressed\n source image stored in <code>srcImage</code> with the newly created\n instance.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int)\">TJCompressor</a></strong>(byte[]&nbsp;srcImage,\n            int&nbsp;width,\n            int&nbsp;pitch,\n            int&nbsp;height,\n            int&nbsp;pixelFormat)</code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;\n<div class=\"block\"><i>Use\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\"><code>TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>\n</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\">TJCompressor</a></strong>(byte[]&nbsp;srcImage,\n            int&nbsp;x,\n            int&nbsp;y,\n            int&nbsp;width,\n            int&nbsp;pitch,\n            int&nbsp;height,\n            int&nbsp;pixelFormat)</code>\n<div class=\"block\">Create a TurboJPEG compressor instance and associate the uncompressed\n source image stored in <code>srcImage</code> with the newly created\n instance.</div>\n</td>\n</tr>\n</table>\n</li>\n</ul>\n<!-- ========== METHOD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_summary\">\n<!--   -->\n</a>\n<h3>Method Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Method Summary table, listing methods, and an explanation\">\n<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Method and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#close()\">close</a></strong>()</code>\n<div class=\"block\">Free the native structures associated with this compressor instance.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20byte[],%20int)\">compress</a></strong>(java.awt.image.BufferedImage&nbsp;srcImage,\n        byte[]&nbsp;dstBuf,\n        int&nbsp;flags)</code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;\n<div class=\"block\"><i>Use\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)\"><code>compress(byte[], int)</code></a> instead.</i></div>\n</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>byte[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20int)\">compress</a></strong>(java.awt.image.BufferedImage&nbsp;srcImage,\n        int&nbsp;flags)</code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;\n<div class=\"block\"><i>Use\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)\"><code>compress(int)</code></a> instead.</i></div>\n</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)\">compress</a></strong>(byte[]&nbsp;dstBuf,\n        int&nbsp;flags)</code>\n<div class=\"block\">Compress the uncompressed source image associated with this compressor\n instance and output a JPEG image to the given destination buffer.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>byte[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)\">compress</a></strong>(int&nbsp;flags)</code>\n<div class=\"block\">Compress the uncompressed source image associated with this compressor\n instance and return a buffer containing a JPEG image.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20byte[],%20int)\">encodeYUV</a></strong>(java.awt.image.BufferedImage&nbsp;srcImage,\n         byte[]&nbsp;dstBuf,\n         int&nbsp;flags)</code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;\n<div class=\"block\"><i>Use\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)\"><code>encodeYUV(byte[], int)</code></a> instead.</i></div>\n</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>byte[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20int)\">encodeYUV</a></strong>(java.awt.image.BufferedImage&nbsp;srcImage,\n         int&nbsp;flags)</code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;\n<div class=\"block\"><i>Use\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)\"><code>encodeYUV(int, int)</code></a> instead.</i></div>\n</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)\">encodeYUV</a></strong>(byte[]&nbsp;dstBuf,\n         int&nbsp;flags)</code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;\n<div class=\"block\"><i>Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)\"><code>encodeYUV(YUVImage, int)</code></a> instead.</i></div>\n</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>byte[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)\">encodeYUV</a></strong>(int&nbsp;flags)</code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;\n<div class=\"block\"><i>Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)\"><code>encodeYUV(int, int)</code></a> instead.</i></div>\n</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int[],%20int)\">encodeYUV</a></strong>(int[]&nbsp;strides,\n         int&nbsp;flags)</code>\n<div class=\"block\">Encode the uncompressed source image associated with this compressor\n instance into separate Y, U (Cb), and V (Cr) image planes and return a\n <code>YUVImage</code> instance containing the encoded image planes.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)\">encodeYUV</a></strong>(int&nbsp;pad,\n         int&nbsp;flags)</code>\n<div class=\"block\">Encode the uncompressed source image associated with this compressor\n instance into a unified YUV planar image buffer and return a\n <code>YUVImage</code> instance containing the encoded image.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)\">encodeYUV</a></strong>(<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a>&nbsp;dstImage,\n         int&nbsp;flags)</code>\n<div class=\"block\">Encode the uncompressed source image associated with this compressor\n instance into a YUV planar image and store it in the given\n <code>YUVImage</code> instance.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>protected void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#finalize()\">finalize</a></strong>()</code>&nbsp;</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()\">getCompressedSize</a></strong>()</code>\n<div class=\"block\">Returns the size of the image (in bytes) generated by the most recent\n compress operation.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setJPEGQuality(int)\">setJPEGQuality</a></strong>(int&nbsp;quality)</code>\n<div class=\"block\">Set the JPEG image quality level for subsequent compress operations.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\">setSourceImage</a></strong>(java.awt.image.BufferedImage&nbsp;srcImage,\n              int&nbsp;x,\n              int&nbsp;y,\n              int&nbsp;width,\n              int&nbsp;height)</code>\n<div class=\"block\">Associate an uncompressed RGB or grayscale source image with this\n compressor instance.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int)\">setSourceImage</a></strong>(byte[]&nbsp;srcImage,\n              int&nbsp;width,\n              int&nbsp;pitch,\n              int&nbsp;height,\n              int&nbsp;pixelFormat)</code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;\n<div class=\"block\"><i>Use\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>\n</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\">setSourceImage</a></strong>(byte[]&nbsp;srcImage,\n              int&nbsp;x,\n              int&nbsp;y,\n              int&nbsp;width,\n              int&nbsp;pitch,\n              int&nbsp;height,\n              int&nbsp;pixelFormat)</code>\n<div class=\"block\">Associate an uncompressed RGB, grayscale, or CMYK source image with this\n compressor instance.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)\">setSourceImage</a></strong>(<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a>&nbsp;srcImage)</code>\n<div class=\"block\">Associate an uncompressed YUV planar source image with this compressor\n instance.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSubsamp(int)\">setSubsamp</a></strong>(int&nbsp;newSubsamp)</code>\n<div class=\"block\">Set the level of chrominance subsampling for subsequent compress/encode\n operations.</div>\n</td>\n</tr>\n</table>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"methods_inherited_from_class_java.lang.Object\">\n<!--   -->\n</a>\n<h3>Methods inherited from class&nbsp;java.lang.Object</h3>\n<code>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"details\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ========= CONSTRUCTOR DETAIL ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_detail\">\n<!--   -->\n</a>\n<h3>Constructor Detail</h3>\n<a name=\"TJCompressor()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>TJCompressor</h4>\n<pre>public&nbsp;TJCompressor()\n             throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Create a TurboJPEG compressor instance.</div>\n<dl><dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"TJCompressor(byte[], int, int, int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>TJCompressor</h4>\n<pre>public&nbsp;TJCompressor(byte[]&nbsp;srcImage,\n            int&nbsp;x,\n            int&nbsp;y,\n            int&nbsp;width,\n            int&nbsp;pitch,\n            int&nbsp;height,\n            int&nbsp;pixelFormat)\n             throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Create a TurboJPEG compressor instance and associate the uncompressed\n source image stored in <code>srcImage</code> with the newly created\n instance.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>srcImage</code> - see <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>x</code> - see <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>y</code> - see <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>width</code> - see <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>pitch</code> - see <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>height</code> - see <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>pixelFormat</code> - pixel format of the source image (one of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB\"><code>TJ.PF_*</code></a>)</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"TJCompressor(byte[], int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>TJCompressor</h4>\n<pre>@Deprecated\npublic&nbsp;TJCompressor(byte[]&nbsp;srcImage,\n                       int&nbsp;width,\n                       int&nbsp;pitch,\n                       int&nbsp;height,\n                       int&nbsp;pixelFormat)\n             throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>Use\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\"><code>TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>\n<dl><dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"TJCompressor(java.awt.image.BufferedImage, int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>TJCompressor</h4>\n<pre>public&nbsp;TJCompressor(java.awt.image.BufferedImage&nbsp;srcImage,\n            int&nbsp;x,\n            int&nbsp;y,\n            int&nbsp;width,\n            int&nbsp;height)\n             throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Create a TurboJPEG compressor instance and associate the uncompressed\n source image stored in <code>srcImage</code> with the newly created\n instance.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>srcImage</code> - see\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>x</code> - see\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>y</code> - see\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>width</code> - see\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>height</code> - see\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n</li>\n</ul>\n<!-- ============ METHOD DETAIL ========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_detail\">\n<!--   -->\n</a>\n<h3>Method Detail</h3>\n<a name=\"setSourceImage(byte[], int, int, int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>setSourceImage</h4>\n<pre>public&nbsp;void&nbsp;setSourceImage(byte[]&nbsp;srcImage,\n                  int&nbsp;x,\n                  int&nbsp;y,\n                  int&nbsp;width,\n                  int&nbsp;pitch,\n                  int&nbsp;height,\n                  int&nbsp;pixelFormat)\n                    throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Associate an uncompressed RGB, grayscale, or CMYK source image with this\n compressor instance.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>srcImage</code> - image buffer containing RGB, grayscale, or CMYK pixels to\n be compressed or encoded.  This buffer is not modified.</dd><dd><code>x</code> - x offset (in pixels) of the region in the source image from which\n the JPEG or YUV image should be compressed/encoded</dd><dd><code>y</code> - y offset (in pixels) of the region in the source image from which\n the JPEG or YUV image should be compressed/encoded</dd><dd><code>width</code> - width (in pixels) of the region in the source image from\n which the JPEG or YUV image should be compressed/encoded</dd><dd><code>pitch</code> - bytes per line of the source image.  Normally, this should be\n <code>width * TJ.pixelSize(pixelFormat)</code> if the source image is\n unpadded, but you can use this parameter to, for instance, specify that\n the scanlines in the source image are padded to a 4-byte boundary or to\n compress/encode a JPEG or YUV image from a region of a larger source\n image.  You can also be clever and use this parameter to skip lines, etc.\n Setting this parameter to 0 is the equivalent of setting it to\n <code>width * TJ.pixelSize(pixelFormat)</code>.</dd><dd><code>height</code> - height (in pixels) of the region in the source image from\n which the JPEG or YUV image should be compressed/encoded</dd><dd><code>pixelFormat</code> - pixel format of the source image (one of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB\"><code>TJ.PF_*</code></a>)</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"setSourceImage(byte[], int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>setSourceImage</h4>\n<pre>@Deprecated\npublic&nbsp;void&nbsp;setSourceImage(byte[]&nbsp;srcImage,\n                             int&nbsp;width,\n                             int&nbsp;pitch,\n                             int&nbsp;height,\n                             int&nbsp;pixelFormat)\n                    throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>Use\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)\"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>\n<dl><dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"setSourceImage(java.awt.image.BufferedImage, int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>setSourceImage</h4>\n<pre>public&nbsp;void&nbsp;setSourceImage(java.awt.image.BufferedImage&nbsp;srcImage,\n                  int&nbsp;x,\n                  int&nbsp;y,\n                  int&nbsp;width,\n                  int&nbsp;height)\n                    throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Associate an uncompressed RGB or grayscale source image with this\n compressor instance.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>srcImage</code> - a <code>BufferedImage</code> instance containing RGB or\n grayscale pixels to be compressed or encoded.  This image is not modified.</dd><dd><code>x</code> - x offset (in pixels) of the region in the source image from which\n the JPEG or YUV image should be compressed/encoded</dd><dd><code>y</code> - y offset (in pixels) of the region in the source image from which\n the JPEG or YUV image should be compressed/encoded</dd><dd><code>width</code> - width (in pixels) of the region in the source image from\n which the JPEG or YUV image should be compressed/encoded (0 = use the\n width of the source image)</dd><dd><code>height</code> - height (in pixels) of the region in the source image from\n which the JPEG or YUV image should be compressed/encoded (0 = use the\n height of the source image)</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>setSourceImage</h4>\n<pre>public&nbsp;void&nbsp;setSourceImage(<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a>&nbsp;srcImage)\n                    throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Associate an uncompressed YUV planar source image with this compressor\n instance.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>srcImage</code> - YUV planar image to be compressed.  This image is not\n modified.</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"setSubsamp(int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>setSubsamp</h4>\n<pre>public&nbsp;void&nbsp;setSubsamp(int&nbsp;newSubsamp)</pre>\n<div class=\"block\">Set the level of chrominance subsampling for subsequent compress/encode\n operations.  When pixels are converted from RGB to YCbCr (see\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr\"><code>TJ.CS_YCbCr</code></a>) or from CMYK to YCCK (see <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK\"><code>TJ.CS_YCCK</code></a>) as part\n of the JPEG compression process, some of the Cb and Cr (chrominance)\n components can be discarded or averaged together to produce a smaller\n image with little perceptible loss of image clarity (the human eye is more\n sensitive to small changes in brightness than to small changes in color.)\n This is called \"chrominance subsampling\".\n <p>\n NOTE: This method has no effect when compressing a JPEG image from a YUV\n planar source.  In that case, the level of chrominance subsampling in\n the JPEG image is determined by the source.  Further, this method has no\n effect when encoding to a pre-allocated <a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>YUVImage</code></a> instance.  In\n that case, the level of chrominance subsampling is determined by the\n destination.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>newSubsamp</code> - the level of chrominance subsampling to use in\n subsequent compress/encode oeprations (one of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444\"><code>TJ.SAMP_*</code></a>)</dd></dl>\n</li>\n</ul>\n<a name=\"setJPEGQuality(int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>setJPEGQuality</h4>\n<pre>public&nbsp;void&nbsp;setJPEGQuality(int&nbsp;quality)</pre>\n<div class=\"block\">Set the JPEG image quality level for subsequent compress operations.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>quality</code> - the new JPEG image quality level (1 to 100, 1 = worst,\n 100 = best)</dd></dl>\n</li>\n</ul>\n<a name=\"compress(byte[], int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>compress</h4>\n<pre>public&nbsp;void&nbsp;compress(byte[]&nbsp;dstBuf,\n            int&nbsp;flags)\n              throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Compress the uncompressed source image associated with this compressor\n instance and output a JPEG image to the given destination buffer.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>dstBuf</code> - buffer that will receive the JPEG image.  Use\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int,%20int,%20int)\"><code>TJ.bufSize(int, int, int)</code></a> to determine the maximum size for this buffer based on\n the source image's width and height and the desired level of chrominance\n subsampling.</dd><dd><code>flags</code> - the bitwise OR of one or more of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\"><code>TJ.FLAG_*</code></a></dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"compress(int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>compress</h4>\n<pre>public&nbsp;byte[]&nbsp;compress(int&nbsp;flags)\n                throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Compress the uncompressed source image associated with this compressor\n instance and return a buffer containing a JPEG image.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>flags</code> - the bitwise OR of one or more of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\"><code>TJ.FLAG_*</code></a></dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>a buffer containing a JPEG image.  The length of this buffer will\n not be equal to the size of the JPEG image.  Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()\"><code>getCompressedSize()</code></a> to obtain the size of the JPEG image.</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"compress(java.awt.image.BufferedImage, byte[], int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>compress</h4>\n<pre>@Deprecated\npublic&nbsp;void&nbsp;compress(java.awt.image.BufferedImage&nbsp;srcImage,\n                       byte[]&nbsp;dstBuf,\n                       int&nbsp;flags)\n              throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>Use\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)\"><code>compress(byte[], int)</code></a> instead.</i></div>\n<dl><dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"compress(java.awt.image.BufferedImage, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>compress</h4>\n<pre>@Deprecated\npublic&nbsp;byte[]&nbsp;compress(java.awt.image.BufferedImage&nbsp;srcImage,\n                         int&nbsp;flags)\n                throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>Use\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)\"><code>compress(int)</code></a> instead.</i></div>\n<dl><dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"encodeYUV(org.libjpegturbo.turbojpeg.YUVImage, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>encodeYUV</h4>\n<pre>public&nbsp;void&nbsp;encodeYUV(<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a>&nbsp;dstImage,\n             int&nbsp;flags)\n               throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Encode the uncompressed source image associated with this compressor\n instance into a YUV planar image and store it in the given\n <code>YUVImage</code> instance.   This method uses the accelerated color\n conversion routines in TurboJPEG's underlying codec but does not execute\n any of the other steps in the JPEG compression process.  Encoding\n CMYK source images to YUV is not supported.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>dstImage</code> - <a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>YUVImage</code></a> instance that will receive the YUV planar\n image</dd><dd><code>flags</code> - the bitwise OR of one or more of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\"><code>TJ.FLAG_*</code></a></dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"encodeYUV(byte[], int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>encodeYUV</h4>\n<pre>@Deprecated\npublic&nbsp;void&nbsp;encodeYUV(byte[]&nbsp;dstBuf,\n                        int&nbsp;flags)\n               throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)\"><code>encodeYUV(YUVImage, int)</code></a> instead.</i></div>\n<dl><dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"encodeYUV(int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>encodeYUV</h4>\n<pre>public&nbsp;<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a>&nbsp;encodeYUV(int&nbsp;pad,\n                 int&nbsp;flags)\n                   throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Encode the uncompressed source image associated with this compressor\n instance into a unified YUV planar image buffer and return a\n <code>YUVImage</code> instance containing the encoded image.  This method\n uses the accelerated color conversion routines in TurboJPEG's underlying\n codec but does not execute any of the other steps in the JPEG compression\n process.  Encoding CMYK source images to YUV is not supported.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>pad</code> - the width of each line in each plane of the YUV image will be\n padded to the nearest multiple of this number of bytes (must be a power of\n 2.)</dd><dd><code>flags</code> - the bitwise OR of one or more of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\"><code>TJ.FLAG_*</code></a></dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>a YUV planar image.</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"encodeYUV(int[], int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>encodeYUV</h4>\n<pre>public&nbsp;<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a>&nbsp;encodeYUV(int[]&nbsp;strides,\n                 int&nbsp;flags)\n                   throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Encode the uncompressed source image associated with this compressor\n instance into separate Y, U (Cb), and V (Cr) image planes and return a\n <code>YUVImage</code> instance containing the encoded image planes.  This\n method uses the accelerated color conversion routines in TurboJPEG's\n underlying codec but does not execute any of the other steps in the JPEG\n compression process.  Encoding CMYK source images to YUV is not supported.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>strides</code> - an array of integers, each specifying the number of bytes\n per line in the corresponding plane of the output image.  Setting the\n stride for any plane to 0 is the same as setting it to the component width\n of the plane.  If <code>strides</code> is null, then the strides for all\n planes will be set to their respective component widths.  You can adjust\n the strides in order to add an arbitrary amount of line padding to each\n plane.</dd><dd><code>flags</code> - the bitwise OR of one or more of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\"><code>TJ.FLAG_*</code></a></dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>a YUV planar image.</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"encodeYUV(int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>encodeYUV</h4>\n<pre>@Deprecated\npublic&nbsp;byte[]&nbsp;encodeYUV(int&nbsp;flags)\n                 throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)\"><code>encodeYUV(int, int)</code></a> instead.</i></div>\n<dl><dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"encodeYUV(java.awt.image.BufferedImage, byte[], int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>encodeYUV</h4>\n<pre>@Deprecated\npublic&nbsp;void&nbsp;encodeYUV(java.awt.image.BufferedImage&nbsp;srcImage,\n                        byte[]&nbsp;dstBuf,\n                        int&nbsp;flags)\n               throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>Use\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)\"><code>encodeYUV(byte[], int)</code></a> instead.</i></div>\n<dl><dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"encodeYUV(java.awt.image.BufferedImage, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>encodeYUV</h4>\n<pre>@Deprecated\npublic&nbsp;byte[]&nbsp;encodeYUV(java.awt.image.BufferedImage&nbsp;srcImage,\n                          int&nbsp;flags)\n                 throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>Use\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)\"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)\"><code>encodeYUV(int, int)</code></a> instead.</i></div>\n<dl><dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"getCompressedSize()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getCompressedSize</h4>\n<pre>public&nbsp;int&nbsp;getCompressedSize()</pre>\n<div class=\"block\">Returns the size of the image (in bytes) generated by the most recent\n compress operation.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the size of the image (in bytes) generated by the most recent\n compress operation.</dd></dl>\n</li>\n</ul>\n<a name=\"close()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>close</h4>\n<pre>public&nbsp;void&nbsp;close()\n           throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Free the native structures associated with this compressor instance.</div>\n<dl>\n<dt><strong>Specified by:</strong></dt>\n<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.io.Closeable</code></dd>\n<dt><strong>Specified by:</strong></dt>\n<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.lang.AutoCloseable</code></dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"finalize()\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>finalize</h4>\n<pre>protected&nbsp;void&nbsp;finalize()\n                 throws java.lang.Throwable</pre>\n<dl>\n<dt><strong>Overrides:</strong></dt>\n<dd><code>finalize</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code>java.lang.Throwable</code></dd></dl>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n<!-- ========= END OF CLASS DATA ========= -->\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJCompressor.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJCompressor.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>TJCustomFilter</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"TJCustomFilter\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJCustomFilter.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJCustomFilter.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li>Constr&nbsp;|&nbsp;</li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li>Constr&nbsp;|&nbsp;</li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<!-- ======== START OF CLASS DATA ======== -->\n<div class=\"header\">\n<div class=\"subTitle\">org.libjpegturbo.turbojpeg</div>\n<h2 title=\"Interface TJCustomFilter\" class=\"title\">Interface TJCustomFilter</h2>\n</div>\n<div class=\"contentContainer\">\n<div class=\"description\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<hr>\n<br>\n<pre>public interface <span class=\"strong\">TJCustomFilter</span></pre>\n<div class=\"block\">Custom filter callback interface</div>\n</li>\n</ul>\n</div>\n<div class=\"summary\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ========== METHOD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_summary\">\n<!--   -->\n</a>\n<h3>Method Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Method Summary table, listing methods, and an explanation\">\n<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Method and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html#customFilter(java.nio.ShortBuffer,%20java.awt.Rectangle,%20java.awt.Rectangle,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJTransform)\">customFilter</a></strong>(java.nio.ShortBuffer&nbsp;coeffBuffer,\n            java.awt.Rectangle&nbsp;bufferRegion,\n            java.awt.Rectangle&nbsp;planeRegion,\n            int&nbsp;componentID,\n            int&nbsp;transformID,\n            <a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a>&nbsp;transform)</code>\n<div class=\"block\">A callback function that can be used to modify the DCT coefficients after\n they are losslessly transformed but before they are transcoded to a new\n JPEG image.</div>\n</td>\n</tr>\n</table>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"details\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ============ METHOD DETAIL ========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_detail\">\n<!--   -->\n</a>\n<h3>Method Detail</h3>\n<a name=\"customFilter(java.nio.ShortBuffer, java.awt.Rectangle, java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJTransform)\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>customFilter</h4>\n<pre>void&nbsp;customFilter(java.nio.ShortBuffer&nbsp;coeffBuffer,\n                java.awt.Rectangle&nbsp;bufferRegion,\n                java.awt.Rectangle&nbsp;planeRegion,\n                int&nbsp;componentID,\n                int&nbsp;transformID,\n                <a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a>&nbsp;transform)\n                  throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">A callback function that can be used to modify the DCT coefficients after\n they are losslessly transformed but before they are transcoded to a new\n JPEG image.  This allows for custom filters or other transformations to be\n applied in the frequency domain.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>coeffBuffer</code> - a buffer containing transformed DCT coefficients.\n (NOTE: this buffer is not guaranteed to be valid once the callback\n returns, so applications wishing to hand off the DCT coefficients to\n another function or library should make a copy of them within the body of\n the callback.)</dd><dd><code>bufferRegion</code> - rectangle containing the width and height of\n <code>coeffBuffer</code> as well as its offset relative to the component\n plane.  TurboJPEG implementations may choose to split each component plane\n into multiple DCT coefficient buffers and call the callback function once\n for each buffer.</dd><dd><code>planeRegion</code> - rectangle containing the width and height of the\n component plane to which <code>coeffBuffer</code> belongs</dd><dd><code>componentID</code> - ID number of the component plane to which\n <code>coeffBuffer</code> belongs (Y, Cb, and Cr have, respectively, ID's\n of 0, 1, and 2 in typical JPEG images.)</dd><dd><code>transformID</code> - ID number of the transformed image to which\n <code>coeffBuffer</code> belongs.  This is the same as the index of the\n transform in the <code>transforms</code> array that was passed to <a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)\"><code>TJTransformer.transform()</code></a>.</dd><dd><code>transform</code> - a <a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>TJTransform</code></a> instance that specifies the\n parameters and/or cropping region for this transform</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n<!-- ========= END OF CLASS DATA ========= -->\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJCustomFilter.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJCustomFilter.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li>Constr&nbsp;|&nbsp;</li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li>Constr&nbsp;|&nbsp;</li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>TJDecompressor</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"TJDecompressor\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJDecompressor.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJDecompressor.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li><a href=\"#field_summary\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li><a href=\"#field_detail\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<!-- ======== START OF CLASS DATA ======== -->\n<div class=\"header\">\n<div class=\"subTitle\">org.libjpegturbo.turbojpeg</div>\n<h2 title=\"Class TJDecompressor\" class=\"title\">Class TJDecompressor</h2>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"inheritance\">\n<li>java.lang.Object</li>\n<li>\n<ul class=\"inheritance\">\n<li>org.libjpegturbo.turbojpeg.TJDecompressor</li>\n</ul>\n</li>\n</ul>\n<div class=\"description\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<dl>\n<dt>All Implemented Interfaces:</dt>\n<dd>java.io.Closeable, java.lang.AutoCloseable</dd>\n</dl>\n<dl>\n<dt>Direct Known Subclasses:</dt>\n<dd><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransformer</a></dd>\n</dl>\n<hr>\n<br>\n<pre>public class <span class=\"strong\">TJDecompressor</span>\nextends java.lang.Object\nimplements java.io.Closeable</pre>\n<div class=\"block\">TurboJPEG decompressor</div>\n</li>\n</ul>\n</div>\n<div class=\"summary\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- =========== FIELD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"field_summary\">\n<!--   -->\n</a>\n<h3>Field Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Field Summary table, listing fields, and an explanation\">\n<caption><span>Fields</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Field and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>protected long</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#handle\">handle</a></strong></code>&nbsp;</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>protected byte[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBuf\">jpegBuf</a></strong></code>&nbsp;</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>protected int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize\">jpegBufSize</a></strong></code>&nbsp;</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>protected int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegColorspace\">jpegColorspace</a></strong></code>&nbsp;</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>protected int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegHeight\">jpegHeight</a></strong></code>&nbsp;</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>protected int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegSubsamp\">jpegSubsamp</a></strong></code>&nbsp;</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>protected int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegWidth\">jpegWidth</a></strong></code>&nbsp;</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>protected <a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#yuvImage\">yuvImage</a></strong></code>&nbsp;</td>\n</tr>\n</table>\n</li>\n</ul>\n<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_summary\">\n<!--   -->\n</a>\n<h3>Constructor Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Constructor Summary table, listing constructors, and an explanation\">\n<caption><span>Constructors</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Constructor and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor()\">TJDecompressor</a></strong>()</code>\n<div class=\"block\">Create a TurboJPEG decompresssor instance.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[])\">TJDecompressor</a></strong>(byte[]&nbsp;jpegImage)</code>\n<div class=\"block\">Create a TurboJPEG decompressor instance and associate the JPEG source\n image stored in <code>jpegImage</code> with the newly created instance.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[],%20int)\">TJDecompressor</a></strong>(byte[]&nbsp;jpegImage,\n              int&nbsp;imageSize)</code>\n<div class=\"block\">Create a TurboJPEG decompressor instance and associate the JPEG source\n image of length <code>imageSize</code> bytes stored in\n <code>jpegImage</code> with the newly created instance.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(org.libjpegturbo.turbojpeg.YUVImage)\">TJDecompressor</a></strong>(<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a>&nbsp;yuvImage)</code>\n<div class=\"block\">Create a TurboJPEG decompressor instance and associate the YUV planar\n source image stored in <code>yuvImage</code> with the newly created\n instance.</div>\n</td>\n</tr>\n</table>\n</li>\n</ul>\n<!-- ========== METHOD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_summary\">\n<!--   -->\n</a>\n<h3>Method Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Method Summary table, listing methods, and an explanation\">\n<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Method and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#close()\">close</a></strong>()</code>\n<div class=\"block\">Free the native structures associated with this decompressor instance.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage,%20int)\">decompress</a></strong>(java.awt.image.BufferedImage&nbsp;dstImage,\n          int&nbsp;flags)</code>\n<div class=\"block\">Decompress the JPEG source image or decode the YUV source image associated\n with this decompressor instance and output a decompressed/decoded image to\n the given <code>BufferedImage</code> instance.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)\">decompress</a></strong>(byte[]&nbsp;dstBuf,\n          int&nbsp;desiredWidth,\n          int&nbsp;pitch,\n          int&nbsp;desiredHeight,\n          int&nbsp;pixelFormat,\n          int&nbsp;flags)</code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;\n<div class=\"block\"><i>Use\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)\"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>\n</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)\">decompress</a></strong>(byte[]&nbsp;dstBuf,\n          int&nbsp;x,\n          int&nbsp;y,\n          int&nbsp;desiredWidth,\n          int&nbsp;pitch,\n          int&nbsp;desiredHeight,\n          int&nbsp;pixelFormat,\n          int&nbsp;flags)</code>\n<div class=\"block\">Decompress the JPEG source image or decode the YUV source image associated\n with this decompressor instance and output a grayscale, RGB, or CMYK image\n to the given destination buffer.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)\">decompress</a></strong>(int[]&nbsp;dstBuf,\n          int&nbsp;x,\n          int&nbsp;y,\n          int&nbsp;desiredWidth,\n          int&nbsp;stride,\n          int&nbsp;desiredHeight,\n          int&nbsp;pixelFormat,\n          int&nbsp;flags)</code>\n<div class=\"block\">Decompress the JPEG source image or decode the YUV source image associated\n with this decompressor instance and output a grayscale, RGB, or CMYK image\n to the given destination buffer.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>java.awt.image.BufferedImage</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int)\">decompress</a></strong>(int&nbsp;desiredWidth,\n          int&nbsp;desiredHeight,\n          int&nbsp;bufferedImageType,\n          int&nbsp;flags)</code>\n<div class=\"block\">Decompress the JPEG source image or decode the YUV source image associated\n with this decompressor instance and return a <code>BufferedImage</code>\n instance containing the decompressed/decoded image.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>byte[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int,%20int)\">decompress</a></strong>(int&nbsp;desiredWidth,\n          int&nbsp;pitch,\n          int&nbsp;desiredHeight,\n          int&nbsp;pixelFormat,\n          int&nbsp;flags)</code>\n<div class=\"block\">Decompress the JPEG source image associated with this decompressor\n instance and return a buffer containing the decompressed image.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)\">decompressToYUV</a></strong>(byte[]&nbsp;dstBuf,\n               int&nbsp;flags)</code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;\n<div class=\"block\"><i>Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)\"><code>decompressToYUV(YUVImage, int)</code></a> instead.</i></div>\n</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>byte[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)\">decompressToYUV</a></strong>(int&nbsp;flags)</code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;\n<div class=\"block\"><i>Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)\"><code>decompressToYUV(int, int, int, int)</code></a> instead.</i></div>\n</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int[],%20int,%20int)\">decompressToYUV</a></strong>(int&nbsp;desiredWidth,\n               int[]&nbsp;strides,\n               int&nbsp;desiredHeight,\n               int&nbsp;flags)</code>\n<div class=\"block\">Decompress the JPEG source image associated with this decompressor\n instance into a set of Y, U (Cb), and V (Cr) image planes and return a\n <code>YUVImage</code> instance containing the decompressed image planes.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)\">decompressToYUV</a></strong>(int&nbsp;desiredWidth,\n               int&nbsp;pad,\n               int&nbsp;desiredHeight,\n               int&nbsp;flags)</code>\n<div class=\"block\">Decompress the JPEG source image associated with this decompressor\n instance into a unified YUV planar image buffer and return a\n <code>YUVImage</code> instance containing the decompressed image.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)\">decompressToYUV</a></strong>(<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a>&nbsp;dstImage,\n               int&nbsp;flags)</code>\n<div class=\"block\">Decompress the JPEG source image associated with this decompressor\n instance into a YUV planar image and store it in the given\n <code>YUVImage</code> instance.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>protected void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()\">finalize</a></strong>()</code>&nbsp;</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()\">getColorspace</a></strong>()</code>\n<div class=\"block\">Returns the colorspace used in the source image (JPEG or YUV) associated\n with this decompressor instance.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()\">getHeight</a></strong>()</code>\n<div class=\"block\">Returns the height of the source image (JPEG or YUV) associated with this\n decompressor instance.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>byte[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()\">getJPEGBuf</a></strong>()</code>\n<div class=\"block\">Returns the JPEG image buffer associated with this decompressor instance.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()\">getJPEGSize</a></strong>()</code>\n<div class=\"block\">Returns the size of the JPEG image (in bytes) associated with this\n decompressor instance.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)\">getScaledHeight</a></strong>(int&nbsp;desiredWidth,\n               int&nbsp;desiredHeight)</code>\n<div class=\"block\">Returns the height of the largest scaled-down image that the TurboJPEG\n decompressor can generate without exceeding the desired image width and\n height.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)\">getScaledWidth</a></strong>(int&nbsp;desiredWidth,\n              int&nbsp;desiredHeight)</code>\n<div class=\"block\">Returns the width of the largest scaled-down image that the TurboJPEG\n decompressor can generate without exceeding the desired image width and\n height.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()\">getSubsamp</a></strong>()</code>\n<div class=\"block\">Returns the level of chrominance subsampling used in the source image\n (JPEG or YUV) associated with this decompressor instance.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()\">getWidth</a></strong>()</code>\n<div class=\"block\">Returns the width of the source image (JPEG or YUV) associated with this\n decompressor instance.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)\">setJPEGImage</a></strong>(byte[]&nbsp;jpegImage,\n            int&nbsp;imageSize)</code>\n<div class=\"block\"><strong>Deprecated.</strong>&nbsp;\n<div class=\"block\"><i>Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)\"><code>setSourceImage(byte[], int)</code></a> instead.</i></div>\n</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)\">setSourceImage</a></strong>(byte[]&nbsp;jpegImage,\n              int&nbsp;imageSize)</code>\n<div class=\"block\">Associate the JPEG image of length <code>imageSize</code> bytes stored in\n <code>jpegImage</code> with this decompressor instance.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)\">setSourceImage</a></strong>(<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a>&nbsp;srcImage)</code>\n<div class=\"block\">Associate the specified YUV planar source image with this decompressor\n instance.</div>\n</td>\n</tr>\n</table>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"methods_inherited_from_class_java.lang.Object\">\n<!--   -->\n</a>\n<h3>Methods inherited from class&nbsp;java.lang.Object</h3>\n<code>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"details\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ============ FIELD DETAIL =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"field_detail\">\n<!--   -->\n</a>\n<h3>Field Detail</h3>\n<a name=\"handle\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>handle</h4>\n<pre>protected&nbsp;long handle</pre>\n</li>\n</ul>\n<a name=\"jpegBuf\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>jpegBuf</h4>\n<pre>protected&nbsp;byte[] jpegBuf</pre>\n</li>\n</ul>\n<a name=\"jpegBufSize\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>jpegBufSize</h4>\n<pre>protected&nbsp;int jpegBufSize</pre>\n</li>\n</ul>\n<a name=\"yuvImage\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>yuvImage</h4>\n<pre>protected&nbsp;<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a> yuvImage</pre>\n</li>\n</ul>\n<a name=\"jpegWidth\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>jpegWidth</h4>\n<pre>protected&nbsp;int jpegWidth</pre>\n</li>\n</ul>\n<a name=\"jpegHeight\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>jpegHeight</h4>\n<pre>protected&nbsp;int jpegHeight</pre>\n</li>\n</ul>\n<a name=\"jpegSubsamp\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>jpegSubsamp</h4>\n<pre>protected&nbsp;int jpegSubsamp</pre>\n</li>\n</ul>\n<a name=\"jpegColorspace\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>jpegColorspace</h4>\n<pre>protected&nbsp;int jpegColorspace</pre>\n</li>\n</ul>\n</li>\n</ul>\n<!-- ========= CONSTRUCTOR DETAIL ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_detail\">\n<!--   -->\n</a>\n<h3>Constructor Detail</h3>\n<a name=\"TJDecompressor()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>TJDecompressor</h4>\n<pre>public&nbsp;TJDecompressor()\n               throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Create a TurboJPEG decompresssor instance.</div>\n<dl><dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"TJDecompressor(byte[])\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>TJDecompressor</h4>\n<pre>public&nbsp;TJDecompressor(byte[]&nbsp;jpegImage)\n               throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Create a TurboJPEG decompressor instance and associate the JPEG source\n image stored in <code>jpegImage</code> with the newly created instance.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer (size of the JPEG image is assumed to\n be the length of the array.)  This buffer is not modified.</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"TJDecompressor(byte[], int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>TJDecompressor</h4>\n<pre>public&nbsp;TJDecompressor(byte[]&nbsp;jpegImage,\n              int&nbsp;imageSize)\n               throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Create a TurboJPEG decompressor instance and associate the JPEG source\n image of length <code>imageSize</code> bytes stored in\n <code>jpegImage</code> with the newly created instance.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer.  This buffer is not modified.</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"TJDecompressor(org.libjpegturbo.turbojpeg.YUVImage)\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>TJDecompressor</h4>\n<pre>public&nbsp;TJDecompressor(<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a>&nbsp;yuvImage)\n               throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Create a TurboJPEG decompressor instance and associate the YUV planar\n source image stored in <code>yuvImage</code> with the newly created\n instance.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>yuvImage</code> - <a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>YUVImage</code></a> instance containing a YUV planar\n image to be decoded.  This image is not modified.</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n</li>\n</ul>\n<!-- ============ METHOD DETAIL ========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_detail\">\n<!--   -->\n</a>\n<h3>Method Detail</h3>\n<a name=\"setSourceImage(byte[], int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>setSourceImage</h4>\n<pre>public&nbsp;void&nbsp;setSourceImage(byte[]&nbsp;jpegImage,\n                  int&nbsp;imageSize)\n                    throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Associate the JPEG image of length <code>imageSize</code> bytes stored in\n <code>jpegImage</code> with this decompressor instance.  This image will\n be used as the source image for subsequent decompress operations.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer.  This buffer is not modified.</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"setJPEGImage(byte[], int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>setJPEGImage</h4>\n<pre>@Deprecated\npublic&nbsp;void&nbsp;setJPEGImage(byte[]&nbsp;jpegImage,\n                           int&nbsp;imageSize)\n                  throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)\"><code>setSourceImage(byte[], int)</code></a> instead.</i></div>\n<dl><dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>setSourceImage</h4>\n<pre>public&nbsp;void&nbsp;setSourceImage(<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a>&nbsp;srcImage)</pre>\n<div class=\"block\">Associate the specified YUV planar source image with this decompressor\n instance.  Subsequent decompress operations will decode this image into an\n RGB or grayscale destination image.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>srcImage</code> - <a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>YUVImage</code></a> instance containing a YUV planar image to\n be decoded.  This image is not modified.</dd></dl>\n</li>\n</ul>\n<a name=\"getWidth()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getWidth</h4>\n<pre>public&nbsp;int&nbsp;getWidth()</pre>\n<div class=\"block\">Returns the width of the source image (JPEG or YUV) associated with this\n decompressor instance.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the width of the source image (JPEG or YUV) associated with this\n decompressor instance.</dd></dl>\n</li>\n</ul>\n<a name=\"getHeight()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getHeight</h4>\n<pre>public&nbsp;int&nbsp;getHeight()</pre>\n<div class=\"block\">Returns the height of the source image (JPEG or YUV) associated with this\n decompressor instance.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the height of the source image (JPEG or YUV) associated with this\n decompressor instance.</dd></dl>\n</li>\n</ul>\n<a name=\"getSubsamp()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getSubsamp</h4>\n<pre>public&nbsp;int&nbsp;getSubsamp()</pre>\n<div class=\"block\">Returns the level of chrominance subsampling used in the source image\n (JPEG or YUV) associated with this decompressor instance.  See\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444\"><code>TJ.SAMP_*</code></a>.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the level of chrominance subsampling used in the source image\n (JPEG or YUV) associated with this decompressor instance.</dd></dl>\n</li>\n</ul>\n<a name=\"getColorspace()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getColorspace</h4>\n<pre>public&nbsp;int&nbsp;getColorspace()</pre>\n<div class=\"block\">Returns the colorspace used in the source image (JPEG or YUV) associated\n with this decompressor instance.  See <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#CS_RGB\"><code>TJ.CS_*</code></a>.  If the\n source image is YUV, then this always returns <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr\"><code>TJ.CS_YCbCr</code></a>.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the colorspace used in the source image (JPEG or YUV) associated\n with this decompressor instance.</dd></dl>\n</li>\n</ul>\n<a name=\"getJPEGBuf()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getJPEGBuf</h4>\n<pre>public&nbsp;byte[]&nbsp;getJPEGBuf()</pre>\n<div class=\"block\">Returns the JPEG image buffer associated with this decompressor instance.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the JPEG image buffer associated with this decompressor instance.</dd></dl>\n</li>\n</ul>\n<a name=\"getJPEGSize()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getJPEGSize</h4>\n<pre>public&nbsp;int&nbsp;getJPEGSize()</pre>\n<div class=\"block\">Returns the size of the JPEG image (in bytes) associated with this\n decompressor instance.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the size of the JPEG image (in bytes) associated with this\n decompressor instance.</dd></dl>\n</li>\n</ul>\n<a name=\"getScaledWidth(int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getScaledWidth</h4>\n<pre>public&nbsp;int&nbsp;getScaledWidth(int&nbsp;desiredWidth,\n                 int&nbsp;desiredHeight)</pre>\n<div class=\"block\">Returns the width of the largest scaled-down image that the TurboJPEG\n decompressor can generate without exceeding the desired image width and\n height.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>desiredWidth</code> - desired width (in pixels) of the decompressed image.\n Setting this to 0 is the same as setting it to the width of the JPEG image\n (in other words, the width will not be considered when determining the\n scaled image size.)</dd><dd><code>desiredHeight</code> - desired height (in pixels) of the decompressed image.\n Setting this to 0 is the same as setting it to the height of the JPEG\n image (in other words, the height will not be considered when determining\n the scaled image size.)</dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>the width of the largest scaled-down image that the TurboJPEG\n decompressor can generate without exceeding the desired image width and\n height.</dd></dl>\n</li>\n</ul>\n<a name=\"getScaledHeight(int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getScaledHeight</h4>\n<pre>public&nbsp;int&nbsp;getScaledHeight(int&nbsp;desiredWidth,\n                  int&nbsp;desiredHeight)</pre>\n<div class=\"block\">Returns the height of the largest scaled-down image that the TurboJPEG\n decompressor can generate without exceeding the desired image width and\n height.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>desiredWidth</code> - desired width (in pixels) of the decompressed image.\n Setting this to 0 is the same as setting it to the width of the JPEG image\n (in other words, the width will not be considered when determining the\n scaled image size.)</dd><dd><code>desiredHeight</code> - desired height (in pixels) of the decompressed image.\n Setting this to 0 is the same as setting it to the height of the JPEG\n image (in other words, the height will not be considered when determining\n the scaled image size.)</dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>the height of the largest scaled-down image that the TurboJPEG\n decompressor can generate without exceeding the desired image width and\n height.</dd></dl>\n</li>\n</ul>\n<a name=\"decompress(byte[], int, int, int, int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>decompress</h4>\n<pre>public&nbsp;void&nbsp;decompress(byte[]&nbsp;dstBuf,\n              int&nbsp;x,\n              int&nbsp;y,\n              int&nbsp;desiredWidth,\n              int&nbsp;pitch,\n              int&nbsp;desiredHeight,\n              int&nbsp;pixelFormat,\n              int&nbsp;flags)\n                throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Decompress the JPEG source image or decode the YUV source image associated\n with this decompressor instance and output a grayscale, RGB, or CMYK image\n to the given destination buffer.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>dstBuf</code> - buffer that will receive the decompressed/decoded image.\n If the source image is a JPEG image, then this buffer should normally be\n <code>pitch * scaledHeight</code> bytes in size, where\n <code>scaledHeight</code> can be determined by calling <code>\n scalingFactor.<a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)\"><code>getScaled</code></a>(jpegHeight)\n </code> with one of the scaling factors returned from <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()\"><code>TJ.getScalingFactors()</code></a> or by calling <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)\"><code>getScaledHeight(int, int)</code></a>.  If the\n source image is a YUV image, then this buffer should normally be\n <code>pitch * height</code> bytes in size, where <code>height</code> is\n the height of the YUV image.  However, the buffer may also be larger than\n the dimensions of the source image, in which case the <code>x</code>,\n <code>y</code>, and <code>pitch</code> parameters can be used to specify\n the region into which the source image should be decompressed/decoded.</dd><dd><code>x</code> - x offset (in pixels) of the region in the destination image into\n which the source image should be decompressed/decoded</dd><dd><code>y</code> - y offset (in pixels) of the region in the destination image into\n which the source image should be decompressed/decoded</dd><dd><code>desiredWidth</code> - If the source image is a JPEG image, then this\n specifies the desired width (in pixels) of the decompressed image (or\n image region.)  If the desired destination image dimensions are different\n than the source image dimensions, then TurboJPEG will use scaling in the\n JPEG decompressor to generate the largest possible image that will fit\n within the desired dimensions.  Setting this to 0 is the same as setting\n it to the width of the JPEG image (in other words, the width will not be\n considered when determining the scaled image size.)  This parameter is\n ignored if the source image is a YUV image.</dd><dd><code>pitch</code> - bytes per line of the destination image.  Normally, this\n should be set to <code>scaledWidth * TJ.pixelSize(pixelFormat)</code> if\n the destination image is unpadded, but you can use this to, for instance,\n pad each line of the destination image to a 4-byte boundary or to\n decompress/decode the source image into a region of a larger image.  NOTE:\n if the source image is a JPEG image, then <code>scaledWidth</code> can be\n determined by calling <code>\n scalingFactor.<a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)\"><code>getScaled</code></a>(jpegWidth)\n </code> or by calling <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)\"><code>getScaledWidth(int, int)</code></a>.  If the source image is a\n YUV image, then <code>scaledWidth</code> is the width of the YUV image.\n Setting this parameter to 0 is the equivalent of setting it to\n <code>scaledWidth * TJ.pixelSize(pixelFormat)</code>.</dd><dd><code>desiredHeight</code> - If the source image is a JPEG image, then this\n specifies the desired height (in pixels) of the decompressed image (or\n image region.)  If the desired destination image dimensions are different\n than the source image dimensions, then TurboJPEG will use scaling in the\n JPEG decompressor to generate the largest possible image that will fit\n within the desired dimensions.  Setting this to 0 is the same as setting\n it to the height of the JPEG image (in other words, the height will not be\n considered when determining the scaled image size.)  This parameter is\n ignored if the source image is a YUV image.</dd><dd><code>pixelFormat</code> - pixel format of the decompressed/decoded image (one of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB\"><code>TJ.PF_*</code></a>)</dd><dd><code>flags</code> - the bitwise OR of one or more of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\"><code>TJ.FLAG_*</code></a></dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"decompress(byte[], int, int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>decompress</h4>\n<pre>@Deprecated\npublic&nbsp;void&nbsp;decompress(byte[]&nbsp;dstBuf,\n                         int&nbsp;desiredWidth,\n                         int&nbsp;pitch,\n                         int&nbsp;desiredHeight,\n                         int&nbsp;pixelFormat,\n                         int&nbsp;flags)\n                throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>Use\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)\"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>\n<dl><dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"decompress(int, int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>decompress</h4>\n<pre>public&nbsp;byte[]&nbsp;decompress(int&nbsp;desiredWidth,\n                int&nbsp;pitch,\n                int&nbsp;desiredHeight,\n                int&nbsp;pixelFormat,\n                int&nbsp;flags)\n                  throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Decompress the JPEG source image associated with this decompressor\n instance and return a buffer containing the decompressed image.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>desiredWidth</code> - see\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)\"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a>\n for description</dd><dd><code>pitch</code> - see\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)\"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a>\n for description</dd><dd><code>desiredHeight</code> - see\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)\"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a>\n for description</dd><dd><code>pixelFormat</code> - pixel format of the decompressed image (one of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB\"><code>TJ.PF_*</code></a>)</dd><dd><code>flags</code> - the bitwise OR of one or more of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\"><code>TJ.FLAG_*</code></a></dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>a buffer containing the decompressed image.</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>decompressToYUV</h4>\n<pre>public&nbsp;void&nbsp;decompressToYUV(<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a>&nbsp;dstImage,\n                   int&nbsp;flags)\n                     throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Decompress the JPEG source image associated with this decompressor\n instance into a YUV planar image and store it in the given\n <code>YUVImage</code> instance.  This method performs JPEG decompression\n but leaves out the color conversion step, so a planar YUV image is\n generated instead of an RGB or grayscale image.  This method cannot be\n used to decompress JPEG source images with the CMYK or YCCK colorspace.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>dstImage</code> - <a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>YUVImage</code></a> instance that will receive the YUV planar\n image.  The level of subsampling specified in this <code>YUVImage</code>\n instance must match that of the JPEG image, and the width and height\n specified in the <code>YUVImage</code> instance must match one of the\n scaled image sizes that TurboJPEG is capable of generating from the JPEG\n source image.</dd><dd><code>flags</code> - the bitwise OR of one or more of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\"><code>TJ.FLAG_*</code></a></dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"decompressToYUV(byte[], int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>decompressToYUV</h4>\n<pre>@Deprecated\npublic&nbsp;void&nbsp;decompressToYUV(byte[]&nbsp;dstBuf,\n                              int&nbsp;flags)\n                     throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)\"><code>decompressToYUV(YUVImage, int)</code></a> instead.</i></div>\n<dl><dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"decompressToYUV(int, int[], int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>decompressToYUV</h4>\n<pre>public&nbsp;<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a>&nbsp;decompressToYUV(int&nbsp;desiredWidth,\n                       int[]&nbsp;strides,\n                       int&nbsp;desiredHeight,\n                       int&nbsp;flags)\n                         throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Decompress the JPEG source image associated with this decompressor\n instance into a set of Y, U (Cb), and V (Cr) image planes and return a\n <code>YUVImage</code> instance containing the decompressed image planes.\n This method performs JPEG decompression but leaves out the color\n conversion step, so a planar YUV image is generated instead of an RGB or\n grayscale image.  This method cannot be used to decompress JPEG source\n images with the CMYK or YCCK colorspace.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>desiredWidth</code> - desired width (in pixels) of the YUV image.  If the\n desired image dimensions are different than the dimensions of the JPEG\n image being decompressed, then TurboJPEG will use scaling in the JPEG\n decompressor to generate the largest possible image that will fit within\n the desired dimensions.  Setting this to 0 is the same as setting it to\n the width of the JPEG image (in other words, the width will not be\n considered when determining the scaled image size.)</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes\n per line in the corresponding plane of the output image.  Setting the\n stride for any plane to 0 is the same as setting it to the scaled\n component width of the plane.  If <tt>strides</tt> is NULL, then the\n strides for all planes will be set to their respective scaled component\n widths.  You can adjust the strides in order to add an arbitrary amount of\n line padding to each plane.</dd><dd><code>desiredHeight</code> - desired height (in pixels) of the YUV image.  If the\n desired image dimensions are different than the dimensions of the JPEG\n image being decompressed, then TurboJPEG will use scaling in the JPEG\n decompressor to generate the largest possible image that will fit within\n the desired dimensions.  Setting this to 0 is the same as setting it to\n the height of the JPEG image (in other words, the height will not be\n considered when determining the scaled image size.)</dd><dd><code>flags</code> - the bitwise OR of one or more of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\"><code>TJ.FLAG_*</code></a></dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>a YUV planar image.</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"decompressToYUV(int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>decompressToYUV</h4>\n<pre>public&nbsp;<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a>&nbsp;decompressToYUV(int&nbsp;desiredWidth,\n                       int&nbsp;pad,\n                       int&nbsp;desiredHeight,\n                       int&nbsp;flags)\n                         throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Decompress the JPEG source image associated with this decompressor\n instance into a unified YUV planar image buffer and return a\n <code>YUVImage</code> instance containing the decompressed image.  This\n method performs JPEG decompression but leaves out the color conversion\n step, so a planar YUV image is generated instead of an RGB or grayscale\n image.  This method cannot be used to decompress JPEG source images with\n the CMYK or YCCK colorspace.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>desiredWidth</code> - desired width (in pixels) of the YUV image.  If the\n desired image dimensions are different than the dimensions of the JPEG\n image being decompressed, then TurboJPEG will use scaling in the JPEG\n decompressor to generate the largest possible image that will fit within\n the desired dimensions.  Setting this to 0 is the same as setting it to\n the width of the JPEG image (in other words, the width will not be\n considered when determining the scaled image size.)</dd><dd><code>pad</code> - the width of each line in each plane of the YUV image will be\n padded to the nearest multiple of this number of bytes (must be a power of\n 2.)</dd><dd><code>desiredHeight</code> - desired height (in pixels) of the YUV image.  If the\n desired image dimensions are different than the dimensions of the JPEG\n image being decompressed, then TurboJPEG will use scaling in the JPEG\n decompressor to generate the largest possible image that will fit within\n the desired dimensions.  Setting this to 0 is the same as setting it to\n the height of the JPEG image (in other words, the height will not be\n considered when determining the scaled image size.)</dd><dd><code>flags</code> - the bitwise OR of one or more of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\"><code>TJ.FLAG_*</code></a></dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>a YUV planar image.</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"decompressToYUV(int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>decompressToYUV</h4>\n<pre>@Deprecated\npublic&nbsp;byte[]&nbsp;decompressToYUV(int&nbsp;flags)\n                       throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)\"><code>decompressToYUV(int, int, int, int)</code></a> instead.</i></div>\n<dl><dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"decompress(int[], int, int, int, int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>decompress</h4>\n<pre>public&nbsp;void&nbsp;decompress(int[]&nbsp;dstBuf,\n              int&nbsp;x,\n              int&nbsp;y,\n              int&nbsp;desiredWidth,\n              int&nbsp;stride,\n              int&nbsp;desiredHeight,\n              int&nbsp;pixelFormat,\n              int&nbsp;flags)\n                throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Decompress the JPEG source image or decode the YUV source image associated\n with this decompressor instance and output a grayscale, RGB, or CMYK image\n to the given destination buffer.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>dstBuf</code> - buffer that will receive the decompressed/decoded image.\n If the source image is a JPEG image, then this buffer should normally be\n <code>stride * scaledHeight</code> pixels in size, where\n <code>scaledHeight</code> can be determined by calling <code>\n scalingFactor.<a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)\"><code>getScaled</code></a>(jpegHeight)\n </code> with one of the scaling factors returned from <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()\"><code>TJ.getScalingFactors()</code></a> or by calling <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)\"><code>getScaledHeight(int, int)</code></a>.  If the\n source image is a YUV image, then this buffer should normally be\n <code>stride * height</code> pixels in size, where <code>height</code> is\n the height of the YUV image.  However, the buffer may also be larger than\n the dimensions of the JPEG image, in which case the <code>x</code>,\n <code>y</code>, and <code>stride</code> parameters can be used to specify\n the region into which the source image should be decompressed.</dd><dd><code>x</code> - x offset (in pixels) of the region in the destination image into\n which the source image should be decompressed/decoded</dd><dd><code>y</code> - y offset (in pixels) of the region in the destination image into\n which the source image should be decompressed/decoded</dd><dd><code>desiredWidth</code> - If the source image is a JPEG image, then this\n specifies the desired width (in pixels) of the decompressed image (or\n image region.)  If the desired destination image dimensions are different\n than the source image dimensions, then TurboJPEG will use scaling in the\n JPEG decompressor to generate the largest possible image that will fit\n within the desired dimensions.  Setting this to 0 is the same as setting\n it to the width of the JPEG image (in other words, the width will not be\n considered when determining the scaled image size.)  This parameter is\n ignored if the source image is a YUV image.</dd><dd><code>stride</code> - pixels per line of the destination image.  Normally, this\n should be set to <code>scaledWidth</code>, but you can use this to, for\n instance, decompress the JPEG image into a region of a larger image.\n NOTE: if the source image is a JPEG image, then <code>scaledWidth</code>\n can be determined by calling <code>\n scalingFactor.<a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)\"><code>getScaled</code></a>(jpegWidth)\n </code> or by calling <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)\"><code>getScaledWidth(int, int)</code></a>.  If the source image is a\n YUV image, then <code>scaledWidth</code> is the width of the YUV image.\n Setting this parameter to 0 is the equivalent of setting it to\n <code>scaledWidth</code>.</dd><dd><code>desiredHeight</code> - If the source image is a JPEG image, then this\n specifies the desired height (in pixels) of the decompressed image (or\n image region.)  If the desired destination image dimensions are different\n than the source image dimensions, then TurboJPEG will use scaling in the\n JPEG decompressor to generate the largest possible image that will fit\n within the desired dimensions.  Setting this to 0 is the same as setting\n it to the height of the JPEG image (in other words, the height will not be\n considered when determining the scaled image size.)  This parameter is\n ignored if the source image is a YUV image.</dd><dd><code>pixelFormat</code> - pixel format of the decompressed image (one of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB\"><code>TJ.PF_*</code></a>)</dd><dd><code>flags</code> - the bitwise OR of one or more of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\"><code>TJ.FLAG_*</code></a></dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"decompress(java.awt.image.BufferedImage, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>decompress</h4>\n<pre>public&nbsp;void&nbsp;decompress(java.awt.image.BufferedImage&nbsp;dstImage,\n              int&nbsp;flags)\n                throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Decompress the JPEG source image or decode the YUV source image associated\n with this decompressor instance and output a decompressed/decoded image to\n the given <code>BufferedImage</code> instance.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>dstImage</code> - a <code>BufferedImage</code> instance that will receive\n the decompressed/decoded image.  If the source image is a JPEG image, then\n the width and height of the <code>BufferedImage</code> instance must match\n one of the scaled image sizes that TurboJPEG is capable of generating from\n the JPEG image.  If the source image is a YUV image, then the width and\n height of the <code>BufferedImage</code> instance must match the width and\n height of the YUV image.</dd><dd><code>flags</code> - the bitwise OR of one or more of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\"><code>TJ.FLAG_*</code></a></dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"decompress(int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>decompress</h4>\n<pre>public&nbsp;java.awt.image.BufferedImage&nbsp;decompress(int&nbsp;desiredWidth,\n                                      int&nbsp;desiredHeight,\n                                      int&nbsp;bufferedImageType,\n                                      int&nbsp;flags)\n                                        throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Decompress the JPEG source image or decode the YUV source image associated\n with this decompressor instance and return a <code>BufferedImage</code>\n instance containing the decompressed/decoded image.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>desiredWidth</code> - see\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)\"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> for\n description</dd><dd><code>desiredHeight</code> - see\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)\"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> for\n description</dd><dd><code>bufferedImageType</code> - the image type of the <code>BufferedImage</code>\n instance that will be created (for instance,\n <code>BufferedImage.TYPE_INT_RGB</code>)</dd><dd><code>flags</code> - the bitwise OR of one or more of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\"><code>TJ.FLAG_*</code></a></dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>a <code>BufferedImage</code> instance containing the\n decompressed/decoded image.</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"close()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>close</h4>\n<pre>public&nbsp;void&nbsp;close()\n           throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Free the native structures associated with this decompressor instance.</div>\n<dl>\n<dt><strong>Specified by:</strong></dt>\n<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.io.Closeable</code></dd>\n<dt><strong>Specified by:</strong></dt>\n<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.lang.AutoCloseable</code></dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"finalize()\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>finalize</h4>\n<pre>protected&nbsp;void&nbsp;finalize()\n                 throws java.lang.Throwable</pre>\n<dl>\n<dt><strong>Overrides:</strong></dt>\n<dd><code>finalize</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code>java.lang.Throwable</code></dd></dl>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n<!-- ========= END OF CLASS DATA ========= -->\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJDecompressor.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJDecompressor.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li><a href=\"#field_summary\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li><a href=\"#field_detail\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/org/libjpegturbo/turbojpeg/TJException.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>TJException</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"TJException\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJException.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJException.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#methods_inherited_from_class_java.lang.Throwable\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li>Method</li>\n</ul>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<!-- ======== START OF CLASS DATA ======== -->\n<div class=\"header\">\n<div class=\"subTitle\">org.libjpegturbo.turbojpeg</div>\n<h2 title=\"Class TJException\" class=\"title\">Class TJException</h2>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"inheritance\">\n<li>java.lang.Object</li>\n<li>\n<ul class=\"inheritance\">\n<li>java.lang.Throwable</li>\n<li>\n<ul class=\"inheritance\">\n<li>java.lang.Exception</li>\n<li>\n<ul class=\"inheritance\">\n<li>java.io.IOException</li>\n<li>\n<ul class=\"inheritance\">\n<li>org.libjpegturbo.turbojpeg.TJException</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<div class=\"description\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<dl>\n<dt>All Implemented Interfaces:</dt>\n<dd>java.io.Serializable</dd>\n</dl>\n<hr>\n<br>\n<pre>public class <span class=\"strong\">TJException</span>\nextends java.io.IOException</pre>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../serialized-form.html#org.libjpegturbo.turbojpeg.TJException\">Serialized Form</a></dd></dl>\n</li>\n</ul>\n</div>\n<div class=\"summary\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_summary\">\n<!--   -->\n</a>\n<h3>Constructor Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Constructor Summary table, listing constructors, and an explanation\">\n<caption><span>Constructors</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Constructor and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html#TJException()\">TJException</a></strong>()</code>&nbsp;</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.String)\">TJException</a></strong>(java.lang.String&nbsp;message)</code>&nbsp;</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.String,%20java.lang.Throwable)\">TJException</a></strong>(java.lang.String&nbsp;message,\n           java.lang.Throwable&nbsp;cause)</code>&nbsp;</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html#TJException(java.lang.Throwable)\">TJException</a></strong>(java.lang.Throwable&nbsp;cause)</code>&nbsp;</td>\n</tr>\n</table>\n</li>\n</ul>\n<!-- ========== METHOD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_summary\">\n<!--   -->\n</a>\n<h3>Method Summary</h3>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"methods_inherited_from_class_java.lang.Throwable\">\n<!--   -->\n</a>\n<h3>Methods inherited from class&nbsp;java.lang.Throwable</h3>\n<code>addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</code></li>\n</ul>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"methods_inherited_from_class_java.lang.Object\">\n<!--   -->\n</a>\n<h3>Methods inherited from class&nbsp;java.lang.Object</h3>\n<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"details\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ========= CONSTRUCTOR DETAIL ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_detail\">\n<!--   -->\n</a>\n<h3>Constructor Detail</h3>\n<a name=\"TJException()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>TJException</h4>\n<pre>public&nbsp;TJException()</pre>\n</li>\n</ul>\n<a name=\"TJException(java.lang.String, java.lang.Throwable)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>TJException</h4>\n<pre>public&nbsp;TJException(java.lang.String&nbsp;message,\n           java.lang.Throwable&nbsp;cause)</pre>\n</li>\n</ul>\n<a name=\"TJException(java.lang.String)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>TJException</h4>\n<pre>public&nbsp;TJException(java.lang.String&nbsp;message)</pre>\n</li>\n</ul>\n<a name=\"TJException(java.lang.Throwable)\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>TJException</h4>\n<pre>public&nbsp;TJException(java.lang.Throwable&nbsp;cause)</pre>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n<!-- ========= END OF CLASS DATA ========= -->\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJException.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJException.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#methods_inherited_from_class_java.lang.Throwable\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li>Method</li>\n</ul>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>TJScalingFactor</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"TJScalingFactor\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJScalingFactor.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJScalingFactor.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<!-- ======== START OF CLASS DATA ======== -->\n<div class=\"header\">\n<div class=\"subTitle\">org.libjpegturbo.turbojpeg</div>\n<h2 title=\"Class TJScalingFactor\" class=\"title\">Class TJScalingFactor</h2>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"inheritance\">\n<li>java.lang.Object</li>\n<li>\n<ul class=\"inheritance\">\n<li>org.libjpegturbo.turbojpeg.TJScalingFactor</li>\n</ul>\n</li>\n</ul>\n<div class=\"description\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<hr>\n<br>\n<pre>public class <span class=\"strong\">TJScalingFactor</span>\nextends java.lang.Object</pre>\n<div class=\"block\">Fractional scaling factor</div>\n</li>\n</ul>\n</div>\n<div class=\"summary\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_summary\">\n<!--   -->\n</a>\n<h3>Constructor Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Constructor Summary table, listing constructors, and an explanation\">\n<caption><span>Constructors</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Constructor and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#TJScalingFactor(int,%20int)\">TJScalingFactor</a></strong>(int&nbsp;num,\n               int&nbsp;denom)</code>&nbsp;</td>\n</tr>\n</table>\n</li>\n</ul>\n<!-- ========== METHOD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_summary\">\n<!--   -->\n</a>\n<h3>Method Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Method Summary table, listing methods, and an explanation\">\n<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Method and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>boolean</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#equals(org.libjpegturbo.turbojpeg.TJScalingFactor)\">equals</a></strong>(<a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJScalingFactor</a>&nbsp;other)</code>\n<div class=\"block\">Returns true or false, depending on whether this instance and\n <code>other</code> have the same numerator and denominator.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getDenom()\">getDenom</a></strong>()</code>\n<div class=\"block\">Returns denominator</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getNum()\">getNum</a></strong>()</code>\n<div class=\"block\">Returns numerator</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)\">getScaled</a></strong>(int&nbsp;dimension)</code>\n<div class=\"block\">Returns the scaled value of <code>dimension</code>.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>boolean</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#isOne()\">isOne</a></strong>()</code>\n<div class=\"block\">Returns true or false, depending on whether this instance is equal to\n 1/1.</div>\n</td>\n</tr>\n</table>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"methods_inherited_from_class_java.lang.Object\">\n<!--   -->\n</a>\n<h3>Methods inherited from class&nbsp;java.lang.Object</h3>\n<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"details\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ========= CONSTRUCTOR DETAIL ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_detail\">\n<!--   -->\n</a>\n<h3>Constructor Detail</h3>\n<a name=\"TJScalingFactor(int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>TJScalingFactor</h4>\n<pre>public&nbsp;TJScalingFactor(int&nbsp;num,\n               int&nbsp;denom)</pre>\n</li>\n</ul>\n</li>\n</ul>\n<!-- ============ METHOD DETAIL ========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_detail\">\n<!--   -->\n</a>\n<h3>Method Detail</h3>\n<a name=\"getNum()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getNum</h4>\n<pre>public&nbsp;int&nbsp;getNum()</pre>\n<div class=\"block\">Returns numerator</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>numerator</dd></dl>\n</li>\n</ul>\n<a name=\"getDenom()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getDenom</h4>\n<pre>public&nbsp;int&nbsp;getDenom()</pre>\n<div class=\"block\">Returns denominator</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>denominator</dd></dl>\n</li>\n</ul>\n<a name=\"getScaled(int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getScaled</h4>\n<pre>public&nbsp;int&nbsp;getScaled(int&nbsp;dimension)</pre>\n<div class=\"block\">Returns the scaled value of <code>dimension</code>.  This function\n performs the integer equivalent of\n <code>ceil(dimension * scalingFactor)</code>.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the scaled value of <code>dimension</code>.</dd></dl>\n</li>\n</ul>\n<a name=\"equals(org.libjpegturbo.turbojpeg.TJScalingFactor)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>equals</h4>\n<pre>public&nbsp;boolean&nbsp;equals(<a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJScalingFactor</a>&nbsp;other)</pre>\n<div class=\"block\">Returns true or false, depending on whether this instance and\n <code>other</code> have the same numerator and denominator.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>true or false, depending on whether this instance and\n <code>other</code> have the same numerator and denominator.</dd></dl>\n</li>\n</ul>\n<a name=\"isOne()\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>isOne</h4>\n<pre>public&nbsp;boolean&nbsp;isOne()</pre>\n<div class=\"block\">Returns true or false, depending on whether this instance is equal to\n 1/1.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>true or false, depending on whether this instance is equal to\n 1/1.</dd></dl>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n<!-- ========= END OF CLASS DATA ========= -->\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJScalingFactor.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJScalingFactor.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>TJTransform</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"TJTransform\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJTransform.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJTransform.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li><a href=\"#nested_classes_inherited_from_class_java.awt.geom.Rectangle2D\">Nested</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#field_summary\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#methods_inherited_from_class_java.awt.Rectangle\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li><a href=\"#field_detail\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li>Method</li>\n</ul>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<!-- ======== START OF CLASS DATA ======== -->\n<div class=\"header\">\n<div class=\"subTitle\">org.libjpegturbo.turbojpeg</div>\n<h2 title=\"Class TJTransform\" class=\"title\">Class TJTransform</h2>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"inheritance\">\n<li>java.lang.Object</li>\n<li>\n<ul class=\"inheritance\">\n<li>java.awt.geom.RectangularShape</li>\n<li>\n<ul class=\"inheritance\">\n<li>java.awt.geom.Rectangle2D</li>\n<li>\n<ul class=\"inheritance\">\n<li>java.awt.Rectangle</li>\n<li>\n<ul class=\"inheritance\">\n<li>org.libjpegturbo.turbojpeg.TJTransform</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<div class=\"description\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<dl>\n<dt>All Implemented Interfaces:</dt>\n<dd>java.awt.Shape, java.io.Serializable, java.lang.Cloneable</dd>\n</dl>\n<hr>\n<br>\n<pre>public class <span class=\"strong\">TJTransform</span>\nextends java.awt.Rectangle</pre>\n<div class=\"block\">Lossless transform parameters</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../serialized-form.html#org.libjpegturbo.turbojpeg.TJTransform\">Serialized Form</a></dd></dl>\n</li>\n</ul>\n</div>\n<div class=\"summary\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ======== NESTED CLASS SUMMARY ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"nested_class_summary\">\n<!--   -->\n</a>\n<h3>Nested Class Summary</h3>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"nested_classes_inherited_from_class_java.awt.geom.Rectangle2D\">\n<!--   -->\n</a>\n<h3>Nested classes/interfaces inherited from class&nbsp;java.awt.geom.Rectangle2D</h3>\n<code>java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float</code></li>\n</ul>\n</li>\n</ul>\n<!-- =========== FIELD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"field_summary\">\n<!--   -->\n</a>\n<h3>Field Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Field Summary table, listing fields, and an explanation\">\n<caption><span>Fields</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Field and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\">TJCustomFilter</a></code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#cf\">cf</a></strong></code>\n<div class=\"block\">Custom filter instance</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#NUMOP\">NUMOP</a></strong></code>\n<div class=\"block\">The number of lossless transform operations</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#op\">op</a></strong></code>\n<div class=\"block\">Transform operation (one of <code>OP_*</code>)</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_HFLIP\">OP_HFLIP</a></strong></code>\n<div class=\"block\">Flip (mirror) image horizontally.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_NONE\">OP_NONE</a></strong></code>\n<div class=\"block\">Do not transform the position of the image pixels.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT180\">OP_ROT180</a></strong></code>\n<div class=\"block\">Rotate image 180 degrees.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT270\">OP_ROT270</a></strong></code>\n<div class=\"block\">Rotate image counter-clockwise by 90 degrees.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_ROT90\">OP_ROT90</a></strong></code>\n<div class=\"block\">Rotate image clockwise by 90 degrees.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSPOSE\">OP_TRANSPOSE</a></strong></code>\n<div class=\"block\">Transpose image (flip/mirror along upper left to lower right axis).</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_TRANSVERSE\">OP_TRANSVERSE</a></strong></code>\n<div class=\"block\">Transverse transpose image (flip/mirror along upper right to lower left\n axis).</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OP_VFLIP\">OP_VFLIP</a></strong></code>\n<div class=\"block\">Flip (mirror) image vertically.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP\">OPT_CROP</a></strong></code>\n<div class=\"block\">This option will enable lossless cropping.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_GRAY\">OPT_GRAY</a></strong></code>\n<div class=\"block\">This option will discard the color data in the input image and produce\n a grayscale output image.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT\">OPT_NOOUTPUT</a></strong></code>\n<div class=\"block\">This option will prevent <a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)\"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this\n particular transform.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT\">OPT_PERFECT</a></strong></code>\n<div class=\"block\">This option will cause <a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)\"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not\n perfect.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>static int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM\">OPT_TRIM</a></strong></code>\n<div class=\"block\">This option will discard any partial MCU blocks that cannot be\n transformed.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#options\">options</a></strong></code>\n<div class=\"block\">Transform options (bitwise OR of one or more of <code>OPT_*</code>)</div>\n</td>\n</tr>\n</table>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"fields_inherited_from_class_java.awt.Rectangle\">\n<!--   -->\n</a>\n<h3>Fields inherited from class&nbsp;java.awt.Rectangle</h3>\n<code>height, width, x, y</code></li>\n</ul>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"fields_inherited_from_class_java.awt.geom.Rectangle2D\">\n<!--   -->\n</a>\n<h3>Fields inherited from class&nbsp;java.awt.geom.Rectangle2D</h3>\n<code>OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP</code></li>\n</ul>\n</li>\n</ul>\n<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_summary\">\n<!--   -->\n</a>\n<h3>Constructor Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Constructor Summary table, listing constructors, and an explanation\">\n<caption><span>Constructors</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Constructor and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform()\">TJTransform</a></strong>()</code>\n<div class=\"block\">Create a new lossless transform instance.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(int,%20int,%20int,%20int,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)\">TJTransform</a></strong>(int&nbsp;x,\n           int&nbsp;y,\n           int&nbsp;w,\n           int&nbsp;h,\n           int&nbsp;op,\n           int&nbsp;options,\n           <a href=\"../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\">TJCustomFilter</a>&nbsp;cf)</code>\n<div class=\"block\">Create a new lossless transform instance with the given parameters.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(java.awt.Rectangle,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)\">TJTransform</a></strong>(java.awt.Rectangle&nbsp;r,\n           int&nbsp;op,\n           int&nbsp;options,\n           <a href=\"../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\">TJCustomFilter</a>&nbsp;cf)</code>\n<div class=\"block\">Create a new lossless transform instance with the given parameters.</div>\n</td>\n</tr>\n</table>\n</li>\n</ul>\n<!-- ========== METHOD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_summary\">\n<!--   -->\n</a>\n<h3>Method Summary</h3>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"methods_inherited_from_class_java.awt.Rectangle\">\n<!--   -->\n</a>\n<h3>Methods inherited from class&nbsp;java.awt.Rectangle</h3>\n<code>add, add, add, contains, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, toString, translate, union</code></li>\n</ul>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"methods_inherited_from_class_java.awt.geom.Rectangle2D\">\n<!--   -->\n</a>\n<h3>Methods inherited from class&nbsp;java.awt.geom.Rectangle2D</h3>\n<code>add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union</code></li>\n</ul>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"methods_inherited_from_class_java.awt.geom.RectangularShape\">\n<!--   -->\n</a>\n<h3>Methods inherited from class&nbsp;java.awt.geom.RectangularShape</h3>\n<code>clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal</code></li>\n</ul>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"methods_inherited_from_class_java.lang.Object\">\n<!--   -->\n</a>\n<h3>Methods inherited from class&nbsp;java.lang.Object</h3>\n<code>finalize, getClass, notify, notifyAll, wait, wait, wait</code></li>\n</ul>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"methods_inherited_from_class_java.awt.Shape\">\n<!--   -->\n</a>\n<h3>Methods inherited from interface&nbsp;java.awt.Shape</h3>\n<code>contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects</code></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"details\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ============ FIELD DETAIL =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"field_detail\">\n<!--   -->\n</a>\n<h3>Field Detail</h3>\n<a name=\"NUMOP\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>NUMOP</h4>\n<pre>public static final&nbsp;int NUMOP</pre>\n<div class=\"block\">The number of lossless transform operations</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.NUMOP\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"OP_NONE\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>OP_NONE</h4>\n<pre>public static final&nbsp;int OP_NONE</pre>\n<div class=\"block\">Do not transform the position of the image pixels.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_NONE\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"OP_HFLIP\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>OP_HFLIP</h4>\n<pre>public static final&nbsp;int OP_HFLIP</pre>\n<div class=\"block\">Flip (mirror) image horizontally.  This transform is imperfect if there\n are any partial MCU blocks on the right edge.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT\"><code>OPT_PERFECT</code></a>, \n<a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_HFLIP\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"OP_VFLIP\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>OP_VFLIP</h4>\n<pre>public static final&nbsp;int OP_VFLIP</pre>\n<div class=\"block\">Flip (mirror) image vertically.  This transform is imperfect if there are\n any partial MCU blocks on the bottom edge.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT\"><code>OPT_PERFECT</code></a>, \n<a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_VFLIP\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"OP_TRANSPOSE\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>OP_TRANSPOSE</h4>\n<pre>public static final&nbsp;int OP_TRANSPOSE</pre>\n<div class=\"block\">Transpose image (flip/mirror along upper left to lower right axis).  This\n transform is always perfect.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT\"><code>OPT_PERFECT</code></a>, \n<a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSPOSE\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"OP_TRANSVERSE\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>OP_TRANSVERSE</h4>\n<pre>public static final&nbsp;int OP_TRANSVERSE</pre>\n<div class=\"block\">Transverse transpose image (flip/mirror along upper right to lower left\n axis).  This transform is imperfect if there are any partial MCU blocks in\n the image.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT\"><code>OPT_PERFECT</code></a>, \n<a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_TRANSVERSE\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"OP_ROT90\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>OP_ROT90</h4>\n<pre>public static final&nbsp;int OP_ROT90</pre>\n<div class=\"block\">Rotate image clockwise by 90 degrees.  This transform is imperfect if\n there are any partial MCU blocks on the bottom edge.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT\"><code>OPT_PERFECT</code></a>, \n<a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_ROT90\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"OP_ROT180\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>OP_ROT180</h4>\n<pre>public static final&nbsp;int OP_ROT180</pre>\n<div class=\"block\">Rotate image 180 degrees.  This transform is imperfect if there are any\n partial MCU blocks in the image.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT\"><code>OPT_PERFECT</code></a>, \n<a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_ROT180\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"OP_ROT270\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>OP_ROT270</h4>\n<pre>public static final&nbsp;int OP_ROT270</pre>\n<div class=\"block\">Rotate image counter-clockwise by 90 degrees.  This transform is imperfect\n if there are any partial MCU blocks on the right edge.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT\"><code>OPT_PERFECT</code></a>, \n<a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OP_ROT270\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"OPT_PERFECT\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>OPT_PERFECT</h4>\n<pre>public static final&nbsp;int OPT_PERFECT</pre>\n<div class=\"block\">This option will cause <a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)\"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not\n perfect.  Lossless transforms operate on MCU blocks, whose size depends on\n the level of chrominance subsampling used.  If the image's width or height\n is not evenly divisible by the MCU block size (see <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUWidth(int)\"><code>TJ.getMCUWidth(int)</code></a>\n and <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUHeight(int)\"><code>TJ.getMCUHeight(int)</code></a>), then there will be partial MCU blocks on the\n right and/or bottom edges.   It is not possible to move these partial MCU\n blocks to the top or left of the image, so any transform that would\n require that is \"imperfect.\"  If this option is not specified, then any\n partial MCU blocks that cannot be transformed will be left in place, which\n will create odd-looking strips on the right or bottom edge of the image.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_PERFECT\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"OPT_TRIM\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>OPT_TRIM</h4>\n<pre>public static final&nbsp;int OPT_TRIM</pre>\n<div class=\"block\">This option will discard any partial MCU blocks that cannot be\n transformed.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_TRIM\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"OPT_CROP\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>OPT_CROP</h4>\n<pre>public static final&nbsp;int OPT_CROP</pre>\n<div class=\"block\">This option will enable lossless cropping.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_CROP\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"OPT_GRAY\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>OPT_GRAY</h4>\n<pre>public static final&nbsp;int OPT_GRAY</pre>\n<div class=\"block\">This option will discard the color data in the input image and produce\n a grayscale output image.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_GRAY\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"OPT_NOOUTPUT\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>OPT_NOOUTPUT</h4>\n<pre>public static final&nbsp;int OPT_NOOUTPUT</pre>\n<div class=\"block\">This option will prevent <a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)\"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this\n particular transform.  This can be used in conjunction with a custom\n filter to capture the transformed DCT coefficients without transcoding\n them.</div>\n<dl><dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_NOOUTPUT\">Constant Field Values</a></dd></dl>\n</li>\n</ul>\n<a name=\"op\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>op</h4>\n<pre>public&nbsp;int op</pre>\n<div class=\"block\">Transform operation (one of <code>OP_*</code>)</div>\n</li>\n</ul>\n<a name=\"options\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>options</h4>\n<pre>public&nbsp;int options</pre>\n<div class=\"block\">Transform options (bitwise OR of one or more of <code>OPT_*</code>)</div>\n</li>\n</ul>\n<a name=\"cf\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>cf</h4>\n<pre>public&nbsp;<a href=\"../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\">TJCustomFilter</a> cf</pre>\n<div class=\"block\">Custom filter instance</div>\n</li>\n</ul>\n</li>\n</ul>\n<!-- ========= CONSTRUCTOR DETAIL ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_detail\">\n<!--   -->\n</a>\n<h3>Constructor Detail</h3>\n<a name=\"TJTransform()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>TJTransform</h4>\n<pre>public&nbsp;TJTransform()</pre>\n<div class=\"block\">Create a new lossless transform instance.</div>\n</li>\n</ul>\n<a name=\"TJTransform(int, int, int, int, int, int, org.libjpegturbo.turbojpeg.TJCustomFilter)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>TJTransform</h4>\n<pre>public&nbsp;TJTransform(int&nbsp;x,\n           int&nbsp;y,\n           int&nbsp;w,\n           int&nbsp;h,\n           int&nbsp;op,\n           int&nbsp;options,\n           <a href=\"../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\">TJCustomFilter</a>&nbsp;cf)</pre>\n<div class=\"block\">Create a new lossless transform instance with the given parameters.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>x</code> - the left boundary of the cropping region.  This must be evenly\n divisible by the MCU block width (see <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUWidth(int)\"><code>TJ.getMCUWidth(int)</code></a>)</dd><dd><code>y</code> - the upper boundary of the cropping region.  This must be evenly\n divisible by the MCU block height (see <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUHeight(int)\"><code>TJ.getMCUHeight(int)</code></a>)</dd><dd><code>w</code> - the width of the cropping region.  Setting this to 0 is the\n equivalent of setting it to (width of the source JPEG image -\n <code>x</code>).</dd><dd><code>h</code> - the height of the cropping region.  Setting this to 0 is the\n equivalent of setting it to (height of the source JPEG image -\n <code>y</code>).</dd><dd><code>op</code> - one of the transform operations (<code>OP_*</code>)</dd><dd><code>options</code> - the bitwise OR of one or more of the transform options\n (<code>OPT_*</code>)</dd><dd><code>cf</code> - an instance of an object that implements the <a href=\"../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\"><code>TJCustomFilter</code></a> interface, or null if no custom filter is needed</dd></dl>\n</li>\n</ul>\n<a name=\"TJTransform(java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJCustomFilter)\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>TJTransform</h4>\n<pre>public&nbsp;TJTransform(java.awt.Rectangle&nbsp;r,\n           int&nbsp;op,\n           int&nbsp;options,\n           <a href=\"../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\">TJCustomFilter</a>&nbsp;cf)</pre>\n<div class=\"block\">Create a new lossless transform instance with the given parameters.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>r</code> - a <code>Rectangle</code> instance that specifies the cropping\n region.  See <a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(int,%20int,%20int,%20int,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)\"><code>TJTransform(int, int, int, int, int, int, TJCustomFilter)</code></a> for more\n detail.</dd><dd><code>op</code> - one of the transform operations (<code>OP_*</code>)</dd><dd><code>options</code> - the bitwise OR of one or more of the transform options\n (<code>OPT_*</code>)</dd><dd><code>cf</code> - an instance of an object that implements the <a href=\"../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\"><code>TJCustomFilter</code></a> interface, or null if no custom filter is needed</dd></dl>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n<!-- ========= END OF CLASS DATA ========= -->\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJTransform.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJTransform.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li><a href=\"#nested_classes_inherited_from_class_java.awt.geom.Rectangle2D\">Nested</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#field_summary\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#methods_inherited_from_class_java.awt.Rectangle\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li><a href=\"#field_detail\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li>Method</li>\n</ul>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>TJTransformer</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"TJTransformer\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJTransformer.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJTransformer.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li><a href=\"#fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<!-- ======== START OF CLASS DATA ======== -->\n<div class=\"header\">\n<div class=\"subTitle\">org.libjpegturbo.turbojpeg</div>\n<h2 title=\"Class TJTransformer\" class=\"title\">Class TJTransformer</h2>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"inheritance\">\n<li>java.lang.Object</li>\n<li>\n<ul class=\"inheritance\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">org.libjpegturbo.turbojpeg.TJDecompressor</a></li>\n<li>\n<ul class=\"inheritance\">\n<li>org.libjpegturbo.turbojpeg.TJTransformer</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<div class=\"description\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<dl>\n<dt>All Implemented Interfaces:</dt>\n<dd>java.io.Closeable, java.lang.AutoCloseable</dd>\n</dl>\n<hr>\n<br>\n<pre>public class <span class=\"strong\">TJTransformer</span>\nextends <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></pre>\n<div class=\"block\">TurboJPEG lossless transformer</div>\n</li>\n</ul>\n</div>\n<div class=\"summary\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- =========== FIELD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"field_summary\">\n<!--   -->\n</a>\n<h3>Field Summary</h3>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor\">\n<!--   -->\n</a>\n<h3>Fields inherited from class&nbsp;org.libjpegturbo.turbojpeg.<a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></h3>\n<code><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#handle\">handle</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBuf\">jpegBuf</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize\">jpegBufSize</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegColorspace\">jpegColorspace</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegHeight\">jpegHeight</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegSubsamp\">jpegSubsamp</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegWidth\">jpegWidth</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#yuvImage\">yuvImage</a></code></li>\n</ul>\n</li>\n</ul>\n<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_summary\">\n<!--   -->\n</a>\n<h3>Constructor Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Constructor Summary table, listing constructors, and an explanation\">\n<caption><span>Constructors</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Constructor and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer()\">TJTransformer</a></strong>()</code>\n<div class=\"block\">Create a TurboJPEG lossless transformer instance.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[])\">TJTransformer</a></strong>(byte[]&nbsp;jpegImage)</code>\n<div class=\"block\">Create a TurboJPEG lossless transformer instance and associate the JPEG\n image stored in <code>jpegImage</code> with the newly created instance.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[],%20int)\">TJTransformer</a></strong>(byte[]&nbsp;jpegImage,\n             int&nbsp;imageSize)</code>\n<div class=\"block\">Create a TurboJPEG lossless transformer instance and associate the JPEG\n image of length <code>imageSize</code> bytes stored in\n <code>jpegImage</code> with the newly created instance.</div>\n</td>\n</tr>\n</table>\n</li>\n</ul>\n<!-- ========== METHOD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_summary\">\n<!--   -->\n</a>\n<h3>Method Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Method Summary table, listing methods, and an explanation\">\n<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Method and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>int[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html#getTransformedSizes()\">getTransformedSizes</a></strong>()</code>\n<div class=\"block\">Returns an array containing the sizes of the transformed JPEG images\n generated by the most recent transform operation.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)\">transform</a></strong>(byte[][]&nbsp;dstBufs,\n         <a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a>[]&nbsp;transforms,\n         int&nbsp;flags)</code>\n<div class=\"block\">Losslessly transform the JPEG image associated with this transformer\n instance into one or more JPEG images stored in the given destination\n buffers.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a>[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(org.libjpegturbo.turbojpeg.TJTransform[],%20int)\">transform</a></strong>(<a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a>[]&nbsp;transforms,\n         int&nbsp;flags)</code>\n<div class=\"block\">Losslessly transform the JPEG image associated with this transformer\n instance and return an array of <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>TJDecompressor</code></a> instances, each of\n which has a transformed JPEG image associated with it.</div>\n</td>\n</tr>\n</table>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"methods_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor\">\n<!--   -->\n</a>\n<h3>Methods inherited from class&nbsp;org.libjpegturbo.turbojpeg.<a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></h3>\n<code><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#close()\">close</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage,%20int)\">decompress</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)\">decompress</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)\">decompress</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)\">decompress</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int)\">decompress</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int,%20int)\">decompress</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)\">decompressToYUV</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)\">decompressToYUV</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int[],%20int,%20int)\">decompressToYUV</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)\">decompressToYUV</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)\">decompressToYUV</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()\">finalize</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()\">getColorspace</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()\">getHeight</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()\">getJPEGBuf</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()\">getJPEGSize</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)\">getScaledHeight</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)\">getScaledWidth</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()\">getSubsamp</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()\">getWidth</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)\">setJPEGImage</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)\">setSourceImage</a>, <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)\">setSourceImage</a></code></li>\n</ul>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"methods_inherited_from_class_java.lang.Object\">\n<!--   -->\n</a>\n<h3>Methods inherited from class&nbsp;java.lang.Object</h3>\n<code>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"details\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ========= CONSTRUCTOR DETAIL ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_detail\">\n<!--   -->\n</a>\n<h3>Constructor Detail</h3>\n<a name=\"TJTransformer()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>TJTransformer</h4>\n<pre>public&nbsp;TJTransformer()\n              throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Create a TurboJPEG lossless transformer instance.</div>\n<dl><dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"TJTransformer(byte[])\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>TJTransformer</h4>\n<pre>public&nbsp;TJTransformer(byte[]&nbsp;jpegImage)\n              throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Create a TurboJPEG lossless transformer instance and associate the JPEG\n image stored in <code>jpegImage</code> with the newly created instance.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer (size of the JPEG image is assumed to\n be the length of the array.)  This buffer is not modified.</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"TJTransformer(byte[], int)\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>TJTransformer</h4>\n<pre>public&nbsp;TJTransformer(byte[]&nbsp;jpegImage,\n             int&nbsp;imageSize)\n              throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Create a TurboJPEG lossless transformer instance and associate the JPEG\n image of length <code>imageSize</code> bytes stored in\n <code>jpegImage</code> with the newly created instance.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer.  This buffer is not modified.</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n</li>\n</ul>\n<!-- ============ METHOD DETAIL ========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_detail\">\n<!--   -->\n</a>\n<h3>Method Detail</h3>\n<a name=\"transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>transform</h4>\n<pre>public&nbsp;void&nbsp;transform(byte[][]&nbsp;dstBufs,\n             <a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a>[]&nbsp;transforms,\n             int&nbsp;flags)\n               throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Losslessly transform the JPEG image associated with this transformer\n instance into one or more JPEG images stored in the given destination\n buffers.  Lossless transforms work by moving the raw coefficients from one\n JPEG image structure to another without altering the values of the\n coefficients.  While this is typically faster than decompressing the\n image, transforming it, and re-compressing it, lossless transforms are not\n free.  Each lossless transform requires reading and performing Huffman\n decoding on all of the coefficients in the source image, regardless of the\n size of the destination image.  Thus, this method provides a means of\n generating multiple transformed images from the same source or of applying\n multiple transformations simultaneously, in order to eliminate the need to\n read the source coefficients multiple times.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>dstBufs</code> - an array of image buffers.  <code>dstbufs[i]</code> will\n receive a JPEG image that has been transformed using the parameters in\n <code>transforms[i]</code>.  Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int,%20int,%20int)\"><code>TJ.bufSize(int, int, int)</code></a> to determine the\n maximum size for each buffer based on the transformed or cropped width and\n height and the level of subsampling used in the source image.</dd><dd><code>transforms</code> - an array of <a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>TJTransform</code></a> instances, each of\n which specifies the transform parameters and/or cropping region for the\n corresponding transformed output image</dd><dd><code>flags</code> - the bitwise OR of one or more of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\"><code>TJ.FLAG_*</code></a></dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"transform(org.libjpegturbo.turbojpeg.TJTransform[], int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>transform</h4>\n<pre>public&nbsp;<a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a>[]&nbsp;transform(<a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a>[]&nbsp;transforms,\n                         int&nbsp;flags)\n                           throws <a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></pre>\n<div class=\"block\">Losslessly transform the JPEG image associated with this transformer\n instance and return an array of <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>TJDecompressor</code></a> instances, each of\n which has a transformed JPEG image associated with it.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>transforms</code> - an array of <a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>TJTransform</code></a> instances, each of\n which specifies the transform parameters and/or cropping region for the\n corresponding transformed output image</dd><dd><code>flags</code> - the bitwise OR of one or more of\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP\"><code>TJ.FLAG_*</code></a></dd>\n<dt><span class=\"strong\">Returns:</span></dt><dd>an array of <a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>TJDecompressor</code></a> instances, each of\n which has a transformed JPEG image associated with it.</dd>\n<dt><span class=\"strong\">Throws:</span></dt>\n<dd><code><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></code></dd></dl>\n</li>\n</ul>\n<a name=\"getTransformedSizes()\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>getTransformedSizes</h4>\n<pre>public&nbsp;int[]&nbsp;getTransformedSizes()</pre>\n<div class=\"block\">Returns an array containing the sizes of the transformed JPEG images\n generated by the most recent transform operation.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>an array containing the sizes of the transformed JPEG images\n generated by the most recent transform operation.</dd></dl>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n<!-- ========= END OF CLASS DATA ========= -->\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/TJTransformer.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"TJTransformer.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li><a href=\"#fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li>Field&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/org/libjpegturbo/turbojpeg/YUVImage.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>YUVImage</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"YUVImage\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li>Next Class</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/YUVImage.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"YUVImage.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li><a href=\"#field_summary\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li><a href=\"#field_detail\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<!-- ======== START OF CLASS DATA ======== -->\n<div class=\"header\">\n<div class=\"subTitle\">org.libjpegturbo.turbojpeg</div>\n<h2 title=\"Class YUVImage\" class=\"title\">Class YUVImage</h2>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"inheritance\">\n<li>java.lang.Object</li>\n<li>\n<ul class=\"inheritance\">\n<li>org.libjpegturbo.turbojpeg.YUVImage</li>\n</ul>\n</li>\n</ul>\n<div class=\"description\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<hr>\n<br>\n<pre>public class <span class=\"strong\">YUVImage</span>\nextends java.lang.Object</pre>\n<div class=\"block\">This class encapsulates a YUV planar image and the metadata\n associated with it.  The TurboJPEG API allows both the JPEG compression and\n decompression pipelines to be split into stages:  YUV encode, compress from\n YUV, decompress to YUV, and YUV decode.  A <code>YUVImage</code> instance\n serves as the destination image for YUV encode and decompress-to-YUV\n operations and as the source image for compress-from-YUV and YUV decode\n operations.\n <p>\n Technically, the JPEG format uses the YCbCr colorspace (which technically is\n not a \"colorspace\" but rather a \"color transform\"), but per the convention\n of the digital video community, the TurboJPEG API uses \"YUV\" to refer to an\n image format consisting of Y, Cb, and Cr image planes.\n <p>\n Each plane is simply a 2D array of bytes, each byte representing the value\n of one of the components (Y, Cb, or Cr) at a particular location in the\n image.  The width and height of each plane are determined by the image\n width, height, and level of chrominance subsampling.  The luminance plane\n width is the image width padded to the nearest multiple of the horizontal\n subsampling factor (2 in the case of 4:2:0 and 4:2:2, 4 in the case of\n 4:1:1, 1 in the case of 4:4:4 or grayscale.)  Similarly, the luminance plane\n height is the image height padded to the nearest multiple of the vertical\n subsampling factor (2 in the case of 4:2:0 or 4:4:0, 1 in the case of 4:4:4\n or grayscale.)  The chrominance plane width is equal to the luminance plane\n width divided by the horizontal subsampling factor, and the chrominance\n plane height is equal to the luminance plane height divided by the vertical\n subsampling factor.\n <p>\n For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is\n used, then the luminance plane would be 36 x 35 bytes, and each of the\n chrominance planes would be 18 x 35 bytes.  If you specify a line padding of\n 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and\n each of the chrominance planes would be 20 x 35 bytes.</div>\n</li>\n</ul>\n</div>\n<div class=\"summary\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- =========== FIELD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"field_summary\">\n<!--   -->\n</a>\n<h3>Field Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Field Summary table, listing fields, and an explanation\">\n<caption><span>Fields</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Field and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>protected long</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#handle\">handle</a></strong></code>&nbsp;</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>protected int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvHeight\">yuvHeight</a></strong></code>&nbsp;</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>protected int[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvOffsets\">yuvOffsets</a></strong></code>&nbsp;</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>protected int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvPad\">yuvPad</a></strong></code>&nbsp;</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>protected byte[][]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvPlanes\">yuvPlanes</a></strong></code>&nbsp;</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>protected int[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvStrides\">yuvStrides</a></strong></code>&nbsp;</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>protected int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvSubsamp\">yuvSubsamp</a></strong></code>&nbsp;</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>protected int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvWidth\">yuvWidth</a></strong></code>&nbsp;</td>\n</tr>\n</table>\n</li>\n</ul>\n<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_summary\">\n<!--   -->\n</a>\n<h3>Constructor Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Constructor Summary table, listing constructors, and an explanation\">\n<caption><span>Constructors</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colOne\" scope=\"col\">Constructor and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[][],%20int[],%20int,%20int[],%20int,%20int)\">YUVImage</a></strong>(byte[][]&nbsp;planes,\n        int[]&nbsp;offsets,\n        int&nbsp;width,\n        int[]&nbsp;strides,\n        int&nbsp;height,\n        int&nbsp;subsamp)</code>\n<div class=\"block\">Create a new <code>YUVImage</code> instance from a set of existing image\n planes.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[],%20int,%20int,%20int,%20int)\">YUVImage</a></strong>(byte[]&nbsp;yuvImage,\n        int&nbsp;width,\n        int&nbsp;pad,\n        int&nbsp;height,\n        int&nbsp;subsamp)</code>\n<div class=\"block\">Create a new <code>YUVImage</code> instance from an existing unified image\n buffer.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int,%20int[],%20int,%20int)\">YUVImage</a></strong>(int&nbsp;width,\n        int[]&nbsp;strides,\n        int&nbsp;height,\n        int&nbsp;subsamp)</code>\n<div class=\"block\">Create a new <code>YUVImage</code> instance backed by separate image\n planes, and allocate memory for the image planes.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colOne\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int,%20int,%20int,%20int)\">YUVImage</a></strong>(int&nbsp;width,\n        int&nbsp;pad,\n        int&nbsp;height,\n        int&nbsp;subsamp)</code>\n<div class=\"block\">Create a new <code>YUVImage</code> instance backed by a unified image\n buffer, and allocate memory for the image buffer.</div>\n</td>\n</tr>\n</table>\n</li>\n</ul>\n<!-- ========== METHOD SUMMARY =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_summary\">\n<!--   -->\n</a>\n<h3>Method Summary</h3>\n<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Method Summary table, listing methods, and an explanation\">\n<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n<th class=\"colLast\" scope=\"col\">Method and Description</th>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>byte[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#getBuf()\">getBuf</a></strong>()</code>\n<div class=\"block\">Returns the YUV image buffer (if this image is stored in a unified\n buffer rather than separate image planes.)</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#getHeight()\">getHeight</a></strong>()</code>\n<div class=\"block\">Returns the height of the YUV image (or subregion.)</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>int[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#getOffsets()\">getOffsets</a></strong>()</code>\n<div class=\"block\">Returns the offsets (in bytes) of each plane within the planes of a larger\n YUV image.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#getPad()\">getPad</a></strong>()</code>\n<div class=\"block\">Returns the line padding used in the YUV image buffer (if this image is\n stored in a unified buffer rather than separate image planes.)</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>byte[][]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#getPlanes()\">getPlanes</a></strong>()</code>\n<div class=\"block\">Returns the YUV image planes.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#getSize()\">getSize</a></strong>()</code>\n<div class=\"block\">Returns the size (in bytes) of the YUV image buffer (if this image is\n stored in a unified buffer rather than separate image planes.)</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>int[]</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#getStrides()\">getStrides</a></strong>()</code>\n<div class=\"block\">Returns the number of bytes per line of each plane in the YUV image.</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#getSubsamp()\">getSubsamp</a></strong>()</code>\n<div class=\"block\">Returns the level of chrominance subsampling used in the YUV image.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>int</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#getWidth()\">getWidth</a></strong>()</code>\n<div class=\"block\">Returns the width of the YUV image (or subregion.)</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[][],%20int[],%20int,%20int[],%20int,%20int)\">setBuf</a></strong>(byte[][]&nbsp;planes,\n      int[]&nbsp;offsets,\n      int&nbsp;width,\n      int[]&nbsp;strides,\n      int&nbsp;height,\n      int&nbsp;subsamp)</code>\n<div class=\"block\">Assign a set of image planes to this <code>YUVImage</code> instance.</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><code><strong><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[],%20int,%20int,%20int,%20int)\">setBuf</a></strong>(byte[]&nbsp;yuvImage,\n      int&nbsp;width,\n      int&nbsp;pad,\n      int&nbsp;height,\n      int&nbsp;subsamp)</code>\n<div class=\"block\">Assign a unified image buffer to this <code>YUVImage</code> instance.</div>\n</td>\n</tr>\n</table>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"methods_inherited_from_class_java.lang.Object\">\n<!--   -->\n</a>\n<h3>Methods inherited from class&nbsp;java.lang.Object</h3>\n<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<div class=\"details\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<!-- ============ FIELD DETAIL =========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"field_detail\">\n<!--   -->\n</a>\n<h3>Field Detail</h3>\n<a name=\"handle\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>handle</h4>\n<pre>protected&nbsp;long handle</pre>\n</li>\n</ul>\n<a name=\"yuvPlanes\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>yuvPlanes</h4>\n<pre>protected&nbsp;byte[][] yuvPlanes</pre>\n</li>\n</ul>\n<a name=\"yuvOffsets\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>yuvOffsets</h4>\n<pre>protected&nbsp;int[] yuvOffsets</pre>\n</li>\n</ul>\n<a name=\"yuvStrides\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>yuvStrides</h4>\n<pre>protected&nbsp;int[] yuvStrides</pre>\n</li>\n</ul>\n<a name=\"yuvPad\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>yuvPad</h4>\n<pre>protected&nbsp;int yuvPad</pre>\n</li>\n</ul>\n<a name=\"yuvWidth\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>yuvWidth</h4>\n<pre>protected&nbsp;int yuvWidth</pre>\n</li>\n</ul>\n<a name=\"yuvHeight\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>yuvHeight</h4>\n<pre>protected&nbsp;int yuvHeight</pre>\n</li>\n</ul>\n<a name=\"yuvSubsamp\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>yuvSubsamp</h4>\n<pre>protected&nbsp;int yuvSubsamp</pre>\n</li>\n</ul>\n</li>\n</ul>\n<!-- ========= CONSTRUCTOR DETAIL ======== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"constructor_detail\">\n<!--   -->\n</a>\n<h3>Constructor Detail</h3>\n<a name=\"YUVImage(int, int[], int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>YUVImage</h4>\n<pre>public&nbsp;YUVImage(int&nbsp;width,\n        int[]&nbsp;strides,\n        int&nbsp;height,\n        int&nbsp;subsamp)</pre>\n<div class=\"block\">Create a new <code>YUVImage</code> instance backed by separate image\n planes, and allocate memory for the image planes.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes\n per line in the corresponding plane of the YUV image.  Setting the stride\n for any plane to 0 is the same as setting it to the plane width (see\n <a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>above</code></a>.)  If <code>strides</code> is null, then the\n strides for all planes will be set to their respective plane widths.  When\n using this constructor, the stride for each plane must be equal to or\n greater than the plane width.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling to be used in the YUV\n image (one of <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444\"><code>TJ.SAMP_*</code></a>)</dd></dl>\n</li>\n</ul>\n<a name=\"YUVImage(int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>YUVImage</h4>\n<pre>public&nbsp;YUVImage(int&nbsp;width,\n        int&nbsp;pad,\n        int&nbsp;height,\n        int&nbsp;subsamp)</pre>\n<div class=\"block\">Create a new <code>YUVImage</code> instance backed by a unified image\n buffer, and allocate memory for the image buffer.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - Each line of each plane in the YUV image buffer will be padded\n to this number of bytes (must be a power of 2.)</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling to be used in the YUV\n image (one of <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444\"><code>TJ.SAMP_*</code></a>)</dd></dl>\n</li>\n</ul>\n<a name=\"YUVImage(byte[][], int[], int, int[], int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>YUVImage</h4>\n<pre>public&nbsp;YUVImage(byte[][]&nbsp;planes,\n        int[]&nbsp;offsets,\n        int&nbsp;width,\n        int[]&nbsp;strides,\n        int&nbsp;height,\n        int&nbsp;subsamp)</pre>\n<div class=\"block\">Create a new <code>YUVImage</code> instance from a set of existing image\n planes.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>planes</code> - an array of buffers representing the Y, U (Cb), and V (Cr)\n image planes (or just the Y plane, if the image is grayscale.)   These\n planes can be contiguous or non-contiguous in memory.  Plane\n <code>i</code> should be at least <code>offsets[i] +\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#planeSizeYUV(int,%20int,%20int,%20int,%20int)\"><code>TJ.planeSizeYUV</code></a>(i, width, strides[i], height, subsamp)</code>\n bytes in size.</dd><dd><code>offsets</code> - If this <code>YUVImage</code> instance represents a\n subregion of a larger image, then <code>offsets[i]</code> specifies the\n offset (in bytes) of the subregion within plane <code>i</code> of the\n larger image.  Setting this to null is the same as setting the offsets for\n all planes to 0.</dd><dd><code>width</code> - width (in pixels) of the new YUV image (or subregion)</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes\n per line in the corresponding plane of the YUV image.  Setting the stride\n for any plane to 0 is the same as setting it to the plane width (see\n <a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>above</code></a>.)  If <code>strides</code> is null, then the\n strides for all planes will be set to their respective plane widths.  You\n can adjust the strides in order to add an arbitrary amount of line padding\n to each plane or to specify that this <code>YUVImage</code> instance is a\n subregion of a larger image (in which case, <code>strides[i]</code> should\n be set to the plane width of plane <code>i</code> in the larger image.)</dd><dd><code>height</code> - height (in pixels) of the new YUV image (or subregion)</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV\n image (one of <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444\"><code>TJ.SAMP_*</code></a>)</dd></dl>\n</li>\n</ul>\n<a name=\"YUVImage(byte[], int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>YUVImage</h4>\n<pre>public&nbsp;YUVImage(byte[]&nbsp;yuvImage,\n        int&nbsp;width,\n        int&nbsp;pad,\n        int&nbsp;height,\n        int&nbsp;subsamp)</pre>\n<div class=\"block\">Create a new <code>YUVImage</code> instance from an existing unified image\n buffer.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>yuvImage</code> - image buffer that contains or will contain YUV planar\n image data.  Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)\"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> to determine the minimum size for\n this buffer.  The Y, U (Cb), and V (Cr) image planes are stored\n sequentially in the buffer (see <a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>above</code></a> for a description\n of the image format.)</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - the line padding used in the YUV image buffer.  For\n instance, if each line in each plane of the buffer is padded to the\n nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV\n image (one of <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444\"><code>TJ.SAMP_*</code></a>)</dd></dl>\n</li>\n</ul>\n</li>\n</ul>\n<!-- ============ METHOD DETAIL ========== -->\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"method_detail\">\n<!--   -->\n</a>\n<h3>Method Detail</h3>\n<a name=\"setBuf(byte[][], int[], int, int[], int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>setBuf</h4>\n<pre>public&nbsp;void&nbsp;setBuf(byte[][]&nbsp;planes,\n          int[]&nbsp;offsets,\n          int&nbsp;width,\n          int[]&nbsp;strides,\n          int&nbsp;height,\n          int&nbsp;subsamp)</pre>\n<div class=\"block\">Assign a set of image planes to this <code>YUVImage</code> instance.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>planes</code> - an array of buffers representing the Y, U (Cb), and V (Cr)\n image planes (or just the Y plane, if the image is grayscale.)  These\n planes can be contiguous or non-contiguous in memory.  Plane\n <code>i</code> should be at least <code>offsets[i] +\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#planeSizeYUV(int,%20int,%20int,%20int,%20int)\"><code>TJ.planeSizeYUV</code></a>(i, width, strides[i], height, subsamp)</code>\n bytes in size.</dd><dd><code>offsets</code> - If this <code>YUVImage</code> instance represents a\n subregion of a larger image, then <code>offsets[i]</code> specifies the\n offset (in bytes) of the subregion within plane <code>i</code> of the\n larger image.  Setting this to null is the same as setting the offsets for\n all planes to 0.</dd><dd><code>width</code> - width (in pixels) of the YUV image (or subregion)</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes\n per line in the corresponding plane of the YUV image.  Setting the stride\n for any plane to 0 is the same as setting it to the plane width (see\n <a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>above</code></a>.)  If <code>strides</code> is null, then the\n strides for all planes will be set to their respective plane widths.  You\n can adjust the strides in order to add an arbitrary amount of line padding\n to each plane or to specify that this <code>YUVImage</code> image is a\n subregion of a larger image (in which case, <code>strides[i]</code> should\n be set to the plane width of plane <code>i</code> in the larger image.)</dd><dd><code>height</code> - height (in pixels) of the YUV image (or subregion)</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV\n image (one of <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444\"><code>TJ.SAMP_*</code></a>)</dd></dl>\n</li>\n</ul>\n<a name=\"setBuf(byte[], int, int, int, int)\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>setBuf</h4>\n<pre>public&nbsp;void&nbsp;setBuf(byte[]&nbsp;yuvImage,\n          int&nbsp;width,\n          int&nbsp;pad,\n          int&nbsp;height,\n          int&nbsp;subsamp)</pre>\n<div class=\"block\">Assign a unified image buffer to this <code>YUVImage</code> instance.</div>\n<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>yuvImage</code> - image buffer that contains or will contain YUV planar\n image data.  Use <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)\"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> to determine the minimum size for\n this buffer.  The Y, U (Cb), and V (Cr) image planes are stored\n sequentially in the buffer (see <a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><code>above</code></a> for a description\n of the image format.)</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - the line padding used in the YUV image buffer.  For\n instance, if each line in each plane of the buffer is padded to the\n nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV\n image (one of <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444\"><code>TJ.SAMP_*</code></a>)</dd></dl>\n</li>\n</ul>\n<a name=\"getWidth()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getWidth</h4>\n<pre>public&nbsp;int&nbsp;getWidth()</pre>\n<div class=\"block\">Returns the width of the YUV image (or subregion.)</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the width of the YUV image (or subregion)</dd></dl>\n</li>\n</ul>\n<a name=\"getHeight()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getHeight</h4>\n<pre>public&nbsp;int&nbsp;getHeight()</pre>\n<div class=\"block\">Returns the height of the YUV image (or subregion.)</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the height of the YUV image (or subregion)</dd></dl>\n</li>\n</ul>\n<a name=\"getPad()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getPad</h4>\n<pre>public&nbsp;int&nbsp;getPad()</pre>\n<div class=\"block\">Returns the line padding used in the YUV image buffer (if this image is\n stored in a unified buffer rather than separate image planes.)</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the line padding used in the YUV image buffer</dd></dl>\n</li>\n</ul>\n<a name=\"getStrides()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getStrides</h4>\n<pre>public&nbsp;int[]&nbsp;getStrides()</pre>\n<div class=\"block\">Returns the number of bytes per line of each plane in the YUV image.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the number of bytes per line of each plane in the YUV image</dd></dl>\n</li>\n</ul>\n<a name=\"getOffsets()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getOffsets</h4>\n<pre>public&nbsp;int[]&nbsp;getOffsets()</pre>\n<div class=\"block\">Returns the offsets (in bytes) of each plane within the planes of a larger\n YUV image.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the offsets (in bytes) of each plane within the planes of a larger\n YUV image</dd></dl>\n</li>\n</ul>\n<a name=\"getSubsamp()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getSubsamp</h4>\n<pre>public&nbsp;int&nbsp;getSubsamp()</pre>\n<div class=\"block\">Returns the level of chrominance subsampling used in the YUV image.  See\n <a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444\"><code>TJ.SAMP_*</code></a>.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the level of chrominance subsampling used in the YUV image</dd></dl>\n</li>\n</ul>\n<a name=\"getPlanes()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getPlanes</h4>\n<pre>public&nbsp;byte[][]&nbsp;getPlanes()</pre>\n<div class=\"block\">Returns the YUV image planes.  If the image is stored in a unified buffer,\n then all image planes will point to that buffer.</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the YUV image planes</dd></dl>\n</li>\n</ul>\n<a name=\"getBuf()\">\n<!--   -->\n</a>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>getBuf</h4>\n<pre>public&nbsp;byte[]&nbsp;getBuf()</pre>\n<div class=\"block\">Returns the YUV image buffer (if this image is stored in a unified\n buffer rather than separate image planes.)</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the YUV image buffer</dd></dl>\n</li>\n</ul>\n<a name=\"getSize()\">\n<!--   -->\n</a>\n<ul class=\"blockListLast\">\n<li class=\"blockList\">\n<h4>getSize</h4>\n<pre>public&nbsp;int&nbsp;getSize()</pre>\n<div class=\"block\">Returns the size (in bytes) of the YUV image buffer (if this image is\n stored in a unified buffer rather than separate image planes.)</div>\n<dl><dt><span class=\"strong\">Returns:</span></dt><dd>the size (in bytes) of the YUV image buffer</dd></dl>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n<!-- ========= END OF CLASS DATA ========= -->\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">Prev Class</span></a></li>\n<li>Next Class</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/YUVImage.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"YUVImage.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li><a href=\"#field_summary\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li><a href=\"#field_detail\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor_detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#method_detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/org/libjpegturbo/turbojpeg/package-frame.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>org.libjpegturbo.turbojpeg</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<h1 class=\"bar\"><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\" target=\"classFrame\">org.libjpegturbo.turbojpeg</a></h1>\n<div class=\"indexContainer\">\n<h2 title=\"Interfaces\">Interfaces</h2>\n<ul title=\"Interfaces\">\n<li><a href=\"TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\" target=\"classFrame\"><i>TJCustomFilter</i></a></li>\n</ul>\n<h2 title=\"Classes\">Classes</h2>\n<ul title=\"Classes\">\n<li><a href=\"TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">TJ</a></li>\n<li><a href=\"TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">TJCompressor</a></li>\n<li><a href=\"TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">TJDecompressor</a></li>\n<li><a href=\"TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">TJScalingFactor</a></li>\n<li><a href=\"TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">TJTransform</a></li>\n<li><a href=\"TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">TJTransformer</a></li>\n<li><a href=\"YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">YUVImage</a></li>\n</ul>\n<h2 title=\"Exceptions\">Exceptions</h2>\n<ul title=\"Exceptions\">\n<li><a href=\"TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\" target=\"classFrame\">TJException</a></li>\n</ul>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/org/libjpegturbo/turbojpeg/package-summary.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>org.libjpegturbo.turbojpeg</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"org.libjpegturbo.turbojpeg\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev Package</li>\n<li>Next Package</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/package-summary.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"package-summary.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h1 title=\"Package\" class=\"title\">Package&nbsp;org.libjpegturbo.turbojpeg</h1>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<table class=\"packageSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Interface Summary table, listing interfaces, and an explanation\">\n<caption><span>Interface Summary</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Interface</th>\n<th class=\"colLast\" scope=\"col\">Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a href=\"../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\">TJCustomFilter</a></td>\n<td class=\"colLast\">\n<div class=\"block\">Custom filter callback interface</div>\n</td>\n</tr>\n</tbody>\n</table>\n</li>\n<li class=\"blockList\">\n<table class=\"packageSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, listing classes, and an explanation\">\n<caption><span>Class Summary</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Class</th>\n<th class=\"colLast\" scope=\"col\">Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJ</a></td>\n<td class=\"colLast\">\n<div class=\"block\">TurboJPEG utility class (cannot be instantiated)</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJCompressor</a></td>\n<td class=\"colLast\">\n<div class=\"block\">TurboJPEG compressor</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJDecompressor</a></td>\n<td class=\"colLast\">\n<div class=\"block\">TurboJPEG decompressor</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJScalingFactor</a></td>\n<td class=\"colLast\">\n<div class=\"block\">Fractional scaling factor</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransform</a></td>\n<td class=\"colLast\">\n<div class=\"block\">Lossless transform parameters</div>\n</td>\n</tr>\n<tr class=\"rowColor\">\n<td class=\"colFirst\"><a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJTransformer</a></td>\n<td class=\"colLast\">\n<div class=\"block\">TurboJPEG lossless transformer</div>\n</td>\n</tr>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\">YUVImage</a></td>\n<td class=\"colLast\">\n<div class=\"block\">This class encapsulates a YUV planar image and the metadata\n associated with it.</div>\n</td>\n</tr>\n</tbody>\n</table>\n</li>\n<li class=\"blockList\">\n<table class=\"packageSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Exception Summary table, listing exceptions, and an explanation\">\n<caption><span>Exception Summary</span><span class=\"tabEnd\">&nbsp;</span></caption>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Exception</th>\n<th class=\"colLast\" scope=\"col\">Description</th>\n</tr>\n<tbody>\n<tr class=\"altColor\">\n<td class=\"colFirst\"><a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">TJException</a></td>\n<td class=\"colLast\">&nbsp;</td>\n</tr>\n</tbody>\n</table>\n</li>\n</ul>\n</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev Package</li>\n<li>Next Package</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/package-summary.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"package-summary.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/org/libjpegturbo/turbojpeg/package-tree.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>org.libjpegturbo.turbojpeg Class Hierarchy</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"org.libjpegturbo.turbojpeg Class Hierarchy\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li class=\"navBarCell1Rev\">Tree</li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/package-tree.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"package-tree.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h1 class=\"title\">Hierarchy For Package org.libjpegturbo.turbojpeg</h1>\n</div>\n<div class=\"contentContainer\">\n<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>\n<ul>\n<li type=\"circle\">java.lang.Object\n<ul>\n<li type=\"circle\">java.awt.geom.RectangularShape (implements java.lang.Cloneable, java.awt.Shape)\n<ul>\n<li type=\"circle\">java.awt.geom.Rectangle2D\n<ul>\n<li type=\"circle\">java.awt.Rectangle (implements java.io.Serializable, java.awt.Shape)\n<ul>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"../../../org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJTransform</span></a></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n<li type=\"circle\">java.lang.Throwable (implements java.io.Serializable)\n<ul>\n<li type=\"circle\">java.lang.Exception\n<ul>\n<li type=\"circle\">java.io.IOException\n<ul>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"../../../org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJException</span></a></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"../../../org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJ</span></a></li>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"../../../org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJCompressor</span></a> (implements java.io.Closeable)</li>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"../../../org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJDecompressor</span></a> (implements java.io.Closeable)\n<ul>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"../../../org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJTransformer</span></a></li>\n</ul>\n</li>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJScalingFactor</span></a></li>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"../../../org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">YUVImage</span></a></li>\n</ul>\n</li>\n</ul>\n<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>\n<ul>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJCustomFilter</span></a></li>\n</ul>\n</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li class=\"navBarCell1Rev\">Tree</li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?org/libjpegturbo/turbojpeg/package-tree.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"package-tree.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/overview-tree.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>Class Hierarchy</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"Class Hierarchy\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li class=\"navBarCell1Rev\">Tree</li>\n<li><a href=\"deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"index-all.html\">Index</a></li>\n<li><a href=\"help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"index.html?overview-tree.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"overview-tree.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h1 class=\"title\">Hierarchy For All Packages</h1>\n<span class=\"strong\">Package Hierarchies:</span>\n<ul class=\"horizontal\">\n<li><a href=\"org/libjpegturbo/turbojpeg/package-tree.html\">org.libjpegturbo.turbojpeg</a></li>\n</ul>\n</div>\n<div class=\"contentContainer\">\n<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>\n<ul>\n<li type=\"circle\">java.lang.Object\n<ul>\n<li type=\"circle\">java.awt.geom.RectangularShape (implements java.lang.Cloneable, java.awt.Shape)\n<ul>\n<li type=\"circle\">java.awt.geom.Rectangle2D\n<ul>\n<li type=\"circle\">java.awt.Rectangle (implements java.io.Serializable, java.awt.Shape)\n<ul>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJTransform</span></a></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n<li type=\"circle\">java.lang.Throwable (implements java.io.Serializable)\n<ul>\n<li type=\"circle\">java.lang.Exception\n<ul>\n<li type=\"circle\">java.io.IOException\n<ul>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJException</span></a></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"org/libjpegturbo/turbojpeg/TJ.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJ</span></a></li>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"org/libjpegturbo/turbojpeg/TJCompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJCompressor</span></a> (implements java.io.Closeable)</li>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"org/libjpegturbo/turbojpeg/TJDecompressor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJDecompressor</span></a> (implements java.io.Closeable)\n<ul>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"org/libjpegturbo/turbojpeg/TJTransformer.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJTransformer</span></a></li>\n</ul>\n</li>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"org/libjpegturbo/turbojpeg/TJScalingFactor.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJScalingFactor</span></a></li>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"org/libjpegturbo/turbojpeg/YUVImage.html\" title=\"class in org.libjpegturbo.turbojpeg\"><span class=\"strong\">YUVImage</span></a></li>\n</ul>\n</li>\n</ul>\n<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>\n<ul>\n<li type=\"circle\">org.libjpegturbo.turbojpeg.<a href=\"org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\"><span class=\"strong\">TJCustomFilter</span></a></li>\n</ul>\n</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li class=\"navBarCell1Rev\">Tree</li>\n<li><a href=\"deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"index-all.html\">Index</a></li>\n<li><a href=\"help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"index.html?overview-tree.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"overview-tree.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/package-list",
    "content": "org.libjpegturbo.turbojpeg\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/serialized-form.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<title>Serialized Form</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n    if (location.href.indexOf('is-external=true') == -1) {\n        parent.document.title=\"Serialized Form\";\n    }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar_top\">\n<!--   -->\n</a><a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li><a href=\"org/libjpegturbo/turbojpeg/package-tree.html\">Tree</a></li>\n<li><a href=\"deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"index-all.html\">Index</a></li>\n<li><a href=\"help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"index.html?serialized-form.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"serialized-form.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_top\">\n<!--   -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<div class=\"header\">\n<h1 title=\"Serialized Form\" class=\"title\">Serialized Form</h1>\n</div>\n<div class=\"serializedFormContainer\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h2 title=\"Package\">Package&nbsp;org.libjpegturbo.turbojpeg</h2>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"org.libjpegturbo.turbojpeg.TJException\">\n<!--   -->\n</a>\n<h3>Class <a href=\"org/libjpegturbo/turbojpeg/TJException.html\" title=\"class in org.libjpegturbo.turbojpeg\">org.libjpegturbo.turbojpeg.TJException</a> extends java.io.IOException implements Serializable</h3>\n<dl class=\"nameValue\">\n<dt>serialVersionUID:</dt>\n<dd>1L</dd>\n</dl>\n</li>\n<li class=\"blockList\"><a name=\"org.libjpegturbo.turbojpeg.TJTransform\">\n<!--   -->\n</a>\n<h3>Class <a href=\"org/libjpegturbo/turbojpeg/TJTransform.html\" title=\"class in org.libjpegturbo.turbojpeg\">org.libjpegturbo.turbojpeg.TJTransform</a> extends java.awt.Rectangle implements Serializable</h3>\n<dl class=\"nameValue\">\n<dt>serialVersionUID:</dt>\n<dd>-127367705761430371L</dd>\n</dl>\n<ul class=\"blockList\">\n<li class=\"blockList\"><a name=\"serializedForm\">\n<!--   -->\n</a>\n<h3>Serialized Fields</h3>\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<h4>op</h4>\n<pre>int op</pre>\n<div class=\"block\">Transform operation (one of <code>OP_*</code>)</div>\n</li>\n<li class=\"blockList\">\n<h4>options</h4>\n<pre>int options</pre>\n<div class=\"block\">Transform options (bitwise OR of one or more of <code>OPT_*</code>)</div>\n</li>\n<li class=\"blockListLast\">\n<h4>cf</h4>\n<pre><a href=\"org/libjpegturbo/turbojpeg/TJCustomFilter.html\" title=\"interface in org.libjpegturbo.turbojpeg\">TJCustomFilter</a> cf</pre>\n<div class=\"block\">Custom filter instance</div>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</div>\n<!-- ======= START OF BOTTOM NAVBAR ====== -->\n<div class=\"bottomNav\"><a name=\"navbar_bottom\">\n<!--   -->\n</a><a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a><a name=\"navbar_bottom_firstrow\">\n<!--   -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"org/libjpegturbo/turbojpeg/package-summary.html\">Package</a></li>\n<li>Class</li>\n<li><a href=\"org/libjpegturbo/turbojpeg/package-tree.html\">Tree</a></li>\n<li><a href=\"deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"index-all.html\">Index</a></li>\n<li><a href=\"help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li>Prev</li>\n<li>Next</li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"index.html?serialized-form.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"serialized-form.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_bottom\">\n<li><a href=\"allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n  allClassesLink = document.getElementById(\"allclasses_navbar_bottom\");\n  if(window==top) {\n    allClassesLink.style.display = \"block\";\n  }\n  else {\n    allClassesLink.style.display = \"none\";\n  }\n  //-->\n</script>\n</div>\n<a name=\"skip-navbar_bottom\">\n<!--   -->\n</a></div>\n<!-- ======== END OF BOTTOM NAVBAR ======= -->\n</body>\n</html>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/doc/stylesheet.css",
    "content": "/* Javadoc style sheet */\n/*\nOverall document style\n*/\nbody {\n    background-color:#ffffff;\n    color:#353833;\n    font-family:Arial, Helvetica, sans-serif;\n    font-size:76%;\n    margin:0;\n}\na:link, a:visited {\n    text-decoration:none;\n    color:#4c6b87;\n}\na:hover, a:focus {\n    text-decoration:none;\n    color:#bb7a2a;\n}\na:active {\n    text-decoration:none;\n    color:#4c6b87;\n}\na[name] {\n    color:#353833;\n}\na[name]:hover {\n    text-decoration:none;\n    color:#353833;\n}\npre {\n    font-size:1.3em;\n}\nh1 {\n    font-size:1.8em;\n}\nh2 {\n    font-size:1.5em;\n}\nh3 {\n    font-size:1.4em;\n}\nh4 {\n    font-size:1.3em;\n}\nh5 {\n    font-size:1.2em;\n}\nh6 {\n    font-size:1.1em;\n}\nul {\n    list-style-type:disc;\n}\ncode, tt {\n    font-size:1.2em;\n}\ndt code {\n    font-size:1.2em;\n}\ntable tr td dt code {\n    font-size:1.2em;\n    vertical-align:top;\n}\nsup {\n    font-size:.6em;\n}\n/*\nDocument title and Copyright styles\n*/\n.clear {\n    clear:both;\n    height:0px;\n    overflow:hidden;\n}\n.aboutLanguage {\n    float:right;\n    padding:0px 21px;\n    font-size:.8em;\n    z-index:200;\n    margin-top:-7px;\n}\n.legalCopy {\n    margin-left:.5em;\n}\n.bar a, .bar a:link, .bar a:visited, .bar a:active {\n    color:#FFFFFF;\n    text-decoration:none;\n}\n.bar a:hover, .bar a:focus {\n    color:#bb7a2a;\n}\n.tab {\n    background-color:#0066FF;\n    background-image:url(resources/titlebar.gif);\n    background-position:left top;\n    background-repeat:no-repeat;\n    color:#ffffff;\n    padding:8px;\n    width:5em;\n    font-weight:bold;\n}\n/*\nNavigation bar styles\n*/\n.bar {\n    background-image:url(resources/background.gif);\n    background-repeat:repeat-x;\n    color:#FFFFFF;\n    padding:.8em .5em .4em .8em;\n    height:auto;/*height:1.8em;*/\n    font-size:1em;\n    margin:0;\n}\n.topNav {\n    background-image:url(resources/background.gif);\n    background-repeat:repeat-x;\n    color:#FFFFFF;\n    float:left;\n    padding:0;\n    width:100%;\n    clear:right;\n    height:2.8em;\n    padding-top:10px;\n    overflow:hidden;\n}\n.bottomNav {\n    margin-top:10px;\n    background-image:url(resources/background.gif);\n    background-repeat:repeat-x;\n    color:#FFFFFF;\n    float:left;\n    padding:0;\n    width:100%;\n    clear:right;\n    height:2.8em;\n    padding-top:10px;\n    overflow:hidden;\n}\n.subNav {\n    background-color:#dee3e9;\n    border-bottom:1px solid #9eadc0;\n    float:left;\n    width:100%;\n    overflow:hidden;\n}\n.subNav div {\n    clear:left;\n    float:left;\n    padding:0 0 5px 6px;\n}\nul.navList, ul.subNavList {\n    float:left;\n    margin:0 25px 0 0;\n    padding:0;\n}\nul.navList li{\n    list-style:none;\n    float:left;\n    padding:3px 6px;\n}\nul.subNavList li{\n    list-style:none;\n    float:left;\n    font-size:90%;\n}\n.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {\n    color:#FFFFFF;\n    text-decoration:none;\n}\n.topNav a:hover, .bottomNav a:hover {\n    text-decoration:none;\n    color:#bb7a2a;\n}\n.navBarCell1Rev {\n    background-image:url(resources/tab.gif);\n    background-color:#a88834;\n    color:#FFFFFF;\n    margin: auto 5px;\n    border:1px solid #c9aa44;\n}\n/*\nPage header and footer styles\n*/\n.header, .footer {\n    clear:both;\n    margin:0 20px;\n    padding:5px 0 0 0;\n}\n.indexHeader {\n    margin:10px;\n    position:relative;\n}\n.indexHeader h1 {\n    font-size:1.3em;\n}\n.title {\n    color:#2c4557;\n    margin:10px 0;\n}\n.subTitle {\n    margin:5px 0 0 0;\n}\n.header ul {\n    margin:0 0 25px 0;\n    padding:0;\n}\n.footer ul {\n    margin:20px 0 5px 0;\n}\n.header ul li, .footer ul li {\n    list-style:none;\n    font-size:1.2em;\n}\n/*\nHeading styles\n*/\ndiv.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {\n    background-color:#dee3e9;\n    border-top:1px solid #9eadc0;\n    border-bottom:1px solid #9eadc0;\n    margin:0 0 6px -8px;\n    padding:2px 5px;\n}\nul.blockList ul.blockList ul.blockList li.blockList h3 {\n    background-color:#dee3e9;\n    border-top:1px solid #9eadc0;\n    border-bottom:1px solid #9eadc0;\n    margin:0 0 6px -8px;\n    padding:2px 5px;\n}\nul.blockList ul.blockList li.blockList h3 {\n    padding:0;\n    margin:15px 0;\n}\nul.blockList li.blockList h2 {\n    padding:0px 0 20px 0;\n}\n/*\nPage layout container styles\n*/\n.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {\n    clear:both;\n    padding:10px 20px;\n    position:relative;\n}\n.indexContainer {\n    margin:10px;\n    position:relative;\n    font-size:1.0em;\n}\n.indexContainer h2 {\n    font-size:1.1em;\n    padding:0 0 3px 0;\n}\n.indexContainer ul {\n    margin:0;\n    padding:0;\n}\n.indexContainer ul li {\n    list-style:none;\n}\n.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {\n    font-size:1.1em;\n    font-weight:bold;\n    margin:10px 0 0 0;\n    color:#4E4E4E;\n}\n.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd {\n    margin:10px 0 10px 20px;\n}\n.serializedFormContainer dl.nameValue dt {\n    margin-left:1px;\n    font-size:1.1em;\n    display:inline;\n    font-weight:bold;\n}\n.serializedFormContainer dl.nameValue dd {\n    margin:0 0 0 1px;\n    font-size:1.1em;\n    display:inline;\n}\n/*\nList styles\n*/\nul.horizontal li {\n    display:inline;\n    font-size:0.9em;\n}\nul.inheritance {\n    margin:0;\n    padding:0;\n}\nul.inheritance li {\n    display:inline;\n    list-style:none;\n}\nul.inheritance li ul.inheritance {\n    margin-left:15px;\n    padding-left:15px;\n    padding-top:1px;\n}\nul.blockList, ul.blockListLast {\n    margin:10px 0 10px 0;\n    padding:0;\n}\nul.blockList li.blockList, ul.blockListLast li.blockList {\n    list-style:none;\n    margin-bottom:25px;\n}\nul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {\n    padding:0px 20px 5px 10px;\n    border:1px solid #9eadc0;\n    background-color:#f9f9f9;\n}\nul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {\n    padding:0 0 5px 8px;\n    background-color:#ffffff;\n    border:1px solid #9eadc0;\n    border-top:none;\n}\nul.blockList ul.blockList ul.blockList ul.blockList li.blockList {\n    margin-left:0;\n    padding-left:0;\n    padding-bottom:15px;\n    border:none;\n    border-bottom:1px solid #9eadc0;\n}\nul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {\n    list-style:none;\n    border-bottom:none;\n    padding-bottom:0;\n}\ntable tr td dl, table tr td dl dt, table tr td dl dd {\n    margin-top:0;\n    margin-bottom:1px;\n}\n/*\nTable styles\n*/\n.contentContainer table, .classUseContainer table, .constantValuesContainer table {\n    border-bottom:1px solid #9eadc0;\n    width:100%;\n}\n.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table {\n    width:100%;\n}\n.contentContainer .description table, .contentContainer .details table {\n    border-bottom:none;\n}\n.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{\n    vertical-align:top;\n    padding-right:20px;\n}\n.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast,\n.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast,\n.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne,\n.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne {\n    padding-right:3px;\n}\n.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption {\n    position:relative;\n    text-align:left;\n    background-repeat:no-repeat;\n    color:#FFFFFF;\n    font-weight:bold;\n    clear:none;\n    overflow:hidden;\n    padding:0px;\n    margin:0px;\n}\ncaption a:link, caption a:hover, caption a:active, caption a:visited {\n    color:#FFFFFF;\n}\n.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span {\n    white-space:nowrap;\n    padding-top:8px;\n    padding-left:8px;\n    display:block;\n    float:left;\n    background-image:url(resources/titlebar.gif);\n    height:18px;\n}\n.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {\n    width:10px;\n    background-image:url(resources/titlebar_end.gif);\n    background-repeat:no-repeat;\n    background-position:top right;\n    position:relative;\n    float:left;\n}\nul.blockList ul.blockList li.blockList table {\n    margin:0 0 12px 0px;\n    width:100%;\n}\n.tableSubHeadingColor {\n    background-color: #EEEEFF;\n}\n.altColor {\n    background-color:#eeeeef;\n}\n.rowColor {\n    background-color:#ffffff;\n}\n.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td {\n    text-align:left;\n    padding:3px 3px 3px 7px;\n}\nth.colFirst, th.colLast, th.colOne, .constantValuesContainer th {\n    background:#dee3e9;\n    border-top:1px solid #9eadc0;\n    border-bottom:1px solid #9eadc0;\n    text-align:left;\n    padding:3px 3px 3px 7px;\n}\ntd.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {\n    font-weight:bold;\n}\ntd.colFirst, th.colFirst {\n    border-left:1px solid #9eadc0;\n    white-space:nowrap;\n}\ntd.colLast, th.colLast {\n    border-right:1px solid #9eadc0;\n}\ntd.colOne, th.colOne {\n    border-right:1px solid #9eadc0;\n    border-left:1px solid #9eadc0;\n}\ntable.overviewSummary  {\n    padding:0px;\n    margin-left:0px;\n}\ntable.overviewSummary td.colFirst, table.overviewSummary th.colFirst,\ntable.overviewSummary td.colOne, table.overviewSummary th.colOne {\n    width:25%;\n    vertical-align:middle;\n}\ntable.packageSummary td.colFirst, table.overviewSummary th.colFirst {\n    width:25%;\n    vertical-align:middle;\n}\n/*\nContent styles\n*/\n.description pre {\n    margin-top:0;\n}\n.deprecatedContent {\n    margin:0;\n    padding:10px 0;\n}\n.docSummary {\n    padding:0;\n}\n/*\nFormatting effect styles\n*/\n.sourceLineNo {\n    color:green;\n    padding:0 30px 0 0;\n}\nh1.hidden {\n    visibility:hidden;\n    overflow:hidden;\n    font-size:.9em;\n}\n.block {\n    display:block;\n    margin:3px 0 0 0;\n}\n.strong {\n    font-weight:bold;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/org/libjpegturbo/turbojpeg/TJ.java",
    "content": "/*\n * Copyright (C)2011-2013 D. R. Commander.  All Rights Reserved.\n * Copyright (C)2015 Viktor Szathmáry.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\npackage org.libjpegturbo.turbojpeg;\n\n/**\n * TurboJPEG utility class (cannot be instantiated)\n */\npublic final class TJ {\n\n\n  /**\n   * The number of chrominance subsampling options\n   */\n  public static final int NUMSAMP   = 6;\n  /**\n   * 4:4:4 chrominance subsampling (no chrominance subsampling).  The JPEG\n   * or YUV image will contain one chrominance component for every pixel in the\n   * source image.\n   */\n  public static final int SAMP_444  = 0;\n  /**\n   * 4:2:2 chrominance subsampling.  The JPEG or YUV image will contain one\n   * chrominance component for every 2x1 block of pixels in the source image.\n   */\n  public static final int SAMP_422  = 1;\n  /**\n   * 4:2:0 chrominance subsampling.  The JPEG or YUV image will contain one\n   * chrominance component for every 2x2 block of pixels in the source image.\n   */\n  public static final int SAMP_420  = 2;\n  /**\n   * Grayscale.  The JPEG or YUV image will contain no chrominance components.\n   */\n  public static final int SAMP_GRAY = 3;\n  /**\n   * 4:4:0 chrominance subsampling.  The JPEG or YUV image will contain one\n   * chrominance component for every 1x2 block of pixels in the source image.\n   * Note that 4:4:0 subsampling is not fully accelerated in libjpeg-turbo.\n   */\n  public static final int SAMP_440  = 4;\n  /**\n   * 4:1:1 chrominance subsampling.  The JPEG or YUV image will contain one\n   * chrominance component for every 4x1 block of pixels in the source image.\n   * JPEG images compressed with 4:1:1 subsampling will be almost exactly the\n   * same size as those compressed with 4:2:0 subsampling, and in the\n   * aggregate, both subsampling methods produce approximately the same\n   * perceptual quality.  However, 4:1:1 is better able to reproduce sharp\n   * horizontal features.  Note that 4:1:1 subsampling is not fully accelerated\n   * in libjpeg-turbo.\n   */\n  public static final int SAMP_411  = 5;\n\n\n  /**\n   * Returns the MCU block width for the given level of chrominance\n   * subsampling.\n   *\n   * @param subsamp the level of chrominance subsampling (one of\n   * <code>SAMP_*</code>)\n   *\n   * @return the MCU block width for the given level of chrominance\n   * subsampling.\n   */\n  public static int getMCUWidth(int subsamp) {\n    checkSubsampling(subsamp);\n    return mcuWidth[subsamp];\n  }\n\n  private static final int[] mcuWidth = {\n    8, 16, 16, 8, 8, 32\n  };\n\n\n  /**\n   * Returns the MCU block height for the given level of chrominance\n   * subsampling.\n   *\n   * @param subsamp the level of chrominance subsampling (one of\n   * <code>SAMP_*</code>)\n   *\n   * @return the MCU block height for the given level of chrominance\n   * subsampling.\n   */\n  public static int getMCUHeight(int subsamp) {\n    checkSubsampling(subsamp);\n    return mcuHeight[subsamp];\n  }\n\n  private static final int[] mcuHeight = {\n    8, 8, 16, 8, 16, 8\n  };\n\n\n  /**\n   * The number of pixel formats\n   */\n  public static final int NUMPF   = 12;\n  /**\n   * RGB pixel format.  The red, green, and blue components in the image are\n   * stored in 3-byte pixels in the order R, G, B from lowest to highest byte\n   * address within each pixel.\n   */\n  public static final int PF_RGB  = 0;\n  /**\n   * BGR pixel format.  The red, green, and blue components in the image are\n   * stored in 3-byte pixels in the order B, G, R from lowest to highest byte\n   * address within each pixel.\n   */\n  public static final int PF_BGR  = 1;\n  /**\n   * RGBX pixel format.  The red, green, and blue components in the image are\n   * stored in 4-byte pixels in the order R, G, B from lowest to highest byte\n   * address within each pixel.  The X component is ignored when compressing\n   * and undefined when decompressing.\n   */\n  public static final int PF_RGBX = 2;\n  /**\n   * BGRX pixel format.  The red, green, and blue components in the image are\n   * stored in 4-byte pixels in the order B, G, R from lowest to highest byte\n   * address within each pixel.  The X component is ignored when compressing\n   * and undefined when decompressing.\n   */\n  public static final int PF_BGRX = 3;\n  /**\n   * XBGR pixel format.  The red, green, and blue components in the image are\n   * stored in 4-byte pixels in the order R, G, B from highest to lowest byte\n   * address within each pixel.  The X component is ignored when compressing\n   * and undefined when decompressing.\n   */\n  public static final int PF_XBGR = 4;\n  /**\n   * XRGB pixel format.  The red, green, and blue components in the image are\n   * stored in 4-byte pixels in the order B, G, R from highest to lowest byte\n   * address within each pixel.  The X component is ignored when compressing\n   * and undefined when decompressing.\n   */\n  public static final int PF_XRGB = 5;\n  /**\n   * Grayscale pixel format.  Each 1-byte pixel represents a luminance\n   * (brightness) level from 0 to 255.\n   */\n  public static final int PF_GRAY = 6;\n  /**\n   * RGBA pixel format.  This is the same as {@link #PF_RGBX}, except that when\n   * decompressing, the X byte is guaranteed to be 0xFF, which can be\n   * interpreted as an opaque alpha channel.\n   */\n  public static final int PF_RGBA = 7;\n  /**\n   * BGRA pixel format.  This is the same as {@link #PF_BGRX}, except that when\n   * decompressing, the X byte is guaranteed to be 0xFF, which can be\n   * interpreted as an opaque alpha channel.\n   */\n  public static final int PF_BGRA = 8;\n  /**\n   * ABGR pixel format.  This is the same as {@link #PF_XBGR}, except that when\n   * decompressing, the X byte is guaranteed to be 0xFF, which can be\n   * interpreted as an opaque alpha channel.\n   */\n  public static final int PF_ABGR = 9;\n  /**\n   * ARGB pixel format.  This is the same as {@link #PF_XRGB}, except that when\n   * decompressing, the X byte is guaranteed to be 0xFF, which can be\n   * interpreted as an opaque alpha channel.\n   */\n  public static final int PF_ARGB = 10;\n  /**\n   * CMYK pixel format.  Unlike RGB, which is an additive color model used\n   * primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive\n   * color model used primarily for printing.  In the CMYK color model, the\n   * value of each color component typically corresponds to an amount of cyan,\n   * magenta, yellow, or black ink that is applied to a white background.  In\n   * order to convert between CMYK and RGB, it is necessary to use a color\n   * management system (CMS.)  A CMS will attempt to map colors within the\n   * printer's gamut to perceptually similar colors in the display's gamut and\n   * vice versa, but the mapping is typically not 1:1 or reversible, nor can it\n   * be defined with a simple formula.  Thus, such a conversion is out of scope\n   * for a codec library.  However, the TurboJPEG API allows for compressing\n   * CMYK pixels into a YCCK JPEG image (see {@link #CS_YCCK}) and\n   * decompressing YCCK JPEG images into CMYK pixels.\n   */\n  public static final int PF_CMYK = 11;\n\n\n  /**\n   * Returns the pixel size (in bytes) for the given pixel format.\n   *\n   * @param pixelFormat the pixel format (one of <code>PF_*</code>)\n   *\n   * @return the pixel size (in bytes) for the given pixel format.\n   */\n  public static int getPixelSize(int pixelFormat) {\n    checkPixelFormat(pixelFormat);\n    return pixelSize[pixelFormat];\n  }\n\n  private static final int[] pixelSize = {\n    3, 3, 4, 4, 4, 4, 1, 4, 4, 4, 4, 4\n  };\n\n\n  /**\n   * For the given pixel format, returns the number of bytes that the red\n   * component is offset from the start of the pixel.  For instance, if a pixel\n   * of format <code>TJ.PF_BGRX</code> is stored in <code>char pixel[]</code>,\n   * then the red component will be\n   * <code>pixel[TJ.getRedOffset(TJ.PF_BGRX)]</code>.\n   *\n   * @param pixelFormat the pixel format (one of <code>PF_*</code>)\n   *\n   * @return the red offset for the given pixel format.\n   */\n  public static int getRedOffset(int pixelFormat) {\n    checkPixelFormat(pixelFormat);\n    return redOffset[pixelFormat];\n  }\n\n  private static final int[] redOffset = {\n    0, 2, 0, 2, 3, 1, 0, 0, 2, 3, 1, -1\n  };\n\n\n  /**\n   * For the given pixel format, returns the number of bytes that the green\n   * component is offset from the start of the pixel.  For instance, if a pixel\n   * of format <code>TJ.PF_BGRX</code> is stored in <code>char pixel[]</code>,\n   * then the green component will be\n   * <code>pixel[TJ.getGreenOffset(TJ.PF_BGRX)]</code>.\n   *\n   * @param pixelFormat the pixel format (one of <code>PF_*</code>)\n   *\n   * @return the green offset for the given pixel format.\n   */\n  public static int getGreenOffset(int pixelFormat) {\n    checkPixelFormat(pixelFormat);\n    return greenOffset[pixelFormat];\n  }\n\n  private static final int[] greenOffset = {\n    1, 1, 1, 1, 2, 2, 0, 1, 1, 2, 2, -1\n  };\n\n\n  /**\n   * For the given pixel format, returns the number of bytes that the blue\n   * component is offset from the start of the pixel.  For instance, if a pixel\n   * of format <code>TJ.PF_BGRX</code> is stored in <code>char pixel[]</code>,\n   * then the blue component will be\n   * <code>pixel[TJ.getBlueOffset(TJ.PF_BGRX)]</code>.\n   *\n   * @param pixelFormat the pixel format (one of <code>PF_*</code>)\n   *\n   * @return the blue offset for the given pixel format.\n   */\n  public static int getBlueOffset(int pixelFormat) {\n    checkPixelFormat(pixelFormat);\n    return blueOffset[pixelFormat];\n  }\n\n  private static final int[] blueOffset = {\n    2, 0, 2, 0, 1, 3, 0, 2, 0, 1, 3, -1\n  };\n\n\n  /**\n   * The number of JPEG colorspaces\n   */\n  public static final int NUMCS = 5;\n  /**\n   * RGB colorspace.  When compressing the JPEG image, the R, G, and B\n   * components in the source image are reordered into image planes, but no\n   * colorspace conversion or subsampling is performed.  RGB JPEG images can be\n   * decompressed to any of the extended RGB pixel formats or grayscale, but\n   * they cannot be decompressed to YUV images.\n   */\n  public static final int CS_RGB = 0;\n  /**\n   * YCbCr colorspace.  YCbCr is not an absolute colorspace but rather a\n   * mathematical transformation of RGB designed solely for storage and\n   * transmission.  YCbCr images must be converted to RGB before they can\n   * actually be displayed.  In the YCbCr colorspace, the Y (luminance)\n   * component represents the black & white portion of the original image, and\n   * the Cb and Cr (chrominance) components represent the color portion of the\n   * original image.  Originally, the analog equivalent of this transformation\n   * allowed the same signal to drive both black & white and color televisions,\n   * but JPEG images use YCbCr primarily because it allows the color data to be\n   * optionally subsampled for the purposes of reducing bandwidth or disk\n   * space.  YCbCr is the most common JPEG colorspace, and YCbCr JPEG images\n   * can be compressed from and decompressed to any of the extended RGB pixel\n   * formats or grayscale, or they can be decompressed to YUV planar images.\n   */\n  public static final int CS_YCbCr = 1;\n  /**\n   * Grayscale colorspace.  The JPEG image retains only the luminance data (Y\n   * component), and any color data from the source image is discarded.\n   * Grayscale JPEG images can be compressed from and decompressed to any of\n   * the extended RGB pixel formats or grayscale, or they can be decompressed\n   * to YUV planar images.\n   */\n  public static final int CS_GRAY = 2;\n  /**\n   * CMYK colorspace.  When compressing the JPEG image, the C, M, Y, and K\n   * components in the source image are reordered into image planes, but no\n   * colorspace conversion or subsampling is performed.  CMYK JPEG images can\n   * only be decompressed to CMYK pixels.\n   */\n  public static final int CS_CMYK = 3;\n  /**\n   * YCCK colorspace.  YCCK (AKA \"YCbCrK\") is not an absolute colorspace but\n   * rather a mathematical transformation of CMYK designed solely for storage\n   * and transmission.  It is to CMYK as YCbCr is to RGB.  CMYK pixels can be\n   * reversibly transformed into YCCK, and as with YCbCr, the chrominance\n   * components in the YCCK pixels can be subsampled without incurring major\n   * perceptual loss.  YCCK JPEG images can only be compressed from and\n   * decompressed to CMYK pixels.\n   */\n  public static final int CS_YCCK = 4;\n\n\n  /**\n   * The uncompressed source/destination image is stored in bottom-up (Windows,\n   * OpenGL) order, not top-down (X11) order.\n   */\n  public static final int FLAG_BOTTOMUP     = 2;\n\n  @Deprecated\n  public static final int FLAG_FORCEMMX     = 8;\n  @Deprecated\n  public static final int FLAG_FORCESSE     = 16;\n  @Deprecated\n  public static final int FLAG_FORCESSE2    = 32;\n  @Deprecated\n  public static final int FLAG_FORCESSE3    = 128;\n\n  /**\n   * When decompressing an image that was compressed using chrominance\n   * subsampling, use the fastest chrominance upsampling algorithm available in\n   * the underlying codec.  The default is to use smooth upsampling, which\n   * creates a smooth transition between neighboring chrominance components in\n   * order to reduce upsampling artifacts in the decompressed image.\n   */\n  public static final int FLAG_FASTUPSAMPLE = 256;\n  /**\n   * Use the fastest DCT/IDCT algorithm available in the underlying codec.  The\n   * default if this flag is not specified is implementation-specific.  For\n   * example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast\n   * algorithm by default when compressing, because this has been shown to have\n   * only a very slight effect on accuracy, but it uses the accurate algorithm\n   * when decompressing, because this has been shown to have a larger effect.\n   */\n  public static final int FLAG_FASTDCT      =  2048;\n  /**\n   * Use the most accurate DCT/IDCT algorithm available in the underlying\n   * codec.  The default if this flag is not specified is\n   * implementation-specific.  For example, the implementation of TurboJPEG for\n   * libjpeg[-turbo] uses the fast algorithm by default when compressing,\n   * because this has been shown to have only a very slight effect on accuracy,\n   * but it uses the accurate algorithm when decompressing, because this has\n   * been shown to have a larger effect.\n   */\n  public static final int FLAG_ACCURATEDCT  =  4096;\n\n\n  /**\n   * Returns the maximum size of the buffer (in bytes) required to hold a JPEG\n   * image with the given width, height, and level of chrominance subsampling.\n   *\n   * @param width the width (in pixels) of the JPEG image\n   *\n   * @param height the height (in pixels) of the JPEG image\n   *\n   * @param jpegSubsamp the level of chrominance subsampling to be used when\n   * generating the JPEG image (one of {@link TJ TJ.SAMP_*})\n   *\n   * @return the maximum size of the buffer (in bytes) required to hold a JPEG\n   * image with the given width, height, and level of chrominance subsampling.\n   */\n  public static native int bufSize(int width, int height, int jpegSubsamp);\n\n  /**\n   * Returns the size of the buffer (in bytes) required to hold a YUV planar\n   * image with the given width, height, and level of chrominance subsampling.\n   *\n   * @param width the width (in pixels) of the YUV image\n   *\n   * @param pad the width of each line in each plane of the image is padded to\n   * the nearest multiple of this number of bytes (must be a power of 2.)\n   *\n   * @param height the height (in pixels) of the YUV image\n   *\n   * @param subsamp the level of chrominance subsampling used in the YUV\n   * image (one of {@link TJ TJ.SAMP_*})\n   *\n   * @return the size of the buffer (in bytes) required to hold a YUV planar\n   * image with the given width, height, and level of chrominance subsampling.\n   */\n  public static native int bufSizeYUV(int width, int pad, int height,\n                                      int subsamp);\n\n  /**\n   * @deprecated Use {@link #bufSizeYUV(int, int, int, int)} instead.\n   */\n  @Deprecated\n  public static native int bufSizeYUV(int width, int height, int subsamp);\n\n  /**\n   * Returns the size of the buffer (in bytes) required to hold a YUV image\n   * plane with the given parameters.\n   *\n   * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb,\n   * 2 = V/Cr)\n   *\n   * @param width width (in pixels) of the YUV image.  NOTE: this is the width\n   * of the whole image, not the plane width.\n   *\n   * @param stride bytes per line in the image plane.\n   *\n   * @param height height (in pixels) of the YUV image.  NOTE: this is the\n   * height of the whole image, not the plane height.\n   *\n   * @param subsamp the level of chrominance subsampling used in the YUV\n   * image (one of {@link TJ TJ.SAMP_*})\n   *\n   * @return the size of the buffer (in bytes) required to hold a YUV planar\n   * image with the given parameters.\n   */\n  public static native int planeSizeYUV(int componentID, int width, int stride,\n                                        int height, int subsamp);\n\n  /**\n   * Returns the plane width of a YUV image plane with the given parameters.\n   * Refer to {@link YUVImage YUVImage} for a description of plane width.\n   *\n   * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb,\n   * 2 = V/Cr)\n   *\n   * @param width width (in pixels) of the YUV image\n   *\n   * @param subsamp the level of chrominance subsampling used in the YUV image\n   * (one of {@link TJ TJ.SAMP_*})\n   *\n   * @return the plane width of a YUV image plane with the given parameters.\n   */\n  public static native int planeWidth(int componentID, int width, int subsamp);\n\n  /**\n   * Returns the plane height of a YUV image plane with the given parameters.\n   * Refer to {@link YUVImage YUVImage} for a description of plane height.\n   *\n   * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb,\n   * 2 = V/Cr)\n   *\n   * @param height height (in pixels) of the YUV image\n   *\n   * @param subsamp the level of chrominance subsampling used in the YUV image\n   * (one of {@link TJ TJ.SAMP_*})\n   *\n   * @return the plane height of a YUV image plane with the given parameters.\n   */\n  public static native int planeHeight(int componentID, int height,\n                                       int subsamp);\n\n  /**\n   * Returns a list of fractional scaling factors that the JPEG decompressor in\n   * this implementation of TurboJPEG supports.\n   *\n   * @return a list of fractional scaling factors that the JPEG decompressor in\n   * this implementation of TurboJPEG supports.\n   */\n  public static native TJScalingFactor[] getScalingFactors();\n\n  static {\n    TJLoader.load();\n  }\n\n  private static void checkPixelFormat(int pixelFormat) {\n    if (pixelFormat < 0 || pixelFormat >= NUMPF)\n      throw new IllegalArgumentException(\"Invalid pixel format\");\n  }\n\n  private static void checkSubsampling(int subsamp) {\n    if (subsamp < 0 || subsamp >= NUMSAMP)\n      throw new IllegalArgumentException(\"Invalid subsampling type\");\n  }\n\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/org/libjpegturbo/turbojpeg/TJCompressor.java",
    "content": "/*\n * Copyright (C)2011-2015 D. R. Commander.  All Rights Reserved.\n * Copyright (C)2015 Viktor Szathmáry.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\npackage org.libjpegturbo.turbojpeg;\n\nimport java.awt.image.*;\nimport java.nio.*;\nimport java.io.*;\n\n/**\n * TurboJPEG compressor\n */\npublic class TJCompressor implements Closeable {\n\n  private static final String NO_ASSOC_ERROR =\n    \"No source image is associated with this instance\";\n\n  /**\n   * Create a TurboJPEG compressor instance.\n   */\n  public TJCompressor() throws TJException {\n    init();\n  }\n\n  /**\n   * Create a TurboJPEG compressor instance and associate the uncompressed\n   * source image stored in <code>srcImage</code> with the newly created\n   * instance.\n   *\n   * @param srcImage see {@link #setSourceImage} for description\n   *\n   * @param x see {@link #setSourceImage} for description\n   *\n   * @param y see {@link #setSourceImage} for description\n   *\n   * @param width see {@link #setSourceImage} for description\n   *\n   * @param pitch see {@link #setSourceImage} for description\n   *\n   * @param height see {@link #setSourceImage} for description\n   *\n   * @param pixelFormat pixel format of the source image (one of\n   * {@link TJ#PF_RGB TJ.PF_*})\n   */\n  public TJCompressor(byte[] srcImage, int x, int y, int width, int pitch,\n                      int height, int pixelFormat) throws TJException {\n    setSourceImage(srcImage, x, y, width, pitch, height, pixelFormat);\n  }\n\n  /**\n   * @deprecated Use\n   * {@link #TJCompressor(byte[], int, int, int, int, int, int)} instead.\n   */\n  @Deprecated\n  public TJCompressor(byte[] srcImage, int width, int pitch, int height,\n                      int pixelFormat) throws TJException {\n    setSourceImage(srcImage, width, pitch, height, pixelFormat);\n  }\n\n  /**\n   * Create a TurboJPEG compressor instance and associate the uncompressed\n   * source image stored in <code>srcImage</code> with the newly created\n   * instance.\n   *\n   * @param srcImage see\n   * {@link #setSourceImage(BufferedImage, int, int, int, int)} for description\n   *\n   * @param x see\n   * {@link #setSourceImage(BufferedImage, int, int, int, int)} for description\n   *\n   * @param y see\n   * {@link #setSourceImage(BufferedImage, int, int, int, int)} for description\n   *\n   * @param width see\n   * {@link #setSourceImage(BufferedImage, int, int, int, int)} for description\n   *\n   * @param height see\n   * {@link #setSourceImage(BufferedImage, int, int, int, int)} for description\n   */\n  public TJCompressor(BufferedImage srcImage, int x, int y, int width,\n                      int height) throws TJException {\n    setSourceImage(srcImage, x, y, width, height);\n  }\n\n  /**\n   * Associate an uncompressed RGB, grayscale, or CMYK source image with this\n   * compressor instance.\n   *\n   * @param srcImage image buffer containing RGB, grayscale, or CMYK pixels to\n   * be compressed or encoded.  This buffer is not modified.\n   *\n   * @param x x offset (in pixels) of the region in the source image from which\n   * the JPEG or YUV image should be compressed/encoded\n   *\n   * @param y y offset (in pixels) of the region in the source image from which\n   * the JPEG or YUV image should be compressed/encoded\n   *\n   * @param width width (in pixels) of the region in the source image from\n   * which the JPEG or YUV image should be compressed/encoded\n   *\n   * @param pitch bytes per line of the source image.  Normally, this should be\n   * <code>width * TJ.pixelSize(pixelFormat)</code> if the source image is\n   * unpadded, but you can use this parameter to, for instance, specify that\n   * the scanlines in the source image are padded to a 4-byte boundary or to\n   * compress/encode a JPEG or YUV image from a region of a larger source\n   * image.  You can also be clever and use this parameter to skip lines, etc.\n   * Setting this parameter to 0 is the equivalent of setting it to\n   * <code>width * TJ.pixelSize(pixelFormat)</code>.\n   *\n   * @param height height (in pixels) of the region in the source image from\n   * which the JPEG or YUV image should be compressed/encoded\n   *\n   * @param pixelFormat pixel format of the source image (one of\n   * {@link TJ#PF_RGB TJ.PF_*})\n   */\n  public void setSourceImage(byte[] srcImage, int x, int y, int width,\n                             int pitch, int height, int pixelFormat)\n                             throws TJException {\n    if (handle == 0) init();\n    if (srcImage == null || x < 0 || y < 0 || width < 1 || height < 1 ||\n        pitch < 0 || pixelFormat < 0 || pixelFormat >= TJ.NUMPF)\n      throw new IllegalArgumentException(\"Invalid argument in setSourceImage()\");\n    srcBuf = srcImage;\n    srcWidth = width;\n    if (pitch == 0)\n      srcPitch = width * TJ.getPixelSize(pixelFormat);\n    else\n      srcPitch = pitch;\n    srcHeight = height;\n    srcPixelFormat = pixelFormat;\n    srcX = x;\n    srcY = y;\n    srcBufInt = null;\n    srcYUVImage = null;\n  }\n\n  /**\n   * @deprecated Use\n   * {@link #setSourceImage(byte[], int, int, int, int, int, int)} instead.\n   */\n  @Deprecated\n  public void setSourceImage(byte[] srcImage, int width, int pitch,\n                             int height, int pixelFormat) throws TJException {\n    setSourceImage(srcImage, 0, 0, width, pitch, height, pixelFormat);\n    srcX = srcY = -1;\n  }\n\n  /**\n   * Associate an uncompressed RGB or grayscale source image with this\n   * compressor instance.\n   *\n   * @param srcImage a <code>BufferedImage</code> instance containing RGB or\n   * grayscale pixels to be compressed or encoded.  This image is not modified.\n   *\n   * @param x x offset (in pixels) of the region in the source image from which\n   * the JPEG or YUV image should be compressed/encoded\n   *\n   * @param y y offset (in pixels) of the region in the source image from which\n   * the JPEG or YUV image should be compressed/encoded\n   *\n   * @param width width (in pixels) of the region in the source image from\n   * which the JPEG or YUV image should be compressed/encoded (0 = use the\n   * width of the source image)\n   *\n   * @param height height (in pixels) of the region in the source image from\n   * which the JPEG or YUV image should be compressed/encoded (0 = use the\n   * height of the source image)\n   */\n  public void setSourceImage(BufferedImage srcImage, int x, int y, int width,\n                             int height) throws TJException {\n    if (handle == 0) init();\n    if (srcImage == null || x < 0 || y < 0 || width < 0 || height < 0)\n      throw new IllegalArgumentException(\"Invalid argument in setSourceImage()\");\n    srcX = x;\n    srcY = y;\n    srcWidth = (width == 0) ? srcImage.getWidth(): width;\n    srcHeight = (height == 0) ? srcImage.getHeight() : height;\n    if (x + width > srcImage.getWidth() || y + height > srcImage.getHeight())\n      throw new IllegalArgumentException(\"Compression region exceeds the bounds of the source image\");\n\n    int pixelFormat;\n    boolean intPixels = false;\n    if (byteOrder == null)\n      byteOrder = ByteOrder.nativeOrder();\n    switch(srcImage.getType()) {\n      case BufferedImage.TYPE_3BYTE_BGR:\n        pixelFormat = TJ.PF_BGR;  break;\n      case BufferedImage.TYPE_4BYTE_ABGR:\n      case BufferedImage.TYPE_4BYTE_ABGR_PRE:\n        pixelFormat = TJ.PF_XBGR;  break;\n      case BufferedImage.TYPE_BYTE_GRAY:\n        pixelFormat = TJ.PF_GRAY;  break;\n      case BufferedImage.TYPE_INT_BGR:\n        if (byteOrder == ByteOrder.BIG_ENDIAN)\n          pixelFormat = TJ.PF_XBGR;\n        else\n          pixelFormat = TJ.PF_RGBX;\n        intPixels = true;  break;\n      case BufferedImage.TYPE_INT_RGB:\n      case BufferedImage.TYPE_INT_ARGB:\n      case BufferedImage.TYPE_INT_ARGB_PRE:\n        if (byteOrder == ByteOrder.BIG_ENDIAN)\n          pixelFormat = TJ.PF_XRGB;\n        else\n          pixelFormat = TJ.PF_BGRX;\n        intPixels = true;  break;\n      default:\n        throw new IllegalArgumentException(\"Unsupported BufferedImage format\");\n    }\n    srcPixelFormat = pixelFormat;\n\n    WritableRaster wr = srcImage.getRaster();\n    if (intPixels) {\n      SinglePixelPackedSampleModel sm =\n        (SinglePixelPackedSampleModel)srcImage.getSampleModel();\n      srcStride = sm.getScanlineStride();\n      DataBufferInt db = (DataBufferInt)wr.getDataBuffer();\n      srcBufInt = db.getData();\n      srcBuf = null;\n    } else {\n      ComponentSampleModel sm =\n        (ComponentSampleModel)srcImage.getSampleModel();\n      int pixelSize = sm.getPixelStride();\n      if (pixelSize != TJ.getPixelSize(pixelFormat))\n        throw new IllegalArgumentException(\"Inconsistency between pixel format and pixel size in BufferedImage\");\n      srcPitch = sm.getScanlineStride();\n      DataBufferByte db = (DataBufferByte)wr.getDataBuffer();\n      srcBuf = db.getData();\n      srcBufInt = null;\n    }\n    srcYUVImage = null;\n  }\n\n  /**\n   * Associate an uncompressed YUV planar source image with this compressor\n   * instance.\n   *\n   * @param srcImage YUV planar image to be compressed.  This image is not\n   * modified.\n   */\n  public void setSourceImage(YUVImage srcImage) throws TJException {\n    if (handle == 0) init();\n    if (srcImage == null)\n      throw new IllegalArgumentException(\"Invalid argument in setSourceImage()\");\n    srcYUVImage = srcImage;\n    srcBuf = null;\n    srcBufInt = null;\n  }\n\n  /**\n   * Set the level of chrominance subsampling for subsequent compress/encode\n   * operations.  When pixels are converted from RGB to YCbCr (see\n   * {@link TJ#CS_YCbCr}) or from CMYK to YCCK (see {@link TJ#CS_YCCK}) as part\n   * of the JPEG compression process, some of the Cb and Cr (chrominance)\n   * components can be discarded or averaged together to produce a smaller\n   * image with little perceptible loss of image clarity (the human eye is more\n   * sensitive to small changes in brightness than to small changes in color.)\n   * This is called \"chrominance subsampling\".\n   * <p>\n   * NOTE: This method has no effect when compressing a JPEG image from a YUV\n   * planar source.  In that case, the level of chrominance subsampling in\n   * the JPEG image is determined by the source.  Further, this method has no\n   * effect when encoding to a pre-allocated {@link YUVImage} instance.  In\n   * that case, the level of chrominance subsampling is determined by the\n   * destination.\n   *\n   * @param newSubsamp the level of chrominance subsampling to use in\n   * subsequent compress/encode oeprations (one of\n   * {@link TJ#SAMP_444 TJ.SAMP_*})\n   */\n  public void setSubsamp(int newSubsamp) {\n    if (newSubsamp < 0 || newSubsamp >= TJ.NUMSAMP)\n      throw new IllegalArgumentException(\"Invalid argument in setSubsamp()\");\n    subsamp = newSubsamp;\n  }\n\n  /**\n   * Set the JPEG image quality level for subsequent compress operations.\n   *\n   * @param quality the new JPEG image quality level (1 to 100, 1 = worst,\n   * 100 = best)\n   */\n  public void setJPEGQuality(int quality) {\n    if (quality < 1 || quality > 100)\n      throw new IllegalArgumentException(\"Invalid argument in setJPEGQuality()\");\n    jpegQuality = quality;\n  }\n\n  /**\n   * Compress the uncompressed source image associated with this compressor\n   * instance and output a JPEG image to the given destination buffer.\n   *\n   * @param dstBuf buffer that will receive the JPEG image.  Use\n   * {@link TJ#bufSize} to determine the maximum size for this buffer based on\n   * the source image's width and height and the desired level of chrominance\n   * subsampling.\n   *\n   * @param flags the bitwise OR of one or more of\n   * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}\n   */\n  public void compress(byte[] dstBuf, int flags) throws TJException {\n    if (dstBuf == null || flags < 0)\n      throw new IllegalArgumentException(\"Invalid argument in compress()\");\n    if (srcBuf == null && srcBufInt == null && srcYUVImage == null)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    if (jpegQuality < 0)\n      throw new IllegalStateException(\"JPEG Quality not set\");\n    if (subsamp < 0 && srcYUVImage == null)\n      throw new IllegalStateException(\"Subsampling level not set\");\n\n    if (srcYUVImage != null)\n      compressedSize = compressFromYUV(srcYUVImage.getPlanes(),\n                                       srcYUVImage.getOffsets(),\n                                       srcYUVImage.getWidth(),\n                                       srcYUVImage.getStrides(),\n                                       srcYUVImage.getHeight(),\n                                       srcYUVImage.getSubsamp(),\n                                       dstBuf, jpegQuality, flags);\n    else if (srcBuf != null) {\n      if (srcX >= 0 && srcY >= 0)\n        compressedSize = compress(srcBuf, srcX, srcY, srcWidth, srcPitch,\n                                  srcHeight, srcPixelFormat, dstBuf, subsamp,\n                                  jpegQuality, flags);\n      else\n        compressedSize = compress(srcBuf, srcWidth, srcPitch, srcHeight,\n                                  srcPixelFormat, dstBuf, subsamp, jpegQuality,\n                                  flags);\n    } else if (srcBufInt != null) {\n      if (srcX >= 0 && srcY >= 0)\n        compressedSize = compress(srcBufInt, srcX, srcY, srcWidth, srcStride,\n                                  srcHeight, srcPixelFormat, dstBuf, subsamp,\n                                  jpegQuality, flags);\n      else\n        compressedSize = compress(srcBufInt, srcWidth, srcStride, srcHeight,\n                                  srcPixelFormat, dstBuf, subsamp, jpegQuality,\n                                  flags);\n    }\n  }\n\n  /**\n   * Compress the uncompressed source image associated with this compressor\n   * instance and return a buffer containing a JPEG image.\n   *\n   * @param flags the bitwise OR of one or more of\n   * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}\n   *\n   * @return a buffer containing a JPEG image.  The length of this buffer will\n   * not be equal to the size of the JPEG image.  Use {@link\n   * #getCompressedSize} to obtain the size of the JPEG image.\n   */\n  public byte[] compress(int flags) throws TJException {\n    checkSourceImage();\n    byte[] buf = new byte[TJ.bufSize(srcWidth, srcHeight, subsamp)];\n    compress(buf, flags);\n    return buf;\n  }\n\n  /**\n   * @deprecated Use\n   * {@link #setSourceImage(BufferedImage, int, int, int, int)} and\n   * {@link #compress(byte[], int)} instead.\n   */\n  @Deprecated\n  public void compress(BufferedImage srcImage, byte[] dstBuf, int flags)\n                       throws TJException {\n    setSourceImage(srcImage, 0, 0, 0, 0);\n    compress(dstBuf, flags);\n  }\n\n  /**\n   * @deprecated Use\n   * {@link #setSourceImage(BufferedImage, int, int, int, int)} and\n   * {@link #compress(int)} instead.\n   */\n  @Deprecated\n  public byte[] compress(BufferedImage srcImage, int flags)\n                         throws TJException {\n    setSourceImage(srcImage, 0, 0, 0, 0);\n    return compress(flags);\n  }\n\n  /**\n   * Encode the uncompressed source image associated with this compressor\n   * instance into a YUV planar image and store it in the given\n   * <code>YUVImage</code> instance.   This method uses the accelerated color\n   * conversion routines in TurboJPEG's underlying codec but does not execute\n   * any of the other steps in the JPEG compression process.  Encoding\n   * CMYK source images to YUV is not supported.\n   *\n   * @param dstImage {@link YUVImage} instance that will receive the YUV planar\n   * image\n   *\n   * @param flags the bitwise OR of one or more of\n   * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}\n   */\n  public void encodeYUV(YUVImage dstImage, int flags) throws TJException {\n    if (dstImage == null || flags < 0)\n      throw new IllegalArgumentException(\"Invalid argument in encodeYUV()\");\n    if (srcBuf == null && srcBufInt == null)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    if (srcYUVImage != null)\n      throw new IllegalStateException(\"Source image is not correct type\");\n    checkSubsampling();\n    if (srcWidth != dstImage.getWidth() || srcHeight != dstImage.getHeight())\n      throw new IllegalStateException(\"Destination image is the wrong size\");\n\n    if (srcBufInt != null) {\n      encodeYUV(srcBufInt, srcX, srcY, srcWidth, srcStride, srcHeight,\n                srcPixelFormat, dstImage.getPlanes(), dstImage.getOffsets(),\n                dstImage.getStrides(), dstImage.getSubsamp(), flags);\n    } else {\n      encodeYUV(srcBuf, srcX, srcY, srcWidth, srcPitch, srcHeight,\n                srcPixelFormat, dstImage.getPlanes(), dstImage.getOffsets(),\n                dstImage.getStrides(), dstImage.getSubsamp(), flags);\n    }\n    compressedSize = 0;\n  }\n\n  /**\n   * @deprecated Use {@link #encodeYUV(YUVImage, int)} instead.\n   */\n  @Deprecated\n  public void encodeYUV(byte[] dstBuf, int flags) throws TJException {\n    if(dstBuf == null)\n      throw new IllegalArgumentException(\"Invalid argument in encodeYUV()\");\n    checkSourceImage();\n    checkSubsampling();\n    YUVImage yuvImage = new YUVImage(dstBuf, srcWidth, 4, srcHeight, subsamp);\n    encodeYUV(yuvImage, flags);\n  }\n\n  /**\n   * Encode the uncompressed source image associated with this compressor\n   * instance into a unified YUV planar image buffer and return a\n   * <code>YUVImage</code> instance containing the encoded image.  This method\n   * uses the accelerated color conversion routines in TurboJPEG's underlying\n   * codec but does not execute any of the other steps in the JPEG compression\n   * process.  Encoding CMYK source images to YUV is not supported.\n   *\n   * @param pad the width of each line in each plane of the YUV image will be\n   * padded to the nearest multiple of this number of bytes (must be a power of\n   * 2.)\n   *\n   * @param flags the bitwise OR of one or more of\n   * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}\n   *\n   * @return a YUV planar image.\n   */\n  public YUVImage encodeYUV(int pad, int flags) throws TJException {\n    checkSourceImage();\n    checkSubsampling();\n    if(pad < 1 || ((pad & (pad - 1)) != 0))\n      throw new IllegalStateException(\"Invalid argument in encodeYUV()\");\n    YUVImage yuvImage = new YUVImage(srcWidth, pad, srcHeight, subsamp);\n    encodeYUV(yuvImage, flags);\n    return yuvImage;\n  }\n\n  /**\n   * Encode the uncompressed source image associated with this compressor\n   * instance into separate Y, U (Cb), and V (Cr) image planes and return a\n   * <code>YUVImage</code> instance containing the encoded image planes.  This\n   * method uses the accelerated color conversion routines in TurboJPEG's\n   * underlying codec but does not execute any of the other steps in the JPEG\n   * compression process.  Encoding CMYK source images to YUV is not supported.\n   *\n   * @param strides an array of integers, each specifying the number of bytes\n   * per line in the corresponding plane of the output image.  Setting the\n   * stride for any plane to 0 is the same as setting it to the component width\n   * of the plane.  If <code>strides</code> is null, then the strides for all\n   * planes will be set to their respective component widths.  You can adjust\n   * the strides in order to add an arbitrary amount of line padding to each\n   * plane.\n   *\n   * @param flags the bitwise OR of one or more of\n   * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}\n   *\n   * @return a YUV planar image.\n   */\n  public YUVImage encodeYUV(int[] strides, int flags) throws TJException {\n    checkSourceImage();\n    checkSubsampling();\n    YUVImage yuvImage = new YUVImage(srcWidth, strides, srcHeight, subsamp);\n    encodeYUV(yuvImage, flags);\n    return yuvImage;\n  }\n\n  /**\n   * @deprecated Use {@link #encodeYUV(int, int)} instead.\n   */\n  @Deprecated\n  public byte[] encodeYUV(int flags) throws TJException {\n    checkSourceImage();\n    checkSubsampling();\n    YUVImage yuvImage = new YUVImage(srcWidth, 4, srcHeight, subsamp);\n    encodeYUV(yuvImage, flags);\n    return yuvImage.getBuf();\n  }\n\n  /**\n   * @deprecated Use\n   * {@link #setSourceImage(BufferedImage, int, int, int, int)} and\n   * {@link #encodeYUV(byte[], int)} instead.\n   */\n  @Deprecated\n  public void encodeYUV(BufferedImage srcImage, byte[] dstBuf, int flags)\n                        throws TJException {\n    setSourceImage(srcImage, 0, 0, 0, 0);\n    encodeYUV(dstBuf, flags);\n  }\n\n  /**\n   * @deprecated Use\n   * {@link #setSourceImage(BufferedImage, int, int, int, int)} and\n   * {@link #encodeYUV(int, int)} instead.\n   */\n  @Deprecated\n  public byte[] encodeYUV(BufferedImage srcImage, int flags)\n                          throws TJException {\n    setSourceImage(srcImage, 0, 0, 0, 0);\n    return encodeYUV(flags);\n  }\n\n  /**\n   * Returns the size of the image (in bytes) generated by the most recent\n   * compress operation.\n   *\n   * @return the size of the image (in bytes) generated by the most recent\n   * compress operation.\n   */\n  public int getCompressedSize() {\n    return compressedSize;\n  }\n\n  /**\n   * Free the native structures associated with this compressor instance.\n   */\n  @Override\n  public void close() throws TJException {\n    if (handle != 0)\n      destroy();\n  }\n\n  @Override\n  protected void finalize() throws Throwable {\n    try {\n      close();\n    } catch(TJException e) {\n    } finally {\n      super.finalize();\n    }\n  };\n\n  private native void init() throws TJException;\n\n  private native void destroy() throws TJException;\n\n  // JPEG size in bytes is returned\n  @Deprecated\n  private native int compress(byte[] srcBuf, int width, int pitch,\n    int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp, int jpegQual,\n    int flags) throws TJException;\n\n  private native int compress(byte[] srcBuf, int x, int y, int width,\n    int pitch, int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp,\n    int jpegQual, int flags) throws TJException;\n\n  @Deprecated\n  private native int compress(int[] srcBuf, int width, int stride,\n    int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp, int jpegQual,\n    int flags) throws TJException;\n\n  private native int compress(int[] srcBuf, int x, int y, int width,\n    int stride, int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp,\n    int jpegQual, int flags) throws TJException;\n\n  private native int compressFromYUV(byte[][] srcPlanes, int[] srcOffsets,\n    int width, int[] srcStrides, int height, int subsamp, byte[] dstBuf,\n    int jpegQual, int flags)\n    throws TJException;\n\n  @Deprecated\n  private native void encodeYUV(byte[] srcBuf, int width, int pitch,\n    int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags)\n    throws TJException;\n\n  private native void encodeYUV(byte[] srcBuf, int x, int y, int width,\n    int pitch, int height, int pixelFormat, byte[][] dstPlanes,\n    int[] dstOffsets, int[] dstStrides, int subsamp, int flags)\n    throws TJException;\n\n  @Deprecated\n  private native void encodeYUV(int[] srcBuf, int width, int stride,\n    int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags)\n    throws TJException;\n\n  private native void encodeYUV(int[] srcBuf, int x, int y, int width,\n    int srcStride, int height, int pixelFormat, byte[][] dstPlanes,\n    int[] dstOffsets, int[] dstStrides, int subsamp, int flags)\n    throws TJException;\n\n  static {\n    TJLoader.load();\n  }\n\n  private void checkSourceImage() {\n    if (srcWidth < 1 || srcHeight < 1)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n  }\n\n  private void checkSubsampling() {\n    if (subsamp < 0)\n      throw new IllegalStateException(\"Subsampling level not set\");\n  }\n\n  private long handle = 0;\n  private byte[] srcBuf = null;\n  private int[] srcBufInt = null;\n  private int srcWidth = 0;\n  private int srcHeight = 0;\n  private int srcX = -1;\n  private int srcY = -1;\n  private int srcPitch = 0;\n  private int srcStride = 0;\n  private int srcPixelFormat = -1;\n  private YUVImage srcYUVImage = null;\n  private int subsamp = -1;\n  private int jpegQuality = -1;\n  private int compressedSize = 0;\n  private int yuvPad = 4;\n  private ByteOrder byteOrder = null;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/org/libjpegturbo/turbojpeg/TJCustomFilter.java",
    "content": "/*\n * Copyright (C)2011, 2013 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\npackage org.libjpegturbo.turbojpeg;\n\nimport java.awt.*;\nimport java.nio.*;\n\n/**\n * Custom filter callback interface\n */\npublic interface TJCustomFilter {\n\n  /**\n   * A callback function that can be used to modify the DCT coefficients after\n   * they are losslessly transformed but before they are transcoded to a new\n   * JPEG image.  This allows for custom filters or other transformations to be\n   * applied in the frequency domain.\n   *\n   * @param coeffBuffer a buffer containing transformed DCT coefficients.\n   * (NOTE: this buffer is not guaranteed to be valid once the callback\n   * returns, so applications wishing to hand off the DCT coefficients to\n   * another function or library should make a copy of them within the body of\n   * the callback.)\n   *\n   * @param bufferRegion rectangle containing the width and height of\n   * <code>coeffBuffer</code> as well as its offset relative to the component\n   * plane.  TurboJPEG implementations may choose to split each component plane\n   * into multiple DCT coefficient buffers and call the callback function once\n   * for each buffer.\n   *\n   * @param planeRegion rectangle containing the width and height of the\n   * component plane to which <code>coeffBuffer</code> belongs\n   *\n   * @param componentID ID number of the component plane to which\n   * <code>coeffBuffer</code> belongs (Y, Cb, and Cr have, respectively, ID's\n   * of 0, 1, and 2 in typical JPEG images.)\n   *\n   * @param transformID ID number of the transformed image to which\n   * <code>coeffBuffer</code> belongs.  This is the same as the index of the\n   * transform in the <code>transforms</code> array that was passed to {@link\n   * TJTransformer#transform TJTransformer.transform()}.\n   *\n   * @param transform a {@link TJTransform} instance that specifies the\n   * parameters and/or cropping region for this transform\n   */\n  void customFilter(ShortBuffer coeffBuffer, Rectangle bufferRegion,\n                    Rectangle planeRegion, int componentID, int transformID,\n                    TJTransform transform)\n    throws TJException;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/org/libjpegturbo/turbojpeg/TJDecompressor.java",
    "content": "/*\n * Copyright (C)2011-2015 D. R. Commander.  All Rights Reserved.\n * Copyright (C)2015 Viktor Szathmáry.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\npackage org.libjpegturbo.turbojpeg;\n\nimport java.awt.image.*;\nimport java.nio.*;\nimport java.io.*;\n\n/**\n * TurboJPEG decompressor\n */\npublic class TJDecompressor implements Closeable {\n\n  private static final String NO_ASSOC_ERROR =\n    \"No JPEG image is associated with this instance\";\n\n  /**\n   * Create a TurboJPEG decompresssor instance.\n   */\n  public TJDecompressor() throws TJException {\n    init();\n  }\n\n  /**\n   * Create a TurboJPEG decompressor instance and associate the JPEG source\n   * image stored in <code>jpegImage</code> with the newly created instance.\n   *\n   * @param jpegImage JPEG image buffer (size of the JPEG image is assumed to\n   * be the length of the array.)  This buffer is not modified.\n   */\n  public TJDecompressor(byte[] jpegImage) throws TJException {\n    init();\n    setSourceImage(jpegImage, jpegImage.length);\n  }\n\n  /**\n   * Create a TurboJPEG decompressor instance and associate the JPEG source\n   * image of length <code>imageSize</code> bytes stored in\n   * <code>jpegImage</code> with the newly created instance.\n   *\n   * @param jpegImage JPEG image buffer.  This buffer is not modified.\n   *\n   * @param imageSize size of the JPEG image (in bytes)\n   */\n  public TJDecompressor(byte[] jpegImage, int imageSize) throws TJException {\n    init();\n    setSourceImage(jpegImage, imageSize);\n  }\n\n  /**\n   * Create a TurboJPEG decompressor instance and associate the YUV planar\n   * source image stored in <code>yuvImage</code> with the newly created\n   * instance.\n   *\n   * @param yuvImage {@link YUVImage} instance containing a YUV planar\n   * image to be decoded.  This image is not modified.\n   */\n  public TJDecompressor(YUVImage yuvImage) throws TJException {\n    init();\n    setSourceImage(yuvImage);\n  }\n\n  /**\n   * Associate the JPEG image of length <code>imageSize</code> bytes stored in\n   * <code>jpegImage</code> with this decompressor instance.  This image will\n   * be used as the source image for subsequent decompress operations.\n   *\n   * @param jpegImage JPEG image buffer.  This buffer is not modified.\n   *\n   * @param imageSize size of the JPEG image (in bytes)\n   */\n  public void setSourceImage(byte[] jpegImage, int imageSize)\n                             throws TJException {\n    if (jpegImage == null || imageSize < 1)\n      throw new IllegalArgumentException(\"Invalid argument in setSourceImage()\");\n    jpegBuf = jpegImage;\n    jpegBufSize = imageSize;\n    decompressHeader(jpegBuf, jpegBufSize);\n    yuvImage = null;\n  }\n\n  /**\n   * @deprecated Use {@link #setSourceImage(byte[], int)} instead.\n   */\n  @Deprecated\n  public void setJPEGImage(byte[] jpegImage, int imageSize)\n                           throws TJException {\n    setSourceImage(jpegImage, imageSize);\n  }\n\n  /**\n   * Associate the specified YUV planar source image with this decompressor\n   * instance.  Subsequent decompress operations will decode this image into an\n   * RGB or grayscale destination image.\n   *\n   * @param srcImage {@link YUVImage} instance containing a YUV planar image to\n   * be decoded.  This image is not modified.\n   */\n  public void setSourceImage(YUVImage srcImage) {\n    if (srcImage == null)\n      throw new IllegalArgumentException(\"Invalid argument in setSourceImage()\");\n    yuvImage = srcImage;\n    jpegBuf = null;\n    jpegBufSize = 0;\n  }\n\n\n  /**\n   * Returns the width of the source image (JPEG or YUV) associated with this\n   * decompressor instance.\n   *\n   * @return the width of the source image (JPEG or YUV) associated with this\n   * decompressor instance.\n   */\n  public int getWidth() {\n    if (yuvImage != null)\n      return yuvImage.getWidth();\n    if (jpegWidth < 1)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    return jpegWidth;\n  }\n\n  /**\n   * Returns the height of the source image (JPEG or YUV) associated with this\n   * decompressor instance.\n   *\n   * @return the height of the source image (JPEG or YUV) associated with this\n   * decompressor instance.\n   */\n  public int getHeight() {\n    if (yuvImage != null)\n      return yuvImage.getHeight();\n    if (jpegHeight < 1)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    return jpegHeight;\n  }\n\n  /**\n   * Returns the level of chrominance subsampling used in the source image\n   * (JPEG or YUV) associated with this decompressor instance.  See\n   * {@link TJ#SAMP_444 TJ.SAMP_*}.\n   *\n   * @return the level of chrominance subsampling used in the source image\n   * (JPEG or YUV) associated with this decompressor instance.\n   */\n  public int getSubsamp() {\n    if (yuvImage != null)\n      return yuvImage.getSubsamp();\n    if (jpegSubsamp < 0)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    if (jpegSubsamp >= TJ.NUMSAMP)\n      throw new IllegalStateException(\"JPEG header information is invalid\");\n    return jpegSubsamp;\n  }\n\n  /**\n   * Returns the colorspace used in the source image (JPEG or YUV) associated\n   * with this decompressor instance.  See {@link TJ#CS_RGB TJ.CS_*}.  If the\n   * source image is YUV, then this always returns {@link TJ#CS_YCbCr}.\n   *\n   * @return the colorspace used in the source image (JPEG or YUV) associated\n   * with this decompressor instance.\n   */\n  public int getColorspace() {\n    if (yuvImage != null)\n      return TJ.CS_YCbCr;\n    if (jpegColorspace < 0)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    if (jpegColorspace >= TJ.NUMCS)\n      throw new IllegalStateException(\"JPEG header information is invalid\");\n    return jpegColorspace;\n  }\n\n  /**\n   * Returns the JPEG image buffer associated with this decompressor instance.\n   *\n   * @return the JPEG image buffer associated with this decompressor instance.\n   */\n  public byte[] getJPEGBuf() {\n    if (jpegBuf == null)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    return jpegBuf;\n  }\n\n  /**\n   * Returns the size of the JPEG image (in bytes) associated with this\n   * decompressor instance.\n   *\n   * @return the size of the JPEG image (in bytes) associated with this\n   * decompressor instance.\n   */\n  public int getJPEGSize() {\n    if (jpegBufSize < 1)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    return jpegBufSize;\n  }\n\n  /**\n   * Returns the width of the largest scaled-down image that the TurboJPEG\n   * decompressor can generate without exceeding the desired image width and\n   * height.\n   *\n   * @param desiredWidth desired width (in pixels) of the decompressed image.\n   * Setting this to 0 is the same as setting it to the width of the JPEG image\n   * (in other words, the width will not be considered when determining the\n   * scaled image size.)\n   *\n   * @param desiredHeight desired height (in pixels) of the decompressed image.\n   * Setting this to 0 is the same as setting it to the height of the JPEG\n   * image (in other words, the height will not be considered when determining\n   * the scaled image size.)\n   *\n   * @return the width of the largest scaled-down image that the TurboJPEG\n   * decompressor can generate without exceeding the desired image width and\n   * height.\n   */\n  public int getScaledWidth(int desiredWidth, int desiredHeight) {\n    if (jpegWidth < 1 || jpegHeight < 1)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    if (desiredWidth < 0 || desiredHeight < 0)\n      throw new IllegalArgumentException(\"Invalid argument in getScaledWidth()\");\n    TJScalingFactor[] sf = TJ.getScalingFactors();\n    if (desiredWidth == 0)\n      desiredWidth = jpegWidth;\n    if (desiredHeight == 0)\n      desiredHeight = jpegHeight;\n    int scaledWidth = jpegWidth, scaledHeight = jpegHeight;\n    for (int i = 0; i < sf.length; i++) {\n      scaledWidth = sf[i].getScaled(jpegWidth);\n      scaledHeight = sf[i].getScaled(jpegHeight);\n      if (scaledWidth <= desiredWidth && scaledHeight <= desiredHeight)\n        break;\n    }\n    if (scaledWidth > desiredWidth || scaledHeight > desiredHeight)\n      throw new IllegalArgumentException(\"Could not scale down to desired image dimensions\");\n    return scaledWidth;\n  }\n\n  /**\n   * Returns the height of the largest scaled-down image that the TurboJPEG\n   * decompressor can generate without exceeding the desired image width and\n   * height.\n   *\n   * @param desiredWidth desired width (in pixels) of the decompressed image.\n   * Setting this to 0 is the same as setting it to the width of the JPEG image\n   * (in other words, the width will not be considered when determining the\n   * scaled image size.)\n   *\n   * @param desiredHeight desired height (in pixels) of the decompressed image.\n   * Setting this to 0 is the same as setting it to the height of the JPEG\n   * image (in other words, the height will not be considered when determining\n   * the scaled image size.)\n   *\n   * @return the height of the largest scaled-down image that the TurboJPEG\n   * decompressor can generate without exceeding the desired image width and\n   * height.\n   */\n  public int getScaledHeight(int desiredWidth, int desiredHeight) {\n    if (jpegWidth < 1 || jpegHeight < 1)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    if (desiredWidth < 0 || desiredHeight < 0)\n      throw new IllegalArgumentException(\"Invalid argument in getScaledHeight()\");\n    TJScalingFactor[] sf = TJ.getScalingFactors();\n    if (desiredWidth == 0)\n      desiredWidth = jpegWidth;\n    if (desiredHeight == 0)\n      desiredHeight = jpegHeight;\n    int scaledWidth = jpegWidth, scaledHeight = jpegHeight;\n    for (int i = 0; i < sf.length; i++) {\n      scaledWidth = sf[i].getScaled(jpegWidth);\n      scaledHeight = sf[i].getScaled(jpegHeight);\n      if (scaledWidth <= desiredWidth && scaledHeight <= desiredHeight)\n        break;\n    }\n    if (scaledWidth > desiredWidth || scaledHeight > desiredHeight)\n      throw new IllegalArgumentException(\"Could not scale down to desired image dimensions\");\n    return scaledHeight;\n  }\n\n  /**\n   * Decompress the JPEG source image or decode the YUV source image associated\n   * with this decompressor instance and output a grayscale, RGB, or CMYK image\n   * to the given destination buffer.\n   *\n   * @param dstBuf buffer that will receive the decompressed/decoded image.\n   * If the source image is a JPEG image, then this buffer should normally be\n   * <code>pitch * scaledHeight</code> bytes in size, where\n   * <code>scaledHeight</code> can be determined by calling <code>\n   * scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegHeight)\n   * </code> with one of the scaling factors returned from {@link\n   * TJ#getScalingFactors} or by calling {@link #getScaledHeight}.  If the\n   * source image is a YUV image, then this buffer should normally be\n   * <code>pitch * height</code> bytes in size, where <code>height</code> is\n   * the height of the YUV image.  However, the buffer may also be larger than\n   * the dimensions of the source image, in which case the <code>x</code>,\n   * <code>y</code>, and <code>pitch</code> parameters can be used to specify\n   * the region into which the source image should be decompressed/decoded.\n   *\n   * @param x x offset (in pixels) of the region in the destination image into\n   * which the source image should be decompressed/decoded\n   *\n   * @param y y offset (in pixels) of the region in the destination image into\n   * which the source image should be decompressed/decoded\n   *\n   * @param desiredWidth If the source image is a JPEG image, then this\n   * specifies the desired width (in pixels) of the decompressed image (or\n   * image region.)  If the desired destination image dimensions are different\n   * than the source image dimensions, then TurboJPEG will use scaling in the\n   * JPEG decompressor to generate the largest possible image that will fit\n   * within the desired dimensions.  Setting this to 0 is the same as setting\n   * it to the width of the JPEG image (in other words, the width will not be\n   * considered when determining the scaled image size.)  This parameter is\n   * ignored if the source image is a YUV image.\n   *\n   * @param pitch bytes per line of the destination image.  Normally, this\n   * should be set to <code>scaledWidth * TJ.pixelSize(pixelFormat)</code> if\n   * the destination image is unpadded, but you can use this to, for instance,\n   * pad each line of the destination image to a 4-byte boundary or to\n   * decompress/decode the source image into a region of a larger image.  NOTE:\n   * if the source image is a JPEG image, then <code>scaledWidth</code> can be\n   * determined by calling <code>\n   * scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegWidth)\n   * </code> or by calling {@link #getScaledWidth}.  If the source image is a\n   * YUV image, then <code>scaledWidth</code> is the width of the YUV image.\n   * Setting this parameter to 0 is the equivalent of setting it to\n   * <code>scaledWidth * TJ.pixelSize(pixelFormat)</code>.\n   *\n   * @param desiredHeight If the source image is a JPEG image, then this\n   * specifies the desired height (in pixels) of the decompressed image (or\n   * image region.)  If the desired destination image dimensions are different\n   * than the source image dimensions, then TurboJPEG will use scaling in the\n   * JPEG decompressor to generate the largest possible image that will fit\n   * within the desired dimensions.  Setting this to 0 is the same as setting\n   * it to the height of the JPEG image (in other words, the height will not be\n   * considered when determining the scaled image size.)  This parameter is\n   * ignored if the source image is a YUV image.\n   *\n   * @param pixelFormat pixel format of the decompressed/decoded image (one of\n   * {@link TJ#PF_RGB TJ.PF_*})\n   *\n   * @param flags the bitwise OR of one or more of\n   * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}\n   */\n  public void decompress(byte[] dstBuf, int x, int y, int desiredWidth,\n                         int pitch, int desiredHeight, int pixelFormat,\n                         int flags) throws TJException {\n    if (jpegBuf == null && yuvImage == null)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    if (dstBuf == null || x < 0 || y < 0 || pitch < 0 ||\n        (yuvImage != null && (desiredWidth < 0 || desiredHeight < 0)) ||\n        pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)\n      throw new IllegalArgumentException(\"Invalid argument in decompress()\");\n    if (yuvImage != null)\n      decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(),\n                yuvImage.getStrides(), yuvImage.getSubsamp(), dstBuf, x, y,\n                yuvImage.getWidth(), pitch, yuvImage.getHeight(), pixelFormat,\n                flags);\n    else {\n      if (x > 0 || y > 0)\n        decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, pitch,\n                   desiredHeight, pixelFormat, flags);\n      else\n        decompress(jpegBuf, jpegBufSize, dstBuf, desiredWidth, pitch,\n                   desiredHeight, pixelFormat, flags);\n    }\n  }\n\n  /**\n   * @deprecated Use\n   * {@link #decompress(byte[], int, int, int, int, int, int, int)} instead.\n   */\n  @Deprecated\n  public void decompress(byte[] dstBuf, int desiredWidth, int pitch,\n                         int desiredHeight, int pixelFormat, int flags)\n                         throws TJException {\n    decompress(dstBuf, 0, 0, desiredWidth, pitch, desiredHeight, pixelFormat,\n               flags);\n  }\n\n  /**\n   * Decompress the JPEG source image associated with this decompressor\n   * instance and return a buffer containing the decompressed image.\n   *\n   * @param desiredWidth see\n   * {@link #decompress(byte[], int, int, int, int, int, int, int)}\n   * for description\n   *\n   * @param pitch see\n   * {@link #decompress(byte[], int, int, int, int, int, int, int)}\n   * for description\n   *\n   * @param desiredHeight see\n   * {@link #decompress(byte[], int, int, int, int, int, int, int)}\n   * for description\n   *\n   * @param pixelFormat pixel format of the decompressed image (one of\n   * {@link TJ#PF_RGB TJ.PF_*})\n   *\n   * @param flags the bitwise OR of one or more of\n   * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}\n   *\n   * @return a buffer containing the decompressed image.\n   */\n  public byte[] decompress(int desiredWidth, int pitch, int desiredHeight,\n                           int pixelFormat, int flags) throws TJException {\n    if (pitch < 0 ||\n        (yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) ||\n        pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)\n      throw new IllegalArgumentException(\"Invalid argument in decompress()\");\n    int pixelSize = TJ.getPixelSize(pixelFormat);\n    int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);\n    int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);\n    if (pitch == 0)\n      pitch = scaledWidth * pixelSize;\n    byte[] buf = new byte[pitch * scaledHeight];\n    decompress(buf, desiredWidth, pitch, desiredHeight, pixelFormat, flags);\n    return buf;\n  }\n\n  /**\n   * Decompress the JPEG source image associated with this decompressor\n   * instance into a YUV planar image and store it in the given\n   * <code>YUVImage</code> instance.  This method performs JPEG decompression\n   * but leaves out the color conversion step, so a planar YUV image is\n   * generated instead of an RGB or grayscale image.  This method cannot be\n   * used to decompress JPEG source images with the CMYK or YCCK colorspace.\n   *\n   * @param dstImage {@link YUVImage} instance that will receive the YUV planar\n   * image.  The level of subsampling specified in this <code>YUVImage</code>\n   * instance must match that of the JPEG image, and the width and height\n   * specified in the <code>YUVImage</code> instance must match one of the\n   * scaled image sizes that TurboJPEG is capable of generating from the JPEG\n   * source image.\n   *\n   * @param flags the bitwise OR of one or more of\n   * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}\n   */\n  public void decompressToYUV(YUVImage dstImage, int flags)\n                              throws TJException {\n    if (jpegBuf == null)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    if (dstImage == null || flags < 0)\n      throw new IllegalArgumentException(\"Invalid argument in decompressToYUV()\");\n    int scaledWidth = getScaledWidth(dstImage.getWidth(),\n                                     dstImage.getHeight());\n    int scaledHeight = getScaledHeight(dstImage.getWidth(),\n                                       dstImage.getHeight());\n    if (scaledWidth != dstImage.getWidth() ||\n        scaledHeight != dstImage.getHeight())\n      throw new IllegalArgumentException(\"YUVImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating.\");\n    if (jpegSubsamp != dstImage.getSubsamp())\n      throw new IllegalArgumentException(\"YUVImage subsampling level does not match that of the JPEG image\");\n\n    decompressToYUV(jpegBuf, jpegBufSize, dstImage.getPlanes(),\n                    dstImage.getOffsets(), dstImage.getWidth(),\n                    dstImage.getStrides(), dstImage.getHeight(), flags);\n  }\n\n  /**\n   * @deprecated Use {@link #decompressToYUV(YUVImage, int)} instead.\n   */\n  @Deprecated\n  public void decompressToYUV(byte[] dstBuf, int flags) throws TJException {\n    YUVImage dstImage = new YUVImage(dstBuf, jpegWidth, 4, jpegHeight,\n                                     jpegSubsamp);\n    decompressToYUV(dstImage, flags);\n  }\n\n  /**\n   * Decompress the JPEG source image associated with this decompressor\n   * instance into a set of Y, U (Cb), and V (Cr) image planes and return a\n   * <code>YUVImage</code> instance containing the decompressed image planes.\n   * This method performs JPEG decompression but leaves out the color\n   * conversion step, so a planar YUV image is generated instead of an RGB or\n   * grayscale image.  This method cannot be used to decompress JPEG source\n   * images with the CMYK or YCCK colorspace.\n   *\n   * @param desiredWidth desired width (in pixels) of the YUV image.  If the\n   * desired image dimensions are different than the dimensions of the JPEG\n   * image being decompressed, then TurboJPEG will use scaling in the JPEG\n   * decompressor to generate the largest possible image that will fit within\n   * the desired dimensions.  Setting this to 0 is the same as setting it to\n   * the width of the JPEG image (in other words, the width will not be\n   * considered when determining the scaled image size.)\n   *\n   * @param strides an array of integers, each specifying the number of bytes\n   * per line in the corresponding plane of the output image.  Setting the\n   * stride for any plane to 0 is the same as setting it to the scaled\n   * component width of the plane.  If <tt>strides</tt> is NULL, then the\n   * strides for all planes will be set to their respective scaled component\n   * widths.  You can adjust the strides in order to add an arbitrary amount of\n   * line padding to each plane.\n   *\n   * @param desiredHeight desired height (in pixels) of the YUV image.  If the\n   * desired image dimensions are different than the dimensions of the JPEG\n   * image being decompressed, then TurboJPEG will use scaling in the JPEG\n   * decompressor to generate the largest possible image that will fit within\n   * the desired dimensions.  Setting this to 0 is the same as setting it to\n   * the height of the JPEG image (in other words, the height will not be\n   * considered when determining the scaled image size.)\n   *\n   * @param flags the bitwise OR of one or more of\n   * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}\n   *\n   * @return a YUV planar image.\n   */\n  public YUVImage decompressToYUV(int desiredWidth, int[] strides,\n                                  int desiredHeight,\n                                  int flags) throws TJException {\n    if (flags < 0)\n      throw new IllegalArgumentException(\"Invalid argument in decompressToYUV()\");\n    if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    if (jpegSubsamp >= TJ.NUMSAMP)\n      throw new IllegalStateException(\"JPEG header information is invalid\");\n    if (yuvImage != null)\n      throw new IllegalStateException(\"Source image is the wrong type\");\n\n    int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);\n    int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);\n    YUVImage yuvImage = new YUVImage(scaledWidth, null, scaledHeight,\n                                     jpegSubsamp);\n    decompressToYUV(yuvImage, flags);\n    return yuvImage;\n  }\n\n  /**\n   * Decompress the JPEG source image associated with this decompressor\n   * instance into a unified YUV planar image buffer and return a\n   * <code>YUVImage</code> instance containing the decompressed image.  This\n   * method performs JPEG decompression but leaves out the color conversion\n   * step, so a planar YUV image is generated instead of an RGB or grayscale\n   * image.  This method cannot be used to decompress JPEG source images with\n   * the CMYK or YCCK colorspace.\n   *\n   * @param desiredWidth desired width (in pixels) of the YUV image.  If the\n   * desired image dimensions are different than the dimensions of the JPEG\n   * image being decompressed, then TurboJPEG will use scaling in the JPEG\n   * decompressor to generate the largest possible image that will fit within\n   * the desired dimensions.  Setting this to 0 is the same as setting it to\n   * the width of the JPEG image (in other words, the width will not be\n   * considered when determining the scaled image size.)\n   *\n   * @param pad the width of each line in each plane of the YUV image will be\n   * padded to the nearest multiple of this number of bytes (must be a power of\n   * 2.)\n   *\n   * @param desiredHeight desired height (in pixels) of the YUV image.  If the\n   * desired image dimensions are different than the dimensions of the JPEG\n   * image being decompressed, then TurboJPEG will use scaling in the JPEG\n   * decompressor to generate the largest possible image that will fit within\n   * the desired dimensions.  Setting this to 0 is the same as setting it to\n   * the height of the JPEG image (in other words, the height will not be\n   * considered when determining the scaled image size.)\n   *\n   * @param flags the bitwise OR of one or more of\n   * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}\n   *\n   * @return a YUV planar image.\n   */\n  public YUVImage decompressToYUV(int desiredWidth, int pad, int desiredHeight,\n                                  int flags) throws TJException {\n    if (flags < 0)\n      throw new IllegalArgumentException(\"Invalid argument in decompressToYUV()\");\n    if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    if (jpegSubsamp >= TJ.NUMSAMP)\n      throw new IllegalStateException(\"JPEG header information is invalid\");\n    if (yuvImage != null)\n      throw new IllegalStateException(\"Source image is the wrong type\");\n\n    int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);\n    int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);\n    YUVImage yuvImage = new YUVImage(scaledWidth, pad, scaledHeight,\n                                     jpegSubsamp);\n    decompressToYUV(yuvImage, flags);\n    return yuvImage;\n  }\n\n  /**\n   * @deprecated Use {@link #decompressToYUV(int, int, int, int)} instead.\n   */\n  @Deprecated\n  public byte[] decompressToYUV(int flags) throws TJException {\n    YUVImage dstImage = new YUVImage(jpegWidth, 4, jpegHeight, jpegSubsamp);\n    decompressToYUV(dstImage, flags);\n    return dstImage.getBuf();\n  }\n\n  /**\n   * Decompress the JPEG source image or decode the YUV source image associated\n   * with this decompressor instance and output a grayscale, RGB, or CMYK image\n   * to the given destination buffer.\n   *\n   * @param dstBuf buffer that will receive the decompressed/decoded image.\n   * If the source image is a JPEG image, then this buffer should normally be\n   * <code>stride * scaledHeight</code> pixels in size, where\n   * <code>scaledHeight</code> can be determined by calling <code>\n   * scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegHeight)\n   * </code> with one of the scaling factors returned from {@link\n   * TJ#getScalingFactors} or by calling {@link #getScaledHeight}.  If the\n   * source image is a YUV image, then this buffer should normally be\n   * <code>stride * height</code> pixels in size, where <code>height</code> is\n   * the height of the YUV image.  However, the buffer may also be larger than\n   * the dimensions of the JPEG image, in which case the <code>x</code>,\n   * <code>y</code>, and <code>stride</code> parameters can be used to specify\n   * the region into which the source image should be decompressed.\n   *\n   * @param x x offset (in pixels) of the region in the destination image into\n   * which the source image should be decompressed/decoded\n   *\n   * @param y y offset (in pixels) of the region in the destination image into\n   * which the source image should be decompressed/decoded\n   *\n   * @param desiredWidth If the source image is a JPEG image, then this\n   * specifies the desired width (in pixels) of the decompressed image (or\n   * image region.)  If the desired destination image dimensions are different\n   * than the source image dimensions, then TurboJPEG will use scaling in the\n   * JPEG decompressor to generate the largest possible image that will fit\n   * within the desired dimensions.  Setting this to 0 is the same as setting\n   * it to the width of the JPEG image (in other words, the width will not be\n   * considered when determining the scaled image size.)  This parameter is\n   * ignored if the source image is a YUV image.\n   *\n   * @param stride pixels per line of the destination image.  Normally, this\n   * should be set to <code>scaledWidth</code>, but you can use this to, for\n   * instance, decompress the JPEG image into a region of a larger image.\n   * NOTE: if the source image is a JPEG image, then <code>scaledWidth</code>\n   * can be determined by calling <code>\n   * scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegWidth)\n   * </code> or by calling {@link #getScaledWidth}.  If the source image is a\n   * YUV image, then <code>scaledWidth</code> is the width of the YUV image.\n   * Setting this parameter to 0 is the equivalent of setting it to\n   * <code>scaledWidth</code>.\n   *\n   * @param desiredHeight If the source image is a JPEG image, then this\n   * specifies the desired height (in pixels) of the decompressed image (or\n   * image region.)  If the desired destination image dimensions are different\n   * than the source image dimensions, then TurboJPEG will use scaling in the\n   * JPEG decompressor to generate the largest possible image that will fit\n   * within the desired dimensions.  Setting this to 0 is the same as setting\n   * it to the height of the JPEG image (in other words, the height will not be\n   * considered when determining the scaled image size.)  This parameter is\n   * ignored if the source image is a YUV image.\n   *\n   * @param pixelFormat pixel format of the decompressed image (one of\n   * {@link TJ#PF_RGB TJ.PF_*})\n   *\n   * @param flags the bitwise OR of one or more of\n   * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}\n   */\n  public void decompress(int[] dstBuf, int x, int y, int desiredWidth,\n                         int stride, int desiredHeight, int pixelFormat,\n                         int flags) throws TJException {\n    if (jpegBuf == null && yuvImage == null)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    if (dstBuf == null || x < 0 || y < 0 || stride < 0 ||\n        (yuvImage != null && (desiredWidth < 0 || desiredHeight < 0)) ||\n        pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)\n      throw new IllegalArgumentException(\"Invalid argument in decompress()\");\n    if (yuvImage != null)\n      decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(),\n                yuvImage.getStrides(), yuvImage.getSubsamp(), dstBuf, x, y,\n                yuvImage.getWidth(), stride, yuvImage.getHeight(), pixelFormat,\n                flags);\n    else\n      decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, stride,\n                 desiredHeight, pixelFormat, flags);\n  }\n\n  /**\n   * Decompress the JPEG source image or decode the YUV source image associated\n   * with this decompressor instance and output a decompressed/decoded image to\n   * the given <code>BufferedImage</code> instance.\n   *\n   * @param dstImage a <code>BufferedImage</code> instance that will receive\n   * the decompressed/decoded image.  If the source image is a JPEG image, then\n   * the width and height of the <code>BufferedImage</code> instance must match\n   * one of the scaled image sizes that TurboJPEG is capable of generating from\n   * the JPEG image.  If the source image is a YUV image, then the width and\n   * height of the <code>BufferedImage</code> instance must match the width and\n   * height of the YUV image.\n   *\n   * @param flags the bitwise OR of one or more of\n   * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}\n   */\n  public void decompress(BufferedImage dstImage, int flags)\n                         throws TJException {\n    if (dstImage == null || flags < 0)\n      throw new IllegalArgumentException(\"Invalid argument in decompress()\");\n    int desiredWidth = dstImage.getWidth();\n    int desiredHeight = dstImage.getHeight();\n    int scaledWidth, scaledHeight;\n\n    if (yuvImage != null) {\n      if (desiredWidth != yuvImage.getWidth() ||\n          desiredHeight != yuvImage.getHeight())\n        throw new IllegalArgumentException(\"BufferedImage dimensions do not match the dimensions of the source image.\");\n      scaledWidth = yuvImage.getWidth();\n      scaledHeight = yuvImage.getHeight();\n    } else {\n      scaledWidth = getScaledWidth(desiredWidth, desiredHeight);\n      scaledHeight = getScaledHeight(desiredWidth, desiredHeight);\n      if (scaledWidth != desiredWidth || scaledHeight != desiredHeight)\n        throw new IllegalArgumentException(\"BufferedImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating.\");\n    }\n    int pixelFormat;  boolean intPixels = false;\n    if (byteOrder == null)\n      byteOrder = ByteOrder.nativeOrder();\n    switch(dstImage.getType()) {\n      case BufferedImage.TYPE_3BYTE_BGR:\n        pixelFormat = TJ.PF_BGR;  break;\n      case BufferedImage.TYPE_4BYTE_ABGR:\n      case BufferedImage.TYPE_4BYTE_ABGR_PRE:\n        pixelFormat = TJ.PF_XBGR;  break;\n      case BufferedImage.TYPE_BYTE_GRAY:\n        pixelFormat = TJ.PF_GRAY;  break;\n      case BufferedImage.TYPE_INT_BGR:\n        if (byteOrder == ByteOrder.BIG_ENDIAN)\n          pixelFormat = TJ.PF_XBGR;\n        else\n          pixelFormat = TJ.PF_RGBX;\n        intPixels = true;  break;\n      case BufferedImage.TYPE_INT_RGB:\n        if (byteOrder == ByteOrder.BIG_ENDIAN)\n          pixelFormat = TJ.PF_XRGB;\n        else\n          pixelFormat = TJ.PF_BGRX;\n        intPixels = true;  break;\n      case BufferedImage.TYPE_INT_ARGB:\n      case BufferedImage.TYPE_INT_ARGB_PRE:\n        if (byteOrder == ByteOrder.BIG_ENDIAN)\n          pixelFormat = TJ.PF_ARGB;\n        else\n          pixelFormat = TJ.PF_BGRA;\n        intPixels = true;  break;\n      default:\n        throw new IllegalArgumentException(\"Unsupported BufferedImage format\");\n    }\n    WritableRaster wr = dstImage.getRaster();\n    if (intPixels) {\n      SinglePixelPackedSampleModel sm =\n        (SinglePixelPackedSampleModel)dstImage.getSampleModel();\n      int stride = sm.getScanlineStride();\n      DataBufferInt db = (DataBufferInt)wr.getDataBuffer();\n      int[] buf = db.getData();\n      if (yuvImage != null)\n        decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(),\n                  yuvImage.getStrides(), yuvImage.getSubsamp(), buf, 0, 0,\n                  yuvImage.getWidth(), stride, yuvImage.getHeight(),\n                  pixelFormat, flags);\n      else {\n        if (jpegBuf == null)\n          throw new IllegalStateException(NO_ASSOC_ERROR);\n        decompress(jpegBuf, jpegBufSize, buf, 0, 0, scaledWidth, stride,\n                   scaledHeight, pixelFormat, flags);\n      }\n    } else {\n      ComponentSampleModel sm =\n        (ComponentSampleModel)dstImage.getSampleModel();\n      int pixelSize = sm.getPixelStride();\n      if (pixelSize != TJ.getPixelSize(pixelFormat))\n        throw new IllegalArgumentException(\"Inconsistency between pixel format and pixel size in BufferedImage\");\n      int pitch = sm.getScanlineStride();\n      DataBufferByte db = (DataBufferByte)wr.getDataBuffer();\n      byte[] buf = db.getData();\n      decompress(buf, 0, 0, scaledWidth, pitch, scaledHeight, pixelFormat,\n                 flags);\n    }\n  }\n\n  /**\n   * Decompress the JPEG source image or decode the YUV source image associated\n   * with this decompressor instance and return a <code>BufferedImage</code>\n   * instance containing the decompressed/decoded image.\n   *\n   * @param desiredWidth see\n   * {@link #decompress(byte[], int, int, int, int, int, int, int)} for\n   * description\n   *\n   * @param desiredHeight see\n   * {@link #decompress(byte[], int, int, int, int, int, int, int)} for\n   * description\n   *\n   * @param bufferedImageType the image type of the <code>BufferedImage</code>\n   * instance that will be created (for instance,\n   * <code>BufferedImage.TYPE_INT_RGB</code>)\n   *\n   * @param flags the bitwise OR of one or more of\n   * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}\n   *\n   * @return a <code>BufferedImage</code> instance containing the\n   * decompressed/decoded image.\n   */\n  public BufferedImage decompress(int desiredWidth, int desiredHeight,\n                                  int bufferedImageType, int flags)\n                                  throws TJException {\n    if ((yuvImage == null && (desiredWidth < 0 || desiredHeight < 0)) ||\n        flags < 0)\n      throw new IllegalArgumentException(\"Invalid argument in decompress()\");\n    int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);\n    int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);\n    BufferedImage img = new BufferedImage(scaledWidth, scaledHeight,\n                                          bufferedImageType);\n    decompress(img, flags);\n    return img;\n  }\n\n  /**\n   * Free the native structures associated with this decompressor instance.\n   */\n  @Override\n  public void close() throws TJException {\n    if (handle != 0)\n      destroy();\n  }\n\n  @Override\n  protected void finalize() throws Throwable {\n    try {\n      close();\n    } catch(TJException e) {\n    } finally {\n      super.finalize();\n    }\n  };\n\n  private native void init() throws TJException;\n\n  private native void destroy() throws TJException;\n\n  private native void decompressHeader(byte[] srcBuf, int size)\n    throws TJException;\n\n  @Deprecated\n  private native void decompress(byte[] srcBuf, int size, byte[] dstBuf,\n    int desiredWidth, int pitch, int desiredHeight, int pixelFormat, int flags)\n    throws TJException;\n\n  private native void decompress(byte[] srcBuf, int size, byte[] dstBuf, int x,\n    int y, int desiredWidth, int pitch, int desiredHeight, int pixelFormat,\n    int flags) throws TJException;\n\n  @Deprecated\n  private native void decompress(byte[] srcBuf, int size, int[] dstBuf,\n    int desiredWidth, int stride, int desiredHeight, int pixelFormat,\n    int flags) throws TJException;\n\n  private native void decompress(byte[] srcBuf, int size, int[] dstBuf, int x,\n    int y, int desiredWidth, int stride, int desiredHeight, int pixelFormat,\n    int flags) throws TJException;\n\n  @Deprecated\n  private native void decompressToYUV(byte[] srcBuf, int size, byte[] dstBuf,\n    int flags) throws TJException;\n\n  private native void decompressToYUV(byte[] srcBuf, int size,\n    byte[][] dstPlanes, int[] dstOffsets, int desiredWidth, int[] dstStrides,\n    int desiredheight, int flags) throws TJException;\n\n  private native void decodeYUV(byte[][] srcPlanes, int[] srcOffsets,\n    int[] srcStrides, int subsamp, byte[] dstBuf, int x, int y, int width,\n    int pitch, int height, int pixelFormat, int flags) throws TJException;\n\n  private native void decodeYUV(byte[][] srcPlanes, int[] srcOffsets,\n    int[] srcStrides, int subsamp, int[] dstBuf, int x, int y, int width,\n    int stride, int height, int pixelFormat, int flags) throws TJException;\n\n  static {\n    TJLoader.load();\n  }\n\n  protected long handle = 0;\n  protected byte[] jpegBuf = null;\n  protected int jpegBufSize = 0;\n  protected YUVImage yuvImage = null;\n  protected int jpegWidth = 0;\n  protected int jpegHeight = 0;\n  protected int jpegSubsamp = -1;\n  protected int jpegColorspace = -1;\n  private ByteOrder byteOrder = null;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/org/libjpegturbo/turbojpeg/TJException.java",
    "content": "/*\n * Copyright (C)2015 Viktor Szathmáry.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\npackage org.libjpegturbo.turbojpeg;\n\nimport java.io.IOException;\n\npublic class TJException extends IOException {\n\n  private static final long serialVersionUID = 1L;\n\n  public TJException() {\n    super();\n  }\n\n  public TJException(String message, Throwable cause) {\n    super(message, cause);\n  }\n\n  public TJException(String message) {\n    super(message);\n  }\n\n  public TJException(Throwable cause) {\n    super(cause);\n  }\n\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/org/libjpegturbo/turbojpeg/TJLoader.java.in",
    "content": "/*\n * Copyright (C)2011 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\npackage org.libjpegturbo.turbojpeg;\n\nfinal class TJLoader {\n  static void load() {\n    System.loadLibrary(\"@TURBOJPEG_DLL_NAME@\");\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/org/libjpegturbo/turbojpeg/TJLoader.java.tmpl",
    "content": "/*\n * Copyright (C)2011-2013 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\npackage org.libjpegturbo.turbojpeg;\n\nfinal class TJLoader {\n  static void load() {\n    try {\n      System.loadLibrary(\"turbojpeg\");\n    } catch (java.lang.UnsatisfiedLinkError e) {\n      String os = System.getProperty(\"os.name\").toLowerCase();\n      if (os.indexOf(\"mac\") >= 0) {\n        try {\n          System.load(\"%{__libdir}/libturbojpeg.jnilib\");\n        } catch (java.lang.UnsatisfiedLinkError e2) {\n          System.load(\"/usr/lib/libturbojpeg.jnilib\");\n        }\n      } else {\n        try {\n          System.load(\"%{__libdir}/libturbojpeg.so\");\n        } catch (java.lang.UnsatisfiedLinkError e3) {\n          String libdir = \"%{__libdir}\";\n          if (libdir.equals(\"/opt/libjpeg-turbo/lib64\")) {\n            System.load(\"/opt/libjpeg-turbo/lib32/libturbojpeg.so\");\n          } else if (libdir.equals(\"/opt/libjpeg-turbo/lib32\")) {\n            System.load(\"/opt/libjpeg-turbo/lib64/libturbojpeg.so\");\n          } else {\n            throw e3;\n          }\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/org/libjpegturbo/turbojpeg/TJScalingFactor.java",
    "content": "/*\n * Copyright (C)2011 D. R. Commander.  All Rights Reserved.\n * Copyright (C)2015 Viktor Szathmáry.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\npackage org.libjpegturbo.turbojpeg;\n\n/**\n * Fractional scaling factor\n */\npublic class TJScalingFactor {\n\n  public TJScalingFactor(int num, int denom) {\n    if (num < 1 || denom < 1)\n      throw new IllegalArgumentException(\"Numerator and denominator must be >= 1\");\n    this.num = num;\n    this.denom = denom;\n  }\n\n  /**\n   * Returns numerator\n   *\n   * @return numerator\n   */\n  public int getNum() {\n    return num;\n  }\n\n  /**\n   * Returns denominator\n   *\n   * @return denominator\n   */\n  public int getDenom() {\n    return denom;\n  }\n\n  /**\n   * Returns the scaled value of <code>dimension</code>.  This function\n   * performs the integer equivalent of\n   * <code>ceil(dimension * scalingFactor)</code>.\n   *\n   * @return the scaled value of <code>dimension</code>.\n   */\n  public int getScaled(int dimension) {\n    return (dimension * num + denom - 1) / denom;\n  }\n\n  /**\n   * Returns true or false, depending on whether this instance and\n   * <code>other</code> have the same numerator and denominator.\n   *\n   * @return true or false, depending on whether this instance and\n   * <code>other</code> have the same numerator and denominator.\n   */\n  public boolean equals(TJScalingFactor other) {\n    return this.num == other.num && this.denom == other.denom;\n  }\n\n  /**\n   * Returns true or false, depending on whether this instance is equal to\n   * 1/1.\n   *\n   * @return true or false, depending on whether this instance is equal to\n   * 1/1.\n   */\n  public boolean isOne() {\n    return num == 1 && denom == 1;\n  }\n\n  /**\n   * Numerator\n   */\n  private int num = 1;\n\n  /**\n   * Denominator\n   */\n  private int denom = 1;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/org/libjpegturbo/turbojpeg/TJTransform.java",
    "content": "/*\n * Copyright (C)2011, 2013 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\npackage org.libjpegturbo.turbojpeg;\n\nimport java.awt.*;\n\n/**\n * Lossless transform parameters\n */\npublic class TJTransform extends Rectangle {\n\n  private static final long serialVersionUID = -127367705761430371L;\n\n  /**\n   * The number of lossless transform operations\n   */\n  public static final int NUMOP         = 8;\n  /**\n   * Do not transform the position of the image pixels.\n   */\n  public static final int OP_NONE       = 0;\n  /**\n   * Flip (mirror) image horizontally.  This transform is imperfect if there\n   * are any partial MCU blocks on the right edge.\n   * @see #OPT_PERFECT\n   */\n  public static final int OP_HFLIP      = 1;\n  /**\n   * Flip (mirror) image vertically.  This transform is imperfect if there are\n   * any partial MCU blocks on the bottom edge.\n   * @see #OPT_PERFECT\n   */\n  public static final int OP_VFLIP      = 2;\n  /**\n   * Transpose image (flip/mirror along upper left to lower right axis).  This\n   * transform is always perfect.\n   * @see #OPT_PERFECT\n   */\n  public static final int OP_TRANSPOSE  = 3;\n  /**\n   * Transverse transpose image (flip/mirror along upper right to lower left\n   * axis).  This transform is imperfect if there are any partial MCU blocks in\n   * the image.\n   * @see #OPT_PERFECT\n   */\n  public static final int OP_TRANSVERSE = 4;\n  /**\n   * Rotate image clockwise by 90 degrees.  This transform is imperfect if\n   * there are any partial MCU blocks on the bottom edge.\n   * @see #OPT_PERFECT\n   */\n  public static final int OP_ROT90      = 5;\n  /**\n   * Rotate image 180 degrees.  This transform is imperfect if there are any\n   * partial MCU blocks in the image.\n   * @see #OPT_PERFECT\n   */\n  public static final int OP_ROT180     = 6;\n  /**\n   * Rotate image counter-clockwise by 90 degrees.  This transform is imperfect\n   * if there are any partial MCU blocks on the right edge.\n   * @see #OPT_PERFECT\n   */\n  public static final int OP_ROT270     = 7;\n\n\n  /**\n   * This option will cause {@link TJTransformer#transform\n   * TJTransformer.transform()} to throw an exception if the transform is not\n   * perfect.  Lossless transforms operate on MCU blocks, whose size depends on\n   * the level of chrominance subsampling used.  If the image's width or height\n   * is not evenly divisible by the MCU block size (see {@link TJ#getMCUWidth}\n   * and {@link TJ#getMCUHeight}), then there will be partial MCU blocks on the\n   * right and/or bottom edges.   It is not possible to move these partial MCU\n   * blocks to the top or left of the image, so any transform that would\n   * require that is \"imperfect.\"  If this option is not specified, then any\n   * partial MCU blocks that cannot be transformed will be left in place, which\n   * will create odd-looking strips on the right or bottom edge of the image.\n   */\n  public static final int OPT_PERFECT  = 1;\n  /**\n   * This option will discard any partial MCU blocks that cannot be\n   * transformed.\n   */\n  public static final int OPT_TRIM     = 2;\n  /**\n   * This option will enable lossless cropping.\n   */\n  public static final int OPT_CROP     = 4;\n  /**\n   * This option will discard the color data in the input image and produce\n   * a grayscale output image.\n   */\n  public static final int OPT_GRAY     = 8;\n  /**\n   * This option will prevent {@link TJTransformer#transform\n   * TJTransformer.transform()} from outputting a JPEG image for this\n   * particular transform.  This can be used in conjunction with a custom\n   * filter to capture the transformed DCT coefficients without transcoding\n   * them.\n   */\n  public static final int OPT_NOOUTPUT = 16;\n\n\n  /**\n   * Create a new lossless transform instance.\n   */\n  public TJTransform() {\n  }\n\n  /**\n   * Create a new lossless transform instance with the given parameters.\n   *\n   * @param x the left boundary of the cropping region.  This must be evenly\n   * divisible by the MCU block width (see {@link TJ#getMCUWidth})\n   *\n   * @param y the upper boundary of the cropping region.  This must be evenly\n   * divisible by the MCU block height (see {@link TJ#getMCUHeight})\n   *\n   * @param w the width of the cropping region.  Setting this to 0 is the\n   * equivalent of setting it to (width of the source JPEG image -\n   * <code>x</code>).\n   *\n   * @param h the height of the cropping region.  Setting this to 0 is the\n   * equivalent of setting it to (height of the source JPEG image -\n   * <code>y</code>).\n   *\n   * @param op one of the transform operations (<code>OP_*</code>)\n   *\n   * @param options the bitwise OR of one or more of the transform options\n   * (<code>OPT_*</code>)\n   *\n   * @param cf an instance of an object that implements the {@link\n   * TJCustomFilter} interface, or null if no custom filter is needed\n   */\n  public TJTransform(int x, int y, int w, int h, int op, int options,\n                     TJCustomFilter cf) {\n    super(x, y, w, h);\n    this.op = op;\n    this.options = options;\n    this.cf = cf;\n  }\n\n  /**\n   * Create a new lossless transform instance with the given parameters.\n   *\n   * @param r a <code>Rectangle</code> instance that specifies the cropping\n   * region.  See {@link\n   * #TJTransform(int, int, int, int, int, int, TJCustomFilter)} for more\n   * detail.\n   *\n   * @param op one of the transform operations (<code>OP_*</code>)\n   *\n   * @param options the bitwise OR of one or more of the transform options\n   * (<code>OPT_*</code>)\n   *\n   * @param cf an instance of an object that implements the {@link\n   * TJCustomFilter} interface, or null if no custom filter is needed\n   */\n  public TJTransform(Rectangle r, int op, int options,\n                     TJCustomFilter cf) {\n    super(r);\n    this.op = op;\n    this.options = options;\n    this.cf = cf;\n  }\n\n  /**\n   * Transform operation (one of <code>OP_*</code>)\n   */\n  public int op = 0;\n\n  /**\n   * Transform options (bitwise OR of one or more of <code>OPT_*</code>)\n   */\n  public int options = 0;\n\n  /**\n   * Custom filter instance\n   */\n  public TJCustomFilter cf = null;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/org/libjpegturbo/turbojpeg/TJTransformer.java",
    "content": "/*\n * Copyright (C)2011, 2013-2015 D. R. Commander.  All Rights Reserved.\n * Copyright (C)2015 Viktor Szathmáry.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\npackage org.libjpegturbo.turbojpeg;\n\n/**\n * TurboJPEG lossless transformer\n */\npublic class TJTransformer extends TJDecompressor {\n\n  /**\n   * Create a TurboJPEG lossless transformer instance.\n   */\n  public TJTransformer() throws TJException {\n    init();\n  }\n\n  /**\n   * Create a TurboJPEG lossless transformer instance and associate the JPEG\n   * image stored in <code>jpegImage</code> with the newly created instance.\n   *\n   * @param jpegImage JPEG image buffer (size of the JPEG image is assumed to\n   * be the length of the array.)  This buffer is not modified.\n   */\n  public TJTransformer(byte[] jpegImage) throws TJException {\n    init();\n    setSourceImage(jpegImage, jpegImage.length);\n  }\n\n  /**\n   * Create a TurboJPEG lossless transformer instance and associate the JPEG\n   * image of length <code>imageSize</code> bytes stored in\n   * <code>jpegImage</code> with the newly created instance.\n   *\n   * @param jpegImage JPEG image buffer.  This buffer is not modified.\n   *\n   * @param imageSize size of the JPEG image (in bytes)\n   */\n  public TJTransformer(byte[] jpegImage, int imageSize) throws TJException {\n    init();\n    setSourceImage(jpegImage, imageSize);\n  }\n\n  /**\n   * Losslessly transform the JPEG image associated with this transformer\n   * instance into one or more JPEG images stored in the given destination\n   * buffers.  Lossless transforms work by moving the raw coefficients from one\n   * JPEG image structure to another without altering the values of the\n   * coefficients.  While this is typically faster than decompressing the\n   * image, transforming it, and re-compressing it, lossless transforms are not\n   * free.  Each lossless transform requires reading and performing Huffman\n   * decoding on all of the coefficients in the source image, regardless of the\n   * size of the destination image.  Thus, this method provides a means of\n   * generating multiple transformed images from the same source or of applying\n   * multiple transformations simultaneously, in order to eliminate the need to\n   * read the source coefficients multiple times.\n   *\n   * @param dstBufs an array of image buffers.  <code>dstbufs[i]</code> will\n   * receive a JPEG image that has been transformed using the parameters in\n   * <code>transforms[i]</code>.  Use {@link TJ#bufSize} to determine the\n   * maximum size for each buffer based on the transformed or cropped width and\n   * height and the level of subsampling used in the source image.\n   *\n   * @param transforms an array of {@link TJTransform} instances, each of\n   * which specifies the transform parameters and/or cropping region for the\n   * corresponding transformed output image\n   *\n   * @param flags the bitwise OR of one or more of\n   * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}\n   */\n  public void transform(byte[][] dstBufs, TJTransform[] transforms,\n                        int flags) throws TJException {\n    if (jpegBuf == null)\n      throw new IllegalStateException(\"JPEG buffer not initialized\");\n    transformedSizes = transform(jpegBuf, jpegBufSize, dstBufs, transforms,\n                                 flags);\n  }\n\n  /**\n   * Losslessly transform the JPEG image associated with this transformer\n   * instance and return an array of {@link TJDecompressor} instances, each of\n   * which has a transformed JPEG image associated with it.\n   *\n   * @param transforms an array of {@link TJTransform} instances, each of\n   * which specifies the transform parameters and/or cropping region for the\n   * corresponding transformed output image\n   *\n   * @return an array of {@link TJDecompressor} instances, each of\n   * which has a transformed JPEG image associated with it.\n   *\n   * @param flags the bitwise OR of one or more of\n   * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}\n   */\n  public TJDecompressor[] transform(TJTransform[] transforms, int flags)\n                                    throws TJException {\n    byte[][] dstBufs = new byte[transforms.length][];\n    if (jpegWidth < 1 || jpegHeight < 1)\n      throw new IllegalStateException(\"JPEG buffer not initialized\");\n    for (int i = 0; i < transforms.length; i++) {\n      int w = jpegWidth, h = jpegHeight;\n      if ((transforms[i].options & TJTransform.OPT_CROP) != 0) {\n        if (transforms[i].width != 0) w = transforms[i].width;\n        if (transforms[i].height != 0) h = transforms[i].height;\n      }\n      dstBufs[i] = new byte[TJ.bufSize(w, h, jpegSubsamp)];\n    }\n    TJDecompressor[] tjd = new TJDecompressor[transforms.length];\n    transform(dstBufs, transforms, flags);\n    for (int i = 0; i < transforms.length; i++)\n      tjd[i] = new TJDecompressor(dstBufs[i], transformedSizes[i]);\n    return tjd;\n  }\n\n  /**\n   * Returns an array containing the sizes of the transformed JPEG images\n   * generated by the most recent transform operation.\n   *\n   * @return an array containing the sizes of the transformed JPEG images\n   * generated by the most recent transform operation.\n   */\n  public int[] getTransformedSizes() {\n    if (transformedSizes == null)\n      throw new IllegalStateException(\"No image has been transformed yet\");\n    return transformedSizes;\n  }\n\n  private native void init() throws TJException;\n\n  private native int[] transform(byte[] srcBuf, int srcSize, byte[][] dstBufs,\n    TJTransform[] transforms, int flags) throws TJException;\n\n  static {\n    TJLoader.load();\n  }\n\n  private int[] transformedSizes = null;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/org/libjpegturbo/turbojpeg/YUVImage.java",
    "content": "/*\n * Copyright (C)2014 D. R. Commander.  All Rights Reserved.\n * Copyright (C)2015 Viktor Szathmáry.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\npackage org.libjpegturbo.turbojpeg;\n\n/**\n * This class encapsulates a YUV planar image and the metadata\n * associated with it.  The TurboJPEG API allows both the JPEG compression and\n * decompression pipelines to be split into stages:  YUV encode, compress from\n * YUV, decompress to YUV, and YUV decode.  A <code>YUVImage</code> instance\n * serves as the destination image for YUV encode and decompress-to-YUV\n * operations and as the source image for compress-from-YUV and YUV decode\n * operations.\n * <p>\n * Technically, the JPEG format uses the YCbCr colorspace (which technically is\n * not a \"colorspace\" but rather a \"color transform\"), but per the convention\n * of the digital video community, the TurboJPEG API uses \"YUV\" to refer to an\n * image format consisting of Y, Cb, and Cr image planes.\n * <p>\n * Each plane is simply a 2D array of bytes, each byte representing the value\n * of one of the components (Y, Cb, or Cr) at a particular location in the\n * image.  The width and height of each plane are determined by the image\n * width, height, and level of chrominance subsampling.  The luminance plane\n * width is the image width padded to the nearest multiple of the horizontal\n * subsampling factor (2 in the case of 4:2:0 and 4:2:2, 4 in the case of\n * 4:1:1, 1 in the case of 4:4:4 or grayscale.)  Similarly, the luminance plane\n * height is the image height padded to the nearest multiple of the vertical\n * subsampling factor (2 in the case of 4:2:0 or 4:4:0, 1 in the case of 4:4:4\n * or grayscale.)  The chrominance plane width is equal to the luminance plane\n * width divided by the horizontal subsampling factor, and the chrominance\n * plane height is equal to the luminance plane height divided by the vertical\n * subsampling factor.\n * <p>\n * For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is\n * used, then the luminance plane would be 36 x 35 bytes, and each of the\n * chrominance planes would be 18 x 35 bytes.  If you specify a line padding of\n * 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and\n * each of the chrominance planes would be 20 x 35 bytes.\n */\npublic class YUVImage {\n\n  private static final String NO_ASSOC_ERROR =\n    \"No image data is associated with this instance\";\n\n  /**\n   * Create a new <code>YUVImage</code> instance backed by separate image\n   * planes, and allocate memory for the image planes.\n   *\n   * @param width width (in pixels) of the YUV image\n   *\n   * @param strides an array of integers, each specifying the number of bytes\n   * per line in the corresponding plane of the YUV image.  Setting the stride\n   * for any plane to 0 is the same as setting it to the plane width (see\n   * {@link YUVImage above}.)  If <code>strides</code> is null, then the\n   * strides for all planes will be set to their respective plane widths.  When\n   * using this constructor, the stride for each plane must be equal to or\n   * greater than the plane width.\n   *\n   * @param height height (in pixels) of the YUV image\n   *\n   * @param subsamp the level of chrominance subsampling to be used in the YUV\n   * image (one of {@link TJ#SAMP_444 TJ.SAMP_*})\n   */\n  public YUVImage(int width, int[] strides, int height, int subsamp) {\n    setBuf(null, null, width, strides, height, subsamp, true);\n  }\n\n  /**\n   * Create a new <code>YUVImage</code> instance backed by a unified image\n   * buffer, and allocate memory for the image buffer.\n   *\n   * @param width width (in pixels) of the YUV image\n   *\n   * @param pad Each line of each plane in the YUV image buffer will be padded\n   * to this number of bytes (must be a power of 2.)\n   *\n   * @param height height (in pixels) of the YUV image\n   *\n   * @param subsamp the level of chrominance subsampling to be used in the YUV\n   * image (one of {@link TJ#SAMP_444 TJ.SAMP_*})\n   */\n  public YUVImage(int width, int pad, int height, int subsamp) {\n    setBuf(new byte[TJ.bufSizeYUV(width, pad, height, subsamp)], width, pad,\n           height, subsamp);\n  }\n\n  /**\n   * Create a new <code>YUVImage</code> instance from a set of existing image\n   * planes.\n   *\n   * @param planes an array of buffers representing the Y, U (Cb), and V (Cr)\n   * image planes (or just the Y plane, if the image is grayscale.)   These\n   * planes can be contiguous or non-contiguous in memory.  Plane\n   * <code>i</code> should be at least <code>offsets[i] +\n   * {@link TJ#planeSizeYUV TJ.planeSizeYUV}(i, width, strides[i], height, subsamp)</code>\n   * bytes in size.\n   *\n   * @param offsets If this <code>YUVImage</code> instance represents a\n   * subregion of a larger image, then <code>offsets[i]</code> specifies the\n   * offset (in bytes) of the subregion within plane <code>i</code> of the\n   * larger image.  Setting this to null is the same as setting the offsets for\n   * all planes to 0.\n   *\n   * @param width width (in pixels) of the new YUV image (or subregion)\n   *\n   * @param strides an array of integers, each specifying the number of bytes\n   * per line in the corresponding plane of the YUV image.  Setting the stride\n   * for any plane to 0 is the same as setting it to the plane width (see\n   * {@link YUVImage above}.)  If <code>strides</code> is null, then the\n   * strides for all planes will be set to their respective plane widths.  You\n   * can adjust the strides in order to add an arbitrary amount of line padding\n   * to each plane or to specify that this <code>YUVImage</code> instance is a\n   * subregion of a larger image (in which case, <code>strides[i]</code> should\n   * be set to the plane width of plane <code>i</code> in the larger image.)\n   *\n   * @param height height (in pixels) of the new YUV image (or subregion)\n   *\n   * @param subsamp the level of chrominance subsampling used in the YUV\n   * image (one of {@link TJ#SAMP_444 TJ.SAMP_*})\n   */\n  public YUVImage(byte[][] planes, int[] offsets, int width, int[] strides,\n                  int height, int subsamp) {\n    setBuf(planes, offsets, width, strides, height, subsamp, false);\n  }\n\n  /**\n   * Create a new <code>YUVImage</code> instance from an existing unified image\n   * buffer.\n   *\n   * @param yuvImage image buffer that contains or will contain YUV planar\n   * image data.  Use {@link TJ#bufSizeYUV} to determine the minimum size for\n   * this buffer.  The Y, U (Cb), and V (Cr) image planes are stored\n   * sequentially in the buffer (see {@link YUVImage above} for a description\n   * of the image format.)\n   *\n   * @param width width (in pixels) of the YUV image\n   *\n   * @param pad the line padding used in the YUV image buffer.  For\n   * instance, if each line in each plane of the buffer is padded to the\n   * nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.\n   *\n   * @param height height (in pixels) of the YUV image\n   *\n   * @param subsamp the level of chrominance subsampling used in the YUV\n   * image (one of {@link TJ#SAMP_444 TJ.SAMP_*})\n   */\n  public YUVImage(byte[] yuvImage, int width, int pad, int height,\n                  int subsamp) {\n    setBuf(yuvImage, width, pad, height, subsamp);\n  }\n\n  /**\n   * Assign a set of image planes to this <code>YUVImage</code> instance.\n   *\n   * @param planes an array of buffers representing the Y, U (Cb), and V (Cr)\n   * image planes (or just the Y plane, if the image is grayscale.)  These\n   * planes can be contiguous or non-contiguous in memory.  Plane\n   * <code>i</code> should be at least <code>offsets[i] +\n   * {@link TJ#planeSizeYUV TJ.planeSizeYUV}(i, width, strides[i], height, subsamp)</code>\n   * bytes in size.\n   *\n   * @param offsets If this <code>YUVImage</code> instance represents a\n   * subregion of a larger image, then <code>offsets[i]</code> specifies the\n   * offset (in bytes) of the subregion within plane <code>i</code> of the\n   * larger image.  Setting this to null is the same as setting the offsets for\n   * all planes to 0.\n   *\n   * @param width width (in pixels) of the YUV image (or subregion)\n   *\n   * @param strides an array of integers, each specifying the number of bytes\n   * per line in the corresponding plane of the YUV image.  Setting the stride\n   * for any plane to 0 is the same as setting it to the plane width (see\n   * {@link YUVImage above}.)  If <code>strides</code> is null, then the\n   * strides for all planes will be set to their respective plane widths.  You\n   * can adjust the strides in order to add an arbitrary amount of line padding\n   * to each plane or to specify that this <code>YUVImage</code> image is a\n   * subregion of a larger image (in which case, <code>strides[i]</code> should\n   * be set to the plane width of plane <code>i</code> in the larger image.)\n   *\n   * @param height height (in pixels) of the YUV image (or subregion)\n   *\n   * @param subsamp the level of chrominance subsampling used in the YUV\n   * image (one of {@link TJ#SAMP_444 TJ.SAMP_*})\n   */\n  public void setBuf(byte[][] planes, int[] offsets, int width, int strides[],\n                     int height, int subsamp) {\n    setBuf(planes, offsets, width, strides, height, subsamp, false);\n  }\n\n  private void setBuf(byte[][] planes, int[] offsets, int width, int strides[],\n                     int height, int subsamp, boolean alloc) {\n    if ((planes == null && !alloc) || width < 1 || height < 1 || subsamp < 0 ||\n        subsamp >= TJ.NUMSAMP)\n      throw new IllegalArgumentException(\"Invalid argument in YUVImage::setBuf()\");\n\n    int nc = (subsamp == TJ.SAMP_GRAY ? 1 : 3);\n    if (planes.length != nc || (offsets != null && offsets.length != nc) ||\n        (strides != null && strides.length != nc))\n      throw new IllegalArgumentException(\"YUVImage::setBuf(): planes, offsets, or strides array is the wrong size\");\n\n    if (offsets == null)\n      offsets = new int[nc];\n    if (strides == null)\n      strides = new int[nc];\n\n    for (int i = 0; i < nc; i++) {\n      int pw = TJ.planeWidth(i, width, subsamp);\n      int ph = TJ.planeHeight(i, height, subsamp);\n      int planeSize = TJ.planeSizeYUV(i, width, strides[i], height, subsamp);\n\n      if (strides[i] == 0)\n        strides[i] = pw;\n      if (alloc) {\n        if (strides[i] < pw)\n          throw new IllegalArgumentException(\"Stride must be >= plane width when allocating a new YUV image\");\n        planes[i] = new byte[strides[i] * ph];\n      }\n      if (planes[i] == null || offsets[i] < 0)\n        throw new IllegalArgumentException(\"Invalid argument in YUVImage::setBuf()\");\n      if (strides[i] < 0 && offsets[i] - planeSize + pw < 0)\n        throw new IllegalArgumentException(\"Stride for plane \" + i + \" would cause memory to be accessed below plane boundary\");\n      if (planes[i].length < offsets[i] + planeSize)\n        throw new IllegalArgumentException(\"Image plane \" + i + \" is not large enough\");\n    }\n\n    yuvPlanes = planes;\n    yuvOffsets = offsets;\n    yuvWidth = width;\n    yuvStrides = strides;\n    yuvHeight = height;\n    yuvSubsamp = subsamp;\n  }\n\n  /**\n   * Assign a unified image buffer to this <code>YUVImage</code> instance.\n   *\n   * @param yuvImage image buffer that contains or will contain YUV planar\n   * image data.  Use {@link TJ#bufSizeYUV} to determine the minimum size for\n   * this buffer.  The Y, U (Cb), and V (Cr) image planes are stored\n   * sequentially in the buffer (see {@link YUVImage above} for a description\n   * of the image format.)\n   *\n   * @param width width (in pixels) of the YUV image\n   *\n   * @param pad the line padding used in the YUV image buffer.  For\n   * instance, if each line in each plane of the buffer is padded to the\n   * nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.\n   *\n   * @param height height (in pixels) of the YUV image\n   *\n   * @param subsamp the level of chrominance subsampling used in the YUV\n   * image (one of {@link TJ#SAMP_444 TJ.SAMP_*})\n   */\n  public void setBuf(byte[] yuvImage, int width, int pad, int height,\n                     int subsamp) {\n    if (yuvImage == null || width < 1 || pad < 1 || ((pad & (pad - 1)) != 0) ||\n        height < 1 || subsamp < 0 || subsamp >= TJ.NUMSAMP)\n      throw new IllegalArgumentException(\"Invalid argument in YUVImage::setBuf()\");\n    if (yuvImage.length < TJ.bufSizeYUV(width, pad, height, subsamp))\n      throw new IllegalArgumentException(\"YUV image buffer is not large enough\");\n\n    int nc = (subsamp == TJ.SAMP_GRAY ? 1 : 3);\n    byte[][] planes = new byte[nc][];\n    int[] strides = new int[nc];\n    int[] offsets = new int[nc];\n\n    planes[0] = yuvImage;\n    strides[0] = PAD(TJ.planeWidth(0, width, subsamp), pad);\n    if (subsamp != TJ.SAMP_GRAY) {\n      strides[1] = strides[2] = PAD(TJ.planeWidth(1, width, subsamp), pad);\n      planes[1] = planes[2] = yuvImage;\n      offsets[1] = offsets[0] +\n        strides[0] * TJ.planeHeight(0, height, subsamp);\n      offsets[2] = offsets[1] +\n        strides[1] * TJ.planeHeight(1, height, subsamp);\n    }\n\n    yuvPad = pad;\n    setBuf(planes, offsets, width, strides, height, subsamp);\n  }\n\n  /**\n   * Returns the width of the YUV image (or subregion.)\n   *\n   * @return the width of the YUV image (or subregion)\n   */\n  public int getWidth() {\n    if (yuvWidth < 1)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    return yuvWidth;\n  }\n\n  /**\n   * Returns the height of the YUV image (or subregion.)\n   *\n   * @return the height of the YUV image (or subregion)\n   */\n  public int getHeight() {\n    if (yuvHeight < 1)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    return yuvHeight;\n  }\n\n  /**\n   * Returns the line padding used in the YUV image buffer (if this image is\n   * stored in a unified buffer rather than separate image planes.)\n   *\n   * @return the line padding used in the YUV image buffer\n   */\n  public int getPad() {\n    if (yuvPlanes == null)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    if (yuvPad < 1 || ((yuvPad & (yuvPad - 1)) != 0))\n      throw new IllegalStateException(\"Image is not stored in a unified buffer\");\n    return yuvPad;\n  }\n\n  /**\n   * Returns the number of bytes per line of each plane in the YUV image.\n   *\n   * @return the number of bytes per line of each plane in the YUV image\n   */\n  public int[] getStrides() {\n    if (yuvStrides == null)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    return yuvStrides;\n  }\n\n  /**\n   * Returns the offsets (in bytes) of each plane within the planes of a larger\n   * YUV image.\n   *\n   * @return the offsets (in bytes) of each plane within the planes of a larger\n   * YUV image\n   */\n  public int[] getOffsets() {\n    if (yuvOffsets == null)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    return yuvOffsets;\n  }\n\n  /**\n   * Returns the level of chrominance subsampling used in the YUV image.  See\n   * {@link TJ#SAMP_444 TJ.SAMP_*}.\n   *\n   * @return the level of chrominance subsampling used in the YUV image\n   */\n  public int getSubsamp() {\n    if (yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    return yuvSubsamp;\n  }\n\n  /**\n   * Returns the YUV image planes.  If the image is stored in a unified buffer,\n   * then all image planes will point to that buffer.\n   *\n   * @return the YUV image planes\n   */\n  public byte[][] getPlanes() {\n    if (yuvPlanes == null)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    return yuvPlanes;\n  }\n\n  /**\n   * Returns the YUV image buffer (if this image is stored in a unified\n   * buffer rather than separate image planes.)\n   *\n   * @return the YUV image buffer\n   */\n  public byte[] getBuf() {\n    if (yuvPlanes == null || yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    int nc = (yuvSubsamp == TJ.SAMP_GRAY ? 1 : 3);\n    for (int i = 1; i < nc; i++) {\n      if (yuvPlanes[i] != yuvPlanes[0])\n        throw new IllegalStateException(\"Image is not stored in a unified buffer\");\n    }\n    return yuvPlanes[0];\n  }\n\n  /**\n   * Returns the size (in bytes) of the YUV image buffer (if this image is\n   * stored in a unified buffer rather than separate image planes.)\n   *\n   * @return the size (in bytes) of the YUV image buffer\n   */\n  public int getSize() {\n    if (yuvPlanes == null || yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP)\n      throw new IllegalStateException(NO_ASSOC_ERROR);\n    int nc = (yuvSubsamp == TJ.SAMP_GRAY ? 1 : 3);\n    if (yuvPad < 1)\n      throw new IllegalStateException(\"Image is not stored in a unified buffer\");\n    for (int i = 1; i < nc; i++) {\n      if (yuvPlanes[i] != yuvPlanes[0])\n        throw new IllegalStateException(\"Image is not stored in a unified buffer\");\n    }\n    return TJ.bufSizeYUV(yuvWidth, yuvPad, yuvHeight, yuvSubsamp);\n  }\n\n  private static final int PAD(int v, int p) {\n    return (v + p - 1) & (~(p - 1));\n  }\n\n  protected long handle = 0;\n  protected byte[][] yuvPlanes = null;\n  protected int[] yuvOffsets = null;\n  protected int[] yuvStrides = null;\n  protected int yuvPad = 0;\n  protected int yuvWidth = 0;\n  protected int yuvHeight = 0;\n  protected int yuvSubsamp = -1;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/org_libjpegturbo_turbojpeg_TJ.h",
    "content": "/* DO NOT EDIT THIS FILE - it is machine generated */\n#include <jni.h>\n/* Header for class org_libjpegturbo_turbojpeg_TJ */\n\n#ifndef _Included_org_libjpegturbo_turbojpeg_TJ\n#define _Included_org_libjpegturbo_turbojpeg_TJ\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#undef org_libjpegturbo_turbojpeg_TJ_NUMSAMP\n#define org_libjpegturbo_turbojpeg_TJ_NUMSAMP 6L\n#undef org_libjpegturbo_turbojpeg_TJ_SAMP_444\n#define org_libjpegturbo_turbojpeg_TJ_SAMP_444 0L\n#undef org_libjpegturbo_turbojpeg_TJ_SAMP_422\n#define org_libjpegturbo_turbojpeg_TJ_SAMP_422 1L\n#undef org_libjpegturbo_turbojpeg_TJ_SAMP_420\n#define org_libjpegturbo_turbojpeg_TJ_SAMP_420 2L\n#undef org_libjpegturbo_turbojpeg_TJ_SAMP_GRAY\n#define org_libjpegturbo_turbojpeg_TJ_SAMP_GRAY 3L\n#undef org_libjpegturbo_turbojpeg_TJ_SAMP_440\n#define org_libjpegturbo_turbojpeg_TJ_SAMP_440 4L\n#undef org_libjpegturbo_turbojpeg_TJ_SAMP_411\n#define org_libjpegturbo_turbojpeg_TJ_SAMP_411 5L\n#undef org_libjpegturbo_turbojpeg_TJ_NUMPF\n#define org_libjpegturbo_turbojpeg_TJ_NUMPF 12L\n#undef org_libjpegturbo_turbojpeg_TJ_PF_RGB\n#define org_libjpegturbo_turbojpeg_TJ_PF_RGB 0L\n#undef org_libjpegturbo_turbojpeg_TJ_PF_BGR\n#define org_libjpegturbo_turbojpeg_TJ_PF_BGR 1L\n#undef org_libjpegturbo_turbojpeg_TJ_PF_RGBX\n#define org_libjpegturbo_turbojpeg_TJ_PF_RGBX 2L\n#undef org_libjpegturbo_turbojpeg_TJ_PF_BGRX\n#define org_libjpegturbo_turbojpeg_TJ_PF_BGRX 3L\n#undef org_libjpegturbo_turbojpeg_TJ_PF_XBGR\n#define org_libjpegturbo_turbojpeg_TJ_PF_XBGR 4L\n#undef org_libjpegturbo_turbojpeg_TJ_PF_XRGB\n#define org_libjpegturbo_turbojpeg_TJ_PF_XRGB 5L\n#undef org_libjpegturbo_turbojpeg_TJ_PF_GRAY\n#define org_libjpegturbo_turbojpeg_TJ_PF_GRAY 6L\n#undef org_libjpegturbo_turbojpeg_TJ_PF_RGBA\n#define org_libjpegturbo_turbojpeg_TJ_PF_RGBA 7L\n#undef org_libjpegturbo_turbojpeg_TJ_PF_BGRA\n#define org_libjpegturbo_turbojpeg_TJ_PF_BGRA 8L\n#undef org_libjpegturbo_turbojpeg_TJ_PF_ABGR\n#define org_libjpegturbo_turbojpeg_TJ_PF_ABGR 9L\n#undef org_libjpegturbo_turbojpeg_TJ_PF_ARGB\n#define org_libjpegturbo_turbojpeg_TJ_PF_ARGB 10L\n#undef org_libjpegturbo_turbojpeg_TJ_PF_CMYK\n#define org_libjpegturbo_turbojpeg_TJ_PF_CMYK 11L\n#undef org_libjpegturbo_turbojpeg_TJ_NUMCS\n#define org_libjpegturbo_turbojpeg_TJ_NUMCS 5L\n#undef org_libjpegturbo_turbojpeg_TJ_CS_RGB\n#define org_libjpegturbo_turbojpeg_TJ_CS_RGB 0L\n#undef org_libjpegturbo_turbojpeg_TJ_CS_YCbCr\n#define org_libjpegturbo_turbojpeg_TJ_CS_YCbCr 1L\n#undef org_libjpegturbo_turbojpeg_TJ_CS_GRAY\n#define org_libjpegturbo_turbojpeg_TJ_CS_GRAY 2L\n#undef org_libjpegturbo_turbojpeg_TJ_CS_CMYK\n#define org_libjpegturbo_turbojpeg_TJ_CS_CMYK 3L\n#undef org_libjpegturbo_turbojpeg_TJ_CS_YCCK\n#define org_libjpegturbo_turbojpeg_TJ_CS_YCCK 4L\n#undef org_libjpegturbo_turbojpeg_TJ_FLAG_BOTTOMUP\n#define org_libjpegturbo_turbojpeg_TJ_FLAG_BOTTOMUP 2L\n#undef org_libjpegturbo_turbojpeg_TJ_FLAG_FASTUPSAMPLE\n#define org_libjpegturbo_turbojpeg_TJ_FLAG_FASTUPSAMPLE 256L\n#undef org_libjpegturbo_turbojpeg_TJ_FLAG_FASTDCT\n#define org_libjpegturbo_turbojpeg_TJ_FLAG_FASTDCT 2048L\n#undef org_libjpegturbo_turbojpeg_TJ_FLAG_ACCURATEDCT\n#define org_libjpegturbo_turbojpeg_TJ_FLAG_ACCURATEDCT 4096L\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJ\n * Method:    bufSize\n * Signature: (III)I\n */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSize\n  (JNIEnv *, jclass, jint, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJ\n * Method:    bufSizeYUV\n * Signature: (IIII)I\n */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__IIII\n  (JNIEnv *, jclass, jint, jint, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJ\n * Method:    bufSizeYUV\n * Signature: (III)I\n */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__III\n  (JNIEnv *, jclass, jint, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJ\n * Method:    planeSizeYUV\n * Signature: (IIIII)I\n */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeSizeYUV__IIIII\n  (JNIEnv *, jclass, jint, jint, jint, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJ\n * Method:    planeWidth\n * Signature: (III)I\n */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeWidth__III\n  (JNIEnv *, jclass, jint, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJ\n * Method:    planeHeight\n * Signature: (III)I\n */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeHeight__III\n  (JNIEnv *, jclass, jint, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJ\n * Method:    getScalingFactors\n * Signature: ()[Lorg/libjpegturbo/turbojpeg/TJScalingFactor;\n */\nJNIEXPORT jobjectArray JNICALL Java_org_libjpegturbo_turbojpeg_TJ_getScalingFactors\n  (JNIEnv *, jclass);\n\n#ifdef __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/org_libjpegturbo_turbojpeg_TJCompressor.h",
    "content": "/* DO NOT EDIT THIS FILE - it is machine generated */\n#include <jni.h>\n/* Header for class org_libjpegturbo_turbojpeg_TJCompressor */\n\n#ifndef _Included_org_libjpegturbo_turbojpeg_TJCompressor\n#define _Included_org_libjpegturbo_turbojpeg_TJCompressor\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJCompressor\n * Method:    init\n * Signature: ()V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_init\n  (JNIEnv *, jobject);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJCompressor\n * Method:    destroy\n * Signature: ()V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_destroy\n  (JNIEnv *, jobject);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJCompressor\n * Method:    compress\n * Signature: ([BIIII[BIII)I\n */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIII_3BIII\n  (JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jbyteArray, jint, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJCompressor\n * Method:    compress\n * Signature: ([BIIIIII[BIII)I\n */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIIIII_3BIII\n  (JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jint, jint, jbyteArray, jint, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJCompressor\n * Method:    compress\n * Signature: ([IIIII[BIII)I\n */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIII_3BIII\n  (JNIEnv *, jobject, jintArray, jint, jint, jint, jint, jbyteArray, jint, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJCompressor\n * Method:    compress\n * Signature: ([IIIIIII[BIII)I\n */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIIIII_3BIII\n  (JNIEnv *, jobject, jintArray, jint, jint, jint, jint, jint, jint, jbyteArray, jint, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJCompressor\n * Method:    compressFromYUV\n * Signature: ([[B[II[III[BII)I\n */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII\n  (JNIEnv *, jobject, jobjectArray, jintArray, jint, jintArray, jint, jint, jbyteArray, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJCompressor\n * Method:    encodeYUV\n * Signature: ([BIIII[BII)V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIII_3BII\n  (JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jbyteArray, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJCompressor\n * Method:    encodeYUV\n * Signature: ([BIIIIII[[B[I[III)V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIIIII_3_3B_3I_3III\n  (JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jint, jint, jobjectArray, jintArray, jintArray, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJCompressor\n * Method:    encodeYUV\n * Signature: ([IIIII[BII)V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIII_3BII\n  (JNIEnv *, jobject, jintArray, jint, jint, jint, jint, jbyteArray, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJCompressor\n * Method:    encodeYUV\n * Signature: ([IIIIIII[[B[I[III)V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3_3B_3I_3III\n  (JNIEnv *, jobject, jintArray, jint, jint, jint, jint, jint, jint, jobjectArray, jintArray, jintArray, jint, jint);\n\n#ifdef __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/org_libjpegturbo_turbojpeg_TJDecompressor.h",
    "content": "/* DO NOT EDIT THIS FILE - it is machine generated */\n#include <jni.h>\n/* Header for class org_libjpegturbo_turbojpeg_TJDecompressor */\n\n#ifndef _Included_org_libjpegturbo_turbojpeg_TJDecompressor\n#define _Included_org_libjpegturbo_turbojpeg_TJDecompressor\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJDecompressor\n * Method:    init\n * Signature: ()V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_init\n  (JNIEnv *, jobject);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJDecompressor\n * Method:    destroy\n * Signature: ()V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_destroy\n  (JNIEnv *, jobject);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJDecompressor\n * Method:    decompressHeader\n * Signature: ([BI)V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader\n  (JNIEnv *, jobject, jbyteArray, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJDecompressor\n * Method:    decompress\n * Signature: ([BI[BIIIII)V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIII\n  (JNIEnv *, jobject, jbyteArray, jint, jbyteArray, jint, jint, jint, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJDecompressor\n * Method:    decompress\n * Signature: ([BI[BIIIIIII)V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIIIII\n  (JNIEnv *, jobject, jbyteArray, jint, jbyteArray, jint, jint, jint, jint, jint, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJDecompressor\n * Method:    decompress\n * Signature: ([BI[IIIIII)V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIII\n  (JNIEnv *, jobject, jbyteArray, jint, jintArray, jint, jint, jint, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJDecompressor\n * Method:    decompress\n * Signature: ([BI[IIIIIIII)V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIIIII\n  (JNIEnv *, jobject, jbyteArray, jint, jintArray, jint, jint, jint, jint, jint, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJDecompressor\n * Method:    decompressToYUV\n * Signature: ([BI[BI)V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI\n  (JNIEnv *, jobject, jbyteArray, jint, jbyteArray, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJDecompressor\n * Method:    decompressToYUV\n * Signature: ([BI[[B[II[III)V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III\n  (JNIEnv *, jobject, jbyteArray, jint, jobjectArray, jintArray, jint, jintArray, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJDecompressor\n * Method:    decodeYUV\n * Signature: ([[B[I[II[BIIIIIII)V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3BIIIIIII\n  (JNIEnv *, jobject, jobjectArray, jintArray, jintArray, jint, jbyteArray, jint, jint, jint, jint, jint, jint, jint);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJDecompressor\n * Method:    decodeYUV\n * Signature: ([[B[I[II[IIIIIIII)V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3IIIIIIII\n  (JNIEnv *, jobject, jobjectArray, jintArray, jintArray, jint, jintArray, jint, jint, jint, jint, jint, jint, jint);\n\n#ifdef __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/java/org_libjpegturbo_turbojpeg_TJTransformer.h",
    "content": "/* DO NOT EDIT THIS FILE - it is machine generated */\n#include <jni.h>\n/* Header for class org_libjpegturbo_turbojpeg_TJTransformer */\n\n#ifndef _Included_org_libjpegturbo_turbojpeg_TJTransformer\n#define _Included_org_libjpegturbo_turbojpeg_TJTransformer\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJTransformer\n * Method:    init\n * Signature: ()V\n */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_init\n  (JNIEnv *, jobject);\n\n/*\n * Class:     org_libjpegturbo_turbojpeg_TJTransformer\n * Method:    transform\n * Signature: ([BI[[B[Lorg/libjpegturbo/turbojpeg/TJTransform;I)[I\n */\nJNIEXPORT jintArray JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_transform\n  (JNIEnv *, jobject, jbyteArray, jint, jobjectArray, jobjectArray, jint);\n\n#ifdef __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jcapimin.c",
    "content": "/*\n * jcapimin.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * Modified 2003-2010 by Guido Vollbeding.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains application interface code for the compression half\n * of the JPEG library.  These are the \"minimum\" API routines that may be\n * needed in either the normal full-compression case or the transcoding-only\n * case.\n *\n * Most of the routines intended to be called directly by an application\n * are in this file or in jcapistd.c.  But also see jcparam.c for\n * parameter-setup helper routines, jcomapi.c for routines shared by\n * compression and decompression, and jctrans.c for the transcoding case.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Initialization of a JPEG compression object.\n * The error manager must already be set up (in case memory manager fails).\n */\n\nGLOBAL(void)\njpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)\n{\n  int i;\n\n  /* Guard against version mismatches between library and caller. */\n  cinfo->mem = NULL;            /* so jpeg_destroy knows mem mgr not called */\n  if (version != JPEG_LIB_VERSION)\n    ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);\n  if (structsize != sizeof(struct jpeg_compress_struct))\n    ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,\n             (int) sizeof(struct jpeg_compress_struct), (int) structsize);\n\n  /* For debugging purposes, we zero the whole master structure.\n   * But the application has already set the err pointer, and may have set\n   * client_data, so we have to save and restore those fields.\n   * Note: if application hasn't set client_data, tools like Purify may\n   * complain here.\n   */\n  {\n    struct jpeg_error_mgr *err = cinfo->err;\n    void *client_data = cinfo->client_data; /* ignore Purify complaint here */\n    MEMZERO(cinfo, sizeof(struct jpeg_compress_struct));\n    cinfo->err = err;\n    cinfo->client_data = client_data;\n  }\n  cinfo->is_decompressor = FALSE;\n\n  /* Initialize a memory manager instance for this object */\n  jinit_memory_mgr((j_common_ptr) cinfo);\n\n  /* Zero out pointers to permanent structures. */\n  cinfo->progress = NULL;\n  cinfo->dest = NULL;\n\n  cinfo->comp_info = NULL;\n\n  for (i = 0; i < NUM_QUANT_TBLS; i++) {\n    cinfo->quant_tbl_ptrs[i] = NULL;\n#if JPEG_LIB_VERSION >= 70\n    cinfo->q_scale_factor[i] = 100;\n#endif\n  }\n\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    cinfo->dc_huff_tbl_ptrs[i] = NULL;\n    cinfo->ac_huff_tbl_ptrs[i] = NULL;\n  }\n\n#if JPEG_LIB_VERSION >= 80\n  /* Must do it here for emit_dqt in case jpeg_write_tables is used */\n  cinfo->block_size = DCTSIZE;\n  cinfo->natural_order = jpeg_natural_order;\n  cinfo->lim_Se = DCTSIZE2-1;\n#endif\n\n  cinfo->script_space = NULL;\n\n  cinfo->input_gamma = 1.0;     /* in case application forgets */\n\n  /* OK, I'm ready */\n  cinfo->global_state = CSTATE_START;\n}\n\n\n/*\n * Destruction of a JPEG compression object\n */\n\nGLOBAL(void)\njpeg_destroy_compress (j_compress_ptr cinfo)\n{\n  jpeg_destroy((j_common_ptr) cinfo); /* use common routine */\n}\n\n\n/*\n * Abort processing of a JPEG compression operation,\n * but don't destroy the object itself.\n */\n\nGLOBAL(void)\njpeg_abort_compress (j_compress_ptr cinfo)\n{\n  jpeg_abort((j_common_ptr) cinfo); /* use common routine */\n}\n\n\n/*\n * Forcibly suppress or un-suppress all quantization and Huffman tables.\n * Marks all currently defined tables as already written (if suppress)\n * or not written (if !suppress).  This will control whether they get emitted\n * by a subsequent jpeg_start_compress call.\n *\n * This routine is exported for use by applications that want to produce\n * abbreviated JPEG datastreams.  It logically belongs in jcparam.c, but\n * since it is called by jpeg_start_compress, we put it here --- otherwise\n * jcparam.o would be linked whether the application used it or not.\n */\n\nGLOBAL(void)\njpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress)\n{\n  int i;\n  JQUANT_TBL *qtbl;\n  JHUFF_TBL *htbl;\n\n  for (i = 0; i < NUM_QUANT_TBLS; i++) {\n    if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL)\n      qtbl->sent_table = suppress;\n  }\n\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL)\n      htbl->sent_table = suppress;\n    if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL)\n      htbl->sent_table = suppress;\n  }\n}\n\n\n/*\n * Finish JPEG compression.\n *\n * If a multipass operating mode was selected, this may do a great deal of\n * work including most of the actual output.\n */\n\nGLOBAL(void)\njpeg_finish_compress (j_compress_ptr cinfo)\n{\n  JDIMENSION iMCU_row;\n\n  if (cinfo->global_state == CSTATE_SCANNING ||\n      cinfo->global_state == CSTATE_RAW_OK) {\n    /* Terminate first pass */\n    if (cinfo->next_scanline < cinfo->image_height)\n      ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);\n    (*cinfo->master->finish_pass) (cinfo);\n  } else if (cinfo->global_state != CSTATE_WRCOEFS)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  /* Perform any remaining passes */\n  while (! cinfo->master->is_last_pass) {\n    (*cinfo->master->prepare_for_pass) (cinfo);\n    for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {\n      if (cinfo->progress != NULL) {\n        cinfo->progress->pass_counter = (long) iMCU_row;\n        cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;\n        (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n      }\n      /* We bypass the main controller and invoke coef controller directly;\n       * all work is being done from the coefficient buffer.\n       */\n      if (! (*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE) NULL))\n        ERREXIT(cinfo, JERR_CANT_SUSPEND);\n    }\n    (*cinfo->master->finish_pass) (cinfo);\n  }\n  /* Write EOI, do final cleanup */\n  (*cinfo->marker->write_file_trailer) (cinfo);\n  (*cinfo->dest->term_destination) (cinfo);\n  /* We can use jpeg_abort to release memory and reset global_state */\n  jpeg_abort((j_common_ptr) cinfo);\n}\n\n\n/*\n * Write a special marker.\n * This is only recommended for writing COM or APPn markers.\n * Must be called after jpeg_start_compress() and before\n * first call to jpeg_write_scanlines() or jpeg_write_raw_data().\n */\n\nGLOBAL(void)\njpeg_write_marker (j_compress_ptr cinfo, int marker,\n                   const JOCTET *dataptr, unsigned int datalen)\n{\n  void (*write_marker_byte) (j_compress_ptr info, int val);\n\n  if (cinfo->next_scanline != 0 ||\n      (cinfo->global_state != CSTATE_SCANNING &&\n       cinfo->global_state != CSTATE_RAW_OK &&\n       cinfo->global_state != CSTATE_WRCOEFS))\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);\n  write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */\n  while (datalen--) {\n    (*write_marker_byte) (cinfo, *dataptr);\n    dataptr++;\n  }\n}\n\n/* Same, but piecemeal. */\n\nGLOBAL(void)\njpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen)\n{\n  if (cinfo->next_scanline != 0 ||\n      (cinfo->global_state != CSTATE_SCANNING &&\n       cinfo->global_state != CSTATE_RAW_OK &&\n       cinfo->global_state != CSTATE_WRCOEFS))\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);\n}\n\nGLOBAL(void)\njpeg_write_m_byte (j_compress_ptr cinfo, int val)\n{\n  (*cinfo->marker->write_marker_byte) (cinfo, val);\n}\n\n\n/*\n * Alternate compression function: just write an abbreviated table file.\n * Before calling this, all parameters and a data destination must be set up.\n *\n * To produce a pair of files containing abbreviated tables and abbreviated\n * image data, one would proceed as follows:\n *\n *              initialize JPEG object\n *              set JPEG parameters\n *              set destination to table file\n *              jpeg_write_tables(cinfo);\n *              set destination to image file\n *              jpeg_start_compress(cinfo, FALSE);\n *              write data...\n *              jpeg_finish_compress(cinfo);\n *\n * jpeg_write_tables has the side effect of marking all tables written\n * (same as jpeg_suppress_tables(..., TRUE)).  Thus a subsequent start_compress\n * will not re-emit the tables unless it is passed write_all_tables=TRUE.\n */\n\nGLOBAL(void)\njpeg_write_tables (j_compress_ptr cinfo)\n{\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* (Re)initialize error mgr and destination modules */\n  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);\n  (*cinfo->dest->init_destination) (cinfo);\n  /* Initialize the marker writer ... bit of a crock to do it here. */\n  jinit_marker_writer(cinfo);\n  /* Write them tables! */\n  (*cinfo->marker->write_tables_only) (cinfo);\n  /* And clean up. */\n  (*cinfo->dest->term_destination) (cinfo);\n  /*\n   * In library releases up through v6a, we called jpeg_abort() here to free\n   * any working memory allocated by the destination manager and marker\n   * writer.  Some applications had a problem with that: they allocated space\n   * of their own from the library memory manager, and didn't want it to go\n   * away during write_tables.  So now we do nothing.  This will cause a\n   * memory leak if an app calls write_tables repeatedly without doing a full\n   * compression cycle or otherwise resetting the JPEG object.  However, that\n   * seems less bad than unexpectedly freeing memory in the normal case.\n   * An app that prefers the old behavior can call jpeg_abort for itself after\n   * each call to jpeg_write_tables().\n   */\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jcapistd.c",
    "content": "/*\n * jcapistd.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains application interface code for the compression half\n * of the JPEG library.  These are the \"standard\" API routines that are\n * used in the normal full-compression case.  They are not used by a\n * transcoding-only application.  Note that if an application links in\n * jpeg_start_compress, it will end up linking in the entire compressor.\n * We thus must separate this file from jcapimin.c to avoid linking the\n * whole compression library into a transcoder.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Compression initialization.\n * Before calling this, all parameters and a data destination must be set up.\n *\n * We require a write_all_tables parameter as a failsafe check when writing\n * multiple datastreams from the same compression object.  Since prior runs\n * will have left all the tables marked sent_table=TRUE, a subsequent run\n * would emit an abbreviated stream (no tables) by default.  This may be what\n * is wanted, but for safety's sake it should not be the default behavior:\n * programmers should have to make a deliberate choice to emit abbreviated\n * images.  Therefore the documentation and examples should encourage people\n * to pass write_all_tables=TRUE; then it will take active thought to do the\n * wrong thing.\n */\n\nGLOBAL(void)\njpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables)\n{\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  if (write_all_tables)\n    jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */\n\n  /* (Re)initialize error mgr and destination modules */\n  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);\n  (*cinfo->dest->init_destination) (cinfo);\n  /* Perform master selection of active modules */\n  jinit_compress_master(cinfo);\n  /* Set up for the first pass */\n  (*cinfo->master->prepare_for_pass) (cinfo);\n  /* Ready for application to drive first pass through jpeg_write_scanlines\n   * or jpeg_write_raw_data.\n   */\n  cinfo->next_scanline = 0;\n  cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING);\n}\n\n\n/*\n * Write some scanlines of data to the JPEG compressor.\n *\n * The return value will be the number of lines actually written.\n * This should be less than the supplied num_lines only in case that\n * the data destination module has requested suspension of the compressor,\n * or if more than image_height scanlines are passed in.\n *\n * Note: we warn about excess calls to jpeg_write_scanlines() since\n * this likely signals an application programmer error.  However,\n * excess scanlines passed in the last valid call are *silently* ignored,\n * so that the application need not adjust num_lines for end-of-image\n * when using a multiple-scanline buffer.\n */\n\nGLOBAL(JDIMENSION)\njpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines,\n                      JDIMENSION num_lines)\n{\n  JDIMENSION row_ctr, rows_left;\n\n  if (cinfo->global_state != CSTATE_SCANNING)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  if (cinfo->next_scanline >= cinfo->image_height)\n    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);\n\n  /* Call progress monitor hook if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->pass_counter = (long) cinfo->next_scanline;\n    cinfo->progress->pass_limit = (long) cinfo->image_height;\n    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n  }\n\n  /* Give master control module another chance if this is first call to\n   * jpeg_write_scanlines.  This lets output of the frame/scan headers be\n   * delayed so that application can write COM, etc, markers between\n   * jpeg_start_compress and jpeg_write_scanlines.\n   */\n  if (cinfo->master->call_pass_startup)\n    (*cinfo->master->pass_startup) (cinfo);\n\n  /* Ignore any extra scanlines at bottom of image. */\n  rows_left = cinfo->image_height - cinfo->next_scanline;\n  if (num_lines > rows_left)\n    num_lines = rows_left;\n\n  row_ctr = 0;\n  (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines);\n  cinfo->next_scanline += row_ctr;\n  return row_ctr;\n}\n\n\n/*\n * Alternate entry point to write raw data.\n * Processes exactly one iMCU row per call, unless suspended.\n */\n\nGLOBAL(JDIMENSION)\njpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data,\n                     JDIMENSION num_lines)\n{\n  JDIMENSION lines_per_iMCU_row;\n\n  if (cinfo->global_state != CSTATE_RAW_OK)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  if (cinfo->next_scanline >= cinfo->image_height) {\n    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);\n    return 0;\n  }\n\n  /* Call progress monitor hook if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->pass_counter = (long) cinfo->next_scanline;\n    cinfo->progress->pass_limit = (long) cinfo->image_height;\n    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n  }\n\n  /* Give master control module another chance if this is first call to\n   * jpeg_write_raw_data.  This lets output of the frame/scan headers be\n   * delayed so that application can write COM, etc, markers between\n   * jpeg_start_compress and jpeg_write_raw_data.\n   */\n  if (cinfo->master->call_pass_startup)\n    (*cinfo->master->pass_startup) (cinfo);\n\n  /* Verify that at least one iMCU row has been passed. */\n  lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE;\n  if (num_lines < lines_per_iMCU_row)\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n\n  /* Directly compress the row. */\n  if (! (*cinfo->coef->compress_data) (cinfo, data)) {\n    /* If compressor did not consume the whole row, suspend processing. */\n    return 0;\n  }\n\n  /* OK, we processed one iMCU row. */\n  cinfo->next_scanline += lines_per_iMCU_row;\n  return lines_per_iMCU_row;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jcarith.c",
    "content": "/*\n * jcarith.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Developed 1997-2009 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains portable arithmetic entropy encoding routines for JPEG\n * (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81).\n *\n * Both sequential and progressive modes are supported in this single module.\n *\n * Suspension is not currently supported in this module.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Expanded entropy encoder object for arithmetic encoding. */\n\ntypedef struct {\n  struct jpeg_entropy_encoder pub; /* public fields */\n\n  JLONG c; /* C register, base of coding interval, layout as in sec. D.1.3 */\n  JLONG a;               /* A register, normalized size of coding interval */\n  JLONG sc;        /* counter for stacked 0xFF values which might overflow */\n  JLONG zc;          /* counter for pending 0x00 output values which might *\n                          * be discarded at the end (\"Pacman\" termination) */\n  int ct;  /* bit shift counter, determines when next byte will be written */\n  int buffer;                /* buffer for most recent output byte != 0xFF */\n\n  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */\n  int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */\n\n  unsigned int restarts_to_go;  /* MCUs left in this restart interval */\n  int next_restart_num;         /* next restart number to write (0-7) */\n\n  /* Pointers to statistics areas (these workspaces have image lifespan) */\n  unsigned char *dc_stats[NUM_ARITH_TBLS];\n  unsigned char *ac_stats[NUM_ARITH_TBLS];\n\n  /* Statistics bin for coding with fixed probability 0.5 */\n  unsigned char fixed_bin[4];\n} arith_entropy_encoder;\n\ntypedef arith_entropy_encoder *arith_entropy_ptr;\n\n/* The following two definitions specify the allocation chunk size\n * for the statistics area.\n * According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least\n * 49 statistics bins for DC, and 245 statistics bins for AC coding.\n *\n * We use a compact representation with 1 byte per statistics bin,\n * thus the numbers directly represent byte sizes.\n * This 1 byte per statistics bin contains the meaning of the MPS\n * (more probable symbol) in the highest bit (mask 0x80), and the\n * index into the probability estimation state machine table\n * in the lower bits (mask 0x7F).\n */\n\n#define DC_STAT_BINS 64\n#define AC_STAT_BINS 256\n\n/* NOTE: Uncomment the following #define if you want to use the\n * given formula for calculating the AC conditioning parameter Kx\n * for spectral selection progressive coding in section G.1.3.2\n * of the spec (Kx = Kmin + SRL (8 + Se - Kmin) 4).\n * Although the spec and P&M authors claim that this \"has proven\n * to give good results for 8 bit precision samples\", I'm not\n * convinced yet that this is really beneficial.\n * Early tests gave only very marginal compression enhancements\n * (a few - around 5 or so - bytes even for very large files),\n * which would turn out rather negative if we'd suppress the\n * DAC (Define Arithmetic Conditioning) marker segments for\n * the default parameters in the future.\n * Note that currently the marker writing module emits 12-byte\n * DAC segments for a full-component scan in a color image.\n * This is not worth worrying about IMHO. However, since the\n * spec defines the default values to be used if the tables\n * are omitted (unlike Huffman tables, which are required\n * anyway), one might optimize this behaviour in the future,\n * and then it would be disadvantageous to use custom tables if\n * they don't provide sufficient gain to exceed the DAC size.\n *\n * On the other hand, I'd consider it as a reasonable result\n * that the conditioning has no significant influence on the\n * compression performance. This means that the basic\n * statistical model is already rather stable.\n *\n * Thus, at the moment, we use the default conditioning values\n * anyway, and do not use the custom formula.\n *\n#define CALCULATE_SPECTRAL_CONDITIONING\n */\n\n/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than JLONG.\n * We assume that int right shift is unsigned if JLONG right shift is,\n * which should be safe.\n */\n\n#ifdef RIGHT_SHIFT_IS_UNSIGNED\n#define ISHIFT_TEMPS    int ishift_temp;\n#define IRIGHT_SHIFT(x,shft)  \\\n        ((ishift_temp = (x)) < 0 ? \\\n         (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \\\n         (ishift_temp >> (shft)))\n#else\n#define ISHIFT_TEMPS\n#define IRIGHT_SHIFT(x,shft)    ((x) >> (shft))\n#endif\n\n\nLOCAL(void)\nemit_byte (int val, j_compress_ptr cinfo)\n/* Write next output byte; we do not support suspension in this module. */\n{\n  struct jpeg_destination_mgr *dest = cinfo->dest;\n\n  *dest->next_output_byte++ = (JOCTET) val;\n  if (--dest->free_in_buffer == 0)\n    if (! (*dest->empty_output_buffer) (cinfo))\n      ERREXIT(cinfo, JERR_CANT_SUSPEND);\n}\n\n\n/*\n * Finish up at the end of an arithmetic-compressed scan.\n */\n\nMETHODDEF(void)\nfinish_pass (j_compress_ptr cinfo)\n{\n  arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;\n  JLONG temp;\n\n  /* Section D.1.8: Termination of encoding */\n\n  /* Find the e->c in the coding interval with the largest\n   * number of trailing zero bits */\n  if ((temp = (e->a - 1 + e->c) & 0xFFFF0000L) < e->c)\n    e->c = temp + 0x8000L;\n  else\n    e->c = temp;\n  /* Send remaining bytes to output */\n  e->c <<= e->ct;\n  if (e->c & 0xF8000000L) {\n    /* One final overflow has to be handled */\n    if (e->buffer >= 0) {\n      if (e->zc)\n        do emit_byte(0x00, cinfo);\n        while (--e->zc);\n      emit_byte(e->buffer + 1, cinfo);\n      if (e->buffer + 1 == 0xFF)\n        emit_byte(0x00, cinfo);\n    }\n    e->zc += e->sc;  /* carry-over converts stacked 0xFF bytes to 0x00 */\n    e->sc = 0;\n  } else {\n    if (e->buffer == 0)\n      ++e->zc;\n    else if (e->buffer >= 0) {\n      if (e->zc)\n        do emit_byte(0x00, cinfo);\n        while (--e->zc);\n      emit_byte(e->buffer, cinfo);\n    }\n    if (e->sc) {\n      if (e->zc)\n        do emit_byte(0x00, cinfo);\n        while (--e->zc);\n      do {\n        emit_byte(0xFF, cinfo);\n        emit_byte(0x00, cinfo);\n      } while (--e->sc);\n    }\n  }\n  /* Output final bytes only if they are not 0x00 */\n  if (e->c & 0x7FFF800L) {\n    if (e->zc)  /* output final pending zero bytes */\n      do emit_byte(0x00, cinfo);\n      while (--e->zc);\n    emit_byte((e->c >> 19) & 0xFF, cinfo);\n    if (((e->c >> 19) & 0xFF) == 0xFF)\n      emit_byte(0x00, cinfo);\n    if (e->c & 0x7F800L) {\n      emit_byte((e->c >> 11) & 0xFF, cinfo);\n      if (((e->c >> 11) & 0xFF) == 0xFF)\n        emit_byte(0x00, cinfo);\n    }\n  }\n}\n\n\n/*\n * The core arithmetic encoding routine (common in JPEG and JBIG).\n * This needs to go as fast as possible.\n * Machine-dependent optimization facilities\n * are not utilized in this portable implementation.\n * However, this code should be fairly efficient and\n * may be a good base for further optimizations anyway.\n *\n * Parameter 'val' to be encoded may be 0 or 1 (binary decision).\n *\n * Note: I've added full \"Pacman\" termination support to the\n * byte output routines, which is equivalent to the optional\n * Discard_final_zeros procedure (Figure D.15) in the spec.\n * Thus, we always produce the shortest possible output\n * stream compliant to the spec (no trailing zero bytes,\n * except for FF stuffing).\n *\n * I've also introduced a new scheme for accessing\n * the probability estimation state machine table,\n * derived from Markus Kuhn's JBIG implementation.\n */\n\nLOCAL(void)\narith_encode (j_compress_ptr cinfo, unsigned char *st, int val)\n{\n  register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;\n  register unsigned char nl, nm;\n  register JLONG qe, temp;\n  register int sv;\n\n  /* Fetch values from our compact representation of Table D.2:\n   * Qe values and probability estimation state machine\n   */\n  sv = *st;\n  qe = jpeg_aritab[sv & 0x7F];  /* => Qe_Value */\n  nl = qe & 0xFF; qe >>= 8;     /* Next_Index_LPS + Switch_MPS */\n  nm = qe & 0xFF; qe >>= 8;     /* Next_Index_MPS */\n\n  /* Encode & estimation procedures per sections D.1.4 & D.1.5 */\n  e->a -= qe;\n  if (val != (sv >> 7)) {\n    /* Encode the less probable symbol */\n    if (e->a >= qe) {\n      /* If the interval size (qe) for the less probable symbol (LPS)\n       * is larger than the interval size for the MPS, then exchange\n       * the two symbols for coding efficiency, otherwise code the LPS\n       * as usual: */\n      e->c += e->a;\n      e->a = qe;\n    }\n    *st = (sv & 0x80) ^ nl;     /* Estimate_after_LPS */\n  } else {\n    /* Encode the more probable symbol */\n    if (e->a >= 0x8000L)\n      return;  /* A >= 0x8000 -> ready, no renormalization required */\n    if (e->a < qe) {\n      /* If the interval size (qe) for the less probable symbol (LPS)\n       * is larger than the interval size for the MPS, then exchange\n       * the two symbols for coding efficiency: */\n      e->c += e->a;\n      e->a = qe;\n    }\n    *st = (sv & 0x80) ^ nm;     /* Estimate_after_MPS */\n  }\n\n  /* Renormalization & data output per section D.1.6 */\n  do {\n    e->a <<= 1;\n    e->c <<= 1;\n    if (--e->ct == 0) {\n      /* Another byte is ready for output */\n      temp = e->c >> 19;\n      if (temp > 0xFF) {\n        /* Handle overflow over all stacked 0xFF bytes */\n        if (e->buffer >= 0) {\n          if (e->zc)\n            do emit_byte(0x00, cinfo);\n            while (--e->zc);\n          emit_byte(e->buffer + 1, cinfo);\n          if (e->buffer + 1 == 0xFF)\n            emit_byte(0x00, cinfo);\n        }\n        e->zc += e->sc;  /* carry-over converts stacked 0xFF bytes to 0x00 */\n        e->sc = 0;\n        /* Note: The 3 spacer bits in the C register guarantee\n         * that the new buffer byte can't be 0xFF here\n         * (see page 160 in the P&M JPEG book). */\n        e->buffer = temp & 0xFF;  /* new output byte, might overflow later */\n      } else if (temp == 0xFF) {\n        ++e->sc;  /* stack 0xFF byte (which might overflow later) */\n      } else {\n        /* Output all stacked 0xFF bytes, they will not overflow any more */\n        if (e->buffer == 0)\n          ++e->zc;\n        else if (e->buffer >= 0) {\n          if (e->zc)\n            do emit_byte(0x00, cinfo);\n            while (--e->zc);\n          emit_byte(e->buffer, cinfo);\n        }\n        if (e->sc) {\n          if (e->zc)\n            do emit_byte(0x00, cinfo);\n            while (--e->zc);\n          do {\n            emit_byte(0xFF, cinfo);\n            emit_byte(0x00, cinfo);\n          } while (--e->sc);\n        }\n        e->buffer = temp & 0xFF;  /* new output byte (can still overflow) */\n      }\n      e->c &= 0x7FFFFL;\n      e->ct += 8;\n    }\n  } while (e->a < 0x8000L);\n}\n\n\n/*\n * Emit a restart marker & resynchronize predictions.\n */\n\nLOCAL(void)\nemit_restart (j_compress_ptr cinfo, int restart_num)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  int ci;\n  jpeg_component_info *compptr;\n\n  finish_pass(cinfo);\n\n  emit_byte(0xFF, cinfo);\n  emit_byte(JPEG_RST0 + restart_num, cinfo);\n\n  /* Re-initialize statistics areas */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    /* DC needs no table for refinement scan */\n    if (cinfo->progressive_mode == 0 || (cinfo->Ss == 0 && cinfo->Ah == 0)) {\n      MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);\n      /* Reset DC predictions to 0 */\n      entropy->last_dc_val[ci] = 0;\n      entropy->dc_context[ci] = 0;\n    }\n    /* AC needs no table when not present */\n    if (cinfo->progressive_mode == 0 || cinfo->Se) {\n      MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);\n    }\n  }\n\n  /* Reset arithmetic encoding variables */\n  entropy->c = 0;\n  entropy->a = 0x10000L;\n  entropy->sc = 0;\n  entropy->zc = 0;\n  entropy->ct = 11;\n  entropy->buffer = -1;  /* empty */\n}\n\n\n/*\n * MCU encoding for DC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\nencode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  JBLOCKROW block;\n  unsigned char *st;\n  int blkn, ci, tbl;\n  int v, v2, m;\n  ISHIFT_TEMPS\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      emit_restart(cinfo, entropy->next_restart_num);\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n    ci = cinfo->MCU_membership[blkn];\n    tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;\n\n    /* Compute the DC value after the required point transform by Al.\n     * This is simply an arithmetic right shift.\n     */\n    m = IRIGHT_SHIFT((int) ((*block)[0]), cinfo->Al);\n\n    /* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */\n\n    /* Table F.4: Point to statistics bin S0 for DC coefficient coding */\n    st = entropy->dc_stats[tbl] + entropy->dc_context[ci];\n\n    /* Figure F.4: Encode_DC_DIFF */\n    if ((v = m - entropy->last_dc_val[ci]) == 0) {\n      arith_encode(cinfo, st, 0);\n      entropy->dc_context[ci] = 0;      /* zero diff category */\n    } else {\n      entropy->last_dc_val[ci] = m;\n      arith_encode(cinfo, st, 1);\n      /* Figure F.6: Encoding nonzero value v */\n      /* Figure F.7: Encoding the sign of v */\n      if (v > 0) {\n        arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */\n        st += 2;                        /* Table F.4: SP = S0 + 2 */\n        entropy->dc_context[ci] = 4;    /* small positive diff category */\n      } else {\n        v = -v;\n        arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */\n        st += 3;                        /* Table F.4: SN = S0 + 3 */\n        entropy->dc_context[ci] = 8;    /* small negative diff category */\n      }\n      /* Figure F.8: Encoding the magnitude category of v */\n      m = 0;\n      if (v -= 1) {\n        arith_encode(cinfo, st, 1);\n        m = 1;\n        v2 = v;\n        st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */\n        while (v2 >>= 1) {\n          arith_encode(cinfo, st, 1);\n          m <<= 1;\n          st += 1;\n        }\n      }\n      arith_encode(cinfo, st, 0);\n      /* Section F.1.4.4.1.2: Establish dc_context conditioning category */\n      if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))\n        entropy->dc_context[ci] = 0;    /* zero diff category */\n      else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))\n        entropy->dc_context[ci] += 8;   /* large diff category */\n      /* Figure F.9: Encoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n        arith_encode(cinfo, st, (m & v) ? 1 : 0);\n    }\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for AC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\nencode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  JBLOCKROW block;\n  unsigned char *st;\n  int tbl, k, ke;\n  int v, v2, m;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      emit_restart(cinfo, entropy->next_restart_num);\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  /* Encode the MCU data block */\n  block = MCU_data[0];\n  tbl = cinfo->cur_comp_info[0]->ac_tbl_no;\n\n  /* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */\n\n  /* Establish EOB (end-of-block) index */\n  for (ke = cinfo->Se; ke > 0; ke--)\n    /* We must apply the point transform by Al.  For AC coefficients this\n     * is an integer division with rounding towards 0.  To do this portably\n     * in C, we shift after obtaining the absolute value.\n     */\n    if ((v = (*block)[jpeg_natural_order[ke]]) >= 0) {\n      if (v >>= cinfo->Al) break;\n    } else {\n      v = -v;\n      if (v >>= cinfo->Al) break;\n    }\n\n  /* Figure F.5: Encode_AC_Coefficients */\n  for (k = cinfo->Ss; k <= ke; k++) {\n    st = entropy->ac_stats[tbl] + 3 * (k - 1);\n    arith_encode(cinfo, st, 0);         /* EOB decision */\n    for (;;) {\n      if ((v = (*block)[jpeg_natural_order[k]]) >= 0) {\n        if (v >>= cinfo->Al) {\n          arith_encode(cinfo, st + 1, 1);\n          arith_encode(cinfo, entropy->fixed_bin, 0);\n          break;\n        }\n      } else {\n        v = -v;\n        if (v >>= cinfo->Al) {\n          arith_encode(cinfo, st + 1, 1);\n          arith_encode(cinfo, entropy->fixed_bin, 1);\n          break;\n        }\n      }\n      arith_encode(cinfo, st + 1, 0); st += 3; k++;\n    }\n    st += 2;\n    /* Figure F.8: Encoding the magnitude category of v */\n    m = 0;\n    if (v -= 1) {\n      arith_encode(cinfo, st, 1);\n      m = 1;\n      v2 = v;\n      if (v2 >>= 1) {\n        arith_encode(cinfo, st, 1);\n        m <<= 1;\n        st = entropy->ac_stats[tbl] +\n             (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);\n        while (v2 >>= 1) {\n          arith_encode(cinfo, st, 1);\n          m <<= 1;\n          st += 1;\n        }\n      }\n    }\n    arith_encode(cinfo, st, 0);\n    /* Figure F.9: Encoding the magnitude bit pattern of v */\n    st += 14;\n    while (m >>= 1)\n      arith_encode(cinfo, st, (m & v) ? 1 : 0);\n  }\n  /* Encode EOB decision only if k <= cinfo->Se */\n  if (k <= cinfo->Se) {\n    st = entropy->ac_stats[tbl] + 3 * (k - 1);\n    arith_encode(cinfo, st, 1);\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for DC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\nencode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  unsigned char *st;\n  int Al, blkn;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      emit_restart(cinfo, entropy->next_restart_num);\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  st = entropy->fixed_bin;      /* use fixed probability estimation */\n  Al = cinfo->Al;\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    /* We simply emit the Al'th bit of the DC coefficient value. */\n    arith_encode(cinfo, st, (MCU_data[blkn][0][0] >> Al) & 1);\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for AC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\nencode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  JBLOCKROW block;\n  unsigned char *st;\n  int tbl, k, ke, kex;\n  int v;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      emit_restart(cinfo, entropy->next_restart_num);\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  /* Encode the MCU data block */\n  block = MCU_data[0];\n  tbl = cinfo->cur_comp_info[0]->ac_tbl_no;\n\n  /* Section G.1.3.3: Encoding of AC coefficients */\n\n  /* Establish EOB (end-of-block) index */\n  for (ke = cinfo->Se; ke > 0; ke--)\n    /* We must apply the point transform by Al.  For AC coefficients this\n     * is an integer division with rounding towards 0.  To do this portably\n     * in C, we shift after obtaining the absolute value.\n     */\n    if ((v = (*block)[jpeg_natural_order[ke]]) >= 0) {\n      if (v >>= cinfo->Al) break;\n    } else {\n      v = -v;\n      if (v >>= cinfo->Al) break;\n    }\n\n  /* Establish EOBx (previous stage end-of-block) index */\n  for (kex = ke; kex > 0; kex--)\n    if ((v = (*block)[jpeg_natural_order[kex]]) >= 0) {\n      if (v >>= cinfo->Ah) break;\n    } else {\n      v = -v;\n      if (v >>= cinfo->Ah) break;\n    }\n\n  /* Figure G.10: Encode_AC_Coefficients_SA */\n  for (k = cinfo->Ss; k <= ke; k++) {\n    st = entropy->ac_stats[tbl] + 3 * (k - 1);\n    if (k > kex)\n      arith_encode(cinfo, st, 0);       /* EOB decision */\n    for (;;) {\n      if ((v = (*block)[jpeg_natural_order[k]]) >= 0) {\n        if (v >>= cinfo->Al) {\n          if (v >> 1)                   /* previously nonzero coef */\n            arith_encode(cinfo, st + 2, (v & 1));\n          else {                        /* newly nonzero coef */\n            arith_encode(cinfo, st + 1, 1);\n            arith_encode(cinfo, entropy->fixed_bin, 0);\n          }\n          break;\n        }\n      } else {\n        v = -v;\n        if (v >>= cinfo->Al) {\n          if (v >> 1)                   /* previously nonzero coef */\n            arith_encode(cinfo, st + 2, (v & 1));\n          else {                        /* newly nonzero coef */\n            arith_encode(cinfo, st + 1, 1);\n            arith_encode(cinfo, entropy->fixed_bin, 1);\n          }\n          break;\n        }\n      }\n      arith_encode(cinfo, st + 1, 0); st += 3; k++;\n    }\n  }\n  /* Encode EOB decision only if k <= cinfo->Se */\n  if (k <= cinfo->Se) {\n    st = entropy->ac_stats[tbl] + 3 * (k - 1);\n    arith_encode(cinfo, st, 1);\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Encode and output one MCU's worth of arithmetic-compressed coefficients.\n */\n\nMETHODDEF(boolean)\nencode_mcu (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  jpeg_component_info *compptr;\n  JBLOCKROW block;\n  unsigned char *st;\n  int blkn, ci, tbl, k, ke;\n  int v, v2, m;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      emit_restart(cinfo, entropy->next_restart_num);\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n    ci = cinfo->MCU_membership[blkn];\n    compptr = cinfo->cur_comp_info[ci];\n\n    /* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */\n\n    tbl = compptr->dc_tbl_no;\n\n    /* Table F.4: Point to statistics bin S0 for DC coefficient coding */\n    st = entropy->dc_stats[tbl] + entropy->dc_context[ci];\n\n    /* Figure F.4: Encode_DC_DIFF */\n    if ((v = (*block)[0] - entropy->last_dc_val[ci]) == 0) {\n      arith_encode(cinfo, st, 0);\n      entropy->dc_context[ci] = 0;      /* zero diff category */\n    } else {\n      entropy->last_dc_val[ci] = (*block)[0];\n      arith_encode(cinfo, st, 1);\n      /* Figure F.6: Encoding nonzero value v */\n      /* Figure F.7: Encoding the sign of v */\n      if (v > 0) {\n        arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */\n        st += 2;                        /* Table F.4: SP = S0 + 2 */\n        entropy->dc_context[ci] = 4;    /* small positive diff category */\n      } else {\n        v = -v;\n        arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */\n        st += 3;                        /* Table F.4: SN = S0 + 3 */\n        entropy->dc_context[ci] = 8;    /* small negative diff category */\n      }\n      /* Figure F.8: Encoding the magnitude category of v */\n      m = 0;\n      if (v -= 1) {\n        arith_encode(cinfo, st, 1);\n        m = 1;\n        v2 = v;\n        st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */\n        while (v2 >>= 1) {\n          arith_encode(cinfo, st, 1);\n          m <<= 1;\n          st += 1;\n        }\n      }\n      arith_encode(cinfo, st, 0);\n      /* Section F.1.4.4.1.2: Establish dc_context conditioning category */\n      if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))\n        entropy->dc_context[ci] = 0;    /* zero diff category */\n      else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))\n        entropy->dc_context[ci] += 8;   /* large diff category */\n      /* Figure F.9: Encoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n        arith_encode(cinfo, st, (m & v) ? 1 : 0);\n    }\n\n    /* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */\n\n    tbl = compptr->ac_tbl_no;\n\n    /* Establish EOB (end-of-block) index */\n    for (ke = DCTSIZE2 - 1; ke > 0; ke--)\n      if ((*block)[jpeg_natural_order[ke]]) break;\n\n    /* Figure F.5: Encode_AC_Coefficients */\n    for (k = 1; k <= ke; k++) {\n      st = entropy->ac_stats[tbl] + 3 * (k - 1);\n      arith_encode(cinfo, st, 0);       /* EOB decision */\n      while ((v = (*block)[jpeg_natural_order[k]]) == 0) {\n        arith_encode(cinfo, st + 1, 0); st += 3; k++;\n      }\n      arith_encode(cinfo, st + 1, 1);\n      /* Figure F.6: Encoding nonzero value v */\n      /* Figure F.7: Encoding the sign of v */\n      if (v > 0) {\n        arith_encode(cinfo, entropy->fixed_bin, 0);\n      } else {\n        v = -v;\n        arith_encode(cinfo, entropy->fixed_bin, 1);\n      }\n      st += 2;\n      /* Figure F.8: Encoding the magnitude category of v */\n      m = 0;\n      if (v -= 1) {\n        arith_encode(cinfo, st, 1);\n        m = 1;\n        v2 = v;\n        if (v2 >>= 1) {\n          arith_encode(cinfo, st, 1);\n          m <<= 1;\n          st = entropy->ac_stats[tbl] +\n               (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);\n          while (v2 >>= 1) {\n            arith_encode(cinfo, st, 1);\n            m <<= 1;\n            st += 1;\n          }\n        }\n      }\n      arith_encode(cinfo, st, 0);\n      /* Figure F.9: Encoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n        arith_encode(cinfo, st, (m & v) ? 1 : 0);\n    }\n    /* Encode EOB decision only if k <= DCTSIZE2 - 1 */\n    if (k <= DCTSIZE2 - 1) {\n      st = entropy->ac_stats[tbl] + 3 * (k - 1);\n      arith_encode(cinfo, st, 1);\n    }\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Initialize for an arithmetic-compressed scan.\n */\n\nMETHODDEF(void)\nstart_pass (j_compress_ptr cinfo, boolean gather_statistics)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  int ci, tbl;\n  jpeg_component_info *compptr;\n\n  if (gather_statistics)\n    /* Make sure to avoid that in the master control logic!\n     * We are fully adaptive here and need no extra\n     * statistics gathering pass!\n     */\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n\n  /* We assume jcmaster.c already validated the progressive scan parameters. */\n\n  /* Select execution routines */\n  if (cinfo->progressive_mode) {\n    if (cinfo->Ah == 0) {\n      if (cinfo->Ss == 0)\n        entropy->pub.encode_mcu = encode_mcu_DC_first;\n      else\n        entropy->pub.encode_mcu = encode_mcu_AC_first;\n    } else {\n      if (cinfo->Ss == 0)\n        entropy->pub.encode_mcu = encode_mcu_DC_refine;\n      else\n        entropy->pub.encode_mcu = encode_mcu_AC_refine;\n    }\n  } else\n    entropy->pub.encode_mcu = encode_mcu;\n\n  /* Allocate & initialize requested statistics areas */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    /* DC needs no table for refinement scan */\n    if (cinfo->progressive_mode == 0 || (cinfo->Ss == 0 && cinfo->Ah == 0)) {\n      tbl = compptr->dc_tbl_no;\n      if (tbl < 0 || tbl >= NUM_ARITH_TBLS)\n        ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);\n      if (entropy->dc_stats[tbl] == NULL)\n        entropy->dc_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)\n          ((j_common_ptr) cinfo, JPOOL_IMAGE, DC_STAT_BINS);\n      MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);\n      /* Initialize DC predictions to 0 */\n      entropy->last_dc_val[ci] = 0;\n      entropy->dc_context[ci] = 0;\n    }\n    /* AC needs no table when not present */\n    if (cinfo->progressive_mode == 0 || cinfo->Se) {\n      tbl = compptr->ac_tbl_no;\n      if (tbl < 0 || tbl >= NUM_ARITH_TBLS)\n        ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);\n      if (entropy->ac_stats[tbl] == NULL)\n        entropy->ac_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)\n          ((j_common_ptr) cinfo, JPOOL_IMAGE, AC_STAT_BINS);\n      MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);\n#ifdef CALCULATE_SPECTRAL_CONDITIONING\n      if (cinfo->progressive_mode)\n        /* Section G.1.3.2: Set appropriate arithmetic conditioning value Kx */\n        cinfo->arith_ac_K[tbl] = cinfo->Ss + ((8 + cinfo->Se - cinfo->Ss) >> 4);\n#endif\n    }\n  }\n\n  /* Initialize arithmetic encoding variables */\n  entropy->c = 0;\n  entropy->a = 0x10000L;\n  entropy->sc = 0;\n  entropy->zc = 0;\n  entropy->ct = 11;\n  entropy->buffer = -1;  /* empty */\n\n  /* Initialize restart stuff */\n  entropy->restarts_to_go = cinfo->restart_interval;\n  entropy->next_restart_num = 0;\n}\n\n\n/*\n * Module initialization routine for arithmetic entropy encoding.\n */\n\nGLOBAL(void)\njinit_arith_encoder (j_compress_ptr cinfo)\n{\n  arith_entropy_ptr entropy;\n  int i;\n\n  entropy = (arith_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(arith_entropy_encoder));\n  cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;\n  entropy->pub.start_pass = start_pass;\n  entropy->pub.finish_pass = finish_pass;\n\n  /* Mark tables unallocated */\n  for (i = 0; i < NUM_ARITH_TBLS; i++) {\n    entropy->dc_stats[i] = NULL;\n    entropy->ac_stats[i] = NULL;\n  }\n\n  /* Initialize index for fixed probability estimation */\n  entropy->fixed_bin[0] = 113;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jccoefct.c",
    "content": "/*\n * jccoefct.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code and\n * information relevant to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains the coefficient buffer controller for compression.\n * This controller is the top level of the JPEG compressor proper.\n * The coefficient buffer lies between forward-DCT and entropy encoding steps.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* We use a full-image coefficient buffer when doing Huffman optimization,\n * and also for writing multiple-scan JPEG files.  In all cases, the DCT\n * step is run during the first pass, and subsequent passes need only read\n * the buffered coefficients.\n */\n#ifdef ENTROPY_OPT_SUPPORTED\n#define FULL_COEF_BUFFER_SUPPORTED\n#else\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n#define FULL_COEF_BUFFER_SUPPORTED\n#endif\n#endif\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_c_coef_controller pub; /* public fields */\n\n  JDIMENSION iMCU_row_num;      /* iMCU row # within image */\n  JDIMENSION mcu_ctr;           /* counts MCUs processed in current row */\n  int MCU_vert_offset;          /* counts MCU rows within iMCU row */\n  int MCU_rows_per_iMCU_row;    /* number of such rows needed */\n\n  /* For single-pass compression, it's sufficient to buffer just one MCU\n   * (although this may prove a bit slow in practice).  We allocate a\n   * workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it for each\n   * MCU constructed and sent.  In multi-pass modes, this array points to the\n   * current MCU's blocks within the virtual arrays.\n   */\n  JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];\n\n  /* In multi-pass modes, we need a virtual block array for each component. */\n  jvirt_barray_ptr whole_image[MAX_COMPONENTS];\n} my_coef_controller;\n\ntypedef my_coef_controller *my_coef_ptr;\n\n\n/* Forward declarations */\nMETHODDEF(boolean) compress_data\n        (j_compress_ptr cinfo, JSAMPIMAGE input_buf);\n#ifdef FULL_COEF_BUFFER_SUPPORTED\nMETHODDEF(boolean) compress_first_pass\n        (j_compress_ptr cinfo, JSAMPIMAGE input_buf);\nMETHODDEF(boolean) compress_output\n        (j_compress_ptr cinfo, JSAMPIMAGE input_buf);\n#endif\n\n\nLOCAL(void)\nstart_iMCU_row (j_compress_ptr cinfo)\n/* Reset within-iMCU-row counters for a new row */\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  /* In an interleaved scan, an MCU row is the same as an iMCU row.\n   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.\n   * But at the bottom of the image, process only what's left.\n   */\n  if (cinfo->comps_in_scan > 1) {\n    coef->MCU_rows_per_iMCU_row = 1;\n  } else {\n    if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;\n    else\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;\n  }\n\n  coef->mcu_ctr = 0;\n  coef->MCU_vert_offset = 0;\n}\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  coef->iMCU_row_num = 0;\n  start_iMCU_row(cinfo);\n\n  switch (pass_mode) {\n  case JBUF_PASS_THRU:\n    if (coef->whole_image[0] != NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    coef->pub.compress_data = compress_data;\n    break;\n#ifdef FULL_COEF_BUFFER_SUPPORTED\n  case JBUF_SAVE_AND_PASS:\n    if (coef->whole_image[0] == NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    coef->pub.compress_data = compress_first_pass;\n    break;\n  case JBUF_CRANK_DEST:\n    if (coef->whole_image[0] == NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    coef->pub.compress_data = compress_output;\n    break;\n#endif\n  default:\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    break;\n  }\n}\n\n\n/*\n * Process some data in the single-pass case.\n * We process the equivalent of one fully interleaved MCU row (\"iMCU\" row)\n * per call, ie, v_samp_factor block rows for each component in the image.\n * Returns TRUE if the iMCU row is completed, FALSE if suspended.\n *\n * NB: input_buf contains a plane for each component in image,\n * which we index according to the component's SOF position.\n */\n\nMETHODDEF(boolean)\ncompress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION MCU_col_num;       /* index of current MCU within row */\n  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  int blkn, bi, ci, yindex, yoffset, blockcnt;\n  JDIMENSION ypos, xpos;\n  jpeg_component_info *compptr;\n\n  /* Loop to write as much as one whole iMCU row */\n  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;\n       yoffset++) {\n    for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col;\n         MCU_col_num++) {\n      /* Determine where data comes from in input_buf and do the DCT thing.\n       * Each call on forward_DCT processes a horizontal row of DCT blocks\n       * as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks\n       * sequentially.  Dummy blocks at the right or bottom edge are filled in\n       * specially.  The data in them does not matter for image reconstruction,\n       * so we fill them with values that will encode to the smallest amount of\n       * data, viz: all zeroes in the AC entries, DC entries equal to previous\n       * block's DC value.  (Thanks to Thomas Kinsman for this idea.)\n       */\n      blkn = 0;\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n        compptr = cinfo->cur_comp_info[ci];\n        blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width\n                                                : compptr->last_col_width;\n        xpos = MCU_col_num * compptr->MCU_sample_width;\n        ypos = yoffset * DCTSIZE; /* ypos == (yoffset+yindex) * DCTSIZE */\n        for (yindex = 0; yindex < compptr->MCU_height; yindex++) {\n          if (coef->iMCU_row_num < last_iMCU_row ||\n              yoffset+yindex < compptr->last_row_height) {\n            (*cinfo->fdct->forward_DCT) (cinfo, compptr,\n                                         input_buf[compptr->component_index],\n                                         coef->MCU_buffer[blkn],\n                                         ypos, xpos, (JDIMENSION) blockcnt);\n            if (blockcnt < compptr->MCU_width) {\n              /* Create some dummy blocks at the right edge of the image. */\n              jzero_far((void *) coef->MCU_buffer[blkn + blockcnt],\n                        (compptr->MCU_width - blockcnt) * sizeof(JBLOCK));\n              for (bi = blockcnt; bi < compptr->MCU_width; bi++) {\n                coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0];\n              }\n            }\n          } else {\n            /* Create a row of dummy blocks at the bottom of the image. */\n            jzero_far((void *) coef->MCU_buffer[blkn],\n                      compptr->MCU_width * sizeof(JBLOCK));\n            for (bi = 0; bi < compptr->MCU_width; bi++) {\n              coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0];\n            }\n          }\n          blkn += compptr->MCU_width;\n          ypos += DCTSIZE;\n        }\n      }\n      /* Try to write the MCU.  In event of a suspension failure, we will\n       * re-DCT the MCU on restart (a bit inefficient, could be fixed...)\n       */\n      if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {\n        /* Suspension forced; update state counters and exit */\n        coef->MCU_vert_offset = yoffset;\n        coef->mcu_ctr = MCU_col_num;\n        return FALSE;\n      }\n    }\n    /* Completed an MCU row, but perhaps not an iMCU row */\n    coef->mcu_ctr = 0;\n  }\n  /* Completed the iMCU row, advance counters for next one */\n  coef->iMCU_row_num++;\n  start_iMCU_row(cinfo);\n  return TRUE;\n}\n\n\n#ifdef FULL_COEF_BUFFER_SUPPORTED\n\n/*\n * Process some data in the first pass of a multi-pass case.\n * We process the equivalent of one fully interleaved MCU row (\"iMCU\" row)\n * per call, ie, v_samp_factor block rows for each component in the image.\n * This amount of data is read from the source buffer, DCT'd and quantized,\n * and saved into the virtual arrays.  We also generate suitable dummy blocks\n * as needed at the right and lower edges.  (The dummy blocks are constructed\n * in the virtual arrays, which have been padded appropriately.)  This makes\n * it possible for subsequent passes not to worry about real vs. dummy blocks.\n *\n * We must also emit the data to the entropy encoder.  This is conveniently\n * done by calling compress_output() after we've loaded the current strip\n * of the virtual arrays.\n *\n * NB: input_buf contains a plane for each component in image.  All\n * components are DCT'd and loaded into the virtual arrays in this pass.\n * However, it may be that only a subset of the components are emitted to\n * the entropy encoder during this first pass; be careful about looking\n * at the scan-dependent variables (MCU dimensions, etc).\n */\n\nMETHODDEF(boolean)\ncompress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  JDIMENSION blocks_across, MCUs_across, MCUindex;\n  int bi, ci, h_samp_factor, block_row, block_rows, ndummy;\n  JCOEF lastDC;\n  jpeg_component_info *compptr;\n  JBLOCKARRAY buffer;\n  JBLOCKROW thisblockrow, lastblockrow;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Align the virtual buffer for this component. */\n    buffer = (*cinfo->mem->access_virt_barray)\n      ((j_common_ptr) cinfo, coef->whole_image[ci],\n       coef->iMCU_row_num * compptr->v_samp_factor,\n       (JDIMENSION) compptr->v_samp_factor, TRUE);\n    /* Count non-dummy DCT block rows in this iMCU row. */\n    if (coef->iMCU_row_num < last_iMCU_row)\n      block_rows = compptr->v_samp_factor;\n    else {\n      /* NB: can't use last_row_height here, since may not be set! */\n      block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);\n      if (block_rows == 0) block_rows = compptr->v_samp_factor;\n    }\n    blocks_across = compptr->width_in_blocks;\n    h_samp_factor = compptr->h_samp_factor;\n    /* Count number of dummy blocks to be added at the right margin. */\n    ndummy = (int) (blocks_across % h_samp_factor);\n    if (ndummy > 0)\n      ndummy = h_samp_factor - ndummy;\n    /* Perform DCT for all non-dummy blocks in this iMCU row.  Each call\n     * on forward_DCT processes a complete horizontal row of DCT blocks.\n     */\n    for (block_row = 0; block_row < block_rows; block_row++) {\n      thisblockrow = buffer[block_row];\n      (*cinfo->fdct->forward_DCT) (cinfo, compptr,\n                                   input_buf[ci], thisblockrow,\n                                   (JDIMENSION) (block_row * DCTSIZE),\n                                   (JDIMENSION) 0, blocks_across);\n      if (ndummy > 0) {\n        /* Create dummy blocks at the right edge of the image. */\n        thisblockrow += blocks_across; /* => first dummy block */\n        jzero_far((void *) thisblockrow, ndummy * sizeof(JBLOCK));\n        lastDC = thisblockrow[-1][0];\n        for (bi = 0; bi < ndummy; bi++) {\n          thisblockrow[bi][0] = lastDC;\n        }\n      }\n    }\n    /* If at end of image, create dummy block rows as needed.\n     * The tricky part here is that within each MCU, we want the DC values\n     * of the dummy blocks to match the last real block's DC value.\n     * This squeezes a few more bytes out of the resulting file...\n     */\n    if (coef->iMCU_row_num == last_iMCU_row) {\n      blocks_across += ndummy;  /* include lower right corner */\n      MCUs_across = blocks_across / h_samp_factor;\n      for (block_row = block_rows; block_row < compptr->v_samp_factor;\n           block_row++) {\n        thisblockrow = buffer[block_row];\n        lastblockrow = buffer[block_row-1];\n        jzero_far((void *) thisblockrow,\n                  (size_t) (blocks_across * sizeof(JBLOCK)));\n        for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {\n          lastDC = lastblockrow[h_samp_factor-1][0];\n          for (bi = 0; bi < h_samp_factor; bi++) {\n            thisblockrow[bi][0] = lastDC;\n          }\n          thisblockrow += h_samp_factor; /* advance to next MCU in row */\n          lastblockrow += h_samp_factor;\n        }\n      }\n    }\n  }\n  /* NB: compress_output will increment iMCU_row_num if successful.\n   * A suspension return will result in redoing all the work above next time.\n   */\n\n  /* Emit data to the entropy encoder, sharing code with subsequent passes */\n  return compress_output(cinfo, input_buf);\n}\n\n\n/*\n * Process some data in subsequent passes of a multi-pass case.\n * We process the equivalent of one fully interleaved MCU row (\"iMCU\" row)\n * per call, ie, v_samp_factor block rows for each component in the scan.\n * The data is obtained from the virtual arrays and fed to the entropy coder.\n * Returns TRUE if the iMCU row is completed, FALSE if suspended.\n *\n * NB: input_buf is ignored; it is likely to be a NULL pointer.\n */\n\nMETHODDEF(boolean)\ncompress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION MCU_col_num;       /* index of current MCU within row */\n  int blkn, ci, xindex, yindex, yoffset;\n  JDIMENSION start_col;\n  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];\n  JBLOCKROW buffer_ptr;\n  jpeg_component_info *compptr;\n\n  /* Align the virtual buffers for the components used in this scan.\n   * NB: during first pass, this is safe only because the buffers will\n   * already be aligned properly, so jmemmgr.c won't need to do any I/O.\n   */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    buffer[ci] = (*cinfo->mem->access_virt_barray)\n      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],\n       coef->iMCU_row_num * compptr->v_samp_factor,\n       (JDIMENSION) compptr->v_samp_factor, FALSE);\n  }\n\n  /* Loop to process one whole iMCU row */\n  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;\n       yoffset++) {\n    for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;\n         MCU_col_num++) {\n      /* Construct list of pointers to DCT blocks belonging to this MCU */\n      blkn = 0;                 /* index of current DCT block within MCU */\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n        compptr = cinfo->cur_comp_info[ci];\n        start_col = MCU_col_num * compptr->MCU_width;\n        for (yindex = 0; yindex < compptr->MCU_height; yindex++) {\n          buffer_ptr = buffer[ci][yindex+yoffset] + start_col;\n          for (xindex = 0; xindex < compptr->MCU_width; xindex++) {\n            coef->MCU_buffer[blkn++] = buffer_ptr++;\n          }\n        }\n      }\n      /* Try to write the MCU. */\n      if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {\n        /* Suspension forced; update state counters and exit */\n        coef->MCU_vert_offset = yoffset;\n        coef->mcu_ctr = MCU_col_num;\n        return FALSE;\n      }\n    }\n    /* Completed an MCU row, but perhaps not an iMCU row */\n    coef->mcu_ctr = 0;\n  }\n  /* Completed the iMCU row, advance counters for next one */\n  coef->iMCU_row_num++;\n  start_iMCU_row(cinfo);\n  return TRUE;\n}\n\n#endif /* FULL_COEF_BUFFER_SUPPORTED */\n\n\n/*\n * Initialize coefficient buffer controller.\n */\n\nGLOBAL(void)\njinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)\n{\n  my_coef_ptr coef;\n\n  coef = (my_coef_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_coef_controller));\n  cinfo->coef = (struct jpeg_c_coef_controller *) coef;\n  coef->pub.start_pass = start_pass_coef;\n\n  /* Create the coefficient buffer. */\n  if (need_full_buffer) {\n#ifdef FULL_COEF_BUFFER_SUPPORTED\n    /* Allocate a full-image virtual array for each component, */\n    /* padded to a multiple of samp_factor DCT blocks in each direction. */\n    int ci;\n    jpeg_component_info *compptr;\n\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n         ci++, compptr++) {\n      coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)\n        ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n         (JDIMENSION) jround_up((long) compptr->width_in_blocks,\n                                (long) compptr->h_samp_factor),\n         (JDIMENSION) jround_up((long) compptr->height_in_blocks,\n                                (long) compptr->v_samp_factor),\n         (JDIMENSION) compptr->v_samp_factor);\n    }\n#else\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n#endif\n  } else {\n    /* We only need a single-MCU buffer. */\n    JBLOCKROW buffer;\n    int i;\n\n    buffer = (JBLOCKROW)\n      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  C_MAX_BLOCKS_IN_MCU * sizeof(JBLOCK));\n    for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {\n      coef->MCU_buffer[i] = buffer + i;\n    }\n    coef->whole_image[0] = NULL; /* flag for no virtual arrays */\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jccolext.c",
    "content": "/*\n * jccolext.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009-2012, 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains input colorspace conversion routines.\n */\n\n\n/* This file is included by jccolor.c */\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n *\n * Note that we change from the application's interleaved-pixel format\n * to our internal noninterleaved, one-plane-per-component format.\n * The input buffer is therefore three times as wide as the output buffer.\n *\n * A starting row offset is provided only for the output buffer.  The caller\n * can easily adjust the passed input_buf value to accommodate any row\n * offset required on that side.\n */\n\nINLINE\nLOCAL(void)\nrgb_ycc_convert_internal (j_compress_ptr cinfo,\n                          JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                          JDIMENSION output_row, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int r, g, b;\n  register JLONG * ctab = cconvert->rgb_ycc_tab;\n  register JSAMPROW inptr;\n  register JSAMPROW outptr0, outptr1, outptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr0 = output_buf[0][output_row];\n    outptr1 = output_buf[1][output_row];\n    outptr2 = output_buf[2][output_row];\n    output_row++;\n    for (col = 0; col < num_cols; col++) {\n      r = GETJSAMPLE(inptr[RGB_RED]);\n      g = GETJSAMPLE(inptr[RGB_GREEN]);\n      b = GETJSAMPLE(inptr[RGB_BLUE]);\n      inptr += RGB_PIXELSIZE;\n      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations\n       * must be too; we do not need an explicit range-limiting operation.\n       * Hence the value being shifted is never negative, and we don't\n       * need the general RIGHT_SHIFT macro.\n       */\n      /* Y */\n      outptr0[col] = (JSAMPLE)\n                ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])\n                 >> SCALEBITS);\n      /* Cb */\n      outptr1[col] = (JSAMPLE)\n                ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])\n                 >> SCALEBITS);\n      /* Cr */\n      outptr2[col] = (JSAMPLE)\n                ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])\n                 >> SCALEBITS);\n    }\n  }\n}\n\n\n/**************** Cases other than RGB -> YCbCr **************/\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * This version handles RGB->grayscale conversion, which is the same\n * as the RGB->Y portion of RGB->YCbCr.\n * We assume rgb_ycc_start has been called (we only use the Y tables).\n */\n\nINLINE\nLOCAL(void)\nrgb_gray_convert_internal (j_compress_ptr cinfo,\n                           JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                           JDIMENSION output_row, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int r, g, b;\n  register JLONG * ctab = cconvert->rgb_ycc_tab;\n  register JSAMPROW inptr;\n  register JSAMPROW outptr;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr = output_buf[0][output_row];\n    output_row++;\n    for (col = 0; col < num_cols; col++) {\n      r = GETJSAMPLE(inptr[RGB_RED]);\n      g = GETJSAMPLE(inptr[RGB_GREEN]);\n      b = GETJSAMPLE(inptr[RGB_BLUE]);\n      inptr += RGB_PIXELSIZE;\n      /* Y */\n      outptr[col] = (JSAMPLE)\n                ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])\n                 >> SCALEBITS);\n    }\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * This version handles extended RGB->plain RGB conversion\n */\n\nINLINE\nLOCAL(void)\nrgb_rgb_convert_internal (j_compress_ptr cinfo,\n                          JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                          JDIMENSION output_row, int num_rows)\n{\n  register JSAMPROW inptr;\n  register JSAMPROW outptr0, outptr1, outptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr0 = output_buf[0][output_row];\n    outptr1 = output_buf[1][output_row];\n    outptr2 = output_buf[2][output_row];\n    output_row++;\n    for (col = 0; col < num_cols; col++) {\n      outptr0[col] = GETJSAMPLE(inptr[RGB_RED]);\n      outptr1[col] = GETJSAMPLE(inptr[RGB_GREEN]);\n      outptr2[col] = GETJSAMPLE(inptr[RGB_BLUE]);\n      inptr += RGB_PIXELSIZE;\n    }\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jccolor.c",
    "content": "/*\n * jccolor.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2009-2012, 2015, D. R. Commander.\n * Copyright (C) 2014, MIPS Technologies, Inc., California.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains input colorspace conversion routines.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jsimd.h\"\n#include \"jconfigint.h\"\n\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_color_converter pub; /* public fields */\n\n  /* Private state for RGB->YCC conversion */\n  JLONG *rgb_ycc_tab;           /* => table for RGB to YCbCr conversion */\n} my_color_converter;\n\ntypedef my_color_converter *my_cconvert_ptr;\n\n\n/**************** RGB -> YCbCr conversion: most common case **************/\n\n/*\n * YCbCr is defined per CCIR 601-1, except that Cb and Cr are\n * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.\n * The conversion equations to be implemented are therefore\n *      Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n *      Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B  + CENTERJSAMPLE\n *      Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B  + CENTERJSAMPLE\n * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)\n * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,\n * rather than CENTERJSAMPLE, for Cb and Cr.  This gave equal positive and\n * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0)\n * were not represented exactly.  Now we sacrifice exact representation of\n * maximum red and maximum blue in order to get exact grayscales.\n *\n * To avoid floating-point arithmetic, we represent the fractional constants\n * as integers scaled up by 2^16 (about 4 digits precision); we have to divide\n * the products by 2^16, with appropriate rounding, to get the correct answer.\n *\n * For even more speed, we avoid doing any multiplications in the inner loop\n * by precalculating the constants times R,G,B for all possible values.\n * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);\n * for 12-bit samples it is still acceptable.  It's not very reasonable for\n * 16-bit samples, but if you want lossless storage you shouldn't be changing\n * colorspace anyway.\n * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included\n * in the tables to save adding them separately in the inner loop.\n */\n\n#define SCALEBITS       16      /* speediest right-shift on some machines */\n#define CBCR_OFFSET     ((JLONG) CENTERJSAMPLE << SCALEBITS)\n#define ONE_HALF        ((JLONG) 1 << (SCALEBITS-1))\n#define FIX(x)          ((JLONG) ((x) * (1L<<SCALEBITS) + 0.5))\n\n/* We allocate one big table and divide it up into eight parts, instead of\n * doing eight alloc_small requests.  This lets us use a single table base\n * address, which can be held in a register in the inner loops on many\n * machines (more than can hold all eight addresses, anyway).\n */\n\n#define R_Y_OFF         0                       /* offset to R => Y section */\n#define G_Y_OFF         (1*(MAXJSAMPLE+1))      /* offset to G => Y section */\n#define B_Y_OFF         (2*(MAXJSAMPLE+1))      /* etc. */\n#define R_CB_OFF        (3*(MAXJSAMPLE+1))\n#define G_CB_OFF        (4*(MAXJSAMPLE+1))\n#define B_CB_OFF        (5*(MAXJSAMPLE+1))\n#define R_CR_OFF        B_CB_OFF                /* B=>Cb, R=>Cr are the same */\n#define G_CR_OFF        (6*(MAXJSAMPLE+1))\n#define B_CR_OFF        (7*(MAXJSAMPLE+1))\n#define TABLE_SIZE      (8*(MAXJSAMPLE+1))\n\n\n/* Include inline routines for colorspace extensions */\n\n#include \"jccolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n\n#define RGB_RED EXT_RGB_RED\n#define RGB_GREEN EXT_RGB_GREEN\n#define RGB_BLUE EXT_RGB_BLUE\n#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n#define rgb_ycc_convert_internal extrgb_ycc_convert_internal\n#define rgb_gray_convert_internal extrgb_gray_convert_internal\n#define rgb_rgb_convert_internal extrgb_rgb_convert_internal\n#include \"jccolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef rgb_ycc_convert_internal\n#undef rgb_gray_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_RGBX_RED\n#define RGB_GREEN EXT_RGBX_GREEN\n#define RGB_BLUE EXT_RGBX_BLUE\n#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n#define rgb_ycc_convert_internal extrgbx_ycc_convert_internal\n#define rgb_gray_convert_internal extrgbx_gray_convert_internal\n#define rgb_rgb_convert_internal extrgbx_rgb_convert_internal\n#include \"jccolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef rgb_ycc_convert_internal\n#undef rgb_gray_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_BGR_RED\n#define RGB_GREEN EXT_BGR_GREEN\n#define RGB_BLUE EXT_BGR_BLUE\n#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n#define rgb_ycc_convert_internal extbgr_ycc_convert_internal\n#define rgb_gray_convert_internal extbgr_gray_convert_internal\n#define rgb_rgb_convert_internal extbgr_rgb_convert_internal\n#include \"jccolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef rgb_ycc_convert_internal\n#undef rgb_gray_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_BGRX_RED\n#define RGB_GREEN EXT_BGRX_GREEN\n#define RGB_BLUE EXT_BGRX_BLUE\n#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n#define rgb_ycc_convert_internal extbgrx_ycc_convert_internal\n#define rgb_gray_convert_internal extbgrx_gray_convert_internal\n#define rgb_rgb_convert_internal extbgrx_rgb_convert_internal\n#include \"jccolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef rgb_ycc_convert_internal\n#undef rgb_gray_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_XBGR_RED\n#define RGB_GREEN EXT_XBGR_GREEN\n#define RGB_BLUE EXT_XBGR_BLUE\n#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n#define rgb_ycc_convert_internal extxbgr_ycc_convert_internal\n#define rgb_gray_convert_internal extxbgr_gray_convert_internal\n#define rgb_rgb_convert_internal extxbgr_rgb_convert_internal\n#include \"jccolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef rgb_ycc_convert_internal\n#undef rgb_gray_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_XRGB_RED\n#define RGB_GREEN EXT_XRGB_GREEN\n#define RGB_BLUE EXT_XRGB_BLUE\n#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n#define rgb_ycc_convert_internal extxrgb_ycc_convert_internal\n#define rgb_gray_convert_internal extxrgb_gray_convert_internal\n#define rgb_rgb_convert_internal extxrgb_rgb_convert_internal\n#include \"jccolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef rgb_ycc_convert_internal\n#undef rgb_gray_convert_internal\n#undef rgb_rgb_convert_internal\n\n\n/*\n * Initialize for RGB->YCC colorspace conversion.\n */\n\nMETHODDEF(void)\nrgb_ycc_start (j_compress_ptr cinfo)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  JLONG *rgb_ycc_tab;\n  JLONG i;\n\n  /* Allocate and fill in the conversion tables. */\n  cconvert->rgb_ycc_tab = rgb_ycc_tab = (JLONG *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                (TABLE_SIZE * sizeof(JLONG)));\n\n  for (i = 0; i <= MAXJSAMPLE; i++) {\n    rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i;\n    rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i;\n    rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i     + ONE_HALF;\n    rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i;\n    rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i;\n    /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr.\n     * This ensures that the maximum output will round to MAXJSAMPLE\n     * not MAXJSAMPLE+1, and thus that we don't have to range-limit.\n     */\n    rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;\n/*  B=>Cb and R=>Cr tables are the same\n    rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;\n*/\n    rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i;\n    rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i;\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n */\n\nMETHODDEF(void)\nrgb_ycc_convert (j_compress_ptr cinfo,\n                 JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                 JDIMENSION output_row, int num_rows)\n{\n  switch (cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      extrgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                  num_rows);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      extrgbx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_BGR:\n      extbgr_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                  num_rows);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      extbgrx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      extxbgr_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      extxrgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    default:\n      rgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,\n                               num_rows);\n      break;\n  }\n}\n\n\n/**************** Cases other than RGB -> YCbCr **************/\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n */\n\nMETHODDEF(void)\nrgb_gray_convert (j_compress_ptr cinfo,\n                  JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                  JDIMENSION output_row, int num_rows)\n{\n  switch (cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      extrgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      extrgbx_gray_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                    num_rows);\n      break;\n    case JCS_EXT_BGR:\n      extbgr_gray_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      extbgrx_gray_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                    num_rows);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      extxbgr_gray_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                    num_rows);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      extxrgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                    num_rows);\n      break;\n    default:\n      rgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                num_rows);\n      break;\n  }\n}\n\n\n/*\n * Extended RGB to plain RGB conversion\n */\n\nMETHODDEF(void)\nrgb_rgb_convert (j_compress_ptr cinfo,\n                  JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                  JDIMENSION output_row, int num_rows)\n{\n  switch (cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      extrgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                  num_rows);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      extrgbx_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_BGR:\n      extbgr_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                  num_rows);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      extbgrx_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      extxbgr_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      extxrgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    default:\n      rgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,\n                               num_rows);\n      break;\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * This version handles Adobe-style CMYK->YCCK conversion,\n * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same\n * conversion as above, while passing K (black) unchanged.\n * We assume rgb_ycc_start has been called.\n */\n\nMETHODDEF(void)\ncmyk_ycck_convert (j_compress_ptr cinfo,\n                   JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                   JDIMENSION output_row, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int r, g, b;\n  register JLONG *ctab = cconvert->rgb_ycc_tab;\n  register JSAMPROW inptr;\n  register JSAMPROW outptr0, outptr1, outptr2, outptr3;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr0 = output_buf[0][output_row];\n    outptr1 = output_buf[1][output_row];\n    outptr2 = output_buf[2][output_row];\n    outptr3 = output_buf[3][output_row];\n    output_row++;\n    for (col = 0; col < num_cols; col++) {\n      r = MAXJSAMPLE - GETJSAMPLE(inptr[0]);\n      g = MAXJSAMPLE - GETJSAMPLE(inptr[1]);\n      b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);\n      /* K passes through as-is */\n      outptr3[col] = inptr[3];  /* don't need GETJSAMPLE here */\n      inptr += 4;\n      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations\n       * must be too; we do not need an explicit range-limiting operation.\n       * Hence the value being shifted is never negative, and we don't\n       * need the general RIGHT_SHIFT macro.\n       */\n      /* Y */\n      outptr0[col] = (JSAMPLE)\n                ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])\n                 >> SCALEBITS);\n      /* Cb */\n      outptr1[col] = (JSAMPLE)\n                ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])\n                 >> SCALEBITS);\n      /* Cr */\n      outptr2[col] = (JSAMPLE)\n                ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])\n                 >> SCALEBITS);\n    }\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * This version handles grayscale output with no conversion.\n * The source can be either plain grayscale or YCbCr (since Y == gray).\n */\n\nMETHODDEF(void)\ngrayscale_convert (j_compress_ptr cinfo,\n                   JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                   JDIMENSION output_row, int num_rows)\n{\n  register JSAMPROW inptr;\n  register JSAMPROW outptr;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n  int instride = cinfo->input_components;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr = output_buf[0][output_row];\n    output_row++;\n    for (col = 0; col < num_cols; col++) {\n      outptr[col] = inptr[0];   /* don't need GETJSAMPLE() here */\n      inptr += instride;\n    }\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * This version handles multi-component colorspaces without conversion.\n * We assume input_components == num_components.\n */\n\nMETHODDEF(void)\nnull_convert (j_compress_ptr cinfo,\n              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n              JDIMENSION output_row, int num_rows)\n{\n  register JSAMPROW inptr;\n  register JSAMPROW outptr, outptr0, outptr1, outptr2, outptr3;\n  register JDIMENSION col;\n  register int ci;\n  int nc = cinfo->num_components;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  if (nc == 3) {\n    while (--num_rows >= 0) {\n      inptr = *input_buf++;\n      outptr0 = output_buf[0][output_row];\n      outptr1 = output_buf[1][output_row];\n      outptr2 = output_buf[2][output_row];\n      output_row++;\n      for (col = 0; col < num_cols; col++) {\n        outptr0[col] = *inptr++;\n        outptr1[col] = *inptr++;\n        outptr2[col] = *inptr++;\n      }\n    }\n  } else if (nc == 4) {\n    while (--num_rows >= 0) {\n      inptr = *input_buf++;\n      outptr0 = output_buf[0][output_row];\n      outptr1 = output_buf[1][output_row];\n      outptr2 = output_buf[2][output_row];\n      outptr3 = output_buf[3][output_row];\n      output_row++;\n      for (col = 0; col < num_cols; col++) {\n        outptr0[col] = *inptr++;\n        outptr1[col] = *inptr++;\n        outptr2[col] = *inptr++;\n        outptr3[col] = *inptr++;\n      }\n    }\n  } else {\n    while (--num_rows >= 0) {\n      /* It seems fastest to make a separate pass for each component. */\n      for (ci = 0; ci < nc; ci++) {\n        inptr = *input_buf;\n        outptr = output_buf[ci][output_row];\n        for (col = 0; col < num_cols; col++) {\n          outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */\n          inptr += nc;\n        }\n      }\n      input_buf++;\n      output_row++;\n    }\n  }\n}\n\n\n/*\n * Empty method for start_pass.\n */\n\nMETHODDEF(void)\nnull_method (j_compress_ptr cinfo)\n{\n  /* no work needed */\n}\n\n\n/*\n * Module initialization routine for input colorspace conversion.\n */\n\nGLOBAL(void)\njinit_color_converter (j_compress_ptr cinfo)\n{\n  my_cconvert_ptr cconvert;\n\n  cconvert = (my_cconvert_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_color_converter));\n  cinfo->cconvert = (struct jpeg_color_converter *) cconvert;\n  /* set start_pass to null method until we find out differently */\n  cconvert->pub.start_pass = null_method;\n\n  /* Make sure input_components agrees with in_color_space */\n  switch (cinfo->in_color_space) {\n  case JCS_GRAYSCALE:\n    if (cinfo->input_components != 1)\n      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n    break;\n\n  case JCS_RGB:\n  case JCS_EXT_RGB:\n  case JCS_EXT_RGBX:\n  case JCS_EXT_BGR:\n  case JCS_EXT_BGRX:\n  case JCS_EXT_XBGR:\n  case JCS_EXT_XRGB:\n  case JCS_EXT_RGBA:\n  case JCS_EXT_BGRA:\n  case JCS_EXT_ABGR:\n  case JCS_EXT_ARGB:\n    if (cinfo->input_components != rgb_pixelsize[cinfo->in_color_space])\n      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n    break;\n\n  case JCS_YCbCr:\n    if (cinfo->input_components != 3)\n      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n    break;\n\n  case JCS_CMYK:\n  case JCS_YCCK:\n    if (cinfo->input_components != 4)\n      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n    break;\n\n  default:                      /* JCS_UNKNOWN can be anything */\n    if (cinfo->input_components < 1)\n      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n    break;\n  }\n\n  /* Check num_components, set conversion method based on requested space */\n  switch (cinfo->jpeg_color_space) {\n  case JCS_GRAYSCALE:\n    if (cinfo->num_components != 1)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    if (cinfo->in_color_space == JCS_GRAYSCALE)\n      cconvert->pub.color_convert = grayscale_convert;\n    else if (cinfo->in_color_space == JCS_RGB ||\n             cinfo->in_color_space == JCS_EXT_RGB ||\n             cinfo->in_color_space == JCS_EXT_RGBX ||\n             cinfo->in_color_space == JCS_EXT_BGR ||\n             cinfo->in_color_space == JCS_EXT_BGRX ||\n             cinfo->in_color_space == JCS_EXT_XBGR ||\n             cinfo->in_color_space == JCS_EXT_XRGB ||\n             cinfo->in_color_space == JCS_EXT_RGBA ||\n             cinfo->in_color_space == JCS_EXT_BGRA ||\n             cinfo->in_color_space == JCS_EXT_ABGR ||\n             cinfo->in_color_space == JCS_EXT_ARGB) {\n      if (jsimd_can_rgb_gray())\n        cconvert->pub.color_convert = jsimd_rgb_gray_convert;\n      else {\n        cconvert->pub.start_pass = rgb_ycc_start;\n        cconvert->pub.color_convert = rgb_gray_convert;\n      }\n    } else if (cinfo->in_color_space == JCS_YCbCr)\n      cconvert->pub.color_convert = grayscale_convert;\n    else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  case JCS_RGB:\n    if (cinfo->num_components != 3)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    if (rgb_red[cinfo->in_color_space] == 0 &&\n        rgb_green[cinfo->in_color_space] == 1 &&\n        rgb_blue[cinfo->in_color_space] == 2 &&\n        rgb_pixelsize[cinfo->in_color_space] == 3) {\n#if defined(__mips__)\n      if (jsimd_c_can_null_convert())\n        cconvert->pub.color_convert = jsimd_c_null_convert;\n      else\n#endif\n        cconvert->pub.color_convert = null_convert;\n    } else if (cinfo->in_color_space == JCS_RGB ||\n               cinfo->in_color_space == JCS_EXT_RGB ||\n               cinfo->in_color_space == JCS_EXT_RGBX ||\n               cinfo->in_color_space == JCS_EXT_BGR ||\n               cinfo->in_color_space == JCS_EXT_BGRX ||\n               cinfo->in_color_space == JCS_EXT_XBGR ||\n               cinfo->in_color_space == JCS_EXT_XRGB ||\n               cinfo->in_color_space == JCS_EXT_RGBA ||\n               cinfo->in_color_space == JCS_EXT_BGRA ||\n               cinfo->in_color_space == JCS_EXT_ABGR ||\n               cinfo->in_color_space == JCS_EXT_ARGB)\n      cconvert->pub.color_convert = rgb_rgb_convert;\n    else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  case JCS_YCbCr:\n    if (cinfo->num_components != 3)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    if (cinfo->in_color_space == JCS_RGB ||\n        cinfo->in_color_space == JCS_EXT_RGB ||\n        cinfo->in_color_space == JCS_EXT_RGBX ||\n        cinfo->in_color_space == JCS_EXT_BGR ||\n        cinfo->in_color_space == JCS_EXT_BGRX ||\n        cinfo->in_color_space == JCS_EXT_XBGR ||\n        cinfo->in_color_space == JCS_EXT_XRGB ||\n        cinfo->in_color_space == JCS_EXT_RGBA ||\n        cinfo->in_color_space == JCS_EXT_BGRA ||\n        cinfo->in_color_space == JCS_EXT_ABGR ||\n        cinfo->in_color_space == JCS_EXT_ARGB) {\n      if (jsimd_can_rgb_ycc())\n        cconvert->pub.color_convert = jsimd_rgb_ycc_convert;\n      else {\n        cconvert->pub.start_pass = rgb_ycc_start;\n        cconvert->pub.color_convert = rgb_ycc_convert;\n      }\n    } else if (cinfo->in_color_space == JCS_YCbCr) {\n#if defined(__mips__)\n      if (jsimd_c_can_null_convert())\n        cconvert->pub.color_convert = jsimd_c_null_convert;\n      else\n#endif\n        cconvert->pub.color_convert = null_convert;\n    } else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  case JCS_CMYK:\n    if (cinfo->num_components != 4)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    if (cinfo->in_color_space == JCS_CMYK) {\n#if defined(__mips__)\n      if (jsimd_c_can_null_convert())\n        cconvert->pub.color_convert = jsimd_c_null_convert;\n      else\n#endif\n        cconvert->pub.color_convert = null_convert;\n    } else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  case JCS_YCCK:\n    if (cinfo->num_components != 4)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    if (cinfo->in_color_space == JCS_CMYK) {\n      cconvert->pub.start_pass = rgb_ycc_start;\n      cconvert->pub.color_convert = cmyk_ycck_convert;\n    } else if (cinfo->in_color_space == JCS_YCCK) {\n#if defined(__mips__)\n      if (jsimd_c_can_null_convert())\n        cconvert->pub.color_convert = jsimd_c_null_convert;\n      else\n#endif\n        cconvert->pub.color_convert = null_convert;\n    } else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  default:                      /* allow null conversion of JCS_UNKNOWN */\n    if (cinfo->jpeg_color_space != cinfo->in_color_space ||\n        cinfo->num_components != cinfo->input_components)\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n#if defined(__mips__)\n    if (jsimd_c_can_null_convert())\n      cconvert->pub.color_convert = jsimd_c_null_convert;\n    else\n#endif\n      cconvert->pub.color_convert = null_convert;\n    break;\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jcdctmgr.c",
    "content": "/*\n * jcdctmgr.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2011, 2014-2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains the forward-DCT management logic.\n * This code selects a particular DCT implementation to be used,\n * and it performs related housekeeping chores including coefficient\n * quantization.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"               /* Private declarations for DCT subsystem */\n#include \"jsimddct.h\"\n\n\n/* Private subobject for this module */\n\ntypedef void (*forward_DCT_method_ptr) (DCTELEM *data);\ntypedef void (*float_DCT_method_ptr) (FAST_FLOAT *data);\n\ntypedef void (*convsamp_method_ptr) (JSAMPARRAY sample_data,\n                                     JDIMENSION start_col,\n                                     DCTELEM *workspace);\ntypedef void (*float_convsamp_method_ptr) (JSAMPARRAY sample_data,\n                                           JDIMENSION start_col,\n                                           FAST_FLOAT *workspace);\n\ntypedef void (*quantize_method_ptr) (JCOEFPTR coef_block, DCTELEM *divisors,\n                                     DCTELEM *workspace);\ntypedef void (*float_quantize_method_ptr) (JCOEFPTR coef_block,\n                                           FAST_FLOAT *divisors,\n                                           FAST_FLOAT *workspace);\n\nMETHODDEF(void) quantize (JCOEFPTR, DCTELEM *, DCTELEM *);\n\ntypedef struct {\n  struct jpeg_forward_dct pub;  /* public fields */\n\n  /* Pointer to the DCT routine actually in use */\n  forward_DCT_method_ptr dct;\n  convsamp_method_ptr convsamp;\n  quantize_method_ptr quantize;\n\n  /* The actual post-DCT divisors --- not identical to the quant table\n   * entries, because of scaling (especially for an unnormalized DCT).\n   * Each table is given in normal array order.\n   */\n  DCTELEM *divisors[NUM_QUANT_TBLS];\n\n  /* work area for FDCT subroutine */\n  DCTELEM *workspace;\n\n#ifdef DCT_FLOAT_SUPPORTED\n  /* Same as above for the floating-point case. */\n  float_DCT_method_ptr float_dct;\n  float_convsamp_method_ptr float_convsamp;\n  float_quantize_method_ptr float_quantize;\n  FAST_FLOAT *float_divisors[NUM_QUANT_TBLS];\n  FAST_FLOAT *float_workspace;\n#endif\n} my_fdct_controller;\n\ntypedef my_fdct_controller *my_fdct_ptr;\n\n\n#if BITS_IN_JSAMPLE == 8\n\n/*\n * Find the highest bit in an integer through binary search.\n */\n\nLOCAL(int)\nflss (UINT16 val)\n{\n  int bit;\n\n  bit = 16;\n\n  if (!val)\n    return 0;\n\n  if (!(val & 0xff00)) {\n    bit -= 8;\n    val <<= 8;\n  }\n  if (!(val & 0xf000)) {\n    bit -= 4;\n    val <<= 4;\n  }\n  if (!(val & 0xc000)) {\n    bit -= 2;\n    val <<= 2;\n  }\n  if (!(val & 0x8000)) {\n    bit -= 1;\n    val <<= 1;\n  }\n\n  return bit;\n}\n\n\n/*\n * Compute values to do a division using reciprocal.\n *\n * This implementation is based on an algorithm described in\n *   \"How to optimize for the Pentium family of microprocessors\"\n *   (http://www.agner.org/assem/).\n * More information about the basic algorithm can be found in\n * the paper \"Integer Division Using Reciprocals\" by Robert Alverson.\n *\n * The basic idea is to replace x/d by x * d^-1. In order to store\n * d^-1 with enough precision we shift it left a few places. It turns\n * out that this algoright gives just enough precision, and also fits\n * into DCTELEM:\n *\n *   b = (the number of significant bits in divisor) - 1\n *   r = (word size) + b\n *   f = 2^r / divisor\n *\n * f will not be an integer for most cases, so we need to compensate\n * for the rounding error introduced:\n *\n *   no fractional part:\n *\n *       result = input >> r\n *\n *   fractional part of f < 0.5:\n *\n *       round f down to nearest integer\n *       result = ((input + 1) * f) >> r\n *\n *   fractional part of f > 0.5:\n *\n *       round f up to nearest integer\n *       result = (input * f) >> r\n *\n * This is the original algorithm that gives truncated results. But we\n * want properly rounded results, so we replace \"input\" with\n * \"input + divisor/2\".\n *\n * In order to allow SIMD implementations we also tweak the values to\n * allow the same calculation to be made at all times:\n *\n *   dctbl[0] = f rounded to nearest integer\n *   dctbl[1] = divisor / 2 (+ 1 if fractional part of f < 0.5)\n *   dctbl[2] = 1 << ((word size) * 2 - r)\n *   dctbl[3] = r - (word size)\n *\n * dctbl[2] is for stupid instruction sets where the shift operation\n * isn't member wise (e.g. MMX).\n *\n * The reason dctbl[2] and dctbl[3] reduce the shift with (word size)\n * is that most SIMD implementations have a \"multiply and store top\n * half\" operation.\n *\n * Lastly, we store each of the values in their own table instead\n * of in a consecutive manner, yet again in order to allow SIMD\n * routines.\n */\n\nLOCAL(int)\ncompute_reciprocal (UINT16 divisor, DCTELEM *dtbl)\n{\n  UDCTELEM2 fq, fr;\n  UDCTELEM c;\n  int b, r;\n\n  if (divisor == 1) {\n    /* divisor == 1 means unquantized, so these reciprocal/correction/shift\n     * values will cause the C quantization algorithm to act like the\n     * identity function.  Since only the C quantization algorithm is used in\n     * these cases, the scale value is irrelevant.\n     */\n    dtbl[DCTSIZE2 * 0] = (DCTELEM) 1;                       /* reciprocal */\n    dtbl[DCTSIZE2 * 1] = (DCTELEM) 0;                       /* correction */\n    dtbl[DCTSIZE2 * 2] = (DCTELEM) 1;                       /* scale */\n    dtbl[DCTSIZE2 * 3] = -(DCTELEM) (sizeof(DCTELEM) * 8);  /* shift */\n    return 0;\n  }\n\n  b = flss(divisor) - 1;\n  r  = sizeof(DCTELEM) * 8 + b;\n\n  fq = ((UDCTELEM2)1 << r) / divisor;\n  fr = ((UDCTELEM2)1 << r) % divisor;\n\n  c = divisor / 2; /* for rounding */\n\n  if (fr == 0) { /* divisor is power of two */\n    /* fq will be one bit too large to fit in DCTELEM, so adjust */\n    fq >>= 1;\n    r--;\n  } else if (fr <= (divisor / 2U)) { /* fractional part is < 0.5 */\n    c++;\n  } else { /* fractional part is > 0.5 */\n    fq++;\n  }\n\n  dtbl[DCTSIZE2 * 0] = (DCTELEM) fq;      /* reciprocal */\n  dtbl[DCTSIZE2 * 1] = (DCTELEM) c;       /* correction + roundfactor */\n#ifdef WITH_SIMD\n  dtbl[DCTSIZE2 * 2] = (DCTELEM) (1 << (sizeof(DCTELEM)*8*2 - r));  /* scale */\n#else\n  dtbl[DCTSIZE2 * 2] = 1;\n#endif\n  dtbl[DCTSIZE2 * 3] = (DCTELEM) r - sizeof(DCTELEM)*8; /* shift */\n\n  if(r <= 16) return 0;\n  else return 1;\n}\n\n#endif\n\n\n/*\n * Initialize for a processing pass.\n * Verify that all referenced Q-tables are present, and set up\n * the divisor table for each one.\n * In the current implementation, DCT of all components is done during\n * the first pass, even if only some components will be output in the\n * first scan.  Hence all components should be examined here.\n */\n\nMETHODDEF(void)\nstart_pass_fdctmgr (j_compress_ptr cinfo)\n{\n  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;\n  int ci, qtblno, i;\n  jpeg_component_info *compptr;\n  JQUANT_TBL *qtbl;\n  DCTELEM *dtbl;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    qtblno = compptr->quant_tbl_no;\n    /* Make sure specified quantization table is present */\n    if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||\n        cinfo->quant_tbl_ptrs[qtblno] == NULL)\n      ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);\n    qtbl = cinfo->quant_tbl_ptrs[qtblno];\n    /* Compute divisors for this quant table */\n    /* We may do this more than once for same table, but it's not a big deal */\n    switch (cinfo->dct_method) {\n#ifdef DCT_ISLOW_SUPPORTED\n    case JDCT_ISLOW:\n      /* For LL&M IDCT method, divisors are equal to raw quantization\n       * coefficients multiplied by 8 (to counteract scaling).\n       */\n      if (fdct->divisors[qtblno] == NULL) {\n        fdct->divisors[qtblno] = (DCTELEM *)\n          (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                      (DCTSIZE2 * 4) * sizeof(DCTELEM));\n      }\n      dtbl = fdct->divisors[qtblno];\n      for (i = 0; i < DCTSIZE2; i++) {\n#if BITS_IN_JSAMPLE == 8\n        if (!compute_reciprocal(qtbl->quantval[i] << 3, &dtbl[i]) &&\n            fdct->quantize == jsimd_quantize)\n          fdct->quantize = quantize;\n#else\n        dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3;\n#endif\n      }\n      break;\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n    case JDCT_IFAST:\n      {\n        /* For AA&N IDCT method, divisors are equal to quantization\n         * coefficients scaled by scalefactor[row]*scalefactor[col], where\n         *   scalefactor[0] = 1\n         *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7\n         * We apply a further scale factor of 8.\n         */\n#define CONST_BITS 14\n        static const INT16 aanscales[DCTSIZE2] = {\n          /* precomputed values scaled up by 14 bits */\n          16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,\n          22725, 31521, 29692, 26722, 22725, 17855, 12299,  6270,\n          21407, 29692, 27969, 25172, 21407, 16819, 11585,  5906,\n          19266, 26722, 25172, 22654, 19266, 15137, 10426,  5315,\n          16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,\n          12873, 17855, 16819, 15137, 12873, 10114,  6967,  3552,\n           8867, 12299, 11585, 10426,  8867,  6967,  4799,  2446,\n           4520,  6270,  5906,  5315,  4520,  3552,  2446,  1247\n        };\n        SHIFT_TEMPS\n\n        if (fdct->divisors[qtblno] == NULL) {\n          fdct->divisors[qtblno] = (DCTELEM *)\n            (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                        (DCTSIZE2 * 4) * sizeof(DCTELEM));\n        }\n        dtbl = fdct->divisors[qtblno];\n        for (i = 0; i < DCTSIZE2; i++) {\n#if BITS_IN_JSAMPLE == 8\n          if (!compute_reciprocal(\n                DESCALE(MULTIPLY16V16((JLONG) qtbl->quantval[i],\n                                      (JLONG) aanscales[i]),\n                        CONST_BITS-3), &dtbl[i]) &&\n              fdct->quantize == jsimd_quantize)\n            fdct->quantize = quantize;\n#else\n           dtbl[i] = (DCTELEM)\n             DESCALE(MULTIPLY16V16((JLONG) qtbl->quantval[i],\n                                   (JLONG) aanscales[i]),\n                     CONST_BITS-3);\n#endif\n        }\n      }\n      break;\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n    case JDCT_FLOAT:\n      {\n        /* For float AA&N IDCT method, divisors are equal to quantization\n         * coefficients scaled by scalefactor[row]*scalefactor[col], where\n         *   scalefactor[0] = 1\n         *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7\n         * We apply a further scale factor of 8.\n         * What's actually stored is 1/divisor so that the inner loop can\n         * use a multiplication rather than a division.\n         */\n        FAST_FLOAT *fdtbl;\n        int row, col;\n        static const double aanscalefactor[DCTSIZE] = {\n          1.0, 1.387039845, 1.306562965, 1.175875602,\n          1.0, 0.785694958, 0.541196100, 0.275899379\n        };\n\n        if (fdct->float_divisors[qtblno] == NULL) {\n          fdct->float_divisors[qtblno] = (FAST_FLOAT *)\n            (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                        DCTSIZE2 * sizeof(FAST_FLOAT));\n        }\n        fdtbl = fdct->float_divisors[qtblno];\n        i = 0;\n        for (row = 0; row < DCTSIZE; row++) {\n          for (col = 0; col < DCTSIZE; col++) {\n            fdtbl[i] = (FAST_FLOAT)\n              (1.0 / (((double) qtbl->quantval[i] *\n                       aanscalefactor[row] * aanscalefactor[col] * 8.0)));\n            i++;\n          }\n        }\n      }\n      break;\n#endif\n    default:\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n      break;\n    }\n  }\n}\n\n\n/*\n * Load data into workspace, applying unsigned->signed conversion.\n */\n\nMETHODDEF(void)\nconvsamp (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace)\n{\n  register DCTELEM *workspaceptr;\n  register JSAMPROW elemptr;\n  register int elemr;\n\n  workspaceptr = workspace;\n  for (elemr = 0; elemr < DCTSIZE; elemr++) {\n    elemptr = sample_data[elemr] + start_col;\n\n#if DCTSIZE == 8                /* unroll the inner loop */\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n#else\n    {\n      register int elemc;\n      for (elemc = DCTSIZE; elemc > 0; elemc--)\n        *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    }\n#endif\n  }\n}\n\n\n/*\n * Quantize/descale the coefficients, and store into coef_blocks[].\n */\n\nMETHODDEF(void)\nquantize (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace)\n{\n  int i;\n  DCTELEM temp;\n  JCOEFPTR output_ptr = coef_block;\n\n#if BITS_IN_JSAMPLE == 8\n\n  UDCTELEM recip, corr;\n  int shift;\n  UDCTELEM2 product;\n\n  for (i = 0; i < DCTSIZE2; i++) {\n    temp = workspace[i];\n    recip = divisors[i + DCTSIZE2 * 0];\n    corr =  divisors[i + DCTSIZE2 * 1];\n    shift = divisors[i + DCTSIZE2 * 3];\n\n    if (temp < 0) {\n      temp = -temp;\n      product = (UDCTELEM2)(temp + corr) * recip;\n      product >>= shift + sizeof(DCTELEM)*8;\n      temp = (DCTELEM)product;\n      temp = -temp;\n    } else {\n      product = (UDCTELEM2)(temp + corr) * recip;\n      product >>= shift + sizeof(DCTELEM)*8;\n      temp = (DCTELEM)product;\n    }\n    output_ptr[i] = (JCOEF) temp;\n  }\n\n#else\n\n  register DCTELEM qval;\n\n  for (i = 0; i < DCTSIZE2; i++) {\n    qval = divisors[i];\n    temp = workspace[i];\n    /* Divide the coefficient value by qval, ensuring proper rounding.\n     * Since C does not specify the direction of rounding for negative\n     * quotients, we have to force the dividend positive for portability.\n     *\n     * In most files, at least half of the output values will be zero\n     * (at default quantization settings, more like three-quarters...)\n     * so we should ensure that this case is fast.  On many machines,\n     * a comparison is enough cheaper than a divide to make a special test\n     * a win.  Since both inputs will be nonnegative, we need only test\n     * for a < b to discover whether a/b is 0.\n     * If your machine's division is fast enough, define FAST_DIVIDE.\n     */\n#ifdef FAST_DIVIDE\n#define DIVIDE_BY(a,b)  a /= b\n#else\n#define DIVIDE_BY(a,b)  if (a >= b) a /= b; else a = 0\n#endif\n    if (temp < 0) {\n      temp = -temp;\n      temp += qval>>1;  /* for rounding */\n      DIVIDE_BY(temp, qval);\n      temp = -temp;\n    } else {\n      temp += qval>>1;  /* for rounding */\n      DIVIDE_BY(temp, qval);\n    }\n    output_ptr[i] = (JCOEF) temp;\n  }\n\n#endif\n\n}\n\n\n/*\n * Perform forward DCT on one or more blocks of a component.\n *\n * The input samples are taken from the sample_data[] array starting at\n * position start_row/start_col, and moving to the right for any additional\n * blocks. The quantized coefficients are returned in coef_blocks[].\n */\n\nMETHODDEF(void)\nforward_DCT (j_compress_ptr cinfo, jpeg_component_info *compptr,\n             JSAMPARRAY sample_data, JBLOCKROW coef_blocks,\n             JDIMENSION start_row, JDIMENSION start_col,\n             JDIMENSION num_blocks)\n/* This version is used for integer DCT implementations. */\n{\n  /* This routine is heavily used, so it's worth coding it tightly. */\n  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;\n  DCTELEM *divisors = fdct->divisors[compptr->quant_tbl_no];\n  DCTELEM *workspace;\n  JDIMENSION bi;\n\n  /* Make sure the compiler doesn't look up these every pass */\n  forward_DCT_method_ptr do_dct = fdct->dct;\n  convsamp_method_ptr do_convsamp = fdct->convsamp;\n  quantize_method_ptr do_quantize = fdct->quantize;\n  workspace = fdct->workspace;\n\n  sample_data += start_row;     /* fold in the vertical offset once */\n\n  for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {\n    /* Load data into workspace, applying unsigned->signed conversion */\n    (*do_convsamp) (sample_data, start_col, workspace);\n\n    /* Perform the DCT */\n    (*do_dct) (workspace);\n\n    /* Quantize/descale the coefficients, and store into coef_blocks[] */\n    (*do_quantize) (coef_blocks[bi], divisors, workspace);\n  }\n}\n\n\n#ifdef DCT_FLOAT_SUPPORTED\n\n\nMETHODDEF(void)\nconvsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace)\n{\n  register FAST_FLOAT *workspaceptr;\n  register JSAMPROW elemptr;\n  register int elemr;\n\n  workspaceptr = workspace;\n  for (elemr = 0; elemr < DCTSIZE; elemr++) {\n    elemptr = sample_data[elemr] + start_col;\n#if DCTSIZE == 8                /* unroll the inner loop */\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n#else\n    {\n      register int elemc;\n      for (elemc = DCTSIZE; elemc > 0; elemc--)\n        *workspaceptr++ = (FAST_FLOAT)\n                          (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    }\n#endif\n  }\n}\n\n\nMETHODDEF(void)\nquantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors, FAST_FLOAT *workspace)\n{\n  register FAST_FLOAT temp;\n  register int i;\n  register JCOEFPTR output_ptr = coef_block;\n\n  for (i = 0; i < DCTSIZE2; i++) {\n    /* Apply the quantization and scaling factor */\n    temp = workspace[i] * divisors[i];\n\n    /* Round to nearest integer.\n     * Since C does not specify the direction of rounding for negative\n     * quotients, we have to force the dividend positive for portability.\n     * The maximum coefficient size is +-16K (for 12-bit data), so this\n     * code should work for either 16-bit or 32-bit ints.\n     */\n    output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384);\n  }\n}\n\n\nMETHODDEF(void)\nforward_DCT_float (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                   JSAMPARRAY sample_data, JBLOCKROW coef_blocks,\n                   JDIMENSION start_row, JDIMENSION start_col,\n                   JDIMENSION num_blocks)\n/* This version is used for floating-point DCT implementations. */\n{\n  /* This routine is heavily used, so it's worth coding it tightly. */\n  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;\n  FAST_FLOAT *divisors = fdct->float_divisors[compptr->quant_tbl_no];\n  FAST_FLOAT *workspace;\n  JDIMENSION bi;\n\n\n  /* Make sure the compiler doesn't look up these every pass */\n  float_DCT_method_ptr do_dct = fdct->float_dct;\n  float_convsamp_method_ptr do_convsamp = fdct->float_convsamp;\n  float_quantize_method_ptr do_quantize = fdct->float_quantize;\n  workspace = fdct->float_workspace;\n\n  sample_data += start_row;     /* fold in the vertical offset once */\n\n  for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {\n    /* Load data into workspace, applying unsigned->signed conversion */\n    (*do_convsamp) (sample_data, start_col, workspace);\n\n    /* Perform the DCT */\n    (*do_dct) (workspace);\n\n    /* Quantize/descale the coefficients, and store into coef_blocks[] */\n    (*do_quantize) (coef_blocks[bi], divisors, workspace);\n  }\n}\n\n#endif /* DCT_FLOAT_SUPPORTED */\n\n\n/*\n * Initialize FDCT manager.\n */\n\nGLOBAL(void)\njinit_forward_dct (j_compress_ptr cinfo)\n{\n  my_fdct_ptr fdct;\n  int i;\n\n  fdct = (my_fdct_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_fdct_controller));\n  cinfo->fdct = (struct jpeg_forward_dct *) fdct;\n  fdct->pub.start_pass = start_pass_fdctmgr;\n\n  /* First determine the DCT... */\n  switch (cinfo->dct_method) {\n#ifdef DCT_ISLOW_SUPPORTED\n  case JDCT_ISLOW:\n    fdct->pub.forward_DCT = forward_DCT;\n    if (jsimd_can_fdct_islow())\n      fdct->dct = jsimd_fdct_islow;\n    else\n      fdct->dct = jpeg_fdct_islow;\n    break;\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n  case JDCT_IFAST:\n    fdct->pub.forward_DCT = forward_DCT;\n    if (jsimd_can_fdct_ifast())\n      fdct->dct = jsimd_fdct_ifast;\n    else\n      fdct->dct = jpeg_fdct_ifast;\n    break;\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n  case JDCT_FLOAT:\n    fdct->pub.forward_DCT = forward_DCT_float;\n    if (jsimd_can_fdct_float())\n      fdct->float_dct = jsimd_fdct_float;\n    else\n      fdct->float_dct = jpeg_fdct_float;\n    break;\n#endif\n  default:\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n    break;\n  }\n\n  /* ...then the supporting stages. */\n  switch (cinfo->dct_method) {\n#ifdef DCT_ISLOW_SUPPORTED\n  case JDCT_ISLOW:\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n  case JDCT_IFAST:\n#endif\n#if defined(DCT_ISLOW_SUPPORTED) || defined(DCT_IFAST_SUPPORTED)\n    if (jsimd_can_convsamp())\n      fdct->convsamp = jsimd_convsamp;\n    else\n      fdct->convsamp = convsamp;\n    if (jsimd_can_quantize())\n      fdct->quantize = jsimd_quantize;\n    else\n      fdct->quantize = quantize;\n    break;\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n  case JDCT_FLOAT:\n    if (jsimd_can_convsamp_float())\n      fdct->float_convsamp = jsimd_convsamp_float;\n    else\n      fdct->float_convsamp = convsamp_float;\n    if (jsimd_can_quantize_float())\n      fdct->float_quantize = jsimd_quantize_float;\n    else\n      fdct->float_quantize = quantize_float;\n    break;\n#endif\n  default:\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n    break;\n  }\n\n  /* Allocate workspace memory */\n#ifdef DCT_FLOAT_SUPPORTED\n  if (cinfo->dct_method == JDCT_FLOAT)\n    fdct->float_workspace = (FAST_FLOAT *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(FAST_FLOAT) * DCTSIZE2);\n  else\n#endif\n    fdct->workspace = (DCTELEM *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(DCTELEM) * DCTSIZE2);\n\n  /* Mark divisor tables unallocated */\n  for (i = 0; i < NUM_QUANT_TBLS; i++) {\n    fdct->divisors[i] = NULL;\n#ifdef DCT_FLOAT_SUPPORTED\n    fdct->float_divisors[i] = NULL;\n#endif\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jchuff.c",
    "content": "/*\n * jchuff.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009-2011, 2014-2016, D. R. Commander.\n * Copyright (C) 2015, Matthieu Darbois.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains Huffman entropy encoding routines.\n *\n * Much of the complexity here has to do with supporting output suspension.\n * If the data destination module demands suspension, we want to be able to\n * back up to the start of the current MCU.  To do this, we copy state\n * variables into local working storage, and update them back to the\n * permanent JPEG objects only upon successful completion of an MCU.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jsimd.h\"\n#include \"jconfigint.h\"\n#include <limits.h>\n\n/*\n * NOTE: If USE_CLZ_INTRINSIC is defined, then clz/bsr instructions will be\n * used for bit counting rather than the lookup table.  This will reduce the\n * memory footprint by 64k, which is important for some mobile applications\n * that create many isolated instances of libjpeg-turbo (web browsers, for\n * instance.)  This may improve performance on some mobile platforms as well.\n * This feature is enabled by default only on ARM processors, because some x86\n * chips have a slow implementation of bsr, and the use of clz/bsr cannot be\n * shown to have a significant performance impact even on the x86 chips that\n * have a fast implementation of it.  When building for ARMv6, you can\n * explicitly disable the use of clz/bsr by adding -mthumb to the compiler\n * flags (this defines __thumb__).\n */\n\n/* NOTE: Both GCC and Clang define __GNUC__ */\n#if defined __GNUC__ && (defined __arm__ || defined __aarch64__)\n#if !defined __thumb__ || defined __thumb2__\n#define USE_CLZ_INTRINSIC\n#endif\n#endif\n\n#ifdef USE_CLZ_INTRINSIC\n#define JPEG_NBITS_NONZERO(x) (32 - __builtin_clz(x))\n#define JPEG_NBITS(x) (x ? JPEG_NBITS_NONZERO(x) : 0)\n#else\n#include \"jpeg_nbits_table.h\"\n#define JPEG_NBITS(x) (jpeg_nbits_table[x])\n#define JPEG_NBITS_NONZERO(x) JPEG_NBITS(x)\n#endif\n\n#ifndef min\n #define min(a,b) ((a)<(b)?(a):(b))\n#endif\n\n\n/* Expanded entropy encoder object for Huffman encoding.\n *\n * The savable_state subrecord contains fields that change within an MCU,\n * but must not be updated permanently until we complete the MCU.\n */\n\ntypedef struct {\n  size_t put_buffer;            /* current bit-accumulation buffer */\n  int put_bits;                 /* # of bits now in it */\n  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */\n} savable_state;\n\n/* This macro is to work around compilers with missing or broken\n * structure assignment.  You'll need to fix this code if you have\n * such a compiler and you change MAX_COMPS_IN_SCAN.\n */\n\n#ifndef NO_STRUCT_ASSIGN\n#define ASSIGN_STATE(dest,src)  ((dest) = (src))\n#else\n#if MAX_COMPS_IN_SCAN == 4\n#define ASSIGN_STATE(dest,src)  \\\n        ((dest).put_buffer = (src).put_buffer, \\\n         (dest).put_bits = (src).put_bits, \\\n         (dest).last_dc_val[0] = (src).last_dc_val[0], \\\n         (dest).last_dc_val[1] = (src).last_dc_val[1], \\\n         (dest).last_dc_val[2] = (src).last_dc_val[2], \\\n         (dest).last_dc_val[3] = (src).last_dc_val[3])\n#endif\n#endif\n\n\ntypedef struct {\n  struct jpeg_entropy_encoder pub; /* public fields */\n\n  savable_state saved;          /* Bit buffer & DC state at start of MCU */\n\n  /* These fields are NOT loaded into local working state. */\n  unsigned int restarts_to_go;  /* MCUs left in this restart interval */\n  int next_restart_num;         /* next restart number to write (0-7) */\n\n  /* Pointers to derived tables (these workspaces have image lifespan) */\n  c_derived_tbl *dc_derived_tbls[NUM_HUFF_TBLS];\n  c_derived_tbl *ac_derived_tbls[NUM_HUFF_TBLS];\n\n#ifdef ENTROPY_OPT_SUPPORTED    /* Statistics tables for optimization */\n  long *dc_count_ptrs[NUM_HUFF_TBLS];\n  long *ac_count_ptrs[NUM_HUFF_TBLS];\n#endif\n\n  int simd;\n} huff_entropy_encoder;\n\ntypedef huff_entropy_encoder *huff_entropy_ptr;\n\n/* Working state while writing an MCU.\n * This struct contains all the fields that are needed by subroutines.\n */\n\ntypedef struct {\n  JOCTET *next_output_byte;     /* => next byte to write in buffer */\n  size_t free_in_buffer;        /* # of byte spaces remaining in buffer */\n  savable_state cur;            /* Current bit buffer & DC state */\n  j_compress_ptr cinfo;         /* dump_buffer needs access to this */\n} working_state;\n\n\n/* Forward declarations */\nMETHODDEF(boolean) encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data);\nMETHODDEF(void) finish_pass_huff (j_compress_ptr cinfo);\n#ifdef ENTROPY_OPT_SUPPORTED\nMETHODDEF(boolean) encode_mcu_gather (j_compress_ptr cinfo,\n                                      JBLOCKROW *MCU_data);\nMETHODDEF(void) finish_pass_gather (j_compress_ptr cinfo);\n#endif\n\n\n/*\n * Initialize for a Huffman-compressed scan.\n * If gather_statistics is TRUE, we do not output anything during the scan,\n * just count the Huffman symbols used and generate Huffman code tables.\n */\n\nMETHODDEF(void)\nstart_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int ci, dctbl, actbl;\n  jpeg_component_info *compptr;\n\n  if (gather_statistics) {\n#ifdef ENTROPY_OPT_SUPPORTED\n    entropy->pub.encode_mcu = encode_mcu_gather;\n    entropy->pub.finish_pass = finish_pass_gather;\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n  } else {\n    entropy->pub.encode_mcu = encode_mcu_huff;\n    entropy->pub.finish_pass = finish_pass_huff;\n  }\n\n  entropy->simd = jsimd_can_huff_encode_one_block();\n\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    dctbl = compptr->dc_tbl_no;\n    actbl = compptr->ac_tbl_no;\n    if (gather_statistics) {\n#ifdef ENTROPY_OPT_SUPPORTED\n      /* Check for invalid table indexes */\n      /* (make_c_derived_tbl does this in the other path) */\n      if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS)\n        ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl);\n      if (actbl < 0 || actbl >= NUM_HUFF_TBLS)\n        ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, actbl);\n      /* Allocate and zero the statistics tables */\n      /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */\n      if (entropy->dc_count_ptrs[dctbl] == NULL)\n        entropy->dc_count_ptrs[dctbl] = (long *)\n          (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                      257 * sizeof(long));\n      MEMZERO(entropy->dc_count_ptrs[dctbl], 257 * sizeof(long));\n      if (entropy->ac_count_ptrs[actbl] == NULL)\n        entropy->ac_count_ptrs[actbl] = (long *)\n          (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                      257 * sizeof(long));\n      MEMZERO(entropy->ac_count_ptrs[actbl], 257 * sizeof(long));\n#endif\n    } else {\n      /* Compute derived values for Huffman tables */\n      /* We may do this more than once for a table, but it's not expensive */\n      jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl,\n                              & entropy->dc_derived_tbls[dctbl]);\n      jpeg_make_c_derived_tbl(cinfo, FALSE, actbl,\n                              & entropy->ac_derived_tbls[actbl]);\n    }\n    /* Initialize DC predictions to 0 */\n    entropy->saved.last_dc_val[ci] = 0;\n  }\n\n  /* Initialize bit buffer to empty */\n  entropy->saved.put_buffer = 0;\n  entropy->saved.put_bits = 0;\n\n  /* Initialize restart stuff */\n  entropy->restarts_to_go = cinfo->restart_interval;\n  entropy->next_restart_num = 0;\n}\n\n\n/*\n * Compute the derived values for a Huffman table.\n * This routine also performs some validation checks on the table.\n *\n * Note this is also used by jcphuff.c.\n */\n\nGLOBAL(void)\njpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,\n                         c_derived_tbl **pdtbl)\n{\n  JHUFF_TBL *htbl;\n  c_derived_tbl *dtbl;\n  int p, i, l, lastp, si, maxsymbol;\n  char huffsize[257];\n  unsigned int huffcode[257];\n  unsigned int code;\n\n  /* Note that huffsize[] and huffcode[] are filled in code-length order,\n   * paralleling the order of the symbols themselves in htbl->huffval[].\n   */\n\n  /* Find the input Huffman table */\n  if (tblno < 0 || tblno >= NUM_HUFF_TBLS)\n    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);\n  htbl =\n    isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];\n  if (htbl == NULL)\n    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);\n\n  /* Allocate a workspace if we haven't already done so. */\n  if (*pdtbl == NULL)\n    *pdtbl = (c_derived_tbl *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(c_derived_tbl));\n  dtbl = *pdtbl;\n\n  /* Figure C.1: make table of Huffman code length for each symbol */\n\n  p = 0;\n  for (l = 1; l <= 16; l++) {\n    i = (int) htbl->bits[l];\n    if (i < 0 || p + i > 256)   /* protect against table overrun */\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    while (i--)\n      huffsize[p++] = (char) l;\n  }\n  huffsize[p] = 0;\n  lastp = p;\n\n  /* Figure C.2: generate the codes themselves */\n  /* We also validate that the counts represent a legal Huffman code tree. */\n\n  code = 0;\n  si = huffsize[0];\n  p = 0;\n  while (huffsize[p]) {\n    while (((int) huffsize[p]) == si) {\n      huffcode[p++] = code;\n      code++;\n    }\n    /* code is now 1 more than the last code used for codelength si; but\n     * it must still fit in si bits, since no code is allowed to be all ones.\n     */\n    if (((JLONG) code) >= (((JLONG) 1) << si))\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    code <<= 1;\n    si++;\n  }\n\n  /* Figure C.3: generate encoding tables */\n  /* These are code and size indexed by symbol value */\n\n  /* Set all codeless symbols to have code length 0;\n   * this lets us detect duplicate VAL entries here, and later\n   * allows emit_bits to detect any attempt to emit such symbols.\n   */\n  MEMZERO(dtbl->ehufsi, sizeof(dtbl->ehufsi));\n\n  /* This is also a convenient place to check for out-of-range\n   * and duplicated VAL entries.  We allow 0..255 for AC symbols\n   * but only 0..15 for DC.  (We could constrain them further\n   * based on data depth and mode, but this seems enough.)\n   */\n  maxsymbol = isDC ? 15 : 255;\n\n  for (p = 0; p < lastp; p++) {\n    i = htbl->huffval[p];\n    if (i < 0 || i > maxsymbol || dtbl->ehufsi[i])\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    dtbl->ehufco[i] = huffcode[p];\n    dtbl->ehufsi[i] = huffsize[p];\n  }\n}\n\n\n/* Outputting bytes to the file */\n\n/* Emit a byte, taking 'action' if must suspend. */\n#define emit_byte(state,val,action)  \\\n        { *(state)->next_output_byte++ = (JOCTET) (val);  \\\n          if (--(state)->free_in_buffer == 0)  \\\n            if (! dump_buffer(state))  \\\n              { action; } }\n\n\nLOCAL(boolean)\ndump_buffer (working_state *state)\n/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */\n{\n  struct jpeg_destination_mgr *dest = state->cinfo->dest;\n\n  if (! (*dest->empty_output_buffer) (state->cinfo))\n    return FALSE;\n  /* After a successful buffer dump, must reset buffer pointers */\n  state->next_output_byte = dest->next_output_byte;\n  state->free_in_buffer = dest->free_in_buffer;\n  return TRUE;\n}\n\n\n/* Outputting bits to the file */\n\n/* These macros perform the same task as the emit_bits() function in the\n * original libjpeg code.  In addition to reducing overhead by explicitly\n * inlining the code, additional performance is achieved by taking into\n * account the size of the bit buffer and waiting until it is almost full\n * before emptying it.  This mostly benefits 64-bit platforms, since 6\n * bytes can be stored in a 64-bit bit buffer before it has to be emptied.\n */\n\n#define EMIT_BYTE() { \\\n  JOCTET c; \\\n  put_bits -= 8; \\\n  c = (JOCTET)GETJOCTET(put_buffer >> put_bits); \\\n  *buffer++ = c; \\\n  if (c == 0xFF)  /* need to stuff a zero byte? */ \\\n    *buffer++ = 0; \\\n }\n\n#define PUT_BITS(code, size) { \\\n  put_bits += size; \\\n  put_buffer = (put_buffer << size) | code; \\\n}\n\n#define CHECKBUF15() { \\\n  if (put_bits > 15) { \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n  } \\\n}\n\n#define CHECKBUF31() { \\\n  if (put_bits > 31) { \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n  } \\\n}\n\n#define CHECKBUF47() { \\\n  if (put_bits > 47) { \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n  } \\\n}\n\n#if !defined(_WIN32) && !defined(SIZEOF_SIZE_T)\n#error Cannot determine word size\n#endif\n\n#if SIZEOF_SIZE_T==8 || defined(_WIN64)\n\n#define EMIT_BITS(code, size) { \\\n  CHECKBUF47() \\\n  PUT_BITS(code, size) \\\n}\n\n#define EMIT_CODE(code, size) { \\\n  temp2 &= (((JLONG) 1)<<nbits) - 1; \\\n  CHECKBUF31() \\\n  PUT_BITS(code, size) \\\n  PUT_BITS(temp2, nbits) \\\n }\n\n#else\n\n#define EMIT_BITS(code, size) { \\\n  PUT_BITS(code, size) \\\n  CHECKBUF15() \\\n}\n\n#define EMIT_CODE(code, size) { \\\n  temp2 &= (((JLONG) 1)<<nbits) - 1; \\\n  PUT_BITS(code, size) \\\n  CHECKBUF15() \\\n  PUT_BITS(temp2, nbits) \\\n  CHECKBUF15() \\\n }\n\n#endif\n\n\n/* Although it is exceedingly rare, it is possible for a Huffman-encoded\n * coefficient block to be larger than the 128-byte unencoded block.  For each\n * of the 64 coefficients, PUT_BITS is invoked twice, and each invocation can\n * theoretically store 16 bits (for a maximum of 2048 bits or 256 bytes per\n * encoded block.)  If, for instance, one artificially sets the AC\n * coefficients to alternating values of 32767 and -32768 (using the JPEG\n * scanning order-- 1, 8, 16, etc.), then this will produce an encoded block\n * larger than 200 bytes.\n */\n#define BUFSIZE (DCTSIZE2 * 4)\n\n#define LOAD_BUFFER() { \\\n  if (state->free_in_buffer < BUFSIZE) { \\\n    localbuf = 1; \\\n    buffer = _buffer; \\\n  } \\\n  else buffer = state->next_output_byte; \\\n }\n\n#define STORE_BUFFER() { \\\n  if (localbuf) { \\\n    bytes = buffer - _buffer; \\\n    buffer = _buffer; \\\n    while (bytes > 0) { \\\n      bytestocopy = min(bytes, state->free_in_buffer); \\\n      MEMCOPY(state->next_output_byte, buffer, bytestocopy); \\\n      state->next_output_byte += bytestocopy; \\\n      buffer += bytestocopy; \\\n      state->free_in_buffer -= bytestocopy; \\\n      if (state->free_in_buffer == 0) \\\n        if (! dump_buffer(state)) return FALSE; \\\n      bytes -= bytestocopy; \\\n    } \\\n  } \\\n  else { \\\n    state->free_in_buffer -= (buffer - state->next_output_byte); \\\n    state->next_output_byte = buffer; \\\n  } \\\n }\n\n\nLOCAL(boolean)\nflush_bits (working_state *state)\n{\n  JOCTET _buffer[BUFSIZE], *buffer;\n  size_t put_buffer;  int put_bits;\n  size_t bytes, bytestocopy;  int localbuf = 0;\n\n  put_buffer = state->cur.put_buffer;\n  put_bits = state->cur.put_bits;\n  LOAD_BUFFER()\n\n  /* fill any partial byte with ones */\n  PUT_BITS(0x7F, 7)\n  while (put_bits >= 8) EMIT_BYTE()\n\n  state->cur.put_buffer = 0;    /* and reset bit-buffer to empty */\n  state->cur.put_bits = 0;\n  STORE_BUFFER()\n\n  return TRUE;\n}\n\n\n/* Encode a single block's worth of coefficients */\n\nLOCAL(boolean)\nencode_one_block_simd (working_state *state, JCOEFPTR block, int last_dc_val,\n                       c_derived_tbl *dctbl, c_derived_tbl *actbl)\n{\n  JOCTET _buffer[BUFSIZE], *buffer;\n  size_t bytes, bytestocopy;  int localbuf = 0;\n\n  LOAD_BUFFER()\n\n  buffer = jsimd_huff_encode_one_block(state, buffer, block, last_dc_val,\n                                       dctbl, actbl);\n\n  STORE_BUFFER()\n\n  return TRUE;\n}\n\nLOCAL(boolean)\nencode_one_block (working_state *state, JCOEFPTR block, int last_dc_val,\n                  c_derived_tbl *dctbl, c_derived_tbl *actbl)\n{\n  int temp, temp2, temp3;\n  int nbits;\n  int r, code, size;\n  JOCTET _buffer[BUFSIZE], *buffer;\n  size_t put_buffer;  int put_bits;\n  int code_0xf0 = actbl->ehufco[0xf0], size_0xf0 = actbl->ehufsi[0xf0];\n  size_t bytes, bytestocopy;  int localbuf = 0;\n\n  put_buffer = state->cur.put_buffer;\n  put_bits = state->cur.put_bits;\n  LOAD_BUFFER()\n\n  /* Encode the DC coefficient difference per section F.1.2.1 */\n\n  temp = temp2 = block[0] - last_dc_val;\n\n /* This is a well-known technique for obtaining the absolute value without a\n  * branch.  It is derived from an assembly language technique presented in\n  * \"How to Optimize for the Pentium Processors\", Copyright (c) 1996, 1997 by\n  * Agner Fog.\n  */\n  temp3 = temp >> (CHAR_BIT * sizeof(int) - 1);\n  temp ^= temp3;\n  temp -= temp3;\n\n  /* For a negative input, want temp2 = bitwise complement of abs(input) */\n  /* This code assumes we are on a two's complement machine */\n  temp2 += temp3;\n\n  /* Find the number of bits needed for the magnitude of the coefficient */\n  nbits = JPEG_NBITS(temp);\n\n  /* Emit the Huffman-coded symbol for the number of bits */\n  code = dctbl->ehufco[nbits];\n  size = dctbl->ehufsi[nbits];\n  EMIT_BITS(code, size)\n\n  /* Mask off any extra bits in code */\n  temp2 &= (((JLONG) 1)<<nbits) - 1;\n\n  /* Emit that number of bits of the value, if positive, */\n  /* or the complement of its magnitude, if negative. */\n  EMIT_BITS(temp2, nbits)\n\n  /* Encode the AC coefficients per section F.1.2.2 */\n\n  r = 0;                        /* r = run length of zeros */\n\n/* Manually unroll the k loop to eliminate the counter variable.  This\n * improves performance greatly on systems with a limited number of\n * registers (such as x86.)\n */\n#define kloop(jpeg_natural_order_of_k) {  \\\n  if ((temp = block[jpeg_natural_order_of_k]) == 0) { \\\n    r++; \\\n  } else { \\\n    temp2 = temp; \\\n    /* Branch-less absolute value, bitwise complement, etc., same as above */ \\\n    temp3 = temp >> (CHAR_BIT * sizeof(int) - 1); \\\n    temp ^= temp3; \\\n    temp -= temp3; \\\n    temp2 += temp3; \\\n    nbits = JPEG_NBITS_NONZERO(temp); \\\n    /* if run length > 15, must emit special run-length-16 codes (0xF0) */ \\\n    while (r > 15) { \\\n      EMIT_BITS(code_0xf0, size_0xf0) \\\n      r -= 16; \\\n    } \\\n    /* Emit Huffman symbol for run length / number of bits */ \\\n    temp3 = (r << 4) + nbits;  \\\n    code = actbl->ehufco[temp3]; \\\n    size = actbl->ehufsi[temp3]; \\\n    EMIT_CODE(code, size) \\\n    r = 0;  \\\n  } \\\n}\n\n  /* One iteration for each value in jpeg_natural_order[] */\n  kloop(1);   kloop(8);   kloop(16);  kloop(9);   kloop(2);   kloop(3);\n  kloop(10);  kloop(17);  kloop(24);  kloop(32);  kloop(25);  kloop(18);\n  kloop(11);  kloop(4);   kloop(5);   kloop(12);  kloop(19);  kloop(26);\n  kloop(33);  kloop(40);  kloop(48);  kloop(41);  kloop(34);  kloop(27);\n  kloop(20);  kloop(13);  kloop(6);   kloop(7);   kloop(14);  kloop(21);\n  kloop(28);  kloop(35);  kloop(42);  kloop(49);  kloop(56);  kloop(57);\n  kloop(50);  kloop(43);  kloop(36);  kloop(29);  kloop(22);  kloop(15);\n  kloop(23);  kloop(30);  kloop(37);  kloop(44);  kloop(51);  kloop(58);\n  kloop(59);  kloop(52);  kloop(45);  kloop(38);  kloop(31);  kloop(39);\n  kloop(46);  kloop(53);  kloop(60);  kloop(61);  kloop(54);  kloop(47);\n  kloop(55);  kloop(62);  kloop(63);\n\n  /* If the last coef(s) were zero, emit an end-of-block code */\n  if (r > 0) {\n    code = actbl->ehufco[0];\n    size = actbl->ehufsi[0];\n    EMIT_BITS(code, size)\n  }\n\n  state->cur.put_buffer = put_buffer;\n  state->cur.put_bits = put_bits;\n  STORE_BUFFER()\n\n  return TRUE;\n}\n\n\n/*\n * Emit a restart marker & resynchronize predictions.\n */\n\nLOCAL(boolean)\nemit_restart (working_state *state, int restart_num)\n{\n  int ci;\n\n  if (! flush_bits(state))\n    return FALSE;\n\n  emit_byte(state, 0xFF, return FALSE);\n  emit_byte(state, JPEG_RST0 + restart_num, return FALSE);\n\n  /* Re-initialize DC predictions to 0 */\n  for (ci = 0; ci < state->cinfo->comps_in_scan; ci++)\n    state->cur.last_dc_val[ci] = 0;\n\n  /* The restart counter is not updated until we successfully write the MCU. */\n\n  return TRUE;\n}\n\n\n/*\n * Encode and output one MCU's worth of Huffman-compressed coefficients.\n */\n\nMETHODDEF(boolean)\nencode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  working_state state;\n  int blkn, ci;\n  jpeg_component_info *compptr;\n\n  /* Load up working state */\n  state.next_output_byte = cinfo->dest->next_output_byte;\n  state.free_in_buffer = cinfo->dest->free_in_buffer;\n  ASSIGN_STATE(state.cur, entropy->saved);\n  state.cinfo = cinfo;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! emit_restart(&state, entropy->next_restart_num))\n        return FALSE;\n  }\n\n  /* Encode the MCU data blocks */\n  if (entropy->simd) {\n    for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n      ci = cinfo->MCU_membership[blkn];\n      compptr = cinfo->cur_comp_info[ci];\n      if (! encode_one_block_simd(&state,\n                                  MCU_data[blkn][0], state.cur.last_dc_val[ci],\n                                  entropy->dc_derived_tbls[compptr->dc_tbl_no],\n                                  entropy->ac_derived_tbls[compptr->ac_tbl_no]))\n        return FALSE;\n      /* Update last_dc_val */\n      state.cur.last_dc_val[ci] = MCU_data[blkn][0][0];\n    }\n  } else {\n    for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n      ci = cinfo->MCU_membership[blkn];\n      compptr = cinfo->cur_comp_info[ci];\n      if (! encode_one_block(&state,\n                             MCU_data[blkn][0], state.cur.last_dc_val[ci],\n                             entropy->dc_derived_tbls[compptr->dc_tbl_no],\n                             entropy->ac_derived_tbls[compptr->ac_tbl_no]))\n        return FALSE;\n      /* Update last_dc_val */\n      state.cur.last_dc_val[ci] = MCU_data[blkn][0][0];\n    }\n  }\n\n  /* Completed MCU, so update state */\n  cinfo->dest->next_output_byte = state.next_output_byte;\n  cinfo->dest->free_in_buffer = state.free_in_buffer;\n  ASSIGN_STATE(entropy->saved, state.cur);\n\n  /* Update restart-interval state too */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Finish up at the end of a Huffman-compressed scan.\n */\n\nMETHODDEF(void)\nfinish_pass_huff (j_compress_ptr cinfo)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  working_state state;\n\n  /* Load up working state ... flush_bits needs it */\n  state.next_output_byte = cinfo->dest->next_output_byte;\n  state.free_in_buffer = cinfo->dest->free_in_buffer;\n  ASSIGN_STATE(state.cur, entropy->saved);\n  state.cinfo = cinfo;\n\n  /* Flush out the last data */\n  if (! flush_bits(&state))\n    ERREXIT(cinfo, JERR_CANT_SUSPEND);\n\n  /* Update state */\n  cinfo->dest->next_output_byte = state.next_output_byte;\n  cinfo->dest->free_in_buffer = state.free_in_buffer;\n  ASSIGN_STATE(entropy->saved, state.cur);\n}\n\n\n/*\n * Huffman coding optimization.\n *\n * We first scan the supplied data and count the number of uses of each symbol\n * that is to be Huffman-coded. (This process MUST agree with the code above.)\n * Then we build a Huffman coding tree for the observed counts.\n * Symbols which are not needed at all for the particular image are not\n * assigned any code, which saves space in the DHT marker as well as in\n * the compressed data.\n */\n\n#ifdef ENTROPY_OPT_SUPPORTED\n\n\n/* Process a single block's worth of coefficients */\n\nLOCAL(void)\nhtest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,\n                 long dc_counts[], long ac_counts[])\n{\n  register int temp;\n  register int nbits;\n  register int k, r;\n\n  /* Encode the DC coefficient difference per section F.1.2.1 */\n\n  temp = block[0] - last_dc_val;\n  if (temp < 0)\n    temp = -temp;\n\n  /* Find the number of bits needed for the magnitude of the coefficient */\n  nbits = 0;\n  while (temp) {\n    nbits++;\n    temp >>= 1;\n  }\n  /* Check for out-of-range coefficient values.\n   * Since we're encoding a difference, the range limit is twice as much.\n   */\n  if (nbits > MAX_COEF_BITS+1)\n    ERREXIT(cinfo, JERR_BAD_DCT_COEF);\n\n  /* Count the Huffman symbol for the number of bits */\n  dc_counts[nbits]++;\n\n  /* Encode the AC coefficients per section F.1.2.2 */\n\n  r = 0;                        /* r = run length of zeros */\n\n  for (k = 1; k < DCTSIZE2; k++) {\n    if ((temp = block[jpeg_natural_order[k]]) == 0) {\n      r++;\n    } else {\n      /* if run length > 15, must emit special run-length-16 codes (0xF0) */\n      while (r > 15) {\n        ac_counts[0xF0]++;\n        r -= 16;\n      }\n\n      /* Find the number of bits needed for the magnitude of the coefficient */\n      if (temp < 0)\n        temp = -temp;\n\n      /* Find the number of bits needed for the magnitude of the coefficient */\n      nbits = 1;                /* there must be at least one 1 bit */\n      while ((temp >>= 1))\n        nbits++;\n      /* Check for out-of-range coefficient values */\n      if (nbits > MAX_COEF_BITS)\n        ERREXIT(cinfo, JERR_BAD_DCT_COEF);\n\n      /* Count Huffman symbol for run length / number of bits */\n      ac_counts[(r << 4) + nbits]++;\n\n      r = 0;\n    }\n  }\n\n  /* If the last coef(s) were zero, emit an end-of-block code */\n  if (r > 0)\n    ac_counts[0]++;\n}\n\n\n/*\n * Trial-encode one MCU's worth of Huffman-compressed coefficients.\n * No data is actually output, so no suspension return is possible.\n */\n\nMETHODDEF(boolean)\nencode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int blkn, ci;\n  jpeg_component_info *compptr;\n\n  /* Take care of restart intervals if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      /* Re-initialize DC predictions to 0 */\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++)\n        entropy->saved.last_dc_val[ci] = 0;\n      /* Update restart state */\n      entropy->restarts_to_go = cinfo->restart_interval;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    ci = cinfo->MCU_membership[blkn];\n    compptr = cinfo->cur_comp_info[ci];\n    htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci],\n                    entropy->dc_count_ptrs[compptr->dc_tbl_no],\n                    entropy->ac_count_ptrs[compptr->ac_tbl_no]);\n    entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0];\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Generate the best Huffman code table for the given counts, fill htbl.\n * Note this is also used by jcphuff.c.\n *\n * The JPEG standard requires that no symbol be assigned a codeword of all\n * one bits (so that padding bits added at the end of a compressed segment\n * can't look like a valid code).  Because of the canonical ordering of\n * codewords, this just means that there must be an unused slot in the\n * longest codeword length category.  Section K.2 of the JPEG spec suggests\n * reserving such a slot by pretending that symbol 256 is a valid symbol\n * with count 1.  In theory that's not optimal; giving it count zero but\n * including it in the symbol set anyway should give a better Huffman code.\n * But the theoretically better code actually seems to come out worse in\n * practice, because it produces more all-ones bytes (which incur stuffed\n * zero bytes in the final file).  In any case the difference is tiny.\n *\n * The JPEG standard requires Huffman codes to be no more than 16 bits long.\n * If some symbols have a very small but nonzero probability, the Huffman tree\n * must be adjusted to meet the code length restriction.  We currently use\n * the adjustment method suggested in JPEG section K.2.  This method is *not*\n * optimal; it may not choose the best possible limited-length code.  But\n * typically only very-low-frequency symbols will be given less-than-optimal\n * lengths, so the code is almost optimal.  Experimental comparisons against\n * an optimal limited-length-code algorithm indicate that the difference is\n * microscopic --- usually less than a hundredth of a percent of total size.\n * So the extra complexity of an optimal algorithm doesn't seem worthwhile.\n */\n\nGLOBAL(void)\njpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL *htbl, long freq[])\n{\n#define MAX_CLEN 32             /* assumed maximum initial code length */\n  UINT8 bits[MAX_CLEN+1];       /* bits[k] = # of symbols with code length k */\n  int codesize[257];            /* codesize[k] = code length of symbol k */\n  int others[257];              /* next symbol in current branch of tree */\n  int c1, c2;\n  int p, i, j;\n  long v;\n\n  /* This algorithm is explained in section K.2 of the JPEG standard */\n\n  MEMZERO(bits, sizeof(bits));\n  MEMZERO(codesize, sizeof(codesize));\n  for (i = 0; i < 257; i++)\n    others[i] = -1;             /* init links to empty */\n\n  freq[256] = 1;                /* make sure 256 has a nonzero count */\n  /* Including the pseudo-symbol 256 in the Huffman procedure guarantees\n   * that no real symbol is given code-value of all ones, because 256\n   * will be placed last in the largest codeword category.\n   */\n\n  /* Huffman's basic algorithm to assign optimal code lengths to symbols */\n\n  for (;;) {\n    /* Find the smallest nonzero frequency, set c1 = its symbol */\n    /* In case of ties, take the larger symbol number */\n    c1 = -1;\n    v = 1000000000L;\n    for (i = 0; i <= 256; i++) {\n      if (freq[i] && freq[i] <= v) {\n        v = freq[i];\n        c1 = i;\n      }\n    }\n\n    /* Find the next smallest nonzero frequency, set c2 = its symbol */\n    /* In case of ties, take the larger symbol number */\n    c2 = -1;\n    v = 1000000000L;\n    for (i = 0; i <= 256; i++) {\n      if (freq[i] && freq[i] <= v && i != c1) {\n        v = freq[i];\n        c2 = i;\n      }\n    }\n\n    /* Done if we've merged everything into one frequency */\n    if (c2 < 0)\n      break;\n\n    /* Else merge the two counts/trees */\n    freq[c1] += freq[c2];\n    freq[c2] = 0;\n\n    /* Increment the codesize of everything in c1's tree branch */\n    codesize[c1]++;\n    while (others[c1] >= 0) {\n      c1 = others[c1];\n      codesize[c1]++;\n    }\n\n    others[c1] = c2;            /* chain c2 onto c1's tree branch */\n\n    /* Increment the codesize of everything in c2's tree branch */\n    codesize[c2]++;\n    while (others[c2] >= 0) {\n      c2 = others[c2];\n      codesize[c2]++;\n    }\n  }\n\n  /* Now count the number of symbols of each code length */\n  for (i = 0; i <= 256; i++) {\n    if (codesize[i]) {\n      /* The JPEG standard seems to think that this can't happen, */\n      /* but I'm paranoid... */\n      if (codesize[i] > MAX_CLEN)\n        ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW);\n\n      bits[codesize[i]]++;\n    }\n  }\n\n  /* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure\n   * Huffman procedure assigned any such lengths, we must adjust the coding.\n   * Here is what the JPEG spec says about how this next bit works:\n   * Since symbols are paired for the longest Huffman code, the symbols are\n   * removed from this length category two at a time.  The prefix for the pair\n   * (which is one bit shorter) is allocated to one of the pair; then,\n   * skipping the BITS entry for that prefix length, a code word from the next\n   * shortest nonzero BITS entry is converted into a prefix for two code words\n   * one bit longer.\n   */\n\n  for (i = MAX_CLEN; i > 16; i--) {\n    while (bits[i] > 0) {\n      j = i - 2;                /* find length of new prefix to be used */\n      while (bits[j] == 0)\n        j--;\n\n      bits[i] -= 2;             /* remove two symbols */\n      bits[i-1]++;              /* one goes in this length */\n      bits[j+1] += 2;           /* two new symbols in this length */\n      bits[j]--;                /* symbol of this length is now a prefix */\n    }\n  }\n\n  /* Remove the count for the pseudo-symbol 256 from the largest codelength */\n  while (bits[i] == 0)          /* find largest codelength still in use */\n    i--;\n  bits[i]--;\n\n  /* Return final symbol counts (only for lengths 0..16) */\n  MEMCOPY(htbl->bits, bits, sizeof(htbl->bits));\n\n  /* Return a list of the symbols sorted by code length */\n  /* It's not real clear to me why we don't need to consider the codelength\n   * changes made above, but the JPEG spec seems to think this works.\n   */\n  p = 0;\n  for (i = 1; i <= MAX_CLEN; i++) {\n    for (j = 0; j <= 255; j++) {\n      if (codesize[j] == i) {\n        htbl->huffval[p] = (UINT8) j;\n        p++;\n      }\n    }\n  }\n\n  /* Set sent_table FALSE so updated table will be written to JPEG file. */\n  htbl->sent_table = FALSE;\n}\n\n\n/*\n * Finish up a statistics-gathering pass and create the new Huffman tables.\n */\n\nMETHODDEF(void)\nfinish_pass_gather (j_compress_ptr cinfo)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int ci, dctbl, actbl;\n  jpeg_component_info *compptr;\n  JHUFF_TBL **htblptr;\n  boolean did_dc[NUM_HUFF_TBLS];\n  boolean did_ac[NUM_HUFF_TBLS];\n\n  /* It's important not to apply jpeg_gen_optimal_table more than once\n   * per table, because it clobbers the input frequency counts!\n   */\n  MEMZERO(did_dc, sizeof(did_dc));\n  MEMZERO(did_ac, sizeof(did_ac));\n\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    dctbl = compptr->dc_tbl_no;\n    actbl = compptr->ac_tbl_no;\n    if (! did_dc[dctbl]) {\n      htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl];\n      if (*htblptr == NULL)\n        *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);\n      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]);\n      did_dc[dctbl] = TRUE;\n    }\n    if (! did_ac[actbl]) {\n      htblptr = & cinfo->ac_huff_tbl_ptrs[actbl];\n      if (*htblptr == NULL)\n        *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);\n      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]);\n      did_ac[actbl] = TRUE;\n    }\n  }\n}\n\n\n#endif /* ENTROPY_OPT_SUPPORTED */\n\n\n/*\n * Module initialization routine for Huffman entropy encoding.\n */\n\nGLOBAL(void)\njinit_huff_encoder (j_compress_ptr cinfo)\n{\n  huff_entropy_ptr entropy;\n  int i;\n\n  entropy = (huff_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(huff_entropy_encoder));\n  cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;\n  entropy->pub.start_pass = start_pass_huff;\n\n  /* Mark tables unallocated */\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;\n#ifdef ENTROPY_OPT_SUPPORTED\n    entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL;\n#endif\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jchuff.h",
    "content": "/*\n * jchuff.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains declarations for Huffman entropy encoding routines\n * that are shared between the sequential encoder (jchuff.c) and the\n * progressive encoder (jcphuff.c).  No other modules need to see these.\n */\n\n/* The legal range of a DCT coefficient is\n *  -1024 .. +1023  for 8-bit data;\n * -16384 .. +16383 for 12-bit data.\n * Hence the magnitude should always fit in 10 or 14 bits respectively.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define MAX_COEF_BITS 10\n#else\n#define MAX_COEF_BITS 14\n#endif\n\n/* Derived data constructed for each Huffman table */\n\ntypedef struct {\n  unsigned int ehufco[256];     /* code for each symbol */\n  char ehufsi[256];             /* length of code for each symbol */\n  /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */\n} c_derived_tbl;\n\n/* Expand a Huffman table definition into the derived format */\nEXTERN(void) jpeg_make_c_derived_tbl\n        (j_compress_ptr cinfo, boolean isDC, int tblno,\n         c_derived_tbl ** pdtbl);\n\n/* Generate an optimal table definition given the specified counts */\nEXTERN(void) jpeg_gen_optimal_table\n        (j_compress_ptr cinfo, JHUFF_TBL *htbl, long freq[]);\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jcinit.c",
    "content": "/*\n * jcinit.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains initialization logic for the JPEG compressor.\n * This routine is in charge of selecting the modules to be executed and\n * making an initialization call to each one.\n *\n * Logically, this code belongs in jcmaster.c.  It's split out because\n * linking this routine implies linking the entire compression library.\n * For a transcoding-only application, we want to be able to use jcmaster.c\n * without linking in the whole library.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Master selection of compression modules.\n * This is done once at the start of processing an image.  We determine\n * which modules will be used and give them appropriate initialization calls.\n */\n\nGLOBAL(void)\njinit_compress_master (j_compress_ptr cinfo)\n{\n  /* Initialize master control (includes parameter checking/processing) */\n  jinit_c_master_control(cinfo, FALSE /* full compression */);\n\n  /* Preprocessing */\n  if (! cinfo->raw_data_in) {\n    jinit_color_converter(cinfo);\n    jinit_downsampler(cinfo);\n    jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */);\n  }\n  /* Forward DCT */\n  jinit_forward_dct(cinfo);\n  /* Entropy encoding: either Huffman or arithmetic coding. */\n  if (cinfo->arith_code) {\n#ifdef C_ARITH_CODING_SUPPORTED\n    jinit_arith_encoder(cinfo);\n#else\n    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);\n#endif\n  } else {\n    if (cinfo->progressive_mode) {\n#ifdef C_PROGRESSIVE_SUPPORTED\n      jinit_phuff_encoder(cinfo);\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    } else\n      jinit_huff_encoder(cinfo);\n  }\n\n  /* Need a full-image coefficient buffer in any multi-pass mode. */\n  jinit_c_coef_controller(cinfo,\n                (boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding));\n  jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);\n\n  jinit_marker_writer(cinfo);\n\n  /* We can now tell the memory manager to allocate virtual arrays. */\n  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);\n\n  /* Write the datastream header (SOI) immediately.\n   * Frame and scan headers are postponed till later.\n   * This lets application insert special markers after the SOI.\n   */\n  (*cinfo->marker->write_file_header) (cinfo);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jcmainct.c",
    "content": "/*\n * jcmainct.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains the main buffer controller for compression.\n * The main buffer lies between the pre-processor and the JPEG\n * compressor proper; it holds downsampled data in the JPEG colorspace.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_c_main_controller pub; /* public fields */\n\n  JDIMENSION cur_iMCU_row;      /* number of current iMCU row */\n  JDIMENSION rowgroup_ctr;      /* counts row groups received in iMCU row */\n  boolean suspended;            /* remember if we suspended output */\n  J_BUF_MODE pass_mode;         /* current operating mode */\n\n  /* If using just a strip buffer, this points to the entire set of buffers\n   * (we allocate one for each component).  In the full-image case, this\n   * points to the currently accessible strips of the virtual arrays.\n   */\n  JSAMPARRAY buffer[MAX_COMPONENTS];\n} my_main_controller;\n\ntypedef my_main_controller *my_main_ptr;\n\n\n/* Forward declarations */\nMETHODDEF(void) process_data_simple_main\n        (j_compress_ptr cinfo, JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,\n         JDIMENSION in_rows_avail);\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n\n  /* Do nothing in raw-data mode. */\n  if (cinfo->raw_data_in)\n    return;\n\n  if (pass_mode != JBUF_PASS_THRU)\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n\n  main_ptr->cur_iMCU_row = 0;   /* initialize counters */\n  main_ptr->rowgroup_ctr = 0;\n  main_ptr->suspended = FALSE;\n  main_ptr->pass_mode = pass_mode;      /* save mode for use by process_data */\n  main_ptr->pub.process_data = process_data_simple_main;\n}\n\n\n/*\n * Process some data.\n * This routine handles the simple pass-through mode,\n * where we have only a strip buffer.\n */\n\nMETHODDEF(void)\nprocess_data_simple_main (j_compress_ptr cinfo,\n                          JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,\n                          JDIMENSION in_rows_avail)\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n\n  while (main_ptr->cur_iMCU_row < cinfo->total_iMCU_rows) {\n    /* Read input data if we haven't filled the main buffer yet */\n    if (main_ptr->rowgroup_ctr < DCTSIZE)\n      (*cinfo->prep->pre_process_data) (cinfo,\n                                        input_buf, in_row_ctr, in_rows_avail,\n                                        main_ptr->buffer, &main_ptr->rowgroup_ctr,\n                                        (JDIMENSION) DCTSIZE);\n\n    /* If we don't have a full iMCU row buffered, return to application for\n     * more data.  Note that preprocessor will always pad to fill the iMCU row\n     * at the bottom of the image.\n     */\n    if (main_ptr->rowgroup_ctr != DCTSIZE)\n      return;\n\n    /* Send the completed row to the compressor */\n    if (! (*cinfo->coef->compress_data) (cinfo, main_ptr->buffer)) {\n      /* If compressor did not consume the whole row, then we must need to\n       * suspend processing and return to the application.  In this situation\n       * we pretend we didn't yet consume the last input row; otherwise, if\n       * it happened to be the last row of the image, the application would\n       * think we were done.\n       */\n      if (! main_ptr->suspended) {\n        (*in_row_ctr)--;\n        main_ptr->suspended = TRUE;\n      }\n      return;\n    }\n    /* We did finish the row.  Undo our little suspension hack if a previous\n     * call suspended; then mark the main buffer empty.\n     */\n    if (main_ptr->suspended) {\n      (*in_row_ctr)++;\n      main_ptr->suspended = FALSE;\n    }\n    main_ptr->rowgroup_ctr = 0;\n    main_ptr->cur_iMCU_row++;\n  }\n}\n\n\n/*\n * Initialize main buffer controller.\n */\n\nGLOBAL(void)\njinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)\n{\n  my_main_ptr main_ptr;\n  int ci;\n  jpeg_component_info *compptr;\n\n  main_ptr = (my_main_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_main_controller));\n  cinfo->main = (struct jpeg_c_main_controller *) main_ptr;\n  main_ptr->pub.start_pass = start_pass_main;\n\n  /* We don't need to create a buffer in raw-data mode. */\n  if (cinfo->raw_data_in)\n    return;\n\n  /* Create the buffer.  It holds downsampled data, so each component\n   * may be of a different size.\n   */\n  if (need_full_buffer) {\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n  } else {\n    /* Allocate a strip buffer for each component */\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n         ci++, compptr++) {\n      main_ptr->buffer[ci] = (*cinfo->mem->alloc_sarray)\n        ((j_common_ptr) cinfo, JPOOL_IMAGE,\n         compptr->width_in_blocks * DCTSIZE,\n         (JDIMENSION) (compptr->v_samp_factor * DCTSIZE));\n    }\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jcmarker.c",
    "content": "/*\n * jcmarker.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2003-2010 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains routines to write JPEG datastream markers.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jpegcomp.h\"\n\n\ntypedef enum {                  /* JPEG marker codes */\n  M_SOF0  = 0xc0,\n  M_SOF1  = 0xc1,\n  M_SOF2  = 0xc2,\n  M_SOF3  = 0xc3,\n\n  M_SOF5  = 0xc5,\n  M_SOF6  = 0xc6,\n  M_SOF7  = 0xc7,\n\n  M_JPG   = 0xc8,\n  M_SOF9  = 0xc9,\n  M_SOF10 = 0xca,\n  M_SOF11 = 0xcb,\n\n  M_SOF13 = 0xcd,\n  M_SOF14 = 0xce,\n  M_SOF15 = 0xcf,\n\n  M_DHT   = 0xc4,\n\n  M_DAC   = 0xcc,\n\n  M_RST0  = 0xd0,\n  M_RST1  = 0xd1,\n  M_RST2  = 0xd2,\n  M_RST3  = 0xd3,\n  M_RST4  = 0xd4,\n  M_RST5  = 0xd5,\n  M_RST6  = 0xd6,\n  M_RST7  = 0xd7,\n\n  M_SOI   = 0xd8,\n  M_EOI   = 0xd9,\n  M_SOS   = 0xda,\n  M_DQT   = 0xdb,\n  M_DNL   = 0xdc,\n  M_DRI   = 0xdd,\n  M_DHP   = 0xde,\n  M_EXP   = 0xdf,\n\n  M_APP0  = 0xe0,\n  M_APP1  = 0xe1,\n  M_APP2  = 0xe2,\n  M_APP3  = 0xe3,\n  M_APP4  = 0xe4,\n  M_APP5  = 0xe5,\n  M_APP6  = 0xe6,\n  M_APP7  = 0xe7,\n  M_APP8  = 0xe8,\n  M_APP9  = 0xe9,\n  M_APP10 = 0xea,\n  M_APP11 = 0xeb,\n  M_APP12 = 0xec,\n  M_APP13 = 0xed,\n  M_APP14 = 0xee,\n  M_APP15 = 0xef,\n\n  M_JPG0  = 0xf0,\n  M_JPG13 = 0xfd,\n  M_COM   = 0xfe,\n\n  M_TEM   = 0x01,\n\n  M_ERROR = 0x100\n} JPEG_MARKER;\n\n\n/* Private state */\n\ntypedef struct {\n  struct jpeg_marker_writer pub; /* public fields */\n\n  unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */\n} my_marker_writer;\n\ntypedef my_marker_writer *my_marker_ptr;\n\n\n/*\n * Basic output routines.\n *\n * Note that we do not support suspension while writing a marker.\n * Therefore, an application using suspension must ensure that there is\n * enough buffer space for the initial markers (typ. 600-700 bytes) before\n * calling jpeg_start_compress, and enough space to write the trailing EOI\n * (a few bytes) before calling jpeg_finish_compress.  Multipass compression\n * modes are not supported at all with suspension, so those two are the only\n * points where markers will be written.\n */\n\nLOCAL(void)\nemit_byte (j_compress_ptr cinfo, int val)\n/* Emit a byte */\n{\n  struct jpeg_destination_mgr *dest = cinfo->dest;\n\n  *(dest->next_output_byte)++ = (JOCTET) val;\n  if (--dest->free_in_buffer == 0) {\n    if (! (*dest->empty_output_buffer) (cinfo))\n      ERREXIT(cinfo, JERR_CANT_SUSPEND);\n  }\n}\n\n\nLOCAL(void)\nemit_marker (j_compress_ptr cinfo, JPEG_MARKER mark)\n/* Emit a marker code */\n{\n  emit_byte(cinfo, 0xFF);\n  emit_byte(cinfo, (int) mark);\n}\n\n\nLOCAL(void)\nemit_2bytes (j_compress_ptr cinfo, int value)\n/* Emit a 2-byte integer; these are always MSB first in JPEG files */\n{\n  emit_byte(cinfo, (value >> 8) & 0xFF);\n  emit_byte(cinfo, value & 0xFF);\n}\n\n\n/*\n * Routines to write specific marker types.\n */\n\nLOCAL(int)\nemit_dqt (j_compress_ptr cinfo, int index)\n/* Emit a DQT marker */\n/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */\n{\n  JQUANT_TBL *qtbl = cinfo->quant_tbl_ptrs[index];\n  int prec;\n  int i;\n\n  if (qtbl == NULL)\n    ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index);\n\n  prec = 0;\n  for (i = 0; i < DCTSIZE2; i++) {\n    if (qtbl->quantval[i] > 255)\n      prec = 1;\n  }\n\n  if (! qtbl->sent_table) {\n    emit_marker(cinfo, M_DQT);\n\n    emit_2bytes(cinfo, prec ? DCTSIZE2*2 + 1 + 2 : DCTSIZE2 + 1 + 2);\n\n    emit_byte(cinfo, index + (prec<<4));\n\n    for (i = 0; i < DCTSIZE2; i++) {\n      /* The table entries must be emitted in zigzag order. */\n      unsigned int qval = qtbl->quantval[jpeg_natural_order[i]];\n      if (prec)\n        emit_byte(cinfo, (int) (qval >> 8));\n      emit_byte(cinfo, (int) (qval & 0xFF));\n    }\n\n    qtbl->sent_table = TRUE;\n  }\n\n  return prec;\n}\n\n\nLOCAL(void)\nemit_dht (j_compress_ptr cinfo, int index, boolean is_ac)\n/* Emit a DHT marker */\n{\n  JHUFF_TBL *htbl;\n  int length, i;\n\n  if (is_ac) {\n    htbl = cinfo->ac_huff_tbl_ptrs[index];\n    index += 0x10;              /* output index has AC bit set */\n  } else {\n    htbl = cinfo->dc_huff_tbl_ptrs[index];\n  }\n\n  if (htbl == NULL)\n    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index);\n\n  if (! htbl->sent_table) {\n    emit_marker(cinfo, M_DHT);\n\n    length = 0;\n    for (i = 1; i <= 16; i++)\n      length += htbl->bits[i];\n\n    emit_2bytes(cinfo, length + 2 + 1 + 16);\n    emit_byte(cinfo, index);\n\n    for (i = 1; i <= 16; i++)\n      emit_byte(cinfo, htbl->bits[i]);\n\n    for (i = 0; i < length; i++)\n      emit_byte(cinfo, htbl->huffval[i]);\n\n    htbl->sent_table = TRUE;\n  }\n}\n\n\nLOCAL(void)\nemit_dac (j_compress_ptr cinfo)\n/* Emit a DAC marker */\n/* Since the useful info is so small, we want to emit all the tables in */\n/* one DAC marker.  Therefore this routine does its own scan of the table. */\n{\n#ifdef C_ARITH_CODING_SUPPORTED\n  char dc_in_use[NUM_ARITH_TBLS];\n  char ac_in_use[NUM_ARITH_TBLS];\n  int length, i;\n  jpeg_component_info *compptr;\n\n  for (i = 0; i < NUM_ARITH_TBLS; i++)\n    dc_in_use[i] = ac_in_use[i] = 0;\n\n  for (i = 0; i < cinfo->comps_in_scan; i++) {\n    compptr = cinfo->cur_comp_info[i];\n    /* DC needs no table for refinement scan */\n    if (cinfo->Ss == 0 && cinfo->Ah == 0)\n      dc_in_use[compptr->dc_tbl_no] = 1;\n    /* AC needs no table when not present */\n    if (cinfo->Se)\n      ac_in_use[compptr->ac_tbl_no] = 1;\n  }\n\n  length = 0;\n  for (i = 0; i < NUM_ARITH_TBLS; i++)\n    length += dc_in_use[i] + ac_in_use[i];\n\n  if (length) {\n    emit_marker(cinfo, M_DAC);\n\n    emit_2bytes(cinfo, length*2 + 2);\n\n    for (i = 0; i < NUM_ARITH_TBLS; i++) {\n      if (dc_in_use[i]) {\n        emit_byte(cinfo, i);\n        emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));\n      }\n      if (ac_in_use[i]) {\n        emit_byte(cinfo, i + 0x10);\n        emit_byte(cinfo, cinfo->arith_ac_K[i]);\n      }\n    }\n  }\n#endif /* C_ARITH_CODING_SUPPORTED */\n}\n\n\nLOCAL(void)\nemit_dri (j_compress_ptr cinfo)\n/* Emit a DRI marker */\n{\n  emit_marker(cinfo, M_DRI);\n\n  emit_2bytes(cinfo, 4);        /* fixed length */\n\n  emit_2bytes(cinfo, (int) cinfo->restart_interval);\n}\n\n\nLOCAL(void)\nemit_sof (j_compress_ptr cinfo, JPEG_MARKER code)\n/* Emit a SOF marker */\n{\n  int ci;\n  jpeg_component_info *compptr;\n\n  emit_marker(cinfo, code);\n\n  emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */\n\n  /* Make sure image isn't bigger than SOF field can handle */\n  if ((long) cinfo->_jpeg_height > 65535L ||\n      (long) cinfo->_jpeg_width > 65535L)\n    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535);\n\n  emit_byte(cinfo, cinfo->data_precision);\n  emit_2bytes(cinfo, (int) cinfo->_jpeg_height);\n  emit_2bytes(cinfo, (int) cinfo->_jpeg_width);\n\n  emit_byte(cinfo, cinfo->num_components);\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    emit_byte(cinfo, compptr->component_id);\n    emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor);\n    emit_byte(cinfo, compptr->quant_tbl_no);\n  }\n}\n\n\nLOCAL(void)\nemit_sos (j_compress_ptr cinfo)\n/* Emit a SOS marker */\n{\n  int i, td, ta;\n  jpeg_component_info *compptr;\n\n  emit_marker(cinfo, M_SOS);\n\n  emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */\n\n  emit_byte(cinfo, cinfo->comps_in_scan);\n\n  for (i = 0; i < cinfo->comps_in_scan; i++) {\n    compptr = cinfo->cur_comp_info[i];\n    emit_byte(cinfo, compptr->component_id);\n\n    /* We emit 0 for unused field(s); this is recommended by the P&M text\n     * but does not seem to be specified in the standard.\n     */\n\n    /* DC needs no table for refinement scan */\n    td = cinfo->Ss == 0 && cinfo->Ah == 0 ? compptr->dc_tbl_no : 0;\n    /* AC needs no table when not present */\n    ta = cinfo->Se ? compptr->ac_tbl_no : 0;\n\n    emit_byte(cinfo, (td << 4) + ta);\n  }\n\n  emit_byte(cinfo, cinfo->Ss);\n  emit_byte(cinfo, cinfo->Se);\n  emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al);\n}\n\n\nLOCAL(void)\nemit_jfif_app0 (j_compress_ptr cinfo)\n/* Emit a JFIF-compliant APP0 marker */\n{\n  /*\n   * Length of APP0 block       (2 bytes)\n   * Block ID                   (4 bytes - ASCII \"JFIF\")\n   * Zero byte                  (1 byte to terminate the ID string)\n   * Version Major, Minor       (2 bytes - major first)\n   * Units                      (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)\n   * Xdpu                       (2 bytes - dots per unit horizontal)\n   * Ydpu                       (2 bytes - dots per unit vertical)\n   * Thumbnail X size           (1 byte)\n   * Thumbnail Y size           (1 byte)\n   */\n\n  emit_marker(cinfo, M_APP0);\n\n  emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */\n\n  emit_byte(cinfo, 0x4A);       /* Identifier: ASCII \"JFIF\" */\n  emit_byte(cinfo, 0x46);\n  emit_byte(cinfo, 0x49);\n  emit_byte(cinfo, 0x46);\n  emit_byte(cinfo, 0);\n  emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */\n  emit_byte(cinfo, cinfo->JFIF_minor_version);\n  emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */\n  emit_2bytes(cinfo, (int) cinfo->X_density);\n  emit_2bytes(cinfo, (int) cinfo->Y_density);\n  emit_byte(cinfo, 0);          /* No thumbnail image */\n  emit_byte(cinfo, 0);\n}\n\n\nLOCAL(void)\nemit_adobe_app14 (j_compress_ptr cinfo)\n/* Emit an Adobe APP14 marker */\n{\n  /*\n   * Length of APP14 block      (2 bytes)\n   * Block ID                   (5 bytes - ASCII \"Adobe\")\n   * Version Number             (2 bytes - currently 100)\n   * Flags0                     (2 bytes - currently 0)\n   * Flags1                     (2 bytes - currently 0)\n   * Color transform            (1 byte)\n   *\n   * Although Adobe TN 5116 mentions Version = 101, all the Adobe files\n   * now in circulation seem to use Version = 100, so that's what we write.\n   *\n   * We write the color transform byte as 1 if the JPEG color space is\n   * YCbCr, 2 if it's YCCK, 0 otherwise.  Adobe's definition has to do with\n   * whether the encoder performed a transformation, which is pretty useless.\n   */\n\n  emit_marker(cinfo, M_APP14);\n\n  emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */\n\n  emit_byte(cinfo, 0x41);       /* Identifier: ASCII \"Adobe\" */\n  emit_byte(cinfo, 0x64);\n  emit_byte(cinfo, 0x6F);\n  emit_byte(cinfo, 0x62);\n  emit_byte(cinfo, 0x65);\n  emit_2bytes(cinfo, 100);      /* Version */\n  emit_2bytes(cinfo, 0);        /* Flags0 */\n  emit_2bytes(cinfo, 0);        /* Flags1 */\n  switch (cinfo->jpeg_color_space) {\n  case JCS_YCbCr:\n    emit_byte(cinfo, 1);        /* Color transform = 1 */\n    break;\n  case JCS_YCCK:\n    emit_byte(cinfo, 2);        /* Color transform = 2 */\n    break;\n  default:\n    emit_byte(cinfo, 0);        /* Color transform = 0 */\n    break;\n  }\n}\n\n\n/*\n * These routines allow writing an arbitrary marker with parameters.\n * The only intended use is to emit COM or APPn markers after calling\n * write_file_header and before calling write_frame_header.\n * Other uses are not guaranteed to produce desirable results.\n * Counting the parameter bytes properly is the caller's responsibility.\n */\n\nMETHODDEF(void)\nwrite_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen)\n/* Emit an arbitrary marker header */\n{\n  if (datalen > (unsigned int) 65533)           /* safety check */\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  emit_marker(cinfo, (JPEG_MARKER) marker);\n\n  emit_2bytes(cinfo, (int) (datalen + 2));      /* total length */\n}\n\nMETHODDEF(void)\nwrite_marker_byte (j_compress_ptr cinfo, int val)\n/* Emit one byte of marker parameters following write_marker_header */\n{\n  emit_byte(cinfo, val);\n}\n\n\n/*\n * Write datastream header.\n * This consists of an SOI and optional APPn markers.\n * We recommend use of the JFIF marker, but not the Adobe marker,\n * when using YCbCr or grayscale data.  The JFIF marker should NOT\n * be used for any other JPEG colorspace.  The Adobe marker is helpful\n * to distinguish RGB, CMYK, and YCCK colorspaces.\n * Note that an application can write additional header markers after\n * jpeg_start_compress returns.\n */\n\nMETHODDEF(void)\nwrite_file_header (j_compress_ptr cinfo)\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n\n  emit_marker(cinfo, M_SOI);    /* first the SOI */\n\n  /* SOI is defined to reset restart interval to 0 */\n  marker->last_restart_interval = 0;\n\n  if (cinfo->write_JFIF_header) /* next an optional JFIF APP0 */\n    emit_jfif_app0(cinfo);\n  if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */\n    emit_adobe_app14(cinfo);\n}\n\n\n/*\n * Write frame header.\n * This consists of DQT and SOFn markers.\n * Note that we do not emit the SOF until we have emitted the DQT(s).\n * This avoids compatibility problems with incorrect implementations that\n * try to error-check the quant table numbers as soon as they see the SOF.\n */\n\nMETHODDEF(void)\nwrite_frame_header (j_compress_ptr cinfo)\n{\n  int ci, prec;\n  boolean is_baseline;\n  jpeg_component_info *compptr;\n\n  /* Emit DQT for each quantization table.\n   * Note that emit_dqt() suppresses any duplicate tables.\n   */\n  prec = 0;\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    prec += emit_dqt(cinfo, compptr->quant_tbl_no);\n  }\n  /* now prec is nonzero iff there are any 16-bit quant tables. */\n\n  /* Check for a non-baseline specification.\n   * Note we assume that Huffman table numbers won't be changed later.\n   */\n  if (cinfo->arith_code || cinfo->progressive_mode ||\n      cinfo->data_precision != 8) {\n    is_baseline = FALSE;\n  } else {\n    is_baseline = TRUE;\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n         ci++, compptr++) {\n      if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1)\n        is_baseline = FALSE;\n    }\n    if (prec && is_baseline) {\n      is_baseline = FALSE;\n      /* If it's baseline except for quantizer size, warn the user */\n      TRACEMS(cinfo, 0, JTRC_16BIT_TABLES);\n    }\n  }\n\n  /* Emit the proper SOF marker */\n  if (cinfo->arith_code) {\n    if (cinfo->progressive_mode)\n      emit_sof(cinfo, M_SOF10); /* SOF code for progressive arithmetic */\n    else\n      emit_sof(cinfo, M_SOF9);  /* SOF code for sequential arithmetic */\n  } else {\n    if (cinfo->progressive_mode)\n      emit_sof(cinfo, M_SOF2);  /* SOF code for progressive Huffman */\n    else if (is_baseline)\n      emit_sof(cinfo, M_SOF0);  /* SOF code for baseline implementation */\n    else\n      emit_sof(cinfo, M_SOF1);  /* SOF code for non-baseline Huffman file */\n  }\n}\n\n\n/*\n * Write scan header.\n * This consists of DHT or DAC markers, optional DRI, and SOS.\n * Compressed data will be written following the SOS.\n */\n\nMETHODDEF(void)\nwrite_scan_header (j_compress_ptr cinfo)\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n  int i;\n  jpeg_component_info *compptr;\n\n  if (cinfo->arith_code) {\n    /* Emit arith conditioning info.  We may have some duplication\n     * if the file has multiple scans, but it's so small it's hardly\n     * worth worrying about.\n     */\n    emit_dac(cinfo);\n  } else {\n    /* Emit Huffman tables.\n     * Note that emit_dht() suppresses any duplicate tables.\n     */\n    for (i = 0; i < cinfo->comps_in_scan; i++) {\n      compptr = cinfo->cur_comp_info[i];\n      /* DC needs no table for refinement scan */\n      if (cinfo->Ss == 0 && cinfo->Ah == 0)\n        emit_dht(cinfo, compptr->dc_tbl_no, FALSE);\n      /* AC needs no table when not present */\n      if (cinfo->Se)\n        emit_dht(cinfo, compptr->ac_tbl_no, TRUE);\n    }\n  }\n\n  /* Emit DRI if required --- note that DRI value could change for each scan.\n   * We avoid wasting space with unnecessary DRIs, however.\n   */\n  if (cinfo->restart_interval != marker->last_restart_interval) {\n    emit_dri(cinfo);\n    marker->last_restart_interval = cinfo->restart_interval;\n  }\n\n  emit_sos(cinfo);\n}\n\n\n/*\n * Write datastream trailer.\n */\n\nMETHODDEF(void)\nwrite_file_trailer (j_compress_ptr cinfo)\n{\n  emit_marker(cinfo, M_EOI);\n}\n\n\n/*\n * Write an abbreviated table-specification datastream.\n * This consists of SOI, DQT and DHT tables, and EOI.\n * Any table that is defined and not marked sent_table = TRUE will be\n * emitted.  Note that all tables will be marked sent_table = TRUE at exit.\n */\n\nMETHODDEF(void)\nwrite_tables_only (j_compress_ptr cinfo)\n{\n  int i;\n\n  emit_marker(cinfo, M_SOI);\n\n  for (i = 0; i < NUM_QUANT_TBLS; i++) {\n    if (cinfo->quant_tbl_ptrs[i] != NULL)\n      (void) emit_dqt(cinfo, i);\n  }\n\n  if (! cinfo->arith_code) {\n    for (i = 0; i < NUM_HUFF_TBLS; i++) {\n      if (cinfo->dc_huff_tbl_ptrs[i] != NULL)\n        emit_dht(cinfo, i, FALSE);\n      if (cinfo->ac_huff_tbl_ptrs[i] != NULL)\n        emit_dht(cinfo, i, TRUE);\n    }\n  }\n\n  emit_marker(cinfo, M_EOI);\n}\n\n\n/*\n * Initialize the marker writer module.\n */\n\nGLOBAL(void)\njinit_marker_writer (j_compress_ptr cinfo)\n{\n  my_marker_ptr marker;\n\n  /* Create the subobject */\n  marker = (my_marker_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_marker_writer));\n  cinfo->marker = (struct jpeg_marker_writer *) marker;\n  /* Initialize method pointers */\n  marker->pub.write_file_header = write_file_header;\n  marker->pub.write_frame_header = write_frame_header;\n  marker->pub.write_scan_header = write_scan_header;\n  marker->pub.write_file_trailer = write_file_trailer;\n  marker->pub.write_tables_only = write_tables_only;\n  marker->pub.write_marker_header = write_marker_header;\n  marker->pub.write_marker_byte = write_marker_byte;\n  /* Initialize private state */\n  marker->last_restart_interval = 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jcmaster.c",
    "content": "/*\n * jcmaster.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2003-2010 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, 2016, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains master control logic for the JPEG compressor.\n * These routines are concerned with parameter validation, initial setup,\n * and inter-pass control (determining the number of passes and the work\n * to be done in each pass).\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jpegcomp.h\"\n#include \"jconfigint.h\"\n\n\n/* Private state */\n\ntypedef enum {\n        main_pass,              /* input data, also do first output step */\n        huff_opt_pass,          /* Huffman code optimization pass */\n        output_pass             /* data output pass */\n} c_pass_type;\n\ntypedef struct {\n  struct jpeg_comp_master pub;  /* public fields */\n\n  c_pass_type pass_type;        /* the type of the current pass */\n\n  int pass_number;              /* # of passes completed */\n  int total_passes;             /* total # of passes needed */\n\n  int scan_number;              /* current index in scan_info[] */\n\n  /*\n   * This is here so we can add libjpeg-turbo version/build information to the\n   * global string table without introducing a new global symbol.  Adding this\n   * information to the global string table allows one to examine a binary\n   * object and determine which version of libjpeg-turbo it was built from or\n   * linked against.\n   */\n  const char *jpeg_version;\n\n} my_comp_master;\n\ntypedef my_comp_master *my_master_ptr;\n\n\n/*\n * Support routines that do various essential calculations.\n */\n\n#if JPEG_LIB_VERSION >= 70\n/*\n * Compute JPEG image dimensions and related values.\n * NOTE: this is exported for possible use by application.\n * Hence it mustn't do anything that can't be done twice.\n */\n\nGLOBAL(void)\njpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)\n/* Do computations that are needed before master selection phase */\n{\n  /* Hardwire it to \"no scaling\" */\n  cinfo->jpeg_width = cinfo->image_width;\n  cinfo->jpeg_height = cinfo->image_height;\n  cinfo->min_DCT_h_scaled_size = DCTSIZE;\n  cinfo->min_DCT_v_scaled_size = DCTSIZE;\n}\n#endif\n\n\nLOCAL(void)\ninitial_setup (j_compress_ptr cinfo, boolean transcode_only)\n/* Do computations that are needed before master selection phase */\n{\n  int ci;\n  jpeg_component_info *compptr;\n  long samplesperrow;\n  JDIMENSION jd_samplesperrow;\n\n#if JPEG_LIB_VERSION >= 70\n#if JPEG_LIB_VERSION >= 80\n  if (!transcode_only)\n#endif\n    jpeg_calc_jpeg_dimensions(cinfo);\n#endif\n\n  /* Sanity check on image dimensions */\n  if (cinfo->_jpeg_height <= 0 || cinfo->_jpeg_width <= 0\n      || cinfo->num_components <= 0 || cinfo->input_components <= 0)\n    ERREXIT(cinfo, JERR_EMPTY_IMAGE);\n\n  /* Make sure image isn't bigger than I can handle */\n  if ((long) cinfo->_jpeg_height > (long) JPEG_MAX_DIMENSION ||\n      (long) cinfo->_jpeg_width > (long) JPEG_MAX_DIMENSION)\n    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);\n\n  /* Width of an input scanline must be representable as JDIMENSION. */\n  samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components;\n  jd_samplesperrow = (JDIMENSION) samplesperrow;\n  if ((long) jd_samplesperrow != samplesperrow)\n    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);\n\n  /* For now, precision must match compiled-in value... */\n  if (cinfo->data_precision != BITS_IN_JSAMPLE)\n    ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);\n\n  /* Check that number of components won't exceed internal array sizes */\n  if (cinfo->num_components > MAX_COMPONENTS)\n    ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,\n             MAX_COMPONENTS);\n\n  /* Compute maximum sampling factors; check factor validity */\n  cinfo->max_h_samp_factor = 1;\n  cinfo->max_v_samp_factor = 1;\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||\n        compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)\n      ERREXIT(cinfo, JERR_BAD_SAMPLING);\n    cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,\n                                   compptr->h_samp_factor);\n    cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,\n                                   compptr->v_samp_factor);\n  }\n\n  /* Compute dimensions of components */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Fill in the correct component_index value; don't rely on application */\n    compptr->component_index = ci;\n    /* For compression, we never do DCT scaling. */\n#if JPEG_LIB_VERSION >= 70\n    compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size = DCTSIZE;\n#else\n    compptr->DCT_scaled_size = DCTSIZE;\n#endif\n    /* Size in DCT blocks */\n    compptr->width_in_blocks = (JDIMENSION)\n      jdiv_round_up((long) cinfo->_jpeg_width * (long) compptr->h_samp_factor,\n                    (long) (cinfo->max_h_samp_factor * DCTSIZE));\n    compptr->height_in_blocks = (JDIMENSION)\n      jdiv_round_up((long) cinfo->_jpeg_height * (long) compptr->v_samp_factor,\n                    (long) (cinfo->max_v_samp_factor * DCTSIZE));\n    /* Size in samples */\n    compptr->downsampled_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->_jpeg_width * (long) compptr->h_samp_factor,\n                    (long) cinfo->max_h_samp_factor);\n    compptr->downsampled_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->_jpeg_height * (long) compptr->v_samp_factor,\n                    (long) cinfo->max_v_samp_factor);\n    /* Mark component needed (this flag isn't actually used for compression) */\n    compptr->component_needed = TRUE;\n  }\n\n  /* Compute number of fully interleaved MCU rows (number of times that\n   * main controller will call coefficient controller).\n   */\n  cinfo->total_iMCU_rows = (JDIMENSION)\n    jdiv_round_up((long) cinfo->_jpeg_height,\n                  (long) (cinfo->max_v_samp_factor*DCTSIZE));\n}\n\n\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n\nLOCAL(void)\nvalidate_script (j_compress_ptr cinfo)\n/* Verify that the scan script in cinfo->scan_info[] is valid; also\n * determine whether it uses progressive JPEG, and set cinfo->progressive_mode.\n */\n{\n  const jpeg_scan_info *scanptr;\n  int scanno, ncomps, ci, coefi, thisi;\n  int Ss, Se, Ah, Al;\n  boolean component_sent[MAX_COMPONENTS];\n#ifdef C_PROGRESSIVE_SUPPORTED\n  int *last_bitpos_ptr;\n  int last_bitpos[MAX_COMPONENTS][DCTSIZE2];\n  /* -1 until that coefficient has been seen; then last Al for it */\n#endif\n\n  if (cinfo->num_scans <= 0)\n    ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0);\n\n  /* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1;\n   * for progressive JPEG, no scan can have this.\n   */\n  scanptr = cinfo->scan_info;\n  if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2-1) {\n#ifdef C_PROGRESSIVE_SUPPORTED\n    cinfo->progressive_mode = TRUE;\n    last_bitpos_ptr = & last_bitpos[0][0];\n    for (ci = 0; ci < cinfo->num_components; ci++)\n      for (coefi = 0; coefi < DCTSIZE2; coefi++)\n        *last_bitpos_ptr++ = -1;\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n  } else {\n    cinfo->progressive_mode = FALSE;\n    for (ci = 0; ci < cinfo->num_components; ci++)\n      component_sent[ci] = FALSE;\n  }\n\n  for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) {\n    /* Validate component indexes */\n    ncomps = scanptr->comps_in_scan;\n    if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN)\n      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN);\n    for (ci = 0; ci < ncomps; ci++) {\n      thisi = scanptr->component_index[ci];\n      if (thisi < 0 || thisi >= cinfo->num_components)\n        ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);\n      /* Components must appear in SOF order within each scan */\n      if (ci > 0 && thisi <= scanptr->component_index[ci-1])\n        ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);\n    }\n    /* Validate progression parameters */\n    Ss = scanptr->Ss;\n    Se = scanptr->Se;\n    Ah = scanptr->Ah;\n    Al = scanptr->Al;\n    if (cinfo->progressive_mode) {\n#ifdef C_PROGRESSIVE_SUPPORTED\n      /* The JPEG spec simply gives the ranges 0..13 for Ah and Al, but that\n       * seems wrong: the upper bound ought to depend on data precision.\n       * Perhaps they really meant 0..N+1 for N-bit precision.\n       * Here we allow 0..10 for 8-bit data; Al larger than 10 results in\n       * out-of-range reconstructed DC values during the first DC scan,\n       * which might cause problems for some decoders.\n       */\n#if BITS_IN_JSAMPLE == 8\n#define MAX_AH_AL 10\n#else\n#define MAX_AH_AL 13\n#endif\n      if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||\n          Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)\n        ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n      if (Ss == 0) {\n        if (Se != 0)            /* DC and AC together not OK */\n          ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n      } else {\n        if (ncomps != 1)        /* AC scans must be for only one component */\n          ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n      }\n      for (ci = 0; ci < ncomps; ci++) {\n        last_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0];\n        if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */\n          ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n        for (coefi = Ss; coefi <= Se; coefi++) {\n          if (last_bitpos_ptr[coefi] < 0) {\n            /* first scan of this coefficient */\n            if (Ah != 0)\n              ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n          } else {\n            /* not first scan */\n            if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1)\n              ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n          }\n          last_bitpos_ptr[coefi] = Al;\n        }\n      }\n#endif\n    } else {\n      /* For sequential JPEG, all progression parameters must be these: */\n      if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0)\n        ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n      /* Make sure components are not sent twice */\n      for (ci = 0; ci < ncomps; ci++) {\n        thisi = scanptr->component_index[ci];\n        if (component_sent[thisi])\n          ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);\n        component_sent[thisi] = TRUE;\n      }\n    }\n  }\n\n  /* Now verify that everything got sent. */\n  if (cinfo->progressive_mode) {\n#ifdef C_PROGRESSIVE_SUPPORTED\n    /* For progressive mode, we only check that at least some DC data\n     * got sent for each component; the spec does not require that all bits\n     * of all coefficients be transmitted.  Would it be wiser to enforce\n     * transmission of all coefficient bits??\n     */\n    for (ci = 0; ci < cinfo->num_components; ci++) {\n      if (last_bitpos[ci][0] < 0)\n        ERREXIT(cinfo, JERR_MISSING_DATA);\n    }\n#endif\n  } else {\n    for (ci = 0; ci < cinfo->num_components; ci++) {\n      if (! component_sent[ci])\n        ERREXIT(cinfo, JERR_MISSING_DATA);\n    }\n  }\n}\n\n#endif /* C_MULTISCAN_FILES_SUPPORTED */\n\n\nLOCAL(void)\nselect_scan_parameters (j_compress_ptr cinfo)\n/* Set up the scan parameters for the current scan */\n{\n  int ci;\n\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n  if (cinfo->scan_info != NULL) {\n    /* Prepare for current scan --- the script is already validated */\n    my_master_ptr master = (my_master_ptr) cinfo->master;\n    const jpeg_scan_info *scanptr = cinfo->scan_info + master->scan_number;\n\n    cinfo->comps_in_scan = scanptr->comps_in_scan;\n    for (ci = 0; ci < scanptr->comps_in_scan; ci++) {\n      cinfo->cur_comp_info[ci] =\n        &cinfo->comp_info[scanptr->component_index[ci]];\n    }\n    cinfo->Ss = scanptr->Ss;\n    cinfo->Se = scanptr->Se;\n    cinfo->Ah = scanptr->Ah;\n    cinfo->Al = scanptr->Al;\n  }\n  else\n#endif\n  {\n    /* Prepare for single sequential-JPEG scan containing all components */\n    if (cinfo->num_components > MAX_COMPS_IN_SCAN)\n      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,\n               MAX_COMPS_IN_SCAN);\n    cinfo->comps_in_scan = cinfo->num_components;\n    for (ci = 0; ci < cinfo->num_components; ci++) {\n      cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci];\n    }\n    cinfo->Ss = 0;\n    cinfo->Se = DCTSIZE2-1;\n    cinfo->Ah = 0;\n    cinfo->Al = 0;\n  }\n}\n\n\nLOCAL(void)\nper_scan_setup (j_compress_ptr cinfo)\n/* Do computations that are needed before processing a JPEG scan */\n/* cinfo->comps_in_scan and cinfo->cur_comp_info[] are already set */\n{\n  int ci, mcublks, tmp;\n  jpeg_component_info *compptr;\n\n  if (cinfo->comps_in_scan == 1) {\n\n    /* Noninterleaved (single-component) scan */\n    compptr = cinfo->cur_comp_info[0];\n\n    /* Overall image size in MCUs */\n    cinfo->MCUs_per_row = compptr->width_in_blocks;\n    cinfo->MCU_rows_in_scan = compptr->height_in_blocks;\n\n    /* For noninterleaved scan, always one block per MCU */\n    compptr->MCU_width = 1;\n    compptr->MCU_height = 1;\n    compptr->MCU_blocks = 1;\n    compptr->MCU_sample_width = DCTSIZE;\n    compptr->last_col_width = 1;\n    /* For noninterleaved scans, it is convenient to define last_row_height\n     * as the number of block rows present in the last iMCU row.\n     */\n    tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);\n    if (tmp == 0) tmp = compptr->v_samp_factor;\n    compptr->last_row_height = tmp;\n\n    /* Prepare array describing MCU composition */\n    cinfo->blocks_in_MCU = 1;\n    cinfo->MCU_membership[0] = 0;\n\n  } else {\n\n    /* Interleaved (multi-component) scan */\n    if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)\n      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,\n               MAX_COMPS_IN_SCAN);\n\n    /* Overall image size in MCUs */\n    cinfo->MCUs_per_row = (JDIMENSION)\n      jdiv_round_up((long) cinfo->_jpeg_width,\n                    (long) (cinfo->max_h_samp_factor*DCTSIZE));\n    cinfo->MCU_rows_in_scan = (JDIMENSION)\n      jdiv_round_up((long) cinfo->_jpeg_height,\n                    (long) (cinfo->max_v_samp_factor*DCTSIZE));\n\n    cinfo->blocks_in_MCU = 0;\n\n    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n      compptr = cinfo->cur_comp_info[ci];\n      /* Sampling factors give # of blocks of component in each MCU */\n      compptr->MCU_width = compptr->h_samp_factor;\n      compptr->MCU_height = compptr->v_samp_factor;\n      compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;\n      compptr->MCU_sample_width = compptr->MCU_width * DCTSIZE;\n      /* Figure number of non-dummy blocks in last MCU column & row */\n      tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);\n      if (tmp == 0) tmp = compptr->MCU_width;\n      compptr->last_col_width = tmp;\n      tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);\n      if (tmp == 0) tmp = compptr->MCU_height;\n      compptr->last_row_height = tmp;\n      /* Prepare array describing MCU composition */\n      mcublks = compptr->MCU_blocks;\n      if (cinfo->blocks_in_MCU + mcublks > C_MAX_BLOCKS_IN_MCU)\n        ERREXIT(cinfo, JERR_BAD_MCU_SIZE);\n      while (mcublks-- > 0) {\n        cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;\n      }\n    }\n\n  }\n\n  /* Convert restart specified in rows to actual MCU count. */\n  /* Note that count must fit in 16 bits, so we provide limiting. */\n  if (cinfo->restart_in_rows > 0) {\n    long nominal = (long) cinfo->restart_in_rows * (long) cinfo->MCUs_per_row;\n    cinfo->restart_interval = (unsigned int) MIN(nominal, 65535L);\n  }\n}\n\n\n/*\n * Per-pass setup.\n * This is called at the beginning of each pass.  We determine which modules\n * will be active during this pass and give them appropriate start_pass calls.\n * We also set is_last_pass to indicate whether any more passes will be\n * required.\n */\n\nMETHODDEF(void)\nprepare_for_pass (j_compress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  switch (master->pass_type) {\n  case main_pass:\n    /* Initial pass: will collect input data, and do either Huffman\n     * optimization or data output for the first scan.\n     */\n    select_scan_parameters(cinfo);\n    per_scan_setup(cinfo);\n    if (! cinfo->raw_data_in) {\n      (*cinfo->cconvert->start_pass) (cinfo);\n      (*cinfo->downsample->start_pass) (cinfo);\n      (*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU);\n    }\n    (*cinfo->fdct->start_pass) (cinfo);\n    (*cinfo->entropy->start_pass) (cinfo, cinfo->optimize_coding);\n    (*cinfo->coef->start_pass) (cinfo,\n                                (master->total_passes > 1 ?\n                                 JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));\n    (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);\n    if (cinfo->optimize_coding) {\n      /* No immediate data output; postpone writing frame/scan headers */\n      master->pub.call_pass_startup = FALSE;\n    } else {\n      /* Will write frame/scan headers at first jpeg_write_scanlines call */\n      master->pub.call_pass_startup = TRUE;\n    }\n    break;\n#ifdef ENTROPY_OPT_SUPPORTED\n  case huff_opt_pass:\n    /* Do Huffman optimization for a scan after the first one. */\n    select_scan_parameters(cinfo);\n    per_scan_setup(cinfo);\n    if (cinfo->Ss != 0 || cinfo->Ah == 0 || cinfo->arith_code) {\n      (*cinfo->entropy->start_pass) (cinfo, TRUE);\n      (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);\n      master->pub.call_pass_startup = FALSE;\n      break;\n    }\n    /* Special case: Huffman DC refinement scans need no Huffman table\n     * and therefore we can skip the optimization pass for them.\n     */\n    master->pass_type = output_pass;\n    master->pass_number++;\n    /*FALLTHROUGH*/\n#endif\n  case output_pass:\n    /* Do a data-output pass. */\n    /* We need not repeat per-scan setup if prior optimization pass did it. */\n    if (! cinfo->optimize_coding) {\n      select_scan_parameters(cinfo);\n      per_scan_setup(cinfo);\n    }\n    (*cinfo->entropy->start_pass) (cinfo, FALSE);\n    (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);\n    /* We emit frame/scan headers now */\n    if (master->scan_number == 0)\n      (*cinfo->marker->write_frame_header) (cinfo);\n    (*cinfo->marker->write_scan_header) (cinfo);\n    master->pub.call_pass_startup = FALSE;\n    break;\n  default:\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n  }\n\n  master->pub.is_last_pass = (master->pass_number == master->total_passes-1);\n\n  /* Set up progress monitor's pass info if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->completed_passes = master->pass_number;\n    cinfo->progress->total_passes = master->total_passes;\n  }\n}\n\n\n/*\n * Special start-of-pass hook.\n * This is called by jpeg_write_scanlines if call_pass_startup is TRUE.\n * In single-pass processing, we need this hook because we don't want to\n * write frame/scan headers during jpeg_start_compress; we want to let the\n * application write COM markers etc. between jpeg_start_compress and the\n * jpeg_write_scanlines loop.\n * In multi-pass processing, this routine is not used.\n */\n\nMETHODDEF(void)\npass_startup (j_compress_ptr cinfo)\n{\n  cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */\n\n  (*cinfo->marker->write_frame_header) (cinfo);\n  (*cinfo->marker->write_scan_header) (cinfo);\n}\n\n\n/*\n * Finish up at end of pass.\n */\n\nMETHODDEF(void)\nfinish_pass_master (j_compress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  /* The entropy coder always needs an end-of-pass call,\n   * either to analyze statistics or to flush its output buffer.\n   */\n  (*cinfo->entropy->finish_pass) (cinfo);\n\n  /* Update state for next pass */\n  switch (master->pass_type) {\n  case main_pass:\n    /* next pass is either output of scan 0 (after optimization)\n     * or output of scan 1 (if no optimization).\n     */\n    master->pass_type = output_pass;\n    if (! cinfo->optimize_coding)\n      master->scan_number++;\n    break;\n  case huff_opt_pass:\n    /* next pass is always output of current scan */\n    master->pass_type = output_pass;\n    break;\n  case output_pass:\n    /* next pass is either optimization or output of next scan */\n    if (cinfo->optimize_coding)\n      master->pass_type = huff_opt_pass;\n    master->scan_number++;\n    break;\n  }\n\n  master->pass_number++;\n}\n\n\n/*\n * Initialize master compression control.\n */\n\nGLOBAL(void)\njinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)\n{\n  my_master_ptr master;\n\n  master = (my_master_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(my_comp_master));\n  cinfo->master = (struct jpeg_comp_master *) master;\n  master->pub.prepare_for_pass = prepare_for_pass;\n  master->pub.pass_startup = pass_startup;\n  master->pub.finish_pass = finish_pass_master;\n  master->pub.is_last_pass = FALSE;\n\n  /* Validate parameters, determine derived values */\n  initial_setup(cinfo, transcode_only);\n\n  if (cinfo->scan_info != NULL) {\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n    validate_script(cinfo);\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n  } else {\n    cinfo->progressive_mode = FALSE;\n    cinfo->num_scans = 1;\n  }\n\n  if (cinfo->progressive_mode && !cinfo->arith_code)  /*  TEMPORARY HACK ??? */\n    cinfo->optimize_coding = TRUE; /* assume default tables no good for progressive mode */\n\n  /* Initialize my private state */\n  if (transcode_only) {\n    /* no main pass in transcoding */\n    if (cinfo->optimize_coding)\n      master->pass_type = huff_opt_pass;\n    else\n      master->pass_type = output_pass;\n  } else {\n    /* for normal compression, first pass is always this type: */\n    master->pass_type = main_pass;\n  }\n  master->scan_number = 0;\n  master->pass_number = 0;\n  if (cinfo->optimize_coding)\n    master->total_passes = cinfo->num_scans * 2;\n  else\n    master->total_passes = cinfo->num_scans;\n\n//master->jpeg_version = PACKAGE_NAME \" version \" VERSION \" (build \" BUILD \")\";\n  master->jpeg_version = \"libjpeg-turbo 1.5.0\";\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jcomapi.c",
    "content": "/*\n * jcomapi.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains application interface routines that are used for both\n * compression and decompression.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Abort processing of a JPEG compression or decompression operation,\n * but don't destroy the object itself.\n *\n * For this, we merely clean up all the nonpermanent memory pools.\n * Note that temp files (virtual arrays) are not allowed to belong to\n * the permanent pool, so we will be able to close all temp files here.\n * Closing a data source or destination, if necessary, is the application's\n * responsibility.\n */\n\nGLOBAL(void)\njpeg_abort (j_common_ptr cinfo)\n{\n  int pool;\n\n  /* Do nothing if called on a not-initialized or destroyed JPEG object. */\n  if (cinfo->mem == NULL)\n    return;\n\n  /* Releasing pools in reverse order might help avoid fragmentation\n   * with some (brain-damaged) malloc libraries.\n   */\n  for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) {\n    (*cinfo->mem->free_pool) (cinfo, pool);\n  }\n\n  /* Reset overall state for possible reuse of object */\n  if (cinfo->is_decompressor) {\n    cinfo->global_state = DSTATE_START;\n    /* Try to keep application from accessing now-deleted marker list.\n     * A bit kludgy to do it here, but this is the most central place.\n     */\n    ((j_decompress_ptr) cinfo)->marker_list = NULL;\n  } else {\n    cinfo->global_state = CSTATE_START;\n  }\n}\n\n\n/*\n * Destruction of a JPEG object.\n *\n * Everything gets deallocated except the master jpeg_compress_struct itself\n * and the error manager struct.  Both of these are supplied by the application\n * and must be freed, if necessary, by the application.  (Often they are on\n * the stack and so don't need to be freed anyway.)\n * Closing a data source or destination, if necessary, is the application's\n * responsibility.\n */\n\nGLOBAL(void)\njpeg_destroy (j_common_ptr cinfo)\n{\n  /* We need only tell the memory manager to release everything. */\n  /* NB: mem pointer is NULL if memory mgr failed to initialize. */\n  if (cinfo->mem != NULL)\n    (*cinfo->mem->self_destruct) (cinfo);\n  cinfo->mem = NULL;            /* be safe if jpeg_destroy is called twice */\n  cinfo->global_state = 0;      /* mark it destroyed */\n}\n\n\n/*\n * Convenience routines for allocating quantization and Huffman tables.\n * (Would jutils.c be a more reasonable place to put these?)\n */\n\nGLOBAL(JQUANT_TBL *)\njpeg_alloc_quant_table (j_common_ptr cinfo)\n{\n  JQUANT_TBL *tbl;\n\n  tbl = (JQUANT_TBL *)\n    (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, sizeof(JQUANT_TBL));\n  tbl->sent_table = FALSE;      /* make sure this is false in any new table */\n  return tbl;\n}\n\n\nGLOBAL(JHUFF_TBL *)\njpeg_alloc_huff_table (j_common_ptr cinfo)\n{\n  JHUFF_TBL *tbl;\n\n  tbl = (JHUFF_TBL *)\n    (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, sizeof(JHUFF_TBL));\n  tbl->sent_table = FALSE;      /* make sure this is false in any new table */\n  return tbl;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jconfig.h.in",
    "content": "/* Version ID for the JPEG library.\n * Might be useful for tests like \"#if JPEG_LIB_VERSION >= 60\".\n */\n#define JPEG_LIB_VERSION  62\t/* Version 6b */\n\n/* libjpeg-turbo version */\n#define LIBJPEG_TURBO_VERSION 0\n\n/* libjpeg-turbo version in integer form */\n#define LIBJPEG_TURBO_VERSION_NUMBER 0\n\n/* Support arithmetic encoding */\n#undef C_ARITH_CODING_SUPPORTED\n\n/* Support arithmetic decoding */\n#undef D_ARITH_CODING_SUPPORTED\n\n/*\n * Define BITS_IN_JSAMPLE as either\n *   8   for 8-bit sample values (the usual setting)\n *   12  for 12-bit sample values\n * Only 8 and 12 are legal data precisions for lossy JPEG according to the\n * JPEG standard, and the IJG code does not support anything else!\n * We do not support run-time selection of data precision, sorry.\n */\n\n#define BITS_IN_JSAMPLE  8      /* use 8 or 12 */\n\n/* Define to 1 if you have the <locale.h> header file. */\n#undef HAVE_LOCALE_H\n\n/* Define to 1 if you have the <stddef.h> header file. */\n#undef HAVE_STDDEF_H\n\n/* Define to 1 if you have the <stdlib.h> header file. */\n#undef HAVE_STDLIB_H\n\n/* Define to 1 if the system has the type `unsigned char'. */\n#undef HAVE_UNSIGNED_CHAR\n\n/* Define to 1 if the system has the type `unsigned short'. */\n#undef HAVE_UNSIGNED_SHORT\n\n/* Compiler does not support pointers to undefined structures. */\n#undef INCOMPLETE_TYPES_BROKEN\n\n/* Support in-memory source/destination managers */\n#undef MEM_SRCDST_SUPPORTED\n\n/* Define if you have BSD-like bzero and bcopy in <strings.h> rather than\n   memset/memcpy in <string.h>. */\n#undef NEED_BSD_STRINGS\n\n/* Define if you need to include <sys/types.h> to get size_t. */\n#undef NEED_SYS_TYPES_H\n\n/* Define if your (broken) compiler shifts signed values as if they were\n   unsigned. */\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n/* Use accelerated SIMD routines. */\n#undef WITH_SIMD\n\n/* Define to 1 if type `char' is unsigned and you are not using gcc.  */\n#ifndef __CHAR_UNSIGNED__\n# undef __CHAR_UNSIGNED__\n#endif\n\n/* Define to empty if `const' does not conform to ANSI C. */\n#undef const\n\n/* Define to `unsigned int' if <sys/types.h> does not define. */\n#undef size_t\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jconfig.txt",
    "content": "/*\n * jconfig.txt\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1994, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file documents the configuration options that are required to\n * customize the JPEG software for a particular system.\n *\n * The actual configuration options for a particular installation are stored\n * in jconfig.h.  On many machines, jconfig.h can be generated automatically\n * or copied from one of the \"canned\" jconfig files that we supply.  But if\n * you need to generate a jconfig.h file by hand, this file tells you how.\n *\n * DO NOT EDIT THIS FILE --- IT WON'T ACCOMPLISH ANYTHING.\n * EDIT A COPY NAMED JCONFIG.H.\n */\n\n\n/*\n * These symbols indicate the properties of your machine or compiler.\n * #define the symbol if yes, #undef it if no.\n */\n\n/* Does your compiler support the declaration \"unsigned char\" ?\n * How about \"unsigned short\" ?\n */\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n\n/* Define \"void\" as \"char\" if your compiler doesn't know about type void.\n * NOTE: be sure to define void such that \"void *\" represents the most general\n * pointer type, e.g., that returned by malloc().\n */\n/* #define void char */\n\n/* Define \"const\" as empty if your compiler doesn't know the \"const\" keyword.\n */\n/* #define const */\n\n/* Define this if an ordinary \"char\" type is unsigned.\n * If you're not sure, leaving it undefined will work at some cost in speed.\n * If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal.\n */\n#undef __CHAR_UNSIGNED__\n\n/* Define this if your system has an ANSI-conforming <stddef.h> file.\n */\n#define HAVE_STDDEF_H\n\n/* Define this if your system has an ANSI-conforming <stdlib.h> file.\n */\n#define HAVE_STDLIB_H\n\n/* Define this if your system does not have an ANSI/SysV <string.h>,\n * but does have a BSD-style <strings.h>.\n */\n#undef NEED_BSD_STRINGS\n\n/* Define this if your system does not provide typedef size_t in any of the\n * ANSI-standard places (stddef.h, stdlib.h, or stdio.h), but places it in\n * <sys/types.h> instead.\n */\n#undef NEED_SYS_TYPES_H\n\n/* Although a real ANSI C compiler can deal perfectly well with pointers to\n * unspecified structures (see \"incomplete types\" in the spec), a few pre-ANSI\n * and pseudo-ANSI compilers get confused.  To keep one of these bozos happy,\n * define INCOMPLETE_TYPES_BROKEN.  This is not recommended unless you\n * actually get \"missing structure definition\" warnings or errors while\n * compiling the JPEG code.\n */\n#undef INCOMPLETE_TYPES_BROKEN\n\n/* Define \"boolean\" as unsigned char, not int, on Windows systems.\n */\n#ifdef _WIN32\n#ifndef __RPCNDR_H__            /* don't conflict if rpcndr.h already read */\ntypedef unsigned char boolean;\n#endif\n#define HAVE_BOOLEAN            /* prevent jmorecfg.h from redefining it */\n#endif\n\n\n/*\n * The following options affect code selection within the JPEG library,\n * but they don't need to be visible to applications using the library.\n * To minimize application namespace pollution, the symbols won't be\n * defined unless JPEG_INTERNALS has been defined.\n */\n\n#ifdef JPEG_INTERNALS\n\n/* Define this if your compiler implements \">>\" on signed values as a logical\n * (unsigned) shift; leave it undefined if \">>\" is a signed (arithmetic) shift,\n * which is the normal and rational definition.\n */\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n\n#endif /* JPEG_INTERNALS */\n\n\n/*\n * The remaining options do not affect the JPEG library proper,\n * but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c).\n * Other applications can ignore these.\n */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n/* These defines indicate which image (non-JPEG) file formats are allowed. */\n\n#define BMP_SUPPORTED           /* BMP image file format */\n#define GIF_SUPPORTED           /* GIF image file format */\n#define PPM_SUPPORTED           /* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED            /* Utah RLE image file format */\n#define TARGA_SUPPORTED         /* Targa image file format */\n\n/* Define this if you want to name both input and output files on the command\n * line, rather than using stdout and optionally stdin.  You MUST do this if\n * your system can't cope with binary I/O to stdin/stdout.  See comments at\n * head of cjpeg.c or djpeg.c.\n */\n#undef TWO_FILE_COMMANDLINE\n\n/* By default, we open image files with fopen(...,\"rb\") or fopen(...,\"wb\").\n * This is necessary on systems that distinguish text files from binary files,\n * and is harmless on most systems that don't.  If you have one of the rare\n * systems that complains about the \"b\" spec, define this symbol.\n */\n#undef DONT_USE_B_MODE\n\n/* Define this if you want percent-done progress reports from cjpeg/djpeg.\n */\n#undef PROGRESS_REPORT\n\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jconfigint.h.in",
    "content": "/* libjpeg-turbo build number */\n#undef BUILD\n\n/* How to obtain function inlining. */\n#undef INLINE\n\n/* Define to the full name of this package. */\n#undef PACKAGE_NAME\n\n/* Version number of package */\n#undef VERSION\n\n/* The size of `size_t', as computed by sizeof. */\n#undef SIZEOF_SIZE_T\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jcparam.c",
    "content": "/*\n * jcparam.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2003-2008 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009-2011, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains optional default-setting code for the JPEG compressor.\n * Applications do not have to use this file, but those that don't use it\n * must know a lot more about the innards of the JPEG code.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jstdhuff.c\"\n\n\n/*\n * Quantization table setup routines\n */\n\nGLOBAL(void)\njpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,\n                      const unsigned int *basic_table,\n                      int scale_factor, boolean force_baseline)\n/* Define a quantization table equal to the basic_table times\n * a scale factor (given as a percentage).\n * If force_baseline is TRUE, the computed quantization table entries\n * are limited to 1..255 for JPEG baseline compatibility.\n */\n{\n  JQUANT_TBL **qtblptr;\n  int i;\n  long temp;\n\n  /* Safety check to ensure start_compress not called yet. */\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS)\n    ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl);\n\n  qtblptr = & cinfo->quant_tbl_ptrs[which_tbl];\n\n  if (*qtblptr == NULL)\n    *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo);\n\n  for (i = 0; i < DCTSIZE2; i++) {\n    temp = ((long) basic_table[i] * scale_factor + 50L) / 100L;\n    /* limit the values to the valid range */\n    if (temp <= 0L) temp = 1L;\n    if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */\n    if (force_baseline && temp > 255L)\n      temp = 255L;              /* limit to baseline range if requested */\n    (*qtblptr)->quantval[i] = (UINT16) temp;\n  }\n\n  /* Initialize sent_table FALSE so table will be written to JPEG file. */\n  (*qtblptr)->sent_table = FALSE;\n}\n\n\n/* These are the sample quantization tables given in JPEG spec section K.1.\n * The spec says that the values given produce \"good\" quality, and\n * when divided by 2, \"very good\" quality.\n */\nstatic const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {\n  16,  11,  10,  16,  24,  40,  51,  61,\n  12,  12,  14,  19,  26,  58,  60,  55,\n  14,  13,  16,  24,  40,  57,  69,  56,\n  14,  17,  22,  29,  51,  87,  80,  62,\n  18,  22,  37,  56,  68, 109, 103,  77,\n  24,  35,  55,  64,  81, 104, 113,  92,\n  49,  64,  78,  87, 103, 121, 120, 101,\n  72,  92,  95,  98, 112, 100, 103,  99\n};\nstatic const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {\n  17,  18,  24,  47,  99,  99,  99,  99,\n  18,  21,  26,  66,  99,  99,  99,  99,\n  24,  26,  56,  99,  99,  99,  99,  99,\n  47,  66,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99\n};\n\n\n#if JPEG_LIB_VERSION >= 70\nGLOBAL(void)\njpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)\n/* Set or change the 'quality' (quantization) setting, using default tables\n * and straight percentage-scaling quality scales.\n * This entry point allows different scalings for luminance and chrominance.\n */\n{\n  /* Set up two quantization tables using the specified scaling */\n  jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,\n                       cinfo->q_scale_factor[0], force_baseline);\n  jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,\n                       cinfo->q_scale_factor[1], force_baseline);\n}\n#endif\n\n\nGLOBAL(void)\njpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,\n                         boolean force_baseline)\n/* Set or change the 'quality' (quantization) setting, using default tables\n * and a straight percentage-scaling quality scale.  In most cases it's better\n * to use jpeg_set_quality (below); this entry point is provided for\n * applications that insist on a linear percentage scaling.\n */\n{\n  /* Set up two quantization tables using the specified scaling */\n  jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,\n                       scale_factor, force_baseline);\n  jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,\n                       scale_factor, force_baseline);\n}\n\n\nGLOBAL(int)\njpeg_quality_scaling (int quality)\n/* Convert a user-specified quality rating to a percentage scaling factor\n * for an underlying quantization table, using our recommended scaling curve.\n * The input 'quality' factor should be 0 (terrible) to 100 (very good).\n */\n{\n  /* Safety limit on quality factor.  Convert 0 to 1 to avoid zero divide. */\n  if (quality <= 0) quality = 1;\n  if (quality > 100) quality = 100;\n\n  /* The basic table is used as-is (scaling 100) for a quality of 50.\n   * Qualities 50..100 are converted to scaling percentage 200 - 2*Q;\n   * note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table\n   * to make all the table entries 1 (hence, minimum quantization loss).\n   * Qualities 1..50 are converted to scaling percentage 5000/Q.\n   */\n  if (quality < 50)\n    quality = 5000 / quality;\n  else\n    quality = 200 - quality*2;\n\n  return quality;\n}\n\n\nGLOBAL(void)\njpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)\n/* Set or change the 'quality' (quantization) setting, using default tables.\n * This is the standard quality-adjusting entry point for typical user\n * interfaces; only those who want detailed control over quantization tables\n * would use the preceding three routines directly.\n */\n{\n  /* Convert user 0-100 rating to percentage scaling */\n  quality = jpeg_quality_scaling(quality);\n\n  /* Set up standard quality tables */\n  jpeg_set_linear_quality(cinfo, quality, force_baseline);\n}\n\n\n/*\n * Default parameter setup for compression.\n *\n * Applications that don't choose to use this routine must do their\n * own setup of all these parameters.  Alternately, you can call this\n * to establish defaults and then alter parameters selectively.  This\n * is the recommended approach since, if we add any new parameters,\n * your code will still work (they'll be set to reasonable defaults).\n */\n\nGLOBAL(void)\njpeg_set_defaults (j_compress_ptr cinfo)\n{\n  int i;\n\n  /* Safety check to ensure start_compress not called yet. */\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* Allocate comp_info array large enough for maximum component count.\n   * Array is made permanent in case application wants to compress\n   * multiple images at same param settings.\n   */\n  if (cinfo->comp_info == NULL)\n    cinfo->comp_info = (jpeg_component_info *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n                                  MAX_COMPONENTS * sizeof(jpeg_component_info));\n\n  /* Initialize everything not dependent on the color space */\n\n#if JPEG_LIB_VERSION >= 70\n  cinfo->scale_num = 1;         /* 1:1 scaling */\n  cinfo->scale_denom = 1;\n#endif\n  cinfo->data_precision = BITS_IN_JSAMPLE;\n  /* Set up two quantization tables using default quality of 75 */\n  jpeg_set_quality(cinfo, 75, TRUE);\n  /* Set up two Huffman tables */\n  std_huff_tables((j_common_ptr) cinfo);\n\n  /* Initialize default arithmetic coding conditioning */\n  for (i = 0; i < NUM_ARITH_TBLS; i++) {\n    cinfo->arith_dc_L[i] = 0;\n    cinfo->arith_dc_U[i] = 1;\n    cinfo->arith_ac_K[i] = 5;\n  }\n\n  /* Default is no multiple-scan output */\n  cinfo->scan_info = NULL;\n  cinfo->num_scans = 0;\n\n  /* Expect normal source image, not raw downsampled data */\n  cinfo->raw_data_in = FALSE;\n\n  /* Use Huffman coding, not arithmetic coding, by default */\n  cinfo->arith_code = FALSE;\n\n  /* By default, don't do extra passes to optimize entropy coding */\n  cinfo->optimize_coding = FALSE;\n  /* The standard Huffman tables are only valid for 8-bit data precision.\n   * If the precision is higher, force optimization on so that usable\n   * tables will be computed.  This test can be removed if default tables\n   * are supplied that are valid for the desired precision.\n   */\n  if (cinfo->data_precision > 8)\n    cinfo->optimize_coding = TRUE;\n\n  /* By default, use the simpler non-cosited sampling alignment */\n  cinfo->CCIR601_sampling = FALSE;\n\n#if JPEG_LIB_VERSION >= 70\n  /* By default, apply fancy downsampling */\n  cinfo->do_fancy_downsampling = TRUE;\n#endif\n\n  /* No input smoothing */\n  cinfo->smoothing_factor = 0;\n\n  /* DCT algorithm preference */\n  cinfo->dct_method = JDCT_DEFAULT;\n\n  /* No restart markers */\n  cinfo->restart_interval = 0;\n  cinfo->restart_in_rows = 0;\n\n  /* Fill in default JFIF marker parameters.  Note that whether the marker\n   * will actually be written is determined by jpeg_set_colorspace.\n   *\n   * By default, the library emits JFIF version code 1.01.\n   * An application that wants to emit JFIF 1.02 extension markers should set\n   * JFIF_minor_version to 2.  We could probably get away with just defaulting\n   * to 1.02, but there may still be some decoders in use that will complain\n   * about that; saying 1.01 should minimize compatibility problems.\n   */\n  cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */\n  cinfo->JFIF_minor_version = 1;\n  cinfo->density_unit = 0;      /* Pixel size is unknown by default */\n  cinfo->X_density = 1;         /* Pixel aspect ratio is square by default */\n  cinfo->Y_density = 1;\n\n  /* Choose JPEG colorspace based on input space, set defaults accordingly */\n\n  jpeg_default_colorspace(cinfo);\n}\n\n\n/*\n * Select an appropriate JPEG colorspace for in_color_space.\n */\n\nGLOBAL(void)\njpeg_default_colorspace (j_compress_ptr cinfo)\n{\n  switch (cinfo->in_color_space) {\n  case JCS_GRAYSCALE:\n    jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);\n    break;\n  case JCS_RGB:\n  case JCS_EXT_RGB:\n  case JCS_EXT_RGBX:\n  case JCS_EXT_BGR:\n  case JCS_EXT_BGRX:\n  case JCS_EXT_XBGR:\n  case JCS_EXT_XRGB:\n  case JCS_EXT_RGBA:\n  case JCS_EXT_BGRA:\n  case JCS_EXT_ABGR:\n  case JCS_EXT_ARGB:\n    jpeg_set_colorspace(cinfo, JCS_YCbCr);\n    break;\n  case JCS_YCbCr:\n    jpeg_set_colorspace(cinfo, JCS_YCbCr);\n    break;\n  case JCS_CMYK:\n    jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */\n    break;\n  case JCS_YCCK:\n    jpeg_set_colorspace(cinfo, JCS_YCCK);\n    break;\n  case JCS_UNKNOWN:\n    jpeg_set_colorspace(cinfo, JCS_UNKNOWN);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n  }\n}\n\n\n/*\n * Set the JPEG colorspace, and choose colorspace-dependent default values.\n */\n\nGLOBAL(void)\njpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)\n{\n  jpeg_component_info *compptr;\n  int ci;\n\n#define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl)  \\\n  (compptr = &cinfo->comp_info[index], \\\n   compptr->component_id = (id), \\\n   compptr->h_samp_factor = (hsamp), \\\n   compptr->v_samp_factor = (vsamp), \\\n   compptr->quant_tbl_no = (quant), \\\n   compptr->dc_tbl_no = (dctbl), \\\n   compptr->ac_tbl_no = (actbl) )\n\n  /* Safety check to ensure start_compress not called yet. */\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* For all colorspaces, we use Q and Huff tables 0 for luminance components,\n   * tables 1 for chrominance components.\n   */\n\n  cinfo->jpeg_color_space = colorspace;\n\n  cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */\n  cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */\n\n  switch (colorspace) {\n  case JCS_GRAYSCALE:\n    cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */\n    cinfo->num_components = 1;\n    /* JFIF specifies component ID 1 */\n    SET_COMP(0, 1, 1,1, 0, 0,0);\n    break;\n  case JCS_RGB:\n    cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */\n    cinfo->num_components = 3;\n    SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0);\n    SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0);\n    SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0);\n    break;\n  case JCS_YCbCr:\n    cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */\n    cinfo->num_components = 3;\n    /* JFIF specifies component IDs 1,2,3 */\n    /* We default to 2x2 subsamples of chrominance */\n    SET_COMP(0, 1, 2,2, 0, 0,0);\n    SET_COMP(1, 2, 1,1, 1, 1,1);\n    SET_COMP(2, 3, 1,1, 1, 1,1);\n    break;\n  case JCS_CMYK:\n    cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */\n    cinfo->num_components = 4;\n    SET_COMP(0, 0x43 /* 'C' */, 1,1, 0, 0,0);\n    SET_COMP(1, 0x4D /* 'M' */, 1,1, 0, 0,0);\n    SET_COMP(2, 0x59 /* 'Y' */, 1,1, 0, 0,0);\n    SET_COMP(3, 0x4B /* 'K' */, 1,1, 0, 0,0);\n    break;\n  case JCS_YCCK:\n    cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */\n    cinfo->num_components = 4;\n    SET_COMP(0, 1, 2,2, 0, 0,0);\n    SET_COMP(1, 2, 1,1, 1, 1,1);\n    SET_COMP(2, 3, 1,1, 1, 1,1);\n    SET_COMP(3, 4, 2,2, 0, 0,0);\n    break;\n  case JCS_UNKNOWN:\n    cinfo->num_components = cinfo->input_components;\n    if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS)\n      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,\n               MAX_COMPONENTS);\n    for (ci = 0; ci < cinfo->num_components; ci++) {\n      SET_COMP(ci, ci, 1,1, 0, 0,0);\n    }\n    break;\n  default:\n    ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n  }\n}\n\n\n#ifdef C_PROGRESSIVE_SUPPORTED\n\nLOCAL(jpeg_scan_info *)\nfill_a_scan (jpeg_scan_info *scanptr, int ci,\n             int Ss, int Se, int Ah, int Al)\n/* Support routine: generate one scan for specified component */\n{\n  scanptr->comps_in_scan = 1;\n  scanptr->component_index[0] = ci;\n  scanptr->Ss = Ss;\n  scanptr->Se = Se;\n  scanptr->Ah = Ah;\n  scanptr->Al = Al;\n  scanptr++;\n  return scanptr;\n}\n\nLOCAL(jpeg_scan_info *)\nfill_scans (jpeg_scan_info *scanptr, int ncomps,\n            int Ss, int Se, int Ah, int Al)\n/* Support routine: generate one scan for each component */\n{\n  int ci;\n\n  for (ci = 0; ci < ncomps; ci++) {\n    scanptr->comps_in_scan = 1;\n    scanptr->component_index[0] = ci;\n    scanptr->Ss = Ss;\n    scanptr->Se = Se;\n    scanptr->Ah = Ah;\n    scanptr->Al = Al;\n    scanptr++;\n  }\n  return scanptr;\n}\n\nLOCAL(jpeg_scan_info *)\nfill_dc_scans (jpeg_scan_info *scanptr, int ncomps, int Ah, int Al)\n/* Support routine: generate interleaved DC scan if possible, else N scans */\n{\n  int ci;\n\n  if (ncomps <= MAX_COMPS_IN_SCAN) {\n    /* Single interleaved DC scan */\n    scanptr->comps_in_scan = ncomps;\n    for (ci = 0; ci < ncomps; ci++)\n      scanptr->component_index[ci] = ci;\n    scanptr->Ss = scanptr->Se = 0;\n    scanptr->Ah = Ah;\n    scanptr->Al = Al;\n    scanptr++;\n  } else {\n    /* Noninterleaved DC scan for each component */\n    scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al);\n  }\n  return scanptr;\n}\n\n\n/*\n * Create a recommended progressive-JPEG script.\n * cinfo->num_components and cinfo->jpeg_color_space must be correct.\n */\n\nGLOBAL(void)\njpeg_simple_progression (j_compress_ptr cinfo)\n{\n  int ncomps = cinfo->num_components;\n  int nscans;\n  jpeg_scan_info *scanptr;\n\n  /* Safety check to ensure start_compress not called yet. */\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* Figure space needed for script.  Calculation must match code below! */\n  if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {\n    /* Custom script for YCbCr color images. */\n    nscans = 10;\n  } else {\n    /* All-purpose script for other color spaces. */\n    if (ncomps > MAX_COMPS_IN_SCAN)\n      nscans = 6 * ncomps;      /* 2 DC + 4 AC scans per component */\n    else\n      nscans = 2 + 4 * ncomps;  /* 2 DC scans; 4 AC scans per component */\n  }\n\n  /* Allocate space for script.\n   * We need to put it in the permanent pool in case the application performs\n   * multiple compressions without changing the settings.  To avoid a memory\n   * leak if jpeg_simple_progression is called repeatedly for the same JPEG\n   * object, we try to re-use previously allocated space, and we allocate\n   * enough space to handle YCbCr even if initially asked for grayscale.\n   */\n  if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) {\n    cinfo->script_space_size = MAX(nscans, 10);\n    cinfo->script_space = (jpeg_scan_info *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n                        cinfo->script_space_size * sizeof(jpeg_scan_info));\n  }\n  scanptr = cinfo->script_space;\n  cinfo->scan_info = scanptr;\n  cinfo->num_scans = nscans;\n\n  if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {\n    /* Custom script for YCbCr color images. */\n    /* Initial DC scan */\n    scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);\n    /* Initial AC scan: get some luma data out in a hurry */\n    scanptr = fill_a_scan(scanptr, 0, 1, 5, 0, 2);\n    /* Chroma data is too small to be worth expending many scans on */\n    scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 1);\n    scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 1);\n    /* Complete spectral selection for luma AC */\n    scanptr = fill_a_scan(scanptr, 0, 6, 63, 0, 2);\n    /* Refine next bit of luma AC */\n    scanptr = fill_a_scan(scanptr, 0, 1, 63, 2, 1);\n    /* Finish DC successive approximation */\n    scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);\n    /* Finish AC successive approximation */\n    scanptr = fill_a_scan(scanptr, 2, 1, 63, 1, 0);\n    scanptr = fill_a_scan(scanptr, 1, 1, 63, 1, 0);\n    /* Luma bottom bit comes last since it's usually largest scan */\n    scanptr = fill_a_scan(scanptr, 0, 1, 63, 1, 0);\n  } else {\n    /* All-purpose script for other color spaces. */\n    /* Successive approximation first pass */\n    scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);\n    scanptr = fill_scans(scanptr, ncomps, 1, 5, 0, 2);\n    scanptr = fill_scans(scanptr, ncomps, 6, 63, 0, 2);\n    /* Successive approximation second pass */\n    scanptr = fill_scans(scanptr, ncomps, 1, 63, 2, 1);\n    /* Successive approximation final pass */\n    scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);\n    scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0);\n  }\n}\n\n#endif /* C_PROGRESSIVE_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jcphuff.c",
    "content": "/*\n * jcphuff.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1995-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains Huffman entropy encoding routines for progressive JPEG.\n *\n * We do not support output suspension in this module, since the library\n * currently does not allow multiple-scan files to be written with output\n * suspension.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jchuff.h\"             /* Declarations shared with jchuff.c */\n\n#ifdef C_PROGRESSIVE_SUPPORTED\n\n/* Expanded entropy encoder object for progressive Huffman encoding. */\n\ntypedef struct {\n  struct jpeg_entropy_encoder pub; /* public fields */\n\n  /* Mode flag: TRUE for optimization, FALSE for actual data output */\n  boolean gather_statistics;\n\n  /* Bit-level coding status.\n   * next_output_byte/free_in_buffer are local copies of cinfo->dest fields.\n   */\n  JOCTET *next_output_byte;     /* => next byte to write in buffer */\n  size_t free_in_buffer;        /* # of byte spaces remaining in buffer */\n  size_t put_buffer;            /* current bit-accumulation buffer */\n  int put_bits;                 /* # of bits now in it */\n  j_compress_ptr cinfo;         /* link to cinfo (needed for dump_buffer) */\n\n  /* Coding status for DC components */\n  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */\n\n  /* Coding status for AC components */\n  int ac_tbl_no;                /* the table number of the single component */\n  unsigned int EOBRUN;          /* run length of EOBs */\n  unsigned int BE;              /* # of buffered correction bits before MCU */\n  char *bit_buffer;             /* buffer for correction bits (1 per char) */\n  /* packing correction bits tightly would save some space but cost time... */\n\n  unsigned int restarts_to_go;  /* MCUs left in this restart interval */\n  int next_restart_num;         /* next restart number to write (0-7) */\n\n  /* Pointers to derived tables (these workspaces have image lifespan).\n   * Since any one scan codes only DC or only AC, we only need one set\n   * of tables, not one for DC and one for AC.\n   */\n  c_derived_tbl *derived_tbls[NUM_HUFF_TBLS];\n\n  /* Statistics tables for optimization; again, one set is enough */\n  long *count_ptrs[NUM_HUFF_TBLS];\n} phuff_entropy_encoder;\n\ntypedef phuff_entropy_encoder *phuff_entropy_ptr;\n\n/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit\n * buffer can hold.  Larger sizes may slightly improve compression, but\n * 1000 is already well into the realm of overkill.\n * The minimum safe size is 64 bits.\n */\n\n#define MAX_CORR_BITS  1000     /* Max # of correction bits I can buffer */\n\n/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than JLONG.\n * We assume that int right shift is unsigned if JLONG right shift is,\n * which should be safe.\n */\n\n#ifdef RIGHT_SHIFT_IS_UNSIGNED\n#define ISHIFT_TEMPS    int ishift_temp;\n#define IRIGHT_SHIFT(x,shft)  \\\n        ((ishift_temp = (x)) < 0 ? \\\n         (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \\\n         (ishift_temp >> (shft)))\n#else\n#define ISHIFT_TEMPS\n#define IRIGHT_SHIFT(x,shft)    ((x) >> (shft))\n#endif\n\n/* Forward declarations */\nMETHODDEF(boolean) encode_mcu_DC_first (j_compress_ptr cinfo,\n                                        JBLOCKROW *MCU_data);\nMETHODDEF(boolean) encode_mcu_AC_first (j_compress_ptr cinfo,\n                                        JBLOCKROW *MCU_data);\nMETHODDEF(boolean) encode_mcu_DC_refine (j_compress_ptr cinfo,\n                                         JBLOCKROW *MCU_data);\nMETHODDEF(boolean) encode_mcu_AC_refine (j_compress_ptr cinfo,\n                                         JBLOCKROW *MCU_data);\nMETHODDEF(void) finish_pass_phuff (j_compress_ptr cinfo);\nMETHODDEF(void) finish_pass_gather_phuff (j_compress_ptr cinfo);\n\n\n/*\n * Initialize for a Huffman-compressed scan using progressive JPEG.\n */\n\nMETHODDEF(void)\nstart_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  boolean is_DC_band;\n  int ci, tbl;\n  jpeg_component_info *compptr;\n\n  entropy->cinfo = cinfo;\n  entropy->gather_statistics = gather_statistics;\n\n  is_DC_band = (cinfo->Ss == 0);\n\n  /* We assume jcmaster.c already validated the scan parameters. */\n\n  /* Select execution routines */\n  if (cinfo->Ah == 0) {\n    if (is_DC_band)\n      entropy->pub.encode_mcu = encode_mcu_DC_first;\n    else\n      entropy->pub.encode_mcu = encode_mcu_AC_first;\n  } else {\n    if (is_DC_band)\n      entropy->pub.encode_mcu = encode_mcu_DC_refine;\n    else {\n      entropy->pub.encode_mcu = encode_mcu_AC_refine;\n      /* AC refinement needs a correction bit buffer */\n      if (entropy->bit_buffer == NULL)\n        entropy->bit_buffer = (char *)\n          (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                      MAX_CORR_BITS * sizeof(char));\n    }\n  }\n  if (gather_statistics)\n    entropy->pub.finish_pass = finish_pass_gather_phuff;\n  else\n    entropy->pub.finish_pass = finish_pass_phuff;\n\n  /* Only DC coefficients may be interleaved, so cinfo->comps_in_scan = 1\n   * for AC coefficients.\n   */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    /* Initialize DC predictions to 0 */\n    entropy->last_dc_val[ci] = 0;\n    /* Get table index */\n    if (is_DC_band) {\n      if (cinfo->Ah != 0)       /* DC refinement needs no table */\n        continue;\n      tbl = compptr->dc_tbl_no;\n    } else {\n      entropy->ac_tbl_no = tbl = compptr->ac_tbl_no;\n    }\n    if (gather_statistics) {\n      /* Check for invalid table index */\n      /* (make_c_derived_tbl does this in the other path) */\n      if (tbl < 0 || tbl >= NUM_HUFF_TBLS)\n        ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);\n      /* Allocate and zero the statistics tables */\n      /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */\n      if (entropy->count_ptrs[tbl] == NULL)\n        entropy->count_ptrs[tbl] = (long *)\n          (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                      257 * sizeof(long));\n      MEMZERO(entropy->count_ptrs[tbl], 257 * sizeof(long));\n    } else {\n      /* Compute derived values for Huffman table */\n      /* We may do this more than once for a table, but it's not expensive */\n      jpeg_make_c_derived_tbl(cinfo, is_DC_band, tbl,\n                              & entropy->derived_tbls[tbl]);\n    }\n  }\n\n  /* Initialize AC stuff */\n  entropy->EOBRUN = 0;\n  entropy->BE = 0;\n\n  /* Initialize bit buffer to empty */\n  entropy->put_buffer = 0;\n  entropy->put_bits = 0;\n\n  /* Initialize restart stuff */\n  entropy->restarts_to_go = cinfo->restart_interval;\n  entropy->next_restart_num = 0;\n}\n\n\n/* Outputting bytes to the file.\n * NB: these must be called only when actually outputting,\n * that is, entropy->gather_statistics == FALSE.\n */\n\n/* Emit a byte */\n#define emit_byte(entropy,val)  \\\n        { *(entropy)->next_output_byte++ = (JOCTET) (val);  \\\n          if (--(entropy)->free_in_buffer == 0)  \\\n            dump_buffer(entropy); }\n\n\nLOCAL(void)\ndump_buffer (phuff_entropy_ptr entropy)\n/* Empty the output buffer; we do not support suspension in this module. */\n{\n  struct jpeg_destination_mgr *dest = entropy->cinfo->dest;\n\n  if (! (*dest->empty_output_buffer) (entropy->cinfo))\n    ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND);\n  /* After a successful buffer dump, must reset buffer pointers */\n  entropy->next_output_byte = dest->next_output_byte;\n  entropy->free_in_buffer = dest->free_in_buffer;\n}\n\n\n/* Outputting bits to the file */\n\n/* Only the right 24 bits of put_buffer are used; the valid bits are\n * left-justified in this part.  At most 16 bits can be passed to emit_bits\n * in one call, and we never retain more than 7 bits in put_buffer\n * between calls, so 24 bits are sufficient.\n */\n\nLOCAL(void)\nemit_bits (phuff_entropy_ptr entropy, unsigned int code, int size)\n/* Emit some bits, unless we are in gather mode */\n{\n  /* This routine is heavily used, so it's worth coding tightly. */\n  register size_t put_buffer = (size_t) code;\n  register int put_bits = entropy->put_bits;\n\n  /* if size is 0, caller used an invalid Huffman table entry */\n  if (size == 0)\n    ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);\n\n  if (entropy->gather_statistics)\n    return;                     /* do nothing if we're only getting stats */\n\n  put_buffer &= (((size_t) 1)<<size) - 1; /* mask off any extra bits in code */\n\n  put_bits += size;             /* new number of bits in buffer */\n\n  put_buffer <<= 24 - put_bits; /* align incoming bits */\n\n  put_buffer |= entropy->put_buffer; /* and merge with old buffer contents */\n\n  while (put_bits >= 8) {\n    int c = (int) ((put_buffer >> 16) & 0xFF);\n\n    emit_byte(entropy, c);\n    if (c == 0xFF) {            /* need to stuff a zero byte? */\n      emit_byte(entropy, 0);\n    }\n    put_buffer <<= 8;\n    put_bits -= 8;\n  }\n\n  entropy->put_buffer = put_buffer; /* update variables */\n  entropy->put_bits = put_bits;\n}\n\n\nLOCAL(void)\nflush_bits (phuff_entropy_ptr entropy)\n{\n  emit_bits(entropy, 0x7F, 7); /* fill any partial byte with ones */\n  entropy->put_buffer = 0;     /* and reset bit-buffer to empty */\n  entropy->put_bits = 0;\n}\n\n\n/*\n * Emit (or just count) a Huffman symbol.\n */\n\nLOCAL(void)\nemit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol)\n{\n  if (entropy->gather_statistics)\n    entropy->count_ptrs[tbl_no][symbol]++;\n  else {\n    c_derived_tbl *tbl = entropy->derived_tbls[tbl_no];\n    emit_bits(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]);\n  }\n}\n\n\n/*\n * Emit bits from a correction bit buffer.\n */\n\nLOCAL(void)\nemit_buffered_bits (phuff_entropy_ptr entropy, char *bufstart,\n                    unsigned int nbits)\n{\n  if (entropy->gather_statistics)\n    return;                     /* no real work */\n\n  while (nbits > 0) {\n    emit_bits(entropy, (unsigned int) (*bufstart), 1);\n    bufstart++;\n    nbits--;\n  }\n}\n\n\n/*\n * Emit any pending EOBRUN symbol.\n */\n\nLOCAL(void)\nemit_eobrun (phuff_entropy_ptr entropy)\n{\n  register int temp, nbits;\n\n  if (entropy->EOBRUN > 0) {    /* if there is any pending EOBRUN */\n    temp = entropy->EOBRUN;\n    nbits = 0;\n    while ((temp >>= 1))\n      nbits++;\n    /* safety check: shouldn't happen given limited correction-bit buffer */\n    if (nbits > 14)\n      ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);\n\n    emit_symbol(entropy, entropy->ac_tbl_no, nbits << 4);\n    if (nbits)\n      emit_bits(entropy, entropy->EOBRUN, nbits);\n\n    entropy->EOBRUN = 0;\n\n    /* Emit any buffered correction bits */\n    emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE);\n    entropy->BE = 0;\n  }\n}\n\n\n/*\n * Emit a restart marker & resynchronize predictions.\n */\n\nLOCAL(void)\nemit_restart (phuff_entropy_ptr entropy, int restart_num)\n{\n  int ci;\n\n  emit_eobrun(entropy);\n\n  if (! entropy->gather_statistics) {\n    flush_bits(entropy);\n    emit_byte(entropy, 0xFF);\n    emit_byte(entropy, JPEG_RST0 + restart_num);\n  }\n\n  if (entropy->cinfo->Ss == 0) {\n    /* Re-initialize DC predictions to 0 */\n    for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++)\n      entropy->last_dc_val[ci] = 0;\n  } else {\n    /* Re-initialize all AC-related fields to 0 */\n    entropy->EOBRUN = 0;\n    entropy->BE = 0;\n  }\n}\n\n\n/*\n * MCU encoding for DC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\nencode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  register int temp, temp2;\n  register int nbits;\n  int blkn, ci;\n  int Al = cinfo->Al;\n  JBLOCKROW block;\n  jpeg_component_info *compptr;\n  ISHIFT_TEMPS\n\n  entropy->next_output_byte = cinfo->dest->next_output_byte;\n  entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval)\n    if (entropy->restarts_to_go == 0)\n      emit_restart(entropy, entropy->next_restart_num);\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n    ci = cinfo->MCU_membership[blkn];\n    compptr = cinfo->cur_comp_info[ci];\n\n    /* Compute the DC value after the required point transform by Al.\n     * This is simply an arithmetic right shift.\n     */\n    temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al);\n\n    /* DC differences are figured on the point-transformed values. */\n    temp = temp2 - entropy->last_dc_val[ci];\n    entropy->last_dc_val[ci] = temp2;\n\n    /* Encode the DC coefficient difference per section G.1.2.1 */\n    temp2 = temp;\n    if (temp < 0) {\n      temp = -temp;             /* temp is abs value of input */\n      /* For a negative input, want temp2 = bitwise complement of abs(input) */\n      /* This code assumes we are on a two's complement machine */\n      temp2--;\n    }\n\n    /* Find the number of bits needed for the magnitude of the coefficient */\n    nbits = 0;\n    while (temp) {\n      nbits++;\n      temp >>= 1;\n    }\n    /* Check for out-of-range coefficient values.\n     * Since we're encoding a difference, the range limit is twice as much.\n     */\n    if (nbits > MAX_COEF_BITS+1)\n      ERREXIT(cinfo, JERR_BAD_DCT_COEF);\n\n    /* Count/emit the Huffman-coded symbol for the number of bits */\n    emit_symbol(entropy, compptr->dc_tbl_no, nbits);\n\n    /* Emit that number of bits of the value, if positive, */\n    /* or the complement of its magnitude, if negative. */\n    if (nbits)                  /* emit_bits rejects calls with size 0 */\n      emit_bits(entropy, (unsigned int) temp2, nbits);\n  }\n\n  cinfo->dest->next_output_byte = entropy->next_output_byte;\n  cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n  /* Update restart-interval state too */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for AC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\nencode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  register int temp, temp2;\n  register int nbits;\n  register int r, k;\n  int Se = cinfo->Se;\n  int Al = cinfo->Al;\n  JBLOCKROW block;\n\n  entropy->next_output_byte = cinfo->dest->next_output_byte;\n  entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval)\n    if (entropy->restarts_to_go == 0)\n      emit_restart(entropy, entropy->next_restart_num);\n\n  /* Encode the MCU data block */\n  block = MCU_data[0];\n\n  /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */\n\n  r = 0;                        /* r = run length of zeros */\n\n  for (k = cinfo->Ss; k <= Se; k++) {\n    if ((temp = (*block)[jpeg_natural_order[k]]) == 0) {\n      r++;\n      continue;\n    }\n    /* We must apply the point transform by Al.  For AC coefficients this\n     * is an integer division with rounding towards 0.  To do this portably\n     * in C, we shift after obtaining the absolute value; so the code is\n     * interwoven with finding the abs value (temp) and output bits (temp2).\n     */\n    if (temp < 0) {\n      temp = -temp;             /* temp is abs value of input */\n      temp >>= Al;              /* apply the point transform */\n      /* For a negative coef, want temp2 = bitwise complement of abs(coef) */\n      temp2 = ~temp;\n    } else {\n      temp >>= Al;              /* apply the point transform */\n      temp2 = temp;\n    }\n    /* Watch out for case that nonzero coef is zero after point transform */\n    if (temp == 0) {\n      r++;\n      continue;\n    }\n\n    /* Emit any pending EOBRUN */\n    if (entropy->EOBRUN > 0)\n      emit_eobrun(entropy);\n    /* if run length > 15, must emit special run-length-16 codes (0xF0) */\n    while (r > 15) {\n      emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);\n      r -= 16;\n    }\n\n    /* Find the number of bits needed for the magnitude of the coefficient */\n    nbits = 1;                  /* there must be at least one 1 bit */\n    while ((temp >>= 1))\n      nbits++;\n    /* Check for out-of-range coefficient values */\n    if (nbits > MAX_COEF_BITS)\n      ERREXIT(cinfo, JERR_BAD_DCT_COEF);\n\n    /* Count/emit Huffman symbol for run length / number of bits */\n    emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits);\n\n    /* Emit that number of bits of the value, if positive, */\n    /* or the complement of its magnitude, if negative. */\n    emit_bits(entropy, (unsigned int) temp2, nbits);\n\n    r = 0;                      /* reset zero run length */\n  }\n\n  if (r > 0) {                  /* If there are trailing zeroes, */\n    entropy->EOBRUN++;          /* count an EOB */\n    if (entropy->EOBRUN == 0x7FFF)\n      emit_eobrun(entropy);     /* force it out to avoid overflow */\n  }\n\n  cinfo->dest->next_output_byte = entropy->next_output_byte;\n  cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n  /* Update restart-interval state too */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for DC successive approximation refinement scan.\n * Note: we assume such scans can be multi-component, although the spec\n * is not very clear on the point.\n */\n\nMETHODDEF(boolean)\nencode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  register int temp;\n  int blkn;\n  int Al = cinfo->Al;\n  JBLOCKROW block;\n\n  entropy->next_output_byte = cinfo->dest->next_output_byte;\n  entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval)\n    if (entropy->restarts_to_go == 0)\n      emit_restart(entropy, entropy->next_restart_num);\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n\n    /* We simply emit the Al'th bit of the DC coefficient value. */\n    temp = (*block)[0];\n    emit_bits(entropy, (unsigned int) (temp >> Al), 1);\n  }\n\n  cinfo->dest->next_output_byte = entropy->next_output_byte;\n  cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n  /* Update restart-interval state too */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for AC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\nencode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  register int temp;\n  register int r, k;\n  int EOB;\n  char *BR_buffer;\n  unsigned int BR;\n  int Se = cinfo->Se;\n  int Al = cinfo->Al;\n  JBLOCKROW block;\n  int absvalues[DCTSIZE2];\n\n  entropy->next_output_byte = cinfo->dest->next_output_byte;\n  entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval)\n    if (entropy->restarts_to_go == 0)\n      emit_restart(entropy, entropy->next_restart_num);\n\n  /* Encode the MCU data block */\n  block = MCU_data[0];\n\n  /* It is convenient to make a pre-pass to determine the transformed\n   * coefficients' absolute values and the EOB position.\n   */\n  EOB = 0;\n  for (k = cinfo->Ss; k <= Se; k++) {\n    temp = (*block)[jpeg_natural_order[k]];\n    /* We must apply the point transform by Al.  For AC coefficients this\n     * is an integer division with rounding towards 0.  To do this portably\n     * in C, we shift after obtaining the absolute value.\n     */\n    if (temp < 0)\n      temp = -temp;             /* temp is abs value of input */\n    temp >>= Al;                /* apply the point transform */\n    absvalues[k] = temp;        /* save abs value for main pass */\n    if (temp == 1)\n      EOB = k;                  /* EOB = index of last newly-nonzero coef */\n  }\n\n  /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */\n\n  r = 0;                        /* r = run length of zeros */\n  BR = 0;                       /* BR = count of buffered bits added now */\n  BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */\n\n  for (k = cinfo->Ss; k <= Se; k++) {\n    if ((temp = absvalues[k]) == 0) {\n      r++;\n      continue;\n    }\n\n    /* Emit any required ZRLs, but not if they can be folded into EOB */\n    while (r > 15 && k <= EOB) {\n      /* emit any pending EOBRUN and the BE correction bits */\n      emit_eobrun(entropy);\n      /* Emit ZRL */\n      emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);\n      r -= 16;\n      /* Emit buffered correction bits that must be associated with ZRL */\n      emit_buffered_bits(entropy, BR_buffer, BR);\n      BR_buffer = entropy->bit_buffer; /* BE bits are gone now */\n      BR = 0;\n    }\n\n    /* If the coef was previously nonzero, it only needs a correction bit.\n     * NOTE: a straight translation of the spec's figure G.7 would suggest\n     * that we also need to test r > 15.  But if r > 15, we can only get here\n     * if k > EOB, which implies that this coefficient is not 1.\n     */\n    if (temp > 1) {\n      /* The correction bit is the next bit of the absolute value. */\n      BR_buffer[BR++] = (char) (temp & 1);\n      continue;\n    }\n\n    /* Emit any pending EOBRUN and the BE correction bits */\n    emit_eobrun(entropy);\n\n    /* Count/emit Huffman symbol for run length / number of bits */\n    emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1);\n\n    /* Emit output bit for newly-nonzero coef */\n    temp = ((*block)[jpeg_natural_order[k]] < 0) ? 0 : 1;\n    emit_bits(entropy, (unsigned int) temp, 1);\n\n    /* Emit buffered correction bits that must be associated with this code */\n    emit_buffered_bits(entropy, BR_buffer, BR);\n    BR_buffer = entropy->bit_buffer; /* BE bits are gone now */\n    BR = 0;\n    r = 0;                      /* reset zero run length */\n  }\n\n  if (r > 0 || BR > 0) {        /* If there are trailing zeroes, */\n    entropy->EOBRUN++;          /* count an EOB */\n    entropy->BE += BR;          /* concat my correction bits to older ones */\n    /* We force out the EOB if we risk either:\n     * 1. overflow of the EOB counter;\n     * 2. overflow of the correction bit buffer during the next MCU.\n     */\n    if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1))\n      emit_eobrun(entropy);\n  }\n\n  cinfo->dest->next_output_byte = entropy->next_output_byte;\n  cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n  /* Update restart-interval state too */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Finish up at the end of a Huffman-compressed progressive scan.\n */\n\nMETHODDEF(void)\nfinish_pass_phuff (j_compress_ptr cinfo)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n\n  entropy->next_output_byte = cinfo->dest->next_output_byte;\n  entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n  /* Flush out any buffered data */\n  emit_eobrun(entropy);\n  flush_bits(entropy);\n\n  cinfo->dest->next_output_byte = entropy->next_output_byte;\n  cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n}\n\n\n/*\n * Finish up a statistics-gathering pass and create the new Huffman tables.\n */\n\nMETHODDEF(void)\nfinish_pass_gather_phuff (j_compress_ptr cinfo)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  boolean is_DC_band;\n  int ci, tbl;\n  jpeg_component_info *compptr;\n  JHUFF_TBL **htblptr;\n  boolean did[NUM_HUFF_TBLS];\n\n  /* Flush out buffered data (all we care about is counting the EOB symbol) */\n  emit_eobrun(entropy);\n\n  is_DC_band = (cinfo->Ss == 0);\n\n  /* It's important not to apply jpeg_gen_optimal_table more than once\n   * per table, because it clobbers the input frequency counts!\n   */\n  MEMZERO(did, sizeof(did));\n\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    if (is_DC_band) {\n      if (cinfo->Ah != 0)       /* DC refinement needs no table */\n        continue;\n      tbl = compptr->dc_tbl_no;\n    } else {\n      tbl = compptr->ac_tbl_no;\n    }\n    if (! did[tbl]) {\n      if (is_DC_band)\n        htblptr = & cinfo->dc_huff_tbl_ptrs[tbl];\n      else\n        htblptr = & cinfo->ac_huff_tbl_ptrs[tbl];\n      if (*htblptr == NULL)\n        *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);\n      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[tbl]);\n      did[tbl] = TRUE;\n    }\n  }\n}\n\n\n/*\n * Module initialization routine for progressive Huffman entropy encoding.\n */\n\nGLOBAL(void)\njinit_phuff_encoder (j_compress_ptr cinfo)\n{\n  phuff_entropy_ptr entropy;\n  int i;\n\n  entropy = (phuff_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(phuff_entropy_encoder));\n  cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;\n  entropy->pub.start_pass = start_pass_phuff;\n\n  /* Mark tables unallocated */\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    entropy->derived_tbls[i] = NULL;\n    entropy->count_ptrs[i] = NULL;\n  }\n  entropy->bit_buffer = NULL;   /* needed only in AC refinement scan */\n}\n\n#endif /* C_PROGRESSIVE_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jcprepct.c",
    "content": "/*\n * jcprepct.c\n *\n * This file is part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains the compression preprocessing controller.\n * This controller manages the color conversion, downsampling,\n * and edge expansion steps.\n *\n * Most of the complexity here is associated with buffering input rows\n * as required by the downsampler.  See the comments at the head of\n * jcsample.c for the downsampler's needs.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* At present, jcsample.c can request context rows only for smoothing.\n * In the future, we might also need context rows for CCIR601 sampling\n * or other more-complex downsampling procedures.  The code to support\n * context rows should be compiled only if needed.\n */\n#ifdef INPUT_SMOOTHING_SUPPORTED\n#define CONTEXT_ROWS_SUPPORTED\n#endif\n\n\n/*\n * For the simple (no-context-row) case, we just need to buffer one\n * row group's worth of pixels for the downsampling step.  At the bottom of\n * the image, we pad to a full row group by replicating the last pixel row.\n * The downsampler's last output row is then replicated if needed to pad\n * out to a full iMCU row.\n *\n * When providing context rows, we must buffer three row groups' worth of\n * pixels.  Three row groups are physically allocated, but the row pointer\n * arrays are made five row groups high, with the extra pointers above and\n * below \"wrapping around\" to point to the last and first real row groups.\n * This allows the downsampler to access the proper context rows.\n * At the top and bottom of the image, we create dummy context rows by\n * copying the first or last real pixel row.  This copying could be avoided\n * by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the\n * trouble on the compression side.\n */\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_c_prep_controller pub; /* public fields */\n\n  /* Downsampling input buffer.  This buffer holds color-converted data\n   * until we have enough to do a downsample step.\n   */\n  JSAMPARRAY color_buf[MAX_COMPONENTS];\n\n  JDIMENSION rows_to_go;        /* counts rows remaining in source image */\n  int next_buf_row;             /* index of next row to store in color_buf */\n\n#ifdef CONTEXT_ROWS_SUPPORTED   /* only needed for context case */\n  int this_row_group;           /* starting row index of group to process */\n  int next_buf_stop;            /* downsample when we reach this index */\n#endif\n} my_prep_controller;\n\ntypedef my_prep_controller *my_prep_ptr;\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;\n\n  if (pass_mode != JBUF_PASS_THRU)\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n\n  /* Initialize total-height counter for detecting bottom of image */\n  prep->rows_to_go = cinfo->image_height;\n  /* Mark the conversion buffer empty */\n  prep->next_buf_row = 0;\n#ifdef CONTEXT_ROWS_SUPPORTED\n  /* Preset additional state variables for context mode.\n   * These aren't used in non-context mode, so we needn't test which mode.\n   */\n  prep->this_row_group = 0;\n  /* Set next_buf_stop to stop after two row groups have been read in. */\n  prep->next_buf_stop = 2 * cinfo->max_v_samp_factor;\n#endif\n}\n\n\n/*\n * Expand an image vertically from height input_rows to height output_rows,\n * by duplicating the bottom row.\n */\n\nLOCAL(void)\nexpand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols,\n                    int input_rows, int output_rows)\n{\n  register int row;\n\n  for (row = input_rows; row < output_rows; row++) {\n    jcopy_sample_rows(image_data, input_rows-1, image_data, row,\n                      1, num_cols);\n  }\n}\n\n\n/*\n * Process some data in the simple no-context case.\n *\n * Preprocessor output data is counted in \"row groups\".  A row group\n * is defined to be v_samp_factor sample rows of each component.\n * Downsampling will produce this much data from each max_v_samp_factor\n * input rows.\n */\n\nMETHODDEF(void)\npre_process_data (j_compress_ptr cinfo,\n                  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,\n                  JDIMENSION in_rows_avail,\n                  JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,\n                  JDIMENSION out_row_groups_avail)\n{\n  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;\n  int numrows, ci;\n  JDIMENSION inrows;\n  jpeg_component_info *compptr;\n\n  while (*in_row_ctr < in_rows_avail &&\n         *out_row_group_ctr < out_row_groups_avail) {\n    /* Do color conversion to fill the conversion buffer. */\n    inrows = in_rows_avail - *in_row_ctr;\n    numrows = cinfo->max_v_samp_factor - prep->next_buf_row;\n    numrows = (int) MIN((JDIMENSION) numrows, inrows);\n    (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,\n                                       prep->color_buf,\n                                       (JDIMENSION) prep->next_buf_row,\n                                       numrows);\n    *in_row_ctr += numrows;\n    prep->next_buf_row += numrows;\n    prep->rows_to_go -= numrows;\n    /* If at bottom of image, pad to fill the conversion buffer. */\n    if (prep->rows_to_go == 0 &&\n        prep->next_buf_row < cinfo->max_v_samp_factor) {\n      for (ci = 0; ci < cinfo->num_components; ci++) {\n        expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,\n                           prep->next_buf_row, cinfo->max_v_samp_factor);\n      }\n      prep->next_buf_row = cinfo->max_v_samp_factor;\n    }\n    /* If we've filled the conversion buffer, empty it. */\n    if (prep->next_buf_row == cinfo->max_v_samp_factor) {\n      (*cinfo->downsample->downsample) (cinfo,\n                                        prep->color_buf, (JDIMENSION) 0,\n                                        output_buf, *out_row_group_ctr);\n      prep->next_buf_row = 0;\n      (*out_row_group_ctr)++;\n    }\n    /* If at bottom of image, pad the output to a full iMCU height.\n     * Note we assume the caller is providing a one-iMCU-height output buffer!\n     */\n    if (prep->rows_to_go == 0 &&\n        *out_row_group_ctr < out_row_groups_avail) {\n      for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n           ci++, compptr++) {\n        expand_bottom_edge(output_buf[ci],\n                           compptr->width_in_blocks * DCTSIZE,\n                           (int) (*out_row_group_ctr * compptr->v_samp_factor),\n                           (int) (out_row_groups_avail * compptr->v_samp_factor));\n      }\n      *out_row_group_ctr = out_row_groups_avail;\n      break;                    /* can exit outer loop without test */\n    }\n  }\n}\n\n\n#ifdef CONTEXT_ROWS_SUPPORTED\n\n/*\n * Process some data in the context case.\n */\n\nMETHODDEF(void)\npre_process_context (j_compress_ptr cinfo,\n                     JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,\n                     JDIMENSION in_rows_avail,\n                     JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,\n                     JDIMENSION out_row_groups_avail)\n{\n  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;\n  int numrows, ci;\n  int buf_height = cinfo->max_v_samp_factor * 3;\n  JDIMENSION inrows;\n\n  while (*out_row_group_ctr < out_row_groups_avail) {\n    if (*in_row_ctr < in_rows_avail) {\n      /* Do color conversion to fill the conversion buffer. */\n      inrows = in_rows_avail - *in_row_ctr;\n      numrows = prep->next_buf_stop - prep->next_buf_row;\n      numrows = (int) MIN((JDIMENSION) numrows, inrows);\n      (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,\n                                         prep->color_buf,\n                                         (JDIMENSION) prep->next_buf_row,\n                                         numrows);\n      /* Pad at top of image, if first time through */\n      if (prep->rows_to_go == cinfo->image_height) {\n        for (ci = 0; ci < cinfo->num_components; ci++) {\n          int row;\n          for (row = 1; row <= cinfo->max_v_samp_factor; row++) {\n            jcopy_sample_rows(prep->color_buf[ci], 0,\n                              prep->color_buf[ci], -row,\n                              1, cinfo->image_width);\n          }\n        }\n      }\n      *in_row_ctr += numrows;\n      prep->next_buf_row += numrows;\n      prep->rows_to_go -= numrows;\n    } else {\n      /* Return for more data, unless we are at the bottom of the image. */\n      if (prep->rows_to_go != 0)\n        break;\n      /* When at bottom of image, pad to fill the conversion buffer. */\n      if (prep->next_buf_row < prep->next_buf_stop) {\n        for (ci = 0; ci < cinfo->num_components; ci++) {\n          expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,\n                             prep->next_buf_row, prep->next_buf_stop);\n        }\n        prep->next_buf_row = prep->next_buf_stop;\n      }\n    }\n    /* If we've gotten enough data, downsample a row group. */\n    if (prep->next_buf_row == prep->next_buf_stop) {\n      (*cinfo->downsample->downsample) (cinfo,\n                                        prep->color_buf,\n                                        (JDIMENSION) prep->this_row_group,\n                                        output_buf, *out_row_group_ctr);\n      (*out_row_group_ctr)++;\n      /* Advance pointers with wraparound as necessary. */\n      prep->this_row_group += cinfo->max_v_samp_factor;\n      if (prep->this_row_group >= buf_height)\n        prep->this_row_group = 0;\n      if (prep->next_buf_row >= buf_height)\n        prep->next_buf_row = 0;\n      prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor;\n    }\n  }\n}\n\n\n/*\n * Create the wrapped-around downsampling input buffer needed for context mode.\n */\n\nLOCAL(void)\ncreate_context_buffer (j_compress_ptr cinfo)\n{\n  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;\n  int rgroup_height = cinfo->max_v_samp_factor;\n  int ci, i;\n  jpeg_component_info *compptr;\n  JSAMPARRAY true_buffer, fake_buffer;\n\n  /* Grab enough space for fake row pointers for all the components;\n   * we need five row groups' worth of pointers for each component.\n   */\n  fake_buffer = (JSAMPARRAY)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                (cinfo->num_components * 5 * rgroup_height) *\n                                sizeof(JSAMPROW));\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Allocate the actual buffer space (3 row groups) for this component.\n     * We make the buffer wide enough to allow the downsampler to edge-expand\n     * horizontally within the buffer, if it so chooses.\n     */\n    true_buffer = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *\n                      cinfo->max_h_samp_factor) / compptr->h_samp_factor),\n       (JDIMENSION) (3 * rgroup_height));\n    /* Copy true buffer row pointers into the middle of the fake row array */\n    MEMCOPY(fake_buffer + rgroup_height, true_buffer,\n            3 * rgroup_height * sizeof(JSAMPROW));\n    /* Fill in the above and below wraparound pointers */\n    for (i = 0; i < rgroup_height; i++) {\n      fake_buffer[i] = true_buffer[2 * rgroup_height + i];\n      fake_buffer[4 * rgroup_height + i] = true_buffer[i];\n    }\n    prep->color_buf[ci] = fake_buffer + rgroup_height;\n    fake_buffer += 5 * rgroup_height; /* point to space for next component */\n  }\n}\n\n#endif /* CONTEXT_ROWS_SUPPORTED */\n\n\n/*\n * Initialize preprocessing controller.\n */\n\nGLOBAL(void)\njinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer)\n{\n  my_prep_ptr prep;\n  int ci;\n  jpeg_component_info *compptr;\n\n  if (need_full_buffer)         /* safety check */\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n\n  prep = (my_prep_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_prep_controller));\n  cinfo->prep = (struct jpeg_c_prep_controller *) prep;\n  prep->pub.start_pass = start_pass_prep;\n\n  /* Allocate the color conversion buffer.\n   * We make the buffer wide enough to allow the downsampler to edge-expand\n   * horizontally within the buffer, if it so chooses.\n   */\n  if (cinfo->downsample->need_context_rows) {\n    /* Set up to provide context rows */\n#ifdef CONTEXT_ROWS_SUPPORTED\n    prep->pub.pre_process_data = pre_process_context;\n    create_context_buffer(cinfo);\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n  } else {\n    /* No context, just make it tall enough for one row group */\n    prep->pub.pre_process_data = pre_process_data;\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n         ci++, compptr++) {\n      prep->color_buf[ci] = (*cinfo->mem->alloc_sarray)\n        ((j_common_ptr) cinfo, JPOOL_IMAGE,\n         (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *\n                        cinfo->max_h_samp_factor) / compptr->h_samp_factor),\n         (JDIMENSION) cinfo->max_v_samp_factor);\n    }\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jcsample.c",
    "content": "/*\n * jcsample.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2014, MIPS Technologies, Inc., California.\n * Copyright (C) 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains downsampling routines.\n *\n * Downsampling input data is counted in \"row groups\".  A row group\n * is defined to be max_v_samp_factor pixel rows of each component,\n * from which the downsampler produces v_samp_factor sample rows.\n * A single row group is processed in each call to the downsampler module.\n *\n * The downsampler is responsible for edge-expansion of its output data\n * to fill an integral number of DCT blocks horizontally.  The source buffer\n * may be modified if it is helpful for this purpose (the source buffer is\n * allocated wide enough to correspond to the desired output width).\n * The caller (the prep controller) is responsible for vertical padding.\n *\n * The downsampler may request \"context rows\" by setting need_context_rows\n * during startup.  In this case, the input arrays will contain at least\n * one row group's worth of pixels above and below the passed-in data;\n * the caller will create dummy rows at image top and bottom by replicating\n * the first or last real pixel row.\n *\n * An excellent reference for image resampling is\n *   Digital Image Warping, George Wolberg, 1990.\n *   Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.\n *\n * The downsampling algorithm used here is a simple average of the source\n * pixels covered by the output pixel.  The hi-falutin sampling literature\n * refers to this as a \"box filter\".  In general the characteristics of a box\n * filter are not very good, but for the specific cases we normally use (1:1\n * and 2:1 ratios) the box is equivalent to a \"triangle filter\" which is not\n * nearly so bad.  If you intend to use other sampling ratios, you'd be well\n * advised to improve this code.\n *\n * A simple input-smoothing capability is provided.  This is mainly intended\n * for cleaning up color-dithered GIF input files (if you find it inadequate,\n * we suggest using an external filtering program such as pnmconvol).  When\n * enabled, each input pixel P is replaced by a weighted sum of itself and its\n * eight neighbors.  P's weight is 1-8*SF and each neighbor's weight is SF,\n * where SF = (smoothing_factor / 1024).\n * Currently, smoothing is only supported for 2h2v sampling factors.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jsimd.h\"\n\n\n/* Pointer to routine to downsample a single component */\ntypedef void (*downsample1_ptr) (j_compress_ptr cinfo,\n                                 jpeg_component_info *compptr,\n                                 JSAMPARRAY input_data,\n                                 JSAMPARRAY output_data);\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_downsampler pub;  /* public fields */\n\n  /* Downsampling method pointers, one per component */\n  downsample1_ptr methods[MAX_COMPONENTS];\n} my_downsampler;\n\ntypedef my_downsampler *my_downsample_ptr;\n\n\n/*\n * Initialize for a downsampling pass.\n */\n\nMETHODDEF(void)\nstart_pass_downsample (j_compress_ptr cinfo)\n{\n  /* no work for now */\n}\n\n\n/*\n * Expand a component horizontally from width input_cols to width output_cols,\n * by duplicating the rightmost samples.\n */\n\nLOCAL(void)\nexpand_right_edge (JSAMPARRAY image_data, int num_rows,\n                   JDIMENSION input_cols, JDIMENSION output_cols)\n{\n  register JSAMPROW ptr;\n  register JSAMPLE pixval;\n  register int count;\n  int row;\n  int numcols = (int) (output_cols - input_cols);\n\n  if (numcols > 0) {\n    for (row = 0; row < num_rows; row++) {\n      ptr = image_data[row] + input_cols;\n      pixval = ptr[-1];         /* don't need GETJSAMPLE() here */\n      for (count = numcols; count > 0; count--)\n        *ptr++ = pixval;\n    }\n  }\n}\n\n\n/*\n * Do downsampling for a whole row group (all components).\n *\n * In this version we simply downsample each component independently.\n */\n\nMETHODDEF(void)\nsep_downsample (j_compress_ptr cinfo,\n                JSAMPIMAGE input_buf, JDIMENSION in_row_index,\n                JSAMPIMAGE output_buf, JDIMENSION out_row_group_index)\n{\n  my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;\n  int ci;\n  jpeg_component_info *compptr;\n  JSAMPARRAY in_ptr, out_ptr;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    in_ptr = input_buf[ci] + in_row_index;\n    out_ptr = output_buf[ci] + (out_row_group_index * compptr->v_samp_factor);\n    (*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr);\n  }\n}\n\n\n/*\n * Downsample pixel values of a single component.\n * One row group is processed per call.\n * This version handles arbitrary integral sampling ratios, without smoothing.\n * Note that this version is not actually used for customary sampling ratios.\n */\n\nMETHODDEF(void)\nint_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v;\n  JDIMENSION outcol, outcol_h;  /* outcol_h == outcol*h_expand */\n  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;\n  JSAMPROW inptr, outptr;\n  JLONG outvalue;\n\n  h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor;\n  v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor;\n  numpix = h_expand * v_expand;\n  numpix2 = numpix/2;\n\n  /* Expand input data enough to let all the output samples be generated\n   * by the standard loop.  Special-casing padded output would be more\n   * efficient.\n   */\n  expand_right_edge(input_data, cinfo->max_v_samp_factor,\n                    cinfo->image_width, output_cols * h_expand);\n\n  inrow = 0;\n  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {\n    outptr = output_data[outrow];\n    for (outcol = 0, outcol_h = 0; outcol < output_cols;\n         outcol++, outcol_h += h_expand) {\n      outvalue = 0;\n      for (v = 0; v < v_expand; v++) {\n        inptr = input_data[inrow+v] + outcol_h;\n        for (h = 0; h < h_expand; h++) {\n          outvalue += (JLONG) GETJSAMPLE(*inptr++);\n        }\n      }\n      *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix);\n    }\n    inrow += v_expand;\n  }\n}\n\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the special case of a full-size component,\n * without smoothing.\n */\n\nMETHODDEF(void)\nfullsize_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                     JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  /* Copy the data */\n  jcopy_sample_rows(input_data, 0, output_data, 0,\n                    cinfo->max_v_samp_factor, cinfo->image_width);\n  /* Edge-expand */\n  expand_right_edge(output_data, cinfo->max_v_samp_factor,\n                    cinfo->image_width, compptr->width_in_blocks * DCTSIZE);\n}\n\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the common case of 2:1 horizontal and 1:1 vertical,\n * without smoothing.\n *\n * A note about the \"bias\" calculations: when rounding fractional values to\n * integer, we do not want to always round 0.5 up to the next integer.\n * If we did that, we'd introduce a noticeable bias towards larger values.\n * Instead, this code is arranged so that 0.5 will be rounded up or down at\n * alternate pixel locations (a simple ordered dither pattern).\n */\n\nMETHODDEF(void)\nh2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                 JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int outrow;\n  JDIMENSION outcol;\n  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;\n  register JSAMPROW inptr, outptr;\n  register int bias;\n\n  /* Expand input data enough to let all the output samples be generated\n   * by the standard loop.  Special-casing padded output would be more\n   * efficient.\n   */\n  expand_right_edge(input_data, cinfo->max_v_samp_factor,\n                    cinfo->image_width, output_cols * 2);\n\n  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {\n    outptr = output_data[outrow];\n    inptr = input_data[outrow];\n    bias = 0;                   /* bias = 0,1,0,1,... for successive samples */\n    for (outcol = 0; outcol < output_cols; outcol++) {\n      *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1])\n                              + bias) >> 1);\n      bias ^= 1;                /* 0=>1, 1=>0 */\n      inptr += 2;\n    }\n  }\n}\n\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the standard case of 2:1 horizontal and 2:1 vertical,\n * without smoothing.\n */\n\nMETHODDEF(void)\nh2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                 JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int inrow, outrow;\n  JDIMENSION outcol;\n  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;\n  register JSAMPROW inptr0, inptr1, outptr;\n  register int bias;\n\n  /* Expand input data enough to let all the output samples be generated\n   * by the standard loop.  Special-casing padded output would be more\n   * efficient.\n   */\n  expand_right_edge(input_data, cinfo->max_v_samp_factor,\n                    cinfo->image_width, output_cols * 2);\n\n  inrow = 0;\n  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {\n    outptr = output_data[outrow];\n    inptr0 = input_data[inrow];\n    inptr1 = input_data[inrow+1];\n    bias = 1;                   /* bias = 1,2,1,2,... for successive samples */\n    for (outcol = 0; outcol < output_cols; outcol++) {\n      *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +\n                              GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1])\n                              + bias) >> 2);\n      bias ^= 3;                /* 1=>2, 2=>1 */\n      inptr0 += 2; inptr1 += 2;\n    }\n    inrow += 2;\n  }\n}\n\n\n#ifdef INPUT_SMOOTHING_SUPPORTED\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the standard case of 2:1 horizontal and 2:1 vertical,\n * with smoothing.  One row of context is required.\n */\n\nMETHODDEF(void)\nh2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                        JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int inrow, outrow;\n  JDIMENSION colctr;\n  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;\n  register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr;\n  JLONG membersum, neighsum, memberscale, neighscale;\n\n  /* Expand input data enough to let all the output samples be generated\n   * by the standard loop.  Special-casing padded output would be more\n   * efficient.\n   */\n  expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,\n                    cinfo->image_width, output_cols * 2);\n\n  /* We don't bother to form the individual \"smoothed\" input pixel values;\n   * we can directly compute the output which is the average of the four\n   * smoothed values.  Each of the four member pixels contributes a fraction\n   * (1-8*SF) to its own smoothed image and a fraction SF to each of the three\n   * other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final\n   * output.  The four corner-adjacent neighbor pixels contribute a fraction\n   * SF to just one smoothed pixel, or SF/4 to the final output; while the\n   * eight edge-adjacent neighbors contribute SF to each of two smoothed\n   * pixels, or SF/2 overall.  In order to use integer arithmetic, these\n   * factors are scaled by 2^16 = 65536.\n   * Also recall that SF = smoothing_factor / 1024.\n   */\n\n  memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */\n  neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */\n\n  inrow = 0;\n  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {\n    outptr = output_data[outrow];\n    inptr0 = input_data[inrow];\n    inptr1 = input_data[inrow+1];\n    above_ptr = input_data[inrow-1];\n    below_ptr = input_data[inrow+2];\n\n    /* Special case for first column: pretend column -1 is same as column 0 */\n    membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +\n                GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);\n    neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +\n               GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +\n               GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) +\n               GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]);\n    neighsum += neighsum;\n    neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) +\n                GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]);\n    membersum = membersum * memberscale + neighsum * neighscale;\n    *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);\n    inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;\n\n    for (colctr = output_cols - 2; colctr > 0; colctr--) {\n      /* sum of pixels directly mapped to this output element */\n      membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +\n                  GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);\n      /* sum of edge-neighbor pixels */\n      neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +\n                 GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +\n                 GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) +\n                 GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]);\n      /* The edge-neighbors count twice as much as corner-neighbors */\n      neighsum += neighsum;\n      /* Add in the corner-neighbors */\n      neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) +\n                  GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]);\n      /* form final output scaled up by 2^16 */\n      membersum = membersum * memberscale + neighsum * neighscale;\n      /* round, descale and output it */\n      *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);\n      inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;\n    }\n\n    /* Special case for last column */\n    membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +\n                GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);\n    neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +\n               GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +\n               GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) +\n               GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]);\n    neighsum += neighsum;\n    neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) +\n                GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]);\n    membersum = membersum * memberscale + neighsum * neighscale;\n    *outptr = (JSAMPLE) ((membersum + 32768) >> 16);\n\n    inrow += 2;\n  }\n}\n\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the special case of a full-size component,\n * with smoothing.  One row of context is required.\n */\n\nMETHODDEF(void)\nfullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                            JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int outrow;\n  JDIMENSION colctr;\n  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;\n  register JSAMPROW inptr, above_ptr, below_ptr, outptr;\n  JLONG membersum, neighsum, memberscale, neighscale;\n  int colsum, lastcolsum, nextcolsum;\n\n  /* Expand input data enough to let all the output samples be generated\n   * by the standard loop.  Special-casing padded output would be more\n   * efficient.\n   */\n  expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,\n                    cinfo->image_width, output_cols);\n\n  /* Each of the eight neighbor pixels contributes a fraction SF to the\n   * smoothed pixel, while the main pixel contributes (1-8*SF).  In order\n   * to use integer arithmetic, these factors are multiplied by 2^16 = 65536.\n   * Also recall that SF = smoothing_factor / 1024.\n   */\n\n  memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */\n  neighscale = cinfo->smoothing_factor * 64; /* scaled SF */\n\n  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {\n    outptr = output_data[outrow];\n    inptr = input_data[outrow];\n    above_ptr = input_data[outrow-1];\n    below_ptr = input_data[outrow+1];\n\n    /* Special case for first column */\n    colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) +\n             GETJSAMPLE(*inptr);\n    membersum = GETJSAMPLE(*inptr++);\n    nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +\n                 GETJSAMPLE(*inptr);\n    neighsum = colsum + (colsum - membersum) + nextcolsum;\n    membersum = membersum * memberscale + neighsum * neighscale;\n    *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);\n    lastcolsum = colsum; colsum = nextcolsum;\n\n    for (colctr = output_cols - 2; colctr > 0; colctr--) {\n      membersum = GETJSAMPLE(*inptr++);\n      above_ptr++; below_ptr++;\n      nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +\n                   GETJSAMPLE(*inptr);\n      neighsum = lastcolsum + (colsum - membersum) + nextcolsum;\n      membersum = membersum * memberscale + neighsum * neighscale;\n      *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);\n      lastcolsum = colsum; colsum = nextcolsum;\n    }\n\n    /* Special case for last column */\n    membersum = GETJSAMPLE(*inptr);\n    neighsum = lastcolsum + (colsum - membersum) + colsum;\n    membersum = membersum * memberscale + neighsum * neighscale;\n    *outptr = (JSAMPLE) ((membersum + 32768) >> 16);\n\n  }\n}\n\n#endif /* INPUT_SMOOTHING_SUPPORTED */\n\n\n/*\n * Module initialization routine for downsampling.\n * Note that we must select a routine for each component.\n */\n\nGLOBAL(void)\njinit_downsampler (j_compress_ptr cinfo)\n{\n  my_downsample_ptr downsample;\n  int ci;\n  jpeg_component_info *compptr;\n  boolean smoothok = TRUE;\n\n  downsample = (my_downsample_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_downsampler));\n  cinfo->downsample = (struct jpeg_downsampler *) downsample;\n  downsample->pub.start_pass = start_pass_downsample;\n  downsample->pub.downsample = sep_downsample;\n  downsample->pub.need_context_rows = FALSE;\n\n  if (cinfo->CCIR601_sampling)\n    ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);\n\n  /* Verify we can handle the sampling factors, and set up method pointers */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    if (compptr->h_samp_factor == cinfo->max_h_samp_factor &&\n        compptr->v_samp_factor == cinfo->max_v_samp_factor) {\n#ifdef INPUT_SMOOTHING_SUPPORTED\n      if (cinfo->smoothing_factor) {\n        downsample->methods[ci] = fullsize_smooth_downsample;\n        downsample->pub.need_context_rows = TRUE;\n      } else\n#endif\n        downsample->methods[ci] = fullsize_downsample;\n    } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&\n               compptr->v_samp_factor == cinfo->max_v_samp_factor) {\n      smoothok = FALSE;\n      if (jsimd_can_h2v1_downsample())\n        downsample->methods[ci] = jsimd_h2v1_downsample;\n      else\n        downsample->methods[ci] = h2v1_downsample;\n    } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&\n               compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) {\n#ifdef INPUT_SMOOTHING_SUPPORTED\n      if (cinfo->smoothing_factor) {\n#if defined(__mips__)\n        if (jsimd_can_h2v2_smooth_downsample())\n          downsample->methods[ci] = jsimd_h2v2_smooth_downsample;\n        else\n#endif\n          downsample->methods[ci] = h2v2_smooth_downsample;\n        downsample->pub.need_context_rows = TRUE;\n      } else\n#endif\n      {\n        if (jsimd_can_h2v2_downsample())\n          downsample->methods[ci] = jsimd_h2v2_downsample;\n        else\n          downsample->methods[ci] = h2v2_downsample;\n      }\n    } else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 &&\n               (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) {\n      smoothok = FALSE;\n      downsample->methods[ci] = int_downsample;\n    } else\n      ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);\n  }\n\n#ifdef INPUT_SMOOTHING_SUPPORTED\n  if (cinfo->smoothing_factor && !smoothok)\n    TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL);\n#endif\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jcstest.c",
    "content": "/*\n * Copyright (C)2011 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* This program demonstrates how to check for the colorspace extension\n   capabilities of libjpeg-turbo at both compile time and run time. */\n\n#include <stdio.h>\n#include <jpeglib.h>\n#include <jerror.h>\n#include <setjmp.h>\n\n#ifndef JCS_EXTENSIONS\n#define JCS_EXT_RGB 6\n#endif\n#if !defined(JCS_EXTENSIONS) || !defined(JCS_ALPHA_EXTENSIONS)\n#define JCS_EXT_RGBA 12\n#endif\n\nstatic char lasterror[JMSG_LENGTH_MAX] = \"No error\";\n\ntypedef struct _error_mgr {\n  struct jpeg_error_mgr pub;\n  jmp_buf jb;\n} error_mgr;\n\nstatic void my_error_exit(j_common_ptr cinfo)\n{\n  error_mgr *myerr = (error_mgr *)cinfo->err;\n  (*cinfo->err->output_message)(cinfo);\n  longjmp(myerr->jb, 1);\n}\n\nstatic void my_output_message(j_common_ptr cinfo)\n{\n  (*cinfo->err->format_message)(cinfo, lasterror);\n}\n\nint main(void)\n{\n  int jcs_valid = -1, jcs_alpha_valid = -1;\n  struct jpeg_compress_struct cinfo;\n  error_mgr jerr;\n\n  printf(\"libjpeg-turbo colorspace extensions:\\n\");\n  #if JCS_EXTENSIONS\n  printf(\"  Present at compile time\\n\");\n  #else\n  printf(\"  Not present at compile time\\n\");\n  #endif\n\n  cinfo.err = jpeg_std_error(&jerr.pub);\n  jerr.pub.error_exit = my_error_exit;\n  jerr.pub.output_message = my_output_message;\n\n  if(setjmp(jerr.jb)) {\n    /* this will execute if libjpeg has an error */\n    jcs_valid = 0;\n    goto done;\n  }\n\n  jpeg_create_compress(&cinfo);\n  cinfo.input_components = 3;\n  jpeg_set_defaults(&cinfo);\n  cinfo.in_color_space = JCS_EXT_RGB;\n  jpeg_default_colorspace(&cinfo);\n  jcs_valid = 1;\n\n  done:\n  if (jcs_valid)\n    printf(\"  Working properly\\n\");\n  else\n    printf(\"  Not working properly.  Error returned was:\\n    %s\\n\",\n           lasterror);\n\n  printf(\"libjpeg-turbo alpha colorspace extensions:\\n\");\n  #if JCS_ALPHA_EXTENSIONS\n  printf(\"  Present at compile time\\n\");\n  #else\n  printf(\"  Not present at compile time\\n\");\n  #endif\n\n  if(setjmp(jerr.jb)) {\n    /* this will execute if libjpeg has an error */\n    jcs_alpha_valid = 0;\n    goto done2;\n  }\n\n  cinfo.in_color_space = JCS_EXT_RGBA;\n  jpeg_default_colorspace(&cinfo);\n  jcs_alpha_valid = 1;\n\n  done2:\n  if (jcs_alpha_valid)\n    printf(\"  Working properly\\n\");\n  else\n    printf(\"  Not working properly.  Error returned was:\\n    %s\\n\",\n           lasterror);\n\n  jpeg_destroy_compress(&cinfo);\n  return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jctrans.c",
    "content": "/*\n * jctrans.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1995-1998, Thomas G. Lane.\n * Modified 2000-2009 by Guido Vollbeding.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains library routines for transcoding compression,\n * that is, writing raw DCT coefficient arrays to an output JPEG file.\n * The routines in jcapimin.c will also be needed by a transcoder.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Forward declarations */\nLOCAL(void) transencode_master_selection\n        (j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays);\nLOCAL(void) transencode_coef_controller\n        (j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays);\n\n\n/*\n * Compression initialization for writing raw-coefficient data.\n * Before calling this, all parameters and a data destination must be set up.\n * Call jpeg_finish_compress() to actually write the data.\n *\n * The number of passed virtual arrays must match cinfo->num_components.\n * Note that the virtual arrays need not be filled or even realized at\n * the time write_coefficients is called; indeed, if the virtual arrays\n * were requested from this compression object's memory manager, they\n * typically will be realized during this routine and filled afterwards.\n */\n\nGLOBAL(void)\njpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays)\n{\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  /* Mark all tables to be written */\n  jpeg_suppress_tables(cinfo, FALSE);\n  /* (Re)initialize error mgr and destination modules */\n  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);\n  (*cinfo->dest->init_destination) (cinfo);\n  /* Perform master selection of active modules */\n  transencode_master_selection(cinfo, coef_arrays);\n  /* Wait for jpeg_finish_compress() call */\n  cinfo->next_scanline = 0;     /* so jpeg_write_marker works */\n  cinfo->global_state = CSTATE_WRCOEFS;\n}\n\n\n/*\n * Initialize the compression object with default parameters,\n * then copy from the source object all parameters needed for lossless\n * transcoding.  Parameters that can be varied without loss (such as\n * scan script and Huffman optimization) are left in their default states.\n */\n\nGLOBAL(void)\njpeg_copy_critical_parameters (j_decompress_ptr srcinfo,\n                               j_compress_ptr dstinfo)\n{\n  JQUANT_TBL **qtblptr;\n  jpeg_component_info *incomp, *outcomp;\n  JQUANT_TBL *c_quant, *slot_quant;\n  int tblno, ci, coefi;\n\n  /* Safety check to ensure start_compress not called yet. */\n  if (dstinfo->global_state != CSTATE_START)\n    ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state);\n  /* Copy fundamental image dimensions */\n  dstinfo->image_width = srcinfo->image_width;\n  dstinfo->image_height = srcinfo->image_height;\n  dstinfo->input_components = srcinfo->num_components;\n  dstinfo->in_color_space = srcinfo->jpeg_color_space;\n#if JPEG_LIB_VERSION >= 70\n  dstinfo->jpeg_width = srcinfo->output_width;\n  dstinfo->jpeg_height = srcinfo->output_height;\n  dstinfo->min_DCT_h_scaled_size = srcinfo->min_DCT_h_scaled_size;\n  dstinfo->min_DCT_v_scaled_size = srcinfo->min_DCT_v_scaled_size;\n#endif\n  /* Initialize all parameters to default values */\n  jpeg_set_defaults(dstinfo);\n  /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.\n   * Fix it to get the right header markers for the image colorspace.\n   */\n  jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);\n  dstinfo->data_precision = srcinfo->data_precision;\n  dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;\n  /* Copy the source's quantization tables. */\n  for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {\n    if (srcinfo->quant_tbl_ptrs[tblno] != NULL) {\n      qtblptr = & dstinfo->quant_tbl_ptrs[tblno];\n      if (*qtblptr == NULL)\n        *qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo);\n      MEMCOPY((*qtblptr)->quantval,\n              srcinfo->quant_tbl_ptrs[tblno]->quantval,\n              sizeof((*qtblptr)->quantval));\n      (*qtblptr)->sent_table = FALSE;\n    }\n  }\n  /* Copy the source's per-component info.\n   * Note we assume jpeg_set_defaults has allocated the dest comp_info array.\n   */\n  dstinfo->num_components = srcinfo->num_components;\n  if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS)\n    ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components,\n             MAX_COMPONENTS);\n  for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info;\n       ci < dstinfo->num_components; ci++, incomp++, outcomp++) {\n    outcomp->component_id = incomp->component_id;\n    outcomp->h_samp_factor = incomp->h_samp_factor;\n    outcomp->v_samp_factor = incomp->v_samp_factor;\n    outcomp->quant_tbl_no = incomp->quant_tbl_no;\n    /* Make sure saved quantization table for component matches the qtable\n     * slot.  If not, the input file re-used this qtable slot.\n     * IJG encoder currently cannot duplicate this.\n     */\n    tblno = outcomp->quant_tbl_no;\n    if (tblno < 0 || tblno >= NUM_QUANT_TBLS ||\n        srcinfo->quant_tbl_ptrs[tblno] == NULL)\n      ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno);\n    slot_quant = srcinfo->quant_tbl_ptrs[tblno];\n    c_quant = incomp->quant_table;\n    if (c_quant != NULL) {\n      for (coefi = 0; coefi < DCTSIZE2; coefi++) {\n        if (c_quant->quantval[coefi] != slot_quant->quantval[coefi])\n          ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno);\n      }\n    }\n    /* Note: we do not copy the source's Huffman table assignments;\n     * instead we rely on jpeg_set_colorspace to have made a suitable choice.\n     */\n  }\n  /* Also copy JFIF version and resolution information, if available.\n   * Strictly speaking this isn't \"critical\" info, but it's nearly\n   * always appropriate to copy it if available.  In particular,\n   * if the application chooses to copy JFIF 1.02 extension markers from\n   * the source file, we need to copy the version to make sure we don't\n   * emit a file that has 1.02 extensions but a claimed version of 1.01.\n   * We will *not*, however, copy version info from mislabeled \"2.01\" files.\n   */\n  if (srcinfo->saw_JFIF_marker) {\n    if (srcinfo->JFIF_major_version == 1) {\n      dstinfo->JFIF_major_version = srcinfo->JFIF_major_version;\n      dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version;\n    }\n    dstinfo->density_unit = srcinfo->density_unit;\n    dstinfo->X_density = srcinfo->X_density;\n    dstinfo->Y_density = srcinfo->Y_density;\n  }\n}\n\n\n/*\n * Master selection of compression modules for transcoding.\n * This substitutes for jcinit.c's initialization of the full compressor.\n */\n\nLOCAL(void)\ntransencode_master_selection (j_compress_ptr cinfo,\n                              jvirt_barray_ptr *coef_arrays)\n{\n  /* Although we don't actually use input_components for transcoding,\n   * jcmaster.c's initial_setup will complain if input_components is 0.\n   */\n  cinfo->input_components = 1;\n  /* Initialize master control (includes parameter checking/processing) */\n  jinit_c_master_control(cinfo, TRUE /* transcode only */);\n\n  /* Entropy encoding: either Huffman or arithmetic coding. */\n  if (cinfo->arith_code) {\n#ifdef C_ARITH_CODING_SUPPORTED\n    jinit_arith_encoder(cinfo);\n#else\n    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);\n#endif\n  } else {\n    if (cinfo->progressive_mode) {\n#ifdef C_PROGRESSIVE_SUPPORTED\n      jinit_phuff_encoder(cinfo);\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    } else\n      jinit_huff_encoder(cinfo);\n  }\n\n  /* We need a special coefficient buffer controller. */\n  transencode_coef_controller(cinfo, coef_arrays);\n\n  jinit_marker_writer(cinfo);\n\n  /* We can now tell the memory manager to allocate virtual arrays. */\n  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);\n\n  /* Write the datastream header (SOI, JFIF) immediately.\n   * Frame and scan headers are postponed till later.\n   * This lets application insert special markers after the SOI.\n   */\n  (*cinfo->marker->write_file_header) (cinfo);\n}\n\n\n/*\n * The rest of this file is a special implementation of the coefficient\n * buffer controller.  This is similar to jccoefct.c, but it handles only\n * output from presupplied virtual arrays.  Furthermore, we generate any\n * dummy padding blocks on-the-fly rather than expecting them to be present\n * in the arrays.\n */\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_c_coef_controller pub; /* public fields */\n\n  JDIMENSION iMCU_row_num;      /* iMCU row # within image */\n  JDIMENSION mcu_ctr;           /* counts MCUs processed in current row */\n  int MCU_vert_offset;          /* counts MCU rows within iMCU row */\n  int MCU_rows_per_iMCU_row;    /* number of such rows needed */\n\n  /* Virtual block array for each component. */\n  jvirt_barray_ptr *whole_image;\n\n  /* Workspace for constructing dummy blocks at right/bottom edges. */\n  JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU];\n} my_coef_controller;\n\ntypedef my_coef_controller *my_coef_ptr;\n\n\nLOCAL(void)\nstart_iMCU_row (j_compress_ptr cinfo)\n/* Reset within-iMCU-row counters for a new row */\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  /* In an interleaved scan, an MCU row is the same as an iMCU row.\n   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.\n   * But at the bottom of the image, process only what's left.\n   */\n  if (cinfo->comps_in_scan > 1) {\n    coef->MCU_rows_per_iMCU_row = 1;\n  } else {\n    if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;\n    else\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;\n  }\n\n  coef->mcu_ctr = 0;\n  coef->MCU_vert_offset = 0;\n}\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  if (pass_mode != JBUF_CRANK_DEST)\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n\n  coef->iMCU_row_num = 0;\n  start_iMCU_row(cinfo);\n}\n\n\n/*\n * Process some data.\n * We process the equivalent of one fully interleaved MCU row (\"iMCU\" row)\n * per call, ie, v_samp_factor block rows for each component in the scan.\n * The data is obtained from the virtual arrays and fed to the entropy coder.\n * Returns TRUE if the iMCU row is completed, FALSE if suspended.\n *\n * NB: input_buf is ignored; it is likely to be a NULL pointer.\n */\n\nMETHODDEF(boolean)\ncompress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION MCU_col_num;       /* index of current MCU within row */\n  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  int blkn, ci, xindex, yindex, yoffset, blockcnt;\n  JDIMENSION start_col;\n  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];\n  JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];\n  JBLOCKROW buffer_ptr;\n  jpeg_component_info *compptr;\n\n  /* Align the virtual buffers for the components used in this scan. */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    buffer[ci] = (*cinfo->mem->access_virt_barray)\n      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],\n       coef->iMCU_row_num * compptr->v_samp_factor,\n       (JDIMENSION) compptr->v_samp_factor, FALSE);\n  }\n\n  /* Loop to process one whole iMCU row */\n  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;\n       yoffset++) {\n    for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;\n         MCU_col_num++) {\n      /* Construct list of pointers to DCT blocks belonging to this MCU */\n      blkn = 0;                 /* index of current DCT block within MCU */\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n        compptr = cinfo->cur_comp_info[ci];\n        start_col = MCU_col_num * compptr->MCU_width;\n        blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width\n                                                : compptr->last_col_width;\n        for (yindex = 0; yindex < compptr->MCU_height; yindex++) {\n          if (coef->iMCU_row_num < last_iMCU_row ||\n              yindex+yoffset < compptr->last_row_height) {\n            /* Fill in pointers to real blocks in this row */\n            buffer_ptr = buffer[ci][yindex+yoffset] + start_col;\n            for (xindex = 0; xindex < blockcnt; xindex++)\n              MCU_buffer[blkn++] = buffer_ptr++;\n          } else {\n            /* At bottom of image, need a whole row of dummy blocks */\n            xindex = 0;\n          }\n          /* Fill in any dummy blocks needed in this row.\n           * Dummy blocks are filled in the same way as in jccoefct.c:\n           * all zeroes in the AC entries, DC entries equal to previous\n           * block's DC value.  The init routine has already zeroed the\n           * AC entries, so we need only set the DC entries correctly.\n           */\n          for (; xindex < compptr->MCU_width; xindex++) {\n            MCU_buffer[blkn] = coef->dummy_buffer[blkn];\n            MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0];\n            blkn++;\n          }\n        }\n      }\n      /* Try to write the MCU. */\n      if (! (*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) {\n        /* Suspension forced; update state counters and exit */\n        coef->MCU_vert_offset = yoffset;\n        coef->mcu_ctr = MCU_col_num;\n        return FALSE;\n      }\n    }\n    /* Completed an MCU row, but perhaps not an iMCU row */\n    coef->mcu_ctr = 0;\n  }\n  /* Completed the iMCU row, advance counters for next one */\n  coef->iMCU_row_num++;\n  start_iMCU_row(cinfo);\n  return TRUE;\n}\n\n\n/*\n * Initialize coefficient buffer controller.\n *\n * Each passed coefficient array must be the right size for that\n * coefficient: width_in_blocks wide and height_in_blocks high,\n * with unitheight at least v_samp_factor.\n */\n\nLOCAL(void)\ntransencode_coef_controller (j_compress_ptr cinfo,\n                             jvirt_barray_ptr *coef_arrays)\n{\n  my_coef_ptr coef;\n  JBLOCKROW buffer;\n  int i;\n\n  coef = (my_coef_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_coef_controller));\n  cinfo->coef = (struct jpeg_c_coef_controller *) coef;\n  coef->pub.start_pass = start_pass_coef;\n  coef->pub.compress_data = compress_output;\n\n  /* Save pointer to virtual arrays */\n  coef->whole_image = coef_arrays;\n\n  /* Allocate and pre-zero space for dummy DCT blocks. */\n  buffer = (JBLOCKROW)\n    (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                C_MAX_BLOCKS_IN_MCU * sizeof(JBLOCK));\n  jzero_far((void *) buffer, C_MAX_BLOCKS_IN_MCU * sizeof(JBLOCK));\n  for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {\n    coef->dummy_buffer[i] = buffer + i;\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdapimin.c",
    "content": "/*\n * jdapimin.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2016, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains application interface code for the decompression half\n * of the JPEG library.  These are the \"minimum\" API routines that may be\n * needed in either the normal full-decompression case or the\n * transcoding-only case.\n *\n * Most of the routines intended to be called directly by an application\n * are in this file or in jdapistd.c.  But also see jcomapi.c for routines\n * shared by compression and decompression, and jdtrans.c for the transcoding\n * case.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdmaster.h\"\n\n\n/*\n * Initialization of a JPEG decompression object.\n * The error manager must already be set up (in case memory manager fails).\n */\n\nGLOBAL(void)\njpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize)\n{\n  int i;\n\n  /* Guard against version mismatches between library and caller. */\n  cinfo->mem = NULL;            /* so jpeg_destroy knows mem mgr not called */\n  if (version != JPEG_LIB_VERSION)\n    ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);\n  if (structsize != sizeof(struct jpeg_decompress_struct))\n    ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,\n             (int) sizeof(struct jpeg_decompress_struct), (int) structsize);\n\n  /* For debugging purposes, we zero the whole master structure.\n   * But the application has already set the err pointer, and may have set\n   * client_data, so we have to save and restore those fields.\n   * Note: if application hasn't set client_data, tools like Purify may\n   * complain here.\n   */\n  {\n    struct jpeg_error_mgr * err = cinfo->err;\n    void * client_data = cinfo->client_data; /* ignore Purify complaint here */\n    MEMZERO(cinfo, sizeof(struct jpeg_decompress_struct));\n    cinfo->err = err;\n    cinfo->client_data = client_data;\n  }\n  cinfo->is_decompressor = TRUE;\n\n  /* Initialize a memory manager instance for this object */\n  jinit_memory_mgr((j_common_ptr) cinfo);\n\n  /* Zero out pointers to permanent structures. */\n  cinfo->progress = NULL;\n  cinfo->src = NULL;\n\n  for (i = 0; i < NUM_QUANT_TBLS; i++)\n    cinfo->quant_tbl_ptrs[i] = NULL;\n\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    cinfo->dc_huff_tbl_ptrs[i] = NULL;\n    cinfo->ac_huff_tbl_ptrs[i] = NULL;\n  }\n\n  /* Initialize marker processor so application can override methods\n   * for COM, APPn markers before calling jpeg_read_header.\n   */\n  cinfo->marker_list = NULL;\n  jinit_marker_reader(cinfo);\n\n  /* And initialize the overall input controller. */\n  jinit_input_controller(cinfo);\n\n  /* OK, I'm ready */\n  cinfo->global_state = DSTATE_START;\n\n  /* The master struct is used to store extension parameters, so we allocate it\n   * here.\n   */\n  cinfo->master = (struct jpeg_decomp_master *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n                                  sizeof(my_decomp_master));\n  MEMZERO(cinfo->master, sizeof(my_decomp_master));\n}\n\n\n/*\n * Destruction of a JPEG decompression object\n */\n\nGLOBAL(void)\njpeg_destroy_decompress (j_decompress_ptr cinfo)\n{\n  jpeg_destroy((j_common_ptr) cinfo); /* use common routine */\n}\n\n\n/*\n * Abort processing of a JPEG decompression operation,\n * but don't destroy the object itself.\n */\n\nGLOBAL(void)\njpeg_abort_decompress (j_decompress_ptr cinfo)\n{\n  jpeg_abort((j_common_ptr) cinfo); /* use common routine */\n}\n\n\n/*\n * Set default decompression parameters.\n */\n\nLOCAL(void)\ndefault_decompress_parms (j_decompress_ptr cinfo)\n{\n  /* Guess the input colorspace, and set output colorspace accordingly. */\n  /* (Wish JPEG committee had provided a real way to specify this...) */\n  /* Note application may override our guesses. */\n  switch (cinfo->num_components) {\n  case 1:\n    cinfo->jpeg_color_space = JCS_GRAYSCALE;\n    cinfo->out_color_space = JCS_GRAYSCALE;\n    break;\n\n  case 3:\n    if (cinfo->saw_JFIF_marker) {\n      cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */\n    } else if (cinfo->saw_Adobe_marker) {\n      switch (cinfo->Adobe_transform) {\n      case 0:\n        cinfo->jpeg_color_space = JCS_RGB;\n        break;\n      case 1:\n        cinfo->jpeg_color_space = JCS_YCbCr;\n        break;\n      default:\n        WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);\n        cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */\n        break;\n      }\n    } else {\n      /* Saw no special markers, try to guess from the component IDs */\n      int cid0 = cinfo->comp_info[0].component_id;\n      int cid1 = cinfo->comp_info[1].component_id;\n      int cid2 = cinfo->comp_info[2].component_id;\n\n      if (cid0 == 1 && cid1 == 2 && cid2 == 3)\n        cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */\n      else if (cid0 == 82 && cid1 == 71 && cid2 == 66)\n        cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */\n      else {\n        TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);\n        cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */\n      }\n    }\n    /* Always guess RGB is proper output colorspace. */\n    cinfo->out_color_space = JCS_RGB;\n    break;\n\n  case 4:\n    if (cinfo->saw_Adobe_marker) {\n      switch (cinfo->Adobe_transform) {\n      case 0:\n        cinfo->jpeg_color_space = JCS_CMYK;\n        break;\n      case 2:\n        cinfo->jpeg_color_space = JCS_YCCK;\n        break;\n      default:\n        WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);\n        cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */\n        break;\n      }\n    } else {\n      /* No special markers, assume straight CMYK. */\n      cinfo->jpeg_color_space = JCS_CMYK;\n    }\n    cinfo->out_color_space = JCS_CMYK;\n    break;\n\n  default:\n    cinfo->jpeg_color_space = JCS_UNKNOWN;\n    cinfo->out_color_space = JCS_UNKNOWN;\n    break;\n  }\n\n  /* Set defaults for other decompression parameters. */\n  cinfo->scale_num = 1;         /* 1:1 scaling */\n  cinfo->scale_denom = 1;\n  cinfo->output_gamma = 1.0;\n  cinfo->buffered_image = FALSE;\n  cinfo->raw_data_out = FALSE;\n  cinfo->dct_method = JDCT_DEFAULT;\n  cinfo->do_fancy_upsampling = TRUE;\n  cinfo->do_block_smoothing = TRUE;\n  cinfo->quantize_colors = FALSE;\n  /* We set these in case application only sets quantize_colors. */\n  cinfo->dither_mode = JDITHER_FS;\n#ifdef QUANT_2PASS_SUPPORTED\n  cinfo->two_pass_quantize = TRUE;\n#else\n  cinfo->two_pass_quantize = FALSE;\n#endif\n  cinfo->desired_number_of_colors = 256;\n  cinfo->colormap = NULL;\n  /* Initialize for no mode change in buffered-image mode. */\n  cinfo->enable_1pass_quant = FALSE;\n  cinfo->enable_external_quant = FALSE;\n  cinfo->enable_2pass_quant = FALSE;\n}\n\n\n/*\n * Decompression startup: read start of JPEG datastream to see what's there.\n * Need only initialize JPEG object and supply a data source before calling.\n *\n * This routine will read as far as the first SOS marker (ie, actual start of\n * compressed data), and will save all tables and parameters in the JPEG\n * object.  It will also initialize the decompression parameters to default\n * values, and finally return JPEG_HEADER_OK.  On return, the application may\n * adjust the decompression parameters and then call jpeg_start_decompress.\n * (Or, if the application only wanted to determine the image parameters,\n * the data need not be decompressed.  In that case, call jpeg_abort or\n * jpeg_destroy to release any temporary space.)\n * If an abbreviated (tables only) datastream is presented, the routine will\n * return JPEG_HEADER_TABLES_ONLY upon reaching EOI.  The application may then\n * re-use the JPEG object to read the abbreviated image datastream(s).\n * It is unnecessary (but OK) to call jpeg_abort in this case.\n * The JPEG_SUSPENDED return code only occurs if the data source module\n * requests suspension of the decompressor.  In this case the application\n * should load more source data and then re-call jpeg_read_header to resume\n * processing.\n * If a non-suspending data source is used and require_image is TRUE, then the\n * return code need not be inspected since only JPEG_HEADER_OK is possible.\n *\n * This routine is now just a front end to jpeg_consume_input, with some\n * extra error checking.\n */\n\nGLOBAL(int)\njpeg_read_header (j_decompress_ptr cinfo, boolean require_image)\n{\n  int retcode;\n\n  if (cinfo->global_state != DSTATE_START &&\n      cinfo->global_state != DSTATE_INHEADER)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  retcode = jpeg_consume_input(cinfo);\n\n  switch (retcode) {\n  case JPEG_REACHED_SOS:\n    retcode = JPEG_HEADER_OK;\n    break;\n  case JPEG_REACHED_EOI:\n    if (require_image)          /* Complain if application wanted an image */\n      ERREXIT(cinfo, JERR_NO_IMAGE);\n    /* Reset to start state; it would be safer to require the application to\n     * call jpeg_abort, but we can't change it now for compatibility reasons.\n     * A side effect is to free any temporary memory (there shouldn't be any).\n     */\n    jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */\n    retcode = JPEG_HEADER_TABLES_ONLY;\n    break;\n  case JPEG_SUSPENDED:\n    /* no work */\n    break;\n  }\n\n  return retcode;\n}\n\n\n/*\n * Consume data in advance of what the decompressor requires.\n * This can be called at any time once the decompressor object has\n * been created and a data source has been set up.\n *\n * This routine is essentially a state machine that handles a couple\n * of critical state-transition actions, namely initial setup and\n * transition from header scanning to ready-for-start_decompress.\n * All the actual input is done via the input controller's consume_input\n * method.\n */\n\nGLOBAL(int)\njpeg_consume_input (j_decompress_ptr cinfo)\n{\n  int retcode = JPEG_SUSPENDED;\n\n  /* NB: every possible DSTATE value should be listed in this switch */\n  switch (cinfo->global_state) {\n  case DSTATE_START:\n    /* Start-of-datastream actions: reset appropriate modules */\n    (*cinfo->inputctl->reset_input_controller) (cinfo);\n    /* Initialize application's data source module */\n    (*cinfo->src->init_source) (cinfo);\n    cinfo->global_state = DSTATE_INHEADER;\n    /*FALLTHROUGH*/\n  case DSTATE_INHEADER:\n    retcode = (*cinfo->inputctl->consume_input) (cinfo);\n    if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */\n      /* Set up default parameters based on header data */\n      default_decompress_parms(cinfo);\n      /* Set global state: ready for start_decompress */\n      cinfo->global_state = DSTATE_READY;\n    }\n    break;\n  case DSTATE_READY:\n    /* Can't advance past first SOS until start_decompress is called */\n    retcode = JPEG_REACHED_SOS;\n    break;\n  case DSTATE_PRELOAD:\n  case DSTATE_PRESCAN:\n  case DSTATE_SCANNING:\n  case DSTATE_RAW_OK:\n  case DSTATE_BUFIMAGE:\n  case DSTATE_BUFPOST:\n  case DSTATE_STOPPING:\n    retcode = (*cinfo->inputctl->consume_input) (cinfo);\n    break;\n  default:\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  }\n  return retcode;\n}\n\n\n/*\n * Have we finished reading the input file?\n */\n\nGLOBAL(boolean)\njpeg_input_complete (j_decompress_ptr cinfo)\n{\n  /* Check for valid jpeg object */\n  if (cinfo->global_state < DSTATE_START ||\n      cinfo->global_state > DSTATE_STOPPING)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  return cinfo->inputctl->eoi_reached;\n}\n\n\n/*\n * Is there more than one scan?\n */\n\nGLOBAL(boolean)\njpeg_has_multiple_scans (j_decompress_ptr cinfo)\n{\n  /* Only valid after jpeg_read_header completes */\n  if (cinfo->global_state < DSTATE_READY ||\n      cinfo->global_state > DSTATE_STOPPING)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  return cinfo->inputctl->has_multiple_scans;\n}\n\n\n/*\n * Finish JPEG decompression.\n *\n * This will normally just verify the file trailer and release temp storage.\n *\n * Returns FALSE if suspended.  The return value need be inspected only if\n * a suspending data source is used.\n */\n\nGLOBAL(boolean)\njpeg_finish_decompress (j_decompress_ptr cinfo)\n{\n  if ((cinfo->global_state == DSTATE_SCANNING ||\n       cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) {\n    /* Terminate final pass of non-buffered mode */\n    if (cinfo->output_scanline < cinfo->output_height)\n      ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);\n    (*cinfo->master->finish_output_pass) (cinfo);\n    cinfo->global_state = DSTATE_STOPPING;\n  } else if (cinfo->global_state == DSTATE_BUFIMAGE) {\n    /* Finishing after a buffered-image operation */\n    cinfo->global_state = DSTATE_STOPPING;\n  } else if (cinfo->global_state != DSTATE_STOPPING) {\n    /* STOPPING = repeat call after a suspension, anything else is error */\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  }\n  /* Read until EOI */\n  while (! cinfo->inputctl->eoi_reached) {\n    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)\n      return FALSE;             /* Suspend, come back later */\n  }\n  /* Do final cleanup */\n  (*cinfo->src->term_source) (cinfo);\n  /* We can use jpeg_abort to release memory and reset global_state */\n  jpeg_abort((j_common_ptr) cinfo);\n  return TRUE;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdapistd.c",
    "content": "/*\n * jdapistd.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, 2015-2016, D. R. Commander.\n * Copyright (C) 2015, Google, Inc.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains application interface code for the decompression half\n * of the JPEG library.  These are the \"standard\" API routines that are\n * used in the normal full-decompression case.  They are not used by a\n * transcoding-only application.  Note that if an application links in\n * jpeg_start_decompress, it will end up linking in the entire decompressor.\n * We thus must separate this file from jdapimin.c to avoid linking the\n * whole decompression library into a transcoder.\n */\n\n#include \"jinclude.h\"\n#include \"jdmainct.h\"\n#include \"jdcoefct.h\"\n#include \"jdsample.h\"\n#include \"jmemsys.h\"\n\n/* Forward declarations */\nLOCAL(boolean) output_pass_setup (j_decompress_ptr cinfo);\n\n\n/*\n * Decompression initialization.\n * jpeg_read_header must be completed before calling this.\n *\n * If a multipass operating mode was selected, this will do all but the\n * last pass, and thus may take a great deal of time.\n *\n * Returns FALSE if suspended.  The return value need be inspected only if\n * a suspending data source is used.\n */\n\nGLOBAL(boolean)\njpeg_start_decompress (j_decompress_ptr cinfo)\n{\n  if (cinfo->global_state == DSTATE_READY) {\n    /* First call: initialize master control, select active modules */\n    jinit_master_decompress(cinfo);\n    if (cinfo->buffered_image) {\n      /* No more work here; expecting jpeg_start_output next */\n      cinfo->global_state = DSTATE_BUFIMAGE;\n      return TRUE;\n    }\n    cinfo->global_state = DSTATE_PRELOAD;\n  }\n  if (cinfo->global_state == DSTATE_PRELOAD) {\n    /* If file has multiple scans, absorb them all into the coef buffer */\n    if (cinfo->inputctl->has_multiple_scans) {\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n      for (;;) {\n        int retcode;\n        /* Call progress monitor hook if present */\n        if (cinfo->progress != NULL)\n          (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n        /* Absorb some more input */\n        retcode = (*cinfo->inputctl->consume_input) (cinfo);\n        if (retcode == JPEG_SUSPENDED)\n          return FALSE;\n        if (retcode == JPEG_REACHED_EOI)\n          break;\n        /* Advance progress counter if appropriate */\n        if (cinfo->progress != NULL &&\n            (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {\n          if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {\n            /* jdmaster underestimated number of scans; ratchet up one scan */\n            cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;\n          }\n        }\n      }\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif /* D_MULTISCAN_FILES_SUPPORTED */\n    }\n    cinfo->output_scan_number = cinfo->input_scan_number;\n  } else if (cinfo->global_state != DSTATE_PRESCAN)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  /* Perform any dummy output passes, and set up for the final pass */\n  return output_pass_setup(cinfo);\n}\n\n\n/*\n * Set up for an output pass, and perform any dummy pass(es) needed.\n * Common subroutine for jpeg_start_decompress and jpeg_start_output.\n * Entry: global_state = DSTATE_PRESCAN only if previously suspended.\n * Exit: If done, returns TRUE and sets global_state for proper output mode.\n *       If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN.\n */\n\nLOCAL(boolean)\noutput_pass_setup (j_decompress_ptr cinfo)\n{\n  if (cinfo->global_state != DSTATE_PRESCAN) {\n    /* First call: do pass setup */\n    (*cinfo->master->prepare_for_output_pass) (cinfo);\n    cinfo->output_scanline = 0;\n    cinfo->global_state = DSTATE_PRESCAN;\n  }\n  /* Loop over any required dummy passes */\n  while (cinfo->master->is_dummy_pass) {\n#ifdef QUANT_2PASS_SUPPORTED\n    /* Crank through the dummy pass */\n    while (cinfo->output_scanline < cinfo->output_height) {\n      JDIMENSION last_scanline;\n      /* Call progress monitor hook if present */\n      if (cinfo->progress != NULL) {\n        cinfo->progress->pass_counter = (long) cinfo->output_scanline;\n        cinfo->progress->pass_limit = (long) cinfo->output_height;\n        (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n      }\n      /* Process some data */\n      last_scanline = cinfo->output_scanline;\n      (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL,\n                                    &cinfo->output_scanline, (JDIMENSION) 0);\n      if (cinfo->output_scanline == last_scanline)\n        return FALSE;           /* No progress made, must suspend */\n    }\n    /* Finish up dummy pass, and set up for another one */\n    (*cinfo->master->finish_output_pass) (cinfo);\n    (*cinfo->master->prepare_for_output_pass) (cinfo);\n    cinfo->output_scanline = 0;\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif /* QUANT_2PASS_SUPPORTED */\n  }\n  /* Ready for application to drive output pass through\n   * jpeg_read_scanlines or jpeg_read_raw_data.\n   */\n  cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;\n  return TRUE;\n}\n\n\n/*\n * Enable partial scanline decompression\n *\n * Must be called after jpeg_start_decompress() and before any calls to\n * jpeg_read_scanlines() or jpeg_skip_scanlines().\n *\n * Refer to libjpeg.txt for more information.\n */\n\nGLOBAL(void)\njpeg_crop_scanline (j_decompress_ptr cinfo, JDIMENSION *xoffset,\n                    JDIMENSION *width)\n{\n  int ci, align, orig_downsampled_width;\n  JDIMENSION input_xoffset;\n  boolean reinit_upsampler = FALSE;\n  jpeg_component_info *compptr;\n\n  if (cinfo->global_state != DSTATE_SCANNING || cinfo->output_scanline != 0)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  if (!xoffset || !width)\n    ERREXIT(cinfo, JERR_BAD_CROP_SPEC);\n\n  /* xoffset and width must fall within the output image dimensions. */\n  if (*width == 0 || *xoffset + *width > cinfo->output_width)\n    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);\n\n  /* No need to do anything if the caller wants the entire width. */\n  if (*width == cinfo->output_width)\n    return;\n\n  /* Ensuring the proper alignment of xoffset is tricky.  At minimum, it\n   * must align with an MCU boundary, because:\n   *\n   *   (1) The IDCT is performed in blocks, and it is not feasible to modify\n   *       the algorithm so that it can transform partial blocks.\n   *   (2) Because of the SIMD extensions, any input buffer passed to the\n   *       upsampling and color conversion routines must be aligned to the\n   *       SIMD word size (for instance, 128-bit in the case of SSE2.)  The\n   *       easiest way to accomplish this without copying data is to ensure\n   *       that upsampling and color conversion begin at the start of the\n   *       first MCU column that will be inverse transformed.\n   *\n   * In practice, we actually impose a stricter alignment requirement.  We\n   * require that xoffset be a multiple of the maximum MCU column width of all\n   * of the components (the \"iMCU column width.\")  This is to simplify the\n   * single-pass decompression case, allowing us to use the same MCU column\n   * width for all of the components.\n   */\n  align = cinfo->_min_DCT_scaled_size * cinfo->max_h_samp_factor;\n\n  /* Adjust xoffset to the nearest iMCU boundary <= the requested value */\n  input_xoffset = *xoffset;\n  *xoffset = (input_xoffset / align) * align;\n\n  /* Adjust the width so that the right edge of the output image is as\n   * requested (only the left edge is altered.)  It is important that calling\n   * programs check this value after this function returns, so that they can\n   * allocate an output buffer with the appropriate size.\n   */\n  *width = *width + input_xoffset - *xoffset;\n  cinfo->output_width = *width;\n\n  /* Set the first and last iMCU columns that we must decompress.  These values\n   * will be used in single-scan decompressions.\n   */\n  cinfo->master->first_iMCU_col =\n    (JDIMENSION) (long) (*xoffset) / (long) align;\n  cinfo->master->last_iMCU_col =\n    (JDIMENSION) jdiv_round_up((long) (*xoffset + cinfo->output_width),\n                               (long) align) - 1;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Set downsampled_width to the new output width. */\n    orig_downsampled_width = compptr->downsampled_width;\n    compptr->downsampled_width =\n      (JDIMENSION) jdiv_round_up((long) (cinfo->output_width *\n                                         compptr->h_samp_factor),\n                                 (long) cinfo->max_h_samp_factor);\n    if (compptr->downsampled_width < 2 && orig_downsampled_width >= 2)\n      reinit_upsampler = TRUE;\n\n    /* Set the first and last iMCU columns that we must decompress.  These\n     * values will be used in multi-scan decompressions.\n     */\n    cinfo->master->first_MCU_col[ci] =\n      (JDIMENSION) (long) (*xoffset * compptr->h_samp_factor) /\n                   (long) align;\n    cinfo->master->last_MCU_col[ci] =\n      (JDIMENSION) jdiv_round_up((long) ((*xoffset + cinfo->output_width) *\n                                         compptr->h_samp_factor),\n                                 (long) align) - 1;\n  }\n\n  if (reinit_upsampler) {\n    cinfo->master->jinit_upsampler_no_alloc = TRUE;\n    jinit_upsampler(cinfo);\n    cinfo->master->jinit_upsampler_no_alloc = FALSE;\n  }\n}\n\n\n/*\n * Read some scanlines of data from the JPEG decompressor.\n *\n * The return value will be the number of lines actually read.\n * This may be less than the number requested in several cases,\n * including bottom of image, data source suspension, and operating\n * modes that emit multiple scanlines at a time.\n *\n * Note: we warn about excess calls to jpeg_read_scanlines() since\n * this likely signals an application programmer error.  However,\n * an oversize buffer (max_lines > scanlines remaining) is not an error.\n */\n\nGLOBAL(JDIMENSION)\njpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines,\n                     JDIMENSION max_lines)\n{\n  JDIMENSION row_ctr;\n\n  if (cinfo->global_state != DSTATE_SCANNING)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  if (cinfo->output_scanline >= cinfo->output_height) {\n    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);\n    return 0;\n  }\n\n  /* Call progress monitor hook if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->pass_counter = (long) cinfo->output_scanline;\n    cinfo->progress->pass_limit = (long) cinfo->output_height;\n    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n  }\n\n  /* Process some data */\n  row_ctr = 0;\n  (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines);\n  cinfo->output_scanline += row_ctr;\n  return row_ctr;\n}\n\n\n/* Dummy color convert function used by jpeg_skip_scanlines() */\nLOCAL(void)\nnoop_convert (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,\n              JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)\n{\n}\n\n\n/*\n * In some cases, it is best to call jpeg_read_scanlines() and discard the\n * output, rather than skipping the scanlines, because this allows us to\n * maintain the internal state of the context-based upsampler.  In these cases,\n * we set up and tear down a dummy color converter in order to avoid valgrind\n * errors and to achieve the best possible performance.\n */\n\nLOCAL(void)\nread_and_discard_scanlines (j_decompress_ptr cinfo, JDIMENSION num_lines)\n{\n  JDIMENSION n;\n  void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,\n                         JDIMENSION input_row, JSAMPARRAY output_buf,\n                         int num_rows);\n\n  color_convert = cinfo->cconvert->color_convert;\n  cinfo->cconvert->color_convert = noop_convert;\n\n  for (n = 0; n < num_lines; n++)\n    jpeg_read_scanlines(cinfo, NULL, 1);\n\n  cinfo->cconvert->color_convert = color_convert;\n}\n\n\n/*\n * Called by jpeg_skip_scanlines().  This partially skips a decompress block by\n * incrementing the rowgroup counter.\n */\n\nLOCAL(void)\nincrement_simple_rowgroup_ctr (j_decompress_ptr cinfo, JDIMENSION rows)\n{\n  JDIMENSION rows_left;\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n\n  /* Increment the counter to the next row group after the skipped rows. */\n  main_ptr->rowgroup_ctr += rows / cinfo->max_v_samp_factor;\n\n  /* Partially skipping a row group would involve modifying the internal state\n   * of the upsampler, so read the remaining rows into a dummy buffer instead.\n   */\n  rows_left = rows % cinfo->max_v_samp_factor;\n  cinfo->output_scanline += rows - rows_left;\n\n  read_and_discard_scanlines(cinfo, rows_left);\n}\n\n/*\n * Skips some scanlines of data from the JPEG decompressor.\n *\n * The return value will be the number of lines actually skipped.  If skipping\n * num_lines would move beyond the end of the image, then the actual number of\n * lines remaining in the image is returned.  Otherwise, the return value will\n * be equal to num_lines.\n *\n * Refer to libjpeg.txt for more information.\n */\n\nGLOBAL(JDIMENSION)\njpeg_skip_scanlines (j_decompress_ptr cinfo, JDIMENSION num_lines)\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  JDIMENSION i, x;\n  int y;\n  JDIMENSION lines_per_iMCU_row, lines_left_in_iMCU_row, lines_after_iMCU_row;\n  JDIMENSION lines_to_skip, lines_to_read;\n\n  if (cinfo->global_state != DSTATE_SCANNING)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* Do not skip past the bottom of the image. */\n  if (cinfo->output_scanline + num_lines >= cinfo->output_height) {\n    cinfo->output_scanline = cinfo->output_height;\n    return cinfo->output_height - cinfo->output_scanline;\n  }\n\n  if (num_lines == 0)\n    return 0;\n\n  lines_per_iMCU_row = cinfo->_min_DCT_scaled_size * cinfo->max_v_samp_factor;\n  lines_left_in_iMCU_row =\n    (lines_per_iMCU_row - (cinfo->output_scanline % lines_per_iMCU_row)) %\n    lines_per_iMCU_row;\n  lines_after_iMCU_row = num_lines - lines_left_in_iMCU_row;\n\n  /* Skip the lines remaining in the current iMCU row.  When upsampling\n   * requires context rows, we need the previous and next rows in order to read\n   * the current row.  This adds some complexity.\n   */\n  if (cinfo->upsample->need_context_rows) {\n    /* If the skipped lines would not move us past the current iMCU row, we\n     * read the lines and ignore them.  There might be a faster way of doing\n     * this, but we are facing increasing complexity for diminishing returns.\n     * The increasing complexity would be a by-product of meddling with the\n     * state machine used to skip context rows.  Near the end of an iMCU row,\n     * the next iMCU row may have already been entropy-decoded.  In this unique\n     * case, we will read the next iMCU row if we cannot skip past it as well.\n     */\n    if ((num_lines < lines_left_in_iMCU_row + 1) ||\n        (lines_left_in_iMCU_row <= 1 && main_ptr->buffer_full &&\n         lines_after_iMCU_row < lines_per_iMCU_row + 1)) {\n      read_and_discard_scanlines(cinfo, num_lines);\n      return num_lines;\n    }\n\n    /* If the next iMCU row has already been entropy-decoded, make sure that\n     * we do not skip too far.\n     */\n    if (lines_left_in_iMCU_row <= 1 && main_ptr->buffer_full) {\n      cinfo->output_scanline += lines_left_in_iMCU_row + lines_per_iMCU_row;\n      lines_after_iMCU_row -= lines_per_iMCU_row;\n    } else {\n      cinfo->output_scanline += lines_left_in_iMCU_row;\n    }\n\n    /* If we have just completed the first block, adjust the buffer pointers */\n    if (main_ptr->iMCU_row_ctr == 0 ||\n        (main_ptr->iMCU_row_ctr == 1 && lines_left_in_iMCU_row > 2))\n      set_wraparound_pointers(cinfo);\n    main_ptr->buffer_full = FALSE;\n    main_ptr->rowgroup_ctr = 0;\n    main_ptr->context_state = CTX_PREPARE_FOR_IMCU;\n    upsample->next_row_out = cinfo->max_v_samp_factor;\n    upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;\n  }\n\n  /* Skipping is much simpler when context rows are not required. */\n  else {\n    if (num_lines < lines_left_in_iMCU_row) {\n      increment_simple_rowgroup_ctr(cinfo, num_lines);\n      return num_lines;\n    } else {\n      cinfo->output_scanline += lines_left_in_iMCU_row;\n      main_ptr->buffer_full = FALSE;\n      main_ptr->rowgroup_ctr = 0;\n      upsample->next_row_out = cinfo->max_v_samp_factor;\n      upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;\n    }\n  }\n\n  /* Calculate how many full iMCU rows we can skip. */\n  if (cinfo->upsample->need_context_rows)\n    lines_to_skip = ((lines_after_iMCU_row - 1) / lines_per_iMCU_row) *\n                    lines_per_iMCU_row;\n  else\n    lines_to_skip = (lines_after_iMCU_row / lines_per_iMCU_row) *\n                    lines_per_iMCU_row;\n  /* Calculate the number of lines that remain to be skipped after skipping all\n   * of the full iMCU rows that we can.  We will not read these lines unless we\n   * have to.\n   */\n  lines_to_read = lines_after_iMCU_row - lines_to_skip;\n\n  /* For images requiring multiple scans (progressive, non-interleaved, etc.),\n   * all of the entropy decoding occurs in jpeg_start_decompress(), assuming\n   * that the input data source is non-suspending.  This makes skipping easy.\n   */\n  if (cinfo->inputctl->has_multiple_scans) {\n    if (cinfo->upsample->need_context_rows) {\n      cinfo->output_scanline += lines_to_skip;\n      cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row;\n      main_ptr->iMCU_row_ctr += lines_after_iMCU_row / lines_per_iMCU_row;\n      /* It is complex to properly move to the middle of a context block, so\n       * read the remaining lines instead of skipping them.\n       */\n      read_and_discard_scanlines(cinfo, lines_to_read);\n    } else {\n      cinfo->output_scanline += lines_to_skip;\n      cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row;\n      increment_simple_rowgroup_ctr(cinfo, lines_to_read);\n    }\n    upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;\n    return num_lines;\n  }\n\n  /* Skip the iMCU rows that we can safely skip. */\n  for (i = 0; i < lines_to_skip; i += lines_per_iMCU_row) {\n    for (y = 0; y < coef->MCU_rows_per_iMCU_row; y++) {\n      for (x = 0; x < cinfo->MCUs_per_row; x++) {\n        /* Calling decode_mcu() with a NULL pointer causes it to discard the\n         * decoded coefficients.  This is ~5% faster for large subsets, but\n         * it's tough to tell a difference for smaller images.\n         */\n        (*cinfo->entropy->decode_mcu) (cinfo, NULL);\n      }\n    }\n    cinfo->input_iMCU_row++;\n    cinfo->output_iMCU_row++;\n    if (cinfo->input_iMCU_row < cinfo->total_iMCU_rows)\n      start_iMCU_row(cinfo);\n    else\n      (*cinfo->inputctl->finish_input_pass) (cinfo);\n  }\n  cinfo->output_scanline += lines_to_skip;\n\n  if (cinfo->upsample->need_context_rows) {\n    /* Context-based upsampling keeps track of iMCU rows. */\n    main_ptr->iMCU_row_ctr += lines_to_skip / lines_per_iMCU_row;\n\n    /* It is complex to properly move to the middle of a context block, so\n     * read the remaining lines instead of skipping them.\n     */\n    read_and_discard_scanlines(cinfo, lines_to_read);\n  } else {\n    increment_simple_rowgroup_ctr(cinfo, lines_to_read);\n  }\n\n  /* Since skipping lines involves skipping the upsampling step, the value of\n   * \"rows_to_go\" will become invalid unless we set it here.  NOTE: This is a\n   * bit odd, since \"rows_to_go\" seems to be redundantly keeping track of\n   * output_scanline.\n   */\n  upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;\n\n  /* Always skip the requested number of lines. */\n  return num_lines;\n}\n\n/*\n * Alternate entry point to read raw data.\n * Processes exactly one iMCU row per call, unless suspended.\n */\n\nGLOBAL(JDIMENSION)\njpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,\n                    JDIMENSION max_lines)\n{\n  JDIMENSION lines_per_iMCU_row;\n\n  if (cinfo->global_state != DSTATE_RAW_OK)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  if (cinfo->output_scanline >= cinfo->output_height) {\n    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);\n    return 0;\n  }\n\n  /* Call progress monitor hook if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->pass_counter = (long) cinfo->output_scanline;\n    cinfo->progress->pass_limit = (long) cinfo->output_height;\n    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n  }\n\n  /* Verify that at least one iMCU row can be returned. */\n  lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->_min_DCT_scaled_size;\n  if (max_lines < lines_per_iMCU_row)\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n\n  /* Decompress directly into user's buffer. */\n  if (! (*cinfo->coef->decompress_data) (cinfo, data))\n    return 0;                   /* suspension forced, can do nothing more */\n\n  /* OK, we processed one iMCU row. */\n  cinfo->output_scanline += lines_per_iMCU_row;\n  return lines_per_iMCU_row;\n}\n\n\n/* Additional entry points for buffered-image mode. */\n\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n\n/*\n * Initialize for an output pass in buffered-image mode.\n */\n\nGLOBAL(boolean)\njpeg_start_output (j_decompress_ptr cinfo, int scan_number)\n{\n  if (cinfo->global_state != DSTATE_BUFIMAGE &&\n      cinfo->global_state != DSTATE_PRESCAN)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  /* Limit scan number to valid range */\n  if (scan_number <= 0)\n    scan_number = 1;\n  if (cinfo->inputctl->eoi_reached &&\n      scan_number > cinfo->input_scan_number)\n    scan_number = cinfo->input_scan_number;\n  cinfo->output_scan_number = scan_number;\n  /* Perform any dummy output passes, and set up for the real pass */\n  return output_pass_setup(cinfo);\n}\n\n\n/*\n * Finish up after an output pass in buffered-image mode.\n *\n * Returns FALSE if suspended.  The return value need be inspected only if\n * a suspending data source is used.\n */\n\nGLOBAL(boolean)\njpeg_finish_output (j_decompress_ptr cinfo)\n{\n  if ((cinfo->global_state == DSTATE_SCANNING ||\n       cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) {\n    /* Terminate this pass. */\n    /* We do not require the whole pass to have been completed. */\n    (*cinfo->master->finish_output_pass) (cinfo);\n    cinfo->global_state = DSTATE_BUFPOST;\n  } else if (cinfo->global_state != DSTATE_BUFPOST) {\n    /* BUFPOST = repeat call after a suspension, anything else is error */\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  }\n  /* Read markers looking for SOS or EOI */\n  while (cinfo->input_scan_number <= cinfo->output_scan_number &&\n         ! cinfo->inputctl->eoi_reached) {\n    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)\n      return FALSE;             /* Suspend, come back later */\n  }\n  cinfo->global_state = DSTATE_BUFIMAGE;\n  return TRUE;\n}\n\n#endif /* D_MULTISCAN_FILES_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdarith.c",
    "content": "/*\n * jdarith.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Developed 1997-2015 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains portable arithmetic entropy decoding routines for JPEG\n * (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81).\n *\n * Both sequential and progressive modes are supported in this single module.\n *\n * Suspension is not currently supported in this module.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Expanded entropy decoder object for arithmetic decoding. */\n\ntypedef struct {\n  struct jpeg_entropy_decoder pub; /* public fields */\n\n  JLONG c;       /* C register, base of coding interval + input bit buffer */\n  JLONG a;               /* A register, normalized size of coding interval */\n  int ct;     /* bit shift counter, # of bits left in bit buffer part of C */\n                                                         /* init: ct = -16 */\n                                                         /* run: ct = 0..7 */\n                                                         /* error: ct = -1 */\n  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */\n  int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */\n\n  unsigned int restarts_to_go;  /* MCUs left in this restart interval */\n\n  /* Pointers to statistics areas (these workspaces have image lifespan) */\n  unsigned char *dc_stats[NUM_ARITH_TBLS];\n  unsigned char *ac_stats[NUM_ARITH_TBLS];\n\n  /* Statistics bin for coding with fixed probability 0.5 */\n  unsigned char fixed_bin[4];\n} arith_entropy_decoder;\n\ntypedef arith_entropy_decoder *arith_entropy_ptr;\n\n/* The following two definitions specify the allocation chunk size\n * for the statistics area.\n * According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least\n * 49 statistics bins for DC, and 245 statistics bins for AC coding.\n *\n * We use a compact representation with 1 byte per statistics bin,\n * thus the numbers directly represent byte sizes.\n * This 1 byte per statistics bin contains the meaning of the MPS\n * (more probable symbol) in the highest bit (mask 0x80), and the\n * index into the probability estimation state machine table\n * in the lower bits (mask 0x7F).\n */\n\n#define DC_STAT_BINS 64\n#define AC_STAT_BINS 256\n\n\nLOCAL(int)\nget_byte (j_decompress_ptr cinfo)\n/* Read next input byte; we do not support suspension in this module. */\n{\n  struct jpeg_source_mgr *src = cinfo->src;\n\n  if (src->bytes_in_buffer == 0)\n    if (! (*src->fill_input_buffer) (cinfo))\n      ERREXIT(cinfo, JERR_CANT_SUSPEND);\n  src->bytes_in_buffer--;\n  return GETJOCTET(*src->next_input_byte++);\n}\n\n\n/*\n * The core arithmetic decoding routine (common in JPEG and JBIG).\n * This needs to go as fast as possible.\n * Machine-dependent optimization facilities\n * are not utilized in this portable implementation.\n * However, this code should be fairly efficient and\n * may be a good base for further optimizations anyway.\n *\n * Return value is 0 or 1 (binary decision).\n *\n * Note: I've changed the handling of the code base & bit\n * buffer register C compared to other implementations\n * based on the standards layout & procedures.\n * While it also contains both the actual base of the\n * coding interval (16 bits) and the next-bits buffer,\n * the cut-point between these two parts is floating\n * (instead of fixed) with the bit shift counter CT.\n * Thus, we also need only one (variable instead of\n * fixed size) shift for the LPS/MPS decision, and\n * we can do away with any renormalization update\n * of C (except for new data insertion, of course).\n *\n * I've also introduced a new scheme for accessing\n * the probability estimation state machine table,\n * derived from Markus Kuhn's JBIG implementation.\n */\n\nLOCAL(int)\narith_decode (j_decompress_ptr cinfo, unsigned char *st)\n{\n  register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;\n  register unsigned char nl, nm;\n  register JLONG qe, temp;\n  register int sv, data;\n\n  /* Renormalization & data input per section D.2.6 */\n  while (e->a < 0x8000L) {\n    if (--e->ct < 0) {\n      /* Need to fetch next data byte */\n      if (cinfo->unread_marker)\n        data = 0;               /* stuff zero data */\n      else {\n        data = get_byte(cinfo); /* read next input byte */\n        if (data == 0xFF) {     /* zero stuff or marker code */\n          do data = get_byte(cinfo);\n          while (data == 0xFF); /* swallow extra 0xFF bytes */\n          if (data == 0)\n            data = 0xFF;        /* discard stuffed zero byte */\n          else {\n            /* Note: Different from the Huffman decoder, hitting\n             * a marker while processing the compressed data\n             * segment is legal in arithmetic coding.\n             * The convention is to supply zero data\n             * then until decoding is complete.\n             */\n            cinfo->unread_marker = data;\n            data = 0;\n          }\n        }\n      }\n      e->c = (e->c << 8) | data; /* insert data into C register */\n      if ((e->ct += 8) < 0)      /* update bit shift counter */\n        /* Need more initial bytes */\n        if (++e->ct == 0)\n          /* Got 2 initial bytes -> re-init A and exit loop */\n          e->a = 0x8000L; /* => e->a = 0x10000L after loop exit */\n    }\n    e->a <<= 1;\n  }\n\n  /* Fetch values from our compact representation of Table D.2:\n   * Qe values and probability estimation state machine\n   */\n  sv = *st;\n  qe = jpeg_aritab[sv & 0x7F];  /* => Qe_Value */\n  nl = qe & 0xFF; qe >>= 8;     /* Next_Index_LPS + Switch_MPS */\n  nm = qe & 0xFF; qe >>= 8;     /* Next_Index_MPS */\n\n  /* Decode & estimation procedures per sections D.2.4 & D.2.5 */\n  temp = e->a - qe;\n  e->a = temp;\n  temp <<= e->ct;\n  if (e->c >= temp) {\n    e->c -= temp;\n    /* Conditional LPS (less probable symbol) exchange */\n    if (e->a < qe) {\n      e->a = qe;\n      *st = (sv & 0x80) ^ nm;   /* Estimate_after_MPS */\n    } else {\n      e->a = qe;\n      *st = (sv & 0x80) ^ nl;   /* Estimate_after_LPS */\n      sv ^= 0x80;               /* Exchange LPS/MPS */\n    }\n  } else if (e->a < 0x8000L) {\n    /* Conditional MPS (more probable symbol) exchange */\n    if (e->a < qe) {\n      *st = (sv & 0x80) ^ nl;   /* Estimate_after_LPS */\n      sv ^= 0x80;               /* Exchange LPS/MPS */\n    } else {\n      *st = (sv & 0x80) ^ nm;   /* Estimate_after_MPS */\n    }\n  }\n\n  return sv >> 7;\n}\n\n\n/*\n * Check for a restart marker & resynchronize decoder.\n */\n\nLOCAL(void)\nprocess_restart (j_decompress_ptr cinfo)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  int ci;\n  jpeg_component_info *compptr;\n\n  /* Advance past the RSTn marker */\n  if (! (*cinfo->marker->read_restart_marker) (cinfo))\n    ERREXIT(cinfo, JERR_CANT_SUSPEND);\n\n  /* Re-initialize statistics areas */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    if (!cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {\n      MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);\n      /* Reset DC predictions to 0 */\n      entropy->last_dc_val[ci] = 0;\n      entropy->dc_context[ci] = 0;\n    }\n    if (!cinfo->progressive_mode || cinfo->Ss) {\n      MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);\n    }\n  }\n\n  /* Reset arithmetic decoding variables */\n  entropy->c = 0;\n  entropy->a = 0;\n  entropy->ct = -16;    /* force reading 2 initial bytes to fill C */\n\n  /* Reset restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n}\n\n\n/*\n * Arithmetic MCU decoding.\n * Each of these routines decodes and returns one MCU's worth of\n * arithmetic-compressed coefficients.\n * The coefficients are reordered from zigzag order into natural array order,\n * but are not dequantized.\n *\n * The i'th block of the MCU is stored into the block pointed to by\n * MCU_data[i].  WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.\n */\n\n/*\n * MCU decoding for DC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\ndecode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  JBLOCKROW block;\n  unsigned char *st;\n  int blkn, ci, tbl, sign;\n  int v, m;\n\n  /* Process restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      process_restart(cinfo);\n    entropy->restarts_to_go--;\n  }\n\n  if (entropy->ct == -1) return TRUE;   /* if error do nothing */\n\n  /* Outer loop handles each block in the MCU */\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n    ci = cinfo->MCU_membership[blkn];\n    tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;\n\n    /* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */\n\n    /* Table F.4: Point to statistics bin S0 for DC coefficient coding */\n    st = entropy->dc_stats[tbl] + entropy->dc_context[ci];\n\n    /* Figure F.19: Decode_DC_DIFF */\n    if (arith_decode(cinfo, st) == 0)\n      entropy->dc_context[ci] = 0;\n    else {\n      /* Figure F.21: Decoding nonzero value v */\n      /* Figure F.22: Decoding the sign of v */\n      sign = arith_decode(cinfo, st + 1);\n      st += 2; st += sign;\n      /* Figure F.23: Decoding the magnitude category of v */\n      if ((m = arith_decode(cinfo, st)) != 0) {\n        st = entropy->dc_stats[tbl] + 20;       /* Table F.4: X1 = 20 */\n        while (arith_decode(cinfo, st)) {\n          if ((m <<= 1) == 0x8000) {\n            WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n            entropy->ct = -1;                   /* magnitude overflow */\n            return TRUE;\n          }\n          st += 1;\n        }\n      }\n      /* Section F.1.4.4.1.2: Establish dc_context conditioning category */\n      if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))\n        entropy->dc_context[ci] = 0;               /* zero diff category */\n      else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))\n        entropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */\n      else\n        entropy->dc_context[ci] = 4 + (sign * 4);  /* small diff category */\n      v = m;\n      /* Figure F.24: Decoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n        if (arith_decode(cinfo, st)) v |= m;\n      v += 1; if (sign) v = -v;\n      entropy->last_dc_val[ci] += v;\n    }\n\n    /* Scale and output the DC coefficient (assumes jpeg_natural_order[0]=0) */\n    (*block)[0] = (JCOEF) LEFT_SHIFT(entropy->last_dc_val[ci], cinfo->Al);\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for AC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\ndecode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  JBLOCKROW block;\n  unsigned char *st;\n  int tbl, sign, k;\n  int v, m;\n\n  /* Process restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      process_restart(cinfo);\n    entropy->restarts_to_go--;\n  }\n\n  if (entropy->ct == -1) return TRUE;   /* if error do nothing */\n\n  /* There is always only one block per MCU */\n  block = MCU_data[0];\n  tbl = cinfo->cur_comp_info[0]->ac_tbl_no;\n\n  /* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */\n\n  /* Figure F.20: Decode_AC_coefficients */\n  for (k = cinfo->Ss; k <= cinfo->Se; k++) {\n    st = entropy->ac_stats[tbl] + 3 * (k - 1);\n    if (arith_decode(cinfo, st)) break;         /* EOB flag */\n    while (arith_decode(cinfo, st + 1) == 0) {\n      st += 3; k++;\n      if (k > cinfo->Se) {\n        WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n        entropy->ct = -1;                       /* spectral overflow */\n        return TRUE;\n      }\n    }\n    /* Figure F.21: Decoding nonzero value v */\n    /* Figure F.22: Decoding the sign of v */\n    sign = arith_decode(cinfo, entropy->fixed_bin);\n    st += 2;\n    /* Figure F.23: Decoding the magnitude category of v */\n    if ((m = arith_decode(cinfo, st)) != 0) {\n      if (arith_decode(cinfo, st)) {\n        m <<= 1;\n        st = entropy->ac_stats[tbl] +\n             (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);\n        while (arith_decode(cinfo, st)) {\n          if ((m <<= 1) == 0x8000) {\n            WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n            entropy->ct = -1;                   /* magnitude overflow */\n            return TRUE;\n          }\n          st += 1;\n        }\n      }\n    }\n    v = m;\n    /* Figure F.24: Decoding the magnitude bit pattern of v */\n    st += 14;\n    while (m >>= 1)\n      if (arith_decode(cinfo, st)) v |= m;\n    v += 1; if (sign) v = -v;\n    /* Scale and output coefficient in natural (dezigzagged) order */\n    (*block)[jpeg_natural_order[k]] = (JCOEF) (v << cinfo->Al);\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for DC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\ndecode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  unsigned char *st;\n  int p1, blkn;\n\n  /* Process restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      process_restart(cinfo);\n    entropy->restarts_to_go--;\n  }\n\n  st = entropy->fixed_bin;      /* use fixed probability estimation */\n  p1 = 1 << cinfo->Al;          /* 1 in the bit position being coded */\n\n  /* Outer loop handles each block in the MCU */\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    /* Encoded data is simply the next bit of the two's-complement DC value */\n    if (arith_decode(cinfo, st))\n      MCU_data[blkn][0][0] |= p1;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for AC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\ndecode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  JBLOCKROW block;\n  JCOEFPTR thiscoef;\n  unsigned char *st;\n  int tbl, k, kex;\n  int p1, m1;\n\n  /* Process restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      process_restart(cinfo);\n    entropy->restarts_to_go--;\n  }\n\n  if (entropy->ct == -1) return TRUE;   /* if error do nothing */\n\n  /* There is always only one block per MCU */\n  block = MCU_data[0];\n  tbl = cinfo->cur_comp_info[0]->ac_tbl_no;\n\n  p1 = 1 << cinfo->Al;          /* 1 in the bit position being coded */\n  m1 = (-1) << cinfo->Al;       /* -1 in the bit position being coded */\n\n  /* Establish EOBx (previous stage end-of-block) index */\n  for (kex = cinfo->Se; kex > 0; kex--)\n    if ((*block)[jpeg_natural_order[kex]]) break;\n\n  for (k = cinfo->Ss; k <= cinfo->Se; k++) {\n    st = entropy->ac_stats[tbl] + 3 * (k - 1);\n    if (k > kex)\n      if (arith_decode(cinfo, st)) break;       /* EOB flag */\n    for (;;) {\n      thiscoef = *block + jpeg_natural_order[k];\n      if (*thiscoef) {                          /* previously nonzero coef */\n        if (arith_decode(cinfo, st + 2)) {\n          if (*thiscoef < 0)\n            *thiscoef += m1;\n          else\n            *thiscoef += p1;\n        }\n        break;\n      }\n      if (arith_decode(cinfo, st + 1)) {        /* newly nonzero coef */\n        if (arith_decode(cinfo, entropy->fixed_bin))\n          *thiscoef = m1;\n        else\n          *thiscoef = p1;\n        break;\n      }\n      st += 3; k++;\n      if (k > cinfo->Se) {\n        WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n        entropy->ct = -1;                       /* spectral overflow */\n        return TRUE;\n      }\n    }\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Decode one MCU's worth of arithmetic-compressed coefficients.\n */\n\nMETHODDEF(boolean)\ndecode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  jpeg_component_info *compptr;\n  JBLOCKROW block;\n  unsigned char *st;\n  int blkn, ci, tbl, sign, k;\n  int v, m;\n\n  /* Process restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      process_restart(cinfo);\n    entropy->restarts_to_go--;\n  }\n\n  if (entropy->ct == -1) return TRUE;   /* if error do nothing */\n\n  /* Outer loop handles each block in the MCU */\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data ? MCU_data[blkn] : NULL;\n    ci = cinfo->MCU_membership[blkn];\n    compptr = cinfo->cur_comp_info[ci];\n\n    /* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */\n\n    tbl = compptr->dc_tbl_no;\n\n    /* Table F.4: Point to statistics bin S0 for DC coefficient coding */\n    st = entropy->dc_stats[tbl] + entropy->dc_context[ci];\n\n    /* Figure F.19: Decode_DC_DIFF */\n    if (arith_decode(cinfo, st) == 0)\n      entropy->dc_context[ci] = 0;\n    else {\n      /* Figure F.21: Decoding nonzero value v */\n      /* Figure F.22: Decoding the sign of v */\n      sign = arith_decode(cinfo, st + 1);\n      st += 2; st += sign;\n      /* Figure F.23: Decoding the magnitude category of v */\n      if ((m = arith_decode(cinfo, st)) != 0) {\n        st = entropy->dc_stats[tbl] + 20;       /* Table F.4: X1 = 20 */\n        while (arith_decode(cinfo, st)) {\n          if ((m <<= 1) == 0x8000) {\n            WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n            entropy->ct = -1;                   /* magnitude overflow */\n            return TRUE;\n          }\n          st += 1;\n        }\n      }\n      /* Section F.1.4.4.1.2: Establish dc_context conditioning category */\n      if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))\n        entropy->dc_context[ci] = 0;               /* zero diff category */\n      else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))\n        entropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */\n      else\n        entropy->dc_context[ci] = 4 + (sign * 4);  /* small diff category */\n      v = m;\n      /* Figure F.24: Decoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n        if (arith_decode(cinfo, st)) v |= m;\n      v += 1; if (sign) v = -v;\n      entropy->last_dc_val[ci] += v;\n    }\n\n    if (block)\n      (*block)[0] = (JCOEF) entropy->last_dc_val[ci];\n\n    /* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */\n\n    tbl = compptr->ac_tbl_no;\n\n    /* Figure F.20: Decode_AC_coefficients */\n    for (k = 1; k <= DCTSIZE2 - 1; k++) {\n      st = entropy->ac_stats[tbl] + 3 * (k - 1);\n      if (arith_decode(cinfo, st)) break;       /* EOB flag */\n      while (arith_decode(cinfo, st + 1) == 0) {\n        st += 3; k++;\n        if (k > DCTSIZE2 - 1) {\n          WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n          entropy->ct = -1;                     /* spectral overflow */\n          return TRUE;\n        }\n      }\n      /* Figure F.21: Decoding nonzero value v */\n      /* Figure F.22: Decoding the sign of v */\n      sign = arith_decode(cinfo, entropy->fixed_bin);\n      st += 2;\n      /* Figure F.23: Decoding the magnitude category of v */\n      if ((m = arith_decode(cinfo, st)) != 0) {\n        if (arith_decode(cinfo, st)) {\n          m <<= 1;\n          st = entropy->ac_stats[tbl] +\n               (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);\n          while (arith_decode(cinfo, st)) {\n            if ((m <<= 1) == 0x8000) {\n              WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n              entropy->ct = -1;                 /* magnitude overflow */\n              return TRUE;\n            }\n            st += 1;\n          }\n        }\n      }\n      v = m;\n      /* Figure F.24: Decoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n        if (arith_decode(cinfo, st)) v |= m;\n      v += 1; if (sign) v = -v;\n      if (block)\n        (*block)[jpeg_natural_order[k]] = (JCOEF) v;\n    }\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Initialize for an arithmetic-compressed scan.\n */\n\nMETHODDEF(void)\nstart_pass (j_decompress_ptr cinfo)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  int ci, tbl;\n  jpeg_component_info *compptr;\n\n  if (cinfo->progressive_mode) {\n    /* Validate progressive scan parameters */\n    if (cinfo->Ss == 0) {\n      if (cinfo->Se != 0)\n        goto bad;\n    } else {\n      /* need not check Ss/Se < 0 since they came from unsigned bytes */\n      if (cinfo->Se < cinfo->Ss || cinfo->Se > DCTSIZE2 - 1)\n        goto bad;\n      /* AC scans may have only one component */\n      if (cinfo->comps_in_scan != 1)\n        goto bad;\n    }\n    if (cinfo->Ah != 0) {\n      /* Successive approximation refinement scan: must have Al = Ah-1. */\n      if (cinfo->Ah-1 != cinfo->Al)\n        goto bad;\n    }\n    if (cinfo->Al > 13) {       /* need not check for < 0 */\n      bad:\n      ERREXIT4(cinfo, JERR_BAD_PROGRESSION,\n               cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);\n    }\n    /* Update progression status, and verify that scan order is legal.\n     * Note that inter-scan inconsistencies are treated as warnings\n     * not fatal errors ... not clear if this is right way to behave.\n     */\n    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n      int coefi, cindex = cinfo->cur_comp_info[ci]->component_index;\n      int *coef_bit_ptr = & cinfo->coef_bits[cindex][0];\n      if (cinfo->Ss && coef_bit_ptr[0] < 0) /* AC without prior DC scan */\n        WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);\n      for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {\n        int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];\n        if (cinfo->Ah != expected)\n          WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);\n        coef_bit_ptr[coefi] = cinfo->Al;\n      }\n    }\n    /* Select MCU decoding routine */\n    if (cinfo->Ah == 0) {\n      if (cinfo->Ss == 0)\n        entropy->pub.decode_mcu = decode_mcu_DC_first;\n      else\n        entropy->pub.decode_mcu = decode_mcu_AC_first;\n    } else {\n      if (cinfo->Ss == 0)\n        entropy->pub.decode_mcu = decode_mcu_DC_refine;\n      else\n        entropy->pub.decode_mcu = decode_mcu_AC_refine;\n    }\n  } else {\n    /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.\n     * This ought to be an error condition, but we make it a warning.\n     */\n    if (cinfo->Ss != 0 || cinfo->Ah != 0 || cinfo->Al != 0 ||\n        (cinfo->Se < DCTSIZE2 && cinfo->Se != DCTSIZE2 - 1))\n      WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);\n    /* Select MCU decoding routine */\n    entropy->pub.decode_mcu = decode_mcu;\n  }\n\n  /* Allocate & initialize requested statistics areas */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    if (!cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {\n      tbl = compptr->dc_tbl_no;\n      if (tbl < 0 || tbl >= NUM_ARITH_TBLS)\n        ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);\n      if (entropy->dc_stats[tbl] == NULL)\n        entropy->dc_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)\n          ((j_common_ptr) cinfo, JPOOL_IMAGE, DC_STAT_BINS);\n      MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);\n      /* Initialize DC predictions to 0 */\n      entropy->last_dc_val[ci] = 0;\n      entropy->dc_context[ci] = 0;\n    }\n    if (!cinfo->progressive_mode || cinfo->Ss) {\n      tbl = compptr->ac_tbl_no;\n      if (tbl < 0 || tbl >= NUM_ARITH_TBLS)\n        ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);\n      if (entropy->ac_stats[tbl] == NULL)\n        entropy->ac_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)\n          ((j_common_ptr) cinfo, JPOOL_IMAGE, AC_STAT_BINS);\n      MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);\n    }\n  }\n\n  /* Initialize arithmetic decoding variables */\n  entropy->c = 0;\n  entropy->a = 0;\n  entropy->ct = -16;    /* force reading 2 initial bytes to fill C */\n\n  /* Initialize restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n}\n\n\n/*\n * Module initialization routine for arithmetic entropy decoding.\n */\n\nGLOBAL(void)\njinit_arith_decoder (j_decompress_ptr cinfo)\n{\n  arith_entropy_ptr entropy;\n  int i;\n\n  entropy = (arith_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(arith_entropy_decoder));\n  cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;\n  entropy->pub.start_pass = start_pass;\n\n  /* Mark tables unallocated */\n  for (i = 0; i < NUM_ARITH_TBLS; i++) {\n    entropy->dc_stats[i] = NULL;\n    entropy->ac_stats[i] = NULL;\n  }\n\n  /* Initialize index for fixed probability estimation */\n  entropy->fixed_bin[0] = 113;\n\n  if (cinfo->progressive_mode) {\n    /* Create progression status table */\n    int *coef_bit_ptr, ci;\n    cinfo->coef_bits = (int (*)[DCTSIZE2])\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  cinfo->num_components*DCTSIZE2*sizeof(int));\n    coef_bit_ptr = & cinfo->coef_bits[0][0];\n    for (ci = 0; ci < cinfo->num_components; ci++)\n      for (i = 0; i < DCTSIZE2; i++)\n        *coef_bit_ptr++ = -1;\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdatadst-tj.c",
    "content": "/*\n * jdatadst-tj.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2009-2012 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2011, 2014, 2016, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains compression data destination routines for the case of\n * emitting JPEG data to memory or to a file (or any stdio stream).\n * While these routines are sufficient for most applications,\n * some will want to use a different destination manager.\n * IMPORTANT: we assume that fwrite() will correctly transcribe an array of\n * JOCTETs into 8-bit-wide elements on external storage.  If char is wider\n * than 8 bits on your machine, you may need to do some tweaking.\n */\n\n/* this is not a core library module, so it doesn't define JPEG_INTERNALS */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jerror.h\"\n\n#ifndef HAVE_STDLIB_H           /* <stdlib.h> should declare malloc(),free() */\nextern void *malloc (size_t size);\nextern void free (void *ptr);\n#endif\n\n\n#define OUTPUT_BUF_SIZE  4096   /* choose an efficiently fwrite'able size */\n\n\n/* Expanded data destination object for memory output */\n\ntypedef struct {\n  struct jpeg_destination_mgr pub; /* public fields */\n\n  unsigned char **outbuffer;    /* target buffer */\n  unsigned long *outsize;\n  unsigned char *newbuffer;     /* newly allocated buffer */\n  JOCTET *buffer;               /* start of buffer */\n  size_t bufsize;\n  boolean alloc;\n} my_mem_destination_mgr;\n\ntypedef my_mem_destination_mgr *my_mem_dest_ptr;\n\n\n/*\n * Initialize destination --- called by jpeg_start_compress\n * before any data is actually written.\n */\n\nMETHODDEF(void)\ninit_mem_destination (j_compress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n\n\n/*\n * Empty the output buffer --- called whenever buffer fills up.\n *\n * In typical applications, this should write the entire output buffer\n * (ignoring the current state of next_output_byte & free_in_buffer),\n * reset the pointer & count to the start of the buffer, and return TRUE\n * indicating that the buffer has been dumped.\n *\n * In applications that need to be able to suspend compression due to output\n * overrun, a FALSE return indicates that the buffer cannot be emptied now.\n * In this situation, the compressor will return to its caller (possibly with\n * an indication that it has not accepted all the supplied scanlines).  The\n * application should resume compression after it has made more room in the\n * output buffer.  Note that there are substantial restrictions on the use of\n * suspension --- see the documentation.\n *\n * When suspending, the compressor will back up to a convenient restart point\n * (typically the start of the current MCU). next_output_byte & free_in_buffer\n * indicate where the restart point will be if the current call returns FALSE.\n * Data beyond this point will be regenerated after resumption, so do not\n * write it out when emptying the buffer externally.\n */\n\nMETHODDEF(boolean)\nempty_mem_output_buffer (j_compress_ptr cinfo)\n{\n  size_t nextsize;\n  JOCTET *nextbuffer;\n  my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest;\n\n  if (!dest->alloc) ERREXIT(cinfo, JERR_BUFFER_SIZE);\n\n  /* Try to allocate new buffer with double size */\n  nextsize = dest->bufsize * 2;\n  nextbuffer = (JOCTET *) malloc(nextsize);\n\n  if (nextbuffer == NULL)\n    ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);\n\n  MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);\n\n  if (dest->newbuffer != NULL)\n    free(dest->newbuffer);\n\n  dest->newbuffer = nextbuffer;\n\n  dest->pub.next_output_byte = nextbuffer + dest->bufsize;\n  dest->pub.free_in_buffer = dest->bufsize;\n\n  dest->buffer = nextbuffer;\n  dest->bufsize = nextsize;\n\n  return TRUE;\n}\n\n\n/*\n * Terminate destination --- called by jpeg_finish_compress\n * after all data has been written.  Usually needs to flush buffer.\n *\n * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding\n * application must deal with any cleanup that should happen even\n * for error exit.\n */\n\nMETHODDEF(void)\nterm_mem_destination (j_compress_ptr cinfo)\n{\n  my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest;\n\n  if(dest->alloc) *dest->outbuffer = dest->buffer;\n  *dest->outsize = (unsigned long)(dest->bufsize - dest->pub.free_in_buffer);\n}\n\n\n/*\n * Prepare for output to a memory buffer.\n * The caller may supply an own initial buffer with appropriate size.\n * Otherwise, or when the actual data output exceeds the given size,\n * the library adapts the buffer size as necessary.\n * The standard library functions malloc/free are used for allocating\n * larger memory, so the buffer is available to the application after\n * finishing compression, and then the application is responsible for\n * freeing the requested memory.\n */\n\nGLOBAL(void)\njpeg_mem_dest_tj (j_compress_ptr cinfo,\n               unsigned char **outbuffer, unsigned long *outsize,\n               boolean alloc)\n{\n  boolean reused = FALSE;\n  my_mem_dest_ptr dest;\n\n  if (outbuffer == NULL || outsize == NULL)     /* sanity check */\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n\n  /* The destination object is made permanent so that multiple JPEG images\n   * can be written to the same buffer without re-executing jpeg_mem_dest.\n   */\n  if (cinfo->dest == NULL) {    /* first time for this JPEG object? */\n    cinfo->dest = (struct jpeg_destination_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n                                  sizeof(my_mem_destination_mgr));\n    dest = (my_mem_dest_ptr) cinfo->dest;\n    dest->newbuffer = NULL;\n    dest->buffer = NULL;\n  } else if (cinfo->dest->init_destination != init_mem_destination) {\n    /* It is unsafe to reuse the existing destination manager unless it was\n     * created by this function.\n     */\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n  }\n\n  dest = (my_mem_dest_ptr) cinfo->dest;\n  dest->pub.init_destination = init_mem_destination;\n  dest->pub.empty_output_buffer = empty_mem_output_buffer;\n  dest->pub.term_destination = term_mem_destination;\n  if (dest->buffer == *outbuffer && *outbuffer != NULL && alloc)\n    reused = TRUE;\n  dest->outbuffer = outbuffer;\n  dest->outsize = outsize;\n  dest->alloc = alloc;\n\n  if (*outbuffer == NULL || *outsize == 0) {\n    if (alloc) {\n      /* Allocate initial buffer */\n      dest->newbuffer = *outbuffer = (unsigned char *) malloc(OUTPUT_BUF_SIZE);\n      if (dest->newbuffer == NULL)\n        ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);\n      *outsize = OUTPUT_BUF_SIZE;\n    }\n    else ERREXIT(cinfo, JERR_BUFFER_SIZE);\n  }\n\n  dest->pub.next_output_byte = dest->buffer = *outbuffer;\n  if (!reused)\n    dest->bufsize = *outsize;\n  dest->pub.free_in_buffer = dest->bufsize;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdatadst.c",
    "content": "/*\n * jdatadst.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2009-2012 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2013, 2016, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains compression data destination routines for the case of\n * emitting JPEG data to memory or to a file (or any stdio stream).\n * While these routines are sufficient for most applications,\n * some will want to use a different destination manager.\n * IMPORTANT: we assume that fwrite() will correctly transcribe an array of\n * JOCTETs into 8-bit-wide elements on external storage.  If char is wider\n * than 8 bits on your machine, you may need to do some tweaking.\n */\n\n/* this is not a core library module, so it doesn't define JPEG_INTERNALS */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jerror.h\"\n\n#ifndef HAVE_STDLIB_H           /* <stdlib.h> should declare malloc(),free() */\nextern void *malloc (size_t size);\nextern void free (void *ptr);\n#endif\n\n\n/* Expanded data destination object for stdio output */\n\ntypedef struct {\n  struct jpeg_destination_mgr pub; /* public fields */\n\n  FILE *outfile;                /* target stream */\n  JOCTET *buffer;               /* start of buffer */\n} my_destination_mgr;\n\ntypedef my_destination_mgr *my_dest_ptr;\n\n#define OUTPUT_BUF_SIZE  4096   /* choose an efficiently fwrite'able size */\n\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n/* Expanded data destination object for memory output */\n\ntypedef struct {\n  struct jpeg_destination_mgr pub; /* public fields */\n\n  unsigned char **outbuffer;    /* target buffer */\n  unsigned long *outsize;\n  unsigned char *newbuffer;     /* newly allocated buffer */\n  JOCTET *buffer;               /* start of buffer */\n  size_t bufsize;\n} my_mem_destination_mgr;\n\ntypedef my_mem_destination_mgr *my_mem_dest_ptr;\n#endif\n\n\n/*\n * Initialize destination --- called by jpeg_start_compress\n * before any data is actually written.\n */\n\nMETHODDEF(void)\ninit_destination (j_compress_ptr cinfo)\n{\n  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;\n\n  /* Allocate the output buffer --- it will be released when done with image */\n  dest->buffer = (JOCTET *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  OUTPUT_BUF_SIZE * sizeof(JOCTET));\n\n  dest->pub.next_output_byte = dest->buffer;\n  dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;\n}\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\nMETHODDEF(void)\ninit_mem_destination (j_compress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n#endif\n\n\n/*\n * Empty the output buffer --- called whenever buffer fills up.\n *\n * In typical applications, this should write the entire output buffer\n * (ignoring the current state of next_output_byte & free_in_buffer),\n * reset the pointer & count to the start of the buffer, and return TRUE\n * indicating that the buffer has been dumped.\n *\n * In applications that need to be able to suspend compression due to output\n * overrun, a FALSE return indicates that the buffer cannot be emptied now.\n * In this situation, the compressor will return to its caller (possibly with\n * an indication that it has not accepted all the supplied scanlines).  The\n * application should resume compression after it has made more room in the\n * output buffer.  Note that there are substantial restrictions on the use of\n * suspension --- see the documentation.\n *\n * When suspending, the compressor will back up to a convenient restart point\n * (typically the start of the current MCU). next_output_byte & free_in_buffer\n * indicate where the restart point will be if the current call returns FALSE.\n * Data beyond this point will be regenerated after resumption, so do not\n * write it out when emptying the buffer externally.\n */\n\nMETHODDEF(boolean)\nempty_output_buffer (j_compress_ptr cinfo)\n{\n  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;\n\n  if (JFWRITE(dest->outfile, dest->buffer, OUTPUT_BUF_SIZE) !=\n      (size_t) OUTPUT_BUF_SIZE)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n\n  dest->pub.next_output_byte = dest->buffer;\n  dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;\n\n  return TRUE;\n}\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\nMETHODDEF(boolean)\nempty_mem_output_buffer (j_compress_ptr cinfo)\n{\n  size_t nextsize;\n  JOCTET *nextbuffer;\n  my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest;\n\n  /* Try to allocate new buffer with double size */\n  nextsize = dest->bufsize * 2;\n  nextbuffer = (JOCTET *) malloc(nextsize);\n\n  if (nextbuffer == NULL)\n    ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);\n\n  MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);\n\n  if (dest->newbuffer != NULL)\n    free(dest->newbuffer);\n\n  dest->newbuffer = nextbuffer;\n\n  dest->pub.next_output_byte = nextbuffer + dest->bufsize;\n  dest->pub.free_in_buffer = dest->bufsize;\n\n  dest->buffer = nextbuffer;\n  dest->bufsize = nextsize;\n\n  return TRUE;\n}\n#endif\n\n\n/*\n * Terminate destination --- called by jpeg_finish_compress\n * after all data has been written.  Usually needs to flush buffer.\n *\n * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding\n * application must deal with any cleanup that should happen even\n * for error exit.\n */\n\nMETHODDEF(void)\nterm_destination (j_compress_ptr cinfo)\n{\n  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;\n  size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer;\n\n  /* Write any data remaining in the buffer */\n  if (datacount > 0) {\n    if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)\n      ERREXIT(cinfo, JERR_FILE_WRITE);\n  }\n  fflush(dest->outfile);\n  /* Make sure we wrote the output file OK */\n  if (ferror(dest->outfile))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\nMETHODDEF(void)\nterm_mem_destination (j_compress_ptr cinfo)\n{\n  my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest;\n\n  *dest->outbuffer = dest->buffer;\n  *dest->outsize = (unsigned long)(dest->bufsize - dest->pub.free_in_buffer);\n}\n#endif\n\n\n/*\n * Prepare for output to a stdio stream.\n * The caller must have already opened the stream, and is responsible\n * for closing it after finishing compression.\n */\n\nGLOBAL(void)\njpeg_stdio_dest (j_compress_ptr cinfo, FILE *outfile)\n{\n  my_dest_ptr dest;\n\n  /* The destination object is made permanent so that multiple JPEG images\n   * can be written to the same file without re-executing jpeg_stdio_dest.\n   */\n  if (cinfo->dest == NULL) {    /* first time for this JPEG object? */\n    cinfo->dest = (struct jpeg_destination_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n                                  sizeof(my_destination_mgr));\n  } else if (cinfo->dest->init_destination != init_destination) {\n    /* It is unsafe to reuse the existing destination manager unless it was\n     * created by this function.  Otherwise, there is no guarantee that the\n     * opaque structure is the right size.  Note that we could just create a\n     * new structure, but the old structure would not be freed until\n     * jpeg_destroy_compress() was called.\n     */\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n  }\n\n  dest = (my_dest_ptr) cinfo->dest;\n  dest->pub.init_destination = init_destination;\n  dest->pub.empty_output_buffer = empty_output_buffer;\n  dest->pub.term_destination = term_destination;\n  dest->outfile = outfile;\n}\n\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n/*\n * Prepare for output to a memory buffer.\n * The caller may supply an own initial buffer with appropriate size.\n * Otherwise, or when the actual data output exceeds the given size,\n * the library adapts the buffer size as necessary.\n * The standard library functions malloc/free are used for allocating\n * larger memory, so the buffer is available to the application after\n * finishing compression, and then the application is responsible for\n * freeing the requested memory.\n * Note:  An initial buffer supplied by the caller is expected to be\n * managed by the application.  The library does not free such buffer\n * when allocating a larger buffer.\n */\n\nGLOBAL(void)\njpeg_mem_dest (j_compress_ptr cinfo,\n               unsigned char **outbuffer, unsigned long *outsize)\n{\n  my_mem_dest_ptr dest;\n\n  if (outbuffer == NULL || outsize == NULL)     /* sanity check */\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n\n  /* The destination object is made permanent so that multiple JPEG images\n   * can be written to the same buffer without re-executing jpeg_mem_dest.\n   */\n  if (cinfo->dest == NULL) {    /* first time for this JPEG object? */\n    cinfo->dest = (struct jpeg_destination_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n                                  sizeof(my_mem_destination_mgr));\n  } else if (cinfo->dest->init_destination != init_mem_destination) {\n    /* It is unsafe to reuse the existing destination manager unless it was\n     * created by this function.\n     */\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n  }\n\n  dest = (my_mem_dest_ptr) cinfo->dest;\n  dest->pub.init_destination = init_mem_destination;\n  dest->pub.empty_output_buffer = empty_mem_output_buffer;\n  dest->pub.term_destination = term_mem_destination;\n  dest->outbuffer = outbuffer;\n  dest->outsize = outsize;\n  dest->newbuffer = NULL;\n\n  if (*outbuffer == NULL || *outsize == 0) {\n    /* Allocate initial buffer */\n    dest->newbuffer = *outbuffer = (unsigned char *) malloc(OUTPUT_BUF_SIZE);\n    if (dest->newbuffer == NULL)\n      ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);\n    *outsize = OUTPUT_BUF_SIZE;\n  }\n\n  dest->pub.next_output_byte = dest->buffer = *outbuffer;\n  dest->pub.free_in_buffer = dest->bufsize = *outsize;\n}\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdatasrc-tj.c",
    "content": "/*\n * jdatasrc-tj.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2009-2011 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2011, 2016, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains decompression data source routines for the case of\n * reading JPEG data from memory or from a file (or any stdio stream).\n * While these routines are sufficient for most applications,\n * some will want to use a different source manager.\n * IMPORTANT: we assume that fread() will correctly transcribe an array of\n * JOCTETs from 8-bit-wide elements on external storage.  If char is wider\n * than 8 bits on your machine, you may need to do some tweaking.\n */\n\n/* this is not a core library module, so it doesn't define JPEG_INTERNALS */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jerror.h\"\n\n\n/*\n * Initialize source --- called by jpeg_read_header\n * before any data is actually read.\n */\n\nMETHODDEF(void)\ninit_mem_source (j_decompress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n\n\n/*\n * Fill the input buffer --- called whenever buffer is emptied.\n *\n * In typical applications, this should read fresh data into the buffer\n * (ignoring the current state of next_input_byte & bytes_in_buffer),\n * reset the pointer & count to the start of the buffer, and return TRUE\n * indicating that the buffer has been reloaded.  It is not necessary to\n * fill the buffer entirely, only to obtain at least one more byte.\n *\n * There is no such thing as an EOF return.  If the end of the file has been\n * reached, the routine has a choice of ERREXIT() or inserting fake data into\n * the buffer.  In most cases, generating a warning message and inserting a\n * fake EOI marker is the best course of action --- this will allow the\n * decompressor to output however much of the image is there.  However,\n * the resulting error message is misleading if the real problem is an empty\n * input file, so we handle that case specially.\n *\n * In applications that need to be able to suspend compression due to input\n * not being available yet, a FALSE return indicates that no more data can be\n * obtained right now, but more may be forthcoming later.  In this situation,\n * the decompressor will return to its caller (with an indication of the\n * number of scanlines it has read, if any).  The application should resume\n * decompression after it has loaded more data into the input buffer.  Note\n * that there are substantial restrictions on the use of suspension --- see\n * the documentation.\n *\n * When suspending, the decompressor will back up to a convenient restart point\n * (typically the start of the current MCU). next_input_byte & bytes_in_buffer\n * indicate where the restart point will be if the current call returns FALSE.\n * Data beyond this point must be rescanned after resumption, so move it to\n * the front of the buffer rather than discarding it.\n */\n\nMETHODDEF(boolean)\nfill_mem_input_buffer (j_decompress_ptr cinfo)\n{\n  static const JOCTET mybuffer[4] = {\n    (JOCTET) 0xFF, (JOCTET) JPEG_EOI, 0, 0\n  };\n\n  /* The whole JPEG data is expected to reside in the supplied memory\n   * buffer, so any request for more data beyond the given buffer size\n   * is treated as an error.\n   */\n  WARNMS(cinfo, JWRN_JPEG_EOF);\n\n  /* Insert a fake EOI marker */\n\n  cinfo->src->next_input_byte = mybuffer;\n  cinfo->src->bytes_in_buffer = 2;\n\n  return TRUE;\n}\n\n\n/*\n * Skip data --- used to skip over a potentially large amount of\n * uninteresting data (such as an APPn marker).\n *\n * Writers of suspendable-input applications must note that skip_input_data\n * is not granted the right to give a suspension return.  If the skip extends\n * beyond the data currently in the buffer, the buffer can be marked empty so\n * that the next read will cause a fill_input_buffer call that can suspend.\n * Arranging for additional bytes to be discarded before reloading the input\n * buffer is the application writer's problem.\n */\n\nMETHODDEF(void)\nskip_input_data (j_decompress_ptr cinfo, long num_bytes)\n{\n  struct jpeg_source_mgr *src = cinfo->src;\n\n  /* Just a dumb implementation for now.  Could use fseek() except\n   * it doesn't work on pipes.  Not clear that being smart is worth\n   * any trouble anyway --- large skips are infrequent.\n   */\n  if (num_bytes > 0) {\n    while (num_bytes > (long) src->bytes_in_buffer) {\n      num_bytes -= (long) src->bytes_in_buffer;\n      (void) (*src->fill_input_buffer) (cinfo);\n      /* note we assume that fill_input_buffer will never return FALSE,\n       * so suspension need not be handled.\n       */\n    }\n    src->next_input_byte += (size_t) num_bytes;\n    src->bytes_in_buffer -= (size_t) num_bytes;\n  }\n}\n\n\n/*\n * An additional method that can be provided by data source modules is the\n * resync_to_restart method for error recovery in the presence of RST markers.\n * For the moment, this source module just uses the default resync method\n * provided by the JPEG library.  That method assumes that no backtracking\n * is possible.\n */\n\n\n/*\n * Terminate source --- called by jpeg_finish_decompress\n * after all data has been read.  Often a no-op.\n *\n * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding\n * application must deal with any cleanup that should happen even\n * for error exit.\n */\n\nMETHODDEF(void)\nterm_source (j_decompress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n\n\n/*\n * Prepare for input from a supplied memory buffer.\n * The buffer must contain the whole JPEG data.\n */\n\nGLOBAL(void)\njpeg_mem_src_tj (j_decompress_ptr cinfo,\n                 const unsigned char *inbuffer, unsigned long insize)\n{\n  struct jpeg_source_mgr *src;\n\n  if (inbuffer == NULL || insize == 0)  /* Treat empty input as fatal error */\n    ERREXIT(cinfo, JERR_INPUT_EMPTY);\n\n  /* The source object is made permanent so that a series of JPEG images\n   * can be read from the same buffer by calling jpeg_mem_src only before\n   * the first one.\n   */\n  if (cinfo->src == NULL) {     /* first time for this JPEG object? */\n    cinfo->src = (struct jpeg_source_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n                                  sizeof(struct jpeg_source_mgr));\n  } else if (cinfo->src->init_source != init_mem_source) {\n    /* It is unsafe to reuse the existing source manager unless it was created\n     * by this function.\n     */\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n  }\n\n  src = cinfo->src;\n  src->init_source = init_mem_source;\n  src->fill_input_buffer = fill_mem_input_buffer;\n  src->skip_input_data = skip_input_data;\n  src->resync_to_restart = jpeg_resync_to_restart; /* use default method */\n  src->term_source = term_source;\n  src->bytes_in_buffer = (size_t) insize;\n  src->next_input_byte = (const JOCTET *) inbuffer;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdatasrc.c",
    "content": "/*\n * jdatasrc.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2009-2011 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2013, 2016, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains decompression data source routines for the case of\n * reading JPEG data from memory or from a file (or any stdio stream).\n * While these routines are sufficient for most applications,\n * some will want to use a different source manager.\n * IMPORTANT: we assume that fread() will correctly transcribe an array of\n * JOCTETs from 8-bit-wide elements on external storage.  If char is wider\n * than 8 bits on your machine, you may need to do some tweaking.\n */\n\n/* this is not a core library module, so it doesn't define JPEG_INTERNALS */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jerror.h\"\n\n\n/* Expanded data source object for stdio input */\n\ntypedef struct {\n  struct jpeg_source_mgr pub;   /* public fields */\n\n  FILE *infile;                 /* source stream */\n  JOCTET *buffer;               /* start of buffer */\n  boolean start_of_file;        /* have we gotten any data yet? */\n} my_source_mgr;\n\ntypedef my_source_mgr *my_src_ptr;\n\n#define INPUT_BUF_SIZE  4096    /* choose an efficiently fread'able size */\n\n\n/*\n * Initialize source --- called by jpeg_read_header\n * before any data is actually read.\n */\n\nMETHODDEF(void)\ninit_source (j_decompress_ptr cinfo)\n{\n  my_src_ptr src = (my_src_ptr) cinfo->src;\n\n  /* We reset the empty-input-file flag for each image,\n   * but we don't clear the input buffer.\n   * This is correct behavior for reading a series of images from one source.\n   */\n  src->start_of_file = TRUE;\n}\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\nMETHODDEF(void)\ninit_mem_source (j_decompress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n#endif\n\n\n/*\n * Fill the input buffer --- called whenever buffer is emptied.\n *\n * In typical applications, this should read fresh data into the buffer\n * (ignoring the current state of next_input_byte & bytes_in_buffer),\n * reset the pointer & count to the start of the buffer, and return TRUE\n * indicating that the buffer has been reloaded.  It is not necessary to\n * fill the buffer entirely, only to obtain at least one more byte.\n *\n * There is no such thing as an EOF return.  If the end of the file has been\n * reached, the routine has a choice of ERREXIT() or inserting fake data into\n * the buffer.  In most cases, generating a warning message and inserting a\n * fake EOI marker is the best course of action --- this will allow the\n * decompressor to output however much of the image is there.  However,\n * the resulting error message is misleading if the real problem is an empty\n * input file, so we handle that case specially.\n *\n * In applications that need to be able to suspend compression due to input\n * not being available yet, a FALSE return indicates that no more data can be\n * obtained right now, but more may be forthcoming later.  In this situation,\n * the decompressor will return to its caller (with an indication of the\n * number of scanlines it has read, if any).  The application should resume\n * decompression after it has loaded more data into the input buffer.  Note\n * that there are substantial restrictions on the use of suspension --- see\n * the documentation.\n *\n * When suspending, the decompressor will back up to a convenient restart point\n * (typically the start of the current MCU). next_input_byte & bytes_in_buffer\n * indicate where the restart point will be if the current call returns FALSE.\n * Data beyond this point must be rescanned after resumption, so move it to\n * the front of the buffer rather than discarding it.\n */\n\nMETHODDEF(boolean)\nfill_input_buffer (j_decompress_ptr cinfo)\n{\n  my_src_ptr src = (my_src_ptr) cinfo->src;\n  size_t nbytes;\n\n  nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE);\n\n  if (nbytes <= 0) {\n    if (src->start_of_file)     /* Treat empty input file as fatal error */\n      ERREXIT(cinfo, JERR_INPUT_EMPTY);\n    WARNMS(cinfo, JWRN_JPEG_EOF);\n    /* Insert a fake EOI marker */\n    src->buffer[0] = (JOCTET) 0xFF;\n    src->buffer[1] = (JOCTET) JPEG_EOI;\n    nbytes = 2;\n  }\n\n  src->pub.next_input_byte = src->buffer;\n  src->pub.bytes_in_buffer = nbytes;\n  src->start_of_file = FALSE;\n\n  return TRUE;\n}\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\nMETHODDEF(boolean)\nfill_mem_input_buffer (j_decompress_ptr cinfo)\n{\n  static const JOCTET mybuffer[4] = {\n    (JOCTET) 0xFF, (JOCTET) JPEG_EOI, 0, 0\n  };\n\n  /* The whole JPEG data is expected to reside in the supplied memory\n   * buffer, so any request for more data beyond the given buffer size\n   * is treated as an error.\n   */\n  WARNMS(cinfo, JWRN_JPEG_EOF);\n\n  /* Insert a fake EOI marker */\n\n  cinfo->src->next_input_byte = mybuffer;\n  cinfo->src->bytes_in_buffer = 2;\n\n  return TRUE;\n}\n#endif\n\n\n/*\n * Skip data --- used to skip over a potentially large amount of\n * uninteresting data (such as an APPn marker).\n *\n * Writers of suspendable-input applications must note that skip_input_data\n * is not granted the right to give a suspension return.  If the skip extends\n * beyond the data currently in the buffer, the buffer can be marked empty so\n * that the next read will cause a fill_input_buffer call that can suspend.\n * Arranging for additional bytes to be discarded before reloading the input\n * buffer is the application writer's problem.\n */\n\nMETHODDEF(void)\nskip_input_data (j_decompress_ptr cinfo, long num_bytes)\n{\n  struct jpeg_source_mgr *src = cinfo->src;\n\n  /* Just a dumb implementation for now.  Could use fseek() except\n   * it doesn't work on pipes.  Not clear that being smart is worth\n   * any trouble anyway --- large skips are infrequent.\n   */\n  if (num_bytes > 0) {\n    while (num_bytes > (long) src->bytes_in_buffer) {\n      num_bytes -= (long) src->bytes_in_buffer;\n      (void) (*src->fill_input_buffer) (cinfo);\n      /* note we assume that fill_input_buffer will never return FALSE,\n       * so suspension need not be handled.\n       */\n    }\n    src->next_input_byte += (size_t) num_bytes;\n    src->bytes_in_buffer -= (size_t) num_bytes;\n  }\n}\n\n\n/*\n * An additional method that can be provided by data source modules is the\n * resync_to_restart method for error recovery in the presence of RST markers.\n * For the moment, this source module just uses the default resync method\n * provided by the JPEG library.  That method assumes that no backtracking\n * is possible.\n */\n\n\n/*\n * Terminate source --- called by jpeg_finish_decompress\n * after all data has been read.  Often a no-op.\n *\n * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding\n * application must deal with any cleanup that should happen even\n * for error exit.\n */\n\nMETHODDEF(void)\nterm_source (j_decompress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n\n\n/*\n * Prepare for input from a stdio stream.\n * The caller must have already opened the stream, and is responsible\n * for closing it after finishing decompression.\n */\n\nGLOBAL(void)\njpeg_stdio_src (j_decompress_ptr cinfo, FILE *infile)\n{\n  my_src_ptr src;\n\n  /* The source object and input buffer are made permanent so that a series\n   * of JPEG images can be read from the same file by calling jpeg_stdio_src\n   * only before the first one.  (If we discarded the buffer at the end of\n   * one image, we'd likely lose the start of the next one.)\n   */\n  if (cinfo->src == NULL) {     /* first time for this JPEG object? */\n    cinfo->src = (struct jpeg_source_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n                                  sizeof(my_source_mgr));\n    src = (my_src_ptr) cinfo->src;\n    src->buffer = (JOCTET *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n                                  INPUT_BUF_SIZE * sizeof(JOCTET));\n  } else if (cinfo->src->init_source != init_source) {\n    /* It is unsafe to reuse the existing source manager unless it was created\n     * by this function.  Otherwise, there is no guarantee that the opaque\n     * structure is the right size.  Note that we could just create a new\n     * structure, but the old structure would not be freed until\n     * jpeg_destroy_decompress() was called.\n     */\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n  }\n\n  src = (my_src_ptr) cinfo->src;\n  src->pub.init_source = init_source;\n  src->pub.fill_input_buffer = fill_input_buffer;\n  src->pub.skip_input_data = skip_input_data;\n  src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */\n  src->pub.term_source = term_source;\n  src->infile = infile;\n  src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */\n  src->pub.next_input_byte = NULL; /* until buffer loaded */\n}\n\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n/*\n * Prepare for input from a supplied memory buffer.\n * The buffer must contain the whole JPEG data.\n */\n\nGLOBAL(void)\njpeg_mem_src (j_decompress_ptr cinfo,\n              const unsigned char *inbuffer, unsigned long insize)\n{\n  struct jpeg_source_mgr *src;\n\n  if (inbuffer == NULL || insize == 0)  /* Treat empty input as fatal error */\n    ERREXIT(cinfo, JERR_INPUT_EMPTY);\n\n  /* The source object is made permanent so that a series of JPEG images\n   * can be read from the same buffer by calling jpeg_mem_src only before\n   * the first one.\n   */\n  if (cinfo->src == NULL) {     /* first time for this JPEG object? */\n    cinfo->src = (struct jpeg_source_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n                                  sizeof(struct jpeg_source_mgr));\n  } else if (cinfo->src->init_source != init_mem_source) {\n    /* It is unsafe to reuse the existing source manager unless it was created\n     * by this function.\n     */\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n  }\n\n  src = cinfo->src;\n  src->init_source = init_mem_source;\n  src->fill_input_buffer = fill_mem_input_buffer;\n  src->skip_input_data = skip_input_data;\n  src->resync_to_restart = jpeg_resync_to_restart; /* use default method */\n  src->term_source = term_source;\n  src->bytes_in_buffer = (size_t) insize;\n  src->next_input_byte = (const JOCTET *) inbuffer;\n}\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdcoefct.c",
    "content": "/*\n * jdcoefct.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2010, 2015-2016, D. R. Commander.\n * Copyright (C) 2015, Google, Inc.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains the coefficient buffer controller for decompression.\n * This controller is the top level of the JPEG decompressor proper.\n * The coefficient buffer lies between entropy decoding and inverse-DCT steps.\n *\n * In buffered-image mode, this controller is the interface between\n * input-oriented processing and output-oriented processing.\n * Also, the input side (only) is used when reading a file for transcoding.\n */\n\n#include \"jinclude.h\"\n#include \"jdcoefct.h\"\n#include \"jpegcomp.h\"\n\n\n/* Forward declarations */\nMETHODDEF(int) decompress_onepass\n        (j_decompress_ptr cinfo, JSAMPIMAGE output_buf);\n#ifdef D_MULTISCAN_FILES_SUPPORTED\nMETHODDEF(int) decompress_data\n        (j_decompress_ptr cinfo, JSAMPIMAGE output_buf);\n#endif\n#ifdef BLOCK_SMOOTHING_SUPPORTED\nLOCAL(boolean) smoothing_ok (j_decompress_ptr cinfo);\nMETHODDEF(int) decompress_smooth_data\n        (j_decompress_ptr cinfo, JSAMPIMAGE output_buf);\n#endif\n\n\n/*\n * Initialize for an input processing pass.\n */\n\nMETHODDEF(void)\nstart_input_pass (j_decompress_ptr cinfo)\n{\n  cinfo->input_iMCU_row = 0;\n  start_iMCU_row(cinfo);\n}\n\n\n/*\n * Initialize for an output processing pass.\n */\n\nMETHODDEF(void)\nstart_output_pass (j_decompress_ptr cinfo)\n{\n#ifdef BLOCK_SMOOTHING_SUPPORTED\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  /* If multipass, check to see whether to use block smoothing on this pass */\n  if (coef->pub.coef_arrays != NULL) {\n    if (cinfo->do_block_smoothing && smoothing_ok(cinfo))\n      coef->pub.decompress_data = decompress_smooth_data;\n    else\n      coef->pub.decompress_data = decompress_data;\n  }\n#endif\n  cinfo->output_iMCU_row = 0;\n}\n\n\n/*\n * Decompress and return some data in the single-pass case.\n * Always attempts to emit one fully interleaved MCU row (\"iMCU\" row).\n * Input and output must run in lockstep since we have only a one-MCU buffer.\n * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.\n *\n * NB: output_buf contains a plane for each component in image,\n * which we index according to the component's SOF position.\n */\n\nMETHODDEF(int)\ndecompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION MCU_col_num;       /* index of current MCU within row */\n  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  int blkn, ci, xindex, yindex, yoffset, useful_width;\n  JSAMPARRAY output_ptr;\n  JDIMENSION start_col, output_col;\n  jpeg_component_info *compptr;\n  inverse_DCT_method_ptr inverse_DCT;\n\n  /* Loop to process as much as one whole iMCU row */\n  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;\n       yoffset++) {\n    for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;\n         MCU_col_num++) {\n      /* Try to fetch an MCU.  Entropy decoder expects buffer to be zeroed. */\n      jzero_far((void *) coef->MCU_buffer[0],\n                (size_t) (cinfo->blocks_in_MCU * sizeof(JBLOCK)));\n      if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {\n        /* Suspension forced; update state counters and exit */\n        coef->MCU_vert_offset = yoffset;\n        coef->MCU_ctr = MCU_col_num;\n        return JPEG_SUSPENDED;\n      }\n\n      /* Only perform the IDCT on blocks that are contained within the desired\n       * cropping region.\n       */\n      if (MCU_col_num >= cinfo->master->first_iMCU_col &&\n          MCU_col_num <= cinfo->master->last_iMCU_col) {\n        /* Determine where data should go in output_buf and do the IDCT thing.\n         * We skip dummy blocks at the right and bottom edges (but blkn gets\n         * incremented past them!).  Note the inner loop relies on having\n         * allocated the MCU_buffer[] blocks sequentially.\n         */\n        blkn = 0;                 /* index of current DCT block within MCU */\n        for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n          compptr = cinfo->cur_comp_info[ci];\n          /* Don't bother to IDCT an uninteresting component. */\n          if (! compptr->component_needed) {\n            blkn += compptr->MCU_blocks;\n            continue;\n          }\n          inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];\n          useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width\n                                                      : compptr->last_col_width;\n          output_ptr = output_buf[compptr->component_index] +\n            yoffset * compptr->_DCT_scaled_size;\n          start_col = (MCU_col_num - cinfo->master->first_iMCU_col) *\n              compptr->MCU_sample_width;\n          for (yindex = 0; yindex < compptr->MCU_height; yindex++) {\n            if (cinfo->input_iMCU_row < last_iMCU_row ||\n                yoffset+yindex < compptr->last_row_height) {\n              output_col = start_col;\n              for (xindex = 0; xindex < useful_width; xindex++) {\n                (*inverse_DCT) (cinfo, compptr,\n                                (JCOEFPTR) coef->MCU_buffer[blkn+xindex],\n                                output_ptr, output_col);\n                output_col += compptr->_DCT_scaled_size;\n              }\n            }\n            blkn += compptr->MCU_width;\n            output_ptr += compptr->_DCT_scaled_size;\n          }\n        }\n      }\n    }\n    /* Completed an MCU row, but perhaps not an iMCU row */\n    coef->MCU_ctr = 0;\n  }\n  /* Completed the iMCU row, advance counters for next one */\n  cinfo->output_iMCU_row++;\n  if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {\n    start_iMCU_row(cinfo);\n    return JPEG_ROW_COMPLETED;\n  }\n  /* Completed the scan */\n  (*cinfo->inputctl->finish_input_pass) (cinfo);\n  return JPEG_SCAN_COMPLETED;\n}\n\n\n/*\n * Dummy consume-input routine for single-pass operation.\n */\n\nMETHODDEF(int)\ndummy_consume_data (j_decompress_ptr cinfo)\n{\n  return JPEG_SUSPENDED;        /* Always indicate nothing was done */\n}\n\n\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n\n/*\n * Consume input data and store it in the full-image coefficient buffer.\n * We read as much as one fully interleaved MCU row (\"iMCU\" row) per call,\n * ie, v_samp_factor block rows for each component in the scan.\n * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.\n */\n\nMETHODDEF(int)\nconsume_data (j_decompress_ptr cinfo)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION MCU_col_num;       /* index of current MCU within row */\n  int blkn, ci, xindex, yindex, yoffset;\n  JDIMENSION start_col;\n  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];\n  JBLOCKROW buffer_ptr;\n  jpeg_component_info *compptr;\n\n  /* Align the virtual buffers for the components used in this scan. */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    buffer[ci] = (*cinfo->mem->access_virt_barray)\n      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],\n       cinfo->input_iMCU_row * compptr->v_samp_factor,\n       (JDIMENSION) compptr->v_samp_factor, TRUE);\n    /* Note: entropy decoder expects buffer to be zeroed,\n     * but this is handled automatically by the memory manager\n     * because we requested a pre-zeroed array.\n     */\n  }\n\n  /* Loop to process one whole iMCU row */\n  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;\n       yoffset++) {\n    for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;\n         MCU_col_num++) {\n      /* Construct list of pointers to DCT blocks belonging to this MCU */\n      blkn = 0;                 /* index of current DCT block within MCU */\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n        compptr = cinfo->cur_comp_info[ci];\n        start_col = MCU_col_num * compptr->MCU_width;\n        for (yindex = 0; yindex < compptr->MCU_height; yindex++) {\n          buffer_ptr = buffer[ci][yindex+yoffset] + start_col;\n          for (xindex = 0; xindex < compptr->MCU_width; xindex++) {\n            coef->MCU_buffer[blkn++] = buffer_ptr++;\n          }\n        }\n      }\n      /* Try to fetch the MCU. */\n      if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {\n        /* Suspension forced; update state counters and exit */\n        coef->MCU_vert_offset = yoffset;\n        coef->MCU_ctr = MCU_col_num;\n        return JPEG_SUSPENDED;\n      }\n    }\n    /* Completed an MCU row, but perhaps not an iMCU row */\n    coef->MCU_ctr = 0;\n  }\n  /* Completed the iMCU row, advance counters for next one */\n  if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {\n    start_iMCU_row(cinfo);\n    return JPEG_ROW_COMPLETED;\n  }\n  /* Completed the scan */\n  (*cinfo->inputctl->finish_input_pass) (cinfo);\n  return JPEG_SCAN_COMPLETED;\n}\n\n\n/*\n * Decompress and return some data in the multi-pass case.\n * Always attempts to emit one fully interleaved MCU row (\"iMCU\" row).\n * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.\n *\n * NB: output_buf contains a plane for each component in image.\n */\n\nMETHODDEF(int)\ndecompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  JDIMENSION block_num;\n  int ci, block_row, block_rows;\n  JBLOCKARRAY buffer;\n  JBLOCKROW buffer_ptr;\n  JSAMPARRAY output_ptr;\n  JDIMENSION output_col;\n  jpeg_component_info *compptr;\n  inverse_DCT_method_ptr inverse_DCT;\n\n  /* Force some input to be done if we are getting ahead of the input. */\n  while (cinfo->input_scan_number < cinfo->output_scan_number ||\n         (cinfo->input_scan_number == cinfo->output_scan_number &&\n          cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) {\n    if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)\n      return JPEG_SUSPENDED;\n  }\n\n  /* OK, output from the virtual arrays. */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Don't bother to IDCT an uninteresting component. */\n    if (! compptr->component_needed)\n      continue;\n    /* Align the virtual buffer for this component. */\n    buffer = (*cinfo->mem->access_virt_barray)\n      ((j_common_ptr) cinfo, coef->whole_image[ci],\n       cinfo->output_iMCU_row * compptr->v_samp_factor,\n       (JDIMENSION) compptr->v_samp_factor, FALSE);\n    /* Count non-dummy DCT block rows in this iMCU row. */\n    if (cinfo->output_iMCU_row < last_iMCU_row)\n      block_rows = compptr->v_samp_factor;\n    else {\n      /* NB: can't use last_row_height here; it is input-side-dependent! */\n      block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);\n      if (block_rows == 0) block_rows = compptr->v_samp_factor;\n    }\n    inverse_DCT = cinfo->idct->inverse_DCT[ci];\n    output_ptr = output_buf[ci];\n    /* Loop over all DCT blocks to be processed. */\n    for (block_row = 0; block_row < block_rows; block_row++) {\n      buffer_ptr = buffer[block_row] + cinfo->master->first_MCU_col[ci];\n      output_col = 0;\n      for (block_num = cinfo->master->first_MCU_col[ci];\n           block_num <= cinfo->master->last_MCU_col[ci]; block_num++) {\n        (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr,\n                        output_ptr, output_col);\n        buffer_ptr++;\n        output_col += compptr->_DCT_scaled_size;\n      }\n      output_ptr += compptr->_DCT_scaled_size;\n    }\n  }\n\n  if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)\n    return JPEG_ROW_COMPLETED;\n  return JPEG_SCAN_COMPLETED;\n}\n\n#endif /* D_MULTISCAN_FILES_SUPPORTED */\n\n\n#ifdef BLOCK_SMOOTHING_SUPPORTED\n\n/*\n * This code applies interblock smoothing as described by section K.8\n * of the JPEG standard: the first 5 AC coefficients are estimated from\n * the DC values of a DCT block and its 8 neighboring blocks.\n * We apply smoothing only for progressive JPEG decoding, and only if\n * the coefficients it can estimate are not yet known to full precision.\n */\n\n/* Natural-order array positions of the first 5 zigzag-order coefficients */\n#define Q01_POS  1\n#define Q10_POS  8\n#define Q20_POS  16\n#define Q11_POS  9\n#define Q02_POS  2\n\n/*\n * Determine whether block smoothing is applicable and safe.\n * We also latch the current states of the coef_bits[] entries for the\n * AC coefficients; otherwise, if the input side of the decompressor\n * advances into a new scan, we might think the coefficients are known\n * more accurately than they really are.\n */\n\nLOCAL(boolean)\nsmoothing_ok (j_decompress_ptr cinfo)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  boolean smoothing_useful = FALSE;\n  int ci, coefi;\n  jpeg_component_info *compptr;\n  JQUANT_TBL *qtable;\n  int *coef_bits;\n  int *coef_bits_latch;\n\n  if (! cinfo->progressive_mode || cinfo->coef_bits == NULL)\n    return FALSE;\n\n  /* Allocate latch area if not already done */\n  if (coef->coef_bits_latch == NULL)\n    coef->coef_bits_latch = (int *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  cinfo->num_components *\n                                  (SAVED_COEFS * sizeof(int)));\n  coef_bits_latch = coef->coef_bits_latch;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* All components' quantization values must already be latched. */\n    if ((qtable = compptr->quant_table) == NULL)\n      return FALSE;\n    /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */\n    if (qtable->quantval[0] == 0 ||\n        qtable->quantval[Q01_POS] == 0 ||\n        qtable->quantval[Q10_POS] == 0 ||\n        qtable->quantval[Q20_POS] == 0 ||\n        qtable->quantval[Q11_POS] == 0 ||\n        qtable->quantval[Q02_POS] == 0)\n      return FALSE;\n    /* DC values must be at least partly known for all components. */\n    coef_bits = cinfo->coef_bits[ci];\n    if (coef_bits[0] < 0)\n      return FALSE;\n    /* Block smoothing is helpful if some AC coefficients remain inaccurate. */\n    for (coefi = 1; coefi <= 5; coefi++) {\n      coef_bits_latch[coefi] = coef_bits[coefi];\n      if (coef_bits[coefi] != 0)\n        smoothing_useful = TRUE;\n    }\n    coef_bits_latch += SAVED_COEFS;\n  }\n\n  return smoothing_useful;\n}\n\n\n/*\n * Variant of decompress_data for use when doing block smoothing.\n */\n\nMETHODDEF(int)\ndecompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  JDIMENSION block_num, last_block_column;\n  int ci, block_row, block_rows, access_rows;\n  JBLOCKARRAY buffer;\n  JBLOCKROW buffer_ptr, prev_block_row, next_block_row;\n  JSAMPARRAY output_ptr;\n  JDIMENSION output_col;\n  jpeg_component_info *compptr;\n  inverse_DCT_method_ptr inverse_DCT;\n  boolean first_row, last_row;\n  JCOEF *workspace;\n  int *coef_bits;\n  JQUANT_TBL *quanttbl;\n  JLONG Q00,Q01,Q02,Q10,Q11,Q20, num;\n  int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9;\n  int Al, pred;\n\n  /* Keep a local variable to avoid looking it up more than once */\n  workspace = coef->workspace;\n\n  /* Force some input to be done if we are getting ahead of the input. */\n  while (cinfo->input_scan_number <= cinfo->output_scan_number &&\n         ! cinfo->inputctl->eoi_reached) {\n    if (cinfo->input_scan_number == cinfo->output_scan_number) {\n      /* If input is working on current scan, we ordinarily want it to\n       * have completed the current row.  But if input scan is DC,\n       * we want it to keep one row ahead so that next block row's DC\n       * values are up to date.\n       */\n      JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0;\n      if (cinfo->input_iMCU_row > cinfo->output_iMCU_row+delta)\n        break;\n    }\n    if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)\n      return JPEG_SUSPENDED;\n  }\n\n  /* OK, output from the virtual arrays. */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Don't bother to IDCT an uninteresting component. */\n    if (! compptr->component_needed)\n      continue;\n    /* Count non-dummy DCT block rows in this iMCU row. */\n    if (cinfo->output_iMCU_row < last_iMCU_row) {\n      block_rows = compptr->v_samp_factor;\n      access_rows = block_rows * 2; /* this and next iMCU row */\n      last_row = FALSE;\n    } else {\n      /* NB: can't use last_row_height here; it is input-side-dependent! */\n      block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);\n      if (block_rows == 0) block_rows = compptr->v_samp_factor;\n      access_rows = block_rows; /* this iMCU row only */\n      last_row = TRUE;\n    }\n    /* Align the virtual buffer for this component. */\n    if (cinfo->output_iMCU_row > 0) {\n      access_rows += compptr->v_samp_factor; /* prior iMCU row too */\n      buffer = (*cinfo->mem->access_virt_barray)\n        ((j_common_ptr) cinfo, coef->whole_image[ci],\n         (cinfo->output_iMCU_row - 1) * compptr->v_samp_factor,\n         (JDIMENSION) access_rows, FALSE);\n      buffer += compptr->v_samp_factor; /* point to current iMCU row */\n      first_row = FALSE;\n    } else {\n      buffer = (*cinfo->mem->access_virt_barray)\n        ((j_common_ptr) cinfo, coef->whole_image[ci],\n         (JDIMENSION) 0, (JDIMENSION) access_rows, FALSE);\n      first_row = TRUE;\n    }\n    /* Fetch component-dependent info */\n    coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS);\n    quanttbl = compptr->quant_table;\n    Q00 = quanttbl->quantval[0];\n    Q01 = quanttbl->quantval[Q01_POS];\n    Q10 = quanttbl->quantval[Q10_POS];\n    Q20 = quanttbl->quantval[Q20_POS];\n    Q11 = quanttbl->quantval[Q11_POS];\n    Q02 = quanttbl->quantval[Q02_POS];\n    inverse_DCT = cinfo->idct->inverse_DCT[ci];\n    output_ptr = output_buf[ci];\n    /* Loop over all DCT blocks to be processed. */\n    for (block_row = 0; block_row < block_rows; block_row++) {\n      buffer_ptr = buffer[block_row] + cinfo->master->first_MCU_col[ci];\n      if (first_row && block_row == 0)\n        prev_block_row = buffer_ptr;\n      else\n        prev_block_row = buffer[block_row-1];\n      if (last_row && block_row == block_rows-1)\n        next_block_row = buffer_ptr;\n      else\n        next_block_row = buffer[block_row+1];\n      /* We fetch the surrounding DC values using a sliding-register approach.\n       * Initialize all nine here so as to do the right thing on narrow pics.\n       */\n      DC1 = DC2 = DC3 = (int) prev_block_row[0][0];\n      DC4 = DC5 = DC6 = (int) buffer_ptr[0][0];\n      DC7 = DC8 = DC9 = (int) next_block_row[0][0];\n      output_col = 0;\n      last_block_column = compptr->width_in_blocks - 1;\n      for (block_num = cinfo->master->first_MCU_col[ci];\n           block_num <= cinfo->master->last_MCU_col[ci]; block_num++) {\n        /* Fetch current DCT block into workspace so we can modify it. */\n        jcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1);\n        /* Update DC values */\n        if (block_num < last_block_column) {\n          DC3 = (int) prev_block_row[1][0];\n          DC6 = (int) buffer_ptr[1][0];\n          DC9 = (int) next_block_row[1][0];\n        }\n        /* Compute coefficient estimates per K.8.\n         * An estimate is applied only if coefficient is still zero,\n         * and is not known to be fully accurate.\n         */\n        /* AC01 */\n        if ((Al=coef_bits[1]) != 0 && workspace[1] == 0) {\n          num = 36 * Q00 * (DC4 - DC6);\n          if (num >= 0) {\n            pred = (int) (((Q01<<7) + num) / (Q01<<8));\n            if (Al > 0 && pred >= (1<<Al))\n              pred = (1<<Al)-1;\n          } else {\n            pred = (int) (((Q01<<7) - num) / (Q01<<8));\n            if (Al > 0 && pred >= (1<<Al))\n              pred = (1<<Al)-1;\n            pred = -pred;\n          }\n          workspace[1] = (JCOEF) pred;\n        }\n        /* AC10 */\n        if ((Al=coef_bits[2]) != 0 && workspace[8] == 0) {\n          num = 36 * Q00 * (DC2 - DC8);\n          if (num >= 0) {\n            pred = (int) (((Q10<<7) + num) / (Q10<<8));\n            if (Al > 0 && pred >= (1<<Al))\n              pred = (1<<Al)-1;\n          } else {\n            pred = (int) (((Q10<<7) - num) / (Q10<<8));\n            if (Al > 0 && pred >= (1<<Al))\n              pred = (1<<Al)-1;\n            pred = -pred;\n          }\n          workspace[8] = (JCOEF) pred;\n        }\n        /* AC20 */\n        if ((Al=coef_bits[3]) != 0 && workspace[16] == 0) {\n          num = 9 * Q00 * (DC2 + DC8 - 2*DC5);\n          if (num >= 0) {\n            pred = (int) (((Q20<<7) + num) / (Q20<<8));\n            if (Al > 0 && pred >= (1<<Al))\n              pred = (1<<Al)-1;\n          } else {\n            pred = (int) (((Q20<<7) - num) / (Q20<<8));\n            if (Al > 0 && pred >= (1<<Al))\n              pred = (1<<Al)-1;\n            pred = -pred;\n          }\n          workspace[16] = (JCOEF) pred;\n        }\n        /* AC11 */\n        if ((Al=coef_bits[4]) != 0 && workspace[9] == 0) {\n          num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);\n          if (num >= 0) {\n            pred = (int) (((Q11<<7) + num) / (Q11<<8));\n            if (Al > 0 && pred >= (1<<Al))\n              pred = (1<<Al)-1;\n          } else {\n            pred = (int) (((Q11<<7) - num) / (Q11<<8));\n            if (Al > 0 && pred >= (1<<Al))\n              pred = (1<<Al)-1;\n            pred = -pred;\n          }\n          workspace[9] = (JCOEF) pred;\n        }\n        /* AC02 */\n        if ((Al=coef_bits[5]) != 0 && workspace[2] == 0) {\n          num = 9 * Q00 * (DC4 + DC6 - 2*DC5);\n          if (num >= 0) {\n            pred = (int) (((Q02<<7) + num) / (Q02<<8));\n            if (Al > 0 && pred >= (1<<Al))\n              pred = (1<<Al)-1;\n          } else {\n            pred = (int) (((Q02<<7) - num) / (Q02<<8));\n            if (Al > 0 && pred >= (1<<Al))\n              pred = (1<<Al)-1;\n            pred = -pred;\n          }\n          workspace[2] = (JCOEF) pred;\n        }\n        /* OK, do the IDCT */\n        (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) workspace,\n                        output_ptr, output_col);\n        /* Advance for next column */\n        DC1 = DC2; DC2 = DC3;\n        DC4 = DC5; DC5 = DC6;\n        DC7 = DC8; DC8 = DC9;\n        buffer_ptr++, prev_block_row++, next_block_row++;\n        output_col += compptr->_DCT_scaled_size;\n      }\n      output_ptr += compptr->_DCT_scaled_size;\n    }\n  }\n\n  if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)\n    return JPEG_ROW_COMPLETED;\n  return JPEG_SCAN_COMPLETED;\n}\n\n#endif /* BLOCK_SMOOTHING_SUPPORTED */\n\n\n/*\n * Initialize coefficient buffer controller.\n */\n\nGLOBAL(void)\njinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)\n{\n  my_coef_ptr coef;\n\n  coef = (my_coef_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_coef_controller));\n  cinfo->coef = (struct jpeg_d_coef_controller *) coef;\n  coef->pub.start_input_pass = start_input_pass;\n  coef->pub.start_output_pass = start_output_pass;\n#ifdef BLOCK_SMOOTHING_SUPPORTED\n  coef->coef_bits_latch = NULL;\n#endif\n\n  /* Create the coefficient buffer. */\n  if (need_full_buffer) {\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n    /* Allocate a full-image virtual array for each component, */\n    /* padded to a multiple of samp_factor DCT blocks in each direction. */\n    /* Note we ask for a pre-zeroed array. */\n    int ci, access_rows;\n    jpeg_component_info *compptr;\n\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n         ci++, compptr++) {\n      access_rows = compptr->v_samp_factor;\n#ifdef BLOCK_SMOOTHING_SUPPORTED\n      /* If block smoothing could be used, need a bigger window */\n      if (cinfo->progressive_mode)\n        access_rows *= 3;\n#endif\n      coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)\n        ((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE,\n         (JDIMENSION) jround_up((long) compptr->width_in_blocks,\n                                (long) compptr->h_samp_factor),\n         (JDIMENSION) jround_up((long) compptr->height_in_blocks,\n                                (long) compptr->v_samp_factor),\n         (JDIMENSION) access_rows);\n    }\n    coef->pub.consume_data = consume_data;\n    coef->pub.decompress_data = decompress_data;\n    coef->pub.coef_arrays = coef->whole_image; /* link to virtual arrays */\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n  } else {\n    /* We only need a single-MCU buffer. */\n    JBLOCKROW buffer;\n    int i;\n\n    buffer = (JBLOCKROW)\n      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  D_MAX_BLOCKS_IN_MCU * sizeof(JBLOCK));\n    for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) {\n      coef->MCU_buffer[i] = buffer + i;\n    }\n    coef->pub.consume_data = dummy_consume_data;\n    coef->pub.decompress_data = decompress_onepass;\n    coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */\n  }\n\n  /* Allocate the workspace buffer */\n  coef->workspace = (JCOEF *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(JCOEF) * DCTSIZE2);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdcoefct.h",
    "content": "/*\n * jdcoefct.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n */\n\n#define JPEG_INTERNALS\n#include \"jpeglib.h\"\n\n\n/* Block smoothing is only applicable for progressive JPEG, so: */\n#ifndef D_PROGRESSIVE_SUPPORTED\n#undef BLOCK_SMOOTHING_SUPPORTED\n#endif\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_d_coef_controller pub; /* public fields */\n\n  /* These variables keep track of the current location of the input side. */\n  /* cinfo->input_iMCU_row is also used for this. */\n  JDIMENSION MCU_ctr;           /* counts MCUs processed in current row */\n  int MCU_vert_offset;          /* counts MCU rows within iMCU row */\n  int MCU_rows_per_iMCU_row;    /* number of such rows needed */\n\n  /* The output side's location is represented by cinfo->output_iMCU_row. */\n\n  /* In single-pass modes, it's sufficient to buffer just one MCU.\n   * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks,\n   * and let the entropy decoder write into that workspace each time.\n   * In multi-pass modes, this array points to the current MCU's blocks\n   * within the virtual arrays; it is used only by the input side.\n   */\n  JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU];\n\n  /* Temporary workspace for one MCU */\n  JCOEF *workspace;\n\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n  /* In multi-pass modes, we need a virtual block array for each component. */\n  jvirt_barray_ptr whole_image[MAX_COMPONENTS];\n#endif\n\n#ifdef BLOCK_SMOOTHING_SUPPORTED\n  /* When doing block smoothing, we latch coefficient Al values here */\n  int *coef_bits_latch;\n#define SAVED_COEFS  6          /* we save coef_bits[0..5] */\n#endif\n} my_coef_controller;\n\ntypedef my_coef_controller *my_coef_ptr;\n\n\nLOCAL(void)\nstart_iMCU_row (j_decompress_ptr cinfo)\n/* Reset within-iMCU-row counters for a new row (input side) */\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  /* In an interleaved scan, an MCU row is the same as an iMCU row.\n   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.\n   * But at the bottom of the image, process only what's left.\n   */\n  if (cinfo->comps_in_scan > 1) {\n    coef->MCU_rows_per_iMCU_row = 1;\n  } else {\n    if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1))\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;\n    else\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;\n  }\n\n  coef->MCU_ctr = 0;\n  coef->MCU_vert_offset = 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdcol565.c",
    "content": "/*\n * jdcol565.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modifications:\n * Copyright (C) 2013, Linaro Limited.\n * Copyright (C) 2014-2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains output colorspace conversion routines.\n */\n\n/* This file is included by jdcolor.c */\n\n\nINLINE\nLOCAL(void)\nycc_rgb565_convert_internal (j_decompress_ptr cinfo,\n                             JSAMPIMAGE input_buf, JDIMENSION input_row,\n                             JSAMPARRAY output_buf, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int y, cb, cr;\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  register int * Crrtab = cconvert->Cr_r_tab;\n  register int * Cbbtab = cconvert->Cb_b_tab;\n  register JLONG * Crgtab = cconvert->Cr_g_tab;\n  register JLONG * Cbgtab = cconvert->Cb_g_tab;\n  SHIFT_TEMPS\n\n  while (--num_rows >= 0) {\n    JLONG rgb;\n    unsigned int r, g, b;\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n\n    if (PACK_NEED_ALIGNMENT(outptr)) {\n      y  = GETJSAMPLE(*inptr0++);\n      cb = GETJSAMPLE(*inptr1++);\n      cr = GETJSAMPLE(*inptr2++);\n      r = range_limit[y + Crrtab[cr]];\n      g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],\n                                            SCALEBITS))];\n      b = range_limit[y + Cbbtab[cb]];\n      rgb = PACK_SHORT_565(r, g, b);\n      *(INT16*)outptr = (INT16)rgb;\n      outptr += 2;\n      num_cols--;\n    }\n    for (col = 0; col < (num_cols >> 1); col++) {\n      y  = GETJSAMPLE(*inptr0++);\n      cb = GETJSAMPLE(*inptr1++);\n      cr = GETJSAMPLE(*inptr2++);\n      r = range_limit[y + Crrtab[cr]];\n      g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],\n                                            SCALEBITS))];\n      b = range_limit[y + Cbbtab[cb]];\n      rgb = PACK_SHORT_565(r, g, b);\n\n      y  = GETJSAMPLE(*inptr0++);\n      cb = GETJSAMPLE(*inptr1++);\n      cr = GETJSAMPLE(*inptr2++);\n      r = range_limit[y + Crrtab[cr]];\n      g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],\n                                            SCALEBITS))];\n      b = range_limit[y + Cbbtab[cb]];\n      rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));\n\n      WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);\n      outptr += 4;\n    }\n    if (num_cols & 1) {\n      y  = GETJSAMPLE(*inptr0);\n      cb = GETJSAMPLE(*inptr1);\n      cr = GETJSAMPLE(*inptr2);\n      r = range_limit[y + Crrtab[cr]];\n      g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],\n                                            SCALEBITS))];\n      b = range_limit[y + Cbbtab[cb]];\n      rgb = PACK_SHORT_565(r, g, b);\n      *(INT16*)outptr = (INT16)rgb;\n    }\n  }\n}\n\n\nINLINE\nLOCAL(void)\nycc_rgb565D_convert_internal (j_decompress_ptr cinfo,\n                              JSAMPIMAGE input_buf, JDIMENSION input_row,\n                              JSAMPARRAY output_buf, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int y, cb, cr;\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  register int * Crrtab = cconvert->Cr_r_tab;\n  register int * Cbbtab = cconvert->Cb_b_tab;\n  register JLONG * Crgtab = cconvert->Cr_g_tab;\n  register JLONG * Cbgtab = cconvert->Cb_g_tab;\n  JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK];\n  SHIFT_TEMPS\n\n  while (--num_rows >= 0) {\n    JLONG rgb;\n    unsigned int r, g, b;\n\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    if (PACK_NEED_ALIGNMENT(outptr)) {\n      y  = GETJSAMPLE(*inptr0++);\n      cb = GETJSAMPLE(*inptr1++);\n      cr = GETJSAMPLE(*inptr2++);\n      r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];\n      g = range_limit[DITHER_565_G(y +\n                                   ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],\n                                                     SCALEBITS)), d0)];\n      b = range_limit[DITHER_565_B(y + Cbbtab[cb], d0)];\n      rgb = PACK_SHORT_565(r, g, b);\n      *(INT16*)outptr = (INT16)rgb;\n      outptr += 2;\n      num_cols--;\n    }\n    for (col = 0; col < (num_cols >> 1); col++) {\n      y  = GETJSAMPLE(*inptr0++);\n      cb = GETJSAMPLE(*inptr1++);\n      cr = GETJSAMPLE(*inptr2++);\n      r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];\n      g = range_limit[DITHER_565_G(y +\n                                   ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],\n                                                     SCALEBITS)), d0)];\n      b = range_limit[DITHER_565_B(y + Cbbtab[cb], d0)];\n      d0 = DITHER_ROTATE(d0);\n      rgb = PACK_SHORT_565(r, g, b);\n\n      y  = GETJSAMPLE(*inptr0++);\n      cb = GETJSAMPLE(*inptr1++);\n      cr = GETJSAMPLE(*inptr2++);\n      r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];\n      g = range_limit[DITHER_565_G(y +\n                                   ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],\n                                                     SCALEBITS)), d0)];\n      b = range_limit[DITHER_565_B(y + Cbbtab[cb], d0)];\n      d0 = DITHER_ROTATE(d0);\n      rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));\n\n      WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);\n      outptr += 4;\n    }\n    if (num_cols & 1) {\n      y  = GETJSAMPLE(*inptr0);\n      cb = GETJSAMPLE(*inptr1);\n      cr = GETJSAMPLE(*inptr2);\n      r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];\n      g = range_limit[DITHER_565_G(y +\n                                   ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],\n                                                     SCALEBITS)), d0)];\n      b = range_limit[DITHER_565_B(y + Cbbtab[cb], d0)];\n      rgb = PACK_SHORT_565(r, g, b);\n      *(INT16*)outptr = (INT16)rgb;\n    }\n  }\n}\n\n\nINLINE\nLOCAL(void)\nrgb_rgb565_convert_internal (j_decompress_ptr cinfo,\n                             JSAMPIMAGE input_buf, JDIMENSION input_row,\n                             JSAMPARRAY output_buf, int num_rows)\n{\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n  SHIFT_TEMPS\n\n  while (--num_rows >= 0) {\n    JLONG rgb;\n    unsigned int r, g, b;\n\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    if (PACK_NEED_ALIGNMENT(outptr)) {\n      r = GETJSAMPLE(*inptr0++);\n      g = GETJSAMPLE(*inptr1++);\n      b = GETJSAMPLE(*inptr2++);\n      rgb = PACK_SHORT_565(r, g, b);\n      *(INT16*)outptr = (INT16)rgb;\n      outptr += 2;\n      num_cols--;\n    }\n    for (col = 0; col < (num_cols >> 1); col++) {\n      r = GETJSAMPLE(*inptr0++);\n      g = GETJSAMPLE(*inptr1++);\n      b = GETJSAMPLE(*inptr2++);\n      rgb = PACK_SHORT_565(r, g, b);\n\n      r = GETJSAMPLE(*inptr0++);\n      g = GETJSAMPLE(*inptr1++);\n      b = GETJSAMPLE(*inptr2++);\n      rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));\n\n      WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);\n      outptr += 4;\n    }\n    if (num_cols & 1) {\n      r = GETJSAMPLE(*inptr0);\n      g = GETJSAMPLE(*inptr1);\n      b = GETJSAMPLE(*inptr2);\n      rgb = PACK_SHORT_565(r, g, b);\n      *(INT16*)outptr = (INT16)rgb;\n    }\n  }\n}\n\n\nINLINE\nLOCAL(void)\nrgb_rgb565D_convert_internal (j_decompress_ptr cinfo,\n                              JSAMPIMAGE input_buf, JDIMENSION input_row,\n                              JSAMPARRAY output_buf, int num_rows)\n{\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2;\n  register JDIMENSION col;\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  JDIMENSION num_cols = cinfo->output_width;\n  JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK];\n  SHIFT_TEMPS\n\n  while (--num_rows >= 0) {\n    JLONG rgb;\n    unsigned int r, g, b;\n\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    if (PACK_NEED_ALIGNMENT(outptr)) {\n      r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0++), d0)];\n      g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1++), d0)];\n      b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2++), d0)];\n      rgb = PACK_SHORT_565(r, g, b);\n      *(INT16*)outptr = (INT16)rgb;\n      outptr += 2;\n      num_cols--;\n    }\n    for (col = 0; col < (num_cols >> 1); col++) {\n      r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0++), d0)];\n      g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1++), d0)];\n      b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2++), d0)];\n      d0 = DITHER_ROTATE(d0);\n      rgb = PACK_SHORT_565(r, g, b);\n\n      r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0++), d0)];\n      g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1++), d0)];\n      b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2++), d0)];\n      d0 = DITHER_ROTATE(d0);\n      rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));\n\n      WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);\n      outptr += 4;\n    }\n    if (num_cols & 1) {\n      r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0), d0)];\n      g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1), d0)];\n      b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2), d0)];\n      rgb = PACK_SHORT_565(r, g, b);\n      *(INT16*)outptr = (INT16)rgb;\n    }\n  }\n}\n\n\nINLINE\nLOCAL(void)\ngray_rgb565_convert_internal (j_decompress_ptr cinfo,\n                              JSAMPIMAGE input_buf, JDIMENSION input_row,\n                              JSAMPARRAY output_buf, int num_rows)\n{\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n\n  while (--num_rows >= 0) {\n    JLONG rgb;\n    unsigned int g;\n\n    inptr = input_buf[0][input_row++];\n    outptr = *output_buf++;\n    if (PACK_NEED_ALIGNMENT(outptr)) {\n      g = *inptr++;\n      rgb = PACK_SHORT_565(g, g, g);\n      *(INT16*)outptr = (INT16)rgb;\n      outptr += 2;\n      num_cols--;\n    }\n    for (col = 0; col < (num_cols >> 1); col++) {\n      g = *inptr++;\n      rgb = PACK_SHORT_565(g, g, g);\n      g = *inptr++;\n      rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(g, g, g));\n      WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);\n      outptr += 4;\n    }\n    if (num_cols & 1) {\n      g = *inptr;\n      rgb = PACK_SHORT_565(g, g, g);\n      *(INT16*)outptr = (INT16)rgb;\n    }\n  }\n}\n\n\nINLINE\nLOCAL(void)\ngray_rgb565D_convert_internal (j_decompress_ptr cinfo,\n                               JSAMPIMAGE input_buf, JDIMENSION input_row,\n                               JSAMPARRAY output_buf, int num_rows)\n{\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  JDIMENSION num_cols = cinfo->output_width;\n  JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK];\n\n  while (--num_rows >= 0) {\n    JLONG rgb;\n    unsigned int g;\n\n    inptr = input_buf[0][input_row++];\n    outptr = *output_buf++;\n    if (PACK_NEED_ALIGNMENT(outptr)) {\n      g = *inptr++;\n      g = range_limit[DITHER_565_R(g, d0)];\n      rgb = PACK_SHORT_565(g, g, g);\n      *(INT16*)outptr = (INT16)rgb;\n      outptr += 2;\n      num_cols--;\n    }\n    for (col = 0; col < (num_cols >> 1); col++) {\n      g = *inptr++;\n      g = range_limit[DITHER_565_R(g, d0)];\n      rgb = PACK_SHORT_565(g, g, g);\n      d0 = DITHER_ROTATE(d0);\n\n      g = *inptr++;\n      g = range_limit[DITHER_565_R(g, d0)];\n      rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(g, g, g));\n      d0 = DITHER_ROTATE(d0);\n\n      WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);\n      outptr += 4;\n    }\n    if (num_cols & 1) {\n      g = *inptr;\n      g = range_limit[DITHER_565_R(g, d0)];\n      rgb = PACK_SHORT_565(g, g, g);\n      *(INT16*)outptr = (INT16)rgb;\n    }\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdcolext.c",
    "content": "/*\n * jdcolext.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009, 2011, 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains output colorspace conversion routines.\n */\n\n\n/* This file is included by jdcolor.c */\n\n\n/*\n * Convert some rows of samples to the output colorspace.\n *\n * Note that we change from noninterleaved, one-plane-per-component format\n * to interleaved-pixel format.  The output buffer is therefore three times\n * as wide as the input buffer.\n * A starting row offset is provided only for the input buffer.  The caller\n * can easily adjust the passed output_buf value to accommodate any row\n * offset required on that side.\n */\n\nINLINE\nLOCAL(void)\nycc_rgb_convert_internal (j_decompress_ptr cinfo,\n                          JSAMPIMAGE input_buf, JDIMENSION input_row,\n                          JSAMPARRAY output_buf, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int y, cb, cr;\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  register int * Crrtab = cconvert->Cr_r_tab;\n  register int * Cbbtab = cconvert->Cb_b_tab;\n  register JLONG * Crgtab = cconvert->Cr_g_tab;\n  register JLONG * Cbgtab = cconvert->Cb_g_tab;\n  SHIFT_TEMPS\n\n  while (--num_rows >= 0) {\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      y  = GETJSAMPLE(inptr0[col]);\n      cb = GETJSAMPLE(inptr1[col]);\n      cr = GETJSAMPLE(inptr2[col]);\n      /* Range-limiting is essential due to noise introduced by DCT losses. */\n      outptr[RGB_RED] =   range_limit[y + Crrtab[cr]];\n      outptr[RGB_GREEN] = range_limit[y +\n                              ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],\n                                                 SCALEBITS))];\n      outptr[RGB_BLUE] =  range_limit[y + Cbbtab[cb]];\n      /* Set unused byte to 0xFF so it can be interpreted as an opaque */\n      /* alpha channel value */\n#ifdef RGB_ALPHA\n      outptr[RGB_ALPHA] = 0xFF;\n#endif\n      outptr += RGB_PIXELSIZE;\n    }\n  }\n}\n\n\n/*\n * Convert grayscale to RGB: just duplicate the graylevel three times.\n * This is provided to support applications that don't want to cope\n * with grayscale as a separate case.\n */\n\nINLINE\nLOCAL(void)\ngray_rgb_convert_internal (j_decompress_ptr cinfo,\n                           JSAMPIMAGE input_buf, JDIMENSION input_row,\n                           JSAMPARRAY output_buf, int num_rows)\n{\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n\n  while (--num_rows >= 0) {\n    inptr = input_buf[0][input_row++];\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      /* We can dispense with GETJSAMPLE() here */\n      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];\n      /* Set unused byte to 0xFF so it can be interpreted as an opaque */\n      /* alpha channel value */\n#ifdef RGB_ALPHA\n      outptr[RGB_ALPHA] = 0xFF;\n#endif\n      outptr += RGB_PIXELSIZE;\n    }\n  }\n}\n\n\n/*\n * Convert RGB to extended RGB: just swap the order of source pixels\n */\n\nINLINE\nLOCAL(void)\nrgb_rgb_convert_internal (j_decompress_ptr cinfo,\n                          JSAMPIMAGE input_buf, JDIMENSION input_row,\n                          JSAMPARRAY output_buf, int num_rows)\n{\n  register JSAMPROW inptr0, inptr1, inptr2;\n  register JSAMPROW outptr;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n\n  while (--num_rows >= 0) {\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      /* We can dispense with GETJSAMPLE() here */\n      outptr[RGB_RED] = inptr0[col];\n      outptr[RGB_GREEN] = inptr1[col];\n      outptr[RGB_BLUE] = inptr2[col];\n      /* Set unused byte to 0xFF so it can be interpreted as an opaque */\n      /* alpha channel value */\n#ifdef RGB_ALPHA\n      outptr[RGB_ALPHA] = 0xFF;\n#endif\n      outptr += RGB_PIXELSIZE;\n    }\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdcolor.c",
    "content": "/*\n * jdcolor.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2011 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2009, 2011-2012, 2014-2015, D. R. Commander.\n * Copyright (C) 2013, Linaro Limited.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains output colorspace conversion routines.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jsimd.h\"\n#include \"jconfigint.h\"\n\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_color_deconverter pub; /* public fields */\n\n  /* Private state for YCC->RGB conversion */\n  int *Cr_r_tab;                /* => table for Cr to R conversion */\n  int *Cb_b_tab;                /* => table for Cb to B conversion */\n  JLONG *Cr_g_tab;              /* => table for Cr to G conversion */\n  JLONG *Cb_g_tab;              /* => table for Cb to G conversion */\n\n  /* Private state for RGB->Y conversion */\n  JLONG *rgb_y_tab;             /* => table for RGB to Y conversion */\n} my_color_deconverter;\n\ntypedef my_color_deconverter *my_cconvert_ptr;\n\n\n/**************** YCbCr -> RGB conversion: most common case **************/\n/****************   RGB -> Y   conversion: less common case **************/\n\n/*\n * YCbCr is defined per CCIR 601-1, except that Cb and Cr are\n * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.\n * The conversion equations to be implemented are therefore\n *\n *      R = Y                + 1.40200 * Cr\n *      G = Y - 0.34414 * Cb - 0.71414 * Cr\n *      B = Y + 1.77200 * Cb\n *\n *      Y = 0.29900 * R + 0.58700 * G + 0.11400 * B\n *\n * where Cb and Cr represent the incoming values less CENTERJSAMPLE.\n * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)\n *\n * To avoid floating-point arithmetic, we represent the fractional constants\n * as integers scaled up by 2^16 (about 4 digits precision); we have to divide\n * the products by 2^16, with appropriate rounding, to get the correct answer.\n * Notice that Y, being an integral input, does not contribute any fraction\n * so it need not participate in the rounding.\n *\n * For even more speed, we avoid doing any multiplications in the inner loop\n * by precalculating the constants times Cb and Cr for all possible values.\n * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);\n * for 12-bit samples it is still acceptable.  It's not very reasonable for\n * 16-bit samples, but if you want lossless storage you shouldn't be changing\n * colorspace anyway.\n * The Cr=>R and Cb=>B values can be rounded to integers in advance; the\n * values for the G calculation are left scaled up, since we must add them\n * together before rounding.\n */\n\n#define SCALEBITS       16      /* speediest right-shift on some machines */\n#define ONE_HALF        ((JLONG) 1 << (SCALEBITS-1))\n#define FIX(x)          ((JLONG) ((x) * (1L<<SCALEBITS) + 0.5))\n\n/* We allocate one big table for RGB->Y conversion and divide it up into\n * three parts, instead of doing three alloc_small requests.  This lets us\n * use a single table base address, which can be held in a register in the\n * inner loops on many machines (more than can hold all three addresses,\n * anyway).\n */\n\n#define R_Y_OFF         0                       /* offset to R => Y section */\n#define G_Y_OFF         (1*(MAXJSAMPLE+1))      /* offset to G => Y section */\n#define B_Y_OFF         (2*(MAXJSAMPLE+1))      /* etc. */\n#define TABLE_SIZE      (3*(MAXJSAMPLE+1))\n\n\n/* Include inline routines for colorspace extensions */\n\n#include \"jdcolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n\n#define RGB_RED EXT_RGB_RED\n#define RGB_GREEN EXT_RGB_GREEN\n#define RGB_BLUE EXT_RGB_BLUE\n#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n#define ycc_rgb_convert_internal ycc_extrgb_convert_internal\n#define gray_rgb_convert_internal gray_extrgb_convert_internal\n#define rgb_rgb_convert_internal rgb_extrgb_convert_internal\n#include \"jdcolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef ycc_rgb_convert_internal\n#undef gray_rgb_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_RGBX_RED\n#define RGB_GREEN EXT_RGBX_GREEN\n#define RGB_BLUE EXT_RGBX_BLUE\n#define RGB_ALPHA 3\n#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n#define ycc_rgb_convert_internal ycc_extrgbx_convert_internal\n#define gray_rgb_convert_internal gray_extrgbx_convert_internal\n#define rgb_rgb_convert_internal rgb_extrgbx_convert_internal\n#include \"jdcolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef ycc_rgb_convert_internal\n#undef gray_rgb_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_BGR_RED\n#define RGB_GREEN EXT_BGR_GREEN\n#define RGB_BLUE EXT_BGR_BLUE\n#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n#define ycc_rgb_convert_internal ycc_extbgr_convert_internal\n#define gray_rgb_convert_internal gray_extbgr_convert_internal\n#define rgb_rgb_convert_internal rgb_extbgr_convert_internal\n#include \"jdcolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef ycc_rgb_convert_internal\n#undef gray_rgb_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_BGRX_RED\n#define RGB_GREEN EXT_BGRX_GREEN\n#define RGB_BLUE EXT_BGRX_BLUE\n#define RGB_ALPHA 3\n#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n#define ycc_rgb_convert_internal ycc_extbgrx_convert_internal\n#define gray_rgb_convert_internal gray_extbgrx_convert_internal\n#define rgb_rgb_convert_internal rgb_extbgrx_convert_internal\n#include \"jdcolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef ycc_rgb_convert_internal\n#undef gray_rgb_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_XBGR_RED\n#define RGB_GREEN EXT_XBGR_GREEN\n#define RGB_BLUE EXT_XBGR_BLUE\n#define RGB_ALPHA 0\n#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n#define ycc_rgb_convert_internal ycc_extxbgr_convert_internal\n#define gray_rgb_convert_internal gray_extxbgr_convert_internal\n#define rgb_rgb_convert_internal rgb_extxbgr_convert_internal\n#include \"jdcolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef ycc_rgb_convert_internal\n#undef gray_rgb_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_XRGB_RED\n#define RGB_GREEN EXT_XRGB_GREEN\n#define RGB_BLUE EXT_XRGB_BLUE\n#define RGB_ALPHA 0\n#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n#define ycc_rgb_convert_internal ycc_extxrgb_convert_internal\n#define gray_rgb_convert_internal gray_extxrgb_convert_internal\n#define rgb_rgb_convert_internal rgb_extxrgb_convert_internal\n#include \"jdcolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef ycc_rgb_convert_internal\n#undef gray_rgb_convert_internal\n#undef rgb_rgb_convert_internal\n\n\n/*\n * Initialize tables for YCC->RGB colorspace conversion.\n */\n\nLOCAL(void)\nbuild_ycc_rgb_table (j_decompress_ptr cinfo)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  int i;\n  JLONG x;\n  SHIFT_TEMPS\n\n  cconvert->Cr_r_tab = (int *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                (MAXJSAMPLE+1) * sizeof(int));\n  cconvert->Cb_b_tab = (int *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                (MAXJSAMPLE+1) * sizeof(int));\n  cconvert->Cr_g_tab = (JLONG *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                (MAXJSAMPLE+1) * sizeof(JLONG));\n  cconvert->Cb_g_tab = (JLONG *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                (MAXJSAMPLE+1) * sizeof(JLONG));\n\n  for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {\n    /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */\n    /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */\n    /* Cr=>R value is nearest int to 1.40200 * x */\n    cconvert->Cr_r_tab[i] = (int)\n                    RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);\n    /* Cb=>B value is nearest int to 1.77200 * x */\n    cconvert->Cb_b_tab[i] = (int)\n                    RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);\n    /* Cr=>G value is scaled-up -0.71414 * x */\n    cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x;\n    /* Cb=>G value is scaled-up -0.34414 * x */\n    /* We also add in ONE_HALF so that need not do it in inner loop */\n    cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;\n  }\n}\n\n\n/*\n * Convert some rows of samples to the output colorspace.\n */\n\nMETHODDEF(void)\nycc_rgb_convert (j_decompress_ptr cinfo,\n                 JSAMPIMAGE input_buf, JDIMENSION input_row,\n                 JSAMPARRAY output_buf, int num_rows)\n{\n  switch (cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      ycc_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                  num_rows);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      ycc_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_BGR:\n      ycc_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                  num_rows);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      ycc_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      ycc_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      ycc_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    default:\n      ycc_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                               num_rows);\n      break;\n  }\n}\n\n\n/**************** Cases other than YCbCr -> RGB **************/\n\n\n/*\n * Initialize for RGB->grayscale colorspace conversion.\n */\n\nLOCAL(void)\nbuild_rgb_y_table (j_decompress_ptr cinfo)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  JLONG *rgb_y_tab;\n  JLONG i;\n\n  /* Allocate and fill in the conversion tables. */\n  cconvert->rgb_y_tab = rgb_y_tab = (JLONG *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                (TABLE_SIZE * sizeof(JLONG)));\n\n  for (i = 0; i <= MAXJSAMPLE; i++) {\n    rgb_y_tab[i+R_Y_OFF] = FIX(0.29900) * i;\n    rgb_y_tab[i+G_Y_OFF] = FIX(0.58700) * i;\n    rgb_y_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;\n  }\n}\n\n\n/*\n * Convert RGB to grayscale.\n */\n\nMETHODDEF(void)\nrgb_gray_convert (j_decompress_ptr cinfo,\n                  JSAMPIMAGE input_buf, JDIMENSION input_row,\n                  JSAMPARRAY output_buf, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int r, g, b;\n  register JLONG *ctab = cconvert->rgb_y_tab;\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n\n  while (--num_rows >= 0) {\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      r = GETJSAMPLE(inptr0[col]);\n      g = GETJSAMPLE(inptr1[col]);\n      b = GETJSAMPLE(inptr2[col]);\n      /* Y */\n      outptr[col] = (JSAMPLE)\n                ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])\n                 >> SCALEBITS);\n    }\n  }\n}\n\n\n/*\n * Color conversion for no colorspace change: just copy the data,\n * converting from separate-planes to interleaved representation.\n */\n\nMETHODDEF(void)\nnull_convert (j_decompress_ptr cinfo,\n              JSAMPIMAGE input_buf, JDIMENSION input_row,\n              JSAMPARRAY output_buf, int num_rows)\n{\n  register JSAMPROW inptr, inptr0, inptr1, inptr2, inptr3, outptr;\n  register JDIMENSION col;\n  register int num_components = cinfo->num_components;\n  JDIMENSION num_cols = cinfo->output_width;\n  int ci;\n\n  if (num_components == 3) {\n    while (--num_rows >= 0) {\n      inptr0 = input_buf[0][input_row];\n      inptr1 = input_buf[1][input_row];\n      inptr2 = input_buf[2][input_row];\n      input_row++;\n      outptr = *output_buf++;\n      for (col = 0; col < num_cols; col++) {\n        *outptr++ = inptr0[col];\n        *outptr++ = inptr1[col];\n        *outptr++ = inptr2[col];\n      }\n    }\n  } else if (num_components == 4) {\n    while (--num_rows >= 0) {\n      inptr0 = input_buf[0][input_row];\n      inptr1 = input_buf[1][input_row];\n      inptr2 = input_buf[2][input_row];\n      inptr3 = input_buf[3][input_row];\n      input_row++;\n      outptr = *output_buf++;\n      for (col = 0; col < num_cols; col++) {\n        *outptr++ = inptr0[col];\n        *outptr++ = inptr1[col];\n        *outptr++ = inptr2[col];\n        *outptr++ = inptr3[col];\n      }\n    }\n  } else {\n    while (--num_rows >= 0) {\n      for (ci = 0; ci < num_components; ci++) {\n        inptr = input_buf[ci][input_row];\n        outptr = *output_buf;\n        for (col = 0; col < num_cols; col++) {\n          outptr[ci] = inptr[col];\n          outptr += num_components;\n        }\n      }\n      output_buf++;\n      input_row++;\n    }\n  }\n}\n\n\n/*\n * Color conversion for grayscale: just copy the data.\n * This also works for YCbCr -> grayscale conversion, in which\n * we just copy the Y (luminance) component and ignore chrominance.\n */\n\nMETHODDEF(void)\ngrayscale_convert (j_decompress_ptr cinfo,\n                   JSAMPIMAGE input_buf, JDIMENSION input_row,\n                   JSAMPARRAY output_buf, int num_rows)\n{\n  jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0,\n                    num_rows, cinfo->output_width);\n}\n\n\n/*\n * Convert grayscale to RGB\n */\n\nMETHODDEF(void)\ngray_rgb_convert (j_decompress_ptr cinfo,\n                  JSAMPIMAGE input_buf, JDIMENSION input_row,\n                  JSAMPARRAY output_buf, int num_rows)\n{\n  switch (cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      gray_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      gray_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                    num_rows);\n      break;\n    case JCS_EXT_BGR:\n      gray_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      gray_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                    num_rows);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      gray_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                    num_rows);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      gray_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                    num_rows);\n      break;\n    default:\n      gray_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                num_rows);\n      break;\n  }\n}\n\n\n/*\n * Convert plain RGB to extended RGB\n */\n\nMETHODDEF(void)\nrgb_rgb_convert (j_decompress_ptr cinfo,\n                  JSAMPIMAGE input_buf, JDIMENSION input_row,\n                  JSAMPARRAY output_buf, int num_rows)\n{\n  switch (cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      rgb_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                  num_rows);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      rgb_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_BGR:\n      rgb_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                  num_rows);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      rgb_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      rgb_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      rgb_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    default:\n      rgb_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                               num_rows);\n      break;\n  }\n}\n\n\n/*\n * Adobe-style YCCK->CMYK conversion.\n * We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same\n * conversion as above, while passing K (black) unchanged.\n * We assume build_ycc_rgb_table has been called.\n */\n\nMETHODDEF(void)\nycck_cmyk_convert (j_decompress_ptr cinfo,\n                   JSAMPIMAGE input_buf, JDIMENSION input_row,\n                   JSAMPARRAY output_buf, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int y, cb, cr;\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2, inptr3;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE *range_limit = cinfo->sample_range_limit;\n  register int *Crrtab = cconvert->Cr_r_tab;\n  register int *Cbbtab = cconvert->Cb_b_tab;\n  register JLONG *Crgtab = cconvert->Cr_g_tab;\n  register JLONG *Cbgtab = cconvert->Cb_g_tab;\n  SHIFT_TEMPS\n\n  while (--num_rows >= 0) {\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    inptr3 = input_buf[3][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      y  = GETJSAMPLE(inptr0[col]);\n      cb = GETJSAMPLE(inptr1[col]);\n      cr = GETJSAMPLE(inptr2[col]);\n      /* Range-limiting is essential due to noise introduced by DCT losses. */\n      outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])];   /* red */\n      outptr[1] = range_limit[MAXJSAMPLE - (y +                 /* green */\n                              ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],\n                                                 SCALEBITS)))];\n      outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])];   /* blue */\n      /* K passes through unchanged */\n      outptr[3] = inptr3[col];  /* don't need GETJSAMPLE here */\n      outptr += 4;\n    }\n  }\n}\n\n\n/*\n * RGB565 conversion\n */\n\n#define PACK_SHORT_565_LE(r, g, b)   ((((r) << 8) & 0xF800) |  \\\n                                      (((g) << 3) & 0x7E0) | ((b) >> 3))\n#define PACK_SHORT_565_BE(r, g, b)   (((r) & 0xF8) | ((g) >> 5) |  \\\n                                      (((g) << 11) & 0xE000) |  \\\n                                      (((b) << 5) & 0x1F00))\n\n#define PACK_TWO_PIXELS_LE(l, r)     ((r << 16) | l)\n#define PACK_TWO_PIXELS_BE(l, r)     ((l << 16) | r)\n\n#define PACK_NEED_ALIGNMENT(ptr)     (((size_t)(ptr)) & 3)\n\n#define WRITE_TWO_ALIGNED_PIXELS(addr, pixels)  ((*(int *)(addr)) = pixels)\n\n#define DITHER_565_R(r, dither)  ((r) + ((dither) & 0xFF))\n#define DITHER_565_G(g, dither)  ((g) + (((dither) & 0xFF) >> 1))\n#define DITHER_565_B(b, dither)  ((b) + ((dither) & 0xFF))\n\n\n/* Declarations for ordered dithering\n *\n * We use a 4x4 ordered dither array packed into 32 bits.  This array is\n * sufficent for dithering RGB888 to RGB565.\n */\n\n#define DITHER_MASK       0x3\n#define DITHER_ROTATE(x)  ((((x) & 0xFF) << 24) | (((x) >> 8) & 0x00FFFFFF))\nstatic const JLONG dither_matrix[4] = {\n  0x0008020A,\n  0x0C040E06,\n  0x030B0109,\n  0x0F070D05\n};\n\n\nstatic INLINE boolean is_big_endian(void)\n{\n  int test_value = 1;\n  if(*(char *)&test_value != 1)\n    return TRUE;\n  return FALSE;\n}\n\n\n/* Include inline routines for RGB565 conversion */\n\n#define PACK_SHORT_565 PACK_SHORT_565_LE\n#define PACK_TWO_PIXELS PACK_TWO_PIXELS_LE\n#define ycc_rgb565_convert_internal ycc_rgb565_convert_le\n#define ycc_rgb565D_convert_internal ycc_rgb565D_convert_le\n#define rgb_rgb565_convert_internal rgb_rgb565_convert_le\n#define rgb_rgb565D_convert_internal rgb_rgb565D_convert_le\n#define gray_rgb565_convert_internal gray_rgb565_convert_le\n#define gray_rgb565D_convert_internal gray_rgb565D_convert_le\n#include \"jdcol565.c\"\n#undef PACK_SHORT_565\n#undef PACK_TWO_PIXELS\n#undef ycc_rgb565_convert_internal\n#undef ycc_rgb565D_convert_internal\n#undef rgb_rgb565_convert_internal\n#undef rgb_rgb565D_convert_internal\n#undef gray_rgb565_convert_internal\n#undef gray_rgb565D_convert_internal\n\n#define PACK_SHORT_565 PACK_SHORT_565_BE\n#define PACK_TWO_PIXELS PACK_TWO_PIXELS_BE\n#define ycc_rgb565_convert_internal ycc_rgb565_convert_be\n#define ycc_rgb565D_convert_internal ycc_rgb565D_convert_be\n#define rgb_rgb565_convert_internal rgb_rgb565_convert_be\n#define rgb_rgb565D_convert_internal rgb_rgb565D_convert_be\n#define gray_rgb565_convert_internal gray_rgb565_convert_be\n#define gray_rgb565D_convert_internal gray_rgb565D_convert_be\n#include \"jdcol565.c\"\n#undef PACK_SHORT_565\n#undef PACK_TWO_PIXELS\n#undef ycc_rgb565_convert_internal\n#undef ycc_rgb565D_convert_internal\n#undef rgb_rgb565_convert_internal\n#undef rgb_rgb565D_convert_internal\n#undef gray_rgb565_convert_internal\n#undef gray_rgb565D_convert_internal\n\n\nMETHODDEF(void)\nycc_rgb565_convert (j_decompress_ptr cinfo,\n                    JSAMPIMAGE input_buf, JDIMENSION input_row,\n                    JSAMPARRAY output_buf, int num_rows)\n{\n  if (is_big_endian())\n    ycc_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);\n  else\n    ycc_rgb565_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);\n}\n\n\nMETHODDEF(void)\nycc_rgb565D_convert (j_decompress_ptr cinfo,\n                     JSAMPIMAGE input_buf, JDIMENSION input_row,\n                     JSAMPARRAY output_buf, int num_rows)\n{\n  if (is_big_endian())\n    ycc_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);\n  else\n    ycc_rgb565D_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);\n}\n\n\nMETHODDEF(void)\nrgb_rgb565_convert (j_decompress_ptr cinfo,\n                    JSAMPIMAGE input_buf, JDIMENSION input_row,\n                    JSAMPARRAY output_buf, int num_rows)\n{\n  if (is_big_endian())\n    rgb_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);\n  else\n    rgb_rgb565_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);\n}\n\n\nMETHODDEF(void)\nrgb_rgb565D_convert (j_decompress_ptr cinfo,\n                     JSAMPIMAGE input_buf, JDIMENSION input_row,\n                     JSAMPARRAY output_buf, int num_rows)\n{\n  if (is_big_endian())\n    rgb_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);\n  else\n    rgb_rgb565D_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);\n}\n\n\nMETHODDEF(void)\ngray_rgb565_convert (j_decompress_ptr cinfo,\n                     JSAMPIMAGE input_buf, JDIMENSION input_row,\n                     JSAMPARRAY output_buf, int num_rows)\n{\n  if (is_big_endian())\n    gray_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);\n  else\n    gray_rgb565_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);\n}\n\n\nMETHODDEF(void)\ngray_rgb565D_convert (j_decompress_ptr cinfo,\n                      JSAMPIMAGE input_buf, JDIMENSION input_row,\n                      JSAMPARRAY output_buf, int num_rows)\n{\n  if (is_big_endian())\n    gray_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);\n  else\n    gray_rgb565D_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);\n}\n\n\n/*\n * Empty method for start_pass.\n */\n\nMETHODDEF(void)\nstart_pass_dcolor (j_decompress_ptr cinfo)\n{\n  /* no work needed */\n}\n\n\n/*\n * Module initialization routine for output colorspace conversion.\n */\n\nGLOBAL(void)\njinit_color_deconverter (j_decompress_ptr cinfo)\n{\n  my_cconvert_ptr cconvert;\n  int ci;\n\n  cconvert = (my_cconvert_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_color_deconverter));\n  cinfo->cconvert = (struct jpeg_color_deconverter *) cconvert;\n  cconvert->pub.start_pass = start_pass_dcolor;\n\n  /* Make sure num_components agrees with jpeg_color_space */\n  switch (cinfo->jpeg_color_space) {\n  case JCS_GRAYSCALE:\n    if (cinfo->num_components != 1)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    break;\n\n  case JCS_RGB:\n  case JCS_YCbCr:\n    if (cinfo->num_components != 3)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    break;\n\n  case JCS_CMYK:\n  case JCS_YCCK:\n    if (cinfo->num_components != 4)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    break;\n\n  default:                      /* JCS_UNKNOWN can be anything */\n    if (cinfo->num_components < 1)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    break;\n  }\n\n  /* Set out_color_components and conversion method based on requested space.\n   * Also clear the component_needed flags for any unused components,\n   * so that earlier pipeline stages can avoid useless computation.\n   */\n\n  switch (cinfo->out_color_space) {\n  case JCS_GRAYSCALE:\n    cinfo->out_color_components = 1;\n    if (cinfo->jpeg_color_space == JCS_GRAYSCALE ||\n        cinfo->jpeg_color_space == JCS_YCbCr) {\n      cconvert->pub.color_convert = grayscale_convert;\n      /* For color->grayscale conversion, only the Y (0) component is needed */\n      for (ci = 1; ci < cinfo->num_components; ci++)\n        cinfo->comp_info[ci].component_needed = FALSE;\n    } else if (cinfo->jpeg_color_space == JCS_RGB) {\n      cconvert->pub.color_convert = rgb_gray_convert;\n      build_rgb_y_table(cinfo);\n    } else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  case JCS_RGB:\n  case JCS_EXT_RGB:\n  case JCS_EXT_RGBX:\n  case JCS_EXT_BGR:\n  case JCS_EXT_BGRX:\n  case JCS_EXT_XBGR:\n  case JCS_EXT_XRGB:\n  case JCS_EXT_RGBA:\n  case JCS_EXT_BGRA:\n  case JCS_EXT_ABGR:\n  case JCS_EXT_ARGB:\n    cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];\n    if (cinfo->jpeg_color_space == JCS_YCbCr) {\n      if (jsimd_can_ycc_rgb())\n        cconvert->pub.color_convert = jsimd_ycc_rgb_convert;\n      else {\n        cconvert->pub.color_convert = ycc_rgb_convert;\n        build_ycc_rgb_table(cinfo);\n      }\n    } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {\n      cconvert->pub.color_convert = gray_rgb_convert;\n    } else if (cinfo->jpeg_color_space == JCS_RGB) {\n      if (rgb_red[cinfo->out_color_space] == 0 &&\n          rgb_green[cinfo->out_color_space] == 1 &&\n          rgb_blue[cinfo->out_color_space] == 2 &&\n          rgb_pixelsize[cinfo->out_color_space] == 3)\n        cconvert->pub.color_convert = null_convert;\n      else\n        cconvert->pub.color_convert = rgb_rgb_convert;\n    } else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  case JCS_RGB565:\n    cinfo->out_color_components = 3;\n    if (cinfo->dither_mode == JDITHER_NONE) {\n      if (cinfo->jpeg_color_space == JCS_YCbCr) {\n         if (jsimd_can_ycc_rgb565())\n           cconvert->pub.color_convert = jsimd_ycc_rgb565_convert;\n         else {\n           cconvert->pub.color_convert = ycc_rgb565_convert;\n           build_ycc_rgb_table(cinfo);\n        }\n      } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {\n        cconvert->pub.color_convert = gray_rgb565_convert;\n      } else if (cinfo->jpeg_color_space == JCS_RGB) {\n        cconvert->pub.color_convert = rgb_rgb565_convert;\n      } else\n        ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    } else {\n      /* only ordered dithering is supported */\n      if (cinfo->jpeg_color_space == JCS_YCbCr) {\n        cconvert->pub.color_convert = ycc_rgb565D_convert;\n        build_ycc_rgb_table(cinfo);\n      } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {\n        cconvert->pub.color_convert = gray_rgb565D_convert;\n      } else if (cinfo->jpeg_color_space == JCS_RGB) {\n        cconvert->pub.color_convert = rgb_rgb565D_convert;\n      } else\n        ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    }\n    break;\n\n  case JCS_CMYK:\n    cinfo->out_color_components = 4;\n    if (cinfo->jpeg_color_space == JCS_YCCK) {\n      cconvert->pub.color_convert = ycck_cmyk_convert;\n      build_ycc_rgb_table(cinfo);\n    } else if (cinfo->jpeg_color_space == JCS_CMYK) {\n      cconvert->pub.color_convert = null_convert;\n    } else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  default:\n    /* Permit null conversion to same output space */\n    if (cinfo->out_color_space == cinfo->jpeg_color_space) {\n      cinfo->out_color_components = cinfo->num_components;\n      cconvert->pub.color_convert = null_convert;\n    } else                      /* unsupported non-null conversion */\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n  }\n\n  if (cinfo->quantize_colors)\n    cinfo->output_components = 1; /* single colormapped output component */\n  else\n    cinfo->output_components = cinfo->out_color_components;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdct.h",
    "content": "/*\n * jdct.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This include file contains common declarations for the forward and\n * inverse DCT modules.  These declarations are private to the DCT managers\n * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms.\n * The individual DCT algorithms are kept in separate files to ease\n * machine-dependent tuning (e.g., assembly coding).\n */\n\n\n/*\n * A forward DCT routine is given a pointer to a work area of type DCTELEM[];\n * the DCT is to be performed in-place in that buffer.  Type DCTELEM is int\n * for 8-bit samples, JLONG for 12-bit samples.  (NOTE: Floating-point DCT\n * implementations use an array of type FAST_FLOAT, instead.)\n * The DCT inputs are expected to be signed (range +-CENTERJSAMPLE).\n * The DCT outputs are returned scaled up by a factor of 8; they therefore\n * have a range of +-8K for 8-bit data, +-128K for 12-bit data.  This\n * convention improves accuracy in integer implementations and saves some\n * work in floating-point ones.\n * Quantization of the output coefficients is done by jcdctmgr.c. This\n * step requires an unsigned type and also one with twice the bits.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#ifndef WITH_SIMD\ntypedef int DCTELEM;            /* 16 or 32 bits is fine */\ntypedef unsigned int UDCTELEM;\ntypedef unsigned long long UDCTELEM2;\n#else\ntypedef short DCTELEM;  /* prefer 16 bit with SIMD for parellelism */\ntypedef unsigned short UDCTELEM;\ntypedef unsigned int UDCTELEM2;\n#endif\n#else\ntypedef JLONG DCTELEM;          /* must have 32 bits */\ntypedef unsigned long long UDCTELEM2;\n#endif\n\n\n/*\n * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer\n * to an output sample array.  The routine must dequantize the input data as\n * well as perform the IDCT; for dequantization, it uses the multiplier table\n * pointed to by compptr->dct_table.  The output data is to be placed into the\n * sample array starting at a specified column.  (Any row offset needed will\n * be applied to the array pointer before it is passed to the IDCT code.)\n * Note that the number of samples emitted by the IDCT routine is\n * DCT_scaled_size * DCT_scaled_size.\n */\n\n/* typedef inverse_DCT_method_ptr is declared in jpegint.h */\n\n/*\n * Each IDCT routine has its own ideas about the best dct_table element type.\n */\n\ntypedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */\n#if BITS_IN_JSAMPLE == 8\ntypedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */\n#define IFAST_SCALE_BITS  2     /* fractional bits in scale factors */\n#else\ntypedef JLONG IFAST_MULT_TYPE;  /* need 32 bits for scaled quantizers */\n#define IFAST_SCALE_BITS  13    /* fractional bits in scale factors */\n#endif\ntypedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */\n\n\n/*\n * Each IDCT routine is responsible for range-limiting its results and\n * converting them to unsigned form (0..MAXJSAMPLE).  The raw outputs could\n * be quite far out of range if the input data is corrupt, so a bulletproof\n * range-limiting step is required.  We use a mask-and-table-lookup method\n * to do the combined operations quickly.  See the comments with\n * prepare_range_limit_table (in jdmaster.c) for more info.\n */\n\n#define IDCT_range_limit(cinfo)  ((cinfo)->sample_range_limit + CENTERJSAMPLE)\n\n#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */\n\n\n/* Extern declarations for the forward and inverse DCT routines. */\n\nEXTERN(void) jpeg_fdct_islow (DCTELEM *data);\nEXTERN(void) jpeg_fdct_ifast (DCTELEM *data);\nEXTERN(void) jpeg_fdct_float (FAST_FLOAT *data);\n\nEXTERN(void) jpeg_idct_islow\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_ifast\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_float\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_7x7\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_6x6\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_5x5\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_4x4\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_3x3\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_2x2\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_1x1\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_9x9\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_10x10\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_11x11\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_12x12\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_13x13\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_14x14\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_15x15\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\nEXTERN(void) jpeg_idct_16x16\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col);\n\n\n/*\n * Macros for handling fixed-point arithmetic; these are used by many\n * but not all of the DCT/IDCT modules.\n *\n * All values are expected to be of type JLONG.\n * Fractional constants are scaled left by CONST_BITS bits.\n * CONST_BITS is defined within each module using these macros,\n * and may differ from one module to the next.\n */\n\n#define ONE     ((JLONG) 1)\n#define CONST_SCALE (ONE << CONST_BITS)\n\n/* Convert a positive real constant to an integer scaled by CONST_SCALE.\n * Caution: some C compilers fail to reduce \"FIX(constant)\" at compile time,\n * thus causing a lot of useless floating-point operations at run time.\n */\n\n#define FIX(x)  ((JLONG) ((x) * CONST_SCALE + 0.5))\n\n/* Descale and correctly round a JLONG value that's scaled by N bits.\n * We assume RIGHT_SHIFT rounds towards minus infinity, so adding\n * the fudge factor is correct for either sign of X.\n */\n\n#define DESCALE(x,n)  RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)\n\n/* Multiply a JLONG variable by a JLONG constant to yield a JLONG result.\n * This macro is used only when the two inputs will actually be no more than\n * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a\n * full 32x32 multiply.  This provides a useful speedup on many machines.\n * Unfortunately there is no way to specify a 16x16->32 multiply portably\n * in C, but some C compilers will do the right thing if you provide the\n * correct combination of casts.\n */\n\n#ifdef SHORTxSHORT_32           /* may work if 'int' is 32 bits */\n#define MULTIPLY16C16(var,const)  (((INT16) (var)) * ((INT16) (const)))\n#endif\n#ifdef SHORTxLCONST_32          /* known to work with Microsoft C 6.0 */\n#define MULTIPLY16C16(var,const)  (((INT16) (var)) * ((JLONG) (const)))\n#endif\n\n#ifndef MULTIPLY16C16           /* default definition */\n#define MULTIPLY16C16(var,const)  ((var) * (const))\n#endif\n\n/* Same except both inputs are variables. */\n\n#ifdef SHORTxSHORT_32           /* may work if 'int' is 32 bits */\n#define MULTIPLY16V16(var1,var2)  (((INT16) (var1)) * ((INT16) (var2)))\n#endif\n\n#ifndef MULTIPLY16V16           /* default definition */\n#define MULTIPLY16V16(var1,var2)  ((var1) * (var2))\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jddctmgr.c",
    "content": "/*\n * jddctmgr.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2002-2010 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2010, 2015, D. R. Commander.\n * Copyright (C) 2013, MIPS Technologies, Inc., California.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains the inverse-DCT management logic.\n * This code selects a particular IDCT implementation to be used,\n * and it performs related housekeeping chores.  No code in this file\n * is executed per IDCT step, only during output pass setup.\n *\n * Note that the IDCT routines are responsible for performing coefficient\n * dequantization as well as the IDCT proper.  This module sets up the\n * dequantization multiplier table needed by the IDCT routine.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"               /* Private declarations for DCT subsystem */\n#include \"jsimddct.h\"\n#include \"jpegcomp.h\"\n\n\n/*\n * The decompressor input side (jdinput.c) saves away the appropriate\n * quantization table for each component at the start of the first scan\n * involving that component.  (This is necessary in order to correctly\n * decode files that reuse Q-table slots.)\n * When we are ready to make an output pass, the saved Q-table is converted\n * to a multiplier table that will actually be used by the IDCT routine.\n * The multiplier table contents are IDCT-method-dependent.  To support\n * application changes in IDCT method between scans, we can remake the\n * multiplier tables if necessary.\n * In buffered-image mode, the first output pass may occur before any data\n * has been seen for some components, and thus before their Q-tables have\n * been saved away.  To handle this case, multiplier tables are preset\n * to zeroes; the result of the IDCT will be a neutral gray level.\n */\n\n\n/* Private subobject for this module */\n\ntypedef struct {\n  struct jpeg_inverse_dct pub;  /* public fields */\n\n  /* This array contains the IDCT method code that each multiplier table\n   * is currently set up for, or -1 if it's not yet set up.\n   * The actual multiplier tables are pointed to by dct_table in the\n   * per-component comp_info structures.\n   */\n  int cur_method[MAX_COMPONENTS];\n} my_idct_controller;\n\ntypedef my_idct_controller *my_idct_ptr;\n\n\n/* Allocated multiplier tables: big enough for any supported variant */\n\ntypedef union {\n  ISLOW_MULT_TYPE islow_array[DCTSIZE2];\n#ifdef DCT_IFAST_SUPPORTED\n  IFAST_MULT_TYPE ifast_array[DCTSIZE2];\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n  FLOAT_MULT_TYPE float_array[DCTSIZE2];\n#endif\n} multiplier_table;\n\n\n/* The current scaled-IDCT routines require ISLOW-style multiplier tables,\n * so be sure to compile that code if either ISLOW or SCALING is requested.\n */\n#ifdef DCT_ISLOW_SUPPORTED\n#define PROVIDE_ISLOW_TABLES\n#else\n#ifdef IDCT_SCALING_SUPPORTED\n#define PROVIDE_ISLOW_TABLES\n#endif\n#endif\n\n\n/*\n * Prepare for an output pass.\n * Here we select the proper IDCT routine for each component and build\n * a matching multiplier table.\n */\n\nMETHODDEF(void)\nstart_pass (j_decompress_ptr cinfo)\n{\n  my_idct_ptr idct = (my_idct_ptr) cinfo->idct;\n  int ci, i;\n  jpeg_component_info *compptr;\n  int method = 0;\n  inverse_DCT_method_ptr method_ptr = NULL;\n  JQUANT_TBL *qtbl;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Select the proper IDCT routine for this component's scaling */\n    switch (compptr->_DCT_scaled_size) {\n#ifdef IDCT_SCALING_SUPPORTED\n    case 1:\n      method_ptr = jpeg_idct_1x1;\n      method = JDCT_ISLOW;      /* jidctred uses islow-style table */\n      break;\n    case 2:\n      if (jsimd_can_idct_2x2())\n        method_ptr = jsimd_idct_2x2;\n      else\n        method_ptr = jpeg_idct_2x2;\n      method = JDCT_ISLOW;      /* jidctred uses islow-style table */\n      break;\n    case 3:\n      method_ptr = jpeg_idct_3x3;\n      method = JDCT_ISLOW;      /* jidctint uses islow-style table */\n      break;\n    case 4:\n      if (jsimd_can_idct_4x4())\n        method_ptr = jsimd_idct_4x4;\n      else\n        method_ptr = jpeg_idct_4x4;\n      method = JDCT_ISLOW;      /* jidctred uses islow-style table */\n      break;\n    case 5:\n      method_ptr = jpeg_idct_5x5;\n      method = JDCT_ISLOW;      /* jidctint uses islow-style table */\n      break;\n    case 6:\n#if defined(__mips__)\n      if (jsimd_can_idct_6x6())\n        method_ptr = jsimd_idct_6x6;\n      else\n#endif\n      method_ptr = jpeg_idct_6x6;\n      method = JDCT_ISLOW;      /* jidctint uses islow-style table */\n      break;\n    case 7:\n      method_ptr = jpeg_idct_7x7;\n      method = JDCT_ISLOW;      /* jidctint uses islow-style table */\n      break;\n#endif\n    case DCTSIZE:\n      switch (cinfo->dct_method) {\n#ifdef DCT_ISLOW_SUPPORTED\n      case JDCT_ISLOW:\n        if (jsimd_can_idct_islow())\n          method_ptr = jsimd_idct_islow;\n        else\n          method_ptr = jpeg_idct_islow;\n        method = JDCT_ISLOW;\n        break;\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n      case JDCT_IFAST:\n        if (jsimd_can_idct_ifast())\n          method_ptr = jsimd_idct_ifast;\n        else\n          method_ptr = jpeg_idct_ifast;\n        method = JDCT_IFAST;\n        break;\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n      case JDCT_FLOAT:\n        if (jsimd_can_idct_float())\n          method_ptr = jsimd_idct_float;\n        else\n          method_ptr = jpeg_idct_float;\n        method = JDCT_FLOAT;\n        break;\n#endif\n      default:\n        ERREXIT(cinfo, JERR_NOT_COMPILED);\n        break;\n      }\n      break;\n#ifdef IDCT_SCALING_SUPPORTED\n    case 9:\n      method_ptr = jpeg_idct_9x9;\n      method = JDCT_ISLOW;      /* jidctint uses islow-style table */\n      break;\n    case 10:\n      method_ptr = jpeg_idct_10x10;\n      method = JDCT_ISLOW;      /* jidctint uses islow-style table */\n      break;\n    case 11:\n      method_ptr = jpeg_idct_11x11;\n      method = JDCT_ISLOW;      /* jidctint uses islow-style table */\n      break;\n    case 12:\n#if defined(__mips__)\n      if (jsimd_can_idct_12x12())\n        method_ptr = jsimd_idct_12x12;\n      else\n#endif\n      method_ptr = jpeg_idct_12x12;\n      method = JDCT_ISLOW;      /* jidctint uses islow-style table */\n      break;\n    case 13:\n      method_ptr = jpeg_idct_13x13;\n      method = JDCT_ISLOW;      /* jidctint uses islow-style table */\n      break;\n    case 14:\n      method_ptr = jpeg_idct_14x14;\n      method = JDCT_ISLOW;      /* jidctint uses islow-style table */\n      break;\n    case 15:\n      method_ptr = jpeg_idct_15x15;\n      method = JDCT_ISLOW;      /* jidctint uses islow-style table */\n      break;\n    case 16:\n      method_ptr = jpeg_idct_16x16;\n      method = JDCT_ISLOW;      /* jidctint uses islow-style table */\n      break;\n#endif\n    default:\n      ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->_DCT_scaled_size);\n      break;\n    }\n    idct->pub.inverse_DCT[ci] = method_ptr;\n    /* Create multiplier table from quant table.\n     * However, we can skip this if the component is uninteresting\n     * or if we already built the table.  Also, if no quant table\n     * has yet been saved for the component, we leave the\n     * multiplier table all-zero; we'll be reading zeroes from the\n     * coefficient controller's buffer anyway.\n     */\n    if (! compptr->component_needed || idct->cur_method[ci] == method)\n      continue;\n    qtbl = compptr->quant_table;\n    if (qtbl == NULL)           /* happens if no data yet for component */\n      continue;\n    idct->cur_method[ci] = method;\n    switch (method) {\n#ifdef PROVIDE_ISLOW_TABLES\n    case JDCT_ISLOW:\n      {\n        /* For LL&M IDCT method, multipliers are equal to raw quantization\n         * coefficients, but are stored as ints to ensure access efficiency.\n         */\n        ISLOW_MULT_TYPE *ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table;\n        for (i = 0; i < DCTSIZE2; i++) {\n          ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i];\n        }\n      }\n      break;\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n    case JDCT_IFAST:\n      {\n        /* For AA&N IDCT method, multipliers are equal to quantization\n         * coefficients scaled by scalefactor[row]*scalefactor[col], where\n         *   scalefactor[0] = 1\n         *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7\n         * For integer operation, the multiplier table is to be scaled by\n         * IFAST_SCALE_BITS.\n         */\n        IFAST_MULT_TYPE *ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table;\n#define CONST_BITS 14\n        static const INT16 aanscales[DCTSIZE2] = {\n          /* precomputed values scaled up by 14 bits */\n          16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,\n          22725, 31521, 29692, 26722, 22725, 17855, 12299,  6270,\n          21407, 29692, 27969, 25172, 21407, 16819, 11585,  5906,\n          19266, 26722, 25172, 22654, 19266, 15137, 10426,  5315,\n          16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,\n          12873, 17855, 16819, 15137, 12873, 10114,  6967,  3552,\n           8867, 12299, 11585, 10426,  8867,  6967,  4799,  2446,\n           4520,  6270,  5906,  5315,  4520,  3552,  2446,  1247\n        };\n        SHIFT_TEMPS\n\n        for (i = 0; i < DCTSIZE2; i++) {\n          ifmtbl[i] = (IFAST_MULT_TYPE)\n            DESCALE(MULTIPLY16V16((JLONG) qtbl->quantval[i],\n                                  (JLONG) aanscales[i]),\n                    CONST_BITS-IFAST_SCALE_BITS);\n        }\n      }\n      break;\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n    case JDCT_FLOAT:\n      {\n        /* For float AA&N IDCT method, multipliers are equal to quantization\n         * coefficients scaled by scalefactor[row]*scalefactor[col], where\n         *   scalefactor[0] = 1\n         *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7\n         */\n        FLOAT_MULT_TYPE *fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table;\n        int row, col;\n        static const double aanscalefactor[DCTSIZE] = {\n          1.0, 1.387039845, 1.306562965, 1.175875602,\n          1.0, 0.785694958, 0.541196100, 0.275899379\n        };\n\n        i = 0;\n        for (row = 0; row < DCTSIZE; row++) {\n          for (col = 0; col < DCTSIZE; col++) {\n            fmtbl[i] = (FLOAT_MULT_TYPE)\n              ((double) qtbl->quantval[i] *\n               aanscalefactor[row] * aanscalefactor[col]);\n            i++;\n          }\n        }\n      }\n      break;\n#endif\n    default:\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n      break;\n    }\n  }\n}\n\n\n/*\n * Initialize IDCT manager.\n */\n\nGLOBAL(void)\njinit_inverse_dct (j_decompress_ptr cinfo)\n{\n  my_idct_ptr idct;\n  int ci;\n  jpeg_component_info *compptr;\n\n  idct = (my_idct_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_idct_controller));\n  cinfo->idct = (struct jpeg_inverse_dct *) idct;\n  idct->pub.start_pass = start_pass;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Allocate and pre-zero a multiplier table for each component */\n    compptr->dct_table =\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(multiplier_table));\n    MEMZERO(compptr->dct_table, sizeof(multiplier_table));\n    /* Mark multiplier table not yet set up for any method */\n    idct->cur_method[ci] = -1;\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdhuff.c",
    "content": "/*\n * jdhuff.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009-2011, 2016, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains Huffman entropy decoding routines.\n *\n * Much of the complexity here has to do with supporting input suspension.\n * If the data source module demands suspension, we want to be able to back\n * up to the start of the current MCU.  To do this, we copy state variables\n * into local working storage, and update them back to the permanent\n * storage only upon successful completion of an MCU.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdhuff.h\"             /* Declarations shared with jdphuff.c */\n#include \"jpegcomp.h\"\n#include \"jstdhuff.c\"\n\n\n/*\n * Expanded entropy decoder object for Huffman decoding.\n *\n * The savable_state subrecord contains fields that change within an MCU,\n * but must not be updated permanently until we complete the MCU.\n */\n\ntypedef struct {\n  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */\n} savable_state;\n\n/* This macro is to work around compilers with missing or broken\n * structure assignment.  You'll need to fix this code if you have\n * such a compiler and you change MAX_COMPS_IN_SCAN.\n */\n\n#ifndef NO_STRUCT_ASSIGN\n#define ASSIGN_STATE(dest,src)  ((dest) = (src))\n#else\n#if MAX_COMPS_IN_SCAN == 4\n#define ASSIGN_STATE(dest,src)  \\\n        ((dest).last_dc_val[0] = (src).last_dc_val[0], \\\n         (dest).last_dc_val[1] = (src).last_dc_val[1], \\\n         (dest).last_dc_val[2] = (src).last_dc_val[2], \\\n         (dest).last_dc_val[3] = (src).last_dc_val[3])\n#endif\n#endif\n\n\ntypedef struct {\n  struct jpeg_entropy_decoder pub; /* public fields */\n\n  /* These fields are loaded into local variables at start of each MCU.\n   * In case of suspension, we exit WITHOUT updating them.\n   */\n  bitread_perm_state bitstate;  /* Bit buffer at start of MCU */\n  savable_state saved;          /* Other state at start of MCU */\n\n  /* These fields are NOT loaded into local working state. */\n  unsigned int restarts_to_go;  /* MCUs left in this restart interval */\n\n  /* Pointers to derived tables (these workspaces have image lifespan) */\n  d_derived_tbl *dc_derived_tbls[NUM_HUFF_TBLS];\n  d_derived_tbl *ac_derived_tbls[NUM_HUFF_TBLS];\n\n  /* Precalculated info set up by start_pass for use in decode_mcu: */\n\n  /* Pointers to derived tables to be used for each block within an MCU */\n  d_derived_tbl *dc_cur_tbls[D_MAX_BLOCKS_IN_MCU];\n  d_derived_tbl *ac_cur_tbls[D_MAX_BLOCKS_IN_MCU];\n  /* Whether we care about the DC and AC coefficient values for each block */\n  boolean dc_needed[D_MAX_BLOCKS_IN_MCU];\n  boolean ac_needed[D_MAX_BLOCKS_IN_MCU];\n} huff_entropy_decoder;\n\ntypedef huff_entropy_decoder *huff_entropy_ptr;\n\n\n/*\n * Initialize for a Huffman-compressed scan.\n */\n\nMETHODDEF(void)\nstart_pass_huff_decoder (j_decompress_ptr cinfo)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int ci, blkn, dctbl, actbl;\n  d_derived_tbl **pdtbl;\n  jpeg_component_info *compptr;\n\n  /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.\n   * This ought to be an error condition, but we make it a warning because\n   * there are some baseline files out there with all zeroes in these bytes.\n   */\n  if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2-1 ||\n      cinfo->Ah != 0 || cinfo->Al != 0)\n    WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);\n\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    dctbl = compptr->dc_tbl_no;\n    actbl = compptr->ac_tbl_no;\n    /* Compute derived values for Huffman tables */\n    /* We may do this more than once for a table, but it's not expensive */\n    pdtbl = entropy->dc_derived_tbls + dctbl;\n    jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl, pdtbl);\n    pdtbl = entropy->ac_derived_tbls + actbl;\n    jpeg_make_d_derived_tbl(cinfo, FALSE, actbl, pdtbl);\n    /* Initialize DC predictions to 0 */\n    entropy->saved.last_dc_val[ci] = 0;\n  }\n\n  /* Precalculate decoding info for each block in an MCU of this scan */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    ci = cinfo->MCU_membership[blkn];\n    compptr = cinfo->cur_comp_info[ci];\n    /* Precalculate which table to use for each block */\n    entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];\n    entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no];\n    /* Decide whether we really care about the coefficient values */\n    if (compptr->component_needed) {\n      entropy->dc_needed[blkn] = TRUE;\n      /* we don't need the ACs if producing a 1/8th-size image */\n      entropy->ac_needed[blkn] = (compptr->_DCT_scaled_size > 1);\n    } else {\n      entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = FALSE;\n    }\n  }\n\n  /* Initialize bitread state variables */\n  entropy->bitstate.bits_left = 0;\n  entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */\n  entropy->pub.insufficient_data = FALSE;\n\n  /* Initialize restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n}\n\n\n/*\n * Compute the derived values for a Huffman table.\n * This routine also performs some validation checks on the table.\n *\n * Note this is also used by jdphuff.c.\n */\n\nGLOBAL(void)\njpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,\n                         d_derived_tbl **pdtbl)\n{\n  JHUFF_TBL *htbl;\n  d_derived_tbl *dtbl;\n  int p, i, l, si, numsymbols;\n  int lookbits, ctr;\n  char huffsize[257];\n  unsigned int huffcode[257];\n  unsigned int code;\n\n  /* Note that huffsize[] and huffcode[] are filled in code-length order,\n   * paralleling the order of the symbols themselves in htbl->huffval[].\n   */\n\n  /* Find the input Huffman table */\n  if (tblno < 0 || tblno >= NUM_HUFF_TBLS)\n    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);\n  htbl =\n    isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];\n  if (htbl == NULL)\n    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);\n\n  /* Allocate a workspace if we haven't already done so. */\n  if (*pdtbl == NULL)\n    *pdtbl = (d_derived_tbl *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(d_derived_tbl));\n  dtbl = *pdtbl;\n  dtbl->pub = htbl;             /* fill in back link */\n\n  /* Figure C.1: make table of Huffman code length for each symbol */\n\n  p = 0;\n  for (l = 1; l <= 16; l++) {\n    i = (int) htbl->bits[l];\n    if (i < 0 || p + i > 256)   /* protect against table overrun */\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    while (i--)\n      huffsize[p++] = (char) l;\n  }\n  huffsize[p] = 0;\n  numsymbols = p;\n\n  /* Figure C.2: generate the codes themselves */\n  /* We also validate that the counts represent a legal Huffman code tree. */\n\n  code = 0;\n  si = huffsize[0];\n  p = 0;\n  while (huffsize[p]) {\n    while (((int) huffsize[p]) == si) {\n      huffcode[p++] = code;\n      code++;\n    }\n    /* code is now 1 more than the last code used for codelength si; but\n     * it must still fit in si bits, since no code is allowed to be all ones.\n     */\n    if (((JLONG) code) >= (((JLONG) 1) << si))\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    code <<= 1;\n    si++;\n  }\n\n  /* Figure F.15: generate decoding tables for bit-sequential decoding */\n\n  p = 0;\n  for (l = 1; l <= 16; l++) {\n    if (htbl->bits[l]) {\n      /* valoffset[l] = huffval[] index of 1st symbol of code length l,\n       * minus the minimum code of length l\n       */\n      dtbl->valoffset[l] = (JLONG) p - (JLONG) huffcode[p];\n      p += htbl->bits[l];\n      dtbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */\n    } else {\n      dtbl->maxcode[l] = -1;    /* -1 if no codes of this length */\n    }\n  }\n  dtbl->valoffset[17] = 0;\n  dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */\n\n  /* Compute lookahead tables to speed up decoding.\n   * First we set all the table entries to 0, indicating \"too long\";\n   * then we iterate through the Huffman codes that are short enough and\n   * fill in all the entries that correspond to bit sequences starting\n   * with that code.\n   */\n\n   for (i = 0; i < (1 << HUFF_LOOKAHEAD); i++)\n     dtbl->lookup[i] = (HUFF_LOOKAHEAD + 1) << HUFF_LOOKAHEAD;\n\n  p = 0;\n  for (l = 1; l <= HUFF_LOOKAHEAD; l++) {\n    for (i = 1; i <= (int) htbl->bits[l]; i++, p++) {\n      /* l = current code's length, p = its index in huffcode[] & huffval[]. */\n      /* Generate left-justified code followed by all possible bit sequences */\n      lookbits = huffcode[p] << (HUFF_LOOKAHEAD-l);\n      for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) {\n        dtbl->lookup[lookbits] = (l << HUFF_LOOKAHEAD) | htbl->huffval[p];\n        lookbits++;\n      }\n    }\n  }\n\n  /* Validate symbols as being reasonable.\n   * For AC tables, we make no check, but accept all byte values 0..255.\n   * For DC tables, we require the symbols to be in range 0..15.\n   * (Tighter bounds could be applied depending on the data depth and mode,\n   * but this is sufficient to ensure safe decoding.)\n   */\n  if (isDC) {\n    for (i = 0; i < numsymbols; i++) {\n      int sym = htbl->huffval[i];\n      if (sym < 0 || sym > 15)\n        ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    }\n  }\n}\n\n\n/*\n * Out-of-line code for bit fetching (shared with jdphuff.c).\n * See jdhuff.h for info about usage.\n * Note: current values of get_buffer and bits_left are passed as parameters,\n * but are returned in the corresponding fields of the state struct.\n *\n * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width\n * of get_buffer to be used.  (On machines with wider words, an even larger\n * buffer could be used.)  However, on some machines 32-bit shifts are\n * quite slow and take time proportional to the number of places shifted.\n * (This is true with most PC compilers, for instance.)  In this case it may\n * be a win to set MIN_GET_BITS to the minimum value of 15.  This reduces the\n * average shift distance at the cost of more calls to jpeg_fill_bit_buffer.\n */\n\n#ifdef SLOW_SHIFT_32\n#define MIN_GET_BITS  15        /* minimum allowable value */\n#else\n#define MIN_GET_BITS  (BIT_BUF_SIZE-7)\n#endif\n\n\nGLOBAL(boolean)\njpeg_fill_bit_buffer (bitread_working_state *state,\n                      register bit_buf_type get_buffer, register int bits_left,\n                      int nbits)\n/* Load up the bit buffer to a depth of at least nbits */\n{\n  /* Copy heavily used state fields into locals (hopefully registers) */\n  register const JOCTET *next_input_byte = state->next_input_byte;\n  register size_t bytes_in_buffer = state->bytes_in_buffer;\n  j_decompress_ptr cinfo = state->cinfo;\n\n  /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */\n  /* (It is assumed that no request will be for more than that many bits.) */\n  /* We fail to do so only if we hit a marker or are forced to suspend. */\n\n  if (cinfo->unread_marker == 0) {      /* cannot advance past a marker */\n    while (bits_left < MIN_GET_BITS) {\n      register int c;\n\n      /* Attempt to read a byte */\n      if (bytes_in_buffer == 0) {\n        if (! (*cinfo->src->fill_input_buffer) (cinfo))\n          return FALSE;\n        next_input_byte = cinfo->src->next_input_byte;\n        bytes_in_buffer = cinfo->src->bytes_in_buffer;\n      }\n      bytes_in_buffer--;\n      c = GETJOCTET(*next_input_byte++);\n\n      /* If it's 0xFF, check and discard stuffed zero byte */\n      if (c == 0xFF) {\n        /* Loop here to discard any padding FF's on terminating marker,\n         * so that we can save a valid unread_marker value.  NOTE: we will\n         * accept multiple FF's followed by a 0 as meaning a single FF data\n         * byte.  This data pattern is not valid according to the standard.\n         */\n        do {\n          if (bytes_in_buffer == 0) {\n            if (! (*cinfo->src->fill_input_buffer) (cinfo))\n              return FALSE;\n            next_input_byte = cinfo->src->next_input_byte;\n            bytes_in_buffer = cinfo->src->bytes_in_buffer;\n          }\n          bytes_in_buffer--;\n          c = GETJOCTET(*next_input_byte++);\n        } while (c == 0xFF);\n\n        if (c == 0) {\n          /* Found FF/00, which represents an FF data byte */\n          c = 0xFF;\n        } else {\n          /* Oops, it's actually a marker indicating end of compressed data.\n           * Save the marker code for later use.\n           * Fine point: it might appear that we should save the marker into\n           * bitread working state, not straight into permanent state.  But\n           * once we have hit a marker, we cannot need to suspend within the\n           * current MCU, because we will read no more bytes from the data\n           * source.  So it is OK to update permanent state right away.\n           */\n          cinfo->unread_marker = c;\n          /* See if we need to insert some fake zero bits. */\n          goto no_more_bytes;\n        }\n      }\n\n      /* OK, load c into get_buffer */\n      get_buffer = (get_buffer << 8) | c;\n      bits_left += 8;\n    } /* end while */\n  } else {\n  no_more_bytes:\n    /* We get here if we've read the marker that terminates the compressed\n     * data segment.  There should be enough bits in the buffer register\n     * to satisfy the request; if so, no problem.\n     */\n    if (nbits > bits_left) {\n      /* Uh-oh.  Report corrupted data to user and stuff zeroes into\n       * the data stream, so that we can produce some kind of image.\n       * We use a nonvolatile flag to ensure that only one warning message\n       * appears per data segment.\n       */\n      if (! cinfo->entropy->insufficient_data) {\n        WARNMS(cinfo, JWRN_HIT_MARKER);\n        cinfo->entropy->insufficient_data = TRUE;\n      }\n      /* Fill the buffer with zero bits */\n      get_buffer <<= MIN_GET_BITS - bits_left;\n      bits_left = MIN_GET_BITS;\n    }\n  }\n\n  /* Unload the local registers */\n  state->next_input_byte = next_input_byte;\n  state->bytes_in_buffer = bytes_in_buffer;\n  state->get_buffer = get_buffer;\n  state->bits_left = bits_left;\n\n  return TRUE;\n}\n\n\n/* Macro version of the above, which performs much better but does not\n   handle markers.  We have to hand off any blocks with markers to the\n   slower routines. */\n\n#define GET_BYTE \\\n{ \\\n  register int c0, c1; \\\n  c0 = GETJOCTET(*buffer++); \\\n  c1 = GETJOCTET(*buffer); \\\n  /* Pre-execute most common case */ \\\n  get_buffer = (get_buffer << 8) | c0; \\\n  bits_left += 8; \\\n  if (c0 == 0xFF) { \\\n    /* Pre-execute case of FF/00, which represents an FF data byte */ \\\n    buffer++; \\\n    if (c1 != 0) { \\\n      /* Oops, it's actually a marker indicating end of compressed data. */ \\\n      cinfo->unread_marker = c1; \\\n      /* Back out pre-execution and fill the buffer with zero bits */ \\\n      buffer -= 2; \\\n      get_buffer &= ~0xFF; \\\n    } \\\n  } \\\n}\n\n#if SIZEOF_SIZE_T==8 || defined(_WIN64)\n\n/* Pre-fetch 48 bytes, because the holding register is 64-bit */\n#define FILL_BIT_BUFFER_FAST \\\n  if (bits_left <= 16) { \\\n    GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \\\n  }\n\n#else\n\n/* Pre-fetch 16 bytes, because the holding register is 32-bit */\n#define FILL_BIT_BUFFER_FAST \\\n  if (bits_left <= 16) { \\\n    GET_BYTE GET_BYTE \\\n  }\n\n#endif\n\n\n/*\n * Out-of-line code for Huffman code decoding.\n * See jdhuff.h for info about usage.\n */\n\nGLOBAL(int)\njpeg_huff_decode (bitread_working_state *state,\n                  register bit_buf_type get_buffer, register int bits_left,\n                  d_derived_tbl *htbl, int min_bits)\n{\n  register int l = min_bits;\n  register JLONG code;\n\n  /* HUFF_DECODE has determined that the code is at least min_bits */\n  /* bits long, so fetch that many bits in one swoop. */\n\n  CHECK_BIT_BUFFER(*state, l, return -1);\n  code = GET_BITS(l);\n\n  /* Collect the rest of the Huffman code one bit at a time. */\n  /* This is per Figure F.16 in the JPEG spec. */\n\n  while (code > htbl->maxcode[l]) {\n    code <<= 1;\n    CHECK_BIT_BUFFER(*state, 1, return -1);\n    code |= GET_BITS(1);\n    l++;\n  }\n\n  /* Unload the local registers */\n  state->get_buffer = get_buffer;\n  state->bits_left = bits_left;\n\n  /* With garbage input we may reach the sentinel value l = 17. */\n\n  if (l > 16) {\n    WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE);\n    return 0;                   /* fake a zero as the safest result */\n  }\n\n  return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ];\n}\n\n\n/*\n * Figure F.12: extend sign bit.\n * On some machines, a shift and add will be faster than a table lookup.\n */\n\n#define AVOID_TABLES\n#ifdef AVOID_TABLES\n\n#define NEG_1 ((unsigned int)-1)\n#define HUFF_EXTEND(x,s)  ((x) + ((((x) - (1<<((s)-1))) >> 31) & (((NEG_1)<<(s)) + 1)))\n\n#else\n\n#define HUFF_EXTEND(x,s)  ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))\n\nstatic const int extend_test[16] =   /* entry n is 2**(n-1) */\n  { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,\n    0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };\n\nstatic const int extend_offset[16] = /* entry n is (-1 << n) + 1 */\n  { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,\n    ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,\n    ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,\n    ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };\n\n#endif /* AVOID_TABLES */\n\n\n/*\n * Check for a restart marker & resynchronize decoder.\n * Returns FALSE if must suspend.\n */\n\nLOCAL(boolean)\nprocess_restart (j_decompress_ptr cinfo)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int ci;\n\n  /* Throw away any unused bits remaining in bit buffer; */\n  /* include any full bytes in next_marker's count of discarded bytes */\n  cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;\n  entropy->bitstate.bits_left = 0;\n\n  /* Advance past the RSTn marker */\n  if (! (*cinfo->marker->read_restart_marker) (cinfo))\n    return FALSE;\n\n  /* Re-initialize DC predictions to 0 */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++)\n    entropy->saved.last_dc_val[ci] = 0;\n\n  /* Reset restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n\n  /* Reset out-of-data flag, unless read_restart_marker left us smack up\n   * against a marker.  In that case we will end up treating the next data\n   * segment as empty, and we can avoid producing bogus output pixels by\n   * leaving the flag set.\n   */\n  if (cinfo->unread_marker == 0)\n    entropy->pub.insufficient_data = FALSE;\n\n  return TRUE;\n}\n\n\nLOCAL(boolean)\ndecode_mcu_slow (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  BITREAD_STATE_VARS;\n  int blkn;\n  savable_state state;\n  /* Outer loop handles each block in the MCU */\n\n  /* Load up working state */\n  BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n  ASSIGN_STATE(state, entropy->saved);\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    JBLOCKROW block = MCU_data ? MCU_data[blkn] : NULL;\n    d_derived_tbl *dctbl = entropy->dc_cur_tbls[blkn];\n    d_derived_tbl *actbl = entropy->ac_cur_tbls[blkn];\n    register int s, k, r;\n\n    /* Decode a single block's worth of coefficients */\n\n    /* Section F.2.2.1: decode the DC coefficient difference */\n    HUFF_DECODE(s, br_state, dctbl, return FALSE, label1);\n    if (s) {\n      CHECK_BIT_BUFFER(br_state, s, return FALSE);\n      r = GET_BITS(s);\n      s = HUFF_EXTEND(r, s);\n    }\n\n    if (entropy->dc_needed[blkn]) {\n      /* Convert DC difference to actual value, update last_dc_val */\n      int ci = cinfo->MCU_membership[blkn];\n      s += state.last_dc_val[ci];\n      state.last_dc_val[ci] = s;\n      if (block) {\n        /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */\n        (*block)[0] = (JCOEF) s;\n      }\n    }\n\n    if (entropy->ac_needed[blkn] && block) {\n\n      /* Section F.2.2.2: decode the AC coefficients */\n      /* Since zeroes are skipped, output area must be cleared beforehand */\n      for (k = 1; k < DCTSIZE2; k++) {\n        HUFF_DECODE(s, br_state, actbl, return FALSE, label2);\n\n        r = s >> 4;\n        s &= 15;\n\n        if (s) {\n          k += r;\n          CHECK_BIT_BUFFER(br_state, s, return FALSE);\n          r = GET_BITS(s);\n          s = HUFF_EXTEND(r, s);\n          /* Output coefficient in natural (dezigzagged) order.\n           * Note: the extra entries in jpeg_natural_order[] will save us\n           * if k >= DCTSIZE2, which could happen if the data is corrupted.\n           */\n          (*block)[jpeg_natural_order[k]] = (JCOEF) s;\n        } else {\n          if (r != 15)\n            break;\n          k += 15;\n        }\n      }\n\n    } else {\n\n      /* Section F.2.2.2: decode the AC coefficients */\n      /* In this path we just discard the values */\n      for (k = 1; k < DCTSIZE2; k++) {\n        HUFF_DECODE(s, br_state, actbl, return FALSE, label3);\n\n        r = s >> 4;\n        s &= 15;\n\n        if (s) {\n          k += r;\n          CHECK_BIT_BUFFER(br_state, s, return FALSE);\n          DROP_BITS(s);\n        } else {\n          if (r != 15)\n            break;\n          k += 15;\n        }\n      }\n    }\n  }\n\n  /* Completed MCU, so update state */\n  BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n  ASSIGN_STATE(entropy->saved, state);\n  return TRUE;\n}\n\n\nLOCAL(boolean)\ndecode_mcu_fast (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  BITREAD_STATE_VARS;\n  JOCTET *buffer;\n  int blkn;\n  savable_state state;\n  /* Outer loop handles each block in the MCU */\n\n  /* Load up working state */\n  BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n  buffer = (JOCTET *) br_state.next_input_byte;\n  ASSIGN_STATE(state, entropy->saved);\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    JBLOCKROW block = MCU_data ? MCU_data[blkn] : NULL;\n    d_derived_tbl *dctbl = entropy->dc_cur_tbls[blkn];\n    d_derived_tbl *actbl = entropy->ac_cur_tbls[blkn];\n    register int s, k, r, l;\n\n    HUFF_DECODE_FAST(s, l, dctbl);\n    if (s) {\n      FILL_BIT_BUFFER_FAST\n      r = GET_BITS(s);\n      s = HUFF_EXTEND(r, s);\n    }\n\n    if (entropy->dc_needed[blkn]) {\n      int ci = cinfo->MCU_membership[blkn];\n      s += state.last_dc_val[ci];\n      state.last_dc_val[ci] = s;\n      if (block)\n        (*block)[0] = (JCOEF) s;\n    }\n\n    if (entropy->ac_needed[blkn] && block) {\n\n      for (k = 1; k < DCTSIZE2; k++) {\n        HUFF_DECODE_FAST(s, l, actbl);\n        r = s >> 4;\n        s &= 15;\n\n        if (s) {\n          k += r;\n          FILL_BIT_BUFFER_FAST\n          r = GET_BITS(s);\n          s = HUFF_EXTEND(r, s);\n          (*block)[jpeg_natural_order[k]] = (JCOEF) s;\n        } else {\n          if (r != 15) break;\n          k += 15;\n        }\n      }\n\n    } else {\n\n      for (k = 1; k < DCTSIZE2; k++) {\n        HUFF_DECODE_FAST(s, l, actbl);\n        r = s >> 4;\n        s &= 15;\n\n        if (s) {\n          k += r;\n          FILL_BIT_BUFFER_FAST\n          DROP_BITS(s);\n        } else {\n          if (r != 15) break;\n          k += 15;\n        }\n      }\n    }\n  }\n\n  if (cinfo->unread_marker != 0) {\n    cinfo->unread_marker = 0;\n    return FALSE;\n  }\n\n  br_state.bytes_in_buffer -= (buffer - br_state.next_input_byte);\n  br_state.next_input_byte = buffer;\n  BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n  ASSIGN_STATE(entropy->saved, state);\n  return TRUE;\n}\n\n\n/*\n * Decode and return one MCU's worth of Huffman-compressed coefficients.\n * The coefficients are reordered from zigzag order into natural array order,\n * but are not dequantized.\n *\n * The i'th block of the MCU is stored into the block pointed to by\n * MCU_data[i].  WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER.\n * (Wholesale zeroing is usually a little faster than retail...)\n *\n * Returns FALSE if data source requested suspension.  In that case no\n * changes have been made to permanent state.  (Exception: some output\n * coefficients may already have been assigned.  This is harmless for\n * this module, since we'll just re-assign them on the next call.)\n */\n\n#define BUFSIZE (DCTSIZE2 * 8)\n\nMETHODDEF(boolean)\ndecode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int usefast = 1;\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n        return FALSE;\n    usefast = 0;\n  }\n\n  if (cinfo->src->bytes_in_buffer < BUFSIZE * (size_t)cinfo->blocks_in_MCU\n    || cinfo->unread_marker != 0)\n    usefast = 0;\n\n  /* If we've run out of data, just leave the MCU set to zeroes.\n   * This way, we return uniform gray for the remainder of the segment.\n   */\n  if (! entropy->pub.insufficient_data) {\n\n    if (usefast) {\n      if (!decode_mcu_fast(cinfo, MCU_data)) goto use_slow;\n    }\n    else {\n      use_slow:\n      if (!decode_mcu_slow(cinfo, MCU_data)) return FALSE;\n    }\n\n  }\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n}\n\n\n/*\n * Module initialization routine for Huffman entropy decoding.\n */\n\nGLOBAL(void)\njinit_huff_decoder (j_decompress_ptr cinfo)\n{\n  huff_entropy_ptr entropy;\n  int i;\n\n  /* Motion JPEG frames typically do not include the Huffman tables if they\n     are the default tables.  Thus, if the tables are not set by the time\n     the Huffman decoder is initialized (usually within the body of\n     jpeg_start_decompress()), we set them to default values. */\n  std_huff_tables((j_common_ptr) cinfo);\n\n  entropy = (huff_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(huff_entropy_decoder));\n  cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;\n  entropy->pub.start_pass = start_pass_huff_decoder;\n  entropy->pub.decode_mcu = decode_mcu;\n\n  /* Mark tables unallocated */\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdhuff.h",
    "content": "/*\n * jdhuff.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010-2011, 2015-2016, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains declarations for Huffman entropy decoding routines\n * that are shared between the sequential decoder (jdhuff.c) and the\n * progressive decoder (jdphuff.c).  No other modules need to see these.\n */\n\n#include \"jconfigint.h\"\n\n\n/* Derived data constructed for each Huffman table */\n\n#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */\n\ntypedef struct {\n  /* Basic tables: (element [0] of each array is unused) */\n  JLONG maxcode[18];            /* largest code of length k (-1 if none) */\n  /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */\n  JLONG valoffset[18];          /* huffval[] offset for codes of length k */\n  /* valoffset[k] = huffval[] index of 1st symbol of code length k, less\n   * the smallest code of length k; so given a code of length k, the\n   * corresponding symbol is huffval[code + valoffset[k]]\n   */\n\n  /* Link to public Huffman table (needed only in jpeg_huff_decode) */\n  JHUFF_TBL *pub;\n\n  /* Lookahead table: indexed by the next HUFF_LOOKAHEAD bits of\n   * the input data stream.  If the next Huffman code is no more\n   * than HUFF_LOOKAHEAD bits long, we can obtain its length and\n   * the corresponding symbol directly from this tables.\n   *\n   * The lower 8 bits of each table entry contain the number of\n   * bits in the corresponding Huffman code, or HUFF_LOOKAHEAD + 1\n   * if too long.  The next 8 bits of each entry contain the\n   * symbol.\n   */\n  int lookup[1<<HUFF_LOOKAHEAD];\n} d_derived_tbl;\n\n/* Expand a Huffman table definition into the derived format */\nEXTERN(void) jpeg_make_d_derived_tbl\n        (j_decompress_ptr cinfo, boolean isDC, int tblno,\n         d_derived_tbl ** pdtbl);\n\n\n/*\n * Fetching the next N bits from the input stream is a time-critical operation\n * for the Huffman decoders.  We implement it with a combination of inline\n * macros and out-of-line subroutines.  Note that N (the number of bits\n * demanded at one time) never exceeds 15 for JPEG use.\n *\n * We read source bytes into get_buffer and dole out bits as needed.\n * If get_buffer already contains enough bits, they are fetched in-line\n * by the macros CHECK_BIT_BUFFER and GET_BITS.  When there aren't enough\n * bits, jpeg_fill_bit_buffer is called; it will attempt to fill get_buffer\n * as full as possible (not just to the number of bits needed; this\n * prefetching reduces the overhead cost of calling jpeg_fill_bit_buffer).\n * Note that jpeg_fill_bit_buffer may return FALSE to indicate suspension.\n * On TRUE return, jpeg_fill_bit_buffer guarantees that get_buffer contains\n * at least the requested number of bits --- dummy zeroes are inserted if\n * necessary.\n */\n\n#if !defined(_WIN32) && !defined(SIZEOF_SIZE_T)\n#error Cannot determine word size\n#endif\n\n#if SIZEOF_SIZE_T==8 || defined(_WIN64)\n\ntypedef size_t bit_buf_type;            /* type of bit-extraction buffer */\n#define BIT_BUF_SIZE  64                /* size of buffer in bits */\n\n#else\n\ntypedef unsigned long bit_buf_type;     /* type of bit-extraction buffer */\n#define BIT_BUF_SIZE  32                /* size of buffer in bits */\n\n#endif\n\n/* If long is > 32 bits on your machine, and shifting/masking longs is\n * reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE\n * appropriately should be a win.  Unfortunately we can't define the size\n * with something like  #define BIT_BUF_SIZE (sizeof(bit_buf_type)*8)\n * because not all machines measure sizeof in 8-bit bytes.\n */\n\ntypedef struct {                /* Bitreading state saved across MCUs */\n  bit_buf_type get_buffer;      /* current bit-extraction buffer */\n  int bits_left;                /* # of unused bits in it */\n} bitread_perm_state;\n\ntypedef struct {                /* Bitreading working state within an MCU */\n  /* Current data source location */\n  /* We need a copy, rather than munging the original, in case of suspension */\n  const JOCTET *next_input_byte; /* => next byte to read from source */\n  size_t bytes_in_buffer;       /* # of bytes remaining in source buffer */\n  /* Bit input buffer --- note these values are kept in register variables,\n   * not in this struct, inside the inner loops.\n   */\n  bit_buf_type get_buffer;      /* current bit-extraction buffer */\n  int bits_left;                /* # of unused bits in it */\n  /* Pointer needed by jpeg_fill_bit_buffer. */\n  j_decompress_ptr cinfo;       /* back link to decompress master record */\n} bitread_working_state;\n\n/* Macros to declare and load/save bitread local variables. */\n#define BITREAD_STATE_VARS  \\\n        register bit_buf_type get_buffer;  \\\n        register int bits_left;  \\\n        bitread_working_state br_state\n\n#define BITREAD_LOAD_STATE(cinfop,permstate)  \\\n        br_state.cinfo = cinfop; \\\n        br_state.next_input_byte = cinfop->src->next_input_byte; \\\n        br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \\\n        get_buffer = permstate.get_buffer; \\\n        bits_left = permstate.bits_left;\n\n#define BITREAD_SAVE_STATE(cinfop,permstate)  \\\n        cinfop->src->next_input_byte = br_state.next_input_byte; \\\n        cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \\\n        permstate.get_buffer = get_buffer; \\\n        permstate.bits_left = bits_left\n\n/*\n * These macros provide the in-line portion of bit fetching.\n * Use CHECK_BIT_BUFFER to ensure there are N bits in get_buffer\n * before using GET_BITS, PEEK_BITS, or DROP_BITS.\n * The variables get_buffer and bits_left are assumed to be locals,\n * but the state struct might not be (jpeg_huff_decode needs this).\n *      CHECK_BIT_BUFFER(state,n,action);\n *              Ensure there are N bits in get_buffer; if suspend, take action.\n *      val = GET_BITS(n);\n *              Fetch next N bits.\n *      val = PEEK_BITS(n);\n *              Fetch next N bits without removing them from the buffer.\n *      DROP_BITS(n);\n *              Discard next N bits.\n * The value N should be a simple variable, not an expression, because it\n * is evaluated multiple times.\n */\n\n#define CHECK_BIT_BUFFER(state,nbits,action) \\\n        { if (bits_left < (nbits)) {  \\\n            if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits))  \\\n              { action; }  \\\n            get_buffer = (state).get_buffer; bits_left = (state).bits_left; } }\n\n#define GET_BITS(nbits) \\\n        (((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1))\n\n#define PEEK_BITS(nbits) \\\n        (((int) (get_buffer >> (bits_left -  (nbits)))) & ((1<<(nbits))-1))\n\n#define DROP_BITS(nbits) \\\n        (bits_left -= (nbits))\n\n/* Load up the bit buffer to a depth of at least nbits */\nEXTERN(boolean) jpeg_fill_bit_buffer\n        (bitread_working_state *state, register bit_buf_type get_buffer,\n         register int bits_left, int nbits);\n\n\n/*\n * Code for extracting next Huffman-coded symbol from input bit stream.\n * Again, this is time-critical and we make the main paths be macros.\n *\n * We use a lookahead table to process codes of up to HUFF_LOOKAHEAD bits\n * without looping.  Usually, more than 95% of the Huffman codes will be 8\n * or fewer bits long.  The few overlength codes are handled with a loop,\n * which need not be inline code.\n *\n * Notes about the HUFF_DECODE macro:\n * 1. Near the end of the data segment, we may fail to get enough bits\n *    for a lookahead.  In that case, we do it the hard way.\n * 2. If the lookahead table contains no entry, the next code must be\n *    more than HUFF_LOOKAHEAD bits long.\n * 3. jpeg_huff_decode returns -1 if forced to suspend.\n */\n\n#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \\\n{ register int nb, look; \\\n  if (bits_left < HUFF_LOOKAHEAD) { \\\n    if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \\\n    get_buffer = state.get_buffer; bits_left = state.bits_left; \\\n    if (bits_left < HUFF_LOOKAHEAD) { \\\n      nb = 1; goto slowlabel; \\\n    } \\\n  } \\\n  look = PEEK_BITS(HUFF_LOOKAHEAD); \\\n  if ((nb = (htbl->lookup[look] >> HUFF_LOOKAHEAD)) <= HUFF_LOOKAHEAD) { \\\n    DROP_BITS(nb); \\\n    result = htbl->lookup[look] & ((1 << HUFF_LOOKAHEAD) - 1); \\\n  } else { \\\nslowlabel: \\\n    if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \\\n        { failaction; } \\\n    get_buffer = state.get_buffer; bits_left = state.bits_left; \\\n  } \\\n}\n\n#define HUFF_DECODE_FAST(s,nb,htbl) \\\n  FILL_BIT_BUFFER_FAST; \\\n  s = PEEK_BITS(HUFF_LOOKAHEAD); \\\n  s = htbl->lookup[s]; \\\n  nb = s >> HUFF_LOOKAHEAD; \\\n  /* Pre-execute the common case of nb <= HUFF_LOOKAHEAD */ \\\n  DROP_BITS(nb); \\\n  s = s & ((1 << HUFF_LOOKAHEAD) - 1); \\\n  if (nb > HUFF_LOOKAHEAD) { \\\n    /* Equivalent of jpeg_huff_decode() */ \\\n    /* Don't use GET_BITS() here because we don't want to modify bits_left */ \\\n    s = (get_buffer >> bits_left) & ((1 << (nb)) - 1); \\\n    while (s > htbl->maxcode[nb]) { \\\n      s <<= 1; \\\n      s |= GET_BITS(1); \\\n      nb++; \\\n    } \\\n    s = htbl->pub->huffval[ (int) (s + htbl->valoffset[nb]) & 0xFF ]; \\\n  }\n\n/* Out-of-line case for Huffman code fetching */\nEXTERN(int) jpeg_huff_decode\n        (bitread_working_state *state, register bit_buf_type get_buffer,\n         register int bits_left, d_derived_tbl *htbl, int min_bits);\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdinput.c",
    "content": "/*\n * jdinput.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, 2016, D. R. Commander.\n * Copyright (C) 2015, Google, Inc.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains input control logic for the JPEG decompressor.\n * These routines are concerned with controlling the decompressor's input\n * processing (marker reading and coefficient decoding).  The actual input\n * reading is done in jdmarker.c, jdhuff.c, and jdphuff.c.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jpegcomp.h\"\n\n\n/* Private state */\n\ntypedef struct {\n  struct jpeg_input_controller pub; /* public fields */\n\n  boolean inheaders;            /* TRUE until first SOS is reached */\n} my_input_controller;\n\ntypedef my_input_controller *my_inputctl_ptr;\n\n\n/* Forward declarations */\nMETHODDEF(int) consume_markers (j_decompress_ptr cinfo);\n\n\n/*\n * Routines to calculate various quantities related to the size of the image.\n */\n\nLOCAL(void)\ninitial_setup (j_decompress_ptr cinfo)\n/* Called once, when first SOS marker is reached */\n{\n  int ci;\n  jpeg_component_info *compptr;\n\n  /* Make sure image isn't bigger than I can handle */\n  if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION ||\n      (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)\n    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);\n\n  /* For now, precision must match compiled-in value... */\n  if (cinfo->data_precision != BITS_IN_JSAMPLE)\n    ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);\n\n  /* Check that number of components won't exceed internal array sizes */\n  if (cinfo->num_components > MAX_COMPONENTS)\n    ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,\n             MAX_COMPONENTS);\n\n  /* Compute maximum sampling factors; check factor validity */\n  cinfo->max_h_samp_factor = 1;\n  cinfo->max_v_samp_factor = 1;\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||\n        compptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)\n      ERREXIT(cinfo, JERR_BAD_SAMPLING);\n    cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,\n                                   compptr->h_samp_factor);\n    cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,\n                                   compptr->v_samp_factor);\n  }\n\n#if JPEG_LIB_VERSION >=80\n    cinfo->block_size = DCTSIZE;\n    cinfo->natural_order = jpeg_natural_order;\n    cinfo->lim_Se = DCTSIZE2-1;\n#endif\n\n  /* We initialize DCT_scaled_size and min_DCT_scaled_size to DCTSIZE.\n   * In the full decompressor, this will be overridden by jdmaster.c;\n   * but in the transcoder, jdmaster.c is not used, so we must do it here.\n   */\n#if JPEG_LIB_VERSION >= 70\n  cinfo->min_DCT_h_scaled_size = cinfo->min_DCT_v_scaled_size = DCTSIZE;\n#else\n  cinfo->min_DCT_scaled_size = DCTSIZE;\n#endif\n\n  /* Compute dimensions of components */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n#if JPEG_LIB_VERSION >= 70\n    compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size = DCTSIZE;\n#else\n    compptr->DCT_scaled_size = DCTSIZE;\n#endif\n    /* Size in DCT blocks */\n    compptr->width_in_blocks = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,\n                    (long) (cinfo->max_h_samp_factor * DCTSIZE));\n    compptr->height_in_blocks = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,\n                    (long) (cinfo->max_v_samp_factor * DCTSIZE));\n    /* Set the first and last MCU columns to decompress from multi-scan images.\n     * By default, decompress all of the MCU columns.\n     */\n    cinfo->master->first_MCU_col[ci] = 0;\n    cinfo->master->last_MCU_col[ci] = compptr->width_in_blocks - 1;\n    /* downsampled_width and downsampled_height will also be overridden by\n     * jdmaster.c if we are doing full decompression.  The transcoder library\n     * doesn't use these values, but the calling application might.\n     */\n    /* Size in samples */\n    compptr->downsampled_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,\n                    (long) cinfo->max_h_samp_factor);\n    compptr->downsampled_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,\n                    (long) cinfo->max_v_samp_factor);\n    /* Mark component needed, until color conversion says otherwise */\n    compptr->component_needed = TRUE;\n    /* Mark no quantization table yet saved for component */\n    compptr->quant_table = NULL;\n  }\n\n  /* Compute number of fully interleaved MCU rows. */\n  cinfo->total_iMCU_rows = (JDIMENSION)\n    jdiv_round_up((long) cinfo->image_height,\n                  (long) (cinfo->max_v_samp_factor*DCTSIZE));\n\n  /* Decide whether file contains multiple scans */\n  if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode)\n    cinfo->inputctl->has_multiple_scans = TRUE;\n  else\n    cinfo->inputctl->has_multiple_scans = FALSE;\n}\n\n\nLOCAL(void)\nper_scan_setup (j_decompress_ptr cinfo)\n/* Do computations that are needed before processing a JPEG scan */\n/* cinfo->comps_in_scan and cinfo->cur_comp_info[] were set from SOS marker */\n{\n  int ci, mcublks, tmp;\n  jpeg_component_info *compptr;\n\n  if (cinfo->comps_in_scan == 1) {\n\n    /* Noninterleaved (single-component) scan */\n    compptr = cinfo->cur_comp_info[0];\n\n    /* Overall image size in MCUs */\n    cinfo->MCUs_per_row = compptr->width_in_blocks;\n    cinfo->MCU_rows_in_scan = compptr->height_in_blocks;\n\n    /* For noninterleaved scan, always one block per MCU */\n    compptr->MCU_width = 1;\n    compptr->MCU_height = 1;\n    compptr->MCU_blocks = 1;\n    compptr->MCU_sample_width = compptr->_DCT_scaled_size;\n    compptr->last_col_width = 1;\n    /* For noninterleaved scans, it is convenient to define last_row_height\n     * as the number of block rows present in the last iMCU row.\n     */\n    tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);\n    if (tmp == 0) tmp = compptr->v_samp_factor;\n    compptr->last_row_height = tmp;\n\n    /* Prepare array describing MCU composition */\n    cinfo->blocks_in_MCU = 1;\n    cinfo->MCU_membership[0] = 0;\n\n  } else {\n\n    /* Interleaved (multi-component) scan */\n    if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)\n      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,\n               MAX_COMPS_IN_SCAN);\n\n    /* Overall image size in MCUs */\n    cinfo->MCUs_per_row = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width,\n                    (long) (cinfo->max_h_samp_factor*DCTSIZE));\n    cinfo->MCU_rows_in_scan = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height,\n                    (long) (cinfo->max_v_samp_factor*DCTSIZE));\n\n    cinfo->blocks_in_MCU = 0;\n\n    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n      compptr = cinfo->cur_comp_info[ci];\n      /* Sampling factors give # of blocks of component in each MCU */\n      compptr->MCU_width = compptr->h_samp_factor;\n      compptr->MCU_height = compptr->v_samp_factor;\n      compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;\n      compptr->MCU_sample_width = compptr->MCU_width * compptr->_DCT_scaled_size;\n      /* Figure number of non-dummy blocks in last MCU column & row */\n      tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);\n      if (tmp == 0) tmp = compptr->MCU_width;\n      compptr->last_col_width = tmp;\n      tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);\n      if (tmp == 0) tmp = compptr->MCU_height;\n      compptr->last_row_height = tmp;\n      /* Prepare array describing MCU composition */\n      mcublks = compptr->MCU_blocks;\n      if (cinfo->blocks_in_MCU + mcublks > D_MAX_BLOCKS_IN_MCU)\n        ERREXIT(cinfo, JERR_BAD_MCU_SIZE);\n      while (mcublks-- > 0) {\n        cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;\n      }\n    }\n\n  }\n}\n\n\n/*\n * Save away a copy of the Q-table referenced by each component present\n * in the current scan, unless already saved during a prior scan.\n *\n * In a multiple-scan JPEG file, the encoder could assign different components\n * the same Q-table slot number, but change table definitions between scans\n * so that each component uses a different Q-table.  (The IJG encoder is not\n * currently capable of doing this, but other encoders might.)  Since we want\n * to be able to dequantize all the components at the end of the file, this\n * means that we have to save away the table actually used for each component.\n * We do this by copying the table at the start of the first scan containing\n * the component.\n * The JPEG spec prohibits the encoder from changing the contents of a Q-table\n * slot between scans of a component using that slot.  If the encoder does so\n * anyway, this decoder will simply use the Q-table values that were current\n * at the start of the first scan for the component.\n *\n * The decompressor output side looks only at the saved quant tables,\n * not at the current Q-table slots.\n */\n\nLOCAL(void)\nlatch_quant_tables (j_decompress_ptr cinfo)\n{\n  int ci, qtblno;\n  jpeg_component_info *compptr;\n  JQUANT_TBL *qtbl;\n\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    /* No work if we already saved Q-table for this component */\n    if (compptr->quant_table != NULL)\n      continue;\n    /* Make sure specified quantization table is present */\n    qtblno = compptr->quant_tbl_no;\n    if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||\n        cinfo->quant_tbl_ptrs[qtblno] == NULL)\n      ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);\n    /* OK, save away the quantization table */\n    qtbl = (JQUANT_TBL *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(JQUANT_TBL));\n    MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], sizeof(JQUANT_TBL));\n    compptr->quant_table = qtbl;\n  }\n}\n\n\n/*\n * Initialize the input modules to read a scan of compressed data.\n * The first call to this is done by jdmaster.c after initializing\n * the entire decompressor (during jpeg_start_decompress).\n * Subsequent calls come from consume_markers, below.\n */\n\nMETHODDEF(void)\nstart_input_pass (j_decompress_ptr cinfo)\n{\n  per_scan_setup(cinfo);\n  latch_quant_tables(cinfo);\n  (*cinfo->entropy->start_pass) (cinfo);\n  (*cinfo->coef->start_input_pass) (cinfo);\n  cinfo->inputctl->consume_input = cinfo->coef->consume_data;\n}\n\n\n/*\n * Finish up after inputting a compressed-data scan.\n * This is called by the coefficient controller after it's read all\n * the expected data of the scan.\n */\n\nMETHODDEF(void)\nfinish_input_pass (j_decompress_ptr cinfo)\n{\n  cinfo->inputctl->consume_input = consume_markers;\n}\n\n\n/*\n * Read JPEG markers before, between, or after compressed-data scans.\n * Change state as necessary when a new scan is reached.\n * Return value is JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.\n *\n * The consume_input method pointer points either here or to the\n * coefficient controller's consume_data routine, depending on whether\n * we are reading a compressed data segment or inter-segment markers.\n */\n\nMETHODDEF(int)\nconsume_markers (j_decompress_ptr cinfo)\n{\n  my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;\n  int val;\n\n  if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */\n    return JPEG_REACHED_EOI;\n\n  val = (*cinfo->marker->read_markers) (cinfo);\n\n  switch (val) {\n  case JPEG_REACHED_SOS:        /* Found SOS */\n    if (inputctl->inheaders) {  /* 1st SOS */\n      initial_setup(cinfo);\n      inputctl->inheaders = FALSE;\n      /* Note: start_input_pass must be called by jdmaster.c\n       * before any more input can be consumed.  jdapimin.c is\n       * responsible for enforcing this sequencing.\n       */\n    } else {                    /* 2nd or later SOS marker */\n      if (! inputctl->pub.has_multiple_scans)\n        ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */\n      start_input_pass(cinfo);\n    }\n    break;\n  case JPEG_REACHED_EOI:        /* Found EOI */\n    inputctl->pub.eoi_reached = TRUE;\n    if (inputctl->inheaders) {  /* Tables-only datastream, apparently */\n      if (cinfo->marker->saw_SOF)\n        ERREXIT(cinfo, JERR_SOF_NO_SOS);\n    } else {\n      /* Prevent infinite loop in coef ctlr's decompress_data routine\n       * if user set output_scan_number larger than number of scans.\n       */\n      if (cinfo->output_scan_number > cinfo->input_scan_number)\n        cinfo->output_scan_number = cinfo->input_scan_number;\n    }\n    break;\n  case JPEG_SUSPENDED:\n    break;\n  }\n\n  return val;\n}\n\n\n/*\n * Reset state to begin a fresh datastream.\n */\n\nMETHODDEF(void)\nreset_input_controller (j_decompress_ptr cinfo)\n{\n  my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;\n\n  inputctl->pub.consume_input = consume_markers;\n  inputctl->pub.has_multiple_scans = FALSE; /* \"unknown\" would be better */\n  inputctl->pub.eoi_reached = FALSE;\n  inputctl->inheaders = TRUE;\n  /* Reset other modules */\n  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);\n  (*cinfo->marker->reset_marker_reader) (cinfo);\n  /* Reset progression state -- would be cleaner if entropy decoder did this */\n  cinfo->coef_bits = NULL;\n}\n\n\n/*\n * Initialize the input controller module.\n * This is called only once, when the decompression object is created.\n */\n\nGLOBAL(void)\njinit_input_controller (j_decompress_ptr cinfo)\n{\n  my_inputctl_ptr inputctl;\n\n  /* Create subobject in permanent pool */\n  inputctl = (my_inputctl_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n                                sizeof(my_input_controller));\n  cinfo->inputctl = (struct jpeg_input_controller *) inputctl;\n  /* Initialize method pointers */\n  inputctl->pub.consume_input = consume_markers;\n  inputctl->pub.reset_input_controller = reset_input_controller;\n  inputctl->pub.start_input_pass = start_input_pass;\n  inputctl->pub.finish_input_pass = finish_input_pass;\n  /* Initialize state: can't use reset_input_controller since we don't\n   * want to try to reset other modules yet.\n   */\n  inputctl->pub.has_multiple_scans = FALSE; /* \"unknown\" would be better */\n  inputctl->pub.eoi_reached = FALSE;\n  inputctl->inheaders = TRUE;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdmainct.c",
    "content": "/*\n * jdmainct.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, 2016, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains the main buffer controller for decompression.\n * The main buffer lies between the JPEG decompressor proper and the\n * post-processor; it holds downsampled data in the JPEG colorspace.\n *\n * Note that this code is bypassed in raw-data mode, since the application\n * supplies the equivalent of the main buffer in that case.\n */\n\n#include \"jinclude.h\"\n#include \"jdmainct.h\"\n\n\n/*\n * In the current system design, the main buffer need never be a full-image\n * buffer; any full-height buffers will be found inside the coefficient or\n * postprocessing controllers.  Nonetheless, the main controller is not\n * trivial.  Its responsibility is to provide context rows for upsampling/\n * rescaling, and doing this in an efficient fashion is a bit tricky.\n *\n * Postprocessor input data is counted in \"row groups\".  A row group\n * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)\n * sample rows of each component.  (We require DCT_scaled_size values to be\n * chosen such that these numbers are integers.  In practice DCT_scaled_size\n * values will likely be powers of two, so we actually have the stronger\n * condition that DCT_scaled_size / min_DCT_scaled_size is an integer.)\n * Upsampling will typically produce max_v_samp_factor pixel rows from each\n * row group (times any additional scale factor that the upsampler is\n * applying).\n *\n * The coefficient controller will deliver data to us one iMCU row at a time;\n * each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or\n * exactly min_DCT_scaled_size row groups.  (This amount of data corresponds\n * to one row of MCUs when the image is fully interleaved.)  Note that the\n * number of sample rows varies across components, but the number of row\n * groups does not.  Some garbage sample rows may be included in the last iMCU\n * row at the bottom of the image.\n *\n * Depending on the vertical scaling algorithm used, the upsampler may need\n * access to the sample row(s) above and below its current input row group.\n * The upsampler is required to set need_context_rows TRUE at global selection\n * time if so.  When need_context_rows is FALSE, this controller can simply\n * obtain one iMCU row at a time from the coefficient controller and dole it\n * out as row groups to the postprocessor.\n *\n * When need_context_rows is TRUE, this controller guarantees that the buffer\n * passed to postprocessing contains at least one row group's worth of samples\n * above and below the row group(s) being processed.  Note that the context\n * rows \"above\" the first passed row group appear at negative row offsets in\n * the passed buffer.  At the top and bottom of the image, the required\n * context rows are manufactured by duplicating the first or last real sample\n * row; this avoids having special cases in the upsampling inner loops.\n *\n * The amount of context is fixed at one row group just because that's a\n * convenient number for this controller to work with.  The existing\n * upsamplers really only need one sample row of context.  An upsampler\n * supporting arbitrary output rescaling might wish for more than one row\n * group of context when shrinking the image; tough, we don't handle that.\n * (This is justified by the assumption that downsizing will be handled mostly\n * by adjusting the DCT_scaled_size values, so that the actual scale factor at\n * the upsample step needn't be much less than one.)\n *\n * To provide the desired context, we have to retain the last two row groups\n * of one iMCU row while reading in the next iMCU row.  (The last row group\n * can't be processed until we have another row group for its below-context,\n * and so we have to save the next-to-last group too for its above-context.)\n * We could do this most simply by copying data around in our buffer, but\n * that'd be very slow.  We can avoid copying any data by creating a rather\n * strange pointer structure.  Here's how it works.  We allocate a workspace\n * consisting of M+2 row groups (where M = min_DCT_scaled_size is the number\n * of row groups per iMCU row).  We create two sets of redundant pointers to\n * the workspace.  Labeling the physical row groups 0 to M+1, the synthesized\n * pointer lists look like this:\n *                   M+1                          M-1\n * master pointer --> 0         master pointer --> 0\n *                    1                            1\n *                   ...                          ...\n *                   M-3                          M-3\n *                   M-2                           M\n *                   M-1                          M+1\n *                    M                           M-2\n *                   M+1                          M-1\n *                    0                            0\n * We read alternate iMCU rows using each master pointer; thus the last two\n * row groups of the previous iMCU row remain un-overwritten in the workspace.\n * The pointer lists are set up so that the required context rows appear to\n * be adjacent to the proper places when we pass the pointer lists to the\n * upsampler.\n *\n * The above pictures describe the normal state of the pointer lists.\n * At top and bottom of the image, we diddle the pointer lists to duplicate\n * the first or last sample row as necessary (this is cheaper than copying\n * sample rows around).\n *\n * This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1.  In that\n * situation each iMCU row provides only one row group so the buffering logic\n * must be different (eg, we must read two iMCU rows before we can emit the\n * first row group).  For now, we simply do not support providing context\n * rows when min_DCT_scaled_size is 1.  That combination seems unlikely to\n * be worth providing --- if someone wants a 1/8th-size preview, they probably\n * want it quick and dirty, so a context-free upsampler is sufficient.\n */\n\n\n/* Forward declarations */\nMETHODDEF(void) process_data_simple_main\n        (j_decompress_ptr cinfo, JSAMPARRAY output_buf,\n         JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);\nMETHODDEF(void) process_data_context_main\n        (j_decompress_ptr cinfo, JSAMPARRAY output_buf,\n         JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);\n#ifdef QUANT_2PASS_SUPPORTED\nMETHODDEF(void) process_data_crank_post\n        (j_decompress_ptr cinfo, JSAMPARRAY output_buf,\n         JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);\n#endif\n\n\nLOCAL(void)\nalloc_funny_pointers (j_decompress_ptr cinfo)\n/* Allocate space for the funny pointer lists.\n * This is done only once, not once per pass.\n */\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n  int ci, rgroup;\n  int M = cinfo->_min_DCT_scaled_size;\n  jpeg_component_info *compptr;\n  JSAMPARRAY xbuf;\n\n  /* Get top-level space for component array pointers.\n   * We alloc both arrays with one call to save a few cycles.\n   */\n  main_ptr->xbuffer[0] = (JSAMPIMAGE)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                cinfo->num_components * 2 * sizeof(JSAMPARRAY));\n  main_ptr->xbuffer[1] = main_ptr->xbuffer[0] + cinfo->num_components;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    rgroup = (compptr->v_samp_factor * compptr->_DCT_scaled_size) /\n      cinfo->_min_DCT_scaled_size; /* height of a row group of component */\n    /* Get space for pointer lists --- M+4 row groups in each list.\n     * We alloc both pointer lists with one call to save a few cycles.\n     */\n    xbuf = (JSAMPARRAY)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  2 * (rgroup * (M + 4)) * sizeof(JSAMPROW));\n    xbuf += rgroup;             /* want one row group at negative offsets */\n    main_ptr->xbuffer[0][ci] = xbuf;\n    xbuf += rgroup * (M + 4);\n    main_ptr->xbuffer[1][ci] = xbuf;\n  }\n}\n\n\nLOCAL(void)\nmake_funny_pointers (j_decompress_ptr cinfo)\n/* Create the funny pointer lists discussed in the comments above.\n * The actual workspace is already allocated (in main_ptr->buffer),\n * and the space for the pointer lists is allocated too.\n * This routine just fills in the curiously ordered lists.\n * This will be repeated at the beginning of each pass.\n */\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n  int ci, i, rgroup;\n  int M = cinfo->_min_DCT_scaled_size;\n  jpeg_component_info *compptr;\n  JSAMPARRAY buf, xbuf0, xbuf1;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    rgroup = (compptr->v_samp_factor * compptr->_DCT_scaled_size) /\n      cinfo->_min_DCT_scaled_size; /* height of a row group of component */\n    xbuf0 = main_ptr->xbuffer[0][ci];\n    xbuf1 = main_ptr->xbuffer[1][ci];\n    /* First copy the workspace pointers as-is */\n    buf = main_ptr->buffer[ci];\n    for (i = 0; i < rgroup * (M + 2); i++) {\n      xbuf0[i] = xbuf1[i] = buf[i];\n    }\n    /* In the second list, put the last four row groups in swapped order */\n    for (i = 0; i < rgroup * 2; i++) {\n      xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i];\n      xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i];\n    }\n    /* The wraparound pointers at top and bottom will be filled later\n     * (see set_wraparound_pointers, below).  Initially we want the \"above\"\n     * pointers to duplicate the first actual data line.  This only needs\n     * to happen in xbuffer[0].\n     */\n    for (i = 0; i < rgroup; i++) {\n      xbuf0[i - rgroup] = xbuf0[0];\n    }\n  }\n}\n\n\nLOCAL(void)\nset_bottom_pointers (j_decompress_ptr cinfo)\n/* Change the pointer lists to duplicate the last sample row at the bottom\n * of the image.  whichptr indicates which xbuffer holds the final iMCU row.\n * Also sets rowgroups_avail to indicate number of nondummy row groups in row.\n */\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n  int ci, i, rgroup, iMCUheight, rows_left;\n  jpeg_component_info *compptr;\n  JSAMPARRAY xbuf;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Count sample rows in one iMCU row and in one row group */\n    iMCUheight = compptr->v_samp_factor * compptr->_DCT_scaled_size;\n    rgroup = iMCUheight / cinfo->_min_DCT_scaled_size;\n    /* Count nondummy sample rows remaining for this component */\n    rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight);\n    if (rows_left == 0) rows_left = iMCUheight;\n    /* Count nondummy row groups.  Should get same answer for each component,\n     * so we need only do it once.\n     */\n    if (ci == 0) {\n      main_ptr->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1);\n    }\n    /* Duplicate the last real sample row rgroup*2 times; this pads out the\n     * last partial rowgroup and ensures at least one full rowgroup of context.\n     */\n    xbuf = main_ptr->xbuffer[main_ptr->whichptr][ci];\n    for (i = 0; i < rgroup * 2; i++) {\n      xbuf[rows_left + i] = xbuf[rows_left-1];\n    }\n  }\n}\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n\n  switch (pass_mode) {\n  case JBUF_PASS_THRU:\n    if (cinfo->upsample->need_context_rows) {\n      main_ptr->pub.process_data = process_data_context_main;\n      make_funny_pointers(cinfo); /* Create the xbuffer[] lists */\n      main_ptr->whichptr = 0;   /* Read first iMCU row into xbuffer[0] */\n      main_ptr->context_state = CTX_PREPARE_FOR_IMCU;\n      main_ptr->iMCU_row_ctr = 0;\n    } else {\n      /* Simple case with no context needed */\n      main_ptr->pub.process_data = process_data_simple_main;\n    }\n    main_ptr->buffer_full = FALSE;      /* Mark buffer empty */\n    main_ptr->rowgroup_ctr = 0;\n    break;\n#ifdef QUANT_2PASS_SUPPORTED\n  case JBUF_CRANK_DEST:\n    /* For last pass of 2-pass quantization, just crank the postprocessor */\n    main_ptr->pub.process_data = process_data_crank_post;\n    break;\n#endif\n  default:\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    break;\n  }\n}\n\n\n/*\n * Process some data.\n * This handles the simple case where no context is required.\n */\n\nMETHODDEF(void)\nprocess_data_simple_main (j_decompress_ptr cinfo,\n                          JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n                          JDIMENSION out_rows_avail)\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n  JDIMENSION rowgroups_avail;\n\n  /* Read input data if we haven't filled the main buffer yet */\n  if (! main_ptr->buffer_full) {\n    if (! (*cinfo->coef->decompress_data) (cinfo, main_ptr->buffer))\n      return;                   /* suspension forced, can do nothing more */\n    main_ptr->buffer_full = TRUE;       /* OK, we have an iMCU row to work with */\n  }\n\n  /* There are always min_DCT_scaled_size row groups in an iMCU row. */\n  rowgroups_avail = (JDIMENSION) cinfo->_min_DCT_scaled_size;\n  /* Note: at the bottom of the image, we may pass extra garbage row groups\n   * to the postprocessor.  The postprocessor has to check for bottom\n   * of image anyway (at row resolution), so no point in us doing it too.\n   */\n\n  /* Feed the postprocessor */\n  (*cinfo->post->post_process_data) (cinfo, main_ptr->buffer,\n                                     &main_ptr->rowgroup_ctr, rowgroups_avail,\n                                     output_buf, out_row_ctr, out_rows_avail);\n\n  /* Has postprocessor consumed all the data yet? If so, mark buffer empty */\n  if (main_ptr->rowgroup_ctr >= rowgroups_avail) {\n    main_ptr->buffer_full = FALSE;\n    main_ptr->rowgroup_ctr = 0;\n  }\n}\n\n\n/*\n * Process some data.\n * This handles the case where context rows must be provided.\n */\n\nMETHODDEF(void)\nprocess_data_context_main (j_decompress_ptr cinfo,\n                           JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n                           JDIMENSION out_rows_avail)\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n\n  /* Read input data if we haven't filled the main buffer yet */\n  if (! main_ptr->buffer_full) {\n    if (! (*cinfo->coef->decompress_data) (cinfo,\n                                           main_ptr->xbuffer[main_ptr->whichptr]))\n      return;                   /* suspension forced, can do nothing more */\n    main_ptr->buffer_full = TRUE;       /* OK, we have an iMCU row to work with */\n    main_ptr->iMCU_row_ctr++;   /* count rows received */\n  }\n\n  /* Postprocessor typically will not swallow all the input data it is handed\n   * in one call (due to filling the output buffer first).  Must be prepared\n   * to exit and restart.  This switch lets us keep track of how far we got.\n   * Note that each case falls through to the next on successful completion.\n   */\n  switch (main_ptr->context_state) {\n  case CTX_POSTPONED_ROW:\n    /* Call postprocessor using previously set pointers for postponed row */\n    (*cinfo->post->post_process_data) (cinfo, main_ptr->xbuffer[main_ptr->whichptr],\n                        &main_ptr->rowgroup_ctr, main_ptr->rowgroups_avail,\n                        output_buf, out_row_ctr, out_rows_avail);\n    if (main_ptr->rowgroup_ctr < main_ptr->rowgroups_avail)\n      return;                   /* Need to suspend */\n    main_ptr->context_state = CTX_PREPARE_FOR_IMCU;\n    if (*out_row_ctr >= out_rows_avail)\n      return;                   /* Postprocessor exactly filled output buf */\n    /*FALLTHROUGH*/\n  case CTX_PREPARE_FOR_IMCU:\n    /* Prepare to process first M-1 row groups of this iMCU row */\n    main_ptr->rowgroup_ctr = 0;\n    main_ptr->rowgroups_avail = (JDIMENSION) (cinfo->_min_DCT_scaled_size - 1);\n    /* Check for bottom of image: if so, tweak pointers to \"duplicate\"\n     * the last sample row, and adjust rowgroups_avail to ignore padding rows.\n     */\n    if (main_ptr->iMCU_row_ctr == cinfo->total_iMCU_rows)\n      set_bottom_pointers(cinfo);\n    main_ptr->context_state = CTX_PROCESS_IMCU;\n    /*FALLTHROUGH*/\n  case CTX_PROCESS_IMCU:\n    /* Call postprocessor using previously set pointers */\n    (*cinfo->post->post_process_data) (cinfo, main_ptr->xbuffer[main_ptr->whichptr],\n                        &main_ptr->rowgroup_ctr, main_ptr->rowgroups_avail,\n                        output_buf, out_row_ctr, out_rows_avail);\n    if (main_ptr->rowgroup_ctr < main_ptr->rowgroups_avail)\n      return;                   /* Need to suspend */\n    /* After the first iMCU, change wraparound pointers to normal state */\n    if (main_ptr->iMCU_row_ctr == 1)\n      set_wraparound_pointers(cinfo);\n    /* Prepare to load new iMCU row using other xbuffer list */\n    main_ptr->whichptr ^= 1;    /* 0=>1 or 1=>0 */\n    main_ptr->buffer_full = FALSE;\n    /* Still need to process last row group of this iMCU row, */\n    /* which is saved at index M+1 of the other xbuffer */\n    main_ptr->rowgroup_ctr = (JDIMENSION) (cinfo->_min_DCT_scaled_size + 1);\n    main_ptr->rowgroups_avail = (JDIMENSION) (cinfo->_min_DCT_scaled_size + 2);\n    main_ptr->context_state = CTX_POSTPONED_ROW;\n  }\n}\n\n\n/*\n * Process some data.\n * Final pass of two-pass quantization: just call the postprocessor.\n * Source data will be the postprocessor controller's internal buffer.\n */\n\n#ifdef QUANT_2PASS_SUPPORTED\n\nMETHODDEF(void)\nprocess_data_crank_post (j_decompress_ptr cinfo,\n                         JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n                         JDIMENSION out_rows_avail)\n{\n  (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL,\n                                     (JDIMENSION *) NULL, (JDIMENSION) 0,\n                                     output_buf, out_row_ctr, out_rows_avail);\n}\n\n#endif /* QUANT_2PASS_SUPPORTED */\n\n\n/*\n * Initialize main buffer controller.\n */\n\nGLOBAL(void)\njinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)\n{\n  my_main_ptr main_ptr;\n  int ci, rgroup, ngroups;\n  jpeg_component_info *compptr;\n\n  main_ptr = (my_main_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_main_controller));\n  cinfo->main = (struct jpeg_d_main_controller *) main_ptr;\n  main_ptr->pub.start_pass = start_pass_main;\n\n  if (need_full_buffer)         /* shouldn't happen */\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n\n  /* Allocate the workspace.\n   * ngroups is the number of row groups we need.\n   */\n  if (cinfo->upsample->need_context_rows) {\n    if (cinfo->_min_DCT_scaled_size < 2) /* unsupported, see comments above */\n      ERREXIT(cinfo, JERR_NOTIMPL);\n    alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */\n    ngroups = cinfo->_min_DCT_scaled_size + 2;\n  } else {\n    ngroups = cinfo->_min_DCT_scaled_size;\n  }\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    rgroup = (compptr->v_samp_factor * compptr->_DCT_scaled_size) /\n      cinfo->_min_DCT_scaled_size; /* height of a row group of component */\n    main_ptr->buffer[ci] = (*cinfo->mem->alloc_sarray)\n                        ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                         compptr->width_in_blocks * compptr->_DCT_scaled_size,\n                         (JDIMENSION) (rgroup * ngroups));\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdmainct.h",
    "content": "/*\n * jdmainct.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n */\n\n#define JPEG_INTERNALS\n#include \"jpeglib.h\"\n#include \"jpegcomp.h\"\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_d_main_controller pub; /* public fields */\n\n  /* Pointer to allocated workspace (M or M+2 row groups). */\n  JSAMPARRAY buffer[MAX_COMPONENTS];\n\n  boolean buffer_full;          /* Have we gotten an iMCU row from decoder? */\n  JDIMENSION rowgroup_ctr;      /* counts row groups output to postprocessor */\n\n  /* Remaining fields are only used in the context case. */\n\n  /* These are the master pointers to the funny-order pointer lists. */\n  JSAMPIMAGE xbuffer[2];        /* pointers to weird pointer lists */\n\n  int whichptr;                 /* indicates which pointer set is now in use */\n  int context_state;            /* process_data state machine status */\n  JDIMENSION rowgroups_avail;   /* row groups available to postprocessor */\n  JDIMENSION iMCU_row_ctr;      /* counts iMCU rows to detect image top/bot */\n} my_main_controller;\n\ntypedef my_main_controller *my_main_ptr;\n\n\n/* context_state values: */\n#define CTX_PREPARE_FOR_IMCU    0       /* need to prepare for MCU row */\n#define CTX_PROCESS_IMCU        1       /* feeding iMCU to postprocessor */\n#define CTX_POSTPONED_ROW       2       /* feeding postponed row group */\n\n\nLOCAL(void)\nset_wraparound_pointers (j_decompress_ptr cinfo)\n/* Set up the \"wraparound\" pointers at top and bottom of the pointer lists.\n * This changes the pointer list state from top-of-image to the normal state.\n */\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n  int ci, i, rgroup;\n  int M = cinfo->_min_DCT_scaled_size;\n  jpeg_component_info *compptr;\n  JSAMPARRAY xbuf0, xbuf1;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    rgroup = (compptr->v_samp_factor * compptr->_DCT_scaled_size) /\n      cinfo->_min_DCT_scaled_size; /* height of a row group of component */\n    xbuf0 = main_ptr->xbuffer[0][ci];\n    xbuf1 = main_ptr->xbuffer[1][ci];\n    for (i = 0; i < rgroup; i++) {\n      xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i];\n      xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i];\n      xbuf0[rgroup*(M+2) + i] = xbuf0[i];\n      xbuf1[rgroup*(M+2) + i] = xbuf1[i];\n    }\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdmarker.c",
    "content": "/*\n * jdmarker.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2012, 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains routines to decode JPEG datastream markers.\n * Most of the complexity arises from our desire to support input\n * suspension: if not all of the data for a marker is available,\n * we must exit back to the application.  On resumption, we reprocess\n * the marker.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\ntypedef enum {                  /* JPEG marker codes */\n  M_SOF0  = 0xc0,\n  M_SOF1  = 0xc1,\n  M_SOF2  = 0xc2,\n  M_SOF3  = 0xc3,\n\n  M_SOF5  = 0xc5,\n  M_SOF6  = 0xc6,\n  M_SOF7  = 0xc7,\n\n  M_JPG   = 0xc8,\n  M_SOF9  = 0xc9,\n  M_SOF10 = 0xca,\n  M_SOF11 = 0xcb,\n\n  M_SOF13 = 0xcd,\n  M_SOF14 = 0xce,\n  M_SOF15 = 0xcf,\n\n  M_DHT   = 0xc4,\n\n  M_DAC   = 0xcc,\n\n  M_RST0  = 0xd0,\n  M_RST1  = 0xd1,\n  M_RST2  = 0xd2,\n  M_RST3  = 0xd3,\n  M_RST4  = 0xd4,\n  M_RST5  = 0xd5,\n  M_RST6  = 0xd6,\n  M_RST7  = 0xd7,\n\n  M_SOI   = 0xd8,\n  M_EOI   = 0xd9,\n  M_SOS   = 0xda,\n  M_DQT   = 0xdb,\n  M_DNL   = 0xdc,\n  M_DRI   = 0xdd,\n  M_DHP   = 0xde,\n  M_EXP   = 0xdf,\n\n  M_APP0  = 0xe0,\n  M_APP1  = 0xe1,\n  M_APP2  = 0xe2,\n  M_APP3  = 0xe3,\n  M_APP4  = 0xe4,\n  M_APP5  = 0xe5,\n  M_APP6  = 0xe6,\n  M_APP7  = 0xe7,\n  M_APP8  = 0xe8,\n  M_APP9  = 0xe9,\n  M_APP10 = 0xea,\n  M_APP11 = 0xeb,\n  M_APP12 = 0xec,\n  M_APP13 = 0xed,\n  M_APP14 = 0xee,\n  M_APP15 = 0xef,\n\n  M_JPG0  = 0xf0,\n  M_JPG13 = 0xfd,\n  M_COM   = 0xfe,\n\n  M_TEM   = 0x01,\n\n  M_ERROR = 0x100\n} JPEG_MARKER;\n\n\n/* Private state */\n\ntypedef struct {\n  struct jpeg_marker_reader pub; /* public fields */\n\n  /* Application-overridable marker processing methods */\n  jpeg_marker_parser_method process_COM;\n  jpeg_marker_parser_method process_APPn[16];\n\n  /* Limit on marker data length to save for each marker type */\n  unsigned int length_limit_COM;\n  unsigned int length_limit_APPn[16];\n\n  /* Status of COM/APPn marker saving */\n  jpeg_saved_marker_ptr cur_marker;     /* NULL if not processing a marker */\n  unsigned int bytes_read;              /* data bytes read so far in marker */\n  /* Note: cur_marker is not linked into marker_list until it's all read. */\n} my_marker_reader;\n\ntypedef my_marker_reader *my_marker_ptr;\n\n\n/*\n * Macros for fetching data from the data source module.\n *\n * At all times, cinfo->src->next_input_byte and ->bytes_in_buffer reflect\n * the current restart point; we update them only when we have reached a\n * suitable place to restart if a suspension occurs.\n */\n\n/* Declare and initialize local copies of input pointer/count */\n#define INPUT_VARS(cinfo)  \\\n        struct jpeg_source_mgr *datasrc = (cinfo)->src;  \\\n        const JOCTET *next_input_byte = datasrc->next_input_byte;  \\\n        size_t bytes_in_buffer = datasrc->bytes_in_buffer\n\n/* Unload the local copies --- do this only at a restart boundary */\n#define INPUT_SYNC(cinfo)  \\\n        ( datasrc->next_input_byte = next_input_byte,  \\\n          datasrc->bytes_in_buffer = bytes_in_buffer )\n\n/* Reload the local copies --- used only in MAKE_BYTE_AVAIL */\n#define INPUT_RELOAD(cinfo)  \\\n        ( next_input_byte = datasrc->next_input_byte,  \\\n          bytes_in_buffer = datasrc->bytes_in_buffer )\n\n/* Internal macro for INPUT_BYTE and INPUT_2BYTES: make a byte available.\n * Note we do *not* do INPUT_SYNC before calling fill_input_buffer,\n * but we must reload the local copies after a successful fill.\n */\n#define MAKE_BYTE_AVAIL(cinfo,action)  \\\n        if (bytes_in_buffer == 0) {  \\\n          if (! (*datasrc->fill_input_buffer) (cinfo))  \\\n            { action; }  \\\n          INPUT_RELOAD(cinfo);  \\\n        }\n\n/* Read a byte into variable V.\n * If must suspend, take the specified action (typically \"return FALSE\").\n */\n#define INPUT_BYTE(cinfo,V,action)  \\\n        MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \\\n                  bytes_in_buffer--; \\\n                  V = GETJOCTET(*next_input_byte++); )\n\n/* As above, but read two bytes interpreted as an unsigned 16-bit integer.\n * V should be declared unsigned int or perhaps JLONG.\n */\n#define INPUT_2BYTES(cinfo,V,action)  \\\n        MAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \\\n                  bytes_in_buffer--; \\\n                  V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \\\n                  MAKE_BYTE_AVAIL(cinfo,action); \\\n                  bytes_in_buffer--; \\\n                  V += GETJOCTET(*next_input_byte++); )\n\n\n/*\n * Routines to process JPEG markers.\n *\n * Entry condition: JPEG marker itself has been read and its code saved\n *   in cinfo->unread_marker; input restart point is just after the marker.\n *\n * Exit: if return TRUE, have read and processed any parameters, and have\n *   updated the restart point to point after the parameters.\n *   If return FALSE, was forced to suspend before reaching end of\n *   marker parameters; restart point has not been moved.  Same routine\n *   will be called again after application supplies more input data.\n *\n * This approach to suspension assumes that all of a marker's parameters\n * can fit into a single input bufferload.  This should hold for \"normal\"\n * markers.  Some COM/APPn markers might have large parameter segments\n * that might not fit.  If we are simply dropping such a marker, we use\n * skip_input_data to get past it, and thereby put the problem on the\n * source manager's shoulders.  If we are saving the marker's contents\n * into memory, we use a slightly different convention: when forced to\n * suspend, the marker processor updates the restart point to the end of\n * what it's consumed (ie, the end of the buffer) before returning FALSE.\n * On resumption, cinfo->unread_marker still contains the marker code,\n * but the data source will point to the next chunk of marker data.\n * The marker processor must retain internal state to deal with this.\n *\n * Note that we don't bother to avoid duplicate trace messages if a\n * suspension occurs within marker parameters.  Other side effects\n * require more care.\n */\n\n\nLOCAL(boolean)\nget_soi (j_decompress_ptr cinfo)\n/* Process an SOI marker */\n{\n  int i;\n\n  TRACEMS(cinfo, 1, JTRC_SOI);\n\n  if (cinfo->marker->saw_SOI)\n    ERREXIT(cinfo, JERR_SOI_DUPLICATE);\n\n  /* Reset all parameters that are defined to be reset by SOI */\n\n  for (i = 0; i < NUM_ARITH_TBLS; i++) {\n    cinfo->arith_dc_L[i] = 0;\n    cinfo->arith_dc_U[i] = 1;\n    cinfo->arith_ac_K[i] = 5;\n  }\n  cinfo->restart_interval = 0;\n\n  /* Set initial assumptions for colorspace etc */\n\n  cinfo->jpeg_color_space = JCS_UNKNOWN;\n  cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */\n\n  cinfo->saw_JFIF_marker = FALSE;\n  cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */\n  cinfo->JFIF_minor_version = 1;\n  cinfo->density_unit = 0;\n  cinfo->X_density = 1;\n  cinfo->Y_density = 1;\n  cinfo->saw_Adobe_marker = FALSE;\n  cinfo->Adobe_transform = 0;\n\n  cinfo->marker->saw_SOI = TRUE;\n\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nget_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith)\n/* Process a SOFn marker */\n{\n  JLONG length;\n  int c, ci;\n  jpeg_component_info *compptr;\n  INPUT_VARS(cinfo);\n\n  cinfo->progressive_mode = is_prog;\n  cinfo->arith_code = is_arith;\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n\n  INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE);\n  INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE);\n  INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE);\n  INPUT_BYTE(cinfo, cinfo->num_components, return FALSE);\n\n  length -= 8;\n\n  TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker,\n           (int) cinfo->image_width, (int) cinfo->image_height,\n           cinfo->num_components);\n\n  if (cinfo->marker->saw_SOF)\n    ERREXIT(cinfo, JERR_SOF_DUPLICATE);\n\n  /* We don't support files in which the image height is initially specified */\n  /* as 0 and is later redefined by DNL.  As long as we have to check that,  */\n  /* might as well have a general sanity check. */\n  if (cinfo->image_height <= 0 || cinfo->image_width <= 0\n      || cinfo->num_components <= 0)\n    ERREXIT(cinfo, JERR_EMPTY_IMAGE);\n\n  if (length != (cinfo->num_components * 3))\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  if (cinfo->comp_info == NULL) /* do only once, even if suspend */\n    cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small)\n                        ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                         cinfo->num_components * sizeof(jpeg_component_info));\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    compptr->component_index = ci;\n    INPUT_BYTE(cinfo, compptr->component_id, return FALSE);\n    INPUT_BYTE(cinfo, c, return FALSE);\n    compptr->h_samp_factor = (c >> 4) & 15;\n    compptr->v_samp_factor = (c     ) & 15;\n    INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE);\n\n    TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT,\n             compptr->component_id, compptr->h_samp_factor,\n             compptr->v_samp_factor, compptr->quant_tbl_no);\n  }\n\n  cinfo->marker->saw_SOF = TRUE;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nget_sos (j_decompress_ptr cinfo)\n/* Process a SOS marker */\n{\n  JLONG length;\n  int i, ci, n, c, cc, pi;\n  jpeg_component_info *compptr;\n  INPUT_VARS(cinfo);\n\n  if (! cinfo->marker->saw_SOF)\n    ERREXIT(cinfo, JERR_SOS_NO_SOF);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n\n  INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */\n\n  TRACEMS1(cinfo, 1, JTRC_SOS, n);\n\n  if (length != (n * 2 + 6) || n < 1 || n > MAX_COMPS_IN_SCAN)\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  cinfo->comps_in_scan = n;\n\n  /* Collect the component-spec parameters */\n\n  for (i = 0; i < MAX_COMPS_IN_SCAN; i++)\n    cinfo->cur_comp_info[i] = NULL;\n\n  for (i = 0; i < n; i++) {\n    INPUT_BYTE(cinfo, cc, return FALSE);\n    INPUT_BYTE(cinfo, c, return FALSE);\n\n    for (ci = 0, compptr = cinfo->comp_info;\n         ci < cinfo->num_components && ci < MAX_COMPS_IN_SCAN;\n         ci++, compptr++) {\n      if (cc == compptr->component_id && !cinfo->cur_comp_info[ci])\n        goto id_found;\n    }\n\n    ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);\n\n  id_found:\n\n    cinfo->cur_comp_info[i] = compptr;\n    compptr->dc_tbl_no = (c >> 4) & 15;\n    compptr->ac_tbl_no = (c     ) & 15;\n\n    TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,\n             compptr->dc_tbl_no, compptr->ac_tbl_no);\n\n    /* This CSi (cc) should differ from the previous CSi */\n    for (pi = 0; pi < i; pi++) {\n      if (cinfo->cur_comp_info[pi] == compptr) {\n        ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);\n      }\n    }\n  }\n\n  /* Collect the additional scan parameters Ss, Se, Ah/Al. */\n  INPUT_BYTE(cinfo, c, return FALSE);\n  cinfo->Ss = c;\n  INPUT_BYTE(cinfo, c, return FALSE);\n  cinfo->Se = c;\n  INPUT_BYTE(cinfo, c, return FALSE);\n  cinfo->Ah = (c >> 4) & 15;\n  cinfo->Al = (c     ) & 15;\n\n  TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se,\n           cinfo->Ah, cinfo->Al);\n\n  /* Prepare to scan data & restart markers */\n  cinfo->marker->next_restart_num = 0;\n\n  /* Count another SOS marker */\n  cinfo->input_scan_number++;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\n#ifdef D_ARITH_CODING_SUPPORTED\n\nLOCAL(boolean)\nget_dac (j_decompress_ptr cinfo)\n/* Process a DAC marker */\n{\n  JLONG length;\n  int index, val;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  length -= 2;\n\n  while (length > 0) {\n    INPUT_BYTE(cinfo, index, return FALSE);\n    INPUT_BYTE(cinfo, val, return FALSE);\n\n    length -= 2;\n\n    TRACEMS2(cinfo, 1, JTRC_DAC, index, val);\n\n    if (index < 0 || index >= (2*NUM_ARITH_TBLS))\n      ERREXIT1(cinfo, JERR_DAC_INDEX, index);\n\n    if (index >= NUM_ARITH_TBLS) { /* define AC table */\n      cinfo->arith_ac_K[index-NUM_ARITH_TBLS] = (UINT8) val;\n    } else {                    /* define DC table */\n      cinfo->arith_dc_L[index] = (UINT8) (val & 0x0F);\n      cinfo->arith_dc_U[index] = (UINT8) (val >> 4);\n      if (cinfo->arith_dc_L[index] > cinfo->arith_dc_U[index])\n        ERREXIT1(cinfo, JERR_DAC_VALUE, val);\n    }\n  }\n\n  if (length != 0)\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n#else /* ! D_ARITH_CODING_SUPPORTED */\n\n#define get_dac(cinfo)  skip_variable(cinfo)\n\n#endif /* D_ARITH_CODING_SUPPORTED */\n\n\nLOCAL(boolean)\nget_dht (j_decompress_ptr cinfo)\n/* Process a DHT marker */\n{\n  JLONG length;\n  UINT8 bits[17];\n  UINT8 huffval[256];\n  int i, index, count;\n  JHUFF_TBL **htblptr;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  length -= 2;\n\n  while (length > 16) {\n    INPUT_BYTE(cinfo, index, return FALSE);\n\n    TRACEMS1(cinfo, 1, JTRC_DHT, index);\n\n    bits[0] = 0;\n    count = 0;\n    for (i = 1; i <= 16; i++) {\n      INPUT_BYTE(cinfo, bits[i], return FALSE);\n      count += bits[i];\n    }\n\n    length -= 1 + 16;\n\n    TRACEMS8(cinfo, 2, JTRC_HUFFBITS,\n             bits[1], bits[2], bits[3], bits[4],\n             bits[5], bits[6], bits[7], bits[8]);\n    TRACEMS8(cinfo, 2, JTRC_HUFFBITS,\n             bits[9], bits[10], bits[11], bits[12],\n             bits[13], bits[14], bits[15], bits[16]);\n\n    /* Here we just do minimal validation of the counts to avoid walking\n     * off the end of our table space.  jdhuff.c will check more carefully.\n     */\n    if (count > 256 || ((JLONG) count) > length)\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n\n    for (i = 0; i < count; i++)\n      INPUT_BYTE(cinfo, huffval[i], return FALSE);\n\n    MEMZERO(&huffval[count], (256 - count) * sizeof(UINT8));\n\n    length -= count;\n\n    if (index & 0x10) {         /* AC table definition */\n      index -= 0x10;\n      if (index < 0 || index >= NUM_HUFF_TBLS)\n        ERREXIT1(cinfo, JERR_DHT_INDEX, index);\n      htblptr = &cinfo->ac_huff_tbl_ptrs[index];\n    } else {                    /* DC table definition */\n      if (index < 0 || index >= NUM_HUFF_TBLS)\n        ERREXIT1(cinfo, JERR_DHT_INDEX, index);\n      htblptr = &cinfo->dc_huff_tbl_ptrs[index];\n    }\n\n    if (*htblptr == NULL)\n      *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);\n\n    MEMCOPY((*htblptr)->bits, bits, sizeof((*htblptr)->bits));\n    MEMCOPY((*htblptr)->huffval, huffval, sizeof((*htblptr)->huffval));\n  }\n\n  if (length != 0)\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nget_dqt (j_decompress_ptr cinfo)\n/* Process a DQT marker */\n{\n  JLONG length;\n  int n, i, prec;\n  unsigned int tmp;\n  JQUANT_TBL *quant_ptr;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  length -= 2;\n\n  while (length > 0) {\n    INPUT_BYTE(cinfo, n, return FALSE);\n    prec = n >> 4;\n    n &= 0x0F;\n\n    TRACEMS2(cinfo, 1, JTRC_DQT, n, prec);\n\n    if (n >= NUM_QUANT_TBLS)\n      ERREXIT1(cinfo, JERR_DQT_INDEX, n);\n\n    if (cinfo->quant_tbl_ptrs[n] == NULL)\n      cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo);\n    quant_ptr = cinfo->quant_tbl_ptrs[n];\n\n    for (i = 0; i < DCTSIZE2; i++) {\n      if (prec)\n        INPUT_2BYTES(cinfo, tmp, return FALSE);\n      else\n        INPUT_BYTE(cinfo, tmp, return FALSE);\n      /* We convert the zigzag-order table to natural array order. */\n      quant_ptr->quantval[jpeg_natural_order[i]] = (UINT16) tmp;\n    }\n\n    if (cinfo->err->trace_level >= 2) {\n      for (i = 0; i < DCTSIZE2; i += 8) {\n        TRACEMS8(cinfo, 2, JTRC_QUANTVALS,\n                 quant_ptr->quantval[i],   quant_ptr->quantval[i+1],\n                 quant_ptr->quantval[i+2], quant_ptr->quantval[i+3],\n                 quant_ptr->quantval[i+4], quant_ptr->quantval[i+5],\n                 quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]);\n      }\n    }\n\n    length -= DCTSIZE2+1;\n    if (prec) length -= DCTSIZE2;\n  }\n\n  if (length != 0)\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nget_dri (j_decompress_ptr cinfo)\n/* Process a DRI marker */\n{\n  JLONG length;\n  unsigned int tmp;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n\n  if (length != 4)\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  INPUT_2BYTES(cinfo, tmp, return FALSE);\n\n  TRACEMS1(cinfo, 1, JTRC_DRI, tmp);\n\n  cinfo->restart_interval = tmp;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\n/*\n * Routines for processing APPn and COM markers.\n * These are either saved in memory or discarded, per application request.\n * APP0 and APP14 are specially checked to see if they are\n * JFIF and Adobe markers, respectively.\n */\n\n#define APP0_DATA_LEN   14      /* Length of interesting data in APP0 */\n#define APP14_DATA_LEN  12      /* Length of interesting data in APP14 */\n#define APPN_DATA_LEN   14      /* Must be the largest of the above!! */\n\n\nLOCAL(void)\nexamine_app0 (j_decompress_ptr cinfo, JOCTET *data,\n              unsigned int datalen, JLONG remaining)\n/* Examine first few bytes from an APP0.\n * Take appropriate action if it is a JFIF marker.\n * datalen is # of bytes at data[], remaining is length of rest of marker data.\n */\n{\n  JLONG totallen = (JLONG) datalen + remaining;\n\n  if (datalen >= APP0_DATA_LEN &&\n      GETJOCTET(data[0]) == 0x4A &&\n      GETJOCTET(data[1]) == 0x46 &&\n      GETJOCTET(data[2]) == 0x49 &&\n      GETJOCTET(data[3]) == 0x46 &&\n      GETJOCTET(data[4]) == 0) {\n    /* Found JFIF APP0 marker: save info */\n    cinfo->saw_JFIF_marker = TRUE;\n    cinfo->JFIF_major_version = GETJOCTET(data[5]);\n    cinfo->JFIF_minor_version = GETJOCTET(data[6]);\n    cinfo->density_unit = GETJOCTET(data[7]);\n    cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]);\n    cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]);\n    /* Check version.\n     * Major version must be 1, anything else signals an incompatible change.\n     * (We used to treat this as an error, but now it's a nonfatal warning,\n     * because some bozo at Hijaak couldn't read the spec.)\n     * Minor version should be 0..2, but process anyway if newer.\n     */\n    if (cinfo->JFIF_major_version != 1)\n      WARNMS2(cinfo, JWRN_JFIF_MAJOR,\n              cinfo->JFIF_major_version, cinfo->JFIF_minor_version);\n    /* Generate trace messages */\n    TRACEMS5(cinfo, 1, JTRC_JFIF,\n             cinfo->JFIF_major_version, cinfo->JFIF_minor_version,\n             cinfo->X_density, cinfo->Y_density, cinfo->density_unit);\n    /* Validate thumbnail dimensions and issue appropriate messages */\n    if (GETJOCTET(data[12]) | GETJOCTET(data[13]))\n      TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL,\n               GETJOCTET(data[12]), GETJOCTET(data[13]));\n    totallen -= APP0_DATA_LEN;\n    if (totallen !=\n        ((JLONG)GETJOCTET(data[12]) * (JLONG)GETJOCTET(data[13]) * (JLONG) 3))\n      TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen);\n  } else if (datalen >= 6 &&\n      GETJOCTET(data[0]) == 0x4A &&\n      GETJOCTET(data[1]) == 0x46 &&\n      GETJOCTET(data[2]) == 0x58 &&\n      GETJOCTET(data[3]) == 0x58 &&\n      GETJOCTET(data[4]) == 0) {\n    /* Found JFIF \"JFXX\" extension APP0 marker */\n    /* The library doesn't actually do anything with these,\n     * but we try to produce a helpful trace message.\n     */\n    switch (GETJOCTET(data[5])) {\n    case 0x10:\n      TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int) totallen);\n      break;\n    case 0x11:\n      TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, (int) totallen);\n      break;\n    case 0x13:\n      TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int) totallen);\n      break;\n    default:\n      TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION,\n               GETJOCTET(data[5]), (int) totallen);\n      break;\n    }\n  } else {\n    /* Start of APP0 does not match \"JFIF\" or \"JFXX\", or too short */\n    TRACEMS1(cinfo, 1, JTRC_APP0, (int) totallen);\n  }\n}\n\n\nLOCAL(void)\nexamine_app14 (j_decompress_ptr cinfo, JOCTET *data,\n               unsigned int datalen, JLONG remaining)\n/* Examine first few bytes from an APP14.\n * Take appropriate action if it is an Adobe marker.\n * datalen is # of bytes at data[], remaining is length of rest of marker data.\n */\n{\n  unsigned int version, flags0, flags1, transform;\n\n  if (datalen >= APP14_DATA_LEN &&\n      GETJOCTET(data[0]) == 0x41 &&\n      GETJOCTET(data[1]) == 0x64 &&\n      GETJOCTET(data[2]) == 0x6F &&\n      GETJOCTET(data[3]) == 0x62 &&\n      GETJOCTET(data[4]) == 0x65) {\n    /* Found Adobe APP14 marker */\n    version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]);\n    flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]);\n    flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]);\n    transform = GETJOCTET(data[11]);\n    TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);\n    cinfo->saw_Adobe_marker = TRUE;\n    cinfo->Adobe_transform = (UINT8) transform;\n  } else {\n    /* Start of APP14 does not match \"Adobe\", or too short */\n    TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining));\n  }\n}\n\n\nMETHODDEF(boolean)\nget_interesting_appn (j_decompress_ptr cinfo)\n/* Process an APP0 or APP14 marker without saving it */\n{\n  JLONG length;\n  JOCTET b[APPN_DATA_LEN];\n  unsigned int i, numtoread;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  length -= 2;\n\n  /* get the interesting part of the marker data */\n  if (length >= APPN_DATA_LEN)\n    numtoread = APPN_DATA_LEN;\n  else if (length > 0)\n    numtoread = (unsigned int) length;\n  else\n    numtoread = 0;\n  for (i = 0; i < numtoread; i++)\n    INPUT_BYTE(cinfo, b[i], return FALSE);\n  length -= numtoread;\n\n  /* process it */\n  switch (cinfo->unread_marker) {\n  case M_APP0:\n    examine_app0(cinfo, (JOCTET *) b, numtoread, length);\n    break;\n  case M_APP14:\n    examine_app14(cinfo, (JOCTET *) b, numtoread, length);\n    break;\n  default:\n    /* can't get here unless jpeg_save_markers chooses wrong processor */\n    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);\n    break;\n  }\n\n  /* skip any remaining data -- could be lots */\n  INPUT_SYNC(cinfo);\n  if (length > 0)\n    (*cinfo->src->skip_input_data) (cinfo, (long) length);\n\n  return TRUE;\n}\n\n\n#ifdef SAVE_MARKERS_SUPPORTED\n\nMETHODDEF(boolean)\nsave_marker (j_decompress_ptr cinfo)\n/* Save an APPn or COM marker into the marker list */\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n  jpeg_saved_marker_ptr cur_marker = marker->cur_marker;\n  unsigned int bytes_read, data_length;\n  JOCTET *data;\n  JLONG length = 0;\n  INPUT_VARS(cinfo);\n\n  if (cur_marker == NULL) {\n    /* begin reading a marker */\n    INPUT_2BYTES(cinfo, length, return FALSE);\n    length -= 2;\n    if (length >= 0) {          /* watch out for bogus length word */\n      /* figure out how much we want to save */\n      unsigned int limit;\n      if (cinfo->unread_marker == (int) M_COM)\n        limit = marker->length_limit_COM;\n      else\n        limit = marker->length_limit_APPn[cinfo->unread_marker - (int) M_APP0];\n      if ((unsigned int) length < limit)\n        limit = (unsigned int) length;\n      /* allocate and initialize the marker item */\n      cur_marker = (jpeg_saved_marker_ptr)\n        (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                    sizeof(struct jpeg_marker_struct) + limit);\n      cur_marker->next = NULL;\n      cur_marker->marker = (UINT8) cinfo->unread_marker;\n      cur_marker->original_length = (unsigned int) length;\n      cur_marker->data_length = limit;\n      /* data area is just beyond the jpeg_marker_struct */\n      data = cur_marker->data = (JOCTET *) (cur_marker + 1);\n      marker->cur_marker = cur_marker;\n      marker->bytes_read = 0;\n      bytes_read = 0;\n      data_length = limit;\n    } else {\n      /* deal with bogus length word */\n      bytes_read = data_length = 0;\n      data = NULL;\n    }\n  } else {\n    /* resume reading a marker */\n    bytes_read = marker->bytes_read;\n    data_length = cur_marker->data_length;\n    data = cur_marker->data + bytes_read;\n  }\n\n  while (bytes_read < data_length) {\n    INPUT_SYNC(cinfo);          /* move the restart point to here */\n    marker->bytes_read = bytes_read;\n    /* If there's not at least one byte in buffer, suspend */\n    MAKE_BYTE_AVAIL(cinfo, return FALSE);\n    /* Copy bytes with reasonable rapidity */\n    while (bytes_read < data_length && bytes_in_buffer > 0) {\n      *data++ = *next_input_byte++;\n      bytes_in_buffer--;\n      bytes_read++;\n    }\n  }\n\n  /* Done reading what we want to read */\n  if (cur_marker != NULL) {     /* will be NULL if bogus length word */\n    /* Add new marker to end of list */\n    if (cinfo->marker_list == NULL) {\n      cinfo->marker_list = cur_marker;\n    } else {\n      jpeg_saved_marker_ptr prev = cinfo->marker_list;\n      while (prev->next != NULL)\n        prev = prev->next;\n      prev->next = cur_marker;\n    }\n    /* Reset pointer & calc remaining data length */\n    data = cur_marker->data;\n    length = cur_marker->original_length - data_length;\n  }\n  /* Reset to initial state for next marker */\n  marker->cur_marker = NULL;\n\n  /* Process the marker if interesting; else just make a generic trace msg */\n  switch (cinfo->unread_marker) {\n  case M_APP0:\n    examine_app0(cinfo, data, data_length, length);\n    break;\n  case M_APP14:\n    examine_app14(cinfo, data, data_length, length);\n    break;\n  default:\n    TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker,\n             (int) (data_length + length));\n    break;\n  }\n\n  /* skip any remaining data -- could be lots */\n  INPUT_SYNC(cinfo);            /* do before skip_input_data */\n  if (length > 0)\n    (*cinfo->src->skip_input_data) (cinfo, (long) length);\n\n  return TRUE;\n}\n\n#endif /* SAVE_MARKERS_SUPPORTED */\n\n\nMETHODDEF(boolean)\nskip_variable (j_decompress_ptr cinfo)\n/* Skip over an unknown or uninteresting variable-length marker */\n{\n  JLONG length;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  length -= 2;\n\n  TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length);\n\n  INPUT_SYNC(cinfo);            /* do before skip_input_data */\n  if (length > 0)\n    (*cinfo->src->skip_input_data) (cinfo, (long) length);\n\n  return TRUE;\n}\n\n\n/*\n * Find the next JPEG marker, save it in cinfo->unread_marker.\n * Returns FALSE if had to suspend before reaching a marker;\n * in that case cinfo->unread_marker is unchanged.\n *\n * Note that the result might not be a valid marker code,\n * but it will never be 0 or FF.\n */\n\nLOCAL(boolean)\nnext_marker (j_decompress_ptr cinfo)\n{\n  int c;\n  INPUT_VARS(cinfo);\n\n  for (;;) {\n    INPUT_BYTE(cinfo, c, return FALSE);\n    /* Skip any non-FF bytes.\n     * This may look a bit inefficient, but it will not occur in a valid file.\n     * We sync after each discarded byte so that a suspending data source\n     * can discard the byte from its buffer.\n     */\n    while (c != 0xFF) {\n      cinfo->marker->discarded_bytes++;\n      INPUT_SYNC(cinfo);\n      INPUT_BYTE(cinfo, c, return FALSE);\n    }\n    /* This loop swallows any duplicate FF bytes.  Extra FFs are legal as\n     * pad bytes, so don't count them in discarded_bytes.  We assume there\n     * will not be so many consecutive FF bytes as to overflow a suspending\n     * data source's input buffer.\n     */\n    do {\n      INPUT_BYTE(cinfo, c, return FALSE);\n    } while (c == 0xFF);\n    if (c != 0)\n      break;                    /* found a valid marker, exit loop */\n    /* Reach here if we found a stuffed-zero data sequence (FF/00).\n     * Discard it and loop back to try again.\n     */\n    cinfo->marker->discarded_bytes += 2;\n    INPUT_SYNC(cinfo);\n  }\n\n  if (cinfo->marker->discarded_bytes != 0) {\n    WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c);\n    cinfo->marker->discarded_bytes = 0;\n  }\n\n  cinfo->unread_marker = c;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nfirst_marker (j_decompress_ptr cinfo)\n/* Like next_marker, but used to obtain the initial SOI marker. */\n/* For this marker, we do not allow preceding garbage or fill; otherwise,\n * we might well scan an entire input file before realizing it ain't JPEG.\n * If an application wants to process non-JFIF files, it must seek to the\n * SOI before calling the JPEG library.\n */\n{\n  int c, c2;\n  INPUT_VARS(cinfo);\n\n  INPUT_BYTE(cinfo, c, return FALSE);\n  INPUT_BYTE(cinfo, c2, return FALSE);\n  if (c != 0xFF || c2 != (int) M_SOI)\n    ERREXIT2(cinfo, JERR_NO_SOI, c, c2);\n\n  cinfo->unread_marker = c2;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\n/*\n * Read markers until SOS or EOI.\n *\n * Returns same codes as are defined for jpeg_consume_input:\n * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.\n */\n\nMETHODDEF(int)\nread_markers (j_decompress_ptr cinfo)\n{\n  /* Outer loop repeats once for each marker. */\n  for (;;) {\n    /* Collect the marker proper, unless we already did. */\n    /* NB: first_marker() enforces the requirement that SOI appear first. */\n    if (cinfo->unread_marker == 0) {\n      if (! cinfo->marker->saw_SOI) {\n        if (! first_marker(cinfo))\n          return JPEG_SUSPENDED;\n      } else {\n        if (! next_marker(cinfo))\n          return JPEG_SUSPENDED;\n      }\n    }\n    /* At this point cinfo->unread_marker contains the marker code and the\n     * input point is just past the marker proper, but before any parameters.\n     * A suspension will cause us to return with this state still true.\n     */\n    switch (cinfo->unread_marker) {\n    case M_SOI:\n      if (! get_soi(cinfo))\n        return JPEG_SUSPENDED;\n      break;\n\n    case M_SOF0:                /* Baseline */\n    case M_SOF1:                /* Extended sequential, Huffman */\n      if (! get_sof(cinfo, FALSE, FALSE))\n        return JPEG_SUSPENDED;\n      break;\n\n    case M_SOF2:                /* Progressive, Huffman */\n      if (! get_sof(cinfo, TRUE, FALSE))\n        return JPEG_SUSPENDED;\n      break;\n\n    case M_SOF9:                /* Extended sequential, arithmetic */\n      if (! get_sof(cinfo, FALSE, TRUE))\n        return JPEG_SUSPENDED;\n      break;\n\n    case M_SOF10:               /* Progressive, arithmetic */\n      if (! get_sof(cinfo, TRUE, TRUE))\n        return JPEG_SUSPENDED;\n      break;\n\n    /* Currently unsupported SOFn types */\n    case M_SOF3:                /* Lossless, Huffman */\n    case M_SOF5:                /* Differential sequential, Huffman */\n    case M_SOF6:                /* Differential progressive, Huffman */\n    case M_SOF7:                /* Differential lossless, Huffman */\n    case M_JPG:                 /* Reserved for JPEG extensions */\n    case M_SOF11:               /* Lossless, arithmetic */\n    case M_SOF13:               /* Differential sequential, arithmetic */\n    case M_SOF14:               /* Differential progressive, arithmetic */\n    case M_SOF15:               /* Differential lossless, arithmetic */\n      ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker);\n      break;\n\n    case M_SOS:\n      if (! get_sos(cinfo))\n        return JPEG_SUSPENDED;\n      cinfo->unread_marker = 0; /* processed the marker */\n      return JPEG_REACHED_SOS;\n\n    case M_EOI:\n      TRACEMS(cinfo, 1, JTRC_EOI);\n      cinfo->unread_marker = 0; /* processed the marker */\n      return JPEG_REACHED_EOI;\n\n    case M_DAC:\n      if (! get_dac(cinfo))\n        return JPEG_SUSPENDED;\n      break;\n\n    case M_DHT:\n      if (! get_dht(cinfo))\n        return JPEG_SUSPENDED;\n      break;\n\n    case M_DQT:\n      if (! get_dqt(cinfo))\n        return JPEG_SUSPENDED;\n      break;\n\n    case M_DRI:\n      if (! get_dri(cinfo))\n        return JPEG_SUSPENDED;\n      break;\n\n    case M_APP0:\n    case M_APP1:\n    case M_APP2:\n    case M_APP3:\n    case M_APP4:\n    case M_APP5:\n    case M_APP6:\n    case M_APP7:\n    case M_APP8:\n    case M_APP9:\n    case M_APP10:\n    case M_APP11:\n    case M_APP12:\n    case M_APP13:\n    case M_APP14:\n    case M_APP15:\n      if (! (*((my_marker_ptr) cinfo->marker)->process_APPn[\n                cinfo->unread_marker - (int) M_APP0]) (cinfo))\n        return JPEG_SUSPENDED;\n      break;\n\n    case M_COM:\n      if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo))\n        return JPEG_SUSPENDED;\n      break;\n\n    case M_RST0:                /* these are all parameterless */\n    case M_RST1:\n    case M_RST2:\n    case M_RST3:\n    case M_RST4:\n    case M_RST5:\n    case M_RST6:\n    case M_RST7:\n    case M_TEM:\n      TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker);\n      break;\n\n    case M_DNL:                 /* Ignore DNL ... perhaps the wrong thing */\n      if (! skip_variable(cinfo))\n        return JPEG_SUSPENDED;\n      break;\n\n    default:                    /* must be DHP, EXP, JPGn, or RESn */\n      /* For now, we treat the reserved markers as fatal errors since they are\n       * likely to be used to signal incompatible JPEG Part 3 extensions.\n       * Once the JPEG 3 version-number marker is well defined, this code\n       * ought to change!\n       */\n      ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);\n      break;\n    }\n    /* Successfully processed marker, so reset state variable */\n    cinfo->unread_marker = 0;\n  } /* end loop */\n}\n\n\n/*\n * Read a restart marker, which is expected to appear next in the datastream;\n * if the marker is not there, take appropriate recovery action.\n * Returns FALSE if suspension is required.\n *\n * This is called by the entropy decoder after it has read an appropriate\n * number of MCUs.  cinfo->unread_marker may be nonzero if the entropy decoder\n * has already read a marker from the data source.  Under normal conditions\n * cinfo->unread_marker will be reset to 0 before returning; if not reset,\n * it holds a marker which the decoder will be unable to read past.\n */\n\nMETHODDEF(boolean)\nread_restart_marker (j_decompress_ptr cinfo)\n{\n  /* Obtain a marker unless we already did. */\n  /* Note that next_marker will complain if it skips any data. */\n  if (cinfo->unread_marker == 0) {\n    if (! next_marker(cinfo))\n      return FALSE;\n  }\n\n  if (cinfo->unread_marker ==\n      ((int) M_RST0 + cinfo->marker->next_restart_num)) {\n    /* Normal case --- swallow the marker and let entropy decoder continue */\n    TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num);\n    cinfo->unread_marker = 0;\n  } else {\n    /* Uh-oh, the restart markers have been messed up. */\n    /* Let the data source manager determine how to resync. */\n    if (! (*cinfo->src->resync_to_restart) (cinfo,\n                                            cinfo->marker->next_restart_num))\n      return FALSE;\n  }\n\n  /* Update next-restart state */\n  cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7;\n\n  return TRUE;\n}\n\n\n/*\n * This is the default resync_to_restart method for data source managers\n * to use if they don't have any better approach.  Some data source managers\n * may be able to back up, or may have additional knowledge about the data\n * which permits a more intelligent recovery strategy; such managers would\n * presumably supply their own resync method.\n *\n * read_restart_marker calls resync_to_restart if it finds a marker other than\n * the restart marker it was expecting.  (This code is *not* used unless\n * a nonzero restart interval has been declared.)  cinfo->unread_marker is\n * the marker code actually found (might be anything, except 0 or FF).\n * The desired restart marker number (0..7) is passed as a parameter.\n * This routine is supposed to apply whatever error recovery strategy seems\n * appropriate in order to position the input stream to the next data segment.\n * Note that cinfo->unread_marker is treated as a marker appearing before\n * the current data-source input point; usually it should be reset to zero\n * before returning.\n * Returns FALSE if suspension is required.\n *\n * This implementation is substantially constrained by wanting to treat the\n * input as a data stream; this means we can't back up.  Therefore, we have\n * only the following actions to work with:\n *   1. Simply discard the marker and let the entropy decoder resume at next\n *      byte of file.\n *   2. Read forward until we find another marker, discarding intervening\n *      data.  (In theory we could look ahead within the current bufferload,\n *      without having to discard data if we don't find the desired marker.\n *      This idea is not implemented here, in part because it makes behavior\n *      dependent on buffer size and chance buffer-boundary positions.)\n *   3. Leave the marker unread (by failing to zero cinfo->unread_marker).\n *      This will cause the entropy decoder to process an empty data segment,\n *      inserting dummy zeroes, and then we will reprocess the marker.\n *\n * #2 is appropriate if we think the desired marker lies ahead, while #3 is\n * appropriate if the found marker is a future restart marker (indicating\n * that we have missed the desired restart marker, probably because it got\n * corrupted).\n * We apply #2 or #3 if the found marker is a restart marker no more than\n * two counts behind or ahead of the expected one.  We also apply #2 if the\n * found marker is not a legal JPEG marker code (it's certainly bogus data).\n * If the found marker is a restart marker more than 2 counts away, we do #1\n * (too much risk that the marker is erroneous; with luck we will be able to\n * resync at some future point).\n * For any valid non-restart JPEG marker, we apply #3.  This keeps us from\n * overrunning the end of a scan.  An implementation limited to single-scan\n * files might find it better to apply #2 for markers other than EOI, since\n * any other marker would have to be bogus data in that case.\n */\n\nGLOBAL(boolean)\njpeg_resync_to_restart (j_decompress_ptr cinfo, int desired)\n{\n  int marker = cinfo->unread_marker;\n  int action = 1;\n\n  /* Always put up a warning. */\n  WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired);\n\n  /* Outer loop handles repeated decision after scanning forward. */\n  for (;;) {\n    if (marker < (int) M_SOF0)\n      action = 2;               /* invalid marker */\n    else if (marker < (int) M_RST0 || marker > (int) M_RST7)\n      action = 3;               /* valid non-restart marker */\n    else {\n      if (marker == ((int) M_RST0 + ((desired+1) & 7)) ||\n          marker == ((int) M_RST0 + ((desired+2) & 7)))\n        action = 3;             /* one of the next two expected restarts */\n      else if (marker == ((int) M_RST0 + ((desired-1) & 7)) ||\n               marker == ((int) M_RST0 + ((desired-2) & 7)))\n        action = 2;             /* a prior restart, so advance */\n      else\n        action = 1;             /* desired restart or too far away */\n    }\n    TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action);\n    switch (action) {\n    case 1:\n      /* Discard marker and let entropy decoder resume processing. */\n      cinfo->unread_marker = 0;\n      return TRUE;\n    case 2:\n      /* Scan to the next marker, and repeat the decision loop. */\n      if (! next_marker(cinfo))\n        return FALSE;\n      marker = cinfo->unread_marker;\n      break;\n    case 3:\n      /* Return without advancing past this marker. */\n      /* Entropy decoder will be forced to process an empty segment. */\n      return TRUE;\n    }\n  } /* end loop */\n}\n\n\n/*\n * Reset marker processing state to begin a fresh datastream.\n */\n\nMETHODDEF(void)\nreset_marker_reader (j_decompress_ptr cinfo)\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n\n  cinfo->comp_info = NULL;              /* until allocated by get_sof */\n  cinfo->input_scan_number = 0;         /* no SOS seen yet */\n  cinfo->unread_marker = 0;             /* no pending marker */\n  marker->pub.saw_SOI = FALSE;          /* set internal state too */\n  marker->pub.saw_SOF = FALSE;\n  marker->pub.discarded_bytes = 0;\n  marker->cur_marker = NULL;\n}\n\n\n/*\n * Initialize the marker reader module.\n * This is called only once, when the decompression object is created.\n */\n\nGLOBAL(void)\njinit_marker_reader (j_decompress_ptr cinfo)\n{\n  my_marker_ptr marker;\n  int i;\n\n  /* Create subobject in permanent pool */\n  marker = (my_marker_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n                                sizeof(my_marker_reader));\n  cinfo->marker = (struct jpeg_marker_reader *) marker;\n  /* Initialize public method pointers */\n  marker->pub.reset_marker_reader = reset_marker_reader;\n  marker->pub.read_markers = read_markers;\n  marker->pub.read_restart_marker = read_restart_marker;\n  /* Initialize COM/APPn processing.\n   * By default, we examine and then discard APP0 and APP14,\n   * but simply discard COM and all other APPn.\n   */\n  marker->process_COM = skip_variable;\n  marker->length_limit_COM = 0;\n  for (i = 0; i < 16; i++) {\n    marker->process_APPn[i] = skip_variable;\n    marker->length_limit_APPn[i] = 0;\n  }\n  marker->process_APPn[0] = get_interesting_appn;\n  marker->process_APPn[14] = get_interesting_appn;\n  /* Reset marker processing state */\n  reset_marker_reader(cinfo);\n}\n\n\n/*\n * Control saving of COM and APPn markers into marker_list.\n */\n\n#ifdef SAVE_MARKERS_SUPPORTED\n\nGLOBAL(void)\njpeg_save_markers (j_decompress_ptr cinfo, int marker_code,\n                   unsigned int length_limit)\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n  long maxlength;\n  jpeg_marker_parser_method processor;\n\n  /* Length limit mustn't be larger than what we can allocate\n   * (should only be a concern in a 16-bit environment).\n   */\n  maxlength = cinfo->mem->max_alloc_chunk - sizeof(struct jpeg_marker_struct);\n  if (((long) length_limit) > maxlength)\n    length_limit = (unsigned int) maxlength;\n\n  /* Choose processor routine to use.\n   * APP0/APP14 have special requirements.\n   */\n  if (length_limit) {\n    processor = save_marker;\n    /* If saving APP0/APP14, save at least enough for our internal use. */\n    if (marker_code == (int) M_APP0 && length_limit < APP0_DATA_LEN)\n      length_limit = APP0_DATA_LEN;\n    else if (marker_code == (int) M_APP14 && length_limit < APP14_DATA_LEN)\n      length_limit = APP14_DATA_LEN;\n  } else {\n    processor = skip_variable;\n    /* If discarding APP0/APP14, use our regular on-the-fly processor. */\n    if (marker_code == (int) M_APP0 || marker_code == (int) M_APP14)\n      processor = get_interesting_appn;\n  }\n\n  if (marker_code == (int) M_COM) {\n    marker->process_COM = processor;\n    marker->length_limit_COM = length_limit;\n  } else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) {\n    marker->process_APPn[marker_code - (int) M_APP0] = processor;\n    marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit;\n  } else\n    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);\n}\n\n#endif /* SAVE_MARKERS_SUPPORTED */\n\n\n/*\n * Install a special processing method for COM or APPn markers.\n */\n\nGLOBAL(void)\njpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code,\n                           jpeg_marker_parser_method routine)\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n\n  if (marker_code == (int) M_COM)\n    marker->process_COM = routine;\n  else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15)\n    marker->process_APPn[marker_code - (int) M_APP0] = routine;\n  else\n    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdmaster.c",
    "content": "/*\n * jdmaster.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2002-2009 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009-2011, 2016, D. R. Commander.\n * Copyright (C) 2013, Linaro Limited.\n * Copyright (C) 2015, Google, Inc.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains master control logic for the JPEG decompressor.\n * These routines are concerned with selecting the modules to be executed\n * and with determining the number of passes and the work to be done in each\n * pass.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jpegcomp.h\"\n#include \"jdmaster.h\"\n\n\n/*\n * Determine whether merged upsample/color conversion should be used.\n * CRUCIAL: this must match the actual capabilities of jdmerge.c!\n */\n\nLOCAL(boolean)\nuse_merged_upsample (j_decompress_ptr cinfo)\n{\n#ifdef UPSAMPLE_MERGING_SUPPORTED\n  /* Merging is the equivalent of plain box-filter upsampling */\n  if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)\n    return FALSE;\n  /* jdmerge.c only supports YCC=>RGB and YCC=>RGB565 color conversion */\n  if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||\n      (cinfo->out_color_space != JCS_RGB &&\n      cinfo->out_color_space != JCS_RGB565 &&\n      cinfo->out_color_space != JCS_EXT_RGB &&\n      cinfo->out_color_space != JCS_EXT_RGBX &&\n      cinfo->out_color_space != JCS_EXT_BGR &&\n      cinfo->out_color_space != JCS_EXT_BGRX &&\n      cinfo->out_color_space != JCS_EXT_XBGR &&\n      cinfo->out_color_space != JCS_EXT_XRGB &&\n      cinfo->out_color_space != JCS_EXT_RGBA &&\n      cinfo->out_color_space != JCS_EXT_BGRA &&\n      cinfo->out_color_space != JCS_EXT_ABGR &&\n      cinfo->out_color_space != JCS_EXT_ARGB))\n    return FALSE;\n  if ((cinfo->out_color_space == JCS_RGB565 &&\n      cinfo->out_color_components != 3) ||\n      (cinfo->out_color_space != JCS_RGB565 &&\n      cinfo->out_color_components != rgb_pixelsize[cinfo->out_color_space]))\n    return FALSE;\n  /* and it only handles 2h1v or 2h2v sampling ratios */\n  if (cinfo->comp_info[0].h_samp_factor != 2 ||\n      cinfo->comp_info[1].h_samp_factor != 1 ||\n      cinfo->comp_info[2].h_samp_factor != 1 ||\n      cinfo->comp_info[0].v_samp_factor >  2 ||\n      cinfo->comp_info[1].v_samp_factor != 1 ||\n      cinfo->comp_info[2].v_samp_factor != 1)\n    return FALSE;\n  /* furthermore, it doesn't work if we've scaled the IDCTs differently */\n  if (cinfo->comp_info[0]._DCT_scaled_size != cinfo->_min_DCT_scaled_size ||\n      cinfo->comp_info[1]._DCT_scaled_size != cinfo->_min_DCT_scaled_size ||\n      cinfo->comp_info[2]._DCT_scaled_size != cinfo->_min_DCT_scaled_size)\n    return FALSE;\n  /* ??? also need to test for upsample-time rescaling, when & if supported */\n  return TRUE;                  /* by golly, it'll work... */\n#else\n  return FALSE;\n#endif\n}\n\n\n/*\n * Compute output image dimensions and related values.\n * NOTE: this is exported for possible use by application.\n * Hence it mustn't do anything that can't be done twice.\n */\n\n#if JPEG_LIB_VERSION >= 80\nGLOBAL(void)\n#else\nLOCAL(void)\n#endif\njpeg_core_output_dimensions (j_decompress_ptr cinfo)\n/* Do computations that are needed before master selection phase.\n * This function is used for transcoding and full decompression.\n */\n{\n#ifdef IDCT_SCALING_SUPPORTED\n  int ci;\n  jpeg_component_info *compptr;\n\n  /* Compute actual output image dimensions and DCT scaling choices. */\n  if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom) {\n    /* Provide 1/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 1;\n    cinfo->_min_DCT_v_scaled_size = 1;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 2) {\n    /* Provide 2/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 2L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 2L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 2;\n    cinfo->_min_DCT_v_scaled_size = 2;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 3) {\n    /* Provide 3/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 3L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 3L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 3;\n    cinfo->_min_DCT_v_scaled_size = 3;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 4) {\n    /* Provide 4/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 4L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 4L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 4;\n    cinfo->_min_DCT_v_scaled_size = 4;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 5) {\n    /* Provide 5/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 5L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 5L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 5;\n    cinfo->_min_DCT_v_scaled_size = 5;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 6) {\n    /* Provide 6/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 6L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 6L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 6;\n    cinfo->_min_DCT_v_scaled_size = 6;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 7) {\n    /* Provide 7/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 7L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 7L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 7;\n    cinfo->_min_DCT_v_scaled_size = 7;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 8) {\n    /* Provide 8/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 8L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 8L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 8;\n    cinfo->_min_DCT_v_scaled_size = 8;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 9) {\n    /* Provide 9/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 9L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 9L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 9;\n    cinfo->_min_DCT_v_scaled_size = 9;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 10) {\n    /* Provide 10/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 10L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 10L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 10;\n    cinfo->_min_DCT_v_scaled_size = 10;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 11) {\n    /* Provide 11/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 11L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 11L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 11;\n    cinfo->_min_DCT_v_scaled_size = 11;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 12) {\n    /* Provide 12/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 12L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 12L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 12;\n    cinfo->_min_DCT_v_scaled_size = 12;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 13) {\n    /* Provide 13/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 13L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 13L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 13;\n    cinfo->_min_DCT_v_scaled_size = 13;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 14) {\n    /* Provide 14/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 14L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 14L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 14;\n    cinfo->_min_DCT_v_scaled_size = 14;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 15) {\n    /* Provide 15/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 15L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 15L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 15;\n    cinfo->_min_DCT_v_scaled_size = 15;\n  } else {\n    /* Provide 16/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 16L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 16L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 16;\n    cinfo->_min_DCT_v_scaled_size = 16;\n  }\n\n  /* Recompute dimensions of components */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    compptr->_DCT_h_scaled_size = cinfo->_min_DCT_h_scaled_size;\n    compptr->_DCT_v_scaled_size = cinfo->_min_DCT_v_scaled_size;\n  }\n\n#else /* !IDCT_SCALING_SUPPORTED */\n\n  /* Hardwire it to \"no scaling\" */\n  cinfo->output_width = cinfo->image_width;\n  cinfo->output_height = cinfo->image_height;\n  /* jdinput.c has already initialized DCT_scaled_size,\n   * and has computed unscaled downsampled_width and downsampled_height.\n   */\n\n#endif /* IDCT_SCALING_SUPPORTED */\n}\n\n\n/*\n * Compute output image dimensions and related values.\n * NOTE: this is exported for possible use by application.\n * Hence it mustn't do anything that can't be done twice.\n * Also note that it may be called before the master module is initialized!\n */\n\nGLOBAL(void)\njpeg_calc_output_dimensions (j_decompress_ptr cinfo)\n/* Do computations that are needed before master selection phase */\n{\n#ifdef IDCT_SCALING_SUPPORTED\n  int ci;\n  jpeg_component_info *compptr;\n#endif\n\n  /* Prevent application from calling me at wrong times */\n  if (cinfo->global_state != DSTATE_READY)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* Compute core output image dimensions and DCT scaling choices. */\n  jpeg_core_output_dimensions(cinfo);\n\n#ifdef IDCT_SCALING_SUPPORTED\n\n  /* In selecting the actual DCT scaling for each component, we try to\n   * scale up the chroma components via IDCT scaling rather than upsampling.\n   * This saves time if the upsampler gets to use 1:1 scaling.\n   * Note this code adapts subsampling ratios which are powers of 2.\n   */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    int ssize = cinfo->_min_DCT_scaled_size;\n    while (ssize < DCTSIZE &&\n           ((cinfo->max_h_samp_factor * cinfo->_min_DCT_scaled_size) %\n            (compptr->h_samp_factor * ssize * 2) == 0) &&\n           ((cinfo->max_v_samp_factor * cinfo->_min_DCT_scaled_size) %\n            (compptr->v_samp_factor * ssize * 2) == 0)) {\n      ssize = ssize * 2;\n    }\n#if JPEG_LIB_VERSION >= 70\n    compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size = ssize;\n#else\n    compptr->DCT_scaled_size = ssize;\n#endif\n  }\n\n  /* Recompute downsampled dimensions of components;\n   * application needs to know these if using raw downsampled data.\n   */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Size in samples, after IDCT scaling */\n    compptr->downsampled_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width *\n                    (long) (compptr->h_samp_factor * compptr->_DCT_scaled_size),\n                    (long) (cinfo->max_h_samp_factor * DCTSIZE));\n    compptr->downsampled_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height *\n                    (long) (compptr->v_samp_factor * compptr->_DCT_scaled_size),\n                    (long) (cinfo->max_v_samp_factor * DCTSIZE));\n  }\n\n#else /* !IDCT_SCALING_SUPPORTED */\n\n  /* Hardwire it to \"no scaling\" */\n  cinfo->output_width = cinfo->image_width;\n  cinfo->output_height = cinfo->image_height;\n  /* jdinput.c has already initialized DCT_scaled_size to DCTSIZE,\n   * and has computed unscaled downsampled_width and downsampled_height.\n   */\n\n#endif /* IDCT_SCALING_SUPPORTED */\n\n  /* Report number of components in selected colorspace. */\n  /* Probably this should be in the color conversion module... */\n  switch (cinfo->out_color_space) {\n  case JCS_GRAYSCALE:\n    cinfo->out_color_components = 1;\n    break;\n  case JCS_RGB:\n  case JCS_EXT_RGB:\n  case JCS_EXT_RGBX:\n  case JCS_EXT_BGR:\n  case JCS_EXT_BGRX:\n  case JCS_EXT_XBGR:\n  case JCS_EXT_XRGB:\n  case JCS_EXT_RGBA:\n  case JCS_EXT_BGRA:\n  case JCS_EXT_ABGR:\n  case JCS_EXT_ARGB:\n    cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];\n    break;\n  case JCS_YCbCr:\n  case JCS_RGB565:\n    cinfo->out_color_components = 3;\n    break;\n  case JCS_CMYK:\n  case JCS_YCCK:\n    cinfo->out_color_components = 4;\n    break;\n  default:                      /* else must be same colorspace as in file */\n    cinfo->out_color_components = cinfo->num_components;\n    break;\n  }\n  cinfo->output_components = (cinfo->quantize_colors ? 1 :\n                              cinfo->out_color_components);\n\n  /* See if upsampler will want to emit more than one row at a time */\n  if (use_merged_upsample(cinfo))\n    cinfo->rec_outbuf_height = cinfo->max_v_samp_factor;\n  else\n    cinfo->rec_outbuf_height = 1;\n}\n\n\n/*\n * Several decompression processes need to range-limit values to the range\n * 0..MAXJSAMPLE; the input value may fall somewhat outside this range\n * due to noise introduced by quantization, roundoff error, etc.  These\n * processes are inner loops and need to be as fast as possible.  On most\n * machines, particularly CPUs with pipelines or instruction prefetch,\n * a (subscript-check-less) C table lookup\n *              x = sample_range_limit[x];\n * is faster than explicit tests\n *              if (x < 0)  x = 0;\n *              else if (x > MAXJSAMPLE)  x = MAXJSAMPLE;\n * These processes all use a common table prepared by the routine below.\n *\n * For most steps we can mathematically guarantee that the initial value\n * of x is within MAXJSAMPLE+1 of the legal range, so a table running from\n * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient.  But for the initial\n * limiting step (just after the IDCT), a wildly out-of-range value is\n * possible if the input data is corrupt.  To avoid any chance of indexing\n * off the end of memory and getting a bad-pointer trap, we perform the\n * post-IDCT limiting thus:\n *              x = range_limit[x & MASK];\n * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit\n * samples.  Under normal circumstances this is more than enough range and\n * a correct output will be generated; with bogus input data the mask will\n * cause wraparound, and we will safely generate a bogus-but-in-range output.\n * For the post-IDCT step, we want to convert the data from signed to unsigned\n * representation by adding CENTERJSAMPLE at the same time that we limit it.\n * So the post-IDCT limiting table ends up looking like this:\n *   CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE,\n *   MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),\n *   0          (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),\n *   0,1,...,CENTERJSAMPLE-1\n * Negative inputs select values from the upper half of the table after\n * masking.\n *\n * We can save some space by overlapping the start of the post-IDCT table\n * with the simpler range limiting table.  The post-IDCT table begins at\n * sample_range_limit + CENTERJSAMPLE.\n */\n\nLOCAL(void)\nprepare_range_limit_table (j_decompress_ptr cinfo)\n/* Allocate and fill in the sample_range_limit table */\n{\n  JSAMPLE *table;\n  int i;\n\n  table = (JSAMPLE *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                (5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * sizeof(JSAMPLE));\n  table += (MAXJSAMPLE+1);      /* allow negative subscripts of simple table */\n  cinfo->sample_range_limit = table;\n  /* First segment of \"simple\" table: limit[x] = 0 for x < 0 */\n  MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * sizeof(JSAMPLE));\n  /* Main part of \"simple\" table: limit[x] = x */\n  for (i = 0; i <= MAXJSAMPLE; i++)\n    table[i] = (JSAMPLE) i;\n  table += CENTERJSAMPLE;       /* Point to where post-IDCT table starts */\n  /* End of simple table, rest of first half of post-IDCT table */\n  for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++)\n    table[i] = MAXJSAMPLE;\n  /* Second half of post-IDCT table */\n  MEMZERO(table + (2 * (MAXJSAMPLE+1)),\n          (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * sizeof(JSAMPLE));\n  MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE),\n          cinfo->sample_range_limit, CENTERJSAMPLE * sizeof(JSAMPLE));\n}\n\n\n/*\n * Master selection of decompression modules.\n * This is done once at jpeg_start_decompress time.  We determine\n * which modules will be used and give them appropriate initialization calls.\n * We also initialize the decompressor input side to begin consuming data.\n *\n * Since jpeg_read_header has finished, we know what is in the SOF\n * and (first) SOS markers.  We also have all the application parameter\n * settings.\n */\n\nLOCAL(void)\nmaster_selection (j_decompress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n  boolean use_c_buffer;\n  long samplesperrow;\n  JDIMENSION jd_samplesperrow;\n\n  /* Initialize dimensions and other stuff */\n  jpeg_calc_output_dimensions(cinfo);\n  prepare_range_limit_table(cinfo);\n\n  /* Width of an output scanline must be representable as JDIMENSION. */\n  samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components;\n  jd_samplesperrow = (JDIMENSION) samplesperrow;\n  if ((long) jd_samplesperrow != samplesperrow)\n    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);\n\n  /* Initialize my private state */\n  master->pass_number = 0;\n  master->using_merged_upsample = use_merged_upsample(cinfo);\n\n  /* Color quantizer selection */\n  master->quantizer_1pass = NULL;\n  master->quantizer_2pass = NULL;\n  /* No mode changes if not using buffered-image mode. */\n  if (! cinfo->quantize_colors || ! cinfo->buffered_image) {\n    cinfo->enable_1pass_quant = FALSE;\n    cinfo->enable_external_quant = FALSE;\n    cinfo->enable_2pass_quant = FALSE;\n  }\n  if (cinfo->quantize_colors) {\n    if (cinfo->raw_data_out)\n      ERREXIT(cinfo, JERR_NOTIMPL);\n    /* 2-pass quantizer only works in 3-component color space. */\n    if (cinfo->out_color_components != 3) {\n      cinfo->enable_1pass_quant = TRUE;\n      cinfo->enable_external_quant = FALSE;\n      cinfo->enable_2pass_quant = FALSE;\n      cinfo->colormap = NULL;\n    } else if (cinfo->colormap != NULL) {\n      cinfo->enable_external_quant = TRUE;\n    } else if (cinfo->two_pass_quantize) {\n      cinfo->enable_2pass_quant = TRUE;\n    } else {\n      cinfo->enable_1pass_quant = TRUE;\n    }\n\n    if (cinfo->enable_1pass_quant) {\n#ifdef QUANT_1PASS_SUPPORTED\n      jinit_1pass_quantizer(cinfo);\n      master->quantizer_1pass = cinfo->cquantize;\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    }\n\n    /* We use the 2-pass code to map to external colormaps. */\n    if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) {\n#ifdef QUANT_2PASS_SUPPORTED\n      jinit_2pass_quantizer(cinfo);\n      master->quantizer_2pass = cinfo->cquantize;\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    }\n    /* If both quantizers are initialized, the 2-pass one is left active;\n     * this is necessary for starting with quantization to an external map.\n     */\n  }\n\n  /* Post-processing: in particular, color conversion first */\n  if (! cinfo->raw_data_out) {\n    if (master->using_merged_upsample) {\n#ifdef UPSAMPLE_MERGING_SUPPORTED\n      jinit_merged_upsampler(cinfo); /* does color conversion too */\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    } else {\n      jinit_color_deconverter(cinfo);\n      jinit_upsampler(cinfo);\n    }\n    jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant);\n  }\n  /* Inverse DCT */\n  jinit_inverse_dct(cinfo);\n  /* Entropy decoding: either Huffman or arithmetic coding. */\n  if (cinfo->arith_code) {\n#ifdef D_ARITH_CODING_SUPPORTED\n    jinit_arith_decoder(cinfo);\n#else\n    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);\n#endif\n  } else {\n    if (cinfo->progressive_mode) {\n#ifdef D_PROGRESSIVE_SUPPORTED\n      jinit_phuff_decoder(cinfo);\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    } else\n      jinit_huff_decoder(cinfo);\n  }\n\n  /* Initialize principal buffer controllers. */\n  use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image;\n  jinit_d_coef_controller(cinfo, use_c_buffer);\n\n  if (! cinfo->raw_data_out)\n    jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */);\n\n  /* We can now tell the memory manager to allocate virtual arrays. */\n  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);\n\n  /* Initialize input side of decompressor to consume first scan. */\n  (*cinfo->inputctl->start_input_pass) (cinfo);\n\n  /* Set the first and last iMCU columns to decompress from single-scan images.\n   * By default, decompress all of the iMCU columns.\n   */\n  cinfo->master->first_iMCU_col = 0;\n  cinfo->master->last_iMCU_col = cinfo->MCUs_per_row - 1;\n\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n  /* If jpeg_start_decompress will read the whole file, initialize\n   * progress monitoring appropriately.  The input step is counted\n   * as one pass.\n   */\n  if (cinfo->progress != NULL && ! cinfo->buffered_image &&\n      cinfo->inputctl->has_multiple_scans) {\n    int nscans;\n    /* Estimate number of scans to set pass_limit. */\n    if (cinfo->progressive_mode) {\n      /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */\n      nscans = 2 + 3 * cinfo->num_components;\n    } else {\n      /* For a nonprogressive multiscan file, estimate 1 scan per component. */\n      nscans = cinfo->num_components;\n    }\n    cinfo->progress->pass_counter = 0L;\n    cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;\n    cinfo->progress->completed_passes = 0;\n    cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2);\n    /* Count the input pass as done */\n    master->pass_number++;\n  }\n#endif /* D_MULTISCAN_FILES_SUPPORTED */\n}\n\n\n/*\n * Per-pass setup.\n * This is called at the beginning of each output pass.  We determine which\n * modules will be active during this pass and give them appropriate\n * start_pass calls.  We also set is_dummy_pass to indicate whether this\n * is a \"real\" output pass or a dummy pass for color quantization.\n * (In the latter case, jdapistd.c will crank the pass to completion.)\n */\n\nMETHODDEF(void)\nprepare_for_output_pass (j_decompress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  if (master->pub.is_dummy_pass) {\n#ifdef QUANT_2PASS_SUPPORTED\n    /* Final pass of 2-pass quantization */\n    master->pub.is_dummy_pass = FALSE;\n    (*cinfo->cquantize->start_pass) (cinfo, FALSE);\n    (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST);\n    (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST);\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif /* QUANT_2PASS_SUPPORTED */\n  } else {\n    if (cinfo->quantize_colors && cinfo->colormap == NULL) {\n      /* Select new quantization method */\n      if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) {\n        cinfo->cquantize = master->quantizer_2pass;\n        master->pub.is_dummy_pass = TRUE;\n      } else if (cinfo->enable_1pass_quant) {\n        cinfo->cquantize = master->quantizer_1pass;\n      } else {\n        ERREXIT(cinfo, JERR_MODE_CHANGE);\n      }\n    }\n    (*cinfo->idct->start_pass) (cinfo);\n    (*cinfo->coef->start_output_pass) (cinfo);\n    if (! cinfo->raw_data_out) {\n      if (! master->using_merged_upsample)\n        (*cinfo->cconvert->start_pass) (cinfo);\n      (*cinfo->upsample->start_pass) (cinfo);\n      if (cinfo->quantize_colors)\n        (*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass);\n      (*cinfo->post->start_pass) (cinfo,\n            (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));\n      (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);\n    }\n  }\n\n  /* Set up progress monitor's pass info if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->completed_passes = master->pass_number;\n    cinfo->progress->total_passes = master->pass_number +\n                                    (master->pub.is_dummy_pass ? 2 : 1);\n    /* In buffered-image mode, we assume one more output pass if EOI not\n     * yet reached, but no more passes if EOI has been reached.\n     */\n    if (cinfo->buffered_image && ! cinfo->inputctl->eoi_reached) {\n      cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1);\n    }\n  }\n}\n\n\n/*\n * Finish up at end of an output pass.\n */\n\nMETHODDEF(void)\nfinish_output_pass (j_decompress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  if (cinfo->quantize_colors)\n    (*cinfo->cquantize->finish_pass) (cinfo);\n  master->pass_number++;\n}\n\n\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n\n/*\n * Switch to a new external colormap between output passes.\n */\n\nGLOBAL(void)\njpeg_new_colormap (j_decompress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  /* Prevent application from calling me at wrong times */\n  if (cinfo->global_state != DSTATE_BUFIMAGE)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  if (cinfo->quantize_colors && cinfo->enable_external_quant &&\n      cinfo->colormap != NULL) {\n    /* Select 2-pass quantizer for external colormap use */\n    cinfo->cquantize = master->quantizer_2pass;\n    /* Notify quantizer of colormap change */\n    (*cinfo->cquantize->new_color_map) (cinfo);\n    master->pub.is_dummy_pass = FALSE; /* just in case */\n  } else\n    ERREXIT(cinfo, JERR_MODE_CHANGE);\n}\n\n#endif /* D_MULTISCAN_FILES_SUPPORTED */\n\n\n/*\n * Initialize master decompression control and select active modules.\n * This is performed at the start of jpeg_start_decompress.\n */\n\nGLOBAL(void)\njinit_master_decompress (j_decompress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  master->pub.prepare_for_output_pass = prepare_for_output_pass;\n  master->pub.finish_output_pass = finish_output_pass;\n\n  master->pub.is_dummy_pass = FALSE;\n  master->pub.jinit_upsampler_no_alloc = FALSE;\n\n  master_selection(cinfo);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdmaster.h",
    "content": "/*\n * jdmaster.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1995, Thomas G. Lane.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains the master control structure for the JPEG decompressor.\n */\n\n/* Private state */\n\ntypedef struct {\n  struct jpeg_decomp_master pub; /* public fields */\n\n  int pass_number;              /* # of passes completed */\n\n  boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */\n\n  /* Saved references to initialized quantizer modules,\n   * in case we need to switch modes.\n   */\n  struct jpeg_color_quantizer *quantizer_1pass;\n  struct jpeg_color_quantizer *quantizer_2pass;\n} my_decomp_master;\n\ntypedef my_decomp_master *my_master_ptr;\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdmerge.c",
    "content": "/*\n * jdmerge.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2009, 2011, 2014-2015, D. R. Commander.\n * Copyright (C) 2013, Linaro Limited.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains code for merged upsampling/color conversion.\n *\n * This file combines functions from jdsample.c and jdcolor.c;\n * read those files first to understand what's going on.\n *\n * When the chroma components are to be upsampled by simple replication\n * (ie, box filtering), we can save some work in color conversion by\n * calculating all the output pixels corresponding to a pair of chroma\n * samples at one time.  In the conversion equations\n *      R = Y           + K1 * Cr\n *      G = Y + K2 * Cb + K3 * Cr\n *      B = Y + K4 * Cb\n * only the Y term varies among the group of pixels corresponding to a pair\n * of chroma samples, so the rest of the terms can be calculated just once.\n * At typical sampling ratios, this eliminates half or three-quarters of the\n * multiplications needed for color conversion.\n *\n * This file currently provides implementations for the following cases:\n *      YCbCr => RGB color conversion only.\n *      Sampling ratios of 2h1v or 2h2v.\n *      No scaling needed at upsample time.\n *      Corner-aligned (non-CCIR601) sampling alignment.\n * Other special cases could be added, but in most applications these are\n * the only common cases.  (For uncommon cases we fall back on the more\n * general code in jdsample.c and jdcolor.c.)\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jsimd.h\"\n#include \"jconfigint.h\"\n\n#ifdef UPSAMPLE_MERGING_SUPPORTED\n\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_upsampler pub;    /* public fields */\n\n  /* Pointer to routine to do actual upsampling/conversion of one row group */\n  void (*upmethod) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,\n                    JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\n\n  /* Private state for YCC->RGB conversion */\n  int *Cr_r_tab;                /* => table for Cr to R conversion */\n  int *Cb_b_tab;                /* => table for Cb to B conversion */\n  JLONG *Cr_g_tab;              /* => table for Cr to G conversion */\n  JLONG *Cb_g_tab;              /* => table for Cb to G conversion */\n\n  /* For 2:1 vertical sampling, we produce two output rows at a time.\n   * We need a \"spare\" row buffer to hold the second output row if the\n   * application provides just a one-row buffer; we also use the spare\n   * to discard the dummy last row if the image height is odd.\n   */\n  JSAMPROW spare_row;\n  boolean spare_full;           /* T if spare buffer is occupied */\n\n  JDIMENSION out_row_width;     /* samples per output row */\n  JDIMENSION rows_to_go;        /* counts rows remaining in image */\n} my_upsampler;\n\ntypedef my_upsampler *my_upsample_ptr;\n\n#define SCALEBITS       16      /* speediest right-shift on some machines */\n#define ONE_HALF        ((JLONG) 1 << (SCALEBITS-1))\n#define FIX(x)          ((JLONG) ((x) * (1L<<SCALEBITS) + 0.5))\n\n\n/* Include inline routines for colorspace extensions */\n\n#include \"jdmrgext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n\n#define RGB_RED EXT_RGB_RED\n#define RGB_GREEN EXT_RGB_GREEN\n#define RGB_BLUE EXT_RGB_BLUE\n#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n#define h2v1_merged_upsample_internal extrgb_h2v1_merged_upsample_internal\n#define h2v2_merged_upsample_internal extrgb_h2v2_merged_upsample_internal\n#include \"jdmrgext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef h2v1_merged_upsample_internal\n#undef h2v2_merged_upsample_internal\n\n#define RGB_RED EXT_RGBX_RED\n#define RGB_GREEN EXT_RGBX_GREEN\n#define RGB_BLUE EXT_RGBX_BLUE\n#define RGB_ALPHA 3\n#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n#define h2v1_merged_upsample_internal extrgbx_h2v1_merged_upsample_internal\n#define h2v2_merged_upsample_internal extrgbx_h2v2_merged_upsample_internal\n#include \"jdmrgext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef h2v1_merged_upsample_internal\n#undef h2v2_merged_upsample_internal\n\n#define RGB_RED EXT_BGR_RED\n#define RGB_GREEN EXT_BGR_GREEN\n#define RGB_BLUE EXT_BGR_BLUE\n#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n#define h2v1_merged_upsample_internal extbgr_h2v1_merged_upsample_internal\n#define h2v2_merged_upsample_internal extbgr_h2v2_merged_upsample_internal\n#include \"jdmrgext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef h2v1_merged_upsample_internal\n#undef h2v2_merged_upsample_internal\n\n#define RGB_RED EXT_BGRX_RED\n#define RGB_GREEN EXT_BGRX_GREEN\n#define RGB_BLUE EXT_BGRX_BLUE\n#define RGB_ALPHA 3\n#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n#define h2v1_merged_upsample_internal extbgrx_h2v1_merged_upsample_internal\n#define h2v2_merged_upsample_internal extbgrx_h2v2_merged_upsample_internal\n#include \"jdmrgext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef h2v1_merged_upsample_internal\n#undef h2v2_merged_upsample_internal\n\n#define RGB_RED EXT_XBGR_RED\n#define RGB_GREEN EXT_XBGR_GREEN\n#define RGB_BLUE EXT_XBGR_BLUE\n#define RGB_ALPHA 0\n#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n#define h2v1_merged_upsample_internal extxbgr_h2v1_merged_upsample_internal\n#define h2v2_merged_upsample_internal extxbgr_h2v2_merged_upsample_internal\n#include \"jdmrgext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef h2v1_merged_upsample_internal\n#undef h2v2_merged_upsample_internal\n\n#define RGB_RED EXT_XRGB_RED\n#define RGB_GREEN EXT_XRGB_GREEN\n#define RGB_BLUE EXT_XRGB_BLUE\n#define RGB_ALPHA 0\n#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n#define h2v1_merged_upsample_internal extxrgb_h2v1_merged_upsample_internal\n#define h2v2_merged_upsample_internal extxrgb_h2v2_merged_upsample_internal\n#include \"jdmrgext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef h2v1_merged_upsample_internal\n#undef h2v2_merged_upsample_internal\n\n\n/*\n * Initialize tables for YCC->RGB colorspace conversion.\n * This is taken directly from jdcolor.c; see that file for more info.\n */\n\nLOCAL(void)\nbuild_ycc_rgb_table (j_decompress_ptr cinfo)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  int i;\n  JLONG x;\n  SHIFT_TEMPS\n\n  upsample->Cr_r_tab = (int *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                (MAXJSAMPLE+1) * sizeof(int));\n  upsample->Cb_b_tab = (int *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                (MAXJSAMPLE+1) * sizeof(int));\n  upsample->Cr_g_tab = (JLONG *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                (MAXJSAMPLE+1) * sizeof(JLONG));\n  upsample->Cb_g_tab = (JLONG *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                (MAXJSAMPLE+1) * sizeof(JLONG));\n\n  for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {\n    /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */\n    /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */\n    /* Cr=>R value is nearest int to 1.40200 * x */\n    upsample->Cr_r_tab[i] = (int)\n                    RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);\n    /* Cb=>B value is nearest int to 1.77200 * x */\n    upsample->Cb_b_tab[i] = (int)\n                    RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);\n    /* Cr=>G value is scaled-up -0.71414 * x */\n    upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x;\n    /* Cb=>G value is scaled-up -0.34414 * x */\n    /* We also add in ONE_HALF so that need not do it in inner loop */\n    upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;\n  }\n}\n\n\n/*\n * Initialize for an upsampling pass.\n */\n\nMETHODDEF(void)\nstart_pass_merged_upsample (j_decompress_ptr cinfo)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n\n  /* Mark the spare buffer empty */\n  upsample->spare_full = FALSE;\n  /* Initialize total-height counter for detecting bottom of image */\n  upsample->rows_to_go = cinfo->output_height;\n}\n\n\n/*\n * Control routine to do upsampling (and color conversion).\n *\n * The control routine just handles the row buffering considerations.\n */\n\nMETHODDEF(void)\nmerged_2v_upsample (j_decompress_ptr cinfo,\n                    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n                    JDIMENSION in_row_groups_avail,\n                    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n                    JDIMENSION out_rows_avail)\n/* 2:1 vertical sampling case: may need a spare row. */\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  JSAMPROW work_ptrs[2];\n  JDIMENSION num_rows;          /* number of rows returned to caller */\n\n  if (upsample->spare_full) {\n    /* If we have a spare row saved from a previous cycle, just return it. */\n    JDIMENSION size = upsample->out_row_width;\n    if (cinfo->out_color_space == JCS_RGB565)\n      size = cinfo->output_width * 2;\n    jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0,\n                      1, size);\n    num_rows = 1;\n    upsample->spare_full = FALSE;\n  } else {\n    /* Figure number of rows to return to caller. */\n    num_rows = 2;\n    /* Not more than the distance to the end of the image. */\n    if (num_rows > upsample->rows_to_go)\n      num_rows = upsample->rows_to_go;\n    /* And not more than what the client can accept: */\n    out_rows_avail -= *out_row_ctr;\n    if (num_rows > out_rows_avail)\n      num_rows = out_rows_avail;\n    /* Create output pointer array for upsampler. */\n    work_ptrs[0] = output_buf[*out_row_ctr];\n    if (num_rows > 1) {\n      work_ptrs[1] = output_buf[*out_row_ctr + 1];\n    } else {\n      work_ptrs[1] = upsample->spare_row;\n      upsample->spare_full = TRUE;\n    }\n    /* Now do the upsampling. */\n    (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs);\n  }\n\n  /* Adjust counts */\n  *out_row_ctr += num_rows;\n  upsample->rows_to_go -= num_rows;\n  /* When the buffer is emptied, declare this input row group consumed */\n  if (! upsample->spare_full)\n    (*in_row_group_ctr)++;\n}\n\n\nMETHODDEF(void)\nmerged_1v_upsample (j_decompress_ptr cinfo,\n                    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n                    JDIMENSION in_row_groups_avail,\n                    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n                    JDIMENSION out_rows_avail)\n/* 1:1 vertical sampling case: much easier, never need a spare row. */\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n\n  /* Just do the upsampling. */\n  (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,\n                         output_buf + *out_row_ctr);\n  /* Adjust counts */\n  (*out_row_ctr)++;\n  (*in_row_group_ctr)++;\n}\n\n\n/*\n * These are the routines invoked by the control routines to do\n * the actual upsampling/conversion.  One row group is processed per call.\n *\n * Note: since we may be writing directly into application-supplied buffers,\n * we have to be honest about the output width; we can't assume the buffer\n * has been rounded up to an even width.\n */\n\n\n/*\n * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.\n */\n\nMETHODDEF(void)\nh2v1_merged_upsample (j_decompress_ptr cinfo,\n                      JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,\n                      JSAMPARRAY output_buf)\n{\n  switch (cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      extrgb_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                           output_buf);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      extrgbx_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    case JCS_EXT_BGR:\n      extbgr_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                           output_buf);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      extbgrx_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      extxbgr_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      extxrgb_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    default:\n      h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                    output_buf);\n      break;\n  }\n}\n\n\n/*\n * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.\n */\n\nMETHODDEF(void)\nh2v2_merged_upsample (j_decompress_ptr cinfo,\n                      JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,\n                      JSAMPARRAY output_buf)\n{\n  switch (cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      extrgb_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                           output_buf);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      extrgbx_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    case JCS_EXT_BGR:\n      extbgr_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                           output_buf);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      extbgrx_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      extxbgr_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      extxrgb_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    default:\n      h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                    output_buf);\n      break;\n  }\n}\n\n\n/*\n * RGB565 conversion\n */\n\n#define PACK_SHORT_565_LE(r, g, b)   ((((r) << 8) & 0xF800) |  \\\n                                      (((g) << 3) & 0x7E0) | ((b) >> 3))\n#define PACK_SHORT_565_BE(r, g, b)   (((r) & 0xF8) | ((g) >> 5) |  \\\n                                      (((g) << 11) & 0xE000) |  \\\n                                      (((b) << 5) & 0x1F00))\n\n#define PACK_TWO_PIXELS_LE(l, r)     ((r << 16) | l)\n#define PACK_TWO_PIXELS_BE(l, r)     ((l << 16) | r)\n\n#define PACK_NEED_ALIGNMENT(ptr)  (((size_t)(ptr)) & 3)\n\n#define WRITE_TWO_PIXELS_LE(addr, pixels) {  \\\n  ((INT16*)(addr))[0] = (INT16)(pixels);  \\\n  ((INT16*)(addr))[1] = (INT16)((pixels) >> 16);  \\\n}\n#define WRITE_TWO_PIXELS_BE(addr, pixels) {  \\\n  ((INT16*)(addr))[1] = (INT16)(pixels);  \\\n  ((INT16*)(addr))[0] = (INT16)((pixels) >> 16);  \\\n}\n\n#define DITHER_565_R(r, dither)  ((r) + ((dither) & 0xFF))\n#define DITHER_565_G(g, dither)  ((g) + (((dither) & 0xFF) >> 1))\n#define DITHER_565_B(b, dither)  ((b) + ((dither) & 0xFF))\n\n\n/* Declarations for ordered dithering\n *\n * We use a 4x4 ordered dither array packed into 32 bits.  This array is\n * sufficent for dithering RGB888 to RGB565.\n */\n\n#define DITHER_MASK       0x3\n#define DITHER_ROTATE(x)  ((((x) & 0xFF) << 24) | (((x) >> 8) & 0x00FFFFFF))\nstatic const JLONG dither_matrix[4] = {\n  0x0008020A,\n  0x0C040E06,\n  0x030B0109,\n  0x0F070D05\n};\n\n\n/* Include inline routines for RGB565 conversion */\n\n#define PACK_SHORT_565 PACK_SHORT_565_LE\n#define PACK_TWO_PIXELS PACK_TWO_PIXELS_LE\n#define WRITE_TWO_PIXELS WRITE_TWO_PIXELS_LE\n#define h2v1_merged_upsample_565_internal h2v1_merged_upsample_565_le\n#define h2v1_merged_upsample_565D_internal h2v1_merged_upsample_565D_le\n#define h2v2_merged_upsample_565_internal h2v2_merged_upsample_565_le\n#define h2v2_merged_upsample_565D_internal h2v2_merged_upsample_565D_le\n#include \"jdmrg565.c\"\n#undef PACK_SHORT_565\n#undef PACK_TWO_PIXELS\n#undef WRITE_TWO_PIXELS\n#undef h2v1_merged_upsample_565_internal\n#undef h2v1_merged_upsample_565D_internal\n#undef h2v2_merged_upsample_565_internal\n#undef h2v2_merged_upsample_565D_internal\n\n#define PACK_SHORT_565 PACK_SHORT_565_BE\n#define PACK_TWO_PIXELS PACK_TWO_PIXELS_BE\n#define WRITE_TWO_PIXELS WRITE_TWO_PIXELS_BE\n#define h2v1_merged_upsample_565_internal h2v1_merged_upsample_565_be\n#define h2v1_merged_upsample_565D_internal h2v1_merged_upsample_565D_be\n#define h2v2_merged_upsample_565_internal h2v2_merged_upsample_565_be\n#define h2v2_merged_upsample_565D_internal h2v2_merged_upsample_565D_be\n#include \"jdmrg565.c\"\n#undef PACK_SHORT_565\n#undef PACK_TWO_PIXELS\n#undef WRITE_TWO_PIXELS\n#undef h2v1_merged_upsample_565_internal\n#undef h2v1_merged_upsample_565D_internal\n#undef h2v2_merged_upsample_565_internal\n#undef h2v2_merged_upsample_565D_internal\n\n\nstatic INLINE boolean is_big_endian(void)\n{\n  int test_value = 1;\n  if(*(char *)&test_value != 1)\n    return TRUE;\n  return FALSE;\n}\n\n\nMETHODDEF(void)\nh2v1_merged_upsample_565 (j_decompress_ptr cinfo,\n                          JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,\n                          JSAMPARRAY output_buf)\n{\n  if (is_big_endian())\n    h2v1_merged_upsample_565_be(cinfo, input_buf, in_row_group_ctr,\n                                output_buf);\n  else\n    h2v1_merged_upsample_565_le(cinfo, input_buf, in_row_group_ctr,\n                                output_buf);\n }\n\n\nMETHODDEF(void)\nh2v1_merged_upsample_565D (j_decompress_ptr cinfo,\n                           JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,\n                           JSAMPARRAY output_buf)\n{\n  if (is_big_endian())\n    h2v1_merged_upsample_565D_be(cinfo, input_buf, in_row_group_ctr,\n                                 output_buf);\n  else\n    h2v1_merged_upsample_565D_le(cinfo, input_buf, in_row_group_ctr,\n                                 output_buf);\n}\n\n\nMETHODDEF(void)\nh2v2_merged_upsample_565 (j_decompress_ptr cinfo,\n                          JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,\n                          JSAMPARRAY output_buf)\n{\n  if (is_big_endian())\n    h2v2_merged_upsample_565_be(cinfo, input_buf, in_row_group_ctr,\n                                output_buf);\n  else\n    h2v2_merged_upsample_565_le(cinfo, input_buf, in_row_group_ctr,\n                                output_buf);\n}\n\n\nMETHODDEF(void)\nh2v2_merged_upsample_565D (j_decompress_ptr cinfo,\n                           JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,\n                           JSAMPARRAY output_buf)\n{\n  if (is_big_endian())\n    h2v2_merged_upsample_565D_be(cinfo, input_buf, in_row_group_ctr,\n                                 output_buf);\n  else\n    h2v2_merged_upsample_565D_le(cinfo, input_buf, in_row_group_ctr,\n                                 output_buf);\n}\n\n\n/*\n * Module initialization routine for merged upsampling/color conversion.\n *\n * NB: this is called under the conditions determined by use_merged_upsample()\n * in jdmaster.c.  That routine MUST correspond to the actual capabilities\n * of this module; no safety checks are made here.\n */\n\nGLOBAL(void)\njinit_merged_upsampler (j_decompress_ptr cinfo)\n{\n  my_upsample_ptr upsample;\n\n  upsample = (my_upsample_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_upsampler));\n  cinfo->upsample = (struct jpeg_upsampler *) upsample;\n  upsample->pub.start_pass = start_pass_merged_upsample;\n  upsample->pub.need_context_rows = FALSE;\n\n  upsample->out_row_width = cinfo->output_width * cinfo->out_color_components;\n\n  if (cinfo->max_v_samp_factor == 2) {\n    upsample->pub.upsample = merged_2v_upsample;\n    if (jsimd_can_h2v2_merged_upsample())\n      upsample->upmethod = jsimd_h2v2_merged_upsample;\n    else\n      upsample->upmethod = h2v2_merged_upsample;\n    if (cinfo->out_color_space == JCS_RGB565) {\n      if (cinfo->dither_mode != JDITHER_NONE) {\n        upsample->upmethod = h2v2_merged_upsample_565D;\n      } else {\n        upsample->upmethod = h2v2_merged_upsample_565;\n      }\n    }\n    /* Allocate a spare row buffer */\n    upsample->spare_row = (JSAMPROW)\n      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                (size_t) (upsample->out_row_width * sizeof(JSAMPLE)));\n  } else {\n    upsample->pub.upsample = merged_1v_upsample;\n    if (jsimd_can_h2v1_merged_upsample())\n      upsample->upmethod = jsimd_h2v1_merged_upsample;\n    else\n      upsample->upmethod = h2v1_merged_upsample;\n    if (cinfo->out_color_space == JCS_RGB565) {\n      if (cinfo->dither_mode != JDITHER_NONE) {\n        upsample->upmethod = h2v1_merged_upsample_565D;\n      } else {\n        upsample->upmethod = h2v1_merged_upsample_565;\n      }\n    }\n    /* No spare row needed */\n    upsample->spare_row = NULL;\n  }\n\n  build_ycc_rgb_table(cinfo);\n}\n\n#endif /* UPSAMPLE_MERGING_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdmrg565.c",
    "content": "/*\n * jdmrg565.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2013, Linaro Limited.\n * Copyright (C) 2014-2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains code for merged upsampling/color conversion.\n */\n\n\nINLINE\nLOCAL(void)\nh2v1_merged_upsample_565_internal (j_decompress_ptr cinfo,\n                                   JSAMPIMAGE input_buf,\n                                   JDIMENSION in_row_group_ctr,\n                                   JSAMPARRAY output_buf)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  register int y, cred, cgreen, cblue;\n  int cb, cr;\n  register JSAMPROW outptr;\n  JSAMPROW inptr0, inptr1, inptr2;\n  JDIMENSION col;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  int * Crrtab = upsample->Cr_r_tab;\n  int * Cbbtab = upsample->Cb_b_tab;\n  JLONG * Crgtab = upsample->Cr_g_tab;\n  JLONG * Cbgtab = upsample->Cb_g_tab;\n  unsigned int r, g, b;\n  JLONG rgb;\n  SHIFT_TEMPS\n\n  inptr0 = input_buf[0][in_row_group_ctr];\n  inptr1 = input_buf[1][in_row_group_ctr];\n  inptr2 = input_buf[2][in_row_group_ctr];\n  outptr = output_buf[0];\n\n  /* Loop for each pair of output pixels */\n  for (col = cinfo->output_width >> 1; col > 0; col--) {\n    /* Do the chroma part of the calculation */\n    cb = GETJSAMPLE(*inptr1++);\n    cr = GETJSAMPLE(*inptr2++);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n\n    /* Fetch 2 Y values and emit 2 pixels */\n    y  = GETJSAMPLE(*inptr0++);\n    r = range_limit[y + cred];\n    g = range_limit[y + cgreen];\n    b = range_limit[y + cblue];\n    rgb = PACK_SHORT_565(r, g, b);\n\n    y  = GETJSAMPLE(*inptr0++);\n    r = range_limit[y + cred];\n    g = range_limit[y + cgreen];\n    b = range_limit[y + cblue];\n    rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));\n\n    WRITE_TWO_PIXELS(outptr, rgb);\n    outptr += 4;\n  }\n\n  /* If image width is odd, do the last output column separately */\n  if (cinfo->output_width & 1) {\n    cb = GETJSAMPLE(*inptr1);\n    cr = GETJSAMPLE(*inptr2);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n    y  = GETJSAMPLE(*inptr0);\n    r = range_limit[y + cred];\n    g = range_limit[y + cgreen];\n    b = range_limit[y + cblue];\n    rgb = PACK_SHORT_565(r, g, b);\n    *(INT16*)outptr = (INT16)rgb;\n   }\n }\n\n\nINLINE\nLOCAL(void)\nh2v1_merged_upsample_565D_internal (j_decompress_ptr cinfo,\n                                    JSAMPIMAGE input_buf,\n                                    JDIMENSION in_row_group_ctr,\n                                    JSAMPARRAY output_buf)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  register int y, cred, cgreen, cblue;\n  int cb, cr;\n  register JSAMPROW outptr;\n  JSAMPROW inptr0, inptr1, inptr2;\n  JDIMENSION col;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  int * Crrtab = upsample->Cr_r_tab;\n  int * Cbbtab = upsample->Cb_b_tab;\n  JLONG * Crgtab = upsample->Cr_g_tab;\n  JLONG * Cbgtab = upsample->Cb_g_tab;\n  JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK];\n  unsigned int r, g, b;\n  JLONG rgb;\n  SHIFT_TEMPS\n\n  inptr0 = input_buf[0][in_row_group_ctr];\n  inptr1 = input_buf[1][in_row_group_ctr];\n  inptr2 = input_buf[2][in_row_group_ctr];\n  outptr = output_buf[0];\n\n  /* Loop for each pair of output pixels */\n  for (col = cinfo->output_width >> 1; col > 0; col--) {\n    /* Do the chroma part of the calculation */\n    cb = GETJSAMPLE(*inptr1++);\n    cr = GETJSAMPLE(*inptr2++);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n\n    /* Fetch 2 Y values and emit 2 pixels */\n    y  = GETJSAMPLE(*inptr0++);\n    r = range_limit[DITHER_565_R(y + cred, d0)];\n    g = range_limit[DITHER_565_G(y + cgreen, d0)];\n    b = range_limit[DITHER_565_B(y + cblue, d0)];\n    d0 = DITHER_ROTATE(d0);\n    rgb = PACK_SHORT_565(r, g, b);\n\n    y  = GETJSAMPLE(*inptr0++);\n    r = range_limit[DITHER_565_R(y + cred, d0)];\n    g = range_limit[DITHER_565_G(y + cgreen, d0)];\n    b = range_limit[DITHER_565_B(y + cblue, d0)];\n    d0 = DITHER_ROTATE(d0);\n    rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));\n\n    WRITE_TWO_PIXELS(outptr, rgb);\n    outptr += 4;\n  }\n\n  /* If image width is odd, do the last output column separately */\n  if (cinfo->output_width & 1) {\n    cb = GETJSAMPLE(*inptr1);\n    cr = GETJSAMPLE(*inptr2);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n    y  = GETJSAMPLE(*inptr0);\n    r = range_limit[DITHER_565_R(y + cred, d0)];\n    g = range_limit[DITHER_565_G(y + cgreen, d0)];\n    b = range_limit[DITHER_565_B(y + cblue, d0)];\n    rgb = PACK_SHORT_565(r, g, b);\n    *(INT16*)outptr = (INT16)rgb;\n  }\n}\n\n\nINLINE\nLOCAL(void)\nh2v2_merged_upsample_565_internal (j_decompress_ptr cinfo,\n                                   JSAMPIMAGE input_buf,\n                                   JDIMENSION in_row_group_ctr,\n                                   JSAMPARRAY output_buf)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  register int y, cred, cgreen, cblue;\n  int cb, cr;\n  register JSAMPROW outptr0, outptr1;\n  JSAMPROW inptr00, inptr01, inptr1, inptr2;\n  JDIMENSION col;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  int * Crrtab = upsample->Cr_r_tab;\n  int * Cbbtab = upsample->Cb_b_tab;\n  JLONG * Crgtab = upsample->Cr_g_tab;\n  JLONG * Cbgtab = upsample->Cb_g_tab;\n  unsigned int r, g, b;\n  JLONG rgb;\n  SHIFT_TEMPS\n\n  inptr00 = input_buf[0][in_row_group_ctr * 2];\n  inptr01 = input_buf[0][in_row_group_ctr * 2 + 1];\n  inptr1 = input_buf[1][in_row_group_ctr];\n  inptr2 = input_buf[2][in_row_group_ctr];\n  outptr0 = output_buf[0];\n  outptr1 = output_buf[1];\n\n  /* Loop for each group of output pixels */\n  for (col = cinfo->output_width >> 1; col > 0; col--) {\n    /* Do the chroma part of the calculation */\n    cb = GETJSAMPLE(*inptr1++);\n    cr = GETJSAMPLE(*inptr2++);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n\n    /* Fetch 4 Y values and emit 4 pixels */\n    y  = GETJSAMPLE(*inptr00++);\n    r = range_limit[y + cred];\n    g = range_limit[y + cgreen];\n    b = range_limit[y + cblue];\n    rgb = PACK_SHORT_565(r, g, b);\n\n    y  = GETJSAMPLE(*inptr00++);\n    r = range_limit[y + cred];\n    g = range_limit[y + cgreen];\n    b = range_limit[y + cblue];\n    rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));\n\n    WRITE_TWO_PIXELS(outptr0, rgb);\n    outptr0 += 4;\n\n    y  = GETJSAMPLE(*inptr01++);\n    r = range_limit[y + cred];\n    g = range_limit[y + cgreen];\n    b = range_limit[y + cblue];\n    rgb = PACK_SHORT_565(r, g, b);\n\n    y  = GETJSAMPLE(*inptr01++);\n    r = range_limit[y + cred];\n    g = range_limit[y + cgreen];\n    b = range_limit[y + cblue];\n    rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));\n\n    WRITE_TWO_PIXELS(outptr1, rgb);\n    outptr1 += 4;\n  }\n\n  /* If image width is odd, do the last output column separately */\n  if (cinfo->output_width & 1) {\n    cb = GETJSAMPLE(*inptr1);\n    cr = GETJSAMPLE(*inptr2);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n\n    y  = GETJSAMPLE(*inptr00);\n    r = range_limit[y + cred];\n    g = range_limit[y + cgreen];\n    b = range_limit[y + cblue];\n    rgb = PACK_SHORT_565(r, g, b);\n    *(INT16*)outptr0 = (INT16)rgb;\n\n    y  = GETJSAMPLE(*inptr01);\n    r = range_limit[y + cred];\n    g = range_limit[y + cgreen];\n    b = range_limit[y + cblue];\n    rgb = PACK_SHORT_565(r, g, b);\n    *(INT16*)outptr1 = (INT16)rgb;\n  }\n}\n\n\nINLINE\nLOCAL(void)\nh2v2_merged_upsample_565D_internal (j_decompress_ptr cinfo,\n                                    JSAMPIMAGE input_buf,\n                                    JDIMENSION in_row_group_ctr,\n                                    JSAMPARRAY output_buf)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  register int y, cred, cgreen, cblue;\n  int cb, cr;\n  register JSAMPROW outptr0, outptr1;\n  JSAMPROW inptr00, inptr01, inptr1, inptr2;\n  JDIMENSION col;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  int * Crrtab = upsample->Cr_r_tab;\n  int * Cbbtab = upsample->Cb_b_tab;\n  JLONG * Crgtab = upsample->Cr_g_tab;\n  JLONG * Cbgtab = upsample->Cb_g_tab;\n  JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK];\n  JLONG d1 = dither_matrix[(cinfo->output_scanline+1) & DITHER_MASK];\n  unsigned int r, g, b;\n  JLONG rgb;\n  SHIFT_TEMPS\n\n  inptr00 = input_buf[0][in_row_group_ctr*2];\n  inptr01 = input_buf[0][in_row_group_ctr*2 + 1];\n  inptr1 = input_buf[1][in_row_group_ctr];\n  inptr2 = input_buf[2][in_row_group_ctr];\n  outptr0 = output_buf[0];\n  outptr1 = output_buf[1];\n\n  /* Loop for each group of output pixels */\n  for (col = cinfo->output_width >> 1; col > 0; col--) {\n    /* Do the chroma part of the calculation */\n    cb = GETJSAMPLE(*inptr1++);\n    cr = GETJSAMPLE(*inptr2++);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n\n    /* Fetch 4 Y values and emit 4 pixels */\n    y  = GETJSAMPLE(*inptr00++);\n    r = range_limit[DITHER_565_R(y + cred, d0)];\n    g = range_limit[DITHER_565_G(y + cgreen, d0)];\n    b = range_limit[DITHER_565_B(y + cblue, d0)];\n    d0 = DITHER_ROTATE(d0);\n    rgb = PACK_SHORT_565(r, g, b);\n\n    y  = GETJSAMPLE(*inptr00++);\n    r = range_limit[DITHER_565_R(y + cred, d1)];\n    g = range_limit[DITHER_565_G(y + cgreen, d1)];\n    b = range_limit[DITHER_565_B(y + cblue, d1)];\n    d1 = DITHER_ROTATE(d1);\n    rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));\n\n    WRITE_TWO_PIXELS(outptr0, rgb);\n    outptr0 += 4;\n\n    y  = GETJSAMPLE(*inptr01++);\n    r = range_limit[DITHER_565_R(y + cred, d0)];\n    g = range_limit[DITHER_565_G(y + cgreen, d0)];\n    b = range_limit[DITHER_565_B(y + cblue, d0)];\n    d0 = DITHER_ROTATE(d0);\n    rgb = PACK_SHORT_565(r, g, b);\n\n    y  = GETJSAMPLE(*inptr01++);\n    r = range_limit[DITHER_565_R(y + cred, d1)];\n    g = range_limit[DITHER_565_G(y + cgreen, d1)];\n    b = range_limit[DITHER_565_B(y + cblue, d1)];\n    d1 = DITHER_ROTATE(d1);\n    rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));\n\n    WRITE_TWO_PIXELS(outptr1, rgb);\n    outptr1 += 4;\n  }\n\n  /* If image width is odd, do the last output column separately */\n  if (cinfo->output_width & 1) {\n    cb = GETJSAMPLE(*inptr1);\n    cr = GETJSAMPLE(*inptr2);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n\n    y  = GETJSAMPLE(*inptr00);\n    r = range_limit[DITHER_565_R(y + cred, d0)];\n    g = range_limit[DITHER_565_G(y + cgreen, d0)];\n    b = range_limit[DITHER_565_B(y + cblue, d0)];\n    rgb = PACK_SHORT_565(r, g, b);\n    *(INT16*)outptr0 = (INT16)rgb;\n\n    y  = GETJSAMPLE(*inptr01);\n    r = range_limit[DITHER_565_R(y + cred, d1)];\n    g = range_limit[DITHER_565_G(y + cgreen, d1)];\n    b = range_limit[DITHER_565_B(y + cblue, d1)];\n    rgb = PACK_SHORT_565(r, g, b);\n    *(INT16*)outptr1 = (INT16)rgb;\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdmrgext.c",
    "content": "/*\n * jdmrgext.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2011, 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains code for merged upsampling/color conversion.\n */\n\n\n/* This file is included by jdmerge.c */\n\n\n/*\n * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.\n */\n\nINLINE\nLOCAL(void)\nh2v1_merged_upsample_internal (j_decompress_ptr cinfo,\n                               JSAMPIMAGE input_buf,\n                               JDIMENSION in_row_group_ctr,\n                               JSAMPARRAY output_buf)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  register int y, cred, cgreen, cblue;\n  int cb, cr;\n  register JSAMPROW outptr;\n  JSAMPROW inptr0, inptr1, inptr2;\n  JDIMENSION col;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  int * Crrtab = upsample->Cr_r_tab;\n  int * Cbbtab = upsample->Cb_b_tab;\n  JLONG * Crgtab = upsample->Cr_g_tab;\n  JLONG * Cbgtab = upsample->Cb_g_tab;\n  SHIFT_TEMPS\n\n  inptr0 = input_buf[0][in_row_group_ctr];\n  inptr1 = input_buf[1][in_row_group_ctr];\n  inptr2 = input_buf[2][in_row_group_ctr];\n  outptr = output_buf[0];\n  /* Loop for each pair of output pixels */\n  for (col = cinfo->output_width >> 1; col > 0; col--) {\n    /* Do the chroma part of the calculation */\n    cb = GETJSAMPLE(*inptr1++);\n    cr = GETJSAMPLE(*inptr2++);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n    /* Fetch 2 Y values and emit 2 pixels */\n    y  = GETJSAMPLE(*inptr0++);\n    outptr[RGB_RED] =   range_limit[y + cred];\n    outptr[RGB_GREEN] = range_limit[y + cgreen];\n    outptr[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr[RGB_ALPHA] = 0xFF;\n#endif\n    outptr += RGB_PIXELSIZE;\n    y  = GETJSAMPLE(*inptr0++);\n    outptr[RGB_RED] =   range_limit[y + cred];\n    outptr[RGB_GREEN] = range_limit[y + cgreen];\n    outptr[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr[RGB_ALPHA] = 0xFF;\n#endif\n    outptr += RGB_PIXELSIZE;\n  }\n  /* If image width is odd, do the last output column separately */\n  if (cinfo->output_width & 1) {\n    cb = GETJSAMPLE(*inptr1);\n    cr = GETJSAMPLE(*inptr2);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n    y  = GETJSAMPLE(*inptr0);\n    outptr[RGB_RED] =   range_limit[y + cred];\n    outptr[RGB_GREEN] = range_limit[y + cgreen];\n    outptr[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr[RGB_ALPHA] = 0xFF;\n#endif\n  }\n}\n\n\n/*\n * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.\n */\n\nINLINE\nLOCAL(void)\nh2v2_merged_upsample_internal (j_decompress_ptr cinfo,\n                               JSAMPIMAGE input_buf,\n                               JDIMENSION in_row_group_ctr,\n                               JSAMPARRAY output_buf)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  register int y, cred, cgreen, cblue;\n  int cb, cr;\n  register JSAMPROW outptr0, outptr1;\n  JSAMPROW inptr00, inptr01, inptr1, inptr2;\n  JDIMENSION col;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  int * Crrtab = upsample->Cr_r_tab;\n  int * Cbbtab = upsample->Cb_b_tab;\n  JLONG * Crgtab = upsample->Cr_g_tab;\n  JLONG * Cbgtab = upsample->Cb_g_tab;\n  SHIFT_TEMPS\n\n  inptr00 = input_buf[0][in_row_group_ctr*2];\n  inptr01 = input_buf[0][in_row_group_ctr*2 + 1];\n  inptr1 = input_buf[1][in_row_group_ctr];\n  inptr2 = input_buf[2][in_row_group_ctr];\n  outptr0 = output_buf[0];\n  outptr1 = output_buf[1];\n  /* Loop for each group of output pixels */\n  for (col = cinfo->output_width >> 1; col > 0; col--) {\n    /* Do the chroma part of the calculation */\n    cb = GETJSAMPLE(*inptr1++);\n    cr = GETJSAMPLE(*inptr2++);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n    /* Fetch 4 Y values and emit 4 pixels */\n    y  = GETJSAMPLE(*inptr00++);\n    outptr0[RGB_RED] =   range_limit[y + cred];\n    outptr0[RGB_GREEN] = range_limit[y + cgreen];\n    outptr0[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr0[RGB_ALPHA] = 0xFF;\n#endif\n    outptr0 += RGB_PIXELSIZE;\n    y  = GETJSAMPLE(*inptr00++);\n    outptr0[RGB_RED] =   range_limit[y + cred];\n    outptr0[RGB_GREEN] = range_limit[y + cgreen];\n    outptr0[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr0[RGB_ALPHA] = 0xFF;\n#endif\n    outptr0 += RGB_PIXELSIZE;\n    y  = GETJSAMPLE(*inptr01++);\n    outptr1[RGB_RED] =   range_limit[y + cred];\n    outptr1[RGB_GREEN] = range_limit[y + cgreen];\n    outptr1[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr1[RGB_ALPHA] = 0xFF;\n#endif\n    outptr1 += RGB_PIXELSIZE;\n    y  = GETJSAMPLE(*inptr01++);\n    outptr1[RGB_RED] =   range_limit[y + cred];\n    outptr1[RGB_GREEN] = range_limit[y + cgreen];\n    outptr1[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr1[RGB_ALPHA] = 0xFF;\n#endif\n    outptr1 += RGB_PIXELSIZE;\n  }\n  /* If image width is odd, do the last output column separately */\n  if (cinfo->output_width & 1) {\n    cb = GETJSAMPLE(*inptr1);\n    cr = GETJSAMPLE(*inptr2);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n    y  = GETJSAMPLE(*inptr00);\n    outptr0[RGB_RED] =   range_limit[y + cred];\n    outptr0[RGB_GREEN] = range_limit[y + cgreen];\n    outptr0[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr0[RGB_ALPHA] = 0xFF;\n#endif\n    y  = GETJSAMPLE(*inptr01);\n    outptr1[RGB_RED] =   range_limit[y + cred];\n    outptr1[RGB_GREEN] = range_limit[y + cgreen];\n    outptr1[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr1[RGB_ALPHA] = 0xFF;\n#endif\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdphuff.c",
    "content": "/*\n * jdphuff.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1995-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains Huffman entropy decoding routines for progressive JPEG.\n *\n * Much of the complexity here has to do with supporting input suspension.\n * If the data source module demands suspension, we want to be able to back\n * up to the start of the current MCU.  To do this, we copy state variables\n * into local working storage, and update them back to the permanent\n * storage only upon successful completion of an MCU.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdhuff.h\"             /* Declarations shared with jdhuff.c */\n\n\n#ifdef D_PROGRESSIVE_SUPPORTED\n\n/*\n * Expanded entropy decoder object for progressive Huffman decoding.\n *\n * The savable_state subrecord contains fields that change within an MCU,\n * but must not be updated permanently until we complete the MCU.\n */\n\ntypedef struct {\n  unsigned int EOBRUN;                  /* remaining EOBs in EOBRUN */\n  int last_dc_val[MAX_COMPS_IN_SCAN];   /* last DC coef for each component */\n} savable_state;\n\n/* This macro is to work around compilers with missing or broken\n * structure assignment.  You'll need to fix this code if you have\n * such a compiler and you change MAX_COMPS_IN_SCAN.\n */\n\n#ifndef NO_STRUCT_ASSIGN\n#define ASSIGN_STATE(dest,src)  ((dest) = (src))\n#else\n#if MAX_COMPS_IN_SCAN == 4\n#define ASSIGN_STATE(dest,src)  \\\n        ((dest).EOBRUN = (src).EOBRUN, \\\n         (dest).last_dc_val[0] = (src).last_dc_val[0], \\\n         (dest).last_dc_val[1] = (src).last_dc_val[1], \\\n         (dest).last_dc_val[2] = (src).last_dc_val[2], \\\n         (dest).last_dc_val[3] = (src).last_dc_val[3])\n#endif\n#endif\n\n\ntypedef struct {\n  struct jpeg_entropy_decoder pub; /* public fields */\n\n  /* These fields are loaded into local variables at start of each MCU.\n   * In case of suspension, we exit WITHOUT updating them.\n   */\n  bitread_perm_state bitstate;  /* Bit buffer at start of MCU */\n  savable_state saved;          /* Other state at start of MCU */\n\n  /* These fields are NOT loaded into local working state. */\n  unsigned int restarts_to_go;  /* MCUs left in this restart interval */\n\n  /* Pointers to derived tables (these workspaces have image lifespan) */\n  d_derived_tbl *derived_tbls[NUM_HUFF_TBLS];\n\n  d_derived_tbl *ac_derived_tbl; /* active table during an AC scan */\n} phuff_entropy_decoder;\n\ntypedef phuff_entropy_decoder *phuff_entropy_ptr;\n\n/* Forward declarations */\nMETHODDEF(boolean) decode_mcu_DC_first (j_decompress_ptr cinfo,\n                                        JBLOCKROW *MCU_data);\nMETHODDEF(boolean) decode_mcu_AC_first (j_decompress_ptr cinfo,\n                                        JBLOCKROW *MCU_data);\nMETHODDEF(boolean) decode_mcu_DC_refine (j_decompress_ptr cinfo,\n                                         JBLOCKROW *MCU_data);\nMETHODDEF(boolean) decode_mcu_AC_refine (j_decompress_ptr cinfo,\n                                         JBLOCKROW *MCU_data);\n\n\n/*\n * Initialize for a Huffman-compressed scan.\n */\n\nMETHODDEF(void)\nstart_pass_phuff_decoder (j_decompress_ptr cinfo)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  boolean is_DC_band, bad;\n  int ci, coefi, tbl;\n  d_derived_tbl **pdtbl;\n  int *coef_bit_ptr;\n  jpeg_component_info *compptr;\n\n  is_DC_band = (cinfo->Ss == 0);\n\n  /* Validate scan parameters */\n  bad = FALSE;\n  if (is_DC_band) {\n    if (cinfo->Se != 0)\n      bad = TRUE;\n  } else {\n    /* need not check Ss/Se < 0 since they came from unsigned bytes */\n    if (cinfo->Ss > cinfo->Se || cinfo->Se >= DCTSIZE2)\n      bad = TRUE;\n    /* AC scans may have only one component */\n    if (cinfo->comps_in_scan != 1)\n      bad = TRUE;\n  }\n  if (cinfo->Ah != 0) {\n    /* Successive approximation refinement scan: must have Al = Ah-1. */\n    if (cinfo->Al != cinfo->Ah-1)\n      bad = TRUE;\n  }\n  if (cinfo->Al > 13)           /* need not check for < 0 */\n    bad = TRUE;\n  /* Arguably the maximum Al value should be less than 13 for 8-bit precision,\n   * but the spec doesn't say so, and we try to be liberal about what we\n   * accept.  Note: large Al values could result in out-of-range DC\n   * coefficients during early scans, leading to bizarre displays due to\n   * overflows in the IDCT math.  But we won't crash.\n   */\n  if (bad)\n    ERREXIT4(cinfo, JERR_BAD_PROGRESSION,\n             cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);\n  /* Update progression status, and verify that scan order is legal.\n   * Note that inter-scan inconsistencies are treated as warnings\n   * not fatal errors ... not clear if this is right way to behave.\n   */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    int cindex = cinfo->cur_comp_info[ci]->component_index;\n    coef_bit_ptr = & cinfo->coef_bits[cindex][0];\n    if (!is_DC_band && coef_bit_ptr[0] < 0) /* AC without prior DC scan */\n      WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);\n    for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {\n      int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];\n      if (cinfo->Ah != expected)\n        WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);\n      coef_bit_ptr[coefi] = cinfo->Al;\n    }\n  }\n\n  /* Select MCU decoding routine */\n  if (cinfo->Ah == 0) {\n    if (is_DC_band)\n      entropy->pub.decode_mcu = decode_mcu_DC_first;\n    else\n      entropy->pub.decode_mcu = decode_mcu_AC_first;\n  } else {\n    if (is_DC_band)\n      entropy->pub.decode_mcu = decode_mcu_DC_refine;\n    else\n      entropy->pub.decode_mcu = decode_mcu_AC_refine;\n  }\n\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    /* Make sure requested tables are present, and compute derived tables.\n     * We may build same derived table more than once, but it's not expensive.\n     */\n    if (is_DC_band) {\n      if (cinfo->Ah == 0) {     /* DC refinement needs no table */\n        tbl = compptr->dc_tbl_no;\n        pdtbl = entropy->derived_tbls + tbl;\n        jpeg_make_d_derived_tbl(cinfo, TRUE, tbl, pdtbl);\n      }\n    } else {\n      tbl = compptr->ac_tbl_no;\n      pdtbl = entropy->derived_tbls + tbl;\n      jpeg_make_d_derived_tbl(cinfo, FALSE, tbl, pdtbl);\n      /* remember the single active table */\n      entropy->ac_derived_tbl = entropy->derived_tbls[tbl];\n    }\n    /* Initialize DC predictions to 0 */\n    entropy->saved.last_dc_val[ci] = 0;\n  }\n\n  /* Initialize bitread state variables */\n  entropy->bitstate.bits_left = 0;\n  entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */\n  entropy->pub.insufficient_data = FALSE;\n\n  /* Initialize private state variables */\n  entropy->saved.EOBRUN = 0;\n\n  /* Initialize restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n}\n\n\n/*\n * Figure F.12: extend sign bit.\n * On some machines, a shift and add will be faster than a table lookup.\n */\n\n#define AVOID_TABLES\n#ifdef AVOID_TABLES\n\n#define NEG_1 ((unsigned)-1)\n#define HUFF_EXTEND(x,s)  ((x) < (1<<((s)-1)) ? (x) + (((NEG_1)<<(s)) + 1) : (x))\n\n#else\n\n#define HUFF_EXTEND(x,s)  ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))\n\nstatic const int extend_test[16] =   /* entry n is 2**(n-1) */\n  { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,\n    0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };\n\nstatic const int extend_offset[16] = /* entry n is (-1 << n) + 1 */\n  { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,\n    ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,\n    ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,\n    ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };\n\n#endif /* AVOID_TABLES */\n\n\n/*\n * Check for a restart marker & resynchronize decoder.\n * Returns FALSE if must suspend.\n */\n\nLOCAL(boolean)\nprocess_restart (j_decompress_ptr cinfo)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  int ci;\n\n  /* Throw away any unused bits remaining in bit buffer; */\n  /* include any full bytes in next_marker's count of discarded bytes */\n  cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;\n  entropy->bitstate.bits_left = 0;\n\n  /* Advance past the RSTn marker */\n  if (! (*cinfo->marker->read_restart_marker) (cinfo))\n    return FALSE;\n\n  /* Re-initialize DC predictions to 0 */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++)\n    entropy->saved.last_dc_val[ci] = 0;\n  /* Re-init EOB run count, too */\n  entropy->saved.EOBRUN = 0;\n\n  /* Reset restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n\n  /* Reset out-of-data flag, unless read_restart_marker left us smack up\n   * against a marker.  In that case we will end up treating the next data\n   * segment as empty, and we can avoid producing bogus output pixels by\n   * leaving the flag set.\n   */\n  if (cinfo->unread_marker == 0)\n    entropy->pub.insufficient_data = FALSE;\n\n  return TRUE;\n}\n\n\n/*\n * Huffman MCU decoding.\n * Each of these routines decodes and returns one MCU's worth of\n * Huffman-compressed coefficients.\n * The coefficients are reordered from zigzag order into natural array order,\n * but are not dequantized.\n *\n * The i'th block of the MCU is stored into the block pointed to by\n * MCU_data[i].  WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.\n *\n * We return FALSE if data source requested suspension.  In that case no\n * changes have been made to permanent state.  (Exception: some output\n * coefficients may already have been assigned.  This is harmless for\n * spectral selection, since we'll just re-assign them on the next call.\n * Successive approximation AC refinement has to be more careful, however.)\n */\n\n/*\n * MCU decoding for DC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\ndecode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  int Al = cinfo->Al;\n  register int s, r;\n  int blkn, ci;\n  JBLOCKROW block;\n  BITREAD_STATE_VARS;\n  savable_state state;\n  d_derived_tbl *tbl;\n  jpeg_component_info *compptr;\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n        return FALSE;\n  }\n\n  /* If we've run out of data, just leave the MCU set to zeroes.\n   * This way, we return uniform gray for the remainder of the segment.\n   */\n  if (! entropy->pub.insufficient_data) {\n\n    /* Load up working state */\n    BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n    ASSIGN_STATE(state, entropy->saved);\n\n    /* Outer loop handles each block in the MCU */\n\n    for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n      block = MCU_data[blkn];\n      ci = cinfo->MCU_membership[blkn];\n      compptr = cinfo->cur_comp_info[ci];\n      tbl = entropy->derived_tbls[compptr->dc_tbl_no];\n\n      /* Decode a single block's worth of coefficients */\n\n      /* Section F.2.2.1: decode the DC coefficient difference */\n      HUFF_DECODE(s, br_state, tbl, return FALSE, label1);\n      if (s) {\n        CHECK_BIT_BUFFER(br_state, s, return FALSE);\n        r = GET_BITS(s);\n        s = HUFF_EXTEND(r, s);\n      }\n\n      /* Convert DC difference to actual value, update last_dc_val */\n      s += state.last_dc_val[ci];\n      state.last_dc_val[ci] = s;\n      /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */\n      (*block)[0] = (JCOEF) LEFT_SHIFT(s, Al);\n    }\n\n    /* Completed MCU, so update state */\n    BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n    ASSIGN_STATE(entropy->saved, state);\n  }\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for AC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\ndecode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  int Se = cinfo->Se;\n  int Al = cinfo->Al;\n  register int s, k, r;\n  unsigned int EOBRUN;\n  JBLOCKROW block;\n  BITREAD_STATE_VARS;\n  d_derived_tbl *tbl;\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n        return FALSE;\n  }\n\n  /* If we've run out of data, just leave the MCU set to zeroes.\n   * This way, we return uniform gray for the remainder of the segment.\n   */\n  if (! entropy->pub.insufficient_data) {\n\n    /* Load up working state.\n     * We can avoid loading/saving bitread state if in an EOB run.\n     */\n    EOBRUN = entropy->saved.EOBRUN;     /* only part of saved state we need */\n\n    /* There is always only one block per MCU */\n\n    if (EOBRUN > 0)             /* if it's a band of zeroes... */\n      EOBRUN--;                 /* ...process it now (we do nothing) */\n    else {\n      BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n      block = MCU_data[0];\n      tbl = entropy->ac_derived_tbl;\n\n      for (k = cinfo->Ss; k <= Se; k++) {\n        HUFF_DECODE(s, br_state, tbl, return FALSE, label2);\n        r = s >> 4;\n        s &= 15;\n        if (s) {\n          k += r;\n          CHECK_BIT_BUFFER(br_state, s, return FALSE);\n          r = GET_BITS(s);\n          s = HUFF_EXTEND(r, s);\n          /* Scale and output coefficient in natural (dezigzagged) order */\n          (*block)[jpeg_natural_order[k]] = (JCOEF) LEFT_SHIFT(s, Al);\n        } else {\n          if (r == 15) {        /* ZRL */\n            k += 15;            /* skip 15 zeroes in band */\n          } else {              /* EOBr, run length is 2^r + appended bits */\n            EOBRUN = 1 << r;\n            if (r) {            /* EOBr, r > 0 */\n              CHECK_BIT_BUFFER(br_state, r, return FALSE);\n              r = GET_BITS(r);\n              EOBRUN += r;\n            }\n            EOBRUN--;           /* this band is processed at this moment */\n            break;              /* force end-of-band */\n          }\n        }\n      }\n\n      BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n    }\n\n    /* Completed MCU, so update state */\n    entropy->saved.EOBRUN = EOBRUN;     /* only part of saved state we need */\n  }\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for DC successive approximation refinement scan.\n * Note: we assume such scans can be multi-component, although the spec\n * is not very clear on the point.\n */\n\nMETHODDEF(boolean)\ndecode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  int p1 = 1 << cinfo->Al;      /* 1 in the bit position being coded */\n  int blkn;\n  JBLOCKROW block;\n  BITREAD_STATE_VARS;\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n        return FALSE;\n  }\n\n  /* Not worth the cycles to check insufficient_data here,\n   * since we will not change the data anyway if we read zeroes.\n   */\n\n  /* Load up working state */\n  BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n\n  /* Outer loop handles each block in the MCU */\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n\n    /* Encoded data is simply the next bit of the two's-complement DC value */\n    CHECK_BIT_BUFFER(br_state, 1, return FALSE);\n    if (GET_BITS(1))\n      (*block)[0] |= p1;\n    /* Note: since we use |=, repeating the assignment later is safe */\n  }\n\n  /* Completed MCU, so update state */\n  BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for AC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\ndecode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  int Se = cinfo->Se;\n  int p1 = 1 << cinfo->Al;        /* 1 in the bit position being coded */\n  int m1 = (NEG_1) << cinfo->Al;  /* -1 in the bit position being coded */\n  register int s, k, r;\n  unsigned int EOBRUN;\n  JBLOCKROW block;\n  JCOEFPTR thiscoef;\n  BITREAD_STATE_VARS;\n  d_derived_tbl *tbl;\n  int num_newnz;\n  int newnz_pos[DCTSIZE2];\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n        return FALSE;\n  }\n\n  /* If we've run out of data, don't modify the MCU.\n   */\n  if (! entropy->pub.insufficient_data) {\n\n    /* Load up working state */\n    BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n    EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */\n\n    /* There is always only one block per MCU */\n    block = MCU_data[0];\n    tbl = entropy->ac_derived_tbl;\n\n    /* If we are forced to suspend, we must undo the assignments to any newly\n     * nonzero coefficients in the block, because otherwise we'd get confused\n     * next time about which coefficients were already nonzero.\n     * But we need not undo addition of bits to already-nonzero coefficients;\n     * instead, we can test the current bit to see if we already did it.\n     */\n    num_newnz = 0;\n\n    /* initialize coefficient loop counter to start of band */\n    k = cinfo->Ss;\n\n    if (EOBRUN == 0) {\n      for (; k <= Se; k++) {\n        HUFF_DECODE(s, br_state, tbl, goto undoit, label3);\n        r = s >> 4;\n        s &= 15;\n        if (s) {\n          if (s != 1)           /* size of new coef should always be 1 */\n            WARNMS(cinfo, JWRN_HUFF_BAD_CODE);\n          CHECK_BIT_BUFFER(br_state, 1, goto undoit);\n          if (GET_BITS(1))\n            s = p1;             /* newly nonzero coef is positive */\n          else\n            s = m1;             /* newly nonzero coef is negative */\n        } else {\n          if (r != 15) {\n            EOBRUN = 1 << r;    /* EOBr, run length is 2^r + appended bits */\n            if (r) {\n              CHECK_BIT_BUFFER(br_state, r, goto undoit);\n              r = GET_BITS(r);\n              EOBRUN += r;\n            }\n            break;              /* rest of block is handled by EOB logic */\n          }\n          /* note s = 0 for processing ZRL */\n        }\n        /* Advance over already-nonzero coefs and r still-zero coefs,\n         * appending correction bits to the nonzeroes.  A correction bit is 1\n         * if the absolute value of the coefficient must be increased.\n         */\n        do {\n          thiscoef = *block + jpeg_natural_order[k];\n          if (*thiscoef != 0) {\n            CHECK_BIT_BUFFER(br_state, 1, goto undoit);\n            if (GET_BITS(1)) {\n              if ((*thiscoef & p1) == 0) { /* do nothing if already set it */\n                if (*thiscoef >= 0)\n                  *thiscoef += p1;\n                else\n                  *thiscoef += m1;\n              }\n            }\n          } else {\n            if (--r < 0)\n              break;            /* reached target zero coefficient */\n          }\n          k++;\n        } while (k <= Se);\n        if (s) {\n          int pos = jpeg_natural_order[k];\n          /* Output newly nonzero coefficient */\n          (*block)[pos] = (JCOEF) s;\n          /* Remember its position in case we have to suspend */\n          newnz_pos[num_newnz++] = pos;\n        }\n      }\n    }\n\n    if (EOBRUN > 0) {\n      /* Scan any remaining coefficient positions after the end-of-band\n       * (the last newly nonzero coefficient, if any).  Append a correction\n       * bit to each already-nonzero coefficient.  A correction bit is 1\n       * if the absolute value of the coefficient must be increased.\n       */\n      for (; k <= Se; k++) {\n        thiscoef = *block + jpeg_natural_order[k];\n        if (*thiscoef != 0) {\n          CHECK_BIT_BUFFER(br_state, 1, goto undoit);\n          if (GET_BITS(1)) {\n            if ((*thiscoef & p1) == 0) { /* do nothing if already changed it */\n              if (*thiscoef >= 0)\n                *thiscoef += p1;\n              else\n                *thiscoef += m1;\n            }\n          }\n        }\n      }\n      /* Count one block completed in EOB run */\n      EOBRUN--;\n    }\n\n    /* Completed MCU, so update state */\n    BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n    entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */\n  }\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n\nundoit:\n  /* Re-zero any output coefficients that we made newly nonzero */\n  while (num_newnz > 0)\n    (*block)[newnz_pos[--num_newnz]] = 0;\n\n  return FALSE;\n}\n\n\n/*\n * Module initialization routine for progressive Huffman entropy decoding.\n */\n\nGLOBAL(void)\njinit_phuff_decoder (j_decompress_ptr cinfo)\n{\n  phuff_entropy_ptr entropy;\n  int *coef_bit_ptr;\n  int ci, i;\n\n  entropy = (phuff_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(phuff_entropy_decoder));\n  cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;\n  entropy->pub.start_pass = start_pass_phuff_decoder;\n\n  /* Mark derived tables unallocated */\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    entropy->derived_tbls[i] = NULL;\n  }\n\n  /* Create progression status table */\n  cinfo->coef_bits = (int (*)[DCTSIZE2])\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                cinfo->num_components*DCTSIZE2*sizeof(int));\n  coef_bit_ptr = & cinfo->coef_bits[0][0];\n  for (ci = 0; ci < cinfo->num_components; ci++)\n    for (i = 0; i < DCTSIZE2; i++)\n      *coef_bit_ptr++ = -1;\n}\n\n#endif /* D_PROGRESSIVE_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdpostct.c",
    "content": "/*\n * jdpostct.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains the decompression postprocessing controller.\n * This controller manages the upsampling, color conversion, and color\n * quantization/reduction steps; specifically, it controls the buffering\n * between upsample/color conversion and color quantization/reduction.\n *\n * If no color quantization/reduction is required, then this module has no\n * work to do, and it just hands off to the upsample/color conversion code.\n * An integrated upsample/convert/quantize process would replace this module\n * entirely.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_d_post_controller pub; /* public fields */\n\n  /* Color quantization source buffer: this holds output data from\n   * the upsample/color conversion step to be passed to the quantizer.\n   * For two-pass color quantization, we need a full-image buffer;\n   * for one-pass operation, a strip buffer is sufficient.\n   */\n  jvirt_sarray_ptr whole_image; /* virtual array, or NULL if one-pass */\n  JSAMPARRAY buffer;            /* strip buffer, or current strip of virtual */\n  JDIMENSION strip_height;      /* buffer size in rows */\n  /* for two-pass mode only: */\n  JDIMENSION starting_row;      /* row # of first row in current strip */\n  JDIMENSION next_row;          /* index of next row to fill/empty in strip */\n} my_post_controller;\n\ntypedef my_post_controller *my_post_ptr;\n\n\n/* Forward declarations */\nMETHODDEF(void) post_process_1pass\n        (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,\n         JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail,\n         JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n         JDIMENSION out_rows_avail);\n#ifdef QUANT_2PASS_SUPPORTED\nMETHODDEF(void) post_process_prepass\n        (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,\n         JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail,\n         JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n         JDIMENSION out_rows_avail);\nMETHODDEF(void) post_process_2pass\n        (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,\n         JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail,\n         JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n         JDIMENSION out_rows_avail);\n#endif\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_post_ptr post = (my_post_ptr) cinfo->post;\n\n  switch (pass_mode) {\n  case JBUF_PASS_THRU:\n    if (cinfo->quantize_colors) {\n      /* Single-pass processing with color quantization. */\n      post->pub.post_process_data = post_process_1pass;\n      /* We could be doing buffered-image output before starting a 2-pass\n       * color quantization; in that case, jinit_d_post_controller did not\n       * allocate a strip buffer.  Use the virtual-array buffer as workspace.\n       */\n      if (post->buffer == NULL) {\n        post->buffer = (*cinfo->mem->access_virt_sarray)\n          ((j_common_ptr) cinfo, post->whole_image,\n           (JDIMENSION) 0, post->strip_height, TRUE);\n      }\n    } else {\n      /* For single-pass processing without color quantization,\n       * I have no work to do; just call the upsampler directly.\n       */\n      post->pub.post_process_data = cinfo->upsample->upsample;\n    }\n    break;\n#ifdef QUANT_2PASS_SUPPORTED\n  case JBUF_SAVE_AND_PASS:\n    /* First pass of 2-pass quantization */\n    if (post->whole_image == NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    post->pub.post_process_data = post_process_prepass;\n    break;\n  case JBUF_CRANK_DEST:\n    /* Second pass of 2-pass quantization */\n    if (post->whole_image == NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    post->pub.post_process_data = post_process_2pass;\n    break;\n#endif /* QUANT_2PASS_SUPPORTED */\n  default:\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    break;\n  }\n  post->starting_row = post->next_row = 0;\n}\n\n\n/*\n * Process some data in the one-pass (strip buffer) case.\n * This is used for color precision reduction as well as one-pass quantization.\n */\n\nMETHODDEF(void)\npost_process_1pass (j_decompress_ptr cinfo,\n                    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n                    JDIMENSION in_row_groups_avail,\n                    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n                    JDIMENSION out_rows_avail)\n{\n  my_post_ptr post = (my_post_ptr) cinfo->post;\n  JDIMENSION num_rows, max_rows;\n\n  /* Fill the buffer, but not more than what we can dump out in one go. */\n  /* Note we rely on the upsampler to detect bottom of image. */\n  max_rows = out_rows_avail - *out_row_ctr;\n  if (max_rows > post->strip_height)\n    max_rows = post->strip_height;\n  num_rows = 0;\n  (*cinfo->upsample->upsample) (cinfo,\n                input_buf, in_row_group_ctr, in_row_groups_avail,\n                post->buffer, &num_rows, max_rows);\n  /* Quantize and emit data. */\n  (*cinfo->cquantize->color_quantize) (cinfo,\n                post->buffer, output_buf + *out_row_ctr, (int) num_rows);\n  *out_row_ctr += num_rows;\n}\n\n\n#ifdef QUANT_2PASS_SUPPORTED\n\n/*\n * Process some data in the first pass of 2-pass quantization.\n */\n\nMETHODDEF(void)\npost_process_prepass (j_decompress_ptr cinfo,\n                      JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n                      JDIMENSION in_row_groups_avail,\n                      JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n                      JDIMENSION out_rows_avail)\n{\n  my_post_ptr post = (my_post_ptr) cinfo->post;\n  JDIMENSION old_next_row, num_rows;\n\n  /* Reposition virtual buffer if at start of strip. */\n  if (post->next_row == 0) {\n    post->buffer = (*cinfo->mem->access_virt_sarray)\n        ((j_common_ptr) cinfo, post->whole_image,\n         post->starting_row, post->strip_height, TRUE);\n  }\n\n  /* Upsample some data (up to a strip height's worth). */\n  old_next_row = post->next_row;\n  (*cinfo->upsample->upsample) (cinfo,\n                input_buf, in_row_group_ctr, in_row_groups_avail,\n                post->buffer, &post->next_row, post->strip_height);\n\n  /* Allow quantizer to scan new data.  No data is emitted, */\n  /* but we advance out_row_ctr so outer loop can tell when we're done. */\n  if (post->next_row > old_next_row) {\n    num_rows = post->next_row - old_next_row;\n    (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row,\n                                         (JSAMPARRAY) NULL, (int) num_rows);\n    *out_row_ctr += num_rows;\n  }\n\n  /* Advance if we filled the strip. */\n  if (post->next_row >= post->strip_height) {\n    post->starting_row += post->strip_height;\n    post->next_row = 0;\n  }\n}\n\n\n/*\n * Process some data in the second pass of 2-pass quantization.\n */\n\nMETHODDEF(void)\npost_process_2pass (j_decompress_ptr cinfo,\n                    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n                    JDIMENSION in_row_groups_avail,\n                    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n                    JDIMENSION out_rows_avail)\n{\n  my_post_ptr post = (my_post_ptr) cinfo->post;\n  JDIMENSION num_rows, max_rows;\n\n  /* Reposition virtual buffer if at start of strip. */\n  if (post->next_row == 0) {\n    post->buffer = (*cinfo->mem->access_virt_sarray)\n        ((j_common_ptr) cinfo, post->whole_image,\n         post->starting_row, post->strip_height, FALSE);\n  }\n\n  /* Determine number of rows to emit. */\n  num_rows = post->strip_height - post->next_row; /* available in strip */\n  max_rows = out_rows_avail - *out_row_ctr; /* available in output area */\n  if (num_rows > max_rows)\n    num_rows = max_rows;\n  /* We have to check bottom of image here, can't depend on upsampler. */\n  max_rows = cinfo->output_height - post->starting_row;\n  if (num_rows > max_rows)\n    num_rows = max_rows;\n\n  /* Quantize and emit data. */\n  (*cinfo->cquantize->color_quantize) (cinfo,\n                post->buffer + post->next_row, output_buf + *out_row_ctr,\n                (int) num_rows);\n  *out_row_ctr += num_rows;\n\n  /* Advance if we filled the strip. */\n  post->next_row += num_rows;\n  if (post->next_row >= post->strip_height) {\n    post->starting_row += post->strip_height;\n    post->next_row = 0;\n  }\n}\n\n#endif /* QUANT_2PASS_SUPPORTED */\n\n\n/*\n * Initialize postprocessing controller.\n */\n\nGLOBAL(void)\njinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer)\n{\n  my_post_ptr post;\n\n  post = (my_post_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_post_controller));\n  cinfo->post = (struct jpeg_d_post_controller *) post;\n  post->pub.start_pass = start_pass_dpost;\n  post->whole_image = NULL;     /* flag for no virtual arrays */\n  post->buffer = NULL;          /* flag for no strip buffer */\n\n  /* Create the quantization buffer, if needed */\n  if (cinfo->quantize_colors) {\n    /* The buffer strip height is max_v_samp_factor, which is typically\n     * an efficient number of rows for upsampling to return.\n     * (In the presence of output rescaling, we might want to be smarter?)\n     */\n    post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor;\n    if (need_full_buffer) {\n      /* Two-pass color quantization: need full-image storage. */\n      /* We round up the number of rows to a multiple of the strip height. */\n#ifdef QUANT_2PASS_SUPPORTED\n      post->whole_image = (*cinfo->mem->request_virt_sarray)\n        ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n         cinfo->output_width * cinfo->out_color_components,\n         (JDIMENSION) jround_up((long) cinfo->output_height,\n                                (long) post->strip_height),\n         post->strip_height);\n#else\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n#endif /* QUANT_2PASS_SUPPORTED */\n    } else {\n      /* One-pass color quantization: just make a strip buffer. */\n      post->buffer = (*cinfo->mem->alloc_sarray)\n        ((j_common_ptr) cinfo, JPOOL_IMAGE,\n         cinfo->output_width * cinfo->out_color_components,\n         post->strip_height);\n    }\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdsample.c",
    "content": "/*\n * jdsample.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2010, 2015-2016, D. R. Commander.\n * Copyright (C) 2014, MIPS Technologies, Inc., California.\n * Copyright (C) 2015, Google, Inc.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains upsampling routines.\n *\n * Upsampling input data is counted in \"row groups\".  A row group\n * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)\n * sample rows of each component.  Upsampling will normally produce\n * max_v_samp_factor pixel rows from each row group (but this could vary\n * if the upsampler is applying a scale factor of its own).\n *\n * An excellent reference for image resampling is\n *   Digital Image Warping, George Wolberg, 1990.\n *   Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.\n */\n\n#include \"jinclude.h\"\n#include \"jdsample.h\"\n#include \"jsimd.h\"\n#include \"jpegcomp.h\"\n\n\n\n/*\n * Initialize for an upsampling pass.\n */\n\nMETHODDEF(void)\nstart_pass_upsample (j_decompress_ptr cinfo)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n\n  /* Mark the conversion buffer empty */\n  upsample->next_row_out = cinfo->max_v_samp_factor;\n  /* Initialize total-height counter for detecting bottom of image */\n  upsample->rows_to_go = cinfo->output_height;\n}\n\n\n/*\n * Control routine to do upsampling (and color conversion).\n *\n * In this version we upsample each component independently.\n * We upsample one row group into the conversion buffer, then apply\n * color conversion a row at a time.\n */\n\nMETHODDEF(void)\nsep_upsample (j_decompress_ptr cinfo,\n              JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n              JDIMENSION in_row_groups_avail,\n              JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n              JDIMENSION out_rows_avail)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  int ci;\n  jpeg_component_info *compptr;\n  JDIMENSION num_rows;\n\n  /* Fill the conversion buffer, if it's empty */\n  if (upsample->next_row_out >= cinfo->max_v_samp_factor) {\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n         ci++, compptr++) {\n      /* Invoke per-component upsample method.  Notice we pass a POINTER\n       * to color_buf[ci], so that fullsize_upsample can change it.\n       */\n      (*upsample->methods[ci]) (cinfo, compptr,\n        input_buf[ci] + (*in_row_group_ctr * upsample->rowgroup_height[ci]),\n        upsample->color_buf + ci);\n    }\n    upsample->next_row_out = 0;\n  }\n\n  /* Color-convert and emit rows */\n\n  /* How many we have in the buffer: */\n  num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out);\n  /* Not more than the distance to the end of the image.  Need this test\n   * in case the image height is not a multiple of max_v_samp_factor:\n   */\n  if (num_rows > upsample->rows_to_go)\n    num_rows = upsample->rows_to_go;\n  /* And not more than what the client can accept: */\n  out_rows_avail -= *out_row_ctr;\n  if (num_rows > out_rows_avail)\n    num_rows = out_rows_avail;\n\n  (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf,\n                                     (JDIMENSION) upsample->next_row_out,\n                                     output_buf + *out_row_ctr,\n                                     (int) num_rows);\n\n  /* Adjust counts */\n  *out_row_ctr += num_rows;\n  upsample->rows_to_go -= num_rows;\n  upsample->next_row_out += num_rows;\n  /* When the buffer is emptied, declare this input row group consumed */\n  if (upsample->next_row_out >= cinfo->max_v_samp_factor)\n    (*in_row_group_ctr)++;\n}\n\n\n/*\n * These are the routines invoked by sep_upsample to upsample pixel values\n * of a single component.  One row group is processed per call.\n */\n\n\n/*\n * For full-size components, we just make color_buf[ci] point at the\n * input buffer, and thus avoid copying any data.  Note that this is\n * safe only because sep_upsample doesn't declare the input row group\n * \"consumed\" until we are done color converting and emitting it.\n */\n\nMETHODDEF(void)\nfullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                   JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)\n{\n  *output_data_ptr = input_data;\n}\n\n\n/*\n * This is a no-op version used for \"uninteresting\" components.\n * These components will not be referenced by color conversion.\n */\n\nMETHODDEF(void)\nnoop_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n               JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)\n{\n  *output_data_ptr = NULL;      /* safety check */\n}\n\n\n/*\n * This version handles any integral sampling ratios.\n * This is not used for typical JPEG files, so it need not be fast.\n * Nor, for that matter, is it particularly accurate: the algorithm is\n * simple replication of the input pixel onto the corresponding output\n * pixels.  The hi-falutin sampling literature refers to this as a\n * \"box filter\".  A box filter tends to introduce visible artifacts,\n * so if you are actually going to use 3:1 or 4:1 sampling ratios\n * you would be well advised to improve this code.\n */\n\nMETHODDEF(void)\nint_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n              JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  JSAMPARRAY output_data = *output_data_ptr;\n  register JSAMPROW inptr, outptr;\n  register JSAMPLE invalue;\n  register int h;\n  JSAMPROW outend;\n  int h_expand, v_expand;\n  int inrow, outrow;\n\n  h_expand = upsample->h_expand[compptr->component_index];\n  v_expand = upsample->v_expand[compptr->component_index];\n\n  inrow = outrow = 0;\n  while (outrow < cinfo->max_v_samp_factor) {\n    /* Generate one output row with proper horizontal expansion */\n    inptr = input_data[inrow];\n    outptr = output_data[outrow];\n    outend = outptr + cinfo->output_width;\n    while (outptr < outend) {\n      invalue = *inptr++;       /* don't need GETJSAMPLE() here */\n      for (h = h_expand; h > 0; h--) {\n        *outptr++ = invalue;\n      }\n    }\n    /* Generate any additional output rows by duplicating the first one */\n    if (v_expand > 1) {\n      jcopy_sample_rows(output_data, outrow, output_data, outrow+1,\n                        v_expand-1, cinfo->output_width);\n    }\n    inrow++;\n    outrow += v_expand;\n  }\n}\n\n\n/*\n * Fast processing for the common case of 2:1 horizontal and 1:1 vertical.\n * It's still a box filter.\n */\n\nMETHODDEF(void)\nh2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n               JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)\n{\n  JSAMPARRAY output_data = *output_data_ptr;\n  register JSAMPROW inptr, outptr;\n  register JSAMPLE invalue;\n  JSAMPROW outend;\n  int inrow;\n\n  for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {\n    inptr = input_data[inrow];\n    outptr = output_data[inrow];\n    outend = outptr + cinfo->output_width;\n    while (outptr < outend) {\n      invalue = *inptr++;       /* don't need GETJSAMPLE() here */\n      *outptr++ = invalue;\n      *outptr++ = invalue;\n    }\n  }\n}\n\n\n/*\n * Fast processing for the common case of 2:1 horizontal and 2:1 vertical.\n * It's still a box filter.\n */\n\nMETHODDEF(void)\nh2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n               JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)\n{\n  JSAMPARRAY output_data = *output_data_ptr;\n  register JSAMPROW inptr, outptr;\n  register JSAMPLE invalue;\n  JSAMPROW outend;\n  int inrow, outrow;\n\n  inrow = outrow = 0;\n  while (outrow < cinfo->max_v_samp_factor) {\n    inptr = input_data[inrow];\n    outptr = output_data[outrow];\n    outend = outptr + cinfo->output_width;\n    while (outptr < outend) {\n      invalue = *inptr++;       /* don't need GETJSAMPLE() here */\n      *outptr++ = invalue;\n      *outptr++ = invalue;\n    }\n    jcopy_sample_rows(output_data, outrow, output_data, outrow+1,\n                      1, cinfo->output_width);\n    inrow++;\n    outrow += 2;\n  }\n}\n\n\n/*\n * Fancy processing for the common case of 2:1 horizontal and 1:1 vertical.\n *\n * The upsampling algorithm is linear interpolation between pixel centers,\n * also known as a \"triangle filter\".  This is a good compromise between\n * speed and visual quality.  The centers of the output pixels are 1/4 and 3/4\n * of the way between input pixel centers.\n *\n * A note about the \"bias\" calculations: when rounding fractional values to\n * integer, we do not want to always round 0.5 up to the next integer.\n * If we did that, we'd introduce a noticeable bias towards larger values.\n * Instead, this code is arranged so that 0.5 will be rounded up or down at\n * alternate pixel locations (a simple ordered dither pattern).\n */\n\nMETHODDEF(void)\nh2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                     JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)\n{\n  JSAMPARRAY output_data = *output_data_ptr;\n  register JSAMPROW inptr, outptr;\n  register int invalue;\n  register JDIMENSION colctr;\n  int inrow;\n\n  for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {\n    inptr = input_data[inrow];\n    outptr = output_data[inrow];\n    /* Special case for first column */\n    invalue = GETJSAMPLE(*inptr++);\n    *outptr++ = (JSAMPLE) invalue;\n    *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2);\n\n    for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {\n      /* General case: 3/4 * nearer pixel + 1/4 * further pixel */\n      invalue = GETJSAMPLE(*inptr++) * 3;\n      *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(inptr[-2]) + 1) >> 2);\n      *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(*inptr) + 2) >> 2);\n    }\n\n    /* Special case for last column */\n    invalue = GETJSAMPLE(*inptr);\n    *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(inptr[-1]) + 1) >> 2);\n    *outptr++ = (JSAMPLE) invalue;\n  }\n}\n\n\n/*\n * Fancy processing for the common case of 2:1 horizontal and 2:1 vertical.\n * Again a triangle filter; see comments for h2v1 case, above.\n *\n * It is OK for us to reference the adjacent input rows because we demanded\n * context from the main buffer controller (see initialization code).\n */\n\nMETHODDEF(void)\nh2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                     JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)\n{\n  JSAMPARRAY output_data = *output_data_ptr;\n  register JSAMPROW inptr0, inptr1, outptr;\n#if BITS_IN_JSAMPLE == 8\n  register int thiscolsum, lastcolsum, nextcolsum;\n#else\n  register JLONG thiscolsum, lastcolsum, nextcolsum;\n#endif\n  register JDIMENSION colctr;\n  int inrow, outrow, v;\n\n  inrow = outrow = 0;\n  while (outrow < cinfo->max_v_samp_factor) {\n    for (v = 0; v < 2; v++) {\n      /* inptr0 points to nearest input row, inptr1 points to next nearest */\n      inptr0 = input_data[inrow];\n      if (v == 0)               /* next nearest is row above */\n        inptr1 = input_data[inrow-1];\n      else                      /* next nearest is row below */\n        inptr1 = input_data[inrow+1];\n      outptr = output_data[outrow++];\n\n      /* Special case for first column */\n      thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);\n      nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);\n      *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 8) >> 4);\n      *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);\n      lastcolsum = thiscolsum; thiscolsum = nextcolsum;\n\n      for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {\n        /* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */\n        /* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */\n        nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);\n        *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);\n        *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);\n        lastcolsum = thiscolsum; thiscolsum = nextcolsum;\n      }\n\n      /* Special case for last column */\n      *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);\n      *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 7) >> 4);\n    }\n    inrow++;\n  }\n}\n\n\n/*\n * Module initialization routine for upsampling.\n */\n\nGLOBAL(void)\njinit_upsampler (j_decompress_ptr cinfo)\n{\n  my_upsample_ptr upsample;\n  int ci;\n  jpeg_component_info *compptr;\n  boolean need_buffer, do_fancy;\n  int h_in_group, v_in_group, h_out_group, v_out_group;\n\n  if (!cinfo->master->jinit_upsampler_no_alloc) {\n    upsample = (my_upsample_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(my_upsampler));\n    cinfo->upsample = (struct jpeg_upsampler *) upsample;\n    upsample->pub.start_pass = start_pass_upsample;\n    upsample->pub.upsample = sep_upsample;\n    upsample->pub.need_context_rows = FALSE; /* until we find out differently */\n  } else\n    upsample = (my_upsample_ptr) cinfo->upsample;\n\n  if (cinfo->CCIR601_sampling)  /* this isn't supported */\n    ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);\n\n  /* jdmainct.c doesn't support context rows when min_DCT_scaled_size = 1,\n   * so don't ask for it.\n   */\n  do_fancy = cinfo->do_fancy_upsampling && cinfo->_min_DCT_scaled_size > 1;\n\n  /* Verify we can handle the sampling factors, select per-component methods,\n   * and create storage as needed.\n   */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Compute size of an \"input group\" after IDCT scaling.  This many samples\n     * are to be converted to max_h_samp_factor * max_v_samp_factor pixels.\n     */\n    h_in_group = (compptr->h_samp_factor * compptr->_DCT_scaled_size) /\n                 cinfo->_min_DCT_scaled_size;\n    v_in_group = (compptr->v_samp_factor * compptr->_DCT_scaled_size) /\n                 cinfo->_min_DCT_scaled_size;\n    h_out_group = cinfo->max_h_samp_factor;\n    v_out_group = cinfo->max_v_samp_factor;\n    upsample->rowgroup_height[ci] = v_in_group; /* save for use later */\n    need_buffer = TRUE;\n    if (! compptr->component_needed) {\n      /* Don't bother to upsample an uninteresting component. */\n      upsample->methods[ci] = noop_upsample;\n      need_buffer = FALSE;\n    } else if (h_in_group == h_out_group && v_in_group == v_out_group) {\n      /* Fullsize components can be processed without any work. */\n      upsample->methods[ci] = fullsize_upsample;\n      need_buffer = FALSE;\n    } else if (h_in_group * 2 == h_out_group &&\n               v_in_group == v_out_group) {\n      /* Special cases for 2h1v upsampling */\n      if (do_fancy && compptr->downsampled_width > 2) {\n        if (jsimd_can_h2v1_fancy_upsample())\n          upsample->methods[ci] = jsimd_h2v1_fancy_upsample;\n        else\n          upsample->methods[ci] = h2v1_fancy_upsample;\n      } else {\n        if (jsimd_can_h2v1_upsample())\n          upsample->methods[ci] = jsimd_h2v1_upsample;\n        else\n          upsample->methods[ci] = h2v1_upsample;\n      }\n    } else if (h_in_group * 2 == h_out_group &&\n               v_in_group * 2 == v_out_group) {\n      /* Special cases for 2h2v upsampling */\n      if (do_fancy && compptr->downsampled_width > 2) {\n        if (jsimd_can_h2v2_fancy_upsample())\n          upsample->methods[ci] = jsimd_h2v2_fancy_upsample;\n        else\n          upsample->methods[ci] = h2v2_fancy_upsample;\n        upsample->pub.need_context_rows = TRUE;\n      } else {\n        if (jsimd_can_h2v2_upsample())\n          upsample->methods[ci] = jsimd_h2v2_upsample;\n        else\n          upsample->methods[ci] = h2v2_upsample;\n      }\n    } else if ((h_out_group % h_in_group) == 0 &&\n               (v_out_group % v_in_group) == 0) {\n      /* Generic integral-factors upsampling method */\n#if defined(__mips__)\n      if (jsimd_can_int_upsample())\n        upsample->methods[ci] = jsimd_int_upsample;\n      else\n#endif\n        upsample->methods[ci] = int_upsample;\n      upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group);\n      upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group);\n    } else\n      ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);\n    if (need_buffer && !cinfo->master->jinit_upsampler_no_alloc) {\n      upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray)\n        ((j_common_ptr) cinfo, JPOOL_IMAGE,\n         (JDIMENSION) jround_up((long) cinfo->output_width,\n                                (long) cinfo->max_h_samp_factor),\n         (JDIMENSION) cinfo->max_v_samp_factor);\n    }\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdsample.h",
    "content": "/*\n * jdsample.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n */\n\n#define JPEG_INTERNALS\n#include \"jpeglib.h\"\n\n\n/* Pointer to routine to upsample a single component */\ntypedef void (*upsample1_ptr) (j_decompress_ptr cinfo,\n                               jpeg_component_info *compptr,\n                               JSAMPARRAY input_data,\n                               JSAMPARRAY *output_data_ptr);\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_upsampler pub;    /* public fields */\n\n  /* Color conversion buffer.  When using separate upsampling and color\n   * conversion steps, this buffer holds one upsampled row group until it\n   * has been color converted and output.\n   * Note: we do not allocate any storage for component(s) which are full-size,\n   * ie do not need rescaling.  The corresponding entry of color_buf[] is\n   * simply set to point to the input data array, thereby avoiding copying.\n   */\n  JSAMPARRAY color_buf[MAX_COMPONENTS];\n\n  /* Per-component upsampling method pointers */\n  upsample1_ptr methods[MAX_COMPONENTS];\n\n  int next_row_out;             /* counts rows emitted from color_buf */\n  JDIMENSION rows_to_go;        /* counts rows remaining in image */\n\n  /* Height of an input row group for each component. */\n  int rowgroup_height[MAX_COMPONENTS];\n\n  /* These arrays save pixel expansion factors so that int_expand need not\n   * recompute them each time.  They are unused for other upsampling methods.\n   */\n  UINT8 h_expand[MAX_COMPONENTS];\n  UINT8 v_expand[MAX_COMPONENTS];\n} my_upsampler;\n\ntypedef my_upsampler *my_upsample_ptr;\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jdtrans.c",
    "content": "/*\n * jdtrans.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1995-1997, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains library routines for transcoding decompression,\n * that is, reading raw DCT coefficient arrays from an input JPEG file.\n * The routines in jdapimin.c will also be needed by a transcoder.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Forward declarations */\nLOCAL(void) transdecode_master_selection (j_decompress_ptr cinfo);\n\n\n/*\n * Read the coefficient arrays from a JPEG file.\n * jpeg_read_header must be completed before calling this.\n *\n * The entire image is read into a set of virtual coefficient-block arrays,\n * one per component.  The return value is a pointer to the array of\n * virtual-array descriptors.  These can be manipulated directly via the\n * JPEG memory manager, or handed off to jpeg_write_coefficients().\n * To release the memory occupied by the virtual arrays, call\n * jpeg_finish_decompress() when done with the data.\n *\n * An alternative usage is to simply obtain access to the coefficient arrays\n * during a buffered-image-mode decompression operation.  This is allowed\n * after any jpeg_finish_output() call.  The arrays can be accessed until\n * jpeg_finish_decompress() is called.  (Note that any call to the library\n * may reposition the arrays, so don't rely on access_virt_barray() results\n * to stay valid across library calls.)\n *\n * Returns NULL if suspended.  This case need be checked only if\n * a suspending data source is used.\n */\n\nGLOBAL(jvirt_barray_ptr *)\njpeg_read_coefficients (j_decompress_ptr cinfo)\n{\n  if (cinfo->global_state == DSTATE_READY) {\n    /* First call: initialize active modules */\n    transdecode_master_selection(cinfo);\n    cinfo->global_state = DSTATE_RDCOEFS;\n  }\n  if (cinfo->global_state == DSTATE_RDCOEFS) {\n    /* Absorb whole file into the coef buffer */\n    for (;;) {\n      int retcode;\n      /* Call progress monitor hook if present */\n      if (cinfo->progress != NULL)\n        (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n      /* Absorb some more input */\n      retcode = (*cinfo->inputctl->consume_input) (cinfo);\n      if (retcode == JPEG_SUSPENDED)\n        return NULL;\n      if (retcode == JPEG_REACHED_EOI)\n        break;\n      /* Advance progress counter if appropriate */\n      if (cinfo->progress != NULL &&\n          (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {\n        if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {\n          /* startup underestimated number of scans; ratchet up one scan */\n          cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;\n        }\n      }\n    }\n    /* Set state so that jpeg_finish_decompress does the right thing */\n    cinfo->global_state = DSTATE_STOPPING;\n  }\n  /* At this point we should be in state DSTATE_STOPPING if being used\n   * standalone, or in state DSTATE_BUFIMAGE if being invoked to get access\n   * to the coefficients during a full buffered-image-mode decompression.\n   */\n  if ((cinfo->global_state == DSTATE_STOPPING ||\n       cinfo->global_state == DSTATE_BUFIMAGE) && cinfo->buffered_image) {\n    return cinfo->coef->coef_arrays;\n  }\n  /* Oops, improper usage */\n  ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  return NULL;                  /* keep compiler happy */\n}\n\n\n/*\n * Master selection of decompression modules for transcoding.\n * This substitutes for jdmaster.c's initialization of the full decompressor.\n */\n\nLOCAL(void)\ntransdecode_master_selection (j_decompress_ptr cinfo)\n{\n  /* This is effectively a buffered-image operation. */\n  cinfo->buffered_image = TRUE;\n\n#if JPEG_LIB_VERSION >= 80\n  /* Compute output image dimensions and related values. */\n  jpeg_core_output_dimensions(cinfo);\n#endif\n\n  /* Entropy decoding: either Huffman or arithmetic coding. */\n  if (cinfo->arith_code) {\n#ifdef D_ARITH_CODING_SUPPORTED\n    jinit_arith_decoder(cinfo);\n#else\n    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);\n#endif\n  } else {\n    if (cinfo->progressive_mode) {\n#ifdef D_PROGRESSIVE_SUPPORTED\n      jinit_phuff_decoder(cinfo);\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    } else\n      jinit_huff_decoder(cinfo);\n  }\n\n  /* Always get a full-image coefficient buffer. */\n  jinit_d_coef_controller(cinfo, TRUE);\n\n  /* We can now tell the memory manager to allocate virtual arrays. */\n  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);\n\n  /* Initialize input side of decompressor to consume first scan. */\n  (*cinfo->inputctl->start_input_pass) (cinfo);\n\n  /* Initialize progress monitoring. */\n  if (cinfo->progress != NULL) {\n    int nscans;\n    /* Estimate number of scans to set pass_limit. */\n    if (cinfo->progressive_mode) {\n      /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */\n      nscans = 2 + 3 * cinfo->num_components;\n    } else if (cinfo->inputctl->has_multiple_scans) {\n      /* For a nonprogressive multiscan file, estimate 1 scan per component. */\n      nscans = cinfo->num_components;\n    } else {\n      nscans = 1;\n    }\n    cinfo->progress->pass_counter = 0L;\n    cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;\n    cinfo->progress->completed_passes = 0;\n    cinfo->progress->total_passes = 1;\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jerror.c",
    "content": "/*\n * jerror.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains simple error-reporting and trace-message routines.\n * These are suitable for Unix-like systems and others where writing to\n * stderr is the right thing to do.  Many applications will want to replace\n * some or all of these routines.\n *\n * If you define USE_WINDOWS_MESSAGEBOX in jconfig.h or in the makefile,\n * you get a Windows-specific hack to display error messages in a dialog box.\n * It ain't much, but it beats dropping error messages into the bit bucket,\n * which is what happens to output to stderr under most Windows C compilers.\n *\n * These routines are used by both the compression and decompression code.\n */\n\n/* this is not a core library module, so it doesn't define JPEG_INTERNALS */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jversion.h\"\n#include \"jerror.h\"\n\n#ifdef USE_WINDOWS_MESSAGEBOX\n#include <windows.h>\n#endif\n\n#ifndef EXIT_FAILURE            /* define exit() codes if not provided */\n#define EXIT_FAILURE  1\n#endif\n\n\n/*\n * Create the message string table.\n * We do this from the master message list in jerror.h by re-reading\n * jerror.h with a suitable definition for macro JMESSAGE.\n * The message table is made an external symbol just in case any applications\n * want to refer to it directly.\n */\n\n#define JMESSAGE(code,string)   string ,\n\nconst char * const jpeg_std_message_table[] = {\n#include \"jerror.h\"\n  NULL\n};\n\n\n/*\n * Error exit handler: must not return to caller.\n *\n * Applications may override this if they want to get control back after\n * an error.  Typically one would longjmp somewhere instead of exiting.\n * The setjmp buffer can be made a private field within an expanded error\n * handler object.  Note that the info needed to generate an error message\n * is stored in the error object, so you can generate the message now or\n * later, at your convenience.\n * You should make sure that the JPEG object is cleaned up (with jpeg_abort\n * or jpeg_destroy) at some point.\n */\n\nMETHODDEF(void)\nerror_exit (j_common_ptr cinfo)\n{\n  /* Always display the message */\n  (*cinfo->err->output_message) (cinfo);\n\n  /* Let the memory manager delete any temp files before we die */\n  jpeg_destroy(cinfo);\n\n  exit(EXIT_FAILURE);\n}\n\n\n/*\n * Actual output of an error or trace message.\n * Applications may override this method to send JPEG messages somewhere\n * other than stderr.\n *\n * On Windows, printing to stderr is generally completely useless,\n * so we provide optional code to produce an error-dialog popup.\n * Most Windows applications will still prefer to override this routine,\n * but if they don't, it'll do something at least marginally useful.\n *\n * NOTE: to use the library in an environment that doesn't support the\n * C stdio library, you may have to delete the call to fprintf() entirely,\n * not just not use this routine.\n */\n\nMETHODDEF(void)\noutput_message (j_common_ptr cinfo)\n{\n  char buffer[JMSG_LENGTH_MAX];\n\n  /* Create the message */\n  (*cinfo->err->format_message) (cinfo, buffer);\n\n#ifdef USE_WINDOWS_MESSAGEBOX\n  /* Display it in a message dialog box */\n  MessageBox(GetActiveWindow(), buffer, \"JPEG Library Error\",\n             MB_OK | MB_ICONERROR);\n#else\n  /* Send it to stderr, adding a newline */\n  fprintf(stderr, \"%s\\n\", buffer);\n#endif\n}\n\n\n/*\n * Decide whether to emit a trace or warning message.\n * msg_level is one of:\n *   -1: recoverable corrupt-data warning, may want to abort.\n *    0: important advisory messages (always display to user).\n *    1: first level of tracing detail.\n *    2,3,...: successively more detailed tracing messages.\n * An application might override this method if it wanted to abort on warnings\n * or change the policy about which messages to display.\n */\n\nMETHODDEF(void)\nemit_message (j_common_ptr cinfo, int msg_level)\n{\n  struct jpeg_error_mgr *err = cinfo->err;\n\n  if (msg_level < 0) {\n    /* It's a warning message.  Since corrupt files may generate many warnings,\n     * the policy implemented here is to show only the first warning,\n     * unless trace_level >= 3.\n     */\n    if (err->num_warnings == 0 || err->trace_level >= 3)\n      (*err->output_message) (cinfo);\n    /* Always count warnings in num_warnings. */\n    err->num_warnings++;\n  } else {\n    /* It's a trace message.  Show it if trace_level >= msg_level. */\n    if (err->trace_level >= msg_level)\n      (*err->output_message) (cinfo);\n  }\n}\n\n\n/*\n * Format a message string for the most recent JPEG error or message.\n * The message is stored into buffer, which should be at least JMSG_LENGTH_MAX\n * characters.  Note that no '\\n' character is added to the string.\n * Few applications should need to override this method.\n */\n\nMETHODDEF(void)\nformat_message (j_common_ptr cinfo, char *buffer)\n{\n  struct jpeg_error_mgr *err = cinfo->err;\n  int msg_code = err->msg_code;\n  const char *msgtext = NULL;\n  const char *msgptr;\n  char ch;\n  boolean isstring;\n\n  /* Look up message string in proper table */\n  if (msg_code > 0 && msg_code <= err->last_jpeg_message) {\n    msgtext = err->jpeg_message_table[msg_code];\n  } else if (err->addon_message_table != NULL &&\n             msg_code >= err->first_addon_message &&\n             msg_code <= err->last_addon_message) {\n    msgtext = err->addon_message_table[msg_code - err->first_addon_message];\n  }\n\n  /* Defend against bogus message number */\n  if (msgtext == NULL) {\n    err->msg_parm.i[0] = msg_code;\n    msgtext = err->jpeg_message_table[0];\n  }\n\n  /* Check for string parameter, as indicated by %s in the message text */\n  isstring = FALSE;\n  msgptr = msgtext;\n  while ((ch = *msgptr++) != '\\0') {\n    if (ch == '%') {\n      if (*msgptr == 's') isstring = TRUE;\n      break;\n    }\n  }\n\n  /* Format the message into the passed buffer */\n  if (isstring)\n    sprintf(buffer, msgtext, err->msg_parm.s);\n  else\n    sprintf(buffer, msgtext,\n            err->msg_parm.i[0], err->msg_parm.i[1],\n            err->msg_parm.i[2], err->msg_parm.i[3],\n            err->msg_parm.i[4], err->msg_parm.i[5],\n            err->msg_parm.i[6], err->msg_parm.i[7]);\n}\n\n\n/*\n * Reset error state variables at start of a new image.\n * This is called during compression startup to reset trace/error\n * processing to default state, without losing any application-specific\n * method pointers.  An application might possibly want to override\n * this method if it has additional error processing state.\n */\n\nMETHODDEF(void)\nreset_error_mgr (j_common_ptr cinfo)\n{\n  cinfo->err->num_warnings = 0;\n  /* trace_level is not reset since it is an application-supplied parameter */\n  cinfo->err->msg_code = 0;     /* may be useful as a flag for \"no error\" */\n}\n\n\n/*\n * Fill in the standard error-handling methods in a jpeg_error_mgr object.\n * Typical call is:\n *      struct jpeg_compress_struct cinfo;\n *      struct jpeg_error_mgr err;\n *\n *      cinfo.err = jpeg_std_error(&err);\n * after which the application may override some of the methods.\n */\n\nGLOBAL(struct jpeg_error_mgr *)\njpeg_std_error (struct jpeg_error_mgr *err)\n{\n  err->error_exit = error_exit;\n  err->emit_message = emit_message;\n  err->output_message = output_message;\n  err->format_message = format_message;\n  err->reset_error_mgr = reset_error_mgr;\n\n  err->trace_level = 0;         /* default = no tracing */\n  err->num_warnings = 0;        /* no warnings emitted yet */\n  err->msg_code = 0;            /* may be useful as a flag for \"no error\" */\n\n  /* Initialize message table pointers */\n  err->jpeg_message_table = jpeg_std_message_table;\n  err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1;\n\n  err->addon_message_table = NULL;\n  err->first_addon_message = 0; /* for safety */\n  err->last_addon_message = 0;\n\n  return err;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jerror.h",
    "content": "/*\n * jerror.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * Modified 1997-2009 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2014, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file defines the error and message codes for the JPEG library.\n * Edit this file to add new codes, or to translate the message strings to\n * some other language.\n * A set of error-reporting macros are defined too.  Some applications using\n * the JPEG library may wish to include this file to get the error codes\n * and/or the macros.\n */\n\n/*\n * To define the enum list of message codes, include this file without\n * defining macro JMESSAGE.  To create a message string table, include it\n * again with a suitable JMESSAGE definition (see jerror.c for an example).\n */\n#ifndef JMESSAGE\n#ifndef JERROR_H\n/* First time through, define the enum list */\n#define JMAKE_ENUM_LIST\n#else\n/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */\n#define JMESSAGE(code,string)\n#endif /* JERROR_H */\n#endif /* JMESSAGE */\n\n#ifdef JMAKE_ENUM_LIST\n\ntypedef enum {\n\n#define JMESSAGE(code,string)   code ,\n\n#endif /* JMAKE_ENUM_LIST */\n\nJMESSAGE(JMSG_NOMESSAGE, \"Bogus message code %d\") /* Must be first entry! */\n\n/* For maintenance convenience, list is alphabetical by message code name */\n#if JPEG_LIB_VERSION < 70\nJMESSAGE(JERR_ARITH_NOTIMPL,\n         \"Sorry, arithmetic coding is not implemented\")\n#endif\nJMESSAGE(JERR_BAD_ALIGN_TYPE, \"ALIGN_TYPE is wrong, please fix\")\nJMESSAGE(JERR_BAD_ALLOC_CHUNK, \"MAX_ALLOC_CHUNK is wrong, please fix\")\nJMESSAGE(JERR_BAD_BUFFER_MODE, \"Bogus buffer control mode\")\nJMESSAGE(JERR_BAD_COMPONENT_ID, \"Invalid component ID %d in SOS\")\n#if JPEG_LIB_VERSION >= 70\nJMESSAGE(JERR_BAD_CROP_SPEC, \"Invalid crop request\")\n#endif\nJMESSAGE(JERR_BAD_DCT_COEF, \"DCT coefficient out of range\")\nJMESSAGE(JERR_BAD_DCTSIZE, \"IDCT output block size %d not supported\")\n#if JPEG_LIB_VERSION >= 70\nJMESSAGE(JERR_BAD_DROP_SAMPLING,\n         \"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c\")\n#endif\nJMESSAGE(JERR_BAD_HUFF_TABLE, \"Bogus Huffman table definition\")\nJMESSAGE(JERR_BAD_IN_COLORSPACE, \"Bogus input colorspace\")\nJMESSAGE(JERR_BAD_J_COLORSPACE, \"Bogus JPEG colorspace\")\nJMESSAGE(JERR_BAD_LENGTH, \"Bogus marker length\")\nJMESSAGE(JERR_BAD_LIB_VERSION,\n         \"Wrong JPEG library version: library is %d, caller expects %d\")\nJMESSAGE(JERR_BAD_MCU_SIZE, \"Sampling factors too large for interleaved scan\")\nJMESSAGE(JERR_BAD_POOL_ID, \"Invalid memory pool code %d\")\nJMESSAGE(JERR_BAD_PRECISION, \"Unsupported JPEG data precision %d\")\nJMESSAGE(JERR_BAD_PROGRESSION,\n         \"Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d\")\nJMESSAGE(JERR_BAD_PROG_SCRIPT,\n         \"Invalid progressive parameters at scan script entry %d\")\nJMESSAGE(JERR_BAD_SAMPLING, \"Bogus sampling factors\")\nJMESSAGE(JERR_BAD_SCAN_SCRIPT, \"Invalid scan script at entry %d\")\nJMESSAGE(JERR_BAD_STATE, \"Improper call to JPEG library in state %d\")\nJMESSAGE(JERR_BAD_STRUCT_SIZE,\n         \"JPEG parameter struct mismatch: library thinks size is %u, caller expects %u\")\nJMESSAGE(JERR_BAD_VIRTUAL_ACCESS, \"Bogus virtual array access\")\nJMESSAGE(JERR_BUFFER_SIZE, \"Buffer passed to JPEG library is too small\")\nJMESSAGE(JERR_CANT_SUSPEND, \"Suspension not allowed here\")\nJMESSAGE(JERR_CCIR601_NOTIMPL, \"CCIR601 sampling not implemented yet\")\nJMESSAGE(JERR_COMPONENT_COUNT, \"Too many color components: %d, max %d\")\nJMESSAGE(JERR_CONVERSION_NOTIMPL, \"Unsupported color conversion request\")\nJMESSAGE(JERR_DAC_INDEX, \"Bogus DAC index %d\")\nJMESSAGE(JERR_DAC_VALUE, \"Bogus DAC value 0x%x\")\nJMESSAGE(JERR_DHT_INDEX, \"Bogus DHT index %d\")\nJMESSAGE(JERR_DQT_INDEX, \"Bogus DQT index %d\")\nJMESSAGE(JERR_EMPTY_IMAGE, \"Empty JPEG image (DNL not supported)\")\nJMESSAGE(JERR_EMS_READ, \"Read from EMS failed\")\nJMESSAGE(JERR_EMS_WRITE, \"Write to EMS failed\")\nJMESSAGE(JERR_EOI_EXPECTED, \"Didn't expect more than one scan\")\nJMESSAGE(JERR_FILE_READ, \"Input file read error\")\nJMESSAGE(JERR_FILE_WRITE, \"Output file write error --- out of disk space?\")\nJMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, \"Fractional sampling not implemented yet\")\nJMESSAGE(JERR_HUFF_CLEN_OVERFLOW, \"Huffman code size table overflow\")\nJMESSAGE(JERR_HUFF_MISSING_CODE, \"Missing Huffman code table entry\")\nJMESSAGE(JERR_IMAGE_TOO_BIG, \"Maximum supported image dimension is %u pixels\")\nJMESSAGE(JERR_INPUT_EMPTY, \"Empty input file\")\nJMESSAGE(JERR_INPUT_EOF, \"Premature end of input file\")\nJMESSAGE(JERR_MISMATCHED_QUANT_TABLE,\n         \"Cannot transcode due to multiple use of quantization table %d\")\nJMESSAGE(JERR_MISSING_DATA, \"Scan script does not transmit all data\")\nJMESSAGE(JERR_MODE_CHANGE, \"Invalid color quantization mode change\")\nJMESSAGE(JERR_NOTIMPL, \"Not implemented yet\")\nJMESSAGE(JERR_NOT_COMPILED, \"Requested feature was omitted at compile time\")\n#if JPEG_LIB_VERSION >= 70\nJMESSAGE(JERR_NO_ARITH_TABLE, \"Arithmetic table 0x%02x was not defined\")\n#endif\nJMESSAGE(JERR_NO_BACKING_STORE, \"Backing store not supported\")\nJMESSAGE(JERR_NO_HUFF_TABLE, \"Huffman table 0x%02x was not defined\")\nJMESSAGE(JERR_NO_IMAGE, \"JPEG datastream contains no image\")\nJMESSAGE(JERR_NO_QUANT_TABLE, \"Quantization table 0x%02x was not defined\")\nJMESSAGE(JERR_NO_SOI, \"Not a JPEG file: starts with 0x%02x 0x%02x\")\nJMESSAGE(JERR_OUT_OF_MEMORY, \"Insufficient memory (case %d)\")\nJMESSAGE(JERR_QUANT_COMPONENTS,\n         \"Cannot quantize more than %d color components\")\nJMESSAGE(JERR_QUANT_FEW_COLORS, \"Cannot quantize to fewer than %d colors\")\nJMESSAGE(JERR_QUANT_MANY_COLORS, \"Cannot quantize to more than %d colors\")\nJMESSAGE(JERR_SOF_DUPLICATE, \"Invalid JPEG file structure: two SOF markers\")\nJMESSAGE(JERR_SOF_NO_SOS, \"Invalid JPEG file structure: missing SOS marker\")\nJMESSAGE(JERR_SOF_UNSUPPORTED, \"Unsupported JPEG process: SOF type 0x%02x\")\nJMESSAGE(JERR_SOI_DUPLICATE, \"Invalid JPEG file structure: two SOI markers\")\nJMESSAGE(JERR_SOS_NO_SOF, \"Invalid JPEG file structure: SOS before SOF\")\nJMESSAGE(JERR_TFILE_CREATE, \"Failed to create temporary file %s\")\nJMESSAGE(JERR_TFILE_READ, \"Read failed on temporary file\")\nJMESSAGE(JERR_TFILE_SEEK, \"Seek failed on temporary file\")\nJMESSAGE(JERR_TFILE_WRITE,\n         \"Write failed on temporary file --- out of disk space?\")\nJMESSAGE(JERR_TOO_LITTLE_DATA, \"Application transferred too few scanlines\")\nJMESSAGE(JERR_UNKNOWN_MARKER, \"Unsupported marker type 0x%02x\")\nJMESSAGE(JERR_VIRTUAL_BUG, \"Virtual array controller messed up\")\nJMESSAGE(JERR_WIDTH_OVERFLOW, \"Image too wide for this implementation\")\nJMESSAGE(JERR_XMS_READ, \"Read from XMS failed\")\nJMESSAGE(JERR_XMS_WRITE, \"Write to XMS failed\")\nJMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT_SHORT)\nJMESSAGE(JMSG_VERSION, JVERSION)\nJMESSAGE(JTRC_16BIT_TABLES,\n         \"Caution: quantization tables are too coarse for baseline JPEG\")\nJMESSAGE(JTRC_ADOBE,\n         \"Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d\")\nJMESSAGE(JTRC_APP0, \"Unknown APP0 marker (not JFIF), length %u\")\nJMESSAGE(JTRC_APP14, \"Unknown APP14 marker (not Adobe), length %u\")\nJMESSAGE(JTRC_DAC, \"Define Arithmetic Table 0x%02x: 0x%02x\")\nJMESSAGE(JTRC_DHT, \"Define Huffman Table 0x%02x\")\nJMESSAGE(JTRC_DQT, \"Define Quantization Table %d  precision %d\")\nJMESSAGE(JTRC_DRI, \"Define Restart Interval %u\")\nJMESSAGE(JTRC_EMS_CLOSE, \"Freed EMS handle %u\")\nJMESSAGE(JTRC_EMS_OPEN, \"Obtained EMS handle %u\")\nJMESSAGE(JTRC_EOI, \"End Of Image\")\nJMESSAGE(JTRC_HUFFBITS, \"        %3d %3d %3d %3d %3d %3d %3d %3d\")\nJMESSAGE(JTRC_JFIF, \"JFIF APP0 marker: version %d.%02d, density %dx%d  %d\")\nJMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,\n         \"Warning: thumbnail image size does not match data length %u\")\nJMESSAGE(JTRC_JFIF_EXTENSION,\n         \"JFIF extension marker: type 0x%02x, length %u\")\nJMESSAGE(JTRC_JFIF_THUMBNAIL, \"    with %d x %d thumbnail image\")\nJMESSAGE(JTRC_MISC_MARKER, \"Miscellaneous marker 0x%02x, length %u\")\nJMESSAGE(JTRC_PARMLESS_MARKER, \"Unexpected marker 0x%02x\")\nJMESSAGE(JTRC_QUANTVALS, \"        %4u %4u %4u %4u %4u %4u %4u %4u\")\nJMESSAGE(JTRC_QUANT_3_NCOLORS, \"Quantizing to %d = %d*%d*%d colors\")\nJMESSAGE(JTRC_QUANT_NCOLORS, \"Quantizing to %d colors\")\nJMESSAGE(JTRC_QUANT_SELECTED, \"Selected %d colors for quantization\")\nJMESSAGE(JTRC_RECOVERY_ACTION, \"At marker 0x%02x, recovery action %d\")\nJMESSAGE(JTRC_RST, \"RST%d\")\nJMESSAGE(JTRC_SMOOTH_NOTIMPL,\n         \"Smoothing not supported with nonstandard sampling ratios\")\nJMESSAGE(JTRC_SOF, \"Start Of Frame 0x%02x: width=%u, height=%u, components=%d\")\nJMESSAGE(JTRC_SOF_COMPONENT, \"    Component %d: %dhx%dv q=%d\")\nJMESSAGE(JTRC_SOI, \"Start of Image\")\nJMESSAGE(JTRC_SOS, \"Start Of Scan: %d components\")\nJMESSAGE(JTRC_SOS_COMPONENT, \"    Component %d: dc=%d ac=%d\")\nJMESSAGE(JTRC_SOS_PARAMS, \"  Ss=%d, Se=%d, Ah=%d, Al=%d\")\nJMESSAGE(JTRC_TFILE_CLOSE, \"Closed temporary file %s\")\nJMESSAGE(JTRC_TFILE_OPEN, \"Opened temporary file %s\")\nJMESSAGE(JTRC_THUMB_JPEG,\n         \"JFIF extension marker: JPEG-compressed thumbnail image, length %u\")\nJMESSAGE(JTRC_THUMB_PALETTE,\n         \"JFIF extension marker: palette thumbnail image, length %u\")\nJMESSAGE(JTRC_THUMB_RGB,\n         \"JFIF extension marker: RGB thumbnail image, length %u\")\nJMESSAGE(JTRC_UNKNOWN_IDS,\n         \"Unrecognized component IDs %d %d %d, assuming YCbCr\")\nJMESSAGE(JTRC_XMS_CLOSE, \"Freed XMS handle %u\")\nJMESSAGE(JTRC_XMS_OPEN, \"Obtained XMS handle %u\")\nJMESSAGE(JWRN_ADOBE_XFORM, \"Unknown Adobe color transform code %d\")\n#if JPEG_LIB_VERSION >= 70\nJMESSAGE(JWRN_ARITH_BAD_CODE, \"Corrupt JPEG data: bad arithmetic code\")\n#endif\nJMESSAGE(JWRN_BOGUS_PROGRESSION,\n         \"Inconsistent progression sequence for component %d coefficient %d\")\nJMESSAGE(JWRN_EXTRANEOUS_DATA,\n         \"Corrupt JPEG data: %u extraneous bytes before marker 0x%02x\")\nJMESSAGE(JWRN_HIT_MARKER, \"Corrupt JPEG data: premature end of data segment\")\nJMESSAGE(JWRN_HUFF_BAD_CODE, \"Corrupt JPEG data: bad Huffman code\")\nJMESSAGE(JWRN_JFIF_MAJOR, \"Warning: unknown JFIF revision number %d.%02d\")\nJMESSAGE(JWRN_JPEG_EOF, \"Premature end of JPEG file\")\nJMESSAGE(JWRN_MUST_RESYNC,\n         \"Corrupt JPEG data: found marker 0x%02x instead of RST%d\")\nJMESSAGE(JWRN_NOT_SEQUENTIAL, \"Invalid SOS parameters for sequential JPEG\")\nJMESSAGE(JWRN_TOO_MUCH_DATA, \"Application transferred too many scanlines\")\n#if JPEG_LIB_VERSION < 70\nJMESSAGE(JERR_BAD_CROP_SPEC, \"Invalid crop request\")\n#if defined(C_ARITH_CODING_SUPPORTED) || defined(D_ARITH_CODING_SUPPORTED)\nJMESSAGE(JERR_NO_ARITH_TABLE, \"Arithmetic table 0x%02x was not defined\")\nJMESSAGE(JWRN_ARITH_BAD_CODE, \"Corrupt JPEG data: bad arithmetic code\")\n#endif\n#endif\n\n#ifdef JMAKE_ENUM_LIST\n\n  JMSG_LASTMSGCODE\n} J_MESSAGE_CODE;\n\n#undef JMAKE_ENUM_LIST\n#endif /* JMAKE_ENUM_LIST */\n\n/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */\n#undef JMESSAGE\n\n\n#ifndef JERROR_H\n#define JERROR_H\n\n/* Macros to simplify using the error and trace message stuff */\n/* The first parameter is either type of cinfo pointer */\n\n/* Fatal errors (print message and exit) */\n#define ERREXIT(cinfo,code)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT1(cinfo,code,p1)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT2(cinfo,code,p1,p2)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT3(cinfo,code,p1,p2,p3)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (cinfo)->err->msg_parm.i[2] = (p3), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT4(cinfo,code,p1,p2,p3,p4)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (cinfo)->err->msg_parm.i[2] = (p3), \\\n   (cinfo)->err->msg_parm.i[3] = (p4), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXITS(cinfo,code,str)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n\n#define MAKESTMT(stuff)         do { stuff } while (0)\n\n/* Nonfatal errors (we can keep going, but the data is probably corrupt) */\n#define WARNMS(cinfo,code)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))\n#define WARNMS1(cinfo,code,p1)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))\n#define WARNMS2(cinfo,code,p1,p2)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))\n\n/* Informational/debugging messages */\n#define TRACEMS(cinfo,lvl,code)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n#define TRACEMS1(cinfo,lvl,code,p1)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n#define TRACEMS2(cinfo,lvl,code,p1,p2)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n#define TRACEMS3(cinfo,lvl,code,p1,p2,p3)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n           _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \\\n           (cinfo)->err->msg_code = (code); \\\n           (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n           _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \\\n           (cinfo)->err->msg_code = (code); \\\n           (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n           _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \\\n           _mp[4] = (p5); \\\n           (cinfo)->err->msg_code = (code); \\\n           (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n           _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \\\n           _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \\\n           (cinfo)->err->msg_code = (code); \\\n           (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMSS(cinfo,lvl,code,str)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n\n#endif /* JERROR_H */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jfdctflt.c",
    "content": "/*\n * jfdctflt.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains a floating-point implementation of the\n * forward DCT (Discrete Cosine Transform).\n *\n * This implementation should be more accurate than either of the integer\n * DCT implementations.  However, it may not give the same results on all\n * machines because of differences in roundoff behavior.  Speed will depend\n * on the hardware's floating point capacity.\n *\n * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT\n * on each column.  Direct algorithms are also available, but they are\n * much more complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on Arai, Agui, and Nakajima's algorithm for\n * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in\n * Japanese, but the algorithm is described in the Pennebaker & Mitchell\n * JPEG textbook (see REFERENCES section in file README.ijg).  The following\n * code is based directly on figure 4-8 in P&M.\n * While an 8-point DCT cannot be done in less than 11 multiplies, it is\n * possible to arrange the computation so that many of the multiplies are\n * simple scalings of the final outputs.  These multiplies can then be\n * folded into the multiplications or divisions by the JPEG quantization\n * table entries.  The AA&N method leaves only 5 multiplies and 29 adds\n * to be done in the DCT itself.\n * The primary disadvantage of this method is that with a fixed-point\n * implementation, accuracy is lost due to imprecise representation of the\n * scaled quantization values.  However, that problem does not arise if\n * we use floating point arithmetic.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"               /* Private declarations for DCT subsystem */\n\n#ifdef DCT_FLOAT_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/*\n * Perform the forward DCT on one block of samples.\n */\n\nGLOBAL(void)\njpeg_fdct_float (FAST_FLOAT *data)\n{\n  FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  FAST_FLOAT tmp10, tmp11, tmp12, tmp13;\n  FAST_FLOAT z1, z2, z3, z4, z5, z11, z13;\n  FAST_FLOAT *dataptr;\n  int ctr;\n\n  /* Pass 1: process rows. */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    tmp0 = dataptr[0] + dataptr[7];\n    tmp7 = dataptr[0] - dataptr[7];\n    tmp1 = dataptr[1] + dataptr[6];\n    tmp6 = dataptr[1] - dataptr[6];\n    tmp2 = dataptr[2] + dataptr[5];\n    tmp5 = dataptr[2] - dataptr[5];\n    tmp3 = dataptr[3] + dataptr[4];\n    tmp4 = dataptr[3] - dataptr[4];\n\n    /* Even part */\n\n    tmp10 = tmp0 + tmp3;        /* phase 2 */\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n\n    dataptr[0] = tmp10 + tmp11; /* phase 3 */\n    dataptr[4] = tmp10 - tmp11;\n\n    z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */\n    dataptr[2] = tmp13 + z1;    /* phase 5 */\n    dataptr[6] = tmp13 - z1;\n\n    /* Odd part */\n\n    tmp10 = tmp4 + tmp5;        /* phase 2 */\n    tmp11 = tmp5 + tmp6;\n    tmp12 = tmp6 + tmp7;\n\n    /* The rotator is modified from fig 4-8 to avoid extra negations. */\n    z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */\n    z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */\n    z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */\n    z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */\n\n    z11 = tmp7 + z3;            /* phase 5 */\n    z13 = tmp7 - z3;\n\n    dataptr[5] = z13 + z2;      /* phase 6 */\n    dataptr[3] = z13 - z2;\n    dataptr[1] = z11 + z4;\n    dataptr[7] = z11 - z4;\n\n    dataptr += DCTSIZE;         /* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns. */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];\n    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];\n    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];\n    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];\n    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];\n\n    /* Even part */\n\n    tmp10 = tmp0 + tmp3;        /* phase 2 */\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n\n    dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */\n    dataptr[DCTSIZE*4] = tmp10 - tmp11;\n\n    z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */\n    dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */\n    dataptr[DCTSIZE*6] = tmp13 - z1;\n\n    /* Odd part */\n\n    tmp10 = tmp4 + tmp5;        /* phase 2 */\n    tmp11 = tmp5 + tmp6;\n    tmp12 = tmp6 + tmp7;\n\n    /* The rotator is modified from fig 4-8 to avoid extra negations. */\n    z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */\n    z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */\n    z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */\n    z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */\n\n    z11 = tmp7 + z3;            /* phase 5 */\n    z13 = tmp7 - z3;\n\n    dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */\n    dataptr[DCTSIZE*3] = z13 - z2;\n    dataptr[DCTSIZE*1] = z11 + z4;\n    dataptr[DCTSIZE*7] = z11 - z4;\n\n    dataptr++;                  /* advance pointer to next column */\n  }\n}\n\n#endif /* DCT_FLOAT_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jfdctfst.c",
    "content": "/*\n * jfdctfst.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains a fast, not so accurate integer implementation of the\n * forward DCT (Discrete Cosine Transform).\n *\n * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT\n * on each column.  Direct algorithms are also available, but they are\n * much more complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on Arai, Agui, and Nakajima's algorithm for\n * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in\n * Japanese, but the algorithm is described in the Pennebaker & Mitchell\n * JPEG textbook (see REFERENCES section in file README.ijg).  The following\n * code is based directly on figure 4-8 in P&M.\n * While an 8-point DCT cannot be done in less than 11 multiplies, it is\n * possible to arrange the computation so that many of the multiplies are\n * simple scalings of the final outputs.  These multiplies can then be\n * folded into the multiplications or divisions by the JPEG quantization\n * table entries.  The AA&N method leaves only 5 multiplies and 29 adds\n * to be done in the DCT itself.\n * The primary disadvantage of this method is that with fixed-point math,\n * accuracy is lost due to imprecise representation of the scaled\n * quantization values.  The smaller the quantization table entry, the less\n * precise the scaled value, so this implementation does worse with high-\n * quality-setting files than with low-quality ones.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"               /* Private declarations for DCT subsystem */\n\n#ifdef DCT_IFAST_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/* Scaling decisions are generally the same as in the LL&M algorithm;\n * see jfdctint.c for more details.  However, we choose to descale\n * (right shift) multiplication products as soon as they are formed,\n * rather than carrying additional fractional bits into subsequent additions.\n * This compromises accuracy slightly, but it lets us save a few shifts.\n * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)\n * everywhere except in the multiplications proper; this saves a good deal\n * of work on 16-bit-int machines.\n *\n * Again to save a few shifts, the intermediate results between pass 1 and\n * pass 2 are not upscaled, but are represented only to integral precision.\n *\n * A final compromise is to represent the multiplicative constants to only\n * 8 fractional bits, rather than 13.  This saves some shifting work on some\n * machines, and may also reduce the cost of multiplication (since there\n * are fewer one-bits in the constants).\n */\n\n#define CONST_BITS  8\n\n\n/* Some C compilers fail to reduce \"FIX(constant)\" at compile time, thus\n * causing a lot of useless floating-point operations at run time.\n * To get around this we use the following pre-calculated constants.\n * If you change CONST_BITS you may want to add appropriate values.\n * (With a reasonable C compiler, you can just rely on the FIX() macro...)\n */\n\n#if CONST_BITS == 8\n#define FIX_0_382683433  ((JLONG)   98)         /* FIX(0.382683433) */\n#define FIX_0_541196100  ((JLONG)  139)         /* FIX(0.541196100) */\n#define FIX_0_707106781  ((JLONG)  181)         /* FIX(0.707106781) */\n#define FIX_1_306562965  ((JLONG)  334)         /* FIX(1.306562965) */\n#else\n#define FIX_0_382683433  FIX(0.382683433)\n#define FIX_0_541196100  FIX(0.541196100)\n#define FIX_0_707106781  FIX(0.707106781)\n#define FIX_1_306562965  FIX(1.306562965)\n#endif\n\n\n/* We can gain a little more speed, with a further compromise in accuracy,\n * by omitting the addition in a descaling shift.  This yields an incorrectly\n * rounded result half the time...\n */\n\n#ifndef USE_ACCURATE_ROUNDING\n#undef DESCALE\n#define DESCALE(x,n)  RIGHT_SHIFT(x, n)\n#endif\n\n\n/* Multiply a DCTELEM variable by an JLONG constant, and immediately\n * descale to yield a DCTELEM result.\n */\n\n#define MULTIPLY(var,const)  ((DCTELEM) DESCALE((var) * (const), CONST_BITS))\n\n\n/*\n * Perform the forward DCT on one block of samples.\n */\n\nGLOBAL(void)\njpeg_fdct_ifast (DCTELEM *data)\n{\n  DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  DCTELEM tmp10, tmp11, tmp12, tmp13;\n  DCTELEM z1, z2, z3, z4, z5, z11, z13;\n  DCTELEM *dataptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows. */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    tmp0 = dataptr[0] + dataptr[7];\n    tmp7 = dataptr[0] - dataptr[7];\n    tmp1 = dataptr[1] + dataptr[6];\n    tmp6 = dataptr[1] - dataptr[6];\n    tmp2 = dataptr[2] + dataptr[5];\n    tmp5 = dataptr[2] - dataptr[5];\n    tmp3 = dataptr[3] + dataptr[4];\n    tmp4 = dataptr[3] - dataptr[4];\n\n    /* Even part */\n\n    tmp10 = tmp0 + tmp3;        /* phase 2 */\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n\n    dataptr[0] = tmp10 + tmp11; /* phase 3 */\n    dataptr[4] = tmp10 - tmp11;\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */\n    dataptr[2] = tmp13 + z1;    /* phase 5 */\n    dataptr[6] = tmp13 - z1;\n\n    /* Odd part */\n\n    tmp10 = tmp4 + tmp5;        /* phase 2 */\n    tmp11 = tmp5 + tmp6;\n    tmp12 = tmp6 + tmp7;\n\n    /* The rotator is modified from fig 4-8 to avoid extra negations. */\n    z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */\n    z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */\n    z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */\n    z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */\n\n    z11 = tmp7 + z3;            /* phase 5 */\n    z13 = tmp7 - z3;\n\n    dataptr[5] = z13 + z2;      /* phase 6 */\n    dataptr[3] = z13 - z2;\n    dataptr[1] = z11 + z4;\n    dataptr[7] = z11 - z4;\n\n    dataptr += DCTSIZE;         /* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns. */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];\n    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];\n    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];\n    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];\n    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];\n\n    /* Even part */\n\n    tmp10 = tmp0 + tmp3;        /* phase 2 */\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n\n    dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */\n    dataptr[DCTSIZE*4] = tmp10 - tmp11;\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */\n    dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */\n    dataptr[DCTSIZE*6] = tmp13 - z1;\n\n    /* Odd part */\n\n    tmp10 = tmp4 + tmp5;        /* phase 2 */\n    tmp11 = tmp5 + tmp6;\n    tmp12 = tmp6 + tmp7;\n\n    /* The rotator is modified from fig 4-8 to avoid extra negations. */\n    z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */\n    z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */\n    z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */\n    z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */\n\n    z11 = tmp7 + z3;            /* phase 5 */\n    z13 = tmp7 - z3;\n\n    dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */\n    dataptr[DCTSIZE*3] = z13 - z2;\n    dataptr[DCTSIZE*1] = z11 + z4;\n    dataptr[DCTSIZE*7] = z11 - z4;\n\n    dataptr++;                  /* advance pointer to next column */\n  }\n}\n\n#endif /* DCT_IFAST_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jfdctint.c",
    "content": "/*\n * jfdctint.c\n *\n * This file was part of the Independent JPEG Group's software.\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains a slow-but-accurate integer implementation of the\n * forward DCT (Discrete Cosine Transform).\n *\n * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT\n * on each column.  Direct algorithms are also available, but they are\n * much more complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on an algorithm described in\n *   C. Loeffler, A. Ligtenberg and G. Moschytz, \"Practical Fast 1-D DCT\n *   Algorithms with 11 Multiplications\", Proc. Int'l. Conf. on Acoustics,\n *   Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.\n * The primary algorithm described there uses 11 multiplies and 29 adds.\n * We use their alternate method with 12 multiplies and 32 adds.\n * The advantage of this method is that no data path contains more than one\n * multiplication; this allows a very simple and accurate implementation in\n * scaled fixed-point arithmetic, with a minimal number of shifts.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"               /* Private declarations for DCT subsystem */\n\n#ifdef DCT_ISLOW_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/*\n * The poop on this scaling stuff is as follows:\n *\n * Each 1-D DCT step produces outputs which are a factor of sqrt(N)\n * larger than the true DCT outputs.  The final outputs are therefore\n * a factor of N larger than desired; since N=8 this can be cured by\n * a simple right shift at the end of the algorithm.  The advantage of\n * this arrangement is that we save two multiplications per 1-D DCT,\n * because the y0 and y4 outputs need not be divided by sqrt(N).\n * In the IJG code, this factor of 8 is removed by the quantization step\n * (in jcdctmgr.c), NOT in this module.\n *\n * We have to do addition and subtraction of the integer inputs, which\n * is no problem, and multiplication by fractional constants, which is\n * a problem to do in integer arithmetic.  We multiply all the constants\n * by CONST_SCALE and convert them to integer constants (thus retaining\n * CONST_BITS bits of precision in the constants).  After doing a\n * multiplication we have to divide the product by CONST_SCALE, with proper\n * rounding, to produce the correct output.  This division can be done\n * cheaply as a right shift of CONST_BITS bits.  We postpone shifting\n * as long as possible so that partial sums can be added together with\n * full fractional precision.\n *\n * The outputs of the first pass are scaled up by PASS1_BITS bits so that\n * they are represented to better-than-integral precision.  These outputs\n * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word\n * with the recommended scaling.  (For 12-bit sample data, the intermediate\n * array is JLONG anyway.)\n *\n * To avoid overflow of the 32-bit intermediate results in pass 2, we must\n * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis\n * shows that the values given below are the most effective.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define CONST_BITS  13\n#define PASS1_BITS  2\n#else\n#define CONST_BITS  13\n#define PASS1_BITS  1           /* lose a little precision to avoid overflow */\n#endif\n\n/* Some C compilers fail to reduce \"FIX(constant)\" at compile time, thus\n * causing a lot of useless floating-point operations at run time.\n * To get around this we use the following pre-calculated constants.\n * If you change CONST_BITS you may want to add appropriate values.\n * (With a reasonable C compiler, you can just rely on the FIX() macro...)\n */\n\n#if CONST_BITS == 13\n#define FIX_0_298631336  ((JLONG)  2446)        /* FIX(0.298631336) */\n#define FIX_0_390180644  ((JLONG)  3196)        /* FIX(0.390180644) */\n#define FIX_0_541196100  ((JLONG)  4433)        /* FIX(0.541196100) */\n#define FIX_0_765366865  ((JLONG)  6270)        /* FIX(0.765366865) */\n#define FIX_0_899976223  ((JLONG)  7373)        /* FIX(0.899976223) */\n#define FIX_1_175875602  ((JLONG)  9633)        /* FIX(1.175875602) */\n#define FIX_1_501321110  ((JLONG)  12299)       /* FIX(1.501321110) */\n#define FIX_1_847759065  ((JLONG)  15137)       /* FIX(1.847759065) */\n#define FIX_1_961570560  ((JLONG)  16069)       /* FIX(1.961570560) */\n#define FIX_2_053119869  ((JLONG)  16819)       /* FIX(2.053119869) */\n#define FIX_2_562915447  ((JLONG)  20995)       /* FIX(2.562915447) */\n#define FIX_3_072711026  ((JLONG)  25172)       /* FIX(3.072711026) */\n#else\n#define FIX_0_298631336  FIX(0.298631336)\n#define FIX_0_390180644  FIX(0.390180644)\n#define FIX_0_541196100  FIX(0.541196100)\n#define FIX_0_765366865  FIX(0.765366865)\n#define FIX_0_899976223  FIX(0.899976223)\n#define FIX_1_175875602  FIX(1.175875602)\n#define FIX_1_501321110  FIX(1.501321110)\n#define FIX_1_847759065  FIX(1.847759065)\n#define FIX_1_961570560  FIX(1.961570560)\n#define FIX_2_053119869  FIX(2.053119869)\n#define FIX_2_562915447  FIX(2.562915447)\n#define FIX_3_072711026  FIX(3.072711026)\n#endif\n\n\n/* Multiply an JLONG variable by an JLONG constant to yield an JLONG result.\n * For 8-bit samples with the recommended scaling, all the variable\n * and constant values involved are no more than 16 bits wide, so a\n * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.\n * For 12-bit samples, a full 32-bit multiplication will be needed.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define MULTIPLY(var,const)  MULTIPLY16C16(var,const)\n#else\n#define MULTIPLY(var,const)  ((var) * (const))\n#endif\n\n\n/*\n * Perform the forward DCT on one block of samples.\n */\n\nGLOBAL(void)\njpeg_fdct_islow (DCTELEM *data)\n{\n  JLONG tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  JLONG tmp10, tmp11, tmp12, tmp13;\n  JLONG z1, z2, z3, z4, z5;\n  DCTELEM *dataptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows. */\n  /* Note results are scaled up by sqrt(8) compared to a true DCT; */\n  /* furthermore, we scale the results by 2**PASS1_BITS. */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    tmp0 = dataptr[0] + dataptr[7];\n    tmp7 = dataptr[0] - dataptr[7];\n    tmp1 = dataptr[1] + dataptr[6];\n    tmp6 = dataptr[1] - dataptr[6];\n    tmp2 = dataptr[2] + dataptr[5];\n    tmp5 = dataptr[2] - dataptr[5];\n    tmp3 = dataptr[3] + dataptr[4];\n    tmp4 = dataptr[3] - dataptr[4];\n\n    /* Even part per LL&M figure 1 --- note that published figure is faulty;\n     * rotator \"sqrt(2)*c1\" should be \"sqrt(2)*c6\".\n     */\n\n    tmp10 = tmp0 + tmp3;\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n\n    dataptr[0] = (DCTELEM) LEFT_SHIFT(tmp10 + tmp11, PASS1_BITS);\n    dataptr[4] = (DCTELEM) LEFT_SHIFT(tmp10 - tmp11, PASS1_BITS);\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);\n    dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),\n                                   CONST_BITS-PASS1_BITS);\n    dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),\n                                   CONST_BITS-PASS1_BITS);\n\n    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).\n     * cK represents cos(K*pi/16).\n     * i0..i3 in the paper are tmp4..tmp7 here.\n     */\n\n    z1 = tmp4 + tmp7;\n    z2 = tmp5 + tmp6;\n    z3 = tmp4 + tmp6;\n    z4 = tmp5 + tmp7;\n    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */\n\n    tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */\n    tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */\n    tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */\n    tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */\n    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */\n    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */\n    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */\n    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */\n\n    z3 += z5;\n    z4 += z5;\n\n    dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS);\n    dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS);\n    dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS);\n    dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS);\n\n    dataptr += DCTSIZE;         /* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];\n    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];\n    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];\n    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];\n    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];\n\n    /* Even part per LL&M figure 1 --- note that published figure is faulty;\n     * rotator \"sqrt(2)*c1\" should be \"sqrt(2)*c6\".\n     */\n\n    tmp10 = tmp0 + tmp3;\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n\n    dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS);\n    dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS);\n\n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);\n    dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),\n                                           CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),\n                                           CONST_BITS+PASS1_BITS);\n\n    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).\n     * cK represents cos(K*pi/16).\n     * i0..i3 in the paper are tmp4..tmp7 here.\n     */\n\n    z1 = tmp4 + tmp7;\n    z2 = tmp5 + tmp6;\n    z3 = tmp4 + tmp6;\n    z4 = tmp5 + tmp7;\n    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */\n\n    tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */\n    tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */\n    tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */\n    tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */\n    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */\n    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */\n    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */\n    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */\n\n    z3 += z5;\n    z4 += z5;\n\n    dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3,\n                                           CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4,\n                                           CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3,\n                                           CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4,\n                                           CONST_BITS+PASS1_BITS);\n\n    dataptr++;                  /* advance pointer to next column */\n  }\n}\n\n#endif /* DCT_ISLOW_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jidctflt.c",
    "content": "/*\n * jidctflt.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * Modified 2010 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2014, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains a floating-point implementation of the\n * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine\n * must also perform dequantization of the input coefficients.\n *\n * This implementation should be more accurate than either of the integer\n * IDCT implementations.  However, it may not give the same results on all\n * machines because of differences in roundoff behavior.  Speed will depend\n * on the hardware's floating point capacity.\n *\n * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT\n * on each row (or vice versa, but it's more convenient to emit a row at\n * a time).  Direct algorithms are also available, but they are much more\n * complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on Arai, Agui, and Nakajima's algorithm for\n * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in\n * Japanese, but the algorithm is described in the Pennebaker & Mitchell\n * JPEG textbook (see REFERENCES section in file README.ijg).  The following\n * code is based directly on figure 4-8 in P&M.\n * While an 8-point DCT cannot be done in less than 11 multiplies, it is\n * possible to arrange the computation so that many of the multiplies are\n * simple scalings of the final outputs.  These multiplies can then be\n * folded into the multiplications or divisions by the JPEG quantization\n * table entries.  The AA&N method leaves only 5 multiplies and 29 adds\n * to be done in the DCT itself.\n * The primary disadvantage of this method is that with a fixed-point\n * implementation, accuracy is lost due to imprecise representation of the\n * scaled quantization values.  However, that problem does not arise if\n * we use floating point arithmetic.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"               /* Private declarations for DCT subsystem */\n\n#ifdef DCT_FLOAT_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/* Dequantize a coefficient by multiplying it by the multiplier-table\n * entry; produce a float result.\n */\n\n#define DEQUANTIZE(coef,quantval)  (((FAST_FLOAT) (coef)) * (quantval))\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients.\n */\n\nGLOBAL(void)\njpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                 JCOEFPTR coef_block,\n                 JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  FAST_FLOAT tmp10, tmp11, tmp12, tmp13;\n  FAST_FLOAT z5, z10, z11, z12, z13;\n  JCOEFPTR inptr;\n  FLOAT_MULT_TYPE *quantptr;\n  FAST_FLOAT *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = cinfo->sample_range_limit;\n  int ctr;\n  FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */\n  #define _0_125 ((FLOAT_MULT_TYPE)0.125)\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (FLOAT_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = DCTSIZE; ctr > 0; ctr--) {\n    /* Due to quantization, we will usually find that many of the input\n     * coefficients are zero, especially the AC terms.  We can exploit this\n     * by short-circuiting the IDCT calculation for any column in which all\n     * the AC terms are zero.  In that case each output is equal to the\n     * DC coefficient (with scale factor as needed).\n     * With typical images and quantization tables, half or more of the\n     * column DCT calculations can be simplified this way.\n     */\n\n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&\n        inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&\n        inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&\n        inptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero */\n      FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0],\n                                    quantptr[DCTSIZE*0] * _0_125);\n\n      wsptr[DCTSIZE*0] = dcval;\n      wsptr[DCTSIZE*1] = dcval;\n      wsptr[DCTSIZE*2] = dcval;\n      wsptr[DCTSIZE*3] = dcval;\n      wsptr[DCTSIZE*4] = dcval;\n      wsptr[DCTSIZE*5] = dcval;\n      wsptr[DCTSIZE*6] = dcval;\n      wsptr[DCTSIZE*7] = dcval;\n\n      inptr++;                  /* advance pointers to next column */\n      quantptr++;\n      wsptr++;\n      continue;\n    }\n\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0] * _0_125);\n    tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2] * _0_125);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4] * _0_125);\n    tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6] * _0_125);\n\n    tmp10 = tmp0 + tmp2;        /* phase 3 */\n    tmp11 = tmp0 - tmp2;\n\n    tmp13 = tmp1 + tmp3;        /* phases 5-3 */\n    tmp12 = (tmp1 - tmp3) * ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */\n\n    tmp0 = tmp10 + tmp13;       /* phase 2 */\n    tmp3 = tmp10 - tmp13;\n    tmp1 = tmp11 + tmp12;\n    tmp2 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1] * _0_125);\n    tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3] * _0_125);\n    tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5] * _0_125);\n    tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7] * _0_125);\n\n    z13 = tmp6 + tmp5;          /* phase 6 */\n    z10 = tmp6 - tmp5;\n    z11 = tmp4 + tmp7;\n    z12 = tmp4 - tmp7;\n\n    tmp7 = z11 + z13;           /* phase 5 */\n    tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */\n\n    z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */\n    tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */\n    tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */\n\n    tmp6 = tmp12 - tmp7;        /* phase 2 */\n    tmp5 = tmp11 - tmp6;\n    tmp4 = tmp10 - tmp5;\n\n    wsptr[DCTSIZE*0] = tmp0 + tmp7;\n    wsptr[DCTSIZE*7] = tmp0 - tmp7;\n    wsptr[DCTSIZE*1] = tmp1 + tmp6;\n    wsptr[DCTSIZE*6] = tmp1 - tmp6;\n    wsptr[DCTSIZE*2] = tmp2 + tmp5;\n    wsptr[DCTSIZE*5] = tmp2 - tmp5;\n    wsptr[DCTSIZE*3] = tmp3 + tmp4;\n    wsptr[DCTSIZE*4] = tmp3 - tmp4;\n\n    inptr++;                    /* advance pointers to next column */\n    quantptr++;\n    wsptr++;\n  }\n\n  /* Pass 2: process rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < DCTSIZE; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n    /* Rows of zeroes can be exploited in the same way as we did with columns.\n     * However, the column calculation has created many nonzero AC terms, so\n     * the simplification applies less often (typically 5% to 10% of the time).\n     * And testing floats for zero is relatively expensive, so we don't bother.\n     */\n\n    /* Even part */\n\n    /* Apply signed->unsigned and prepare float->int conversion */\n    z5 = wsptr[0] + ((FAST_FLOAT) CENTERJSAMPLE + (FAST_FLOAT) 0.5);\n    tmp10 = z5 + wsptr[4];\n    tmp11 = z5 - wsptr[4];\n\n    tmp13 = wsptr[2] + wsptr[6];\n    tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13;\n\n    tmp0 = tmp10 + tmp13;\n    tmp3 = tmp10 - tmp13;\n    tmp1 = tmp11 + tmp12;\n    tmp2 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    z13 = wsptr[5] + wsptr[3];\n    z10 = wsptr[5] - wsptr[3];\n    z11 = wsptr[1] + wsptr[7];\n    z12 = wsptr[1] - wsptr[7];\n\n    tmp7 = z11 + z13;\n    tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562);\n\n    z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */\n    tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */\n    tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */\n\n    tmp6 = tmp12 - tmp7;\n    tmp5 = tmp11 - tmp6;\n    tmp4 = tmp10 - tmp5;\n\n    /* Final output stage: float->int conversion and range-limit */\n\n    outptr[0] = range_limit[((int) (tmp0 + tmp7)) & RANGE_MASK];\n    outptr[7] = range_limit[((int) (tmp0 - tmp7)) & RANGE_MASK];\n    outptr[1] = range_limit[((int) (tmp1 + tmp6)) & RANGE_MASK];\n    outptr[6] = range_limit[((int) (tmp1 - tmp6)) & RANGE_MASK];\n    outptr[2] = range_limit[((int) (tmp2 + tmp5)) & RANGE_MASK];\n    outptr[5] = range_limit[((int) (tmp2 - tmp5)) & RANGE_MASK];\n    outptr[3] = range_limit[((int) (tmp3 + tmp4)) & RANGE_MASK];\n    outptr[4] = range_limit[((int) (tmp3 - tmp4)) & RANGE_MASK];\n\n    wsptr += DCTSIZE;           /* advance pointer to next row */\n  }\n}\n\n#endif /* DCT_FLOAT_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jidctfst.c",
    "content": "/*\n * jidctfst.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains a fast, not so accurate integer implementation of the\n * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine\n * must also perform dequantization of the input coefficients.\n *\n * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT\n * on each row (or vice versa, but it's more convenient to emit a row at\n * a time).  Direct algorithms are also available, but they are much more\n * complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on Arai, Agui, and Nakajima's algorithm for\n * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in\n * Japanese, but the algorithm is described in the Pennebaker & Mitchell\n * JPEG textbook (see REFERENCES section in file README.ijg).  The following\n * code is based directly on figure 4-8 in P&M.\n * While an 8-point DCT cannot be done in less than 11 multiplies, it is\n * possible to arrange the computation so that many of the multiplies are\n * simple scalings of the final outputs.  These multiplies can then be\n * folded into the multiplications or divisions by the JPEG quantization\n * table entries.  The AA&N method leaves only 5 multiplies and 29 adds\n * to be done in the DCT itself.\n * The primary disadvantage of this method is that with fixed-point math,\n * accuracy is lost due to imprecise representation of the scaled\n * quantization values.  The smaller the quantization table entry, the less\n * precise the scaled value, so this implementation does worse with high-\n * quality-setting files than with low-quality ones.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"               /* Private declarations for DCT subsystem */\n\n#ifdef DCT_IFAST_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/* Scaling decisions are generally the same as in the LL&M algorithm;\n * see jidctint.c for more details.  However, we choose to descale\n * (right shift) multiplication products as soon as they are formed,\n * rather than carrying additional fractional bits into subsequent additions.\n * This compromises accuracy slightly, but it lets us save a few shifts.\n * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)\n * everywhere except in the multiplications proper; this saves a good deal\n * of work on 16-bit-int machines.\n *\n * The dequantized coefficients are not integers because the AA&N scaling\n * factors have been incorporated.  We represent them scaled up by PASS1_BITS,\n * so that the first and second IDCT rounds have the same input scaling.\n * For 8-bit JSAMPLEs, we choose IFAST_SCALE_BITS = PASS1_BITS so as to\n * avoid a descaling shift; this compromises accuracy rather drastically\n * for small quantization table entries, but it saves a lot of shifts.\n * For 12-bit JSAMPLEs, there's no hope of using 16x16 multiplies anyway,\n * so we use a much larger scaling factor to preserve accuracy.\n *\n * A final compromise is to represent the multiplicative constants to only\n * 8 fractional bits, rather than 13.  This saves some shifting work on some\n * machines, and may also reduce the cost of multiplication (since there\n * are fewer one-bits in the constants).\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define CONST_BITS  8\n#define PASS1_BITS  2\n#else\n#define CONST_BITS  8\n#define PASS1_BITS  1           /* lose a little precision to avoid overflow */\n#endif\n\n/* Some C compilers fail to reduce \"FIX(constant)\" at compile time, thus\n * causing a lot of useless floating-point operations at run time.\n * To get around this we use the following pre-calculated constants.\n * If you change CONST_BITS you may want to add appropriate values.\n * (With a reasonable C compiler, you can just rely on the FIX() macro...)\n */\n\n#if CONST_BITS == 8\n#define FIX_1_082392200  ((JLONG)  277)         /* FIX(1.082392200) */\n#define FIX_1_414213562  ((JLONG)  362)         /* FIX(1.414213562) */\n#define FIX_1_847759065  ((JLONG)  473)         /* FIX(1.847759065) */\n#define FIX_2_613125930  ((JLONG)  669)         /* FIX(2.613125930) */\n#else\n#define FIX_1_082392200  FIX(1.082392200)\n#define FIX_1_414213562  FIX(1.414213562)\n#define FIX_1_847759065  FIX(1.847759065)\n#define FIX_2_613125930  FIX(2.613125930)\n#endif\n\n\n/* We can gain a little more speed, with a further compromise in accuracy,\n * by omitting the addition in a descaling shift.  This yields an incorrectly\n * rounded result half the time...\n */\n\n#ifndef USE_ACCURATE_ROUNDING\n#undef DESCALE\n#define DESCALE(x,n)  RIGHT_SHIFT(x, n)\n#endif\n\n\n/* Multiply a DCTELEM variable by an JLONG constant, and immediately\n * descale to yield a DCTELEM result.\n */\n\n#define MULTIPLY(var,const)  ((DCTELEM) DESCALE((var) * (const), CONST_BITS))\n\n\n/* Dequantize a coefficient by multiplying it by the multiplier-table\n * entry; produce a DCTELEM result.  For 8-bit data a 16x16->16\n * multiplication will do.  For 12-bit data, the multiplier table is\n * declared JLONG, so a 32-bit multiply will be used.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define DEQUANTIZE(coef,quantval)  (((IFAST_MULT_TYPE) (coef)) * (quantval))\n#else\n#define DEQUANTIZE(coef,quantval)  \\\n        DESCALE((coef)*(quantval), IFAST_SCALE_BITS-PASS1_BITS)\n#endif\n\n\n/* Like DESCALE, but applies to a DCTELEM and produces an int.\n * We assume that int right shift is unsigned if JLONG right shift is.\n */\n\n#ifdef RIGHT_SHIFT_IS_UNSIGNED\n#define ISHIFT_TEMPS    DCTELEM ishift_temp;\n#if BITS_IN_JSAMPLE == 8\n#define DCTELEMBITS  16         /* DCTELEM may be 16 or 32 bits */\n#else\n#define DCTELEMBITS  32         /* DCTELEM must be 32 bits */\n#endif\n#define IRIGHT_SHIFT(x,shft)  \\\n    ((ishift_temp = (x)) < 0 ? \\\n     (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \\\n     (ishift_temp >> (shft)))\n#else\n#define ISHIFT_TEMPS\n#define IRIGHT_SHIFT(x,shft)    ((x) >> (shft))\n#endif\n\n#ifdef USE_ACCURATE_ROUNDING\n#define IDESCALE(x,n)  ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n))\n#else\n#define IDESCALE(x,n)  ((int) IRIGHT_SHIFT(x, n))\n#endif\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients.\n */\n\nGLOBAL(void)\njpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                 JCOEFPTR coef_block,\n                 JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  DCTELEM tmp10, tmp11, tmp12, tmp13;\n  DCTELEM z5, z10, z11, z12, z13;\n  JCOEFPTR inptr;\n  IFAST_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[DCTSIZE2];      /* buffers data between passes */\n  SHIFT_TEMPS                   /* for DESCALE */\n  ISHIFT_TEMPS                  /* for IDESCALE */\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (IFAST_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = DCTSIZE; ctr > 0; ctr--) {\n    /* Due to quantization, we will usually find that many of the input\n     * coefficients are zero, especially the AC terms.  We can exploit this\n     * by short-circuiting the IDCT calculation for any column in which all\n     * the AC terms are zero.  In that case each output is equal to the\n     * DC coefficient (with scale factor as needed).\n     * With typical images and quantization tables, half or more of the\n     * column DCT calculations can be simplified this way.\n     */\n\n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&\n        inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&\n        inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&\n        inptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero */\n      int dcval = (int) DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n\n      wsptr[DCTSIZE*0] = dcval;\n      wsptr[DCTSIZE*1] = dcval;\n      wsptr[DCTSIZE*2] = dcval;\n      wsptr[DCTSIZE*3] = dcval;\n      wsptr[DCTSIZE*4] = dcval;\n      wsptr[DCTSIZE*5] = dcval;\n      wsptr[DCTSIZE*6] = dcval;\n      wsptr[DCTSIZE*7] = dcval;\n\n      inptr++;                  /* advance pointers to next column */\n      quantptr++;\n      wsptr++;\n      continue;\n    }\n\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp10 = tmp0 + tmp2;        /* phase 3 */\n    tmp11 = tmp0 - tmp2;\n\n    tmp13 = tmp1 + tmp3;        /* phases 5-3 */\n    tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */\n\n    tmp0 = tmp10 + tmp13;       /* phase 2 */\n    tmp3 = tmp10 - tmp13;\n    tmp1 = tmp11 + tmp12;\n    tmp2 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    z13 = tmp6 + tmp5;          /* phase 6 */\n    z10 = tmp6 - tmp5;\n    z11 = tmp4 + tmp7;\n    z12 = tmp4 - tmp7;\n\n    tmp7 = z11 + z13;           /* phase 5 */\n    tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */\n\n    z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */\n    tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */\n    tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */\n\n    tmp6 = tmp12 - tmp7;        /* phase 2 */\n    tmp5 = tmp11 - tmp6;\n    tmp4 = tmp10 + tmp5;\n\n    wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7);\n    wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7);\n    wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6);\n    wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6);\n    wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5);\n    wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5);\n    wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4);\n    wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4);\n\n    inptr++;                    /* advance pointers to next column */\n    quantptr++;\n    wsptr++;\n  }\n\n  /* Pass 2: process rows from work array, store into output array. */\n  /* Note that we must descale the results by a factor of 8 == 2**3, */\n  /* and also undo the PASS1_BITS scaling. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < DCTSIZE; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n    /* Rows of zeroes can be exploited in the same way as we did with columns.\n     * However, the column calculation has created many nonzero AC terms, so\n     * the simplification applies less often (typically 5% to 10% of the time).\n     * On machines with very fast multiplication, it's possible that the\n     * test takes more time than it's worth.  In that case this section\n     * may be commented out.\n     */\n\n#ifndef NO_ZERO_ROW_TEST\n    if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&\n        wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {\n      /* AC terms all zero */\n      JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3)\n                                  & RANGE_MASK];\n\n      outptr[0] = dcval;\n      outptr[1] = dcval;\n      outptr[2] = dcval;\n      outptr[3] = dcval;\n      outptr[4] = dcval;\n      outptr[5] = dcval;\n      outptr[6] = dcval;\n      outptr[7] = dcval;\n\n      wsptr += DCTSIZE;         /* advance pointer to next row */\n      continue;\n    }\n#endif\n\n    /* Even part */\n\n    tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]);\n    tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]);\n\n    tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]);\n    tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562)\n            - tmp13;\n\n    tmp0 = tmp10 + tmp13;\n    tmp3 = tmp10 - tmp13;\n    tmp1 = tmp11 + tmp12;\n    tmp2 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3];\n    z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3];\n    z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7];\n    z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7];\n\n    tmp7 = z11 + z13;           /* phase 5 */\n    tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */\n\n    z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */\n    tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */\n    tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */\n\n    tmp6 = tmp12 - tmp7;        /* phase 2 */\n    tmp5 = tmp11 - tmp6;\n    tmp4 = tmp10 + tmp5;\n\n    /* Final output stage: scale down by a factor of 8 and range-limit */\n\n    outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3)\n                            & RANGE_MASK];\n\n    wsptr += DCTSIZE;           /* advance pointer to next row */\n  }\n}\n\n#endif /* DCT_IFAST_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jidctint.c",
    "content": "/*\n * jidctint.c\n *\n * This file was part of the Independent JPEG Group's software.\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modification developed 2002-2009 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains a slow-but-accurate integer implementation of the\n * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine\n * must also perform dequantization of the input coefficients.\n *\n * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT\n * on each row (or vice versa, but it's more convenient to emit a row at\n * a time).  Direct algorithms are also available, but they are much more\n * complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on an algorithm described in\n *   C. Loeffler, A. Ligtenberg and G. Moschytz, \"Practical Fast 1-D DCT\n *   Algorithms with 11 Multiplications\", Proc. Int'l. Conf. on Acoustics,\n *   Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.\n * The primary algorithm described there uses 11 multiplies and 29 adds.\n * We use their alternate method with 12 multiplies and 32 adds.\n * The advantage of this method is that no data path contains more than one\n * multiplication; this allows a very simple and accurate implementation in\n * scaled fixed-point arithmetic, with a minimal number of shifts.\n *\n * We also provide IDCT routines with various output sample block sizes for\n * direct resolution reduction or enlargement without additional resampling:\n * NxN (N=1...16) pixels for one 8x8 input DCT block.\n *\n * For N<8 we simply take the corresponding low-frequency coefficients of\n * the 8x8 input DCT block and apply an NxN point IDCT on the sub-block\n * to yield the downscaled outputs.\n * This can be seen as direct low-pass downsampling from the DCT domain\n * point of view rather than the usual spatial domain point of view,\n * yielding significant computational savings and results at least\n * as good as common bilinear (averaging) spatial downsampling.\n *\n * For N>8 we apply a partial NxN IDCT on the 8 input coefficients as\n * lower frequencies and higher frequencies assumed to be zero.\n * It turns out that the computational effort is similar to the 8x8 IDCT\n * regarding the output size.\n * Furthermore, the scaling and descaling is the same for all IDCT sizes.\n *\n * CAUTION: We rely on the FIX() macro except for the N=1,2,4,8 cases\n * since there would be too many additional constants to pre-calculate.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"               /* Private declarations for DCT subsystem */\n\n#ifdef DCT_ISLOW_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */\n#endif\n\n\n/*\n * The poop on this scaling stuff is as follows:\n *\n * Each 1-D IDCT step produces outputs which are a factor of sqrt(N)\n * larger than the true IDCT outputs.  The final outputs are therefore\n * a factor of N larger than desired; since N=8 this can be cured by\n * a simple right shift at the end of the algorithm.  The advantage of\n * this arrangement is that we save two multiplications per 1-D IDCT,\n * because the y0 and y4 inputs need not be divided by sqrt(N).\n *\n * We have to do addition and subtraction of the integer inputs, which\n * is no problem, and multiplication by fractional constants, which is\n * a problem to do in integer arithmetic.  We multiply all the constants\n * by CONST_SCALE and convert them to integer constants (thus retaining\n * CONST_BITS bits of precision in the constants).  After doing a\n * multiplication we have to divide the product by CONST_SCALE, with proper\n * rounding, to produce the correct output.  This division can be done\n * cheaply as a right shift of CONST_BITS bits.  We postpone shifting\n * as long as possible so that partial sums can be added together with\n * full fractional precision.\n *\n * The outputs of the first pass are scaled up by PASS1_BITS bits so that\n * they are represented to better-than-integral precision.  These outputs\n * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word\n * with the recommended scaling.  (To scale up 12-bit sample data further, an\n * intermediate JLONG array would be needed.)\n *\n * To avoid overflow of the 32-bit intermediate results in pass 2, we must\n * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis\n * shows that the values given below are the most effective.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define CONST_BITS  13\n#define PASS1_BITS  2\n#else\n#define CONST_BITS  13\n#define PASS1_BITS  1           /* lose a little precision to avoid overflow */\n#endif\n\n/* Some C compilers fail to reduce \"FIX(constant)\" at compile time, thus\n * causing a lot of useless floating-point operations at run time.\n * To get around this we use the following pre-calculated constants.\n * If you change CONST_BITS you may want to add appropriate values.\n * (With a reasonable C compiler, you can just rely on the FIX() macro...)\n */\n\n#if CONST_BITS == 13\n#define FIX_0_298631336  ((JLONG)  2446)        /* FIX(0.298631336) */\n#define FIX_0_390180644  ((JLONG)  3196)        /* FIX(0.390180644) */\n#define FIX_0_541196100  ((JLONG)  4433)        /* FIX(0.541196100) */\n#define FIX_0_765366865  ((JLONG)  6270)        /* FIX(0.765366865) */\n#define FIX_0_899976223  ((JLONG)  7373)        /* FIX(0.899976223) */\n#define FIX_1_175875602  ((JLONG)  9633)        /* FIX(1.175875602) */\n#define FIX_1_501321110  ((JLONG)  12299)       /* FIX(1.501321110) */\n#define FIX_1_847759065  ((JLONG)  15137)       /* FIX(1.847759065) */\n#define FIX_1_961570560  ((JLONG)  16069)       /* FIX(1.961570560) */\n#define FIX_2_053119869  ((JLONG)  16819)       /* FIX(2.053119869) */\n#define FIX_2_562915447  ((JLONG)  20995)       /* FIX(2.562915447) */\n#define FIX_3_072711026  ((JLONG)  25172)       /* FIX(3.072711026) */\n#else\n#define FIX_0_298631336  FIX(0.298631336)\n#define FIX_0_390180644  FIX(0.390180644)\n#define FIX_0_541196100  FIX(0.541196100)\n#define FIX_0_765366865  FIX(0.765366865)\n#define FIX_0_899976223  FIX(0.899976223)\n#define FIX_1_175875602  FIX(1.175875602)\n#define FIX_1_501321110  FIX(1.501321110)\n#define FIX_1_847759065  FIX(1.847759065)\n#define FIX_1_961570560  FIX(1.961570560)\n#define FIX_2_053119869  FIX(2.053119869)\n#define FIX_2_562915447  FIX(2.562915447)\n#define FIX_3_072711026  FIX(3.072711026)\n#endif\n\n\n/* Multiply an JLONG variable by an JLONG constant to yield an JLONG result.\n * For 8-bit samples with the recommended scaling, all the variable\n * and constant values involved are no more than 16 bits wide, so a\n * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.\n * For 12-bit samples, a full 32-bit multiplication will be needed.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define MULTIPLY(var,const)  MULTIPLY16C16(var,const)\n#else\n#define MULTIPLY(var,const)  ((var) * (const))\n#endif\n\n\n/* Dequantize a coefficient by multiplying it by the multiplier-table\n * entry; produce an int result.  In this module, both inputs and result\n * are 16 bits or less, so either int or short multiply will work.\n */\n\n#define DEQUANTIZE(coef,quantval)  (((ISLOW_MULT_TYPE) (coef)) * (quantval))\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients.\n */\n\nGLOBAL(void)\njpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                 JCOEFPTR coef_block,\n                 JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  JLONG tmp0, tmp1, tmp2, tmp3;\n  JLONG tmp10, tmp11, tmp12, tmp13;\n  JLONG z1, z2, z3, z4, z5;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[DCTSIZE2];      /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n  /* Note results are scaled up by sqrt(8) compared to a true IDCT; */\n  /* furthermore, we scale the results by 2**PASS1_BITS. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = DCTSIZE; ctr > 0; ctr--) {\n    /* Due to quantization, we will usually find that many of the input\n     * coefficients are zero, especially the AC terms.  We can exploit this\n     * by short-circuiting the IDCT calculation for any column in which all\n     * the AC terms are zero.  In that case each output is equal to the\n     * DC coefficient (with scale factor as needed).\n     * With typical images and quantization tables, half or more of the\n     * column DCT calculations can be simplified this way.\n     */\n\n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&\n        inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&\n        inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&\n        inptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero */\n      int dcval = LEFT_SHIFT(DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]),\n                             PASS1_BITS);\n\n      wsptr[DCTSIZE*0] = dcval;\n      wsptr[DCTSIZE*1] = dcval;\n      wsptr[DCTSIZE*2] = dcval;\n      wsptr[DCTSIZE*3] = dcval;\n      wsptr[DCTSIZE*4] = dcval;\n      wsptr[DCTSIZE*5] = dcval;\n      wsptr[DCTSIZE*6] = dcval;\n      wsptr[DCTSIZE*7] = dcval;\n\n      inptr++;                  /* advance pointers to next column */\n      quantptr++;\n      wsptr++;\n      continue;\n    }\n\n    /* Even part: reverse the even part of the forward DCT. */\n    /* The rotator is sqrt(2)*c(-6). */\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);\n    tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065);\n    tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n\n    tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS);\n    tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS);\n\n    tmp10 = tmp0 + tmp3;\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n\n    /* Odd part per figure 8; the matrix is unitary and hence its\n     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.\n     */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n    tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n\n    z1 = tmp0 + tmp3;\n    z2 = tmp1 + tmp2;\n    z3 = tmp0 + tmp2;\n    z4 = tmp1 + tmp3;\n    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */\n\n    tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */\n    tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */\n    tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */\n    tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */\n    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */\n    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */\n    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */\n    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */\n\n    z3 += z5;\n    z4 += z5;\n\n    tmp0 += z1 + z3;\n    tmp1 += z2 + z4;\n    tmp2 += z2 + z3;\n    tmp3 += z1 + z4;\n\n    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */\n\n    wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS);\n\n    inptr++;                    /* advance pointers to next column */\n    quantptr++;\n    wsptr++;\n  }\n\n  /* Pass 2: process rows from work array, store into output array. */\n  /* Note that we must descale the results by a factor of 8 == 2**3, */\n  /* and also undo the PASS1_BITS scaling. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < DCTSIZE; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n    /* Rows of zeroes can be exploited in the same way as we did with columns.\n     * However, the column calculation has created many nonzero AC terms, so\n     * the simplification applies less often (typically 5% to 10% of the time).\n     * On machines with very fast multiplication, it's possible that the\n     * test takes more time than it's worth.  In that case this section\n     * may be commented out.\n     */\n\n#ifndef NO_ZERO_ROW_TEST\n    if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&\n        wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {\n      /* AC terms all zero */\n      JSAMPLE dcval = range_limit[(int) DESCALE((JLONG) wsptr[0], PASS1_BITS+3)\n                                  & RANGE_MASK];\n\n      outptr[0] = dcval;\n      outptr[1] = dcval;\n      outptr[2] = dcval;\n      outptr[3] = dcval;\n      outptr[4] = dcval;\n      outptr[5] = dcval;\n      outptr[6] = dcval;\n      outptr[7] = dcval;\n\n      wsptr += DCTSIZE;         /* advance pointer to next row */\n      continue;\n    }\n#endif\n\n    /* Even part: reverse the even part of the forward DCT. */\n    /* The rotator is sqrt(2)*c(-6). */\n\n    z2 = (JLONG) wsptr[2];\n    z3 = (JLONG) wsptr[6];\n\n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);\n    tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065);\n    tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);\n\n    tmp0 = LEFT_SHIFT((JLONG) wsptr[0] + (JLONG) wsptr[4], CONST_BITS);\n    tmp1 = LEFT_SHIFT((JLONG) wsptr[0] - (JLONG) wsptr[4], CONST_BITS);\n\n    tmp10 = tmp0 + tmp3;\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n\n    /* Odd part per figure 8; the matrix is unitary and hence its\n     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.\n     */\n\n    tmp0 = (JLONG) wsptr[7];\n    tmp1 = (JLONG) wsptr[5];\n    tmp2 = (JLONG) wsptr[3];\n    tmp3 = (JLONG) wsptr[1];\n\n    z1 = tmp0 + tmp3;\n    z2 = tmp1 + tmp2;\n    z3 = tmp0 + tmp2;\n    z4 = tmp1 + tmp3;\n    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */\n\n    tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */\n    tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */\n    tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */\n    tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */\n    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */\n    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */\n    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */\n    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */\n\n    z3 += z5;\n    z4 += z5;\n\n    tmp0 += z1 + z3;\n    tmp1 += z2 + z4;\n    tmp2 += z2 + z3;\n    tmp3 += z1 + z4;\n\n    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */\n\n    outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp3,\n                                          CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[7] = range_limit[(int) DESCALE(tmp10 - tmp3,\n                                          CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[1] = range_limit[(int) DESCALE(tmp11 + tmp2,\n                                          CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[6] = range_limit[(int) DESCALE(tmp11 - tmp2,\n                                          CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[2] = range_limit[(int) DESCALE(tmp12 + tmp1,\n                                          CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[5] = range_limit[(int) DESCALE(tmp12 - tmp1,\n                                          CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[3] = range_limit[(int) DESCALE(tmp13 + tmp0,\n                                          CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[4] = range_limit[(int) DESCALE(tmp13 - tmp0,\n                                          CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n\n    wsptr += DCTSIZE;           /* advance pointer to next row */\n  }\n}\n\n#ifdef IDCT_SCALING_SUPPORTED\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 7x7 output block.\n *\n * Optimized algorithm with 12 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/14).\n */\n\nGLOBAL(void)\njpeg_idct_7x7 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n               JCOEFPTR coef_block,\n               JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  JLONG tmp0, tmp1, tmp2, tmp10, tmp11, tmp12, tmp13;\n  JLONG z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[7*7];   /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 7; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp13 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp13 = LEFT_SHIFT(tmp13, CONST_BITS);\n    /* Add fudge factor here for final descale. */\n    tmp13 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp10 = MULTIPLY(z2 - z3, FIX(0.881747734));     /* c4 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.314692123));     /* c6 */\n    tmp11 = tmp10 + tmp12 + tmp13 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */\n    tmp0 = z1 + z3;\n    z2 -= tmp0;\n    tmp0 = MULTIPLY(tmp0, FIX(1.274162392)) + tmp13; /* c2 */\n    tmp10 += tmp0 - MULTIPLY(z3, FIX(0.077722536));  /* c2-c4-c6 */\n    tmp12 += tmp0 - MULTIPLY(z1, FIX(2.470602249));  /* c2+c4+c6 */\n    tmp13 += MULTIPLY(z2, FIX(1.414213562));         /* c0 */\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n\n    tmp1 = MULTIPLY(z1 + z2, FIX(0.935414347));      /* (c3+c1-c5)/2 */\n    tmp2 = MULTIPLY(z1 - z2, FIX(0.170262339));      /* (c3+c5-c1)/2 */\n    tmp0 = tmp1 - tmp2;\n    tmp1 += tmp2;\n    tmp2 = MULTIPLY(z2 + z3, - FIX(1.378756276));    /* -c1 */\n    tmp1 += tmp2;\n    z2 = MULTIPLY(z1 + z3, FIX(0.613604268));        /* c5 */\n    tmp0 += z2;\n    tmp2 += z2 + MULTIPLY(z3, FIX(1.870828693));     /* c3+c1-c5 */\n\n    /* Final output stage */\n\n    wsptr[7*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[7*6] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[7*1] = (int) RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[7*5] = (int) RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[7*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[7*4] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[7*3] = (int) RIGHT_SHIFT(tmp13, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 7 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 7; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp13 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp13 = LEFT_SHIFT(tmp13, CONST_BITS);\n\n    z1 = (JLONG) wsptr[2];\n    z2 = (JLONG) wsptr[4];\n    z3 = (JLONG) wsptr[6];\n\n    tmp10 = MULTIPLY(z2 - z3, FIX(0.881747734));     /* c4 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.314692123));     /* c6 */\n    tmp11 = tmp10 + tmp12 + tmp13 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */\n    tmp0 = z1 + z3;\n    z2 -= tmp0;\n    tmp0 = MULTIPLY(tmp0, FIX(1.274162392)) + tmp13; /* c2 */\n    tmp10 += tmp0 - MULTIPLY(z3, FIX(0.077722536));  /* c2-c4-c6 */\n    tmp12 += tmp0 - MULTIPLY(z1, FIX(2.470602249));  /* c2+c4+c6 */\n    tmp13 += MULTIPLY(z2, FIX(1.414213562));         /* c0 */\n\n    /* Odd part */\n\n    z1 = (JLONG) wsptr[1];\n    z2 = (JLONG) wsptr[3];\n    z3 = (JLONG) wsptr[5];\n\n    tmp1 = MULTIPLY(z1 + z2, FIX(0.935414347));      /* (c3+c1-c5)/2 */\n    tmp2 = MULTIPLY(z1 - z2, FIX(0.170262339));      /* (c3+c5-c1)/2 */\n    tmp0 = tmp1 - tmp2;\n    tmp1 += tmp2;\n    tmp2 = MULTIPLY(z2 + z3, - FIX(1.378756276));    /* -c1 */\n    tmp1 += tmp2;\n    z2 = MULTIPLY(z1 + z3, FIX(0.613604268));        /* c5 */\n    tmp0 += z2;\n    tmp2 += z2 + MULTIPLY(z3, FIX(1.870828693));     /* c3+c1-c5 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n\n    wsptr += 7;         /* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 6x6 output block.\n *\n * Optimized algorithm with 3 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/12).\n */\n\nGLOBAL(void)\njpeg_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n               JCOEFPTR coef_block,\n               JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  JLONG tmp0, tmp1, tmp2, tmp10, tmp11, tmp12;\n  JLONG z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[6*6];   /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 6; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    tmp10 = MULTIPLY(tmp2, FIX(0.707106781));   /* c4 */\n    tmp1 = tmp0 + tmp10;\n    tmp11 = RIGHT_SHIFT(tmp0 - tmp10 - tmp10, CONST_BITS-PASS1_BITS);\n    tmp10 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp0 = MULTIPLY(tmp10, FIX(1.224744871));   /* c2 */\n    tmp10 = tmp1 + tmp0;\n    tmp12 = tmp1 - tmp0;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */\n    tmp0 = tmp1 + LEFT_SHIFT(z1 + z2, CONST_BITS);\n    tmp2 = tmp1 + LEFT_SHIFT(z3 - z2, CONST_BITS);\n    tmp1 = LEFT_SHIFT(z1 - z2 - z3, PASS1_BITS);\n\n    /* Final output stage */\n\n    wsptr[6*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[6*5] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[6*1] = (int) (tmp11 + tmp1);\n    wsptr[6*4] = (int) (tmp11 - tmp1);\n    wsptr[6*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[6*3] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 6 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 6; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);\n    tmp2 = (JLONG) wsptr[4];\n    tmp10 = MULTIPLY(tmp2, FIX(0.707106781));   /* c4 */\n    tmp1 = tmp0 + tmp10;\n    tmp11 = tmp0 - tmp10 - tmp10;\n    tmp10 = (JLONG) wsptr[2];\n    tmp0 = MULTIPLY(tmp10, FIX(1.224744871));   /* c2 */\n    tmp10 = tmp1 + tmp0;\n    tmp12 = tmp1 - tmp0;\n\n    /* Odd part */\n\n    z1 = (JLONG) wsptr[1];\n    z2 = (JLONG) wsptr[3];\n    z3 = (JLONG) wsptr[5];\n    tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */\n    tmp0 = tmp1 + LEFT_SHIFT(z1 + z2, CONST_BITS);\n    tmp2 = tmp1 + LEFT_SHIFT(z3 - z2, CONST_BITS);\n    tmp1 = LEFT_SHIFT(z1 - z2 - z3, CONST_BITS);\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n\n    wsptr += 6;         /* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 5x5 output block.\n *\n * Optimized algorithm with 5 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/10).\n */\n\nGLOBAL(void)\njpeg_idct_5x5 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n               JCOEFPTR coef_block,\n               JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  JLONG tmp0, tmp1, tmp10, tmp11, tmp12;\n  JLONG z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[5*5];   /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 5; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp12 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp12 = LEFT_SHIFT(tmp12, CONST_BITS);\n    /* Add fudge factor here for final descale. */\n    tmp12 += ONE << (CONST_BITS-PASS1_BITS-1);\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z1 = MULTIPLY(tmp0 + tmp1, FIX(0.790569415)); /* (c2+c4)/2 */\n    z2 = MULTIPLY(tmp0 - tmp1, FIX(0.353553391)); /* (c2-c4)/2 */\n    z3 = tmp12 + z2;\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z1;\n    tmp12 -= LEFT_SHIFT(z2, 2);\n\n    /* Odd part */\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));     /* c3 */\n    tmp0 = z1 + MULTIPLY(z2, FIX(0.513743148));   /* c1-c3 */\n    tmp1 = z1 - MULTIPLY(z3, FIX(2.176250899));   /* c1+c3 */\n\n    /* Final output stage */\n\n    wsptr[5*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[5*4] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[5*1] = (int) RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[5*3] = (int) RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[5*2] = (int) RIGHT_SHIFT(tmp12, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 5 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 5; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp12 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp12 = LEFT_SHIFT(tmp12, CONST_BITS);\n    tmp0 = (JLONG) wsptr[2];\n    tmp1 = (JLONG) wsptr[4];\n    z1 = MULTIPLY(tmp0 + tmp1, FIX(0.790569415)); /* (c2+c4)/2 */\n    z2 = MULTIPLY(tmp0 - tmp1, FIX(0.353553391)); /* (c2-c4)/2 */\n    z3 = tmp12 + z2;\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z1;\n    tmp12 -= LEFT_SHIFT(z2, 2);\n\n    /* Odd part */\n\n    z2 = (JLONG) wsptr[1];\n    z3 = (JLONG) wsptr[3];\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));     /* c3 */\n    tmp0 = z1 + MULTIPLY(z2, FIX(0.513743148));   /* c1-c3 */\n    tmp1 = z1 - MULTIPLY(z3, FIX(2.176250899));   /* c1+c3 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n\n    wsptr += 5;         /* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 3x3 output block.\n *\n * Optimized algorithm with 2 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/6).\n */\n\nGLOBAL(void)\njpeg_idct_3x3 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n               JCOEFPTR coef_block,\n               JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  JLONG tmp0, tmp2, tmp10, tmp12;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[3*3];   /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 3; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */\n    tmp10 = tmp0 + tmp12;\n    tmp2 = tmp0 - tmp12 - tmp12;\n\n    /* Odd part */\n\n    tmp12 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */\n\n    /* Final output stage */\n\n    wsptr[3*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[3*2] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[3*1] = (int) RIGHT_SHIFT(tmp2, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 3 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 3; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);\n    tmp2 = (JLONG) wsptr[2];\n    tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */\n    tmp10 = tmp0 + tmp12;\n    tmp2 = tmp0 - tmp12 - tmp12;\n\n    /* Odd part */\n\n    tmp12 = (JLONG) wsptr[1];\n    tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp2,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n\n    wsptr += 3;         /* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 9x9 output block.\n *\n * Optimized algorithm with 10 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/18).\n */\n\nGLOBAL(void)\njpeg_idct_9x9 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n               JCOEFPTR coef_block,\n               JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  JLONG tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13, tmp14;\n  JLONG z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*9];   /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp3 = MULTIPLY(z3, FIX(0.707106781));      /* c6 */\n    tmp1 = tmp0 + tmp3;\n    tmp2 = tmp0 - tmp3 - tmp3;\n\n    tmp0 = MULTIPLY(z1 - z2, FIX(0.707106781)); /* c6 */\n    tmp11 = tmp2 + tmp0;\n    tmp14 = tmp2 - tmp0 - tmp0;\n\n    tmp0 = MULTIPLY(z1 + z2, FIX(1.328926049)); /* c2 */\n    tmp2 = MULTIPLY(z1, FIX(1.083350441));      /* c4 */\n    tmp3 = MULTIPLY(z2, FIX(0.245575608));      /* c8 */\n\n    tmp10 = tmp1 + tmp0 - tmp3;\n    tmp12 = tmp1 - tmp0 + tmp2;\n    tmp13 = tmp1 - tmp2 + tmp3;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    z2 = MULTIPLY(z2, - FIX(1.224744871));           /* -c3 */\n\n    tmp2 = MULTIPLY(z1 + z3, FIX(0.909038955));      /* c5 */\n    tmp3 = MULTIPLY(z1 + z4, FIX(0.483689525));      /* c7 */\n    tmp0 = tmp2 + tmp3 - z2;\n    tmp1 = MULTIPLY(z3 - z4, FIX(1.392728481));      /* c1 */\n    tmp2 += z2 - tmp1;\n    tmp3 += z2 + tmp1;\n    tmp1 = MULTIPLY(z1 - z3 - z4, FIX(1.224744871)); /* c3 */\n\n    /* Final output stage */\n\n    wsptr[8*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[8*8] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[8*1] = (int) RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[8*7] = (int) RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[8*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[8*6] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[8*3] = (int) RIGHT_SHIFT(tmp13 + tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[8*5] = (int) RIGHT_SHIFT(tmp13 - tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[8*4] = (int) RIGHT_SHIFT(tmp14, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 9 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 9; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);\n\n    z1 = (JLONG) wsptr[2];\n    z2 = (JLONG) wsptr[4];\n    z3 = (JLONG) wsptr[6];\n\n    tmp3 = MULTIPLY(z3, FIX(0.707106781));      /* c6 */\n    tmp1 = tmp0 + tmp3;\n    tmp2 = tmp0 - tmp3 - tmp3;\n\n    tmp0 = MULTIPLY(z1 - z2, FIX(0.707106781)); /* c6 */\n    tmp11 = tmp2 + tmp0;\n    tmp14 = tmp2 - tmp0 - tmp0;\n\n    tmp0 = MULTIPLY(z1 + z2, FIX(1.328926049)); /* c2 */\n    tmp2 = MULTIPLY(z1, FIX(1.083350441));      /* c4 */\n    tmp3 = MULTIPLY(z2, FIX(0.245575608));      /* c8 */\n\n    tmp10 = tmp1 + tmp0 - tmp3;\n    tmp12 = tmp1 - tmp0 + tmp2;\n    tmp13 = tmp1 - tmp2 + tmp3;\n\n    /* Odd part */\n\n    z1 = (JLONG) wsptr[1];\n    z2 = (JLONG) wsptr[3];\n    z3 = (JLONG) wsptr[5];\n    z4 = (JLONG) wsptr[7];\n\n    z2 = MULTIPLY(z2, - FIX(1.224744871));           /* -c3 */\n\n    tmp2 = MULTIPLY(z1 + z3, FIX(0.909038955));      /* c5 */\n    tmp3 = MULTIPLY(z1 + z4, FIX(0.483689525));      /* c7 */\n    tmp0 = tmp2 + tmp3 - z2;\n    tmp1 = MULTIPLY(z3 - z4, FIX(1.392728481));      /* c1 */\n    tmp2 += z2 - tmp1;\n    tmp3 += z2 + tmp1;\n    tmp1 = MULTIPLY(z1 - z3 - z4, FIX(1.224744871)); /* c3 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13 + tmp3,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp3,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp14,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n\n    wsptr += 8;         /* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 10x10 output block.\n *\n * Optimized algorithm with 12 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/20).\n */\n\nGLOBAL(void)\njpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                 JCOEFPTR coef_block,\n                 JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  JLONG tmp10, tmp11, tmp12, tmp13, tmp14;\n  JLONG tmp20, tmp21, tmp22, tmp23, tmp24;\n  JLONG z1, z2, z3, z4, z5;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*10];  /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z3 = LEFT_SHIFT(z3, CONST_BITS);\n    /* Add fudge factor here for final descale. */\n    z3 += ONE << (CONST_BITS-PASS1_BITS-1);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z1 = MULTIPLY(z4, FIX(1.144122806));         /* c4 */\n    z2 = MULTIPLY(z4, FIX(0.437016024));         /* c8 */\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z2;\n\n    tmp22 = RIGHT_SHIFT(z3 - LEFT_SHIFT(z1 - z2, 1),\n                        CONST_BITS-PASS1_BITS);  /* c0 = (c4-c8)*2 */\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));    /* c6 */\n    tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */\n    tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */\n\n    tmp20 = tmp10 + tmp12;\n    tmp24 = tmp10 - tmp12;\n    tmp21 = tmp11 + tmp13;\n    tmp23 = tmp11 - tmp13;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = z2 + z4;\n    tmp13 = z2 - z4;\n\n    tmp12 = MULTIPLY(tmp13, FIX(0.309016994));        /* (c3-c7)/2 */\n    z5 = LEFT_SHIFT(z3, CONST_BITS);\n\n    z2 = MULTIPLY(tmp11, FIX(0.951056516));           /* (c3+c7)/2 */\n    z4 = z5 + tmp12;\n\n    tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */\n    tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */\n\n    z2 = MULTIPLY(tmp11, FIX(0.587785252));           /* (c1-c9)/2 */\n    z4 = z5 - tmp12 - LEFT_SHIFT(tmp13, CONST_BITS - 1);\n\n    tmp12 = LEFT_SHIFT(z1 - tmp13 - z3, PASS1_BITS);\n\n    tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */\n    tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */\n\n    /* Final output stage */\n\n    wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*9] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*8] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2] = (int) (tmp22 + tmp12);\n    wsptr[8*7] = (int) (tmp22 - tmp12);\n    wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*6] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 10 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 10; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z3 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z3 = LEFT_SHIFT(z3, CONST_BITS);\n    z4 = (JLONG) wsptr[4];\n    z1 = MULTIPLY(z4, FIX(1.144122806));         /* c4 */\n    z2 = MULTIPLY(z4, FIX(0.437016024));         /* c8 */\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z2;\n\n    tmp22 = z3 - LEFT_SHIFT(z1 - z2, 1);         /* c0 = (c4-c8)*2 */\n\n    z2 = (JLONG) wsptr[2];\n    z3 = (JLONG) wsptr[6];\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));    /* c6 */\n    tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */\n    tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */\n\n    tmp20 = tmp10 + tmp12;\n    tmp24 = tmp10 - tmp12;\n    tmp21 = tmp11 + tmp13;\n    tmp23 = tmp11 - tmp13;\n\n    /* Odd part */\n\n    z1 = (JLONG) wsptr[1];\n    z2 = (JLONG) wsptr[3];\n    z3 = (JLONG) wsptr[5];\n    z3 = LEFT_SHIFT(z3, CONST_BITS);\n    z4 = (JLONG) wsptr[7];\n\n    tmp11 = z2 + z4;\n    tmp13 = z2 - z4;\n\n    tmp12 = MULTIPLY(tmp13, FIX(0.309016994));        /* (c3-c7)/2 */\n\n    z2 = MULTIPLY(tmp11, FIX(0.951056516));           /* (c3+c7)/2 */\n    z4 = z3 + tmp12;\n\n    tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */\n    tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */\n\n    z2 = MULTIPLY(tmp11, FIX(0.587785252));           /* (c1-c9)/2 */\n    z4 = z3 - tmp12 - LEFT_SHIFT(tmp13, CONST_BITS - 1);\n\n    tmp12 = LEFT_SHIFT(z1 - tmp13, CONST_BITS) - z3;\n\n    tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */\n    tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n                                              CONST_BITS+PASS1_BITS+3)\n                            & RANGE_MASK];\n\n    wsptr += 8;         /* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 11x11 output block.\n *\n * Optimized algorithm with 24 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/22).\n */\n\nGLOBAL(void)\njpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                 JCOEFPTR coef_block,\n                 JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  JLONG tmp10, tmp11, tmp12, tmp13, tmp14;\n  JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;\n  JLONG z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*11];  /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp10 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp10 = LEFT_SHIFT(tmp10, CONST_BITS);\n    /* Add fudge factor here for final descale. */\n    tmp10 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp20 = MULTIPLY(z2 - z3, FIX(2.546640132));     /* c2+c4 */\n    tmp23 = MULTIPLY(z2 - z1, FIX(0.430815045));     /* c2-c6 */\n    z4 = z1 + z3;\n    tmp24 = MULTIPLY(z4, - FIX(1.155664402));        /* -(c2-c10) */\n    z4 -= z2;\n    tmp25 = tmp10 + MULTIPLY(z4, FIX(1.356927976));  /* c2 */\n    tmp21 = tmp20 + tmp23 + tmp25 -\n            MULTIPLY(z2, FIX(1.821790775));          /* c2+c4+c10-c6 */\n    tmp20 += tmp25 + MULTIPLY(z3, FIX(2.115825087)); /* c4+c6 */\n    tmp23 += tmp25 - MULTIPLY(z1, FIX(1.513598477)); /* c6+c8 */\n    tmp24 += tmp25;\n    tmp22 = tmp24 - MULTIPLY(z3, FIX(0.788749120));  /* c8+c10 */\n    tmp24 += MULTIPLY(z2, FIX(1.944413522)) -        /* c2+c8 */\n             MULTIPLY(z1, FIX(1.390975730));         /* c4+c10 */\n    tmp25 = tmp10 - MULTIPLY(z4, FIX(1.414213562));  /* c0 */\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = z1 + z2;\n    tmp14 = MULTIPLY(tmp11 + z3 + z4, FIX(0.398430003)); /* c9 */\n    tmp11 = MULTIPLY(tmp11, FIX(0.887983902));           /* c3-c9 */\n    tmp12 = MULTIPLY(z1 + z3, FIX(0.670361295));         /* c5-c9 */\n    tmp13 = tmp14 + MULTIPLY(z1 + z4, FIX(0.366151574)); /* c7-c9 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n            MULTIPLY(z1, FIX(0.923107866));              /* c7+c5+c3-c1-2*c9 */\n    z1    = tmp14 - MULTIPLY(z2 + z3, FIX(1.163011579)); /* c7+c9 */\n    tmp11 += z1 + MULTIPLY(z2, FIX(2.073276588));        /* c1+c7+3*c9-c3 */\n    tmp12 += z1 - MULTIPLY(z3, FIX(1.192193623));        /* c3+c5-c7-c9 */\n    z1    = MULTIPLY(z2 + z4, - FIX(1.798248910));       /* -(c1+c9) */\n    tmp11 += z1;\n    tmp13 += z1 + MULTIPLY(z4, FIX(2.102458632));        /* c1+c5+c9-c7 */\n    tmp14 += MULTIPLY(z2, - FIX(1.467221301)) +          /* -(c5+c9) */\n             MULTIPLY(z3, FIX(1.001388905)) -            /* c1-c9 */\n             MULTIPLY(z4, FIX(1.684843907));             /* c3+c9 */\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 11 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 11; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp10 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp10 = LEFT_SHIFT(tmp10, CONST_BITS);\n\n    z1 = (JLONG) wsptr[2];\n    z2 = (JLONG) wsptr[4];\n    z3 = (JLONG) wsptr[6];\n\n    tmp20 = MULTIPLY(z2 - z3, FIX(2.546640132));     /* c2+c4 */\n    tmp23 = MULTIPLY(z2 - z1, FIX(0.430815045));     /* c2-c6 */\n    z4 = z1 + z3;\n    tmp24 = MULTIPLY(z4, - FIX(1.155664402));        /* -(c2-c10) */\n    z4 -= z2;\n    tmp25 = tmp10 + MULTIPLY(z4, FIX(1.356927976));  /* c2 */\n    tmp21 = tmp20 + tmp23 + tmp25 -\n            MULTIPLY(z2, FIX(1.821790775));          /* c2+c4+c10-c6 */\n    tmp20 += tmp25 + MULTIPLY(z3, FIX(2.115825087)); /* c4+c6 */\n    tmp23 += tmp25 - MULTIPLY(z1, FIX(1.513598477)); /* c6+c8 */\n    tmp24 += tmp25;\n    tmp22 = tmp24 - MULTIPLY(z3, FIX(0.788749120));  /* c8+c10 */\n    tmp24 += MULTIPLY(z2, FIX(1.944413522)) -        /* c2+c8 */\n             MULTIPLY(z1, FIX(1.390975730));         /* c4+c10 */\n    tmp25 = tmp10 - MULTIPLY(z4, FIX(1.414213562));  /* c0 */\n\n    /* Odd part */\n\n    z1 = (JLONG) wsptr[1];\n    z2 = (JLONG) wsptr[3];\n    z3 = (JLONG) wsptr[5];\n    z4 = (JLONG) wsptr[7];\n\n    tmp11 = z1 + z2;\n    tmp14 = MULTIPLY(tmp11 + z3 + z4, FIX(0.398430003)); /* c9 */\n    tmp11 = MULTIPLY(tmp11, FIX(0.887983902));           /* c3-c9 */\n    tmp12 = MULTIPLY(z1 + z3, FIX(0.670361295));         /* c5-c9 */\n    tmp13 = tmp14 + MULTIPLY(z1 + z4, FIX(0.366151574)); /* c7-c9 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n            MULTIPLY(z1, FIX(0.923107866));              /* c7+c5+c3-c1-2*c9 */\n    z1    = tmp14 - MULTIPLY(z2 + z3, FIX(1.163011579)); /* c7+c9 */\n    tmp11 += z1 + MULTIPLY(z2, FIX(2.073276588));        /* c1+c7+3*c9-c3 */\n    tmp12 += z1 - MULTIPLY(z3, FIX(1.192193623));        /* c3+c5-c7-c9 */\n    z1    = MULTIPLY(z2 + z4, - FIX(1.798248910));       /* -(c1+c9) */\n    tmp11 += z1;\n    tmp13 += z1 + MULTIPLY(z4, FIX(2.102458632));        /* c1+c5+c9-c7 */\n    tmp14 += MULTIPLY(z2, - FIX(1.467221301)) +          /* -(c5+c9) */\n             MULTIPLY(z3, FIX(1.001388905)) -            /* c1-c9 */\n             MULTIPLY(z4, FIX(1.684843907));             /* c3+c9 */\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n\n    wsptr += 8;         /* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 12x12 output block.\n *\n * Optimized algorithm with 15 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/24).\n */\n\nGLOBAL(void)\njpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                 JCOEFPTR coef_block,\n                 JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;\n  JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;\n  JLONG z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*12];  /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z3 = LEFT_SHIFT(z3, CONST_BITS);\n    /* Add fudge factor here for final descale. */\n    z3 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */\n\n    tmp10 = z3 + z4;\n    tmp11 = z3 - z4;\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */\n    z1 = LEFT_SHIFT(z1, CONST_BITS);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n    z2 = LEFT_SHIFT(z2, CONST_BITS);\n\n    tmp12 = z1 - z2;\n\n    tmp21 = z3 + tmp12;\n    tmp24 = z3 - tmp12;\n\n    tmp12 = z4 + z2;\n\n    tmp20 = tmp10 + tmp12;\n    tmp25 = tmp10 - tmp12;\n\n    tmp12 = z4 - z1 - z2;\n\n    tmp22 = tmp11 + tmp12;\n    tmp23 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = MULTIPLY(z2, FIX(1.306562965));                  /* c3 */\n    tmp14 = MULTIPLY(z2, - FIX_0_541196100);                 /* -c9 */\n\n    tmp10 = z1 + z3;\n    tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669));          /* c7 */\n    tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384));       /* c5-c7 */\n    tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716));  /* c1-c5 */\n    tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580));           /* -(c7+c11) */\n    tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */\n    tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */\n    tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) -        /* c7-c11 */\n             MULTIPLY(z4, FIX(1.982889723));                 /* c5+c7 */\n\n    z1 -= z4;\n    z2 -= z3;\n    z3 = MULTIPLY(z1 + z2, FIX_0_541196100);                 /* c9 */\n    tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865);              /* c3-c9 */\n    tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065);              /* c3+c9 */\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 12 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 12; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z3 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z3 = LEFT_SHIFT(z3, CONST_BITS);\n\n    z4 = (JLONG) wsptr[4];\n    z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */\n\n    tmp10 = z3 + z4;\n    tmp11 = z3 - z4;\n\n    z1 = (JLONG) wsptr[2];\n    z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */\n    z1 = LEFT_SHIFT(z1, CONST_BITS);\n    z2 = (JLONG) wsptr[6];\n    z2 = LEFT_SHIFT(z2, CONST_BITS);\n\n    tmp12 = z1 - z2;\n\n    tmp21 = z3 + tmp12;\n    tmp24 = z3 - tmp12;\n\n    tmp12 = z4 + z2;\n\n    tmp20 = tmp10 + tmp12;\n    tmp25 = tmp10 - tmp12;\n\n    tmp12 = z4 - z1 - z2;\n\n    tmp22 = tmp11 + tmp12;\n    tmp23 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    z1 = (JLONG) wsptr[1];\n    z2 = (JLONG) wsptr[3];\n    z3 = (JLONG) wsptr[5];\n    z4 = (JLONG) wsptr[7];\n\n    tmp11 = MULTIPLY(z2, FIX(1.306562965));                  /* c3 */\n    tmp14 = MULTIPLY(z2, - FIX_0_541196100);                 /* -c9 */\n\n    tmp10 = z1 + z3;\n    tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669));          /* c7 */\n    tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384));       /* c5-c7 */\n    tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716));  /* c1-c5 */\n    tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580));           /* -(c7+c11) */\n    tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */\n    tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */\n    tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) -        /* c7-c11 */\n             MULTIPLY(z4, FIX(1.982889723));                 /* c5+c7 */\n\n    z1 -= z4;\n    z2 -= z3;\n    z3 = MULTIPLY(z1 + z2, FIX_0_541196100);                 /* c9 */\n    tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865);              /* c3-c9 */\n    tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065);              /* c3+c9 */\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n\n    wsptr += 8;         /* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 13x13 output block.\n *\n * Optimized algorithm with 29 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/26).\n */\n\nGLOBAL(void)\njpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                 JCOEFPTR coef_block,\n                 JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;\n  JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;\n  JLONG z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*13];  /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z1 = LEFT_SHIFT(z1, CONST_BITS);\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp10 = z3 + z4;\n    tmp11 = z3 - z4;\n\n    tmp12 = MULTIPLY(tmp10, FIX(1.155388986));                /* (c4+c6)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.096834934)) + z1;           /* (c4-c6)/2 */\n\n    tmp20 = MULTIPLY(z2, FIX(1.373119086)) + tmp12 + tmp13;   /* c2 */\n    tmp22 = MULTIPLY(z2, FIX(0.501487041)) - tmp12 + tmp13;   /* c10 */\n\n    tmp12 = MULTIPLY(tmp10, FIX(0.316450131));                /* (c8-c12)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.486914739)) + z1;           /* (c8+c12)/2 */\n\n    tmp21 = MULTIPLY(z2, FIX(1.058554052)) - tmp12 + tmp13;   /* c6 */\n    tmp25 = MULTIPLY(z2, - FIX(1.252223920)) + tmp12 + tmp13; /* c4 */\n\n    tmp12 = MULTIPLY(tmp10, FIX(0.435816023));                /* (c2-c10)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.937303064)) - z1;           /* (c2+c10)/2 */\n\n    tmp23 = MULTIPLY(z2, - FIX(0.170464608)) - tmp12 - tmp13; /* c12 */\n    tmp24 = MULTIPLY(z2, - FIX(0.803364869)) + tmp12 - tmp13; /* c8 */\n\n    tmp26 = MULTIPLY(tmp11 - z2, FIX(1.414213562)) + z1;      /* c0 */\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = MULTIPLY(z1 + z2, FIX(1.322312651));     /* c3 */\n    tmp12 = MULTIPLY(z1 + z3, FIX(1.163874945));     /* c5 */\n    tmp15 = z1 + z4;\n    tmp13 = MULTIPLY(tmp15, FIX(0.937797057));       /* c7 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n            MULTIPLY(z1, FIX(2.020082300));          /* c7+c5+c3-c1 */\n    tmp14 = MULTIPLY(z2 + z3, - FIX(0.338443458));   /* -c11 */\n    tmp11 += tmp14 + MULTIPLY(z2, FIX(0.837223564)); /* c5+c9+c11-c3 */\n    tmp12 += tmp14 - MULTIPLY(z3, FIX(1.572116027)); /* c1+c5-c9-c11 */\n    tmp14 = MULTIPLY(z2 + z4, - FIX(1.163874945));   /* -c5 */\n    tmp11 += tmp14;\n    tmp13 += tmp14 + MULTIPLY(z4, FIX(2.205608352)); /* c3+c5+c9-c7 */\n    tmp14 = MULTIPLY(z3 + z4, - FIX(0.657217813));   /* -c9 */\n    tmp12 += tmp14;\n    tmp13 += tmp14;\n    tmp15 = MULTIPLY(tmp15, FIX(0.338443458));       /* c11 */\n    tmp14 = tmp15 + MULTIPLY(z1, FIX(0.318774355)) - /* c9-c11 */\n            MULTIPLY(z2, FIX(0.466105296));          /* c1-c7 */\n    z1    = MULTIPLY(z3 - z2, FIX(0.937797057));     /* c7 */\n    tmp14 += z1;\n    tmp15 += z1 + MULTIPLY(z3, FIX(0.384515595)) -   /* c3-c7 */\n             MULTIPLY(z4, FIX(1.742345811));         /* c1+c11 */\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*12] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp26, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 13 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 13; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z1 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z1 = LEFT_SHIFT(z1, CONST_BITS);\n\n    z2 = (JLONG) wsptr[2];\n    z3 = (JLONG) wsptr[4];\n    z4 = (JLONG) wsptr[6];\n\n    tmp10 = z3 + z4;\n    tmp11 = z3 - z4;\n\n    tmp12 = MULTIPLY(tmp10, FIX(1.155388986));                /* (c4+c6)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.096834934)) + z1;           /* (c4-c6)/2 */\n\n    tmp20 = MULTIPLY(z2, FIX(1.373119086)) + tmp12 + tmp13;   /* c2 */\n    tmp22 = MULTIPLY(z2, FIX(0.501487041)) - tmp12 + tmp13;   /* c10 */\n\n    tmp12 = MULTIPLY(tmp10, FIX(0.316450131));                /* (c8-c12)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.486914739)) + z1;           /* (c8+c12)/2 */\n\n    tmp21 = MULTIPLY(z2, FIX(1.058554052)) - tmp12 + tmp13;   /* c6 */\n    tmp25 = MULTIPLY(z2, - FIX(1.252223920)) + tmp12 + tmp13; /* c4 */\n\n    tmp12 = MULTIPLY(tmp10, FIX(0.435816023));                /* (c2-c10)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.937303064)) - z1;           /* (c2+c10)/2 */\n\n    tmp23 = MULTIPLY(z2, - FIX(0.170464608)) - tmp12 - tmp13; /* c12 */\n    tmp24 = MULTIPLY(z2, - FIX(0.803364869)) + tmp12 - tmp13; /* c8 */\n\n    tmp26 = MULTIPLY(tmp11 - z2, FIX(1.414213562)) + z1;      /* c0 */\n\n    /* Odd part */\n\n    z1 = (JLONG) wsptr[1];\n    z2 = (JLONG) wsptr[3];\n    z3 = (JLONG) wsptr[5];\n    z4 = (JLONG) wsptr[7];\n\n    tmp11 = MULTIPLY(z1 + z2, FIX(1.322312651));     /* c3 */\n    tmp12 = MULTIPLY(z1 + z3, FIX(1.163874945));     /* c5 */\n    tmp15 = z1 + z4;\n    tmp13 = MULTIPLY(tmp15, FIX(0.937797057));       /* c7 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n            MULTIPLY(z1, FIX(2.020082300));          /* c7+c5+c3-c1 */\n    tmp14 = MULTIPLY(z2 + z3, - FIX(0.338443458));   /* -c11 */\n    tmp11 += tmp14 + MULTIPLY(z2, FIX(0.837223564)); /* c5+c9+c11-c3 */\n    tmp12 += tmp14 - MULTIPLY(z3, FIX(1.572116027)); /* c1+c5-c9-c11 */\n    tmp14 = MULTIPLY(z2 + z4, - FIX(1.163874945));   /* -c5 */\n    tmp11 += tmp14;\n    tmp13 += tmp14 + MULTIPLY(z4, FIX(2.205608352)); /* c3+c5+c9-c7 */\n    tmp14 = MULTIPLY(z3 + z4, - FIX(0.657217813));   /* -c9 */\n    tmp12 += tmp14;\n    tmp13 += tmp14;\n    tmp15 = MULTIPLY(tmp15, FIX(0.338443458));       /* c11 */\n    tmp14 = tmp15 + MULTIPLY(z1, FIX(0.318774355)) - /* c9-c11 */\n            MULTIPLY(z2, FIX(0.466105296));          /* c1-c7 */\n    z1    = MULTIPLY(z3 - z2, FIX(0.937797057));     /* c7 */\n    tmp14 += z1;\n    tmp15 += z1 + MULTIPLY(z3, FIX(0.384515595)) -   /* c3-c7 */\n             MULTIPLY(z4, FIX(1.742345811));         /* c1+c11 */\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp26,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n\n    wsptr += 8;         /* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 14x14 output block.\n *\n * Optimized algorithm with 20 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/28).\n */\n\nGLOBAL(void)\njpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                 JCOEFPTR coef_block,\n                 JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;\n  JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;\n  JLONG z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*14];  /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z1 = LEFT_SHIFT(z1, CONST_BITS);\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-1);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z2 = MULTIPLY(z4, FIX(1.274162392));         /* c4 */\n    z3 = MULTIPLY(z4, FIX(0.314692123));         /* c12 */\n    z4 = MULTIPLY(z4, FIX(0.881747734));         /* c8 */\n\n    tmp10 = z1 + z2;\n    tmp11 = z1 + z3;\n    tmp12 = z1 - z4;\n\n    tmp23 = RIGHT_SHIFT(z1 - LEFT_SHIFT(z2 + z3 - z4, 1),\n                        CONST_BITS-PASS1_BITS);  /* c0 = (c4+c12-c8)*2 */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    z3 = MULTIPLY(z1 + z2, FIX(1.105676686));    /* c6 */\n\n    tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */\n    tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */\n    tmp15 = MULTIPLY(z1, FIX(0.613604268)) -     /* c10 */\n            MULTIPLY(z2, FIX(1.378756276));      /* c2 */\n\n    tmp20 = tmp10 + tmp13;\n    tmp26 = tmp10 - tmp13;\n    tmp21 = tmp11 + tmp14;\n    tmp25 = tmp11 - tmp14;\n    tmp22 = tmp12 + tmp15;\n    tmp24 = tmp12 - tmp15;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n    tmp13 = LEFT_SHIFT(z4, CONST_BITS);\n\n    tmp14 = z1 + z3;\n    tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607));           /* c3 */\n    tmp12 = MULTIPLY(tmp14, FIX(1.197448846));             /* c5 */\n    tmp10 = tmp11 + tmp12 + tmp13 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */\n    tmp14 = MULTIPLY(tmp14, FIX(0.752406978));             /* c9 */\n    tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426));        /* c9+c11-c13 */\n    z1    -= z2;\n    tmp15 = MULTIPLY(z1, FIX(0.467085129)) - tmp13;        /* c11 */\n    tmp16 += tmp15;\n    z1    += z4;\n    z4    = MULTIPLY(z2 + z3, - FIX(0.158341681)) - tmp13; /* -c13 */\n    tmp11 += z4 - MULTIPLY(z2, FIX(0.424103948));          /* c3-c9-c13 */\n    tmp12 += z4 - MULTIPLY(z3, FIX(2.373959773));          /* c3+c5-c13 */\n    z4    = MULTIPLY(z3 - z2, FIX(1.405321284));           /* c1 */\n    tmp14 += z4 + tmp13 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */\n    tmp15 += z4 + MULTIPLY(z2, FIX(0.674957567));          /* c1+c11-c5 */\n\n    tmp13 = LEFT_SHIFT(z1 - z3, PASS1_BITS);\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*13] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*12] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) (tmp23 + tmp13);\n    wsptr[8*10] = (int) (tmp23 - tmp13);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 14 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 14; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z1 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z1 = LEFT_SHIFT(z1, CONST_BITS);\n    z4 = (JLONG) wsptr[4];\n    z2 = MULTIPLY(z4, FIX(1.274162392));         /* c4 */\n    z3 = MULTIPLY(z4, FIX(0.314692123));         /* c12 */\n    z4 = MULTIPLY(z4, FIX(0.881747734));         /* c8 */\n\n    tmp10 = z1 + z2;\n    tmp11 = z1 + z3;\n    tmp12 = z1 - z4;\n\n    tmp23 = z1 - LEFT_SHIFT(z2 + z3 - z4, 1);    /* c0 = (c4+c12-c8)*2 */\n\n    z1 = (JLONG) wsptr[2];\n    z2 = (JLONG) wsptr[6];\n\n    z3 = MULTIPLY(z1 + z2, FIX(1.105676686));    /* c6 */\n\n    tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */\n    tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */\n    tmp15 = MULTIPLY(z1, FIX(0.613604268)) -     /* c10 */\n            MULTIPLY(z2, FIX(1.378756276));      /* c2 */\n\n    tmp20 = tmp10 + tmp13;\n    tmp26 = tmp10 - tmp13;\n    tmp21 = tmp11 + tmp14;\n    tmp25 = tmp11 - tmp14;\n    tmp22 = tmp12 + tmp15;\n    tmp24 = tmp12 - tmp15;\n\n    /* Odd part */\n\n    z1 = (JLONG) wsptr[1];\n    z2 = (JLONG) wsptr[3];\n    z3 = (JLONG) wsptr[5];\n    z4 = (JLONG) wsptr[7];\n    z4 = LEFT_SHIFT(z4, CONST_BITS);\n\n    tmp14 = z1 + z3;\n    tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607));           /* c3 */\n    tmp12 = MULTIPLY(tmp14, FIX(1.197448846));             /* c5 */\n    tmp10 = tmp11 + tmp12 + z4 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */\n    tmp14 = MULTIPLY(tmp14, FIX(0.752406978));             /* c9 */\n    tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426));        /* c9+c11-c13 */\n    z1    -= z2;\n    tmp15 = MULTIPLY(z1, FIX(0.467085129)) - z4;           /* c11 */\n    tmp16 += tmp15;\n    tmp13 = MULTIPLY(z2 + z3, - FIX(0.158341681)) - z4;    /* -c13 */\n    tmp11 += tmp13 - MULTIPLY(z2, FIX(0.424103948));       /* c3-c9-c13 */\n    tmp12 += tmp13 - MULTIPLY(z3, FIX(2.373959773));       /* c3+c5-c13 */\n    tmp13 = MULTIPLY(z3 - z2, FIX(1.405321284));           /* c1 */\n    tmp14 += tmp13 + z4 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */\n    tmp15 += tmp13 + MULTIPLY(z2, FIX(0.674957567));       /* c1+c11-c5 */\n\n    tmp13 = LEFT_SHIFT(z1 - z3, CONST_BITS) + z4;\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp16,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp16,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n\n    wsptr += 8;         /* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 15x15 output block.\n *\n * Optimized algorithm with 22 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/30).\n */\n\nGLOBAL(void)\njpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                 JCOEFPTR coef_block,\n                 JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  JLONG tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;\n  JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;\n  JLONG z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*15];  /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z1 = LEFT_SHIFT(z1, CONST_BITS);\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp10 = MULTIPLY(z4, FIX(0.437016024)); /* c12 */\n    tmp11 = MULTIPLY(z4, FIX(1.144122806)); /* c6 */\n\n    tmp12 = z1 - tmp10;\n    tmp13 = z1 + tmp11;\n    z1 -= LEFT_SHIFT(tmp11 - tmp10, 1);     /* c0 = (c6-c12)*2 */\n\n    z4 = z2 - z3;\n    z3 += z2;\n    tmp10 = MULTIPLY(z3, FIX(1.337628990)); /* (c2+c4)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.045680613)); /* (c2-c4)/2 */\n    z2 = MULTIPLY(z2, FIX(1.439773946));    /* c4+c14 */\n\n    tmp20 = tmp13 + tmp10 + tmp11;\n    tmp23 = tmp12 - tmp10 + tmp11 + z2;\n\n    tmp10 = MULTIPLY(z3, FIX(0.547059574)); /* (c8+c14)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.399234004)); /* (c8-c14)/2 */\n\n    tmp25 = tmp13 - tmp10 - tmp11;\n    tmp26 = tmp12 + tmp10 - tmp11 - z2;\n\n    tmp10 = MULTIPLY(z3, FIX(0.790569415)); /* (c6+c12)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.353553391)); /* (c6-c12)/2 */\n\n    tmp21 = tmp12 + tmp10 + tmp11;\n    tmp24 = tmp13 - tmp10 + tmp11;\n    tmp11 += tmp11;\n    tmp22 = z1 + tmp11;                     /* c10 = c6-c12 */\n    tmp27 = z1 - tmp11 - tmp11;             /* c0 = (c6-c12)*2 */\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z3 = MULTIPLY(z4, FIX(1.224744871));                    /* c5 */\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp13 = z2 - z4;\n    tmp15 = MULTIPLY(z1 + tmp13, FIX(0.831253876));         /* c9 */\n    tmp11 = tmp15 + MULTIPLY(z1, FIX(0.513743148));         /* c3-c9 */\n    tmp14 = tmp15 - MULTIPLY(tmp13, FIX(2.176250899));      /* c3+c9 */\n\n    tmp13 = MULTIPLY(z2, - FIX(0.831253876));               /* -c9 */\n    tmp15 = MULTIPLY(z2, - FIX(1.344997024));               /* -c3 */\n    z2 = z1 - z4;\n    tmp12 = z3 + MULTIPLY(z2, FIX(1.406466353));            /* c1 */\n\n    tmp10 = tmp12 + MULTIPLY(z4, FIX(2.457431844)) - tmp15; /* c1+c7 */\n    tmp16 = tmp12 - MULTIPLY(z1, FIX(1.112434820)) + tmp13; /* c1-c13 */\n    tmp12 = MULTIPLY(z2, FIX(1.224744871)) - z3;            /* c5 */\n    z2 = MULTIPLY(z1 + z4, FIX(0.575212477));               /* c11 */\n    tmp13 += z2 + MULTIPLY(z1, FIX(0.475753014)) - z3;      /* c7-c11 */\n    tmp15 += z2 - MULTIPLY(z4, FIX(0.869244010)) + z3;      /* c11+c13 */\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*14] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*13] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*12] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp27, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 15 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 15; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z1 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z1 = LEFT_SHIFT(z1, CONST_BITS);\n\n    z2 = (JLONG) wsptr[2];\n    z3 = (JLONG) wsptr[4];\n    z4 = (JLONG) wsptr[6];\n\n    tmp10 = MULTIPLY(z4, FIX(0.437016024)); /* c12 */\n    tmp11 = MULTIPLY(z4, FIX(1.144122806)); /* c6 */\n\n    tmp12 = z1 - tmp10;\n    tmp13 = z1 + tmp11;\n    z1 -= LEFT_SHIFT(tmp11 - tmp10, 1);     /* c0 = (c6-c12)*2 */\n\n    z4 = z2 - z3;\n    z3 += z2;\n    tmp10 = MULTIPLY(z3, FIX(1.337628990)); /* (c2+c4)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.045680613)); /* (c2-c4)/2 */\n    z2 = MULTIPLY(z2, FIX(1.439773946));    /* c4+c14 */\n\n    tmp20 = tmp13 + tmp10 + tmp11;\n    tmp23 = tmp12 - tmp10 + tmp11 + z2;\n\n    tmp10 = MULTIPLY(z3, FIX(0.547059574)); /* (c8+c14)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.399234004)); /* (c8-c14)/2 */\n\n    tmp25 = tmp13 - tmp10 - tmp11;\n    tmp26 = tmp12 + tmp10 - tmp11 - z2;\n\n    tmp10 = MULTIPLY(z3, FIX(0.790569415)); /* (c6+c12)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.353553391)); /* (c6-c12)/2 */\n\n    tmp21 = tmp12 + tmp10 + tmp11;\n    tmp24 = tmp13 - tmp10 + tmp11;\n    tmp11 += tmp11;\n    tmp22 = z1 + tmp11;                     /* c10 = c6-c12 */\n    tmp27 = z1 - tmp11 - tmp11;             /* c0 = (c6-c12)*2 */\n\n    /* Odd part */\n\n    z1 = (JLONG) wsptr[1];\n    z2 = (JLONG) wsptr[3];\n    z4 = (JLONG) wsptr[5];\n    z3 = MULTIPLY(z4, FIX(1.224744871));                    /* c5 */\n    z4 = (JLONG) wsptr[7];\n\n    tmp13 = z2 - z4;\n    tmp15 = MULTIPLY(z1 + tmp13, FIX(0.831253876));         /* c9 */\n    tmp11 = tmp15 + MULTIPLY(z1, FIX(0.513743148));         /* c3-c9 */\n    tmp14 = tmp15 - MULTIPLY(tmp13, FIX(2.176250899));      /* c3+c9 */\n\n    tmp13 = MULTIPLY(z2, - FIX(0.831253876));               /* -c9 */\n    tmp15 = MULTIPLY(z2, - FIX(1.344997024));               /* -c3 */\n    z2 = z1 - z4;\n    tmp12 = z3 + MULTIPLY(z2, FIX(1.406466353));            /* c1 */\n\n    tmp10 = tmp12 + MULTIPLY(z4, FIX(2.457431844)) - tmp15; /* c1+c7 */\n    tmp16 = tmp12 - MULTIPLY(z1, FIX(1.112434820)) + tmp13; /* c1-c13 */\n    tmp12 = MULTIPLY(z2, FIX(1.224744871)) - z3;            /* c5 */\n    z2 = MULTIPLY(z1 + z4, FIX(0.575212477));               /* c11 */\n    tmp13 += z2 + MULTIPLY(z1, FIX(0.475753014)) - z3;      /* c7-c11 */\n    tmp15 += z2 - MULTIPLY(z4, FIX(0.869244010)) + z3;      /* c11+c13 */\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[14] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp16,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp16,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp27,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n\n    wsptr += 8;         /* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 16x16 output block.\n *\n * Optimized algorithm with 28 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/32).\n */\n\nGLOBAL(void)\njpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                 JCOEFPTR coef_block,\n                 JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  JLONG tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;\n  JLONG tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;\n  JLONG z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*16];  /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);\n    /* Add fudge factor here for final descale. */\n    tmp0 += 1 << (CONST_BITS-PASS1_BITS-1);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    tmp1 = MULTIPLY(z1, FIX(1.306562965));      /* c4[16] = c2[8] */\n    tmp2 = MULTIPLY(z1, FIX_0_541196100);       /* c12[16] = c6[8] */\n\n    tmp10 = tmp0 + tmp1;\n    tmp11 = tmp0 - tmp1;\n    tmp12 = tmp0 + tmp2;\n    tmp13 = tmp0 - tmp2;\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n    z3 = z1 - z2;\n    z4 = MULTIPLY(z3, FIX(0.275899379));        /* c14[16] = c7[8] */\n    z3 = MULTIPLY(z3, FIX(1.387039845));        /* c2[16] = c1[8] */\n\n    tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447);  /* (c6+c2)[16] = (c3+c1)[8] */\n    tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223);  /* (c6-c14)[16] = (c3-c7)[8] */\n    tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */\n    tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */\n\n    tmp20 = tmp10 + tmp0;\n    tmp27 = tmp10 - tmp0;\n    tmp21 = tmp12 + tmp1;\n    tmp26 = tmp12 - tmp1;\n    tmp22 = tmp13 + tmp2;\n    tmp25 = tmp13 - tmp2;\n    tmp23 = tmp11 + tmp3;\n    tmp24 = tmp11 - tmp3;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = z1 + z3;\n\n    tmp1  = MULTIPLY(z1 + z2, FIX(1.353318001));   /* c3 */\n    tmp2  = MULTIPLY(tmp11,   FIX(1.247225013));   /* c5 */\n    tmp3  = MULTIPLY(z1 + z4, FIX(1.093201867));   /* c7 */\n    tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586));   /* c9 */\n    tmp11 = MULTIPLY(tmp11,   FIX(0.666655658));   /* c11 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528));   /* c13 */\n    tmp0  = tmp1 + tmp2 + tmp3 -\n            MULTIPLY(z1, FIX(2.286341144));        /* c7+c5+c3-c1 */\n    tmp13 = tmp10 + tmp11 + tmp12 -\n            MULTIPLY(z1, FIX(1.835730603));        /* c9+c11+c13-c15 */\n    z1    = MULTIPLY(z2 + z3, FIX(0.138617169));   /* c15 */\n    tmp1  += z1 + MULTIPLY(z2, FIX(0.071888074));  /* c9+c11-c3-c15 */\n    tmp2  += z1 - MULTIPLY(z3, FIX(1.125726048));  /* c5+c7+c15-c3 */\n    z1    = MULTIPLY(z3 - z2, FIX(1.407403738));   /* c1 */\n    tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282));  /* c1+c11-c9-c13 */\n    tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411));  /* c1+c5+c13-c7 */\n    z2    += z4;\n    z1    = MULTIPLY(z2, - FIX(0.666655658));      /* -c11 */\n    tmp1  += z1;\n    tmp3  += z1 + MULTIPLY(z4, FIX(1.065388962));  /* c3+c11+c15-c7 */\n    z2    = MULTIPLY(z2, - FIX(1.247225013));      /* -c5 */\n    tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809));  /* c1+c5+c9-c13 */\n    tmp12 += z2;\n    z2    = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */\n    tmp2  += z2;\n    tmp3  += z2;\n    z2    = MULTIPLY(z4 - z3, FIX(0.410524528));   /* c13 */\n    tmp10 += z2;\n    tmp11 += z2;\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp0,  CONST_BITS-PASS1_BITS);\n    wsptr[8*15] = (int) RIGHT_SHIFT(tmp20 - tmp0,  CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp1,  CONST_BITS-PASS1_BITS);\n    wsptr[8*14] = (int) RIGHT_SHIFT(tmp21 - tmp1,  CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp2,  CONST_BITS-PASS1_BITS);\n    wsptr[8*13] = (int) RIGHT_SHIFT(tmp22 - tmp2,  CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp3,  CONST_BITS-PASS1_BITS);\n    wsptr[8*12] = (int) RIGHT_SHIFT(tmp23 - tmp3,  CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp24 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp25 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp26 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp26 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp27 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp27 - tmp13, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 16 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 16; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (JLONG) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS);\n\n    z1 = (JLONG) wsptr[4];\n    tmp1 = MULTIPLY(z1, FIX(1.306562965));      /* c4[16] = c2[8] */\n    tmp2 = MULTIPLY(z1, FIX_0_541196100);       /* c12[16] = c6[8] */\n\n    tmp10 = tmp0 + tmp1;\n    tmp11 = tmp0 - tmp1;\n    tmp12 = tmp0 + tmp2;\n    tmp13 = tmp0 - tmp2;\n\n    z1 = (JLONG) wsptr[2];\n    z2 = (JLONG) wsptr[6];\n    z3 = z1 - z2;\n    z4 = MULTIPLY(z3, FIX(0.275899379));        /* c14[16] = c7[8] */\n    z3 = MULTIPLY(z3, FIX(1.387039845));        /* c2[16] = c1[8] */\n\n    tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447);  /* (c6+c2)[16] = (c3+c1)[8] */\n    tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223);  /* (c6-c14)[16] = (c3-c7)[8] */\n    tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */\n    tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */\n\n    tmp20 = tmp10 + tmp0;\n    tmp27 = tmp10 - tmp0;\n    tmp21 = tmp12 + tmp1;\n    tmp26 = tmp12 - tmp1;\n    tmp22 = tmp13 + tmp2;\n    tmp25 = tmp13 - tmp2;\n    tmp23 = tmp11 + tmp3;\n    tmp24 = tmp11 - tmp3;\n\n    /* Odd part */\n\n    z1 = (JLONG) wsptr[1];\n    z2 = (JLONG) wsptr[3];\n    z3 = (JLONG) wsptr[5];\n    z4 = (JLONG) wsptr[7];\n\n    tmp11 = z1 + z3;\n\n    tmp1  = MULTIPLY(z1 + z2, FIX(1.353318001));   /* c3 */\n    tmp2  = MULTIPLY(tmp11,   FIX(1.247225013));   /* c5 */\n    tmp3  = MULTIPLY(z1 + z4, FIX(1.093201867));   /* c7 */\n    tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586));   /* c9 */\n    tmp11 = MULTIPLY(tmp11,   FIX(0.666655658));   /* c11 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528));   /* c13 */\n    tmp0  = tmp1 + tmp2 + tmp3 -\n            MULTIPLY(z1, FIX(2.286341144));        /* c7+c5+c3-c1 */\n    tmp13 = tmp10 + tmp11 + tmp12 -\n            MULTIPLY(z1, FIX(1.835730603));        /* c9+c11+c13-c15 */\n    z1    = MULTIPLY(z2 + z3, FIX(0.138617169));   /* c15 */\n    tmp1  += z1 + MULTIPLY(z2, FIX(0.071888074));  /* c9+c11-c3-c15 */\n    tmp2  += z1 - MULTIPLY(z3, FIX(1.125726048));  /* c5+c7+c15-c3 */\n    z1    = MULTIPLY(z3 - z2, FIX(1.407403738));   /* c1 */\n    tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282));  /* c1+c11-c9-c13 */\n    tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411));  /* c1+c5+c13-c7 */\n    z2    += z4;\n    z1    = MULTIPLY(z2, - FIX(0.666655658));      /* -c11 */\n    tmp1  += z1;\n    tmp3  += z1 + MULTIPLY(z4, FIX(1.065388962));  /* c3+c11+c15-c7 */\n    z2    = MULTIPLY(z2, - FIX(1.247225013));      /* -c5 */\n    tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809));  /* c1+c5+c9-c13 */\n    tmp12 += z2;\n    z2    = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */\n    tmp2  += z2;\n    tmp3  += z2;\n    z2    = MULTIPLY(z4 - z3, FIX(0.410524528));   /* c13 */\n    tmp10 += z2;\n    tmp11 += z2;\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp0,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[15] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp0,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp1,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[14] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp1,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp2,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp2,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp3,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp3,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp10,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp10,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp11,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp11,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp12,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp12,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp27 + tmp13,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp27 - tmp13,\n                                               CONST_BITS+PASS1_BITS+3)\n                             & RANGE_MASK];\n\n    wsptr += 8;         /* advance pointer to next row */\n  }\n}\n\n#endif /* IDCT_SCALING_SUPPORTED */\n#endif /* DCT_ISLOW_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jidctred.c",
    "content": "/*\n * jidctred.c\n *\n * This file was part of the Independent JPEG Group's software.\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains inverse-DCT routines that produce reduced-size output:\n * either 4x4, 2x2, or 1x1 pixels from an 8x8 DCT block.\n *\n * The implementation is based on the Loeffler, Ligtenberg and Moschytz (LL&M)\n * algorithm used in jidctint.c.  We simply replace each 8-to-8 1-D IDCT step\n * with an 8-to-4 step that produces the four averages of two adjacent outputs\n * (or an 8-to-2 step producing two averages of four outputs, for 2x2 output).\n * These steps were derived by computing the corresponding values at the end\n * of the normal LL&M code, then simplifying as much as possible.\n *\n * 1x1 is trivial: just take the DC coefficient divided by 8.\n *\n * See jidctint.c for additional comments.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"               /* Private declarations for DCT subsystem */\n\n#ifdef IDCT_SCALING_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/* Scaling is the same as in jidctint.c. */\n\n#if BITS_IN_JSAMPLE == 8\n#define CONST_BITS  13\n#define PASS1_BITS  2\n#else\n#define CONST_BITS  13\n#define PASS1_BITS  1           /* lose a little precision to avoid overflow */\n#endif\n\n/* Some C compilers fail to reduce \"FIX(constant)\" at compile time, thus\n * causing a lot of useless floating-point operations at run time.\n * To get around this we use the following pre-calculated constants.\n * If you change CONST_BITS you may want to add appropriate values.\n * (With a reasonable C compiler, you can just rely on the FIX() macro...)\n */\n\n#if CONST_BITS == 13\n#define FIX_0_211164243  ((JLONG)  1730)        /* FIX(0.211164243) */\n#define FIX_0_509795579  ((JLONG)  4176)        /* FIX(0.509795579) */\n#define FIX_0_601344887  ((JLONG)  4926)        /* FIX(0.601344887) */\n#define FIX_0_720959822  ((JLONG)  5906)        /* FIX(0.720959822) */\n#define FIX_0_765366865  ((JLONG)  6270)        /* FIX(0.765366865) */\n#define FIX_0_850430095  ((JLONG)  6967)        /* FIX(0.850430095) */\n#define FIX_0_899976223  ((JLONG)  7373)        /* FIX(0.899976223) */\n#define FIX_1_061594337  ((JLONG)  8697)        /* FIX(1.061594337) */\n#define FIX_1_272758580  ((JLONG)  10426)       /* FIX(1.272758580) */\n#define FIX_1_451774981  ((JLONG)  11893)       /* FIX(1.451774981) */\n#define FIX_1_847759065  ((JLONG)  15137)       /* FIX(1.847759065) */\n#define FIX_2_172734803  ((JLONG)  17799)       /* FIX(2.172734803) */\n#define FIX_2_562915447  ((JLONG)  20995)       /* FIX(2.562915447) */\n#define FIX_3_624509785  ((JLONG)  29692)       /* FIX(3.624509785) */\n#else\n#define FIX_0_211164243  FIX(0.211164243)\n#define FIX_0_509795579  FIX(0.509795579)\n#define FIX_0_601344887  FIX(0.601344887)\n#define FIX_0_720959822  FIX(0.720959822)\n#define FIX_0_765366865  FIX(0.765366865)\n#define FIX_0_850430095  FIX(0.850430095)\n#define FIX_0_899976223  FIX(0.899976223)\n#define FIX_1_061594337  FIX(1.061594337)\n#define FIX_1_272758580  FIX(1.272758580)\n#define FIX_1_451774981  FIX(1.451774981)\n#define FIX_1_847759065  FIX(1.847759065)\n#define FIX_2_172734803  FIX(2.172734803)\n#define FIX_2_562915447  FIX(2.562915447)\n#define FIX_3_624509785  FIX(3.624509785)\n#endif\n\n\n/* Multiply a JLONG variable by a JLONG constant to yield a JLONG result.\n * For 8-bit samples with the recommended scaling, all the variable\n * and constant values involved are no more than 16 bits wide, so a\n * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.\n * For 12-bit samples, a full 32-bit multiplication will be needed.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define MULTIPLY(var,const)  MULTIPLY16C16(var,const)\n#else\n#define MULTIPLY(var,const)  ((var) * (const))\n#endif\n\n\n/* Dequantize a coefficient by multiplying it by the multiplier-table\n * entry; produce an int result.  In this module, both inputs and result\n * are 16 bits or less, so either int or short multiply will work.\n */\n\n#define DEQUANTIZE(coef,quantval)  (((ISLOW_MULT_TYPE) (coef)) * (quantval))\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 4x4 output block.\n */\n\nGLOBAL(void)\njpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n               JCOEFPTR coef_block,\n               JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  JLONG tmp0, tmp2, tmp10, tmp12;\n  JLONG z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[DCTSIZE*4];     /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) {\n    /* Don't bother to process column 4, because second pass won't use it */\n    if (ctr == DCTSIZE-4)\n      continue;\n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&\n        inptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*5] == 0 &&\n        inptr[DCTSIZE*6] == 0 && inptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero; we need not examine term 4 for 4x4 output */\n      int dcval = LEFT_SHIFT(DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]),\n                             PASS1_BITS);\n\n      wsptr[DCTSIZE*0] = dcval;\n      wsptr[DCTSIZE*1] = dcval;\n      wsptr[DCTSIZE*2] = dcval;\n      wsptr[DCTSIZE*3] = dcval;\n\n      continue;\n    }\n\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 = LEFT_SHIFT(tmp0, CONST_BITS+1);\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp2 = MULTIPLY(z2, FIX_1_847759065) + MULTIPLY(z3, - FIX_0_765366865);\n\n    tmp10 = tmp0 + tmp2;\n    tmp12 = tmp0 - tmp2;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n\n    tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */\n         + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */\n         + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */\n         + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */\n\n    tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */\n         + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */\n         + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */\n         + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */\n\n    /* Final output stage */\n\n    wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp2, CONST_BITS-PASS1_BITS+1);\n    wsptr[DCTSIZE*3] = (int) DESCALE(tmp10 - tmp2, CONST_BITS-PASS1_BITS+1);\n    wsptr[DCTSIZE*1] = (int) DESCALE(tmp12 + tmp0, CONST_BITS-PASS1_BITS+1);\n    wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 - tmp0, CONST_BITS-PASS1_BITS+1);\n  }\n\n  /* Pass 2: process 4 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 4; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n    /* It's not clear whether a zero row test is worthwhile here ... */\n\n#ifndef NO_ZERO_ROW_TEST\n    if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 &&\n        wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {\n      /* AC terms all zero */\n      JSAMPLE dcval = range_limit[(int) DESCALE((JLONG) wsptr[0], PASS1_BITS+3)\n                                  & RANGE_MASK];\n\n      outptr[0] = dcval;\n      outptr[1] = dcval;\n      outptr[2] = dcval;\n      outptr[3] = dcval;\n\n      wsptr += DCTSIZE;         /* advance pointer to next row */\n      continue;\n    }\n#endif\n\n    /* Even part */\n\n    tmp0 = LEFT_SHIFT((JLONG) wsptr[0], CONST_BITS+1);\n\n    tmp2 = MULTIPLY((JLONG) wsptr[2], FIX_1_847759065)\n         + MULTIPLY((JLONG) wsptr[6], - FIX_0_765366865);\n\n    tmp10 = tmp0 + tmp2;\n    tmp12 = tmp0 - tmp2;\n\n    /* Odd part */\n\n    z1 = (JLONG) wsptr[7];\n    z2 = (JLONG) wsptr[5];\n    z3 = (JLONG) wsptr[3];\n    z4 = (JLONG) wsptr[1];\n\n    tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */\n         + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */\n         + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */\n         + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */\n\n    tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */\n         + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */\n         + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */\n         + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp2,\n                                          CONST_BITS+PASS1_BITS+3+1)\n                            & RANGE_MASK];\n    outptr[3] = range_limit[(int) DESCALE(tmp10 - tmp2,\n                                          CONST_BITS+PASS1_BITS+3+1)\n                            & RANGE_MASK];\n    outptr[1] = range_limit[(int) DESCALE(tmp12 + tmp0,\n                                          CONST_BITS+PASS1_BITS+3+1)\n                            & RANGE_MASK];\n    outptr[2] = range_limit[(int) DESCALE(tmp12 - tmp0,\n                                          CONST_BITS+PASS1_BITS+3+1)\n                            & RANGE_MASK];\n\n    wsptr += DCTSIZE;           /* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 2x2 output block.\n */\n\nGLOBAL(void)\njpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n               JCOEFPTR coef_block,\n               JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  JLONG tmp0, tmp10, z1;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE *quantptr;\n  int *wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[DCTSIZE*2];     /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) {\n    /* Don't bother to process columns 2,4,6 */\n    if (ctr == DCTSIZE-2 || ctr == DCTSIZE-4 || ctr == DCTSIZE-6)\n      continue;\n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*3] == 0 &&\n        inptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero; we need not examine terms 2,4,6 for 2x2 output */\n      int dcval = LEFT_SHIFT(DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]),\n                             PASS1_BITS);\n\n      wsptr[DCTSIZE*0] = dcval;\n      wsptr[DCTSIZE*1] = dcval;\n\n      continue;\n    }\n\n    /* Even part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp10 = LEFT_SHIFT(z1, CONST_BITS+2);\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n    tmp0 = MULTIPLY(z1, - FIX_0_720959822); /* sqrt(2) * (c7-c5+c3-c1) */\n    z1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp0 += MULTIPLY(z1, FIX_0_850430095); /* sqrt(2) * (-c1+c3+c5+c7) */\n    z1 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    tmp0 += MULTIPLY(z1, - FIX_1_272758580); /* sqrt(2) * (-c1+c3-c5-c7) */\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    tmp0 += MULTIPLY(z1, FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */\n\n    /* Final output stage */\n\n    wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp0, CONST_BITS-PASS1_BITS+2);\n    wsptr[DCTSIZE*1] = (int) DESCALE(tmp10 - tmp0, CONST_BITS-PASS1_BITS+2);\n  }\n\n  /* Pass 2: process 2 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 2; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n    /* It's not clear whether a zero row test is worthwhile here ... */\n\n#ifndef NO_ZERO_ROW_TEST\n    if (wsptr[1] == 0 && wsptr[3] == 0 && wsptr[5] == 0 && wsptr[7] == 0) {\n      /* AC terms all zero */\n      JSAMPLE dcval = range_limit[(int) DESCALE((JLONG) wsptr[0], PASS1_BITS+3)\n                                  & RANGE_MASK];\n\n      outptr[0] = dcval;\n      outptr[1] = dcval;\n\n      wsptr += DCTSIZE;         /* advance pointer to next row */\n      continue;\n    }\n#endif\n\n    /* Even part */\n\n    tmp10 = LEFT_SHIFT((JLONG) wsptr[0], CONST_BITS+2);\n\n    /* Odd part */\n\n    tmp0 = MULTIPLY((JLONG) wsptr[7], - FIX_0_720959822) /* sqrt(2) * (c7-c5+c3-c1) */\n         + MULTIPLY((JLONG) wsptr[5], FIX_0_850430095) /* sqrt(2) * (-c1+c3+c5+c7) */\n         + MULTIPLY((JLONG) wsptr[3], - FIX_1_272758580) /* sqrt(2) * (-c1+c3-c5-c7) */\n         + MULTIPLY((JLONG) wsptr[1], FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp0,\n                                          CONST_BITS+PASS1_BITS+3+2)\n                            & RANGE_MASK];\n    outptr[1] = range_limit[(int) DESCALE(tmp10 - tmp0,\n                                          CONST_BITS+PASS1_BITS+3+2)\n                            & RANGE_MASK];\n\n    wsptr += DCTSIZE;           /* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 1x1 output block.\n */\n\nGLOBAL(void)\njpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n               JCOEFPTR coef_block,\n               JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  int dcval;\n  ISLOW_MULT_TYPE *quantptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  SHIFT_TEMPS\n\n  /* We hardly need an inverse DCT routine for this: just take the\n   * average pixel value, which is one-eighth of the DC coefficient.\n   */\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  dcval = DEQUANTIZE(coef_block[0], quantptr[0]);\n  dcval = (int) DESCALE((JLONG) dcval, 3);\n\n  output_buf[0][output_col] = range_limit[dcval & RANGE_MASK];\n}\n\n#endif /* IDCT_SCALING_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jinclude.h",
    "content": "/*\n * jinclude.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1994, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file exists to provide a single place to fix any problems with\n * including the wrong system include files.  (Common problems are taken\n * care of by the standard jconfig symbols, but on really weird systems\n * you may have to edit this file.)\n *\n * NOTE: this file is NOT intended to be included by applications using the\n * JPEG library.  Most applications need only include jpeglib.h.\n */\n\n\n/* Include auto-config file to find out which system include files we need. */\n\n#include \"jconfig.h\"            /* auto configuration options */\n#define JCONFIG_INCLUDED        /* so that jpeglib.h doesn't do it again */\n\n/*\n * We need the NULL macro and size_t typedef.\n * On an ANSI-conforming system it is sufficient to include <stddef.h>.\n * Otherwise, we get them from <stdlib.h> or <stdio.h>; we may have to\n * pull in <sys/types.h> as well.\n * Note that the core JPEG library does not require <stdio.h>;\n * only the default error handler and data source/destination modules do.\n * But we must pull it in because of the references to FILE in jpeglib.h.\n * You can remove those references if you want to compile without <stdio.h>.\n */\n\n#ifdef HAVE_STDDEF_H\n#include <stddef.h>\n#endif\n\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n\n#ifdef NEED_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include <stdio.h>\n\n/*\n * We need memory copying and zeroing functions, plus strncpy().\n * ANSI and System V implementations declare these in <string.h>.\n * BSD doesn't have the mem() functions, but it does have bcopy()/bzero().\n * Some systems may declare memset and memcpy in <memory.h>.\n *\n * NOTE: we assume the size parameters to these functions are of type size_t.\n * Change the casts in these macros if not!\n */\n\n#ifdef NEED_BSD_STRINGS\n\n#include <strings.h>\n#define MEMZERO(target,size)    bzero((void *)(target), (size_t)(size))\n#define MEMCOPY(dest,src,size)  bcopy((const void *)(src), (void *)(dest), (size_t)(size))\n\n#else /* not BSD, assume ANSI/SysV string lib */\n\n#include <string.h>\n#define MEMZERO(target,size)    memset((void *)(target), 0, (size_t)(size))\n#define MEMCOPY(dest,src,size)  memcpy((void *)(dest), (const void *)(src), (size_t)(size))\n\n#endif\n\n/*\n * The modules that use fread() and fwrite() always invoke them through\n * these macros.  On some systems you may need to twiddle the argument casts.\n * CAUTION: argument order is different from underlying functions!\n */\n\n#define JFREAD(file,buf,sizeofbuf)  \\\n  ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))\n#define JFWRITE(file,buf,sizeofbuf)  \\\n  ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jmemmgr.c",
    "content": "/*\n * jmemmgr.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2016, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains the JPEG system-independent memory management\n * routines.  This code is usable across a wide variety of machines; most\n * of the system dependencies have been isolated in a separate file.\n * The major functions provided here are:\n *   * pool-based allocation and freeing of memory;\n *   * policy decisions about how to divide available memory among the\n *     virtual arrays;\n *   * control logic for swapping virtual arrays between main memory and\n *     backing storage.\n * The separate system-dependent file provides the actual backing-storage\n * access code, and it contains the policy decision about how much total\n * main memory to use.\n * This file is system-dependent in the sense that some of its functions\n * are unnecessary in some systems.  For example, if there is enough virtual\n * memory so that backing storage will never be used, much of the virtual\n * array control logic could be removed.  (Of course, if you have that much\n * memory then you shouldn't care about a little bit of unused code...)\n */\n\n#define JPEG_INTERNALS\n#define AM_MEMORY_MANAGER       /* we define jvirt_Xarray_control structs */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jmemsys.h\"            /* import the system-dependent declarations */\n\n#ifndef NO_GETENV\n#ifndef HAVE_STDLIB_H           /* <stdlib.h> should declare getenv() */\nextern char *getenv (const char *name);\n#endif\n#endif\n\n\nLOCAL(size_t)\nround_up_pow2 (size_t a, size_t b)\n/* a rounded up to the next multiple of b, i.e. ceil(a/b)*b */\n/* Assumes a >= 0, b > 0, and b is a power of 2 */\n{\n  return ((a + b - 1) & (~(b - 1)));\n}\n\n\n/*\n * Some important notes:\n *   The allocation routines provided here must never return NULL.\n *   They should exit to error_exit if unsuccessful.\n *\n *   It's not a good idea to try to merge the sarray and barray routines,\n *   even though they are textually almost the same, because samples are\n *   usually stored as bytes while coefficients are shorts or ints.  Thus,\n *   in machines where byte pointers have a different representation from\n *   word pointers, the resulting machine code could not be the same.\n */\n\n\n/*\n * Many machines require storage alignment: longs must start on 4-byte\n * boundaries, doubles on 8-byte boundaries, etc.  On such machines, malloc()\n * always returns pointers that are multiples of the worst-case alignment\n * requirement, and we had better do so too.\n * There isn't any really portable way to determine the worst-case alignment\n * requirement.  This module assumes that the alignment requirement is\n * multiples of ALIGN_SIZE.\n * By default, we define ALIGN_SIZE as sizeof(double).  This is necessary on\n * some workstations (where doubles really do need 8-byte alignment) and will\n * work fine on nearly everything.  If your machine has lesser alignment needs,\n * you can save a few bytes by making ALIGN_SIZE smaller.\n * The only place I know of where this will NOT work is certain Macintosh\n * 680x0 compilers that define double as a 10-byte IEEE extended float.\n * Doing 10-byte alignment is counterproductive because longwords won't be\n * aligned well.  Put \"#define ALIGN_SIZE 4\" in jconfig.h if you have\n * such a compiler.\n */\n\n#ifndef ALIGN_SIZE              /* so can override from jconfig.h */\n#ifndef WITH_SIMD\n#define ALIGN_SIZE  sizeof(double)\n#else\n#define ALIGN_SIZE  16 /* Most SIMD implementations require this */\n#endif\n#endif\n\n/*\n * We allocate objects from \"pools\", where each pool is gotten with a single\n * request to jpeg_get_small() or jpeg_get_large().  There is no per-object\n * overhead within a pool, except for alignment padding.  Each pool has a\n * header with a link to the next pool of the same class.\n * Small and large pool headers are identical.\n */\n\ntypedef struct small_pool_struct *small_pool_ptr;\n\ntypedef struct small_pool_struct {\n  small_pool_ptr next;  /* next in list of pools */\n  size_t bytes_used;            /* how many bytes already used within pool */\n  size_t bytes_left;            /* bytes still available in this pool */\n} small_pool_hdr;\n\ntypedef struct large_pool_struct *large_pool_ptr;\n\ntypedef struct large_pool_struct {\n  large_pool_ptr next;  /* next in list of pools */\n  size_t bytes_used;            /* how many bytes already used within pool */\n  size_t bytes_left;            /* bytes still available in this pool */\n} large_pool_hdr;\n\n/*\n * Here is the full definition of a memory manager object.\n */\n\ntypedef struct {\n  struct jpeg_memory_mgr pub;   /* public fields */\n\n  /* Each pool identifier (lifetime class) names a linked list of pools. */\n  small_pool_ptr small_list[JPOOL_NUMPOOLS];\n  large_pool_ptr large_list[JPOOL_NUMPOOLS];\n\n  /* Since we only have one lifetime class of virtual arrays, only one\n   * linked list is necessary (for each datatype).  Note that the virtual\n   * array control blocks being linked together are actually stored somewhere\n   * in the small-pool list.\n   */\n  jvirt_sarray_ptr virt_sarray_list;\n  jvirt_barray_ptr virt_barray_list;\n\n  /* This counts total space obtained from jpeg_get_small/large */\n  size_t total_space_allocated;\n\n  /* alloc_sarray and alloc_barray set this value for use by virtual\n   * array routines.\n   */\n  JDIMENSION last_rowsperchunk; /* from most recent alloc_sarray/barray */\n} my_memory_mgr;\n\ntypedef my_memory_mgr *my_mem_ptr;\n\n\n/*\n * The control blocks for virtual arrays.\n * Note that these blocks are allocated in the \"small\" pool area.\n * System-dependent info for the associated backing store (if any) is hidden\n * inside the backing_store_info struct.\n */\n\nstruct jvirt_sarray_control {\n  JSAMPARRAY mem_buffer;        /* => the in-memory buffer */\n  JDIMENSION rows_in_array;     /* total virtual array height */\n  JDIMENSION samplesperrow;     /* width of array (and of memory buffer) */\n  JDIMENSION maxaccess;         /* max rows accessed by access_virt_sarray */\n  JDIMENSION rows_in_mem;       /* height of memory buffer */\n  JDIMENSION rowsperchunk;      /* allocation chunk size in mem_buffer */\n  JDIMENSION cur_start_row;     /* first logical row # in the buffer */\n  JDIMENSION first_undef_row;   /* row # of first uninitialized row */\n  boolean pre_zero;             /* pre-zero mode requested? */\n  boolean dirty;                /* do current buffer contents need written? */\n  boolean b_s_open;             /* is backing-store data valid? */\n  jvirt_sarray_ptr next;        /* link to next virtual sarray control block */\n  backing_store_info b_s_info;  /* System-dependent control info */\n};\n\nstruct jvirt_barray_control {\n  JBLOCKARRAY mem_buffer;       /* => the in-memory buffer */\n  JDIMENSION rows_in_array;     /* total virtual array height */\n  JDIMENSION blocksperrow;      /* width of array (and of memory buffer) */\n  JDIMENSION maxaccess;         /* max rows accessed by access_virt_barray */\n  JDIMENSION rows_in_mem;       /* height of memory buffer */\n  JDIMENSION rowsperchunk;      /* allocation chunk size in mem_buffer */\n  JDIMENSION cur_start_row;     /* first logical row # in the buffer */\n  JDIMENSION first_undef_row;   /* row # of first uninitialized row */\n  boolean pre_zero;             /* pre-zero mode requested? */\n  boolean dirty;                /* do current buffer contents need written? */\n  boolean b_s_open;             /* is backing-store data valid? */\n  jvirt_barray_ptr next;        /* link to next virtual barray control block */\n  backing_store_info b_s_info;  /* System-dependent control info */\n};\n\n\n#ifdef MEM_STATS                /* optional extra stuff for statistics */\n\nLOCAL(void)\nprint_mem_stats (j_common_ptr cinfo, int pool_id)\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  small_pool_ptr shdr_ptr;\n  large_pool_ptr lhdr_ptr;\n\n  /* Since this is only a debugging stub, we can cheat a little by using\n   * fprintf directly rather than going through the trace message code.\n   * This is helpful because message parm array can't handle longs.\n   */\n  fprintf(stderr, \"Freeing pool %d, total space = %ld\\n\",\n          pool_id, mem->total_space_allocated);\n\n  for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL;\n       lhdr_ptr = lhdr_ptr->next) {\n    fprintf(stderr, \"  Large chunk used %ld\\n\",\n            (long) lhdr_ptr->bytes_used);\n  }\n\n  for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL;\n       shdr_ptr = shdr_ptr->next) {\n    fprintf(stderr, \"  Small chunk used %ld free %ld\\n\",\n            (long) shdr_ptr->bytes_used,\n            (long) shdr_ptr->bytes_left);\n  }\n}\n\n#endif /* MEM_STATS */\n\n\nLOCAL(void)\nout_of_memory (j_common_ptr cinfo, int which)\n/* Report an out-of-memory error and stop execution */\n/* If we compiled MEM_STATS support, report alloc requests before dying */\n{\n#ifdef MEM_STATS\n  cinfo->err->trace_level = 2;  /* force self_destruct to report stats */\n#endif\n  ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which);\n}\n\n\n/*\n * Allocation of \"small\" objects.\n *\n * For these, we use pooled storage.  When a new pool must be created,\n * we try to get enough space for the current request plus a \"slop\" factor,\n * where the slop will be the amount of leftover space in the new pool.\n * The speed vs. space tradeoff is largely determined by the slop values.\n * A different slop value is provided for each pool class (lifetime),\n * and we also distinguish the first pool of a class from later ones.\n * NOTE: the values given work fairly well on both 16- and 32-bit-int\n * machines, but may be too small if longs are 64 bits or more.\n *\n * Since we do not know what alignment malloc() gives us, we have to\n * allocate ALIGN_SIZE-1 extra space per pool to have room for alignment\n * adjustment.\n */\n\nstatic const size_t first_pool_slop[JPOOL_NUMPOOLS] =\n{\n        1600,                   /* first PERMANENT pool */\n        16000                   /* first IMAGE pool */\n};\n\nstatic const size_t extra_pool_slop[JPOOL_NUMPOOLS] =\n{\n        0,                      /* additional PERMANENT pools */\n        5000                    /* additional IMAGE pools */\n};\n\n#define MIN_SLOP  50            /* greater than 0 to avoid futile looping */\n\n\nMETHODDEF(void *)\nalloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)\n/* Allocate a \"small\" object */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  small_pool_ptr hdr_ptr, prev_hdr_ptr;\n  char *data_ptr;\n  size_t min_request, slop;\n\n  /*\n   * Round up the requested size to a multiple of ALIGN_SIZE in order\n   * to assure alignment for the next object allocated in the same pool\n   * and so that algorithms can straddle outside the proper area up\n   * to the next alignment.\n   */\n  if (sizeofobject > MAX_ALLOC_CHUNK) {\n    /* This prevents overflow/wrap-around in round_up_pow2() if sizeofobject\n       is close to SIZE_MAX. */\n    out_of_memory(cinfo, 7);\n  }\n  sizeofobject = round_up_pow2(sizeofobject, ALIGN_SIZE);\n\n  /* Check for unsatisfiable request (do now to ensure no overflow below) */\n  if ((sizeof(small_pool_hdr) + sizeofobject + ALIGN_SIZE - 1) >\n      MAX_ALLOC_CHUNK)\n    out_of_memory(cinfo, 1);    /* request exceeds malloc's ability */\n\n  /* See if space is available in any existing pool */\n  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)\n    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */\n  prev_hdr_ptr = NULL;\n  hdr_ptr = mem->small_list[pool_id];\n  while (hdr_ptr != NULL) {\n    if (hdr_ptr->bytes_left >= sizeofobject)\n      break;                    /* found pool with enough space */\n    prev_hdr_ptr = hdr_ptr;\n    hdr_ptr = hdr_ptr->next;\n  }\n\n  /* Time to make a new pool? */\n  if (hdr_ptr == NULL) {\n    /* min_request is what we need now, slop is what will be leftover */\n    min_request = sizeof(small_pool_hdr) + sizeofobject + ALIGN_SIZE - 1;\n    if (prev_hdr_ptr == NULL)   /* first pool in class? */\n      slop = first_pool_slop[pool_id];\n    else\n      slop = extra_pool_slop[pool_id];\n    /* Don't ask for more than MAX_ALLOC_CHUNK */\n    if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request))\n      slop = (size_t) (MAX_ALLOC_CHUNK-min_request);\n    /* Try to get space, if fail reduce slop and try again */\n    for (;;) {\n      hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop);\n      if (hdr_ptr != NULL)\n        break;\n      slop /= 2;\n      if (slop < MIN_SLOP)      /* give up when it gets real small */\n        out_of_memory(cinfo, 2); /* jpeg_get_small failed */\n    }\n    mem->total_space_allocated += min_request + slop;\n    /* Success, initialize the new pool header and add to end of list */\n    hdr_ptr->next = NULL;\n    hdr_ptr->bytes_used = 0;\n    hdr_ptr->bytes_left = sizeofobject + slop;\n    if (prev_hdr_ptr == NULL)   /* first pool in class? */\n      mem->small_list[pool_id] = hdr_ptr;\n    else\n      prev_hdr_ptr->next = hdr_ptr;\n  }\n\n  /* OK, allocate the object from the current pool */\n  data_ptr = (char *) hdr_ptr; /* point to first data byte in pool... */\n  data_ptr += sizeof(small_pool_hdr); /* ...by skipping the header... */\n  if ((size_t)data_ptr % ALIGN_SIZE) /* ...and adjust for alignment */\n    data_ptr += ALIGN_SIZE - (size_t)data_ptr % ALIGN_SIZE;\n  data_ptr += hdr_ptr->bytes_used; /* point to place for object */\n  hdr_ptr->bytes_used += sizeofobject;\n  hdr_ptr->bytes_left -= sizeofobject;\n\n  return (void *) data_ptr;\n}\n\n\n/*\n * Allocation of \"large\" objects.\n *\n * The external semantics of these are the same as \"small\" objects.  However,\n * the pool management heuristics are quite different.  We assume that each\n * request is large enough that it may as well be passed directly to\n * jpeg_get_large; the pool management just links everything together\n * so that we can free it all on demand.\n * Note: the major use of \"large\" objects is in JSAMPARRAY and JBLOCKARRAY\n * structures.  The routines that create these structures (see below)\n * deliberately bunch rows together to ensure a large request size.\n */\n\nMETHODDEF(void *)\nalloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)\n/* Allocate a \"large\" object */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  large_pool_ptr hdr_ptr;\n  char *data_ptr;\n\n  /*\n   * Round up the requested size to a multiple of ALIGN_SIZE so that\n   * algorithms can straddle outside the proper area up to the next\n   * alignment.\n   */\n  if (sizeofobject > MAX_ALLOC_CHUNK) {\n    /* This prevents overflow/wrap-around in round_up_pow2() if sizeofobject\n       is close to SIZE_MAX. */\n    out_of_memory(cinfo, 8);\n  }\n  sizeofobject = round_up_pow2(sizeofobject, ALIGN_SIZE);\n\n  /* Check for unsatisfiable request (do now to ensure no overflow below) */\n  if ((sizeof(large_pool_hdr) + sizeofobject + ALIGN_SIZE - 1) >\n      MAX_ALLOC_CHUNK)\n    out_of_memory(cinfo, 3);    /* request exceeds malloc's ability */\n\n  /* Always make a new pool */\n  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)\n    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */\n\n  hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject +\n                                            sizeof(large_pool_hdr) +\n                                            ALIGN_SIZE - 1);\n  if (hdr_ptr == NULL)\n    out_of_memory(cinfo, 4);    /* jpeg_get_large failed */\n  mem->total_space_allocated += sizeofobject + sizeof(large_pool_hdr) +\n                                ALIGN_SIZE - 1;\n\n  /* Success, initialize the new pool header and add to list */\n  hdr_ptr->next = mem->large_list[pool_id];\n  /* We maintain space counts in each pool header for statistical purposes,\n   * even though they are not needed for allocation.\n   */\n  hdr_ptr->bytes_used = sizeofobject;\n  hdr_ptr->bytes_left = 0;\n  mem->large_list[pool_id] = hdr_ptr;\n\n  data_ptr = (char *) hdr_ptr; /* point to first data byte in pool... */\n  data_ptr += sizeof(small_pool_hdr); /* ...by skipping the header... */\n  if ((size_t)data_ptr % ALIGN_SIZE) /* ...and adjust for alignment */\n    data_ptr += ALIGN_SIZE - (size_t)data_ptr % ALIGN_SIZE;\n\n  return (void *) data_ptr;\n}\n\n\n/*\n * Creation of 2-D sample arrays.\n *\n * To minimize allocation overhead and to allow I/O of large contiguous\n * blocks, we allocate the sample rows in groups of as many rows as possible\n * without exceeding MAX_ALLOC_CHUNK total bytes per allocation request.\n * NB: the virtual array control routines, later in this file, know about\n * this chunking of rows.  The rowsperchunk value is left in the mem manager\n * object so that it can be saved away if this sarray is the workspace for\n * a virtual array.\n *\n * Since we are often upsampling with a factor 2, we align the size (not\n * the start) to 2 * ALIGN_SIZE so that the upsampling routines don't have\n * to be as careful about size.\n */\n\nMETHODDEF(JSAMPARRAY)\nalloc_sarray (j_common_ptr cinfo, int pool_id,\n              JDIMENSION samplesperrow, JDIMENSION numrows)\n/* Allocate a 2-D sample array */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  JSAMPARRAY result;\n  JSAMPROW workspace;\n  JDIMENSION rowsperchunk, currow, i;\n  long ltemp;\n\n  /* Make sure each row is properly aligned */\n  if ((ALIGN_SIZE % sizeof(JSAMPLE)) != 0)\n    out_of_memory(cinfo, 5);    /* safety check */\n\n  if (samplesperrow > MAX_ALLOC_CHUNK) {\n    /* This prevents overflow/wrap-around in round_up_pow2() if sizeofobject\n       is close to SIZE_MAX. */\n    out_of_memory(cinfo, 9);\n  }\n  samplesperrow = (JDIMENSION)round_up_pow2(samplesperrow, (2 * ALIGN_SIZE) /\n                                                           sizeof(JSAMPLE));\n\n  /* Calculate max # of rows allowed in one allocation chunk */\n  ltemp = (MAX_ALLOC_CHUNK-sizeof(large_pool_hdr)) /\n          ((long) samplesperrow * sizeof(JSAMPLE));\n  if (ltemp <= 0)\n    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);\n  if (ltemp < (long) numrows)\n    rowsperchunk = (JDIMENSION) ltemp;\n  else\n    rowsperchunk = numrows;\n  mem->last_rowsperchunk = rowsperchunk;\n\n  /* Get space for row pointers (small object) */\n  result = (JSAMPARRAY) alloc_small(cinfo, pool_id,\n                                    (size_t) (numrows * sizeof(JSAMPROW)));\n\n  /* Get the rows themselves (large objects) */\n  currow = 0;\n  while (currow < numrows) {\n    rowsperchunk = MIN(rowsperchunk, numrows - currow);\n    workspace = (JSAMPROW) alloc_large(cinfo, pool_id,\n        (size_t) ((size_t) rowsperchunk * (size_t) samplesperrow\n                  * sizeof(JSAMPLE)));\n    for (i = rowsperchunk; i > 0; i--) {\n      result[currow++] = workspace;\n      workspace += samplesperrow;\n    }\n  }\n\n  return result;\n}\n\n\n/*\n * Creation of 2-D coefficient-block arrays.\n * This is essentially the same as the code for sample arrays, above.\n */\n\nMETHODDEF(JBLOCKARRAY)\nalloc_barray (j_common_ptr cinfo, int pool_id,\n              JDIMENSION blocksperrow, JDIMENSION numrows)\n/* Allocate a 2-D coefficient-block array */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  JBLOCKARRAY result;\n  JBLOCKROW workspace;\n  JDIMENSION rowsperchunk, currow, i;\n  long ltemp;\n\n  /* Make sure each row is properly aligned */\n  if ((sizeof(JBLOCK) % ALIGN_SIZE) != 0)\n    out_of_memory(cinfo, 6);    /* safety check */\n\n  /* Calculate max # of rows allowed in one allocation chunk */\n  ltemp = (MAX_ALLOC_CHUNK-sizeof(large_pool_hdr)) /\n          ((long) blocksperrow * sizeof(JBLOCK));\n  if (ltemp <= 0)\n    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);\n  if (ltemp < (long) numrows)\n    rowsperchunk = (JDIMENSION) ltemp;\n  else\n    rowsperchunk = numrows;\n  mem->last_rowsperchunk = rowsperchunk;\n\n  /* Get space for row pointers (small object) */\n  result = (JBLOCKARRAY) alloc_small(cinfo, pool_id,\n                                     (size_t) (numrows * sizeof(JBLOCKROW)));\n\n  /* Get the rows themselves (large objects) */\n  currow = 0;\n  while (currow < numrows) {\n    rowsperchunk = MIN(rowsperchunk, numrows - currow);\n    workspace = (JBLOCKROW) alloc_large(cinfo, pool_id,\n        (size_t) ((size_t) rowsperchunk * (size_t) blocksperrow\n                  * sizeof(JBLOCK)));\n    for (i = rowsperchunk; i > 0; i--) {\n      result[currow++] = workspace;\n      workspace += blocksperrow;\n    }\n  }\n\n  return result;\n}\n\n\n/*\n * About virtual array management:\n *\n * The above \"normal\" array routines are only used to allocate strip buffers\n * (as wide as the image, but just a few rows high).  Full-image-sized buffers\n * are handled as \"virtual\" arrays.  The array is still accessed a strip at a\n * time, but the memory manager must save the whole array for repeated\n * accesses.  The intended implementation is that there is a strip buffer in\n * memory (as high as is possible given the desired memory limit), plus a\n * backing file that holds the rest of the array.\n *\n * The request_virt_array routines are told the total size of the image and\n * the maximum number of rows that will be accessed at once.  The in-memory\n * buffer must be at least as large as the maxaccess value.\n *\n * The request routines create control blocks but not the in-memory buffers.\n * That is postponed until realize_virt_arrays is called.  At that time the\n * total amount of space needed is known (approximately, anyway), so free\n * memory can be divided up fairly.\n *\n * The access_virt_array routines are responsible for making a specific strip\n * area accessible (after reading or writing the backing file, if necessary).\n * Note that the access routines are told whether the caller intends to modify\n * the accessed strip; during a read-only pass this saves having to rewrite\n * data to disk.  The access routines are also responsible for pre-zeroing\n * any newly accessed rows, if pre-zeroing was requested.\n *\n * In current usage, the access requests are usually for nonoverlapping\n * strips; that is, successive access start_row numbers differ by exactly\n * num_rows = maxaccess.  This means we can get good performance with simple\n * buffer dump/reload logic, by making the in-memory buffer be a multiple\n * of the access height; then there will never be accesses across bufferload\n * boundaries.  The code will still work with overlapping access requests,\n * but it doesn't handle bufferload overlaps very efficiently.\n */\n\n\nMETHODDEF(jvirt_sarray_ptr)\nrequest_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero,\n                     JDIMENSION samplesperrow, JDIMENSION numrows,\n                     JDIMENSION maxaccess)\n/* Request a virtual 2-D sample array */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  jvirt_sarray_ptr result;\n\n  /* Only IMAGE-lifetime virtual arrays are currently supported */\n  if (pool_id != JPOOL_IMAGE)\n    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */\n\n  /* get control block */\n  result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id,\n                                          sizeof(struct jvirt_sarray_control));\n\n  result->mem_buffer = NULL;    /* marks array not yet realized */\n  result->rows_in_array = numrows;\n  result->samplesperrow = samplesperrow;\n  result->maxaccess = maxaccess;\n  result->pre_zero = pre_zero;\n  result->b_s_open = FALSE;     /* no associated backing-store object */\n  result->next = mem->virt_sarray_list; /* add to list of virtual arrays */\n  mem->virt_sarray_list = result;\n\n  return result;\n}\n\n\nMETHODDEF(jvirt_barray_ptr)\nrequest_virt_barray (j_common_ptr cinfo, int pool_id, boolean pre_zero,\n                     JDIMENSION blocksperrow, JDIMENSION numrows,\n                     JDIMENSION maxaccess)\n/* Request a virtual 2-D coefficient-block array */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  jvirt_barray_ptr result;\n\n  /* Only IMAGE-lifetime virtual arrays are currently supported */\n  if (pool_id != JPOOL_IMAGE)\n    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */\n\n  /* get control block */\n  result = (jvirt_barray_ptr) alloc_small(cinfo, pool_id,\n                                          sizeof(struct jvirt_barray_control));\n\n  result->mem_buffer = NULL;    /* marks array not yet realized */\n  result->rows_in_array = numrows;\n  result->blocksperrow = blocksperrow;\n  result->maxaccess = maxaccess;\n  result->pre_zero = pre_zero;\n  result->b_s_open = FALSE;     /* no associated backing-store object */\n  result->next = mem->virt_barray_list; /* add to list of virtual arrays */\n  mem->virt_barray_list = result;\n\n  return result;\n}\n\n\nMETHODDEF(void)\nrealize_virt_arrays (j_common_ptr cinfo)\n/* Allocate the in-memory buffers for any unrealized virtual arrays */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  size_t space_per_minheight, maximum_space, avail_mem;\n  size_t minheights, max_minheights;\n  jvirt_sarray_ptr sptr;\n  jvirt_barray_ptr bptr;\n\n  /* Compute the minimum space needed (maxaccess rows in each buffer)\n   * and the maximum space needed (full image height in each buffer).\n   * These may be of use to the system-dependent jpeg_mem_available routine.\n   */\n  space_per_minheight = 0;\n  maximum_space = 0;\n  for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {\n    if (sptr->mem_buffer == NULL) { /* if not realized yet */\n      space_per_minheight += (long) sptr->maxaccess *\n                             (long) sptr->samplesperrow * sizeof(JSAMPLE);\n      maximum_space += (long) sptr->rows_in_array *\n                       (long) sptr->samplesperrow * sizeof(JSAMPLE);\n    }\n  }\n  for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {\n    if (bptr->mem_buffer == NULL) { /* if not realized yet */\n      space_per_minheight += (long) bptr->maxaccess *\n                             (long) bptr->blocksperrow * sizeof(JBLOCK);\n      maximum_space += (long) bptr->rows_in_array *\n                       (long) bptr->blocksperrow * sizeof(JBLOCK);\n    }\n  }\n\n  if (space_per_minheight <= 0)\n    return;                     /* no unrealized arrays, no work */\n\n  /* Determine amount of memory to actually use; this is system-dependent. */\n  avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space,\n                                 mem->total_space_allocated);\n\n  /* If the maximum space needed is available, make all the buffers full\n   * height; otherwise parcel it out with the same number of minheights\n   * in each buffer.\n   */\n  if (avail_mem >= maximum_space)\n    max_minheights = 1000000000L;\n  else {\n    max_minheights = avail_mem / space_per_minheight;\n    /* If there doesn't seem to be enough space, try to get the minimum\n     * anyway.  This allows a \"stub\" implementation of jpeg_mem_available().\n     */\n    if (max_minheights <= 0)\n      max_minheights = 1;\n  }\n\n  /* Allocate the in-memory buffers and initialize backing store as needed. */\n\n  for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {\n    if (sptr->mem_buffer == NULL) { /* if not realized yet */\n      minheights = ((long) sptr->rows_in_array - 1L) / sptr->maxaccess + 1L;\n      if (minheights <= max_minheights) {\n        /* This buffer fits in memory */\n        sptr->rows_in_mem = sptr->rows_in_array;\n      } else {\n        /* It doesn't fit in memory, create backing store. */\n        sptr->rows_in_mem = (JDIMENSION) (max_minheights * sptr->maxaccess);\n        jpeg_open_backing_store(cinfo, & sptr->b_s_info,\n                                (long) sptr->rows_in_array *\n                                (long) sptr->samplesperrow *\n                                (long) sizeof(JSAMPLE));\n        sptr->b_s_open = TRUE;\n      }\n      sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE,\n                                      sptr->samplesperrow, sptr->rows_in_mem);\n      sptr->rowsperchunk = mem->last_rowsperchunk;\n      sptr->cur_start_row = 0;\n      sptr->first_undef_row = 0;\n      sptr->dirty = FALSE;\n    }\n  }\n\n  for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {\n    if (bptr->mem_buffer == NULL) { /* if not realized yet */\n      minheights = ((long) bptr->rows_in_array - 1L) / bptr->maxaccess + 1L;\n      if (minheights <= max_minheights) {\n        /* This buffer fits in memory */\n        bptr->rows_in_mem = bptr->rows_in_array;\n      } else {\n        /* It doesn't fit in memory, create backing store. */\n        bptr->rows_in_mem = (JDIMENSION) (max_minheights * bptr->maxaccess);\n        jpeg_open_backing_store(cinfo, & bptr->b_s_info,\n                                (long) bptr->rows_in_array *\n                                (long) bptr->blocksperrow *\n                                (long) sizeof(JBLOCK));\n        bptr->b_s_open = TRUE;\n      }\n      bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE,\n                                      bptr->blocksperrow, bptr->rows_in_mem);\n      bptr->rowsperchunk = mem->last_rowsperchunk;\n      bptr->cur_start_row = 0;\n      bptr->first_undef_row = 0;\n      bptr->dirty = FALSE;\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing)\n/* Do backing store read or write of a virtual sample array */\n{\n  long bytesperrow, file_offset, byte_count, rows, thisrow, i;\n\n  bytesperrow = (long) ptr->samplesperrow * sizeof(JSAMPLE);\n  file_offset = ptr->cur_start_row * bytesperrow;\n  /* Loop to read or write each allocation chunk in mem_buffer */\n  for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {\n    /* One chunk, but check for short chunk at end of buffer */\n    rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);\n    /* Transfer no more than is currently defined */\n    thisrow = (long) ptr->cur_start_row + i;\n    rows = MIN(rows, (long) ptr->first_undef_row - thisrow);\n    /* Transfer no more than fits in file */\n    rows = MIN(rows, (long) ptr->rows_in_array - thisrow);\n    if (rows <= 0)              /* this chunk might be past end of file! */\n      break;\n    byte_count = rows * bytesperrow;\n    if (writing)\n      (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,\n                                            (void *) ptr->mem_buffer[i],\n                                            file_offset, byte_count);\n    else\n      (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,\n                                           (void *) ptr->mem_buffer[i],\n                                           file_offset, byte_count);\n    file_offset += byte_count;\n  }\n}\n\n\nLOCAL(void)\ndo_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing)\n/* Do backing store read or write of a virtual coefficient-block array */\n{\n  long bytesperrow, file_offset, byte_count, rows, thisrow, i;\n\n  bytesperrow = (long) ptr->blocksperrow * sizeof(JBLOCK);\n  file_offset = ptr->cur_start_row * bytesperrow;\n  /* Loop to read or write each allocation chunk in mem_buffer */\n  for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {\n    /* One chunk, but check for short chunk at end of buffer */\n    rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);\n    /* Transfer no more than is currently defined */\n    thisrow = (long) ptr->cur_start_row + i;\n    rows = MIN(rows, (long) ptr->first_undef_row - thisrow);\n    /* Transfer no more than fits in file */\n    rows = MIN(rows, (long) ptr->rows_in_array - thisrow);\n    if (rows <= 0)              /* this chunk might be past end of file! */\n      break;\n    byte_count = rows * bytesperrow;\n    if (writing)\n      (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,\n                                            (void *) ptr->mem_buffer[i],\n                                            file_offset, byte_count);\n    else\n      (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,\n                                           (void *) ptr->mem_buffer[i],\n                                           file_offset, byte_count);\n    file_offset += byte_count;\n  }\n}\n\n\nMETHODDEF(JSAMPARRAY)\naccess_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr,\n                    JDIMENSION start_row, JDIMENSION num_rows,\n                    boolean writable)\n/* Access the part of a virtual sample array starting at start_row */\n/* and extending for num_rows rows.  writable is true if  */\n/* caller intends to modify the accessed area. */\n{\n  JDIMENSION end_row = start_row + num_rows;\n  JDIMENSION undef_row;\n\n  /* debugging check */\n  if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||\n      ptr->mem_buffer == NULL)\n    ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n\n  /* Make the desired part of the virtual array accessible */\n  if (start_row < ptr->cur_start_row ||\n      end_row > ptr->cur_start_row+ptr->rows_in_mem) {\n    if (! ptr->b_s_open)\n      ERREXIT(cinfo, JERR_VIRTUAL_BUG);\n    /* Flush old buffer contents if necessary */\n    if (ptr->dirty) {\n      do_sarray_io(cinfo, ptr, TRUE);\n      ptr->dirty = FALSE;\n    }\n    /* Decide what part of virtual array to access.\n     * Algorithm: if target address > current window, assume forward scan,\n     * load starting at target address.  If target address < current window,\n     * assume backward scan, load so that target area is top of window.\n     * Note that when switching from forward write to forward read, will have\n     * start_row = 0, so the limiting case applies and we load from 0 anyway.\n     */\n    if (start_row > ptr->cur_start_row) {\n      ptr->cur_start_row = start_row;\n    } else {\n      /* use long arithmetic here to avoid overflow & unsigned problems */\n      long ltemp;\n\n      ltemp = (long) end_row - (long) ptr->rows_in_mem;\n      if (ltemp < 0)\n        ltemp = 0;              /* don't fall off front end of file */\n      ptr->cur_start_row = (JDIMENSION) ltemp;\n    }\n    /* Read in the selected part of the array.\n     * During the initial write pass, we will do no actual read\n     * because the selected part is all undefined.\n     */\n    do_sarray_io(cinfo, ptr, FALSE);\n  }\n  /* Ensure the accessed part of the array is defined; prezero if needed.\n   * To improve locality of access, we only prezero the part of the array\n   * that the caller is about to access, not the entire in-memory array.\n   */\n  if (ptr->first_undef_row < end_row) {\n    if (ptr->first_undef_row < start_row) {\n      if (writable)             /* writer skipped over a section of array */\n        ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n      undef_row = start_row;    /* but reader is allowed to read ahead */\n    } else {\n      undef_row = ptr->first_undef_row;\n    }\n    if (writable)\n      ptr->first_undef_row = end_row;\n    if (ptr->pre_zero) {\n      size_t bytesperrow = (size_t) ptr->samplesperrow * sizeof(JSAMPLE);\n      undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */\n      end_row -= ptr->cur_start_row;\n      while (undef_row < end_row) {\n        jzero_far((void *) ptr->mem_buffer[undef_row], bytesperrow);\n        undef_row++;\n      }\n    } else {\n      if (! writable)           /* reader looking at undefined data */\n        ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n    }\n  }\n  /* Flag the buffer dirty if caller will write in it */\n  if (writable)\n    ptr->dirty = TRUE;\n  /* Return address of proper part of the buffer */\n  return ptr->mem_buffer + (start_row - ptr->cur_start_row);\n}\n\n\nMETHODDEF(JBLOCKARRAY)\naccess_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr,\n                    JDIMENSION start_row, JDIMENSION num_rows,\n                    boolean writable)\n/* Access the part of a virtual block array starting at start_row */\n/* and extending for num_rows rows.  writable is true if  */\n/* caller intends to modify the accessed area. */\n{\n  JDIMENSION end_row = start_row + num_rows;\n  JDIMENSION undef_row;\n\n  /* debugging check */\n  if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||\n      ptr->mem_buffer == NULL)\n    ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n\n  /* Make the desired part of the virtual array accessible */\n  if (start_row < ptr->cur_start_row ||\n      end_row > ptr->cur_start_row+ptr->rows_in_mem) {\n    if (! ptr->b_s_open)\n      ERREXIT(cinfo, JERR_VIRTUAL_BUG);\n    /* Flush old buffer contents if necessary */\n    if (ptr->dirty) {\n      do_barray_io(cinfo, ptr, TRUE);\n      ptr->dirty = FALSE;\n    }\n    /* Decide what part of virtual array to access.\n     * Algorithm: if target address > current window, assume forward scan,\n     * load starting at target address.  If target address < current window,\n     * assume backward scan, load so that target area is top of window.\n     * Note that when switching from forward write to forward read, will have\n     * start_row = 0, so the limiting case applies and we load from 0 anyway.\n     */\n    if (start_row > ptr->cur_start_row) {\n      ptr->cur_start_row = start_row;\n    } else {\n      /* use long arithmetic here to avoid overflow & unsigned problems */\n      long ltemp;\n\n      ltemp = (long) end_row - (long) ptr->rows_in_mem;\n      if (ltemp < 0)\n        ltemp = 0;              /* don't fall off front end of file */\n      ptr->cur_start_row = (JDIMENSION) ltemp;\n    }\n    /* Read in the selected part of the array.\n     * During the initial write pass, we will do no actual read\n     * because the selected part is all undefined.\n     */\n    do_barray_io(cinfo, ptr, FALSE);\n  }\n  /* Ensure the accessed part of the array is defined; prezero if needed.\n   * To improve locality of access, we only prezero the part of the array\n   * that the caller is about to access, not the entire in-memory array.\n   */\n  if (ptr->first_undef_row < end_row) {\n    if (ptr->first_undef_row < start_row) {\n      if (writable)             /* writer skipped over a section of array */\n        ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n      undef_row = start_row;    /* but reader is allowed to read ahead */\n    } else {\n      undef_row = ptr->first_undef_row;\n    }\n    if (writable)\n      ptr->first_undef_row = end_row;\n    if (ptr->pre_zero) {\n      size_t bytesperrow = (size_t) ptr->blocksperrow * sizeof(JBLOCK);\n      undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */\n      end_row -= ptr->cur_start_row;\n      while (undef_row < end_row) {\n        jzero_far((void *) ptr->mem_buffer[undef_row], bytesperrow);\n        undef_row++;\n      }\n    } else {\n      if (! writable)           /* reader looking at undefined data */\n        ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n    }\n  }\n  /* Flag the buffer dirty if caller will write in it */\n  if (writable)\n    ptr->dirty = TRUE;\n  /* Return address of proper part of the buffer */\n  return ptr->mem_buffer + (start_row - ptr->cur_start_row);\n}\n\n\n/*\n * Release all objects belonging to a specified pool.\n */\n\nMETHODDEF(void)\nfree_pool (j_common_ptr cinfo, int pool_id)\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  small_pool_ptr shdr_ptr;\n  large_pool_ptr lhdr_ptr;\n  size_t space_freed;\n\n  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)\n    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */\n\n#ifdef MEM_STATS\n  if (cinfo->err->trace_level > 1)\n    print_mem_stats(cinfo, pool_id); /* print pool's memory usage statistics */\n#endif\n\n  /* If freeing IMAGE pool, close any virtual arrays first */\n  if (pool_id == JPOOL_IMAGE) {\n    jvirt_sarray_ptr sptr;\n    jvirt_barray_ptr bptr;\n\n    for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {\n      if (sptr->b_s_open) {     /* there may be no backing store */\n        sptr->b_s_open = FALSE; /* prevent recursive close if error */\n        (*sptr->b_s_info.close_backing_store) (cinfo, & sptr->b_s_info);\n      }\n    }\n    mem->virt_sarray_list = NULL;\n    for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {\n      if (bptr->b_s_open) {     /* there may be no backing store */\n        bptr->b_s_open = FALSE; /* prevent recursive close if error */\n        (*bptr->b_s_info.close_backing_store) (cinfo, & bptr->b_s_info);\n      }\n    }\n    mem->virt_barray_list = NULL;\n  }\n\n  /* Release large objects */\n  lhdr_ptr = mem->large_list[pool_id];\n  mem->large_list[pool_id] = NULL;\n\n  while (lhdr_ptr != NULL) {\n    large_pool_ptr next_lhdr_ptr = lhdr_ptr->next;\n    space_freed = lhdr_ptr->bytes_used +\n                  lhdr_ptr->bytes_left +\n                  sizeof(large_pool_hdr);\n    jpeg_free_large(cinfo, (void *) lhdr_ptr, space_freed);\n    mem->total_space_allocated -= space_freed;\n    lhdr_ptr = next_lhdr_ptr;\n  }\n\n  /* Release small objects */\n  shdr_ptr = mem->small_list[pool_id];\n  mem->small_list[pool_id] = NULL;\n\n  while (shdr_ptr != NULL) {\n    small_pool_ptr next_shdr_ptr = shdr_ptr->next;\n    space_freed = shdr_ptr->bytes_used +\n                  shdr_ptr->bytes_left +\n                  sizeof(small_pool_hdr);\n    jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed);\n    mem->total_space_allocated -= space_freed;\n    shdr_ptr = next_shdr_ptr;\n  }\n}\n\n\n/*\n * Close up shop entirely.\n * Note that this cannot be called unless cinfo->mem is non-NULL.\n */\n\nMETHODDEF(void)\nself_destruct (j_common_ptr cinfo)\n{\n  int pool;\n\n  /* Close all backing store, release all memory.\n   * Releasing pools in reverse order might help avoid fragmentation\n   * with some (brain-damaged) malloc libraries.\n   */\n  for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {\n    free_pool(cinfo, pool);\n  }\n\n  /* Release the memory manager control block too. */\n  jpeg_free_small(cinfo, (void *) cinfo->mem, sizeof(my_memory_mgr));\n  cinfo->mem = NULL;            /* ensures I will be called only once */\n\n  jpeg_mem_term(cinfo);         /* system-dependent cleanup */\n}\n\n\n/*\n * Memory manager initialization.\n * When this is called, only the error manager pointer is valid in cinfo!\n */\n\nGLOBAL(void)\njinit_memory_mgr (j_common_ptr cinfo)\n{\n  my_mem_ptr mem;\n  long max_to_use;\n  int pool;\n  size_t test_mac;\n\n  cinfo->mem = NULL;            /* for safety if init fails */\n\n  /* Check for configuration errors.\n   * sizeof(ALIGN_TYPE) should be a power of 2; otherwise, it probably\n   * doesn't reflect any real hardware alignment requirement.\n   * The test is a little tricky: for X>0, X and X-1 have no one-bits\n   * in common if and only if X is a power of 2, ie has only one one-bit.\n   * Some compilers may give an \"unreachable code\" warning here; ignore it.\n   */\n  if ((ALIGN_SIZE & (ALIGN_SIZE-1)) != 0)\n    ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE);\n  /* MAX_ALLOC_CHUNK must be representable as type size_t, and must be\n   * a multiple of ALIGN_SIZE.\n   * Again, an \"unreachable code\" warning may be ignored here.\n   * But a \"constant too large\" warning means you need to fix MAX_ALLOC_CHUNK.\n   */\n  test_mac = (size_t) MAX_ALLOC_CHUNK;\n  if ((long) test_mac != MAX_ALLOC_CHUNK ||\n      (MAX_ALLOC_CHUNK % ALIGN_SIZE) != 0)\n    ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);\n\n  max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */\n\n  /* Attempt to allocate memory manager's control block */\n  mem = (my_mem_ptr) jpeg_get_small(cinfo, sizeof(my_memory_mgr));\n\n  if (mem == NULL) {\n    jpeg_mem_term(cinfo);       /* system-dependent cleanup */\n    ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0);\n  }\n\n  /* OK, fill in the method pointers */\n  mem->pub.alloc_small = alloc_small;\n  mem->pub.alloc_large = alloc_large;\n  mem->pub.alloc_sarray = alloc_sarray;\n  mem->pub.alloc_barray = alloc_barray;\n  mem->pub.request_virt_sarray = request_virt_sarray;\n  mem->pub.request_virt_barray = request_virt_barray;\n  mem->pub.realize_virt_arrays = realize_virt_arrays;\n  mem->pub.access_virt_sarray = access_virt_sarray;\n  mem->pub.access_virt_barray = access_virt_barray;\n  mem->pub.free_pool = free_pool;\n  mem->pub.self_destruct = self_destruct;\n\n  /* Make MAX_ALLOC_CHUNK accessible to other modules */\n  mem->pub.max_alloc_chunk = MAX_ALLOC_CHUNK;\n\n  /* Initialize working state */\n  mem->pub.max_memory_to_use = max_to_use;\n\n  for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {\n    mem->small_list[pool] = NULL;\n    mem->large_list[pool] = NULL;\n  }\n  mem->virt_sarray_list = NULL;\n  mem->virt_barray_list = NULL;\n\n  mem->total_space_allocated = sizeof(my_memory_mgr);\n\n  /* Declare ourselves open for business */\n  cinfo->mem = & mem->pub;\n\n  /* Check for an environment variable JPEGMEM; if found, override the\n   * default max_memory setting from jpeg_mem_init.  Note that the\n   * surrounding application may again override this value.\n   * If your system doesn't support getenv(), define NO_GETENV to disable\n   * this feature.\n   */\n#ifndef NO_GETENV\n  { char *memenv;\n\n    if ((memenv = getenv(\"JPEGMEM\")) != NULL) {\n      char ch = 'x';\n\n      if (sscanf(memenv, \"%ld%c\", &max_to_use, &ch) > 0) {\n        if (ch == 'm' || ch == 'M')\n          max_to_use *= 1000L;\n        mem->pub.max_memory_to_use = max_to_use * 1000L;\n      }\n    }\n  }\n#endif\n\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jmemnobs.c",
    "content": "/*\n * jmemnobs.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1992-1996, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code and\n * information relevant to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file provides a really simple implementation of the system-\n * dependent portion of the JPEG memory manager.  This implementation\n * assumes that no backing-store files are needed: all required space\n * can be obtained from malloc().\n * This is very portable in the sense that it'll compile on almost anything,\n * but you'd better have lots of main memory (or virtual memory) if you want\n * to process big images.\n * Note that the max_memory_to_use option is ignored by this implementation.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jmemsys.h\"            /* import the system-dependent declarations */\n\n#ifndef HAVE_STDLIB_H           /* <stdlib.h> should declare malloc(),free() */\nextern void *malloc (size_t size);\nextern void free (void *ptr);\n#endif\n\n\n/*\n * Memory allocation and freeing are controlled by the regular library\n * routines malloc() and free().\n */\n\nGLOBAL(void *)\njpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)\n{\n  return (void *) malloc(sizeofobject);\n}\n\nGLOBAL(void)\njpeg_free_small (j_common_ptr cinfo, void *object, size_t sizeofobject)\n{\n  free(object);\n}\n\n\n/*\n * \"Large\" objects are treated the same as \"small\" ones.\n */\n\nGLOBAL(void *)\njpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)\n{\n  return (void *) malloc(sizeofobject);\n}\n\nGLOBAL(void)\njpeg_free_large (j_common_ptr cinfo, void *object, size_t sizeofobject)\n{\n  free(object);\n}\n\n\n/*\n * This routine computes the total memory space available for allocation.\n * Here we always say, \"we got all you want bud!\"\n */\n\nGLOBAL(size_t)\njpeg_mem_available (j_common_ptr cinfo, size_t min_bytes_needed,\n                    size_t max_bytes_needed, size_t already_allocated)\n{\n  return max_bytes_needed;\n}\n\n\n/*\n * Backing store (temporary file) management.\n * Since jpeg_mem_available always promised the moon,\n * this should never be called and we can just error out.\n */\n\nGLOBAL(void)\njpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,\n                         long total_bytes_needed)\n{\n  ERREXIT(cinfo, JERR_NO_BACKING_STORE);\n}\n\n\n/*\n * These routines take care of any system-dependent initialization and\n * cleanup required.  Here, there isn't any.\n */\n\nGLOBAL(long)\njpeg_mem_init (j_common_ptr cinfo)\n{\n  return 0;                     /* just set max_memory_to_use to 0 */\n}\n\nGLOBAL(void)\njpeg_mem_term (j_common_ptr cinfo)\n{\n  /* no work */\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jmemsys.h",
    "content": "/*\n * jmemsys.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1992-1997, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code and\n * information relevant to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This include file defines the interface between the system-independent\n * and system-dependent portions of the JPEG memory manager.  No other\n * modules need include it.  (The system-independent portion is jmemmgr.c;\n * there are several different versions of the system-dependent portion.)\n *\n * This file works as-is for the system-dependent memory managers supplied\n * in the IJG distribution.  You may need to modify it if you write a\n * custom memory manager.  If system-dependent changes are needed in\n * this file, the best method is to #ifdef them based on a configuration\n * symbol supplied in jconfig.h.\n */\n\n\n/*\n * These two functions are used to allocate and release small chunks of\n * memory.  (Typically the total amount requested through jpeg_get_small is\n * no more than 20K or so; this will be requested in chunks of a few K each.)\n * Behavior should be the same as for the standard library functions malloc\n * and free; in particular, jpeg_get_small must return NULL on failure.\n * On most systems, these ARE malloc and free.  jpeg_free_small is passed the\n * size of the object being freed, just in case it's needed.\n */\n\nEXTERN(void *) jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject);\nEXTERN(void) jpeg_free_small (j_common_ptr cinfo, void *object,\n                              size_t sizeofobject);\n\n/*\n * These two functions are used to allocate and release large chunks of\n * memory (up to the total free space designated by jpeg_mem_available).\n * These are identical to the jpeg_get/free_small routines; but we keep them\n * separate anyway, in case a different allocation strategy is desirable for\n * large chunks.\n */\n\nEXTERN(void *) jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject);\nEXTERN(void) jpeg_free_large (j_common_ptr cinfo, void *object,\n                              size_t sizeofobject);\n\n/*\n * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may\n * be requested in a single call to jpeg_get_large (and jpeg_get_small for that\n * matter, but that case should never come into play).  This macro was needed\n * to model the 64Kb-segment-size limit of far addressing on 80x86 machines.\n * On machines with flat address spaces, any large constant may be used.\n *\n * NB: jmemmgr.c expects that MAX_ALLOC_CHUNK will be representable as type\n * size_t and will be a multiple of sizeof(align_type).\n */\n\n#ifndef MAX_ALLOC_CHUNK         /* may be overridden in jconfig.h */\n#define MAX_ALLOC_CHUNK  1000000000L\n#endif\n\n/*\n * This routine computes the total space still available for allocation by\n * jpeg_get_large.  If more space than this is needed, backing store will be\n * used.  NOTE: any memory already allocated must not be counted.\n *\n * There is a minimum space requirement, corresponding to the minimum\n * feasible buffer sizes; jmemmgr.c will request that much space even if\n * jpeg_mem_available returns zero.  The maximum space needed, enough to hold\n * all working storage in memory, is also passed in case it is useful.\n * Finally, the total space already allocated is passed.  If no better\n * method is available, cinfo->mem->max_memory_to_use - already_allocated\n * is often a suitable calculation.\n *\n * It is OK for jpeg_mem_available to underestimate the space available\n * (that'll just lead to more backing-store access than is really necessary).\n * However, an overestimate will lead to failure.  Hence it's wise to subtract\n * a slop factor from the true available space.  5% should be enough.\n *\n * On machines with lots of virtual memory, any large constant may be returned.\n * Conversely, zero may be returned to always use the minimum amount of memory.\n */\n\nEXTERN(size_t) jpeg_mem_available (j_common_ptr cinfo, size_t min_bytes_needed,\n                                   size_t max_bytes_needed,\n                                   size_t already_allocated);\n\n\n/*\n * This structure holds whatever state is needed to access a single\n * backing-store object.  The read/write/close method pointers are called\n * by jmemmgr.c to manipulate the backing-store object; all other fields\n * are private to the system-dependent backing store routines.\n */\n\n#define TEMP_NAME_LENGTH   64   /* max length of a temporary file's name */\n\n\n#ifdef USE_MSDOS_MEMMGR         /* DOS-specific junk */\n\ntypedef unsigned short XMSH;    /* type of extended-memory handles */\ntypedef unsigned short EMSH;    /* type of expanded-memory handles */\n\ntypedef union {\n  short file_handle;            /* DOS file handle if it's a temp file */\n  XMSH xms_handle;              /* handle if it's a chunk of XMS */\n  EMSH ems_handle;              /* handle if it's a chunk of EMS */\n} handle_union;\n\n#endif /* USE_MSDOS_MEMMGR */\n\n#ifdef USE_MAC_MEMMGR           /* Mac-specific junk */\n#include <Files.h>\n#endif /* USE_MAC_MEMMGR */\n\n\ntypedef struct backing_store_struct *backing_store_ptr;\n\ntypedef struct backing_store_struct {\n  /* Methods for reading/writing/closing this backing-store object */\n  void (*read_backing_store) (j_common_ptr cinfo, backing_store_ptr info,\n                              void *buffer_address, long file_offset,\n                              long byte_count);\n  void (*write_backing_store) (j_common_ptr cinfo, backing_store_ptr info,\n                               void *buffer_address, long file_offset,\n                               long byte_count);\n  void (*close_backing_store) (j_common_ptr cinfo, backing_store_ptr info);\n\n  /* Private fields for system-dependent backing-store management */\n#ifdef USE_MSDOS_MEMMGR\n  /* For the MS-DOS manager (jmemdos.c), we need: */\n  handle_union handle;          /* reference to backing-store storage object */\n  char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */\n#else\n#ifdef USE_MAC_MEMMGR\n  /* For the Mac manager (jmemmac.c), we need: */\n  short temp_file;              /* file reference number to temp file */\n  FSSpec tempSpec;              /* the FSSpec for the temp file */\n  char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */\n#else\n  /* For a typical implementation with temp files, we need: */\n  FILE *temp_file;              /* stdio reference to temp file */\n  char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */\n#endif\n#endif\n} backing_store_info;\n\n\n/*\n * Initial opening of a backing-store object.  This must fill in the\n * read/write/close pointers in the object.  The read/write routines\n * may take an error exit if the specified maximum file size is exceeded.\n * (If jpeg_mem_available always returns a large value, this routine can\n * just take an error exit.)\n */\n\nEXTERN(void) jpeg_open_backing_store (j_common_ptr cinfo,\n                                      backing_store_ptr info,\n                                      long total_bytes_needed);\n\n\n/*\n * These routines take care of any system-dependent initialization and\n * cleanup required.  jpeg_mem_init will be called before anything is\n * allocated (and, therefore, nothing in cinfo is of use except the error\n * manager pointer).  It should return a suitable default value for\n * max_memory_to_use; this may subsequently be overridden by the surrounding\n * application.  (Note that max_memory_to_use is only important if\n * jpeg_mem_available chooses to consult it ... no one else will.)\n * jpeg_mem_term may assume that all requested memory has been freed and that\n * all opened backing-store objects have been closed.\n */\n\nEXTERN(long) jpeg_mem_init (j_common_ptr cinfo);\nEXTERN(void) jpeg_mem_term (j_common_ptr cinfo);\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jmorecfg.h",
    "content": "/*\n * jmorecfg.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 1997-2009 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009, 2011, 2014-2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains additional configuration options that customize the\n * JPEG software for special applications or support machine-dependent\n * optimizations.  Most users will not need to touch this file.\n */\n\n\n/*\n * Maximum number of components (color channels) allowed in JPEG image.\n * To meet the letter of the JPEG spec, set this to 255.  However, darn\n * few applications need more than 4 channels (maybe 5 for CMYK + alpha\n * mask).  We recommend 10 as a reasonable compromise; use 4 if you are\n * really short on memory.  (Each allowed component costs a hundred or so\n * bytes of storage, whether actually used in an image or not.)\n */\n\n#define MAX_COMPONENTS  10      /* maximum number of image components */\n\n\n/*\n * Basic data types.\n * You may need to change these if you have a machine with unusual data\n * type sizes; for example, \"char\" not 8 bits, \"short\" not 16 bits,\n * or \"long\" not 32 bits.  We don't care whether \"int\" is 16 or 32 bits,\n * but it had better be at least 16.\n */\n\n/* Representation of a single sample (pixel element value).\n * We frequently allocate large arrays of these, so it's important to keep\n * them small.  But if you have memory to burn and access to char or short\n * arrays is very slow on your hardware, you might want to change these.\n */\n\n#if BITS_IN_JSAMPLE == 8\n/* JSAMPLE should be the smallest type that will hold the values 0..255.\n * You can use a signed char by having GETJSAMPLE mask it with 0xFF.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JSAMPLE;\n#ifdef __CHAR_UNSIGNED__\n#define GETJSAMPLE(value)  ((int) (value))\n#else\n#define GETJSAMPLE(value)  ((int) (value) & 0xFF)\n#endif /* __CHAR_UNSIGNED__ */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n#define MAXJSAMPLE      255\n#define CENTERJSAMPLE   128\n\n#endif /* BITS_IN_JSAMPLE == 8 */\n\n\n#if BITS_IN_JSAMPLE == 12\n/* JSAMPLE should be the smallest type that will hold the values 0..4095.\n * On nearly all machines \"short\" will do nicely.\n */\n\ntypedef short JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#define MAXJSAMPLE      4095\n#define CENTERJSAMPLE   2048\n\n#endif /* BITS_IN_JSAMPLE == 12 */\n\n\n/* Representation of a DCT frequency coefficient.\n * This should be a signed value of at least 16 bits; \"short\" is usually OK.\n * Again, we allocate large arrays of these, but you can change to int\n * if you have memory to burn and \"short\" is really slow.\n */\n\ntypedef short JCOEF;\n\n\n/* Compressed datastreams are represented as arrays of JOCTET.\n * These must be EXACTLY 8 bits wide, at least once they are written to\n * external storage.  Note that when using the stdio data source/destination\n * managers, this is also the data type passed to fread/fwrite.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JOCTET;\n#define GETJOCTET(value)  (value)\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JOCTET;\n#ifdef __CHAR_UNSIGNED__\n#define GETJOCTET(value)  (value)\n#else\n#define GETJOCTET(value)  ((value) & 0xFF)\n#endif /* __CHAR_UNSIGNED__ */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n/* These typedefs are used for various table entries and so forth.\n * They must be at least as wide as specified; but making them too big\n * won't cost a huge amount of memory, so we don't provide special\n * extraction code like we did for JSAMPLE.  (In other words, these\n * typedefs live at a different point on the speed/space tradeoff curve.)\n */\n\n/* UINT8 must hold at least the values 0..255. */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char UINT8;\n#else /* not HAVE_UNSIGNED_CHAR */\n#ifdef __CHAR_UNSIGNED__\ntypedef char UINT8;\n#else /* not __CHAR_UNSIGNED__ */\ntypedef short UINT8;\n#endif /* __CHAR_UNSIGNED__ */\n#endif /* HAVE_UNSIGNED_CHAR */\n\n/* UINT16 must hold at least the values 0..65535. */\n\n#ifdef HAVE_UNSIGNED_SHORT\ntypedef unsigned short UINT16;\n#else /* not HAVE_UNSIGNED_SHORT */\ntypedef unsigned int UINT16;\n#endif /* HAVE_UNSIGNED_SHORT */\n\n/* INT16 must hold at least the values -32768..32767. */\n\n#ifndef XMD_H                   /* X11/xmd.h correctly defines INT16 */\ntypedef short INT16;\n#endif\n\n/* INT32 must hold at least signed 32-bit values.\n *\n * NOTE: The INT32 typedef dates back to libjpeg v5 (1994.)  Integers were\n * sometimes 16-bit back then (MS-DOS), which is why INT32 is typedef'd to\n * long.  It also wasn't common (or at least as common) in 1994 for INT32 to be\n * defined by platform headers.  Since then, however, INT32 is defined in\n * several other common places:\n *\n * Xmd.h (X11 header) typedefs INT32 to int on 64-bit platforms and long on\n * 32-bit platforms (i.e always a 32-bit signed type.)\n *\n * basetsd.h (Win32 header) typedefs INT32 to int (always a 32-bit signed type\n * on modern platforms.)\n *\n * qglobal.h (Qt header) typedefs INT32 to int (always a 32-bit signed type on\n * modern platforms.)\n *\n * This is a recipe for conflict, since \"long\" and \"int\" aren't always\n * compatible types.  Since the definition of INT32 has technically been part\n * of the libjpeg API for more than 20 years, we can't remove it, but we do not\n * use it internally any longer.  We instead define a separate type (JLONG)\n * for internal use, which ensures that internal behavior will always be the\n * same regardless of any external headers that may be included.\n */\n\n#ifndef XMD_H                   /* X11/xmd.h correctly defines INT32 */\n#ifndef _BASETSD_H_\t\t/* Microsoft defines it in basetsd.h */\n#ifndef _BASETSD_H\t\t/* MinGW is slightly different */\n#ifndef QGLOBAL_H\t\t/* Qt defines it in qglobal.h */\ntypedef long INT32;\n#endif\n#endif\n#endif\n#endif\n\n/* Datatype used for image dimensions.  The JPEG standard only supports\n * images up to 64K*64K due to 16-bit fields in SOF markers.  Therefore\n * \"unsigned int\" is sufficient on all machines.  However, if you need to\n * handle larger images and you don't mind deviating from the spec, you\n * can change this datatype.  (Note that changing this datatype will\n * potentially require modifying the SIMD code.  The x86-64 SIMD extensions,\n * in particular, assume a 32-bit JDIMENSION.)\n */\n\ntypedef unsigned int JDIMENSION;\n\n#define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */\n\n\n/* These macros are used in all function definitions and extern declarations.\n * You could modify them if you need to change function linkage conventions;\n * in particular, you'll need to do that to make the library a Windows DLL.\n * Another application is to make all functions global for use with debuggers\n * or code profilers that require it.\n */\n\n/* a function called through method pointers: */\n#define METHODDEF(type)         static type\n/* a function used only in its module: */\n#define LOCAL(type)             static type\n/* a function referenced thru EXTERNs: */\n#define GLOBAL(type)            type\n/* a reference to a GLOBAL function: */\n#define EXTERN(type)            extern type\n\n\n/* Originally, this macro was used as a way of defining function prototypes\n * for both modern compilers as well as older compilers that did not support\n * prototype parameters.  libjpeg-turbo has never supported these older,\n * non-ANSI compilers, but the macro is still included because there is some\n * software out there that uses it.\n */\n\n#define JMETHOD(type,methodname,arglist)  type (*methodname) arglist\n\n\n/* libjpeg-turbo no longer supports platforms that have far symbols (MS-DOS),\n * but again, some software relies on this macro.\n */\n\n#undef FAR\n#define FAR\n\n\n/*\n * On a few systems, type boolean and/or its values FALSE, TRUE may appear\n * in standard header files.  Or you may have conflicts with application-\n * specific header files that you want to include together with these files.\n * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.\n */\n\n#ifndef HAVE_BOOLEAN\ntypedef int boolean;\n#endif\n#ifndef FALSE                   /* in case these macros already exist */\n#define FALSE   0               /* values of boolean */\n#endif\n#ifndef TRUE\n#define TRUE    1\n#endif\n\n\n/*\n * The remaining options affect code selection within the JPEG library,\n * but they don't need to be visible to most applications using the library.\n * To minimize application namespace pollution, the symbols won't be\n * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.\n */\n\n#ifdef JPEG_INTERNALS\n#define JPEG_INTERNAL_OPTIONS\n#endif\n\n#ifdef JPEG_INTERNAL_OPTIONS\n\n\n/*\n * These defines indicate whether to include various optional functions.\n * Undefining some of these symbols will produce a smaller but less capable\n * library.  Note that you can leave certain source files out of the\n * compilation/linking process if you've #undef'd the corresponding symbols.\n * (You may HAVE to do that if your compiler doesn't like null source files.)\n */\n\n/* Capability options common to encoder and decoder: */\n\n#define DCT_ISLOW_SUPPORTED     /* slow but accurate integer algorithm */\n#define DCT_IFAST_SUPPORTED     /* faster, less accurate integer method */\n#define DCT_FLOAT_SUPPORTED     /* floating-point: accurate, fast on fast HW */\n\n/* Encoder capability options: */\n\n#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define C_PROGRESSIVE_SUPPORTED     /* Progressive JPEG? (Requires MULTISCAN)*/\n#define ENTROPY_OPT_SUPPORTED       /* Optimization of entropy coding parms? */\n/* Note: if you selected 12-bit data precision, it is dangerous to turn off\n * ENTROPY_OPT_SUPPORTED.  The standard Huffman tables are only good for 8-bit\n * precision, so jchuff.c normally uses entropy optimization to compute\n * usable tables for higher precision.  If you don't want to do optimization,\n * you'll have to supply different default Huffman tables.\n * The exact same statements apply for progressive JPEG: the default tables\n * don't work for progressive mode.  (This may get fixed, however.)\n */\n#define INPUT_SMOOTHING_SUPPORTED   /* Input image smoothing option? */\n\n/* Decoder capability options: */\n\n#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define D_PROGRESSIVE_SUPPORTED     /* Progressive JPEG? (Requires MULTISCAN)*/\n#define SAVE_MARKERS_SUPPORTED      /* jpeg_save_markers() needed? */\n#define BLOCK_SMOOTHING_SUPPORTED   /* Block smoothing? (Progressive only) */\n#define IDCT_SCALING_SUPPORTED      /* Output rescaling via IDCT? */\n#undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */\n#define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */\n#define QUANT_1PASS_SUPPORTED       /* 1-pass color quantization? */\n#define QUANT_2PASS_SUPPORTED       /* 2-pass color quantization? */\n\n/* more capability options later, no doubt */\n\n\n/*\n * The RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE macros are a vestigial\n * feature of libjpeg.  The idea was that, if an application developer needed\n * to compress from/decompress to a BGR/BGRX/RGBX/XBGR/XRGB buffer, they could\n * change these macros, rebuild libjpeg, and link their application statically\n * with it.  In reality, few people ever did this, because there were some\n * severe restrictions involved (cjpeg and djpeg no longer worked properly,\n * compressing/decompressing RGB JPEGs no longer worked properly, and the color\n * quantizer wouldn't work with pixel sizes other than 3.)  Further, since all\n * of the O/S-supplied versions of libjpeg were built with the default values\n * of RGB_RED, RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE, many applications have\n * come to regard these values as immutable.\n *\n * The libjpeg-turbo colorspace extensions provide a much cleaner way of\n * compressing from/decompressing to buffers with arbitrary component orders\n * and pixel sizes.  Thus, we do not support changing the values of RGB_RED,\n * RGB_GREEN, RGB_BLUE, or RGB_PIXELSIZE.  In addition to the restrictions\n * listed above, changing these values will also break the SIMD extensions and\n * the regression tests.\n */\n\n#define RGB_RED         0       /* Offset of Red in an RGB scanline element */\n#define RGB_GREEN       1       /* Offset of Green */\n#define RGB_BLUE        2       /* Offset of Blue */\n#define RGB_PIXELSIZE   3       /* JSAMPLEs per RGB scanline element */\n\n#define JPEG_NUMCS 17\n\n#define EXT_RGB_RED        0\n#define EXT_RGB_GREEN      1\n#define EXT_RGB_BLUE       2\n#define EXT_RGB_PIXELSIZE  3\n\n#define EXT_RGBX_RED       0\n#define EXT_RGBX_GREEN     1\n#define EXT_RGBX_BLUE      2\n#define EXT_RGBX_PIXELSIZE 4\n\n#define EXT_BGR_RED        2\n#define EXT_BGR_GREEN      1\n#define EXT_BGR_BLUE       0\n#define EXT_BGR_PIXELSIZE  3\n\n#define EXT_BGRX_RED       2\n#define EXT_BGRX_GREEN     1\n#define EXT_BGRX_BLUE      0\n#define EXT_BGRX_PIXELSIZE 4\n\n#define EXT_XBGR_RED       3\n#define EXT_XBGR_GREEN     2\n#define EXT_XBGR_BLUE      1\n#define EXT_XBGR_PIXELSIZE 4\n\n#define EXT_XRGB_RED       1\n#define EXT_XRGB_GREEN     2\n#define EXT_XRGB_BLUE      3\n#define EXT_XRGB_PIXELSIZE 4\n\nstatic const int rgb_red[JPEG_NUMCS] = {\n  -1, -1, RGB_RED, -1, -1, -1, EXT_RGB_RED, EXT_RGBX_RED,\n  EXT_BGR_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED,\n  EXT_RGBX_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED,\n  -1\n};\n\nstatic const int rgb_green[JPEG_NUMCS] = {\n  -1, -1, RGB_GREEN, -1, -1, -1, EXT_RGB_GREEN, EXT_RGBX_GREEN,\n  EXT_BGR_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN,\n  EXT_RGBX_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN,\n  -1\n};\n\nstatic const int rgb_blue[JPEG_NUMCS] = {\n  -1, -1, RGB_BLUE, -1, -1, -1, EXT_RGB_BLUE, EXT_RGBX_BLUE,\n  EXT_BGR_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE,\n  EXT_RGBX_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE,\n  -1\n};\n\nstatic const int rgb_pixelsize[JPEG_NUMCS] = {\n  -1, -1, RGB_PIXELSIZE, -1, -1, -1, EXT_RGB_PIXELSIZE, EXT_RGBX_PIXELSIZE,\n  EXT_BGR_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE,\n  EXT_RGBX_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE,\n  -1\n};\n\n/* Definitions for speed-related optimizations. */\n\n/* On some machines (notably 68000 series) \"int\" is 32 bits, but multiplying\n * two 16-bit shorts is faster than multiplying two ints.  Define MULTIPLIER\n * as short on such a machine.  MULTIPLIER must be at least 16 bits wide.\n */\n\n#ifndef MULTIPLIER\n#ifndef WITH_SIMD\n#define MULTIPLIER  int         /* type for fastest integer multiply */\n#else\n#define MULTIPLIER short  /* prefer 16-bit with SIMD for parellelism */\n#endif\n#endif\n\n\n/* FAST_FLOAT should be either float or double, whichever is done faster\n * by your compiler.  (Note that this type is only used in the floating point\n * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)\n */\n\n#ifndef FAST_FLOAT\n#define FAST_FLOAT  float\n#endif\n\n#endif /* JPEG_INTERNAL_OPTIONS */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jpeg_nbits_table.h",
    "content": "static const unsigned char jpeg_nbits_table[65536] = {\n   0,  1,  2,  2,  3,  3,  3,  3,  4,  4,  4,  4,  4,  4,  4,  4,\n   5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,\n   6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,\n   6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,\n   7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,\n   7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,\n   7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,\n   7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16\n};\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jpegcomp.h",
    "content": "/*\n * jpegcomp.h\n *\n * Copyright (C) 2010, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * JPEG compatibility macros\n * These declarations are considered internal to the JPEG library; most\n * applications using the library shouldn't need to include this file.\n */\n\n#if JPEG_LIB_VERSION >= 70\n#define _DCT_scaled_size DCT_h_scaled_size\n#define _DCT_h_scaled_size DCT_h_scaled_size\n#define _DCT_v_scaled_size DCT_v_scaled_size\n#define _min_DCT_scaled_size min_DCT_h_scaled_size\n#define _min_DCT_h_scaled_size min_DCT_h_scaled_size\n#define _min_DCT_v_scaled_size min_DCT_v_scaled_size\n#define _jpeg_width jpeg_width\n#define _jpeg_height jpeg_height\n#else\n#define _DCT_scaled_size DCT_scaled_size\n#define _DCT_h_scaled_size DCT_scaled_size\n#define _DCT_v_scaled_size DCT_scaled_size\n#define _min_DCT_scaled_size min_DCT_scaled_size\n#define _min_DCT_h_scaled_size min_DCT_scaled_size\n#define _min_DCT_v_scaled_size min_DCT_scaled_size\n#define _jpeg_width image_width\n#define _jpeg_height image_height\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jpegint.h",
    "content": "/*\n * jpegint.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 1997-2009 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2015-2016, D. R. Commander.\n * Copyright (C) 2015, Google, Inc.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file provides common declarations for the various JPEG modules.\n * These declarations are considered internal to the JPEG library; most\n * applications using the library shouldn't need to include this file.\n */\n\n\n/* Declarations for both compression & decompression */\n\ntypedef enum {            /* Operating modes for buffer controllers */\n  JBUF_PASS_THRU,         /* Plain stripwise operation */\n  /* Remaining modes require a full-image buffer to have been created */\n  JBUF_SAVE_SOURCE,       /* Run source subobject only, save output */\n  JBUF_CRANK_DEST,        /* Run dest subobject only, using saved data */\n  JBUF_SAVE_AND_PASS      /* Run both subobjects, save output */\n} J_BUF_MODE;\n\n/* Values of global_state field (jdapi.c has some dependencies on ordering!) */\n#define CSTATE_START    100     /* after create_compress */\n#define CSTATE_SCANNING 101     /* start_compress done, write_scanlines OK */\n#define CSTATE_RAW_OK   102     /* start_compress done, write_raw_data OK */\n#define CSTATE_WRCOEFS  103     /* jpeg_write_coefficients done */\n#define DSTATE_START    200     /* after create_decompress */\n#define DSTATE_INHEADER 201     /* reading header markers, no SOS yet */\n#define DSTATE_READY    202     /* found SOS, ready for start_decompress */\n#define DSTATE_PRELOAD  203     /* reading multiscan file in start_decompress*/\n#define DSTATE_PRESCAN  204     /* performing dummy pass for 2-pass quant */\n#define DSTATE_SCANNING 205     /* start_decompress done, read_scanlines OK */\n#define DSTATE_RAW_OK   206     /* start_decompress done, read_raw_data OK */\n#define DSTATE_BUFIMAGE 207     /* expecting jpeg_start_output */\n#define DSTATE_BUFPOST  208     /* looking for SOS/EOI in jpeg_finish_output */\n#define DSTATE_RDCOEFS  209     /* reading file in jpeg_read_coefficients */\n#define DSTATE_STOPPING 210     /* looking for EOI in jpeg_finish_decompress */\n\n\n/* JLONG must hold at least signed 32-bit values. */\ntypedef long JLONG;\n\n\n/*\n * Left shift macro that handles a negative operand without causing any\n * sanitizer warnings\n */\n\n#define LEFT_SHIFT(a, b) ((JLONG)((unsigned long)(a) << (b)))\n\n\n/* Declarations for compression modules */\n\n/* Master control module */\nstruct jpeg_comp_master {\n  void (*prepare_for_pass) (j_compress_ptr cinfo);\n  void (*pass_startup) (j_compress_ptr cinfo);\n  void (*finish_pass) (j_compress_ptr cinfo);\n\n  /* State variables made visible to other modules */\n  boolean call_pass_startup;    /* True if pass_startup must be called */\n  boolean is_last_pass;         /* True during last pass */\n};\n\n/* Main buffer control (downsampled-data buffer) */\nstruct jpeg_c_main_controller {\n  void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode);\n  void (*process_data) (j_compress_ptr cinfo, JSAMPARRAY input_buf,\n                        JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail);\n};\n\n/* Compression preprocessing (downsampling input buffer control) */\nstruct jpeg_c_prep_controller {\n  void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode);\n  void (*pre_process_data) (j_compress_ptr cinfo, JSAMPARRAY input_buf,\n                            JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail,\n                            JSAMPIMAGE output_buf,\n                            JDIMENSION *out_row_group_ctr,\n                            JDIMENSION out_row_groups_avail);\n};\n\n/* Coefficient buffer control */\nstruct jpeg_c_coef_controller {\n  void (*start_pass) (j_compress_ptr cinfo, J_BUF_MODE pass_mode);\n  boolean (*compress_data) (j_compress_ptr cinfo, JSAMPIMAGE input_buf);\n};\n\n/* Colorspace conversion */\nstruct jpeg_color_converter {\n  void (*start_pass) (j_compress_ptr cinfo);\n  void (*color_convert) (j_compress_ptr cinfo, JSAMPARRAY input_buf,\n                         JSAMPIMAGE output_buf, JDIMENSION output_row,\n                         int num_rows);\n};\n\n/* Downsampling */\nstruct jpeg_downsampler {\n  void (*start_pass) (j_compress_ptr cinfo);\n  void (*downsample) (j_compress_ptr cinfo, JSAMPIMAGE input_buf,\n                      JDIMENSION in_row_index, JSAMPIMAGE output_buf,\n                      JDIMENSION out_row_group_index);\n\n  boolean need_context_rows;    /* TRUE if need rows above & below */\n};\n\n/* Forward DCT (also controls coefficient quantization) */\nstruct jpeg_forward_dct {\n  void (*start_pass) (j_compress_ptr cinfo);\n  /* perhaps this should be an array??? */\n  void (*forward_DCT) (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                       JSAMPARRAY sample_data, JBLOCKROW coef_blocks,\n                       JDIMENSION start_row, JDIMENSION start_col,\n                       JDIMENSION num_blocks);\n};\n\n/* Entropy encoding */\nstruct jpeg_entropy_encoder {\n  void (*start_pass) (j_compress_ptr cinfo, boolean gather_statistics);\n  boolean (*encode_mcu) (j_compress_ptr cinfo, JBLOCKROW *MCU_data);\n  void (*finish_pass) (j_compress_ptr cinfo);\n};\n\n/* Marker writing */\nstruct jpeg_marker_writer {\n  void (*write_file_header) (j_compress_ptr cinfo);\n  void (*write_frame_header) (j_compress_ptr cinfo);\n  void (*write_scan_header) (j_compress_ptr cinfo);\n  void (*write_file_trailer) (j_compress_ptr cinfo);\n  void (*write_tables_only) (j_compress_ptr cinfo);\n  /* These routines are exported to allow insertion of extra markers */\n  /* Probably only COM and APPn markers should be written this way */\n  void (*write_marker_header) (j_compress_ptr cinfo, int marker,\n                               unsigned int datalen);\n  void (*write_marker_byte) (j_compress_ptr cinfo, int val);\n};\n\n\n/* Declarations for decompression modules */\n\n/* Master control module */\nstruct jpeg_decomp_master {\n  void (*prepare_for_output_pass) (j_decompress_ptr cinfo);\n  void (*finish_output_pass) (j_decompress_ptr cinfo);\n\n  /* State variables made visible to other modules */\n  boolean is_dummy_pass;        /* True during 1st pass for 2-pass quant */\n\n  /* Partial decompression variables */\n  JDIMENSION first_iMCU_col;\n  JDIMENSION last_iMCU_col;\n  JDIMENSION first_MCU_col[MAX_COMPS_IN_SCAN];\n  JDIMENSION last_MCU_col[MAX_COMPS_IN_SCAN];\n  boolean jinit_upsampler_no_alloc;\n};\n\n/* Input control module */\nstruct jpeg_input_controller {\n  int (*consume_input) (j_decompress_ptr cinfo);\n  void (*reset_input_controller) (j_decompress_ptr cinfo);\n  void (*start_input_pass) (j_decompress_ptr cinfo);\n  void (*finish_input_pass) (j_decompress_ptr cinfo);\n\n  /* State variables made visible to other modules */\n  boolean has_multiple_scans;   /* True if file has multiple scans */\n  boolean eoi_reached;          /* True when EOI has been consumed */\n};\n\n/* Main buffer control (downsampled-data buffer) */\nstruct jpeg_d_main_controller {\n  void (*start_pass) (j_decompress_ptr cinfo, J_BUF_MODE pass_mode);\n  void (*process_data) (j_decompress_ptr cinfo, JSAMPARRAY output_buf,\n                        JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);\n};\n\n/* Coefficient buffer control */\nstruct jpeg_d_coef_controller {\n  void (*start_input_pass) (j_decompress_ptr cinfo);\n  int (*consume_data) (j_decompress_ptr cinfo);\n  void (*start_output_pass) (j_decompress_ptr cinfo);\n  int (*decompress_data) (j_decompress_ptr cinfo, JSAMPIMAGE output_buf);\n  /* Pointer to array of coefficient virtual arrays, or NULL if none */\n  jvirt_barray_ptr *coef_arrays;\n};\n\n/* Decompression postprocessing (color quantization buffer control) */\nstruct jpeg_d_post_controller {\n  void (*start_pass) (j_decompress_ptr cinfo, J_BUF_MODE pass_mode);\n  void (*post_process_data) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,\n                             JDIMENSION *in_row_group_ctr,\n                             JDIMENSION in_row_groups_avail,\n                             JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n                             JDIMENSION out_rows_avail);\n};\n\n/* Marker reading & parsing */\nstruct jpeg_marker_reader {\n  void (*reset_marker_reader) (j_decompress_ptr cinfo);\n  /* Read markers until SOS or EOI.\n   * Returns same codes as are defined for jpeg_consume_input:\n   * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.\n   */\n  int (*read_markers) (j_decompress_ptr cinfo);\n  /* Read a restart marker --- exported for use by entropy decoder only */\n  jpeg_marker_parser_method read_restart_marker;\n\n  /* State of marker reader --- nominally internal, but applications\n   * supplying COM or APPn handlers might like to know the state.\n   */\n  boolean saw_SOI;              /* found SOI? */\n  boolean saw_SOF;              /* found SOF? */\n  int next_restart_num;         /* next restart number expected (0-7) */\n  unsigned int discarded_bytes; /* # of bytes skipped looking for a marker */\n};\n\n/* Entropy decoding */\nstruct jpeg_entropy_decoder {\n  void (*start_pass) (j_decompress_ptr cinfo);\n  boolean (*decode_mcu) (j_decompress_ptr cinfo, JBLOCKROW *MCU_data);\n\n  /* This is here to share code between baseline and progressive decoders; */\n  /* other modules probably should not use it */\n  boolean insufficient_data;    /* set TRUE after emitting warning */\n};\n\n/* Inverse DCT (also performs dequantization) */\ntypedef void (*inverse_DCT_method_ptr) (j_decompress_ptr cinfo,\n                                        jpeg_component_info *compptr,\n                                        JCOEFPTR coef_block,\n                                        JSAMPARRAY output_buf,\n                                        JDIMENSION output_col);\n\nstruct jpeg_inverse_dct {\n  void (*start_pass) (j_decompress_ptr cinfo);\n  /* It is useful to allow each component to have a separate IDCT method. */\n  inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];\n};\n\n/* Upsampling (note that upsampler must also call color converter) */\nstruct jpeg_upsampler {\n  void (*start_pass) (j_decompress_ptr cinfo);\n  void (*upsample) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,\n                    JDIMENSION *in_row_group_ctr,\n                    JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf,\n                    JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail);\n\n  boolean need_context_rows;    /* TRUE if need rows above & below */\n};\n\n/* Colorspace conversion */\nstruct jpeg_color_deconverter {\n  void (*start_pass) (j_decompress_ptr cinfo);\n  void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,\n                         JDIMENSION input_row, JSAMPARRAY output_buf,\n                         int num_rows);\n};\n\n/* Color quantization or color precision reduction */\nstruct jpeg_color_quantizer {\n  void (*start_pass) (j_decompress_ptr cinfo, boolean is_pre_scan);\n  void (*color_quantize) (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n                          JSAMPARRAY output_buf, int num_rows);\n  void (*finish_pass) (j_decompress_ptr cinfo);\n  void (*new_color_map) (j_decompress_ptr cinfo);\n};\n\n\n/* Miscellaneous useful macros */\n\n#undef MAX\n#define MAX(a,b)        ((a) > (b) ? (a) : (b))\n#undef MIN\n#define MIN(a,b)        ((a) < (b) ? (a) : (b))\n\n\n/* We assume that right shift corresponds to signed division by 2 with\n * rounding towards minus infinity.  This is correct for typical \"arithmetic\n * shift\" instructions that shift in copies of the sign bit.  But some\n * C compilers implement >> with an unsigned shift.  For these machines you\n * must define RIGHT_SHIFT_IS_UNSIGNED.\n * RIGHT_SHIFT provides a proper signed right shift of a JLONG quantity.\n * It is only applied with constant shift counts.  SHIFT_TEMPS must be\n * included in the variables of any routine using RIGHT_SHIFT.\n */\n\n#ifdef RIGHT_SHIFT_IS_UNSIGNED\n#define SHIFT_TEMPS     JLONG shift_temp;\n#define RIGHT_SHIFT(x,shft)  \\\n        ((shift_temp = (x)) < 0 ? \\\n         (shift_temp >> (shft)) | ((~((JLONG) 0)) << (32-(shft))) : \\\n         (shift_temp >> (shft)))\n#else\n#define SHIFT_TEMPS\n#define RIGHT_SHIFT(x,shft)     ((x) >> (shft))\n#endif\n\n\n/* Compression module initialization routines */\nEXTERN(void) jinit_compress_master (j_compress_ptr cinfo);\nEXTERN(void) jinit_c_master_control (j_compress_ptr cinfo,\n                                     boolean transcode_only);\nEXTERN(void) jinit_c_main_controller (j_compress_ptr cinfo,\n                                      boolean need_full_buffer);\nEXTERN(void) jinit_c_prep_controller (j_compress_ptr cinfo,\n                                      boolean need_full_buffer);\nEXTERN(void) jinit_c_coef_controller (j_compress_ptr cinfo,\n                                      boolean need_full_buffer);\nEXTERN(void) jinit_color_converter (j_compress_ptr cinfo);\nEXTERN(void) jinit_downsampler (j_compress_ptr cinfo);\nEXTERN(void) jinit_forward_dct (j_compress_ptr cinfo);\nEXTERN(void) jinit_huff_encoder (j_compress_ptr cinfo);\nEXTERN(void) jinit_phuff_encoder (j_compress_ptr cinfo);\nEXTERN(void) jinit_arith_encoder (j_compress_ptr cinfo);\nEXTERN(void) jinit_marker_writer (j_compress_ptr cinfo);\n/* Decompression module initialization routines */\nEXTERN(void) jinit_master_decompress (j_decompress_ptr cinfo);\nEXTERN(void) jinit_d_main_controller (j_decompress_ptr cinfo,\n                                      boolean need_full_buffer);\nEXTERN(void) jinit_d_coef_controller (j_decompress_ptr cinfo,\n                                      boolean need_full_buffer);\nEXTERN(void) jinit_d_post_controller (j_decompress_ptr cinfo,\n                                      boolean need_full_buffer);\nEXTERN(void) jinit_input_controller (j_decompress_ptr cinfo);\nEXTERN(void) jinit_marker_reader (j_decompress_ptr cinfo);\nEXTERN(void) jinit_huff_decoder (j_decompress_ptr cinfo);\nEXTERN(void) jinit_phuff_decoder (j_decompress_ptr cinfo);\nEXTERN(void) jinit_arith_decoder (j_decompress_ptr cinfo);\nEXTERN(void) jinit_inverse_dct (j_decompress_ptr cinfo);\nEXTERN(void) jinit_upsampler (j_decompress_ptr cinfo);\nEXTERN(void) jinit_color_deconverter (j_decompress_ptr cinfo);\nEXTERN(void) jinit_1pass_quantizer (j_decompress_ptr cinfo);\nEXTERN(void) jinit_2pass_quantizer (j_decompress_ptr cinfo);\nEXTERN(void) jinit_merged_upsampler (j_decompress_ptr cinfo);\n/* Memory manager initialization */\nEXTERN(void) jinit_memory_mgr (j_common_ptr cinfo);\n\n/* Utility routines in jutils.c */\nEXTERN(long) jdiv_round_up (long a, long b);\nEXTERN(long) jround_up (long a, long b);\nEXTERN(void) jcopy_sample_rows (JSAMPARRAY input_array, int source_row,\n                                JSAMPARRAY output_array, int dest_row,\n                                int num_rows, JDIMENSION num_cols);\nEXTERN(void) jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row,\n                              JDIMENSION num_blocks);\nEXTERN(void) jzero_far (void *target, size_t bytestozero);\n/* Constant tables in jutils.c */\n#if 0                           /* This table is not actually needed in v6a */\nextern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */\n#endif\nextern const int jpeg_natural_order[]; /* zigzag coef order to natural order */\n\n/* Arithmetic coding probability estimation tables in jaricom.c */\nextern const JLONG jpeg_aritab[];\n\n/* Suppress undefined-structure complaints if necessary. */\n\n#ifdef INCOMPLETE_TYPES_BROKEN\n#ifndef AM_MEMORY_MANAGER       /* only jmemmgr.c defines these */\nstruct jvirt_sarray_control { long dummy; };\nstruct jvirt_barray_control { long dummy; };\n#endif\n#endif /* INCOMPLETE_TYPES_BROKEN */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jpeglib.h",
    "content": "/*\n * jpeglib.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2002-2009 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander.\n * Copyright (C) 2015, Google, Inc.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file defines the application interface for the JPEG library.\n * Most applications using the library need only include this file,\n * and perhaps jerror.h if they want to know the exact error codes.\n */\n\n#ifndef JPEGLIB_H\n#define JPEGLIB_H\n\n/*\n * First we include the configuration files that record how this\n * installation of the JPEG library is set up.  jconfig.h can be\n * generated automatically for many systems.  jmorecfg.h contains\n * manual configuration options that most people need not worry about.\n */\n\n#ifndef JCONFIG_INCLUDED        /* in case jinclude.h already did */\n#include \"jconfig.h\"            /* widely used configuration options */\n#endif\n#include \"jmorecfg.h\"           /* seldom changed options */\n\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\nextern \"C\" {\n#endif\n#endif\n\n\n/* Various constants determining the sizes of things.\n * All of these are specified by the JPEG standard, so don't change them\n * if you want to be compatible.\n */\n\n#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */\n#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */\n#define NUM_QUANT_TBLS      4   /* Quantization tables are numbered 0..3 */\n#define NUM_HUFF_TBLS       4   /* Huffman tables are numbered 0..3 */\n#define NUM_ARITH_TBLS      16  /* Arith-coding tables are numbered 0..15 */\n#define MAX_COMPS_IN_SCAN   4   /* JPEG limit on # of components in one scan */\n#define MAX_SAMP_FACTOR     4   /* JPEG limit on sampling factors */\n/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;\n * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.\n * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU\n * to handle it.  We even let you do this from the jconfig.h file.  However,\n * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe\n * sometimes emits noncompliant files doesn't mean you should too.\n */\n#define C_MAX_BLOCKS_IN_MCU   10 /* compressor's limit on blocks per MCU */\n#ifndef D_MAX_BLOCKS_IN_MCU\n#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */\n#endif\n\n\n/* Data structures for images (arrays of samples and of DCT coefficients).\n */\n\ntypedef JSAMPLE *JSAMPROW;      /* ptr to one image row of pixel samples. */\ntypedef JSAMPROW *JSAMPARRAY;   /* ptr to some rows (a 2-D sample array) */\ntypedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */\n\ntypedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */\ntypedef JBLOCK *JBLOCKROW;      /* pointer to one row of coefficient blocks */\ntypedef JBLOCKROW *JBLOCKARRAY;         /* a 2-D array of coefficient blocks */\ntypedef JBLOCKARRAY *JBLOCKIMAGE;       /* a 3-D array of coefficient blocks */\n\ntypedef JCOEF *JCOEFPTR;        /* useful in a couple of places */\n\n\n/* Types for JPEG compression parameters and working tables. */\n\n\n/* DCT coefficient quantization tables. */\n\ntypedef struct {\n  /* This array gives the coefficient quantizers in natural array order\n   * (not the zigzag order in which they are stored in a JPEG DQT marker).\n   * CAUTION: IJG versions prior to v6a kept this array in zigzag order.\n   */\n  UINT16 quantval[DCTSIZE2];    /* quantization step for each coefficient */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;           /* TRUE when table has been output */\n} JQUANT_TBL;\n\n\n/* Huffman coding tables. */\n\ntypedef struct {\n  /* These two fields directly represent the contents of a JPEG DHT marker */\n  UINT8 bits[17];               /* bits[k] = # of symbols with codes of */\n                                /* length k bits; bits[0] is unused */\n  UINT8 huffval[256];           /* The symbols, in order of incr code length */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;           /* TRUE when table has been output */\n} JHUFF_TBL;\n\n\n/* Basic info about one component (color channel). */\n\ntypedef struct {\n  /* These values are fixed over the whole image. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOF marker. */\n  int component_id;             /* identifier for this component (0..255) */\n  int component_index;          /* its index in SOF or cinfo->comp_info[] */\n  int h_samp_factor;            /* horizontal sampling factor (1..4) */\n  int v_samp_factor;            /* vertical sampling factor (1..4) */\n  int quant_tbl_no;             /* quantization table selector (0..3) */\n  /* These values may vary between scans. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOS marker. */\n  /* The decompressor output side may not use these variables. */\n  int dc_tbl_no;                /* DC entropy table selector (0..3) */\n  int ac_tbl_no;                /* AC entropy table selector (0..3) */\n\n  /* Remaining fields should be treated as private by applications. */\n\n  /* These values are computed during compression or decompression startup: */\n  /* Component's size in DCT blocks.\n   * Any dummy blocks added to complete an MCU are not counted; therefore\n   * these values do not depend on whether a scan is interleaved or not.\n   */\n  JDIMENSION width_in_blocks;\n  JDIMENSION height_in_blocks;\n  /* Size of a DCT block in samples.  Always DCTSIZE for compression.\n   * For decompression this is the size of the output from one DCT block,\n   * reflecting any scaling we choose to apply during the IDCT step.\n   * Values from 1 to 16 are supported.\n   * Note that different components may receive different IDCT scalings.\n   */\n#if JPEG_LIB_VERSION >= 70\n  int DCT_h_scaled_size;\n  int DCT_v_scaled_size;\n#else\n  int DCT_scaled_size;\n#endif\n  /* The downsampled dimensions are the component's actual, unpadded number\n   * of samples at the main buffer (preprocessing/compression interface), thus\n   * downsampled_width = ceil(image_width * Hi/Hmax)\n   * and similarly for height.  For decompression, IDCT scaling is included, so\n   * downsampled_width = ceil(image_width * Hi/Hmax * DCT_[h_]scaled_size/DCTSIZE)\n   */\n  JDIMENSION downsampled_width;  /* actual width in samples */\n  JDIMENSION downsampled_height; /* actual height in samples */\n  /* This flag is used only for decompression.  In cases where some of the\n   * components will be ignored (eg grayscale output from YCbCr image),\n   * we can skip most computations for the unused components.\n   */\n  boolean component_needed;     /* do we need the value of this component? */\n\n  /* These values are computed before starting a scan of the component. */\n  /* The decompressor output side may not use these variables. */\n  int MCU_width;                /* number of blocks per MCU, horizontally */\n  int MCU_height;               /* number of blocks per MCU, vertically */\n  int MCU_blocks;               /* MCU_width * MCU_height */\n  int MCU_sample_width;         /* MCU width in samples, MCU_width*DCT_[h_]scaled_size */\n  int last_col_width;           /* # of non-dummy blocks across in last MCU */\n  int last_row_height;          /* # of non-dummy blocks down in last MCU */\n\n  /* Saved quantization table for component; NULL if none yet saved.\n   * See jdinput.c comments about the need for this information.\n   * This field is currently used only for decompression.\n   */\n  JQUANT_TBL *quant_table;\n\n  /* Private per-component storage for DCT or IDCT subsystem. */\n  void *dct_table;\n} jpeg_component_info;\n\n\n/* The script for encoding a multiple-scan file is an array of these: */\n\ntypedef struct {\n  int comps_in_scan;            /* number of components encoded in this scan */\n  int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */\n  int Ss, Se;                   /* progressive JPEG spectral selection parms */\n  int Ah, Al;                   /* progressive JPEG successive approx. parms */\n} jpeg_scan_info;\n\n/* The decompressor can save APPn and COM markers in a list of these: */\n\ntypedef struct jpeg_marker_struct *jpeg_saved_marker_ptr;\n\nstruct jpeg_marker_struct {\n  jpeg_saved_marker_ptr next;   /* next in list, or NULL */\n  UINT8 marker;                 /* marker code: JPEG_COM, or JPEG_APP0+n */\n  unsigned int original_length; /* # bytes of data in the file */\n  unsigned int data_length;     /* # bytes of data saved at data[] */\n  JOCTET *data;                 /* the data contained in the marker */\n  /* the marker length word is not counted in data_length or original_length */\n};\n\n/* Known color spaces. */\n\n#define JCS_EXTENSIONS 1\n#define JCS_ALPHA_EXTENSIONS 1\n\ntypedef enum {\n  JCS_UNKNOWN,            /* error/unspecified */\n  JCS_GRAYSCALE,          /* monochrome */\n  JCS_RGB,                /* red/green/blue as specified by the RGB_RED,\n                             RGB_GREEN, RGB_BLUE, and RGB_PIXELSIZE macros */\n  JCS_YCbCr,              /* Y/Cb/Cr (also known as YUV) */\n  JCS_CMYK,               /* C/M/Y/K */\n  JCS_YCCK,               /* Y/Cb/Cr/K */\n  JCS_EXT_RGB,            /* red/green/blue */\n  JCS_EXT_RGBX,           /* red/green/blue/x */\n  JCS_EXT_BGR,            /* blue/green/red */\n  JCS_EXT_BGRX,           /* blue/green/red/x */\n  JCS_EXT_XBGR,           /* x/blue/green/red */\n  JCS_EXT_XRGB,           /* x/red/green/blue */\n  /* When out_color_space it set to JCS_EXT_RGBX, JCS_EXT_BGRX, JCS_EXT_XBGR,\n     or JCS_EXT_XRGB during decompression, the X byte is undefined, and in\n     order to ensure the best performance, libjpeg-turbo can set that byte to\n     whatever value it wishes.  Use the following colorspace constants to\n     ensure that the X byte is set to 0xFF, so that it can be interpreted as an\n     opaque alpha channel. */\n  JCS_EXT_RGBA,           /* red/green/blue/alpha */\n  JCS_EXT_BGRA,           /* blue/green/red/alpha */\n  JCS_EXT_ABGR,           /* alpha/blue/green/red */\n  JCS_EXT_ARGB,           /* alpha/red/green/blue */\n  JCS_RGB565              /* 5-bit red/6-bit green/5-bit blue */\n} J_COLOR_SPACE;\n\n/* DCT/IDCT algorithm options. */\n\ntypedef enum {\n  JDCT_ISLOW,             /* slow but accurate integer algorithm */\n  JDCT_IFAST,             /* faster, less accurate integer method */\n  JDCT_FLOAT              /* floating-point: accurate, fast on fast HW */\n} J_DCT_METHOD;\n\n#ifndef JDCT_DEFAULT            /* may be overridden in jconfig.h */\n#define JDCT_DEFAULT  JDCT_ISLOW\n#endif\n#ifndef JDCT_FASTEST            /* may be overridden in jconfig.h */\n#define JDCT_FASTEST  JDCT_IFAST\n#endif\n\n/* Dithering options for decompression. */\n\ntypedef enum {\n  JDITHER_NONE,           /* no dithering */\n  JDITHER_ORDERED,        /* simple ordered dither */\n  JDITHER_FS              /* Floyd-Steinberg error diffusion dither */\n} J_DITHER_MODE;\n\n\n/* Common fields between JPEG compression and decompression master structs. */\n\n#define jpeg_common_fields \\\n  struct jpeg_error_mgr *err;   /* Error handler module */\\\n  struct jpeg_memory_mgr *mem;  /* Memory manager module */\\\n  struct jpeg_progress_mgr *progress; /* Progress monitor, or NULL if none */\\\n  void *client_data;            /* Available for use by application */\\\n  boolean is_decompressor;      /* So common code can tell which is which */\\\n  int global_state              /* For checking call sequence validity */\n\n/* Routines that are to be used by both halves of the library are declared\n * to receive a pointer to this structure.  There are no actual instances of\n * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.\n */\nstruct jpeg_common_struct {\n  jpeg_common_fields;           /* Fields common to both master struct types */\n  /* Additional fields follow in an actual jpeg_compress_struct or\n   * jpeg_decompress_struct.  All three structs must agree on these\n   * initial fields!  (This would be a lot cleaner in C++.)\n   */\n};\n\ntypedef struct jpeg_common_struct *j_common_ptr;\ntypedef struct jpeg_compress_struct *j_compress_ptr;\ntypedef struct jpeg_decompress_struct *j_decompress_ptr;\n\n\n/* Master record for a compression instance */\n\nstruct jpeg_compress_struct {\n  jpeg_common_fields;           /* Fields shared with jpeg_decompress_struct */\n\n  /* Destination for compressed data */\n  struct jpeg_destination_mgr *dest;\n\n  /* Description of source image --- these fields must be filled in by\n   * outer application before starting compression.  in_color_space must\n   * be correct before you can even call jpeg_set_defaults().\n   */\n\n  JDIMENSION image_width;       /* input image width */\n  JDIMENSION image_height;      /* input image height */\n  int input_components;         /* # of color components in input image */\n  J_COLOR_SPACE in_color_space; /* colorspace of input image */\n\n  double input_gamma;           /* image gamma of input image */\n\n  /* Compression parameters --- these fields must be set before calling\n   * jpeg_start_compress().  We recommend calling jpeg_set_defaults() to\n   * initialize everything to reasonable defaults, then changing anything\n   * the application specifically wants to change.  That way you won't get\n   * burnt when new parameters are added.  Also note that there are several\n   * helper routines to simplify changing parameters.\n   */\n\n#if JPEG_LIB_VERSION >= 70\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  JDIMENSION jpeg_width;        /* scaled JPEG image width */\n  JDIMENSION jpeg_height;       /* scaled JPEG image height */\n  /* Dimensions of actual JPEG image that will be written to file,\n   * derived from input dimensions by scaling factors above.\n   * These fields are computed by jpeg_start_compress().\n   * You can also use jpeg_calc_jpeg_dimensions() to determine these values\n   * in advance of calling jpeg_start_compress().\n   */\n#endif\n\n  int data_precision;           /* bits of precision in image data */\n\n  int num_components;           /* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  jpeg_component_info *comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n  JQUANT_TBL *quant_tbl_ptrs[NUM_QUANT_TBLS];\n#if JPEG_LIB_VERSION >= 70\n  int q_scale_factor[NUM_QUANT_TBLS];\n#endif\n  /* ptrs to coefficient quantization tables, or NULL if not defined,\n   * and corresponding scale factors (percentage, initialized 100).\n   */\n\n  JHUFF_TBL *dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL *ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  int num_scans;                /* # of entries in scan_info array */\n  const jpeg_scan_info *scan_info; /* script for multi-scan file, or NULL */\n  /* The default value of scan_info is NULL, which causes a single-scan\n   * sequential JPEG file to be emitted.  To create a multi-scan file,\n   * set num_scans and scan_info to point to an array of scan definitions.\n   */\n\n  boolean raw_data_in;          /* TRUE=caller supplies downsampled data */\n  boolean arith_code;           /* TRUE=arithmetic coding, FALSE=Huffman */\n  boolean optimize_coding;      /* TRUE=optimize entropy encoding parms */\n  boolean CCIR601_sampling;     /* TRUE=first samples are cosited */\n#if JPEG_LIB_VERSION >= 70\n  boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */\n#endif\n  int smoothing_factor;         /* 1..100, or 0 for no input smoothing */\n  J_DCT_METHOD dct_method;      /* DCT algorithm selector */\n\n  /* The restart interval can be specified in absolute MCUs by setting\n   * restart_interval, or in MCU rows by setting restart_in_rows\n   * (in which case the correct restart_interval will be figured\n   * for each scan).\n   */\n  unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */\n  int restart_in_rows;          /* if > 0, MCU rows per restart interval */\n\n  /* Parameters controlling emission of special markers. */\n\n  boolean write_JFIF_header;    /* should a JFIF marker be written? */\n  UINT8 JFIF_major_version;     /* What to write for the JFIF version number */\n  UINT8 JFIF_minor_version;\n  /* These three values are not used by the JPEG code, merely copied */\n  /* into the JFIF APP0 marker.  density_unit can be 0 for unknown, */\n  /* 1 for dots/inch, or 2 for dots/cm.  Note that the pixel aspect */\n  /* ratio is defined by X_density/Y_density even when density_unit=0. */\n  UINT8 density_unit;           /* JFIF code for pixel size units */\n  UINT16 X_density;             /* Horizontal pixel density */\n  UINT16 Y_density;             /* Vertical pixel density */\n  boolean write_Adobe_marker;   /* should an Adobe marker be written? */\n\n  /* State variable: index of next scanline to be written to\n   * jpeg_write_scanlines().  Application may use this to control its\n   * processing loop, e.g., \"while (next_scanline < image_height)\".\n   */\n\n  JDIMENSION next_scanline;     /* 0 .. image_height-1  */\n\n  /* Remaining fields are known throughout compressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during compression startup\n   */\n  boolean progressive_mode;     /* TRUE if scan script uses progressive mode */\n  int max_h_samp_factor;        /* largest h_samp_factor */\n  int max_v_samp_factor;        /* largest v_samp_factor */\n\n#if JPEG_LIB_VERSION >= 70\n  int min_DCT_h_scaled_size;    /* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;    /* smallest DCT_v_scaled_size of any component */\n#endif\n\n  JDIMENSION total_iMCU_rows;   /* # of iMCU rows to be input to coef ctlr */\n  /* The coefficient controller receives data in units of MCU rows as defined\n   * for fully interleaved scans (whether the JPEG file is interleaved or not).\n   * There are v_samp_factor * DCTSIZE sample rows of each component in an\n   * \"iMCU\" (interleaved MCU) row.\n   */\n\n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   */\n  int comps_in_scan;            /* # of JPEG components in this scan */\n  jpeg_component_info *cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n\n  JDIMENSION MCUs_per_row;      /* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;  /* # of MCU rows in the image */\n\n  int blocks_in_MCU;            /* # of DCT blocks per MCU */\n  int MCU_membership[C_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;           /* progressive JPEG parameters for scan */\n\n#if JPEG_LIB_VERSION >= 80\n  int block_size;               /* the basic DCT block size: 1..16 */\n  const int *natural_order;     /* natural-order position array */\n  int lim_Se;                   /* min( Se, DCTSIZE2-1 ) */\n#endif\n\n  /*\n   * Links to compression subobjects (methods and private variables of modules)\n   */\n  struct jpeg_comp_master *master;\n  struct jpeg_c_main_controller *main;\n  struct jpeg_c_prep_controller *prep;\n  struct jpeg_c_coef_controller *coef;\n  struct jpeg_marker_writer *marker;\n  struct jpeg_color_converter *cconvert;\n  struct jpeg_downsampler *downsample;\n  struct jpeg_forward_dct *fdct;\n  struct jpeg_entropy_encoder *entropy;\n  jpeg_scan_info *script_space; /* workspace for jpeg_simple_progression */\n  int script_space_size;\n};\n\n\n/* Master record for a decompression instance */\n\nstruct jpeg_decompress_struct {\n  jpeg_common_fields;           /* Fields shared with jpeg_compress_struct */\n\n  /* Source of compressed data */\n  struct jpeg_source_mgr *src;\n\n  /* Basic description of image --- filled in by jpeg_read_header(). */\n  /* Application may inspect these values to decide how to process image. */\n\n  JDIMENSION image_width;       /* nominal image width (from SOF marker) */\n  JDIMENSION image_height;      /* nominal image height */\n  int num_components;           /* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  /* Decompression processing parameters --- these fields must be set before\n   * calling jpeg_start_decompress().  Note that jpeg_read_header() initializes\n   * them to default values.\n   */\n\n  J_COLOR_SPACE out_color_space; /* colorspace for output */\n\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  double output_gamma;          /* image gamma wanted in output */\n\n  boolean buffered_image;       /* TRUE=multiple output passes */\n  boolean raw_data_out;         /* TRUE=downsampled data wanted */\n\n  J_DCT_METHOD dct_method;      /* IDCT algorithm selector */\n  boolean do_fancy_upsampling;  /* TRUE=apply fancy upsampling */\n  boolean do_block_smoothing;   /* TRUE=apply interblock smoothing */\n\n  boolean quantize_colors;      /* TRUE=colormapped output wanted */\n  /* the following are ignored if not quantize_colors: */\n  J_DITHER_MODE dither_mode;    /* type of color dithering to use */\n  boolean two_pass_quantize;    /* TRUE=use two-pass color quantization */\n  int desired_number_of_colors; /* max # colors to use in created colormap */\n  /* these are significant only in buffered-image mode: */\n  boolean enable_1pass_quant;   /* enable future use of 1-pass quantizer */\n  boolean enable_external_quant;/* enable future use of external colormap */\n  boolean enable_2pass_quant;   /* enable future use of 2-pass quantizer */\n\n  /* Description of actual output image that will be returned to application.\n   * These fields are computed by jpeg_start_decompress().\n   * You can also use jpeg_calc_output_dimensions() to determine these values\n   * in advance of calling jpeg_start_decompress().\n   */\n\n  JDIMENSION output_width;      /* scaled image width */\n  JDIMENSION output_height;     /* scaled image height */\n  int out_color_components;     /* # of color components in out_color_space */\n  int output_components;        /* # of color components returned */\n  /* output_components is 1 (a colormap index) when quantizing colors;\n   * otherwise it equals out_color_components.\n   */\n  int rec_outbuf_height;        /* min recommended height of scanline buffer */\n  /* If the buffer passed to jpeg_read_scanlines() is less than this many rows\n   * high, space and time will be wasted due to unnecessary data copying.\n   * Usually rec_outbuf_height will be 1 or 2, at most 4.\n   */\n\n  /* When quantizing colors, the output colormap is described by these fields.\n   * The application can supply a colormap by setting colormap non-NULL before\n   * calling jpeg_start_decompress; otherwise a colormap is created during\n   * jpeg_start_decompress or jpeg_start_output.\n   * The map has out_color_components rows and actual_number_of_colors columns.\n   */\n  int actual_number_of_colors;  /* number of entries in use */\n  JSAMPARRAY colormap;          /* The color map as a 2-D pixel array */\n\n  /* State variables: these variables indicate the progress of decompression.\n   * The application may examine these but must not modify them.\n   */\n\n  /* Row index of next scanline to be read from jpeg_read_scanlines().\n   * Application may use this to control its processing loop, e.g.,\n   * \"while (output_scanline < output_height)\".\n   */\n  JDIMENSION output_scanline;   /* 0 .. output_height-1  */\n\n  /* Current input scan number and number of iMCU rows completed in scan.\n   * These indicate the progress of the decompressor input side.\n   */\n  int input_scan_number;        /* Number of SOS markers seen so far */\n  JDIMENSION input_iMCU_row;    /* Number of iMCU rows completed */\n\n  /* The \"output scan number\" is the notional scan being displayed by the\n   * output side.  The decompressor will not allow output scan/row number\n   * to get ahead of input scan/row, but it can fall arbitrarily far behind.\n   */\n  int output_scan_number;       /* Nominal scan number being displayed */\n  JDIMENSION output_iMCU_row;   /* Number of iMCU rows read */\n\n  /* Current progression status.  coef_bits[c][i] indicates the precision\n   * with which component c's DCT coefficient i (in zigzag order) is known.\n   * It is -1 when no data has yet been received, otherwise it is the point\n   * transform (shift) value for the most recent scan of the coefficient\n   * (thus, 0 at completion of the progression).\n   * This pointer is NULL when reading a non-progressive file.\n   */\n  int (*coef_bits)[DCTSIZE2];   /* -1 or current Al value for each coef */\n\n  /* Internal JPEG parameters --- the application usually need not look at\n   * these fields.  Note that the decompressor output side may not use\n   * any parameters that can change between scans.\n   */\n\n  /* Quantization and Huffman tables are carried forward across input\n   * datastreams when processing abbreviated JPEG datastreams.\n   */\n\n  JQUANT_TBL *quant_tbl_ptrs[NUM_QUANT_TBLS];\n  /* ptrs to coefficient quantization tables, or NULL if not defined */\n\n  JHUFF_TBL *dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL *ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  /* These parameters are never carried across datastreams, since they\n   * are given in SOF/SOS markers or defined to be reset by SOI.\n   */\n\n  int data_precision;           /* bits of precision in image data */\n\n  jpeg_component_info *comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n#if JPEG_LIB_VERSION >= 80\n  boolean is_baseline;          /* TRUE if Baseline SOF0 encountered */\n#endif\n  boolean progressive_mode;     /* TRUE if SOFn specifies progressive mode */\n  boolean arith_code;           /* TRUE=arithmetic coding, FALSE=Huffman */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */\n\n  /* These fields record data obtained from optional markers recognized by\n   * the JPEG library.\n   */\n  boolean saw_JFIF_marker;      /* TRUE iff a JFIF APP0 marker was found */\n  /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */\n  UINT8 JFIF_major_version;     /* JFIF version number */\n  UINT8 JFIF_minor_version;\n  UINT8 density_unit;           /* JFIF code for pixel size units */\n  UINT16 X_density;             /* Horizontal pixel density */\n  UINT16 Y_density;             /* Vertical pixel density */\n  boolean saw_Adobe_marker;     /* TRUE iff an Adobe APP14 marker was found */\n  UINT8 Adobe_transform;        /* Color transform code from Adobe marker */\n\n  boolean CCIR601_sampling;     /* TRUE=first samples are cosited */\n\n  /* Aside from the specific data retained from APPn markers known to the\n   * library, the uninterpreted contents of any or all APPn and COM markers\n   * can be saved in a list for examination by the application.\n   */\n  jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */\n\n  /* Remaining fields are known throughout decompressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during decompression startup\n   */\n  int max_h_samp_factor;        /* largest h_samp_factor */\n  int max_v_samp_factor;        /* largest v_samp_factor */\n\n#if JPEG_LIB_VERSION >= 70\n  int min_DCT_h_scaled_size;    /* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;    /* smallest DCT_v_scaled_size of any component */\n#else\n  int min_DCT_scaled_size;      /* smallest DCT_scaled_size of any component */\n#endif\n\n  JDIMENSION total_iMCU_rows;   /* # of iMCU rows in image */\n  /* The coefficient controller's input and output progress is measured in\n   * units of \"iMCU\" (interleaved MCU) rows.  These are the same as MCU rows\n   * in fully interleaved JPEG scans, but are used whether the scan is\n   * interleaved or not.  We define an iMCU row as v_samp_factor DCT block\n   * rows of each component.  Therefore, the IDCT output contains\n   * v_samp_factor*DCT_[v_]scaled_size sample rows of a component per iMCU row.\n   */\n\n  JSAMPLE *sample_range_limit;  /* table for fast range-limiting */\n\n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   * Note that the decompressor output side must not use these fields.\n   */\n  int comps_in_scan;            /* # of JPEG components in this scan */\n  jpeg_component_info *cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n\n  JDIMENSION MCUs_per_row;      /* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;  /* # of MCU rows in the image */\n\n  int blocks_in_MCU;            /* # of DCT blocks per MCU */\n  int MCU_membership[D_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;           /* progressive JPEG parameters for scan */\n\n#if JPEG_LIB_VERSION >= 80\n  /* These fields are derived from Se of first SOS marker.\n   */\n  int block_size;               /* the basic DCT block size: 1..16 */\n  const int *natural_order; /* natural-order position array for entropy decode */\n  int lim_Se;                   /* min( Se, DCTSIZE2-1 ) for entropy decode */\n#endif\n\n  /* This field is shared between entropy decoder and marker parser.\n   * It is either zero or the code of a JPEG marker that has been\n   * read from the data source, but has not yet been processed.\n   */\n  int unread_marker;\n\n  /*\n   * Links to decompression subobjects (methods, private variables of modules)\n   */\n  struct jpeg_decomp_master *master;\n  struct jpeg_d_main_controller *main;\n  struct jpeg_d_coef_controller *coef;\n  struct jpeg_d_post_controller *post;\n  struct jpeg_input_controller *inputctl;\n  struct jpeg_marker_reader *marker;\n  struct jpeg_entropy_decoder *entropy;\n  struct jpeg_inverse_dct *idct;\n  struct jpeg_upsampler *upsample;\n  struct jpeg_color_deconverter *cconvert;\n  struct jpeg_color_quantizer *cquantize;\n};\n\n\n/* \"Object\" declarations for JPEG modules that may be supplied or called\n * directly by the surrounding application.\n * As with all objects in the JPEG library, these structs only define the\n * publicly visible methods and state variables of a module.  Additional\n * private fields may exist after the public ones.\n */\n\n\n/* Error handler object */\n\nstruct jpeg_error_mgr {\n  /* Error exit handler: does not return to caller */\n  void (*error_exit) (j_common_ptr cinfo);\n  /* Conditionally emit a trace or warning message */\n  void (*emit_message) (j_common_ptr cinfo, int msg_level);\n  /* Routine that actually outputs a trace or error message */\n  void (*output_message) (j_common_ptr cinfo);\n  /* Format a message string for the most recent JPEG error or message */\n  void (*format_message) (j_common_ptr cinfo, char *buffer);\n#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */\n  /* Reset error state variables at start of a new image */\n  void (*reset_error_mgr) (j_common_ptr cinfo);\n\n  /* The message ID code and any parameters are saved here.\n   * A message can have one string parameter or up to 8 int parameters.\n   */\n  int msg_code;\n#define JMSG_STR_PARM_MAX  80\n  union {\n    int i[8];\n    char s[JMSG_STR_PARM_MAX];\n  } msg_parm;\n\n  /* Standard state variables for error facility */\n\n  int trace_level;              /* max msg_level that will be displayed */\n\n  /* For recoverable corrupt-data errors, we emit a warning message,\n   * but keep going unless emit_message chooses to abort.  emit_message\n   * should count warnings in num_warnings.  The surrounding application\n   * can check for bad data by seeing if num_warnings is nonzero at the\n   * end of processing.\n   */\n  long num_warnings;            /* number of corrupt-data warnings */\n\n  /* These fields point to the table(s) of error message strings.\n   * An application can change the table pointer to switch to a different\n   * message list (typically, to change the language in which errors are\n   * reported).  Some applications may wish to add additional error codes\n   * that will be handled by the JPEG library error mechanism; the second\n   * table pointer is used for this purpose.\n   *\n   * First table includes all errors generated by JPEG library itself.\n   * Error code 0 is reserved for a \"no such error string\" message.\n   */\n  const char * const *jpeg_message_table; /* Library errors */\n  int last_jpeg_message;    /* Table contains strings 0..last_jpeg_message */\n  /* Second table can be added by application (see cjpeg/djpeg for example).\n   * It contains strings numbered first_addon_message..last_addon_message.\n   */\n  const char * const *addon_message_table; /* Non-library errors */\n  int first_addon_message;      /* code for first string in addon table */\n  int last_addon_message;       /* code for last string in addon table */\n};\n\n\n/* Progress monitor object */\n\nstruct jpeg_progress_mgr {\n  void (*progress_monitor) (j_common_ptr cinfo);\n\n  long pass_counter;            /* work units completed in this pass */\n  long pass_limit;              /* total number of work units in this pass */\n  int completed_passes;         /* passes completed so far */\n  int total_passes;             /* total number of passes expected */\n};\n\n\n/* Data destination object for compression */\n\nstruct jpeg_destination_mgr {\n  JOCTET *next_output_byte;     /* => next byte to write in buffer */\n  size_t free_in_buffer;        /* # of byte spaces remaining in buffer */\n\n  void (*init_destination) (j_compress_ptr cinfo);\n  boolean (*empty_output_buffer) (j_compress_ptr cinfo);\n  void (*term_destination) (j_compress_ptr cinfo);\n};\n\n\n/* Data source object for decompression */\n\nstruct jpeg_source_mgr {\n  const JOCTET *next_input_byte; /* => next byte to read from buffer */\n  size_t bytes_in_buffer;       /* # of bytes remaining in buffer */\n\n  void (*init_source) (j_decompress_ptr cinfo);\n  boolean (*fill_input_buffer) (j_decompress_ptr cinfo);\n  void (*skip_input_data) (j_decompress_ptr cinfo, long num_bytes);\n  boolean (*resync_to_restart) (j_decompress_ptr cinfo, int desired);\n  void (*term_source) (j_decompress_ptr cinfo);\n};\n\n\n/* Memory manager object.\n * Allocates \"small\" objects (a few K total), \"large\" objects (tens of K),\n * and \"really big\" objects (virtual arrays with backing store if needed).\n * The memory manager does not allow individual objects to be freed; rather,\n * each created object is assigned to a pool, and whole pools can be freed\n * at once.  This is faster and more convenient than remembering exactly what\n * to free, especially where malloc()/free() are not too speedy.\n * NB: alloc routines never return NULL.  They exit to error_exit if not\n * successful.\n */\n\n#define JPOOL_PERMANENT 0       /* lasts until master record is destroyed */\n#define JPOOL_IMAGE     1       /* lasts until done with image/datastream */\n#define JPOOL_NUMPOOLS  2\n\ntypedef struct jvirt_sarray_control *jvirt_sarray_ptr;\ntypedef struct jvirt_barray_control *jvirt_barray_ptr;\n\n\nstruct jpeg_memory_mgr {\n  /* Method pointers */\n  void *(*alloc_small) (j_common_ptr cinfo, int pool_id, size_t sizeofobject);\n  void *(*alloc_large) (j_common_ptr cinfo, int pool_id,\n                        size_t sizeofobject);\n  JSAMPARRAY (*alloc_sarray) (j_common_ptr cinfo, int pool_id,\n                              JDIMENSION samplesperrow, JDIMENSION numrows);\n  JBLOCKARRAY (*alloc_barray) (j_common_ptr cinfo, int pool_id,\n                               JDIMENSION blocksperrow, JDIMENSION numrows);\n  jvirt_sarray_ptr (*request_virt_sarray) (j_common_ptr cinfo, int pool_id,\n                                           boolean pre_zero,\n                                           JDIMENSION samplesperrow,\n                                           JDIMENSION numrows,\n                                           JDIMENSION maxaccess);\n  jvirt_barray_ptr (*request_virt_barray) (j_common_ptr cinfo, int pool_id,\n                                           boolean pre_zero,\n                                           JDIMENSION blocksperrow,\n                                           JDIMENSION numrows,\n                                           JDIMENSION maxaccess);\n  void (*realize_virt_arrays) (j_common_ptr cinfo);\n  JSAMPARRAY (*access_virt_sarray) (j_common_ptr cinfo, jvirt_sarray_ptr ptr,\n                                    JDIMENSION start_row, JDIMENSION num_rows,\n                                    boolean writable);\n  JBLOCKARRAY (*access_virt_barray) (j_common_ptr cinfo, jvirt_barray_ptr ptr,\n                                     JDIMENSION start_row, JDIMENSION num_rows,\n                                     boolean writable);\n  void (*free_pool) (j_common_ptr cinfo, int pool_id);\n  void (*self_destruct) (j_common_ptr cinfo);\n\n  /* Limit on memory allocation for this JPEG object.  (Note that this is\n   * merely advisory, not a guaranteed maximum; it only affects the space\n   * used for virtual-array buffers.)  May be changed by outer application\n   * after creating the JPEG object.\n   */\n  long max_memory_to_use;\n\n  /* Maximum allocation request accepted by alloc_large. */\n  long max_alloc_chunk;\n};\n\n\n/* Routine signature for application-supplied marker processing methods.\n * Need not pass marker code since it is stored in cinfo->unread_marker.\n */\ntypedef boolean (*jpeg_marker_parser_method) (j_decompress_ptr cinfo);\n\n\n/* Originally, this macro was used as a way of defining function prototypes\n * for both modern compilers as well as older compilers that did not support\n * prototype parameters.  libjpeg-turbo has never supported these older,\n * non-ANSI compilers, but the macro is still included because there is some\n * software out there that uses it.\n */\n\n#define JPP(arglist)    arglist\n\n\n/* Default error-management setup */\nEXTERN(struct jpeg_error_mgr *) jpeg_std_error (struct jpeg_error_mgr *err);\n\n/* Initialization of JPEG compression objects.\n * jpeg_create_compress() and jpeg_create_decompress() are the exported\n * names that applications should call.  These expand to calls on\n * jpeg_CreateCompress and jpeg_CreateDecompress with additional information\n * passed for version mismatch checking.\n * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.\n */\n#define jpeg_create_compress(cinfo) \\\n    jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \\\n                        (size_t) sizeof(struct jpeg_compress_struct))\n#define jpeg_create_decompress(cinfo) \\\n    jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \\\n                          (size_t) sizeof(struct jpeg_decompress_struct))\nEXTERN(void) jpeg_CreateCompress (j_compress_ptr cinfo, int version,\n                                  size_t structsize);\nEXTERN(void) jpeg_CreateDecompress (j_decompress_ptr cinfo, int version,\n                                    size_t structsize);\n/* Destruction of JPEG compression objects */\nEXTERN(void) jpeg_destroy_compress (j_compress_ptr cinfo);\nEXTERN(void) jpeg_destroy_decompress (j_decompress_ptr cinfo);\n\n/* Standard data source and destination managers: stdio streams. */\n/* Caller is responsible for opening the file before and closing after. */\nEXTERN(void) jpeg_stdio_dest (j_compress_ptr cinfo, FILE *outfile);\nEXTERN(void) jpeg_stdio_src (j_decompress_ptr cinfo, FILE *infile);\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n/* Data source and destination managers: memory buffers. */\nEXTERN(void) jpeg_mem_dest (j_compress_ptr cinfo, unsigned char **outbuffer,\n                            unsigned long *outsize);\nEXTERN(void) jpeg_mem_src (j_decompress_ptr cinfo,\n                           const unsigned char *inbuffer,\n                           unsigned long insize);\n#endif\n\n/* Default parameter setup for compression */\nEXTERN(void) jpeg_set_defaults (j_compress_ptr cinfo);\n/* Compression parameter setup aids */\nEXTERN(void) jpeg_set_colorspace (j_compress_ptr cinfo,\n                                  J_COLOR_SPACE colorspace);\nEXTERN(void) jpeg_default_colorspace (j_compress_ptr cinfo);\nEXTERN(void) jpeg_set_quality (j_compress_ptr cinfo, int quality,\n                               boolean force_baseline);\nEXTERN(void) jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,\n                                      boolean force_baseline);\n#if JPEG_LIB_VERSION >= 70\nEXTERN(void) jpeg_default_qtables (j_compress_ptr cinfo,\n                                   boolean force_baseline);\n#endif\nEXTERN(void) jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,\n                                   const unsigned int *basic_table,\n                                   int scale_factor, boolean force_baseline);\nEXTERN(int) jpeg_quality_scaling (int quality);\nEXTERN(void) jpeg_simple_progression (j_compress_ptr cinfo);\nEXTERN(void) jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress);\nEXTERN(JQUANT_TBL *) jpeg_alloc_quant_table (j_common_ptr cinfo);\nEXTERN(JHUFF_TBL *) jpeg_alloc_huff_table (j_common_ptr cinfo);\n\n/* Main entry points for compression */\nEXTERN(void) jpeg_start_compress (j_compress_ptr cinfo,\n                                  boolean write_all_tables);\nEXTERN(JDIMENSION) jpeg_write_scanlines (j_compress_ptr cinfo,\n                                         JSAMPARRAY scanlines,\n                                         JDIMENSION num_lines);\nEXTERN(void) jpeg_finish_compress (j_compress_ptr cinfo);\n\n#if JPEG_LIB_VERSION >= 70\n/* Precalculate JPEG dimensions for current compression parameters. */\nEXTERN(void) jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo);\n#endif\n\n/* Replaces jpeg_write_scanlines when writing raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data,\n                                        JDIMENSION num_lines);\n\n/* Write a special marker.  See libjpeg.txt concerning safe usage. */\nEXTERN(void) jpeg_write_marker (j_compress_ptr cinfo, int marker,\n                                const JOCTET *dataptr, unsigned int datalen);\n/* Same, but piecemeal. */\nEXTERN(void) jpeg_write_m_header (j_compress_ptr cinfo, int marker,\n                                  unsigned int datalen);\nEXTERN(void) jpeg_write_m_byte (j_compress_ptr cinfo, int val);\n\n/* Alternate compression function: just write an abbreviated table file */\nEXTERN(void) jpeg_write_tables (j_compress_ptr cinfo);\n\n/* Decompression startup: read start of JPEG datastream to see what's there */\nEXTERN(int) jpeg_read_header (j_decompress_ptr cinfo, boolean require_image);\n/* Return value is one of: */\n#define JPEG_SUSPENDED          0 /* Suspended due to lack of input data */\n#define JPEG_HEADER_OK          1 /* Found valid image datastream */\n#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */\n/* If you pass require_image = TRUE (normal case), you need not check for\n * a TABLES_ONLY return code; an abbreviated file will cause an error exit.\n * JPEG_SUSPENDED is only possible if you use a data source module that can\n * give a suspension return (the stdio source module doesn't).\n */\n\n/* Main entry points for decompression */\nEXTERN(boolean) jpeg_start_decompress (j_decompress_ptr cinfo);\nEXTERN(JDIMENSION) jpeg_read_scanlines (j_decompress_ptr cinfo,\n                                        JSAMPARRAY scanlines,\n                                        JDIMENSION max_lines);\nEXTERN(JDIMENSION) jpeg_skip_scanlines (j_decompress_ptr cinfo,\n                                        JDIMENSION num_lines);\nEXTERN(void) jpeg_crop_scanline (j_decompress_ptr cinfo, JDIMENSION *xoffset,\n                                 JDIMENSION *width);\nEXTERN(boolean) jpeg_finish_decompress (j_decompress_ptr cinfo);\n\n/* Replaces jpeg_read_scanlines when reading raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,\n                                       JDIMENSION max_lines);\n\n/* Additional entry points for buffered-image mode. */\nEXTERN(boolean) jpeg_has_multiple_scans (j_decompress_ptr cinfo);\nEXTERN(boolean) jpeg_start_output (j_decompress_ptr cinfo, int scan_number);\nEXTERN(boolean) jpeg_finish_output (j_decompress_ptr cinfo);\nEXTERN(boolean) jpeg_input_complete (j_decompress_ptr cinfo);\nEXTERN(void) jpeg_new_colormap (j_decompress_ptr cinfo);\nEXTERN(int) jpeg_consume_input (j_decompress_ptr cinfo);\n/* Return value is one of: */\n/* #define JPEG_SUSPENDED       0    Suspended due to lack of input data */\n#define JPEG_REACHED_SOS        1 /* Reached start of new scan */\n#define JPEG_REACHED_EOI        2 /* Reached end of image */\n#define JPEG_ROW_COMPLETED      3 /* Completed one iMCU row */\n#define JPEG_SCAN_COMPLETED     4 /* Completed last iMCU row of a scan */\n\n/* Precalculate output dimensions for current decompression parameters. */\n#if JPEG_LIB_VERSION >= 80\nEXTERN(void) jpeg_core_output_dimensions (j_decompress_ptr cinfo);\n#endif\nEXTERN(void) jpeg_calc_output_dimensions (j_decompress_ptr cinfo);\n\n/* Control saving of COM and APPn markers into marker_list. */\nEXTERN(void) jpeg_save_markers (j_decompress_ptr cinfo, int marker_code,\n                                unsigned int length_limit);\n\n/* Install a special processing method for COM or APPn markers. */\nEXTERN(void) jpeg_set_marker_processor (j_decompress_ptr cinfo,\n                                        int marker_code,\n                                        jpeg_marker_parser_method routine);\n\n/* Read or write raw DCT coefficients --- useful for lossless transcoding. */\nEXTERN(jvirt_barray_ptr *) jpeg_read_coefficients (j_decompress_ptr cinfo);\nEXTERN(void) jpeg_write_coefficients (j_compress_ptr cinfo,\n                                      jvirt_barray_ptr *coef_arrays);\nEXTERN(void) jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,\n                                            j_compress_ptr dstinfo);\n\n/* If you choose to abort compression or decompression before completing\n * jpeg_finish_(de)compress, then you need to clean up to release memory,\n * temporary files, etc.  You can just call jpeg_destroy_(de)compress\n * if you're done with the JPEG object, but if you want to clean it up and\n * reuse it, call this:\n */\nEXTERN(void) jpeg_abort_compress (j_compress_ptr cinfo);\nEXTERN(void) jpeg_abort_decompress (j_decompress_ptr cinfo);\n\n/* Generic versions of jpeg_abort and jpeg_destroy that work on either\n * flavor of JPEG object.  These may be more convenient in some places.\n */\nEXTERN(void) jpeg_abort (j_common_ptr cinfo);\nEXTERN(void) jpeg_destroy (j_common_ptr cinfo);\n\n/* Default restart-marker-resync procedure for use by data source modules */\nEXTERN(boolean) jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired);\n\n\n/* These marker codes are exported since applications and data source modules\n * are likely to want to use them.\n */\n\n#define JPEG_RST0       0xD0    /* RST0 marker code */\n#define JPEG_EOI        0xD9    /* EOI marker code */\n#define JPEG_APP0       0xE0    /* APP0 marker code */\n#define JPEG_COM        0xFE    /* COM marker code */\n\n\n/* If we have a brain-damaged compiler that emits warnings (or worse, errors)\n * for structure definitions that are never filled in, keep it quiet by\n * supplying dummy definitions for the various substructures.\n */\n\n#ifdef INCOMPLETE_TYPES_BROKEN\n#ifndef JPEG_INTERNALS          /* will be defined in jpegint.h */\nstruct jvirt_sarray_control { long dummy; };\nstruct jvirt_barray_control { long dummy; };\nstruct jpeg_comp_master { long dummy; };\nstruct jpeg_c_main_controller { long dummy; };\nstruct jpeg_c_prep_controller { long dummy; };\nstruct jpeg_c_coef_controller { long dummy; };\nstruct jpeg_marker_writer { long dummy; };\nstruct jpeg_color_converter { long dummy; };\nstruct jpeg_downsampler { long dummy; };\nstruct jpeg_forward_dct { long dummy; };\nstruct jpeg_entropy_encoder { long dummy; };\nstruct jpeg_decomp_master { long dummy; };\nstruct jpeg_d_main_controller { long dummy; };\nstruct jpeg_d_coef_controller { long dummy; };\nstruct jpeg_d_post_controller { long dummy; };\nstruct jpeg_input_controller { long dummy; };\nstruct jpeg_marker_reader { long dummy; };\nstruct jpeg_entropy_decoder { long dummy; };\nstruct jpeg_inverse_dct { long dummy; };\nstruct jpeg_upsampler { long dummy; };\nstruct jpeg_color_deconverter { long dummy; };\nstruct jpeg_color_quantizer { long dummy; };\n#endif /* JPEG_INTERNALS */\n#endif /* INCOMPLETE_TYPES_BROKEN */\n\n\n/*\n * The JPEG library modules define JPEG_INTERNALS before including this file.\n * The internal structure declarations are read only when that is true.\n * Applications using the library should not include jpegint.h, but may wish\n * to include jerror.h.\n */\n\n#ifdef JPEG_INTERNALS\n#include \"jpegint.h\"            /* fetch private declarations */\n#include \"jerror.h\"             /* fetch error codes too */\n#endif\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\n}\n#endif\n#endif\n\n#endif /* JPEGLIB_H */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jpegtran.1",
    "content": ".TH JPEGTRAN 1 \"18 February 2016\"\n.SH NAME\njpegtran \\- lossless transformation of JPEG files\n.SH SYNOPSIS\n.B jpegtran\n[\n.I options\n]\n[\n.I filename\n]\n.LP\n.SH DESCRIPTION\n.LP\n.B jpegtran\nperforms various useful transformations of JPEG files.\nIt can translate the coded representation from one variant of JPEG to another,\nfor example from baseline JPEG to progressive JPEG or vice versa.  It can also\nperform some rearrangements of the image data, for example turning an image\nfrom landscape to portrait format by rotation.\n.PP\nFor EXIF files and JPEG files containing Exif data, you may prefer to use\n.B exiftran\ninstead.\n.PP\n.B jpegtran\nworks by rearranging the compressed data (DCT coefficients), without\never fully decoding the image.  Therefore, its transformations are lossless:\nthere is no image degradation at all, which would not be true if you used\n.B djpeg\nfollowed by\n.B cjpeg\nto accomplish the same conversion.  But by the same token,\n.B jpegtran\ncannot perform lossy operations such as changing the image quality.  However,\nwhile the image data is losslessly transformed, metadata can be removed.  See\nthe\n.B \\-copy\noption for specifics.\n.PP\n.B jpegtran\nreads the named JPEG/JFIF file, or the standard input if no file is\nnamed, and produces a JPEG/JFIF file on the standard output.\n.SH OPTIONS\nAll switch names may be abbreviated; for example,\n.B \\-optimize\nmay be written\n.B \\-opt\nor\n.BR \\-o .\nUpper and lower case are equivalent.\nBritish spellings are also accepted (e.g.,\n.BR \\-optimise ),\nthough for brevity these are not mentioned below.\n.PP\nTo specify the coded JPEG representation used in the output file,\n.B jpegtran\naccepts a subset of the switches recognized by\n.BR cjpeg :\n.TP\n.B \\-optimize\nPerform optimization of entropy encoding parameters.\n.TP\n.B \\-progressive\nCreate progressive JPEG file.\n.TP\n.BI \\-restart \" N\"\nEmit a JPEG restart marker every N MCU rows, or every N MCU blocks if \"B\" is\nattached to the number.\n.TP\n.B \\-arithmetic\nUse arithmetic coding.\n.TP\n.BI \\-scans \" file\"\nUse the scan script given in the specified text file.\n.PP\nSee\n.BR cjpeg (1)\nfor more details about these switches.\nIf you specify none of these switches, you get a plain baseline-JPEG output\nfile.  The quality setting and so forth are determined by the input file.\n.PP\nThe image can be losslessly transformed by giving one of these switches:\n.TP\n.B \\-flip horizontal\nMirror image horizontally (left-right).\n.TP\n.B \\-flip vertical\nMirror image vertically (top-bottom).\n.TP\n.B \\-rotate 90\nRotate image 90 degrees clockwise.\n.TP\n.B \\-rotate 180\nRotate image 180 degrees.\n.TP\n.B \\-rotate 270\nRotate image 270 degrees clockwise (or 90 ccw).\n.TP\n.B \\-transpose\nTranspose image (across UL-to-LR axis).\n.TP\n.B \\-transverse\nTransverse transpose (across UR-to-LL axis).\n.PP\nThe transpose transformation has no restrictions regarding image dimensions.\nThe other transformations operate rather oddly if the image dimensions are not\na multiple of the iMCU size (usually 8 or 16 pixels), because they can only\ntransform complete blocks of DCT coefficient data in the desired way.\n.PP\n.BR jpegtran 's\ndefault behavior when transforming an odd-size image is designed\nto preserve exact reversibility and mathematical consistency of the\ntransformation set.  As stated, transpose is able to flip the entire image\narea.  Horizontal mirroring leaves any partial iMCU column at the right edge\nuntouched, but is able to flip all rows of the image.  Similarly, vertical\nmirroring leaves any partial iMCU row at the bottom edge untouched, but is\nable to flip all columns.  The other transforms can be built up as sequences\nof transpose and flip operations; for consistency, their actions on edge\npixels are defined to be the same as the end result of the corresponding\ntranspose-and-flip sequence.\n.PP\nFor practical use, you may prefer to discard any untransformable edge pixels\nrather than having a strange-looking strip along the right and/or bottom edges\nof a transformed image.  To do this, add the\n.B \\-trim\nswitch:\n.TP\n.B \\-trim\nDrop non-transformable edge blocks.\n.IP\nObviously, a transformation with\n.B \\-trim\nis not reversible, so strictly speaking\n.B jpegtran\nwith this switch is not lossless.  Also, the expected mathematical\nequivalences between the transformations no longer hold.  For example,\n.B \\-rot 270 -trim\ntrims only the bottom edge, but\n.B \\-rot 90 -trim\nfollowed by\n.B \\-rot 180 -trim\ntrims both edges.\n.TP\n.B \\-perfect\nIf you are only interested in perfect transformations, add the\n.B \\-perfect\nswitch.  This causes\n.B jpegtran\nto fail with an error if the transformation is not perfect.\n.IP\nFor example, you may want to do\n.IP\n.B (jpegtran \\-rot 90 -perfect\n.I foo.jpg\n.B || djpeg\n.I foo.jpg\n.B | pnmflip \\-r90 | cjpeg)\n.IP\nto do a perfect rotation, if available, or an approximated one if not.\n.PP\nThis version of \\fBjpegtran\\fR also offers a lossless crop option, which\ndiscards data outside of a given image region but losslessly preserves what is\ninside. Like the rotate and flip transforms, lossless crop is restricted by the\ncurrent JPEG format; the upper left corner of the selected region must fall on\nan iMCU boundary.  If it doesn't, then it is silently moved up and/or left to\nthe nearest iMCU boundary (the lower right corner is unchanged.)  Thus, the\noutput image covers at least the requested region, but it may cover more.  The\nadjustment of the region dimensions may be optionally disabled by attaching\nan 'f' character (\"force\") to the width or height number.\n\nThe image can be losslessly cropped by giving the switch:\n.TP\n.B \\-crop WxH+X+Y\nCrop the image to a rectangular region of width W and height H, starting at\npoint X,Y.  The lossless crop feature discards data outside of a given image\nregion but losslessly preserves what is inside.  Like the rotate and flip\ntransforms, lossless crop is restricted by the current JPEG format; the upper\nleft corner of the selected region must fall on an iMCU boundary.  If it\ndoesn't, then it is silently moved up and/or left to the nearest iMCU boundary\n(the lower right corner is unchanged.)\n.PP\nOther not-strictly-lossless transformation switches are:\n.TP\n.B \\-grayscale\nForce grayscale output.\n.IP\nThis option discards the chrominance channels if the input image is YCbCr\n(ie, a standard color JPEG), resulting in a grayscale JPEG file.  The\nluminance channel is preserved exactly, so this is a better method of reducing\nto grayscale than decompression, conversion, and recompression.  This switch\nis particularly handy for fixing a monochrome picture that was mistakenly\nencoded as a color JPEG.  (In such a case, the space savings from getting rid\nof the near-empty chroma channels won't be large; but the decoding time for\na grayscale JPEG is substantially less than that for a color JPEG.)\n.PP\n.B jpegtran\nalso recognizes these switches that control what to do with \"extra\" markers,\nsuch as comment blocks:\n.TP\n.B \\-copy none\nCopy no extra markers from source file.  This setting suppresses all\ncomments and other metadata in the source file.\n.TP\n.B \\-copy comments\nCopy only comment markers.  This setting copies comments from the source file\nbut discards any other metadata.\n.TP\n.B \\-copy all\nCopy all extra markers.  This setting preserves miscellaneous markers\nfound in the source file, such as JFIF thumbnails, Exif data, and Photoshop\nsettings.  In some files, these extra markers can be sizable.  Note that this\noption will copy thumbnails as-is; they will not be transformed.\n.PP\nThe default behavior is \\fB-copy comments\\fR.  (Note: in IJG releases v6 and\nv6a, \\fBjpegtran\\fR always did the equivalent of \\fB-copy none\\fR.)\n.PP\nAdditional switches recognized by jpegtran are:\n.TP\n.BI \\-maxmemory \" N\"\nSet limit for amount of memory to use in processing large images.  Value is\nin thousands of bytes, or millions of bytes if \"M\" is attached to the\nnumber.  For example,\n.B \\-max 4m\nselects 4000000 bytes.  If more space is needed, temporary files will be used.\n.TP\n.BI \\-outfile \" name\"\nSend output image to the named file, not to standard output.\n.TP\n.B \\-verbose\nEnable debug printout.  More\n.BR \\-v 's\ngive more output.  Also, version information is printed at startup.\n.TP\n.B \\-debug\nSame as\n.BR \\-verbose .\n.TP\n.B \\-version\nPrint version information and exit.\n.SH EXAMPLES\n.LP\nThis example converts a baseline JPEG file to progressive form:\n.IP\n.B jpegtran \\-progressive\n.I foo.jpg\n.B >\n.I fooprog.jpg\n.PP\nThis example rotates an image 90 degrees clockwise, discarding any\nunrotatable edge pixels:\n.IP\n.B jpegtran \\-rot 90 -trim\n.I foo.jpg\n.B >\n.I foo90.jpg\n.SH ENVIRONMENT\n.TP\n.B JPEGMEM\nIf this environment variable is set, its value is the default memory limit.\nThe value is specified as described for the\n.B \\-maxmemory\nswitch.\n.B JPEGMEM\noverrides the default value specified when the program was compiled, and\nitself is overridden by an explicit\n.BR \\-maxmemory .\n.SH SEE ALSO\n.BR cjpeg (1),\n.BR djpeg (1),\n.BR rdjpgcom (1),\n.BR wrjpgcom (1)\n.br\nWallace, Gregory K.  \"The JPEG Still Picture Compression Standard\",\nCommunications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.\n.SH AUTHOR\nIndependent JPEG Group\n.PP\nThis file was modified by The libjpeg-turbo Project to include only information\nrelevant to libjpeg-turbo and to wordsmith certain sections.\n.SH BUGS\nThe transform options can't transform odd-size images perfectly.  Use\n.B \\-trim\nor\n.B \\-perfect\nif you don't like the results.\n.PP\nThe entire image is read into memory and then written out again, even in\ncases where this isn't really necessary.  Expect swapping on large images,\nespecially when using the more complex transform options.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jpegtran.c",
    "content": "/*\n * jpegtran.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1995-2010, Thomas G. Lane, Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, 2014, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains a command-line user interface for JPEG transcoding.\n * It is very similar to cjpeg.c, and partly to djpeg.c, but provides\n * lossless transcoding between different JPEG file formats.  It also\n * provides some lossless and sort-of-lossless transformations of JPEG data.\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n#include \"transupp.h\"           /* Support routines for jpegtran */\n#include \"jversion.h\"           /* for version message */\n#include \"jconfigint.h\"\n\n#ifdef USE_CCOMMAND             /* command-line reader for Macintosh */\n#ifdef __MWERKS__\n#include <SIOUX.h>              /* Metrowerks needs this */\n#include <console.h>            /* ... and this */\n#endif\n#ifdef THINK_C\n#include <console.h>            /* Think declares it here */\n#endif\n#endif\n\n\n/*\n * Argument-parsing code.\n * The switch parser is designed to be useful with DOS-style command line\n * syntax, ie, intermixed switches and file names, where only the switches\n * to the left of a given file name affect processing of that file.\n * The main program in this file doesn't actually use this capability...\n */\n\n\nstatic const char *progname;    /* program name for error messages */\nstatic char *outfilename;       /* for -outfile switch */\nstatic JCOPY_OPTION copyoption; /* -copy switch */\nstatic jpeg_transform_info transformoption; /* image transformation options */\n\n\nLOCAL(void)\nusage (void)\n/* complain about bad command line */\n{\n  fprintf(stderr, \"usage: %s [switches] \", progname);\n#ifdef TWO_FILE_COMMANDLINE\n  fprintf(stderr, \"inputfile outputfile\\n\");\n#else\n  fprintf(stderr, \"[inputfile]\\n\");\n#endif\n\n  fprintf(stderr, \"Switches (names may be abbreviated):\\n\");\n  fprintf(stderr, \"  -copy none     Copy no extra markers from source file\\n\");\n  fprintf(stderr, \"  -copy comments Copy only comment markers (default)\\n\");\n  fprintf(stderr, \"  -copy all      Copy all extra markers\\n\");\n#ifdef ENTROPY_OPT_SUPPORTED\n  fprintf(stderr, \"  -optimize      Optimize Huffman table (smaller file, but slow compression)\\n\");\n#endif\n#ifdef C_PROGRESSIVE_SUPPORTED\n  fprintf(stderr, \"  -progressive   Create progressive JPEG file\\n\");\n#endif\n  fprintf(stderr, \"Switches for modifying the image:\\n\");\n#if TRANSFORMS_SUPPORTED\n  fprintf(stderr, \"  -crop WxH+X+Y  Crop to a rectangular subarea\\n\");\n  fprintf(stderr, \"  -grayscale     Reduce to grayscale (omit color data)\\n\");\n  fprintf(stderr, \"  -flip [horizontal|vertical]  Mirror image (left-right or top-bottom)\\n\");\n  fprintf(stderr, \"  -perfect       Fail if there is non-transformable edge blocks\\n\");\n  fprintf(stderr, \"  -rotate [90|180|270]         Rotate image (degrees clockwise)\\n\");\n#endif\n#if TRANSFORMS_SUPPORTED\n  fprintf(stderr, \"  -transpose     Transpose image\\n\");\n  fprintf(stderr, \"  -transverse    Transverse transpose image\\n\");\n  fprintf(stderr, \"  -trim          Drop non-transformable edge blocks\\n\");\n#endif\n  fprintf(stderr, \"Switches for advanced users:\\n\");\n#ifdef C_ARITH_CODING_SUPPORTED\n  fprintf(stderr, \"  -arithmetic    Use arithmetic coding\\n\");\n#endif\n  fprintf(stderr, \"  -restart N     Set restart interval in rows, or in blocks with B\\n\");\n  fprintf(stderr, \"  -maxmemory N   Maximum memory to use (in kbytes)\\n\");\n  fprintf(stderr, \"  -outfile name  Specify name for output file\\n\");\n  fprintf(stderr, \"  -verbose  or  -debug   Emit debug output\\n\");\n  fprintf(stderr, \"  -version       Print version information and exit\\n\");\n  fprintf(stderr, \"Switches for wizards:\\n\");\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n  fprintf(stderr, \"  -scans file    Create multi-scan JPEG per script file\\n\");\n#endif\n  exit(EXIT_FAILURE);\n}\n\n\nLOCAL(void)\nselect_transform (JXFORM_CODE transform)\n/* Silly little routine to detect multiple transform options,\n * which we can't handle.\n */\n{\n#if TRANSFORMS_SUPPORTED\n  if (transformoption.transform == JXFORM_NONE ||\n      transformoption.transform == transform) {\n    transformoption.transform = transform;\n  } else {\n    fprintf(stderr, \"%s: can only do one image transformation at a time\\n\",\n            progname);\n    usage();\n  }\n#else\n  fprintf(stderr, \"%s: sorry, image transformation was not compiled\\n\",\n          progname);\n  exit(EXIT_FAILURE);\n#endif\n}\n\n\nLOCAL(int)\nparse_switches (j_compress_ptr cinfo, int argc, char **argv,\n                int last_file_arg_seen, boolean for_real)\n/* Parse optional switches.\n * Returns argv[] index of first file-name argument (== argc if none).\n * Any file names with indexes <= last_file_arg_seen are ignored;\n * they have presumably been processed in a previous iteration.\n * (Pass 0 for last_file_arg_seen on the first or only iteration.)\n * for_real is FALSE on the first (dummy) pass; we may skip any expensive\n * processing.\n */\n{\n  int argn;\n  char *arg;\n  boolean simple_progressive;\n  char *scansarg = NULL;        /* saves -scans parm if any */\n\n  /* Set up default JPEG parameters. */\n  simple_progressive = FALSE;\n  outfilename = NULL;\n  copyoption = JCOPYOPT_DEFAULT;\n  transformoption.transform = JXFORM_NONE;\n  transformoption.perfect = FALSE;\n  transformoption.trim = FALSE;\n  transformoption.force_grayscale = FALSE;\n  transformoption.crop = FALSE;\n  transformoption.slow_hflip = FALSE;\n  cinfo->err->trace_level = 0;\n\n  /* Scan command line options, adjust parameters */\n\n  for (argn = 1; argn < argc; argn++) {\n    arg = argv[argn];\n    if (*arg != '-') {\n      /* Not a switch, must be a file name argument */\n      if (argn <= last_file_arg_seen) {\n        outfilename = NULL;     /* -outfile applies to just one input file */\n        continue;               /* ignore this name if previously processed */\n      }\n      break;                    /* else done parsing switches */\n    }\n    arg++;                      /* advance past switch marker character */\n\n    if (keymatch(arg, \"arithmetic\", 1)) {\n      /* Use arithmetic coding. */\n#ifdef C_ARITH_CODING_SUPPORTED\n      cinfo->arith_code = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, arithmetic coding not supported\\n\",\n              progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"copy\", 2)) {\n      /* Select which extra markers to copy. */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (keymatch(argv[argn], \"none\", 1)) {\n        copyoption = JCOPYOPT_NONE;\n      } else if (keymatch(argv[argn], \"comments\", 1)) {\n        copyoption = JCOPYOPT_COMMENTS;\n      } else if (keymatch(argv[argn], \"all\", 1)) {\n        copyoption = JCOPYOPT_ALL;\n      } else\n        usage();\n\n    } else if (keymatch(arg, \"crop\", 2)) {\n      /* Perform lossless cropping. */\n#if TRANSFORMS_SUPPORTED\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (! jtransform_parse_crop_spec(&transformoption, argv[argn])) {\n        fprintf(stderr, \"%s: bogus -crop argument '%s'\\n\",\n                progname, argv[argn]);\n        exit(EXIT_FAILURE);\n      }\n#else\n      select_transform(JXFORM_NONE);    /* force an error */\n#endif\n\n    } else if (keymatch(arg, \"debug\", 1) || keymatch(arg, \"verbose\", 1)) {\n      /* Enable debug printouts. */\n      /* On first -d, print version identification */\n      static boolean printed_version = FALSE;\n\n      if (! printed_version) {\n        fprintf(stderr, \"%s version %s (build %s)\\n\",\n                PACKAGE_NAME, VERSION, BUILD);\n        fprintf(stderr, \"%s\\n\\n\", JCOPYRIGHT);\n        fprintf(stderr, \"Emulating The Independent JPEG Group's software, version %s\\n\\n\",\n                JVERSION);\n        printed_version = TRUE;\n      }\n      cinfo->err->trace_level++;\n\n    } else if (keymatch(arg, \"version\", 4)) {\n      fprintf(stderr, \"%s version %s (build %s)\\n\",\n              PACKAGE_NAME, VERSION, BUILD);\n      exit(EXIT_SUCCESS);\n\n    } else if (keymatch(arg, \"flip\", 1)) {\n      /* Mirror left-right or top-bottom. */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (keymatch(argv[argn], \"horizontal\", 1))\n        select_transform(JXFORM_FLIP_H);\n      else if (keymatch(argv[argn], \"vertical\", 1))\n        select_transform(JXFORM_FLIP_V);\n      else\n        usage();\n\n    } else if (keymatch(arg, \"grayscale\", 1) || keymatch(arg, \"greyscale\",1)) {\n      /* Force to grayscale. */\n#if TRANSFORMS_SUPPORTED\n      transformoption.force_grayscale = TRUE;\n#else\n      select_transform(JXFORM_NONE);    /* force an error */\n#endif\n\n    } else if (keymatch(arg, \"maxmemory\", 3)) {\n      /* Maximum memory in Kb (or Mb with 'm'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n        usage();\n      if (ch == 'm' || ch == 'M')\n        lval *= 1000L;\n      cinfo->mem->max_memory_to_use = lval * 1000L;\n\n    } else if (keymatch(arg, \"optimize\", 1) || keymatch(arg, \"optimise\", 1)) {\n      /* Enable entropy parm optimization. */\n#ifdef ENTROPY_OPT_SUPPORTED\n      cinfo->optimize_coding = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, entropy optimization was not compiled\\n\",\n              progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"outfile\", 4)) {\n      /* Set output file name. */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      outfilename = argv[argn]; /* save it away for later use */\n\n    } else if (keymatch(arg, \"perfect\", 2)) {\n      /* Fail if there is any partial edge MCUs that the transform can't\n       * handle. */\n      transformoption.perfect = TRUE;\n\n    } else if (keymatch(arg, \"progressive\", 2)) {\n      /* Select simple progressive mode. */\n#ifdef C_PROGRESSIVE_SUPPORTED\n      simple_progressive = TRUE;\n      /* We must postpone execution until num_components is known. */\n#else\n      fprintf(stderr, \"%s: sorry, progressive output was not compiled\\n\",\n              progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"restart\", 1)) {\n      /* Restart interval in MCU rows (or in MCUs with 'b'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n        usage();\n      if (lval < 0 || lval > 65535L)\n        usage();\n      if (ch == 'b' || ch == 'B') {\n        cinfo->restart_interval = (unsigned int) lval;\n        cinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */\n      } else {\n        cinfo->restart_in_rows = (int) lval;\n        /* restart_interval will be computed during startup */\n      }\n\n    } else if (keymatch(arg, \"rotate\", 2)) {\n      /* Rotate 90, 180, or 270 degrees (measured clockwise). */\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      if (keymatch(argv[argn], \"90\", 2))\n        select_transform(JXFORM_ROT_90);\n      else if (keymatch(argv[argn], \"180\", 3))\n        select_transform(JXFORM_ROT_180);\n      else if (keymatch(argv[argn], \"270\", 3))\n        select_transform(JXFORM_ROT_270);\n      else\n        usage();\n\n    } else if (keymatch(arg, \"scans\", 1)) {\n      /* Set scan script. */\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n      if (++argn >= argc)       /* advance to next argument */\n        usage();\n      scansarg = argv[argn];\n      /* We must postpone reading the file in case -progressive appears. */\n#else\n      fprintf(stderr, \"%s: sorry, multi-scan output was not compiled\\n\",\n              progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"transpose\", 1)) {\n      /* Transpose (across UL-to-LR axis). */\n      select_transform(JXFORM_TRANSPOSE);\n\n    } else if (keymatch(arg, \"transverse\", 6)) {\n      /* Transverse transpose (across UR-to-LL axis). */\n      select_transform(JXFORM_TRANSVERSE);\n\n    } else if (keymatch(arg, \"trim\", 3)) {\n      /* Trim off any partial edge MCUs that the transform can't handle. */\n      transformoption.trim = TRUE;\n\n    } else {\n      usage();                  /* bogus switch */\n    }\n  }\n\n  /* Post-switch-scanning cleanup */\n\n  if (for_real) {\n\n#ifdef C_PROGRESSIVE_SUPPORTED\n    if (simple_progressive)     /* process -progressive; -scans can override */\n      jpeg_simple_progression(cinfo);\n#endif\n\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n    if (scansarg != NULL)       /* process -scans if it was present */\n      if (! read_scan_script(cinfo, scansarg))\n        usage();\n#endif\n  }\n\n  return argn;                  /* return index of next arg (file name) */\n}\n\n\n/*\n * The main program.\n */\n\nint\nmain (int argc, char **argv)\n{\n  struct jpeg_decompress_struct srcinfo;\n  struct jpeg_compress_struct dstinfo;\n  struct jpeg_error_mgr jsrcerr, jdsterr;\n#ifdef PROGRESS_REPORT\n  struct cdjpeg_progress_mgr progress;\n#endif\n  jvirt_barray_ptr *src_coef_arrays;\n  jvirt_barray_ptr *dst_coef_arrays;\n  int file_index;\n  /* We assume all-in-memory processing and can therefore use only a\n   * single file pointer for sequential input and output operation.\n   */\n  FILE *fp;\n\n  /* On Mac, fetch a command line. */\n#ifdef USE_CCOMMAND\n  argc = ccommand(&argv);\n#endif\n\n  progname = argv[0];\n  if (progname == NULL || progname[0] == 0)\n    progname = \"jpegtran\";      /* in case C library doesn't provide it */\n\n  /* Initialize the JPEG decompression object with default error handling. */\n  srcinfo.err = jpeg_std_error(&jsrcerr);\n  jpeg_create_decompress(&srcinfo);\n  /* Initialize the JPEG compression object with default error handling. */\n  dstinfo.err = jpeg_std_error(&jdsterr);\n  jpeg_create_compress(&dstinfo);\n\n  /* Scan command line to find file names.\n   * It is convenient to use just one switch-parsing routine, but the switch\n   * values read here are mostly ignored; we will rescan the switches after\n   * opening the input file.  Also note that most of the switches affect the\n   * destination JPEG object, so we parse into that and then copy over what\n   * needs to affects the source too.\n   */\n\n  file_index = parse_switches(&dstinfo, argc, argv, 0, FALSE);\n  jsrcerr.trace_level = jdsterr.trace_level;\n  srcinfo.mem->max_memory_to_use = dstinfo.mem->max_memory_to_use;\n\n#ifdef TWO_FILE_COMMANDLINE\n  /* Must have either -outfile switch or explicit output file name */\n  if (outfilename == NULL) {\n    if (file_index != argc-2) {\n      fprintf(stderr, \"%s: must name one input and one output file\\n\",\n              progname);\n      usage();\n    }\n    outfilename = argv[file_index+1];\n  } else {\n    if (file_index != argc-1) {\n      fprintf(stderr, \"%s: must name one input and one output file\\n\",\n              progname);\n      usage();\n    }\n  }\n#else\n  /* Unix style: expect zero or one file name */\n  if (file_index < argc-1) {\n    fprintf(stderr, \"%s: only one input file\\n\", progname);\n    usage();\n  }\n#endif /* TWO_FILE_COMMANDLINE */\n\n  /* Open the input file. */\n  if (file_index < argc) {\n    if ((fp = fopen(argv[file_index], READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s for reading\\n\", progname, argv[file_index]);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default input file is stdin */\n    fp = read_stdin();\n  }\n\n#ifdef PROGRESS_REPORT\n  start_progress_monitor((j_common_ptr) &dstinfo, &progress);\n#endif\n\n  /* Specify data source for decompression */\n  jpeg_stdio_src(&srcinfo, fp);\n\n  /* Enable saving of extra markers that we want to copy */\n  jcopy_markers_setup(&srcinfo, copyoption);\n\n  /* Read file header */\n  (void) jpeg_read_header(&srcinfo, TRUE);\n\n  /* Any space needed by a transform option must be requested before\n   * jpeg_read_coefficients so that memory allocation will be done right.\n   */\n#if TRANSFORMS_SUPPORTED\n  /* Fail right away if -perfect is given and transformation is not perfect.\n   */\n  if (!jtransform_request_workspace(&srcinfo, &transformoption)) {\n    fprintf(stderr, \"%s: transformation is not perfect\\n\", progname);\n    exit(EXIT_FAILURE);\n  }\n#endif\n\n  /* Read source file as DCT coefficients */\n  src_coef_arrays = jpeg_read_coefficients(&srcinfo);\n\n  /* Initialize destination compression parameters from source values */\n  jpeg_copy_critical_parameters(&srcinfo, &dstinfo);\n\n  /* Adjust destination parameters if required by transform options;\n   * also find out which set of coefficient arrays will hold the output.\n   */\n#if TRANSFORMS_SUPPORTED\n  dst_coef_arrays = jtransform_adjust_parameters(&srcinfo, &dstinfo,\n                                                 src_coef_arrays,\n                                                 &transformoption);\n#else\n  dst_coef_arrays = src_coef_arrays;\n#endif\n\n  /* Close input file, if we opened it.\n   * Note: we assume that jpeg_read_coefficients consumed all input\n   * until JPEG_REACHED_EOI, and that jpeg_finish_decompress will\n   * only consume more while (! cinfo->inputctl->eoi_reached).\n   * We cannot call jpeg_finish_decompress here since we still need the\n   * virtual arrays allocated from the source object for processing.\n   */\n  if (fp != stdin)\n    fclose(fp);\n\n  /* Open the output file. */\n  if (outfilename != NULL) {\n    if ((fp = fopen(outfilename, WRITE_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s for writing\\n\", progname, outfilename);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default output file is stdout */\n    fp = write_stdout();\n  }\n\n  /* Adjust default compression parameters by re-parsing the options */\n  file_index = parse_switches(&dstinfo, argc, argv, 0, TRUE);\n\n  /* Specify data destination for compression */\n  jpeg_stdio_dest(&dstinfo, fp);\n\n  /* Start compressor (note no image data is actually written here) */\n  jpeg_write_coefficients(&dstinfo, dst_coef_arrays);\n\n  /* Copy to the output file any extra markers that we want to preserve */\n  jcopy_markers_execute(&srcinfo, &dstinfo, copyoption);\n\n  /* Execute image transformation, if any */\n#if TRANSFORMS_SUPPORTED\n  jtransform_execute_transformation(&srcinfo, &dstinfo,\n                                    src_coef_arrays,\n                                    &transformoption);\n#endif\n\n  /* Finish compression and release memory */\n  jpeg_finish_compress(&dstinfo);\n  jpeg_destroy_compress(&dstinfo);\n  (void) jpeg_finish_decompress(&srcinfo);\n  jpeg_destroy_decompress(&srcinfo);\n\n  /* Close output file, if we opened it */\n  if (fp != stdout)\n    fclose(fp);\n\n#ifdef PROGRESS_REPORT\n  end_progress_monitor((j_common_ptr) &dstinfo);\n#endif\n\n  /* All done. */\n  exit(jsrcerr.num_warnings + jdsterr.num_warnings ?EXIT_WARNING:EXIT_SUCCESS);\n  return 0;                     /* suppress no-return-value warnings */\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jquant1.c",
    "content": "/*\n * jquant1.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009, 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains 1-pass color quantization (color mapping) routines.\n * These routines provide mapping to a fixed color map using equally spaced\n * color values.  Optional Floyd-Steinberg or ordered dithering is available.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n#ifdef QUANT_1PASS_SUPPORTED\n\n\n/*\n * The main purpose of 1-pass quantization is to provide a fast, if not very\n * high quality, colormapped output capability.  A 2-pass quantizer usually\n * gives better visual quality; however, for quantized grayscale output this\n * quantizer is perfectly adequate.  Dithering is highly recommended with this\n * quantizer, though you can turn it off if you really want to.\n *\n * In 1-pass quantization the colormap must be chosen in advance of seeing the\n * image.  We use a map consisting of all combinations of Ncolors[i] color\n * values for the i'th component.  The Ncolors[] values are chosen so that\n * their product, the total number of colors, is no more than that requested.\n * (In most cases, the product will be somewhat less.)\n *\n * Since the colormap is orthogonal, the representative value for each color\n * component can be determined without considering the other components;\n * then these indexes can be combined into a colormap index by a standard\n * N-dimensional-array-subscript calculation.  Most of the arithmetic involved\n * can be precalculated and stored in the lookup table colorindex[].\n * colorindex[i][j] maps pixel value j in component i to the nearest\n * representative value (grid plane) for that component; this index is\n * multiplied by the array stride for component i, so that the\n * index of the colormap entry closest to a given pixel value is just\n *    sum( colorindex[component-number][pixel-component-value] )\n * Aside from being fast, this scheme allows for variable spacing between\n * representative values with no additional lookup cost.\n *\n * If gamma correction has been applied in color conversion, it might be wise\n * to adjust the color grid spacing so that the representative colors are\n * equidistant in linear space.  At this writing, gamma correction is not\n * implemented by jdcolor, so nothing is done here.\n */\n\n\n/* Declarations for ordered dithering.\n *\n * We use a standard 16x16 ordered dither array.  The basic concept of ordered\n * dithering is described in many references, for instance Dale Schumacher's\n * chapter II.2 of Graphics Gems II (James Arvo, ed. Academic Press, 1991).\n * In place of Schumacher's comparisons against a \"threshold\" value, we add a\n * \"dither\" value to the input pixel and then round the result to the nearest\n * output value.  The dither value is equivalent to (0.5 - threshold) times\n * the distance between output values.  For ordered dithering, we assume that\n * the output colors are equally spaced; if not, results will probably be\n * worse, since the dither may be too much or too little at a given point.\n *\n * The normal calculation would be to form pixel value + dither, range-limit\n * this to 0..MAXJSAMPLE, and then index into the colorindex table as usual.\n * We can skip the separate range-limiting step by extending the colorindex\n * table in both directions.\n */\n\n#define ODITHER_SIZE  16        /* dimension of dither matrix */\n/* NB: if ODITHER_SIZE is not a power of 2, ODITHER_MASK uses will break */\n#define ODITHER_CELLS (ODITHER_SIZE*ODITHER_SIZE)       /* # cells in matrix */\n#define ODITHER_MASK  (ODITHER_SIZE-1) /* mask for wrapping around counters */\n\ntypedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE];\ntypedef int (*ODITHER_MATRIX_PTR)[ODITHER_SIZE];\n\nstatic const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = {\n  /* Bayer's order-4 dither array.  Generated by the code given in\n   * Stephen Hawley's article \"Ordered Dithering\" in Graphics Gems I.\n   * The values in this array must range from 0 to ODITHER_CELLS-1.\n   */\n  {   0,192, 48,240, 12,204, 60,252,  3,195, 51,243, 15,207, 63,255 },\n  { 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 },\n  {  32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 },\n  { 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 },\n  {   8,200, 56,248,  4,196, 52,244, 11,203, 59,251,  7,199, 55,247 },\n  { 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 },\n  {  40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 },\n  { 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 },\n  {   2,194, 50,242, 14,206, 62,254,  1,193, 49,241, 13,205, 61,253 },\n  { 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 },\n  {  34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 },\n  { 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 },\n  {  10,202, 58,250,  6,198, 54,246,  9,201, 57,249,  5,197, 53,245 },\n  { 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 },\n  {  42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 },\n  { 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 }\n};\n\n\n/* Declarations for Floyd-Steinberg dithering.\n *\n * Errors are accumulated into the array fserrors[], at a resolution of\n * 1/16th of a pixel count.  The error at a given pixel is propagated\n * to its not-yet-processed neighbors using the standard F-S fractions,\n *              ...     (here)  7/16\n *              3/16    5/16    1/16\n * We work left-to-right on even rows, right-to-left on odd rows.\n *\n * We can get away with a single array (holding one row's worth of errors)\n * by using it to store the current row's errors at pixel columns not yet\n * processed, but the next row's errors at columns already processed.  We\n * need only a few extra variables to hold the errors immediately around the\n * current column.  (If we are lucky, those variables are in registers, but\n * even if not, they're probably cheaper to access than array elements are.)\n *\n * The fserrors[] array is indexed [component#][position].\n * We provide (#columns + 2) entries per component; the extra entry at each\n * end saves us from special-casing the first and last pixels.\n */\n\n#if BITS_IN_JSAMPLE == 8\ntypedef INT16 FSERROR;          /* 16 bits should be enough */\ntypedef int LOCFSERROR;         /* use 'int' for calculation temps */\n#else\ntypedef JLONG FSERROR;          /* may need more than 16 bits */\ntypedef JLONG LOCFSERROR;       /* be sure calculation temps are big enough */\n#endif\n\ntypedef FSERROR *FSERRPTR;  /* pointer to error array */\n\n\n/* Private subobject */\n\n#define MAX_Q_COMPS 4           /* max components I can handle */\n\ntypedef struct {\n  struct jpeg_color_quantizer pub; /* public fields */\n\n  /* Initially allocated colormap is saved here */\n  JSAMPARRAY sv_colormap;       /* The color map as a 2-D pixel array */\n  int sv_actual;                /* number of entries in use */\n\n  JSAMPARRAY colorindex;        /* Precomputed mapping for speed */\n  /* colorindex[i][j] = index of color closest to pixel value j in component i,\n   * premultiplied as described above.  Since colormap indexes must fit into\n   * JSAMPLEs, the entries of this array will too.\n   */\n  boolean is_padded;            /* is the colorindex padded for odither? */\n\n  int Ncolors[MAX_Q_COMPS];     /* # of values alloced to each component */\n\n  /* Variables for ordered dithering */\n  int row_index;                /* cur row's vertical index in dither matrix */\n  ODITHER_MATRIX_PTR odither[MAX_Q_COMPS]; /* one dither array per component */\n\n  /* Variables for Floyd-Steinberg dithering */\n  FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */\n  boolean on_odd_row;           /* flag to remember which row we are on */\n} my_cquantizer;\n\ntypedef my_cquantizer *my_cquantize_ptr;\n\n\n/*\n * Policy-making subroutines for create_colormap and create_colorindex.\n * These routines determine the colormap to be used.  The rest of the module\n * only assumes that the colormap is orthogonal.\n *\n *  * select_ncolors decides how to divvy up the available colors\n *    among the components.\n *  * output_value defines the set of representative values for a component.\n *  * largest_input_value defines the mapping from input values to\n *    representative values for a component.\n * Note that the latter two routines may impose different policies for\n * different components, though this is not currently done.\n */\n\n\nLOCAL(int)\nselect_ncolors (j_decompress_ptr cinfo, int Ncolors[])\n/* Determine allocation of desired colors to components, */\n/* and fill in Ncolors[] array to indicate choice. */\n/* Return value is total number of colors (product of Ncolors[] values). */\n{\n  int nc = cinfo->out_color_components; /* number of color components */\n  int max_colors = cinfo->desired_number_of_colors;\n  int total_colors, iroot, i, j;\n  boolean changed;\n  long temp;\n  int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE };\n  RGB_order[0] = rgb_green[cinfo->out_color_space];\n  RGB_order[1] = rgb_red[cinfo->out_color_space];\n  RGB_order[2] = rgb_blue[cinfo->out_color_space];\n\n  /* We can allocate at least the nc'th root of max_colors per component. */\n  /* Compute floor(nc'th root of max_colors). */\n  iroot = 1;\n  do {\n    iroot++;\n    temp = iroot;               /* set temp = iroot ** nc */\n    for (i = 1; i < nc; i++)\n      temp *= iroot;\n  } while (temp <= (long) max_colors); /* repeat till iroot exceeds root */\n  iroot--;                      /* now iroot = floor(root) */\n\n  /* Must have at least 2 color values per component */\n  if (iroot < 2)\n    ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, (int) temp);\n\n  /* Initialize to iroot color values for each component */\n  total_colors = 1;\n  for (i = 0; i < nc; i++) {\n    Ncolors[i] = iroot;\n    total_colors *= iroot;\n  }\n  /* We may be able to increment the count for one or more components without\n   * exceeding max_colors, though we know not all can be incremented.\n   * Sometimes, the first component can be incremented more than once!\n   * (Example: for 16 colors, we start at 2*2*2, go to 3*2*2, then 4*2*2.)\n   * In RGB colorspace, try to increment G first, then R, then B.\n   */\n  do {\n    changed = FALSE;\n    for (i = 0; i < nc; i++) {\n      j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i);\n      /* calculate new total_colors if Ncolors[j] is incremented */\n      temp = total_colors / Ncolors[j];\n      temp *= Ncolors[j]+1;     /* done in long arith to avoid oflo */\n      if (temp > (long) max_colors)\n        break;                  /* won't fit, done with this pass */\n      Ncolors[j]++;             /* OK, apply the increment */\n      total_colors = (int) temp;\n      changed = TRUE;\n    }\n  } while (changed);\n\n  return total_colors;\n}\n\n\nLOCAL(int)\noutput_value (j_decompress_ptr cinfo, int ci, int j, int maxj)\n/* Return j'th output value, where j will range from 0 to maxj */\n/* The output values must fall in 0..MAXJSAMPLE in increasing order */\n{\n  /* We always provide values 0 and MAXJSAMPLE for each component;\n   * any additional values are equally spaced between these limits.\n   * (Forcing the upper and lower values to the limits ensures that\n   * dithering can't produce a color outside the selected gamut.)\n   */\n  return (int) (((JLONG) j * MAXJSAMPLE + maxj/2) / maxj);\n}\n\n\nLOCAL(int)\nlargest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj)\n/* Return largest input value that should map to j'th output value */\n/* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */\n{\n  /* Breakpoints are halfway between values returned by output_value */\n  return (int) (((JLONG) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj));\n}\n\n\n/*\n * Create the colormap.\n */\n\nLOCAL(void)\ncreate_colormap (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  JSAMPARRAY colormap;          /* Created colormap */\n  int total_colors;             /* Number of distinct output colors */\n  int i,j,k, nci, blksize, blkdist, ptr, val;\n\n  /* Select number of colors for each component */\n  total_colors = select_ncolors(cinfo, cquantize->Ncolors);\n\n  /* Report selected color counts */\n  if (cinfo->out_color_components == 3)\n    TRACEMS4(cinfo, 1, JTRC_QUANT_3_NCOLORS,\n             total_colors, cquantize->Ncolors[0],\n             cquantize->Ncolors[1], cquantize->Ncolors[2]);\n  else\n    TRACEMS1(cinfo, 1, JTRC_QUANT_NCOLORS, total_colors);\n\n  /* Allocate and fill in the colormap. */\n  /* The colors are ordered in the map in standard row-major order, */\n  /* i.e. rightmost (highest-indexed) color changes most rapidly. */\n\n  colormap = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE,\n     (JDIMENSION) total_colors, (JDIMENSION) cinfo->out_color_components);\n\n  /* blksize is number of adjacent repeated entries for a component */\n  /* blkdist is distance between groups of identical entries for a component */\n  blkdist = total_colors;\n\n  for (i = 0; i < cinfo->out_color_components; i++) {\n    /* fill in colormap entries for i'th color component */\n    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */\n    blksize = blkdist / nci;\n    for (j = 0; j < nci; j++) {\n      /* Compute j'th output value (out of nci) for component */\n      val = output_value(cinfo, i, j, nci-1);\n      /* Fill in all colormap entries that have this value of this component */\n      for (ptr = j * blksize; ptr < total_colors; ptr += blkdist) {\n        /* fill in blksize entries beginning at ptr */\n        for (k = 0; k < blksize; k++)\n          colormap[i][ptr+k] = (JSAMPLE) val;\n      }\n    }\n    blkdist = blksize;          /* blksize of this color is blkdist of next */\n  }\n\n  /* Save the colormap in private storage,\n   * where it will survive color quantization mode changes.\n   */\n  cquantize->sv_colormap = colormap;\n  cquantize->sv_actual = total_colors;\n}\n\n\n/*\n * Create the color index table.\n */\n\nLOCAL(void)\ncreate_colorindex (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  JSAMPROW indexptr;\n  int i,j,k, nci, blksize, val, pad;\n\n  /* For ordered dither, we pad the color index tables by MAXJSAMPLE in\n   * each direction (input index values can be -MAXJSAMPLE .. 2*MAXJSAMPLE).\n   * This is not necessary in the other dithering modes.  However, we\n   * flag whether it was done in case user changes dithering mode.\n   */\n  if (cinfo->dither_mode == JDITHER_ORDERED) {\n    pad = MAXJSAMPLE*2;\n    cquantize->is_padded = TRUE;\n  } else {\n    pad = 0;\n    cquantize->is_padded = FALSE;\n  }\n\n  cquantize->colorindex = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE,\n     (JDIMENSION) (MAXJSAMPLE+1 + pad),\n     (JDIMENSION) cinfo->out_color_components);\n\n  /* blksize is number of adjacent repeated entries for a component */\n  blksize = cquantize->sv_actual;\n\n  for (i = 0; i < cinfo->out_color_components; i++) {\n    /* fill in colorindex entries for i'th color component */\n    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */\n    blksize = blksize / nci;\n\n    /* adjust colorindex pointers to provide padding at negative indexes. */\n    if (pad)\n      cquantize->colorindex[i] += MAXJSAMPLE;\n\n    /* in loop, val = index of current output value, */\n    /* and k = largest j that maps to current val */\n    indexptr = cquantize->colorindex[i];\n    val = 0;\n    k = largest_input_value(cinfo, i, 0, nci-1);\n    for (j = 0; j <= MAXJSAMPLE; j++) {\n      while (j > k)             /* advance val if past boundary */\n        k = largest_input_value(cinfo, i, ++val, nci-1);\n      /* premultiply so that no multiplication needed in main processing */\n      indexptr[j] = (JSAMPLE) (val * blksize);\n    }\n    /* Pad at both ends if necessary */\n    if (pad)\n      for (j = 1; j <= MAXJSAMPLE; j++) {\n        indexptr[-j] = indexptr[0];\n        indexptr[MAXJSAMPLE+j] = indexptr[MAXJSAMPLE];\n      }\n  }\n}\n\n\n/*\n * Create an ordered-dither array for a component having ncolors\n * distinct output values.\n */\n\nLOCAL(ODITHER_MATRIX_PTR)\nmake_odither_array (j_decompress_ptr cinfo, int ncolors)\n{\n  ODITHER_MATRIX_PTR odither;\n  int j,k;\n  JLONG num,den;\n\n  odither = (ODITHER_MATRIX_PTR)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(ODITHER_MATRIX));\n  /* The inter-value distance for this color is MAXJSAMPLE/(ncolors-1).\n   * Hence the dither value for the matrix cell with fill order f\n   * (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1).\n   * On 16-bit-int machine, be careful to avoid overflow.\n   */\n  den = 2 * ODITHER_CELLS * ((JLONG) (ncolors - 1));\n  for (j = 0; j < ODITHER_SIZE; j++) {\n    for (k = 0; k < ODITHER_SIZE; k++) {\n      num = ((JLONG) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k])))\n            * MAXJSAMPLE;\n      /* Ensure round towards zero despite C's lack of consistency\n       * about rounding negative values in integer division...\n       */\n      odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den);\n    }\n  }\n  return odither;\n}\n\n\n/*\n * Create the ordered-dither tables.\n * Components having the same number of representative colors may\n * share a dither table.\n */\n\nLOCAL(void)\ncreate_odither_tables (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  ODITHER_MATRIX_PTR odither;\n  int i, j, nci;\n\n  for (i = 0; i < cinfo->out_color_components; i++) {\n    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */\n    odither = NULL;             /* search for matching prior component */\n    for (j = 0; j < i; j++) {\n      if (nci == cquantize->Ncolors[j]) {\n        odither = cquantize->odither[j];\n        break;\n      }\n    }\n    if (odither == NULL)        /* need a new table? */\n      odither = make_odither_array(cinfo, nci);\n    cquantize->odither[i] = odither;\n  }\n}\n\n\n/*\n * Map some rows of pixels to the output colormapped representation.\n */\n\nMETHODDEF(void)\ncolor_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n                JSAMPARRAY output_buf, int num_rows)\n/* General case, no dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  JSAMPARRAY colorindex = cquantize->colorindex;\n  register int pixcode, ci;\n  register JSAMPROW ptrin, ptrout;\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n  register int nc = cinfo->out_color_components;\n\n  for (row = 0; row < num_rows; row++) {\n    ptrin = input_buf[row];\n    ptrout = output_buf[row];\n    for (col = width; col > 0; col--) {\n      pixcode = 0;\n      for (ci = 0; ci < nc; ci++) {\n        pixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]);\n      }\n      *ptrout++ = (JSAMPLE) pixcode;\n    }\n  }\n}\n\n\nMETHODDEF(void)\ncolor_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n                 JSAMPARRAY output_buf, int num_rows)\n/* Fast path for out_color_components==3, no dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  register int pixcode;\n  register JSAMPROW ptrin, ptrout;\n  JSAMPROW colorindex0 = cquantize->colorindex[0];\n  JSAMPROW colorindex1 = cquantize->colorindex[1];\n  JSAMPROW colorindex2 = cquantize->colorindex[2];\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n\n  for (row = 0; row < num_rows; row++) {\n    ptrin = input_buf[row];\n    ptrout = output_buf[row];\n    for (col = width; col > 0; col--) {\n      pixcode  = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]);\n      pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]);\n      pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]);\n      *ptrout++ = (JSAMPLE) pixcode;\n    }\n  }\n}\n\n\nMETHODDEF(void)\nquantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n                     JSAMPARRAY output_buf, int num_rows)\n/* General case, with ordered dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  register JSAMPROW input_ptr;\n  register JSAMPROW output_ptr;\n  JSAMPROW colorindex_ci;\n  int *dither;                  /* points to active row of dither matrix */\n  int row_index, col_index;     /* current indexes into dither matrix */\n  int nc = cinfo->out_color_components;\n  int ci;\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n\n  for (row = 0; row < num_rows; row++) {\n    /* Initialize output values to 0 so can process components separately */\n    jzero_far((void *) output_buf[row], (size_t) (width * sizeof(JSAMPLE)));\n    row_index = cquantize->row_index;\n    for (ci = 0; ci < nc; ci++) {\n      input_ptr = input_buf[row] + ci;\n      output_ptr = output_buf[row];\n      colorindex_ci = cquantize->colorindex[ci];\n      dither = cquantize->odither[ci][row_index];\n      col_index = 0;\n\n      for (col = width; col > 0; col--) {\n        /* Form pixel value + dither, range-limit to 0..MAXJSAMPLE,\n         * select output value, accumulate into output code for this pixel.\n         * Range-limiting need not be done explicitly, as we have extended\n         * the colorindex table to produce the right answers for out-of-range\n         * inputs.  The maximum dither is +- MAXJSAMPLE; this sets the\n         * required amount of padding.\n         */\n        *output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]];\n        input_ptr += nc;\n        output_ptr++;\n        col_index = (col_index + 1) & ODITHER_MASK;\n      }\n    }\n    /* Advance row index for next row */\n    row_index = (row_index + 1) & ODITHER_MASK;\n    cquantize->row_index = row_index;\n  }\n}\n\n\nMETHODDEF(void)\nquantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n                      JSAMPARRAY output_buf, int num_rows)\n/* Fast path for out_color_components==3, with ordered dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  register int pixcode;\n  register JSAMPROW input_ptr;\n  register JSAMPROW output_ptr;\n  JSAMPROW colorindex0 = cquantize->colorindex[0];\n  JSAMPROW colorindex1 = cquantize->colorindex[1];\n  JSAMPROW colorindex2 = cquantize->colorindex[2];\n  int *dither0;                 /* points to active row of dither matrix */\n  int *dither1;\n  int *dither2;\n  int row_index, col_index;     /* current indexes into dither matrix */\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n\n  for (row = 0; row < num_rows; row++) {\n    row_index = cquantize->row_index;\n    input_ptr = input_buf[row];\n    output_ptr = output_buf[row];\n    dither0 = cquantize->odither[0][row_index];\n    dither1 = cquantize->odither[1][row_index];\n    dither2 = cquantize->odither[2][row_index];\n    col_index = 0;\n\n    for (col = width; col > 0; col--) {\n      pixcode  = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) +\n                                        dither0[col_index]]);\n      pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) +\n                                        dither1[col_index]]);\n      pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) +\n                                        dither2[col_index]]);\n      *output_ptr++ = (JSAMPLE) pixcode;\n      col_index = (col_index + 1) & ODITHER_MASK;\n    }\n    row_index = (row_index + 1) & ODITHER_MASK;\n    cquantize->row_index = row_index;\n  }\n}\n\n\nMETHODDEF(void)\nquantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n                    JSAMPARRAY output_buf, int num_rows)\n/* General case, with Floyd-Steinberg dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  register LOCFSERROR cur;      /* current error or pixel value */\n  LOCFSERROR belowerr;          /* error for pixel below cur */\n  LOCFSERROR bpreverr;          /* error for below/prev col */\n  LOCFSERROR bnexterr;          /* error for below/next col */\n  LOCFSERROR delta;\n  register FSERRPTR errorptr;   /* => fserrors[] at column before current */\n  register JSAMPROW input_ptr;\n  register JSAMPROW output_ptr;\n  JSAMPROW colorindex_ci;\n  JSAMPROW colormap_ci;\n  int pixcode;\n  int nc = cinfo->out_color_components;\n  int dir;                      /* 1 for left-to-right, -1 for right-to-left */\n  int dirnc;                    /* dir * nc */\n  int ci;\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n  JSAMPLE *range_limit = cinfo->sample_range_limit;\n  SHIFT_TEMPS\n\n  for (row = 0; row < num_rows; row++) {\n    /* Initialize output values to 0 so can process components separately */\n    jzero_far((void *) output_buf[row], (size_t) (width * sizeof(JSAMPLE)));\n    for (ci = 0; ci < nc; ci++) {\n      input_ptr = input_buf[row] + ci;\n      output_ptr = output_buf[row];\n      if (cquantize->on_odd_row) {\n        /* work right to left in this row */\n        input_ptr += (width-1) * nc; /* so point to rightmost pixel */\n        output_ptr += width-1;\n        dir = -1;\n        dirnc = -nc;\n        errorptr = cquantize->fserrors[ci] + (width+1); /* => entry after last column */\n      } else {\n        /* work left to right in this row */\n        dir = 1;\n        dirnc = nc;\n        errorptr = cquantize->fserrors[ci]; /* => entry before first column */\n      }\n      colorindex_ci = cquantize->colorindex[ci];\n      colormap_ci = cquantize->sv_colormap[ci];\n      /* Preset error values: no error propagated to first pixel from left */\n      cur = 0;\n      /* and no error propagated to row below yet */\n      belowerr = bpreverr = 0;\n\n      for (col = width; col > 0; col--) {\n        /* cur holds the error propagated from the previous pixel on the\n         * current line.  Add the error propagated from the previous line\n         * to form the complete error correction term for this pixel, and\n         * round the error term (which is expressed * 16) to an integer.\n         * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct\n         * for either sign of the error value.\n         * Note: errorptr points to *previous* column's array entry.\n         */\n        cur = RIGHT_SHIFT(cur + errorptr[dir] + 8, 4);\n        /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE.\n         * The maximum error is +- MAXJSAMPLE; this sets the required size\n         * of the range_limit array.\n         */\n        cur += GETJSAMPLE(*input_ptr);\n        cur = GETJSAMPLE(range_limit[cur]);\n        /* Select output value, accumulate into output code for this pixel */\n        pixcode = GETJSAMPLE(colorindex_ci[cur]);\n        *output_ptr += (JSAMPLE) pixcode;\n        /* Compute actual representation error at this pixel */\n        /* Note: we can do this even though we don't have the final */\n        /* pixel code, because the colormap is orthogonal. */\n        cur -= GETJSAMPLE(colormap_ci[pixcode]);\n        /* Compute error fractions to be propagated to adjacent pixels.\n         * Add these into the running sums, and simultaneously shift the\n         * next-line error sums left by 1 column.\n         */\n        bnexterr = cur;\n        delta = cur * 2;\n        cur += delta;           /* form error * 3 */\n        errorptr[0] = (FSERROR) (bpreverr + cur);\n        cur += delta;           /* form error * 5 */\n        bpreverr = belowerr + cur;\n        belowerr = bnexterr;\n        cur += delta;           /* form error * 7 */\n        /* At this point cur contains the 7/16 error value to be propagated\n         * to the next pixel on the current line, and all the errors for the\n         * next line have been shifted over. We are therefore ready to move on.\n         */\n        input_ptr += dirnc;     /* advance input ptr to next column */\n        output_ptr += dir;      /* advance output ptr to next column */\n        errorptr += dir;        /* advance errorptr to current column */\n      }\n      /* Post-loop cleanup: we must unload the final error value into the\n       * final fserrors[] entry.  Note we need not unload belowerr because\n       * it is for the dummy column before or after the actual array.\n       */\n      errorptr[0] = (FSERROR) bpreverr; /* unload prev err into array */\n    }\n    cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : TRUE);\n  }\n}\n\n\n/*\n * Allocate workspace for Floyd-Steinberg errors.\n */\n\nLOCAL(void)\nalloc_fs_workspace (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  size_t arraysize;\n  int i;\n\n  arraysize = (size_t) ((cinfo->output_width + 2) * sizeof(FSERROR));\n  for (i = 0; i < cinfo->out_color_components; i++) {\n    cquantize->fserrors[i] = (FSERRPTR)\n      (*cinfo->mem->alloc_large)((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);\n  }\n}\n\n\n/*\n * Initialize for one-pass color quantization.\n */\n\nMETHODDEF(void)\nstart_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  size_t arraysize;\n  int i;\n\n  /* Install my colormap. */\n  cinfo->colormap = cquantize->sv_colormap;\n  cinfo->actual_number_of_colors = cquantize->sv_actual;\n\n  /* Initialize for desired dithering mode. */\n  switch (cinfo->dither_mode) {\n  case JDITHER_NONE:\n    if (cinfo->out_color_components == 3)\n      cquantize->pub.color_quantize = color_quantize3;\n    else\n      cquantize->pub.color_quantize = color_quantize;\n    break;\n  case JDITHER_ORDERED:\n    if (cinfo->out_color_components == 3)\n      cquantize->pub.color_quantize = quantize3_ord_dither;\n    else\n      cquantize->pub.color_quantize = quantize_ord_dither;\n    cquantize->row_index = 0;   /* initialize state for ordered dither */\n    /* If user changed to ordered dither from another mode,\n     * we must recreate the color index table with padding.\n     * This will cost extra space, but probably isn't very likely.\n     */\n    if (! cquantize->is_padded)\n      create_colorindex(cinfo);\n    /* Create ordered-dither tables if we didn't already. */\n    if (cquantize->odither[0] == NULL)\n      create_odither_tables(cinfo);\n    break;\n  case JDITHER_FS:\n    cquantize->pub.color_quantize = quantize_fs_dither;\n    cquantize->on_odd_row = FALSE; /* initialize state for F-S dither */\n    /* Allocate Floyd-Steinberg workspace if didn't already. */\n    if (cquantize->fserrors[0] == NULL)\n      alloc_fs_workspace(cinfo);\n    /* Initialize the propagated errors to zero. */\n    arraysize = (size_t) ((cinfo->output_width + 2) * sizeof(FSERROR));\n    for (i = 0; i < cinfo->out_color_components; i++)\n      jzero_far((void *) cquantize->fserrors[i], arraysize);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n    break;\n  }\n}\n\n\n/*\n * Finish up at the end of the pass.\n */\n\nMETHODDEF(void)\nfinish_pass_1_quant (j_decompress_ptr cinfo)\n{\n  /* no work in 1-pass case */\n}\n\n\n/*\n * Switch to a new external colormap between output passes.\n * Shouldn't get to this module!\n */\n\nMETHODDEF(void)\nnew_color_map_1_quant (j_decompress_ptr cinfo)\n{\n  ERREXIT(cinfo, JERR_MODE_CHANGE);\n}\n\n\n/*\n * Module initialization routine for 1-pass color quantization.\n */\n\nGLOBAL(void)\njinit_1pass_quantizer (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize;\n\n  cquantize = (my_cquantize_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_cquantizer));\n  cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;\n  cquantize->pub.start_pass = start_pass_1_quant;\n  cquantize->pub.finish_pass = finish_pass_1_quant;\n  cquantize->pub.new_color_map = new_color_map_1_quant;\n  cquantize->fserrors[0] = NULL; /* Flag FS workspace not allocated */\n  cquantize->odither[0] = NULL; /* Also flag odither arrays not allocated */\n\n  /* Make sure my internal arrays won't overflow */\n  if (cinfo->out_color_components > MAX_Q_COMPS)\n    ERREXIT1(cinfo, JERR_QUANT_COMPONENTS, MAX_Q_COMPS);\n  /* Make sure colormap indexes can be represented by JSAMPLEs */\n  if (cinfo->desired_number_of_colors > (MAXJSAMPLE+1))\n    ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXJSAMPLE+1);\n\n  /* Create the colormap and color index table. */\n  create_colormap(cinfo);\n  create_colorindex(cinfo);\n\n  /* Allocate Floyd-Steinberg workspace now if requested.\n   * We do this now since it may affect the memory manager's space\n   * calculations.  If the user changes to FS dither mode in a later pass, we\n   * will allocate the space then, and will possibly overrun the\n   * max_memory_to_use setting.\n   */\n  if (cinfo->dither_mode == JDITHER_FS)\n    alloc_fs_workspace(cinfo);\n}\n\n#endif /* QUANT_1PASS_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jquant2.c",
    "content": "/*\n * jquant2.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009, 2014-2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains 2-pass color quantization (color mapping) routines.\n * These routines provide selection of a custom color map for an image,\n * followed by mapping of the image to that color map, with optional\n * Floyd-Steinberg dithering.\n * It is also possible to use just the second pass to map to an arbitrary\n * externally-given color map.\n *\n * Note: ordered dithering is not supported, since there isn't any fast\n * way to compute intercolor distances; it's unclear that ordered dither's\n * fundamental assumptions even hold with an irregularly spaced color map.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n#ifdef QUANT_2PASS_SUPPORTED\n\n\n/*\n * This module implements the well-known Heckbert paradigm for color\n * quantization.  Most of the ideas used here can be traced back to\n * Heckbert's seminal paper\n *   Heckbert, Paul.  \"Color Image Quantization for Frame Buffer Display\",\n *   Proc. SIGGRAPH '82, Computer Graphics v.16 #3 (July 1982), pp 297-304.\n *\n * In the first pass over the image, we accumulate a histogram showing the\n * usage count of each possible color.  To keep the histogram to a reasonable\n * size, we reduce the precision of the input; typical practice is to retain\n * 5 or 6 bits per color, so that 8 or 4 different input values are counted\n * in the same histogram cell.\n *\n * Next, the color-selection step begins with a box representing the whole\n * color space, and repeatedly splits the \"largest\" remaining box until we\n * have as many boxes as desired colors.  Then the mean color in each\n * remaining box becomes one of the possible output colors.\n *\n * The second pass over the image maps each input pixel to the closest output\n * color (optionally after applying a Floyd-Steinberg dithering correction).\n * This mapping is logically trivial, but making it go fast enough requires\n * considerable care.\n *\n * Heckbert-style quantizers vary a good deal in their policies for choosing\n * the \"largest\" box and deciding where to cut it.  The particular policies\n * used here have proved out well in experimental comparisons, but better ones\n * may yet be found.\n *\n * In earlier versions of the IJG code, this module quantized in YCbCr color\n * space, processing the raw upsampled data without a color conversion step.\n * This allowed the color conversion math to be done only once per colormap\n * entry, not once per pixel.  However, that optimization precluded other\n * useful optimizations (such as merging color conversion with upsampling)\n * and it also interfered with desired capabilities such as quantizing to an\n * externally-supplied colormap.  We have therefore abandoned that approach.\n * The present code works in the post-conversion color space, typically RGB.\n *\n * To improve the visual quality of the results, we actually work in scaled\n * RGB space, giving G distances more weight than R, and R in turn more than\n * B.  To do everything in integer math, we must use integer scale factors.\n * The 2/3/1 scale factors used here correspond loosely to the relative\n * weights of the colors in the NTSC grayscale equation.\n * If you want to use this code to quantize a non-RGB color space, you'll\n * probably need to change these scale factors.\n */\n\n#define R_SCALE 2               /* scale R distances by this much */\n#define G_SCALE 3               /* scale G distances by this much */\n#define B_SCALE 1               /* and B by this much */\n\nstatic const int c_scales[3]={R_SCALE, G_SCALE, B_SCALE};\n#define C0_SCALE c_scales[rgb_red[cinfo->out_color_space]]\n#define C1_SCALE c_scales[rgb_green[cinfo->out_color_space]]\n#define C2_SCALE c_scales[rgb_blue[cinfo->out_color_space]]\n\n/*\n * First we have the histogram data structure and routines for creating it.\n *\n * The number of bits of precision can be adjusted by changing these symbols.\n * We recommend keeping 6 bits for G and 5 each for R and B.\n * If you have plenty of memory and cycles, 6 bits all around gives marginally\n * better results; if you are short of memory, 5 bits all around will save\n * some space but degrade the results.\n * To maintain a fully accurate histogram, we'd need to allocate a \"long\"\n * (preferably unsigned long) for each cell.  In practice this is overkill;\n * we can get by with 16 bits per cell.  Few of the cell counts will overflow,\n * and clamping those that do overflow to the maximum value will give close-\n * enough results.  This reduces the recommended histogram size from 256Kb\n * to 128Kb, which is a useful savings on PC-class machines.\n * (In the second pass the histogram space is re-used for pixel mapping data;\n * in that capacity, each cell must be able to store zero to the number of\n * desired colors.  16 bits/cell is plenty for that too.)\n * Since the JPEG code is intended to run in small memory model on 80x86\n * machines, we can't just allocate the histogram in one chunk.  Instead\n * of a true 3-D array, we use a row of pointers to 2-D arrays.  Each\n * pointer corresponds to a C0 value (typically 2^5 = 32 pointers) and\n * each 2-D array has 2^6*2^5 = 2048 or 2^6*2^6 = 4096 entries.\n */\n\n#define MAXNUMCOLORS  (MAXJSAMPLE+1) /* maximum size of colormap */\n\n/* These will do the right thing for either R,G,B or B,G,R color order,\n * but you may not like the results for other color orders.\n */\n#define HIST_C0_BITS  5         /* bits of precision in R/B histogram */\n#define HIST_C1_BITS  6         /* bits of precision in G histogram */\n#define HIST_C2_BITS  5         /* bits of precision in B/R histogram */\n\n/* Number of elements along histogram axes. */\n#define HIST_C0_ELEMS  (1<<HIST_C0_BITS)\n#define HIST_C1_ELEMS  (1<<HIST_C1_BITS)\n#define HIST_C2_ELEMS  (1<<HIST_C2_BITS)\n\n/* These are the amounts to shift an input value to get a histogram index. */\n#define C0_SHIFT  (BITS_IN_JSAMPLE-HIST_C0_BITS)\n#define C1_SHIFT  (BITS_IN_JSAMPLE-HIST_C1_BITS)\n#define C2_SHIFT  (BITS_IN_JSAMPLE-HIST_C2_BITS)\n\n\ntypedef UINT16 histcell;        /* histogram cell; prefer an unsigned type */\n\ntypedef histcell *histptr; /* for pointers to histogram cells */\n\ntypedef histcell hist1d[HIST_C2_ELEMS]; /* typedefs for the array */\ntypedef hist1d *hist2d;         /* type for the 2nd-level pointers */\ntypedef hist2d *hist3d;         /* type for top-level pointer */\n\n\n/* Declarations for Floyd-Steinberg dithering.\n *\n * Errors are accumulated into the array fserrors[], at a resolution of\n * 1/16th of a pixel count.  The error at a given pixel is propagated\n * to its not-yet-processed neighbors using the standard F-S fractions,\n *              ...     (here)  7/16\n *              3/16    5/16    1/16\n * We work left-to-right on even rows, right-to-left on odd rows.\n *\n * We can get away with a single array (holding one row's worth of errors)\n * by using it to store the current row's errors at pixel columns not yet\n * processed, but the next row's errors at columns already processed.  We\n * need only a few extra variables to hold the errors immediately around the\n * current column.  (If we are lucky, those variables are in registers, but\n * even if not, they're probably cheaper to access than array elements are.)\n *\n * The fserrors[] array has (#columns + 2) entries; the extra entry at\n * each end saves us from special-casing the first and last pixels.\n * Each entry is three values long, one value for each color component.\n */\n\n#if BITS_IN_JSAMPLE == 8\ntypedef INT16 FSERROR;          /* 16 bits should be enough */\ntypedef int LOCFSERROR;         /* use 'int' for calculation temps */\n#else\ntypedef JLONG FSERROR;          /* may need more than 16 bits */\ntypedef JLONG LOCFSERROR;       /* be sure calculation temps are big enough */\n#endif\n\ntypedef FSERROR *FSERRPTR;      /* pointer to error array */\n\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_color_quantizer pub; /* public fields */\n\n  /* Space for the eventually created colormap is stashed here */\n  JSAMPARRAY sv_colormap;       /* colormap allocated at init time */\n  int desired;                  /* desired # of colors = size of colormap */\n\n  /* Variables for accumulating image statistics */\n  hist3d histogram;             /* pointer to the histogram */\n\n  boolean needs_zeroed;         /* TRUE if next pass must zero histogram */\n\n  /* Variables for Floyd-Steinberg dithering */\n  FSERRPTR fserrors;            /* accumulated errors */\n  boolean on_odd_row;           /* flag to remember which row we are on */\n  int *error_limiter;           /* table for clamping the applied error */\n} my_cquantizer;\n\ntypedef my_cquantizer *my_cquantize_ptr;\n\n\n/*\n * Prescan some rows of pixels.\n * In this module the prescan simply updates the histogram, which has been\n * initialized to zeroes by start_pass.\n * An output_buf parameter is required by the method signature, but no data\n * is actually output (in fact the buffer controller is probably passing a\n * NULL pointer).\n */\n\nMETHODDEF(void)\nprescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n                  JSAMPARRAY output_buf, int num_rows)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  register JSAMPROW ptr;\n  register histptr histp;\n  register hist3d histogram = cquantize->histogram;\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n\n  for (row = 0; row < num_rows; row++) {\n    ptr = input_buf[row];\n    for (col = width; col > 0; col--) {\n      /* get pixel value and index into the histogram */\n      histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT]\n                         [GETJSAMPLE(ptr[1]) >> C1_SHIFT]\n                         [GETJSAMPLE(ptr[2]) >> C2_SHIFT];\n      /* increment, check for overflow and undo increment if so. */\n      if (++(*histp) <= 0)\n        (*histp)--;\n      ptr += 3;\n    }\n  }\n}\n\n\n/*\n * Next we have the really interesting routines: selection of a colormap\n * given the completed histogram.\n * These routines work with a list of \"boxes\", each representing a rectangular\n * subset of the input color space (to histogram precision).\n */\n\ntypedef struct {\n  /* The bounds of the box (inclusive); expressed as histogram indexes */\n  int c0min, c0max;\n  int c1min, c1max;\n  int c2min, c2max;\n  /* The volume (actually 2-norm) of the box */\n  JLONG volume;\n  /* The number of nonzero histogram cells within this box */\n  long colorcount;\n} box;\n\ntypedef box *boxptr;\n\n\nLOCAL(boxptr)\nfind_biggest_color_pop (boxptr boxlist, int numboxes)\n/* Find the splittable box with the largest color population */\n/* Returns NULL if no splittable boxes remain */\n{\n  register boxptr boxp;\n  register int i;\n  register long maxc = 0;\n  boxptr which = NULL;\n\n  for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {\n    if (boxp->colorcount > maxc && boxp->volume > 0) {\n      which = boxp;\n      maxc = boxp->colorcount;\n    }\n  }\n  return which;\n}\n\n\nLOCAL(boxptr)\nfind_biggest_volume (boxptr boxlist, int numboxes)\n/* Find the splittable box with the largest (scaled) volume */\n/* Returns NULL if no splittable boxes remain */\n{\n  register boxptr boxp;\n  register int i;\n  register JLONG maxv = 0;\n  boxptr which = NULL;\n\n  for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {\n    if (boxp->volume > maxv) {\n      which = boxp;\n      maxv = boxp->volume;\n    }\n  }\n  return which;\n}\n\n\nLOCAL(void)\nupdate_box (j_decompress_ptr cinfo, boxptr boxp)\n/* Shrink the min/max bounds of a box to enclose only nonzero elements, */\n/* and recompute its volume and population */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  histptr histp;\n  int c0,c1,c2;\n  int c0min,c0max,c1min,c1max,c2min,c2max;\n  JLONG dist0,dist1,dist2;\n  long ccount;\n\n  c0min = boxp->c0min;  c0max = boxp->c0max;\n  c1min = boxp->c1min;  c1max = boxp->c1max;\n  c2min = boxp->c2min;  c2max = boxp->c2max;\n\n  if (c0max > c0min)\n    for (c0 = c0min; c0 <= c0max; c0++)\n      for (c1 = c1min; c1 <= c1max; c1++) {\n        histp = & histogram[c0][c1][c2min];\n        for (c2 = c2min; c2 <= c2max; c2++)\n          if (*histp++ != 0) {\n            boxp->c0min = c0min = c0;\n            goto have_c0min;\n          }\n      }\n have_c0min:\n  if (c0max > c0min)\n    for (c0 = c0max; c0 >= c0min; c0--)\n      for (c1 = c1min; c1 <= c1max; c1++) {\n        histp = & histogram[c0][c1][c2min];\n        for (c2 = c2min; c2 <= c2max; c2++)\n          if (*histp++ != 0) {\n            boxp->c0max = c0max = c0;\n            goto have_c0max;\n          }\n      }\n have_c0max:\n  if (c1max > c1min)\n    for (c1 = c1min; c1 <= c1max; c1++)\n      for (c0 = c0min; c0 <= c0max; c0++) {\n        histp = & histogram[c0][c1][c2min];\n        for (c2 = c2min; c2 <= c2max; c2++)\n          if (*histp++ != 0) {\n            boxp->c1min = c1min = c1;\n            goto have_c1min;\n          }\n      }\n have_c1min:\n  if (c1max > c1min)\n    for (c1 = c1max; c1 >= c1min; c1--)\n      for (c0 = c0min; c0 <= c0max; c0++) {\n        histp = & histogram[c0][c1][c2min];\n        for (c2 = c2min; c2 <= c2max; c2++)\n          if (*histp++ != 0) {\n            boxp->c1max = c1max = c1;\n            goto have_c1max;\n          }\n      }\n have_c1max:\n  if (c2max > c2min)\n    for (c2 = c2min; c2 <= c2max; c2++)\n      for (c0 = c0min; c0 <= c0max; c0++) {\n        histp = & histogram[c0][c1min][c2];\n        for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS)\n          if (*histp != 0) {\n            boxp->c2min = c2min = c2;\n            goto have_c2min;\n          }\n      }\n have_c2min:\n  if (c2max > c2min)\n    for (c2 = c2max; c2 >= c2min; c2--)\n      for (c0 = c0min; c0 <= c0max; c0++) {\n        histp = & histogram[c0][c1min][c2];\n        for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS)\n          if (*histp != 0) {\n            boxp->c2max = c2max = c2;\n            goto have_c2max;\n          }\n      }\n have_c2max:\n\n  /* Update box volume.\n   * We use 2-norm rather than real volume here; this biases the method\n   * against making long narrow boxes, and it has the side benefit that\n   * a box is splittable iff norm > 0.\n   * Since the differences are expressed in histogram-cell units,\n   * we have to shift back to JSAMPLE units to get consistent distances;\n   * after which, we scale according to the selected distance scale factors.\n   */\n  dist0 = ((c0max - c0min) << C0_SHIFT) * C0_SCALE;\n  dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE;\n  dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE;\n  boxp->volume = dist0*dist0 + dist1*dist1 + dist2*dist2;\n\n  /* Now scan remaining volume of box and compute population */\n  ccount = 0;\n  for (c0 = c0min; c0 <= c0max; c0++)\n    for (c1 = c1min; c1 <= c1max; c1++) {\n      histp = & histogram[c0][c1][c2min];\n      for (c2 = c2min; c2 <= c2max; c2++, histp++)\n        if (*histp != 0) {\n          ccount++;\n        }\n    }\n  boxp->colorcount = ccount;\n}\n\n\nLOCAL(int)\nmedian_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes,\n            int desired_colors)\n/* Repeatedly select and split the largest box until we have enough boxes */\n{\n  int n,lb;\n  int c0,c1,c2,cmax;\n  register boxptr b1,b2;\n\n  while (numboxes < desired_colors) {\n    /* Select box to split.\n     * Current algorithm: by population for first half, then by volume.\n     */\n    if (numboxes*2 <= desired_colors) {\n      b1 = find_biggest_color_pop(boxlist, numboxes);\n    } else {\n      b1 = find_biggest_volume(boxlist, numboxes);\n    }\n    if (b1 == NULL)             /* no splittable boxes left! */\n      break;\n    b2 = &boxlist[numboxes];    /* where new box will go */\n    /* Copy the color bounds to the new box. */\n    b2->c0max = b1->c0max; b2->c1max = b1->c1max; b2->c2max = b1->c2max;\n    b2->c0min = b1->c0min; b2->c1min = b1->c1min; b2->c2min = b1->c2min;\n    /* Choose which axis to split the box on.\n     * Current algorithm: longest scaled axis.\n     * See notes in update_box about scaling distances.\n     */\n    c0 = ((b1->c0max - b1->c0min) << C0_SHIFT) * C0_SCALE;\n    c1 = ((b1->c1max - b1->c1min) << C1_SHIFT) * C1_SCALE;\n    c2 = ((b1->c2max - b1->c2min) << C2_SHIFT) * C2_SCALE;\n    /* We want to break any ties in favor of green, then red, blue last.\n     * This code does the right thing for R,G,B or B,G,R color orders only.\n     */\n    if (rgb_red[cinfo->out_color_space] == 0) {\n      cmax = c1; n = 1;\n      if (c0 > cmax) { cmax = c0; n = 0; }\n      if (c2 > cmax) { n = 2; }\n    }\n    else {\n      cmax = c1; n = 1;\n      if (c2 > cmax) { cmax = c2; n = 2; }\n      if (c0 > cmax) { n = 0; }\n    }\n    /* Choose split point along selected axis, and update box bounds.\n     * Current algorithm: split at halfway point.\n     * (Since the box has been shrunk to minimum volume,\n     * any split will produce two nonempty subboxes.)\n     * Note that lb value is max for lower box, so must be < old max.\n     */\n    switch (n) {\n    case 0:\n      lb = (b1->c0max + b1->c0min) / 2;\n      b1->c0max = lb;\n      b2->c0min = lb+1;\n      break;\n    case 1:\n      lb = (b1->c1max + b1->c1min) / 2;\n      b1->c1max = lb;\n      b2->c1min = lb+1;\n      break;\n    case 2:\n      lb = (b1->c2max + b1->c2min) / 2;\n      b1->c2max = lb;\n      b2->c2min = lb+1;\n      break;\n    }\n    /* Update stats for boxes */\n    update_box(cinfo, b1);\n    update_box(cinfo, b2);\n    numboxes++;\n  }\n  return numboxes;\n}\n\n\nLOCAL(void)\ncompute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor)\n/* Compute representative color for a box, put it in colormap[icolor] */\n{\n  /* Current algorithm: mean weighted by pixels (not colors) */\n  /* Note it is important to get the rounding correct! */\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  histptr histp;\n  int c0,c1,c2;\n  int c0min,c0max,c1min,c1max,c2min,c2max;\n  long count;\n  long total = 0;\n  long c0total = 0;\n  long c1total = 0;\n  long c2total = 0;\n\n  c0min = boxp->c0min;  c0max = boxp->c0max;\n  c1min = boxp->c1min;  c1max = boxp->c1max;\n  c2min = boxp->c2min;  c2max = boxp->c2max;\n\n  for (c0 = c0min; c0 <= c0max; c0++)\n    for (c1 = c1min; c1 <= c1max; c1++) {\n      histp = & histogram[c0][c1][c2min];\n      for (c2 = c2min; c2 <= c2max; c2++) {\n        if ((count = *histp++) != 0) {\n          total += count;\n          c0total += ((c0 << C0_SHIFT) + ((1<<C0_SHIFT)>>1)) * count;\n          c1total += ((c1 << C1_SHIFT) + ((1<<C1_SHIFT)>>1)) * count;\n          c2total += ((c2 << C2_SHIFT) + ((1<<C2_SHIFT)>>1)) * count;\n        }\n      }\n    }\n\n  cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total);\n  cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total);\n  cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total);\n}\n\n\nLOCAL(void)\nselect_colors (j_decompress_ptr cinfo, int desired_colors)\n/* Master routine for color selection */\n{\n  boxptr boxlist;\n  int numboxes;\n  int i;\n\n  /* Allocate workspace for box list */\n  boxlist = (boxptr) (*cinfo->mem->alloc_small)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * sizeof(box));\n  /* Initialize one box containing whole space */\n  numboxes = 1;\n  boxlist[0].c0min = 0;\n  boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT;\n  boxlist[0].c1min = 0;\n  boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT;\n  boxlist[0].c2min = 0;\n  boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT;\n  /* Shrink it to actually-used volume and set its statistics */\n  update_box(cinfo, & boxlist[0]);\n  /* Perform median-cut to produce final box list */\n  numboxes = median_cut(cinfo, boxlist, numboxes, desired_colors);\n  /* Compute the representative color for each box, fill colormap */\n  for (i = 0; i < numboxes; i++)\n    compute_color(cinfo, & boxlist[i], i);\n  cinfo->actual_number_of_colors = numboxes;\n  TRACEMS1(cinfo, 1, JTRC_QUANT_SELECTED, numboxes);\n}\n\n\n/*\n * These routines are concerned with the time-critical task of mapping input\n * colors to the nearest color in the selected colormap.\n *\n * We re-use the histogram space as an \"inverse color map\", essentially a\n * cache for the results of nearest-color searches.  All colors within a\n * histogram cell will be mapped to the same colormap entry, namely the one\n * closest to the cell's center.  This may not be quite the closest entry to\n * the actual input color, but it's almost as good.  A zero in the cache\n * indicates we haven't found the nearest color for that cell yet; the array\n * is cleared to zeroes before starting the mapping pass.  When we find the\n * nearest color for a cell, its colormap index plus one is recorded in the\n * cache for future use.  The pass2 scanning routines call fill_inverse_cmap\n * when they need to use an unfilled entry in the cache.\n *\n * Our method of efficiently finding nearest colors is based on the \"locally\n * sorted search\" idea described by Heckbert and on the incremental distance\n * calculation described by Spencer W. Thomas in chapter III.1 of Graphics\n * Gems II (James Arvo, ed.  Academic Press, 1991).  Thomas points out that\n * the distances from a given colormap entry to each cell of the histogram can\n * be computed quickly using an incremental method: the differences between\n * distances to adjacent cells themselves differ by a constant.  This allows a\n * fairly fast implementation of the \"brute force\" approach of computing the\n * distance from every colormap entry to every histogram cell.  Unfortunately,\n * it needs a work array to hold the best-distance-so-far for each histogram\n * cell (because the inner loop has to be over cells, not colormap entries).\n * The work array elements have to be JLONGs, so the work array would need\n * 256Kb at our recommended precision.  This is not feasible in DOS machines.\n *\n * To get around these problems, we apply Thomas' method to compute the\n * nearest colors for only the cells within a small subbox of the histogram.\n * The work array need be only as big as the subbox, so the memory usage\n * problem is solved.  Furthermore, we need not fill subboxes that are never\n * referenced in pass2; many images use only part of the color gamut, so a\n * fair amount of work is saved.  An additional advantage of this\n * approach is that we can apply Heckbert's locality criterion to quickly\n * eliminate colormap entries that are far away from the subbox; typically\n * three-fourths of the colormap entries are rejected by Heckbert's criterion,\n * and we need not compute their distances to individual cells in the subbox.\n * The speed of this approach is heavily influenced by the subbox size: too\n * small means too much overhead, too big loses because Heckbert's criterion\n * can't eliminate as many colormap entries.  Empirically the best subbox\n * size seems to be about 1/512th of the histogram (1/8th in each direction).\n *\n * Thomas' article also describes a refined method which is asymptotically\n * faster than the brute-force method, but it is also far more complex and\n * cannot efficiently be applied to small subboxes.  It is therefore not\n * useful for programs intended to be portable to DOS machines.  On machines\n * with plenty of memory, filling the whole histogram in one shot with Thomas'\n * refined method might be faster than the present code --- but then again,\n * it might not be any faster, and it's certainly more complicated.\n */\n\n\n/* log2(histogram cells in update box) for each axis; this can be adjusted */\n#define BOX_C0_LOG  (HIST_C0_BITS-3)\n#define BOX_C1_LOG  (HIST_C1_BITS-3)\n#define BOX_C2_LOG  (HIST_C2_BITS-3)\n\n#define BOX_C0_ELEMS  (1<<BOX_C0_LOG) /* # of hist cells in update box */\n#define BOX_C1_ELEMS  (1<<BOX_C1_LOG)\n#define BOX_C2_ELEMS  (1<<BOX_C2_LOG)\n\n#define BOX_C0_SHIFT  (C0_SHIFT + BOX_C0_LOG)\n#define BOX_C1_SHIFT  (C1_SHIFT + BOX_C1_LOG)\n#define BOX_C2_SHIFT  (C2_SHIFT + BOX_C2_LOG)\n\n\n/*\n * The next three routines implement inverse colormap filling.  They could\n * all be folded into one big routine, but splitting them up this way saves\n * some stack space (the mindist[] and bestdist[] arrays need not coexist)\n * and may allow some compilers to produce better code by registerizing more\n * inner-loop variables.\n */\n\nLOCAL(int)\nfind_nearby_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,\n                    JSAMPLE colorlist[])\n/* Locate the colormap entries close enough to an update box to be candidates\n * for the nearest entry to some cell(s) in the update box.  The update box\n * is specified by the center coordinates of its first cell.  The number of\n * candidate colormap entries is returned, and their colormap indexes are\n * placed in colorlist[].\n * This routine uses Heckbert's \"locally sorted search\" criterion to select\n * the colors that need further consideration.\n */\n{\n  int numcolors = cinfo->actual_number_of_colors;\n  int maxc0, maxc1, maxc2;\n  int centerc0, centerc1, centerc2;\n  int i, x, ncolors;\n  JLONG minmaxdist, min_dist, max_dist, tdist;\n  JLONG mindist[MAXNUMCOLORS];  /* min distance to colormap entry i */\n\n  /* Compute true coordinates of update box's upper corner and center.\n   * Actually we compute the coordinates of the center of the upper-corner\n   * histogram cell, which are the upper bounds of the volume we care about.\n   * Note that since \">>\" rounds down, the \"center\" values may be closer to\n   * min than to max; hence comparisons to them must be \"<=\", not \"<\".\n   */\n  maxc0 = minc0 + ((1 << BOX_C0_SHIFT) - (1 << C0_SHIFT));\n  centerc0 = (minc0 + maxc0) >> 1;\n  maxc1 = minc1 + ((1 << BOX_C1_SHIFT) - (1 << C1_SHIFT));\n  centerc1 = (minc1 + maxc1) >> 1;\n  maxc2 = minc2 + ((1 << BOX_C2_SHIFT) - (1 << C2_SHIFT));\n  centerc2 = (minc2 + maxc2) >> 1;\n\n  /* For each color in colormap, find:\n   *  1. its minimum squared-distance to any point in the update box\n   *     (zero if color is within update box);\n   *  2. its maximum squared-distance to any point in the update box.\n   * Both of these can be found by considering only the corners of the box.\n   * We save the minimum distance for each color in mindist[];\n   * only the smallest maximum distance is of interest.\n   */\n  minmaxdist = 0x7FFFFFFFL;\n\n  for (i = 0; i < numcolors; i++) {\n    /* We compute the squared-c0-distance term, then add in the other two. */\n    x = GETJSAMPLE(cinfo->colormap[0][i]);\n    if (x < minc0) {\n      tdist = (x - minc0) * C0_SCALE;\n      min_dist = tdist*tdist;\n      tdist = (x - maxc0) * C0_SCALE;\n      max_dist = tdist*tdist;\n    } else if (x > maxc0) {\n      tdist = (x - maxc0) * C0_SCALE;\n      min_dist = tdist*tdist;\n      tdist = (x - minc0) * C0_SCALE;\n      max_dist = tdist*tdist;\n    } else {\n      /* within cell range so no contribution to min_dist */\n      min_dist = 0;\n      if (x <= centerc0) {\n        tdist = (x - maxc0) * C0_SCALE;\n        max_dist = tdist*tdist;\n      } else {\n        tdist = (x - minc0) * C0_SCALE;\n        max_dist = tdist*tdist;\n      }\n    }\n\n    x = GETJSAMPLE(cinfo->colormap[1][i]);\n    if (x < minc1) {\n      tdist = (x - minc1) * C1_SCALE;\n      min_dist += tdist*tdist;\n      tdist = (x - maxc1) * C1_SCALE;\n      max_dist += tdist*tdist;\n    } else if (x > maxc1) {\n      tdist = (x - maxc1) * C1_SCALE;\n      min_dist += tdist*tdist;\n      tdist = (x - minc1) * C1_SCALE;\n      max_dist += tdist*tdist;\n    } else {\n      /* within cell range so no contribution to min_dist */\n      if (x <= centerc1) {\n        tdist = (x - maxc1) * C1_SCALE;\n        max_dist += tdist*tdist;\n      } else {\n        tdist = (x - minc1) * C1_SCALE;\n        max_dist += tdist*tdist;\n      }\n    }\n\n    x = GETJSAMPLE(cinfo->colormap[2][i]);\n    if (x < minc2) {\n      tdist = (x - minc2) * C2_SCALE;\n      min_dist += tdist*tdist;\n      tdist = (x - maxc2) * C2_SCALE;\n      max_dist += tdist*tdist;\n    } else if (x > maxc2) {\n      tdist = (x - maxc2) * C2_SCALE;\n      min_dist += tdist*tdist;\n      tdist = (x - minc2) * C2_SCALE;\n      max_dist += tdist*tdist;\n    } else {\n      /* within cell range so no contribution to min_dist */\n      if (x <= centerc2) {\n        tdist = (x - maxc2) * C2_SCALE;\n        max_dist += tdist*tdist;\n      } else {\n        tdist = (x - minc2) * C2_SCALE;\n        max_dist += tdist*tdist;\n      }\n    }\n\n    mindist[i] = min_dist;      /* save away the results */\n    if (max_dist < minmaxdist)\n      minmaxdist = max_dist;\n  }\n\n  /* Now we know that no cell in the update box is more than minmaxdist\n   * away from some colormap entry.  Therefore, only colors that are\n   * within minmaxdist of some part of the box need be considered.\n   */\n  ncolors = 0;\n  for (i = 0; i < numcolors; i++) {\n    if (mindist[i] <= minmaxdist)\n      colorlist[ncolors++] = (JSAMPLE) i;\n  }\n  return ncolors;\n}\n\n\nLOCAL(void)\nfind_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,\n                  int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[])\n/* Find the closest colormap entry for each cell in the update box,\n * given the list of candidate colors prepared by find_nearby_colors.\n * Return the indexes of the closest entries in the bestcolor[] array.\n * This routine uses Thomas' incremental distance calculation method to\n * find the distance from a colormap entry to successive cells in the box.\n */\n{\n  int ic0, ic1, ic2;\n  int i, icolor;\n  register JLONG *bptr;         /* pointer into bestdist[] array */\n  JSAMPLE *cptr;                /* pointer into bestcolor[] array */\n  JLONG dist0, dist1;           /* initial distance values */\n  register JLONG dist2;         /* current distance in inner loop */\n  JLONG xx0, xx1;               /* distance increments */\n  register JLONG xx2;\n  JLONG inc0, inc1, inc2;       /* initial values for increments */\n  /* This array holds the distance to the nearest-so-far color for each cell */\n  JLONG bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];\n\n  /* Initialize best-distance for each cell of the update box */\n  bptr = bestdist;\n  for (i = BOX_C0_ELEMS*BOX_C1_ELEMS*BOX_C2_ELEMS-1; i >= 0; i--)\n    *bptr++ = 0x7FFFFFFFL;\n\n  /* For each color selected by find_nearby_colors,\n   * compute its distance to the center of each cell in the box.\n   * If that's less than best-so-far, update best distance and color number.\n   */\n\n  /* Nominal steps between cell centers (\"x\" in Thomas article) */\n#define STEP_C0  ((1 << C0_SHIFT) * C0_SCALE)\n#define STEP_C1  ((1 << C1_SHIFT) * C1_SCALE)\n#define STEP_C2  ((1 << C2_SHIFT) * C2_SCALE)\n\n  for (i = 0; i < numcolors; i++) {\n    icolor = GETJSAMPLE(colorlist[i]);\n    /* Compute (square of) distance from minc0/c1/c2 to this color */\n    inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE;\n    dist0 = inc0*inc0;\n    inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE;\n    dist0 += inc1*inc1;\n    inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE;\n    dist0 += inc2*inc2;\n    /* Form the initial difference increments */\n    inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0;\n    inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1;\n    inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2;\n    /* Now loop over all cells in box, updating distance per Thomas method */\n    bptr = bestdist;\n    cptr = bestcolor;\n    xx0 = inc0;\n    for (ic0 = BOX_C0_ELEMS-1; ic0 >= 0; ic0--) {\n      dist1 = dist0;\n      xx1 = inc1;\n      for (ic1 = BOX_C1_ELEMS-1; ic1 >= 0; ic1--) {\n        dist2 = dist1;\n        xx2 = inc2;\n        for (ic2 = BOX_C2_ELEMS-1; ic2 >= 0; ic2--) {\n          if (dist2 < *bptr) {\n            *bptr = dist2;\n            *cptr = (JSAMPLE) icolor;\n          }\n          dist2 += xx2;\n          xx2 += 2 * STEP_C2 * STEP_C2;\n          bptr++;\n          cptr++;\n        }\n        dist1 += xx1;\n        xx1 += 2 * STEP_C1 * STEP_C1;\n      }\n      dist0 += xx0;\n      xx0 += 2 * STEP_C0 * STEP_C0;\n    }\n  }\n}\n\n\nLOCAL(void)\nfill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2)\n/* Fill the inverse-colormap entries in the update box that contains */\n/* histogram cell c0/c1/c2.  (Only that one cell MUST be filled, but */\n/* we can fill as many others as we wish.) */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  int minc0, minc1, minc2;      /* lower left corner of update box */\n  int ic0, ic1, ic2;\n  register JSAMPLE *cptr;       /* pointer into bestcolor[] array */\n  register histptr cachep;      /* pointer into main cache array */\n  /* This array lists the candidate colormap indexes. */\n  JSAMPLE colorlist[MAXNUMCOLORS];\n  int numcolors;                /* number of candidate colors */\n  /* This array holds the actually closest colormap index for each cell. */\n  JSAMPLE bestcolor[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];\n\n  /* Convert cell coordinates to update box ID */\n  c0 >>= BOX_C0_LOG;\n  c1 >>= BOX_C1_LOG;\n  c2 >>= BOX_C2_LOG;\n\n  /* Compute true coordinates of update box's origin corner.\n   * Actually we compute the coordinates of the center of the corner\n   * histogram cell, which are the lower bounds of the volume we care about.\n   */\n  minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1);\n  minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1);\n  minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1);\n\n  /* Determine which colormap entries are close enough to be candidates\n   * for the nearest entry to some cell in the update box.\n   */\n  numcolors = find_nearby_colors(cinfo, minc0, minc1, minc2, colorlist);\n\n  /* Determine the actually nearest colors. */\n  find_best_colors(cinfo, minc0, minc1, minc2, numcolors, colorlist,\n                   bestcolor);\n\n  /* Save the best color numbers (plus 1) in the main cache array */\n  c0 <<= BOX_C0_LOG;            /* convert ID back to base cell indexes */\n  c1 <<= BOX_C1_LOG;\n  c2 <<= BOX_C2_LOG;\n  cptr = bestcolor;\n  for (ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++) {\n    for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) {\n      cachep = & histogram[c0+ic0][c1+ic1][c2];\n      for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) {\n        *cachep++ = (histcell) (GETJSAMPLE(*cptr++) + 1);\n      }\n    }\n  }\n}\n\n\n/*\n * Map some rows of pixels to the output colormapped representation.\n */\n\nMETHODDEF(void)\npass2_no_dither (j_decompress_ptr cinfo,\n                 JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)\n/* This version performs no dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  register JSAMPROW inptr, outptr;\n  register histptr cachep;\n  register int c0, c1, c2;\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n\n  for (row = 0; row < num_rows; row++) {\n    inptr = input_buf[row];\n    outptr = output_buf[row];\n    for (col = width; col > 0; col--) {\n      /* get pixel value and index into the cache */\n      c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT;\n      c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT;\n      c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT;\n      cachep = & histogram[c0][c1][c2];\n      /* If we have not seen this color before, find nearest colormap entry */\n      /* and update the cache */\n      if (*cachep == 0)\n        fill_inverse_cmap(cinfo, c0,c1,c2);\n      /* Now emit the colormap index for this cell */\n      *outptr++ = (JSAMPLE) (*cachep - 1);\n    }\n  }\n}\n\n\nMETHODDEF(void)\npass2_fs_dither (j_decompress_ptr cinfo,\n                 JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)\n/* This version performs Floyd-Steinberg dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  register LOCFSERROR cur0, cur1, cur2; /* current error or pixel value */\n  LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */\n  LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */\n  register FSERRPTR errorptr;   /* => fserrors[] at column before current */\n  JSAMPROW inptr;               /* => current input pixel */\n  JSAMPROW outptr;              /* => current output pixel */\n  histptr cachep;\n  int dir;                      /* +1 or -1 depending on direction */\n  int dir3;                     /* 3*dir, for advancing inptr & errorptr */\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n  JSAMPLE *range_limit = cinfo->sample_range_limit;\n  int *error_limit = cquantize->error_limiter;\n  JSAMPROW colormap0 = cinfo->colormap[0];\n  JSAMPROW colormap1 = cinfo->colormap[1];\n  JSAMPROW colormap2 = cinfo->colormap[2];\n  SHIFT_TEMPS\n\n  for (row = 0; row < num_rows; row++) {\n    inptr = input_buf[row];\n    outptr = output_buf[row];\n    if (cquantize->on_odd_row) {\n      /* work right to left in this row */\n      inptr += (width-1) * 3;   /* so point to rightmost pixel */\n      outptr += width-1;\n      dir = -1;\n      dir3 = -3;\n      errorptr = cquantize->fserrors + (width+1)*3; /* => entry after last column */\n      cquantize->on_odd_row = FALSE; /* flip for next time */\n    } else {\n      /* work left to right in this row */\n      dir = 1;\n      dir3 = 3;\n      errorptr = cquantize->fserrors; /* => entry before first real column */\n      cquantize->on_odd_row = TRUE; /* flip for next time */\n    }\n    /* Preset error values: no error propagated to first pixel from left */\n    cur0 = cur1 = cur2 = 0;\n    /* and no error propagated to row below yet */\n    belowerr0 = belowerr1 = belowerr2 = 0;\n    bpreverr0 = bpreverr1 = bpreverr2 = 0;\n\n    for (col = width; col > 0; col--) {\n      /* curN holds the error propagated from the previous pixel on the\n       * current line.  Add the error propagated from the previous line\n       * to form the complete error correction term for this pixel, and\n       * round the error term (which is expressed * 16) to an integer.\n       * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct\n       * for either sign of the error value.\n       * Note: errorptr points to *previous* column's array entry.\n       */\n      cur0 = RIGHT_SHIFT(cur0 + errorptr[dir3+0] + 8, 4);\n      cur1 = RIGHT_SHIFT(cur1 + errorptr[dir3+1] + 8, 4);\n      cur2 = RIGHT_SHIFT(cur2 + errorptr[dir3+2] + 8, 4);\n      /* Limit the error using transfer function set by init_error_limit.\n       * See comments with init_error_limit for rationale.\n       */\n      cur0 = error_limit[cur0];\n      cur1 = error_limit[cur1];\n      cur2 = error_limit[cur2];\n      /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE.\n       * The maximum error is +- MAXJSAMPLE (or less with error limiting);\n       * this sets the required size of the range_limit array.\n       */\n      cur0 += GETJSAMPLE(inptr[0]);\n      cur1 += GETJSAMPLE(inptr[1]);\n      cur2 += GETJSAMPLE(inptr[2]);\n      cur0 = GETJSAMPLE(range_limit[cur0]);\n      cur1 = GETJSAMPLE(range_limit[cur1]);\n      cur2 = GETJSAMPLE(range_limit[cur2]);\n      /* Index into the cache with adjusted pixel value */\n      cachep = & histogram[cur0>>C0_SHIFT][cur1>>C1_SHIFT][cur2>>C2_SHIFT];\n      /* If we have not seen this color before, find nearest colormap */\n      /* entry and update the cache */\n      if (*cachep == 0)\n        fill_inverse_cmap(cinfo, cur0>>C0_SHIFT,cur1>>C1_SHIFT,cur2>>C2_SHIFT);\n      /* Now emit the colormap index for this cell */\n      { register int pixcode = *cachep - 1;\n        *outptr = (JSAMPLE) pixcode;\n        /* Compute representation error for this pixel */\n        cur0 -= GETJSAMPLE(colormap0[pixcode]);\n        cur1 -= GETJSAMPLE(colormap1[pixcode]);\n        cur2 -= GETJSAMPLE(colormap2[pixcode]);\n      }\n      /* Compute error fractions to be propagated to adjacent pixels.\n       * Add these into the running sums, and simultaneously shift the\n       * next-line error sums left by 1 column.\n       */\n      { register LOCFSERROR bnexterr;\n\n        bnexterr = cur0;        /* Process component 0 */\n        errorptr[0] = (FSERROR) (bpreverr0 + cur0 * 3);\n        bpreverr0 = belowerr0 + cur0 * 5;\n        belowerr0 = bnexterr;\n        cur0 *= 7;\n        bnexterr = cur1;        /* Process component 1 */\n        errorptr[1] = (FSERROR) (bpreverr1 + cur1 * 3);\n        bpreverr1 = belowerr1 + cur1 * 5;\n        belowerr1 = bnexterr;\n        cur1 *= 7;\n        bnexterr = cur2;        /* Process component 2 */\n        errorptr[2] = (FSERROR) (bpreverr2 + cur2 * 3);\n        bpreverr2 = belowerr2 + cur2 * 5;\n        belowerr2 = bnexterr;\n        cur2 *= 7;\n      }\n      /* At this point curN contains the 7/16 error value to be propagated\n       * to the next pixel on the current line, and all the errors for the\n       * next line have been shifted over.  We are therefore ready to move on.\n       */\n      inptr += dir3;            /* Advance pixel pointers to next column */\n      outptr += dir;\n      errorptr += dir3;         /* advance errorptr to current column */\n    }\n    /* Post-loop cleanup: we must unload the final error values into the\n     * final fserrors[] entry.  Note we need not unload belowerrN because\n     * it is for the dummy column before or after the actual array.\n     */\n    errorptr[0] = (FSERROR) bpreverr0; /* unload prev errs into array */\n    errorptr[1] = (FSERROR) bpreverr1;\n    errorptr[2] = (FSERROR) bpreverr2;\n  }\n}\n\n\n/*\n * Initialize the error-limiting transfer function (lookup table).\n * The raw F-S error computation can potentially compute error values of up to\n * +- MAXJSAMPLE.  But we want the maximum correction applied to a pixel to be\n * much less, otherwise obviously wrong pixels will be created.  (Typical\n * effects include weird fringes at color-area boundaries, isolated bright\n * pixels in a dark area, etc.)  The standard advice for avoiding this problem\n * is to ensure that the \"corners\" of the color cube are allocated as output\n * colors; then repeated errors in the same direction cannot cause cascading\n * error buildup.  However, that only prevents the error from getting\n * completely out of hand; Aaron Giles reports that error limiting improves\n * the results even with corner colors allocated.\n * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty\n * well, but the smoother transfer function used below is even better.  Thanks\n * to Aaron Giles for this idea.\n */\n\nLOCAL(void)\ninit_error_limit (j_decompress_ptr cinfo)\n/* Allocate and fill in the error_limiter table */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  int *table;\n  int in, out;\n\n  table = (int *) (*cinfo->mem->alloc_small)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE*2+1) * sizeof(int));\n  table += MAXJSAMPLE;          /* so can index -MAXJSAMPLE .. +MAXJSAMPLE */\n  cquantize->error_limiter = table;\n\n#define STEPSIZE ((MAXJSAMPLE+1)/16)\n  /* Map errors 1:1 up to +- MAXJSAMPLE/16 */\n  out = 0;\n  for (in = 0; in < STEPSIZE; in++, out++) {\n    table[in] = out; table[-in] = -out;\n  }\n  /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */\n  for (; in < STEPSIZE*3; in++, out += (in&1) ? 0 : 1) {\n    table[in] = out; table[-in] = -out;\n  }\n  /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */\n  for (; in <= MAXJSAMPLE; in++) {\n    table[in] = out; table[-in] = -out;\n  }\n#undef STEPSIZE\n}\n\n\n/*\n * Finish up at the end of each pass.\n */\n\nMETHODDEF(void)\nfinish_pass1 (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n\n  /* Select the representative colors and fill in cinfo->colormap */\n  cinfo->colormap = cquantize->sv_colormap;\n  select_colors(cinfo, cquantize->desired);\n  /* Force next pass to zero the color index table */\n  cquantize->needs_zeroed = TRUE;\n}\n\n\nMETHODDEF(void)\nfinish_pass2 (j_decompress_ptr cinfo)\n{\n  /* no work */\n}\n\n\n/*\n * Initialize for each processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  int i;\n\n  /* Only F-S dithering or no dithering is supported. */\n  /* If user asks for ordered dither, give him F-S. */\n  if (cinfo->dither_mode != JDITHER_NONE)\n    cinfo->dither_mode = JDITHER_FS;\n\n  if (is_pre_scan) {\n    /* Set up method pointers */\n    cquantize->pub.color_quantize = prescan_quantize;\n    cquantize->pub.finish_pass = finish_pass1;\n    cquantize->needs_zeroed = TRUE; /* Always zero histogram */\n  } else {\n    /* Set up method pointers */\n    if (cinfo->dither_mode == JDITHER_FS)\n      cquantize->pub.color_quantize = pass2_fs_dither;\n    else\n      cquantize->pub.color_quantize = pass2_no_dither;\n    cquantize->pub.finish_pass = finish_pass2;\n\n    /* Make sure color count is acceptable */\n    i = cinfo->actual_number_of_colors;\n    if (i < 1)\n      ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 1);\n    if (i > MAXNUMCOLORS)\n      ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);\n\n    if (cinfo->dither_mode == JDITHER_FS) {\n      size_t arraysize = (size_t) ((cinfo->output_width + 2) *\n                                   (3 * sizeof(FSERROR)));\n      /* Allocate Floyd-Steinberg workspace if we didn't already. */\n      if (cquantize->fserrors == NULL)\n        cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)\n          ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);\n      /* Initialize the propagated errors to zero. */\n      jzero_far((void *) cquantize->fserrors, arraysize);\n      /* Make the error-limit table if we didn't already. */\n      if (cquantize->error_limiter == NULL)\n        init_error_limit(cinfo);\n      cquantize->on_odd_row = FALSE;\n    }\n\n  }\n  /* Zero the histogram or inverse color map, if necessary */\n  if (cquantize->needs_zeroed) {\n    for (i = 0; i < HIST_C0_ELEMS; i++) {\n      jzero_far((void *) histogram[i],\n                HIST_C1_ELEMS*HIST_C2_ELEMS * sizeof(histcell));\n    }\n    cquantize->needs_zeroed = FALSE;\n  }\n}\n\n\n/*\n * Switch to a new external colormap between output passes.\n */\n\nMETHODDEF(void)\nnew_color_map_2_quant (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n\n  /* Reset the inverse color map */\n  cquantize->needs_zeroed = TRUE;\n}\n\n\n/*\n * Module initialization routine for 2-pass color quantization.\n */\n\nGLOBAL(void)\njinit_2pass_quantizer (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize;\n  int i;\n\n  cquantize = (my_cquantize_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                sizeof(my_cquantizer));\n  cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;\n  cquantize->pub.start_pass = start_pass_2_quant;\n  cquantize->pub.new_color_map = new_color_map_2_quant;\n  cquantize->fserrors = NULL;   /* flag optional arrays not allocated */\n  cquantize->error_limiter = NULL;\n\n  /* Make sure jdmaster didn't give me a case I can't handle */\n  if (cinfo->out_color_components != 3)\n    ERREXIT(cinfo, JERR_NOTIMPL);\n\n  /* Allocate the histogram/inverse colormap storage */\n  cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C0_ELEMS * sizeof(hist2d));\n  for (i = 0; i < HIST_C0_ELEMS; i++) {\n    cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       HIST_C1_ELEMS*HIST_C2_ELEMS * sizeof(histcell));\n  }\n  cquantize->needs_zeroed = TRUE; /* histogram is garbage now */\n\n  /* Allocate storage for the completed colormap, if required.\n   * We do this now since it may affect the memory manager's space\n   * calculations.\n   */\n  if (cinfo->enable_2pass_quant) {\n    /* Make sure color count is acceptable */\n    int desired = cinfo->desired_number_of_colors;\n    /* Lower bound on # of colors ... somewhat arbitrary as long as > 0 */\n    if (desired < 8)\n      ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 8);\n    /* Make sure colormap indexes can be represented by JSAMPLEs */\n    if (desired > MAXNUMCOLORS)\n      ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);\n    cquantize->sv_colormap = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo,JPOOL_IMAGE, (JDIMENSION) desired, (JDIMENSION) 3);\n    cquantize->desired = desired;\n  } else\n    cquantize->sv_colormap = NULL;\n\n  /* Only F-S dithering or no dithering is supported. */\n  /* If user asks for ordered dither, give him F-S. */\n  if (cinfo->dither_mode != JDITHER_NONE)\n    cinfo->dither_mode = JDITHER_FS;\n\n  /* Allocate Floyd-Steinberg workspace if necessary.\n   * This isn't really needed until pass 2, but again it may affect the memory\n   * manager's space calculations.  Although we will cope with a later change\n   * in dither_mode, we do not promise to honor max_memory_to_use if\n   * dither_mode changes.\n   */\n  if (cinfo->dither_mode == JDITHER_FS) {\n    cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (size_t) ((cinfo->output_width + 2) * (3 * sizeof(FSERROR))));\n    /* Might as well create the error-limiting table too. */\n    init_error_limit(cinfo);\n  }\n}\n\n#endif /* QUANT_2PASS_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jsimd.h",
    "content": "/*\n * jsimd.h\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2011, 2014, D. R. Commander.\n * Copyright (C) 2015, Matthieu Darbois.\n *\n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n */\n\n#include \"jchuff.h\"             /* Declarations shared with jcphuff.c */\n\nEXTERN(int) jsimd_can_rgb_ycc (void);\nEXTERN(int) jsimd_can_rgb_gray (void);\nEXTERN(int) jsimd_can_ycc_rgb (void);\nEXTERN(int) jsimd_can_ycc_rgb565 (void);\nEXTERN(int) jsimd_c_can_null_convert (void);\n\nEXTERN(void) jsimd_rgb_ycc_convert\n        (j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_rgb_gray_convert\n        (j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_ycc_rgb_convert\n        (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_rgb565_convert\n        (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_c_null_convert\n        (j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\n\nEXTERN(int) jsimd_can_h2v2_downsample (void);\nEXTERN(int) jsimd_can_h2v1_downsample (void);\n\nEXTERN(void) jsimd_h2v2_downsample\n        (j_compress_ptr cinfo, jpeg_component_info *compptr,\n         JSAMPARRAY input_data, JSAMPARRAY output_data);\n\nEXTERN(int) jsimd_can_h2v2_smooth_downsample (void);\n\nEXTERN(void) jsimd_h2v2_smooth_downsample\n        (j_compress_ptr cinfo, jpeg_component_info *compptr,\n         JSAMPARRAY input_data, JSAMPARRAY output_data);\n\nEXTERN(void) jsimd_h2v1_downsample\n        (j_compress_ptr cinfo, jpeg_component_info *compptr,\n        JSAMPARRAY input_data, JSAMPARRAY output_data);\n\nEXTERN(int) jsimd_can_h2v2_upsample (void);\nEXTERN(int) jsimd_can_h2v1_upsample (void);\nEXTERN(int) jsimd_can_int_upsample (void);\n\nEXTERN(void) jsimd_h2v2_upsample\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);\nEXTERN(void) jsimd_h2v1_upsample\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);\nEXTERN(void) jsimd_int_upsample\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);\n\nEXTERN(int) jsimd_can_h2v2_fancy_upsample (void);\nEXTERN(int) jsimd_can_h2v1_fancy_upsample (void);\n\nEXTERN(void) jsimd_h2v2_fancy_upsample\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);\nEXTERN(void) jsimd_h2v1_fancy_upsample\n        (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n         JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);\n\nEXTERN(int) jsimd_can_h2v2_merged_upsample (void);\nEXTERN(int) jsimd_can_h2v1_merged_upsample (void);\n\nEXTERN(void) jsimd_h2v2_merged_upsample\n        (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_merged_upsample\n        (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\n\nEXTERN(int) jsimd_can_huff_encode_one_block (void);\n\nEXTERN(JOCTET*) jsimd_huff_encode_one_block\n        (void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val,\n         c_derived_tbl *dctbl, c_derived_tbl *actbl);\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jsimd_none.c",
    "content": "/*\n * jsimd_none.c\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2009-2011, 2014, D. R. Commander.\n * Copyright (C) 2015, Matthieu Darbois.\n *\n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n * This file contains stubs for when there is no SIMD support available.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jsimd.h\"\n#include \"jdct.h\"\n#include \"jsimddct.h\"\n\nGLOBAL(int)\njsimd_can_rgb_ycc (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_rgb_gray (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb565 (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_c_can_null_convert (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_rgb_ycc_convert (j_compress_ptr cinfo,\n                       JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                       JDIMENSION output_row, int num_rows)\n{\n}\n\nGLOBAL(void)\njsimd_rgb_gray_convert (j_compress_ptr cinfo,\n                        JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                        JDIMENSION output_row, int num_rows)\n{\n}\n\nGLOBAL(void)\njsimd_ycc_rgb_convert (j_decompress_ptr cinfo,\n                       JSAMPIMAGE input_buf, JDIMENSION input_row,\n                       JSAMPARRAY output_buf, int num_rows)\n{\n}\n\nGLOBAL(void)\njsimd_ycc_rgb565_convert (j_decompress_ptr cinfo,\n                          JSAMPIMAGE input_buf, JDIMENSION input_row,\n                          JSAMPARRAY output_buf, int num_rows)\n{\n}\n\nGLOBAL(void)\njsimd_c_null_convert (j_compress_ptr cinfo,\n                      JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                      JDIMENSION output_row, int num_rows)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_downsample (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_downsample (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v2_smooth_downsample (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n}\n\nGLOBAL(void)\njsimd_h2v2_smooth_downsample (j_compress_ptr cinfo,\n                              jpeg_component_info *compptr,\n                              JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_upsample (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_upsample (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_int_upsample (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_int_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                      JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)\n{\n}\n\nGLOBAL(void)\njsimd_h2v2_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info *compptr,\n                     JSAMPARRAY input_data,\n                     JSAMPARRAY *output_data_ptr)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info *compptr,\n                     JSAMPARRAY input_data,\n                     JSAMPARRAY *output_data_ptr)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_fancy_upsample (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_fancy_upsample (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info *compptr,\n                           JSAMPARRAY input_data,\n                           JSAMPARRAY *output_data_ptr)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info *compptr,\n                           JSAMPARRAY input_data,\n                           JSAMPARRAY *output_data_ptr)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_merged_upsample (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_merged_upsample (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n}\n\nGLOBAL(int)\njsimd_can_convsamp (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_convsamp_float (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,\n                DCTELEM *workspace)\n{\n}\n\nGLOBAL(void)\njsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,\n                      FAST_FLOAT *workspace)\n{\n}\n\nGLOBAL(int)\njsimd_can_fdct_islow (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_ifast (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_float (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_fdct_islow (DCTELEM *data)\n{\n}\n\nGLOBAL(void)\njsimd_fdct_ifast (DCTELEM *data)\n{\n}\n\nGLOBAL(void)\njsimd_fdct_float (FAST_FLOAT *data)\n{\n}\n\nGLOBAL(int)\njsimd_can_quantize (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_quantize_float (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors,\n                DCTELEM *workspace)\n{\n}\n\nGLOBAL(void)\njsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors,\n                      FAST_FLOAT *workspace)\n{\n}\n\nGLOBAL(int)\njsimd_can_idct_2x2 (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_4x4 (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_6x6 (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_12x12 (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n}\n\nGLOBAL(void)\njsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n}\n\nGLOBAL(void)\njsimd_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n}\n\nGLOBAL(void)\njsimd_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n}\n\nGLOBAL(int)\njsimd_can_idct_islow (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_ifast (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_float (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n}\n\nGLOBAL(void)\njsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n}\n\nGLOBAL(void)\njsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n}\n\nGLOBAL(int)\njsimd_can_huff_encode_one_block (void)\n{\n  return 0;\n}\n\nGLOBAL(JOCTET*)\njsimd_huff_encode_one_block (void *state, JOCTET *buffer, JCOEFPTR block,\n                             int last_dc_val, c_derived_tbl *dctbl,\n                             c_derived_tbl *actbl)\n{\n  return NULL;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jsimddct.h",
    "content": "/*\n * jsimddct.h\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n *\n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n */\n\nEXTERN(int) jsimd_can_convsamp (void);\nEXTERN(int) jsimd_can_convsamp_float (void);\n\nEXTERN(void) jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,\n                             DCTELEM *workspace);\nEXTERN(void) jsimd_convsamp_float (JSAMPARRAY sample_data,\n                                   JDIMENSION start_col,\n                                   FAST_FLOAT *workspace);\n\nEXTERN(int) jsimd_can_fdct_islow (void);\nEXTERN(int) jsimd_can_fdct_ifast (void);\nEXTERN(int) jsimd_can_fdct_float (void);\n\nEXTERN(void) jsimd_fdct_islow (DCTELEM *data);\nEXTERN(void) jsimd_fdct_ifast (DCTELEM *data);\nEXTERN(void) jsimd_fdct_float (FAST_FLOAT *data);\n\nEXTERN(int) jsimd_can_quantize (void);\nEXTERN(int) jsimd_can_quantize_float (void);\n\nEXTERN(void) jsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors,\n                             DCTELEM *workspace);\nEXTERN(void) jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors,\n                                   FAST_FLOAT *workspace);\n\nEXTERN(int) jsimd_can_idct_2x2 (void);\nEXTERN(int) jsimd_can_idct_4x4 (void);\nEXTERN(int) jsimd_can_idct_6x6 (void);\nEXTERN(int) jsimd_can_idct_12x12 (void);\n\nEXTERN(void) jsimd_idct_2x2 (j_decompress_ptr cinfo,\n                             jpeg_component_info *compptr,\n                             JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                             JDIMENSION output_col);\nEXTERN(void) jsimd_idct_4x4 (j_decompress_ptr cinfo,\n                             jpeg_component_info *compptr,\n                             JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                             JDIMENSION output_col);\nEXTERN(void) jsimd_idct_6x6 (j_decompress_ptr cinfo,\n                             jpeg_component_info *compptr,\n                             JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                             JDIMENSION output_col);\nEXTERN(void) jsimd_idct_12x12 (j_decompress_ptr cinfo,\n                               jpeg_component_info *compptr,\n                               JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                               JDIMENSION output_col);\n\nEXTERN(int) jsimd_can_idct_islow (void);\nEXTERN(int) jsimd_can_idct_ifast (void);\nEXTERN(int) jsimd_can_idct_float (void);\n\nEXTERN(void) jsimd_idct_islow (j_decompress_ptr cinfo,\n                               jpeg_component_info *compptr,\n                               JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                               JDIMENSION output_col);\nEXTERN(void) jsimd_idct_ifast (j_decompress_ptr cinfo,\n                               jpeg_component_info *compptr,\n                               JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                               JDIMENSION output_col);\nEXTERN(void) jsimd_idct_float (j_decompress_ptr cinfo,\n                               jpeg_component_info *compptr,\n                               JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                               JDIMENSION output_col);\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jstdhuff.c",
    "content": "/*\n * jstdhuff.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2013, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains routines to set the default Huffman tables, if they are\n * not already set.\n */\n\n/*\n * Huffman table setup routines\n */\n\nLOCAL(void)\nadd_huff_table (j_common_ptr cinfo,\n                JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)\n/* Define a Huffman table */\n{\n  int nsymbols, len;\n\n  if (*htblptr == NULL)\n    *htblptr = jpeg_alloc_huff_table(cinfo);\n  else\n    return;\n\n  /* Copy the number-of-symbols-of-each-code-length counts */\n  MEMCOPY((*htblptr)->bits, bits, sizeof((*htblptr)->bits));\n\n  /* Validate the counts.  We do this here mainly so we can copy the right\n   * number of symbols from the val[] array, without risking marching off\n   * the end of memory.  jchuff.c will do a more thorough test later.\n   */\n  nsymbols = 0;\n  for (len = 1; len <= 16; len++)\n    nsymbols += bits[len];\n  if (nsymbols < 1 || nsymbols > 256)\n    ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n\n  MEMCOPY((*htblptr)->huffval, val, nsymbols * sizeof(UINT8));\n  MEMZERO(&((*htblptr)->huffval[nsymbols]), (256 - nsymbols) * sizeof(UINT8));\n\n  /* Initialize sent_table FALSE so table will be written to JPEG file. */\n  (*htblptr)->sent_table = FALSE;\n}\n\n\nLOCAL(void)\nstd_huff_tables (j_common_ptr cinfo)\n/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */\n/* IMPORTANT: these are only valid for 8-bit data precision! */\n{\n  JHUFF_TBL **dc_huff_tbl_ptrs, **ac_huff_tbl_ptrs;\n\n  static const UINT8 bits_dc_luminance[17] =\n    { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };\n  static const UINT8 val_dc_luminance[] =\n    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };\n\n  static const UINT8 bits_dc_chrominance[17] =\n    { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };\n  static const UINT8 val_dc_chrominance[] =\n    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };\n\n  static const UINT8 bits_ac_luminance[17] =\n    { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };\n  static const UINT8 val_ac_luminance[] =\n    { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,\n      0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,\n      0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,\n      0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,\n      0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,\n      0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,\n      0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,\n      0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,\n      0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,\n      0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,\n      0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,\n      0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,\n      0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,\n      0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,\n      0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,\n      0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,\n      0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,\n      0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,\n      0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,\n      0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,\n      0xf9, 0xfa };\n\n  static const UINT8 bits_ac_chrominance[17] =\n    { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };\n  static const UINT8 val_ac_chrominance[] =\n    { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,\n      0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,\n      0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,\n      0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,\n      0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,\n      0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,\n      0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,\n      0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,\n      0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,\n      0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,\n      0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,\n      0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,\n      0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,\n      0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,\n      0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,\n      0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,\n      0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,\n      0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,\n      0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,\n      0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,\n      0xf9, 0xfa };\n\n  if (cinfo->is_decompressor) {\n    dc_huff_tbl_ptrs = ((j_decompress_ptr)cinfo)->dc_huff_tbl_ptrs;\n    ac_huff_tbl_ptrs = ((j_decompress_ptr)cinfo)->ac_huff_tbl_ptrs;\n  } else {\n    dc_huff_tbl_ptrs = ((j_compress_ptr)cinfo)->dc_huff_tbl_ptrs;\n    ac_huff_tbl_ptrs = ((j_compress_ptr)cinfo)->ac_huff_tbl_ptrs;\n  }\n\n  add_huff_table(cinfo, &dc_huff_tbl_ptrs[0], bits_dc_luminance,\n                 val_dc_luminance);\n  add_huff_table(cinfo, &ac_huff_tbl_ptrs[0], bits_ac_luminance,\n                 val_ac_luminance);\n  add_huff_table(cinfo, &dc_huff_tbl_ptrs[1], bits_dc_chrominance,\n                 val_dc_chrominance);\n  add_huff_table(cinfo, &ac_huff_tbl_ptrs[1], bits_ac_chrominance,\n                 val_ac_chrominance);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jutils.c",
    "content": "/*\n * jutils.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code\n * relevant to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains tables and miscellaneous utility routines needed\n * for both compression and decompression.\n * Note we prefix all global names with \"j\" to minimize conflicts with\n * a surrounding application.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * jpeg_zigzag_order[i] is the zigzag-order position of the i'th element\n * of a DCT block read in natural order (left to right, top to bottom).\n */\n\n#if 0                           /* This table is not actually needed in v6a */\n\nconst int jpeg_zigzag_order[DCTSIZE2] = {\n   0,  1,  5,  6, 14, 15, 27, 28,\n   2,  4,  7, 13, 16, 26, 29, 42,\n   3,  8, 12, 17, 25, 30, 41, 43,\n   9, 11, 18, 24, 31, 40, 44, 53,\n  10, 19, 23, 32, 39, 45, 52, 54,\n  20, 22, 33, 38, 46, 51, 55, 60,\n  21, 34, 37, 47, 50, 56, 59, 61,\n  35, 36, 48, 49, 57, 58, 62, 63\n};\n\n#endif\n\n/*\n * jpeg_natural_order[i] is the natural-order position of the i'th element\n * of zigzag order.\n *\n * When reading corrupted data, the Huffman decoders could attempt\n * to reference an entry beyond the end of this array (if the decoded\n * zero run length reaches past the end of the block).  To prevent\n * wild stores without adding an inner-loop test, we put some extra\n * \"63\"s after the real entries.  This will cause the extra coefficient\n * to be stored in location 63 of the block, not somewhere random.\n * The worst case would be a run-length of 15, which means we need 16\n * fake entries.\n */\n\nconst int jpeg_natural_order[DCTSIZE2+16] = {\n  0,  1,  8, 16,  9,  2,  3, 10,\n 17, 24, 32, 25, 18, 11,  4,  5,\n 12, 19, 26, 33, 40, 48, 41, 34,\n 27, 20, 13,  6,  7, 14, 21, 28,\n 35, 42, 49, 56, 57, 50, 43, 36,\n 29, 22, 15, 23, 30, 37, 44, 51,\n 58, 59, 52, 45, 38, 31, 39, 46,\n 53, 60, 61, 54, 47, 55, 62, 63,\n 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */\n 63, 63, 63, 63, 63, 63, 63, 63\n};\n\n\n/*\n * Arithmetic utilities\n */\n\nGLOBAL(long)\njdiv_round_up (long a, long b)\n/* Compute a/b rounded up to next integer, ie, ceil(a/b) */\n/* Assumes a >= 0, b > 0 */\n{\n  return (a + b - 1L) / b;\n}\n\n\nGLOBAL(long)\njround_up (long a, long b)\n/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */\n/* Assumes a >= 0, b > 0 */\n{\n  a += b - 1L;\n  return a - (a % b);\n}\n\n\nGLOBAL(void)\njcopy_sample_rows (JSAMPARRAY input_array, int source_row,\n                   JSAMPARRAY output_array, int dest_row,\n                   int num_rows, JDIMENSION num_cols)\n/* Copy some rows of samples from one place to another.\n * num_rows rows are copied from input_array[source_row++]\n * to output_array[dest_row++]; these areas may overlap for duplication.\n * The source and destination arrays must be at least as wide as num_cols.\n */\n{\n  register JSAMPROW inptr, outptr;\n  register size_t count = (size_t) (num_cols * sizeof(JSAMPLE));\n  register int row;\n\n  input_array += source_row;\n  output_array += dest_row;\n\n  for (row = num_rows; row > 0; row--) {\n    inptr = *input_array++;\n    outptr = *output_array++;\n    MEMCOPY(outptr, inptr, count);\n  }\n}\n\n\nGLOBAL(void)\njcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row,\n                 JDIMENSION num_blocks)\n/* Copy a row of coefficient blocks from one place to another. */\n{\n  MEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * sizeof(JCOEF)));\n}\n\n\nGLOBAL(void)\njzero_far (void *target, size_t bytestozero)\n/* Zero out a chunk of memory. */\n/* This might be sample-array data, block-array data, or alloc_large data. */\n{\n  MEMZERO(target, bytestozero);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/jversion.h",
    "content": "/*\n * jversion.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, 2012-2016, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains software version identification.\n */\n\n\n#if JPEG_LIB_VERSION >= 80\n\n#define JVERSION        \"8d  15-Jan-2012\"\n\n#elif JPEG_LIB_VERSION >= 70\n\n#define JVERSION        \"7  27-Jun-2009\"\n\n#else\n\n#define JVERSION        \"6b  27-Mar-1998\"\n\n#endif\n\n/*\n * NOTE: It is our convention to place the authors in the following order:\n * - libjpeg-turbo authors (2009-) in descending order of the date of their\n *   most recent contribution to the project, then in ascending order of the\n *   date of their first contribution to the project\n * - Upstream authors in descending order of the date of the first inclusion of\n *   their code\n */\n\n#define JCOPYRIGHT      \"Copyright (C) 2009-2016 D. R. Commander\\n\" \\\n                        \"Copyright (C) 2011-2016 Siarhei Siamashka\\n\" \\\n                        \"Copyright (C) 2015-2016 Matthieu Darbois\\n\" \\\n                        \"Copyright (C) 2015 Google, Inc.\\n\" \\\n                        \"Copyright (C) 2013-2014 MIPS Technologies, Inc.\\n\" \\\n                        \"Copyright (C) 2013 Linaro Limited\\n\" \\\n                        \"Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\\n\" \\\n                        \"Copyright (C) 2009 Pierre Ossman for Cendio AB\\n\" \\\n                        \"Copyright (C) 1999-2006 MIYASAKA Masaru\\n\" \\\n                        \"Copyright (C) 1991-2016 Thomas G. Lane, Guido Vollbeding\" \\\n\n#define JCOPYRIGHT_SHORT \"Copyright (C) 1991-2016 The libjpeg-turbo Project and many others\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/libjpeg.map.in",
    "content": "LIBJPEGTURBO_@JPEG_LIB_VERSION_DECIMAL@ {\n  @MEM_SRCDST_FUNCTIONS@\n  local:\n    jsimd_*;\n    jconst_*;\n};\n\nLIBJPEG_@JPEG_LIB_VERSION_DECIMAL@ {\n  global:\n    *;\n};\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/libjpeg.txt",
    "content": "USING THE IJG JPEG LIBRARY\n\nThis file was part of the Independent JPEG Group's software:\nCopyright (C) 1994-2013, Thomas G. Lane, Guido Vollbeding.\nlibjpeg-turbo Modifications:\nCopyright (C) 2010, 2014-2016, D. R. Commander.\nCopyright (C) 2015, Google, Inc.\nFor conditions of distribution and use, see the accompanying README.ijg file.\n\n\nThis file describes how to use the IJG JPEG library within an application\nprogram.  Read it if you want to write a program that uses the library.\n\nThe file example.c provides heavily commented skeleton code for calling the\nJPEG library.  Also see jpeglib.h (the include file to be used by application\nprograms) for full details about data structures and function parameter lists.\nThe library source code, of course, is the ultimate reference.\n\nNote that there have been *major* changes from the application interface\npresented by IJG version 4 and earlier versions.  The old design had several\ninherent limitations, and it had accumulated a lot of cruft as we added\nfeatures while trying to minimize application-interface changes.  We have\nsacrificed backward compatibility in the version 5 rewrite, but we think the\nimprovements justify this.\n\n\nTABLE OF CONTENTS\n-----------------\n\nOverview:\n        Functions provided by the library\n        Outline of typical usage\nBasic library usage:\n        Data formats\n        Compression details\n        Decompression details\n        Mechanics of usage: include files, linking, etc\nAdvanced features:\n        Compression parameter selection\n        Decompression parameter selection\n        Special color spaces\n        Error handling\n        Compressed data handling (source and destination managers)\n        I/O suspension\n        Progressive JPEG support\n        Buffered-image mode\n        Abbreviated datastreams and multiple images\n        Special markers\n        Raw (downsampled) image data\n        Really raw data: DCT coefficients\n        Progress monitoring\n        Memory management\n        Memory usage\n        Library compile-time options\n        Portability considerations\n\nYou should read at least the overview and basic usage sections before trying\nto program with the library.  The sections on advanced features can be read\nif and when you need them.\n\n\nOVERVIEW\n========\n\nFunctions provided by the library\n---------------------------------\n\nThe IJG JPEG library provides C code to read and write JPEG-compressed image\nfiles.  The surrounding application program receives or supplies image data a\nscanline at a time, using a straightforward uncompressed image format.  All\ndetails of color conversion and other preprocessing/postprocessing can be\nhandled by the library.\n\nThe library includes a substantial amount of code that is not covered by the\nJPEG standard but is necessary for typical applications of JPEG.  These\nfunctions preprocess the image before JPEG compression or postprocess it after\ndecompression.  They include colorspace conversion, downsampling/upsampling,\nand color quantization.  The application indirectly selects use of this code\nby specifying the format in which it wishes to supply or receive image data.\nFor example, if colormapped output is requested, then the decompression\nlibrary automatically invokes color quantization.\n\nA wide range of quality vs. speed tradeoffs are possible in JPEG processing,\nand even more so in decompression postprocessing.  The decompression library\nprovides multiple implementations that cover most of the useful tradeoffs,\nranging from very-high-quality down to fast-preview operation.  On the\ncompression side we have generally not provided low-quality choices, since\ncompression is normally less time-critical.  It should be understood that the\nlow-quality modes may not meet the JPEG standard's accuracy requirements;\nnonetheless, they are useful for viewers.\n\nA word about functions *not* provided by the library.  We handle a subset of\nthe ISO JPEG standard; most baseline, extended-sequential, and progressive\nJPEG processes are supported.  (Our subset includes all features now in common\nuse.)  Unsupported ISO options include:\n        * Hierarchical storage\n        * Lossless JPEG\n        * DNL marker\n        * Nonintegral subsampling ratios\nWe support both 8- and 12-bit data precision, but this is a compile-time\nchoice rather than a run-time choice; hence it is difficult to use both\nprecisions in a single application.\n\nBy itself, the library handles only interchange JPEG datastreams --- in\nparticular the widely used JFIF file format.  The library can be used by\nsurrounding code to process interchange or abbreviated JPEG datastreams that\nare embedded in more complex file formats.  (For example, this library is\nused by the free LIBTIFF library to support JPEG compression in TIFF.)\n\n\nOutline of typical usage\n------------------------\n\nThe rough outline of a JPEG compression operation is:\n\n        Allocate and initialize a JPEG compression object\n        Specify the destination for the compressed data (eg, a file)\n        Set parameters for compression, including image size & colorspace\n        jpeg_start_compress(...);\n        while (scan lines remain to be written)\n                jpeg_write_scanlines(...);\n        jpeg_finish_compress(...);\n        Release the JPEG compression object\n\nA JPEG compression object holds parameters and working state for the JPEG\nlibrary.  We make creation/destruction of the object separate from starting\nor finishing compression of an image; the same object can be re-used for a\nseries of image compression operations.  This makes it easy to re-use the\nsame parameter settings for a sequence of images.  Re-use of a JPEG object\nalso has important implications for processing abbreviated JPEG datastreams,\nas discussed later.\n\nThe image data to be compressed is supplied to jpeg_write_scanlines() from\nin-memory buffers.  If the application is doing file-to-file compression,\nreading image data from the source file is the application's responsibility.\nThe library emits compressed data by calling a \"data destination manager\",\nwhich typically will write the data into a file; but the application can\nprovide its own destination manager to do something else.\n\nSimilarly, the rough outline of a JPEG decompression operation is:\n\n        Allocate and initialize a JPEG decompression object\n        Specify the source of the compressed data (eg, a file)\n        Call jpeg_read_header() to obtain image info\n        Set parameters for decompression\n        jpeg_start_decompress(...);\n        while (scan lines remain to be read)\n                jpeg_read_scanlines(...);\n        jpeg_finish_decompress(...);\n        Release the JPEG decompression object\n\nThis is comparable to the compression outline except that reading the\ndatastream header is a separate step.  This is helpful because information\nabout the image's size, colorspace, etc is available when the application\nselects decompression parameters.  For example, the application can choose an\noutput scaling ratio that will fit the image into the available screen size.\n\nThe decompression library obtains compressed data by calling a data source\nmanager, which typically will read the data from a file; but other behaviors\ncan be obtained with a custom source manager.  Decompressed data is delivered\ninto in-memory buffers passed to jpeg_read_scanlines().\n\nIt is possible to abort an incomplete compression or decompression operation\nby calling jpeg_abort(); or, if you do not need to retain the JPEG object,\nsimply release it by calling jpeg_destroy().\n\nJPEG compression and decompression objects are two separate struct types.\nHowever, they share some common fields, and certain routines such as\njpeg_destroy() can work on either type of object.\n\nThe JPEG library has no static variables: all state is in the compression\nor decompression object.  Therefore it is possible to process multiple\ncompression and decompression operations concurrently, using multiple JPEG\nobjects.\n\nBoth compression and decompression can be done in an incremental memory-to-\nmemory fashion, if suitable source/destination managers are used.  See the\nsection on \"I/O suspension\" for more details.\n\n\nBASIC LIBRARY USAGE\n===================\n\nData formats\n------------\n\nBefore diving into procedural details, it is helpful to understand the\nimage data format that the JPEG library expects or returns.\n\nThe standard input image format is a rectangular array of pixels, with each\npixel having the same number of \"component\" or \"sample\" values (color\nchannels).  You must specify how many components there are and the colorspace\ninterpretation of the components.  Most applications will use RGB data\n(three components per pixel) or grayscale data (one component per pixel).\nPLEASE NOTE THAT RGB DATA IS THREE SAMPLES PER PIXEL, GRAYSCALE ONLY ONE.\nA remarkable number of people manage to miss this, only to find that their\nprograms don't work with grayscale JPEG files.\n\nThere is no provision for colormapped input.  JPEG files are always full-color\nor full grayscale (or sometimes another colorspace such as CMYK).  You can\nfeed in a colormapped image by expanding it to full-color format.  However\nJPEG often doesn't work very well with source data that has been colormapped,\nbecause of dithering noise.  This is discussed in more detail in the JPEG FAQ\nand the other references mentioned in the README.ijg file.\n\nPixels are stored by scanlines, with each scanline running from left to\nright.  The component values for each pixel are adjacent in the row; for\nexample, R,G,B,R,G,B,R,G,B,... for 24-bit RGB color.  Each scanline is an\narray of data type JSAMPLE --- which is typically \"unsigned char\", unless\nyou've changed jmorecfg.h.  (You can also change the RGB pixel layout, say\nto B,G,R order, by modifying jmorecfg.h.  But see the restrictions listed in\nthat file before doing so.)\n\nA 2-D array of pixels is formed by making a list of pointers to the starts of\nscanlines; so the scanlines need not be physically adjacent in memory.  Even\nif you process just one scanline at a time, you must make a one-element\npointer array to conform to this structure.  Pointers to JSAMPLE rows are of\ntype JSAMPROW, and the pointer to the pointer array is of type JSAMPARRAY.\n\nThe library accepts or supplies one or more complete scanlines per call.\nIt is not possible to process part of a row at a time.  Scanlines are always\nprocessed top-to-bottom.  You can process an entire image in one call if you\nhave it all in memory, but usually it's simplest to process one scanline at\na time.\n\nFor best results, source data values should have the precision specified by\nBITS_IN_JSAMPLE (normally 8 bits).  For instance, if you choose to compress\ndata that's only 6 bits/channel, you should left-justify each value in a\nbyte before passing it to the compressor.  If you need to compress data\nthat has more than 8 bits/channel, compile with BITS_IN_JSAMPLE = 12.\n(See \"Library compile-time options\", later.)\n\n\nThe data format returned by the decompressor is the same in all details,\nexcept that colormapped output is supported.  (Again, a JPEG file is never\ncolormapped.  But you can ask the decompressor to perform on-the-fly color\nquantization to deliver colormapped output.)  If you request colormapped\noutput then the returned data array contains a single JSAMPLE per pixel;\nits value is an index into a color map.  The color map is represented as\na 2-D JSAMPARRAY in which each row holds the values of one color component,\nthat is, colormap[i][j] is the value of the i'th color component for pixel\nvalue (map index) j.  Note that since the colormap indexes are stored in\nJSAMPLEs, the maximum number of colors is limited by the size of JSAMPLE\n(ie, at most 256 colors for an 8-bit JPEG library).\n\n\nCompression details\n-------------------\n\nHere we revisit the JPEG compression outline given in the overview.\n\n1. Allocate and initialize a JPEG compression object.\n\nA JPEG compression object is a \"struct jpeg_compress_struct\".  (It also has\na bunch of subsidiary structures which are allocated via malloc(), but the\napplication doesn't control those directly.)  This struct can be just a local\nvariable in the calling routine, if a single routine is going to execute the\nwhole JPEG compression sequence.  Otherwise it can be static or allocated\nfrom malloc().\n\nYou will also need a structure representing a JPEG error handler.  The part\nof this that the library cares about is a \"struct jpeg_error_mgr\".  If you\nare providing your own error handler, you'll typically want to embed the\njpeg_error_mgr struct in a larger structure; this is discussed later under\n\"Error handling\".  For now we'll assume you are just using the default error\nhandler.  The default error handler will print JPEG error/warning messages\non stderr, and it will call exit() if a fatal error occurs.\n\nYou must initialize the error handler structure, store a pointer to it into\nthe JPEG object's \"err\" field, and then call jpeg_create_compress() to\ninitialize the rest of the JPEG object.\n\nTypical code for this step, if you are using the default error handler, is\n\n        struct jpeg_compress_struct cinfo;\n        struct jpeg_error_mgr jerr;\n        ...\n        cinfo.err = jpeg_std_error(&jerr);\n        jpeg_create_compress(&cinfo);\n\njpeg_create_compress allocates a small amount of memory, so it could fail\nif you are out of memory.  In that case it will exit via the error handler;\nthat's why the error handler must be initialized first.\n\n\n2. Specify the destination for the compressed data (eg, a file).\n\nAs previously mentioned, the JPEG library delivers compressed data to a\n\"data destination\" module.  The library includes one data destination\nmodule which knows how to write to a stdio stream.  You can use your own\ndestination module if you want to do something else, as discussed later.\n\nIf you use the standard destination module, you must open the target stdio\nstream beforehand.  Typical code for this step looks like:\n\n        FILE *outfile;\n        ...\n        if ((outfile = fopen(filename, \"wb\")) == NULL) {\n            fprintf(stderr, \"can't open %s\\n\", filename);\n            exit(1);\n        }\n        jpeg_stdio_dest(&cinfo, outfile);\n\nwhere the last line invokes the standard destination module.\n\nWARNING: it is critical that the binary compressed data be delivered to the\noutput file unchanged.  On non-Unix systems the stdio library may perform\nnewline translation or otherwise corrupt binary data.  To suppress this\nbehavior, you may need to use a \"b\" option to fopen (as shown above), or use\nsetmode() or another routine to put the stdio stream in binary mode.  See\ncjpeg.c and djpeg.c for code that has been found to work on many systems.\n\nYou can select the data destination after setting other parameters (step 3),\nif that's more convenient.  You may not change the destination between\ncalling jpeg_start_compress() and jpeg_finish_compress().\n\n\n3. Set parameters for compression, including image size & colorspace.\n\nYou must supply information about the source image by setting the following\nfields in the JPEG object (cinfo structure):\n\n        image_width             Width of image, in pixels\n        image_height            Height of image, in pixels\n        input_components        Number of color channels (samples per pixel)\n        in_color_space          Color space of source image\n\nThe image dimensions are, hopefully, obvious.  JPEG supports image dimensions\nof 1 to 64K pixels in either direction.  The input color space is typically\nRGB or grayscale, and input_components is 3 or 1 accordingly.  (See \"Special\ncolor spaces\", later, for more info.)  The in_color_space field must be\nassigned one of the J_COLOR_SPACE enum constants, typically JCS_RGB or\nJCS_GRAYSCALE.\n\nJPEG has a large number of compression parameters that determine how the\nimage is encoded.  Most applications don't need or want to know about all\nthese parameters.  You can set all the parameters to reasonable defaults by\ncalling jpeg_set_defaults(); then, if there are particular values you want\nto change, you can do so after that.  The \"Compression parameter selection\"\nsection tells about all the parameters.\n\nYou must set in_color_space correctly before calling jpeg_set_defaults(),\nbecause the defaults depend on the source image colorspace.  However the\nother three source image parameters need not be valid until you call\njpeg_start_compress().  There's no harm in calling jpeg_set_defaults() more\nthan once, if that happens to be convenient.\n\nTypical code for a 24-bit RGB source image is\n\n        cinfo.image_width = Width;      /* image width and height, in pixels */\n        cinfo.image_height = Height;\n        cinfo.input_components = 3;     /* # of color components per pixel */\n        cinfo.in_color_space = JCS_RGB; /* colorspace of input image */\n\n        jpeg_set_defaults(&cinfo);\n        /* Make optional parameter settings here */\n\n\n4. jpeg_start_compress(...);\n\nAfter you have established the data destination and set all the necessary\nsource image info and other parameters, call jpeg_start_compress() to begin\na compression cycle.  This will initialize internal state, allocate working\nstorage, and emit the first few bytes of the JPEG datastream header.\n\nTypical code:\n\n        jpeg_start_compress(&cinfo, TRUE);\n\nThe \"TRUE\" parameter ensures that a complete JPEG interchange datastream\nwill be written.  This is appropriate in most cases.  If you think you might\nwant to use an abbreviated datastream, read the section on abbreviated\ndatastreams, below.\n\nOnce you have called jpeg_start_compress(), you may not alter any JPEG\nparameters or other fields of the JPEG object until you have completed\nthe compression cycle.\n\n\n5. while (scan lines remain to be written)\n        jpeg_write_scanlines(...);\n\nNow write all the required image data by calling jpeg_write_scanlines()\none or more times.  You can pass one or more scanlines in each call, up\nto the total image height.  In most applications it is convenient to pass\njust one or a few scanlines at a time.  The expected format for the passed\ndata is discussed under \"Data formats\", above.\n\nImage data should be written in top-to-bottom scanline order.  The JPEG spec\ncontains some weasel wording about how top and bottom are application-defined\nterms (a curious interpretation of the English language...) but if you want\nyour files to be compatible with everyone else's, you WILL use top-to-bottom\norder.  If the source data must be read in bottom-to-top order, you can use\nthe JPEG library's virtual array mechanism to invert the data efficiently.\nExamples of this can be found in the sample application cjpeg.\n\nThe library maintains a count of the number of scanlines written so far\nin the next_scanline field of the JPEG object.  Usually you can just use\nthis variable as the loop counter, so that the loop test looks like\n\"while (cinfo.next_scanline < cinfo.image_height)\".\n\nCode for this step depends heavily on the way that you store the source data.\nexample.c shows the following code for the case of a full-size 2-D source\narray containing 3-byte RGB pixels:\n\n        JSAMPROW row_pointer[1];        /* pointer to a single row */\n        int row_stride;                 /* physical row width in buffer */\n\n        row_stride = image_width * 3;   /* JSAMPLEs per row in image_buffer */\n\n        while (cinfo.next_scanline < cinfo.image_height) {\n            row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride];\n            jpeg_write_scanlines(&cinfo, row_pointer, 1);\n        }\n\njpeg_write_scanlines() returns the number of scanlines actually written.\nThis will normally be equal to the number passed in, so you can usually\nignore the return value.  It is different in just two cases:\n  * If you try to write more scanlines than the declared image height,\n    the additional scanlines are ignored.\n  * If you use a suspending data destination manager, output buffer overrun\n    will cause the compressor to return before accepting all the passed lines.\n    This feature is discussed under \"I/O suspension\", below.  The normal\n    stdio destination manager will NOT cause this to happen.\nIn any case, the return value is the same as the change in the value of\nnext_scanline.\n\n\n6. jpeg_finish_compress(...);\n\nAfter all the image data has been written, call jpeg_finish_compress() to\ncomplete the compression cycle.  This step is ESSENTIAL to ensure that the\nlast bufferload of data is written to the data destination.\njpeg_finish_compress() also releases working memory associated with the JPEG\nobject.\n\nTypical code:\n\n        jpeg_finish_compress(&cinfo);\n\nIf using the stdio destination manager, don't forget to close the output\nstdio stream (if necessary) afterwards.\n\nIf you have requested a multi-pass operating mode, such as Huffman code\noptimization, jpeg_finish_compress() will perform the additional passes using\ndata buffered by the first pass.  In this case jpeg_finish_compress() may take\nquite a while to complete.  With the default compression parameters, this will\nnot happen.\n\nIt is an error to call jpeg_finish_compress() before writing the necessary\ntotal number of scanlines.  If you wish to abort compression, call\njpeg_abort() as discussed below.\n\nAfter completing a compression cycle, you may dispose of the JPEG object\nas discussed next, or you may use it to compress another image.  In that case\nreturn to step 2, 3, or 4 as appropriate.  If you do not change the\ndestination manager, the new datastream will be written to the same target.\nIf you do not change any JPEG parameters, the new datastream will be written\nwith the same parameters as before.  Note that you can change the input image\ndimensions freely between cycles, but if you change the input colorspace, you\nshould call jpeg_set_defaults() to adjust for the new colorspace; and then\nyou'll need to repeat all of step 3.\n\n\n7. Release the JPEG compression object.\n\nWhen you are done with a JPEG compression object, destroy it by calling\njpeg_destroy_compress().  This will free all subsidiary memory (regardless of\nthe previous state of the object).  Or you can call jpeg_destroy(), which\nworks for either compression or decompression objects --- this may be more\nconvenient if you are sharing code between compression and decompression\ncases.  (Actually, these routines are equivalent except for the declared type\nof the passed pointer.  To avoid gripes from ANSI C compilers, jpeg_destroy()\nshould be passed a j_common_ptr.)\n\nIf you allocated the jpeg_compress_struct structure from malloc(), freeing\nit is your responsibility --- jpeg_destroy() won't.  Ditto for the error\nhandler structure.\n\nTypical code:\n\n        jpeg_destroy_compress(&cinfo);\n\n\n8. Aborting.\n\nIf you decide to abort a compression cycle before finishing, you can clean up\nin either of two ways:\n\n* If you don't need the JPEG object any more, just call\n  jpeg_destroy_compress() or jpeg_destroy() to release memory.  This is\n  legitimate at any point after calling jpeg_create_compress() --- in fact,\n  it's safe even if jpeg_create_compress() fails.\n\n* If you want to re-use the JPEG object, call jpeg_abort_compress(), or call\n  jpeg_abort() which works on both compression and decompression objects.\n  This will return the object to an idle state, releasing any working memory.\n  jpeg_abort() is allowed at any time after successful object creation.\n\nNote that cleaning up the data destination, if required, is your\nresponsibility; neither of these routines will call term_destination().\n(See \"Compressed data handling\", below, for more about that.)\n\njpeg_destroy() and jpeg_abort() are the only safe calls to make on a JPEG\nobject that has reported an error by calling error_exit (see \"Error handling\"\nfor more info).  The internal state of such an object is likely to be out of\nwhack.  Either of these two routines will return the object to a known state.\n\n\nDecompression details\n---------------------\n\nHere we revisit the JPEG decompression outline given in the overview.\n\n1. Allocate and initialize a JPEG decompression object.\n\nThis is just like initialization for compression, as discussed above,\nexcept that the object is a \"struct jpeg_decompress_struct\" and you\ncall jpeg_create_decompress().  Error handling is exactly the same.\n\nTypical code:\n\n        struct jpeg_decompress_struct cinfo;\n        struct jpeg_error_mgr jerr;\n        ...\n        cinfo.err = jpeg_std_error(&jerr);\n        jpeg_create_decompress(&cinfo);\n\n(Both here and in the IJG code, we usually use variable name \"cinfo\" for\nboth compression and decompression objects.)\n\n\n2. Specify the source of the compressed data (eg, a file).\n\nAs previously mentioned, the JPEG library reads compressed data from a \"data\nsource\" module.  The library includes one data source module which knows how\nto read from a stdio stream.  You can use your own source module if you want\nto do something else, as discussed later.\n\nIf you use the standard source module, you must open the source stdio stream\nbeforehand.  Typical code for this step looks like:\n\n        FILE *infile;\n        ...\n        if ((infile = fopen(filename, \"rb\")) == NULL) {\n            fprintf(stderr, \"can't open %s\\n\", filename);\n            exit(1);\n        }\n        jpeg_stdio_src(&cinfo, infile);\n\nwhere the last line invokes the standard source module.\n\nWARNING: it is critical that the binary compressed data be read unchanged.\nOn non-Unix systems the stdio library may perform newline translation or\notherwise corrupt binary data.  To suppress this behavior, you may need to use\na \"b\" option to fopen (as shown above), or use setmode() or another routine to\nput the stdio stream in binary mode.  See cjpeg.c and djpeg.c for code that\nhas been found to work on many systems.\n\nYou may not change the data source between calling jpeg_read_header() and\njpeg_finish_decompress().  If you wish to read a series of JPEG images from\na single source file, you should repeat the jpeg_read_header() to\njpeg_finish_decompress() sequence without reinitializing either the JPEG\nobject or the data source module; this prevents buffered input data from\nbeing discarded.\n\n\n3. Call jpeg_read_header() to obtain image info.\n\nTypical code for this step is just\n\n        jpeg_read_header(&cinfo, TRUE);\n\nThis will read the source datastream header markers, up to the beginning\nof the compressed data proper.  On return, the image dimensions and other\ninfo have been stored in the JPEG object.  The application may wish to\nconsult this information before selecting decompression parameters.\n\nMore complex code is necessary if\n  * A suspending data source is used --- in that case jpeg_read_header()\n    may return before it has read all the header data.  See \"I/O suspension\",\n    below.  The normal stdio source manager will NOT cause this to happen.\n  * Abbreviated JPEG files are to be processed --- see the section on\n    abbreviated datastreams.  Standard applications that deal only in\n    interchange JPEG files need not be concerned with this case either.\n\nIt is permissible to stop at this point if you just wanted to find out the\nimage dimensions and other header info for a JPEG file.  In that case,\ncall jpeg_destroy() when you are done with the JPEG object, or call\njpeg_abort() to return it to an idle state before selecting a new data\nsource and reading another header.\n\n\n4. Set parameters for decompression.\n\njpeg_read_header() sets appropriate default decompression parameters based on\nthe properties of the image (in particular, its colorspace).  However, you\nmay well want to alter these defaults before beginning the decompression.\nFor example, the default is to produce full color output from a color file.\nIf you want colormapped output you must ask for it.  Other options allow the\nreturned image to be scaled and allow various speed/quality tradeoffs to be\nselected.  \"Decompression parameter selection\", below, gives details.\n\nIf the defaults are appropriate, nothing need be done at this step.\n\nNote that all default values are set by each call to jpeg_read_header().\nIf you reuse a decompression object, you cannot expect your parameter\nsettings to be preserved across cycles, as you can for compression.\nYou must set desired parameter values each time.\n\n\n5. jpeg_start_decompress(...);\n\nOnce the parameter values are satisfactory, call jpeg_start_decompress() to\nbegin decompression.  This will initialize internal state, allocate working\nmemory, and prepare for returning data.\n\nTypical code is just\n\n        jpeg_start_decompress(&cinfo);\n\nIf you have requested a multi-pass operating mode, such as 2-pass color\nquantization, jpeg_start_decompress() will do everything needed before data\noutput can begin.  In this case jpeg_start_decompress() may take quite a while\nto complete.  With a single-scan (non progressive) JPEG file and default\ndecompression parameters, this will not happen; jpeg_start_decompress() will\nreturn quickly.\n\nAfter this call, the final output image dimensions, including any requested\nscaling, are available in the JPEG object; so is the selected colormap, if\ncolormapped output has been requested.  Useful fields include\n\n        output_width            image width and height, as scaled\n        output_height\n        out_color_components    # of color components in out_color_space\n        output_components       # of color components returned per pixel\n        colormap                the selected colormap, if any\n        actual_number_of_colors         number of entries in colormap\n\noutput_components is 1 (a colormap index) when quantizing colors; otherwise it\nequals out_color_components.  It is the number of JSAMPLE values that will be\nemitted per pixel in the output arrays.\n\nTypically you will need to allocate data buffers to hold the incoming image.\nYou will need output_width * output_components JSAMPLEs per scanline in your\noutput buffer, and a total of output_height scanlines will be returned.\n\nNote: if you are using the JPEG library's internal memory manager to allocate\ndata buffers (as djpeg does), then the manager's protocol requires that you\nrequest large buffers *before* calling jpeg_start_decompress().  This is a\nlittle tricky since the output_XXX fields are not normally valid then.  You\ncan make them valid by calling jpeg_calc_output_dimensions() after setting the\nrelevant parameters (scaling, output color space, and quantization flag).\n\n\n6. while (scan lines remain to be read)\n        jpeg_read_scanlines(...);\n\nNow you can read the decompressed image data by calling jpeg_read_scanlines()\none or more times.  At each call, you pass in the maximum number of scanlines\nto be read (ie, the height of your working buffer); jpeg_read_scanlines()\nwill return up to that many lines.  The return value is the number of lines\nactually read.  The format of the returned data is discussed under \"Data\nformats\", above.  Don't forget that grayscale and color JPEGs will return\ndifferent data formats!\n\nImage data is returned in top-to-bottom scanline order.  If you must write\nout the image in bottom-to-top order, you can use the JPEG library's virtual\narray mechanism to invert the data efficiently.  Examples of this can be\nfound in the sample application djpeg.\n\nThe library maintains a count of the number of scanlines returned so far\nin the output_scanline field of the JPEG object.  Usually you can just use\nthis variable as the loop counter, so that the loop test looks like\n\"while (cinfo.output_scanline < cinfo.output_height)\".  (Note that the test\nshould NOT be against image_height, unless you never use scaling.  The\nimage_height field is the height of the original unscaled image.)\nThe return value always equals the change in the value of output_scanline.\n\nIf you don't use a suspending data source, it is safe to assume that\njpeg_read_scanlines() reads at least one scanline per call, until the\nbottom of the image has been reached.\n\nIf you use a buffer larger than one scanline, it is NOT safe to assume that\njpeg_read_scanlines() fills it.  (The current implementation returns only a\nfew scanlines per call, no matter how large a buffer you pass.)  So you must\nalways provide a loop that calls jpeg_read_scanlines() repeatedly until the\nwhole image has been read.\n\n\n7. jpeg_finish_decompress(...);\n\nAfter all the image data has been read, call jpeg_finish_decompress() to\ncomplete the decompression cycle.  This causes working memory associated\nwith the JPEG object to be released.\n\nTypical code:\n\n        jpeg_finish_decompress(&cinfo);\n\nIf using the stdio source manager, don't forget to close the source stdio\nstream if necessary.\n\nIt is an error to call jpeg_finish_decompress() before reading the correct\ntotal number of scanlines.  If you wish to abort decompression, call\njpeg_abort() as discussed below.\n\nAfter completing a decompression cycle, you may dispose of the JPEG object as\ndiscussed next, or you may use it to decompress another image.  In that case\nreturn to step 2 or 3 as appropriate.  If you do not change the source\nmanager, the next image will be read from the same source.\n\n\n8. Release the JPEG decompression object.\n\nWhen you are done with a JPEG decompression object, destroy it by calling\njpeg_destroy_decompress() or jpeg_destroy().  The previous discussion of\ndestroying compression objects applies here too.\n\nTypical code:\n\n        jpeg_destroy_decompress(&cinfo);\n\n\n9. Aborting.\n\nYou can abort a decompression cycle by calling jpeg_destroy_decompress() or\njpeg_destroy() if you don't need the JPEG object any more, or\njpeg_abort_decompress() or jpeg_abort() if you want to reuse the object.\nThe previous discussion of aborting compression cycles applies here too.\n\n\nPartial image decompression\n---------------------------\n\nPartial image decompression is convenient for performance-critical applications\nthat wish to view only a portion of a large JPEG image without decompressing\nthe whole thing.  It it also useful in memory-constrained environments (such as\non mobile devices.)  This library provides the following functions to support\npartial image decompression:\n\n1. Skipping rows when decompressing\n\n        jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines);\n\nThis function provides application programmers with the ability to skip over\nmultiple rows in the JPEG image.\n\nSuspending data sources are not supported by this function.  Calling\njpeg_skip_scanlines() with a suspending data source will result in undefined\nbehavior.\n\njpeg_skip_scanlines() will not allow skipping past the bottom of the image.  If\nthe value of num_lines is large enough to skip past the bottom of the image,\nthen the function will skip to the end of the image instead.\n\nIf the value of num_lines is valid, then jpeg_skip_scanlines() will always\nskip all of the input rows requested.  There is no need to inspect the return\nvalue of the function in that case.\n\nBest results will be achieved by calling jpeg_skip_scanlines() for large chunks\nof rows.  The function should be viewed as a way to quickly jump to a\nparticular vertical offset in the JPEG image in order to decode a subset of the\nimage.  Used in this manner, it will provide significant performance\nimprovements.\n\nCalling jpeg_skip_scanlines() for small values of num_lines has several\npotential drawbacks:\n    1) JPEG decompression occurs in blocks, so if jpeg_skip_scanlines() is\n       called from the middle of a decompression block, then it is likely that\n       much of the decompression work has already been done for the first\n       couple of rows that need to be skipped.\n    2) When this function returns, it must leave the decompressor in a state\n       such that it is ready to read the next line.  This may involve\n       decompressing a block that must be partially skipped.\nThese issues are especially tricky for cases in which upsampling requires\ncontext rows.  In the worst case, jpeg_skip_scanlines() will perform similarly\nto jpeg_read_scanlines() (since it will actually call jpeg_read_scanlines().)\n\n2. Decompressing partial scanlines\n\n        jpeg_crop_scanline (j_decompress_ptr cinfo, JDIMENSION *xoffset,\n                            JDIMENSION *width)\n\nThis function provides application programmers with the ability to decompress\nonly a portion of each row in the JPEG image.  It must be called after\njpeg_start_decompress() and before any calls to jpeg_read_scanlines() or\njpeg_skip_scanlines().\n\nIf xoffset and width do not form a valid subset of the image row, then this\nfunction will generate an error.  Note that if the output image is scaled, then\nxoffset and width are relative to the scaled image dimensions.\n\nxoffset and width are passed by reference because xoffset must fall on an iMCU\nboundary.  If it doesn't, then it will be moved left to the nearest iMCU\nboundary, and width will be increased accordingly.  If the calling program does\nnot like the adjusted values of xoffset and width, then it can call\njpeg_crop_scanline() again with new values (for instance, if it wants to move\nxoffset to the nearest iMCU boundary to the right instead of to the left.)\n\nAfter calling this function, cinfo->output_width will be set to the adjusted\nwidth.  This value should be used when allocating an output buffer to pass to\njpeg_read_scanlines().\n\nThe output image from a partial-width decompression will be identical to the\ncorresponding image region from a full decode, with one exception:  The \"fancy\"\n(smooth) h2v2 (4:2:0) and h2v1 (4:2:2) upsampling algorithms fill in the\nmissing chroma components by averaging the chroma components from neighboring\npixels, except on the right and left edges of the image (where there are no\nneighboring pixels.)  When performing a partial-width decompression, these\n\"fancy\" upsampling algorithms may treat the left and right edges of the partial\nimage region as if they are the left and right edges of the image, meaning that\nthe upsampling algorithm may be simplified.  The result is that the pixels on\nthe left or right edge of the partial image may not be exactly identical to the\ncorresponding pixels in the original image.\n\n\nMechanics of usage: include files, linking, etc\n-----------------------------------------------\n\nApplications using the JPEG library should include the header file jpeglib.h\nto obtain declarations of data types and routines.  Before including\njpeglib.h, include system headers that define at least the typedefs FILE and\nsize_t.  On ANSI-conforming systems, including <stdio.h> is sufficient; on\nolder Unix systems, you may need <sys/types.h> to define size_t.\n\nIf the application needs to refer to individual JPEG library error codes, also\ninclude jerror.h to define those symbols.\n\njpeglib.h indirectly includes the files jconfig.h and jmorecfg.h.  If you are\ninstalling the JPEG header files in a system directory, you will want to\ninstall all four files: jpeglib.h, jerror.h, jconfig.h, jmorecfg.h.\n\nThe most convenient way to include the JPEG code into your executable program\nis to prepare a library file (\"libjpeg.a\", or a corresponding name on non-Unix\nmachines) and reference it at your link step.  If you use only half of the\nlibrary (only compression or only decompression), only that much code will be\nincluded from the library, unless your linker is hopelessly brain-damaged.\nThe supplied makefiles build libjpeg.a automatically (see install.txt).\n\nWhile you can build the JPEG library as a shared library if the whim strikes\nyou, we don't really recommend it.  The trouble with shared libraries is that\nat some point you'll probably try to substitute a new version of the library\nwithout recompiling the calling applications.  That generally doesn't work\nbecause the parameter struct declarations usually change with each new\nversion.  In other words, the library's API is *not* guaranteed binary\ncompatible across versions; we only try to ensure source-code compatibility.\n(In hindsight, it might have been smarter to hide the parameter structs from\napplications and introduce a ton of access functions instead.  Too late now,\nhowever.)\n\nIt may be worth pointing out that the core JPEG library does not actually\nrequire the stdio library: only the default source/destination managers and\nerror handler need it.  You can use the library in a stdio-less environment\nif you replace those modules and use jmemnobs.c (or another memory manager of\nyour own devising).  More info about the minimum system library requirements\nmay be found in jinclude.h.\n\n\nADVANCED FEATURES\n=================\n\nCompression parameter selection\n-------------------------------\n\nThis section describes all the optional parameters you can set for JPEG\ncompression, as well as the \"helper\" routines provided to assist in this\ntask.  Proper setting of some parameters requires detailed understanding\nof the JPEG standard; if you don't know what a parameter is for, it's best\nnot to mess with it!  See REFERENCES in the README.ijg file for pointers to\nmore info about JPEG.\n\nIt's a good idea to call jpeg_set_defaults() first, even if you plan to set\nall the parameters; that way your code is more likely to work with future JPEG\nlibraries that have additional parameters.  For the same reason, we recommend\nyou use a helper routine where one is provided, in preference to twiddling\ncinfo fields directly.\n\nThe helper routines are:\n\njpeg_set_defaults (j_compress_ptr cinfo)\n        This routine sets all JPEG parameters to reasonable defaults, using\n        only the input image's color space (field in_color_space, which must\n        already be set in cinfo).  Many applications will only need to use\n        this routine and perhaps jpeg_set_quality().\n\njpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)\n        Sets the JPEG file's colorspace (field jpeg_color_space) as specified,\n        and sets other color-space-dependent parameters appropriately.  See\n        \"Special color spaces\", below, before using this.  A large number of\n        parameters, including all per-component parameters, are set by this\n        routine; if you want to twiddle individual parameters you should call\n        jpeg_set_colorspace() before rather than after.\n\njpeg_default_colorspace (j_compress_ptr cinfo)\n        Selects an appropriate JPEG colorspace based on cinfo->in_color_space,\n        and calls jpeg_set_colorspace().  This is actually a subroutine of\n        jpeg_set_defaults().  It's broken out in case you want to change\n        just the colorspace-dependent JPEG parameters.\n\njpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)\n        Constructs JPEG quantization tables appropriate for the indicated\n        quality setting.  The quality value is expressed on the 0..100 scale\n        recommended by IJG (cjpeg's \"-quality\" switch uses this routine).\n        Note that the exact mapping from quality values to tables may change\n        in future IJG releases as more is learned about DCT quantization.\n        If the force_baseline parameter is TRUE, then the quantization table\n        entries are constrained to the range 1..255 for full JPEG baseline\n        compatibility.  In the current implementation, this only makes a\n        difference for quality settings below 25, and it effectively prevents\n        very small/low quality files from being generated.  The IJG decoder\n        is capable of reading the non-baseline files generated at low quality\n        settings when force_baseline is FALSE, but other decoders may not be.\n\njpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,\n                         boolean force_baseline)\n        Same as jpeg_set_quality() except that the generated tables are the\n        sample tables given in the JPEC spec section K.1, multiplied by the\n        specified scale factor (which is expressed as a percentage; thus\n        scale_factor = 100 reproduces the spec's tables).  Note that larger\n        scale factors give lower quality.  This entry point is useful for\n        conforming to the Adobe PostScript DCT conventions, but we do not\n        recommend linear scaling as a user-visible quality scale otherwise.\n        force_baseline again constrains the computed table entries to 1..255.\n\nint jpeg_quality_scaling (int quality)\n        Converts a value on the IJG-recommended quality scale to a linear\n        scaling percentage.  Note that this routine may change or go away\n        in future releases --- IJG may choose to adopt a scaling method that\n        can't be expressed as a simple scalar multiplier, in which case the\n        premise of this routine collapses.  Caveat user.\n\njpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)\n        [libjpeg v7+ API/ABI emulation only]\n        Set default quantization tables with linear q_scale_factor[] values\n        (see below).\n\njpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,\n                      const unsigned int *basic_table,\n                      int scale_factor, boolean force_baseline)\n        Allows an arbitrary quantization table to be created.  which_tbl\n        indicates which table slot to fill.  basic_table points to an array\n        of 64 unsigned ints given in normal array order.  These values are\n        multiplied by scale_factor/100 and then clamped to the range 1..65535\n        (or to 1..255 if force_baseline is TRUE).\n        CAUTION: prior to library version 6a, jpeg_add_quant_table expected\n        the basic table to be given in JPEG zigzag order.  If you need to\n        write code that works with either older or newer versions of this\n        routine, you must check the library version number.  Something like\n        \"#if JPEG_LIB_VERSION >= 61\" is the right test.\n\njpeg_simple_progression (j_compress_ptr cinfo)\n        Generates a default scan script for writing a progressive-JPEG file.\n        This is the recommended method of creating a progressive file,\n        unless you want to make a custom scan sequence.  You must ensure that\n        the JPEG color space is set correctly before calling this routine.\n\n\nCompression parameters (cinfo fields) include:\n\nboolean arith_code\n\tIf TRUE, use arithmetic coding.\n\tIf FALSE, use Huffman coding.\n\nJ_DCT_METHOD dct_method\n        Selects the algorithm used for the DCT step.  Choices are:\n                JDCT_ISLOW: slow but accurate integer algorithm\n                JDCT_IFAST: faster, less accurate integer method\n                JDCT_FLOAT: floating-point method\n                JDCT_DEFAULT: default method (normally JDCT_ISLOW)\n                JDCT_FASTEST: fastest method (normally JDCT_IFAST)\n        In libjpeg-turbo, JDCT_IFAST is generally about 5-15% faster than\n        JDCT_ISLOW when using the x86/x86-64 SIMD extensions (results may vary\n        with other SIMD implementations, or when using libjpeg-turbo without\n        SIMD extensions.)  For quality levels of 90 and below, there should be\n        little or no perceptible difference between the two algorithms.  For\n        quality levels above 90, however, the difference between JDCT_IFAST and\n        JDCT_ISLOW becomes more pronounced.  With quality=97, for instance,\n        JDCT_IFAST incurs generally about a 1-3 dB loss (in PSNR) relative to\n        JDCT_ISLOW, but this can be larger for some images.  Do not use\n        JDCT_IFAST with quality levels above 97.  The algorithm often\n        degenerates at quality=98 and above and can actually produce a more\n        lossy image than if lower quality levels had been used.  Also, in\n        libjpeg-turbo, JDCT_IFAST is not fully accelerated for quality levels\n        above 97, so it will be slower than JDCT_ISLOW.  JDCT_FLOAT is mainly a\n        legacy feature.  It does not produce significantly more accurate\n        results than the ISLOW method, and it is much slower.  The FLOAT method\n        may also give different results on different machines due to varying\n        roundoff behavior, whereas the integer methods should give the same\n        results on all machines.\n\nJ_COLOR_SPACE jpeg_color_space\nint num_components\n        The JPEG color space and corresponding number of components; see\n        \"Special color spaces\", below, for more info.  We recommend using\n        jpeg_set_color_space() if you want to change these.\n\nboolean optimize_coding\n        TRUE causes the compressor to compute optimal Huffman coding tables\n        for the image.  This requires an extra pass over the data and\n        therefore costs a good deal of space and time.  The default is\n        FALSE, which tells the compressor to use the supplied or default\n        Huffman tables.  In most cases optimal tables save only a few percent\n        of file size compared to the default tables.  Note that when this is\n        TRUE, you need not supply Huffman tables at all, and any you do\n        supply will be overwritten.\n\nunsigned int restart_interval\nint restart_in_rows\n        To emit restart markers in the JPEG file, set one of these nonzero.\n        Set restart_interval to specify the exact interval in MCU blocks.\n        Set restart_in_rows to specify the interval in MCU rows.  (If\n        restart_in_rows is not 0, then restart_interval is set after the\n        image width in MCUs is computed.)  Defaults are zero (no restarts).\n        One restart marker per MCU row is often a good choice.\n        NOTE: the overhead of restart markers is higher in grayscale JPEG\n        files than in color files, and MUCH higher in progressive JPEGs.\n        If you use restarts, you may want to use larger intervals in those\n        cases.\n\nconst jpeg_scan_info *scan_info\nint num_scans\n        By default, scan_info is NULL; this causes the compressor to write a\n        single-scan sequential JPEG file.  If not NULL, scan_info points to\n        an array of scan definition records of length num_scans.  The\n        compressor will then write a JPEG file having one scan for each scan\n        definition record.  This is used to generate noninterleaved or\n        progressive JPEG files.  The library checks that the scan array\n        defines a valid JPEG scan sequence.  (jpeg_simple_progression creates\n        a suitable scan definition array for progressive JPEG.)  This is\n        discussed further under \"Progressive JPEG support\".\n\nint smoothing_factor\n        If non-zero, the input image is smoothed; the value should be 1 for\n        minimal smoothing to 100 for maximum smoothing.  Consult jcsample.c\n        for details of the smoothing algorithm.  The default is zero.\n\nboolean write_JFIF_header\n        If TRUE, a JFIF APP0 marker is emitted.  jpeg_set_defaults() and\n        jpeg_set_colorspace() set this TRUE if a JFIF-legal JPEG color space\n        (ie, YCbCr or grayscale) is selected, otherwise FALSE.\n\nUINT8 JFIF_major_version\nUINT8 JFIF_minor_version\n        The version number to be written into the JFIF marker.\n        jpeg_set_defaults() initializes the version to 1.01 (major=minor=1).\n        You should set it to 1.02 (major=1, minor=2) if you plan to write\n        any JFIF 1.02 extension markers.\n\nUINT8 density_unit\nUINT16 X_density\nUINT16 Y_density\n        The resolution information to be written into the JFIF marker;\n        not used otherwise.  density_unit may be 0 for unknown,\n        1 for dots/inch, or 2 for dots/cm.  The default values are 0,1,1\n        indicating square pixels of unknown size.\n\nboolean write_Adobe_marker\n        If TRUE, an Adobe APP14 marker is emitted.  jpeg_set_defaults() and\n        jpeg_set_colorspace() set this TRUE if JPEG color space RGB, CMYK,\n        or YCCK is selected, otherwise FALSE.  It is generally a bad idea\n        to set both write_JFIF_header and write_Adobe_marker.  In fact,\n        you probably shouldn't change the default settings at all --- the\n        default behavior ensures that the JPEG file's color space can be\n        recognized by the decoder.\n\nJQUANT_TBL *quant_tbl_ptrs[NUM_QUANT_TBLS]\n        Pointers to coefficient quantization tables, one per table slot,\n        or NULL if no table is defined for a slot.  Usually these should\n        be set via one of the above helper routines; jpeg_add_quant_table()\n        is general enough to define any quantization table.  The other\n        routines will set up table slot 0 for luminance quality and table\n        slot 1 for chrominance.\n\nint q_scale_factor[NUM_QUANT_TBLS]\n        [libjpeg v7+ API/ABI emulation only]\n        Linear quantization scaling factors (0-100, default 100)\n        for use with jpeg_default_qtables().\n        See rdswitch.c and cjpeg.c for an example of usage.\n        Note that the q_scale_factor[] values use \"linear\" scales, so JPEG\n        quality levels chosen by the user must be converted to these scales\n        using jpeg_quality_scaling().  Here is an example that corresponds to\n        cjpeg -quality 90,70:\n\n                jpeg_set_defaults(cinfo);\n\n                /* Set luminance quality 90. */\n                cinfo->q_scale_factor[0] = jpeg_quality_scaling(90);\n                /* Set chrominance quality 70. */\n                cinfo->q_scale_factor[1] = jpeg_quality_scaling(70);\n\n                jpeg_default_qtables(cinfo, force_baseline);\n\n        CAUTION: Setting separate quality levels for chrominance and luminance\n        is mainly only useful if chrominance subsampling is disabled.  2x2\n        chrominance subsampling (AKA \"4:2:0\") is the default, but you can\n        explicitly disable subsampling as follows:\n\n                cinfo->comp_info[0].v_samp_factor = 1;\n                cinfo->comp_info[0].h_samp_factor = 1;\n\nJHUFF_TBL *dc_huff_tbl_ptrs[NUM_HUFF_TBLS]\nJHUFF_TBL *ac_huff_tbl_ptrs[NUM_HUFF_TBLS]\n        Pointers to Huffman coding tables, one per table slot, or NULL if\n        no table is defined for a slot.  Slots 0 and 1 are filled with the\n        JPEG sample tables by jpeg_set_defaults().  If you need to allocate\n        more table structures, jpeg_alloc_huff_table() may be used.\n        Note that optimal Huffman tables can be computed for an image\n        by setting optimize_coding, as discussed above; there's seldom\n        any need to mess with providing your own Huffman tables.\n\n\n[libjpeg v7+ API/ABI emulation only]\nThe actual dimensions of the JPEG image that will be written to the file are\ngiven by the following fields.  These are computed from the input image\ndimensions and the compression parameters by jpeg_start_compress().  You can\nalso call jpeg_calc_jpeg_dimensions() to obtain the values that will result\nfrom the current parameter settings.  This can be useful if you are trying\nto pick a scaling ratio that will get close to a desired target size.\n\nJDIMENSION jpeg_width           Actual dimensions of output image.\nJDIMENSION jpeg_height\n\n\nPer-component parameters are stored in the struct cinfo.comp_info[i] for\ncomponent number i.  Note that components here refer to components of the\nJPEG color space, *not* the source image color space.  A suitably large\ncomp_info[] array is allocated by jpeg_set_defaults(); if you choose not\nto use that routine, it's up to you to allocate the array.\n\nint component_id\n        The one-byte identifier code to be recorded in the JPEG file for\n        this component.  For the standard color spaces, we recommend you\n        leave the default values alone.\n\nint h_samp_factor\nint v_samp_factor\n        Horizontal and vertical sampling factors for the component; must\n        be 1..4 according to the JPEG standard.  Note that larger sampling\n        factors indicate a higher-resolution component; many people find\n        this behavior quite unintuitive.  The default values are 2,2 for\n        luminance components and 1,1 for chrominance components, except\n        for grayscale where 1,1 is used.\n\nint quant_tbl_no\n        Quantization table number for component.  The default value is\n        0 for luminance components and 1 for chrominance components.\n\nint dc_tbl_no\nint ac_tbl_no\n        DC and AC entropy coding table numbers.  The default values are\n        0 for luminance components and 1 for chrominance components.\n\nint component_index\n        Must equal the component's index in comp_info[].  (Beginning in\n        release v6, the compressor library will fill this in automatically;\n        you don't have to.)\n\n\nDecompression parameter selection\n---------------------------------\n\nDecompression parameter selection is somewhat simpler than compression\nparameter selection, since all of the JPEG internal parameters are\nrecorded in the source file and need not be supplied by the application.\n(Unless you are working with abbreviated files, in which case see\n\"Abbreviated datastreams\", below.)  Decompression parameters control\nthe postprocessing done on the image to deliver it in a format suitable\nfor the application's use.  Many of the parameters control speed/quality\ntradeoffs, in which faster decompression may be obtained at the price of\na poorer-quality image.  The defaults select the highest quality (slowest)\nprocessing.\n\nThe following fields in the JPEG object are set by jpeg_read_header() and\nmay be useful to the application in choosing decompression parameters:\n\nJDIMENSION image_width                  Width and height of image\nJDIMENSION image_height\nint num_components                      Number of color components\nJ_COLOR_SPACE jpeg_color_space          Colorspace of image\nboolean saw_JFIF_marker                 TRUE if a JFIF APP0 marker was seen\n  UINT8 JFIF_major_version              Version information from JFIF marker\n  UINT8 JFIF_minor_version\n  UINT8 density_unit                    Resolution data from JFIF marker\n  UINT16 X_density\n  UINT16 Y_density\nboolean saw_Adobe_marker                TRUE if an Adobe APP14 marker was seen\n  UINT8 Adobe_transform                 Color transform code from Adobe marker\n\nThe JPEG color space, unfortunately, is something of a guess since the JPEG\nstandard proper does not provide a way to record it.  In practice most files\nadhere to the JFIF or Adobe conventions, and the decoder will recognize these\ncorrectly.  See \"Special color spaces\", below, for more info.\n\n\nThe decompression parameters that determine the basic properties of the\nreturned image are:\n\nJ_COLOR_SPACE out_color_space\n        Output color space.  jpeg_read_header() sets an appropriate default\n        based on jpeg_color_space; typically it will be RGB or grayscale.\n        The application can change this field to request output in a different\n        colorspace.  For example, set it to JCS_GRAYSCALE to get grayscale\n        output from a color file.  (This is useful for previewing: grayscale\n        output is faster than full color since the color components need not\n        be processed.)  Note that not all possible color space transforms are\n        currently implemented; you may need to extend jdcolor.c if you want an\n        unusual conversion.\n\nunsigned int scale_num, scale_denom\n        Scale the image by the fraction scale_num/scale_denom.  Default is\n        1/1, or no scaling.  Currently, the only supported scaling ratios\n        are M/8 with all M from 1 to 16, or any reduced fraction thereof (such\n        as 1/2, 3/4, etc.)  (The library design allows for arbitrary\n        scaling ratios but this is not likely to be implemented any time soon.)\n        Smaller scaling ratios permit significantly faster decoding since\n        fewer pixels need be processed and a simpler IDCT method can be used.\n\nboolean quantize_colors\n        If set TRUE, colormapped output will be delivered.  Default is FALSE,\n        meaning that full-color output will be delivered.\n\nThe next three parameters are relevant only if quantize_colors is TRUE.\n\nint desired_number_of_colors\n        Maximum number of colors to use in generating a library-supplied color\n        map (the actual number of colors is returned in a different field).\n        Default 256.  Ignored when the application supplies its own color map.\n\nboolean two_pass_quantize\n        If TRUE, an extra pass over the image is made to select a custom color\n        map for the image.  This usually looks a lot better than the one-size-\n        fits-all colormap that is used otherwise.  Default is TRUE.  Ignored\n        when the application supplies its own color map.\n\nJ_DITHER_MODE dither_mode\n        Selects color dithering method.  Supported values are:\n                JDITHER_NONE    no dithering: fast, very low quality\n                JDITHER_ORDERED ordered dither: moderate speed and quality\n                JDITHER_FS      Floyd-Steinberg dither: slow, high quality\n        Default is JDITHER_FS.  (At present, ordered dither is implemented\n        only in the single-pass, standard-colormap case.  If you ask for\n        ordered dither when two_pass_quantize is TRUE or when you supply\n        an external color map, you'll get F-S dithering.)\n\nWhen quantize_colors is TRUE, the target color map is described by the next\ntwo fields.  colormap is set to NULL by jpeg_read_header().  The application\ncan supply a color map by setting colormap non-NULL and setting\nactual_number_of_colors to the map size.  Otherwise, jpeg_start_decompress()\nselects a suitable color map and sets these two fields itself.\n[Implementation restriction: at present, an externally supplied colormap is\nonly accepted for 3-component output color spaces.]\n\nJSAMPARRAY colormap\n        The color map, represented as a 2-D pixel array of out_color_components\n        rows and actual_number_of_colors columns.  Ignored if not quantizing.\n        CAUTION: if the JPEG library creates its own colormap, the storage\n        pointed to by this field is released by jpeg_finish_decompress().\n        Copy the colormap somewhere else first, if you want to save it.\n\nint actual_number_of_colors\n        The number of colors in the color map.\n\nAdditional decompression parameters that the application may set include:\n\nJ_DCT_METHOD dct_method\n        Selects the algorithm used for the DCT step.  Choices are:\n                JDCT_ISLOW: slow but accurate integer algorithm\n                JDCT_IFAST: faster, less accurate integer method\n                JDCT_FLOAT: floating-point method\n                JDCT_DEFAULT: default method (normally JDCT_ISLOW)\n                JDCT_FASTEST: fastest method (normally JDCT_IFAST)\n        In libjpeg-turbo, JDCT_IFAST is generally about 5-15% faster than\n        JDCT_ISLOW when using the x86/x86-64 SIMD extensions (results may vary\n        with other SIMD implementations, or when using libjpeg-turbo without\n        SIMD extensions.)  If the JPEG image was compressed using a quality\n        level of 85 or below, then there should be little or no perceptible\n        difference between the two algorithms.  When decompressing images that\n        were compressed using quality levels above 85, however, the difference\n        between JDCT_IFAST and JDCT_ISLOW becomes more pronounced.  With images\n        compressed using quality=97, for instance, JDCT_IFAST incurs generally\n        about a 4-6 dB loss (in PSNR) relative to JDCT_ISLOW, but this can be\n        larger for some images.  If you can avoid it, do not use JDCT_IFAST\n        when decompressing images that were compressed using quality levels\n        above 97.  The algorithm often degenerates for such images and can\n        actually produce a more lossy output image than if the JPEG image had\n        been compressed using lower quality levels.  JDCT_FLOAT is mainly a\n        legacy feature.  It does not produce significantly more accurate\n        results than the ISLOW method, and it is much slower.  The FLOAT method\n        may also give different results on different machines due to varying\n        roundoff behavior, whereas the integer methods should give the same\n        results on all machines.\n\nboolean do_fancy_upsampling\n        If TRUE, do careful upsampling of chroma components.  If FALSE,\n        a faster but sloppier method is used.  Default is TRUE.  The visual\n        impact of the sloppier method is often very small.\n\nboolean do_block_smoothing\n        If TRUE, interblock smoothing is applied in early stages of decoding\n        progressive JPEG files; if FALSE, not.  Default is TRUE.  Early\n        progression stages look \"fuzzy\" with smoothing, \"blocky\" without.\n        In any case, block smoothing ceases to be applied after the first few\n        AC coefficients are known to full accuracy, so it is relevant only\n        when using buffered-image mode for progressive images.\n\nboolean enable_1pass_quant\nboolean enable_external_quant\nboolean enable_2pass_quant\n        These are significant only in buffered-image mode, which is\n        described in its own section below.\n\n\nThe output image dimensions are given by the following fields.  These are\ncomputed from the source image dimensions and the decompression parameters\nby jpeg_start_decompress().  You can also call jpeg_calc_output_dimensions()\nto obtain the values that will result from the current parameter settings.\nThis can be useful if you are trying to pick a scaling ratio that will get\nclose to a desired target size.  It's also important if you are using the\nJPEG library's memory manager to allocate output buffer space, because you\nare supposed to request such buffers *before* jpeg_start_decompress().\n\nJDIMENSION output_width         Actual dimensions of output image.\nJDIMENSION output_height\nint out_color_components        Number of color components in out_color_space.\nint output_components           Number of color components returned.\nint rec_outbuf_height           Recommended height of scanline buffer.\n\nWhen quantizing colors, output_components is 1, indicating a single color map\nindex per pixel.  Otherwise it equals out_color_components.  The output arrays\nare required to be output_width * output_components JSAMPLEs wide.\n\nrec_outbuf_height is the recommended minimum height (in scanlines) of the\nbuffer passed to jpeg_read_scanlines().  If the buffer is smaller, the\nlibrary will still work, but time will be wasted due to unnecessary data\ncopying.  In high-quality modes, rec_outbuf_height is always 1, but some\nfaster, lower-quality modes set it to larger values (typically 2 to 4).\nIf you are going to ask for a high-speed processing mode, you may as well\ngo to the trouble of honoring rec_outbuf_height so as to avoid data copying.\n(An output buffer larger than rec_outbuf_height lines is OK, but won't\nprovide any material speed improvement over that height.)\n\n\nSpecial color spaces\n--------------------\n\nThe JPEG standard itself is \"color blind\" and doesn't specify any particular\ncolor space.  It is customary to convert color data to a luminance/chrominance\ncolor space before compressing, since this permits greater compression.  The\nexisting de-facto JPEG file format standards specify YCbCr or grayscale data\n(JFIF), or grayscale, RGB, YCbCr, CMYK, or YCCK (Adobe).  For special\napplications such as multispectral images, other color spaces can be used,\nbut it must be understood that such files will be unportable.\n\nThe JPEG library can handle the most common colorspace conversions (namely\nRGB <=> YCbCr and CMYK <=> YCCK).  It can also deal with data of an unknown\ncolor space, passing it through without conversion.  If you deal extensively\nwith an unusual color space, you can easily extend the library to understand\nadditional color spaces and perform appropriate conversions.\n\nFor compression, the source data's color space is specified by field\nin_color_space.  This is transformed to the JPEG file's color space given\nby jpeg_color_space.  jpeg_set_defaults() chooses a reasonable JPEG color\nspace depending on in_color_space, but you can override this by calling\njpeg_set_colorspace().  Of course you must select a supported transformation.\njccolor.c currently supports the following transformations:\n        RGB => YCbCr\n        RGB => GRAYSCALE\n        YCbCr => GRAYSCALE\n        CMYK => YCCK\nplus the null transforms: GRAYSCALE => GRAYSCALE, RGB => RGB,\nYCbCr => YCbCr, CMYK => CMYK, YCCK => YCCK, and UNKNOWN => UNKNOWN.\n\nThe de-facto file format standards (JFIF and Adobe) specify APPn markers that\nindicate the color space of the JPEG file.  It is important to ensure that\nthese are written correctly, or omitted if the JPEG file's color space is not\none of the ones supported by the de-facto standards.  jpeg_set_colorspace()\nwill set the compression parameters to include or omit the APPn markers\nproperly, so long as it is told the truth about the JPEG color space.\nFor example, if you are writing some random 3-component color space without\nconversion, don't try to fake out the library by setting in_color_space and\njpeg_color_space to JCS_YCbCr; use JCS_UNKNOWN.  You may want to write an\nAPPn marker of your own devising to identify the colorspace --- see \"Special\nmarkers\", below.\n\nWhen told that the color space is UNKNOWN, the library will default to using\nluminance-quality compression parameters for all color components.  You may\nwell want to change these parameters.  See the source code for\njpeg_set_colorspace(), in jcparam.c, for details.\n\nFor decompression, the JPEG file's color space is given in jpeg_color_space,\nand this is transformed to the output color space out_color_space.\njpeg_read_header's setting of jpeg_color_space can be relied on if the file\nconforms to JFIF or Adobe conventions, but otherwise it is no better than a\nguess.  If you know the JPEG file's color space for certain, you can override\njpeg_read_header's guess by setting jpeg_color_space.  jpeg_read_header also\nselects a default output color space based on (its guess of) jpeg_color_space;\nset out_color_space to override this.  Again, you must select a supported\ntransformation.  jdcolor.c currently supports\n        YCbCr => RGB\n        YCbCr => GRAYSCALE\n        RGB => GRAYSCALE\n        GRAYSCALE => RGB\n        YCCK => CMYK\nas well as the null transforms.  (Since GRAYSCALE=>RGB is provided, an\napplication can force grayscale JPEGs to look like color JPEGs if it only\nwants to handle one case.)\n\nThe two-pass color quantizer, jquant2.c, is specialized to handle RGB data\n(it weights distances appropriately for RGB colors).  You'll need to modify\nthe code if you want to use it for non-RGB output color spaces.  Note that\njquant2.c is used to map to an application-supplied colormap as well as for\nthe normal two-pass colormap selection process.\n\nCAUTION: it appears that Adobe Photoshop writes inverted data in CMYK JPEG\nfiles: 0 represents 100% ink coverage, rather than 0% ink as you'd expect.\nThis is arguably a bug in Photoshop, but if you need to work with Photoshop\nCMYK files, you will have to deal with it in your application.  We cannot\n\"fix\" this in the library by inverting the data during the CMYK<=>YCCK\ntransform, because that would break other applications, notably Ghostscript.\nPhotoshop versions prior to 3.0 write EPS files containing JPEG-encoded CMYK\ndata in the same inverted-YCCK representation used in bare JPEG files, but\nthe surrounding PostScript code performs an inversion using the PS image\noperator.  I am told that Photoshop 3.0 will write uninverted YCCK in\nEPS/JPEG files, and will omit the PS-level inversion.  (But the data\npolarity used in bare JPEG files will not change in 3.0.)  In either case,\nthe JPEG library must not invert the data itself, or else Ghostscript would\nread these EPS files incorrectly.\n\n\nError handling\n--------------\n\nWhen the default error handler is used, any error detected inside the JPEG\nroutines will cause a message to be printed on stderr, followed by exit().\nYou can supply your own error handling routines to override this behavior\nand to control the treatment of nonfatal warnings and trace/debug messages.\nThe file example.c illustrates the most common case, which is to have the\napplication regain control after an error rather than exiting.\n\nThe JPEG library never writes any message directly; it always goes through\nthe error handling routines.  Three classes of messages are recognized:\n  * Fatal errors: the library cannot continue.\n  * Warnings: the library can continue, but the data is corrupt, and a\n    damaged output image is likely to result.\n  * Trace/informational messages.  These come with a trace level indicating\n    the importance of the message; you can control the verbosity of the\n    program by adjusting the maximum trace level that will be displayed.\n\nYou may, if you wish, simply replace the entire JPEG error handling module\n(jerror.c) with your own code.  However, you can avoid code duplication by\nonly replacing some of the routines depending on the behavior you need.\nThis is accomplished by calling jpeg_std_error() as usual, but then overriding\nsome of the method pointers in the jpeg_error_mgr struct, as illustrated by\nexample.c.\n\nAll of the error handling routines will receive a pointer to the JPEG object\n(a j_common_ptr which points to either a jpeg_compress_struct or a\njpeg_decompress_struct; if you need to tell which, test the is_decompressor\nfield).  This struct includes a pointer to the error manager struct in its\n\"err\" field.  Frequently, custom error handler routines will need to access\nadditional data which is not known to the JPEG library or the standard error\nhandler.  The most convenient way to do this is to embed either the JPEG\nobject or the jpeg_error_mgr struct in a larger structure that contains\nadditional fields; then casting the passed pointer provides access to the\nadditional fields.  Again, see example.c for one way to do it.  (Beginning\nwith IJG version 6b, there is also a void pointer \"client_data\" in each\nJPEG object, which the application can also use to find related data.\nThe library does not touch client_data at all.)\n\nThe individual methods that you might wish to override are:\n\nerror_exit (j_common_ptr cinfo)\n        Receives control for a fatal error.  Information sufficient to\n        generate the error message has been stored in cinfo->err; call\n        output_message to display it.  Control must NOT return to the caller;\n        generally this routine will exit() or longjmp() somewhere.\n        Typically you would override this routine to get rid of the exit()\n        default behavior.  Note that if you continue processing, you should\n        clean up the JPEG object with jpeg_abort() or jpeg_destroy().\n\noutput_message (j_common_ptr cinfo)\n        Actual output of any JPEG message.  Override this to send messages\n        somewhere other than stderr.  Note that this method does not know\n        how to generate a message, only where to send it.\n\nformat_message (j_common_ptr cinfo, char *buffer)\n        Constructs a readable error message string based on the error info\n        stored in cinfo->err.  This method is called by output_message.  Few\n        applications should need to override this method.  One possible\n        reason for doing so is to implement dynamic switching of error message\n        language.\n\nemit_message (j_common_ptr cinfo, int msg_level)\n        Decide whether or not to emit a warning or trace message; if so,\n        calls output_message.  The main reason for overriding this method\n        would be to abort on warnings.  msg_level is -1 for warnings,\n        0 and up for trace messages.\n\nOnly error_exit() and emit_message() are called from the rest of the JPEG\nlibrary; the other two are internal to the error handler.\n\nThe actual message texts are stored in an array of strings which is pointed to\nby the field err->jpeg_message_table.  The messages are numbered from 0 to\nerr->last_jpeg_message, and it is these code numbers that are used in the\nJPEG library code.  You could replace the message texts (for instance, with\nmessages in French or German) by changing the message table pointer.  See\njerror.h for the default texts.  CAUTION: this table will almost certainly\nchange or grow from one library version to the next.\n\nIt may be useful for an application to add its own message texts that are\nhandled by the same mechanism.  The error handler supports a second \"add-on\"\nmessage table for this purpose.  To define an addon table, set the pointer\nerr->addon_message_table and the message numbers err->first_addon_message and\nerr->last_addon_message.  If you number the addon messages beginning at 1000\nor so, you won't have to worry about conflicts with the library's built-in\nmessages.  See the sample applications cjpeg/djpeg for an example of using\naddon messages (the addon messages are defined in cderror.h).\n\nActual invocation of the error handler is done via macros defined in jerror.h:\n        ERREXITn(...)   for fatal errors\n        WARNMSn(...)    for corrupt-data warnings\n        TRACEMSn(...)   for trace and informational messages.\nThese macros store the message code and any additional parameters into the\nerror handler struct, then invoke the error_exit() or emit_message() method.\nThe variants of each macro are for varying numbers of additional parameters.\nThe additional parameters are inserted into the generated message using\nstandard printf() format codes.\n\nSee jerror.h and jerror.c for further details.\n\n\nCompressed data handling (source and destination managers)\n----------------------------------------------------------\n\nThe JPEG compression library sends its compressed data to a \"destination\nmanager\" module.  The default destination manager just writes the data to a\nmemory buffer or to a stdio stream, but you can provide your own manager to\ndo something else.  Similarly, the decompression library calls a \"source\nmanager\" to obtain the compressed data; you can provide your own source\nmanager if you want the data to come from somewhere other than a memory\nbuffer or a stdio stream.\n\nIn both cases, compressed data is processed a bufferload at a time: the\ndestination or source manager provides a work buffer, and the library invokes\nthe manager only when the buffer is filled or emptied.  (You could define a\none-character buffer to force the manager to be invoked for each byte, but\nthat would be rather inefficient.)  The buffer's size and location are\ncontrolled by the manager, not by the library.  For example, the memory\nsource manager just makes the buffer pointer and length point to the original\ndata in memory.  In this case the buffer-reload procedure will be invoked\nonly if the decompressor ran off the end of the datastream, which would\nindicate an erroneous datastream.\n\nThe work buffer is defined as an array of datatype JOCTET, which is generally\n\"char\" or \"unsigned char\".  On a machine where char is not exactly 8 bits\nwide, you must define JOCTET as a wider data type and then modify the data\nsource and destination modules to transcribe the work arrays into 8-bit units\non external storage.\n\nA data destination manager struct contains a pointer and count defining the\nnext byte to write in the work buffer and the remaining free space:\n\n        JOCTET *next_output_byte;   /* => next byte to write in buffer */\n        size_t free_in_buffer;      /* # of byte spaces remaining in buffer */\n\nThe library increments the pointer and decrements the count until the buffer\nis filled.  The manager's empty_output_buffer method must reset the pointer\nand count.  The manager is expected to remember the buffer's starting address\nand total size in private fields not visible to the library.\n\nA data destination manager provides three methods:\n\ninit_destination (j_compress_ptr cinfo)\n        Initialize destination.  This is called by jpeg_start_compress()\n        before any data is actually written.  It must initialize\n        next_output_byte and free_in_buffer.  free_in_buffer must be\n        initialized to a positive value.\n\nempty_output_buffer (j_compress_ptr cinfo)\n        This is called whenever the buffer has filled (free_in_buffer\n        reaches zero).  In typical applications, it should write out the\n        *entire* buffer (use the saved start address and buffer length;\n        ignore the current state of next_output_byte and free_in_buffer).\n        Then reset the pointer & count to the start of the buffer, and\n        return TRUE indicating that the buffer has been dumped.\n        free_in_buffer must be set to a positive value when TRUE is\n        returned.  A FALSE return should only be used when I/O suspension is\n        desired (this operating mode is discussed in the next section).\n\nterm_destination (j_compress_ptr cinfo)\n        Terminate destination --- called by jpeg_finish_compress() after all\n        data has been written.  In most applications, this must flush any\n        data remaining in the buffer.  Use either next_output_byte or\n        free_in_buffer to determine how much data is in the buffer.\n\nterm_destination() is NOT called by jpeg_abort() or jpeg_destroy().  If you\nwant the destination manager to be cleaned up during an abort, you must do it\nyourself.\n\nYou will also need code to create a jpeg_destination_mgr struct, fill in its\nmethod pointers, and insert a pointer to the struct into the \"dest\" field of\nthe JPEG compression object.  This can be done in-line in your setup code if\nyou like, but it's probably cleaner to provide a separate routine similar to\nthe jpeg_stdio_dest() or jpeg_mem_dest() routines of the supplied destination\nmanagers.\n\nDecompression source managers follow a parallel design, but with some\nadditional frammishes.  The source manager struct contains a pointer and count\ndefining the next byte to read from the work buffer and the number of bytes\nremaining:\n\n        const JOCTET *next_input_byte;  /* => next byte to read from buffer */\n        size_t bytes_in_buffer;         /* # of bytes remaining in buffer */\n\nThe library increments the pointer and decrements the count until the buffer\nis emptied.  The manager's fill_input_buffer method must reset the pointer and\ncount.  In most applications, the manager must remember the buffer's starting\naddress and total size in private fields not visible to the library.\n\nA data source manager provides five methods:\n\ninit_source (j_decompress_ptr cinfo)\n        Initialize source.  This is called by jpeg_read_header() before any\n        data is actually read.  Unlike init_destination(), it may leave\n        bytes_in_buffer set to 0 (in which case a fill_input_buffer() call\n        will occur immediately).\n\nfill_input_buffer (j_decompress_ptr cinfo)\n        This is called whenever bytes_in_buffer has reached zero and more\n        data is wanted.  In typical applications, it should read fresh data\n        into the buffer (ignoring the current state of next_input_byte and\n        bytes_in_buffer), reset the pointer & count to the start of the\n        buffer, and return TRUE indicating that the buffer has been reloaded.\n        It is not necessary to fill the buffer entirely, only to obtain at\n        least one more byte.  bytes_in_buffer MUST be set to a positive value\n        if TRUE is returned.  A FALSE return should only be used when I/O\n        suspension is desired (this mode is discussed in the next section).\n\nskip_input_data (j_decompress_ptr cinfo, long num_bytes)\n        Skip num_bytes worth of data.  The buffer pointer and count should\n        be advanced over num_bytes input bytes, refilling the buffer as\n        needed.  This is used to skip over a potentially large amount of\n        uninteresting data (such as an APPn marker).  In some applications\n        it may be possible to optimize away the reading of the skipped data,\n        but it's not clear that being smart is worth much trouble; large\n        skips are uncommon.  bytes_in_buffer may be zero on return.\n        A zero or negative skip count should be treated as a no-op.\n\nresync_to_restart (j_decompress_ptr cinfo, int desired)\n        This routine is called only when the decompressor has failed to find\n        a restart (RSTn) marker where one is expected.  Its mission is to\n        find a suitable point for resuming decompression.  For most\n        applications, we recommend that you just use the default resync\n        procedure, jpeg_resync_to_restart().  However, if you are able to back\n        up in the input data stream, or if you have a-priori knowledge about\n        the likely location of restart markers, you may be able to do better.\n        Read the read_restart_marker() and jpeg_resync_to_restart() routines\n        in jdmarker.c if you think you'd like to implement your own resync\n        procedure.\n\nterm_source (j_decompress_ptr cinfo)\n        Terminate source --- called by jpeg_finish_decompress() after all\n        data has been read.  Often a no-op.\n\nFor both fill_input_buffer() and skip_input_data(), there is no such thing\nas an EOF return.  If the end of the file has been reached, the routine has\na choice of exiting via ERREXIT() or inserting fake data into the buffer.\nIn most cases, generating a warning message and inserting a fake EOI marker\nis the best course of action --- this will allow the decompressor to output\nhowever much of the image is there.  In pathological cases, the decompressor\nmay swallow the EOI and again demand data ... just keep feeding it fake EOIs.\njdatasrc.c illustrates the recommended error recovery behavior.\n\nterm_source() is NOT called by jpeg_abort() or jpeg_destroy().  If you want\nthe source manager to be cleaned up during an abort, you must do it yourself.\n\nYou will also need code to create a jpeg_source_mgr struct, fill in its method\npointers, and insert a pointer to the struct into the \"src\" field of the JPEG\ndecompression object.  This can be done in-line in your setup code if you\nlike, but it's probably cleaner to provide a separate routine similar to the\njpeg_stdio_src() or jpeg_mem_src() routines of the supplied source managers.\n\nFor more information, consult the memory and stdio source and destination\nmanagers in jdatasrc.c and jdatadst.c.\n\n\nI/O suspension\n--------------\n\nSome applications need to use the JPEG library as an incremental memory-to-\nmemory filter: when the compressed data buffer is filled or emptied, they want\ncontrol to return to the outer loop, rather than expecting that the buffer can\nbe emptied or reloaded within the data source/destination manager subroutine.\nThe library supports this need by providing an \"I/O suspension\" mode, which we\ndescribe in this section.\n\nThe I/O suspension mode is not a panacea: nothing is guaranteed about the\nmaximum amount of time spent in any one call to the library, so it will not\neliminate response-time problems in single-threaded applications.  If you\nneed guaranteed response time, we suggest you \"bite the bullet\" and implement\na real multi-tasking capability.\n\nTo use I/O suspension, cooperation is needed between the calling application\nand the data source or destination manager; you will always need a custom\nsource/destination manager.  (Please read the previous section if you haven't\nalready.)  The basic idea is that the empty_output_buffer() or\nfill_input_buffer() routine is a no-op, merely returning FALSE to indicate\nthat it has done nothing.  Upon seeing this, the JPEG library suspends\noperation and returns to its caller.  The surrounding application is\nresponsible for emptying or refilling the work buffer before calling the\nJPEG library again.\n\nCompression suspension:\n\nFor compression suspension, use an empty_output_buffer() routine that returns\nFALSE; typically it will not do anything else.  This will cause the\ncompressor to return to the caller of jpeg_write_scanlines(), with the return\nvalue indicating that not all the supplied scanlines have been accepted.\nThe application must make more room in the output buffer, adjust the output\nbuffer pointer/count appropriately, and then call jpeg_write_scanlines()\nagain, pointing to the first unconsumed scanline.\n\nWhen forced to suspend, the compressor will backtrack to a convenient stopping\npoint (usually the start of the current MCU); it will regenerate some output\ndata when restarted.  Therefore, although empty_output_buffer() is only\ncalled when the buffer is filled, you should NOT write out the entire buffer\nafter a suspension.  Write only the data up to the current position of\nnext_output_byte/free_in_buffer.  The data beyond that point will be\nregenerated after resumption.\n\nBecause of the backtracking behavior, a good-size output buffer is essential\nfor efficiency; you don't want the compressor to suspend often.  (In fact, an\noverly small buffer could lead to infinite looping, if a single MCU required\nmore data than would fit in the buffer.)  We recommend a buffer of at least\nseveral Kbytes.  You may want to insert explicit code to ensure that you don't\ncall jpeg_write_scanlines() unless there is a reasonable amount of space in\nthe output buffer; in other words, flush the buffer before trying to compress\nmore data.\n\nThe compressor does not allow suspension while it is trying to write JPEG\nmarkers at the beginning and end of the file.  This means that:\n  * At the beginning of a compression operation, there must be enough free\n    space in the output buffer to hold the header markers (typically 600 or\n    so bytes).  The recommended buffer size is bigger than this anyway, so\n    this is not a problem as long as you start with an empty buffer.  However,\n    this restriction might catch you if you insert large special markers, such\n    as a JFIF thumbnail image, without flushing the buffer afterwards.\n  * When you call jpeg_finish_compress(), there must be enough space in the\n    output buffer to emit any buffered data and the final EOI marker.  In the\n    current implementation, half a dozen bytes should suffice for this, but\n    for safety's sake we recommend ensuring that at least 100 bytes are free\n    before calling jpeg_finish_compress().\n\nA more significant restriction is that jpeg_finish_compress() cannot suspend.\nThis means you cannot use suspension with multi-pass operating modes, namely\nHuffman code optimization and multiple-scan output.  Those modes write the\nwhole file during jpeg_finish_compress(), which will certainly result in\nbuffer overrun.  (Note that this restriction applies only to compression,\nnot decompression.  The decompressor supports input suspension in all of its\noperating modes.)\n\nDecompression suspension:\n\nFor decompression suspension, use a fill_input_buffer() routine that simply\nreturns FALSE (except perhaps during error recovery, as discussed below).\nThis will cause the decompressor to return to its caller with an indication\nthat suspension has occurred.  This can happen at four places:\n  * jpeg_read_header(): will return JPEG_SUSPENDED.\n  * jpeg_start_decompress(): will return FALSE, rather than its usual TRUE.\n  * jpeg_read_scanlines(): will return the number of scanlines already\n        completed (possibly 0).\n  * jpeg_finish_decompress(): will return FALSE, rather than its usual TRUE.\nThe surrounding application must recognize these cases, load more data into\nthe input buffer, and repeat the call.  In the case of jpeg_read_scanlines(),\nincrement the passed pointers past any scanlines successfully read.\n\nJust as with compression, the decompressor will typically backtrack to a\nconvenient restart point before suspending.  When fill_input_buffer() is\ncalled, next_input_byte/bytes_in_buffer point to the current restart point,\nwhich is where the decompressor will backtrack to if FALSE is returned.\nThe data beyond that position must NOT be discarded if you suspend; it needs\nto be re-read upon resumption.  In most implementations, you'll need to shift\nthis data down to the start of your work buffer and then load more data after\nit.  Again, this behavior means that a several-Kbyte work buffer is essential\nfor decent performance; furthermore, you should load a reasonable amount of\nnew data before resuming decompression.  (If you loaded, say, only one new\nbyte each time around, you could waste a LOT of cycles.)\n\nThe skip_input_data() source manager routine requires special care in a\nsuspension scenario.  This routine is NOT granted the ability to suspend the\ndecompressor; it can decrement bytes_in_buffer to zero, but no more.  If the\nrequested skip distance exceeds the amount of data currently in the input\nbuffer, then skip_input_data() must set bytes_in_buffer to zero and record the\nadditional skip distance somewhere else.  The decompressor will immediately\ncall fill_input_buffer(), which should return FALSE, which will cause a\nsuspension return.  The surrounding application must then arrange to discard\nthe recorded number of bytes before it resumes loading the input buffer.\n(Yes, this design is rather baroque, but it avoids complexity in the far more\ncommon case where a non-suspending source manager is used.)\n\nIf the input data has been exhausted, we recommend that you emit a warning\nand insert dummy EOI markers just as a non-suspending data source manager\nwould do.  This can be handled either in the surrounding application logic or\nwithin fill_input_buffer(); the latter is probably more efficient.  If\nfill_input_buffer() knows that no more data is available, it can set the\npointer/count to point to a dummy EOI marker and then return TRUE just as\nthough it had read more data in a non-suspending situation.\n\nThe decompressor does not attempt to suspend within standard JPEG markers;\ninstead it will backtrack to the start of the marker and reprocess the whole\nmarker next time.  Hence the input buffer must be large enough to hold the\nlongest standard marker in the file.  Standard JPEG markers should normally\nnot exceed a few hundred bytes each (DHT tables are typically the longest).\nWe recommend at least a 2K buffer for performance reasons, which is much\nlarger than any correct marker is likely to be.  For robustness against\ndamaged marker length counts, you may wish to insert a test in your\napplication for the case that the input buffer is completely full and yet\nthe decoder has suspended without consuming any data --- otherwise, if this\nsituation did occur, it would lead to an endless loop.  (The library can't\nprovide this test since it has no idea whether \"the buffer is full\", or\neven whether there is a fixed-size input buffer.)\n\nThe input buffer would need to be 64K to allow for arbitrary COM or APPn\nmarkers, but these are handled specially: they are either saved into allocated\nmemory, or skipped over by calling skip_input_data().  In the former case,\nsuspension is handled correctly, and in the latter case, the problem of\nbuffer overrun is placed on skip_input_data's shoulders, as explained above.\nNote that if you provide your own marker handling routine for large markers,\nyou should consider how to deal with buffer overflow.\n\nMultiple-buffer management:\n\nIn some applications it is desirable to store the compressed data in a linked\nlist of buffer areas, so as to avoid data copying.  This can be handled by\nhaving empty_output_buffer() or fill_input_buffer() set the pointer and count\nto reference the next available buffer; FALSE is returned only if no more\nbuffers are available.  Although seemingly straightforward, there is a\npitfall in this approach: the backtrack that occurs when FALSE is returned\ncould back up into an earlier buffer.  For example, when fill_input_buffer()\nis called, the current pointer & count indicate the backtrack restart point.\nSince fill_input_buffer() will set the pointer and count to refer to a new\nbuffer, the restart position must be saved somewhere else.  Suppose a second\ncall to fill_input_buffer() occurs in the same library call, and no\nadditional input data is available, so fill_input_buffer must return FALSE.\nIf the JPEG library has not moved the pointer/count forward in the current\nbuffer, then *the correct restart point is the saved position in the prior\nbuffer*.  Prior buffers may be discarded only after the library establishes\na restart point within a later buffer.  Similar remarks apply for output into\na chain of buffers.\n\nThe library will never attempt to backtrack over a skip_input_data() call,\nso any skipped data can be permanently discarded.  You still have to deal\nwith the case of skipping not-yet-received data, however.\n\nIt's much simpler to use only a single buffer; when fill_input_buffer() is\ncalled, move any unconsumed data (beyond the current pointer/count) down to\nthe beginning of this buffer and then load new data into the remaining buffer\nspace.  This approach requires a little more data copying but is far easier\nto get right.\n\n\nProgressive JPEG support\n------------------------\n\nProgressive JPEG rearranges the stored data into a series of scans of\nincreasing quality.  In situations where a JPEG file is transmitted across a\nslow communications link, a decoder can generate a low-quality image very\nquickly from the first scan, then gradually improve the displayed quality as\nmore scans are received.  The final image after all scans are complete is\nidentical to that of a regular (sequential) JPEG file of the same quality\nsetting.  Progressive JPEG files are often slightly smaller than equivalent\nsequential JPEG files, but the possibility of incremental display is the main\nreason for using progressive JPEG.\n\nThe IJG encoder library generates progressive JPEG files when given a\nsuitable \"scan script\" defining how to divide the data into scans.\nCreation of progressive JPEG files is otherwise transparent to the encoder.\nProgressive JPEG files can also be read transparently by the decoder library.\nIf the decoding application simply uses the library as defined above, it\nwill receive a final decoded image without any indication that the file was\nprogressive.  Of course, this approach does not allow incremental display.\nTo perform incremental display, an application needs to use the decoder\nlibrary's \"buffered-image\" mode, in which it receives a decoded image\nmultiple times.\n\nEach displayed scan requires about as much work to decode as a full JPEG\nimage of the same size, so the decoder must be fairly fast in relation to the\ndata transmission rate in order to make incremental display useful.  However,\nit is possible to skip displaying the image and simply add the incoming bits\nto the decoder's coefficient buffer.  This is fast because only Huffman\ndecoding need be done, not IDCT, upsampling, colorspace conversion, etc.\nThe IJG decoder library allows the application to switch dynamically between\ndisplaying the image and simply absorbing the incoming bits.  A properly\ncoded application can automatically adapt the number of display passes to\nsuit the time available as the image is received.  Also, a final\nhigher-quality display cycle can be performed from the buffered data after\nthe end of the file is reached.\n\nProgressive compression:\n\nTo create a progressive JPEG file (or a multiple-scan sequential JPEG file),\nset the scan_info cinfo field to point to an array of scan descriptors, and\nperform compression as usual.  Instead of constructing your own scan list,\nyou can call the jpeg_simple_progression() helper routine to create a\nrecommended progression sequence; this method should be used by all\napplications that don't want to get involved in the nitty-gritty of\nprogressive scan sequence design.  (If you want to provide user control of\nscan sequences, you may wish to borrow the scan script reading code found\nin rdswitch.c, so that you can read scan script files just like cjpeg's.)\nWhen scan_info is not NULL, the compression library will store DCT'd data\ninto a buffer array as jpeg_write_scanlines() is called, and will emit all\nthe requested scans during jpeg_finish_compress().  This implies that\nmultiple-scan output cannot be created with a suspending data destination\nmanager, since jpeg_finish_compress() does not support suspension.  We\nshould also note that the compressor currently forces Huffman optimization\nmode when creating a progressive JPEG file, because the default Huffman\ntables are unsuitable for progressive files.\n\nProgressive decompression:\n\nWhen buffered-image mode is not used, the decoder library will read all of\na multi-scan file during jpeg_start_decompress(), so that it can provide a\nfinal decoded image.  (Here \"multi-scan\" means either progressive or\nmulti-scan sequential.)  This makes multi-scan files transparent to the\ndecoding application.  However, existing applications that used suspending\ninput with version 5 of the IJG library will need to be modified to check\nfor a suspension return from jpeg_start_decompress().\n\nTo perform incremental display, an application must use the library's\nbuffered-image mode.  This is described in the next section.\n\n\nBuffered-image mode\n-------------------\n\nIn buffered-image mode, the library stores the partially decoded image in a\ncoefficient buffer, from which it can be read out as many times as desired.\nThis mode is typically used for incremental display of progressive JPEG files,\nbut it can be used with any JPEG file.  Each scan of a progressive JPEG file\nadds more data (more detail) to the buffered image.  The application can\ndisplay in lockstep with the source file (one display pass per input scan),\nor it can allow input processing to outrun display processing.  By making\ninput and display processing run independently, it is possible for the\napplication to adapt progressive display to a wide range of data transmission\nrates.\n\nThe basic control flow for buffered-image decoding is\n\n        jpeg_create_decompress()\n        set data source\n        jpeg_read_header()\n        set overall decompression parameters\n        cinfo.buffered_image = TRUE;    /* select buffered-image mode */\n        jpeg_start_decompress()\n        for (each output pass) {\n            adjust output decompression parameters if required\n            jpeg_start_output()         /* start a new output pass */\n            for (all scanlines in image) {\n                jpeg_read_scanlines()\n                display scanlines\n            }\n            jpeg_finish_output()        /* terminate output pass */\n        }\n        jpeg_finish_decompress()\n        jpeg_destroy_decompress()\n\nThis differs from ordinary unbuffered decoding in that there is an additional\nlevel of looping.  The application can choose how many output passes to make\nand how to display each pass.\n\nThe simplest approach to displaying progressive images is to do one display\npass for each scan appearing in the input file.  In this case the outer loop\ncondition is typically\n        while (! jpeg_input_complete(&cinfo))\nand the start-output call should read\n        jpeg_start_output(&cinfo, cinfo.input_scan_number);\nThe second parameter to jpeg_start_output() indicates which scan of the input\nfile is to be displayed; the scans are numbered starting at 1 for this\npurpose.  (You can use a loop counter starting at 1 if you like, but using\nthe library's input scan counter is easier.)  The library automatically reads\ndata as necessary to complete each requested scan, and jpeg_finish_output()\nadvances to the next scan or end-of-image marker (hence input_scan_number\nwill be incremented by the time control arrives back at jpeg_start_output()).\nWith this technique, data is read from the input file only as needed, and\ninput and output processing run in lockstep.\n\nAfter reading the final scan and reaching the end of the input file, the\nbuffered image remains available; it can be read additional times by\nrepeating the jpeg_start_output()/jpeg_read_scanlines()/jpeg_finish_output()\nsequence.  For example, a useful technique is to use fast one-pass color\nquantization for display passes made while the image is arriving, followed by\na final display pass using two-pass quantization for highest quality.  This\nis done by changing the library parameters before the final output pass.\nChanging parameters between passes is discussed in detail below.\n\nIn general the last scan of a progressive file cannot be recognized as such\nuntil after it is read, so a post-input display pass is the best approach if\nyou want special processing in the final pass.\n\nWhen done with the image, be sure to call jpeg_finish_decompress() to release\nthe buffered image (or just use jpeg_destroy_decompress()).\n\nIf input data arrives faster than it can be displayed, the application can\ncause the library to decode input data in advance of what's needed to produce\noutput.  This is done by calling the routine jpeg_consume_input().\nThe return value is one of the following:\n        JPEG_REACHED_SOS:    reached an SOS marker (the start of a new scan)\n        JPEG_REACHED_EOI:    reached the EOI marker (end of image)\n        JPEG_ROW_COMPLETED:  completed reading one MCU row of compressed data\n        JPEG_SCAN_COMPLETED: completed reading last MCU row of current scan\n        JPEG_SUSPENDED:      suspended before completing any of the above\n(JPEG_SUSPENDED can occur only if a suspending data source is used.)  This\nroutine can be called at any time after initializing the JPEG object.  It\nreads some additional data and returns when one of the indicated significant\nevents occurs.  (If called after the EOI marker is reached, it will\nimmediately return JPEG_REACHED_EOI without attempting to read more data.)\n\nThe library's output processing will automatically call jpeg_consume_input()\nwhenever the output processing overtakes the input; thus, simple lockstep\ndisplay requires no direct calls to jpeg_consume_input().  But by adding\ncalls to jpeg_consume_input(), you can absorb data in advance of what is\nbeing displayed.  This has two benefits:\n  * You can limit buildup of unprocessed data in your input buffer.\n  * You can eliminate extra display passes by paying attention to the\n    state of the library's input processing.\n\nThe first of these benefits only requires interspersing calls to\njpeg_consume_input() with your display operations and any other processing\nyou may be doing.  To avoid wasting cycles due to backtracking, it's best to\ncall jpeg_consume_input() only after a hundred or so new bytes have arrived.\nThis is discussed further under \"I/O suspension\", above.  (Note: the JPEG\nlibrary currently is not thread-safe.  You must not call jpeg_consume_input()\nfrom one thread of control if a different library routine is working on the\nsame JPEG object in another thread.)\n\nWhen input arrives fast enough that more than one new scan is available\nbefore you start a new output pass, you may as well skip the output pass\ncorresponding to the completed scan.  This occurs for free if you pass\ncinfo.input_scan_number as the target scan number to jpeg_start_output().\nThe input_scan_number field is simply the index of the scan currently being\nconsumed by the input processor.  You can ensure that this is up-to-date by\nemptying the input buffer just before calling jpeg_start_output(): call\njpeg_consume_input() repeatedly until it returns JPEG_SUSPENDED or\nJPEG_REACHED_EOI.\n\nThe target scan number passed to jpeg_start_output() is saved in the\ncinfo.output_scan_number field.  The library's output processing calls\njpeg_consume_input() whenever the current input scan number and row within\nthat scan is less than or equal to the current output scan number and row.\nThus, input processing can \"get ahead\" of the output processing but is not\nallowed to \"fall behind\".  You can achieve several different effects by\nmanipulating this interlock rule.  For example, if you pass a target scan\nnumber greater than the current input scan number, the output processor will\nwait until that scan starts to arrive before producing any output.  (To avoid\nan infinite loop, the target scan number is automatically reset to the last\nscan number when the end of image is reached.  Thus, if you specify a large\ntarget scan number, the library will just absorb the entire input file and\nthen perform an output pass.  This is effectively the same as what\njpeg_start_decompress() does when you don't select buffered-image mode.)\nWhen you pass a target scan number equal to the current input scan number,\nthe image is displayed no faster than the current input scan arrives.  The\nfinal possibility is to pass a target scan number less than the current input\nscan number; this disables the input/output interlock and causes the output\nprocessor to simply display whatever it finds in the image buffer, without\nwaiting for input.  (However, the library will not accept a target scan\nnumber less than one, so you can't avoid waiting for the first scan.)\n\nWhen data is arriving faster than the output display processing can advance\nthrough the image, jpeg_consume_input() will store data into the buffered\nimage beyond the point at which the output processing is reading data out\nagain.  If the input arrives fast enough, it may \"wrap around\" the buffer to\nthe point where the input is more than one whole scan ahead of the output.\nIf the output processing simply proceeds through its display pass without\npaying attention to the input, the effect seen on-screen is that the lower\npart of the image is one or more scans better in quality than the upper part.\nThen, when the next output scan is started, you have a choice of what target\nscan number to use.  The recommended choice is to use the current input scan\nnumber at that time, which implies that you've skipped the output scans\ncorresponding to the input scans that were completed while you processed the\nprevious output scan.  In this way, the decoder automatically adapts its\nspeed to the arriving data, by skipping output scans as necessary to keep up\nwith the arriving data.\n\nWhen using this strategy, you'll want to be sure that you perform a final\noutput pass after receiving all the data; otherwise your last display may not\nbe full quality across the whole screen.  So the right outer loop logic is\nsomething like this:\n        do {\n            absorb any waiting input by calling jpeg_consume_input()\n            final_pass = jpeg_input_complete(&cinfo);\n            adjust output decompression parameters if required\n            jpeg_start_output(&cinfo, cinfo.input_scan_number);\n            ...\n            jpeg_finish_output()\n        } while (! final_pass);\nrather than quitting as soon as jpeg_input_complete() returns TRUE.  This\narrangement makes it simple to use higher-quality decoding parameters\nfor the final pass.  But if you don't want to use special parameters for\nthe final pass, the right loop logic is like this:\n        for (;;) {\n            absorb any waiting input by calling jpeg_consume_input()\n            jpeg_start_output(&cinfo, cinfo.input_scan_number);\n            ...\n            jpeg_finish_output()\n            if (jpeg_input_complete(&cinfo) &&\n                cinfo.input_scan_number == cinfo.output_scan_number)\n              break;\n        }\nIn this case you don't need to know in advance whether an output pass is to\nbe the last one, so it's not necessary to have reached EOF before starting\nthe final output pass; rather, what you want to test is whether the output\npass was performed in sync with the final input scan.  This form of the loop\nwill avoid an extra output pass whenever the decoder is able (or nearly able)\nto keep up with the incoming data.\n\nWhen the data transmission speed is high, you might begin a display pass,\nthen find that much or all of the file has arrived before you can complete\nthe pass.  (You can detect this by noting the JPEG_REACHED_EOI return code\nfrom jpeg_consume_input(), or equivalently by testing jpeg_input_complete().)\nIn this situation you may wish to abort the current display pass and start a\nnew one using the newly arrived information.  To do so, just call\njpeg_finish_output() and then start a new pass with jpeg_start_output().\n\nA variant strategy is to abort and restart display if more than one complete\nscan arrives during an output pass; this can be detected by noting\nJPEG_REACHED_SOS returns and/or examining cinfo.input_scan_number.  This\nidea should be employed with caution, however, since the display process\nmight never get to the bottom of the image before being aborted, resulting\nin the lower part of the screen being several passes worse than the upper.\nIn most cases it's probably best to abort an output pass only if the whole\nfile has arrived and you want to begin the final output pass immediately.\n\nWhen receiving data across a communication link, we recommend always using\nthe current input scan number for the output target scan number; if a\nhigher-quality final pass is to be done, it should be started (aborting any\nincomplete output pass) as soon as the end of file is received.  However,\nmany other strategies are possible.  For example, the application can examine\nthe parameters of the current input scan and decide whether to display it or\nnot.  If the scan contains only chroma data, one might choose not to use it\nas the target scan, expecting that the scan will be small and will arrive\nquickly.  To skip to the next scan, call jpeg_consume_input() until it\nreturns JPEG_REACHED_SOS or JPEG_REACHED_EOI.  Or just use the next higher\nnumber as the target scan for jpeg_start_output(); but that method doesn't\nlet you inspect the next scan's parameters before deciding to display it.\n\n\nIn buffered-image mode, jpeg_start_decompress() never performs input and\nthus never suspends.  An application that uses input suspension with\nbuffered-image mode must be prepared for suspension returns from these\nroutines:\n* jpeg_start_output() performs input only if you request 2-pass quantization\n  and the target scan isn't fully read yet.  (This is discussed below.)\n* jpeg_read_scanlines(), as always, returns the number of scanlines that it\n  was able to produce before suspending.\n* jpeg_finish_output() will read any markers following the target scan,\n  up to the end of the file or the SOS marker that begins another scan.\n  (But it reads no input if jpeg_consume_input() has already reached the\n  end of the file or a SOS marker beyond the target output scan.)\n* jpeg_finish_decompress() will read until the end of file, and thus can\n  suspend if the end hasn't already been reached (as can be tested by\n  calling jpeg_input_complete()).\njpeg_start_output(), jpeg_finish_output(), and jpeg_finish_decompress()\nall return TRUE if they completed their tasks, FALSE if they had to suspend.\nIn the event of a FALSE return, the application must load more input data\nand repeat the call.  Applications that use non-suspending data sources need\nnot check the return values of these three routines.\n\n\nIt is possible to change decoding parameters between output passes in the\nbuffered-image mode.  The decoder library currently supports only very\nlimited changes of parameters.  ONLY THE FOLLOWING parameter changes are\nallowed after jpeg_start_decompress() is called:\n* dct_method can be changed before each call to jpeg_start_output().\n  For example, one could use a fast DCT method for early scans, changing\n  to a higher quality method for the final scan.\n* dither_mode can be changed before each call to jpeg_start_output();\n  of course this has no impact if not using color quantization.  Typically\n  one would use ordered dither for initial passes, then switch to\n  Floyd-Steinberg dither for the final pass.  Caution: changing dither mode\n  can cause more memory to be allocated by the library.  Although the amount\n  of memory involved is not large (a scanline or so), it may cause the\n  initial max_memory_to_use specification to be exceeded, which in the worst\n  case would result in an out-of-memory failure.\n* do_block_smoothing can be changed before each call to jpeg_start_output().\n  This setting is relevant only when decoding a progressive JPEG image.\n  During the first DC-only scan, block smoothing provides a very \"fuzzy\" look\n  instead of the very \"blocky\" look seen without it; which is better seems a\n  matter of personal taste.  But block smoothing is nearly always a win\n  during later stages, especially when decoding a successive-approximation\n  image: smoothing helps to hide the slight blockiness that otherwise shows\n  up on smooth gradients until the lowest coefficient bits are sent.\n* Color quantization mode can be changed under the rules described below.\n  You *cannot* change between full-color and quantized output (because that\n  would alter the required I/O buffer sizes), but you can change which\n  quantization method is used.\n\nWhen generating color-quantized output, changing quantization method is a\nvery useful way of switching between high-speed and high-quality display.\nThe library allows you to change among its three quantization methods:\n1. Single-pass quantization to a fixed color cube.\n   Selected by cinfo.two_pass_quantize = FALSE and cinfo.colormap = NULL.\n2. Single-pass quantization to an application-supplied colormap.\n   Selected by setting cinfo.colormap to point to the colormap (the value of\n   two_pass_quantize is ignored); also set cinfo.actual_number_of_colors.\n3. Two-pass quantization to a colormap chosen specifically for the image.\n   Selected by cinfo.two_pass_quantize = TRUE and cinfo.colormap = NULL.\n   (This is the default setting selected by jpeg_read_header, but it is\n   probably NOT what you want for the first pass of progressive display!)\nThese methods offer successively better quality and lesser speed.  However,\nonly the first method is available for quantizing in non-RGB color spaces.\n\nIMPORTANT: because the different quantizer methods have very different\nworking-storage requirements, the library requires you to indicate which\none(s) you intend to use before you call jpeg_start_decompress().  (If we did\nnot require this, the max_memory_to_use setting would be a complete fiction.)\nYou do this by setting one or more of these three cinfo fields to TRUE:\n        enable_1pass_quant              Fixed color cube colormap\n        enable_external_quant           Externally-supplied colormap\n        enable_2pass_quant              Two-pass custom colormap\nAll three are initialized FALSE by jpeg_read_header().  But\njpeg_start_decompress() automatically sets TRUE the one selected by the\ncurrent two_pass_quantize and colormap settings, so you only need to set the\nenable flags for any other quantization methods you plan to change to later.\n\nAfter setting the enable flags correctly at jpeg_start_decompress() time, you\ncan change to any enabled quantization method by setting two_pass_quantize\nand colormap properly just before calling jpeg_start_output().  The following\nspecial rules apply:\n1. You must explicitly set cinfo.colormap to NULL when switching to 1-pass\n   or 2-pass mode from a different mode, or when you want the 2-pass\n   quantizer to be re-run to generate a new colormap.\n2. To switch to an external colormap, or to change to a different external\n   colormap than was used on the prior pass, you must call\n   jpeg_new_colormap() after setting cinfo.colormap.\nNOTE: if you want to use the same colormap as was used in the prior pass,\nyou should not do either of these things.  This will save some nontrivial\nswitchover costs.\n(These requirements exist because cinfo.colormap will always be non-NULL\nafter completing a prior output pass, since both the 1-pass and 2-pass\nquantizers set it to point to their output colormaps.  Thus you have to\ndo one of these two things to notify the library that something has changed.\nYup, it's a bit klugy, but it's necessary to do it this way for backwards\ncompatibility.)\n\nNote that in buffered-image mode, the library generates any requested colormap\nduring jpeg_start_output(), not during jpeg_start_decompress().\n\nWhen using two-pass quantization, jpeg_start_output() makes a pass over the\nbuffered image to determine the optimum color map; it therefore may take a\nsignificant amount of time, whereas ordinarily it does little work.  The\nprogress monitor hook is called during this pass, if defined.  It is also\nimportant to realize that if the specified target scan number is greater than\nor equal to the current input scan number, jpeg_start_output() will attempt\nto consume input as it makes this pass.  If you use a suspending data source,\nyou need to check for a FALSE return from jpeg_start_output() under these\nconditions.  The combination of 2-pass quantization and a not-yet-fully-read\ntarget scan is the only case in which jpeg_start_output() will consume input.\n\n\nApplication authors who support buffered-image mode may be tempted to use it\nfor all JPEG images, even single-scan ones.  This will work, but it is\ninefficient: there is no need to create an image-sized coefficient buffer for\nsingle-scan images.  Requesting buffered-image mode for such an image wastes\nmemory.  Worse, it can cost time on large images, since the buffered data has\nto be swapped out or written to a temporary file.  If you are concerned about\nmaximum performance on baseline JPEG files, you should use buffered-image\nmode only when the incoming file actually has multiple scans.  This can be\ntested by calling jpeg_has_multiple_scans(), which will return a correct\nresult at any time after jpeg_read_header() completes.\n\nIt is also worth noting that when you use jpeg_consume_input() to let input\nprocessing get ahead of output processing, the resulting pattern of access to\nthe coefficient buffer is quite nonsequential.  It's best to use the memory\nmanager jmemnobs.c if you can (ie, if you have enough real or virtual main\nmemory).  If not, at least make sure that max_memory_to_use is set as high as\npossible.  If the JPEG memory manager has to use a temporary file, you will\nprobably see a lot of disk traffic and poor performance.  (This could be\nimproved with additional work on the memory manager, but we haven't gotten\naround to it yet.)\n\nIn some applications it may be convenient to use jpeg_consume_input() for all\ninput processing, including reading the initial markers; that is, you may\nwish to call jpeg_consume_input() instead of jpeg_read_header() during\nstartup.  This works, but note that you must check for JPEG_REACHED_SOS and\nJPEG_REACHED_EOI return codes as the equivalent of jpeg_read_header's codes.\nOnce the first SOS marker has been reached, you must call\njpeg_start_decompress() before jpeg_consume_input() will consume more input;\nit'll just keep returning JPEG_REACHED_SOS until you do.  If you read a\ntables-only file this way, jpeg_consume_input() will return JPEG_REACHED_EOI\nwithout ever returning JPEG_REACHED_SOS; be sure to check for this case.\nIf this happens, the decompressor will not read any more input until you call\njpeg_abort() to reset it.  It is OK to call jpeg_consume_input() even when not\nusing buffered-image mode, but in that case it's basically a no-op after the\ninitial markers have been read: it will just return JPEG_SUSPENDED.\n\n\nAbbreviated datastreams and multiple images\n-------------------------------------------\n\nA JPEG compression or decompression object can be reused to process multiple\nimages.  This saves a small amount of time per image by eliminating the\n\"create\" and \"destroy\" operations, but that isn't the real purpose of the\nfeature.  Rather, reuse of an object provides support for abbreviated JPEG\ndatastreams.  Object reuse can also simplify processing a series of images in\na single input or output file.  This section explains these features.\n\nA JPEG file normally contains several hundred bytes worth of quantization\nand Huffman tables.  In a situation where many images will be stored or\ntransmitted with identical tables, this may represent an annoying overhead.\nThe JPEG standard therefore permits tables to be omitted.  The standard\ndefines three classes of JPEG datastreams:\n  * \"Interchange\" datastreams contain an image and all tables needed to decode\n     the image.  These are the usual kind of JPEG file.\n  * \"Abbreviated image\" datastreams contain an image, but are missing some or\n    all of the tables needed to decode that image.\n  * \"Abbreviated table specification\" (henceforth \"tables-only\") datastreams\n    contain only table specifications.\nTo decode an abbreviated image, it is necessary to load the missing table(s)\ninto the decoder beforehand.  This can be accomplished by reading a separate\ntables-only file.  A variant scheme uses a series of images in which the first\nimage is an interchange (complete) datastream, while subsequent ones are\nabbreviated and rely on the tables loaded by the first image.  It is assumed\nthat once the decoder has read a table, it will remember that table until a\nnew definition for the same table number is encountered.\n\nIt is the application designer's responsibility to figure out how to associate\nthe correct tables with an abbreviated image.  While abbreviated datastreams\ncan be useful in a closed environment, their use is strongly discouraged in\nany situation where data exchange with other applications might be needed.\nCaveat designer.\n\nThe JPEG library provides support for reading and writing any combination of\ntables-only datastreams and abbreviated images.  In both compression and\ndecompression objects, a quantization or Huffman table will be retained for\nthe lifetime of the object, unless it is overwritten by a new table definition.\n\n\nTo create abbreviated image datastreams, it is only necessary to tell the\ncompressor not to emit some or all of the tables it is using.  Each\nquantization and Huffman table struct contains a boolean field \"sent_table\",\nwhich normally is initialized to FALSE.  For each table used by the image, the\nheader-writing process emits the table and sets sent_table = TRUE unless it is\nalready TRUE.  (In normal usage, this prevents outputting the same table\ndefinition multiple times, as would otherwise occur because the chroma\ncomponents typically share tables.)  Thus, setting this field to TRUE before\ncalling jpeg_start_compress() will prevent the table from being written at\nall.\n\nIf you want to create a \"pure\" abbreviated image file containing no tables,\njust call \"jpeg_suppress_tables(&cinfo, TRUE)\" after constructing all the\ntables.  If you want to emit some but not all tables, you'll need to set the\nindividual sent_table fields directly.\n\nTo create an abbreviated image, you must also call jpeg_start_compress()\nwith a second parameter of FALSE, not TRUE.  Otherwise jpeg_start_compress()\nwill force all the sent_table fields to FALSE.  (This is a safety feature to\nprevent abbreviated images from being created accidentally.)\n\nTo create a tables-only file, perform the same parameter setup that you\nnormally would, but instead of calling jpeg_start_compress() and so on, call\njpeg_write_tables(&cinfo).  This will write an abbreviated datastream\ncontaining only SOI, DQT and/or DHT markers, and EOI.  All the quantization\nand Huffman tables that are currently defined in the compression object will\nbe emitted unless their sent_tables flag is already TRUE, and then all the\nsent_tables flags will be set TRUE.\n\nA sure-fire way to create matching tables-only and abbreviated image files\nis to proceed as follows:\n\n        create JPEG compression object\n        set JPEG parameters\n        set destination to tables-only file\n        jpeg_write_tables(&cinfo);\n        set destination to image file\n        jpeg_start_compress(&cinfo, FALSE);\n        write data...\n        jpeg_finish_compress(&cinfo);\n\nSince the JPEG parameters are not altered between writing the table file and\nthe abbreviated image file, the same tables are sure to be used.  Of course,\nyou can repeat the jpeg_start_compress() ... jpeg_finish_compress() sequence\nmany times to produce many abbreviated image files matching the table file.\n\nYou cannot suppress output of the computed Huffman tables when Huffman\noptimization is selected.  (If you could, there'd be no way to decode the\nimage...)  Generally, you don't want to set optimize_coding = TRUE when\nyou are trying to produce abbreviated files.\n\nIn some cases you might want to compress an image using tables which are\nnot stored in the application, but are defined in an interchange or\ntables-only file readable by the application.  This can be done by setting up\na JPEG decompression object to read the specification file, then copying the\ntables into your compression object.  See jpeg_copy_critical_parameters()\nfor an example of copying quantization tables.\n\n\nTo read abbreviated image files, you simply need to load the proper tables\ninto the decompression object before trying to read the abbreviated image.\nIf the proper tables are stored in the application program, you can just\nallocate the table structs and fill in their contents directly.  For example,\nto load a fixed quantization table into table slot \"n\":\n\n    if (cinfo.quant_tbl_ptrs[n] == NULL)\n      cinfo.quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) &cinfo);\n    quant_ptr = cinfo.quant_tbl_ptrs[n];        /* quant_ptr is JQUANT_TBL* */\n    for (i = 0; i < 64; i++) {\n      /* Qtable[] is desired quantization table, in natural array order */\n      quant_ptr->quantval[i] = Qtable[i];\n    }\n\nCode to load a fixed Huffman table is typically (for AC table \"n\"):\n\n    if (cinfo.ac_huff_tbl_ptrs[n] == NULL)\n      cinfo.ac_huff_tbl_ptrs[n] = jpeg_alloc_huff_table((j_common_ptr) &cinfo);\n    huff_ptr = cinfo.ac_huff_tbl_ptrs[n];       /* huff_ptr is JHUFF_TBL* */\n    for (i = 1; i <= 16; i++) {\n      /* counts[i] is number of Huffman codes of length i bits, i=1..16 */\n      huff_ptr->bits[i] = counts[i];\n    }\n    for (i = 0; i < 256; i++) {\n      /* symbols[] is the list of Huffman symbols, in code-length order */\n      huff_ptr->huffval[i] = symbols[i];\n    }\n\n(Note that trying to set cinfo.quant_tbl_ptrs[n] to point directly at a\nconstant JQUANT_TBL object is not safe.  If the incoming file happened to\ncontain a quantization table definition, your master table would get\noverwritten!  Instead allocate a working table copy and copy the master table\ninto it, as illustrated above.  Ditto for Huffman tables, of course.)\n\nYou might want to read the tables from a tables-only file, rather than\nhard-wiring them into your application.  The jpeg_read_header() call is\nsufficient to read a tables-only file.  You must pass a second parameter of\nFALSE to indicate that you do not require an image to be present.  Thus, the\ntypical scenario is\n\n        create JPEG decompression object\n        set source to tables-only file\n        jpeg_read_header(&cinfo, FALSE);\n        set source to abbreviated image file\n        jpeg_read_header(&cinfo, TRUE);\n        set decompression parameters\n        jpeg_start_decompress(&cinfo);\n        read data...\n        jpeg_finish_decompress(&cinfo);\n\nIn some cases, you may want to read a file without knowing whether it contains\nan image or just tables.  In that case, pass FALSE and check the return value\nfrom jpeg_read_header(): it will be JPEG_HEADER_OK if an image was found,\nJPEG_HEADER_TABLES_ONLY if only tables were found.  (A third return value,\nJPEG_SUSPENDED, is possible when using a suspending data source manager.)\nNote that jpeg_read_header() will not complain if you read an abbreviated\nimage for which you haven't loaded the missing tables; the missing-table check\noccurs later, in jpeg_start_decompress().\n\n\nIt is possible to read a series of images from a single source file by\nrepeating the jpeg_read_header() ... jpeg_finish_decompress() sequence,\nwithout releasing/recreating the JPEG object or the data source module.\n(If you did reinitialize, any partial bufferload left in the data source\nbuffer at the end of one image would be discarded, causing you to lose the\nstart of the next image.)  When you use this method, stored tables are\nautomatically carried forward, so some of the images can be abbreviated images\nthat depend on tables from earlier images.\n\nIf you intend to write a series of images into a single destination file,\nyou might want to make a specialized data destination module that doesn't\nflush the output buffer at term_destination() time.  This would speed things\nup by some trifling amount.  Of course, you'd need to remember to flush the\nbuffer after the last image.  You can make the later images be abbreviated\nones by passing FALSE to jpeg_start_compress().\n\n\nSpecial markers\n---------------\n\nSome applications may need to insert or extract special data in the JPEG\ndatastream.  The JPEG standard provides marker types \"COM\" (comment) and\n\"APP0\" through \"APP15\" (application) to hold application-specific data.\nUnfortunately, the use of these markers is not specified by the standard.\nCOM markers are fairly widely used to hold user-supplied text.  The JFIF file\nformat spec uses APP0 markers with specified initial strings to hold certain\ndata.  Adobe applications use APP14 markers beginning with the string \"Adobe\"\nfor miscellaneous data.  Other APPn markers are rarely seen, but might\ncontain almost anything.\n\nIf you wish to store user-supplied text, we recommend you use COM markers\nand place readable 7-bit ASCII text in them.  Newline conventions are not\nstandardized --- expect to find LF (Unix style), CR/LF (DOS style), or CR\n(Mac style).  A robust COM reader should be able to cope with random binary\ngarbage, including nulls, since some applications generate COM markers\ncontaining non-ASCII junk.  (But yours should not be one of them.)\n\nFor program-supplied data, use an APPn marker, and be sure to begin it with an\nidentifying string so that you can tell whether the marker is actually yours.\nIt's probably best to avoid using APP0 or APP14 for any private markers.\n(NOTE: the upcoming SPIFF standard will use APP8 markers; we recommend you\nnot use APP8 markers for any private purposes, either.)\n\nKeep in mind that at most 65533 bytes can be put into one marker, but you\ncan have as many markers as you like.\n\nBy default, the IJG compression library will write a JFIF APP0 marker if the\nselected JPEG colorspace is grayscale or YCbCr, or an Adobe APP14 marker if\nthe selected colorspace is RGB, CMYK, or YCCK.  You can disable this, but\nwe don't recommend it.  The decompression library will recognize JFIF and\nAdobe markers and will set the JPEG colorspace properly when one is found.\n\n\nYou can write special markers immediately following the datastream header by\ncalling jpeg_write_marker() after jpeg_start_compress() and before the first\ncall to jpeg_write_scanlines().  When you do this, the markers appear after\nthe SOI and the JFIF APP0 and Adobe APP14 markers (if written), but before\nall else.  Specify the marker type parameter as \"JPEG_COM\" for COM or\n\"JPEG_APP0 + n\" for APPn.  (Actually, jpeg_write_marker will let you write\nany marker type, but we don't recommend writing any other kinds of marker.)\nFor example, to write a user comment string pointed to by comment_text:\n        jpeg_write_marker(cinfo, JPEG_COM, comment_text, strlen(comment_text));\n\nIf it's not convenient to store all the marker data in memory at once,\nyou can instead call jpeg_write_m_header() followed by multiple calls to\njpeg_write_m_byte().  If you do it this way, it's your responsibility to\ncall jpeg_write_m_byte() exactly the number of times given in the length\nparameter to jpeg_write_m_header().  (This method lets you empty the\noutput buffer partway through a marker, which might be important when\nusing a suspending data destination module.  In any case, if you are using\na suspending destination, you should flush its buffer after inserting\nany special markers.  See \"I/O suspension\".)\n\nOr, if you prefer to synthesize the marker byte sequence yourself,\nyou can just cram it straight into the data destination module.\n\nIf you are writing JFIF 1.02 extension markers (thumbnail images), don't\nforget to set cinfo.JFIF_minor_version = 2 so that the encoder will write the\ncorrect JFIF version number in the JFIF header marker.  The library's default\nis to write version 1.01, but that's wrong if you insert any 1.02 extension\nmarkers.  (We could probably get away with just defaulting to 1.02, but there\nused to be broken decoders that would complain about unknown minor version\nnumbers.  To reduce compatibility risks it's safest not to write 1.02 unless\nyou are actually using 1.02 extensions.)\n\n\nWhen reading, two methods of handling special markers are available:\n1. You can ask the library to save the contents of COM and/or APPn markers\ninto memory, and then examine them at your leisure afterwards.\n2. You can supply your own routine to process COM and/or APPn markers\non-the-fly as they are read.\nThe first method is simpler to use, especially if you are using a suspending\ndata source; writing a marker processor that copes with input suspension is\nnot easy (consider what happens if the marker is longer than your available\ninput buffer).  However, the second method conserves memory since the marker\ndata need not be kept around after it's been processed.\n\nFor either method, you'd normally set up marker handling after creating a\ndecompression object and before calling jpeg_read_header(), because the\nmarkers of interest will typically be near the head of the file and so will\nbe scanned by jpeg_read_header.  Once you've established a marker handling\nmethod, it will be used for the life of that decompression object\n(potentially many datastreams), unless you change it.  Marker handling is\ndetermined separately for COM markers and for each APPn marker code.\n\n\nTo save the contents of special markers in memory, call\n        jpeg_save_markers(cinfo, marker_code, length_limit)\nwhere marker_code is the marker type to save, JPEG_COM or JPEG_APP0+n.\n(To arrange to save all the special marker types, you need to call this\nroutine 17 times, for COM and APP0-APP15.)  If the incoming marker is longer\nthan length_limit data bytes, only length_limit bytes will be saved; this\nparameter allows you to avoid chewing up memory when you only need to see the\nfirst few bytes of a potentially large marker.  If you want to save all the\ndata, set length_limit to 0xFFFF; that is enough since marker lengths are only\n16 bits.  As a special case, setting length_limit to 0 prevents that marker\ntype from being saved at all.  (That is the default behavior, in fact.)\n\nAfter jpeg_read_header() completes, you can examine the special markers by\nfollowing the cinfo->marker_list pointer chain.  All the special markers in\nthe file appear in this list, in order of their occurrence in the file (but\nomitting any markers of types you didn't ask for).  Both the original data\nlength and the saved data length are recorded for each list entry; the latter\nwill not exceed length_limit for the particular marker type.  Note that these\nlengths exclude the marker length word, whereas the stored representation\nwithin the JPEG file includes it.  (Hence the maximum data length is really\nonly 65533.)\n\nIt is possible that additional special markers appear in the file beyond the\nSOS marker at which jpeg_read_header stops; if so, the marker list will be\nextended during reading of the rest of the file.  This is not expected to be\ncommon, however.  If you are short on memory you may want to reset the length\nlimit to zero for all marker types after finishing jpeg_read_header, to\nensure that the max_memory_to_use setting cannot be exceeded due to addition\nof later markers.\n\nThe marker list remains stored until you call jpeg_finish_decompress or\njpeg_abort, at which point the memory is freed and the list is set to empty.\n(jpeg_destroy also releases the storage, of course.)\n\nNote that the library is internally interested in APP0 and APP14 markers;\nif you try to set a small nonzero length limit on these types, the library\nwill silently force the length up to the minimum it wants.  (But you can set\na zero length limit to prevent them from being saved at all.)  Also, in a\n16-bit environment, the maximum length limit may be constrained to less than\n65533 by malloc() limitations.  It is therefore best not to assume that the\neffective length limit is exactly what you set it to be.\n\n\nIf you want to supply your own marker-reading routine, you do it by calling\njpeg_set_marker_processor().  A marker processor routine must have the\nsignature\n        boolean jpeg_marker_parser_method (j_decompress_ptr cinfo)\nAlthough the marker code is not explicitly passed, the routine can find it\nin cinfo->unread_marker.  At the time of call, the marker proper has been\nread from the data source module.  The processor routine is responsible for\nreading the marker length word and the remaining parameter bytes, if any.\nReturn TRUE to indicate success.  (FALSE should be returned only if you are\nusing a suspending data source and it tells you to suspend.  See the standard\nmarker processors in jdmarker.c for appropriate coding methods if you need to\nuse a suspending data source.)\n\nIf you override the default APP0 or APP14 processors, it is up to you to\nrecognize JFIF and Adobe markers if you want colorspace recognition to occur\nproperly.  We recommend copying and extending the default processors if you\nwant to do that.  (A better idea is to save these marker types for later\nexamination by calling jpeg_save_markers(); that method doesn't interfere\nwith the library's own processing of these markers.)\n\njpeg_set_marker_processor() and jpeg_save_markers() are mutually exclusive\n--- if you call one it overrides any previous call to the other, for the\nparticular marker type specified.\n\nA simple example of an external COM processor can be found in djpeg.c.\nAlso, see jpegtran.c for an example of using jpeg_save_markers.\n\n\nRaw (downsampled) image data\n----------------------------\n\nSome applications need to supply already-downsampled image data to the JPEG\ncompressor, or to receive raw downsampled data from the decompressor.  The\nlibrary supports this requirement by allowing the application to write or\nread raw data, bypassing the normal preprocessing or postprocessing steps.\nThe interface is different from the standard one and is somewhat harder to\nuse.  If your interest is merely in bypassing color conversion, we recommend\nthat you use the standard interface and simply set jpeg_color_space =\nin_color_space (or jpeg_color_space = out_color_space for decompression).\nThe mechanism described in this section is necessary only to supply or\nreceive downsampled image data, in which not all components have the same\ndimensions.\n\n\nTo compress raw data, you must supply the data in the colorspace to be used\nin the JPEG file (please read the earlier section on Special color spaces)\nand downsampled to the sampling factors specified in the JPEG parameters.\nYou must supply the data in the format used internally by the JPEG library,\nnamely a JSAMPIMAGE array.  This is an array of pointers to two-dimensional\narrays, each of type JSAMPARRAY.  Each 2-D array holds the values for one\ncolor component.  This structure is necessary since the components are of\ndifferent sizes.  If the image dimensions are not a multiple of the MCU size,\nyou must also pad the data correctly (usually, this is done by replicating\nthe last column and/or row).  The data must be padded to a multiple of a DCT\nblock in each component: that is, each downsampled row must contain a\nmultiple of 8 valid samples, and there must be a multiple of 8 sample rows\nfor each component.  (For applications such as conversion of digital TV\nimages, the standard image size is usually a multiple of the DCT block size,\nso that no padding need actually be done.)\n\nThe procedure for compression of raw data is basically the same as normal\ncompression, except that you call jpeg_write_raw_data() in place of\njpeg_write_scanlines().  Before calling jpeg_start_compress(), you must do\nthe following:\n  * Set cinfo->raw_data_in to TRUE.  (It is set FALSE by jpeg_set_defaults().)\n    This notifies the library that you will be supplying raw data.\n  * Ensure jpeg_color_space is correct --- an explicit jpeg_set_colorspace()\n    call is a good idea.  Note that since color conversion is bypassed,\n    in_color_space is ignored, except that jpeg_set_defaults() uses it to\n    choose the default jpeg_color_space setting.\n  * Ensure the sampling factors, cinfo->comp_info[i].h_samp_factor and\n    cinfo->comp_info[i].v_samp_factor, are correct.  Since these indicate the\n    dimensions of the data you are supplying, it's wise to set them\n    explicitly, rather than assuming the library's defaults are what you want.\n\nTo pass raw data to the library, call jpeg_write_raw_data() in place of\njpeg_write_scanlines().  The two routines work similarly except that\njpeg_write_raw_data takes a JSAMPIMAGE data array rather than JSAMPARRAY.\nThe scanlines count passed to and returned from jpeg_write_raw_data is\nmeasured in terms of the component with the largest v_samp_factor.\n\njpeg_write_raw_data() processes one MCU row per call, which is to say\nv_samp_factor*DCTSIZE sample rows of each component.  The passed num_lines\nvalue must be at least max_v_samp_factor*DCTSIZE, and the return value will\nbe exactly that amount (or possibly some multiple of that amount, in future\nlibrary versions).  This is true even on the last call at the bottom of the\nimage; don't forget to pad your data as necessary.\n\nThe required dimensions of the supplied data can be computed for each\ncomponent as\n        cinfo->comp_info[i].width_in_blocks*DCTSIZE  samples per row\n        cinfo->comp_info[i].height_in_blocks*DCTSIZE rows in image\nafter jpeg_start_compress() has initialized those fields.  If the valid data\nis smaller than this, it must be padded appropriately.  For some sampling\nfactors and image sizes, additional dummy DCT blocks are inserted to make\nthe image a multiple of the MCU dimensions.  The library creates such dummy\nblocks itself; it does not read them from your supplied data.  Therefore you\nneed never pad by more than DCTSIZE samples.  An example may help here.\nAssume 2h2v downsampling of YCbCr data, that is\n        cinfo->comp_info[0].h_samp_factor = 2           for Y\n        cinfo->comp_info[0].v_samp_factor = 2\n        cinfo->comp_info[1].h_samp_factor = 1           for Cb\n        cinfo->comp_info[1].v_samp_factor = 1\n        cinfo->comp_info[2].h_samp_factor = 1           for Cr\n        cinfo->comp_info[2].v_samp_factor = 1\nand suppose that the nominal image dimensions (cinfo->image_width and\ncinfo->image_height) are 101x101 pixels.  Then jpeg_start_compress() will\ncompute downsampled_width = 101 and width_in_blocks = 13 for Y,\ndownsampled_width = 51 and width_in_blocks = 7 for Cb and Cr (and the same\nfor the height fields).  You must pad the Y data to at least 13*8 = 104\ncolumns and rows, the Cb/Cr data to at least 7*8 = 56 columns and rows.  The\nMCU height is max_v_samp_factor = 2 DCT rows so you must pass at least 16\nscanlines on each call to jpeg_write_raw_data(), which is to say 16 actual\nsample rows of Y and 8 each of Cb and Cr.  A total of 7 MCU rows are needed,\nso you must pass a total of 7*16 = 112 \"scanlines\".  The last DCT block row\nof Y data is dummy, so it doesn't matter what you pass for it in the data\narrays, but the scanlines count must total up to 112 so that all of the Cb\nand Cr data gets passed.\n\nOutput suspension is supported with raw-data compression: if the data\ndestination module suspends, jpeg_write_raw_data() will return 0.\nIn this case the same data rows must be passed again on the next call.\n\n\nDecompression with raw data output implies bypassing all postprocessing:\nyou cannot ask for rescaling or color quantization, for instance.  More\nseriously, you must deal with the color space and sampling factors present in\nthe incoming file.  If your application only handles, say, 2h1v YCbCr data,\nyou must check for and fail on other color spaces or other sampling factors.\nThe library will not convert to a different color space for you.\n\nTo obtain raw data output, set cinfo->raw_data_out = TRUE before\njpeg_start_decompress() (it is set FALSE by jpeg_read_header()).  Be sure to\nverify that the color space and sampling factors are ones you can handle.\nThen call jpeg_read_raw_data() in place of jpeg_read_scanlines().  The\ndecompression process is otherwise the same as usual.\n\njpeg_read_raw_data() returns one MCU row per call, and thus you must pass a\nbuffer of at least max_v_samp_factor*DCTSIZE scanlines (scanline counting is\nthe same as for raw-data compression).  The buffer you pass must be large\nenough to hold the actual data plus padding to DCT-block boundaries.  As with\ncompression, any entirely dummy DCT blocks are not processed so you need not\nallocate space for them, but the total scanline count includes them.  The\nabove example of computing buffer dimensions for raw-data compression is\nequally valid for decompression.\n\nInput suspension is supported with raw-data decompression: if the data source\nmodule suspends, jpeg_read_raw_data() will return 0.  You can also use\nbuffered-image mode to read raw data in multiple passes.\n\n\nReally raw data: DCT coefficients\n---------------------------------\n\nIt is possible to read or write the contents of a JPEG file as raw DCT\ncoefficients.  This facility is mainly intended for use in lossless\ntranscoding between different JPEG file formats.  Other possible applications\ninclude lossless cropping of a JPEG image, lossless reassembly of a\nmulti-strip or multi-tile TIFF/JPEG file into a single JPEG datastream, etc.\n\nTo read the contents of a JPEG file as DCT coefficients, open the file and do\njpeg_read_header() as usual.  But instead of calling jpeg_start_decompress()\nand jpeg_read_scanlines(), call jpeg_read_coefficients().  This will read the\nentire image into a set of virtual coefficient-block arrays, one array per\ncomponent.  The return value is a pointer to an array of virtual-array\ndescriptors.  Each virtual array can be accessed directly using the JPEG\nmemory manager's access_virt_barray method (see Memory management, below,\nand also read structure.txt's discussion of virtual array handling).  Or,\nfor simple transcoding to a different JPEG file format, the array list can\njust be handed directly to jpeg_write_coefficients().\n\nEach block in the block arrays contains quantized coefficient values in\nnormal array order (not JPEG zigzag order).  The block arrays contain only\nDCT blocks containing real data; any entirely-dummy blocks added to fill out\ninterleaved MCUs at the right or bottom edges of the image are discarded\nduring reading and are not stored in the block arrays.  (The size of each\nblock array can be determined from the width_in_blocks and height_in_blocks\nfields of the component's comp_info entry.)  This is also the data format\nexpected by jpeg_write_coefficients().\n\nWhen you are done using the virtual arrays, call jpeg_finish_decompress()\nto release the array storage and return the decompression object to an idle\nstate; or just call jpeg_destroy() if you don't need to reuse the object.\n\nIf you use a suspending data source, jpeg_read_coefficients() will return\nNULL if it is forced to suspend; a non-NULL return value indicates successful\ncompletion.  You need not test for a NULL return value when using a\nnon-suspending data source.\n\nIt is also possible to call jpeg_read_coefficients() to obtain access to the\ndecoder's coefficient arrays during a normal decode cycle in buffered-image\nmode.  This frammish might be useful for progressively displaying an incoming\nimage and then re-encoding it without loss.  To do this, decode in buffered-\nimage mode as discussed previously, then call jpeg_read_coefficients() after\nthe last jpeg_finish_output() call.  The arrays will be available for your use\nuntil you call jpeg_finish_decompress().\n\n\nTo write the contents of a JPEG file as DCT coefficients, you must provide\nthe DCT coefficients stored in virtual block arrays.  You can either pass\nblock arrays read from an input JPEG file by jpeg_read_coefficients(), or\nallocate virtual arrays from the JPEG compression object and fill them\nyourself.  In either case, jpeg_write_coefficients() is substituted for\njpeg_start_compress() and jpeg_write_scanlines().  Thus the sequence is\n  * Create compression object\n  * Set all compression parameters as necessary\n  * Request virtual arrays if needed\n  * jpeg_write_coefficients()\n  * jpeg_finish_compress()\n  * Destroy or re-use compression object\njpeg_write_coefficients() is passed a pointer to an array of virtual block\narray descriptors; the number of arrays is equal to cinfo.num_components.\n\nThe virtual arrays need only have been requested, not realized, before\njpeg_write_coefficients() is called.  A side-effect of\njpeg_write_coefficients() is to realize any virtual arrays that have been\nrequested from the compression object's memory manager.  Thus, when obtaining\nthe virtual arrays from the compression object, you should fill the arrays\nafter calling jpeg_write_coefficients().  The data is actually written out\nwhen you call jpeg_finish_compress(); jpeg_write_coefficients() only writes\nthe file header.\n\nWhen writing raw DCT coefficients, it is crucial that the JPEG quantization\ntables and sampling factors match the way the data was encoded, or the\nresulting file will be invalid.  For transcoding from an existing JPEG file,\nwe recommend using jpeg_copy_critical_parameters().  This routine initializes\nall the compression parameters to default values (like jpeg_set_defaults()),\nthen copies the critical information from a source decompression object.\nThe decompression object should have just been used to read the entire\nJPEG input file --- that is, it should be awaiting jpeg_finish_decompress().\n\njpeg_write_coefficients() marks all tables stored in the compression object\nas needing to be written to the output file (thus, it acts like\njpeg_start_compress(cinfo, TRUE)).  This is for safety's sake, to avoid\nemitting abbreviated JPEG files by accident.  If you really want to emit an\nabbreviated JPEG file, call jpeg_suppress_tables(), or set the tables'\nindividual sent_table flags, between calling jpeg_write_coefficients() and\njpeg_finish_compress().\n\n\nProgress monitoring\n-------------------\n\nSome applications may need to regain control from the JPEG library every so\noften.  The typical use of this feature is to produce a percent-done bar or\nother progress display.  (For a simple example, see cjpeg.c or djpeg.c.)\nAlthough you do get control back frequently during the data-transferring pass\n(the jpeg_read_scanlines or jpeg_write_scanlines loop), any additional passes\nwill occur inside jpeg_finish_compress or jpeg_start_decompress; those\nroutines may take a long time to execute, and you don't get control back\nuntil they are done.\n\nYou can define a progress-monitor routine which will be called periodically\nby the library.  No guarantees are made about how often this call will occur,\nso we don't recommend you use it for mouse tracking or anything like that.\nAt present, a call will occur once per MCU row, scanline, or sample row\ngroup, whichever unit is convenient for the current processing mode; so the\nwider the image, the longer the time between calls.  During the data\ntransferring pass, only one call occurs per call of jpeg_read_scanlines or\njpeg_write_scanlines, so don't pass a large number of scanlines at once if\nyou want fine resolution in the progress count.  (If you really need to use\nthe callback mechanism for time-critical tasks like mouse tracking, you could\ninsert additional calls inside some of the library's inner loops.)\n\nTo establish a progress-monitor callback, create a struct jpeg_progress_mgr,\nfill in its progress_monitor field with a pointer to your callback routine,\nand set cinfo->progress to point to the struct.  The callback will be called\nwhenever cinfo->progress is non-NULL.  (This pointer is set to NULL by\njpeg_create_compress or jpeg_create_decompress; the library will not change\nit thereafter.  So if you allocate dynamic storage for the progress struct,\nmake sure it will live as long as the JPEG object does.  Allocating from the\nJPEG memory manager with lifetime JPOOL_PERMANENT will work nicely.)  You\ncan use the same callback routine for both compression and decompression.\n\nThe jpeg_progress_mgr struct contains four fields which are set by the library:\n        long pass_counter;      /* work units completed in this pass */\n        long pass_limit;        /* total number of work units in this pass */\n        int completed_passes;   /* passes completed so far */\n        int total_passes;       /* total number of passes expected */\nDuring any one pass, pass_counter increases from 0 up to (not including)\npass_limit; the step size is usually but not necessarily 1.  The pass_limit\nvalue may change from one pass to another.  The expected total number of\npasses is in total_passes, and the number of passes already completed is in\ncompleted_passes.  Thus the fraction of work completed may be estimated as\n                completed_passes + (pass_counter/pass_limit)\n                --------------------------------------------\n                                total_passes\nignoring the fact that the passes may not be equal amounts of work.\n\nWhen decompressing, pass_limit can even change within a pass, because it\ndepends on the number of scans in the JPEG file, which isn't always known in\nadvance.  The computed fraction-of-work-done may jump suddenly (if the library\ndiscovers it has overestimated the number of scans) or even decrease (in the\nopposite case).  It is not wise to put great faith in the work estimate.\n\nWhen using the decompressor's buffered-image mode, the progress monitor work\nestimate is likely to be completely unhelpful, because the library has no way\nto know how many output passes will be demanded of it.  Currently, the library\nsets total_passes based on the assumption that there will be one more output\npass if the input file end hasn't yet been read (jpeg_input_complete() isn't\nTRUE), but no more output passes if the file end has been reached when the\noutput pass is started.  This means that total_passes will rise as additional\noutput passes are requested.  If you have a way of determining the input file\nsize, estimating progress based on the fraction of the file that's been read\nwill probably be more useful than using the library's value.\n\n\nMemory management\n-----------------\n\nThis section covers some key facts about the JPEG library's built-in memory\nmanager.  For more info, please read structure.txt's section about the memory\nmanager, and consult the source code if necessary.\n\nAll memory and temporary file allocation within the library is done via the\nmemory manager.  If necessary, you can replace the \"back end\" of the memory\nmanager to control allocation yourself (for example, if you don't want the\nlibrary to use malloc() and free() for some reason).\n\nSome data is allocated \"permanently\" and will not be freed until the JPEG\nobject is destroyed.  Most data is allocated \"per image\" and is freed by\njpeg_finish_compress, jpeg_finish_decompress, or jpeg_abort.  You can call the\nmemory manager yourself to allocate structures that will automatically be\nfreed at these times.  Typical code for this is\n  ptr = (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, size);\nUse JPOOL_PERMANENT to get storage that lasts as long as the JPEG object.\nUse alloc_large instead of alloc_small for anything bigger than a few Kbytes.\nThere are also alloc_sarray and alloc_barray routines that automatically\nbuild 2-D sample or block arrays.\n\nThe library's minimum space requirements to process an image depend on the\nimage's width, but not on its height, because the library ordinarily works\nwith \"strip\" buffers that are as wide as the image but just a few rows high.\nSome operating modes (eg, two-pass color quantization) require full-image\nbuffers.  Such buffers are treated as \"virtual arrays\": only the current strip\nneed be in memory, and the rest can be swapped out to a temporary file.\n\nIf you use the simplest memory manager back end (jmemnobs.c), then no\ntemporary files are used; virtual arrays are simply malloc()'d.  Images bigger\nthan memory can be processed only if your system supports virtual memory.\nThe other memory manager back ends support temporary files of various flavors\nand thus work in machines without virtual memory.  They may also be useful on\nUnix machines if you need to process images that exceed available swap space.\n\nWhen using temporary files, the library will make the in-memory buffers for\nits virtual arrays just big enough to stay within a \"maximum memory\" setting.\nYour application can set this limit by setting cinfo->mem->max_memory_to_use\nafter creating the JPEG object.  (Of course, there is still a minimum size for\nthe buffers, so the max-memory setting is effective only if it is bigger than\nthe minimum space needed.)  If you allocate any large structures yourself, you\nmust allocate them before jpeg_start_compress() or jpeg_start_decompress() in\norder to have them counted against the max memory limit.  Also keep in mind\nthat space allocated with alloc_small() is ignored, on the assumption that\nit's too small to be worth worrying about; so a reasonable safety margin\nshould be left when setting max_memory_to_use.\n\n\nMemory usage\n------------\n\nWorking memory requirements while performing compression or decompression\ndepend on image dimensions, image characteristics (such as colorspace and\nJPEG process), and operating mode (application-selected options).\n\nAs of v6b, the decompressor requires:\n 1. About 24K in more-or-less-fixed-size data.  This varies a bit depending\n    on operating mode and image characteristics (particularly color vs.\n    grayscale), but it doesn't depend on image dimensions.\n 2. Strip buffers (of size proportional to the image width) for IDCT and\n    upsampling results.  The worst case for commonly used sampling factors\n    is about 34 bytes * width in pixels for a color image.  A grayscale image\n    only needs about 8 bytes per pixel column.\n 3. A full-image DCT coefficient buffer is needed to decode a multi-scan JPEG\n    file (including progressive JPEGs), or whenever you select buffered-image\n    mode.  This takes 2 bytes/coefficient.  At typical 2x2 sampling, that's\n    3 bytes per pixel for a color image.  Worst case (1x1 sampling) requires\n    6 bytes/pixel.  For grayscale, figure 2 bytes/pixel.\n 4. To perform 2-pass color quantization, the decompressor also needs a\n    128K color lookup table and a full-image pixel buffer (3 bytes/pixel).\nThis does not count any memory allocated by the application, such as a\nbuffer to hold the final output image.\n\nThe above figures are valid for 8-bit JPEG data precision and a machine with\n32-bit ints.  For 12-bit JPEG data, double the size of the strip buffers and\nquantization pixel buffer.  The \"fixed-size\" data will be somewhat smaller\nwith 16-bit ints, larger with 64-bit ints.  Also, CMYK or other unusual\ncolor spaces will require different amounts of space.\n\nThe full-image coefficient and pixel buffers, if needed at all, do not\nhave to be fully RAM resident; you can have the library use temporary\nfiles instead when the total memory usage would exceed a limit you set.\n(But if your OS supports virtual memory, it's probably better to just use\njmemnobs and let the OS do the swapping.)\n\nThe compressor's memory requirements are similar, except that it has no need\nfor color quantization.  Also, it needs a full-image DCT coefficient buffer\nif Huffman-table optimization is asked for, even if progressive mode is not\nrequested.\n\nIf you need more detailed information about memory usage in a particular\nsituation, you can enable the MEM_STATS code in jmemmgr.c.\n\n\nLibrary compile-time options\n----------------------------\n\nA number of compile-time options are available by modifying jmorecfg.h.\n\nThe JPEG standard provides for both the baseline 8-bit DCT process and\na 12-bit DCT process.  The IJG code supports 12-bit lossy JPEG if you define\nBITS_IN_JSAMPLE as 12 rather than 8.  Note that this causes JSAMPLE to be\nlarger than a char, so it affects the surrounding application's image data.\nThe sample applications cjpeg and djpeg can support 12-bit mode only for PPM\nand GIF file formats; you must disable the other file formats to compile a\n12-bit cjpeg or djpeg.  (install.txt has more information about that.)\nAt present, a 12-bit library can handle *only* 12-bit images, not both\nprecisions.\n\nNote that a 12-bit library always compresses in Huffman optimization mode,\nin order to generate valid Huffman tables.  This is necessary because our\ndefault Huffman tables only cover 8-bit data.  If you need to output 12-bit\nfiles in one pass, you'll have to supply suitable default Huffman tables.\nYou may also want to supply your own DCT quantization tables; the existing\nquality-scaling code has been developed for 8-bit use, and probably doesn't\ngenerate especially good tables for 12-bit.\n\nThe maximum number of components (color channels) in the image is determined\nby MAX_COMPONENTS.  The JPEG standard allows up to 255 components, but we\nexpect that few applications will need more than four or so.\n\nOn machines with unusual data type sizes, you may be able to improve\nperformance or reduce memory space by tweaking the various typedefs in\njmorecfg.h.  In particular, on some RISC CPUs, access to arrays of \"short\"s\nis quite slow; consider trading memory for speed by making JCOEF, INT16, and\nUINT16 be \"int\" or \"unsigned int\".  UINT8 is also a candidate to become int.\nYou probably don't want to make JSAMPLE be int unless you have lots of memory\nto burn.\n\nYou can reduce the size of the library by compiling out various optional\nfunctions.  To do this, undefine xxx_SUPPORTED symbols as necessary.\n\nYou can also save a few K by not having text error messages in the library;\nthe standard error message table occupies about 5Kb.  This is particularly\nreasonable for embedded applications where there's no good way to display\na message anyway.  To do this, remove the creation of the message table\n(jpeg_std_message_table[]) from jerror.c, and alter format_message to do\nsomething reasonable without it.  You could output the numeric value of the\nmessage code number, for example.  If you do this, you can also save a couple\nmore K by modifying the TRACEMSn() macros in jerror.h to expand to nothing;\nyou don't need trace capability anyway, right?\n\n\nPortability considerations\n--------------------------\n\nThe JPEG library has been written to be extremely portable; the sample\napplications cjpeg and djpeg are slightly less so.  This section summarizes\nthe design goals in this area.  (If you encounter any bugs that cause the\nlibrary to be less portable than is claimed here, we'd appreciate hearing\nabout them.)\n\nThe code works fine on ANSI C and C++ compilers, using any of the popular\nsystem include file setups, and some not-so-popular ones too.\n\nThe code is not dependent on the exact sizes of the C data types.  As\ndistributed, we make the assumptions that\n        char    is at least 8 bits wide\n        short   is at least 16 bits wide\n        int     is at least 16 bits wide\n        long    is at least 32 bits wide\n(These are the minimum requirements of the ANSI C standard.)  Wider types will\nwork fine, although memory may be used inefficiently if char is much larger\nthan 8 bits or short is much bigger than 16 bits.  The code should work\nequally well with 16- or 32-bit ints.\n\nIn a system where these assumptions are not met, you may be able to make the\ncode work by modifying the typedefs in jmorecfg.h.  However, you will probably\nhave difficulty if int is less than 16 bits wide, since references to plain\nint abound in the code.\n\nchar can be either signed or unsigned, although the code runs faster if an\nunsigned char type is available.  If char is wider than 8 bits, you will need\nto redefine JOCTET and/or provide custom data source/destination managers so\nthat JOCTET represents exactly 8 bits of data on external storage.\n\nThe JPEG library proper does not assume ASCII representation of characters.\nBut some of the image file I/O modules in cjpeg/djpeg do have ASCII\ndependencies in file-header manipulation; so does cjpeg's select_file_type()\nroutine.\n\nThe JPEG library does not rely heavily on the C library.  In particular, C\nstdio is used only by the data source/destination modules and the error\nhandler, all of which are application-replaceable.  (cjpeg/djpeg are more\nheavily dependent on stdio.)  malloc and free are called only from the memory\nmanager \"back end\" module, so you can use a different memory allocator by\nreplacing that one file.\n\nMore info about porting the code may be gleaned by reading jconfig.txt,\njmorecfg.h, and jinclude.h.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/ltmain.sh",
    "content": "#! /bin/sh\n## DO NOT EDIT - This file generated from ./build-aux/ltmain.in\n##               by inline-source v2014-01-03.01\n\n# libtool (GNU libtool) 2.4.6\n# Provide generalized library-building support services.\n# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996\n\n# Copyright (C) 1996-2015 Free Software Foundation, Inc.\n# This is free software; see the source for copying conditions.  There is NO\n# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n# GNU Libtool is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at your option) any later version.\n#\n# As a special exception to the GNU General Public License,\n# if you distribute this file as part of a program or library that\n# is built using GNU Libtool, you may include this file under the\n# same distribution terms that you use for the rest of that program.\n#\n# GNU Libtool is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n\nPROGRAM=libtool\nPACKAGE=libtool\nVERSION=2.4.6\npackage_revision=2.4.6\n\n\n## ------ ##\n## Usage. ##\n## ------ ##\n\n# Run './libtool --help' for help with using this script from the\n# command line.\n\n\n## ------------------------------- ##\n## User overridable command paths. ##\n## ------------------------------- ##\n\n# After configure completes, it has a better idea of some of the\n# shell tools we need than the defaults used by the functions shared\n# with bootstrap, so set those here where they can still be over-\n# ridden by the user, but otherwise take precedence.\n\n: ${AUTOCONF=\"autoconf\"}\n: ${AUTOMAKE=\"automake\"}\n\n\n## -------------------------- ##\n## Source external libraries. ##\n## -------------------------- ##\n\n# Much of our low-level functionality needs to be sourced from external\n# libraries, which are installed to $pkgauxdir.\n\n# Set a version string for this script.\nscriptversion=2015-01-20.17; # UTC\n\n# General shell script boiler plate, and helper functions.\n# Written by Gary V. Vaughan, 2004\n\n# Copyright (C) 2004-2015 Free Software Foundation, Inc.\n# This is free software; see the source for copying conditions.  There is NO\n# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 3 of the License, or\n# (at your option) any later version.\n\n# As a special exception to the GNU General Public License, if you distribute\n# this file as part of a program or library that is built using GNU Libtool,\n# you may include this file under the same distribution terms that you use\n# for the rest of that program.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU\n# General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program. If not, see <http://www.gnu.org/licenses/>.\n\n# Please report bugs or propose patches to gary@gnu.org.\n\n\n## ------ ##\n## Usage. ##\n## ------ ##\n\n# Evaluate this file near the top of your script to gain access to\n# the functions and variables defined here:\n#\n#   . `echo \"$0\" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh\n#\n# If you need to override any of the default environment variable\n# settings, do that before evaluating this file.\n\n\n## -------------------- ##\n## Shell normalisation. ##\n## -------------------- ##\n\n# Some shells need a little help to be as Bourne compatible as possible.\n# Before doing anything else, make sure all that help has been provided!\n\nDUALCASE=1; export DUALCASE # for MKS sh\nif test -n \"${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :\n  emulate sh\n  NULLCMD=:\n  # Pre-4.2 versions of Zsh do word splitting on ${1+\"$@\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '${1+\"$@\"}'='\"$@\"'\n  setopt NO_GLOB_SUBST\nelse\n  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac\nfi\n\n# NLS nuisances: We save the old values in case they are required later.\n_G_user_locale=\n_G_safe_locale=\nfor _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES\ndo\n  eval \"if test set = \\\"\\${$_G_var+set}\\\"; then\n          save_$_G_var=\\$$_G_var\n          $_G_var=C\n\t  export $_G_var\n\t  _G_user_locale=\\\"$_G_var=\\\\\\$save_\\$_G_var; \\$_G_user_locale\\\"\n\t  _G_safe_locale=\\\"$_G_var=C; \\$_G_safe_locale\\\"\n\tfi\"\ndone\n\n# CDPATH.\n(unset CDPATH) >/dev/null 2>&1 && unset CDPATH\n\n# Make sure IFS has a sensible default\nsp=' '\nnl='\n'\nIFS=\"$sp\t$nl\"\n\n# There are apparently some retarded systems that use ';' as a PATH separator!\nif test \"${PATH_SEPARATOR+set}\" != set; then\n  PATH_SEPARATOR=:\n  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {\n    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||\n      PATH_SEPARATOR=';'\n  }\nfi\n\n\n\n## ------------------------- ##\n## Locate command utilities. ##\n## ------------------------- ##\n\n\n# func_executable_p FILE\n# ----------------------\n# Check that FILE is an executable regular file.\nfunc_executable_p ()\n{\n    test -f \"$1\" && test -x \"$1\"\n}\n\n\n# func_path_progs PROGS_LIST CHECK_FUNC [PATH]\n# --------------------------------------------\n# Search for either a program that responds to --version with output\n# containing \"GNU\", or else returned by CHECK_FUNC otherwise, by\n# trying all the directories in PATH with each of the elements of\n# PROGS_LIST.\n#\n# CHECK_FUNC should accept the path to a candidate program, and\n# set $func_check_prog_result if it truncates its output less than\n# $_G_path_prog_max characters.\nfunc_path_progs ()\n{\n    _G_progs_list=$1\n    _G_check_func=$2\n    _G_PATH=${3-\"$PATH\"}\n\n    _G_path_prog_max=0\n    _G_path_prog_found=false\n    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}\n    for _G_dir in $_G_PATH; do\n      IFS=$_G_save_IFS\n      test -z \"$_G_dir\" && _G_dir=.\n      for _G_prog_name in $_G_progs_list; do\n        for _exeext in '' .EXE; do\n          _G_path_prog=$_G_dir/$_G_prog_name$_exeext\n          func_executable_p \"$_G_path_prog\" || continue\n          case `\"$_G_path_prog\" --version 2>&1` in\n            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;\n            *)     $_G_check_func $_G_path_prog\n\t\t   func_path_progs_result=$func_check_prog_result\n\t\t   ;;\n          esac\n          $_G_path_prog_found && break 3\n        done\n      done\n    done\n    IFS=$_G_save_IFS\n    test -z \"$func_path_progs_result\" && {\n      echo \"no acceptable sed could be found in \\$PATH\" >&2\n      exit 1\n    }\n}\n\n\n# We want to be able to use the functions in this file before configure\n# has figured out where the best binaries are kept, which means we have\n# to search for them ourselves - except when the results are already set\n# where we skip the searches.\n\n# Unless the user overrides by setting SED, search the path for either GNU\n# sed, or the sed that truncates its output the least.\ntest -z \"$SED\" && {\n  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/\n  for _G_i in 1 2 3 4 5 6 7; do\n    _G_sed_script=$_G_sed_script$nl$_G_sed_script\n  done\n  echo \"$_G_sed_script\" 2>/dev/null | sed 99q >conftest.sed\n  _G_sed_script=\n\n  func_check_prog_sed ()\n  {\n    _G_path_prog=$1\n\n    _G_count=0\n    printf 0123456789 >conftest.in\n    while :\n    do\n      cat conftest.in conftest.in >conftest.tmp\n      mv conftest.tmp conftest.in\n      cp conftest.in conftest.nl\n      echo '' >> conftest.nl\n      \"$_G_path_prog\" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break\n      diff conftest.out conftest.nl >/dev/null 2>&1 || break\n      _G_count=`expr $_G_count + 1`\n      if test \"$_G_count\" -gt \"$_G_path_prog_max\"; then\n        # Best one so far, save it but keep looking for a better one\n        func_check_prog_result=$_G_path_prog\n        _G_path_prog_max=$_G_count\n      fi\n      # 10*(2^10) chars as input seems more than enough\n      test 10 -lt \"$_G_count\" && break\n    done\n    rm -f conftest.in conftest.tmp conftest.nl conftest.out\n  }\n\n  func_path_progs \"sed gsed\" func_check_prog_sed $PATH:/usr/xpg4/bin\n  rm -f conftest.sed\n  SED=$func_path_progs_result\n}\n\n\n# Unless the user overrides by setting GREP, search the path for either GNU\n# grep, or the grep that truncates its output the least.\ntest -z \"$GREP\" && {\n  func_check_prog_grep ()\n  {\n    _G_path_prog=$1\n\n    _G_count=0\n    _G_path_prog_max=0\n    printf 0123456789 >conftest.in\n    while :\n    do\n      cat conftest.in conftest.in >conftest.tmp\n      mv conftest.tmp conftest.in\n      cp conftest.in conftest.nl\n      echo 'GREP' >> conftest.nl\n      \"$_G_path_prog\" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break\n      diff conftest.out conftest.nl >/dev/null 2>&1 || break\n      _G_count=`expr $_G_count + 1`\n      if test \"$_G_count\" -gt \"$_G_path_prog_max\"; then\n        # Best one so far, save it but keep looking for a better one\n        func_check_prog_result=$_G_path_prog\n        _G_path_prog_max=$_G_count\n      fi\n      # 10*(2^10) chars as input seems more than enough\n      test 10 -lt \"$_G_count\" && break\n    done\n    rm -f conftest.in conftest.tmp conftest.nl conftest.out\n  }\n\n  func_path_progs \"grep ggrep\" func_check_prog_grep $PATH:/usr/xpg4/bin\n  GREP=$func_path_progs_result\n}\n\n\n## ------------------------------- ##\n## User overridable command paths. ##\n## ------------------------------- ##\n\n# All uppercase variable names are used for environment variables.  These\n# variables can be overridden by the user before calling a script that\n# uses them if a suitable command of that name is not already available\n# in the command search PATH.\n\n: ${CP=\"cp -f\"}\n: ${ECHO=\"printf %s\\n\"}\n: ${EGREP=\"$GREP -E\"}\n: ${FGREP=\"$GREP -F\"}\n: ${LN_S=\"ln -s\"}\n: ${MAKE=\"make\"}\n: ${MKDIR=\"mkdir\"}\n: ${MV=\"mv -f\"}\n: ${RM=\"rm -f\"}\n: ${SHELL=\"${CONFIG_SHELL-/bin/sh}\"}\n\n\n## -------------------- ##\n## Useful sed snippets. ##\n## -------------------- ##\n\nsed_dirname='s|/[^/]*$||'\nsed_basename='s|^.*/||'\n\n# Sed substitution that helps us do robust quoting.  It backslashifies\n# metacharacters that are still active within double-quoted strings.\nsed_quote_subst='s|\\([`\"$\\\\]\\)|\\\\\\1|g'\n\n# Same as above, but do not quote variable references.\nsed_double_quote_subst='s/\\([\"`\\\\]\\)/\\\\\\1/g'\n\n# Sed substitution that turns a string into a regex matching for the\n# string literally.\nsed_make_literal_regex='s|[].[^$\\\\*\\/]|\\\\&|g'\n\n# Sed substitution that converts a w32 file name or path\n# that contains forward slashes, into one that contains\n# (escaped) backslashes.  A very naive implementation.\nsed_naive_backslashify='s|\\\\\\\\*|\\\\|g;s|/|\\\\|g;s|\\\\|\\\\\\\\|g'\n\n# Re-'\\' parameter expansions in output of sed_double_quote_subst that\n# were '\\'-ed in input to the same.  If an odd number of '\\' preceded a\n# '$' in input to sed_double_quote_subst, that '$' was protected from\n# expansion.  Since each input '\\' is now two '\\'s, look for any number\n# of runs of four '\\'s followed by two '\\'s and then a '$'.  '\\' that '$'.\n_G_bs='\\\\'\n_G_bs2='\\\\\\\\'\n_G_bs4='\\\\\\\\\\\\\\\\'\n_G_dollar='\\$'\nsed_double_backslash=\"\\\n  s/$_G_bs4/&\\\\\n/g\n  s/^$_G_bs2$_G_dollar/$_G_bs&/\n  s/\\\\([^$_G_bs]\\\\)$_G_bs2$_G_dollar/\\\\1$_G_bs2$_G_bs$_G_dollar/g\n  s/\\n//g\"\n\n\n## ----------------- ##\n## Global variables. ##\n## ----------------- ##\n\n# Except for the global variables explicitly listed below, the following\n# functions in the '^func_' namespace, and the '^require_' namespace\n# variables initialised in the 'Resource management' section, sourcing\n# this file will not pollute your global namespace with anything\n# else. There's no portable way to scope variables in Bourne shell\n# though, so actually running these functions will sometimes place\n# results into a variable named after the function, and often use\n# temporary variables in the '^_G_' namespace. If you are careful to\n# avoid using those namespaces casually in your sourcing script, things\n# should continue to work as you expect. And, of course, you can freely\n# overwrite any of the functions or variables defined here before\n# calling anything to customize them.\n\nEXIT_SUCCESS=0\nEXIT_FAILURE=1\nEXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.\nEXIT_SKIP=77\t  # $? = 77 is used to indicate a skipped test to automake.\n\n# Allow overriding, eg assuming that you follow the convention of\n# putting '$debug_cmd' at the start of all your functions, you can get\n# bash to show function call trace with:\n#\n#    debug_cmd='eval echo \"${FUNCNAME[0]} $*\" >&2' bash your-script-name\ndebug_cmd=${debug_cmd-\":\"}\nexit_cmd=:\n\n# By convention, finish your script with:\n#\n#    exit $exit_status\n#\n# so that you can set exit_status to non-zero if you want to indicate\n# something went wrong during execution without actually bailing out at\n# the point of failure.\nexit_status=$EXIT_SUCCESS\n\n# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh\n# is ksh but when the shell is invoked as \"sh\" and the current value of\n# the _XPG environment variable is not equal to 1 (one), the special\n# positional parameter $0, within a function call, is the name of the\n# function.\nprogpath=$0\n\n# The name of this program.\nprogname=`$ECHO \"$progpath\" |$SED \"$sed_basename\"`\n\n# Make sure we have an absolute progpath for reexecution:\ncase $progpath in\n  [\\\\/]*|[A-Za-z]:\\\\*) ;;\n  *[\\\\/]*)\n     progdir=`$ECHO \"$progpath\" |$SED \"$sed_dirname\"`\n     progdir=`cd \"$progdir\" && pwd`\n     progpath=$progdir/$progname\n     ;;\n  *)\n     _G_IFS=$IFS\n     IFS=${PATH_SEPARATOR-:}\n     for progdir in $PATH; do\n       IFS=$_G_IFS\n       test -x \"$progdir/$progname\" && break\n     done\n     IFS=$_G_IFS\n     test -n \"$progdir\" || progdir=`pwd`\n     progpath=$progdir/$progname\n     ;;\nesac\n\n\n## ----------------- ##\n## Standard options. ##\n## ----------------- ##\n\n# The following options affect the operation of the functions defined\n# below, and should be set appropriately depending on run-time para-\n# meters passed on the command line.\n\nopt_dry_run=false\nopt_quiet=false\nopt_verbose=false\n\n# Categories 'all' and 'none' are always available.  Append any others\n# you will pass as the first argument to func_warning from your own\n# code.\nwarning_categories=\n\n# By default, display warnings according to 'opt_warning_types'.  Set\n# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to\n# treat the next displayed warning as a fatal error.\nwarning_func=func_warn_and_continue\n\n# Set to 'all' to display all warnings, 'none' to suppress all\n# warnings, or a space delimited list of some subset of\n# 'warning_categories' to display only the listed warnings.\nopt_warning_types=all\n\n\n## -------------------- ##\n## Resource management. ##\n## -------------------- ##\n\n# This section contains definitions for functions that each ensure a\n# particular resource (a file, or a non-empty configuration variable for\n# example) is available, and if appropriate to extract default values\n# from pertinent package files. Call them using their associated\n# 'require_*' variable to ensure that they are executed, at most, once.\n#\n# It's entirely deliberate that calling these functions can set\n# variables that don't obey the namespace limitations obeyed by the rest\n# of this file, in order that that they be as useful as possible to\n# callers.\n\n\n# require_term_colors\n# -------------------\n# Allow display of bold text on terminals that support it.\nrequire_term_colors=func_require_term_colors\nfunc_require_term_colors ()\n{\n    $debug_cmd\n\n    test -t 1 && {\n      # COLORTERM and USE_ANSI_COLORS environment variables take\n      # precedence, because most terminfo databases neglect to describe\n      # whether color sequences are supported.\n      test -n \"${COLORTERM+set}\" && : ${USE_ANSI_COLORS=\"1\"}\n\n      if test 1 = \"$USE_ANSI_COLORS\"; then\n        # Standard ANSI escape sequences\n        tc_reset='\u001b[0m'\n        tc_bold='\u001b[1m';   tc_standout='\u001b[7m'\n        tc_red='\u001b[31m';   tc_green='\u001b[32m'\n        tc_blue='\u001b[34m';  tc_cyan='\u001b[36m'\n      else\n        # Otherwise trust the terminfo database after all.\n        test -n \"`tput sgr0 2>/dev/null`\" && {\n          tc_reset=`tput sgr0`\n          test -n \"`tput bold 2>/dev/null`\" && tc_bold=`tput bold`\n          tc_standout=$tc_bold\n          test -n \"`tput smso 2>/dev/null`\" && tc_standout=`tput smso`\n          test -n \"`tput setaf 1 2>/dev/null`\" && tc_red=`tput setaf 1`\n          test -n \"`tput setaf 2 2>/dev/null`\" && tc_green=`tput setaf 2`\n          test -n \"`tput setaf 4 2>/dev/null`\" && tc_blue=`tput setaf 4`\n          test -n \"`tput setaf 5 2>/dev/null`\" && tc_cyan=`tput setaf 5`\n        }\n      fi\n    }\n\n    require_term_colors=:\n}\n\n\n## ----------------- ##\n## Function library. ##\n## ----------------- ##\n\n# This section contains a variety of useful functions to call in your\n# scripts. Take note of the portable wrappers for features provided by\n# some modern shells, which will fall back to slower equivalents on\n# less featureful shells.\n\n\n# func_append VAR VALUE\n# ---------------------\n# Append VALUE onto the existing contents of VAR.\n\n  # We should try to minimise forks, especially on Windows where they are\n  # unreasonably slow, so skip the feature probes when bash or zsh are\n  # being used:\n  if test set = \"${BASH_VERSION+set}${ZSH_VERSION+set}\"; then\n    : ${_G_HAVE_ARITH_OP=\"yes\"}\n    : ${_G_HAVE_XSI_OPS=\"yes\"}\n    # The += operator was introduced in bash 3.1\n    case $BASH_VERSION in\n      [12].* | 3.0 | 3.0*) ;;\n      *)\n        : ${_G_HAVE_PLUSEQ_OP=\"yes\"}\n        ;;\n    esac\n  fi\n\n  # _G_HAVE_PLUSEQ_OP\n  # Can be empty, in which case the shell is probed, \"yes\" if += is\n  # useable or anything else if it does not work.\n  test -z \"$_G_HAVE_PLUSEQ_OP\" \\\n    && (eval 'x=a; x+=\" b\"; test \"a b\" = \"$x\"') 2>/dev/null \\\n    && _G_HAVE_PLUSEQ_OP=yes\n\nif test yes = \"$_G_HAVE_PLUSEQ_OP\"\nthen\n  # This is an XSI compatible shell, allowing a faster implementation...\n  eval 'func_append ()\n  {\n    $debug_cmd\n\n    eval \"$1+=\\$2\"\n  }'\nelse\n  # ...otherwise fall back to using expr, which is often a shell builtin.\n  func_append ()\n  {\n    $debug_cmd\n\n    eval \"$1=\\$$1\\$2\"\n  }\nfi\n\n\n# func_append_quoted VAR VALUE\n# ----------------------------\n# Quote VALUE and append to the end of shell variable VAR, separated\n# by a space.\nif test yes = \"$_G_HAVE_PLUSEQ_OP\"; then\n  eval 'func_append_quoted ()\n  {\n    $debug_cmd\n\n    func_quote_for_eval \"$2\"\n    eval \"$1+=\\\\ \\$func_quote_for_eval_result\"\n  }'\nelse\n  func_append_quoted ()\n  {\n    $debug_cmd\n\n    func_quote_for_eval \"$2\"\n    eval \"$1=\\$$1\\\\ \\$func_quote_for_eval_result\"\n  }\nfi\n\n\n# func_append_uniq VAR VALUE\n# --------------------------\n# Append unique VALUE onto the existing contents of VAR, assuming\n# entries are delimited by the first character of VALUE.  For example:\n#\n#   func_append_uniq options \" --another-option option-argument\"\n#\n# will only append to $options if \" --another-option option-argument \"\n# is not already present somewhere in $options already (note spaces at\n# each end implied by leading space in second argument).\nfunc_append_uniq ()\n{\n    $debug_cmd\n\n    eval _G_current_value='`$ECHO $'$1'`'\n    _G_delim=`expr \"$2\" : '\\(.\\)'`\n\n    case $_G_delim$_G_current_value$_G_delim in\n      *\"$2$_G_delim\"*) ;;\n      *) func_append \"$@\" ;;\n    esac\n}\n\n\n# func_arith TERM...\n# ------------------\n# Set func_arith_result to the result of evaluating TERMs.\n  test -z \"$_G_HAVE_ARITH_OP\" \\\n    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \\\n    && _G_HAVE_ARITH_OP=yes\n\nif test yes = \"$_G_HAVE_ARITH_OP\"; then\n  eval 'func_arith ()\n  {\n    $debug_cmd\n\n    func_arith_result=$(( $* ))\n  }'\nelse\n  func_arith ()\n  {\n    $debug_cmd\n\n    func_arith_result=`expr \"$@\"`\n  }\nfi\n\n\n# func_basename FILE\n# ------------------\n# Set func_basename_result to FILE with everything up to and including\n# the last / stripped.\nif test yes = \"$_G_HAVE_XSI_OPS\"; then\n  # If this shell supports suffix pattern removal, then use it to avoid\n  # forking. Hide the definitions single quotes in case the shell chokes\n  # on unsupported syntax...\n  _b='func_basename_result=${1##*/}'\n  _d='case $1 in\n        */*) func_dirname_result=${1%/*}$2 ;;\n        *  ) func_dirname_result=$3        ;;\n      esac'\n\nelse\n  # ...otherwise fall back to using sed.\n  _b='func_basename_result=`$ECHO \"$1\" |$SED \"$sed_basename\"`'\n  _d='func_dirname_result=`$ECHO \"$1\"  |$SED \"$sed_dirname\"`\n      if test \"X$func_dirname_result\" = \"X$1\"; then\n        func_dirname_result=$3\n      else\n        func_append func_dirname_result \"$2\"\n      fi'\nfi\n\neval 'func_basename ()\n{\n    $debug_cmd\n\n    '\"$_b\"'\n}'\n\n\n# func_dirname FILE APPEND NONDIR_REPLACEMENT\n# -------------------------------------------\n# Compute the dirname of FILE.  If nonempty, add APPEND to the result,\n# otherwise set result to NONDIR_REPLACEMENT.\neval 'func_dirname ()\n{\n    $debug_cmd\n\n    '\"$_d\"'\n}'\n\n\n# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT\n# --------------------------------------------------------\n# Perform func_basename and func_dirname in a single function\n# call:\n#   dirname:  Compute the dirname of FILE.  If nonempty,\n#             add APPEND to the result, otherwise set result\n#             to NONDIR_REPLACEMENT.\n#             value returned in \"$func_dirname_result\"\n#   basename: Compute filename of FILE.\n#             value retuned in \"$func_basename_result\"\n# For efficiency, we do not delegate to the functions above but instead\n# duplicate the functionality here.\neval 'func_dirname_and_basename ()\n{\n    $debug_cmd\n\n    '\"$_b\"'\n    '\"$_d\"'\n}'\n\n\n# func_echo ARG...\n# ----------------\n# Echo program name prefixed message.\nfunc_echo ()\n{\n    $debug_cmd\n\n    _G_message=$*\n\n    func_echo_IFS=$IFS\n    IFS=$nl\n    for _G_line in $_G_message; do\n      IFS=$func_echo_IFS\n      $ECHO \"$progname: $_G_line\"\n    done\n    IFS=$func_echo_IFS\n}\n\n\n# func_echo_all ARG...\n# --------------------\n# Invoke $ECHO with all args, space-separated.\nfunc_echo_all ()\n{\n    $ECHO \"$*\"\n}\n\n\n# func_echo_infix_1 INFIX ARG...\n# ------------------------------\n# Echo program name, followed by INFIX on the first line, with any\n# additional lines not showing INFIX.\nfunc_echo_infix_1 ()\n{\n    $debug_cmd\n\n    $require_term_colors\n\n    _G_infix=$1; shift\n    _G_indent=$_G_infix\n    _G_prefix=\"$progname: $_G_infix: \"\n    _G_message=$*\n\n    # Strip color escape sequences before counting printable length\n    for _G_tc in \"$tc_reset\" \"$tc_bold\" \"$tc_standout\" \"$tc_red\" \"$tc_green\" \"$tc_blue\" \"$tc_cyan\"\n    do\n      test -n \"$_G_tc\" && {\n        _G_esc_tc=`$ECHO \"$_G_tc\" | $SED \"$sed_make_literal_regex\"`\n        _G_indent=`$ECHO \"$_G_indent\" | $SED \"s|$_G_esc_tc||g\"`\n      }\n    done\n    _G_indent=\"$progname: \"`echo \"$_G_indent\" | $SED 's|.| |g'`\"  \" ## exclude from sc_prohibit_nested_quotes\n\n    func_echo_infix_1_IFS=$IFS\n    IFS=$nl\n    for _G_line in $_G_message; do\n      IFS=$func_echo_infix_1_IFS\n      $ECHO \"$_G_prefix$tc_bold$_G_line$tc_reset\" >&2\n      _G_prefix=$_G_indent\n    done\n    IFS=$func_echo_infix_1_IFS\n}\n\n\n# func_error ARG...\n# -----------------\n# Echo program name prefixed message to standard error.\nfunc_error ()\n{\n    $debug_cmd\n\n    $require_term_colors\n\n    func_echo_infix_1 \"  $tc_standout${tc_red}error$tc_reset\" \"$*\" >&2\n}\n\n\n# func_fatal_error ARG...\n# -----------------------\n# Echo program name prefixed message to standard error, and exit.\nfunc_fatal_error ()\n{\n    $debug_cmd\n\n    func_error \"$*\"\n    exit $EXIT_FAILURE\n}\n\n\n# func_grep EXPRESSION FILENAME\n# -----------------------------\n# Check whether EXPRESSION matches any line of FILENAME, without output.\nfunc_grep ()\n{\n    $debug_cmd\n\n    $GREP \"$1\" \"$2\" >/dev/null 2>&1\n}\n\n\n# func_len STRING\n# ---------------\n# Set func_len_result to the length of STRING. STRING may not\n# start with a hyphen.\n  test -z \"$_G_HAVE_XSI_OPS\" \\\n    && (eval 'x=a/b/c;\n      test 5aa/bb/cc = \"${#x}${x%%/*}${x%/*}${x#*/}${x##*/}\"') 2>/dev/null \\\n    && _G_HAVE_XSI_OPS=yes\n\nif test yes = \"$_G_HAVE_XSI_OPS\"; then\n  eval 'func_len ()\n  {\n    $debug_cmd\n\n    func_len_result=${#1}\n  }'\nelse\n  func_len ()\n  {\n    $debug_cmd\n\n    func_len_result=`expr \"$1\" : \".*\" 2>/dev/null || echo $max_cmd_len`\n  }\nfi\n\n\n# func_mkdir_p DIRECTORY-PATH\n# ---------------------------\n# Make sure the entire path to DIRECTORY-PATH is available.\nfunc_mkdir_p ()\n{\n    $debug_cmd\n\n    _G_directory_path=$1\n    _G_dir_list=\n\n    if test -n \"$_G_directory_path\" && test : != \"$opt_dry_run\"; then\n\n      # Protect directory names starting with '-'\n      case $_G_directory_path in\n        -*) _G_directory_path=./$_G_directory_path ;;\n      esac\n\n      # While some portion of DIR does not yet exist...\n      while test ! -d \"$_G_directory_path\"; do\n        # ...make a list in topmost first order.  Use a colon delimited\n\t# list incase some portion of path contains whitespace.\n        _G_dir_list=$_G_directory_path:$_G_dir_list\n\n        # If the last portion added has no slash in it, the list is done\n        case $_G_directory_path in */*) ;; *) break ;; esac\n\n        # ...otherwise throw away the child directory and loop\n        _G_directory_path=`$ECHO \"$_G_directory_path\" | $SED -e \"$sed_dirname\"`\n      done\n      _G_dir_list=`$ECHO \"$_G_dir_list\" | $SED 's|:*$||'`\n\n      func_mkdir_p_IFS=$IFS; IFS=:\n      for _G_dir in $_G_dir_list; do\n\tIFS=$func_mkdir_p_IFS\n        # mkdir can fail with a 'File exist' error if two processes\n        # try to create one of the directories concurrently.  Don't\n        # stop in that case!\n        $MKDIR \"$_G_dir\" 2>/dev/null || :\n      done\n      IFS=$func_mkdir_p_IFS\n\n      # Bail out if we (or some other process) failed to create a directory.\n      test -d \"$_G_directory_path\" || \\\n        func_fatal_error \"Failed to create '$1'\"\n    fi\n}\n\n\n# func_mktempdir [BASENAME]\n# -------------------------\n# Make a temporary directory that won't clash with other running\n# libtool processes, and avoids race conditions if possible.  If\n# given, BASENAME is the basename for that directory.\nfunc_mktempdir ()\n{\n    $debug_cmd\n\n    _G_template=${TMPDIR-/tmp}/${1-$progname}\n\n    if test : = \"$opt_dry_run\"; then\n      # Return a directory name, but don't create it in dry-run mode\n      _G_tmpdir=$_G_template-$$\n    else\n\n      # If mktemp works, use that first and foremost\n      _G_tmpdir=`mktemp -d \"$_G_template-XXXXXXXX\" 2>/dev/null`\n\n      if test ! -d \"$_G_tmpdir\"; then\n        # Failing that, at least try and use $RANDOM to avoid a race\n        _G_tmpdir=$_G_template-${RANDOM-0}$$\n\n        func_mktempdir_umask=`umask`\n        umask 0077\n        $MKDIR \"$_G_tmpdir\"\n        umask $func_mktempdir_umask\n      fi\n\n      # If we're not in dry-run mode, bomb out on failure\n      test -d \"$_G_tmpdir\" || \\\n        func_fatal_error \"cannot create temporary directory '$_G_tmpdir'\"\n    fi\n\n    $ECHO \"$_G_tmpdir\"\n}\n\n\n# func_normal_abspath PATH\n# ------------------------\n# Remove doubled-up and trailing slashes, \".\" path components,\n# and cancel out any \"..\" path components in PATH after making\n# it an absolute path.\nfunc_normal_abspath ()\n{\n    $debug_cmd\n\n    # These SED scripts presuppose an absolute path with a trailing slash.\n    _G_pathcar='s|^/\\([^/]*\\).*$|\\1|'\n    _G_pathcdr='s|^/[^/]*||'\n    _G_removedotparts=':dotsl\n\t\ts|/\\./|/|g\n\t\tt dotsl\n\t\ts|/\\.$|/|'\n    _G_collapseslashes='s|/\\{1,\\}|/|g'\n    _G_finalslash='s|/*$|/|'\n\n    # Start from root dir and reassemble the path.\n    func_normal_abspath_result=\n    func_normal_abspath_tpath=$1\n    func_normal_abspath_altnamespace=\n    case $func_normal_abspath_tpath in\n      \"\")\n        # Empty path, that just means $cwd.\n        func_stripname '' '/' \"`pwd`\"\n        func_normal_abspath_result=$func_stripname_result\n        return\n        ;;\n      # The next three entries are used to spot a run of precisely\n      # two leading slashes without using negated character classes;\n      # we take advantage of case's first-match behaviour.\n      ///*)\n        # Unusual form of absolute path, do nothing.\n        ;;\n      //*)\n        # Not necessarily an ordinary path; POSIX reserves leading '//'\n        # and for example Cygwin uses it to access remote file shares\n        # over CIFS/SMB, so we conserve a leading double slash if found.\n        func_normal_abspath_altnamespace=/\n        ;;\n      /*)\n        # Absolute path, do nothing.\n        ;;\n      *)\n        # Relative path, prepend $cwd.\n        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath\n        ;;\n    esac\n\n    # Cancel out all the simple stuff to save iterations.  We also want\n    # the path to end with a slash for ease of parsing, so make sure\n    # there is one (and only one) here.\n    func_normal_abspath_tpath=`$ECHO \"$func_normal_abspath_tpath\" | $SED \\\n          -e \"$_G_removedotparts\" -e \"$_G_collapseslashes\" -e \"$_G_finalslash\"`\n    while :; do\n      # Processed it all yet?\n      if test / = \"$func_normal_abspath_tpath\"; then\n        # If we ascended to the root using \"..\" the result may be empty now.\n        if test -z \"$func_normal_abspath_result\"; then\n          func_normal_abspath_result=/\n        fi\n        break\n      fi\n      func_normal_abspath_tcomponent=`$ECHO \"$func_normal_abspath_tpath\" | $SED \\\n          -e \"$_G_pathcar\"`\n      func_normal_abspath_tpath=`$ECHO \"$func_normal_abspath_tpath\" | $SED \\\n          -e \"$_G_pathcdr\"`\n      # Figure out what to do with it\n      case $func_normal_abspath_tcomponent in\n        \"\")\n          # Trailing empty path component, ignore it.\n          ;;\n        ..)\n          # Parent dir; strip last assembled component from result.\n          func_dirname \"$func_normal_abspath_result\"\n          func_normal_abspath_result=$func_dirname_result\n          ;;\n        *)\n          # Actual path component, append it.\n          func_append func_normal_abspath_result \"/$func_normal_abspath_tcomponent\"\n          ;;\n      esac\n    done\n    # Restore leading double-slash if one was found on entry.\n    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result\n}\n\n\n# func_notquiet ARG...\n# --------------------\n# Echo program name prefixed message only when not in quiet mode.\nfunc_notquiet ()\n{\n    $debug_cmd\n\n    $opt_quiet || func_echo ${1+\"$@\"}\n\n    # A bug in bash halts the script if the last line of a function\n    # fails when set -e is in force, so we need another command to\n    # work around that:\n    :\n}\n\n\n# func_relative_path SRCDIR DSTDIR\n# --------------------------------\n# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.\nfunc_relative_path ()\n{\n    $debug_cmd\n\n    func_relative_path_result=\n    func_normal_abspath \"$1\"\n    func_relative_path_tlibdir=$func_normal_abspath_result\n    func_normal_abspath \"$2\"\n    func_relative_path_tbindir=$func_normal_abspath_result\n\n    # Ascend the tree starting from libdir\n    while :; do\n      # check if we have found a prefix of bindir\n      case $func_relative_path_tbindir in\n        $func_relative_path_tlibdir)\n          # found an exact match\n          func_relative_path_tcancelled=\n          break\n          ;;\n        $func_relative_path_tlibdir*)\n          # found a matching prefix\n          func_stripname \"$func_relative_path_tlibdir\" '' \"$func_relative_path_tbindir\"\n          func_relative_path_tcancelled=$func_stripname_result\n          if test -z \"$func_relative_path_result\"; then\n            func_relative_path_result=.\n          fi\n          break\n          ;;\n        *)\n          func_dirname $func_relative_path_tlibdir\n          func_relative_path_tlibdir=$func_dirname_result\n          if test -z \"$func_relative_path_tlibdir\"; then\n            # Have to descend all the way to the root!\n            func_relative_path_result=../$func_relative_path_result\n            func_relative_path_tcancelled=$func_relative_path_tbindir\n            break\n          fi\n          func_relative_path_result=../$func_relative_path_result\n          ;;\n      esac\n    done\n\n    # Now calculate path; take care to avoid doubling-up slashes.\n    func_stripname '' '/' \"$func_relative_path_result\"\n    func_relative_path_result=$func_stripname_result\n    func_stripname '/' '/' \"$func_relative_path_tcancelled\"\n    if test -n \"$func_stripname_result\"; then\n      func_append func_relative_path_result \"/$func_stripname_result\"\n    fi\n\n    # Normalisation. If bindir is libdir, return '.' else relative path.\n    if test -n \"$func_relative_path_result\"; then\n      func_stripname './' '' \"$func_relative_path_result\"\n      func_relative_path_result=$func_stripname_result\n    fi\n\n    test -n \"$func_relative_path_result\" || func_relative_path_result=.\n\n    :\n}\n\n\n# func_quote_for_eval ARG...\n# --------------------------\n# Aesthetically quote ARGs to be evaled later.\n# This function returns two values:\n#   i) func_quote_for_eval_result\n#      double-quoted, suitable for a subsequent eval\n#  ii) func_quote_for_eval_unquoted_result\n#      has all characters that are still active within double\n#      quotes backslashified.\nfunc_quote_for_eval ()\n{\n    $debug_cmd\n\n    func_quote_for_eval_unquoted_result=\n    func_quote_for_eval_result=\n    while test 0 -lt $#; do\n      case $1 in\n        *[\\\\\\`\\\"\\$]*)\n\t  _G_unquoted_arg=`printf '%s\\n' \"$1\" |$SED \"$sed_quote_subst\"` ;;\n        *)\n          _G_unquoted_arg=$1 ;;\n      esac\n      if test -n \"$func_quote_for_eval_unquoted_result\"; then\n\tfunc_append func_quote_for_eval_unquoted_result \" $_G_unquoted_arg\"\n      else\n        func_append func_quote_for_eval_unquoted_result \"$_G_unquoted_arg\"\n      fi\n\n      case $_G_unquoted_arg in\n        # Double-quote args containing shell metacharacters to delay\n        # word splitting, command substitution and variable expansion\n        # for a subsequent eval.\n        # Many Bourne shells cannot handle close brackets correctly\n        # in scan sets, so we specify it separately.\n        *[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*|\"\")\n          _G_quoted_arg=\\\"$_G_unquoted_arg\\\"\n          ;;\n        *)\n          _G_quoted_arg=$_G_unquoted_arg\n\t  ;;\n      esac\n\n      if test -n \"$func_quote_for_eval_result\"; then\n\tfunc_append func_quote_for_eval_result \" $_G_quoted_arg\"\n      else\n        func_append func_quote_for_eval_result \"$_G_quoted_arg\"\n      fi\n      shift\n    done\n}\n\n\n# func_quote_for_expand ARG\n# -------------------------\n# Aesthetically quote ARG to be evaled later; same as above,\n# but do not quote variable references.\nfunc_quote_for_expand ()\n{\n    $debug_cmd\n\n    case $1 in\n      *[\\\\\\`\\\"]*)\n\t_G_arg=`$ECHO \"$1\" | $SED \\\n\t    -e \"$sed_double_quote_subst\" -e \"$sed_double_backslash\"` ;;\n      *)\n        _G_arg=$1 ;;\n    esac\n\n    case $_G_arg in\n      # Double-quote args containing shell metacharacters to delay\n      # word splitting and command substitution for a subsequent eval.\n      # Many Bourne shells cannot handle close brackets correctly\n      # in scan sets, so we specify it separately.\n      *[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*|\"\")\n        _G_arg=\\\"$_G_arg\\\"\n        ;;\n    esac\n\n    func_quote_for_expand_result=$_G_arg\n}\n\n\n# func_stripname PREFIX SUFFIX NAME\n# ---------------------------------\n# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.\n# PREFIX and SUFFIX must not contain globbing or regex special\n# characters, hashes, percent signs, but SUFFIX may contain a leading\n# dot (in which case that matches only a dot).\nif test yes = \"$_G_HAVE_XSI_OPS\"; then\n  eval 'func_stripname ()\n  {\n    $debug_cmd\n\n    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\n    # positional parameters, so assign one to ordinary variable first.\n    func_stripname_result=$3\n    func_stripname_result=${func_stripname_result#\"$1\"}\n    func_stripname_result=${func_stripname_result%\"$2\"}\n  }'\nelse\n  func_stripname ()\n  {\n    $debug_cmd\n\n    case $2 in\n      .*) func_stripname_result=`$ECHO \"$3\" | $SED -e \"s%^$1%%\" -e \"s%\\\\\\\\$2\\$%%\"`;;\n      *)  func_stripname_result=`$ECHO \"$3\" | $SED -e \"s%^$1%%\" -e \"s%$2\\$%%\"`;;\n    esac\n  }\nfi\n\n\n# func_show_eval CMD [FAIL_EXP]\n# -----------------------------\n# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is\n# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP\n# is given, then evaluate it.\nfunc_show_eval ()\n{\n    $debug_cmd\n\n    _G_cmd=$1\n    _G_fail_exp=${2-':'}\n\n    func_quote_for_expand \"$_G_cmd\"\n    eval \"func_notquiet $func_quote_for_expand_result\"\n\n    $opt_dry_run || {\n      eval \"$_G_cmd\"\n      _G_status=$?\n      if test 0 -ne \"$_G_status\"; then\n\teval \"(exit $_G_status); $_G_fail_exp\"\n      fi\n    }\n}\n\n\n# func_show_eval_locale CMD [FAIL_EXP]\n# ------------------------------------\n# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is\n# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP\n# is given, then evaluate it.  Use the saved locale for evaluation.\nfunc_show_eval_locale ()\n{\n    $debug_cmd\n\n    _G_cmd=$1\n    _G_fail_exp=${2-':'}\n\n    $opt_quiet || {\n      func_quote_for_expand \"$_G_cmd\"\n      eval \"func_echo $func_quote_for_expand_result\"\n    }\n\n    $opt_dry_run || {\n      eval \"$_G_user_locale\n\t    $_G_cmd\"\n      _G_status=$?\n      eval \"$_G_safe_locale\"\n      if test 0 -ne \"$_G_status\"; then\n\teval \"(exit $_G_status); $_G_fail_exp\"\n      fi\n    }\n}\n\n\n# func_tr_sh\n# ----------\n# Turn $1 into a string suitable for a shell variable name.\n# Result is stored in $func_tr_sh_result.  All characters\n# not in the set a-zA-Z0-9_ are replaced with '_'. Further,\n# if $1 begins with a digit, a '_' is prepended as well.\nfunc_tr_sh ()\n{\n    $debug_cmd\n\n    case $1 in\n    [0-9]* | *[!a-zA-Z0-9_]*)\n      func_tr_sh_result=`$ECHO \"$1\" | $SED -e 's/^\\([0-9]\\)/_\\1/' -e 's/[^a-zA-Z0-9_]/_/g'`\n      ;;\n    * )\n      func_tr_sh_result=$1\n      ;;\n    esac\n}\n\n\n# func_verbose ARG...\n# -------------------\n# Echo program name prefixed message in verbose mode only.\nfunc_verbose ()\n{\n    $debug_cmd\n\n    $opt_verbose && func_echo \"$*\"\n\n    :\n}\n\n\n# func_warn_and_continue ARG...\n# -----------------------------\n# Echo program name prefixed warning message to standard error.\nfunc_warn_and_continue ()\n{\n    $debug_cmd\n\n    $require_term_colors\n\n    func_echo_infix_1 \"${tc_red}warning$tc_reset\" \"$*\" >&2\n}\n\n\n# func_warning CATEGORY ARG...\n# ----------------------------\n# Echo program name prefixed warning message to standard error. Warning\n# messages can be filtered according to CATEGORY, where this function\n# elides messages where CATEGORY is not listed in the global variable\n# 'opt_warning_types'.\nfunc_warning ()\n{\n    $debug_cmd\n\n    # CATEGORY must be in the warning_categories list!\n    case \" $warning_categories \" in\n      *\" $1 \"*) ;;\n      *) func_internal_error \"invalid warning category '$1'\" ;;\n    esac\n\n    _G_category=$1\n    shift\n\n    case \" $opt_warning_types \" in\n      *\" $_G_category \"*) $warning_func ${1+\"$@\"} ;;\n    esac\n}\n\n\n# func_sort_ver VER1 VER2\n# -----------------------\n# 'sort -V' is not generally available.\n# Note this deviates from the version comparison in automake\n# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a\n# but this should suffice as we won't be specifying old\n# version formats or redundant trailing .0 in bootstrap.conf.\n# If we did want full compatibility then we should probably\n# use m4_version_compare from autoconf.\nfunc_sort_ver ()\n{\n    $debug_cmd\n\n    printf '%s\\n%s\\n' \"$1\" \"$2\" \\\n      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n\n}\n\n# func_lt_ver PREV CURR\n# ---------------------\n# Return true if PREV and CURR are in the correct order according to\n# func_sort_ver, otherwise false.  Use it like this:\n#\n#  func_lt_ver \"$prev_ver\" \"$proposed_ver\" || func_fatal_error \"...\"\nfunc_lt_ver ()\n{\n    $debug_cmd\n\n    test \"x$1\" = x`func_sort_ver \"$1\" \"$2\" | $SED 1q`\n}\n\n\n# Local variables:\n# mode: shell-script\n# sh-indentation: 2\n# eval: (add-hook 'before-save-hook 'time-stamp)\n# time-stamp-pattern: \"10/scriptversion=%:y-%02m-%02d.%02H; # UTC\"\n# time-stamp-time-zone: \"UTC\"\n# End:\n#! /bin/sh\n\n# Set a version string for this script.\nscriptversion=2014-01-07.03; # UTC\n\n# A portable, pluggable option parser for Bourne shell.\n# Written by Gary V. Vaughan, 2010\n\n# Copyright (C) 2010-2015 Free Software Foundation, Inc.\n# This is free software; see the source for copying conditions.  There is NO\n# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n# Please report bugs or propose patches to gary@gnu.org.\n\n\n## ------ ##\n## Usage. ##\n## ------ ##\n\n# This file is a library for parsing options in your shell scripts along\n# with assorted other useful supporting features that you can make use\n# of too.\n#\n# For the simplest scripts you might need only:\n#\n#   #!/bin/sh\n#   . relative/path/to/funclib.sh\n#   . relative/path/to/options-parser\n#   scriptversion=1.0\n#   func_options ${1+\"$@\"}\n#   eval set dummy \"$func_options_result\"; shift\n#   ...rest of your script...\n#\n# In order for the '--version' option to work, you will need to have a\n# suitably formatted comment like the one at the top of this file\n# starting with '# Written by ' and ending with '# warranty; '.\n#\n# For '-h' and '--help' to work, you will also need a one line\n# description of your script's purpose in a comment directly above the\n# '# Written by ' line, like the one at the top of this file.\n#\n# The default options also support '--debug', which will turn on shell\n# execution tracing (see the comment above debug_cmd below for another\n# use), and '--verbose' and the func_verbose function to allow your script\n# to display verbose messages only when your user has specified\n# '--verbose'.\n#\n# After sourcing this file, you can plug processing for additional\n# options by amending the variables from the 'Configuration' section\n# below, and following the instructions in the 'Option parsing'\n# section further down.\n\n## -------------- ##\n## Configuration. ##\n## -------------- ##\n\n# You should override these variables in your script after sourcing this\n# file so that they reflect the customisations you have added to the\n# option parser.\n\n# The usage line for option parsing errors and the start of '-h' and\n# '--help' output messages. You can embed shell variables for delayed\n# expansion at the time the message is displayed, but you will need to\n# quote other shell meta-characters carefully to prevent them being\n# expanded when the contents are evaled.\nusage='$progpath [OPTION]...'\n\n# Short help message in response to '-h' and '--help'.  Add to this or\n# override it after sourcing this library to reflect the full set of\n# options your script accepts.\nusage_message=\"\\\n       --debug        enable verbose shell tracing\n   -W, --warnings=CATEGORY\n                      report the warnings falling in CATEGORY [all]\n   -v, --verbose      verbosely report processing\n       --version      print version information and exit\n   -h, --help         print short or long help message and exit\n\"\n\n# Additional text appended to 'usage_message' in response to '--help'.\nlong_help_message=\"\nWarning categories include:\n       'all'          show all warnings\n       'none'         turn off all the warnings\n       'error'        warnings are treated as fatal errors\"\n\n# Help message printed before fatal option parsing errors.\nfatal_help=\"Try '\\$progname --help' for more information.\"\n\n\n\n## ------------------------- ##\n## Hook function management. ##\n## ------------------------- ##\n\n# This section contains functions for adding, removing, and running hooks\n# to the main code.  A hook is just a named list of of function, that can\n# be run in order later on.\n\n# func_hookable FUNC_NAME\n# -----------------------\n# Declare that FUNC_NAME will run hooks added with\n# 'func_add_hook FUNC_NAME ...'.\nfunc_hookable ()\n{\n    $debug_cmd\n\n    func_append hookable_fns \" $1\"\n}\n\n\n# func_add_hook FUNC_NAME HOOK_FUNC\n# ---------------------------------\n# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must\n# first have been declared \"hookable\" by a call to 'func_hookable'.\nfunc_add_hook ()\n{\n    $debug_cmd\n\n    case \" $hookable_fns \" in\n      *\" $1 \"*) ;;\n      *) func_fatal_error \"'$1' does not accept hook functions.\" ;;\n    esac\n\n    eval func_append ${1}_hooks '\" $2\"'\n}\n\n\n# func_remove_hook FUNC_NAME HOOK_FUNC\n# ------------------------------------\n# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.\nfunc_remove_hook ()\n{\n    $debug_cmd\n\n    eval ${1}_hooks='`$ECHO \"\\$'$1'_hooks\" |$SED \"s| '$2'||\"`'\n}\n\n\n# func_run_hooks FUNC_NAME [ARG]...\n# ---------------------------------\n# Run all hook functions registered to FUNC_NAME.\n# It is assumed that the list of hook functions contains nothing more\n# than a whitespace-delimited list of legal shell function names, and\n# no effort is wasted trying to catch shell meta-characters or preserve\n# whitespace.\nfunc_run_hooks ()\n{\n    $debug_cmd\n\n    case \" $hookable_fns \" in\n      *\" $1 \"*) ;;\n      *) func_fatal_error \"'$1' does not support hook funcions.n\" ;;\n    esac\n\n    eval _G_hook_fns=\\$$1_hooks; shift\n\n    for _G_hook in $_G_hook_fns; do\n      eval $_G_hook '\"$@\"'\n\n      # store returned options list back into positional\n      # parameters for next 'cmd' execution.\n      eval _G_hook_result=\\$${_G_hook}_result\n      eval set dummy \"$_G_hook_result\"; shift\n    done\n\n    func_quote_for_eval ${1+\"$@\"}\n    func_run_hooks_result=$func_quote_for_eval_result\n}\n\n\n\n## --------------- ##\n## Option parsing. ##\n## --------------- ##\n\n# In order to add your own option parsing hooks, you must accept the\n# full positional parameter list in your hook function, remove any\n# options that you action, and then pass back the remaining unprocessed\n# options in '<hooked_function_name>_result', escaped suitably for\n# 'eval'.  Like this:\n#\n#    my_options_prep ()\n#    {\n#        $debug_cmd\n#\n#        # Extend the existing usage message.\n#        usage_message=$usage_message'\n#      -s, --silent       don'\\''t print informational messages\n#    '\n#\n#        func_quote_for_eval ${1+\"$@\"}\n#        my_options_prep_result=$func_quote_for_eval_result\n#    }\n#    func_add_hook func_options_prep my_options_prep\n#\n#\n#    my_silent_option ()\n#    {\n#        $debug_cmd\n#\n#        # Note that for efficiency, we parse as many options as we can\n#        # recognise in a loop before passing the remainder back to the\n#        # caller on the first unrecognised argument we encounter.\n#        while test $# -gt 0; do\n#          opt=$1; shift\n#          case $opt in\n#            --silent|-s) opt_silent=: ;;\n#            # Separate non-argument short options:\n#            -s*)         func_split_short_opt \"$_G_opt\"\n#                         set dummy \"$func_split_short_opt_name\" \\\n#                             \"-$func_split_short_opt_arg\" ${1+\"$@\"}\n#                         shift\n#                         ;;\n#            *)            set dummy \"$_G_opt\" \"$*\"; shift; break ;;\n#          esac\n#        done\n#\n#        func_quote_for_eval ${1+\"$@\"}\n#        my_silent_option_result=$func_quote_for_eval_result\n#    }\n#    func_add_hook func_parse_options my_silent_option\n#\n#\n#    my_option_validation ()\n#    {\n#        $debug_cmd\n#\n#        $opt_silent && $opt_verbose && func_fatal_help \"\\\n#    '--silent' and '--verbose' options are mutually exclusive.\"\n#\n#        func_quote_for_eval ${1+\"$@\"}\n#        my_option_validation_result=$func_quote_for_eval_result\n#    }\n#    func_add_hook func_validate_options my_option_validation\n#\n# You'll alse need to manually amend $usage_message to reflect the extra\n# options you parse.  It's preferable to append if you can, so that\n# multiple option parsing hooks can be added safely.\n\n\n# func_options [ARG]...\n# ---------------------\n# All the functions called inside func_options are hookable. See the\n# individual implementations for details.\nfunc_hookable func_options\nfunc_options ()\n{\n    $debug_cmd\n\n    func_options_prep ${1+\"$@\"}\n    eval func_parse_options \\\n        ${func_options_prep_result+\"$func_options_prep_result\"}\n    eval func_validate_options \\\n        ${func_parse_options_result+\"$func_parse_options_result\"}\n\n    eval func_run_hooks func_options \\\n        ${func_validate_options_result+\"$func_validate_options_result\"}\n\n    # save modified positional parameters for caller\n    func_options_result=$func_run_hooks_result\n}\n\n\n# func_options_prep [ARG]...\n# --------------------------\n# All initialisations required before starting the option parse loop.\n# Note that when calling hook functions, we pass through the list of\n# positional parameters.  If a hook function modifies that list, and\n# needs to propogate that back to rest of this script, then the complete\n# modified list must be put in 'func_run_hooks_result' before\n# returning.\nfunc_hookable func_options_prep\nfunc_options_prep ()\n{\n    $debug_cmd\n\n    # Option defaults:\n    opt_verbose=false\n    opt_warning_types=\n\n    func_run_hooks func_options_prep ${1+\"$@\"}\n\n    # save modified positional parameters for caller\n    func_options_prep_result=$func_run_hooks_result\n}\n\n\n# func_parse_options [ARG]...\n# ---------------------------\n# The main option parsing loop.\nfunc_hookable func_parse_options\nfunc_parse_options ()\n{\n    $debug_cmd\n\n    func_parse_options_result=\n\n    # this just eases exit handling\n    while test $# -gt 0; do\n      # Defer to hook functions for initial option parsing, so they\n      # get priority in the event of reusing an option name.\n      func_run_hooks func_parse_options ${1+\"$@\"}\n\n      # Adjust func_parse_options positional parameters to match\n      eval set dummy \"$func_run_hooks_result\"; shift\n\n      # Break out of the loop if we already parsed every option.\n      test $# -gt 0 || break\n\n      _G_opt=$1\n      shift\n      case $_G_opt in\n        --debug|-x)   debug_cmd='set -x'\n                      func_echo \"enabling shell trace mode\"\n                      $debug_cmd\n                      ;;\n\n        --no-warnings|--no-warning|--no-warn)\n                      set dummy --warnings none ${1+\"$@\"}\n                      shift\n\t\t      ;;\n\n        --warnings|--warning|-W)\n                      test $# = 0 && func_missing_arg $_G_opt && break\n                      case \" $warning_categories $1\" in\n                        *\" $1 \"*)\n                          # trailing space prevents matching last $1 above\n                          func_append_uniq opt_warning_types \" $1\"\n                          ;;\n                        *all)\n                          opt_warning_types=$warning_categories\n                          ;;\n                        *none)\n                          opt_warning_types=none\n                          warning_func=:\n                          ;;\n                        *error)\n                          opt_warning_types=$warning_categories\n                          warning_func=func_fatal_error\n                          ;;\n                        *)\n                          func_fatal_error \\\n                             \"unsupported warning category: '$1'\"\n                          ;;\n                      esac\n                      shift\n                      ;;\n\n        --verbose|-v) opt_verbose=: ;;\n        --version)    func_version ;;\n        -\\?|-h)       func_usage ;;\n        --help)       func_help ;;\n\n\t# Separate optargs to long options (plugins may need this):\n\t--*=*)        func_split_equals \"$_G_opt\"\n\t              set dummy \"$func_split_equals_lhs\" \\\n                          \"$func_split_equals_rhs\" ${1+\"$@\"}\n                      shift\n                      ;;\n\n       # Separate optargs to short options:\n        -W*)\n                      func_split_short_opt \"$_G_opt\"\n                      set dummy \"$func_split_short_opt_name\" \\\n                          \"$func_split_short_opt_arg\" ${1+\"$@\"}\n                      shift\n                      ;;\n\n        # Separate non-argument short options:\n        -\\?*|-h*|-v*|-x*)\n                      func_split_short_opt \"$_G_opt\"\n                      set dummy \"$func_split_short_opt_name\" \\\n                          \"-$func_split_short_opt_arg\" ${1+\"$@\"}\n                      shift\n                      ;;\n\n        --)           break ;;\n        -*)           func_fatal_help \"unrecognised option: '$_G_opt'\" ;;\n        *)            set dummy \"$_G_opt\" ${1+\"$@\"}; shift; break ;;\n      esac\n    done\n\n    # save modified positional parameters for caller\n    func_quote_for_eval ${1+\"$@\"}\n    func_parse_options_result=$func_quote_for_eval_result\n}\n\n\n# func_validate_options [ARG]...\n# ------------------------------\n# Perform any sanity checks on option settings and/or unconsumed\n# arguments.\nfunc_hookable func_validate_options\nfunc_validate_options ()\n{\n    $debug_cmd\n\n    # Display all warnings if -W was not given.\n    test -n \"$opt_warning_types\" || opt_warning_types=\" $warning_categories\"\n\n    func_run_hooks func_validate_options ${1+\"$@\"}\n\n    # Bail if the options were screwed!\n    $exit_cmd $EXIT_FAILURE\n\n    # save modified positional parameters for caller\n    func_validate_options_result=$func_run_hooks_result\n}\n\n\n\n## ----------------- ##\n## Helper functions. ##\n## ----------------- ##\n\n# This section contains the helper functions used by the rest of the\n# hookable option parser framework in ascii-betical order.\n\n\n# func_fatal_help ARG...\n# ----------------------\n# Echo program name prefixed message to standard error, followed by\n# a help hint, and exit.\nfunc_fatal_help ()\n{\n    $debug_cmd\n\n    eval \\$ECHO \\\"\"Usage: $usage\"\\\"\n    eval \\$ECHO \\\"\"$fatal_help\"\\\"\n    func_error ${1+\"$@\"}\n    exit $EXIT_FAILURE\n}\n\n\n# func_help\n# ---------\n# Echo long help message to standard output and exit.\nfunc_help ()\n{\n    $debug_cmd\n\n    func_usage_message\n    $ECHO \"$long_help_message\"\n    exit 0\n}\n\n\n# func_missing_arg ARGNAME\n# ------------------------\n# Echo program name prefixed message to standard error and set global\n# exit_cmd.\nfunc_missing_arg ()\n{\n    $debug_cmd\n\n    func_error \"Missing argument for '$1'.\"\n    exit_cmd=exit\n}\n\n\n# func_split_equals STRING\n# ------------------------\n# Set func_split_equals_lhs and func_split_equals_rhs shell variables after\n# splitting STRING at the '=' sign.\ntest -z \"$_G_HAVE_XSI_OPS\" \\\n    && (eval 'x=a/b/c;\n      test 5aa/bb/cc = \"${#x}${x%%/*}${x%/*}${x#*/}${x##*/}\"') 2>/dev/null \\\n    && _G_HAVE_XSI_OPS=yes\n\nif test yes = \"$_G_HAVE_XSI_OPS\"\nthen\n  # This is an XSI compatible shell, allowing a faster implementation...\n  eval 'func_split_equals ()\n  {\n      $debug_cmd\n\n      func_split_equals_lhs=${1%%=*}\n      func_split_equals_rhs=${1#*=}\n      test \"x$func_split_equals_lhs\" = \"x$1\" \\\n        && func_split_equals_rhs=\n  }'\nelse\n  # ...otherwise fall back to using expr, which is often a shell builtin.\n  func_split_equals ()\n  {\n      $debug_cmd\n\n      func_split_equals_lhs=`expr \"x$1\" : 'x\\([^=]*\\)'`\n      func_split_equals_rhs=\n      test \"x$func_split_equals_lhs\" = \"x$1\" \\\n        || func_split_equals_rhs=`expr \"x$1\" : 'x[^=]*=\\(.*\\)$'`\n  }\nfi #func_split_equals\n\n\n# func_split_short_opt SHORTOPT\n# -----------------------------\n# Set func_split_short_opt_name and func_split_short_opt_arg shell\n# variables after splitting SHORTOPT after the 2nd character.\nif test yes = \"$_G_HAVE_XSI_OPS\"\nthen\n  # This is an XSI compatible shell, allowing a faster implementation...\n  eval 'func_split_short_opt ()\n  {\n      $debug_cmd\n\n      func_split_short_opt_arg=${1#??}\n      func_split_short_opt_name=${1%\"$func_split_short_opt_arg\"}\n  }'\nelse\n  # ...otherwise fall back to using expr, which is often a shell builtin.\n  func_split_short_opt ()\n  {\n      $debug_cmd\n\n      func_split_short_opt_name=`expr \"x$1\" : 'x-\\(.\\)'`\n      func_split_short_opt_arg=`expr \"x$1\" : 'x-.\\(.*\\)$'`\n  }\nfi #func_split_short_opt\n\n\n# func_usage\n# ----------\n# Echo short help message to standard output and exit.\nfunc_usage ()\n{\n    $debug_cmd\n\n    func_usage_message\n    $ECHO \"Run '$progname --help |${PAGER-more}' for full usage\"\n    exit 0\n}\n\n\n# func_usage_message\n# ------------------\n# Echo short help message to standard output.\nfunc_usage_message ()\n{\n    $debug_cmd\n\n    eval \\$ECHO \\\"\"Usage: $usage\"\\\"\n    echo\n    $SED -n 's|^# ||\n        /^Written by/{\n          x;p;x\n        }\n\th\n\t/^Written by/q' < \"$progpath\"\n    echo\n    eval \\$ECHO \\\"\"$usage_message\"\\\"\n}\n\n\n# func_version\n# ------------\n# Echo version message to standard output and exit.\nfunc_version ()\n{\n    $debug_cmd\n\n    printf '%s\\n' \"$progname $scriptversion\"\n    $SED -n '\n        /(C)/!b go\n        :more\n        /\\./!{\n          N\n          s|\\n# | |\n          b more\n        }\n        :go\n        /^# Written by /,/# warranty; / {\n          s|^# ||\n          s|^# *$||\n          s|\\((C)\\)[ 0-9,-]*[ ,-]\\([1-9][0-9]* \\)|\\1 \\2|\n          p\n        }\n        /^# Written by / {\n          s|^# ||\n          p\n        }\n        /^warranty; /q' < \"$progpath\"\n\n    exit $?\n}\n\n\n# Local variables:\n# mode: shell-script\n# sh-indentation: 2\n# eval: (add-hook 'before-save-hook 'time-stamp)\n# time-stamp-pattern: \"10/scriptversion=%:y-%02m-%02d.%02H; # UTC\"\n# time-stamp-time-zone: \"UTC\"\n# End:\n\n# Set a version string.\nscriptversion='(GNU libtool) 2.4.6'\n\n\n# func_echo ARG...\n# ----------------\n# Libtool also displays the current mode in messages, so override\n# funclib.sh func_echo with this custom definition.\nfunc_echo ()\n{\n    $debug_cmd\n\n    _G_message=$*\n\n    func_echo_IFS=$IFS\n    IFS=$nl\n    for _G_line in $_G_message; do\n      IFS=$func_echo_IFS\n      $ECHO \"$progname${opt_mode+: $opt_mode}: $_G_line\"\n    done\n    IFS=$func_echo_IFS\n}\n\n\n# func_warning ARG...\n# -------------------\n# Libtool warnings are not categorized, so override funclib.sh\n# func_warning with this simpler definition.\nfunc_warning ()\n{\n    $debug_cmd\n\n    $warning_func ${1+\"$@\"}\n}\n\n\n## ---------------- ##\n## Options parsing. ##\n## ---------------- ##\n\n# Hook in the functions to make sure our own options are parsed during\n# the option parsing loop.\n\nusage='$progpath [OPTION]... [MODE-ARG]...'\n\n# Short help message in response to '-h'.\nusage_message=\"Options:\n       --config             show all configuration variables\n       --debug              enable verbose shell tracing\n   -n, --dry-run            display commands without modifying any files\n       --features           display basic configuration information and exit\n       --mode=MODE          use operation mode MODE\n       --no-warnings        equivalent to '-Wnone'\n       --preserve-dup-deps  don't remove duplicate dependency libraries\n       --quiet, --silent    don't print informational messages\n       --tag=TAG            use configuration variables from tag TAG\n   -v, --verbose            print more informational messages than default\n       --version            print version information\n   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]\n   -h, --help, --help-all   print short, long, or detailed help message\n\"\n\n# Additional text appended to 'usage_message' in response to '--help'.\nfunc_help ()\n{\n    $debug_cmd\n\n    func_usage_message\n    $ECHO \"$long_help_message\n\nMODE must be one of the following:\n\n       clean           remove files from the build directory\n       compile         compile a source file into a libtool object\n       execute         automatically set library path, then run a program\n       finish          complete the installation of libtool libraries\n       install         install libraries or executables\n       link            create a library or an executable\n       uninstall       remove libraries from an installed directory\n\nMODE-ARGS vary depending on the MODE.  When passed as first option,\n'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.\nTry '$progname --help --mode=MODE' for a more detailed description of MODE.\n\nWhen reporting a bug, please describe a test case to reproduce it and\ninclude the following information:\n\n       host-triplet:   $host\n       shell:          $SHELL\n       compiler:       $LTCC\n       compiler flags: $LTCFLAGS\n       linker:         $LD (gnu? $with_gnu_ld)\n       version:        $progname (GNU libtool) 2.4.6\n       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`\n       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`\n\nReport bugs to <bug-libtool@gnu.org>.\nGNU libtool home page: <http://www.gnu.org/software/libtool/>.\nGeneral help using GNU software: <http://www.gnu.org/gethelp/>.\"\n    exit 0\n}\n\n\n# func_lo2o OBJECT-NAME\n# ---------------------\n# Transform OBJECT-NAME from a '.lo' suffix to the platform specific\n# object suffix.\n\nlo2o=s/\\\\.lo\\$/.$objext/\no2lo=s/\\\\.$objext\\$/.lo/\n\nif test yes = \"$_G_HAVE_XSI_OPS\"; then\n  eval 'func_lo2o ()\n  {\n    case $1 in\n      *.lo) func_lo2o_result=${1%.lo}.$objext ;;\n      *   ) func_lo2o_result=$1               ;;\n    esac\n  }'\n\n  # func_xform LIBOBJ-OR-SOURCE\n  # ---------------------------\n  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)\n  # suffix to a '.lo' libtool-object suffix.\n  eval 'func_xform ()\n  {\n    func_xform_result=${1%.*}.lo\n  }'\nelse\n  # ...otherwise fall back to using sed.\n  func_lo2o ()\n  {\n    func_lo2o_result=`$ECHO \"$1\" | $SED \"$lo2o\"`\n  }\n\n  func_xform ()\n  {\n    func_xform_result=`$ECHO \"$1\" | $SED 's|\\.[^.]*$|.lo|'`\n  }\nfi\n\n\n# func_fatal_configuration ARG...\n# -------------------------------\n# Echo program name prefixed message to standard error, followed by\n# a configuration failure hint, and exit.\nfunc_fatal_configuration ()\n{\n    func__fatal_error ${1+\"$@\"} \\\n      \"See the $PACKAGE documentation for more information.\" \\\n      \"Fatal configuration error.\"\n}\n\n\n# func_config\n# -----------\n# Display the configuration for all the tags in this script.\nfunc_config ()\n{\n    re_begincf='^# ### BEGIN LIBTOOL'\n    re_endcf='^# ### END LIBTOOL'\n\n    # Default configuration.\n    $SED \"1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\\$d\" < \"$progpath\"\n\n    # Now print the configurations for the tags.\n    for tagname in $taglist; do\n      $SED -n \"/$re_begincf TAG CONFIG: $tagname\\$/,/$re_endcf TAG CONFIG: $tagname\\$/p\" < \"$progpath\"\n    done\n\n    exit $?\n}\n\n\n# func_features\n# -------------\n# Display the features supported by this script.\nfunc_features ()\n{\n    echo \"host: $host\"\n    if test yes = \"$build_libtool_libs\"; then\n      echo \"enable shared libraries\"\n    else\n      echo \"disable shared libraries\"\n    fi\n    if test yes = \"$build_old_libs\"; then\n      echo \"enable static libraries\"\n    else\n      echo \"disable static libraries\"\n    fi\n\n    exit $?\n}\n\n\n# func_enable_tag TAGNAME\n# -----------------------\n# Verify that TAGNAME is valid, and either flag an error and exit, or\n# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist\n# variable here.\nfunc_enable_tag ()\n{\n    # Global variable:\n    tagname=$1\n\n    re_begincf=\"^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\\$\"\n    re_endcf=\"^# ### END LIBTOOL TAG CONFIG: $tagname\\$\"\n    sed_extractcf=/$re_begincf/,/$re_endcf/p\n\n    # Validate tagname.\n    case $tagname in\n      *[!-_A-Za-z0-9,/]*)\n        func_fatal_error \"invalid tag name: $tagname\"\n        ;;\n    esac\n\n    # Don't test for the \"default\" C tag, as we know it's\n    # there but not specially marked.\n    case $tagname in\n        CC) ;;\n    *)\n        if $GREP \"$re_begincf\" \"$progpath\" >/dev/null 2>&1; then\n\t  taglist=\"$taglist $tagname\"\n\n\t  # Evaluate the configuration.  Be careful to quote the path\n\t  # and the sed script, to avoid splitting on whitespace, but\n\t  # also don't use non-portable quotes within backquotes within\n\t  # quotes we have to do it in 2 steps:\n\t  extractedcf=`$SED -n -e \"$sed_extractcf\" < \"$progpath\"`\n\t  eval \"$extractedcf\"\n        else\n\t  func_error \"ignoring unknown tag $tagname\"\n        fi\n        ;;\n    esac\n}\n\n\n# func_check_version_match\n# ------------------------\n# Ensure that we are using m4 macros, and libtool script from the same\n# release of libtool.\nfunc_check_version_match ()\n{\n    if test \"$package_revision\" != \"$macro_revision\"; then\n      if test \"$VERSION\" != \"$macro_version\"; then\n        if test -z \"$macro_version\"; then\n          cat >&2 <<_LT_EOF\n$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the\n$progname: definition of this LT_INIT comes from an older release.\n$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION\n$progname: and run autoconf again.\n_LT_EOF\n        else\n          cat >&2 <<_LT_EOF\n$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the\n$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.\n$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION\n$progname: and run autoconf again.\n_LT_EOF\n        fi\n      else\n        cat >&2 <<_LT_EOF\n$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,\n$progname: but the definition of this LT_INIT comes from revision $macro_revision.\n$progname: You should recreate aclocal.m4 with macros from revision $package_revision\n$progname: of $PACKAGE $VERSION and run autoconf again.\n_LT_EOF\n      fi\n\n      exit $EXIT_MISMATCH\n    fi\n}\n\n\n# libtool_options_prep [ARG]...\n# -----------------------------\n# Preparation for options parsed by libtool.\nlibtool_options_prep ()\n{\n    $debug_mode\n\n    # Option defaults:\n    opt_config=false\n    opt_dlopen=\n    opt_dry_run=false\n    opt_help=false\n    opt_mode=\n    opt_preserve_dup_deps=false\n    opt_quiet=false\n\n    nonopt=\n    preserve_args=\n\n    # Shorthand for --mode=foo, only valid as the first argument\n    case $1 in\n    clean|clea|cle|cl)\n      shift; set dummy --mode clean ${1+\"$@\"}; shift\n      ;;\n    compile|compil|compi|comp|com|co|c)\n      shift; set dummy --mode compile ${1+\"$@\"}; shift\n      ;;\n    execute|execut|execu|exec|exe|ex|e)\n      shift; set dummy --mode execute ${1+\"$@\"}; shift\n      ;;\n    finish|finis|fini|fin|fi|f)\n      shift; set dummy --mode finish ${1+\"$@\"}; shift\n      ;;\n    install|instal|insta|inst|ins|in|i)\n      shift; set dummy --mode install ${1+\"$@\"}; shift\n      ;;\n    link|lin|li|l)\n      shift; set dummy --mode link ${1+\"$@\"}; shift\n      ;;\n    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)\n      shift; set dummy --mode uninstall ${1+\"$@\"}; shift\n      ;;\n    esac\n\n    # Pass back the list of options.\n    func_quote_for_eval ${1+\"$@\"}\n    libtool_options_prep_result=$func_quote_for_eval_result\n}\nfunc_add_hook func_options_prep libtool_options_prep\n\n\n# libtool_parse_options [ARG]...\n# ---------------------------------\n# Provide handling for libtool specific options.\nlibtool_parse_options ()\n{\n    $debug_cmd\n\n    # Perform our own loop to consume as many options as possible in\n    # each iteration.\n    while test $# -gt 0; do\n      _G_opt=$1\n      shift\n      case $_G_opt in\n        --dry-run|--dryrun|-n)\n                        opt_dry_run=:\n                        ;;\n\n        --config)       func_config ;;\n\n        --dlopen|-dlopen)\n                        opt_dlopen=\"${opt_dlopen+$opt_dlopen\n}$1\"\n                        shift\n                        ;;\n\n        --preserve-dup-deps)\n                        opt_preserve_dup_deps=: ;;\n\n        --features)     func_features ;;\n\n        --finish)       set dummy --mode finish ${1+\"$@\"}; shift ;;\n\n        --help)         opt_help=: ;;\n\n        --help-all)     opt_help=': help-all' ;;\n\n        --mode)         test $# = 0 && func_missing_arg $_G_opt && break\n                        opt_mode=$1\n                        case $1 in\n                          # Valid mode arguments:\n                          clean|compile|execute|finish|install|link|relink|uninstall) ;;\n\n                          # Catch anything else as an error\n                          *) func_error \"invalid argument for $_G_opt\"\n                             exit_cmd=exit\n                             break\n                             ;;\n                        esac\n                        shift\n                        ;;\n\n        --no-silent|--no-quiet)\n                        opt_quiet=false\n                        func_append preserve_args \" $_G_opt\"\n                        ;;\n\n        --no-warnings|--no-warning|--no-warn)\n                        opt_warning=false\n                        func_append preserve_args \" $_G_opt\"\n                        ;;\n\n        --no-verbose)\n                        opt_verbose=false\n                        func_append preserve_args \" $_G_opt\"\n                        ;;\n\n        --silent|--quiet)\n                        opt_quiet=:\n                        opt_verbose=false\n                        func_append preserve_args \" $_G_opt\"\n                        ;;\n\n        --tag)          test $# = 0 && func_missing_arg $_G_opt && break\n                        opt_tag=$1\n                        func_append preserve_args \" $_G_opt $1\"\n                        func_enable_tag \"$1\"\n                        shift\n                        ;;\n\n        --verbose|-v)   opt_quiet=false\n                        opt_verbose=:\n                        func_append preserve_args \" $_G_opt\"\n                        ;;\n\n\t# An option not handled by this hook function:\n        *)\t\tset dummy \"$_G_opt\" ${1+\"$@\"};\tshift; break  ;;\n      esac\n    done\n\n\n    # save modified positional parameters for caller\n    func_quote_for_eval ${1+\"$@\"}\n    libtool_parse_options_result=$func_quote_for_eval_result\n}\nfunc_add_hook func_parse_options libtool_parse_options\n\n\n\n# libtool_validate_options [ARG]...\n# ---------------------------------\n# Perform any sanity checks on option settings and/or unconsumed\n# arguments.\nlibtool_validate_options ()\n{\n    # save first non-option argument\n    if test 0 -lt $#; then\n      nonopt=$1\n      shift\n    fi\n\n    # preserve --debug\n    test : = \"$debug_cmd\" || func_append preserve_args \" --debug\"\n\n    case $host in\n      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452\n      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788\n      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)\n        # don't eliminate duplications in $postdeps and $predeps\n        opt_duplicate_compiler_generated_deps=:\n        ;;\n      *)\n        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps\n        ;;\n    esac\n\n    $opt_help || {\n      # Sanity checks first:\n      func_check_version_match\n\n      test yes != \"$build_libtool_libs\" \\\n        && test yes != \"$build_old_libs\" \\\n        && func_fatal_configuration \"not configured to build any kind of library\"\n\n      # Darwin sucks\n      eval std_shrext=\\\"$shrext_cmds\\\"\n\n      # Only execute mode is allowed to have -dlopen flags.\n      if test -n \"$opt_dlopen\" && test execute != \"$opt_mode\"; then\n        func_error \"unrecognized option '-dlopen'\"\n        $ECHO \"$help\" 1>&2\n        exit $EXIT_FAILURE\n      fi\n\n      # Change the help message to a mode-specific one.\n      generic_help=$help\n      help=\"Try '$progname --help --mode=$opt_mode' for more information.\"\n    }\n\n    # Pass back the unparsed argument list\n    func_quote_for_eval ${1+\"$@\"}\n    libtool_validate_options_result=$func_quote_for_eval_result\n}\nfunc_add_hook func_validate_options libtool_validate_options\n\n\n# Process options as early as possible so that --help and --version\n# can return quickly.\nfunc_options ${1+\"$@\"}\neval set dummy \"$func_options_result\"; shift\n\n\n\n## ----------- ##\n##    Main.    ##\n## ----------- ##\n\nmagic='%%%MAGIC variable%%%'\nmagic_exe='%%%MAGIC EXE variable%%%'\n\n# Global variables.\nextracted_archives=\nextracted_serial=0\n\n# If this variable is set in any of the actions, the command in it\n# will be execed at the end.  This prevents here-documents from being\n# left over by shells.\nexec_cmd=\n\n\n# A function that is used when there is no print builtin or printf.\nfunc_fallback_echo ()\n{\n  eval 'cat <<_LTECHO_EOF\n$1\n_LTECHO_EOF'\n}\n\n# func_generated_by_libtool\n# True iff stdin has been generated by Libtool. This function is only\n# a basic sanity check; it will hardly flush out determined imposters.\nfunc_generated_by_libtool_p ()\n{\n  $GREP \"^# Generated by .*$PACKAGE\" > /dev/null 2>&1\n}\n\n# func_lalib_p file\n# True iff FILE is a libtool '.la' library or '.lo' object file.\n# This function is only a basic sanity check; it will hardly flush out\n# determined imposters.\nfunc_lalib_p ()\n{\n    test -f \"$1\" &&\n      $SED -e 4q \"$1\" 2>/dev/null | func_generated_by_libtool_p\n}\n\n# func_lalib_unsafe_p file\n# True iff FILE is a libtool '.la' library or '.lo' object file.\n# This function implements the same check as func_lalib_p without\n# resorting to external programs.  To this end, it redirects stdin and\n# closes it afterwards, without saving the original file descriptor.\n# As a safety measure, use it only where a negative result would be\n# fatal anyway.  Works if 'file' does not exist.\nfunc_lalib_unsafe_p ()\n{\n    lalib_p=no\n    if test -f \"$1\" && test -r \"$1\" && exec 5<&0 <\"$1\"; then\n\tfor lalib_p_l in 1 2 3 4\n\tdo\n\t    read lalib_p_line\n\t    case $lalib_p_line in\n\t\t\\#\\ Generated\\ by\\ *$PACKAGE* ) lalib_p=yes; break;;\n\t    esac\n\tdone\n\texec 0<&5 5<&-\n    fi\n    test yes = \"$lalib_p\"\n}\n\n# func_ltwrapper_script_p file\n# True iff FILE is a libtool wrapper script\n# This function is only a basic sanity check; it will hardly flush out\n# determined imposters.\nfunc_ltwrapper_script_p ()\n{\n    test -f \"$1\" &&\n      $lt_truncate_bin < \"$1\" 2>/dev/null | func_generated_by_libtool_p\n}\n\n# func_ltwrapper_executable_p file\n# True iff FILE is a libtool wrapper executable\n# This function is only a basic sanity check; it will hardly flush out\n# determined imposters.\nfunc_ltwrapper_executable_p ()\n{\n    func_ltwrapper_exec_suffix=\n    case $1 in\n    *.exe) ;;\n    *) func_ltwrapper_exec_suffix=.exe ;;\n    esac\n    $GREP \"$magic_exe\" \"$1$func_ltwrapper_exec_suffix\" >/dev/null 2>&1\n}\n\n# func_ltwrapper_scriptname file\n# Assumes file is an ltwrapper_executable\n# uses $file to determine the appropriate filename for a\n# temporary ltwrapper_script.\nfunc_ltwrapper_scriptname ()\n{\n    func_dirname_and_basename \"$1\" \"\" \".\"\n    func_stripname '' '.exe' \"$func_basename_result\"\n    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper\n}\n\n# func_ltwrapper_p file\n# True iff FILE is a libtool wrapper script or wrapper executable\n# This function is only a basic sanity check; it will hardly flush out\n# determined imposters.\nfunc_ltwrapper_p ()\n{\n    func_ltwrapper_script_p \"$1\" || func_ltwrapper_executable_p \"$1\"\n}\n\n\n# func_execute_cmds commands fail_cmd\n# Execute tilde-delimited COMMANDS.\n# If FAIL_CMD is given, eval that upon failure.\n# FAIL_CMD may read-access the current command in variable CMD!\nfunc_execute_cmds ()\n{\n    $debug_cmd\n\n    save_ifs=$IFS; IFS='~'\n    for cmd in $1; do\n      IFS=$sp$nl\n      eval cmd=\\\"$cmd\\\"\n      IFS=$save_ifs\n      func_show_eval \"$cmd\" \"${2-:}\"\n    done\n    IFS=$save_ifs\n}\n\n\n# func_source file\n# Source FILE, adding directory component if necessary.\n# Note that it is not necessary on cygwin/mingw to append a dot to\n# FILE even if both FILE and FILE.exe exist: automatic-append-.exe\n# behavior happens only for exec(3), not for open(2)!  Also, sourcing\n# 'FILE.' does not work on cygwin managed mounts.\nfunc_source ()\n{\n    $debug_cmd\n\n    case $1 in\n    */* | *\\\\*)\t. \"$1\" ;;\n    *)\t\t. \"./$1\" ;;\n    esac\n}\n\n\n# func_resolve_sysroot PATH\n# Replace a leading = in PATH with a sysroot.  Store the result into\n# func_resolve_sysroot_result\nfunc_resolve_sysroot ()\n{\n  func_resolve_sysroot_result=$1\n  case $func_resolve_sysroot_result in\n  =*)\n    func_stripname '=' '' \"$func_resolve_sysroot_result\"\n    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result\n    ;;\n  esac\n}\n\n# func_replace_sysroot PATH\n# If PATH begins with the sysroot, replace it with = and\n# store the result into func_replace_sysroot_result.\nfunc_replace_sysroot ()\n{\n  case $lt_sysroot:$1 in\n  ?*:\"$lt_sysroot\"*)\n    func_stripname \"$lt_sysroot\" '' \"$1\"\n    func_replace_sysroot_result='='$func_stripname_result\n    ;;\n  *)\n    # Including no sysroot.\n    func_replace_sysroot_result=$1\n    ;;\n  esac\n}\n\n# func_infer_tag arg\n# Infer tagged configuration to use if any are available and\n# if one wasn't chosen via the \"--tag\" command line option.\n# Only attempt this if the compiler in the base compile\n# command doesn't match the default compiler.\n# arg is usually of the form 'gcc ...'\nfunc_infer_tag ()\n{\n    $debug_cmd\n\n    if test -n \"$available_tags\" && test -z \"$tagname\"; then\n      CC_quoted=\n      for arg in $CC; do\n\tfunc_append_quoted CC_quoted \"$arg\"\n      done\n      CC_expanded=`func_echo_all $CC`\n      CC_quoted_expanded=`func_echo_all $CC_quoted`\n      case $@ in\n      # Blanks in the command may have been stripped by the calling shell,\n      # but not from the CC environment variable when configure was run.\n      \" $CC \"* | \"$CC \"* | \" $CC_expanded \"* | \"$CC_expanded \"* | \\\n      \" $CC_quoted\"* | \"$CC_quoted \"* | \" $CC_quoted_expanded \"* | \"$CC_quoted_expanded \"*) ;;\n      # Blanks at the start of $base_compile will cause this to fail\n      # if we don't check for them as well.\n      *)\n\tfor z in $available_tags; do\n\t  if $GREP \"^# ### BEGIN LIBTOOL TAG CONFIG: $z$\" < \"$progpath\" > /dev/null; then\n\t    # Evaluate the configuration.\n\t    eval \"`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`\"\n\t    CC_quoted=\n\t    for arg in $CC; do\n\t      # Double-quote args containing other shell metacharacters.\n\t      func_append_quoted CC_quoted \"$arg\"\n\t    done\n\t    CC_expanded=`func_echo_all $CC`\n\t    CC_quoted_expanded=`func_echo_all $CC_quoted`\n\t    case \"$@ \" in\n\t    \" $CC \"* | \"$CC \"* | \" $CC_expanded \"* | \"$CC_expanded \"* | \\\n\t    \" $CC_quoted\"* | \"$CC_quoted \"* | \" $CC_quoted_expanded \"* | \"$CC_quoted_expanded \"*)\n\t      # The compiler in the base compile command matches\n\t      # the one in the tagged configuration.\n\t      # Assume this is the tagged configuration we want.\n\t      tagname=$z\n\t      break\n\t      ;;\n\t    esac\n\t  fi\n\tdone\n\t# If $tagname still isn't set, then no tagged configuration\n\t# was found and let the user know that the \"--tag\" command\n\t# line option must be used.\n\tif test -z \"$tagname\"; then\n\t  func_echo \"unable to infer tagged configuration\"\n\t  func_fatal_error \"specify a tag with '--tag'\"\n#\telse\n#\t  func_verbose \"using $tagname tagged configuration\"\n\tfi\n\t;;\n      esac\n    fi\n}\n\n\n\n# func_write_libtool_object output_name pic_name nonpic_name\n# Create a libtool object file (analogous to a \".la\" file),\n# but don't create it if we're doing a dry run.\nfunc_write_libtool_object ()\n{\n    write_libobj=$1\n    if test yes = \"$build_libtool_libs\"; then\n      write_lobj=\\'$2\\'\n    else\n      write_lobj=none\n    fi\n\n    if test yes = \"$build_old_libs\"; then\n      write_oldobj=\\'$3\\'\n    else\n      write_oldobj=none\n    fi\n\n    $opt_dry_run || {\n      cat >${write_libobj}T <<EOF\n# $write_libobj - a libtool object file\n# Generated by $PROGRAM (GNU $PACKAGE) $VERSION\n#\n# Please DO NOT delete this file!\n# It is necessary for linking the library.\n\n# Name of the PIC object.\npic_object=$write_lobj\n\n# Name of the non-PIC object\nnon_pic_object=$write_oldobj\n\nEOF\n      $MV \"${write_libobj}T\" \"$write_libobj\"\n    }\n}\n\n\n##################################################\n# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #\n##################################################\n\n# func_convert_core_file_wine_to_w32 ARG\n# Helper function used by file name conversion functions when $build is *nix,\n# and $host is mingw, cygwin, or some other w32 environment. Relies on a\n# correctly configured wine environment available, with the winepath program\n# in $build's $PATH.\n#\n# ARG is the $build file name to be converted to w32 format.\n# Result is available in $func_convert_core_file_wine_to_w32_result, and will\n# be empty on error (or when ARG is empty)\nfunc_convert_core_file_wine_to_w32 ()\n{\n  $debug_cmd\n\n  func_convert_core_file_wine_to_w32_result=$1\n  if test -n \"$1\"; then\n    # Unfortunately, winepath does not exit with a non-zero error code, so we\n    # are forced to check the contents of stdout. On the other hand, if the\n    # command is not found, the shell will set an exit code of 127 and print\n    # *an error message* to stdout. So we must check for both error code of\n    # zero AND non-empty stdout, which explains the odd construction:\n    func_convert_core_file_wine_to_w32_tmp=`winepath -w \"$1\" 2>/dev/null`\n    if test \"$?\" -eq 0 && test -n \"$func_convert_core_file_wine_to_w32_tmp\"; then\n      func_convert_core_file_wine_to_w32_result=`$ECHO \"$func_convert_core_file_wine_to_w32_tmp\" |\n        $SED -e \"$sed_naive_backslashify\"`\n    else\n      func_convert_core_file_wine_to_w32_result=\n    fi\n  fi\n}\n# end: func_convert_core_file_wine_to_w32\n\n\n# func_convert_core_path_wine_to_w32 ARG\n# Helper function used by path conversion functions when $build is *nix, and\n# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly\n# configured wine environment available, with the winepath program in $build's\n# $PATH. Assumes ARG has no leading or trailing path separator characters.\n#\n# ARG is path to be converted from $build format to win32.\n# Result is available in $func_convert_core_path_wine_to_w32_result.\n# Unconvertible file (directory) names in ARG are skipped; if no directory names\n# are convertible, then the result may be empty.\nfunc_convert_core_path_wine_to_w32 ()\n{\n  $debug_cmd\n\n  # unfortunately, winepath doesn't convert paths, only file names\n  func_convert_core_path_wine_to_w32_result=\n  if test -n \"$1\"; then\n    oldIFS=$IFS\n    IFS=:\n    for func_convert_core_path_wine_to_w32_f in $1; do\n      IFS=$oldIFS\n      func_convert_core_file_wine_to_w32 \"$func_convert_core_path_wine_to_w32_f\"\n      if test -n \"$func_convert_core_file_wine_to_w32_result\"; then\n        if test -z \"$func_convert_core_path_wine_to_w32_result\"; then\n          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result\n        else\n          func_append func_convert_core_path_wine_to_w32_result \";$func_convert_core_file_wine_to_w32_result\"\n        fi\n      fi\n    done\n    IFS=$oldIFS\n  fi\n}\n# end: func_convert_core_path_wine_to_w32\n\n\n# func_cygpath ARGS...\n# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when\n# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)\n# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or\n# (2), returns the Cygwin file name or path in func_cygpath_result (input\n# file name or path is assumed to be in w32 format, as previously converted\n# from $build's *nix or MSYS format). In case (3), returns the w32 file name\n# or path in func_cygpath_result (input file name or path is assumed to be in\n# Cygwin format). Returns an empty string on error.\n#\n# ARGS are passed to cygpath, with the last one being the file name or path to\n# be converted.\n#\n# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH\n# environment variable; do not put it in $PATH.\nfunc_cygpath ()\n{\n  $debug_cmd\n\n  if test -n \"$LT_CYGPATH\" && test -f \"$LT_CYGPATH\"; then\n    func_cygpath_result=`$LT_CYGPATH \"$@\" 2>/dev/null`\n    if test \"$?\" -ne 0; then\n      # on failure, ensure result is empty\n      func_cygpath_result=\n    fi\n  else\n    func_cygpath_result=\n    func_error \"LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'\"\n  fi\n}\n#end: func_cygpath\n\n\n# func_convert_core_msys_to_w32 ARG\n# Convert file name or path ARG from MSYS format to w32 format.  Return\n# result in func_convert_core_msys_to_w32_result.\nfunc_convert_core_msys_to_w32 ()\n{\n  $debug_cmd\n\n  # awkward: cmd appends spaces to result\n  func_convert_core_msys_to_w32_result=`( cmd //c echo \"$1\" ) 2>/dev/null |\n    $SED -e 's/[ ]*$//' -e \"$sed_naive_backslashify\"`\n}\n#end: func_convert_core_msys_to_w32\n\n\n# func_convert_file_check ARG1 ARG2\n# Verify that ARG1 (a file name in $build format) was converted to $host\n# format in ARG2. Otherwise, emit an error message, but continue (resetting\n# func_to_host_file_result to ARG1).\nfunc_convert_file_check ()\n{\n  $debug_cmd\n\n  if test -z \"$2\" && test -n \"$1\"; then\n    func_error \"Could not determine host file name corresponding to\"\n    func_error \"  '$1'\"\n    func_error \"Continuing, but uninstalled executables may not work.\"\n    # Fallback:\n    func_to_host_file_result=$1\n  fi\n}\n# end func_convert_file_check\n\n\n# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH\n# Verify that FROM_PATH (a path in $build format) was converted to $host\n# format in TO_PATH. Otherwise, emit an error message, but continue, resetting\n# func_to_host_file_result to a simplistic fallback value (see below).\nfunc_convert_path_check ()\n{\n  $debug_cmd\n\n  if test -z \"$4\" && test -n \"$3\"; then\n    func_error \"Could not determine the host path corresponding to\"\n    func_error \"  '$3'\"\n    func_error \"Continuing, but uninstalled executables may not work.\"\n    # Fallback.  This is a deliberately simplistic \"conversion\" and\n    # should not be \"improved\".  See libtool.info.\n    if test \"x$1\" != \"x$2\"; then\n      lt_replace_pathsep_chars=\"s|$1|$2|g\"\n      func_to_host_path_result=`echo \"$3\" |\n        $SED -e \"$lt_replace_pathsep_chars\"`\n    else\n      func_to_host_path_result=$3\n    fi\n  fi\n}\n# end func_convert_path_check\n\n\n# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG\n# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT\n# and appending REPL if ORIG matches BACKPAT.\nfunc_convert_path_front_back_pathsep ()\n{\n  $debug_cmd\n\n  case $4 in\n  $1 ) func_to_host_path_result=$3$func_to_host_path_result\n    ;;\n  esac\n  case $4 in\n  $2 ) func_append func_to_host_path_result \"$3\"\n    ;;\n  esac\n}\n# end func_convert_path_front_back_pathsep\n\n\n##################################################\n# $build to $host FILE NAME CONVERSION FUNCTIONS #\n##################################################\n# invoked via '$to_host_file_cmd ARG'\n#\n# In each case, ARG is the path to be converted from $build to $host format.\n# Result will be available in $func_to_host_file_result.\n\n\n# func_to_host_file ARG\n# Converts the file name ARG from $build format to $host format. Return result\n# in func_to_host_file_result.\nfunc_to_host_file ()\n{\n  $debug_cmd\n\n  $to_host_file_cmd \"$1\"\n}\n# end func_to_host_file\n\n\n# func_to_tool_file ARG LAZY\n# converts the file name ARG from $build format to toolchain format. Return\n# result in func_to_tool_file_result.  If the conversion in use is listed\n# in (the comma separated) LAZY, no conversion takes place.\nfunc_to_tool_file ()\n{\n  $debug_cmd\n\n  case ,$2, in\n    *,\"$to_tool_file_cmd\",*)\n      func_to_tool_file_result=$1\n      ;;\n    *)\n      $to_tool_file_cmd \"$1\"\n      func_to_tool_file_result=$func_to_host_file_result\n      ;;\n  esac\n}\n# end func_to_tool_file\n\n\n# func_convert_file_noop ARG\n# Copy ARG to func_to_host_file_result.\nfunc_convert_file_noop ()\n{\n  func_to_host_file_result=$1\n}\n# end func_convert_file_noop\n\n\n# func_convert_file_msys_to_w32 ARG\n# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic\n# conversion to w32 is not available inside the cwrapper.  Returns result in\n# func_to_host_file_result.\nfunc_convert_file_msys_to_w32 ()\n{\n  $debug_cmd\n\n  func_to_host_file_result=$1\n  if test -n \"$1\"; then\n    func_convert_core_msys_to_w32 \"$1\"\n    func_to_host_file_result=$func_convert_core_msys_to_w32_result\n  fi\n  func_convert_file_check \"$1\" \"$func_to_host_file_result\"\n}\n# end func_convert_file_msys_to_w32\n\n\n# func_convert_file_cygwin_to_w32 ARG\n# Convert file name ARG from Cygwin to w32 format.  Returns result in\n# func_to_host_file_result.\nfunc_convert_file_cygwin_to_w32 ()\n{\n  $debug_cmd\n\n  func_to_host_file_result=$1\n  if test -n \"$1\"; then\n    # because $build is cygwin, we call \"the\" cygpath in $PATH; no need to use\n    # LT_CYGPATH in this case.\n    func_to_host_file_result=`cygpath -m \"$1\"`\n  fi\n  func_convert_file_check \"$1\" \"$func_to_host_file_result\"\n}\n# end func_convert_file_cygwin_to_w32\n\n\n# func_convert_file_nix_to_w32 ARG\n# Convert file name ARG from *nix to w32 format.  Requires a wine environment\n# and a working winepath. Returns result in func_to_host_file_result.\nfunc_convert_file_nix_to_w32 ()\n{\n  $debug_cmd\n\n  func_to_host_file_result=$1\n  if test -n \"$1\"; then\n    func_convert_core_file_wine_to_w32 \"$1\"\n    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result\n  fi\n  func_convert_file_check \"$1\" \"$func_to_host_file_result\"\n}\n# end func_convert_file_nix_to_w32\n\n\n# func_convert_file_msys_to_cygwin ARG\n# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.\n# Returns result in func_to_host_file_result.\nfunc_convert_file_msys_to_cygwin ()\n{\n  $debug_cmd\n\n  func_to_host_file_result=$1\n  if test -n \"$1\"; then\n    func_convert_core_msys_to_w32 \"$1\"\n    func_cygpath -u \"$func_convert_core_msys_to_w32_result\"\n    func_to_host_file_result=$func_cygpath_result\n  fi\n  func_convert_file_check \"$1\" \"$func_to_host_file_result\"\n}\n# end func_convert_file_msys_to_cygwin\n\n\n# func_convert_file_nix_to_cygwin ARG\n# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed\n# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result\n# in func_to_host_file_result.\nfunc_convert_file_nix_to_cygwin ()\n{\n  $debug_cmd\n\n  func_to_host_file_result=$1\n  if test -n \"$1\"; then\n    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.\n    func_convert_core_file_wine_to_w32 \"$1\"\n    func_cygpath -u \"$func_convert_core_file_wine_to_w32_result\"\n    func_to_host_file_result=$func_cygpath_result\n  fi\n  func_convert_file_check \"$1\" \"$func_to_host_file_result\"\n}\n# end func_convert_file_nix_to_cygwin\n\n\n#############################################\n# $build to $host PATH CONVERSION FUNCTIONS #\n#############################################\n# invoked via '$to_host_path_cmd ARG'\n#\n# In each case, ARG is the path to be converted from $build to $host format.\n# The result will be available in $func_to_host_path_result.\n#\n# Path separators are also converted from $build format to $host format.  If\n# ARG begins or ends with a path separator character, it is preserved (but\n# converted to $host format) on output.\n#\n# All path conversion functions are named using the following convention:\n#   file name conversion function    : func_convert_file_X_to_Y ()\n#   path conversion function         : func_convert_path_X_to_Y ()\n# where, for any given $build/$host combination the 'X_to_Y' value is the\n# same.  If conversion functions are added for new $build/$host combinations,\n# the two new functions must follow this pattern, or func_init_to_host_path_cmd\n# will break.\n\n\n# func_init_to_host_path_cmd\n# Ensures that function \"pointer\" variable $to_host_path_cmd is set to the\n# appropriate value, based on the value of $to_host_file_cmd.\nto_host_path_cmd=\nfunc_init_to_host_path_cmd ()\n{\n  $debug_cmd\n\n  if test -z \"$to_host_path_cmd\"; then\n    func_stripname 'func_convert_file_' '' \"$to_host_file_cmd\"\n    to_host_path_cmd=func_convert_path_$func_stripname_result\n  fi\n}\n\n\n# func_to_host_path ARG\n# Converts the path ARG from $build format to $host format. Return result\n# in func_to_host_path_result.\nfunc_to_host_path ()\n{\n  $debug_cmd\n\n  func_init_to_host_path_cmd\n  $to_host_path_cmd \"$1\"\n}\n# end func_to_host_path\n\n\n# func_convert_path_noop ARG\n# Copy ARG to func_to_host_path_result.\nfunc_convert_path_noop ()\n{\n  func_to_host_path_result=$1\n}\n# end func_convert_path_noop\n\n\n# func_convert_path_msys_to_w32 ARG\n# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic\n# conversion to w32 is not available inside the cwrapper.  Returns result in\n# func_to_host_path_result.\nfunc_convert_path_msys_to_w32 ()\n{\n  $debug_cmd\n\n  func_to_host_path_result=$1\n  if test -n \"$1\"; then\n    # Remove leading and trailing path separator characters from ARG.  MSYS\n    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';\n    # and winepath ignores them completely.\n    func_stripname : : \"$1\"\n    func_to_host_path_tmp1=$func_stripname_result\n    func_convert_core_msys_to_w32 \"$func_to_host_path_tmp1\"\n    func_to_host_path_result=$func_convert_core_msys_to_w32_result\n    func_convert_path_check : \";\" \\\n      \"$func_to_host_path_tmp1\" \"$func_to_host_path_result\"\n    func_convert_path_front_back_pathsep \":*\" \"*:\" \";\" \"$1\"\n  fi\n}\n# end func_convert_path_msys_to_w32\n\n\n# func_convert_path_cygwin_to_w32 ARG\n# Convert path ARG from Cygwin to w32 format.  Returns result in\n# func_to_host_file_result.\nfunc_convert_path_cygwin_to_w32 ()\n{\n  $debug_cmd\n\n  func_to_host_path_result=$1\n  if test -n \"$1\"; then\n    # See func_convert_path_msys_to_w32:\n    func_stripname : : \"$1\"\n    func_to_host_path_tmp1=$func_stripname_result\n    func_to_host_path_result=`cygpath -m -p \"$func_to_host_path_tmp1\"`\n    func_convert_path_check : \";\" \\\n      \"$func_to_host_path_tmp1\" \"$func_to_host_path_result\"\n    func_convert_path_front_back_pathsep \":*\" \"*:\" \";\" \"$1\"\n  fi\n}\n# end func_convert_path_cygwin_to_w32\n\n\n# func_convert_path_nix_to_w32 ARG\n# Convert path ARG from *nix to w32 format.  Requires a wine environment and\n# a working winepath.  Returns result in func_to_host_file_result.\nfunc_convert_path_nix_to_w32 ()\n{\n  $debug_cmd\n\n  func_to_host_path_result=$1\n  if test -n \"$1\"; then\n    # See func_convert_path_msys_to_w32:\n    func_stripname : : \"$1\"\n    func_to_host_path_tmp1=$func_stripname_result\n    func_convert_core_path_wine_to_w32 \"$func_to_host_path_tmp1\"\n    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result\n    func_convert_path_check : \";\" \\\n      \"$func_to_host_path_tmp1\" \"$func_to_host_path_result\"\n    func_convert_path_front_back_pathsep \":*\" \"*:\" \";\" \"$1\"\n  fi\n}\n# end func_convert_path_nix_to_w32\n\n\n# func_convert_path_msys_to_cygwin ARG\n# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.\n# Returns result in func_to_host_file_result.\nfunc_convert_path_msys_to_cygwin ()\n{\n  $debug_cmd\n\n  func_to_host_path_result=$1\n  if test -n \"$1\"; then\n    # See func_convert_path_msys_to_w32:\n    func_stripname : : \"$1\"\n    func_to_host_path_tmp1=$func_stripname_result\n    func_convert_core_msys_to_w32 \"$func_to_host_path_tmp1\"\n    func_cygpath -u -p \"$func_convert_core_msys_to_w32_result\"\n    func_to_host_path_result=$func_cygpath_result\n    func_convert_path_check : : \\\n      \"$func_to_host_path_tmp1\" \"$func_to_host_path_result\"\n    func_convert_path_front_back_pathsep \":*\" \"*:\" : \"$1\"\n  fi\n}\n# end func_convert_path_msys_to_cygwin\n\n\n# func_convert_path_nix_to_cygwin ARG\n# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a\n# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in\n# func_to_host_file_result.\nfunc_convert_path_nix_to_cygwin ()\n{\n  $debug_cmd\n\n  func_to_host_path_result=$1\n  if test -n \"$1\"; then\n    # Remove leading and trailing path separator characters from\n    # ARG. msys behavior is inconsistent here, cygpath turns them\n    # into '.;' and ';.', and winepath ignores them completely.\n    func_stripname : : \"$1\"\n    func_to_host_path_tmp1=$func_stripname_result\n    func_convert_core_path_wine_to_w32 \"$func_to_host_path_tmp1\"\n    func_cygpath -u -p \"$func_convert_core_path_wine_to_w32_result\"\n    func_to_host_path_result=$func_cygpath_result\n    func_convert_path_check : : \\\n      \"$func_to_host_path_tmp1\" \"$func_to_host_path_result\"\n    func_convert_path_front_back_pathsep \":*\" \"*:\" : \"$1\"\n  fi\n}\n# end func_convert_path_nix_to_cygwin\n\n\n# func_dll_def_p FILE\n# True iff FILE is a Windows DLL '.def' file.\n# Keep in sync with _LT_DLL_DEF_P in libtool.m4\nfunc_dll_def_p ()\n{\n  $debug_cmd\n\n  func_dll_def_p_tmp=`$SED -n \\\n    -e 's/^[\t ]*//' \\\n    -e '/^\\(;.*\\)*$/d' \\\n    -e 's/^\\(EXPORTS\\|LIBRARY\\)\\([\t ].*\\)*$/DEF/p' \\\n    -e q \\\n    \"$1\"`\n  test DEF = \"$func_dll_def_p_tmp\"\n}\n\n\n# func_mode_compile arg...\nfunc_mode_compile ()\n{\n    $debug_cmd\n\n    # Get the compilation command and the source file.\n    base_compile=\n    srcfile=$nonopt  #  always keep a non-empty value in \"srcfile\"\n    suppress_opt=yes\n    suppress_output=\n    arg_mode=normal\n    libobj=\n    later=\n    pie_flag=\n\n    for arg\n    do\n      case $arg_mode in\n      arg  )\n\t# do not \"continue\".  Instead, add this to base_compile\n\tlastarg=$arg\n\targ_mode=normal\n\t;;\n\n      target )\n\tlibobj=$arg\n\targ_mode=normal\n\tcontinue\n\t;;\n\n      normal )\n\t# Accept any command-line options.\n\tcase $arg in\n\t-o)\n\t  test -n \"$libobj\" && \\\n\t    func_fatal_error \"you cannot specify '-o' more than once\"\n\t  arg_mode=target\n\t  continue\n\t  ;;\n\n\t-pie | -fpie | -fPIE)\n          func_append pie_flag \" $arg\"\n\t  continue\n\t  ;;\n\n\t-shared | -static | -prefer-pic | -prefer-non-pic)\n\t  func_append later \" $arg\"\n\t  continue\n\t  ;;\n\n\t-no-suppress)\n\t  suppress_opt=no\n\t  continue\n\t  ;;\n\n\t-Xcompiler)\n\t  arg_mode=arg  #  the next one goes into the \"base_compile\" arg list\n\t  continue      #  The current \"srcfile\" will either be retained or\n\t  ;;            #  replaced later.  I would guess that would be a bug.\n\n\t-Wc,*)\n\t  func_stripname '-Wc,' '' \"$arg\"\n\t  args=$func_stripname_result\n\t  lastarg=\n\t  save_ifs=$IFS; IFS=,\n\t  for arg in $args; do\n\t    IFS=$save_ifs\n\t    func_append_quoted lastarg \"$arg\"\n\t  done\n\t  IFS=$save_ifs\n\t  func_stripname ' ' '' \"$lastarg\"\n\t  lastarg=$func_stripname_result\n\n\t  # Add the arguments to base_compile.\n\t  func_append base_compile \" $lastarg\"\n\t  continue\n\t  ;;\n\n\t*)\n\t  # Accept the current argument as the source file.\n\t  # The previous \"srcfile\" becomes the current argument.\n\t  #\n\t  lastarg=$srcfile\n\t  srcfile=$arg\n\t  ;;\n\tesac  #  case $arg\n\t;;\n      esac    #  case $arg_mode\n\n      # Aesthetically quote the previous argument.\n      func_append_quoted base_compile \"$lastarg\"\n    done # for arg\n\n    case $arg_mode in\n    arg)\n      func_fatal_error \"you must specify an argument for -Xcompile\"\n      ;;\n    target)\n      func_fatal_error \"you must specify a target with '-o'\"\n      ;;\n    *)\n      # Get the name of the library object.\n      test -z \"$libobj\" && {\n\tfunc_basename \"$srcfile\"\n\tlibobj=$func_basename_result\n      }\n      ;;\n    esac\n\n    # Recognize several different file suffixes.\n    # If the user specifies -o file.o, it is replaced with file.lo\n    case $libobj in\n    *.[cCFSifmso] | \\\n    *.ada | *.adb | *.ads | *.asm | \\\n    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \\\n    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)\n      func_xform \"$libobj\"\n      libobj=$func_xform_result\n      ;;\n    esac\n\n    case $libobj in\n    *.lo) func_lo2o \"$libobj\"; obj=$func_lo2o_result ;;\n    *)\n      func_fatal_error \"cannot determine name of library object from '$libobj'\"\n      ;;\n    esac\n\n    func_infer_tag $base_compile\n\n    for arg in $later; do\n      case $arg in\n      -shared)\n\ttest yes = \"$build_libtool_libs\" \\\n\t  || func_fatal_configuration \"cannot build a shared library\"\n\tbuild_old_libs=no\n\tcontinue\n\t;;\n\n      -static)\n\tbuild_libtool_libs=no\n\tbuild_old_libs=yes\n\tcontinue\n\t;;\n\n      -prefer-pic)\n\tpic_mode=yes\n\tcontinue\n\t;;\n\n      -prefer-non-pic)\n\tpic_mode=no\n\tcontinue\n\t;;\n      esac\n    done\n\n    func_quote_for_eval \"$libobj\"\n    test \"X$libobj\" != \"X$func_quote_for_eval_result\" \\\n      && $ECHO \"X$libobj\" | $GREP '[]~#^*{};<>?\"'\"'\"'\t &()|`$[]' \\\n      && func_warning \"libobj name '$libobj' may not contain shell special characters.\"\n    func_dirname_and_basename \"$obj\" \"/\" \"\"\n    objname=$func_basename_result\n    xdir=$func_dirname_result\n    lobj=$xdir$objdir/$objname\n\n    test -z \"$base_compile\" && \\\n      func_fatal_help \"you must specify a compilation command\"\n\n    # Delete any leftover library objects.\n    if test yes = \"$build_old_libs\"; then\n      removelist=\"$obj $lobj $libobj ${libobj}T\"\n    else\n      removelist=\"$lobj $libobj ${libobj}T\"\n    fi\n\n    # On Cygwin there's no \"real\" PIC flag so we must build both object types\n    case $host_os in\n    cygwin* | mingw* | pw32* | os2* | cegcc*)\n      pic_mode=default\n      ;;\n    esac\n    if test no = \"$pic_mode\" && test pass_all != \"$deplibs_check_method\"; then\n      # non-PIC code in shared libraries is not supported\n      pic_mode=default\n    fi\n\n    # Calculate the filename of the output object if compiler does\n    # not support -o with -c\n    if test no = \"$compiler_c_o\"; then\n      output_obj=`$ECHO \"$srcfile\" | $SED 's%^.*/%%; s%\\.[^.]*$%%'`.$objext\n      lockfile=$output_obj.lock\n    else\n      output_obj=\n      need_locks=no\n      lockfile=\n    fi\n\n    # Lock this critical section if it is needed\n    # We use this script file to make the link, it avoids creating a new file\n    if test yes = \"$need_locks\"; then\n      until $opt_dry_run || ln \"$progpath\" \"$lockfile\" 2>/dev/null; do\n\tfunc_echo \"Waiting for $lockfile to be removed\"\n\tsleep 2\n      done\n    elif test warn = \"$need_locks\"; then\n      if test -f \"$lockfile\"; then\n\t$ECHO \"\\\n*** ERROR, $lockfile exists and contains:\n`cat $lockfile 2>/dev/null`\n\nThis indicates that another process is trying to use the same\ntemporary object file, and libtool could not work around it because\nyour compiler does not support '-c' and '-o' together.  If you\nrepeat this compilation, it may succeed, by chance, but you had better\navoid parallel builds (make -j) in this platform, or get a better\ncompiler.\"\n\n\t$opt_dry_run || $RM $removelist\n\texit $EXIT_FAILURE\n      fi\n      func_append removelist \" $output_obj\"\n      $ECHO \"$srcfile\" > \"$lockfile\"\n    fi\n\n    $opt_dry_run || $RM $removelist\n    func_append removelist \" $lockfile\"\n    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15\n\n    func_to_tool_file \"$srcfile\" func_convert_file_msys_to_w32\n    srcfile=$func_to_tool_file_result\n    func_quote_for_eval \"$srcfile\"\n    qsrcfile=$func_quote_for_eval_result\n\n    # Only build a PIC object if we are building libtool libraries.\n    if test yes = \"$build_libtool_libs\"; then\n      # Without this assignment, base_compile gets emptied.\n      fbsd_hideous_sh_bug=$base_compile\n\n      if test no != \"$pic_mode\"; then\n\tcommand=\"$base_compile $qsrcfile $pic_flag\"\n      else\n\t# Don't build PIC code\n\tcommand=\"$base_compile $qsrcfile\"\n      fi\n\n      func_mkdir_p \"$xdir$objdir\"\n\n      if test -z \"$output_obj\"; then\n\t# Place PIC objects in $objdir\n\tfunc_append command \" -o $lobj\"\n      fi\n\n      func_show_eval_locale \"$command\"\t\\\n          'test -n \"$output_obj\" && $RM $removelist; exit $EXIT_FAILURE'\n\n      if test warn = \"$need_locks\" &&\n\t test \"X`cat $lockfile 2>/dev/null`\" != \"X$srcfile\"; then\n\t$ECHO \"\\\n*** ERROR, $lockfile contains:\n`cat $lockfile 2>/dev/null`\n\nbut it should contain:\n$srcfile\n\nThis indicates that another process is trying to use the same\ntemporary object file, and libtool could not work around it because\nyour compiler does not support '-c' and '-o' together.  If you\nrepeat this compilation, it may succeed, by chance, but you had better\navoid parallel builds (make -j) in this platform, or get a better\ncompiler.\"\n\n\t$opt_dry_run || $RM $removelist\n\texit $EXIT_FAILURE\n      fi\n\n      # Just move the object if needed, then go on to compile the next one\n      if test -n \"$output_obj\" && test \"X$output_obj\" != \"X$lobj\"; then\n\tfunc_show_eval '$MV \"$output_obj\" \"$lobj\"' \\\n\t  'error=$?; $opt_dry_run || $RM $removelist; exit $error'\n      fi\n\n      # Allow error messages only from the first compilation.\n      if test yes = \"$suppress_opt\"; then\n\tsuppress_output=' >/dev/null 2>&1'\n      fi\n    fi\n\n    # Only build a position-dependent object if we build old libraries.\n    if test yes = \"$build_old_libs\"; then\n      if test yes != \"$pic_mode\"; then\n\t# Don't build PIC code\n\tcommand=\"$base_compile $qsrcfile$pie_flag\"\n      else\n\tcommand=\"$base_compile $qsrcfile $pic_flag\"\n      fi\n      if test yes = \"$compiler_c_o\"; then\n\tfunc_append command \" -o $obj\"\n      fi\n\n      # Suppress compiler output if we already did a PIC compilation.\n      func_append command \"$suppress_output\"\n      func_show_eval_locale \"$command\" \\\n        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'\n\n      if test warn = \"$need_locks\" &&\n\t test \"X`cat $lockfile 2>/dev/null`\" != \"X$srcfile\"; then\n\t$ECHO \"\\\n*** ERROR, $lockfile contains:\n`cat $lockfile 2>/dev/null`\n\nbut it should contain:\n$srcfile\n\nThis indicates that another process is trying to use the same\ntemporary object file, and libtool could not work around it because\nyour compiler does not support '-c' and '-o' together.  If you\nrepeat this compilation, it may succeed, by chance, but you had better\navoid parallel builds (make -j) in this platform, or get a better\ncompiler.\"\n\n\t$opt_dry_run || $RM $removelist\n\texit $EXIT_FAILURE\n      fi\n\n      # Just move the object if needed\n      if test -n \"$output_obj\" && test \"X$output_obj\" != \"X$obj\"; then\n\tfunc_show_eval '$MV \"$output_obj\" \"$obj\"' \\\n\t  'error=$?; $opt_dry_run || $RM $removelist; exit $error'\n      fi\n    fi\n\n    $opt_dry_run || {\n      func_write_libtool_object \"$libobj\" \"$objdir/$objname\" \"$objname\"\n\n      # Unlock the critical section if it was locked\n      if test no != \"$need_locks\"; then\n\tremovelist=$lockfile\n        $RM \"$lockfile\"\n      fi\n    }\n\n    exit $EXIT_SUCCESS\n}\n\n$opt_help || {\n  test compile = \"$opt_mode\" && func_mode_compile ${1+\"$@\"}\n}\n\nfunc_mode_help ()\n{\n    # We need to display help for each of the modes.\n    case $opt_mode in\n      \"\")\n        # Generic help is extracted from the usage comments\n        # at the start of this file.\n        func_help\n        ;;\n\n      clean)\n        $ECHO \\\n\"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...\n\nRemove files from the build directory.\n\nRM is the name of the program to use to delete files associated with each FILE\n(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed\nto RM.\n\nIf FILE is a libtool library, object or program, all the files associated\nwith it are deleted. Otherwise, only FILE itself is deleted using RM.\"\n        ;;\n\n      compile)\n      $ECHO \\\n\"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE\n\nCompile a source file into a libtool library object.\n\nThis mode accepts the following additional options:\n\n  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE\n  -no-suppress      do not suppress compiler output for multiple passes\n  -prefer-pic       try to build PIC objects only\n  -prefer-non-pic   try to build non-PIC objects only\n  -shared           do not build a '.o' file suitable for static linking\n  -static           only build a '.o' file suitable for static linking\n  -Wc,FLAG          pass FLAG directly to the compiler\n\nCOMPILE-COMMAND is a command to be used in creating a 'standard' object file\nfrom the given SOURCEFILE.\n\nThe output file name is determined by removing the directory component from\nSOURCEFILE, then substituting the C source code suffix '.c' with the\nlibrary object suffix, '.lo'.\"\n        ;;\n\n      execute)\n        $ECHO \\\n\"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...\n\nAutomatically set library path, then run a program.\n\nThis mode accepts the following additional options:\n\n  -dlopen FILE      add the directory containing FILE to the library path\n\nThis mode sets the library path environment variable according to '-dlopen'\nflags.\n\nIf any of the ARGS are libtool executable wrappers, then they are translated\ninto their corresponding uninstalled binary, and any of their required library\ndirectories are added to the library path.\n\nThen, COMMAND is executed, with ARGS as arguments.\"\n        ;;\n\n      finish)\n        $ECHO \\\n\"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...\n\nComplete the installation of libtool libraries.\n\nEach LIBDIR is a directory that contains libtool libraries.\n\nThe commands that this mode executes may require superuser privileges.  Use\nthe '--dry-run' option if you just want to see what would be executed.\"\n        ;;\n\n      install)\n        $ECHO \\\n\"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...\n\nInstall executables or libraries.\n\nINSTALL-COMMAND is the installation command.  The first component should be\neither the 'install' or 'cp' program.\n\nThe following components of INSTALL-COMMAND are treated specially:\n\n  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation\n\nThe rest of the components are interpreted as arguments to that command (only\nBSD-compatible install options are recognized).\"\n        ;;\n\n      link)\n        $ECHO \\\n\"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...\n\nLink object files or libraries together to form another library, or to\ncreate an executable program.\n\nLINK-COMMAND is a command using the C compiler that you would use to create\na program from several object files.\n\nThe following components of LINK-COMMAND are treated specially:\n\n  -all-static       do not do any dynamic linking at all\n  -avoid-version    do not add a version suffix if possible\n  -bindir BINDIR    specify path to binaries directory (for systems where\n                    libraries must be found in the PATH setting at runtime)\n  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime\n  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols\n  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)\n  -export-symbols SYMFILE\n                    try to export only the symbols listed in SYMFILE\n  -export-symbols-regex REGEX\n                    try to export only the symbols matching REGEX\n  -LLIBDIR          search LIBDIR for required installed libraries\n  -lNAME            OUTPUT-FILE requires the installed library libNAME\n  -module           build a library that can dlopened\n  -no-fast-install  disable the fast-install mode\n  -no-install       link a not-installable executable\n  -no-undefined     declare that a library does not refer to external symbols\n  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects\n  -objectlist FILE  use a list of object files found in FILE to specify objects\n  -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)\n  -precious-files-regex REGEX\n                    don't remove output files matching REGEX\n  -release RELEASE  specify package release information\n  -rpath LIBDIR     the created library will eventually be installed in LIBDIR\n  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries\n  -shared           only do dynamic linking of libtool libraries\n  -shrext SUFFIX    override the standard shared library file extension\n  -static           do not do any dynamic linking of uninstalled libtool libraries\n  -static-libtool-libs\n                    do not do any dynamic linking of libtool libraries\n  -version-info CURRENT[:REVISION[:AGE]]\n                    specify library version info [each variable defaults to 0]\n  -weak LIBNAME     declare that the target provides the LIBNAME interface\n  -Wc,FLAG\n  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler\n  -Wl,FLAG\n  -Xlinker FLAG     pass linker-specific FLAG directly to the linker\n  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)\n\nAll other options (arguments beginning with '-') are ignored.\n\nEvery other argument is treated as a filename.  Files ending in '.la' are\ntreated as uninstalled libtool libraries, other files are standard or library\nobject files.\n\nIf the OUTPUT-FILE ends in '.la', then a libtool library is created,\nonly library objects ('.lo' files) may be specified, and '-rpath' is\nrequired, except when creating a convenience library.\n\nIf OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created\nusing 'ar' and 'ranlib', or on Windows using 'lib'.\n\nIf OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file\nis created, otherwise an executable program is created.\"\n        ;;\n\n      uninstall)\n        $ECHO \\\n\"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...\n\nRemove libraries from an installation directory.\n\nRM is the name of the program to use to delete files associated with each FILE\n(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed\nto RM.\n\nIf FILE is a libtool library, all the files associated with it are deleted.\nOtherwise, only FILE itself is deleted using RM.\"\n        ;;\n\n      *)\n        func_fatal_help \"invalid operation mode '$opt_mode'\"\n        ;;\n    esac\n\n    echo\n    $ECHO \"Try '$progname --help' for more information about other modes.\"\n}\n\n# Now that we've collected a possible --mode arg, show help if necessary\nif $opt_help; then\n  if test : = \"$opt_help\"; then\n    func_mode_help\n  else\n    {\n      func_help noexit\n      for opt_mode in compile link execute install finish uninstall clean; do\n\tfunc_mode_help\n      done\n    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'\n    {\n      func_help noexit\n      for opt_mode in compile link execute install finish uninstall clean; do\n\techo\n\tfunc_mode_help\n      done\n    } |\n    $SED '1d\n      /^When reporting/,/^Report/{\n\tH\n\td\n      }\n      $x\n      /information about other modes/d\n      /more detailed .*MODE/d\n      s/^Usage:.*--mode=\\([^ ]*\\) .*/Description of \\1 mode:/'\n  fi\n  exit $?\nfi\n\n\n# func_mode_execute arg...\nfunc_mode_execute ()\n{\n    $debug_cmd\n\n    # The first argument is the command name.\n    cmd=$nonopt\n    test -z \"$cmd\" && \\\n      func_fatal_help \"you must specify a COMMAND\"\n\n    # Handle -dlopen flags immediately.\n    for file in $opt_dlopen; do\n      test -f \"$file\" \\\n\t|| func_fatal_help \"'$file' is not a file\"\n\n      dir=\n      case $file in\n      *.la)\n\tfunc_resolve_sysroot \"$file\"\n\tfile=$func_resolve_sysroot_result\n\n\t# Check to see that this really is a libtool archive.\n\tfunc_lalib_unsafe_p \"$file\" \\\n\t  || func_fatal_help \"'$lib' is not a valid libtool archive\"\n\n\t# Read the libtool library.\n\tdlname=\n\tlibrary_names=\n\tfunc_source \"$file\"\n\n\t# Skip this library if it cannot be dlopened.\n\tif test -z \"$dlname\"; then\n\t  # Warn if it was a shared library.\n\t  test -n \"$library_names\" && \\\n\t    func_warning \"'$file' was not linked with '-export-dynamic'\"\n\t  continue\n\tfi\n\n\tfunc_dirname \"$file\" \"\" \".\"\n\tdir=$func_dirname_result\n\n\tif test -f \"$dir/$objdir/$dlname\"; then\n\t  func_append dir \"/$objdir\"\n\telse\n\t  if test ! -f \"$dir/$dlname\"; then\n\t    func_fatal_error \"cannot find '$dlname' in '$dir' or '$dir/$objdir'\"\n\t  fi\n\tfi\n\t;;\n\n      *.lo)\n\t# Just add the directory containing the .lo file.\n\tfunc_dirname \"$file\" \"\" \".\"\n\tdir=$func_dirname_result\n\t;;\n\n      *)\n\tfunc_warning \"'-dlopen' is ignored for non-libtool libraries and objects\"\n\tcontinue\n\t;;\n      esac\n\n      # Get the absolute pathname.\n      absdir=`cd \"$dir\" && pwd`\n      test -n \"$absdir\" && dir=$absdir\n\n      # Now add the directory to shlibpath_var.\n      if eval \"test -z \\\"\\$$shlibpath_var\\\"\"; then\n\teval \"$shlibpath_var=\\\"\\$dir\\\"\"\n      else\n\teval \"$shlibpath_var=\\\"\\$dir:\\$$shlibpath_var\\\"\"\n      fi\n    done\n\n    # This variable tells wrapper scripts just to set shlibpath_var\n    # rather than running their programs.\n    libtool_execute_magic=$magic\n\n    # Check if any of the arguments is a wrapper script.\n    args=\n    for file\n    do\n      case $file in\n      -* | *.la | *.lo ) ;;\n      *)\n\t# Do a test to see if this is really a libtool program.\n\tif func_ltwrapper_script_p \"$file\"; then\n\t  func_source \"$file\"\n\t  # Transform arg to wrapped name.\n\t  file=$progdir/$program\n\telif func_ltwrapper_executable_p \"$file\"; then\n\t  func_ltwrapper_scriptname \"$file\"\n\t  func_source \"$func_ltwrapper_scriptname_result\"\n\t  # Transform arg to wrapped name.\n\t  file=$progdir/$program\n\tfi\n\t;;\n      esac\n      # Quote arguments (to preserve shell metacharacters).\n      func_append_quoted args \"$file\"\n    done\n\n    if $opt_dry_run; then\n      # Display what would be done.\n      if test -n \"$shlibpath_var\"; then\n\teval \"\\$ECHO \\\"\\$shlibpath_var=\\$$shlibpath_var\\\"\"\n\techo \"export $shlibpath_var\"\n      fi\n      $ECHO \"$cmd$args\"\n      exit $EXIT_SUCCESS\n    else\n      if test -n \"$shlibpath_var\"; then\n\t# Export the shlibpath_var.\n\teval \"export $shlibpath_var\"\n      fi\n\n      # Restore saved environment variables\n      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES\n      do\n\teval \"if test \\\"\\${save_$lt_var+set}\\\" = set; then\n                $lt_var=\\$save_$lt_var; export $lt_var\n\t      else\n\t\t$lt_unset $lt_var\n\t      fi\"\n      done\n\n      # Now prepare to actually exec the command.\n      exec_cmd=\\$cmd$args\n    fi\n}\n\ntest execute = \"$opt_mode\" && func_mode_execute ${1+\"$@\"}\n\n\n# func_mode_finish arg...\nfunc_mode_finish ()\n{\n    $debug_cmd\n\n    libs=\n    libdirs=\n    admincmds=\n\n    for opt in \"$nonopt\" ${1+\"$@\"}\n    do\n      if test -d \"$opt\"; then\n\tfunc_append libdirs \" $opt\"\n\n      elif test -f \"$opt\"; then\n\tif func_lalib_unsafe_p \"$opt\"; then\n\t  func_append libs \" $opt\"\n\telse\n\t  func_warning \"'$opt' is not a valid libtool archive\"\n\tfi\n\n      else\n\tfunc_fatal_error \"invalid argument '$opt'\"\n      fi\n    done\n\n    if test -n \"$libs\"; then\n      if test -n \"$lt_sysroot\"; then\n        sysroot_regex=`$ECHO \"$lt_sysroot\" | $SED \"$sed_make_literal_regex\"`\n        sysroot_cmd=\"s/\\([ ']\\)$sysroot_regex/\\1/g;\"\n      else\n        sysroot_cmd=\n      fi\n\n      # Remove sysroot references\n      if $opt_dry_run; then\n        for lib in $libs; do\n          echo \"removing references to $lt_sysroot and '=' prefixes from $lib\"\n        done\n      else\n        tmpdir=`func_mktempdir`\n        for lib in $libs; do\n\t  $SED -e \"$sysroot_cmd s/\\([ ']-[LR]\\)=/\\1/g; s/\\([ ']\\)=/\\1/g\" $lib \\\n\t    > $tmpdir/tmp-la\n\t  mv -f $tmpdir/tmp-la $lib\n\tdone\n        ${RM}r \"$tmpdir\"\n      fi\n    fi\n\n    if test -n \"$finish_cmds$finish_eval\" && test -n \"$libdirs\"; then\n      for libdir in $libdirs; do\n\tif test -n \"$finish_cmds\"; then\n\t  # Do each command in the finish commands.\n\t  func_execute_cmds \"$finish_cmds\" 'admincmds=\"$admincmds\n'\"$cmd\"'\"'\n\tfi\n\tif test -n \"$finish_eval\"; then\n\t  # Do the single finish_eval.\n\t  eval cmds=\\\"$finish_eval\\\"\n\t  $opt_dry_run || eval \"$cmds\" || func_append admincmds \"\n       $cmds\"\n\tfi\n      done\n    fi\n\n    # Exit here if they wanted silent mode.\n    $opt_quiet && exit $EXIT_SUCCESS\n\n    if test -n \"$finish_cmds$finish_eval\" && test -n \"$libdirs\"; then\n      echo \"----------------------------------------------------------------------\"\n      echo \"Libraries have been installed in:\"\n      for libdir in $libdirs; do\n\t$ECHO \"   $libdir\"\n      done\n      echo\n      echo \"If you ever happen to want to link against installed libraries\"\n      echo \"in a given directory, LIBDIR, you must either use libtool, and\"\n      echo \"specify the full pathname of the library, or use the '-LLIBDIR'\"\n      echo \"flag during linking and do at least one of the following:\"\n      if test -n \"$shlibpath_var\"; then\n\techo \"   - add LIBDIR to the '$shlibpath_var' environment variable\"\n\techo \"     during execution\"\n      fi\n      if test -n \"$runpath_var\"; then\n\techo \"   - add LIBDIR to the '$runpath_var' environment variable\"\n\techo \"     during linking\"\n      fi\n      if test -n \"$hardcode_libdir_flag_spec\"; then\n\tlibdir=LIBDIR\n\teval flag=\\\"$hardcode_libdir_flag_spec\\\"\n\n\t$ECHO \"   - use the '$flag' linker flag\"\n      fi\n      if test -n \"$admincmds\"; then\n\t$ECHO \"   - have your system administrator run these commands:$admincmds\"\n      fi\n      if test -f /etc/ld.so.conf; then\n\techo \"   - have your system administrator add LIBDIR to '/etc/ld.so.conf'\"\n      fi\n      echo\n\n      echo \"See any operating system documentation about shared libraries for\"\n      case $host in\n\tsolaris2.[6789]|solaris2.1[0-9])\n\t  echo \"more information, such as the ld(1), crle(1) and ld.so(8) manual\"\n\t  echo \"pages.\"\n\t  ;;\n\t*)\n\t  echo \"more information, such as the ld(1) and ld.so(8) manual pages.\"\n\t  ;;\n      esac\n      echo \"----------------------------------------------------------------------\"\n    fi\n    exit $EXIT_SUCCESS\n}\n\ntest finish = \"$opt_mode\" && func_mode_finish ${1+\"$@\"}\n\n\n# func_mode_install arg...\nfunc_mode_install ()\n{\n    $debug_cmd\n\n    # There may be an optional sh(1) argument at the beginning of\n    # install_prog (especially on Windows NT).\n    if test \"$SHELL\" = \"$nonopt\" || test /bin/sh = \"$nonopt\" ||\n       # Allow the use of GNU shtool's install command.\n       case $nonopt in *shtool*) :;; *) false;; esac\n    then\n      # Aesthetically quote it.\n      func_quote_for_eval \"$nonopt\"\n      install_prog=\"$func_quote_for_eval_result \"\n      arg=$1\n      shift\n    else\n      install_prog=\n      arg=$nonopt\n    fi\n\n    # The real first argument should be the name of the installation program.\n    # Aesthetically quote it.\n    func_quote_for_eval \"$arg\"\n    func_append install_prog \"$func_quote_for_eval_result\"\n    install_shared_prog=$install_prog\n    case \" $install_prog \" in\n      *[\\\\\\ /]cp\\ *) install_cp=: ;;\n      *) install_cp=false ;;\n    esac\n\n    # We need to accept at least all the BSD install flags.\n    dest=\n    files=\n    opts=\n    prev=\n    install_type=\n    isdir=false\n    stripme=\n    no_mode=:\n    for arg\n    do\n      arg2=\n      if test -n \"$dest\"; then\n\tfunc_append files \" $dest\"\n\tdest=$arg\n\tcontinue\n      fi\n\n      case $arg in\n      -d) isdir=: ;;\n      -f)\n\tif $install_cp; then :; else\n\t  prev=$arg\n\tfi\n\t;;\n      -g | -m | -o)\n\tprev=$arg\n\t;;\n      -s)\n\tstripme=\" -s\"\n\tcontinue\n\t;;\n      -*)\n\t;;\n      *)\n\t# If the previous option needed an argument, then skip it.\n\tif test -n \"$prev\"; then\n\t  if test X-m = \"X$prev\" && test -n \"$install_override_mode\"; then\n\t    arg2=$install_override_mode\n\t    no_mode=false\n\t  fi\n\t  prev=\n\telse\n\t  dest=$arg\n\t  continue\n\tfi\n\t;;\n      esac\n\n      # Aesthetically quote the argument.\n      func_quote_for_eval \"$arg\"\n      func_append install_prog \" $func_quote_for_eval_result\"\n      if test -n \"$arg2\"; then\n\tfunc_quote_for_eval \"$arg2\"\n      fi\n      func_append install_shared_prog \" $func_quote_for_eval_result\"\n    done\n\n    test -z \"$install_prog\" && \\\n      func_fatal_help \"you must specify an install program\"\n\n    test -n \"$prev\" && \\\n      func_fatal_help \"the '$prev' option requires an argument\"\n\n    if test -n \"$install_override_mode\" && $no_mode; then\n      if $install_cp; then :; else\n\tfunc_quote_for_eval \"$install_override_mode\"\n\tfunc_append install_shared_prog \" -m $func_quote_for_eval_result\"\n      fi\n    fi\n\n    if test -z \"$files\"; then\n      if test -z \"$dest\"; then\n\tfunc_fatal_help \"no file or destination specified\"\n      else\n\tfunc_fatal_help \"you must specify a destination\"\n      fi\n    fi\n\n    # Strip any trailing slash from the destination.\n    func_stripname '' '/' \"$dest\"\n    dest=$func_stripname_result\n\n    # Check to see that the destination is a directory.\n    test -d \"$dest\" && isdir=:\n    if $isdir; then\n      destdir=$dest\n      destname=\n    else\n      func_dirname_and_basename \"$dest\" \"\" \".\"\n      destdir=$func_dirname_result\n      destname=$func_basename_result\n\n      # Not a directory, so check to see that there is only one file specified.\n      set dummy $files; shift\n      test \"$#\" -gt 1 && \\\n\tfunc_fatal_help \"'$dest' is not a directory\"\n    fi\n    case $destdir in\n    [\\\\/]* | [A-Za-z]:[\\\\/]*) ;;\n    *)\n      for file in $files; do\n\tcase $file in\n\t*.lo) ;;\n\t*)\n\t  func_fatal_help \"'$destdir' must be an absolute directory name\"\n\t  ;;\n\tesac\n      done\n      ;;\n    esac\n\n    # This variable tells wrapper scripts just to set variables rather\n    # than running their programs.\n    libtool_install_magic=$magic\n\n    staticlibs=\n    future_libdirs=\n    current_libdirs=\n    for file in $files; do\n\n      # Do each installation.\n      case $file in\n      *.$libext)\n\t# Do the static libraries later.\n\tfunc_append staticlibs \" $file\"\n\t;;\n\n      *.la)\n\tfunc_resolve_sysroot \"$file\"\n\tfile=$func_resolve_sysroot_result\n\n\t# Check to see that this really is a libtool archive.\n\tfunc_lalib_unsafe_p \"$file\" \\\n\t  || func_fatal_help \"'$file' is not a valid libtool archive\"\n\n\tlibrary_names=\n\told_library=\n\trelink_command=\n\tfunc_source \"$file\"\n\n\t# Add the libdir to current_libdirs if it is the destination.\n\tif test \"X$destdir\" = \"X$libdir\"; then\n\t  case \"$current_libdirs \" in\n\t  *\" $libdir \"*) ;;\n\t  *) func_append current_libdirs \" $libdir\" ;;\n\t  esac\n\telse\n\t  # Note the libdir as a future libdir.\n\t  case \"$future_libdirs \" in\n\t  *\" $libdir \"*) ;;\n\t  *) func_append future_libdirs \" $libdir\" ;;\n\t  esac\n\tfi\n\n\tfunc_dirname \"$file\" \"/\" \"\"\n\tdir=$func_dirname_result\n\tfunc_append dir \"$objdir\"\n\n\tif test -n \"$relink_command\"; then\n\t  # Determine the prefix the user has applied to our future dir.\n\t  inst_prefix_dir=`$ECHO \"$destdir\" | $SED -e \"s%$libdir\\$%%\"`\n\n\t  # Don't allow the user to place us outside of our expected\n\t  # location b/c this prevents finding dependent libraries that\n\t  # are installed to the same prefix.\n\t  # At present, this check doesn't affect windows .dll's that\n\t  # are installed into $libdir/../bin (currently, that works fine)\n\t  # but it's something to keep an eye on.\n\t  test \"$inst_prefix_dir\" = \"$destdir\" && \\\n\t    func_fatal_error \"error: cannot install '$file' to a directory not ending in $libdir\"\n\n\t  if test -n \"$inst_prefix_dir\"; then\n\t    # Stick the inst_prefix_dir data into the link command.\n\t    relink_command=`$ECHO \"$relink_command\" | $SED \"s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%\"`\n\t  else\n\t    relink_command=`$ECHO \"$relink_command\" | $SED \"s%@inst_prefix_dir@%%\"`\n\t  fi\n\n\t  func_warning \"relinking '$file'\"\n\t  func_show_eval \"$relink_command\" \\\n\t    'func_fatal_error \"error: relink '\\''$file'\\'' with the above command before installing it\"'\n\tfi\n\n\t# See the names of the shared library.\n\tset dummy $library_names; shift\n\tif test -n \"$1\"; then\n\t  realname=$1\n\t  shift\n\n\t  srcname=$realname\n\t  test -n \"$relink_command\" && srcname=${realname}T\n\n\t  # Install the shared library and build the symlinks.\n\t  func_show_eval \"$install_shared_prog $dir/$srcname $destdir/$realname\" \\\n\t      'exit $?'\n\t  tstripme=$stripme\n\t  case $host_os in\n\t  cygwin* | mingw* | pw32* | cegcc*)\n\t    case $realname in\n\t    *.dll.a)\n\t      tstripme=\n\t      ;;\n\t    esac\n\t    ;;\n\t  os2*)\n\t    case $realname in\n\t    *_dll.a)\n\t      tstripme=\n\t      ;;\n\t    esac\n\t    ;;\n\t  esac\n\t  if test -n \"$tstripme\" && test -n \"$striplib\"; then\n\t    func_show_eval \"$striplib $destdir/$realname\" 'exit $?'\n\t  fi\n\n\t  if test \"$#\" -gt 0; then\n\t    # Delete the old symlinks, and create new ones.\n\t    # Try 'ln -sf' first, because the 'ln' binary might depend on\n\t    # the symlink we replace!  Solaris /bin/ln does not understand -f,\n\t    # so we also need to try rm && ln -s.\n\t    for linkname\n\t    do\n\t      test \"$linkname\" != \"$realname\" \\\n\t\t&& func_show_eval \"(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })\"\n\t    done\n\t  fi\n\n\t  # Do each command in the postinstall commands.\n\t  lib=$destdir/$realname\n\t  func_execute_cmds \"$postinstall_cmds\" 'exit $?'\n\tfi\n\n\t# Install the pseudo-library for information purposes.\n\tfunc_basename \"$file\"\n\tname=$func_basename_result\n\tinstname=$dir/${name}i\n\tfunc_show_eval \"$install_prog $instname $destdir/$name\" 'exit $?'\n\n\t# Maybe install the static library, too.\n\ttest -n \"$old_library\" && func_append staticlibs \" $dir/$old_library\"\n\t;;\n\n      *.lo)\n\t# Install (i.e. copy) a libtool object.\n\n\t# Figure out destination file name, if it wasn't already specified.\n\tif test -n \"$destname\"; then\n\t  destfile=$destdir/$destname\n\telse\n\t  func_basename \"$file\"\n\t  destfile=$func_basename_result\n\t  destfile=$destdir/$destfile\n\tfi\n\n\t# Deduce the name of the destination old-style object file.\n\tcase $destfile in\n\t*.lo)\n\t  func_lo2o \"$destfile\"\n\t  staticdest=$func_lo2o_result\n\t  ;;\n\t*.$objext)\n\t  staticdest=$destfile\n\t  destfile=\n\t  ;;\n\t*)\n\t  func_fatal_help \"cannot copy a libtool object to '$destfile'\"\n\t  ;;\n\tesac\n\n\t# Install the libtool object if requested.\n\ttest -n \"$destfile\" && \\\n\t  func_show_eval \"$install_prog $file $destfile\" 'exit $?'\n\n\t# Install the old object if enabled.\n\tif test yes = \"$build_old_libs\"; then\n\t  # Deduce the name of the old-style object file.\n\t  func_lo2o \"$file\"\n\t  staticobj=$func_lo2o_result\n\t  func_show_eval \"$install_prog \\$staticobj \\$staticdest\" 'exit $?'\n\tfi\n\texit $EXIT_SUCCESS\n\t;;\n\n      *)\n\t# Figure out destination file name, if it wasn't already specified.\n\tif test -n \"$destname\"; then\n\t  destfile=$destdir/$destname\n\telse\n\t  func_basename \"$file\"\n\t  destfile=$func_basename_result\n\t  destfile=$destdir/$destfile\n\tfi\n\n\t# If the file is missing, and there is a .exe on the end, strip it\n\t# because it is most likely a libtool script we actually want to\n\t# install\n\tstripped_ext=\n\tcase $file in\n\t  *.exe)\n\t    if test ! -f \"$file\"; then\n\t      func_stripname '' '.exe' \"$file\"\n\t      file=$func_stripname_result\n\t      stripped_ext=.exe\n\t    fi\n\t    ;;\n\tesac\n\n\t# Do a test to see if this is really a libtool program.\n\tcase $host in\n\t*cygwin* | *mingw*)\n\t    if func_ltwrapper_executable_p \"$file\"; then\n\t      func_ltwrapper_scriptname \"$file\"\n\t      wrapper=$func_ltwrapper_scriptname_result\n\t    else\n\t      func_stripname '' '.exe' \"$file\"\n\t      wrapper=$func_stripname_result\n\t    fi\n\t    ;;\n\t*)\n\t    wrapper=$file\n\t    ;;\n\tesac\n\tif func_ltwrapper_script_p \"$wrapper\"; then\n\t  notinst_deplibs=\n\t  relink_command=\n\n\t  func_source \"$wrapper\"\n\n\t  # Check the variables that should have been set.\n\t  test -z \"$generated_by_libtool_version\" && \\\n\t    func_fatal_error \"invalid libtool wrapper script '$wrapper'\"\n\n\t  finalize=:\n\t  for lib in $notinst_deplibs; do\n\t    # Check to see that each library is installed.\n\t    libdir=\n\t    if test -f \"$lib\"; then\n\t      func_source \"$lib\"\n\t    fi\n\t    libfile=$libdir/`$ECHO \"$lib\" | $SED 's%^.*/%%g'`\n\t    if test -n \"$libdir\" && test ! -f \"$libfile\"; then\n\t      func_warning \"'$lib' has not been installed in '$libdir'\"\n\t      finalize=false\n\t    fi\n\t  done\n\n\t  relink_command=\n\t  func_source \"$wrapper\"\n\n\t  outputname=\n\t  if test no = \"$fast_install\" && test -n \"$relink_command\"; then\n\t    $opt_dry_run || {\n\t      if $finalize; then\n\t        tmpdir=`func_mktempdir`\n\t\tfunc_basename \"$file$stripped_ext\"\n\t\tfile=$func_basename_result\n\t        outputname=$tmpdir/$file\n\t        # Replace the output file specification.\n\t        relink_command=`$ECHO \"$relink_command\" | $SED 's%@OUTPUT@%'\"$outputname\"'%g'`\n\n\t        $opt_quiet || {\n\t          func_quote_for_expand \"$relink_command\"\n\t\t  eval \"func_echo $func_quote_for_expand_result\"\n\t        }\n\t        if eval \"$relink_command\"; then :\n\t          else\n\t\t  func_error \"error: relink '$file' with the above command before installing it\"\n\t\t  $opt_dry_run || ${RM}r \"$tmpdir\"\n\t\t  continue\n\t        fi\n\t        file=$outputname\n\t      else\n\t        func_warning \"cannot relink '$file'\"\n\t      fi\n\t    }\n\t  else\n\t    # Install the binary that we compiled earlier.\n\t    file=`$ECHO \"$file$stripped_ext\" | $SED \"s%\\([^/]*\\)$%$objdir/\\1%\"`\n\t  fi\n\tfi\n\n\t# remove .exe since cygwin /usr/bin/install will append another\n\t# one anyway\n\tcase $install_prog,$host in\n\t*/usr/bin/install*,*cygwin*)\n\t  case $file:$destfile in\n\t  *.exe:*.exe)\n\t    # this is ok\n\t    ;;\n\t  *.exe:*)\n\t    destfile=$destfile.exe\n\t    ;;\n\t  *:*.exe)\n\t    func_stripname '' '.exe' \"$destfile\"\n\t    destfile=$func_stripname_result\n\t    ;;\n\t  esac\n\t  ;;\n\tesac\n\tfunc_show_eval \"$install_prog\\$stripme \\$file \\$destfile\" 'exit $?'\n\t$opt_dry_run || if test -n \"$outputname\"; then\n\t  ${RM}r \"$tmpdir\"\n\tfi\n\t;;\n      esac\n    done\n\n    for file in $staticlibs; do\n      func_basename \"$file\"\n      name=$func_basename_result\n\n      # Set up the ranlib parameters.\n      oldlib=$destdir/$name\n      func_to_tool_file \"$oldlib\" func_convert_file_msys_to_w32\n      tool_oldlib=$func_to_tool_file_result\n\n      func_show_eval \"$install_prog \\$file \\$oldlib\" 'exit $?'\n\n      if test -n \"$stripme\" && test -n \"$old_striplib\"; then\n\tfunc_show_eval \"$old_striplib $tool_oldlib\" 'exit $?'\n      fi\n\n      # Do each command in the postinstall commands.\n      func_execute_cmds \"$old_postinstall_cmds\" 'exit $?'\n    done\n\n    test -n \"$future_libdirs\" && \\\n      func_warning \"remember to run '$progname --finish$future_libdirs'\"\n\n    if test -n \"$current_libdirs\"; then\n      # Maybe just do a dry run.\n      $opt_dry_run && current_libdirs=\" -n$current_libdirs\"\n      exec_cmd='$SHELL \"$progpath\" $preserve_args --finish$current_libdirs'\n    else\n      exit $EXIT_SUCCESS\n    fi\n}\n\ntest install = \"$opt_mode\" && func_mode_install ${1+\"$@\"}\n\n\n# func_generate_dlsyms outputname originator pic_p\n# Extract symbols from dlprefiles and create ${outputname}S.o with\n# a dlpreopen symbol table.\nfunc_generate_dlsyms ()\n{\n    $debug_cmd\n\n    my_outputname=$1\n    my_originator=$2\n    my_pic_p=${3-false}\n    my_prefix=`$ECHO \"$my_originator\" | $SED 's%[^a-zA-Z0-9]%_%g'`\n    my_dlsyms=\n\n    if test -n \"$dlfiles$dlprefiles\" || test no != \"$dlself\"; then\n      if test -n \"$NM\" && test -n \"$global_symbol_pipe\"; then\n\tmy_dlsyms=${my_outputname}S.c\n      else\n\tfunc_error \"not configured to extract global symbols from dlpreopened files\"\n      fi\n    fi\n\n    if test -n \"$my_dlsyms\"; then\n      case $my_dlsyms in\n      \"\") ;;\n      *.c)\n\t# Discover the nlist of each of the dlfiles.\n\tnlist=$output_objdir/$my_outputname.nm\n\n\tfunc_show_eval \"$RM $nlist ${nlist}S ${nlist}T\"\n\n\t# Parse the name list into a source file.\n\tfunc_verbose \"creating $output_objdir/$my_dlsyms\"\n\n\t$opt_dry_run || $ECHO > \"$output_objdir/$my_dlsyms\" \"\\\n/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */\n/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */\n\n#ifdef __cplusplus\nextern \\\"C\\\" {\n#endif\n\n#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))\n#pragma GCC diagnostic ignored \\\"-Wstrict-prototypes\\\"\n#endif\n\n/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */\n#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE\n/* DATA imports from DLLs on WIN32 can't be const, because runtime\n   relocations are performed -- see ld's documentation on pseudo-relocs.  */\n# define LT_DLSYM_CONST\n#elif defined __osf__\n/* This system does not cope well with relocations in const data.  */\n# define LT_DLSYM_CONST\n#else\n# define LT_DLSYM_CONST const\n#endif\n\n#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)\n\n/* External symbol declarations for the compiler. */\\\n\"\n\n\tif test yes = \"$dlself\"; then\n\t  func_verbose \"generating symbol list for '$output'\"\n\n\t  $opt_dry_run || echo ': @PROGRAM@ ' > \"$nlist\"\n\n\t  # Add our own program objects to the symbol list.\n\t  progfiles=`$ECHO \"$objs$old_deplibs\" | $SP2NL | $SED \"$lo2o\" | $NL2SP`\n\t  for progfile in $progfiles; do\n\t    func_to_tool_file \"$progfile\" func_convert_file_msys_to_w32\n\t    func_verbose \"extracting global C symbols from '$func_to_tool_file_result'\"\n\t    $opt_dry_run || eval \"$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'\"\n\t  done\n\n\t  if test -n \"$exclude_expsyms\"; then\n\t    $opt_dry_run || {\n\t      eval '$EGREP -v \" ($exclude_expsyms)$\" \"$nlist\" > \"$nlist\"T'\n\t      eval '$MV \"$nlist\"T \"$nlist\"'\n\t    }\n\t  fi\n\n\t  if test -n \"$export_symbols_regex\"; then\n\t    $opt_dry_run || {\n\t      eval '$EGREP -e \"$export_symbols_regex\" \"$nlist\" > \"$nlist\"T'\n\t      eval '$MV \"$nlist\"T \"$nlist\"'\n\t    }\n\t  fi\n\n\t  # Prepare the list of exported symbols\n\t  if test -z \"$export_symbols\"; then\n\t    export_symbols=$output_objdir/$outputname.exp\n\t    $opt_dry_run || {\n\t      $RM $export_symbols\n\t      eval \"$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \\(.*\\)$/\\1/p' \"'< \"$nlist\" > \"$export_symbols\"'\n\t      case $host in\n\t      *cygwin* | *mingw* | *cegcc* )\n                eval \"echo EXPORTS \"'> \"$output_objdir/$outputname.def\"'\n                eval 'cat \"$export_symbols\" >> \"$output_objdir/$outputname.def\"'\n\t        ;;\n\t      esac\n\t    }\n\t  else\n\t    $opt_dry_run || {\n\t      eval \"$SED -e 's/\\([].[*^$]\\)/\\\\\\\\\\1/g' -e 's/^/ /' -e 's/$/$/'\"' < \"$export_symbols\" > \"$output_objdir/$outputname.exp\"'\n\t      eval '$GREP -f \"$output_objdir/$outputname.exp\" < \"$nlist\" > \"$nlist\"T'\n\t      eval '$MV \"$nlist\"T \"$nlist\"'\n\t      case $host in\n\t        *cygwin* | *mingw* | *cegcc* )\n\t          eval \"echo EXPORTS \"'> \"$output_objdir/$outputname.def\"'\n\t          eval 'cat \"$nlist\" >> \"$output_objdir/$outputname.def\"'\n\t          ;;\n\t      esac\n\t    }\n\t  fi\n\tfi\n\n\tfor dlprefile in $dlprefiles; do\n\t  func_verbose \"extracting global C symbols from '$dlprefile'\"\n\t  func_basename \"$dlprefile\"\n\t  name=$func_basename_result\n          case $host in\n\t    *cygwin* | *mingw* | *cegcc* )\n\t      # if an import library, we need to obtain dlname\n\t      if func_win32_import_lib_p \"$dlprefile\"; then\n\t        func_tr_sh \"$dlprefile\"\n\t        eval \"curr_lafile=\\$libfile_$func_tr_sh_result\"\n\t        dlprefile_dlbasename=\n\t        if test -n \"$curr_lafile\" && func_lalib_p \"$curr_lafile\"; then\n\t          # Use subshell, to avoid clobbering current variable values\n\t          dlprefile_dlname=`source \"$curr_lafile\" && echo \"$dlname\"`\n\t          if test -n \"$dlprefile_dlname\"; then\n\t            func_basename \"$dlprefile_dlname\"\n\t            dlprefile_dlbasename=$func_basename_result\n\t          else\n\t            # no lafile. user explicitly requested -dlpreopen <import library>.\n\t            $sharedlib_from_linklib_cmd \"$dlprefile\"\n\t            dlprefile_dlbasename=$sharedlib_from_linklib_result\n\t          fi\n\t        fi\n\t        $opt_dry_run || {\n\t          if test -n \"$dlprefile_dlbasename\"; then\n\t            eval '$ECHO \": $dlprefile_dlbasename\" >> \"$nlist\"'\n\t          else\n\t            func_warning \"Could not compute DLL name from $name\"\n\t            eval '$ECHO \": $name \" >> \"$nlist\"'\n\t          fi\n\t          func_to_tool_file \"$dlprefile\" func_convert_file_msys_to_w32\n\t          eval \"$NM \\\"$func_to_tool_file_result\\\" 2>/dev/null | $global_symbol_pipe |\n\t            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'\"\n\t        }\n\t      else # not an import lib\n\t        $opt_dry_run || {\n\t          eval '$ECHO \": $name \" >> \"$nlist\"'\n\t          func_to_tool_file \"$dlprefile\" func_convert_file_msys_to_w32\n\t          eval \"$NM \\\"$func_to_tool_file_result\\\" 2>/dev/null | $global_symbol_pipe >> '$nlist'\"\n\t        }\n\t      fi\n\t    ;;\n\t    *)\n\t      $opt_dry_run || {\n\t        eval '$ECHO \": $name \" >> \"$nlist\"'\n\t        func_to_tool_file \"$dlprefile\" func_convert_file_msys_to_w32\n\t        eval \"$NM \\\"$func_to_tool_file_result\\\" 2>/dev/null | $global_symbol_pipe >> '$nlist'\"\n\t      }\n\t    ;;\n          esac\n\tdone\n\n\t$opt_dry_run || {\n\t  # Make sure we have at least an empty file.\n\t  test -f \"$nlist\" || : > \"$nlist\"\n\n\t  if test -n \"$exclude_expsyms\"; then\n\t    $EGREP -v \" ($exclude_expsyms)$\" \"$nlist\" > \"$nlist\"T\n\t    $MV \"$nlist\"T \"$nlist\"\n\t  fi\n\n\t  # Try sorting and uniquifying the output.\n\t  if $GREP -v \"^: \" < \"$nlist\" |\n\t      if sort -k 3 </dev/null >/dev/null 2>&1; then\n\t\tsort -k 3\n\t      else\n\t\tsort +2\n\t      fi |\n\t      uniq > \"$nlist\"S; then\n\t    :\n\t  else\n\t    $GREP -v \"^: \" < \"$nlist\" > \"$nlist\"S\n\t  fi\n\n\t  if test -f \"$nlist\"S; then\n\t    eval \"$global_symbol_to_cdecl\"' < \"$nlist\"S >> \"$output_objdir/$my_dlsyms\"'\n\t  else\n\t    echo '/* NONE */' >> \"$output_objdir/$my_dlsyms\"\n\t  fi\n\n\t  func_show_eval '$RM \"${nlist}I\"'\n\t  if test -n \"$global_symbol_to_import\"; then\n\t    eval \"$global_symbol_to_import\"' < \"$nlist\"S > \"$nlist\"I'\n\t  fi\n\n\t  echo >> \"$output_objdir/$my_dlsyms\" \"\\\n\n/* The mapping between symbol names and symbols.  */\ntypedef struct {\n  const char *name;\n  void *address;\n} lt_dlsymlist;\nextern LT_DLSYM_CONST lt_dlsymlist\nlt_${my_prefix}_LTX_preloaded_symbols[];\\\n\"\n\n\t  if test -s \"$nlist\"I; then\n\t    echo >> \"$output_objdir/$my_dlsyms\" \"\\\nstatic void lt_syminit(void)\n{\n  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;\n  for (; symbol->name; ++symbol)\n    {\"\n\t    $SED 's/.*/      if (STREQ (symbol->name, \\\"&\\\")) symbol->address = (void *) \\&&;/' < \"$nlist\"I >> \"$output_objdir/$my_dlsyms\"\n\t    echo >> \"$output_objdir/$my_dlsyms\" \"\\\n    }\n}\"\n\t  fi\n\t  echo >> \"$output_objdir/$my_dlsyms\" \"\\\nLT_DLSYM_CONST lt_dlsymlist\nlt_${my_prefix}_LTX_preloaded_symbols[] =\n{ {\\\"$my_originator\\\", (void *) 0},\"\n\n\t  if test -s \"$nlist\"I; then\n\t    echo >> \"$output_objdir/$my_dlsyms\" \"\\\n  {\\\"@INIT@\\\", (void *) &lt_syminit},\"\n\t  fi\n\n\t  case $need_lib_prefix in\n\t  no)\n\t    eval \"$global_symbol_to_c_name_address\" < \"$nlist\" >> \"$output_objdir/$my_dlsyms\"\n\t    ;;\n\t  *)\n\t    eval \"$global_symbol_to_c_name_address_lib_prefix\" < \"$nlist\" >> \"$output_objdir/$my_dlsyms\"\n\t    ;;\n\t  esac\n\t  echo >> \"$output_objdir/$my_dlsyms\" \"\\\n  {0, (void *) 0}\n};\n\n/* This works around a problem in FreeBSD linker */\n#ifdef FREEBSD_WORKAROUND\nstatic const void *lt_preloaded_setup() {\n  return lt_${my_prefix}_LTX_preloaded_symbols;\n}\n#endif\n\n#ifdef __cplusplus\n}\n#endif\\\n\"\n\t} # !$opt_dry_run\n\n\tpic_flag_for_symtable=\n\tcase \"$compile_command \" in\n\t*\" -static \"*) ;;\n\t*)\n\t  case $host in\n\t  # compiling the symbol table file with pic_flag works around\n\t  # a FreeBSD bug that causes programs to crash when -lm is\n\t  # linked before any other PIC object.  But we must not use\n\t  # pic_flag when linking with -static.  The problem exists in\n\t  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.\n\t  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)\n\t    pic_flag_for_symtable=\" $pic_flag -DFREEBSD_WORKAROUND\" ;;\n\t  *-*-hpux*)\n\t    pic_flag_for_symtable=\" $pic_flag\"  ;;\n\t  *)\n\t    $my_pic_p && pic_flag_for_symtable=\" $pic_flag\"\n\t    ;;\n\t  esac\n\t  ;;\n\tesac\n\tsymtab_cflags=\n\tfor arg in $LTCFLAGS; do\n\t  case $arg in\n\t  -pie | -fpie | -fPIE) ;;\n\t  *) func_append symtab_cflags \" $arg\" ;;\n\t  esac\n\tdone\n\n\t# Now compile the dynamic symbol file.\n\tfunc_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable \"$my_dlsyms\")' 'exit $?'\n\n\t# Clean up the generated files.\n\tfunc_show_eval '$RM \"$output_objdir/$my_dlsyms\" \"$nlist\" \"${nlist}S\" \"${nlist}T\" \"${nlist}I\"'\n\n\t# Transform the symbol file into the correct name.\n\tsymfileobj=$output_objdir/${my_outputname}S.$objext\n\tcase $host in\n\t*cygwin* | *mingw* | *cegcc* )\n\t  if test -f \"$output_objdir/$my_outputname.def\"; then\n\t    compile_command=`$ECHO \"$compile_command\" | $SED \"s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%\"`\n\t    finalize_command=`$ECHO \"$finalize_command\" | $SED \"s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%\"`\n\t  else\n\t    compile_command=`$ECHO \"$compile_command\" | $SED \"s%@SYMFILE@%$symfileobj%\"`\n\t    finalize_command=`$ECHO \"$finalize_command\" | $SED \"s%@SYMFILE@%$symfileobj%\"`\n\t  fi\n\t  ;;\n\t*)\n\t  compile_command=`$ECHO \"$compile_command\" | $SED \"s%@SYMFILE@%$symfileobj%\"`\n\t  finalize_command=`$ECHO \"$finalize_command\" | $SED \"s%@SYMFILE@%$symfileobj%\"`\n\t  ;;\n\tesac\n\t;;\n      *)\n\tfunc_fatal_error \"unknown suffix for '$my_dlsyms'\"\n\t;;\n      esac\n    else\n      # We keep going just in case the user didn't refer to\n      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe\n      # really was required.\n\n      # Nullify the symbol file.\n      compile_command=`$ECHO \"$compile_command\" | $SED \"s% @SYMFILE@%%\"`\n      finalize_command=`$ECHO \"$finalize_command\" | $SED \"s% @SYMFILE@%%\"`\n    fi\n}\n\n# func_cygming_gnu_implib_p ARG\n# This predicate returns with zero status (TRUE) if\n# ARG is a GNU/binutils-style import library. Returns\n# with nonzero status (FALSE) otherwise.\nfunc_cygming_gnu_implib_p ()\n{\n  $debug_cmd\n\n  func_to_tool_file \"$1\" func_convert_file_msys_to_w32\n  func_cygming_gnu_implib_tmp=`$NM \"$func_to_tool_file_result\" | eval \"$global_symbol_pipe\" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`\n  test -n \"$func_cygming_gnu_implib_tmp\"\n}\n\n# func_cygming_ms_implib_p ARG\n# This predicate returns with zero status (TRUE) if\n# ARG is an MS-style import library. Returns\n# with nonzero status (FALSE) otherwise.\nfunc_cygming_ms_implib_p ()\n{\n  $debug_cmd\n\n  func_to_tool_file \"$1\" func_convert_file_msys_to_w32\n  func_cygming_ms_implib_tmp=`$NM \"$func_to_tool_file_result\" | eval \"$global_symbol_pipe\" | $GREP '_NULL_IMPORT_DESCRIPTOR'`\n  test -n \"$func_cygming_ms_implib_tmp\"\n}\n\n# func_win32_libid arg\n# return the library type of file 'arg'\n#\n# Need a lot of goo to handle *both* DLLs and import libs\n# Has to be a shell function in order to 'eat' the argument\n# that is supplied when $file_magic_command is called.\n# Despite the name, also deal with 64 bit binaries.\nfunc_win32_libid ()\n{\n  $debug_cmd\n\n  win32_libid_type=unknown\n  win32_fileres=`file -L $1 2>/dev/null`\n  case $win32_fileres in\n  *ar\\ archive\\ import\\ library*) # definitely import\n    win32_libid_type=\"x86 archive import\"\n    ;;\n  *ar\\ archive*) # could be an import, or static\n    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.\n    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |\n       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then\n      case $nm_interface in\n      \"MS dumpbin\")\n\tif func_cygming_ms_implib_p \"$1\" ||\n\t   func_cygming_gnu_implib_p \"$1\"\n\tthen\n\t  win32_nmres=import\n\telse\n\t  win32_nmres=\n\tfi\n\t;;\n      *)\n\tfunc_to_tool_file \"$1\" func_convert_file_msys_to_w32\n\twin32_nmres=`eval $NM -f posix -A \\\"$func_to_tool_file_result\\\" |\n\t  $SED -n -e '\n\t    1,100{\n\t\t/ I /{\n\t\t    s|.*|import|\n\t\t    p\n\t\t    q\n\t\t}\n\t    }'`\n\t;;\n      esac\n      case $win32_nmres in\n      import*)  win32_libid_type=\"x86 archive import\";;\n      *)        win32_libid_type=\"x86 archive static\";;\n      esac\n    fi\n    ;;\n  *DLL*)\n    win32_libid_type=\"x86 DLL\"\n    ;;\n  *executable*) # but shell scripts are \"executable\" too...\n    case $win32_fileres in\n    *MS\\ Windows\\ PE\\ Intel*)\n      win32_libid_type=\"x86 DLL\"\n      ;;\n    esac\n    ;;\n  esac\n  $ECHO \"$win32_libid_type\"\n}\n\n# func_cygming_dll_for_implib ARG\n#\n# Platform-specific function to extract the\n# name of the DLL associated with the specified\n# import library ARG.\n# Invoked by eval'ing the libtool variable\n#    $sharedlib_from_linklib_cmd\n# Result is available in the variable\n#    $sharedlib_from_linklib_result\nfunc_cygming_dll_for_implib ()\n{\n  $debug_cmd\n\n  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify \"$1\"`\n}\n\n# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs\n#\n# The is the core of a fallback implementation of a\n# platform-specific function to extract the name of the\n# DLL associated with the specified import library LIBNAME.\n#\n# SECTION_NAME is either .idata$6 or .idata$7, depending\n# on the platform and compiler that created the implib.\n#\n# Echos the name of the DLL associated with the\n# specified import library.\nfunc_cygming_dll_for_implib_fallback_core ()\n{\n  $debug_cmd\n\n  match_literal=`$ECHO \"$1\" | $SED \"$sed_make_literal_regex\"`\n  $OBJDUMP -s --section \"$1\" \"$2\" 2>/dev/null |\n    $SED '/^Contents of section '\"$match_literal\"':/{\n      # Place marker at beginning of archive member dllname section\n      s/.*/====MARK====/\n      p\n      d\n    }\n    # These lines can sometimes be longer than 43 characters, but\n    # are always uninteresting\n    /:[\t ]*file format pe[i]\\{,1\\}-/d\n    /^In archive [^:]*:/d\n    # Ensure marker is printed\n    /^====MARK====/p\n    # Remove all lines with less than 43 characters\n    /^.\\{43\\}/!d\n    # From remaining lines, remove first 43 characters\n    s/^.\\{43\\}//' |\n    $SED -n '\n      # Join marker and all lines until next marker into a single line\n      /^====MARK====/ b para\n      H\n      $ b para\n      b\n      :para\n      x\n      s/\\n//g\n      # Remove the marker\n      s/^====MARK====//\n      # Remove trailing dots and whitespace\n      s/[\\. \\t]*$//\n      # Print\n      /./p' |\n    # we now have a list, one entry per line, of the stringified\n    # contents of the appropriate section of all members of the\n    # archive that possess that section. Heuristic: eliminate\n    # all those that have a first or second character that is\n    # a '.' (that is, objdump's representation of an unprintable\n    # character.) This should work for all archives with less than\n    # 0x302f exports -- but will fail for DLLs whose name actually\n    # begins with a literal '.' or a single character followed by\n    # a '.'.\n    #\n    # Of those that remain, print the first one.\n    $SED -e '/^\\./d;/^.\\./d;q'\n}\n\n# func_cygming_dll_for_implib_fallback ARG\n# Platform-specific function to extract the\n# name of the DLL associated with the specified\n# import library ARG.\n#\n# This fallback implementation is for use when $DLLTOOL\n# does not support the --identify-strict option.\n# Invoked by eval'ing the libtool variable\n#    $sharedlib_from_linklib_cmd\n# Result is available in the variable\n#    $sharedlib_from_linklib_result\nfunc_cygming_dll_for_implib_fallback ()\n{\n  $debug_cmd\n\n  if func_cygming_gnu_implib_p \"$1\"; then\n    # binutils import library\n    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' \"$1\"`\n  elif func_cygming_ms_implib_p \"$1\"; then\n    # ms-generated import library\n    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' \"$1\"`\n  else\n    # unknown\n    sharedlib_from_linklib_result=\n  fi\n}\n\n\n# func_extract_an_archive dir oldlib\nfunc_extract_an_archive ()\n{\n    $debug_cmd\n\n    f_ex_an_ar_dir=$1; shift\n    f_ex_an_ar_oldlib=$1\n    if test yes = \"$lock_old_archive_extraction\"; then\n      lockfile=$f_ex_an_ar_oldlib.lock\n      until $opt_dry_run || ln \"$progpath\" \"$lockfile\" 2>/dev/null; do\n\tfunc_echo \"Waiting for $lockfile to be removed\"\n\tsleep 2\n      done\n    fi\n    func_show_eval \"(cd \\$f_ex_an_ar_dir && $AR x \\\"\\$f_ex_an_ar_oldlib\\\")\" \\\n\t\t   'stat=$?; rm -f \"$lockfile\"; exit $stat'\n    if test yes = \"$lock_old_archive_extraction\"; then\n      $opt_dry_run || rm -f \"$lockfile\"\n    fi\n    if ($AR t \"$f_ex_an_ar_oldlib\" | sort | sort -uc >/dev/null 2>&1); then\n     :\n    else\n      func_fatal_error \"object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib\"\n    fi\n}\n\n\n# func_extract_archives gentop oldlib ...\nfunc_extract_archives ()\n{\n    $debug_cmd\n\n    my_gentop=$1; shift\n    my_oldlibs=${1+\"$@\"}\n    my_oldobjs=\n    my_xlib=\n    my_xabs=\n    my_xdir=\n\n    for my_xlib in $my_oldlibs; do\n      # Extract the objects.\n      case $my_xlib in\n\t[\\\\/]* | [A-Za-z]:[\\\\/]*) my_xabs=$my_xlib ;;\n\t*) my_xabs=`pwd`\"/$my_xlib\" ;;\n      esac\n      func_basename \"$my_xlib\"\n      my_xlib=$func_basename_result\n      my_xlib_u=$my_xlib\n      while :; do\n        case \" $extracted_archives \" in\n\t*\" $my_xlib_u \"*)\n\t  func_arith $extracted_serial + 1\n\t  extracted_serial=$func_arith_result\n\t  my_xlib_u=lt$extracted_serial-$my_xlib ;;\n\t*) break ;;\n\tesac\n      done\n      extracted_archives=\"$extracted_archives $my_xlib_u\"\n      my_xdir=$my_gentop/$my_xlib_u\n\n      func_mkdir_p \"$my_xdir\"\n\n      case $host in\n      *-darwin*)\n\tfunc_verbose \"Extracting $my_xabs\"\n\t# Do not bother doing anything if just a dry run\n\t$opt_dry_run || {\n\t  darwin_orig_dir=`pwd`\n\t  cd $my_xdir || exit $?\n\t  darwin_archive=$my_xabs\n\t  darwin_curdir=`pwd`\n\t  func_basename \"$darwin_archive\"\n\t  darwin_base_archive=$func_basename_result\n\t  darwin_arches=`$LIPO -info \"$darwin_archive\" 2>/dev/null | $GREP Architectures 2>/dev/null || true`\n\t  if test -n \"$darwin_arches\"; then\n\t    darwin_arches=`$ECHO \"$darwin_arches\" | $SED -e 's/.*are://'`\n\t    darwin_arch=\n\t    func_verbose \"$darwin_base_archive has multiple architectures $darwin_arches\"\n\t    for darwin_arch in  $darwin_arches; do\n\t      func_mkdir_p \"unfat-$$/$darwin_base_archive-$darwin_arch\"\n\t      $LIPO -thin $darwin_arch -output \"unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive\" \"$darwin_archive\"\n\t      cd \"unfat-$$/$darwin_base_archive-$darwin_arch\"\n\t      func_extract_an_archive \"`pwd`\" \"$darwin_base_archive\"\n\t      cd \"$darwin_curdir\"\n\t      $RM \"unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive\"\n\t    done # $darwin_arches\n            ## Okay now we've a bunch of thin objects, gotta fatten them up :)\n\t    darwin_filelist=`find unfat-$$ -type f -name \\*.o -print -o -name \\*.lo -print | $SED -e \"$sed_basename\" | sort -u`\n\t    darwin_file=\n\t    darwin_files=\n\t    for darwin_file in $darwin_filelist; do\n\t      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`\n\t      $LIPO -create -output \"$darwin_file\" $darwin_files\n\t    done # $darwin_filelist\n\t    $RM -rf unfat-$$\n\t    cd \"$darwin_orig_dir\"\n\t  else\n\t    cd $darwin_orig_dir\n\t    func_extract_an_archive \"$my_xdir\" \"$my_xabs\"\n\t  fi # $darwin_arches\n\t} # !$opt_dry_run\n\t;;\n      *)\n        func_extract_an_archive \"$my_xdir\" \"$my_xabs\"\n\t;;\n      esac\n      my_oldobjs=\"$my_oldobjs \"`find $my_xdir -name \\*.$objext -print -o -name \\*.lo -print | sort | $NL2SP`\n    done\n\n    func_extract_archives_result=$my_oldobjs\n}\n\n\n# func_emit_wrapper [arg=no]\n#\n# Emit a libtool wrapper script on stdout.\n# Don't directly open a file because we may want to\n# incorporate the script contents within a cygwin/mingw\n# wrapper executable.  Must ONLY be called from within\n# func_mode_link because it depends on a number of variables\n# set therein.\n#\n# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\n# variable will take.  If 'yes', then the emitted script\n# will assume that the directory where it is stored is\n# the $objdir directory.  This is a cygwin/mingw-specific\n# behavior.\nfunc_emit_wrapper ()\n{\n\tfunc_emit_wrapper_arg1=${1-no}\n\n\t$ECHO \"\\\n#! $SHELL\n\n# $output - temporary wrapper script for $objdir/$outputname\n# Generated by $PROGRAM (GNU $PACKAGE) $VERSION\n#\n# The $output program cannot be directly executed until all the libtool\n# libraries that it depends on are installed.\n#\n# This wrapper script should never be moved out of the build directory.\n# If it is, it will not operate correctly.\n\n# Sed substitution that helps us do robust quoting.  It backslashifies\n# metacharacters that are still active within double-quoted strings.\nsed_quote_subst='$sed_quote_subst'\n\n# Be Bourne compatible\nif test -n \\\"\\${ZSH_VERSION+set}\\\" && (emulate sh) >/dev/null 2>&1; then\n  emulate sh\n  NULLCMD=:\n  # Zsh 3.x and 4.x performs word splitting on \\${1+\\\"\\$@\\\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '\\${1+\\\"\\$@\\\"}'='\\\"\\$@\\\"'\n  setopt NO_GLOB_SUBST\nelse\n  case \\`(set -o) 2>/dev/null\\` in *posix*) set -o posix;; esac\nfi\nBIN_SH=xpg4; export BIN_SH # for Tru64\nDUALCASE=1; export DUALCASE # for MKS sh\n\n# The HP-UX ksh and POSIX shell print the target directory to stdout\n# if CDPATH is set.\n(unset CDPATH) >/dev/null 2>&1 && unset CDPATH\n\nrelink_command=\\\"$relink_command\\\"\n\n# This environment variable determines our operation mode.\nif test \\\"\\$libtool_install_magic\\\" = \\\"$magic\\\"; then\n  # install mode needs the following variables:\n  generated_by_libtool_version='$macro_version'\n  notinst_deplibs='$notinst_deplibs'\nelse\n  # When we are sourced in execute mode, \\$file and \\$ECHO are already set.\n  if test \\\"\\$libtool_execute_magic\\\" != \\\"$magic\\\"; then\n    file=\\\"\\$0\\\"\"\n\n    qECHO=`$ECHO \"$ECHO\" | $SED \"$sed_quote_subst\"`\n    $ECHO \"\\\n\n# A function that is used when there is no print builtin or printf.\nfunc_fallback_echo ()\n{\n  eval 'cat <<_LTECHO_EOF\n\\$1\n_LTECHO_EOF'\n}\n    ECHO=\\\"$qECHO\\\"\n  fi\n\n# Very basic option parsing. These options are (a) specific to\n# the libtool wrapper, (b) are identical between the wrapper\n# /script/ and the wrapper /executable/ that is used only on\n# windows platforms, and (c) all begin with the string \"--lt-\"\n# (application programs are unlikely to have options that match\n# this pattern).\n#\n# There are only two supported options: --lt-debug and\n# --lt-dump-script. There is, deliberately, no --lt-help.\n#\n# The first argument to this parsing function should be the\n# script's $0 value, followed by \"$@\".\nlt_option_debug=\nfunc_parse_lt_options ()\n{\n  lt_script_arg0=\\$0\n  shift\n  for lt_opt\n  do\n    case \\\"\\$lt_opt\\\" in\n    --lt-debug) lt_option_debug=1 ;;\n    --lt-dump-script)\n        lt_dump_D=\\`\\$ECHO \\\"X\\$lt_script_arg0\\\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\\`\n        test \\\"X\\$lt_dump_D\\\" = \\\"X\\$lt_script_arg0\\\" && lt_dump_D=.\n        lt_dump_F=\\`\\$ECHO \\\"X\\$lt_script_arg0\\\" | $SED -e 's/^X//' -e 's%^.*/%%'\\`\n        cat \\\"\\$lt_dump_D/\\$lt_dump_F\\\"\n        exit 0\n      ;;\n    --lt-*)\n        \\$ECHO \\\"Unrecognized --lt- option: '\\$lt_opt'\\\" 1>&2\n        exit 1\n      ;;\n    esac\n  done\n\n  # Print the debug banner immediately:\n  if test -n \\\"\\$lt_option_debug\\\"; then\n    echo \\\"$outputname:$output:\\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\\\" 1>&2\n  fi\n}\n\n# Used when --lt-debug. Prints its arguments to stdout\n# (redirection is the responsibility of the caller)\nfunc_lt_dump_args ()\n{\n  lt_dump_args_N=1;\n  for lt_arg\n  do\n    \\$ECHO \\\"$outputname:$output:\\$LINENO: newargv[\\$lt_dump_args_N]: \\$lt_arg\\\"\n    lt_dump_args_N=\\`expr \\$lt_dump_args_N + 1\\`\n  done\n}\n\n# Core function for launching the target application\nfunc_exec_program_core ()\n{\n\"\n  case $host in\n  # Backslashes separate directories on plain windows\n  *-*-mingw | *-*-os2* | *-cegcc*)\n    $ECHO \"\\\n      if test -n \\\"\\$lt_option_debug\\\"; then\n        \\$ECHO \\\"$outputname:$output:\\$LINENO: newargv[0]: \\$progdir\\\\\\\\\\$program\\\" 1>&2\n        func_lt_dump_args \\${1+\\\"\\$@\\\"} 1>&2\n      fi\n      exec \\\"\\$progdir\\\\\\\\\\$program\\\" \\${1+\\\"\\$@\\\"}\n\"\n    ;;\n\n  *)\n    $ECHO \"\\\n      if test -n \\\"\\$lt_option_debug\\\"; then\n        \\$ECHO \\\"$outputname:$output:\\$LINENO: newargv[0]: \\$progdir/\\$program\\\" 1>&2\n        func_lt_dump_args \\${1+\\\"\\$@\\\"} 1>&2\n      fi\n      exec \\\"\\$progdir/\\$program\\\" \\${1+\\\"\\$@\\\"}\n\"\n    ;;\n  esac\n  $ECHO \"\\\n      \\$ECHO \\\"\\$0: cannot exec \\$program \\$*\\\" 1>&2\n      exit 1\n}\n\n# A function to encapsulate launching the target application\n# Strips options in the --lt-* namespace from \\$@ and\n# launches target application with the remaining arguments.\nfunc_exec_program ()\n{\n  case \\\" \\$* \\\" in\n  *\\\\ --lt-*)\n    for lt_wr_arg\n    do\n      case \\$lt_wr_arg in\n      --lt-*) ;;\n      *) set x \\\"\\$@\\\" \\\"\\$lt_wr_arg\\\"; shift;;\n      esac\n      shift\n    done ;;\n  esac\n  func_exec_program_core \\${1+\\\"\\$@\\\"}\n}\n\n  # Parse options\n  func_parse_lt_options \\\"\\$0\\\" \\${1+\\\"\\$@\\\"}\n\n  # Find the directory that this script lives in.\n  thisdir=\\`\\$ECHO \\\"\\$file\\\" | $SED 's%/[^/]*$%%'\\`\n  test \\\"x\\$thisdir\\\" = \\\"x\\$file\\\" && thisdir=.\n\n  # Follow symbolic links until we get to the real thisdir.\n  file=\\`ls -ld \\\"\\$file\\\" | $SED -n 's/.*-> //p'\\`\n  while test -n \\\"\\$file\\\"; do\n    destdir=\\`\\$ECHO \\\"\\$file\\\" | $SED 's%/[^/]*\\$%%'\\`\n\n    # If there was a directory component, then change thisdir.\n    if test \\\"x\\$destdir\\\" != \\\"x\\$file\\\"; then\n      case \\\"\\$destdir\\\" in\n      [\\\\\\\\/]* | [A-Za-z]:[\\\\\\\\/]*) thisdir=\\\"\\$destdir\\\" ;;\n      *) thisdir=\\\"\\$thisdir/\\$destdir\\\" ;;\n      esac\n    fi\n\n    file=\\`\\$ECHO \\\"\\$file\\\" | $SED 's%^.*/%%'\\`\n    file=\\`ls -ld \\\"\\$thisdir/\\$file\\\" | $SED -n 's/.*-> //p'\\`\n  done\n\n  # Usually 'no', except on cygwin/mingw when embedded into\n  # the cwrapper.\n  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1\n  if test \\\"\\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\\\" = \\\"yes\\\"; then\n    # special case for '.'\n    if test \\\"\\$thisdir\\\" = \\\".\\\"; then\n      thisdir=\\`pwd\\`\n    fi\n    # remove .libs from thisdir\n    case \\\"\\$thisdir\\\" in\n    *[\\\\\\\\/]$objdir ) thisdir=\\`\\$ECHO \\\"\\$thisdir\\\" | $SED 's%[\\\\\\\\/][^\\\\\\\\/]*$%%'\\` ;;\n    $objdir )   thisdir=. ;;\n    esac\n  fi\n\n  # Try to get the absolute directory name.\n  absdir=\\`cd \\\"\\$thisdir\\\" && pwd\\`\n  test -n \\\"\\$absdir\\\" && thisdir=\\\"\\$absdir\\\"\n\"\n\n\tif test yes = \"$fast_install\"; then\n\t  $ECHO \"\\\n  program=lt-'$outputname'$exeext\n  progdir=\\\"\\$thisdir/$objdir\\\"\n\n  if test ! -f \\\"\\$progdir/\\$program\\\" ||\n     { file=\\`ls -1dt \\\"\\$progdir/\\$program\\\" \\\"\\$progdir/../\\$program\\\" 2>/dev/null | $SED 1q\\`; \\\\\n       test \\\"X\\$file\\\" != \\\"X\\$progdir/\\$program\\\"; }; then\n\n    file=\\\"\\$\\$-\\$program\\\"\n\n    if test ! -d \\\"\\$progdir\\\"; then\n      $MKDIR \\\"\\$progdir\\\"\n    else\n      $RM \\\"\\$progdir/\\$file\\\"\n    fi\"\n\n\t  $ECHO \"\\\n\n    # relink executable if necessary\n    if test -n \\\"\\$relink_command\\\"; then\n      if relink_command_output=\\`eval \\$relink_command 2>&1\\`; then :\n      else\n\t\\$ECHO \\\"\\$relink_command_output\\\" >&2\n\t$RM \\\"\\$progdir/\\$file\\\"\n\texit 1\n      fi\n    fi\n\n    $MV \\\"\\$progdir/\\$file\\\" \\\"\\$progdir/\\$program\\\" 2>/dev/null ||\n    { $RM \\\"\\$progdir/\\$program\\\";\n      $MV \\\"\\$progdir/\\$file\\\" \\\"\\$progdir/\\$program\\\"; }\n    $RM \\\"\\$progdir/\\$file\\\"\n  fi\"\n\telse\n\t  $ECHO \"\\\n  program='$outputname'\n  progdir=\\\"\\$thisdir/$objdir\\\"\n\"\n\tfi\n\n\t$ECHO \"\\\n\n  if test -f \\\"\\$progdir/\\$program\\\"; then\"\n\n\t# fixup the dll searchpath if we need to.\n\t#\n\t# Fix the DLL searchpath if we need to.  Do this before prepending\n\t# to shlibpath, because on Windows, both are PATH and uninstalled\n\t# libraries must come first.\n\tif test -n \"$dllsearchpath\"; then\n\t  $ECHO \"\\\n    # Add the dll search path components to the executable PATH\n    PATH=$dllsearchpath:\\$PATH\n\"\n\tfi\n\n\t# Export our shlibpath_var if we have one.\n\tif test yes = \"$shlibpath_overrides_runpath\" && test -n \"$shlibpath_var\" && test -n \"$temp_rpath\"; then\n\t  $ECHO \"\\\n    # Add our own library path to $shlibpath_var\n    $shlibpath_var=\\\"$temp_rpath\\$$shlibpath_var\\\"\n\n    # Some systems cannot cope with colon-terminated $shlibpath_var\n    # The second colon is a workaround for a bug in BeOS R4 sed\n    $shlibpath_var=\\`\\$ECHO \\\"\\$$shlibpath_var\\\" | $SED 's/::*\\$//'\\`\n\n    export $shlibpath_var\n\"\n\tfi\n\n\t$ECHO \"\\\n    if test \\\"\\$libtool_execute_magic\\\" != \\\"$magic\\\"; then\n      # Run the actual program with our arguments.\n      func_exec_program \\${1+\\\"\\$@\\\"}\n    fi\n  else\n    # The program doesn't exist.\n    \\$ECHO \\\"\\$0: error: '\\$progdir/\\$program' does not exist\\\" 1>&2\n    \\$ECHO \\\"This script is just a wrapper for \\$program.\\\" 1>&2\n    \\$ECHO \\\"See the $PACKAGE documentation for more information.\\\" 1>&2\n    exit 1\n  fi\nfi\\\n\"\n}\n\n\n# func_emit_cwrapperexe_src\n# emit the source code for a wrapper executable on stdout\n# Must ONLY be called from within func_mode_link because\n# it depends on a number of variable set therein.\nfunc_emit_cwrapperexe_src ()\n{\n\tcat <<EOF\n\n/* $cwrappersource - temporary wrapper executable for $objdir/$outputname\n   Generated by $PROGRAM (GNU $PACKAGE) $VERSION\n\n   The $output program cannot be directly executed until all the libtool\n   libraries that it depends on are installed.\n\n   This wrapper executable should never be moved out of the build directory.\n   If it is, it will not operate correctly.\n*/\nEOF\n\t    cat <<\"EOF\"\n#ifdef _MSC_VER\n# define _CRT_SECURE_NO_DEPRECATE 1\n#endif\n#include <stdio.h>\n#include <stdlib.h>\n#ifdef _MSC_VER\n# include <direct.h>\n# include <process.h>\n# include <io.h>\n#else\n# include <unistd.h>\n# include <stdint.h>\n# ifdef __CYGWIN__\n#  include <io.h>\n# endif\n#endif\n#include <malloc.h>\n#include <stdarg.h>\n#include <assert.h>\n#include <string.h>\n#include <ctype.h>\n#include <errno.h>\n#include <fcntl.h>\n#include <sys/stat.h>\n\n#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)\n\n/* declarations of non-ANSI functions */\n#if defined __MINGW32__\n# ifdef __STRICT_ANSI__\nint _putenv (const char *);\n# endif\n#elif defined __CYGWIN__\n# ifdef __STRICT_ANSI__\nchar *realpath (const char *, char *);\nint putenv (char *);\nint setenv (const char *, const char *, int);\n# endif\n/* #elif defined other_platform || defined ... */\n#endif\n\n/* portability defines, excluding path handling macros */\n#if defined _MSC_VER\n# define setmode _setmode\n# define stat    _stat\n# define chmod   _chmod\n# define getcwd  _getcwd\n# define putenv  _putenv\n# define S_IXUSR _S_IEXEC\n#elif defined __MINGW32__\n# define setmode _setmode\n# define stat    _stat\n# define chmod   _chmod\n# define getcwd  _getcwd\n# define putenv  _putenv\n#elif defined __CYGWIN__\n# define HAVE_SETENV\n# define FOPEN_WB \"wb\"\n/* #elif defined other platforms ... */\n#endif\n\n#if defined PATH_MAX\n# define LT_PATHMAX PATH_MAX\n#elif defined MAXPATHLEN\n# define LT_PATHMAX MAXPATHLEN\n#else\n# define LT_PATHMAX 1024\n#endif\n\n#ifndef S_IXOTH\n# define S_IXOTH 0\n#endif\n#ifndef S_IXGRP\n# define S_IXGRP 0\n#endif\n\n/* path handling portability macros */\n#ifndef DIR_SEPARATOR\n# define DIR_SEPARATOR '/'\n# define PATH_SEPARATOR ':'\n#endif\n\n#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \\\n  defined __OS2__\n# define HAVE_DOS_BASED_FILE_SYSTEM\n# define FOPEN_WB \"wb\"\n# ifndef DIR_SEPARATOR_2\n#  define DIR_SEPARATOR_2 '\\\\'\n# endif\n# ifndef PATH_SEPARATOR_2\n#  define PATH_SEPARATOR_2 ';'\n# endif\n#endif\n\n#ifndef DIR_SEPARATOR_2\n# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)\n#else /* DIR_SEPARATOR_2 */\n# define IS_DIR_SEPARATOR(ch) \\\n\t(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))\n#endif /* DIR_SEPARATOR_2 */\n\n#ifndef PATH_SEPARATOR_2\n# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)\n#else /* PATH_SEPARATOR_2 */\n# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)\n#endif /* PATH_SEPARATOR_2 */\n\n#ifndef FOPEN_WB\n# define FOPEN_WB \"w\"\n#endif\n#ifndef _O_BINARY\n# define _O_BINARY 0\n#endif\n\n#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))\n#define XFREE(stale) do { \\\n  if (stale) { free (stale); stale = 0; } \\\n} while (0)\n\n#if defined LT_DEBUGWRAPPER\nstatic int lt_debug = 1;\n#else\nstatic int lt_debug = 0;\n#endif\n\nconst char *program_name = \"libtool-wrapper\"; /* in case xstrdup fails */\n\nvoid *xmalloc (size_t num);\nchar *xstrdup (const char *string);\nconst char *base_name (const char *name);\nchar *find_executable (const char *wrapper);\nchar *chase_symlinks (const char *pathspec);\nint make_executable (const char *path);\nint check_executable (const char *path);\nchar *strendzap (char *str, const char *pat);\nvoid lt_debugprintf (const char *file, int line, const char *fmt, ...);\nvoid lt_fatal (const char *file, int line, const char *message, ...);\nstatic const char *nonnull (const char *s);\nstatic const char *nonempty (const char *s);\nvoid lt_setenv (const char *name, const char *value);\nchar *lt_extend_str (const char *orig_value, const char *add, int to_end);\nvoid lt_update_exe_path (const char *name, const char *value);\nvoid lt_update_lib_path (const char *name, const char *value);\nchar **prepare_spawn (char **argv);\nvoid lt_dump_script (FILE *f);\nEOF\n\n\t    cat <<EOF\n#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)\n# define externally_visible volatile\n#else\n# define externally_visible __attribute__((externally_visible)) volatile\n#endif\nexternally_visible const char * MAGIC_EXE = \"$magic_exe\";\nconst char * LIB_PATH_VARNAME = \"$shlibpath_var\";\nEOF\n\n\t    if test yes = \"$shlibpath_overrides_runpath\" && test -n \"$shlibpath_var\" && test -n \"$temp_rpath\"; then\n              func_to_host_path \"$temp_rpath\"\n\t      cat <<EOF\nconst char * LIB_PATH_VALUE   = \"$func_to_host_path_result\";\nEOF\n\t    else\n\t      cat <<\"EOF\"\nconst char * LIB_PATH_VALUE   = \"\";\nEOF\n\t    fi\n\n\t    if test -n \"$dllsearchpath\"; then\n              func_to_host_path \"$dllsearchpath:\"\n\t      cat <<EOF\nconst char * EXE_PATH_VARNAME = \"PATH\";\nconst char * EXE_PATH_VALUE   = \"$func_to_host_path_result\";\nEOF\n\t    else\n\t      cat <<\"EOF\"\nconst char * EXE_PATH_VARNAME = \"\";\nconst char * EXE_PATH_VALUE   = \"\";\nEOF\n\t    fi\n\n\t    if test yes = \"$fast_install\"; then\n\t      cat <<EOF\nconst char * TARGET_PROGRAM_NAME = \"lt-$outputname\"; /* hopefully, no .exe */\nEOF\n\t    else\n\t      cat <<EOF\nconst char * TARGET_PROGRAM_NAME = \"$outputname\"; /* hopefully, no .exe */\nEOF\n\t    fi\n\n\n\t    cat <<\"EOF\"\n\n#define LTWRAPPER_OPTION_PREFIX         \"--lt-\"\n\nstatic const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;\nstatic const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX \"dump-script\";\nstatic const char *debug_opt            = LTWRAPPER_OPTION_PREFIX \"debug\";\n\nint\nmain (int argc, char *argv[])\n{\n  char **newargz;\n  int  newargc;\n  char *tmp_pathspec;\n  char *actual_cwrapper_path;\n  char *actual_cwrapper_name;\n  char *target_name;\n  char *lt_argv_zero;\n  int rval = 127;\n\n  int i;\n\n  program_name = (char *) xstrdup (base_name (argv[0]));\n  newargz = XMALLOC (char *, (size_t) argc + 1);\n\n  /* very simple arg parsing; don't want to rely on getopt\n   * also, copy all non cwrapper options to newargz, except\n   * argz[0], which is handled differently\n   */\n  newargc=0;\n  for (i = 1; i < argc; i++)\n    {\n      if (STREQ (argv[i], dumpscript_opt))\n\t{\nEOF\n\t    case $host in\n\t      *mingw* | *cygwin* )\n\t\t# make stdout use \"unix\" line endings\n\t\techo \"          setmode(1,_O_BINARY);\"\n\t\t;;\n\t      esac\n\n\t    cat <<\"EOF\"\n\t  lt_dump_script (stdout);\n\t  return 0;\n\t}\n      if (STREQ (argv[i], debug_opt))\n\t{\n          lt_debug = 1;\n          continue;\n\t}\n      if (STREQ (argv[i], ltwrapper_option_prefix))\n        {\n          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX\n             namespace, but it is not one of the ones we know about and\n             have already dealt with, above (inluding dump-script), then\n             report an error. Otherwise, targets might begin to believe\n             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX\n             namespace. The first time any user complains about this, we'll\n             need to make LTWRAPPER_OPTION_PREFIX a configure-time option\n             or a configure.ac-settable value.\n           */\n          lt_fatal (__FILE__, __LINE__,\n\t\t    \"unrecognized %s option: '%s'\",\n                    ltwrapper_option_prefix, argv[i]);\n        }\n      /* otherwise ... */\n      newargz[++newargc] = xstrdup (argv[i]);\n    }\n  newargz[++newargc] = NULL;\n\nEOF\n\t    cat <<EOF\n  /* The GNU banner must be the first non-error debug message */\n  lt_debugprintf (__FILE__, __LINE__, \"libtool wrapper (GNU $PACKAGE) $VERSION\\n\");\nEOF\n\t    cat <<\"EOF\"\n  lt_debugprintf (__FILE__, __LINE__, \"(main) argv[0]: %s\\n\", argv[0]);\n  lt_debugprintf (__FILE__, __LINE__, \"(main) program_name: %s\\n\", program_name);\n\n  tmp_pathspec = find_executable (argv[0]);\n  if (tmp_pathspec == NULL)\n    lt_fatal (__FILE__, __LINE__, \"couldn't find %s\", argv[0]);\n  lt_debugprintf (__FILE__, __LINE__,\n                  \"(main) found exe (before symlink chase) at: %s\\n\",\n\t\t  tmp_pathspec);\n\n  actual_cwrapper_path = chase_symlinks (tmp_pathspec);\n  lt_debugprintf (__FILE__, __LINE__,\n                  \"(main) found exe (after symlink chase) at: %s\\n\",\n\t\t  actual_cwrapper_path);\n  XFREE (tmp_pathspec);\n\n  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));\n  strendzap (actual_cwrapper_path, actual_cwrapper_name);\n\n  /* wrapper name transforms */\n  strendzap (actual_cwrapper_name, \".exe\");\n  tmp_pathspec = lt_extend_str (actual_cwrapper_name, \".exe\", 1);\n  XFREE (actual_cwrapper_name);\n  actual_cwrapper_name = tmp_pathspec;\n  tmp_pathspec = 0;\n\n  /* target_name transforms -- use actual target program name; might have lt- prefix */\n  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));\n  strendzap (target_name, \".exe\");\n  tmp_pathspec = lt_extend_str (target_name, \".exe\", 1);\n  XFREE (target_name);\n  target_name = tmp_pathspec;\n  tmp_pathspec = 0;\n\n  lt_debugprintf (__FILE__, __LINE__,\n\t\t  \"(main) libtool target name: %s\\n\",\n\t\t  target_name);\nEOF\n\n\t    cat <<EOF\n  newargz[0] =\n    XMALLOC (char, (strlen (actual_cwrapper_path) +\n\t\t    strlen (\"$objdir\") + 1 + strlen (actual_cwrapper_name) + 1));\n  strcpy (newargz[0], actual_cwrapper_path);\n  strcat (newargz[0], \"$objdir\");\n  strcat (newargz[0], \"/\");\nEOF\n\n\t    cat <<\"EOF\"\n  /* stop here, and copy so we don't have to do this twice */\n  tmp_pathspec = xstrdup (newargz[0]);\n\n  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */\n  strcat (newargz[0], actual_cwrapper_name);\n\n  /* DO want the lt- prefix here if it exists, so use target_name */\n  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);\n  XFREE (tmp_pathspec);\n  tmp_pathspec = NULL;\nEOF\n\n\t    case $host_os in\n\t      mingw*)\n\t    cat <<\"EOF\"\n  {\n    char* p;\n    while ((p = strchr (newargz[0], '\\\\')) != NULL)\n      {\n\t*p = '/';\n      }\n    while ((p = strchr (lt_argv_zero, '\\\\')) != NULL)\n      {\n\t*p = '/';\n      }\n  }\nEOF\n\t    ;;\n\t    esac\n\n\t    cat <<\"EOF\"\n  XFREE (target_name);\n  XFREE (actual_cwrapper_path);\n  XFREE (actual_cwrapper_name);\n\n  lt_setenv (\"BIN_SH\", \"xpg4\"); /* for Tru64 */\n  lt_setenv (\"DUALCASE\", \"1\");  /* for MSK sh */\n  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must\n     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)\n     because on Windows, both *_VARNAMEs are PATH but uninstalled\n     libraries must come first. */\n  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);\n  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);\n\n  lt_debugprintf (__FILE__, __LINE__, \"(main) lt_argv_zero: %s\\n\",\n\t\t  nonnull (lt_argv_zero));\n  for (i = 0; i < newargc; i++)\n    {\n      lt_debugprintf (__FILE__, __LINE__, \"(main) newargz[%d]: %s\\n\",\n\t\t      i, nonnull (newargz[i]));\n    }\n\nEOF\n\n\t    case $host_os in\n\t      mingw*)\n\t\tcat <<\"EOF\"\n  /* execv doesn't actually work on mingw as expected on unix */\n  newargz = prepare_spawn (newargz);\n  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);\n  if (rval == -1)\n    {\n      /* failed to start process */\n      lt_debugprintf (__FILE__, __LINE__,\n\t\t      \"(main) failed to launch target \\\"%s\\\": %s\\n\",\n\t\t      lt_argv_zero, nonnull (strerror (errno)));\n      return 127;\n    }\n  return rval;\nEOF\n\t\t;;\n\t      *)\n\t\tcat <<\"EOF\"\n  execv (lt_argv_zero, newargz);\n  return rval; /* =127, but avoids unused variable warning */\nEOF\n\t\t;;\n\t    esac\n\n\t    cat <<\"EOF\"\n}\n\nvoid *\nxmalloc (size_t num)\n{\n  void *p = (void *) malloc (num);\n  if (!p)\n    lt_fatal (__FILE__, __LINE__, \"memory exhausted\");\n\n  return p;\n}\n\nchar *\nxstrdup (const char *string)\n{\n  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),\n\t\t\t  string) : NULL;\n}\n\nconst char *\nbase_name (const char *name)\n{\n  const char *base;\n\n#if defined HAVE_DOS_BASED_FILE_SYSTEM\n  /* Skip over the disk name in MSDOS pathnames. */\n  if (isalpha ((unsigned char) name[0]) && name[1] == ':')\n    name += 2;\n#endif\n\n  for (base = name; *name; name++)\n    if (IS_DIR_SEPARATOR (*name))\n      base = name + 1;\n  return base;\n}\n\nint\ncheck_executable (const char *path)\n{\n  struct stat st;\n\n  lt_debugprintf (__FILE__, __LINE__, \"(check_executable): %s\\n\",\n                  nonempty (path));\n  if ((!path) || (!*path))\n    return 0;\n\n  if ((stat (path, &st) >= 0)\n      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))\n    return 1;\n  else\n    return 0;\n}\n\nint\nmake_executable (const char *path)\n{\n  int rval = 0;\n  struct stat st;\n\n  lt_debugprintf (__FILE__, __LINE__, \"(make_executable): %s\\n\",\n                  nonempty (path));\n  if ((!path) || (!*path))\n    return 0;\n\n  if (stat (path, &st) >= 0)\n    {\n      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);\n    }\n  return rval;\n}\n\n/* Searches for the full path of the wrapper.  Returns\n   newly allocated full path name if found, NULL otherwise\n   Does not chase symlinks, even on platforms that support them.\n*/\nchar *\nfind_executable (const char *wrapper)\n{\n  int has_slash = 0;\n  const char *p;\n  const char *p_next;\n  /* static buffer for getcwd */\n  char tmp[LT_PATHMAX + 1];\n  size_t tmp_len;\n  char *concat_name;\n\n  lt_debugprintf (__FILE__, __LINE__, \"(find_executable): %s\\n\",\n                  nonempty (wrapper));\n\n  if ((wrapper == NULL) || (*wrapper == '\\0'))\n    return NULL;\n\n  /* Absolute path? */\n#if defined HAVE_DOS_BASED_FILE_SYSTEM\n  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')\n    {\n      concat_name = xstrdup (wrapper);\n      if (check_executable (concat_name))\n\treturn concat_name;\n      XFREE (concat_name);\n    }\n  else\n    {\n#endif\n      if (IS_DIR_SEPARATOR (wrapper[0]))\n\t{\n\t  concat_name = xstrdup (wrapper);\n\t  if (check_executable (concat_name))\n\t    return concat_name;\n\t  XFREE (concat_name);\n\t}\n#if defined HAVE_DOS_BASED_FILE_SYSTEM\n    }\n#endif\n\n  for (p = wrapper; *p; p++)\n    if (*p == '/')\n      {\n\thas_slash = 1;\n\tbreak;\n      }\n  if (!has_slash)\n    {\n      /* no slashes; search PATH */\n      const char *path = getenv (\"PATH\");\n      if (path != NULL)\n\t{\n\t  for (p = path; *p; p = p_next)\n\t    {\n\t      const char *q;\n\t      size_t p_len;\n\t      for (q = p; *q; q++)\n\t\tif (IS_PATH_SEPARATOR (*q))\n\t\t  break;\n\t      p_len = (size_t) (q - p);\n\t      p_next = (*q == '\\0' ? q : q + 1);\n\t      if (p_len == 0)\n\t\t{\n\t\t  /* empty path: current directory */\n\t\t  if (getcwd (tmp, LT_PATHMAX) == NULL)\n\t\t    lt_fatal (__FILE__, __LINE__, \"getcwd failed: %s\",\n                              nonnull (strerror (errno)));\n\t\t  tmp_len = strlen (tmp);\n\t\t  concat_name =\n\t\t    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);\n\t\t  memcpy (concat_name, tmp, tmp_len);\n\t\t  concat_name[tmp_len] = '/';\n\t\t  strcpy (concat_name + tmp_len + 1, wrapper);\n\t\t}\n\t      else\n\t\t{\n\t\t  concat_name =\n\t\t    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);\n\t\t  memcpy (concat_name, p, p_len);\n\t\t  concat_name[p_len] = '/';\n\t\t  strcpy (concat_name + p_len + 1, wrapper);\n\t\t}\n\t      if (check_executable (concat_name))\n\t\treturn concat_name;\n\t      XFREE (concat_name);\n\t    }\n\t}\n      /* not found in PATH; assume curdir */\n    }\n  /* Relative path | not found in path: prepend cwd */\n  if (getcwd (tmp, LT_PATHMAX) == NULL)\n    lt_fatal (__FILE__, __LINE__, \"getcwd failed: %s\",\n              nonnull (strerror (errno)));\n  tmp_len = strlen (tmp);\n  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);\n  memcpy (concat_name, tmp, tmp_len);\n  concat_name[tmp_len] = '/';\n  strcpy (concat_name + tmp_len + 1, wrapper);\n\n  if (check_executable (concat_name))\n    return concat_name;\n  XFREE (concat_name);\n  return NULL;\n}\n\nchar *\nchase_symlinks (const char *pathspec)\n{\n#ifndef S_ISLNK\n  return xstrdup (pathspec);\n#else\n  char buf[LT_PATHMAX];\n  struct stat s;\n  char *tmp_pathspec = xstrdup (pathspec);\n  char *p;\n  int has_symlinks = 0;\n  while (strlen (tmp_pathspec) && !has_symlinks)\n    {\n      lt_debugprintf (__FILE__, __LINE__,\n\t\t      \"checking path component for symlinks: %s\\n\",\n\t\t      tmp_pathspec);\n      if (lstat (tmp_pathspec, &s) == 0)\n\t{\n\t  if (S_ISLNK (s.st_mode) != 0)\n\t    {\n\t      has_symlinks = 1;\n\t      break;\n\t    }\n\n\t  /* search backwards for last DIR_SEPARATOR */\n\t  p = tmp_pathspec + strlen (tmp_pathspec) - 1;\n\t  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))\n\t    p--;\n\t  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))\n\t    {\n\t      /* no more DIR_SEPARATORS left */\n\t      break;\n\t    }\n\t  *p = '\\0';\n\t}\n      else\n\t{\n\t  lt_fatal (__FILE__, __LINE__,\n\t\t    \"error accessing file \\\"%s\\\": %s\",\n\t\t    tmp_pathspec, nonnull (strerror (errno)));\n\t}\n    }\n  XFREE (tmp_pathspec);\n\n  if (!has_symlinks)\n    {\n      return xstrdup (pathspec);\n    }\n\n  tmp_pathspec = realpath (pathspec, buf);\n  if (tmp_pathspec == 0)\n    {\n      lt_fatal (__FILE__, __LINE__,\n\t\t\"could not follow symlinks for %s\", pathspec);\n    }\n  return xstrdup (tmp_pathspec);\n#endif\n}\n\nchar *\nstrendzap (char *str, const char *pat)\n{\n  size_t len, patlen;\n\n  assert (str != NULL);\n  assert (pat != NULL);\n\n  len = strlen (str);\n  patlen = strlen (pat);\n\n  if (patlen <= len)\n    {\n      str += len - patlen;\n      if (STREQ (str, pat))\n\t*str = '\\0';\n    }\n  return str;\n}\n\nvoid\nlt_debugprintf (const char *file, int line, const char *fmt, ...)\n{\n  va_list args;\n  if (lt_debug)\n    {\n      (void) fprintf (stderr, \"%s:%s:%d: \", program_name, file, line);\n      va_start (args, fmt);\n      (void) vfprintf (stderr, fmt, args);\n      va_end (args);\n    }\n}\n\nstatic void\nlt_error_core (int exit_status, const char *file,\n\t       int line, const char *mode,\n\t       const char *message, va_list ap)\n{\n  fprintf (stderr, \"%s:%s:%d: %s: \", program_name, file, line, mode);\n  vfprintf (stderr, message, ap);\n  fprintf (stderr, \".\\n\");\n\n  if (exit_status >= 0)\n    exit (exit_status);\n}\n\nvoid\nlt_fatal (const char *file, int line, const char *message, ...)\n{\n  va_list ap;\n  va_start (ap, message);\n  lt_error_core (EXIT_FAILURE, file, line, \"FATAL\", message, ap);\n  va_end (ap);\n}\n\nstatic const char *\nnonnull (const char *s)\n{\n  return s ? s : \"(null)\";\n}\n\nstatic const char *\nnonempty (const char *s)\n{\n  return (s && !*s) ? \"(empty)\" : nonnull (s);\n}\n\nvoid\nlt_setenv (const char *name, const char *value)\n{\n  lt_debugprintf (__FILE__, __LINE__,\n\t\t  \"(lt_setenv) setting '%s' to '%s'\\n\",\n                  nonnull (name), nonnull (value));\n  {\n#ifdef HAVE_SETENV\n    /* always make a copy, for consistency with !HAVE_SETENV */\n    char *str = xstrdup (value);\n    setenv (name, str, 1);\n#else\n    size_t len = strlen (name) + 1 + strlen (value) + 1;\n    char *str = XMALLOC (char, len);\n    sprintf (str, \"%s=%s\", name, value);\n    if (putenv (str) != EXIT_SUCCESS)\n      {\n        XFREE (str);\n      }\n#endif\n  }\n}\n\nchar *\nlt_extend_str (const char *orig_value, const char *add, int to_end)\n{\n  char *new_value;\n  if (orig_value && *orig_value)\n    {\n      size_t orig_value_len = strlen (orig_value);\n      size_t add_len = strlen (add);\n      new_value = XMALLOC (char, add_len + orig_value_len + 1);\n      if (to_end)\n        {\n          strcpy (new_value, orig_value);\n          strcpy (new_value + orig_value_len, add);\n        }\n      else\n        {\n          strcpy (new_value, add);\n          strcpy (new_value + add_len, orig_value);\n        }\n    }\n  else\n    {\n      new_value = xstrdup (add);\n    }\n  return new_value;\n}\n\nvoid\nlt_update_exe_path (const char *name, const char *value)\n{\n  lt_debugprintf (__FILE__, __LINE__,\n\t\t  \"(lt_update_exe_path) modifying '%s' by prepending '%s'\\n\",\n                  nonnull (name), nonnull (value));\n\n  if (name && *name && value && *value)\n    {\n      char *new_value = lt_extend_str (getenv (name), value, 0);\n      /* some systems can't cope with a ':'-terminated path #' */\n      size_t len = strlen (new_value);\n      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))\n        {\n          new_value[--len] = '\\0';\n        }\n      lt_setenv (name, new_value);\n      XFREE (new_value);\n    }\n}\n\nvoid\nlt_update_lib_path (const char *name, const char *value)\n{\n  lt_debugprintf (__FILE__, __LINE__,\n\t\t  \"(lt_update_lib_path) modifying '%s' by prepending '%s'\\n\",\n                  nonnull (name), nonnull (value));\n\n  if (name && *name && value && *value)\n    {\n      char *new_value = lt_extend_str (getenv (name), value, 0);\n      lt_setenv (name, new_value);\n      XFREE (new_value);\n    }\n}\n\nEOF\n\t    case $host_os in\n\t      mingw*)\n\t\tcat <<\"EOF\"\n\n/* Prepares an argument vector before calling spawn().\n   Note that spawn() does not by itself call the command interpreter\n     (getenv (\"COMSPEC\") != NULL ? getenv (\"COMSPEC\") :\n      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);\n         GetVersionEx(&v);\n         v.dwPlatformId == VER_PLATFORM_WIN32_NT;\n      }) ? \"cmd.exe\" : \"command.com\").\n   Instead it simply concatenates the arguments, separated by ' ', and calls\n   CreateProcess().  We must quote the arguments since Win32 CreateProcess()\n   interprets characters like ' ', '\\t', '\\\\', '\"' (but not '<' and '>') in a\n   special way:\n   - Space and tab are interpreted as delimiters. They are not treated as\n     delimiters if they are surrounded by double quotes: \"...\".\n   - Unescaped double quotes are removed from the input. Their only effect is\n     that within double quotes, space and tab are treated like normal\n     characters.\n   - Backslashes not followed by double quotes are not special.\n   - But 2*n+1 backslashes followed by a double quote become\n     n backslashes followed by a double quote (n >= 0):\n       \\\" -> \"\n       \\\\\\\" -> \\\"\n       \\\\\\\\\\\" -> \\\\\"\n */\n#define SHELL_SPECIAL_CHARS \"\\\"\\\\ \\001\\002\\003\\004\\005\\006\\007\\010\\011\\012\\013\\014\\015\\016\\017\\020\\021\\022\\023\\024\\025\\026\\027\\030\\031\\032\\033\\034\\035\\036\\037\"\n#define SHELL_SPACE_CHARS \" \\001\\002\\003\\004\\005\\006\\007\\010\\011\\012\\013\\014\\015\\016\\017\\020\\021\\022\\023\\024\\025\\026\\027\\030\\031\\032\\033\\034\\035\\036\\037\"\nchar **\nprepare_spawn (char **argv)\n{\n  size_t argc;\n  char **new_argv;\n  size_t i;\n\n  /* Count number of arguments.  */\n  for (argc = 0; argv[argc] != NULL; argc++)\n    ;\n\n  /* Allocate new argument vector.  */\n  new_argv = XMALLOC (char *, argc + 1);\n\n  /* Put quoted arguments into the new argument vector.  */\n  for (i = 0; i < argc; i++)\n    {\n      const char *string = argv[i];\n\n      if (string[0] == '\\0')\n\tnew_argv[i] = xstrdup (\"\\\"\\\"\");\n      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)\n\t{\n\t  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);\n\t  size_t length;\n\t  unsigned int backslashes;\n\t  const char *s;\n\t  char *quoted_string;\n\t  char *p;\n\n\t  length = 0;\n\t  backslashes = 0;\n\t  if (quote_around)\n\t    length++;\n\t  for (s = string; *s != '\\0'; s++)\n\t    {\n\t      char c = *s;\n\t      if (c == '\"')\n\t\tlength += backslashes + 1;\n\t      length++;\n\t      if (c == '\\\\')\n\t\tbackslashes++;\n\t      else\n\t\tbackslashes = 0;\n\t    }\n\t  if (quote_around)\n\t    length += backslashes + 1;\n\n\t  quoted_string = XMALLOC (char, length + 1);\n\n\t  p = quoted_string;\n\t  backslashes = 0;\n\t  if (quote_around)\n\t    *p++ = '\"';\n\t  for (s = string; *s != '\\0'; s++)\n\t    {\n\t      char c = *s;\n\t      if (c == '\"')\n\t\t{\n\t\t  unsigned int j;\n\t\t  for (j = backslashes + 1; j > 0; j--)\n\t\t    *p++ = '\\\\';\n\t\t}\n\t      *p++ = c;\n\t      if (c == '\\\\')\n\t\tbackslashes++;\n\t      else\n\t\tbackslashes = 0;\n\t    }\n\t  if (quote_around)\n\t    {\n\t      unsigned int j;\n\t      for (j = backslashes; j > 0; j--)\n\t\t*p++ = '\\\\';\n\t      *p++ = '\"';\n\t    }\n\t  *p = '\\0';\n\n\t  new_argv[i] = quoted_string;\n\t}\n      else\n\tnew_argv[i] = (char *) string;\n    }\n  new_argv[argc] = NULL;\n\n  return new_argv;\n}\nEOF\n\t\t;;\n\t    esac\n\n            cat <<\"EOF\"\nvoid lt_dump_script (FILE* f)\n{\nEOF\n\t    func_emit_wrapper yes |\n\t      $SED -n -e '\ns/^\\(.\\{79\\}\\)\\(..*\\)/\\1\\\n\\2/\nh\ns/\\([\\\\\"]\\)/\\\\\\1/g\ns/$/\\\\n/\ns/\\([^\\n]*\\).*/  fputs (\"\\1\", f);/p\ng\nD'\n            cat <<\"EOF\"\n}\nEOF\n}\n# end: func_emit_cwrapperexe_src\n\n# func_win32_import_lib_p ARG\n# True if ARG is an import lib, as indicated by $file_magic_cmd\nfunc_win32_import_lib_p ()\n{\n    $debug_cmd\n\n    case `eval $file_magic_cmd \\\"\\$1\\\" 2>/dev/null | $SED -e 10q` in\n    *import*) : ;;\n    *) false ;;\n    esac\n}\n\n# func_suncc_cstd_abi\n# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!\n# Several compiler flags select an ABI that is incompatible with the\n# Cstd library. Avoid specifying it if any are in CXXFLAGS.\nfunc_suncc_cstd_abi ()\n{\n    $debug_cmd\n\n    case \" $compile_command \" in\n    *\" -compat=g \"*|*\\ -std=c++[0-9][0-9]\\ *|*\" -library=stdcxx4 \"*|*\" -library=stlport4 \"*)\n      suncc_use_cstd_abi=no\n      ;;\n    *)\n      suncc_use_cstd_abi=yes\n      ;;\n    esac\n}\n\n# func_mode_link arg...\nfunc_mode_link ()\n{\n    $debug_cmd\n\n    case $host in\n    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)\n      # It is impossible to link a dll without this setting, and\n      # we shouldn't force the makefile maintainer to figure out\n      # what system we are compiling for in order to pass an extra\n      # flag for every libtool invocation.\n      # allow_undefined=no\n\n      # FIXME: Unfortunately, there are problems with the above when trying\n      # to make a dll that has undefined symbols, in which case not\n      # even a static library is built.  For now, we need to specify\n      # -no-undefined on the libtool link line when we can be certain\n      # that all symbols are satisfied, otherwise we get a static library.\n      allow_undefined=yes\n      ;;\n    *)\n      allow_undefined=yes\n      ;;\n    esac\n    libtool_args=$nonopt\n    base_compile=\"$nonopt $@\"\n    compile_command=$nonopt\n    finalize_command=$nonopt\n\n    compile_rpath=\n    finalize_rpath=\n    compile_shlibpath=\n    finalize_shlibpath=\n    convenience=\n    old_convenience=\n    deplibs=\n    old_deplibs=\n    compiler_flags=\n    linker_flags=\n    dllsearchpath=\n    lib_search_path=`pwd`\n    inst_prefix_dir=\n    new_inherited_linker_flags=\n\n    avoid_version=no\n    bindir=\n    dlfiles=\n    dlprefiles=\n    dlself=no\n    export_dynamic=no\n    export_symbols=\n    export_symbols_regex=\n    generated=\n    libobjs=\n    ltlibs=\n    module=no\n    no_install=no\n    objs=\n    os2dllname=\n    non_pic_objects=\n    precious_files_regex=\n    prefer_static_libs=no\n    preload=false\n    prev=\n    prevarg=\n    release=\n    rpath=\n    xrpath=\n    perm_rpath=\n    temp_rpath=\n    thread_safe=no\n    vinfo=\n    vinfo_number=no\n    weak_libs=\n    single_module=$wl-single_module\n    func_infer_tag $base_compile\n\n    # We need to know -static, to get the right output filenames.\n    for arg\n    do\n      case $arg in\n      -shared)\n\ttest yes != \"$build_libtool_libs\" \\\n\t  && func_fatal_configuration \"cannot build a shared library\"\n\tbuild_old_libs=no\n\tbreak\n\t;;\n      -all-static | -static | -static-libtool-libs)\n\tcase $arg in\n\t-all-static)\n\t  if test yes = \"$build_libtool_libs\" && test -z \"$link_static_flag\"; then\n\t    func_warning \"complete static linking is impossible in this configuration\"\n\t  fi\n\t  if test -n \"$link_static_flag\"; then\n\t    dlopen_self=$dlopen_self_static\n\t  fi\n\t  prefer_static_libs=yes\n\t  ;;\n\t-static)\n\t  if test -z \"$pic_flag\" && test -n \"$link_static_flag\"; then\n\t    dlopen_self=$dlopen_self_static\n\t  fi\n\t  prefer_static_libs=built\n\t  ;;\n\t-static-libtool-libs)\n\t  if test -z \"$pic_flag\" && test -n \"$link_static_flag\"; then\n\t    dlopen_self=$dlopen_self_static\n\t  fi\n\t  prefer_static_libs=yes\n\t  ;;\n\tesac\n\tbuild_libtool_libs=no\n\tbuild_old_libs=yes\n\tbreak\n\t;;\n      esac\n    done\n\n    # See if our shared archives depend on static archives.\n    test -n \"$old_archive_from_new_cmds\" && build_old_libs=yes\n\n    # Go through the arguments, transforming them on the way.\n    while test \"$#\" -gt 0; do\n      arg=$1\n      shift\n      func_quote_for_eval \"$arg\"\n      qarg=$func_quote_for_eval_unquoted_result\n      func_append libtool_args \" $func_quote_for_eval_result\"\n\n      # If the previous option needs an argument, assign it.\n      if test -n \"$prev\"; then\n\tcase $prev in\n\toutput)\n\t  func_append compile_command \" @OUTPUT@\"\n\t  func_append finalize_command \" @OUTPUT@\"\n\t  ;;\n\tesac\n\n\tcase $prev in\n\tbindir)\n\t  bindir=$arg\n\t  prev=\n\t  continue\n\t  ;;\n\tdlfiles|dlprefiles)\n\t  $preload || {\n\t    # Add the symbol object into the linking commands.\n\t    func_append compile_command \" @SYMFILE@\"\n\t    func_append finalize_command \" @SYMFILE@\"\n\t    preload=:\n\t  }\n\t  case $arg in\n\t  *.la | *.lo) ;;  # We handle these cases below.\n\t  force)\n\t    if test no = \"$dlself\"; then\n\t      dlself=needless\n\t      export_dynamic=yes\n\t    fi\n\t    prev=\n\t    continue\n\t    ;;\n\t  self)\n\t    if test dlprefiles = \"$prev\"; then\n\t      dlself=yes\n\t    elif test dlfiles = \"$prev\" && test yes != \"$dlopen_self\"; then\n\t      dlself=yes\n\t    else\n\t      dlself=needless\n\t      export_dynamic=yes\n\t    fi\n\t    prev=\n\t    continue\n\t    ;;\n\t  *)\n\t    if test dlfiles = \"$prev\"; then\n\t      func_append dlfiles \" $arg\"\n\t    else\n\t      func_append dlprefiles \" $arg\"\n\t    fi\n\t    prev=\n\t    continue\n\t    ;;\n\t  esac\n\t  ;;\n\texpsyms)\n\t  export_symbols=$arg\n\t  test -f \"$arg\" \\\n\t    || func_fatal_error \"symbol file '$arg' does not exist\"\n\t  prev=\n\t  continue\n\t  ;;\n\texpsyms_regex)\n\t  export_symbols_regex=$arg\n\t  prev=\n\t  continue\n\t  ;;\n\tframework)\n\t  case $host in\n\t    *-*-darwin*)\n\t      case \"$deplibs \" in\n\t\t*\" $qarg.ltframework \"*) ;;\n\t\t*) func_append deplibs \" $qarg.ltframework\" # this is fixed later\n\t\t   ;;\n\t      esac\n\t      ;;\n\t  esac\n\t  prev=\n\t  continue\n\t  ;;\n\tinst_prefix)\n\t  inst_prefix_dir=$arg\n\t  prev=\n\t  continue\n\t  ;;\n\tmllvm)\n\t  # Clang does not use LLVM to link, so we can simply discard any\n\t  # '-mllvm $arg' options when doing the link step.\n\t  prev=\n\t  continue\n\t  ;;\n\tobjectlist)\n\t  if test -f \"$arg\"; then\n\t    save_arg=$arg\n\t    moreargs=\n\t    for fil in `cat \"$save_arg\"`\n\t    do\n#\t      func_append moreargs \" $fil\"\n\t      arg=$fil\n\t      # A libtool-controlled object.\n\n\t      # Check to see that this really is a libtool object.\n\t      if func_lalib_unsafe_p \"$arg\"; then\n\t\tpic_object=\n\t\tnon_pic_object=\n\n\t\t# Read the .lo file\n\t\tfunc_source \"$arg\"\n\n\t\tif test -z \"$pic_object\" ||\n\t\t   test -z \"$non_pic_object\" ||\n\t\t   test none = \"$pic_object\" &&\n\t\t   test none = \"$non_pic_object\"; then\n\t\t  func_fatal_error \"cannot find name of object for '$arg'\"\n\t\tfi\n\n\t\t# Extract subdirectory from the argument.\n\t\tfunc_dirname \"$arg\" \"/\" \"\"\n\t\txdir=$func_dirname_result\n\n\t\tif test none != \"$pic_object\"; then\n\t\t  # Prepend the subdirectory the object is found in.\n\t\t  pic_object=$xdir$pic_object\n\n\t\t  if test dlfiles = \"$prev\"; then\n\t\t    if test yes = \"$build_libtool_libs\" && test yes = \"$dlopen_support\"; then\n\t\t      func_append dlfiles \" $pic_object\"\n\t\t      prev=\n\t\t      continue\n\t\t    else\n\t\t      # If libtool objects are unsupported, then we need to preload.\n\t\t      prev=dlprefiles\n\t\t    fi\n\t\t  fi\n\n\t\t  # CHECK ME:  I think I busted this.  -Ossama\n\t\t  if test dlprefiles = \"$prev\"; then\n\t\t    # Preload the old-style object.\n\t\t    func_append dlprefiles \" $pic_object\"\n\t\t    prev=\n\t\t  fi\n\n\t\t  # A PIC object.\n\t\t  func_append libobjs \" $pic_object\"\n\t\t  arg=$pic_object\n\t\tfi\n\n\t\t# Non-PIC object.\n\t\tif test none != \"$non_pic_object\"; then\n\t\t  # Prepend the subdirectory the object is found in.\n\t\t  non_pic_object=$xdir$non_pic_object\n\n\t\t  # A standard non-PIC object\n\t\t  func_append non_pic_objects \" $non_pic_object\"\n\t\t  if test -z \"$pic_object\" || test none = \"$pic_object\"; then\n\t\t    arg=$non_pic_object\n\t\t  fi\n\t\telse\n\t\t  # If the PIC object exists, use it instead.\n\t\t  # $xdir was prepended to $pic_object above.\n\t\t  non_pic_object=$pic_object\n\t\t  func_append non_pic_objects \" $non_pic_object\"\n\t\tfi\n\t      else\n\t\t# Only an error if not doing a dry-run.\n\t\tif $opt_dry_run; then\n\t\t  # Extract subdirectory from the argument.\n\t\t  func_dirname \"$arg\" \"/\" \"\"\n\t\t  xdir=$func_dirname_result\n\n\t\t  func_lo2o \"$arg\"\n\t\t  pic_object=$xdir$objdir/$func_lo2o_result\n\t\t  non_pic_object=$xdir$func_lo2o_result\n\t\t  func_append libobjs \" $pic_object\"\n\t\t  func_append non_pic_objects \" $non_pic_object\"\n\t        else\n\t\t  func_fatal_error \"'$arg' is not a valid libtool object\"\n\t\tfi\n\t      fi\n\t    done\n\t  else\n\t    func_fatal_error \"link input file '$arg' does not exist\"\n\t  fi\n\t  arg=$save_arg\n\t  prev=\n\t  continue\n\t  ;;\n\tos2dllname)\n\t  os2dllname=$arg\n\t  prev=\n\t  continue\n\t  ;;\n\tprecious_regex)\n\t  precious_files_regex=$arg\n\t  prev=\n\t  continue\n\t  ;;\n\trelease)\n\t  release=-$arg\n\t  prev=\n\t  continue\n\t  ;;\n\trpath | xrpath)\n\t  # We need an absolute path.\n\t  case $arg in\n\t  [\\\\/]* | [A-Za-z]:[\\\\/]*) ;;\n\t  *)\n\t    func_fatal_error \"only absolute run-paths are allowed\"\n\t    ;;\n\t  esac\n\t  if test rpath = \"$prev\"; then\n\t    case \"$rpath \" in\n\t    *\" $arg \"*) ;;\n\t    *) func_append rpath \" $arg\" ;;\n\t    esac\n\t  else\n\t    case \"$xrpath \" in\n\t    *\" $arg \"*) ;;\n\t    *) func_append xrpath \" $arg\" ;;\n\t    esac\n\t  fi\n\t  prev=\n\t  continue\n\t  ;;\n\tshrext)\n\t  shrext_cmds=$arg\n\t  prev=\n\t  continue\n\t  ;;\n\tweak)\n\t  func_append weak_libs \" $arg\"\n\t  prev=\n\t  continue\n\t  ;;\n\txcclinker)\n\t  func_append linker_flags \" $qarg\"\n\t  func_append compiler_flags \" $qarg\"\n\t  prev=\n\t  func_append compile_command \" $qarg\"\n\t  func_append finalize_command \" $qarg\"\n\t  continue\n\t  ;;\n\txcompiler)\n\t  func_append compiler_flags \" $qarg\"\n\t  prev=\n\t  func_append compile_command \" $qarg\"\n\t  func_append finalize_command \" $qarg\"\n\t  continue\n\t  ;;\n\txlinker)\n\t  func_append linker_flags \" $qarg\"\n\t  func_append compiler_flags \" $wl$qarg\"\n\t  prev=\n\t  func_append compile_command \" $wl$qarg\"\n\t  func_append finalize_command \" $wl$qarg\"\n\t  continue\n\t  ;;\n\t*)\n\t  eval \"$prev=\\\"\\$arg\\\"\"\n\t  prev=\n\t  continue\n\t  ;;\n\tesac\n      fi # test -n \"$prev\"\n\n      prevarg=$arg\n\n      case $arg in\n      -all-static)\n\tif test -n \"$link_static_flag\"; then\n\t  # See comment for -static flag below, for more details.\n\t  func_append compile_command \" $link_static_flag\"\n\t  func_append finalize_command \" $link_static_flag\"\n\tfi\n\tcontinue\n\t;;\n\n      -allow-undefined)\n\t# FIXME: remove this flag sometime in the future.\n\tfunc_fatal_error \"'-allow-undefined' must not be used because it is the default\"\n\t;;\n\n      -avoid-version)\n\tavoid_version=yes\n\tcontinue\n\t;;\n\n      -bindir)\n\tprev=bindir\n\tcontinue\n\t;;\n\n      -dlopen)\n\tprev=dlfiles\n\tcontinue\n\t;;\n\n      -dlpreopen)\n\tprev=dlprefiles\n\tcontinue\n\t;;\n\n      -export-dynamic)\n\texport_dynamic=yes\n\tcontinue\n\t;;\n\n      -export-symbols | -export-symbols-regex)\n\tif test -n \"$export_symbols\" || test -n \"$export_symbols_regex\"; then\n\t  func_fatal_error \"more than one -exported-symbols argument is not allowed\"\n\tfi\n\tif test X-export-symbols = \"X$arg\"; then\n\t  prev=expsyms\n\telse\n\t  prev=expsyms_regex\n\tfi\n\tcontinue\n\t;;\n\n      -framework)\n\tprev=framework\n\tcontinue\n\t;;\n\n      -inst-prefix-dir)\n\tprev=inst_prefix\n\tcontinue\n\t;;\n\n      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*\n      # so, if we see these flags be careful not to treat them like -L\n      -L[A-Z][A-Z]*:*)\n\tcase $with_gcc/$host in\n\tno/*-*-irix* | /*-*-irix*)\n\t  func_append compile_command \" $arg\"\n\t  func_append finalize_command \" $arg\"\n\t  ;;\n\tesac\n\tcontinue\n\t;;\n\n      -L*)\n\tfunc_stripname \"-L\" '' \"$arg\"\n\tif test -z \"$func_stripname_result\"; then\n\t  if test \"$#\" -gt 0; then\n\t    func_fatal_error \"require no space between '-L' and '$1'\"\n\t  else\n\t    func_fatal_error \"need path for '-L' option\"\n\t  fi\n\tfi\n\tfunc_resolve_sysroot \"$func_stripname_result\"\n\tdir=$func_resolve_sysroot_result\n\t# We need an absolute path.\n\tcase $dir in\n\t[\\\\/]* | [A-Za-z]:[\\\\/]*) ;;\n\t*)\n\t  absdir=`cd \"$dir\" && pwd`\n\t  test -z \"$absdir\" && \\\n\t    func_fatal_error \"cannot determine absolute directory name of '$dir'\"\n\t  dir=$absdir\n\t  ;;\n\tesac\n\tcase \"$deplibs \" in\n\t*\" -L$dir \"* | *\" $arg \"*)\n\t  # Will only happen for absolute or sysroot arguments\n\t  ;;\n\t*)\n\t  # Preserve sysroot, but never include relative directories\n\t  case $dir in\n\t    [\\\\/]* | [A-Za-z]:[\\\\/]* | =*) func_append deplibs \" $arg\" ;;\n\t    *) func_append deplibs \" -L$dir\" ;;\n\t  esac\n\t  func_append lib_search_path \" $dir\"\n\t  ;;\n\tesac\n\tcase $host in\n\t*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)\n\t  testbindir=`$ECHO \"$dir\" | $SED 's*/lib$*/bin*'`\n\t  case :$dllsearchpath: in\n\t  *\":$dir:\"*) ;;\n\t  ::) dllsearchpath=$dir;;\n\t  *) func_append dllsearchpath \":$dir\";;\n\t  esac\n\t  case :$dllsearchpath: in\n\t  *\":$testbindir:\"*) ;;\n\t  ::) dllsearchpath=$testbindir;;\n\t  *) func_append dllsearchpath \":$testbindir\";;\n\t  esac\n\t  ;;\n\tesac\n\tcontinue\n\t;;\n\n      -l*)\n\tif test X-lc = \"X$arg\" || test X-lm = \"X$arg\"; then\n\t  case $host in\n\t  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)\n\t    # These systems don't actually have a C or math library (as such)\n\t    continue\n\t    ;;\n\t  *-*-os2*)\n\t    # These systems don't actually have a C library (as such)\n\t    test X-lc = \"X$arg\" && continue\n\t    ;;\n\t  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)\n\t    # Do not include libc due to us having libc/libc_r.\n\t    test X-lc = \"X$arg\" && continue\n\t    ;;\n\t  *-*-rhapsody* | *-*-darwin1.[012])\n\t    # Rhapsody C and math libraries are in the System framework\n\t    func_append deplibs \" System.ltframework\"\n\t    continue\n\t    ;;\n\t  *-*-sco3.2v5* | *-*-sco5v6*)\n\t    # Causes problems with __ctype\n\t    test X-lc = \"X$arg\" && continue\n\t    ;;\n\t  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)\n\t    # Compiler inserts libc in the correct place for threads to work\n\t    test X-lc = \"X$arg\" && continue\n\t    ;;\n\t  esac\n\telif test X-lc_r = \"X$arg\"; then\n\t case $host in\n\t *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)\n\t   # Do not include libc_r directly, use -pthread flag.\n\t   continue\n\t   ;;\n\t esac\n\tfi\n\tfunc_append deplibs \" $arg\"\n\tcontinue\n\t;;\n\n      -mllvm)\n\tprev=mllvm\n\tcontinue\n\t;;\n\n      -module)\n\tmodule=yes\n\tcontinue\n\t;;\n\n      # Tru64 UNIX uses -model [arg] to determine the layout of C++\n      # classes, name mangling, and exception handling.\n      # Darwin uses the -arch flag to determine output architecture.\n      -model|-arch|-isysroot|--sysroot)\n\tfunc_append compiler_flags \" $arg\"\n\tfunc_append compile_command \" $arg\"\n\tfunc_append finalize_command \" $arg\"\n\tprev=xcompiler\n\tcontinue\n\t;;\n\n      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \\\n      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)\n\tfunc_append compiler_flags \" $arg\"\n\tfunc_append compile_command \" $arg\"\n\tfunc_append finalize_command \" $arg\"\n\tcase \"$new_inherited_linker_flags \" in\n\t    *\" $arg \"*) ;;\n\t    * ) func_append new_inherited_linker_flags \" $arg\" ;;\n\tesac\n\tcontinue\n\t;;\n\n      -multi_module)\n\tsingle_module=$wl-multi_module\n\tcontinue\n\t;;\n\n      -no-fast-install)\n\tfast_install=no\n\tcontinue\n\t;;\n\n      -no-install)\n\tcase $host in\n\t*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)\n\t  # The PATH hackery in wrapper scripts is required on Windows\n\t  # and Darwin in order for the loader to find any dlls it needs.\n\t  func_warning \"'-no-install' is ignored for $host\"\n\t  func_warning \"assuming '-no-fast-install' instead\"\n\t  fast_install=no\n\t  ;;\n\t*) no_install=yes ;;\n\tesac\n\tcontinue\n\t;;\n\n      -no-undefined)\n\tallow_undefined=no\n\tcontinue\n\t;;\n\n      -objectlist)\n\tprev=objectlist\n\tcontinue\n\t;;\n\n      -os2dllname)\n\tprev=os2dllname\n\tcontinue\n\t;;\n\n      -o) prev=output ;;\n\n      -precious-files-regex)\n\tprev=precious_regex\n\tcontinue\n\t;;\n\n      -release)\n\tprev=release\n\tcontinue\n\t;;\n\n      -rpath)\n\tprev=rpath\n\tcontinue\n\t;;\n\n      -R)\n\tprev=xrpath\n\tcontinue\n\t;;\n\n      -R*)\n\tfunc_stripname '-R' '' \"$arg\"\n\tdir=$func_stripname_result\n\t# We need an absolute path.\n\tcase $dir in\n\t[\\\\/]* | [A-Za-z]:[\\\\/]*) ;;\n\t=*)\n\t  func_stripname '=' '' \"$dir\"\n\t  dir=$lt_sysroot$func_stripname_result\n\t  ;;\n\t*)\n\t  func_fatal_error \"only absolute run-paths are allowed\"\n\t  ;;\n\tesac\n\tcase \"$xrpath \" in\n\t*\" $dir \"*) ;;\n\t*) func_append xrpath \" $dir\" ;;\n\tesac\n\tcontinue\n\t;;\n\n      -shared)\n\t# The effects of -shared are defined in a previous loop.\n\tcontinue\n\t;;\n\n      -shrext)\n\tprev=shrext\n\tcontinue\n\t;;\n\n      -static | -static-libtool-libs)\n\t# The effects of -static are defined in a previous loop.\n\t# We used to do the same as -all-static on platforms that\n\t# didn't have a PIC flag, but the assumption that the effects\n\t# would be equivalent was wrong.  It would break on at least\n\t# Digital Unix and AIX.\n\tcontinue\n\t;;\n\n      -thread-safe)\n\tthread_safe=yes\n\tcontinue\n\t;;\n\n      -version-info)\n\tprev=vinfo\n\tcontinue\n\t;;\n\n      -version-number)\n\tprev=vinfo\n\tvinfo_number=yes\n\tcontinue\n\t;;\n\n      -weak)\n        prev=weak\n\tcontinue\n\t;;\n\n      -Wc,*)\n\tfunc_stripname '-Wc,' '' \"$arg\"\n\targs=$func_stripname_result\n\targ=\n\tsave_ifs=$IFS; IFS=,\n\tfor flag in $args; do\n\t  IFS=$save_ifs\n          func_quote_for_eval \"$flag\"\n\t  func_append arg \" $func_quote_for_eval_result\"\n\t  func_append compiler_flags \" $func_quote_for_eval_result\"\n\tdone\n\tIFS=$save_ifs\n\tfunc_stripname ' ' '' \"$arg\"\n\targ=$func_stripname_result\n\t;;\n\n      -Wl,*)\n\tfunc_stripname '-Wl,' '' \"$arg\"\n\targs=$func_stripname_result\n\targ=\n\tsave_ifs=$IFS; IFS=,\n\tfor flag in $args; do\n\t  IFS=$save_ifs\n          func_quote_for_eval \"$flag\"\n\t  func_append arg \" $wl$func_quote_for_eval_result\"\n\t  func_append compiler_flags \" $wl$func_quote_for_eval_result\"\n\t  func_append linker_flags \" $func_quote_for_eval_result\"\n\tdone\n\tIFS=$save_ifs\n\tfunc_stripname ' ' '' \"$arg\"\n\targ=$func_stripname_result\n\t;;\n\n      -Xcompiler)\n\tprev=xcompiler\n\tcontinue\n\t;;\n\n      -Xlinker)\n\tprev=xlinker\n\tcontinue\n\t;;\n\n      -XCClinker)\n\tprev=xcclinker\n\tcontinue\n\t;;\n\n      # -msg_* for osf cc\n      -msg_*)\n\tfunc_quote_for_eval \"$arg\"\n\targ=$func_quote_for_eval_result\n\t;;\n\n      # Flags to be passed through unchanged, with rationale:\n      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler\n      # -r[0-9][0-9]*        specify processor for the SGI compiler\n      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler\n      # +DA*, +DD*           enable 64-bit mode for the HP compiler\n      # -q*                  compiler args for the IBM compiler\n      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC\n      # -F/path              path to uninstalled frameworks, gcc on darwin\n      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC\n      # -fstack-protector*   stack protector flags for GCC\n      # @file                GCC response files\n      # -tp=*                Portland pgcc target processor selection\n      # --sysroot=*          for sysroot support\n      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization\n      # -stdlib=*            select c++ std lib with clang\n      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \\\n      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \\\n      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)\n        func_quote_for_eval \"$arg\"\n\targ=$func_quote_for_eval_result\n        func_append compile_command \" $arg\"\n        func_append finalize_command \" $arg\"\n        func_append compiler_flags \" $arg\"\n        continue\n        ;;\n\n      -Z*)\n        if test os2 = \"`expr $host : '.*\\(os2\\)'`\"; then\n          # OS/2 uses -Zxxx to specify OS/2-specific options\n\t  compiler_flags=\"$compiler_flags $arg\"\n\t  func_append compile_command \" $arg\"\n\t  func_append finalize_command \" $arg\"\n\t  case $arg in\n\t  -Zlinker | -Zstack)\n\t    prev=xcompiler\n\t    ;;\n\t  esac\n\t  continue\n        else\n\t  # Otherwise treat like 'Some other compiler flag' below\n\t  func_quote_for_eval \"$arg\"\n\t  arg=$func_quote_for_eval_result\n        fi\n\t;;\n\n      # Some other compiler flag.\n      -* | +*)\n        func_quote_for_eval \"$arg\"\n\targ=$func_quote_for_eval_result\n\t;;\n\n      *.$objext)\n\t# A standard object.\n\tfunc_append objs \" $arg\"\n\t;;\n\n      *.lo)\n\t# A libtool-controlled object.\n\n\t# Check to see that this really is a libtool object.\n\tif func_lalib_unsafe_p \"$arg\"; then\n\t  pic_object=\n\t  non_pic_object=\n\n\t  # Read the .lo file\n\t  func_source \"$arg\"\n\n\t  if test -z \"$pic_object\" ||\n\t     test -z \"$non_pic_object\" ||\n\t     test none = \"$pic_object\" &&\n\t     test none = \"$non_pic_object\"; then\n\t    func_fatal_error \"cannot find name of object for '$arg'\"\n\t  fi\n\n\t  # Extract subdirectory from the argument.\n\t  func_dirname \"$arg\" \"/\" \"\"\n\t  xdir=$func_dirname_result\n\n\t  test none = \"$pic_object\" || {\n\t    # Prepend the subdirectory the object is found in.\n\t    pic_object=$xdir$pic_object\n\n\t    if test dlfiles = \"$prev\"; then\n\t      if test yes = \"$build_libtool_libs\" && test yes = \"$dlopen_support\"; then\n\t\tfunc_append dlfiles \" $pic_object\"\n\t\tprev=\n\t\tcontinue\n\t      else\n\t\t# If libtool objects are unsupported, then we need to preload.\n\t\tprev=dlprefiles\n\t      fi\n\t    fi\n\n\t    # CHECK ME:  I think I busted this.  -Ossama\n\t    if test dlprefiles = \"$prev\"; then\n\t      # Preload the old-style object.\n\t      func_append dlprefiles \" $pic_object\"\n\t      prev=\n\t    fi\n\n\t    # A PIC object.\n\t    func_append libobjs \" $pic_object\"\n\t    arg=$pic_object\n\t  }\n\n\t  # Non-PIC object.\n\t  if test none != \"$non_pic_object\"; then\n\t    # Prepend the subdirectory the object is found in.\n\t    non_pic_object=$xdir$non_pic_object\n\n\t    # A standard non-PIC object\n\t    func_append non_pic_objects \" $non_pic_object\"\n\t    if test -z \"$pic_object\" || test none = \"$pic_object\"; then\n\t      arg=$non_pic_object\n\t    fi\n\t  else\n\t    # If the PIC object exists, use it instead.\n\t    # $xdir was prepended to $pic_object above.\n\t    non_pic_object=$pic_object\n\t    func_append non_pic_objects \" $non_pic_object\"\n\t  fi\n\telse\n\t  # Only an error if not doing a dry-run.\n\t  if $opt_dry_run; then\n\t    # Extract subdirectory from the argument.\n\t    func_dirname \"$arg\" \"/\" \"\"\n\t    xdir=$func_dirname_result\n\n\t    func_lo2o \"$arg\"\n\t    pic_object=$xdir$objdir/$func_lo2o_result\n\t    non_pic_object=$xdir$func_lo2o_result\n\t    func_append libobjs \" $pic_object\"\n\t    func_append non_pic_objects \" $non_pic_object\"\n\t  else\n\t    func_fatal_error \"'$arg' is not a valid libtool object\"\n\t  fi\n\tfi\n\t;;\n\n      *.$libext)\n\t# An archive.\n\tfunc_append deplibs \" $arg\"\n\tfunc_append old_deplibs \" $arg\"\n\tcontinue\n\t;;\n\n      *.la)\n\t# A libtool-controlled library.\n\n\tfunc_resolve_sysroot \"$arg\"\n\tif test dlfiles = \"$prev\"; then\n\t  # This library was specified with -dlopen.\n\t  func_append dlfiles \" $func_resolve_sysroot_result\"\n\t  prev=\n\telif test dlprefiles = \"$prev\"; then\n\t  # The library was specified with -dlpreopen.\n\t  func_append dlprefiles \" $func_resolve_sysroot_result\"\n\t  prev=\n\telse\n\t  func_append deplibs \" $func_resolve_sysroot_result\"\n\tfi\n\tcontinue\n\t;;\n\n      # Some other compiler argument.\n      *)\n\t# Unknown arguments in both finalize_command and compile_command need\n\t# to be aesthetically quoted because they are evaled later.\n\tfunc_quote_for_eval \"$arg\"\n\targ=$func_quote_for_eval_result\n\t;;\n      esac # arg\n\n      # Now actually substitute the argument into the commands.\n      if test -n \"$arg\"; then\n\tfunc_append compile_command \" $arg\"\n\tfunc_append finalize_command \" $arg\"\n      fi\n    done # argument parsing loop\n\n    test -n \"$prev\" && \\\n      func_fatal_help \"the '$prevarg' option requires an argument\"\n\n    if test yes = \"$export_dynamic\" && test -n \"$export_dynamic_flag_spec\"; then\n      eval arg=\\\"$export_dynamic_flag_spec\\\"\n      func_append compile_command \" $arg\"\n      func_append finalize_command \" $arg\"\n    fi\n\n    oldlibs=\n    # calculate the name of the file, without its directory\n    func_basename \"$output\"\n    outputname=$func_basename_result\n    libobjs_save=$libobjs\n\n    if test -n \"$shlibpath_var\"; then\n      # get the directories listed in $shlibpath_var\n      eval shlib_search_path=\\`\\$ECHO \\\"\\$$shlibpath_var\\\" \\| \\$SED \\'s/:/ /g\\'\\`\n    else\n      shlib_search_path=\n    fi\n    eval sys_lib_search_path=\\\"$sys_lib_search_path_spec\\\"\n    eval sys_lib_dlsearch_path=\\\"$sys_lib_dlsearch_path_spec\\\"\n\n    # Definition is injected by LT_CONFIG during libtool generation.\n    func_munge_path_list sys_lib_dlsearch_path \"$LT_SYS_LIBRARY_PATH\"\n\n    func_dirname \"$output\" \"/\" \"\"\n    output_objdir=$func_dirname_result$objdir\n    func_to_tool_file \"$output_objdir/\"\n    tool_output_objdir=$func_to_tool_file_result\n    # Create the object directory.\n    func_mkdir_p \"$output_objdir\"\n\n    # Determine the type of output\n    case $output in\n    \"\")\n      func_fatal_help \"you must specify an output file\"\n      ;;\n    *.$libext) linkmode=oldlib ;;\n    *.lo | *.$objext) linkmode=obj ;;\n    *.la) linkmode=lib ;;\n    *) linkmode=prog ;; # Anything else should be a program.\n    esac\n\n    specialdeplibs=\n\n    libs=\n    # Find all interdependent deplibs by searching for libraries\n    # that are linked more than once (e.g. -la -lb -la)\n    for deplib in $deplibs; do\n      if $opt_preserve_dup_deps; then\n\tcase \"$libs \" in\n\t*\" $deplib \"*) func_append specialdeplibs \" $deplib\" ;;\n\tesac\n      fi\n      func_append libs \" $deplib\"\n    done\n\n    if test lib = \"$linkmode\"; then\n      libs=\"$predeps $libs $compiler_lib_search_path $postdeps\"\n\n      # Compute libraries that are listed more than once in $predeps\n      # $postdeps and mark them as special (i.e., whose duplicates are\n      # not to be eliminated).\n      pre_post_deps=\n      if $opt_duplicate_compiler_generated_deps; then\n\tfor pre_post_dep in $predeps $postdeps; do\n\t  case \"$pre_post_deps \" in\n\t  *\" $pre_post_dep \"*) func_append specialdeplibs \" $pre_post_deps\" ;;\n\t  esac\n\t  func_append pre_post_deps \" $pre_post_dep\"\n\tdone\n      fi\n      pre_post_deps=\n    fi\n\n    deplibs=\n    newdependency_libs=\n    newlib_search_path=\n    need_relink=no # whether we're linking any uninstalled libtool libraries\n    notinst_deplibs= # not-installed libtool libraries\n    notinst_path= # paths that contain not-installed libtool libraries\n\n    case $linkmode in\n    lib)\n\tpasses=\"conv dlpreopen link\"\n\tfor file in $dlfiles $dlprefiles; do\n\t  case $file in\n\t  *.la) ;;\n\t  *)\n\t    func_fatal_help \"libraries can '-dlopen' only libtool libraries: $file\"\n\t    ;;\n\t  esac\n\tdone\n\t;;\n    prog)\n\tcompile_deplibs=\n\tfinalize_deplibs=\n\talldeplibs=false\n\tnewdlfiles=\n\tnewdlprefiles=\n\tpasses=\"conv scan dlopen dlpreopen link\"\n\t;;\n    *)  passes=\"conv\"\n\t;;\n    esac\n\n    for pass in $passes; do\n      # The preopen pass in lib mode reverses $deplibs; put it back here\n      # so that -L comes before libs that need it for instance...\n      if test lib,link = \"$linkmode,$pass\"; then\n\t## FIXME: Find the place where the list is rebuilt in the wrong\n\t##        order, and fix it there properly\n        tmp_deplibs=\n\tfor deplib in $deplibs; do\n\t  tmp_deplibs=\"$deplib $tmp_deplibs\"\n\tdone\n\tdeplibs=$tmp_deplibs\n      fi\n\n      if test lib,link = \"$linkmode,$pass\" ||\n\t test prog,scan = \"$linkmode,$pass\"; then\n\tlibs=$deplibs\n\tdeplibs=\n      fi\n      if test prog = \"$linkmode\"; then\n\tcase $pass in\n\tdlopen) libs=$dlfiles ;;\n\tdlpreopen) libs=$dlprefiles ;;\n\tlink) libs=\"$deplibs %DEPLIBS% $dependency_libs\" ;;\n\tesac\n      fi\n      if test lib,dlpreopen = \"$linkmode,$pass\"; then\n\t# Collect and forward deplibs of preopened libtool libs\n\tfor lib in $dlprefiles; do\n\t  # Ignore non-libtool-libs\n\t  dependency_libs=\n\t  func_resolve_sysroot \"$lib\"\n\t  case $lib in\n\t  *.la)\tfunc_source \"$func_resolve_sysroot_result\" ;;\n\t  esac\n\n\t  # Collect preopened libtool deplibs, except any this library\n\t  # has declared as weak libs\n\t  for deplib in $dependency_libs; do\n\t    func_basename \"$deplib\"\n            deplib_base=$func_basename_result\n\t    case \" $weak_libs \" in\n\t    *\" $deplib_base \"*) ;;\n\t    *) func_append deplibs \" $deplib\" ;;\n\t    esac\n\t  done\n\tdone\n\tlibs=$dlprefiles\n      fi\n      if test dlopen = \"$pass\"; then\n\t# Collect dlpreopened libraries\n\tsave_deplibs=$deplibs\n\tdeplibs=\n      fi\n\n      for deplib in $libs; do\n\tlib=\n\tfound=false\n\tcase $deplib in\n\t-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \\\n        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)\n\t  if test prog,link = \"$linkmode,$pass\"; then\n\t    compile_deplibs=\"$deplib $compile_deplibs\"\n\t    finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t  else\n\t    func_append compiler_flags \" $deplib\"\n\t    if test lib = \"$linkmode\"; then\n\t\tcase \"$new_inherited_linker_flags \" in\n\t\t    *\" $deplib \"*) ;;\n\t\t    * ) func_append new_inherited_linker_flags \" $deplib\" ;;\n\t\tesac\n\t    fi\n\t  fi\n\t  continue\n\t  ;;\n\t-l*)\n\t  if test lib != \"$linkmode\" && test prog != \"$linkmode\"; then\n\t    func_warning \"'-l' is ignored for archives/objects\"\n\t    continue\n\t  fi\n\t  func_stripname '-l' '' \"$deplib\"\n\t  name=$func_stripname_result\n\t  if test lib = \"$linkmode\"; then\n\t    searchdirs=\"$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path\"\n\t  else\n\t    searchdirs=\"$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path\"\n\t  fi\n\t  for searchdir in $searchdirs; do\n\t    for search_ext in .la $std_shrext .so .a; do\n\t      # Search the libtool library\n\t      lib=$searchdir/lib$name$search_ext\n\t      if test -f \"$lib\"; then\n\t\tif test .la = \"$search_ext\"; then\n\t\t  found=:\n\t\telse\n\t\t  found=false\n\t\tfi\n\t\tbreak 2\n\t      fi\n\t    done\n\t  done\n\t  if $found; then\n\t    # deplib is a libtool library\n\t    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,\n\t    # We need to do some special things here, and not later.\n\t    if test yes = \"$allow_libtool_libs_with_static_runtimes\"; then\n\t      case \" $predeps $postdeps \" in\n\t      *\" $deplib \"*)\n\t\tif func_lalib_p \"$lib\"; then\n\t\t  library_names=\n\t\t  old_library=\n\t\t  func_source \"$lib\"\n\t\t  for l in $old_library $library_names; do\n\t\t    ll=$l\n\t\t  done\n\t\t  if test \"X$ll\" = \"X$old_library\"; then # only static version available\n\t\t    found=false\n\t\t    func_dirname \"$lib\" \"\" \".\"\n\t\t    ladir=$func_dirname_result\n\t\t    lib=$ladir/$old_library\n\t\t    if test prog,link = \"$linkmode,$pass\"; then\n\t\t      compile_deplibs=\"$deplib $compile_deplibs\"\n\t\t      finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t\t    else\n\t\t      deplibs=\"$deplib $deplibs\"\n\t\t      test lib = \"$linkmode\" && newdependency_libs=\"$deplib $newdependency_libs\"\n\t\t    fi\n\t\t    continue\n\t\t  fi\n\t\tfi\n\t\t;;\n\t      *) ;;\n\t      esac\n\t    fi\n\t  else\n\t    # deplib doesn't seem to be a libtool library\n\t    if test prog,link = \"$linkmode,$pass\"; then\n\t      compile_deplibs=\"$deplib $compile_deplibs\"\n\t      finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t    else\n\t      deplibs=\"$deplib $deplibs\"\n\t      test lib = \"$linkmode\" && newdependency_libs=\"$deplib $newdependency_libs\"\n\t    fi\n\t    continue\n\t  fi\n\t  ;; # -l\n\t*.ltframework)\n\t  if test prog,link = \"$linkmode,$pass\"; then\n\t    compile_deplibs=\"$deplib $compile_deplibs\"\n\t    finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t  else\n\t    deplibs=\"$deplib $deplibs\"\n\t    if test lib = \"$linkmode\"; then\n\t\tcase \"$new_inherited_linker_flags \" in\n\t\t    *\" $deplib \"*) ;;\n\t\t    * ) func_append new_inherited_linker_flags \" $deplib\" ;;\n\t\tesac\n\t    fi\n\t  fi\n\t  continue\n\t  ;;\n\t-L*)\n\t  case $linkmode in\n\t  lib)\n\t    deplibs=\"$deplib $deplibs\"\n\t    test conv = \"$pass\" && continue\n\t    newdependency_libs=\"$deplib $newdependency_libs\"\n\t    func_stripname '-L' '' \"$deplib\"\n\t    func_resolve_sysroot \"$func_stripname_result\"\n\t    func_append newlib_search_path \" $func_resolve_sysroot_result\"\n\t    ;;\n\t  prog)\n\t    if test conv = \"$pass\"; then\n\t      deplibs=\"$deplib $deplibs\"\n\t      continue\n\t    fi\n\t    if test scan = \"$pass\"; then\n\t      deplibs=\"$deplib $deplibs\"\n\t    else\n\t      compile_deplibs=\"$deplib $compile_deplibs\"\n\t      finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t    fi\n\t    func_stripname '-L' '' \"$deplib\"\n\t    func_resolve_sysroot \"$func_stripname_result\"\n\t    func_append newlib_search_path \" $func_resolve_sysroot_result\"\n\t    ;;\n\t  *)\n\t    func_warning \"'-L' is ignored for archives/objects\"\n\t    ;;\n\t  esac # linkmode\n\t  continue\n\t  ;; # -L\n\t-R*)\n\t  if test link = \"$pass\"; then\n\t    func_stripname '-R' '' \"$deplib\"\n\t    func_resolve_sysroot \"$func_stripname_result\"\n\t    dir=$func_resolve_sysroot_result\n\t    # Make sure the xrpath contains only unique directories.\n\t    case \"$xrpath \" in\n\t    *\" $dir \"*) ;;\n\t    *) func_append xrpath \" $dir\" ;;\n\t    esac\n\t  fi\n\t  deplibs=\"$deplib $deplibs\"\n\t  continue\n\t  ;;\n\t*.la)\n\t  func_resolve_sysroot \"$deplib\"\n\t  lib=$func_resolve_sysroot_result\n\t  ;;\n\t*.$libext)\n\t  if test conv = \"$pass\"; then\n\t    deplibs=\"$deplib $deplibs\"\n\t    continue\n\t  fi\n\t  case $linkmode in\n\t  lib)\n\t    # Linking convenience modules into shared libraries is allowed,\n\t    # but linking other static libraries is non-portable.\n\t    case \" $dlpreconveniencelibs \" in\n\t    *\" $deplib \"*) ;;\n\t    *)\n\t      valid_a_lib=false\n\t      case $deplibs_check_method in\n\t\tmatch_pattern*)\n\t\t  set dummy $deplibs_check_method; shift\n\t\t  match_pattern_regex=`expr \"$deplibs_check_method\" : \"$1 \\(.*\\)\"`\n\t\t  if eval \"\\$ECHO \\\"$deplib\\\"\" 2>/dev/null | $SED 10q \\\n\t\t    | $EGREP \"$match_pattern_regex\" > /dev/null; then\n\t\t    valid_a_lib=:\n\t\t  fi\n\t\t;;\n\t\tpass_all)\n\t\t  valid_a_lib=:\n\t\t;;\n\t      esac\n\t      if $valid_a_lib; then\n\t\techo\n\t\t$ECHO \"*** Warning: Linking the shared library $output against the\"\n\t\t$ECHO \"*** static library $deplib is not portable!\"\n\t\tdeplibs=\"$deplib $deplibs\"\n\t      else\n\t\techo\n\t\t$ECHO \"*** Warning: Trying to link with static lib archive $deplib.\"\n\t\techo \"*** I have the capability to make that library automatically link in when\"\n\t\techo \"*** you link to this library.  But I can only do this if you have a\"\n\t\techo \"*** shared version of the library, which you do not appear to have\"\n\t\techo \"*** because the file extensions .$libext of this argument makes me believe\"\n\t\techo \"*** that it is just a static archive that I should not use here.\"\n\t      fi\n\t      ;;\n\t    esac\n\t    continue\n\t    ;;\n\t  prog)\n\t    if test link != \"$pass\"; then\n\t      deplibs=\"$deplib $deplibs\"\n\t    else\n\t      compile_deplibs=\"$deplib $compile_deplibs\"\n\t      finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t    fi\n\t    continue\n\t    ;;\n\t  esac # linkmode\n\t  ;; # *.$libext\n\t*.lo | *.$objext)\n\t  if test conv = \"$pass\"; then\n\t    deplibs=\"$deplib $deplibs\"\n\t  elif test prog = \"$linkmode\"; then\n\t    if test dlpreopen = \"$pass\" || test yes != \"$dlopen_support\" || test no = \"$build_libtool_libs\"; then\n\t      # If there is no dlopen support or we're linking statically,\n\t      # we need to preload.\n\t      func_append newdlprefiles \" $deplib\"\n\t      compile_deplibs=\"$deplib $compile_deplibs\"\n\t      finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t    else\n\t      func_append newdlfiles \" $deplib\"\n\t    fi\n\t  fi\n\t  continue\n\t  ;;\n\t%DEPLIBS%)\n\t  alldeplibs=:\n\t  continue\n\t  ;;\n\tesac # case $deplib\n\n\t$found || test -f \"$lib\" \\\n\t  || func_fatal_error \"cannot find the library '$lib' or unhandled argument '$deplib'\"\n\n\t# Check to see that this really is a libtool archive.\n\tfunc_lalib_unsafe_p \"$lib\" \\\n\t  || func_fatal_error \"'$lib' is not a valid libtool archive\"\n\n\tfunc_dirname \"$lib\" \"\" \".\"\n\tladir=$func_dirname_result\n\n\tdlname=\n\tdlopen=\n\tdlpreopen=\n\tlibdir=\n\tlibrary_names=\n\told_library=\n\tinherited_linker_flags=\n\t# If the library was installed with an old release of libtool,\n\t# it will not redefine variables installed, or shouldnotlink\n\tinstalled=yes\n\tshouldnotlink=no\n\tavoidtemprpath=\n\n\n\t# Read the .la file\n\tfunc_source \"$lib\"\n\n\t# Convert \"-framework foo\" to \"foo.ltframework\"\n\tif test -n \"$inherited_linker_flags\"; then\n\t  tmp_inherited_linker_flags=`$ECHO \"$inherited_linker_flags\" | $SED 's/-framework \\([^ $]*\\)/\\1.ltframework/g'`\n\t  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do\n\t    case \" $new_inherited_linker_flags \" in\n\t      *\" $tmp_inherited_linker_flag \"*) ;;\n\t      *) func_append new_inherited_linker_flags \" $tmp_inherited_linker_flag\";;\n\t    esac\n\t  done\n\tfi\n\tdependency_libs=`$ECHO \" $dependency_libs\" | $SED 's% \\([^ $]*\\).ltframework% -framework \\1%g'`\n\tif test lib,link = \"$linkmode,$pass\" ||\n\t   test prog,scan = \"$linkmode,$pass\" ||\n\t   { test prog != \"$linkmode\" && test lib != \"$linkmode\"; }; then\n\t  test -n \"$dlopen\" && func_append dlfiles \" $dlopen\"\n\t  test -n \"$dlpreopen\" && func_append dlprefiles \" $dlpreopen\"\n\tfi\n\n\tif test conv = \"$pass\"; then\n\t  # Only check for convenience libraries\n\t  deplibs=\"$lib $deplibs\"\n\t  if test -z \"$libdir\"; then\n\t    if test -z \"$old_library\"; then\n\t      func_fatal_error \"cannot find name of link library for '$lib'\"\n\t    fi\n\t    # It is a libtool convenience library, so add in its objects.\n\t    func_append convenience \" $ladir/$objdir/$old_library\"\n\t    func_append old_convenience \" $ladir/$objdir/$old_library\"\n\t  elif test prog != \"$linkmode\" && test lib != \"$linkmode\"; then\n\t    func_fatal_error \"'$lib' is not a convenience library\"\n\t  fi\n\t  tmp_libs=\n\t  for deplib in $dependency_libs; do\n\t    deplibs=\"$deplib $deplibs\"\n\t    if $opt_preserve_dup_deps; then\n\t      case \"$tmp_libs \" in\n\t      *\" $deplib \"*) func_append specialdeplibs \" $deplib\" ;;\n\t      esac\n\t    fi\n\t    func_append tmp_libs \" $deplib\"\n\t  done\n\t  continue\n\tfi # $pass = conv\n\n\n\t# Get the name of the library we link against.\n\tlinklib=\n\tif test -n \"$old_library\" &&\n\t   { test yes = \"$prefer_static_libs\" ||\n\t     test built,no = \"$prefer_static_libs,$installed\"; }; then\n\t  linklib=$old_library\n\telse\n\t  for l in $old_library $library_names; do\n\t    linklib=$l\n\t  done\n\tfi\n\tif test -z \"$linklib\"; then\n\t  func_fatal_error \"cannot find name of link library for '$lib'\"\n\tfi\n\n\t# This library was specified with -dlopen.\n\tif test dlopen = \"$pass\"; then\n\t  test -z \"$libdir\" \\\n\t    && func_fatal_error \"cannot -dlopen a convenience library: '$lib'\"\n\t  if test -z \"$dlname\" ||\n\t     test yes != \"$dlopen_support\" ||\n\t     test no = \"$build_libtool_libs\"\n\t  then\n\t    # If there is no dlname, no dlopen support or we're linking\n\t    # statically, we need to preload.  We also need to preload any\n\t    # dependent libraries so libltdl's deplib preloader doesn't\n\t    # bomb out in the load deplibs phase.\n\t    func_append dlprefiles \" $lib $dependency_libs\"\n\t  else\n\t    func_append newdlfiles \" $lib\"\n\t  fi\n\t  continue\n\tfi # $pass = dlopen\n\n\t# We need an absolute path.\n\tcase $ladir in\n\t[\\\\/]* | [A-Za-z]:[\\\\/]*) abs_ladir=$ladir ;;\n\t*)\n\t  abs_ladir=`cd \"$ladir\" && pwd`\n\t  if test -z \"$abs_ladir\"; then\n\t    func_warning \"cannot determine absolute directory name of '$ladir'\"\n\t    func_warning \"passing it literally to the linker, although it might fail\"\n\t    abs_ladir=$ladir\n\t  fi\n\t  ;;\n\tesac\n\tfunc_basename \"$lib\"\n\tlaname=$func_basename_result\n\n\t# Find the relevant object directory and library name.\n\tif test yes = \"$installed\"; then\n\t  if test ! -f \"$lt_sysroot$libdir/$linklib\" && test -f \"$abs_ladir/$linklib\"; then\n\t    func_warning \"library '$lib' was moved.\"\n\t    dir=$ladir\n\t    absdir=$abs_ladir\n\t    libdir=$abs_ladir\n\t  else\n\t    dir=$lt_sysroot$libdir\n\t    absdir=$lt_sysroot$libdir\n\t  fi\n\t  test yes = \"$hardcode_automatic\" && avoidtemprpath=yes\n\telse\n\t  if test ! -f \"$ladir/$objdir/$linklib\" && test -f \"$abs_ladir/$linklib\"; then\n\t    dir=$ladir\n\t    absdir=$abs_ladir\n\t    # Remove this search path later\n\t    func_append notinst_path \" $abs_ladir\"\n\t  else\n\t    dir=$ladir/$objdir\n\t    absdir=$abs_ladir/$objdir\n\t    # Remove this search path later\n\t    func_append notinst_path \" $abs_ladir\"\n\t  fi\n\tfi # $installed = yes\n\tfunc_stripname 'lib' '.la' \"$laname\"\n\tname=$func_stripname_result\n\n\t# This library was specified with -dlpreopen.\n\tif test dlpreopen = \"$pass\"; then\n\t  if test -z \"$libdir\" && test prog = \"$linkmode\"; then\n\t    func_fatal_error \"only libraries may -dlpreopen a convenience library: '$lib'\"\n\t  fi\n\t  case $host in\n\t    # special handling for platforms with PE-DLLs.\n\t    *cygwin* | *mingw* | *cegcc* )\n\t      # Linker will automatically link against shared library if both\n\t      # static and shared are present.  Therefore, ensure we extract\n\t      # symbols from the import library if a shared library is present\n\t      # (otherwise, the dlopen module name will be incorrect).  We do\n\t      # this by putting the import library name into $newdlprefiles.\n\t      # We recover the dlopen module name by 'saving' the la file\n\t      # name in a special purpose variable, and (later) extracting the\n\t      # dlname from the la file.\n\t      if test -n \"$dlname\"; then\n\t        func_tr_sh \"$dir/$linklib\"\n\t        eval \"libfile_$func_tr_sh_result=\\$abs_ladir/\\$laname\"\n\t        func_append newdlprefiles \" $dir/$linklib\"\n\t      else\n\t        func_append newdlprefiles \" $dir/$old_library\"\n\t        # Keep a list of preopened convenience libraries to check\n\t        # that they are being used correctly in the link pass.\n\t        test -z \"$libdir\" && \\\n\t          func_append dlpreconveniencelibs \" $dir/$old_library\"\n\t      fi\n\t    ;;\n\t    * )\n\t      # Prefer using a static library (so that no silly _DYNAMIC symbols\n\t      # are required to link).\n\t      if test -n \"$old_library\"; then\n\t        func_append newdlprefiles \" $dir/$old_library\"\n\t        # Keep a list of preopened convenience libraries to check\n\t        # that they are being used correctly in the link pass.\n\t        test -z \"$libdir\" && \\\n\t          func_append dlpreconveniencelibs \" $dir/$old_library\"\n\t      # Otherwise, use the dlname, so that lt_dlopen finds it.\n\t      elif test -n \"$dlname\"; then\n\t        func_append newdlprefiles \" $dir/$dlname\"\n\t      else\n\t        func_append newdlprefiles \" $dir/$linklib\"\n\t      fi\n\t    ;;\n\t  esac\n\tfi # $pass = dlpreopen\n\n\tif test -z \"$libdir\"; then\n\t  # Link the convenience library\n\t  if test lib = \"$linkmode\"; then\n\t    deplibs=\"$dir/$old_library $deplibs\"\n\t  elif test prog,link = \"$linkmode,$pass\"; then\n\t    compile_deplibs=\"$dir/$old_library $compile_deplibs\"\n\t    finalize_deplibs=\"$dir/$old_library $finalize_deplibs\"\n\t  else\n\t    deplibs=\"$lib $deplibs\" # used for prog,scan pass\n\t  fi\n\t  continue\n\tfi\n\n\n\tif test prog = \"$linkmode\" && test link != \"$pass\"; then\n\t  func_append newlib_search_path \" $ladir\"\n\t  deplibs=\"$lib $deplibs\"\n\n\t  linkalldeplibs=false\n\t  if test no != \"$link_all_deplibs\" || test -z \"$library_names\" ||\n\t     test no = \"$build_libtool_libs\"; then\n\t    linkalldeplibs=:\n\t  fi\n\n\t  tmp_libs=\n\t  for deplib in $dependency_libs; do\n\t    case $deplib in\n\t    -L*) func_stripname '-L' '' \"$deplib\"\n\t         func_resolve_sysroot \"$func_stripname_result\"\n\t         func_append newlib_search_path \" $func_resolve_sysroot_result\"\n\t\t ;;\n\t    esac\n\t    # Need to link against all dependency_libs?\n\t    if $linkalldeplibs; then\n\t      deplibs=\"$deplib $deplibs\"\n\t    else\n\t      # Need to hardcode shared library paths\n\t      # or/and link against static libraries\n\t      newdependency_libs=\"$deplib $newdependency_libs\"\n\t    fi\n\t    if $opt_preserve_dup_deps; then\n\t      case \"$tmp_libs \" in\n\t      *\" $deplib \"*) func_append specialdeplibs \" $deplib\" ;;\n\t      esac\n\t    fi\n\t    func_append tmp_libs \" $deplib\"\n\t  done # for deplib\n\t  continue\n\tfi # $linkmode = prog...\n\n\tif test prog,link = \"$linkmode,$pass\"; then\n\t  if test -n \"$library_names\" &&\n\t     { { test no = \"$prefer_static_libs\" ||\n\t         test built,yes = \"$prefer_static_libs,$installed\"; } ||\n\t       test -z \"$old_library\"; }; then\n\t    # We need to hardcode the library path\n\t    if test -n \"$shlibpath_var\" && test -z \"$avoidtemprpath\"; then\n\t      # Make sure the rpath contains only unique directories.\n\t      case $temp_rpath: in\n\t      *\"$absdir:\"*) ;;\n\t      *) func_append temp_rpath \"$absdir:\" ;;\n\t      esac\n\t    fi\n\n\t    # Hardcode the library path.\n\t    # Skip directories that are in the system default run-time\n\t    # search path.\n\t    case \" $sys_lib_dlsearch_path \" in\n\t    *\" $absdir \"*) ;;\n\t    *)\n\t      case \"$compile_rpath \" in\n\t      *\" $absdir \"*) ;;\n\t      *) func_append compile_rpath \" $absdir\" ;;\n\t      esac\n\t      ;;\n\t    esac\n\t    case \" $sys_lib_dlsearch_path \" in\n\t    *\" $libdir \"*) ;;\n\t    *)\n\t      case \"$finalize_rpath \" in\n\t      *\" $libdir \"*) ;;\n\t      *) func_append finalize_rpath \" $libdir\" ;;\n\t      esac\n\t      ;;\n\t    esac\n\t  fi # $linkmode,$pass = prog,link...\n\n\t  if $alldeplibs &&\n\t     { test pass_all = \"$deplibs_check_method\" ||\n\t       { test yes = \"$build_libtool_libs\" &&\n\t\t test -n \"$library_names\"; }; }; then\n\t    # We only need to search for static libraries\n\t    continue\n\t  fi\n\tfi\n\n\tlink_static=no # Whether the deplib will be linked statically\n\tuse_static_libs=$prefer_static_libs\n\tif test built = \"$use_static_libs\" && test yes = \"$installed\"; then\n\t  use_static_libs=no\n\tfi\n\tif test -n \"$library_names\" &&\n\t   { test no = \"$use_static_libs\" || test -z \"$old_library\"; }; then\n\t  case $host in\n\t  *cygwin* | *mingw* | *cegcc* | *os2*)\n\t      # No point in relinking DLLs because paths are not encoded\n\t      func_append notinst_deplibs \" $lib\"\n\t      need_relink=no\n\t    ;;\n\t  *)\n\t    if test no = \"$installed\"; then\n\t      func_append notinst_deplibs \" $lib\"\n\t      need_relink=yes\n\t    fi\n\t    ;;\n\t  esac\n\t  # This is a shared library\n\n\t  # Warn about portability, can't link against -module's on some\n\t  # systems (darwin).  Don't bleat about dlopened modules though!\n\t  dlopenmodule=\n\t  for dlpremoduletest in $dlprefiles; do\n\t    if test \"X$dlpremoduletest\" = \"X$lib\"; then\n\t      dlopenmodule=$dlpremoduletest\n\t      break\n\t    fi\n\t  done\n\t  if test -z \"$dlopenmodule\" && test yes = \"$shouldnotlink\" && test link = \"$pass\"; then\n\t    echo\n\t    if test prog = \"$linkmode\"; then\n\t      $ECHO \"*** Warning: Linking the executable $output against the loadable module\"\n\t    else\n\t      $ECHO \"*** Warning: Linking the shared library $output against the loadable module\"\n\t    fi\n\t    $ECHO \"*** $linklib is not portable!\"\n\t  fi\n\t  if test lib = \"$linkmode\" &&\n\t     test yes = \"$hardcode_into_libs\"; then\n\t    # Hardcode the library path.\n\t    # Skip directories that are in the system default run-time\n\t    # search path.\n\t    case \" $sys_lib_dlsearch_path \" in\n\t    *\" $absdir \"*) ;;\n\t    *)\n\t      case \"$compile_rpath \" in\n\t      *\" $absdir \"*) ;;\n\t      *) func_append compile_rpath \" $absdir\" ;;\n\t      esac\n\t      ;;\n\t    esac\n\t    case \" $sys_lib_dlsearch_path \" in\n\t    *\" $libdir \"*) ;;\n\t    *)\n\t      case \"$finalize_rpath \" in\n\t      *\" $libdir \"*) ;;\n\t      *) func_append finalize_rpath \" $libdir\" ;;\n\t      esac\n\t      ;;\n\t    esac\n\t  fi\n\n\t  if test -n \"$old_archive_from_expsyms_cmds\"; then\n\t    # figure out the soname\n\t    set dummy $library_names\n\t    shift\n\t    realname=$1\n\t    shift\n\t    libname=`eval \"\\\\$ECHO \\\"$libname_spec\\\"\"`\n\t    # use dlname if we got it. it's perfectly good, no?\n\t    if test -n \"$dlname\"; then\n\t      soname=$dlname\n\t    elif test -n \"$soname_spec\"; then\n\t      # bleh windows\n\t      case $host in\n\t      *cygwin* | mingw* | *cegcc* | *os2*)\n\t        func_arith $current - $age\n\t\tmajor=$func_arith_result\n\t\tversuffix=-$major\n\t\t;;\n\t      esac\n\t      eval soname=\\\"$soname_spec\\\"\n\t    else\n\t      soname=$realname\n\t    fi\n\n\t    # Make a new name for the extract_expsyms_cmds to use\n\t    soroot=$soname\n\t    func_basename \"$soroot\"\n\t    soname=$func_basename_result\n\t    func_stripname 'lib' '.dll' \"$soname\"\n\t    newlib=libimp-$func_stripname_result.a\n\n\t    # If the library has no export list, then create one now\n\t    if test -f \"$output_objdir/$soname-def\"; then :\n\t    else\n\t      func_verbose \"extracting exported symbol list from '$soname'\"\n\t      func_execute_cmds \"$extract_expsyms_cmds\" 'exit $?'\n\t    fi\n\n\t    # Create $newlib\n\t    if test -f \"$output_objdir/$newlib\"; then :; else\n\t      func_verbose \"generating import library for '$soname'\"\n\t      func_execute_cmds \"$old_archive_from_expsyms_cmds\" 'exit $?'\n\t    fi\n\t    # make sure the library variables are pointing to the new library\n\t    dir=$output_objdir\n\t    linklib=$newlib\n\t  fi # test -n \"$old_archive_from_expsyms_cmds\"\n\n\t  if test prog = \"$linkmode\" || test relink != \"$opt_mode\"; then\n\t    add_shlibpath=\n\t    add_dir=\n\t    add=\n\t    lib_linked=yes\n\t    case $hardcode_action in\n\t    immediate | unsupported)\n\t      if test no = \"$hardcode_direct\"; then\n\t\tadd=$dir/$linklib\n\t\tcase $host in\n\t\t  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;\n\t\t  *-*-sysv4*uw2*) add_dir=-L$dir ;;\n\t\t  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \\\n\t\t    *-*-unixware7*) add_dir=-L$dir ;;\n\t\t  *-*-darwin* )\n\t\t    # if the lib is a (non-dlopened) module then we cannot\n\t\t    # link against it, someone is ignoring the earlier warnings\n\t\t    if /usr/bin/file -L $add 2> /dev/null |\n\t\t\t $GREP \": [^:]* bundle\" >/dev/null; then\n\t\t      if test \"X$dlopenmodule\" != \"X$lib\"; then\n\t\t\t$ECHO \"*** Warning: lib $linklib is a module, not a shared library\"\n\t\t\tif test -z \"$old_library\"; then\n\t\t\t  echo\n\t\t\t  echo \"*** And there doesn't seem to be a static archive available\"\n\t\t\t  echo \"*** The link will probably fail, sorry\"\n\t\t\telse\n\t\t\t  add=$dir/$old_library\n\t\t\tfi\n\t\t      elif test -n \"$old_library\"; then\n\t\t\tadd=$dir/$old_library\n\t\t      fi\n\t\t    fi\n\t\tesac\n\t      elif test no = \"$hardcode_minus_L\"; then\n\t\tcase $host in\n\t\t*-*-sunos*) add_shlibpath=$dir ;;\n\t\tesac\n\t\tadd_dir=-L$dir\n\t\tadd=-l$name\n\t      elif test no = \"$hardcode_shlibpath_var\"; then\n\t\tadd_shlibpath=$dir\n\t\tadd=-l$name\n\t      else\n\t\tlib_linked=no\n\t      fi\n\t      ;;\n\t    relink)\n\t      if test yes = \"$hardcode_direct\" &&\n\t         test no = \"$hardcode_direct_absolute\"; then\n\t\tadd=$dir/$linklib\n\t      elif test yes = \"$hardcode_minus_L\"; then\n\t\tadd_dir=-L$absdir\n\t\t# Try looking first in the location we're being installed to.\n\t\tif test -n \"$inst_prefix_dir\"; then\n\t\t  case $libdir in\n\t\t    [\\\\/]*)\n\t\t      func_append add_dir \" -L$inst_prefix_dir$libdir\"\n\t\t      ;;\n\t\t  esac\n\t\tfi\n\t\tadd=-l$name\n\t      elif test yes = \"$hardcode_shlibpath_var\"; then\n\t\tadd_shlibpath=$dir\n\t\tadd=-l$name\n\t      else\n\t\tlib_linked=no\n\t      fi\n\t      ;;\n\t    *) lib_linked=no ;;\n\t    esac\n\n\t    if test yes != \"$lib_linked\"; then\n\t      func_fatal_configuration \"unsupported hardcode properties\"\n\t    fi\n\n\t    if test -n \"$add_shlibpath\"; then\n\t      case :$compile_shlibpath: in\n\t      *\":$add_shlibpath:\"*) ;;\n\t      *) func_append compile_shlibpath \"$add_shlibpath:\" ;;\n\t      esac\n\t    fi\n\t    if test prog = \"$linkmode\"; then\n\t      test -n \"$add_dir\" && compile_deplibs=\"$add_dir $compile_deplibs\"\n\t      test -n \"$add\" && compile_deplibs=\"$add $compile_deplibs\"\n\t    else\n\t      test -n \"$add_dir\" && deplibs=\"$add_dir $deplibs\"\n\t      test -n \"$add\" && deplibs=\"$add $deplibs\"\n\t      if test yes != \"$hardcode_direct\" &&\n\t\t test yes != \"$hardcode_minus_L\" &&\n\t\t test yes = \"$hardcode_shlibpath_var\"; then\n\t\tcase :$finalize_shlibpath: in\n\t\t*\":$libdir:\"*) ;;\n\t\t*) func_append finalize_shlibpath \"$libdir:\" ;;\n\t\tesac\n\t      fi\n\t    fi\n\t  fi\n\n\t  if test prog = \"$linkmode\" || test relink = \"$opt_mode\"; then\n\t    add_shlibpath=\n\t    add_dir=\n\t    add=\n\t    # Finalize command for both is simple: just hardcode it.\n\t    if test yes = \"$hardcode_direct\" &&\n\t       test no = \"$hardcode_direct_absolute\"; then\n\t      add=$libdir/$linklib\n\t    elif test yes = \"$hardcode_minus_L\"; then\n\t      add_dir=-L$libdir\n\t      add=-l$name\n\t    elif test yes = \"$hardcode_shlibpath_var\"; then\n\t      case :$finalize_shlibpath: in\n\t      *\":$libdir:\"*) ;;\n\t      *) func_append finalize_shlibpath \"$libdir:\" ;;\n\t      esac\n\t      add=-l$name\n\t    elif test yes = \"$hardcode_automatic\"; then\n\t      if test -n \"$inst_prefix_dir\" &&\n\t\t test -f \"$inst_prefix_dir$libdir/$linklib\"; then\n\t\tadd=$inst_prefix_dir$libdir/$linklib\n\t      else\n\t\tadd=$libdir/$linklib\n\t      fi\n\t    else\n\t      # We cannot seem to hardcode it, guess we'll fake it.\n\t      add_dir=-L$libdir\n\t      # Try looking first in the location we're being installed to.\n\t      if test -n \"$inst_prefix_dir\"; then\n\t\tcase $libdir in\n\t\t  [\\\\/]*)\n\t\t    func_append add_dir \" -L$inst_prefix_dir$libdir\"\n\t\t    ;;\n\t\tesac\n\t      fi\n\t      add=-l$name\n\t    fi\n\n\t    if test prog = \"$linkmode\"; then\n\t      test -n \"$add_dir\" && finalize_deplibs=\"$add_dir $finalize_deplibs\"\n\t      test -n \"$add\" && finalize_deplibs=\"$add $finalize_deplibs\"\n\t    else\n\t      test -n \"$add_dir\" && deplibs=\"$add_dir $deplibs\"\n\t      test -n \"$add\" && deplibs=\"$add $deplibs\"\n\t    fi\n\t  fi\n\telif test prog = \"$linkmode\"; then\n\t  # Here we assume that one of hardcode_direct or hardcode_minus_L\n\t  # is not unsupported.  This is valid on all known static and\n\t  # shared platforms.\n\t  if test unsupported != \"$hardcode_direct\"; then\n\t    test -n \"$old_library\" && linklib=$old_library\n\t    compile_deplibs=\"$dir/$linklib $compile_deplibs\"\n\t    finalize_deplibs=\"$dir/$linklib $finalize_deplibs\"\n\t  else\n\t    compile_deplibs=\"-l$name -L$dir $compile_deplibs\"\n\t    finalize_deplibs=\"-l$name -L$dir $finalize_deplibs\"\n\t  fi\n\telif test yes = \"$build_libtool_libs\"; then\n\t  # Not a shared library\n\t  if test pass_all != \"$deplibs_check_method\"; then\n\t    # We're trying link a shared library against a static one\n\t    # but the system doesn't support it.\n\n\t    # Just print a warning and add the library to dependency_libs so\n\t    # that the program can be linked against the static library.\n\t    echo\n\t    $ECHO \"*** Warning: This system cannot link to static lib archive $lib.\"\n\t    echo \"*** I have the capability to make that library automatically link in when\"\n\t    echo \"*** you link to this library.  But I can only do this if you have a\"\n\t    echo \"*** shared version of the library, which you do not appear to have.\"\n\t    if test yes = \"$module\"; then\n\t      echo \"*** But as you try to build a module library, libtool will still create \"\n\t      echo \"*** a static module, that should work as long as the dlopening application\"\n\t      echo \"*** is linked with the -dlopen flag to resolve symbols at runtime.\"\n\t      if test -z \"$global_symbol_pipe\"; then\n\t\techo\n\t\techo \"*** However, this would only work if libtool was able to extract symbol\"\n\t\techo \"*** lists from a program, using 'nm' or equivalent, but libtool could\"\n\t\techo \"*** not find such a program.  So, this module is probably useless.\"\n\t\techo \"*** 'nm' from GNU binutils and a full rebuild may help.\"\n\t      fi\n\t      if test no = \"$build_old_libs\"; then\n\t\tbuild_libtool_libs=module\n\t\tbuild_old_libs=yes\n\t      else\n\t\tbuild_libtool_libs=no\n\t      fi\n\t    fi\n\t  else\n\t    deplibs=\"$dir/$old_library $deplibs\"\n\t    link_static=yes\n\t  fi\n\tfi # link shared/static library?\n\n\tif test lib = \"$linkmode\"; then\n\t  if test -n \"$dependency_libs\" &&\n\t     { test yes != \"$hardcode_into_libs\" ||\n\t       test yes = \"$build_old_libs\" ||\n\t       test yes = \"$link_static\"; }; then\n\t    # Extract -R from dependency_libs\n\t    temp_deplibs=\n\t    for libdir in $dependency_libs; do\n\t      case $libdir in\n\t      -R*) func_stripname '-R' '' \"$libdir\"\n\t           temp_xrpath=$func_stripname_result\n\t\t   case \" $xrpath \" in\n\t\t   *\" $temp_xrpath \"*) ;;\n\t\t   *) func_append xrpath \" $temp_xrpath\";;\n\t\t   esac;;\n\t      *) func_append temp_deplibs \" $libdir\";;\n\t      esac\n\t    done\n\t    dependency_libs=$temp_deplibs\n\t  fi\n\n\t  func_append newlib_search_path \" $absdir\"\n\t  # Link against this library\n\t  test no = \"$link_static\" && newdependency_libs=\"$abs_ladir/$laname $newdependency_libs\"\n\t  # ... and its dependency_libs\n\t  tmp_libs=\n\t  for deplib in $dependency_libs; do\n\t    newdependency_libs=\"$deplib $newdependency_libs\"\n\t    case $deplib in\n              -L*) func_stripname '-L' '' \"$deplib\"\n                   func_resolve_sysroot \"$func_stripname_result\";;\n              *) func_resolve_sysroot \"$deplib\" ;;\n            esac\n\t    if $opt_preserve_dup_deps; then\n\t      case \"$tmp_libs \" in\n\t      *\" $func_resolve_sysroot_result \"*)\n                func_append specialdeplibs \" $func_resolve_sysroot_result\" ;;\n\t      esac\n\t    fi\n\t    func_append tmp_libs \" $func_resolve_sysroot_result\"\n\t  done\n\n\t  if test no != \"$link_all_deplibs\"; then\n\t    # Add the search paths of all dependency libraries\n\t    for deplib in $dependency_libs; do\n\t      path=\n\t      case $deplib in\n\t      -L*) path=$deplib ;;\n\t      *.la)\n\t        func_resolve_sysroot \"$deplib\"\n\t        deplib=$func_resolve_sysroot_result\n\t        func_dirname \"$deplib\" \"\" \".\"\n\t\tdir=$func_dirname_result\n\t\t# We need an absolute path.\n\t\tcase $dir in\n\t\t[\\\\/]* | [A-Za-z]:[\\\\/]*) absdir=$dir ;;\n\t\t*)\n\t\t  absdir=`cd \"$dir\" && pwd`\n\t\t  if test -z \"$absdir\"; then\n\t\t    func_warning \"cannot determine absolute directory name of '$dir'\"\n\t\t    absdir=$dir\n\t\t  fi\n\t\t  ;;\n\t\tesac\n\t\tif $GREP \"^installed=no\" $deplib > /dev/null; then\n\t\tcase $host in\n\t\t*-*-darwin*)\n\t\t  depdepl=\n\t\t  eval deplibrary_names=`$SED -n -e 's/^library_names=\\(.*\\)$/\\1/p' $deplib`\n\t\t  if test -n \"$deplibrary_names\"; then\n\t\t    for tmp in $deplibrary_names; do\n\t\t      depdepl=$tmp\n\t\t    done\n\t\t    if test -f \"$absdir/$objdir/$depdepl\"; then\n\t\t      depdepl=$absdir/$objdir/$depdepl\n\t\t      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`\n                      if test -z \"$darwin_install_name\"; then\n                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`\n                      fi\n\t\t      func_append compiler_flags \" $wl-dylib_file $wl$darwin_install_name:$depdepl\"\n\t\t      func_append linker_flags \" -dylib_file $darwin_install_name:$depdepl\"\n\t\t      path=\n\t\t    fi\n\t\t  fi\n\t\t  ;;\n\t\t*)\n\t\t  path=-L$absdir/$objdir\n\t\t  ;;\n\t\tesac\n\t\telse\n\t\t  eval libdir=`$SED -n -e 's/^libdir=\\(.*\\)$/\\1/p' $deplib`\n\t\t  test -z \"$libdir\" && \\\n\t\t    func_fatal_error \"'$deplib' is not a valid libtool archive\"\n\t\t  test \"$absdir\" != \"$libdir\" && \\\n\t\t    func_warning \"'$deplib' seems to be moved\"\n\n\t\t  path=-L$absdir\n\t\tfi\n\t\t;;\n\t      esac\n\t      case \" $deplibs \" in\n\t      *\" $path \"*) ;;\n\t      *) deplibs=\"$path $deplibs\" ;;\n\t      esac\n\t    done\n\t  fi # link_all_deplibs != no\n\tfi # linkmode = lib\n      done # for deplib in $libs\n      if test link = \"$pass\"; then\n\tif test prog = \"$linkmode\"; then\n\t  compile_deplibs=\"$new_inherited_linker_flags $compile_deplibs\"\n\t  finalize_deplibs=\"$new_inherited_linker_flags $finalize_deplibs\"\n\telse\n\t  compiler_flags=\"$compiler_flags \"`$ECHO \" $new_inherited_linker_flags\" | $SED 's% \\([^ $]*\\).ltframework% -framework \\1%g'`\n\tfi\n      fi\n      dependency_libs=$newdependency_libs\n      if test dlpreopen = \"$pass\"; then\n\t# Link the dlpreopened libraries before other libraries\n\tfor deplib in $save_deplibs; do\n\t  deplibs=\"$deplib $deplibs\"\n\tdone\n      fi\n      if test dlopen != \"$pass\"; then\n\ttest conv = \"$pass\" || {\n\t  # Make sure lib_search_path contains only unique directories.\n\t  lib_search_path=\n\t  for dir in $newlib_search_path; do\n\t    case \"$lib_search_path \" in\n\t    *\" $dir \"*) ;;\n\t    *) func_append lib_search_path \" $dir\" ;;\n\t    esac\n\t  done\n\t  newlib_search_path=\n\t}\n\n\tif test prog,link = \"$linkmode,$pass\"; then\n\t  vars=\"compile_deplibs finalize_deplibs\"\n\telse\n\t  vars=deplibs\n\tfi\n\tfor var in $vars dependency_libs; do\n\t  # Add libraries to $var in reverse order\n\t  eval tmp_libs=\\\"\\$$var\\\"\n\t  new_libs=\n\t  for deplib in $tmp_libs; do\n\t    # FIXME: Pedantically, this is the right thing to do, so\n\t    #        that some nasty dependency loop isn't accidentally\n\t    #        broken:\n\t    #new_libs=\"$deplib $new_libs\"\n\t    # Pragmatically, this seems to cause very few problems in\n\t    # practice:\n\t    case $deplib in\n\t    -L*) new_libs=\"$deplib $new_libs\" ;;\n\t    -R*) ;;\n\t    *)\n\t      # And here is the reason: when a library appears more\n\t      # than once as an explicit dependence of a library, or\n\t      # is implicitly linked in more than once by the\n\t      # compiler, it is considered special, and multiple\n\t      # occurrences thereof are not removed.  Compare this\n\t      # with having the same library being listed as a\n\t      # dependency of multiple other libraries: in this case,\n\t      # we know (pedantically, we assume) the library does not\n\t      # need to be listed more than once, so we keep only the\n\t      # last copy.  This is not always right, but it is rare\n\t      # enough that we require users that really mean to play\n\t      # such unportable linking tricks to link the library\n\t      # using -Wl,-lname, so that libtool does not consider it\n\t      # for duplicate removal.\n\t      case \" $specialdeplibs \" in\n\t      *\" $deplib \"*) new_libs=\"$deplib $new_libs\" ;;\n\t      *)\n\t\tcase \" $new_libs \" in\n\t\t*\" $deplib \"*) ;;\n\t\t*) new_libs=\"$deplib $new_libs\" ;;\n\t\tesac\n\t\t;;\n\t      esac\n\t      ;;\n\t    esac\n\t  done\n\t  tmp_libs=\n\t  for deplib in $new_libs; do\n\t    case $deplib in\n\t    -L*)\n\t      case \" $tmp_libs \" in\n\t      *\" $deplib \"*) ;;\n\t      *) func_append tmp_libs \" $deplib\" ;;\n\t      esac\n\t      ;;\n\t    *) func_append tmp_libs \" $deplib\" ;;\n\t    esac\n\t  done\n\t  eval $var=\\\"$tmp_libs\\\"\n\tdone # for var\n      fi\n\n      # Add Sun CC postdeps if required:\n      test CXX = \"$tagname\" && {\n        case $host_os in\n        linux*)\n          case `$CC -V 2>&1 | sed 5q` in\n          *Sun\\ C*) # Sun C++ 5.9\n            func_suncc_cstd_abi\n\n            if test no != \"$suncc_use_cstd_abi\"; then\n              func_append postdeps ' -library=Cstd -library=Crun'\n            fi\n            ;;\n          esac\n          ;;\n\n        solaris*)\n          func_cc_basename \"$CC\"\n          case $func_cc_basename_result in\n          CC* | sunCC*)\n            func_suncc_cstd_abi\n\n            if test no != \"$suncc_use_cstd_abi\"; then\n              func_append postdeps ' -library=Cstd -library=Crun'\n            fi\n            ;;\n          esac\n          ;;\n        esac\n      }\n\n      # Last step: remove runtime libs from dependency_libs\n      # (they stay in deplibs)\n      tmp_libs=\n      for i in $dependency_libs; do\n\tcase \" $predeps $postdeps $compiler_lib_search_path \" in\n\t*\" $i \"*)\n\t  i=\n\t  ;;\n\tesac\n\tif test -n \"$i\"; then\n\t  func_append tmp_libs \" $i\"\n\tfi\n      done\n      dependency_libs=$tmp_libs\n    done # for pass\n    if test prog = \"$linkmode\"; then\n      dlfiles=$newdlfiles\n    fi\n    if test prog = \"$linkmode\" || test lib = \"$linkmode\"; then\n      dlprefiles=$newdlprefiles\n    fi\n\n    case $linkmode in\n    oldlib)\n      if test -n \"$dlfiles$dlprefiles\" || test no != \"$dlself\"; then\n\tfunc_warning \"'-dlopen' is ignored for archives\"\n      fi\n\n      case \" $deplibs\" in\n      *\\ -l* | *\\ -L*)\n\tfunc_warning \"'-l' and '-L' are ignored for archives\" ;;\n      esac\n\n      test -n \"$rpath\" && \\\n\tfunc_warning \"'-rpath' is ignored for archives\"\n\n      test -n \"$xrpath\" && \\\n\tfunc_warning \"'-R' is ignored for archives\"\n\n      test -n \"$vinfo\" && \\\n\tfunc_warning \"'-version-info/-version-number' is ignored for archives\"\n\n      test -n \"$release\" && \\\n\tfunc_warning \"'-release' is ignored for archives\"\n\n      test -n \"$export_symbols$export_symbols_regex\" && \\\n\tfunc_warning \"'-export-symbols' is ignored for archives\"\n\n      # Now set the variables for building old libraries.\n      build_libtool_libs=no\n      oldlibs=$output\n      func_append objs \"$old_deplibs\"\n      ;;\n\n    lib)\n      # Make sure we only generate libraries of the form 'libNAME.la'.\n      case $outputname in\n      lib*)\n\tfunc_stripname 'lib' '.la' \"$outputname\"\n\tname=$func_stripname_result\n\teval shared_ext=\\\"$shrext_cmds\\\"\n\teval libname=\\\"$libname_spec\\\"\n\t;;\n      *)\n\ttest no = \"$module\" \\\n\t  && func_fatal_help \"libtool library '$output' must begin with 'lib'\"\n\n\tif test no != \"$need_lib_prefix\"; then\n\t  # Add the \"lib\" prefix for modules if required\n\t  func_stripname '' '.la' \"$outputname\"\n\t  name=$func_stripname_result\n\t  eval shared_ext=\\\"$shrext_cmds\\\"\n\t  eval libname=\\\"$libname_spec\\\"\n\telse\n\t  func_stripname '' '.la' \"$outputname\"\n\t  libname=$func_stripname_result\n\tfi\n\t;;\n      esac\n\n      if test -n \"$objs\"; then\n\tif test pass_all != \"$deplibs_check_method\"; then\n\t  func_fatal_error \"cannot build libtool library '$output' from non-libtool objects on this host:$objs\"\n\telse\n\t  echo\n\t  $ECHO \"*** Warning: Linking the shared library $output against the non-libtool\"\n\t  $ECHO \"*** objects $objs is not portable!\"\n\t  func_append libobjs \" $objs\"\n\tfi\n      fi\n\n      test no = \"$dlself\" \\\n\t|| func_warning \"'-dlopen self' is ignored for libtool libraries\"\n\n      set dummy $rpath\n      shift\n      test 1 -lt \"$#\" \\\n\t&& func_warning \"ignoring multiple '-rpath's for a libtool library\"\n\n      install_libdir=$1\n\n      oldlibs=\n      if test -z \"$rpath\"; then\n\tif test yes = \"$build_libtool_libs\"; then\n\t  # Building a libtool convenience library.\n\t  # Some compilers have problems with a '.al' extension so\n\t  # convenience libraries should have the same extension an\n\t  # archive normally would.\n\t  oldlibs=\"$output_objdir/$libname.$libext $oldlibs\"\n\t  build_libtool_libs=convenience\n\t  build_old_libs=yes\n\tfi\n\n\ttest -n \"$vinfo\" && \\\n\t  func_warning \"'-version-info/-version-number' is ignored for convenience libraries\"\n\n\ttest -n \"$release\" && \\\n\t  func_warning \"'-release' is ignored for convenience libraries\"\n      else\n\n\t# Parse the version information argument.\n\tsave_ifs=$IFS; IFS=:\n\tset dummy $vinfo 0 0 0\n\tshift\n\tIFS=$save_ifs\n\n\ttest -n \"$7\" && \\\n\t  func_fatal_help \"too many parameters to '-version-info'\"\n\n\t# convert absolute version numbers to libtool ages\n\t# this retains compatibility with .la files and attempts\n\t# to make the code below a bit more comprehensible\n\n\tcase $vinfo_number in\n\tyes)\n\t  number_major=$1\n\t  number_minor=$2\n\t  number_revision=$3\n\t  #\n\t  # There are really only two kinds -- those that\n\t  # use the current revision as the major version\n\t  # and those that subtract age and use age as\n\t  # a minor version.  But, then there is irix\n\t  # that has an extra 1 added just for fun\n\t  #\n\t  case $version_type in\n\t  # correct linux to gnu/linux during the next big refactor\n\t  darwin|freebsd-elf|linux|osf|windows|none)\n\t    func_arith $number_major + $number_minor\n\t    current=$func_arith_result\n\t    age=$number_minor\n\t    revision=$number_revision\n\t    ;;\n\t  freebsd-aout|qnx|sunos)\n\t    current=$number_major\n\t    revision=$number_minor\n\t    age=0\n\t    ;;\n\t  irix|nonstopux)\n\t    func_arith $number_major + $number_minor\n\t    current=$func_arith_result\n\t    age=$number_minor\n\t    revision=$number_minor\n\t    lt_irix_increment=no\n\t    ;;\n\t  esac\n\t  ;;\n\tno)\n\t  current=$1\n\t  revision=$2\n\t  age=$3\n\t  ;;\n\tesac\n\n\t# Check that each of the things are valid numbers.\n\tcase $current in\n\t0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;\n\t*)\n\t  func_error \"CURRENT '$current' must be a nonnegative integer\"\n\t  func_fatal_error \"'$vinfo' is not valid version information\"\n\t  ;;\n\tesac\n\n\tcase $revision in\n\t0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;\n\t*)\n\t  func_error \"REVISION '$revision' must be a nonnegative integer\"\n\t  func_fatal_error \"'$vinfo' is not valid version information\"\n\t  ;;\n\tesac\n\n\tcase $age in\n\t0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;\n\t*)\n\t  func_error \"AGE '$age' must be a nonnegative integer\"\n\t  func_fatal_error \"'$vinfo' is not valid version information\"\n\t  ;;\n\tesac\n\n\tif test \"$age\" -gt \"$current\"; then\n\t  func_error \"AGE '$age' is greater than the current interface number '$current'\"\n\t  func_fatal_error \"'$vinfo' is not valid version information\"\n\tfi\n\n\t# Calculate the version variables.\n\tmajor=\n\tversuffix=\n\tverstring=\n\tcase $version_type in\n\tnone) ;;\n\n\tdarwin)\n\t  # Like Linux, but with the current version available in\n\t  # verstring for coding it into the library header\n\t  func_arith $current - $age\n\t  major=.$func_arith_result\n\t  versuffix=$major.$age.$revision\n\t  # Darwin ld doesn't like 0 for these options...\n\t  func_arith $current + 1\n\t  minor_current=$func_arith_result\n\t  xlcverstring=\"$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision\"\n\t  verstring=\"-compatibility_version $minor_current -current_version $minor_current.$revision\"\n          # On Darwin other compilers\n          case $CC in\n              nagfor*)\n                  verstring=\"$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision\"\n                  ;;\n              *)\n                  verstring=\"-compatibility_version $minor_current -current_version $minor_current.$revision\"\n                  ;;\n          esac\n\t  ;;\n\n\tfreebsd-aout)\n\t  major=.$current\n\t  versuffix=.$current.$revision\n\t  ;;\n\n\tfreebsd-elf)\n\t  func_arith $current - $age\n\t  major=.$func_arith_result\n\t  versuffix=$major.$age.$revision\n\t  ;;\n\n\tirix | nonstopux)\n\t  if test no = \"$lt_irix_increment\"; then\n\t    func_arith $current - $age\n\t  else\n\t    func_arith $current - $age + 1\n\t  fi\n\t  major=$func_arith_result\n\n\t  case $version_type in\n\t    nonstopux) verstring_prefix=nonstopux ;;\n\t    *)         verstring_prefix=sgi ;;\n\t  esac\n\t  verstring=$verstring_prefix$major.$revision\n\n\t  # Add in all the interfaces that we are compatible with.\n\t  loop=$revision\n\t  while test 0 -ne \"$loop\"; do\n\t    func_arith $revision - $loop\n\t    iface=$func_arith_result\n\t    func_arith $loop - 1\n\t    loop=$func_arith_result\n\t    verstring=$verstring_prefix$major.$iface:$verstring\n\t  done\n\n\t  # Before this point, $major must not contain '.'.\n\t  major=.$major\n\t  versuffix=$major.$revision\n\t  ;;\n\n\tlinux) # correct to gnu/linux during the next big refactor\n\t  func_arith $current - $age\n\t  major=.$func_arith_result\n\t  versuffix=$major.$age.$revision\n\t  ;;\n\n\tosf)\n\t  func_arith $current - $age\n\t  major=.$func_arith_result\n\t  versuffix=.$current.$age.$revision\n\t  verstring=$current.$age.$revision\n\n\t  # Add in all the interfaces that we are compatible with.\n\t  loop=$age\n\t  while test 0 -ne \"$loop\"; do\n\t    func_arith $current - $loop\n\t    iface=$func_arith_result\n\t    func_arith $loop - 1\n\t    loop=$func_arith_result\n\t    verstring=$verstring:$iface.0\n\t  done\n\n\t  # Make executables depend on our current version.\n\t  func_append verstring \":$current.0\"\n\t  ;;\n\n\tqnx)\n\t  major=.$current\n\t  versuffix=.$current\n\t  ;;\n\n\tsco)\n\t  major=.$current\n\t  versuffix=.$current\n\t  ;;\n\n\tsunos)\n\t  major=.$current\n\t  versuffix=.$current.$revision\n\t  ;;\n\n\twindows)\n\t  # Use '-' rather than '.', since we only want one\n\t  # extension on DOS 8.3 file systems.\n\t  func_arith $current - $age\n\t  major=$func_arith_result\n\t  versuffix=-$major\n\t  ;;\n\n\t*)\n\t  func_fatal_configuration \"unknown library version type '$version_type'\"\n\t  ;;\n\tesac\n\n\t# Clear the version info if we defaulted, and they specified a release.\n\tif test -z \"$vinfo\" && test -n \"$release\"; then\n\t  major=\n\t  case $version_type in\n\t  darwin)\n\t    # we can't check for \"0.0\" in archive_cmds due to quoting\n\t    # problems, so we reset it completely\n\t    verstring=\n\t    ;;\n\t  *)\n\t    verstring=0.0\n\t    ;;\n\t  esac\n\t  if test no = \"$need_version\"; then\n\t    versuffix=\n\t  else\n\t    versuffix=.0.0\n\t  fi\n\tfi\n\n\t# Remove version info from name if versioning should be avoided\n\tif test yes,no = \"$avoid_version,$need_version\"; then\n\t  major=\n\t  versuffix=\n\t  verstring=\n\tfi\n\n\t# Check to see if the archive will have undefined symbols.\n\tif test yes = \"$allow_undefined\"; then\n\t  if test unsupported = \"$allow_undefined_flag\"; then\n\t    if test yes = \"$build_old_libs\"; then\n\t      func_warning \"undefined symbols not allowed in $host shared libraries; building static only\"\n\t      build_libtool_libs=no\n\t    else\n\t      func_fatal_error \"can't build $host shared library unless -no-undefined is specified\"\n\t    fi\n\t  fi\n\telse\n\t  # Don't allow undefined symbols.\n\t  allow_undefined_flag=$no_undefined_flag\n\tfi\n\n      fi\n\n      func_generate_dlsyms \"$libname\" \"$libname\" :\n      func_append libobjs \" $symfileobj\"\n      test \" \" = \"$libobjs\" && libobjs=\n\n      if test relink != \"$opt_mode\"; then\n\t# Remove our outputs, but don't remove object files since they\n\t# may have been created when compiling PIC objects.\n\tremovelist=\n\ttempremovelist=`$ECHO \"$output_objdir/*\"`\n\tfor p in $tempremovelist; do\n\t  case $p in\n\t    *.$objext | *.gcno)\n\t       ;;\n\t    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)\n\t       if test -n \"$precious_files_regex\"; then\n\t\t if $ECHO \"$p\" | $EGREP -e \"$precious_files_regex\" >/dev/null 2>&1\n\t\t then\n\t\t   continue\n\t\t fi\n\t       fi\n\t       func_append removelist \" $p\"\n\t       ;;\n\t    *) ;;\n\t  esac\n\tdone\n\ttest -n \"$removelist\" && \\\n\t  func_show_eval \"${RM}r \\$removelist\"\n      fi\n\n      # Now set the variables for building old libraries.\n      if test yes = \"$build_old_libs\" && test convenience != \"$build_libtool_libs\"; then\n\tfunc_append oldlibs \" $output_objdir/$libname.$libext\"\n\n\t# Transform .lo files to .o files.\n\toldobjs=\"$objs \"`$ECHO \"$libobjs\" | $SP2NL | $SED \"/\\.$libext$/d; $lo2o\" | $NL2SP`\n      fi\n\n      # Eliminate all temporary directories.\n      #for path in $notinst_path; do\n      #\tlib_search_path=`$ECHO \"$lib_search_path \" | $SED \"s% $path % %g\"`\n      #\tdeplibs=`$ECHO \"$deplibs \" | $SED \"s% -L$path % %g\"`\n      #\tdependency_libs=`$ECHO \"$dependency_libs \" | $SED \"s% -L$path % %g\"`\n      #done\n\n      if test -n \"$xrpath\"; then\n\t# If the user specified any rpath flags, then add them.\n\ttemp_xrpath=\n\tfor libdir in $xrpath; do\n\t  func_replace_sysroot \"$libdir\"\n\t  func_append temp_xrpath \" -R$func_replace_sysroot_result\"\n\t  case \"$finalize_rpath \" in\n\t  *\" $libdir \"*) ;;\n\t  *) func_append finalize_rpath \" $libdir\" ;;\n\t  esac\n\tdone\n\tif test yes != \"$hardcode_into_libs\" || test yes = \"$build_old_libs\"; then\n\t  dependency_libs=\"$temp_xrpath $dependency_libs\"\n\tfi\n      fi\n\n      # Make sure dlfiles contains only unique files that won't be dlpreopened\n      old_dlfiles=$dlfiles\n      dlfiles=\n      for lib in $old_dlfiles; do\n\tcase \" $dlprefiles $dlfiles \" in\n\t*\" $lib \"*) ;;\n\t*) func_append dlfiles \" $lib\" ;;\n\tesac\n      done\n\n      # Make sure dlprefiles contains only unique files\n      old_dlprefiles=$dlprefiles\n      dlprefiles=\n      for lib in $old_dlprefiles; do\n\tcase \"$dlprefiles \" in\n\t*\" $lib \"*) ;;\n\t*) func_append dlprefiles \" $lib\" ;;\n\tesac\n      done\n\n      if test yes = \"$build_libtool_libs\"; then\n\tif test -n \"$rpath\"; then\n\t  case $host in\n\t  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)\n\t    # these systems don't actually have a c library (as such)!\n\t    ;;\n\t  *-*-rhapsody* | *-*-darwin1.[012])\n\t    # Rhapsody C library is in the System framework\n\t    func_append deplibs \" System.ltframework\"\n\t    ;;\n\t  *-*-netbsd*)\n\t    # Don't link with libc until the a.out ld.so is fixed.\n\t    ;;\n\t  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)\n\t    # Do not include libc due to us having libc/libc_r.\n\t    ;;\n\t  *-*-sco3.2v5* | *-*-sco5v6*)\n\t    # Causes problems with __ctype\n\t    ;;\n\t  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)\n\t    # Compiler inserts libc in the correct place for threads to work\n\t    ;;\n\t  *)\n\t    # Add libc to deplibs on all other systems if necessary.\n\t    if test yes = \"$build_libtool_need_lc\"; then\n\t      func_append deplibs \" -lc\"\n\t    fi\n\t    ;;\n\t  esac\n\tfi\n\n\t# Transform deplibs into only deplibs that can be linked in shared.\n\tname_save=$name\n\tlibname_save=$libname\n\trelease_save=$release\n\tversuffix_save=$versuffix\n\tmajor_save=$major\n\t# I'm not sure if I'm treating the release correctly.  I think\n\t# release should show up in the -l (ie -lgmp5) so we don't want to\n\t# add it in twice.  Is that correct?\n\trelease=\n\tversuffix=\n\tmajor=\n\tnewdeplibs=\n\tdroppeddeps=no\n\tcase $deplibs_check_method in\n\tpass_all)\n\t  # Don't check for shared/static.  Everything works.\n\t  # This might be a little naive.  We might want to check\n\t  # whether the library exists or not.  But this is on\n\t  # osf3 & osf4 and I'm not really sure... Just\n\t  # implementing what was already the behavior.\n\t  newdeplibs=$deplibs\n\t  ;;\n\ttest_compile)\n\t  # This code stresses the \"libraries are programs\" paradigm to its\n\t  # limits. Maybe even breaks it.  We compile a program, linking it\n\t  # against the deplibs as a proxy for the library.  Then we can check\n\t  # whether they linked in statically or dynamically with ldd.\n\t  $opt_dry_run || $RM conftest.c\n\t  cat > conftest.c <<EOF\n\t  int main() { return 0; }\nEOF\n\t  $opt_dry_run || $RM conftest\n\t  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then\n\t    ldd_output=`ldd conftest`\n\t    for i in $deplibs; do\n\t      case $i in\n\t      -l*)\n\t\tfunc_stripname -l '' \"$i\"\n\t\tname=$func_stripname_result\n\t\tif test yes = \"$allow_libtool_libs_with_static_runtimes\"; then\n\t\t  case \" $predeps $postdeps \" in\n\t\t  *\" $i \"*)\n\t\t    func_append newdeplibs \" $i\"\n\t\t    i=\n\t\t    ;;\n\t\t  esac\n\t\tfi\n\t\tif test -n \"$i\"; then\n\t\t  libname=`eval \"\\\\$ECHO \\\"$libname_spec\\\"\"`\n\t\t  deplib_matches=`eval \"\\\\$ECHO \\\"$library_names_spec\\\"\"`\n\t\t  set dummy $deplib_matches; shift\n\t\t  deplib_match=$1\n\t\t  if test `expr \"$ldd_output\" : \".*$deplib_match\"` -ne 0; then\n\t\t    func_append newdeplibs \" $i\"\n\t\t  else\n\t\t    droppeddeps=yes\n\t\t    echo\n\t\t    $ECHO \"*** Warning: dynamic linker does not accept needed library $i.\"\n\t\t    echo \"*** I have the capability to make that library automatically link in when\"\n\t\t    echo \"*** you link to this library.  But I can only do this if you have a\"\n\t\t    echo \"*** shared version of the library, which I believe you do not have\"\n\t\t    echo \"*** because a test_compile did reveal that the linker did not use it for\"\n\t\t    echo \"*** its dynamic dependency list that programs get resolved with at runtime.\"\n\t\t  fi\n\t\tfi\n\t\t;;\n\t      *)\n\t\tfunc_append newdeplibs \" $i\"\n\t\t;;\n\t      esac\n\t    done\n\t  else\n\t    # Error occurred in the first compile.  Let's try to salvage\n\t    # the situation: Compile a separate program for each library.\n\t    for i in $deplibs; do\n\t      case $i in\n\t      -l*)\n\t\tfunc_stripname -l '' \"$i\"\n\t\tname=$func_stripname_result\n\t\t$opt_dry_run || $RM conftest\n\t\tif $LTCC $LTCFLAGS -o conftest conftest.c $i; then\n\t\t  ldd_output=`ldd conftest`\n\t\t  if test yes = \"$allow_libtool_libs_with_static_runtimes\"; then\n\t\t    case \" $predeps $postdeps \" in\n\t\t    *\" $i \"*)\n\t\t      func_append newdeplibs \" $i\"\n\t\t      i=\n\t\t      ;;\n\t\t    esac\n\t\t  fi\n\t\t  if test -n \"$i\"; then\n\t\t    libname=`eval \"\\\\$ECHO \\\"$libname_spec\\\"\"`\n\t\t    deplib_matches=`eval \"\\\\$ECHO \\\"$library_names_spec\\\"\"`\n\t\t    set dummy $deplib_matches; shift\n\t\t    deplib_match=$1\n\t\t    if test `expr \"$ldd_output\" : \".*$deplib_match\"` -ne 0; then\n\t\t      func_append newdeplibs \" $i\"\n\t\t    else\n\t\t      droppeddeps=yes\n\t\t      echo\n\t\t      $ECHO \"*** Warning: dynamic linker does not accept needed library $i.\"\n\t\t      echo \"*** I have the capability to make that library automatically link in when\"\n\t\t      echo \"*** you link to this library.  But I can only do this if you have a\"\n\t\t      echo \"*** shared version of the library, which you do not appear to have\"\n\t\t      echo \"*** because a test_compile did reveal that the linker did not use this one\"\n\t\t      echo \"*** as a dynamic dependency that programs can get resolved with at runtime.\"\n\t\t    fi\n\t\t  fi\n\t\telse\n\t\t  droppeddeps=yes\n\t\t  echo\n\t\t  $ECHO \"*** Warning!  Library $i is needed by this library but I was not able to\"\n\t\t  echo \"*** make it link in!  You will probably need to install it or some\"\n\t\t  echo \"*** library that it depends on before this library will be fully\"\n\t\t  echo \"*** functional.  Installing it before continuing would be even better.\"\n\t\tfi\n\t\t;;\n\t      *)\n\t\tfunc_append newdeplibs \" $i\"\n\t\t;;\n\t      esac\n\t    done\n\t  fi\n\t  ;;\n\tfile_magic*)\n\t  set dummy $deplibs_check_method; shift\n\t  file_magic_regex=`expr \"$deplibs_check_method\" : \"$1 \\(.*\\)\"`\n\t  for a_deplib in $deplibs; do\n\t    case $a_deplib in\n\t    -l*)\n\t      func_stripname -l '' \"$a_deplib\"\n\t      name=$func_stripname_result\n\t      if test yes = \"$allow_libtool_libs_with_static_runtimes\"; then\n\t\tcase \" $predeps $postdeps \" in\n\t\t*\" $a_deplib \"*)\n\t\t  func_append newdeplibs \" $a_deplib\"\n\t\t  a_deplib=\n\t\t  ;;\n\t\tesac\n\t      fi\n\t      if test -n \"$a_deplib\"; then\n\t\tlibname=`eval \"\\\\$ECHO \\\"$libname_spec\\\"\"`\n\t\tif test -n \"$file_magic_glob\"; then\n\t\t  libnameglob=`func_echo_all \"$libname\" | $SED -e $file_magic_glob`\n\t\telse\n\t\t  libnameglob=$libname\n\t\tfi\n\t\ttest yes = \"$want_nocaseglob\" && nocaseglob=`shopt -p nocaseglob`\n\t\tfor i in $lib_search_path $sys_lib_search_path $shlib_search_path; do\n\t\t  if test yes = \"$want_nocaseglob\"; then\n\t\t    shopt -s nocaseglob\n\t\t    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`\n\t\t    $nocaseglob\n\t\t  else\n\t\t    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`\n\t\t  fi\n\t\t  for potent_lib in $potential_libs; do\n\t\t      # Follow soft links.\n\t\t      if ls -lLd \"$potent_lib\" 2>/dev/null |\n\t\t\t $GREP \" -> \" >/dev/null; then\n\t\t\tcontinue\n\t\t      fi\n\t\t      # The statement above tries to avoid entering an\n\t\t      # endless loop below, in case of cyclic links.\n\t\t      # We might still enter an endless loop, since a link\n\t\t      # loop can be closed while we follow links,\n\t\t      # but so what?\n\t\t      potlib=$potent_lib\n\t\t      while test -h \"$potlib\" 2>/dev/null; do\n\t\t\tpotliblink=`ls -ld $potlib | $SED 's/.* -> //'`\n\t\t\tcase $potliblink in\n\t\t\t[\\\\/]* | [A-Za-z]:[\\\\/]*) potlib=$potliblink;;\n\t\t\t*) potlib=`$ECHO \"$potlib\" | $SED 's|[^/]*$||'`\"$potliblink\";;\n\t\t\tesac\n\t\t      done\n\t\t      if eval $file_magic_cmd \\\"\\$potlib\\\" 2>/dev/null |\n\t\t\t $SED -e 10q |\n\t\t\t $EGREP \"$file_magic_regex\" > /dev/null; then\n\t\t\tfunc_append newdeplibs \" $a_deplib\"\n\t\t\ta_deplib=\n\t\t\tbreak 2\n\t\t      fi\n\t\t  done\n\t\tdone\n\t      fi\n\t      if test -n \"$a_deplib\"; then\n\t\tdroppeddeps=yes\n\t\techo\n\t\t$ECHO \"*** Warning: linker path does not have real file for library $a_deplib.\"\n\t\techo \"*** I have the capability to make that library automatically link in when\"\n\t\techo \"*** you link to this library.  But I can only do this if you have a\"\n\t\techo \"*** shared version of the library, which you do not appear to have\"\n\t\techo \"*** because I did check the linker path looking for a file starting\"\n\t\tif test -z \"$potlib\"; then\n\t\t  $ECHO \"*** with $libname but no candidates were found. (...for file magic test)\"\n\t\telse\n\t\t  $ECHO \"*** with $libname and none of the candidates passed a file format test\"\n\t\t  $ECHO \"*** using a file magic. Last file checked: $potlib\"\n\t\tfi\n\t      fi\n\t      ;;\n\t    *)\n\t      # Add a -L argument.\n\t      func_append newdeplibs \" $a_deplib\"\n\t      ;;\n\t    esac\n\t  done # Gone through all deplibs.\n\t  ;;\n\tmatch_pattern*)\n\t  set dummy $deplibs_check_method; shift\n\t  match_pattern_regex=`expr \"$deplibs_check_method\" : \"$1 \\(.*\\)\"`\n\t  for a_deplib in $deplibs; do\n\t    case $a_deplib in\n\t    -l*)\n\t      func_stripname -l '' \"$a_deplib\"\n\t      name=$func_stripname_result\n\t      if test yes = \"$allow_libtool_libs_with_static_runtimes\"; then\n\t\tcase \" $predeps $postdeps \" in\n\t\t*\" $a_deplib \"*)\n\t\t  func_append newdeplibs \" $a_deplib\"\n\t\t  a_deplib=\n\t\t  ;;\n\t\tesac\n\t      fi\n\t      if test -n \"$a_deplib\"; then\n\t\tlibname=`eval \"\\\\$ECHO \\\"$libname_spec\\\"\"`\n\t\tfor i in $lib_search_path $sys_lib_search_path $shlib_search_path; do\n\t\t  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`\n\t\t  for potent_lib in $potential_libs; do\n\t\t    potlib=$potent_lib # see symlink-check above in file_magic test\n\t\t    if eval \"\\$ECHO \\\"$potent_lib\\\"\" 2>/dev/null | $SED 10q | \\\n\t\t       $EGREP \"$match_pattern_regex\" > /dev/null; then\n\t\t      func_append newdeplibs \" $a_deplib\"\n\t\t      a_deplib=\n\t\t      break 2\n\t\t    fi\n\t\t  done\n\t\tdone\n\t      fi\n\t      if test -n \"$a_deplib\"; then\n\t\tdroppeddeps=yes\n\t\techo\n\t\t$ECHO \"*** Warning: linker path does not have real file for library $a_deplib.\"\n\t\techo \"*** I have the capability to make that library automatically link in when\"\n\t\techo \"*** you link to this library.  But I can only do this if you have a\"\n\t\techo \"*** shared version of the library, which you do not appear to have\"\n\t\techo \"*** because I did check the linker path looking for a file starting\"\n\t\tif test -z \"$potlib\"; then\n\t\t  $ECHO \"*** with $libname but no candidates were found. (...for regex pattern test)\"\n\t\telse\n\t\t  $ECHO \"*** with $libname and none of the candidates passed a file format test\"\n\t\t  $ECHO \"*** using a regex pattern. Last file checked: $potlib\"\n\t\tfi\n\t      fi\n\t      ;;\n\t    *)\n\t      # Add a -L argument.\n\t      func_append newdeplibs \" $a_deplib\"\n\t      ;;\n\t    esac\n\t  done # Gone through all deplibs.\n\t  ;;\n\tnone | unknown | *)\n\t  newdeplibs=\n\t  tmp_deplibs=`$ECHO \" $deplibs\" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`\n\t  if test yes = \"$allow_libtool_libs_with_static_runtimes\"; then\n\t    for i in $predeps $postdeps; do\n\t      # can't use Xsed below, because $i might contain '/'\n\t      tmp_deplibs=`$ECHO \" $tmp_deplibs\" | $SED \"s|$i||\"`\n\t    done\n\t  fi\n\t  case $tmp_deplibs in\n\t  *[!\\\t\\ ]*)\n\t    echo\n\t    if test none = \"$deplibs_check_method\"; then\n\t      echo \"*** Warning: inter-library dependencies are not supported in this platform.\"\n\t    else\n\t      echo \"*** Warning: inter-library dependencies are not known to be supported.\"\n\t    fi\n\t    echo \"*** All declared inter-library dependencies are being dropped.\"\n\t    droppeddeps=yes\n\t    ;;\n\t  esac\n\t  ;;\n\tesac\n\tversuffix=$versuffix_save\n\tmajor=$major_save\n\trelease=$release_save\n\tlibname=$libname_save\n\tname=$name_save\n\n\tcase $host in\n\t*-*-rhapsody* | *-*-darwin1.[012])\n\t  # On Rhapsody replace the C library with the System framework\n\t  newdeplibs=`$ECHO \" $newdeplibs\" | $SED 's/ -lc / System.ltframework /'`\n\t  ;;\n\tesac\n\n\tif test yes = \"$droppeddeps\"; then\n\t  if test yes = \"$module\"; then\n\t    echo\n\t    echo \"*** Warning: libtool could not satisfy all declared inter-library\"\n\t    $ECHO \"*** dependencies of module $libname.  Therefore, libtool will create\"\n\t    echo \"*** a static module, that should work as long as the dlopening\"\n\t    echo \"*** application is linked with the -dlopen flag.\"\n\t    if test -z \"$global_symbol_pipe\"; then\n\t      echo\n\t      echo \"*** However, this would only work if libtool was able to extract symbol\"\n\t      echo \"*** lists from a program, using 'nm' or equivalent, but libtool could\"\n\t      echo \"*** not find such a program.  So, this module is probably useless.\"\n\t      echo \"*** 'nm' from GNU binutils and a full rebuild may help.\"\n\t    fi\n\t    if test no = \"$build_old_libs\"; then\n\t      oldlibs=$output_objdir/$libname.$libext\n\t      build_libtool_libs=module\n\t      build_old_libs=yes\n\t    else\n\t      build_libtool_libs=no\n\t    fi\n\t  else\n\t    echo \"*** The inter-library dependencies that have been dropped here will be\"\n\t    echo \"*** automatically added whenever a program is linked with this library\"\n\t    echo \"*** or is declared to -dlopen it.\"\n\n\t    if test no = \"$allow_undefined\"; then\n\t      echo\n\t      echo \"*** Since this library must not contain undefined symbols,\"\n\t      echo \"*** because either the platform does not support them or\"\n\t      echo \"*** it was explicitly requested with -no-undefined,\"\n\t      echo \"*** libtool will only create a static version of it.\"\n\t      if test no = \"$build_old_libs\"; then\n\t\toldlibs=$output_objdir/$libname.$libext\n\t\tbuild_libtool_libs=module\n\t\tbuild_old_libs=yes\n\t      else\n\t\tbuild_libtool_libs=no\n\t      fi\n\t    fi\n\t  fi\n\tfi\n\t# Done checking deplibs!\n\tdeplibs=$newdeplibs\n      fi\n      # Time to change all our \"foo.ltframework\" stuff back to \"-framework foo\"\n      case $host in\n\t*-*-darwin*)\n\t  newdeplibs=`$ECHO \" $newdeplibs\" | $SED 's% \\([^ $]*\\).ltframework% -framework \\1%g'`\n\t  new_inherited_linker_flags=`$ECHO \" $new_inherited_linker_flags\" | $SED 's% \\([^ $]*\\).ltframework% -framework \\1%g'`\n\t  deplibs=`$ECHO \" $deplibs\" | $SED 's% \\([^ $]*\\).ltframework% -framework \\1%g'`\n\t  ;;\n      esac\n\n      # move library search paths that coincide with paths to not yet\n      # installed libraries to the beginning of the library search list\n      new_libs=\n      for path in $notinst_path; do\n\tcase \" $new_libs \" in\n\t*\" -L$path/$objdir \"*) ;;\n\t*)\n\t  case \" $deplibs \" in\n\t  *\" -L$path/$objdir \"*)\n\t    func_append new_libs \" -L$path/$objdir\" ;;\n\t  esac\n\t  ;;\n\tesac\n      done\n      for deplib in $deplibs; do\n\tcase $deplib in\n\t-L*)\n\t  case \" $new_libs \" in\n\t  *\" $deplib \"*) ;;\n\t  *) func_append new_libs \" $deplib\" ;;\n\t  esac\n\t  ;;\n\t*) func_append new_libs \" $deplib\" ;;\n\tesac\n      done\n      deplibs=$new_libs\n\n      # All the library-specific variables (install_libdir is set above).\n      library_names=\n      old_library=\n      dlname=\n\n      # Test again, we may have decided not to build it any more\n      if test yes = \"$build_libtool_libs\"; then\n\t# Remove $wl instances when linking with ld.\n\t# FIXME: should test the right _cmds variable.\n\tcase $archive_cmds in\n\t  *\\$LD\\ *) wl= ;;\n        esac\n\tif test yes = \"$hardcode_into_libs\"; then\n\t  # Hardcode the library paths\n\t  hardcode_libdirs=\n\t  dep_rpath=\n\t  rpath=$finalize_rpath\n\t  test relink = \"$opt_mode\" || rpath=$compile_rpath$rpath\n\t  for libdir in $rpath; do\n\t    if test -n \"$hardcode_libdir_flag_spec\"; then\n\t      if test -n \"$hardcode_libdir_separator\"; then\n\t\tfunc_replace_sysroot \"$libdir\"\n\t\tlibdir=$func_replace_sysroot_result\n\t\tif test -z \"$hardcode_libdirs\"; then\n\t\t  hardcode_libdirs=$libdir\n\t\telse\n\t\t  # Just accumulate the unique libdirs.\n\t\t  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in\n\t\t  *\"$hardcode_libdir_separator$libdir$hardcode_libdir_separator\"*)\n\t\t    ;;\n\t\t  *)\n\t\t    func_append hardcode_libdirs \"$hardcode_libdir_separator$libdir\"\n\t\t    ;;\n\t\t  esac\n\t\tfi\n\t      else\n\t\teval flag=\\\"$hardcode_libdir_flag_spec\\\"\n\t\tfunc_append dep_rpath \" $flag\"\n\t      fi\n\t    elif test -n \"$runpath_var\"; then\n\t      case \"$perm_rpath \" in\n\t      *\" $libdir \"*) ;;\n\t      *) func_append perm_rpath \" $libdir\" ;;\n\t      esac\n\t    fi\n\t  done\n\t  # Substitute the hardcoded libdirs into the rpath.\n\t  if test -n \"$hardcode_libdir_separator\" &&\n\t     test -n \"$hardcode_libdirs\"; then\n\t    libdir=$hardcode_libdirs\n\t    eval \"dep_rpath=\\\"$hardcode_libdir_flag_spec\\\"\"\n\t  fi\n\t  if test -n \"$runpath_var\" && test -n \"$perm_rpath\"; then\n\t    # We should set the runpath_var.\n\t    rpath=\n\t    for dir in $perm_rpath; do\n\t      func_append rpath \"$dir:\"\n\t    done\n\t    eval \"$runpath_var='$rpath\\$$runpath_var'; export $runpath_var\"\n\t  fi\n\t  test -n \"$dep_rpath\" && deplibs=\"$dep_rpath $deplibs\"\n\tfi\n\n\tshlibpath=$finalize_shlibpath\n\ttest relink = \"$opt_mode\" || shlibpath=$compile_shlibpath$shlibpath\n\tif test -n \"$shlibpath\"; then\n\t  eval \"$shlibpath_var='$shlibpath\\$$shlibpath_var'; export $shlibpath_var\"\n\tfi\n\n\t# Get the real and link names of the library.\n\teval shared_ext=\\\"$shrext_cmds\\\"\n\teval library_names=\\\"$library_names_spec\\\"\n\tset dummy $library_names\n\tshift\n\trealname=$1\n\tshift\n\n\tif test -n \"$soname_spec\"; then\n\t  eval soname=\\\"$soname_spec\\\"\n\telse\n\t  soname=$realname\n\tfi\n\tif test -z \"$dlname\"; then\n\t  dlname=$soname\n\tfi\n\n\tlib=$output_objdir/$realname\n\tlinknames=\n\tfor link\n\tdo\n\t  func_append linknames \" $link\"\n\tdone\n\n\t# Use standard objects if they are pic\n\ttest -z \"$pic_flag\" && libobjs=`$ECHO \"$libobjs\" | $SP2NL | $SED \"$lo2o\" | $NL2SP`\n\ttest \"X$libobjs\" = \"X \" && libobjs=\n\n\tdelfiles=\n\tif test -n \"$export_symbols\" && test -n \"$include_expsyms\"; then\n\t  $opt_dry_run || cp \"$export_symbols\" \"$output_objdir/$libname.uexp\"\n\t  export_symbols=$output_objdir/$libname.uexp\n\t  func_append delfiles \" $export_symbols\"\n\tfi\n\n\torig_export_symbols=\n\tcase $host_os in\n\tcygwin* | mingw* | cegcc*)\n\t  if test -n \"$export_symbols\" && test -z \"$export_symbols_regex\"; then\n\t    # exporting using user supplied symfile\n\t    func_dll_def_p \"$export_symbols\" || {\n\t      # and it's NOT already a .def file. Must figure out\n\t      # which of the given symbols are data symbols and tag\n\t      # them as such. So, trigger use of export_symbols_cmds.\n\t      # export_symbols gets reassigned inside the \"prepare\n\t      # the list of exported symbols\" if statement, so the\n\t      # include_expsyms logic still works.\n\t      orig_export_symbols=$export_symbols\n\t      export_symbols=\n\t      always_export_symbols=yes\n\t    }\n\t  fi\n\t  ;;\n\tesac\n\n\t# Prepare the list of exported symbols\n\tif test -z \"$export_symbols\"; then\n\t  if test yes = \"$always_export_symbols\" || test -n \"$export_symbols_regex\"; then\n\t    func_verbose \"generating symbol list for '$libname.la'\"\n\t    export_symbols=$output_objdir/$libname.exp\n\t    $opt_dry_run || $RM $export_symbols\n\t    cmds=$export_symbols_cmds\n\t    save_ifs=$IFS; IFS='~'\n\t    for cmd1 in $cmds; do\n\t      IFS=$save_ifs\n\t      # Take the normal branch if the nm_file_list_spec branch\n\t      # doesn't work or if tool conversion is not needed.\n\t      case $nm_file_list_spec~$to_tool_file_cmd in\n\t\t*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)\n\t\t  try_normal_branch=yes\n\t\t  eval cmd=\\\"$cmd1\\\"\n\t\t  func_len \" $cmd\"\n\t\t  len=$func_len_result\n\t\t  ;;\n\t\t*)\n\t\t  try_normal_branch=no\n\t\t  ;;\n\t      esac\n\t      if test yes = \"$try_normal_branch\" \\\n\t\t && { test \"$len\" -lt \"$max_cmd_len\" \\\n\t\t      || test \"$max_cmd_len\" -le -1; }\n\t      then\n\t\tfunc_show_eval \"$cmd\" 'exit $?'\n\t\tskipped_export=false\n\t      elif test -n \"$nm_file_list_spec\"; then\n\t\tfunc_basename \"$output\"\n\t\toutput_la=$func_basename_result\n\t\tsave_libobjs=$libobjs\n\t\tsave_output=$output\n\t\toutput=$output_objdir/$output_la.nm\n\t\tfunc_to_tool_file \"$output\"\n\t\tlibobjs=$nm_file_list_spec$func_to_tool_file_result\n\t\tfunc_append delfiles \" $output\"\n\t\tfunc_verbose \"creating $NM input file list: $output\"\n\t\tfor obj in $save_libobjs; do\n\t\t  func_to_tool_file \"$obj\"\n\t\t  $ECHO \"$func_to_tool_file_result\"\n\t\tdone > \"$output\"\n\t\teval cmd=\\\"$cmd1\\\"\n\t\tfunc_show_eval \"$cmd\" 'exit $?'\n\t\toutput=$save_output\n\t\tlibobjs=$save_libobjs\n\t\tskipped_export=false\n\t      else\n\t\t# The command line is too long to execute in one step.\n\t\tfunc_verbose \"using reloadable object file for export list...\"\n\t\tskipped_export=:\n\t\t# Break out early, otherwise skipped_export may be\n\t\t# set to false by a later but shorter cmd.\n\t\tbreak\n\t      fi\n\t    done\n\t    IFS=$save_ifs\n\t    if test -n \"$export_symbols_regex\" && test : != \"$skipped_export\"; then\n\t      func_show_eval '$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"'\n\t      func_show_eval '$MV \"${export_symbols}T\" \"$export_symbols\"'\n\t    fi\n\t  fi\n\tfi\n\n\tif test -n \"$export_symbols\" && test -n \"$include_expsyms\"; then\n\t  tmp_export_symbols=$export_symbols\n\t  test -n \"$orig_export_symbols\" && tmp_export_symbols=$orig_export_symbols\n\t  $opt_dry_run || eval '$ECHO \"$include_expsyms\" | $SP2NL >> \"$tmp_export_symbols\"'\n\tfi\n\n\tif test : != \"$skipped_export\" && test -n \"$orig_export_symbols\"; then\n\t  # The given exports_symbols file has to be filtered, so filter it.\n\t  func_verbose \"filter symbol list for '$libname.la' to tag DATA exports\"\n\t  # FIXME: $output_objdir/$libname.filter potentially contains lots of\n\t  # 's' commands, which not all seds can handle. GNU sed should be fine\n\t  # though. Also, the filter scales superlinearly with the number of\n\t  # global variables. join(1) would be nice here, but unfortunately\n\t  # isn't a blessed tool.\n\t  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\\(.*\\)\\([ \\,].*\\),s|^\\1$|\\1\\2|,' < $export_symbols > $output_objdir/$libname.filter\n\t  func_append delfiles \" $export_symbols $output_objdir/$libname.filter\"\n\t  export_symbols=$output_objdir/$libname.def\n\t  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols\n\tfi\n\n\ttmp_deplibs=\n\tfor test_deplib in $deplibs; do\n\t  case \" $convenience \" in\n\t  *\" $test_deplib \"*) ;;\n\t  *)\n\t    func_append tmp_deplibs \" $test_deplib\"\n\t    ;;\n\t  esac\n\tdone\n\tdeplibs=$tmp_deplibs\n\n\tif test -n \"$convenience\"; then\n\t  if test -n \"$whole_archive_flag_spec\" &&\n\t    test yes = \"$compiler_needs_object\" &&\n\t    test -z \"$libobjs\"; then\n\t    # extract the archives, so we have objects to list.\n\t    # TODO: could optimize this to just extract one archive.\n\t    whole_archive_flag_spec=\n\t  fi\n\t  if test -n \"$whole_archive_flag_spec\"; then\n\t    save_libobjs=$libobjs\n\t    eval libobjs=\\\"\\$libobjs $whole_archive_flag_spec\\\"\n\t    test \"X$libobjs\" = \"X \" && libobjs=\n\t  else\n\t    gentop=$output_objdir/${outputname}x\n\t    func_append generated \" $gentop\"\n\n\t    func_extract_archives $gentop $convenience\n\t    func_append libobjs \" $func_extract_archives_result\"\n\t    test \"X$libobjs\" = \"X \" && libobjs=\n\t  fi\n\tfi\n\n\tif test yes = \"$thread_safe\" && test -n \"$thread_safe_flag_spec\"; then\n\t  eval flag=\\\"$thread_safe_flag_spec\\\"\n\t  func_append linker_flags \" $flag\"\n\tfi\n\n\t# Make a backup of the uninstalled library when relinking\n\tif test relink = \"$opt_mode\"; then\n\t  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?\n\tfi\n\n\t# Do each of the archive commands.\n\tif test yes = \"$module\" && test -n \"$module_cmds\"; then\n\t  if test -n \"$export_symbols\" && test -n \"$module_expsym_cmds\"; then\n\t    eval test_cmds=\\\"$module_expsym_cmds\\\"\n\t    cmds=$module_expsym_cmds\n\t  else\n\t    eval test_cmds=\\\"$module_cmds\\\"\n\t    cmds=$module_cmds\n\t  fi\n\telse\n\t  if test -n \"$export_symbols\" && test -n \"$archive_expsym_cmds\"; then\n\t    eval test_cmds=\\\"$archive_expsym_cmds\\\"\n\t    cmds=$archive_expsym_cmds\n\t  else\n\t    eval test_cmds=\\\"$archive_cmds\\\"\n\t    cmds=$archive_cmds\n\t  fi\n\tfi\n\n\tif test : != \"$skipped_export\" &&\n\t   func_len \" $test_cmds\" &&\n\t   len=$func_len_result &&\n\t   test \"$len\" -lt \"$max_cmd_len\" || test \"$max_cmd_len\" -le -1; then\n\t  :\n\telse\n\t  # The command line is too long to link in one step, link piecewise\n\t  # or, if using GNU ld and skipped_export is not :, use a linker\n\t  # script.\n\n\t  # Save the value of $output and $libobjs because we want to\n\t  # use them later.  If we have whole_archive_flag_spec, we\n\t  # want to use save_libobjs as it was before\n\t  # whole_archive_flag_spec was expanded, because we can't\n\t  # assume the linker understands whole_archive_flag_spec.\n\t  # This may have to be revisited, in case too many\n\t  # convenience libraries get linked in and end up exceeding\n\t  # the spec.\n\t  if test -z \"$convenience\" || test -z \"$whole_archive_flag_spec\"; then\n\t    save_libobjs=$libobjs\n\t  fi\n\t  save_output=$output\n\t  func_basename \"$output\"\n\t  output_la=$func_basename_result\n\n\t  # Clear the reloadable object creation command queue and\n\t  # initialize k to one.\n\t  test_cmds=\n\t  concat_cmds=\n\t  objlist=\n\t  last_robj=\n\t  k=1\n\n\t  if test -n \"$save_libobjs\" && test : != \"$skipped_export\" && test yes = \"$with_gnu_ld\"; then\n\t    output=$output_objdir/$output_la.lnkscript\n\t    func_verbose \"creating GNU ld script: $output\"\n\t    echo 'INPUT (' > $output\n\t    for obj in $save_libobjs\n\t    do\n\t      func_to_tool_file \"$obj\"\n\t      $ECHO \"$func_to_tool_file_result\" >> $output\n\t    done\n\t    echo ')' >> $output\n\t    func_append delfiles \" $output\"\n\t    func_to_tool_file \"$output\"\n\t    output=$func_to_tool_file_result\n\t  elif test -n \"$save_libobjs\" && test : != \"$skipped_export\" && test -n \"$file_list_spec\"; then\n\t    output=$output_objdir/$output_la.lnk\n\t    func_verbose \"creating linker input file list: $output\"\n\t    : > $output\n\t    set x $save_libobjs\n\t    shift\n\t    firstobj=\n\t    if test yes = \"$compiler_needs_object\"; then\n\t      firstobj=\"$1 \"\n\t      shift\n\t    fi\n\t    for obj\n\t    do\n\t      func_to_tool_file \"$obj\"\n\t      $ECHO \"$func_to_tool_file_result\" >> $output\n\t    done\n\t    func_append delfiles \" $output\"\n\t    func_to_tool_file \"$output\"\n\t    output=$firstobj\\\"$file_list_spec$func_to_tool_file_result\\\"\n\t  else\n\t    if test -n \"$save_libobjs\"; then\n\t      func_verbose \"creating reloadable object files...\"\n\t      output=$output_objdir/$output_la-$k.$objext\n\t      eval test_cmds=\\\"$reload_cmds\\\"\n\t      func_len \" $test_cmds\"\n\t      len0=$func_len_result\n\t      len=$len0\n\n\t      # Loop over the list of objects to be linked.\n\t      for obj in $save_libobjs\n\t      do\n\t\tfunc_len \" $obj\"\n\t\tfunc_arith $len + $func_len_result\n\t\tlen=$func_arith_result\n\t\tif test -z \"$objlist\" ||\n\t\t   test \"$len\" -lt \"$max_cmd_len\"; then\n\t\t  func_append objlist \" $obj\"\n\t\telse\n\t\t  # The command $test_cmds is almost too long, add a\n\t\t  # command to the queue.\n\t\t  if test 1 -eq \"$k\"; then\n\t\t    # The first file doesn't have a previous command to add.\n\t\t    reload_objs=$objlist\n\t\t    eval concat_cmds=\\\"$reload_cmds\\\"\n\t\t  else\n\t\t    # All subsequent reloadable object files will link in\n\t\t    # the last one created.\n\t\t    reload_objs=\"$objlist $last_robj\"\n\t\t    eval concat_cmds=\\\"\\$concat_cmds~$reload_cmds~\\$RM $last_robj\\\"\n\t\t  fi\n\t\t  last_robj=$output_objdir/$output_la-$k.$objext\n\t\t  func_arith $k + 1\n\t\t  k=$func_arith_result\n\t\t  output=$output_objdir/$output_la-$k.$objext\n\t\t  objlist=\" $obj\"\n\t\t  func_len \" $last_robj\"\n\t\t  func_arith $len0 + $func_len_result\n\t\t  len=$func_arith_result\n\t\tfi\n\t      done\n\t      # Handle the remaining objects by creating one last\n\t      # reloadable object file.  All subsequent reloadable object\n\t      # files will link in the last one created.\n\t      test -z \"$concat_cmds\" || concat_cmds=$concat_cmds~\n\t      reload_objs=\"$objlist $last_robj\"\n\t      eval concat_cmds=\\\"\\$concat_cmds$reload_cmds\\\"\n\t      if test -n \"$last_robj\"; then\n\t        eval concat_cmds=\\\"\\$concat_cmds~\\$RM $last_robj\\\"\n\t      fi\n\t      func_append delfiles \" $output\"\n\n\t    else\n\t      output=\n\t    fi\n\n\t    ${skipped_export-false} && {\n\t      func_verbose \"generating symbol list for '$libname.la'\"\n\t      export_symbols=$output_objdir/$libname.exp\n\t      $opt_dry_run || $RM $export_symbols\n\t      libobjs=$output\n\t      # Append the command to create the export file.\n\t      test -z \"$concat_cmds\" || concat_cmds=$concat_cmds~\n\t      eval concat_cmds=\\\"\\$concat_cmds$export_symbols_cmds\\\"\n\t      if test -n \"$last_robj\"; then\n\t\teval concat_cmds=\\\"\\$concat_cmds~\\$RM $last_robj\\\"\n\t      fi\n\t    }\n\n\t    test -n \"$save_libobjs\" &&\n\t      func_verbose \"creating a temporary reloadable object file: $output\"\n\n\t    # Loop through the commands generated above and execute them.\n\t    save_ifs=$IFS; IFS='~'\n\t    for cmd in $concat_cmds; do\n\t      IFS=$save_ifs\n\t      $opt_quiet || {\n\t\t  func_quote_for_expand \"$cmd\"\n\t\t  eval \"func_echo $func_quote_for_expand_result\"\n\t      }\n\t      $opt_dry_run || eval \"$cmd\" || {\n\t\tlt_exit=$?\n\n\t\t# Restore the uninstalled library and exit\n\t\tif test relink = \"$opt_mode\"; then\n\t\t  ( cd \"$output_objdir\" && \\\n\t\t    $RM \"${realname}T\" && \\\n\t\t    $MV \"${realname}U\" \"$realname\" )\n\t\tfi\n\n\t\texit $lt_exit\n\t      }\n\t    done\n\t    IFS=$save_ifs\n\n\t    if test -n \"$export_symbols_regex\" && ${skipped_export-false}; then\n\t      func_show_eval '$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"'\n\t      func_show_eval '$MV \"${export_symbols}T\" \"$export_symbols\"'\n\t    fi\n\t  fi\n\n          ${skipped_export-false} && {\n\t    if test -n \"$export_symbols\" && test -n \"$include_expsyms\"; then\n\t      tmp_export_symbols=$export_symbols\n\t      test -n \"$orig_export_symbols\" && tmp_export_symbols=$orig_export_symbols\n\t      $opt_dry_run || eval '$ECHO \"$include_expsyms\" | $SP2NL >> \"$tmp_export_symbols\"'\n\t    fi\n\n\t    if test -n \"$orig_export_symbols\"; then\n\t      # The given exports_symbols file has to be filtered, so filter it.\n\t      func_verbose \"filter symbol list for '$libname.la' to tag DATA exports\"\n\t      # FIXME: $output_objdir/$libname.filter potentially contains lots of\n\t      # 's' commands, which not all seds can handle. GNU sed should be fine\n\t      # though. Also, the filter scales superlinearly with the number of\n\t      # global variables. join(1) would be nice here, but unfortunately\n\t      # isn't a blessed tool.\n\t      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\\(.*\\)\\([ \\,].*\\),s|^\\1$|\\1\\2|,' < $export_symbols > $output_objdir/$libname.filter\n\t      func_append delfiles \" $export_symbols $output_objdir/$libname.filter\"\n\t      export_symbols=$output_objdir/$libname.def\n\t      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols\n\t    fi\n\t  }\n\n\t  libobjs=$output\n\t  # Restore the value of output.\n\t  output=$save_output\n\n\t  if test -n \"$convenience\" && test -n \"$whole_archive_flag_spec\"; then\n\t    eval libobjs=\\\"\\$libobjs $whole_archive_flag_spec\\\"\n\t    test \"X$libobjs\" = \"X \" && libobjs=\n\t  fi\n\t  # Expand the library linking commands again to reset the\n\t  # value of $libobjs for piecewise linking.\n\n\t  # Do each of the archive commands.\n\t  if test yes = \"$module\" && test -n \"$module_cmds\"; then\n\t    if test -n \"$export_symbols\" && test -n \"$module_expsym_cmds\"; then\n\t      cmds=$module_expsym_cmds\n\t    else\n\t      cmds=$module_cmds\n\t    fi\n\t  else\n\t    if test -n \"$export_symbols\" && test -n \"$archive_expsym_cmds\"; then\n\t      cmds=$archive_expsym_cmds\n\t    else\n\t      cmds=$archive_cmds\n\t    fi\n\t  fi\n\tfi\n\n\tif test -n \"$delfiles\"; then\n\t  # Append the command to remove temporary files to $cmds.\n\t  eval cmds=\\\"\\$cmds~\\$RM $delfiles\\\"\n\tfi\n\n\t# Add any objects from preloaded convenience libraries\n\tif test -n \"$dlprefiles\"; then\n\t  gentop=$output_objdir/${outputname}x\n\t  func_append generated \" $gentop\"\n\n\t  func_extract_archives $gentop $dlprefiles\n\t  func_append libobjs \" $func_extract_archives_result\"\n\t  test \"X$libobjs\" = \"X \" && libobjs=\n\tfi\n\n\tsave_ifs=$IFS; IFS='~'\n\tfor cmd in $cmds; do\n\t  IFS=$sp$nl\n\t  eval cmd=\\\"$cmd\\\"\n\t  IFS=$save_ifs\n\t  $opt_quiet || {\n\t    func_quote_for_expand \"$cmd\"\n\t    eval \"func_echo $func_quote_for_expand_result\"\n\t  }\n\t  $opt_dry_run || eval \"$cmd\" || {\n\t    lt_exit=$?\n\n\t    # Restore the uninstalled library and exit\n\t    if test relink = \"$opt_mode\"; then\n\t      ( cd \"$output_objdir\" && \\\n\t        $RM \"${realname}T\" && \\\n\t\t$MV \"${realname}U\" \"$realname\" )\n\t    fi\n\n\t    exit $lt_exit\n\t  }\n\tdone\n\tIFS=$save_ifs\n\n\t# Restore the uninstalled library and exit\n\tif test relink = \"$opt_mode\"; then\n\t  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?\n\n\t  if test -n \"$convenience\"; then\n\t    if test -z \"$whole_archive_flag_spec\"; then\n\t      func_show_eval '${RM}r \"$gentop\"'\n\t    fi\n\t  fi\n\n\t  exit $EXIT_SUCCESS\n\tfi\n\n\t# Create links to the real library.\n\tfor linkname in $linknames; do\n\t  if test \"$realname\" != \"$linkname\"; then\n\t    func_show_eval '(cd \"$output_objdir\" && $RM \"$linkname\" && $LN_S \"$realname\" \"$linkname\")' 'exit $?'\n\t  fi\n\tdone\n\n\t# If -module or -export-dynamic was specified, set the dlname.\n\tif test yes = \"$module\" || test yes = \"$export_dynamic\"; then\n\t  # On all known operating systems, these are identical.\n\t  dlname=$soname\n\tfi\n      fi\n      ;;\n\n    obj)\n      if test -n \"$dlfiles$dlprefiles\" || test no != \"$dlself\"; then\n\tfunc_warning \"'-dlopen' is ignored for objects\"\n      fi\n\n      case \" $deplibs\" in\n      *\\ -l* | *\\ -L*)\n\tfunc_warning \"'-l' and '-L' are ignored for objects\" ;;\n      esac\n\n      test -n \"$rpath\" && \\\n\tfunc_warning \"'-rpath' is ignored for objects\"\n\n      test -n \"$xrpath\" && \\\n\tfunc_warning \"'-R' is ignored for objects\"\n\n      test -n \"$vinfo\" && \\\n\tfunc_warning \"'-version-info' is ignored for objects\"\n\n      test -n \"$release\" && \\\n\tfunc_warning \"'-release' is ignored for objects\"\n\n      case $output in\n      *.lo)\n\ttest -n \"$objs$old_deplibs\" && \\\n\t  func_fatal_error \"cannot build library object '$output' from non-libtool objects\"\n\n\tlibobj=$output\n\tfunc_lo2o \"$libobj\"\n\tobj=$func_lo2o_result\n\t;;\n      *)\n\tlibobj=\n\tobj=$output\n\t;;\n      esac\n\n      # Delete the old objects.\n      $opt_dry_run || $RM $obj $libobj\n\n      # Objects from convenience libraries.  This assumes\n      # single-version convenience libraries.  Whenever we create\n      # different ones for PIC/non-PIC, this we'll have to duplicate\n      # the extraction.\n      reload_conv_objs=\n      gentop=\n      # if reload_cmds runs $LD directly, get rid of -Wl from\n      # whole_archive_flag_spec and hope we can get by with turning comma\n      # into space.\n      case $reload_cmds in\n        *\\$LD[\\ \\$]*) wl= ;;\n      esac\n      if test -n \"$convenience\"; then\n\tif test -n \"$whole_archive_flag_spec\"; then\n\t  eval tmp_whole_archive_flags=\\\"$whole_archive_flag_spec\\\"\n\t  test -n \"$wl\" || tmp_whole_archive_flags=`$ECHO \"$tmp_whole_archive_flags\" | $SED 's|,| |g'`\n\t  reload_conv_objs=$reload_objs\\ $tmp_whole_archive_flags\n\telse\n\t  gentop=$output_objdir/${obj}x\n\t  func_append generated \" $gentop\"\n\n\t  func_extract_archives $gentop $convenience\n\t  reload_conv_objs=\"$reload_objs $func_extract_archives_result\"\n\tfi\n      fi\n\n      # If we're not building shared, we need to use non_pic_objs\n      test yes = \"$build_libtool_libs\" || libobjs=$non_pic_objects\n\n      # Create the old-style object.\n      reload_objs=$objs$old_deplibs' '`$ECHO \"$libobjs\" | $SP2NL | $SED \"/\\.$libext$/d; /\\.lib$/d; $lo2o\" | $NL2SP`' '$reload_conv_objs\n\n      output=$obj\n      func_execute_cmds \"$reload_cmds\" 'exit $?'\n\n      # Exit if we aren't doing a library object file.\n      if test -z \"$libobj\"; then\n\tif test -n \"$gentop\"; then\n\t  func_show_eval '${RM}r \"$gentop\"'\n\tfi\n\n\texit $EXIT_SUCCESS\n      fi\n\n      test yes = \"$build_libtool_libs\" || {\n\tif test -n \"$gentop\"; then\n\t  func_show_eval '${RM}r \"$gentop\"'\n\tfi\n\n\t# Create an invalid libtool object if no PIC, so that we don't\n\t# accidentally link it into a program.\n\t# $show \"echo timestamp > $libobj\"\n\t# $opt_dry_run || eval \"echo timestamp > $libobj\" || exit $?\n\texit $EXIT_SUCCESS\n      }\n\n      if test -n \"$pic_flag\" || test default != \"$pic_mode\"; then\n\t# Only do commands if we really have different PIC objects.\n\treload_objs=\"$libobjs $reload_conv_objs\"\n\toutput=$libobj\n\tfunc_execute_cmds \"$reload_cmds\" 'exit $?'\n      fi\n\n      if test -n \"$gentop\"; then\n\tfunc_show_eval '${RM}r \"$gentop\"'\n      fi\n\n      exit $EXIT_SUCCESS\n      ;;\n\n    prog)\n      case $host in\n\t*cygwin*) func_stripname '' '.exe' \"$output\"\n\t          output=$func_stripname_result.exe;;\n      esac\n      test -n \"$vinfo\" && \\\n\tfunc_warning \"'-version-info' is ignored for programs\"\n\n      test -n \"$release\" && \\\n\tfunc_warning \"'-release' is ignored for programs\"\n\n      $preload \\\n\t&& test unknown,unknown,unknown = \"$dlopen_support,$dlopen_self,$dlopen_self_static\" \\\n\t&& func_warning \"'LT_INIT([dlopen])' not used. Assuming no dlopen support.\"\n\n      case $host in\n      *-*-rhapsody* | *-*-darwin1.[012])\n\t# On Rhapsody replace the C library is the System framework\n\tcompile_deplibs=`$ECHO \" $compile_deplibs\" | $SED 's/ -lc / System.ltframework /'`\n\tfinalize_deplibs=`$ECHO \" $finalize_deplibs\" | $SED 's/ -lc / System.ltframework /'`\n\t;;\n      esac\n\n      case $host in\n      *-*-darwin*)\n\t# Don't allow lazy linking, it breaks C++ global constructors\n\t# But is supposedly fixed on 10.4 or later (yay!).\n\tif test CXX = \"$tagname\"; then\n\t  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in\n\t    10.[0123])\n\t      func_append compile_command \" $wl-bind_at_load\"\n\t      func_append finalize_command \" $wl-bind_at_load\"\n\t    ;;\n\t  esac\n\tfi\n\t# Time to change all our \"foo.ltframework\" stuff back to \"-framework foo\"\n\tcompile_deplibs=`$ECHO \" $compile_deplibs\" | $SED 's% \\([^ $]*\\).ltframework% -framework \\1%g'`\n\tfinalize_deplibs=`$ECHO \" $finalize_deplibs\" | $SED 's% \\([^ $]*\\).ltframework% -framework \\1%g'`\n\t;;\n      esac\n\n\n      # move library search paths that coincide with paths to not yet\n      # installed libraries to the beginning of the library search list\n      new_libs=\n      for path in $notinst_path; do\n\tcase \" $new_libs \" in\n\t*\" -L$path/$objdir \"*) ;;\n\t*)\n\t  case \" $compile_deplibs \" in\n\t  *\" -L$path/$objdir \"*)\n\t    func_append new_libs \" -L$path/$objdir\" ;;\n\t  esac\n\t  ;;\n\tesac\n      done\n      for deplib in $compile_deplibs; do\n\tcase $deplib in\n\t-L*)\n\t  case \" $new_libs \" in\n\t  *\" $deplib \"*) ;;\n\t  *) func_append new_libs \" $deplib\" ;;\n\t  esac\n\t  ;;\n\t*) func_append new_libs \" $deplib\" ;;\n\tesac\n      done\n      compile_deplibs=$new_libs\n\n\n      func_append compile_command \" $compile_deplibs\"\n      func_append finalize_command \" $finalize_deplibs\"\n\n      if test -n \"$rpath$xrpath\"; then\n\t# If the user specified any rpath flags, then add them.\n\tfor libdir in $rpath $xrpath; do\n\t  # This is the magic to use -rpath.\n\t  case \"$finalize_rpath \" in\n\t  *\" $libdir \"*) ;;\n\t  *) func_append finalize_rpath \" $libdir\" ;;\n\t  esac\n\tdone\n      fi\n\n      # Now hardcode the library paths\n      rpath=\n      hardcode_libdirs=\n      for libdir in $compile_rpath $finalize_rpath; do\n\tif test -n \"$hardcode_libdir_flag_spec\"; then\n\t  if test -n \"$hardcode_libdir_separator\"; then\n\t    if test -z \"$hardcode_libdirs\"; then\n\t      hardcode_libdirs=$libdir\n\t    else\n\t      # Just accumulate the unique libdirs.\n\t      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in\n\t      *\"$hardcode_libdir_separator$libdir$hardcode_libdir_separator\"*)\n\t\t;;\n\t      *)\n\t\tfunc_append hardcode_libdirs \"$hardcode_libdir_separator$libdir\"\n\t\t;;\n\t      esac\n\t    fi\n\t  else\n\t    eval flag=\\\"$hardcode_libdir_flag_spec\\\"\n\t    func_append rpath \" $flag\"\n\t  fi\n\telif test -n \"$runpath_var\"; then\n\t  case \"$perm_rpath \" in\n\t  *\" $libdir \"*) ;;\n\t  *) func_append perm_rpath \" $libdir\" ;;\n\t  esac\n\tfi\n\tcase $host in\n\t*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)\n\t  testbindir=`$ECHO \"$libdir\" | $SED -e 's*/lib$*/bin*'`\n\t  case :$dllsearchpath: in\n\t  *\":$libdir:\"*) ;;\n\t  ::) dllsearchpath=$libdir;;\n\t  *) func_append dllsearchpath \":$libdir\";;\n\t  esac\n\t  case :$dllsearchpath: in\n\t  *\":$testbindir:\"*) ;;\n\t  ::) dllsearchpath=$testbindir;;\n\t  *) func_append dllsearchpath \":$testbindir\";;\n\t  esac\n\t  ;;\n\tesac\n      done\n      # Substitute the hardcoded libdirs into the rpath.\n      if test -n \"$hardcode_libdir_separator\" &&\n\t test -n \"$hardcode_libdirs\"; then\n\tlibdir=$hardcode_libdirs\n\teval rpath=\\\" $hardcode_libdir_flag_spec\\\"\n      fi\n      compile_rpath=$rpath\n\n      rpath=\n      hardcode_libdirs=\n      for libdir in $finalize_rpath; do\n\tif test -n \"$hardcode_libdir_flag_spec\"; then\n\t  if test -n \"$hardcode_libdir_separator\"; then\n\t    if test -z \"$hardcode_libdirs\"; then\n\t      hardcode_libdirs=$libdir\n\t    else\n\t      # Just accumulate the unique libdirs.\n\t      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in\n\t      *\"$hardcode_libdir_separator$libdir$hardcode_libdir_separator\"*)\n\t\t;;\n\t      *)\n\t\tfunc_append hardcode_libdirs \"$hardcode_libdir_separator$libdir\"\n\t\t;;\n\t      esac\n\t    fi\n\t  else\n\t    eval flag=\\\"$hardcode_libdir_flag_spec\\\"\n\t    func_append rpath \" $flag\"\n\t  fi\n\telif test -n \"$runpath_var\"; then\n\t  case \"$finalize_perm_rpath \" in\n\t  *\" $libdir \"*) ;;\n\t  *) func_append finalize_perm_rpath \" $libdir\" ;;\n\t  esac\n\tfi\n      done\n      # Substitute the hardcoded libdirs into the rpath.\n      if test -n \"$hardcode_libdir_separator\" &&\n\t test -n \"$hardcode_libdirs\"; then\n\tlibdir=$hardcode_libdirs\n\teval rpath=\\\" $hardcode_libdir_flag_spec\\\"\n      fi\n      finalize_rpath=$rpath\n\n      if test -n \"$libobjs\" && test yes = \"$build_old_libs\"; then\n\t# Transform all the library objects into standard objects.\n\tcompile_command=`$ECHO \"$compile_command\" | $SP2NL | $SED \"$lo2o\" | $NL2SP`\n\tfinalize_command=`$ECHO \"$finalize_command\" | $SP2NL | $SED \"$lo2o\" | $NL2SP`\n      fi\n\n      func_generate_dlsyms \"$outputname\" \"@PROGRAM@\" false\n\n      # template prelinking step\n      if test -n \"$prelink_cmds\"; then\n\tfunc_execute_cmds \"$prelink_cmds\" 'exit $?'\n      fi\n\n      wrappers_required=:\n      case $host in\n      *cegcc* | *mingw32ce*)\n        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.\n        wrappers_required=false\n        ;;\n      *cygwin* | *mingw* )\n        test yes = \"$build_libtool_libs\" || wrappers_required=false\n        ;;\n      *)\n        if test no = \"$need_relink\" || test yes != \"$build_libtool_libs\"; then\n          wrappers_required=false\n        fi\n        ;;\n      esac\n      $wrappers_required || {\n\t# Replace the output file specification.\n\tcompile_command=`$ECHO \"$compile_command\" | $SED 's%@OUTPUT@%'\"$output\"'%g'`\n\tlink_command=$compile_command$compile_rpath\n\n\t# We have no uninstalled library dependencies, so finalize right now.\n\texit_status=0\n\tfunc_show_eval \"$link_command\" 'exit_status=$?'\n\n\tif test -n \"$postlink_cmds\"; then\n\t  func_to_tool_file \"$output\"\n\t  postlink_cmds=`func_echo_all \"$postlink_cmds\" | $SED -e 's%@OUTPUT@%'\"$output\"'%g' -e 's%@TOOL_OUTPUT@%'\"$func_to_tool_file_result\"'%g'`\n\t  func_execute_cmds \"$postlink_cmds\" 'exit $?'\n\tfi\n\n\t# Delete the generated files.\n\tif test -f \"$output_objdir/${outputname}S.$objext\"; then\n\t  func_show_eval '$RM \"$output_objdir/${outputname}S.$objext\"'\n\tfi\n\n\texit $exit_status\n      }\n\n      if test -n \"$compile_shlibpath$finalize_shlibpath\"; then\n\tcompile_command=\"$shlibpath_var=\\\"$compile_shlibpath$finalize_shlibpath\\$$shlibpath_var\\\" $compile_command\"\n      fi\n      if test -n \"$finalize_shlibpath\"; then\n\tfinalize_command=\"$shlibpath_var=\\\"$finalize_shlibpath\\$$shlibpath_var\\\" $finalize_command\"\n      fi\n\n      compile_var=\n      finalize_var=\n      if test -n \"$runpath_var\"; then\n\tif test -n \"$perm_rpath\"; then\n\t  # We should set the runpath_var.\n\t  rpath=\n\t  for dir in $perm_rpath; do\n\t    func_append rpath \"$dir:\"\n\t  done\n\t  compile_var=\"$runpath_var=\\\"$rpath\\$$runpath_var\\\" \"\n\tfi\n\tif test -n \"$finalize_perm_rpath\"; then\n\t  # We should set the runpath_var.\n\t  rpath=\n\t  for dir in $finalize_perm_rpath; do\n\t    func_append rpath \"$dir:\"\n\t  done\n\t  finalize_var=\"$runpath_var=\\\"$rpath\\$$runpath_var\\\" \"\n\tfi\n      fi\n\n      if test yes = \"$no_install\"; then\n\t# We don't need to create a wrapper script.\n\tlink_command=$compile_var$compile_command$compile_rpath\n\t# Replace the output file specification.\n\tlink_command=`$ECHO \"$link_command\" | $SED 's%@OUTPUT@%'\"$output\"'%g'`\n\t# Delete the old output file.\n\t$opt_dry_run || $RM $output\n\t# Link the executable and exit\n\tfunc_show_eval \"$link_command\" 'exit $?'\n\n\tif test -n \"$postlink_cmds\"; then\n\t  func_to_tool_file \"$output\"\n\t  postlink_cmds=`func_echo_all \"$postlink_cmds\" | $SED -e 's%@OUTPUT@%'\"$output\"'%g' -e 's%@TOOL_OUTPUT@%'\"$func_to_tool_file_result\"'%g'`\n\t  func_execute_cmds \"$postlink_cmds\" 'exit $?'\n\tfi\n\n\texit $EXIT_SUCCESS\n      fi\n\n      case $hardcode_action,$fast_install in\n        relink,*)\n\t  # Fast installation is not supported\n\t  link_command=$compile_var$compile_command$compile_rpath\n\t  relink_command=$finalize_var$finalize_command$finalize_rpath\n\n\t  func_warning \"this platform does not like uninstalled shared libraries\"\n\t  func_warning \"'$output' will be relinked during installation\"\n\t  ;;\n        *,yes)\n\t  link_command=$finalize_var$compile_command$finalize_rpath\n\t  relink_command=`$ECHO \"$compile_var$compile_command$compile_rpath\" | $SED 's%@OUTPUT@%\\$progdir/\\$file%g'`\n          ;;\n\t*,no)\n\t  link_command=$compile_var$compile_command$compile_rpath\n\t  relink_command=$finalize_var$finalize_command$finalize_rpath\n          ;;\n\t*,needless)\n\t  link_command=$finalize_var$compile_command$finalize_rpath\n\t  relink_command=\n          ;;\n      esac\n\n      # Replace the output file specification.\n      link_command=`$ECHO \"$link_command\" | $SED 's%@OUTPUT@%'\"$output_objdir/$outputname\"'%g'`\n\n      # Delete the old output files.\n      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname\n\n      func_show_eval \"$link_command\" 'exit $?'\n\n      if test -n \"$postlink_cmds\"; then\n\tfunc_to_tool_file \"$output_objdir/$outputname\"\n\tpostlink_cmds=`func_echo_all \"$postlink_cmds\" | $SED -e 's%@OUTPUT@%'\"$output_objdir/$outputname\"'%g' -e 's%@TOOL_OUTPUT@%'\"$func_to_tool_file_result\"'%g'`\n\tfunc_execute_cmds \"$postlink_cmds\" 'exit $?'\n      fi\n\n      # Now create the wrapper script.\n      func_verbose \"creating $output\"\n\n      # Quote the relink command for shipping.\n      if test -n \"$relink_command\"; then\n\t# Preserve any variables that may affect compiler behavior\n\tfor var in $variables_saved_for_relink; do\n\t  if eval test -z \\\"\\${$var+set}\\\"; then\n\t    relink_command=\"{ test -z \\\"\\${$var+set}\\\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command\"\n\t  elif eval var_value=\\$$var; test -z \"$var_value\"; then\n\t    relink_command=\"$var=; export $var; $relink_command\"\n\t  else\n\t    func_quote_for_eval \"$var_value\"\n\t    relink_command=\"$var=$func_quote_for_eval_result; export $var; $relink_command\"\n\t  fi\n\tdone\n\trelink_command=\"(cd `pwd`; $relink_command)\"\n\trelink_command=`$ECHO \"$relink_command\" | $SED \"$sed_quote_subst\"`\n      fi\n\n      # Only actually do things if not in dry run mode.\n      $opt_dry_run || {\n\t# win32 will think the script is a binary if it has\n\t# a .exe suffix, so we strip it off here.\n\tcase $output in\n\t  *.exe) func_stripname '' '.exe' \"$output\"\n\t         output=$func_stripname_result ;;\n\tesac\n\t# test for cygwin because mv fails w/o .exe extensions\n\tcase $host in\n\t  *cygwin*)\n\t    exeext=.exe\n\t    func_stripname '' '.exe' \"$outputname\"\n\t    outputname=$func_stripname_result ;;\n\t  *) exeext= ;;\n\tesac\n\tcase $host in\n\t  *cygwin* | *mingw* )\n\t    func_dirname_and_basename \"$output\" \"\" \".\"\n\t    output_name=$func_basename_result\n\t    output_path=$func_dirname_result\n\t    cwrappersource=$output_path/$objdir/lt-$output_name.c\n\t    cwrapper=$output_path/$output_name.exe\n\t    $RM $cwrappersource $cwrapper\n\t    trap \"$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE\" 1 2 15\n\n\t    func_emit_cwrapperexe_src > $cwrappersource\n\n\t    # The wrapper executable is built using the $host compiler,\n\t    # because it contains $host paths and files. If cross-\n\t    # compiling, it, like the target executable, must be\n\t    # executed on the $host or under an emulation environment.\n\t    $opt_dry_run || {\n\t      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource\n\t      $STRIP $cwrapper\n\t    }\n\n\t    # Now, create the wrapper script for func_source use:\n\t    func_ltwrapper_scriptname $cwrapper\n\t    $RM $func_ltwrapper_scriptname_result\n\t    trap \"$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE\" 1 2 15\n\t    $opt_dry_run || {\n\t      # note: this script will not be executed, so do not chmod.\n\t      if test \"x$build\" = \"x$host\"; then\n\t\t$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result\n\t      else\n\t\tfunc_emit_wrapper no > $func_ltwrapper_scriptname_result\n\t      fi\n\t    }\n\t  ;;\n\t  * )\n\t    $RM $output\n\t    trap \"$RM $output; exit $EXIT_FAILURE\" 1 2 15\n\n\t    func_emit_wrapper no > $output\n\t    chmod +x $output\n\t  ;;\n\tesac\n      }\n      exit $EXIT_SUCCESS\n      ;;\n    esac\n\n    # See if we need to build an old-fashioned archive.\n    for oldlib in $oldlibs; do\n\n      case $build_libtool_libs in\n        convenience)\n\t  oldobjs=\"$libobjs_save $symfileobj\"\n\t  addlibs=$convenience\n\t  build_libtool_libs=no\n\t  ;;\n\tmodule)\n\t  oldobjs=$libobjs_save\n\t  addlibs=$old_convenience\n\t  build_libtool_libs=no\n          ;;\n\t*)\n\t  oldobjs=\"$old_deplibs $non_pic_objects\"\n\t  $preload && test -f \"$symfileobj\" \\\n\t    && func_append oldobjs \" $symfileobj\"\n\t  addlibs=$old_convenience\n\t  ;;\n      esac\n\n      if test -n \"$addlibs\"; then\n\tgentop=$output_objdir/${outputname}x\n\tfunc_append generated \" $gentop\"\n\n\tfunc_extract_archives $gentop $addlibs\n\tfunc_append oldobjs \" $func_extract_archives_result\"\n      fi\n\n      # Do each command in the archive commands.\n      if test -n \"$old_archive_from_new_cmds\" && test yes = \"$build_libtool_libs\"; then\n\tcmds=$old_archive_from_new_cmds\n      else\n\n\t# Add any objects from preloaded convenience libraries\n\tif test -n \"$dlprefiles\"; then\n\t  gentop=$output_objdir/${outputname}x\n\t  func_append generated \" $gentop\"\n\n\t  func_extract_archives $gentop $dlprefiles\n\t  func_append oldobjs \" $func_extract_archives_result\"\n\tfi\n\n\t# POSIX demands no paths to be encoded in archives.  We have\n\t# to avoid creating archives with duplicate basenames if we\n\t# might have to extract them afterwards, e.g., when creating a\n\t# static archive out of a convenience library, or when linking\n\t# the entirety of a libtool archive into another (currently\n\t# not supported by libtool).\n\tif (for obj in $oldobjs\n\t    do\n\t      func_basename \"$obj\"\n\t      $ECHO \"$func_basename_result\"\n\t    done | sort | sort -uc >/dev/null 2>&1); then\n\t  :\n\telse\n\t  echo \"copying selected object files to avoid basename conflicts...\"\n\t  gentop=$output_objdir/${outputname}x\n\t  func_append generated \" $gentop\"\n\t  func_mkdir_p \"$gentop\"\n\t  save_oldobjs=$oldobjs\n\t  oldobjs=\n\t  counter=1\n\t  for obj in $save_oldobjs\n\t  do\n\t    func_basename \"$obj\"\n\t    objbase=$func_basename_result\n\t    case \" $oldobjs \" in\n\t    \" \") oldobjs=$obj ;;\n\t    *[\\ /]\"$objbase \"*)\n\t      while :; do\n\t\t# Make sure we don't pick an alternate name that also\n\t\t# overlaps.\n\t\tnewobj=lt$counter-$objbase\n\t\tfunc_arith $counter + 1\n\t\tcounter=$func_arith_result\n\t\tcase \" $oldobjs \" in\n\t\t*[\\ /]\"$newobj \"*) ;;\n\t\t*) if test ! -f \"$gentop/$newobj\"; then break; fi ;;\n\t\tesac\n\t      done\n\t      func_show_eval \"ln $obj $gentop/$newobj || cp $obj $gentop/$newobj\"\n\t      func_append oldobjs \" $gentop/$newobj\"\n\t      ;;\n\t    *) func_append oldobjs \" $obj\" ;;\n\t    esac\n\t  done\n\tfi\n\tfunc_to_tool_file \"$oldlib\" func_convert_file_msys_to_w32\n\ttool_oldlib=$func_to_tool_file_result\n\teval cmds=\\\"$old_archive_cmds\\\"\n\n\tfunc_len \" $cmds\"\n\tlen=$func_len_result\n\tif test \"$len\" -lt \"$max_cmd_len\" || test \"$max_cmd_len\" -le -1; then\n\t  cmds=$old_archive_cmds\n\telif test -n \"$archiver_list_spec\"; then\n\t  func_verbose \"using command file archive linking...\"\n\t  for obj in $oldobjs\n\t  do\n\t    func_to_tool_file \"$obj\"\n\t    $ECHO \"$func_to_tool_file_result\"\n\t  done > $output_objdir/$libname.libcmd\n\t  func_to_tool_file \"$output_objdir/$libname.libcmd\"\n\t  oldobjs=\" $archiver_list_spec$func_to_tool_file_result\"\n\t  cmds=$old_archive_cmds\n\telse\n\t  # the command line is too long to link in one step, link in parts\n\t  func_verbose \"using piecewise archive linking...\"\n\t  save_RANLIB=$RANLIB\n\t  RANLIB=:\n\t  objlist=\n\t  concat_cmds=\n\t  save_oldobjs=$oldobjs\n\t  oldobjs=\n\t  # Is there a better way of finding the last object in the list?\n\t  for obj in $save_oldobjs\n\t  do\n\t    last_oldobj=$obj\n\t  done\n\t  eval test_cmds=\\\"$old_archive_cmds\\\"\n\t  func_len \" $test_cmds\"\n\t  len0=$func_len_result\n\t  len=$len0\n\t  for obj in $save_oldobjs\n\t  do\n\t    func_len \" $obj\"\n\t    func_arith $len + $func_len_result\n\t    len=$func_arith_result\n\t    func_append objlist \" $obj\"\n\t    if test \"$len\" -lt \"$max_cmd_len\"; then\n\t      :\n\t    else\n\t      # the above command should be used before it gets too long\n\t      oldobjs=$objlist\n\t      if test \"$obj\" = \"$last_oldobj\"; then\n\t\tRANLIB=$save_RANLIB\n\t      fi\n\t      test -z \"$concat_cmds\" || concat_cmds=$concat_cmds~\n\t      eval concat_cmds=\\\"\\$concat_cmds$old_archive_cmds\\\"\n\t      objlist=\n\t      len=$len0\n\t    fi\n\t  done\n\t  RANLIB=$save_RANLIB\n\t  oldobjs=$objlist\n\t  if test -z \"$oldobjs\"; then\n\t    eval cmds=\\\"\\$concat_cmds\\\"\n\t  else\n\t    eval cmds=\\\"\\$concat_cmds~\\$old_archive_cmds\\\"\n\t  fi\n\tfi\n      fi\n      func_execute_cmds \"$cmds\" 'exit $?'\n    done\n\n    test -n \"$generated\" && \\\n      func_show_eval \"${RM}r$generated\"\n\n    # Now create the libtool archive.\n    case $output in\n    *.la)\n      old_library=\n      test yes = \"$build_old_libs\" && old_library=$libname.$libext\n      func_verbose \"creating $output\"\n\n      # Preserve any variables that may affect compiler behavior\n      for var in $variables_saved_for_relink; do\n\tif eval test -z \\\"\\${$var+set}\\\"; then\n\t  relink_command=\"{ test -z \\\"\\${$var+set}\\\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command\"\n\telif eval var_value=\\$$var; test -z \"$var_value\"; then\n\t  relink_command=\"$var=; export $var; $relink_command\"\n\telse\n\t  func_quote_for_eval \"$var_value\"\n\t  relink_command=\"$var=$func_quote_for_eval_result; export $var; $relink_command\"\n\tfi\n      done\n      # Quote the link command for shipping.\n      relink_command=\"(cd `pwd`; $SHELL \\\"$progpath\\\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)\"\n      relink_command=`$ECHO \"$relink_command\" | $SED \"$sed_quote_subst\"`\n      if test yes = \"$hardcode_automatic\"; then\n\trelink_command=\n      fi\n\n      # Only create the output if not a dry run.\n      $opt_dry_run || {\n\tfor installed in no yes; do\n\t  if test yes = \"$installed\"; then\n\t    if test -z \"$install_libdir\"; then\n\t      break\n\t    fi\n\t    output=$output_objdir/${outputname}i\n\t    # Replace all uninstalled libtool libraries with the installed ones\n\t    newdependency_libs=\n\t    for deplib in $dependency_libs; do\n\t      case $deplib in\n\t      *.la)\n\t\tfunc_basename \"$deplib\"\n\t\tname=$func_basename_result\n\t\tfunc_resolve_sysroot \"$deplib\"\n\t\teval libdir=`$SED -n -e 's/^libdir=\\(.*\\)$/\\1/p' $func_resolve_sysroot_result`\n\t\ttest -z \"$libdir\" && \\\n\t\t  func_fatal_error \"'$deplib' is not a valid libtool archive\"\n\t\tfunc_append newdependency_libs \" ${lt_sysroot:+=}$libdir/$name\"\n\t\t;;\n\t      -L*)\n\t\tfunc_stripname -L '' \"$deplib\"\n\t\tfunc_replace_sysroot \"$func_stripname_result\"\n\t\tfunc_append newdependency_libs \" -L$func_replace_sysroot_result\"\n\t\t;;\n\t      -R*)\n\t\tfunc_stripname -R '' \"$deplib\"\n\t\tfunc_replace_sysroot \"$func_stripname_result\"\n\t\tfunc_append newdependency_libs \" -R$func_replace_sysroot_result\"\n\t\t;;\n\t      *) func_append newdependency_libs \" $deplib\" ;;\n\t      esac\n\t    done\n\t    dependency_libs=$newdependency_libs\n\t    newdlfiles=\n\n\t    for lib in $dlfiles; do\n\t      case $lib in\n\t      *.la)\n\t        func_basename \"$lib\"\n\t\tname=$func_basename_result\n\t\teval libdir=`$SED -n -e 's/^libdir=\\(.*\\)$/\\1/p' $lib`\n\t\ttest -z \"$libdir\" && \\\n\t\t  func_fatal_error \"'$lib' is not a valid libtool archive\"\n\t\tfunc_append newdlfiles \" ${lt_sysroot:+=}$libdir/$name\"\n\t\t;;\n\t      *) func_append newdlfiles \" $lib\" ;;\n\t      esac\n\t    done\n\t    dlfiles=$newdlfiles\n\t    newdlprefiles=\n\t    for lib in $dlprefiles; do\n\t      case $lib in\n\t      *.la)\n\t\t# Only pass preopened files to the pseudo-archive (for\n\t\t# eventual linking with the app. that links it) if we\n\t\t# didn't already link the preopened objects directly into\n\t\t# the library:\n\t\tfunc_basename \"$lib\"\n\t\tname=$func_basename_result\n\t\teval libdir=`$SED -n -e 's/^libdir=\\(.*\\)$/\\1/p' $lib`\n\t\ttest -z \"$libdir\" && \\\n\t\t  func_fatal_error \"'$lib' is not a valid libtool archive\"\n\t\tfunc_append newdlprefiles \" ${lt_sysroot:+=}$libdir/$name\"\n\t\t;;\n\t      esac\n\t    done\n\t    dlprefiles=$newdlprefiles\n\t  else\n\t    newdlfiles=\n\t    for lib in $dlfiles; do\n\t      case $lib in\n\t\t[\\\\/]* | [A-Za-z]:[\\\\/]*) abs=$lib ;;\n\t\t*) abs=`pwd`\"/$lib\" ;;\n\t      esac\n\t      func_append newdlfiles \" $abs\"\n\t    done\n\t    dlfiles=$newdlfiles\n\t    newdlprefiles=\n\t    for lib in $dlprefiles; do\n\t      case $lib in\n\t\t[\\\\/]* | [A-Za-z]:[\\\\/]*) abs=$lib ;;\n\t\t*) abs=`pwd`\"/$lib\" ;;\n\t      esac\n\t      func_append newdlprefiles \" $abs\"\n\t    done\n\t    dlprefiles=$newdlprefiles\n\t  fi\n\t  $RM $output\n\t  # place dlname in correct position for cygwin\n\t  # In fact, it would be nice if we could use this code for all target\n\t  # systems that can't hard-code library paths into their executables\n\t  # and that have no shared library path variable independent of PATH,\n\t  # but it turns out we can't easily determine that from inspecting\n\t  # libtool variables, so we have to hard-code the OSs to which it\n\t  # applies here; at the moment, that means platforms that use the PE\n\t  # object format with DLL files.  See the long comment at the top of\n\t  # tests/bindir.at for full details.\n\t  tdlname=$dlname\n\t  case $host,$output,$installed,$module,$dlname in\n\t    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)\n\t      # If a -bindir argument was supplied, place the dll there.\n\t      if test -n \"$bindir\"; then\n\t\tfunc_relative_path \"$install_libdir\" \"$bindir\"\n\t\ttdlname=$func_relative_path_result/$dlname\n\t      else\n\t\t# Otherwise fall back on heuristic.\n\t\ttdlname=../bin/$dlname\n\t      fi\n\t      ;;\n\t  esac\n\t  $ECHO > $output \"\\\n# $outputname - a libtool library file\n# Generated by $PROGRAM (GNU $PACKAGE) $VERSION\n#\n# Please DO NOT delete this file!\n# It is necessary for linking the library.\n\n# The name that we can dlopen(3).\ndlname='$tdlname'\n\n# Names of this library.\nlibrary_names='$library_names'\n\n# The name of the static archive.\nold_library='$old_library'\n\n# Linker flags that cannot go in dependency_libs.\ninherited_linker_flags='$new_inherited_linker_flags'\n\n# Libraries that this one depends upon.\ndependency_libs='$dependency_libs'\n\n# Names of additional weak libraries provided by this library\nweak_library_names='$weak_libs'\n\n# Version information for $libname.\ncurrent=$current\nage=$age\nrevision=$revision\n\n# Is this an already installed library?\ninstalled=$installed\n\n# Should we warn about portability when linking against -modules?\nshouldnotlink=$module\n\n# Files to dlopen/dlpreopen\ndlopen='$dlfiles'\ndlpreopen='$dlprefiles'\n\n# Directory that this library needs to be installed in:\nlibdir='$install_libdir'\"\n\t  if test no,yes = \"$installed,$need_relink\"; then\n\t    $ECHO >> $output \"\\\nrelink_command=\\\"$relink_command\\\"\"\n\t  fi\n\tdone\n      }\n\n      # Do a symbolic link so that the libtool archive can be found in\n      # LD_LIBRARY_PATH before the program is installed.\n      func_show_eval '( cd \"$output_objdir\" && $RM \"$outputname\" && $LN_S \"../$outputname\" \"$outputname\" )' 'exit $?'\n      ;;\n    esac\n    exit $EXIT_SUCCESS\n}\n\nif test link = \"$opt_mode\" || test relink = \"$opt_mode\"; then\n  func_mode_link ${1+\"$@\"}\nfi\n\n\n# func_mode_uninstall arg...\nfunc_mode_uninstall ()\n{\n    $debug_cmd\n\n    RM=$nonopt\n    files=\n    rmforce=false\n    exit_status=0\n\n    # This variable tells wrapper scripts just to set variables rather\n    # than running their programs.\n    libtool_install_magic=$magic\n\n    for arg\n    do\n      case $arg in\n      -f) func_append RM \" $arg\"; rmforce=: ;;\n      -*) func_append RM \" $arg\" ;;\n      *) func_append files \" $arg\" ;;\n      esac\n    done\n\n    test -z \"$RM\" && \\\n      func_fatal_help \"you must specify an RM program\"\n\n    rmdirs=\n\n    for file in $files; do\n      func_dirname \"$file\" \"\" \".\"\n      dir=$func_dirname_result\n      if test . = \"$dir\"; then\n\todir=$objdir\n      else\n\todir=$dir/$objdir\n      fi\n      func_basename \"$file\"\n      name=$func_basename_result\n      test uninstall = \"$opt_mode\" && odir=$dir\n\n      # Remember odir for removal later, being careful to avoid duplicates\n      if test clean = \"$opt_mode\"; then\n\tcase \" $rmdirs \" in\n\t  *\" $odir \"*) ;;\n\t  *) func_append rmdirs \" $odir\" ;;\n\tesac\n      fi\n\n      # Don't error if the file doesn't exist and rm -f was used.\n      if { test -L \"$file\"; } >/dev/null 2>&1 ||\n\t { test -h \"$file\"; } >/dev/null 2>&1 ||\n\t test -f \"$file\"; then\n\t:\n      elif test -d \"$file\"; then\n\texit_status=1\n\tcontinue\n      elif $rmforce; then\n\tcontinue\n      fi\n\n      rmfiles=$file\n\n      case $name in\n      *.la)\n\t# Possibly a libtool archive, so verify it.\n\tif func_lalib_p \"$file\"; then\n\t  func_source $dir/$name\n\n\t  # Delete the libtool libraries and symlinks.\n\t  for n in $library_names; do\n\t    func_append rmfiles \" $odir/$n\"\n\t  done\n\t  test -n \"$old_library\" && func_append rmfiles \" $odir/$old_library\"\n\n\t  case $opt_mode in\n\t  clean)\n\t    case \" $library_names \" in\n\t    *\" $dlname \"*) ;;\n\t    *) test -n \"$dlname\" && func_append rmfiles \" $odir/$dlname\" ;;\n\t    esac\n\t    test -n \"$libdir\" && func_append rmfiles \" $odir/$name $odir/${name}i\"\n\t    ;;\n\t  uninstall)\n\t    if test -n \"$library_names\"; then\n\t      # Do each command in the postuninstall commands.\n\t      func_execute_cmds \"$postuninstall_cmds\" '$rmforce || exit_status=1'\n\t    fi\n\n\t    if test -n \"$old_library\"; then\n\t      # Do each command in the old_postuninstall commands.\n\t      func_execute_cmds \"$old_postuninstall_cmds\" '$rmforce || exit_status=1'\n\t    fi\n\t    # FIXME: should reinstall the best remaining shared library.\n\t    ;;\n\t  esac\n\tfi\n\t;;\n\n      *.lo)\n\t# Possibly a libtool object, so verify it.\n\tif func_lalib_p \"$file\"; then\n\n\t  # Read the .lo file\n\t  func_source $dir/$name\n\n\t  # Add PIC object to the list of files to remove.\n\t  if test -n \"$pic_object\" && test none != \"$pic_object\"; then\n\t    func_append rmfiles \" $dir/$pic_object\"\n\t  fi\n\n\t  # Add non-PIC object to the list of files to remove.\n\t  if test -n \"$non_pic_object\" && test none != \"$non_pic_object\"; then\n\t    func_append rmfiles \" $dir/$non_pic_object\"\n\t  fi\n\tfi\n\t;;\n\n      *)\n\tif test clean = \"$opt_mode\"; then\n\t  noexename=$name\n\t  case $file in\n\t  *.exe)\n\t    func_stripname '' '.exe' \"$file\"\n\t    file=$func_stripname_result\n\t    func_stripname '' '.exe' \"$name\"\n\t    noexename=$func_stripname_result\n\t    # $file with .exe has already been added to rmfiles,\n\t    # add $file without .exe\n\t    func_append rmfiles \" $file\"\n\t    ;;\n\t  esac\n\t  # Do a test to see if this is a libtool program.\n\t  if func_ltwrapper_p \"$file\"; then\n\t    if func_ltwrapper_executable_p \"$file\"; then\n\t      func_ltwrapper_scriptname \"$file\"\n\t      relink_command=\n\t      func_source $func_ltwrapper_scriptname_result\n\t      func_append rmfiles \" $func_ltwrapper_scriptname_result\"\n\t    else\n\t      relink_command=\n\t      func_source $dir/$noexename\n\t    fi\n\n\t    # note $name still contains .exe if it was in $file originally\n\t    # as does the version of $file that was added into $rmfiles\n\t    func_append rmfiles \" $odir/$name $odir/${name}S.$objext\"\n\t    if test yes = \"$fast_install\" && test -n \"$relink_command\"; then\n\t      func_append rmfiles \" $odir/lt-$name\"\n\t    fi\n\t    if test \"X$noexename\" != \"X$name\"; then\n\t      func_append rmfiles \" $odir/lt-$noexename.c\"\n\t    fi\n\t  fi\n\tfi\n\t;;\n      esac\n      func_show_eval \"$RM $rmfiles\" 'exit_status=1'\n    done\n\n    # Try to remove the $objdir's in the directories where we deleted files\n    for dir in $rmdirs; do\n      if test -d \"$dir\"; then\n\tfunc_show_eval \"rmdir $dir >/dev/null 2>&1\"\n      fi\n    done\n\n    exit $exit_status\n}\n\nif test uninstall = \"$opt_mode\" || test clean = \"$opt_mode\"; then\n  func_mode_uninstall ${1+\"$@\"}\nfi\n\ntest -z \"$opt_mode\" && {\n  help=$generic_help\n  func_fatal_help \"you must specify a MODE\"\n}\n\ntest -z \"$exec_cmd\" && \\\n  func_fatal_help \"invalid operation mode '$opt_mode'\"\n\nif test -n \"$exec_cmd\"; then\n  eval exec \"$exec_cmd\"\n  exit $EXIT_FAILURE\nfi\n\nexit $exit_status\n\n\n# The TAGs below are defined such that we never get into a situation\n# where we disable both kinds of libraries.  Given conflicting\n# choices, we go for a static library, that is the most portable,\n# since we can't tell whether shared libraries were disabled because\n# the user asked for that or because the platform doesn't support\n# them.  This is particularly important on AIX, because we don't\n# support having both static and shared libraries enabled at the same\n# time on that platform, so we default to a shared-only configuration.\n# If a disable-shared tag is given, we'll fallback to a static-only\n# configuration.  But we'll never go from static-only to shared-only.\n\n# ### BEGIN LIBTOOL TAG CONFIG: disable-shared\nbuild_libtool_libs=no\nbuild_old_libs=yes\n# ### END LIBTOOL TAG CONFIG: disable-shared\n\n# ### BEGIN LIBTOOL TAG CONFIG: disable-static\nbuild_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`\n# ### END LIBTOOL TAG CONFIG: disable-static\n\n# Local Variables:\n# mode:shell-script\n# sh-indentation:2\n# End:\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/md5/CMakeLists.txt",
    "content": "add_executable(md5cmp md5cmp.c md5.c md5hl.c)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/md5/Makefile.am",
    "content": "noinst_PROGRAMS = md5cmp\n\nmd5cmp_SOURCES = md5cmp.c md5.c md5hl.c md5.h\nmd5cmp_CFLAGS = -I$(srcdir)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/md5/Makefile.in",
    "content": "# Makefile.in generated by automake 1.15 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2014 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\nVPATH = @srcdir@\nam__is_gnu_make = { \\\n  if test -z '$(MAKELEVEL)'; then \\\n    false; \\\n  elif test -n '$(MAKE_HOST)'; then \\\n    true; \\\n  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \\\n    true; \\\n  else \\\n    false; \\\n  fi; \\\n}\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nbuild_triplet = @build@\nhost_triplet = @host@\nnoinst_PROGRAMS = md5cmp$(EXEEXT)\nsubdir = md5\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \\\n\t$(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nDIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)\nmkinstalldirs = $(install_sh) -d\nCONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/jconfig.h \\\n\t$(top_builddir)/jconfigint.h\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nPROGRAMS = $(noinst_PROGRAMS)\nam_md5cmp_OBJECTS = md5cmp-md5cmp.$(OBJEXT) md5cmp-md5.$(OBJEXT) \\\n\tmd5cmp-md5hl.$(OBJEXT)\nmd5cmp_OBJECTS = $(am_md5cmp_OBJECTS)\nmd5cmp_LDADD = $(LDADD)\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nam__v_lt_1 = \nmd5cmp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(md5cmp_CFLAGS) $(CFLAGS) \\\n\t$(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nDEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)\ndepcomp = $(SHELL) $(top_srcdir)/depcomp\nam__depfiles_maybe = depfiles\nam__mv = mv -f\nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nLTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \\\n\t$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \\\n\t$(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC      \" $@;\nam__v_CC_1 = \nCCLD = $(CC)\nLINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n\t$(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD    \" $@;\nam__v_CCLD_1 = \nSOURCES = $(md5cmp_SOURCES)\nDIST_SOURCES = $(md5cmp_SOURCES)\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nam__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp\nDISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nBUILD = @BUILD@\nCC = @CC@\nCCAS = @CCAS@\nCCASDEPMODE = @CCASDEPMODE@\nCCASFLAGS = @CCASFLAGS@\nCCDEPMODE = @CCDEPMODE@\nCFLAGS = @CFLAGS@\nCPP = @CPP@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEBARCH = @DEBARCH@\nDEFS = @DEFS@\nDEPDIR = @DEPDIR@\nDLLTOOL = @DLLTOOL@\nDSYMUTIL = @DSYMUTIL@\nDUMPBIN = @DUMPBIN@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEGREP = @EGREP@\nEXEEXT = @EXEEXT@\nFGREP = @FGREP@\nGREP = @GREP@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nJAR = @JAR@\nJAVA = @JAVA@\nJAVAC = @JAVAC@\nJAVACFLAGS = @JAVACFLAGS@\nJAVA_RPM_CONTENTS_1 = @JAVA_RPM_CONTENTS_1@\nJAVA_RPM_CONTENTS_2 = @JAVA_RPM_CONTENTS_2@\nJNI_CFLAGS = @JNI_CFLAGS@\nJPEG_LIB_VERSION = @JPEG_LIB_VERSION@\nJPEG_LIB_VERSION_DECIMAL = @JPEG_LIB_VERSION_DECIMAL@\nLD = @LD@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLIBTOOL = @LIBTOOL@\nLIBTOOL_CURRENT = @LIBTOOL_CURRENT@\nLIPO = @LIPO@\nLN_S = @LN_S@\nLTLIBOBJS = @LTLIBOBJS@\nLT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@\nMAKEINFO = @MAKEINFO@\nMANIFEST_TOOL = @MANIFEST_TOOL@\nMEM_SRCDST_FUNCTIONS = @MEM_SRCDST_FUNCTIONS@\nMKDIR_P = @MKDIR_P@\nNAFLAGS = @NAFLAGS@\nNASM = @NASM@\nNM = @NM@\nNMEDIT = @NMEDIT@\nOBJDUMP = @OBJDUMP@\nOBJEXT = @OBJEXT@\nOTOOL = @OTOOL@\nOTOOL64 = @OTOOL64@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nPKGNAME = @PKGNAME@\nPKG_CONFIG = @PKG_CONFIG@\nRANLIB = @RANLIB@\nRPMARCH = @RPMARCH@\nRPM_CONFIG_ARGS = @RPM_CONFIG_ARGS@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSO_AGE = @SO_AGE@\nSO_MAJOR_VERSION = @SO_MAJOR_VERSION@\nSO_MINOR_VERSION = @SO_MINOR_VERSION@\nSTRIP = @STRIP@\nVERSION = @VERSION@\nVERSION_SCRIPT_FLAG = @VERSION_SCRIPT_FLAG@\nWITH_JAVA = @WITH_JAVA@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_AR = @ac_ct_AR@\nac_ct_CC = @ac_ct_CC@\nac_ct_DUMPBIN = @ac_ct_DUMPBIN@\nam__include = @am__include@\nam__leading_dot = @am__leading_dot@\nam__quote = @am__quote@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild = @build@\nbuild_alias = @build_alias@\nbuild_cpu = @build_cpu@\nbuild_os = @build_os@\nbuild_vendor = @build_vendor@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost = @host@\nhost_alias = @host_alias@\nhost_cpu = @host_cpu@\nhost_os = @host_os@\nhost_vendor = @host_vendor@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nmd5cmp_SOURCES = md5cmp.c md5.c md5hl.c md5.h\nmd5cmp_CFLAGS = -I$(srcdir)\nall: all-am\n\n.SUFFIXES:\n.SUFFIXES: .c .lo .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign md5/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign md5/Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstPROGRAMS:\n\t@list='$(noinst_PROGRAMS)'; test -n \"$$list\" || exit 0; \\\n\techo \" rm -f\" $$list; \\\n\trm -f $$list || exit $$?; \\\n\ttest -n \"$(EXEEXT)\" || exit 0; \\\n\tlist=`for p in $$list; do echo \"$$p\"; done | sed 's/$(EXEEXT)$$//'`; \\\n\techo \" rm -f\" $$list; \\\n\trm -f $$list\n\nmd5cmp$(EXEEXT): $(md5cmp_OBJECTS) $(md5cmp_DEPENDENCIES) $(EXTRA_md5cmp_DEPENDENCIES) \n\t@rm -f md5cmp$(EXEEXT)\n\t$(AM_V_CCLD)$(md5cmp_LINK) $(md5cmp_OBJECTS) $(md5cmp_LDADD) $(LIBS)\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5cmp-md5.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5cmp-md5cmp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5cmp-md5hl.Po@am__quote@\n\n.c.o:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\n.c.lo:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<\n\nmd5cmp-md5cmp.o: md5cmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(md5cmp_CFLAGS) $(CFLAGS) -MT md5cmp-md5cmp.o -MD -MP -MF $(DEPDIR)/md5cmp-md5cmp.Tpo -c -o md5cmp-md5cmp.o `test -f 'md5cmp.c' || echo '$(srcdir)/'`md5cmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/md5cmp-md5cmp.Tpo $(DEPDIR)/md5cmp-md5cmp.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='md5cmp.c' object='md5cmp-md5cmp.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(md5cmp_CFLAGS) $(CFLAGS) -c -o md5cmp-md5cmp.o `test -f 'md5cmp.c' || echo '$(srcdir)/'`md5cmp.c\n\nmd5cmp-md5cmp.obj: md5cmp.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(md5cmp_CFLAGS) $(CFLAGS) -MT md5cmp-md5cmp.obj -MD -MP -MF $(DEPDIR)/md5cmp-md5cmp.Tpo -c -o md5cmp-md5cmp.obj `if test -f 'md5cmp.c'; then $(CYGPATH_W) 'md5cmp.c'; else $(CYGPATH_W) '$(srcdir)/md5cmp.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/md5cmp-md5cmp.Tpo $(DEPDIR)/md5cmp-md5cmp.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='md5cmp.c' object='md5cmp-md5cmp.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(md5cmp_CFLAGS) $(CFLAGS) -c -o md5cmp-md5cmp.obj `if test -f 'md5cmp.c'; then $(CYGPATH_W) 'md5cmp.c'; else $(CYGPATH_W) '$(srcdir)/md5cmp.c'; fi`\n\nmd5cmp-md5.o: md5.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(md5cmp_CFLAGS) $(CFLAGS) -MT md5cmp-md5.o -MD -MP -MF $(DEPDIR)/md5cmp-md5.Tpo -c -o md5cmp-md5.o `test -f 'md5.c' || echo '$(srcdir)/'`md5.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/md5cmp-md5.Tpo $(DEPDIR)/md5cmp-md5.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='md5.c' object='md5cmp-md5.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(md5cmp_CFLAGS) $(CFLAGS) -c -o md5cmp-md5.o `test -f 'md5.c' || echo '$(srcdir)/'`md5.c\n\nmd5cmp-md5.obj: md5.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(md5cmp_CFLAGS) $(CFLAGS) -MT md5cmp-md5.obj -MD -MP -MF $(DEPDIR)/md5cmp-md5.Tpo -c -o md5cmp-md5.obj `if test -f 'md5.c'; then $(CYGPATH_W) 'md5.c'; else $(CYGPATH_W) '$(srcdir)/md5.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/md5cmp-md5.Tpo $(DEPDIR)/md5cmp-md5.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='md5.c' object='md5cmp-md5.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(md5cmp_CFLAGS) $(CFLAGS) -c -o md5cmp-md5.obj `if test -f 'md5.c'; then $(CYGPATH_W) 'md5.c'; else $(CYGPATH_W) '$(srcdir)/md5.c'; fi`\n\nmd5cmp-md5hl.o: md5hl.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(md5cmp_CFLAGS) $(CFLAGS) -MT md5cmp-md5hl.o -MD -MP -MF $(DEPDIR)/md5cmp-md5hl.Tpo -c -o md5cmp-md5hl.o `test -f 'md5hl.c' || echo '$(srcdir)/'`md5hl.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/md5cmp-md5hl.Tpo $(DEPDIR)/md5cmp-md5hl.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='md5hl.c' object='md5cmp-md5hl.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(md5cmp_CFLAGS) $(CFLAGS) -c -o md5cmp-md5hl.o `test -f 'md5hl.c' || echo '$(srcdir)/'`md5hl.c\n\nmd5cmp-md5hl.obj: md5hl.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(md5cmp_CFLAGS) $(CFLAGS) -MT md5cmp-md5hl.obj -MD -MP -MF $(DEPDIR)/md5cmp-md5hl.Tpo -c -o md5cmp-md5hl.obj `if test -f 'md5hl.c'; then $(CYGPATH_W) 'md5hl.c'; else $(CYGPATH_W) '$(srcdir)/md5hl.c'; fi`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/md5cmp-md5hl.Tpo $(DEPDIR)/md5cmp-md5hl.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='md5hl.c' object='md5cmp-md5hl.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(md5cmp_CFLAGS) $(CFLAGS) -c -o md5cmp-md5hl.obj `if test -f 'md5hl.c'; then $(CYGPATH_W) 'md5hl.c'; else $(CYGPATH_W) '$(srcdir)/md5hl.c'; fi`\n\nmostlyclean-libtool:\n\t-rm -f *.lo\n\nclean-libtool:\n\t-rm -rf .libs _libs\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-am\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-am\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscopelist: cscopelist-am\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\n\ndistdir: $(DISTFILES)\n\t@srcdirstrip=`echo \"$(srcdir)\" | sed 's/[].[^$$\\\\*]/\\\\\\\\&/g'`; \\\n\ttopsrcdirstrip=`echo \"$(top_srcdir)\" | sed 's/[].[^$$\\\\*]/\\\\\\\\&/g'`; \\\n\tlist='$(DISTFILES)'; \\\n\t  dist_files=`for file in $$list; do echo $$file; done | \\\n\t  sed -e \"s|^$$srcdirstrip/||;t\" \\\n\t      -e \"s|^$$topsrcdirstrip/|$(top_builddir)/|;t\"`; \\\n\tcase $$dist_files in \\\n\t  */*) $(MKDIR_P) `echo \"$$dist_files\" | \\\n\t\t\t   sed '/\\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \\\n\t\t\t   sort -u` ;; \\\n\tesac; \\\n\tfor file in $$dist_files; do \\\n\t  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n\t  if test -d $$d/$$file; then \\\n\t    dir=`echo \"/$$file\" | sed -e 's,/[^/]*$$,,'`; \\\n\t    if test -d \"$(distdir)/$$file\"; then \\\n\t      find \"$(distdir)/$$file\" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n\t    fi; \\\n\t    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n\t      cp -fpR $(srcdir)/$$file \"$(distdir)$$dir\" || exit 1; \\\n\t      find \"$(distdir)/$$file\" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n\t    fi; \\\n\t    cp -fpR $$d/$$file \"$(distdir)$$dir\" || exit 1; \\\n\t  else \\\n\t    test -f \"$(distdir)/$$file\" \\\n\t    || cp -p $$d/$$file \"$(distdir)/$$file\" \\\n\t    || exit 1; \\\n\t  fi; \\\n\tdone\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile $(PROGRAMS)\ninstalldirs:\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-am\n\nclean-am: clean-generic clean-libtool clean-noinstPROGRAMS \\\n\tmostlyclean-am\n\ndistclean: distclean-am\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n\tmostlyclean-libtool\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am:\n\n.MAKE: install-am install-strip\n\n.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \\\n\tclean-libtool clean-noinstPROGRAMS cscopelist-am ctags \\\n\tctags-am distclean distclean-compile distclean-generic \\\n\tdistclean-libtool distclean-tags distdir dvi dvi-am html \\\n\thtml-am info info-am install install-am install-data \\\n\tinstall-data-am install-dvi install-dvi-am install-exec \\\n\tinstall-exec-am install-html install-html-am install-info \\\n\tinstall-info-am install-man install-pdf install-pdf-am \\\n\tinstall-ps install-ps-am install-strip installcheck \\\n\tinstallcheck-am installdirs maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \\\n\ttags tags-am uninstall uninstall-am\n\n.PRECIOUS: Makefile\n\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/md5/md5.c",
    "content": "/*\n * MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm\n *\n * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All\n * rights reserved.\n *\n * License to copy and use this software is granted provided that it\n * is identified as the \"RSA Data Security, Inc. MD5 Message-Digest\n * Algorithm\" in all material mentioning or referencing this software\n * or this function.\n *\n * License is also granted to make and use derivative works provided\n * that such works are identified as \"derived from the RSA Data\n * Security, Inc. MD5 Message-Digest Algorithm\" in all material\n * mentioning or referencing the derived work.\n *\n * RSA Data Security, Inc. makes no representations concerning either\n * the merchantability of this software or the suitability of this\n * software for any particular purpose. It is provided \"as is\"\n * without express or implied warranty of any kind.\n *\n * These notices must be retained in any copies of any part of this\n * documentation and/or software.\n *\n * This code is the same as the code published by RSA Inc.  It has been\n * edited for clarity and style only.\n */\n\n#include <sys/types.h>\n#include <string.h>\n\n#include \"./md5.h\"\n\nstatic void MD5Transform(unsigned int [4], const unsigned char [64]);\n\n#if (BYTE_ORDER == LITTLE_ENDIAN)\n#define Encode memcpy\n#define Decode memcpy\n#else\n\n/*\n * OS X doesn't have le32toh() or htole32()\n */\n#ifdef __APPLE__\n#include <libkern/OSByteOrder.h>\n#define le32toh(x) OSSwapLittleToHostInt32(x)\n#define htole32(x) OSSwapHostToLittleInt32(x)\n#endif\n\n/*\n * Encodes input (unsigned int) into output (unsigned char). Assumes len is\n * a multiple of 4.\n */\n\nstatic void\nEncode (unsigned char *output, unsigned int *input, unsigned int len)\n{\n\tunsigned int i;\n\tunsigned int *op = (unsigned int *)output;\n\n\tfor (i = 0; i < len / 4; i++)\n\t\top[i] = htole32(input[i]);\n}\n\n/*\n * Decodes input (unsigned char) into output (unsigned int). Assumes len is\n * a multiple of 4.\n */\n\nstatic void\nDecode (unsigned int *output, const unsigned char *input, unsigned int len)\n{\n\tunsigned int i;\n\tconst unsigned int *ip = (const unsigned int *)input;\n\n\tfor (i = 0; i < len / 4; i++)\n\t\toutput[i] = le32toh(ip[i]);\n}\n#endif\n\nstatic unsigned char PADDING[64] = {\n  0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n};\n\n/* F, G, H and I are basic MD5 functions. */\n#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))\n#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))\n#define H(x, y, z) ((x) ^ (y) ^ (z))\n#define I(x, y, z) ((y) ^ ((x) | (~z)))\n\n/* ROTATE_LEFT rotates x left n bits. */\n#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))\n\n/*\n * FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.\n * Rotation is separate from addition to prevent recomputation.\n */\n#define FF(a, b, c, d, x, s, ac) { \\\n\t(a) += F ((b), (c), (d)) + (x) + (unsigned int)(ac); \\\n\t(a) = ROTATE_LEFT ((a), (s)); \\\n\t(a) += (b); \\\n\t}\n#define GG(a, b, c, d, x, s, ac) { \\\n\t(a) += G ((b), (c), (d)) + (x) + (unsigned int)(ac); \\\n\t(a) = ROTATE_LEFT ((a), (s)); \\\n\t(a) += (b); \\\n\t}\n#define HH(a, b, c, d, x, s, ac) { \\\n\t(a) += H ((b), (c), (d)) + (x) + (unsigned int)(ac); \\\n\t(a) = ROTATE_LEFT ((a), (s)); \\\n\t(a) += (b); \\\n\t}\n#define II(a, b, c, d, x, s, ac) { \\\n\t(a) += I ((b), (c), (d)) + (x) + (unsigned int)(ac); \\\n\t(a) = ROTATE_LEFT ((a), (s)); \\\n\t(a) += (b); \\\n\t}\n\n/* MD5 initialization. Begins an MD5 operation, writing a new context. */\n\nvoid\nMD5Init (context)\n\tMD5_CTX *context;\n{\n\n\tcontext->count[0] = context->count[1] = 0;\n\n\t/* Load magic initialization constants.  */\n\tcontext->state[0] = 0x67452301;\n\tcontext->state[1] = 0xefcdab89;\n\tcontext->state[2] = 0x98badcfe;\n\tcontext->state[3] = 0x10325476;\n}\n\n/*\n * MD5 block update operation. Continues an MD5 message-digest\n * operation, processing another message block, and updating the\n * context.\n */\n\nvoid\nMD5Update (context, in, inputLen)\n\tMD5_CTX *context;\n\tconst void *in;\n\tunsigned int inputLen;\n{\n\tunsigned int i, idx, partLen;\n\tconst unsigned char *input = in;\n\n\t/* Compute number of bytes mod 64 */\n\tidx = (unsigned int)((context->count[0] >> 3) & 0x3F);\n\n\t/* Update number of bits */\n\tif ((context->count[0] += ((unsigned int)inputLen << 3))\n\t    < ((unsigned int)inputLen << 3))\n\t\tcontext->count[1]++;\n\tcontext->count[1] += ((unsigned int)inputLen >> 29);\n\n\tpartLen = 64 - idx;\n\n\t/* Transform as many times as possible. */\n\tif (inputLen >= partLen) {\n\t\tmemcpy((void *)&context->buffer[idx], (const void *)input,\n\t\t    partLen);\n\t\tMD5Transform (context->state, context->buffer);\n\n\t\tfor (i = partLen; i + 63 < inputLen; i += 64)\n\t\t\tMD5Transform (context->state, &input[i]);\n\n\t\tidx = 0;\n\t}\n\telse\n\t\ti = 0;\n\n\t/* Buffer remaining input */\n\tmemcpy ((void *)&context->buffer[idx], (const void *)&input[i],\n\t    inputLen-i);\n}\n\n/*\n * MD5 padding. Adds padding followed by original length.\n */\n\nvoid\nMD5Pad (context)\n\tMD5_CTX *context;\n{\n\tunsigned char bits[8];\n\tunsigned int idx, padLen;\n\n\t/* Save number of bits */\n\tEncode (bits, context->count, 8);\n\n\t/* Pad out to 56 mod 64. */\n\tidx = (unsigned int)((context->count[0] >> 3) & 0x3f);\n\tpadLen = (idx < 56) ? (56 - idx) : (120 - idx);\n\tMD5Update (context, PADDING, padLen);\n\n\t/* Append length (before padding) */\n\tMD5Update (context, bits, 8);\n}\n\n/*\n * MD5 finalization. Ends an MD5 message-digest operation, writing the\n * the message digest and zeroizing the context.\n */\n\nvoid\nMD5Final (digest, context)\n\tunsigned char digest[16];\n\tMD5_CTX *context;\n{\n\t/* Do padding. */\n\tMD5Pad (context);\n\n\t/* Store state in digest */\n\tEncode (digest, context->state, 16);\n\n\t/* Zeroize sensitive information. */\n\tmemset ((void *)context, 0, sizeof (*context));\n}\n\n/* MD5 basic transformation. Transforms state based on block. */\n\nstatic void\nMD5Transform (state, block)\n\tunsigned int state[4];\n\tconst unsigned char block[64];\n{\n\tunsigned int a = state[0], b = state[1], c = state[2], d = state[3], x[16];\n\n\tDecode (x, block, 64);\n\n\t/* Round 1 */\n#define S11 7\n#define S12 12\n#define S13 17\n#define S14 22\n\tFF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */\n\tFF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */\n\tFF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */\n\tFF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */\n\tFF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */\n\tFF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */\n\tFF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */\n\tFF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */\n\tFF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */\n\tFF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */\n\tFF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */\n\tFF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */\n\tFF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */\n\tFF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */\n\tFF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */\n\tFF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */\n\n\t/* Round 2 */\n#define S21 5\n#define S22 9\n#define S23 14\n#define S24 20\n\tGG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */\n\tGG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */\n\tGG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */\n\tGG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */\n\tGG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */\n\tGG (d, a, b, c, x[10], S22,  0x2441453); /* 22 */\n\tGG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */\n\tGG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */\n\tGG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */\n\tGG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */\n\tGG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */\n\tGG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */\n\tGG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */\n\tGG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */\n\tGG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */\n\tGG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */\n\n\t/* Round 3 */\n#define S31 4\n#define S32 11\n#define S33 16\n#define S34 23\n\tHH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */\n\tHH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */\n\tHH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */\n\tHH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */\n\tHH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */\n\tHH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */\n\tHH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */\n\tHH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */\n\tHH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */\n\tHH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */\n\tHH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */\n\tHH (b, c, d, a, x[ 6], S34,  0x4881d05); /* 44 */\n\tHH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */\n\tHH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */\n\tHH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */\n\tHH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */\n\n\t/* Round 4 */\n#define S41 6\n#define S42 10\n#define S43 15\n#define S44 21\n\tII (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */\n\tII (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */\n\tII (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */\n\tII (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */\n\tII (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */\n\tII (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */\n\tII (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */\n\tII (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */\n\tII (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */\n\tII (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */\n\tII (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */\n\tII (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */\n\tII (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */\n\tII (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */\n\tII (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */\n\tII (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */\n\n\tstate[0] += a;\n\tstate[1] += b;\n\tstate[2] += c;\n\tstate[3] += d;\n\n\t/* Zeroize sensitive information. */\n\tmemset ((void *)x, 0, sizeof (x));\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/md5/md5.h",
    "content": "/* MD5.H - header file for MD5C.C\n * $FreeBSD$\n */\n\n/*-\n Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All\nrights reserved.\n\nLicense to copy and use this software is granted provided that it\nis identified as the \"RSA Data Security, Inc. MD5 Message-Digest\nAlgorithm\" in all material mentioning or referencing this software\nor this function.\n\nLicense is also granted to make and use derivative works provided\nthat such works are identified as \"derived from the RSA Data\nSecurity, Inc. MD5 Message-Digest Algorithm\" in all material\nmentioning or referencing the derived work.\n\nRSA Data Security, Inc. makes no representations concerning either\nthe merchantability of this software or the suitability of this\nsoftware for any particular purpose. It is provided \"as is\"\nwithout express or implied warranty of any kind.\n\nThese notices must be retained in any copies of any part of this\ndocumentation and/or software.\n */\n\n#ifndef _SYS_MD5_H_\n#define _SYS_MD5_H_\n\n#define MD5_BLOCK_LENGTH\t\t64\n#define MD5_DIGEST_LENGTH\t\t16\n#define MD5_DIGEST_STRING_LENGTH\t(MD5_DIGEST_LENGTH * 2 + 1)\n\n/* MD5 context. */\ntypedef struct MD5Context {\n  unsigned int state[4];\t/* state (ABCD) */\n  unsigned int count[2];\t/* number of bits, modulo 2^64 (lsb first) */\n  unsigned char buffer[64];\t/* input buffer */\n} MD5_CTX;\n\nvoid   MD5Init (MD5_CTX *);\nvoid   MD5Update (MD5_CTX *, const void *, unsigned int);\nvoid   MD5Final (unsigned char [16], MD5_CTX *);\nchar * MD5End(MD5_CTX *, char *);\nchar * MD5File(const char *, char *);\nchar * MD5FileChunk(const char *, char *, off_t, off_t);\nchar * MD5Data(const void *, unsigned int, char *);\n#endif /* _SYS_MD5_H_ */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/md5/md5cmp.c",
    "content": "/*\n * Copyright (C)2013, 2016 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include <stdio.h>\n#include <string.h>\n#include <sys/types.h>\n#include \"./md5.h\"\n#include \"../tjutil.h\"\n\nint main(int argc, char *argv[])\n{\n\tchar *md5sum = NULL, buf[65];\n\n\tif (argc < 3) {\n\t\tfprintf(stderr, \"USAGE: %s <correct MD5 sum> <file>\\n\", argv[0]);\n\t\treturn -1;\n\t}\n\n\tif (strlen(argv[1]) != 32)\n\t\tfprintf(stderr, \"WARNING: MD5 hash size is wrong.\\n\");\n\n\tmd5sum = MD5File(argv[2], buf);\n\tif (!md5sum) {\n\t\tperror(\"Could not obtain MD5 sum\");\n\t\treturn -1;\n\t}\n\n\tif (!strcasecmp(md5sum, argv[1])) {\n\t\tfprintf(stderr, \"%s: OK\\n\", argv[2]);\n\t\treturn 0;\n\t} else {\n\t\tfprintf(stderr, \"%s: FAILED.  Checksum is %s\\n\", argv[2], md5sum);\n\t\treturn -1;\n\t}\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/md5/md5hl.c",
    "content": "/* mdXhl.c * ----------------------------------------------------------------------------\n * \"THE BEER-WARE LICENSE\" (Revision 42):\n * <phk@FreeBSD.org> wrote this file.  As long as you retain this notice you\n * can do whatever you want with this stuff. If we meet some day, and you think\n * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp\n * ----------------------------------------------------------------------------\n * libjpeg-turbo Modifications:\n * Copyright (C) 2016, D. R. Commander.\n * Modifications are under the same license as the original code (see above)\n * ----------------------------------------------------------------------------\n */\n\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <fcntl.h>\n#ifdef _WIN32\n#include <io.h>\n#define close _close\n#define fstat _fstat\n#define lseek _lseek\n#define read _read\n#define stat _stat\n#else\n#include <unistd.h>\n#endif\n\n#include <errno.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#define LENGTH 16\n\n#include \"./md5.h\"\n\nchar *\nMD5End(MD5_CTX *ctx, char *buf)\n{\n\tint i;\n\tunsigned char digest[LENGTH];\n\tstatic const char hex[]=\"0123456789abcdef\";\n\n\tif (!buf)\n\t\tbuf = malloc(2*LENGTH + 1);\n\tif (!buf)\n\t\treturn 0;\n\tMD5Final(digest, ctx);\n\tfor (i = 0; i < LENGTH; i++) {\n\t\tbuf[i+i] = hex[digest[i] >> 4];\n\t\tbuf[i+i+1] = hex[digest[i] & 0x0f];\n\t}\n\tbuf[i+i] = '\\0';\n\treturn buf;\n}\n\nchar *\nMD5File(const char *filename, char *buf)\n{\n\treturn (MD5FileChunk(filename, buf, 0, 0));\n}\n\nchar *\nMD5FileChunk(const char *filename, char *buf, off_t ofs, off_t len)\n{\n\tunsigned char buffer[BUFSIZ];\n\tMD5_CTX ctx;\n\tstruct stat stbuf;\n\tint f, i, e;\n\toff_t n;\n\n\tMD5Init(&ctx);\n#if _WIN32\n\tf = _open(filename, O_RDONLY|O_BINARY);\n#else\n\tf = open(filename, O_RDONLY);\n#endif\n\tif (f < 0)\n\t\treturn 0;\n\tif (fstat(f, &stbuf) < 0)\n\t\treturn 0;\n\tif (ofs > stbuf.st_size)\n\t\tofs = stbuf.st_size;\n\tif ((len == 0) || (len > stbuf.st_size - ofs))\n\t\tlen = stbuf.st_size - ofs;\n\tif (lseek(f, ofs, SEEK_SET) < 0)\n\t\treturn 0;\n\tn = len;\n\ti = 0;\n\twhile (n > 0) {\n\t\tif (n > sizeof(buffer))\n\t\t\ti = read(f, buffer, sizeof(buffer));\n\t\telse\n\t\t\ti = read(f, buffer, n);\n\t\tif (i < 0)\n\t\t\tbreak;\n\t\tMD5Update(&ctx, buffer, i);\n\t\tn -= i;\n\t}\n\te = errno;\n\tclose(f);\n\terrno = e;\n\tif (i < 0)\n\t\treturn 0;\n\treturn (MD5End(&ctx, buf));\n}\n\nchar *\nMD5Data (const void *data, unsigned int len, char *buf)\n{\n\tMD5_CTX ctx;\n\n\tMD5Init(&ctx);\n\tMD5Update(&ctx,data,len);\n\treturn (MD5End(&ctx, buf));\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/missing",
    "content": "#! /bin/sh\n# Common wrapper for a few potentially missing GNU programs.\n\nscriptversion=2013-10-28.13; # UTC\n\n# Copyright (C) 1996-2014 Free Software Foundation, Inc.\n# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\nif test $# -eq 0; then\n  echo 1>&2 \"Try '$0 --help' for more information\"\n  exit 1\nfi\n\ncase $1 in\n\n  --is-lightweight)\n    # Used by our autoconf macros to check whether the available missing\n    # script is modern enough.\n    exit 0\n    ;;\n\n  --run)\n    # Back-compat with the calling convention used by older automake.\n    shift\n    ;;\n\n  -h|--h|--he|--hel|--help)\n    echo \"\\\n$0 [OPTION]... PROGRAM [ARGUMENT]...\n\nRun 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due\nto PROGRAM being missing or too old.\n\nOptions:\n  -h, --help      display this help and exit\n  -v, --version   output version information and exit\n\nSupported PROGRAM values:\n  aclocal   autoconf  autoheader   autom4te  automake  makeinfo\n  bison     yacc      flex         lex       help2man\n\nVersion suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and\n'g' are ignored when checking the name.\n\nSend bug reports to <bug-automake@gnu.org>.\"\n    exit $?\n    ;;\n\n  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)\n    echo \"missing $scriptversion (GNU Automake)\"\n    exit $?\n    ;;\n\n  -*)\n    echo 1>&2 \"$0: unknown '$1' option\"\n    echo 1>&2 \"Try '$0 --help' for more information\"\n    exit 1\n    ;;\n\nesac\n\n# Run the given program, remember its exit status.\n\"$@\"; st=$?\n\n# If it succeeded, we are done.\ntest $st -eq 0 && exit 0\n\n# Also exit now if we it failed (or wasn't found), and '--version' was\n# passed; such an option is passed most likely to detect whether the\n# program is present and works.\ncase $2 in --version|--help) exit $st;; esac\n\n# Exit code 63 means version mismatch.  This often happens when the user\n# tries to use an ancient version of a tool on a file that requires a\n# minimum version.\nif test $st -eq 63; then\n  msg=\"probably too old\"\nelif test $st -eq 127; then\n  # Program was missing.\n  msg=\"missing on your system\"\nelse\n  # Program was found and executed, but failed.  Give up.\n  exit $st\nfi\n\nperl_URL=http://www.perl.org/\nflex_URL=http://flex.sourceforge.net/\ngnu_software_URL=http://www.gnu.org/software\n\nprogram_details ()\n{\n  case $1 in\n    aclocal|automake)\n      echo \"The '$1' program is part of the GNU Automake package:\"\n      echo \"<$gnu_software_URL/automake>\"\n      echo \"It also requires GNU Autoconf, GNU m4 and Perl in order to run:\"\n      echo \"<$gnu_software_URL/autoconf>\"\n      echo \"<$gnu_software_URL/m4/>\"\n      echo \"<$perl_URL>\"\n      ;;\n    autoconf|autom4te|autoheader)\n      echo \"The '$1' program is part of the GNU Autoconf package:\"\n      echo \"<$gnu_software_URL/autoconf/>\"\n      echo \"It also requires GNU m4 and Perl in order to run:\"\n      echo \"<$gnu_software_URL/m4/>\"\n      echo \"<$perl_URL>\"\n      ;;\n  esac\n}\n\ngive_advice ()\n{\n  # Normalize program name to check for.\n  normalized_program=`echo \"$1\" | sed '\n    s/^gnu-//; t\n    s/^gnu//; t\n    s/^g//; t'`\n\n  printf '%s\\n' \"'$1' is $msg.\"\n\n  configure_deps=\"'configure.ac' or m4 files included by 'configure.ac'\"\n  case $normalized_program in\n    autoconf*)\n      echo \"You should only need it if you modified 'configure.ac',\"\n      echo \"or m4 files included by it.\"\n      program_details 'autoconf'\n      ;;\n    autoheader*)\n      echo \"You should only need it if you modified 'acconfig.h' or\"\n      echo \"$configure_deps.\"\n      program_details 'autoheader'\n      ;;\n    automake*)\n      echo \"You should only need it if you modified 'Makefile.am' or\"\n      echo \"$configure_deps.\"\n      program_details 'automake'\n      ;;\n    aclocal*)\n      echo \"You should only need it if you modified 'acinclude.m4' or\"\n      echo \"$configure_deps.\"\n      program_details 'aclocal'\n      ;;\n   autom4te*)\n      echo \"You might have modified some maintainer files that require\"\n      echo \"the 'autom4te' program to be rebuilt.\"\n      program_details 'autom4te'\n      ;;\n    bison*|yacc*)\n      echo \"You should only need it if you modified a '.y' file.\"\n      echo \"You may want to install the GNU Bison package:\"\n      echo \"<$gnu_software_URL/bison/>\"\n      ;;\n    lex*|flex*)\n      echo \"You should only need it if you modified a '.l' file.\"\n      echo \"You may want to install the Fast Lexical Analyzer package:\"\n      echo \"<$flex_URL>\"\n      ;;\n    help2man*)\n      echo \"You should only need it if you modified a dependency\" \\\n           \"of a man page.\"\n      echo \"You may want to install the GNU Help2man package:\"\n      echo \"<$gnu_software_URL/help2man/>\"\n    ;;\n    makeinfo*)\n      echo \"You should only need it if you modified a '.texi' file, or\"\n      echo \"any other file indirectly affecting the aspect of the manual.\"\n      echo \"You might want to install the Texinfo package:\"\n      echo \"<$gnu_software_URL/texinfo/>\"\n      echo \"The spurious makeinfo call might also be the consequence of\"\n      echo \"using a buggy 'make' (AIX, DU, IRIX), in which case you might\"\n      echo \"want to install GNU make:\"\n      echo \"<$gnu_software_URL/make/>\"\n      ;;\n    *)\n      echo \"You might have modified some files without having the proper\"\n      echo \"tools for further handling them.  Check the 'README' file, it\"\n      echo \"often tells you about the needed prerequisites for installing\"\n      echo \"this package.  You may also peek at any GNU archive site, in\"\n      echo \"case some other package contains this missing '$1' program.\"\n      ;;\n  esac\n}\n\ngive_advice \"$1\" | sed -e '1s/^/WARNING: /' \\\n                       -e '2,$s/^/         /' >&2\n\n# Propagate the correct exit status (expected to be 127 for a program\n# not found, 63 for a program that failed due to version mismatch).\nexit $st\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-time-zone: \"UTC\"\n# time-stamp-end: \"; # UTC\"\n# End:\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/rdbmp.c",
    "content": "/*\n * rdbmp.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2009-2010 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Modified 2011 by Siarhei Siamashka.\n * Copyright (C) 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains routines to read input images in Microsoft \"BMP\"\n * format (MS Windows 3.x, OS/2 1.x, and OS/2 2.x flavors).\n * Currently, only 8-bit and 24-bit images are supported, not 1-bit or\n * 4-bit (feeding such low-depth images into JPEG would be silly anyway).\n * Also, we don't support RLE-compressed files.\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume input from\n * an ordinary stdio stream.  They further assume that reading begins\n * at the start of the file; start_input may need work if the\n * user interface has already read some data (e.g., to determine that\n * the file is indeed BMP format).\n *\n * This code contributed by James Arthur Boucher.\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n\n#ifdef BMP_SUPPORTED\n\n\n/* Macros to deal with unsigned chars as efficiently as compiler allows */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char U_CHAR;\n#define UCH(x)  ((int) (x))\n#else /* !HAVE_UNSIGNED_CHAR */\n#ifdef __CHAR_UNSIGNED__\ntypedef char U_CHAR;\n#define UCH(x)  ((int) (x))\n#else\ntypedef char U_CHAR;\n#define UCH(x)  ((int) (x) & 0xFF)\n#endif\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n#define ReadOK(file,buffer,len) (JFREAD(file,buffer,len) == ((size_t) (len)))\n\n\n/* Private version of data source object */\n\ntypedef struct _bmp_source_struct *bmp_source_ptr;\n\ntypedef struct _bmp_source_struct {\n  struct cjpeg_source_struct pub; /* public fields */\n\n  j_compress_ptr cinfo;         /* back link saves passing separate parm */\n\n  JSAMPARRAY colormap;          /* BMP colormap (converted to my format) */\n\n  jvirt_sarray_ptr whole_image; /* Needed to reverse row order */\n  JDIMENSION source_row;        /* Current source row number */\n  JDIMENSION row_width;         /* Physical width of scanlines in file */\n\n  int bits_per_pixel;           /* remembers 8- or 24-bit format */\n} bmp_source_struct;\n\n\nLOCAL(int)\nread_byte (bmp_source_ptr sinfo)\n/* Read next byte from BMP file */\n{\n  register FILE *infile = sinfo->pub.input_file;\n  register int c;\n\n  if ((c = getc(infile)) == EOF)\n    ERREXIT(sinfo->cinfo, JERR_INPUT_EOF);\n  return c;\n}\n\n\nLOCAL(void)\nread_colormap (bmp_source_ptr sinfo, int cmaplen, int mapentrysize)\n/* Read the colormap from a BMP file */\n{\n  int i;\n\n  switch (mapentrysize) {\n  case 3:\n    /* BGR format (occurs in OS/2 files) */\n    for (i = 0; i < cmaplen; i++) {\n      sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);\n      sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);\n      sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);\n    }\n    break;\n  case 4:\n    /* BGR0 format (occurs in MS Windows files) */\n    for (i = 0; i < cmaplen; i++) {\n      sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);\n      sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);\n      sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);\n      (void) read_byte(sinfo);\n    }\n    break;\n  default:\n    ERREXIT(sinfo->cinfo, JERR_BMP_BADCMAP);\n    break;\n  }\n}\n\n\n/*\n * Read one row of pixels.\n * The image has been read into the whole_image array, but is otherwise\n * unprocessed.  We must read it out in top-to-bottom row order, and if\n * it is an 8-bit image, we must expand colormapped pixels to 24bit format.\n */\n\nMETHODDEF(JDIMENSION)\nget_8bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 8-bit colormap indexes */\n{\n  bmp_source_ptr source = (bmp_source_ptr) sinfo;\n  register JSAMPARRAY colormap = source->colormap;\n  JSAMPARRAY image_ptr;\n  register int t;\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n\n  /* Fetch next row from virtual array */\n  source->source_row--;\n  image_ptr = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->whole_image,\n     source->source_row, (JDIMENSION) 1, FALSE);\n\n  /* Expand the colormap indexes to real data */\n  inptr = image_ptr[0];\n  outptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    t = GETJSAMPLE(*inptr++);\n    *outptr++ = colormap[0][t]; /* can omit GETJSAMPLE() safely */\n    *outptr++ = colormap[1][t];\n    *outptr++ = colormap[2][t];\n  }\n\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_24bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 24-bit pixels */\n{\n  bmp_source_ptr source = (bmp_source_ptr) sinfo;\n  JSAMPARRAY image_ptr;\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n\n  /* Fetch next row from virtual array */\n  source->source_row--;\n  image_ptr = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->whole_image,\n     source->source_row, (JDIMENSION) 1, FALSE);\n\n  /* Transfer data.  Note source values are in BGR order\n   * (even though Microsoft's own documents say the opposite).\n   */\n  inptr = image_ptr[0];\n  outptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    outptr[2] = *inptr++;       /* can omit GETJSAMPLE() safely */\n    outptr[1] = *inptr++;\n    outptr[0] = *inptr++;\n    outptr += 3;\n  }\n\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_32bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 32-bit pixels */\n{\n  bmp_source_ptr source = (bmp_source_ptr) sinfo;\n  JSAMPARRAY image_ptr;\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n\n  /* Fetch next row from virtual array */\n  source->source_row--;\n  image_ptr = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->whole_image,\n     source->source_row, (JDIMENSION) 1, FALSE);\n  /* Transfer data.  Note source values are in BGR order\n   * (even though Microsoft's own documents say the opposite).\n   */\n  inptr = image_ptr[0];\n  outptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    outptr[2] = *inptr++;       /* can omit GETJSAMPLE() safely */\n    outptr[1] = *inptr++;\n    outptr[0] = *inptr++;\n    inptr++;                    /* skip the 4th byte (Alpha channel) */\n    outptr += 3;\n  }\n\n  return 1;\n}\n\n\n/*\n * This method loads the image into whole_image during the first call on\n * get_pixel_rows.  The get_pixel_rows pointer is then adjusted to call\n * get_8bit_row, get_24bit_row, or get_32bit_row on subsequent calls.\n */\n\nMETHODDEF(JDIMENSION)\npreload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  bmp_source_ptr source = (bmp_source_ptr) sinfo;\n  register FILE *infile = source->pub.input_file;\n  register JSAMPROW out_ptr;\n  JSAMPARRAY image_ptr;\n  JDIMENSION row;\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n\n  /* Read the data into a virtual array in input-file row order. */\n  for (row = 0; row < cinfo->image_height; row++) {\n    if (progress != NULL) {\n      progress->pub.pass_counter = (long) row;\n      progress->pub.pass_limit = (long) cinfo->image_height;\n      (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n    }\n    image_ptr = (*cinfo->mem->access_virt_sarray)\n      ((j_common_ptr) cinfo, source->whole_image,\n       row, (JDIMENSION) 1, TRUE);\n    out_ptr = image_ptr[0];\n    if (fread(out_ptr, 1, source->row_width, infile) != source->row_width) {\n      if (feof(infile))\n        ERREXIT(cinfo, JERR_INPUT_EOF);\n      else\n        ERREXIT(cinfo, JERR_FILE_READ);\n    }\n  }\n  if (progress != NULL)\n    progress->completed_extra_passes++;\n\n  /* Set up to read from the virtual array in top-to-bottom order */\n  switch (source->bits_per_pixel) {\n  case 8:\n    source->pub.get_pixel_rows = get_8bit_row;\n    break;\n  case 24:\n    source->pub.get_pixel_rows = get_24bit_row;\n    break;\n  case 32:\n    source->pub.get_pixel_rows = get_32bit_row;\n    break;\n  default:\n    ERREXIT(cinfo, JERR_BMP_BADDEPTH);\n  }\n  source->source_row = cinfo->image_height;\n\n  /* And read the first row */\n  return (*source->pub.get_pixel_rows) (cinfo, sinfo);\n}\n\n\n/*\n * Read the file header; return image size and component count.\n */\n\nMETHODDEF(void)\nstart_input_bmp (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  bmp_source_ptr source = (bmp_source_ptr) sinfo;\n  U_CHAR bmpfileheader[14];\n  U_CHAR bmpinfoheader[64];\n#define GET_2B(array,offset)  ((unsigned short) UCH(array[offset]) + \\\n                               (((unsigned short) UCH(array[offset+1])) << 8))\n#define GET_4B(array,offset)  ((unsigned int) UCH(array[offset]) + \\\n                               (((unsigned int) UCH(array[offset+1])) << 8) + \\\n                               (((unsigned int) UCH(array[offset+2])) << 16) + \\\n                               (((unsigned int) UCH(array[offset+3])) << 24))\n  unsigned int bfOffBits;\n  unsigned int headerSize;\n  int biWidth;\n  int biHeight;\n  unsigned short biPlanes;\n  unsigned int biCompression;\n  int biXPelsPerMeter,biYPelsPerMeter;\n  unsigned int biClrUsed = 0;\n  int mapentrysize = 0;         /* 0 indicates no colormap */\n  int bPad;\n  JDIMENSION row_width;\n\n  /* Read and verify the bitmap file header */\n  if (! ReadOK(source->pub.input_file, bmpfileheader, 14))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  if (GET_2B(bmpfileheader,0) != 0x4D42) /* 'BM' */\n    ERREXIT(cinfo, JERR_BMP_NOT);\n  bfOffBits = GET_4B(bmpfileheader,10);\n  /* We ignore the remaining fileheader fields */\n\n  /* The infoheader might be 12 bytes (OS/2 1.x), 40 bytes (Windows),\n   * or 64 bytes (OS/2 2.x).  Check the first 4 bytes to find out which.\n   */\n  if (! ReadOK(source->pub.input_file, bmpinfoheader, 4))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  headerSize = GET_4B(bmpinfoheader,0);\n  if (headerSize < 12 || headerSize > 64)\n    ERREXIT(cinfo, JERR_BMP_BADHEADER);\n  if (! ReadOK(source->pub.input_file, bmpinfoheader+4, headerSize-4))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n\n  switch (headerSize) {\n  case 12:\n    /* Decode OS/2 1.x header (Microsoft calls this a BITMAPCOREHEADER) */\n    biWidth = (int) GET_2B(bmpinfoheader,4);\n    biHeight = (int) GET_2B(bmpinfoheader,6);\n    biPlanes = GET_2B(bmpinfoheader,8);\n    source->bits_per_pixel = (int) GET_2B(bmpinfoheader,10);\n\n    switch (source->bits_per_pixel) {\n    case 8:                     /* colormapped image */\n      mapentrysize = 3;         /* OS/2 uses RGBTRIPLE colormap */\n      TRACEMS2(cinfo, 1, JTRC_BMP_OS2_MAPPED, biWidth, biHeight);\n      break;\n    case 24:                    /* RGB image */\n      TRACEMS2(cinfo, 1, JTRC_BMP_OS2, biWidth, biHeight);\n      break;\n    default:\n      ERREXIT(cinfo, JERR_BMP_BADDEPTH);\n      break;\n    }\n    break;\n  case 40:\n  case 64:\n    /* Decode Windows 3.x header (Microsoft calls this a BITMAPINFOHEADER) */\n    /* or OS/2 2.x header, which has additional fields that we ignore */\n    biWidth = (int) GET_4B(bmpinfoheader,4);\n    biHeight = (int) GET_4B(bmpinfoheader,8);\n    biPlanes = GET_2B(bmpinfoheader,12);\n    source->bits_per_pixel = (int) GET_2B(bmpinfoheader,14);\n    biCompression = GET_4B(bmpinfoheader,16);\n    biXPelsPerMeter = (int) GET_4B(bmpinfoheader,24);\n    biYPelsPerMeter = (int) GET_4B(bmpinfoheader,28);\n    biClrUsed = GET_4B(bmpinfoheader,32);\n    /* biSizeImage, biClrImportant fields are ignored */\n\n    switch (source->bits_per_pixel) {\n    case 8:                     /* colormapped image */\n      mapentrysize = 4;         /* Windows uses RGBQUAD colormap */\n      TRACEMS2(cinfo, 1, JTRC_BMP_MAPPED, biWidth, biHeight);\n      break;\n    case 24:                    /* RGB image */\n      TRACEMS2(cinfo, 1, JTRC_BMP, biWidth, biHeight);\n      break;\n    case 32:                    /* RGB image + Alpha channel */\n      TRACEMS2(cinfo, 1, JTRC_BMP, biWidth, biHeight);\n      break;\n    default:\n      ERREXIT(cinfo, JERR_BMP_BADDEPTH);\n      break;\n    }\n    if (biCompression != 0)\n      ERREXIT(cinfo, JERR_BMP_COMPRESSED);\n\n    if (biXPelsPerMeter > 0 && biYPelsPerMeter > 0) {\n      /* Set JFIF density parameters from the BMP data */\n      cinfo->X_density = (UINT16) (biXPelsPerMeter/100); /* 100 cm per meter */\n      cinfo->Y_density = (UINT16) (biYPelsPerMeter/100);\n      cinfo->density_unit = 2;  /* dots/cm */\n    }\n    break;\n  default:\n    ERREXIT(cinfo, JERR_BMP_BADHEADER);\n    return;\n  }\n\n  if (biWidth <= 0 || biHeight <= 0)\n    ERREXIT(cinfo, JERR_BMP_EMPTY);\n  if (biPlanes != 1)\n    ERREXIT(cinfo, JERR_BMP_BADPLANES);\n\n  /* Compute distance to bitmap data --- will adjust for colormap below */\n  bPad = bfOffBits - (headerSize + 14);\n\n  /* Read the colormap, if any */\n  if (mapentrysize > 0) {\n    if (biClrUsed <= 0)\n      biClrUsed = 256;          /* assume it's 256 */\n    else if (biClrUsed > 256)\n      ERREXIT(cinfo, JERR_BMP_BADCMAP);\n    /* Allocate space to store the colormap */\n    source->colormap = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (JDIMENSION) biClrUsed, (JDIMENSION) 3);\n    /* and read it from the file */\n    read_colormap(source, (int) biClrUsed, mapentrysize);\n    /* account for size of colormap */\n    bPad -= biClrUsed * mapentrysize;\n  }\n\n  /* Skip any remaining pad bytes */\n  if (bPad < 0)                 /* incorrect bfOffBits value? */\n    ERREXIT(cinfo, JERR_BMP_BADHEADER);\n  while (--bPad >= 0) {\n    (void) read_byte(source);\n  }\n\n  /* Compute row width in file, including padding to 4-byte boundary */\n  if (source->bits_per_pixel == 24)\n    row_width = (JDIMENSION) (biWidth * 3);\n  else if (source->bits_per_pixel == 32)\n    row_width = (JDIMENSION) (biWidth * 4);\n  else\n    row_width = (JDIMENSION) biWidth;\n  while ((row_width & 3) != 0) row_width++;\n  source->row_width = row_width;\n\n  /* Allocate space for inversion array, prepare for preload pass */\n  source->whole_image = (*cinfo->mem->request_virt_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n     row_width, (JDIMENSION) biHeight, (JDIMENSION) 1);\n  source->pub.get_pixel_rows = preload_image;\n  if (cinfo->progress != NULL) {\n    cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n    progress->total_extra_passes++; /* count file input as separate pass */\n  }\n\n  /* Allocate one-row buffer for returned data */\n  source->pub.buffer = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE,\n     (JDIMENSION) (biWidth * 3), (JDIMENSION) 1);\n  source->pub.buffer_height = 1;\n\n  cinfo->in_color_space = JCS_RGB;\n  cinfo->input_components = 3;\n  cinfo->data_precision = 8;\n  cinfo->image_width = (JDIMENSION) biWidth;\n  cinfo->image_height = (JDIMENSION) biHeight;\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_input_bmp (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  /* no work */\n}\n\n\n/*\n * The module selection routine for BMP format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_bmp (j_compress_ptr cinfo)\n{\n  bmp_source_ptr source;\n\n  /* Create module interface object */\n  source = (bmp_source_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(bmp_source_struct));\n  source->cinfo = cinfo;        /* make back link for subroutines */\n  /* Fill in method ptrs, except get_pixel_rows which start_input sets */\n  source->pub.start_input = start_input_bmp;\n  source->pub.finish_input = finish_input_bmp;\n\n  return (cjpeg_source_ptr) source;\n}\n\n#endif /* BMP_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/rdcolmap.c",
    "content": "/*\n * rdcolmap.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file implements djpeg's \"-map file\" switch.  It reads a source image\n * and constructs a colormap to be supplied to the JPEG decompressor.\n *\n * Currently, these file formats are supported for the map file:\n *   GIF: the contents of the GIF's global colormap are used.\n *   PPM (either text or raw flavor): the entire file is read and\n *      each unique pixel value is entered in the map.\n * Note that reading a large PPM file will be horrendously slow.\n * Typically, a PPM-format map file should contain just one pixel\n * of each desired color.  Such a file can be extracted from an\n * ordinary image PPM file with ppmtomap(1).\n *\n * Rescaling a PPM that has a maxval unequal to MAXJSAMPLE is not\n * currently implemented.\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n\n#ifdef QUANT_2PASS_SUPPORTED    /* otherwise can't quantize to supplied map */\n\n/* Portions of this code are based on the PBMPLUS library, which is:\n**\n** Copyright (C) 1988 by Jef Poskanzer.\n**\n** Permission to use, copy, modify, and distribute this software and its\n** documentation for any purpose and without fee is hereby granted, provided\n** that the above copyright notice appear in all copies and that both that\n** copyright notice and this permission notice appear in supporting\n** documentation.  This software is provided \"as is\" without express or\n** implied warranty.\n*/\n\n\n/*\n * Add a (potentially) new color to the color map.\n */\n\nLOCAL(void)\nadd_map_entry (j_decompress_ptr cinfo, int R, int G, int B)\n{\n  JSAMPROW colormap0 = cinfo->colormap[0];\n  JSAMPROW colormap1 = cinfo->colormap[1];\n  JSAMPROW colormap2 = cinfo->colormap[2];\n  int ncolors = cinfo->actual_number_of_colors;\n  int index;\n\n  /* Check for duplicate color. */\n  for (index = 0; index < ncolors; index++) {\n    if (GETJSAMPLE(colormap0[index]) == R &&\n        GETJSAMPLE(colormap1[index]) == G &&\n        GETJSAMPLE(colormap2[index]) == B)\n      return;                   /* color is already in map */\n  }\n\n  /* Check for map overflow. */\n  if (ncolors >= (MAXJSAMPLE+1))\n    ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, (MAXJSAMPLE+1));\n\n  /* OK, add color to map. */\n  colormap0[ncolors] = (JSAMPLE) R;\n  colormap1[ncolors] = (JSAMPLE) G;\n  colormap2[ncolors] = (JSAMPLE) B;\n  cinfo->actual_number_of_colors++;\n}\n\n\n/*\n * Extract color map from a GIF file.\n */\n\nLOCAL(void)\nread_gif_map (j_decompress_ptr cinfo, FILE *infile)\n{\n  int header[13];\n  int i, colormaplen;\n  int R, G, B;\n\n  /* Initial 'G' has already been read by read_color_map */\n  /* Read the rest of the GIF header and logical screen descriptor */\n  for (i = 1; i < 13; i++) {\n    if ((header[i] = getc(infile)) == EOF)\n      ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n  }\n\n  /* Verify GIF Header */\n  if (header[1] != 'I' || header[2] != 'F')\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n\n  /* There must be a global color map. */\n  if ((header[10] & 0x80) == 0)\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n\n  /* OK, fetch it. */\n  colormaplen = 2 << (header[10] & 0x07);\n\n  for (i = 0; i < colormaplen; i++) {\n    R = getc(infile);\n    G = getc(infile);\n    B = getc(infile);\n    if (R == EOF || G == EOF || B == EOF)\n      ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n    add_map_entry(cinfo,\n                  R << (BITS_IN_JSAMPLE-8),\n                  G << (BITS_IN_JSAMPLE-8),\n                  B << (BITS_IN_JSAMPLE-8));\n  }\n}\n\n\n/* Support routines for reading PPM */\n\n\nLOCAL(int)\npbm_getc (FILE *infile)\n/* Read next char, skipping over any comments */\n/* A comment/newline sequence is returned as a newline */\n{\n  register int ch;\n\n  ch = getc(infile);\n  if (ch == '#') {\n    do {\n      ch = getc(infile);\n    } while (ch != '\\n' && ch != EOF);\n  }\n  return ch;\n}\n\n\nLOCAL(unsigned int)\nread_pbm_integer (j_decompress_ptr cinfo, FILE *infile)\n/* Read an unsigned decimal integer from the PPM file */\n/* Swallows one trailing character after the integer */\n/* Note that on a 16-bit-int machine, only values up to 64k can be read. */\n/* This should not be a problem in practice. */\n{\n  register int ch;\n  register unsigned int val;\n\n  /* Skip any leading whitespace */\n  do {\n    ch = pbm_getc(infile);\n    if (ch == EOF)\n      ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n  } while (ch == ' ' || ch == '\\t' || ch == '\\n' || ch == '\\r');\n\n  if (ch < '0' || ch > '9')\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n\n  val = ch - '0';\n  while ((ch = pbm_getc(infile)) >= '0' && ch <= '9') {\n    val *= 10;\n    val += ch - '0';\n  }\n  return val;\n}\n\n\n/*\n * Extract color map from a PPM file.\n */\n\nLOCAL(void)\nread_ppm_map (j_decompress_ptr cinfo, FILE *infile)\n{\n  int c;\n  unsigned int w, h, maxval, row, col;\n  int R, G, B;\n\n  /* Initial 'P' has already been read by read_color_map */\n  c = getc(infile);             /* save format discriminator for a sec */\n\n  /* while we fetch the remaining header info */\n  w = read_pbm_integer(cinfo, infile);\n  h = read_pbm_integer(cinfo, infile);\n  maxval = read_pbm_integer(cinfo, infile);\n\n  if (w <= 0 || h <= 0 || maxval <= 0) /* error check */\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n\n  /* For now, we don't support rescaling from an unusual maxval. */\n  if (maxval != (unsigned int) MAXJSAMPLE)\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n\n  switch (c) {\n  case '3':                     /* it's a text-format PPM file */\n    for (row = 0; row < h; row++) {\n      for (col = 0; col < w; col++) {\n        R = read_pbm_integer(cinfo, infile);\n        G = read_pbm_integer(cinfo, infile);\n        B = read_pbm_integer(cinfo, infile);\n        add_map_entry(cinfo, R, G, B);\n      }\n    }\n    break;\n\n  case '6':                     /* it's a raw-format PPM file */\n    for (row = 0; row < h; row++) {\n      for (col = 0; col < w; col++) {\n        R = getc(infile);\n        G = getc(infile);\n        B = getc(infile);\n        if (R == EOF || G == EOF || B == EOF)\n          ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n        add_map_entry(cinfo, R, G, B);\n      }\n    }\n    break;\n\n  default:\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n    break;\n  }\n}\n\n\n/*\n * Main entry point from djpeg.c.\n *  Input: opened input file (from file name argument on command line).\n *  Output: colormap and actual_number_of_colors fields are set in cinfo.\n */\n\nGLOBAL(void)\nread_color_map (j_decompress_ptr cinfo, FILE *infile)\n{\n  /* Allocate space for a color map of maximum supported size. */\n  cinfo->colormap = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE,\n     (JDIMENSION) (MAXJSAMPLE+1), (JDIMENSION) 3);\n  cinfo->actual_number_of_colors = 0; /* initialize map to empty */\n\n  /* Read first byte to determine file format */\n  switch (getc(infile)) {\n  case 'G':\n    read_gif_map(cinfo, infile);\n    break;\n  case 'P':\n    read_ppm_map(cinfo, infile);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n    break;\n  }\n}\n\n#endif /* QUANT_2PASS_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/rdgif.c",
    "content": "/*\n * rdgif.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains routines to read input images in GIF format.\n *\n *****************************************************************************\n * NOTE: to avoid entanglements with Unisys' patent on LZW compression,      *\n * the ability to read GIF files has been removed from the IJG distribution. *\n * Sorry about that.                                                         *\n *****************************************************************************\n *\n * We are required to state that\n *    \"The Graphics Interchange Format(c) is the Copyright property of\n *    CompuServe Incorporated. GIF(sm) is a Service Mark property of\n *    CompuServe Incorporated.\"\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n\n#ifdef GIF_SUPPORTED\n\n/*\n * The module selection routine for GIF format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_gif (j_compress_ptr cinfo)\n{\n  fprintf(stderr, \"GIF input is unsupported for legal reasons.  Sorry.\\n\");\n  exit(EXIT_FAILURE);\n  return NULL;                  /* keep compiler happy */\n}\n\n#endif /* GIF_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/rdjpgcom.1",
    "content": ".TH RDJPGCOM 1 \"02 April 2009\"\n.SH NAME\nrdjpgcom \\- display text comments from a JPEG file\n.SH SYNOPSIS\n.B rdjpgcom\n[\n.B \\-raw\n]\n[\n.B \\-verbose\n]\n[\n.I filename\n]\n.LP\n.SH DESCRIPTION\n.LP\n.B rdjpgcom\nreads the named JPEG/JFIF file, or the standard input if no file is named,\nand prints any text comments found in the file on the standard output.\n.PP\nThe JPEG standard allows \"comment\" (COM) blocks to occur within a JPEG file.\nAlthough the standard doesn't actually define what COM blocks are for, they\nare widely used to hold user-supplied text strings.  This lets you add\nannotations, titles, index terms, etc to your JPEG files, and later retrieve\nthem as text.  COM blocks do not interfere with the image stored in the JPEG\nfile.  The maximum size of a COM block is 64K, but you can have as many of\nthem as you like in one JPEG file.\n.SH OPTIONS\n.TP\n.B \\-raw\nNormally\n.B rdjpgcom\nescapes non-printable characters in comments, for security reasons.\nThis option avoids that.\n.PP\n.B \\-verbose\nCauses\n.B rdjpgcom\nto also display the JPEG image dimensions.\n.PP\nSwitch names may be abbreviated, and are not case sensitive.\n.SH HINTS\n.B rdjpgcom\ndoes not depend on the IJG JPEG library.  Its source code is intended as an\nillustration of the minimum amount of code required to parse a JPEG file\nheader correctly.\n.PP\nIn\n.B \\-verbose\nmode,\n.B rdjpgcom\nwill also attempt to print the contents of any \"APP12\" markers as text.\nSome digital cameras produce APP12 markers containing useful textual\ninformation.  If you like, you can modify the source code to print\nother APPn marker types as well.\n.SH SEE ALSO\n.BR cjpeg (1),\n.BR djpeg (1),\n.BR jpegtran (1),\n.BR wrjpgcom (1)\n.SH AUTHOR\nIndependent JPEG Group\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/rdjpgcom.c",
    "content": "/*\n * rdjpgcom.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * Modified 2009 by Bill Allombert, Guido Vollbeding.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains a very simple stand-alone application that displays\n * the text in COM (comment) markers in a JFIF file.\n * This may be useful as an example of the minimum logic needed to parse\n * JPEG markers.\n */\n\n#define JPEG_CJPEG_DJPEG        /* to get the command-line config symbols */\n#include \"jinclude.h\"           /* get auto-config symbols, <stdio.h> */\n\n#ifdef HAVE_LOCALE_H\n#include <locale.h>             /* Bill Allombert: use locale for isprint */\n#endif\n#include <ctype.h>              /* to declare isupper(), tolower() */\n#ifdef USE_SETMODE\n#include <fcntl.h>              /* to declare setmode()'s parameter macros */\n/* If you have setmode() but not <io.h>, just delete this line: */\n#include <io.h>                 /* to declare setmode() */\n#endif\n\n#ifdef USE_CCOMMAND             /* command-line reader for Macintosh */\n#ifdef __MWERKS__\n#include <SIOUX.h>              /* Metrowerks needs this */\n#include <console.h>            /* ... and this */\n#endif\n#ifdef THINK_C\n#include <console.h>            /* Think declares it here */\n#endif\n#endif\n\n#ifdef DONT_USE_B_MODE          /* define mode parameters for fopen() */\n#define READ_BINARY     \"r\"\n#else\n#define READ_BINARY     \"rb\"\n#endif\n\n#ifndef EXIT_FAILURE            /* define exit() codes if not provided */\n#define EXIT_FAILURE  1\n#endif\n#ifndef EXIT_SUCCESS\n#define EXIT_SUCCESS  0\n#endif\n\n\n/*\n * These macros are used to read the input file.\n * To reuse this code in another application, you might need to change these.\n */\n\nstatic FILE *infile;            /* input JPEG file */\n\n/* Return next input byte, or EOF if no more */\n#define NEXTBYTE()  getc(infile)\n\n\n/* Error exit handler */\n#define ERREXIT(msg)  (fprintf(stderr, \"%s\\n\", msg), exit(EXIT_FAILURE))\n\n\n/* Read one byte, testing for EOF */\nstatic int\nread_1_byte (void)\n{\n  int c;\n\n  c = NEXTBYTE();\n  if (c == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  return c;\n}\n\n/* Read 2 bytes, convert to unsigned int */\n/* All 2-byte quantities in JPEG markers are MSB first */\nstatic unsigned int\nread_2_bytes (void)\n{\n  int c1, c2;\n\n  c1 = NEXTBYTE();\n  if (c1 == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  c2 = NEXTBYTE();\n  if (c2 == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  return (((unsigned int) c1) << 8) + ((unsigned int) c2);\n}\n\n\n/*\n * JPEG markers consist of one or more 0xFF bytes, followed by a marker\n * code byte (which is not an FF).  Here are the marker codes of interest\n * in this program.  (See jdmarker.c for a more complete list.)\n */\n\n#define M_SOF0  0xC0            /* Start Of Frame N */\n#define M_SOF1  0xC1            /* N indicates which compression process */\n#define M_SOF2  0xC2            /* Only SOF0-SOF2 are now in common use */\n#define M_SOF3  0xC3\n#define M_SOF5  0xC5            /* NB: codes C4 and CC are NOT SOF markers */\n#define M_SOF6  0xC6\n#define M_SOF7  0xC7\n#define M_SOF9  0xC9\n#define M_SOF10 0xCA\n#define M_SOF11 0xCB\n#define M_SOF13 0xCD\n#define M_SOF14 0xCE\n#define M_SOF15 0xCF\n#define M_SOI   0xD8            /* Start Of Image (beginning of datastream) */\n#define M_EOI   0xD9            /* End Of Image (end of datastream) */\n#define M_SOS   0xDA            /* Start Of Scan (begins compressed data) */\n#define M_APP0  0xE0            /* Application-specific marker, type N */\n#define M_APP12 0xEC            /* (we don't bother to list all 16 APPn's) */\n#define M_COM   0xFE            /* COMment */\n\n\n/*\n * Find the next JPEG marker and return its marker code.\n * We expect at least one FF byte, possibly more if the compressor used FFs\n * to pad the file.\n * There could also be non-FF garbage between markers.  The treatment of such\n * garbage is unspecified; we choose to skip over it but emit a warning msg.\n * NB: this routine must not be used after seeing SOS marker, since it will\n * not deal correctly with FF/00 sequences in the compressed image data...\n */\n\nstatic int\nnext_marker (void)\n{\n  int c;\n  int discarded_bytes = 0;\n\n  /* Find 0xFF byte; count and skip any non-FFs. */\n  c = read_1_byte();\n  while (c != 0xFF) {\n    discarded_bytes++;\n    c = read_1_byte();\n  }\n  /* Get marker code byte, swallowing any duplicate FF bytes.  Extra FFs\n   * are legal as pad bytes, so don't count them in discarded_bytes.\n   */\n  do {\n    c = read_1_byte();\n  } while (c == 0xFF);\n\n  if (discarded_bytes != 0) {\n    fprintf(stderr, \"Warning: garbage data found in JPEG file\\n\");\n  }\n\n  return c;\n}\n\n\n/*\n * Read the initial marker, which should be SOI.\n * For a JFIF file, the first two bytes of the file should be literally\n * 0xFF M_SOI.  To be more general, we could use next_marker, but if the\n * input file weren't actually JPEG at all, next_marker might read the whole\n * file and then return a misleading error message...\n */\n\nstatic int\nfirst_marker (void)\n{\n  int c1, c2;\n\n  c1 = NEXTBYTE();\n  c2 = NEXTBYTE();\n  if (c1 != 0xFF || c2 != M_SOI)\n    ERREXIT(\"Not a JPEG file\");\n  return c2;\n}\n\n\n/*\n * Most types of marker are followed by a variable-length parameter segment.\n * This routine skips over the parameters for any marker we don't otherwise\n * want to process.\n * Note that we MUST skip the parameter segment explicitly in order not to\n * be fooled by 0xFF bytes that might appear within the parameter segment;\n * such bytes do NOT introduce new markers.\n */\n\nstatic void\nskip_variable (void)\n/* Skip over an unknown or uninteresting variable-length marker */\n{\n  unsigned int length;\n\n  /* Get the marker parameter length count */\n  length = read_2_bytes();\n  /* Length includes itself, so must be at least 2 */\n  if (length < 2)\n    ERREXIT(\"Erroneous JPEG marker length\");\n  length -= 2;\n  /* Skip over the remaining bytes */\n  while (length > 0) {\n    (void) read_1_byte();\n    length--;\n  }\n}\n\n\n/*\n * Process a COM marker.\n * We want to print out the marker contents as legible text;\n * we must guard against non-text junk and varying newline representations.\n */\n\nstatic void\nprocess_COM (int raw)\n{\n  unsigned int length;\n  int ch;\n  int lastch = 0;\n\n  /* Bill Allombert: set locale properly for isprint */\n#ifdef HAVE_LOCALE_H\n  setlocale(LC_CTYPE, \"\");\n#endif\n\n  /* Get the marker parameter length count */\n  length = read_2_bytes();\n  /* Length includes itself, so must be at least 2 */\n  if (length < 2)\n    ERREXIT(\"Erroneous JPEG marker length\");\n  length -= 2;\n\n  while (length > 0) {\n    ch = read_1_byte();\n    if (raw) {\n      putc(ch, stdout);\n    /* Emit the character in a readable form.\n     * Nonprintables are converted to \\nnn form,\n     * while \\ is converted to \\\\.\n     * Newlines in CR, CR/LF, or LF form will be printed as one newline.\n     */\n    } else if (ch == '\\r') {\n      printf(\"\\n\");\n    } else if (ch == '\\n') {\n      if (lastch != '\\r')\n        printf(\"\\n\");\n    } else if (ch == '\\\\') {\n      printf(\"\\\\\\\\\");\n    } else if (isprint(ch)) {\n      putc(ch, stdout);\n    } else {\n      printf(\"\\\\%03o\", ch);\n    }\n    lastch = ch;\n    length--;\n  }\n  printf(\"\\n\");\n\n  /* Bill Allombert: revert to C locale */\n#ifdef HAVE_LOCALE_H\n  setlocale(LC_CTYPE, \"C\");\n#endif\n}\n\n\n/*\n * Process a SOFn marker.\n * This code is only needed if you want to know the image dimensions...\n */\n\nstatic void\nprocess_SOFn (int marker)\n{\n  unsigned int length;\n  unsigned int image_height, image_width;\n  int data_precision, num_components;\n  const char *process;\n  int ci;\n\n  length = read_2_bytes();      /* usual parameter length count */\n\n  data_precision = read_1_byte();\n  image_height = read_2_bytes();\n  image_width = read_2_bytes();\n  num_components = read_1_byte();\n\n  switch (marker) {\n  case M_SOF0:  process = \"Baseline\";  break;\n  case M_SOF1:  process = \"Extended sequential\";  break;\n  case M_SOF2:  process = \"Progressive\";  break;\n  case M_SOF3:  process = \"Lossless\";  break;\n  case M_SOF5:  process = \"Differential sequential\";  break;\n  case M_SOF6:  process = \"Differential progressive\";  break;\n  case M_SOF7:  process = \"Differential lossless\";  break;\n  case M_SOF9:  process = \"Extended sequential, arithmetic coding\";  break;\n  case M_SOF10: process = \"Progressive, arithmetic coding\";  break;\n  case M_SOF11: process = \"Lossless, arithmetic coding\";  break;\n  case M_SOF13: process = \"Differential sequential, arithmetic coding\";  break;\n  case M_SOF14: process = \"Differential progressive, arithmetic coding\"; break;\n  case M_SOF15: process = \"Differential lossless, arithmetic coding\";  break;\n  default:      process = \"Unknown\";  break;\n  }\n\n  printf(\"JPEG image is %uw * %uh, %d color components, %d bits per sample\\n\",\n         image_width, image_height, num_components, data_precision);\n  printf(\"JPEG process: %s\\n\", process);\n\n  if (length != (unsigned int) (8 + num_components * 3))\n    ERREXIT(\"Bogus SOF marker length\");\n\n  for (ci = 0; ci < num_components; ci++) {\n    (void) read_1_byte();       /* Component ID code */\n    (void) read_1_byte();       /* H, V sampling factors */\n    (void) read_1_byte();       /* Quantization table number */\n  }\n}\n\n\n/*\n * Parse the marker stream until SOS or EOI is seen;\n * display any COM markers.\n * While the companion program wrjpgcom will always insert COM markers before\n * SOFn, other implementations might not, so we scan to SOS before stopping.\n * If we were only interested in the image dimensions, we would stop at SOFn.\n * (Conversely, if we only cared about COM markers, there would be no need\n * for special code to handle SOFn; we could treat it like other markers.)\n */\n\nstatic int\nscan_JPEG_header (int verbose, int raw)\n{\n  int marker;\n\n  /* Expect SOI at start of file */\n  if (first_marker() != M_SOI)\n    ERREXIT(\"Expected SOI marker first\");\n\n  /* Scan miscellaneous markers until we reach SOS. */\n  for (;;) {\n    marker = next_marker();\n    switch (marker) {\n      /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be,\n       * treated as SOFn.  C4 in particular is actually DHT.\n       */\n    case M_SOF0:                /* Baseline */\n    case M_SOF1:                /* Extended sequential, Huffman */\n    case M_SOF2:                /* Progressive, Huffman */\n    case M_SOF3:                /* Lossless, Huffman */\n    case M_SOF5:                /* Differential sequential, Huffman */\n    case M_SOF6:                /* Differential progressive, Huffman */\n    case M_SOF7:                /* Differential lossless, Huffman */\n    case M_SOF9:                /* Extended sequential, arithmetic */\n    case M_SOF10:               /* Progressive, arithmetic */\n    case M_SOF11:               /* Lossless, arithmetic */\n    case M_SOF13:               /* Differential sequential, arithmetic */\n    case M_SOF14:               /* Differential progressive, arithmetic */\n    case M_SOF15:               /* Differential lossless, arithmetic */\n      if (verbose)\n        process_SOFn(marker);\n      else\n        skip_variable();\n      break;\n\n    case M_SOS:                 /* stop before hitting compressed data */\n      return marker;\n\n    case M_EOI:                 /* in case it's a tables-only JPEG stream */\n      return marker;\n\n    case M_COM:\n      process_COM(raw);\n      break;\n\n    case M_APP12:\n      /* Some digital camera makers put useful textual information into\n       * APP12 markers, so we print those out too when in -verbose mode.\n       */\n      if (verbose) {\n        printf(\"APP12 contains:\\n\");\n        process_COM(raw);\n      } else\n        skip_variable();\n      break;\n\n    default:                    /* Anything else just gets skipped */\n      skip_variable();          /* we assume it has a parameter count... */\n      break;\n    }\n  } /* end loop */\n}\n\n\n/* Command line parsing code */\n\nstatic const char *progname;    /* program name for error messages */\n\n\nstatic void\nusage (void)\n/* complain about bad command line */\n{\n  fprintf(stderr, \"rdjpgcom displays any textual comments in a JPEG file.\\n\");\n\n  fprintf(stderr, \"Usage: %s [switches] [inputfile]\\n\", progname);\n\n  fprintf(stderr, \"Switches (names may be abbreviated):\\n\");\n  fprintf(stderr, \"  -raw        Display non-printable characters in comments (unsafe)\\n\");\n  fprintf(stderr, \"  -verbose    Also display dimensions of JPEG image\\n\");\n\n  exit(EXIT_FAILURE);\n}\n\n\nstatic int\nkeymatch (char *arg, const char *keyword, int minchars)\n/* Case-insensitive matching of (possibly abbreviated) keyword switches. */\n/* keyword is the constant keyword (must be lower case already), */\n/* minchars is length of minimum legal abbreviation. */\n{\n  register int ca, ck;\n  register int nmatched = 0;\n\n  while ((ca = *arg++) != '\\0') {\n    if ((ck = *keyword++) == '\\0')\n      return 0;                 /* arg longer than keyword, no good */\n    if (isupper(ca))            /* force arg to lcase (assume ck is already) */\n      ca = tolower(ca);\n    if (ca != ck)\n      return 0;                 /* no good */\n    nmatched++;                 /* count matched characters */\n  }\n  /* reached end of argument; fail if it's too short for unique abbrev */\n  if (nmatched < minchars)\n    return 0;\n  return 1;                     /* A-OK */\n}\n\n\n/*\n * The main program.\n */\n\nint\nmain (int argc, char **argv)\n{\n  int argn;\n  char *arg;\n  int verbose = 0, raw = 0;\n\n  /* On Mac, fetch a command line. */\n#ifdef USE_CCOMMAND\n  argc = ccommand(&argv);\n#endif\n\n  progname = argv[0];\n  if (progname == NULL || progname[0] == 0)\n    progname = \"rdjpgcom\";      /* in case C library doesn't provide it */\n\n  /* Parse switches, if any */\n  for (argn = 1; argn < argc; argn++) {\n    arg = argv[argn];\n    if (arg[0] != '-')\n      break;                    /* not switch, must be file name */\n    arg++;                      /* advance over '-' */\n    if (keymatch(arg, \"verbose\", 1)) {\n      verbose++;\n    } else if (keymatch(arg, \"raw\", 1)) {\n      raw = 1;\n    } else\n      usage();\n  }\n\n  /* Open the input file. */\n  /* Unix style: expect zero or one file name */\n  if (argn < argc-1) {\n    fprintf(stderr, \"%s: only one input file\\n\", progname);\n    usage();\n  }\n  if (argn < argc) {\n    if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[argn]);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default input file is stdin */\n#ifdef USE_SETMODE              /* need to hack file mode? */\n    setmode(fileno(stdin), O_BINARY);\n#endif\n#ifdef USE_FDOPEN               /* need to re-open in binary mode? */\n    if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open stdin\\n\", progname);\n      exit(EXIT_FAILURE);\n    }\n#else\n    infile = stdin;\n#endif\n  }\n\n  /* Scan the JPEG headers. */\n  (void) scan_JPEG_header(verbose, raw);\n\n  /* All done. */\n  exit(EXIT_SUCCESS);\n  return 0;                     /* suppress no-return-value warnings */\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/rdppm.c",
    "content": "/*\n * rdppm.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2009 by Bill Allombert, Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2015, 2016, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains routines to read input images in PPM/PGM format.\n * The extended 2-byte-per-sample raw PPM/PGM formats are supported.\n * The PBMPLUS library is NOT required to compile this software\n * (but it is highly useful as a set of PPM image manipulation programs).\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume input from\n * an ordinary stdio stream.  They further assume that reading begins\n * at the start of the file; start_input may need work if the\n * user interface has already read some data (e.g., to determine that\n * the file is indeed PPM format).\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n\n#ifdef PPM_SUPPORTED\n\n\n/* Portions of this code are based on the PBMPLUS library, which is:\n**\n** Copyright (C) 1988 by Jef Poskanzer.\n**\n** Permission to use, copy, modify, and distribute this software and its\n** documentation for any purpose and without fee is hereby granted, provided\n** that the above copyright notice appear in all copies and that both that\n** copyright notice and this permission notice appear in supporting\n** documentation.  This software is provided \"as is\" without express or\n** implied warranty.\n*/\n\n\n/* Macros to deal with unsigned chars as efficiently as compiler allows */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char U_CHAR;\n#define UCH(x)  ((int) (x))\n#else /* !HAVE_UNSIGNED_CHAR */\n#ifdef __CHAR_UNSIGNED__\ntypedef char U_CHAR;\n#define UCH(x)  ((int) (x))\n#else\ntypedef char U_CHAR;\n#define UCH(x)  ((int) (x) & 0xFF)\n#endif\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n#define ReadOK(file,buffer,len) (JFREAD(file,buffer,len) == ((size_t) (len)))\n\n\n/* Private version of data source object */\n\ntypedef struct {\n  struct cjpeg_source_struct pub; /* public fields */\n\n  /* Usually these two pointers point to the same place: */\n  U_CHAR *iobuffer;             /* fread's I/O buffer */\n  JSAMPROW pixrow;              /* compressor input buffer */\n  size_t buffer_width;          /* width of I/O buffer */\n  JSAMPLE *rescale;             /* => maxval-remapping array, or NULL */\n  int maxval;\n} ppm_source_struct;\n\ntypedef ppm_source_struct *ppm_source_ptr;\n\n\nLOCAL(int)\npbm_getc (FILE *infile)\n/* Read next char, skipping over any comments */\n/* A comment/newline sequence is returned as a newline */\n{\n  register int ch;\n\n  ch = getc(infile);\n  if (ch == '#') {\n    do {\n      ch = getc(infile);\n    } while (ch != '\\n' && ch != EOF);\n  }\n  return ch;\n}\n\n\nLOCAL(unsigned int)\nread_pbm_integer (j_compress_ptr cinfo, FILE *infile, unsigned int maxval)\n/* Read an unsigned decimal integer from the PPM file */\n/* Swallows one trailing character after the integer */\n/* Note that on a 16-bit-int machine, only values up to 64k can be read. */\n/* This should not be a problem in practice. */\n{\n  register int ch;\n  register unsigned int val;\n\n  /* Skip any leading whitespace */\n  do {\n    ch = pbm_getc(infile);\n    if (ch == EOF)\n      ERREXIT(cinfo, JERR_INPUT_EOF);\n  } while (ch == ' ' || ch == '\\t' || ch == '\\n' || ch == '\\r');\n\n  if (ch < '0' || ch > '9')\n    ERREXIT(cinfo, JERR_PPM_NONNUMERIC);\n\n  val = ch - '0';\n  while ((ch = pbm_getc(infile)) >= '0' && ch <= '9') {\n    val *= 10;\n    val += ch - '0';\n  }\n\n  if (val > maxval)\n    ERREXIT(cinfo, JERR_PPM_TOOLARGE);\n\n  return val;\n}\n\n\n/*\n * Read one row of pixels.\n *\n * We provide several different versions depending on input file format.\n * In all cases, input is scaled to the size of JSAMPLE.\n *\n * A really fast path is provided for reading byte/sample raw files with\n * maxval = MAXJSAMPLE, which is the normal case for 8-bit data.\n */\n\n\nMETHODDEF(JDIMENSION)\nget_text_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading text-format PGM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  FILE *infile = source->pub.input_file;\n  register JSAMPROW ptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n  unsigned int maxval = source->maxval;\n\n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    *ptr++ = rescale[read_pbm_integer(cinfo, infile, maxval)];\n  }\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_text_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading text-format PPM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  FILE *infile = source->pub.input_file;\n  register JSAMPROW ptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n  unsigned int maxval = source->maxval;\n\n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    *ptr++ = rescale[read_pbm_integer(cinfo, infile, maxval)];\n    *ptr++ = rescale[read_pbm_integer(cinfo, infile, maxval)];\n    *ptr++ = rescale[read_pbm_integer(cinfo, infile, maxval)];\n  }\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_scaled_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading raw-byte-format PGM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register U_CHAR *bufferptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n\n  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  ptr = source->pub.buffer[0];\n  bufferptr = source->iobuffer;\n  for (col = cinfo->image_width; col > 0; col--) {\n    *ptr++ = rescale[UCH(*bufferptr++)];\n  }\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_scaled_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading raw-byte-format PPM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register U_CHAR *bufferptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n\n  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  ptr = source->pub.buffer[0];\n  bufferptr = source->iobuffer;\n  for (col = cinfo->image_width; col > 0; col--) {\n    *ptr++ = rescale[UCH(*bufferptr++)];\n    *ptr++ = rescale[UCH(*bufferptr++)];\n    *ptr++ = rescale[UCH(*bufferptr++)];\n  }\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_raw_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading raw-byte-format files with maxval = MAXJSAMPLE.\n * In this case we just read right into the JSAMPLE buffer!\n * Note that same code works for PPM and PGM files.\n */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n\n  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_word_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading raw-word-format PGM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register U_CHAR *bufferptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n  unsigned int maxval = source->maxval;\n\n  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  ptr = source->pub.buffer[0];\n  bufferptr = source->iobuffer;\n  for (col = cinfo->image_width; col > 0; col--) {\n    register int temp;\n    temp  = UCH(*bufferptr++) << 8;\n    temp |= UCH(*bufferptr++);\n    if (temp > maxval)\n      ERREXIT(cinfo, JERR_PPM_TOOLARGE);\n    *ptr++ = rescale[temp];\n  }\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_word_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading raw-word-format PPM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register U_CHAR *bufferptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n  unsigned int maxval = source->maxval;\n\n  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  ptr = source->pub.buffer[0];\n  bufferptr = source->iobuffer;\n  for (col = cinfo->image_width; col > 0; col--) {\n    register int temp;\n    temp  = UCH(*bufferptr++) << 8;\n    temp |= UCH(*bufferptr++);\n    if (temp > maxval)\n      ERREXIT(cinfo, JERR_PPM_TOOLARGE);\n    *ptr++ = rescale[temp];\n    temp  = UCH(*bufferptr++) << 8;\n    temp |= UCH(*bufferptr++);\n    if (temp > maxval)\n      ERREXIT(cinfo, JERR_PPM_TOOLARGE);\n    *ptr++ = rescale[temp];\n    temp  = UCH(*bufferptr++) << 8;\n    temp |= UCH(*bufferptr++);\n    if (temp > maxval)\n      ERREXIT(cinfo, JERR_PPM_TOOLARGE);\n    *ptr++ = rescale[temp];\n  }\n  return 1;\n}\n\n\n/*\n * Read the file header; return image size and component count.\n */\n\nMETHODDEF(void)\nstart_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  int c;\n  unsigned int w, h, maxval;\n  boolean need_iobuffer, use_raw_buffer, need_rescale;\n\n  if (getc(source->pub.input_file) != 'P')\n    ERREXIT(cinfo, JERR_PPM_NOT);\n\n  c = getc(source->pub.input_file); /* subformat discriminator character */\n\n  /* detect unsupported variants (ie, PBM) before trying to read header */\n  switch (c) {\n  case '2':                     /* it's a text-format PGM file */\n  case '3':                     /* it's a text-format PPM file */\n  case '5':                     /* it's a raw-format PGM file */\n  case '6':                     /* it's a raw-format PPM file */\n    break;\n  default:\n    ERREXIT(cinfo, JERR_PPM_NOT);\n    break;\n  }\n\n  /* fetch the remaining header info */\n  w = read_pbm_integer(cinfo, source->pub.input_file, 65535);\n  h = read_pbm_integer(cinfo, source->pub.input_file, 65535);\n  maxval = read_pbm_integer(cinfo, source->pub.input_file, 65535);\n\n  if (w <= 0 || h <= 0 || maxval <= 0) /* error check */\n    ERREXIT(cinfo, JERR_PPM_NOT);\n\n  cinfo->data_precision = BITS_IN_JSAMPLE; /* we always rescale data to this */\n  cinfo->image_width = (JDIMENSION) w;\n  cinfo->image_height = (JDIMENSION) h;\n  source->maxval = maxval;\n\n  /* initialize flags to most common settings */\n  need_iobuffer = TRUE;         /* do we need an I/O buffer? */\n  use_raw_buffer = FALSE;       /* do we map input buffer onto I/O buffer? */\n  need_rescale = TRUE;          /* do we need a rescale array? */\n\n  switch (c) {\n  case '2':                     /* it's a text-format PGM file */\n    cinfo->input_components = 1;\n    cinfo->in_color_space = JCS_GRAYSCALE;\n    TRACEMS2(cinfo, 1, JTRC_PGM_TEXT, w, h);\n    source->pub.get_pixel_rows = get_text_gray_row;\n    need_iobuffer = FALSE;\n    break;\n\n  case '3':                     /* it's a text-format PPM file */\n    cinfo->input_components = 3;\n    cinfo->in_color_space = JCS_RGB;\n    TRACEMS2(cinfo, 1, JTRC_PPM_TEXT, w, h);\n    source->pub.get_pixel_rows = get_text_rgb_row;\n    need_iobuffer = FALSE;\n    break;\n\n  case '5':                     /* it's a raw-format PGM file */\n    cinfo->input_components = 1;\n    cinfo->in_color_space = JCS_GRAYSCALE;\n    TRACEMS2(cinfo, 1, JTRC_PGM, w, h);\n    if (maxval > 255) {\n      source->pub.get_pixel_rows = get_word_gray_row;\n    } else if (maxval == MAXJSAMPLE && sizeof(JSAMPLE) == sizeof(U_CHAR)) {\n      source->pub.get_pixel_rows = get_raw_row;\n      use_raw_buffer = TRUE;\n      need_rescale = FALSE;\n    } else {\n      source->pub.get_pixel_rows = get_scaled_gray_row;\n    }\n    break;\n\n  case '6':                     /* it's a raw-format PPM file */\n    cinfo->input_components = 3;\n    cinfo->in_color_space = JCS_RGB;\n    TRACEMS2(cinfo, 1, JTRC_PPM, w, h);\n    if (maxval > 255) {\n      source->pub.get_pixel_rows = get_word_rgb_row;\n    } else if (maxval == MAXJSAMPLE && sizeof(JSAMPLE) == sizeof(U_CHAR)) {\n      source->pub.get_pixel_rows = get_raw_row;\n      use_raw_buffer = TRUE;\n      need_rescale = FALSE;\n    } else {\n      source->pub.get_pixel_rows = get_scaled_rgb_row;\n    }\n    break;\n  }\n\n  /* Allocate space for I/O buffer: 1 or 3 bytes or words/pixel. */\n  if (need_iobuffer) {\n    source->buffer_width = (size_t) w * cinfo->input_components *\n      ((maxval <= 255) ? sizeof(U_CHAR) : (2 * sizeof(U_CHAR)));\n    source->iobuffer = (U_CHAR *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  source->buffer_width);\n  }\n\n  /* Create compressor input buffer. */\n  if (use_raw_buffer) {\n    /* For unscaled raw-input case, we can just map it onto the I/O buffer. */\n    /* Synthesize a JSAMPARRAY pointer structure */\n    source->pixrow = (JSAMPROW) source->iobuffer;\n    source->pub.buffer = & source->pixrow;\n    source->pub.buffer_height = 1;\n  } else {\n    /* Need to translate anyway, so make a separate sample buffer. */\n    source->pub.buffer = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (JDIMENSION) w * cinfo->input_components, (JDIMENSION) 1);\n    source->pub.buffer_height = 1;\n  }\n\n  /* Compute the rescaling array if required. */\n  if (need_rescale) {\n    long val, half_maxval;\n\n    /* On 16-bit-int machines we have to be careful of maxval = 65535 */\n    source->rescale = (JSAMPLE *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  (size_t) (((long) maxval + 1L) *\n                                            sizeof(JSAMPLE)));\n    half_maxval = maxval / 2;\n    for (val = 0; val <= (long) maxval; val++) {\n      /* The multiplication here must be done in 32 bits to avoid overflow */\n      source->rescale[val] = (JSAMPLE) ((val * MAXJSAMPLE + half_maxval) /\n                                        maxval);\n    }\n  }\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  /* no work */\n}\n\n\n/*\n * The module selection routine for PPM format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_ppm (j_compress_ptr cinfo)\n{\n  ppm_source_ptr source;\n\n  /* Create module interface object */\n  source = (ppm_source_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(ppm_source_struct));\n  /* Fill in method ptrs, except get_pixel_rows which start_input sets */\n  source->pub.start_input = start_input_ppm;\n  source->pub.finish_input = finish_input_ppm;\n\n  return (cjpeg_source_ptr) source;\n}\n\n#endif /* PPM_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/rdrle.c",
    "content": "/*\n * rdrle.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code and\n * information relevant to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains routines to read input images in Utah RLE format.\n * The Utah Raster Toolkit library is required (version 3.1 or later).\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume input from\n * an ordinary stdio stream.  They further assume that reading begins\n * at the start of the file; start_input may need work if the\n * user interface has already read some data (e.g., to determine that\n * the file is indeed RLE format).\n *\n * Based on code contributed by Mike Lijewski,\n * with updates from Robert Hutchinson.\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n\n#ifdef RLE_SUPPORTED\n\n/* rle.h is provided by the Utah Raster Toolkit. */\n\n#include <rle.h>\n\n/*\n * We assume that JSAMPLE has the same representation as rle_pixel,\n * to wit, \"unsigned char\".  Hence we can't cope with 12- or 16-bit samples.\n */\n\n#if BITS_IN_JSAMPLE != 8\n  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */\n#endif\n\n/*\n * We support the following types of RLE files:\n *\n *   GRAYSCALE   - 8 bits, no colormap\n *   MAPPEDGRAY  - 8 bits, 1 channel colomap\n *   PSEUDOCOLOR - 8 bits, 3 channel colormap\n *   TRUECOLOR   - 24 bits, 3 channel colormap\n *   DIRECTCOLOR - 24 bits, no colormap\n *\n * For now, we ignore any alpha channel in the image.\n */\n\ntypedef enum\n  { GRAYSCALE, MAPPEDGRAY, PSEUDOCOLOR, TRUECOLOR, DIRECTCOLOR } rle_kind;\n\n\n/*\n * Since RLE stores scanlines bottom-to-top, we have to invert the image\n * to conform to JPEG's top-to-bottom order.  To do this, we read the\n * incoming image into a virtual array on the first get_pixel_rows call,\n * then fetch the required row from the virtual array on subsequent calls.\n */\n\ntypedef struct _rle_source_struct *rle_source_ptr;\n\ntypedef struct _rle_source_struct {\n  struct cjpeg_source_struct pub; /* public fields */\n\n  rle_kind visual;              /* actual type of input file */\n  jvirt_sarray_ptr image;       /* virtual array to hold the image */\n  JDIMENSION row;               /* current row # in the virtual array */\n  rle_hdr header;               /* Input file information */\n  rle_pixel **rle_row;          /* holds a row returned by rle_getrow() */\n\n} rle_source_struct;\n\n\n/*\n * Read the file header; return image size and component count.\n */\n\nMETHODDEF(void)\nstart_input_rle (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  rle_source_ptr source = (rle_source_ptr) sinfo;\n  JDIMENSION width, height;\n#ifdef PROGRESS_REPORT\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n#endif\n\n  /* Use RLE library routine to get the header info */\n  source->header = *rle_hdr_init(NULL);\n  source->header.rle_file = source->pub.input_file;\n  switch (rle_get_setup(&(source->header))) {\n  case RLE_SUCCESS:\n    /* A-OK */\n    break;\n  case RLE_NOT_RLE:\n    ERREXIT(cinfo, JERR_RLE_NOT);\n    break;\n  case RLE_NO_SPACE:\n    ERREXIT(cinfo, JERR_RLE_MEM);\n    break;\n  case RLE_EMPTY:\n    ERREXIT(cinfo, JERR_RLE_EMPTY);\n    break;\n  case RLE_EOF:\n    ERREXIT(cinfo, JERR_RLE_EOF);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_RLE_BADERROR);\n    break;\n  }\n\n  /* Figure out what we have, set private vars and return values accordingly */\n\n  width  = source->header.xmax - source->header.xmin + 1;\n  height = source->header.ymax - source->header.ymin + 1;\n  source->header.xmin = 0;              /* realign horizontally */\n  source->header.xmax = width-1;\n\n  cinfo->image_width      = width;\n  cinfo->image_height     = height;\n  cinfo->data_precision   = 8;  /* we can only handle 8 bit data */\n\n  if (source->header.ncolors == 1 && source->header.ncmap == 0) {\n    source->visual     = GRAYSCALE;\n    TRACEMS2(cinfo, 1, JTRC_RLE_GRAY, width, height);\n  } else if (source->header.ncolors == 1 && source->header.ncmap == 1) {\n    source->visual     = MAPPEDGRAY;\n    TRACEMS3(cinfo, 1, JTRC_RLE_MAPGRAY, width, height,\n             1 << source->header.cmaplen);\n  } else if (source->header.ncolors == 1 && source->header.ncmap == 3) {\n    source->visual     = PSEUDOCOLOR;\n    TRACEMS3(cinfo, 1, JTRC_RLE_MAPPED, width, height,\n             1 << source->header.cmaplen);\n  } else if (source->header.ncolors == 3 && source->header.ncmap == 3) {\n    source->visual     = TRUECOLOR;\n    TRACEMS3(cinfo, 1, JTRC_RLE_FULLMAP, width, height,\n             1 << source->header.cmaplen);\n  } else if (source->header.ncolors == 3 && source->header.ncmap == 0) {\n    source->visual     = DIRECTCOLOR;\n    TRACEMS2(cinfo, 1, JTRC_RLE, width, height);\n  } else\n    ERREXIT(cinfo, JERR_RLE_UNSUPPORTED);\n\n  if (source->visual == GRAYSCALE || source->visual == MAPPEDGRAY) {\n    cinfo->in_color_space   = JCS_GRAYSCALE;\n    cinfo->input_components = 1;\n  } else {\n    cinfo->in_color_space   = JCS_RGB;\n    cinfo->input_components = 3;\n  }\n\n  /*\n   * A place to hold each scanline while it's converted.\n   * (GRAYSCALE scanlines don't need converting)\n   */\n  if (source->visual != GRAYSCALE) {\n    source->rle_row = (rle_pixel**) (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (JDIMENSION) width, (JDIMENSION) cinfo->input_components);\n  }\n\n  /* request a virtual array to hold the image */\n  source->image = (*cinfo->mem->request_virt_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n     (JDIMENSION) (width * source->header.ncolors),\n     (JDIMENSION) height, (JDIMENSION) 1);\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL) {\n    /* count file input as separate pass */\n    progress->total_extra_passes++;\n  }\n#endif\n\n  source->pub.buffer_height = 1;\n}\n\n\n/*\n * Read one row of pixels.\n * Called only after load_image has read the image into the virtual array.\n * Used for GRAYSCALE, MAPPEDGRAY, TRUECOLOR, and DIRECTCOLOR images.\n */\n\nMETHODDEF(JDIMENSION)\nget_rle_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  rle_source_ptr source = (rle_source_ptr) sinfo;\n\n  source->row--;\n  source->pub.buffer = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->image, source->row, (JDIMENSION) 1, FALSE);\n\n  return 1;\n}\n\n/*\n * Read one row of pixels.\n * Called only after load_image has read the image into the virtual array.\n * Used for PSEUDOCOLOR images.\n */\n\nMETHODDEF(JDIMENSION)\nget_pseudocolor_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  rle_source_ptr source = (rle_source_ptr) sinfo;\n  JSAMPROW src_row, dest_row;\n  JDIMENSION col;\n  rle_map *colormap;\n  int val;\n\n  colormap = source->header.cmap;\n  dest_row = source->pub.buffer[0];\n  source->row--;\n  src_row = *(*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->image, source->row, (JDIMENSION) 1, FALSE);\n\n  for (col = cinfo->image_width; col > 0; col--) {\n    val = GETJSAMPLE(*src_row++);\n    *dest_row++ = (JSAMPLE) (colormap[val      ] >> 8);\n    *dest_row++ = (JSAMPLE) (colormap[val + 256] >> 8);\n    *dest_row++ = (JSAMPLE) (colormap[val + 512] >> 8);\n  }\n\n  return 1;\n}\n\n\n/*\n * Load the image into a virtual array.  We have to do this because RLE\n * files start at the lower left while the JPEG standard has them starting\n * in the upper left.  This is called the first time we want to get a row\n * of input.  What we do is load the RLE data into the array and then call\n * the appropriate routine to read one row from the array.  Before returning,\n * we set source->pub.get_pixel_rows so that subsequent calls go straight to\n * the appropriate row-reading routine.\n */\n\nMETHODDEF(JDIMENSION)\nload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  rle_source_ptr source = (rle_source_ptr) sinfo;\n  JDIMENSION row, col;\n  JSAMPROW  scanline, red_ptr, green_ptr, blue_ptr;\n  rle_pixel **rle_row;\n  rle_map *colormap;\n  char channel;\n#ifdef PROGRESS_REPORT\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n#endif\n\n  colormap = source->header.cmap;\n  rle_row = source->rle_row;\n\n  /* Read the RLE data into our virtual array.\n   * We assume here that rle_pixel is represented the same as JSAMPLE.\n   */\n  RLE_CLR_BIT(source->header, RLE_ALPHA); /* don't read the alpha channel */\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL) {\n    progress->pub.pass_limit = cinfo->image_height;\n    progress->pub.pass_counter = 0;\n    (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n  }\n#endif\n\n  switch (source->visual) {\n\n  case GRAYSCALE:\n  case PSEUDOCOLOR:\n    for (row = 0; row < cinfo->image_height; row++) {\n      rle_row = (rle_pixel **) (*cinfo->mem->access_virt_sarray)\n         ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);\n      rle_getrow(&source->header, rle_row);\n#ifdef PROGRESS_REPORT\n      if (progress != NULL) {\n        progress->pub.pass_counter++;\n        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n      }\n#endif\n    }\n    break;\n\n  case MAPPEDGRAY:\n  case TRUECOLOR:\n    for (row = 0; row < cinfo->image_height; row++) {\n      scanline = *(*cinfo->mem->access_virt_sarray)\n        ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);\n      rle_row = source->rle_row;\n      rle_getrow(&source->header, rle_row);\n\n      for (col = 0; col < cinfo->image_width; col++) {\n        for (channel = 0; channel < source->header.ncolors; channel++) {\n          *scanline++ = (JSAMPLE)\n            (colormap[GETJSAMPLE(rle_row[channel][col]) + 256 * channel] >> 8);\n        }\n      }\n\n#ifdef PROGRESS_REPORT\n      if (progress != NULL) {\n        progress->pub.pass_counter++;\n        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n      }\n#endif\n    }\n    break;\n\n  case DIRECTCOLOR:\n    for (row = 0; row < cinfo->image_height; row++) {\n      scanline = *(*cinfo->mem->access_virt_sarray)\n        ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);\n      rle_getrow(&source->header, rle_row);\n\n      red_ptr   = rle_row[0];\n      green_ptr = rle_row[1];\n      blue_ptr  = rle_row[2];\n\n      for (col = cinfo->image_width; col > 0; col--) {\n        *scanline++ = *red_ptr++;\n        *scanline++ = *green_ptr++;\n        *scanline++ = *blue_ptr++;\n      }\n\n#ifdef PROGRESS_REPORT\n      if (progress != NULL) {\n        progress->pub.pass_counter++;\n        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n      }\n#endif\n    }\n  }\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL)\n    progress->completed_extra_passes++;\n#endif\n\n  /* Set up to call proper row-extraction routine in future */\n  if (source->visual == PSEUDOCOLOR) {\n    source->pub.buffer = source->rle_row;\n    source->pub.get_pixel_rows = get_pseudocolor_row;\n  } else {\n    source->pub.get_pixel_rows = get_rle_row;\n  }\n  source->row = cinfo->image_height;\n\n  /* And fetch the topmost (bottommost) row */\n  return (*source->pub.get_pixel_rows) (cinfo, sinfo);\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_input_rle (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  /* no work */\n}\n\n\n/*\n * The module selection routine for RLE format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_rle (j_compress_ptr cinfo)\n{\n  rle_source_ptr source;\n\n  /* Create module interface object */\n  source = (rle_source_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(rle_source_struct));\n  /* Fill in method ptrs */\n  source->pub.start_input = start_input_rle;\n  source->pub.finish_input = finish_input_rle;\n  source->pub.get_pixel_rows = load_image;\n\n  return (cjpeg_source_ptr) source;\n}\n\n#endif /* RLE_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/rdswitch.c",
    "content": "/*\n * rdswitch.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains routines to process some of cjpeg's more complicated\n * command-line switches.  Switches processed here are:\n *      -qtables file           Read quantization tables from text file\n *      -scans file             Read scan script from text file\n *      -quality N[,N,...]      Set quality ratings\n *      -qslots N[,N,...]       Set component quantization table selectors\n *      -sample HxV[,HxV,...]   Set component sampling factors\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n#include <ctype.h>              /* to declare isdigit(), isspace() */\n\n\nLOCAL(int)\ntext_getc (FILE *file)\n/* Read next char, skipping over any comments (# to end of line) */\n/* A comment/newline sequence is returned as a newline */\n{\n  register int ch;\n\n  ch = getc(file);\n  if (ch == '#') {\n    do {\n      ch = getc(file);\n    } while (ch != '\\n' && ch != EOF);\n  }\n  return ch;\n}\n\n\nLOCAL(boolean)\nread_text_integer (FILE *file, long *result, int *termchar)\n/* Read an unsigned decimal integer from a file, store it in result */\n/* Reads one trailing character after the integer; returns it in termchar */\n{\n  register int ch;\n  register long val;\n\n  /* Skip any leading whitespace, detect EOF */\n  do {\n    ch = text_getc(file);\n    if (ch == EOF) {\n      *termchar = ch;\n      return FALSE;\n    }\n  } while (isspace(ch));\n\n  if (! isdigit(ch)) {\n    *termchar = ch;\n    return FALSE;\n  }\n\n  val = ch - '0';\n  while ((ch = text_getc(file)) != EOF) {\n    if (! isdigit(ch))\n      break;\n    val *= 10;\n    val += ch - '0';\n  }\n  *result = val;\n  *termchar = ch;\n  return TRUE;\n}\n\n\n#if JPEG_LIB_VERSION < 70\nstatic int q_scale_factor[NUM_QUANT_TBLS] = {100, 100, 100, 100};\n#endif\n\nGLOBAL(boolean)\nread_quant_tables (j_compress_ptr cinfo, char *filename,\n                   boolean force_baseline)\n/* Read a set of quantization tables from the specified file.\n * The file is plain ASCII text: decimal numbers with whitespace between.\n * Comments preceded by '#' may be included in the file.\n * There may be one to NUM_QUANT_TBLS tables in the file, each of 64 values.\n * The tables are implicitly numbered 0,1,etc.\n * NOTE: does not affect the qslots mapping, which will default to selecting\n * table 0 for luminance (or primary) components, 1 for chrominance components.\n * You must use -qslots if you want a different component->table mapping.\n */\n{\n  FILE *fp;\n  int tblno, i, termchar;\n  long val;\n  unsigned int table[DCTSIZE2];\n\n  if ((fp = fopen(filename, \"r\")) == NULL) {\n    fprintf(stderr, \"Can't open table file %s\\n\", filename);\n    return FALSE;\n  }\n  tblno = 0;\n\n  while (read_text_integer(fp, &val, &termchar)) { /* read 1st element of table */\n    if (tblno >= NUM_QUANT_TBLS) {\n      fprintf(stderr, \"Too many tables in file %s\\n\", filename);\n      fclose(fp);\n      return FALSE;\n    }\n    table[0] = (unsigned int) val;\n    for (i = 1; i < DCTSIZE2; i++) {\n      if (! read_text_integer(fp, &val, &termchar)) {\n        fprintf(stderr, \"Invalid table data in file %s\\n\", filename);\n        fclose(fp);\n        return FALSE;\n      }\n      table[i] = (unsigned int) val;\n    }\n#if JPEG_LIB_VERSION >= 70\n    jpeg_add_quant_table(cinfo, tblno, table, cinfo->q_scale_factor[tblno],\n                         force_baseline);\n#else\n    jpeg_add_quant_table(cinfo, tblno, table, q_scale_factor[tblno],\n                         force_baseline);\n#endif\n    tblno++;\n  }\n\n  if (termchar != EOF) {\n    fprintf(stderr, \"Non-numeric data in file %s\\n\", filename);\n    fclose(fp);\n    return FALSE;\n  }\n\n  fclose(fp);\n  return TRUE;\n}\n\n\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n\nLOCAL(boolean)\nread_scan_integer (FILE *file, long *result, int *termchar)\n/* Variant of read_text_integer that always looks for a non-space termchar;\n * this simplifies parsing of punctuation in scan scripts.\n */\n{\n  register int ch;\n\n  if (! read_text_integer(file, result, termchar))\n    return FALSE;\n  ch = *termchar;\n  while (ch != EOF && isspace(ch))\n    ch = text_getc(file);\n  if (isdigit(ch)) {            /* oops, put it back */\n    if (ungetc(ch, file) == EOF)\n      return FALSE;\n    ch = ' ';\n  } else {\n    /* Any separators other than ';' and ':' are ignored;\n     * this allows user to insert commas, etc, if desired.\n     */\n    if (ch != EOF && ch != ';' && ch != ':')\n      ch = ' ';\n  }\n  *termchar = ch;\n  return TRUE;\n}\n\n\nGLOBAL(boolean)\nread_scan_script (j_compress_ptr cinfo, char *filename)\n/* Read a scan script from the specified text file.\n * Each entry in the file defines one scan to be emitted.\n * Entries are separated by semicolons ';'.\n * An entry contains one to four component indexes,\n * optionally followed by a colon ':' and four progressive-JPEG parameters.\n * The component indexes denote which component(s) are to be transmitted\n * in the current scan.  The first component has index 0.\n * Sequential JPEG is used if the progressive-JPEG parameters are omitted.\n * The file is free format text: any whitespace may appear between numbers\n * and the ':' and ';' punctuation marks.  Also, other punctuation (such\n * as commas or dashes) can be placed between numbers if desired.\n * Comments preceded by '#' may be included in the file.\n * Note: we do very little validity checking here;\n * jcmaster.c will validate the script parameters.\n */\n{\n  FILE *fp;\n  int scanno, ncomps, termchar;\n  long val;\n  jpeg_scan_info *scanptr;\n#define MAX_SCANS  100          /* quite arbitrary limit */\n  jpeg_scan_info scans[MAX_SCANS];\n\n  if ((fp = fopen(filename, \"r\")) == NULL) {\n    fprintf(stderr, \"Can't open scan definition file %s\\n\", filename);\n    return FALSE;\n  }\n  scanptr = scans;\n  scanno = 0;\n\n  while (read_scan_integer(fp, &val, &termchar)) {\n    if (scanno >= MAX_SCANS) {\n      fprintf(stderr, \"Too many scans defined in file %s\\n\", filename);\n      fclose(fp);\n      return FALSE;\n    }\n    scanptr->component_index[0] = (int) val;\n    ncomps = 1;\n    while (termchar == ' ') {\n      if (ncomps >= MAX_COMPS_IN_SCAN) {\n        fprintf(stderr, \"Too many components in one scan in file %s\\n\",\n                filename);\n        fclose(fp);\n        return FALSE;\n      }\n      if (! read_scan_integer(fp, &val, &termchar))\n        goto bogus;\n      scanptr->component_index[ncomps] = (int) val;\n      ncomps++;\n    }\n    scanptr->comps_in_scan = ncomps;\n    if (termchar == ':') {\n      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')\n        goto bogus;\n      scanptr->Ss = (int) val;\n      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')\n        goto bogus;\n      scanptr->Se = (int) val;\n      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')\n        goto bogus;\n      scanptr->Ah = (int) val;\n      if (! read_scan_integer(fp, &val, &termchar))\n        goto bogus;\n      scanptr->Al = (int) val;\n    } else {\n      /* set non-progressive parameters */\n      scanptr->Ss = 0;\n      scanptr->Se = DCTSIZE2-1;\n      scanptr->Ah = 0;\n      scanptr->Al = 0;\n    }\n    if (termchar != ';' && termchar != EOF) {\nbogus:\n      fprintf(stderr, \"Invalid scan entry format in file %s\\n\", filename);\n      fclose(fp);\n      return FALSE;\n    }\n    scanptr++, scanno++;\n  }\n\n  if (termchar != EOF) {\n    fprintf(stderr, \"Non-numeric data in file %s\\n\", filename);\n    fclose(fp);\n    return FALSE;\n  }\n\n  if (scanno > 0) {\n    /* Stash completed scan list in cinfo structure.\n     * NOTE: for cjpeg's use, JPOOL_IMAGE is the right lifetime for this data,\n     * but if you want to compress multiple images you'd want JPOOL_PERMANENT.\n     */\n    scanptr = (jpeg_scan_info *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  scanno * sizeof(jpeg_scan_info));\n    MEMCOPY(scanptr, scans, scanno * sizeof(jpeg_scan_info));\n    cinfo->scan_info = scanptr;\n    cinfo->num_scans = scanno;\n  }\n\n  fclose(fp);\n  return TRUE;\n}\n\n#endif /* C_MULTISCAN_FILES_SUPPORTED */\n\n\n#if JPEG_LIB_VERSION < 70\n/* These are the sample quantization tables given in JPEG spec section K.1.\n * The spec says that the values given produce \"good\" quality, and\n * when divided by 2, \"very good\" quality.\n */\nstatic const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {\n  16,  11,  10,  16,  24,  40,  51,  61,\n  12,  12,  14,  19,  26,  58,  60,  55,\n  14,  13,  16,  24,  40,  57,  69,  56,\n  14,  17,  22,  29,  51,  87,  80,  62,\n  18,  22,  37,  56,  68, 109, 103,  77,\n  24,  35,  55,  64,  81, 104, 113,  92,\n  49,  64,  78,  87, 103, 121, 120, 101,\n  72,  92,  95,  98, 112, 100, 103,  99\n};\nstatic const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {\n  17,  18,  24,  47,  99,  99,  99,  99,\n  18,  21,  26,  66,  99,  99,  99,  99,\n  24,  26,  56,  99,  99,  99,  99,  99,\n  47,  66,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99\n};\n\n\nLOCAL(void)\njpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)\n{\n  jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,\n                       q_scale_factor[0], force_baseline);\n  jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,\n                       q_scale_factor[1], force_baseline);\n}\n#endif\n\n\nGLOBAL(boolean)\nset_quality_ratings (j_compress_ptr cinfo, char *arg, boolean force_baseline)\n/* Process a quality-ratings parameter string, of the form\n *     N[,N,...]\n * If there are more q-table slots than parameters, the last value is replicated.\n */\n{\n  int val = 75;                 /* default value */\n  int tblno;\n  char ch;\n\n  for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {\n    if (*arg) {\n      ch = ',';                 /* if not set by sscanf, will be ',' */\n      if (sscanf(arg, \"%d%c\", &val, &ch) < 1)\n        return FALSE;\n      if (ch != ',')            /* syntax check */\n        return FALSE;\n      /* Convert user 0-100 rating to percentage scaling */\n#if JPEG_LIB_VERSION >= 70\n      cinfo->q_scale_factor[tblno] = jpeg_quality_scaling(val);\n#else\n      q_scale_factor[tblno] = jpeg_quality_scaling(val);\n#endif\n      while (*arg && *arg++ != ',') /* advance to next segment of arg string */\n        ;\n    } else {\n      /* reached end of parameter, set remaining factors to last value */\n#if JPEG_LIB_VERSION >= 70\n      cinfo->q_scale_factor[tblno] = jpeg_quality_scaling(val);\n#else\n      q_scale_factor[tblno] = jpeg_quality_scaling(val);\n#endif\n    }\n  }\n  jpeg_default_qtables(cinfo, force_baseline);\n  return TRUE;\n}\n\n\nGLOBAL(boolean)\nset_quant_slots (j_compress_ptr cinfo, char *arg)\n/* Process a quantization-table-selectors parameter string, of the form\n *     N[,N,...]\n * If there are more components than parameters, the last value is replicated.\n */\n{\n  int val = 0;                  /* default table # */\n  int ci;\n  char ch;\n\n  for (ci = 0; ci < MAX_COMPONENTS; ci++) {\n    if (*arg) {\n      ch = ',';                 /* if not set by sscanf, will be ',' */\n      if (sscanf(arg, \"%d%c\", &val, &ch) < 1)\n        return FALSE;\n      if (ch != ',')            /* syntax check */\n        return FALSE;\n      if (val < 0 || val >= NUM_QUANT_TBLS) {\n        fprintf(stderr, \"JPEG quantization tables are numbered 0..%d\\n\",\n                NUM_QUANT_TBLS-1);\n        return FALSE;\n      }\n      cinfo->comp_info[ci].quant_tbl_no = val;\n      while (*arg && *arg++ != ',') /* advance to next segment of arg string */\n        ;\n    } else {\n      /* reached end of parameter, set remaining components to last table */\n      cinfo->comp_info[ci].quant_tbl_no = val;\n    }\n  }\n  return TRUE;\n}\n\n\nGLOBAL(boolean)\nset_sample_factors (j_compress_ptr cinfo, char *arg)\n/* Process a sample-factors parameter string, of the form\n *     HxV[,HxV,...]\n * If there are more components than parameters, \"1x1\" is assumed for the rest.\n */\n{\n  int ci, val1, val2;\n  char ch1, ch2;\n\n  for (ci = 0; ci < MAX_COMPONENTS; ci++) {\n    if (*arg) {\n      ch2 = ',';                /* if not set by sscanf, will be ',' */\n      if (sscanf(arg, \"%d%c%d%c\", &val1, &ch1, &val2, &ch2) < 3)\n        return FALSE;\n      if ((ch1 != 'x' && ch1 != 'X') || ch2 != ',') /* syntax check */\n        return FALSE;\n      if (val1 <= 0 || val1 > 4 || val2 <= 0 || val2 > 4) {\n        fprintf(stderr, \"JPEG sampling factors must be 1..4\\n\");\n        return FALSE;\n      }\n      cinfo->comp_info[ci].h_samp_factor = val1;\n      cinfo->comp_info[ci].v_samp_factor = val2;\n      while (*arg && *arg++ != ',') /* advance to next segment of arg string */\n        ;\n    } else {\n      /* reached end of parameter, set remaining components to 1x1 sampling */\n      cinfo->comp_info[ci].h_samp_factor = 1;\n      cinfo->comp_info[ci].v_samp_factor = 1;\n    }\n  }\n  return TRUE;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/rdtarga.c",
    "content": "/*\n * rdtarga.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains routines to read input images in Targa format.\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume input from\n * an ordinary stdio stream.  They further assume that reading begins\n * at the start of the file; start_input may need work if the\n * user interface has already read some data (e.g., to determine that\n * the file is indeed Targa format).\n *\n * Based on code contributed by Lee Daniel Crocker.\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n\n#ifdef TARGA_SUPPORTED\n\n\n/* Macros to deal with unsigned chars as efficiently as compiler allows */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char U_CHAR;\n#define UCH(x)  ((int) (x))\n#else /* !HAVE_UNSIGNED_CHAR */\n#ifdef __CHAR_UNSIGNED__\ntypedef char U_CHAR;\n#define UCH(x)  ((int) (x))\n#else\ntypedef char U_CHAR;\n#define UCH(x)  ((int) (x) & 0xFF)\n#endif\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n#define ReadOK(file,buffer,len) (JFREAD(file,buffer,len) == ((size_t) (len)))\n\n\n/* Private version of data source object */\n\ntypedef struct _tga_source_struct *tga_source_ptr;\n\ntypedef struct _tga_source_struct {\n  struct cjpeg_source_struct pub; /* public fields */\n\n  j_compress_ptr cinfo;         /* back link saves passing separate parm */\n\n  JSAMPARRAY colormap;          /* Targa colormap (converted to my format) */\n\n  jvirt_sarray_ptr whole_image; /* Needed if funny input row order */\n  JDIMENSION current_row;       /* Current logical row number to read */\n\n  /* Pointer to routine to extract next Targa pixel from input file */\n  void (*read_pixel) (tga_source_ptr sinfo);\n\n  /* Result of read_pixel is delivered here: */\n  U_CHAR tga_pixel[4];\n\n  int pixel_size;               /* Bytes per Targa pixel (1 to 4) */\n\n  /* State info for reading RLE-coded pixels; both counts must be init to 0 */\n  int block_count;              /* # of pixels remaining in RLE block */\n  int dup_pixel_count;          /* # of times to duplicate previous pixel */\n\n  /* This saves the correct pixel-row-expansion method for preload_image */\n  JDIMENSION (*get_pixel_rows) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo);\n} tga_source_struct;\n\n\n/* For expanding 5-bit pixel values to 8-bit with best rounding */\n\nstatic const UINT8 c5to8bits[32] = {\n    0,   8,  16,  25,  33,  41,  49,  58,\n   66,  74,  82,  90,  99, 107, 115, 123,\n  132, 140, 148, 156, 165, 173, 181, 189,\n  197, 206, 214, 222, 230, 239, 247, 255\n};\n\n\n\nLOCAL(int)\nread_byte (tga_source_ptr sinfo)\n/* Read next byte from Targa file */\n{\n  register FILE *infile = sinfo->pub.input_file;\n  register int c;\n\n  if ((c = getc(infile)) == EOF)\n    ERREXIT(sinfo->cinfo, JERR_INPUT_EOF);\n  return c;\n}\n\n\nLOCAL(void)\nread_colormap (tga_source_ptr sinfo, int cmaplen, int mapentrysize)\n/* Read the colormap from a Targa file */\n{\n  int i;\n\n  /* Presently only handles 24-bit BGR format */\n  if (mapentrysize != 24)\n    ERREXIT(sinfo->cinfo, JERR_TGA_BADCMAP);\n\n  for (i = 0; i < cmaplen; i++) {\n    sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);\n    sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);\n    sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);\n  }\n}\n\n\n/*\n * read_pixel methods: get a single pixel from Targa file into tga_pixel[]\n */\n\nMETHODDEF(void)\nread_non_rle_pixel (tga_source_ptr sinfo)\n/* Read one Targa pixel from the input file; no RLE expansion */\n{\n  register FILE *infile = sinfo->pub.input_file;\n  register int i;\n\n  for (i = 0; i < sinfo->pixel_size; i++) {\n    sinfo->tga_pixel[i] = (U_CHAR) getc(infile);\n  }\n}\n\n\nMETHODDEF(void)\nread_rle_pixel (tga_source_ptr sinfo)\n/* Read one Targa pixel from the input file, expanding RLE data as needed */\n{\n  register FILE *infile = sinfo->pub.input_file;\n  register int i;\n\n  /* Duplicate previously read pixel? */\n  if (sinfo->dup_pixel_count > 0) {\n    sinfo->dup_pixel_count--;\n    return;\n  }\n\n  /* Time to read RLE block header? */\n  if (--sinfo->block_count < 0) { /* decrement pixels remaining in block */\n    i = read_byte(sinfo);\n    if (i & 0x80) {             /* Start of duplicate-pixel block? */\n      sinfo->dup_pixel_count = i & 0x7F; /* number of dups after this one */\n      sinfo->block_count = 0;   /* then read new block header */\n    } else {\n      sinfo->block_count = i & 0x7F; /* number of pixels after this one */\n    }\n  }\n\n  /* Read next pixel */\n  for (i = 0; i < sinfo->pixel_size; i++) {\n    sinfo->tga_pixel[i] = (U_CHAR) getc(infile);\n  }\n}\n\n\n/*\n * Read one row of pixels.\n *\n * We provide several different versions depending on input file format.\n */\n\n\nMETHODDEF(JDIMENSION)\nget_8bit_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 8-bit grayscale pixels */\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n\n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */\n    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[0]);\n  }\n  return 1;\n}\n\nMETHODDEF(JDIMENSION)\nget_8bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 8-bit colormap indexes */\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  register int t;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n  register JSAMPARRAY colormap = source->colormap;\n\n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */\n    t = UCH(source->tga_pixel[0]);\n    *ptr++ = colormap[0][t];\n    *ptr++ = colormap[1][t];\n    *ptr++ = colormap[2][t];\n  }\n  return 1;\n}\n\nMETHODDEF(JDIMENSION)\nget_16bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 16-bit pixels */\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  register int t;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n\n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */\n    t = UCH(source->tga_pixel[0]);\n    t += UCH(source->tga_pixel[1]) << 8;\n    /* We expand 5 bit data to 8 bit sample width.\n     * The format of the 16-bit (LSB first) input word is\n     *     xRRRRRGGGGGBBBBB\n     */\n    ptr[2] = (JSAMPLE) c5to8bits[t & 0x1F];\n    t >>= 5;\n    ptr[1] = (JSAMPLE) c5to8bits[t & 0x1F];\n    t >>= 5;\n    ptr[0] = (JSAMPLE) c5to8bits[t & 0x1F];\n    ptr += 3;\n  }\n  return 1;\n}\n\nMETHODDEF(JDIMENSION)\nget_24bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 24-bit pixels */\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n\n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */\n    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[2]); /* change BGR to RGB order */\n    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[1]);\n    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[0]);\n  }\n  return 1;\n}\n\n/*\n * Targa also defines a 32-bit pixel format with order B,G,R,A.\n * We presently ignore the attribute byte, so the code for reading\n * these pixels is identical to the 24-bit routine above.\n * This works because the actual pixel length is only known to read_pixel.\n */\n\n#define get_32bit_row  get_24bit_row\n\n\n/*\n * This method is for re-reading the input data in standard top-down\n * row order.  The entire image has already been read into whole_image\n * with proper conversion of pixel format, but it's in a funny row order.\n */\n\nMETHODDEF(JDIMENSION)\nget_memory_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  JDIMENSION source_row;\n\n  /* Compute row of source that maps to current_row of normal order */\n  /* For now, assume image is bottom-up and not interlaced. */\n  /* NEEDS WORK to support interlaced images! */\n  source_row = cinfo->image_height - source->current_row - 1;\n\n  /* Fetch that row from virtual array */\n  source->pub.buffer = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->whole_image,\n     source_row, (JDIMENSION) 1, FALSE);\n\n  source->current_row++;\n  return 1;\n}\n\n\n/*\n * This method loads the image into whole_image during the first call on\n * get_pixel_rows.  The get_pixel_rows pointer is then adjusted to call\n * get_memory_row on subsequent calls.\n */\n\nMETHODDEF(JDIMENSION)\npreload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  JDIMENSION row;\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n\n  /* Read the data into a virtual array in input-file row order. */\n  for (row = 0; row < cinfo->image_height; row++) {\n    if (progress != NULL) {\n      progress->pub.pass_counter = (long) row;\n      progress->pub.pass_limit = (long) cinfo->image_height;\n      (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n    }\n    source->pub.buffer = (*cinfo->mem->access_virt_sarray)\n      ((j_common_ptr) cinfo, source->whole_image, row, (JDIMENSION) 1, TRUE);\n    (*source->get_pixel_rows) (cinfo, sinfo);\n  }\n  if (progress != NULL)\n    progress->completed_extra_passes++;\n\n  /* Set up to read from the virtual array in unscrambled order */\n  source->pub.get_pixel_rows = get_memory_row;\n  source->current_row = 0;\n  /* And read the first row */\n  return get_memory_row(cinfo, sinfo);\n}\n\n\n/*\n * Read the file header; return image size and component count.\n */\n\nMETHODDEF(void)\nstart_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  U_CHAR targaheader[18];\n  int idlen, cmaptype, subtype, flags, interlace_type, components;\n  unsigned int width, height, maplen;\n  boolean is_bottom_up;\n\n#define GET_2B(offset)  ((unsigned int) UCH(targaheader[offset]) + \\\n                         (((unsigned int) UCH(targaheader[offset+1])) << 8))\n\n  if (! ReadOK(source->pub.input_file, targaheader, 18))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n\n  /* Pretend \"15-bit\" pixels are 16-bit --- we ignore attribute bit anyway */\n  if (targaheader[16] == 15)\n    targaheader[16] = 16;\n\n  idlen = UCH(targaheader[0]);\n  cmaptype = UCH(targaheader[1]);\n  subtype = UCH(targaheader[2]);\n  maplen = GET_2B(5);\n  width = GET_2B(12);\n  height = GET_2B(14);\n  source->pixel_size = UCH(targaheader[16]) >> 3;\n  flags = UCH(targaheader[17]); /* Image Descriptor byte */\n\n  is_bottom_up = ((flags & 0x20) == 0); /* bit 5 set => top-down */\n  interlace_type = flags >> 6;  /* bits 6/7 are interlace code */\n\n  if (cmaptype > 1 ||           /* cmaptype must be 0 or 1 */\n      source->pixel_size < 1 || source->pixel_size > 4 ||\n      (UCH(targaheader[16]) & 7) != 0 || /* bits/pixel must be multiple of 8 */\n      interlace_type != 0 ||      /* currently don't allow interlaced image */\n      width == 0 || height == 0)  /* image width/height must be non-zero */\n    ERREXIT(cinfo, JERR_TGA_BADPARMS);\n\n  if (subtype > 8) {\n    /* It's an RLE-coded file */\n    source->read_pixel = read_rle_pixel;\n    source->block_count = source->dup_pixel_count = 0;\n    subtype -= 8;\n  } else {\n    /* Non-RLE file */\n    source->read_pixel = read_non_rle_pixel;\n  }\n\n  /* Now should have subtype 1, 2, or 3 */\n  components = 3;               /* until proven different */\n  cinfo->in_color_space = JCS_RGB;\n\n  switch (subtype) {\n  case 1:                       /* Colormapped image */\n    if (source->pixel_size == 1 && cmaptype == 1)\n      source->get_pixel_rows = get_8bit_row;\n    else\n      ERREXIT(cinfo, JERR_TGA_BADPARMS);\n    TRACEMS2(cinfo, 1, JTRC_TGA_MAPPED, width, height);\n    break;\n  case 2:                       /* RGB image */\n    switch (source->pixel_size) {\n    case 2:\n      source->get_pixel_rows = get_16bit_row;\n      break;\n    case 3:\n      source->get_pixel_rows = get_24bit_row;\n      break;\n    case 4:\n      source->get_pixel_rows = get_32bit_row;\n      break;\n    default:\n      ERREXIT(cinfo, JERR_TGA_BADPARMS);\n      break;\n    }\n    TRACEMS2(cinfo, 1, JTRC_TGA, width, height);\n    break;\n  case 3:                       /* Grayscale image */\n    components = 1;\n    cinfo->in_color_space = JCS_GRAYSCALE;\n    if (source->pixel_size == 1)\n      source->get_pixel_rows = get_8bit_gray_row;\n    else\n      ERREXIT(cinfo, JERR_TGA_BADPARMS);\n    TRACEMS2(cinfo, 1, JTRC_TGA_GRAY, width, height);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_TGA_BADPARMS);\n    break;\n  }\n\n  if (is_bottom_up) {\n    /* Create a virtual array to buffer the upside-down image. */\n    source->whole_image = (*cinfo->mem->request_virt_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n       (JDIMENSION) width * components, (JDIMENSION) height, (JDIMENSION) 1);\n    if (cinfo->progress != NULL) {\n      cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n      progress->total_extra_passes++; /* count file input as separate pass */\n    }\n    /* source->pub.buffer will point to the virtual array. */\n    source->pub.buffer_height = 1; /* in case anyone looks at it */\n    source->pub.get_pixel_rows = preload_image;\n  } else {\n    /* Don't need a virtual array, but do need a one-row input buffer. */\n    source->whole_image = NULL;\n    source->pub.buffer = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (JDIMENSION) width * components, (JDIMENSION) 1);\n    source->pub.buffer_height = 1;\n    source->pub.get_pixel_rows = source->get_pixel_rows;\n  }\n\n  while (idlen--)               /* Throw away ID field */\n    (void) read_byte(source);\n\n  if (maplen > 0) {\n    if (maplen > 256 || GET_2B(3) != 0)\n      ERREXIT(cinfo, JERR_TGA_BADCMAP);\n    /* Allocate space to store the colormap */\n    source->colormap = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE, (JDIMENSION) maplen, (JDIMENSION) 3);\n    /* and read it from the file */\n    read_colormap(source, (int) maplen, UCH(targaheader[7]));\n  } else {\n    if (cmaptype)               /* but you promised a cmap! */\n      ERREXIT(cinfo, JERR_TGA_BADPARMS);\n    source->colormap = NULL;\n  }\n\n  cinfo->input_components = components;\n  cinfo->data_precision = 8;\n  cinfo->image_width = width;\n  cinfo->image_height = height;\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  /* no work */\n}\n\n\n/*\n * The module selection routine for Targa format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_targa (j_compress_ptr cinfo)\n{\n  tga_source_ptr source;\n\n  /* Create module interface object */\n  source = (tga_source_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(tga_source_struct));\n  source->cinfo = cinfo;        /* make back link for subroutines */\n  /* Fill in method ptrs, except get_pixel_rows which start_input sets */\n  source->pub.start_input = start_input_tga;\n  source->pub.finish_input = finish_input_tga;\n\n  return (cjpeg_source_ptr) source;\n}\n\n#endif /* TARGA_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/release/Distribution.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<installer-gui-script minSpecVersion=\"1\">\n\t<title>libjpeg-turbo</title>\n\t<welcome file=\"Welcome.rtf\" />\n\t<readme file=\"ReadMe.txt\" />\n\t<license file=\"License.rtf\" />\n\t<domains\n\t\tenable_anywhere=\"false\"\n\t\tenable_currentUserHome=\"false\"\n\t\tenable_localSystem=\"true\"\n\t/>\n\t<options customize=\"never\" />\n\t<choices-outline>\n\t\t<line choice=\"default\">\n\t\t\t<line choice=\"com.libjpeg-turbo.libjpeg-turbo\"/>\n\t\t</line>\n\t</choices-outline>\n\t<choice id=\"default\"/>\n\t<choice id=\"com.libjpeg-turbo.libjpeg-turbo\" visible=\"false\">\n\t\t<pkg-ref id=\"com.libjpeg-turbo.libjpeg-turbo\"/>\n\t</choice>\n\t<pkg-ref auth=\"root\"\n\t\tid=\"com.libjpeg-turbo.libjpeg-turbo\">libjpeg-turbo.pkg</pkg-ref>\n</installer-gui-script>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/release/License.rtf",
    "content": "{\\rtf1\\ansi\\ansicpg1252\\cocoartf1038\\cocoasubrtf350\n{\\fonttbl\\f0\\fswiss\\fcharset0 Helvetica;}\n{\\colortbl;\\red255\\green255\\blue255;}\n{\\*\\listtable{\\list\\listtemplateid1\\listhybrid{\\listlevel\\levelnfc23\\levelnfcn23\\leveljc0\\leveljcn0\\levelfollow0\\levelstartat1\\levelspace360\\levelindent0{\\*\\levelmarker \\{disc\\}}{\\leveltext\\leveltemplateid1\\'01\\uc0\\u8226 ;}{\\levelnumbers;}\\fi-360\\li720\\lin720 }{\\listname ;}\\listid1}}\n{\\*\\listoverridetable{\\listoverride\\listid1\\listoverridecount0\\ls1}}\n\\margl1440\\margr1440\\vieww9820\\viewh8480\\viewkind0\n\\deftab720\n\\pard\\pardeftab720\n\n\\f0\\fs24 \\cf0 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\\\n\\\n\\pard\\tx220\\tx720\\pardeftab720\\li720\\fi-720\n\\ls1\\ilvl0\\cf0 {\\listtext\t\\'95\t}Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\\\n{\\listtext\t\\'95\t}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.\\\n{\\listtext\t\\'95\t}Neither the name of the libjpeg-turbo Project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\\\n\\pard\\pardeftab720\\qc\n\\cf0 \\\n\\pard\\pardeftab720\n\\cf0 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\", AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS 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.\\\n}"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/release/ReadMe.txt",
    "content": "libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression on x86, x86-64, ARM, and PowerPC systems.  On such systems, libjpeg-turbo is generally 2-6x as fast as libjpeg, all else being equal.  On other types of systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by virtue of its highly-optimized Huffman coding routines.  In many cases, the performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.\n\nlibjpeg-turbo implements both the traditional libjpeg API as well as the less powerful but more straightforward TurboJPEG API.  libjpeg-turbo also features colorspace extensions that allow it to compress from/decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java interface.\n\nlibjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated derivative of libjpeg v6b developed by Miyasaka Masaru.  The TigerVNC and VirtualGL projects made numerous enhancements to the codec in 2009, and in early 2010, libjpeg-turbo spun off into an independent project, with the goal of making high-speed JPEG compression/decompression technology available to a broader range of users and developers.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/release/Welcome.rtf",
    "content": "{\\rtf1\\ansi\\ansicpg1252\\cocoartf1038\\cocoasubrtf360\n{\\fonttbl\\f0\\fswiss\\fcharset0 Helvetica;\\f1\\fmodern\\fcharset0 CourierNewPSMT;}\n{\\colortbl;\\red255\\green255\\blue255;}\n\\margl1440\\margr1440\\vieww9000\\viewh8400\\viewkind0\n\\deftab720\n\\pard\\pardeftab720\\ql\\qnatural\n\n\\f0\\fs24 \\cf0 This installer will install the libjpeg-turbo SDK and run-time libraries onto your computer so that you can use libjpeg-turbo to build new applications or accelerate existing ones.  To remove the libjpeg-turbo package, run\\\n\\\n\\pard\\pardeftab720\\ql\\qnatural\n\n\\f1 \\cf0   /opt/libjpeg-turbo/bin/uninstall\\\n\\pard\\pardeftab720\\ql\\qnatural\n\n\\f0 \\cf0 \\\nfrom the command line.\\\n}"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/release/deb-control.tmpl",
    "content": "Package: {__PKGNAME}\nVersion: {__VERSION}-{__BUILD}\nSection: misc\nPriority: optional\nArchitecture: {__ARCH}\nEssential: no\nMaintainer: The libjpeg-turbo Project <information@libjpeg-turbo.org>\nHomepage: http://www.libjpeg-turbo.org\nInstalled-Size: {__SIZE}\nDescription: A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs\n libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,\n NEON, AltiVec) to accelerate baseline JPEG compression and decompression on\n x86, x86-64, ARM, and PowerPC systems.  On such systems, libjpeg-turbo is\n generally 2-6x as fast as libjpeg, all else being equal.  On other types of\n systems, libjpeg-turbo can still outperform libjpeg by a significant amount,\n by virtue of its highly-optimized Huffman coding routines.  In many cases, the\n performance of libjpeg-turbo rivals that of proprietary high-speed JPEG\n codecs.\n .\n libjpeg-turbo implements both the traditional libjpeg API as well as the less\n powerful but more straightforward TurboJPEG API.  libjpeg-turbo also features\n colorspace extensions that allow it to compress from/decompress to 32-bit and\n big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java\n interface.\n .\n libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated\n derivative of libjpeg v6b developed by Miyasaka Masaru.  The TigerVNC and\n VirtualGL projects made numerous enhancements to the codec in 2009, and in\n early 2010, libjpeg-turbo spun off into an independent project, with the goal\n of making high-speed JPEG compression/decompression technology available to a\n broader range of users and developers.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/release/libjpeg-turbo.nsi.in",
    "content": "!include x64.nsh\nName \"@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@\"\nOutFile \"@CMAKE_BINARY_DIR@\\${BUILDDIR}@INST_NAME@.exe\"\nInstallDir @INST_DIR@\n\nSetCompressor bzip2\n\nPage directory\nPage instfiles\n\nUninstPage uninstConfirm\nUninstPage instfiles\n\nSection \"@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ (required)\"\n!ifdef WIN64\n\t${If} ${RunningX64}\n\t${DisableX64FSRedirection}\n\t${Endif}\n!endif\n\tSectionIn RO\n!ifdef GCC\n\tIfFileExists $SYSDIR/libturbojpeg.dll exists 0\n!else\n\tIfFileExists $SYSDIR/turbojpeg.dll exists 0\n!endif\n\tgoto notexists\n\texists:\n!ifdef GCC\n\tMessageBox MB_OK \"An existing version of the @CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ is already installed.  Please uninstall it first.\"\n!else\n\tMessageBox MB_OK \"An existing version of the @CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ or the TurboJPEG SDK is already installed.  Please uninstall it first.\"\n!endif\n\tquit\n\n\tnotexists:\n\tSetOutPath $SYSDIR\n!ifdef GCC\n\tFile \"@CMAKE_BINARY_DIR@\\libturbojpeg.dll\"\n!else\n\tFile \"@CMAKE_BINARY_DIR@\\${BUILDDIR}turbojpeg.dll\"\n!endif\n\tSetOutPath $INSTDIR\\bin\n!ifdef GCC\n\tFile \"@CMAKE_BINARY_DIR@\\libturbojpeg.dll\"\n!else\n\tFile \"@CMAKE_BINARY_DIR@\\${BUILDDIR}turbojpeg.dll\"\n!endif\n!ifdef GCC\n\tFile \"/oname=libjpeg-@DLL_VERSION@.dll\" \"@CMAKE_BINARY_DIR@\\sharedlib\\libjpeg-*.dll\"\n!else\n\tFile \"@CMAKE_BINARY_DIR@\\sharedlib\\${BUILDDIR}jpeg@DLL_VERSION@.dll\"\n!endif\n\tFile \"@CMAKE_BINARY_DIR@\\sharedlib\\${BUILDDIR}cjpeg.exe\"\n\tFile \"@CMAKE_BINARY_DIR@\\sharedlib\\${BUILDDIR}djpeg.exe\"\n\tFile \"@CMAKE_BINARY_DIR@\\sharedlib\\${BUILDDIR}jpegtran.exe\"\n\tFile \"@CMAKE_BINARY_DIR@\\${BUILDDIR}tjbench.exe\"\n\tFile \"@CMAKE_BINARY_DIR@\\${BUILDDIR}rdjpgcom.exe\"\n\tFile \"@CMAKE_BINARY_DIR@\\${BUILDDIR}wrjpgcom.exe\"\n\tSetOutPath $INSTDIR\\lib\n!ifdef GCC\n\tFile \"@CMAKE_BINARY_DIR@\\libturbojpeg.dll.a\"\n\tFile \"@CMAKE_BINARY_DIR@\\libturbojpeg.a\"\n\tFile \"@CMAKE_BINARY_DIR@\\sharedlib\\libjpeg.dll.a\"\n\tFile \"@CMAKE_BINARY_DIR@\\libjpeg.a\"\n!else\n\tFile \"@CMAKE_BINARY_DIR@\\${BUILDDIR}turbojpeg.lib\"\n\tFile \"@CMAKE_BINARY_DIR@\\${BUILDDIR}turbojpeg-static.lib\"\n\tFile \"@CMAKE_BINARY_DIR@\\sharedlib\\${BUILDDIR}jpeg.lib\"\n\tFile \"@CMAKE_BINARY_DIR@\\${BUILDDIR}jpeg-static.lib\"\n!endif\n!ifdef JAVA\n\tSetOutPath $INSTDIR\\classes\n\tFile \"@CMAKE_BINARY_DIR@\\java\\${BUILDDIR}turbojpeg.jar\"\n!endif\n\tSetOutPath $INSTDIR\\include\n\tFile \"@CMAKE_BINARY_DIR@\\jconfig.h\"\n\tFile \"@CMAKE_SOURCE_DIR@\\jerror.h\"\n\tFile \"@CMAKE_SOURCE_DIR@\\jmorecfg.h\"\n\tFile \"@CMAKE_SOURCE_DIR@\\jpeglib.h\"\n\tFile \"@CMAKE_SOURCE_DIR@\\turbojpeg.h\"\n\tSetOutPath $INSTDIR\\doc\n\tFile \"@CMAKE_SOURCE_DIR@\\README.ijg\"\n\tFile \"@CMAKE_SOURCE_DIR@\\README.md\"\n\tFile \"@CMAKE_SOURCE_DIR@\\LICENSE.md\"\n\tFile \"@CMAKE_SOURCE_DIR@\\example.c\"\n\tFile \"@CMAKE_SOURCE_DIR@\\libjpeg.txt\"\n\tFile \"@CMAKE_SOURCE_DIR@\\structure.txt\"\n\tFile \"@CMAKE_SOURCE_DIR@\\usage.txt\"\n\tFile \"@CMAKE_SOURCE_DIR@\\wizard.txt\"\n\n\tWriteRegStr HKLM \"SOFTWARE\\@INST_REG_NAME@ @VERSION@\" \"Install_Dir\" \"$INSTDIR\"\n\n\tWriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\@INST_REG_NAME@ @VERSION@\" \"DisplayName\" \"@CMAKE_PROJECT_NAME@ SDK v@VERSION@ for @INST_PLATFORM@\"\n\tWriteRegStr HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\@INST_REG_NAME@ @VERSION@\" \"UninstallString\" '\"$INSTDIR\\uninstall_@VERSION@.exe\"'\n\tWriteRegDWORD HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\@INST_REG_NAME@ @VERSION@\" \"NoModify\" 1\n\tWriteRegDWORD HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\@INST_REG_NAME@ @VERSION@\" \"NoRepair\" 1\n\tWriteUninstaller \"uninstall_@VERSION@.exe\"\nSectionEnd\n\nSection \"Uninstall\"\n!ifdef WIN64\n\t${If} ${RunningX64}\n\t${DisableX64FSRedirection}\n\t${Endif}\n!endif\n\n\tSetShellVarContext all\n\n\tDeleteRegKey HKLM \"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\@INST_REG_NAME@ @VERSION@\"\n\tDeleteRegKey HKLM \"SOFTWARE\\@INST_REG_NAME@ @VERSION@\"\n\n!ifdef GCC\n\tDelete $INSTDIR\\bin\\libjpeg-@DLL_VERSION@.dll\n\tDelete $INSTDIR\\bin\\libturbojpeg.dll\n\tDelete $SYSDIR\\libturbojpeg.dll\n\tDelete $INSTDIR\\lib\\libturbojpeg.dll.a\"\n\tDelete $INSTDIR\\lib\\libturbojpeg.a\"\n\tDelete $INSTDIR\\lib\\libjpeg.dll.a\"\n\tDelete $INSTDIR\\lib\\libjpeg.a\"\n!else\n\tDelete $INSTDIR\\bin\\jpeg@DLL_VERSION@.dll\n\tDelete $INSTDIR\\bin\\turbojpeg.dll\n\tDelete $SYSDIR\\turbojpeg.dll\n\tDelete $INSTDIR\\lib\\jpeg.lib\n\tDelete $INSTDIR\\lib\\jpeg-static.lib\n\tDelete $INSTDIR\\lib\\turbojpeg.lib\n\tDelete $INSTDIR\\lib\\turbojpeg-static.lib\n!endif\n!ifdef JAVA\n\tDelete $INSTDIR\\classes\\turbojpeg.jar\n!endif\n\tDelete $INSTDIR\\bin\\cjpeg.exe\n\tDelete $INSTDIR\\bin\\djpeg.exe\n\tDelete $INSTDIR\\bin\\jpegtran.exe\n\tDelete $INSTDIR\\bin\\tjbench.exe\n\tDelete $INSTDIR\\bin\\rdjpgcom.exe\n\tDelete $INSTDIR\\bin\\wrjpgcom.exe\n\tDelete $INSTDIR\\include\\jconfig.h\"\n\tDelete $INSTDIR\\include\\jerror.h\"\n\tDelete $INSTDIR\\include\\jmorecfg.h\"\n\tDelete $INSTDIR\\include\\jpeglib.h\"\n\tDelete $INSTDIR\\include\\turbojpeg.h\"\n\tDelete $INSTDIR\\uninstall_@VERSION@.exe\n\tDelete $INSTDIR\\doc\\README.ijg\n\tDelete $INSTDIR\\doc\\README.md\n\tDelete $INSTDIR\\doc\\LICENSE.md\n\tDelete $INSTDIR\\doc\\example.c\n\tDelete $INSTDIR\\doc\\libjpeg.txt\n\tDelete $INSTDIR\\doc\\structure.txt\n\tDelete $INSTDIR\\doc\\usage.txt\n\tDelete $INSTDIR\\doc\\wizard.txt\n\n\tRMDir \"$INSTDIR\\include\"\n\tRMDir \"$INSTDIR\\lib\"\n\tRMDir \"$INSTDIR\\doc\"\n!ifdef JAVA\n\tRMDir \"$INSTDIR\\classes\"\n!endif\n\tRMDir \"$INSTDIR\\bin\"\n\tRMDir \"$INSTDIR\"\n\nSectionEnd\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/release/libjpeg-turbo.spec.in",
    "content": "# Path under which libjpeg-turbo should be installed\n%define _prefix %{__prefix}\n\n# Path under which executables should be installed\n%define _bindir %{__bindir}\n\n# Path under which Java classes and man pages should be installed\n%define _datadir %{__datadir}\n\n# Path under which docs should be installed\n%define _docdir /usr/share/doc/%{name}-%{version}\n\n# Path under which headers should be installed\n%define _includedir %{__includedir}\n\n# _libdir is set to %{_prefix}/%{_lib} by default\n%ifarch x86_64\n%define _lib lib64\n%else\n%if \"%{_prefix}\" == \"/opt/libjpeg-turbo\"\n%define _lib lib32\n%endif\n%endif\n\n# Path under which man pages should be installed\n%define _mandir %{__mandir}\n\nSummary: A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs\nName: @PKGNAME@\nVersion: @VERSION@\nVendor: The libjpeg-turbo Project\nURL: http://www.libjpeg-turbo.org\nGroup: System Environment/Libraries\n#-->Source0: http://prdownloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-%{version}.tar.gz\nRelease: @BUILD@\nLicense: BSD-style\nBuildRoot: %{_blddir}/%{name}-buildroot-%{version}-%{release}\nPrereq: /sbin/ldconfig\n%ifarch x86_64\nProvides: %{name} = %{version}-%{release}, @PACKAGE_NAME@ = %{version}-%{release}, libturbojpeg.so()(64bit)\n%else\nProvides: %{name} = %{version}-%{release}, @PACKAGE_NAME@ = %{version}-%{release}, libturbojpeg.so\n%endif\n\n%description\nlibjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,\nNEON, AltiVec) to accelerate baseline JPEG compression and decompression on\nx86, x86-64, ARM, and PowerPC systems.  On such systems, libjpeg-turbo is\ngenerally 2-6x as fast as libjpeg, all else being equal.  On other types of\nsystems, libjpeg-turbo can still outperform libjpeg by a significant amount, by\nvirtue of its highly-optimized Huffman coding routines.  In many cases, the\nperformance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.\n\nlibjpeg-turbo implements both the traditional libjpeg API as well as the less\npowerful but more straightforward TurboJPEG API.  libjpeg-turbo also features\ncolorspace extensions that allow it to compress from/decompress to 32-bit and\nbig-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java\ninterface.\n\nlibjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated\nderivative of libjpeg v6b developed by Miyasaka Masaru.  The TigerVNC and\nVirtualGL projects made numerous enhancements to the codec in 2009, and in\nearly 2010, libjpeg-turbo spun off into an independent project, with the goal\nof making high-speed JPEG compression/decompression technology available to a\nbroader range of users and developers.\n\n#-->%prep\n#-->%setup -q -n libjpeg-turbo-%{version}\n\n#-->%build\n#-->./configure prefix=%{_prefix} bindir=%{_bindir} datadir=%{_datadir} \\\n#-->\tdocdir=%{_docdir} includedir=%{_includedir} libdir=%{_libdir} \\\n#-->\tmandir=%{_mandir} JPEG_LIB_VERSION=@JPEG_LIB_VERSION@ \\\n#-->\tSO_MAJOR_VERSION=@SO_MAJOR_VERSION@ SO_MINOR_VERSION=@SO_MINOR_VERSION@ \\\n#-->\t--with-pic @RPM_CONFIG_ARGS@\n#-->make DESTDIR=$RPM_BUILD_ROOT\n\n%install\n\nrm -rf $RPM_BUILD_ROOT\nmake install DESTDIR=$RPM_BUILD_ROOT docdir=%{_docdir} exampledir=%{_docdir}\nrm -f $RPM_BUILD_ROOT%{_libdir}/*.la\n/sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}\n\n#-->%if 0\n\nLJT_LIBDIR=%{__libdir}\nif [ ! \"$LJT_LIBDIR\" = \"%{_libdir}\" ]; then\n\techo ERROR: libjpeg-turbo must be configured with libdir=%{_prefix}/%{_lib} when generating an in-tree RPM for this architecture.\n\texit 1\nfi\n\n#-->%endif\n\nLJT_DOCDIR=%{__docdir}\nif [ \"%{_prefix}\" = \"/opt/libjpeg-turbo\" -a \"$LJT_DOCDIR\" = \"/opt/libjpeg-turbo/doc\" ]; then\n\tln -fs %{_docdir} $RPM_BUILD_ROOT/$LJT_DOCDIR\nfi\n\n%post -p /sbin/ldconfig\n\n%postun -p /sbin/ldconfig\n\n%clean\nrm -rf $RPM_BUILD_ROOT\n\n%files\n%defattr(-,root,root)\n%dir %{_docdir}\n%doc %{_docdir}/*\n%dir %{_prefix}\n%if \"%{_prefix}\" == \"/opt/libjpeg-turbo\" && \"%{_docdir}\" != \"%{_prefix}/doc\"\n %{_prefix}/doc\n%endif\n%dir %{_bindir}\n%{_bindir}/cjpeg\n%{_bindir}/djpeg\n%{_bindir}/jpegtran\n%{_bindir}/tjbench\n%{_bindir}/rdjpgcom\n%{_bindir}/wrjpgcom\n%dir %{_libdir}\n%{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@.@SO_AGE@.@SO_MINOR_VERSION@\n%{_libdir}/libjpeg.so.@SO_MAJOR_VERSION@\n%{_libdir}/libjpeg.so\n%{_libdir}/libjpeg.a\n%{_libdir}/pkgconfig\n%{_libdir}/pkgconfig/libjpeg.pc\n%{_libdir}/libturbojpeg.so.0.1.0\n%{_libdir}/libturbojpeg.so.0\n%{_libdir}/libturbojpeg.so\n%{_libdir}/libturbojpeg.a\n%{_libdir}/pkgconfig/libturbojpeg.pc\n%dir %{_includedir}\n%{_includedir}/jconfig.h\n%{_includedir}/jerror.h\n%{_includedir}/jmorecfg.h\n%{_includedir}/jpeglib.h\n%{_includedir}/turbojpeg.h\n%dir %{_mandir}\n%dir %{_mandir}/man1\n%{_mandir}/man1/cjpeg.1*\n%{_mandir}/man1/djpeg.1*\n%{_mandir}/man1/jpegtran.1*\n%{_mandir}/man1/rdjpgcom.1*\n%{_mandir}/man1/wrjpgcom.1*\n%if \"%{_prefix}\" != \"%{_datadir}\"\n %dir %{_datadir}\n%endif\n@JAVA_RPM_CONTENTS_1@\n@JAVA_RPM_CONTENTS_2@\n\n%changelog\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/release/libjpeg.pc.in",
    "content": "prefix=@prefix@\nexec_prefix=@exec_prefix@\nlibdir=@libdir@\nincludedir=@includedir@\n\nName: libjpeg\nDescription: A SIMD-accelerated JPEG codec that provides the libjpeg API\nVersion: @PACKAGE_VERSION@\nLibs: -L${libdir} -ljpeg\nCflags: -I${includedir}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/release/libturbojpeg.pc.in",
    "content": "prefix=@prefix@\nexec_prefix=@exec_prefix@\nlibdir=@libdir@\nincludedir=@includedir@\n\nName: libturbojpeg\nDescription: A SIMD-accelerated JPEG codec that provides the TurboJPEG API\nVersion: @PACKAGE_VERSION@\nLibs: -L${libdir} -lturbojpeg\nCflags: -I${includedir}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/release/makecygwinpkg.in",
    "content": "#!/bin/sh\n\nset -u\nset -e\ntrap onexit INT\ntrap onexit TERM\ntrap onexit EXIT\n\nTMPDIR=\n\nonexit()\n{\n\tif [ ! \"$TMPDIR\" = \"\" ]; then\n\t\trm -rf $TMPDIR\n\tfi\n}\n\nPACKAGE_NAME=@PKGNAME@\nVERSION=@VERSION@\nBUILD=@BUILD@\nSRCDIR=@abs_top_srcdir@\n\nPREFIX=%{__prefix}\nDOCDIR=%{__docdir}\nLIBDIR=%{__libdir}\n\numask 022\nrm -f $PACKAGE_NAME-$VERSION-$BUILD.tar.bz2\nTMPDIR=`mktemp -d /tmp/ljtbuild.XXXXXX`\n__PWD=`pwd`\nmake install DESTDIR=$TMPDIR/pkg docdir=/usr/share/doc/$PACKAGE_NAME-$VERSION \\\n\texampledir=/usr/share/doc/$PACKAGE_NAME-$VERSION\nrm $TMPDIR/pkg$LIBDIR/*.la\nif [ \"$PREFIX\" = \"/opt/libjpeg-turbo\" -a \"$DOCDIR\" = \"/opt/libjpeg-turbo/doc\" ]; then\n\tln -fs /usr/share/doc/$PACKAGE_NAME-$VERSION $TMPDIR/pkg$DOCDIR\nfi\ncd $TMPDIR/pkg\ntar cfj ../$PACKAGE_NAME-$VERSION-$BUILD.tar.bz2 *\ncd $__PWD\nmv $TMPDIR/*.tar.bz2 .\n\nexit 0\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/release/makedpkg.in",
    "content": "#!/bin/sh\n\nset -u\nset -e\ntrap onexit INT\ntrap onexit TERM\ntrap onexit EXIT\n\nTMPDIR=\nSUDO=\n\nonexit()\n{\n\tif [ ! \"$TMPDIR\" = \"\" ]; then\n\t\t$SUDO rm -rf $TMPDIR\n\tfi\n}\n\nuid()\n{\n\tid | cut -f2 -d = | cut -f1 -d \\(;\n}\n\nmakedeb()\n{\n\tSUPPLEMENT=$1\n\tDIRNAME=$PACKAGE_NAME\n\n\tif [ $SUPPLEMENT = 1 ]; then\n\t\tPACKAGE_NAME=$PACKAGE_NAME\\32\n\t\tDEBARCH=amd64\n\tfi\n\n\tumask 022\n\trm -f $PACKAGE_NAME\\_$VERSION\\_$DEBARCH.deb\n\tTMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`\n\tmkdir $TMPDIR/DEBIAN\n\n\tif [ $SUPPLEMENT = 1 ]; then\n\t\tmake install DESTDIR=$TMPDIR bindir=/dummy/bin datadir=/dummy/data \\\n\t\t\tdocdir=/dummy/doc includedir=/dummy/include mandir=/dummy/man\n\t\trm -f $TMPDIR$LIBDIR/*.la\n\t\trm -rf $TMPDIR/dummy\n\telse\n\t\tmake install DESTDIR=$TMPDIR docdir=/usr/share/doc/$DIRNAME-$VERSION \\\n\t\t\texampledir=/usr/share/doc/$DIRNAME-$VERSION\n\t\trm -f $TMPDIR$LIBDIR/*.la\n\t\tif [ \"$PREFIX\" = \"/opt/libjpeg-turbo\" -a \"$DOCDIR\" = \"/opt/libjpeg-turbo/doc\" ]; then\n\t\t\tln -fs /usr/share/doc/$DIRNAME-$VERSION $TMPDIR$DOCDIR\n\t\tfi\n\tfi\n\n\tSIZE=`du -s $TMPDIR | cut -f1`\n\t(cat $SRCDIR/release/deb-control.tmpl | sed s/{__PKGNAME}/$PACKAGE_NAME/g \\\n\t\t| sed s/{__VERSION}/$VERSION/g | sed s/{__BUILD}/$BUILD/g \\\n\t\t| sed s/{__ARCH}/$DEBARCH/g | sed s/{__SIZE}/$SIZE/g \\\n\t\t> $TMPDIR/DEBIAN/control)\n\n\n\t/sbin/ldconfig -n $TMPDIR$LIBDIR\n\n\t$SUDO chown -Rh root:root $TMPDIR/*\n\tdpkg -b $TMPDIR $PACKAGE_NAME\\_$VERSION\\_$DEBARCH.deb\n}\n\nPACKAGE_NAME=@PKGNAME@\nVERSION=@VERSION@\nBUILD=@BUILD@\nDEBARCH=@DEBARCH@\nSRCDIR=@abs_top_srcdir@\nPREFIX=%{__prefix}\nDOCDIR=%{__docdir}\nLIBDIR=%{__libdir}\n\nif [ ! `uid` -eq 0 ]; then\n\tSUDO=sudo\nfi\n\nmakedeb 0\nif [ \"$DEBARCH\" = \"i386\" ]; then makedeb 1; fi\n\nexit\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/release/makemacpkg.in",
    "content": "#!/bin/sh\n\nset -u\nset -e\ntrap onexit INT\ntrap onexit TERM\ntrap onexit EXIT\n\nTMPDIR=\n\nonexit()\n{\n\tif [ ! \"$TMPDIR\" = \"\" ]; then\n\t\trm -rf $TMPDIR\n\tfi\n}\n\nusage()\n{\n\techo \"$0 [-build32 [32-bit build dir]] [-buildarmv6 [ARMv6 build dir]] [-buildarmv7 [ARMv7 build dir]] [-buildarmv7s [ARMv7s build dir] [-buildarmv8 [ARMv8 build dir]] [-lipo [path to lipo]]\"\n\texit 1\n}\n\nPACKAGE_NAME=@PKGNAME@\nVERSION=@VERSION@\nBUILD=@BUILD@\nSRCDIR=@abs_top_srcdir@\nBUILDDIR32=@abs_top_srcdir@/osxx86\nBUILD32=0\nBUILDDIRARMV6=@abs_top_srcdir@/iosarmv6\nBUILDARMV6=0\nBUILDDIRARMV7=@abs_top_srcdir@/iosarmv7\nBUILDARMV7=0\nBUILDDIRARMV7S=@abs_top_srcdir@/iosarmv7s\nBUILDARMV7S=0\nBUILDDIRARMV8=@abs_top_srcdir@/iosarmv8\nBUILDARMV8=0\nWITH_JAVA=@WITH_JAVA@\nLIPO=lipo\n\nPREFIX=%{__prefix}\nBINDIR=%{__bindir}\nDOCDIR=%{__docdir}\nLIBDIR=%{__libdir}\n\nwhile [ $# -gt 0 ]; do\n\tcase $1 in\n\t-h*)             usage 0                   ;;\n\t-build32)\n\t\tBUILD32=1\n\t\tif [ $# -gt 1 ]; then\n\t\t\tif [[ ! \"$2\" =~ -.* ]]; then\n\t\t\t\tBUILDDIR32=$2;  shift\n\t\t\tfi\n\t\tfi\n\t\t;;\n\t-buildarmv6)\n\t\tBUILDARMV6=1\n\t\tif [ $# -gt 1 ]; then\n\t\t\tif [[ ! \"$2\" =~ -.* ]]; then\n\t\t\t\tBUILDDIRARMV6=$2;  shift\n\t\t\tfi\n\t\tfi\n\t\t;;\n\t-buildarmv7)\n\t\tBUILDARMV7=1\n\t\tif [ $# -gt 1 ]; then\n\t\t\tif [[ ! \"$2\" =~ -.* ]]; then\n\t\t\t\tBUILDDIRARMV7=$2;  shift\n\t\t\tfi\n\t\tfi\n\t\t;;\n\t-buildarmv7s)\n\t\tBUILDARMV7S=1\n\t\tif [ $# -gt 1 ]; then\n\t\t\tif [[ ! \"$2\" =~ -.* ]]; then\n\t\t\t\tBUILDDIRARMV7S=$2;  shift\n\t\t\tfi\n\t\tfi\n\t\t;;\n\t-buildarmv8)\n\t\tBUILDARMV8=1\n\t\tif [ $# -gt 1 ]; then\n\t\t\tif [[ ! \"$2\" =~ -.* ]]; then\n\t\t\t\tBUILDDIRARMV8=$2;  shift\n\t\t\tfi\n\t\tfi\n\t\t;;\n\t-lipo)\n\t\tif [ $# -gt 1 ]; then\n\t\t\tif [[ ! \"$2\" =~ -.* ]]; then\n\t\t\t\tLIPO=$2;  shift\n\t\t\tfi\n\t\tfi\n\t\t;;\n\tesac\n\tshift\ndone\n\nif [ -f $PACKAGE_NAME-$VERSION.dmg ]; then\n\trm -f $PACKAGE_NAME-$VERSION.dmg\nfi\n\numask 022\nTMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`\nPKGROOT=$TMPDIR/pkg/Package_Root\nmkdir -p $PKGROOT\nmake install DESTDIR=$PKGROOT docdir=/Library/Documentation/$PACKAGE_NAME \\\n\texampledir=/Library/Documentation/$PACKAGE_NAME\nrm -f $PKGROOT$LIBDIR/*.la\n\nif [ \"$PREFIX\" = \"/opt/libjpeg-turbo\" -a \"$DOCDIR\" = \"/opt/libjpeg-turbo/doc\" ]; then\n\tln -fs /Library/Documentation/$PACKAGE_NAME $PKGROOT$DOCDIR\nfi\n\nif [ $BUILD32 = 1 ]; then\n\tif [ ! -d $BUILDDIR32 ]; then\n\t\techo ERROR: 32-bit build directory $BUILDDIR32 does not exist\n\t\texit 1\n\tfi\n\tif [ ! -f $BUILDDIR32/Makefile ]; then\n\t\techo ERROR: 32-bit build directory $BUILDDIR32 is not configured\n\t\texit 1\n\tfi\n\tmkdir -p $TMPDIR/dist.x86\n\tpushd $BUILDDIR32\n\tmake install DESTDIR=$TMPDIR/dist.x86\n\tpopd\n\tif [ ! -h $TMPDIR/dist.x86/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib -a \\\n\t\t! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib ]; then\n\t\t$LIPO -create \\\n\t\t\t-arch i386 $TMPDIR/dist.x86/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \\\n\t\t\t-arch x86_64 $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \\\n\t\t\t-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib\n\telif [ ! -h $TMPDIR/dist.x86/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib -a \\\n\t\t! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib ]; then\n\t\t$LIPO -create \\\n\t\t\t-arch i386 $TMPDIR/dist.x86/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \\\n\t\t\t-arch x86_64 $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \\\n\t\t\t-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib\n\tfi\n\t$LIPO -create \\\n\t\t-arch i386 $TMPDIR/dist.x86/$LIBDIR/libjpeg.a \\\n\t\t-arch x86_64 $PKGROOT/$LIBDIR/libjpeg.a \\\n\t\t-output $PKGROOT/$LIBDIR/libjpeg.a\n\t$LIPO -create \\\n\t\t-arch i386 $TMPDIR/dist.x86/$LIBDIR/libturbojpeg.0.dylib \\\n\t\t-arch x86_64 $PKGROOT/$LIBDIR/libturbojpeg.0.dylib \\\n\t\t-output $PKGROOT/$LIBDIR/libturbojpeg.0.dylib\n\t$LIPO -create \\\n\t\t-arch i386 $TMPDIR/dist.x86/$LIBDIR/libturbojpeg.a \\\n\t\t-arch x86_64 $PKGROOT/$LIBDIR/libturbojpeg.a \\\n\t\t-output $PKGROOT/$LIBDIR/libturbojpeg.a\n\t$LIPO -create \\\n\t\t-arch i386 $TMPDIR/dist.x86/$BINDIR/cjpeg \\\n\t\t-arch x86_64 $PKGROOT/$BINDIR/cjpeg \\\n\t\t-output $PKGROOT/$BINDIR/cjpeg\n\t$LIPO -create \\\n\t\t-arch i386 $TMPDIR/dist.x86/$BINDIR/djpeg \\\n\t\t-arch x86_64 $PKGROOT/$BINDIR/djpeg \\\n\t\t-output $PKGROOT/$BINDIR/djpeg\n\t$LIPO -create \\\n\t\t-arch i386 $TMPDIR/dist.x86/$BINDIR/jpegtran \\\n\t\t-arch x86_64 $PKGROOT/$BINDIR/jpegtran \\\n\t\t-output $PKGROOT/$BINDIR/jpegtran\n\t$LIPO -create \\\n\t\t-arch i386 $TMPDIR/dist.x86/$BINDIR/tjbench \\\n\t\t-arch x86_64 $PKGROOT/$BINDIR/tjbench \\\n\t\t-output $PKGROOT/$BINDIR/tjbench\n\t$LIPO -create \\\n\t\t-arch i386 $TMPDIR/dist.x86/$BINDIR/rdjpgcom \\\n\t\t-arch x86_64 $PKGROOT/$BINDIR/rdjpgcom \\\n\t\t-output $PKGROOT/$BINDIR/rdjpgcom\n\t$LIPO -create \\\n\t\t-arch i386 $TMPDIR/dist.x86/$BINDIR/wrjpgcom \\\n\t\t-arch x86_64 $PKGROOT/$BINDIR/wrjpgcom \\\n\t\t-output $PKGROOT/$BINDIR/wrjpgcom\n\nfi\n\nif [ $BUILDARMV6 = 1 ]; then\n\tif [ ! -d $BUILDDIRARMV6 ]; then\n\t\techo ERROR: ARMv6 build directory $BUILDDIRARMV6 does not exist\n\t\texit 1\n\tfi\n\tif [ ! -f $BUILDDIRARMV6/Makefile ]; then\n\t\techo ERROR: ARMv6 build directory $BUILDDIRARMV6 is not configured\n\t\texit 1\n\tfi\n\tmkdir -p $TMPDIR/dist.armv6\n\tpushd $BUILDDIRARMV6\n\tmake install DESTDIR=$TMPDIR/dist.armv6\n\tpopd\n\tif [ ! -h $TMPDIR/dist.armv6/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib -a \\\n\t\t! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib ]; then\n\t\t$LIPO -create \\\n\t\t\t$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \\\n\t\t\t-arch arm $TMPDIR/dist.armv6/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \\\n\t\t\t-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib\n\telif [ ! -h $TMPDIR/dist.armv6/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib -a \\\n\t\t! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib ]; then\n\t\t$LIPO -create \\\n\t\t\t$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \\\n\t\t\t-arch arm $TMPDIR/dist.armv6/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \\\n\t\t\t-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib\n\tfi\n\t$LIPO -create \\\n\t\t$PKGROOT/$LIBDIR/libjpeg.a \\\n\t\t-arch arm $TMPDIR/dist.armv6/$LIBDIR/libjpeg.a \\\n\t\t-output $PKGROOT/$LIBDIR/libjpeg.a\n\t$LIPO -create \\\n\t\t$PKGROOT/$LIBDIR/libturbojpeg.0.dylib \\\n\t\t-arch arm $TMPDIR/dist.armv6/$LIBDIR/libturbojpeg.0.dylib \\\n\t\t-output $PKGROOT/$LIBDIR/libturbojpeg.0.dylib\n\t$LIPO -create \\\n\t\t$PKGROOT/$LIBDIR/libturbojpeg.a \\\n\t\t-arch arm $TMPDIR/dist.armv6/$LIBDIR/libturbojpeg.a \\\n\t\t-output $PKGROOT/$LIBDIR/libturbojpeg.a\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/cjpeg \\\n\t\t-arch arm $TMPDIR/dist.armv6/$BINDIR/cjpeg \\\n\t\t-output $PKGROOT/$BINDIR/cjpeg\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/djpeg \\\n\t\t-arch arm $TMPDIR/dist.armv6/$BINDIR/djpeg \\\n\t\t-output $PKGROOT/$BINDIR/djpeg\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/jpegtran \\\n\t\t-arch arm $TMPDIR/dist.armv6/$BINDIR/jpegtran \\\n\t\t-output $PKGROOT/$BINDIR/jpegtran\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/tjbench \\\n\t\t-arch arm $TMPDIR/dist.armv6/$BINDIR/tjbench \\\n\t\t-output $PKGROOT/$BINDIR/tjbench\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/rdjpgcom \\\n\t\t-arch arm $TMPDIR/dist.armv6/$BINDIR/rdjpgcom \\\n\t\t-output $PKGROOT/$BINDIR/rdjpgcom\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/wrjpgcom \\\n\t\t-arch arm $TMPDIR/dist.armv6/$BINDIR/wrjpgcom \\\n\t\t-output $PKGROOT/$BINDIR/wrjpgcom\nfi\n\nif [ $BUILDARMV7 = 1 ]; then\n\tif [ ! -d $BUILDDIRARMV7 ]; then\n\t\techo ERROR: ARMv7 build directory $BUILDDIRARMV7 does not exist\n\t\texit 1\n\tfi\n\tif [ ! -f $BUILDDIRARMV7/Makefile ]; then\n\t\techo ERROR: ARMv7 build directory $BUILDDIRARMV7 is not configured\n\t\texit 1\n\tfi\n\tmkdir -p $TMPDIR/dist.armv7\n\tpushd $BUILDDIRARMV7\n\tmake install DESTDIR=$TMPDIR/dist.armv7\n\tpopd\n\tif [ ! -h $TMPDIR/dist.armv7/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib -a \\\n\t\t! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib ]; then\n\t\t$LIPO -create \\\n\t\t\t$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \\\n\t\t\t-arch arm $TMPDIR/dist.armv7/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \\\n\t\t\t-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib\n\telif [ ! -h $TMPDIR/dist.armv7/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib -a \\\n\t\t! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib ]; then\n\t\t$LIPO -create \\\n\t\t\t$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \\\n\t\t\t-arch arm $TMPDIR/dist.armv7/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \\\n\t\t\t-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib\n\tfi\n\t$LIPO -create \\\n\t\t$PKGROOT/$LIBDIR/libjpeg.a \\\n\t\t-arch arm $TMPDIR/dist.armv7/$LIBDIR/libjpeg.a \\\n\t\t-output $PKGROOT/$LIBDIR/libjpeg.a\n\t$LIPO -create \\\n\t\t$PKGROOT/$LIBDIR/libturbojpeg.0.dylib \\\n\t\t-arch arm $TMPDIR/dist.armv7/$LIBDIR/libturbojpeg.0.dylib \\\n\t\t-output $PKGROOT/$LIBDIR/libturbojpeg.0.dylib\n\t$LIPO -create \\\n\t\t$PKGROOT/$LIBDIR/libturbojpeg.a \\\n\t\t-arch arm $TMPDIR/dist.armv7/$LIBDIR/libturbojpeg.a \\\n\t\t-output $PKGROOT/$LIBDIR/libturbojpeg.a\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/cjpeg \\\n\t\t-arch arm $TMPDIR/dist.armv7/$BINDIR/cjpeg \\\n\t\t-output $PKGROOT/$BINDIR/cjpeg\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/djpeg \\\n\t\t-arch arm $TMPDIR/dist.armv7/$BINDIR/djpeg \\\n\t\t-output $PKGROOT/$BINDIR/djpeg\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/jpegtran \\\n\t\t-arch arm $TMPDIR/dist.armv7/$BINDIR/jpegtran \\\n\t\t-output $PKGROOT/$BINDIR/jpegtran\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/tjbench \\\n\t\t-arch arm $TMPDIR/dist.armv7/$BINDIR/tjbench \\\n\t\t-output $PKGROOT/$BINDIR/tjbench\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/rdjpgcom \\\n\t\t-arch arm $TMPDIR/dist.armv7/$BINDIR/rdjpgcom \\\n\t\t-output $PKGROOT/$BINDIR/rdjpgcom\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/wrjpgcom \\\n\t\t-arch arm $TMPDIR/dist.armv7/$BINDIR/wrjpgcom \\\n\t\t-output $PKGROOT/$BINDIR/wrjpgcom\nfi\n\nif [ $BUILDARMV7S = 1 ]; then\n\tif [ ! -d $BUILDDIRARMV7S ]; then\n\t\techo ERROR: ARMv7s build directory $BUILDDIRARMV7S does not exist\n\t\texit 1\n\tfi\n\tif [ ! -f $BUILDDIRARMV7S/Makefile ]; then\n\t\techo ERROR: ARMv7s build directory $BUILDDIRARMV7S is not configured\n\t\texit 1\n\tfi\n\tmkdir -p $TMPDIR/dist.armv7s\n\tpushd $BUILDDIRARMV7S\n\tmake install DESTDIR=$TMPDIR/dist.armv7s\n\tpopd\n\tif [ ! -h $TMPDIR/dist.armv7s/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib -a \\\n\t\t! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib ]; then\n\t\t$LIPO -create \\\n\t\t\t$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \\\n\t\t\t-arch arm $TMPDIR/dist.armv7s/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \\\n\t\t\t-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib\n\telif [ ! -h $TMPDIR/dist.armv7s/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib -a \\\n\t\t! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib ]; then\n\t\t$LIPO -create \\\n\t\t\t$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \\\n\t\t\t-arch arm $TMPDIR/dist.armv7s/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \\\n\t\t\t-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib\n\tfi\n\t$LIPO -create \\\n\t\t$PKGROOT/$LIBDIR/libjpeg.a \\\n\t\t-arch arm $TMPDIR/dist.armv7s/$LIBDIR/libjpeg.a \\\n\t\t-output $PKGROOT/$LIBDIR/libjpeg.a\n\t$LIPO -create \\\n\t\t$PKGROOT/$LIBDIR/libturbojpeg.0.dylib \\\n\t\t-arch arm $TMPDIR/dist.armv7s/$LIBDIR/libturbojpeg.0.dylib \\\n\t\t-output $PKGROOT/$LIBDIR/libturbojpeg.0.dylib\n\t$LIPO -create \\\n\t\t$PKGROOT/$LIBDIR/libturbojpeg.a \\\n\t\t-arch arm $TMPDIR/dist.armv7s/$LIBDIR/libturbojpeg.a \\\n\t\t-output $PKGROOT/$LIBDIR/libturbojpeg.a\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/cjpeg \\\n\t\t-arch arm $TMPDIR/dist.armv7s/$BINDIR/cjpeg \\\n\t\t-output $PKGROOT/$BINDIR/cjpeg\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/djpeg \\\n\t\t-arch arm $TMPDIR/dist.armv7s/$BINDIR/djpeg \\\n\t\t-output $PKGROOT/$BINDIR/djpeg\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/jpegtran \\\n\t\t-arch arm $TMPDIR/dist.armv7s/$BINDIR/jpegtran \\\n\t\t-output $PKGROOT/$BINDIR/jpegtran\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/tjbench \\\n\t\t-arch arm $TMPDIR/dist.armv7s/$BINDIR/tjbench \\\n\t\t-output $PKGROOT/$BINDIR/tjbench\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/rdjpgcom \\\n\t\t-arch arm $TMPDIR/dist.armv7s/$BINDIR/rdjpgcom \\\n\t\t-output $PKGROOT/$BINDIR/rdjpgcom\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/wrjpgcom \\\n\t\t-arch arm $TMPDIR/dist.armv7s/$BINDIR/wrjpgcom \\\n\t\t-output $PKGROOT/$BINDIR/wrjpgcom\nfi\n\nif [ $BUILDARMV8 = 1 ]; then\n\tif [ ! -d $BUILDDIRARMV8 ]; then\n\t\techo ERROR: ARMv8 build directory $BUILDDIRARMV8 does not exist\n\t\texit 1\n\tfi\n\tif [ ! -f $BUILDDIRARMV8/Makefile ]; then\n\t\techo ERROR: ARMv8 build directory $BUILDDIRARMV8 is not configured\n\t\texit 1\n\tfi\n\tmkdir -p $TMPDIR/dist.armv8\n\tpushd $BUILDDIRARMV8\n\tmake install DESTDIR=$TMPDIR/dist.armv8\n\tpopd\n\tif [ ! -h $TMPDIR/dist.armv8/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib -a \\\n\t\t! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib ]; then\n\t\t$LIPO -create \\\n\t\t\t$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \\\n\t\t\t-arch arm64 $TMPDIR/dist.armv8/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib \\\n\t\t\t-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib\n\telif [ ! -h $TMPDIR/dist.armv8/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib -a \\\n\t\t! -h $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib ]; then\n\t\t$LIPO -create \\\n\t\t\t$PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \\\n\t\t\t-arch arm64 $TMPDIR/dist.armv8/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib \\\n\t\t\t-output $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.0.@SO_MINOR_VERSION@.dylib\n\tfi\n\t$LIPO -create \\\n\t\t$PKGROOT/$LIBDIR/libjpeg.a \\\n\t\t-arch arm64 $TMPDIR/dist.armv8/$LIBDIR/libjpeg.a \\\n\t\t-output $PKGROOT/$LIBDIR/libjpeg.a\n\t$LIPO -create \\\n\t\t$PKGROOT/$LIBDIR/libturbojpeg.0.dylib \\\n\t\t-arch arm64 $TMPDIR/dist.armv8/$LIBDIR/libturbojpeg.0.dylib \\\n\t\t-output $PKGROOT/$LIBDIR/libturbojpeg.0.dylib\n\t$LIPO -create \\\n\t\t$PKGROOT/$LIBDIR/libturbojpeg.a \\\n\t\t-arch arm64 $TMPDIR/dist.armv8/$LIBDIR/libturbojpeg.a \\\n\t\t-output $PKGROOT/$LIBDIR/libturbojpeg.a\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/cjpeg \\\n\t\t-arch arm64 $TMPDIR/dist.armv8/$BINDIR/cjpeg \\\n\t\t-output $PKGROOT/$BINDIR/cjpeg\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/djpeg \\\n\t\t-arch arm64 $TMPDIR/dist.armv8/$BINDIR/djpeg \\\n\t\t-output $PKGROOT/$BINDIR/djpeg\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/jpegtran \\\n\t\t-arch arm64 $TMPDIR/dist.armv8/$BINDIR/jpegtran \\\n\t\t-output $PKGROOT/$BINDIR/jpegtran\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/tjbench \\\n\t\t-arch arm64 $TMPDIR/dist.armv8/$BINDIR/tjbench \\\n\t\t-output $PKGROOT/$BINDIR/tjbench\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/rdjpgcom \\\n\t\t-arch arm64 $TMPDIR/dist.armv8/$BINDIR/rdjpgcom \\\n\t\t-output $PKGROOT/$BINDIR/rdjpgcom\n\t$LIPO -create \\\n\t\t$PKGROOT/$BINDIR/wrjpgcom \\\n\t\t-arch arm64 $TMPDIR/dist.armv8/$BINDIR/wrjpgcom \\\n\t\t-output $PKGROOT/$BINDIR/wrjpgcom\nfi\n\ninstall_name_tool -id $LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib $PKGROOT/$LIBDIR/libjpeg.@SO_MAJOR_VERSION@.dylib\ninstall_name_tool -id $LIBDIR/libturbojpeg.0.dylib $PKGROOT/$LIBDIR/libturbojpeg.0.dylib\n\nif [ $WITH_JAVA = 1 ]; then\n\tln -fs libturbojpeg.0.dylib $PKGROOT/$LIBDIR/libturbojpeg.jnilib\nfi\nif [ \"$PREFIX\" = \"/opt/libjpeg-turbo\" -a \"$LIBDIR\" = \"/opt/libjpeg-turbo/lib\" ]; then\n\tif [ ! -h $PKGROOT/$PREFIX/lib32 ]; then\n\t\tln -fs lib $PKGROOT/$PREFIX/lib32\n\tfi\n\tif [ ! -h $PKGROOT/$PREFIX/lib64 ]; then\n\t\tln -fs lib $PKGROOT/$PREFIX/lib64\n\tfi\nfi\n\nmkdir -p $TMPDIR/pkg\n\ninstall -m 755 pkgscripts/uninstall $PKGROOT/$BINDIR/\n\nfind $PKGROOT -type f | while read file; do xattr -c $file; done\n\ncp $SRCDIR/release/License.rtf $SRCDIR/release/Welcome.rtf $SRCDIR/release/ReadMe.txt $TMPDIR/pkg/\n\nmkdir $TMPDIR/dmg\npkgbuild --root $PKGROOT --version $VERSION.$BUILD \\\n\t--identifier com.libjpeg-turbo.libjpeg-turbo $TMPDIR/pkg/$PACKAGE_NAME.pkg\nproductbuild --distribution $SRCDIR/release/Distribution.xml \\\n\t--package-path $TMPDIR/pkg/ --resources $TMPDIR/pkg/ \\\n\t$TMPDIR/dmg/$PACKAGE_NAME.pkg\nhdiutil create -fs HFS+ -volname $PACKAGE_NAME-$VERSION \\\n\t-srcfolder \"$TMPDIR/dmg\" $TMPDIR/$PACKAGE_NAME-$VERSION.dmg\ncp $TMPDIR/$PACKAGE_NAME-$VERSION.dmg .\n\nexit\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/release/uninstall.in",
    "content": "# Copyright (C)2009-2011, 2013, 2016 D. R. Commander.  All Rights Reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# - Redistributions of source code must retain the above copyright notice,\n#   this list of conditions and the following disclaimer.\n# - Redistributions in binary form must reproduce the above copyright notice,\n#   this list of conditions and the following disclaimer in the documentation\n#   and/or other materials provided with the distribution.\n# - Neither the name of the libjpeg-turbo Project nor the names of its\n#   contributors may be used to endorse or promote products derived from this\n#   software without specific prior written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n# ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n# POSSIBILITY OF SUCH DAMAGE.\n\n#!/bin/sh\n\nif [ ! \"`id -u`\" = \"0\" ]; then\n\techo \"ERROR: This script must be executed as root\"\n\texit -1\nfi\n\nPACKAGE=@PKGNAME@\nMACPACKAGE=com.$PACKAGE.$PACKAGE\nRECEIPT=/Library/Receipts/$PACKAGE.pkg\n\nLSBOM=\nif [ -d $RECEIPT ]; then\n\tLSBOM='lsbom -s -f -l '$RECEIPT'/Contents/Archive.bom'\nelse\n\tLSBOM='pkgutil --files '$MACPACKAGE\nfi\n\nmylsbom()\n{\n\t$LSBOM || (echo \"ERROR: Could not list package contents\"; exit -1)\n}\n\necho Removing package files ...\nEXITSTATUS=0\npushd /\nmylsbom | while read file; do\n\tif [ ! -d \"$file\" ]; then rm \"$file\" 2>&1 || EXITSTATUS=-1; fi\ndone\npopd\n\necho Removing package directories ...\nPREFIX=%{__prefix}\nBINDIR=%{__bindir}\nDATADIR=%{__datadir}\nINCLUDEDIR=%{__includedir}\nLIBDIR=%{__libdir}\nMANDIR=%{__mandir}\n\nif [ -d $BINDIR ]; then\n\trmdir $BINDIR 2>&1 || EXITSTATUS=-1\nfi\nif [ -d $LIBDIR/pkgconfig ]; then\n\trmdir $LIBDIR/pkgconfig 2>&1 || EXITSTATUS=-1\nfi\nif [ -d $LIBDIR ]; then\n\trmdir $LIBDIR 2>&1 || EXITSTATUS=-1\nfi\nif [ -d $INCLUDEDIR ]; then\n\trmdir $INCLUDEDIR 2>&1 || EXITSTATUS=-1\nfi\nif [ \"$PREFIX\" = \"/opt/libjpeg-turbo\" -a \"$LIBDIR\" = \"/opt/libjpeg-turbo/lib\" ]; then\n\tif [ -h $LIBDIR\\32 ]; then\n\t\trm $LIBDIR\\32 2>&1 || EXITSTATUS=-1\n\tfi\n\tif [ -h $LIBDIR\\64 ]; then\n\t\trm $LIBDIR\\64 2>&1 || EXITSTATUS=-1\n\tfi\nfi\nif [ -d $MANDIR/man1 ]; then\n\trmdir $MANDIR/man1 2>&1 || EXITSTATUS=-1\nfi\nif [ -d $MANDIR ]; then\n\trmdir $MANDIR 2>&1 || EXITSTATUS=-1\nfi\nif [ -d $DATADIR/classes ]; then\n\trmdir $DATADIR/classes 2>&1 || EXITSTATUS=-1\nfi\nif [ -d $DATADIR -a \"$DATADIR\" != \"$PREFIX\" ]; then\n\trmdir $DATADIR 2>&1 || EXITSTATUS=-1\nfi\nif [ \"$PREFIX\" = \"/opt/libjpeg-turbo\" -a -h \"$PREFIX/doc\" ]; then\n\trm $PREFIX/doc 2>&1 || EXITSTATUS=-1\nfi\nrmdir $PREFIX 2>&1 || EXITSTATUS=-1\nrmdir /Library/Documentation/$PACKAGE 2>&1 || EXITSTATUS=-1\n\nif [ -d $RECEIPT ]; then\n\techo Removing package receipt ...\n\trm -r $RECEIPT 2>&1 || EXITSTATUS=-1\nelse\n\techo Forgetting package $MACPACKAGE ...\n\tpkgutil --forget $MACPACKAGE\nfi\n\nexit $EXITSTATUS\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/sharedlib/CMakeLists.txt",
    "content": "# Anything that must be linked against the shared C library on Windows must\n# be built in this subdirectory, because CMake doesn't allow us to override\n# the compiler flags for each build type except at directory scope.  Note\n# to CMake developers:  Add a COMPILE_FLAGS_<CONFIG> target property, or\n# better yet, provide a friendly way of configuring a Windows target to use the\n# static C library.\n\nif(MSVC)\n  # Build all configurations against shared C library\n  foreach(var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE\n    CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)\n    if(${var} MATCHES \"/MT\")\n      string(REGEX REPLACE \"/MT\" \"/MD\" ${var} \"${${var}}\")\n    endif()\n  endforeach()\nendif()\n\nforeach(src ${JPEG_SOURCES})\n  set(JPEG_SRCS ${JPEG_SRCS} ${CMAKE_SOURCE_DIR}/${src})\nendforeach()\n\nif(WITH_SIMD)\n  # This tells CMake that the \"source\" files haven't been generated yet\n  set_source_files_properties(${SIMD_OBJS} PROPERTIES GENERATED 1)\nendif()\n\nif(WITH_MEM_SRCDST AND NOT WITH_JPEG8)\n  add_library(jpeg SHARED ${JPEG_SRCS} ${SIMD_OBJS}\n    ${CMAKE_SOURCE_DIR}/win/jpeg${DLL_VERSION}-memsrcdst.def)\nelse()\n  add_library(jpeg SHARED ${JPEG_SRCS} ${SIMD_OBJS}\n    ${CMAKE_SOURCE_DIR}/win/jpeg${DLL_VERSION}.def)\nendif()\nset_target_properties(jpeg PROPERTIES SOVERSION ${DLL_VERSION}\n  VERSION ${FULLVERSION})\nif(MSVC)\n  set_target_properties(jpeg PROPERTIES SUFFIX ${DLL_VERSION}.dll)\nelseif(MINGW OR CYGWIN)\n  set_target_properties(jpeg PROPERTIES SUFFIX -${DLL_VERSION}.dll)\nendif(MSVC)\nif(WITH_SIMD)\n  add_dependencies(jpeg simd)\nendif()\n\nif(WITH_12BIT)\n  set(COMPILE_FLAGS \"-DGIF_SUPPORTED -DPPM_SUPPORTED -DUSE_SETMODE\")\nelse()\n  set(COMPILE_FLAGS \"-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE\")\n\tset(CJPEG_BMP_SOURCES ../rdbmp.c ../rdtarga.c)\n\tset(DJPEG_BMP_SOURCES ../wrbmp.c ../wrtarga.c)\nendif()\n\nadd_executable(cjpeg ../cjpeg.c ../cdjpeg.c ../rdgif.c ../rdppm.c\n  ../rdswitch.c ${CJPEG_BMP_SOURCES})\nset_property(TARGET cjpeg PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})\ntarget_link_libraries(cjpeg jpeg)\n\nadd_executable(djpeg ../djpeg.c ../cdjpeg.c ../rdcolmap.c ../rdswitch.c\n  ../wrgif.c ../wrppm.c ${DJPEG_BMP_SOURCES})\nset_property(TARGET djpeg PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})\ntarget_link_libraries(djpeg jpeg)\n\nadd_executable(jpegtran ../jpegtran.c ../cdjpeg.c ../rdswitch.c ../transupp.c)\ntarget_link_libraries(jpegtran jpeg)\nset_property(TARGET jpegtran PROPERTY COMPILE_FLAGS \"-DUSE_SETMODE\")\n\nadd_executable(jcstest ../jcstest.c)\ntarget_link_libraries(jcstest jpeg)\n\ninstall(TARGETS jpeg cjpeg djpeg jpegtran\n  ARCHIVE DESTINATION lib\n  LIBRARY DESTINATION lib\n  RUNTIME DESTINATION bin)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/CMakeLists.txt",
    "content": "if(NOT DEFINED NASM)\n  set(NASM nasm CACHE FILEPATH \"Path to NASM/YASM executable\")\nendif()\n\nif(SIMD_X86_64)\n  set(NAFLAGS -fwin64 -DWIN64 -D__x86_64__)\nelse()\n  if(BORLAND)\n    set(NAFLAGS -fobj -DOBJ32)\n  else()\n    set(NAFLAGS -fwin32 -DWIN32)\n  endif()\nendif()\nset(NAFLAGS ${NAFLAGS} -I${CMAKE_SOURCE_DIR}/win/ -I${CMAKE_CURRENT_SOURCE_DIR}/)\n\n# This only works if building from the command line.  There is currently no way\n# to set a variable's value based on the build type when using the MSVC IDE.\nif(CMAKE_BUILD_TYPE STREQUAL \"Debug\"\n  OR CMAKE_BUILD_TYPE STREQUAL \"RelWithDebInfo\")\n  set(NAFLAGS ${NAFLAGS} -g)\nendif()\n\nif(SIMD_X86_64)\n  set(SIMD_BASENAMES jfdctflt-sse-64 jccolor-sse2-64 jcgray-sse2-64\n    jchuff-sse2-64 jcsample-sse2-64 jdcolor-sse2-64 jdmerge-sse2-64\n    jdsample-sse2-64 jfdctfst-sse2-64 jfdctint-sse2-64 jidctflt-sse2-64\n    jidctfst-sse2-64 jidctint-sse2-64 jidctred-sse2-64 jquantf-sse2-64\n    jquanti-sse2-64)\n  message(STATUS \"Building x86_64 SIMD extensions\")\nelse()\n  set(SIMD_BASENAMES jsimdcpu jfdctflt-3dn jidctflt-3dn jquant-3dn jccolor-mmx\n    jcgray-mmx jcsample-mmx jdcolor-mmx jdmerge-mmx jdsample-mmx jfdctfst-mmx\n    jfdctint-mmx jidctfst-mmx jidctint-mmx jidctred-mmx jquant-mmx jfdctflt-sse\n    jidctflt-sse jquant-sse jccolor-sse2 jcgray-sse2 jchuff-sse2 jcsample-sse2\n    jdcolor-sse2 jdmerge-sse2 jdsample-sse2 jfdctfst-sse2 jfdctint-sse2\n    jidctflt-sse2 jidctfst-sse2 jidctint-sse2 jidctred-sse2 jquantf-sse2\n    jquanti-sse2)\n  message(STATUS \"Building i386 SIMD extensions\")\nendif()\n\nif(MSVC_IDE)\n  set(OBJDIR \"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}\")\nelse()\n  set(OBJDIR ${CMAKE_CURRENT_BINARY_DIR})\nendif()\n\nfile(GLOB INC_FILES *.inc)\n\nforeach(file ${SIMD_BASENAMES})\n  set(DEPFILE \"\")\n  set(SIMD_SRC ${CMAKE_CURRENT_SOURCE_DIR}/${file}.asm)\n  if(${file} MATCHES jccolor)\n    set(DEPFILE ${file})\n    string(REGEX REPLACE \"jccolor\" \"jccolext\" DEPFILE ${DEPFILE})\n    set(DEPFILE ${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE}.asm)\n  endif()\n  if(${file} MATCHES jcgray)\n    set(DEPFILE ${file})\n    string(REGEX REPLACE \"jcgray\" \"jcgryext\" DEPFILE ${DEPFILE})\n    set(DEPFILE ${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE}.asm)\n  endif()\n  if(${file} MATCHES jdcolor)\n    set(DEPFILE ${file})\n    string(REGEX REPLACE \"jdcolor\" \"jdcolext\" DEPFILE ${DEPFILE})\n    set(DEPFILE ${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE}.asm)\n  endif()\n  if(${file} MATCHES jdmerge)\n    set(DEPFILE ${file})\n    string(REGEX REPLACE \"jdmerge\" \"jdmrgext\" DEPFILE ${DEPFILE})\n    set(DEPFILE ${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE}.asm)\n  endif()\n  set(SIMD_OBJ ${OBJDIR}/${file}.obj)\n  add_custom_command(OUTPUT ${SIMD_OBJ}\n    DEPENDS ${SIMD_SRC} ${DEPFILE} ${INC_FILES}\n    COMMAND ${NASM} ${NAFLAGS} ${SIMD_SRC} -o${SIMD_OBJ})\n  set(SIMD_OBJS ${SIMD_OBJS} ${SIMD_OBJ})\nendforeach()\n\nset(SIMD_OBJS ${SIMD_OBJS} PARENT_SCOPE)\nadd_custom_target(simd DEPENDS ${SIMD_OBJS})\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/Makefile.am",
    "content": "noinst_LTLIBRARIES = libsimd.la\n\nBUILT_SOURCES = jsimdcfg.inc\n\nEXTRA_DIST = nasm_lt.sh CMakeLists.txt \\\n\tjccolext-mmx.asm   jcgryext-mmx.asm   jdcolext-mmx.asm   jdmrgext-mmx.asm \\\n\tjccolext-sse2.asm  jcgryext-sse2.asm  jdcolext-sse2.asm  jdmrgext-sse2.asm \\\n\tjccolext-sse2-64.asm  jcgryext-sse2-64.asm  jdcolext-sse2-64.asm \\\n\tjdmrgext-sse2-64.asm  jccolext-altivec.c    jcgryext-altivec.c \\\n\tjdcolext-altivec.c    jdmrgext-altivec.c\n\nif SIMD_X86_64\n\nlibsimd_la_SOURCES = jsimd_x86_64.c jsimd.h jsimdcfg.inc.h jsimdext.inc \\\n\tjcolsamp.inc jdct.inc jpeg_nbits_table.inc jfdctflt-sse-64.asm \\\n\tjccolor-sse2-64.asm   jcgray-sse2-64.asm    jchuff-sse2-64.asm \\\n\tjcsample-sse2-64.asm  jdcolor-sse2-64.asm   jdmerge-sse2-64.asm \\\n\tjdsample-sse2-64.asm  jfdctfst-sse2-64.asm  jfdctint-sse2-64.asm \\\n\tjidctflt-sse2-64.asm  jidctfst-sse2-64.asm  jidctint-sse2-64.asm \\\n\tjidctred-sse2-64.asm  jquantf-sse2-64.asm   jquanti-sse2-64.asm\n\njccolor-sse2-64.lo:  jccolext-sse2-64.asm\njcgray-sse2-64.lo:   jcgryext-sse2-64.asm\njdcolor-sse2-64.lo:  jdcolext-sse2-64.asm\njdmerge-sse2-64.lo:  jdmrgext-sse2-64.asm\n\nendif\n\nif SIMD_I386\n\nlibsimd_la_SOURCES = jsimd_i386.c jsimd.h jsimdcfg.inc.h jsimdext.inc \\\n\tjcolsamp.inc jdct.inc jpeg_nbits_table.inc jsimdcpu.asm \\\n\tjfdctflt-3dn.asm   jidctflt-3dn.asm   jquant-3dn.asm \\\n\tjccolor-mmx.asm    jcgray-mmx.asm     jcsample-mmx.asm \\\n\tjdcolor-mmx.asm    jdmerge-mmx.asm    jdsample-mmx.asm \\\n\tjfdctfst-mmx.asm   jfdctint-mmx.asm   jidctfst-mmx.asm \\\n\tjidctint-mmx.asm   jidctred-mmx.asm   jquant-mmx.asm \\\n\tjfdctflt-sse.asm   jidctflt-sse.asm   jquant-sse.asm \\\n\tjccolor-sse2.asm   jcgray-sse2.asm    jchuff-sse2.asm \\\n\tjcsample-sse2.asm  jdcolor-sse2.asm   jdmerge-sse2.asm \\\n\tjdsample-sse2.asm  jfdctfst-sse2.asm  jfdctint-sse2.asm \\\n\tjidctflt-sse2.asm  jidctfst-sse2.asm  jidctint-sse2.asm \\\n\tjidctred-sse2.asm  jquantf-sse2.asm   jquanti-sse2.asm\n\njccolor-mmx.lo:   jccolext-mmx.asm\njcgray.-mmx.lo:   jcgryext-mmx.asm\njdcolor-mmx.lo:   jdcolext-mmx.asm\njdmerge-mmx.lo:   jdmrgext-mmx.asm\njccolor-sse2.lo:  jccolext-sse2.asm\njcgray-sse2.lo:   jcgryext-sse2.asm\njdcolor-sse2.lo:  jdcolext-sse2.asm\njdmerge-sse2.lo:  jdmrgext-sse2.asm\n\nendif\n\nif SIMD_ARM\n\nlibsimd_la_SOURCES = jsimd_arm.c jsimd_arm_neon.S\n\nendif\n\nif SIMD_ARM_64\n\nlibsimd_la_SOURCES = jsimd_arm64.c jsimd_arm64_neon.S\n\nendif\n\nif SIMD_MIPS\n\nlibsimd_la_SOURCES = jsimd_mips.c jsimd_mips_dspr2_asm.h jsimd_mips_dspr2.S\n\nendif\n\nif SIMD_POWERPC\n\nlibsimd_la_SOURCES = jsimd_powerpc.c jsimd_altivec.h jcsample.h \\\n\tjccolor-altivec.c     jcgray-altivec.c      jcsample-altivec.c \\\n\tjdcolor-altivec.c     jdmerge-altivec.c     jdsample-altivec.c \\\n\tjfdctfst-altivec.c    jfdctint-altivec.c \\\n\tjidctfst-altivec.c    jidctint-altivec.c \\\n\tjquanti-altivec.c\nlibsimd_la_CFLAGS = -maltivec\n\njccolor-altivec.lo:  jccolext-altivec.c\njcgray-altivec.lo:   jcgryext-altivec.c\njdcolor-altivec.lo:  jdcolext-altivec.c\njdmerge-altivec.lo:  jdmrgext-altivec.c\n\nendif\n\nAM_CPPFLAGS = -I$(top_srcdir)\n\n.asm.lo:\n\t$(AM_V_GEN) $(LIBTOOL) $(AM_V_lt) --mode=compile --tag NASM $(srcdir)/nasm_lt.sh $(AM_V_lt) $(NASM) $(NAFLAGS) -I$(srcdir) -I. $< -o $@\n\njsimdcfg.inc: $(srcdir)/jsimdcfg.inc.h ../jpeglib.h ../jconfig.h ../jmorecfg.h\n\t$(AM_V_GEN) $(CPP) -I$(top_builddir) -I$(top_builddir)/simd $(srcdir)/jsimdcfg.inc.h | $(EGREP) \"^[\\;%]|^\\ %\" | sed 's%_cpp_protection_%%' | sed 's@% define@%define@g' > $@\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/Makefile.in",
    "content": "# Makefile.in generated by automake 1.15 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994-2014 Free Software Foundation, Inc.\n\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\nVPATH = @srcdir@\nam__is_gnu_make = { \\\n  if test -z '$(MAKELEVEL)'; then \\\n    false; \\\n  elif test -n '$(MAKE_HOST)'; then \\\n    true; \\\n  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \\\n    true; \\\n  else \\\n    false; \\\n  fi; \\\n}\nam__make_running_with_option = \\\n  case $${target_option-} in \\\n      ?) ;; \\\n      *) echo \"am__make_running_with_option: internal error: invalid\" \\\n              \"target option '$${target_option-}' specified\" >&2; \\\n         exit 1;; \\\n  esac; \\\n  has_opt=no; \\\n  sane_makeflags=$$MAKEFLAGS; \\\n  if $(am__is_gnu_make); then \\\n    sane_makeflags=$$MFLAGS; \\\n  else \\\n    case $$MAKEFLAGS in \\\n      *\\\\[\\ \\\t]*) \\\n        bs=\\\\; \\\n        sane_makeflags=`printf '%s\\n' \"$$MAKEFLAGS\" \\\n          | sed \"s/$$bs$$bs[$$bs $$bs\t]*//g\"`;; \\\n    esac; \\\n  fi; \\\n  skip_next=no; \\\n  strip_trailopt () \\\n  { \\\n    flg=`printf '%s\\n' \"$$flg\" | sed \"s/$$1.*$$//\"`; \\\n  }; \\\n  for flg in $$sane_makeflags; do \\\n    test $$skip_next = yes && { skip_next=no; continue; }; \\\n    case $$flg in \\\n      *=*|--*) continue;; \\\n        -*I) strip_trailopt 'I'; skip_next=yes;; \\\n      -*I?*) strip_trailopt 'I';; \\\n        -*O) strip_trailopt 'O'; skip_next=yes;; \\\n      -*O?*) strip_trailopt 'O';; \\\n        -*l) strip_trailopt 'l'; skip_next=yes;; \\\n      -*l?*) strip_trailopt 'l';; \\\n      -[dEDm]) skip_next=yes;; \\\n      -[JT]) skip_next=yes;; \\\n    esac; \\\n    case $$flg in \\\n      *$$target_option*) has_opt=yes; break;; \\\n    esac; \\\n  done; \\\n  test $$has_opt = yes\nam__make_dryrun = (target_option=n; $(am__make_running_with_option))\nam__make_keepgoing = (target_option=k; $(am__make_running_with_option))\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nbuild_triplet = @build@\nhost_triplet = @host@\nsubdir = simd\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \\\n\t$(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nDIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)\nmkinstalldirs = $(install_sh) -d\nCONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/jconfig.h \\\n\t$(top_builddir)/jconfigint.h\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nLTLIBRARIES = $(noinst_LTLIBRARIES)\nlibsimd_la_LIBADD =\nam__libsimd_la_SOURCES_DIST = jsimd_arm64.c jsimd_arm64_neon.S \\\n\tjsimd_arm.c jsimd_arm_neon.S jsimd_i386.c jsimd.h \\\n\tjsimdcfg.inc.h jsimdext.inc jcolsamp.inc jdct.inc \\\n\tjpeg_nbits_table.inc jsimdcpu.asm jfdctflt-3dn.asm \\\n\tjidctflt-3dn.asm jquant-3dn.asm jccolor-mmx.asm jcgray-mmx.asm \\\n\tjcsample-mmx.asm jdcolor-mmx.asm jdmerge-mmx.asm \\\n\tjdsample-mmx.asm jfdctfst-mmx.asm jfdctint-mmx.asm \\\n\tjidctfst-mmx.asm jidctint-mmx.asm jidctred-mmx.asm \\\n\tjquant-mmx.asm jfdctflt-sse.asm jidctflt-sse.asm \\\n\tjquant-sse.asm jccolor-sse2.asm jcgray-sse2.asm \\\n\tjchuff-sse2.asm jcsample-sse2.asm jdcolor-sse2.asm \\\n\tjdmerge-sse2.asm jdsample-sse2.asm jfdctfst-sse2.asm \\\n\tjfdctint-sse2.asm jidctflt-sse2.asm jidctfst-sse2.asm \\\n\tjidctint-sse2.asm jidctred-sse2.asm jquantf-sse2.asm \\\n\tjquanti-sse2.asm jsimd_mips.c jsimd_mips_dspr2_asm.h \\\n\tjsimd_mips_dspr2.S jsimd_powerpc.c jsimd_altivec.h jcsample.h \\\n\tjccolor-altivec.c jcgray-altivec.c jcsample-altivec.c \\\n\tjdcolor-altivec.c jdmerge-altivec.c jdsample-altivec.c \\\n\tjfdctfst-altivec.c jfdctint-altivec.c jidctfst-altivec.c \\\n\tjidctint-altivec.c jquanti-altivec.c jsimd_x86_64.c \\\n\tjfdctflt-sse-64.asm jccolor-sse2-64.asm jcgray-sse2-64.asm \\\n\tjchuff-sse2-64.asm jcsample-sse2-64.asm jdcolor-sse2-64.asm \\\n\tjdmerge-sse2-64.asm jdsample-sse2-64.asm jfdctfst-sse2-64.asm \\\n\tjfdctint-sse2-64.asm jidctflt-sse2-64.asm jidctfst-sse2-64.asm \\\n\tjidctint-sse2-64.asm jidctred-sse2-64.asm jquantf-sse2-64.asm \\\n\tjquanti-sse2-64.asm\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@am_libsimd_la_OBJECTS = libsimd_la-jsimd_x86_64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjfdctflt-sse-64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjccolor-sse2-64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjcgray-sse2-64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjchuff-sse2-64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjcsample-sse2-64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjdcolor-sse2-64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjdmerge-sse2-64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjdsample-sse2-64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjfdctfst-sse2-64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjfdctint-sse2-64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjidctflt-sse2-64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjidctfst-sse2-64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjidctint-sse2-64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjidctred-sse2-64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjquantf-sse2-64.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_FALSE@@SIMD_X86_64_TRUE@\tjquanti-sse2-64.lo\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_TRUE@am_libsimd_la_OBJECTS = libsimd_la-jsimd_powerpc.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_TRUE@\tlibsimd_la-jccolor-altivec.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_TRUE@\tlibsimd_la-jcgray-altivec.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_TRUE@\tlibsimd_la-jcsample-altivec.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_TRUE@\tlibsimd_la-jdcolor-altivec.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_TRUE@\tlibsimd_la-jdmerge-altivec.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_TRUE@\tlibsimd_la-jdsample-altivec.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_TRUE@\tlibsimd_la-jfdctfst-altivec.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_TRUE@\tlibsimd_la-jfdctint-altivec.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_TRUE@\tlibsimd_la-jidctfst-altivec.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_TRUE@\tlibsimd_la-jidctint-altivec.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_FALSE@@SIMD_POWERPC_TRUE@\tlibsimd_la-jquanti-altivec.lo\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_TRUE@am_libsimd_la_OBJECTS = libsimd_la-jsimd_mips.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_MIPS_TRUE@\tjsimd_mips_dspr2.lo\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@am_libsimd_la_OBJECTS = libsimd_la-jsimd_i386.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjsimdcpu.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjfdctflt-3dn.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjidctflt-3dn.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjquant-3dn.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjccolor-mmx.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjcgray-mmx.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjcsample-mmx.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjdcolor-mmx.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjdmerge-mmx.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjdsample-mmx.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjfdctfst-mmx.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjfdctint-mmx.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjidctfst-mmx.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjidctint-mmx.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjidctred-mmx.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjquant-mmx.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjfdctflt-sse.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjidctflt-sse.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjquant-sse.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjccolor-sse2.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjcgray-sse2.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjchuff-sse2.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjcsample-sse2.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjdcolor-sse2.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjdmerge-sse2.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjdsample-sse2.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjfdctfst-sse2.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjfdctint-sse2.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjidctflt-sse2.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjidctfst-sse2.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjidctint-sse2.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjidctred-sse2.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjquantf-sse2.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjquanti-sse2.lo\n@SIMD_ARM_64_FALSE@@SIMD_ARM_TRUE@am_libsimd_la_OBJECTS =  \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_TRUE@\tlibsimd_la-jsimd_arm.lo \\\n@SIMD_ARM_64_FALSE@@SIMD_ARM_TRUE@\tjsimd_arm_neon.lo\n@SIMD_ARM_64_TRUE@am_libsimd_la_OBJECTS = libsimd_la-jsimd_arm64.lo \\\n@SIMD_ARM_64_TRUE@\tjsimd_arm64_neon.lo\nlibsimd_la_OBJECTS = $(am_libsimd_la_OBJECTS)\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nam__v_lt_1 = \nlibsimd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libsimd_la_CFLAGS) \\\n\t$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_P = $(am__v_P_@AM_V@)\nam__v_P_ = $(am__v_P_@AM_DEFAULT_V@)\nam__v_P_0 = false\nam__v_P_1 = :\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN     \" $@;\nam__v_GEN_1 = \nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nam__v_at_1 = \nDEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)\ndepcomp = $(SHELL) $(top_srcdir)/depcomp\nam__depfiles_maybe = depfiles\nam__mv = mv -f\nCPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)\nLTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \\\n\t$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \\\n\t$(AM_CCASFLAGS) $(CCASFLAGS)\nAM_V_CPPAS = $(am__v_CPPAS_@AM_V@)\nam__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@)\nam__v_CPPAS_0 = @echo \"  CPPAS   \" $@;\nam__v_CPPAS_1 = \nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nLTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \\\n\t$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \\\n\t$(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC      \" $@;\nam__v_CC_1 = \nCCLD = $(CC)\nLINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n\t$(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD    \" $@;\nam__v_CCLD_1 = \nSOURCES = $(libsimd_la_SOURCES)\nDIST_SOURCES = $(am__libsimd_la_SOURCES_DIST)\nam__can_run_installinfo = \\\n  case $$AM_UPDATE_INFO_DIR in \\\n    n|no|NO) false;; \\\n    *) (install-info --version) >/dev/null 2>&1;; \\\n  esac\nam__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)\n# Read a list of newline-separated strings from the standard input,\n# and print each of them once, without duplicates.  Input order is\n# *not* preserved.\nam__uniquify_input = $(AWK) '\\\n  BEGIN { nonempty = 0; } \\\n  { items[$$0] = 1; nonempty = 1; } \\\n  END { if (nonempty) { for (i in items) print i; }; } \\\n'\n# Make sure the list of sources is unique.  This is necessary because,\n# e.g., the same source file might be shared among _SOURCES variables\n# for different programs/libraries.\nam__define_uniq_tagged_files = \\\n  list='$(am__tagged_files)'; \\\n  unique=`for i in $$list; do \\\n    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n  done | $(am__uniquify_input)`\nETAGS = etags\nCTAGS = ctags\nam__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp\nDISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nBUILD = @BUILD@\nCC = @CC@\nCCAS = @CCAS@\nCCASDEPMODE = @CCASDEPMODE@\nCCASFLAGS = @CCASFLAGS@\nCCDEPMODE = @CCDEPMODE@\nCFLAGS = @CFLAGS@\nCPP = @CPP@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEBARCH = @DEBARCH@\nDEFS = @DEFS@\nDEPDIR = @DEPDIR@\nDLLTOOL = @DLLTOOL@\nDSYMUTIL = @DSYMUTIL@\nDUMPBIN = @DUMPBIN@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEGREP = @EGREP@\nEXEEXT = @EXEEXT@\nFGREP = @FGREP@\nGREP = @GREP@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nJAR = @JAR@\nJAVA = @JAVA@\nJAVAC = @JAVAC@\nJAVACFLAGS = @JAVACFLAGS@\nJAVA_RPM_CONTENTS_1 = @JAVA_RPM_CONTENTS_1@\nJAVA_RPM_CONTENTS_2 = @JAVA_RPM_CONTENTS_2@\nJNI_CFLAGS = @JNI_CFLAGS@\nJPEG_LIB_VERSION = @JPEG_LIB_VERSION@\nJPEG_LIB_VERSION_DECIMAL = @JPEG_LIB_VERSION_DECIMAL@\nLD = @LD@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLIBTOOL = @LIBTOOL@\nLIBTOOL_CURRENT = @LIBTOOL_CURRENT@\nLIPO = @LIPO@\nLN_S = @LN_S@\nLTLIBOBJS = @LTLIBOBJS@\nLT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@\nMAKEINFO = @MAKEINFO@\nMANIFEST_TOOL = @MANIFEST_TOOL@\nMEM_SRCDST_FUNCTIONS = @MEM_SRCDST_FUNCTIONS@\nMKDIR_P = @MKDIR_P@\nNAFLAGS = @NAFLAGS@\nNASM = @NASM@\nNM = @NM@\nNMEDIT = @NMEDIT@\nOBJDUMP = @OBJDUMP@\nOBJEXT = @OBJEXT@\nOTOOL = @OTOOL@\nOTOOL64 = @OTOOL64@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nPKGNAME = @PKGNAME@\nPKG_CONFIG = @PKG_CONFIG@\nRANLIB = @RANLIB@\nRPMARCH = @RPMARCH@\nRPM_CONFIG_ARGS = @RPM_CONFIG_ARGS@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSO_AGE = @SO_AGE@\nSO_MAJOR_VERSION = @SO_MAJOR_VERSION@\nSO_MINOR_VERSION = @SO_MINOR_VERSION@\nSTRIP = @STRIP@\nVERSION = @VERSION@\nVERSION_SCRIPT_FLAG = @VERSION_SCRIPT_FLAG@\nWITH_JAVA = @WITH_JAVA@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_AR = @ac_ct_AR@\nac_ct_CC = @ac_ct_CC@\nac_ct_DUMPBIN = @ac_ct_DUMPBIN@\nam__include = @am__include@\nam__leading_dot = @am__leading_dot@\nam__quote = @am__quote@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild = @build@\nbuild_alias = @build_alias@\nbuild_cpu = @build_cpu@\nbuild_os = @build_os@\nbuild_vendor = @build_vendor@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost = @host@\nhost_alias = @host_alias@\nhost_cpu = @host_cpu@\nhost_os = @host_os@\nhost_vendor = @host_vendor@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nnoinst_LTLIBRARIES = libsimd.la\nBUILT_SOURCES = jsimdcfg.inc\nEXTRA_DIST = nasm_lt.sh CMakeLists.txt \\\n\tjccolext-mmx.asm   jcgryext-mmx.asm   jdcolext-mmx.asm   jdmrgext-mmx.asm \\\n\tjccolext-sse2.asm  jcgryext-sse2.asm  jdcolext-sse2.asm  jdmrgext-sse2.asm \\\n\tjccolext-sse2-64.asm  jcgryext-sse2-64.asm  jdcolext-sse2-64.asm \\\n\tjdmrgext-sse2-64.asm  jccolext-altivec.c    jcgryext-altivec.c \\\n\tjdcolext-altivec.c    jdmrgext-altivec.c\n\n@SIMD_ARM_64_TRUE@libsimd_la_SOURCES = jsimd_arm64.c jsimd_arm64_neon.S\n@SIMD_ARM_TRUE@libsimd_la_SOURCES = jsimd_arm.c jsimd_arm_neon.S\n@SIMD_I386_TRUE@libsimd_la_SOURCES = jsimd_i386.c jsimd.h jsimdcfg.inc.h jsimdext.inc \\\n@SIMD_I386_TRUE@\tjcolsamp.inc jdct.inc jpeg_nbits_table.inc jsimdcpu.asm \\\n@SIMD_I386_TRUE@\tjfdctflt-3dn.asm   jidctflt-3dn.asm   jquant-3dn.asm \\\n@SIMD_I386_TRUE@\tjccolor-mmx.asm    jcgray-mmx.asm     jcsample-mmx.asm \\\n@SIMD_I386_TRUE@\tjdcolor-mmx.asm    jdmerge-mmx.asm    jdsample-mmx.asm \\\n@SIMD_I386_TRUE@\tjfdctfst-mmx.asm   jfdctint-mmx.asm   jidctfst-mmx.asm \\\n@SIMD_I386_TRUE@\tjidctint-mmx.asm   jidctred-mmx.asm   jquant-mmx.asm \\\n@SIMD_I386_TRUE@\tjfdctflt-sse.asm   jidctflt-sse.asm   jquant-sse.asm \\\n@SIMD_I386_TRUE@\tjccolor-sse2.asm   jcgray-sse2.asm    jchuff-sse2.asm \\\n@SIMD_I386_TRUE@\tjcsample-sse2.asm  jdcolor-sse2.asm   jdmerge-sse2.asm \\\n@SIMD_I386_TRUE@\tjdsample-sse2.asm  jfdctfst-sse2.asm  jfdctint-sse2.asm \\\n@SIMD_I386_TRUE@\tjidctflt-sse2.asm  jidctfst-sse2.asm  jidctint-sse2.asm \\\n@SIMD_I386_TRUE@\tjidctred-sse2.asm  jquantf-sse2.asm   jquanti-sse2.asm\n\n@SIMD_MIPS_TRUE@libsimd_la_SOURCES = jsimd_mips.c jsimd_mips_dspr2_asm.h jsimd_mips_dspr2.S\n@SIMD_POWERPC_TRUE@libsimd_la_SOURCES = jsimd_powerpc.c jsimd_altivec.h jcsample.h \\\n@SIMD_POWERPC_TRUE@\tjccolor-altivec.c     jcgray-altivec.c      jcsample-altivec.c \\\n@SIMD_POWERPC_TRUE@\tjdcolor-altivec.c     jdmerge-altivec.c     jdsample-altivec.c \\\n@SIMD_POWERPC_TRUE@\tjfdctfst-altivec.c    jfdctint-altivec.c \\\n@SIMD_POWERPC_TRUE@\tjidctfst-altivec.c    jidctint-altivec.c \\\n@SIMD_POWERPC_TRUE@\tjquanti-altivec.c\n\n@SIMD_X86_64_TRUE@libsimd_la_SOURCES = jsimd_x86_64.c jsimd.h jsimdcfg.inc.h jsimdext.inc \\\n@SIMD_X86_64_TRUE@\tjcolsamp.inc jdct.inc jpeg_nbits_table.inc jfdctflt-sse-64.asm \\\n@SIMD_X86_64_TRUE@\tjccolor-sse2-64.asm   jcgray-sse2-64.asm    jchuff-sse2-64.asm \\\n@SIMD_X86_64_TRUE@\tjcsample-sse2-64.asm  jdcolor-sse2-64.asm   jdmerge-sse2-64.asm \\\n@SIMD_X86_64_TRUE@\tjdsample-sse2-64.asm  jfdctfst-sse2-64.asm  jfdctint-sse2-64.asm \\\n@SIMD_X86_64_TRUE@\tjidctflt-sse2-64.asm  jidctfst-sse2-64.asm  jidctint-sse2-64.asm \\\n@SIMD_X86_64_TRUE@\tjidctred-sse2-64.asm  jquantf-sse2-64.asm   jquanti-sse2-64.asm\n\n@SIMD_POWERPC_TRUE@libsimd_la_CFLAGS = -maltivec\nAM_CPPFLAGS = -I$(top_srcdir)\nall: $(BUILT_SOURCES)\n\t$(MAKE) $(AM_MAKEFLAGS) all-am\n\n.SUFFIXES:\n.SUFFIXES: .S .asm .c .lo .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign simd/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign simd/Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstLTLIBRARIES:\n\t-test -z \"$(noinst_LTLIBRARIES)\" || rm -f $(noinst_LTLIBRARIES)\n\t@list='$(noinst_LTLIBRARIES)'; \\\n\tlocs=`for p in $$list; do echo $$p; done | \\\n\t      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \\\n\t      sort -u`; \\\n\ttest -z \"$$locs\" || { \\\n\t  echo rm -f $${locs}; \\\n\t  rm -f $${locs}; \\\n\t}\n\nlibsimd.la: $(libsimd_la_OBJECTS) $(libsimd_la_DEPENDENCIES) $(EXTRA_libsimd_la_DEPENDENCIES) \n\t$(AM_V_CCLD)$(libsimd_la_LINK)  $(libsimd_la_OBJECTS) $(libsimd_la_LIBADD) $(LIBS)\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsimd_arm64_neon.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsimd_arm_neon.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsimd_mips_dspr2.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jccolor-altivec.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jcgray-altivec.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jcsample-altivec.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jdcolor-altivec.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jdmerge-altivec.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jdsample-altivec.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jfdctfst-altivec.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jfdctint-altivec.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jidctfst-altivec.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jidctint-altivec.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jquanti-altivec.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jsimd_arm.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jsimd_arm64.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jsimd_i386.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jsimd_mips.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jsimd_powerpc.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsimd_la-jsimd_x86_64.Plo@am__quote@\n\n.S.o:\n@am__fastdepCCAS_TRUE@\t$(AM_V_CPPAS)$(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\n@am__fastdepCCAS_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\n@AMDEP_TRUE@@am__fastdepCCAS_FALSE@\t$(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCCAS_FALSE@\tDEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCCAS_FALSE@\t$(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $<\n\n.S.obj:\n@am__fastdepCCAS_TRUE@\t$(AM_V_CPPAS)$(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`\n@am__fastdepCCAS_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\n@AMDEP_TRUE@@am__fastdepCCAS_FALSE@\t$(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCCAS_FALSE@\tDEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCCAS_FALSE@\t$(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\n.S.lo:\n@am__fastdepCCAS_TRUE@\t$(AM_V_CPPAS)$(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\n@am__fastdepCCAS_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo\n@AMDEP_TRUE@@am__fastdepCCAS_FALSE@\t$(AM_V_CPPAS)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCCAS_FALSE@\tDEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCCAS_FALSE@\t$(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $<\n\n.c.o:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\n.c.lo:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<\n\nlibsimd_la-jsimd_arm64.lo: jsimd_arm64.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jsimd_arm64.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jsimd_arm64.Tpo -c -o libsimd_la-jsimd_arm64.lo `test -f 'jsimd_arm64.c' || echo '$(srcdir)/'`jsimd_arm64.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jsimd_arm64.Tpo $(DEPDIR)/libsimd_la-jsimd_arm64.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jsimd_arm64.c' object='libsimd_la-jsimd_arm64.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jsimd_arm64.lo `test -f 'jsimd_arm64.c' || echo '$(srcdir)/'`jsimd_arm64.c\n\nlibsimd_la-jsimd_arm.lo: jsimd_arm.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jsimd_arm.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jsimd_arm.Tpo -c -o libsimd_la-jsimd_arm.lo `test -f 'jsimd_arm.c' || echo '$(srcdir)/'`jsimd_arm.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jsimd_arm.Tpo $(DEPDIR)/libsimd_la-jsimd_arm.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jsimd_arm.c' object='libsimd_la-jsimd_arm.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jsimd_arm.lo `test -f 'jsimd_arm.c' || echo '$(srcdir)/'`jsimd_arm.c\n\nlibsimd_la-jsimd_i386.lo: jsimd_i386.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jsimd_i386.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jsimd_i386.Tpo -c -o libsimd_la-jsimd_i386.lo `test -f 'jsimd_i386.c' || echo '$(srcdir)/'`jsimd_i386.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jsimd_i386.Tpo $(DEPDIR)/libsimd_la-jsimd_i386.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jsimd_i386.c' object='libsimd_la-jsimd_i386.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jsimd_i386.lo `test -f 'jsimd_i386.c' || echo '$(srcdir)/'`jsimd_i386.c\n\nlibsimd_la-jsimd_mips.lo: jsimd_mips.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jsimd_mips.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jsimd_mips.Tpo -c -o libsimd_la-jsimd_mips.lo `test -f 'jsimd_mips.c' || echo '$(srcdir)/'`jsimd_mips.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jsimd_mips.Tpo $(DEPDIR)/libsimd_la-jsimd_mips.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jsimd_mips.c' object='libsimd_la-jsimd_mips.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jsimd_mips.lo `test -f 'jsimd_mips.c' || echo '$(srcdir)/'`jsimd_mips.c\n\nlibsimd_la-jsimd_powerpc.lo: jsimd_powerpc.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jsimd_powerpc.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jsimd_powerpc.Tpo -c -o libsimd_la-jsimd_powerpc.lo `test -f 'jsimd_powerpc.c' || echo '$(srcdir)/'`jsimd_powerpc.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jsimd_powerpc.Tpo $(DEPDIR)/libsimd_la-jsimd_powerpc.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jsimd_powerpc.c' object='libsimd_la-jsimd_powerpc.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jsimd_powerpc.lo `test -f 'jsimd_powerpc.c' || echo '$(srcdir)/'`jsimd_powerpc.c\n\nlibsimd_la-jccolor-altivec.lo: jccolor-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jccolor-altivec.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jccolor-altivec.Tpo -c -o libsimd_la-jccolor-altivec.lo `test -f 'jccolor-altivec.c' || echo '$(srcdir)/'`jccolor-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jccolor-altivec.Tpo $(DEPDIR)/libsimd_la-jccolor-altivec.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jccolor-altivec.c' object='libsimd_la-jccolor-altivec.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jccolor-altivec.lo `test -f 'jccolor-altivec.c' || echo '$(srcdir)/'`jccolor-altivec.c\n\nlibsimd_la-jcgray-altivec.lo: jcgray-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jcgray-altivec.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jcgray-altivec.Tpo -c -o libsimd_la-jcgray-altivec.lo `test -f 'jcgray-altivec.c' || echo '$(srcdir)/'`jcgray-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jcgray-altivec.Tpo $(DEPDIR)/libsimd_la-jcgray-altivec.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jcgray-altivec.c' object='libsimd_la-jcgray-altivec.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jcgray-altivec.lo `test -f 'jcgray-altivec.c' || echo '$(srcdir)/'`jcgray-altivec.c\n\nlibsimd_la-jcsample-altivec.lo: jcsample-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jcsample-altivec.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jcsample-altivec.Tpo -c -o libsimd_la-jcsample-altivec.lo `test -f 'jcsample-altivec.c' || echo '$(srcdir)/'`jcsample-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jcsample-altivec.Tpo $(DEPDIR)/libsimd_la-jcsample-altivec.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jcsample-altivec.c' object='libsimd_la-jcsample-altivec.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jcsample-altivec.lo `test -f 'jcsample-altivec.c' || echo '$(srcdir)/'`jcsample-altivec.c\n\nlibsimd_la-jdcolor-altivec.lo: jdcolor-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jdcolor-altivec.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jdcolor-altivec.Tpo -c -o libsimd_la-jdcolor-altivec.lo `test -f 'jdcolor-altivec.c' || echo '$(srcdir)/'`jdcolor-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jdcolor-altivec.Tpo $(DEPDIR)/libsimd_la-jdcolor-altivec.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdcolor-altivec.c' object='libsimd_la-jdcolor-altivec.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jdcolor-altivec.lo `test -f 'jdcolor-altivec.c' || echo '$(srcdir)/'`jdcolor-altivec.c\n\nlibsimd_la-jdmerge-altivec.lo: jdmerge-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jdmerge-altivec.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jdmerge-altivec.Tpo -c -o libsimd_la-jdmerge-altivec.lo `test -f 'jdmerge-altivec.c' || echo '$(srcdir)/'`jdmerge-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jdmerge-altivec.Tpo $(DEPDIR)/libsimd_la-jdmerge-altivec.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdmerge-altivec.c' object='libsimd_la-jdmerge-altivec.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jdmerge-altivec.lo `test -f 'jdmerge-altivec.c' || echo '$(srcdir)/'`jdmerge-altivec.c\n\nlibsimd_la-jdsample-altivec.lo: jdsample-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jdsample-altivec.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jdsample-altivec.Tpo -c -o libsimd_la-jdsample-altivec.lo `test -f 'jdsample-altivec.c' || echo '$(srcdir)/'`jdsample-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jdsample-altivec.Tpo $(DEPDIR)/libsimd_la-jdsample-altivec.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jdsample-altivec.c' object='libsimd_la-jdsample-altivec.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jdsample-altivec.lo `test -f 'jdsample-altivec.c' || echo '$(srcdir)/'`jdsample-altivec.c\n\nlibsimd_la-jfdctfst-altivec.lo: jfdctfst-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jfdctfst-altivec.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jfdctfst-altivec.Tpo -c -o libsimd_la-jfdctfst-altivec.lo `test -f 'jfdctfst-altivec.c' || echo '$(srcdir)/'`jfdctfst-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jfdctfst-altivec.Tpo $(DEPDIR)/libsimd_la-jfdctfst-altivec.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jfdctfst-altivec.c' object='libsimd_la-jfdctfst-altivec.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jfdctfst-altivec.lo `test -f 'jfdctfst-altivec.c' || echo '$(srcdir)/'`jfdctfst-altivec.c\n\nlibsimd_la-jfdctint-altivec.lo: jfdctint-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jfdctint-altivec.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jfdctint-altivec.Tpo -c -o libsimd_la-jfdctint-altivec.lo `test -f 'jfdctint-altivec.c' || echo '$(srcdir)/'`jfdctint-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jfdctint-altivec.Tpo $(DEPDIR)/libsimd_la-jfdctint-altivec.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jfdctint-altivec.c' object='libsimd_la-jfdctint-altivec.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jfdctint-altivec.lo `test -f 'jfdctint-altivec.c' || echo '$(srcdir)/'`jfdctint-altivec.c\n\nlibsimd_la-jidctfst-altivec.lo: jidctfst-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jidctfst-altivec.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jidctfst-altivec.Tpo -c -o libsimd_la-jidctfst-altivec.lo `test -f 'jidctfst-altivec.c' || echo '$(srcdir)/'`jidctfst-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jidctfst-altivec.Tpo $(DEPDIR)/libsimd_la-jidctfst-altivec.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jidctfst-altivec.c' object='libsimd_la-jidctfst-altivec.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jidctfst-altivec.lo `test -f 'jidctfst-altivec.c' || echo '$(srcdir)/'`jidctfst-altivec.c\n\nlibsimd_la-jidctint-altivec.lo: jidctint-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jidctint-altivec.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jidctint-altivec.Tpo -c -o libsimd_la-jidctint-altivec.lo `test -f 'jidctint-altivec.c' || echo '$(srcdir)/'`jidctint-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jidctint-altivec.Tpo $(DEPDIR)/libsimd_la-jidctint-altivec.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jidctint-altivec.c' object='libsimd_la-jidctint-altivec.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jidctint-altivec.lo `test -f 'jidctint-altivec.c' || echo '$(srcdir)/'`jidctint-altivec.c\n\nlibsimd_la-jquanti-altivec.lo: jquanti-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jquanti-altivec.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jquanti-altivec.Tpo -c -o libsimd_la-jquanti-altivec.lo `test -f 'jquanti-altivec.c' || echo '$(srcdir)/'`jquanti-altivec.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jquanti-altivec.Tpo $(DEPDIR)/libsimd_la-jquanti-altivec.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jquanti-altivec.c' object='libsimd_la-jquanti-altivec.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jquanti-altivec.lo `test -f 'jquanti-altivec.c' || echo '$(srcdir)/'`jquanti-altivec.c\n\nlibsimd_la-jsimd_x86_64.lo: jsimd_x86_64.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -MT libsimd_la-jsimd_x86_64.lo -MD -MP -MF $(DEPDIR)/libsimd_la-jsimd_x86_64.Tpo -c -o libsimd_la-jsimd_x86_64.lo `test -f 'jsimd_x86_64.c' || echo '$(srcdir)/'`jsimd_x86_64.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libsimd_la-jsimd_x86_64.Tpo $(DEPDIR)/libsimd_la-jsimd_x86_64.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='jsimd_x86_64.c' object='libsimd_la-jsimd_x86_64.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsimd_la_CFLAGS) $(CFLAGS) -c -o libsimd_la-jsimd_x86_64.lo `test -f 'jsimd_x86_64.c' || echo '$(srcdir)/'`jsimd_x86_64.c\n\nmostlyclean-libtool:\n\t-rm -f *.lo\n\nclean-libtool:\n\t-rm -rf .libs _libs\n\nID: $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); mkid -fID $$unique\ntags: tags-am\nTAGS: tags\n\ntags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\tset x; \\\n\there=`pwd`; \\\n\t$(am__define_uniq_tagged_files); \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: ctags-am\n\nCTAGS: ctags\nctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)\n\t$(am__define_uniq_tagged_files); \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\ncscopelist: cscopelist-am\n\ncscopelist-am: $(am__tagged_files)\n\tlist='$(am__tagged_files)'; \\\n\tcase \"$(srcdir)\" in \\\n\t  [\\\\/]* | ?:[\\\\/]*) sdir=\"$(srcdir)\" ;; \\\n\t  *) sdir=$(subdir)/$(srcdir) ;; \\\n\tesac; \\\n\tfor i in $$list; do \\\n\t  if test -f \"$$i\"; then \\\n\t    echo \"$(subdir)/$$i\"; \\\n\t  else \\\n\t    echo \"$$sdir/$$i\"; \\\n\t  fi; \\\n\tdone >> $(top_builddir)/cscope.files\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\n\ndistdir: $(DISTFILES)\n\t@srcdirstrip=`echo \"$(srcdir)\" | sed 's/[].[^$$\\\\*]/\\\\\\\\&/g'`; \\\n\ttopsrcdirstrip=`echo \"$(top_srcdir)\" | sed 's/[].[^$$\\\\*]/\\\\\\\\&/g'`; \\\n\tlist='$(DISTFILES)'; \\\n\t  dist_files=`for file in $$list; do echo $$file; done | \\\n\t  sed -e \"s|^$$srcdirstrip/||;t\" \\\n\t      -e \"s|^$$topsrcdirstrip/|$(top_builddir)/|;t\"`; \\\n\tcase $$dist_files in \\\n\t  */*) $(MKDIR_P) `echo \"$$dist_files\" | \\\n\t\t\t   sed '/\\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \\\n\t\t\t   sort -u` ;; \\\n\tesac; \\\n\tfor file in $$dist_files; do \\\n\t  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n\t  if test -d $$d/$$file; then \\\n\t    dir=`echo \"/$$file\" | sed -e 's,/[^/]*$$,,'`; \\\n\t    if test -d \"$(distdir)/$$file\"; then \\\n\t      find \"$(distdir)/$$file\" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n\t    fi; \\\n\t    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n\t      cp -fpR $(srcdir)/$$file \"$(distdir)$$dir\" || exit 1; \\\n\t      find \"$(distdir)/$$file\" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n\t    fi; \\\n\t    cp -fpR $$d/$$file \"$(distdir)$$dir\" || exit 1; \\\n\t  else \\\n\t    test -f \"$(distdir)/$$file\" \\\n\t    || cp -p $$d/$$file \"$(distdir)/$$file\" \\\n\t    || exit 1; \\\n\t  fi; \\\n\tdone\ncheck-am: all-am\ncheck: $(BUILT_SOURCES)\n\t$(MAKE) $(AM_MAKEFLAGS) check-am\nall-am: Makefile $(LTLIBRARIES)\ninstalldirs:\ninstall: $(BUILT_SOURCES)\n\t$(MAKE) $(AM_MAKEFLAGS) install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\n\t-test -z \"$(BUILT_SOURCES)\" || rm -f $(BUILT_SOURCES)\nclean: clean-am\n\nclean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \\\n\tmostlyclean-am\n\ndistclean: distclean-am\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n\tmostlyclean-libtool\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am:\n\n.MAKE: all check install install-am install-strip\n\n.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \\\n\tclean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \\\n\tctags-am distclean distclean-compile distclean-generic \\\n\tdistclean-libtool distclean-tags distdir dvi dvi-am html \\\n\thtml-am info info-am install install-am install-data \\\n\tinstall-data-am install-dvi install-dvi-am install-exec \\\n\tinstall-exec-am install-html install-html-am install-info \\\n\tinstall-info-am install-man install-pdf install-pdf-am \\\n\tinstall-ps install-ps-am install-strip installcheck \\\n\tinstallcheck-am installdirs maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \\\n\ttags tags-am uninstall uninstall-am\n\n.PRECIOUS: Makefile\n\n\n@SIMD_X86_64_TRUE@jccolor-sse2-64.lo:  jccolext-sse2-64.asm\n@SIMD_X86_64_TRUE@jcgray-sse2-64.lo:   jcgryext-sse2-64.asm\n@SIMD_X86_64_TRUE@jdcolor-sse2-64.lo:  jdcolext-sse2-64.asm\n@SIMD_X86_64_TRUE@jdmerge-sse2-64.lo:  jdmrgext-sse2-64.asm\n\n@SIMD_I386_TRUE@jccolor-mmx.lo:   jccolext-mmx.asm\n@SIMD_I386_TRUE@jcgray.-mmx.lo:   jcgryext-mmx.asm\n@SIMD_I386_TRUE@jdcolor-mmx.lo:   jdcolext-mmx.asm\n@SIMD_I386_TRUE@jdmerge-mmx.lo:   jdmrgext-mmx.asm\n@SIMD_I386_TRUE@jccolor-sse2.lo:  jccolext-sse2.asm\n@SIMD_I386_TRUE@jcgray-sse2.lo:   jcgryext-sse2.asm\n@SIMD_I386_TRUE@jdcolor-sse2.lo:  jdcolext-sse2.asm\n@SIMD_I386_TRUE@jdmerge-sse2.lo:  jdmrgext-sse2.asm\n\n@SIMD_POWERPC_TRUE@jccolor-altivec.lo:  jccolext-altivec.c\n@SIMD_POWERPC_TRUE@jcgray-altivec.lo:   jcgryext-altivec.c\n@SIMD_POWERPC_TRUE@jdcolor-altivec.lo:  jdcolext-altivec.c\n@SIMD_POWERPC_TRUE@jdmerge-altivec.lo:  jdmrgext-altivec.c\n\n.asm.lo:\n\t$(AM_V_GEN) $(LIBTOOL) $(AM_V_lt) --mode=compile --tag NASM $(srcdir)/nasm_lt.sh $(AM_V_lt) $(NASM) $(NAFLAGS) -I$(srcdir) -I. $< -o $@\n\njsimdcfg.inc: $(srcdir)/jsimdcfg.inc.h ../jpeglib.h ../jconfig.h ../jmorecfg.h\n\t$(AM_V_GEN) $(CPP) -I$(top_builddir) -I$(top_builddir)/simd $(srcdir)/jsimdcfg.inc.h | $(EGREP) \"^[\\;%]|^\\ %\" | sed 's%_cpp_protection_%%' | sed 's@% define@%define@g' > $@\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jccolext-altivec.c",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2014-2015, D. R. Commander.  All Rights Reserved.\n * Copyright (C) 2014, Jay Foad.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n/* This file is included by jccolor-altivec.c */\n\n\nvoid jsimd_rgb_ycc_convert_altivec (JDIMENSION img_width, JSAMPARRAY input_buf,\n                                    JSAMPIMAGE output_buf,\n                                    JDIMENSION output_row, int num_rows)\n{\n  JSAMPROW inptr, outptr0, outptr1, outptr2;\n  int pitch = img_width * RGB_PIXELSIZE, num_cols;\n#if __BIG_ENDIAN__\n  int offset;\n#endif\n  unsigned char __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16];\n\n  __vector unsigned char rgb0, rgb1 = {0}, rgb2 = {0},\n    rgbg0, rgbg1, rgbg2, rgbg3, y, cb, cr;\n#if __BIG_ENDIAN__ || RGB_PIXELSIZE == 4\n  __vector unsigned char rgb3 = {0};\n#endif\n#if __BIG_ENDIAN__ && RGB_PIXELSIZE == 4\n  __vector unsigned char rgb4 = {0};\n#endif\n  __vector short rg0, rg1, rg2, rg3, bg0, bg1, bg2, bg3;\n  __vector unsigned short yl, yh, crl, crh, cbl, cbh;\n  __vector int y0, y1, y2, y3, cr0, cr1, cr2, cr3, cb0, cb1, cb2, cb3;\n\n  /* Constants */\n  __vector short pw_f0299_f0337 = { __4X2(F_0_299, F_0_337) },\n    pw_f0114_f0250 = { __4X2(F_0_114, F_0_250) },\n    pw_mf016_mf033 = { __4X2(-F_0_168, -F_0_331) },\n    pw_mf008_mf041 = { __4X2(-F_0_081, -F_0_418) };\n  __vector unsigned short pw_f050_f000 = { __4X2(F_0_500, 0) };\n  __vector int pd_onehalf = { __4X(ONE_HALF) },\n    pd_onehalfm1_cj = { __4X(ONE_HALF - 1 + (CENTERJSAMPLE << SCALEBITS)) };\n  __vector unsigned char pb_zero = { __16X(0) },\n#if __BIG_ENDIAN__\n    shift_pack_index = {0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29};\n#else\n    shift_pack_index = {2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31};\n#endif\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr0 = output_buf[0][output_row];\n    outptr1 = output_buf[1][output_row];\n    outptr2 = output_buf[2][output_row];\n    output_row++;\n\n    for (num_cols = pitch; num_cols > 0;\n         num_cols -= RGB_PIXELSIZE * 16, inptr += RGB_PIXELSIZE * 16,\n         outptr0 += 16, outptr1 += 16, outptr2 += 16) {\n\n#if __BIG_ENDIAN__\n      /* Load 16 pixels == 48 or 64 bytes */\n      offset = (size_t)inptr & 15;\n      if (offset) {\n        __vector unsigned char unaligned_shift_index;\n        int bytes = num_cols + offset;\n\n        if (bytes < (RGB_PIXELSIZE + 1) * 16 && (bytes & 15)) {\n          /* Slow path to prevent buffer overread.  Since there is no way to\n           * read a partial AltiVec register, overread would occur on the last\n           * chunk of the last image row if the right edge is not on a 16-byte\n           * boundary.  It could also occur on other rows if the bytes per row\n           * is low enough.  Since we can't determine whether we're on the last\n           * image row, we have to assume every row is the last.\n           */\n          memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16));\n          rgb0 = vec_ld(0, tmpbuf);\n          rgb1 = vec_ld(16, tmpbuf);\n          rgb2 = vec_ld(32, tmpbuf);\n#if RGB_PIXELSIZE == 4\n          rgb3 = vec_ld(48, tmpbuf);\n#endif\n        } else {\n          /* Fast path */\n          rgb0 = vec_ld(0, inptr);\n          if (bytes > 16)\n            rgb1 = vec_ld(16, inptr);\n          if (bytes > 32)\n            rgb2 = vec_ld(32, inptr);\n          if (bytes > 48)\n            rgb3 = vec_ld(48, inptr);\n#if RGB_PIXELSIZE == 4\n          if (bytes > 64)\n            rgb4 = vec_ld(64, inptr);\n#endif\n          unaligned_shift_index = vec_lvsl(0, inptr);\n          rgb0 = vec_perm(rgb0, rgb1, unaligned_shift_index);\n          rgb1 = vec_perm(rgb1, rgb2, unaligned_shift_index);\n          rgb2 = vec_perm(rgb2, rgb3, unaligned_shift_index);\n#if RGB_PIXELSIZE == 4\n          rgb3 = vec_perm(rgb3, rgb4, unaligned_shift_index);\n#endif\n        }\n      } else {\n#endif /* __BIG_ENDIAN__ */\n        if (num_cols < RGB_PIXELSIZE * 16 && (num_cols & 15)) {\n          /* Slow path */\n          memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16));\n          rgb0 = VEC_LD(0, tmpbuf);\n          rgb1 = VEC_LD(16, tmpbuf);\n          rgb2 = VEC_LD(32, tmpbuf);\n#if RGB_PIXELSIZE == 4\n          rgb3 = VEC_LD(48, tmpbuf);\n#endif\n        } else {\n          /* Fast path */\n          rgb0 = VEC_LD(0, inptr);\n          if (num_cols > 16)\n            rgb1 = VEC_LD(16, inptr);\n          if (num_cols > 32)\n            rgb2 = VEC_LD(32, inptr);\n#if RGB_PIXELSIZE == 4\n          if (num_cols > 48)\n            rgb3 = VEC_LD(48, inptr);\n#endif\n        }\n#if __BIG_ENDIAN__\n      }\n#endif\n\n#if RGB_PIXELSIZE == 3\n      /* rgb0 = R0 G0 B0 R1 G1 B1 R2 G2 B2 R3 G3 B3 R4 G4 B4 R5\n       * rgb1 = G5 B5 R6 G6 B6 R7 G7 B7 R8 G8 B8 R9 G9 B9 Ra Ga\n       * rgb2 = Ba Rb Gb Bb Rc Gc Bc Rd Gd Bd Re Ge Be Rf Gf Bf\n       *\n       * rgbg0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 G0 B1 G1 B2 G2 B3 G3\n       * rgbg1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 G4 B5 G5 B6 G6 B7 G7\n       * rgbg2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 G8 B9 G9 Ba Ga Bb Gb\n       * rgbg3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Gc Bd Gd Be Ge Bf Gf\n       */\n      rgbg0 = vec_perm(rgb0, rgb0, (__vector unsigned char)RGBG_INDEX0);\n      rgbg1 = vec_perm(rgb0, rgb1, (__vector unsigned char)RGBG_INDEX1);\n      rgbg2 = vec_perm(rgb1, rgb2, (__vector unsigned char)RGBG_INDEX2);\n      rgbg3 = vec_perm(rgb2, rgb2, (__vector unsigned char)RGBG_INDEX3);\n#else\n      /* rgb0 = R0 G0 B0 X0 R1 G1 B1 X1 R2 G2 B2 X2 R3 G3 B3 X3\n       * rgb1 = R4 G4 B4 X4 R5 G5 B5 X5 R6 G6 B6 X6 R7 G7 B7 X7\n       * rgb2 = R8 G8 B8 X8 R9 G9 B9 X9 Ra Ga Ba Xa Rb Gb Bb Xb\n       * rgb3 = Rc Gc Bc Xc Rd Gd Bd Xd Re Ge Be Xe Rf Gf Bf Xf\n       *\n       * rgbg0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 G0 B1 G1 B2 G2 B3 G3\n       * rgbg1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 G4 B5 G5 B6 G6 B7 G7\n       * rgbg2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 G8 B9 G9 Ba Ga Bb Gb\n       * rgbg3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Gc Bd Gd Be Ge Bf Gf\n       */\n      rgbg0 = vec_perm(rgb0, rgb0, (__vector unsigned char)RGBG_INDEX);\n      rgbg1 = vec_perm(rgb1, rgb1, (__vector unsigned char)RGBG_INDEX);\n      rgbg2 = vec_perm(rgb2, rgb2, (__vector unsigned char)RGBG_INDEX);\n      rgbg3 = vec_perm(rgb3, rgb3, (__vector unsigned char)RGBG_INDEX);\n#endif\n\n      /* rg0 = R0 G0 R1 G1 R2 G2 R3 G3\n       * bg0 = B0 G0 B1 G1 B2 G2 B3 G3\n       * ...\n       *\n       * NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't\n       * support unsigned vectors.\n       */\n      rg0 = (__vector signed short)VEC_UNPACKHU(rgbg0);\n      bg0 = (__vector signed short)VEC_UNPACKLU(rgbg0);\n      rg1 = (__vector signed short)VEC_UNPACKHU(rgbg1);\n      bg1 = (__vector signed short)VEC_UNPACKLU(rgbg1);\n      rg2 = (__vector signed short)VEC_UNPACKHU(rgbg2);\n      bg2 = (__vector signed short)VEC_UNPACKLU(rgbg2);\n      rg3 = (__vector signed short)VEC_UNPACKHU(rgbg3);\n      bg3 = (__vector signed short)VEC_UNPACKLU(rgbg3);\n\n      /* (Original)\n       * Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n       * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE\n       * Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE\n       *\n       * (This implementation)\n       * Y  =  0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G\n       * Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE\n       * Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE\n       */\n\n      /* Calculate Y values */\n\n      y0 = vec_msums(rg0, pw_f0299_f0337, pd_onehalf);\n      y1 = vec_msums(rg1, pw_f0299_f0337, pd_onehalf);\n      y2 = vec_msums(rg2, pw_f0299_f0337, pd_onehalf);\n      y3 = vec_msums(rg3, pw_f0299_f0337, pd_onehalf);\n      y0 = vec_msums(bg0, pw_f0114_f0250, y0);\n      y1 = vec_msums(bg1, pw_f0114_f0250, y1);\n      y2 = vec_msums(bg2, pw_f0114_f0250, y2);\n      y3 = vec_msums(bg3, pw_f0114_f0250, y3);\n      /* Clever way to avoid 4 shifts + 2 packs.  This packs the high word from\n       * each dword into a new 16-bit vector, which is the equivalent of\n       * descaling the 32-bit results (right-shifting by 16 bits) and then\n       * packing them.\n       */\n      yl = vec_perm((__vector unsigned short)y0, (__vector unsigned short)y1,\n                    shift_pack_index);\n      yh = vec_perm((__vector unsigned short)y2, (__vector unsigned short)y3,\n                    shift_pack_index);\n      y = vec_pack(yl, yh);\n      vec_st(y, 0, outptr0);\n\n      /* Calculate Cb values */\n      cb0 = vec_msums(rg0, pw_mf016_mf033, pd_onehalfm1_cj);\n      cb1 = vec_msums(rg1, pw_mf016_mf033, pd_onehalfm1_cj);\n      cb2 = vec_msums(rg2, pw_mf016_mf033, pd_onehalfm1_cj);\n      cb3 = vec_msums(rg3, pw_mf016_mf033, pd_onehalfm1_cj);\n      cb0 = (__vector int)vec_msum((__vector unsigned short)bg0, pw_f050_f000,\n                                   (__vector unsigned int)cb0);\n      cb1 = (__vector int)vec_msum((__vector unsigned short)bg1, pw_f050_f000,\n                                   (__vector unsigned int)cb1);\n      cb2 = (__vector int)vec_msum((__vector unsigned short)bg2, pw_f050_f000,\n                                   (__vector unsigned int)cb2);\n      cb3 = (__vector int)vec_msum((__vector unsigned short)bg3, pw_f050_f000,\n                                   (__vector unsigned int)cb3);\n      cbl = vec_perm((__vector unsigned short)cb0,\n                     (__vector unsigned short)cb1, shift_pack_index);\n      cbh = vec_perm((__vector unsigned short)cb2,\n                     (__vector unsigned short)cb3, shift_pack_index);\n      cb = vec_pack(cbl, cbh);\n      vec_st(cb, 0, outptr1);\n\n      /* Calculate Cr values */\n      cr0 = vec_msums(bg0, pw_mf008_mf041, pd_onehalfm1_cj);\n      cr1 = vec_msums(bg1, pw_mf008_mf041, pd_onehalfm1_cj);\n      cr2 = vec_msums(bg2, pw_mf008_mf041, pd_onehalfm1_cj);\n      cr3 = vec_msums(bg3, pw_mf008_mf041, pd_onehalfm1_cj);\n      cr0 = (__vector int)vec_msum((__vector unsigned short)rg0, pw_f050_f000,\n                                   (__vector unsigned int)cr0);\n      cr1 = (__vector int)vec_msum((__vector unsigned short)rg1, pw_f050_f000,\n                                   (__vector unsigned int)cr1);\n      cr2 = (__vector int)vec_msum((__vector unsigned short)rg2, pw_f050_f000,\n                                   (__vector unsigned int)cr2);\n      cr3 = (__vector int)vec_msum((__vector unsigned short)rg3, pw_f050_f000,\n                                   (__vector unsigned int)cr3);\n      crl = vec_perm((__vector unsigned short)cr0,\n                     (__vector unsigned short)cr1, shift_pack_index);\n      crh = vec_perm((__vector unsigned short)cr2,\n                     (__vector unsigned short)cr3, shift_pack_index);\n      cr = vec_pack(crl, crh);\n      vec_st(cr, 0, outptr2);\n    }\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jccolext-mmx.asm",
    "content": ";\n; jccolext.asm - colorspace conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_rgb_ycc_convert_mmx (JDIMENSION img_width,\n;                           JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n;                           JDIMENSION output_row, int num_rows);\n;\n\n%define img_width(b)    (b)+8           ; JDIMENSION img_width\n%define input_buf(b)    (b)+12          ; JSAMPARRAY input_buf\n%define output_buf(b)   (b)+16          ; JSAMPIMAGE output_buf\n%define output_row(b)   (b)+20          ; JDIMENSION output_row\n%define num_rows(b)     (b)+24          ; int num_rows\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_MMWORD  ; mmword wk[WK_NUM]\n%define WK_NUM          8\n%define gotptr          wk(0)-SIZEOF_POINTER    ; void * gotptr\n\n        align   16\n        global  EXTN(jsimd_rgb_ycc_convert_mmx)\n\nEXTN(jsimd_rgb_ycc_convert_mmx):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_MMWORD)      ; align to 64 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic eax             ; make a room for GOT address\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx                     ; get GOT address\n        movpic  POINTER [gotptr], ebx   ; save GOT address\n\n        mov     ecx, JDIMENSION [img_width(eax)]        ; num_cols\n        test    ecx,ecx\n        jz      near .return\n\n        push    ecx\n\n        mov     esi, JSAMPIMAGE [output_buf(eax)]\n        mov     ecx, JDIMENSION [output_row(eax)]\n        mov     edi, JSAMPARRAY [esi+0*SIZEOF_JSAMPARRAY]\n        mov     ebx, JSAMPARRAY [esi+1*SIZEOF_JSAMPARRAY]\n        mov     edx, JSAMPARRAY [esi+2*SIZEOF_JSAMPARRAY]\n        lea     edi, [edi+ecx*SIZEOF_JSAMPROW]\n        lea     ebx, [ebx+ecx*SIZEOF_JSAMPROW]\n        lea     edx, [edx+ecx*SIZEOF_JSAMPROW]\n\n        pop     ecx\n\n        mov     esi, JSAMPARRAY [input_buf(eax)]\n        mov     eax, INT [num_rows(eax)]\n        test    eax,eax\n        jle     near .return\n        alignx  16,7\n.rowloop:\n        pushpic eax\n        push    edx\n        push    ebx\n        push    edi\n        push    esi\n        push    ecx                     ; col\n\n        mov     esi, JSAMPROW [esi]     ; inptr\n        mov     edi, JSAMPROW [edi]     ; outptr0\n        mov     ebx, JSAMPROW [ebx]     ; outptr1\n        mov     edx, JSAMPROW [edx]     ; outptr2\n        movpic  eax, POINTER [gotptr]   ; load GOT address (eax)\n\n        cmp     ecx, byte SIZEOF_MMWORD\n        jae     short .columnloop\n        alignx  16,7\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n.column_ld1:\n        push    eax\n        push    edx\n        lea     ecx,[ecx+ecx*2]         ; imul ecx,RGB_PIXELSIZE\n        test    cl, SIZEOF_BYTE\n        jz      short .column_ld2\n        sub     ecx, byte SIZEOF_BYTE\n        xor     eax,eax\n        mov     al, BYTE [esi+ecx]\n.column_ld2:\n        test    cl, SIZEOF_WORD\n        jz      short .column_ld4\n        sub     ecx, byte SIZEOF_WORD\n        xor     edx,edx\n        mov     dx, WORD [esi+ecx]\n        shl     eax, WORD_BIT\n        or      eax,edx\n.column_ld4:\n        movd    mmA,eax\n        pop     edx\n        pop     eax\n        test    cl, SIZEOF_DWORD\n        jz      short .column_ld8\n        sub     ecx, byte SIZEOF_DWORD\n        movd    mmG, DWORD [esi+ecx]\n        psllq   mmA, DWORD_BIT\n        por     mmA,mmG\n.column_ld8:\n        test    cl, SIZEOF_MMWORD\n        jz      short .column_ld16\n        movq    mmG,mmA\n        movq    mmA, MMWORD [esi+0*SIZEOF_MMWORD]\n        mov     ecx, SIZEOF_MMWORD\n        jmp     short .rgb_ycc_cnv\n.column_ld16:\n        test    cl, 2*SIZEOF_MMWORD\n        mov     ecx, SIZEOF_MMWORD\n        jz      short .rgb_ycc_cnv\n        movq    mmF,mmA\n        movq    mmA, MMWORD [esi+0*SIZEOF_MMWORD]\n        movq    mmG, MMWORD [esi+1*SIZEOF_MMWORD]\n        jmp     short .rgb_ycc_cnv\n        alignx  16,7\n\n.columnloop:\n        movq    mmA, MMWORD [esi+0*SIZEOF_MMWORD]\n        movq    mmG, MMWORD [esi+1*SIZEOF_MMWORD]\n        movq    mmF, MMWORD [esi+2*SIZEOF_MMWORD]\n\n.rgb_ycc_cnv:\n        ; mmA=(00 10 20 01 11 21 02 12)\n        ; mmG=(22 03 13 23 04 14 24 05)\n        ; mmF=(15 25 06 16 26 07 17 27)\n\n        movq      mmD,mmA\n        psllq     mmA,4*BYTE_BIT        ; mmA=(-- -- -- -- 00 10 20 01)\n        psrlq     mmD,4*BYTE_BIT        ; mmD=(11 21 02 12 -- -- -- --)\n\n        punpckhbw mmA,mmG               ; mmA=(00 04 10 14 20 24 01 05)\n        psllq     mmG,4*BYTE_BIT        ; mmG=(-- -- -- -- 22 03 13 23)\n\n        punpcklbw mmD,mmF               ; mmD=(11 15 21 25 02 06 12 16)\n        punpckhbw mmG,mmF               ; mmG=(22 26 03 07 13 17 23 27)\n\n        movq      mmE,mmA\n        psllq     mmA,4*BYTE_BIT        ; mmA=(-- -- -- -- 00 04 10 14)\n        psrlq     mmE,4*BYTE_BIT        ; mmE=(20 24 01 05 -- -- -- --)\n\n        punpckhbw mmA,mmD               ; mmA=(00 02 04 06 10 12 14 16)\n        psllq     mmD,4*BYTE_BIT        ; mmD=(-- -- -- -- 11 15 21 25)\n\n        punpcklbw mmE,mmG               ; mmE=(20 22 24 26 01 03 05 07)\n        punpckhbw mmD,mmG               ; mmD=(11 13 15 17 21 23 25 27)\n\n        pxor      mmH,mmH\n\n        movq      mmC,mmA\n        punpcklbw mmA,mmH               ; mmA=(00 02 04 06)\n        punpckhbw mmC,mmH               ; mmC=(10 12 14 16)\n\n        movq      mmB,mmE\n        punpcklbw mmE,mmH               ; mmE=(20 22 24 26)\n        punpckhbw mmB,mmH               ; mmB=(01 03 05 07)\n\n        movq      mmF,mmD\n        punpcklbw mmD,mmH               ; mmD=(11 13 15 17)\n        punpckhbw mmF,mmH               ; mmF=(21 23 25 27)\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n.column_ld1:\n        test    cl, SIZEOF_MMWORD/8\n        jz      short .column_ld2\n        sub     ecx, byte SIZEOF_MMWORD/8\n        movd    mmA, DWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld2:\n        test    cl, SIZEOF_MMWORD/4\n        jz      short .column_ld4\n        sub     ecx, byte SIZEOF_MMWORD/4\n        movq    mmF,mmA\n        movq    mmA, MMWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld4:\n        test    cl, SIZEOF_MMWORD/2\n        mov     ecx, SIZEOF_MMWORD\n        jz      short .rgb_ycc_cnv\n        movq    mmD,mmA\n        movq    mmC,mmF\n        movq    mmA, MMWORD [esi+0*SIZEOF_MMWORD]\n        movq    mmF, MMWORD [esi+1*SIZEOF_MMWORD]\n        jmp     short .rgb_ycc_cnv\n        alignx  16,7\n\n.columnloop:\n        movq    mmA, MMWORD [esi+0*SIZEOF_MMWORD]\n        movq    mmF, MMWORD [esi+1*SIZEOF_MMWORD]\n        movq    mmD, MMWORD [esi+2*SIZEOF_MMWORD]\n        movq    mmC, MMWORD [esi+3*SIZEOF_MMWORD]\n\n.rgb_ycc_cnv:\n        ; mmA=(00 10 20 30 01 11 21 31)\n        ; mmF=(02 12 22 32 03 13 23 33)\n        ; mmD=(04 14 24 34 05 15 25 35)\n        ; mmC=(06 16 26 36 07 17 27 37)\n\n        movq      mmB,mmA\n        punpcklbw mmA,mmF               ; mmA=(00 02 10 12 20 22 30 32)\n        punpckhbw mmB,mmF               ; mmB=(01 03 11 13 21 23 31 33)\n\n        movq      mmG,mmD\n        punpcklbw mmD,mmC               ; mmD=(04 06 14 16 24 26 34 36)\n        punpckhbw mmG,mmC               ; mmG=(05 07 15 17 25 27 35 37)\n\n        movq      mmE,mmA\n        punpcklwd mmA,mmD               ; mmA=(00 02 04 06 10 12 14 16)\n        punpckhwd mmE,mmD               ; mmE=(20 22 24 26 30 32 34 36)\n\n        movq      mmH,mmB\n        punpcklwd mmB,mmG               ; mmB=(01 03 05 07 11 13 15 17)\n        punpckhwd mmH,mmG               ; mmH=(21 23 25 27 31 33 35 37)\n\n        pxor      mmF,mmF\n\n        movq      mmC,mmA\n        punpcklbw mmA,mmF               ; mmA=(00 02 04 06)\n        punpckhbw mmC,mmF               ; mmC=(10 12 14 16)\n\n        movq      mmD,mmB\n        punpcklbw mmB,mmF               ; mmB=(01 03 05 07)\n        punpckhbw mmD,mmF               ; mmD=(11 13 15 17)\n\n        movq      mmG,mmE\n        punpcklbw mmE,mmF               ; mmE=(20 22 24 26)\n        punpckhbw mmG,mmF               ; mmG=(30 32 34 36)\n\n        punpcklbw mmF,mmH\n        punpckhbw mmH,mmH\n        psrlw     mmF,BYTE_BIT          ; mmF=(21 23 25 27)\n        psrlw     mmH,BYTE_BIT          ; mmH=(31 33 35 37)\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n        ; mm0=(R0 R2 R4 R6)=RE, mm2=(G0 G2 G4 G6)=GE, mm4=(B0 B2 B4 B6)=BE\n        ; mm1=(R1 R3 R5 R7)=RO, mm3=(G1 G3 G5 G7)=GO, mm5=(B1 B3 B5 B7)=BO\n\n        ; (Original)\n        ; Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n        ; Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE\n        ; Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE\n        ;\n        ; (This implementation)\n        ; Y  =  0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G\n        ; Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE\n        ; Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE\n\n        movq      MMWORD [wk(0)], mm0   ; wk(0)=RE\n        movq      MMWORD [wk(1)], mm1   ; wk(1)=RO\n        movq      MMWORD [wk(2)], mm4   ; wk(2)=BE\n        movq      MMWORD [wk(3)], mm5   ; wk(3)=BO\n\n        movq      mm6,mm1\n        punpcklwd mm1,mm3\n        punpckhwd mm6,mm3\n        movq      mm7,mm1\n        movq      mm4,mm6\n        pmaddwd   mm1,[GOTOFF(eax,PW_F0299_F0337)] ; mm1=ROL*FIX(0.299)+GOL*FIX(0.337)\n        pmaddwd   mm6,[GOTOFF(eax,PW_F0299_F0337)] ; mm6=ROH*FIX(0.299)+GOH*FIX(0.337)\n        pmaddwd   mm7,[GOTOFF(eax,PW_MF016_MF033)] ; mm7=ROL*-FIX(0.168)+GOL*-FIX(0.331)\n        pmaddwd   mm4,[GOTOFF(eax,PW_MF016_MF033)] ; mm4=ROH*-FIX(0.168)+GOH*-FIX(0.331)\n\n        movq      MMWORD [wk(4)], mm1   ; wk(4)=ROL*FIX(0.299)+GOL*FIX(0.337)\n        movq      MMWORD [wk(5)], mm6   ; wk(5)=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n        pxor      mm1,mm1\n        pxor      mm6,mm6\n        punpcklwd mm1,mm5               ; mm1=BOL\n        punpckhwd mm6,mm5               ; mm6=BOH\n        psrld     mm1,1                 ; mm1=BOL*FIX(0.500)\n        psrld     mm6,1                 ; mm6=BOH*FIX(0.500)\n\n        movq      mm5,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; mm5=[PD_ONEHALFM1_CJ]\n\n        paddd     mm7,mm1\n        paddd     mm4,mm6\n        paddd     mm7,mm5\n        paddd     mm4,mm5\n        psrld     mm7,SCALEBITS         ; mm7=CbOL\n        psrld     mm4,SCALEBITS         ; mm4=CbOH\n        packssdw  mm7,mm4               ; mm7=CbO\n\n        movq      mm1, MMWORD [wk(2)]   ; mm1=BE\n\n        movq      mm6,mm0\n        punpcklwd mm0,mm2\n        punpckhwd mm6,mm2\n        movq      mm5,mm0\n        movq      mm4,mm6\n        pmaddwd   mm0,[GOTOFF(eax,PW_F0299_F0337)] ; mm0=REL*FIX(0.299)+GEL*FIX(0.337)\n        pmaddwd   mm6,[GOTOFF(eax,PW_F0299_F0337)] ; mm6=REH*FIX(0.299)+GEH*FIX(0.337)\n        pmaddwd   mm5,[GOTOFF(eax,PW_MF016_MF033)] ; mm5=REL*-FIX(0.168)+GEL*-FIX(0.331)\n        pmaddwd   mm4,[GOTOFF(eax,PW_MF016_MF033)] ; mm4=REH*-FIX(0.168)+GEH*-FIX(0.331)\n\n        movq      MMWORD [wk(6)], mm0   ; wk(6)=REL*FIX(0.299)+GEL*FIX(0.337)\n        movq      MMWORD [wk(7)], mm6   ; wk(7)=REH*FIX(0.299)+GEH*FIX(0.337)\n\n        pxor      mm0,mm0\n        pxor      mm6,mm6\n        punpcklwd mm0,mm1               ; mm0=BEL\n        punpckhwd mm6,mm1               ; mm6=BEH\n        psrld     mm0,1                 ; mm0=BEL*FIX(0.500)\n        psrld     mm6,1                 ; mm6=BEH*FIX(0.500)\n\n        movq      mm1,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; mm1=[PD_ONEHALFM1_CJ]\n\n        paddd     mm5,mm0\n        paddd     mm4,mm6\n        paddd     mm5,mm1\n        paddd     mm4,mm1\n        psrld     mm5,SCALEBITS         ; mm5=CbEL\n        psrld     mm4,SCALEBITS         ; mm4=CbEH\n        packssdw  mm5,mm4               ; mm5=CbE\n\n        psllw     mm7,BYTE_BIT\n        por       mm5,mm7               ; mm5=Cb\n        movq      MMWORD [ebx], mm5     ; Save Cb\n\n        movq      mm0, MMWORD [wk(3)]   ; mm0=BO\n        movq      mm6, MMWORD [wk(2)]   ; mm6=BE\n        movq      mm1, MMWORD [wk(1)]   ; mm1=RO\n\n        movq      mm4,mm0\n        punpcklwd mm0,mm3\n        punpckhwd mm4,mm3\n        movq      mm7,mm0\n        movq      mm5,mm4\n        pmaddwd   mm0,[GOTOFF(eax,PW_F0114_F0250)] ; mm0=BOL*FIX(0.114)+GOL*FIX(0.250)\n        pmaddwd   mm4,[GOTOFF(eax,PW_F0114_F0250)] ; mm4=BOH*FIX(0.114)+GOH*FIX(0.250)\n        pmaddwd   mm7,[GOTOFF(eax,PW_MF008_MF041)] ; mm7=BOL*-FIX(0.081)+GOL*-FIX(0.418)\n        pmaddwd   mm5,[GOTOFF(eax,PW_MF008_MF041)] ; mm5=BOH*-FIX(0.081)+GOH*-FIX(0.418)\n\n        movq      mm3,[GOTOFF(eax,PD_ONEHALF)]  ; mm3=[PD_ONEHALF]\n\n        paddd     mm0, MMWORD [wk(4)]\n        paddd     mm4, MMWORD [wk(5)]\n        paddd     mm0,mm3\n        paddd     mm4,mm3\n        psrld     mm0,SCALEBITS         ; mm0=YOL\n        psrld     mm4,SCALEBITS         ; mm4=YOH\n        packssdw  mm0,mm4               ; mm0=YO\n\n        pxor      mm3,mm3\n        pxor      mm4,mm4\n        punpcklwd mm3,mm1               ; mm3=ROL\n        punpckhwd mm4,mm1               ; mm4=ROH\n        psrld     mm3,1                 ; mm3=ROL*FIX(0.500)\n        psrld     mm4,1                 ; mm4=ROH*FIX(0.500)\n\n        movq      mm1,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; mm1=[PD_ONEHALFM1_CJ]\n\n        paddd     mm7,mm3\n        paddd     mm5,mm4\n        paddd     mm7,mm1\n        paddd     mm5,mm1\n        psrld     mm7,SCALEBITS         ; mm7=CrOL\n        psrld     mm5,SCALEBITS         ; mm5=CrOH\n        packssdw  mm7,mm5               ; mm7=CrO\n\n        movq      mm3, MMWORD [wk(0)]   ; mm3=RE\n\n        movq      mm4,mm6\n        punpcklwd mm6,mm2\n        punpckhwd mm4,mm2\n        movq      mm1,mm6\n        movq      mm5,mm4\n        pmaddwd   mm6,[GOTOFF(eax,PW_F0114_F0250)] ; mm6=BEL*FIX(0.114)+GEL*FIX(0.250)\n        pmaddwd   mm4,[GOTOFF(eax,PW_F0114_F0250)] ; mm4=BEH*FIX(0.114)+GEH*FIX(0.250)\n        pmaddwd   mm1,[GOTOFF(eax,PW_MF008_MF041)] ; mm1=BEL*-FIX(0.081)+GEL*-FIX(0.418)\n        pmaddwd   mm5,[GOTOFF(eax,PW_MF008_MF041)] ; mm5=BEH*-FIX(0.081)+GEH*-FIX(0.418)\n\n        movq      mm2,[GOTOFF(eax,PD_ONEHALF)]  ; mm2=[PD_ONEHALF]\n\n        paddd     mm6, MMWORD [wk(6)]\n        paddd     mm4, MMWORD [wk(7)]\n        paddd     mm6,mm2\n        paddd     mm4,mm2\n        psrld     mm6,SCALEBITS         ; mm6=YEL\n        psrld     mm4,SCALEBITS         ; mm4=YEH\n        packssdw  mm6,mm4               ; mm6=YE\n\n        psllw     mm0,BYTE_BIT\n        por       mm6,mm0               ; mm6=Y\n        movq      MMWORD [edi], mm6     ; Save Y\n\n        pxor      mm2,mm2\n        pxor      mm4,mm4\n        punpcklwd mm2,mm3               ; mm2=REL\n        punpckhwd mm4,mm3               ; mm4=REH\n        psrld     mm2,1                 ; mm2=REL*FIX(0.500)\n        psrld     mm4,1                 ; mm4=REH*FIX(0.500)\n\n        movq      mm0,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; mm0=[PD_ONEHALFM1_CJ]\n\n        paddd     mm1,mm2\n        paddd     mm5,mm4\n        paddd     mm1,mm0\n        paddd     mm5,mm0\n        psrld     mm1,SCALEBITS         ; mm1=CrEL\n        psrld     mm5,SCALEBITS         ; mm5=CrEH\n        packssdw  mm1,mm5               ; mm1=CrE\n\n        psllw     mm7,BYTE_BIT\n        por       mm1,mm7               ; mm1=Cr\n        movq      MMWORD [edx], mm1     ; Save Cr\n\n        sub     ecx, byte SIZEOF_MMWORD\n        add     esi, byte RGB_PIXELSIZE*SIZEOF_MMWORD   ; inptr\n        add     edi, byte SIZEOF_MMWORD                 ; outptr0\n        add     ebx, byte SIZEOF_MMWORD                 ; outptr1\n        add     edx, byte SIZEOF_MMWORD                 ; outptr2\n        cmp     ecx, byte SIZEOF_MMWORD\n        jae     near .columnloop\n        test    ecx,ecx\n        jnz     near .column_ld1\n\n        pop     ecx                     ; col\n        pop     esi\n        pop     edi\n        pop     ebx\n        pop     edx\n        poppic  eax\n\n        add     esi, byte SIZEOF_JSAMPROW       ; input_buf\n        add     edi, byte SIZEOF_JSAMPROW\n        add     ebx, byte SIZEOF_JSAMPROW\n        add     edx, byte SIZEOF_JSAMPROW\n        dec     eax                             ; num_rows\n        jg      near .rowloop\n\n        emms            ; empty MMX state\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jccolext-sse2-64.asm",
    "content": ";\n; jccolext.asm - colorspace conversion (64-bit SSE2)\n;\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_rgb_ycc_convert_sse2 (JDIMENSION img_width,\n;                             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n;                             JDIMENSION output_row, int num_rows);\n;\n\n; r10 = JDIMENSION img_width\n; r11 = JSAMPARRAY input_buf\n; r12 = JSAMPIMAGE output_buf\n; r13 = JDIMENSION output_row\n; r14 = int num_rows\n\n%define wk(i)           rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          8\n\n        align   16\n\n        global  EXTN(jsimd_rgb_ycc_convert_sse2)\n\nEXTN(jsimd_rgb_ycc_convert_sse2):\n        push    rbp\n        mov     rax,rsp                         ; rax = original rbp\n        sub     rsp, byte 4\n        and     rsp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [rsp],rax\n        mov     rbp,rsp                         ; rbp = aligned rbp\n        lea     rsp, [wk(0)]\n        collect_args\n        push    rbx\n\n        mov     ecx, r10d\n        test    rcx,rcx\n        jz      near .return\n\n        push    rcx\n\n        mov rsi, r12\n        mov ecx, r13d\n        mov     rdi, JSAMPARRAY [rsi+0*SIZEOF_JSAMPARRAY]\n        mov     rbx, JSAMPARRAY [rsi+1*SIZEOF_JSAMPARRAY]\n        mov     rdx, JSAMPARRAY [rsi+2*SIZEOF_JSAMPARRAY]\n        lea     rdi, [rdi+rcx*SIZEOF_JSAMPROW]\n        lea     rbx, [rbx+rcx*SIZEOF_JSAMPROW]\n        lea     rdx, [rdx+rcx*SIZEOF_JSAMPROW]\n\n        pop     rcx\n\n        mov rsi, r11\n        mov     eax, r14d\n        test    rax,rax\n        jle     near .return\n.rowloop:\n        push    rdx\n        push    rbx\n        push    rdi\n        push    rsi\n        push    rcx                     ; col\n\n        mov     rsi, JSAMPROW [rsi]     ; inptr\n        mov     rdi, JSAMPROW [rdi]     ; outptr0\n        mov     rbx, JSAMPROW [rbx]     ; outptr1\n        mov     rdx, JSAMPROW [rdx]     ; outptr2\n\n        cmp     rcx, byte SIZEOF_XMMWORD\n        jae     near .columnloop\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n.column_ld1:\n        push    rax\n        push    rdx\n        lea     rcx,[rcx+rcx*2]         ; imul ecx,RGB_PIXELSIZE\n        test    cl, SIZEOF_BYTE\n        jz      short .column_ld2\n        sub     rcx, byte SIZEOF_BYTE\n        movzx   rax, BYTE [rsi+rcx]\n.column_ld2:\n        test    cl, SIZEOF_WORD\n        jz      short .column_ld4\n        sub     rcx, byte SIZEOF_WORD\n        movzx   rdx, WORD [rsi+rcx]\n        shl     rax, WORD_BIT\n        or      rax,rdx\n.column_ld4:\n        movd    xmmA,eax\n        pop     rdx\n        pop     rax\n        test    cl, SIZEOF_DWORD\n        jz      short .column_ld8\n        sub     rcx, byte SIZEOF_DWORD\n        movd    xmmF, XMM_DWORD [rsi+rcx]\n        pslldq  xmmA, SIZEOF_DWORD\n        por     xmmA,xmmF\n.column_ld8:\n        test    cl, SIZEOF_MMWORD\n        jz      short .column_ld16\n        sub     rcx, byte SIZEOF_MMWORD\n        movq    xmmB, XMM_MMWORD [rsi+rcx]\n        pslldq  xmmA, SIZEOF_MMWORD\n        por     xmmA,xmmB\n.column_ld16:\n        test    cl, SIZEOF_XMMWORD\n        jz      short .column_ld32\n        movdqa  xmmF,xmmA\n        movdqu  xmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        mov     rcx, SIZEOF_XMMWORD\n        jmp     short .rgb_ycc_cnv\n.column_ld32:\n        test    cl, 2*SIZEOF_XMMWORD\n        mov     rcx, SIZEOF_XMMWORD\n        jz      short .rgb_ycc_cnv\n        movdqa  xmmB,xmmA\n        movdqu  xmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        movdqu  xmmF, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n        jmp     short .rgb_ycc_cnv\n\n.columnloop:\n        movdqu  xmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        movdqu  xmmF, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n        movdqu  xmmB, XMMWORD [rsi+2*SIZEOF_XMMWORD]\n\n.rgb_ycc_cnv:\n        ; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n        ; xmmF=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n        ; xmmB=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n        movdqa    xmmG,xmmA\n        pslldq    xmmA,8        ; xmmA=(-- -- -- -- -- -- -- -- 00 10 20 01 11 21 02 12)\n        psrldq    xmmG,8        ; xmmG=(22 03 13 23 04 14 24 05 -- -- -- -- -- -- -- --)\n\n        punpckhbw xmmA,xmmF     ; xmmA=(00 08 10 18 20 28 01 09 11 19 21 29 02 0A 12 1A)\n        pslldq    xmmF,8        ; xmmF=(-- -- -- -- -- -- -- -- 15 25 06 16 26 07 17 27)\n\n        punpcklbw xmmG,xmmB     ; xmmG=(22 2A 03 0B 13 1B 23 2B 04 0C 14 1C 24 2C 05 0D)\n        punpckhbw xmmF,xmmB     ; xmmF=(15 1D 25 2D 06 0E 16 1E 26 2E 07 0F 17 1F 27 2F)\n\n        movdqa    xmmD,xmmA\n        pslldq    xmmA,8        ; xmmA=(-- -- -- -- -- -- -- -- 00 08 10 18 20 28 01 09)\n        psrldq    xmmD,8        ; xmmD=(11 19 21 29 02 0A 12 1A -- -- -- -- -- -- -- --)\n\n        punpckhbw xmmA,xmmG     ; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 01 05 09 0D)\n        pslldq    xmmG,8        ; xmmG=(-- -- -- -- -- -- -- -- 22 2A 03 0B 13 1B 23 2B)\n\n        punpcklbw xmmD,xmmF     ; xmmD=(11 15 19 1D 21 25 29 2D 02 06 0A 0E 12 16 1A 1E)\n        punpckhbw xmmG,xmmF     ; xmmG=(22 26 2A 2E 03 07 0B 0F 13 17 1B 1F 23 27 2B 2F)\n\n        movdqa    xmmE,xmmA\n        pslldq    xmmA,8        ; xmmA=(-- -- -- -- -- -- -- -- 00 04 08 0C 10 14 18 1C)\n        psrldq    xmmE,8        ; xmmE=(20 24 28 2C 01 05 09 0D -- -- -- -- -- -- -- --)\n\n        punpckhbw xmmA,xmmD     ; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n        pslldq    xmmD,8        ; xmmD=(-- -- -- -- -- -- -- -- 11 15 19 1D 21 25 29 2D)\n\n        punpcklbw xmmE,xmmG     ; xmmE=(20 22 24 26 28 2A 2C 2E 01 03 05 07 09 0B 0D 0F)\n        punpckhbw xmmD,xmmG     ; xmmD=(11 13 15 17 19 1B 1D 1F 21 23 25 27 29 2B 2D 2F)\n\n        pxor      xmmH,xmmH\n\n        movdqa    xmmC,xmmA\n        punpcklbw xmmA,xmmH     ; xmmA=(00 02 04 06 08 0A 0C 0E)\n        punpckhbw xmmC,xmmH     ; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n        movdqa    xmmB,xmmE\n        punpcklbw xmmE,xmmH     ; xmmE=(20 22 24 26 28 2A 2C 2E)\n        punpckhbw xmmB,xmmH     ; xmmB=(01 03 05 07 09 0B 0D 0F)\n\n        movdqa    xmmF,xmmD\n        punpcklbw xmmD,xmmH     ; xmmD=(11 13 15 17 19 1B 1D 1F)\n        punpckhbw xmmF,xmmH     ; xmmF=(21 23 25 27 29 2B 2D 2F)\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n.column_ld1:\n        test    cl, SIZEOF_XMMWORD/16\n        jz      short .column_ld2\n        sub     rcx, byte SIZEOF_XMMWORD/16\n        movd    xmmA, XMM_DWORD [rsi+rcx*RGB_PIXELSIZE]\n.column_ld2:\n        test    cl, SIZEOF_XMMWORD/8\n        jz      short .column_ld4\n        sub     rcx, byte SIZEOF_XMMWORD/8\n        movq    xmmE, XMM_MMWORD [rsi+rcx*RGB_PIXELSIZE]\n        pslldq  xmmA, SIZEOF_MMWORD\n        por     xmmA,xmmE\n.column_ld4:\n        test    cl, SIZEOF_XMMWORD/4\n        jz      short .column_ld8\n        sub     rcx, byte SIZEOF_XMMWORD/4\n        movdqa  xmmE,xmmA\n        movdqu  xmmA, XMMWORD [rsi+rcx*RGB_PIXELSIZE]\n.column_ld8:\n        test    cl, SIZEOF_XMMWORD/2\n        mov     rcx, SIZEOF_XMMWORD\n        jz      short .rgb_ycc_cnv\n        movdqa  xmmF,xmmA\n        movdqa  xmmH,xmmE\n        movdqu  xmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        movdqu  xmmE, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n        jmp     short .rgb_ycc_cnv\n\n.columnloop:\n        movdqu  xmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        movdqu  xmmE, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n        movdqu  xmmF, XMMWORD [rsi+2*SIZEOF_XMMWORD]\n        movdqu  xmmH, XMMWORD [rsi+3*SIZEOF_XMMWORD]\n\n.rgb_ycc_cnv:\n        ; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n        ; xmmE=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n        ; xmmF=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n        ; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n        movdqa    xmmD,xmmA\n        punpcklbw xmmA,xmmE     ; xmmA=(00 04 10 14 20 24 30 34 01 05 11 15 21 25 31 35)\n        punpckhbw xmmD,xmmE     ; xmmD=(02 06 12 16 22 26 32 36 03 07 13 17 23 27 33 37)\n\n        movdqa    xmmC,xmmF\n        punpcklbw xmmF,xmmH     ; xmmF=(08 0C 18 1C 28 2C 38 3C 09 0D 19 1D 29 2D 39 3D)\n        punpckhbw xmmC,xmmH     ; xmmC=(0A 0E 1A 1E 2A 2E 3A 3E 0B 0F 1B 1F 2B 2F 3B 3F)\n\n        movdqa    xmmB,xmmA\n        punpcklwd xmmA,xmmF     ; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 30 34 38 3C)\n        punpckhwd xmmB,xmmF     ; xmmB=(01 05 09 0D 11 15 19 1D 21 25 29 2D 31 35 39 3D)\n\n        movdqa    xmmG,xmmD\n        punpcklwd xmmD,xmmC     ; xmmD=(02 06 0A 0E 12 16 1A 1E 22 26 2A 2E 32 36 3A 3E)\n        punpckhwd xmmG,xmmC     ; xmmG=(03 07 0B 0F 13 17 1B 1F 23 27 2B 2F 33 37 3B 3F)\n\n        movdqa    xmmE,xmmA\n        punpcklbw xmmA,xmmD     ; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n        punpckhbw xmmE,xmmD     ; xmmE=(20 22 24 26 28 2A 2C 2E 30 32 34 36 38 3A 3C 3E)\n\n        movdqa    xmmH,xmmB\n        punpcklbw xmmB,xmmG     ; xmmB=(01 03 05 07 09 0B 0D 0F 11 13 15 17 19 1B 1D 1F)\n        punpckhbw xmmH,xmmG     ; xmmH=(21 23 25 27 29 2B 2D 2F 31 33 35 37 39 3B 3D 3F)\n\n        pxor      xmmF,xmmF\n\n        movdqa    xmmC,xmmA\n        punpcklbw xmmA,xmmF     ; xmmA=(00 02 04 06 08 0A 0C 0E)\n        punpckhbw xmmC,xmmF     ; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n        movdqa    xmmD,xmmB\n        punpcklbw xmmB,xmmF     ; xmmB=(01 03 05 07 09 0B 0D 0F)\n        punpckhbw xmmD,xmmF     ; xmmD=(11 13 15 17 19 1B 1D 1F)\n\n        movdqa    xmmG,xmmE\n        punpcklbw xmmE,xmmF     ; xmmE=(20 22 24 26 28 2A 2C 2E)\n        punpckhbw xmmG,xmmF     ; xmmG=(30 32 34 36 38 3A 3C 3E)\n\n        punpcklbw xmmF,xmmH\n        punpckhbw xmmH,xmmH\n        psrlw     xmmF,BYTE_BIT ; xmmF=(21 23 25 27 29 2B 2D 2F)\n        psrlw     xmmH,BYTE_BIT ; xmmH=(31 33 35 37 39 3B 3D 3F)\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n        ; xmm0=R(02468ACE)=RE, xmm2=G(02468ACE)=GE, xmm4=B(02468ACE)=BE\n        ; xmm1=R(13579BDF)=RO, xmm3=G(13579BDF)=GO, xmm5=B(13579BDF)=BO\n\n        ; (Original)\n        ; Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n        ; Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE\n        ; Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE\n        ;\n        ; (This implementation)\n        ; Y  =  0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G\n        ; Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE\n        ; Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE\n\n        movdqa    XMMWORD [wk(0)], xmm0 ; wk(0)=RE\n        movdqa    XMMWORD [wk(1)], xmm1 ; wk(1)=RO\n        movdqa    XMMWORD [wk(2)], xmm4 ; wk(2)=BE\n        movdqa    XMMWORD [wk(3)], xmm5 ; wk(3)=BO\n\n        movdqa    xmm6,xmm1\n        punpcklwd xmm1,xmm3\n        punpckhwd xmm6,xmm3\n        movdqa    xmm7,xmm1\n        movdqa    xmm4,xmm6\n        pmaddwd   xmm1,[rel PW_F0299_F0337] ; xmm1=ROL*FIX(0.299)+GOL*FIX(0.337)\n        pmaddwd   xmm6,[rel PW_F0299_F0337] ; xmm6=ROH*FIX(0.299)+GOH*FIX(0.337)\n        pmaddwd   xmm7,[rel PW_MF016_MF033] ; xmm7=ROL*-FIX(0.168)+GOL*-FIX(0.331)\n        pmaddwd   xmm4,[rel PW_MF016_MF033] ; xmm4=ROH*-FIX(0.168)+GOH*-FIX(0.331)\n\n        movdqa    XMMWORD [wk(4)], xmm1 ; wk(4)=ROL*FIX(0.299)+GOL*FIX(0.337)\n        movdqa    XMMWORD [wk(5)], xmm6 ; wk(5)=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n        pxor      xmm1,xmm1\n        pxor      xmm6,xmm6\n        punpcklwd xmm1,xmm5             ; xmm1=BOL\n        punpckhwd xmm6,xmm5             ; xmm6=BOH\n        psrld     xmm1,1                ; xmm1=BOL*FIX(0.500)\n        psrld     xmm6,1                ; xmm6=BOH*FIX(0.500)\n\n        movdqa    xmm5,[rel PD_ONEHALFM1_CJ] ; xmm5=[PD_ONEHALFM1_CJ]\n\n        paddd     xmm7,xmm1\n        paddd     xmm4,xmm6\n        paddd     xmm7,xmm5\n        paddd     xmm4,xmm5\n        psrld     xmm7,SCALEBITS        ; xmm7=CbOL\n        psrld     xmm4,SCALEBITS        ; xmm4=CbOH\n        packssdw  xmm7,xmm4             ; xmm7=CbO\n\n        movdqa    xmm1, XMMWORD [wk(2)] ; xmm1=BE\n\n        movdqa    xmm6,xmm0\n        punpcklwd xmm0,xmm2\n        punpckhwd xmm6,xmm2\n        movdqa    xmm5,xmm0\n        movdqa    xmm4,xmm6\n        pmaddwd   xmm0,[rel PW_F0299_F0337] ; xmm0=REL*FIX(0.299)+GEL*FIX(0.337)\n        pmaddwd   xmm6,[rel PW_F0299_F0337] ; xmm6=REH*FIX(0.299)+GEH*FIX(0.337)\n        pmaddwd   xmm5,[rel PW_MF016_MF033] ; xmm5=REL*-FIX(0.168)+GEL*-FIX(0.331)\n        pmaddwd   xmm4,[rel PW_MF016_MF033] ; xmm4=REH*-FIX(0.168)+GEH*-FIX(0.331)\n\n        movdqa    XMMWORD [wk(6)], xmm0 ; wk(6)=REL*FIX(0.299)+GEL*FIX(0.337)\n        movdqa    XMMWORD [wk(7)], xmm6 ; wk(7)=REH*FIX(0.299)+GEH*FIX(0.337)\n\n        pxor      xmm0,xmm0\n        pxor      xmm6,xmm6\n        punpcklwd xmm0,xmm1             ; xmm0=BEL\n        punpckhwd xmm6,xmm1             ; xmm6=BEH\n        psrld     xmm0,1                ; xmm0=BEL*FIX(0.500)\n        psrld     xmm6,1                ; xmm6=BEH*FIX(0.500)\n\n        movdqa    xmm1,[rel PD_ONEHALFM1_CJ] ; xmm1=[PD_ONEHALFM1_CJ]\n\n        paddd     xmm5,xmm0\n        paddd     xmm4,xmm6\n        paddd     xmm5,xmm1\n        paddd     xmm4,xmm1\n        psrld     xmm5,SCALEBITS        ; xmm5=CbEL\n        psrld     xmm4,SCALEBITS        ; xmm4=CbEH\n        packssdw  xmm5,xmm4             ; xmm5=CbE\n\n        psllw     xmm7,BYTE_BIT\n        por       xmm5,xmm7             ; xmm5=Cb\n        movdqa    XMMWORD [rbx], xmm5   ; Save Cb\n\n        movdqa    xmm0, XMMWORD [wk(3)] ; xmm0=BO\n        movdqa    xmm6, XMMWORD [wk(2)] ; xmm6=BE\n        movdqa    xmm1, XMMWORD [wk(1)] ; xmm1=RO\n\n        movdqa    xmm4,xmm0\n        punpcklwd xmm0,xmm3\n        punpckhwd xmm4,xmm3\n        movdqa    xmm7,xmm0\n        movdqa    xmm5,xmm4\n        pmaddwd   xmm0,[rel PW_F0114_F0250] ; xmm0=BOL*FIX(0.114)+GOL*FIX(0.250)\n        pmaddwd   xmm4,[rel PW_F0114_F0250] ; xmm4=BOH*FIX(0.114)+GOH*FIX(0.250)\n        pmaddwd   xmm7,[rel PW_MF008_MF041] ; xmm7=BOL*-FIX(0.081)+GOL*-FIX(0.418)\n        pmaddwd   xmm5,[rel PW_MF008_MF041] ; xmm5=BOH*-FIX(0.081)+GOH*-FIX(0.418)\n\n        movdqa    xmm3,[rel PD_ONEHALF] ; xmm3=[PD_ONEHALF]\n\n        paddd     xmm0, XMMWORD [wk(4)]\n        paddd     xmm4, XMMWORD [wk(5)]\n        paddd     xmm0,xmm3\n        paddd     xmm4,xmm3\n        psrld     xmm0,SCALEBITS        ; xmm0=YOL\n        psrld     xmm4,SCALEBITS        ; xmm4=YOH\n        packssdw  xmm0,xmm4             ; xmm0=YO\n\n        pxor      xmm3,xmm3\n        pxor      xmm4,xmm4\n        punpcklwd xmm3,xmm1             ; xmm3=ROL\n        punpckhwd xmm4,xmm1             ; xmm4=ROH\n        psrld     xmm3,1                ; xmm3=ROL*FIX(0.500)\n        psrld     xmm4,1                ; xmm4=ROH*FIX(0.500)\n\n        movdqa    xmm1,[rel PD_ONEHALFM1_CJ] ; xmm1=[PD_ONEHALFM1_CJ]\n\n        paddd     xmm7,xmm3\n        paddd     xmm5,xmm4\n        paddd     xmm7,xmm1\n        paddd     xmm5,xmm1\n        psrld     xmm7,SCALEBITS        ; xmm7=CrOL\n        psrld     xmm5,SCALEBITS        ; xmm5=CrOH\n        packssdw  xmm7,xmm5             ; xmm7=CrO\n\n        movdqa    xmm3, XMMWORD [wk(0)] ; xmm3=RE\n\n        movdqa    xmm4,xmm6\n        punpcklwd xmm6,xmm2\n        punpckhwd xmm4,xmm2\n        movdqa    xmm1,xmm6\n        movdqa    xmm5,xmm4\n        pmaddwd   xmm6,[rel PW_F0114_F0250] ; xmm6=BEL*FIX(0.114)+GEL*FIX(0.250)\n        pmaddwd   xmm4,[rel PW_F0114_F0250] ; xmm4=BEH*FIX(0.114)+GEH*FIX(0.250)\n        pmaddwd   xmm1,[rel PW_MF008_MF041] ; xmm1=BEL*-FIX(0.081)+GEL*-FIX(0.418)\n        pmaddwd   xmm5,[rel PW_MF008_MF041] ; xmm5=BEH*-FIX(0.081)+GEH*-FIX(0.418)\n\n        movdqa    xmm2,[rel PD_ONEHALF] ; xmm2=[PD_ONEHALF]\n\n        paddd     xmm6, XMMWORD [wk(6)]\n        paddd     xmm4, XMMWORD [wk(7)]\n        paddd     xmm6,xmm2\n        paddd     xmm4,xmm2\n        psrld     xmm6,SCALEBITS        ; xmm6=YEL\n        psrld     xmm4,SCALEBITS        ; xmm4=YEH\n        packssdw  xmm6,xmm4             ; xmm6=YE\n\n        psllw     xmm0,BYTE_BIT\n        por       xmm6,xmm0             ; xmm6=Y\n        movdqa    XMMWORD [rdi], xmm6   ; Save Y\n\n        pxor      xmm2,xmm2\n        pxor      xmm4,xmm4\n        punpcklwd xmm2,xmm3             ; xmm2=REL\n        punpckhwd xmm4,xmm3             ; xmm4=REH\n        psrld     xmm2,1                ; xmm2=REL*FIX(0.500)\n        psrld     xmm4,1                ; xmm4=REH*FIX(0.500)\n\n        movdqa    xmm0,[rel PD_ONEHALFM1_CJ] ; xmm0=[PD_ONEHALFM1_CJ]\n\n        paddd     xmm1,xmm2\n        paddd     xmm5,xmm4\n        paddd     xmm1,xmm0\n        paddd     xmm5,xmm0\n        psrld     xmm1,SCALEBITS        ; xmm1=CrEL\n        psrld     xmm5,SCALEBITS        ; xmm5=CrEH\n        packssdw  xmm1,xmm5             ; xmm1=CrE\n\n        psllw     xmm7,BYTE_BIT\n        por       xmm1,xmm7             ; xmm1=Cr\n        movdqa    XMMWORD [rdx], xmm1   ; Save Cr\n\n        sub     rcx, byte SIZEOF_XMMWORD\n        add     rsi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD  ; inptr\n        add     rdi, byte SIZEOF_XMMWORD                ; outptr0\n        add     rbx, byte SIZEOF_XMMWORD                ; outptr1\n        add     rdx, byte SIZEOF_XMMWORD                ; outptr2\n        cmp     rcx, byte SIZEOF_XMMWORD\n        jae     near .columnloop\n        test    rcx,rcx\n        jnz     near .column_ld1\n\n        pop     rcx                     ; col\n        pop     rsi\n        pop     rdi\n        pop     rbx\n        pop     rdx\n\n        add     rsi, byte SIZEOF_JSAMPROW       ; input_buf\n        add     rdi, byte SIZEOF_JSAMPROW\n        add     rbx, byte SIZEOF_JSAMPROW\n        add     rdx, byte SIZEOF_JSAMPROW\n        dec     rax                             ; num_rows\n        jg      near .rowloop\n\n.return:\n        pop     rbx\n        uncollect_args\n        mov     rsp,rbp         ; rsp <- aligned rbp\n        pop     rsp             ; rsp <- original rbp\n        pop     rbp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jccolext-sse2.asm",
    "content": ";\n; jccolext.asm - colorspace conversion (SSE2)\n;\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_rgb_ycc_convert_sse2 (JDIMENSION img_width,\n;                             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n;                             JDIMENSION output_row, int num_rows);\n;\n\n%define img_width(b)    (b)+8           ; JDIMENSION img_width\n%define input_buf(b)    (b)+12          ; JSAMPARRAY input_buf\n%define output_buf(b)   (b)+16          ; JSAMPIMAGE output_buf\n%define output_row(b)   (b)+20          ; JDIMENSION output_row\n%define num_rows(b)     (b)+24          ; int num_rows\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          8\n%define gotptr          wk(0)-SIZEOF_POINTER    ; void * gotptr\n\n        align   16\n\n        global  EXTN(jsimd_rgb_ycc_convert_sse2)\n\nEXTN(jsimd_rgb_ycc_convert_sse2):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic eax             ; make a room for GOT address\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx                     ; get GOT address\n        movpic  POINTER [gotptr], ebx   ; save GOT address\n\n        mov     ecx, JDIMENSION [img_width(eax)]\n        test    ecx,ecx\n        jz      near .return\n\n        push    ecx\n\n        mov     esi, JSAMPIMAGE [output_buf(eax)]\n        mov     ecx, JDIMENSION [output_row(eax)]\n        mov     edi, JSAMPARRAY [esi+0*SIZEOF_JSAMPARRAY]\n        mov     ebx, JSAMPARRAY [esi+1*SIZEOF_JSAMPARRAY]\n        mov     edx, JSAMPARRAY [esi+2*SIZEOF_JSAMPARRAY]\n        lea     edi, [edi+ecx*SIZEOF_JSAMPROW]\n        lea     ebx, [ebx+ecx*SIZEOF_JSAMPROW]\n        lea     edx, [edx+ecx*SIZEOF_JSAMPROW]\n\n        pop     ecx\n\n        mov     esi, JSAMPARRAY [input_buf(eax)]\n        mov     eax, INT [num_rows(eax)]\n        test    eax,eax\n        jle     near .return\n        alignx  16,7\n.rowloop:\n        pushpic eax\n        push    edx\n        push    ebx\n        push    edi\n        push    esi\n        push    ecx                     ; col\n\n        mov     esi, JSAMPROW [esi]     ; inptr\n        mov     edi, JSAMPROW [edi]     ; outptr0\n        mov     ebx, JSAMPROW [ebx]     ; outptr1\n        mov     edx, JSAMPROW [edx]     ; outptr2\n        movpic  eax, POINTER [gotptr]   ; load GOT address (eax)\n\n        cmp     ecx, byte SIZEOF_XMMWORD\n        jae     near .columnloop\n        alignx  16,7\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n.column_ld1:\n        push    eax\n        push    edx\n        lea     ecx,[ecx+ecx*2]         ; imul ecx,RGB_PIXELSIZE\n        test    cl, SIZEOF_BYTE\n        jz      short .column_ld2\n        sub     ecx, byte SIZEOF_BYTE\n        movzx   eax, BYTE [esi+ecx]\n.column_ld2:\n        test    cl, SIZEOF_WORD\n        jz      short .column_ld4\n        sub     ecx, byte SIZEOF_WORD\n        movzx   edx, WORD [esi+ecx]\n        shl     eax, WORD_BIT\n        or      eax,edx\n.column_ld4:\n        movd    xmmA,eax\n        pop     edx\n        pop     eax\n        test    cl, SIZEOF_DWORD\n        jz      short .column_ld8\n        sub     ecx, byte SIZEOF_DWORD\n        movd    xmmF, XMM_DWORD [esi+ecx]\n        pslldq  xmmA, SIZEOF_DWORD\n        por     xmmA,xmmF\n.column_ld8:\n        test    cl, SIZEOF_MMWORD\n        jz      short .column_ld16\n        sub     ecx, byte SIZEOF_MMWORD\n        movq    xmmB, XMM_MMWORD [esi+ecx]\n        pslldq  xmmA, SIZEOF_MMWORD\n        por     xmmA,xmmB\n.column_ld16:\n        test    cl, SIZEOF_XMMWORD\n        jz      short .column_ld32\n        movdqa  xmmF,xmmA\n        movdqu  xmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        mov     ecx, SIZEOF_XMMWORD\n        jmp     short .rgb_ycc_cnv\n.column_ld32:\n        test    cl, 2*SIZEOF_XMMWORD\n        mov     ecx, SIZEOF_XMMWORD\n        jz      short .rgb_ycc_cnv\n        movdqa  xmmB,xmmA\n        movdqu  xmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        movdqu  xmmF, XMMWORD [esi+1*SIZEOF_XMMWORD]\n        jmp     short .rgb_ycc_cnv\n        alignx  16,7\n\n.columnloop:\n        movdqu  xmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        movdqu  xmmF, XMMWORD [esi+1*SIZEOF_XMMWORD]\n        movdqu  xmmB, XMMWORD [esi+2*SIZEOF_XMMWORD]\n\n.rgb_ycc_cnv:\n        ; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n        ; xmmF=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n        ; xmmB=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n        movdqa    xmmG,xmmA\n        pslldq    xmmA,8        ; xmmA=(-- -- -- -- -- -- -- -- 00 10 20 01 11 21 02 12)\n        psrldq    xmmG,8        ; xmmG=(22 03 13 23 04 14 24 05 -- -- -- -- -- -- -- --)\n\n        punpckhbw xmmA,xmmF     ; xmmA=(00 08 10 18 20 28 01 09 11 19 21 29 02 0A 12 1A)\n        pslldq    xmmF,8        ; xmmF=(-- -- -- -- -- -- -- -- 15 25 06 16 26 07 17 27)\n\n        punpcklbw xmmG,xmmB     ; xmmG=(22 2A 03 0B 13 1B 23 2B 04 0C 14 1C 24 2C 05 0D)\n        punpckhbw xmmF,xmmB     ; xmmF=(15 1D 25 2D 06 0E 16 1E 26 2E 07 0F 17 1F 27 2F)\n\n        movdqa    xmmD,xmmA\n        pslldq    xmmA,8        ; xmmA=(-- -- -- -- -- -- -- -- 00 08 10 18 20 28 01 09)\n        psrldq    xmmD,8        ; xmmD=(11 19 21 29 02 0A 12 1A -- -- -- -- -- -- -- --)\n\n        punpckhbw xmmA,xmmG     ; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 01 05 09 0D)\n        pslldq    xmmG,8        ; xmmG=(-- -- -- -- -- -- -- -- 22 2A 03 0B 13 1B 23 2B)\n\n        punpcklbw xmmD,xmmF     ; xmmD=(11 15 19 1D 21 25 29 2D 02 06 0A 0E 12 16 1A 1E)\n        punpckhbw xmmG,xmmF     ; xmmG=(22 26 2A 2E 03 07 0B 0F 13 17 1B 1F 23 27 2B 2F)\n\n        movdqa    xmmE,xmmA\n        pslldq    xmmA,8        ; xmmA=(-- -- -- -- -- -- -- -- 00 04 08 0C 10 14 18 1C)\n        psrldq    xmmE,8        ; xmmE=(20 24 28 2C 01 05 09 0D -- -- -- -- -- -- -- --)\n\n        punpckhbw xmmA,xmmD     ; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n        pslldq    xmmD,8        ; xmmD=(-- -- -- -- -- -- -- -- 11 15 19 1D 21 25 29 2D)\n\n        punpcklbw xmmE,xmmG     ; xmmE=(20 22 24 26 28 2A 2C 2E 01 03 05 07 09 0B 0D 0F)\n        punpckhbw xmmD,xmmG     ; xmmD=(11 13 15 17 19 1B 1D 1F 21 23 25 27 29 2B 2D 2F)\n\n        pxor      xmmH,xmmH\n\n        movdqa    xmmC,xmmA\n        punpcklbw xmmA,xmmH     ; xmmA=(00 02 04 06 08 0A 0C 0E)\n        punpckhbw xmmC,xmmH     ; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n        movdqa    xmmB,xmmE\n        punpcklbw xmmE,xmmH     ; xmmE=(20 22 24 26 28 2A 2C 2E)\n        punpckhbw xmmB,xmmH     ; xmmB=(01 03 05 07 09 0B 0D 0F)\n\n        movdqa    xmmF,xmmD\n        punpcklbw xmmD,xmmH     ; xmmD=(11 13 15 17 19 1B 1D 1F)\n        punpckhbw xmmF,xmmH     ; xmmF=(21 23 25 27 29 2B 2D 2F)\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n.column_ld1:\n        test    cl, SIZEOF_XMMWORD/16\n        jz      short .column_ld2\n        sub     ecx, byte SIZEOF_XMMWORD/16\n        movd    xmmA, XMM_DWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld2:\n        test    cl, SIZEOF_XMMWORD/8\n        jz      short .column_ld4\n        sub     ecx, byte SIZEOF_XMMWORD/8\n        movq    xmmE, XMM_MMWORD [esi+ecx*RGB_PIXELSIZE]\n        pslldq  xmmA, SIZEOF_MMWORD\n        por     xmmA,xmmE\n.column_ld4:\n        test    cl, SIZEOF_XMMWORD/4\n        jz      short .column_ld8\n        sub     ecx, byte SIZEOF_XMMWORD/4\n        movdqa  xmmE,xmmA\n        movdqu  xmmA, XMMWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld8:\n        test    cl, SIZEOF_XMMWORD/2\n        mov     ecx, SIZEOF_XMMWORD\n        jz      short .rgb_ycc_cnv\n        movdqa  xmmF,xmmA\n        movdqa  xmmH,xmmE\n        movdqu  xmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        movdqu  xmmE, XMMWORD [esi+1*SIZEOF_XMMWORD]\n        jmp     short .rgb_ycc_cnv\n        alignx  16,7\n\n.columnloop:\n        movdqu  xmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        movdqu  xmmE, XMMWORD [esi+1*SIZEOF_XMMWORD]\n        movdqu  xmmF, XMMWORD [esi+2*SIZEOF_XMMWORD]\n        movdqu  xmmH, XMMWORD [esi+3*SIZEOF_XMMWORD]\n\n.rgb_ycc_cnv:\n        ; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n        ; xmmE=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n        ; xmmF=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n        ; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n        movdqa    xmmD,xmmA\n        punpcklbw xmmA,xmmE     ; xmmA=(00 04 10 14 20 24 30 34 01 05 11 15 21 25 31 35)\n        punpckhbw xmmD,xmmE     ; xmmD=(02 06 12 16 22 26 32 36 03 07 13 17 23 27 33 37)\n\n        movdqa    xmmC,xmmF\n        punpcklbw xmmF,xmmH     ; xmmF=(08 0C 18 1C 28 2C 38 3C 09 0D 19 1D 29 2D 39 3D)\n        punpckhbw xmmC,xmmH     ; xmmC=(0A 0E 1A 1E 2A 2E 3A 3E 0B 0F 1B 1F 2B 2F 3B 3F)\n\n        movdqa    xmmB,xmmA\n        punpcklwd xmmA,xmmF     ; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 30 34 38 3C)\n        punpckhwd xmmB,xmmF     ; xmmB=(01 05 09 0D 11 15 19 1D 21 25 29 2D 31 35 39 3D)\n\n        movdqa    xmmG,xmmD\n        punpcklwd xmmD,xmmC     ; xmmD=(02 06 0A 0E 12 16 1A 1E 22 26 2A 2E 32 36 3A 3E)\n        punpckhwd xmmG,xmmC     ; xmmG=(03 07 0B 0F 13 17 1B 1F 23 27 2B 2F 33 37 3B 3F)\n\n        movdqa    xmmE,xmmA\n        punpcklbw xmmA,xmmD     ; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n        punpckhbw xmmE,xmmD     ; xmmE=(20 22 24 26 28 2A 2C 2E 30 32 34 36 38 3A 3C 3E)\n\n        movdqa    xmmH,xmmB\n        punpcklbw xmmB,xmmG     ; xmmB=(01 03 05 07 09 0B 0D 0F 11 13 15 17 19 1B 1D 1F)\n        punpckhbw xmmH,xmmG     ; xmmH=(21 23 25 27 29 2B 2D 2F 31 33 35 37 39 3B 3D 3F)\n\n        pxor      xmmF,xmmF\n\n        movdqa    xmmC,xmmA\n        punpcklbw xmmA,xmmF     ; xmmA=(00 02 04 06 08 0A 0C 0E)\n        punpckhbw xmmC,xmmF     ; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n        movdqa    xmmD,xmmB\n        punpcklbw xmmB,xmmF     ; xmmB=(01 03 05 07 09 0B 0D 0F)\n        punpckhbw xmmD,xmmF     ; xmmD=(11 13 15 17 19 1B 1D 1F)\n\n        movdqa    xmmG,xmmE\n        punpcklbw xmmE,xmmF     ; xmmE=(20 22 24 26 28 2A 2C 2E)\n        punpckhbw xmmG,xmmF     ; xmmG=(30 32 34 36 38 3A 3C 3E)\n\n        punpcklbw xmmF,xmmH\n        punpckhbw xmmH,xmmH\n        psrlw     xmmF,BYTE_BIT ; xmmF=(21 23 25 27 29 2B 2D 2F)\n        psrlw     xmmH,BYTE_BIT ; xmmH=(31 33 35 37 39 3B 3D 3F)\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n        ; xmm0=R(02468ACE)=RE, xmm2=G(02468ACE)=GE, xmm4=B(02468ACE)=BE\n        ; xmm1=R(13579BDF)=RO, xmm3=G(13579BDF)=GO, xmm5=B(13579BDF)=BO\n\n        ; (Original)\n        ; Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n        ; Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE\n        ; Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE\n        ;\n        ; (This implementation)\n        ; Y  =  0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G\n        ; Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE\n        ; Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE\n\n        movdqa    XMMWORD [wk(0)], xmm0 ; wk(0)=RE\n        movdqa    XMMWORD [wk(1)], xmm1 ; wk(1)=RO\n        movdqa    XMMWORD [wk(2)], xmm4 ; wk(2)=BE\n        movdqa    XMMWORD [wk(3)], xmm5 ; wk(3)=BO\n\n        movdqa    xmm6,xmm1\n        punpcklwd xmm1,xmm3\n        punpckhwd xmm6,xmm3\n        movdqa    xmm7,xmm1\n        movdqa    xmm4,xmm6\n        pmaddwd   xmm1,[GOTOFF(eax,PW_F0299_F0337)] ; xmm1=ROL*FIX(0.299)+GOL*FIX(0.337)\n        pmaddwd   xmm6,[GOTOFF(eax,PW_F0299_F0337)] ; xmm6=ROH*FIX(0.299)+GOH*FIX(0.337)\n        pmaddwd   xmm7,[GOTOFF(eax,PW_MF016_MF033)] ; xmm7=ROL*-FIX(0.168)+GOL*-FIX(0.331)\n        pmaddwd   xmm4,[GOTOFF(eax,PW_MF016_MF033)] ; xmm4=ROH*-FIX(0.168)+GOH*-FIX(0.331)\n\n        movdqa    XMMWORD [wk(4)], xmm1 ; wk(4)=ROL*FIX(0.299)+GOL*FIX(0.337)\n        movdqa    XMMWORD [wk(5)], xmm6 ; wk(5)=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n        pxor      xmm1,xmm1\n        pxor      xmm6,xmm6\n        punpcklwd xmm1,xmm5             ; xmm1=BOL\n        punpckhwd xmm6,xmm5             ; xmm6=BOH\n        psrld     xmm1,1                ; xmm1=BOL*FIX(0.500)\n        psrld     xmm6,1                ; xmm6=BOH*FIX(0.500)\n\n        movdqa    xmm5,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; xmm5=[PD_ONEHALFM1_CJ]\n\n        paddd     xmm7,xmm1\n        paddd     xmm4,xmm6\n        paddd     xmm7,xmm5\n        paddd     xmm4,xmm5\n        psrld     xmm7,SCALEBITS        ; xmm7=CbOL\n        psrld     xmm4,SCALEBITS        ; xmm4=CbOH\n        packssdw  xmm7,xmm4             ; xmm7=CbO\n\n        movdqa    xmm1, XMMWORD [wk(2)] ; xmm1=BE\n\n        movdqa    xmm6,xmm0\n        punpcklwd xmm0,xmm2\n        punpckhwd xmm6,xmm2\n        movdqa    xmm5,xmm0\n        movdqa    xmm4,xmm6\n        pmaddwd   xmm0,[GOTOFF(eax,PW_F0299_F0337)] ; xmm0=REL*FIX(0.299)+GEL*FIX(0.337)\n        pmaddwd   xmm6,[GOTOFF(eax,PW_F0299_F0337)] ; xmm6=REH*FIX(0.299)+GEH*FIX(0.337)\n        pmaddwd   xmm5,[GOTOFF(eax,PW_MF016_MF033)] ; xmm5=REL*-FIX(0.168)+GEL*-FIX(0.331)\n        pmaddwd   xmm4,[GOTOFF(eax,PW_MF016_MF033)] ; xmm4=REH*-FIX(0.168)+GEH*-FIX(0.331)\n\n        movdqa    XMMWORD [wk(6)], xmm0 ; wk(6)=REL*FIX(0.299)+GEL*FIX(0.337)\n        movdqa    XMMWORD [wk(7)], xmm6 ; wk(7)=REH*FIX(0.299)+GEH*FIX(0.337)\n\n        pxor      xmm0,xmm0\n        pxor      xmm6,xmm6\n        punpcklwd xmm0,xmm1             ; xmm0=BEL\n        punpckhwd xmm6,xmm1             ; xmm6=BEH\n        psrld     xmm0,1                ; xmm0=BEL*FIX(0.500)\n        psrld     xmm6,1                ; xmm6=BEH*FIX(0.500)\n\n        movdqa    xmm1,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; xmm1=[PD_ONEHALFM1_CJ]\n\n        paddd     xmm5,xmm0\n        paddd     xmm4,xmm6\n        paddd     xmm5,xmm1\n        paddd     xmm4,xmm1\n        psrld     xmm5,SCALEBITS        ; xmm5=CbEL\n        psrld     xmm4,SCALEBITS        ; xmm4=CbEH\n        packssdw  xmm5,xmm4             ; xmm5=CbE\n\n        psllw     xmm7,BYTE_BIT\n        por       xmm5,xmm7             ; xmm5=Cb\n        movdqa    XMMWORD [ebx], xmm5   ; Save Cb\n\n        movdqa    xmm0, XMMWORD [wk(3)] ; xmm0=BO\n        movdqa    xmm6, XMMWORD [wk(2)] ; xmm6=BE\n        movdqa    xmm1, XMMWORD [wk(1)] ; xmm1=RO\n\n        movdqa    xmm4,xmm0\n        punpcklwd xmm0,xmm3\n        punpckhwd xmm4,xmm3\n        movdqa    xmm7,xmm0\n        movdqa    xmm5,xmm4\n        pmaddwd   xmm0,[GOTOFF(eax,PW_F0114_F0250)] ; xmm0=BOL*FIX(0.114)+GOL*FIX(0.250)\n        pmaddwd   xmm4,[GOTOFF(eax,PW_F0114_F0250)] ; xmm4=BOH*FIX(0.114)+GOH*FIX(0.250)\n        pmaddwd   xmm7,[GOTOFF(eax,PW_MF008_MF041)] ; xmm7=BOL*-FIX(0.081)+GOL*-FIX(0.418)\n        pmaddwd   xmm5,[GOTOFF(eax,PW_MF008_MF041)] ; xmm5=BOH*-FIX(0.081)+GOH*-FIX(0.418)\n\n        movdqa    xmm3,[GOTOFF(eax,PD_ONEHALF)] ; xmm3=[PD_ONEHALF]\n\n        paddd     xmm0, XMMWORD [wk(4)]\n        paddd     xmm4, XMMWORD [wk(5)]\n        paddd     xmm0,xmm3\n        paddd     xmm4,xmm3\n        psrld     xmm0,SCALEBITS        ; xmm0=YOL\n        psrld     xmm4,SCALEBITS        ; xmm4=YOH\n        packssdw  xmm0,xmm4             ; xmm0=YO\n\n        pxor      xmm3,xmm3\n        pxor      xmm4,xmm4\n        punpcklwd xmm3,xmm1             ; xmm3=ROL\n        punpckhwd xmm4,xmm1             ; xmm4=ROH\n        psrld     xmm3,1                ; xmm3=ROL*FIX(0.500)\n        psrld     xmm4,1                ; xmm4=ROH*FIX(0.500)\n\n        movdqa    xmm1,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; xmm1=[PD_ONEHALFM1_CJ]\n\n        paddd     xmm7,xmm3\n        paddd     xmm5,xmm4\n        paddd     xmm7,xmm1\n        paddd     xmm5,xmm1\n        psrld     xmm7,SCALEBITS        ; xmm7=CrOL\n        psrld     xmm5,SCALEBITS        ; xmm5=CrOH\n        packssdw  xmm7,xmm5             ; xmm7=CrO\n\n        movdqa    xmm3, XMMWORD [wk(0)] ; xmm3=RE\n\n        movdqa    xmm4,xmm6\n        punpcklwd xmm6,xmm2\n        punpckhwd xmm4,xmm2\n        movdqa    xmm1,xmm6\n        movdqa    xmm5,xmm4\n        pmaddwd   xmm6,[GOTOFF(eax,PW_F0114_F0250)] ; xmm6=BEL*FIX(0.114)+GEL*FIX(0.250)\n        pmaddwd   xmm4,[GOTOFF(eax,PW_F0114_F0250)] ; xmm4=BEH*FIX(0.114)+GEH*FIX(0.250)\n        pmaddwd   xmm1,[GOTOFF(eax,PW_MF008_MF041)] ; xmm1=BEL*-FIX(0.081)+GEL*-FIX(0.418)\n        pmaddwd   xmm5,[GOTOFF(eax,PW_MF008_MF041)] ; xmm5=BEH*-FIX(0.081)+GEH*-FIX(0.418)\n\n        movdqa    xmm2,[GOTOFF(eax,PD_ONEHALF)] ; xmm2=[PD_ONEHALF]\n\n        paddd     xmm6, XMMWORD [wk(6)]\n        paddd     xmm4, XMMWORD [wk(7)]\n        paddd     xmm6,xmm2\n        paddd     xmm4,xmm2\n        psrld     xmm6,SCALEBITS        ; xmm6=YEL\n        psrld     xmm4,SCALEBITS        ; xmm4=YEH\n        packssdw  xmm6,xmm4             ; xmm6=YE\n\n        psllw     xmm0,BYTE_BIT\n        por       xmm6,xmm0             ; xmm6=Y\n        movdqa    XMMWORD [edi], xmm6   ; Save Y\n\n        pxor      xmm2,xmm2\n        pxor      xmm4,xmm4\n        punpcklwd xmm2,xmm3             ; xmm2=REL\n        punpckhwd xmm4,xmm3             ; xmm4=REH\n        psrld     xmm2,1                ; xmm2=REL*FIX(0.500)\n        psrld     xmm4,1                ; xmm4=REH*FIX(0.500)\n\n        movdqa    xmm0,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; xmm0=[PD_ONEHALFM1_CJ]\n\n        paddd     xmm1,xmm2\n        paddd     xmm5,xmm4\n        paddd     xmm1,xmm0\n        paddd     xmm5,xmm0\n        psrld     xmm1,SCALEBITS        ; xmm1=CrEL\n        psrld     xmm5,SCALEBITS        ; xmm5=CrEH\n        packssdw  xmm1,xmm5             ; xmm1=CrE\n\n        psllw     xmm7,BYTE_BIT\n        por       xmm1,xmm7             ; xmm1=Cr\n        movdqa    XMMWORD [edx], xmm1   ; Save Cr\n\n        sub     ecx, byte SIZEOF_XMMWORD\n        add     esi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD  ; inptr\n        add     edi, byte SIZEOF_XMMWORD                ; outptr0\n        add     ebx, byte SIZEOF_XMMWORD                ; outptr1\n        add     edx, byte SIZEOF_XMMWORD                ; outptr2\n        cmp     ecx, byte SIZEOF_XMMWORD\n        jae     near .columnloop\n        test    ecx,ecx\n        jnz     near .column_ld1\n\n        pop     ecx                     ; col\n        pop     esi\n        pop     edi\n        pop     ebx\n        pop     edx\n        poppic  eax\n\n        add     esi, byte SIZEOF_JSAMPROW       ; input_buf\n        add     edi, byte SIZEOF_JSAMPROW\n        add     ebx, byte SIZEOF_JSAMPROW\n        add     edx, byte SIZEOF_JSAMPROW\n        dec     eax                             ; num_rows\n        jg      near .rowloop\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jccolor-altivec.c",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2014, D. R. Commander.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n/* RGB --> YCC CONVERSION */\n\n#include \"jsimd_altivec.h\"\n\n\n#define F_0_081 5329                 /* FIX(0.08131) */\n#define F_0_114 7471                 /* FIX(0.11400) */\n#define F_0_168 11059                /* FIX(0.16874) */\n#define F_0_250 16384                /* FIX(0.25000) */\n#define F_0_299 19595                /* FIX(0.29900) */\n#define F_0_331 21709                /* FIX(0.33126) */\n#define F_0_418 27439                /* FIX(0.41869) */\n#define F_0_500 32768                /* FIX(0.50000) */\n#define F_0_587 38470                /* FIX(0.58700) */\n#define F_0_337 (F_0_587 - F_0_250)  /* FIX(0.58700) - FIX(0.25000) */\n\n#define SCALEBITS 16\n#define ONE_HALF (1 << (SCALEBITS - 1))\n\n\n#define RGBG_INDEX0 {0,1,3,4,6,7,9,10,2,1,5,4,8,7,11,10}\n#define RGBG_INDEX1 {12,13,15,16,18,19,21,22,14,13,17,16,20,19,23,22}\n#define RGBG_INDEX2 {8,9,11,12,14,15,17,18,10,9,13,12,16,15,19,18}\n#define RGBG_INDEX3 {4,5,7,8,10,11,13,14,6,5,9,8,12,11,15,14}\n#include \"jccolext-altivec.c\"\n#undef RGB_PIXELSIZE\n\n#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n#define jsimd_rgb_ycc_convert_altivec jsimd_extrgb_ycc_convert_altivec\n#include \"jccolext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGBG_INDEX0\n#undef RGBG_INDEX1\n#undef RGBG_INDEX2\n#undef RGBG_INDEX3\n#undef jsimd_rgb_ycc_convert_altivec\n\n#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n#define RGBG_INDEX {0,1,4,5,8,9,12,13,2,1,6,5,10,9,14,13}\n#define jsimd_rgb_ycc_convert_altivec jsimd_extrgbx_ycc_convert_altivec\n#include \"jccolext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGBG_INDEX\n#undef jsimd_rgb_ycc_convert_altivec\n\n#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n#define RGBG_INDEX0 {2,1,5,4,8,7,11,10,0,1,3,4,6,7,9,10}\n#define RGBG_INDEX1 {14,13,17,16,20,19,23,22,12,13,15,16,18,19,21,22}\n#define RGBG_INDEX2 {10,9,13,12,16,15,19,18,8,9,11,12,14,15,17,18}\n#define RGBG_INDEX3 {6,5,9,8,12,11,15,14,4,5,7,8,10,11,13,14}\n#define jsimd_rgb_ycc_convert_altivec jsimd_extbgr_ycc_convert_altivec\n#include \"jccolext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGBG_INDEX0\n#undef RGBG_INDEX1\n#undef RGBG_INDEX2\n#undef RGBG_INDEX3\n#undef jsimd_rgb_ycc_convert_altivec\n\n#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n#define RGBG_INDEX {2,1,6,5,10,9,14,13,0,1,4,5,8,9,12,13}\n#define jsimd_rgb_ycc_convert_altivec jsimd_extbgrx_ycc_convert_altivec\n#include \"jccolext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGBG_INDEX\n#undef jsimd_rgb_ycc_convert_altivec\n\n#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n#define RGBG_INDEX {3,2,7,6,11,10,15,14,1,2,5,6,9,10,13,14}\n#define jsimd_rgb_ycc_convert_altivec jsimd_extxbgr_ycc_convert_altivec\n#include \"jccolext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGBG_INDEX\n#undef jsimd_rgb_ycc_convert_altivec\n\n#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n#define RGBG_INDEX {1,2,5,6,9,10,13,14,3,2,7,6,11,10,15,14}\n#define jsimd_rgb_ycc_convert_altivec jsimd_extxrgb_ycc_convert_altivec\n#include \"jccolext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGBG_INDEX\n#undef jsimd_rgb_ycc_convert_altivec\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jccolor-mmx.asm",
    "content": ";\n; jccolor.asm - colorspace conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS       16\n\nF_0_081 equ      5329                   ; FIX(0.08131)\nF_0_114 equ      7471                   ; FIX(0.11400)\nF_0_168 equ     11059                   ; FIX(0.16874)\nF_0_250 equ     16384                   ; FIX(0.25000)\nF_0_299 equ     19595                   ; FIX(0.29900)\nF_0_331 equ     21709                   ; FIX(0.33126)\nF_0_418 equ     27439                   ; FIX(0.41869)\nF_0_587 equ     38470                   ; FIX(0.58700)\nF_0_337 equ     (F_0_587 - F_0_250)     ; FIX(0.58700) - FIX(0.25000)\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_rgb_ycc_convert_mmx)\n\nEXTN(jconst_rgb_ycc_convert_mmx):\n\nPW_F0299_F0337  times 2 dw  F_0_299, F_0_337\nPW_F0114_F0250  times 2 dw  F_0_114, F_0_250\nPW_MF016_MF033  times 2 dw -F_0_168,-F_0_331\nPW_MF008_MF041  times 2 dw -F_0_081,-F_0_418\nPD_ONEHALFM1_CJ times 2 dd  (1 << (SCALEBITS-1)) - 1 + (CENTERJSAMPLE << SCALEBITS)\nPD_ONEHALF      times 2 dd  (1 << (SCALEBITS-1))\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n\n%include \"jccolext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_rgb_ycc_convert_mmx jsimd_extrgb_ycc_convert_mmx\n%include \"jccolext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_rgb_ycc_convert_mmx jsimd_extrgbx_ycc_convert_mmx\n%include \"jccolext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_rgb_ycc_convert_mmx jsimd_extbgr_ycc_convert_mmx\n%include \"jccolext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_rgb_ycc_convert_mmx jsimd_extbgrx_ycc_convert_mmx\n%include \"jccolext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_rgb_ycc_convert_mmx jsimd_extxbgr_ycc_convert_mmx\n%include \"jccolext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_rgb_ycc_convert_mmx jsimd_extxrgb_ycc_convert_mmx\n%include \"jccolext-mmx.asm\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jccolor-sse2-64.asm",
    "content": ";\n; jccolor.asm - colorspace conversion (64-bit SSE2)\n;\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS       16\n\nF_0_081 equ      5329                   ; FIX(0.08131)\nF_0_114 equ      7471                   ; FIX(0.11400)\nF_0_168 equ     11059                   ; FIX(0.16874)\nF_0_250 equ     16384                   ; FIX(0.25000)\nF_0_299 equ     19595                   ; FIX(0.29900)\nF_0_331 equ     21709                   ; FIX(0.33126)\nF_0_418 equ     27439                   ; FIX(0.41869)\nF_0_587 equ     38470                   ; FIX(0.58700)\nF_0_337 equ     (F_0_587 - F_0_250)     ; FIX(0.58700) - FIX(0.25000)\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_rgb_ycc_convert_sse2)\n\nEXTN(jconst_rgb_ycc_convert_sse2):\n\nPW_F0299_F0337  times 4 dw  F_0_299, F_0_337\nPW_F0114_F0250  times 4 dw  F_0_114, F_0_250\nPW_MF016_MF033  times 4 dw -F_0_168,-F_0_331\nPW_MF008_MF041  times 4 dw -F_0_081,-F_0_418\nPD_ONEHALFM1_CJ times 4 dd  (1 << (SCALEBITS-1)) - 1 + (CENTERJSAMPLE << SCALEBITS)\nPD_ONEHALF      times 4 dd  (1 << (SCALEBITS-1))\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n\n%include \"jccolext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extrgb_ycc_convert_sse2\n%include \"jccolext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extrgbx_ycc_convert_sse2\n%include \"jccolext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extbgr_ycc_convert_sse2\n%include \"jccolext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extbgrx_ycc_convert_sse2\n%include \"jccolext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extxbgr_ycc_convert_sse2\n%include \"jccolext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extxrgb_ycc_convert_sse2\n%include \"jccolext-sse2-64.asm\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jccolor-sse2.asm",
    "content": ";\n; jccolor.asm - colorspace conversion (SSE2)\n;\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS       16\n\nF_0_081 equ      5329                   ; FIX(0.08131)\nF_0_114 equ      7471                   ; FIX(0.11400)\nF_0_168 equ     11059                   ; FIX(0.16874)\nF_0_250 equ     16384                   ; FIX(0.25000)\nF_0_299 equ     19595                   ; FIX(0.29900)\nF_0_331 equ     21709                   ; FIX(0.33126)\nF_0_418 equ     27439                   ; FIX(0.41869)\nF_0_587 equ     38470                   ; FIX(0.58700)\nF_0_337 equ     (F_0_587 - F_0_250)     ; FIX(0.58700) - FIX(0.25000)\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_rgb_ycc_convert_sse2)\n\nEXTN(jconst_rgb_ycc_convert_sse2):\n\nPW_F0299_F0337  times 4 dw  F_0_299, F_0_337\nPW_F0114_F0250  times 4 dw  F_0_114, F_0_250\nPW_MF016_MF033  times 4 dw -F_0_168,-F_0_331\nPW_MF008_MF041  times 4 dw -F_0_081,-F_0_418\nPD_ONEHALFM1_CJ times 4 dd  (1 << (SCALEBITS-1)) - 1 + (CENTERJSAMPLE << SCALEBITS)\nPD_ONEHALF      times 4 dd  (1 << (SCALEBITS-1))\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n\n%include \"jccolext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extrgb_ycc_convert_sse2\n%include \"jccolext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extrgbx_ycc_convert_sse2\n%include \"jccolext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extbgr_ycc_convert_sse2\n%include \"jccolext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extbgrx_ycc_convert_sse2\n%include \"jccolext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extxbgr_ycc_convert_sse2\n%include \"jccolext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extxrgb_ycc_convert_sse2\n%include \"jccolext-sse2.asm\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jcgray-altivec.c",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2014, D. R. Commander.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n/* RGB --> GRAYSCALE CONVERSION */\n\n#include \"jsimd_altivec.h\"\n\n\n#define F_0_114 7471                 /* FIX(0.11400) */\n#define F_0_250 16384                /* FIX(0.25000) */\n#define F_0_299 19595                /* FIX(0.29900) */\n#define F_0_587 38470                /* FIX(0.58700) */\n#define F_0_337 (F_0_587 - F_0_250)  /* FIX(0.58700) - FIX(0.25000) */\n\n#define SCALEBITS 16\n#define ONE_HALF (1 << (SCALEBITS - 1))\n\n\n#define RGBG_INDEX0 {0,1,3,4,6,7,9,10,2,1,5,4,8,7,11,10}\n#define RGBG_INDEX1 {12,13,15,16,18,19,21,22,14,13,17,16,20,19,23,22}\n#define RGBG_INDEX2 {8,9,11,12,14,15,17,18,10,9,13,12,16,15,19,18}\n#define RGBG_INDEX3 {4,5,7,8,10,11,13,14,6,5,9,8,12,11,15,14}\n#include \"jcgryext-altivec.c\"\n#undef RGB_PIXELSIZE\n\n#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n#define jsimd_rgb_gray_convert_altivec jsimd_extrgb_gray_convert_altivec\n#include \"jcgryext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGBG_INDEX0\n#undef RGBG_INDEX1\n#undef RGBG_INDEX2\n#undef RGBG_INDEX3\n#undef jsimd_rgb_gray_convert_altivec\n\n#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n#define RGBG_INDEX {0,1,4,5,8,9,12,13,2,1,6,5,10,9,14,13}\n#define jsimd_rgb_gray_convert_altivec jsimd_extrgbx_gray_convert_altivec\n#include \"jcgryext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGBG_INDEX\n#undef jsimd_rgb_gray_convert_altivec\n\n#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n#define RGBG_INDEX0 {2,1,5,4,8,7,11,10,0,1,3,4,6,7,9,10}\n#define RGBG_INDEX1 {14,13,17,16,20,19,23,22,12,13,15,16,18,19,21,22}\n#define RGBG_INDEX2 {10,9,13,12,16,15,19,18,8,9,11,12,14,15,17,18}\n#define RGBG_INDEX3 {6,5,9,8,12,11,15,14,4,5,7,8,10,11,13,14}\n#define jsimd_rgb_gray_convert_altivec jsimd_extbgr_gray_convert_altivec\n#include \"jcgryext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGBG_INDEX0\n#undef RGBG_INDEX1\n#undef RGBG_INDEX2\n#undef RGBG_INDEX3\n#undef jsimd_rgb_gray_convert_altivec\n\n#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n#define RGBG_INDEX {2,1,6,5,10,9,14,13,0,1,4,5,8,9,12,13}\n#define jsimd_rgb_gray_convert_altivec jsimd_extbgrx_gray_convert_altivec\n#include \"jcgryext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGBG_INDEX\n#undef jsimd_rgb_gray_convert_altivec\n\n#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n#define RGBG_INDEX {3,2,7,6,11,10,15,14,1,2,5,6,9,10,13,14}\n#define jsimd_rgb_gray_convert_altivec jsimd_extxbgr_gray_convert_altivec\n#include \"jcgryext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGBG_INDEX\n#undef jsimd_rgb_gray_convert_altivec\n\n#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n#define RGBG_INDEX {1,2,5,6,9,10,13,14,3,2,7,6,11,10,15,14}\n#define jsimd_rgb_gray_convert_altivec jsimd_extxrgb_gray_convert_altivec\n#include \"jcgryext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGBG_INDEX\n#undef jsimd_rgb_gray_convert_altivec\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jcgray-mmx.asm",
    "content": ";\n; jcgray.asm - grayscale colorspace conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2011, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS       16\n\nF_0_114 equ      7471                   ; FIX(0.11400)\nF_0_250 equ     16384                   ; FIX(0.25000)\nF_0_299 equ     19595                   ; FIX(0.29900)\nF_0_587 equ     38470                   ; FIX(0.58700)\nF_0_337 equ     (F_0_587 - F_0_250)     ; FIX(0.58700) - FIX(0.25000)\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_rgb_gray_convert_mmx)\n\nEXTN(jconst_rgb_gray_convert_mmx):\n\nPW_F0299_F0337  times 2 dw  F_0_299, F_0_337\nPW_F0114_F0250  times 2 dw  F_0_114, F_0_250\nPD_ONEHALF      times 2 dd  (1 << (SCALEBITS-1))\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n\n%include \"jcgryext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_rgb_gray_convert_mmx jsimd_extrgb_gray_convert_mmx\n%include \"jcgryext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_rgb_gray_convert_mmx jsimd_extrgbx_gray_convert_mmx\n%include \"jcgryext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_rgb_gray_convert_mmx jsimd_extbgr_gray_convert_mmx\n%include \"jcgryext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_rgb_gray_convert_mmx jsimd_extbgrx_gray_convert_mmx\n%include \"jcgryext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_rgb_gray_convert_mmx jsimd_extxbgr_gray_convert_mmx\n%include \"jcgryext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_rgb_gray_convert_mmx jsimd_extxrgb_gray_convert_mmx\n%include \"jcgryext-mmx.asm\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jcgray-sse2-64.asm",
    "content": ";\n; jcgray.asm - grayscale colorspace conversion (64-bit SSE2)\n;\n; Copyright (C) 2011, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS       16\n\nF_0_114 equ      7471                   ; FIX(0.11400)\nF_0_250 equ     16384                   ; FIX(0.25000)\nF_0_299 equ     19595                   ; FIX(0.29900)\nF_0_587 equ     38470                   ; FIX(0.58700)\nF_0_337 equ     (F_0_587 - F_0_250)     ; FIX(0.58700) - FIX(0.25000)\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_rgb_gray_convert_sse2)\n\nEXTN(jconst_rgb_gray_convert_sse2):\n\nPW_F0299_F0337  times 4 dw  F_0_299, F_0_337\nPW_F0114_F0250  times 4 dw  F_0_114, F_0_250\nPD_ONEHALF      times 4 dd  (1 << (SCALEBITS-1))\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n\n%include \"jcgryext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extrgb_gray_convert_sse2\n%include \"jcgryext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extrgbx_gray_convert_sse2\n%include \"jcgryext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extbgr_gray_convert_sse2\n%include \"jcgryext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extbgrx_gray_convert_sse2\n%include \"jcgryext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extxbgr_gray_convert_sse2\n%include \"jcgryext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extxrgb_gray_convert_sse2\n%include \"jcgryext-sse2-64.asm\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jcgray-sse2.asm",
    "content": ";\n; jcgray.asm - grayscale colorspace conversion (SSE2)\n;\n; Copyright (C) 2011, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS       16\n\nF_0_114 equ      7471                   ; FIX(0.11400)\nF_0_250 equ     16384                   ; FIX(0.25000)\nF_0_299 equ     19595                   ; FIX(0.29900)\nF_0_587 equ     38470                   ; FIX(0.58700)\nF_0_337 equ     (F_0_587 - F_0_250)     ; FIX(0.58700) - FIX(0.25000)\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_rgb_gray_convert_sse2)\n\nEXTN(jconst_rgb_gray_convert_sse2):\n\nPW_F0299_F0337  times 4 dw  F_0_299, F_0_337\nPW_F0114_F0250  times 4 dw  F_0_114, F_0_250\nPD_ONEHALF      times 4 dd  (1 << (SCALEBITS-1))\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n\n%include \"jcgryext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extrgb_gray_convert_sse2\n%include \"jcgryext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extrgbx_gray_convert_sse2\n%include \"jcgryext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extbgr_gray_convert_sse2\n%include \"jcgryext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extbgrx_gray_convert_sse2\n%include \"jcgryext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extxbgr_gray_convert_sse2\n%include \"jcgryext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extxrgb_gray_convert_sse2\n%include \"jcgryext-sse2.asm\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jcgryext-altivec.c",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2014-2015, D. R. Commander.  All Rights Reserved.\n * Copyright (C) 2014, Jay Foad.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n/* This file is included by jcgray-altivec.c */\n\n\nvoid jsimd_rgb_gray_convert_altivec (JDIMENSION img_width,\n                                     JSAMPARRAY input_buf,\n                                     JSAMPIMAGE output_buf,\n                                     JDIMENSION output_row, int num_rows)\n{\n  JSAMPROW inptr, outptr;\n  int pitch = img_width * RGB_PIXELSIZE, num_cols;\n#if __BIG_ENDIAN__\n  int offset;\n  unsigned char __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16];\n#endif\n\n  __vector unsigned char rgb0, rgb1 = {0}, rgb2 = {0},\n    rgbg0, rgbg1, rgbg2, rgbg3, y;\n#if __BIG_ENDIAN__ || RGB_PIXELSIZE == 4\n  __vector unsigned char rgb3 = {0};\n#endif\n#if __BIG_ENDIAN__ && RGB_PIXELSIZE == 4\n  __vector unsigned char rgb4 = {0};\n#endif\n  __vector short rg0, rg1, rg2, rg3, bg0, bg1, bg2, bg3;\n  __vector unsigned short yl, yh;\n  __vector int y0, y1, y2, y3;\n\n  /* Constants */\n  __vector short pw_f0299_f0337 = { __4X2(F_0_299, F_0_337) },\n    pw_f0114_f0250 = { __4X2(F_0_114, F_0_250) };\n  __vector int pd_onehalf = { __4X(ONE_HALF) };\n  __vector unsigned char pb_zero = { __16X(0) },\n#if __BIG_ENDIAN__\n    shift_pack_index = {0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29};\n#else\n    shift_pack_index = {2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31};\n#endif\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr = output_buf[0][output_row];\n    output_row++;\n\n    for (num_cols = pitch; num_cols > 0;\n         num_cols -= RGB_PIXELSIZE * 16, inptr += RGB_PIXELSIZE * 16,\n         outptr += 16) {\n\n#if __BIG_ENDIAN__\n      /* Load 16 pixels == 48 or 64 bytes */\n      offset = (size_t)inptr & 15;\n      if (offset) {\n        __vector unsigned char unaligned_shift_index;\n        int bytes = num_cols + offset;\n\n        if (bytes < (RGB_PIXELSIZE + 1) * 16 && (bytes & 15)) {\n          /* Slow path to prevent buffer overread.  Since there is no way to\n           * read a partial AltiVec register, overread would occur on the last\n           * chunk of the last image row if the right edge is not on a 16-byte\n           * boundary.  It could also occur on other rows if the bytes per row\n           * is low enough.  Since we can't determine whether we're on the last\n           * image row, we have to assume every row is the last.\n           */\n          memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16));\n          rgb0 = vec_ld(0, tmpbuf);\n          rgb1 = vec_ld(16, tmpbuf);\n          rgb2 = vec_ld(32, tmpbuf);\n#if RGB_PIXELSIZE == 4\n          rgb3 = vec_ld(48, tmpbuf);\n#endif\n        } else {\n          /* Fast path */\n          rgb0 = vec_ld(0, inptr);\n          if (bytes > 16)\n            rgb1 = vec_ld(16, inptr);\n          if (bytes > 32)\n            rgb2 = vec_ld(32, inptr);\n          if (bytes > 48)\n            rgb3 = vec_ld(48, inptr);\n#if RGB_PIXELSIZE == 4\n          if (bytes > 64)\n            rgb4 = vec_ld(64, inptr);\n#endif\n          unaligned_shift_index = vec_lvsl(0, inptr);\n          rgb0 = vec_perm(rgb0, rgb1, unaligned_shift_index);\n          rgb1 = vec_perm(rgb1, rgb2, unaligned_shift_index);\n          rgb2 = vec_perm(rgb2, rgb3, unaligned_shift_index);\n#if RGB_PIXELSIZE == 4\n          rgb3 = vec_perm(rgb3, rgb4, unaligned_shift_index);\n#endif\n        }\n      } else {\n        if (num_cols < RGB_PIXELSIZE * 16 && (num_cols & 15)) {\n          /* Slow path */\n          memcpy(tmpbuf, inptr, min(num_cols, RGB_PIXELSIZE * 16));\n          rgb0 = vec_ld(0, tmpbuf);\n          rgb1 = vec_ld(16, tmpbuf);\n          rgb2 = vec_ld(32, tmpbuf);\n#if RGB_PIXELSIZE == 4\n          rgb3 = vec_ld(48, tmpbuf);\n#endif\n        } else {\n          /* Fast path */\n          rgb0 = vec_ld(0, inptr);\n          if (num_cols > 16)\n            rgb1 = vec_ld(16, inptr);\n          if (num_cols > 32)\n            rgb2 = vec_ld(32, inptr);\n#if RGB_PIXELSIZE == 4\n          if (num_cols > 48)\n            rgb3 = vec_ld(48, inptr);\n#endif\n        }\n      }\n#else\n      /* Little endian */\n      rgb0 = vec_vsx_ld(0, inptr);\n      if (num_cols > 16)\n        rgb1 = vec_vsx_ld(16, inptr);\n      if (num_cols > 32)\n        rgb2 = vec_vsx_ld(32, inptr);\n#if RGB_PIXELSIZE == 4\n      if (num_cols > 48)\n        rgb3 = vec_vsx_ld(48, inptr);\n#endif\n#endif\n\n#if RGB_PIXELSIZE == 3\n      /* rgb0 = R0 G0 B0 R1 G1 B1 R2 G2 B2 R3 G3 B3 R4 G4 B4 R5\n       * rgb1 = G5 B5 R6 G6 B6 R7 G7 B7 R8 G8 B8 R9 G9 B9 Ra Ga\n       * rgb2 = Ba Rb Gb Bb Rc Gc Bc Rd Gd Bd Re Ge Be Rf Gf Bf\n       *\n       * rgbg0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 G0 B1 G1 B2 G2 B3 G3\n       * rgbg1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 G4 B5 G5 B6 G6 B7 G7\n       * rgbg2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 G8 B9 G9 Ba Ga Bb Gb\n       * rgbg3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Gc Bd Gd Be Ge Bf Gf\n       */\n      rgbg0 = vec_perm(rgb0, rgb0, (__vector unsigned char)RGBG_INDEX0);\n      rgbg1 = vec_perm(rgb0, rgb1, (__vector unsigned char)RGBG_INDEX1);\n      rgbg2 = vec_perm(rgb1, rgb2, (__vector unsigned char)RGBG_INDEX2);\n      rgbg3 = vec_perm(rgb2, rgb2, (__vector unsigned char)RGBG_INDEX3);\n#else\n      /* rgb0 = R0 G0 B0 X0 R1 G1 B1 X1 R2 G2 B2 X2 R3 G3 B3 X3\n       * rgb1 = R4 G4 B4 X4 R5 G5 B5 X5 R6 G6 B6 X6 R7 G7 B7 X7\n       * rgb2 = R8 G8 B8 X8 R9 G9 B9 X9 Ra Ga Ba Xa Rb Gb Bb Xb\n       * rgb3 = Rc Gc Bc Xc Rd Gd Bd Xd Re Ge Be Xe Rf Gf Bf Xf\n       *\n       * rgbg0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 G0 B1 G1 B2 G2 B3 G3\n       * rgbg1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 G4 B5 G5 B6 G6 B7 G7\n       * rgbg2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 G8 B9 G9 Ba Ga Bb Gb\n       * rgbg3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Gc Bd Gd Be Ge Bf Gf\n       */\n      rgbg0 = vec_perm(rgb0, rgb0, (__vector unsigned char)RGBG_INDEX);\n      rgbg1 = vec_perm(rgb1, rgb1, (__vector unsigned char)RGBG_INDEX);\n      rgbg2 = vec_perm(rgb2, rgb2, (__vector unsigned char)RGBG_INDEX);\n      rgbg3 = vec_perm(rgb3, rgb3, (__vector unsigned char)RGBG_INDEX);\n#endif\n\n      /* rg0 = R0 G0 R1 G1 R2 G2 R3 G3\n       * bg0 = B0 G0 B1 G1 B2 G2 B3 G3\n       * ...\n       *\n       * NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't\n       * support unsigned vectors.\n       */\n      rg0 = (__vector signed short)VEC_UNPACKHU(rgbg0);\n      bg0 = (__vector signed short)VEC_UNPACKLU(rgbg0);\n      rg1 = (__vector signed short)VEC_UNPACKHU(rgbg1);\n      bg1 = (__vector signed short)VEC_UNPACKLU(rgbg1);\n      rg2 = (__vector signed short)VEC_UNPACKHU(rgbg2);\n      bg2 = (__vector signed short)VEC_UNPACKLU(rgbg2);\n      rg3 = (__vector signed short)VEC_UNPACKHU(rgbg3);\n      bg3 = (__vector signed short)VEC_UNPACKLU(rgbg3);\n\n      /* (Original)\n       * Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n       *\n       * (This implementation)\n       * Y  =  0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G\n       */\n\n      /* Calculate Y values */\n\n      y0 = vec_msums(rg0, pw_f0299_f0337, pd_onehalf);\n      y1 = vec_msums(rg1, pw_f0299_f0337, pd_onehalf);\n      y2 = vec_msums(rg2, pw_f0299_f0337, pd_onehalf);\n      y3 = vec_msums(rg3, pw_f0299_f0337, pd_onehalf);\n      y0 = vec_msums(bg0, pw_f0114_f0250, y0);\n      y1 = vec_msums(bg1, pw_f0114_f0250, y1);\n      y2 = vec_msums(bg2, pw_f0114_f0250, y2);\n      y3 = vec_msums(bg3, pw_f0114_f0250, y3);\n      /* Clever way to avoid 4 shifts + 2 packs.  This packs the high word from\n       * each dword into a new 16-bit vector, which is the equivalent of\n       * descaling the 32-bit results (right-shifting by 16 bits) and then\n       * packing them.\n       */\n      yl = vec_perm((__vector unsigned short)y0, (__vector unsigned short)y1,\n                    shift_pack_index);\n      yh = vec_perm((__vector unsigned short)y2, (__vector unsigned short)y3,\n                    shift_pack_index);\n      y = vec_pack(yl, yh);\n      vec_st(y, 0, outptr);\n    }\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jcgryext-mmx.asm",
    "content": ";\n; jcgryext.asm - grayscale colorspace conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2011, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_rgb_gray_convert_mmx (JDIMENSION img_width,\n;                             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n;                             JDIMENSION output_row, int num_rows);\n;\n\n%define img_width(b)    (b)+8           ; JDIMENSION img_width\n%define input_buf(b)    (b)+12          ; JSAMPARRAY input_buf\n%define output_buf(b)   (b)+16          ; JSAMPIMAGE output_buf\n%define output_row(b)   (b)+20          ; JDIMENSION output_row\n%define num_rows(b)     (b)+24          ; int num_rows\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_MMWORD  ; mmword wk[WK_NUM]\n%define WK_NUM          2\n%define gotptr          wk(0)-SIZEOF_POINTER    ; void * gotptr\n\n        align   16\n        global  EXTN(jsimd_rgb_gray_convert_mmx)\n\nEXTN(jsimd_rgb_gray_convert_mmx):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_MMWORD)      ; align to 64 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic eax             ; make a room for GOT address\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx                     ; get GOT address\n        movpic  POINTER [gotptr], ebx   ; save GOT address\n\n        mov     ecx, JDIMENSION [img_width(eax)]        ; num_cols\n        test    ecx,ecx\n        jz      near .return\n\n        push    ecx\n\n        mov     esi, JSAMPIMAGE [output_buf(eax)]\n        mov     ecx, JDIMENSION [output_row(eax)]\n        mov     edi, JSAMPARRAY [esi+0*SIZEOF_JSAMPARRAY]\n        lea     edi, [edi+ecx*SIZEOF_JSAMPROW]\n\n        pop     ecx\n\n        mov     esi, JSAMPARRAY [input_buf(eax)]\n        mov     eax, INT [num_rows(eax)]\n        test    eax,eax\n        jle     near .return\n        alignx  16,7\n.rowloop:\n        pushpic eax\n        push    edi\n        push    esi\n        push    ecx                     ; col\n\n        mov     esi, JSAMPROW [esi]     ; inptr\n        mov     edi, JSAMPROW [edi]     ; outptr0\n        movpic  eax, POINTER [gotptr]   ; load GOT address (eax)\n\n        cmp     ecx, byte SIZEOF_MMWORD\n        jae     short .columnloop\n        alignx  16,7\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n.column_ld1:\n        push    eax\n        push    edx\n        lea     ecx,[ecx+ecx*2]         ; imul ecx,RGB_PIXELSIZE\n        test    cl, SIZEOF_BYTE\n        jz      short .column_ld2\n        sub     ecx, byte SIZEOF_BYTE\n        xor     eax,eax\n        mov     al, BYTE [esi+ecx]\n.column_ld2:\n        test    cl, SIZEOF_WORD\n        jz      short .column_ld4\n        sub     ecx, byte SIZEOF_WORD\n        xor     edx,edx\n        mov     dx, WORD [esi+ecx]\n        shl     eax, WORD_BIT\n        or      eax,edx\n.column_ld4:\n        movd    mmA,eax\n        pop     edx\n        pop     eax\n        test    cl, SIZEOF_DWORD\n        jz      short .column_ld8\n        sub     ecx, byte SIZEOF_DWORD\n        movd    mmG, DWORD [esi+ecx]\n        psllq   mmA, DWORD_BIT\n        por     mmA,mmG\n.column_ld8:\n        test    cl, SIZEOF_MMWORD\n        jz      short .column_ld16\n        movq    mmG,mmA\n        movq    mmA, MMWORD [esi+0*SIZEOF_MMWORD]\n        mov     ecx, SIZEOF_MMWORD\n        jmp     short .rgb_gray_cnv\n.column_ld16:\n        test    cl, 2*SIZEOF_MMWORD\n        mov     ecx, SIZEOF_MMWORD\n        jz      short .rgb_gray_cnv\n        movq    mmF,mmA\n        movq    mmA, MMWORD [esi+0*SIZEOF_MMWORD]\n        movq    mmG, MMWORD [esi+1*SIZEOF_MMWORD]\n        jmp     short .rgb_gray_cnv\n        alignx  16,7\n\n.columnloop:\n        movq    mmA, MMWORD [esi+0*SIZEOF_MMWORD]\n        movq    mmG, MMWORD [esi+1*SIZEOF_MMWORD]\n        movq    mmF, MMWORD [esi+2*SIZEOF_MMWORD]\n\n.rgb_gray_cnv:\n        ; mmA=(00 10 20 01 11 21 02 12)\n        ; mmG=(22 03 13 23 04 14 24 05)\n        ; mmF=(15 25 06 16 26 07 17 27)\n\n        movq      mmD,mmA\n        psllq     mmA,4*BYTE_BIT        ; mmA=(-- -- -- -- 00 10 20 01)\n        psrlq     mmD,4*BYTE_BIT        ; mmD=(11 21 02 12 -- -- -- --)\n\n        punpckhbw mmA,mmG               ; mmA=(00 04 10 14 20 24 01 05)\n        psllq     mmG,4*BYTE_BIT        ; mmG=(-- -- -- -- 22 03 13 23)\n\n        punpcklbw mmD,mmF               ; mmD=(11 15 21 25 02 06 12 16)\n        punpckhbw mmG,mmF               ; mmG=(22 26 03 07 13 17 23 27)\n\n        movq      mmE,mmA\n        psllq     mmA,4*BYTE_BIT        ; mmA=(-- -- -- -- 00 04 10 14)\n        psrlq     mmE,4*BYTE_BIT        ; mmE=(20 24 01 05 -- -- -- --)\n\n        punpckhbw mmA,mmD               ; mmA=(00 02 04 06 10 12 14 16)\n        psllq     mmD,4*BYTE_BIT        ; mmD=(-- -- -- -- 11 15 21 25)\n\n        punpcklbw mmE,mmG               ; mmE=(20 22 24 26 01 03 05 07)\n        punpckhbw mmD,mmG               ; mmD=(11 13 15 17 21 23 25 27)\n\n        pxor      mmH,mmH\n\n        movq      mmC,mmA\n        punpcklbw mmA,mmH               ; mmA=(00 02 04 06)\n        punpckhbw mmC,mmH               ; mmC=(10 12 14 16)\n\n        movq      mmB,mmE\n        punpcklbw mmE,mmH               ; mmE=(20 22 24 26)\n        punpckhbw mmB,mmH               ; mmB=(01 03 05 07)\n\n        movq      mmF,mmD\n        punpcklbw mmD,mmH               ; mmD=(11 13 15 17)\n        punpckhbw mmF,mmH               ; mmF=(21 23 25 27)\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n.column_ld1:\n        test    cl, SIZEOF_MMWORD/8\n        jz      short .column_ld2\n        sub     ecx, byte SIZEOF_MMWORD/8\n        movd    mmA, DWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld2:\n        test    cl, SIZEOF_MMWORD/4\n        jz      short .column_ld4\n        sub     ecx, byte SIZEOF_MMWORD/4\n        movq    mmF,mmA\n        movq    mmA, MMWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld4:\n        test    cl, SIZEOF_MMWORD/2\n        mov     ecx, SIZEOF_MMWORD\n        jz      short .rgb_gray_cnv\n        movq    mmD,mmA\n        movq    mmC,mmF\n        movq    mmA, MMWORD [esi+0*SIZEOF_MMWORD]\n        movq    mmF, MMWORD [esi+1*SIZEOF_MMWORD]\n        jmp     short .rgb_gray_cnv\n        alignx  16,7\n\n.columnloop:\n        movq    mmA, MMWORD [esi+0*SIZEOF_MMWORD]\n        movq    mmF, MMWORD [esi+1*SIZEOF_MMWORD]\n        movq    mmD, MMWORD [esi+2*SIZEOF_MMWORD]\n        movq    mmC, MMWORD [esi+3*SIZEOF_MMWORD]\n\n.rgb_gray_cnv:\n        ; mmA=(00 10 20 30 01 11 21 31)\n        ; mmF=(02 12 22 32 03 13 23 33)\n        ; mmD=(04 14 24 34 05 15 25 35)\n        ; mmC=(06 16 26 36 07 17 27 37)\n\n        movq      mmB,mmA\n        punpcklbw mmA,mmF               ; mmA=(00 02 10 12 20 22 30 32)\n        punpckhbw mmB,mmF               ; mmB=(01 03 11 13 21 23 31 33)\n\n        movq      mmG,mmD\n        punpcklbw mmD,mmC               ; mmD=(04 06 14 16 24 26 34 36)\n        punpckhbw mmG,mmC               ; mmG=(05 07 15 17 25 27 35 37)\n\n        movq      mmE,mmA\n        punpcklwd mmA,mmD               ; mmA=(00 02 04 06 10 12 14 16)\n        punpckhwd mmE,mmD               ; mmE=(20 22 24 26 30 32 34 36)\n\n        movq      mmH,mmB\n        punpcklwd mmB,mmG               ; mmB=(01 03 05 07 11 13 15 17)\n        punpckhwd mmH,mmG               ; mmH=(21 23 25 27 31 33 35 37)\n\n        pxor      mmF,mmF\n\n        movq      mmC,mmA\n        punpcklbw mmA,mmF               ; mmA=(00 02 04 06)\n        punpckhbw mmC,mmF               ; mmC=(10 12 14 16)\n\n        movq      mmD,mmB\n        punpcklbw mmB,mmF               ; mmB=(01 03 05 07)\n        punpckhbw mmD,mmF               ; mmD=(11 13 15 17)\n\n        movq      mmG,mmE\n        punpcklbw mmE,mmF               ; mmE=(20 22 24 26)\n        punpckhbw mmG,mmF               ; mmG=(30 32 34 36)\n\n        punpcklbw mmF,mmH\n        punpckhbw mmH,mmH\n        psrlw     mmF,BYTE_BIT          ; mmF=(21 23 25 27)\n        psrlw     mmH,BYTE_BIT          ; mmH=(31 33 35 37)\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n        ; mm0=(R0 R2 R4 R6)=RE, mm2=(G0 G2 G4 G6)=GE, mm4=(B0 B2 B4 B6)=BE\n        ; mm1=(R1 R3 R5 R7)=RO, mm3=(G1 G3 G5 G7)=GO, mm5=(B1 B3 B5 B7)=BO\n\n        ; (Original)\n        ; Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n        ;\n        ; (This implementation)\n        ; Y  =  0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G\n\n        movq      mm6,mm1\n        punpcklwd mm1,mm3\n        punpckhwd mm6,mm3\n        pmaddwd   mm1,[GOTOFF(eax,PW_F0299_F0337)] ; mm1=ROL*FIX(0.299)+GOL*FIX(0.337)\n        pmaddwd   mm6,[GOTOFF(eax,PW_F0299_F0337)] ; mm6=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n        movq      mm7, mm6      ; mm7=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n        movq      mm6,mm0\n        punpcklwd mm0,mm2\n        punpckhwd mm6,mm2\n        pmaddwd   mm0,[GOTOFF(eax,PW_F0299_F0337)] ; mm0=REL*FIX(0.299)+GEL*FIX(0.337)\n        pmaddwd   mm6,[GOTOFF(eax,PW_F0299_F0337)] ; mm6=REH*FIX(0.299)+GEH*FIX(0.337)\n\n        movq      MMWORD [wk(0)], mm0   ; wk(0)=REL*FIX(0.299)+GEL*FIX(0.337)\n        movq      MMWORD [wk(1)], mm6   ; wk(1)=REH*FIX(0.299)+GEH*FIX(0.337)\n\n        movq      mm0, mm5      ; mm0=BO\n        movq      mm6, mm4      ; mm6=BE\n\n        movq      mm4,mm0\n        punpcklwd mm0,mm3\n        punpckhwd mm4,mm3\n        pmaddwd   mm0,[GOTOFF(eax,PW_F0114_F0250)] ; mm0=BOL*FIX(0.114)+GOL*FIX(0.250)\n        pmaddwd   mm4,[GOTOFF(eax,PW_F0114_F0250)] ; mm4=BOH*FIX(0.114)+GOH*FIX(0.250)\n\n        movq      mm3,[GOTOFF(eax,PD_ONEHALF)]  ; mm3=[PD_ONEHALF]\n\n        paddd     mm0, mm1\n        paddd     mm4, mm7\n        paddd     mm0,mm3\n        paddd     mm4,mm3\n        psrld     mm0,SCALEBITS         ; mm0=YOL\n        psrld     mm4,SCALEBITS         ; mm4=YOH\n        packssdw  mm0,mm4               ; mm0=YO\n\n        movq      mm4,mm6\n        punpcklwd mm6,mm2\n        punpckhwd mm4,mm2\n        pmaddwd   mm6,[GOTOFF(eax,PW_F0114_F0250)] ; mm6=BEL*FIX(0.114)+GEL*FIX(0.250)\n        pmaddwd   mm4,[GOTOFF(eax,PW_F0114_F0250)] ; mm4=BEH*FIX(0.114)+GEH*FIX(0.250)\n\n        movq      mm2,[GOTOFF(eax,PD_ONEHALF)]  ; mm2=[PD_ONEHALF]\n\n        paddd     mm6, MMWORD [wk(0)]\n        paddd     mm4, MMWORD [wk(1)]\n        paddd     mm6,mm2\n        paddd     mm4,mm2\n        psrld     mm6,SCALEBITS         ; mm6=YEL\n        psrld     mm4,SCALEBITS         ; mm4=YEH\n        packssdw  mm6,mm4               ; mm6=YE\n\n        psllw     mm0,BYTE_BIT\n        por       mm6,mm0               ; mm6=Y\n        movq      MMWORD [edi], mm6     ; Save Y\n\n        sub     ecx, byte SIZEOF_MMWORD\n        add     esi, byte RGB_PIXELSIZE*SIZEOF_MMWORD   ; inptr\n        add     edi, byte SIZEOF_MMWORD                 ; outptr0\n        cmp     ecx, byte SIZEOF_MMWORD\n        jae     near .columnloop\n        test    ecx,ecx\n        jnz     near .column_ld1\n\n        pop     ecx                     ; col\n        pop     esi\n        pop     edi\n        poppic  eax\n\n        add     esi, byte SIZEOF_JSAMPROW       ; input_buf\n        add     edi, byte SIZEOF_JSAMPROW\n        dec     eax                             ; num_rows\n        jg      near .rowloop\n\n        emms            ; empty MMX state\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jcgryext-sse2-64.asm",
    "content": ";\n; jcgryext.asm - grayscale colorspace conversion (64-bit SSE2)\n;\n; Copyright (C) 2011, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_rgb_gray_convert_sse2 (JDIMENSION img_width,\n;                              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n;                              JDIMENSION output_row, int num_rows);\n;\n\n; r10 = JDIMENSION img_width\n; r11 = JSAMPARRAY input_buf\n; r12 = JSAMPIMAGE output_buf\n; r13 = JDIMENSION output_row\n; r14 = int num_rows\n\n%define wk(i)           rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          2\n\n        align   16\n\n        global  EXTN(jsimd_rgb_gray_convert_sse2)\n\nEXTN(jsimd_rgb_gray_convert_sse2):\n        push    rbp\n        mov     rax,rsp                         ; rax = original rbp\n        sub     rsp, byte 4\n        and     rsp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [rsp],rax\n        mov     rbp,rsp                         ; rbp = aligned rbp\n        lea     rsp, [wk(0)]\n        collect_args\n        push    rbx\n\n        mov     ecx, r10d\n        test    rcx,rcx\n        jz      near .return\n\n        push    rcx\n\n        mov rsi, r12\n        mov ecx, r13d\n        mov     rdi, JSAMPARRAY [rsi+0*SIZEOF_JSAMPARRAY]\n        lea     rdi, [rdi+rcx*SIZEOF_JSAMPROW]\n\n        pop     rcx\n\n        mov rsi, r11\n        mov     eax, r14d\n        test    rax,rax\n        jle     near .return\n.rowloop:\n        push    rdi\n        push    rsi\n        push    rcx                     ; col\n\n        mov     rsi, JSAMPROW [rsi]     ; inptr\n        mov     rdi, JSAMPROW [rdi]     ; outptr0\n\n        cmp     rcx, byte SIZEOF_XMMWORD\n        jae     near .columnloop\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n.column_ld1:\n        push    rax\n        push    rdx\n        lea     rcx,[rcx+rcx*2]         ; imul ecx,RGB_PIXELSIZE\n        test    cl, SIZEOF_BYTE\n        jz      short .column_ld2\n        sub     rcx, byte SIZEOF_BYTE\n        movzx   rax, BYTE [rsi+rcx]\n.column_ld2:\n        test    cl, SIZEOF_WORD\n        jz      short .column_ld4\n        sub     rcx, byte SIZEOF_WORD\n        movzx   rdx, WORD [rsi+rcx]\n        shl     rax, WORD_BIT\n        or      rax,rdx\n.column_ld4:\n        movd    xmmA,eax\n        pop     rdx\n        pop     rax\n        test    cl, SIZEOF_DWORD\n        jz      short .column_ld8\n        sub     rcx, byte SIZEOF_DWORD\n        movd    xmmF, XMM_DWORD [rsi+rcx]\n        pslldq  xmmA, SIZEOF_DWORD\n        por     xmmA,xmmF\n.column_ld8:\n        test    cl, SIZEOF_MMWORD\n        jz      short .column_ld16\n        sub     rcx, byte SIZEOF_MMWORD\n        movq    xmmB, XMM_MMWORD [rsi+rcx]\n        pslldq  xmmA, SIZEOF_MMWORD\n        por     xmmA,xmmB\n.column_ld16:\n        test    cl, SIZEOF_XMMWORD\n        jz      short .column_ld32\n        movdqa  xmmF,xmmA\n        movdqu  xmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        mov     rcx, SIZEOF_XMMWORD\n        jmp     short .rgb_gray_cnv\n.column_ld32:\n        test    cl, 2*SIZEOF_XMMWORD\n        mov     rcx, SIZEOF_XMMWORD\n        jz      short .rgb_gray_cnv\n        movdqa  xmmB,xmmA\n        movdqu  xmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        movdqu  xmmF, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n        jmp     short .rgb_gray_cnv\n\n.columnloop:\n        movdqu  xmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        movdqu  xmmF, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n        movdqu  xmmB, XMMWORD [rsi+2*SIZEOF_XMMWORD]\n\n.rgb_gray_cnv:\n        ; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n        ; xmmF=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n        ; xmmB=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n        movdqa    xmmG,xmmA\n        pslldq    xmmA,8        ; xmmA=(-- -- -- -- -- -- -- -- 00 10 20 01 11 21 02 12)\n        psrldq    xmmG,8        ; xmmG=(22 03 13 23 04 14 24 05 -- -- -- -- -- -- -- --)\n\n        punpckhbw xmmA,xmmF     ; xmmA=(00 08 10 18 20 28 01 09 11 19 21 29 02 0A 12 1A)\n        pslldq    xmmF,8        ; xmmF=(-- -- -- -- -- -- -- -- 15 25 06 16 26 07 17 27)\n\n        punpcklbw xmmG,xmmB     ; xmmG=(22 2A 03 0B 13 1B 23 2B 04 0C 14 1C 24 2C 05 0D)\n        punpckhbw xmmF,xmmB     ; xmmF=(15 1D 25 2D 06 0E 16 1E 26 2E 07 0F 17 1F 27 2F)\n\n        movdqa    xmmD,xmmA\n        pslldq    xmmA,8        ; xmmA=(-- -- -- -- -- -- -- -- 00 08 10 18 20 28 01 09)\n        psrldq    xmmD,8        ; xmmD=(11 19 21 29 02 0A 12 1A -- -- -- -- -- -- -- --)\n\n        punpckhbw xmmA,xmmG     ; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 01 05 09 0D)\n        pslldq    xmmG,8        ; xmmG=(-- -- -- -- -- -- -- -- 22 2A 03 0B 13 1B 23 2B)\n\n        punpcklbw xmmD,xmmF     ; xmmD=(11 15 19 1D 21 25 29 2D 02 06 0A 0E 12 16 1A 1E)\n        punpckhbw xmmG,xmmF     ; xmmG=(22 26 2A 2E 03 07 0B 0F 13 17 1B 1F 23 27 2B 2F)\n\n        movdqa    xmmE,xmmA\n        pslldq    xmmA,8        ; xmmA=(-- -- -- -- -- -- -- -- 00 04 08 0C 10 14 18 1C)\n        psrldq    xmmE,8        ; xmmE=(20 24 28 2C 01 05 09 0D -- -- -- -- -- -- -- --)\n\n        punpckhbw xmmA,xmmD     ; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n        pslldq    xmmD,8        ; xmmD=(-- -- -- -- -- -- -- -- 11 15 19 1D 21 25 29 2D)\n\n        punpcklbw xmmE,xmmG     ; xmmE=(20 22 24 26 28 2A 2C 2E 01 03 05 07 09 0B 0D 0F)\n        punpckhbw xmmD,xmmG     ; xmmD=(11 13 15 17 19 1B 1D 1F 21 23 25 27 29 2B 2D 2F)\n\n        pxor      xmmH,xmmH\n\n        movdqa    xmmC,xmmA\n        punpcklbw xmmA,xmmH     ; xmmA=(00 02 04 06 08 0A 0C 0E)\n        punpckhbw xmmC,xmmH     ; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n        movdqa    xmmB,xmmE\n        punpcklbw xmmE,xmmH     ; xmmE=(20 22 24 26 28 2A 2C 2E)\n        punpckhbw xmmB,xmmH     ; xmmB=(01 03 05 07 09 0B 0D 0F)\n\n        movdqa    xmmF,xmmD\n        punpcklbw xmmD,xmmH     ; xmmD=(11 13 15 17 19 1B 1D 1F)\n        punpckhbw xmmF,xmmH     ; xmmF=(21 23 25 27 29 2B 2D 2F)\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n.column_ld1:\n        test    cl, SIZEOF_XMMWORD/16\n        jz      short .column_ld2\n        sub     rcx, byte SIZEOF_XMMWORD/16\n        movd    xmmA, XMM_DWORD [rsi+rcx*RGB_PIXELSIZE]\n.column_ld2:\n        test    cl, SIZEOF_XMMWORD/8\n        jz      short .column_ld4\n        sub     rcx, byte SIZEOF_XMMWORD/8\n        movq    xmmE, XMM_MMWORD [rsi+rcx*RGB_PIXELSIZE]\n        pslldq  xmmA, SIZEOF_MMWORD\n        por     xmmA,xmmE\n.column_ld4:\n        test    cl, SIZEOF_XMMWORD/4\n        jz      short .column_ld8\n        sub     rcx, byte SIZEOF_XMMWORD/4\n        movdqa  xmmE,xmmA\n        movdqu  xmmA, XMMWORD [rsi+rcx*RGB_PIXELSIZE]\n.column_ld8:\n        test    cl, SIZEOF_XMMWORD/2\n        mov     rcx, SIZEOF_XMMWORD\n        jz      short .rgb_gray_cnv\n        movdqa  xmmF,xmmA\n        movdqa  xmmH,xmmE\n        movdqu  xmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        movdqu  xmmE, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n        jmp     short .rgb_gray_cnv\n\n.columnloop:\n        movdqu  xmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        movdqu  xmmE, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n        movdqu  xmmF, XMMWORD [rsi+2*SIZEOF_XMMWORD]\n        movdqu  xmmH, XMMWORD [rsi+3*SIZEOF_XMMWORD]\n\n.rgb_gray_cnv:\n        ; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n        ; xmmE=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n        ; xmmF=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n        ; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n        movdqa    xmmD,xmmA\n        punpcklbw xmmA,xmmE     ; xmmA=(00 04 10 14 20 24 30 34 01 05 11 15 21 25 31 35)\n        punpckhbw xmmD,xmmE     ; xmmD=(02 06 12 16 22 26 32 36 03 07 13 17 23 27 33 37)\n\n        movdqa    xmmC,xmmF\n        punpcklbw xmmF,xmmH     ; xmmF=(08 0C 18 1C 28 2C 38 3C 09 0D 19 1D 29 2D 39 3D)\n        punpckhbw xmmC,xmmH     ; xmmC=(0A 0E 1A 1E 2A 2E 3A 3E 0B 0F 1B 1F 2B 2F 3B 3F)\n\n        movdqa    xmmB,xmmA\n        punpcklwd xmmA,xmmF     ; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 30 34 38 3C)\n        punpckhwd xmmB,xmmF     ; xmmB=(01 05 09 0D 11 15 19 1D 21 25 29 2D 31 35 39 3D)\n\n        movdqa    xmmG,xmmD\n        punpcklwd xmmD,xmmC     ; xmmD=(02 06 0A 0E 12 16 1A 1E 22 26 2A 2E 32 36 3A 3E)\n        punpckhwd xmmG,xmmC     ; xmmG=(03 07 0B 0F 13 17 1B 1F 23 27 2B 2F 33 37 3B 3F)\n\n        movdqa    xmmE,xmmA\n        punpcklbw xmmA,xmmD     ; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n        punpckhbw xmmE,xmmD     ; xmmE=(20 22 24 26 28 2A 2C 2E 30 32 34 36 38 3A 3C 3E)\n\n        movdqa    xmmH,xmmB\n        punpcklbw xmmB,xmmG     ; xmmB=(01 03 05 07 09 0B 0D 0F 11 13 15 17 19 1B 1D 1F)\n        punpckhbw xmmH,xmmG     ; xmmH=(21 23 25 27 29 2B 2D 2F 31 33 35 37 39 3B 3D 3F)\n\n        pxor      xmmF,xmmF\n\n        movdqa    xmmC,xmmA\n        punpcklbw xmmA,xmmF     ; xmmA=(00 02 04 06 08 0A 0C 0E)\n        punpckhbw xmmC,xmmF     ; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n        movdqa    xmmD,xmmB\n        punpcklbw xmmB,xmmF     ; xmmB=(01 03 05 07 09 0B 0D 0F)\n        punpckhbw xmmD,xmmF     ; xmmD=(11 13 15 17 19 1B 1D 1F)\n\n        movdqa    xmmG,xmmE\n        punpcklbw xmmE,xmmF     ; xmmE=(20 22 24 26 28 2A 2C 2E)\n        punpckhbw xmmG,xmmF     ; xmmG=(30 32 34 36 38 3A 3C 3E)\n\n        punpcklbw xmmF,xmmH\n        punpckhbw xmmH,xmmH\n        psrlw     xmmF,BYTE_BIT ; xmmF=(21 23 25 27 29 2B 2D 2F)\n        psrlw     xmmH,BYTE_BIT ; xmmH=(31 33 35 37 39 3B 3D 3F)\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n        ; xmm0=R(02468ACE)=RE, xmm2=G(02468ACE)=GE, xmm4=B(02468ACE)=BE\n        ; xmm1=R(13579BDF)=RO, xmm3=G(13579BDF)=GO, xmm5=B(13579BDF)=BO\n\n        ; (Original)\n        ; Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n        ;\n        ; (This implementation)\n        ; Y  =  0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G\n\n        movdqa    xmm6,xmm1\n        punpcklwd xmm1,xmm3\n        punpckhwd xmm6,xmm3\n        pmaddwd   xmm1,[rel PW_F0299_F0337] ; xmm1=ROL*FIX(0.299)+GOL*FIX(0.337)\n        pmaddwd   xmm6,[rel PW_F0299_F0337] ; xmm6=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n        movdqa    xmm7, xmm6    ; xmm7=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n        movdqa    xmm6,xmm0\n        punpcklwd xmm0,xmm2\n        punpckhwd xmm6,xmm2\n        pmaddwd   xmm0,[rel PW_F0299_F0337] ; xmm0=REL*FIX(0.299)+GEL*FIX(0.337)\n        pmaddwd   xmm6,[rel PW_F0299_F0337] ; xmm6=REH*FIX(0.299)+GEH*FIX(0.337)\n\n        movdqa    XMMWORD [wk(0)], xmm0 ; wk(0)=REL*FIX(0.299)+GEL*FIX(0.337)\n        movdqa    XMMWORD [wk(1)], xmm6 ; wk(1)=REH*FIX(0.299)+GEH*FIX(0.337)\n\n        movdqa    xmm0, xmm5    ; xmm0=BO\n        movdqa    xmm6, xmm4    ; xmm6=BE\n\n        movdqa    xmm4,xmm0\n        punpcklwd xmm0,xmm3\n        punpckhwd xmm4,xmm3\n        pmaddwd   xmm0,[rel PW_F0114_F0250] ; xmm0=BOL*FIX(0.114)+GOL*FIX(0.250)\n        pmaddwd   xmm4,[rel PW_F0114_F0250] ; xmm4=BOH*FIX(0.114)+GOH*FIX(0.250)\n\n        movdqa    xmm3,[rel PD_ONEHALF] ; xmm3=[PD_ONEHALF]\n\n        paddd     xmm0, xmm1\n        paddd     xmm4, xmm7\n        paddd     xmm0,xmm3\n        paddd     xmm4,xmm3\n        psrld     xmm0,SCALEBITS        ; xmm0=YOL\n        psrld     xmm4,SCALEBITS        ; xmm4=YOH\n        packssdw  xmm0,xmm4             ; xmm0=YO\n\n        movdqa    xmm4,xmm6\n        punpcklwd xmm6,xmm2\n        punpckhwd xmm4,xmm2\n        pmaddwd   xmm6,[rel PW_F0114_F0250] ; xmm6=BEL*FIX(0.114)+GEL*FIX(0.250)\n        pmaddwd   xmm4,[rel PW_F0114_F0250] ; xmm4=BEH*FIX(0.114)+GEH*FIX(0.250)\n\n        movdqa    xmm2,[rel PD_ONEHALF] ; xmm2=[PD_ONEHALF]\n\n        paddd     xmm6, XMMWORD [wk(0)]\n        paddd     xmm4, XMMWORD [wk(1)]\n        paddd     xmm6,xmm2\n        paddd     xmm4,xmm2\n        psrld     xmm6,SCALEBITS        ; xmm6=YEL\n        psrld     xmm4,SCALEBITS        ; xmm4=YEH\n        packssdw  xmm6,xmm4             ; xmm6=YE\n\n        psllw     xmm0,BYTE_BIT\n        por       xmm6,xmm0             ; xmm6=Y\n        movdqa    XMMWORD [rdi], xmm6   ; Save Y\n\n        sub     rcx, byte SIZEOF_XMMWORD\n        add     rsi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD  ; inptr\n        add     rdi, byte SIZEOF_XMMWORD                ; outptr0\n        cmp     rcx, byte SIZEOF_XMMWORD\n        jae     near .columnloop\n        test    rcx,rcx\n        jnz     near .column_ld1\n\n        pop     rcx                     ; col\n        pop     rsi\n        pop     rdi\n\n        add     rsi, byte SIZEOF_JSAMPROW       ; input_buf\n        add     rdi, byte SIZEOF_JSAMPROW\n        dec     rax                             ; num_rows\n        jg      near .rowloop\n\n.return:\n        pop     rbx\n        uncollect_args\n        mov     rsp,rbp         ; rsp <- aligned rbp\n        pop     rsp             ; rsp <- original rbp\n        pop     rbp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jcgryext-sse2.asm",
    "content": ";\n; jcgryext.asm - grayscale colorspace conversion (SSE2)\n;\n; Copyright (C) 2011, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_rgb_gray_convert_sse2 (JDIMENSION img_width,\n;                              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n;                              JDIMENSION output_row, int num_rows);\n;\n\n%define img_width(b)    (b)+8           ; JDIMENSION img_width\n%define input_buf(b)    (b)+12          ; JSAMPARRAY input_buf\n%define output_buf(b)   (b)+16          ; JSAMPIMAGE output_buf\n%define output_row(b)   (b)+20          ; JDIMENSION output_row\n%define num_rows(b)     (b)+24          ; int num_rows\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          2\n%define gotptr          wk(0)-SIZEOF_POINTER    ; void * gotptr\n\n        align   16\n\n        global  EXTN(jsimd_rgb_gray_convert_sse2)\n\nEXTN(jsimd_rgb_gray_convert_sse2):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic eax             ; make a room for GOT address\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx                     ; get GOT address\n        movpic  POINTER [gotptr], ebx   ; save GOT address\n\n        mov     ecx, JDIMENSION [img_width(eax)]\n        test    ecx,ecx\n        jz      near .return\n\n        push    ecx\n\n        mov     esi, JSAMPIMAGE [output_buf(eax)]\n        mov     ecx, JDIMENSION [output_row(eax)]\n        mov     edi, JSAMPARRAY [esi+0*SIZEOF_JSAMPARRAY]\n        lea     edi, [edi+ecx*SIZEOF_JSAMPROW]\n\n        pop     ecx\n\n        mov     esi, JSAMPARRAY [input_buf(eax)]\n        mov     eax, INT [num_rows(eax)]\n        test    eax,eax\n        jle     near .return\n        alignx  16,7\n.rowloop:\n        pushpic eax\n        push    edi\n        push    esi\n        push    ecx                     ; col\n\n        mov     esi, JSAMPROW [esi]     ; inptr\n        mov     edi, JSAMPROW [edi]     ; outptr0\n        movpic  eax, POINTER [gotptr]   ; load GOT address (eax)\n\n        cmp     ecx, byte SIZEOF_XMMWORD\n        jae     near .columnloop\n        alignx  16,7\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n.column_ld1:\n        push    eax\n        push    edx\n        lea     ecx,[ecx+ecx*2]         ; imul ecx,RGB_PIXELSIZE\n        test    cl, SIZEOF_BYTE\n        jz      short .column_ld2\n        sub     ecx, byte SIZEOF_BYTE\n        movzx   eax, BYTE [esi+ecx]\n.column_ld2:\n        test    cl, SIZEOF_WORD\n        jz      short .column_ld4\n        sub     ecx, byte SIZEOF_WORD\n        movzx   edx, WORD [esi+ecx]\n        shl     eax, WORD_BIT\n        or      eax,edx\n.column_ld4:\n        movd    xmmA,eax\n        pop     edx\n        pop     eax\n        test    cl, SIZEOF_DWORD\n        jz      short .column_ld8\n        sub     ecx, byte SIZEOF_DWORD\n        movd    xmmF, XMM_DWORD [esi+ecx]\n        pslldq  xmmA, SIZEOF_DWORD\n        por     xmmA,xmmF\n.column_ld8:\n        test    cl, SIZEOF_MMWORD\n        jz      short .column_ld16\n        sub     ecx, byte SIZEOF_MMWORD\n        movq    xmmB, XMM_MMWORD [esi+ecx]\n        pslldq  xmmA, SIZEOF_MMWORD\n        por     xmmA,xmmB\n.column_ld16:\n        test    cl, SIZEOF_XMMWORD\n        jz      short .column_ld32\n        movdqa  xmmF,xmmA\n        movdqu  xmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        mov     ecx, SIZEOF_XMMWORD\n        jmp     short .rgb_gray_cnv\n.column_ld32:\n        test    cl, 2*SIZEOF_XMMWORD\n        mov     ecx, SIZEOF_XMMWORD\n        jz      short .rgb_gray_cnv\n        movdqa  xmmB,xmmA\n        movdqu  xmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        movdqu  xmmF, XMMWORD [esi+1*SIZEOF_XMMWORD]\n        jmp     short .rgb_gray_cnv\n        alignx  16,7\n\n.columnloop:\n        movdqu  xmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        movdqu  xmmF, XMMWORD [esi+1*SIZEOF_XMMWORD]\n        movdqu  xmmB, XMMWORD [esi+2*SIZEOF_XMMWORD]\n\n.rgb_gray_cnv:\n        ; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n        ; xmmF=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n        ; xmmB=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n        movdqa    xmmG,xmmA\n        pslldq    xmmA,8        ; xmmA=(-- -- -- -- -- -- -- -- 00 10 20 01 11 21 02 12)\n        psrldq    xmmG,8        ; xmmG=(22 03 13 23 04 14 24 05 -- -- -- -- -- -- -- --)\n\n        punpckhbw xmmA,xmmF     ; xmmA=(00 08 10 18 20 28 01 09 11 19 21 29 02 0A 12 1A)\n        pslldq    xmmF,8        ; xmmF=(-- -- -- -- -- -- -- -- 15 25 06 16 26 07 17 27)\n\n        punpcklbw xmmG,xmmB     ; xmmG=(22 2A 03 0B 13 1B 23 2B 04 0C 14 1C 24 2C 05 0D)\n        punpckhbw xmmF,xmmB     ; xmmF=(15 1D 25 2D 06 0E 16 1E 26 2E 07 0F 17 1F 27 2F)\n\n        movdqa    xmmD,xmmA\n        pslldq    xmmA,8        ; xmmA=(-- -- -- -- -- -- -- -- 00 08 10 18 20 28 01 09)\n        psrldq    xmmD,8        ; xmmD=(11 19 21 29 02 0A 12 1A -- -- -- -- -- -- -- --)\n\n        punpckhbw xmmA,xmmG     ; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 01 05 09 0D)\n        pslldq    xmmG,8        ; xmmG=(-- -- -- -- -- -- -- -- 22 2A 03 0B 13 1B 23 2B)\n\n        punpcklbw xmmD,xmmF     ; xmmD=(11 15 19 1D 21 25 29 2D 02 06 0A 0E 12 16 1A 1E)\n        punpckhbw xmmG,xmmF     ; xmmG=(22 26 2A 2E 03 07 0B 0F 13 17 1B 1F 23 27 2B 2F)\n\n        movdqa    xmmE,xmmA\n        pslldq    xmmA,8        ; xmmA=(-- -- -- -- -- -- -- -- 00 04 08 0C 10 14 18 1C)\n        psrldq    xmmE,8        ; xmmE=(20 24 28 2C 01 05 09 0D -- -- -- -- -- -- -- --)\n\n        punpckhbw xmmA,xmmD     ; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n        pslldq    xmmD,8        ; xmmD=(-- -- -- -- -- -- -- -- 11 15 19 1D 21 25 29 2D)\n\n        punpcklbw xmmE,xmmG     ; xmmE=(20 22 24 26 28 2A 2C 2E 01 03 05 07 09 0B 0D 0F)\n        punpckhbw xmmD,xmmG     ; xmmD=(11 13 15 17 19 1B 1D 1F 21 23 25 27 29 2B 2D 2F)\n\n        pxor      xmmH,xmmH\n\n        movdqa    xmmC,xmmA\n        punpcklbw xmmA,xmmH     ; xmmA=(00 02 04 06 08 0A 0C 0E)\n        punpckhbw xmmC,xmmH     ; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n        movdqa    xmmB,xmmE\n        punpcklbw xmmE,xmmH     ; xmmE=(20 22 24 26 28 2A 2C 2E)\n        punpckhbw xmmB,xmmH     ; xmmB=(01 03 05 07 09 0B 0D 0F)\n\n        movdqa    xmmF,xmmD\n        punpcklbw xmmD,xmmH     ; xmmD=(11 13 15 17 19 1B 1D 1F)\n        punpckhbw xmmF,xmmH     ; xmmF=(21 23 25 27 29 2B 2D 2F)\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n.column_ld1:\n        test    cl, SIZEOF_XMMWORD/16\n        jz      short .column_ld2\n        sub     ecx, byte SIZEOF_XMMWORD/16\n        movd    xmmA, XMM_DWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld2:\n        test    cl, SIZEOF_XMMWORD/8\n        jz      short .column_ld4\n        sub     ecx, byte SIZEOF_XMMWORD/8\n        movq    xmmE, XMM_MMWORD [esi+ecx*RGB_PIXELSIZE]\n        pslldq  xmmA, SIZEOF_MMWORD\n        por     xmmA,xmmE\n.column_ld4:\n        test    cl, SIZEOF_XMMWORD/4\n        jz      short .column_ld8\n        sub     ecx, byte SIZEOF_XMMWORD/4\n        movdqa  xmmE,xmmA\n        movdqu  xmmA, XMMWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld8:\n        test    cl, SIZEOF_XMMWORD/2\n        mov     ecx, SIZEOF_XMMWORD\n        jz      short .rgb_gray_cnv\n        movdqa  xmmF,xmmA\n        movdqa  xmmH,xmmE\n        movdqu  xmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        movdqu  xmmE, XMMWORD [esi+1*SIZEOF_XMMWORD]\n        jmp     short .rgb_gray_cnv\n        alignx  16,7\n\n.columnloop:\n        movdqu  xmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        movdqu  xmmE, XMMWORD [esi+1*SIZEOF_XMMWORD]\n        movdqu  xmmF, XMMWORD [esi+2*SIZEOF_XMMWORD]\n        movdqu  xmmH, XMMWORD [esi+3*SIZEOF_XMMWORD]\n\n.rgb_gray_cnv:\n        ; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n        ; xmmE=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n        ; xmmF=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n        ; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n        movdqa    xmmD,xmmA\n        punpcklbw xmmA,xmmE     ; xmmA=(00 04 10 14 20 24 30 34 01 05 11 15 21 25 31 35)\n        punpckhbw xmmD,xmmE     ; xmmD=(02 06 12 16 22 26 32 36 03 07 13 17 23 27 33 37)\n\n        movdqa    xmmC,xmmF\n        punpcklbw xmmF,xmmH     ; xmmF=(08 0C 18 1C 28 2C 38 3C 09 0D 19 1D 29 2D 39 3D)\n        punpckhbw xmmC,xmmH     ; xmmC=(0A 0E 1A 1E 2A 2E 3A 3E 0B 0F 1B 1F 2B 2F 3B 3F)\n\n        movdqa    xmmB,xmmA\n        punpcklwd xmmA,xmmF     ; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 30 34 38 3C)\n        punpckhwd xmmB,xmmF     ; xmmB=(01 05 09 0D 11 15 19 1D 21 25 29 2D 31 35 39 3D)\n\n        movdqa    xmmG,xmmD\n        punpcklwd xmmD,xmmC     ; xmmD=(02 06 0A 0E 12 16 1A 1E 22 26 2A 2E 32 36 3A 3E)\n        punpckhwd xmmG,xmmC     ; xmmG=(03 07 0B 0F 13 17 1B 1F 23 27 2B 2F 33 37 3B 3F)\n\n        movdqa    xmmE,xmmA\n        punpcklbw xmmA,xmmD     ; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n        punpckhbw xmmE,xmmD     ; xmmE=(20 22 24 26 28 2A 2C 2E 30 32 34 36 38 3A 3C 3E)\n\n        movdqa    xmmH,xmmB\n        punpcklbw xmmB,xmmG     ; xmmB=(01 03 05 07 09 0B 0D 0F 11 13 15 17 19 1B 1D 1F)\n        punpckhbw xmmH,xmmG     ; xmmH=(21 23 25 27 29 2B 2D 2F 31 33 35 37 39 3B 3D 3F)\n\n        pxor      xmmF,xmmF\n\n        movdqa    xmmC,xmmA\n        punpcklbw xmmA,xmmF     ; xmmA=(00 02 04 06 08 0A 0C 0E)\n        punpckhbw xmmC,xmmF     ; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n        movdqa    xmmD,xmmB\n        punpcklbw xmmB,xmmF     ; xmmB=(01 03 05 07 09 0B 0D 0F)\n        punpckhbw xmmD,xmmF     ; xmmD=(11 13 15 17 19 1B 1D 1F)\n\n        movdqa    xmmG,xmmE\n        punpcklbw xmmE,xmmF     ; xmmE=(20 22 24 26 28 2A 2C 2E)\n        punpckhbw xmmG,xmmF     ; xmmG=(30 32 34 36 38 3A 3C 3E)\n\n        punpcklbw xmmF,xmmH\n        punpckhbw xmmH,xmmH\n        psrlw     xmmF,BYTE_BIT ; xmmF=(21 23 25 27 29 2B 2D 2F)\n        psrlw     xmmH,BYTE_BIT ; xmmH=(31 33 35 37 39 3B 3D 3F)\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n        ; xmm0=R(02468ACE)=RE, xmm2=G(02468ACE)=GE, xmm4=B(02468ACE)=BE\n        ; xmm1=R(13579BDF)=RO, xmm3=G(13579BDF)=GO, xmm5=B(13579BDF)=BO\n\n        ; (Original)\n        ; Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n        ;\n        ; (This implementation)\n        ; Y  =  0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G\n\n        movdqa    xmm6,xmm1\n        punpcklwd xmm1,xmm3\n        punpckhwd xmm6,xmm3\n        pmaddwd   xmm1,[GOTOFF(eax,PW_F0299_F0337)] ; xmm1=ROL*FIX(0.299)+GOL*FIX(0.337)\n        pmaddwd   xmm6,[GOTOFF(eax,PW_F0299_F0337)] ; xmm6=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n        movdqa    xmm7, xmm6    ; xmm7=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n        movdqa    xmm6,xmm0\n        punpcklwd xmm0,xmm2\n        punpckhwd xmm6,xmm2\n        pmaddwd   xmm0,[GOTOFF(eax,PW_F0299_F0337)] ; xmm0=REL*FIX(0.299)+GEL*FIX(0.337)\n        pmaddwd   xmm6,[GOTOFF(eax,PW_F0299_F0337)] ; xmm6=REH*FIX(0.299)+GEH*FIX(0.337)\n\n        movdqa    XMMWORD [wk(0)], xmm0 ; wk(0)=REL*FIX(0.299)+GEL*FIX(0.337)\n        movdqa    XMMWORD [wk(1)], xmm6 ; wk(1)=REH*FIX(0.299)+GEH*FIX(0.337)\n\n        movdqa    xmm0, xmm5    ; xmm0=BO\n        movdqa    xmm6, xmm4    ; xmm6=BE\n\n        movdqa    xmm4,xmm0\n        punpcklwd xmm0,xmm3\n        punpckhwd xmm4,xmm3\n        pmaddwd   xmm0,[GOTOFF(eax,PW_F0114_F0250)] ; xmm0=BOL*FIX(0.114)+GOL*FIX(0.250)\n        pmaddwd   xmm4,[GOTOFF(eax,PW_F0114_F0250)] ; xmm4=BOH*FIX(0.114)+GOH*FIX(0.250)\n\n        movdqa    xmm3,[GOTOFF(eax,PD_ONEHALF)] ; xmm3=[PD_ONEHALF]\n\n        paddd     xmm0, xmm1\n        paddd     xmm4, xmm7\n        paddd     xmm0,xmm3\n        paddd     xmm4,xmm3\n        psrld     xmm0,SCALEBITS        ; xmm0=YOL\n        psrld     xmm4,SCALEBITS        ; xmm4=YOH\n        packssdw  xmm0,xmm4             ; xmm0=YO\n\n        movdqa    xmm4,xmm6\n        punpcklwd xmm6,xmm2\n        punpckhwd xmm4,xmm2\n        pmaddwd   xmm6,[GOTOFF(eax,PW_F0114_F0250)] ; xmm6=BEL*FIX(0.114)+GEL*FIX(0.250)\n        pmaddwd   xmm4,[GOTOFF(eax,PW_F0114_F0250)] ; xmm4=BEH*FIX(0.114)+GEH*FIX(0.250)\n\n        movdqa    xmm2,[GOTOFF(eax,PD_ONEHALF)] ; xmm2=[PD_ONEHALF]\n\n        paddd     xmm6, XMMWORD [wk(0)]\n        paddd     xmm4, XMMWORD [wk(1)]\n        paddd     xmm6,xmm2\n        paddd     xmm4,xmm2\n        psrld     xmm6,SCALEBITS        ; xmm6=YEL\n        psrld     xmm4,SCALEBITS        ; xmm4=YEH\n        packssdw  xmm6,xmm4             ; xmm6=YE\n\n        psllw     xmm0,BYTE_BIT\n        por       xmm6,xmm0             ; xmm6=Y\n        movdqa    XMMWORD [edi], xmm6   ; Save Y\n\n        sub     ecx, byte SIZEOF_XMMWORD\n        add     esi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD  ; inptr\n        add     edi, byte SIZEOF_XMMWORD                ; outptr0\n        cmp     ecx, byte SIZEOF_XMMWORD\n        jae     near .columnloop\n        test    ecx,ecx\n        jnz     near .column_ld1\n\n        pop     ecx                     ; col\n        pop     esi\n        pop     edi\n        poppic  eax\n\n        add     esi, byte SIZEOF_JSAMPROW       ; input_buf\n        add     edi, byte SIZEOF_JSAMPROW\n        dec     eax                             ; num_rows\n        jg      near .rowloop\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jchuff-sse2-64.asm",
    "content": ";\n; jchuff-sse2-64.asm - Huffman entropy encoding (64-bit SSE2)\n;\n; Copyright (C) 2009-2011, 2014-2016, D. R. Commander.\n; Copyright (C) 2015, Matthieu Darbois.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains an SSE2 implementation for Huffman coding of one block.\n; The following code is based directly on jchuff.c; see jchuff.c for more\n; details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_huff_encode_one_block)\n\nEXTN(jconst_huff_encode_one_block):\n\n%include \"jpeg_nbits_table.inc\"\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n\n; These macros perform the same task as the emit_bits() function in the\n; original libjpeg code.  In addition to reducing overhead by explicitly\n; inlining the code, additional performance is achieved by taking into\n; account the size of the bit buffer and waiting until it is almost full\n; before emptying it.  This mostly benefits 64-bit platforms, since 6\n; bytes can be stored in a 64-bit bit buffer before it has to be emptied.\n\n%macro EMIT_BYTE 0\n        sub put_bits, 8  ; put_bits -= 8;\n        mov rdx, put_buffer\n        mov ecx, put_bits\n        shr rdx, cl  ; c = (JOCTET)GETJOCTET(put_buffer >> put_bits);\n        mov byte [buffer], dl  ; *buffer++ = c;\n        add buffer, 1\n        cmp dl, 0xFF  ; need to stuff a zero byte?\n        jne %%.EMIT_BYTE_END\n        mov byte [buffer], 0  ; *buffer++ = 0;\n        add buffer, 1\n%%.EMIT_BYTE_END:\n%endmacro\n\n%macro PUT_BITS 1\n        add put_bits, ecx  ; put_bits += size;\n        shl put_buffer, cl  ; put_buffer = (put_buffer << size);\n        or  put_buffer, %1\n%endmacro\n\n%macro CHECKBUF31 0\n        cmp put_bits, 32  ; if (put_bits > 31) {\n        jl %%.CHECKBUF31_END\n        EMIT_BYTE\n        EMIT_BYTE\n        EMIT_BYTE\n        EMIT_BYTE\n%%.CHECKBUF31_END:\n%endmacro\n\n%macro CHECKBUF47 0\n        cmp put_bits, 48  ; if (put_bits > 47) {\n        jl %%.CHECKBUF47_END\n        EMIT_BYTE\n        EMIT_BYTE\n        EMIT_BYTE\n        EMIT_BYTE\n        EMIT_BYTE\n        EMIT_BYTE\n%%.CHECKBUF47_END:\n%endmacro\n\n%macro EMIT_BITS 2\n        CHECKBUF47\n        mov ecx, %2\n        PUT_BITS %1\n%endmacro\n\n%macro kloop_prepare 37  ;(ko, jno0, ..., jno31, xmm0, xmm1, xmm2, xmm3)\n    pxor xmm8, xmm8  ; __m128i neg = _mm_setzero_si128();\n    pxor xmm9, xmm9  ; __m128i neg = _mm_setzero_si128();\n    pxor xmm10, xmm10  ; __m128i neg = _mm_setzero_si128();\n    pxor xmm11, xmm11  ; __m128i neg = _mm_setzero_si128();\n    pinsrw %34, word [r12 + %2  * SIZEOF_WORD], 0  ; xmm_shadow[0] = block[jno0];\n    pinsrw %35, word [r12 + %10 * SIZEOF_WORD], 0  ; xmm_shadow[8] = block[jno8];\n    pinsrw %36, word [r12 + %18 * SIZEOF_WORD], 0  ; xmm_shadow[16] = block[jno16];\n    pinsrw %37, word [r12 + %26 * SIZEOF_WORD], 0  ; xmm_shadow[24] = block[jno24];\n    pinsrw %34, word [r12 + %3  * SIZEOF_WORD], 1  ; xmm_shadow[1] = block[jno1];\n    pinsrw %35, word [r12 + %11 * SIZEOF_WORD], 1  ; xmm_shadow[9] = block[jno9];\n    pinsrw %36, word [r12 + %19 * SIZEOF_WORD], 1  ; xmm_shadow[17] = block[jno17];\n    pinsrw %37, word [r12 + %27 * SIZEOF_WORD], 1  ; xmm_shadow[25] = block[jno25];\n    pinsrw %34, word [r12 + %4  * SIZEOF_WORD], 2  ; xmm_shadow[2] = block[jno2];\n    pinsrw %35, word [r12 + %12 * SIZEOF_WORD], 2  ; xmm_shadow[10] = block[jno10];\n    pinsrw %36, word [r12 + %20 * SIZEOF_WORD], 2  ; xmm_shadow[18] = block[jno18];\n    pinsrw %37, word [r12 + %28 * SIZEOF_WORD], 2  ; xmm_shadow[26] = block[jno26];\n    pinsrw %34, word [r12 + %5  * SIZEOF_WORD], 3  ; xmm_shadow[3] = block[jno3];\n    pinsrw %35, word [r12 + %13 * SIZEOF_WORD], 3  ; xmm_shadow[11] = block[jno11];\n    pinsrw %36, word [r12 + %21 * SIZEOF_WORD], 3  ; xmm_shadow[19] = block[jno19];\n    pinsrw %37, word [r12 + %29 * SIZEOF_WORD], 3  ; xmm_shadow[27] = block[jno27];\n    pinsrw %34, word [r12 + %6  * SIZEOF_WORD], 4  ; xmm_shadow[4] = block[jno4];\n    pinsrw %35, word [r12 + %14 * SIZEOF_WORD], 4  ; xmm_shadow[12] = block[jno12];\n    pinsrw %36, word [r12 + %22 * SIZEOF_WORD], 4  ; xmm_shadow[20] = block[jno20];\n    pinsrw %37, word [r12 + %30 * SIZEOF_WORD], 4  ; xmm_shadow[28] = block[jno28];\n    pinsrw %34, word [r12 + %7  * SIZEOF_WORD], 5  ; xmm_shadow[5] = block[jno5];\n    pinsrw %35, word [r12 + %15 * SIZEOF_WORD], 5  ; xmm_shadow[13] = block[jno13];\n    pinsrw %36, word [r12 + %23 * SIZEOF_WORD], 5  ; xmm_shadow[21] = block[jno21];\n    pinsrw %37, word [r12 + %31 * SIZEOF_WORD], 5  ; xmm_shadow[29] = block[jno29];\n    pinsrw %34, word [r12 + %8  * SIZEOF_WORD], 6  ; xmm_shadow[6] = block[jno6];\n    pinsrw %35, word [r12 + %16 * SIZEOF_WORD], 6  ; xmm_shadow[14] = block[jno14];\n    pinsrw %36, word [r12 + %24 * SIZEOF_WORD], 6  ; xmm_shadow[22] = block[jno22];\n    pinsrw %37, word [r12 + %32 * SIZEOF_WORD], 6  ; xmm_shadow[30] = block[jno30];\n    pinsrw %34, word [r12 + %9  * SIZEOF_WORD], 7  ; xmm_shadow[7] = block[jno7];\n    pinsrw %35, word [r12 + %17 * SIZEOF_WORD], 7  ; xmm_shadow[15] = block[jno15];\n    pinsrw %36, word [r12 + %25 * SIZEOF_WORD], 7  ; xmm_shadow[23] = block[jno23];\n%if %1 != 32\n    pinsrw %37, word [r12 + %33 * SIZEOF_WORD], 7  ; xmm_shadow[31] = block[jno31];\n%else\n    pinsrw %37, ebx, 7  ; xmm_shadow[31] = block[jno31];\n%endif\n    pcmpgtw xmm8, %34  ; neg = _mm_cmpgt_epi16(neg, x1);\n    pcmpgtw xmm9, %35  ; neg = _mm_cmpgt_epi16(neg, x1);\n    pcmpgtw xmm10, %36  ; neg = _mm_cmpgt_epi16(neg, x1);\n    pcmpgtw xmm11, %37  ; neg = _mm_cmpgt_epi16(neg, x1);\n    paddw %34, xmm8   ; x1 = _mm_add_epi16(x1, neg);\n    paddw %35, xmm9   ; x1 = _mm_add_epi16(x1, neg);\n    paddw %36, xmm10  ; x1 = _mm_add_epi16(x1, neg);\n    paddw %37, xmm11  ; x1 = _mm_add_epi16(x1, neg);\n    pxor %34, xmm8    ; x1 = _mm_xor_si128(x1, neg);\n    pxor %35, xmm9    ; x1 = _mm_xor_si128(x1, neg);\n    pxor %36, xmm10   ; x1 = _mm_xor_si128(x1, neg);\n    pxor %37, xmm11   ; x1 = _mm_xor_si128(x1, neg);\n    pxor xmm8, %34    ; neg = _mm_xor_si128(neg, x1);\n    pxor xmm9, %35    ; neg = _mm_xor_si128(neg, x1);\n    pxor xmm10, %36   ; neg = _mm_xor_si128(neg, x1);\n    pxor xmm11, %37   ; neg = _mm_xor_si128(neg, x1);\n    movdqa XMMWORD [t1 + %1 * SIZEOF_WORD], %34  ; _mm_storeu_si128((__m128i *)(t1 + ko), x1);\n    movdqa XMMWORD [t1 + (%1 + 8) * SIZEOF_WORD], %35  ; _mm_storeu_si128((__m128i *)(t1 + ko + 8), x1);\n    movdqa XMMWORD [t1 + (%1 + 16) * SIZEOF_WORD], %36  ; _mm_storeu_si128((__m128i *)(t1 + ko + 16), x1);\n    movdqa XMMWORD [t1 + (%1 + 24) * SIZEOF_WORD], %37  ; _mm_storeu_si128((__m128i *)(t1 + ko + 24), x1);\n    movdqa XMMWORD [t2 + %1 * SIZEOF_WORD], xmm8  ; _mm_storeu_si128((__m128i *)(t2 + ko), neg);\n    movdqa XMMWORD [t2 + (%1 + 8) * SIZEOF_WORD], xmm9  ; _mm_storeu_si128((__m128i *)(t2 + ko + 8), neg);\n    movdqa XMMWORD [t2 + (%1 + 16) * SIZEOF_WORD], xmm10  ; _mm_storeu_si128((__m128i *)(t2 + ko + 16), neg);\n    movdqa XMMWORD [t2 + (%1 + 24) * SIZEOF_WORD], xmm11  ; _mm_storeu_si128((__m128i *)(t2 + ko + 24), neg);\n%endmacro\n\n;\n; Encode a single block's worth of coefficients.\n;\n; GLOBAL(JOCTET*)\n; jsimd_huff_encode_one_block_sse2 (working_state *state, JOCTET *buffer,\n;                                   JCOEFPTR block, int last_dc_val,\n;                                   c_derived_tbl *dctbl, c_derived_tbl *actbl)\n;\n\n; r10 = working_state *state\n; r11 = JOCTET *buffer\n; r12 = JCOEFPTR block\n; r13 = int last_dc_val\n; r14 = c_derived_tbl *dctbl\n; r15 = c_derived_tbl *actbl\n\n%define t1              rbp-(DCTSIZE2*SIZEOF_WORD)\n%define t2              t1-(DCTSIZE2*SIZEOF_WORD)\n%define put_buffer      r8\n%define put_bits        r9d\n%define buffer          rax\n\n        align   16\n        global  EXTN(jsimd_huff_encode_one_block_sse2)\n\nEXTN(jsimd_huff_encode_one_block_sse2):\n        push    rbp\n        mov     rax,rsp                         ; rax = original rbp\n        sub     rsp, byte 4\n        and     rsp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [rsp],rax\n        mov     rbp,rsp                         ; rbp = aligned rbp\n        lea     rsp, [t2]\n        collect_args\n%ifdef WIN64\n        movaps  XMMWORD [rsp-1*SIZEOF_XMMWORD], xmm8\n        movaps  XMMWORD [rsp-2*SIZEOF_XMMWORD], xmm9\n        movaps  XMMWORD [rsp-3*SIZEOF_XMMWORD], xmm10\n        movaps  XMMWORD [rsp-4*SIZEOF_XMMWORD], xmm11\n        sub     rsp, 4*SIZEOF_XMMWORD\n%endif\n        push rbx\n\n        mov buffer, r11  ; r11 is now sratch\n\n        mov put_buffer, MMWORD [r10+16]  ; put_buffer = state->cur.put_buffer;\n        mov put_bits,    DWORD [r10+24]  ; put_bits = state->cur.put_bits;\n        push r10  ; r10 is now scratch\n\n        ; Encode the DC coefficient difference per section F.1.2.1\n        movsx edi, word [r12]  ; temp = temp2 = block[0] - last_dc_val;\n        sub   edi, r13d  ; r13 is not used anymore\n        mov   ebx, edi\n\n        ; This is a well-known technique for obtaining the absolute value\n        ; without a branch.  It is derived from an assembly language technique\n        ; presented in \"How to Optimize for the Pentium Processors\",\n        ; Copyright (c) 1996, 1997 by Agner Fog.\n        mov esi, edi\n        sar esi, 31   ; temp3 = temp >> (CHAR_BIT * sizeof(int) - 1);\n        xor edi, esi  ; temp ^= temp3;\n        sub edi, esi  ; temp -= temp3;\n\n        ; For a negative input, want temp2 = bitwise complement of abs(input)\n        ; This code assumes we are on a two's complement machine\n        add ebx, esi  ; temp2 += temp3;\n\n        ; Find the number of bits needed for the magnitude of the coefficient\n        lea   r11, [rel jpeg_nbits_table]\n        movzx rdi, byte [r11 + rdi]  ; nbits = JPEG_NBITS(temp);\n        ; Emit the Huffman-coded symbol for the number of bits\n        mov   r11d,  INT [r14 + rdi * 4]  ; code = dctbl->ehufco[nbits];\n        movzx  esi, byte [r14 + rdi + 1024]  ; size = dctbl->ehufsi[nbits];\n        EMIT_BITS r11, esi  ; EMIT_BITS(code, size)\n\n        ; Mask off any extra bits in code\n        mov esi, 1\n        mov ecx, edi\n        shl esi, cl\n        dec esi\n        and ebx, esi  ; temp2 &= (((JLONG) 1)<<nbits) - 1;\n\n        ; Emit that number of bits of the value, if positive,\n        ; or the complement of its magnitude, if negative.\n        EMIT_BITS rbx, edi  ; EMIT_BITS(temp2, nbits)\n\n        ; Prepare data\n        xor ebx, ebx\n        kloop_prepare  0,  1,  8,  16, 9,  2,  3,  10, 17, 24, 32, 25, \\\n                       18, 11, 4,  5,  12, 19, 26, 33, 40, 48, 41, 34, \\\n                       27, 20, 13, 6,  7,  14, 21, 28, 35, \\\n                       xmm0, xmm1, xmm2, xmm3\n        kloop_prepare  32, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, \\\n                       30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, \\\n                       53, 60, 61, 54, 47, 55, 62, 63, 63, \\\n                       xmm4, xmm5, xmm6, xmm7\n\n        pxor xmm8, xmm8\n        pcmpeqw xmm0, xmm8  ; tmp0 = _mm_cmpeq_epi16(tmp0, zero);\n        pcmpeqw xmm1, xmm8  ; tmp1 = _mm_cmpeq_epi16(tmp1, zero);\n        pcmpeqw xmm2, xmm8  ; tmp2 = _mm_cmpeq_epi16(tmp2, zero);\n        pcmpeqw xmm3, xmm8  ; tmp3 = _mm_cmpeq_epi16(tmp3, zero);\n        pcmpeqw xmm4, xmm8  ; tmp4 = _mm_cmpeq_epi16(tmp4, zero);\n        pcmpeqw xmm5, xmm8  ; tmp5 = _mm_cmpeq_epi16(tmp5, zero);\n        pcmpeqw xmm6, xmm8  ; tmp6 = _mm_cmpeq_epi16(tmp6, zero);\n        pcmpeqw xmm7, xmm8  ; tmp7 = _mm_cmpeq_epi16(tmp7, zero);\n        packsswb xmm0, xmm1  ; tmp0 = _mm_packs_epi16(tmp0, tmp1);\n        packsswb xmm2, xmm3  ; tmp2 = _mm_packs_epi16(tmp2, tmp3);\n        packsswb xmm4, xmm5  ; tmp4 = _mm_packs_epi16(tmp4, tmp5);\n        packsswb xmm6, xmm7  ; tmp6 = _mm_packs_epi16(tmp6, tmp7);\n        pmovmskb r11d, xmm0  ; index  = ((uint64_t)_mm_movemask_epi8(tmp0)) << 0;\n        pmovmskb r12d, xmm2  ; index  = ((uint64_t)_mm_movemask_epi8(tmp2)) << 16;\n        pmovmskb r13d, xmm4  ; index  = ((uint64_t)_mm_movemask_epi8(tmp4)) << 32;\n        pmovmskb r14d, xmm6  ; index  = ((uint64_t)_mm_movemask_epi8(tmp6)) << 48;\n        shl r12, 16\n        shl r14, 16\n        or  r11, r12\n        or  r13, r14\n        shl r13, 32\n        or  r11, r13\n        not r11  ; index = ~index;\n\n        ;mov MMWORD [ t1 + DCTSIZE2 * SIZEOF_WORD ], r11\n        ;jmp .EFN\n\n        mov   r13d,  INT [r15 + 240 * 4]  ; code_0xf0 = actbl->ehufco[0xf0];\n        movzx r14d, byte [r15 + 1024 + 240]  ; size_0xf0 = actbl->ehufsi[0xf0];\n        lea rsi, [t1]\n.BLOOP:\n        bsf r12, r11  ; r = __builtin_ctzl(index);\n        jz .ELOOP\n        mov rcx, r12\n        lea rsi, [rsi+r12*2]  ; k += r;\n        shr r11, cl  ; index >>= r;\n        movzx rdi, word [rsi]  ; temp = t1[k];\n        lea   rbx, [rel jpeg_nbits_table]\n        movzx rdi, byte [rbx + rdi]  ; nbits = JPEG_NBITS(temp);\n.BRLOOP:\n        cmp r12, 16  ; while (r > 15) {\n        jl .ERLOOP\n        EMIT_BITS r13, r14d  ; EMIT_BITS(code_0xf0, size_0xf0)\n        sub r12, 16  ; r -= 16;\n        jmp .BRLOOP\n.ERLOOP:\n        ; Emit Huffman symbol for run length / number of bits\n        CHECKBUF31  ; uses rcx, rdx\n\n        shl r12, 4  ; temp3 = (r << 4) + nbits;\n        add r12, rdi\n        mov   ebx,  INT [r15 + r12 * 4]  ; code = actbl->ehufco[temp3];\n        movzx ecx, byte [r15 + r12 + 1024]  ; size = actbl->ehufsi[temp3];\n        PUT_BITS rbx\n\n        ;EMIT_CODE(code, size)\n\n        movsx ebx, word [rsi-DCTSIZE2*2]  ; temp2 = t2[k];\n        ; Mask off any extra bits in code\n        mov rcx, rdi\n        mov rdx, 1\n        shl rdx, cl\n        dec rdx\n        and rbx, rdx  ; temp2 &= (((JLONG) 1)<<nbits) - 1;\n        PUT_BITS rbx  ; PUT_BITS(temp2, nbits)\n\n        shr r11, 1  ; index >>= 1;\n        add rsi, 2  ; ++k;\n        jmp .BLOOP\n.ELOOP:\n        ; If the last coef(s) were zero, emit an end-of-block code\n        lea rdi, [t1 + (DCTSIZE2-1) * 2]  ; r = DCTSIZE2-1-k;\n        cmp rdi, rsi  ; if (r > 0) {\n        je .EFN\n        mov   ebx,  INT [r15]  ; code = actbl->ehufco[0];\n        movzx r12d, byte [r15 + 1024]  ; size = actbl->ehufsi[0];\n        EMIT_BITS rbx, r12d\n.EFN:\n        pop r10\n        ; Save put_buffer & put_bits\n        mov MMWORD [r10+16], put_buffer  ; state->cur.put_buffer = put_buffer;\n        mov DWORD  [r10+24], put_bits  ; state->cur.put_bits = put_bits;\n\n        pop rbx\n%ifdef WIN64\n        movaps  xmm11, XMMWORD [rsp+0*SIZEOF_XMMWORD]\n        movaps  xmm10, XMMWORD [rsp+1*SIZEOF_XMMWORD]\n        movaps  xmm9, XMMWORD [rsp+2*SIZEOF_XMMWORD]\n        movaps  xmm8, XMMWORD [rsp+3*SIZEOF_XMMWORD]\n        add     rsp, 4*SIZEOF_XMMWORD\n%endif\n        uncollect_args\n        mov     rsp,rbp         ; rsp <- aligned rbp\n        pop     rsp             ; rsp <- original rbp\n        pop     rbp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jchuff-sse2.asm",
    "content": ";\n; jchuff-sse2.asm - Huffman entropy encoding (SSE2)\n;\n; Copyright (C) 2009-2011, 2014-2016, D. R. Commander.\n; Copyright (C) 2015, Matthieu Darbois.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains an SSE2 implementation for Huffman coding of one block.\n; The following code is based directly on jchuff.c; see jchuff.c for more\n; details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_huff_encode_one_block)\n\nEXTN(jconst_huff_encode_one_block):\n\n%include \"jpeg_nbits_table.inc\"\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n\n; These macros perform the same task as the emit_bits() function in the\n; original libjpeg code.  In addition to reducing overhead by explicitly\n; inlining the code, additional performance is achieved by taking into\n; account the size of the bit buffer and waiting until it is almost full\n; before emptying it.  This mostly benefits 64-bit platforms, since 6\n; bytes can be stored in a 64-bit bit buffer before it has to be emptied.\n\n%macro EMIT_BYTE 0\n        sub put_bits, 8  ; put_bits -= 8;\n        mov edx, put_buffer\n        mov ecx, put_bits\n        shr edx, cl  ; c = (JOCTET)GETJOCTET(put_buffer >> put_bits);\n        mov byte [eax], dl  ; *buffer++ = c;\n        add eax, 1\n        cmp dl, 0xFF  ; need to stuff a zero byte?\n        jne %%.EMIT_BYTE_END\n        mov byte [eax], 0  ; *buffer++ = 0;\n        add eax, 1\n%%.EMIT_BYTE_END:\n%endmacro\n\n%macro PUT_BITS 1\n        add put_bits, ecx  ; put_bits += size;\n        shl put_buffer, cl  ; put_buffer = (put_buffer << size);\n        or  put_buffer, %1\n%endmacro\n\n%macro CHECKBUF15 0\n        cmp put_bits, 16  ; if (put_bits > 31) {\n        jl %%.CHECKBUF15_END\n        mov eax, POINTER [esp+buffer]\n        EMIT_BYTE\n        EMIT_BYTE\n        mov POINTER [esp+buffer], eax\n%%.CHECKBUF15_END:\n%endmacro\n\n%macro EMIT_BITS 1\n        PUT_BITS %1\n        CHECKBUF15\n%endmacro\n\n%macro kloop_prepare 37  ;(ko, jno0, ..., jno31, xmm0, xmm1, xmm2, xmm3)\n    pxor xmm4, xmm4  ; __m128i neg = _mm_setzero_si128();\n    pxor xmm5, xmm5  ; __m128i neg = _mm_setzero_si128();\n    pxor xmm6, xmm6  ; __m128i neg = _mm_setzero_si128();\n    pxor xmm7, xmm7  ; __m128i neg = _mm_setzero_si128();\n    pinsrw %34, word [esi + %2  * SIZEOF_WORD], 0  ; xmm_shadow[0] = block[jno0];\n    pinsrw %35, word [esi + %10 * SIZEOF_WORD], 0  ; xmm_shadow[8] = block[jno8];\n    pinsrw %36, word [esi + %18 * SIZEOF_WORD], 0  ; xmm_shadow[16] = block[jno16];\n    pinsrw %37, word [esi + %26 * SIZEOF_WORD], 0  ; xmm_shadow[24] = block[jno24];\n    pinsrw %34, word [esi + %3  * SIZEOF_WORD], 1  ; xmm_shadow[1] = block[jno1];\n    pinsrw %35, word [esi + %11 * SIZEOF_WORD], 1  ; xmm_shadow[9] = block[jno9];\n    pinsrw %36, word [esi + %19 * SIZEOF_WORD], 1  ; xmm_shadow[17] = block[jno17];\n    pinsrw %37, word [esi + %27 * SIZEOF_WORD], 1  ; xmm_shadow[25] = block[jno25];\n    pinsrw %34, word [esi + %4  * SIZEOF_WORD], 2  ; xmm_shadow[2] = block[jno2];\n    pinsrw %35, word [esi + %12 * SIZEOF_WORD], 2  ; xmm_shadow[10] = block[jno10];\n    pinsrw %36, word [esi + %20 * SIZEOF_WORD], 2  ; xmm_shadow[18] = block[jno18];\n    pinsrw %37, word [esi + %28 * SIZEOF_WORD], 2  ; xmm_shadow[26] = block[jno26];\n    pinsrw %34, word [esi + %5  * SIZEOF_WORD], 3  ; xmm_shadow[3] = block[jno3];\n    pinsrw %35, word [esi + %13 * SIZEOF_WORD], 3  ; xmm_shadow[11] = block[jno11];\n    pinsrw %36, word [esi + %21 * SIZEOF_WORD], 3  ; xmm_shadow[19] = block[jno19];\n    pinsrw %37, word [esi + %29 * SIZEOF_WORD], 3  ; xmm_shadow[27] = block[jno27];\n    pinsrw %34, word [esi + %6  * SIZEOF_WORD], 4  ; xmm_shadow[4] = block[jno4];\n    pinsrw %35, word [esi + %14 * SIZEOF_WORD], 4  ; xmm_shadow[12] = block[jno12];\n    pinsrw %36, word [esi + %22 * SIZEOF_WORD], 4  ; xmm_shadow[20] = block[jno20];\n    pinsrw %37, word [esi + %30 * SIZEOF_WORD], 4  ; xmm_shadow[28] = block[jno28];\n    pinsrw %34, word [esi + %7  * SIZEOF_WORD], 5  ; xmm_shadow[5] = block[jno5];\n    pinsrw %35, word [esi + %15 * SIZEOF_WORD], 5  ; xmm_shadow[13] = block[jno13];\n    pinsrw %36, word [esi + %23 * SIZEOF_WORD], 5  ; xmm_shadow[21] = block[jno21];\n    pinsrw %37, word [esi + %31 * SIZEOF_WORD], 5  ; xmm_shadow[29] = block[jno29];\n    pinsrw %34, word [esi + %8  * SIZEOF_WORD], 6  ; xmm_shadow[6] = block[jno6];\n    pinsrw %35, word [esi + %16 * SIZEOF_WORD], 6  ; xmm_shadow[14] = block[jno14];\n    pinsrw %36, word [esi + %24 * SIZEOF_WORD], 6  ; xmm_shadow[22] = block[jno22];\n    pinsrw %37, word [esi + %32 * SIZEOF_WORD], 6  ; xmm_shadow[30] = block[jno30];\n    pinsrw %34, word [esi + %9  * SIZEOF_WORD], 7  ; xmm_shadow[7] = block[jno7];\n    pinsrw %35, word [esi + %17 * SIZEOF_WORD], 7  ; xmm_shadow[15] = block[jno15];\n    pinsrw %36, word [esi + %25 * SIZEOF_WORD], 7  ; xmm_shadow[23] = block[jno23];\n%if %1 != 32\n    pinsrw %37, word [esi + %33 * SIZEOF_WORD], 7  ; xmm_shadow[31] = block[jno31];\n%else\n    pinsrw %37, ecx, 7  ; xmm_shadow[31] = block[jno31];\n%endif\n    pcmpgtw xmm4, %34  ; neg = _mm_cmpgt_epi16(neg, x1);\n    pcmpgtw xmm5, %35  ; neg = _mm_cmpgt_epi16(neg, x1);\n    pcmpgtw xmm6, %36  ; neg = _mm_cmpgt_epi16(neg, x1);\n    pcmpgtw xmm7, %37  ; neg = _mm_cmpgt_epi16(neg, x1);\n    paddw %34, xmm4   ; x1 = _mm_add_epi16(x1, neg);\n    paddw %35, xmm5   ; x1 = _mm_add_epi16(x1, neg);\n    paddw %36, xmm6  ; x1 = _mm_add_epi16(x1, neg);\n    paddw %37, xmm7  ; x1 = _mm_add_epi16(x1, neg);\n    pxor %34, xmm4    ; x1 = _mm_xor_si128(x1, neg);\n    pxor %35, xmm5    ; x1 = _mm_xor_si128(x1, neg);\n    pxor %36, xmm6   ; x1 = _mm_xor_si128(x1, neg);\n    pxor %37, xmm7   ; x1 = _mm_xor_si128(x1, neg);\n    pxor xmm4, %34    ; neg = _mm_xor_si128(neg, x1);\n    pxor xmm5, %35    ; neg = _mm_xor_si128(neg, x1);\n    pxor xmm6, %36   ; neg = _mm_xor_si128(neg, x1);\n    pxor xmm7, %37   ; neg = _mm_xor_si128(neg, x1);\n    movdqa XMMWORD [esp + t1 + %1 * SIZEOF_WORD], %34  ; _mm_storeu_si128((__m128i *)(t1 + ko), x1);\n    movdqa XMMWORD [esp + t1 + (%1 + 8) * SIZEOF_WORD], %35  ; _mm_storeu_si128((__m128i *)(t1 + ko + 8), x1);\n    movdqa XMMWORD [esp + t1 + (%1 + 16) * SIZEOF_WORD], %36  ; _mm_storeu_si128((__m128i *)(t1 + ko + 16), x1);\n    movdqa XMMWORD [esp + t1 + (%1 + 24) * SIZEOF_WORD], %37  ; _mm_storeu_si128((__m128i *)(t1 + ko + 24), x1);\n    movdqa XMMWORD [esp + t2 + %1 * SIZEOF_WORD], xmm4  ; _mm_storeu_si128((__m128i *)(t2 + ko), neg);\n    movdqa XMMWORD [esp + t2 + (%1 + 8) * SIZEOF_WORD], xmm5  ; _mm_storeu_si128((__m128i *)(t2 + ko + 8), neg);\n    movdqa XMMWORD [esp + t2 + (%1 + 16) * SIZEOF_WORD], xmm6  ; _mm_storeu_si128((__m128i *)(t2 + ko + 16), neg);\n    movdqa XMMWORD [esp + t2 + (%1 + 24) * SIZEOF_WORD], xmm7  ; _mm_storeu_si128((__m128i *)(t2 + ko + 24), neg);\n%endmacro\n\n;\n; Encode a single block's worth of coefficients.\n;\n; GLOBAL(JOCTET*)\n; jsimd_huff_encode_one_block_sse2 (working_state *state, JOCTET *buffer,\n;                                   JCOEFPTR block, int last_dc_val,\n;                                   c_derived_tbl *dctbl, c_derived_tbl *actbl)\n;\n\n; eax + 8 = working_state *state\n; eax + 12 = JOCTET *buffer\n; eax + 16 = JCOEFPTR block\n; eax + 20 = int last_dc_val\n; eax + 24 = c_derived_tbl *dctbl\n; eax + 28 = c_derived_tbl *actbl\n\n%define pad             6*SIZEOF_DWORD  ; Align to 16 bytes\n%define t1              pad\n%define t2              t1+(DCTSIZE2*SIZEOF_WORD)\n%define block           t2+(DCTSIZE2*SIZEOF_WORD)\n%define actbl           block+SIZEOF_DWORD\n%define buffer          actbl+SIZEOF_DWORD\n%define temp            buffer+SIZEOF_DWORD\n%define temp2           temp+SIZEOF_DWORD\n%define temp3           temp2+SIZEOF_DWORD\n%define temp4           temp3+SIZEOF_DWORD\n%define temp5           temp4+SIZEOF_DWORD\n%define gotptr          temp5+SIZEOF_DWORD  ; void *gotptr\n%define put_buffer      ebx\n%define put_bits        edi\n\n        align   16\n        global  EXTN(jsimd_huff_encode_one_block_sse2)\n\nEXTN(jsimd_huff_encode_one_block_sse2):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        sub     esp, temp5+9*SIZEOF_DWORD-pad\n        push    ebx\n        push    ecx\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n        push    ebp\n\n        mov esi, POINTER [eax+8]        ; (working_state *state)\n        mov put_buffer,  DWORD [esi+8]  ; put_buffer = state->cur.put_buffer;\n        mov put_bits,    DWORD [esi+12]  ; put_bits = state->cur.put_bits;\n        push esi  ; esi is now scratch\n\n        get_GOT edx                       ; get GOT address\n        movpic POINTER [esp+gotptr], edx  ; save GOT address\n\n        mov ecx, POINTER [eax+28]\n        mov edx, POINTER [eax+16]\n        mov esi, POINTER [eax+12]\n        mov POINTER [esp+actbl],  ecx\n        mov POINTER [esp+block],  edx\n        mov POINTER [esp+buffer], esi\n\n        ; Encode the DC coefficient difference per section F.1.2.1\n        mov esi, POINTER [esp+block]        ; block\n        movsx ecx, word [esi]  ; temp = temp2 = block[0] - last_dc_val;\n        sub   ecx, DWORD [eax+20]\n        mov   esi, ecx\n\n        ; This is a well-known technique for obtaining the absolute value\n        ; without a branch.  It is derived from an assembly language technique\n        ; presented in \"How to Optimize for the Pentium Processors\",\n        ; Copyright (c) 1996, 1997 by Agner Fog.\n        mov edx, ecx\n        sar edx, 31   ; temp3 = temp >> (CHAR_BIT * sizeof(int) - 1);\n        xor ecx, edx ; temp ^= temp3;\n        sub ecx, edx ; temp -= temp3;\n\n        ; For a negative input, want temp2 = bitwise complement of abs(input)\n        ; This code assumes we are on a two's complement machine\n        add esi, edx  ; temp2 += temp3;\n        mov DWORD [esp+temp], esi  ; backup temp2 in temp\n\n        ; Find the number of bits needed for the magnitude of the coefficient\n        movpic ebp, POINTER [esp+gotptr]   ; load GOT address (ebp)\n        movzx edx, byte [GOTOFF(ebp, jpeg_nbits_table + ecx)]  ; nbits = JPEG_NBITS(temp);\n        mov DWORD [esp+temp2], edx  ; backup nbits in temp2\n\n        ; Emit the Huffman-coded symbol for the number of bits\n        mov    ebp, POINTER [eax+24]  ; After this point, arguments are not accessible anymore\n        mov    eax,  INT [ebp + edx * 4]  ; code = dctbl->ehufco[nbits];\n        movzx  ecx, byte [ebp + edx + 1024]  ; size = dctbl->ehufsi[nbits];\n        EMIT_BITS eax  ; EMIT_BITS(code, size)\n\n        mov ecx, DWORD [esp+temp2]  ; restore nbits\n\n        ; Mask off any extra bits in code\n        mov eax, 1\n        shl eax, cl\n        dec eax\n        and eax, DWORD [esp+temp]  ; temp2 &= (((JLONG) 1)<<nbits) - 1;\n\n        ; Emit that number of bits of the value, if positive,\n        ; or the complement of its magnitude, if negative.\n        EMIT_BITS eax  ; EMIT_BITS(temp2, nbits)\n\n        ; Prepare data\n        xor ecx, ecx\n        mov esi, POINTER [esp+block]\n        kloop_prepare  0,  1,  8,  16, 9,  2,  3,  10, 17, 24, 32, 25, \\\n                       18, 11, 4,  5,  12, 19, 26, 33, 40, 48, 41, 34, \\\n                       27, 20, 13, 6,  7,  14, 21, 28, 35, \\\n                       xmm0, xmm1, xmm2, xmm3\n        kloop_prepare  32, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, \\\n                       30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, \\\n                       53, 60, 61, 54, 47, 55, 62, 63, 63, \\\n                       xmm0, xmm1, xmm2, xmm3\n\n        pxor xmm7, xmm7\n        movdqa xmm0, XMMWORD [esp + t1 + 0 * SIZEOF_WORD]   ; __m128i tmp0 = _mm_loadu_si128((__m128i *)(t1 + 0));\n        movdqa xmm1, XMMWORD [esp + t1 + 8 * SIZEOF_WORD]   ; __m128i tmp1 = _mm_loadu_si128((__m128i *)(t1 + 8));\n        movdqa xmm2, XMMWORD [esp + t1 + 16 * SIZEOF_WORD]  ; __m128i tmp2 = _mm_loadu_si128((__m128i *)(t1 + 16));\n        movdqa xmm3, XMMWORD [esp + t1 + 24 * SIZEOF_WORD]  ; __m128i tmp3 = _mm_loadu_si128((__m128i *)(t1 + 24));\n        pcmpeqw xmm0, xmm7  ; tmp0 = _mm_cmpeq_epi16(tmp0, zero);\n        pcmpeqw xmm1, xmm7  ; tmp1 = _mm_cmpeq_epi16(tmp1, zero);\n        pcmpeqw xmm2, xmm7  ; tmp2 = _mm_cmpeq_epi16(tmp2, zero);\n        pcmpeqw xmm3, xmm7  ; tmp3 = _mm_cmpeq_epi16(tmp3, zero);\n        packsswb xmm0, xmm1  ; tmp0 = _mm_packs_epi16(tmp0, tmp1);\n        packsswb xmm2, xmm3  ; tmp2 = _mm_packs_epi16(tmp2, tmp3);\n        pmovmskb edx, xmm0  ; index  = ((uint64_t)_mm_movemask_epi8(tmp0)) << 0;\n        pmovmskb ecx, xmm2  ; index  = ((uint64_t)_mm_movemask_epi8(tmp2)) << 16;\n        shl ecx, 16\n        or  edx, ecx\n        not edx  ; index = ~index;\n\n        lea esi, [esp+t1]\n        mov ebp, POINTER [esp+actbl]  ; ebp = actbl\n\n.BLOOP:\n        bsf ecx, edx  ; r = __builtin_ctzl(index);\n        jz .ELOOP\n        lea esi, [esi+ecx*2]  ; k += r;\n        shr edx, cl  ; index >>= r;\n        mov DWORD [esp+temp3], edx\n.BRLOOP:\n        cmp ecx, 16  ; while (r > 15) {\n        jl .ERLOOP\n        sub ecx, 16 ; r -= 16;\n        mov DWORD [esp+temp], ecx\n        mov   eax, INT [ebp + 240 * 4]  ; code_0xf0 = actbl->ehufco[0xf0];\n        movzx ecx, byte [ebp + 1024 + 240]  ; size_0xf0 = actbl->ehufsi[0xf0];\n        EMIT_BITS eax  ; EMIT_BITS(code_0xf0, size_0xf0)\n        mov ecx, DWORD [esp+temp]\n        jmp .BRLOOP\n.ERLOOP:\n        movsx eax, word [esi]  ; temp = t1[k];\n        movpic edx, POINTER [esp+gotptr]   ; load GOT address (edx)\n        movzx eax, byte [GOTOFF(edx, jpeg_nbits_table + eax)]  ; nbits = JPEG_NBITS(temp);\n        mov DWORD [esp+temp2], eax\n        ; Emit Huffman symbol for run length / number of bits\n        shl ecx, 4  ; temp3 = (r << 4) + nbits;\n        add ecx, eax\n        mov   eax,  INT [ebp + ecx * 4]  ; code = actbl->ehufco[temp3];\n        movzx ecx, byte [ebp + ecx + 1024]  ; size = actbl->ehufsi[temp3];\n        EMIT_BITS eax\n\n        movsx edx, word [esi+DCTSIZE2*2]  ; temp2 = t2[k];\n        ; Mask off any extra bits in code\n        mov ecx, DWORD [esp+temp2]\n        mov eax, 1\n        shl eax, cl\n        dec eax\n        and eax, edx  ; temp2 &= (((JLONG) 1)<<nbits) - 1;\n        EMIT_BITS eax  ; PUT_BITS(temp2, nbits)\n        mov edx, DWORD [esp+temp3]\n        add esi, 2  ; ++k;\n        shr edx, 1  ; index >>= 1;\n\n        jmp .BLOOP\n.ELOOP:\n        movdqa xmm0, XMMWORD [esp + t1 + 32 * SIZEOF_WORD]  ; __m128i tmp0 = _mm_loadu_si128((__m128i *)(t1 + 0));\n        movdqa xmm1, XMMWORD [esp + t1 + 40 * SIZEOF_WORD]  ; __m128i tmp1 = _mm_loadu_si128((__m128i *)(t1 + 8));\n        movdqa xmm2, XMMWORD [esp + t1 + 48 * SIZEOF_WORD]  ; __m128i tmp2 = _mm_loadu_si128((__m128i *)(t1 + 16));\n        movdqa xmm3, XMMWORD [esp + t1 + 56 * SIZEOF_WORD]  ; __m128i tmp3 = _mm_loadu_si128((__m128i *)(t1 + 24));\n        pcmpeqw xmm0, xmm7  ; tmp0 = _mm_cmpeq_epi16(tmp0, zero);\n        pcmpeqw xmm1, xmm7  ; tmp1 = _mm_cmpeq_epi16(tmp1, zero);\n        pcmpeqw xmm2, xmm7  ; tmp2 = _mm_cmpeq_epi16(tmp2, zero);\n        pcmpeqw xmm3, xmm7  ; tmp3 = _mm_cmpeq_epi16(tmp3, zero);\n        packsswb xmm0, xmm1  ; tmp0 = _mm_packs_epi16(tmp0, tmp1);\n        packsswb xmm2, xmm3  ; tmp2 = _mm_packs_epi16(tmp2, tmp3);\n        pmovmskb edx, xmm0  ; index  = ((uint64_t)_mm_movemask_epi8(tmp0)) << 0;\n        pmovmskb ecx, xmm2  ; index  = ((uint64_t)_mm_movemask_epi8(tmp2)) << 16;\n        shl ecx, 16\n        or  edx, ecx\n        not edx  ; index = ~index;\n\n        lea eax, [esp + t1 + (DCTSIZE2/2) * 2]\n        sub eax, esi\n        shr eax, 1\n        bsf ecx, edx  ; r = __builtin_ctzl(index);\n        jz .ELOOP2\n        shr edx, cl  ; index >>= r;\n        add ecx, eax\n        lea esi, [esi+ecx*2]  ; k += r;\n        mov DWORD [esp+temp3], edx\n        jmp .BRLOOP2\n.BLOOP2:\n        bsf ecx, edx  ; r = __builtin_ctzl(index);\n        jz .ELOOP2\n        lea esi, [esi+ecx*2]  ; k += r;\n        shr edx, cl  ; index >>= r;\n        mov DWORD [esp+temp3], edx\n.BRLOOP2:\n        cmp ecx, 16  ; while (r > 15) {\n        jl .ERLOOP2\n        sub ecx, 16  ; r -= 16;\n        mov DWORD [esp+temp], ecx\n        mov   eax, INT [ebp + 240 * 4]  ; code_0xf0 = actbl->ehufco[0xf0];\n        movzx ecx, byte [ebp + 1024 + 240]  ; size_0xf0 = actbl->ehufsi[0xf0];\n        EMIT_BITS eax  ; EMIT_BITS(code_0xf0, size_0xf0)\n        mov ecx, DWORD [esp+temp]\n        jmp .BRLOOP2\n.ERLOOP2:\n        movsx eax, word [esi]  ; temp = t1[k];\n        bsr eax, eax  ; nbits = 32 - __builtin_clz(temp);\n        inc eax\n        mov DWORD [esp+temp2], eax\n        ; Emit Huffman symbol for run length / number of bits\n        shl ecx, 4  ; temp3 = (r << 4) + nbits;\n        add ecx, eax\n        mov   eax,  INT [ebp + ecx * 4]  ; code = actbl->ehufco[temp3];\n        movzx ecx, byte [ebp + ecx + 1024]  ; size = actbl->ehufsi[temp3];\n        EMIT_BITS eax\n\n        movsx edx, word [esi+DCTSIZE2*2]  ; temp2 = t2[k];\n        ; Mask off any extra bits in code\n        mov ecx, DWORD [esp+temp2]\n        mov eax, 1\n        shl eax, cl\n        dec eax\n        and eax, edx  ; temp2 &= (((JLONG) 1)<<nbits) - 1;\n        EMIT_BITS eax  ; PUT_BITS(temp2, nbits)\n        mov edx, DWORD [esp+temp3]\n        add esi, 2  ; ++k;\n        shr edx, 1  ; index >>= 1;\n\n        jmp .BLOOP2\n.ELOOP2:\n        ; If the last coef(s) were zero, emit an end-of-block code\n        lea edx, [esp + t1 + (DCTSIZE2-1) * 2]  ; r = DCTSIZE2-1-k;\n        cmp edx, esi  ; if (r > 0) {\n        je .EFN\n        mov   eax,  INT [ebp]  ; code = actbl->ehufco[0];\n        movzx ecx, byte [ebp + 1024]  ; size = actbl->ehufsi[0];\n        EMIT_BITS eax\n.EFN:\n        mov eax, [esp+buffer]\n        pop esi\n        ; Save put_buffer & put_bits\n        mov DWORD [esi+8], put_buffer  ; state->cur.put_buffer = put_buffer;\n        mov DWORD [esi+12], put_bits  ; state->cur.put_bits = put_bits;\n\n        pop     ebp\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n        pop     ecx\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jcolsamp.inc",
    "content": ";\n; jcolsamp.inc - private declarations for color conversion & up/downsampling\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; [TAB8]\n\n; --------------------------------------------------------------------------\n\n; pseudo-resisters to make ordering of RGB configurable\n;\n%if RGB_RED == 0\n%define  mmA  mm0\n%define  mmB  mm1\n%define xmmA xmm0\n%define xmmB xmm1\n%elif RGB_GREEN == 0\n%define  mmA  mm2\n%define  mmB  mm3\n%define xmmA xmm2\n%define xmmB xmm3\n%elif RGB_BLUE == 0\n%define  mmA  mm4\n%define  mmB  mm5\n%define xmmA xmm4\n%define xmmB xmm5\n%else\n%define  mmA  mm6\n%define  mmB  mm7\n%define xmmA xmm6\n%define xmmB xmm7\n%endif\n\n%if RGB_RED == 1\n%define  mmC  mm0\n%define  mmD  mm1\n%define xmmC xmm0\n%define xmmD xmm1\n%elif RGB_GREEN == 1\n%define  mmC  mm2\n%define  mmD  mm3\n%define xmmC xmm2\n%define xmmD xmm3\n%elif RGB_BLUE == 1\n%define  mmC  mm4\n%define  mmD  mm5\n%define xmmC xmm4\n%define xmmD xmm5\n%else\n%define  mmC  mm6\n%define  mmD  mm7\n%define xmmC xmm6\n%define xmmD xmm7\n%endif\n\n%if RGB_RED == 2\n%define  mmE  mm0\n%define  mmF  mm1\n%define xmmE xmm0\n%define xmmF xmm1\n%elif RGB_GREEN == 2\n%define  mmE  mm2\n%define  mmF  mm3\n%define xmmE xmm2\n%define xmmF xmm3\n%elif RGB_BLUE == 2\n%define  mmE  mm4\n%define  mmF  mm5\n%define xmmE xmm4\n%define xmmF xmm5\n%else\n%define  mmE  mm6\n%define  mmF  mm7\n%define xmmE xmm6\n%define xmmF xmm7\n%endif\n\n%if RGB_RED == 3\n%define  mmG  mm0\n%define  mmH  mm1\n%define xmmG xmm0\n%define xmmH xmm1\n%elif RGB_GREEN == 3\n%define  mmG  mm2\n%define  mmH  mm3\n%define xmmG xmm2\n%define xmmH xmm3\n%elif RGB_BLUE == 3\n%define  mmG  mm4\n%define  mmH  mm5\n%define xmmG xmm4\n%define xmmH xmm5\n%else\n%define  mmG  mm6\n%define  mmH  mm7\n%define xmmG xmm6\n%define xmmH xmm7\n%endif\n\n; --------------------------------------------------------------------------\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jcsample-altivec.c",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2015, D. R. Commander.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n/* CHROMA DOWNSAMPLING */\n\n#include \"jsimd_altivec.h\"\n#include \"jcsample.h\"\n\n\nvoid\njsimd_h2v1_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor,\n                               JDIMENSION v_samp_factor,\n                               JDIMENSION width_blocks,\n                               JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int outrow, outcol;\n  JDIMENSION output_cols = width_blocks * DCTSIZE;\n  JSAMPROW inptr, outptr;\n\n  __vector unsigned char this0, next0, out;\n  __vector unsigned short this0e, this0o, next0e, next0o, outl, outh;\n\n  /* Constants */\n  __vector unsigned short pw_bias = { __4X2(0, 1) },\n    pw_one = { __8X(1) };\n  __vector unsigned char even_odd_index =\n    {0,2,4,6,8,10,12,14,1,3,5,7,9,11,13,15},\n    pb_zero = { __16X(0) };\n\n  expand_right_edge(input_data, max_v_samp_factor, image_width,\n                    output_cols * 2);\n\n  for (outrow = 0; outrow < v_samp_factor; outrow++) {\n    outptr = output_data[outrow];\n    inptr = input_data[outrow];\n\n    for (outcol = output_cols; outcol > 0;\n         outcol -= 16, inptr += 32, outptr += 16) {\n\n      this0 = vec_ld(0, inptr);\n      this0 = vec_perm(this0, this0, even_odd_index);\n      this0e = (__vector unsigned short)VEC_UNPACKHU(this0);\n      this0o = (__vector unsigned short)VEC_UNPACKLU(this0);\n      outl = vec_add(this0e, this0o);\n      outl = vec_add(outl, pw_bias);\n      outl = vec_sr(outl, pw_one);\n\n      if (outcol > 8) {\n        next0 = vec_ld(16, inptr);\n        next0 = vec_perm(next0, next0, even_odd_index);\n        next0e = (__vector unsigned short)VEC_UNPACKHU(next0);\n        next0o = (__vector unsigned short)VEC_UNPACKLU(next0);\n        outh = vec_add(next0e, next0o);\n        outh = vec_add(outh, pw_bias);\n        outh = vec_sr(outh, pw_one);\n      } else\n        outh = vec_splat_u16(0);\n\n      out = vec_pack(outl, outh);\n      vec_st(out, 0, outptr);\n    }\n  }\n}\n\n\nvoid\njsimd_h2v2_downsample_altivec (JDIMENSION image_width, int max_v_samp_factor,\n                               JDIMENSION v_samp_factor,\n                               JDIMENSION width_blocks,\n                               JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int inrow, outrow, outcol;\n  JDIMENSION output_cols = width_blocks * DCTSIZE;\n  JSAMPROW inptr0, inptr1, outptr;\n\n  __vector unsigned char this0, next0, this1, next1, out;\n  __vector unsigned short this0e, this0o, next0e, next0o, this1e, this1o,\n    next1e, next1o, out0l, out0h, out1l, out1h, outl, outh;\n\n  /* Constants */\n  __vector unsigned short pw_bias = { __4X2(1, 2) },\n    pw_two = { __8X(2) };\n  __vector unsigned char even_odd_index =\n    { 0, 2, 4, 6, 8, 10, 12, 14, 1, 3, 5, 7, 9, 11, 13, 15 },\n    pb_zero = { __16X(0) };\n\n  expand_right_edge(input_data, max_v_samp_factor, image_width,\n                    output_cols * 2);\n\n  for (inrow = 0, outrow = 0; outrow < v_samp_factor;\n       inrow += 2, outrow++) {\n\n    inptr0 = input_data[inrow];\n    inptr1 = input_data[inrow + 1];\n    outptr = output_data[outrow];\n\n    for (outcol = output_cols; outcol > 0;\n         outcol -= 16, inptr0 += 32, inptr1 += 32, outptr += 16) {\n\n      this0 = vec_ld(0, inptr0);\n      this0 = vec_perm(this0, this0, even_odd_index);\n      this0e = (__vector unsigned short)VEC_UNPACKHU(this0);\n      this0o = (__vector unsigned short)VEC_UNPACKLU(this0);\n      out0l = vec_add(this0e, this0o);\n\n      this1 = vec_ld(0, inptr1);\n      this1 = vec_perm(this1, this1, even_odd_index);\n      this1e = (__vector unsigned short)VEC_UNPACKHU(this1);\n      this1o = (__vector unsigned short)VEC_UNPACKLU(this1);\n      out1l = vec_add(this1e, this1o);\n\n      outl = vec_add(out0l, out1l);\n      outl = vec_add(outl, pw_bias);\n      outl = vec_sr(outl, pw_two);\n\n      if (outcol > 8) {\n        next0 = vec_ld(16, inptr0);\n        next0 = vec_perm(next0, next0, even_odd_index);\n        next0e = (__vector unsigned short)VEC_UNPACKHU(next0);\n        next0o = (__vector unsigned short)VEC_UNPACKLU(next0);\n        out0h = vec_add(next0e, next0o);\n\n        next1 = vec_ld(16, inptr1);\n        next1 = vec_perm(next1, next1, even_odd_index);\n        next1e = (__vector unsigned short)VEC_UNPACKHU(next1);\n        next1o = (__vector unsigned short)VEC_UNPACKLU(next1);\n        out1h = vec_add(next1e, next1o);\n\n        outh = vec_add(out0h, out1h);\n        outh = vec_add(outh, pw_bias);\n        outh = vec_sr(outh, pw_two);\n      } else\n        outh = vec_splat_u16(0);\n\n      out = vec_pack(outl, outh);\n      vec_st(out, 0, outptr);\n    }\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jcsample-mmx.asm",
    "content": ";\n; jcsample.asm - downsampling (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Downsample pixel values of a single component.\n; This version handles the common case of 2:1 horizontal and 1:1 vertical,\n; without smoothing.\n;\n; GLOBAL(void)\n; jsimd_h2v1_downsample_mmx (JDIMENSION image_width, int max_v_samp_factor,\n;                            JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n;                            JSAMPARRAY input_data, JSAMPARRAY output_data);\n;\n\n%define img_width(b)    (b)+8           ; JDIMENSION image_width\n%define max_v_samp(b)   (b)+12          ; int max_v_samp_factor\n%define v_samp(b)       (b)+16          ; JDIMENSION v_samp_factor\n%define width_blks(b)   (b)+20          ; JDIMENSION width_blocks\n%define input_data(b)   (b)+24          ; JSAMPARRAY input_data\n%define output_data(b)  (b)+28          ; JSAMPARRAY output_data\n\n        align   16\n        global  EXTN(jsimd_h2v1_downsample_mmx)\n\nEXTN(jsimd_h2v1_downsample_mmx):\n        push    ebp\n        mov     ebp,esp\n;       push    ebx             ; unused\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        mov     ecx, JDIMENSION [width_blks(ebp)]\n        shl     ecx,3                   ; imul ecx,DCTSIZE (ecx = output_cols)\n        jz      near .return\n\n        mov     edx, JDIMENSION [img_width(ebp)]\n\n        ; -- expand_right_edge\n\n        push    ecx\n        shl     ecx,1                           ; output_cols * 2\n        sub     ecx,edx\n        jle     short .expand_end\n\n        mov     eax, INT [max_v_samp(ebp)]\n        test    eax,eax\n        jle     short .expand_end\n\n        cld\n        mov     esi, JSAMPARRAY [input_data(ebp)]       ; input_data\n        alignx  16,7\n.expandloop:\n        push    eax\n        push    ecx\n\n        mov     edi, JSAMPROW [esi]\n        add     edi,edx\n        mov     al, JSAMPLE [edi-1]\n\n        rep stosb\n\n        pop     ecx\n        pop     eax\n\n        add     esi, byte SIZEOF_JSAMPROW\n        dec     eax\n        jg      short .expandloop\n\n.expand_end:\n        pop     ecx                             ; output_cols\n\n        ; -- h2v1_downsample\n\n        mov     eax, JDIMENSION [v_samp(ebp)]   ; rowctr\n        test    eax,eax\n        jle     near .return\n\n        mov       edx, 0x00010000       ; bias pattern\n        movd      mm7,edx\n        pcmpeqw   mm6,mm6\n        punpckldq mm7,mm7               ; mm7={0, 1, 0, 1}\n        psrlw     mm6,BYTE_BIT          ; mm6={0xFF 0x00 0xFF 0x00 ..}\n\n        mov     esi, JSAMPARRAY [input_data(ebp)]       ; input_data\n        mov     edi, JSAMPARRAY [output_data(ebp)]      ; output_data\n        alignx  16,7\n.rowloop:\n        push    ecx\n        push    edi\n        push    esi\n\n        mov     esi, JSAMPROW [esi]             ; inptr\n        mov     edi, JSAMPROW [edi]             ; outptr\n        alignx  16,7\n.columnloop:\n\n        movq    mm0, MMWORD [esi+0*SIZEOF_MMWORD]\n        movq    mm1, MMWORD [esi+1*SIZEOF_MMWORD]\n        movq    mm2,mm0\n        movq    mm3,mm1\n\n        pand    mm0,mm6\n        psrlw   mm2,BYTE_BIT\n        pand    mm1,mm6\n        psrlw   mm3,BYTE_BIT\n\n        paddw   mm0,mm2\n        paddw   mm1,mm3\n        paddw   mm0,mm7\n        paddw   mm1,mm7\n        psrlw   mm0,1\n        psrlw   mm1,1\n\n        packuswb mm0,mm1\n\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mm0\n\n        add     esi, byte 2*SIZEOF_MMWORD       ; inptr\n        add     edi, byte 1*SIZEOF_MMWORD       ; outptr\n        sub     ecx, byte SIZEOF_MMWORD         ; outcol\n        jnz     short .columnloop\n\n        pop     esi\n        pop     edi\n        pop     ecx\n\n        add     esi, byte SIZEOF_JSAMPROW       ; input_data\n        add     edi, byte SIZEOF_JSAMPROW       ; output_data\n        dec     eax                             ; rowctr\n        jg      short .rowloop\n\n        emms            ; empty MMX state\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n;       pop     ebx             ; unused\n        pop     ebp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Downsample pixel values of a single component.\n; This version handles the standard case of 2:1 horizontal and 2:1 vertical,\n; without smoothing.\n;\n; GLOBAL(void)\n; jsimd_h2v2_downsample_mmx (JDIMENSION image_width, int max_v_samp_factor,\n;                            JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n;                            JSAMPARRAY input_data, JSAMPARRAY output_data);\n;\n\n%define img_width(b)    (b)+8           ; JDIMENSION image_width\n%define max_v_samp(b)   (b)+12          ; int max_v_samp_factor\n%define v_samp(b)       (b)+16          ; JDIMENSION v_samp_factor\n%define width_blks(b)   (b)+20          ; JDIMENSION width_blocks\n%define input_data(b)   (b)+24          ; JSAMPARRAY input_data\n%define output_data(b)  (b)+28          ; JSAMPARRAY output_data\n\n        align   16\n        global  EXTN(jsimd_h2v2_downsample_mmx)\n\nEXTN(jsimd_h2v2_downsample_mmx):\n        push    ebp\n        mov     ebp,esp\n;       push    ebx             ; unused\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        mov     ecx, JDIMENSION [width_blks(ebp)]\n        shl     ecx,3                   ; imul ecx,DCTSIZE (ecx = output_cols)\n        jz      near .return\n\n        mov     edx, JDIMENSION [img_width(ebp)]\n\n        ; -- expand_right_edge\n\n        push    ecx\n        shl     ecx,1                           ; output_cols * 2\n        sub     ecx,edx\n        jle     short .expand_end\n\n        mov     eax, INT [max_v_samp(ebp)]\n        test    eax,eax\n        jle     short .expand_end\n\n        cld\n        mov     esi, JSAMPARRAY [input_data(ebp)]       ; input_data\n        alignx  16,7\n.expandloop:\n        push    eax\n        push    ecx\n\n        mov     edi, JSAMPROW [esi]\n        add     edi,edx\n        mov     al, JSAMPLE [edi-1]\n\n        rep stosb\n\n        pop     ecx\n        pop     eax\n\n        add     esi, byte SIZEOF_JSAMPROW\n        dec     eax\n        jg      short .expandloop\n\n.expand_end:\n        pop     ecx                             ; output_cols\n\n        ; -- h2v2_downsample\n\n        mov     eax, JDIMENSION [v_samp(ebp)]   ; rowctr\n        test    eax,eax\n        jle     near .return\n\n        mov       edx, 0x00020001       ; bias pattern\n        movd      mm7,edx\n        pcmpeqw   mm6,mm6\n        punpckldq mm7,mm7               ; mm7={1, 2, 1, 2}\n        psrlw     mm6,BYTE_BIT          ; mm6={0xFF 0x00 0xFF 0x00 ..}\n\n        mov     esi, JSAMPARRAY [input_data(ebp)]       ; input_data\n        mov     edi, JSAMPARRAY [output_data(ebp)]      ; output_data\n        alignx  16,7\n.rowloop:\n        push    ecx\n        push    edi\n        push    esi\n\n        mov     edx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]   ; inptr0\n        mov     esi, JSAMPROW [esi+1*SIZEOF_JSAMPROW]   ; inptr1\n        mov     edi, JSAMPROW [edi]                     ; outptr\n        alignx  16,7\n.columnloop:\n\n        movq    mm0, MMWORD [edx+0*SIZEOF_MMWORD]\n        movq    mm1, MMWORD [esi+0*SIZEOF_MMWORD]\n        movq    mm2, MMWORD [edx+1*SIZEOF_MMWORD]\n        movq    mm3, MMWORD [esi+1*SIZEOF_MMWORD]\n\n        movq    mm4,mm0\n        movq    mm5,mm1\n        pand    mm0,mm6\n        psrlw   mm4,BYTE_BIT\n        pand    mm1,mm6\n        psrlw   mm5,BYTE_BIT\n        paddw   mm0,mm4\n        paddw   mm1,mm5\n\n        movq    mm4,mm2\n        movq    mm5,mm3\n        pand    mm2,mm6\n        psrlw   mm4,BYTE_BIT\n        pand    mm3,mm6\n        psrlw   mm5,BYTE_BIT\n        paddw   mm2,mm4\n        paddw   mm3,mm5\n\n        paddw   mm0,mm1\n        paddw   mm2,mm3\n        paddw   mm0,mm7\n        paddw   mm2,mm7\n        psrlw   mm0,2\n        psrlw   mm2,2\n\n        packuswb mm0,mm2\n\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mm0\n\n        add     edx, byte 2*SIZEOF_MMWORD       ; inptr0\n        add     esi, byte 2*SIZEOF_MMWORD       ; inptr1\n        add     edi, byte 1*SIZEOF_MMWORD       ; outptr\n        sub     ecx, byte SIZEOF_MMWORD         ; outcol\n        jnz     near .columnloop\n\n        pop     esi\n        pop     edi\n        pop     ecx\n\n        add     esi, byte 2*SIZEOF_JSAMPROW     ; input_data\n        add     edi, byte 1*SIZEOF_JSAMPROW     ; output_data\n        dec     eax                             ; rowctr\n        jg      near .rowloop\n\n        emms            ; empty MMX state\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n;       pop     ebx             ; unused\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jcsample-sse2-64.asm",
    "content": ";\n; jcsample.asm - downsampling (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n;\n; Downsample pixel values of a single component.\n; This version handles the common case of 2:1 horizontal and 1:1 vertical,\n; without smoothing.\n;\n; GLOBAL(void)\n; jsimd_h2v1_downsample_sse2 (JDIMENSION image_width, int max_v_samp_factor,\n;                             JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n;                             JSAMPARRAY input_data, JSAMPARRAY output_data);\n;\n\n; r10 = JDIMENSION image_width\n; r11 = int max_v_samp_factor\n; r12 = JDIMENSION v_samp_factor\n; r13 = JDIMENSION width_blocks\n; r14 = JSAMPARRAY input_data\n; r15 = JSAMPARRAY output_data\n\n        align   16\n        global  EXTN(jsimd_h2v1_downsample_sse2)\n\nEXTN(jsimd_h2v1_downsample_sse2):\n        push    rbp\n        mov     rax,rsp\n        mov     rbp,rsp\n        collect_args\n\n        mov ecx, r13d\n        shl     rcx,3                   ; imul rcx,DCTSIZE (rcx = output_cols)\n        jz      near .return\n\n        mov edx, r10d\n\n        ; -- expand_right_edge\n\n        push    rcx\n        shl     rcx,1                           ; output_cols * 2\n        sub     rcx,rdx\n        jle     short .expand_end\n\n        mov     rax, r11\n        test    rax,rax\n        jle     short .expand_end\n\n        cld\n        mov     rsi, r14        ; input_data\n.expandloop:\n        push    rax\n        push    rcx\n\n        mov     rdi, JSAMPROW [rsi]\n        add     rdi,rdx\n        mov     al, JSAMPLE [rdi-1]\n\n        rep stosb\n\n        pop     rcx\n        pop     rax\n\n        add     rsi, byte SIZEOF_JSAMPROW\n        dec     rax\n        jg      short .expandloop\n\n.expand_end:\n        pop     rcx                             ; output_cols\n\n        ; -- h2v1_downsample\n\n        mov     eax, r12d        ; rowctr\n        test    eax,eax\n        jle     near .return\n\n        mov     rdx, 0x00010000         ; bias pattern\n        movd    xmm7,edx\n        pcmpeqw xmm6,xmm6\n        pshufd  xmm7,xmm7,0x00          ; xmm7={0, 1, 0, 1, 0, 1, 0, 1}\n        psrlw   xmm6,BYTE_BIT           ; xmm6={0xFF 0x00 0xFF 0x00 ..}\n\n        mov     rsi, r14        ; input_data\n        mov     rdi, r15        ; output_data\n.rowloop:\n        push    rcx\n        push    rdi\n        push    rsi\n\n        mov     rsi, JSAMPROW [rsi]             ; inptr\n        mov rdi, JSAMPROW [rdi]         ; outptr\n\n        cmp     rcx, byte SIZEOF_XMMWORD\n        jae     short .columnloop\n\n.columnloop_r8:\n        movdqa  xmm0, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        pxor    xmm1,xmm1\n        mov     rcx, SIZEOF_XMMWORD\n        jmp     short .downsample\n\n.columnloop:\n        movdqa  xmm0, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        movdqa  xmm1, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\n.downsample:\n        movdqa  xmm2,xmm0\n        movdqa  xmm3,xmm1\n\n        pand    xmm0,xmm6\n        psrlw   xmm2,BYTE_BIT\n        pand    xmm1,xmm6\n        psrlw   xmm3,BYTE_BIT\n\n        paddw   xmm0,xmm2\n        paddw   xmm1,xmm3\n        paddw   xmm0,xmm7\n        paddw   xmm1,xmm7\n        psrlw   xmm0,1\n        psrlw   xmm1,1\n\n        packuswb xmm0,xmm1\n\n        movdqa  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmm0\n\n        sub     rcx, byte SIZEOF_XMMWORD        ; outcol\n        add     rsi, byte 2*SIZEOF_XMMWORD      ; inptr\n        add     rdi, byte 1*SIZEOF_XMMWORD      ; outptr\n        cmp     rcx, byte SIZEOF_XMMWORD\n        jae     short .columnloop\n        test    rcx,rcx\n        jnz     short .columnloop_r8\n\n        pop     rsi\n        pop     rdi\n        pop     rcx\n\n        add     rsi, byte SIZEOF_JSAMPROW       ; input_data\n        add     rdi, byte SIZEOF_JSAMPROW       ; output_data\n        dec     rax                             ; rowctr\n        jg      near .rowloop\n\n.return:\n        uncollect_args\n        pop     rbp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Downsample pixel values of a single component.\n; This version handles the standard case of 2:1 horizontal and 2:1 vertical,\n; without smoothing.\n;\n; GLOBAL(void)\n; jsimd_h2v2_downsample_sse2 (JDIMENSION image_width, int max_v_samp_factor,\n;                             JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n;                             JSAMPARRAY input_data, JSAMPARRAY output_data);\n;\n\n; r10 = JDIMENSION image_width\n; r11 = int max_v_samp_factor\n; r12 = JDIMENSION v_samp_factor\n; r13 = JDIMENSION width_blocks\n; r14 = JSAMPARRAY input_data\n; r15 = JSAMPARRAY output_data\n\n        align   16\n        global  EXTN(jsimd_h2v2_downsample_sse2)\n\nEXTN(jsimd_h2v2_downsample_sse2):\n        push    rbp\n        mov     rax,rsp\n        mov     rbp,rsp\n        collect_args\n\n        mov     ecx, r13d\n        shl     rcx,3                   ; imul rcx,DCTSIZE (rcx = output_cols)\n        jz      near .return\n\n        mov     edx, r10d\n\n        ; -- expand_right_edge\n\n        push    rcx\n        shl     rcx,1                           ; output_cols * 2\n        sub     rcx,rdx\n        jle     short .expand_end\n\n        mov     rax, r11\n        test    rax,rax\n        jle     short .expand_end\n\n        cld\n        mov     rsi, r14        ; input_data\n.expandloop:\n        push    rax\n        push    rcx\n\n        mov     rdi, JSAMPROW [rsi]\n        add     rdi,rdx\n        mov     al, JSAMPLE [rdi-1]\n\n        rep stosb\n\n        pop     rcx\n        pop     rax\n\n        add     rsi, byte SIZEOF_JSAMPROW\n        dec     rax\n        jg      short .expandloop\n\n.expand_end:\n        pop     rcx                             ; output_cols\n\n        ; -- h2v2_downsample\n\n        mov     eax, r12d        ; rowctr\n        test    rax,rax\n        jle     near .return\n\n        mov     rdx, 0x00020001         ; bias pattern\n        movd    xmm7,edx\n        pcmpeqw xmm6,xmm6\n        pshufd  xmm7,xmm7,0x00          ; xmm7={1, 2, 1, 2, 1, 2, 1, 2}\n        psrlw   xmm6,BYTE_BIT           ; xmm6={0xFF 0x00 0xFF 0x00 ..}\n\n        mov     rsi, r14        ; input_data\n        mov     rdi, r15        ; output_data\n.rowloop:\n        push    rcx\n        push    rdi\n        push    rsi\n\n        mov     rdx, JSAMPROW [rsi+0*SIZEOF_JSAMPROW]   ; inptr0\n        mov     rsi, JSAMPROW [rsi+1*SIZEOF_JSAMPROW]   ; inptr1\n        mov     rdi, JSAMPROW [rdi]                     ; outptr\n\n        cmp     rcx, byte SIZEOF_XMMWORD\n        jae     short .columnloop\n\n.columnloop_r8:\n        movdqa  xmm0, XMMWORD [rdx+0*SIZEOF_XMMWORD]\n        movdqa  xmm1, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        pxor    xmm2,xmm2\n        pxor    xmm3,xmm3\n        mov     rcx, SIZEOF_XMMWORD\n        jmp     short .downsample\n\n.columnloop:\n        movdqa  xmm0, XMMWORD [rdx+0*SIZEOF_XMMWORD]\n        movdqa  xmm1, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        movdqa  xmm2, XMMWORD [rdx+1*SIZEOF_XMMWORD]\n        movdqa  xmm3, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\n.downsample:\n        movdqa  xmm4,xmm0\n        movdqa  xmm5,xmm1\n        pand    xmm0,xmm6\n        psrlw   xmm4,BYTE_BIT\n        pand    xmm1,xmm6\n        psrlw   xmm5,BYTE_BIT\n        paddw   xmm0,xmm4\n        paddw   xmm1,xmm5\n\n        movdqa  xmm4,xmm2\n        movdqa  xmm5,xmm3\n        pand    xmm2,xmm6\n        psrlw   xmm4,BYTE_BIT\n        pand    xmm3,xmm6\n        psrlw   xmm5,BYTE_BIT\n        paddw   xmm2,xmm4\n        paddw   xmm3,xmm5\n\n        paddw   xmm0,xmm1\n        paddw   xmm2,xmm3\n        paddw   xmm0,xmm7\n        paddw   xmm2,xmm7\n        psrlw   xmm0,2\n        psrlw   xmm2,2\n\n        packuswb xmm0,xmm2\n\n        movdqa  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmm0\n\n        sub     rcx, byte SIZEOF_XMMWORD        ; outcol\n        add     rdx, byte 2*SIZEOF_XMMWORD      ; inptr0\n        add     rsi, byte 2*SIZEOF_XMMWORD      ; inptr1\n        add     rdi, byte 1*SIZEOF_XMMWORD      ; outptr\n        cmp     rcx, byte SIZEOF_XMMWORD\n        jae     near .columnloop\n        test    rcx,rcx\n        jnz     near .columnloop_r8\n\n        pop     rsi\n        pop     rdi\n        pop     rcx\n\n        add     rsi, byte 2*SIZEOF_JSAMPROW     ; input_data\n        add     rdi, byte 1*SIZEOF_JSAMPROW     ; output_data\n        dec     rax                             ; rowctr\n        jg      near .rowloop\n\n.return:\n        uncollect_args\n        pop     rbp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jcsample-sse2.asm",
    "content": ";\n; jcsample.asm - downsampling (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Downsample pixel values of a single component.\n; This version handles the common case of 2:1 horizontal and 1:1 vertical,\n; without smoothing.\n;\n; GLOBAL(void)\n; jsimd_h2v1_downsample_sse2 (JDIMENSION image_width, int max_v_samp_factor,\n;                             JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n;                             JSAMPARRAY input_data, JSAMPARRAY output_data);\n;\n\n%define img_width(b)    (b)+8           ; JDIMENSION image_width\n%define max_v_samp(b)   (b)+12          ; int max_v_samp_factor\n%define v_samp(b)       (b)+16          ; JDIMENSION v_samp_factor\n%define width_blks(b)   (b)+20          ; JDIMENSION width_blocks\n%define input_data(b)   (b)+24          ; JSAMPARRAY input_data\n%define output_data(b)  (b)+28          ; JSAMPARRAY output_data\n\n        align   16\n        global  EXTN(jsimd_h2v1_downsample_sse2)\n\nEXTN(jsimd_h2v1_downsample_sse2):\n        push    ebp\n        mov     ebp,esp\n;       push    ebx             ; unused\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        mov     ecx, JDIMENSION [width_blks(ebp)]\n        shl     ecx,3                   ; imul ecx,DCTSIZE (ecx = output_cols)\n        jz      near .return\n\n        mov     edx, JDIMENSION [img_width(ebp)]\n\n        ; -- expand_right_edge\n\n        push    ecx\n        shl     ecx,1                           ; output_cols * 2\n        sub     ecx,edx\n        jle     short .expand_end\n\n        mov     eax, INT [max_v_samp(ebp)]\n        test    eax,eax\n        jle     short .expand_end\n\n        cld\n        mov     esi, JSAMPARRAY [input_data(ebp)]       ; input_data\n        alignx  16,7\n.expandloop:\n        push    eax\n        push    ecx\n\n        mov     edi, JSAMPROW [esi]\n        add     edi,edx\n        mov     al, JSAMPLE [edi-1]\n\n        rep stosb\n\n        pop     ecx\n        pop     eax\n\n        add     esi, byte SIZEOF_JSAMPROW\n        dec     eax\n        jg      short .expandloop\n\n.expand_end:\n        pop     ecx                             ; output_cols\n\n        ; -- h2v1_downsample\n\n        mov     eax, JDIMENSION [v_samp(ebp)]   ; rowctr\n        test    eax,eax\n        jle     near .return\n\n        mov     edx, 0x00010000         ; bias pattern\n        movd    xmm7,edx\n        pcmpeqw xmm6,xmm6\n        pshufd  xmm7,xmm7,0x00          ; xmm7={0, 1, 0, 1, 0, 1, 0, 1}\n        psrlw   xmm6,BYTE_BIT           ; xmm6={0xFF 0x00 0xFF 0x00 ..}\n\n        mov     esi, JSAMPARRAY [input_data(ebp)]       ; input_data\n        mov     edi, JSAMPARRAY [output_data(ebp)]      ; output_data\n        alignx  16,7\n.rowloop:\n        push    ecx\n        push    edi\n        push    esi\n\n        mov     esi, JSAMPROW [esi]             ; inptr\n        mov     edi, JSAMPROW [edi]             ; outptr\n\n        cmp     ecx, byte SIZEOF_XMMWORD\n        jae     short .columnloop\n        alignx  16,7\n\n.columnloop_r8:\n        movdqa  xmm0, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        pxor    xmm1,xmm1\n        mov     ecx, SIZEOF_XMMWORD\n        jmp     short .downsample\n        alignx  16,7\n\n.columnloop:\n        movdqa  xmm0, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        movdqa  xmm1, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\n.downsample:\n        movdqa  xmm2,xmm0\n        movdqa  xmm3,xmm1\n\n        pand    xmm0,xmm6\n        psrlw   xmm2,BYTE_BIT\n        pand    xmm1,xmm6\n        psrlw   xmm3,BYTE_BIT\n\n        paddw   xmm0,xmm2\n        paddw   xmm1,xmm3\n        paddw   xmm0,xmm7\n        paddw   xmm1,xmm7\n        psrlw   xmm0,1\n        psrlw   xmm1,1\n\n        packuswb xmm0,xmm1\n\n        movdqa  XMMWORD [edi+0*SIZEOF_XMMWORD], xmm0\n\n        sub     ecx, byte SIZEOF_XMMWORD        ; outcol\n        add     esi, byte 2*SIZEOF_XMMWORD      ; inptr\n        add     edi, byte 1*SIZEOF_XMMWORD      ; outptr\n        cmp     ecx, byte SIZEOF_XMMWORD\n        jae     short .columnloop\n        test    ecx,ecx\n        jnz     short .columnloop_r8\n\n        pop     esi\n        pop     edi\n        pop     ecx\n\n        add     esi, byte SIZEOF_JSAMPROW       ; input_data\n        add     edi, byte SIZEOF_JSAMPROW       ; output_data\n        dec     eax                             ; rowctr\n        jg      near .rowloop\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n;       pop     ebx             ; unused\n        pop     ebp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Downsample pixel values of a single component.\n; This version handles the standard case of 2:1 horizontal and 2:1 vertical,\n; without smoothing.\n;\n; GLOBAL(void)\n; jsimd_h2v2_downsample_sse2 (JDIMENSION image_width, int max_v_samp_factor,\n;                             JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n;                             JSAMPARRAY input_data, JSAMPARRAY output_data);\n;\n\n%define img_width(b)    (b)+8           ; JDIMENSION image_width\n%define max_v_samp(b)   (b)+12          ; int max_v_samp_factor\n%define v_samp(b)       (b)+16          ; JDIMENSION v_samp_factor\n%define width_blks(b)   (b)+20          ; JDIMENSION width_blocks\n%define input_data(b)   (b)+24          ; JSAMPARRAY input_data\n%define output_data(b)  (b)+28          ; JSAMPARRAY output_data\n\n        align   16\n        global  EXTN(jsimd_h2v2_downsample_sse2)\n\nEXTN(jsimd_h2v2_downsample_sse2):\n        push    ebp\n        mov     ebp,esp\n;       push    ebx             ; unused\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        mov     ecx, JDIMENSION [width_blks(ebp)]\n        shl     ecx,3                   ; imul ecx,DCTSIZE (ecx = output_cols)\n        jz      near .return\n\n        mov     edx, JDIMENSION [img_width(ebp)]\n\n        ; -- expand_right_edge\n\n        push    ecx\n        shl     ecx,1                           ; output_cols * 2\n        sub     ecx,edx\n        jle     short .expand_end\n\n        mov     eax, INT [max_v_samp(ebp)]\n        test    eax,eax\n        jle     short .expand_end\n\n        cld\n        mov     esi, JSAMPARRAY [input_data(ebp)]       ; input_data\n        alignx  16,7\n.expandloop:\n        push    eax\n        push    ecx\n\n        mov     edi, JSAMPROW [esi]\n        add     edi,edx\n        mov     al, JSAMPLE [edi-1]\n\n        rep stosb\n\n        pop     ecx\n        pop     eax\n\n        add     esi, byte SIZEOF_JSAMPROW\n        dec     eax\n        jg      short .expandloop\n\n.expand_end:\n        pop     ecx                             ; output_cols\n\n        ; -- h2v2_downsample\n\n        mov     eax, JDIMENSION [v_samp(ebp)]   ; rowctr\n        test    eax,eax\n        jle     near .return\n\n        mov     edx, 0x00020001         ; bias pattern\n        movd    xmm7,edx\n        pcmpeqw xmm6,xmm6\n        pshufd  xmm7,xmm7,0x00          ; xmm7={1, 2, 1, 2, 1, 2, 1, 2}\n        psrlw   xmm6,BYTE_BIT           ; xmm6={0xFF 0x00 0xFF 0x00 ..}\n\n        mov     esi, JSAMPARRAY [input_data(ebp)]       ; input_data\n        mov     edi, JSAMPARRAY [output_data(ebp)]      ; output_data\n        alignx  16,7\n.rowloop:\n        push    ecx\n        push    edi\n        push    esi\n\n        mov     edx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]   ; inptr0\n        mov     esi, JSAMPROW [esi+1*SIZEOF_JSAMPROW]   ; inptr1\n        mov     edi, JSAMPROW [edi]                     ; outptr\n\n        cmp     ecx, byte SIZEOF_XMMWORD\n        jae     short .columnloop\n        alignx  16,7\n\n.columnloop_r8:\n        movdqa  xmm0, XMMWORD [edx+0*SIZEOF_XMMWORD]\n        movdqa  xmm1, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        pxor    xmm2,xmm2\n        pxor    xmm3,xmm3\n        mov     ecx, SIZEOF_XMMWORD\n        jmp     short .downsample\n        alignx  16,7\n\n.columnloop:\n        movdqa  xmm0, XMMWORD [edx+0*SIZEOF_XMMWORD]\n        movdqa  xmm1, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        movdqa  xmm2, XMMWORD [edx+1*SIZEOF_XMMWORD]\n        movdqa  xmm3, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\n.downsample:\n        movdqa  xmm4,xmm0\n        movdqa  xmm5,xmm1\n        pand    xmm0,xmm6\n        psrlw   xmm4,BYTE_BIT\n        pand    xmm1,xmm6\n        psrlw   xmm5,BYTE_BIT\n        paddw   xmm0,xmm4\n        paddw   xmm1,xmm5\n\n        movdqa  xmm4,xmm2\n        movdqa  xmm5,xmm3\n        pand    xmm2,xmm6\n        psrlw   xmm4,BYTE_BIT\n        pand    xmm3,xmm6\n        psrlw   xmm5,BYTE_BIT\n        paddw   xmm2,xmm4\n        paddw   xmm3,xmm5\n\n        paddw   xmm0,xmm1\n        paddw   xmm2,xmm3\n        paddw   xmm0,xmm7\n        paddw   xmm2,xmm7\n        psrlw   xmm0,2\n        psrlw   xmm2,2\n\n        packuswb xmm0,xmm2\n\n        movdqa  XMMWORD [edi+0*SIZEOF_XMMWORD], xmm0\n\n        sub     ecx, byte SIZEOF_XMMWORD        ; outcol\n        add     edx, byte 2*SIZEOF_XMMWORD      ; inptr0\n        add     esi, byte 2*SIZEOF_XMMWORD      ; inptr1\n        add     edi, byte 1*SIZEOF_XMMWORD      ; outptr\n        cmp     ecx, byte SIZEOF_XMMWORD\n        jae     near .columnloop\n        test    ecx,ecx\n        jnz     near .columnloop_r8\n\n        pop     esi\n        pop     edi\n        pop     ecx\n\n        add     esi, byte 2*SIZEOF_JSAMPROW     ; input_data\n        add     edi, byte 1*SIZEOF_JSAMPROW     ; output_data\n        dec     eax                             ; rowctr\n        jg      near .rowloop\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n;       pop     ebx             ; unused\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jcsample.h",
    "content": "/*\n * jcsample.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n */\n\nLOCAL(void)\nexpand_right_edge (JSAMPARRAY image_data, int num_rows,\n                   JDIMENSION input_cols, JDIMENSION output_cols)\n{\n  register JSAMPROW ptr;\n  register JSAMPLE pixval;\n  register int count;\n  int row;\n  int numcols = (int) (output_cols - input_cols);\n\n  if (numcols > 0) {\n    for (row = 0; row < num_rows; row++) {\n      ptr = image_data[row] + input_cols;\n      pixval = ptr[-1];         /* don't need GETJSAMPLE() here */\n      for (count = numcols; count > 0; count--)\n        *ptr++ = pixval;\n    }\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdcolext-altivec.c",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2015, D. R. Commander.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n/* This file is included by jdcolor-altivec.c */\n\n\nvoid jsimd_ycc_rgb_convert_altivec (JDIMENSION out_width, JSAMPIMAGE input_buf,\n                                    JDIMENSION input_row,\n                                    JSAMPARRAY output_buf, int num_rows)\n{\n  JSAMPROW outptr, inptr0, inptr1, inptr2;\n  int pitch = out_width * RGB_PIXELSIZE, num_cols;\n#if __BIG_ENDIAN__\n  int offset;\n#endif\n  unsigned char __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16];\n\n  __vector unsigned char rgb0, rgb1, rgb2, rgbx0, rgbx1, rgbx2, rgbx3,\n    y, cb, cr;\n#if __BIG_ENDIAN__\n  __vector unsigned char edgel, edgeh, edges, out0, out1, out2, out3;\n#if RGB_PIXELSIZE == 4\n  __vector unsigned char out4;\n#endif\n#endif\n#if RGB_PIXELSIZE == 4\n  __vector unsigned char rgb3;\n#endif\n  __vector short rg0, rg1, rg2, rg3, bx0, bx1, bx2, bx3, yl, yh, cbl, cbh,\n    crl, crh, rl, rh, gl, gh, bl, bh, g0w, g1w, g2w, g3w;\n  __vector int g0, g1, g2, g3;\n\n  /* Constants\n   * NOTE: The >> 1 is to compensate for the fact that vec_madds() returns 17\n   * high-order bits, not 16.\n   */\n  __vector short pw_f0402 = { __8X(F_0_402 >> 1) },\n    pw_mf0228 = { __8X(-F_0_228 >> 1) },\n    pw_mf0344_f0285 = { __4X2(-F_0_344, F_0_285) },\n    pw_one = { __8X(1) }, pw_255 = { __8X(255) },\n    pw_cj = { __8X(CENTERJSAMPLE) };\n  __vector int pd_onehalf = { __4X(ONE_HALF) };\n  __vector unsigned char pb_zero = { __16X(0) },\n#if __BIG_ENDIAN__\n    shift_pack_index = {0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29};\n#else\n    shift_pack_index = {2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31};\n#endif\n\n  while (--num_rows >= 0) {\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n\n    for (num_cols = pitch; num_cols > 0;\n         num_cols -= RGB_PIXELSIZE * 16, outptr += RGB_PIXELSIZE * 16,\n         inptr0 += 16, inptr1 += 16, inptr2 += 16) {\n\n      y = vec_ld(0, inptr0);\n      /* NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't\n       * support unsigned vectors.\n       */\n      yl = (__vector signed short)VEC_UNPACKHU(y);\n      yh = (__vector signed short)VEC_UNPACKLU(y);\n\n      cb = vec_ld(0, inptr1);\n      cbl = (__vector signed short)VEC_UNPACKHU(cb);\n      cbh = (__vector signed short)VEC_UNPACKLU(cb);\n      cbl = vec_sub(cbl, pw_cj);\n      cbh = vec_sub(cbh, pw_cj);\n\n      cr = vec_ld(0, inptr2);\n      crl = (__vector signed short)VEC_UNPACKHU(cr);\n      crh = (__vector signed short)VEC_UNPACKLU(cr);\n      crl = vec_sub(crl, pw_cj);\n      crh = vec_sub(crh, pw_cj);\n\n      /* (Original)\n       * R = Y                + 1.40200 * Cr\n       * G = Y - 0.34414 * Cb - 0.71414 * Cr\n       * B = Y + 1.77200 * Cb\n       *\n       * (This implementation)\n       * R = Y                + 0.40200 * Cr + Cr\n       * G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr\n       * B = Y - 0.22800 * Cb + Cb + Cb\n       */\n      bl = vec_add(cbl, cbl);\n      bh = vec_add(cbh, cbh);\n      bl = vec_madds(bl, pw_mf0228, pw_one);\n      bh = vec_madds(bh, pw_mf0228, pw_one);\n      bl = vec_sra(bl, (__vector unsigned short)pw_one);\n      bh = vec_sra(bh, (__vector unsigned short)pw_one);\n      bl = vec_add(bl, cbl);\n      bh = vec_add(bh, cbh);\n      bl = vec_add(bl, cbl);\n      bh = vec_add(bh, cbh);\n      bl = vec_add(bl, yl);\n      bh = vec_add(bh, yh);\n\n      rl = vec_add(crl, crl);\n      rh = vec_add(crh, crh);\n      rl = vec_madds(rl, pw_f0402, pw_one);\n      rh = vec_madds(rh, pw_f0402, pw_one);\n      rl = vec_sra(rl, (__vector unsigned short)pw_one);\n      rh = vec_sra(rh, (__vector unsigned short)pw_one);\n      rl = vec_add(rl, crl);\n      rh = vec_add(rh, crh);\n      rl = vec_add(rl, yl);\n      rh = vec_add(rh, yh);\n\n      g0w = vec_mergeh(cbl, crl);\n      g1w = vec_mergel(cbl, crl);\n      g0 = vec_msums(g0w, pw_mf0344_f0285, pd_onehalf);\n      g1 = vec_msums(g1w, pw_mf0344_f0285, pd_onehalf);\n      g2w = vec_mergeh(cbh, crh);\n      g3w = vec_mergel(cbh, crh);\n      g2 = vec_msums(g2w, pw_mf0344_f0285, pd_onehalf);\n      g3 = vec_msums(g3w, pw_mf0344_f0285, pd_onehalf);\n      /* Clever way to avoid 4 shifts + 2 packs.  This packs the high word from\n       * each dword into a new 16-bit vector, which is the equivalent of\n       * descaling the 32-bit results (right-shifting by 16 bits) and then\n       * packing them.\n       */\n      gl = vec_perm((__vector short)g0, (__vector short)g1, shift_pack_index);\n      gh = vec_perm((__vector short)g2, (__vector short)g3, shift_pack_index);\n      gl = vec_sub(gl, crl);\n      gh = vec_sub(gh, crh);\n      gl = vec_add(gl, yl);\n      gh = vec_add(gh, yh);\n\n      rg0 = vec_mergeh(rl, gl);\n      bx0 = vec_mergeh(bl, pw_255);\n      rg1 = vec_mergel(rl, gl);\n      bx1 = vec_mergel(bl, pw_255);\n      rg2 = vec_mergeh(rh, gh);\n      bx2 = vec_mergeh(bh, pw_255);\n      rg3 = vec_mergel(rh, gh);\n      bx3 = vec_mergel(bh, pw_255);\n\n      rgbx0 = vec_packsu(rg0, bx0);\n      rgbx1 = vec_packsu(rg1, bx1);\n      rgbx2 = vec_packsu(rg2, bx2);\n      rgbx3 = vec_packsu(rg3, bx3);\n\n#if RGB_PIXELSIZE == 3\n      /* rgbx0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 X0 B1 X1 B2 X2 B3 X3\n       * rgbx1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 X4 B5 X5 B6 X6 B7 X7\n       * rgbx2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 X8 B9 X9 Ba Xa Bb Xb\n       * rgbx3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Xc Bd Xd Be Xe Bf Xf\n       *\n       * rgb0 = R0 G0 B0 R1 G1 B1 R2 G2 B2 R3 G3 B3 R4 G4 B4 R5\n       * rgb1 = G5 B5 R6 G6 B6 R7 G7 B7 R8 G8 B8 R9 G9 B9 Ra Ga\n       * rgb2 = Ba Rb Gb Bb Rc Gc Bc Rd Gd Bd Re Ge Be Rf Gf Bf\n       */\n      rgb0 = vec_perm(rgbx0, rgbx1, (__vector unsigned char)RGB_INDEX0);\n      rgb1 = vec_perm(rgbx1, rgbx2, (__vector unsigned char)RGB_INDEX1);\n      rgb2 = vec_perm(rgbx2, rgbx3, (__vector unsigned char)RGB_INDEX2);\n#else\n      /* rgbx0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 X0 B1 X1 B2 X2 B3 X3\n       * rgbx1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 X4 B5 X5 B6 X6 B7 X7\n       * rgbx2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 X8 B9 X9 Ba Xa Bb Xb\n       * rgbx3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Xc Bd Xd Be Xe Bf Xf\n       *\n       * rgb0 = R0 G0 B0 X0 R1 G1 B1 X1 R2 G2 B2 X2 R3 G3 B3 X3\n       * rgb1 = R4 G4 B4 X4 R5 G5 B5 X5 R6 G6 B6 X6 R7 G7 B7 X7\n       * rgb2 = R8 G8 B8 X8 R9 G9 B9 X9 Ra Ga Ba Xa Rb Gb Bb Xb\n       * rgb3 = Rc Gc Bc Xc Rd Gd Bd Xd Re Ge Be Xe Rf Gf Bf Xf\n       */\n      rgb0 = vec_perm(rgbx0, rgbx0, (__vector unsigned char)RGB_INDEX);\n      rgb1 = vec_perm(rgbx1, rgbx1, (__vector unsigned char)RGB_INDEX);\n      rgb2 = vec_perm(rgbx2, rgbx2, (__vector unsigned char)RGB_INDEX);\n      rgb3 = vec_perm(rgbx3, rgbx3, (__vector unsigned char)RGB_INDEX);\n#endif\n\n#if __BIG_ENDIAN__\n      offset = (size_t)outptr & 15;\n      if (offset) {\n        __vector unsigned char unaligned_shift_index;\n        int bytes = num_cols + offset;\n\n        if (bytes < (RGB_PIXELSIZE + 1) * 16 && (bytes & 15)) {\n          /* Slow path to prevent buffer overwrite.  Since there is no way to\n           * write a partial AltiVec register, overwrite would occur on the\n           * last chunk of the last image row if the right edge is not on a\n           * 16-byte boundary.  It could also occur on other rows if the bytes\n           * per row is low enough.  Since we can't determine whether we're on\n           * the last image row, we have to assume every row is the last.\n           */\n          vec_st(rgb0, 0, tmpbuf);\n          vec_st(rgb1, 16, tmpbuf);\n          vec_st(rgb2, 32, tmpbuf);\n#if RGB_PIXELSIZE == 4\n          vec_st(rgb3, 48, tmpbuf);\n#endif\n          memcpy(outptr, tmpbuf, min(num_cols, RGB_PIXELSIZE * 16));\n        } else {\n          /* Fast path */\n          unaligned_shift_index = vec_lvsl(0, outptr);\n          edgel = vec_ld(0, outptr);\n          edgeh = vec_ld(min(num_cols - 1, RGB_PIXELSIZE * 16), outptr);\n          edges = vec_perm(edgeh, edgel, unaligned_shift_index);\n          unaligned_shift_index = vec_lvsr(0, outptr);\n          out0 = vec_perm(edges, rgb0, unaligned_shift_index);\n          out1 = vec_perm(rgb0, rgb1, unaligned_shift_index);\n          out2 = vec_perm(rgb1, rgb2, unaligned_shift_index);\n#if RGB_PIXELSIZE == 4\n          out3 = vec_perm(rgb2, rgb3, unaligned_shift_index);\n          out4 = vec_perm(rgb3, edges, unaligned_shift_index);\n#else\n          out3 = vec_perm(rgb2, edges, unaligned_shift_index);\n#endif\n          vec_st(out0, 0, outptr);\n          if (bytes > 16)\n            vec_st(out1, 16, outptr);\n          if (bytes > 32)\n            vec_st(out2, 32, outptr);\n          if (bytes > 48)\n            vec_st(out3, 48, outptr);\n#if RGB_PIXELSIZE == 4\n          if (bytes > 64)\n            vec_st(out4, 64, outptr);\n#endif\n        }\n      } else {\n#endif /* __BIG_ENDIAN__ */\n        if (num_cols < RGB_PIXELSIZE * 16 && (num_cols & 15)) {\n          /* Slow path */\n          VEC_ST(rgb0, 0, tmpbuf);\n          VEC_ST(rgb1, 16, tmpbuf);\n          VEC_ST(rgb2, 32, tmpbuf);\n#if RGB_PIXELSIZE == 4\n          VEC_ST(rgb3, 48, tmpbuf);\n#endif\n          memcpy(outptr, tmpbuf, min(num_cols, RGB_PIXELSIZE * 16));\n        } else {\n          /* Fast path */\n          VEC_ST(rgb0, 0, outptr);\n          if (num_cols > 16)\n            VEC_ST(rgb1, 16, outptr);\n          if (num_cols > 32)\n            VEC_ST(rgb2, 32, outptr);\n#if RGB_PIXELSIZE == 4\n          if (num_cols > 48)\n            VEC_ST(rgb3, 48, outptr);\n#endif\n        }\n#if __BIG_ENDIAN__\n      }\n#endif\n    }\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdcolext-mmx.asm",
    "content": ";\n; jdcolext.asm - colorspace conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_ycc_rgb_convert_mmx (JDIMENSION out_width,\n;                            JSAMPIMAGE input_buf, JDIMENSION input_row,\n;                            JSAMPARRAY output_buf, int num_rows)\n;\n\n%define out_width(b)    (b)+8           ; JDIMENSION out_width\n%define input_buf(b)    (b)+12          ; JSAMPIMAGE input_buf\n%define input_row(b)    (b)+16          ; JDIMENSION input_row\n%define output_buf(b)   (b)+20          ; JSAMPARRAY output_buf\n%define num_rows(b)     (b)+24          ; int num_rows\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_MMWORD  ; mmword wk[WK_NUM]\n%define WK_NUM          2\n%define gotptr          wk(0)-SIZEOF_POINTER    ; void * gotptr\n\n        align   16\n        global  EXTN(jsimd_ycc_rgb_convert_mmx)\n\nEXTN(jsimd_ycc_rgb_convert_mmx):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_MMWORD)      ; align to 64 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic eax             ; make a room for GOT address\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx                     ; get GOT address\n        movpic  POINTER [gotptr], ebx   ; save GOT address\n\n        mov     ecx, JDIMENSION [out_width(eax)]        ; num_cols\n        test    ecx,ecx\n        jz      near .return\n\n        push    ecx\n\n        mov     edi, JSAMPIMAGE [input_buf(eax)]\n        mov     ecx, JDIMENSION [input_row(eax)]\n        mov     esi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY]\n        mov     ebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY]\n        mov     edx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY]\n        lea     esi, [esi+ecx*SIZEOF_JSAMPROW]\n        lea     ebx, [ebx+ecx*SIZEOF_JSAMPROW]\n        lea     edx, [edx+ecx*SIZEOF_JSAMPROW]\n\n        pop     ecx\n\n        mov     edi, JSAMPARRAY [output_buf(eax)]\n        mov     eax, INT [num_rows(eax)]\n        test    eax,eax\n        jle     near .return\n        alignx  16,7\n.rowloop:\n        push    eax\n        push    edi\n        push    edx\n        push    ebx\n        push    esi\n        push    ecx                     ; col\n\n        mov     esi, JSAMPROW [esi]     ; inptr0\n        mov     ebx, JSAMPROW [ebx]     ; inptr1\n        mov     edx, JSAMPROW [edx]     ; inptr2\n        mov     edi, JSAMPROW [edi]     ; outptr\n        movpic  eax, POINTER [gotptr]   ; load GOT address (eax)\n        alignx  16,7\n.columnloop:\n\n        movq    mm5, MMWORD [ebx]       ; mm5=Cb(01234567)\n        movq    mm1, MMWORD [edx]       ; mm1=Cr(01234567)\n\n        pcmpeqw mm4,mm4\n        pcmpeqw mm7,mm7\n        psrlw   mm4,BYTE_BIT\n        psllw   mm7,7                   ; mm7={0xFF80 0xFF80 0xFF80 0xFF80}\n        movq    mm0,mm4                 ; mm0=mm4={0xFF 0x00 0xFF 0x00 ..}\n\n        pand    mm4,mm5                 ; mm4=Cb(0246)=CbE\n        psrlw   mm5,BYTE_BIT            ; mm5=Cb(1357)=CbO\n        pand    mm0,mm1                 ; mm0=Cr(0246)=CrE\n        psrlw   mm1,BYTE_BIT            ; mm1=Cr(1357)=CrO\n\n        paddw   mm4,mm7\n        paddw   mm5,mm7\n        paddw   mm0,mm7\n        paddw   mm1,mm7\n\n        ; (Original)\n        ; R = Y                + 1.40200 * Cr\n        ; G = Y - 0.34414 * Cb - 0.71414 * Cr\n        ; B = Y + 1.77200 * Cb\n        ;\n        ; (This implementation)\n        ; R = Y                + 0.40200 * Cr + Cr\n        ; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr\n        ; B = Y - 0.22800 * Cb + Cb + Cb\n\n        movq    mm2,mm4                 ; mm2=CbE\n        movq    mm3,mm5                 ; mm3=CbO\n        paddw   mm4,mm4                 ; mm4=2*CbE\n        paddw   mm5,mm5                 ; mm5=2*CbO\n        movq    mm6,mm0                 ; mm6=CrE\n        movq    mm7,mm1                 ; mm7=CrO\n        paddw   mm0,mm0                 ; mm0=2*CrE\n        paddw   mm1,mm1                 ; mm1=2*CrO\n\n        pmulhw  mm4,[GOTOFF(eax,PW_MF0228)]     ; mm4=(2*CbE * -FIX(0.22800))\n        pmulhw  mm5,[GOTOFF(eax,PW_MF0228)]     ; mm5=(2*CbO * -FIX(0.22800))\n        pmulhw  mm0,[GOTOFF(eax,PW_F0402)]      ; mm0=(2*CrE * FIX(0.40200))\n        pmulhw  mm1,[GOTOFF(eax,PW_F0402)]      ; mm1=(2*CrO * FIX(0.40200))\n\n        paddw   mm4,[GOTOFF(eax,PW_ONE)]\n        paddw   mm5,[GOTOFF(eax,PW_ONE)]\n        psraw   mm4,1                   ; mm4=(CbE * -FIX(0.22800))\n        psraw   mm5,1                   ; mm5=(CbO * -FIX(0.22800))\n        paddw   mm0,[GOTOFF(eax,PW_ONE)]\n        paddw   mm1,[GOTOFF(eax,PW_ONE)]\n        psraw   mm0,1                   ; mm0=(CrE * FIX(0.40200))\n        psraw   mm1,1                   ; mm1=(CrO * FIX(0.40200))\n\n        paddw   mm4,mm2\n        paddw   mm5,mm3\n        paddw   mm4,mm2                 ; mm4=(CbE * FIX(1.77200))=(B-Y)E\n        paddw   mm5,mm3                 ; mm5=(CbO * FIX(1.77200))=(B-Y)O\n        paddw   mm0,mm6                 ; mm0=(CrE * FIX(1.40200))=(R-Y)E\n        paddw   mm1,mm7                 ; mm1=(CrO * FIX(1.40200))=(R-Y)O\n\n        movq    MMWORD [wk(0)], mm4     ; wk(0)=(B-Y)E\n        movq    MMWORD [wk(1)], mm5     ; wk(1)=(B-Y)O\n\n        movq      mm4,mm2\n        movq      mm5,mm3\n        punpcklwd mm2,mm6\n        punpckhwd mm4,mm6\n        pmaddwd   mm2,[GOTOFF(eax,PW_MF0344_F0285)]\n        pmaddwd   mm4,[GOTOFF(eax,PW_MF0344_F0285)]\n        punpcklwd mm3,mm7\n        punpckhwd mm5,mm7\n        pmaddwd   mm3,[GOTOFF(eax,PW_MF0344_F0285)]\n        pmaddwd   mm5,[GOTOFF(eax,PW_MF0344_F0285)]\n\n        paddd     mm2,[GOTOFF(eax,PD_ONEHALF)]\n        paddd     mm4,[GOTOFF(eax,PD_ONEHALF)]\n        psrad     mm2,SCALEBITS\n        psrad     mm4,SCALEBITS\n        paddd     mm3,[GOTOFF(eax,PD_ONEHALF)]\n        paddd     mm5,[GOTOFF(eax,PD_ONEHALF)]\n        psrad     mm3,SCALEBITS\n        psrad     mm5,SCALEBITS\n\n        packssdw  mm2,mm4       ; mm2=CbE*-FIX(0.344)+CrE*FIX(0.285)\n        packssdw  mm3,mm5       ; mm3=CbO*-FIX(0.344)+CrO*FIX(0.285)\n        psubw     mm2,mm6       ; mm2=CbE*-FIX(0.344)+CrE*-FIX(0.714)=(G-Y)E\n        psubw     mm3,mm7       ; mm3=CbO*-FIX(0.344)+CrO*-FIX(0.714)=(G-Y)O\n\n        movq      mm5, MMWORD [esi]     ; mm5=Y(01234567)\n\n        pcmpeqw   mm4,mm4\n        psrlw     mm4,BYTE_BIT          ; mm4={0xFF 0x00 0xFF 0x00 ..}\n        pand      mm4,mm5               ; mm4=Y(0246)=YE\n        psrlw     mm5,BYTE_BIT          ; mm5=Y(1357)=YO\n\n        paddw     mm0,mm4               ; mm0=((R-Y)E+YE)=RE=(R0 R2 R4 R6)\n        paddw     mm1,mm5               ; mm1=((R-Y)O+YO)=RO=(R1 R3 R5 R7)\n        packuswb  mm0,mm0               ; mm0=(R0 R2 R4 R6 ** ** ** **)\n        packuswb  mm1,mm1               ; mm1=(R1 R3 R5 R7 ** ** ** **)\n\n        paddw     mm2,mm4               ; mm2=((G-Y)E+YE)=GE=(G0 G2 G4 G6)\n        paddw     mm3,mm5               ; mm3=((G-Y)O+YO)=GO=(G1 G3 G5 G7)\n        packuswb  mm2,mm2               ; mm2=(G0 G2 G4 G6 ** ** ** **)\n        packuswb  mm3,mm3               ; mm3=(G1 G3 G5 G7 ** ** ** **)\n\n        paddw     mm4, MMWORD [wk(0)]   ; mm4=(YE+(B-Y)E)=BE=(B0 B2 B4 B6)\n        paddw     mm5, MMWORD [wk(1)]   ; mm5=(YO+(B-Y)O)=BO=(B1 B3 B5 B7)\n        packuswb  mm4,mm4               ; mm4=(B0 B2 B4 B6 ** ** ** **)\n        packuswb  mm5,mm5               ; mm5=(B1 B3 B5 B7 ** ** ** **)\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n        ; mmA=(00 02 04 06 ** ** ** **), mmB=(01 03 05 07 ** ** ** **)\n        ; mmC=(10 12 14 16 ** ** ** **), mmD=(11 13 15 17 ** ** ** **)\n        ; mmE=(20 22 24 26 ** ** ** **), mmF=(21 23 25 27 ** ** ** **)\n        ; mmG=(** ** ** ** ** ** ** **), mmH=(** ** ** ** ** ** ** **)\n\n        punpcklbw mmA,mmC               ; mmA=(00 10 02 12 04 14 06 16)\n        punpcklbw mmE,mmB               ; mmE=(20 01 22 03 24 05 26 07)\n        punpcklbw mmD,mmF               ; mmD=(11 21 13 23 15 25 17 27)\n\n        movq      mmG,mmA\n        movq      mmH,mmA\n        punpcklwd mmA,mmE               ; mmA=(00 10 20 01 02 12 22 03)\n        punpckhwd mmG,mmE               ; mmG=(04 14 24 05 06 16 26 07)\n\n        psrlq     mmH,2*BYTE_BIT        ; mmH=(02 12 04 14 06 16 -- --)\n        psrlq     mmE,2*BYTE_BIT        ; mmE=(22 03 24 05 26 07 -- --)\n\n        movq      mmC,mmD\n        movq      mmB,mmD\n        punpcklwd mmD,mmH               ; mmD=(11 21 02 12 13 23 04 14)\n        punpckhwd mmC,mmH               ; mmC=(15 25 06 16 17 27 -- --)\n\n        psrlq     mmB,2*BYTE_BIT        ; mmB=(13 23 15 25 17 27 -- --)\n\n        movq      mmF,mmE\n        punpcklwd mmE,mmB               ; mmE=(22 03 13 23 24 05 15 25)\n        punpckhwd mmF,mmB               ; mmF=(26 07 17 27 -- -- -- --)\n\n        punpckldq mmA,mmD               ; mmA=(00 10 20 01 11 21 02 12)\n        punpckldq mmE,mmG               ; mmE=(22 03 13 23 04 14 24 05)\n        punpckldq mmC,mmF               ; mmC=(15 25 06 16 26 07 17 27)\n\n        cmp     ecx, byte SIZEOF_MMWORD\n        jb      short .column_st16\n\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mmA\n        movq    MMWORD [edi+1*SIZEOF_MMWORD], mmE\n        movq    MMWORD [edi+2*SIZEOF_MMWORD], mmC\n\n        sub     ecx, byte SIZEOF_MMWORD\n        jz      short .nextrow\n\n        add     esi, byte SIZEOF_MMWORD                 ; inptr0\n        add     ebx, byte SIZEOF_MMWORD                 ; inptr1\n        add     edx, byte SIZEOF_MMWORD                 ; inptr2\n        add     edi, byte RGB_PIXELSIZE*SIZEOF_MMWORD   ; outptr\n        jmp     near .columnloop\n        alignx  16,7\n\n.column_st16:\n        lea     ecx, [ecx+ecx*2]        ; imul ecx, RGB_PIXELSIZE\n        cmp     ecx, byte 2*SIZEOF_MMWORD\n        jb      short .column_st8\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mmA\n        movq    MMWORD [edi+1*SIZEOF_MMWORD], mmE\n        movq    mmA,mmC\n        sub     ecx, byte 2*SIZEOF_MMWORD\n        add     edi, byte 2*SIZEOF_MMWORD\n        jmp     short .column_st4\n.column_st8:\n        cmp     ecx, byte SIZEOF_MMWORD\n        jb      short .column_st4\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mmA\n        movq    mmA,mmE\n        sub     ecx, byte SIZEOF_MMWORD\n        add     edi, byte SIZEOF_MMWORD\n.column_st4:\n        movd    eax,mmA\n        cmp     ecx, byte SIZEOF_DWORD\n        jb      short .column_st2\n        mov     DWORD [edi+0*SIZEOF_DWORD], eax\n        psrlq   mmA,DWORD_BIT\n        movd    eax,mmA\n        sub     ecx, byte SIZEOF_DWORD\n        add     edi, byte SIZEOF_DWORD\n.column_st2:\n        cmp     ecx, byte SIZEOF_WORD\n        jb      short .column_st1\n        mov     WORD [edi+0*SIZEOF_WORD], ax\n        shr     eax,WORD_BIT\n        sub     ecx, byte SIZEOF_WORD\n        add     edi, byte SIZEOF_WORD\n.column_st1:\n        cmp     ecx, byte SIZEOF_BYTE\n        jb      short .nextrow\n        mov     BYTE [edi+0*SIZEOF_BYTE], al\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n%ifdef RGBX_FILLER_0XFF\n        pcmpeqb   mm6,mm6               ; mm6=(X0 X2 X4 X6 ** ** ** **)\n        pcmpeqb   mm7,mm7               ; mm7=(X1 X3 X5 X7 ** ** ** **)\n%else\n        pxor      mm6,mm6               ; mm6=(X0 X2 X4 X6 ** ** ** **)\n        pxor      mm7,mm7               ; mm7=(X1 X3 X5 X7 ** ** ** **)\n%endif\n        ; mmA=(00 02 04 06 ** ** ** **), mmB=(01 03 05 07 ** ** ** **)\n        ; mmC=(10 12 14 16 ** ** ** **), mmD=(11 13 15 17 ** ** ** **)\n        ; mmE=(20 22 24 26 ** ** ** **), mmF=(21 23 25 27 ** ** ** **)\n        ; mmG=(30 32 34 36 ** ** ** **), mmH=(31 33 35 37 ** ** ** **)\n\n        punpcklbw mmA,mmC               ; mmA=(00 10 02 12 04 14 06 16)\n        punpcklbw mmE,mmG               ; mmE=(20 30 22 32 24 34 26 36)\n        punpcklbw mmB,mmD               ; mmB=(01 11 03 13 05 15 07 17)\n        punpcklbw mmF,mmH               ; mmF=(21 31 23 33 25 35 27 37)\n\n        movq      mmC,mmA\n        punpcklwd mmA,mmE               ; mmA=(00 10 20 30 02 12 22 32)\n        punpckhwd mmC,mmE               ; mmC=(04 14 24 34 06 16 26 36)\n        movq      mmG,mmB\n        punpcklwd mmB,mmF               ; mmB=(01 11 21 31 03 13 23 33)\n        punpckhwd mmG,mmF               ; mmG=(05 15 25 35 07 17 27 37)\n\n        movq      mmD,mmA\n        punpckldq mmA,mmB               ; mmA=(00 10 20 30 01 11 21 31)\n        punpckhdq mmD,mmB               ; mmD=(02 12 22 32 03 13 23 33)\n        movq      mmH,mmC\n        punpckldq mmC,mmG               ; mmC=(04 14 24 34 05 15 25 35)\n        punpckhdq mmH,mmG               ; mmH=(06 16 26 36 07 17 27 37)\n\n        cmp     ecx, byte SIZEOF_MMWORD\n        jb      short .column_st16\n\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mmA\n        movq    MMWORD [edi+1*SIZEOF_MMWORD], mmD\n        movq    MMWORD [edi+2*SIZEOF_MMWORD], mmC\n        movq    MMWORD [edi+3*SIZEOF_MMWORD], mmH\n\n        sub     ecx, byte SIZEOF_MMWORD\n        jz      short .nextrow\n\n        add     esi, byte SIZEOF_MMWORD                 ; inptr0\n        add     ebx, byte SIZEOF_MMWORD                 ; inptr1\n        add     edx, byte SIZEOF_MMWORD                 ; inptr2\n        add     edi, byte RGB_PIXELSIZE*SIZEOF_MMWORD   ; outptr\n        jmp     near .columnloop\n        alignx  16,7\n\n.column_st16:\n        cmp     ecx, byte SIZEOF_MMWORD/2\n        jb      short .column_st8\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mmA\n        movq    MMWORD [edi+1*SIZEOF_MMWORD], mmD\n        movq    mmA,mmC\n        movq    mmD,mmH\n        sub     ecx, byte SIZEOF_MMWORD/2\n        add     edi, byte 2*SIZEOF_MMWORD\n.column_st8:\n        cmp     ecx, byte SIZEOF_MMWORD/4\n        jb      short .column_st4\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mmA\n        movq    mmA,mmD\n        sub     ecx, byte SIZEOF_MMWORD/4\n        add     edi, byte 1*SIZEOF_MMWORD\n.column_st4:\n        cmp     ecx, byte SIZEOF_MMWORD/8\n        jb      short .nextrow\n        movd    DWORD [edi+0*SIZEOF_DWORD], mmA\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n        alignx  16,7\n\n.nextrow:\n        pop     ecx\n        pop     esi\n        pop     ebx\n        pop     edx\n        pop     edi\n        pop     eax\n\n        add     esi, byte SIZEOF_JSAMPROW\n        add     ebx, byte SIZEOF_JSAMPROW\n        add     edx, byte SIZEOF_JSAMPROW\n        add     edi, byte SIZEOF_JSAMPROW       ; output_buf\n        dec     eax                             ; num_rows\n        jg      near .rowloop\n\n        emms            ; empty MMX state\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdcolext-sse2-64.asm",
    "content": ";\n; jdcolext.asm - colorspace conversion (64-bit SSE2)\n;\n; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, 2012, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_ycc_rgb_convert_sse2 (JDIMENSION out_width,\n;                             JSAMPIMAGE input_buf, JDIMENSION input_row,\n;                             JSAMPARRAY output_buf, int num_rows)\n;\n\n; r10 = JDIMENSION out_width\n; r11 = JSAMPIMAGE input_buf\n; r12 = JDIMENSION input_row\n; r13 = JSAMPARRAY output_buf\n; r14 = int num_rows\n\n%define wk(i)           rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          2\n\n        align   16\n        global  EXTN(jsimd_ycc_rgb_convert_sse2)\n\nEXTN(jsimd_ycc_rgb_convert_sse2):\n        push    rbp\n        mov     rax,rsp                         ; rax = original rbp\n        sub     rsp, byte 4\n        and     rsp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [rsp],rax\n        mov     rbp,rsp                         ; rbp = aligned rbp\n        lea     rsp, [wk(0)]\n        collect_args\n        push    rbx\n\n        mov     ecx, r10d        ; num_cols\n        test    rcx,rcx\n        jz      near .return\n\n        push    rcx\n\n        mov     rdi, r11\n        mov     ecx, r12d\n        mov     rsi, JSAMPARRAY [rdi+0*SIZEOF_JSAMPARRAY]\n        mov     rbx, JSAMPARRAY [rdi+1*SIZEOF_JSAMPARRAY]\n        mov     rdx, JSAMPARRAY [rdi+2*SIZEOF_JSAMPARRAY]\n        lea     rsi, [rsi+rcx*SIZEOF_JSAMPROW]\n        lea     rbx, [rbx+rcx*SIZEOF_JSAMPROW]\n        lea     rdx, [rdx+rcx*SIZEOF_JSAMPROW]\n\n        pop     rcx\n\n        mov     rdi, r13\n        mov     eax, r14d\n        test    rax,rax\n        jle     near .return\n.rowloop:\n        push    rax\n        push    rdi\n        push    rdx\n        push    rbx\n        push    rsi\n        push    rcx                     ; col\n\n        mov     rsi, JSAMPROW [rsi]     ; inptr0\n        mov     rbx, JSAMPROW [rbx]     ; inptr1\n        mov     rdx, JSAMPROW [rdx]     ; inptr2\n        mov     rdi, JSAMPROW [rdi]     ; outptr\n.columnloop:\n\n        movdqa  xmm5, XMMWORD [rbx]     ; xmm5=Cb(0123456789ABCDEF)\n        movdqa  xmm1, XMMWORD [rdx]     ; xmm1=Cr(0123456789ABCDEF)\n\n        pcmpeqw xmm4,xmm4\n        pcmpeqw xmm7,xmm7\n        psrlw   xmm4,BYTE_BIT\n        psllw   xmm7,7                  ; xmm7={0xFF80 0xFF80 0xFF80 0xFF80 ..}\n        movdqa  xmm0,xmm4               ; xmm0=xmm4={0xFF 0x00 0xFF 0x00 ..}\n\n        pand    xmm4,xmm5               ; xmm4=Cb(02468ACE)=CbE\n        psrlw   xmm5,BYTE_BIT           ; xmm5=Cb(13579BDF)=CbO\n        pand    xmm0,xmm1               ; xmm0=Cr(02468ACE)=CrE\n        psrlw   xmm1,BYTE_BIT           ; xmm1=Cr(13579BDF)=CrO\n\n        paddw   xmm4,xmm7\n        paddw   xmm5,xmm7\n        paddw   xmm0,xmm7\n        paddw   xmm1,xmm7\n\n        ; (Original)\n        ; R = Y                + 1.40200 * Cr\n        ; G = Y - 0.34414 * Cb - 0.71414 * Cr\n        ; B = Y + 1.77200 * Cb\n        ;\n        ; (This implementation)\n        ; R = Y                + 0.40200 * Cr + Cr\n        ; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr\n        ; B = Y - 0.22800 * Cb + Cb + Cb\n\n        movdqa  xmm2,xmm4               ; xmm2=CbE\n        movdqa  xmm3,xmm5               ; xmm3=CbO\n        paddw   xmm4,xmm4               ; xmm4=2*CbE\n        paddw   xmm5,xmm5               ; xmm5=2*CbO\n        movdqa  xmm6,xmm0               ; xmm6=CrE\n        movdqa  xmm7,xmm1               ; xmm7=CrO\n        paddw   xmm0,xmm0               ; xmm0=2*CrE\n        paddw   xmm1,xmm1               ; xmm1=2*CrO\n\n        pmulhw  xmm4,[rel PW_MF0228]    ; xmm4=(2*CbE * -FIX(0.22800))\n        pmulhw  xmm5,[rel PW_MF0228]    ; xmm5=(2*CbO * -FIX(0.22800))\n        pmulhw  xmm0,[rel PW_F0402]     ; xmm0=(2*CrE * FIX(0.40200))\n        pmulhw  xmm1,[rel PW_F0402]     ; xmm1=(2*CrO * FIX(0.40200))\n\n        paddw   xmm4,[rel PW_ONE]\n        paddw   xmm5,[rel PW_ONE]\n        psraw   xmm4,1                  ; xmm4=(CbE * -FIX(0.22800))\n        psraw   xmm5,1                  ; xmm5=(CbO * -FIX(0.22800))\n        paddw   xmm0,[rel PW_ONE]\n        paddw   xmm1,[rel PW_ONE]\n        psraw   xmm0,1                  ; xmm0=(CrE * FIX(0.40200))\n        psraw   xmm1,1                  ; xmm1=(CrO * FIX(0.40200))\n\n        paddw   xmm4,xmm2\n        paddw   xmm5,xmm3\n        paddw   xmm4,xmm2               ; xmm4=(CbE * FIX(1.77200))=(B-Y)E\n        paddw   xmm5,xmm3               ; xmm5=(CbO * FIX(1.77200))=(B-Y)O\n        paddw   xmm0,xmm6               ; xmm0=(CrE * FIX(1.40200))=(R-Y)E\n        paddw   xmm1,xmm7               ; xmm1=(CrO * FIX(1.40200))=(R-Y)O\n\n        movdqa  XMMWORD [wk(0)], xmm4   ; wk(0)=(B-Y)E\n        movdqa  XMMWORD [wk(1)], xmm5   ; wk(1)=(B-Y)O\n\n        movdqa    xmm4,xmm2\n        movdqa    xmm5,xmm3\n        punpcklwd xmm2,xmm6\n        punpckhwd xmm4,xmm6\n        pmaddwd   xmm2,[rel PW_MF0344_F0285]\n        pmaddwd   xmm4,[rel PW_MF0344_F0285]\n        punpcklwd xmm3,xmm7\n        punpckhwd xmm5,xmm7\n        pmaddwd   xmm3,[rel PW_MF0344_F0285]\n        pmaddwd   xmm5,[rel PW_MF0344_F0285]\n\n        paddd     xmm2,[rel PD_ONEHALF]\n        paddd     xmm4,[rel PD_ONEHALF]\n        psrad     xmm2,SCALEBITS\n        psrad     xmm4,SCALEBITS\n        paddd     xmm3,[rel PD_ONEHALF]\n        paddd     xmm5,[rel PD_ONEHALF]\n        psrad     xmm3,SCALEBITS\n        psrad     xmm5,SCALEBITS\n\n        packssdw  xmm2,xmm4     ; xmm2=CbE*-FIX(0.344)+CrE*FIX(0.285)\n        packssdw  xmm3,xmm5     ; xmm3=CbO*-FIX(0.344)+CrO*FIX(0.285)\n        psubw     xmm2,xmm6     ; xmm2=CbE*-FIX(0.344)+CrE*-FIX(0.714)=(G-Y)E\n        psubw     xmm3,xmm7     ; xmm3=CbO*-FIX(0.344)+CrO*-FIX(0.714)=(G-Y)O\n\n        movdqa    xmm5, XMMWORD [rsi]   ; xmm5=Y(0123456789ABCDEF)\n\n        pcmpeqw   xmm4,xmm4\n        psrlw     xmm4,BYTE_BIT         ; xmm4={0xFF 0x00 0xFF 0x00 ..}\n        pand      xmm4,xmm5             ; xmm4=Y(02468ACE)=YE\n        psrlw     xmm5,BYTE_BIT         ; xmm5=Y(13579BDF)=YO\n\n        paddw     xmm0,xmm4             ; xmm0=((R-Y)E+YE)=RE=R(02468ACE)\n        paddw     xmm1,xmm5             ; xmm1=((R-Y)O+YO)=RO=R(13579BDF)\n        packuswb  xmm0,xmm0             ; xmm0=R(02468ACE********)\n        packuswb  xmm1,xmm1             ; xmm1=R(13579BDF********)\n\n        paddw     xmm2,xmm4             ; xmm2=((G-Y)E+YE)=GE=G(02468ACE)\n        paddw     xmm3,xmm5             ; xmm3=((G-Y)O+YO)=GO=G(13579BDF)\n        packuswb  xmm2,xmm2             ; xmm2=G(02468ACE********)\n        packuswb  xmm3,xmm3             ; xmm3=G(13579BDF********)\n\n        paddw     xmm4, XMMWORD [wk(0)] ; xmm4=(YE+(B-Y)E)=BE=B(02468ACE)\n        paddw     xmm5, XMMWORD [wk(1)] ; xmm5=(YO+(B-Y)O)=BO=B(13579BDF)\n        packuswb  xmm4,xmm4             ; xmm4=B(02468ACE********)\n        packuswb  xmm5,xmm5             ; xmm5=B(13579BDF********)\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n        ; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n        ; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n        ; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n        ; xmmG=(** ** ** ** ** ** ** ** **), xmmH=(** ** ** ** ** ** ** ** **)\n\n        punpcklbw xmmA,xmmC     ; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n        punpcklbw xmmE,xmmB     ; xmmE=(20 01 22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F)\n        punpcklbw xmmD,xmmF     ; xmmD=(11 21 13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F)\n\n        movdqa    xmmG,xmmA\n        movdqa    xmmH,xmmA\n        punpcklwd xmmA,xmmE     ; xmmA=(00 10 20 01 02 12 22 03 04 14 24 05 06 16 26 07)\n        punpckhwd xmmG,xmmE     ; xmmG=(08 18 28 09 0A 1A 2A 0B 0C 1C 2C 0D 0E 1E 2E 0F)\n\n        psrldq    xmmH,2        ; xmmH=(02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E -- --)\n        psrldq    xmmE,2        ; xmmE=(22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F -- --)\n\n        movdqa    xmmC,xmmD\n        movdqa    xmmB,xmmD\n        punpcklwd xmmD,xmmH     ; xmmD=(11 21 02 12 13 23 04 14 15 25 06 16 17 27 08 18)\n        punpckhwd xmmC,xmmH     ; xmmC=(19 29 0A 1A 1B 2B 0C 1C 1D 2D 0E 1E 1F 2F -- --)\n\n        psrldq    xmmB,2        ; xmmB=(13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F -- --)\n\n        movdqa    xmmF,xmmE\n        punpcklwd xmmE,xmmB     ; xmmE=(22 03 13 23 24 05 15 25 26 07 17 27 28 09 19 29)\n        punpckhwd xmmF,xmmB     ; xmmF=(2A 0B 1B 2B 2C 0D 1D 2D 2E 0F 1F 2F -- -- -- --)\n\n        pshufd    xmmH,xmmA,0x4E; xmmH=(04 14 24 05 06 16 26 07 00 10 20 01 02 12 22 03)\n        movdqa    xmmB,xmmE\n        punpckldq xmmA,xmmD     ; xmmA=(00 10 20 01 11 21 02 12 02 12 22 03 13 23 04 14)\n        punpckldq xmmE,xmmH     ; xmmE=(22 03 13 23 04 14 24 05 24 05 15 25 06 16 26 07)\n        punpckhdq xmmD,xmmB     ; xmmD=(15 25 06 16 26 07 17 27 17 27 08 18 28 09 19 29)\n\n        pshufd    xmmH,xmmG,0x4E; xmmH=(0C 1C 2C 0D 0E 1E 2E 0F 08 18 28 09 0A 1A 2A 0B)\n        movdqa    xmmB,xmmF\n        punpckldq xmmG,xmmC     ; xmmG=(08 18 28 09 19 29 0A 1A 0A 1A 2A 0B 1B 2B 0C 1C)\n        punpckldq xmmF,xmmH     ; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 2C 0D 1D 2D 0E 1E 2E 0F)\n        punpckhdq xmmC,xmmB     ; xmmC=(1D 2D 0E 1E 2E 0F 1F 2F 1F 2F -- -- -- -- -- --)\n\n        punpcklqdq xmmA,xmmE    ; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n        punpcklqdq xmmD,xmmG    ; xmmD=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n        punpcklqdq xmmF,xmmC    ; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n        cmp     rcx, byte SIZEOF_XMMWORD\n        jb      short .column_st32\n\n        test    rdi, SIZEOF_XMMWORD-1\n        jnz     short .out1\n        ; --(aligned)-------------------\n        movntdq XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        movntdq XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n        movntdq XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF\n        jmp     short .out0\n.out1:  ; --(unaligned)-----------------\n        movdqu  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n        movdqu  XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF\n.out0:\n        add     rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD  ; outptr\n        sub     rcx, byte SIZEOF_XMMWORD\n        jz      near .nextrow\n\n        add     rsi, byte SIZEOF_XMMWORD        ; inptr0\n        add     rbx, byte SIZEOF_XMMWORD        ; inptr1\n        add     rdx, byte SIZEOF_XMMWORD        ; inptr2\n        jmp     near .columnloop\n\n.column_st32:\n        lea     rcx, [rcx+rcx*2]                ; imul ecx, RGB_PIXELSIZE\n        cmp     rcx, byte 2*SIZEOF_XMMWORD\n        jb      short .column_st16\n        movdqu  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n        add     rdi, byte 2*SIZEOF_XMMWORD      ; outptr\n        movdqa  xmmA,xmmF\n        sub     rcx, byte 2*SIZEOF_XMMWORD\n        jmp     short .column_st15\n.column_st16:\n        cmp     rcx, byte SIZEOF_XMMWORD\n        jb      short .column_st15\n        movdqu  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        add     rdi, byte SIZEOF_XMMWORD        ; outptr\n        movdqa  xmmA,xmmD\n        sub     rcx, byte SIZEOF_XMMWORD\n.column_st15:\n        ; Store the lower 8 bytes of xmmA to the output when it has enough\n        ; space.\n        cmp     rcx, byte SIZEOF_MMWORD\n        jb      short .column_st7\n        movq    XMM_MMWORD [rdi], xmmA\n        add     rdi, byte SIZEOF_MMWORD\n        sub     rcx, byte SIZEOF_MMWORD\n        psrldq  xmmA, SIZEOF_MMWORD\n.column_st7:\n        ; Store the lower 4 bytes of xmmA to the output when it has enough\n        ; space.\n        cmp     rcx, byte SIZEOF_DWORD\n        jb      short .column_st3\n        movd    XMM_DWORD [rdi], xmmA\n        add     rdi, byte SIZEOF_DWORD\n        sub     rcx, byte SIZEOF_DWORD\n        psrldq  xmmA, SIZEOF_DWORD\n.column_st3:\n        ; Store the lower 2 bytes of rax to the output when it has enough\n        ; space.\n        movd    eax, xmmA\n        cmp     rcx, byte SIZEOF_WORD\n        jb      short .column_st1\n        mov     WORD [rdi], ax\n        add     rdi, byte SIZEOF_WORD\n        sub     rcx, byte SIZEOF_WORD\n        shr     rax, 16\n.column_st1:\n        ; Store the lower 1 byte of rax to the output when it has enough\n        ; space.\n        test    rcx, rcx\n        jz      short .nextrow\n        mov     BYTE [rdi], al\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n%ifdef RGBX_FILLER_0XFF\n        pcmpeqb   xmm6,xmm6             ; xmm6=XE=X(02468ACE********)\n        pcmpeqb   xmm7,xmm7             ; xmm7=XO=X(13579BDF********)\n%else\n        pxor      xmm6,xmm6             ; xmm6=XE=X(02468ACE********)\n        pxor      xmm7,xmm7             ; xmm7=XO=X(13579BDF********)\n%endif\n        ; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n        ; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n        ; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n        ; xmmG=(30 32 34 36 38 3A 3C 3E **), xmmH=(31 33 35 37 39 3B 3D 3F **)\n\n        punpcklbw xmmA,xmmC     ; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n        punpcklbw xmmE,xmmG     ; xmmE=(20 30 22 32 24 34 26 36 28 38 2A 3A 2C 3C 2E 3E)\n        punpcklbw xmmB,xmmD     ; xmmB=(01 11 03 13 05 15 07 17 09 19 0B 1B 0D 1D 0F 1F)\n        punpcklbw xmmF,xmmH     ; xmmF=(21 31 23 33 25 35 27 37 29 39 2B 3B 2D 3D 2F 3F)\n\n        movdqa    xmmC,xmmA\n        punpcklwd xmmA,xmmE     ; xmmA=(00 10 20 30 02 12 22 32 04 14 24 34 06 16 26 36)\n        punpckhwd xmmC,xmmE     ; xmmC=(08 18 28 38 0A 1A 2A 3A 0C 1C 2C 3C 0E 1E 2E 3E)\n        movdqa    xmmG,xmmB\n        punpcklwd xmmB,xmmF     ; xmmB=(01 11 21 31 03 13 23 33 05 15 25 35 07 17 27 37)\n        punpckhwd xmmG,xmmF     ; xmmG=(09 19 29 39 0B 1B 2B 3B 0D 1D 2D 3D 0F 1F 2F 3F)\n\n        movdqa    xmmD,xmmA\n        punpckldq xmmA,xmmB     ; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n        punpckhdq xmmD,xmmB     ; xmmD=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n        movdqa    xmmH,xmmC\n        punpckldq xmmC,xmmG     ; xmmC=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n        punpckhdq xmmH,xmmG     ; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n        cmp     rcx, byte SIZEOF_XMMWORD\n        jb      short .column_st32\n\n        test    rdi, SIZEOF_XMMWORD-1\n        jnz     short .out1\n        ; --(aligned)-------------------\n        movntdq XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        movntdq XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n        movntdq XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC\n        movntdq XMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH\n        jmp     short .out0\n.out1:  ; --(unaligned)-----------------\n        movdqu  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n        movdqu  XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC\n        movdqu  XMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH\n.out0:\n        add     rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD  ; outptr\n        sub     rcx, byte SIZEOF_XMMWORD\n        jz      near .nextrow\n\n        add     rsi, byte SIZEOF_XMMWORD        ; inptr0\n        add     rbx, byte SIZEOF_XMMWORD        ; inptr1\n        add     rdx, byte SIZEOF_XMMWORD        ; inptr2\n        jmp     near .columnloop\n\n.column_st32:\n        cmp     rcx, byte SIZEOF_XMMWORD/2\n        jb      short .column_st16\n        movdqu  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n        add     rdi, byte 2*SIZEOF_XMMWORD      ; outptr\n        movdqa  xmmA,xmmC\n        movdqa  xmmD,xmmH\n        sub     rcx, byte SIZEOF_XMMWORD/2\n.column_st16:\n        cmp     rcx, byte SIZEOF_XMMWORD/4\n        jb      short .column_st15\n        movdqu  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        add     rdi, byte SIZEOF_XMMWORD        ; outptr\n        movdqa  xmmA,xmmD\n        sub     rcx, byte SIZEOF_XMMWORD/4\n.column_st15:\n        ; Store two pixels (8 bytes) of xmmA to the output when it has enough\n        ; space.\n        cmp     rcx, byte SIZEOF_XMMWORD/8\n        jb      short .column_st7\n        movq    MMWORD [rdi], xmmA\n        add     rdi, byte SIZEOF_XMMWORD/8*4\n        sub     rcx, byte SIZEOF_XMMWORD/8\n        psrldq  xmmA, SIZEOF_XMMWORD/8*4\n.column_st7:\n        ; Store one pixel (4 bytes) of xmmA to the output when it has enough\n        ; space.\n        test    rcx, rcx\n        jz      short .nextrow\n        movd    XMM_DWORD [rdi], xmmA\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n.nextrow:\n        pop     rcx\n        pop     rsi\n        pop     rbx\n        pop     rdx\n        pop     rdi\n        pop     rax\n\n        add     rsi, byte SIZEOF_JSAMPROW\n        add     rbx, byte SIZEOF_JSAMPROW\n        add     rdx, byte SIZEOF_JSAMPROW\n        add     rdi, byte SIZEOF_JSAMPROW       ; output_buf\n        dec     rax                             ; num_rows\n        jg      near .rowloop\n\n        sfence          ; flush the write buffer\n\n.return:\n        pop     rbx\n        uncollect_args\n        mov     rsp,rbp         ; rsp <- aligned rbp\n        pop     rsp             ; rsp <- original rbp\n        pop     rbp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdcolext-sse2.asm",
    "content": ";\n; jdcolext.asm - colorspace conversion (SSE2)\n;\n; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2012, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_ycc_rgb_convert_sse2 (JDIMENSION out_width,\n;                             JSAMPIMAGE input_buf, JDIMENSION input_row,\n;                             JSAMPARRAY output_buf, int num_rows)\n;\n\n%define out_width(b)    (b)+8           ; JDIMENSION out_width\n%define input_buf(b)    (b)+12          ; JSAMPIMAGE input_buf\n%define input_row(b)    (b)+16          ; JDIMENSION input_row\n%define output_buf(b)   (b)+20          ; JSAMPARRAY output_buf\n%define num_rows(b)     (b)+24          ; int num_rows\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          2\n%define gotptr          wk(0)-SIZEOF_POINTER    ; void * gotptr\n\n        align   16\n        global  EXTN(jsimd_ycc_rgb_convert_sse2)\n\nEXTN(jsimd_ycc_rgb_convert_sse2):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic eax             ; make a room for GOT address\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx                     ; get GOT address\n        movpic  POINTER [gotptr], ebx   ; save GOT address\n\n        mov     ecx, JDIMENSION [out_width(eax)]        ; num_cols\n        test    ecx,ecx\n        jz      near .return\n\n        push    ecx\n\n        mov     edi, JSAMPIMAGE [input_buf(eax)]\n        mov     ecx, JDIMENSION [input_row(eax)]\n        mov     esi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY]\n        mov     ebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY]\n        mov     edx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY]\n        lea     esi, [esi+ecx*SIZEOF_JSAMPROW]\n        lea     ebx, [ebx+ecx*SIZEOF_JSAMPROW]\n        lea     edx, [edx+ecx*SIZEOF_JSAMPROW]\n\n        pop     ecx\n\n        mov     edi, JSAMPARRAY [output_buf(eax)]\n        mov     eax, INT [num_rows(eax)]\n        test    eax,eax\n        jle     near .return\n        alignx  16,7\n.rowloop:\n        push    eax\n        push    edi\n        push    edx\n        push    ebx\n        push    esi\n        push    ecx                     ; col\n\n        mov     esi, JSAMPROW [esi]     ; inptr0\n        mov     ebx, JSAMPROW [ebx]     ; inptr1\n        mov     edx, JSAMPROW [edx]     ; inptr2\n        mov     edi, JSAMPROW [edi]     ; outptr\n        movpic  eax, POINTER [gotptr]   ; load GOT address (eax)\n        alignx  16,7\n.columnloop:\n\n        movdqa  xmm5, XMMWORD [ebx]     ; xmm5=Cb(0123456789ABCDEF)\n        movdqa  xmm1, XMMWORD [edx]     ; xmm1=Cr(0123456789ABCDEF)\n\n        pcmpeqw xmm4,xmm4\n        pcmpeqw xmm7,xmm7\n        psrlw   xmm4,BYTE_BIT\n        psllw   xmm7,7                  ; xmm7={0xFF80 0xFF80 0xFF80 0xFF80 ..}\n        movdqa  xmm0,xmm4               ; xmm0=xmm4={0xFF 0x00 0xFF 0x00 ..}\n\n        pand    xmm4,xmm5               ; xmm4=Cb(02468ACE)=CbE\n        psrlw   xmm5,BYTE_BIT           ; xmm5=Cb(13579BDF)=CbO\n        pand    xmm0,xmm1               ; xmm0=Cr(02468ACE)=CrE\n        psrlw   xmm1,BYTE_BIT           ; xmm1=Cr(13579BDF)=CrO\n\n        paddw   xmm4,xmm7\n        paddw   xmm5,xmm7\n        paddw   xmm0,xmm7\n        paddw   xmm1,xmm7\n\n        ; (Original)\n        ; R = Y                + 1.40200 * Cr\n        ; G = Y - 0.34414 * Cb - 0.71414 * Cr\n        ; B = Y + 1.77200 * Cb\n        ;\n        ; (This implementation)\n        ; R = Y                + 0.40200 * Cr + Cr\n        ; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr\n        ; B = Y - 0.22800 * Cb + Cb + Cb\n\n        movdqa  xmm2,xmm4               ; xmm2=CbE\n        movdqa  xmm3,xmm5               ; xmm3=CbO\n        paddw   xmm4,xmm4               ; xmm4=2*CbE\n        paddw   xmm5,xmm5               ; xmm5=2*CbO\n        movdqa  xmm6,xmm0               ; xmm6=CrE\n        movdqa  xmm7,xmm1               ; xmm7=CrO\n        paddw   xmm0,xmm0               ; xmm0=2*CrE\n        paddw   xmm1,xmm1               ; xmm1=2*CrO\n\n        pmulhw  xmm4,[GOTOFF(eax,PW_MF0228)]    ; xmm4=(2*CbE * -FIX(0.22800))\n        pmulhw  xmm5,[GOTOFF(eax,PW_MF0228)]    ; xmm5=(2*CbO * -FIX(0.22800))\n        pmulhw  xmm0,[GOTOFF(eax,PW_F0402)]     ; xmm0=(2*CrE * FIX(0.40200))\n        pmulhw  xmm1,[GOTOFF(eax,PW_F0402)]     ; xmm1=(2*CrO * FIX(0.40200))\n\n        paddw   xmm4,[GOTOFF(eax,PW_ONE)]\n        paddw   xmm5,[GOTOFF(eax,PW_ONE)]\n        psraw   xmm4,1                  ; xmm4=(CbE * -FIX(0.22800))\n        psraw   xmm5,1                  ; xmm5=(CbO * -FIX(0.22800))\n        paddw   xmm0,[GOTOFF(eax,PW_ONE)]\n        paddw   xmm1,[GOTOFF(eax,PW_ONE)]\n        psraw   xmm0,1                  ; xmm0=(CrE * FIX(0.40200))\n        psraw   xmm1,1                  ; xmm1=(CrO * FIX(0.40200))\n\n        paddw   xmm4,xmm2\n        paddw   xmm5,xmm3\n        paddw   xmm4,xmm2               ; xmm4=(CbE * FIX(1.77200))=(B-Y)E\n        paddw   xmm5,xmm3               ; xmm5=(CbO * FIX(1.77200))=(B-Y)O\n        paddw   xmm0,xmm6               ; xmm0=(CrE * FIX(1.40200))=(R-Y)E\n        paddw   xmm1,xmm7               ; xmm1=(CrO * FIX(1.40200))=(R-Y)O\n\n        movdqa  XMMWORD [wk(0)], xmm4   ; wk(0)=(B-Y)E\n        movdqa  XMMWORD [wk(1)], xmm5   ; wk(1)=(B-Y)O\n\n        movdqa    xmm4,xmm2\n        movdqa    xmm5,xmm3\n        punpcklwd xmm2,xmm6\n        punpckhwd xmm4,xmm6\n        pmaddwd   xmm2,[GOTOFF(eax,PW_MF0344_F0285)]\n        pmaddwd   xmm4,[GOTOFF(eax,PW_MF0344_F0285)]\n        punpcklwd xmm3,xmm7\n        punpckhwd xmm5,xmm7\n        pmaddwd   xmm3,[GOTOFF(eax,PW_MF0344_F0285)]\n        pmaddwd   xmm5,[GOTOFF(eax,PW_MF0344_F0285)]\n\n        paddd     xmm2,[GOTOFF(eax,PD_ONEHALF)]\n        paddd     xmm4,[GOTOFF(eax,PD_ONEHALF)]\n        psrad     xmm2,SCALEBITS\n        psrad     xmm4,SCALEBITS\n        paddd     xmm3,[GOTOFF(eax,PD_ONEHALF)]\n        paddd     xmm5,[GOTOFF(eax,PD_ONEHALF)]\n        psrad     xmm3,SCALEBITS\n        psrad     xmm5,SCALEBITS\n\n        packssdw  xmm2,xmm4     ; xmm2=CbE*-FIX(0.344)+CrE*FIX(0.285)\n        packssdw  xmm3,xmm5     ; xmm3=CbO*-FIX(0.344)+CrO*FIX(0.285)\n        psubw     xmm2,xmm6     ; xmm2=CbE*-FIX(0.344)+CrE*-FIX(0.714)=(G-Y)E\n        psubw     xmm3,xmm7     ; xmm3=CbO*-FIX(0.344)+CrO*-FIX(0.714)=(G-Y)O\n\n        movdqa    xmm5, XMMWORD [esi]   ; xmm5=Y(0123456789ABCDEF)\n\n        pcmpeqw   xmm4,xmm4\n        psrlw     xmm4,BYTE_BIT         ; xmm4={0xFF 0x00 0xFF 0x00 ..}\n        pand      xmm4,xmm5             ; xmm4=Y(02468ACE)=YE\n        psrlw     xmm5,BYTE_BIT         ; xmm5=Y(13579BDF)=YO\n\n        paddw     xmm0,xmm4             ; xmm0=((R-Y)E+YE)=RE=R(02468ACE)\n        paddw     xmm1,xmm5             ; xmm1=((R-Y)O+YO)=RO=R(13579BDF)\n        packuswb  xmm0,xmm0             ; xmm0=R(02468ACE********)\n        packuswb  xmm1,xmm1             ; xmm1=R(13579BDF********)\n\n        paddw     xmm2,xmm4             ; xmm2=((G-Y)E+YE)=GE=G(02468ACE)\n        paddw     xmm3,xmm5             ; xmm3=((G-Y)O+YO)=GO=G(13579BDF)\n        packuswb  xmm2,xmm2             ; xmm2=G(02468ACE********)\n        packuswb  xmm3,xmm3             ; xmm3=G(13579BDF********)\n\n        paddw     xmm4, XMMWORD [wk(0)] ; xmm4=(YE+(B-Y)E)=BE=B(02468ACE)\n        paddw     xmm5, XMMWORD [wk(1)] ; xmm5=(YO+(B-Y)O)=BO=B(13579BDF)\n        packuswb  xmm4,xmm4             ; xmm4=B(02468ACE********)\n        packuswb  xmm5,xmm5             ; xmm5=B(13579BDF********)\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n        ; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n        ; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n        ; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n        ; xmmG=(** ** ** ** ** ** ** ** **), xmmH=(** ** ** ** ** ** ** ** **)\n\n        punpcklbw xmmA,xmmC     ; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n        punpcklbw xmmE,xmmB     ; xmmE=(20 01 22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F)\n        punpcklbw xmmD,xmmF     ; xmmD=(11 21 13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F)\n\n        movdqa    xmmG,xmmA\n        movdqa    xmmH,xmmA\n        punpcklwd xmmA,xmmE     ; xmmA=(00 10 20 01 02 12 22 03 04 14 24 05 06 16 26 07)\n        punpckhwd xmmG,xmmE     ; xmmG=(08 18 28 09 0A 1A 2A 0B 0C 1C 2C 0D 0E 1E 2E 0F)\n\n        psrldq    xmmH,2        ; xmmH=(02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E -- --)\n        psrldq    xmmE,2        ; xmmE=(22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F -- --)\n\n        movdqa    xmmC,xmmD\n        movdqa    xmmB,xmmD\n        punpcklwd xmmD,xmmH     ; xmmD=(11 21 02 12 13 23 04 14 15 25 06 16 17 27 08 18)\n        punpckhwd xmmC,xmmH     ; xmmC=(19 29 0A 1A 1B 2B 0C 1C 1D 2D 0E 1E 1F 2F -- --)\n\n        psrldq    xmmB,2        ; xmmB=(13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F -- --)\n\n        movdqa    xmmF,xmmE\n        punpcklwd xmmE,xmmB     ; xmmE=(22 03 13 23 24 05 15 25 26 07 17 27 28 09 19 29)\n        punpckhwd xmmF,xmmB     ; xmmF=(2A 0B 1B 2B 2C 0D 1D 2D 2E 0F 1F 2F -- -- -- --)\n\n        pshufd    xmmH,xmmA,0x4E; xmmH=(04 14 24 05 06 16 26 07 00 10 20 01 02 12 22 03)\n        movdqa    xmmB,xmmE\n        punpckldq xmmA,xmmD     ; xmmA=(00 10 20 01 11 21 02 12 02 12 22 03 13 23 04 14)\n        punpckldq xmmE,xmmH     ; xmmE=(22 03 13 23 04 14 24 05 24 05 15 25 06 16 26 07)\n        punpckhdq xmmD,xmmB     ; xmmD=(15 25 06 16 26 07 17 27 17 27 08 18 28 09 19 29)\n\n        pshufd    xmmH,xmmG,0x4E; xmmH=(0C 1C 2C 0D 0E 1E 2E 0F 08 18 28 09 0A 1A 2A 0B)\n        movdqa    xmmB,xmmF\n        punpckldq xmmG,xmmC     ; xmmG=(08 18 28 09 19 29 0A 1A 0A 1A 2A 0B 1B 2B 0C 1C)\n        punpckldq xmmF,xmmH     ; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 2C 0D 1D 2D 0E 1E 2E 0F)\n        punpckhdq xmmC,xmmB     ; xmmC=(1D 2D 0E 1E 2E 0F 1F 2F 1F 2F -- -- -- -- -- --)\n\n        punpcklqdq xmmA,xmmE    ; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n        punpcklqdq xmmD,xmmG    ; xmmD=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n        punpcklqdq xmmF,xmmC    ; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n        cmp     ecx, byte SIZEOF_XMMWORD\n        jb      short .column_st32\n\n        test    edi, SIZEOF_XMMWORD-1\n        jnz     short .out1\n        ; --(aligned)-------------------\n        movntdq XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        movntdq XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n        movntdq XMMWORD [edi+2*SIZEOF_XMMWORD], xmmF\n        jmp     short .out0\n.out1:  ; --(unaligned)-----------------\n        movdqu  XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n        movdqu  XMMWORD [edi+2*SIZEOF_XMMWORD], xmmF\n.out0:\n        add     edi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD  ; outptr\n        sub     ecx, byte SIZEOF_XMMWORD\n        jz      near .nextrow\n\n        add     esi, byte SIZEOF_XMMWORD        ; inptr0\n        add     ebx, byte SIZEOF_XMMWORD        ; inptr1\n        add     edx, byte SIZEOF_XMMWORD        ; inptr2\n        jmp     near .columnloop\n        alignx  16,7\n\n.column_st32:\n        lea     ecx, [ecx+ecx*2]                ; imul ecx, RGB_PIXELSIZE\n        cmp     ecx, byte 2*SIZEOF_XMMWORD\n        jb      short .column_st16\n        movdqu  XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n        add     edi, byte 2*SIZEOF_XMMWORD      ; outptr\n        movdqa  xmmA,xmmF\n        sub     ecx, byte 2*SIZEOF_XMMWORD\n        jmp     short .column_st15\n.column_st16:\n        cmp     ecx, byte SIZEOF_XMMWORD\n        jb      short .column_st15\n        movdqu  XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        add     edi, byte SIZEOF_XMMWORD        ; outptr\n        movdqa  xmmA,xmmD\n        sub     ecx, byte SIZEOF_XMMWORD\n.column_st15:\n        ; Store the lower 8 bytes of xmmA to the output when it has enough\n        ; space.\n        cmp     ecx, byte SIZEOF_MMWORD\n        jb      short .column_st7\n        movq    XMM_MMWORD [edi], xmmA\n        add     edi, byte SIZEOF_MMWORD\n        sub     ecx, byte SIZEOF_MMWORD\n        psrldq  xmmA, SIZEOF_MMWORD\n.column_st7:\n        ; Store the lower 4 bytes of xmmA to the output when it has enough\n        ; space.\n        cmp     ecx, byte SIZEOF_DWORD\n        jb      short .column_st3\n        movd    XMM_DWORD [edi], xmmA\n        add     edi, byte SIZEOF_DWORD\n        sub     ecx, byte SIZEOF_DWORD\n        psrldq  xmmA, SIZEOF_DWORD\n.column_st3:\n        ; Store the lower 2 bytes of eax to the output when it has enough\n        ; space.\n        movd    eax, xmmA\n        cmp     ecx, byte SIZEOF_WORD\n        jb      short .column_st1\n        mov     WORD [edi], ax\n        add     edi, byte SIZEOF_WORD\n        sub     ecx, byte SIZEOF_WORD\n        shr     eax, 16\n.column_st1:\n        ; Store the lower 1 byte of eax to the output when it has enough\n        ; space.\n        test    ecx, ecx\n        jz      short .nextrow\n        mov     BYTE [edi], al\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n%ifdef RGBX_FILLER_0XFF\n        pcmpeqb   xmm6,xmm6             ; xmm6=XE=X(02468ACE********)\n        pcmpeqb   xmm7,xmm7             ; xmm7=XO=X(13579BDF********)\n%else\n        pxor      xmm6,xmm6             ; xmm6=XE=X(02468ACE********)\n        pxor      xmm7,xmm7             ; xmm7=XO=X(13579BDF********)\n%endif\n        ; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n        ; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n        ; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n        ; xmmG=(30 32 34 36 38 3A 3C 3E **), xmmH=(31 33 35 37 39 3B 3D 3F **)\n\n        punpcklbw xmmA,xmmC     ; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n        punpcklbw xmmE,xmmG     ; xmmE=(20 30 22 32 24 34 26 36 28 38 2A 3A 2C 3C 2E 3E)\n        punpcklbw xmmB,xmmD     ; xmmB=(01 11 03 13 05 15 07 17 09 19 0B 1B 0D 1D 0F 1F)\n        punpcklbw xmmF,xmmH     ; xmmF=(21 31 23 33 25 35 27 37 29 39 2B 3B 2D 3D 2F 3F)\n\n        movdqa    xmmC,xmmA\n        punpcklwd xmmA,xmmE     ; xmmA=(00 10 20 30 02 12 22 32 04 14 24 34 06 16 26 36)\n        punpckhwd xmmC,xmmE     ; xmmC=(08 18 28 38 0A 1A 2A 3A 0C 1C 2C 3C 0E 1E 2E 3E)\n        movdqa    xmmG,xmmB\n        punpcklwd xmmB,xmmF     ; xmmB=(01 11 21 31 03 13 23 33 05 15 25 35 07 17 27 37)\n        punpckhwd xmmG,xmmF     ; xmmG=(09 19 29 39 0B 1B 2B 3B 0D 1D 2D 3D 0F 1F 2F 3F)\n\n        movdqa    xmmD,xmmA\n        punpckldq xmmA,xmmB     ; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n        punpckhdq xmmD,xmmB     ; xmmD=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n        movdqa    xmmH,xmmC\n        punpckldq xmmC,xmmG     ; xmmC=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n        punpckhdq xmmH,xmmG     ; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n        cmp     ecx, byte SIZEOF_XMMWORD\n        jb      short .column_st32\n\n        test    edi, SIZEOF_XMMWORD-1\n        jnz     short .out1\n        ; --(aligned)-------------------\n        movntdq XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        movntdq XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n        movntdq XMMWORD [edi+2*SIZEOF_XMMWORD], xmmC\n        movntdq XMMWORD [edi+3*SIZEOF_XMMWORD], xmmH\n        jmp     short .out0\n.out1:  ; --(unaligned)-----------------\n        movdqu  XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n        movdqu  XMMWORD [edi+2*SIZEOF_XMMWORD], xmmC\n        movdqu  XMMWORD [edi+3*SIZEOF_XMMWORD], xmmH\n.out0:\n        add     edi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD  ; outptr\n        sub     ecx, byte SIZEOF_XMMWORD\n        jz      near .nextrow\n\n        add     esi, byte SIZEOF_XMMWORD        ; inptr0\n        add     ebx, byte SIZEOF_XMMWORD        ; inptr1\n        add     edx, byte SIZEOF_XMMWORD        ; inptr2\n        jmp     near .columnloop\n        alignx  16,7\n\n.column_st32:\n        cmp     ecx, byte SIZEOF_XMMWORD/2\n        jb      short .column_st16\n        movdqu  XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n        add     edi, byte 2*SIZEOF_XMMWORD      ; outptr\n        movdqa  xmmA,xmmC\n        movdqa  xmmD,xmmH\n        sub     ecx, byte SIZEOF_XMMWORD/2\n.column_st16:\n        cmp     ecx, byte SIZEOF_XMMWORD/4\n        jb      short .column_st15\n        movdqu  XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        add     edi, byte SIZEOF_XMMWORD        ; outptr\n        movdqa  xmmA,xmmD\n        sub     ecx, byte SIZEOF_XMMWORD/4\n.column_st15:\n        ; Store two pixels (8 bytes) of xmmA to the output when it has enough\n        ; space.\n        cmp     ecx, byte SIZEOF_XMMWORD/8\n        jb      short .column_st7\n        movq    XMM_MMWORD [edi], xmmA\n        add     edi, byte SIZEOF_XMMWORD/8*4\n        sub     ecx, byte SIZEOF_XMMWORD/8\n        psrldq  xmmA, SIZEOF_XMMWORD/8*4\n.column_st7:\n        ; Store one pixel (4 bytes) of xmmA to the output when it has enough\n        ; space.\n        test    ecx, ecx\n        jz      short .nextrow\n        movd    XMM_DWORD [edi], xmmA\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n        alignx  16,7\n\n.nextrow:\n        pop     ecx\n        pop     esi\n        pop     ebx\n        pop     edx\n        pop     edi\n        pop     eax\n\n        add     esi, byte SIZEOF_JSAMPROW\n        add     ebx, byte SIZEOF_JSAMPROW\n        add     edx, byte SIZEOF_JSAMPROW\n        add     edi, byte SIZEOF_JSAMPROW       ; output_buf\n        dec     eax                             ; num_rows\n        jg      near .rowloop\n\n        sfence          ; flush the write buffer\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdcolor-altivec.c",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2015, D. R. Commander.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n/* YCC --> RGB CONVERSION */\n\n#include \"jsimd_altivec.h\"\n\n\n#define F_0_344 22554              /* FIX(0.34414) */\n#define F_0_714 46802              /* FIX(0.71414) */\n#define F_1_402 91881              /* FIX(1.40200) */\n#define F_1_772 116130             /* FIX(1.77200) */\n#define F_0_402 (F_1_402 - 65536)  /* FIX(1.40200) - FIX(1) */\n#define F_0_285 (65536 - F_0_714)  /* FIX(1) - FIX(0.71414) */\n#define F_0_228 (131072 - F_1_772) /* FIX(2) - FIX(1.77200) */\n\n#define SCALEBITS 16\n#define ONE_HALF (1 << (SCALEBITS - 1))\n\n#define RGB_INDEX0 {0,1,8,2,3,10,4,5,12,6,7,14,16,17,24,18}\n#define RGB_INDEX1 {3,10,4,5,12,6,7,14,16,17,24,18,19,26,20,21}\n#define RGB_INDEX2 {12,6,7,14,16,17,24,18,19,26,20,21,28,22,23,30}\n#include \"jdcolext-altivec.c\"\n#undef RGB_PIXELSIZE\n\n#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n#define jsimd_ycc_rgb_convert_altivec jsimd_ycc_extrgb_convert_altivec\n#include \"jdcolext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGB_INDEX0\n#undef RGB_INDEX1\n#undef RGB_INDEX2\n#undef jsimd_ycc_rgb_convert_altivec\n\n#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n#define RGB_INDEX {0,1,8,9,2,3,10,11,4,5,12,13,6,7,14,15}\n#define jsimd_ycc_rgb_convert_altivec jsimd_ycc_extrgbx_convert_altivec\n#include \"jdcolext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGB_INDEX\n#undef jsimd_ycc_rgb_convert_altivec\n\n#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n#define RGB_INDEX0 {8,1,0,10,3,2,12,5,4,14,7,6,24,17,16,26}\n#define RGB_INDEX1 {3,2,12,5,4,14,7,6,24,17,16,26,19,18,28,21}\n#define RGB_INDEX2 {4,14,7,6,24,17,16,26,19,18,28,21,20,30,23,22}\n#define jsimd_ycc_rgb_convert_altivec jsimd_ycc_extbgr_convert_altivec\n#include \"jdcolext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGB_INDEX0\n#undef RGB_INDEX1\n#undef RGB_INDEX2\n#undef jsimd_ycc_rgb_convert_altivec\n\n#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n#define RGB_INDEX {8,1,0,9,10,3,2,11,12,5,4,13,14,7,6,15}\n#define jsimd_ycc_rgb_convert_altivec jsimd_ycc_extbgrx_convert_altivec\n#include \"jdcolext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGB_INDEX\n#undef jsimd_ycc_rgb_convert_altivec\n\n#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n#define RGB_INDEX {9,8,1,0,11,10,3,2,13,12,5,4,15,14,7,6}\n#define jsimd_ycc_rgb_convert_altivec jsimd_ycc_extxbgr_convert_altivec\n#include \"jdcolext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGB_INDEX\n#undef jsimd_ycc_rgb_convert_altivec\n\n#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n#define RGB_INDEX {9,0,1,8,11,2,3,10,13,4,5,12,15,6,7,14}\n#define jsimd_ycc_rgb_convert_altivec jsimd_ycc_extxrgb_convert_altivec\n#include \"jdcolext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGB_INDEX\n#undef jsimd_ycc_rgb_convert_altivec\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdcolor-mmx.asm",
    "content": ";\n; jdcolor.asm - colorspace conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS       16\n\nF_0_344 equ      22554                  ; FIX(0.34414)\nF_0_714 equ      46802                  ; FIX(0.71414)\nF_1_402 equ      91881                  ; FIX(1.40200)\nF_1_772 equ     116130                  ; FIX(1.77200)\nF_0_402 equ     (F_1_402 - 65536)       ; FIX(1.40200) - FIX(1)\nF_0_285 equ     ( 65536 - F_0_714)      ; FIX(1) - FIX(0.71414)\nF_0_228 equ     (131072 - F_1_772)      ; FIX(2) - FIX(1.77200)\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_ycc_rgb_convert_mmx)\n\nEXTN(jconst_ycc_rgb_convert_mmx):\n\nPW_F0402        times 4 dw  F_0_402\nPW_MF0228       times 4 dw -F_0_228\nPW_MF0344_F0285 times 2 dw -F_0_344, F_0_285\nPW_ONE          times 4 dw  1\nPD_ONEHALF      times 2 dd  1 << (SCALEBITS-1)\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n\n%include \"jdcolext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extrgb_convert_mmx\n%include \"jdcolext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extrgbx_convert_mmx\n%include \"jdcolext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extbgr_convert_mmx\n%include \"jdcolext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extbgrx_convert_mmx\n%include \"jdcolext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extxbgr_convert_mmx\n%include \"jdcolext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extxrgb_convert_mmx\n%include \"jdcolext-mmx.asm\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdcolor-sse2-64.asm",
    "content": ";\n; jdcolor.asm - colorspace conversion (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS       16\n\nF_0_344 equ      22554                  ; FIX(0.34414)\nF_0_714 equ      46802                  ; FIX(0.71414)\nF_1_402 equ      91881                  ; FIX(1.40200)\nF_1_772 equ     116130                  ; FIX(1.77200)\nF_0_402 equ     (F_1_402 - 65536)       ; FIX(1.40200) - FIX(1)\nF_0_285 equ     ( 65536 - F_0_714)      ; FIX(1) - FIX(0.71414)\nF_0_228 equ     (131072 - F_1_772)      ; FIX(2) - FIX(1.77200)\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_ycc_rgb_convert_sse2)\n\nEXTN(jconst_ycc_rgb_convert_sse2):\n\nPW_F0402        times 8 dw  F_0_402\nPW_MF0228       times 8 dw -F_0_228\nPW_MF0344_F0285 times 4 dw -F_0_344, F_0_285\nPW_ONE          times 8 dw  1\nPD_ONEHALF      times 4 dd  1 << (SCALEBITS-1)\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n\n%include \"jdcolext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extrgb_convert_sse2\n%include \"jdcolext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extrgbx_convert_sse2\n%include \"jdcolext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extbgr_convert_sse2\n%include \"jdcolext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extbgrx_convert_sse2\n%include \"jdcolext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extxbgr_convert_sse2\n%include \"jdcolext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extxrgb_convert_sse2\n%include \"jdcolext-sse2-64.asm\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdcolor-sse2.asm",
    "content": ";\n; jdcolor.asm - colorspace conversion (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS       16\n\nF_0_344 equ      22554                  ; FIX(0.34414)\nF_0_714 equ      46802                  ; FIX(0.71414)\nF_1_402 equ      91881                  ; FIX(1.40200)\nF_1_772 equ     116130                  ; FIX(1.77200)\nF_0_402 equ     (F_1_402 - 65536)       ; FIX(1.40200) - FIX(1)\nF_0_285 equ     ( 65536 - F_0_714)      ; FIX(1) - FIX(0.71414)\nF_0_228 equ     (131072 - F_1_772)      ; FIX(2) - FIX(1.77200)\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_ycc_rgb_convert_sse2)\n\nEXTN(jconst_ycc_rgb_convert_sse2):\n\nPW_F0402        times 8 dw  F_0_402\nPW_MF0228       times 8 dw -F_0_228\nPW_MF0344_F0285 times 4 dw -F_0_344, F_0_285\nPW_ONE          times 8 dw  1\nPD_ONEHALF      times 4 dd  1 << (SCALEBITS-1)\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n\n%include \"jdcolext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extrgb_convert_sse2\n%include \"jdcolext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extrgbx_convert_sse2\n%include \"jdcolext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extbgr_convert_sse2\n%include \"jdcolext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extbgrx_convert_sse2\n%include \"jdcolext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extxbgr_convert_sse2\n%include \"jdcolext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extxrgb_convert_sse2\n%include \"jdcolext-sse2.asm\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdct.inc",
    "content": ";\n; jdct.inc - private declarations for forward & reverse DCT subsystems\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; [TAB8]\n\n; Each IDCT routine is responsible for range-limiting its results and\n; converting them to unsigned form (0..MAXJSAMPLE).  The raw outputs could\n; be quite far out of range if the input data is corrupt, so a bulletproof\n; range-limiting step is required.  We use a mask-and-table-lookup method\n; to do the combined operations quickly.\n;\n%define RANGE_MASK  (MAXJSAMPLE * 4 + 3)  ; 2 bits wider than legal samples\n\n%define ROW(n,b,s)              ((b)+(n)*(s))\n%define COL(n,b,s)              ((b)+(n)*(s)*DCTSIZE)\n\n%define DWBLOCK(m,n,b,s)        ((b)+(m)*DCTSIZE*(s)+(n)*SIZEOF_DWORD)\n%define MMBLOCK(m,n,b,s)        ((b)+(m)*DCTSIZE*(s)+(n)*SIZEOF_MMWORD)\n%define XMMBLOCK(m,n,b,s)       ((b)+(m)*DCTSIZE*(s)+(n)*SIZEOF_XMMWORD)\n\n; --------------------------------------------------------------------------\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdmerge-altivec.c",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2015, D. R. Commander.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n/* MERGED YCC --> RGB CONVERSION AND UPSAMPLING */\n\n#include \"jsimd_altivec.h\"\n\n\n#define F_0_344 22554              /* FIX(0.34414) */\n#define F_0_714 46802              /* FIX(0.71414) */\n#define F_1_402 91881              /* FIX(1.40200) */\n#define F_1_772 116130             /* FIX(1.77200) */\n#define F_0_402 (F_1_402 - 65536)  /* FIX(1.40200) - FIX(1) */\n#define F_0_285 (65536 - F_0_714)  /* FIX(1) - FIX(0.71414) */\n#define F_0_228 (131072 - F_1_772) /* FIX(2) - FIX(1.77200) */\n\n#define SCALEBITS 16\n#define ONE_HALF (1 << (SCALEBITS - 1))\n\n#define RGB_INDEX0 {0,1,8,2,3,10,4,5,12,6,7,14,16,17,24,18}\n#define RGB_INDEX1 {3,10,4,5,12,6,7,14,16,17,24,18,19,26,20,21}\n#define RGB_INDEX2 {12,6,7,14,16,17,24,18,19,26,20,21,28,22,23,30}\n#include \"jdmrgext-altivec.c\"\n#undef RGB_PIXELSIZE\n\n#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n#define jsimd_h2v1_merged_upsample_altivec jsimd_h2v1_extrgb_merged_upsample_altivec\n#define jsimd_h2v2_merged_upsample_altivec jsimd_h2v2_extrgb_merged_upsample_altivec\n#include \"jdmrgext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGB_INDEX0\n#undef RGB_INDEX1\n#undef RGB_INDEX2\n#undef jsimd_h2v1_merged_upsample_altivec\n#undef jsimd_h2v2_merged_upsample_altivec\n\n#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n#define RGB_INDEX {0,1,8,9,2,3,10,11,4,5,12,13,6,7,14,15}\n#define jsimd_h2v1_merged_upsample_altivec jsimd_h2v1_extrgbx_merged_upsample_altivec\n#define jsimd_h2v2_merged_upsample_altivec jsimd_h2v2_extrgbx_merged_upsample_altivec\n#include \"jdmrgext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGB_INDEX\n#undef jsimd_h2v1_merged_upsample_altivec\n#undef jsimd_h2v2_merged_upsample_altivec\n\n#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n#define RGB_INDEX0 {8,1,0,10,3,2,12,5,4,14,7,6,24,17,16,26}\n#define RGB_INDEX1 {3,2,12,5,4,14,7,6,24,17,16,26,19,18,28,21}\n#define RGB_INDEX2 {4,14,7,6,24,17,16,26,19,18,28,21,20,30,23,22}\n#define jsimd_h2v1_merged_upsample_altivec jsimd_h2v1_extbgr_merged_upsample_altivec\n#define jsimd_h2v2_merged_upsample_altivec jsimd_h2v2_extbgr_merged_upsample_altivec\n#include \"jdmrgext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGB_INDEX0\n#undef RGB_INDEX1\n#undef RGB_INDEX2\n#undef jsimd_h2v1_merged_upsample_altivec\n#undef jsimd_h2v2_merged_upsample_altivec\n\n#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n#define RGB_INDEX {8,1,0,9,10,3,2,11,12,5,4,13,14,7,6,15}\n#define jsimd_h2v1_merged_upsample_altivec jsimd_h2v1_extbgrx_merged_upsample_altivec\n#define jsimd_h2v2_merged_upsample_altivec jsimd_h2v2_extbgrx_merged_upsample_altivec\n#include \"jdmrgext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGB_INDEX\n#undef jsimd_h2v1_merged_upsample_altivec\n#undef jsimd_h2v2_merged_upsample_altivec\n\n#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n#define RGB_INDEX {9,8,1,0,11,10,3,2,13,12,5,4,15,14,7,6}\n#define jsimd_h2v1_merged_upsample_altivec jsimd_h2v1_extxbgr_merged_upsample_altivec\n#define jsimd_h2v2_merged_upsample_altivec jsimd_h2v2_extxbgr_merged_upsample_altivec\n#include \"jdmrgext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGB_INDEX\n#undef jsimd_h2v1_merged_upsample_altivec\n#undef jsimd_h2v2_merged_upsample_altivec\n\n#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n#define RGB_INDEX {9,0,1,8,11,2,3,10,13,4,5,12,15,6,7,14}\n#define jsimd_h2v1_merged_upsample_altivec jsimd_h2v1_extxrgb_merged_upsample_altivec\n#define jsimd_h2v2_merged_upsample_altivec jsimd_h2v2_extxrgb_merged_upsample_altivec\n#include \"jdmrgext-altivec.c\"\n#undef RGB_PIXELSIZE\n#undef RGB_INDEX\n#undef jsimd_h2v1_merged_upsample_altivec\n#undef jsimd_h2v2_merged_upsample_altivec\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdmerge-mmx.asm",
    "content": ";\n; jdmerge.asm - merged upsampling/color conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS       16\n\nF_0_344 equ      22554                  ; FIX(0.34414)\nF_0_714 equ      46802                  ; FIX(0.71414)\nF_1_402 equ      91881                  ; FIX(1.40200)\nF_1_772 equ     116130                  ; FIX(1.77200)\nF_0_402 equ     (F_1_402 - 65536)       ; FIX(1.40200) - FIX(1)\nF_0_285 equ     ( 65536 - F_0_714)      ; FIX(1) - FIX(0.71414)\nF_0_228 equ     (131072 - F_1_772)      ; FIX(2) - FIX(1.77200)\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_merged_upsample_mmx)\n\nEXTN(jconst_merged_upsample_mmx):\n\nPW_F0402        times 4 dw  F_0_402\nPW_MF0228       times 4 dw -F_0_228\nPW_MF0344_F0285 times 2 dw -F_0_344, F_0_285\nPW_ONE          times 4 dw  1\nPD_ONEHALF      times 2 dd  1 << (SCALEBITS-1)\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n\n%include \"jdmrgext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_mmx jsimd_h2v1_extrgb_merged_upsample_mmx\n%define jsimd_h2v2_merged_upsample_mmx jsimd_h2v2_extrgb_merged_upsample_mmx\n%include \"jdmrgext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_mmx jsimd_h2v1_extrgbx_merged_upsample_mmx\n%define jsimd_h2v2_merged_upsample_mmx jsimd_h2v2_extrgbx_merged_upsample_mmx\n%include \"jdmrgext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_mmx jsimd_h2v1_extbgr_merged_upsample_mmx\n%define jsimd_h2v2_merged_upsample_mmx jsimd_h2v2_extbgr_merged_upsample_mmx\n%include \"jdmrgext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_mmx jsimd_h2v1_extbgrx_merged_upsample_mmx\n%define jsimd_h2v2_merged_upsample_mmx jsimd_h2v2_extbgrx_merged_upsample_mmx\n%include \"jdmrgext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_mmx jsimd_h2v1_extxbgr_merged_upsample_mmx\n%define jsimd_h2v2_merged_upsample_mmx jsimd_h2v2_extxbgr_merged_upsample_mmx\n%include \"jdmrgext-mmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_mmx jsimd_h2v1_extxrgb_merged_upsample_mmx\n%define jsimd_h2v2_merged_upsample_mmx jsimd_h2v2_extxrgb_merged_upsample_mmx\n%include \"jdmrgext-mmx.asm\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdmerge-sse2-64.asm",
    "content": ";\n; jdmerge.asm - merged upsampling/color conversion (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS       16\n\nF_0_344 equ      22554                  ; FIX(0.34414)\nF_0_714 equ      46802                  ; FIX(0.71414)\nF_1_402 equ      91881                  ; FIX(1.40200)\nF_1_772 equ     116130                  ; FIX(1.77200)\nF_0_402 equ     (F_1_402 - 65536)       ; FIX(1.40200) - FIX(1)\nF_0_285 equ     ( 65536 - F_0_714)      ; FIX(1) - FIX(0.71414)\nF_0_228 equ     (131072 - F_1_772)      ; FIX(2) - FIX(1.77200)\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_merged_upsample_sse2)\n\nEXTN(jconst_merged_upsample_sse2):\n\nPW_F0402        times 8 dw  F_0_402\nPW_MF0228       times 8 dw -F_0_228\nPW_MF0344_F0285 times 4 dw -F_0_344, F_0_285\nPW_ONE          times 8 dw  1\nPD_ONEHALF      times 4 dd  1 << (SCALEBITS-1)\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n\n%include \"jdmrgext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extrgb_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extrgb_merged_upsample_sse2\n%include \"jdmrgext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extrgbx_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extrgbx_merged_upsample_sse2\n%include \"jdmrgext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extbgr_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extbgr_merged_upsample_sse2\n%include \"jdmrgext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extbgrx_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extbgrx_merged_upsample_sse2\n%include \"jdmrgext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extxbgr_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extxbgr_merged_upsample_sse2\n%include \"jdmrgext-sse2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extxrgb_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extxrgb_merged_upsample_sse2\n%include \"jdmrgext-sse2-64.asm\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdmerge-sse2.asm",
    "content": ";\n; jdmerge.asm - merged upsampling/color conversion (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS       16\n\nF_0_344 equ      22554                  ; FIX(0.34414)\nF_0_714 equ      46802                  ; FIX(0.71414)\nF_1_402 equ      91881                  ; FIX(1.40200)\nF_1_772 equ     116130                  ; FIX(1.77200)\nF_0_402 equ     (F_1_402 - 65536)       ; FIX(1.40200) - FIX(1)\nF_0_285 equ     ( 65536 - F_0_714)      ; FIX(1) - FIX(0.71414)\nF_0_228 equ     (131072 - F_1_772)      ; FIX(2) - FIX(1.77200)\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_merged_upsample_sse2)\n\nEXTN(jconst_merged_upsample_sse2):\n\nPW_F0402        times 8 dw  F_0_402\nPW_MF0228       times 8 dw -F_0_228\nPW_MF0344_F0285 times 4 dw -F_0_344, F_0_285\nPW_ONE          times 8 dw  1\nPD_ONEHALF      times 4 dd  1 << (SCALEBITS-1)\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n\n%include \"jdmrgext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extrgb_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extrgb_merged_upsample_sse2\n%include \"jdmrgext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extrgbx_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extrgbx_merged_upsample_sse2\n%include \"jdmrgext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extbgr_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extbgr_merged_upsample_sse2\n%include \"jdmrgext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extbgrx_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extbgrx_merged_upsample_sse2\n%include \"jdmrgext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extxbgr_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extxbgr_merged_upsample_sse2\n%include \"jdmrgext-sse2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extxrgb_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extxrgb_merged_upsample_sse2\n%include \"jdmrgext-sse2.asm\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdmrgext-altivec.c",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2015, D. R. Commander.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n/* This file is included by jdmerge-altivec.c */\n\n\nvoid jsimd_h2v1_merged_upsample_altivec (JDIMENSION output_width,\n                                         JSAMPIMAGE input_buf,\n                                         JDIMENSION in_row_group_ctr,\n                                         JSAMPARRAY output_buf)\n{\n  JSAMPROW outptr, inptr0, inptr1, inptr2;\n  int pitch = output_width * RGB_PIXELSIZE, num_cols, yloop;\n#if __BIG_ENDIAN__\n  int offset;\n#endif\n  unsigned char __attribute__((aligned(16))) tmpbuf[RGB_PIXELSIZE * 16];\n\n  __vector unsigned char rgb0, rgb1, rgb2, rgbx0, rgbx1, rgbx2, rgbx3,\n    y, cb, cr;\n#if __BIG_ENDIAN__\n  __vector unsigned char edgel, edgeh, edges, out0, out1, out2, out3;\n#if RGB_PIXELSIZE == 4\n  __vector unsigned char out4;\n#endif\n#endif\n#if RGB_PIXELSIZE == 4\n  __vector unsigned char rgb3;\n#endif\n  __vector short rg0, rg1, rg2, rg3, bx0, bx1, bx2, bx3, ye, yo, cbl, cbh,\n    crl, crh, r_yl, r_yh, g_yl, g_yh, b_yl, b_yh, g_y0w, g_y1w, g_y2w, g_y3w,\n    rl, rh, gl, gh, bl, bh, re, ro, ge, go, be, bo;\n  __vector int g_y0, g_y1, g_y2, g_y3;\n\n  /* Constants\n   * NOTE: The >> 1 is to compensate for the fact that vec_madds() returns 17\n   * high-order bits, not 16.\n   */\n  __vector short pw_f0402 = { __8X(F_0_402 >> 1) },\n    pw_mf0228 = { __8X(-F_0_228 >> 1) },\n    pw_mf0344_f0285 = { __4X2(-F_0_344, F_0_285) },\n    pw_one = { __8X(1) }, pw_255 = { __8X(255) },\n    pw_cj = { __8X(CENTERJSAMPLE) };\n  __vector int pd_onehalf = { __4X(ONE_HALF) };\n  __vector unsigned char pb_zero = { __16X(0) },\n#if __BIG_ENDIAN__\n    shift_pack_index = {0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29},\n    even_index = {0,16,0,18,0,20,0,22,0,24,0,26,0,28,0,30},\n    odd_index = {0,17,0,19,0,21,0,23,0,25,0,27,0,29,0,31};\n#else\n    shift_pack_index = {2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31},\n    even_index = {16,0,18,0,20,0,22,0,24,0,26,0,28,0,30,0},\n    odd_index = {17,0,19,0,21,0,23,0,25,0,27,0,29,0,31,0};\n#endif\n\n  inptr0 = input_buf[0][in_row_group_ctr];\n  inptr1 = input_buf[1][in_row_group_ctr];\n  inptr2 = input_buf[2][in_row_group_ctr];\n  outptr = output_buf[0];\n\n  for (num_cols = pitch; num_cols > 0; inptr1 += 16, inptr2 += 16) {\n\n    cb = vec_ld(0, inptr1);\n    /* NOTE: We have to use vec_merge*() here because vec_unpack*() doesn't\n     * support unsigned vectors.\n     */\n    cbl = (__vector signed short)VEC_UNPACKHU(cb);\n    cbh = (__vector signed short)VEC_UNPACKLU(cb);\n    cbl = vec_sub(cbl, pw_cj);\n    cbh = vec_sub(cbh, pw_cj);\n\n    cr = vec_ld(0, inptr2);\n    crl = (__vector signed short)VEC_UNPACKHU(cr);\n    crh = (__vector signed short)VEC_UNPACKLU(cr);\n    crl = vec_sub(crl, pw_cj);\n    crh = vec_sub(crh, pw_cj);\n\n    /* (Original)\n     * R = Y                + 1.40200 * Cr\n     * G = Y - 0.34414 * Cb - 0.71414 * Cr\n     * B = Y + 1.77200 * Cb\n     *\n     * (This implementation)\n     * R = Y                + 0.40200 * Cr + Cr\n     * G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr\n     * B = Y - 0.22800 * Cb + Cb + Cb\n     */\n    b_yl = vec_add(cbl, cbl);\n    b_yh = vec_add(cbh, cbh);\n    b_yl = vec_madds(b_yl, pw_mf0228, pw_one);\n    b_yh = vec_madds(b_yh, pw_mf0228, pw_one);\n    b_yl = vec_sra(b_yl, (__vector unsigned short)pw_one);\n    b_yh = vec_sra(b_yh, (__vector unsigned short)pw_one);\n    b_yl = vec_add(b_yl, cbl);\n    b_yh = vec_add(b_yh, cbh);\n    b_yl = vec_add(b_yl, cbl);\n    b_yh = vec_add(b_yh, cbh);\n\n    r_yl = vec_add(crl, crl);\n    r_yh = vec_add(crh, crh);\n    r_yl = vec_madds(r_yl, pw_f0402, pw_one);\n    r_yh = vec_madds(r_yh, pw_f0402, pw_one);\n    r_yl = vec_sra(r_yl, (__vector unsigned short)pw_one);\n    r_yh = vec_sra(r_yh, (__vector unsigned short)pw_one);\n    r_yl = vec_add(r_yl, crl);\n    r_yh = vec_add(r_yh, crh);\n\n    g_y0w = vec_mergeh(cbl, crl);\n    g_y1w = vec_mergel(cbl, crl);\n    g_y0 = vec_msums(g_y0w, pw_mf0344_f0285, pd_onehalf);\n    g_y1 = vec_msums(g_y1w, pw_mf0344_f0285, pd_onehalf);\n    g_y2w = vec_mergeh(cbh, crh);\n    g_y3w = vec_mergel(cbh, crh);\n    g_y2 = vec_msums(g_y2w, pw_mf0344_f0285, pd_onehalf);\n    g_y3 = vec_msums(g_y3w, pw_mf0344_f0285, pd_onehalf);\n    /* Clever way to avoid 4 shifts + 2 packs.  This packs the high word from\n     * each dword into a new 16-bit vector, which is the equivalent of\n     * descaling the 32-bit results (right-shifting by 16 bits) and then\n     * packing them.\n     */\n    g_yl = vec_perm((__vector short)g_y0, (__vector short)g_y1,\n                    shift_pack_index);\n    g_yh = vec_perm((__vector short)g_y2, (__vector short)g_y3,\n                    shift_pack_index);\n    g_yl = vec_sub(g_yl, crl);\n    g_yh = vec_sub(g_yh, crh);\n\n    for (yloop = 0; yloop < 2 && num_cols > 0; yloop++,\n         num_cols -= RGB_PIXELSIZE * 16,\n         outptr += RGB_PIXELSIZE * 16, inptr0 += 16) {\n\n      y = vec_ld(0, inptr0);\n      ye = (__vector signed short)vec_perm(pb_zero, y, even_index);\n      yo = (__vector signed short)vec_perm(pb_zero, y, odd_index);\n\n      if (yloop == 0) {\n        be = vec_add(b_yl, ye);\n        bo = vec_add(b_yl, yo);\n        re = vec_add(r_yl, ye);\n        ro = vec_add(r_yl, yo);\n        ge = vec_add(g_yl, ye);\n        go = vec_add(g_yl, yo);\n      } else {\n        be = vec_add(b_yh, ye);\n        bo = vec_add(b_yh, yo);\n        re = vec_add(r_yh, ye);\n        ro = vec_add(r_yh, yo);\n        ge = vec_add(g_yh, ye);\n        go = vec_add(g_yh, yo);\n      }\n\n      rl = vec_mergeh(re, ro);\n      rh = vec_mergel(re, ro);\n      gl = vec_mergeh(ge, go);\n      gh = vec_mergel(ge, go);\n      bl = vec_mergeh(be, bo);\n      bh = vec_mergel(be, bo);\n\n      rg0 = vec_mergeh(rl, gl);\n      bx0 = vec_mergeh(bl, pw_255);\n      rg1 = vec_mergel(rl, gl);\n      bx1 = vec_mergel(bl, pw_255);\n      rg2 = vec_mergeh(rh, gh);\n      bx2 = vec_mergeh(bh, pw_255);\n      rg3 = vec_mergel(rh, gh);\n      bx3 = vec_mergel(bh, pw_255);\n\n      rgbx0 = vec_packsu(rg0, bx0);\n      rgbx1 = vec_packsu(rg1, bx1);\n      rgbx2 = vec_packsu(rg2, bx2);\n      rgbx3 = vec_packsu(rg3, bx3);\n\n#if RGB_PIXELSIZE == 3\n      /* rgbx0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 X0 B1 X1 B2 X2 B3 X3\n       * rgbx1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 X4 B5 X5 B6 X6 B7 X7\n       * rgbx2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 X8 B9 X9 Ba Xa Bb Xb\n       * rgbx3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Xc Bd Xd Be Xe Bf Xf\n       *\n       * rgb0 = R0 G0 B0 R1 G1 B1 R2 G2 B2 R3 G3 B3 R4 G4 B4 R5\n       * rgb1 = G5 B5 R6 G6 B6 R7 G7 B7 R8 G8 B8 R9 G9 B9 Ra Ga\n       * rgb2 = Ba Rb Gb Bb Rc Gc Bc Rd Gd Bd Re Ge Be Rf Gf Bf\n       */\n      rgb0 = vec_perm(rgbx0, rgbx1, (__vector unsigned char)RGB_INDEX0);\n      rgb1 = vec_perm(rgbx1, rgbx2, (__vector unsigned char)RGB_INDEX1);\n      rgb2 = vec_perm(rgbx2, rgbx3, (__vector unsigned char)RGB_INDEX2);\n#else\n      /* rgbx0 = R0 G0 R1 G1 R2 G2 R3 G3 B0 X0 B1 X1 B2 X2 B3 X3\n       * rgbx1 = R4 G4 R5 G5 R6 G6 R7 G7 B4 X4 B5 X5 B6 X6 B7 X7\n       * rgbx2 = R8 G8 R9 G9 Ra Ga Rb Gb B8 X8 B9 X9 Ba Xa Bb Xb\n       * rgbx3 = Rc Gc Rd Gd Re Ge Rf Gf Bc Xc Bd Xd Be Xe Bf Xf\n       *\n       * rgb0 = R0 G0 B0 X0 R1 G1 B1 X1 R2 G2 B2 X2 R3 G3 B3 X3\n       * rgb1 = R4 G4 B4 X4 R5 G5 B5 X5 R6 G6 B6 X6 R7 G7 B7 X7\n       * rgb2 = R8 G8 B8 X8 R9 G9 B9 X9 Ra Ga Ba Xa Rb Gb Bb Xb\n       * rgb3 = Rc Gc Bc Xc Rd Gd Bd Xd Re Ge Be Xe Rf Gf Bf Xf\n       */\n      rgb0 = vec_perm(rgbx0, rgbx0, (__vector unsigned char)RGB_INDEX);\n      rgb1 = vec_perm(rgbx1, rgbx1, (__vector unsigned char)RGB_INDEX);\n      rgb2 = vec_perm(rgbx2, rgbx2, (__vector unsigned char)RGB_INDEX);\n      rgb3 = vec_perm(rgbx3, rgbx3, (__vector unsigned char)RGB_INDEX);\n#endif\n\n#if __BIG_ENDIAN__\n      offset = (size_t)outptr & 15;\n      if (offset) {\n        __vector unsigned char unaligned_shift_index;\n        int bytes = num_cols + offset;\n\n        if (bytes < (RGB_PIXELSIZE + 1) * 16 && (bytes & 15)) {\n          /* Slow path to prevent buffer overwrite.  Since there is no way to\n           * write a partial AltiVec register, overwrite would occur on the\n           * last chunk of the last image row if the right edge is not on a\n           * 16-byte boundary.  It could also occur on other rows if the bytes\n           * per row is low enough.  Since we can't determine whether we're on\n           * the last image row, we have to assume every row is the last.\n           */\n          vec_st(rgb0, 0, tmpbuf);\n          vec_st(rgb1, 16, tmpbuf);\n          vec_st(rgb2, 32, tmpbuf);\n#if RGB_PIXELSIZE == 4\n          vec_st(rgb3, 48, tmpbuf);\n#endif\n          memcpy(outptr, tmpbuf, min(num_cols, RGB_PIXELSIZE * 16));\n        } else {\n          /* Fast path */\n          unaligned_shift_index = vec_lvsl(0, outptr);\n          edgel = vec_ld(0, outptr);\n          edgeh = vec_ld(min(num_cols - 1, RGB_PIXELSIZE * 16), outptr);\n          edges = vec_perm(edgeh, edgel, unaligned_shift_index);\n          unaligned_shift_index = vec_lvsr(0, outptr);\n          out0 = vec_perm(edges, rgb0, unaligned_shift_index);\n          out1 = vec_perm(rgb0, rgb1, unaligned_shift_index);\n          out2 = vec_perm(rgb1, rgb2, unaligned_shift_index);\n#if RGB_PIXELSIZE == 4\n          out3 = vec_perm(rgb2, rgb3, unaligned_shift_index);\n          out4 = vec_perm(rgb3, edges, unaligned_shift_index);\n#else\n          out3 = vec_perm(rgb2, edges, unaligned_shift_index);\n#endif\n          vec_st(out0, 0, outptr);\n          if (bytes > 16)\n            vec_st(out1, 16, outptr);\n          if (bytes > 32)\n            vec_st(out2, 32, outptr);\n          if (bytes > 48)\n            vec_st(out3, 48, outptr);\n#if RGB_PIXELSIZE == 4\n          if (bytes > 64)\n            vec_st(out4, 64, outptr);\n#endif\n        }\n      } else {\n#endif /* __BIG_ENDIAN__ */\n        if (num_cols < RGB_PIXELSIZE * 16 && (num_cols & 15)) {\n          /* Slow path */\n          VEC_ST(rgb0, 0, tmpbuf);\n          VEC_ST(rgb1, 16, tmpbuf);\n          VEC_ST(rgb2, 32, tmpbuf);\n#if RGB_PIXELSIZE == 4\n          VEC_ST(rgb3, 48, tmpbuf);\n#endif\n          memcpy(outptr, tmpbuf, min(num_cols, RGB_PIXELSIZE * 16));\n        } else {\n          /* Fast path */\n          VEC_ST(rgb0, 0, outptr);\n          if (num_cols > 16)\n            VEC_ST(rgb1, 16, outptr);\n          if (num_cols > 32)\n            VEC_ST(rgb2, 32, outptr);\n#if RGB_PIXELSIZE == 4\n          if (num_cols > 48)\n            VEC_ST(rgb3, 48, outptr);\n#endif\n        }\n#if __BIG_ENDIAN__\n      }\n#endif\n    }\n  }\n}\n\n\nvoid jsimd_h2v2_merged_upsample_altivec (JDIMENSION output_width,\n                                         JSAMPIMAGE input_buf,\n                                         JDIMENSION in_row_group_ctr,\n                                         JSAMPARRAY output_buf)\n{\n  JSAMPROW inptr, outptr;\n\n  inptr = input_buf[0][in_row_group_ctr];\n  outptr = output_buf[0];\n\n  input_buf[0][in_row_group_ctr] = input_buf[0][in_row_group_ctr * 2];\n  jsimd_h2v1_merged_upsample_altivec(output_width, input_buf, in_row_group_ctr,\n                                     output_buf);\n\n  input_buf[0][in_row_group_ctr] = input_buf[0][in_row_group_ctr * 2 + 1];\n  output_buf[0] = output_buf[1];\n  jsimd_h2v1_merged_upsample_altivec(output_width, input_buf, in_row_group_ctr,\n                                     output_buf);\n\n  input_buf[0][in_row_group_ctr] = inptr;\n  output_buf[0] = outptr;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdmrgext-mmx.asm",
    "content": ";\n; jdmrgext.asm - merged upsampling/color conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.\n;\n; GLOBAL(void)\n; jsimd_h2v1_merged_upsample_mmx (JDIMENSION output_width,\n;                                 JSAMPIMAGE input_buf,\n;                                 JDIMENSION in_row_group_ctr,\n;                                 JSAMPARRAY output_buf);\n;\n\n%define output_width(b) (b)+8                   ; JDIMENSION output_width\n%define input_buf(b)            (b)+12          ; JSAMPIMAGE input_buf\n%define in_row_group_ctr(b)     (b)+16          ; JDIMENSION in_row_group_ctr\n%define output_buf(b)           (b)+20          ; JSAMPARRAY output_buf\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_MMWORD  ; mmword wk[WK_NUM]\n%define WK_NUM          3\n%define gotptr          wk(0)-SIZEOF_POINTER    ; void * gotptr\n\n        align   16\n        global  EXTN(jsimd_h2v1_merged_upsample_mmx)\n\nEXTN(jsimd_h2v1_merged_upsample_mmx):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_MMWORD)      ; align to 64 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic eax             ; make a room for GOT address\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx                     ; get GOT address\n        movpic  POINTER [gotptr], ebx   ; save GOT address\n\n        mov     ecx, JDIMENSION [output_width(eax)]     ; col\n        test    ecx,ecx\n        jz      near .return\n\n        push    ecx\n\n        mov     edi, JSAMPIMAGE [input_buf(eax)]\n        mov     ecx, JDIMENSION [in_row_group_ctr(eax)]\n        mov     esi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY]\n        mov     ebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY]\n        mov     edx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY]\n        mov     edi, JSAMPARRAY [output_buf(eax)]\n        mov     esi, JSAMPROW [esi+ecx*SIZEOF_JSAMPROW]         ; inptr0\n        mov     ebx, JSAMPROW [ebx+ecx*SIZEOF_JSAMPROW]         ; inptr1\n        mov     edx, JSAMPROW [edx+ecx*SIZEOF_JSAMPROW]         ; inptr2\n        mov     edi, JSAMPROW [edi]                             ; outptr\n\n        pop     ecx                     ; col\n\n        alignx  16,7\n.columnloop:\n        movpic  eax, POINTER [gotptr]   ; load GOT address (eax)\n\n        movq      mm6, MMWORD [ebx]     ; mm6=Cb(01234567)\n        movq      mm7, MMWORD [edx]     ; mm7=Cr(01234567)\n\n        pxor      mm1,mm1               ; mm1=(all 0's)\n        pcmpeqw   mm3,mm3\n        psllw     mm3,7                 ; mm3={0xFF80 0xFF80 0xFF80 0xFF80}\n\n        movq      mm4,mm6\n        punpckhbw mm6,mm1               ; mm6=Cb(4567)=CbH\n        punpcklbw mm4,mm1               ; mm4=Cb(0123)=CbL\n        movq      mm0,mm7\n        punpckhbw mm7,mm1               ; mm7=Cr(4567)=CrH\n        punpcklbw mm0,mm1               ; mm0=Cr(0123)=CrL\n\n        paddw     mm6,mm3\n        paddw     mm4,mm3\n        paddw     mm7,mm3\n        paddw     mm0,mm3\n\n        ; (Original)\n        ; R = Y                + 1.40200 * Cr\n        ; G = Y - 0.34414 * Cb - 0.71414 * Cr\n        ; B = Y + 1.77200 * Cb\n        ;\n        ; (This implementation)\n        ; R = Y                + 0.40200 * Cr + Cr\n        ; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr\n        ; B = Y - 0.22800 * Cb + Cb + Cb\n\n        movq    mm5,mm6                 ; mm5=CbH\n        movq    mm2,mm4                 ; mm2=CbL\n        paddw   mm6,mm6                 ; mm6=2*CbH\n        paddw   mm4,mm4                 ; mm4=2*CbL\n        movq    mm1,mm7                 ; mm1=CrH\n        movq    mm3,mm0                 ; mm3=CrL\n        paddw   mm7,mm7                 ; mm7=2*CrH\n        paddw   mm0,mm0                 ; mm0=2*CrL\n\n        pmulhw  mm6,[GOTOFF(eax,PW_MF0228)]     ; mm6=(2*CbH * -FIX(0.22800))\n        pmulhw  mm4,[GOTOFF(eax,PW_MF0228)]     ; mm4=(2*CbL * -FIX(0.22800))\n        pmulhw  mm7,[GOTOFF(eax,PW_F0402)]      ; mm7=(2*CrH * FIX(0.40200))\n        pmulhw  mm0,[GOTOFF(eax,PW_F0402)]      ; mm0=(2*CrL * FIX(0.40200))\n\n        paddw   mm6,[GOTOFF(eax,PW_ONE)]\n        paddw   mm4,[GOTOFF(eax,PW_ONE)]\n        psraw   mm6,1                   ; mm6=(CbH * -FIX(0.22800))\n        psraw   mm4,1                   ; mm4=(CbL * -FIX(0.22800))\n        paddw   mm7,[GOTOFF(eax,PW_ONE)]\n        paddw   mm0,[GOTOFF(eax,PW_ONE)]\n        psraw   mm7,1                   ; mm7=(CrH * FIX(0.40200))\n        psraw   mm0,1                   ; mm0=(CrL * FIX(0.40200))\n\n        paddw   mm6,mm5\n        paddw   mm4,mm2\n        paddw   mm6,mm5                 ; mm6=(CbH * FIX(1.77200))=(B-Y)H\n        paddw   mm4,mm2                 ; mm4=(CbL * FIX(1.77200))=(B-Y)L\n        paddw   mm7,mm1                 ; mm7=(CrH * FIX(1.40200))=(R-Y)H\n        paddw   mm0,mm3                 ; mm0=(CrL * FIX(1.40200))=(R-Y)L\n\n        movq    MMWORD [wk(0)], mm6     ; wk(0)=(B-Y)H\n        movq    MMWORD [wk(1)], mm7     ; wk(1)=(R-Y)H\n\n        movq      mm6,mm5\n        movq      mm7,mm2\n        punpcklwd mm5,mm1\n        punpckhwd mm6,mm1\n        pmaddwd   mm5,[GOTOFF(eax,PW_MF0344_F0285)]\n        pmaddwd   mm6,[GOTOFF(eax,PW_MF0344_F0285)]\n        punpcklwd mm2,mm3\n        punpckhwd mm7,mm3\n        pmaddwd   mm2,[GOTOFF(eax,PW_MF0344_F0285)]\n        pmaddwd   mm7,[GOTOFF(eax,PW_MF0344_F0285)]\n\n        paddd     mm5,[GOTOFF(eax,PD_ONEHALF)]\n        paddd     mm6,[GOTOFF(eax,PD_ONEHALF)]\n        psrad     mm5,SCALEBITS\n        psrad     mm6,SCALEBITS\n        paddd     mm2,[GOTOFF(eax,PD_ONEHALF)]\n        paddd     mm7,[GOTOFF(eax,PD_ONEHALF)]\n        psrad     mm2,SCALEBITS\n        psrad     mm7,SCALEBITS\n\n        packssdw  mm5,mm6       ; mm5=CbH*-FIX(0.344)+CrH*FIX(0.285)\n        packssdw  mm2,mm7       ; mm2=CbL*-FIX(0.344)+CrL*FIX(0.285)\n        psubw     mm5,mm1       ; mm5=CbH*-FIX(0.344)+CrH*-FIX(0.714)=(G-Y)H\n        psubw     mm2,mm3       ; mm2=CbL*-FIX(0.344)+CrL*-FIX(0.714)=(G-Y)L\n\n        movq    MMWORD [wk(2)], mm5     ; wk(2)=(G-Y)H\n\n        mov     al,2                    ; Yctr\n        jmp     short .Yloop_1st\n        alignx  16,7\n\n.Yloop_2nd:\n        movq    mm0, MMWORD [wk(1)]     ; mm0=(R-Y)H\n        movq    mm2, MMWORD [wk(2)]     ; mm2=(G-Y)H\n        movq    mm4, MMWORD [wk(0)]     ; mm4=(B-Y)H\n        alignx  16,7\n\n.Yloop_1st:\n        movq    mm7, MMWORD [esi]       ; mm7=Y(01234567)\n\n        pcmpeqw mm6,mm6\n        psrlw   mm6,BYTE_BIT            ; mm6={0xFF 0x00 0xFF 0x00 ..}\n        pand    mm6,mm7                 ; mm6=Y(0246)=YE\n        psrlw   mm7,BYTE_BIT            ; mm7=Y(1357)=YO\n\n        movq    mm1,mm0                 ; mm1=mm0=(R-Y)(L/H)\n        movq    mm3,mm2                 ; mm3=mm2=(G-Y)(L/H)\n        movq    mm5,mm4                 ; mm5=mm4=(B-Y)(L/H)\n\n        paddw     mm0,mm6               ; mm0=((R-Y)+YE)=RE=(R0 R2 R4 R6)\n        paddw     mm1,mm7               ; mm1=((R-Y)+YO)=RO=(R1 R3 R5 R7)\n        packuswb  mm0,mm0               ; mm0=(R0 R2 R4 R6 ** ** ** **)\n        packuswb  mm1,mm1               ; mm1=(R1 R3 R5 R7 ** ** ** **)\n\n        paddw     mm2,mm6               ; mm2=((G-Y)+YE)=GE=(G0 G2 G4 G6)\n        paddw     mm3,mm7               ; mm3=((G-Y)+YO)=GO=(G1 G3 G5 G7)\n        packuswb  mm2,mm2               ; mm2=(G0 G2 G4 G6 ** ** ** **)\n        packuswb  mm3,mm3               ; mm3=(G1 G3 G5 G7 ** ** ** **)\n\n        paddw     mm4,mm6               ; mm4=((B-Y)+YE)=BE=(B0 B2 B4 B6)\n        paddw     mm5,mm7               ; mm5=((B-Y)+YO)=BO=(B1 B3 B5 B7)\n        packuswb  mm4,mm4               ; mm4=(B0 B2 B4 B6 ** ** ** **)\n        packuswb  mm5,mm5               ; mm5=(B1 B3 B5 B7 ** ** ** **)\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n        ; mmA=(00 02 04 06 ** ** ** **), mmB=(01 03 05 07 ** ** ** **)\n        ; mmC=(10 12 14 16 ** ** ** **), mmD=(11 13 15 17 ** ** ** **)\n        ; mmE=(20 22 24 26 ** ** ** **), mmF=(21 23 25 27 ** ** ** **)\n        ; mmG=(** ** ** ** ** ** ** **), mmH=(** ** ** ** ** ** ** **)\n\n        punpcklbw mmA,mmC               ; mmA=(00 10 02 12 04 14 06 16)\n        punpcklbw mmE,mmB               ; mmE=(20 01 22 03 24 05 26 07)\n        punpcklbw mmD,mmF               ; mmD=(11 21 13 23 15 25 17 27)\n\n        movq      mmG,mmA\n        movq      mmH,mmA\n        punpcklwd mmA,mmE               ; mmA=(00 10 20 01 02 12 22 03)\n        punpckhwd mmG,mmE               ; mmG=(04 14 24 05 06 16 26 07)\n\n        psrlq     mmH,2*BYTE_BIT        ; mmH=(02 12 04 14 06 16 -- --)\n        psrlq     mmE,2*BYTE_BIT        ; mmE=(22 03 24 05 26 07 -- --)\n\n        movq      mmC,mmD\n        movq      mmB,mmD\n        punpcklwd mmD,mmH               ; mmD=(11 21 02 12 13 23 04 14)\n        punpckhwd mmC,mmH               ; mmC=(15 25 06 16 17 27 -- --)\n\n        psrlq     mmB,2*BYTE_BIT        ; mmB=(13 23 15 25 17 27 -- --)\n\n        movq      mmF,mmE\n        punpcklwd mmE,mmB               ; mmE=(22 03 13 23 24 05 15 25)\n        punpckhwd mmF,mmB               ; mmF=(26 07 17 27 -- -- -- --)\n\n        punpckldq mmA,mmD               ; mmA=(00 10 20 01 11 21 02 12)\n        punpckldq mmE,mmG               ; mmE=(22 03 13 23 04 14 24 05)\n        punpckldq mmC,mmF               ; mmC=(15 25 06 16 26 07 17 27)\n\n        cmp     ecx, byte SIZEOF_MMWORD\n        jb      short .column_st16\n\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mmA\n        movq    MMWORD [edi+1*SIZEOF_MMWORD], mmE\n        movq    MMWORD [edi+2*SIZEOF_MMWORD], mmC\n\n        sub     ecx, byte SIZEOF_MMWORD\n        jz      near .endcolumn\n\n        add     edi, byte RGB_PIXELSIZE*SIZEOF_MMWORD   ; outptr\n        add     esi, byte SIZEOF_MMWORD                 ; inptr0\n        dec     al                      ; Yctr\n        jnz     near .Yloop_2nd\n\n        add     ebx, byte SIZEOF_MMWORD                 ; inptr1\n        add     edx, byte SIZEOF_MMWORD                 ; inptr2\n        jmp     near .columnloop\n        alignx  16,7\n\n.column_st16:\n        lea     ecx, [ecx+ecx*2]        ; imul ecx, RGB_PIXELSIZE\n        cmp     ecx, byte 2*SIZEOF_MMWORD\n        jb      short .column_st8\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mmA\n        movq    MMWORD [edi+1*SIZEOF_MMWORD], mmE\n        movq    mmA,mmC\n        sub     ecx, byte 2*SIZEOF_MMWORD\n        add     edi, byte 2*SIZEOF_MMWORD\n        jmp     short .column_st4\n.column_st8:\n        cmp     ecx, byte SIZEOF_MMWORD\n        jb      short .column_st4\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mmA\n        movq    mmA,mmE\n        sub     ecx, byte SIZEOF_MMWORD\n        add     edi, byte SIZEOF_MMWORD\n.column_st4:\n        movd    eax,mmA\n        cmp     ecx, byte SIZEOF_DWORD\n        jb      short .column_st2\n        mov     DWORD [edi+0*SIZEOF_DWORD], eax\n        psrlq   mmA,DWORD_BIT\n        movd    eax,mmA\n        sub     ecx, byte SIZEOF_DWORD\n        add     edi, byte SIZEOF_DWORD\n.column_st2:\n        cmp     ecx, byte SIZEOF_WORD\n        jb      short .column_st1\n        mov     WORD [edi+0*SIZEOF_WORD], ax\n        shr     eax,WORD_BIT\n        sub     ecx, byte SIZEOF_WORD\n        add     edi, byte SIZEOF_WORD\n.column_st1:\n        cmp     ecx, byte SIZEOF_BYTE\n        jb      short .endcolumn\n        mov     BYTE [edi+0*SIZEOF_BYTE], al\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n%ifdef RGBX_FILLER_0XFF\n        pcmpeqb   mm6,mm6               ; mm6=(X0 X2 X4 X6 ** ** ** **)\n        pcmpeqb   mm7,mm7               ; mm7=(X1 X3 X5 X7 ** ** ** **)\n%else\n        pxor      mm6,mm6               ; mm6=(X0 X2 X4 X6 ** ** ** **)\n        pxor      mm7,mm7               ; mm7=(X1 X3 X5 X7 ** ** ** **)\n%endif\n        ; mmA=(00 02 04 06 ** ** ** **), mmB=(01 03 05 07 ** ** ** **)\n        ; mmC=(10 12 14 16 ** ** ** **), mmD=(11 13 15 17 ** ** ** **)\n        ; mmE=(20 22 24 26 ** ** ** **), mmF=(21 23 25 27 ** ** ** **)\n        ; mmG=(30 32 34 36 ** ** ** **), mmH=(31 33 35 37 ** ** ** **)\n\n        punpcklbw mmA,mmC               ; mmA=(00 10 02 12 04 14 06 16)\n        punpcklbw mmE,mmG               ; mmE=(20 30 22 32 24 34 26 36)\n        punpcklbw mmB,mmD               ; mmB=(01 11 03 13 05 15 07 17)\n        punpcklbw mmF,mmH               ; mmF=(21 31 23 33 25 35 27 37)\n\n        movq      mmC,mmA\n        punpcklwd mmA,mmE               ; mmA=(00 10 20 30 02 12 22 32)\n        punpckhwd mmC,mmE               ; mmC=(04 14 24 34 06 16 26 36)\n        movq      mmG,mmB\n        punpcklwd mmB,mmF               ; mmB=(01 11 21 31 03 13 23 33)\n        punpckhwd mmG,mmF               ; mmG=(05 15 25 35 07 17 27 37)\n\n        movq      mmD,mmA\n        punpckldq mmA,mmB               ; mmA=(00 10 20 30 01 11 21 31)\n        punpckhdq mmD,mmB               ; mmD=(02 12 22 32 03 13 23 33)\n        movq      mmH,mmC\n        punpckldq mmC,mmG               ; mmC=(04 14 24 34 05 15 25 35)\n        punpckhdq mmH,mmG               ; mmH=(06 16 26 36 07 17 27 37)\n\n        cmp     ecx, byte SIZEOF_MMWORD\n        jb      short .column_st16\n\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mmA\n        movq    MMWORD [edi+1*SIZEOF_MMWORD], mmD\n        movq    MMWORD [edi+2*SIZEOF_MMWORD], mmC\n        movq    MMWORD [edi+3*SIZEOF_MMWORD], mmH\n\n        sub     ecx, byte SIZEOF_MMWORD\n        jz      short .endcolumn\n\n        add     edi, byte RGB_PIXELSIZE*SIZEOF_MMWORD   ; outptr\n        add     esi, byte SIZEOF_MMWORD                 ; inptr0\n        dec     al                      ; Yctr\n        jnz     near .Yloop_2nd\n\n        add     ebx, byte SIZEOF_MMWORD                 ; inptr1\n        add     edx, byte SIZEOF_MMWORD                 ; inptr2\n        jmp     near .columnloop\n        alignx  16,7\n\n.column_st16:\n        cmp     ecx, byte SIZEOF_MMWORD/2\n        jb      short .column_st8\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mmA\n        movq    MMWORD [edi+1*SIZEOF_MMWORD], mmD\n        movq    mmA,mmC\n        movq    mmD,mmH\n        sub     ecx, byte SIZEOF_MMWORD/2\n        add     edi, byte 2*SIZEOF_MMWORD\n.column_st8:\n        cmp     ecx, byte SIZEOF_MMWORD/4\n        jb      short .column_st4\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mmA\n        movq    mmA,mmD\n        sub     ecx, byte SIZEOF_MMWORD/4\n        add     edi, byte 1*SIZEOF_MMWORD\n.column_st4:\n        cmp     ecx, byte SIZEOF_MMWORD/8\n        jb      short .endcolumn\n        movd    DWORD [edi+0*SIZEOF_DWORD], mmA\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n.endcolumn:\n        emms            ; empty MMX state\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.\n;\n; GLOBAL(void)\n; jsimd_h2v2_merged_upsample_mmx (JDIMENSION output_width,\n;                                 JSAMPIMAGE input_buf,\n;                                 JDIMENSION in_row_group_ctr,\n;                                 JSAMPARRAY output_buf);\n;\n\n%define output_width(b) (b)+8                   ; JDIMENSION output_width\n%define input_buf(b)            (b)+12          ; JSAMPIMAGE input_buf\n%define in_row_group_ctr(b)     (b)+16          ; JDIMENSION in_row_group_ctr\n%define output_buf(b)           (b)+20          ; JSAMPARRAY output_buf\n\n        align   16\n        global  EXTN(jsimd_h2v2_merged_upsample_mmx)\n\nEXTN(jsimd_h2v2_merged_upsample_mmx):\n        push    ebp\n        mov     ebp,esp\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        mov     eax, JDIMENSION [output_width(ebp)]\n\n        mov     edi, JSAMPIMAGE [input_buf(ebp)]\n        mov     ecx, JDIMENSION [in_row_group_ctr(ebp)]\n        mov     esi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY]\n        mov     ebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY]\n        mov     edx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY]\n        mov     edi, JSAMPARRAY [output_buf(ebp)]\n        lea     esi, [esi+ecx*SIZEOF_JSAMPROW]\n\n        push    edx                     ; inptr2\n        push    ebx                     ; inptr1\n        push    esi                     ; inptr00\n        mov     ebx,esp\n\n        push    edi                     ; output_buf (outptr0)\n        push    ecx                     ; in_row_group_ctr\n        push    ebx                     ; input_buf\n        push    eax                     ; output_width\n\n        call    near EXTN(jsimd_h2v1_merged_upsample_mmx)\n\n        add     esi, byte SIZEOF_JSAMPROW       ; inptr01\n        add     edi, byte SIZEOF_JSAMPROW       ; outptr1\n        mov     POINTER [ebx+0*SIZEOF_POINTER], esi\n        mov     POINTER [ebx-1*SIZEOF_POINTER], edi\n\n        call    near EXTN(jsimd_h2v1_merged_upsample_mmx)\n\n        add     esp, byte 7*SIZEOF_DWORD\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdmrgext-sse2-64.asm",
    "content": ";\n; jdmrgext.asm - merged upsampling/color conversion (64-bit SSE2)\n;\n; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, 2012, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.\n;\n; GLOBAL(void)\n; jsimd_h2v1_merged_upsample_sse2 (JDIMENSION output_width,\n;                                  JSAMPIMAGE input_buf,\n;                                  JDIMENSION in_row_group_ctr,\n;                                  JSAMPARRAY output_buf);\n;\n\n; r10 = JDIMENSION output_width\n; r11 = JSAMPIMAGE input_buf\n; r12 = JDIMENSION in_row_group_ctr\n; r13 = JSAMPARRAY output_buf\n\n%define wk(i)           rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          3\n\n        align   16\n        global  EXTN(jsimd_h2v1_merged_upsample_sse2)\n\nEXTN(jsimd_h2v1_merged_upsample_sse2):\n        push    rbp\n        mov     rax,rsp                         ; rax = original rbp\n        sub     rsp, byte 4\n        and     rsp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [rsp],rax\n        mov     rbp,rsp                         ; rbp = aligned rbp\n        lea     rsp, [wk(0)]\n        collect_args\n        push    rbx\n\n        mov     ecx, r10d        ; col\n        test    rcx,rcx\n        jz      near .return\n\n        push    rcx\n\n        mov     rdi, r11\n        mov     ecx, r12d\n        mov     rsi, JSAMPARRAY [rdi+0*SIZEOF_JSAMPARRAY]\n        mov     rbx, JSAMPARRAY [rdi+1*SIZEOF_JSAMPARRAY]\n        mov     rdx, JSAMPARRAY [rdi+2*SIZEOF_JSAMPARRAY]\n        mov     rdi, r13\n        mov     rsi, JSAMPROW [rsi+rcx*SIZEOF_JSAMPROW]         ; inptr0\n        mov     rbx, JSAMPROW [rbx+rcx*SIZEOF_JSAMPROW]         ; inptr1\n        mov     rdx, JSAMPROW [rdx+rcx*SIZEOF_JSAMPROW]         ; inptr2\n        mov     rdi, JSAMPROW [rdi]                             ; outptr\n\n        pop     rcx                     ; col\n\n.columnloop:\n\n        movdqa    xmm6, XMMWORD [rbx]   ; xmm6=Cb(0123456789ABCDEF)\n        movdqa    xmm7, XMMWORD [rdx]   ; xmm7=Cr(0123456789ABCDEF)\n\n        pxor      xmm1,xmm1             ; xmm1=(all 0's)\n        pcmpeqw   xmm3,xmm3\n        psllw     xmm3,7                ; xmm3={0xFF80 0xFF80 0xFF80 0xFF80 ..}\n\n        movdqa    xmm4,xmm6\n        punpckhbw xmm6,xmm1             ; xmm6=Cb(89ABCDEF)=CbH\n        punpcklbw xmm4,xmm1             ; xmm4=Cb(01234567)=CbL\n        movdqa    xmm0,xmm7\n        punpckhbw xmm7,xmm1             ; xmm7=Cr(89ABCDEF)=CrH\n        punpcklbw xmm0,xmm1             ; xmm0=Cr(01234567)=CrL\n\n        paddw     xmm6,xmm3\n        paddw     xmm4,xmm3\n        paddw     xmm7,xmm3\n        paddw     xmm0,xmm3\n\n        ; (Original)\n        ; R = Y                + 1.40200 * Cr\n        ; G = Y - 0.34414 * Cb - 0.71414 * Cr\n        ; B = Y + 1.77200 * Cb\n        ;\n        ; (This implementation)\n        ; R = Y                + 0.40200 * Cr + Cr\n        ; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr\n        ; B = Y - 0.22800 * Cb + Cb + Cb\n\n        movdqa  xmm5,xmm6               ; xmm5=CbH\n        movdqa  xmm2,xmm4               ; xmm2=CbL\n        paddw   xmm6,xmm6               ; xmm6=2*CbH\n        paddw   xmm4,xmm4               ; xmm4=2*CbL\n        movdqa  xmm1,xmm7               ; xmm1=CrH\n        movdqa  xmm3,xmm0               ; xmm3=CrL\n        paddw   xmm7,xmm7               ; xmm7=2*CrH\n        paddw   xmm0,xmm0               ; xmm0=2*CrL\n\n        pmulhw  xmm6,[rel PW_MF0228]    ; xmm6=(2*CbH * -FIX(0.22800))\n        pmulhw  xmm4,[rel PW_MF0228]    ; xmm4=(2*CbL * -FIX(0.22800))\n        pmulhw  xmm7,[rel PW_F0402]     ; xmm7=(2*CrH * FIX(0.40200))\n        pmulhw  xmm0,[rel PW_F0402]     ; xmm0=(2*CrL * FIX(0.40200))\n\n        paddw   xmm6,[rel PW_ONE]\n        paddw   xmm4,[rel PW_ONE]\n        psraw   xmm6,1                  ; xmm6=(CbH * -FIX(0.22800))\n        psraw   xmm4,1                  ; xmm4=(CbL * -FIX(0.22800))\n        paddw   xmm7,[rel PW_ONE]\n        paddw   xmm0,[rel PW_ONE]\n        psraw   xmm7,1                  ; xmm7=(CrH * FIX(0.40200))\n        psraw   xmm0,1                  ; xmm0=(CrL * FIX(0.40200))\n\n        paddw   xmm6,xmm5\n        paddw   xmm4,xmm2\n        paddw   xmm6,xmm5               ; xmm6=(CbH * FIX(1.77200))=(B-Y)H\n        paddw   xmm4,xmm2               ; xmm4=(CbL * FIX(1.77200))=(B-Y)L\n        paddw   xmm7,xmm1               ; xmm7=(CrH * FIX(1.40200))=(R-Y)H\n        paddw   xmm0,xmm3               ; xmm0=(CrL * FIX(1.40200))=(R-Y)L\n\n        movdqa  XMMWORD [wk(0)], xmm6   ; wk(0)=(B-Y)H\n        movdqa  XMMWORD [wk(1)], xmm7   ; wk(1)=(R-Y)H\n\n        movdqa    xmm6,xmm5\n        movdqa    xmm7,xmm2\n        punpcklwd xmm5,xmm1\n        punpckhwd xmm6,xmm1\n        pmaddwd   xmm5,[rel PW_MF0344_F0285]\n        pmaddwd   xmm6,[rel PW_MF0344_F0285]\n        punpcklwd xmm2,xmm3\n        punpckhwd xmm7,xmm3\n        pmaddwd   xmm2,[rel PW_MF0344_F0285]\n        pmaddwd   xmm7,[rel PW_MF0344_F0285]\n\n        paddd     xmm5,[rel PD_ONEHALF]\n        paddd     xmm6,[rel PD_ONEHALF]\n        psrad     xmm5,SCALEBITS\n        psrad     xmm6,SCALEBITS\n        paddd     xmm2,[rel PD_ONEHALF]\n        paddd     xmm7,[rel PD_ONEHALF]\n        psrad     xmm2,SCALEBITS\n        psrad     xmm7,SCALEBITS\n\n        packssdw  xmm5,xmm6     ; xmm5=CbH*-FIX(0.344)+CrH*FIX(0.285)\n        packssdw  xmm2,xmm7     ; xmm2=CbL*-FIX(0.344)+CrL*FIX(0.285)\n        psubw     xmm5,xmm1     ; xmm5=CbH*-FIX(0.344)+CrH*-FIX(0.714)=(G-Y)H\n        psubw     xmm2,xmm3     ; xmm2=CbL*-FIX(0.344)+CrL*-FIX(0.714)=(G-Y)L\n\n        movdqa  XMMWORD [wk(2)], xmm5   ; wk(2)=(G-Y)H\n\n        mov     al,2                    ; Yctr\n        jmp     short .Yloop_1st\n\n.Yloop_2nd:\n        movdqa  xmm0, XMMWORD [wk(1)]   ; xmm0=(R-Y)H\n        movdqa  xmm2, XMMWORD [wk(2)]   ; xmm2=(G-Y)H\n        movdqa  xmm4, XMMWORD [wk(0)]   ; xmm4=(B-Y)H\n\n.Yloop_1st:\n        movdqa  xmm7, XMMWORD [rsi]     ; xmm7=Y(0123456789ABCDEF)\n\n        pcmpeqw xmm6,xmm6\n        psrlw   xmm6,BYTE_BIT           ; xmm6={0xFF 0x00 0xFF 0x00 ..}\n        pand    xmm6,xmm7               ; xmm6=Y(02468ACE)=YE\n        psrlw   xmm7,BYTE_BIT           ; xmm7=Y(13579BDF)=YO\n\n        movdqa  xmm1,xmm0               ; xmm1=xmm0=(R-Y)(L/H)\n        movdqa  xmm3,xmm2               ; xmm3=xmm2=(G-Y)(L/H)\n        movdqa  xmm5,xmm4               ; xmm5=xmm4=(B-Y)(L/H)\n\n        paddw     xmm0,xmm6             ; xmm0=((R-Y)+YE)=RE=R(02468ACE)\n        paddw     xmm1,xmm7             ; xmm1=((R-Y)+YO)=RO=R(13579BDF)\n        packuswb  xmm0,xmm0             ; xmm0=R(02468ACE********)\n        packuswb  xmm1,xmm1             ; xmm1=R(13579BDF********)\n\n        paddw     xmm2,xmm6             ; xmm2=((G-Y)+YE)=GE=G(02468ACE)\n        paddw     xmm3,xmm7             ; xmm3=((G-Y)+YO)=GO=G(13579BDF)\n        packuswb  xmm2,xmm2             ; xmm2=G(02468ACE********)\n        packuswb  xmm3,xmm3             ; xmm3=G(13579BDF********)\n\n        paddw     xmm4,xmm6             ; xmm4=((B-Y)+YE)=BE=B(02468ACE)\n        paddw     xmm5,xmm7             ; xmm5=((B-Y)+YO)=BO=B(13579BDF)\n        packuswb  xmm4,xmm4             ; xmm4=B(02468ACE********)\n        packuswb  xmm5,xmm5             ; xmm5=B(13579BDF********)\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n        ; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n        ; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n        ; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n        ; xmmG=(** ** ** ** ** ** ** ** **), xmmH=(** ** ** ** ** ** ** ** **)\n\n        punpcklbw xmmA,xmmC     ; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n        punpcklbw xmmE,xmmB     ; xmmE=(20 01 22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F)\n        punpcklbw xmmD,xmmF     ; xmmD=(11 21 13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F)\n\n        movdqa    xmmG,xmmA\n        movdqa    xmmH,xmmA\n        punpcklwd xmmA,xmmE     ; xmmA=(00 10 20 01 02 12 22 03 04 14 24 05 06 16 26 07)\n        punpckhwd xmmG,xmmE     ; xmmG=(08 18 28 09 0A 1A 2A 0B 0C 1C 2C 0D 0E 1E 2E 0F)\n\n        psrldq    xmmH,2        ; xmmH=(02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E -- --)\n        psrldq    xmmE,2        ; xmmE=(22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F -- --)\n\n        movdqa    xmmC,xmmD\n        movdqa    xmmB,xmmD\n        punpcklwd xmmD,xmmH     ; xmmD=(11 21 02 12 13 23 04 14 15 25 06 16 17 27 08 18)\n        punpckhwd xmmC,xmmH     ; xmmC=(19 29 0A 1A 1B 2B 0C 1C 1D 2D 0E 1E 1F 2F -- --)\n\n        psrldq    xmmB,2        ; xmmB=(13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F -- --)\n\n        movdqa    xmmF,xmmE\n        punpcklwd xmmE,xmmB     ; xmmE=(22 03 13 23 24 05 15 25 26 07 17 27 28 09 19 29)\n        punpckhwd xmmF,xmmB     ; xmmF=(2A 0B 1B 2B 2C 0D 1D 2D 2E 0F 1F 2F -- -- -- --)\n\n        pshufd    xmmH,xmmA,0x4E; xmmH=(04 14 24 05 06 16 26 07 00 10 20 01 02 12 22 03)\n        movdqa    xmmB,xmmE\n        punpckldq xmmA,xmmD     ; xmmA=(00 10 20 01 11 21 02 12 02 12 22 03 13 23 04 14)\n        punpckldq xmmE,xmmH     ; xmmE=(22 03 13 23 04 14 24 05 24 05 15 25 06 16 26 07)\n        punpckhdq xmmD,xmmB     ; xmmD=(15 25 06 16 26 07 17 27 17 27 08 18 28 09 19 29)\n\n        pshufd    xmmH,xmmG,0x4E; xmmH=(0C 1C 2C 0D 0E 1E 2E 0F 08 18 28 09 0A 1A 2A 0B)\n        movdqa    xmmB,xmmF\n        punpckldq xmmG,xmmC     ; xmmG=(08 18 28 09 19 29 0A 1A 0A 1A 2A 0B 1B 2B 0C 1C)\n        punpckldq xmmF,xmmH     ; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 2C 0D 1D 2D 0E 1E 2E 0F)\n        punpckhdq xmmC,xmmB     ; xmmC=(1D 2D 0E 1E 2E 0F 1F 2F 1F 2F -- -- -- -- -- --)\n\n        punpcklqdq xmmA,xmmE    ; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n        punpcklqdq xmmD,xmmG    ; xmmD=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n        punpcklqdq xmmF,xmmC    ; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n        cmp     rcx, byte SIZEOF_XMMWORD\n        jb      short .column_st32\n\n        test    rdi, SIZEOF_XMMWORD-1\n        jnz     short .out1\n        ; --(aligned)-------------------\n        movntdq XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        movntdq XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n        movntdq XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF\n        jmp     short .out0\n.out1:  ; --(unaligned)-----------------\n        movdqu  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n        movdqu  XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF\n.out0:\n        add     rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD  ; outptr\n        sub     rcx, byte SIZEOF_XMMWORD\n        jz      near .endcolumn\n\n        add     rsi, byte SIZEOF_XMMWORD        ; inptr0\n        dec     al                      ; Yctr\n        jnz     near .Yloop_2nd\n\n        add     rbx, byte SIZEOF_XMMWORD        ; inptr1\n        add     rdx, byte SIZEOF_XMMWORD        ; inptr2\n        jmp     near .columnloop\n\n.column_st32:\n        lea     rcx, [rcx+rcx*2]                ; imul ecx, RGB_PIXELSIZE\n        cmp     rcx, byte 2*SIZEOF_XMMWORD\n        jb      short .column_st16\n        movdqu  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n        add     rdi, byte 2*SIZEOF_XMMWORD      ; outptr\n        movdqa  xmmA,xmmF\n        sub     rcx, byte 2*SIZEOF_XMMWORD\n        jmp     short .column_st15\n.column_st16:\n        cmp     rcx, byte SIZEOF_XMMWORD\n        jb      short .column_st15\n        movdqu  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        add     rdi, byte SIZEOF_XMMWORD        ; outptr\n        movdqa  xmmA,xmmD\n        sub     rcx, byte SIZEOF_XMMWORD\n.column_st15:\n        ; Store the lower 8 bytes of xmmA to the output when it has enough\n        ; space.\n        cmp     rcx, byte SIZEOF_MMWORD\n        jb      short .column_st7\n        movq    XMM_MMWORD [rdi], xmmA\n        add     rdi, byte SIZEOF_MMWORD\n        sub     rcx, byte SIZEOF_MMWORD\n        psrldq  xmmA, SIZEOF_MMWORD\n.column_st7:\n        ; Store the lower 4 bytes of xmmA to the output when it has enough\n        ; space.\n        cmp     rcx, byte SIZEOF_DWORD\n        jb      short .column_st3\n        movd    XMM_DWORD [rdi], xmmA\n        add     rdi, byte SIZEOF_DWORD\n        sub     rcx, byte SIZEOF_DWORD\n        psrldq  xmmA, SIZEOF_DWORD\n.column_st3:\n        ; Store the lower 2 bytes of rax to the output when it has enough\n        ; space.\n        movd    eax, xmmA\n        cmp     rcx, byte SIZEOF_WORD\n        jb      short .column_st1\n        mov     WORD [rdi], ax\n        add     rdi, byte SIZEOF_WORD\n        sub     rcx, byte SIZEOF_WORD\n        shr     rax, 16\n.column_st1:\n        ; Store the lower 1 byte of rax to the output when it has enough\n        ; space.\n        test    rcx, rcx\n        jz      short .endcolumn\n        mov     BYTE [rdi], al\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n%ifdef RGBX_FILLER_0XFF\n        pcmpeqb   xmm6,xmm6             ; xmm6=XE=X(02468ACE********)\n        pcmpeqb   xmm7,xmm7             ; xmm7=XO=X(13579BDF********)\n%else\n        pxor      xmm6,xmm6             ; xmm6=XE=X(02468ACE********)\n        pxor      xmm7,xmm7             ; xmm7=XO=X(13579BDF********)\n%endif\n        ; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n        ; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n        ; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n        ; xmmG=(30 32 34 36 38 3A 3C 3E **), xmmH=(31 33 35 37 39 3B 3D 3F **)\n\n        punpcklbw xmmA,xmmC     ; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n        punpcklbw xmmE,xmmG     ; xmmE=(20 30 22 32 24 34 26 36 28 38 2A 3A 2C 3C 2E 3E)\n        punpcklbw xmmB,xmmD     ; xmmB=(01 11 03 13 05 15 07 17 09 19 0B 1B 0D 1D 0F 1F)\n        punpcklbw xmmF,xmmH     ; xmmF=(21 31 23 33 25 35 27 37 29 39 2B 3B 2D 3D 2F 3F)\n\n        movdqa    xmmC,xmmA\n        punpcklwd xmmA,xmmE     ; xmmA=(00 10 20 30 02 12 22 32 04 14 24 34 06 16 26 36)\n        punpckhwd xmmC,xmmE     ; xmmC=(08 18 28 38 0A 1A 2A 3A 0C 1C 2C 3C 0E 1E 2E 3E)\n        movdqa    xmmG,xmmB\n        punpcklwd xmmB,xmmF     ; xmmB=(01 11 21 31 03 13 23 33 05 15 25 35 07 17 27 37)\n        punpckhwd xmmG,xmmF     ; xmmG=(09 19 29 39 0B 1B 2B 3B 0D 1D 2D 3D 0F 1F 2F 3F)\n\n        movdqa    xmmD,xmmA\n        punpckldq xmmA,xmmB     ; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n        punpckhdq xmmD,xmmB     ; xmmD=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n        movdqa    xmmH,xmmC\n        punpckldq xmmC,xmmG     ; xmmC=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n        punpckhdq xmmH,xmmG     ; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n        cmp     rcx, byte SIZEOF_XMMWORD\n        jb      short .column_st32\n\n        test    rdi, SIZEOF_XMMWORD-1\n        jnz     short .out1\n        ; --(aligned)-------------------\n        movntdq XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        movntdq XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n        movntdq XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC\n        movntdq XMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH\n        jmp     short .out0\n.out1:  ; --(unaligned)-----------------\n        movdqu  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n        movdqu  XMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC\n        movdqu  XMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH\n.out0:\n        add     rdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD  ; outptr\n        sub     rcx, byte SIZEOF_XMMWORD\n        jz      near .endcolumn\n\n        add     rsi, byte SIZEOF_XMMWORD        ; inptr0\n        dec     al                      ; Yctr\n        jnz     near .Yloop_2nd\n\n        add     rbx, byte SIZEOF_XMMWORD        ; inptr1\n        add     rdx, byte SIZEOF_XMMWORD        ; inptr2\n        jmp     near .columnloop\n\n.column_st32:\n        cmp     rcx, byte SIZEOF_XMMWORD/2\n        jb      short .column_st16\n        movdqu  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n        add     rdi, byte 2*SIZEOF_XMMWORD      ; outptr\n        movdqa  xmmA,xmmC\n        movdqa  xmmD,xmmH\n        sub     rcx, byte SIZEOF_XMMWORD/2\n.column_st16:\n        cmp     rcx, byte SIZEOF_XMMWORD/4\n        jb      short .column_st15\n        movdqu  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n        add     rdi, byte SIZEOF_XMMWORD        ; outptr\n        movdqa  xmmA,xmmD\n        sub     rcx, byte SIZEOF_XMMWORD/4\n.column_st15:\n        ; Store two pixels (8 bytes) of xmmA to the output when it has enough\n        ; space.\n        cmp     rcx, byte SIZEOF_XMMWORD/8\n        jb      short .column_st7\n        movq    XMM_MMWORD [rdi], xmmA\n        add     rdi, byte SIZEOF_XMMWORD/8*4\n        sub     rcx, byte SIZEOF_XMMWORD/8\n        psrldq  xmmA, SIZEOF_XMMWORD/8*4\n.column_st7:\n        ; Store one pixel (4 bytes) of xmmA to the output when it has enough\n        ; space.\n        test    rcx, rcx\n        jz      short .endcolumn\n        movd    XMM_DWORD [rdi], xmmA\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n.endcolumn:\n        sfence          ; flush the write buffer\n\n.return:\n        pop     rbx\n        uncollect_args\n        mov     rsp,rbp         ; rsp <- aligned rbp\n        pop     rsp             ; rsp <- original rbp\n        pop     rbp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.\n;\n; GLOBAL(void)\n; jsimd_h2v2_merged_upsample_sse2 (JDIMENSION output_width,\n;                                  JSAMPIMAGE input_buf,\n;                                  JDIMENSION in_row_group_ctr,\n;                                  JSAMPARRAY output_buf);\n;\n\n; r10 = JDIMENSION output_width\n; r11 = JSAMPIMAGE input_buf\n; r12 = JDIMENSION in_row_group_ctr\n; r13 = JSAMPARRAY output_buf\n\n        align   16\n        global  EXTN(jsimd_h2v2_merged_upsample_sse2)\n\nEXTN(jsimd_h2v2_merged_upsample_sse2):\n        push    rbp\n        mov     rax,rsp\n        mov     rbp,rsp\n        collect_args\n        push    rbx\n\n        mov     eax, r10d\n\n        mov     rdi, r11\n        mov     ecx, r12d\n        mov     rsi, JSAMPARRAY [rdi+0*SIZEOF_JSAMPARRAY]\n        mov     rbx, JSAMPARRAY [rdi+1*SIZEOF_JSAMPARRAY]\n        mov     rdx, JSAMPARRAY [rdi+2*SIZEOF_JSAMPARRAY]\n        mov     rdi, r13\n        lea     rsi, [rsi+rcx*SIZEOF_JSAMPROW]\n\n        push    rdx                     ; inptr2\n        push    rbx                     ; inptr1\n        push    rsi                     ; inptr00\n        mov     rbx,rsp\n\n        push    rdi\n        push    rcx\n        push    rax\n\n        %ifdef WIN64\n        mov r8, rcx\n        mov r9, rdi\n        mov rcx, rax\n        mov rdx, rbx\n        %else\n        mov rdx, rcx\n        mov rcx, rdi\n        mov     rdi, rax\n        mov rsi, rbx\n        %endif\n\n        call    EXTN(jsimd_h2v1_merged_upsample_sse2)\n\n        pop rax\n        pop rcx\n        pop rdi\n        pop rsi\n        pop rbx\n        pop rdx\n\n        add     rdi, byte SIZEOF_JSAMPROW       ; outptr1\n        add     rsi, byte SIZEOF_JSAMPROW       ; inptr01\n\n        push    rdx                     ; inptr2\n        push    rbx                     ; inptr1\n        push    rsi                     ; inptr00\n        mov     rbx,rsp\n\n        push    rdi\n        push    rcx\n        push    rax\n\n        %ifdef WIN64\n        mov r8, rcx\n        mov r9, rdi\n        mov rcx, rax\n        mov rdx, rbx\n        %else\n        mov rdx, rcx\n        mov rcx, rdi\n        mov     rdi, rax\n        mov rsi, rbx\n        %endif\n\n        call    EXTN(jsimd_h2v1_merged_upsample_sse2)\n\n        pop rax\n        pop rcx\n        pop rdi\n        pop rsi\n        pop rbx\n        pop rdx\n\n        pop     rbx\n        uncollect_args\n        pop     rbp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdmrgext-sse2.asm",
    "content": ";\n; jdmrgext.asm - merged upsampling/color conversion (SSE2)\n;\n; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2012, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.\n;\n; GLOBAL(void)\n; jsimd_h2v1_merged_upsample_sse2 (JDIMENSION output_width,\n;                                  JSAMPIMAGE input_buf,\n;                                  JDIMENSION in_row_group_ctr,\n;                                  JSAMPARRAY output_buf);\n;\n\n%define output_width(b) (b)+8                   ; JDIMENSION output_width\n%define input_buf(b)            (b)+12          ; JSAMPIMAGE input_buf\n%define in_row_group_ctr(b)     (b)+16          ; JDIMENSION in_row_group_ctr\n%define output_buf(b)           (b)+20          ; JSAMPARRAY output_buf\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          3\n%define gotptr          wk(0)-SIZEOF_POINTER    ; void * gotptr\n\n        align   16\n        global  EXTN(jsimd_h2v1_merged_upsample_sse2)\n\nEXTN(jsimd_h2v1_merged_upsample_sse2):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic eax             ; make a room for GOT address\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx                     ; get GOT address\n        movpic  POINTER [gotptr], ebx   ; save GOT address\n\n        mov     ecx, JDIMENSION [output_width(eax)]     ; col\n        test    ecx,ecx\n        jz      near .return\n\n        push    ecx\n\n        mov     edi, JSAMPIMAGE [input_buf(eax)]\n        mov     ecx, JDIMENSION [in_row_group_ctr(eax)]\n        mov     esi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY]\n        mov     ebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY]\n        mov     edx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY]\n        mov     edi, JSAMPARRAY [output_buf(eax)]\n        mov     esi, JSAMPROW [esi+ecx*SIZEOF_JSAMPROW]         ; inptr0\n        mov     ebx, JSAMPROW [ebx+ecx*SIZEOF_JSAMPROW]         ; inptr1\n        mov     edx, JSAMPROW [edx+ecx*SIZEOF_JSAMPROW]         ; inptr2\n        mov     edi, JSAMPROW [edi]                             ; outptr\n\n        pop     ecx                     ; col\n\n        alignx  16,7\n.columnloop:\n        movpic  eax, POINTER [gotptr]   ; load GOT address (eax)\n\n        movdqa    xmm6, XMMWORD [ebx]   ; xmm6=Cb(0123456789ABCDEF)\n        movdqa    xmm7, XMMWORD [edx]   ; xmm7=Cr(0123456789ABCDEF)\n\n        pxor      xmm1,xmm1             ; xmm1=(all 0's)\n        pcmpeqw   xmm3,xmm3\n        psllw     xmm3,7                ; xmm3={0xFF80 0xFF80 0xFF80 0xFF80 ..}\n\n        movdqa    xmm4,xmm6\n        punpckhbw xmm6,xmm1             ; xmm6=Cb(89ABCDEF)=CbH\n        punpcklbw xmm4,xmm1             ; xmm4=Cb(01234567)=CbL\n        movdqa    xmm0,xmm7\n        punpckhbw xmm7,xmm1             ; xmm7=Cr(89ABCDEF)=CrH\n        punpcklbw xmm0,xmm1             ; xmm0=Cr(01234567)=CrL\n\n        paddw     xmm6,xmm3\n        paddw     xmm4,xmm3\n        paddw     xmm7,xmm3\n        paddw     xmm0,xmm3\n\n        ; (Original)\n        ; R = Y                + 1.40200 * Cr\n        ; G = Y - 0.34414 * Cb - 0.71414 * Cr\n        ; B = Y + 1.77200 * Cb\n        ;\n        ; (This implementation)\n        ; R = Y                + 0.40200 * Cr + Cr\n        ; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr\n        ; B = Y - 0.22800 * Cb + Cb + Cb\n\n        movdqa  xmm5,xmm6               ; xmm5=CbH\n        movdqa  xmm2,xmm4               ; xmm2=CbL\n        paddw   xmm6,xmm6               ; xmm6=2*CbH\n        paddw   xmm4,xmm4               ; xmm4=2*CbL\n        movdqa  xmm1,xmm7               ; xmm1=CrH\n        movdqa  xmm3,xmm0               ; xmm3=CrL\n        paddw   xmm7,xmm7               ; xmm7=2*CrH\n        paddw   xmm0,xmm0               ; xmm0=2*CrL\n\n        pmulhw  xmm6,[GOTOFF(eax,PW_MF0228)]    ; xmm6=(2*CbH * -FIX(0.22800))\n        pmulhw  xmm4,[GOTOFF(eax,PW_MF0228)]    ; xmm4=(2*CbL * -FIX(0.22800))\n        pmulhw  xmm7,[GOTOFF(eax,PW_F0402)]     ; xmm7=(2*CrH * FIX(0.40200))\n        pmulhw  xmm0,[GOTOFF(eax,PW_F0402)]     ; xmm0=(2*CrL * FIX(0.40200))\n\n        paddw   xmm6,[GOTOFF(eax,PW_ONE)]\n        paddw   xmm4,[GOTOFF(eax,PW_ONE)]\n        psraw   xmm6,1                  ; xmm6=(CbH * -FIX(0.22800))\n        psraw   xmm4,1                  ; xmm4=(CbL * -FIX(0.22800))\n        paddw   xmm7,[GOTOFF(eax,PW_ONE)]\n        paddw   xmm0,[GOTOFF(eax,PW_ONE)]\n        psraw   xmm7,1                  ; xmm7=(CrH * FIX(0.40200))\n        psraw   xmm0,1                  ; xmm0=(CrL * FIX(0.40200))\n\n        paddw   xmm6,xmm5\n        paddw   xmm4,xmm2\n        paddw   xmm6,xmm5               ; xmm6=(CbH * FIX(1.77200))=(B-Y)H\n        paddw   xmm4,xmm2               ; xmm4=(CbL * FIX(1.77200))=(B-Y)L\n        paddw   xmm7,xmm1               ; xmm7=(CrH * FIX(1.40200))=(R-Y)H\n        paddw   xmm0,xmm3               ; xmm0=(CrL * FIX(1.40200))=(R-Y)L\n\n        movdqa  XMMWORD [wk(0)], xmm6   ; wk(0)=(B-Y)H\n        movdqa  XMMWORD [wk(1)], xmm7   ; wk(1)=(R-Y)H\n\n        movdqa    xmm6,xmm5\n        movdqa    xmm7,xmm2\n        punpcklwd xmm5,xmm1\n        punpckhwd xmm6,xmm1\n        pmaddwd   xmm5,[GOTOFF(eax,PW_MF0344_F0285)]\n        pmaddwd   xmm6,[GOTOFF(eax,PW_MF0344_F0285)]\n        punpcklwd xmm2,xmm3\n        punpckhwd xmm7,xmm3\n        pmaddwd   xmm2,[GOTOFF(eax,PW_MF0344_F0285)]\n        pmaddwd   xmm7,[GOTOFF(eax,PW_MF0344_F0285)]\n\n        paddd     xmm5,[GOTOFF(eax,PD_ONEHALF)]\n        paddd     xmm6,[GOTOFF(eax,PD_ONEHALF)]\n        psrad     xmm5,SCALEBITS\n        psrad     xmm6,SCALEBITS\n        paddd     xmm2,[GOTOFF(eax,PD_ONEHALF)]\n        paddd     xmm7,[GOTOFF(eax,PD_ONEHALF)]\n        psrad     xmm2,SCALEBITS\n        psrad     xmm7,SCALEBITS\n\n        packssdw  xmm5,xmm6     ; xmm5=CbH*-FIX(0.344)+CrH*FIX(0.285)\n        packssdw  xmm2,xmm7     ; xmm2=CbL*-FIX(0.344)+CrL*FIX(0.285)\n        psubw     xmm5,xmm1     ; xmm5=CbH*-FIX(0.344)+CrH*-FIX(0.714)=(G-Y)H\n        psubw     xmm2,xmm3     ; xmm2=CbL*-FIX(0.344)+CrL*-FIX(0.714)=(G-Y)L\n\n        movdqa  XMMWORD [wk(2)], xmm5   ; wk(2)=(G-Y)H\n\n        mov     al,2                    ; Yctr\n        jmp     short .Yloop_1st\n        alignx  16,7\n\n.Yloop_2nd:\n        movdqa  xmm0, XMMWORD [wk(1)]   ; xmm0=(R-Y)H\n        movdqa  xmm2, XMMWORD [wk(2)]   ; xmm2=(G-Y)H\n        movdqa  xmm4, XMMWORD [wk(0)]   ; xmm4=(B-Y)H\n        alignx  16,7\n\n.Yloop_1st:\n        movdqa  xmm7, XMMWORD [esi]     ; xmm7=Y(0123456789ABCDEF)\n\n        pcmpeqw xmm6,xmm6\n        psrlw   xmm6,BYTE_BIT           ; xmm6={0xFF 0x00 0xFF 0x00 ..}\n        pand    xmm6,xmm7               ; xmm6=Y(02468ACE)=YE\n        psrlw   xmm7,BYTE_BIT           ; xmm7=Y(13579BDF)=YO\n\n        movdqa  xmm1,xmm0               ; xmm1=xmm0=(R-Y)(L/H)\n        movdqa  xmm3,xmm2               ; xmm3=xmm2=(G-Y)(L/H)\n        movdqa  xmm5,xmm4               ; xmm5=xmm4=(B-Y)(L/H)\n\n        paddw     xmm0,xmm6             ; xmm0=((R-Y)+YE)=RE=R(02468ACE)\n        paddw     xmm1,xmm7             ; xmm1=((R-Y)+YO)=RO=R(13579BDF)\n        packuswb  xmm0,xmm0             ; xmm0=R(02468ACE********)\n        packuswb  xmm1,xmm1             ; xmm1=R(13579BDF********)\n\n        paddw     xmm2,xmm6             ; xmm2=((G-Y)+YE)=GE=G(02468ACE)\n        paddw     xmm3,xmm7             ; xmm3=((G-Y)+YO)=GO=G(13579BDF)\n        packuswb  xmm2,xmm2             ; xmm2=G(02468ACE********)\n        packuswb  xmm3,xmm3             ; xmm3=G(13579BDF********)\n\n        paddw     xmm4,xmm6             ; xmm4=((B-Y)+YE)=BE=B(02468ACE)\n        paddw     xmm5,xmm7             ; xmm5=((B-Y)+YO)=BO=B(13579BDF)\n        packuswb  xmm4,xmm4             ; xmm4=B(02468ACE********)\n        packuswb  xmm5,xmm5             ; xmm5=B(13579BDF********)\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n        ; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n        ; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n        ; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n        ; xmmG=(** ** ** ** ** ** ** ** **), xmmH=(** ** ** ** ** ** ** ** **)\n\n        punpcklbw xmmA,xmmC     ; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n        punpcklbw xmmE,xmmB     ; xmmE=(20 01 22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F)\n        punpcklbw xmmD,xmmF     ; xmmD=(11 21 13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F)\n\n        movdqa    xmmG,xmmA\n        movdqa    xmmH,xmmA\n        punpcklwd xmmA,xmmE     ; xmmA=(00 10 20 01 02 12 22 03 04 14 24 05 06 16 26 07)\n        punpckhwd xmmG,xmmE     ; xmmG=(08 18 28 09 0A 1A 2A 0B 0C 1C 2C 0D 0E 1E 2E 0F)\n\n        psrldq    xmmH,2        ; xmmH=(02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E -- --)\n        psrldq    xmmE,2        ; xmmE=(22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F -- --)\n\n        movdqa    xmmC,xmmD\n        movdqa    xmmB,xmmD\n        punpcklwd xmmD,xmmH     ; xmmD=(11 21 02 12 13 23 04 14 15 25 06 16 17 27 08 18)\n        punpckhwd xmmC,xmmH     ; xmmC=(19 29 0A 1A 1B 2B 0C 1C 1D 2D 0E 1E 1F 2F -- --)\n\n        psrldq    xmmB,2        ; xmmB=(13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F -- --)\n\n        movdqa    xmmF,xmmE\n        punpcklwd xmmE,xmmB     ; xmmE=(22 03 13 23 24 05 15 25 26 07 17 27 28 09 19 29)\n        punpckhwd xmmF,xmmB     ; xmmF=(2A 0B 1B 2B 2C 0D 1D 2D 2E 0F 1F 2F -- -- -- --)\n\n        pshufd    xmmH,xmmA,0x4E; xmmH=(04 14 24 05 06 16 26 07 00 10 20 01 02 12 22 03)\n        movdqa    xmmB,xmmE\n        punpckldq xmmA,xmmD     ; xmmA=(00 10 20 01 11 21 02 12 02 12 22 03 13 23 04 14)\n        punpckldq xmmE,xmmH     ; xmmE=(22 03 13 23 04 14 24 05 24 05 15 25 06 16 26 07)\n        punpckhdq xmmD,xmmB     ; xmmD=(15 25 06 16 26 07 17 27 17 27 08 18 28 09 19 29)\n\n        pshufd    xmmH,xmmG,0x4E; xmmH=(0C 1C 2C 0D 0E 1E 2E 0F 08 18 28 09 0A 1A 2A 0B)\n        movdqa    xmmB,xmmF\n        punpckldq xmmG,xmmC     ; xmmG=(08 18 28 09 19 29 0A 1A 0A 1A 2A 0B 1B 2B 0C 1C)\n        punpckldq xmmF,xmmH     ; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 2C 0D 1D 2D 0E 1E 2E 0F)\n        punpckhdq xmmC,xmmB     ; xmmC=(1D 2D 0E 1E 2E 0F 1F 2F 1F 2F -- -- -- -- -- --)\n\n        punpcklqdq xmmA,xmmE    ; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n        punpcklqdq xmmD,xmmG    ; xmmD=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n        punpcklqdq xmmF,xmmC    ; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n        cmp     ecx, byte SIZEOF_XMMWORD\n        jb      short .column_st32\n\n        test    edi, SIZEOF_XMMWORD-1\n        jnz     short .out1\n        ; --(aligned)-------------------\n        movntdq XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        movntdq XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n        movntdq XMMWORD [edi+2*SIZEOF_XMMWORD], xmmF\n        jmp     short .out0\n.out1:  ; --(unaligned)-----------------\n        movdqu  XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n        movdqu  XMMWORD [edi+2*SIZEOF_XMMWORD], xmmF\n.out0:\n        add     edi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD  ; outptr\n        sub     ecx, byte SIZEOF_XMMWORD\n        jz      near .endcolumn\n\n        add     esi, byte SIZEOF_XMMWORD        ; inptr0\n        dec     al                      ; Yctr\n        jnz     near .Yloop_2nd\n\n        add     ebx, byte SIZEOF_XMMWORD        ; inptr1\n        add     edx, byte SIZEOF_XMMWORD        ; inptr2\n        jmp     near .columnloop\n        alignx  16,7\n\n.column_st32:\n        lea     ecx, [ecx+ecx*2]                ; imul ecx, RGB_PIXELSIZE\n        cmp     ecx, byte 2*SIZEOF_XMMWORD\n        jb      short .column_st16\n        movdqu  XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n        add     edi, byte 2*SIZEOF_XMMWORD      ; outptr\n        movdqa  xmmA,xmmF\n        sub     ecx, byte 2*SIZEOF_XMMWORD\n        jmp     short .column_st15\n.column_st16:\n        cmp     ecx, byte SIZEOF_XMMWORD\n        jb      short .column_st15\n        movdqu  XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        add     edi, byte SIZEOF_XMMWORD        ; outptr\n        movdqa  xmmA,xmmD\n        sub     ecx, byte SIZEOF_XMMWORD\n.column_st15:\n        ; Store the lower 8 bytes of xmmA to the output when it has enough\n        ; space.\n        cmp     ecx, byte SIZEOF_MMWORD\n        jb      short .column_st7\n        movq    XMM_MMWORD [edi], xmmA\n        add     edi, byte SIZEOF_MMWORD\n        sub     ecx, byte SIZEOF_MMWORD\n        psrldq  xmmA, SIZEOF_MMWORD\n.column_st7:\n        ; Store the lower 4 bytes of xmmA to the output when it has enough\n        ; space.\n        cmp     ecx, byte SIZEOF_DWORD\n        jb      short .column_st3\n        movd    XMM_DWORD [edi], xmmA\n        add     edi, byte SIZEOF_DWORD\n        sub     ecx, byte SIZEOF_DWORD\n        psrldq  xmmA, SIZEOF_DWORD\n.column_st3:\n        ; Store the lower 2 bytes of eax to the output when it has enough\n        ; space.\n        movd    eax, xmmA\n        cmp     ecx, byte SIZEOF_WORD\n        jb      short .column_st1\n        mov     WORD [edi], ax\n        add     edi, byte SIZEOF_WORD\n        sub     ecx, byte SIZEOF_WORD\n        shr     eax, 16\n.column_st1:\n        ; Store the lower 1 byte of eax to the output when it has enough\n        ; space.\n        test    ecx, ecx\n        jz      short .endcolumn\n        mov     BYTE [edi], al\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n%ifdef RGBX_FILLER_0XFF\n        pcmpeqb   xmm6,xmm6             ; xmm6=XE=X(02468ACE********)\n        pcmpeqb   xmm7,xmm7             ; xmm7=XO=X(13579BDF********)\n%else\n        pxor      xmm6,xmm6             ; xmm6=XE=X(02468ACE********)\n        pxor      xmm7,xmm7             ; xmm7=XO=X(13579BDF********)\n%endif\n        ; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n        ; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n        ; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n        ; xmmG=(30 32 34 36 38 3A 3C 3E **), xmmH=(31 33 35 37 39 3B 3D 3F **)\n\n        punpcklbw xmmA,xmmC     ; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n        punpcklbw xmmE,xmmG     ; xmmE=(20 30 22 32 24 34 26 36 28 38 2A 3A 2C 3C 2E 3E)\n        punpcklbw xmmB,xmmD     ; xmmB=(01 11 03 13 05 15 07 17 09 19 0B 1B 0D 1D 0F 1F)\n        punpcklbw xmmF,xmmH     ; xmmF=(21 31 23 33 25 35 27 37 29 39 2B 3B 2D 3D 2F 3F)\n\n        movdqa    xmmC,xmmA\n        punpcklwd xmmA,xmmE     ; xmmA=(00 10 20 30 02 12 22 32 04 14 24 34 06 16 26 36)\n        punpckhwd xmmC,xmmE     ; xmmC=(08 18 28 38 0A 1A 2A 3A 0C 1C 2C 3C 0E 1E 2E 3E)\n        movdqa    xmmG,xmmB\n        punpcklwd xmmB,xmmF     ; xmmB=(01 11 21 31 03 13 23 33 05 15 25 35 07 17 27 37)\n        punpckhwd xmmG,xmmF     ; xmmG=(09 19 29 39 0B 1B 2B 3B 0D 1D 2D 3D 0F 1F 2F 3F)\n\n        movdqa    xmmD,xmmA\n        punpckldq xmmA,xmmB     ; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n        punpckhdq xmmD,xmmB     ; xmmD=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n        movdqa    xmmH,xmmC\n        punpckldq xmmC,xmmG     ; xmmC=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n        punpckhdq xmmH,xmmG     ; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n        cmp     ecx, byte SIZEOF_XMMWORD\n        jb      short .column_st32\n\n        test    edi, SIZEOF_XMMWORD-1\n        jnz     short .out1\n        ; --(aligned)-------------------\n        movntdq XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        movntdq XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n        movntdq XMMWORD [edi+2*SIZEOF_XMMWORD], xmmC\n        movntdq XMMWORD [edi+3*SIZEOF_XMMWORD], xmmH\n        jmp     short .out0\n.out1:  ; --(unaligned)-----------------\n        movdqu  XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n        movdqu  XMMWORD [edi+2*SIZEOF_XMMWORD], xmmC\n        movdqu  XMMWORD [edi+3*SIZEOF_XMMWORD], xmmH\n.out0:\n        add     edi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD  ; outptr\n        sub     ecx, byte SIZEOF_XMMWORD\n        jz      near .endcolumn\n\n        add     esi, byte SIZEOF_XMMWORD        ; inptr0\n        dec     al                      ; Yctr\n        jnz     near .Yloop_2nd\n\n        add     ebx, byte SIZEOF_XMMWORD        ; inptr1\n        add     edx, byte SIZEOF_XMMWORD        ; inptr2\n        jmp     near .columnloop\n        alignx  16,7\n\n.column_st32:\n        cmp     ecx, byte SIZEOF_XMMWORD/2\n        jb      short .column_st16\n        movdqu  XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        movdqu  XMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n        add     edi, byte 2*SIZEOF_XMMWORD      ; outptr\n        movdqa  xmmA,xmmC\n        movdqa  xmmD,xmmH\n        sub     ecx, byte SIZEOF_XMMWORD/2\n.column_st16:\n        cmp     ecx, byte SIZEOF_XMMWORD/4\n        jb      short .column_st15\n        movdqu  XMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n        add     edi, byte SIZEOF_XMMWORD        ; outptr\n        movdqa  xmmA,xmmD\n        sub     ecx, byte SIZEOF_XMMWORD/4\n.column_st15:\n        ; Store two pixels (8 bytes) of xmmA to the output when it has enough\n        ; space.\n        cmp     ecx, byte SIZEOF_XMMWORD/8\n        jb      short .column_st7\n        movq    XMM_MMWORD [edi], xmmA\n        add     edi, byte SIZEOF_XMMWORD/8*4\n        sub     ecx, byte SIZEOF_XMMWORD/8\n        psrldq  xmmA, SIZEOF_XMMWORD/8*4\n.column_st7:\n        ; Store one pixel (4 bytes) of xmmA to the output when it has enough\n        ; space.\n        test    ecx, ecx\n        jz      short .endcolumn\n        movd    XMM_DWORD [edi], xmmA\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n.endcolumn:\n        sfence          ; flush the write buffer\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.\n;\n; GLOBAL(void)\n; jsimd_h2v2_merged_upsample_sse2 (JDIMENSION output_width,\n;                                  JSAMPIMAGE input_buf,\n;                                  JDIMENSION in_row_group_ctr,\n;                                  JSAMPARRAY output_buf);\n;\n\n%define output_width(b) (b)+8                   ; JDIMENSION output_width\n%define input_buf(b)            (b)+12          ; JSAMPIMAGE input_buf\n%define in_row_group_ctr(b)     (b)+16          ; JDIMENSION in_row_group_ctr\n%define output_buf(b)           (b)+20          ; JSAMPARRAY output_buf\n\n        align   16\n        global  EXTN(jsimd_h2v2_merged_upsample_sse2)\n\nEXTN(jsimd_h2v2_merged_upsample_sse2):\n        push    ebp\n        mov     ebp,esp\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        mov     eax, POINTER [output_width(ebp)]\n\n        mov     edi, JSAMPIMAGE [input_buf(ebp)]\n        mov     ecx, JDIMENSION [in_row_group_ctr(ebp)]\n        mov     esi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY]\n        mov     ebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY]\n        mov     edx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY]\n        mov     edi, JSAMPARRAY [output_buf(ebp)]\n        lea     esi, [esi+ecx*SIZEOF_JSAMPROW]\n\n        push    edx                     ; inptr2\n        push    ebx                     ; inptr1\n        push    esi                     ; inptr00\n        mov     ebx,esp\n\n        push    edi                     ; output_buf (outptr0)\n        push    ecx                     ; in_row_group_ctr\n        push    ebx                     ; input_buf\n        push    eax                     ; output_width\n\n        call    near EXTN(jsimd_h2v1_merged_upsample_sse2)\n\n        add     esi, byte SIZEOF_JSAMPROW       ; inptr01\n        add     edi, byte SIZEOF_JSAMPROW       ; outptr1\n        mov     POINTER [ebx+0*SIZEOF_POINTER], esi\n        mov     POINTER [ebx-1*SIZEOF_POINTER], edi\n\n        call    near EXTN(jsimd_h2v1_merged_upsample_sse2)\n\n        add     esp, byte 7*SIZEOF_DWORD\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdsample-altivec.c",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2015, D. R. Commander.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n/* CHROMA UPSAMPLING */\n\n#include \"jsimd_altivec.h\"\n\n\nvoid\njsimd_h2v1_fancy_upsample_altivec (int max_v_samp_factor,\n                                   JDIMENSION downsampled_width,\n                                   JSAMPARRAY input_data,\n                                   JSAMPARRAY *output_data_ptr)\n{\n  JSAMPARRAY output_data = *output_data_ptr;\n  JSAMPROW inptr, outptr;\n  int inrow, incol;\n\n  __vector unsigned char this0, last0, p_last0, next0 = {0}, p_next0,\n    out;\n  __vector short this0e, this0o, this0l, this0h, last0l, last0h,\n    next0l, next0h, outle, outhe, outlo, outho;\n\n  /* Constants */\n  __vector unsigned char pb_zero = { __16X(0) }, pb_three = { __16X(3) },\n    last_index_col0 = {0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14},\n    last_index = {15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30},\n    next_index = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16},\n    next_index_lastcol = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,15},\n#if __BIG_ENDIAN__\n    merge_pack_index = {1,17,3,19,5,21,7,23,9,25,11,27,13,29,15,31};\n#else\n    merge_pack_index = {0,16,2,18,4,20,6,22,8,24,10,26,12,28,14,30};\n#endif\n  __vector short pw_one = { __8X(1) }, pw_two = { __8X(2) };\n\n  for (inrow = 0; inrow < max_v_samp_factor; inrow++) {\n    inptr = input_data[inrow];\n    outptr = output_data[inrow];\n\n    if (downsampled_width & 15)\n      inptr[downsampled_width] = inptr[downsampled_width - 1];\n\n    this0 = vec_ld(0, inptr);\n    p_last0 = vec_perm(this0, this0, last_index_col0);\n    last0 = this0;\n\n    for (incol = downsampled_width; incol > 0;\n         incol -= 16, inptr += 16, outptr += 32) {\n\n      if (downsampled_width - incol > 0) {\n        p_last0 = vec_perm(last0, this0, last_index);\n        last0 = this0;\n      }\n\n      if (incol <= 16)\n        p_next0 = vec_perm(this0, this0, next_index_lastcol);\n      else {\n        next0 = vec_ld(16, inptr);\n        p_next0 = vec_perm(this0, next0, next_index);\n      }\n\n      this0e = (__vector short)vec_mule(this0, pb_three);\n      this0o = (__vector short)vec_mulo(this0, pb_three);\n      this0l = vec_mergeh(this0e, this0o);\n      this0h = vec_mergel(this0e, this0o);\n\n      last0l = (__vector short)VEC_UNPACKHU(p_last0);\n      last0h = (__vector short)VEC_UNPACKLU(p_last0);\n      last0l = vec_add(last0l, pw_one);\n\n      next0l = (__vector short)VEC_UNPACKHU(p_next0);\n      next0h = (__vector short)VEC_UNPACKLU(p_next0);\n      next0l = vec_add(next0l, pw_two);\n\n      outle = vec_add(this0l, last0l);\n      outlo = vec_add(this0l, next0l);\n      outle = vec_sr(outle, (__vector unsigned short)pw_two);\n      outlo = vec_sr(outlo, (__vector unsigned short)pw_two);\n\n      out = vec_perm((__vector unsigned char)outle,\n                     (__vector unsigned char)outlo, merge_pack_index);\n      vec_st(out, 0, outptr);\n\n      if (incol > 8) {\n        last0h = vec_add(last0h, pw_one);\n        next0h = vec_add(next0h, pw_two);\n\n        outhe = vec_add(this0h, last0h);\n        outho = vec_add(this0h, next0h);\n        outhe = vec_sr(outhe, (__vector unsigned short)pw_two);\n        outho = vec_sr(outho, (__vector unsigned short)pw_two);\n\n        out = vec_perm((__vector unsigned char)outhe,\n                       (__vector unsigned char)outho, merge_pack_index);\n        vec_st(out, 16, outptr);\n      }\n\n      this0 = next0;\n    }\n  }\n}\n\n\nvoid\njsimd_h2v2_fancy_upsample_altivec (int max_v_samp_factor,\n                                   JDIMENSION downsampled_width,\n                                   JSAMPARRAY input_data,\n                                   JSAMPARRAY *output_data_ptr)\n{\n  JSAMPARRAY output_data = *output_data_ptr;\n  JSAMPROW inptr_1, inptr0, inptr1, outptr0, outptr1;\n  int inrow, outrow, incol;\n\n  __vector unsigned char this_1, this0, this1, out;\n  __vector short this_1l, this_1h, this0l, this0h, this1l, this1h,\n    lastcolsum_1h, lastcolsum1h,\n    p_lastcolsum_1l, p_lastcolsum_1h, p_lastcolsum1l, p_lastcolsum1h,\n    thiscolsum_1l, thiscolsum_1h, thiscolsum1l, thiscolsum1h,\n    nextcolsum_1l = {0}, nextcolsum_1h = {0},\n    nextcolsum1l = {0}, nextcolsum1h = {0},\n    p_nextcolsum_1l, p_nextcolsum_1h, p_nextcolsum1l, p_nextcolsum1h,\n    tmpl, tmph, outle, outhe, outlo, outho;\n\n  /* Constants */\n  __vector unsigned char pb_zero = { __16X(0) },\n    last_index_col0 = {0,1,0,1,2,3,4,5,6,7,8,9,10,11,12,13},\n    last_index={14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29},\n    next_index = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},\n    next_index_lastcol = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,15},\n#if __BIG_ENDIAN__\n    merge_pack_index = {1,17,3,19,5,21,7,23,9,25,11,27,13,29,15,31};\n#else\n    merge_pack_index = {0,16,2,18,4,20,6,22,8,24,10,26,12,28,14,30};\n#endif\n  __vector short pw_zero = { __8X(0) }, pw_three = { __8X(3) },\n    pw_seven = { __8X(7) }, pw_eight = { __8X(8) };\n  __vector unsigned short pw_four = { __8X(4) };\n\n  for (inrow = 0, outrow = 0; outrow < max_v_samp_factor; inrow++) {\n\n    inptr_1 = input_data[inrow - 1];\n    inptr0 = input_data[inrow];\n    inptr1 = input_data[inrow + 1];\n    outptr0 = output_data[outrow++];\n    outptr1 = output_data[outrow++];\n\n    if (downsampled_width & 15) {\n      inptr_1[downsampled_width] = inptr_1[downsampled_width - 1];\n      inptr0[downsampled_width] = inptr0[downsampled_width - 1];\n      inptr1[downsampled_width] = inptr1[downsampled_width - 1];\n    }\n\n    this0 = vec_ld(0, inptr0);\n    this0l = (__vector short)VEC_UNPACKHU(this0);\n    this0h = (__vector short)VEC_UNPACKLU(this0);\n    this0l = vec_mladd(this0l, pw_three, pw_zero);\n    this0h = vec_mladd(this0h, pw_three, pw_zero);\n\n    this_1 = vec_ld(0, inptr_1);\n    this_1l = (__vector short)VEC_UNPACKHU(this_1);\n    this_1h = (__vector short)VEC_UNPACKLU(this_1);\n    thiscolsum_1l = vec_add(this0l, this_1l);\n    thiscolsum_1h = vec_add(this0h, this_1h);\n    lastcolsum_1h = thiscolsum_1h;\n    p_lastcolsum_1l = vec_perm(thiscolsum_1l, thiscolsum_1l, last_index_col0);\n    p_lastcolsum_1h = vec_perm(thiscolsum_1l, thiscolsum_1h, last_index);\n\n    this1 = vec_ld(0, inptr1);\n    this1l = (__vector short)VEC_UNPACKHU(this1);\n    this1h = (__vector short)VEC_UNPACKLU(this1);\n    thiscolsum1l = vec_add(this0l, this1l);\n    thiscolsum1h = vec_add(this0h, this1h);\n    lastcolsum1h = thiscolsum1h;\n    p_lastcolsum1l = vec_perm(thiscolsum1l, thiscolsum1l, last_index_col0);\n    p_lastcolsum1h = vec_perm(thiscolsum1l, thiscolsum1h, last_index);\n\n    for (incol = downsampled_width; incol > 0;\n         incol -= 16, inptr_1 += 16, inptr0 += 16, inptr1 += 16,\n         outptr0 += 32, outptr1 += 32) {\n\n      if (downsampled_width - incol > 0) {\n        p_lastcolsum_1l = vec_perm(lastcolsum_1h, thiscolsum_1l, last_index);\n        p_lastcolsum_1h = vec_perm(thiscolsum_1l, thiscolsum_1h, last_index);\n        p_lastcolsum1l = vec_perm(lastcolsum1h, thiscolsum1l, last_index);\n        p_lastcolsum1h = vec_perm(thiscolsum1l, thiscolsum1h, last_index);\n        lastcolsum_1h = thiscolsum_1h;  lastcolsum1h = thiscolsum1h;\n      }\n\n      if (incol <= 16) {\n        p_nextcolsum_1l = vec_perm(thiscolsum_1l, thiscolsum_1h, next_index);\n        p_nextcolsum_1h = vec_perm(thiscolsum_1h, thiscolsum_1h,\n                                   next_index_lastcol);\n        p_nextcolsum1l = vec_perm(thiscolsum1l, thiscolsum1h, next_index);\n        p_nextcolsum1h = vec_perm(thiscolsum1h, thiscolsum1h,\n                                  next_index_lastcol);\n      } else {\n        this0 = vec_ld(16, inptr0);\n        this0l = (__vector short)VEC_UNPACKHU(this0);\n        this0h = (__vector short)VEC_UNPACKLU(this0);\n        this0l = vec_mladd(this0l, pw_three, pw_zero);\n        this0h = vec_mladd(this0h, pw_three, pw_zero);\n\n        this_1 = vec_ld(16, inptr_1);\n        this_1l = (__vector short)VEC_UNPACKHU(this_1);\n        this_1h = (__vector short)VEC_UNPACKLU(this_1);\n        nextcolsum_1l = vec_add(this0l, this_1l);\n        nextcolsum_1h = vec_add(this0h, this_1h);\n        p_nextcolsum_1l = vec_perm(thiscolsum_1l, thiscolsum_1h, next_index);\n        p_nextcolsum_1h = vec_perm(thiscolsum_1h, nextcolsum_1l, next_index);\n\n        this1 = vec_ld(16, inptr1);\n        this1l = (__vector short)VEC_UNPACKHU(this1);\n        this1h = (__vector short)VEC_UNPACKLU(this1);\n        nextcolsum1l = vec_add(this0l, this1l);\n        nextcolsum1h = vec_add(this0h, this1h);\n        p_nextcolsum1l = vec_perm(thiscolsum1l, thiscolsum1h, next_index);\n        p_nextcolsum1h = vec_perm(thiscolsum1h, nextcolsum1l, next_index);\n      }\n\n      /* Process the upper row */\n\n      tmpl = vec_mladd(thiscolsum_1l, pw_three, pw_zero);\n      outle = vec_add(tmpl, p_lastcolsum_1l);\n      outle = vec_add(outle, pw_eight);\n      outle = vec_sr(outle, pw_four);\n\n      outlo = vec_add(tmpl, p_nextcolsum_1l);\n      outlo = vec_add(outlo, pw_seven);\n      outlo = vec_sr(outlo, pw_four);\n\n      out = vec_perm((__vector unsigned char)outle,\n                     (__vector unsigned char)outlo, merge_pack_index);\n      vec_st(out, 0, outptr0);\n\n      if (incol > 8) {\n        tmph = vec_mladd(thiscolsum_1h, pw_three, pw_zero);\n        outhe = vec_add(tmph, p_lastcolsum_1h);\n        outhe = vec_add(outhe, pw_eight);\n        outhe = vec_sr(outhe, pw_four);\n\n        outho = vec_add(tmph, p_nextcolsum_1h);\n        outho = vec_add(outho, pw_seven);\n        outho = vec_sr(outho, pw_four);\n\n        out = vec_perm((__vector unsigned char)outhe,\n                       (__vector unsigned char)outho, merge_pack_index);\n        vec_st(out, 16, outptr0);\n      }\n\n      /* Process the lower row */\n\n      tmpl = vec_mladd(thiscolsum1l, pw_three, pw_zero);\n      outle = vec_add(tmpl, p_lastcolsum1l);\n      outle = vec_add(outle, pw_eight);\n      outle = vec_sr(outle, pw_four);\n\n      outlo = vec_add(tmpl, p_nextcolsum1l);\n      outlo = vec_add(outlo, pw_seven);\n      outlo = vec_sr(outlo, pw_four);\n\n      out = vec_perm((__vector unsigned char)outle,\n                     (__vector unsigned char)outlo, merge_pack_index);\n      vec_st(out, 0, outptr1);\n\n      if (incol > 8) {\n        tmph = vec_mladd(thiscolsum1h, pw_three, pw_zero);\n        outhe = vec_add(tmph, p_lastcolsum1h);\n        outhe = vec_add(outhe, pw_eight);\n        outhe = vec_sr(outhe, pw_four);\n\n        outho = vec_add(tmph, p_nextcolsum1h);\n        outho = vec_add(outho, pw_seven);\n        outho = vec_sr(outho, pw_four);\n\n        out = vec_perm((__vector unsigned char)outhe,\n                       (__vector unsigned char)outho, merge_pack_index);\n        vec_st(out, 16, outptr1);\n      }\n\n      thiscolsum_1l = nextcolsum_1l;  thiscolsum_1h = nextcolsum_1h;\n      thiscolsum1l = nextcolsum1l;  thiscolsum1h = nextcolsum1h;\n    }\n  }\n}\n\n\n/* These are rarely used (mainly just for decompressing YCCK images) */\n\nvoid\njsimd_h2v1_upsample_altivec (int max_v_samp_factor,\n                             JDIMENSION output_width,\n                             JSAMPARRAY input_data,\n                             JSAMPARRAY *output_data_ptr)\n{\n  JSAMPARRAY output_data = *output_data_ptr;\n  JSAMPROW inptr, outptr;\n  int inrow, incol;\n\n  __vector unsigned char in, inl, inh;\n\n  for (inrow = 0; inrow < max_v_samp_factor; inrow++) {\n    inptr = input_data[inrow];\n    outptr = output_data[inrow];\n\n    for (incol = (output_width + 31) & (~31); incol > 0;\n         incol -= 64, inptr += 32, outptr += 64) {\n\n      in = vec_ld(0, inptr);\n      inl = vec_mergeh(in, in);\n      inh = vec_mergel(in, in);\n\n      vec_st(inl, 0, outptr);\n      vec_st(inh, 16, outptr);\n\n      if (incol > 32) {\n        in = vec_ld(16, inptr);\n        inl = vec_mergeh(in, in);\n        inh = vec_mergel(in, in);\n\n        vec_st(inl, 32, outptr);\n        vec_st(inh, 48, outptr);\n      }\n    }\n  }\n}\n\n\nvoid\njsimd_h2v2_upsample_altivec (int max_v_samp_factor,\n                             JDIMENSION output_width,\n                             JSAMPARRAY input_data,\n                             JSAMPARRAY *output_data_ptr)\n{\n  JSAMPARRAY output_data = *output_data_ptr;\n  JSAMPROW inptr, outptr0, outptr1;\n  int inrow, outrow, incol;\n\n  __vector unsigned char in, inl, inh;\n\n  for (inrow = 0, outrow = 0; outrow < max_v_samp_factor; inrow++) {\n\n    inptr = input_data[inrow];\n    outptr0 = output_data[outrow++];\n    outptr1 = output_data[outrow++];\n\n    for (incol = (output_width + 31) & (~31); incol > 0;\n         incol -= 64, inptr += 32, outptr0 += 64, outptr1 += 64) {\n\n      in = vec_ld(0, inptr);\n      inl = vec_mergeh(in, in);\n      inh = vec_mergel(in, in);\n\n      vec_st(inl, 0, outptr0);\n      vec_st(inl, 0, outptr1);\n\n      vec_st(inh, 16, outptr0);\n      vec_st(inh, 16, outptr1);\n\n      if (incol > 32) {\n        in = vec_ld(16, inptr);\n        inl = vec_mergeh(in, in);\n        inh = vec_mergel(in, in);\n\n        vec_st(inl, 32, outptr0);\n        vec_st(inl, 32, outptr1);\n\n        vec_st(inh, 48, outptr0);\n        vec_st(inh, 48, outptr1);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdsample-mmx.asm",
    "content": ";\n; jdsample.asm - upsampling (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_fancy_upsample_mmx)\n\nEXTN(jconst_fancy_upsample_mmx):\n\nPW_ONE          times 4 dw  1\nPW_TWO          times 4 dw  2\nPW_THREE        times 4 dw  3\nPW_SEVEN        times 4 dw  7\nPW_EIGHT        times 4 dw  8\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Fancy processing for the common case of 2:1 horizontal and 1:1 vertical.\n;\n; The upsampling algorithm is linear interpolation between pixel centers,\n; also known as a \"triangle filter\".  This is a good compromise between\n; speed and visual quality.  The centers of the output pixels are 1/4 and 3/4\n; of the way between input pixel centers.\n;\n; GLOBAL(void)\n; jsimd_h2v1_fancy_upsample_mmx (int max_v_samp_factor,\n;                                JDIMENSION downsampled_width,\n;                                JSAMPARRAY input_data,\n;                                JSAMPARRAY *output_data_ptr);\n;\n\n%define max_v_samp(b)           (b)+8           ; int max_v_samp_factor\n%define downsamp_width(b)       (b)+12          ; JDIMENSION downsampled_width\n%define input_data(b)           (b)+16          ; JSAMPARRAY input_data\n%define output_data_ptr(b)      (b)+20          ; JSAMPARRAY *output_data_ptr\n\n        align   16\n        global  EXTN(jsimd_h2v1_fancy_upsample_mmx)\n\nEXTN(jsimd_h2v1_fancy_upsample_mmx):\n        push    ebp\n        mov     ebp,esp\n        pushpic ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx             ; get GOT address\n\n        mov     eax, JDIMENSION [downsamp_width(ebp)]  ; colctr\n        test    eax,eax\n        jz      near .return\n\n        mov     ecx, INT [max_v_samp(ebp)]      ; rowctr\n        test    ecx,ecx\n        jz      near .return\n\n        mov     esi, JSAMPARRAY [input_data(ebp)]       ; input_data\n        mov     edi, POINTER [output_data_ptr(ebp)]\n        mov     edi, JSAMPARRAY [edi]                   ; output_data\n        alignx  16,7\n.rowloop:\n        push    eax                     ; colctr\n        push    edi\n        push    esi\n\n        mov     esi, JSAMPROW [esi]     ; inptr\n        mov     edi, JSAMPROW [edi]     ; outptr\n\n        test    eax, SIZEOF_MMWORD-1\n        jz      short .skip\n        mov     dl, JSAMPLE [esi+(eax-1)*SIZEOF_JSAMPLE]\n        mov     JSAMPLE [esi+eax*SIZEOF_JSAMPLE], dl    ; insert a dummy sample\n.skip:\n        pxor    mm0,mm0                 ; mm0=(all 0's)\n        pcmpeqb mm7,mm7\n        psrlq   mm7,(SIZEOF_MMWORD-1)*BYTE_BIT\n        pand    mm7, MMWORD [esi+0*SIZEOF_MMWORD]\n\n        add     eax, byte SIZEOF_MMWORD-1\n        and     eax, byte -SIZEOF_MMWORD\n        cmp     eax, byte SIZEOF_MMWORD\n        ja      short .columnloop\n        alignx  16,7\n\n.columnloop_last:\n        pcmpeqb mm6,mm6\n        psllq   mm6,(SIZEOF_MMWORD-1)*BYTE_BIT\n        pand    mm6, MMWORD [esi+0*SIZEOF_MMWORD]\n        jmp     short .upsample\n        alignx  16,7\n\n.columnloop:\n        movq    mm6, MMWORD [esi+1*SIZEOF_MMWORD]\n        psllq   mm6,(SIZEOF_MMWORD-1)*BYTE_BIT\n\n.upsample:\n        movq    mm1, MMWORD [esi+0*SIZEOF_MMWORD]\n        movq    mm2,mm1\n        movq    mm3,mm1                 ; mm1=( 0 1 2 3 4 5 6 7)\n        psllq   mm2,BYTE_BIT            ; mm2=( - 0 1 2 3 4 5 6)\n        psrlq   mm3,BYTE_BIT            ; mm3=( 1 2 3 4 5 6 7 -)\n\n        por     mm2,mm7                 ; mm2=(-1 0 1 2 3 4 5 6)\n        por     mm3,mm6                 ; mm3=( 1 2 3 4 5 6 7 8)\n\n        movq    mm7,mm1\n        psrlq   mm7,(SIZEOF_MMWORD-1)*BYTE_BIT  ; mm7=( 7 - - - - - - -)\n\n        movq      mm4,mm1\n        punpcklbw mm1,mm0               ; mm1=( 0 1 2 3)\n        punpckhbw mm4,mm0               ; mm4=( 4 5 6 7)\n        movq      mm5,mm2\n        punpcklbw mm2,mm0               ; mm2=(-1 0 1 2)\n        punpckhbw mm5,mm0               ; mm5=( 3 4 5 6)\n        movq      mm6,mm3\n        punpcklbw mm3,mm0               ; mm3=( 1 2 3 4)\n        punpckhbw mm6,mm0               ; mm6=( 5 6 7 8)\n\n        pmullw  mm1,[GOTOFF(ebx,PW_THREE)]\n        pmullw  mm4,[GOTOFF(ebx,PW_THREE)]\n        paddw   mm2,[GOTOFF(ebx,PW_ONE)]\n        paddw   mm5,[GOTOFF(ebx,PW_ONE)]\n        paddw   mm3,[GOTOFF(ebx,PW_TWO)]\n        paddw   mm6,[GOTOFF(ebx,PW_TWO)]\n\n        paddw   mm2,mm1\n        paddw   mm5,mm4\n        psrlw   mm2,2                   ; mm2=OutLE=( 0  2  4  6)\n        psrlw   mm5,2                   ; mm5=OutHE=( 8 10 12 14)\n        paddw   mm3,mm1\n        paddw   mm6,mm4\n        psrlw   mm3,2                   ; mm3=OutLO=( 1  3  5  7)\n        psrlw   mm6,2                   ; mm6=OutHO=( 9 11 13 15)\n\n        psllw   mm3,BYTE_BIT\n        psllw   mm6,BYTE_BIT\n        por     mm2,mm3                 ; mm2=OutL=( 0  1  2  3  4  5  6  7)\n        por     mm5,mm6                 ; mm5=OutH=( 8  9 10 11 12 13 14 15)\n\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mm2\n        movq    MMWORD [edi+1*SIZEOF_MMWORD], mm5\n\n        sub     eax, byte SIZEOF_MMWORD\n        add     esi, byte 1*SIZEOF_MMWORD       ; inptr\n        add     edi, byte 2*SIZEOF_MMWORD       ; outptr\n        cmp     eax, byte SIZEOF_MMWORD\n        ja      near .columnloop\n        test    eax,eax\n        jnz     near .columnloop_last\n\n        pop     esi\n        pop     edi\n        pop     eax\n\n        add     esi, byte SIZEOF_JSAMPROW       ; input_data\n        add     edi, byte SIZEOF_JSAMPROW       ; output_data\n        dec     ecx                             ; rowctr\n        jg      near .rowloop\n\n        emms            ; empty MMX state\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        poppic  ebx\n        pop     ebp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Fancy processing for the common case of 2:1 horizontal and 2:1 vertical.\n; Again a triangle filter; see comments for h2v1 case, above.\n;\n; GLOBAL(void)\n; jsimd_h2v2_fancy_upsample_mmx (int max_v_samp_factor,\n;                                JDIMENSION downsampled_width,\n;                                JSAMPARRAY input_data,\n;                                JSAMPARRAY *output_data_ptr);\n;\n\n%define max_v_samp(b)           (b)+8           ; int max_v_samp_factor\n%define downsamp_width(b)       (b)+12          ; JDIMENSION downsampled_width\n%define input_data(b)           (b)+16          ; JSAMPARRAY input_data\n%define output_data_ptr(b)      (b)+20          ; JSAMPARRAY *output_data_ptr\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_MMWORD  ; mmword wk[WK_NUM]\n%define WK_NUM          4\n%define gotptr          wk(0)-SIZEOF_POINTER    ; void *gotptr\n\n        align   16\n        global  EXTN(jsimd_h2v2_fancy_upsample_mmx)\n\nEXTN(jsimd_h2v2_fancy_upsample_mmx):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_MMWORD)      ; align to 64 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic eax             ; make a room for GOT address\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx                     ; get GOT address\n        movpic  POINTER [gotptr], ebx   ; save GOT address\n\n        mov     edx,eax                         ; edx = original ebp\n        mov     eax, JDIMENSION [downsamp_width(edx)]  ; colctr\n        test    eax,eax\n        jz      near .return\n\n        mov     ecx, INT [max_v_samp(edx)]      ; rowctr\n        test    ecx,ecx\n        jz      near .return\n\n        mov     esi, JSAMPARRAY [input_data(edx)]       ; input_data\n        mov     edi, POINTER [output_data_ptr(edx)]\n        mov     edi, JSAMPARRAY [edi]                   ; output_data\n        alignx  16,7\n.rowloop:\n        push    eax                                     ; colctr\n        push    ecx\n        push    edi\n        push    esi\n\n        mov     ecx, JSAMPROW [esi-1*SIZEOF_JSAMPROW]   ; inptr1(above)\n        mov     ebx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]   ; inptr0\n        mov     esi, JSAMPROW [esi+1*SIZEOF_JSAMPROW]   ; inptr1(below)\n        mov     edx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]   ; outptr0\n        mov     edi, JSAMPROW [edi+1*SIZEOF_JSAMPROW]   ; outptr1\n\n        test    eax, SIZEOF_MMWORD-1\n        jz      short .skip\n        push    edx\n        mov     dl, JSAMPLE [ecx+(eax-1)*SIZEOF_JSAMPLE]\n        mov     JSAMPLE [ecx+eax*SIZEOF_JSAMPLE], dl\n        mov     dl, JSAMPLE [ebx+(eax-1)*SIZEOF_JSAMPLE]\n        mov     JSAMPLE [ebx+eax*SIZEOF_JSAMPLE], dl\n        mov     dl, JSAMPLE [esi+(eax-1)*SIZEOF_JSAMPLE]\n        mov     JSAMPLE [esi+eax*SIZEOF_JSAMPLE], dl    ; insert a dummy sample\n        pop     edx\n.skip:\n        ; -- process the first column block\n\n        movq    mm0, MMWORD [ebx+0*SIZEOF_MMWORD]       ; mm0=row[ 0][0]\n        movq    mm1, MMWORD [ecx+0*SIZEOF_MMWORD]       ; mm1=row[-1][0]\n        movq    mm2, MMWORD [esi+0*SIZEOF_MMWORD]       ; mm2=row[+1][0]\n\n        pushpic ebx\n        movpic  ebx, POINTER [gotptr]   ; load GOT address\n\n        pxor      mm3,mm3               ; mm3=(all 0's)\n        movq      mm4,mm0\n        punpcklbw mm0,mm3               ; mm0=row[ 0][0]( 0 1 2 3)\n        punpckhbw mm4,mm3               ; mm4=row[ 0][0]( 4 5 6 7)\n        movq      mm5,mm1\n        punpcklbw mm1,mm3               ; mm1=row[-1][0]( 0 1 2 3)\n        punpckhbw mm5,mm3               ; mm5=row[-1][0]( 4 5 6 7)\n        movq      mm6,mm2\n        punpcklbw mm2,mm3               ; mm2=row[+1][0]( 0 1 2 3)\n        punpckhbw mm6,mm3               ; mm6=row[+1][0]( 4 5 6 7)\n\n        pmullw  mm0,[GOTOFF(ebx,PW_THREE)]\n        pmullw  mm4,[GOTOFF(ebx,PW_THREE)]\n\n        pcmpeqb mm7,mm7\n        psrlq   mm7,(SIZEOF_MMWORD-2)*BYTE_BIT\n\n        paddw   mm1,mm0                 ; mm1=Int0L=( 0 1 2 3)\n        paddw   mm5,mm4                 ; mm5=Int0H=( 4 5 6 7)\n        paddw   mm2,mm0                 ; mm2=Int1L=( 0 1 2 3)\n        paddw   mm6,mm4                 ; mm6=Int1H=( 4 5 6 7)\n\n        movq    MMWORD [edx+0*SIZEOF_MMWORD], mm1       ; temporarily save\n        movq    MMWORD [edx+1*SIZEOF_MMWORD], mm5       ; the intermediate data\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mm2\n        movq    MMWORD [edi+1*SIZEOF_MMWORD], mm6\n\n        pand    mm1,mm7                 ; mm1=( 0 - - -)\n        pand    mm2,mm7                 ; mm2=( 0 - - -)\n\n        movq    MMWORD [wk(0)], mm1\n        movq    MMWORD [wk(1)], mm2\n\n        poppic  ebx\n\n        add     eax, byte SIZEOF_MMWORD-1\n        and     eax, byte -SIZEOF_MMWORD\n        cmp     eax, byte SIZEOF_MMWORD\n        ja      short .columnloop\n        alignx  16,7\n\n.columnloop_last:\n        ; -- process the last column block\n\n        pushpic ebx\n        movpic  ebx, POINTER [gotptr]   ; load GOT address\n\n        pcmpeqb mm1,mm1\n        psllq   mm1,(SIZEOF_MMWORD-2)*BYTE_BIT\n        movq    mm2,mm1\n\n        pand    mm1, MMWORD [edx+1*SIZEOF_MMWORD]       ; mm1=( - - - 7)\n        pand    mm2, MMWORD [edi+1*SIZEOF_MMWORD]       ; mm2=( - - - 7)\n\n        movq    MMWORD [wk(2)], mm1\n        movq    MMWORD [wk(3)], mm2\n\n        jmp     short .upsample\n        alignx  16,7\n\n.columnloop:\n        ; -- process the next column block\n\n        movq    mm0, MMWORD [ebx+1*SIZEOF_MMWORD]       ; mm0=row[ 0][1]\n        movq    mm1, MMWORD [ecx+1*SIZEOF_MMWORD]       ; mm1=row[-1][1]\n        movq    mm2, MMWORD [esi+1*SIZEOF_MMWORD]       ; mm2=row[+1][1]\n\n        pushpic ebx\n        movpic  ebx, POINTER [gotptr]   ; load GOT address\n\n        pxor      mm3,mm3               ; mm3=(all 0's)\n        movq      mm4,mm0\n        punpcklbw mm0,mm3               ; mm0=row[ 0][1]( 0 1 2 3)\n        punpckhbw mm4,mm3               ; mm4=row[ 0][1]( 4 5 6 7)\n        movq      mm5,mm1\n        punpcklbw mm1,mm3               ; mm1=row[-1][1]( 0 1 2 3)\n        punpckhbw mm5,mm3               ; mm5=row[-1][1]( 4 5 6 7)\n        movq      mm6,mm2\n        punpcklbw mm2,mm3               ; mm2=row[+1][1]( 0 1 2 3)\n        punpckhbw mm6,mm3               ; mm6=row[+1][1]( 4 5 6 7)\n\n        pmullw  mm0,[GOTOFF(ebx,PW_THREE)]\n        pmullw  mm4,[GOTOFF(ebx,PW_THREE)]\n\n        paddw   mm1,mm0                 ; mm1=Int0L=( 0 1 2 3)\n        paddw   mm5,mm4                 ; mm5=Int0H=( 4 5 6 7)\n        paddw   mm2,mm0                 ; mm2=Int1L=( 0 1 2 3)\n        paddw   mm6,mm4                 ; mm6=Int1H=( 4 5 6 7)\n\n        movq    MMWORD [edx+2*SIZEOF_MMWORD], mm1       ; temporarily save\n        movq    MMWORD [edx+3*SIZEOF_MMWORD], mm5       ; the intermediate data\n        movq    MMWORD [edi+2*SIZEOF_MMWORD], mm2\n        movq    MMWORD [edi+3*SIZEOF_MMWORD], mm6\n\n        psllq   mm1,(SIZEOF_MMWORD-2)*BYTE_BIT  ; mm1=( - - - 0)\n        psllq   mm2,(SIZEOF_MMWORD-2)*BYTE_BIT  ; mm2=( - - - 0)\n\n        movq    MMWORD [wk(2)], mm1\n        movq    MMWORD [wk(3)], mm2\n\n.upsample:\n        ; -- process the upper row\n\n        movq    mm7, MMWORD [edx+0*SIZEOF_MMWORD]       ; mm7=Int0L=( 0 1 2 3)\n        movq    mm3, MMWORD [edx+1*SIZEOF_MMWORD]       ; mm3=Int0H=( 4 5 6 7)\n\n        movq    mm0,mm7\n        movq    mm4,mm3\n        psrlq   mm0,2*BYTE_BIT                  ; mm0=( 1 2 3 -)\n        psllq   mm4,(SIZEOF_MMWORD-2)*BYTE_BIT  ; mm4=( - - - 4)\n        movq    mm5,mm7\n        movq    mm6,mm3\n        psrlq   mm5,(SIZEOF_MMWORD-2)*BYTE_BIT  ; mm5=( 3 - - -)\n        psllq   mm6,2*BYTE_BIT                  ; mm6=( - 4 5 6)\n\n        por     mm0,mm4                         ; mm0=( 1 2 3 4)\n        por     mm5,mm6                         ; mm5=( 3 4 5 6)\n\n        movq    mm1,mm7\n        movq    mm2,mm3\n        psllq   mm1,2*BYTE_BIT                  ; mm1=( - 0 1 2)\n        psrlq   mm2,2*BYTE_BIT                  ; mm2=( 5 6 7 -)\n        movq    mm4,mm3\n        psrlq   mm4,(SIZEOF_MMWORD-2)*BYTE_BIT  ; mm4=( 7 - - -)\n\n        por     mm1, MMWORD [wk(0)]             ; mm1=(-1 0 1 2)\n        por     mm2, MMWORD [wk(2)]             ; mm2=( 5 6 7 8)\n\n        movq    MMWORD [wk(0)], mm4\n\n        pmullw  mm7,[GOTOFF(ebx,PW_THREE)]\n        pmullw  mm3,[GOTOFF(ebx,PW_THREE)]\n        paddw   mm1,[GOTOFF(ebx,PW_EIGHT)]\n        paddw   mm5,[GOTOFF(ebx,PW_EIGHT)]\n        paddw   mm0,[GOTOFF(ebx,PW_SEVEN)]\n        paddw   mm2,[GOTOFF(ebx,PW_SEVEN)]\n\n        paddw   mm1,mm7\n        paddw   mm5,mm3\n        psrlw   mm1,4                   ; mm1=Out0LE=( 0  2  4  6)\n        psrlw   mm5,4                   ; mm5=Out0HE=( 8 10 12 14)\n        paddw   mm0,mm7\n        paddw   mm2,mm3\n        psrlw   mm0,4                   ; mm0=Out0LO=( 1  3  5  7)\n        psrlw   mm2,4                   ; mm2=Out0HO=( 9 11 13 15)\n\n        psllw   mm0,BYTE_BIT\n        psllw   mm2,BYTE_BIT\n        por     mm1,mm0                 ; mm1=Out0L=( 0  1  2  3  4  5  6  7)\n        por     mm5,mm2                 ; mm5=Out0H=( 8  9 10 11 12 13 14 15)\n\n        movq    MMWORD [edx+0*SIZEOF_MMWORD], mm1\n        movq    MMWORD [edx+1*SIZEOF_MMWORD], mm5\n\n        ; -- process the lower row\n\n        movq    mm6, MMWORD [edi+0*SIZEOF_MMWORD]       ; mm6=Int1L=( 0 1 2 3)\n        movq    mm4, MMWORD [edi+1*SIZEOF_MMWORD]       ; mm4=Int1H=( 4 5 6 7)\n\n        movq    mm7,mm6\n        movq    mm3,mm4\n        psrlq   mm7,2*BYTE_BIT                  ; mm7=( 1 2 3 -)\n        psllq   mm3,(SIZEOF_MMWORD-2)*BYTE_BIT  ; mm3=( - - - 4)\n        movq    mm0,mm6\n        movq    mm2,mm4\n        psrlq   mm0,(SIZEOF_MMWORD-2)*BYTE_BIT  ; mm0=( 3 - - -)\n        psllq   mm2,2*BYTE_BIT                  ; mm2=( - 4 5 6)\n\n        por     mm7,mm3                         ; mm7=( 1 2 3 4)\n        por     mm0,mm2                         ; mm0=( 3 4 5 6)\n\n        movq    mm1,mm6\n        movq    mm5,mm4\n        psllq   mm1,2*BYTE_BIT                  ; mm1=( - 0 1 2)\n        psrlq   mm5,2*BYTE_BIT                  ; mm5=( 5 6 7 -)\n        movq    mm3,mm4\n        psrlq   mm3,(SIZEOF_MMWORD-2)*BYTE_BIT  ; mm3=( 7 - - -)\n\n        por     mm1, MMWORD [wk(1)]             ; mm1=(-1 0 1 2)\n        por     mm5, MMWORD [wk(3)]             ; mm5=( 5 6 7 8)\n\n        movq    MMWORD [wk(1)], mm3\n\n        pmullw  mm6,[GOTOFF(ebx,PW_THREE)]\n        pmullw  mm4,[GOTOFF(ebx,PW_THREE)]\n        paddw   mm1,[GOTOFF(ebx,PW_EIGHT)]\n        paddw   mm0,[GOTOFF(ebx,PW_EIGHT)]\n        paddw   mm7,[GOTOFF(ebx,PW_SEVEN)]\n        paddw   mm5,[GOTOFF(ebx,PW_SEVEN)]\n\n        paddw   mm1,mm6\n        paddw   mm0,mm4\n        psrlw   mm1,4                   ; mm1=Out1LE=( 0  2  4  6)\n        psrlw   mm0,4                   ; mm0=Out1HE=( 8 10 12 14)\n        paddw   mm7,mm6\n        paddw   mm5,mm4\n        psrlw   mm7,4                   ; mm7=Out1LO=( 1  3  5  7)\n        psrlw   mm5,4                   ; mm5=Out1HO=( 9 11 13 15)\n\n        psllw   mm7,BYTE_BIT\n        psllw   mm5,BYTE_BIT\n        por     mm1,mm7                 ; mm1=Out1L=( 0  1  2  3  4  5  6  7)\n        por     mm0,mm5                 ; mm0=Out1H=( 8  9 10 11 12 13 14 15)\n\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mm1\n        movq    MMWORD [edi+1*SIZEOF_MMWORD], mm0\n\n        poppic  ebx\n\n        sub     eax, byte SIZEOF_MMWORD\n        add     ecx, byte 1*SIZEOF_MMWORD       ; inptr1(above)\n        add     ebx, byte 1*SIZEOF_MMWORD       ; inptr0\n        add     esi, byte 1*SIZEOF_MMWORD       ; inptr1(below)\n        add     edx, byte 2*SIZEOF_MMWORD       ; outptr0\n        add     edi, byte 2*SIZEOF_MMWORD       ; outptr1\n        cmp     eax, byte SIZEOF_MMWORD\n        ja      near .columnloop\n        test    eax,eax\n        jnz     near .columnloop_last\n\n        pop     esi\n        pop     edi\n        pop     ecx\n        pop     eax\n\n        add     esi, byte 1*SIZEOF_JSAMPROW     ; input_data\n        add     edi, byte 2*SIZEOF_JSAMPROW     ; output_data\n        sub     ecx, byte 2                     ; rowctr\n        jg      near .rowloop\n\n        emms            ; empty MMX state\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Fast processing for the common case of 2:1 horizontal and 1:1 vertical.\n; It's still a box filter.\n;\n; GLOBAL(void)\n; jsimd_h2v1_upsample_mmx (int max_v_samp_factor,\n;                          JDIMENSION output_width,\n;                          JSAMPARRAY input_data,\n;                          JSAMPARRAY *output_data_ptr);\n;\n\n%define max_v_samp(b)           (b)+8           ; int max_v_samp_factor\n%define output_width(b)         (b)+12          ; JDIMENSION output_width\n%define input_data(b)           (b)+16          ; JSAMPARRAY input_data\n%define output_data_ptr(b)      (b)+20          ; JSAMPARRAY *output_data_ptr\n\n        align   16\n        global  EXTN(jsimd_h2v1_upsample_mmx)\n\nEXTN(jsimd_h2v1_upsample_mmx):\n        push    ebp\n        mov     ebp,esp\n;       push    ebx             ; unused\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        mov     edx, JDIMENSION [output_width(ebp)]\n        add     edx, byte (2*SIZEOF_MMWORD)-1\n        and     edx, byte -(2*SIZEOF_MMWORD)\n        jz      short .return\n\n        mov     ecx, INT [max_v_samp(ebp)]      ; rowctr\n        test    ecx,ecx\n        jz      short .return\n\n        mov     esi, JSAMPARRAY [input_data(ebp)]       ; input_data\n        mov     edi, POINTER [output_data_ptr(ebp)]\n        mov     edi, JSAMPARRAY [edi]                   ; output_data\n        alignx  16,7\n.rowloop:\n        push    edi\n        push    esi\n\n        mov     esi, JSAMPROW [esi]             ; inptr\n        mov     edi, JSAMPROW [edi]             ; outptr\n        mov     eax,edx                         ; colctr\n        alignx  16,7\n.columnloop:\n\n        movq    mm0, MMWORD [esi+0*SIZEOF_MMWORD]\n\n        movq      mm1,mm0\n        punpcklbw mm0,mm0\n        punpckhbw mm1,mm1\n\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mm0\n        movq    MMWORD [edi+1*SIZEOF_MMWORD], mm1\n\n        sub     eax, byte 2*SIZEOF_MMWORD\n        jz      short .nextrow\n\n        movq    mm2, MMWORD [esi+1*SIZEOF_MMWORD]\n\n        movq      mm3,mm2\n        punpcklbw mm2,mm2\n        punpckhbw mm3,mm3\n\n        movq    MMWORD [edi+2*SIZEOF_MMWORD], mm2\n        movq    MMWORD [edi+3*SIZEOF_MMWORD], mm3\n\n        sub     eax, byte 2*SIZEOF_MMWORD\n        jz      short .nextrow\n\n        add     esi, byte 2*SIZEOF_MMWORD       ; inptr\n        add     edi, byte 4*SIZEOF_MMWORD       ; outptr\n        jmp     short .columnloop\n        alignx  16,7\n\n.nextrow:\n        pop     esi\n        pop     edi\n\n        add     esi, byte SIZEOF_JSAMPROW       ; input_data\n        add     edi, byte SIZEOF_JSAMPROW       ; output_data\n        dec     ecx                             ; rowctr\n        jg      short .rowloop\n\n        emms            ; empty MMX state\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n;       pop     ebx             ; unused\n        pop     ebp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Fast processing for the common case of 2:1 horizontal and 2:1 vertical.\n; It's still a box filter.\n;\n; GLOBAL(void)\n; jsimd_h2v2_upsample_mmx (int max_v_samp_factor,\n;                          JDIMENSION output_width,\n;                          JSAMPARRAY input_data,\n;                          JSAMPARRAY *output_data_ptr);\n;\n\n%define max_v_samp(b)           (b)+8           ; int max_v_samp_factor\n%define output_width(b)         (b)+12          ; JDIMENSION output_width\n%define input_data(b)           (b)+16          ; JSAMPARRAY input_data\n%define output_data_ptr(b)      (b)+20          ; JSAMPARRAY *output_data_ptr\n\n        align   16\n        global  EXTN(jsimd_h2v2_upsample_mmx)\n\nEXTN(jsimd_h2v2_upsample_mmx):\n        push    ebp\n        mov     ebp,esp\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        mov     edx, JDIMENSION [output_width(ebp)]\n        add     edx, byte (2*SIZEOF_MMWORD)-1\n        and     edx, byte -(2*SIZEOF_MMWORD)\n        jz      near .return\n\n        mov     ecx, INT [max_v_samp(ebp)]      ; rowctr\n        test    ecx,ecx\n        jz      short .return\n\n        mov     esi, JSAMPARRAY [input_data(ebp)]       ; input_data\n        mov     edi, POINTER [output_data_ptr(ebp)]\n        mov     edi, JSAMPARRAY [edi]                   ; output_data\n        alignx  16,7\n.rowloop:\n        push    edi\n        push    esi\n\n        mov     esi, JSAMPROW [esi]                     ; inptr\n        mov     ebx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]   ; outptr0\n        mov     edi, JSAMPROW [edi+1*SIZEOF_JSAMPROW]   ; outptr1\n        mov     eax,edx                                 ; colctr\n        alignx  16,7\n.columnloop:\n\n        movq    mm0, MMWORD [esi+0*SIZEOF_MMWORD]\n\n        movq      mm1,mm0\n        punpcklbw mm0,mm0\n        punpckhbw mm1,mm1\n\n        movq    MMWORD [ebx+0*SIZEOF_MMWORD], mm0\n        movq    MMWORD [ebx+1*SIZEOF_MMWORD], mm1\n        movq    MMWORD [edi+0*SIZEOF_MMWORD], mm0\n        movq    MMWORD [edi+1*SIZEOF_MMWORD], mm1\n\n        sub     eax, byte 2*SIZEOF_MMWORD\n        jz      short .nextrow\n\n        movq    mm2, MMWORD [esi+1*SIZEOF_MMWORD]\n\n        movq      mm3,mm2\n        punpcklbw mm2,mm2\n        punpckhbw mm3,mm3\n\n        movq    MMWORD [ebx+2*SIZEOF_MMWORD], mm2\n        movq    MMWORD [ebx+3*SIZEOF_MMWORD], mm3\n        movq    MMWORD [edi+2*SIZEOF_MMWORD], mm2\n        movq    MMWORD [edi+3*SIZEOF_MMWORD], mm3\n\n        sub     eax, byte 2*SIZEOF_MMWORD\n        jz      short .nextrow\n\n        add     esi, byte 2*SIZEOF_MMWORD       ; inptr\n        add     ebx, byte 4*SIZEOF_MMWORD       ; outptr0\n        add     edi, byte 4*SIZEOF_MMWORD       ; outptr1\n        jmp     short .columnloop\n        alignx  16,7\n\n.nextrow:\n        pop     esi\n        pop     edi\n\n        add     esi, byte 1*SIZEOF_JSAMPROW     ; input_data\n        add     edi, byte 2*SIZEOF_JSAMPROW     ; output_data\n        sub     ecx, byte 2                     ; rowctr\n        jg      short .rowloop\n\n        emms            ; empty MMX state\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdsample-sse2-64.asm",
    "content": ";\n; jdsample.asm - upsampling (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_fancy_upsample_sse2)\n\nEXTN(jconst_fancy_upsample_sse2):\n\nPW_ONE          times 8 dw  1\nPW_TWO          times 8 dw  2\nPW_THREE        times 8 dw  3\nPW_SEVEN        times 8 dw  7\nPW_EIGHT        times 8 dw  8\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n;\n; Fancy processing for the common case of 2:1 horizontal and 1:1 vertical.\n;\n; The upsampling algorithm is linear interpolation between pixel centers,\n; also known as a \"triangle filter\".  This is a good compromise between\n; speed and visual quality.  The centers of the output pixels are 1/4 and 3/4\n; of the way between input pixel centers.\n;\n; GLOBAL(void)\n; jsimd_h2v1_fancy_upsample_sse2 (int max_v_samp_factor,\n;                                 JDIMENSION downsampled_width,\n;                                 JSAMPARRAY input_data,\n;                                 JSAMPARRAY *output_data_ptr);\n;\n\n; r10 = int max_v_samp_factor\n; r11 = JDIMENSION downsampled_width\n; r12 = JSAMPARRAY input_data\n; r13 = JSAMPARRAY *output_data_ptr\n\n        align   16\n        global  EXTN(jsimd_h2v1_fancy_upsample_sse2)\n\nEXTN(jsimd_h2v1_fancy_upsample_sse2):\n        push    rbp\n        mov     rax,rsp\n        mov     rbp,rsp\n        collect_args\n\n        mov     eax, r11d  ; colctr\n        test    rax,rax\n        jz      near .return\n\n        mov     rcx, r10        ; rowctr\n        test    rcx,rcx\n        jz      near .return\n\n        mov     rsi, r12        ; input_data\n        mov     rdi, r13\n        mov     rdi, JSAMPARRAY [rdi]                   ; output_data\n.rowloop:\n        push    rax                     ; colctr\n        push    rdi\n        push    rsi\n\n        mov     rsi, JSAMPROW [rsi]     ; inptr\n        mov     rdi, JSAMPROW [rdi]     ; outptr\n\n        test    rax, SIZEOF_XMMWORD-1\n        jz      short .skip\n        mov     dl, JSAMPLE [rsi+(rax-1)*SIZEOF_JSAMPLE]\n        mov     JSAMPLE [rsi+rax*SIZEOF_JSAMPLE], dl    ; insert a dummy sample\n.skip:\n        pxor    xmm0,xmm0               ; xmm0=(all 0's)\n        pcmpeqb xmm7,xmm7\n        psrldq  xmm7,(SIZEOF_XMMWORD-1)\n        pand    xmm7, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\n        add     rax, byte SIZEOF_XMMWORD-1\n        and     rax, byte -SIZEOF_XMMWORD\n        cmp     rax, byte SIZEOF_XMMWORD\n        ja      short .columnloop\n\n.columnloop_last:\n        pcmpeqb xmm6,xmm6\n        pslldq  xmm6,(SIZEOF_XMMWORD-1)\n        pand    xmm6, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        jmp     short .upsample\n\n.columnloop:\n        movdqa  xmm6, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n        pslldq  xmm6,(SIZEOF_XMMWORD-1)\n\n.upsample:\n        movdqa  xmm1, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n        movdqa  xmm2,xmm1\n        movdqa  xmm3,xmm1               ; xmm1=( 0  1  2 ... 13 14 15)\n        pslldq  xmm2,1                  ; xmm2=(--  0  1 ... 12 13 14)\n        psrldq  xmm3,1                  ; xmm3=( 1  2  3 ... 14 15 --)\n\n        por     xmm2,xmm7               ; xmm2=(-1  0  1 ... 12 13 14)\n        por     xmm3,xmm6               ; xmm3=( 1  2  3 ... 14 15 16)\n\n        movdqa  xmm7,xmm1\n        psrldq  xmm7,(SIZEOF_XMMWORD-1) ; xmm7=(15 -- -- ... -- -- --)\n\n        movdqa    xmm4,xmm1\n        punpcklbw xmm1,xmm0             ; xmm1=( 0  1  2  3  4  5  6  7)\n        punpckhbw xmm4,xmm0             ; xmm4=( 8  9 10 11 12 13 14 15)\n        movdqa    xmm5,xmm2\n        punpcklbw xmm2,xmm0             ; xmm2=(-1  0  1  2  3  4  5  6)\n        punpckhbw xmm5,xmm0             ; xmm5=( 7  8  9 10 11 12 13 14)\n        movdqa    xmm6,xmm3\n        punpcklbw xmm3,xmm0             ; xmm3=( 1  2  3  4  5  6  7  8)\n        punpckhbw xmm6,xmm0             ; xmm6=( 9 10 11 12 13 14 15 16)\n\n        pmullw  xmm1,[rel PW_THREE]\n        pmullw  xmm4,[rel PW_THREE]\n        paddw   xmm2,[rel PW_ONE]\n        paddw   xmm5,[rel PW_ONE]\n        paddw   xmm3,[rel PW_TWO]\n        paddw   xmm6,[rel PW_TWO]\n\n        paddw   xmm2,xmm1\n        paddw   xmm5,xmm4\n        psrlw   xmm2,2                  ; xmm2=OutLE=( 0  2  4  6  8 10 12 14)\n        psrlw   xmm5,2                  ; xmm5=OutHE=(16 18 20 22 24 26 28 30)\n        paddw   xmm3,xmm1\n        paddw   xmm6,xmm4\n        psrlw   xmm3,2                  ; xmm3=OutLO=( 1  3  5  7  9 11 13 15)\n        psrlw   xmm6,2                  ; xmm6=OutHO=(17 19 21 23 25 27 29 31)\n\n        psllw   xmm3,BYTE_BIT\n        psllw   xmm6,BYTE_BIT\n        por     xmm2,xmm3               ; xmm2=OutL=( 0  1  2 ... 13 14 15)\n        por     xmm5,xmm6               ; xmm5=OutH=(16 17 18 ... 29 30 31)\n\n        movdqa  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmm2\n        movdqa  XMMWORD [rdi+1*SIZEOF_XMMWORD], xmm5\n\n        sub     rax, byte SIZEOF_XMMWORD\n        add     rsi, byte 1*SIZEOF_XMMWORD      ; inptr\n        add     rdi, byte 2*SIZEOF_XMMWORD      ; outptr\n        cmp     rax, byte SIZEOF_XMMWORD\n        ja      near .columnloop\n        test    eax,eax\n        jnz     near .columnloop_last\n\n        pop     rsi\n        pop     rdi\n        pop     rax\n\n        add     rsi, byte SIZEOF_JSAMPROW       ; input_data\n        add     rdi, byte SIZEOF_JSAMPROW       ; output_data\n        dec     rcx                             ; rowctr\n        jg      near .rowloop\n\n.return:\n        uncollect_args\n        pop     rbp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Fancy processing for the common case of 2:1 horizontal and 2:1 vertical.\n; Again a triangle filter; see comments for h2v1 case, above.\n;\n; GLOBAL(void)\n; jsimd_h2v2_fancy_upsample_sse2 (int max_v_samp_factor,\n;                                 JDIMENSION downsampled_width,\n;                                 JSAMPARRAY input_data,\n;                                 JSAMPARRAY *output_data_ptr);\n;\n\n; r10 = int max_v_samp_factor\n; r11 = JDIMENSION downsampled_width\n; r12 = JSAMPARRAY input_data\n; r13 = JSAMPARRAY *output_data_ptr\n\n%define wk(i)           rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          4\n\n        align   16\n        global  EXTN(jsimd_h2v2_fancy_upsample_sse2)\n\nEXTN(jsimd_h2v2_fancy_upsample_sse2):\n        push    rbp\n        mov     rax,rsp                         ; rax = original rbp\n        sub     rsp, byte 4\n        and     rsp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [rsp],rax\n        mov     rbp,rsp                         ; rbp = aligned rbp\n        lea     rsp, [wk(0)]\n        collect_args\n        push    rbx\n\n        mov     eax, r11d  ; colctr\n        test    rax,rax\n        jz      near .return\n\n        mov     rcx, r10        ; rowctr\n        test    rcx,rcx\n        jz      near .return\n\n        mov     rsi, r12        ; input_data\n        mov     rdi, r13\n        mov     rdi, JSAMPARRAY [rdi]                   ; output_data\n.rowloop:\n        push    rax                                     ; colctr\n        push    rcx\n        push    rdi\n        push    rsi\n\n        mov     rcx, JSAMPROW [rsi-1*SIZEOF_JSAMPROW]   ; inptr1(above)\n        mov     rbx, JSAMPROW [rsi+0*SIZEOF_JSAMPROW]   ; inptr0\n        mov     rsi, JSAMPROW [rsi+1*SIZEOF_JSAMPROW]   ; inptr1(below)\n        mov     rdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW]   ; outptr0\n        mov     rdi, JSAMPROW [rdi+1*SIZEOF_JSAMPROW]   ; outptr1\n\n        test    rax, SIZEOF_XMMWORD-1\n        jz      short .skip\n        push    rdx\n        mov     dl, JSAMPLE [rcx+(rax-1)*SIZEOF_JSAMPLE]\n        mov     JSAMPLE [rcx+rax*SIZEOF_JSAMPLE], dl\n        mov     dl, JSAMPLE [rbx+(rax-1)*SIZEOF_JSAMPLE]\n        mov     JSAMPLE [rbx+rax*SIZEOF_JSAMPLE], dl\n        mov     dl, JSAMPLE [rsi+(rax-1)*SIZEOF_JSAMPLE]\n        mov     JSAMPLE [rsi+rax*SIZEOF_JSAMPLE], dl    ; insert a dummy sample\n        pop     rdx\n.skip:\n        ; -- process the first column block\n\n        movdqa  xmm0, XMMWORD [rbx+0*SIZEOF_XMMWORD]    ; xmm0=row[ 0][0]\n        movdqa  xmm1, XMMWORD [rcx+0*SIZEOF_XMMWORD]    ; xmm1=row[-1][0]\n        movdqa  xmm2, XMMWORD [rsi+0*SIZEOF_XMMWORD]    ; xmm2=row[+1][0]\n\n        pxor      xmm3,xmm3             ; xmm3=(all 0's)\n        movdqa    xmm4,xmm0\n        punpcklbw xmm0,xmm3             ; xmm0=row[ 0]( 0  1  2  3  4  5  6  7)\n        punpckhbw xmm4,xmm3             ; xmm4=row[ 0]( 8  9 10 11 12 13 14 15)\n        movdqa    xmm5,xmm1\n        punpcklbw xmm1,xmm3             ; xmm1=row[-1]( 0  1  2  3  4  5  6  7)\n        punpckhbw xmm5,xmm3             ; xmm5=row[-1]( 8  9 10 11 12 13 14 15)\n        movdqa    xmm6,xmm2\n        punpcklbw xmm2,xmm3             ; xmm2=row[+1]( 0  1  2  3  4  5  6  7)\n        punpckhbw xmm6,xmm3             ; xmm6=row[+1]( 8  9 10 11 12 13 14 15)\n\n        pmullw  xmm0,[rel PW_THREE]\n        pmullw  xmm4,[rel PW_THREE]\n\n        pcmpeqb xmm7,xmm7\n        psrldq  xmm7,(SIZEOF_XMMWORD-2)\n\n        paddw   xmm1,xmm0               ; xmm1=Int0L=( 0  1  2  3  4  5  6  7)\n        paddw   xmm5,xmm4               ; xmm5=Int0H=( 8  9 10 11 12 13 14 15)\n        paddw   xmm2,xmm0               ; xmm2=Int1L=( 0  1  2  3  4  5  6  7)\n        paddw   xmm6,xmm4               ; xmm6=Int1H=( 8  9 10 11 12 13 14 15)\n\n        movdqa  XMMWORD [rdx+0*SIZEOF_XMMWORD], xmm1    ; temporarily save\n        movdqa  XMMWORD [rdx+1*SIZEOF_XMMWORD], xmm5    ; the intermediate data\n        movdqa  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmm2\n        movdqa  XMMWORD [rdi+1*SIZEOF_XMMWORD], xmm6\n\n        pand    xmm1,xmm7               ; xmm1=( 0 -- -- -- -- -- -- --)\n        pand    xmm2,xmm7               ; xmm2=( 0 -- -- -- -- -- -- --)\n\n        movdqa  XMMWORD [wk(0)], xmm1\n        movdqa  XMMWORD [wk(1)], xmm2\n\n        add     rax, byte SIZEOF_XMMWORD-1\n        and     rax, byte -SIZEOF_XMMWORD\n        cmp     rax, byte SIZEOF_XMMWORD\n        ja      short .columnloop\n\n.columnloop_last:\n        ; -- process the last column block\n\n        pcmpeqb xmm1,xmm1\n        pslldq  xmm1,(SIZEOF_XMMWORD-2)\n        movdqa  xmm2,xmm1\n\n        pand    xmm1, XMMWORD [rdx+1*SIZEOF_XMMWORD]\n        pand    xmm2, XMMWORD [rdi+1*SIZEOF_XMMWORD]\n\n        movdqa  XMMWORD [wk(2)], xmm1   ; xmm1=(-- -- -- -- -- -- -- 15)\n        movdqa  XMMWORD [wk(3)], xmm2   ; xmm2=(-- -- -- -- -- -- -- 15)\n\n        jmp     near .upsample\n\n.columnloop:\n        ; -- process the next column block\n\n        movdqa  xmm0, XMMWORD [rbx+1*SIZEOF_XMMWORD]    ; xmm0=row[ 0][1]\n        movdqa  xmm1, XMMWORD [rcx+1*SIZEOF_XMMWORD]    ; xmm1=row[-1][1]\n        movdqa  xmm2, XMMWORD [rsi+1*SIZEOF_XMMWORD]    ; xmm2=row[+1][1]\n\n        pxor      xmm3,xmm3             ; xmm3=(all 0's)\n        movdqa    xmm4,xmm0\n        punpcklbw xmm0,xmm3             ; xmm0=row[ 0]( 0  1  2  3  4  5  6  7)\n        punpckhbw xmm4,xmm3             ; xmm4=row[ 0]( 8  9 10 11 12 13 14 15)\n        movdqa    xmm5,xmm1\n        punpcklbw xmm1,xmm3             ; xmm1=row[-1]( 0  1  2  3  4  5  6  7)\n        punpckhbw xmm5,xmm3             ; xmm5=row[-1]( 8  9 10 11 12 13 14 15)\n        movdqa    xmm6,xmm2\n        punpcklbw xmm2,xmm3             ; xmm2=row[+1]( 0  1  2  3  4  5  6  7)\n        punpckhbw xmm6,xmm3             ; xmm6=row[+1]( 8  9 10 11 12 13 14 15)\n\n        pmullw  xmm0,[rel PW_THREE]\n        pmullw  xmm4,[rel PW_THREE]\n\n        paddw   xmm1,xmm0               ; xmm1=Int0L=( 0  1  2  3  4  5  6  7)\n        paddw   xmm5,xmm4               ; xmm5=Int0H=( 8  9 10 11 12 13 14 15)\n        paddw   xmm2,xmm0               ; xmm2=Int1L=( 0  1  2  3  4  5  6  7)\n        paddw   xmm6,xmm4               ; xmm6=Int1H=( 8  9 10 11 12 13 14 15)\n\n        movdqa  XMMWORD [rdx+2*SIZEOF_XMMWORD], xmm1    ; temporarily save\n        movdqa  XMMWORD [rdx+3*SIZEOF_XMMWORD], xmm5    ; the intermediate data\n        movdqa  XMMWORD [rdi+2*SIZEOF_XMMWORD], xmm2\n        movdqa  XMMWORD [rdi+3*SIZEOF_XMMWORD], xmm6\n\n        pslldq  xmm1,(SIZEOF_XMMWORD-2) ; xmm1=(-- -- -- -- -- -- --  0)\n        pslldq  xmm2,(SIZEOF_XMMWORD-2) ; xmm2=(-- -- -- -- -- -- --  0)\n\n        movdqa  XMMWORD [wk(2)], xmm1\n        movdqa  XMMWORD [wk(3)], xmm2\n\n.upsample:\n        ; -- process the upper row\n\n        movdqa  xmm7, XMMWORD [rdx+0*SIZEOF_XMMWORD]\n        movdqa  xmm3, XMMWORD [rdx+1*SIZEOF_XMMWORD]\n\n        movdqa  xmm0,xmm7               ; xmm7=Int0L=( 0  1  2  3  4  5  6  7)\n        movdqa  xmm4,xmm3               ; xmm3=Int0H=( 8  9 10 11 12 13 14 15)\n        psrldq  xmm0,2                  ; xmm0=( 1  2  3  4  5  6  7 --)\n        pslldq  xmm4,(SIZEOF_XMMWORD-2) ; xmm4=(-- -- -- -- -- -- --  8)\n        movdqa  xmm5,xmm7\n        movdqa  xmm6,xmm3\n        psrldq  xmm5,(SIZEOF_XMMWORD-2) ; xmm5=( 7 -- -- -- -- -- -- --)\n        pslldq  xmm6,2                  ; xmm6=(--  8  9 10 11 12 13 14)\n\n        por     xmm0,xmm4               ; xmm0=( 1  2  3  4  5  6  7  8)\n        por     xmm5,xmm6               ; xmm5=( 7  8  9 10 11 12 13 14)\n\n        movdqa  xmm1,xmm7\n        movdqa  xmm2,xmm3\n        pslldq  xmm1,2                  ; xmm1=(--  0  1  2  3  4  5  6)\n        psrldq  xmm2,2                  ; xmm2=( 9 10 11 12 13 14 15 --)\n        movdqa  xmm4,xmm3\n        psrldq  xmm4,(SIZEOF_XMMWORD-2) ; xmm4=(15 -- -- -- -- -- -- --)\n\n        por     xmm1, XMMWORD [wk(0)]   ; xmm1=(-1  0  1  2  3  4  5  6)\n        por     xmm2, XMMWORD [wk(2)]   ; xmm2=( 9 10 11 12 13 14 15 16)\n\n        movdqa  XMMWORD [wk(0)], xmm4\n\n        pmullw  xmm7,[rel PW_THREE]\n        pmullw  xmm3,[rel PW_THREE]\n        paddw   xmm1,[rel PW_EIGHT]\n        paddw   xmm5,[rel PW_EIGHT]\n        paddw   xmm0,[rel PW_SEVEN]\n        paddw   xmm2,[rel PW_SEVEN]\n\n        paddw   xmm1,xmm7\n        paddw   xmm5,xmm3\n        psrlw   xmm1,4                  ; xmm1=Out0LE=( 0  2  4  6  8 10 12 14)\n        psrlw   xmm5,4                  ; xmm5=Out0HE=(16 18 20 22 24 26 28 30)\n        paddw   xmm0,xmm7\n        paddw   xmm2,xmm3\n        psrlw   xmm0,4                  ; xmm0=Out0LO=( 1  3  5  7  9 11 13 15)\n        psrlw   xmm2,4                  ; xmm2=Out0HO=(17 19 21 23 25 27 29 31)\n\n        psllw   xmm0,BYTE_BIT\n        psllw   xmm2,BYTE_BIT\n        por     xmm1,xmm0               ; xmm1=Out0L=( 0  1  2 ... 13 14 15)\n        por     xmm5,xmm2               ; xmm5=Out0H=(16 17 18 ... 29 30 31)\n\n        movdqa  XMMWORD [rdx+0*SIZEOF_XMMWORD], xmm1\n        movdqa  XMMWORD [rdx+1*SIZEOF_XMMWORD], xmm5\n\n        ; -- process the lower row\n\n        movdqa  xmm6, XMMWORD [rdi+0*SIZEOF_XMMWORD]\n        movdqa  xmm4, XMMWORD [rdi+1*SIZEOF_XMMWORD]\n\n        movdqa  xmm7,xmm6               ; xmm6=Int1L=( 0  1  2  3  4  5  6  7)\n        movdqa  xmm3,xmm4               ; xmm4=Int1H=( 8  9 10 11 12 13 14 15)\n        psrldq  xmm7,2                  ; xmm7=( 1  2  3  4  5  6  7 --)\n        pslldq  xmm3,(SIZEOF_XMMWORD-2) ; xmm3=(-- -- -- -- -- -- --  8)\n        movdqa  xmm0,xmm6\n        movdqa  xmm2,xmm4\n        psrldq  xmm0,(SIZEOF_XMMWORD-2) ; xmm0=( 7 -- -- -- -- -- -- --)\n        pslldq  xmm2,2                  ; xmm2=(--  8  9 10 11 12 13 14)\n\n        por     xmm7,xmm3               ; xmm7=( 1  2  3  4  5  6  7  8)\n        por     xmm0,xmm2               ; xmm0=( 7  8  9 10 11 12 13 14)\n\n        movdqa  xmm1,xmm6\n        movdqa  xmm5,xmm4\n        pslldq  xmm1,2                  ; xmm1=(--  0  1  2  3  4  5  6)\n        psrldq  xmm5,2                  ; xmm5=( 9 10 11 12 13 14 15 --)\n        movdqa  xmm3,xmm4\n        psrldq  xmm3,(SIZEOF_XMMWORD-2) ; xmm3=(15 -- -- -- -- -- -- --)\n\n        por     xmm1, XMMWORD [wk(1)]   ; xmm1=(-1  0  1  2  3  4  5  6)\n        por     xmm5, XMMWORD [wk(3)]   ; xmm5=( 9 10 11 12 13 14 15 16)\n\n        movdqa  XMMWORD [wk(1)], xmm3\n\n        pmullw  xmm6,[rel PW_THREE]\n        pmullw  xmm4,[rel PW_THREE]\n        paddw   xmm1,[rel PW_EIGHT]\n        paddw   xmm0,[rel PW_EIGHT]\n        paddw   xmm7,[rel PW_SEVEN]\n        paddw   xmm5,[rel PW_SEVEN]\n\n        paddw   xmm1,xmm6\n        paddw   xmm0,xmm4\n        psrlw   xmm1,4                  ; xmm1=Out1LE=( 0  2  4  6  8 10 12 14)\n        psrlw   xmm0,4                  ; xmm0=Out1HE=(16 18 20 22 24 26 28 30)\n        paddw   xmm7,xmm6\n        paddw   xmm5,xmm4\n        psrlw   xmm7,4                  ; xmm7=Out1LO=( 1  3  5  7  9 11 13 15)\n        psrlw   xmm5,4                  ; xmm5=Out1HO=(17 19 21 23 25 27 29 31)\n\n        psllw   xmm7,BYTE_BIT\n        psllw   xmm5,BYTE_BIT\n        por     xmm1,xmm7               ; xmm1=Out1L=( 0  1  2 ... 13 14 15)\n        por     xmm0,xmm5               ; xmm0=Out1H=(16 17 18 ... 29 30 31)\n\n        movdqa  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmm1\n        movdqa  XMMWORD [rdi+1*SIZEOF_XMMWORD], xmm0\n\n        sub     rax, byte SIZEOF_XMMWORD\n        add     rcx, byte 1*SIZEOF_XMMWORD      ; inptr1(above)\n        add     rbx, byte 1*SIZEOF_XMMWORD      ; inptr0\n        add     rsi, byte 1*SIZEOF_XMMWORD      ; inptr1(below)\n        add     rdx, byte 2*SIZEOF_XMMWORD      ; outptr0\n        add     rdi, byte 2*SIZEOF_XMMWORD      ; outptr1\n        cmp     rax, byte SIZEOF_XMMWORD\n        ja      near .columnloop\n        test    rax,rax\n        jnz     near .columnloop_last\n\n        pop     rsi\n        pop     rdi\n        pop     rcx\n        pop     rax\n\n        add     rsi, byte 1*SIZEOF_JSAMPROW     ; input_data\n        add     rdi, byte 2*SIZEOF_JSAMPROW     ; output_data\n        sub     rcx, byte 2                     ; rowctr\n        jg      near .rowloop\n\n.return:\n        pop     rbx\n        uncollect_args\n        mov     rsp,rbp         ; rsp <- aligned rbp\n        pop     rsp             ; rsp <- original rbp\n        pop     rbp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Fast processing for the common case of 2:1 horizontal and 1:1 vertical.\n; It's still a box filter.\n;\n; GLOBAL(void)\n; jsimd_h2v1_upsample_sse2 (int max_v_samp_factor,\n;                           JDIMENSION output_width,\n;                           JSAMPARRAY input_data,\n;                           JSAMPARRAY *output_data_ptr);\n;\n\n; r10 = int max_v_samp_factor\n; r11 = JDIMENSION output_width\n; r12 = JSAMPARRAY input_data\n; r13 = JSAMPARRAY *output_data_ptr\n\n        align   16\n        global  EXTN(jsimd_h2v1_upsample_sse2)\n\nEXTN(jsimd_h2v1_upsample_sse2):\n        push    rbp\n        mov     rax,rsp\n        mov     rbp,rsp\n        collect_args\n\n        mov     edx, r11d\n        add     rdx, byte (2*SIZEOF_XMMWORD)-1\n        and     rdx, byte -(2*SIZEOF_XMMWORD)\n        jz      near .return\n\n        mov     rcx, r10        ; rowctr\n        test    rcx,rcx\n        jz      short .return\n\n        mov     rsi, r12 ; input_data\n        mov     rdi, r13\n        mov     rdi, JSAMPARRAY [rdi]                   ; output_data\n.rowloop:\n        push    rdi\n        push    rsi\n\n        mov     rsi, JSAMPROW [rsi]             ; inptr\n        mov     rdi, JSAMPROW [rdi]             ; outptr\n        mov     rax,rdx                         ; colctr\n.columnloop:\n\n        movdqa  xmm0, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\n        movdqa    xmm1,xmm0\n        punpcklbw xmm0,xmm0\n        punpckhbw xmm1,xmm1\n\n        movdqa  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmm0\n        movdqa  XMMWORD [rdi+1*SIZEOF_XMMWORD], xmm1\n\n        sub     rax, byte 2*SIZEOF_XMMWORD\n        jz      short .nextrow\n\n        movdqa  xmm2, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\n        movdqa    xmm3,xmm2\n        punpcklbw xmm2,xmm2\n        punpckhbw xmm3,xmm3\n\n        movdqa  XMMWORD [rdi+2*SIZEOF_XMMWORD], xmm2\n        movdqa  XMMWORD [rdi+3*SIZEOF_XMMWORD], xmm3\n\n        sub     rax, byte 2*SIZEOF_XMMWORD\n        jz      short .nextrow\n\n        add     rsi, byte 2*SIZEOF_XMMWORD      ; inptr\n        add     rdi, byte 4*SIZEOF_XMMWORD      ; outptr\n        jmp     short .columnloop\n\n.nextrow:\n        pop     rsi\n        pop     rdi\n\n        add     rsi, byte SIZEOF_JSAMPROW       ; input_data\n        add     rdi, byte SIZEOF_JSAMPROW       ; output_data\n        dec     rcx                             ; rowctr\n        jg      short .rowloop\n\n.return:\n        uncollect_args\n        pop     rbp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Fast processing for the common case of 2:1 horizontal and 2:1 vertical.\n; It's still a box filter.\n;\n; GLOBAL(void)\n; jsimd_h2v2_upsample_sse2 (nt max_v_samp_factor,\n;                           JDIMENSION output_width,\n;                           JSAMPARRAY input_data,\n;                           JSAMPARRAY *output_data_ptr);\n;\n\n; r10 = int max_v_samp_factor\n; r11 = JDIMENSION output_width\n; r12 = JSAMPARRAY input_data\n; r13 = JSAMPARRAY *output_data_ptr\n\n        align   16\n        global  EXTN(jsimd_h2v2_upsample_sse2)\n\nEXTN(jsimd_h2v2_upsample_sse2):\n        push    rbp\n        mov     rax,rsp\n        mov     rbp,rsp\n        collect_args\n        push    rbx\n\n        mov     edx, r11d\n        add     rdx, byte (2*SIZEOF_XMMWORD)-1\n        and     rdx, byte -(2*SIZEOF_XMMWORD)\n        jz      near .return\n\n        mov     rcx, r10        ; rowctr\n        test    rcx,rcx\n        jz      near .return\n\n        mov     rsi, r12        ; input_data\n        mov     rdi, r13\n        mov     rdi, JSAMPARRAY [rdi]                   ; output_data\n.rowloop:\n        push    rdi\n        push    rsi\n\n        mov     rsi, JSAMPROW [rsi]                     ; inptr\n        mov     rbx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW]   ; outptr0\n        mov     rdi, JSAMPROW [rdi+1*SIZEOF_JSAMPROW]   ; outptr1\n        mov     rax,rdx                                 ; colctr\n.columnloop:\n\n        movdqa  xmm0, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\n        movdqa    xmm1,xmm0\n        punpcklbw xmm0,xmm0\n        punpckhbw xmm1,xmm1\n\n        movdqa  XMMWORD [rbx+0*SIZEOF_XMMWORD], xmm0\n        movdqa  XMMWORD [rbx+1*SIZEOF_XMMWORD], xmm1\n        movdqa  XMMWORD [rdi+0*SIZEOF_XMMWORD], xmm0\n        movdqa  XMMWORD [rdi+1*SIZEOF_XMMWORD], xmm1\n\n        sub     rax, byte 2*SIZEOF_XMMWORD\n        jz      short .nextrow\n\n        movdqa  xmm2, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\n        movdqa    xmm3,xmm2\n        punpcklbw xmm2,xmm2\n        punpckhbw xmm3,xmm3\n\n        movdqa  XMMWORD [rbx+2*SIZEOF_XMMWORD], xmm2\n        movdqa  XMMWORD [rbx+3*SIZEOF_XMMWORD], xmm3\n        movdqa  XMMWORD [rdi+2*SIZEOF_XMMWORD], xmm2\n        movdqa  XMMWORD [rdi+3*SIZEOF_XMMWORD], xmm3\n\n        sub     rax, byte 2*SIZEOF_XMMWORD\n        jz      short .nextrow\n\n        add     rsi, byte 2*SIZEOF_XMMWORD      ; inptr\n        add     rbx, byte 4*SIZEOF_XMMWORD      ; outptr0\n        add     rdi, byte 4*SIZEOF_XMMWORD      ; outptr1\n        jmp     short .columnloop\n\n.nextrow:\n        pop     rsi\n        pop     rdi\n\n        add     rsi, byte 1*SIZEOF_JSAMPROW     ; input_data\n        add     rdi, byte 2*SIZEOF_JSAMPROW     ; output_data\n        sub     rcx, byte 2                     ; rowctr\n        jg      near .rowloop\n\n.return:\n        pop     rbx\n        uncollect_args\n        pop     rbp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jdsample-sse2.asm",
    "content": ";\n; jdsample.asm - upsampling (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_fancy_upsample_sse2)\n\nEXTN(jconst_fancy_upsample_sse2):\n\nPW_ONE          times 8 dw  1\nPW_TWO          times 8 dw  2\nPW_THREE        times 8 dw  3\nPW_SEVEN        times 8 dw  7\nPW_EIGHT        times 8 dw  8\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Fancy processing for the common case of 2:1 horizontal and 1:1 vertical.\n;\n; The upsampling algorithm is linear interpolation between pixel centers,\n; also known as a \"triangle filter\".  This is a good compromise between\n; speed and visual quality.  The centers of the output pixels are 1/4 and 3/4\n; of the way between input pixel centers.\n;\n; GLOBAL(void)\n; jsimd_h2v1_fancy_upsample_sse2 (int max_v_samp_factor,\n;                                 JDIMENSION downsampled_width,\n;                                 JSAMPARRAY input_data,\n;                                 JSAMPARRAY *output_data_ptr);\n;\n\n%define max_v_samp(b)           (b)+8           ; int max_v_samp_factor\n%define downsamp_width(b)       (b)+12          ; JDIMENSION downsampled_width\n%define input_data(b)           (b)+16          ; JSAMPARRAY input_data\n%define output_data_ptr(b)      (b)+20          ; JSAMPARRAY *output_data_ptr\n\n        align   16\n        global  EXTN(jsimd_h2v1_fancy_upsample_sse2)\n\nEXTN(jsimd_h2v1_fancy_upsample_sse2):\n        push    ebp\n        mov     ebp,esp\n        pushpic ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx             ; get GOT address\n\n        mov     eax, JDIMENSION [downsamp_width(ebp)]  ; colctr\n        test    eax,eax\n        jz      near .return\n\n        mov     ecx, INT [max_v_samp(ebp)]      ; rowctr\n        test    ecx,ecx\n        jz      near .return\n\n        mov     esi, JSAMPARRAY [input_data(ebp)]       ; input_data\n        mov     edi, POINTER [output_data_ptr(ebp)]\n        mov     edi, JSAMPARRAY [edi]                   ; output_data\n        alignx  16,7\n.rowloop:\n        push    eax                     ; colctr\n        push    edi\n        push    esi\n\n        mov     esi, JSAMPROW [esi]     ; inptr\n        mov     edi, JSAMPROW [edi]     ; outptr\n\n        test    eax, SIZEOF_XMMWORD-1\n        jz      short .skip\n        mov     dl, JSAMPLE [esi+(eax-1)*SIZEOF_JSAMPLE]\n        mov     JSAMPLE [esi+eax*SIZEOF_JSAMPLE], dl    ; insert a dummy sample\n.skip:\n        pxor    xmm0,xmm0               ; xmm0=(all 0's)\n        pcmpeqb xmm7,xmm7\n        psrldq  xmm7,(SIZEOF_XMMWORD-1)\n        pand    xmm7, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\n        add     eax, byte SIZEOF_XMMWORD-1\n        and     eax, byte -SIZEOF_XMMWORD\n        cmp     eax, byte SIZEOF_XMMWORD\n        ja      short .columnloop\n        alignx  16,7\n\n.columnloop_last:\n        pcmpeqb xmm6,xmm6\n        pslldq  xmm6,(SIZEOF_XMMWORD-1)\n        pand    xmm6, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        jmp     short .upsample\n        alignx  16,7\n\n.columnloop:\n        movdqa  xmm6, XMMWORD [esi+1*SIZEOF_XMMWORD]\n        pslldq  xmm6,(SIZEOF_XMMWORD-1)\n\n.upsample:\n        movdqa  xmm1, XMMWORD [esi+0*SIZEOF_XMMWORD]\n        movdqa  xmm2,xmm1\n        movdqa  xmm3,xmm1               ; xmm1=( 0  1  2 ... 13 14 15)\n        pslldq  xmm2,1                  ; xmm2=(--  0  1 ... 12 13 14)\n        psrldq  xmm3,1                  ; xmm3=( 1  2  3 ... 14 15 --)\n\n        por     xmm2,xmm7               ; xmm2=(-1  0  1 ... 12 13 14)\n        por     xmm3,xmm6               ; xmm3=( 1  2  3 ... 14 15 16)\n\n        movdqa  xmm7,xmm1\n        psrldq  xmm7,(SIZEOF_XMMWORD-1) ; xmm7=(15 -- -- ... -- -- --)\n\n        movdqa    xmm4,xmm1\n        punpcklbw xmm1,xmm0             ; xmm1=( 0  1  2  3  4  5  6  7)\n        punpckhbw xmm4,xmm0             ; xmm4=( 8  9 10 11 12 13 14 15)\n        movdqa    xmm5,xmm2\n        punpcklbw xmm2,xmm0             ; xmm2=(-1  0  1  2  3  4  5  6)\n        punpckhbw xmm5,xmm0             ; xmm5=( 7  8  9 10 11 12 13 14)\n        movdqa    xmm6,xmm3\n        punpcklbw xmm3,xmm0             ; xmm3=( 1  2  3  4  5  6  7  8)\n        punpckhbw xmm6,xmm0             ; xmm6=( 9 10 11 12 13 14 15 16)\n\n        pmullw  xmm1,[GOTOFF(ebx,PW_THREE)]\n        pmullw  xmm4,[GOTOFF(ebx,PW_THREE)]\n        paddw   xmm2,[GOTOFF(ebx,PW_ONE)]\n        paddw   xmm5,[GOTOFF(ebx,PW_ONE)]\n        paddw   xmm3,[GOTOFF(ebx,PW_TWO)]\n        paddw   xmm6,[GOTOFF(ebx,PW_TWO)]\n\n        paddw   xmm2,xmm1\n        paddw   xmm5,xmm4\n        psrlw   xmm2,2                  ; xmm2=OutLE=( 0  2  4  6  8 10 12 14)\n        psrlw   xmm5,2                  ; xmm5=OutHE=(16 18 20 22 24 26 28 30)\n        paddw   xmm3,xmm1\n        paddw   xmm6,xmm4\n        psrlw   xmm3,2                  ; xmm3=OutLO=( 1  3  5  7  9 11 13 15)\n        psrlw   xmm6,2                  ; xmm6=OutHO=(17 19 21 23 25 27 29 31)\n\n        psllw   xmm3,BYTE_BIT\n        psllw   xmm6,BYTE_BIT\n        por     xmm2,xmm3               ; xmm2=OutL=( 0  1  2 ... 13 14 15)\n        por     xmm5,xmm6               ; xmm5=OutH=(16 17 18 ... 29 30 31)\n\n        movdqa  XMMWORD [edi+0*SIZEOF_XMMWORD], xmm2\n        movdqa  XMMWORD [edi+1*SIZEOF_XMMWORD], xmm5\n\n        sub     eax, byte SIZEOF_XMMWORD\n        add     esi, byte 1*SIZEOF_XMMWORD      ; inptr\n        add     edi, byte 2*SIZEOF_XMMWORD      ; outptr\n        cmp     eax, byte SIZEOF_XMMWORD\n        ja      near .columnloop\n        test    eax,eax\n        jnz     near .columnloop_last\n\n        pop     esi\n        pop     edi\n        pop     eax\n\n        add     esi, byte SIZEOF_JSAMPROW       ; input_data\n        add     edi, byte SIZEOF_JSAMPROW       ; output_data\n        dec     ecx                             ; rowctr\n        jg      near .rowloop\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        poppic  ebx\n        pop     ebp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Fancy processing for the common case of 2:1 horizontal and 2:1 vertical.\n; Again a triangle filter; see comments for h2v1 case, above.\n;\n; GLOBAL(void)\n; jsimd_h2v2_fancy_upsample_sse2 (int max_v_samp_factor,\n;                                 JDIMENSION downsampled_width,\n;                                 JSAMPARRAY input_data,\n;                                 JSAMPARRAY *output_data_ptr);\n;\n\n%define max_v_samp(b)           (b)+8           ; int max_v_samp_factor\n%define downsamp_width(b)       (b)+12          ; JDIMENSION downsampled_width\n%define input_data(b)           (b)+16          ; JSAMPARRAY input_data\n%define output_data_ptr(b)      (b)+20          ; JSAMPARRAY *output_data_ptr\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          4\n%define gotptr          wk(0)-SIZEOF_POINTER    ; void *gotptr\n\n        align   16\n        global  EXTN(jsimd_h2v2_fancy_upsample_sse2)\n\nEXTN(jsimd_h2v2_fancy_upsample_sse2):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic eax             ; make a room for GOT address\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx                     ; get GOT address\n        movpic  POINTER [gotptr], ebx   ; save GOT address\n\n        mov     edx,eax                         ; edx = original ebp\n        mov     eax, JDIMENSION [downsamp_width(edx)]  ; colctr\n        test    eax,eax\n        jz      near .return\n\n        mov     ecx, INT [max_v_samp(edx)]      ; rowctr\n        test    ecx,ecx\n        jz      near .return\n\n        mov     esi, JSAMPARRAY [input_data(edx)]       ; input_data\n        mov     edi, POINTER [output_data_ptr(edx)]\n        mov     edi, JSAMPARRAY [edi]                   ; output_data\n        alignx  16,7\n.rowloop:\n        push    eax                                     ; colctr\n        push    ecx\n        push    edi\n        push    esi\n\n        mov     ecx, JSAMPROW [esi-1*SIZEOF_JSAMPROW]   ; inptr1(above)\n        mov     ebx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]   ; inptr0\n        mov     esi, JSAMPROW [esi+1*SIZEOF_JSAMPROW]   ; inptr1(below)\n        mov     edx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]   ; outptr0\n        mov     edi, JSAMPROW [edi+1*SIZEOF_JSAMPROW]   ; outptr1\n\n        test    eax, SIZEOF_XMMWORD-1\n        jz      short .skip\n        push    edx\n        mov     dl, JSAMPLE [ecx+(eax-1)*SIZEOF_JSAMPLE]\n        mov     JSAMPLE [ecx+eax*SIZEOF_JSAMPLE], dl\n        mov     dl, JSAMPLE [ebx+(eax-1)*SIZEOF_JSAMPLE]\n        mov     JSAMPLE [ebx+eax*SIZEOF_JSAMPLE], dl\n        mov     dl, JSAMPLE [esi+(eax-1)*SIZEOF_JSAMPLE]\n        mov     JSAMPLE [esi+eax*SIZEOF_JSAMPLE], dl    ; insert a dummy sample\n        pop     edx\n.skip:\n        ; -- process the first column block\n\n        movdqa  xmm0, XMMWORD [ebx+0*SIZEOF_XMMWORD]    ; xmm0=row[ 0][0]\n        movdqa  xmm1, XMMWORD [ecx+0*SIZEOF_XMMWORD]    ; xmm1=row[-1][0]\n        movdqa  xmm2, XMMWORD [esi+0*SIZEOF_XMMWORD]    ; xmm2=row[+1][0]\n\n        pushpic ebx\n        movpic  ebx, POINTER [gotptr]   ; load GOT address\n\n        pxor      xmm3,xmm3             ; xmm3=(all 0's)\n        movdqa    xmm4,xmm0\n        punpcklbw xmm0,xmm3             ; xmm0=row[ 0]( 0  1  2  3  4  5  6  7)\n        punpckhbw xmm4,xmm3             ; xmm4=row[ 0]( 8  9 10 11 12 13 14 15)\n        movdqa    xmm5,xmm1\n        punpcklbw xmm1,xmm3             ; xmm1=row[-1]( 0  1  2  3  4  5  6  7)\n        punpckhbw xmm5,xmm3             ; xmm5=row[-1]( 8  9 10 11 12 13 14 15)\n        movdqa    xmm6,xmm2\n        punpcklbw xmm2,xmm3             ; xmm2=row[+1]( 0  1  2  3  4  5  6  7)\n        punpckhbw xmm6,xmm3             ; xmm6=row[+1]( 8  9 10 11 12 13 14 15)\n\n        pmullw  xmm0,[GOTOFF(ebx,PW_THREE)]\n        pmullw  xmm4,[GOTOFF(ebx,PW_THREE)]\n\n        pcmpeqb xmm7,xmm7\n        psrldq  xmm7,(SIZEOF_XMMWORD-2)\n\n        paddw   xmm1,xmm0               ; xmm1=Int0L=( 0  1  2  3  4  5  6  7)\n        paddw   xmm5,xmm4               ; xmm5=Int0H=( 8  9 10 11 12 13 14 15)\n        paddw   xmm2,xmm0               ; xmm2=Int1L=( 0  1  2  3  4  5  6  7)\n        paddw   xmm6,xmm4               ; xmm6=Int1H=( 8  9 10 11 12 13 14 15)\n\n        movdqa  XMMWORD [edx+0*SIZEOF_XMMWORD], xmm1    ; temporarily save\n        movdqa  XMMWORD [edx+1*SIZEOF_XMMWORD], xmm5    ; the intermediate data\n        movdqa  XMMWORD [edi+0*SIZEOF_XMMWORD], xmm2\n        movdqa  XMMWORD [edi+1*SIZEOF_XMMWORD], xmm6\n\n        pand    xmm1,xmm7               ; xmm1=( 0 -- -- -- -- -- -- --)\n        pand    xmm2,xmm7               ; xmm2=( 0 -- -- -- -- -- -- --)\n\n        movdqa  XMMWORD [wk(0)], xmm1\n        movdqa  XMMWORD [wk(1)], xmm2\n\n        poppic  ebx\n\n        add     eax, byte SIZEOF_XMMWORD-1\n        and     eax, byte -SIZEOF_XMMWORD\n        cmp     eax, byte SIZEOF_XMMWORD\n        ja      short .columnloop\n        alignx  16,7\n\n.columnloop_last:\n        ; -- process the last column block\n\n        pushpic ebx\n        movpic  ebx, POINTER [gotptr]   ; load GOT address\n\n        pcmpeqb xmm1,xmm1\n        pslldq  xmm1,(SIZEOF_XMMWORD-2)\n        movdqa  xmm2,xmm1\n\n        pand    xmm1, XMMWORD [edx+1*SIZEOF_XMMWORD]\n        pand    xmm2, XMMWORD [edi+1*SIZEOF_XMMWORD]\n\n        movdqa  XMMWORD [wk(2)], xmm1   ; xmm1=(-- -- -- -- -- -- -- 15)\n        movdqa  XMMWORD [wk(3)], xmm2   ; xmm2=(-- -- -- -- -- -- -- 15)\n\n        jmp     near .upsample\n        alignx  16,7\n\n.columnloop:\n        ; -- process the next column block\n\n        movdqa  xmm0, XMMWORD [ebx+1*SIZEOF_XMMWORD]    ; xmm0=row[ 0][1]\n        movdqa  xmm1, XMMWORD [ecx+1*SIZEOF_XMMWORD]    ; xmm1=row[-1][1]\n        movdqa  xmm2, XMMWORD [esi+1*SIZEOF_XMMWORD]    ; xmm2=row[+1][1]\n\n        pushpic ebx\n        movpic  ebx, POINTER [gotptr]   ; load GOT address\n\n        pxor      xmm3,xmm3             ; xmm3=(all 0's)\n        movdqa    xmm4,xmm0\n        punpcklbw xmm0,xmm3             ; xmm0=row[ 0]( 0  1  2  3  4  5  6  7)\n        punpckhbw xmm4,xmm3             ; xmm4=row[ 0]( 8  9 10 11 12 13 14 15)\n        movdqa    xmm5,xmm1\n        punpcklbw xmm1,xmm3             ; xmm1=row[-1]( 0  1  2  3  4  5  6  7)\n        punpckhbw xmm5,xmm3             ; xmm5=row[-1]( 8  9 10 11 12 13 14 15)\n        movdqa    xmm6,xmm2\n        punpcklbw xmm2,xmm3             ; xmm2=row[+1]( 0  1  2  3  4  5  6  7)\n        punpckhbw xmm6,xmm3             ; xmm6=row[+1]( 8  9 10 11 12 13 14 15)\n\n        pmullw  xmm0,[GOTOFF(ebx,PW_THREE)]\n        pmullw  xmm4,[GOTOFF(ebx,PW_THREE)]\n\n        paddw   xmm1,xmm0               ; xmm1=Int0L=( 0  1  2  3  4  5  6  7)\n        paddw   xmm5,xmm4               ; xmm5=Int0H=( 8  9 10 11 12 13 14 15)\n        paddw   xmm2,xmm0               ; xmm2=Int1L=( 0  1  2  3  4  5  6  7)\n        paddw   xmm6,xmm4               ; xmm6=Int1H=( 8  9 10 11 12 13 14 15)\n\n        movdqa  XMMWORD [edx+2*SIZEOF_XMMWORD], xmm1    ; temporarily save\n        movdqa  XMMWORD [edx+3*SIZEOF_XMMWORD], xmm5    ; the intermediate data\n        movdqa  XMMWORD [edi+2*SIZEOF_XMMWORD], xmm2\n        movdqa  XMMWORD [edi+3*SIZEOF_XMMWORD], xmm6\n\n        pslldq  xmm1,(SIZEOF_XMMWORD-2) ; xmm1=(-- -- -- -- -- -- --  0)\n        pslldq  xmm2,(SIZEOF_XMMWORD-2) ; xmm2=(-- -- -- -- -- -- --  0)\n\n        movdqa  XMMWORD [wk(2)], xmm1\n        movdqa  XMMWORD [wk(3)], xmm2\n\n.upsample:\n        ; -- process the upper row\n\n        movdqa  xmm7, XMMWORD [edx+0*SIZEOF_XMMWORD]\n        movdqa  xmm3, XMMWORD [edx+1*SIZEOF_XMMWORD]\n\n        movdqa  xmm0,xmm7               ; xmm7=Int0L=( 0  1  2  3  4  5  6  7)\n        movdqa  xmm4,xmm3               ; xmm3=Int0H=( 8  9 10 11 12 13 14 15)\n        psrldq  xmm0,2                  ; xmm0=( 1  2  3  4  5  6  7 --)\n        pslldq  xmm4,(SIZEOF_XMMWORD-2) ; xmm4=(-- -- -- -- -- -- --  8)\n        movdqa  xmm5,xmm7\n        movdqa  xmm6,xmm3\n        psrldq  xmm5,(SIZEOF_XMMWORD-2) ; xmm5=( 7 -- -- -- -- -- -- --)\n        pslldq  xmm6,2                  ; xmm6=(--  8  9 10 11 12 13 14)\n\n        por     xmm0,xmm4               ; xmm0=( 1  2  3  4  5  6  7  8)\n        por     xmm5,xmm6               ; xmm5=( 7  8  9 10 11 12 13 14)\n\n        movdqa  xmm1,xmm7\n        movdqa  xmm2,xmm3\n        pslldq  xmm1,2                  ; xmm1=(--  0  1  2  3  4  5  6)\n        psrldq  xmm2,2                  ; xmm2=( 9 10 11 12 13 14 15 --)\n        movdqa  xmm4,xmm3\n        psrldq  xmm4,(SIZEOF_XMMWORD-2) ; xmm4=(15 -- -- -- -- -- -- --)\n\n        por     xmm1, XMMWORD [wk(0)]   ; xmm1=(-1  0  1  2  3  4  5  6)\n        por     xmm2, XMMWORD [wk(2)]   ; xmm2=( 9 10 11 12 13 14 15 16)\n\n        movdqa  XMMWORD [wk(0)], xmm4\n\n        pmullw  xmm7,[GOTOFF(ebx,PW_THREE)]\n        pmullw  xmm3,[GOTOFF(ebx,PW_THREE)]\n        paddw   xmm1,[GOTOFF(ebx,PW_EIGHT)]\n        paddw   xmm5,[GOTOFF(ebx,PW_EIGHT)]\n        paddw   xmm0,[GOTOFF(ebx,PW_SEVEN)]\n        paddw   xmm2,[GOTOFF(ebx,PW_SEVEN)]\n\n        paddw   xmm1,xmm7\n        paddw   xmm5,xmm3\n        psrlw   xmm1,4                  ; xmm1=Out0LE=( 0  2  4  6  8 10 12 14)\n        psrlw   xmm5,4                  ; xmm5=Out0HE=(16 18 20 22 24 26 28 30)\n        paddw   xmm0,xmm7\n        paddw   xmm2,xmm3\n        psrlw   xmm0,4                  ; xmm0=Out0LO=( 1  3  5  7  9 11 13 15)\n        psrlw   xmm2,4                  ; xmm2=Out0HO=(17 19 21 23 25 27 29 31)\n\n        psllw   xmm0,BYTE_BIT\n        psllw   xmm2,BYTE_BIT\n        por     xmm1,xmm0               ; xmm1=Out0L=( 0  1  2 ... 13 14 15)\n        por     xmm5,xmm2               ; xmm5=Out0H=(16 17 18 ... 29 30 31)\n\n        movdqa  XMMWORD [edx+0*SIZEOF_XMMWORD], xmm1\n        movdqa  XMMWORD [edx+1*SIZEOF_XMMWORD], xmm5\n\n        ; -- process the lower row\n\n        movdqa  xmm6, XMMWORD [edi+0*SIZEOF_XMMWORD]\n        movdqa  xmm4, XMMWORD [edi+1*SIZEOF_XMMWORD]\n\n        movdqa  xmm7,xmm6               ; xmm6=Int1L=( 0  1  2  3  4  5  6  7)\n        movdqa  xmm3,xmm4               ; xmm4=Int1H=( 8  9 10 11 12 13 14 15)\n        psrldq  xmm7,2                  ; xmm7=( 1  2  3  4  5  6  7 --)\n        pslldq  xmm3,(SIZEOF_XMMWORD-2) ; xmm3=(-- -- -- -- -- -- --  8)\n        movdqa  xmm0,xmm6\n        movdqa  xmm2,xmm4\n        psrldq  xmm0,(SIZEOF_XMMWORD-2) ; xmm0=( 7 -- -- -- -- -- -- --)\n        pslldq  xmm2,2                  ; xmm2=(--  8  9 10 11 12 13 14)\n\n        por     xmm7,xmm3               ; xmm7=( 1  2  3  4  5  6  7  8)\n        por     xmm0,xmm2               ; xmm0=( 7  8  9 10 11 12 13 14)\n\n        movdqa  xmm1,xmm6\n        movdqa  xmm5,xmm4\n        pslldq  xmm1,2                  ; xmm1=(--  0  1  2  3  4  5  6)\n        psrldq  xmm5,2                  ; xmm5=( 9 10 11 12 13 14 15 --)\n        movdqa  xmm3,xmm4\n        psrldq  xmm3,(SIZEOF_XMMWORD-2) ; xmm3=(15 -- -- -- -- -- -- --)\n\n        por     xmm1, XMMWORD [wk(1)]   ; xmm1=(-1  0  1  2  3  4  5  6)\n        por     xmm5, XMMWORD [wk(3)]   ; xmm5=( 9 10 11 12 13 14 15 16)\n\n        movdqa  XMMWORD [wk(1)], xmm3\n\n        pmullw  xmm6,[GOTOFF(ebx,PW_THREE)]\n        pmullw  xmm4,[GOTOFF(ebx,PW_THREE)]\n        paddw   xmm1,[GOTOFF(ebx,PW_EIGHT)]\n        paddw   xmm0,[GOTOFF(ebx,PW_EIGHT)]\n        paddw   xmm7,[GOTOFF(ebx,PW_SEVEN)]\n        paddw   xmm5,[GOTOFF(ebx,PW_SEVEN)]\n\n        paddw   xmm1,xmm6\n        paddw   xmm0,xmm4\n        psrlw   xmm1,4                  ; xmm1=Out1LE=( 0  2  4  6  8 10 12 14)\n        psrlw   xmm0,4                  ; xmm0=Out1HE=(16 18 20 22 24 26 28 30)\n        paddw   xmm7,xmm6\n        paddw   xmm5,xmm4\n        psrlw   xmm7,4                  ; xmm7=Out1LO=( 1  3  5  7  9 11 13 15)\n        psrlw   xmm5,4                  ; xmm5=Out1HO=(17 19 21 23 25 27 29 31)\n\n        psllw   xmm7,BYTE_BIT\n        psllw   xmm5,BYTE_BIT\n        por     xmm1,xmm7               ; xmm1=Out1L=( 0  1  2 ... 13 14 15)\n        por     xmm0,xmm5               ; xmm0=Out1H=(16 17 18 ... 29 30 31)\n\n        movdqa  XMMWORD [edi+0*SIZEOF_XMMWORD], xmm1\n        movdqa  XMMWORD [edi+1*SIZEOF_XMMWORD], xmm0\n\n        poppic  ebx\n\n        sub     eax, byte SIZEOF_XMMWORD\n        add     ecx, byte 1*SIZEOF_XMMWORD      ; inptr1(above)\n        add     ebx, byte 1*SIZEOF_XMMWORD      ; inptr0\n        add     esi, byte 1*SIZEOF_XMMWORD      ; inptr1(below)\n        add     edx, byte 2*SIZEOF_XMMWORD      ; outptr0\n        add     edi, byte 2*SIZEOF_XMMWORD      ; outptr1\n        cmp     eax, byte SIZEOF_XMMWORD\n        ja      near .columnloop\n        test    eax,eax\n        jnz     near .columnloop_last\n\n        pop     esi\n        pop     edi\n        pop     ecx\n        pop     eax\n\n        add     esi, byte 1*SIZEOF_JSAMPROW     ; input_data\n        add     edi, byte 2*SIZEOF_JSAMPROW     ; output_data\n        sub     ecx, byte 2                     ; rowctr\n        jg      near .rowloop\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Fast processing for the common case of 2:1 horizontal and 1:1 vertical.\n; It's still a box filter.\n;\n; GLOBAL(void)\n; jsimd_h2v1_upsample_sse2 (int max_v_samp_factor,\n;                           JDIMENSION output_width,\n;                           JSAMPARRAY input_data,\n;                           JSAMPARRAY *output_data_ptr);\n;\n\n%define max_v_samp(b)           (b)+8           ; int max_v_samp_factor\n%define output_width(b)         (b)+12          ; JDIMENSION output_width\n%define input_data(b)           (b)+16          ; JSAMPARRAY input_data\n%define output_data_ptr(b)      (b)+20          ; JSAMPARRAY *output_data_ptr\n\n        align   16\n        global  EXTN(jsimd_h2v1_upsample_sse2)\n\nEXTN(jsimd_h2v1_upsample_sse2):\n        push    ebp\n        mov     ebp,esp\n;       push    ebx             ; unused\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        mov     edx, JDIMENSION [output_width(ebp)]\n        add     edx, byte (2*SIZEOF_XMMWORD)-1\n        and     edx, byte -(2*SIZEOF_XMMWORD)\n        jz      short .return\n\n        mov     ecx, INT [max_v_samp(ebp)]      ; rowctr\n        test    ecx,ecx\n        jz      short .return\n\n        mov     esi, JSAMPARRAY [input_data(ebp)]       ; input_data\n        mov     edi, POINTER [output_data_ptr(ebp)]\n        mov     edi, JSAMPARRAY [edi]                   ; output_data\n        alignx  16,7\n.rowloop:\n        push    edi\n        push    esi\n\n        mov     esi, JSAMPROW [esi]             ; inptr\n        mov     edi, JSAMPROW [edi]             ; outptr\n        mov     eax,edx                         ; colctr\n        alignx  16,7\n.columnloop:\n\n        movdqa  xmm0, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\n        movdqa    xmm1,xmm0\n        punpcklbw xmm0,xmm0\n        punpckhbw xmm1,xmm1\n\n        movdqa  XMMWORD [edi+0*SIZEOF_XMMWORD], xmm0\n        movdqa  XMMWORD [edi+1*SIZEOF_XMMWORD], xmm1\n\n        sub     eax, byte 2*SIZEOF_XMMWORD\n        jz      short .nextrow\n\n        movdqa  xmm2, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\n        movdqa    xmm3,xmm2\n        punpcklbw xmm2,xmm2\n        punpckhbw xmm3,xmm3\n\n        movdqa  XMMWORD [edi+2*SIZEOF_XMMWORD], xmm2\n        movdqa  XMMWORD [edi+3*SIZEOF_XMMWORD], xmm3\n\n        sub     eax, byte 2*SIZEOF_XMMWORD\n        jz      short .nextrow\n\n        add     esi, byte 2*SIZEOF_XMMWORD      ; inptr\n        add     edi, byte 4*SIZEOF_XMMWORD      ; outptr\n        jmp     short .columnloop\n        alignx  16,7\n\n.nextrow:\n        pop     esi\n        pop     edi\n\n        add     esi, byte SIZEOF_JSAMPROW       ; input_data\n        add     edi, byte SIZEOF_JSAMPROW       ; output_data\n        dec     ecx                             ; rowctr\n        jg      short .rowloop\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n;       pop     ebx             ; unused\n        pop     ebp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Fast processing for the common case of 2:1 horizontal and 2:1 vertical.\n; It's still a box filter.\n;\n; GLOBAL(void)\n; jsimd_h2v2_upsample_sse2 (nt max_v_samp_factor,\n;                           JDIMENSION output_width,\n;                           JSAMPARRAY input_data,\n;                           JSAMPARRAY *output_data_ptr);\n;\n\n%define max_v_samp(b)           (b)+8           ; int max_v_samp_factor\n%define output_width(b)         (b)+12          ; JDIMENSION output_width\n%define input_data(b)           (b)+16          ; JSAMPARRAY input_data\n%define output_data_ptr(b)      (b)+20          ; JSAMPARRAY *output_data_ptr\n\n        align   16\n        global  EXTN(jsimd_h2v2_upsample_sse2)\n\nEXTN(jsimd_h2v2_upsample_sse2):\n        push    ebp\n        mov     ebp,esp\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        mov     edx, JDIMENSION [output_width(ebp)]\n        add     edx, byte (2*SIZEOF_XMMWORD)-1\n        and     edx, byte -(2*SIZEOF_XMMWORD)\n        jz      near .return\n\n        mov     ecx, INT [max_v_samp(ebp)]      ; rowctr\n        test    ecx,ecx\n        jz      near .return\n\n        mov     esi, JSAMPARRAY [input_data(ebp)]       ; input_data\n        mov     edi, POINTER [output_data_ptr(ebp)]\n        mov     edi, JSAMPARRAY [edi]                   ; output_data\n        alignx  16,7\n.rowloop:\n        push    edi\n        push    esi\n\n        mov     esi, JSAMPROW [esi]                     ; inptr\n        mov     ebx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]   ; outptr0\n        mov     edi, JSAMPROW [edi+1*SIZEOF_JSAMPROW]   ; outptr1\n        mov     eax,edx                                 ; colctr\n        alignx  16,7\n.columnloop:\n\n        movdqa  xmm0, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\n        movdqa    xmm1,xmm0\n        punpcklbw xmm0,xmm0\n        punpckhbw xmm1,xmm1\n\n        movdqa  XMMWORD [ebx+0*SIZEOF_XMMWORD], xmm0\n        movdqa  XMMWORD [ebx+1*SIZEOF_XMMWORD], xmm1\n        movdqa  XMMWORD [edi+0*SIZEOF_XMMWORD], xmm0\n        movdqa  XMMWORD [edi+1*SIZEOF_XMMWORD], xmm1\n\n        sub     eax, byte 2*SIZEOF_XMMWORD\n        jz      short .nextrow\n\n        movdqa  xmm2, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\n        movdqa    xmm3,xmm2\n        punpcklbw xmm2,xmm2\n        punpckhbw xmm3,xmm3\n\n        movdqa  XMMWORD [ebx+2*SIZEOF_XMMWORD], xmm2\n        movdqa  XMMWORD [ebx+3*SIZEOF_XMMWORD], xmm3\n        movdqa  XMMWORD [edi+2*SIZEOF_XMMWORD], xmm2\n        movdqa  XMMWORD [edi+3*SIZEOF_XMMWORD], xmm3\n\n        sub     eax, byte 2*SIZEOF_XMMWORD\n        jz      short .nextrow\n\n        add     esi, byte 2*SIZEOF_XMMWORD      ; inptr\n        add     ebx, byte 4*SIZEOF_XMMWORD      ; outptr0\n        add     edi, byte 4*SIZEOF_XMMWORD      ; outptr1\n        jmp     short .columnloop\n        alignx  16,7\n\n.nextrow:\n        pop     esi\n        pop     edi\n\n        add     esi, byte 1*SIZEOF_JSAMPROW     ; input_data\n        add     edi, byte 2*SIZEOF_JSAMPROW     ; output_data\n        sub     ecx, byte 2                     ; rowctr\n        jg      short .rowloop\n\n.return:\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jfdctflt-3dn.asm",
    "content": ";\n; jfdctflt.asm - floating-point FDCT (3DNow!)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a floating-point implementation of the forward DCT\n; (Discrete Cosine Transform). The following code is based directly on\n; the IJG's original jfdctflt.c; see the jfdctflt.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_fdct_float_3dnow)\n\nEXTN(jconst_fdct_float_3dnow):\n\nPD_0_382        times 2 dd  0.382683432365089771728460\nPD_0_707        times 2 dd  0.707106781186547524400844\nPD_0_541        times 2 dd  0.541196100146196984399723\nPD_1_306        times 2 dd  1.306562964876376527856643\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_float_3dnow (FAST_FLOAT *data)\n;\n\n%define data(b)         (b)+8           ; FAST_FLOAT *data\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_MMWORD  ; mmword wk[WK_NUM]\n%define WK_NUM          2\n\n        align   16\n        global  EXTN(jsimd_fdct_float_3dnow)\n\nEXTN(jsimd_fdct_float_3dnow):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_MMWORD)      ; align to 64 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n;       push    esi             ; unused\n;       push    edi             ; unused\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process rows.\n\n        mov     edx, POINTER [data(eax)]        ; (FAST_FLOAT *)\n        mov     ecx, DCTSIZE/2\n        alignx  16,7\n.rowloop:\n\n        movq    mm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)]\n        movq    mm1, MMWORD [MMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)]\n        movq    mm2, MMWORD [MMBLOCK(0,3,edx,SIZEOF_FAST_FLOAT)]\n        movq    mm3, MMWORD [MMBLOCK(1,3,edx,SIZEOF_FAST_FLOAT)]\n\n        ; mm0=(00 01), mm1=(10 11), mm2=(06 07), mm3=(16 17)\n\n        movq      mm4,mm0               ; transpose coefficients\n        punpckldq mm0,mm1               ; mm0=(00 10)=data0\n        punpckhdq mm4,mm1               ; mm4=(01 11)=data1\n        movq      mm5,mm2               ; transpose coefficients\n        punpckldq mm2,mm3               ; mm2=(06 16)=data6\n        punpckhdq mm5,mm3               ; mm5=(07 17)=data7\n\n        movq    mm6,mm4\n        movq    mm7,mm0\n        pfsub   mm4,mm2                 ; mm4=data1-data6=tmp6\n        pfsub   mm0,mm5                 ; mm0=data0-data7=tmp7\n        pfadd   mm6,mm2                 ; mm6=data1+data6=tmp1\n        pfadd   mm7,mm5                 ; mm7=data0+data7=tmp0\n\n        movq    mm1, MMWORD [MMBLOCK(0,1,edx,SIZEOF_FAST_FLOAT)]\n        movq    mm3, MMWORD [MMBLOCK(1,1,edx,SIZEOF_FAST_FLOAT)]\n        movq    mm2, MMWORD [MMBLOCK(0,2,edx,SIZEOF_FAST_FLOAT)]\n        movq    mm5, MMWORD [MMBLOCK(1,2,edx,SIZEOF_FAST_FLOAT)]\n\n        ; mm1=(02 03), mm3=(12 13), mm2=(04 05), mm5=(14 15)\n\n        movq    MMWORD [wk(0)], mm4     ; wk(0)=tmp6\n        movq    MMWORD [wk(1)], mm0     ; wk(1)=tmp7\n\n        movq      mm4,mm1               ; transpose coefficients\n        punpckldq mm1,mm3               ; mm1=(02 12)=data2\n        punpckhdq mm4,mm3               ; mm4=(03 13)=data3\n        movq      mm0,mm2               ; transpose coefficients\n        punpckldq mm2,mm5               ; mm2=(04 14)=data4\n        punpckhdq mm0,mm5               ; mm0=(05 15)=data5\n\n        movq    mm3,mm4\n        movq    mm5,mm1\n        pfadd   mm4,mm2                 ; mm4=data3+data4=tmp3\n        pfadd   mm1,mm0                 ; mm1=data2+data5=tmp2\n        pfsub   mm3,mm2                 ; mm3=data3-data4=tmp4\n        pfsub   mm5,mm0                 ; mm5=data2-data5=tmp5\n\n        ; -- Even part\n\n        movq    mm2,mm7\n        movq    mm0,mm6\n        pfsub   mm7,mm4                 ; mm7=tmp13\n        pfsub   mm6,mm1                 ; mm6=tmp12\n        pfadd   mm2,mm4                 ; mm2=tmp10\n        pfadd   mm0,mm1                 ; mm0=tmp11\n\n        pfadd   mm6,mm7\n        pfmul   mm6,[GOTOFF(ebx,PD_0_707)] ; mm6=z1\n\n        movq    mm4,mm2\n        movq    mm1,mm7\n        pfsub   mm2,mm0                 ; mm2=data4\n        pfsub   mm7,mm6                 ; mm7=data6\n        pfadd   mm4,mm0                 ; mm4=data0\n        pfadd   mm1,mm6                 ; mm1=data2\n\n        movq    MMWORD [MMBLOCK(0,2,edx,SIZEOF_FAST_FLOAT)], mm2\n        movq    MMWORD [MMBLOCK(0,3,edx,SIZEOF_FAST_FLOAT)], mm7\n        movq    MMWORD [MMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)], mm4\n        movq    MMWORD [MMBLOCK(0,1,edx,SIZEOF_FAST_FLOAT)], mm1\n\n        ; -- Odd part\n\n        movq    mm0, MMWORD [wk(0)]     ; mm0=tmp6\n        movq    mm6, MMWORD [wk(1)]     ; mm6=tmp7\n\n        pfadd   mm3,mm5                 ; mm3=tmp10\n        pfadd   mm5,mm0                 ; mm5=tmp11\n        pfadd   mm0,mm6                 ; mm0=tmp12, mm6=tmp7\n\n        pfmul   mm5,[GOTOFF(ebx,PD_0_707)] ; mm5=z3\n\n        movq    mm2,mm3                 ; mm2=tmp10\n        pfsub   mm3,mm0\n        pfmul   mm3,[GOTOFF(ebx,PD_0_382)] ; mm3=z5\n        pfmul   mm2,[GOTOFF(ebx,PD_0_541)] ; mm2=MULTIPLY(tmp10,FIX_0_54119610)\n        pfmul   mm0,[GOTOFF(ebx,PD_1_306)] ; mm0=MULTIPLY(tmp12,FIX_1_30656296)\n        pfadd   mm2,mm3                 ; mm2=z2\n        pfadd   mm0,mm3                 ; mm0=z4\n\n        movq    mm7,mm6\n        pfsub   mm6,mm5                 ; mm6=z13\n        pfadd   mm7,mm5                 ; mm7=z11\n\n        movq    mm4,mm6\n        movq    mm1,mm7\n        pfsub   mm6,mm2                 ; mm6=data3\n        pfsub   mm7,mm0                 ; mm7=data7\n        pfadd   mm4,mm2                 ; mm4=data5\n        pfadd   mm1,mm0                 ; mm1=data1\n\n        movq    MMWORD [MMBLOCK(1,1,edx,SIZEOF_FAST_FLOAT)], mm6\n        movq    MMWORD [MMBLOCK(1,3,edx,SIZEOF_FAST_FLOAT)], mm7\n        movq    MMWORD [MMBLOCK(1,2,edx,SIZEOF_FAST_FLOAT)], mm4\n        movq    MMWORD [MMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)], mm1\n\n        add     edx, byte 2*DCTSIZE*SIZEOF_FAST_FLOAT\n        dec     ecx\n        jnz     near .rowloop\n\n        ; ---- Pass 2: process columns.\n\n        mov     edx, POINTER [data(eax)]        ; (FAST_FLOAT *)\n        mov     ecx, DCTSIZE/2\n        alignx  16,7\n.columnloop:\n\n        movq    mm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)]\n        movq    mm1, MMWORD [MMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)]\n        movq    mm2, MMWORD [MMBLOCK(6,0,edx,SIZEOF_FAST_FLOAT)]\n        movq    mm3, MMWORD [MMBLOCK(7,0,edx,SIZEOF_FAST_FLOAT)]\n\n        ; mm0=(00 10), mm1=(01 11), mm2=(60 70), mm3=(61 71)\n\n        movq      mm4,mm0               ; transpose coefficients\n        punpckldq mm0,mm1               ; mm0=(00 01)=data0\n        punpckhdq mm4,mm1               ; mm4=(10 11)=data1\n        movq      mm5,mm2               ; transpose coefficients\n        punpckldq mm2,mm3               ; mm2=(60 61)=data6\n        punpckhdq mm5,mm3               ; mm5=(70 71)=data7\n\n        movq    mm6,mm4\n        movq    mm7,mm0\n        pfsub   mm4,mm2                 ; mm4=data1-data6=tmp6\n        pfsub   mm0,mm5                 ; mm0=data0-data7=tmp7\n        pfadd   mm6,mm2                 ; mm6=data1+data6=tmp1\n        pfadd   mm7,mm5                 ; mm7=data0+data7=tmp0\n\n        movq    mm1, MMWORD [MMBLOCK(2,0,edx,SIZEOF_FAST_FLOAT)]\n        movq    mm3, MMWORD [MMBLOCK(3,0,edx,SIZEOF_FAST_FLOAT)]\n        movq    mm2, MMWORD [MMBLOCK(4,0,edx,SIZEOF_FAST_FLOAT)]\n        movq    mm5, MMWORD [MMBLOCK(5,0,edx,SIZEOF_FAST_FLOAT)]\n\n        ; mm1=(20 30), mm3=(21 31), mm2=(40 50), mm5=(41 51)\n\n        movq    MMWORD [wk(0)], mm4     ; wk(0)=tmp6\n        movq    MMWORD [wk(1)], mm0     ; wk(1)=tmp7\n\n        movq      mm4,mm1               ; transpose coefficients\n        punpckldq mm1,mm3               ; mm1=(20 21)=data2\n        punpckhdq mm4,mm3               ; mm4=(30 31)=data3\n        movq      mm0,mm2               ; transpose coefficients\n        punpckldq mm2,mm5               ; mm2=(40 41)=data4\n        punpckhdq mm0,mm5               ; mm0=(50 51)=data5\n\n        movq    mm3,mm4\n        movq    mm5,mm1\n        pfadd   mm4,mm2                 ; mm4=data3+data4=tmp3\n        pfadd   mm1,mm0                 ; mm1=data2+data5=tmp2\n        pfsub   mm3,mm2                 ; mm3=data3-data4=tmp4\n        pfsub   mm5,mm0                 ; mm5=data2-data5=tmp5\n\n        ; -- Even part\n\n        movq    mm2,mm7\n        movq    mm0,mm6\n        pfsub   mm7,mm4                 ; mm7=tmp13\n        pfsub   mm6,mm1                 ; mm6=tmp12\n        pfadd   mm2,mm4                 ; mm2=tmp10\n        pfadd   mm0,mm1                 ; mm0=tmp11\n\n        pfadd   mm6,mm7\n        pfmul   mm6,[GOTOFF(ebx,PD_0_707)] ; mm6=z1\n\n        movq    mm4,mm2\n        movq    mm1,mm7\n        pfsub   mm2,mm0                 ; mm2=data4\n        pfsub   mm7,mm6                 ; mm7=data6\n        pfadd   mm4,mm0                 ; mm4=data0\n        pfadd   mm1,mm6                 ; mm1=data2\n\n        movq    MMWORD [MMBLOCK(4,0,edx,SIZEOF_FAST_FLOAT)], mm2\n        movq    MMWORD [MMBLOCK(6,0,edx,SIZEOF_FAST_FLOAT)], mm7\n        movq    MMWORD [MMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)], mm4\n        movq    MMWORD [MMBLOCK(2,0,edx,SIZEOF_FAST_FLOAT)], mm1\n\n        ; -- Odd part\n\n        movq    mm0, MMWORD [wk(0)]     ; mm0=tmp6\n        movq    mm6, MMWORD [wk(1)]     ; mm6=tmp7\n\n        pfadd   mm3,mm5                 ; mm3=tmp10\n        pfadd   mm5,mm0                 ; mm5=tmp11\n        pfadd   mm0,mm6                 ; mm0=tmp12, mm6=tmp7\n\n        pfmul   mm5,[GOTOFF(ebx,PD_0_707)] ; mm5=z3\n\n        movq    mm2,mm3                 ; mm2=tmp10\n        pfsub   mm3,mm0\n        pfmul   mm3,[GOTOFF(ebx,PD_0_382)] ; mm3=z5\n        pfmul   mm2,[GOTOFF(ebx,PD_0_541)] ; mm2=MULTIPLY(tmp10,FIX_0_54119610)\n        pfmul   mm0,[GOTOFF(ebx,PD_1_306)] ; mm0=MULTIPLY(tmp12,FIX_1_30656296)\n        pfadd   mm2,mm3                 ; mm2=z2\n        pfadd   mm0,mm3                 ; mm0=z4\n\n        movq    mm7,mm6\n        pfsub   mm6,mm5                 ; mm6=z13\n        pfadd   mm7,mm5                 ; mm7=z11\n\n        movq    mm4,mm6\n        movq    mm1,mm7\n        pfsub   mm6,mm2                 ; mm6=data3\n        pfsub   mm7,mm0                 ; mm7=data7\n        pfadd   mm4,mm2                 ; mm4=data5\n        pfadd   mm1,mm0                 ; mm1=data1\n\n        movq    MMWORD [MMBLOCK(3,0,edx,SIZEOF_FAST_FLOAT)], mm6\n        movq    MMWORD [MMBLOCK(7,0,edx,SIZEOF_FAST_FLOAT)], mm7\n        movq    MMWORD [MMBLOCK(5,0,edx,SIZEOF_FAST_FLOAT)], mm4\n        movq    MMWORD [MMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)], mm1\n\n        add     edx, byte 2*SIZEOF_FAST_FLOAT\n        dec     ecx\n        jnz     near .columnloop\n\n        femms           ; empty MMX/3DNow! state\n\n;       pop     edi             ; unused\n;       pop     esi             ; unused\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        poppic  ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jfdctflt-sse-64.asm",
    "content": ";\n; jfdctflt.asm - floating-point FDCT (64-bit SSE)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a floating-point implementation of the forward DCT\n; (Discrete Cosine Transform). The following code is based directly on\n; the IJG's original jfdctflt.c; see the jfdctflt.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%macro  unpcklps2 2     ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(0 1 4 5)\n        shufps  %1,%2,0x44\n%endmacro\n\n%macro  unpckhps2 2     ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(2 3 6 7)\n        shufps  %1,%2,0xEE\n%endmacro\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_fdct_float_sse)\n\nEXTN(jconst_fdct_float_sse):\n\nPD_0_382        times 4 dd  0.382683432365089771728460\nPD_0_707        times 4 dd  0.707106781186547524400844\nPD_0_541        times 4 dd  0.541196100146196984399723\nPD_1_306        times 4 dd  1.306562964876376527856643\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_float_sse (FAST_FLOAT *data)\n;\n\n; r10 = FAST_FLOAT *data\n\n%define wk(i)           rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          2\n\n        align   16\n        global  EXTN(jsimd_fdct_float_sse)\n\nEXTN(jsimd_fdct_float_sse):\n        push    rbp\n        mov     rax,rsp                         ; rax = original rbp\n        sub     rsp, byte 4\n        and     rsp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [rsp],rax\n        mov     rbp,rsp                         ; rbp = aligned rbp\n        lea     rsp, [wk(0)]\n        collect_args\n\n        ; ---- Pass 1: process rows.\n\n        mov     rdx, r10        ; (FAST_FLOAT *)\n        mov     rcx, DCTSIZE/4\n.rowloop:\n\n        movaps  xmm0, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm2, XMMWORD [XMMBLOCK(2,1,rdx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(3,1,rdx,SIZEOF_FAST_FLOAT)]\n\n        ; xmm0=(20 21 22 23), xmm2=(24 25 26 27)\n        ; xmm1=(30 31 32 33), xmm3=(34 35 36 37)\n\n        movaps   xmm4,xmm0              ; transpose coefficients(phase 1)\n        unpcklps xmm0,xmm1              ; xmm0=(20 30 21 31)\n        unpckhps xmm4,xmm1              ; xmm4=(22 32 23 33)\n        movaps   xmm5,xmm2              ; transpose coefficients(phase 1)\n        unpcklps xmm2,xmm3              ; xmm2=(24 34 25 35)\n        unpckhps xmm5,xmm3              ; xmm5=(26 36 27 37)\n\n        movaps  xmm6, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm7, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(0,1,rdx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(1,1,rdx,SIZEOF_FAST_FLOAT)]\n\n        ; xmm6=(00 01 02 03), xmm1=(04 05 06 07)\n        ; xmm7=(10 11 12 13), xmm3=(14 15 16 17)\n\n        movaps  XMMWORD [wk(0)], xmm4   ; wk(0)=(22 32 23 33)\n        movaps  XMMWORD [wk(1)], xmm2   ; wk(1)=(24 34 25 35)\n\n        movaps   xmm4,xmm6              ; transpose coefficients(phase 1)\n        unpcklps xmm6,xmm7              ; xmm6=(00 10 01 11)\n        unpckhps xmm4,xmm7              ; xmm4=(02 12 03 13)\n        movaps   xmm2,xmm1              ; transpose coefficients(phase 1)\n        unpcklps xmm1,xmm3              ; xmm1=(04 14 05 15)\n        unpckhps xmm2,xmm3              ; xmm2=(06 16 07 17)\n\n        movaps    xmm7,xmm6             ; transpose coefficients(phase 2)\n        unpcklps2 xmm6,xmm0             ; xmm6=(00 10 20 30)=data0\n        unpckhps2 xmm7,xmm0             ; xmm7=(01 11 21 31)=data1\n        movaps    xmm3,xmm2             ; transpose coefficients(phase 2)\n        unpcklps2 xmm2,xmm5             ; xmm2=(06 16 26 36)=data6\n        unpckhps2 xmm3,xmm5             ; xmm3=(07 17 27 37)=data7\n\n        movaps  xmm0,xmm7\n        movaps  xmm5,xmm6\n        subps   xmm7,xmm2               ; xmm7=data1-data6=tmp6\n        subps   xmm6,xmm3               ; xmm6=data0-data7=tmp7\n        addps   xmm0,xmm2               ; xmm0=data1+data6=tmp1\n        addps   xmm5,xmm3               ; xmm5=data0+data7=tmp0\n\n        movaps  xmm2, XMMWORD [wk(0)]   ; xmm2=(22 32 23 33)\n        movaps  xmm3, XMMWORD [wk(1)]   ; xmm3=(24 34 25 35)\n        movaps  XMMWORD [wk(0)], xmm7   ; wk(0)=tmp6\n        movaps  XMMWORD [wk(1)], xmm6   ; wk(1)=tmp7\n\n        movaps    xmm7,xmm4             ; transpose coefficients(phase 2)\n        unpcklps2 xmm4,xmm2             ; xmm4=(02 12 22 32)=data2\n        unpckhps2 xmm7,xmm2             ; xmm7=(03 13 23 33)=data3\n        movaps    xmm6,xmm1             ; transpose coefficients(phase 2)\n        unpcklps2 xmm1,xmm3             ; xmm1=(04 14 24 34)=data4\n        unpckhps2 xmm6,xmm3             ; xmm6=(05 15 25 35)=data5\n\n        movaps  xmm2,xmm7\n        movaps  xmm3,xmm4\n        addps   xmm7,xmm1               ; xmm7=data3+data4=tmp3\n        addps   xmm4,xmm6               ; xmm4=data2+data5=tmp2\n        subps   xmm2,xmm1               ; xmm2=data3-data4=tmp4\n        subps   xmm3,xmm6               ; xmm3=data2-data5=tmp5\n\n        ; -- Even part\n\n        movaps  xmm1,xmm5\n        movaps  xmm6,xmm0\n        subps   xmm5,xmm7               ; xmm5=tmp13\n        subps   xmm0,xmm4               ; xmm0=tmp12\n        addps   xmm1,xmm7               ; xmm1=tmp10\n        addps   xmm6,xmm4               ; xmm6=tmp11\n\n        addps   xmm0,xmm5\n        mulps   xmm0,[rel PD_0_707] ; xmm0=z1\n\n        movaps  xmm7,xmm1\n        movaps  xmm4,xmm5\n        subps   xmm1,xmm6               ; xmm1=data4\n        subps   xmm5,xmm0               ; xmm5=data6\n        addps   xmm7,xmm6               ; xmm7=data0\n        addps   xmm4,xmm0               ; xmm4=data2\n\n        movaps  XMMWORD [XMMBLOCK(0,1,rdx,SIZEOF_FAST_FLOAT)], xmm1\n        movaps  XMMWORD [XMMBLOCK(2,1,rdx,SIZEOF_FAST_FLOAT)], xmm5\n        movaps  XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)], xmm7\n        movaps  XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)], xmm4\n\n        ; -- Odd part\n\n        movaps  xmm6, XMMWORD [wk(0)]   ; xmm6=tmp6\n        movaps  xmm0, XMMWORD [wk(1)]   ; xmm0=tmp7\n\n        addps   xmm2,xmm3               ; xmm2=tmp10\n        addps   xmm3,xmm6               ; xmm3=tmp11\n        addps   xmm6,xmm0               ; xmm6=tmp12, xmm0=tmp7\n\n        mulps   xmm3,[rel PD_0_707] ; xmm3=z3\n\n        movaps  xmm1,xmm2               ; xmm1=tmp10\n        subps   xmm2,xmm6\n        mulps   xmm2,[rel PD_0_382] ; xmm2=z5\n        mulps   xmm1,[rel PD_0_541] ; xmm1=MULTIPLY(tmp10,FIX_0_541196)\n        mulps   xmm6,[rel PD_1_306] ; xmm6=MULTIPLY(tmp12,FIX_1_306562)\n        addps   xmm1,xmm2               ; xmm1=z2\n        addps   xmm6,xmm2               ; xmm6=z4\n\n        movaps  xmm5,xmm0\n        subps   xmm0,xmm3               ; xmm0=z13\n        addps   xmm5,xmm3               ; xmm5=z11\n\n        movaps  xmm7,xmm0\n        movaps  xmm4,xmm5\n        subps   xmm0,xmm1               ; xmm0=data3\n        subps   xmm5,xmm6               ; xmm5=data7\n        addps   xmm7,xmm1               ; xmm7=data5\n        addps   xmm4,xmm6               ; xmm4=data1\n\n        movaps  XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)], xmm0\n        movaps  XMMWORD [XMMBLOCK(3,1,rdx,SIZEOF_FAST_FLOAT)], xmm5\n        movaps  XMMWORD [XMMBLOCK(1,1,rdx,SIZEOF_FAST_FLOAT)], xmm7\n        movaps  XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)], xmm4\n\n        add     rdx, 4*DCTSIZE*SIZEOF_FAST_FLOAT\n        dec     rcx\n        jnz     near .rowloop\n\n        ; ---- Pass 2: process columns.\n\n        mov     rdx, r10        ; (FAST_FLOAT *)\n        mov     rcx, DCTSIZE/4\n.columnloop:\n\n        movaps  xmm0, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm2, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_FAST_FLOAT)]\n\n        ; xmm0=(02 12 22 32), xmm2=(42 52 62 72)\n        ; xmm1=(03 13 23 33), xmm3=(43 53 63 73)\n\n        movaps   xmm4,xmm0              ; transpose coefficients(phase 1)\n        unpcklps xmm0,xmm1              ; xmm0=(02 03 12 13)\n        unpckhps xmm4,xmm1              ; xmm4=(22 23 32 33)\n        movaps   xmm5,xmm2              ; transpose coefficients(phase 1)\n        unpcklps xmm2,xmm3              ; xmm2=(42 43 52 53)\n        unpckhps xmm5,xmm3              ; xmm5=(62 63 72 73)\n\n        movaps  xmm6, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm7, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_FAST_FLOAT)]\n\n        ; xmm6=(00 10 20 30), xmm1=(40 50 60 70)\n        ; xmm7=(01 11 21 31), xmm3=(41 51 61 71)\n\n        movaps  XMMWORD [wk(0)], xmm4   ; wk(0)=(22 23 32 33)\n        movaps  XMMWORD [wk(1)], xmm2   ; wk(1)=(42 43 52 53)\n\n        movaps   xmm4,xmm6              ; transpose coefficients(phase 1)\n        unpcklps xmm6,xmm7              ; xmm6=(00 01 10 11)\n        unpckhps xmm4,xmm7              ; xmm4=(20 21 30 31)\n        movaps   xmm2,xmm1              ; transpose coefficients(phase 1)\n        unpcklps xmm1,xmm3              ; xmm1=(40 41 50 51)\n        unpckhps xmm2,xmm3              ; xmm2=(60 61 70 71)\n\n        movaps    xmm7,xmm6             ; transpose coefficients(phase 2)\n        unpcklps2 xmm6,xmm0             ; xmm6=(00 01 02 03)=data0\n        unpckhps2 xmm7,xmm0             ; xmm7=(10 11 12 13)=data1\n        movaps    xmm3,xmm2             ; transpose coefficients(phase 2)\n        unpcklps2 xmm2,xmm5             ; xmm2=(60 61 62 63)=data6\n        unpckhps2 xmm3,xmm5             ; xmm3=(70 71 72 73)=data7\n\n        movaps  xmm0,xmm7\n        movaps  xmm5,xmm6\n        subps   xmm7,xmm2               ; xmm7=data1-data6=tmp6\n        subps   xmm6,xmm3               ; xmm6=data0-data7=tmp7\n        addps   xmm0,xmm2               ; xmm0=data1+data6=tmp1\n        addps   xmm5,xmm3               ; xmm5=data0+data7=tmp0\n\n        movaps  xmm2, XMMWORD [wk(0)]   ; xmm2=(22 23 32 33)\n        movaps  xmm3, XMMWORD [wk(1)]   ; xmm3=(42 43 52 53)\n        movaps  XMMWORD [wk(0)], xmm7   ; wk(0)=tmp6\n        movaps  XMMWORD [wk(1)], xmm6   ; wk(1)=tmp7\n\n        movaps    xmm7,xmm4             ; transpose coefficients(phase 2)\n        unpcklps2 xmm4,xmm2             ; xmm4=(20 21 22 23)=data2\n        unpckhps2 xmm7,xmm2             ; xmm7=(30 31 32 33)=data3\n        movaps    xmm6,xmm1             ; transpose coefficients(phase 2)\n        unpcklps2 xmm1,xmm3             ; xmm1=(40 41 42 43)=data4\n        unpckhps2 xmm6,xmm3             ; xmm6=(50 51 52 53)=data5\n\n        movaps  xmm2,xmm7\n        movaps  xmm3,xmm4\n        addps   xmm7,xmm1               ; xmm7=data3+data4=tmp3\n        addps   xmm4,xmm6               ; xmm4=data2+data5=tmp2\n        subps   xmm2,xmm1               ; xmm2=data3-data4=tmp4\n        subps   xmm3,xmm6               ; xmm3=data2-data5=tmp5\n\n        ; -- Even part\n\n        movaps  xmm1,xmm5\n        movaps  xmm6,xmm0\n        subps   xmm5,xmm7               ; xmm5=tmp13\n        subps   xmm0,xmm4               ; xmm0=tmp12\n        addps   xmm1,xmm7               ; xmm1=tmp10\n        addps   xmm6,xmm4               ; xmm6=tmp11\n\n        addps   xmm0,xmm5\n        mulps   xmm0,[rel PD_0_707] ; xmm0=z1\n\n        movaps  xmm7,xmm1\n        movaps  xmm4,xmm5\n        subps   xmm1,xmm6               ; xmm1=data4\n        subps   xmm5,xmm0               ; xmm5=data6\n        addps   xmm7,xmm6               ; xmm7=data0\n        addps   xmm4,xmm0               ; xmm4=data2\n\n        movaps  XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_FAST_FLOAT)], xmm1\n        movaps  XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_FAST_FLOAT)], xmm5\n        movaps  XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)], xmm7\n        movaps  XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)], xmm4\n\n        ; -- Odd part\n\n        movaps  xmm6, XMMWORD [wk(0)]   ; xmm6=tmp6\n        movaps  xmm0, XMMWORD [wk(1)]   ; xmm0=tmp7\n\n        addps   xmm2,xmm3               ; xmm2=tmp10\n        addps   xmm3,xmm6               ; xmm3=tmp11\n        addps   xmm6,xmm0               ; xmm6=tmp12, xmm0=tmp7\n\n        mulps   xmm3,[rel PD_0_707] ; xmm3=z3\n\n        movaps  xmm1,xmm2               ; xmm1=tmp10\n        subps   xmm2,xmm6\n        mulps   xmm2,[rel PD_0_382] ; xmm2=z5\n        mulps   xmm1,[rel PD_0_541] ; xmm1=MULTIPLY(tmp10,FIX_0_541196)\n        mulps   xmm6,[rel PD_1_306] ; xmm6=MULTIPLY(tmp12,FIX_1_306562)\n        addps   xmm1,xmm2               ; xmm1=z2\n        addps   xmm6,xmm2               ; xmm6=z4\n\n        movaps  xmm5,xmm0\n        subps   xmm0,xmm3               ; xmm0=z13\n        addps   xmm5,xmm3               ; xmm5=z11\n\n        movaps  xmm7,xmm0\n        movaps  xmm4,xmm5\n        subps   xmm0,xmm1               ; xmm0=data3\n        subps   xmm5,xmm6               ; xmm5=data7\n        addps   xmm7,xmm1               ; xmm7=data5\n        addps   xmm4,xmm6               ; xmm4=data1\n\n        movaps  XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)], xmm0\n        movaps  XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_FAST_FLOAT)], xmm5\n        movaps  XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_FAST_FLOAT)], xmm7\n        movaps  XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)], xmm4\n\n        add     rdx, byte 4*SIZEOF_FAST_FLOAT\n        dec     rcx\n        jnz     near .columnloop\n\n        uncollect_args\n        mov     rsp,rbp         ; rsp <- aligned rbp\n        pop     rsp             ; rsp <- original rbp\n        pop     rbp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jfdctflt-sse.asm",
    "content": ";\n; jfdctflt.asm - floating-point FDCT (SSE)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a floating-point implementation of the forward DCT\n; (Discrete Cosine Transform). The following code is based directly on\n; the IJG's original jfdctflt.c; see the jfdctflt.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%macro  unpcklps2 2     ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(0 1 4 5)\n        shufps  %1,%2,0x44\n%endmacro\n\n%macro  unpckhps2 2     ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(2 3 6 7)\n        shufps  %1,%2,0xEE\n%endmacro\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_fdct_float_sse)\n\nEXTN(jconst_fdct_float_sse):\n\nPD_0_382        times 4 dd  0.382683432365089771728460\nPD_0_707        times 4 dd  0.707106781186547524400844\nPD_0_541        times 4 dd  0.541196100146196984399723\nPD_1_306        times 4 dd  1.306562964876376527856643\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_float_sse (FAST_FLOAT *data)\n;\n\n%define data(b)         (b)+8           ; FAST_FLOAT *data\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          2\n\n        align   16\n        global  EXTN(jsimd_fdct_float_sse)\n\nEXTN(jsimd_fdct_float_sse):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n;       push    esi             ; unused\n;       push    edi             ; unused\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process rows.\n\n        mov     edx, POINTER [data(eax)]        ; (FAST_FLOAT *)\n        mov     ecx, DCTSIZE/4\n        alignx  16,7\n.rowloop:\n\n        movaps  xmm0, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm2, XMMWORD [XMMBLOCK(2,1,edx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(3,1,edx,SIZEOF_FAST_FLOAT)]\n\n        ; xmm0=(20 21 22 23), xmm2=(24 25 26 27)\n        ; xmm1=(30 31 32 33), xmm3=(34 35 36 37)\n\n        movaps   xmm4,xmm0              ; transpose coefficients(phase 1)\n        unpcklps xmm0,xmm1              ; xmm0=(20 30 21 31)\n        unpckhps xmm4,xmm1              ; xmm4=(22 32 23 33)\n        movaps   xmm5,xmm2              ; transpose coefficients(phase 1)\n        unpcklps xmm2,xmm3              ; xmm2=(24 34 25 35)\n        unpckhps xmm5,xmm3              ; xmm5=(26 36 27 37)\n\n        movaps  xmm6, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm7, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(0,1,edx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(1,1,edx,SIZEOF_FAST_FLOAT)]\n\n        ; xmm6=(00 01 02 03), xmm1=(04 05 06 07)\n        ; xmm7=(10 11 12 13), xmm3=(14 15 16 17)\n\n        movaps  XMMWORD [wk(0)], xmm4   ; wk(0)=(22 32 23 33)\n        movaps  XMMWORD [wk(1)], xmm2   ; wk(1)=(24 34 25 35)\n\n        movaps   xmm4,xmm6              ; transpose coefficients(phase 1)\n        unpcklps xmm6,xmm7              ; xmm6=(00 10 01 11)\n        unpckhps xmm4,xmm7              ; xmm4=(02 12 03 13)\n        movaps   xmm2,xmm1              ; transpose coefficients(phase 1)\n        unpcklps xmm1,xmm3              ; xmm1=(04 14 05 15)\n        unpckhps xmm2,xmm3              ; xmm2=(06 16 07 17)\n\n        movaps    xmm7,xmm6             ; transpose coefficients(phase 2)\n        unpcklps2 xmm6,xmm0             ; xmm6=(00 10 20 30)=data0\n        unpckhps2 xmm7,xmm0             ; xmm7=(01 11 21 31)=data1\n        movaps    xmm3,xmm2             ; transpose coefficients(phase 2)\n        unpcklps2 xmm2,xmm5             ; xmm2=(06 16 26 36)=data6\n        unpckhps2 xmm3,xmm5             ; xmm3=(07 17 27 37)=data7\n\n        movaps  xmm0,xmm7\n        movaps  xmm5,xmm6\n        subps   xmm7,xmm2               ; xmm7=data1-data6=tmp6\n        subps   xmm6,xmm3               ; xmm6=data0-data7=tmp7\n        addps   xmm0,xmm2               ; xmm0=data1+data6=tmp1\n        addps   xmm5,xmm3               ; xmm5=data0+data7=tmp0\n\n        movaps  xmm2, XMMWORD [wk(0)]   ; xmm2=(22 32 23 33)\n        movaps  xmm3, XMMWORD [wk(1)]   ; xmm3=(24 34 25 35)\n        movaps  XMMWORD [wk(0)], xmm7   ; wk(0)=tmp6\n        movaps  XMMWORD [wk(1)], xmm6   ; wk(1)=tmp7\n\n        movaps    xmm7,xmm4             ; transpose coefficients(phase 2)\n        unpcklps2 xmm4,xmm2             ; xmm4=(02 12 22 32)=data2\n        unpckhps2 xmm7,xmm2             ; xmm7=(03 13 23 33)=data3\n        movaps    xmm6,xmm1             ; transpose coefficients(phase 2)\n        unpcklps2 xmm1,xmm3             ; xmm1=(04 14 24 34)=data4\n        unpckhps2 xmm6,xmm3             ; xmm6=(05 15 25 35)=data5\n\n        movaps  xmm2,xmm7\n        movaps  xmm3,xmm4\n        addps   xmm7,xmm1               ; xmm7=data3+data4=tmp3\n        addps   xmm4,xmm6               ; xmm4=data2+data5=tmp2\n        subps   xmm2,xmm1               ; xmm2=data3-data4=tmp4\n        subps   xmm3,xmm6               ; xmm3=data2-data5=tmp5\n\n        ; -- Even part\n\n        movaps  xmm1,xmm5\n        movaps  xmm6,xmm0\n        subps   xmm5,xmm7               ; xmm5=tmp13\n        subps   xmm0,xmm4               ; xmm0=tmp12\n        addps   xmm1,xmm7               ; xmm1=tmp10\n        addps   xmm6,xmm4               ; xmm6=tmp11\n\n        addps   xmm0,xmm5\n        mulps   xmm0,[GOTOFF(ebx,PD_0_707)] ; xmm0=z1\n\n        movaps  xmm7,xmm1\n        movaps  xmm4,xmm5\n        subps   xmm1,xmm6               ; xmm1=data4\n        subps   xmm5,xmm0               ; xmm5=data6\n        addps   xmm7,xmm6               ; xmm7=data0\n        addps   xmm4,xmm0               ; xmm4=data2\n\n        movaps  XMMWORD [XMMBLOCK(0,1,edx,SIZEOF_FAST_FLOAT)], xmm1\n        movaps  XMMWORD [XMMBLOCK(2,1,edx,SIZEOF_FAST_FLOAT)], xmm5\n        movaps  XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)], xmm7\n        movaps  XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_FAST_FLOAT)], xmm4\n\n        ; -- Odd part\n\n        movaps  xmm6, XMMWORD [wk(0)]   ; xmm6=tmp6\n        movaps  xmm0, XMMWORD [wk(1)]   ; xmm0=tmp7\n\n        addps   xmm2,xmm3               ; xmm2=tmp10\n        addps   xmm3,xmm6               ; xmm3=tmp11\n        addps   xmm6,xmm0               ; xmm6=tmp12, xmm0=tmp7\n\n        mulps   xmm3,[GOTOFF(ebx,PD_0_707)] ; xmm3=z3\n\n        movaps  xmm1,xmm2               ; xmm1=tmp10\n        subps   xmm2,xmm6\n        mulps   xmm2,[GOTOFF(ebx,PD_0_382)] ; xmm2=z5\n        mulps   xmm1,[GOTOFF(ebx,PD_0_541)] ; xmm1=MULTIPLY(tmp10,FIX_0_541196)\n        mulps   xmm6,[GOTOFF(ebx,PD_1_306)] ; xmm6=MULTIPLY(tmp12,FIX_1_306562)\n        addps   xmm1,xmm2               ; xmm1=z2\n        addps   xmm6,xmm2               ; xmm6=z4\n\n        movaps  xmm5,xmm0\n        subps   xmm0,xmm3               ; xmm0=z13\n        addps   xmm5,xmm3               ; xmm5=z11\n\n        movaps  xmm7,xmm0\n        movaps  xmm4,xmm5\n        subps   xmm0,xmm1               ; xmm0=data3\n        subps   xmm5,xmm6               ; xmm5=data7\n        addps   xmm7,xmm1               ; xmm7=data5\n        addps   xmm4,xmm6               ; xmm4=data1\n\n        movaps  XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_FAST_FLOAT)], xmm0\n        movaps  XMMWORD [XMMBLOCK(3,1,edx,SIZEOF_FAST_FLOAT)], xmm5\n        movaps  XMMWORD [XMMBLOCK(1,1,edx,SIZEOF_FAST_FLOAT)], xmm7\n        movaps  XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)], xmm4\n\n        add     edx, 4*DCTSIZE*SIZEOF_FAST_FLOAT\n        dec     ecx\n        jnz     near .rowloop\n\n        ; ---- Pass 2: process columns.\n\n        mov     edx, POINTER [data(eax)]        ; (FAST_FLOAT *)\n        mov     ecx, DCTSIZE/4\n        alignx  16,7\n.columnloop:\n\n        movaps  xmm0, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm2, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_FAST_FLOAT)]\n\n        ; xmm0=(02 12 22 32), xmm2=(42 52 62 72)\n        ; xmm1=(03 13 23 33), xmm3=(43 53 63 73)\n\n        movaps   xmm4,xmm0              ; transpose coefficients(phase 1)\n        unpcklps xmm0,xmm1              ; xmm0=(02 03 12 13)\n        unpckhps xmm4,xmm1              ; xmm4=(22 23 32 33)\n        movaps   xmm5,xmm2              ; transpose coefficients(phase 1)\n        unpcklps xmm2,xmm3              ; xmm2=(42 43 52 53)\n        unpckhps xmm5,xmm3              ; xmm5=(62 63 72 73)\n\n        movaps  xmm6, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm7, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_FAST_FLOAT)]\n\n        ; xmm6=(00 10 20 30), xmm1=(40 50 60 70)\n        ; xmm7=(01 11 21 31), xmm3=(41 51 61 71)\n\n        movaps  XMMWORD [wk(0)], xmm4   ; wk(0)=(22 23 32 33)\n        movaps  XMMWORD [wk(1)], xmm2   ; wk(1)=(42 43 52 53)\n\n        movaps   xmm4,xmm6              ; transpose coefficients(phase 1)\n        unpcklps xmm6,xmm7              ; xmm6=(00 01 10 11)\n        unpckhps xmm4,xmm7              ; xmm4=(20 21 30 31)\n        movaps   xmm2,xmm1              ; transpose coefficients(phase 1)\n        unpcklps xmm1,xmm3              ; xmm1=(40 41 50 51)\n        unpckhps xmm2,xmm3              ; xmm2=(60 61 70 71)\n\n        movaps    xmm7,xmm6             ; transpose coefficients(phase 2)\n        unpcklps2 xmm6,xmm0             ; xmm6=(00 01 02 03)=data0\n        unpckhps2 xmm7,xmm0             ; xmm7=(10 11 12 13)=data1\n        movaps    xmm3,xmm2             ; transpose coefficients(phase 2)\n        unpcklps2 xmm2,xmm5             ; xmm2=(60 61 62 63)=data6\n        unpckhps2 xmm3,xmm5             ; xmm3=(70 71 72 73)=data7\n\n        movaps  xmm0,xmm7\n        movaps  xmm5,xmm6\n        subps   xmm7,xmm2               ; xmm7=data1-data6=tmp6\n        subps   xmm6,xmm3               ; xmm6=data0-data7=tmp7\n        addps   xmm0,xmm2               ; xmm0=data1+data6=tmp1\n        addps   xmm5,xmm3               ; xmm5=data0+data7=tmp0\n\n        movaps  xmm2, XMMWORD [wk(0)]   ; xmm2=(22 23 32 33)\n        movaps  xmm3, XMMWORD [wk(1)]   ; xmm3=(42 43 52 53)\n        movaps  XMMWORD [wk(0)], xmm7   ; wk(0)=tmp6\n        movaps  XMMWORD [wk(1)], xmm6   ; wk(1)=tmp7\n\n        movaps    xmm7,xmm4             ; transpose coefficients(phase 2)\n        unpcklps2 xmm4,xmm2             ; xmm4=(20 21 22 23)=data2\n        unpckhps2 xmm7,xmm2             ; xmm7=(30 31 32 33)=data3\n        movaps    xmm6,xmm1             ; transpose coefficients(phase 2)\n        unpcklps2 xmm1,xmm3             ; xmm1=(40 41 42 43)=data4\n        unpckhps2 xmm6,xmm3             ; xmm6=(50 51 52 53)=data5\n\n        movaps  xmm2,xmm7\n        movaps  xmm3,xmm4\n        addps   xmm7,xmm1               ; xmm7=data3+data4=tmp3\n        addps   xmm4,xmm6               ; xmm4=data2+data5=tmp2\n        subps   xmm2,xmm1               ; xmm2=data3-data4=tmp4\n        subps   xmm3,xmm6               ; xmm3=data2-data5=tmp5\n\n        ; -- Even part\n\n        movaps  xmm1,xmm5\n        movaps  xmm6,xmm0\n        subps   xmm5,xmm7               ; xmm5=tmp13\n        subps   xmm0,xmm4               ; xmm0=tmp12\n        addps   xmm1,xmm7               ; xmm1=tmp10\n        addps   xmm6,xmm4               ; xmm6=tmp11\n\n        addps   xmm0,xmm5\n        mulps   xmm0,[GOTOFF(ebx,PD_0_707)] ; xmm0=z1\n\n        movaps  xmm7,xmm1\n        movaps  xmm4,xmm5\n        subps   xmm1,xmm6               ; xmm1=data4\n        subps   xmm5,xmm0               ; xmm5=data6\n        addps   xmm7,xmm6               ; xmm7=data0\n        addps   xmm4,xmm0               ; xmm4=data2\n\n        movaps  XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_FAST_FLOAT)], xmm1\n        movaps  XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_FAST_FLOAT)], xmm5\n        movaps  XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)], xmm7\n        movaps  XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_FAST_FLOAT)], xmm4\n\n        ; -- Odd part\n\n        movaps  xmm6, XMMWORD [wk(0)]   ; xmm6=tmp6\n        movaps  xmm0, XMMWORD [wk(1)]   ; xmm0=tmp7\n\n        addps   xmm2,xmm3               ; xmm2=tmp10\n        addps   xmm3,xmm6               ; xmm3=tmp11\n        addps   xmm6,xmm0               ; xmm6=tmp12, xmm0=tmp7\n\n        mulps   xmm3,[GOTOFF(ebx,PD_0_707)] ; xmm3=z3\n\n        movaps  xmm1,xmm2               ; xmm1=tmp10\n        subps   xmm2,xmm6\n        mulps   xmm2,[GOTOFF(ebx,PD_0_382)] ; xmm2=z5\n        mulps   xmm1,[GOTOFF(ebx,PD_0_541)] ; xmm1=MULTIPLY(tmp10,FIX_0_541196)\n        mulps   xmm6,[GOTOFF(ebx,PD_1_306)] ; xmm6=MULTIPLY(tmp12,FIX_1_306562)\n        addps   xmm1,xmm2               ; xmm1=z2\n        addps   xmm6,xmm2               ; xmm6=z4\n\n        movaps  xmm5,xmm0\n        subps   xmm0,xmm3               ; xmm0=z13\n        addps   xmm5,xmm3               ; xmm5=z11\n\n        movaps  xmm7,xmm0\n        movaps  xmm4,xmm5\n        subps   xmm0,xmm1               ; xmm0=data3\n        subps   xmm5,xmm6               ; xmm5=data7\n        addps   xmm7,xmm1               ; xmm7=data5\n        addps   xmm4,xmm6               ; xmm4=data1\n\n        movaps  XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_FAST_FLOAT)], xmm0\n        movaps  XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_FAST_FLOAT)], xmm5\n        movaps  XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_FAST_FLOAT)], xmm7\n        movaps  XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)], xmm4\n\n        add     edx, byte 4*SIZEOF_FAST_FLOAT\n        dec     ecx\n        jnz     near .columnloop\n\n;       pop     edi             ; unused\n;       pop     esi             ; unused\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        poppic  ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jfdctfst-altivec.c",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2014, D. R. Commander.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n/* FAST INTEGER FORWARD DCT\n *\n * This is similar to the SSE2 implementation, except that we left-shift the\n * constants by 1 less bit (the -1 in CONST_SHIFT.)  This is because\n * vec_madds(arg1, arg2, arg3) generates the 16-bit saturated sum of:\n *   the elements in arg3 + the most significant 17 bits of\n *     (the elements in arg1 * the elements in arg2).\n */\n\n#include \"jsimd_altivec.h\"\n\n\n#define F_0_382 98   /* FIX(0.382683433) */\n#define F_0_541 139  /* FIX(0.541196100) */\n#define F_0_707 181  /* FIX(0.707106781) */\n#define F_1_306 334  /* FIX(1.306562965) */\n\n#define CONST_BITS 8\n#define PRE_MULTIPLY_SCALE_BITS 2\n#define CONST_SHIFT (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS - 1)\n\n\n#define DO_FDCT()  \\\n{  \\\n  /* Even part */  \\\n  \\\n  tmp10 = vec_add(tmp0, tmp3);  \\\n  tmp13 = vec_sub(tmp0, tmp3);  \\\n  tmp11 = vec_add(tmp1, tmp2);  \\\n  tmp12 = vec_sub(tmp1, tmp2);  \\\n  \\\n  out0  = vec_add(tmp10, tmp11);  \\\n  out4  = vec_sub(tmp10, tmp11);  \\\n  \\\n  z1 = vec_add(tmp12, tmp13);  \\\n  z1 = vec_sl(z1, pre_multiply_scale_bits);  \\\n  z1 = vec_madds(z1, pw_0707, pw_zero);  \\\n  \\\n  out2 = vec_add(tmp13, z1);  \\\n  out6 = vec_sub(tmp13, z1);  \\\n  \\\n  /* Odd part */  \\\n  \\\n  tmp10 = vec_add(tmp4, tmp5);  \\\n  tmp11 = vec_add(tmp5, tmp6);  \\\n  tmp12 = vec_add(tmp6, tmp7);  \\\n  \\\n  tmp10 = vec_sl(tmp10, pre_multiply_scale_bits);  \\\n  tmp12 = vec_sl(tmp12, pre_multiply_scale_bits);  \\\n  z5 = vec_sub(tmp10, tmp12);  \\\n  z5 = vec_madds(z5, pw_0382, pw_zero);  \\\n  \\\n  z2 = vec_madds(tmp10, pw_0541, z5);  \\\n  z4 = vec_madds(tmp12, pw_1306, z5);  \\\n  \\\n  tmp11 = vec_sl(tmp11, pre_multiply_scale_bits);  \\\n  z3 = vec_madds(tmp11, pw_0707, pw_zero);  \\\n  \\\n  z11 = vec_add(tmp7, z3);  \\\n  z13 = vec_sub(tmp7, z3);  \\\n  \\\n  out5 = vec_add(z13, z2);  \\\n  out3 = vec_sub(z13, z2);  \\\n  out1 = vec_add(z11, z4);  \\\n  out7 = vec_sub(z11, z4);  \\\n}\n\n\nvoid\njsimd_fdct_ifast_altivec (DCTELEM *data)\n{\n  __vector short row0, row1, row2, row3, row4, row5, row6, row7,\n    col0, col1, col2, col3, col4, col5, col6, col7,\n    tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13,\n    z1, z2, z3, z4, z5, z11, z13,\n    out0, out1, out2, out3, out4, out5, out6, out7;\n\n  /* Constants */\n  __vector short pw_zero = { __8X(0) },\n    pw_0382 = { __8X(F_0_382 << CONST_SHIFT) },\n    pw_0541 = { __8X(F_0_541 << CONST_SHIFT) },\n    pw_0707 = { __8X(F_0_707 << CONST_SHIFT) },\n    pw_1306 = { __8X(F_1_306 << CONST_SHIFT) };\n  __vector unsigned short\n    pre_multiply_scale_bits = { __8X(PRE_MULTIPLY_SCALE_BITS) };\n\n  /* Pass 1: process rows */\n\n  row0 = vec_ld(0, data);\n  row1 = vec_ld(16, data);\n  row2 = vec_ld(32, data);\n  row3 = vec_ld(48, data);\n  row4 = vec_ld(64, data);\n  row5 = vec_ld(80, data);\n  row6 = vec_ld(96, data);\n  row7 = vec_ld(112, data);\n\n  TRANSPOSE(row, col);\n\n  tmp0 = vec_add(col0, col7);\n  tmp7 = vec_sub(col0, col7);\n  tmp1 = vec_add(col1, col6);\n  tmp6 = vec_sub(col1, col6);\n  tmp2 = vec_add(col2, col5);\n  tmp5 = vec_sub(col2, col5);\n  tmp3 = vec_add(col3, col4);\n  tmp4 = vec_sub(col3, col4);\n\n  DO_FDCT();\n\n  /* Pass 2: process columns */\n\n  TRANSPOSE(out, row);\n\n  tmp0 = vec_add(row0, row7);\n  tmp7 = vec_sub(row0, row7);\n  tmp1 = vec_add(row1, row6);\n  tmp6 = vec_sub(row1, row6);\n  tmp2 = vec_add(row2, row5);\n  tmp5 = vec_sub(row2, row5);\n  tmp3 = vec_add(row3, row4);\n  tmp4 = vec_sub(row3, row4);\n\n  DO_FDCT();\n\n  vec_st(out0, 0, data);\n  vec_st(out1, 16, data);\n  vec_st(out2, 32, data);\n  vec_st(out3, 48, data);\n  vec_st(out4, 64, data);\n  vec_st(out5, 80, data);\n  vec_st(out6, 96, data);\n  vec_st(out7, 112, data);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jfdctfst-mmx.asm",
    "content": ";\n; jfdctfst.asm - fast integer FDCT (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a fast, not so accurate integer implementation of\n; the forward DCT (Discrete Cosine Transform). The following code is\n; based directly on the IJG's original jfdctfst.c; see the jfdctfst.c\n; for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS      8       ; 14 is also OK.\n\n%if CONST_BITS == 8\nF_0_382 equ      98             ; FIX(0.382683433)\nF_0_541 equ     139             ; FIX(0.541196100)\nF_0_707 equ     181             ; FIX(0.707106781)\nF_1_306 equ     334             ; FIX(1.306562965)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_382 equ     DESCALE( 410903207,30-CONST_BITS)       ; FIX(0.382683433)\nF_0_541 equ     DESCALE( 581104887,30-CONST_BITS)       ; FIX(0.541196100)\nF_0_707 equ     DESCALE( 759250124,30-CONST_BITS)       ; FIX(0.707106781)\nF_1_306 equ     DESCALE(1402911301,30-CONST_BITS)       ; FIX(1.306562965)\n%endif\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n; PRE_MULTIPLY_SCALE_BITS <= 2 (to avoid overflow)\n; CONST_BITS + CONST_SHIFT + PRE_MULTIPLY_SCALE_BITS == 16 (for pmulhw)\n\n%define PRE_MULTIPLY_SCALE_BITS   2\n%define CONST_SHIFT     (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS)\n\n        alignz  16\n        global  EXTN(jconst_fdct_ifast_mmx)\n\nEXTN(jconst_fdct_ifast_mmx):\n\nPW_F0707        times 4 dw  F_0_707 << CONST_SHIFT\nPW_F0382        times 4 dw  F_0_382 << CONST_SHIFT\nPW_F0541        times 4 dw  F_0_541 << CONST_SHIFT\nPW_F1306        times 4 dw  F_1_306 << CONST_SHIFT\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_ifast_mmx (DCTELEM *data)\n;\n\n%define data(b)         (b)+8           ; DCTELEM *data\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_MMWORD  ; mmword wk[WK_NUM]\n%define WK_NUM          2\n\n        align   16\n        global  EXTN(jsimd_fdct_ifast_mmx)\n\nEXTN(jsimd_fdct_ifast_mmx):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_MMWORD)      ; align to 64 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n;       push    esi             ; unused\n;       push    edi             ; unused\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process rows.\n\n        mov     edx, POINTER [data(eax)]        ; (DCTELEM *)\n        mov     ecx, DCTSIZE/4\n        alignx  16,7\n.rowloop:\n\n        movq    mm0, MMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)]\n        movq    mm1, MMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)]\n        movq    mm2, MMWORD [MMBLOCK(2,1,edx,SIZEOF_DCTELEM)]\n        movq    mm3, MMWORD [MMBLOCK(3,1,edx,SIZEOF_DCTELEM)]\n\n        ; mm0=(20 21 22 23), mm2=(24 25 26 27)\n        ; mm1=(30 31 32 33), mm3=(34 35 36 37)\n\n        movq      mm4,mm0               ; transpose coefficients(phase 1)\n        punpcklwd mm0,mm1               ; mm0=(20 30 21 31)\n        punpckhwd mm4,mm1               ; mm4=(22 32 23 33)\n        movq      mm5,mm2               ; transpose coefficients(phase 1)\n        punpcklwd mm2,mm3               ; mm2=(24 34 25 35)\n        punpckhwd mm5,mm3               ; mm5=(26 36 27 37)\n\n        movq    mm6, MMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)]\n        movq    mm7, MMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)]\n        movq    mm1, MMWORD [MMBLOCK(0,1,edx,SIZEOF_DCTELEM)]\n        movq    mm3, MMWORD [MMBLOCK(1,1,edx,SIZEOF_DCTELEM)]\n\n        ; mm6=(00 01 02 03), mm1=(04 05 06 07)\n        ; mm7=(10 11 12 13), mm3=(14 15 16 17)\n\n        movq    MMWORD [wk(0)], mm4     ; wk(0)=(22 32 23 33)\n        movq    MMWORD [wk(1)], mm2     ; wk(1)=(24 34 25 35)\n\n        movq      mm4,mm6               ; transpose coefficients(phase 1)\n        punpcklwd mm6,mm7               ; mm6=(00 10 01 11)\n        punpckhwd mm4,mm7               ; mm4=(02 12 03 13)\n        movq      mm2,mm1               ; transpose coefficients(phase 1)\n        punpcklwd mm1,mm3               ; mm1=(04 14 05 15)\n        punpckhwd mm2,mm3               ; mm2=(06 16 07 17)\n\n        movq      mm7,mm6               ; transpose coefficients(phase 2)\n        punpckldq mm6,mm0               ; mm6=(00 10 20 30)=data0\n        punpckhdq mm7,mm0               ; mm7=(01 11 21 31)=data1\n        movq      mm3,mm2               ; transpose coefficients(phase 2)\n        punpckldq mm2,mm5               ; mm2=(06 16 26 36)=data6\n        punpckhdq mm3,mm5               ; mm3=(07 17 27 37)=data7\n\n        movq    mm0,mm7\n        movq    mm5,mm6\n        psubw   mm7,mm2                 ; mm7=data1-data6=tmp6\n        psubw   mm6,mm3                 ; mm6=data0-data7=tmp7\n        paddw   mm0,mm2                 ; mm0=data1+data6=tmp1\n        paddw   mm5,mm3                 ; mm5=data0+data7=tmp0\n\n        movq    mm2, MMWORD [wk(0)]     ; mm2=(22 32 23 33)\n        movq    mm3, MMWORD [wk(1)]     ; mm3=(24 34 25 35)\n        movq    MMWORD [wk(0)], mm7     ; wk(0)=tmp6\n        movq    MMWORD [wk(1)], mm6     ; wk(1)=tmp7\n\n        movq      mm7,mm4               ; transpose coefficients(phase 2)\n        punpckldq mm4,mm2               ; mm4=(02 12 22 32)=data2\n        punpckhdq mm7,mm2               ; mm7=(03 13 23 33)=data3\n        movq      mm6,mm1               ; transpose coefficients(phase 2)\n        punpckldq mm1,mm3               ; mm1=(04 14 24 34)=data4\n        punpckhdq mm6,mm3               ; mm6=(05 15 25 35)=data5\n\n        movq    mm2,mm7\n        movq    mm3,mm4\n        paddw   mm7,mm1                 ; mm7=data3+data4=tmp3\n        paddw   mm4,mm6                 ; mm4=data2+data5=tmp2\n        psubw   mm2,mm1                 ; mm2=data3-data4=tmp4\n        psubw   mm3,mm6                 ; mm3=data2-data5=tmp5\n\n        ; -- Even part\n\n        movq    mm1,mm5\n        movq    mm6,mm0\n        psubw   mm5,mm7                 ; mm5=tmp13\n        psubw   mm0,mm4                 ; mm0=tmp12\n        paddw   mm1,mm7                 ; mm1=tmp10\n        paddw   mm6,mm4                 ; mm6=tmp11\n\n        paddw   mm0,mm5\n        psllw   mm0,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  mm0,[GOTOFF(ebx,PW_F0707)] ; mm0=z1\n\n        movq    mm7,mm1\n        movq    mm4,mm5\n        psubw   mm1,mm6                 ; mm1=data4\n        psubw   mm5,mm0                 ; mm5=data6\n        paddw   mm7,mm6                 ; mm7=data0\n        paddw   mm4,mm0                 ; mm4=data2\n\n        movq    MMWORD [MMBLOCK(0,1,edx,SIZEOF_DCTELEM)], mm1\n        movq    MMWORD [MMBLOCK(2,1,edx,SIZEOF_DCTELEM)], mm5\n        movq    MMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)], mm7\n        movq    MMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)], mm4\n\n        ; -- Odd part\n\n        movq    mm6, MMWORD [wk(0)]     ; mm6=tmp6\n        movq    mm0, MMWORD [wk(1)]     ; mm0=tmp7\n\n        paddw   mm2,mm3                 ; mm2=tmp10\n        paddw   mm3,mm6                 ; mm3=tmp11\n        paddw   mm6,mm0                 ; mm6=tmp12, mm0=tmp7\n\n        psllw   mm2,PRE_MULTIPLY_SCALE_BITS\n        psllw   mm6,PRE_MULTIPLY_SCALE_BITS\n\n        psllw   mm3,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  mm3,[GOTOFF(ebx,PW_F0707)] ; mm3=z3\n\n        movq    mm1,mm2                 ; mm1=tmp10\n        psubw   mm2,mm6\n        pmulhw  mm2,[GOTOFF(ebx,PW_F0382)] ; mm2=z5\n        pmulhw  mm1,[GOTOFF(ebx,PW_F0541)] ; mm1=MULTIPLY(tmp10,FIX_0_54119610)\n        pmulhw  mm6,[GOTOFF(ebx,PW_F1306)] ; mm6=MULTIPLY(tmp12,FIX_1_30656296)\n        paddw   mm1,mm2                 ; mm1=z2\n        paddw   mm6,mm2                 ; mm6=z4\n\n        movq    mm5,mm0\n        psubw   mm0,mm3                 ; mm0=z13\n        paddw   mm5,mm3                 ; mm5=z11\n\n        movq    mm7,mm0\n        movq    mm4,mm5\n        psubw   mm0,mm1                 ; mm0=data3\n        psubw   mm5,mm6                 ; mm5=data7\n        paddw   mm7,mm1                 ; mm7=data5\n        paddw   mm4,mm6                 ; mm4=data1\n\n        movq    MMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)], mm0\n        movq    MMWORD [MMBLOCK(3,1,edx,SIZEOF_DCTELEM)], mm5\n        movq    MMWORD [MMBLOCK(1,1,edx,SIZEOF_DCTELEM)], mm7\n        movq    MMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)], mm4\n\n        add     edx, byte 4*DCTSIZE*SIZEOF_DCTELEM\n        dec     ecx\n        jnz     near .rowloop\n\n        ; ---- Pass 2: process columns.\n\n        mov     edx, POINTER [data(eax)]        ; (DCTELEM *)\n        mov     ecx, DCTSIZE/4\n        alignx  16,7\n.columnloop:\n\n        movq    mm0, MMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)]\n        movq    mm1, MMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)]\n        movq    mm2, MMWORD [MMBLOCK(6,0,edx,SIZEOF_DCTELEM)]\n        movq    mm3, MMWORD [MMBLOCK(7,0,edx,SIZEOF_DCTELEM)]\n\n        ; mm0=(02 12 22 32), mm2=(42 52 62 72)\n        ; mm1=(03 13 23 33), mm3=(43 53 63 73)\n\n        movq      mm4,mm0               ; transpose coefficients(phase 1)\n        punpcklwd mm0,mm1               ; mm0=(02 03 12 13)\n        punpckhwd mm4,mm1               ; mm4=(22 23 32 33)\n        movq      mm5,mm2               ; transpose coefficients(phase 1)\n        punpcklwd mm2,mm3               ; mm2=(42 43 52 53)\n        punpckhwd mm5,mm3               ; mm5=(62 63 72 73)\n\n        movq    mm6, MMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)]\n        movq    mm7, MMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)]\n        movq    mm1, MMWORD [MMBLOCK(4,0,edx,SIZEOF_DCTELEM)]\n        movq    mm3, MMWORD [MMBLOCK(5,0,edx,SIZEOF_DCTELEM)]\n\n        ; mm6=(00 10 20 30), mm1=(40 50 60 70)\n        ; mm7=(01 11 21 31), mm3=(41 51 61 71)\n\n        movq    MMWORD [wk(0)], mm4     ; wk(0)=(22 23 32 33)\n        movq    MMWORD [wk(1)], mm2     ; wk(1)=(42 43 52 53)\n\n        movq      mm4,mm6               ; transpose coefficients(phase 1)\n        punpcklwd mm6,mm7               ; mm6=(00 01 10 11)\n        punpckhwd mm4,mm7               ; mm4=(20 21 30 31)\n        movq      mm2,mm1               ; transpose coefficients(phase 1)\n        punpcklwd mm1,mm3               ; mm1=(40 41 50 51)\n        punpckhwd mm2,mm3               ; mm2=(60 61 70 71)\n\n        movq      mm7,mm6               ; transpose coefficients(phase 2)\n        punpckldq mm6,mm0               ; mm6=(00 01 02 03)=data0\n        punpckhdq mm7,mm0               ; mm7=(10 11 12 13)=data1\n        movq      mm3,mm2               ; transpose coefficients(phase 2)\n        punpckldq mm2,mm5               ; mm2=(60 61 62 63)=data6\n        punpckhdq mm3,mm5               ; mm3=(70 71 72 73)=data7\n\n        movq    mm0,mm7\n        movq    mm5,mm6\n        psubw   mm7,mm2                 ; mm7=data1-data6=tmp6\n        psubw   mm6,mm3                 ; mm6=data0-data7=tmp7\n        paddw   mm0,mm2                 ; mm0=data1+data6=tmp1\n        paddw   mm5,mm3                 ; mm5=data0+data7=tmp0\n\n        movq    mm2, MMWORD [wk(0)]     ; mm2=(22 23 32 33)\n        movq    mm3, MMWORD [wk(1)]     ; mm3=(42 43 52 53)\n        movq    MMWORD [wk(0)], mm7     ; wk(0)=tmp6\n        movq    MMWORD [wk(1)], mm6     ; wk(1)=tmp7\n\n        movq      mm7,mm4               ; transpose coefficients(phase 2)\n        punpckldq mm4,mm2               ; mm4=(20 21 22 23)=data2\n        punpckhdq mm7,mm2               ; mm7=(30 31 32 33)=data3\n        movq      mm6,mm1               ; transpose coefficients(phase 2)\n        punpckldq mm1,mm3               ; mm1=(40 41 42 43)=data4\n        punpckhdq mm6,mm3               ; mm6=(50 51 52 53)=data5\n\n        movq    mm2,mm7\n        movq    mm3,mm4\n        paddw   mm7,mm1                 ; mm7=data3+data4=tmp3\n        paddw   mm4,mm6                 ; mm4=data2+data5=tmp2\n        psubw   mm2,mm1                 ; mm2=data3-data4=tmp4\n        psubw   mm3,mm6                 ; mm3=data2-data5=tmp5\n\n        ; -- Even part\n\n        movq    mm1,mm5\n        movq    mm6,mm0\n        psubw   mm5,mm7                 ; mm5=tmp13\n        psubw   mm0,mm4                 ; mm0=tmp12\n        paddw   mm1,mm7                 ; mm1=tmp10\n        paddw   mm6,mm4                 ; mm6=tmp11\n\n        paddw   mm0,mm5\n        psllw   mm0,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  mm0,[GOTOFF(ebx,PW_F0707)] ; mm0=z1\n\n        movq    mm7,mm1\n        movq    mm4,mm5\n        psubw   mm1,mm6                 ; mm1=data4\n        psubw   mm5,mm0                 ; mm5=data6\n        paddw   mm7,mm6                 ; mm7=data0\n        paddw   mm4,mm0                 ; mm4=data2\n\n        movq    MMWORD [MMBLOCK(4,0,edx,SIZEOF_DCTELEM)], mm1\n        movq    MMWORD [MMBLOCK(6,0,edx,SIZEOF_DCTELEM)], mm5\n        movq    MMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)], mm7\n        movq    MMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)], mm4\n\n        ; -- Odd part\n\n        movq    mm6, MMWORD [wk(0)]     ; mm6=tmp6\n        movq    mm0, MMWORD [wk(1)]     ; mm0=tmp7\n\n        paddw   mm2,mm3                 ; mm2=tmp10\n        paddw   mm3,mm6                 ; mm3=tmp11\n        paddw   mm6,mm0                 ; mm6=tmp12, mm0=tmp7\n\n        psllw   mm2,PRE_MULTIPLY_SCALE_BITS\n        psllw   mm6,PRE_MULTIPLY_SCALE_BITS\n\n        psllw   mm3,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  mm3,[GOTOFF(ebx,PW_F0707)] ; mm3=z3\n\n        movq    mm1,mm2                 ; mm1=tmp10\n        psubw   mm2,mm6\n        pmulhw  mm2,[GOTOFF(ebx,PW_F0382)] ; mm2=z5\n        pmulhw  mm1,[GOTOFF(ebx,PW_F0541)] ; mm1=MULTIPLY(tmp10,FIX_0_54119610)\n        pmulhw  mm6,[GOTOFF(ebx,PW_F1306)] ; mm6=MULTIPLY(tmp12,FIX_1_30656296)\n        paddw   mm1,mm2                 ; mm1=z2\n        paddw   mm6,mm2                 ; mm6=z4\n\n        movq    mm5,mm0\n        psubw   mm0,mm3                 ; mm0=z13\n        paddw   mm5,mm3                 ; mm5=z11\n\n        movq    mm7,mm0\n        movq    mm4,mm5\n        psubw   mm0,mm1                 ; mm0=data3\n        psubw   mm5,mm6                 ; mm5=data7\n        paddw   mm7,mm1                 ; mm7=data5\n        paddw   mm4,mm6                 ; mm4=data1\n\n        movq    MMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)], mm0\n        movq    MMWORD [MMBLOCK(7,0,edx,SIZEOF_DCTELEM)], mm5\n        movq    MMWORD [MMBLOCK(5,0,edx,SIZEOF_DCTELEM)], mm7\n        movq    MMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)], mm4\n\n        add     edx, byte 4*SIZEOF_DCTELEM\n        dec     ecx\n        jnz     near .columnloop\n\n        emms            ; empty MMX state\n\n;       pop     edi             ; unused\n;       pop     esi             ; unused\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        poppic  ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jfdctfst-sse2-64.asm",
    "content": ";\n; jfdctfst.asm - fast integer FDCT (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a fast, not so accurate integer implementation of\n; the forward DCT (Discrete Cosine Transform). The following code is\n; based directly on the IJG's original jfdctfst.c; see the jfdctfst.c\n; for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS      8       ; 14 is also OK.\n\n%if CONST_BITS == 8\nF_0_382 equ      98             ; FIX(0.382683433)\nF_0_541 equ     139             ; FIX(0.541196100)\nF_0_707 equ     181             ; FIX(0.707106781)\nF_1_306 equ     334             ; FIX(1.306562965)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_382 equ     DESCALE( 410903207,30-CONST_BITS)       ; FIX(0.382683433)\nF_0_541 equ     DESCALE( 581104887,30-CONST_BITS)       ; FIX(0.541196100)\nF_0_707 equ     DESCALE( 759250124,30-CONST_BITS)       ; FIX(0.707106781)\nF_1_306 equ     DESCALE(1402911301,30-CONST_BITS)       ; FIX(1.306562965)\n%endif\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n; PRE_MULTIPLY_SCALE_BITS <= 2 (to avoid overflow)\n; CONST_BITS + CONST_SHIFT + PRE_MULTIPLY_SCALE_BITS == 16 (for pmulhw)\n\n%define PRE_MULTIPLY_SCALE_BITS   2\n%define CONST_SHIFT     (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS)\n\n        alignz  16\n        global  EXTN(jconst_fdct_ifast_sse2)\n\nEXTN(jconst_fdct_ifast_sse2):\n\nPW_F0707        times 8 dw  F_0_707 << CONST_SHIFT\nPW_F0382        times 8 dw  F_0_382 << CONST_SHIFT\nPW_F0541        times 8 dw  F_0_541 << CONST_SHIFT\nPW_F1306        times 8 dw  F_1_306 << CONST_SHIFT\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_ifast_sse2 (DCTELEM *data)\n;\n\n; r10 = DCTELEM *data\n\n%define wk(i)           rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          2\n\n        align   16\n        global  EXTN(jsimd_fdct_ifast_sse2)\n\nEXTN(jsimd_fdct_ifast_sse2):\n        push    rbp\n        mov     rax,rsp                         ; rax = original rbp\n        sub     rsp, byte 4\n        and     rsp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [rsp],rax\n        mov     rbp,rsp                         ; rbp = aligned rbp\n        lea     rsp, [wk(0)]\n        collect_args\n\n        ; ---- Pass 1: process rows.\n\n        mov     rdx, r10        ; (DCTELEM *)\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_DCTELEM)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_DCTELEM)]\n        movdqa  xmm2, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_DCTELEM)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_DCTELEM)]\n\n        ; xmm0=(00 01 02 03 04 05 06 07), xmm2=(20 21 22 23 24 25 26 27)\n        ; xmm1=(10 11 12 13 14 15 16 17), xmm3=(30 31 32 33 34 35 36 37)\n\n        movdqa    xmm4,xmm0             ; transpose coefficients(phase 1)\n        punpcklwd xmm0,xmm1             ; xmm0=(00 10 01 11 02 12 03 13)\n        punpckhwd xmm4,xmm1             ; xmm4=(04 14 05 15 06 16 07 17)\n        movdqa    xmm5,xmm2             ; transpose coefficients(phase 1)\n        punpcklwd xmm2,xmm3             ; xmm2=(20 30 21 31 22 32 23 33)\n        punpckhwd xmm5,xmm3             ; xmm5=(24 34 25 35 26 36 27 37)\n\n        movdqa  xmm6, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_DCTELEM)]\n        movdqa  xmm7, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_DCTELEM)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_DCTELEM)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_DCTELEM)]\n\n        ; xmm6=( 4 12 20 28 36 44 52 60), xmm1=( 6 14 22 30 38 46 54 62)\n        ; xmm7=( 5 13 21 29 37 45 53 61), xmm3=( 7 15 23 31 39 47 55 63)\n\n        movdqa  XMMWORD [wk(0)], xmm2   ; wk(0)=(20 30 21 31 22 32 23 33)\n        movdqa  XMMWORD [wk(1)], xmm5   ; wk(1)=(24 34 25 35 26 36 27 37)\n\n        movdqa    xmm2,xmm6             ; transpose coefficients(phase 1)\n        punpcklwd xmm6,xmm7             ; xmm6=(40 50 41 51 42 52 43 53)\n        punpckhwd xmm2,xmm7             ; xmm2=(44 54 45 55 46 56 47 57)\n        movdqa    xmm5,xmm1             ; transpose coefficients(phase 1)\n        punpcklwd xmm1,xmm3             ; xmm1=(60 70 61 71 62 72 63 73)\n        punpckhwd xmm5,xmm3             ; xmm5=(64 74 65 75 66 76 67 77)\n\n        movdqa    xmm7,xmm6             ; transpose coefficients(phase 2)\n        punpckldq xmm6,xmm1             ; xmm6=(40 50 60 70 41 51 61 71)\n        punpckhdq xmm7,xmm1             ; xmm7=(42 52 62 72 43 53 63 73)\n        movdqa    xmm3,xmm2             ; transpose coefficients(phase 2)\n        punpckldq xmm2,xmm5             ; xmm2=(44 54 64 74 45 55 65 75)\n        punpckhdq xmm3,xmm5             ; xmm3=(46 56 66 76 47 57 67 77)\n\n        movdqa  xmm1, XMMWORD [wk(0)]   ; xmm1=(20 30 21 31 22 32 23 33)\n        movdqa  xmm5, XMMWORD [wk(1)]   ; xmm5=(24 34 25 35 26 36 27 37)\n        movdqa  XMMWORD [wk(0)], xmm7   ; wk(0)=(42 52 62 72 43 53 63 73)\n        movdqa  XMMWORD [wk(1)], xmm2   ; wk(1)=(44 54 64 74 45 55 65 75)\n\n        movdqa    xmm7,xmm0             ; transpose coefficients(phase 2)\n        punpckldq xmm0,xmm1             ; xmm0=(00 10 20 30 01 11 21 31)\n        punpckhdq xmm7,xmm1             ; xmm7=(02 12 22 32 03 13 23 33)\n        movdqa    xmm2,xmm4             ; transpose coefficients(phase 2)\n        punpckldq xmm4,xmm5             ; xmm4=(04 14 24 34 05 15 25 35)\n        punpckhdq xmm2,xmm5             ; xmm2=(06 16 26 36 07 17 27 37)\n\n        movdqa     xmm1,xmm0            ; transpose coefficients(phase 3)\n        punpcklqdq xmm0,xmm6            ; xmm0=(00 10 20 30 40 50 60 70)=data0\n        punpckhqdq xmm1,xmm6            ; xmm1=(01 11 21 31 41 51 61 71)=data1\n        movdqa     xmm5,xmm2            ; transpose coefficients(phase 3)\n        punpcklqdq xmm2,xmm3            ; xmm2=(06 16 26 36 46 56 66 76)=data6\n        punpckhqdq xmm5,xmm3            ; xmm5=(07 17 27 37 47 57 67 77)=data7\n\n        movdqa  xmm6,xmm1\n        movdqa  xmm3,xmm0\n        psubw   xmm1,xmm2               ; xmm1=data1-data6=tmp6\n        psubw   xmm0,xmm5               ; xmm0=data0-data7=tmp7\n        paddw   xmm6,xmm2               ; xmm6=data1+data6=tmp1\n        paddw   xmm3,xmm5               ; xmm3=data0+data7=tmp0\n\n        movdqa  xmm2, XMMWORD [wk(0)]   ; xmm2=(42 52 62 72 43 53 63 73)\n        movdqa  xmm5, XMMWORD [wk(1)]   ; xmm5=(44 54 64 74 45 55 65 75)\n        movdqa  XMMWORD [wk(0)], xmm1   ; wk(0)=tmp6\n        movdqa  XMMWORD [wk(1)], xmm0   ; wk(1)=tmp7\n\n        movdqa     xmm1,xmm7            ; transpose coefficients(phase 3)\n        punpcklqdq xmm7,xmm2            ; xmm7=(02 12 22 32 42 52 62 72)=data2\n        punpckhqdq xmm1,xmm2            ; xmm1=(03 13 23 33 43 53 63 73)=data3\n        movdqa     xmm0,xmm4            ; transpose coefficients(phase 3)\n        punpcklqdq xmm4,xmm5            ; xmm4=(04 14 24 34 44 54 64 74)=data4\n        punpckhqdq xmm0,xmm5            ; xmm0=(05 15 25 35 45 55 65 75)=data5\n\n        movdqa  xmm2,xmm1\n        movdqa  xmm5,xmm7\n        paddw   xmm1,xmm4               ; xmm1=data3+data4=tmp3\n        paddw   xmm7,xmm0               ; xmm7=data2+data5=tmp2\n        psubw   xmm2,xmm4               ; xmm2=data3-data4=tmp4\n        psubw   xmm5,xmm0               ; xmm5=data2-data5=tmp5\n\n        ; -- Even part\n\n        movdqa  xmm4,xmm3\n        movdqa  xmm0,xmm6\n        psubw   xmm3,xmm1               ; xmm3=tmp13\n        psubw   xmm6,xmm7               ; xmm6=tmp12\n        paddw   xmm4,xmm1               ; xmm4=tmp10\n        paddw   xmm0,xmm7               ; xmm0=tmp11\n\n        paddw   xmm6,xmm3\n        psllw   xmm6,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm6,[rel PW_F0707] ; xmm6=z1\n\n        movdqa  xmm1,xmm4\n        movdqa  xmm7,xmm3\n        psubw   xmm4,xmm0               ; xmm4=data4\n        psubw   xmm3,xmm6               ; xmm3=data6\n        paddw   xmm1,xmm0               ; xmm1=data0\n        paddw   xmm7,xmm6               ; xmm7=data2\n\n        movdqa  xmm0, XMMWORD [wk(0)]   ; xmm0=tmp6\n        movdqa  xmm6, XMMWORD [wk(1)]   ; xmm6=tmp7\n        movdqa  XMMWORD [wk(0)], xmm4   ; wk(0)=data4\n        movdqa  XMMWORD [wk(1)], xmm3   ; wk(1)=data6\n\n        ; -- Odd part\n\n        paddw   xmm2,xmm5               ; xmm2=tmp10\n        paddw   xmm5,xmm0               ; xmm5=tmp11\n        paddw   xmm0,xmm6               ; xmm0=tmp12, xmm6=tmp7\n\n        psllw   xmm2,PRE_MULTIPLY_SCALE_BITS\n        psllw   xmm0,PRE_MULTIPLY_SCALE_BITS\n\n        psllw   xmm5,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm5,[rel PW_F0707] ; xmm5=z3\n\n        movdqa  xmm4,xmm2               ; xmm4=tmp10\n        psubw   xmm2,xmm0\n        pmulhw  xmm2,[rel PW_F0382] ; xmm2=z5\n        pmulhw  xmm4,[rel PW_F0541] ; xmm4=MULTIPLY(tmp10,FIX_0_541196)\n        pmulhw  xmm0,[rel PW_F1306] ; xmm0=MULTIPLY(tmp12,FIX_1_306562)\n        paddw   xmm4,xmm2               ; xmm4=z2\n        paddw   xmm0,xmm2               ; xmm0=z4\n\n        movdqa  xmm3,xmm6\n        psubw   xmm6,xmm5               ; xmm6=z13\n        paddw   xmm3,xmm5               ; xmm3=z11\n\n        movdqa  xmm2,xmm6\n        movdqa  xmm5,xmm3\n        psubw   xmm6,xmm4               ; xmm6=data3\n        psubw   xmm3,xmm0               ; xmm3=data7\n        paddw   xmm2,xmm4               ; xmm2=data5\n        paddw   xmm5,xmm0               ; xmm5=data1\n\n        ; ---- Pass 2: process columns.\n\n        ; xmm1=(00 10 20 30 40 50 60 70), xmm7=(02 12 22 32 42 52 62 72)\n        ; xmm5=(01 11 21 31 41 51 61 71), xmm6=(03 13 23 33 43 53 63 73)\n\n        movdqa    xmm4,xmm1             ; transpose coefficients(phase 1)\n        punpcklwd xmm1,xmm5             ; xmm1=(00 01 10 11 20 21 30 31)\n        punpckhwd xmm4,xmm5             ; xmm4=(40 41 50 51 60 61 70 71)\n        movdqa    xmm0,xmm7             ; transpose coefficients(phase 1)\n        punpcklwd xmm7,xmm6             ; xmm7=(02 03 12 13 22 23 32 33)\n        punpckhwd xmm0,xmm6             ; xmm0=(42 43 52 53 62 63 72 73)\n\n        movdqa  xmm5, XMMWORD [wk(0)]   ; xmm5=col4\n        movdqa  xmm6, XMMWORD [wk(1)]   ; xmm6=col6\n\n        ; xmm5=(04 14 24 34 44 54 64 74), xmm6=(06 16 26 36 46 56 66 76)\n        ; xmm2=(05 15 25 35 45 55 65 75), xmm3=(07 17 27 37 47 57 67 77)\n\n        movdqa  XMMWORD [wk(0)], xmm7   ; wk(0)=(02 03 12 13 22 23 32 33)\n        movdqa  XMMWORD [wk(1)], xmm0   ; wk(1)=(42 43 52 53 62 63 72 73)\n\n        movdqa    xmm7,xmm5             ; transpose coefficients(phase 1)\n        punpcklwd xmm5,xmm2             ; xmm5=(04 05 14 15 24 25 34 35)\n        punpckhwd xmm7,xmm2             ; xmm7=(44 45 54 55 64 65 74 75)\n        movdqa    xmm0,xmm6             ; transpose coefficients(phase 1)\n        punpcklwd xmm6,xmm3             ; xmm6=(06 07 16 17 26 27 36 37)\n        punpckhwd xmm0,xmm3             ; xmm0=(46 47 56 57 66 67 76 77)\n\n        movdqa    xmm2,xmm5             ; transpose coefficients(phase 2)\n        punpckldq xmm5,xmm6             ; xmm5=(04 05 06 07 14 15 16 17)\n        punpckhdq xmm2,xmm6             ; xmm2=(24 25 26 27 34 35 36 37)\n        movdqa    xmm3,xmm7             ; transpose coefficients(phase 2)\n        punpckldq xmm7,xmm0             ; xmm7=(44 45 46 47 54 55 56 57)\n        punpckhdq xmm3,xmm0             ; xmm3=(64 65 66 67 74 75 76 77)\n\n        movdqa  xmm6, XMMWORD [wk(0)]   ; xmm6=(02 03 12 13 22 23 32 33)\n        movdqa  xmm0, XMMWORD [wk(1)]   ; xmm0=(42 43 52 53 62 63 72 73)\n        movdqa  XMMWORD [wk(0)], xmm2   ; wk(0)=(24 25 26 27 34 35 36 37)\n        movdqa  XMMWORD [wk(1)], xmm7   ; wk(1)=(44 45 46 47 54 55 56 57)\n\n        movdqa    xmm2,xmm1             ; transpose coefficients(phase 2)\n        punpckldq xmm1,xmm6             ; xmm1=(00 01 02 03 10 11 12 13)\n        punpckhdq xmm2,xmm6             ; xmm2=(20 21 22 23 30 31 32 33)\n        movdqa    xmm7,xmm4             ; transpose coefficients(phase 2)\n        punpckldq xmm4,xmm0             ; xmm4=(40 41 42 43 50 51 52 53)\n        punpckhdq xmm7,xmm0             ; xmm7=(60 61 62 63 70 71 72 73)\n\n        movdqa     xmm6,xmm1            ; transpose coefficients(phase 3)\n        punpcklqdq xmm1,xmm5            ; xmm1=(00 01 02 03 04 05 06 07)=data0\n        punpckhqdq xmm6,xmm5            ; xmm6=(10 11 12 13 14 15 16 17)=data1\n        movdqa     xmm0,xmm7            ; transpose coefficients(phase 3)\n        punpcklqdq xmm7,xmm3            ; xmm7=(60 61 62 63 64 65 66 67)=data6\n        punpckhqdq xmm0,xmm3            ; xmm0=(70 71 72 73 74 75 76 77)=data7\n\n        movdqa  xmm5,xmm6\n        movdqa  xmm3,xmm1\n        psubw   xmm6,xmm7               ; xmm6=data1-data6=tmp6\n        psubw   xmm1,xmm0               ; xmm1=data0-data7=tmp7\n        paddw   xmm5,xmm7               ; xmm5=data1+data6=tmp1\n        paddw   xmm3,xmm0               ; xmm3=data0+data7=tmp0\n\n        movdqa  xmm7, XMMWORD [wk(0)]   ; xmm7=(24 25 26 27 34 35 36 37)\n        movdqa  xmm0, XMMWORD [wk(1)]   ; xmm0=(44 45 46 47 54 55 56 57)\n        movdqa  XMMWORD [wk(0)], xmm6   ; wk(0)=tmp6\n        movdqa  XMMWORD [wk(1)], xmm1   ; wk(1)=tmp7\n\n        movdqa     xmm6,xmm2            ; transpose coefficients(phase 3)\n        punpcklqdq xmm2,xmm7            ; xmm2=(20 21 22 23 24 25 26 27)=data2\n        punpckhqdq xmm6,xmm7            ; xmm6=(30 31 32 33 34 35 36 37)=data3\n        movdqa     xmm1,xmm4            ; transpose coefficients(phase 3)\n        punpcklqdq xmm4,xmm0            ; xmm4=(40 41 42 43 44 45 46 47)=data4\n        punpckhqdq xmm1,xmm0            ; xmm1=(50 51 52 53 54 55 56 57)=data5\n\n        movdqa  xmm7,xmm6\n        movdqa  xmm0,xmm2\n        paddw   xmm6,xmm4               ; xmm6=data3+data4=tmp3\n        paddw   xmm2,xmm1               ; xmm2=data2+data5=tmp2\n        psubw   xmm7,xmm4               ; xmm7=data3-data4=tmp4\n        psubw   xmm0,xmm1               ; xmm0=data2-data5=tmp5\n\n        ; -- Even part\n\n        movdqa  xmm4,xmm3\n        movdqa  xmm1,xmm5\n        psubw   xmm3,xmm6               ; xmm3=tmp13\n        psubw   xmm5,xmm2               ; xmm5=tmp12\n        paddw   xmm4,xmm6               ; xmm4=tmp10\n        paddw   xmm1,xmm2               ; xmm1=tmp11\n\n        paddw   xmm5,xmm3\n        psllw   xmm5,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm5,[rel PW_F0707] ; xmm5=z1\n\n        movdqa  xmm6,xmm4\n        movdqa  xmm2,xmm3\n        psubw   xmm4,xmm1               ; xmm4=data4\n        psubw   xmm3,xmm5               ; xmm3=data6\n        paddw   xmm6,xmm1               ; xmm6=data0\n        paddw   xmm2,xmm5               ; xmm2=data2\n\n        movdqa  XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_DCTELEM)], xmm4\n        movdqa  XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_DCTELEM)], xmm3\n        movdqa  XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_DCTELEM)], xmm6\n        movdqa  XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_DCTELEM)], xmm2\n\n        ; -- Odd part\n\n        movdqa  xmm1, XMMWORD [wk(0)]   ; xmm1=tmp6\n        movdqa  xmm5, XMMWORD [wk(1)]   ; xmm5=tmp7\n\n        paddw   xmm7,xmm0               ; xmm7=tmp10\n        paddw   xmm0,xmm1               ; xmm0=tmp11\n        paddw   xmm1,xmm5               ; xmm1=tmp12, xmm5=tmp7\n\n        psllw   xmm7,PRE_MULTIPLY_SCALE_BITS\n        psllw   xmm1,PRE_MULTIPLY_SCALE_BITS\n\n        psllw   xmm0,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm0,[rel PW_F0707] ; xmm0=z3\n\n        movdqa  xmm4,xmm7               ; xmm4=tmp10\n        psubw   xmm7,xmm1\n        pmulhw  xmm7,[rel PW_F0382] ; xmm7=z5\n        pmulhw  xmm4,[rel PW_F0541] ; xmm4=MULTIPLY(tmp10,FIX_0_541196)\n        pmulhw  xmm1,[rel PW_F1306] ; xmm1=MULTIPLY(tmp12,FIX_1_306562)\n        paddw   xmm4,xmm7               ; xmm4=z2\n        paddw   xmm1,xmm7               ; xmm1=z4\n\n        movdqa  xmm3,xmm5\n        psubw   xmm5,xmm0               ; xmm5=z13\n        paddw   xmm3,xmm0               ; xmm3=z11\n\n        movdqa  xmm6,xmm5\n        movdqa  xmm2,xmm3\n        psubw   xmm5,xmm4               ; xmm5=data3\n        psubw   xmm3,xmm1               ; xmm3=data7\n        paddw   xmm6,xmm4               ; xmm6=data5\n        paddw   xmm2,xmm1               ; xmm2=data1\n\n        movdqa  XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_DCTELEM)], xmm5\n        movdqa  XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_DCTELEM)], xmm3\n        movdqa  XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_DCTELEM)], xmm6\n        movdqa  XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_DCTELEM)], xmm2\n\n        uncollect_args\n        mov     rsp,rbp         ; rsp <- aligned rbp\n        pop     rsp             ; rsp <- original rbp\n        pop     rbp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jfdctfst-sse2.asm",
    "content": ";\n; jfdctfst.asm - fast integer FDCT (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a fast, not so accurate integer implementation of\n; the forward DCT (Discrete Cosine Transform). The following code is\n; based directly on the IJG's original jfdctfst.c; see the jfdctfst.c\n; for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS      8       ; 14 is also OK.\n\n%if CONST_BITS == 8\nF_0_382 equ      98             ; FIX(0.382683433)\nF_0_541 equ     139             ; FIX(0.541196100)\nF_0_707 equ     181             ; FIX(0.707106781)\nF_1_306 equ     334             ; FIX(1.306562965)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_382 equ     DESCALE( 410903207,30-CONST_BITS)       ; FIX(0.382683433)\nF_0_541 equ     DESCALE( 581104887,30-CONST_BITS)       ; FIX(0.541196100)\nF_0_707 equ     DESCALE( 759250124,30-CONST_BITS)       ; FIX(0.707106781)\nF_1_306 equ     DESCALE(1402911301,30-CONST_BITS)       ; FIX(1.306562965)\n%endif\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n; PRE_MULTIPLY_SCALE_BITS <= 2 (to avoid overflow)\n; CONST_BITS + CONST_SHIFT + PRE_MULTIPLY_SCALE_BITS == 16 (for pmulhw)\n\n%define PRE_MULTIPLY_SCALE_BITS   2\n%define CONST_SHIFT     (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS)\n\n        alignz  16\n        global  EXTN(jconst_fdct_ifast_sse2)\n\nEXTN(jconst_fdct_ifast_sse2):\n\nPW_F0707        times 8 dw  F_0_707 << CONST_SHIFT\nPW_F0382        times 8 dw  F_0_382 << CONST_SHIFT\nPW_F0541        times 8 dw  F_0_541 << CONST_SHIFT\nPW_F1306        times 8 dw  F_1_306 << CONST_SHIFT\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_ifast_sse2 (DCTELEM *data)\n;\n\n%define data(b)         (b)+8           ; DCTELEM *data\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          2\n\n        align   16\n        global  EXTN(jsimd_fdct_ifast_sse2)\n\nEXTN(jsimd_fdct_ifast_sse2):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic ebx\n;       push    ecx             ; unused\n;       push    edx             ; need not be preserved\n;       push    esi             ; unused\n;       push    edi             ; unused\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process rows.\n\n        mov     edx, POINTER [data(eax)]        ; (DCTELEM *)\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_DCTELEM)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_DCTELEM)]\n        movdqa  xmm2, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_DCTELEM)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_DCTELEM)]\n\n        ; xmm0=(00 01 02 03 04 05 06 07), xmm2=(20 21 22 23 24 25 26 27)\n        ; xmm1=(10 11 12 13 14 15 16 17), xmm3=(30 31 32 33 34 35 36 37)\n\n        movdqa    xmm4,xmm0             ; transpose coefficients(phase 1)\n        punpcklwd xmm0,xmm1             ; xmm0=(00 10 01 11 02 12 03 13)\n        punpckhwd xmm4,xmm1             ; xmm4=(04 14 05 15 06 16 07 17)\n        movdqa    xmm5,xmm2             ; transpose coefficients(phase 1)\n        punpcklwd xmm2,xmm3             ; xmm2=(20 30 21 31 22 32 23 33)\n        punpckhwd xmm5,xmm3             ; xmm5=(24 34 25 35 26 36 27 37)\n\n        movdqa  xmm6, XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_DCTELEM)]\n        movdqa  xmm7, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_DCTELEM)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_DCTELEM)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_DCTELEM)]\n\n        ; xmm6=( 4 12 20 28 36 44 52 60), xmm1=( 6 14 22 30 38 46 54 62)\n        ; xmm7=( 5 13 21 29 37 45 53 61), xmm3=( 7 15 23 31 39 47 55 63)\n\n        movdqa  XMMWORD [wk(0)], xmm2   ; wk(0)=(20 30 21 31 22 32 23 33)\n        movdqa  XMMWORD [wk(1)], xmm5   ; wk(1)=(24 34 25 35 26 36 27 37)\n\n        movdqa    xmm2,xmm6             ; transpose coefficients(phase 1)\n        punpcklwd xmm6,xmm7             ; xmm6=(40 50 41 51 42 52 43 53)\n        punpckhwd xmm2,xmm7             ; xmm2=(44 54 45 55 46 56 47 57)\n        movdqa    xmm5,xmm1             ; transpose coefficients(phase 1)\n        punpcklwd xmm1,xmm3             ; xmm1=(60 70 61 71 62 72 63 73)\n        punpckhwd xmm5,xmm3             ; xmm5=(64 74 65 75 66 76 67 77)\n\n        movdqa    xmm7,xmm6             ; transpose coefficients(phase 2)\n        punpckldq xmm6,xmm1             ; xmm6=(40 50 60 70 41 51 61 71)\n        punpckhdq xmm7,xmm1             ; xmm7=(42 52 62 72 43 53 63 73)\n        movdqa    xmm3,xmm2             ; transpose coefficients(phase 2)\n        punpckldq xmm2,xmm5             ; xmm2=(44 54 64 74 45 55 65 75)\n        punpckhdq xmm3,xmm5             ; xmm3=(46 56 66 76 47 57 67 77)\n\n        movdqa  xmm1, XMMWORD [wk(0)]   ; xmm1=(20 30 21 31 22 32 23 33)\n        movdqa  xmm5, XMMWORD [wk(1)]   ; xmm5=(24 34 25 35 26 36 27 37)\n        movdqa  XMMWORD [wk(0)], xmm7   ; wk(0)=(42 52 62 72 43 53 63 73)\n        movdqa  XMMWORD [wk(1)], xmm2   ; wk(1)=(44 54 64 74 45 55 65 75)\n\n        movdqa    xmm7,xmm0             ; transpose coefficients(phase 2)\n        punpckldq xmm0,xmm1             ; xmm0=(00 10 20 30 01 11 21 31)\n        punpckhdq xmm7,xmm1             ; xmm7=(02 12 22 32 03 13 23 33)\n        movdqa    xmm2,xmm4             ; transpose coefficients(phase 2)\n        punpckldq xmm4,xmm5             ; xmm4=(04 14 24 34 05 15 25 35)\n        punpckhdq xmm2,xmm5             ; xmm2=(06 16 26 36 07 17 27 37)\n\n        movdqa     xmm1,xmm0            ; transpose coefficients(phase 3)\n        punpcklqdq xmm0,xmm6            ; xmm0=(00 10 20 30 40 50 60 70)=data0\n        punpckhqdq xmm1,xmm6            ; xmm1=(01 11 21 31 41 51 61 71)=data1\n        movdqa     xmm5,xmm2            ; transpose coefficients(phase 3)\n        punpcklqdq xmm2,xmm3            ; xmm2=(06 16 26 36 46 56 66 76)=data6\n        punpckhqdq xmm5,xmm3            ; xmm5=(07 17 27 37 47 57 67 77)=data7\n\n        movdqa  xmm6,xmm1\n        movdqa  xmm3,xmm0\n        psubw   xmm1,xmm2               ; xmm1=data1-data6=tmp6\n        psubw   xmm0,xmm5               ; xmm0=data0-data7=tmp7\n        paddw   xmm6,xmm2               ; xmm6=data1+data6=tmp1\n        paddw   xmm3,xmm5               ; xmm3=data0+data7=tmp0\n\n        movdqa  xmm2, XMMWORD [wk(0)]   ; xmm2=(42 52 62 72 43 53 63 73)\n        movdqa  xmm5, XMMWORD [wk(1)]   ; xmm5=(44 54 64 74 45 55 65 75)\n        movdqa  XMMWORD [wk(0)], xmm1   ; wk(0)=tmp6\n        movdqa  XMMWORD [wk(1)], xmm0   ; wk(1)=tmp7\n\n        movdqa     xmm1,xmm7            ; transpose coefficients(phase 3)\n        punpcklqdq xmm7,xmm2            ; xmm7=(02 12 22 32 42 52 62 72)=data2\n        punpckhqdq xmm1,xmm2            ; xmm1=(03 13 23 33 43 53 63 73)=data3\n        movdqa     xmm0,xmm4            ; transpose coefficients(phase 3)\n        punpcklqdq xmm4,xmm5            ; xmm4=(04 14 24 34 44 54 64 74)=data4\n        punpckhqdq xmm0,xmm5            ; xmm0=(05 15 25 35 45 55 65 75)=data5\n\n        movdqa  xmm2,xmm1\n        movdqa  xmm5,xmm7\n        paddw   xmm1,xmm4               ; xmm1=data3+data4=tmp3\n        paddw   xmm7,xmm0               ; xmm7=data2+data5=tmp2\n        psubw   xmm2,xmm4               ; xmm2=data3-data4=tmp4\n        psubw   xmm5,xmm0               ; xmm5=data2-data5=tmp5\n\n        ; -- Even part\n\n        movdqa  xmm4,xmm3\n        movdqa  xmm0,xmm6\n        psubw   xmm3,xmm1               ; xmm3=tmp13\n        psubw   xmm6,xmm7               ; xmm6=tmp12\n        paddw   xmm4,xmm1               ; xmm4=tmp10\n        paddw   xmm0,xmm7               ; xmm0=tmp11\n\n        paddw   xmm6,xmm3\n        psllw   xmm6,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm6,[GOTOFF(ebx,PW_F0707)] ; xmm6=z1\n\n        movdqa  xmm1,xmm4\n        movdqa  xmm7,xmm3\n        psubw   xmm4,xmm0               ; xmm4=data4\n        psubw   xmm3,xmm6               ; xmm3=data6\n        paddw   xmm1,xmm0               ; xmm1=data0\n        paddw   xmm7,xmm6               ; xmm7=data2\n\n        movdqa  xmm0, XMMWORD [wk(0)]   ; xmm0=tmp6\n        movdqa  xmm6, XMMWORD [wk(1)]   ; xmm6=tmp7\n        movdqa  XMMWORD [wk(0)], xmm4   ; wk(0)=data4\n        movdqa  XMMWORD [wk(1)], xmm3   ; wk(1)=data6\n\n        ; -- Odd part\n\n        paddw   xmm2,xmm5               ; xmm2=tmp10\n        paddw   xmm5,xmm0               ; xmm5=tmp11\n        paddw   xmm0,xmm6               ; xmm0=tmp12, xmm6=tmp7\n\n        psllw   xmm2,PRE_MULTIPLY_SCALE_BITS\n        psllw   xmm0,PRE_MULTIPLY_SCALE_BITS\n\n        psllw   xmm5,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm5,[GOTOFF(ebx,PW_F0707)] ; xmm5=z3\n\n        movdqa  xmm4,xmm2               ; xmm4=tmp10\n        psubw   xmm2,xmm0\n        pmulhw  xmm2,[GOTOFF(ebx,PW_F0382)] ; xmm2=z5\n        pmulhw  xmm4,[GOTOFF(ebx,PW_F0541)] ; xmm4=MULTIPLY(tmp10,FIX_0_541196)\n        pmulhw  xmm0,[GOTOFF(ebx,PW_F1306)] ; xmm0=MULTIPLY(tmp12,FIX_1_306562)\n        paddw   xmm4,xmm2               ; xmm4=z2\n        paddw   xmm0,xmm2               ; xmm0=z4\n\n        movdqa  xmm3,xmm6\n        psubw   xmm6,xmm5               ; xmm6=z13\n        paddw   xmm3,xmm5               ; xmm3=z11\n\n        movdqa  xmm2,xmm6\n        movdqa  xmm5,xmm3\n        psubw   xmm6,xmm4               ; xmm6=data3\n        psubw   xmm3,xmm0               ; xmm3=data7\n        paddw   xmm2,xmm4               ; xmm2=data5\n        paddw   xmm5,xmm0               ; xmm5=data1\n\n        ; ---- Pass 2: process columns.\n\n;       mov     edx, POINTER [data(eax)]        ; (DCTELEM *)\n\n        ; xmm1=(00 10 20 30 40 50 60 70), xmm7=(02 12 22 32 42 52 62 72)\n        ; xmm5=(01 11 21 31 41 51 61 71), xmm6=(03 13 23 33 43 53 63 73)\n\n        movdqa    xmm4,xmm1             ; transpose coefficients(phase 1)\n        punpcklwd xmm1,xmm5             ; xmm1=(00 01 10 11 20 21 30 31)\n        punpckhwd xmm4,xmm5             ; xmm4=(40 41 50 51 60 61 70 71)\n        movdqa    xmm0,xmm7             ; transpose coefficients(phase 1)\n        punpcklwd xmm7,xmm6             ; xmm7=(02 03 12 13 22 23 32 33)\n        punpckhwd xmm0,xmm6             ; xmm0=(42 43 52 53 62 63 72 73)\n\n        movdqa  xmm5, XMMWORD [wk(0)]   ; xmm5=col4\n        movdqa  xmm6, XMMWORD [wk(1)]   ; xmm6=col6\n\n        ; xmm5=(04 14 24 34 44 54 64 74), xmm6=(06 16 26 36 46 56 66 76)\n        ; xmm2=(05 15 25 35 45 55 65 75), xmm3=(07 17 27 37 47 57 67 77)\n\n        movdqa  XMMWORD [wk(0)], xmm7   ; wk(0)=(02 03 12 13 22 23 32 33)\n        movdqa  XMMWORD [wk(1)], xmm0   ; wk(1)=(42 43 52 53 62 63 72 73)\n\n        movdqa    xmm7,xmm5             ; transpose coefficients(phase 1)\n        punpcklwd xmm5,xmm2             ; xmm5=(04 05 14 15 24 25 34 35)\n        punpckhwd xmm7,xmm2             ; xmm7=(44 45 54 55 64 65 74 75)\n        movdqa    xmm0,xmm6             ; transpose coefficients(phase 1)\n        punpcklwd xmm6,xmm3             ; xmm6=(06 07 16 17 26 27 36 37)\n        punpckhwd xmm0,xmm3             ; xmm0=(46 47 56 57 66 67 76 77)\n\n        movdqa    xmm2,xmm5             ; transpose coefficients(phase 2)\n        punpckldq xmm5,xmm6             ; xmm5=(04 05 06 07 14 15 16 17)\n        punpckhdq xmm2,xmm6             ; xmm2=(24 25 26 27 34 35 36 37)\n        movdqa    xmm3,xmm7             ; transpose coefficients(phase 2)\n        punpckldq xmm7,xmm0             ; xmm7=(44 45 46 47 54 55 56 57)\n        punpckhdq xmm3,xmm0             ; xmm3=(64 65 66 67 74 75 76 77)\n\n        movdqa  xmm6, XMMWORD [wk(0)]   ; xmm6=(02 03 12 13 22 23 32 33)\n        movdqa  xmm0, XMMWORD [wk(1)]   ; xmm0=(42 43 52 53 62 63 72 73)\n        movdqa  XMMWORD [wk(0)], xmm2   ; wk(0)=(24 25 26 27 34 35 36 37)\n        movdqa  XMMWORD [wk(1)], xmm7   ; wk(1)=(44 45 46 47 54 55 56 57)\n\n        movdqa    xmm2,xmm1             ; transpose coefficients(phase 2)\n        punpckldq xmm1,xmm6             ; xmm1=(00 01 02 03 10 11 12 13)\n        punpckhdq xmm2,xmm6             ; xmm2=(20 21 22 23 30 31 32 33)\n        movdqa    xmm7,xmm4             ; transpose coefficients(phase 2)\n        punpckldq xmm4,xmm0             ; xmm4=(40 41 42 43 50 51 52 53)\n        punpckhdq xmm7,xmm0             ; xmm7=(60 61 62 63 70 71 72 73)\n\n        movdqa     xmm6,xmm1            ; transpose coefficients(phase 3)\n        punpcklqdq xmm1,xmm5            ; xmm1=(00 01 02 03 04 05 06 07)=data0\n        punpckhqdq xmm6,xmm5            ; xmm6=(10 11 12 13 14 15 16 17)=data1\n        movdqa     xmm0,xmm7            ; transpose coefficients(phase 3)\n        punpcklqdq xmm7,xmm3            ; xmm7=(60 61 62 63 64 65 66 67)=data6\n        punpckhqdq xmm0,xmm3            ; xmm0=(70 71 72 73 74 75 76 77)=data7\n\n        movdqa  xmm5,xmm6\n        movdqa  xmm3,xmm1\n        psubw   xmm6,xmm7               ; xmm6=data1-data6=tmp6\n        psubw   xmm1,xmm0               ; xmm1=data0-data7=tmp7\n        paddw   xmm5,xmm7               ; xmm5=data1+data6=tmp1\n        paddw   xmm3,xmm0               ; xmm3=data0+data7=tmp0\n\n        movdqa  xmm7, XMMWORD [wk(0)]   ; xmm7=(24 25 26 27 34 35 36 37)\n        movdqa  xmm0, XMMWORD [wk(1)]   ; xmm0=(44 45 46 47 54 55 56 57)\n        movdqa  XMMWORD [wk(0)], xmm6   ; wk(0)=tmp6\n        movdqa  XMMWORD [wk(1)], xmm1   ; wk(1)=tmp7\n\n        movdqa     xmm6,xmm2            ; transpose coefficients(phase 3)\n        punpcklqdq xmm2,xmm7            ; xmm2=(20 21 22 23 24 25 26 27)=data2\n        punpckhqdq xmm6,xmm7            ; xmm6=(30 31 32 33 34 35 36 37)=data3\n        movdqa     xmm1,xmm4            ; transpose coefficients(phase 3)\n        punpcklqdq xmm4,xmm0            ; xmm4=(40 41 42 43 44 45 46 47)=data4\n        punpckhqdq xmm1,xmm0            ; xmm1=(50 51 52 53 54 55 56 57)=data5\n\n        movdqa  xmm7,xmm6\n        movdqa  xmm0,xmm2\n        paddw   xmm6,xmm4               ; xmm6=data3+data4=tmp3\n        paddw   xmm2,xmm1               ; xmm2=data2+data5=tmp2\n        psubw   xmm7,xmm4               ; xmm7=data3-data4=tmp4\n        psubw   xmm0,xmm1               ; xmm0=data2-data5=tmp5\n\n        ; -- Even part\n\n        movdqa  xmm4,xmm3\n        movdqa  xmm1,xmm5\n        psubw   xmm3,xmm6               ; xmm3=tmp13\n        psubw   xmm5,xmm2               ; xmm5=tmp12\n        paddw   xmm4,xmm6               ; xmm4=tmp10\n        paddw   xmm1,xmm2               ; xmm1=tmp11\n\n        paddw   xmm5,xmm3\n        psllw   xmm5,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm5,[GOTOFF(ebx,PW_F0707)] ; xmm5=z1\n\n        movdqa  xmm6,xmm4\n        movdqa  xmm2,xmm3\n        psubw   xmm4,xmm1               ; xmm4=data4\n        psubw   xmm3,xmm5               ; xmm3=data6\n        paddw   xmm6,xmm1               ; xmm6=data0\n        paddw   xmm2,xmm5               ; xmm2=data2\n\n        movdqa  XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_DCTELEM)], xmm4\n        movdqa  XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_DCTELEM)], xmm3\n        movdqa  XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_DCTELEM)], xmm6\n        movdqa  XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_DCTELEM)], xmm2\n\n        ; -- Odd part\n\n        movdqa  xmm1, XMMWORD [wk(0)]   ; xmm1=tmp6\n        movdqa  xmm5, XMMWORD [wk(1)]   ; xmm5=tmp7\n\n        paddw   xmm7,xmm0               ; xmm7=tmp10\n        paddw   xmm0,xmm1               ; xmm0=tmp11\n        paddw   xmm1,xmm5               ; xmm1=tmp12, xmm5=tmp7\n\n        psllw   xmm7,PRE_MULTIPLY_SCALE_BITS\n        psllw   xmm1,PRE_MULTIPLY_SCALE_BITS\n\n        psllw   xmm0,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm0,[GOTOFF(ebx,PW_F0707)] ; xmm0=z3\n\n        movdqa  xmm4,xmm7               ; xmm4=tmp10\n        psubw   xmm7,xmm1\n        pmulhw  xmm7,[GOTOFF(ebx,PW_F0382)] ; xmm7=z5\n        pmulhw  xmm4,[GOTOFF(ebx,PW_F0541)] ; xmm4=MULTIPLY(tmp10,FIX_0_541196)\n        pmulhw  xmm1,[GOTOFF(ebx,PW_F1306)] ; xmm1=MULTIPLY(tmp12,FIX_1_306562)\n        paddw   xmm4,xmm7               ; xmm4=z2\n        paddw   xmm1,xmm7               ; xmm1=z4\n\n        movdqa  xmm3,xmm5\n        psubw   xmm5,xmm0               ; xmm5=z13\n        paddw   xmm3,xmm0               ; xmm3=z11\n\n        movdqa  xmm6,xmm5\n        movdqa  xmm2,xmm3\n        psubw   xmm5,xmm4               ; xmm5=data3\n        psubw   xmm3,xmm1               ; xmm3=data7\n        paddw   xmm6,xmm4               ; xmm6=data5\n        paddw   xmm2,xmm1               ; xmm2=data1\n\n        movdqa  XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_DCTELEM)], xmm5\n        movdqa  XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_DCTELEM)], xmm3\n        movdqa  XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_DCTELEM)], xmm6\n        movdqa  XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_DCTELEM)], xmm2\n\n;       pop     edi             ; unused\n;       pop     esi             ; unused\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; unused\n        poppic  ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jfdctint-altivec.c",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2014, D. R. Commander.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n/* SLOW INTEGER FORWARD DCT */\n\n#include \"jsimd_altivec.h\"\n\n\n#define F_0_298 2446   /* FIX(0.298631336) */\n#define F_0_390 3196   /* FIX(0.390180644) */\n#define F_0_541 4433   /* FIX(0.541196100) */\n#define F_0_765 6270   /* FIX(0.765366865) */\n#define F_0_899 7373   /* FIX(0.899976223) */\n#define F_1_175 9633   /* FIX(1.175875602) */\n#define F_1_501 12299  /* FIX(1.501321110) */\n#define F_1_847 15137  /* FIX(1.847759065) */\n#define F_1_961 16069  /* FIX(1.961570560) */\n#define F_2_053 16819  /* FIX(2.053119869) */\n#define F_2_562 20995  /* FIX(2.562915447) */\n#define F_3_072 25172  /* FIX(3.072711026) */\n\n#define CONST_BITS 13\n#define PASS1_BITS 2\n#define DESCALE_P1 (CONST_BITS - PASS1_BITS)\n#define DESCALE_P2 (CONST_BITS + PASS1_BITS)\n\n\n#define DO_FDCT_COMMON(PASS)  \\\n{  \\\n  /* (Original)  \\\n   * z1 = (tmp12 + tmp13) * 0.541196100;  \\\n   * data2 = z1 + tmp13 * 0.765366865;  \\\n   * data6 = z1 + tmp12 * -1.847759065;  \\\n   *  \\\n   * (This implementation)  \\\n   * data2 = tmp13 * (0.541196100 + 0.765366865) + tmp12 * 0.541196100;  \\\n   * data6 = tmp13 * 0.541196100 + tmp12 * (0.541196100 - 1.847759065);  \\\n   */  \\\n  \\\n  tmp1312l = vec_mergeh(tmp13, tmp12);  \\\n  tmp1312h = vec_mergel(tmp13, tmp12);  \\\n  \\\n  out2l = vec_msums(tmp1312l, pw_f130_f054, pd_descale_p##PASS);  \\\n  out2h = vec_msums(tmp1312h, pw_f130_f054, pd_descale_p##PASS);  \\\n  out6l = vec_msums(tmp1312l, pw_f054_mf130, pd_descale_p##PASS);  \\\n  out6h = vec_msums(tmp1312h, pw_f054_mf130, pd_descale_p##PASS);  \\\n  \\\n  out2l = vec_sra(out2l, descale_p##PASS);  \\\n  out2h = vec_sra(out2h, descale_p##PASS);  \\\n  out6l = vec_sra(out6l, descale_p##PASS);  \\\n  out6h = vec_sra(out6h, descale_p##PASS);  \\\n  \\\n  out2 = vec_pack(out2l, out2h);  \\\n  out6 = vec_pack(out6l, out6h);  \\\n  \\\n  /* Odd part */  \\\n  \\\n  z3 = vec_add(tmp4, tmp6);  \\\n  z4 = vec_add(tmp5, tmp7);  \\\n  \\\n  /* (Original)  \\\n   * z5 = (z3 + z4) * 1.175875602;  \\\n   * z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;  \\\n   * z3 += z5;  z4 += z5;  \\\n   *  \\\n   * (This implementation)  \\\n   * z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;  \\\n   * z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);  \\\n   */  \\\n  \\\n  z34l = vec_mergeh(z3, z4);  \\\n  z34h = vec_mergel(z3, z4);  \\\n  \\\n  z3l = vec_msums(z34l, pw_mf078_f117, pd_descale_p##PASS);  \\\n  z3h = vec_msums(z34h, pw_mf078_f117, pd_descale_p##PASS);  \\\n  z4l = vec_msums(z34l, pw_f117_f078, pd_descale_p##PASS);  \\\n  z4h = vec_msums(z34h, pw_f117_f078, pd_descale_p##PASS);  \\\n  \\\n  /* (Original)  \\\n   * z1 = tmp4 + tmp7;  z2 = tmp5 + tmp6;  \\\n   * tmp4 = tmp4 * 0.298631336;  tmp5 = tmp5 * 2.053119869;  \\\n   * tmp6 = tmp6 * 3.072711026;  tmp7 = tmp7 * 1.501321110;  \\\n   * z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;  \\\n   * data7 = tmp4 + z1 + z3;  data5 = tmp5 + z2 + z4;  \\\n   * data3 = tmp6 + z2 + z3;  data1 = tmp7 + z1 + z4;  \\\n   *  \\\n   * (This implementation)  \\\n   * tmp4 = tmp4 * (0.298631336 - 0.899976223) + tmp7 * -0.899976223;  \\\n   * tmp5 = tmp5 * (2.053119869 - 2.562915447) + tmp6 * -2.562915447;  \\\n   * tmp6 = tmp5 * -2.562915447 + tmp6 * (3.072711026 - 2.562915447);  \\\n   * tmp7 = tmp4 * -0.899976223 + tmp7 * (1.501321110 - 0.899976223);  \\\n   * data7 = tmp4 + z3;  data5 = tmp5 + z4;  \\\n   * data3 = tmp6 + z3;  data1 = tmp7 + z4;  \\\n   */  \\\n  \\\n  tmp47l = vec_mergeh(tmp4, tmp7);  \\\n  tmp47h = vec_mergel(tmp4, tmp7);  \\\n  \\\n  out7l = vec_msums(tmp47l, pw_mf060_mf089, z3l);  \\\n  out7h = vec_msums(tmp47h, pw_mf060_mf089, z3h);  \\\n  out1l = vec_msums(tmp47l, pw_mf089_f060, z4l);  \\\n  out1h = vec_msums(tmp47h, pw_mf089_f060, z4h);  \\\n  \\\n  out7l = vec_sra(out7l, descale_p##PASS);  \\\n  out7h = vec_sra(out7h, descale_p##PASS);  \\\n  out1l = vec_sra(out1l, descale_p##PASS);  \\\n  out1h = vec_sra(out1h, descale_p##PASS);  \\\n  \\\n  out7 = vec_pack(out7l, out7h);  \\\n  out1 = vec_pack(out1l, out1h);  \\\n  \\\n  tmp56l = vec_mergeh(tmp5, tmp6);  \\\n  tmp56h = vec_mergel(tmp5, tmp6);  \\\n  \\\n  out5l = vec_msums(tmp56l, pw_mf050_mf256, z4l);  \\\n  out5h = vec_msums(tmp56h, pw_mf050_mf256, z4h);  \\\n  out3l = vec_msums(tmp56l, pw_mf256_f050, z3l);  \\\n  out3h = vec_msums(tmp56h, pw_mf256_f050, z3h);  \\\n  \\\n  out5l = vec_sra(out5l, descale_p##PASS);  \\\n  out5h = vec_sra(out5h, descale_p##PASS);  \\\n  out3l = vec_sra(out3l, descale_p##PASS);  \\\n  out3h = vec_sra(out3h, descale_p##PASS);  \\\n  \\\n  out5 = vec_pack(out5l, out5h);  \\\n  out3 = vec_pack(out3l, out3h);  \\\n}\n\n#define DO_FDCT_PASS1()  \\\n{  \\\n  /* Even part */  \\\n  \\\n  tmp10 = vec_add(tmp0, tmp3);  \\\n  tmp13 = vec_sub(tmp0, tmp3);  \\\n  tmp11 = vec_add(tmp1, tmp2);  \\\n  tmp12 = vec_sub(tmp1, tmp2);  \\\n  \\\n  out0  = vec_add(tmp10, tmp11);  \\\n  out0  = vec_sl(out0, pass1_bits);  \\\n  out4  = vec_sub(tmp10, tmp11);  \\\n  out4  = vec_sl(out4, pass1_bits);  \\\n  \\\n  DO_FDCT_COMMON(1);  \\\n}\n\n#define DO_FDCT_PASS2()  \\\n{  \\\n  /* Even part */  \\\n  \\\n  tmp10 = vec_add(tmp0, tmp3);  \\\n  tmp13 = vec_sub(tmp0, tmp3);  \\\n  tmp11 = vec_add(tmp1, tmp2);  \\\n  tmp12 = vec_sub(tmp1, tmp2);  \\\n  \\\n  out0  = vec_add(tmp10, tmp11);  \\\n  out0  = vec_add(out0, pw_descale_p2x);  \\\n  out0  = vec_sra(out0, pass1_bits);  \\\n  out4  = vec_sub(tmp10, tmp11);  \\\n  out4  = vec_add(out4, pw_descale_p2x);  \\\n  out4  = vec_sra(out4, pass1_bits);  \\\n  \\\n  DO_FDCT_COMMON(2);  \\\n}\n\n\nvoid\njsimd_fdct_islow_altivec (DCTELEM *data)\n{\n  __vector short row0, row1, row2, row3, row4, row5, row6, row7,\n    col0, col1, col2, col3, col4, col5, col6, col7,\n    tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13,\n    tmp47l, tmp47h, tmp56l, tmp56h, tmp1312l, tmp1312h,\n    z3, z4, z34l, z34h,\n    out0, out1, out2, out3, out4, out5, out6, out7;\n  __vector int z3l, z3h, z4l, z4h,\n    out1l, out1h, out2l, out2h, out3l, out3h, out5l, out5h, out6l, out6h,\n    out7l, out7h;\n\n  /* Constants */\n  __vector short\n    pw_f130_f054 = { __4X2(F_0_541 + F_0_765, F_0_541) },\n    pw_f054_mf130 = { __4X2(F_0_541, F_0_541 - F_1_847) },\n    pw_mf078_f117 = { __4X2(F_1_175 - F_1_961, F_1_175) },\n    pw_f117_f078 = { __4X2(F_1_175, F_1_175 - F_0_390) },\n    pw_mf060_mf089 = { __4X2(F_0_298 - F_0_899, -F_0_899) },\n    pw_mf089_f060 = { __4X2(-F_0_899, F_1_501 - F_0_899) },\n    pw_mf050_mf256 = { __4X2(F_2_053 - F_2_562, -F_2_562) },\n    pw_mf256_f050 = { __4X2(-F_2_562, F_3_072 - F_2_562) },\n    pw_descale_p2x = { __8X(1 << (PASS1_BITS - 1)) };\n  __vector unsigned short pass1_bits = { __8X(PASS1_BITS) };\n  __vector int pd_descale_p1 = { __4X(1 << (DESCALE_P1 - 1)) },\n    pd_descale_p2 = { __4X(1 << (DESCALE_P2 - 1)) };\n  __vector unsigned int descale_p1 = { __4X(DESCALE_P1) },\n    descale_p2 = { __4X(DESCALE_P2) };\n\n  /* Pass 1: process rows */\n\n  row0 = vec_ld(0, data);\n  row1 = vec_ld(16, data);\n  row2 = vec_ld(32, data);\n  row3 = vec_ld(48, data);\n  row4 = vec_ld(64, data);\n  row5 = vec_ld(80, data);\n  row6 = vec_ld(96, data);\n  row7 = vec_ld(112, data);\n\n  TRANSPOSE(row, col);\n\n  tmp0 = vec_add(col0, col7);\n  tmp7 = vec_sub(col0, col7);\n  tmp1 = vec_add(col1, col6);\n  tmp6 = vec_sub(col1, col6);\n  tmp2 = vec_add(col2, col5);\n  tmp5 = vec_sub(col2, col5);\n  tmp3 = vec_add(col3, col4);\n  tmp4 = vec_sub(col3, col4);\n\n  DO_FDCT_PASS1();\n\n  /* Pass 2: process columns */\n\n  TRANSPOSE(out, row);\n\n  tmp0 = vec_add(row0, row7);\n  tmp7 = vec_sub(row0, row7);\n  tmp1 = vec_add(row1, row6);\n  tmp6 = vec_sub(row1, row6);\n  tmp2 = vec_add(row2, row5);\n  tmp5 = vec_sub(row2, row5);\n  tmp3 = vec_add(row3, row4);\n  tmp4 = vec_sub(row3, row4);\n\n  DO_FDCT_PASS2();\n\n  vec_st(out0, 0, data);\n  vec_st(out1, 16, data);\n  vec_st(out2, 32, data);\n  vec_st(out3, 48, data);\n  vec_st(out4, 64, data);\n  vec_st(out5, 80, data);\n  vec_st(out6, 96, data);\n  vec_st(out7, 112, data);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jfdctint-mmx.asm",
    "content": ";\n; jfdctint.asm - accurate integer FDCT (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a slow-but-accurate integer implementation of the\n; forward DCT (Discrete Cosine Transform). The following code is based\n; directly on the IJG's original jfdctint.c; see the jfdctint.c for\n; more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS      13\n%define PASS1_BITS      2\n\n%define DESCALE_P1      (CONST_BITS-PASS1_BITS)\n%define DESCALE_P2      (CONST_BITS+PASS1_BITS)\n\n%if CONST_BITS == 13\nF_0_298 equ      2446           ; FIX(0.298631336)\nF_0_390 equ      3196           ; FIX(0.390180644)\nF_0_541 equ      4433           ; FIX(0.541196100)\nF_0_765 equ      6270           ; FIX(0.765366865)\nF_0_899 equ      7373           ; FIX(0.899976223)\nF_1_175 equ      9633           ; FIX(1.175875602)\nF_1_501 equ     12299           ; FIX(1.501321110)\nF_1_847 equ     15137           ; FIX(1.847759065)\nF_1_961 equ     16069           ; FIX(1.961570560)\nF_2_053 equ     16819           ; FIX(2.053119869)\nF_2_562 equ     20995           ; FIX(2.562915447)\nF_3_072 equ     25172           ; FIX(3.072711026)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_298 equ     DESCALE( 320652955,30-CONST_BITS)       ; FIX(0.298631336)\nF_0_390 equ     DESCALE( 418953276,30-CONST_BITS)       ; FIX(0.390180644)\nF_0_541 equ     DESCALE( 581104887,30-CONST_BITS)       ; FIX(0.541196100)\nF_0_765 equ     DESCALE( 821806413,30-CONST_BITS)       ; FIX(0.765366865)\nF_0_899 equ     DESCALE( 966342111,30-CONST_BITS)       ; FIX(0.899976223)\nF_1_175 equ     DESCALE(1262586813,30-CONST_BITS)       ; FIX(1.175875602)\nF_1_501 equ     DESCALE(1612031267,30-CONST_BITS)       ; FIX(1.501321110)\nF_1_847 equ     DESCALE(1984016188,30-CONST_BITS)       ; FIX(1.847759065)\nF_1_961 equ     DESCALE(2106220350,30-CONST_BITS)       ; FIX(1.961570560)\nF_2_053 equ     DESCALE(2204520673,30-CONST_BITS)       ; FIX(2.053119869)\nF_2_562 equ     DESCALE(2751909506,30-CONST_BITS)       ; FIX(2.562915447)\nF_3_072 equ     DESCALE(3299298341,30-CONST_BITS)       ; FIX(3.072711026)\n%endif\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_fdct_islow_mmx)\n\nEXTN(jconst_fdct_islow_mmx):\n\nPW_F130_F054    times 2 dw  (F_0_541+F_0_765), F_0_541\nPW_F054_MF130   times 2 dw  F_0_541, (F_0_541-F_1_847)\nPW_MF078_F117   times 2 dw  (F_1_175-F_1_961), F_1_175\nPW_F117_F078    times 2 dw  F_1_175, (F_1_175-F_0_390)\nPW_MF060_MF089  times 2 dw  (F_0_298-F_0_899),-F_0_899\nPW_MF089_F060   times 2 dw -F_0_899, (F_1_501-F_0_899)\nPW_MF050_MF256  times 2 dw  (F_2_053-F_2_562),-F_2_562\nPW_MF256_F050   times 2 dw -F_2_562, (F_3_072-F_2_562)\nPD_DESCALE_P1   times 2 dd  1 << (DESCALE_P1-1)\nPD_DESCALE_P2   times 2 dd  1 << (DESCALE_P2-1)\nPW_DESCALE_P2X  times 4 dw  1 << (PASS1_BITS-1)\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_islow_mmx (DCTELEM *data)\n;\n\n%define data(b)         (b)+8           ; DCTELEM *data\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_MMWORD  ; mmword wk[WK_NUM]\n%define WK_NUM          2\n\n        align   16\n        global  EXTN(jsimd_fdct_islow_mmx)\n\nEXTN(jsimd_fdct_islow_mmx):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_MMWORD)      ; align to 64 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n;       push    esi             ; unused\n;       push    edi             ; unused\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process rows.\n\n        mov     edx, POINTER [data(eax)]        ; (DCTELEM *)\n        mov     ecx, DCTSIZE/4\n        alignx  16,7\n.rowloop:\n\n        movq    mm0, MMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)]\n        movq    mm1, MMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)]\n        movq    mm2, MMWORD [MMBLOCK(2,1,edx,SIZEOF_DCTELEM)]\n        movq    mm3, MMWORD [MMBLOCK(3,1,edx,SIZEOF_DCTELEM)]\n\n        ; mm0=(20 21 22 23), mm2=(24 25 26 27)\n        ; mm1=(30 31 32 33), mm3=(34 35 36 37)\n\n        movq      mm4,mm0               ; transpose coefficients(phase 1)\n        punpcklwd mm0,mm1               ; mm0=(20 30 21 31)\n        punpckhwd mm4,mm1               ; mm4=(22 32 23 33)\n        movq      mm5,mm2               ; transpose coefficients(phase 1)\n        punpcklwd mm2,mm3               ; mm2=(24 34 25 35)\n        punpckhwd mm5,mm3               ; mm5=(26 36 27 37)\n\n        movq    mm6, MMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)]\n        movq    mm7, MMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)]\n        movq    mm1, MMWORD [MMBLOCK(0,1,edx,SIZEOF_DCTELEM)]\n        movq    mm3, MMWORD [MMBLOCK(1,1,edx,SIZEOF_DCTELEM)]\n\n        ; mm6=(00 01 02 03), mm1=(04 05 06 07)\n        ; mm7=(10 11 12 13), mm3=(14 15 16 17)\n\n        movq    MMWORD [wk(0)], mm4     ; wk(0)=(22 32 23 33)\n        movq    MMWORD [wk(1)], mm2     ; wk(1)=(24 34 25 35)\n\n        movq      mm4,mm6               ; transpose coefficients(phase 1)\n        punpcklwd mm6,mm7               ; mm6=(00 10 01 11)\n        punpckhwd mm4,mm7               ; mm4=(02 12 03 13)\n        movq      mm2,mm1               ; transpose coefficients(phase 1)\n        punpcklwd mm1,mm3               ; mm1=(04 14 05 15)\n        punpckhwd mm2,mm3               ; mm2=(06 16 07 17)\n\n        movq      mm7,mm6               ; transpose coefficients(phase 2)\n        punpckldq mm6,mm0               ; mm6=(00 10 20 30)=data0\n        punpckhdq mm7,mm0               ; mm7=(01 11 21 31)=data1\n        movq      mm3,mm2               ; transpose coefficients(phase 2)\n        punpckldq mm2,mm5               ; mm2=(06 16 26 36)=data6\n        punpckhdq mm3,mm5               ; mm3=(07 17 27 37)=data7\n\n        movq    mm0,mm7\n        movq    mm5,mm6\n        psubw   mm7,mm2                 ; mm7=data1-data6=tmp6\n        psubw   mm6,mm3                 ; mm6=data0-data7=tmp7\n        paddw   mm0,mm2                 ; mm0=data1+data6=tmp1\n        paddw   mm5,mm3                 ; mm5=data0+data7=tmp0\n\n        movq    mm2, MMWORD [wk(0)]     ; mm2=(22 32 23 33)\n        movq    mm3, MMWORD [wk(1)]     ; mm3=(24 34 25 35)\n        movq    MMWORD [wk(0)], mm7     ; wk(0)=tmp6\n        movq    MMWORD [wk(1)], mm6     ; wk(1)=tmp7\n\n        movq      mm7,mm4               ; transpose coefficients(phase 2)\n        punpckldq mm4,mm2               ; mm4=(02 12 22 32)=data2\n        punpckhdq mm7,mm2               ; mm7=(03 13 23 33)=data3\n        movq      mm6,mm1               ; transpose coefficients(phase 2)\n        punpckldq mm1,mm3               ; mm1=(04 14 24 34)=data4\n        punpckhdq mm6,mm3               ; mm6=(05 15 25 35)=data5\n\n        movq    mm2,mm7\n        movq    mm3,mm4\n        paddw   mm7,mm1                 ; mm7=data3+data4=tmp3\n        paddw   mm4,mm6                 ; mm4=data2+data5=tmp2\n        psubw   mm2,mm1                 ; mm2=data3-data4=tmp4\n        psubw   mm3,mm6                 ; mm3=data2-data5=tmp5\n\n        ; -- Even part\n\n        movq    mm1,mm5\n        movq    mm6,mm0\n        paddw   mm5,mm7                 ; mm5=tmp10\n        paddw   mm0,mm4                 ; mm0=tmp11\n        psubw   mm1,mm7                 ; mm1=tmp13\n        psubw   mm6,mm4                 ; mm6=tmp12\n\n        movq    mm7,mm5\n        paddw   mm5,mm0                 ; mm5=tmp10+tmp11\n        psubw   mm7,mm0                 ; mm7=tmp10-tmp11\n\n        psllw   mm5,PASS1_BITS          ; mm5=data0\n        psllw   mm7,PASS1_BITS          ; mm7=data4\n\n        movq    MMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)], mm5\n        movq    MMWORD [MMBLOCK(0,1,edx,SIZEOF_DCTELEM)], mm7\n\n        ; (Original)\n        ; z1 = (tmp12 + tmp13) * 0.541196100;\n        ; data2 = z1 + tmp13 * 0.765366865;\n        ; data6 = z1 + tmp12 * -1.847759065;\n        ;\n        ; (This implementation)\n        ; data2 = tmp13 * (0.541196100 + 0.765366865) + tmp12 * 0.541196100;\n        ; data6 = tmp13 * 0.541196100 + tmp12 * (0.541196100 - 1.847759065);\n\n        movq      mm4,mm1               ; mm1=tmp13\n        movq      mm0,mm1\n        punpcklwd mm4,mm6               ; mm6=tmp12\n        punpckhwd mm0,mm6\n        movq      mm1,mm4\n        movq      mm6,mm0\n        pmaddwd   mm4,[GOTOFF(ebx,PW_F130_F054)]        ; mm4=data2L\n        pmaddwd   mm0,[GOTOFF(ebx,PW_F130_F054)]        ; mm0=data2H\n        pmaddwd   mm1,[GOTOFF(ebx,PW_F054_MF130)]       ; mm1=data6L\n        pmaddwd   mm6,[GOTOFF(ebx,PW_F054_MF130)]       ; mm6=data6H\n\n        paddd   mm4,[GOTOFF(ebx,PD_DESCALE_P1)]\n        paddd   mm0,[GOTOFF(ebx,PD_DESCALE_P1)]\n        psrad   mm4,DESCALE_P1\n        psrad   mm0,DESCALE_P1\n        paddd   mm1,[GOTOFF(ebx,PD_DESCALE_P1)]\n        paddd   mm6,[GOTOFF(ebx,PD_DESCALE_P1)]\n        psrad   mm1,DESCALE_P1\n        psrad   mm6,DESCALE_P1\n\n        packssdw  mm4,mm0               ; mm4=data2\n        packssdw  mm1,mm6               ; mm1=data6\n\n        movq    MMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)], mm4\n        movq    MMWORD [MMBLOCK(2,1,edx,SIZEOF_DCTELEM)], mm1\n\n        ; -- Odd part\n\n        movq    mm5, MMWORD [wk(0)]     ; mm5=tmp6\n        movq    mm7, MMWORD [wk(1)]     ; mm7=tmp7\n\n        movq    mm0,mm2                 ; mm2=tmp4\n        movq    mm6,mm3                 ; mm3=tmp5\n        paddw   mm0,mm5                 ; mm0=z3\n        paddw   mm6,mm7                 ; mm6=z4\n\n        ; (Original)\n        ; z5 = (z3 + z4) * 1.175875602;\n        ; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n        ; z3 += z5;  z4 += z5;\n        ;\n        ; (This implementation)\n        ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n        ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n        movq      mm4,mm0\n        movq      mm1,mm0\n        punpcklwd mm4,mm6\n        punpckhwd mm1,mm6\n        movq      mm0,mm4\n        movq      mm6,mm1\n        pmaddwd   mm4,[GOTOFF(ebx,PW_MF078_F117)]       ; mm4=z3L\n        pmaddwd   mm1,[GOTOFF(ebx,PW_MF078_F117)]       ; mm1=z3H\n        pmaddwd   mm0,[GOTOFF(ebx,PW_F117_F078)]        ; mm0=z4L\n        pmaddwd   mm6,[GOTOFF(ebx,PW_F117_F078)]        ; mm6=z4H\n\n        movq    MMWORD [wk(0)], mm4     ; wk(0)=z3L\n        movq    MMWORD [wk(1)], mm1     ; wk(1)=z3H\n\n        ; (Original)\n        ; z1 = tmp4 + tmp7;  z2 = tmp5 + tmp6;\n        ; tmp4 = tmp4 * 0.298631336;  tmp5 = tmp5 * 2.053119869;\n        ; tmp6 = tmp6 * 3.072711026;  tmp7 = tmp7 * 1.501321110;\n        ; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n        ; data7 = tmp4 + z1 + z3;  data5 = tmp5 + z2 + z4;\n        ; data3 = tmp6 + z2 + z3;  data1 = tmp7 + z1 + z4;\n        ;\n        ; (This implementation)\n        ; tmp4 = tmp4 * (0.298631336 - 0.899976223) + tmp7 * -0.899976223;\n        ; tmp5 = tmp5 * (2.053119869 - 2.562915447) + tmp6 * -2.562915447;\n        ; tmp6 = tmp5 * -2.562915447 + tmp6 * (3.072711026 - 2.562915447);\n        ; tmp7 = tmp4 * -0.899976223 + tmp7 * (1.501321110 - 0.899976223);\n        ; data7 = tmp4 + z3;  data5 = tmp5 + z4;\n        ; data3 = tmp6 + z3;  data1 = tmp7 + z4;\n\n        movq      mm4,mm2\n        movq      mm1,mm2\n        punpcklwd mm4,mm7\n        punpckhwd mm1,mm7\n        movq      mm2,mm4\n        movq      mm7,mm1\n        pmaddwd   mm4,[GOTOFF(ebx,PW_MF060_MF089)]      ; mm4=tmp4L\n        pmaddwd   mm1,[GOTOFF(ebx,PW_MF060_MF089)]      ; mm1=tmp4H\n        pmaddwd   mm2,[GOTOFF(ebx,PW_MF089_F060)]       ; mm2=tmp7L\n        pmaddwd   mm7,[GOTOFF(ebx,PW_MF089_F060)]       ; mm7=tmp7H\n\n        paddd   mm4, MMWORD [wk(0)]     ; mm4=data7L\n        paddd   mm1, MMWORD [wk(1)]     ; mm1=data7H\n        paddd   mm2,mm0                 ; mm2=data1L\n        paddd   mm7,mm6                 ; mm7=data1H\n\n        paddd   mm4,[GOTOFF(ebx,PD_DESCALE_P1)]\n        paddd   mm1,[GOTOFF(ebx,PD_DESCALE_P1)]\n        psrad   mm4,DESCALE_P1\n        psrad   mm1,DESCALE_P1\n        paddd   mm2,[GOTOFF(ebx,PD_DESCALE_P1)]\n        paddd   mm7,[GOTOFF(ebx,PD_DESCALE_P1)]\n        psrad   mm2,DESCALE_P1\n        psrad   mm7,DESCALE_P1\n\n        packssdw  mm4,mm1               ; mm4=data7\n        packssdw  mm2,mm7               ; mm2=data1\n\n        movq    MMWORD [MMBLOCK(3,1,edx,SIZEOF_DCTELEM)], mm4\n        movq    MMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)], mm2\n\n        movq      mm1,mm3\n        movq      mm7,mm3\n        punpcklwd mm1,mm5\n        punpckhwd mm7,mm5\n        movq      mm3,mm1\n        movq      mm5,mm7\n        pmaddwd   mm1,[GOTOFF(ebx,PW_MF050_MF256)]      ; mm1=tmp5L\n        pmaddwd   mm7,[GOTOFF(ebx,PW_MF050_MF256)]      ; mm7=tmp5H\n        pmaddwd   mm3,[GOTOFF(ebx,PW_MF256_F050)]       ; mm3=tmp6L\n        pmaddwd   mm5,[GOTOFF(ebx,PW_MF256_F050)]       ; mm5=tmp6H\n\n        paddd   mm1,mm0                 ; mm1=data5L\n        paddd   mm7,mm6                 ; mm7=data5H\n        paddd   mm3, MMWORD [wk(0)]     ; mm3=data3L\n        paddd   mm5, MMWORD [wk(1)]     ; mm5=data3H\n\n        paddd   mm1,[GOTOFF(ebx,PD_DESCALE_P1)]\n        paddd   mm7,[GOTOFF(ebx,PD_DESCALE_P1)]\n        psrad   mm1,DESCALE_P1\n        psrad   mm7,DESCALE_P1\n        paddd   mm3,[GOTOFF(ebx,PD_DESCALE_P1)]\n        paddd   mm5,[GOTOFF(ebx,PD_DESCALE_P1)]\n        psrad   mm3,DESCALE_P1\n        psrad   mm5,DESCALE_P1\n\n        packssdw  mm1,mm7               ; mm1=data5\n        packssdw  mm3,mm5               ; mm3=data3\n\n        movq    MMWORD [MMBLOCK(1,1,edx,SIZEOF_DCTELEM)], mm1\n        movq    MMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)], mm3\n\n        add     edx, byte 4*DCTSIZE*SIZEOF_DCTELEM\n        dec     ecx\n        jnz     near .rowloop\n\n        ; ---- Pass 2: process columns.\n\n        mov     edx, POINTER [data(eax)]        ; (DCTELEM *)\n        mov     ecx, DCTSIZE/4\n        alignx  16,7\n.columnloop:\n\n        movq    mm0, MMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)]\n        movq    mm1, MMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)]\n        movq    mm2, MMWORD [MMBLOCK(6,0,edx,SIZEOF_DCTELEM)]\n        movq    mm3, MMWORD [MMBLOCK(7,0,edx,SIZEOF_DCTELEM)]\n\n        ; mm0=(02 12 22 32), mm2=(42 52 62 72)\n        ; mm1=(03 13 23 33), mm3=(43 53 63 73)\n\n        movq      mm4,mm0               ; transpose coefficients(phase 1)\n        punpcklwd mm0,mm1               ; mm0=(02 03 12 13)\n        punpckhwd mm4,mm1               ; mm4=(22 23 32 33)\n        movq      mm5,mm2               ; transpose coefficients(phase 1)\n        punpcklwd mm2,mm3               ; mm2=(42 43 52 53)\n        punpckhwd mm5,mm3               ; mm5=(62 63 72 73)\n\n        movq    mm6, MMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)]\n        movq    mm7, MMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)]\n        movq    mm1, MMWORD [MMBLOCK(4,0,edx,SIZEOF_DCTELEM)]\n        movq    mm3, MMWORD [MMBLOCK(5,0,edx,SIZEOF_DCTELEM)]\n\n        ; mm6=(00 10 20 30), mm1=(40 50 60 70)\n        ; mm7=(01 11 21 31), mm3=(41 51 61 71)\n\n        movq    MMWORD [wk(0)], mm4     ; wk(0)=(22 23 32 33)\n        movq    MMWORD [wk(1)], mm2     ; wk(1)=(42 43 52 53)\n\n        movq      mm4,mm6               ; transpose coefficients(phase 1)\n        punpcklwd mm6,mm7               ; mm6=(00 01 10 11)\n        punpckhwd mm4,mm7               ; mm4=(20 21 30 31)\n        movq      mm2,mm1               ; transpose coefficients(phase 1)\n        punpcklwd mm1,mm3               ; mm1=(40 41 50 51)\n        punpckhwd mm2,mm3               ; mm2=(60 61 70 71)\n\n        movq      mm7,mm6               ; transpose coefficients(phase 2)\n        punpckldq mm6,mm0               ; mm6=(00 01 02 03)=data0\n        punpckhdq mm7,mm0               ; mm7=(10 11 12 13)=data1\n        movq      mm3,mm2               ; transpose coefficients(phase 2)\n        punpckldq mm2,mm5               ; mm2=(60 61 62 63)=data6\n        punpckhdq mm3,mm5               ; mm3=(70 71 72 73)=data7\n\n        movq    mm0,mm7\n        movq    mm5,mm6\n        psubw   mm7,mm2                 ; mm7=data1-data6=tmp6\n        psubw   mm6,mm3                 ; mm6=data0-data7=tmp7\n        paddw   mm0,mm2                 ; mm0=data1+data6=tmp1\n        paddw   mm5,mm3                 ; mm5=data0+data7=tmp0\n\n        movq    mm2, MMWORD [wk(0)]     ; mm2=(22 23 32 33)\n        movq    mm3, MMWORD [wk(1)]     ; mm3=(42 43 52 53)\n        movq    MMWORD [wk(0)], mm7     ; wk(0)=tmp6\n        movq    MMWORD [wk(1)], mm6     ; wk(1)=tmp7\n\n        movq      mm7,mm4               ; transpose coefficients(phase 2)\n        punpckldq mm4,mm2               ; mm4=(20 21 22 23)=data2\n        punpckhdq mm7,mm2               ; mm7=(30 31 32 33)=data3\n        movq      mm6,mm1               ; transpose coefficients(phase 2)\n        punpckldq mm1,mm3               ; mm1=(40 41 42 43)=data4\n        punpckhdq mm6,mm3               ; mm6=(50 51 52 53)=data5\n\n        movq    mm2,mm7\n        movq    mm3,mm4\n        paddw   mm7,mm1                 ; mm7=data3+data4=tmp3\n        paddw   mm4,mm6                 ; mm4=data2+data5=tmp2\n        psubw   mm2,mm1                 ; mm2=data3-data4=tmp4\n        psubw   mm3,mm6                 ; mm3=data2-data5=tmp5\n\n        ; -- Even part\n\n        movq    mm1,mm5\n        movq    mm6,mm0\n        paddw   mm5,mm7                 ; mm5=tmp10\n        paddw   mm0,mm4                 ; mm0=tmp11\n        psubw   mm1,mm7                 ; mm1=tmp13\n        psubw   mm6,mm4                 ; mm6=tmp12\n\n        movq    mm7,mm5\n        paddw   mm5,mm0                 ; mm5=tmp10+tmp11\n        psubw   mm7,mm0                 ; mm7=tmp10-tmp11\n\n        paddw   mm5,[GOTOFF(ebx,PW_DESCALE_P2X)]\n        paddw   mm7,[GOTOFF(ebx,PW_DESCALE_P2X)]\n        psraw   mm5,PASS1_BITS          ; mm5=data0\n        psraw   mm7,PASS1_BITS          ; mm7=data4\n\n        movq    MMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)], mm5\n        movq    MMWORD [MMBLOCK(4,0,edx,SIZEOF_DCTELEM)], mm7\n\n        ; (Original)\n        ; z1 = (tmp12 + tmp13) * 0.541196100;\n        ; data2 = z1 + tmp13 * 0.765366865;\n        ; data6 = z1 + tmp12 * -1.847759065;\n        ;\n        ; (This implementation)\n        ; data2 = tmp13 * (0.541196100 + 0.765366865) + tmp12 * 0.541196100;\n        ; data6 = tmp13 * 0.541196100 + tmp12 * (0.541196100 - 1.847759065);\n\n        movq      mm4,mm1               ; mm1=tmp13\n        movq      mm0,mm1\n        punpcklwd mm4,mm6               ; mm6=tmp12\n        punpckhwd mm0,mm6\n        movq      mm1,mm4\n        movq      mm6,mm0\n        pmaddwd   mm4,[GOTOFF(ebx,PW_F130_F054)]        ; mm4=data2L\n        pmaddwd   mm0,[GOTOFF(ebx,PW_F130_F054)]        ; mm0=data2H\n        pmaddwd   mm1,[GOTOFF(ebx,PW_F054_MF130)]       ; mm1=data6L\n        pmaddwd   mm6,[GOTOFF(ebx,PW_F054_MF130)]       ; mm6=data6H\n\n        paddd   mm4,[GOTOFF(ebx,PD_DESCALE_P2)]\n        paddd   mm0,[GOTOFF(ebx,PD_DESCALE_P2)]\n        psrad   mm4,DESCALE_P2\n        psrad   mm0,DESCALE_P2\n        paddd   mm1,[GOTOFF(ebx,PD_DESCALE_P2)]\n        paddd   mm6,[GOTOFF(ebx,PD_DESCALE_P2)]\n        psrad   mm1,DESCALE_P2\n        psrad   mm6,DESCALE_P2\n\n        packssdw  mm4,mm0               ; mm4=data2\n        packssdw  mm1,mm6               ; mm1=data6\n\n        movq    MMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)], mm4\n        movq    MMWORD [MMBLOCK(6,0,edx,SIZEOF_DCTELEM)], mm1\n\n        ; -- Odd part\n\n        movq    mm5, MMWORD [wk(0)]     ; mm5=tmp6\n        movq    mm7, MMWORD [wk(1)]     ; mm7=tmp7\n\n        movq    mm0,mm2                 ; mm2=tmp4\n        movq    mm6,mm3                 ; mm3=tmp5\n        paddw   mm0,mm5                 ; mm0=z3\n        paddw   mm6,mm7                 ; mm6=z4\n\n        ; (Original)\n        ; z5 = (z3 + z4) * 1.175875602;\n        ; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n        ; z3 += z5;  z4 += z5;\n        ;\n        ; (This implementation)\n        ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n        ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n        movq      mm4,mm0\n        movq      mm1,mm0\n        punpcklwd mm4,mm6\n        punpckhwd mm1,mm6\n        movq      mm0,mm4\n        movq      mm6,mm1\n        pmaddwd   mm4,[GOTOFF(ebx,PW_MF078_F117)]       ; mm4=z3L\n        pmaddwd   mm1,[GOTOFF(ebx,PW_MF078_F117)]       ; mm1=z3H\n        pmaddwd   mm0,[GOTOFF(ebx,PW_F117_F078)]        ; mm0=z4L\n        pmaddwd   mm6,[GOTOFF(ebx,PW_F117_F078)]        ; mm6=z4H\n\n        movq    MMWORD [wk(0)], mm4     ; wk(0)=z3L\n        movq    MMWORD [wk(1)], mm1     ; wk(1)=z3H\n\n        ; (Original)\n        ; z1 = tmp4 + tmp7;  z2 = tmp5 + tmp6;\n        ; tmp4 = tmp4 * 0.298631336;  tmp5 = tmp5 * 2.053119869;\n        ; tmp6 = tmp6 * 3.072711026;  tmp7 = tmp7 * 1.501321110;\n        ; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n        ; data7 = tmp4 + z1 + z3;  data5 = tmp5 + z2 + z4;\n        ; data3 = tmp6 + z2 + z3;  data1 = tmp7 + z1 + z4;\n        ;\n        ; (This implementation)\n        ; tmp4 = tmp4 * (0.298631336 - 0.899976223) + tmp7 * -0.899976223;\n        ; tmp5 = tmp5 * (2.053119869 - 2.562915447) + tmp6 * -2.562915447;\n        ; tmp6 = tmp5 * -2.562915447 + tmp6 * (3.072711026 - 2.562915447);\n        ; tmp7 = tmp4 * -0.899976223 + tmp7 * (1.501321110 - 0.899976223);\n        ; data7 = tmp4 + z3;  data5 = tmp5 + z4;\n        ; data3 = tmp6 + z3;  data1 = tmp7 + z4;\n\n        movq      mm4,mm2\n        movq      mm1,mm2\n        punpcklwd mm4,mm7\n        punpckhwd mm1,mm7\n        movq      mm2,mm4\n        movq      mm7,mm1\n        pmaddwd   mm4,[GOTOFF(ebx,PW_MF060_MF089)]      ; mm4=tmp4L\n        pmaddwd   mm1,[GOTOFF(ebx,PW_MF060_MF089)]      ; mm1=tmp4H\n        pmaddwd   mm2,[GOTOFF(ebx,PW_MF089_F060)]       ; mm2=tmp7L\n        pmaddwd   mm7,[GOTOFF(ebx,PW_MF089_F060)]       ; mm7=tmp7H\n\n        paddd   mm4, MMWORD [wk(0)]     ; mm4=data7L\n        paddd   mm1, MMWORD [wk(1)]     ; mm1=data7H\n        paddd   mm2,mm0                 ; mm2=data1L\n        paddd   mm7,mm6                 ; mm7=data1H\n\n        paddd   mm4,[GOTOFF(ebx,PD_DESCALE_P2)]\n        paddd   mm1,[GOTOFF(ebx,PD_DESCALE_P2)]\n        psrad   mm4,DESCALE_P2\n        psrad   mm1,DESCALE_P2\n        paddd   mm2,[GOTOFF(ebx,PD_DESCALE_P2)]\n        paddd   mm7,[GOTOFF(ebx,PD_DESCALE_P2)]\n        psrad   mm2,DESCALE_P2\n        psrad   mm7,DESCALE_P2\n\n        packssdw  mm4,mm1               ; mm4=data7\n        packssdw  mm2,mm7               ; mm2=data1\n\n        movq    MMWORD [MMBLOCK(7,0,edx,SIZEOF_DCTELEM)], mm4\n        movq    MMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)], mm2\n\n        movq      mm1,mm3\n        movq      mm7,mm3\n        punpcklwd mm1,mm5\n        punpckhwd mm7,mm5\n        movq      mm3,mm1\n        movq      mm5,mm7\n        pmaddwd   mm1,[GOTOFF(ebx,PW_MF050_MF256)]      ; mm1=tmp5L\n        pmaddwd   mm7,[GOTOFF(ebx,PW_MF050_MF256)]      ; mm7=tmp5H\n        pmaddwd   mm3,[GOTOFF(ebx,PW_MF256_F050)]       ; mm3=tmp6L\n        pmaddwd   mm5,[GOTOFF(ebx,PW_MF256_F050)]       ; mm5=tmp6H\n\n        paddd   mm1,mm0                 ; mm1=data5L\n        paddd   mm7,mm6                 ; mm7=data5H\n        paddd   mm3, MMWORD [wk(0)]     ; mm3=data3L\n        paddd   mm5, MMWORD [wk(1)]     ; mm5=data3H\n\n        paddd   mm1,[GOTOFF(ebx,PD_DESCALE_P2)]\n        paddd   mm7,[GOTOFF(ebx,PD_DESCALE_P2)]\n        psrad   mm1,DESCALE_P2\n        psrad   mm7,DESCALE_P2\n        paddd   mm3,[GOTOFF(ebx,PD_DESCALE_P2)]\n        paddd   mm5,[GOTOFF(ebx,PD_DESCALE_P2)]\n        psrad   mm3,DESCALE_P2\n        psrad   mm5,DESCALE_P2\n\n        packssdw  mm1,mm7               ; mm1=data5\n        packssdw  mm3,mm5               ; mm3=data3\n\n        movq    MMWORD [MMBLOCK(5,0,edx,SIZEOF_DCTELEM)], mm1\n        movq    MMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)], mm3\n\n        add     edx, byte 4*SIZEOF_DCTELEM\n        dec     ecx\n        jnz     near .columnloop\n\n        emms            ; empty MMX state\n\n;       pop     edi             ; unused\n;       pop     esi             ; unused\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        poppic  ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jfdctint-sse2-64.asm",
    "content": ";\n; jfdctint.asm - accurate integer FDCT (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a slow-but-accurate integer implementation of the\n; forward DCT (Discrete Cosine Transform). The following code is based\n; directly on the IJG's original jfdctint.c; see the jfdctint.c for\n; more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS      13\n%define PASS1_BITS      2\n\n%define DESCALE_P1      (CONST_BITS-PASS1_BITS)\n%define DESCALE_P2      (CONST_BITS+PASS1_BITS)\n\n%if CONST_BITS == 13\nF_0_298 equ      2446           ; FIX(0.298631336)\nF_0_390 equ      3196           ; FIX(0.390180644)\nF_0_541 equ      4433           ; FIX(0.541196100)\nF_0_765 equ      6270           ; FIX(0.765366865)\nF_0_899 equ      7373           ; FIX(0.899976223)\nF_1_175 equ      9633           ; FIX(1.175875602)\nF_1_501 equ     12299           ; FIX(1.501321110)\nF_1_847 equ     15137           ; FIX(1.847759065)\nF_1_961 equ     16069           ; FIX(1.961570560)\nF_2_053 equ     16819           ; FIX(2.053119869)\nF_2_562 equ     20995           ; FIX(2.562915447)\nF_3_072 equ     25172           ; FIX(3.072711026)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_298 equ     DESCALE( 320652955,30-CONST_BITS)       ; FIX(0.298631336)\nF_0_390 equ     DESCALE( 418953276,30-CONST_BITS)       ; FIX(0.390180644)\nF_0_541 equ     DESCALE( 581104887,30-CONST_BITS)       ; FIX(0.541196100)\nF_0_765 equ     DESCALE( 821806413,30-CONST_BITS)       ; FIX(0.765366865)\nF_0_899 equ     DESCALE( 966342111,30-CONST_BITS)       ; FIX(0.899976223)\nF_1_175 equ     DESCALE(1262586813,30-CONST_BITS)       ; FIX(1.175875602)\nF_1_501 equ     DESCALE(1612031267,30-CONST_BITS)       ; FIX(1.501321110)\nF_1_847 equ     DESCALE(1984016188,30-CONST_BITS)       ; FIX(1.847759065)\nF_1_961 equ     DESCALE(2106220350,30-CONST_BITS)       ; FIX(1.961570560)\nF_2_053 equ     DESCALE(2204520673,30-CONST_BITS)       ; FIX(2.053119869)\nF_2_562 equ     DESCALE(2751909506,30-CONST_BITS)       ; FIX(2.562915447)\nF_3_072 equ     DESCALE(3299298341,30-CONST_BITS)       ; FIX(3.072711026)\n%endif\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_fdct_islow_sse2)\n\nEXTN(jconst_fdct_islow_sse2):\n\nPW_F130_F054    times 4 dw  (F_0_541+F_0_765), F_0_541\nPW_F054_MF130   times 4 dw  F_0_541, (F_0_541-F_1_847)\nPW_MF078_F117   times 4 dw  (F_1_175-F_1_961), F_1_175\nPW_F117_F078    times 4 dw  F_1_175, (F_1_175-F_0_390)\nPW_MF060_MF089  times 4 dw  (F_0_298-F_0_899),-F_0_899\nPW_MF089_F060   times 4 dw -F_0_899, (F_1_501-F_0_899)\nPW_MF050_MF256  times 4 dw  (F_2_053-F_2_562),-F_2_562\nPW_MF256_F050   times 4 dw -F_2_562, (F_3_072-F_2_562)\nPD_DESCALE_P1   times 4 dd  1 << (DESCALE_P1-1)\nPD_DESCALE_P2   times 4 dd  1 << (DESCALE_P2-1)\nPW_DESCALE_P2X  times 8 dw  1 << (PASS1_BITS-1)\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_islow_sse2 (DCTELEM *data)\n;\n\n; r10 = DCTELEM *data\n\n%define wk(i)           rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          6\n\n        align   16\n        global  EXTN(jsimd_fdct_islow_sse2)\n\nEXTN(jsimd_fdct_islow_sse2):\n        push    rbp\n        mov     rax,rsp                         ; rax = original rbp\n        sub     rsp, byte 4\n        and     rsp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [rsp],rax\n        mov     rbp,rsp                         ; rbp = aligned rbp\n        lea     rsp, [wk(0)]\n        collect_args\n\n        ; ---- Pass 1: process rows.\n\n        mov     rdx, r10        ; (DCTELEM *)\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_DCTELEM)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_DCTELEM)]\n        movdqa  xmm2, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_DCTELEM)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_DCTELEM)]\n\n        ; xmm0=(00 01 02 03 04 05 06 07), xmm2=(20 21 22 23 24 25 26 27)\n        ; xmm1=(10 11 12 13 14 15 16 17), xmm3=(30 31 32 33 34 35 36 37)\n\n        movdqa    xmm4,xmm0             ; transpose coefficients(phase 1)\n        punpcklwd xmm0,xmm1             ; xmm0=(00 10 01 11 02 12 03 13)\n        punpckhwd xmm4,xmm1             ; xmm4=(04 14 05 15 06 16 07 17)\n        movdqa    xmm5,xmm2             ; transpose coefficients(phase 1)\n        punpcklwd xmm2,xmm3             ; xmm2=(20 30 21 31 22 32 23 33)\n        punpckhwd xmm5,xmm3             ; xmm5=(24 34 25 35 26 36 27 37)\n\n        movdqa  xmm6, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_DCTELEM)]\n        movdqa  xmm7, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_DCTELEM)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_DCTELEM)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_DCTELEM)]\n\n        ; xmm6=( 4 12 20 28 36 44 52 60), xmm1=( 6 14 22 30 38 46 54 62)\n        ; xmm7=( 5 13 21 29 37 45 53 61), xmm3=( 7 15 23 31 39 47 55 63)\n\n        movdqa  XMMWORD [wk(0)], xmm2   ; wk(0)=(20 30 21 31 22 32 23 33)\n        movdqa  XMMWORD [wk(1)], xmm5   ; wk(1)=(24 34 25 35 26 36 27 37)\n\n        movdqa    xmm2,xmm6             ; transpose coefficients(phase 1)\n        punpcklwd xmm6,xmm7             ; xmm6=(40 50 41 51 42 52 43 53)\n        punpckhwd xmm2,xmm7             ; xmm2=(44 54 45 55 46 56 47 57)\n        movdqa    xmm5,xmm1             ; transpose coefficients(phase 1)\n        punpcklwd xmm1,xmm3             ; xmm1=(60 70 61 71 62 72 63 73)\n        punpckhwd xmm5,xmm3             ; xmm5=(64 74 65 75 66 76 67 77)\n\n        movdqa    xmm7,xmm6             ; transpose coefficients(phase 2)\n        punpckldq xmm6,xmm1             ; xmm6=(40 50 60 70 41 51 61 71)\n        punpckhdq xmm7,xmm1             ; xmm7=(42 52 62 72 43 53 63 73)\n        movdqa    xmm3,xmm2             ; transpose coefficients(phase 2)\n        punpckldq xmm2,xmm5             ; xmm2=(44 54 64 74 45 55 65 75)\n        punpckhdq xmm3,xmm5             ; xmm3=(46 56 66 76 47 57 67 77)\n\n        movdqa  xmm1, XMMWORD [wk(0)]   ; xmm1=(20 30 21 31 22 32 23 33)\n        movdqa  xmm5, XMMWORD [wk(1)]   ; xmm5=(24 34 25 35 26 36 27 37)\n        movdqa  XMMWORD [wk(2)], xmm7   ; wk(2)=(42 52 62 72 43 53 63 73)\n        movdqa  XMMWORD [wk(3)], xmm2   ; wk(3)=(44 54 64 74 45 55 65 75)\n\n        movdqa    xmm7,xmm0             ; transpose coefficients(phase 2)\n        punpckldq xmm0,xmm1             ; xmm0=(00 10 20 30 01 11 21 31)\n        punpckhdq xmm7,xmm1             ; xmm7=(02 12 22 32 03 13 23 33)\n        movdqa    xmm2,xmm4             ; transpose coefficients(phase 2)\n        punpckldq xmm4,xmm5             ; xmm4=(04 14 24 34 05 15 25 35)\n        punpckhdq xmm2,xmm5             ; xmm2=(06 16 26 36 07 17 27 37)\n\n        movdqa     xmm1,xmm0            ; transpose coefficients(phase 3)\n        punpcklqdq xmm0,xmm6            ; xmm0=(00 10 20 30 40 50 60 70)=data0\n        punpckhqdq xmm1,xmm6            ; xmm1=(01 11 21 31 41 51 61 71)=data1\n        movdqa     xmm5,xmm2            ; transpose coefficients(phase 3)\n        punpcklqdq xmm2,xmm3            ; xmm2=(06 16 26 36 46 56 66 76)=data6\n        punpckhqdq xmm5,xmm3            ; xmm5=(07 17 27 37 47 57 67 77)=data7\n\n        movdqa  xmm6,xmm1\n        movdqa  xmm3,xmm0\n        psubw   xmm1,xmm2               ; xmm1=data1-data6=tmp6\n        psubw   xmm0,xmm5               ; xmm0=data0-data7=tmp7\n        paddw   xmm6,xmm2               ; xmm6=data1+data6=tmp1\n        paddw   xmm3,xmm5               ; xmm3=data0+data7=tmp0\n\n        movdqa  xmm2, XMMWORD [wk(2)]   ; xmm2=(42 52 62 72 43 53 63 73)\n        movdqa  xmm5, XMMWORD [wk(3)]   ; xmm5=(44 54 64 74 45 55 65 75)\n        movdqa  XMMWORD [wk(0)], xmm1   ; wk(0)=tmp6\n        movdqa  XMMWORD [wk(1)], xmm0   ; wk(1)=tmp7\n\n        movdqa     xmm1,xmm7            ; transpose coefficients(phase 3)\n        punpcklqdq xmm7,xmm2            ; xmm7=(02 12 22 32 42 52 62 72)=data2\n        punpckhqdq xmm1,xmm2            ; xmm1=(03 13 23 33 43 53 63 73)=data3\n        movdqa     xmm0,xmm4            ; transpose coefficients(phase 3)\n        punpcklqdq xmm4,xmm5            ; xmm4=(04 14 24 34 44 54 64 74)=data4\n        punpckhqdq xmm0,xmm5            ; xmm0=(05 15 25 35 45 55 65 75)=data5\n\n        movdqa  xmm2,xmm1\n        movdqa  xmm5,xmm7\n        paddw   xmm1,xmm4               ; xmm1=data3+data4=tmp3\n        paddw   xmm7,xmm0               ; xmm7=data2+data5=tmp2\n        psubw   xmm2,xmm4               ; xmm2=data3-data4=tmp4\n        psubw   xmm5,xmm0               ; xmm5=data2-data5=tmp5\n\n        ; -- Even part\n\n        movdqa  xmm4,xmm3\n        movdqa  xmm0,xmm6\n        paddw   xmm3,xmm1               ; xmm3=tmp10\n        paddw   xmm6,xmm7               ; xmm6=tmp11\n        psubw   xmm4,xmm1               ; xmm4=tmp13\n        psubw   xmm0,xmm7               ; xmm0=tmp12\n\n        movdqa  xmm1,xmm3\n        paddw   xmm3,xmm6               ; xmm3=tmp10+tmp11\n        psubw   xmm1,xmm6               ; xmm1=tmp10-tmp11\n\n        psllw   xmm3,PASS1_BITS         ; xmm3=data0\n        psllw   xmm1,PASS1_BITS         ; xmm1=data4\n\n        movdqa  XMMWORD [wk(2)], xmm3   ; wk(2)=data0\n        movdqa  XMMWORD [wk(3)], xmm1   ; wk(3)=data4\n\n        ; (Original)\n        ; z1 = (tmp12 + tmp13) * 0.541196100;\n        ; data2 = z1 + tmp13 * 0.765366865;\n        ; data6 = z1 + tmp12 * -1.847759065;\n        ;\n        ; (This implementation)\n        ; data2 = tmp13 * (0.541196100 + 0.765366865) + tmp12 * 0.541196100;\n        ; data6 = tmp13 * 0.541196100 + tmp12 * (0.541196100 - 1.847759065);\n\n        movdqa    xmm7,xmm4             ; xmm4=tmp13\n        movdqa    xmm6,xmm4\n        punpcklwd xmm7,xmm0             ; xmm0=tmp12\n        punpckhwd xmm6,xmm0\n        movdqa    xmm4,xmm7\n        movdqa    xmm0,xmm6\n        pmaddwd   xmm7,[rel PW_F130_F054]       ; xmm7=data2L\n        pmaddwd   xmm6,[rel PW_F130_F054]       ; xmm6=data2H\n        pmaddwd   xmm4,[rel PW_F054_MF130]      ; xmm4=data6L\n        pmaddwd   xmm0,[rel PW_F054_MF130]      ; xmm0=data6H\n\n        paddd   xmm7,[rel PD_DESCALE_P1]\n        paddd   xmm6,[rel PD_DESCALE_P1]\n        psrad   xmm7,DESCALE_P1\n        psrad   xmm6,DESCALE_P1\n        paddd   xmm4,[rel PD_DESCALE_P1]\n        paddd   xmm0,[rel PD_DESCALE_P1]\n        psrad   xmm4,DESCALE_P1\n        psrad   xmm0,DESCALE_P1\n\n        packssdw  xmm7,xmm6             ; xmm7=data2\n        packssdw  xmm4,xmm0             ; xmm4=data6\n\n        movdqa  XMMWORD [wk(4)], xmm7   ; wk(4)=data2\n        movdqa  XMMWORD [wk(5)], xmm4   ; wk(5)=data6\n\n        ; -- Odd part\n\n        movdqa  xmm3, XMMWORD [wk(0)]   ; xmm3=tmp6\n        movdqa  xmm1, XMMWORD [wk(1)]   ; xmm1=tmp7\n\n        movdqa  xmm6,xmm2               ; xmm2=tmp4\n        movdqa  xmm0,xmm5               ; xmm5=tmp5\n        paddw   xmm6,xmm3               ; xmm6=z3\n        paddw   xmm0,xmm1               ; xmm0=z4\n\n        ; (Original)\n        ; z5 = (z3 + z4) * 1.175875602;\n        ; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n        ; z3 += z5;  z4 += z5;\n        ;\n        ; (This implementation)\n        ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n        ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n        movdqa    xmm7,xmm6\n        movdqa    xmm4,xmm6\n        punpcklwd xmm7,xmm0\n        punpckhwd xmm4,xmm0\n        movdqa    xmm6,xmm7\n        movdqa    xmm0,xmm4\n        pmaddwd   xmm7,[rel PW_MF078_F117]      ; xmm7=z3L\n        pmaddwd   xmm4,[rel PW_MF078_F117]      ; xmm4=z3H\n        pmaddwd   xmm6,[rel PW_F117_F078]       ; xmm6=z4L\n        pmaddwd   xmm0,[rel PW_F117_F078]       ; xmm0=z4H\n\n        movdqa  XMMWORD [wk(0)], xmm7   ; wk(0)=z3L\n        movdqa  XMMWORD [wk(1)], xmm4   ; wk(1)=z3H\n\n        ; (Original)\n        ; z1 = tmp4 + tmp7;  z2 = tmp5 + tmp6;\n        ; tmp4 = tmp4 * 0.298631336;  tmp5 = tmp5 * 2.053119869;\n        ; tmp6 = tmp6 * 3.072711026;  tmp7 = tmp7 * 1.501321110;\n        ; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n        ; data7 = tmp4 + z1 + z3;  data5 = tmp5 + z2 + z4;\n        ; data3 = tmp6 + z2 + z3;  data1 = tmp7 + z1 + z4;\n        ;\n        ; (This implementation)\n        ; tmp4 = tmp4 * (0.298631336 - 0.899976223) + tmp7 * -0.899976223;\n        ; tmp5 = tmp5 * (2.053119869 - 2.562915447) + tmp6 * -2.562915447;\n        ; tmp6 = tmp5 * -2.562915447 + tmp6 * (3.072711026 - 2.562915447);\n        ; tmp7 = tmp4 * -0.899976223 + tmp7 * (1.501321110 - 0.899976223);\n        ; data7 = tmp4 + z3;  data5 = tmp5 + z4;\n        ; data3 = tmp6 + z3;  data1 = tmp7 + z4;\n\n        movdqa    xmm7,xmm2\n        movdqa    xmm4,xmm2\n        punpcklwd xmm7,xmm1\n        punpckhwd xmm4,xmm1\n        movdqa    xmm2,xmm7\n        movdqa    xmm1,xmm4\n        pmaddwd   xmm7,[rel PW_MF060_MF089]     ; xmm7=tmp4L\n        pmaddwd   xmm4,[rel PW_MF060_MF089]     ; xmm4=tmp4H\n        pmaddwd   xmm2,[rel PW_MF089_F060]      ; xmm2=tmp7L\n        pmaddwd   xmm1,[rel PW_MF089_F060]      ; xmm1=tmp7H\n\n        paddd   xmm7, XMMWORD [wk(0)]   ; xmm7=data7L\n        paddd   xmm4, XMMWORD [wk(1)]   ; xmm4=data7H\n        paddd   xmm2,xmm6               ; xmm2=data1L\n        paddd   xmm1,xmm0               ; xmm1=data1H\n\n        paddd   xmm7,[rel PD_DESCALE_P1]\n        paddd   xmm4,[rel PD_DESCALE_P1]\n        psrad   xmm7,DESCALE_P1\n        psrad   xmm4,DESCALE_P1\n        paddd   xmm2,[rel PD_DESCALE_P1]\n        paddd   xmm1,[rel PD_DESCALE_P1]\n        psrad   xmm2,DESCALE_P1\n        psrad   xmm1,DESCALE_P1\n\n        packssdw  xmm7,xmm4             ; xmm7=data7\n        packssdw  xmm2,xmm1             ; xmm2=data1\n\n        movdqa    xmm4,xmm5\n        movdqa    xmm1,xmm5\n        punpcklwd xmm4,xmm3\n        punpckhwd xmm1,xmm3\n        movdqa    xmm5,xmm4\n        movdqa    xmm3,xmm1\n        pmaddwd   xmm4,[rel PW_MF050_MF256]     ; xmm4=tmp5L\n        pmaddwd   xmm1,[rel PW_MF050_MF256]     ; xmm1=tmp5H\n        pmaddwd   xmm5,[rel PW_MF256_F050]      ; xmm5=tmp6L\n        pmaddwd   xmm3,[rel PW_MF256_F050]      ; xmm3=tmp6H\n\n        paddd   xmm4,xmm6               ; xmm4=data5L\n        paddd   xmm1,xmm0               ; xmm1=data5H\n        paddd   xmm5, XMMWORD [wk(0)]   ; xmm5=data3L\n        paddd   xmm3, XMMWORD [wk(1)]   ; xmm3=data3H\n\n        paddd   xmm4,[rel PD_DESCALE_P1]\n        paddd   xmm1,[rel PD_DESCALE_P1]\n        psrad   xmm4,DESCALE_P1\n        psrad   xmm1,DESCALE_P1\n        paddd   xmm5,[rel PD_DESCALE_P1]\n        paddd   xmm3,[rel PD_DESCALE_P1]\n        psrad   xmm5,DESCALE_P1\n        psrad   xmm3,DESCALE_P1\n\n        packssdw  xmm4,xmm1             ; xmm4=data5\n        packssdw  xmm5,xmm3             ; xmm5=data3\n\n        ; ---- Pass 2: process columns.\n\n        movdqa  xmm6, XMMWORD [wk(2)]   ; xmm6=col0\n        movdqa  xmm0, XMMWORD [wk(4)]   ; xmm0=col2\n\n        ; xmm6=(00 10 20 30 40 50 60 70), xmm0=(02 12 22 32 42 52 62 72)\n        ; xmm2=(01 11 21 31 41 51 61 71), xmm5=(03 13 23 33 43 53 63 73)\n\n        movdqa    xmm1,xmm6             ; transpose coefficients(phase 1)\n        punpcklwd xmm6,xmm2             ; xmm6=(00 01 10 11 20 21 30 31)\n        punpckhwd xmm1,xmm2             ; xmm1=(40 41 50 51 60 61 70 71)\n        movdqa    xmm3,xmm0             ; transpose coefficients(phase 1)\n        punpcklwd xmm0,xmm5             ; xmm0=(02 03 12 13 22 23 32 33)\n        punpckhwd xmm3,xmm5             ; xmm3=(42 43 52 53 62 63 72 73)\n\n        movdqa  xmm2, XMMWORD [wk(3)]   ; xmm2=col4\n        movdqa  xmm5, XMMWORD [wk(5)]   ; xmm5=col6\n\n        ; xmm2=(04 14 24 34 44 54 64 74), xmm5=(06 16 26 36 46 56 66 76)\n        ; xmm4=(05 15 25 35 45 55 65 75), xmm7=(07 17 27 37 47 57 67 77)\n\n        movdqa  XMMWORD [wk(0)], xmm0   ; wk(0)=(02 03 12 13 22 23 32 33)\n        movdqa  XMMWORD [wk(1)], xmm3   ; wk(1)=(42 43 52 53 62 63 72 73)\n\n        movdqa    xmm0,xmm2             ; transpose coefficients(phase 1)\n        punpcklwd xmm2,xmm4             ; xmm2=(04 05 14 15 24 25 34 35)\n        punpckhwd xmm0,xmm4             ; xmm0=(44 45 54 55 64 65 74 75)\n        movdqa    xmm3,xmm5             ; transpose coefficients(phase 1)\n        punpcklwd xmm5,xmm7             ; xmm5=(06 07 16 17 26 27 36 37)\n        punpckhwd xmm3,xmm7             ; xmm3=(46 47 56 57 66 67 76 77)\n\n        movdqa    xmm4,xmm2             ; transpose coefficients(phase 2)\n        punpckldq xmm2,xmm5             ; xmm2=(04 05 06 07 14 15 16 17)\n        punpckhdq xmm4,xmm5             ; xmm4=(24 25 26 27 34 35 36 37)\n        movdqa    xmm7,xmm0             ; transpose coefficients(phase 2)\n        punpckldq xmm0,xmm3             ; xmm0=(44 45 46 47 54 55 56 57)\n        punpckhdq xmm7,xmm3             ; xmm7=(64 65 66 67 74 75 76 77)\n\n        movdqa  xmm5, XMMWORD [wk(0)]   ; xmm5=(02 03 12 13 22 23 32 33)\n        movdqa  xmm3, XMMWORD [wk(1)]   ; xmm3=(42 43 52 53 62 63 72 73)\n        movdqa  XMMWORD [wk(2)], xmm4   ; wk(2)=(24 25 26 27 34 35 36 37)\n        movdqa  XMMWORD [wk(3)], xmm0   ; wk(3)=(44 45 46 47 54 55 56 57)\n\n        movdqa    xmm4,xmm6             ; transpose coefficients(phase 2)\n        punpckldq xmm6,xmm5             ; xmm6=(00 01 02 03 10 11 12 13)\n        punpckhdq xmm4,xmm5             ; xmm4=(20 21 22 23 30 31 32 33)\n        movdqa    xmm0,xmm1             ; transpose coefficients(phase 2)\n        punpckldq xmm1,xmm3             ; xmm1=(40 41 42 43 50 51 52 53)\n        punpckhdq xmm0,xmm3             ; xmm0=(60 61 62 63 70 71 72 73)\n\n        movdqa     xmm5,xmm6            ; transpose coefficients(phase 3)\n        punpcklqdq xmm6,xmm2            ; xmm6=(00 01 02 03 04 05 06 07)=data0\n        punpckhqdq xmm5,xmm2            ; xmm5=(10 11 12 13 14 15 16 17)=data1\n        movdqa     xmm3,xmm0            ; transpose coefficients(phase 3)\n        punpcklqdq xmm0,xmm7            ; xmm0=(60 61 62 63 64 65 66 67)=data6\n        punpckhqdq xmm3,xmm7            ; xmm3=(70 71 72 73 74 75 76 77)=data7\n\n        movdqa  xmm2,xmm5\n        movdqa  xmm7,xmm6\n        psubw   xmm5,xmm0               ; xmm5=data1-data6=tmp6\n        psubw   xmm6,xmm3               ; xmm6=data0-data7=tmp7\n        paddw   xmm2,xmm0               ; xmm2=data1+data6=tmp1\n        paddw   xmm7,xmm3               ; xmm7=data0+data7=tmp0\n\n        movdqa  xmm0, XMMWORD [wk(2)]   ; xmm0=(24 25 26 27 34 35 36 37)\n        movdqa  xmm3, XMMWORD [wk(3)]   ; xmm3=(44 45 46 47 54 55 56 57)\n        movdqa  XMMWORD [wk(0)], xmm5   ; wk(0)=tmp6\n        movdqa  XMMWORD [wk(1)], xmm6   ; wk(1)=tmp7\n\n        movdqa     xmm5,xmm4            ; transpose coefficients(phase 3)\n        punpcklqdq xmm4,xmm0            ; xmm4=(20 21 22 23 24 25 26 27)=data2\n        punpckhqdq xmm5,xmm0            ; xmm5=(30 31 32 33 34 35 36 37)=data3\n        movdqa     xmm6,xmm1            ; transpose coefficients(phase 3)\n        punpcklqdq xmm1,xmm3            ; xmm1=(40 41 42 43 44 45 46 47)=data4\n        punpckhqdq xmm6,xmm3            ; xmm6=(50 51 52 53 54 55 56 57)=data5\n\n        movdqa  xmm0,xmm5\n        movdqa  xmm3,xmm4\n        paddw   xmm5,xmm1               ; xmm5=data3+data4=tmp3\n        paddw   xmm4,xmm6               ; xmm4=data2+data5=tmp2\n        psubw   xmm0,xmm1               ; xmm0=data3-data4=tmp4\n        psubw   xmm3,xmm6               ; xmm3=data2-data5=tmp5\n\n        ; -- Even part\n\n        movdqa  xmm1,xmm7\n        movdqa  xmm6,xmm2\n        paddw   xmm7,xmm5               ; xmm7=tmp10\n        paddw   xmm2,xmm4               ; xmm2=tmp11\n        psubw   xmm1,xmm5               ; xmm1=tmp13\n        psubw   xmm6,xmm4               ; xmm6=tmp12\n\n        movdqa  xmm5,xmm7\n        paddw   xmm7,xmm2               ; xmm7=tmp10+tmp11\n        psubw   xmm5,xmm2               ; xmm5=tmp10-tmp11\n\n        paddw   xmm7,[rel PW_DESCALE_P2X]\n        paddw   xmm5,[rel PW_DESCALE_P2X]\n        psraw   xmm7,PASS1_BITS         ; xmm7=data0\n        psraw   xmm5,PASS1_BITS         ; xmm5=data4\n\n        movdqa  XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_DCTELEM)], xmm7\n        movdqa  XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_DCTELEM)], xmm5\n\n        ; (Original)\n        ; z1 = (tmp12 + tmp13) * 0.541196100;\n        ; data2 = z1 + tmp13 * 0.765366865;\n        ; data6 = z1 + tmp12 * -1.847759065;\n        ;\n        ; (This implementation)\n        ; data2 = tmp13 * (0.541196100 + 0.765366865) + tmp12 * 0.541196100;\n        ; data6 = tmp13 * 0.541196100 + tmp12 * (0.541196100 - 1.847759065);\n\n        movdqa    xmm4,xmm1             ; xmm1=tmp13\n        movdqa    xmm2,xmm1\n        punpcklwd xmm4,xmm6             ; xmm6=tmp12\n        punpckhwd xmm2,xmm6\n        movdqa    xmm1,xmm4\n        movdqa    xmm6,xmm2\n        pmaddwd   xmm4,[rel PW_F130_F054]       ; xmm4=data2L\n        pmaddwd   xmm2,[rel PW_F130_F054]       ; xmm2=data2H\n        pmaddwd   xmm1,[rel PW_F054_MF130]      ; xmm1=data6L\n        pmaddwd   xmm6,[rel PW_F054_MF130]      ; xmm6=data6H\n\n        paddd   xmm4,[rel PD_DESCALE_P2]\n        paddd   xmm2,[rel PD_DESCALE_P2]\n        psrad   xmm4,DESCALE_P2\n        psrad   xmm2,DESCALE_P2\n        paddd   xmm1,[rel PD_DESCALE_P2]\n        paddd   xmm6,[rel PD_DESCALE_P2]\n        psrad   xmm1,DESCALE_P2\n        psrad   xmm6,DESCALE_P2\n\n        packssdw  xmm4,xmm2             ; xmm4=data2\n        packssdw  xmm1,xmm6             ; xmm1=data6\n\n        movdqa  XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_DCTELEM)], xmm4\n        movdqa  XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_DCTELEM)], xmm1\n\n        ; -- Odd part\n\n        movdqa  xmm7, XMMWORD [wk(0)]   ; xmm7=tmp6\n        movdqa  xmm5, XMMWORD [wk(1)]   ; xmm5=tmp7\n\n        movdqa  xmm2,xmm0               ; xmm0=tmp4\n        movdqa  xmm6,xmm3               ; xmm3=tmp5\n        paddw   xmm2,xmm7               ; xmm2=z3\n        paddw   xmm6,xmm5               ; xmm6=z4\n\n        ; (Original)\n        ; z5 = (z3 + z4) * 1.175875602;\n        ; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n        ; z3 += z5;  z4 += z5;\n        ;\n        ; (This implementation)\n        ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n        ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n        movdqa    xmm4,xmm2\n        movdqa    xmm1,xmm2\n        punpcklwd xmm4,xmm6\n        punpckhwd xmm1,xmm6\n        movdqa    xmm2,xmm4\n        movdqa    xmm6,xmm1\n        pmaddwd   xmm4,[rel PW_MF078_F117]      ; xmm4=z3L\n        pmaddwd   xmm1,[rel PW_MF078_F117]      ; xmm1=z3H\n        pmaddwd   xmm2,[rel PW_F117_F078]       ; xmm2=z4L\n        pmaddwd   xmm6,[rel PW_F117_F078]       ; xmm6=z4H\n\n        movdqa  XMMWORD [wk(0)], xmm4   ; wk(0)=z3L\n        movdqa  XMMWORD [wk(1)], xmm1   ; wk(1)=z3H\n\n        ; (Original)\n        ; z1 = tmp4 + tmp7;  z2 = tmp5 + tmp6;\n        ; tmp4 = tmp4 * 0.298631336;  tmp5 = tmp5 * 2.053119869;\n        ; tmp6 = tmp6 * 3.072711026;  tmp7 = tmp7 * 1.501321110;\n        ; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n        ; data7 = tmp4 + z1 + z3;  data5 = tmp5 + z2 + z4;\n        ; data3 = tmp6 + z2 + z3;  data1 = tmp7 + z1 + z4;\n        ;\n        ; (This implementation)\n        ; tmp4 = tmp4 * (0.298631336 - 0.899976223) + tmp7 * -0.899976223;\n        ; tmp5 = tmp5 * (2.053119869 - 2.562915447) + tmp6 * -2.562915447;\n        ; tmp6 = tmp5 * -2.562915447 + tmp6 * (3.072711026 - 2.562915447);\n        ; tmp7 = tmp4 * -0.899976223 + tmp7 * (1.501321110 - 0.899976223);\n        ; data7 = tmp4 + z3;  data5 = tmp5 + z4;\n        ; data3 = tmp6 + z3;  data1 = tmp7 + z4;\n\n        movdqa    xmm4,xmm0\n        movdqa    xmm1,xmm0\n        punpcklwd xmm4,xmm5\n        punpckhwd xmm1,xmm5\n        movdqa    xmm0,xmm4\n        movdqa    xmm5,xmm1\n        pmaddwd   xmm4,[rel PW_MF060_MF089]     ; xmm4=tmp4L\n        pmaddwd   xmm1,[rel PW_MF060_MF089]     ; xmm1=tmp4H\n        pmaddwd   xmm0,[rel PW_MF089_F060]      ; xmm0=tmp7L\n        pmaddwd   xmm5,[rel PW_MF089_F060]      ; xmm5=tmp7H\n\n        paddd   xmm4, XMMWORD [wk(0)]   ; xmm4=data7L\n        paddd   xmm1, XMMWORD [wk(1)]   ; xmm1=data7H\n        paddd   xmm0,xmm2               ; xmm0=data1L\n        paddd   xmm5,xmm6               ; xmm5=data1H\n\n        paddd   xmm4,[rel PD_DESCALE_P2]\n        paddd   xmm1,[rel PD_DESCALE_P2]\n        psrad   xmm4,DESCALE_P2\n        psrad   xmm1,DESCALE_P2\n        paddd   xmm0,[rel PD_DESCALE_P2]\n        paddd   xmm5,[rel PD_DESCALE_P2]\n        psrad   xmm0,DESCALE_P2\n        psrad   xmm5,DESCALE_P2\n\n        packssdw  xmm4,xmm1             ; xmm4=data7\n        packssdw  xmm0,xmm5             ; xmm0=data1\n\n        movdqa  XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_DCTELEM)], xmm4\n        movdqa  XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_DCTELEM)], xmm0\n\n        movdqa    xmm1,xmm3\n        movdqa    xmm5,xmm3\n        punpcklwd xmm1,xmm7\n        punpckhwd xmm5,xmm7\n        movdqa    xmm3,xmm1\n        movdqa    xmm7,xmm5\n        pmaddwd   xmm1,[rel PW_MF050_MF256]     ; xmm1=tmp5L\n        pmaddwd   xmm5,[rel PW_MF050_MF256]     ; xmm5=tmp5H\n        pmaddwd   xmm3,[rel PW_MF256_F050]      ; xmm3=tmp6L\n        pmaddwd   xmm7,[rel PW_MF256_F050]      ; xmm7=tmp6H\n\n        paddd   xmm1,xmm2               ; xmm1=data5L\n        paddd   xmm5,xmm6               ; xmm5=data5H\n        paddd   xmm3, XMMWORD [wk(0)]   ; xmm3=data3L\n        paddd   xmm7, XMMWORD [wk(1)]   ; xmm7=data3H\n\n        paddd   xmm1,[rel PD_DESCALE_P2]\n        paddd   xmm5,[rel PD_DESCALE_P2]\n        psrad   xmm1,DESCALE_P2\n        psrad   xmm5,DESCALE_P2\n        paddd   xmm3,[rel PD_DESCALE_P2]\n        paddd   xmm7,[rel PD_DESCALE_P2]\n        psrad   xmm3,DESCALE_P2\n        psrad   xmm7,DESCALE_P2\n\n        packssdw  xmm1,xmm5             ; xmm1=data5\n        packssdw  xmm3,xmm7             ; xmm3=data3\n\n        movdqa  XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_DCTELEM)], xmm1\n        movdqa  XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_DCTELEM)], xmm3\n\n        uncollect_args\n        mov     rsp,rbp         ; rsp <- aligned rbp\n        pop     rsp             ; rsp <- original rbp\n        pop     rbp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jfdctint-sse2.asm",
    "content": ";\n; jfdctint.asm - accurate integer FDCT (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a slow-but-accurate integer implementation of the\n; forward DCT (Discrete Cosine Transform). The following code is based\n; directly on the IJG's original jfdctint.c; see the jfdctint.c for\n; more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS      13\n%define PASS1_BITS      2\n\n%define DESCALE_P1      (CONST_BITS-PASS1_BITS)\n%define DESCALE_P2      (CONST_BITS+PASS1_BITS)\n\n%if CONST_BITS == 13\nF_0_298 equ      2446           ; FIX(0.298631336)\nF_0_390 equ      3196           ; FIX(0.390180644)\nF_0_541 equ      4433           ; FIX(0.541196100)\nF_0_765 equ      6270           ; FIX(0.765366865)\nF_0_899 equ      7373           ; FIX(0.899976223)\nF_1_175 equ      9633           ; FIX(1.175875602)\nF_1_501 equ     12299           ; FIX(1.501321110)\nF_1_847 equ     15137           ; FIX(1.847759065)\nF_1_961 equ     16069           ; FIX(1.961570560)\nF_2_053 equ     16819           ; FIX(2.053119869)\nF_2_562 equ     20995           ; FIX(2.562915447)\nF_3_072 equ     25172           ; FIX(3.072711026)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_298 equ     DESCALE( 320652955,30-CONST_BITS)       ; FIX(0.298631336)\nF_0_390 equ     DESCALE( 418953276,30-CONST_BITS)       ; FIX(0.390180644)\nF_0_541 equ     DESCALE( 581104887,30-CONST_BITS)       ; FIX(0.541196100)\nF_0_765 equ     DESCALE( 821806413,30-CONST_BITS)       ; FIX(0.765366865)\nF_0_899 equ     DESCALE( 966342111,30-CONST_BITS)       ; FIX(0.899976223)\nF_1_175 equ     DESCALE(1262586813,30-CONST_BITS)       ; FIX(1.175875602)\nF_1_501 equ     DESCALE(1612031267,30-CONST_BITS)       ; FIX(1.501321110)\nF_1_847 equ     DESCALE(1984016188,30-CONST_BITS)       ; FIX(1.847759065)\nF_1_961 equ     DESCALE(2106220350,30-CONST_BITS)       ; FIX(1.961570560)\nF_2_053 equ     DESCALE(2204520673,30-CONST_BITS)       ; FIX(2.053119869)\nF_2_562 equ     DESCALE(2751909506,30-CONST_BITS)       ; FIX(2.562915447)\nF_3_072 equ     DESCALE(3299298341,30-CONST_BITS)       ; FIX(3.072711026)\n%endif\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_fdct_islow_sse2)\n\nEXTN(jconst_fdct_islow_sse2):\n\nPW_F130_F054    times 4 dw  (F_0_541+F_0_765), F_0_541\nPW_F054_MF130   times 4 dw  F_0_541, (F_0_541-F_1_847)\nPW_MF078_F117   times 4 dw  (F_1_175-F_1_961), F_1_175\nPW_F117_F078    times 4 dw  F_1_175, (F_1_175-F_0_390)\nPW_MF060_MF089  times 4 dw  (F_0_298-F_0_899),-F_0_899\nPW_MF089_F060   times 4 dw -F_0_899, (F_1_501-F_0_899)\nPW_MF050_MF256  times 4 dw  (F_2_053-F_2_562),-F_2_562\nPW_MF256_F050   times 4 dw -F_2_562, (F_3_072-F_2_562)\nPD_DESCALE_P1   times 4 dd  1 << (DESCALE_P1-1)\nPD_DESCALE_P2   times 4 dd  1 << (DESCALE_P2-1)\nPW_DESCALE_P2X  times 8 dw  1 << (PASS1_BITS-1)\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_islow_sse2 (DCTELEM *data)\n;\n\n%define data(b)         (b)+8           ; DCTELEM *data\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          6\n\n        align   16\n        global  EXTN(jsimd_fdct_islow_sse2)\n\nEXTN(jsimd_fdct_islow_sse2):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic ebx\n;       push    ecx             ; unused\n;       push    edx             ; need not be preserved\n;       push    esi             ; unused\n;       push    edi             ; unused\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process rows.\n\n        mov     edx, POINTER [data(eax)]        ; (DCTELEM *)\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_DCTELEM)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_DCTELEM)]\n        movdqa  xmm2, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_DCTELEM)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_DCTELEM)]\n\n        ; xmm0=(00 01 02 03 04 05 06 07), xmm2=(20 21 22 23 24 25 26 27)\n        ; xmm1=(10 11 12 13 14 15 16 17), xmm3=(30 31 32 33 34 35 36 37)\n\n        movdqa    xmm4,xmm0             ; transpose coefficients(phase 1)\n        punpcklwd xmm0,xmm1             ; xmm0=(00 10 01 11 02 12 03 13)\n        punpckhwd xmm4,xmm1             ; xmm4=(04 14 05 15 06 16 07 17)\n        movdqa    xmm5,xmm2             ; transpose coefficients(phase 1)\n        punpcklwd xmm2,xmm3             ; xmm2=(20 30 21 31 22 32 23 33)\n        punpckhwd xmm5,xmm3             ; xmm5=(24 34 25 35 26 36 27 37)\n\n        movdqa  xmm6, XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_DCTELEM)]\n        movdqa  xmm7, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_DCTELEM)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_DCTELEM)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_DCTELEM)]\n\n        ; xmm6=( 4 12 20 28 36 44 52 60), xmm1=( 6 14 22 30 38 46 54 62)\n        ; xmm7=( 5 13 21 29 37 45 53 61), xmm3=( 7 15 23 31 39 47 55 63)\n\n        movdqa  XMMWORD [wk(0)], xmm2   ; wk(0)=(20 30 21 31 22 32 23 33)\n        movdqa  XMMWORD [wk(1)], xmm5   ; wk(1)=(24 34 25 35 26 36 27 37)\n\n        movdqa    xmm2,xmm6             ; transpose coefficients(phase 1)\n        punpcklwd xmm6,xmm7             ; xmm6=(40 50 41 51 42 52 43 53)\n        punpckhwd xmm2,xmm7             ; xmm2=(44 54 45 55 46 56 47 57)\n        movdqa    xmm5,xmm1             ; transpose coefficients(phase 1)\n        punpcklwd xmm1,xmm3             ; xmm1=(60 70 61 71 62 72 63 73)\n        punpckhwd xmm5,xmm3             ; xmm5=(64 74 65 75 66 76 67 77)\n\n        movdqa    xmm7,xmm6             ; transpose coefficients(phase 2)\n        punpckldq xmm6,xmm1             ; xmm6=(40 50 60 70 41 51 61 71)\n        punpckhdq xmm7,xmm1             ; xmm7=(42 52 62 72 43 53 63 73)\n        movdqa    xmm3,xmm2             ; transpose coefficients(phase 2)\n        punpckldq xmm2,xmm5             ; xmm2=(44 54 64 74 45 55 65 75)\n        punpckhdq xmm3,xmm5             ; xmm3=(46 56 66 76 47 57 67 77)\n\n        movdqa  xmm1, XMMWORD [wk(0)]   ; xmm1=(20 30 21 31 22 32 23 33)\n        movdqa  xmm5, XMMWORD [wk(1)]   ; xmm5=(24 34 25 35 26 36 27 37)\n        movdqa  XMMWORD [wk(2)], xmm7   ; wk(2)=(42 52 62 72 43 53 63 73)\n        movdqa  XMMWORD [wk(3)], xmm2   ; wk(3)=(44 54 64 74 45 55 65 75)\n\n        movdqa    xmm7,xmm0             ; transpose coefficients(phase 2)\n        punpckldq xmm0,xmm1             ; xmm0=(00 10 20 30 01 11 21 31)\n        punpckhdq xmm7,xmm1             ; xmm7=(02 12 22 32 03 13 23 33)\n        movdqa    xmm2,xmm4             ; transpose coefficients(phase 2)\n        punpckldq xmm4,xmm5             ; xmm4=(04 14 24 34 05 15 25 35)\n        punpckhdq xmm2,xmm5             ; xmm2=(06 16 26 36 07 17 27 37)\n\n        movdqa     xmm1,xmm0            ; transpose coefficients(phase 3)\n        punpcklqdq xmm0,xmm6            ; xmm0=(00 10 20 30 40 50 60 70)=data0\n        punpckhqdq xmm1,xmm6            ; xmm1=(01 11 21 31 41 51 61 71)=data1\n        movdqa     xmm5,xmm2            ; transpose coefficients(phase 3)\n        punpcklqdq xmm2,xmm3            ; xmm2=(06 16 26 36 46 56 66 76)=data6\n        punpckhqdq xmm5,xmm3            ; xmm5=(07 17 27 37 47 57 67 77)=data7\n\n        movdqa  xmm6,xmm1\n        movdqa  xmm3,xmm0\n        psubw   xmm1,xmm2               ; xmm1=data1-data6=tmp6\n        psubw   xmm0,xmm5               ; xmm0=data0-data7=tmp7\n        paddw   xmm6,xmm2               ; xmm6=data1+data6=tmp1\n        paddw   xmm3,xmm5               ; xmm3=data0+data7=tmp0\n\n        movdqa  xmm2, XMMWORD [wk(2)]   ; xmm2=(42 52 62 72 43 53 63 73)\n        movdqa  xmm5, XMMWORD [wk(3)]   ; xmm5=(44 54 64 74 45 55 65 75)\n        movdqa  XMMWORD [wk(0)], xmm1   ; wk(0)=tmp6\n        movdqa  XMMWORD [wk(1)], xmm0   ; wk(1)=tmp7\n\n        movdqa     xmm1,xmm7            ; transpose coefficients(phase 3)\n        punpcklqdq xmm7,xmm2            ; xmm7=(02 12 22 32 42 52 62 72)=data2\n        punpckhqdq xmm1,xmm2            ; xmm1=(03 13 23 33 43 53 63 73)=data3\n        movdqa     xmm0,xmm4            ; transpose coefficients(phase 3)\n        punpcklqdq xmm4,xmm5            ; xmm4=(04 14 24 34 44 54 64 74)=data4\n        punpckhqdq xmm0,xmm5            ; xmm0=(05 15 25 35 45 55 65 75)=data5\n\n        movdqa  xmm2,xmm1\n        movdqa  xmm5,xmm7\n        paddw   xmm1,xmm4               ; xmm1=data3+data4=tmp3\n        paddw   xmm7,xmm0               ; xmm7=data2+data5=tmp2\n        psubw   xmm2,xmm4               ; xmm2=data3-data4=tmp4\n        psubw   xmm5,xmm0               ; xmm5=data2-data5=tmp5\n\n        ; -- Even part\n\n        movdqa  xmm4,xmm3\n        movdqa  xmm0,xmm6\n        paddw   xmm3,xmm1               ; xmm3=tmp10\n        paddw   xmm6,xmm7               ; xmm6=tmp11\n        psubw   xmm4,xmm1               ; xmm4=tmp13\n        psubw   xmm0,xmm7               ; xmm0=tmp12\n\n        movdqa  xmm1,xmm3\n        paddw   xmm3,xmm6               ; xmm3=tmp10+tmp11\n        psubw   xmm1,xmm6               ; xmm1=tmp10-tmp11\n\n        psllw   xmm3,PASS1_BITS         ; xmm3=data0\n        psllw   xmm1,PASS1_BITS         ; xmm1=data4\n\n        movdqa  XMMWORD [wk(2)], xmm3   ; wk(2)=data0\n        movdqa  XMMWORD [wk(3)], xmm1   ; wk(3)=data4\n\n        ; (Original)\n        ; z1 = (tmp12 + tmp13) * 0.541196100;\n        ; data2 = z1 + tmp13 * 0.765366865;\n        ; data6 = z1 + tmp12 * -1.847759065;\n        ;\n        ; (This implementation)\n        ; data2 = tmp13 * (0.541196100 + 0.765366865) + tmp12 * 0.541196100;\n        ; data6 = tmp13 * 0.541196100 + tmp12 * (0.541196100 - 1.847759065);\n\n        movdqa    xmm7,xmm4             ; xmm4=tmp13\n        movdqa    xmm6,xmm4\n        punpcklwd xmm7,xmm0             ; xmm0=tmp12\n        punpckhwd xmm6,xmm0\n        movdqa    xmm4,xmm7\n        movdqa    xmm0,xmm6\n        pmaddwd   xmm7,[GOTOFF(ebx,PW_F130_F054)]       ; xmm7=data2L\n        pmaddwd   xmm6,[GOTOFF(ebx,PW_F130_F054)]       ; xmm6=data2H\n        pmaddwd   xmm4,[GOTOFF(ebx,PW_F054_MF130)]      ; xmm4=data6L\n        pmaddwd   xmm0,[GOTOFF(ebx,PW_F054_MF130)]      ; xmm0=data6H\n\n        paddd   xmm7,[GOTOFF(ebx,PD_DESCALE_P1)]\n        paddd   xmm6,[GOTOFF(ebx,PD_DESCALE_P1)]\n        psrad   xmm7,DESCALE_P1\n        psrad   xmm6,DESCALE_P1\n        paddd   xmm4,[GOTOFF(ebx,PD_DESCALE_P1)]\n        paddd   xmm0,[GOTOFF(ebx,PD_DESCALE_P1)]\n        psrad   xmm4,DESCALE_P1\n        psrad   xmm0,DESCALE_P1\n\n        packssdw  xmm7,xmm6             ; xmm7=data2\n        packssdw  xmm4,xmm0             ; xmm4=data6\n\n        movdqa  XMMWORD [wk(4)], xmm7   ; wk(4)=data2\n        movdqa  XMMWORD [wk(5)], xmm4   ; wk(5)=data6\n\n        ; -- Odd part\n\n        movdqa  xmm3, XMMWORD [wk(0)]   ; xmm3=tmp6\n        movdqa  xmm1, XMMWORD [wk(1)]   ; xmm1=tmp7\n\n        movdqa  xmm6,xmm2               ; xmm2=tmp4\n        movdqa  xmm0,xmm5               ; xmm5=tmp5\n        paddw   xmm6,xmm3               ; xmm6=z3\n        paddw   xmm0,xmm1               ; xmm0=z4\n\n        ; (Original)\n        ; z5 = (z3 + z4) * 1.175875602;\n        ; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n        ; z3 += z5;  z4 += z5;\n        ;\n        ; (This implementation)\n        ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n        ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n        movdqa    xmm7,xmm6\n        movdqa    xmm4,xmm6\n        punpcklwd xmm7,xmm0\n        punpckhwd xmm4,xmm0\n        movdqa    xmm6,xmm7\n        movdqa    xmm0,xmm4\n        pmaddwd   xmm7,[GOTOFF(ebx,PW_MF078_F117)]      ; xmm7=z3L\n        pmaddwd   xmm4,[GOTOFF(ebx,PW_MF078_F117)]      ; xmm4=z3H\n        pmaddwd   xmm6,[GOTOFF(ebx,PW_F117_F078)]       ; xmm6=z4L\n        pmaddwd   xmm0,[GOTOFF(ebx,PW_F117_F078)]       ; xmm0=z4H\n\n        movdqa  XMMWORD [wk(0)], xmm7   ; wk(0)=z3L\n        movdqa  XMMWORD [wk(1)], xmm4   ; wk(1)=z3H\n\n        ; (Original)\n        ; z1 = tmp4 + tmp7;  z2 = tmp5 + tmp6;\n        ; tmp4 = tmp4 * 0.298631336;  tmp5 = tmp5 * 2.053119869;\n        ; tmp6 = tmp6 * 3.072711026;  tmp7 = tmp7 * 1.501321110;\n        ; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n        ; data7 = tmp4 + z1 + z3;  data5 = tmp5 + z2 + z4;\n        ; data3 = tmp6 + z2 + z3;  data1 = tmp7 + z1 + z4;\n        ;\n        ; (This implementation)\n        ; tmp4 = tmp4 * (0.298631336 - 0.899976223) + tmp7 * -0.899976223;\n        ; tmp5 = tmp5 * (2.053119869 - 2.562915447) + tmp6 * -2.562915447;\n        ; tmp6 = tmp5 * -2.562915447 + tmp6 * (3.072711026 - 2.562915447);\n        ; tmp7 = tmp4 * -0.899976223 + tmp7 * (1.501321110 - 0.899976223);\n        ; data7 = tmp4 + z3;  data5 = tmp5 + z4;\n        ; data3 = tmp6 + z3;  data1 = tmp7 + z4;\n\n        movdqa    xmm7,xmm2\n        movdqa    xmm4,xmm2\n        punpcklwd xmm7,xmm1\n        punpckhwd xmm4,xmm1\n        movdqa    xmm2,xmm7\n        movdqa    xmm1,xmm4\n        pmaddwd   xmm7,[GOTOFF(ebx,PW_MF060_MF089)]     ; xmm7=tmp4L\n        pmaddwd   xmm4,[GOTOFF(ebx,PW_MF060_MF089)]     ; xmm4=tmp4H\n        pmaddwd   xmm2,[GOTOFF(ebx,PW_MF089_F060)]      ; xmm2=tmp7L\n        pmaddwd   xmm1,[GOTOFF(ebx,PW_MF089_F060)]      ; xmm1=tmp7H\n\n        paddd   xmm7, XMMWORD [wk(0)]   ; xmm7=data7L\n        paddd   xmm4, XMMWORD [wk(1)]   ; xmm4=data7H\n        paddd   xmm2,xmm6               ; xmm2=data1L\n        paddd   xmm1,xmm0               ; xmm1=data1H\n\n        paddd   xmm7,[GOTOFF(ebx,PD_DESCALE_P1)]\n        paddd   xmm4,[GOTOFF(ebx,PD_DESCALE_P1)]\n        psrad   xmm7,DESCALE_P1\n        psrad   xmm4,DESCALE_P1\n        paddd   xmm2,[GOTOFF(ebx,PD_DESCALE_P1)]\n        paddd   xmm1,[GOTOFF(ebx,PD_DESCALE_P1)]\n        psrad   xmm2,DESCALE_P1\n        psrad   xmm1,DESCALE_P1\n\n        packssdw  xmm7,xmm4             ; xmm7=data7\n        packssdw  xmm2,xmm1             ; xmm2=data1\n\n        movdqa    xmm4,xmm5\n        movdqa    xmm1,xmm5\n        punpcklwd xmm4,xmm3\n        punpckhwd xmm1,xmm3\n        movdqa    xmm5,xmm4\n        movdqa    xmm3,xmm1\n        pmaddwd   xmm4,[GOTOFF(ebx,PW_MF050_MF256)]     ; xmm4=tmp5L\n        pmaddwd   xmm1,[GOTOFF(ebx,PW_MF050_MF256)]     ; xmm1=tmp5H\n        pmaddwd   xmm5,[GOTOFF(ebx,PW_MF256_F050)]      ; xmm5=tmp6L\n        pmaddwd   xmm3,[GOTOFF(ebx,PW_MF256_F050)]      ; xmm3=tmp6H\n\n        paddd   xmm4,xmm6               ; xmm4=data5L\n        paddd   xmm1,xmm0               ; xmm1=data5H\n        paddd   xmm5, XMMWORD [wk(0)]   ; xmm5=data3L\n        paddd   xmm3, XMMWORD [wk(1)]   ; xmm3=data3H\n\n        paddd   xmm4,[GOTOFF(ebx,PD_DESCALE_P1)]\n        paddd   xmm1,[GOTOFF(ebx,PD_DESCALE_P1)]\n        psrad   xmm4,DESCALE_P1\n        psrad   xmm1,DESCALE_P1\n        paddd   xmm5,[GOTOFF(ebx,PD_DESCALE_P1)]\n        paddd   xmm3,[GOTOFF(ebx,PD_DESCALE_P1)]\n        psrad   xmm5,DESCALE_P1\n        psrad   xmm3,DESCALE_P1\n\n        packssdw  xmm4,xmm1             ; xmm4=data5\n        packssdw  xmm5,xmm3             ; xmm5=data3\n\n        ; ---- Pass 2: process columns.\n\n;       mov     edx, POINTER [data(eax)]        ; (DCTELEM *)\n\n        movdqa  xmm6, XMMWORD [wk(2)]   ; xmm6=col0\n        movdqa  xmm0, XMMWORD [wk(4)]   ; xmm0=col2\n\n        ; xmm6=(00 10 20 30 40 50 60 70), xmm0=(02 12 22 32 42 52 62 72)\n        ; xmm2=(01 11 21 31 41 51 61 71), xmm5=(03 13 23 33 43 53 63 73)\n\n        movdqa    xmm1,xmm6             ; transpose coefficients(phase 1)\n        punpcklwd xmm6,xmm2             ; xmm6=(00 01 10 11 20 21 30 31)\n        punpckhwd xmm1,xmm2             ; xmm1=(40 41 50 51 60 61 70 71)\n        movdqa    xmm3,xmm0             ; transpose coefficients(phase 1)\n        punpcklwd xmm0,xmm5             ; xmm0=(02 03 12 13 22 23 32 33)\n        punpckhwd xmm3,xmm5             ; xmm3=(42 43 52 53 62 63 72 73)\n\n        movdqa  xmm2, XMMWORD [wk(3)]   ; xmm2=col4\n        movdqa  xmm5, XMMWORD [wk(5)]   ; xmm5=col6\n\n        ; xmm2=(04 14 24 34 44 54 64 74), xmm5=(06 16 26 36 46 56 66 76)\n        ; xmm4=(05 15 25 35 45 55 65 75), xmm7=(07 17 27 37 47 57 67 77)\n\n        movdqa  XMMWORD [wk(0)], xmm0   ; wk(0)=(02 03 12 13 22 23 32 33)\n        movdqa  XMMWORD [wk(1)], xmm3   ; wk(1)=(42 43 52 53 62 63 72 73)\n\n        movdqa    xmm0,xmm2             ; transpose coefficients(phase 1)\n        punpcklwd xmm2,xmm4             ; xmm2=(04 05 14 15 24 25 34 35)\n        punpckhwd xmm0,xmm4             ; xmm0=(44 45 54 55 64 65 74 75)\n        movdqa    xmm3,xmm5             ; transpose coefficients(phase 1)\n        punpcklwd xmm5,xmm7             ; xmm5=(06 07 16 17 26 27 36 37)\n        punpckhwd xmm3,xmm7             ; xmm3=(46 47 56 57 66 67 76 77)\n\n        movdqa    xmm4,xmm2             ; transpose coefficients(phase 2)\n        punpckldq xmm2,xmm5             ; xmm2=(04 05 06 07 14 15 16 17)\n        punpckhdq xmm4,xmm5             ; xmm4=(24 25 26 27 34 35 36 37)\n        movdqa    xmm7,xmm0             ; transpose coefficients(phase 2)\n        punpckldq xmm0,xmm3             ; xmm0=(44 45 46 47 54 55 56 57)\n        punpckhdq xmm7,xmm3             ; xmm7=(64 65 66 67 74 75 76 77)\n\n        movdqa  xmm5, XMMWORD [wk(0)]   ; xmm5=(02 03 12 13 22 23 32 33)\n        movdqa  xmm3, XMMWORD [wk(1)]   ; xmm3=(42 43 52 53 62 63 72 73)\n        movdqa  XMMWORD [wk(2)], xmm4   ; wk(2)=(24 25 26 27 34 35 36 37)\n        movdqa  XMMWORD [wk(3)], xmm0   ; wk(3)=(44 45 46 47 54 55 56 57)\n\n        movdqa    xmm4,xmm6             ; transpose coefficients(phase 2)\n        punpckldq xmm6,xmm5             ; xmm6=(00 01 02 03 10 11 12 13)\n        punpckhdq xmm4,xmm5             ; xmm4=(20 21 22 23 30 31 32 33)\n        movdqa    xmm0,xmm1             ; transpose coefficients(phase 2)\n        punpckldq xmm1,xmm3             ; xmm1=(40 41 42 43 50 51 52 53)\n        punpckhdq xmm0,xmm3             ; xmm0=(60 61 62 63 70 71 72 73)\n\n        movdqa     xmm5,xmm6            ; transpose coefficients(phase 3)\n        punpcklqdq xmm6,xmm2            ; xmm6=(00 01 02 03 04 05 06 07)=data0\n        punpckhqdq xmm5,xmm2            ; xmm5=(10 11 12 13 14 15 16 17)=data1\n        movdqa     xmm3,xmm0            ; transpose coefficients(phase 3)\n        punpcklqdq xmm0,xmm7            ; xmm0=(60 61 62 63 64 65 66 67)=data6\n        punpckhqdq xmm3,xmm7            ; xmm3=(70 71 72 73 74 75 76 77)=data7\n\n        movdqa  xmm2,xmm5\n        movdqa  xmm7,xmm6\n        psubw   xmm5,xmm0               ; xmm5=data1-data6=tmp6\n        psubw   xmm6,xmm3               ; xmm6=data0-data7=tmp7\n        paddw   xmm2,xmm0               ; xmm2=data1+data6=tmp1\n        paddw   xmm7,xmm3               ; xmm7=data0+data7=tmp0\n\n        movdqa  xmm0, XMMWORD [wk(2)]   ; xmm0=(24 25 26 27 34 35 36 37)\n        movdqa  xmm3, XMMWORD [wk(3)]   ; xmm3=(44 45 46 47 54 55 56 57)\n        movdqa  XMMWORD [wk(0)], xmm5   ; wk(0)=tmp6\n        movdqa  XMMWORD [wk(1)], xmm6   ; wk(1)=tmp7\n\n        movdqa     xmm5,xmm4            ; transpose coefficients(phase 3)\n        punpcklqdq xmm4,xmm0            ; xmm4=(20 21 22 23 24 25 26 27)=data2\n        punpckhqdq xmm5,xmm0            ; xmm5=(30 31 32 33 34 35 36 37)=data3\n        movdqa     xmm6,xmm1            ; transpose coefficients(phase 3)\n        punpcklqdq xmm1,xmm3            ; xmm1=(40 41 42 43 44 45 46 47)=data4\n        punpckhqdq xmm6,xmm3            ; xmm6=(50 51 52 53 54 55 56 57)=data5\n\n        movdqa  xmm0,xmm5\n        movdqa  xmm3,xmm4\n        paddw   xmm5,xmm1               ; xmm5=data3+data4=tmp3\n        paddw   xmm4,xmm6               ; xmm4=data2+data5=tmp2\n        psubw   xmm0,xmm1               ; xmm0=data3-data4=tmp4\n        psubw   xmm3,xmm6               ; xmm3=data2-data5=tmp5\n\n        ; -- Even part\n\n        movdqa  xmm1,xmm7\n        movdqa  xmm6,xmm2\n        paddw   xmm7,xmm5               ; xmm7=tmp10\n        paddw   xmm2,xmm4               ; xmm2=tmp11\n        psubw   xmm1,xmm5               ; xmm1=tmp13\n        psubw   xmm6,xmm4               ; xmm6=tmp12\n\n        movdqa  xmm5,xmm7\n        paddw   xmm7,xmm2               ; xmm7=tmp10+tmp11\n        psubw   xmm5,xmm2               ; xmm5=tmp10-tmp11\n\n        paddw   xmm7,[GOTOFF(ebx,PW_DESCALE_P2X)]\n        paddw   xmm5,[GOTOFF(ebx,PW_DESCALE_P2X)]\n        psraw   xmm7,PASS1_BITS         ; xmm7=data0\n        psraw   xmm5,PASS1_BITS         ; xmm5=data4\n\n        movdqa  XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_DCTELEM)], xmm7\n        movdqa  XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_DCTELEM)], xmm5\n\n        ; (Original)\n        ; z1 = (tmp12 + tmp13) * 0.541196100;\n        ; data2 = z1 + tmp13 * 0.765366865;\n        ; data6 = z1 + tmp12 * -1.847759065;\n        ;\n        ; (This implementation)\n        ; data2 = tmp13 * (0.541196100 + 0.765366865) + tmp12 * 0.541196100;\n        ; data6 = tmp13 * 0.541196100 + tmp12 * (0.541196100 - 1.847759065);\n\n        movdqa    xmm4,xmm1             ; xmm1=tmp13\n        movdqa    xmm2,xmm1\n        punpcklwd xmm4,xmm6             ; xmm6=tmp12\n        punpckhwd xmm2,xmm6\n        movdqa    xmm1,xmm4\n        movdqa    xmm6,xmm2\n        pmaddwd   xmm4,[GOTOFF(ebx,PW_F130_F054)]       ; xmm4=data2L\n        pmaddwd   xmm2,[GOTOFF(ebx,PW_F130_F054)]       ; xmm2=data2H\n        pmaddwd   xmm1,[GOTOFF(ebx,PW_F054_MF130)]      ; xmm1=data6L\n        pmaddwd   xmm6,[GOTOFF(ebx,PW_F054_MF130)]      ; xmm6=data6H\n\n        paddd   xmm4,[GOTOFF(ebx,PD_DESCALE_P2)]\n        paddd   xmm2,[GOTOFF(ebx,PD_DESCALE_P2)]\n        psrad   xmm4,DESCALE_P2\n        psrad   xmm2,DESCALE_P2\n        paddd   xmm1,[GOTOFF(ebx,PD_DESCALE_P2)]\n        paddd   xmm6,[GOTOFF(ebx,PD_DESCALE_P2)]\n        psrad   xmm1,DESCALE_P2\n        psrad   xmm6,DESCALE_P2\n\n        packssdw  xmm4,xmm2             ; xmm4=data2\n        packssdw  xmm1,xmm6             ; xmm1=data6\n\n        movdqa  XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_DCTELEM)], xmm4\n        movdqa  XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_DCTELEM)], xmm1\n\n        ; -- Odd part\n\n        movdqa  xmm7, XMMWORD [wk(0)]   ; xmm7=tmp6\n        movdqa  xmm5, XMMWORD [wk(1)]   ; xmm5=tmp7\n\n        movdqa  xmm2,xmm0               ; xmm0=tmp4\n        movdqa  xmm6,xmm3               ; xmm3=tmp5\n        paddw   xmm2,xmm7               ; xmm2=z3\n        paddw   xmm6,xmm5               ; xmm6=z4\n\n        ; (Original)\n        ; z5 = (z3 + z4) * 1.175875602;\n        ; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n        ; z3 += z5;  z4 += z5;\n        ;\n        ; (This implementation)\n        ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n        ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n        movdqa    xmm4,xmm2\n        movdqa    xmm1,xmm2\n        punpcklwd xmm4,xmm6\n        punpckhwd xmm1,xmm6\n        movdqa    xmm2,xmm4\n        movdqa    xmm6,xmm1\n        pmaddwd   xmm4,[GOTOFF(ebx,PW_MF078_F117)]      ; xmm4=z3L\n        pmaddwd   xmm1,[GOTOFF(ebx,PW_MF078_F117)]      ; xmm1=z3H\n        pmaddwd   xmm2,[GOTOFF(ebx,PW_F117_F078)]       ; xmm2=z4L\n        pmaddwd   xmm6,[GOTOFF(ebx,PW_F117_F078)]       ; xmm6=z4H\n\n        movdqa  XMMWORD [wk(0)], xmm4   ; wk(0)=z3L\n        movdqa  XMMWORD [wk(1)], xmm1   ; wk(1)=z3H\n\n        ; (Original)\n        ; z1 = tmp4 + tmp7;  z2 = tmp5 + tmp6;\n        ; tmp4 = tmp4 * 0.298631336;  tmp5 = tmp5 * 2.053119869;\n        ; tmp6 = tmp6 * 3.072711026;  tmp7 = tmp7 * 1.501321110;\n        ; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n        ; data7 = tmp4 + z1 + z3;  data5 = tmp5 + z2 + z4;\n        ; data3 = tmp6 + z2 + z3;  data1 = tmp7 + z1 + z4;\n        ;\n        ; (This implementation)\n        ; tmp4 = tmp4 * (0.298631336 - 0.899976223) + tmp7 * -0.899976223;\n        ; tmp5 = tmp5 * (2.053119869 - 2.562915447) + tmp6 * -2.562915447;\n        ; tmp6 = tmp5 * -2.562915447 + tmp6 * (3.072711026 - 2.562915447);\n        ; tmp7 = tmp4 * -0.899976223 + tmp7 * (1.501321110 - 0.899976223);\n        ; data7 = tmp4 + z3;  data5 = tmp5 + z4;\n        ; data3 = tmp6 + z3;  data1 = tmp7 + z4;\n\n        movdqa    xmm4,xmm0\n        movdqa    xmm1,xmm0\n        punpcklwd xmm4,xmm5\n        punpckhwd xmm1,xmm5\n        movdqa    xmm0,xmm4\n        movdqa    xmm5,xmm1\n        pmaddwd   xmm4,[GOTOFF(ebx,PW_MF060_MF089)]     ; xmm4=tmp4L\n        pmaddwd   xmm1,[GOTOFF(ebx,PW_MF060_MF089)]     ; xmm1=tmp4H\n        pmaddwd   xmm0,[GOTOFF(ebx,PW_MF089_F060)]      ; xmm0=tmp7L\n        pmaddwd   xmm5,[GOTOFF(ebx,PW_MF089_F060)]      ; xmm5=tmp7H\n\n        paddd   xmm4, XMMWORD [wk(0)]   ; xmm4=data7L\n        paddd   xmm1, XMMWORD [wk(1)]   ; xmm1=data7H\n        paddd   xmm0,xmm2               ; xmm0=data1L\n        paddd   xmm5,xmm6               ; xmm5=data1H\n\n        paddd   xmm4,[GOTOFF(ebx,PD_DESCALE_P2)]\n        paddd   xmm1,[GOTOFF(ebx,PD_DESCALE_P2)]\n        psrad   xmm4,DESCALE_P2\n        psrad   xmm1,DESCALE_P2\n        paddd   xmm0,[GOTOFF(ebx,PD_DESCALE_P2)]\n        paddd   xmm5,[GOTOFF(ebx,PD_DESCALE_P2)]\n        psrad   xmm0,DESCALE_P2\n        psrad   xmm5,DESCALE_P2\n\n        packssdw  xmm4,xmm1             ; xmm4=data7\n        packssdw  xmm0,xmm5             ; xmm0=data1\n\n        movdqa  XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_DCTELEM)], xmm4\n        movdqa  XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_DCTELEM)], xmm0\n\n        movdqa    xmm1,xmm3\n        movdqa    xmm5,xmm3\n        punpcklwd xmm1,xmm7\n        punpckhwd xmm5,xmm7\n        movdqa    xmm3,xmm1\n        movdqa    xmm7,xmm5\n        pmaddwd   xmm1,[GOTOFF(ebx,PW_MF050_MF256)]     ; xmm1=tmp5L\n        pmaddwd   xmm5,[GOTOFF(ebx,PW_MF050_MF256)]     ; xmm5=tmp5H\n        pmaddwd   xmm3,[GOTOFF(ebx,PW_MF256_F050)]      ; xmm3=tmp6L\n        pmaddwd   xmm7,[GOTOFF(ebx,PW_MF256_F050)]      ; xmm7=tmp6H\n\n        paddd   xmm1,xmm2               ; xmm1=data5L\n        paddd   xmm5,xmm6               ; xmm5=data5H\n        paddd   xmm3, XMMWORD [wk(0)]   ; xmm3=data3L\n        paddd   xmm7, XMMWORD [wk(1)]   ; xmm7=data3H\n\n        paddd   xmm1,[GOTOFF(ebx,PD_DESCALE_P2)]\n        paddd   xmm5,[GOTOFF(ebx,PD_DESCALE_P2)]\n        psrad   xmm1,DESCALE_P2\n        psrad   xmm5,DESCALE_P2\n        paddd   xmm3,[GOTOFF(ebx,PD_DESCALE_P2)]\n        paddd   xmm7,[GOTOFF(ebx,PD_DESCALE_P2)]\n        psrad   xmm3,DESCALE_P2\n        psrad   xmm7,DESCALE_P2\n\n        packssdw  xmm1,xmm5             ; xmm1=data5\n        packssdw  xmm3,xmm7             ; xmm3=data3\n\n        movdqa  XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_DCTELEM)], xmm1\n        movdqa  XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_DCTELEM)], xmm3\n\n;       pop     edi             ; unused\n;       pop     esi             ; unused\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; unused\n        poppic  ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jidctflt-3dn.asm",
    "content": ";\n; jidctflt.asm - floating-point IDCT (3DNow! & MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a floating-point implementation of the inverse DCT\n; (Discrete Cosine Transform). The following code is based directly on\n; the IJG's original jidctflt.c; see the jidctflt.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_idct_float_3dnow)\n\nEXTN(jconst_idct_float_3dnow):\n\nPD_1_414        times 2 dd  1.414213562373095048801689\nPD_1_847        times 2 dd  1.847759065022573512256366\nPD_1_082        times 2 dd  1.082392200292393968799446\nPD_2_613        times 2 dd  2.613125929752753055713286\nPD_RNDINT_MAGIC times 2 dd  100663296.0 ; (float)(0x00C00000 << 3)\nPB_CENTERJSAMP  times 8 db  CENTERJSAMPLE\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_float_3dnow (void *dct_table, JCOEFPTR coef_block,\n;                         JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)    (b)+8           ; void *dct_table\n%define coef_block(b)   (b)+12          ; JCOEFPTR coef_block\n%define output_buf(b)   (b)+16          ; JSAMPARRAY output_buf\n%define output_col(b)   (b)+20          ; JDIMENSION output_col\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_MMWORD  ; mmword wk[WK_NUM]\n%define WK_NUM          2\n%define workspace       wk(0)-DCTSIZE2*SIZEOF_FAST_FLOAT\n                                        ; FAST_FLOAT workspace[DCTSIZE2]\n\n        align   16\n        global  EXTN(jsimd_idct_float_3dnow)\n\nEXTN(jsimd_idct_float_3dnow):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_MMWORD)      ; align to 64 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [workspace]\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process columns from input, store into work array.\n\n;       mov     eax, [original_ebp]\n        mov     edx, POINTER [dct_table(eax)]           ; quantptr\n        mov     esi, JCOEFPTR [coef_block(eax)]         ; inptr\n        lea     edi, [workspace]                        ; FAST_FLOAT *wsptr\n        mov     ecx, DCTSIZE/2                          ; ctr\n        alignx  16,7\n.columnloop:\n%ifndef NO_ZERO_COLUMN_TEST_FLOAT_3DNOW\n        mov     eax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        or      eax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        jnz     short .columnDCT\n\n        pushpic ebx             ; save GOT address\n        mov     ebx, DWORD [DWBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        mov     eax, DWORD [DWBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        or      ebx, DWORD [DWBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        or      eax, DWORD [DWBLOCK(6,0,esi,SIZEOF_JCOEF)]\n        or      ebx, DWORD [DWBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        or      eax,ebx\n        poppic  ebx             ; restore GOT address\n        jnz     short .columnDCT\n\n        ; -- AC terms all zero\n\n        movd      mm0, DWORD [DWBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\n        punpcklwd mm0,mm0\n        psrad     mm0,(DWORD_BIT-WORD_BIT)\n        pi2fd     mm0,mm0\n\n        pfmul     mm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        movq      mm1,mm0\n        punpckldq mm0,mm0\n        punpckhdq mm1,mm1\n\n        movq    MMWORD [MMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], mm0\n        movq    MMWORD [MMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], mm0\n        movq    MMWORD [MMBLOCK(0,2,edi,SIZEOF_FAST_FLOAT)], mm0\n        movq    MMWORD [MMBLOCK(0,3,edi,SIZEOF_FAST_FLOAT)], mm0\n        movq    MMWORD [MMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], mm1\n        movq    MMWORD [MMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], mm1\n        movq    MMWORD [MMBLOCK(1,2,edi,SIZEOF_FAST_FLOAT)], mm1\n        movq    MMWORD [MMBLOCK(1,3,edi,SIZEOF_FAST_FLOAT)], mm1\n        jmp     near .nextcolumn\n        alignx  16,7\n%endif\n.columnDCT:\n\n        ; -- Even part\n\n        movd      mm0, DWORD [DWBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        movd      mm1, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        movd      mm2, DWORD [DWBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        movd      mm3, DWORD [DWBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\n        punpcklwd mm0,mm0\n        punpcklwd mm1,mm1\n        psrad     mm0,(DWORD_BIT-WORD_BIT)\n        psrad     mm1,(DWORD_BIT-WORD_BIT)\n        pi2fd     mm0,mm0\n        pi2fd     mm1,mm1\n\n        pfmul     mm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n        pfmul     mm1, MMWORD [MMBLOCK(2,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        punpcklwd mm2,mm2\n        punpcklwd mm3,mm3\n        psrad     mm2,(DWORD_BIT-WORD_BIT)\n        psrad     mm3,(DWORD_BIT-WORD_BIT)\n        pi2fd     mm2,mm2\n        pi2fd     mm3,mm3\n\n        pfmul     mm2, MMWORD [MMBLOCK(4,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n        pfmul     mm3, MMWORD [MMBLOCK(6,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        movq    mm4,mm0\n        movq    mm5,mm1\n        pfsub   mm0,mm2                 ; mm0=tmp11\n        pfsub   mm1,mm3\n        pfadd   mm4,mm2                 ; mm4=tmp10\n        pfadd   mm5,mm3                 ; mm5=tmp13\n\n        pfmul   mm1,[GOTOFF(ebx,PD_1_414)]\n        pfsub   mm1,mm5                 ; mm1=tmp12\n\n        movq    mm6,mm4\n        movq    mm7,mm0\n        pfsub   mm4,mm5                 ; mm4=tmp3\n        pfsub   mm0,mm1                 ; mm0=tmp2\n        pfadd   mm6,mm5                 ; mm6=tmp0\n        pfadd   mm7,mm1                 ; mm7=tmp1\n\n        movq    MMWORD [wk(1)], mm4     ; tmp3\n        movq    MMWORD [wk(0)], mm0     ; tmp2\n\n        ; -- Odd part\n\n        movd      mm2, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movd      mm3, DWORD [DWBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        movd      mm5, DWORD [DWBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        movd      mm1, DWORD [DWBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\n        punpcklwd mm2,mm2\n        punpcklwd mm3,mm3\n        psrad     mm2,(DWORD_BIT-WORD_BIT)\n        psrad     mm3,(DWORD_BIT-WORD_BIT)\n        pi2fd     mm2,mm2\n        pi2fd     mm3,mm3\n\n        pfmul     mm2, MMWORD [MMBLOCK(1,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n        pfmul     mm3, MMWORD [MMBLOCK(3,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        punpcklwd mm5,mm5\n        punpcklwd mm1,mm1\n        psrad     mm5,(DWORD_BIT-WORD_BIT)\n        psrad     mm1,(DWORD_BIT-WORD_BIT)\n        pi2fd     mm5,mm5\n        pi2fd     mm1,mm1\n\n        pfmul     mm5, MMWORD [MMBLOCK(5,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n        pfmul     mm1, MMWORD [MMBLOCK(7,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        movq    mm4,mm2\n        movq    mm0,mm5\n        pfadd   mm2,mm1                 ; mm2=z11\n        pfadd   mm5,mm3                 ; mm5=z13\n        pfsub   mm4,mm1                 ; mm4=z12\n        pfsub   mm0,mm3                 ; mm0=z10\n\n        movq    mm1,mm2\n        pfsub   mm2,mm5\n        pfadd   mm1,mm5                 ; mm1=tmp7\n\n        pfmul   mm2,[GOTOFF(ebx,PD_1_414)]      ; mm2=tmp11\n\n        movq    mm3,mm0\n        pfadd   mm0,mm4\n        pfmul   mm0,[GOTOFF(ebx,PD_1_847)]      ; mm0=z5\n        pfmul   mm3,[GOTOFF(ebx,PD_2_613)]      ; mm3=(z10 * 2.613125930)\n        pfmul   mm4,[GOTOFF(ebx,PD_1_082)]      ; mm4=(z12 * 1.082392200)\n        pfsubr  mm3,mm0                 ; mm3=tmp12\n        pfsub   mm4,mm0                 ; mm4=tmp10\n\n        ; -- Final output stage\n\n        pfsub   mm3,mm1                 ; mm3=tmp6\n        movq    mm5,mm6\n        movq    mm0,mm7\n        pfadd   mm6,mm1                 ; mm6=data0=(00 01)\n        pfadd   mm7,mm3                 ; mm7=data1=(10 11)\n        pfsub   mm5,mm1                 ; mm5=data7=(70 71)\n        pfsub   mm0,mm3                 ; mm0=data6=(60 61)\n        pfsub   mm2,mm3                 ; mm2=tmp5\n\n        movq      mm1,mm6               ; transpose coefficients\n        punpckldq mm6,mm7               ; mm6=(00 10)\n        punpckhdq mm1,mm7               ; mm1=(01 11)\n        movq      mm3,mm0               ; transpose coefficients\n        punpckldq mm0,mm5               ; mm0=(60 70)\n        punpckhdq mm3,mm5               ; mm3=(61 71)\n\n        movq    MMWORD [MMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], mm6\n        movq    MMWORD [MMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], mm1\n        movq    MMWORD [MMBLOCK(0,3,edi,SIZEOF_FAST_FLOAT)], mm0\n        movq    MMWORD [MMBLOCK(1,3,edi,SIZEOF_FAST_FLOAT)], mm3\n\n        movq    mm7, MMWORD [wk(0)]     ; mm7=tmp2\n        movq    mm5, MMWORD [wk(1)]     ; mm5=tmp3\n\n        pfadd   mm4,mm2                 ; mm4=tmp4\n        movq    mm6,mm7\n        movq    mm1,mm5\n        pfadd   mm7,mm2                 ; mm7=data2=(20 21)\n        pfadd   mm5,mm4                 ; mm5=data4=(40 41)\n        pfsub   mm6,mm2                 ; mm6=data5=(50 51)\n        pfsub   mm1,mm4                 ; mm1=data3=(30 31)\n\n        movq      mm0,mm7               ; transpose coefficients\n        punpckldq mm7,mm1               ; mm7=(20 30)\n        punpckhdq mm0,mm1               ; mm0=(21 31)\n        movq      mm3,mm5               ; transpose coefficients\n        punpckldq mm5,mm6               ; mm5=(40 50)\n        punpckhdq mm3,mm6               ; mm3=(41 51)\n\n        movq    MMWORD [MMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], mm7\n        movq    MMWORD [MMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], mm0\n        movq    MMWORD [MMBLOCK(0,2,edi,SIZEOF_FAST_FLOAT)], mm5\n        movq    MMWORD [MMBLOCK(1,2,edi,SIZEOF_FAST_FLOAT)], mm3\n\n.nextcolumn:\n        add     esi, byte 2*SIZEOF_JCOEF                ; coef_block\n        add     edx, byte 2*SIZEOF_FLOAT_MULT_TYPE      ; quantptr\n        add     edi, byte 2*DCTSIZE*SIZEOF_FAST_FLOAT   ; wsptr\n        dec     ecx                                     ; ctr\n        jnz     near .columnloop\n\n        ; -- Prefetch the next coefficient block\n\n        prefetch [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 0*32]\n        prefetch [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 1*32]\n        prefetch [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 2*32]\n        prefetch [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 3*32]\n\n        ; ---- Pass 2: process rows from work array, store into output array.\n\n        mov     eax, [original_ebp]\n        lea     esi, [workspace]                        ; FAST_FLOAT *wsptr\n        mov     edi, JSAMPARRAY [output_buf(eax)]       ; (JSAMPROW *)\n        mov     eax, JDIMENSION [output_col(eax)]\n        mov     ecx, DCTSIZE/2                          ; ctr\n        alignx  16,7\n.rowloop:\n\n        ; -- Even part\n\n        movq    mm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_FAST_FLOAT)]\n        movq    mm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_FAST_FLOAT)]\n        movq    mm2, MMWORD [MMBLOCK(4,0,esi,SIZEOF_FAST_FLOAT)]\n        movq    mm3, MMWORD [MMBLOCK(6,0,esi,SIZEOF_FAST_FLOAT)]\n\n        movq    mm4,mm0\n        movq    mm5,mm1\n        pfsub   mm0,mm2                 ; mm0=tmp11\n        pfsub   mm1,mm3\n        pfadd   mm4,mm2                 ; mm4=tmp10\n        pfadd   mm5,mm3                 ; mm5=tmp13\n\n        pfmul   mm1,[GOTOFF(ebx,PD_1_414)]\n        pfsub   mm1,mm5                 ; mm1=tmp12\n\n        movq    mm6,mm4\n        movq    mm7,mm0\n        pfsub   mm4,mm5                 ; mm4=tmp3\n        pfsub   mm0,mm1                 ; mm0=tmp2\n        pfadd   mm6,mm5                 ; mm6=tmp0\n        pfadd   mm7,mm1                 ; mm7=tmp1\n\n        movq    MMWORD [wk(1)], mm4     ; tmp3\n        movq    MMWORD [wk(0)], mm0     ; tmp2\n\n        ; -- Odd part\n\n        movq    mm2, MMWORD [MMBLOCK(1,0,esi,SIZEOF_FAST_FLOAT)]\n        movq    mm3, MMWORD [MMBLOCK(3,0,esi,SIZEOF_FAST_FLOAT)]\n        movq    mm5, MMWORD [MMBLOCK(5,0,esi,SIZEOF_FAST_FLOAT)]\n        movq    mm1, MMWORD [MMBLOCK(7,0,esi,SIZEOF_FAST_FLOAT)]\n\n        movq    mm4,mm2\n        movq    mm0,mm5\n        pfadd   mm2,mm1                 ; mm2=z11\n        pfadd   mm5,mm3                 ; mm5=z13\n        pfsub   mm4,mm1                 ; mm4=z12\n        pfsub   mm0,mm3                 ; mm0=z10\n\n        movq    mm1,mm2\n        pfsub   mm2,mm5\n        pfadd   mm1,mm5                 ; mm1=tmp7\n\n        pfmul   mm2,[GOTOFF(ebx,PD_1_414)]      ; mm2=tmp11\n\n        movq    mm3,mm0\n        pfadd   mm0,mm4\n        pfmul   mm0,[GOTOFF(ebx,PD_1_847)]      ; mm0=z5\n        pfmul   mm3,[GOTOFF(ebx,PD_2_613)]      ; mm3=(z10 * 2.613125930)\n        pfmul   mm4,[GOTOFF(ebx,PD_1_082)]      ; mm4=(z12 * 1.082392200)\n        pfsubr  mm3,mm0                 ; mm3=tmp12\n        pfsub   mm4,mm0                 ; mm4=tmp10\n\n        ; -- Final output stage\n\n        pfsub   mm3,mm1                 ; mm3=tmp6\n        movq    mm5,mm6\n        movq    mm0,mm7\n        pfadd   mm6,mm1                 ; mm6=data0=(00 10)\n        pfadd   mm7,mm3                 ; mm7=data1=(01 11)\n        pfsub   mm5,mm1                 ; mm5=data7=(07 17)\n        pfsub   mm0,mm3                 ; mm0=data6=(06 16)\n        pfsub   mm2,mm3                 ; mm2=tmp5\n\n        movq    mm1,[GOTOFF(ebx,PD_RNDINT_MAGIC)]       ; mm1=[PD_RNDINT_MAGIC]\n        pcmpeqd mm3,mm3\n        psrld   mm3,WORD_BIT            ; mm3={0xFFFF 0x0000 0xFFFF 0x0000}\n\n        pfadd   mm6,mm1                 ; mm6=roundint(data0/8)=(00 ** 10 **)\n        pfadd   mm7,mm1                 ; mm7=roundint(data1/8)=(01 ** 11 **)\n        pfadd   mm0,mm1                 ; mm0=roundint(data6/8)=(06 ** 16 **)\n        pfadd   mm5,mm1                 ; mm5=roundint(data7/8)=(07 ** 17 **)\n\n        pand    mm6,mm3                 ; mm6=(00 -- 10 --)\n        pslld   mm7,WORD_BIT            ; mm7=(-- 01 -- 11)\n        pand    mm0,mm3                 ; mm0=(06 -- 16 --)\n        pslld   mm5,WORD_BIT            ; mm5=(-- 07 -- 17)\n        por     mm6,mm7                 ; mm6=(00 01 10 11)\n        por     mm0,mm5                 ; mm0=(06 07 16 17)\n\n        movq    mm1, MMWORD [wk(0)]     ; mm1=tmp2\n        movq    mm3, MMWORD [wk(1)]     ; mm3=tmp3\n\n        pfadd   mm4,mm2                 ; mm4=tmp4\n        movq    mm7,mm1\n        movq    mm5,mm3\n        pfadd   mm1,mm2                 ; mm1=data2=(02 12)\n        pfadd   mm3,mm4                 ; mm3=data4=(04 14)\n        pfsub   mm7,mm2                 ; mm7=data5=(05 15)\n        pfsub   mm5,mm4                 ; mm5=data3=(03 13)\n\n        movq    mm2,[GOTOFF(ebx,PD_RNDINT_MAGIC)]       ; mm2=[PD_RNDINT_MAGIC]\n        pcmpeqd mm4,mm4\n        psrld   mm4,WORD_BIT            ; mm4={0xFFFF 0x0000 0xFFFF 0x0000}\n\n        pfadd   mm3,mm2                 ; mm3=roundint(data4/8)=(04 ** 14 **)\n        pfadd   mm7,mm2                 ; mm7=roundint(data5/8)=(05 ** 15 **)\n        pfadd   mm1,mm2                 ; mm1=roundint(data2/8)=(02 ** 12 **)\n        pfadd   mm5,mm2                 ; mm5=roundint(data3/8)=(03 ** 13 **)\n\n        pand    mm3,mm4                 ; mm3=(04 -- 14 --)\n        pslld   mm7,WORD_BIT            ; mm7=(-- 05 -- 15)\n        pand    mm1,mm4                 ; mm1=(02 -- 12 --)\n        pslld   mm5,WORD_BIT            ; mm5=(-- 03 -- 13)\n        por     mm3,mm7                 ; mm3=(04 05 14 15)\n        por     mm1,mm5                 ; mm1=(02 03 12 13)\n\n        movq      mm2,[GOTOFF(ebx,PB_CENTERJSAMP)]      ; mm2=[PB_CENTERJSAMP]\n\n        packsswb  mm6,mm3               ; mm6=(00 01 10 11 04 05 14 15)\n        packsswb  mm1,mm0               ; mm1=(02 03 12 13 06 07 16 17)\n        paddb     mm6,mm2\n        paddb     mm1,mm2\n\n        movq      mm4,mm6               ; transpose coefficients(phase 2)\n        punpcklwd mm6,mm1               ; mm6=(00 01 02 03 10 11 12 13)\n        punpckhwd mm4,mm1               ; mm4=(04 05 06 07 14 15 16 17)\n\n        movq      mm7,mm6               ; transpose coefficients(phase 3)\n        punpckldq mm6,mm4               ; mm6=(00 01 02 03 04 05 06 07)\n        punpckhdq mm7,mm4               ; mm7=(10 11 12 13 14 15 16 17)\n\n        pushpic ebx                     ; save GOT address\n\n        mov     edx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n        mov     ebx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n        movq    MMWORD [edx+eax*SIZEOF_JSAMPLE], mm6\n        movq    MMWORD [ebx+eax*SIZEOF_JSAMPLE], mm7\n\n        poppic  ebx                     ; restore GOT address\n\n        add     esi, byte 2*SIZEOF_FAST_FLOAT   ; wsptr\n        add     edi, byte 2*SIZEOF_JSAMPROW\n        dec     ecx                             ; ctr\n        jnz     near .rowloop\n\n        femms           ; empty MMX/3DNow! state\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jidctflt-sse.asm",
    "content": ";\n; jidctflt.asm - floating-point IDCT (SSE & MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a floating-point implementation of the inverse DCT\n; (Discrete Cosine Transform). The following code is based directly on\n; the IJG's original jidctflt.c; see the jidctflt.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%macro  unpcklps2 2     ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(0 1 4 5)\n        shufps  %1,%2,0x44\n%endmacro\n\n%macro  unpckhps2 2     ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(2 3 6 7)\n        shufps  %1,%2,0xEE\n%endmacro\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_idct_float_sse)\n\nEXTN(jconst_idct_float_sse):\n\nPD_1_414        times 4 dd  1.414213562373095048801689\nPD_1_847        times 4 dd  1.847759065022573512256366\nPD_1_082        times 4 dd  1.082392200292393968799446\nPD_M2_613       times 4 dd -2.613125929752753055713286\nPD_0_125        times 4 dd  0.125       ; 1/8\nPB_CENTERJSAMP  times 8 db  CENTERJSAMPLE\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_float_sse (void *dct_table, JCOEFPTR coef_block,\n;                       JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)    (b)+8           ; void *dct_table\n%define coef_block(b)   (b)+12          ; JCOEFPTR coef_block\n%define output_buf(b)   (b)+16          ; JSAMPARRAY output_buf\n%define output_col(b)   (b)+20          ; JDIMENSION output_col\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          2\n%define workspace       wk(0)-DCTSIZE2*SIZEOF_FAST_FLOAT\n                                        ; FAST_FLOAT workspace[DCTSIZE2]\n\n        align   16\n        global  EXTN(jsimd_idct_float_sse)\n\nEXTN(jsimd_idct_float_sse):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [workspace]\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process columns from input, store into work array.\n\n;       mov     eax, [original_ebp]\n        mov     edx, POINTER [dct_table(eax)]           ; quantptr\n        mov     esi, JCOEFPTR [coef_block(eax)]         ; inptr\n        lea     edi, [workspace]                        ; FAST_FLOAT *wsptr\n        mov     ecx, DCTSIZE/4                          ; ctr\n        alignx  16,7\n.columnloop:\n%ifndef NO_ZERO_COLUMN_TEST_FLOAT_SSE\n        mov     eax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        or      eax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        jnz     near .columnDCT\n\n        movq    mm0, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movq    mm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        por     mm0, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        por     mm1, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        por     mm0, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        por     mm1, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n        por     mm0, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        por     mm1,mm0\n        packsswb mm1,mm1\n        movd    eax,mm1\n        test    eax,eax\n        jnz     short .columnDCT\n\n        ; -- AC terms all zero\n\n        movq      mm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\n        punpckhwd mm1,mm0                       ; mm1=(** 02 ** 03)\n        punpcklwd mm0,mm0                       ; mm0=(00 00 01 01)\n        psrad     mm1,(DWORD_BIT-WORD_BIT)      ; mm1=in0H=(02 03)\n        psrad     mm0,(DWORD_BIT-WORD_BIT)      ; mm0=in0L=(00 01)\n        cvtpi2ps  xmm3,mm1                      ; xmm3=(02 03 ** **)\n        cvtpi2ps  xmm0,mm0                      ; xmm0=(00 01 ** **)\n        movlhps   xmm0,xmm3                     ; xmm0=in0=(00 01 02 03)\n\n        mulps   xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        movaps  xmm1,xmm0\n        movaps  xmm2,xmm0\n        movaps  xmm3,xmm0\n\n        shufps  xmm0,xmm0,0x00                  ; xmm0=(00 00 00 00)\n        shufps  xmm1,xmm1,0x55                  ; xmm1=(01 01 01 01)\n        shufps  xmm2,xmm2,0xAA                  ; xmm2=(02 02 02 02)\n        shufps  xmm3,xmm3,0xFF                  ; xmm3=(03 03 03 03)\n\n        movaps  XMMWORD [XMMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], xmm0\n        movaps  XMMWORD [XMMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], xmm0\n        movaps  XMMWORD [XMMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], xmm1\n        movaps  XMMWORD [XMMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], xmm1\n        movaps  XMMWORD [XMMBLOCK(2,0,edi,SIZEOF_FAST_FLOAT)], xmm2\n        movaps  XMMWORD [XMMBLOCK(2,1,edi,SIZEOF_FAST_FLOAT)], xmm2\n        movaps  XMMWORD [XMMBLOCK(3,0,edi,SIZEOF_FAST_FLOAT)], xmm3\n        movaps  XMMWORD [XMMBLOCK(3,1,edi,SIZEOF_FAST_FLOAT)], xmm3\n        jmp     near .nextcolumn\n        alignx  16,7\n%endif\n.columnDCT:\n\n        ; -- Even part\n\n        movq      mm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        movq      mm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        movq      mm2, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        movq      mm3, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\n        punpckhwd mm4,mm0                       ; mm4=(** 02 ** 03)\n        punpcklwd mm0,mm0                       ; mm0=(00 00 01 01)\n        punpckhwd mm5,mm1                       ; mm5=(** 22 ** 23)\n        punpcklwd mm1,mm1                       ; mm1=(20 20 21 21)\n\n        psrad     mm4,(DWORD_BIT-WORD_BIT)      ; mm4=in0H=(02 03)\n        psrad     mm0,(DWORD_BIT-WORD_BIT)      ; mm0=in0L=(00 01)\n        cvtpi2ps  xmm4,mm4                      ; xmm4=(02 03 ** **)\n        cvtpi2ps  xmm0,mm0                      ; xmm0=(00 01 ** **)\n        psrad     mm5,(DWORD_BIT-WORD_BIT)      ; mm5=in2H=(22 23)\n        psrad     mm1,(DWORD_BIT-WORD_BIT)      ; mm1=in2L=(20 21)\n        cvtpi2ps  xmm5,mm5                      ; xmm5=(22 23 ** **)\n        cvtpi2ps  xmm1,mm1                      ; xmm1=(20 21 ** **)\n\n        punpckhwd mm6,mm2                       ; mm6=(** 42 ** 43)\n        punpcklwd mm2,mm2                       ; mm2=(40 40 41 41)\n        punpckhwd mm7,mm3                       ; mm7=(** 62 ** 63)\n        punpcklwd mm3,mm3                       ; mm3=(60 60 61 61)\n\n        psrad     mm6,(DWORD_BIT-WORD_BIT)      ; mm6=in4H=(42 43)\n        psrad     mm2,(DWORD_BIT-WORD_BIT)      ; mm2=in4L=(40 41)\n        cvtpi2ps  xmm6,mm6                      ; xmm6=(42 43 ** **)\n        cvtpi2ps  xmm2,mm2                      ; xmm2=(40 41 ** **)\n        psrad     mm7,(DWORD_BIT-WORD_BIT)      ; mm7=in6H=(62 63)\n        psrad     mm3,(DWORD_BIT-WORD_BIT)      ; mm3=in6L=(60 61)\n        cvtpi2ps  xmm7,mm7                      ; xmm7=(62 63 ** **)\n        cvtpi2ps  xmm3,mm3                      ; xmm3=(60 61 ** **)\n\n        movlhps   xmm0,xmm4                     ; xmm0=in0=(00 01 02 03)\n        movlhps   xmm1,xmm5                     ; xmm1=in2=(20 21 22 23)\n        mulps     xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm1, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        movlhps   xmm2,xmm6                     ; xmm2=in4=(40 41 42 43)\n        movlhps   xmm3,xmm7                     ; xmm3=in6=(60 61 62 63)\n        mulps     xmm2, XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm3, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        movaps  xmm4,xmm0\n        movaps  xmm5,xmm1\n        subps   xmm0,xmm2               ; xmm0=tmp11\n        subps   xmm1,xmm3\n        addps   xmm4,xmm2               ; xmm4=tmp10\n        addps   xmm5,xmm3               ; xmm5=tmp13\n\n        mulps   xmm1,[GOTOFF(ebx,PD_1_414)]\n        subps   xmm1,xmm5               ; xmm1=tmp12\n\n        movaps  xmm6,xmm4\n        movaps  xmm7,xmm0\n        subps   xmm4,xmm5               ; xmm4=tmp3\n        subps   xmm0,xmm1               ; xmm0=tmp2\n        addps   xmm6,xmm5               ; xmm6=tmp0\n        addps   xmm7,xmm1               ; xmm7=tmp1\n\n        movaps  XMMWORD [wk(1)], xmm4   ; tmp3\n        movaps  XMMWORD [wk(0)], xmm0   ; tmp2\n\n        ; -- Odd part\n\n        movq      mm4, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movq      mm0, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        movq      mm5, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        movq      mm1, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\n        punpckhwd mm6,mm4                       ; mm6=(** 12 ** 13)\n        punpcklwd mm4,mm4                       ; mm4=(10 10 11 11)\n        punpckhwd mm2,mm0                       ; mm2=(** 32 ** 33)\n        punpcklwd mm0,mm0                       ; mm0=(30 30 31 31)\n\n        psrad     mm6,(DWORD_BIT-WORD_BIT)      ; mm6=in1H=(12 13)\n        psrad     mm4,(DWORD_BIT-WORD_BIT)      ; mm4=in1L=(10 11)\n        cvtpi2ps  xmm4,mm6                      ; xmm4=(12 13 ** **)\n        cvtpi2ps  xmm2,mm4                      ; xmm2=(10 11 ** **)\n        psrad     mm2,(DWORD_BIT-WORD_BIT)      ; mm2=in3H=(32 33)\n        psrad     mm0,(DWORD_BIT-WORD_BIT)      ; mm0=in3L=(30 31)\n        cvtpi2ps  xmm0,mm2                      ; xmm0=(32 33 ** **)\n        cvtpi2ps  xmm3,mm0                      ; xmm3=(30 31 ** **)\n\n        punpckhwd mm7,mm5                       ; mm7=(** 52 ** 53)\n        punpcklwd mm5,mm5                       ; mm5=(50 50 51 51)\n        punpckhwd mm3,mm1                       ; mm3=(** 72 ** 73)\n        punpcklwd mm1,mm1                       ; mm1=(70 70 71 71)\n\n        movlhps   xmm2,xmm4                     ; xmm2=in1=(10 11 12 13)\n        movlhps   xmm3,xmm0                     ; xmm3=in3=(30 31 32 33)\n\n        psrad     mm7,(DWORD_BIT-WORD_BIT)      ; mm7=in5H=(52 53)\n        psrad     mm5,(DWORD_BIT-WORD_BIT)      ; mm5=in5L=(50 51)\n        cvtpi2ps  xmm4,mm7                      ; xmm4=(52 53 ** **)\n        cvtpi2ps  xmm5,mm5                      ; xmm5=(50 51 ** **)\n        psrad     mm3,(DWORD_BIT-WORD_BIT)      ; mm3=in7H=(72 73)\n        psrad     mm1,(DWORD_BIT-WORD_BIT)      ; mm1=in7L=(70 71)\n        cvtpi2ps  xmm0,mm3                      ; xmm0=(72 73 ** **)\n        cvtpi2ps  xmm1,mm1                      ; xmm1=(70 71 ** **)\n\n        mulps     xmm2, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm3, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        movlhps   xmm5,xmm4                     ; xmm5=in5=(50 51 52 53)\n        movlhps   xmm1,xmm0                     ; xmm1=in7=(70 71 72 73)\n        mulps     xmm5, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm1, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        movaps  xmm4,xmm2\n        movaps  xmm0,xmm5\n        addps   xmm2,xmm1               ; xmm2=z11\n        addps   xmm5,xmm3               ; xmm5=z13\n        subps   xmm4,xmm1               ; xmm4=z12\n        subps   xmm0,xmm3               ; xmm0=z10\n\n        movaps  xmm1,xmm2\n        subps   xmm2,xmm5\n        addps   xmm1,xmm5               ; xmm1=tmp7\n\n        mulps   xmm2,[GOTOFF(ebx,PD_1_414)]     ; xmm2=tmp11\n\n        movaps  xmm3,xmm0\n        addps   xmm0,xmm4\n        mulps   xmm0,[GOTOFF(ebx,PD_1_847)]     ; xmm0=z5\n        mulps   xmm3,[GOTOFF(ebx,PD_M2_613)]    ; xmm3=(z10 * -2.613125930)\n        mulps   xmm4,[GOTOFF(ebx,PD_1_082)]     ; xmm4=(z12 * 1.082392200)\n        addps   xmm3,xmm0               ; xmm3=tmp12\n        subps   xmm4,xmm0               ; xmm4=tmp10\n\n        ; -- Final output stage\n\n        subps   xmm3,xmm1               ; xmm3=tmp6\n        movaps  xmm5,xmm6\n        movaps  xmm0,xmm7\n        addps   xmm6,xmm1               ; xmm6=data0=(00 01 02 03)\n        addps   xmm7,xmm3               ; xmm7=data1=(10 11 12 13)\n        subps   xmm5,xmm1               ; xmm5=data7=(70 71 72 73)\n        subps   xmm0,xmm3               ; xmm0=data6=(60 61 62 63)\n        subps   xmm2,xmm3               ; xmm2=tmp5\n\n        movaps    xmm1,xmm6             ; transpose coefficients(phase 1)\n        unpcklps  xmm6,xmm7             ; xmm6=(00 10 01 11)\n        unpckhps  xmm1,xmm7             ; xmm1=(02 12 03 13)\n        movaps    xmm3,xmm0             ; transpose coefficients(phase 1)\n        unpcklps  xmm0,xmm5             ; xmm0=(60 70 61 71)\n        unpckhps  xmm3,xmm5             ; xmm3=(62 72 63 73)\n\n        movaps  xmm7, XMMWORD [wk(0)]   ; xmm7=tmp2\n        movaps  xmm5, XMMWORD [wk(1)]   ; xmm5=tmp3\n\n        movaps  XMMWORD [wk(0)], xmm0   ; wk(0)=(60 70 61 71)\n        movaps  XMMWORD [wk(1)], xmm3   ; wk(1)=(62 72 63 73)\n\n        addps   xmm4,xmm2               ; xmm4=tmp4\n        movaps  xmm0,xmm7\n        movaps  xmm3,xmm5\n        addps   xmm7,xmm2               ; xmm7=data2=(20 21 22 23)\n        addps   xmm5,xmm4               ; xmm5=data4=(40 41 42 43)\n        subps   xmm0,xmm2               ; xmm0=data5=(50 51 52 53)\n        subps   xmm3,xmm4               ; xmm3=data3=(30 31 32 33)\n\n        movaps    xmm2,xmm7             ; transpose coefficients(phase 1)\n        unpcklps  xmm7,xmm3             ; xmm7=(20 30 21 31)\n        unpckhps  xmm2,xmm3             ; xmm2=(22 32 23 33)\n        movaps    xmm4,xmm5             ; transpose coefficients(phase 1)\n        unpcklps  xmm5,xmm0             ; xmm5=(40 50 41 51)\n        unpckhps  xmm4,xmm0             ; xmm4=(42 52 43 53)\n\n        movaps    xmm3,xmm6             ; transpose coefficients(phase 2)\n        unpcklps2 xmm6,xmm7             ; xmm6=(00 10 20 30)\n        unpckhps2 xmm3,xmm7             ; xmm3=(01 11 21 31)\n        movaps    xmm0,xmm1             ; transpose coefficients(phase 2)\n        unpcklps2 xmm1,xmm2             ; xmm1=(02 12 22 32)\n        unpckhps2 xmm0,xmm2             ; xmm0=(03 13 23 33)\n\n        movaps  xmm7, XMMWORD [wk(0)]   ; xmm7=(60 70 61 71)\n        movaps  xmm2, XMMWORD [wk(1)]   ; xmm2=(62 72 63 73)\n\n        movaps  XMMWORD [XMMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], xmm6\n        movaps  XMMWORD [XMMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], xmm3\n        movaps  XMMWORD [XMMBLOCK(2,0,edi,SIZEOF_FAST_FLOAT)], xmm1\n        movaps  XMMWORD [XMMBLOCK(3,0,edi,SIZEOF_FAST_FLOAT)], xmm0\n\n        movaps    xmm6,xmm5             ; transpose coefficients(phase 2)\n        unpcklps2 xmm5,xmm7             ; xmm5=(40 50 60 70)\n        unpckhps2 xmm6,xmm7             ; xmm6=(41 51 61 71)\n        movaps    xmm3,xmm4             ; transpose coefficients(phase 2)\n        unpcklps2 xmm4,xmm2             ; xmm4=(42 52 62 72)\n        unpckhps2 xmm3,xmm2             ; xmm3=(43 53 63 73)\n\n        movaps  XMMWORD [XMMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], xmm5\n        movaps  XMMWORD [XMMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], xmm6\n        movaps  XMMWORD [XMMBLOCK(2,1,edi,SIZEOF_FAST_FLOAT)], xmm4\n        movaps  XMMWORD [XMMBLOCK(3,1,edi,SIZEOF_FAST_FLOAT)], xmm3\n\n.nextcolumn:\n        add     esi, byte 4*SIZEOF_JCOEF                ; coef_block\n        add     edx, byte 4*SIZEOF_FLOAT_MULT_TYPE      ; quantptr\n        add     edi,      4*DCTSIZE*SIZEOF_FAST_FLOAT   ; wsptr\n        dec     ecx                                     ; ctr\n        jnz     near .columnloop\n\n        ; -- Prefetch the next coefficient block\n\n        prefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 0*32]\n        prefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 1*32]\n        prefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 2*32]\n        prefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 3*32]\n\n        ; ---- Pass 2: process rows from work array, store into output array.\n\n        mov     eax, [original_ebp]\n        lea     esi, [workspace]                        ; FAST_FLOAT *wsptr\n        mov     edi, JSAMPARRAY [output_buf(eax)]       ; (JSAMPROW *)\n        mov     eax, JDIMENSION [output_col(eax)]\n        mov     ecx, DCTSIZE/4                          ; ctr\n        alignx  16,7\n.rowloop:\n\n        ; -- Even part\n\n        movaps  xmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm2, XMMWORD [XMMBLOCK(4,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_FAST_FLOAT)]\n\n        movaps  xmm4,xmm0\n        movaps  xmm5,xmm1\n        subps   xmm0,xmm2               ; xmm0=tmp11\n        subps   xmm1,xmm3\n        addps   xmm4,xmm2               ; xmm4=tmp10\n        addps   xmm5,xmm3               ; xmm5=tmp13\n\n        mulps   xmm1,[GOTOFF(ebx,PD_1_414)]\n        subps   xmm1,xmm5               ; xmm1=tmp12\n\n        movaps  xmm6,xmm4\n        movaps  xmm7,xmm0\n        subps   xmm4,xmm5               ; xmm4=tmp3\n        subps   xmm0,xmm1               ; xmm0=tmp2\n        addps   xmm6,xmm5               ; xmm6=tmp0\n        addps   xmm7,xmm1               ; xmm7=tmp1\n\n        movaps  XMMWORD [wk(1)], xmm4   ; tmp3\n        movaps  XMMWORD [wk(0)], xmm0   ; tmp2\n\n        ; -- Odd part\n\n        movaps  xmm2, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm5, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_FAST_FLOAT)]\n\n        movaps  xmm4,xmm2\n        movaps  xmm0,xmm5\n        addps   xmm2,xmm1               ; xmm2=z11\n        addps   xmm5,xmm3               ; xmm5=z13\n        subps   xmm4,xmm1               ; xmm4=z12\n        subps   xmm0,xmm3               ; xmm0=z10\n\n        movaps  xmm1,xmm2\n        subps   xmm2,xmm5\n        addps   xmm1,xmm5               ; xmm1=tmp7\n\n        mulps   xmm2,[GOTOFF(ebx,PD_1_414)]     ; xmm2=tmp11\n\n        movaps  xmm3,xmm0\n        addps   xmm0,xmm4\n        mulps   xmm0,[GOTOFF(ebx,PD_1_847)]     ; xmm0=z5\n        mulps   xmm3,[GOTOFF(ebx,PD_M2_613)]    ; xmm3=(z10 * -2.613125930)\n        mulps   xmm4,[GOTOFF(ebx,PD_1_082)]     ; xmm4=(z12 * 1.082392200)\n        addps   xmm3,xmm0               ; xmm3=tmp12\n        subps   xmm4,xmm0               ; xmm4=tmp10\n\n        ; -- Final output stage\n\n        subps   xmm3,xmm1               ; xmm3=tmp6\n        movaps  xmm5,xmm6\n        movaps  xmm0,xmm7\n        addps   xmm6,xmm1               ; xmm6=data0=(00 10 20 30)\n        addps   xmm7,xmm3               ; xmm7=data1=(01 11 21 31)\n        subps   xmm5,xmm1               ; xmm5=data7=(07 17 27 37)\n        subps   xmm0,xmm3               ; xmm0=data6=(06 16 26 36)\n        subps   xmm2,xmm3               ; xmm2=tmp5\n\n        movaps  xmm1,[GOTOFF(ebx,PD_0_125)]     ; xmm1=[PD_0_125]\n\n        mulps   xmm6,xmm1               ; descale(1/8)\n        mulps   xmm7,xmm1               ; descale(1/8)\n        mulps   xmm5,xmm1               ; descale(1/8)\n        mulps   xmm0,xmm1               ; descale(1/8)\n\n        movhlps   xmm3,xmm6\n        movhlps   xmm1,xmm7\n        cvtps2pi  mm0,xmm6              ; round to int32, mm0=data0L=(00 10)\n        cvtps2pi  mm1,xmm7              ; round to int32, mm1=data1L=(01 11)\n        cvtps2pi  mm2,xmm3              ; round to int32, mm2=data0H=(20 30)\n        cvtps2pi  mm3,xmm1              ; round to int32, mm3=data1H=(21 31)\n        packssdw  mm0,mm2               ; mm0=data0=(00 10 20 30)\n        packssdw  mm1,mm3               ; mm1=data1=(01 11 21 31)\n\n        movhlps   xmm6,xmm5\n        movhlps   xmm7,xmm0\n        cvtps2pi  mm4,xmm5              ; round to int32, mm4=data7L=(07 17)\n        cvtps2pi  mm5,xmm0              ; round to int32, mm5=data6L=(06 16)\n        cvtps2pi  mm6,xmm6              ; round to int32, mm6=data7H=(27 37)\n        cvtps2pi  mm7,xmm7              ; round to int32, mm7=data6H=(26 36)\n        packssdw  mm4,mm6               ; mm4=data7=(07 17 27 37)\n        packssdw  mm5,mm7               ; mm5=data6=(06 16 26 36)\n\n        packsswb  mm0,mm5               ; mm0=(00 10 20 30 06 16 26 36)\n        packsswb  mm1,mm4               ; mm1=(01 11 21 31 07 17 27 37)\n\n        movaps  xmm3, XMMWORD [wk(0)]   ; xmm3=tmp2\n        movaps  xmm1, XMMWORD [wk(1)]   ; xmm1=tmp3\n\n        movaps  xmm6,[GOTOFF(ebx,PD_0_125)]     ; xmm6=[PD_0_125]\n\n        addps   xmm4,xmm2               ; xmm4=tmp4\n        movaps  xmm5,xmm3\n        movaps  xmm0,xmm1\n        addps   xmm3,xmm2               ; xmm3=data2=(02 12 22 32)\n        addps   xmm1,xmm4               ; xmm1=data4=(04 14 24 34)\n        subps   xmm5,xmm2               ; xmm5=data5=(05 15 25 35)\n        subps   xmm0,xmm4               ; xmm0=data3=(03 13 23 33)\n\n        mulps   xmm3,xmm6               ; descale(1/8)\n        mulps   xmm1,xmm6               ; descale(1/8)\n        mulps   xmm5,xmm6               ; descale(1/8)\n        mulps   xmm0,xmm6               ; descale(1/8)\n\n        movhlps   xmm7,xmm3\n        movhlps   xmm2,xmm1\n        cvtps2pi  mm2,xmm3              ; round to int32, mm2=data2L=(02 12)\n        cvtps2pi  mm3,xmm1              ; round to int32, mm3=data4L=(04 14)\n        cvtps2pi  mm6,xmm7              ; round to int32, mm6=data2H=(22 32)\n        cvtps2pi  mm7,xmm2              ; round to int32, mm7=data4H=(24 34)\n        packssdw  mm2,mm6               ; mm2=data2=(02 12 22 32)\n        packssdw  mm3,mm7               ; mm3=data4=(04 14 24 34)\n\n        movhlps   xmm4,xmm5\n        movhlps   xmm6,xmm0\n        cvtps2pi  mm5,xmm5              ; round to int32, mm5=data5L=(05 15)\n        cvtps2pi  mm4,xmm0              ; round to int32, mm4=data3L=(03 13)\n        cvtps2pi  mm6,xmm4              ; round to int32, mm6=data5H=(25 35)\n        cvtps2pi  mm7,xmm6              ; round to int32, mm7=data3H=(23 33)\n        packssdw  mm5,mm6               ; mm5=data5=(05 15 25 35)\n        packssdw  mm4,mm7               ; mm4=data3=(03 13 23 33)\n\n        movq      mm6,[GOTOFF(ebx,PB_CENTERJSAMP)]      ; mm6=[PB_CENTERJSAMP]\n\n        packsswb  mm2,mm3               ; mm2=(02 12 22 32 04 14 24 34)\n        packsswb  mm4,mm5               ; mm4=(03 13 23 33 05 15 25 35)\n\n        paddb     mm0,mm6\n        paddb     mm1,mm6\n        paddb     mm2,mm6\n        paddb     mm4,mm6\n\n        movq      mm7,mm0               ; transpose coefficients(phase 1)\n        punpcklbw mm0,mm1               ; mm0=(00 01 10 11 20 21 30 31)\n        punpckhbw mm7,mm1               ; mm7=(06 07 16 17 26 27 36 37)\n        movq      mm3,mm2               ; transpose coefficients(phase 1)\n        punpcklbw mm2,mm4               ; mm2=(02 03 12 13 22 23 32 33)\n        punpckhbw mm3,mm4               ; mm3=(04 05 14 15 24 25 34 35)\n\n        movq      mm5,mm0               ; transpose coefficients(phase 2)\n        punpcklwd mm0,mm2               ; mm0=(00 01 02 03 10 11 12 13)\n        punpckhwd mm5,mm2               ; mm5=(20 21 22 23 30 31 32 33)\n        movq      mm6,mm3               ; transpose coefficients(phase 2)\n        punpcklwd mm3,mm7               ; mm3=(04 05 06 07 14 15 16 17)\n        punpckhwd mm6,mm7               ; mm6=(24 25 26 27 34 35 36 37)\n\n        movq      mm1,mm0               ; transpose coefficients(phase 3)\n        punpckldq mm0,mm3               ; mm0=(00 01 02 03 04 05 06 07)\n        punpckhdq mm1,mm3               ; mm1=(10 11 12 13 14 15 16 17)\n        movq      mm4,mm5               ; transpose coefficients(phase 3)\n        punpckldq mm5,mm6               ; mm5=(20 21 22 23 24 25 26 27)\n        punpckhdq mm4,mm6               ; mm4=(30 31 32 33 34 35 36 37)\n\n        pushpic ebx                     ; save GOT address\n\n        mov     edx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n        mov     ebx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n        movq    MMWORD [edx+eax*SIZEOF_JSAMPLE], mm0\n        movq    MMWORD [ebx+eax*SIZEOF_JSAMPLE], mm1\n        mov     edx, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n        mov     ebx, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n        movq    MMWORD [edx+eax*SIZEOF_JSAMPLE], mm5\n        movq    MMWORD [ebx+eax*SIZEOF_JSAMPLE], mm4\n\n        poppic  ebx                     ; restore GOT address\n\n        add     esi, byte 4*SIZEOF_FAST_FLOAT   ; wsptr\n        add     edi, byte 4*SIZEOF_JSAMPROW\n        dec     ecx                             ; ctr\n        jnz     near .rowloop\n\n        emms            ; empty MMX state\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jidctflt-sse2-64.asm",
    "content": ";\n; jidctflt.asm - floating-point IDCT (64-bit SSE & SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a floating-point implementation of the inverse DCT\n; (Discrete Cosine Transform). The following code is based directly on\n; the IJG's original jidctflt.c; see the jidctflt.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%macro  unpcklps2 2     ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(0 1 4 5)\n        shufps  %1,%2,0x44\n%endmacro\n\n%macro  unpckhps2 2     ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(2 3 6 7)\n        shufps  %1,%2,0xEE\n%endmacro\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_idct_float_sse2)\n\nEXTN(jconst_idct_float_sse2):\n\nPD_1_414        times 4 dd  1.414213562373095048801689\nPD_1_847        times 4 dd  1.847759065022573512256366\nPD_1_082        times 4 dd  1.082392200292393968799446\nPD_M2_613       times 4 dd -2.613125929752753055713286\nPD_RNDINT_MAGIC times 4 dd  100663296.0 ; (float)(0x00C00000 << 3)\nPB_CENTERJSAMP  times 16 db CENTERJSAMPLE\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_float_sse2 (void *dct_table, JCOEFPTR coef_block,\n;                        JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n; r10 = void *dct_table\n; r11 = JCOEFPTR coef_block\n; r12 = JSAMPARRAY output_buf\n; r13 = JDIMENSION output_col\n\n%define original_rbp    rbp+0\n%define wk(i)           rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          2\n%define workspace       wk(0)-DCTSIZE2*SIZEOF_FAST_FLOAT\n                                        ; FAST_FLOAT workspace[DCTSIZE2]\n\n        align   16\n        global  EXTN(jsimd_idct_float_sse2)\n\nEXTN(jsimd_idct_float_sse2):\n        push    rbp\n        mov     rax,rsp                         ; rax = original rbp\n        sub     rsp, byte 4\n        and     rsp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [rsp],rax\n        mov     rbp,rsp                         ; rbp = aligned rbp\n        lea     rsp, [workspace]\n        collect_args\n        push    rbx\n\n        ; ---- Pass 1: process columns from input, store into work array.\n\n        mov     rdx, r10                ; quantptr\n        mov     rsi, r11                ; inptr\n        lea     rdi, [workspace]                        ; FAST_FLOAT *wsptr\n        mov     rcx, DCTSIZE/4                          ; ctr\n.columnloop:\n%ifndef NO_ZERO_COLUMN_TEST_FLOAT_SSE\n        mov     eax, DWORD [DWBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n        or      eax, DWORD [DWBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n        jnz     near .columnDCT\n\n        movq    xmm1, XMM_MMWORD [MMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n        movq    xmm2, XMM_MMWORD [MMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n        movq    xmm3, XMM_MMWORD [MMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n        movq    xmm4, XMM_MMWORD [MMBLOCK(4,0,rsi,SIZEOF_JCOEF)]\n        movq    xmm5, XMM_MMWORD [MMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n        movq    xmm6, XMM_MMWORD [MMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n        movq    xmm7, XMM_MMWORD [MMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n        por     xmm1,xmm2\n        por     xmm3,xmm4\n        por     xmm5,xmm6\n        por     xmm1,xmm3\n        por     xmm5,xmm7\n        por     xmm1,xmm5\n        packsswb xmm1,xmm1\n        movd    eax,xmm1\n        test    rax,rax\n        jnz     short .columnDCT\n\n        ; -- AC terms all zero\n\n        movq      xmm0, XMM_MMWORD [MMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n\n        punpcklwd xmm0,xmm0             ; xmm0=(00 00 01 01 02 02 03 03)\n        psrad     xmm0,(DWORD_BIT-WORD_BIT)     ; xmm0=in0=(00 01 02 03)\n        cvtdq2ps  xmm0,xmm0                     ; xmm0=in0=(00 01 02 03)\n\n        mulps   xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        movaps  xmm1,xmm0\n        movaps  xmm2,xmm0\n        movaps  xmm3,xmm0\n\n        shufps  xmm0,xmm0,0x00                  ; xmm0=(00 00 00 00)\n        shufps  xmm1,xmm1,0x55                  ; xmm1=(01 01 01 01)\n        shufps  xmm2,xmm2,0xAA                  ; xmm2=(02 02 02 02)\n        shufps  xmm3,xmm3,0xFF                  ; xmm3=(03 03 03 03)\n\n        movaps  XMMWORD [XMMBLOCK(0,0,rdi,SIZEOF_FAST_FLOAT)], xmm0\n        movaps  XMMWORD [XMMBLOCK(0,1,rdi,SIZEOF_FAST_FLOAT)], xmm0\n        movaps  XMMWORD [XMMBLOCK(1,0,rdi,SIZEOF_FAST_FLOAT)], xmm1\n        movaps  XMMWORD [XMMBLOCK(1,1,rdi,SIZEOF_FAST_FLOAT)], xmm1\n        movaps  XMMWORD [XMMBLOCK(2,0,rdi,SIZEOF_FAST_FLOAT)], xmm2\n        movaps  XMMWORD [XMMBLOCK(2,1,rdi,SIZEOF_FAST_FLOAT)], xmm2\n        movaps  XMMWORD [XMMBLOCK(3,0,rdi,SIZEOF_FAST_FLOAT)], xmm3\n        movaps  XMMWORD [XMMBLOCK(3,1,rdi,SIZEOF_FAST_FLOAT)], xmm3\n        jmp     near .nextcolumn\n%endif\n.columnDCT:\n\n        ; -- Even part\n\n        movq      xmm0, XMM_MMWORD [MMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n        movq      xmm1, XMM_MMWORD [MMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n        movq      xmm2, XMM_MMWORD [MMBLOCK(4,0,rsi,SIZEOF_JCOEF)]\n        movq      xmm3, XMM_MMWORD [MMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n\n        punpcklwd xmm0,xmm0             ; xmm0=(00 00 01 01 02 02 03 03)\n        punpcklwd xmm1,xmm1             ; xmm1=(20 20 21 21 22 22 23 23)\n        psrad     xmm0,(DWORD_BIT-WORD_BIT)     ; xmm0=in0=(00 01 02 03)\n        psrad     xmm1,(DWORD_BIT-WORD_BIT)     ; xmm1=in2=(20 21 22 23)\n        cvtdq2ps  xmm0,xmm0                     ; xmm0=in0=(00 01 02 03)\n        cvtdq2ps  xmm1,xmm1                     ; xmm1=in2=(20 21 22 23)\n\n        punpcklwd xmm2,xmm2             ; xmm2=(40 40 41 41 42 42 43 43)\n        punpcklwd xmm3,xmm3             ; xmm3=(60 60 61 61 62 62 63 63)\n        psrad     xmm2,(DWORD_BIT-WORD_BIT)     ; xmm2=in4=(40 41 42 43)\n        psrad     xmm3,(DWORD_BIT-WORD_BIT)     ; xmm3=in6=(60 61 62 63)\n        cvtdq2ps  xmm2,xmm2                     ; xmm2=in4=(40 41 42 43)\n        cvtdq2ps  xmm3,xmm3                     ; xmm3=in6=(60 61 62 63)\n\n        mulps     xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm1, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm2, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm3, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        movaps  xmm4,xmm0\n        movaps  xmm5,xmm1\n        subps   xmm0,xmm2               ; xmm0=tmp11\n        subps   xmm1,xmm3\n        addps   xmm4,xmm2               ; xmm4=tmp10\n        addps   xmm5,xmm3               ; xmm5=tmp13\n\n        mulps   xmm1,[rel PD_1_414]\n        subps   xmm1,xmm5               ; xmm1=tmp12\n\n        movaps  xmm6,xmm4\n        movaps  xmm7,xmm0\n        subps   xmm4,xmm5               ; xmm4=tmp3\n        subps   xmm0,xmm1               ; xmm0=tmp2\n        addps   xmm6,xmm5               ; xmm6=tmp0\n        addps   xmm7,xmm1               ; xmm7=tmp1\n\n        movaps  XMMWORD [wk(1)], xmm4   ; tmp3\n        movaps  XMMWORD [wk(0)], xmm0   ; tmp2\n\n        ; -- Odd part\n\n        movq      xmm2, XMM_MMWORD [MMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n        movq      xmm3, XMM_MMWORD [MMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n        movq      xmm5, XMM_MMWORD [MMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n        movq      xmm1, XMM_MMWORD [MMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n\n        punpcklwd xmm2,xmm2             ; xmm2=(10 10 11 11 12 12 13 13)\n        punpcklwd xmm3,xmm3             ; xmm3=(30 30 31 31 32 32 33 33)\n        psrad     xmm2,(DWORD_BIT-WORD_BIT)     ; xmm2=in1=(10 11 12 13)\n        psrad     xmm3,(DWORD_BIT-WORD_BIT)     ; xmm3=in3=(30 31 32 33)\n        cvtdq2ps  xmm2,xmm2                     ; xmm2=in1=(10 11 12 13)\n        cvtdq2ps  xmm3,xmm3                     ; xmm3=in3=(30 31 32 33)\n\n        punpcklwd xmm5,xmm5             ; xmm5=(50 50 51 51 52 52 53 53)\n        punpcklwd xmm1,xmm1             ; xmm1=(70 70 71 71 72 72 73 73)\n        psrad     xmm5,(DWORD_BIT-WORD_BIT)     ; xmm5=in5=(50 51 52 53)\n        psrad     xmm1,(DWORD_BIT-WORD_BIT)     ; xmm1=in7=(70 71 72 73)\n        cvtdq2ps  xmm5,xmm5                     ; xmm5=in5=(50 51 52 53)\n        cvtdq2ps  xmm1,xmm1                     ; xmm1=in7=(70 71 72 73)\n\n        mulps     xmm2, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm3, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm5, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm1, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        movaps  xmm4,xmm2\n        movaps  xmm0,xmm5\n        addps   xmm2,xmm1               ; xmm2=z11\n        addps   xmm5,xmm3               ; xmm5=z13\n        subps   xmm4,xmm1               ; xmm4=z12\n        subps   xmm0,xmm3               ; xmm0=z10\n\n        movaps  xmm1,xmm2\n        subps   xmm2,xmm5\n        addps   xmm1,xmm5               ; xmm1=tmp7\n\n        mulps   xmm2,[rel PD_1_414]     ; xmm2=tmp11\n\n        movaps  xmm3,xmm0\n        addps   xmm0,xmm4\n        mulps   xmm0,[rel PD_1_847]     ; xmm0=z5\n        mulps   xmm3,[rel PD_M2_613]    ; xmm3=(z10 * -2.613125930)\n        mulps   xmm4,[rel PD_1_082]     ; xmm4=(z12 * 1.082392200)\n        addps   xmm3,xmm0               ; xmm3=tmp12\n        subps   xmm4,xmm0               ; xmm4=tmp10\n\n        ; -- Final output stage\n\n        subps   xmm3,xmm1               ; xmm3=tmp6\n        movaps  xmm5,xmm6\n        movaps  xmm0,xmm7\n        addps   xmm6,xmm1               ; xmm6=data0=(00 01 02 03)\n        addps   xmm7,xmm3               ; xmm7=data1=(10 11 12 13)\n        subps   xmm5,xmm1               ; xmm5=data7=(70 71 72 73)\n        subps   xmm0,xmm3               ; xmm0=data6=(60 61 62 63)\n        subps   xmm2,xmm3               ; xmm2=tmp5\n\n        movaps    xmm1,xmm6             ; transpose coefficients(phase 1)\n        unpcklps  xmm6,xmm7             ; xmm6=(00 10 01 11)\n        unpckhps  xmm1,xmm7             ; xmm1=(02 12 03 13)\n        movaps    xmm3,xmm0             ; transpose coefficients(phase 1)\n        unpcklps  xmm0,xmm5             ; xmm0=(60 70 61 71)\n        unpckhps  xmm3,xmm5             ; xmm3=(62 72 63 73)\n\n        movaps  xmm7, XMMWORD [wk(0)]   ; xmm7=tmp2\n        movaps  xmm5, XMMWORD [wk(1)]   ; xmm5=tmp3\n\n        movaps  XMMWORD [wk(0)], xmm0   ; wk(0)=(60 70 61 71)\n        movaps  XMMWORD [wk(1)], xmm3   ; wk(1)=(62 72 63 73)\n\n        addps   xmm4,xmm2               ; xmm4=tmp4\n        movaps  xmm0,xmm7\n        movaps  xmm3,xmm5\n        addps   xmm7,xmm2               ; xmm7=data2=(20 21 22 23)\n        addps   xmm5,xmm4               ; xmm5=data4=(40 41 42 43)\n        subps   xmm0,xmm2               ; xmm0=data5=(50 51 52 53)\n        subps   xmm3,xmm4               ; xmm3=data3=(30 31 32 33)\n\n        movaps    xmm2,xmm7             ; transpose coefficients(phase 1)\n        unpcklps  xmm7,xmm3             ; xmm7=(20 30 21 31)\n        unpckhps  xmm2,xmm3             ; xmm2=(22 32 23 33)\n        movaps    xmm4,xmm5             ; transpose coefficients(phase 1)\n        unpcklps  xmm5,xmm0             ; xmm5=(40 50 41 51)\n        unpckhps  xmm4,xmm0             ; xmm4=(42 52 43 53)\n\n        movaps    xmm3,xmm6             ; transpose coefficients(phase 2)\n        unpcklps2 xmm6,xmm7             ; xmm6=(00 10 20 30)\n        unpckhps2 xmm3,xmm7             ; xmm3=(01 11 21 31)\n        movaps    xmm0,xmm1             ; transpose coefficients(phase 2)\n        unpcklps2 xmm1,xmm2             ; xmm1=(02 12 22 32)\n        unpckhps2 xmm0,xmm2             ; xmm0=(03 13 23 33)\n\n        movaps  xmm7, XMMWORD [wk(0)]   ; xmm7=(60 70 61 71)\n        movaps  xmm2, XMMWORD [wk(1)]   ; xmm2=(62 72 63 73)\n\n        movaps  XMMWORD [XMMBLOCK(0,0,rdi,SIZEOF_FAST_FLOAT)], xmm6\n        movaps  XMMWORD [XMMBLOCK(1,0,rdi,SIZEOF_FAST_FLOAT)], xmm3\n        movaps  XMMWORD [XMMBLOCK(2,0,rdi,SIZEOF_FAST_FLOAT)], xmm1\n        movaps  XMMWORD [XMMBLOCK(3,0,rdi,SIZEOF_FAST_FLOAT)], xmm0\n\n        movaps    xmm6,xmm5             ; transpose coefficients(phase 2)\n        unpcklps2 xmm5,xmm7             ; xmm5=(40 50 60 70)\n        unpckhps2 xmm6,xmm7             ; xmm6=(41 51 61 71)\n        movaps    xmm3,xmm4             ; transpose coefficients(phase 2)\n        unpcklps2 xmm4,xmm2             ; xmm4=(42 52 62 72)\n        unpckhps2 xmm3,xmm2             ; xmm3=(43 53 63 73)\n\n        movaps  XMMWORD [XMMBLOCK(0,1,rdi,SIZEOF_FAST_FLOAT)], xmm5\n        movaps  XMMWORD [XMMBLOCK(1,1,rdi,SIZEOF_FAST_FLOAT)], xmm6\n        movaps  XMMWORD [XMMBLOCK(2,1,rdi,SIZEOF_FAST_FLOAT)], xmm4\n        movaps  XMMWORD [XMMBLOCK(3,1,rdi,SIZEOF_FAST_FLOAT)], xmm3\n\n.nextcolumn:\n        add     rsi, byte 4*SIZEOF_JCOEF                ; coef_block\n        add     rdx, byte 4*SIZEOF_FLOAT_MULT_TYPE      ; quantptr\n        add     rdi,      4*DCTSIZE*SIZEOF_FAST_FLOAT   ; wsptr\n        dec     rcx                                     ; ctr\n        jnz     near .columnloop\n\n        ; -- Prefetch the next coefficient block\n\n        prefetchnta [rsi + (DCTSIZE2-8)*SIZEOF_JCOEF + 0*32]\n        prefetchnta [rsi + (DCTSIZE2-8)*SIZEOF_JCOEF + 1*32]\n        prefetchnta [rsi + (DCTSIZE2-8)*SIZEOF_JCOEF + 2*32]\n        prefetchnta [rsi + (DCTSIZE2-8)*SIZEOF_JCOEF + 3*32]\n\n        ; ---- Pass 2: process rows from work array, store into output array.\n\n        mov     rax, [original_rbp]\n        lea     rsi, [workspace]                        ; FAST_FLOAT *wsptr\n        mov     rdi, r12        ; (JSAMPROW *)\n        mov     eax, r13d\n        mov     rcx, DCTSIZE/4                          ; ctr\n.rowloop:\n\n        ; -- Even part\n\n        movaps  xmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm2, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_FAST_FLOAT)]\n\n        movaps  xmm4,xmm0\n        movaps  xmm5,xmm1\n        subps   xmm0,xmm2               ; xmm0=tmp11\n        subps   xmm1,xmm3\n        addps   xmm4,xmm2               ; xmm4=tmp10\n        addps   xmm5,xmm3               ; xmm5=tmp13\n\n        mulps   xmm1,[rel PD_1_414]\n        subps   xmm1,xmm5               ; xmm1=tmp12\n\n        movaps  xmm6,xmm4\n        movaps  xmm7,xmm0\n        subps   xmm4,xmm5               ; xmm4=tmp3\n        subps   xmm0,xmm1               ; xmm0=tmp2\n        addps   xmm6,xmm5               ; xmm6=tmp0\n        addps   xmm7,xmm1               ; xmm7=tmp1\n\n        movaps  XMMWORD [wk(1)], xmm4   ; tmp3\n        movaps  XMMWORD [wk(0)], xmm0   ; tmp2\n\n        ; -- Odd part\n\n        movaps  xmm2, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm5, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_FAST_FLOAT)]\n\n        movaps  xmm4,xmm2\n        movaps  xmm0,xmm5\n        addps   xmm2,xmm1               ; xmm2=z11\n        addps   xmm5,xmm3               ; xmm5=z13\n        subps   xmm4,xmm1               ; xmm4=z12\n        subps   xmm0,xmm3               ; xmm0=z10\n\n        movaps  xmm1,xmm2\n        subps   xmm2,xmm5\n        addps   xmm1,xmm5               ; xmm1=tmp7\n\n        mulps   xmm2,[rel PD_1_414]     ; xmm2=tmp11\n\n        movaps  xmm3,xmm0\n        addps   xmm0,xmm4\n        mulps   xmm0,[rel PD_1_847]     ; xmm0=z5\n        mulps   xmm3,[rel PD_M2_613]    ; xmm3=(z10 * -2.613125930)\n        mulps   xmm4,[rel PD_1_082]     ; xmm4=(z12 * 1.082392200)\n        addps   xmm3,xmm0               ; xmm3=tmp12\n        subps   xmm4,xmm0               ; xmm4=tmp10\n\n        ; -- Final output stage\n\n        subps   xmm3,xmm1               ; xmm3=tmp6\n        movaps  xmm5,xmm6\n        movaps  xmm0,xmm7\n        addps   xmm6,xmm1               ; xmm6=data0=(00 10 20 30)\n        addps   xmm7,xmm3               ; xmm7=data1=(01 11 21 31)\n        subps   xmm5,xmm1               ; xmm5=data7=(07 17 27 37)\n        subps   xmm0,xmm3               ; xmm0=data6=(06 16 26 36)\n        subps   xmm2,xmm3               ; xmm2=tmp5\n\n        movaps  xmm1,[rel PD_RNDINT_MAGIC]      ; xmm1=[rel PD_RNDINT_MAGIC]\n        pcmpeqd xmm3,xmm3\n        psrld   xmm3,WORD_BIT           ; xmm3={0xFFFF 0x0000 0xFFFF 0x0000 ..}\n\n        addps   xmm6,xmm1       ; xmm6=roundint(data0/8)=(00 ** 10 ** 20 ** 30 **)\n        addps   xmm7,xmm1       ; xmm7=roundint(data1/8)=(01 ** 11 ** 21 ** 31 **)\n        addps   xmm0,xmm1       ; xmm0=roundint(data6/8)=(06 ** 16 ** 26 ** 36 **)\n        addps   xmm5,xmm1       ; xmm5=roundint(data7/8)=(07 ** 17 ** 27 ** 37 **)\n\n        pand    xmm6,xmm3               ; xmm6=(00 -- 10 -- 20 -- 30 --)\n        pslld   xmm7,WORD_BIT           ; xmm7=(-- 01 -- 11 -- 21 -- 31)\n        pand    xmm0,xmm3               ; xmm0=(06 -- 16 -- 26 -- 36 --)\n        pslld   xmm5,WORD_BIT           ; xmm5=(-- 07 -- 17 -- 27 -- 37)\n        por     xmm6,xmm7               ; xmm6=(00 01 10 11 20 21 30 31)\n        por     xmm0,xmm5               ; xmm0=(06 07 16 17 26 27 36 37)\n\n        movaps  xmm1, XMMWORD [wk(0)]   ; xmm1=tmp2\n        movaps  xmm3, XMMWORD [wk(1)]   ; xmm3=tmp3\n\n        addps   xmm4,xmm2               ; xmm4=tmp4\n        movaps  xmm7,xmm1\n        movaps  xmm5,xmm3\n        addps   xmm1,xmm2               ; xmm1=data2=(02 12 22 32)\n        addps   xmm3,xmm4               ; xmm3=data4=(04 14 24 34)\n        subps   xmm7,xmm2               ; xmm7=data5=(05 15 25 35)\n        subps   xmm5,xmm4               ; xmm5=data3=(03 13 23 33)\n\n        movaps  xmm2,[rel PD_RNDINT_MAGIC]      ; xmm2=[rel PD_RNDINT_MAGIC]\n        pcmpeqd xmm4,xmm4\n        psrld   xmm4,WORD_BIT           ; xmm4={0xFFFF 0x0000 0xFFFF 0x0000 ..}\n\n        addps   xmm3,xmm2       ; xmm3=roundint(data4/8)=(04 ** 14 ** 24 ** 34 **)\n        addps   xmm7,xmm2       ; xmm7=roundint(data5/8)=(05 ** 15 ** 25 ** 35 **)\n        addps   xmm1,xmm2       ; xmm1=roundint(data2/8)=(02 ** 12 ** 22 ** 32 **)\n        addps   xmm5,xmm2       ; xmm5=roundint(data3/8)=(03 ** 13 ** 23 ** 33 **)\n\n        pand    xmm3,xmm4               ; xmm3=(04 -- 14 -- 24 -- 34 --)\n        pslld   xmm7,WORD_BIT           ; xmm7=(-- 05 -- 15 -- 25 -- 35)\n        pand    xmm1,xmm4               ; xmm1=(02 -- 12 -- 22 -- 32 --)\n        pslld   xmm5,WORD_BIT           ; xmm5=(-- 03 -- 13 -- 23 -- 33)\n        por     xmm3,xmm7               ; xmm3=(04 05 14 15 24 25 34 35)\n        por     xmm1,xmm5               ; xmm1=(02 03 12 13 22 23 32 33)\n\n        movdqa    xmm2,[rel PB_CENTERJSAMP]     ; xmm2=[rel PB_CENTERJSAMP]\n\n        packsswb  xmm6,xmm3     ; xmm6=(00 01 10 11 20 21 30 31 04 05 14 15 24 25 34 35)\n        packsswb  xmm1,xmm0     ; xmm1=(02 03 12 13 22 23 32 33 06 07 16 17 26 27 36 37)\n        paddb     xmm6,xmm2\n        paddb     xmm1,xmm2\n\n        movdqa    xmm4,xmm6     ; transpose coefficients(phase 2)\n        punpcklwd xmm6,xmm1     ; xmm6=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33)\n        punpckhwd xmm4,xmm1     ; xmm4=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37)\n\n        movdqa    xmm7,xmm6     ; transpose coefficients(phase 3)\n        punpckldq xmm6,xmm4     ; xmm6=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17)\n        punpckhdq xmm7,xmm4     ; xmm7=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37)\n\n        pshufd  xmm5,xmm6,0x4E  ; xmm5=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07)\n        pshufd  xmm3,xmm7,0x4E  ; xmm3=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27)\n\n        mov     rdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW]\n        mov     rbx, JSAMPROW [rdi+2*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm6\n        movq    XMM_MMWORD [rbx+rax*SIZEOF_JSAMPLE], xmm7\n        mov     rdx, JSAMPROW [rdi+1*SIZEOF_JSAMPROW]\n        mov     rbx, JSAMPROW [rdi+3*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm5\n        movq    XMM_MMWORD [rbx+rax*SIZEOF_JSAMPLE], xmm3\n\n        add     rsi, byte 4*SIZEOF_FAST_FLOAT   ; wsptr\n        add     rdi, byte 4*SIZEOF_JSAMPROW\n        dec     rcx                             ; ctr\n        jnz     near .rowloop\n\n        pop     rbx\n        uncollect_args\n        mov     rsp,rbp         ; rsp <- aligned rbp\n        pop     rsp             ; rsp <- original rbp\n        pop     rbp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jidctflt-sse2.asm",
    "content": ";\n; jidctflt.asm - floating-point IDCT (SSE & SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a floating-point implementation of the inverse DCT\n; (Discrete Cosine Transform). The following code is based directly on\n; the IJG's original jidctflt.c; see the jidctflt.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%macro  unpcklps2 2     ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(0 1 4 5)\n        shufps  %1,%2,0x44\n%endmacro\n\n%macro  unpckhps2 2     ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(2 3 6 7)\n        shufps  %1,%2,0xEE\n%endmacro\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_idct_float_sse2)\n\nEXTN(jconst_idct_float_sse2):\n\nPD_1_414        times 4 dd  1.414213562373095048801689\nPD_1_847        times 4 dd  1.847759065022573512256366\nPD_1_082        times 4 dd  1.082392200292393968799446\nPD_M2_613       times 4 dd -2.613125929752753055713286\nPD_RNDINT_MAGIC times 4 dd  100663296.0 ; (float)(0x00C00000 << 3)\nPB_CENTERJSAMP  times 16 db CENTERJSAMPLE\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_float_sse2 (void *dct_table, JCOEFPTR coef_block,\n;                        JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)    (b)+8           ; void *dct_table\n%define coef_block(b)   (b)+12          ; JCOEFPTR coef_block\n%define output_buf(b)   (b)+16          ; JSAMPARRAY output_buf\n%define output_col(b)   (b)+20          ; JDIMENSION output_col\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          2\n%define workspace       wk(0)-DCTSIZE2*SIZEOF_FAST_FLOAT\n                                        ; FAST_FLOAT workspace[DCTSIZE2]\n\n        align   16\n        global  EXTN(jsimd_idct_float_sse2)\n\nEXTN(jsimd_idct_float_sse2):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [workspace]\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process columns from input, store into work array.\n\n;       mov     eax, [original_ebp]\n        mov     edx, POINTER [dct_table(eax)]           ; quantptr\n        mov     esi, JCOEFPTR [coef_block(eax)]         ; inptr\n        lea     edi, [workspace]                        ; FAST_FLOAT *wsptr\n        mov     ecx, DCTSIZE/4                          ; ctr\n        alignx  16,7\n.columnloop:\n%ifndef NO_ZERO_COLUMN_TEST_FLOAT_SSE\n        mov     eax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        or      eax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        jnz     near .columnDCT\n\n        movq    xmm1, XMM_MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movq    xmm2, XMM_MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        movq    xmm3, XMM_MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        movq    xmm4, XMM_MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        movq    xmm5, XMM_MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        movq    xmm6, XMM_MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n        movq    xmm7, XMM_MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        por     xmm1,xmm2\n        por     xmm3,xmm4\n        por     xmm5,xmm6\n        por     xmm1,xmm3\n        por     xmm5,xmm7\n        por     xmm1,xmm5\n        packsswb xmm1,xmm1\n        movd    eax,xmm1\n        test    eax,eax\n        jnz     short .columnDCT\n\n        ; -- AC terms all zero\n\n        movq      xmm0, XMM_MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\n        punpcklwd xmm0,xmm0             ; xmm0=(00 00 01 01 02 02 03 03)\n        psrad     xmm0,(DWORD_BIT-WORD_BIT)     ; xmm0=in0=(00 01 02 03)\n        cvtdq2ps  xmm0,xmm0                     ; xmm0=in0=(00 01 02 03)\n\n        mulps   xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        movaps  xmm1,xmm0\n        movaps  xmm2,xmm0\n        movaps  xmm3,xmm0\n\n        shufps  xmm0,xmm0,0x00                  ; xmm0=(00 00 00 00)\n        shufps  xmm1,xmm1,0x55                  ; xmm1=(01 01 01 01)\n        shufps  xmm2,xmm2,0xAA                  ; xmm2=(02 02 02 02)\n        shufps  xmm3,xmm3,0xFF                  ; xmm3=(03 03 03 03)\n\n        movaps  XMMWORD [XMMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], xmm0\n        movaps  XMMWORD [XMMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], xmm0\n        movaps  XMMWORD [XMMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], xmm1\n        movaps  XMMWORD [XMMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], xmm1\n        movaps  XMMWORD [XMMBLOCK(2,0,edi,SIZEOF_FAST_FLOAT)], xmm2\n        movaps  XMMWORD [XMMBLOCK(2,1,edi,SIZEOF_FAST_FLOAT)], xmm2\n        movaps  XMMWORD [XMMBLOCK(3,0,edi,SIZEOF_FAST_FLOAT)], xmm3\n        movaps  XMMWORD [XMMBLOCK(3,1,edi,SIZEOF_FAST_FLOAT)], xmm3\n        jmp     near .nextcolumn\n        alignx  16,7\n%endif\n.columnDCT:\n\n        ; -- Even part\n\n        movq      xmm0, XMM_MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        movq      xmm1, XMM_MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        movq      xmm2, XMM_MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        movq      xmm3, XMM_MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\n        punpcklwd xmm0,xmm0             ; xmm0=(00 00 01 01 02 02 03 03)\n        punpcklwd xmm1,xmm1             ; xmm1=(20 20 21 21 22 22 23 23)\n        psrad     xmm0,(DWORD_BIT-WORD_BIT)     ; xmm0=in0=(00 01 02 03)\n        psrad     xmm1,(DWORD_BIT-WORD_BIT)     ; xmm1=in2=(20 21 22 23)\n        cvtdq2ps  xmm0,xmm0                     ; xmm0=in0=(00 01 02 03)\n        cvtdq2ps  xmm1,xmm1                     ; xmm1=in2=(20 21 22 23)\n\n        punpcklwd xmm2,xmm2             ; xmm2=(40 40 41 41 42 42 43 43)\n        punpcklwd xmm3,xmm3             ; xmm3=(60 60 61 61 62 62 63 63)\n        psrad     xmm2,(DWORD_BIT-WORD_BIT)     ; xmm2=in4=(40 41 42 43)\n        psrad     xmm3,(DWORD_BIT-WORD_BIT)     ; xmm3=in6=(60 61 62 63)\n        cvtdq2ps  xmm2,xmm2                     ; xmm2=in4=(40 41 42 43)\n        cvtdq2ps  xmm3,xmm3                     ; xmm3=in6=(60 61 62 63)\n\n        mulps     xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm1, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm2, XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm3, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        movaps  xmm4,xmm0\n        movaps  xmm5,xmm1\n        subps   xmm0,xmm2               ; xmm0=tmp11\n        subps   xmm1,xmm3\n        addps   xmm4,xmm2               ; xmm4=tmp10\n        addps   xmm5,xmm3               ; xmm5=tmp13\n\n        mulps   xmm1,[GOTOFF(ebx,PD_1_414)]\n        subps   xmm1,xmm5               ; xmm1=tmp12\n\n        movaps  xmm6,xmm4\n        movaps  xmm7,xmm0\n        subps   xmm4,xmm5               ; xmm4=tmp3\n        subps   xmm0,xmm1               ; xmm0=tmp2\n        addps   xmm6,xmm5               ; xmm6=tmp0\n        addps   xmm7,xmm1               ; xmm7=tmp1\n\n        movaps  XMMWORD [wk(1)], xmm4   ; tmp3\n        movaps  XMMWORD [wk(0)], xmm0   ; tmp2\n\n        ; -- Odd part\n\n        movq      xmm2, XMM_MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movq      xmm3, XMM_MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        movq      xmm5, XMM_MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        movq      xmm1, XMM_MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\n        punpcklwd xmm2,xmm2             ; xmm2=(10 10 11 11 12 12 13 13)\n        punpcklwd xmm3,xmm3             ; xmm3=(30 30 31 31 32 32 33 33)\n        psrad     xmm2,(DWORD_BIT-WORD_BIT)     ; xmm2=in1=(10 11 12 13)\n        psrad     xmm3,(DWORD_BIT-WORD_BIT)     ; xmm3=in3=(30 31 32 33)\n        cvtdq2ps  xmm2,xmm2                     ; xmm2=in1=(10 11 12 13)\n        cvtdq2ps  xmm3,xmm3                     ; xmm3=in3=(30 31 32 33)\n\n        punpcklwd xmm5,xmm5             ; xmm5=(50 50 51 51 52 52 53 53)\n        punpcklwd xmm1,xmm1             ; xmm1=(70 70 71 71 72 72 73 73)\n        psrad     xmm5,(DWORD_BIT-WORD_BIT)     ; xmm5=in5=(50 51 52 53)\n        psrad     xmm1,(DWORD_BIT-WORD_BIT)     ; xmm1=in7=(70 71 72 73)\n        cvtdq2ps  xmm5,xmm5                     ; xmm5=in5=(50 51 52 53)\n        cvtdq2ps  xmm1,xmm1                     ; xmm1=in7=(70 71 72 73)\n\n        mulps     xmm2, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm3, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm5, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n        mulps     xmm1, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n        movaps  xmm4,xmm2\n        movaps  xmm0,xmm5\n        addps   xmm2,xmm1               ; xmm2=z11\n        addps   xmm5,xmm3               ; xmm5=z13\n        subps   xmm4,xmm1               ; xmm4=z12\n        subps   xmm0,xmm3               ; xmm0=z10\n\n        movaps  xmm1,xmm2\n        subps   xmm2,xmm5\n        addps   xmm1,xmm5               ; xmm1=tmp7\n\n        mulps   xmm2,[GOTOFF(ebx,PD_1_414)]     ; xmm2=tmp11\n\n        movaps  xmm3,xmm0\n        addps   xmm0,xmm4\n        mulps   xmm0,[GOTOFF(ebx,PD_1_847)]     ; xmm0=z5\n        mulps   xmm3,[GOTOFF(ebx,PD_M2_613)]    ; xmm3=(z10 * -2.613125930)\n        mulps   xmm4,[GOTOFF(ebx,PD_1_082)]     ; xmm4=(z12 * 1.082392200)\n        addps   xmm3,xmm0               ; xmm3=tmp12\n        subps   xmm4,xmm0               ; xmm4=tmp10\n\n        ; -- Final output stage\n\n        subps   xmm3,xmm1               ; xmm3=tmp6\n        movaps  xmm5,xmm6\n        movaps  xmm0,xmm7\n        addps   xmm6,xmm1               ; xmm6=data0=(00 01 02 03)\n        addps   xmm7,xmm3               ; xmm7=data1=(10 11 12 13)\n        subps   xmm5,xmm1               ; xmm5=data7=(70 71 72 73)\n        subps   xmm0,xmm3               ; xmm0=data6=(60 61 62 63)\n        subps   xmm2,xmm3               ; xmm2=tmp5\n\n        movaps    xmm1,xmm6             ; transpose coefficients(phase 1)\n        unpcklps  xmm6,xmm7             ; xmm6=(00 10 01 11)\n        unpckhps  xmm1,xmm7             ; xmm1=(02 12 03 13)\n        movaps    xmm3,xmm0             ; transpose coefficients(phase 1)\n        unpcklps  xmm0,xmm5             ; xmm0=(60 70 61 71)\n        unpckhps  xmm3,xmm5             ; xmm3=(62 72 63 73)\n\n        movaps  xmm7, XMMWORD [wk(0)]   ; xmm7=tmp2\n        movaps  xmm5, XMMWORD [wk(1)]   ; xmm5=tmp3\n\n        movaps  XMMWORD [wk(0)], xmm0   ; wk(0)=(60 70 61 71)\n        movaps  XMMWORD [wk(1)], xmm3   ; wk(1)=(62 72 63 73)\n\n        addps   xmm4,xmm2               ; xmm4=tmp4\n        movaps  xmm0,xmm7\n        movaps  xmm3,xmm5\n        addps   xmm7,xmm2               ; xmm7=data2=(20 21 22 23)\n        addps   xmm5,xmm4               ; xmm5=data4=(40 41 42 43)\n        subps   xmm0,xmm2               ; xmm0=data5=(50 51 52 53)\n        subps   xmm3,xmm4               ; xmm3=data3=(30 31 32 33)\n\n        movaps    xmm2,xmm7             ; transpose coefficients(phase 1)\n        unpcklps  xmm7,xmm3             ; xmm7=(20 30 21 31)\n        unpckhps  xmm2,xmm3             ; xmm2=(22 32 23 33)\n        movaps    xmm4,xmm5             ; transpose coefficients(phase 1)\n        unpcklps  xmm5,xmm0             ; xmm5=(40 50 41 51)\n        unpckhps  xmm4,xmm0             ; xmm4=(42 52 43 53)\n\n        movaps    xmm3,xmm6             ; transpose coefficients(phase 2)\n        unpcklps2 xmm6,xmm7             ; xmm6=(00 10 20 30)\n        unpckhps2 xmm3,xmm7             ; xmm3=(01 11 21 31)\n        movaps    xmm0,xmm1             ; transpose coefficients(phase 2)\n        unpcklps2 xmm1,xmm2             ; xmm1=(02 12 22 32)\n        unpckhps2 xmm0,xmm2             ; xmm0=(03 13 23 33)\n\n        movaps  xmm7, XMMWORD [wk(0)]   ; xmm7=(60 70 61 71)\n        movaps  xmm2, XMMWORD [wk(1)]   ; xmm2=(62 72 63 73)\n\n        movaps  XMMWORD [XMMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], xmm6\n        movaps  XMMWORD [XMMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], xmm3\n        movaps  XMMWORD [XMMBLOCK(2,0,edi,SIZEOF_FAST_FLOAT)], xmm1\n        movaps  XMMWORD [XMMBLOCK(3,0,edi,SIZEOF_FAST_FLOAT)], xmm0\n\n        movaps    xmm6,xmm5             ; transpose coefficients(phase 2)\n        unpcklps2 xmm5,xmm7             ; xmm5=(40 50 60 70)\n        unpckhps2 xmm6,xmm7             ; xmm6=(41 51 61 71)\n        movaps    xmm3,xmm4             ; transpose coefficients(phase 2)\n        unpcklps2 xmm4,xmm2             ; xmm4=(42 52 62 72)\n        unpckhps2 xmm3,xmm2             ; xmm3=(43 53 63 73)\n\n        movaps  XMMWORD [XMMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], xmm5\n        movaps  XMMWORD [XMMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], xmm6\n        movaps  XMMWORD [XMMBLOCK(2,1,edi,SIZEOF_FAST_FLOAT)], xmm4\n        movaps  XMMWORD [XMMBLOCK(3,1,edi,SIZEOF_FAST_FLOAT)], xmm3\n\n.nextcolumn:\n        add     esi, byte 4*SIZEOF_JCOEF                ; coef_block\n        add     edx, byte 4*SIZEOF_FLOAT_MULT_TYPE      ; quantptr\n        add     edi,      4*DCTSIZE*SIZEOF_FAST_FLOAT   ; wsptr\n        dec     ecx                                     ; ctr\n        jnz     near .columnloop\n\n        ; -- Prefetch the next coefficient block\n\n        prefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 0*32]\n        prefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 1*32]\n        prefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 2*32]\n        prefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 3*32]\n\n        ; ---- Pass 2: process rows from work array, store into output array.\n\n        mov     eax, [original_ebp]\n        lea     esi, [workspace]                        ; FAST_FLOAT *wsptr\n        mov     edi, JSAMPARRAY [output_buf(eax)]       ; (JSAMPROW *)\n        mov     eax, JDIMENSION [output_col(eax)]\n        mov     ecx, DCTSIZE/4                          ; ctr\n        alignx  16,7\n.rowloop:\n\n        ; -- Even part\n\n        movaps  xmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm2, XMMWORD [XMMBLOCK(4,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_FAST_FLOAT)]\n\n        movaps  xmm4,xmm0\n        movaps  xmm5,xmm1\n        subps   xmm0,xmm2               ; xmm0=tmp11\n        subps   xmm1,xmm3\n        addps   xmm4,xmm2               ; xmm4=tmp10\n        addps   xmm5,xmm3               ; xmm5=tmp13\n\n        mulps   xmm1,[GOTOFF(ebx,PD_1_414)]\n        subps   xmm1,xmm5               ; xmm1=tmp12\n\n        movaps  xmm6,xmm4\n        movaps  xmm7,xmm0\n        subps   xmm4,xmm5               ; xmm4=tmp3\n        subps   xmm0,xmm1               ; xmm0=tmp2\n        addps   xmm6,xmm5               ; xmm6=tmp0\n        addps   xmm7,xmm1               ; xmm7=tmp1\n\n        movaps  XMMWORD [wk(1)], xmm4   ; tmp3\n        movaps  XMMWORD [wk(0)], xmm0   ; tmp2\n\n        ; -- Odd part\n\n        movaps  xmm2, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm5, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_FAST_FLOAT)]\n\n        movaps  xmm4,xmm2\n        movaps  xmm0,xmm5\n        addps   xmm2,xmm1               ; xmm2=z11\n        addps   xmm5,xmm3               ; xmm5=z13\n        subps   xmm4,xmm1               ; xmm4=z12\n        subps   xmm0,xmm3               ; xmm0=z10\n\n        movaps  xmm1,xmm2\n        subps   xmm2,xmm5\n        addps   xmm1,xmm5               ; xmm1=tmp7\n\n        mulps   xmm2,[GOTOFF(ebx,PD_1_414)]     ; xmm2=tmp11\n\n        movaps  xmm3,xmm0\n        addps   xmm0,xmm4\n        mulps   xmm0,[GOTOFF(ebx,PD_1_847)]     ; xmm0=z5\n        mulps   xmm3,[GOTOFF(ebx,PD_M2_613)]    ; xmm3=(z10 * -2.613125930)\n        mulps   xmm4,[GOTOFF(ebx,PD_1_082)]     ; xmm4=(z12 * 1.082392200)\n        addps   xmm3,xmm0               ; xmm3=tmp12\n        subps   xmm4,xmm0               ; xmm4=tmp10\n\n        ; -- Final output stage\n\n        subps   xmm3,xmm1               ; xmm3=tmp6\n        movaps  xmm5,xmm6\n        movaps  xmm0,xmm7\n        addps   xmm6,xmm1               ; xmm6=data0=(00 10 20 30)\n        addps   xmm7,xmm3               ; xmm7=data1=(01 11 21 31)\n        subps   xmm5,xmm1               ; xmm5=data7=(07 17 27 37)\n        subps   xmm0,xmm3               ; xmm0=data6=(06 16 26 36)\n        subps   xmm2,xmm3               ; xmm2=tmp5\n\n        movaps  xmm1,[GOTOFF(ebx,PD_RNDINT_MAGIC)]      ; xmm1=[PD_RNDINT_MAGIC]\n        pcmpeqd xmm3,xmm3\n        psrld   xmm3,WORD_BIT           ; xmm3={0xFFFF 0x0000 0xFFFF 0x0000 ..}\n\n        addps   xmm6,xmm1       ; xmm6=roundint(data0/8)=(00 ** 10 ** 20 ** 30 **)\n        addps   xmm7,xmm1       ; xmm7=roundint(data1/8)=(01 ** 11 ** 21 ** 31 **)\n        addps   xmm0,xmm1       ; xmm0=roundint(data6/8)=(06 ** 16 ** 26 ** 36 **)\n        addps   xmm5,xmm1       ; xmm5=roundint(data7/8)=(07 ** 17 ** 27 ** 37 **)\n\n        pand    xmm6,xmm3               ; xmm6=(00 -- 10 -- 20 -- 30 --)\n        pslld   xmm7,WORD_BIT           ; xmm7=(-- 01 -- 11 -- 21 -- 31)\n        pand    xmm0,xmm3               ; xmm0=(06 -- 16 -- 26 -- 36 --)\n        pslld   xmm5,WORD_BIT           ; xmm5=(-- 07 -- 17 -- 27 -- 37)\n        por     xmm6,xmm7               ; xmm6=(00 01 10 11 20 21 30 31)\n        por     xmm0,xmm5               ; xmm0=(06 07 16 17 26 27 36 37)\n\n        movaps  xmm1, XMMWORD [wk(0)]   ; xmm1=tmp2\n        movaps  xmm3, XMMWORD [wk(1)]   ; xmm3=tmp3\n\n        addps   xmm4,xmm2               ; xmm4=tmp4\n        movaps  xmm7,xmm1\n        movaps  xmm5,xmm3\n        addps   xmm1,xmm2               ; xmm1=data2=(02 12 22 32)\n        addps   xmm3,xmm4               ; xmm3=data4=(04 14 24 34)\n        subps   xmm7,xmm2               ; xmm7=data5=(05 15 25 35)\n        subps   xmm5,xmm4               ; xmm5=data3=(03 13 23 33)\n\n        movaps  xmm2,[GOTOFF(ebx,PD_RNDINT_MAGIC)]      ; xmm2=[PD_RNDINT_MAGIC]\n        pcmpeqd xmm4,xmm4\n        psrld   xmm4,WORD_BIT           ; xmm4={0xFFFF 0x0000 0xFFFF 0x0000 ..}\n\n        addps   xmm3,xmm2       ; xmm3=roundint(data4/8)=(04 ** 14 ** 24 ** 34 **)\n        addps   xmm7,xmm2       ; xmm7=roundint(data5/8)=(05 ** 15 ** 25 ** 35 **)\n        addps   xmm1,xmm2       ; xmm1=roundint(data2/8)=(02 ** 12 ** 22 ** 32 **)\n        addps   xmm5,xmm2       ; xmm5=roundint(data3/8)=(03 ** 13 ** 23 ** 33 **)\n\n        pand    xmm3,xmm4               ; xmm3=(04 -- 14 -- 24 -- 34 --)\n        pslld   xmm7,WORD_BIT           ; xmm7=(-- 05 -- 15 -- 25 -- 35)\n        pand    xmm1,xmm4               ; xmm1=(02 -- 12 -- 22 -- 32 --)\n        pslld   xmm5,WORD_BIT           ; xmm5=(-- 03 -- 13 -- 23 -- 33)\n        por     xmm3,xmm7               ; xmm3=(04 05 14 15 24 25 34 35)\n        por     xmm1,xmm5               ; xmm1=(02 03 12 13 22 23 32 33)\n\n        movdqa    xmm2,[GOTOFF(ebx,PB_CENTERJSAMP)]     ; xmm2=[PB_CENTERJSAMP]\n\n        packsswb  xmm6,xmm3     ; xmm6=(00 01 10 11 20 21 30 31 04 05 14 15 24 25 34 35)\n        packsswb  xmm1,xmm0     ; xmm1=(02 03 12 13 22 23 32 33 06 07 16 17 26 27 36 37)\n        paddb     xmm6,xmm2\n        paddb     xmm1,xmm2\n\n        movdqa    xmm4,xmm6     ; transpose coefficients(phase 2)\n        punpcklwd xmm6,xmm1     ; xmm6=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33)\n        punpckhwd xmm4,xmm1     ; xmm4=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37)\n\n        movdqa    xmm7,xmm6     ; transpose coefficients(phase 3)\n        punpckldq xmm6,xmm4     ; xmm6=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17)\n        punpckhdq xmm7,xmm4     ; xmm7=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37)\n\n        pshufd  xmm5,xmm6,0x4E  ; xmm5=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07)\n        pshufd  xmm3,xmm7,0x4E  ; xmm3=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27)\n\n        pushpic ebx                     ; save GOT address\n\n        mov     edx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n        mov     ebx, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm6\n        movq    XMM_MMWORD [ebx+eax*SIZEOF_JSAMPLE], xmm7\n        mov     edx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n        mov     ebx, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm5\n        movq    XMM_MMWORD [ebx+eax*SIZEOF_JSAMPLE], xmm3\n\n        poppic  ebx                     ; restore GOT address\n\n        add     esi, byte 4*SIZEOF_FAST_FLOAT   ; wsptr\n        add     edi, byte 4*SIZEOF_JSAMPROW\n        dec     ecx                             ; ctr\n        jnz     near .rowloop\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jidctfst-altivec.c",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2014-2015, D. R. Commander.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n/* FAST INTEGER INVERSE DCT\n *\n * This is similar to the SSE2 implementation, except that we left-shift the\n * constants by 1 less bit (the -1 in CONST_SHIFT.)  This is because\n * vec_madds(arg1, arg2, arg3) generates the 16-bit saturated sum of:\n *   the elements in arg3 + the most significant 17 bits of\n *     (the elements in arg1 * the elements in arg2).\n */\n\n#include \"jsimd_altivec.h\"\n\n\n#define F_1_082 277              /* FIX(1.082392200) */\n#define F_1_414 362              /* FIX(1.414213562) */\n#define F_1_847 473              /* FIX(1.847759065) */\n#define F_2_613 669              /* FIX(2.613125930) */\n#define F_1_613 (F_2_613 - 256)  /* FIX(2.613125930) - FIX(1) */\n\n#define CONST_BITS 8\n#define PASS1_BITS 2\n#define PRE_MULTIPLY_SCALE_BITS 2\n#define CONST_SHIFT (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS - 1)\n\n\n#define DO_IDCT(in)  \\\n{  \\\n  /* Even part */  \\\n  \\\n  tmp10 = vec_add(in##0, in##4);  \\\n  tmp11 = vec_sub(in##0, in##4);  \\\n  tmp13 = vec_add(in##2, in##6);  \\\n  \\\n  tmp12 = vec_sub(in##2, in##6);  \\\n  tmp12 = vec_sl(tmp12, pre_multiply_scale_bits);  \\\n  tmp12 = vec_madds(tmp12, pw_F1414, pw_zero);  \\\n  tmp12 = vec_sub(tmp12, tmp13);  \\\n  \\\n  tmp0 = vec_add(tmp10, tmp13);  \\\n  tmp3 = vec_sub(tmp10, tmp13);  \\\n  tmp1 = vec_add(tmp11, tmp12);  \\\n  tmp2 = vec_sub(tmp11, tmp12);  \\\n  \\\n  /* Odd part */  \\\n  \\\n  z13 = vec_add(in##5, in##3);  \\\n  z10 = vec_sub(in##5, in##3);  \\\n  z10s = vec_sl(z10, pre_multiply_scale_bits);  \\\n  z11 = vec_add(in##1, in##7);  \\\n  z12s = vec_sub(in##1, in##7);  \\\n  z12s = vec_sl(z12s, pre_multiply_scale_bits);  \\\n  \\\n  tmp11 = vec_sub(z11, z13);  \\\n  tmp11 = vec_sl(tmp11, pre_multiply_scale_bits);  \\\n  tmp11 = vec_madds(tmp11, pw_F1414, pw_zero);  \\\n  \\\n  tmp7 = vec_add(z11, z13);  \\\n  \\\n  /* To avoid overflow...  \\\n   *  \\\n   * (Original)  \\\n   * tmp12 = -2.613125930 * z10 + z5;  \\\n   *  \\\n   * (This implementation)  \\\n   * tmp12 = (-1.613125930 - 1) * z10 + z5;  \\\n   *       = -1.613125930 * z10 - z10 + z5;  \\\n   */  \\\n  \\\n  z5 = vec_add(z10s, z12s);  \\\n  z5 = vec_madds(z5, pw_F1847, pw_zero);  \\\n  \\\n  tmp10 = vec_madds(z12s, pw_F1082, pw_zero);  \\\n  tmp10 = vec_sub(tmp10, z5);  \\\n  tmp12 = vec_madds(z10s, pw_MF1613, z5);  \\\n  tmp12 = vec_sub(tmp12, z10);  \\\n  \\\n  tmp6 = vec_sub(tmp12, tmp7);  \\\n  tmp5 = vec_sub(tmp11, tmp6);  \\\n  tmp4 = vec_add(tmp10, tmp5);  \\\n  \\\n  out0 = vec_add(tmp0, tmp7);  \\\n  out1 = vec_add(tmp1, tmp6);  \\\n  out2 = vec_add(tmp2, tmp5);  \\\n  out3 = vec_sub(tmp3, tmp4);  \\\n  out4 = vec_add(tmp3, tmp4);  \\\n  out5 = vec_sub(tmp2, tmp5);  \\\n  out6 = vec_sub(tmp1, tmp6);  \\\n  out7 = vec_sub(tmp0, tmp7);  \\\n}\n\n\nvoid\njsimd_idct_ifast_altivec (void *dct_table_, JCOEFPTR coef_block,\n                          JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  short *dct_table = (short *)dct_table_;\n  int *outptr;\n\n  __vector short row0, row1, row2, row3, row4, row5, row6, row7,\n    col0, col1, col2, col3, col4, col5, col6, col7,\n    quant0, quant1, quant2, quant3, quant4, quant5, quant6, quant7,\n    tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp10, tmp11, tmp12, tmp13,\n    z5, z10, z10s, z11, z12s, z13,\n    out0, out1, out2, out3, out4, out5, out6, out7;\n  __vector signed char outb;\n\n  /* Constants */\n  __vector short pw_zero = { __8X(0) },\n    pw_F1414 = { __8X(F_1_414 << CONST_SHIFT) },\n    pw_F1847 = { __8X(F_1_847 << CONST_SHIFT) },\n    pw_MF1613 = { __8X(-F_1_613 << CONST_SHIFT) },\n    pw_F1082 = { __8X(F_1_082 << CONST_SHIFT) };\n  __vector unsigned short\n    pre_multiply_scale_bits = { __8X(PRE_MULTIPLY_SCALE_BITS) },\n    pass1_bits3 = { __8X(PASS1_BITS + 3) };\n  __vector signed char pb_centerjsamp = { __16X(CENTERJSAMPLE) };\n\n  /* Pass 1: process columns */\n\n  col0 = vec_ld(0, coef_block);\n  col1 = vec_ld(16, coef_block);\n  col2 = vec_ld(32, coef_block);\n  col3 = vec_ld(48, coef_block);\n  col4 = vec_ld(64, coef_block);\n  col5 = vec_ld(80, coef_block);\n  col6 = vec_ld(96, coef_block);\n  col7 = vec_ld(112, coef_block);\n\n  tmp1 = vec_or(col1, col2);\n  tmp2 = vec_or(col3, col4);\n  tmp1 = vec_or(tmp1, tmp2);\n  tmp3 = vec_or(col5, col6);\n  tmp3 = vec_or(tmp3, col7);\n  tmp1 = vec_or(tmp1, tmp3);\n\n  quant0 = vec_ld(0, dct_table);\n  col0 = vec_mladd(col0, quant0, pw_zero);\n\n  if (vec_all_eq(tmp1, pw_zero)) {\n    /* AC terms all zero */\n\n    row0 = vec_splat(col0, 0);\n    row1 = vec_splat(col0, 1);\n    row2 = vec_splat(col0, 2);\n    row3 = vec_splat(col0, 3);\n    row4 = vec_splat(col0, 4);\n    row5 = vec_splat(col0, 5);\n    row6 = vec_splat(col0, 6);\n    row7 = vec_splat(col0, 7);\n\n  } else {\n\n    quant1 = vec_ld(16, dct_table);\n    quant2 = vec_ld(32, dct_table);\n    quant3 = vec_ld(48, dct_table);\n    quant4 = vec_ld(64, dct_table);\n    quant5 = vec_ld(80, dct_table);\n    quant6 = vec_ld(96, dct_table);\n    quant7 = vec_ld(112, dct_table);\n\n    col1 = vec_mladd(col1, quant1, pw_zero);\n    col2 = vec_mladd(col2, quant2, pw_zero);\n    col3 = vec_mladd(col3, quant3, pw_zero);\n    col4 = vec_mladd(col4, quant4, pw_zero);\n    col5 = vec_mladd(col5, quant5, pw_zero);\n    col6 = vec_mladd(col6, quant6, pw_zero);\n    col7 = vec_mladd(col7, quant7, pw_zero);\n\n    DO_IDCT(col);\n\n    TRANSPOSE(out, row);\n  }\n\n  /* Pass 2: process rows */\n\n  DO_IDCT(row);\n\n  out0 = vec_sra(out0, pass1_bits3);\n  out1 = vec_sra(out1, pass1_bits3);\n  out2 = vec_sra(out2, pass1_bits3);\n  out3 = vec_sra(out3, pass1_bits3);\n  out4 = vec_sra(out4, pass1_bits3);\n  out5 = vec_sra(out5, pass1_bits3);\n  out6 = vec_sra(out6, pass1_bits3);\n  out7 = vec_sra(out7, pass1_bits3);\n\n  TRANSPOSE(out, col);\n\n  outb = vec_packs(col0, col0);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[0] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n\n  outb = vec_packs(col1, col1);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[1] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n\n  outb = vec_packs(col2, col2);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[2] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n\n  outb = vec_packs(col3, col3);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[3] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n\n  outb = vec_packs(col4, col4);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[4] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n\n  outb = vec_packs(col5, col5);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[5] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n\n  outb = vec_packs(col6, col6);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[6] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n\n  outb = vec_packs(col7, col7);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[7] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jidctfst-mmx.asm",
    "content": ";\n; jidctfst.asm - fast integer IDCT (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a fast, not so accurate integer implementation of\n; the inverse DCT (Discrete Cosine Transform). The following code is\n; based directly on the IJG's original jidctfst.c; see the jidctfst.c\n; for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS      8       ; 14 is also OK.\n%define PASS1_BITS      2\n\n%if IFAST_SCALE_BITS != PASS1_BITS\n%error \"'IFAST_SCALE_BITS' must be equal to 'PASS1_BITS'.\"\n%endif\n\n%if CONST_BITS == 8\nF_1_082 equ     277             ; FIX(1.082392200)\nF_1_414 equ     362             ; FIX(1.414213562)\nF_1_847 equ     473             ; FIX(1.847759065)\nF_2_613 equ     669             ; FIX(2.613125930)\nF_1_613 equ     (F_2_613 - 256) ; FIX(2.613125930) - FIX(1)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_1_082 equ     DESCALE(1162209775,30-CONST_BITS)       ; FIX(1.082392200)\nF_1_414 equ     DESCALE(1518500249,30-CONST_BITS)       ; FIX(1.414213562)\nF_1_847 equ     DESCALE(1984016188,30-CONST_BITS)       ; FIX(1.847759065)\nF_2_613 equ     DESCALE(2805822602,30-CONST_BITS)       ; FIX(2.613125930)\nF_1_613 equ     (F_2_613 - (1 << CONST_BITS))   ; FIX(2.613125930) - FIX(1)\n%endif\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n; PRE_MULTIPLY_SCALE_BITS <= 2 (to avoid overflow)\n; CONST_BITS + CONST_SHIFT + PRE_MULTIPLY_SCALE_BITS == 16 (for pmulhw)\n\n%define PRE_MULTIPLY_SCALE_BITS   2\n%define CONST_SHIFT     (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS)\n\n        alignz  16\n        global  EXTN(jconst_idct_ifast_mmx)\n\nEXTN(jconst_idct_ifast_mmx):\n\nPW_F1414        times 4 dw  F_1_414 << CONST_SHIFT\nPW_F1847        times 4 dw  F_1_847 << CONST_SHIFT\nPW_MF1613       times 4 dw -F_1_613 << CONST_SHIFT\nPW_F1082        times 4 dw  F_1_082 << CONST_SHIFT\nPB_CENTERJSAMP  times 8 db  CENTERJSAMPLE\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_ifast_mmx (void *dct_table, JCOEFPTR coef_block,\n;                       JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)    (b)+8           ; jpeg_component_info *compptr\n%define coef_block(b)   (b)+12          ; JCOEFPTR coef_block\n%define output_buf(b)   (b)+16          ; JSAMPARRAY output_buf\n%define output_col(b)   (b)+20          ; JDIMENSION output_col\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_MMWORD  ; mmword wk[WK_NUM]\n%define WK_NUM          2\n%define workspace       wk(0)-DCTSIZE2*SIZEOF_JCOEF\n                                        ; JCOEF workspace[DCTSIZE2]\n\n        align   16\n        global  EXTN(jsimd_idct_ifast_mmx)\n\nEXTN(jsimd_idct_ifast_mmx):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_MMWORD)      ; align to 64 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [workspace]\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process columns from input, store into work array.\n\n;       mov     eax, [original_ebp]\n        mov     edx, POINTER [dct_table(eax)]           ; quantptr\n        mov     esi, JCOEFPTR [coef_block(eax)]         ; inptr\n        lea     edi, [workspace]                        ; JCOEF *wsptr\n        mov     ecx, DCTSIZE/4                          ; ctr\n        alignx  16,7\n.columnloop:\n%ifndef NO_ZERO_COLUMN_TEST_IFAST_MMX\n        mov     eax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        or      eax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        jnz     short .columnDCT\n\n        movq    mm0, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movq    mm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        por     mm0, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        por     mm1, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        por     mm0, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        por     mm1, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n        por     mm0, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        por     mm1,mm0\n        packsswb mm1,mm1\n        movd    eax,mm1\n        test    eax,eax\n        jnz     short .columnDCT\n\n        ; -- AC terms all zero\n\n        movq    mm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\n        movq      mm2,mm0               ; mm0=in0=(00 01 02 03)\n        punpcklwd mm0,mm0               ; mm0=(00 00 01 01)\n        punpckhwd mm2,mm2               ; mm2=(02 02 03 03)\n\n        movq      mm1,mm0\n        punpckldq mm0,mm0               ; mm0=(00 00 00 00)\n        punpckhdq mm1,mm1               ; mm1=(01 01 01 01)\n        movq      mm3,mm2\n        punpckldq mm2,mm2               ; mm2=(02 02 02 02)\n        punpckhdq mm3,mm3               ; mm3=(03 03 03 03)\n\n        movq    MMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm0\n        movq    MMWORD [MMBLOCK(0,1,edi,SIZEOF_JCOEF)], mm0\n        movq    MMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm1\n        movq    MMWORD [MMBLOCK(1,1,edi,SIZEOF_JCOEF)], mm1\n        movq    MMWORD [MMBLOCK(2,0,edi,SIZEOF_JCOEF)], mm2\n        movq    MMWORD [MMBLOCK(2,1,edi,SIZEOF_JCOEF)], mm2\n        movq    MMWORD [MMBLOCK(3,0,edi,SIZEOF_JCOEF)], mm3\n        movq    MMWORD [MMBLOCK(3,1,edi,SIZEOF_JCOEF)], mm3\n        jmp     near .nextcolumn\n        alignx  16,7\n%endif\n.columnDCT:\n\n        ; -- Even part\n\n        movq    mm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        movq    mm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n        pmullw  mm1, MMWORD [MMBLOCK(2,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n        movq    mm2, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        movq    mm3, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm2, MMWORD [MMBLOCK(4,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n        pmullw  mm3, MMWORD [MMBLOCK(6,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\n        movq    mm4,mm0\n        movq    mm5,mm1\n        psubw   mm0,mm2                 ; mm0=tmp11\n        psubw   mm1,mm3\n        paddw   mm4,mm2                 ; mm4=tmp10\n        paddw   mm5,mm3                 ; mm5=tmp13\n\n        psllw   mm1,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  mm1,[GOTOFF(ebx,PW_F1414)]\n        psubw   mm1,mm5                 ; mm1=tmp12\n\n        movq    mm6,mm4\n        movq    mm7,mm0\n        psubw   mm4,mm5                 ; mm4=tmp3\n        psubw   mm0,mm1                 ; mm0=tmp2\n        paddw   mm6,mm5                 ; mm6=tmp0\n        paddw   mm7,mm1                 ; mm7=tmp1\n\n        movq    MMWORD [wk(1)], mm4     ; wk(1)=tmp3\n        movq    MMWORD [wk(0)], mm0     ; wk(0)=tmp2\n\n        ; -- Odd part\n\n        movq    mm2, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movq    mm3, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm2, MMWORD [MMBLOCK(1,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n        pmullw  mm3, MMWORD [MMBLOCK(3,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n        movq    mm5, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        movq    mm1, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm5, MMWORD [MMBLOCK(5,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n        pmullw  mm1, MMWORD [MMBLOCK(7,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\n        movq    mm4,mm2\n        movq    mm0,mm5\n        psubw   mm2,mm1                 ; mm2=z12\n        psubw   mm5,mm3                 ; mm5=z10\n        paddw   mm4,mm1                 ; mm4=z11\n        paddw   mm0,mm3                 ; mm0=z13\n\n        movq    mm1,mm5                 ; mm1=z10(unscaled)\n        psllw   mm2,PRE_MULTIPLY_SCALE_BITS\n        psllw   mm5,PRE_MULTIPLY_SCALE_BITS\n\n        movq    mm3,mm4\n        psubw   mm4,mm0\n        paddw   mm3,mm0                 ; mm3=tmp7\n\n        psllw   mm4,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  mm4,[GOTOFF(ebx,PW_F1414)]      ; mm4=tmp11\n\n        ; To avoid overflow...\n        ;\n        ; (Original)\n        ; tmp12 = -2.613125930 * z10 + z5;\n        ;\n        ; (This implementation)\n        ; tmp12 = (-1.613125930 - 1) * z10 + z5;\n        ;       = -1.613125930 * z10 - z10 + z5;\n\n        movq    mm0,mm5\n        paddw   mm5,mm2\n        pmulhw  mm5,[GOTOFF(ebx,PW_F1847)]      ; mm5=z5\n        pmulhw  mm0,[GOTOFF(ebx,PW_MF1613)]\n        pmulhw  mm2,[GOTOFF(ebx,PW_F1082)]\n        psubw   mm0,mm1\n        psubw   mm2,mm5                 ; mm2=tmp10\n        paddw   mm0,mm5                 ; mm0=tmp12\n\n        ; -- Final output stage\n\n        psubw   mm0,mm3                 ; mm0=tmp6\n        movq    mm1,mm6\n        movq    mm5,mm7\n        paddw   mm6,mm3                 ; mm6=data0=(00 01 02 03)\n        paddw   mm7,mm0                 ; mm7=data1=(10 11 12 13)\n        psubw   mm1,mm3                 ; mm1=data7=(70 71 72 73)\n        psubw   mm5,mm0                 ; mm5=data6=(60 61 62 63)\n        psubw   mm4,mm0                 ; mm4=tmp5\n\n        movq      mm3,mm6               ; transpose coefficients(phase 1)\n        punpcklwd mm6,mm7               ; mm6=(00 10 01 11)\n        punpckhwd mm3,mm7               ; mm3=(02 12 03 13)\n        movq      mm0,mm5               ; transpose coefficients(phase 1)\n        punpcklwd mm5,mm1               ; mm5=(60 70 61 71)\n        punpckhwd mm0,mm1               ; mm0=(62 72 63 73)\n\n        movq    mm7, MMWORD [wk(0)]     ; mm7=tmp2\n        movq    mm1, MMWORD [wk(1)]     ; mm1=tmp3\n\n        movq    MMWORD [wk(0)], mm5     ; wk(0)=(60 70 61 71)\n        movq    MMWORD [wk(1)], mm0     ; wk(1)=(62 72 63 73)\n\n        paddw   mm2,mm4                 ; mm2=tmp4\n        movq    mm5,mm7\n        movq    mm0,mm1\n        paddw   mm7,mm4                 ; mm7=data2=(20 21 22 23)\n        paddw   mm1,mm2                 ; mm1=data4=(40 41 42 43)\n        psubw   mm5,mm4                 ; mm5=data5=(50 51 52 53)\n        psubw   mm0,mm2                 ; mm0=data3=(30 31 32 33)\n\n        movq      mm4,mm7               ; transpose coefficients(phase 1)\n        punpcklwd mm7,mm0               ; mm7=(20 30 21 31)\n        punpckhwd mm4,mm0               ; mm4=(22 32 23 33)\n        movq      mm2,mm1               ; transpose coefficients(phase 1)\n        punpcklwd mm1,mm5               ; mm1=(40 50 41 51)\n        punpckhwd mm2,mm5               ; mm2=(42 52 43 53)\n\n        movq      mm0,mm6               ; transpose coefficients(phase 2)\n        punpckldq mm6,mm7               ; mm6=(00 10 20 30)\n        punpckhdq mm0,mm7               ; mm0=(01 11 21 31)\n        movq      mm5,mm3               ; transpose coefficients(phase 2)\n        punpckldq mm3,mm4               ; mm3=(02 12 22 32)\n        punpckhdq mm5,mm4               ; mm5=(03 13 23 33)\n\n        movq    mm7, MMWORD [wk(0)]     ; mm7=(60 70 61 71)\n        movq    mm4, MMWORD [wk(1)]     ; mm4=(62 72 63 73)\n\n        movq    MMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm6\n        movq    MMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm0\n        movq    MMWORD [MMBLOCK(2,0,edi,SIZEOF_JCOEF)], mm3\n        movq    MMWORD [MMBLOCK(3,0,edi,SIZEOF_JCOEF)], mm5\n\n        movq      mm6,mm1               ; transpose coefficients(phase 2)\n        punpckldq mm1,mm7               ; mm1=(40 50 60 70)\n        punpckhdq mm6,mm7               ; mm6=(41 51 61 71)\n        movq      mm0,mm2               ; transpose coefficients(phase 2)\n        punpckldq mm2,mm4               ; mm2=(42 52 62 72)\n        punpckhdq mm0,mm4               ; mm0=(43 53 63 73)\n\n        movq    MMWORD [MMBLOCK(0,1,edi,SIZEOF_JCOEF)], mm1\n        movq    MMWORD [MMBLOCK(1,1,edi,SIZEOF_JCOEF)], mm6\n        movq    MMWORD [MMBLOCK(2,1,edi,SIZEOF_JCOEF)], mm2\n        movq    MMWORD [MMBLOCK(3,1,edi,SIZEOF_JCOEF)], mm0\n\n.nextcolumn:\n        add     esi, byte 4*SIZEOF_JCOEF                ; coef_block\n        add     edx, byte 4*SIZEOF_IFAST_MULT_TYPE      ; quantptr\n        add     edi, byte 4*DCTSIZE*SIZEOF_JCOEF        ; wsptr\n        dec     ecx                                     ; ctr\n        jnz     near .columnloop\n\n        ; ---- Pass 2: process rows from work array, store into output array.\n\n        mov     eax, [original_ebp]\n        lea     esi, [workspace]                        ; JCOEF *wsptr\n        mov     edi, JSAMPARRAY [output_buf(eax)]       ; (JSAMPROW *)\n        mov     eax, JDIMENSION [output_col(eax)]\n        mov     ecx, DCTSIZE/4                          ; ctr\n        alignx  16,7\n.rowloop:\n\n        ; -- Even part\n\n        movq    mm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        movq    mm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        movq    mm2, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        movq    mm3, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\n        movq    mm4,mm0\n        movq    mm5,mm1\n        psubw   mm0,mm2                 ; mm0=tmp11\n        psubw   mm1,mm3\n        paddw   mm4,mm2                 ; mm4=tmp10\n        paddw   mm5,mm3                 ; mm5=tmp13\n\n        psllw   mm1,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  mm1,[GOTOFF(ebx,PW_F1414)]\n        psubw   mm1,mm5                 ; mm1=tmp12\n\n        movq    mm6,mm4\n        movq    mm7,mm0\n        psubw   mm4,mm5                 ; mm4=tmp3\n        psubw   mm0,mm1                 ; mm0=tmp2\n        paddw   mm6,mm5                 ; mm6=tmp0\n        paddw   mm7,mm1                 ; mm7=tmp1\n\n        movq    MMWORD [wk(1)], mm4     ; wk(1)=tmp3\n        movq    MMWORD [wk(0)], mm0     ; wk(0)=tmp2\n\n        ; -- Odd part\n\n        movq    mm2, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movq    mm3, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        movq    mm5, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        movq    mm1, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\n        movq    mm4,mm2\n        movq    mm0,mm5\n        psubw   mm2,mm1                 ; mm2=z12\n        psubw   mm5,mm3                 ; mm5=z10\n        paddw   mm4,mm1                 ; mm4=z11\n        paddw   mm0,mm3                 ; mm0=z13\n\n        movq    mm1,mm5                 ; mm1=z10(unscaled)\n        psllw   mm2,PRE_MULTIPLY_SCALE_BITS\n        psllw   mm5,PRE_MULTIPLY_SCALE_BITS\n\n        movq    mm3,mm4\n        psubw   mm4,mm0\n        paddw   mm3,mm0                 ; mm3=tmp7\n\n        psllw   mm4,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  mm4,[GOTOFF(ebx,PW_F1414)]      ; mm4=tmp11\n\n        ; To avoid overflow...\n        ;\n        ; (Original)\n        ; tmp12 = -2.613125930 * z10 + z5;\n        ;\n        ; (This implementation)\n        ; tmp12 = (-1.613125930 - 1) * z10 + z5;\n        ;       = -1.613125930 * z10 - z10 + z5;\n\n        movq    mm0,mm5\n        paddw   mm5,mm2\n        pmulhw  mm5,[GOTOFF(ebx,PW_F1847)]      ; mm5=z5\n        pmulhw  mm0,[GOTOFF(ebx,PW_MF1613)]\n        pmulhw  mm2,[GOTOFF(ebx,PW_F1082)]\n        psubw   mm0,mm1\n        psubw   mm2,mm5                 ; mm2=tmp10\n        paddw   mm0,mm5                 ; mm0=tmp12\n\n        ; -- Final output stage\n\n        psubw   mm0,mm3                 ; mm0=tmp6\n        movq    mm1,mm6\n        movq    mm5,mm7\n        paddw   mm6,mm3                 ; mm6=data0=(00 10 20 30)\n        paddw   mm7,mm0                 ; mm7=data1=(01 11 21 31)\n        psraw   mm6,(PASS1_BITS+3)      ; descale\n        psraw   mm7,(PASS1_BITS+3)      ; descale\n        psubw   mm1,mm3                 ; mm1=data7=(07 17 27 37)\n        psubw   mm5,mm0                 ; mm5=data6=(06 16 26 36)\n        psraw   mm1,(PASS1_BITS+3)      ; descale\n        psraw   mm5,(PASS1_BITS+3)      ; descale\n        psubw   mm4,mm0                 ; mm4=tmp5\n\n        packsswb  mm6,mm5               ; mm6=(00 10 20 30 06 16 26 36)\n        packsswb  mm7,mm1               ; mm7=(01 11 21 31 07 17 27 37)\n\n        movq    mm3, MMWORD [wk(0)]     ; mm3=tmp2\n        movq    mm0, MMWORD [wk(1)]     ; mm0=tmp3\n\n        paddw   mm2,mm4                 ; mm2=tmp4\n        movq    mm5,mm3\n        movq    mm1,mm0\n        paddw   mm3,mm4                 ; mm3=data2=(02 12 22 32)\n        paddw   mm0,mm2                 ; mm0=data4=(04 14 24 34)\n        psraw   mm3,(PASS1_BITS+3)      ; descale\n        psraw   mm0,(PASS1_BITS+3)      ; descale\n        psubw   mm5,mm4                 ; mm5=data5=(05 15 25 35)\n        psubw   mm1,mm2                 ; mm1=data3=(03 13 23 33)\n        psraw   mm5,(PASS1_BITS+3)      ; descale\n        psraw   mm1,(PASS1_BITS+3)      ; descale\n\n        movq      mm4,[GOTOFF(ebx,PB_CENTERJSAMP)]      ; mm4=[PB_CENTERJSAMP]\n\n        packsswb  mm3,mm0               ; mm3=(02 12 22 32 04 14 24 34)\n        packsswb  mm1,mm5               ; mm1=(03 13 23 33 05 15 25 35)\n\n        paddb     mm6,mm4\n        paddb     mm7,mm4\n        paddb     mm3,mm4\n        paddb     mm1,mm4\n\n        movq      mm2,mm6               ; transpose coefficients(phase 1)\n        punpcklbw mm6,mm7               ; mm6=(00 01 10 11 20 21 30 31)\n        punpckhbw mm2,mm7               ; mm2=(06 07 16 17 26 27 36 37)\n        movq      mm0,mm3               ; transpose coefficients(phase 1)\n        punpcklbw mm3,mm1               ; mm3=(02 03 12 13 22 23 32 33)\n        punpckhbw mm0,mm1               ; mm0=(04 05 14 15 24 25 34 35)\n\n        movq      mm5,mm6               ; transpose coefficients(phase 2)\n        punpcklwd mm6,mm3               ; mm6=(00 01 02 03 10 11 12 13)\n        punpckhwd mm5,mm3               ; mm5=(20 21 22 23 30 31 32 33)\n        movq      mm4,mm0               ; transpose coefficients(phase 2)\n        punpcklwd mm0,mm2               ; mm0=(04 05 06 07 14 15 16 17)\n        punpckhwd mm4,mm2               ; mm4=(24 25 26 27 34 35 36 37)\n\n        movq      mm7,mm6               ; transpose coefficients(phase 3)\n        punpckldq mm6,mm0               ; mm6=(00 01 02 03 04 05 06 07)\n        punpckhdq mm7,mm0               ; mm7=(10 11 12 13 14 15 16 17)\n        movq      mm1,mm5               ; transpose coefficients(phase 3)\n        punpckldq mm5,mm4               ; mm5=(20 21 22 23 24 25 26 27)\n        punpckhdq mm1,mm4               ; mm1=(30 31 32 33 34 35 36 37)\n\n        pushpic ebx                     ; save GOT address\n\n        mov     edx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n        mov     ebx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n        movq    MMWORD [edx+eax*SIZEOF_JSAMPLE], mm6\n        movq    MMWORD [ebx+eax*SIZEOF_JSAMPLE], mm7\n        mov     edx, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n        mov     ebx, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n        movq    MMWORD [edx+eax*SIZEOF_JSAMPLE], mm5\n        movq    MMWORD [ebx+eax*SIZEOF_JSAMPLE], mm1\n\n        poppic  ebx                     ; restore GOT address\n\n        add     esi, byte 4*SIZEOF_JCOEF        ; wsptr\n        add     edi, byte 4*SIZEOF_JSAMPROW\n        dec     ecx                             ; ctr\n        jnz     near .rowloop\n\n        emms            ; empty MMX state\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jidctfst-sse2-64.asm",
    "content": ";\n; jidctfst.asm - fast integer IDCT (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a fast, not so accurate integer implementation of\n; the inverse DCT (Discrete Cosine Transform). The following code is\n; based directly on the IJG's original jidctfst.c; see the jidctfst.c\n; for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS      8       ; 14 is also OK.\n%define PASS1_BITS      2\n\n%if IFAST_SCALE_BITS != PASS1_BITS\n%error \"'IFAST_SCALE_BITS' must be equal to 'PASS1_BITS'.\"\n%endif\n\n%if CONST_BITS == 8\nF_1_082 equ     277             ; FIX(1.082392200)\nF_1_414 equ     362             ; FIX(1.414213562)\nF_1_847 equ     473             ; FIX(1.847759065)\nF_2_613 equ     669             ; FIX(2.613125930)\nF_1_613 equ     (F_2_613 - 256) ; FIX(2.613125930) - FIX(1)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_1_082 equ     DESCALE(1162209775,30-CONST_BITS)       ; FIX(1.082392200)\nF_1_414 equ     DESCALE(1518500249,30-CONST_BITS)       ; FIX(1.414213562)\nF_1_847 equ     DESCALE(1984016188,30-CONST_BITS)       ; FIX(1.847759065)\nF_2_613 equ     DESCALE(2805822602,30-CONST_BITS)       ; FIX(2.613125930)\nF_1_613 equ     (F_2_613 - (1 << CONST_BITS))   ; FIX(2.613125930) - FIX(1)\n%endif\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n; PRE_MULTIPLY_SCALE_BITS <= 2 (to avoid overflow)\n; CONST_BITS + CONST_SHIFT + PRE_MULTIPLY_SCALE_BITS == 16 (for pmulhw)\n\n%define PRE_MULTIPLY_SCALE_BITS   2\n%define CONST_SHIFT     (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS)\n\n        alignz  16\n        global  EXTN(jconst_idct_ifast_sse2)\n\nEXTN(jconst_idct_ifast_sse2):\n\nPW_F1414        times 8 dw  F_1_414 << CONST_SHIFT\nPW_F1847        times 8 dw  F_1_847 << CONST_SHIFT\nPW_MF1613       times 8 dw -F_1_613 << CONST_SHIFT\nPW_F1082        times 8 dw  F_1_082 << CONST_SHIFT\nPB_CENTERJSAMP  times 16 db CENTERJSAMPLE\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_ifast_sse2 (void *dct_table, JCOEFPTR coef_block,\n;                       JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n; r10 = jpeg_component_info *compptr\n; r11 = JCOEFPTR coef_block\n; r12 = JSAMPARRAY output_buf\n; r13 = JDIMENSION output_col\n\n%define original_rbp    rbp+0\n%define wk(i)           rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          2\n\n        align   16\n        global  EXTN(jsimd_idct_ifast_sse2)\n\nEXTN(jsimd_idct_ifast_sse2):\n        push    rbp\n        mov     rax,rsp                         ; rax = original rbp\n        sub     rsp, byte 4\n        and     rsp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [rsp],rax\n        mov     rbp,rsp                         ; rbp = aligned rbp\n        lea     rsp, [wk(0)]\n        collect_args\n\n        ; ---- Pass 1: process columns from input.\n\n        mov     rdx, r10                ; quantptr\n        mov     rsi, r11                ; inptr\n\n%ifndef NO_ZERO_COLUMN_TEST_IFAST_SSE2\n        mov     eax, DWORD [DWBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n        or      eax, DWORD [DWBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n        jnz     near .columnDCT\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n        por     xmm1, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n        por     xmm1, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n        por     xmm1,xmm0\n        packsswb xmm1,xmm1\n        packsswb xmm1,xmm1\n        movd    eax,xmm1\n        test    rax,rax\n        jnz     short .columnDCT\n\n        ; -- AC terms all zero\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        movdqa    xmm7,xmm0             ; xmm0=in0=(00 01 02 03 04 05 06 07)\n        punpcklwd xmm0,xmm0             ; xmm0=(00 00 01 01 02 02 03 03)\n        punpckhwd xmm7,xmm7             ; xmm7=(04 04 05 05 06 06 07 07)\n\n        pshufd  xmm6,xmm0,0x00          ; xmm6=col0=(00 00 00 00 00 00 00 00)\n        pshufd  xmm2,xmm0,0x55          ; xmm2=col1=(01 01 01 01 01 01 01 01)\n        pshufd  xmm5,xmm0,0xAA          ; xmm5=col2=(02 02 02 02 02 02 02 02)\n        pshufd  xmm0,xmm0,0xFF          ; xmm0=col3=(03 03 03 03 03 03 03 03)\n        pshufd  xmm1,xmm7,0x00          ; xmm1=col4=(04 04 04 04 04 04 04 04)\n        pshufd  xmm4,xmm7,0x55          ; xmm4=col5=(05 05 05 05 05 05 05 05)\n        pshufd  xmm3,xmm7,0xAA          ; xmm3=col6=(06 06 06 06 06 06 06 06)\n        pshufd  xmm7,xmm7,0xFF          ; xmm7=col7=(07 07 07 07 07 07 07 07)\n\n        movdqa  XMMWORD [wk(0)], xmm2   ; wk(0)=col1\n        movdqa  XMMWORD [wk(1)], xmm0   ; wk(1)=col3\n        jmp     near .column_end\n%endif\n.columnDCT:\n\n        ; -- Even part\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n        pmullw  xmm1, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n        movdqa  xmm2, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm2, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n        pmullw  xmm3, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n\n        movdqa  xmm4,xmm0\n        movdqa  xmm5,xmm1\n        psubw   xmm0,xmm2               ; xmm0=tmp11\n        psubw   xmm1,xmm3\n        paddw   xmm4,xmm2               ; xmm4=tmp10\n        paddw   xmm5,xmm3               ; xmm5=tmp13\n\n        psllw   xmm1,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm1,[rel PW_F1414]\n        psubw   xmm1,xmm5               ; xmm1=tmp12\n\n        movdqa  xmm6,xmm4\n        movdqa  xmm7,xmm0\n        psubw   xmm4,xmm5               ; xmm4=tmp3\n        psubw   xmm0,xmm1               ; xmm0=tmp2\n        paddw   xmm6,xmm5               ; xmm6=tmp0\n        paddw   xmm7,xmm1               ; xmm7=tmp1\n\n        movdqa  XMMWORD [wk(1)], xmm4   ; wk(1)=tmp3\n        movdqa  XMMWORD [wk(0)], xmm0   ; wk(0)=tmp2\n\n        ; -- Odd part\n\n        movdqa  xmm2, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm2, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n        pmullw  xmm3, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n        movdqa  xmm5, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm5, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n        pmullw  xmm1, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n\n        movdqa  xmm4,xmm2\n        movdqa  xmm0,xmm5\n        psubw   xmm2,xmm1               ; xmm2=z12\n        psubw   xmm5,xmm3               ; xmm5=z10\n        paddw   xmm4,xmm1               ; xmm4=z11\n        paddw   xmm0,xmm3               ; xmm0=z13\n\n        movdqa  xmm1,xmm5               ; xmm1=z10(unscaled)\n        psllw   xmm2,PRE_MULTIPLY_SCALE_BITS\n        psllw   xmm5,PRE_MULTIPLY_SCALE_BITS\n\n        movdqa  xmm3,xmm4\n        psubw   xmm4,xmm0\n        paddw   xmm3,xmm0               ; xmm3=tmp7\n\n        psllw   xmm4,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm4,[rel PW_F1414]     ; xmm4=tmp11\n\n        ; To avoid overflow...\n        ;\n        ; (Original)\n        ; tmp12 = -2.613125930 * z10 + z5;\n        ;\n        ; (This implementation)\n        ; tmp12 = (-1.613125930 - 1) * z10 + z5;\n        ;       = -1.613125930 * z10 - z10 + z5;\n\n        movdqa  xmm0,xmm5\n        paddw   xmm5,xmm2\n        pmulhw  xmm5,[rel PW_F1847]     ; xmm5=z5\n        pmulhw  xmm0,[rel PW_MF1613]\n        pmulhw  xmm2,[rel PW_F1082]\n        psubw   xmm0,xmm1\n        psubw   xmm2,xmm5               ; xmm2=tmp10\n        paddw   xmm0,xmm5               ; xmm0=tmp12\n\n        ; -- Final output stage\n\n        psubw   xmm0,xmm3               ; xmm0=tmp6\n        movdqa  xmm1,xmm6\n        movdqa  xmm5,xmm7\n        paddw   xmm6,xmm3               ; xmm6=data0=(00 01 02 03 04 05 06 07)\n        paddw   xmm7,xmm0               ; xmm7=data1=(10 11 12 13 14 15 16 17)\n        psubw   xmm1,xmm3               ; xmm1=data7=(70 71 72 73 74 75 76 77)\n        psubw   xmm5,xmm0               ; xmm5=data6=(60 61 62 63 64 65 66 67)\n        psubw   xmm4,xmm0               ; xmm4=tmp5\n\n        movdqa    xmm3,xmm6             ; transpose coefficients(phase 1)\n        punpcklwd xmm6,xmm7             ; xmm6=(00 10 01 11 02 12 03 13)\n        punpckhwd xmm3,xmm7             ; xmm3=(04 14 05 15 06 16 07 17)\n        movdqa    xmm0,xmm5             ; transpose coefficients(phase 1)\n        punpcklwd xmm5,xmm1             ; xmm5=(60 70 61 71 62 72 63 73)\n        punpckhwd xmm0,xmm1             ; xmm0=(64 74 65 75 66 76 67 77)\n\n        movdqa  xmm7, XMMWORD [wk(0)]   ; xmm7=tmp2\n        movdqa  xmm1, XMMWORD [wk(1)]   ; xmm1=tmp3\n\n        movdqa  XMMWORD [wk(0)], xmm5   ; wk(0)=(60 70 61 71 62 72 63 73)\n        movdqa  XMMWORD [wk(1)], xmm0   ; wk(1)=(64 74 65 75 66 76 67 77)\n\n        paddw   xmm2,xmm4               ; xmm2=tmp4\n        movdqa  xmm5,xmm7\n        movdqa  xmm0,xmm1\n        paddw   xmm7,xmm4               ; xmm7=data2=(20 21 22 23 24 25 26 27)\n        paddw   xmm1,xmm2               ; xmm1=data4=(40 41 42 43 44 45 46 47)\n        psubw   xmm5,xmm4               ; xmm5=data5=(50 51 52 53 54 55 56 57)\n        psubw   xmm0,xmm2               ; xmm0=data3=(30 31 32 33 34 35 36 37)\n\n        movdqa    xmm4,xmm7             ; transpose coefficients(phase 1)\n        punpcklwd xmm7,xmm0             ; xmm7=(20 30 21 31 22 32 23 33)\n        punpckhwd xmm4,xmm0             ; xmm4=(24 34 25 35 26 36 27 37)\n        movdqa    xmm2,xmm1             ; transpose coefficients(phase 1)\n        punpcklwd xmm1,xmm5             ; xmm1=(40 50 41 51 42 52 43 53)\n        punpckhwd xmm2,xmm5             ; xmm2=(44 54 45 55 46 56 47 57)\n\n        movdqa    xmm0,xmm3             ; transpose coefficients(phase 2)\n        punpckldq xmm3,xmm4             ; xmm3=(04 14 24 34 05 15 25 35)\n        punpckhdq xmm0,xmm4             ; xmm0=(06 16 26 36 07 17 27 37)\n        movdqa    xmm5,xmm6             ; transpose coefficients(phase 2)\n        punpckldq xmm6,xmm7             ; xmm6=(00 10 20 30 01 11 21 31)\n        punpckhdq xmm5,xmm7             ; xmm5=(02 12 22 32 03 13 23 33)\n\n        movdqa  xmm4, XMMWORD [wk(0)]   ; xmm4=(60 70 61 71 62 72 63 73)\n        movdqa  xmm7, XMMWORD [wk(1)]   ; xmm7=(64 74 65 75 66 76 67 77)\n\n        movdqa  XMMWORD [wk(0)], xmm3   ; wk(0)=(04 14 24 34 05 15 25 35)\n        movdqa  XMMWORD [wk(1)], xmm0   ; wk(1)=(06 16 26 36 07 17 27 37)\n\n        movdqa    xmm3,xmm1             ; transpose coefficients(phase 2)\n        punpckldq xmm1,xmm4             ; xmm1=(40 50 60 70 41 51 61 71)\n        punpckhdq xmm3,xmm4             ; xmm3=(42 52 62 72 43 53 63 73)\n        movdqa    xmm0,xmm2             ; transpose coefficients(phase 2)\n        punpckldq xmm2,xmm7             ; xmm2=(44 54 64 74 45 55 65 75)\n        punpckhdq xmm0,xmm7             ; xmm0=(46 56 66 76 47 57 67 77)\n\n        movdqa     xmm4,xmm6            ; transpose coefficients(phase 3)\n        punpcklqdq xmm6,xmm1            ; xmm6=col0=(00 10 20 30 40 50 60 70)\n        punpckhqdq xmm4,xmm1            ; xmm4=col1=(01 11 21 31 41 51 61 71)\n        movdqa     xmm7,xmm5            ; transpose coefficients(phase 3)\n        punpcklqdq xmm5,xmm3            ; xmm5=col2=(02 12 22 32 42 52 62 72)\n        punpckhqdq xmm7,xmm3            ; xmm7=col3=(03 13 23 33 43 53 63 73)\n\n        movdqa  xmm1, XMMWORD [wk(0)]   ; xmm1=(04 14 24 34 05 15 25 35)\n        movdqa  xmm3, XMMWORD [wk(1)]   ; xmm3=(06 16 26 36 07 17 27 37)\n\n        movdqa  XMMWORD [wk(0)], xmm4   ; wk(0)=col1\n        movdqa  XMMWORD [wk(1)], xmm7   ; wk(1)=col3\n\n        movdqa     xmm4,xmm1            ; transpose coefficients(phase 3)\n        punpcklqdq xmm1,xmm2            ; xmm1=col4=(04 14 24 34 44 54 64 74)\n        punpckhqdq xmm4,xmm2            ; xmm4=col5=(05 15 25 35 45 55 65 75)\n        movdqa     xmm7,xmm3            ; transpose coefficients(phase 3)\n        punpcklqdq xmm3,xmm0            ; xmm3=col6=(06 16 26 36 46 56 66 76)\n        punpckhqdq xmm7,xmm0            ; xmm7=col7=(07 17 27 37 47 57 67 77)\n.column_end:\n\n        ; -- Prefetch the next coefficient block\n\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n        ; ---- Pass 2: process rows from work array, store into output array.\n\n        mov     rax, [original_rbp]\n        mov     rdi, r12        ; (JSAMPROW *)\n        mov     eax, r13d\n\n        ; -- Even part\n\n        ; xmm6=col0, xmm5=col2, xmm1=col4, xmm3=col6\n\n        movdqa  xmm2,xmm6\n        movdqa  xmm0,xmm5\n        psubw   xmm6,xmm1               ; xmm6=tmp11\n        psubw   xmm5,xmm3\n        paddw   xmm2,xmm1               ; xmm2=tmp10\n        paddw   xmm0,xmm3               ; xmm0=tmp13\n\n        psllw   xmm5,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm5,[rel PW_F1414]\n        psubw   xmm5,xmm0               ; xmm5=tmp12\n\n        movdqa  xmm1,xmm2\n        movdqa  xmm3,xmm6\n        psubw   xmm2,xmm0               ; xmm2=tmp3\n        psubw   xmm6,xmm5               ; xmm6=tmp2\n        paddw   xmm1,xmm0               ; xmm1=tmp0\n        paddw   xmm3,xmm5               ; xmm3=tmp1\n\n        movdqa  xmm0, XMMWORD [wk(0)]   ; xmm0=col1\n        movdqa  xmm5, XMMWORD [wk(1)]   ; xmm5=col3\n\n        movdqa  XMMWORD [wk(0)], xmm2   ; wk(0)=tmp3\n        movdqa  XMMWORD [wk(1)], xmm6   ; wk(1)=tmp2\n\n        ; -- Odd part\n\n        ; xmm0=col1, xmm5=col3, xmm4=col5, xmm7=col7\n\n        movdqa  xmm2,xmm0\n        movdqa  xmm6,xmm4\n        psubw   xmm0,xmm7               ; xmm0=z12\n        psubw   xmm4,xmm5               ; xmm4=z10\n        paddw   xmm2,xmm7               ; xmm2=z11\n        paddw   xmm6,xmm5               ; xmm6=z13\n\n        movdqa  xmm7,xmm4               ; xmm7=z10(unscaled)\n        psllw   xmm0,PRE_MULTIPLY_SCALE_BITS\n        psllw   xmm4,PRE_MULTIPLY_SCALE_BITS\n\n        movdqa  xmm5,xmm2\n        psubw   xmm2,xmm6\n        paddw   xmm5,xmm6               ; xmm5=tmp7\n\n        psllw   xmm2,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm2,[rel PW_F1414]     ; xmm2=tmp11\n\n        ; To avoid overflow...\n        ;\n        ; (Original)\n        ; tmp12 = -2.613125930 * z10 + z5;\n        ;\n        ; (This implementation)\n        ; tmp12 = (-1.613125930 - 1) * z10 + z5;\n        ;       = -1.613125930 * z10 - z10 + z5;\n\n        movdqa  xmm6,xmm4\n        paddw   xmm4,xmm0\n        pmulhw  xmm4,[rel PW_F1847]     ; xmm4=z5\n        pmulhw  xmm6,[rel PW_MF1613]\n        pmulhw  xmm0,[rel PW_F1082]\n        psubw   xmm6,xmm7\n        psubw   xmm0,xmm4               ; xmm0=tmp10\n        paddw   xmm6,xmm4               ; xmm6=tmp12\n\n        ; -- Final output stage\n\n        psubw   xmm6,xmm5               ; xmm6=tmp6\n        movdqa  xmm7,xmm1\n        movdqa  xmm4,xmm3\n        paddw   xmm1,xmm5               ; xmm1=data0=(00 10 20 30 40 50 60 70)\n        paddw   xmm3,xmm6               ; xmm3=data1=(01 11 21 31 41 51 61 71)\n        psraw   xmm1,(PASS1_BITS+3)     ; descale\n        psraw   xmm3,(PASS1_BITS+3)     ; descale\n        psubw   xmm7,xmm5               ; xmm7=data7=(07 17 27 37 47 57 67 77)\n        psubw   xmm4,xmm6               ; xmm4=data6=(06 16 26 36 46 56 66 76)\n        psraw   xmm7,(PASS1_BITS+3)     ; descale\n        psraw   xmm4,(PASS1_BITS+3)     ; descale\n        psubw   xmm2,xmm6               ; xmm2=tmp5\n\n        packsswb  xmm1,xmm4     ; xmm1=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n        packsswb  xmm3,xmm7     ; xmm3=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n        movdqa  xmm5, XMMWORD [wk(1)]   ; xmm5=tmp2\n        movdqa  xmm6, XMMWORD [wk(0)]   ; xmm6=tmp3\n\n        paddw   xmm0,xmm2               ; xmm0=tmp4\n        movdqa  xmm4,xmm5\n        movdqa  xmm7,xmm6\n        paddw   xmm5,xmm2               ; xmm5=data2=(02 12 22 32 42 52 62 72)\n        paddw   xmm6,xmm0               ; xmm6=data4=(04 14 24 34 44 54 64 74)\n        psraw   xmm5,(PASS1_BITS+3)     ; descale\n        psraw   xmm6,(PASS1_BITS+3)     ; descale\n        psubw   xmm4,xmm2               ; xmm4=data5=(05 15 25 35 45 55 65 75)\n        psubw   xmm7,xmm0               ; xmm7=data3=(03 13 23 33 43 53 63 73)\n        psraw   xmm4,(PASS1_BITS+3)     ; descale\n        psraw   xmm7,(PASS1_BITS+3)     ; descale\n\n        movdqa    xmm2,[rel PB_CENTERJSAMP]     ; xmm2=[rel PB_CENTERJSAMP]\n\n        packsswb  xmm5,xmm6     ; xmm5=(02 12 22 32 42 52 62 72 04 14 24 34 44 54 64 74)\n        packsswb  xmm7,xmm4     ; xmm7=(03 13 23 33 43 53 63 73 05 15 25 35 45 55 65 75)\n\n        paddb     xmm1,xmm2\n        paddb     xmm3,xmm2\n        paddb     xmm5,xmm2\n        paddb     xmm7,xmm2\n\n        movdqa    xmm0,xmm1     ; transpose coefficients(phase 1)\n        punpcklbw xmm1,xmm3     ; xmm1=(00 01 10 11 20 21 30 31 40 41 50 51 60 61 70 71)\n        punpckhbw xmm0,xmm3     ; xmm0=(06 07 16 17 26 27 36 37 46 47 56 57 66 67 76 77)\n        movdqa    xmm6,xmm5     ; transpose coefficients(phase 1)\n        punpcklbw xmm5,xmm7     ; xmm5=(02 03 12 13 22 23 32 33 42 43 52 53 62 63 72 73)\n        punpckhbw xmm6,xmm7     ; xmm6=(04 05 14 15 24 25 34 35 44 45 54 55 64 65 74 75)\n\n        movdqa    xmm4,xmm1     ; transpose coefficients(phase 2)\n        punpcklwd xmm1,xmm5     ; xmm1=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33)\n        punpckhwd xmm4,xmm5     ; xmm4=(40 41 42 43 50 51 52 53 60 61 62 63 70 71 72 73)\n        movdqa    xmm2,xmm6     ; transpose coefficients(phase 2)\n        punpcklwd xmm6,xmm0     ; xmm6=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37)\n        punpckhwd xmm2,xmm0     ; xmm2=(44 45 46 47 54 55 56 57 64 65 66 67 74 75 76 77)\n\n        movdqa    xmm3,xmm1     ; transpose coefficients(phase 3)\n        punpckldq xmm1,xmm6     ; xmm1=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17)\n        punpckhdq xmm3,xmm6     ; xmm3=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37)\n        movdqa    xmm7,xmm4     ; transpose coefficients(phase 3)\n        punpckldq xmm4,xmm2     ; xmm4=(40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57)\n        punpckhdq xmm7,xmm2     ; xmm7=(60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77)\n\n        pshufd  xmm5,xmm1,0x4E  ; xmm5=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07)\n        pshufd  xmm0,xmm3,0x4E  ; xmm0=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27)\n        pshufd  xmm6,xmm4,0x4E  ; xmm6=(50 51 52 53 54 55 56 57 40 41 42 43 44 45 46 47)\n        pshufd  xmm2,xmm7,0x4E  ; xmm2=(70 71 72 73 74 75 76 77 60 61 62 63 64 65 66 67)\n\n        mov     rdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW]\n        mov     rsi, JSAMPROW [rdi+2*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm1\n        movq    XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm3\n        mov     rdx, JSAMPROW [rdi+4*SIZEOF_JSAMPROW]\n        mov     rsi, JSAMPROW [rdi+6*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm4\n        movq    XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm7\n\n        mov     rdx, JSAMPROW [rdi+1*SIZEOF_JSAMPROW]\n        mov     rsi, JSAMPROW [rdi+3*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm5\n        movq    XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm0\n        mov     rdx, JSAMPROW [rdi+5*SIZEOF_JSAMPROW]\n        mov     rsi, JSAMPROW [rdi+7*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm6\n        movq    XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm2\n\n        uncollect_args\n        mov     rsp,rbp         ; rsp <- aligned rbp\n        pop     rsp             ; rsp <- original rbp\n        pop     rbp\n        ret\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jidctfst-sse2.asm",
    "content": ";\n; jidctfst.asm - fast integer IDCT (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a fast, not so accurate integer implementation of\n; the inverse DCT (Discrete Cosine Transform). The following code is\n; based directly on the IJG's original jidctfst.c; see the jidctfst.c\n; for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS      8       ; 14 is also OK.\n%define PASS1_BITS      2\n\n%if IFAST_SCALE_BITS != PASS1_BITS\n%error \"'IFAST_SCALE_BITS' must be equal to 'PASS1_BITS'.\"\n%endif\n\n%if CONST_BITS == 8\nF_1_082 equ     277             ; FIX(1.082392200)\nF_1_414 equ     362             ; FIX(1.414213562)\nF_1_847 equ     473             ; FIX(1.847759065)\nF_2_613 equ     669             ; FIX(2.613125930)\nF_1_613 equ     (F_2_613 - 256) ; FIX(2.613125930) - FIX(1)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_1_082 equ     DESCALE(1162209775,30-CONST_BITS)       ; FIX(1.082392200)\nF_1_414 equ     DESCALE(1518500249,30-CONST_BITS)       ; FIX(1.414213562)\nF_1_847 equ     DESCALE(1984016188,30-CONST_BITS)       ; FIX(1.847759065)\nF_2_613 equ     DESCALE(2805822602,30-CONST_BITS)       ; FIX(2.613125930)\nF_1_613 equ     (F_2_613 - (1 << CONST_BITS))   ; FIX(2.613125930) - FIX(1)\n%endif\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n; PRE_MULTIPLY_SCALE_BITS <= 2 (to avoid overflow)\n; CONST_BITS + CONST_SHIFT + PRE_MULTIPLY_SCALE_BITS == 16 (for pmulhw)\n\n%define PRE_MULTIPLY_SCALE_BITS   2\n%define CONST_SHIFT     (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS)\n\n        alignz  16\n        global  EXTN(jconst_idct_ifast_sse2)\n\nEXTN(jconst_idct_ifast_sse2):\n\nPW_F1414        times 8 dw  F_1_414 << CONST_SHIFT\nPW_F1847        times 8 dw  F_1_847 << CONST_SHIFT\nPW_MF1613       times 8 dw -F_1_613 << CONST_SHIFT\nPW_F1082        times 8 dw  F_1_082 << CONST_SHIFT\nPB_CENTERJSAMP  times 16 db CENTERJSAMPLE\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_ifast_sse2 (void *dct_table, JCOEFPTR coef_block,\n;                       JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)    (b)+8           ; jpeg_component_info *compptr\n%define coef_block(b)   (b)+12          ; JCOEFPTR coef_block\n%define output_buf(b)   (b)+16          ; JSAMPARRAY output_buf\n%define output_col(b)   (b)+20          ; JDIMENSION output_col\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          2\n\n        align   16\n        global  EXTN(jsimd_idct_ifast_sse2)\n\nEXTN(jsimd_idct_ifast_sse2):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic ebx\n;       push    ecx             ; unused\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process columns from input.\n\n;       mov     eax, [original_ebp]\n        mov     edx, POINTER [dct_table(eax)]           ; quantptr\n        mov     esi, JCOEFPTR [coef_block(eax)]         ; inptr\n\n%ifndef NO_ZERO_COLUMN_TEST_IFAST_SSE2\n        mov     eax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        or      eax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        jnz     near .columnDCT\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        por     xmm1, XMMWORD [XMMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        por     xmm1, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        por     xmm1,xmm0\n        packsswb xmm1,xmm1\n        packsswb xmm1,xmm1\n        movd    eax,xmm1\n        test    eax,eax\n        jnz     short .columnDCT\n\n        ; -- AC terms all zero\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        movdqa    xmm7,xmm0             ; xmm0=in0=(00 01 02 03 04 05 06 07)\n        punpcklwd xmm0,xmm0             ; xmm0=(00 00 01 01 02 02 03 03)\n        punpckhwd xmm7,xmm7             ; xmm7=(04 04 05 05 06 06 07 07)\n\n        pshufd  xmm6,xmm0,0x00          ; xmm6=col0=(00 00 00 00 00 00 00 00)\n        pshufd  xmm2,xmm0,0x55          ; xmm2=col1=(01 01 01 01 01 01 01 01)\n        pshufd  xmm5,xmm0,0xAA          ; xmm5=col2=(02 02 02 02 02 02 02 02)\n        pshufd  xmm0,xmm0,0xFF          ; xmm0=col3=(03 03 03 03 03 03 03 03)\n        pshufd  xmm1,xmm7,0x00          ; xmm1=col4=(04 04 04 04 04 04 04 04)\n        pshufd  xmm4,xmm7,0x55          ; xmm4=col5=(05 05 05 05 05 05 05 05)\n        pshufd  xmm3,xmm7,0xAA          ; xmm3=col6=(06 06 06 06 06 06 06 06)\n        pshufd  xmm7,xmm7,0xFF          ; xmm7=col7=(07 07 07 07 07 07 07 07)\n\n        movdqa  XMMWORD [wk(0)], xmm2   ; wk(0)=col1\n        movdqa  XMMWORD [wk(1)], xmm0   ; wk(1)=col3\n        jmp     near .column_end\n        alignx  16,7\n%endif\n.columnDCT:\n\n        ; -- Even part\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n        pmullw  xmm1, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n        movdqa  xmm2, XMMWORD [XMMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm2, XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n        pmullw  xmm3, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\n        movdqa  xmm4,xmm0\n        movdqa  xmm5,xmm1\n        psubw   xmm0,xmm2               ; xmm0=tmp11\n        psubw   xmm1,xmm3\n        paddw   xmm4,xmm2               ; xmm4=tmp10\n        paddw   xmm5,xmm3               ; xmm5=tmp13\n\n        psllw   xmm1,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm1,[GOTOFF(ebx,PW_F1414)]\n        psubw   xmm1,xmm5               ; xmm1=tmp12\n\n        movdqa  xmm6,xmm4\n        movdqa  xmm7,xmm0\n        psubw   xmm4,xmm5               ; xmm4=tmp3\n        psubw   xmm0,xmm1               ; xmm0=tmp2\n        paddw   xmm6,xmm5               ; xmm6=tmp0\n        paddw   xmm7,xmm1               ; xmm7=tmp1\n\n        movdqa  XMMWORD [wk(1)], xmm4   ; wk(1)=tmp3\n        movdqa  XMMWORD [wk(0)], xmm0   ; wk(0)=tmp2\n\n        ; -- Odd part\n\n        movdqa  xmm2, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm2, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n        pmullw  xmm3, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n        movdqa  xmm5, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm5, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n        pmullw  xmm1, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\n        movdqa  xmm4,xmm2\n        movdqa  xmm0,xmm5\n        psubw   xmm2,xmm1               ; xmm2=z12\n        psubw   xmm5,xmm3               ; xmm5=z10\n        paddw   xmm4,xmm1               ; xmm4=z11\n        paddw   xmm0,xmm3               ; xmm0=z13\n\n        movdqa  xmm1,xmm5               ; xmm1=z10(unscaled)\n        psllw   xmm2,PRE_MULTIPLY_SCALE_BITS\n        psllw   xmm5,PRE_MULTIPLY_SCALE_BITS\n\n        movdqa  xmm3,xmm4\n        psubw   xmm4,xmm0\n        paddw   xmm3,xmm0               ; xmm3=tmp7\n\n        psllw   xmm4,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm4,[GOTOFF(ebx,PW_F1414)]     ; xmm4=tmp11\n\n        ; To avoid overflow...\n        ;\n        ; (Original)\n        ; tmp12 = -2.613125930 * z10 + z5;\n        ;\n        ; (This implementation)\n        ; tmp12 = (-1.613125930 - 1) * z10 + z5;\n        ;       = -1.613125930 * z10 - z10 + z5;\n\n        movdqa  xmm0,xmm5\n        paddw   xmm5,xmm2\n        pmulhw  xmm5,[GOTOFF(ebx,PW_F1847)]     ; xmm5=z5\n        pmulhw  xmm0,[GOTOFF(ebx,PW_MF1613)]\n        pmulhw  xmm2,[GOTOFF(ebx,PW_F1082)]\n        psubw   xmm0,xmm1\n        psubw   xmm2,xmm5               ; xmm2=tmp10\n        paddw   xmm0,xmm5               ; xmm0=tmp12\n\n        ; -- Final output stage\n\n        psubw   xmm0,xmm3               ; xmm0=tmp6\n        movdqa  xmm1,xmm6\n        movdqa  xmm5,xmm7\n        paddw   xmm6,xmm3               ; xmm6=data0=(00 01 02 03 04 05 06 07)\n        paddw   xmm7,xmm0               ; xmm7=data1=(10 11 12 13 14 15 16 17)\n        psubw   xmm1,xmm3               ; xmm1=data7=(70 71 72 73 74 75 76 77)\n        psubw   xmm5,xmm0               ; xmm5=data6=(60 61 62 63 64 65 66 67)\n        psubw   xmm4,xmm0               ; xmm4=tmp5\n\n        movdqa    xmm3,xmm6             ; transpose coefficients(phase 1)\n        punpcklwd xmm6,xmm7             ; xmm6=(00 10 01 11 02 12 03 13)\n        punpckhwd xmm3,xmm7             ; xmm3=(04 14 05 15 06 16 07 17)\n        movdqa    xmm0,xmm5             ; transpose coefficients(phase 1)\n        punpcklwd xmm5,xmm1             ; xmm5=(60 70 61 71 62 72 63 73)\n        punpckhwd xmm0,xmm1             ; xmm0=(64 74 65 75 66 76 67 77)\n\n        movdqa  xmm7, XMMWORD [wk(0)]   ; xmm7=tmp2\n        movdqa  xmm1, XMMWORD [wk(1)]   ; xmm1=tmp3\n\n        movdqa  XMMWORD [wk(0)], xmm5   ; wk(0)=(60 70 61 71 62 72 63 73)\n        movdqa  XMMWORD [wk(1)], xmm0   ; wk(1)=(64 74 65 75 66 76 67 77)\n\n        paddw   xmm2,xmm4               ; xmm2=tmp4\n        movdqa  xmm5,xmm7\n        movdqa  xmm0,xmm1\n        paddw   xmm7,xmm4               ; xmm7=data2=(20 21 22 23 24 25 26 27)\n        paddw   xmm1,xmm2               ; xmm1=data4=(40 41 42 43 44 45 46 47)\n        psubw   xmm5,xmm4               ; xmm5=data5=(50 51 52 53 54 55 56 57)\n        psubw   xmm0,xmm2               ; xmm0=data3=(30 31 32 33 34 35 36 37)\n\n        movdqa    xmm4,xmm7             ; transpose coefficients(phase 1)\n        punpcklwd xmm7,xmm0             ; xmm7=(20 30 21 31 22 32 23 33)\n        punpckhwd xmm4,xmm0             ; xmm4=(24 34 25 35 26 36 27 37)\n        movdqa    xmm2,xmm1             ; transpose coefficients(phase 1)\n        punpcklwd xmm1,xmm5             ; xmm1=(40 50 41 51 42 52 43 53)\n        punpckhwd xmm2,xmm5             ; xmm2=(44 54 45 55 46 56 47 57)\n\n        movdqa    xmm0,xmm3             ; transpose coefficients(phase 2)\n        punpckldq xmm3,xmm4             ; xmm3=(04 14 24 34 05 15 25 35)\n        punpckhdq xmm0,xmm4             ; xmm0=(06 16 26 36 07 17 27 37)\n        movdqa    xmm5,xmm6             ; transpose coefficients(phase 2)\n        punpckldq xmm6,xmm7             ; xmm6=(00 10 20 30 01 11 21 31)\n        punpckhdq xmm5,xmm7             ; xmm5=(02 12 22 32 03 13 23 33)\n\n        movdqa  xmm4, XMMWORD [wk(0)]   ; xmm4=(60 70 61 71 62 72 63 73)\n        movdqa  xmm7, XMMWORD [wk(1)]   ; xmm7=(64 74 65 75 66 76 67 77)\n\n        movdqa  XMMWORD [wk(0)], xmm3   ; wk(0)=(04 14 24 34 05 15 25 35)\n        movdqa  XMMWORD [wk(1)], xmm0   ; wk(1)=(06 16 26 36 07 17 27 37)\n\n        movdqa    xmm3,xmm1             ; transpose coefficients(phase 2)\n        punpckldq xmm1,xmm4             ; xmm1=(40 50 60 70 41 51 61 71)\n        punpckhdq xmm3,xmm4             ; xmm3=(42 52 62 72 43 53 63 73)\n        movdqa    xmm0,xmm2             ; transpose coefficients(phase 2)\n        punpckldq xmm2,xmm7             ; xmm2=(44 54 64 74 45 55 65 75)\n        punpckhdq xmm0,xmm7             ; xmm0=(46 56 66 76 47 57 67 77)\n\n        movdqa     xmm4,xmm6            ; transpose coefficients(phase 3)\n        punpcklqdq xmm6,xmm1            ; xmm6=col0=(00 10 20 30 40 50 60 70)\n        punpckhqdq xmm4,xmm1            ; xmm4=col1=(01 11 21 31 41 51 61 71)\n        movdqa     xmm7,xmm5            ; transpose coefficients(phase 3)\n        punpcklqdq xmm5,xmm3            ; xmm5=col2=(02 12 22 32 42 52 62 72)\n        punpckhqdq xmm7,xmm3            ; xmm7=col3=(03 13 23 33 43 53 63 73)\n\n        movdqa  xmm1, XMMWORD [wk(0)]   ; xmm1=(04 14 24 34 05 15 25 35)\n        movdqa  xmm3, XMMWORD [wk(1)]   ; xmm3=(06 16 26 36 07 17 27 37)\n\n        movdqa  XMMWORD [wk(0)], xmm4   ; wk(0)=col1\n        movdqa  XMMWORD [wk(1)], xmm7   ; wk(1)=col3\n\n        movdqa     xmm4,xmm1            ; transpose coefficients(phase 3)\n        punpcklqdq xmm1,xmm2            ; xmm1=col4=(04 14 24 34 44 54 64 74)\n        punpckhqdq xmm4,xmm2            ; xmm4=col5=(05 15 25 35 45 55 65 75)\n        movdqa     xmm7,xmm3            ; transpose coefficients(phase 3)\n        punpcklqdq xmm3,xmm0            ; xmm3=col6=(06 16 26 36 46 56 66 76)\n        punpckhqdq xmm7,xmm0            ; xmm7=col7=(07 17 27 37 47 57 67 77)\n.column_end:\n\n        ; -- Prefetch the next coefficient block\n\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n        ; ---- Pass 2: process rows from work array, store into output array.\n\n        mov     eax, [original_ebp]\n        mov     edi, JSAMPARRAY [output_buf(eax)]       ; (JSAMPROW *)\n        mov     eax, JDIMENSION [output_col(eax)]\n\n        ; -- Even part\n\n        ; xmm6=col0, xmm5=col2, xmm1=col4, xmm3=col6\n\n        movdqa  xmm2,xmm6\n        movdqa  xmm0,xmm5\n        psubw   xmm6,xmm1               ; xmm6=tmp11\n        psubw   xmm5,xmm3\n        paddw   xmm2,xmm1               ; xmm2=tmp10\n        paddw   xmm0,xmm3               ; xmm0=tmp13\n\n        psllw   xmm5,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm5,[GOTOFF(ebx,PW_F1414)]\n        psubw   xmm5,xmm0               ; xmm5=tmp12\n\n        movdqa  xmm1,xmm2\n        movdqa  xmm3,xmm6\n        psubw   xmm2,xmm0               ; xmm2=tmp3\n        psubw   xmm6,xmm5               ; xmm6=tmp2\n        paddw   xmm1,xmm0               ; xmm1=tmp0\n        paddw   xmm3,xmm5               ; xmm3=tmp1\n\n        movdqa  xmm0, XMMWORD [wk(0)]   ; xmm0=col1\n        movdqa  xmm5, XMMWORD [wk(1)]   ; xmm5=col3\n\n        movdqa  XMMWORD [wk(0)], xmm2   ; wk(0)=tmp3\n        movdqa  XMMWORD [wk(1)], xmm6   ; wk(1)=tmp2\n\n        ; -- Odd part\n\n        ; xmm0=col1, xmm5=col3, xmm4=col5, xmm7=col7\n\n        movdqa  xmm2,xmm0\n        movdqa  xmm6,xmm4\n        psubw   xmm0,xmm7               ; xmm0=z12\n        psubw   xmm4,xmm5               ; xmm4=z10\n        paddw   xmm2,xmm7               ; xmm2=z11\n        paddw   xmm6,xmm5               ; xmm6=z13\n\n        movdqa  xmm7,xmm4               ; xmm7=z10(unscaled)\n        psllw   xmm0,PRE_MULTIPLY_SCALE_BITS\n        psllw   xmm4,PRE_MULTIPLY_SCALE_BITS\n\n        movdqa  xmm5,xmm2\n        psubw   xmm2,xmm6\n        paddw   xmm5,xmm6               ; xmm5=tmp7\n\n        psllw   xmm2,PRE_MULTIPLY_SCALE_BITS\n        pmulhw  xmm2,[GOTOFF(ebx,PW_F1414)]     ; xmm2=tmp11\n\n        ; To avoid overflow...\n        ;\n        ; (Original)\n        ; tmp12 = -2.613125930 * z10 + z5;\n        ;\n        ; (This implementation)\n        ; tmp12 = (-1.613125930 - 1) * z10 + z5;\n        ;       = -1.613125930 * z10 - z10 + z5;\n\n        movdqa  xmm6,xmm4\n        paddw   xmm4,xmm0\n        pmulhw  xmm4,[GOTOFF(ebx,PW_F1847)]     ; xmm4=z5\n        pmulhw  xmm6,[GOTOFF(ebx,PW_MF1613)]\n        pmulhw  xmm0,[GOTOFF(ebx,PW_F1082)]\n        psubw   xmm6,xmm7\n        psubw   xmm0,xmm4               ; xmm0=tmp10\n        paddw   xmm6,xmm4               ; xmm6=tmp12\n\n        ; -- Final output stage\n\n        psubw   xmm6,xmm5               ; xmm6=tmp6\n        movdqa  xmm7,xmm1\n        movdqa  xmm4,xmm3\n        paddw   xmm1,xmm5               ; xmm1=data0=(00 10 20 30 40 50 60 70)\n        paddw   xmm3,xmm6               ; xmm3=data1=(01 11 21 31 41 51 61 71)\n        psraw   xmm1,(PASS1_BITS+3)     ; descale\n        psraw   xmm3,(PASS1_BITS+3)     ; descale\n        psubw   xmm7,xmm5               ; xmm7=data7=(07 17 27 37 47 57 67 77)\n        psubw   xmm4,xmm6               ; xmm4=data6=(06 16 26 36 46 56 66 76)\n        psraw   xmm7,(PASS1_BITS+3)     ; descale\n        psraw   xmm4,(PASS1_BITS+3)     ; descale\n        psubw   xmm2,xmm6               ; xmm2=tmp5\n\n        packsswb  xmm1,xmm4     ; xmm1=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n        packsswb  xmm3,xmm7     ; xmm3=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n        movdqa  xmm5, XMMWORD [wk(1)]   ; xmm5=tmp2\n        movdqa  xmm6, XMMWORD [wk(0)]   ; xmm6=tmp3\n\n        paddw   xmm0,xmm2               ; xmm0=tmp4\n        movdqa  xmm4,xmm5\n        movdqa  xmm7,xmm6\n        paddw   xmm5,xmm2               ; xmm5=data2=(02 12 22 32 42 52 62 72)\n        paddw   xmm6,xmm0               ; xmm6=data4=(04 14 24 34 44 54 64 74)\n        psraw   xmm5,(PASS1_BITS+3)     ; descale\n        psraw   xmm6,(PASS1_BITS+3)     ; descale\n        psubw   xmm4,xmm2               ; xmm4=data5=(05 15 25 35 45 55 65 75)\n        psubw   xmm7,xmm0               ; xmm7=data3=(03 13 23 33 43 53 63 73)\n        psraw   xmm4,(PASS1_BITS+3)     ; descale\n        psraw   xmm7,(PASS1_BITS+3)     ; descale\n\n        movdqa    xmm2,[GOTOFF(ebx,PB_CENTERJSAMP)]     ; xmm2=[PB_CENTERJSAMP]\n\n        packsswb  xmm5,xmm6     ; xmm5=(02 12 22 32 42 52 62 72 04 14 24 34 44 54 64 74)\n        packsswb  xmm7,xmm4     ; xmm7=(03 13 23 33 43 53 63 73 05 15 25 35 45 55 65 75)\n\n        paddb     xmm1,xmm2\n        paddb     xmm3,xmm2\n        paddb     xmm5,xmm2\n        paddb     xmm7,xmm2\n\n        movdqa    xmm0,xmm1     ; transpose coefficients(phase 1)\n        punpcklbw xmm1,xmm3     ; xmm1=(00 01 10 11 20 21 30 31 40 41 50 51 60 61 70 71)\n        punpckhbw xmm0,xmm3     ; xmm0=(06 07 16 17 26 27 36 37 46 47 56 57 66 67 76 77)\n        movdqa    xmm6,xmm5     ; transpose coefficients(phase 1)\n        punpcklbw xmm5,xmm7     ; xmm5=(02 03 12 13 22 23 32 33 42 43 52 53 62 63 72 73)\n        punpckhbw xmm6,xmm7     ; xmm6=(04 05 14 15 24 25 34 35 44 45 54 55 64 65 74 75)\n\n        movdqa    xmm4,xmm1     ; transpose coefficients(phase 2)\n        punpcklwd xmm1,xmm5     ; xmm1=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33)\n        punpckhwd xmm4,xmm5     ; xmm4=(40 41 42 43 50 51 52 53 60 61 62 63 70 71 72 73)\n        movdqa    xmm2,xmm6     ; transpose coefficients(phase 2)\n        punpcklwd xmm6,xmm0     ; xmm6=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37)\n        punpckhwd xmm2,xmm0     ; xmm2=(44 45 46 47 54 55 56 57 64 65 66 67 74 75 76 77)\n\n        movdqa    xmm3,xmm1     ; transpose coefficients(phase 3)\n        punpckldq xmm1,xmm6     ; xmm1=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17)\n        punpckhdq xmm3,xmm6     ; xmm3=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37)\n        movdqa    xmm7,xmm4     ; transpose coefficients(phase 3)\n        punpckldq xmm4,xmm2     ; xmm4=(40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57)\n        punpckhdq xmm7,xmm2     ; xmm7=(60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77)\n\n        pshufd  xmm5,xmm1,0x4E  ; xmm5=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07)\n        pshufd  xmm0,xmm3,0x4E  ; xmm0=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27)\n        pshufd  xmm6,xmm4,0x4E  ; xmm6=(50 51 52 53 54 55 56 57 40 41 42 43 44 45 46 47)\n        pshufd  xmm2,xmm7,0x4E  ; xmm2=(70 71 72 73 74 75 76 77 60 61 62 63 64 65 66 67)\n\n        mov     edx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n        mov     esi, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm1\n        movq    XMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm3\n        mov     edx, JSAMPROW [edi+4*SIZEOF_JSAMPROW]\n        mov     esi, JSAMPROW [edi+6*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm4\n        movq    XMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm7\n\n        mov     edx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n        mov     esi, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm5\n        movq    XMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm0\n        mov     edx, JSAMPROW [edi+5*SIZEOF_JSAMPROW]\n        mov     esi, JSAMPROW [edi+7*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm6\n        movq    XMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm2\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; unused\n        poppic  ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jidctint-altivec.c",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2014-2015, D. R. Commander.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n/* SLOW INTEGER INVERSE DCT */\n\n#include \"jsimd_altivec.h\"\n\n\n#define F_0_298 2446   /* FIX(0.298631336) */\n#define F_0_390 3196   /* FIX(0.390180644) */\n#define F_0_541 4433   /* FIX(0.541196100) */\n#define F_0_765 6270   /* FIX(0.765366865) */\n#define F_0_899 7373   /* FIX(0.899976223) */\n#define F_1_175 9633   /* FIX(1.175875602) */\n#define F_1_501 12299  /* FIX(1.501321110) */\n#define F_1_847 15137  /* FIX(1.847759065) */\n#define F_1_961 16069  /* FIX(1.961570560) */\n#define F_2_053 16819  /* FIX(2.053119869) */\n#define F_2_562 20995  /* FIX(2.562915447) */\n#define F_3_072 25172  /* FIX(3.072711026) */\n\n#define CONST_BITS 13\n#define PASS1_BITS 2\n#define DESCALE_P1 (CONST_BITS - PASS1_BITS)\n#define DESCALE_P2 (CONST_BITS + PASS1_BITS + 3)\n\n\n#define DO_IDCT(in, PASS)  \\\n{  \\\n  /* Even part  \\\n   *  \\\n   * (Original)  \\\n   * z1 = (z2 + z3) * 0.541196100;  \\\n   * tmp2 = z1 + z3 * -1.847759065;  \\\n   * tmp3 = z1 + z2 * 0.765366865;  \\\n   *  \\\n   * (This implementation)  \\\n   * tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065);  \\\n   * tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100;  \\\n   */  \\\n  \\\n  in##26l = vec_mergeh(in##2, in##6);  \\\n  in##26h = vec_mergel(in##2, in##6);  \\\n  \\\n  tmp3l = vec_msums(in##26l, pw_f130_f054, pd_zero);  \\\n  tmp3h = vec_msums(in##26h, pw_f130_f054, pd_zero);  \\\n  tmp2l = vec_msums(in##26l, pw_f054_mf130, pd_zero);  \\\n  tmp2h = vec_msums(in##26h, pw_f054_mf130, pd_zero);  \\\n  \\\n  tmp0 = vec_add(in##0, in##4);  \\\n  tmp1 = vec_sub(in##0, in##4);  \\\n  \\\n  tmp0l = vec_unpackh(tmp0);  \\\n  tmp0h = vec_unpackl(tmp0);  \\\n  tmp0l = vec_sl(tmp0l, const_bits);  \\\n  tmp0h = vec_sl(tmp0h, const_bits);  \\\n  tmp0l = vec_add(tmp0l, pd_descale_p##PASS);  \\\n  tmp0h = vec_add(tmp0h, pd_descale_p##PASS);  \\\n  \\\n  tmp10l = vec_add(tmp0l, tmp3l);  \\\n  tmp10h = vec_add(tmp0h, tmp3h);  \\\n  tmp13l = vec_sub(tmp0l, tmp3l);  \\\n  tmp13h = vec_sub(tmp0h, tmp3h);  \\\n  \\\n  tmp1l = vec_unpackh(tmp1);  \\\n  tmp1h = vec_unpackl(tmp1);  \\\n  tmp1l = vec_sl(tmp1l, const_bits);  \\\n  tmp1h = vec_sl(tmp1h, const_bits);  \\\n  tmp1l = vec_add(tmp1l, pd_descale_p##PASS);  \\\n  tmp1h = vec_add(tmp1h, pd_descale_p##PASS);  \\\n  \\\n  tmp11l = vec_add(tmp1l, tmp2l);  \\\n  tmp11h = vec_add(tmp1h, tmp2h);  \\\n  tmp12l = vec_sub(tmp1l, tmp2l);  \\\n  tmp12h = vec_sub(tmp1h, tmp2h);  \\\n  \\\n  /* Odd part */  \\\n  \\\n  z3 = vec_add(in##3, in##7);  \\\n  z4 = vec_add(in##1, in##5);  \\\n  \\\n  /* (Original)  \\\n   * z5 = (z3 + z4) * 1.175875602;  \\\n   * z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;  \\\n   * z3 += z5;  z4 += z5;  \\\n   *  \\\n   * (This implementation)  \\\n   * z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;  \\\n   * z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);  \\\n   */  \\\n  \\\n  z34l = vec_mergeh(z3, z4);  \\\n  z34h = vec_mergel(z3, z4);  \\\n  \\\n  z3l = vec_msums(z34l, pw_mf078_f117, pd_zero);  \\\n  z3h = vec_msums(z34h, pw_mf078_f117, pd_zero);  \\\n  z4l = vec_msums(z34l, pw_f117_f078, pd_zero);  \\\n  z4h = vec_msums(z34h, pw_f117_f078, pd_zero);  \\\n  \\\n  /* (Original)  \\\n   * z1 = tmp0 + tmp3;  z2 = tmp1 + tmp2;  \\\n   * tmp0 = tmp0 * 0.298631336;  tmp1 = tmp1 * 2.053119869;  \\\n   * tmp2 = tmp2 * 3.072711026;  tmp3 = tmp3 * 1.501321110;  \\\n   * z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;  \\\n   * tmp0 += z1 + z3;  tmp1 += z2 + z4;  \\\n   * tmp2 += z2 + z3;  tmp3 += z1 + z4;  \\\n   *  \\\n   * (This implementation)  \\\n   * tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223;  \\\n   * tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447;  \\\n   * tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447);  \\\n   * tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223);  \\\n   * tmp0 += z3;  tmp1 += z4;  \\\n   * tmp2 += z3;  tmp3 += z4;  \\\n   */  \\\n  \\\n  in##71l = vec_mergeh(in##7, in##1);  \\\n  in##71h = vec_mergel(in##7, in##1);  \\\n  \\\n  tmp0l = vec_msums(in##71l, pw_mf060_mf089, z3l);  \\\n  tmp0h = vec_msums(in##71h, pw_mf060_mf089, z3h);  \\\n  tmp3l = vec_msums(in##71l, pw_mf089_f060, z4l);  \\\n  tmp3h = vec_msums(in##71h, pw_mf089_f060, z4h);  \\\n  \\\n  in##53l = vec_mergeh(in##5, in##3);  \\\n  in##53h = vec_mergel(in##5, in##3);  \\\n  \\\n  tmp1l = vec_msums(in##53l, pw_mf050_mf256, z4l);  \\\n  tmp1h = vec_msums(in##53h, pw_mf050_mf256, z4h);  \\\n  tmp2l = vec_msums(in##53l, pw_mf256_f050, z3l);  \\\n  tmp2h = vec_msums(in##53h, pw_mf256_f050, z3h);  \\\n  \\\n  /* Final output stage */  \\\n  \\\n  out0l = vec_add(tmp10l, tmp3l);  \\\n  out0h = vec_add(tmp10h, tmp3h);  \\\n  out7l = vec_sub(tmp10l, tmp3l);  \\\n  out7h = vec_sub(tmp10h, tmp3h);  \\\n  \\\n  out0l = vec_sra(out0l, descale_p##PASS);  \\\n  out0h = vec_sra(out0h, descale_p##PASS);  \\\n  out7l = vec_sra(out7l, descale_p##PASS);  \\\n  out7h = vec_sra(out7h, descale_p##PASS);  \\\n  \\\n  out0 = vec_pack(out0l, out0h);  \\\n  out7 = vec_pack(out7l, out7h);  \\\n  \\\n  out1l = vec_add(tmp11l, tmp2l);  \\\n  out1h = vec_add(tmp11h, tmp2h);  \\\n  out6l = vec_sub(tmp11l, tmp2l);  \\\n  out6h = vec_sub(tmp11h, tmp2h);  \\\n  \\\n  out1l = vec_sra(out1l, descale_p##PASS);  \\\n  out1h = vec_sra(out1h, descale_p##PASS);  \\\n  out6l = vec_sra(out6l, descale_p##PASS);  \\\n  out6h = vec_sra(out6h, descale_p##PASS);  \\\n  \\\n  out1 = vec_pack(out1l, out1h);  \\\n  out6 = vec_pack(out6l, out6h);  \\\n  \\\n  out2l = vec_add(tmp12l, tmp1l);  \\\n  out2h = vec_add(tmp12h, tmp1h);  \\\n  out5l = vec_sub(tmp12l, tmp1l);  \\\n  out5h = vec_sub(tmp12h, tmp1h);  \\\n  \\\n  out2l = vec_sra(out2l, descale_p##PASS);  \\\n  out2h = vec_sra(out2h, descale_p##PASS);  \\\n  out5l = vec_sra(out5l, descale_p##PASS);  \\\n  out5h = vec_sra(out5h, descale_p##PASS);  \\\n  \\\n  out2 = vec_pack(out2l, out2h);  \\\n  out5 = vec_pack(out5l, out5h);  \\\n  \\\n  out3l = vec_add(tmp13l, tmp0l);  \\\n  out3h = vec_add(tmp13h, tmp0h);  \\\n  out4l = vec_sub(tmp13l, tmp0l);  \\\n  out4h = vec_sub(tmp13h, tmp0h);  \\\n  \\\n  out3l = vec_sra(out3l, descale_p##PASS);  \\\n  out3h = vec_sra(out3h, descale_p##PASS);  \\\n  out4l = vec_sra(out4l, descale_p##PASS);  \\\n  out4h = vec_sra(out4h, descale_p##PASS);  \\\n  \\\n  out3 = vec_pack(out3l, out3h);  \\\n  out4 = vec_pack(out4l, out4h);  \\\n}\n\n\nvoid\njsimd_idct_islow_altivec (void *dct_table_, JCOEFPTR coef_block,\n                          JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  short *dct_table = (short *)dct_table_;\n  int *outptr;\n\n  __vector short row0, row1, row2, row3, row4, row5, row6, row7,\n    col0, col1, col2, col3, col4, col5, col6, col7,\n    quant0, quant1, quant2, quant3, quant4, quant5, quant6, quant7,\n    tmp0, tmp1, tmp2, tmp3, z3, z4,\n    z34l, z34h, col71l, col71h, col26l, col26h, col53l, col53h,\n    row71l, row71h, row26l, row26h, row53l, row53h,\n    out0, out1, out2, out3, out4, out5, out6, out7;\n  __vector int tmp0l, tmp0h, tmp1l, tmp1h, tmp2l, tmp2h, tmp3l, tmp3h,\n    tmp10l, tmp10h, tmp11l, tmp11h, tmp12l, tmp12h, tmp13l, tmp13h,\n    z3l, z3h, z4l, z4h,\n    out0l, out0h, out1l, out1h, out2l, out2h, out3l, out3h, out4l, out4h,\n    out5l, out5h, out6l, out6h, out7l, out7h;\n  __vector signed char outb;\n\n  /* Constants */\n  __vector short pw_zero = { __8X(0) },\n    pw_f130_f054 = { __4X2(F_0_541 + F_0_765, F_0_541) },\n    pw_f054_mf130 = { __4X2(F_0_541, F_0_541 - F_1_847) },\n    pw_mf078_f117 = { __4X2(F_1_175 - F_1_961, F_1_175) },\n    pw_f117_f078 = { __4X2(F_1_175, F_1_175 - F_0_390) },\n    pw_mf060_mf089 = { __4X2(F_0_298 - F_0_899, -F_0_899) },\n    pw_mf089_f060 = { __4X2(-F_0_899, F_1_501 - F_0_899) },\n    pw_mf050_mf256 = { __4X2(F_2_053 - F_2_562, -F_2_562) },\n    pw_mf256_f050 = { __4X2(-F_2_562, F_3_072 - F_2_562) };\n  __vector unsigned short pass1_bits = { __8X(PASS1_BITS) };\n  __vector int pd_zero = { __4X(0) },\n    pd_descale_p1 = { __4X(1 << (DESCALE_P1 - 1)) },\n    pd_descale_p2 = { __4X(1 << (DESCALE_P2 - 1)) };\n  __vector unsigned int descale_p1 = { __4X(DESCALE_P1) },\n    descale_p2 = { __4X(DESCALE_P2) },\n    const_bits = { __4X(CONST_BITS) };\n  __vector signed char pb_centerjsamp = { __16X(CENTERJSAMPLE) };\n\n  /* Pass 1: process columns */\n\n  col0 = vec_ld(0, coef_block);\n  col1 = vec_ld(16, coef_block);\n  col2 = vec_ld(32, coef_block);\n  col3 = vec_ld(48, coef_block);\n  col4 = vec_ld(64, coef_block);\n  col5 = vec_ld(80, coef_block);\n  col6 = vec_ld(96, coef_block);\n  col7 = vec_ld(112, coef_block);\n\n  tmp1 = vec_or(col1, col2);\n  tmp2 = vec_or(col3, col4);\n  tmp1 = vec_or(tmp1, tmp2);\n  tmp3 = vec_or(col5, col6);\n  tmp3 = vec_or(tmp3, col7);\n  tmp1 = vec_or(tmp1, tmp3);\n\n  quant0 = vec_ld(0, dct_table);\n  col0 = vec_mladd(col0, quant0, pw_zero);\n\n  if (vec_all_eq(tmp1, pw_zero)) {\n    /* AC terms all zero */\n\n    col0 = vec_sl(col0, pass1_bits);\n\n    row0 = vec_splat(col0, 0);\n    row1 = vec_splat(col0, 1);\n    row2 = vec_splat(col0, 2);\n    row3 = vec_splat(col0, 3);\n    row4 = vec_splat(col0, 4);\n    row5 = vec_splat(col0, 5);\n    row6 = vec_splat(col0, 6);\n    row7 = vec_splat(col0, 7);\n\n  } else {\n\n    quant1 = vec_ld(16, dct_table);\n    quant2 = vec_ld(32, dct_table);\n    quant3 = vec_ld(48, dct_table);\n    quant4 = vec_ld(64, dct_table);\n    quant5 = vec_ld(80, dct_table);\n    quant6 = vec_ld(96, dct_table);\n    quant7 = vec_ld(112, dct_table);\n\n    col1 = vec_mladd(col1, quant1, pw_zero);\n    col2 = vec_mladd(col2, quant2, pw_zero);\n    col3 = vec_mladd(col3, quant3, pw_zero);\n    col4 = vec_mladd(col4, quant4, pw_zero);\n    col5 = vec_mladd(col5, quant5, pw_zero);\n    col6 = vec_mladd(col6, quant6, pw_zero);\n    col7 = vec_mladd(col7, quant7, pw_zero);\n\n    DO_IDCT(col, 1);\n\n    TRANSPOSE(out, row);\n  }\n\n  /* Pass 2: process rows */\n\n  DO_IDCT(row, 2);\n\n  TRANSPOSE(out, col);\n\n  outb = vec_packs(col0, col0);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[0] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n\n  outb = vec_packs(col1, col1);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[1] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n\n  outb = vec_packs(col2, col2);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[2] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n\n  outb = vec_packs(col3, col3);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[3] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n\n  outb = vec_packs(col4, col4);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[4] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n\n  outb = vec_packs(col5, col5);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[5] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n\n  outb = vec_packs(col6, col6);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[6] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n\n  outb = vec_packs(col7, col7);\n  outb = vec_add(outb, pb_centerjsamp);\n  outptr = (int *)(output_buf[7] + output_col);\n  vec_ste((__vector int)outb, 0, outptr);\n  vec_ste((__vector int)outb, 4, outptr);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jidctint-mmx.asm",
    "content": ";\n; jidctint.asm - accurate integer IDCT (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a slow-but-accurate integer implementation of the\n; inverse DCT (Discrete Cosine Transform). The following code is based\n; directly on the IJG's original jidctint.c; see the jidctint.c for\n; more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS      13\n%define PASS1_BITS      2\n\n%define DESCALE_P1      (CONST_BITS-PASS1_BITS)\n%define DESCALE_P2      (CONST_BITS+PASS1_BITS+3)\n\n%if CONST_BITS == 13\nF_0_298 equ      2446           ; FIX(0.298631336)\nF_0_390 equ      3196           ; FIX(0.390180644)\nF_0_541 equ      4433           ; FIX(0.541196100)\nF_0_765 equ      6270           ; FIX(0.765366865)\nF_0_899 equ      7373           ; FIX(0.899976223)\nF_1_175 equ      9633           ; FIX(1.175875602)\nF_1_501 equ     12299           ; FIX(1.501321110)\nF_1_847 equ     15137           ; FIX(1.847759065)\nF_1_961 equ     16069           ; FIX(1.961570560)\nF_2_053 equ     16819           ; FIX(2.053119869)\nF_2_562 equ     20995           ; FIX(2.562915447)\nF_3_072 equ     25172           ; FIX(3.072711026)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_298 equ     DESCALE( 320652955,30-CONST_BITS)       ; FIX(0.298631336)\nF_0_390 equ     DESCALE( 418953276,30-CONST_BITS)       ; FIX(0.390180644)\nF_0_541 equ     DESCALE( 581104887,30-CONST_BITS)       ; FIX(0.541196100)\nF_0_765 equ     DESCALE( 821806413,30-CONST_BITS)       ; FIX(0.765366865)\nF_0_899 equ     DESCALE( 966342111,30-CONST_BITS)       ; FIX(0.899976223)\nF_1_175 equ     DESCALE(1262586813,30-CONST_BITS)       ; FIX(1.175875602)\nF_1_501 equ     DESCALE(1612031267,30-CONST_BITS)       ; FIX(1.501321110)\nF_1_847 equ     DESCALE(1984016188,30-CONST_BITS)       ; FIX(1.847759065)\nF_1_961 equ     DESCALE(2106220350,30-CONST_BITS)       ; FIX(1.961570560)\nF_2_053 equ     DESCALE(2204520673,30-CONST_BITS)       ; FIX(2.053119869)\nF_2_562 equ     DESCALE(2751909506,30-CONST_BITS)       ; FIX(2.562915447)\nF_3_072 equ     DESCALE(3299298341,30-CONST_BITS)       ; FIX(3.072711026)\n%endif\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_idct_islow_mmx)\n\nEXTN(jconst_idct_islow_mmx):\n\nPW_F130_F054    times 2 dw  (F_0_541+F_0_765), F_0_541\nPW_F054_MF130   times 2 dw  F_0_541, (F_0_541-F_1_847)\nPW_MF078_F117   times 2 dw  (F_1_175-F_1_961), F_1_175\nPW_F117_F078    times 2 dw  F_1_175, (F_1_175-F_0_390)\nPW_MF060_MF089  times 2 dw  (F_0_298-F_0_899),-F_0_899\nPW_MF089_F060   times 2 dw -F_0_899, (F_1_501-F_0_899)\nPW_MF050_MF256  times 2 dw  (F_2_053-F_2_562),-F_2_562\nPW_MF256_F050   times 2 dw -F_2_562, (F_3_072-F_2_562)\nPD_DESCALE_P1   times 2 dd  1 << (DESCALE_P1-1)\nPD_DESCALE_P2   times 2 dd  1 << (DESCALE_P2-1)\nPB_CENTERJSAMP  times 8 db  CENTERJSAMPLE\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_islow_mmx (void *dct_table, JCOEFPTR coef_block,\n;                       JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)    (b)+8           ; jpeg_component_info *compptr\n%define coef_block(b)   (b)+12          ; JCOEFPTR coef_block\n%define output_buf(b)   (b)+16          ; JSAMPARRAY output_buf\n%define output_col(b)   (b)+20          ; JDIMENSION output_col\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_MMWORD  ; mmword wk[WK_NUM]\n%define WK_NUM          12\n%define workspace       wk(0)-DCTSIZE2*SIZEOF_JCOEF\n                                        ; JCOEF workspace[DCTSIZE2]\n\n        align   16\n        global  EXTN(jsimd_idct_islow_mmx)\n\nEXTN(jsimd_idct_islow_mmx):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_MMWORD)      ; align to 64 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [workspace]\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process columns from input, store into work array.\n\n;       mov     eax, [original_ebp]\n        mov     edx, POINTER [dct_table(eax)]           ; quantptr\n        mov     esi, JCOEFPTR [coef_block(eax)]         ; inptr\n        lea     edi, [workspace]                        ; JCOEF *wsptr\n        mov     ecx, DCTSIZE/4                          ; ctr\n        alignx  16,7\n.columnloop:\n%ifndef NO_ZERO_COLUMN_TEST_ISLOW_MMX\n        mov     eax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        or      eax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        jnz     short .columnDCT\n\n        movq    mm0, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movq    mm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        por     mm0, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        por     mm1, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        por     mm0, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        por     mm1, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n        por     mm0, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        por     mm1,mm0\n        packsswb mm1,mm1\n        movd    eax,mm1\n        test    eax,eax\n        jnz     short .columnDCT\n\n        ; -- AC terms all zero\n\n        movq    mm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        psllw   mm0,PASS1_BITS\n\n        movq      mm2,mm0               ; mm0=in0=(00 01 02 03)\n        punpcklwd mm0,mm0               ; mm0=(00 00 01 01)\n        punpckhwd mm2,mm2               ; mm2=(02 02 03 03)\n\n        movq      mm1,mm0\n        punpckldq mm0,mm0               ; mm0=(00 00 00 00)\n        punpckhdq mm1,mm1               ; mm1=(01 01 01 01)\n        movq      mm3,mm2\n        punpckldq mm2,mm2               ; mm2=(02 02 02 02)\n        punpckhdq mm3,mm3               ; mm3=(03 03 03 03)\n\n        movq    MMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm0\n        movq    MMWORD [MMBLOCK(0,1,edi,SIZEOF_JCOEF)], mm0\n        movq    MMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm1\n        movq    MMWORD [MMBLOCK(1,1,edi,SIZEOF_JCOEF)], mm1\n        movq    MMWORD [MMBLOCK(2,0,edi,SIZEOF_JCOEF)], mm2\n        movq    MMWORD [MMBLOCK(2,1,edi,SIZEOF_JCOEF)], mm2\n        movq    MMWORD [MMBLOCK(3,0,edi,SIZEOF_JCOEF)], mm3\n        movq    MMWORD [MMBLOCK(3,1,edi,SIZEOF_JCOEF)], mm3\n        jmp     near .nextcolumn\n        alignx  16,7\n%endif\n.columnDCT:\n\n        ; -- Even part\n\n        movq    mm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        movq    mm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  mm1, MMWORD [MMBLOCK(2,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        movq    mm2, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        movq    mm3, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm2, MMWORD [MMBLOCK(4,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  mm3, MMWORD [MMBLOCK(6,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        ; (Original)\n        ; z1 = (z2 + z3) * 0.541196100;\n        ; tmp2 = z1 + z3 * -1.847759065;\n        ; tmp3 = z1 + z2 * 0.765366865;\n        ;\n        ; (This implementation)\n        ; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065);\n        ; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100;\n\n        movq      mm4,mm1               ; mm1=in2=z2\n        movq      mm5,mm1\n        punpcklwd mm4,mm3               ; mm3=in6=z3\n        punpckhwd mm5,mm3\n        movq      mm1,mm4\n        movq      mm3,mm5\n        pmaddwd   mm4,[GOTOFF(ebx,PW_F130_F054)]        ; mm4=tmp3L\n        pmaddwd   mm5,[GOTOFF(ebx,PW_F130_F054)]        ; mm5=tmp3H\n        pmaddwd   mm1,[GOTOFF(ebx,PW_F054_MF130)]       ; mm1=tmp2L\n        pmaddwd   mm3,[GOTOFF(ebx,PW_F054_MF130)]       ; mm3=tmp2H\n\n        movq      mm6,mm0\n        paddw     mm0,mm2               ; mm0=in0+in4\n        psubw     mm6,mm2               ; mm6=in0-in4\n\n        pxor      mm7,mm7\n        pxor      mm2,mm2\n        punpcklwd mm7,mm0               ; mm7=tmp0L\n        punpckhwd mm2,mm0               ; mm2=tmp0H\n        psrad     mm7,(16-CONST_BITS)   ; psrad mm7,16 & pslld mm7,CONST_BITS\n        psrad     mm2,(16-CONST_BITS)   ; psrad mm2,16 & pslld mm2,CONST_BITS\n\n        movq    mm0,mm7\n        paddd   mm7,mm4                 ; mm7=tmp10L\n        psubd   mm0,mm4                 ; mm0=tmp13L\n        movq    mm4,mm2\n        paddd   mm2,mm5                 ; mm2=tmp10H\n        psubd   mm4,mm5                 ; mm4=tmp13H\n\n        movq    MMWORD [wk(0)], mm7     ; wk(0)=tmp10L\n        movq    MMWORD [wk(1)], mm2     ; wk(1)=tmp10H\n        movq    MMWORD [wk(2)], mm0     ; wk(2)=tmp13L\n        movq    MMWORD [wk(3)], mm4     ; wk(3)=tmp13H\n\n        pxor      mm5,mm5\n        pxor      mm7,mm7\n        punpcklwd mm5,mm6               ; mm5=tmp1L\n        punpckhwd mm7,mm6               ; mm7=tmp1H\n        psrad     mm5,(16-CONST_BITS)   ; psrad mm5,16 & pslld mm5,CONST_BITS\n        psrad     mm7,(16-CONST_BITS)   ; psrad mm7,16 & pslld mm7,CONST_BITS\n\n        movq    mm2,mm5\n        paddd   mm5,mm1                 ; mm5=tmp11L\n        psubd   mm2,mm1                 ; mm2=tmp12L\n        movq    mm0,mm7\n        paddd   mm7,mm3                 ; mm7=tmp11H\n        psubd   mm0,mm3                 ; mm0=tmp12H\n\n        movq    MMWORD [wk(4)], mm5     ; wk(4)=tmp11L\n        movq    MMWORD [wk(5)], mm7     ; wk(5)=tmp11H\n        movq    MMWORD [wk(6)], mm2     ; wk(6)=tmp12L\n        movq    MMWORD [wk(7)], mm0     ; wk(7)=tmp12H\n\n        ; -- Odd part\n\n        movq    mm4, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movq    mm6, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm4, MMWORD [MMBLOCK(1,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  mm6, MMWORD [MMBLOCK(3,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        movq    mm1, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        movq    mm3, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm1, MMWORD [MMBLOCK(5,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  mm3, MMWORD [MMBLOCK(7,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        movq    mm5,mm6\n        movq    mm7,mm4\n        paddw   mm5,mm3                 ; mm5=z3\n        paddw   mm7,mm1                 ; mm7=z4\n\n        ; (Original)\n        ; z5 = (z3 + z4) * 1.175875602;\n        ; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n        ; z3 += z5;  z4 += z5;\n        ;\n        ; (This implementation)\n        ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n        ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n        movq      mm2,mm5\n        movq      mm0,mm5\n        punpcklwd mm2,mm7\n        punpckhwd mm0,mm7\n        movq      mm5,mm2\n        movq      mm7,mm0\n        pmaddwd   mm2,[GOTOFF(ebx,PW_MF078_F117)]       ; mm2=z3L\n        pmaddwd   mm0,[GOTOFF(ebx,PW_MF078_F117)]       ; mm0=z3H\n        pmaddwd   mm5,[GOTOFF(ebx,PW_F117_F078)]        ; mm5=z4L\n        pmaddwd   mm7,[GOTOFF(ebx,PW_F117_F078)]        ; mm7=z4H\n\n        movq    MMWORD [wk(10)], mm2    ; wk(10)=z3L\n        movq    MMWORD [wk(11)], mm0    ; wk(11)=z3H\n\n        ; (Original)\n        ; z1 = tmp0 + tmp3;  z2 = tmp1 + tmp2;\n        ; tmp0 = tmp0 * 0.298631336;  tmp1 = tmp1 * 2.053119869;\n        ; tmp2 = tmp2 * 3.072711026;  tmp3 = tmp3 * 1.501321110;\n        ; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n        ; tmp0 += z1 + z3;  tmp1 += z2 + z4;\n        ; tmp2 += z2 + z3;  tmp3 += z1 + z4;\n        ;\n        ; (This implementation)\n        ; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223;\n        ; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447;\n        ; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447);\n        ; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223);\n        ; tmp0 += z3;  tmp1 += z4;\n        ; tmp2 += z3;  tmp3 += z4;\n\n        movq      mm2,mm3\n        movq      mm0,mm3\n        punpcklwd mm2,mm4\n        punpckhwd mm0,mm4\n        movq      mm3,mm2\n        movq      mm4,mm0\n        pmaddwd   mm2,[GOTOFF(ebx,PW_MF060_MF089)]      ; mm2=tmp0L\n        pmaddwd   mm0,[GOTOFF(ebx,PW_MF060_MF089)]      ; mm0=tmp0H\n        pmaddwd   mm3,[GOTOFF(ebx,PW_MF089_F060)]       ; mm3=tmp3L\n        pmaddwd   mm4,[GOTOFF(ebx,PW_MF089_F060)]       ; mm4=tmp3H\n\n        paddd   mm2, MMWORD [wk(10)]    ; mm2=tmp0L\n        paddd   mm0, MMWORD [wk(11)]    ; mm0=tmp0H\n        paddd   mm3,mm5                 ; mm3=tmp3L\n        paddd   mm4,mm7                 ; mm4=tmp3H\n\n        movq    MMWORD [wk(8)], mm2     ; wk(8)=tmp0L\n        movq    MMWORD [wk(9)], mm0     ; wk(9)=tmp0H\n\n        movq      mm2,mm1\n        movq      mm0,mm1\n        punpcklwd mm2,mm6\n        punpckhwd mm0,mm6\n        movq      mm1,mm2\n        movq      mm6,mm0\n        pmaddwd   mm2,[GOTOFF(ebx,PW_MF050_MF256)]      ; mm2=tmp1L\n        pmaddwd   mm0,[GOTOFF(ebx,PW_MF050_MF256)]      ; mm0=tmp1H\n        pmaddwd   mm1,[GOTOFF(ebx,PW_MF256_F050)]       ; mm1=tmp2L\n        pmaddwd   mm6,[GOTOFF(ebx,PW_MF256_F050)]       ; mm6=tmp2H\n\n        paddd   mm2,mm5                 ; mm2=tmp1L\n        paddd   mm0,mm7                 ; mm0=tmp1H\n        paddd   mm1, MMWORD [wk(10)]    ; mm1=tmp2L\n        paddd   mm6, MMWORD [wk(11)]    ; mm6=tmp2H\n\n        movq    MMWORD [wk(10)], mm2    ; wk(10)=tmp1L\n        movq    MMWORD [wk(11)], mm0    ; wk(11)=tmp1H\n\n        ; -- Final output stage\n\n        movq    mm5, MMWORD [wk(0)]     ; mm5=tmp10L\n        movq    mm7, MMWORD [wk(1)]     ; mm7=tmp10H\n\n        movq    mm2,mm5\n        movq    mm0,mm7\n        paddd   mm5,mm3                 ; mm5=data0L\n        paddd   mm7,mm4                 ; mm7=data0H\n        psubd   mm2,mm3                 ; mm2=data7L\n        psubd   mm0,mm4                 ; mm0=data7H\n\n        movq    mm3,[GOTOFF(ebx,PD_DESCALE_P1)] ; mm3=[PD_DESCALE_P1]\n\n        paddd   mm5,mm3\n        paddd   mm7,mm3\n        psrad   mm5,DESCALE_P1\n        psrad   mm7,DESCALE_P1\n        paddd   mm2,mm3\n        paddd   mm0,mm3\n        psrad   mm2,DESCALE_P1\n        psrad   mm0,DESCALE_P1\n\n        packssdw  mm5,mm7               ; mm5=data0=(00 01 02 03)\n        packssdw  mm2,mm0               ; mm2=data7=(70 71 72 73)\n\n        movq    mm4, MMWORD [wk(4)]     ; mm4=tmp11L\n        movq    mm3, MMWORD [wk(5)]     ; mm3=tmp11H\n\n        movq    mm7,mm4\n        movq    mm0,mm3\n        paddd   mm4,mm1                 ; mm4=data1L\n        paddd   mm3,mm6                 ; mm3=data1H\n        psubd   mm7,mm1                 ; mm7=data6L\n        psubd   mm0,mm6                 ; mm0=data6H\n\n        movq    mm1,[GOTOFF(ebx,PD_DESCALE_P1)] ; mm1=[PD_DESCALE_P1]\n\n        paddd   mm4,mm1\n        paddd   mm3,mm1\n        psrad   mm4,DESCALE_P1\n        psrad   mm3,DESCALE_P1\n        paddd   mm7,mm1\n        paddd   mm0,mm1\n        psrad   mm7,DESCALE_P1\n        psrad   mm0,DESCALE_P1\n\n        packssdw  mm4,mm3               ; mm4=data1=(10 11 12 13)\n        packssdw  mm7,mm0               ; mm7=data6=(60 61 62 63)\n\n        movq      mm6,mm5               ; transpose coefficients(phase 1)\n        punpcklwd mm5,mm4               ; mm5=(00 10 01 11)\n        punpckhwd mm6,mm4               ; mm6=(02 12 03 13)\n        movq      mm1,mm7               ; transpose coefficients(phase 1)\n        punpcklwd mm7,mm2               ; mm7=(60 70 61 71)\n        punpckhwd mm1,mm2               ; mm1=(62 72 63 73)\n\n        movq    mm3, MMWORD [wk(6)]     ; mm3=tmp12L\n        movq    mm0, MMWORD [wk(7)]     ; mm0=tmp12H\n        movq    mm4, MMWORD [wk(10)]    ; mm4=tmp1L\n        movq    mm2, MMWORD [wk(11)]    ; mm2=tmp1H\n\n        movq    MMWORD [wk(0)], mm5     ; wk(0)=(00 10 01 11)\n        movq    MMWORD [wk(1)], mm6     ; wk(1)=(02 12 03 13)\n        movq    MMWORD [wk(4)], mm7     ; wk(4)=(60 70 61 71)\n        movq    MMWORD [wk(5)], mm1     ; wk(5)=(62 72 63 73)\n\n        movq    mm5,mm3\n        movq    mm6,mm0\n        paddd   mm3,mm4                 ; mm3=data2L\n        paddd   mm0,mm2                 ; mm0=data2H\n        psubd   mm5,mm4                 ; mm5=data5L\n        psubd   mm6,mm2                 ; mm6=data5H\n\n        movq    mm7,[GOTOFF(ebx,PD_DESCALE_P1)] ; mm7=[PD_DESCALE_P1]\n\n        paddd   mm3,mm7\n        paddd   mm0,mm7\n        psrad   mm3,DESCALE_P1\n        psrad   mm0,DESCALE_P1\n        paddd   mm5,mm7\n        paddd   mm6,mm7\n        psrad   mm5,DESCALE_P1\n        psrad   mm6,DESCALE_P1\n\n        packssdw  mm3,mm0               ; mm3=data2=(20 21 22 23)\n        packssdw  mm5,mm6               ; mm5=data5=(50 51 52 53)\n\n        movq    mm1, MMWORD [wk(2)]     ; mm1=tmp13L\n        movq    mm4, MMWORD [wk(3)]     ; mm4=tmp13H\n        movq    mm2, MMWORD [wk(8)]     ; mm2=tmp0L\n        movq    mm7, MMWORD [wk(9)]     ; mm7=tmp0H\n\n        movq    mm0,mm1\n        movq    mm6,mm4\n        paddd   mm1,mm2                 ; mm1=data3L\n        paddd   mm4,mm7                 ; mm4=data3H\n        psubd   mm0,mm2                 ; mm0=data4L\n        psubd   mm6,mm7                 ; mm6=data4H\n\n        movq    mm2,[GOTOFF(ebx,PD_DESCALE_P1)] ; mm2=[PD_DESCALE_P1]\n\n        paddd   mm1,mm2\n        paddd   mm4,mm2\n        psrad   mm1,DESCALE_P1\n        psrad   mm4,DESCALE_P1\n        paddd   mm0,mm2\n        paddd   mm6,mm2\n        psrad   mm0,DESCALE_P1\n        psrad   mm6,DESCALE_P1\n\n        packssdw  mm1,mm4               ; mm1=data3=(30 31 32 33)\n        packssdw  mm0,mm6               ; mm0=data4=(40 41 42 43)\n\n        movq    mm7, MMWORD [wk(0)]     ; mm7=(00 10 01 11)\n        movq    mm2, MMWORD [wk(1)]     ; mm2=(02 12 03 13)\n\n        movq      mm4,mm3               ; transpose coefficients(phase 1)\n        punpcklwd mm3,mm1               ; mm3=(20 30 21 31)\n        punpckhwd mm4,mm1               ; mm4=(22 32 23 33)\n        movq      mm6,mm0               ; transpose coefficients(phase 1)\n        punpcklwd mm0,mm5               ; mm0=(40 50 41 51)\n        punpckhwd mm6,mm5               ; mm6=(42 52 43 53)\n\n        movq      mm1,mm7               ; transpose coefficients(phase 2)\n        punpckldq mm7,mm3               ; mm7=(00 10 20 30)\n        punpckhdq mm1,mm3               ; mm1=(01 11 21 31)\n        movq      mm5,mm2               ; transpose coefficients(phase 2)\n        punpckldq mm2,mm4               ; mm2=(02 12 22 32)\n        punpckhdq mm5,mm4               ; mm5=(03 13 23 33)\n\n        movq    mm3, MMWORD [wk(4)]     ; mm3=(60 70 61 71)\n        movq    mm4, MMWORD [wk(5)]     ; mm4=(62 72 63 73)\n\n        movq    MMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm7\n        movq    MMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm1\n        movq    MMWORD [MMBLOCK(2,0,edi,SIZEOF_JCOEF)], mm2\n        movq    MMWORD [MMBLOCK(3,0,edi,SIZEOF_JCOEF)], mm5\n\n        movq      mm7,mm0               ; transpose coefficients(phase 2)\n        punpckldq mm0,mm3               ; mm0=(40 50 60 70)\n        punpckhdq mm7,mm3               ; mm7=(41 51 61 71)\n        movq      mm1,mm6               ; transpose coefficients(phase 2)\n        punpckldq mm6,mm4               ; mm6=(42 52 62 72)\n        punpckhdq mm1,mm4               ; mm1=(43 53 63 73)\n\n        movq    MMWORD [MMBLOCK(0,1,edi,SIZEOF_JCOEF)], mm0\n        movq    MMWORD [MMBLOCK(1,1,edi,SIZEOF_JCOEF)], mm7\n        movq    MMWORD [MMBLOCK(2,1,edi,SIZEOF_JCOEF)], mm6\n        movq    MMWORD [MMBLOCK(3,1,edi,SIZEOF_JCOEF)], mm1\n\n.nextcolumn:\n        add     esi, byte 4*SIZEOF_JCOEF                ; coef_block\n        add     edx, byte 4*SIZEOF_ISLOW_MULT_TYPE      ; quantptr\n        add     edi, byte 4*DCTSIZE*SIZEOF_JCOEF        ; wsptr\n        dec     ecx                                     ; ctr\n        jnz     near .columnloop\n\n        ; ---- Pass 2: process rows from work array, store into output array.\n\n        mov     eax, [original_ebp]\n        lea     esi, [workspace]                        ; JCOEF *wsptr\n        mov     edi, JSAMPARRAY [output_buf(eax)]       ; (JSAMPROW *)\n        mov     eax, JDIMENSION [output_col(eax)]\n        mov     ecx, DCTSIZE/4                          ; ctr\n        alignx  16,7\n.rowloop:\n\n        ; -- Even part\n\n        movq    mm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        movq    mm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        movq    mm2, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        movq    mm3, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\n        ; (Original)\n        ; z1 = (z2 + z3) * 0.541196100;\n        ; tmp2 = z1 + z3 * -1.847759065;\n        ; tmp3 = z1 + z2 * 0.765366865;\n        ;\n        ; (This implementation)\n        ; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065);\n        ; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100;\n\n        movq      mm4,mm1               ; mm1=in2=z2\n        movq      mm5,mm1\n        punpcklwd mm4,mm3               ; mm3=in6=z3\n        punpckhwd mm5,mm3\n        movq      mm1,mm4\n        movq      mm3,mm5\n        pmaddwd   mm4,[GOTOFF(ebx,PW_F130_F054)]        ; mm4=tmp3L\n        pmaddwd   mm5,[GOTOFF(ebx,PW_F130_F054)]        ; mm5=tmp3H\n        pmaddwd   mm1,[GOTOFF(ebx,PW_F054_MF130)]       ; mm1=tmp2L\n        pmaddwd   mm3,[GOTOFF(ebx,PW_F054_MF130)]       ; mm3=tmp2H\n\n        movq      mm6,mm0\n        paddw     mm0,mm2               ; mm0=in0+in4\n        psubw     mm6,mm2               ; mm6=in0-in4\n\n        pxor      mm7,mm7\n        pxor      mm2,mm2\n        punpcklwd mm7,mm0               ; mm7=tmp0L\n        punpckhwd mm2,mm0               ; mm2=tmp0H\n        psrad     mm7,(16-CONST_BITS)   ; psrad mm7,16 & pslld mm7,CONST_BITS\n        psrad     mm2,(16-CONST_BITS)   ; psrad mm2,16 & pslld mm2,CONST_BITS\n\n        movq    mm0,mm7\n        paddd   mm7,mm4                 ; mm7=tmp10L\n        psubd   mm0,mm4                 ; mm0=tmp13L\n        movq    mm4,mm2\n        paddd   mm2,mm5                 ; mm2=tmp10H\n        psubd   mm4,mm5                 ; mm4=tmp13H\n\n        movq    MMWORD [wk(0)], mm7     ; wk(0)=tmp10L\n        movq    MMWORD [wk(1)], mm2     ; wk(1)=tmp10H\n        movq    MMWORD [wk(2)], mm0     ; wk(2)=tmp13L\n        movq    MMWORD [wk(3)], mm4     ; wk(3)=tmp13H\n\n        pxor      mm5,mm5\n        pxor      mm7,mm7\n        punpcklwd mm5,mm6               ; mm5=tmp1L\n        punpckhwd mm7,mm6               ; mm7=tmp1H\n        psrad     mm5,(16-CONST_BITS)   ; psrad mm5,16 & pslld mm5,CONST_BITS\n        psrad     mm7,(16-CONST_BITS)   ; psrad mm7,16 & pslld mm7,CONST_BITS\n\n        movq    mm2,mm5\n        paddd   mm5,mm1                 ; mm5=tmp11L\n        psubd   mm2,mm1                 ; mm2=tmp12L\n        movq    mm0,mm7\n        paddd   mm7,mm3                 ; mm7=tmp11H\n        psubd   mm0,mm3                 ; mm0=tmp12H\n\n        movq    MMWORD [wk(4)], mm5     ; wk(4)=tmp11L\n        movq    MMWORD [wk(5)], mm7     ; wk(5)=tmp11H\n        movq    MMWORD [wk(6)], mm2     ; wk(6)=tmp12L\n        movq    MMWORD [wk(7)], mm0     ; wk(7)=tmp12H\n\n        ; -- Odd part\n\n        movq    mm4, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movq    mm6, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        movq    mm1, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        movq    mm3, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\n        movq    mm5,mm6\n        movq    mm7,mm4\n        paddw   mm5,mm3                 ; mm5=z3\n        paddw   mm7,mm1                 ; mm7=z4\n\n        ; (Original)\n        ; z5 = (z3 + z4) * 1.175875602;\n        ; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n        ; z3 += z5;  z4 += z5;\n        ;\n        ; (This implementation)\n        ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n        ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n        movq      mm2,mm5\n        movq      mm0,mm5\n        punpcklwd mm2,mm7\n        punpckhwd mm0,mm7\n        movq      mm5,mm2\n        movq      mm7,mm0\n        pmaddwd   mm2,[GOTOFF(ebx,PW_MF078_F117)]       ; mm2=z3L\n        pmaddwd   mm0,[GOTOFF(ebx,PW_MF078_F117)]       ; mm0=z3H\n        pmaddwd   mm5,[GOTOFF(ebx,PW_F117_F078)]        ; mm5=z4L\n        pmaddwd   mm7,[GOTOFF(ebx,PW_F117_F078)]        ; mm7=z4H\n\n        movq    MMWORD [wk(10)], mm2    ; wk(10)=z3L\n        movq    MMWORD [wk(11)], mm0    ; wk(11)=z3H\n\n        ; (Original)\n        ; z1 = tmp0 + tmp3;  z2 = tmp1 + tmp2;\n        ; tmp0 = tmp0 * 0.298631336;  tmp1 = tmp1 * 2.053119869;\n        ; tmp2 = tmp2 * 3.072711026;  tmp3 = tmp3 * 1.501321110;\n        ; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n        ; tmp0 += z1 + z3;  tmp1 += z2 + z4;\n        ; tmp2 += z2 + z3;  tmp3 += z1 + z4;\n        ;\n        ; (This implementation)\n        ; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223;\n        ; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447;\n        ; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447);\n        ; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223);\n        ; tmp0 += z3;  tmp1 += z4;\n        ; tmp2 += z3;  tmp3 += z4;\n\n        movq      mm2,mm3\n        movq      mm0,mm3\n        punpcklwd mm2,mm4\n        punpckhwd mm0,mm4\n        movq      mm3,mm2\n        movq      mm4,mm0\n        pmaddwd   mm2,[GOTOFF(ebx,PW_MF060_MF089)]      ; mm2=tmp0L\n        pmaddwd   mm0,[GOTOFF(ebx,PW_MF060_MF089)]      ; mm0=tmp0H\n        pmaddwd   mm3,[GOTOFF(ebx,PW_MF089_F060)]       ; mm3=tmp3L\n        pmaddwd   mm4,[GOTOFF(ebx,PW_MF089_F060)]       ; mm4=tmp3H\n\n        paddd   mm2, MMWORD [wk(10)]    ; mm2=tmp0L\n        paddd   mm0, MMWORD [wk(11)]    ; mm0=tmp0H\n        paddd   mm3,mm5                 ; mm3=tmp3L\n        paddd   mm4,mm7                 ; mm4=tmp3H\n\n        movq    MMWORD [wk(8)], mm2     ; wk(8)=tmp0L\n        movq    MMWORD [wk(9)], mm0     ; wk(9)=tmp0H\n\n        movq      mm2,mm1\n        movq      mm0,mm1\n        punpcklwd mm2,mm6\n        punpckhwd mm0,mm6\n        movq      mm1,mm2\n        movq      mm6,mm0\n        pmaddwd   mm2,[GOTOFF(ebx,PW_MF050_MF256)]      ; mm2=tmp1L\n        pmaddwd   mm0,[GOTOFF(ebx,PW_MF050_MF256)]      ; mm0=tmp1H\n        pmaddwd   mm1,[GOTOFF(ebx,PW_MF256_F050)]       ; mm1=tmp2L\n        pmaddwd   mm6,[GOTOFF(ebx,PW_MF256_F050)]       ; mm6=tmp2H\n\n        paddd   mm2,mm5                 ; mm2=tmp1L\n        paddd   mm0,mm7                 ; mm0=tmp1H\n        paddd   mm1, MMWORD [wk(10)]    ; mm1=tmp2L\n        paddd   mm6, MMWORD [wk(11)]    ; mm6=tmp2H\n\n        movq    MMWORD [wk(10)], mm2    ; wk(10)=tmp1L\n        movq    MMWORD [wk(11)], mm0    ; wk(11)=tmp1H\n\n        ; -- Final output stage\n\n        movq    mm5, MMWORD [wk(0)]     ; mm5=tmp10L\n        movq    mm7, MMWORD [wk(1)]     ; mm7=tmp10H\n\n        movq    mm2,mm5\n        movq    mm0,mm7\n        paddd   mm5,mm3                 ; mm5=data0L\n        paddd   mm7,mm4                 ; mm7=data0H\n        psubd   mm2,mm3                 ; mm2=data7L\n        psubd   mm0,mm4                 ; mm0=data7H\n\n        movq    mm3,[GOTOFF(ebx,PD_DESCALE_P2)] ; mm3=[PD_DESCALE_P2]\n\n        paddd   mm5,mm3\n        paddd   mm7,mm3\n        psrad   mm5,DESCALE_P2\n        psrad   mm7,DESCALE_P2\n        paddd   mm2,mm3\n        paddd   mm0,mm3\n        psrad   mm2,DESCALE_P2\n        psrad   mm0,DESCALE_P2\n\n        packssdw  mm5,mm7               ; mm5=data0=(00 10 20 30)\n        packssdw  mm2,mm0               ; mm2=data7=(07 17 27 37)\n\n        movq    mm4, MMWORD [wk(4)]     ; mm4=tmp11L\n        movq    mm3, MMWORD [wk(5)]     ; mm3=tmp11H\n\n        movq    mm7,mm4\n        movq    mm0,mm3\n        paddd   mm4,mm1                 ; mm4=data1L\n        paddd   mm3,mm6                 ; mm3=data1H\n        psubd   mm7,mm1                 ; mm7=data6L\n        psubd   mm0,mm6                 ; mm0=data6H\n\n        movq    mm1,[GOTOFF(ebx,PD_DESCALE_P2)] ; mm1=[PD_DESCALE_P2]\n\n        paddd   mm4,mm1\n        paddd   mm3,mm1\n        psrad   mm4,DESCALE_P2\n        psrad   mm3,DESCALE_P2\n        paddd   mm7,mm1\n        paddd   mm0,mm1\n        psrad   mm7,DESCALE_P2\n        psrad   mm0,DESCALE_P2\n\n        packssdw  mm4,mm3               ; mm4=data1=(01 11 21 31)\n        packssdw  mm7,mm0               ; mm7=data6=(06 16 26 36)\n\n        packsswb  mm5,mm7               ; mm5=(00 10 20 30 06 16 26 36)\n        packsswb  mm4,mm2               ; mm4=(01 11 21 31 07 17 27 37)\n\n        movq    mm6, MMWORD [wk(6)]     ; mm6=tmp12L\n        movq    mm1, MMWORD [wk(7)]     ; mm1=tmp12H\n        movq    mm3, MMWORD [wk(10)]    ; mm3=tmp1L\n        movq    mm0, MMWORD [wk(11)]    ; mm0=tmp1H\n\n        movq    MMWORD [wk(0)], mm5     ; wk(0)=(00 10 20 30 06 16 26 36)\n        movq    MMWORD [wk(1)], mm4     ; wk(1)=(01 11 21 31 07 17 27 37)\n\n        movq    mm7,mm6\n        movq    mm2,mm1\n        paddd   mm6,mm3                 ; mm6=data2L\n        paddd   mm1,mm0                 ; mm1=data2H\n        psubd   mm7,mm3                 ; mm7=data5L\n        psubd   mm2,mm0                 ; mm2=data5H\n\n        movq    mm5,[GOTOFF(ebx,PD_DESCALE_P2)] ; mm5=[PD_DESCALE_P2]\n\n        paddd   mm6,mm5\n        paddd   mm1,mm5\n        psrad   mm6,DESCALE_P2\n        psrad   mm1,DESCALE_P2\n        paddd   mm7,mm5\n        paddd   mm2,mm5\n        psrad   mm7,DESCALE_P2\n        psrad   mm2,DESCALE_P2\n\n        packssdw  mm6,mm1               ; mm6=data2=(02 12 22 32)\n        packssdw  mm7,mm2               ; mm7=data5=(05 15 25 35)\n\n        movq    mm4, MMWORD [wk(2)]     ; mm4=tmp13L\n        movq    mm3, MMWORD [wk(3)]     ; mm3=tmp13H\n        movq    mm0, MMWORD [wk(8)]     ; mm0=tmp0L\n        movq    mm5, MMWORD [wk(9)]     ; mm5=tmp0H\n\n        movq    mm1,mm4\n        movq    mm2,mm3\n        paddd   mm4,mm0                 ; mm4=data3L\n        paddd   mm3,mm5                 ; mm3=data3H\n        psubd   mm1,mm0                 ; mm1=data4L\n        psubd   mm2,mm5                 ; mm2=data4H\n\n        movq    mm0,[GOTOFF(ebx,PD_DESCALE_P2)] ; mm0=[PD_DESCALE_P2]\n\n        paddd   mm4,mm0\n        paddd   mm3,mm0\n        psrad   mm4,DESCALE_P2\n        psrad   mm3,DESCALE_P2\n        paddd   mm1,mm0\n        paddd   mm2,mm0\n        psrad   mm1,DESCALE_P2\n        psrad   mm2,DESCALE_P2\n\n        movq      mm5,[GOTOFF(ebx,PB_CENTERJSAMP)]      ; mm5=[PB_CENTERJSAMP]\n\n        packssdw  mm4,mm3               ; mm4=data3=(03 13 23 33)\n        packssdw  mm1,mm2               ; mm1=data4=(04 14 24 34)\n\n        movq      mm0, MMWORD [wk(0)]   ; mm0=(00 10 20 30 06 16 26 36)\n        movq      mm3, MMWORD [wk(1)]   ; mm3=(01 11 21 31 07 17 27 37)\n\n        packsswb  mm6,mm1               ; mm6=(02 12 22 32 04 14 24 34)\n        packsswb  mm4,mm7               ; mm4=(03 13 23 33 05 15 25 35)\n\n        paddb     mm0,mm5\n        paddb     mm3,mm5\n        paddb     mm6,mm5\n        paddb     mm4,mm5\n\n        movq      mm2,mm0               ; transpose coefficients(phase 1)\n        punpcklbw mm0,mm3               ; mm0=(00 01 10 11 20 21 30 31)\n        punpckhbw mm2,mm3               ; mm2=(06 07 16 17 26 27 36 37)\n        movq      mm1,mm6               ; transpose coefficients(phase 1)\n        punpcklbw mm6,mm4               ; mm6=(02 03 12 13 22 23 32 33)\n        punpckhbw mm1,mm4               ; mm1=(04 05 14 15 24 25 34 35)\n\n        movq      mm7,mm0               ; transpose coefficients(phase 2)\n        punpcklwd mm0,mm6               ; mm0=(00 01 02 03 10 11 12 13)\n        punpckhwd mm7,mm6               ; mm7=(20 21 22 23 30 31 32 33)\n        movq      mm5,mm1               ; transpose coefficients(phase 2)\n        punpcklwd mm1,mm2               ; mm1=(04 05 06 07 14 15 16 17)\n        punpckhwd mm5,mm2               ; mm5=(24 25 26 27 34 35 36 37)\n\n        movq      mm3,mm0               ; transpose coefficients(phase 3)\n        punpckldq mm0,mm1               ; mm0=(00 01 02 03 04 05 06 07)\n        punpckhdq mm3,mm1               ; mm3=(10 11 12 13 14 15 16 17)\n        movq      mm4,mm7               ; transpose coefficients(phase 3)\n        punpckldq mm7,mm5               ; mm7=(20 21 22 23 24 25 26 27)\n        punpckhdq mm4,mm5               ; mm4=(30 31 32 33 34 35 36 37)\n\n        pushpic ebx                     ; save GOT address\n\n        mov     edx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n        mov     ebx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n        movq    MMWORD [edx+eax*SIZEOF_JSAMPLE], mm0\n        movq    MMWORD [ebx+eax*SIZEOF_JSAMPLE], mm3\n        mov     edx, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n        mov     ebx, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n        movq    MMWORD [edx+eax*SIZEOF_JSAMPLE], mm7\n        movq    MMWORD [ebx+eax*SIZEOF_JSAMPLE], mm4\n\n        poppic  ebx                     ; restore GOT address\n\n        add     esi, byte 4*SIZEOF_JCOEF        ; wsptr\n        add     edi, byte 4*SIZEOF_JSAMPROW\n        dec     ecx                             ; ctr\n        jnz     near .rowloop\n\n        emms            ; empty MMX state\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jidctint-sse2-64.asm",
    "content": ";\n; jidctint.asm - accurate integer IDCT (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a slow-but-accurate integer implementation of the\n; inverse DCT (Discrete Cosine Transform). The following code is based\n; directly on the IJG's original jidctint.c; see the jidctint.c for\n; more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS      13\n%define PASS1_BITS      2\n\n%define DESCALE_P1      (CONST_BITS-PASS1_BITS)\n%define DESCALE_P2      (CONST_BITS+PASS1_BITS+3)\n\n%if CONST_BITS == 13\nF_0_298 equ      2446           ; FIX(0.298631336)\nF_0_390 equ      3196           ; FIX(0.390180644)\nF_0_541 equ      4433           ; FIX(0.541196100)\nF_0_765 equ      6270           ; FIX(0.765366865)\nF_0_899 equ      7373           ; FIX(0.899976223)\nF_1_175 equ      9633           ; FIX(1.175875602)\nF_1_501 equ     12299           ; FIX(1.501321110)\nF_1_847 equ     15137           ; FIX(1.847759065)\nF_1_961 equ     16069           ; FIX(1.961570560)\nF_2_053 equ     16819           ; FIX(2.053119869)\nF_2_562 equ     20995           ; FIX(2.562915447)\nF_3_072 equ     25172           ; FIX(3.072711026)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_298 equ     DESCALE( 320652955,30-CONST_BITS)       ; FIX(0.298631336)\nF_0_390 equ     DESCALE( 418953276,30-CONST_BITS)       ; FIX(0.390180644)\nF_0_541 equ     DESCALE( 581104887,30-CONST_BITS)       ; FIX(0.541196100)\nF_0_765 equ     DESCALE( 821806413,30-CONST_BITS)       ; FIX(0.765366865)\nF_0_899 equ     DESCALE( 966342111,30-CONST_BITS)       ; FIX(0.899976223)\nF_1_175 equ     DESCALE(1262586813,30-CONST_BITS)       ; FIX(1.175875602)\nF_1_501 equ     DESCALE(1612031267,30-CONST_BITS)       ; FIX(1.501321110)\nF_1_847 equ     DESCALE(1984016188,30-CONST_BITS)       ; FIX(1.847759065)\nF_1_961 equ     DESCALE(2106220350,30-CONST_BITS)       ; FIX(1.961570560)\nF_2_053 equ     DESCALE(2204520673,30-CONST_BITS)       ; FIX(2.053119869)\nF_2_562 equ     DESCALE(2751909506,30-CONST_BITS)       ; FIX(2.562915447)\nF_3_072 equ     DESCALE(3299298341,30-CONST_BITS)       ; FIX(3.072711026)\n%endif\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_idct_islow_sse2)\n\nEXTN(jconst_idct_islow_sse2):\n\nPW_F130_F054    times 4 dw  (F_0_541+F_0_765), F_0_541\nPW_F054_MF130   times 4 dw  F_0_541, (F_0_541-F_1_847)\nPW_MF078_F117   times 4 dw  (F_1_175-F_1_961), F_1_175\nPW_F117_F078    times 4 dw  F_1_175, (F_1_175-F_0_390)\nPW_MF060_MF089  times 4 dw  (F_0_298-F_0_899),-F_0_899\nPW_MF089_F060   times 4 dw -F_0_899, (F_1_501-F_0_899)\nPW_MF050_MF256  times 4 dw  (F_2_053-F_2_562),-F_2_562\nPW_MF256_F050   times 4 dw -F_2_562, (F_3_072-F_2_562)\nPD_DESCALE_P1   times 4 dd  1 << (DESCALE_P1-1)\nPD_DESCALE_P2   times 4 dd  1 << (DESCALE_P2-1)\nPB_CENTERJSAMP  times 16 db CENTERJSAMPLE\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_islow_sse2 (void *dct_table, JCOEFPTR coef_block,\n;                        JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n; r10 = jpeg_component_info *compptr\n; r11 = JCOEFPTR coef_block\n; r12 = JSAMPARRAY output_buf\n; r13 = JDIMENSION output_col\n\n%define original_rbp    rbp+0\n%define wk(i)           rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          12\n\n        align   16\n        global  EXTN(jsimd_idct_islow_sse2)\n\nEXTN(jsimd_idct_islow_sse2):\n        push    rbp\n        mov     rax,rsp                         ; rax = original rbp\n        sub     rsp, byte 4\n        and     rsp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [rsp],rax\n        mov     rbp,rsp                         ; rbp = aligned rbp\n        lea     rsp, [wk(0)]\n        collect_args\n\n        ; ---- Pass 1: process columns from input.\n\n        mov     rdx, r10                ; quantptr\n        mov     rsi, r11                ; inptr\n\n%ifndef NO_ZERO_COLUMN_TEST_ISLOW_SSE2\n        mov     eax, DWORD [DWBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n        or      eax, DWORD [DWBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n        jnz     near .columnDCT\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n        por     xmm1, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n        por     xmm1, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n        por     xmm1,xmm0\n        packsswb xmm1,xmm1\n        packsswb xmm1,xmm1\n        movd    eax,xmm1\n        test    rax,rax\n        jnz     short .columnDCT\n\n        ; -- AC terms all zero\n\n        movdqa  xmm5, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm5, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        psllw   xmm5,PASS1_BITS\n\n        movdqa    xmm4,xmm5             ; xmm5=in0=(00 01 02 03 04 05 06 07)\n        punpcklwd xmm5,xmm5             ; xmm5=(00 00 01 01 02 02 03 03)\n        punpckhwd xmm4,xmm4             ; xmm4=(04 04 05 05 06 06 07 07)\n\n        pshufd  xmm7,xmm5,0x00          ; xmm7=col0=(00 00 00 00 00 00 00 00)\n        pshufd  xmm6,xmm5,0x55          ; xmm6=col1=(01 01 01 01 01 01 01 01)\n        pshufd  xmm1,xmm5,0xAA          ; xmm1=col2=(02 02 02 02 02 02 02 02)\n        pshufd  xmm5,xmm5,0xFF          ; xmm5=col3=(03 03 03 03 03 03 03 03)\n        pshufd  xmm0,xmm4,0x00          ; xmm0=col4=(04 04 04 04 04 04 04 04)\n        pshufd  xmm3,xmm4,0x55          ; xmm3=col5=(05 05 05 05 05 05 05 05)\n        pshufd  xmm2,xmm4,0xAA          ; xmm2=col6=(06 06 06 06 06 06 06 06)\n        pshufd  xmm4,xmm4,0xFF          ; xmm4=col7=(07 07 07 07 07 07 07 07)\n\n        movdqa  XMMWORD [wk(8)], xmm6   ; wk(8)=col1\n        movdqa  XMMWORD [wk(9)], xmm5   ; wk(9)=col3\n        movdqa  XMMWORD [wk(10)], xmm3  ; wk(10)=col5\n        movdqa  XMMWORD [wk(11)], xmm4  ; wk(11)=col7\n        jmp     near .column_end\n%endif\n.columnDCT:\n\n        ; -- Even part\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm1, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n        movdqa  xmm2, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm2, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm3, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        ; (Original)\n        ; z1 = (z2 + z3) * 0.541196100;\n        ; tmp2 = z1 + z3 * -1.847759065;\n        ; tmp3 = z1 + z2 * 0.765366865;\n        ;\n        ; (This implementation)\n        ; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065);\n        ; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100;\n\n        movdqa    xmm4,xmm1             ; xmm1=in2=z2\n        movdqa    xmm5,xmm1\n        punpcklwd xmm4,xmm3             ; xmm3=in6=z3\n        punpckhwd xmm5,xmm3\n        movdqa    xmm1,xmm4\n        movdqa    xmm3,xmm5\n        pmaddwd   xmm4,[rel PW_F130_F054]       ; xmm4=tmp3L\n        pmaddwd   xmm5,[rel PW_F130_F054]       ; xmm5=tmp3H\n        pmaddwd   xmm1,[rel PW_F054_MF130]      ; xmm1=tmp2L\n        pmaddwd   xmm3,[rel PW_F054_MF130]      ; xmm3=tmp2H\n\n        movdqa    xmm6,xmm0\n        paddw     xmm0,xmm2             ; xmm0=in0+in4\n        psubw     xmm6,xmm2             ; xmm6=in0-in4\n\n        pxor      xmm7,xmm7\n        pxor      xmm2,xmm2\n        punpcklwd xmm7,xmm0             ; xmm7=tmp0L\n        punpckhwd xmm2,xmm0             ; xmm2=tmp0H\n        psrad     xmm7,(16-CONST_BITS)  ; psrad xmm7,16 & pslld xmm7,CONST_BITS\n        psrad     xmm2,(16-CONST_BITS)  ; psrad xmm2,16 & pslld xmm2,CONST_BITS\n\n        movdqa  xmm0,xmm7\n        paddd   xmm7,xmm4               ; xmm7=tmp10L\n        psubd   xmm0,xmm4               ; xmm0=tmp13L\n        movdqa  xmm4,xmm2\n        paddd   xmm2,xmm5               ; xmm2=tmp10H\n        psubd   xmm4,xmm5               ; xmm4=tmp13H\n\n        movdqa  XMMWORD [wk(0)], xmm7   ; wk(0)=tmp10L\n        movdqa  XMMWORD [wk(1)], xmm2   ; wk(1)=tmp10H\n        movdqa  XMMWORD [wk(2)], xmm0   ; wk(2)=tmp13L\n        movdqa  XMMWORD [wk(3)], xmm4   ; wk(3)=tmp13H\n\n        pxor      xmm5,xmm5\n        pxor      xmm7,xmm7\n        punpcklwd xmm5,xmm6             ; xmm5=tmp1L\n        punpckhwd xmm7,xmm6             ; xmm7=tmp1H\n        psrad     xmm5,(16-CONST_BITS)  ; psrad xmm5,16 & pslld xmm5,CONST_BITS\n        psrad     xmm7,(16-CONST_BITS)  ; psrad xmm7,16 & pslld xmm7,CONST_BITS\n\n        movdqa  xmm2,xmm5\n        paddd   xmm5,xmm1               ; xmm5=tmp11L\n        psubd   xmm2,xmm1               ; xmm2=tmp12L\n        movdqa  xmm0,xmm7\n        paddd   xmm7,xmm3               ; xmm7=tmp11H\n        psubd   xmm0,xmm3               ; xmm0=tmp12H\n\n        movdqa  XMMWORD [wk(4)], xmm5   ; wk(4)=tmp11L\n        movdqa  XMMWORD [wk(5)], xmm7   ; wk(5)=tmp11H\n        movdqa  XMMWORD [wk(6)], xmm2   ; wk(6)=tmp12L\n        movdqa  XMMWORD [wk(7)], xmm0   ; wk(7)=tmp12H\n\n        ; -- Odd part\n\n        movdqa  xmm4, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm6, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm4, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm6, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm1, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        movdqa  xmm5,xmm6\n        movdqa  xmm7,xmm4\n        paddw   xmm5,xmm3               ; xmm5=z3\n        paddw   xmm7,xmm1               ; xmm7=z4\n\n        ; (Original)\n        ; z5 = (z3 + z4) * 1.175875602;\n        ; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n        ; z3 += z5;  z4 += z5;\n        ;\n        ; (This implementation)\n        ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n        ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n        movdqa    xmm2,xmm5\n        movdqa    xmm0,xmm5\n        punpcklwd xmm2,xmm7\n        punpckhwd xmm0,xmm7\n        movdqa    xmm5,xmm2\n        movdqa    xmm7,xmm0\n        pmaddwd   xmm2,[rel PW_MF078_F117]      ; xmm2=z3L\n        pmaddwd   xmm0,[rel PW_MF078_F117]      ; xmm0=z3H\n        pmaddwd   xmm5,[rel PW_F117_F078]       ; xmm5=z4L\n        pmaddwd   xmm7,[rel PW_F117_F078]       ; xmm7=z4H\n\n        movdqa  XMMWORD [wk(10)], xmm2  ; wk(10)=z3L\n        movdqa  XMMWORD [wk(11)], xmm0  ; wk(11)=z3H\n\n        ; (Original)\n        ; z1 = tmp0 + tmp3;  z2 = tmp1 + tmp2;\n        ; tmp0 = tmp0 * 0.298631336;  tmp1 = tmp1 * 2.053119869;\n        ; tmp2 = tmp2 * 3.072711026;  tmp3 = tmp3 * 1.501321110;\n        ; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n        ; tmp0 += z1 + z3;  tmp1 += z2 + z4;\n        ; tmp2 += z2 + z3;  tmp3 += z1 + z4;\n        ;\n        ; (This implementation)\n        ; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223;\n        ; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447;\n        ; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447);\n        ; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223);\n        ; tmp0 += z3;  tmp1 += z4;\n        ; tmp2 += z3;  tmp3 += z4;\n\n        movdqa    xmm2,xmm3\n        movdqa    xmm0,xmm3\n        punpcklwd xmm2,xmm4\n        punpckhwd xmm0,xmm4\n        movdqa    xmm3,xmm2\n        movdqa    xmm4,xmm0\n        pmaddwd   xmm2,[rel PW_MF060_MF089]     ; xmm2=tmp0L\n        pmaddwd   xmm0,[rel PW_MF060_MF089]     ; xmm0=tmp0H\n        pmaddwd   xmm3,[rel PW_MF089_F060]      ; xmm3=tmp3L\n        pmaddwd   xmm4,[rel PW_MF089_F060]      ; xmm4=tmp3H\n\n        paddd   xmm2, XMMWORD [wk(10)]  ; xmm2=tmp0L\n        paddd   xmm0, XMMWORD [wk(11)]  ; xmm0=tmp0H\n        paddd   xmm3,xmm5               ; xmm3=tmp3L\n        paddd   xmm4,xmm7               ; xmm4=tmp3H\n\n        movdqa  XMMWORD [wk(8)], xmm2   ; wk(8)=tmp0L\n        movdqa  XMMWORD [wk(9)], xmm0   ; wk(9)=tmp0H\n\n        movdqa    xmm2,xmm1\n        movdqa    xmm0,xmm1\n        punpcklwd xmm2,xmm6\n        punpckhwd xmm0,xmm6\n        movdqa    xmm1,xmm2\n        movdqa    xmm6,xmm0\n        pmaddwd   xmm2,[rel PW_MF050_MF256]     ; xmm2=tmp1L\n        pmaddwd   xmm0,[rel PW_MF050_MF256]     ; xmm0=tmp1H\n        pmaddwd   xmm1,[rel PW_MF256_F050]      ; xmm1=tmp2L\n        pmaddwd   xmm6,[rel PW_MF256_F050]      ; xmm6=tmp2H\n\n        paddd   xmm2,xmm5               ; xmm2=tmp1L\n        paddd   xmm0,xmm7               ; xmm0=tmp1H\n        paddd   xmm1, XMMWORD [wk(10)]  ; xmm1=tmp2L\n        paddd   xmm6, XMMWORD [wk(11)]  ; xmm6=tmp2H\n\n        movdqa  XMMWORD [wk(10)], xmm2  ; wk(10)=tmp1L\n        movdqa  XMMWORD [wk(11)], xmm0  ; wk(11)=tmp1H\n\n        ; -- Final output stage\n\n        movdqa  xmm5, XMMWORD [wk(0)]   ; xmm5=tmp10L\n        movdqa  xmm7, XMMWORD [wk(1)]   ; xmm7=tmp10H\n\n        movdqa  xmm2,xmm5\n        movdqa  xmm0,xmm7\n        paddd   xmm5,xmm3               ; xmm5=data0L\n        paddd   xmm7,xmm4               ; xmm7=data0H\n        psubd   xmm2,xmm3               ; xmm2=data7L\n        psubd   xmm0,xmm4               ; xmm0=data7H\n\n        movdqa  xmm3,[rel PD_DESCALE_P1]        ; xmm3=[rel PD_DESCALE_P1]\n\n        paddd   xmm5,xmm3\n        paddd   xmm7,xmm3\n        psrad   xmm5,DESCALE_P1\n        psrad   xmm7,DESCALE_P1\n        paddd   xmm2,xmm3\n        paddd   xmm0,xmm3\n        psrad   xmm2,DESCALE_P1\n        psrad   xmm0,DESCALE_P1\n\n        packssdw  xmm5,xmm7             ; xmm5=data0=(00 01 02 03 04 05 06 07)\n        packssdw  xmm2,xmm0             ; xmm2=data7=(70 71 72 73 74 75 76 77)\n\n        movdqa  xmm4, XMMWORD [wk(4)]   ; xmm4=tmp11L\n        movdqa  xmm3, XMMWORD [wk(5)]   ; xmm3=tmp11H\n\n        movdqa  xmm7,xmm4\n        movdqa  xmm0,xmm3\n        paddd   xmm4,xmm1               ; xmm4=data1L\n        paddd   xmm3,xmm6               ; xmm3=data1H\n        psubd   xmm7,xmm1               ; xmm7=data6L\n        psubd   xmm0,xmm6               ; xmm0=data6H\n\n        movdqa  xmm1,[rel PD_DESCALE_P1]        ; xmm1=[rel PD_DESCALE_P1]\n\n        paddd   xmm4,xmm1\n        paddd   xmm3,xmm1\n        psrad   xmm4,DESCALE_P1\n        psrad   xmm3,DESCALE_P1\n        paddd   xmm7,xmm1\n        paddd   xmm0,xmm1\n        psrad   xmm7,DESCALE_P1\n        psrad   xmm0,DESCALE_P1\n\n        packssdw  xmm4,xmm3             ; xmm4=data1=(10 11 12 13 14 15 16 17)\n        packssdw  xmm7,xmm0             ; xmm7=data6=(60 61 62 63 64 65 66 67)\n\n        movdqa    xmm6,xmm5             ; transpose coefficients(phase 1)\n        punpcklwd xmm5,xmm4             ; xmm5=(00 10 01 11 02 12 03 13)\n        punpckhwd xmm6,xmm4             ; xmm6=(04 14 05 15 06 16 07 17)\n        movdqa    xmm1,xmm7             ; transpose coefficients(phase 1)\n        punpcklwd xmm7,xmm2             ; xmm7=(60 70 61 71 62 72 63 73)\n        punpckhwd xmm1,xmm2             ; xmm1=(64 74 65 75 66 76 67 77)\n\n        movdqa  xmm3, XMMWORD [wk(6)]   ; xmm3=tmp12L\n        movdqa  xmm0, XMMWORD [wk(7)]   ; xmm0=tmp12H\n        movdqa  xmm4, XMMWORD [wk(10)]  ; xmm4=tmp1L\n        movdqa  xmm2, XMMWORD [wk(11)]  ; xmm2=tmp1H\n\n        movdqa  XMMWORD [wk(0)], xmm5   ; wk(0)=(00 10 01 11 02 12 03 13)\n        movdqa  XMMWORD [wk(1)], xmm6   ; wk(1)=(04 14 05 15 06 16 07 17)\n        movdqa  XMMWORD [wk(4)], xmm7   ; wk(4)=(60 70 61 71 62 72 63 73)\n        movdqa  XMMWORD [wk(5)], xmm1   ; wk(5)=(64 74 65 75 66 76 67 77)\n\n        movdqa  xmm5,xmm3\n        movdqa  xmm6,xmm0\n        paddd   xmm3,xmm4               ; xmm3=data2L\n        paddd   xmm0,xmm2               ; xmm0=data2H\n        psubd   xmm5,xmm4               ; xmm5=data5L\n        psubd   xmm6,xmm2               ; xmm6=data5H\n\n        movdqa  xmm7,[rel PD_DESCALE_P1]        ; xmm7=[rel PD_DESCALE_P1]\n\n        paddd   xmm3,xmm7\n        paddd   xmm0,xmm7\n        psrad   xmm3,DESCALE_P1\n        psrad   xmm0,DESCALE_P1\n        paddd   xmm5,xmm7\n        paddd   xmm6,xmm7\n        psrad   xmm5,DESCALE_P1\n        psrad   xmm6,DESCALE_P1\n\n        packssdw  xmm3,xmm0             ; xmm3=data2=(20 21 22 23 24 25 26 27)\n        packssdw  xmm5,xmm6             ; xmm5=data5=(50 51 52 53 54 55 56 57)\n\n        movdqa  xmm1, XMMWORD [wk(2)]   ; xmm1=tmp13L\n        movdqa  xmm4, XMMWORD [wk(3)]   ; xmm4=tmp13H\n        movdqa  xmm2, XMMWORD [wk(8)]   ; xmm2=tmp0L\n        movdqa  xmm7, XMMWORD [wk(9)]   ; xmm7=tmp0H\n\n        movdqa  xmm0,xmm1\n        movdqa  xmm6,xmm4\n        paddd   xmm1,xmm2               ; xmm1=data3L\n        paddd   xmm4,xmm7               ; xmm4=data3H\n        psubd   xmm0,xmm2               ; xmm0=data4L\n        psubd   xmm6,xmm7               ; xmm6=data4H\n\n        movdqa  xmm2,[rel PD_DESCALE_P1]        ; xmm2=[rel PD_DESCALE_P1]\n\n        paddd   xmm1,xmm2\n        paddd   xmm4,xmm2\n        psrad   xmm1,DESCALE_P1\n        psrad   xmm4,DESCALE_P1\n        paddd   xmm0,xmm2\n        paddd   xmm6,xmm2\n        psrad   xmm0,DESCALE_P1\n        psrad   xmm6,DESCALE_P1\n\n        packssdw  xmm1,xmm4             ; xmm1=data3=(30 31 32 33 34 35 36 37)\n        packssdw  xmm0,xmm6             ; xmm0=data4=(40 41 42 43 44 45 46 47)\n\n        movdqa  xmm7, XMMWORD [wk(0)]   ; xmm7=(00 10 01 11 02 12 03 13)\n        movdqa  xmm2, XMMWORD [wk(1)]   ; xmm2=(04 14 05 15 06 16 07 17)\n\n        movdqa    xmm4,xmm3             ; transpose coefficients(phase 1)\n        punpcklwd xmm3,xmm1             ; xmm3=(20 30 21 31 22 32 23 33)\n        punpckhwd xmm4,xmm1             ; xmm4=(24 34 25 35 26 36 27 37)\n        movdqa    xmm6,xmm0             ; transpose coefficients(phase 1)\n        punpcklwd xmm0,xmm5             ; xmm0=(40 50 41 51 42 52 43 53)\n        punpckhwd xmm6,xmm5             ; xmm6=(44 54 45 55 46 56 47 57)\n\n        movdqa    xmm1,xmm7             ; transpose coefficients(phase 2)\n        punpckldq xmm7,xmm3             ; xmm7=(00 10 20 30 01 11 21 31)\n        punpckhdq xmm1,xmm3             ; xmm1=(02 12 22 32 03 13 23 33)\n        movdqa    xmm5,xmm2             ; transpose coefficients(phase 2)\n        punpckldq xmm2,xmm4             ; xmm2=(04 14 24 34 05 15 25 35)\n        punpckhdq xmm5,xmm4             ; xmm5=(06 16 26 36 07 17 27 37)\n\n        movdqa  xmm3, XMMWORD [wk(4)]   ; xmm3=(60 70 61 71 62 72 63 73)\n        movdqa  xmm4, XMMWORD [wk(5)]   ; xmm4=(64 74 65 75 66 76 67 77)\n\n        movdqa  XMMWORD [wk(6)], xmm2   ; wk(6)=(04 14 24 34 05 15 25 35)\n        movdqa  XMMWORD [wk(7)], xmm5   ; wk(7)=(06 16 26 36 07 17 27 37)\n\n        movdqa    xmm2,xmm0             ; transpose coefficients(phase 2)\n        punpckldq xmm0,xmm3             ; xmm0=(40 50 60 70 41 51 61 71)\n        punpckhdq xmm2,xmm3             ; xmm2=(42 52 62 72 43 53 63 73)\n        movdqa    xmm5,xmm6             ; transpose coefficients(phase 2)\n        punpckldq xmm6,xmm4             ; xmm6=(44 54 64 74 45 55 65 75)\n        punpckhdq xmm5,xmm4             ; xmm5=(46 56 66 76 47 57 67 77)\n\n        movdqa     xmm3,xmm7            ; transpose coefficients(phase 3)\n        punpcklqdq xmm7,xmm0            ; xmm7=col0=(00 10 20 30 40 50 60 70)\n        punpckhqdq xmm3,xmm0            ; xmm3=col1=(01 11 21 31 41 51 61 71)\n        movdqa     xmm4,xmm1            ; transpose coefficients(phase 3)\n        punpcklqdq xmm1,xmm2            ; xmm1=col2=(02 12 22 32 42 52 62 72)\n        punpckhqdq xmm4,xmm2            ; xmm4=col3=(03 13 23 33 43 53 63 73)\n\n        movdqa  xmm0, XMMWORD [wk(6)]   ; xmm0=(04 14 24 34 05 15 25 35)\n        movdqa  xmm2, XMMWORD [wk(7)]   ; xmm2=(06 16 26 36 07 17 27 37)\n\n        movdqa  XMMWORD [wk(8)], xmm3   ; wk(8)=col1\n        movdqa  XMMWORD [wk(9)], xmm4   ; wk(9)=col3\n\n        movdqa     xmm3,xmm0            ; transpose coefficients(phase 3)\n        punpcklqdq xmm0,xmm6            ; xmm0=col4=(04 14 24 34 44 54 64 74)\n        punpckhqdq xmm3,xmm6            ; xmm3=col5=(05 15 25 35 45 55 65 75)\n        movdqa     xmm4,xmm2            ; transpose coefficients(phase 3)\n        punpcklqdq xmm2,xmm5            ; xmm2=col6=(06 16 26 36 46 56 66 76)\n        punpckhqdq xmm4,xmm5            ; xmm4=col7=(07 17 27 37 47 57 67 77)\n\n        movdqa  XMMWORD [wk(10)], xmm3  ; wk(10)=col5\n        movdqa  XMMWORD [wk(11)], xmm4  ; wk(11)=col7\n.column_end:\n\n        ; -- Prefetch the next coefficient block\n\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n        ; ---- Pass 2: process rows from work array, store into output array.\n\n        mov     rax, [original_rbp]\n        mov     rdi, r12        ; (JSAMPROW *)\n        mov     eax, r13d\n\n        ; -- Even part\n\n        ; xmm7=col0, xmm1=col2, xmm0=col4, xmm2=col6\n\n        ; (Original)\n        ; z1 = (z2 + z3) * 0.541196100;\n        ; tmp2 = z1 + z3 * -1.847759065;\n        ; tmp3 = z1 + z2 * 0.765366865;\n        ;\n        ; (This implementation)\n        ; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065);\n        ; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100;\n\n        movdqa    xmm6,xmm1             ; xmm1=in2=z2\n        movdqa    xmm5,xmm1\n        punpcklwd xmm6,xmm2             ; xmm2=in6=z3\n        punpckhwd xmm5,xmm2\n        movdqa    xmm1,xmm6\n        movdqa    xmm2,xmm5\n        pmaddwd   xmm6,[rel PW_F130_F054]       ; xmm6=tmp3L\n        pmaddwd   xmm5,[rel PW_F130_F054]       ; xmm5=tmp3H\n        pmaddwd   xmm1,[rel PW_F054_MF130]      ; xmm1=tmp2L\n        pmaddwd   xmm2,[rel PW_F054_MF130]      ; xmm2=tmp2H\n\n        movdqa    xmm3,xmm7\n        paddw     xmm7,xmm0             ; xmm7=in0+in4\n        psubw     xmm3,xmm0             ; xmm3=in0-in4\n\n        pxor      xmm4,xmm4\n        pxor      xmm0,xmm0\n        punpcklwd xmm4,xmm7             ; xmm4=tmp0L\n        punpckhwd xmm0,xmm7             ; xmm0=tmp0H\n        psrad     xmm4,(16-CONST_BITS)  ; psrad xmm4,16 & pslld xmm4,CONST_BITS\n        psrad     xmm0,(16-CONST_BITS)  ; psrad xmm0,16 & pslld xmm0,CONST_BITS\n\n        movdqa  xmm7,xmm4\n        paddd   xmm4,xmm6               ; xmm4=tmp10L\n        psubd   xmm7,xmm6               ; xmm7=tmp13L\n        movdqa  xmm6,xmm0\n        paddd   xmm0,xmm5               ; xmm0=tmp10H\n        psubd   xmm6,xmm5               ; xmm6=tmp13H\n\n        movdqa  XMMWORD [wk(0)], xmm4   ; wk(0)=tmp10L\n        movdqa  XMMWORD [wk(1)], xmm0   ; wk(1)=tmp10H\n        movdqa  XMMWORD [wk(2)], xmm7   ; wk(2)=tmp13L\n        movdqa  XMMWORD [wk(3)], xmm6   ; wk(3)=tmp13H\n\n        pxor      xmm5,xmm5\n        pxor      xmm4,xmm4\n        punpcklwd xmm5,xmm3             ; xmm5=tmp1L\n        punpckhwd xmm4,xmm3             ; xmm4=tmp1H\n        psrad     xmm5,(16-CONST_BITS)  ; psrad xmm5,16 & pslld xmm5,CONST_BITS\n        psrad     xmm4,(16-CONST_BITS)  ; psrad xmm4,16 & pslld xmm4,CONST_BITS\n\n        movdqa  xmm0,xmm5\n        paddd   xmm5,xmm1               ; xmm5=tmp11L\n        psubd   xmm0,xmm1               ; xmm0=tmp12L\n        movdqa  xmm7,xmm4\n        paddd   xmm4,xmm2               ; xmm4=tmp11H\n        psubd   xmm7,xmm2               ; xmm7=tmp12H\n\n        movdqa  XMMWORD [wk(4)], xmm5   ; wk(4)=tmp11L\n        movdqa  XMMWORD [wk(5)], xmm4   ; wk(5)=tmp11H\n        movdqa  XMMWORD [wk(6)], xmm0   ; wk(6)=tmp12L\n        movdqa  XMMWORD [wk(7)], xmm7   ; wk(7)=tmp12H\n\n        ; -- Odd part\n\n        movdqa  xmm6, XMMWORD [wk(9)]   ; xmm6=col3\n        movdqa  xmm3, XMMWORD [wk(8)]   ; xmm3=col1\n        movdqa  xmm1, XMMWORD [wk(11)]  ; xmm1=col7\n        movdqa  xmm2, XMMWORD [wk(10)]  ; xmm2=col5\n\n        movdqa  xmm5,xmm6\n        movdqa  xmm4,xmm3\n        paddw   xmm5,xmm1               ; xmm5=z3\n        paddw   xmm4,xmm2               ; xmm4=z4\n\n        ; (Original)\n        ; z5 = (z3 + z4) * 1.175875602;\n        ; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n        ; z3 += z5;  z4 += z5;\n        ;\n        ; (This implementation)\n        ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n        ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n        movdqa    xmm0,xmm5\n        movdqa    xmm7,xmm5\n        punpcklwd xmm0,xmm4\n        punpckhwd xmm7,xmm4\n        movdqa    xmm5,xmm0\n        movdqa    xmm4,xmm7\n        pmaddwd   xmm0,[rel PW_MF078_F117]      ; xmm0=z3L\n        pmaddwd   xmm7,[rel PW_MF078_F117]      ; xmm7=z3H\n        pmaddwd   xmm5,[rel PW_F117_F078]       ; xmm5=z4L\n        pmaddwd   xmm4,[rel PW_F117_F078]       ; xmm4=z4H\n\n        movdqa  XMMWORD [wk(10)], xmm0  ; wk(10)=z3L\n        movdqa  XMMWORD [wk(11)], xmm7  ; wk(11)=z3H\n\n        ; (Original)\n        ; z1 = tmp0 + tmp3;  z2 = tmp1 + tmp2;\n        ; tmp0 = tmp0 * 0.298631336;  tmp1 = tmp1 * 2.053119869;\n        ; tmp2 = tmp2 * 3.072711026;  tmp3 = tmp3 * 1.501321110;\n        ; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n        ; tmp0 += z1 + z3;  tmp1 += z2 + z4;\n        ; tmp2 += z2 + z3;  tmp3 += z1 + z4;\n        ;\n        ; (This implementation)\n        ; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223;\n        ; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447;\n        ; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447);\n        ; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223);\n        ; tmp0 += z3;  tmp1 += z4;\n        ; tmp2 += z3;  tmp3 += z4;\n\n        movdqa    xmm0,xmm1\n        movdqa    xmm7,xmm1\n        punpcklwd xmm0,xmm3\n        punpckhwd xmm7,xmm3\n        movdqa    xmm1,xmm0\n        movdqa    xmm3,xmm7\n        pmaddwd   xmm0,[rel PW_MF060_MF089]     ; xmm0=tmp0L\n        pmaddwd   xmm7,[rel PW_MF060_MF089]     ; xmm7=tmp0H\n        pmaddwd   xmm1,[rel PW_MF089_F060]      ; xmm1=tmp3L\n        pmaddwd   xmm3,[rel PW_MF089_F060]      ; xmm3=tmp3H\n\n        paddd   xmm0, XMMWORD [wk(10)]  ; xmm0=tmp0L\n        paddd   xmm7, XMMWORD [wk(11)]  ; xmm7=tmp0H\n        paddd   xmm1,xmm5               ; xmm1=tmp3L\n        paddd   xmm3,xmm4               ; xmm3=tmp3H\n\n        movdqa  XMMWORD [wk(8)], xmm0   ; wk(8)=tmp0L\n        movdqa  XMMWORD [wk(9)], xmm7   ; wk(9)=tmp0H\n\n        movdqa    xmm0,xmm2\n        movdqa    xmm7,xmm2\n        punpcklwd xmm0,xmm6\n        punpckhwd xmm7,xmm6\n        movdqa    xmm2,xmm0\n        movdqa    xmm6,xmm7\n        pmaddwd   xmm0,[rel PW_MF050_MF256]     ; xmm0=tmp1L\n        pmaddwd   xmm7,[rel PW_MF050_MF256]     ; xmm7=tmp1H\n        pmaddwd   xmm2,[rel PW_MF256_F050]      ; xmm2=tmp2L\n        pmaddwd   xmm6,[rel PW_MF256_F050]      ; xmm6=tmp2H\n\n        paddd   xmm0,xmm5               ; xmm0=tmp1L\n        paddd   xmm7,xmm4               ; xmm7=tmp1H\n        paddd   xmm2, XMMWORD [wk(10)]  ; xmm2=tmp2L\n        paddd   xmm6, XMMWORD [wk(11)]  ; xmm6=tmp2H\n\n        movdqa  XMMWORD [wk(10)], xmm0  ; wk(10)=tmp1L\n        movdqa  XMMWORD [wk(11)], xmm7  ; wk(11)=tmp1H\n\n        ; -- Final output stage\n\n        movdqa  xmm5, XMMWORD [wk(0)]   ; xmm5=tmp10L\n        movdqa  xmm4, XMMWORD [wk(1)]   ; xmm4=tmp10H\n\n        movdqa  xmm0,xmm5\n        movdqa  xmm7,xmm4\n        paddd   xmm5,xmm1               ; xmm5=data0L\n        paddd   xmm4,xmm3               ; xmm4=data0H\n        psubd   xmm0,xmm1               ; xmm0=data7L\n        psubd   xmm7,xmm3               ; xmm7=data7H\n\n        movdqa  xmm1,[rel PD_DESCALE_P2]        ; xmm1=[rel PD_DESCALE_P2]\n\n        paddd   xmm5,xmm1\n        paddd   xmm4,xmm1\n        psrad   xmm5,DESCALE_P2\n        psrad   xmm4,DESCALE_P2\n        paddd   xmm0,xmm1\n        paddd   xmm7,xmm1\n        psrad   xmm0,DESCALE_P2\n        psrad   xmm7,DESCALE_P2\n\n        packssdw  xmm5,xmm4             ; xmm5=data0=(00 10 20 30 40 50 60 70)\n        packssdw  xmm0,xmm7             ; xmm0=data7=(07 17 27 37 47 57 67 77)\n\n        movdqa  xmm3, XMMWORD [wk(4)]   ; xmm3=tmp11L\n        movdqa  xmm1, XMMWORD [wk(5)]   ; xmm1=tmp11H\n\n        movdqa  xmm4,xmm3\n        movdqa  xmm7,xmm1\n        paddd   xmm3,xmm2               ; xmm3=data1L\n        paddd   xmm1,xmm6               ; xmm1=data1H\n        psubd   xmm4,xmm2               ; xmm4=data6L\n        psubd   xmm7,xmm6               ; xmm7=data6H\n\n        movdqa  xmm2,[rel PD_DESCALE_P2]        ; xmm2=[rel PD_DESCALE_P2]\n\n        paddd   xmm3,xmm2\n        paddd   xmm1,xmm2\n        psrad   xmm3,DESCALE_P2\n        psrad   xmm1,DESCALE_P2\n        paddd   xmm4,xmm2\n        paddd   xmm7,xmm2\n        psrad   xmm4,DESCALE_P2\n        psrad   xmm7,DESCALE_P2\n\n        packssdw  xmm3,xmm1             ; xmm3=data1=(01 11 21 31 41 51 61 71)\n        packssdw  xmm4,xmm7             ; xmm4=data6=(06 16 26 36 46 56 66 76)\n\n        packsswb  xmm5,xmm4             ; xmm5=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n        packsswb  xmm3,xmm0             ; xmm3=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n        movdqa  xmm6, XMMWORD [wk(6)]   ; xmm6=tmp12L\n        movdqa  xmm2, XMMWORD [wk(7)]   ; xmm2=tmp12H\n        movdqa  xmm1, XMMWORD [wk(10)]  ; xmm1=tmp1L\n        movdqa  xmm7, XMMWORD [wk(11)]  ; xmm7=tmp1H\n\n        movdqa  XMMWORD [wk(0)], xmm5   ; wk(0)=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n        movdqa  XMMWORD [wk(1)], xmm3   ; wk(1)=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n        movdqa  xmm4,xmm6\n        movdqa  xmm0,xmm2\n        paddd   xmm6,xmm1               ; xmm6=data2L\n        paddd   xmm2,xmm7               ; xmm2=data2H\n        psubd   xmm4,xmm1               ; xmm4=data5L\n        psubd   xmm0,xmm7               ; xmm0=data5H\n\n        movdqa  xmm5,[rel PD_DESCALE_P2]        ; xmm5=[rel PD_DESCALE_P2]\n\n        paddd   xmm6,xmm5\n        paddd   xmm2,xmm5\n        psrad   xmm6,DESCALE_P2\n        psrad   xmm2,DESCALE_P2\n        paddd   xmm4,xmm5\n        paddd   xmm0,xmm5\n        psrad   xmm4,DESCALE_P2\n        psrad   xmm0,DESCALE_P2\n\n        packssdw  xmm6,xmm2             ; xmm6=data2=(02 12 22 32 42 52 62 72)\n        packssdw  xmm4,xmm0             ; xmm4=data5=(05 15 25 35 45 55 65 75)\n\n        movdqa  xmm3, XMMWORD [wk(2)]   ; xmm3=tmp13L\n        movdqa  xmm1, XMMWORD [wk(3)]   ; xmm1=tmp13H\n        movdqa  xmm7, XMMWORD [wk(8)]   ; xmm7=tmp0L\n        movdqa  xmm5, XMMWORD [wk(9)]   ; xmm5=tmp0H\n\n        movdqa  xmm2,xmm3\n        movdqa  xmm0,xmm1\n        paddd   xmm3,xmm7               ; xmm3=data3L\n        paddd   xmm1,xmm5               ; xmm1=data3H\n        psubd   xmm2,xmm7               ; xmm2=data4L\n        psubd   xmm0,xmm5               ; xmm0=data4H\n\n        movdqa  xmm7,[rel PD_DESCALE_P2]        ; xmm7=[rel PD_DESCALE_P2]\n\n        paddd   xmm3,xmm7\n        paddd   xmm1,xmm7\n        psrad   xmm3,DESCALE_P2\n        psrad   xmm1,DESCALE_P2\n        paddd   xmm2,xmm7\n        paddd   xmm0,xmm7\n        psrad   xmm2,DESCALE_P2\n        psrad   xmm0,DESCALE_P2\n\n        movdqa    xmm5,[rel PB_CENTERJSAMP]     ; xmm5=[rel PB_CENTERJSAMP]\n\n        packssdw  xmm3,xmm1             ; xmm3=data3=(03 13 23 33 43 53 63 73)\n        packssdw  xmm2,xmm0             ; xmm2=data4=(04 14 24 34 44 54 64 74)\n\n        movdqa    xmm7, XMMWORD [wk(0)] ; xmm7=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n        movdqa    xmm1, XMMWORD [wk(1)] ; xmm1=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n        packsswb  xmm6,xmm2             ; xmm6=(02 12 22 32 42 52 62 72 04 14 24 34 44 54 64 74)\n        packsswb  xmm3,xmm4             ; xmm3=(03 13 23 33 43 53 63 73 05 15 25 35 45 55 65 75)\n\n        paddb     xmm7,xmm5\n        paddb     xmm1,xmm5\n        paddb     xmm6,xmm5\n        paddb     xmm3,xmm5\n\n        movdqa    xmm0,xmm7     ; transpose coefficients(phase 1)\n        punpcklbw xmm7,xmm1     ; xmm7=(00 01 10 11 20 21 30 31 40 41 50 51 60 61 70 71)\n        punpckhbw xmm0,xmm1     ; xmm0=(06 07 16 17 26 27 36 37 46 47 56 57 66 67 76 77)\n        movdqa    xmm2,xmm6     ; transpose coefficients(phase 1)\n        punpcklbw xmm6,xmm3     ; xmm6=(02 03 12 13 22 23 32 33 42 43 52 53 62 63 72 73)\n        punpckhbw xmm2,xmm3     ; xmm2=(04 05 14 15 24 25 34 35 44 45 54 55 64 65 74 75)\n\n        movdqa    xmm4,xmm7     ; transpose coefficients(phase 2)\n        punpcklwd xmm7,xmm6     ; xmm7=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33)\n        punpckhwd xmm4,xmm6     ; xmm4=(40 41 42 43 50 51 52 53 60 61 62 63 70 71 72 73)\n        movdqa    xmm5,xmm2     ; transpose coefficients(phase 2)\n        punpcklwd xmm2,xmm0     ; xmm2=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37)\n        punpckhwd xmm5,xmm0     ; xmm5=(44 45 46 47 54 55 56 57 64 65 66 67 74 75 76 77)\n\n        movdqa    xmm1,xmm7     ; transpose coefficients(phase 3)\n        punpckldq xmm7,xmm2     ; xmm7=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17)\n        punpckhdq xmm1,xmm2     ; xmm1=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37)\n        movdqa    xmm3,xmm4     ; transpose coefficients(phase 3)\n        punpckldq xmm4,xmm5     ; xmm4=(40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57)\n        punpckhdq xmm3,xmm5     ; xmm3=(60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77)\n\n        pshufd  xmm6,xmm7,0x4E  ; xmm6=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07)\n        pshufd  xmm0,xmm1,0x4E  ; xmm0=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27)\n        pshufd  xmm2,xmm4,0x4E  ; xmm2=(50 51 52 53 54 55 56 57 40 41 42 43 44 45 46 47)\n        pshufd  xmm5,xmm3,0x4E  ; xmm5=(70 71 72 73 74 75 76 77 60 61 62 63 64 65 66 67)\n\n        mov     rdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW]\n        mov     rsi, JSAMPROW [rdi+2*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm7\n        movq    XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm1\n        mov     rdx, JSAMPROW [rdi+4*SIZEOF_JSAMPROW]\n        mov     rsi, JSAMPROW [rdi+6*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm4\n        movq    XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm3\n\n        mov     rdx, JSAMPROW [rdi+1*SIZEOF_JSAMPROW]\n        mov     rsi, JSAMPROW [rdi+3*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm6\n        movq    XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm0\n        mov     rdx, JSAMPROW [rdi+5*SIZEOF_JSAMPROW]\n        mov     rsi, JSAMPROW [rdi+7*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm2\n        movq    XMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm5\n\n        uncollect_args\n        mov     rsp,rbp         ; rsp <- aligned rbp\n        pop     rsp             ; rsp <- original rbp\n        pop     rbp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jidctint-sse2.asm",
    "content": ";\n; jidctint.asm - accurate integer IDCT (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a slow-but-accurate integer implementation of the\n; inverse DCT (Discrete Cosine Transform). The following code is based\n; directly on the IJG's original jidctint.c; see the jidctint.c for\n; more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS      13\n%define PASS1_BITS      2\n\n%define DESCALE_P1      (CONST_BITS-PASS1_BITS)\n%define DESCALE_P2      (CONST_BITS+PASS1_BITS+3)\n\n%if CONST_BITS == 13\nF_0_298 equ      2446           ; FIX(0.298631336)\nF_0_390 equ      3196           ; FIX(0.390180644)\nF_0_541 equ      4433           ; FIX(0.541196100)\nF_0_765 equ      6270           ; FIX(0.765366865)\nF_0_899 equ      7373           ; FIX(0.899976223)\nF_1_175 equ      9633           ; FIX(1.175875602)\nF_1_501 equ     12299           ; FIX(1.501321110)\nF_1_847 equ     15137           ; FIX(1.847759065)\nF_1_961 equ     16069           ; FIX(1.961570560)\nF_2_053 equ     16819           ; FIX(2.053119869)\nF_2_562 equ     20995           ; FIX(2.562915447)\nF_3_072 equ     25172           ; FIX(3.072711026)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_298 equ     DESCALE( 320652955,30-CONST_BITS)       ; FIX(0.298631336)\nF_0_390 equ     DESCALE( 418953276,30-CONST_BITS)       ; FIX(0.390180644)\nF_0_541 equ     DESCALE( 581104887,30-CONST_BITS)       ; FIX(0.541196100)\nF_0_765 equ     DESCALE( 821806413,30-CONST_BITS)       ; FIX(0.765366865)\nF_0_899 equ     DESCALE( 966342111,30-CONST_BITS)       ; FIX(0.899976223)\nF_1_175 equ     DESCALE(1262586813,30-CONST_BITS)       ; FIX(1.175875602)\nF_1_501 equ     DESCALE(1612031267,30-CONST_BITS)       ; FIX(1.501321110)\nF_1_847 equ     DESCALE(1984016188,30-CONST_BITS)       ; FIX(1.847759065)\nF_1_961 equ     DESCALE(2106220350,30-CONST_BITS)       ; FIX(1.961570560)\nF_2_053 equ     DESCALE(2204520673,30-CONST_BITS)       ; FIX(2.053119869)\nF_2_562 equ     DESCALE(2751909506,30-CONST_BITS)       ; FIX(2.562915447)\nF_3_072 equ     DESCALE(3299298341,30-CONST_BITS)       ; FIX(3.072711026)\n%endif\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_idct_islow_sse2)\n\nEXTN(jconst_idct_islow_sse2):\n\nPW_F130_F054    times 4 dw  (F_0_541+F_0_765), F_0_541\nPW_F054_MF130   times 4 dw  F_0_541, (F_0_541-F_1_847)\nPW_MF078_F117   times 4 dw  (F_1_175-F_1_961), F_1_175\nPW_F117_F078    times 4 dw  F_1_175, (F_1_175-F_0_390)\nPW_MF060_MF089  times 4 dw  (F_0_298-F_0_899),-F_0_899\nPW_MF089_F060   times 4 dw -F_0_899, (F_1_501-F_0_899)\nPW_MF050_MF256  times 4 dw  (F_2_053-F_2_562),-F_2_562\nPW_MF256_F050   times 4 dw -F_2_562, (F_3_072-F_2_562)\nPD_DESCALE_P1   times 4 dd  1 << (DESCALE_P1-1)\nPD_DESCALE_P2   times 4 dd  1 << (DESCALE_P2-1)\nPB_CENTERJSAMP  times 16 db CENTERJSAMPLE\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_islow_sse2 (void *dct_table, JCOEFPTR coef_block,\n;                        JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)    (b)+8           ; jpeg_component_info *compptr\n%define coef_block(b)   (b)+12          ; JCOEFPTR coef_block\n%define output_buf(b)   (b)+16          ; JSAMPARRAY output_buf\n%define output_col(b)   (b)+20          ; JDIMENSION output_col\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          12\n\n        align   16\n        global  EXTN(jsimd_idct_islow_sse2)\n\nEXTN(jsimd_idct_islow_sse2):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic ebx\n;       push    ecx             ; unused\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process columns from input.\n\n;       mov     eax, [original_ebp]\n        mov     edx, POINTER [dct_table(eax)]           ; quantptr\n        mov     esi, JCOEFPTR [coef_block(eax)]         ; inptr\n\n%ifndef NO_ZERO_COLUMN_TEST_ISLOW_SSE2\n        mov     eax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        or      eax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        jnz     near .columnDCT\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        por     xmm1, XMMWORD [XMMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        por     xmm1, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        por     xmm1,xmm0\n        packsswb xmm1,xmm1\n        packsswb xmm1,xmm1\n        movd    eax,xmm1\n        test    eax,eax\n        jnz     short .columnDCT\n\n        ; -- AC terms all zero\n\n        movdqa  xmm5, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm5, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        psllw   xmm5,PASS1_BITS\n\n        movdqa    xmm4,xmm5             ; xmm5=in0=(00 01 02 03 04 05 06 07)\n        punpcklwd xmm5,xmm5             ; xmm5=(00 00 01 01 02 02 03 03)\n        punpckhwd xmm4,xmm4             ; xmm4=(04 04 05 05 06 06 07 07)\n\n        pshufd  xmm7,xmm5,0x00          ; xmm7=col0=(00 00 00 00 00 00 00 00)\n        pshufd  xmm6,xmm5,0x55          ; xmm6=col1=(01 01 01 01 01 01 01 01)\n        pshufd  xmm1,xmm5,0xAA          ; xmm1=col2=(02 02 02 02 02 02 02 02)\n        pshufd  xmm5,xmm5,0xFF          ; xmm5=col3=(03 03 03 03 03 03 03 03)\n        pshufd  xmm0,xmm4,0x00          ; xmm0=col4=(04 04 04 04 04 04 04 04)\n        pshufd  xmm3,xmm4,0x55          ; xmm3=col5=(05 05 05 05 05 05 05 05)\n        pshufd  xmm2,xmm4,0xAA          ; xmm2=col6=(06 06 06 06 06 06 06 06)\n        pshufd  xmm4,xmm4,0xFF          ; xmm4=col7=(07 07 07 07 07 07 07 07)\n\n        movdqa  XMMWORD [wk(8)], xmm6   ; wk(8)=col1\n        movdqa  XMMWORD [wk(9)], xmm5   ; wk(9)=col3\n        movdqa  XMMWORD [wk(10)], xmm3  ; wk(10)=col5\n        movdqa  XMMWORD [wk(11)], xmm4  ; wk(11)=col7\n        jmp     near .column_end\n        alignx  16,7\n%endif\n.columnDCT:\n\n        ; -- Even part\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm1, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        movdqa  xmm2, XMMWORD [XMMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm2, XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm3, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        ; (Original)\n        ; z1 = (z2 + z3) * 0.541196100;\n        ; tmp2 = z1 + z3 * -1.847759065;\n        ; tmp3 = z1 + z2 * 0.765366865;\n        ;\n        ; (This implementation)\n        ; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065);\n        ; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100;\n\n        movdqa    xmm4,xmm1             ; xmm1=in2=z2\n        movdqa    xmm5,xmm1\n        punpcklwd xmm4,xmm3             ; xmm3=in6=z3\n        punpckhwd xmm5,xmm3\n        movdqa    xmm1,xmm4\n        movdqa    xmm3,xmm5\n        pmaddwd   xmm4,[GOTOFF(ebx,PW_F130_F054)]       ; xmm4=tmp3L\n        pmaddwd   xmm5,[GOTOFF(ebx,PW_F130_F054)]       ; xmm5=tmp3H\n        pmaddwd   xmm1,[GOTOFF(ebx,PW_F054_MF130)]      ; xmm1=tmp2L\n        pmaddwd   xmm3,[GOTOFF(ebx,PW_F054_MF130)]      ; xmm3=tmp2H\n\n        movdqa    xmm6,xmm0\n        paddw     xmm0,xmm2             ; xmm0=in0+in4\n        psubw     xmm6,xmm2             ; xmm6=in0-in4\n\n        pxor      xmm7,xmm7\n        pxor      xmm2,xmm2\n        punpcklwd xmm7,xmm0             ; xmm7=tmp0L\n        punpckhwd xmm2,xmm0             ; xmm2=tmp0H\n        psrad     xmm7,(16-CONST_BITS)  ; psrad xmm7,16 & pslld xmm7,CONST_BITS\n        psrad     xmm2,(16-CONST_BITS)  ; psrad xmm2,16 & pslld xmm2,CONST_BITS\n\n        movdqa  xmm0,xmm7\n        paddd   xmm7,xmm4               ; xmm7=tmp10L\n        psubd   xmm0,xmm4               ; xmm0=tmp13L\n        movdqa  xmm4,xmm2\n        paddd   xmm2,xmm5               ; xmm2=tmp10H\n        psubd   xmm4,xmm5               ; xmm4=tmp13H\n\n        movdqa  XMMWORD [wk(0)], xmm7   ; wk(0)=tmp10L\n        movdqa  XMMWORD [wk(1)], xmm2   ; wk(1)=tmp10H\n        movdqa  XMMWORD [wk(2)], xmm0   ; wk(2)=tmp13L\n        movdqa  XMMWORD [wk(3)], xmm4   ; wk(3)=tmp13H\n\n        pxor      xmm5,xmm5\n        pxor      xmm7,xmm7\n        punpcklwd xmm5,xmm6             ; xmm5=tmp1L\n        punpckhwd xmm7,xmm6             ; xmm7=tmp1H\n        psrad     xmm5,(16-CONST_BITS)  ; psrad xmm5,16 & pslld xmm5,CONST_BITS\n        psrad     xmm7,(16-CONST_BITS)  ; psrad xmm7,16 & pslld xmm7,CONST_BITS\n\n        movdqa  xmm2,xmm5\n        paddd   xmm5,xmm1               ; xmm5=tmp11L\n        psubd   xmm2,xmm1               ; xmm2=tmp12L\n        movdqa  xmm0,xmm7\n        paddd   xmm7,xmm3               ; xmm7=tmp11H\n        psubd   xmm0,xmm3               ; xmm0=tmp12H\n\n        movdqa  XMMWORD [wk(4)], xmm5   ; wk(4)=tmp11L\n        movdqa  XMMWORD [wk(5)], xmm7   ; wk(5)=tmp11H\n        movdqa  XMMWORD [wk(6)], xmm2   ; wk(6)=tmp12L\n        movdqa  XMMWORD [wk(7)], xmm0   ; wk(7)=tmp12H\n\n        ; -- Odd part\n\n        movdqa  xmm4, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm6, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm4, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm6, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm1, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm3, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        movdqa  xmm5,xmm6\n        movdqa  xmm7,xmm4\n        paddw   xmm5,xmm3               ; xmm5=z3\n        paddw   xmm7,xmm1               ; xmm7=z4\n\n        ; (Original)\n        ; z5 = (z3 + z4) * 1.175875602;\n        ; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n        ; z3 += z5;  z4 += z5;\n        ;\n        ; (This implementation)\n        ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n        ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n        movdqa    xmm2,xmm5\n        movdqa    xmm0,xmm5\n        punpcklwd xmm2,xmm7\n        punpckhwd xmm0,xmm7\n        movdqa    xmm5,xmm2\n        movdqa    xmm7,xmm0\n        pmaddwd   xmm2,[GOTOFF(ebx,PW_MF078_F117)]      ; xmm2=z3L\n        pmaddwd   xmm0,[GOTOFF(ebx,PW_MF078_F117)]      ; xmm0=z3H\n        pmaddwd   xmm5,[GOTOFF(ebx,PW_F117_F078)]       ; xmm5=z4L\n        pmaddwd   xmm7,[GOTOFF(ebx,PW_F117_F078)]       ; xmm7=z4H\n\n        movdqa  XMMWORD [wk(10)], xmm2  ; wk(10)=z3L\n        movdqa  XMMWORD [wk(11)], xmm0  ; wk(11)=z3H\n\n        ; (Original)\n        ; z1 = tmp0 + tmp3;  z2 = tmp1 + tmp2;\n        ; tmp0 = tmp0 * 0.298631336;  tmp1 = tmp1 * 2.053119869;\n        ; tmp2 = tmp2 * 3.072711026;  tmp3 = tmp3 * 1.501321110;\n        ; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n        ; tmp0 += z1 + z3;  tmp1 += z2 + z4;\n        ; tmp2 += z2 + z3;  tmp3 += z1 + z4;\n        ;\n        ; (This implementation)\n        ; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223;\n        ; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447;\n        ; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447);\n        ; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223);\n        ; tmp0 += z3;  tmp1 += z4;\n        ; tmp2 += z3;  tmp3 += z4;\n\n        movdqa    xmm2,xmm3\n        movdqa    xmm0,xmm3\n        punpcklwd xmm2,xmm4\n        punpckhwd xmm0,xmm4\n        movdqa    xmm3,xmm2\n        movdqa    xmm4,xmm0\n        pmaddwd   xmm2,[GOTOFF(ebx,PW_MF060_MF089)]     ; xmm2=tmp0L\n        pmaddwd   xmm0,[GOTOFF(ebx,PW_MF060_MF089)]     ; xmm0=tmp0H\n        pmaddwd   xmm3,[GOTOFF(ebx,PW_MF089_F060)]      ; xmm3=tmp3L\n        pmaddwd   xmm4,[GOTOFF(ebx,PW_MF089_F060)]      ; xmm4=tmp3H\n\n        paddd   xmm2, XMMWORD [wk(10)]  ; xmm2=tmp0L\n        paddd   xmm0, XMMWORD [wk(11)]  ; xmm0=tmp0H\n        paddd   xmm3,xmm5               ; xmm3=tmp3L\n        paddd   xmm4,xmm7               ; xmm4=tmp3H\n\n        movdqa  XMMWORD [wk(8)], xmm2   ; wk(8)=tmp0L\n        movdqa  XMMWORD [wk(9)], xmm0   ; wk(9)=tmp0H\n\n        movdqa    xmm2,xmm1\n        movdqa    xmm0,xmm1\n        punpcklwd xmm2,xmm6\n        punpckhwd xmm0,xmm6\n        movdqa    xmm1,xmm2\n        movdqa    xmm6,xmm0\n        pmaddwd   xmm2,[GOTOFF(ebx,PW_MF050_MF256)]     ; xmm2=tmp1L\n        pmaddwd   xmm0,[GOTOFF(ebx,PW_MF050_MF256)]     ; xmm0=tmp1H\n        pmaddwd   xmm1,[GOTOFF(ebx,PW_MF256_F050)]      ; xmm1=tmp2L\n        pmaddwd   xmm6,[GOTOFF(ebx,PW_MF256_F050)]      ; xmm6=tmp2H\n\n        paddd   xmm2,xmm5               ; xmm2=tmp1L\n        paddd   xmm0,xmm7               ; xmm0=tmp1H\n        paddd   xmm1, XMMWORD [wk(10)]  ; xmm1=tmp2L\n        paddd   xmm6, XMMWORD [wk(11)]  ; xmm6=tmp2H\n\n        movdqa  XMMWORD [wk(10)], xmm2  ; wk(10)=tmp1L\n        movdqa  XMMWORD [wk(11)], xmm0  ; wk(11)=tmp1H\n\n        ; -- Final output stage\n\n        movdqa  xmm5, XMMWORD [wk(0)]   ; xmm5=tmp10L\n        movdqa  xmm7, XMMWORD [wk(1)]   ; xmm7=tmp10H\n\n        movdqa  xmm2,xmm5\n        movdqa  xmm0,xmm7\n        paddd   xmm5,xmm3               ; xmm5=data0L\n        paddd   xmm7,xmm4               ; xmm7=data0H\n        psubd   xmm2,xmm3               ; xmm2=data7L\n        psubd   xmm0,xmm4               ; xmm0=data7H\n\n        movdqa  xmm3,[GOTOFF(ebx,PD_DESCALE_P1)]        ; xmm3=[PD_DESCALE_P1]\n\n        paddd   xmm5,xmm3\n        paddd   xmm7,xmm3\n        psrad   xmm5,DESCALE_P1\n        psrad   xmm7,DESCALE_P1\n        paddd   xmm2,xmm3\n        paddd   xmm0,xmm3\n        psrad   xmm2,DESCALE_P1\n        psrad   xmm0,DESCALE_P1\n\n        packssdw  xmm5,xmm7             ; xmm5=data0=(00 01 02 03 04 05 06 07)\n        packssdw  xmm2,xmm0             ; xmm2=data7=(70 71 72 73 74 75 76 77)\n\n        movdqa  xmm4, XMMWORD [wk(4)]   ; xmm4=tmp11L\n        movdqa  xmm3, XMMWORD [wk(5)]   ; xmm3=tmp11H\n\n        movdqa  xmm7,xmm4\n        movdqa  xmm0,xmm3\n        paddd   xmm4,xmm1               ; xmm4=data1L\n        paddd   xmm3,xmm6               ; xmm3=data1H\n        psubd   xmm7,xmm1               ; xmm7=data6L\n        psubd   xmm0,xmm6               ; xmm0=data6H\n\n        movdqa  xmm1,[GOTOFF(ebx,PD_DESCALE_P1)]        ; xmm1=[PD_DESCALE_P1]\n\n        paddd   xmm4,xmm1\n        paddd   xmm3,xmm1\n        psrad   xmm4,DESCALE_P1\n        psrad   xmm3,DESCALE_P1\n        paddd   xmm7,xmm1\n        paddd   xmm0,xmm1\n        psrad   xmm7,DESCALE_P1\n        psrad   xmm0,DESCALE_P1\n\n        packssdw  xmm4,xmm3             ; xmm4=data1=(10 11 12 13 14 15 16 17)\n        packssdw  xmm7,xmm0             ; xmm7=data6=(60 61 62 63 64 65 66 67)\n\n        movdqa    xmm6,xmm5             ; transpose coefficients(phase 1)\n        punpcklwd xmm5,xmm4             ; xmm5=(00 10 01 11 02 12 03 13)\n        punpckhwd xmm6,xmm4             ; xmm6=(04 14 05 15 06 16 07 17)\n        movdqa    xmm1,xmm7             ; transpose coefficients(phase 1)\n        punpcklwd xmm7,xmm2             ; xmm7=(60 70 61 71 62 72 63 73)\n        punpckhwd xmm1,xmm2             ; xmm1=(64 74 65 75 66 76 67 77)\n\n        movdqa  xmm3, XMMWORD [wk(6)]   ; xmm3=tmp12L\n        movdqa  xmm0, XMMWORD [wk(7)]   ; xmm0=tmp12H\n        movdqa  xmm4, XMMWORD [wk(10)]  ; xmm4=tmp1L\n        movdqa  xmm2, XMMWORD [wk(11)]  ; xmm2=tmp1H\n\n        movdqa  XMMWORD [wk(0)], xmm5   ; wk(0)=(00 10 01 11 02 12 03 13)\n        movdqa  XMMWORD [wk(1)], xmm6   ; wk(1)=(04 14 05 15 06 16 07 17)\n        movdqa  XMMWORD [wk(4)], xmm7   ; wk(4)=(60 70 61 71 62 72 63 73)\n        movdqa  XMMWORD [wk(5)], xmm1   ; wk(5)=(64 74 65 75 66 76 67 77)\n\n        movdqa  xmm5,xmm3\n        movdqa  xmm6,xmm0\n        paddd   xmm3,xmm4               ; xmm3=data2L\n        paddd   xmm0,xmm2               ; xmm0=data2H\n        psubd   xmm5,xmm4               ; xmm5=data5L\n        psubd   xmm6,xmm2               ; xmm6=data5H\n\n        movdqa  xmm7,[GOTOFF(ebx,PD_DESCALE_P1)]        ; xmm7=[PD_DESCALE_P1]\n\n        paddd   xmm3,xmm7\n        paddd   xmm0,xmm7\n        psrad   xmm3,DESCALE_P1\n        psrad   xmm0,DESCALE_P1\n        paddd   xmm5,xmm7\n        paddd   xmm6,xmm7\n        psrad   xmm5,DESCALE_P1\n        psrad   xmm6,DESCALE_P1\n\n        packssdw  xmm3,xmm0             ; xmm3=data2=(20 21 22 23 24 25 26 27)\n        packssdw  xmm5,xmm6             ; xmm5=data5=(50 51 52 53 54 55 56 57)\n\n        movdqa  xmm1, XMMWORD [wk(2)]   ; xmm1=tmp13L\n        movdqa  xmm4, XMMWORD [wk(3)]   ; xmm4=tmp13H\n        movdqa  xmm2, XMMWORD [wk(8)]   ; xmm2=tmp0L\n        movdqa  xmm7, XMMWORD [wk(9)]   ; xmm7=tmp0H\n\n        movdqa  xmm0,xmm1\n        movdqa  xmm6,xmm4\n        paddd   xmm1,xmm2               ; xmm1=data3L\n        paddd   xmm4,xmm7               ; xmm4=data3H\n        psubd   xmm0,xmm2               ; xmm0=data4L\n        psubd   xmm6,xmm7               ; xmm6=data4H\n\n        movdqa  xmm2,[GOTOFF(ebx,PD_DESCALE_P1)]        ; xmm2=[PD_DESCALE_P1]\n\n        paddd   xmm1,xmm2\n        paddd   xmm4,xmm2\n        psrad   xmm1,DESCALE_P1\n        psrad   xmm4,DESCALE_P1\n        paddd   xmm0,xmm2\n        paddd   xmm6,xmm2\n        psrad   xmm0,DESCALE_P1\n        psrad   xmm6,DESCALE_P1\n\n        packssdw  xmm1,xmm4             ; xmm1=data3=(30 31 32 33 34 35 36 37)\n        packssdw  xmm0,xmm6             ; xmm0=data4=(40 41 42 43 44 45 46 47)\n\n        movdqa  xmm7, XMMWORD [wk(0)]   ; xmm7=(00 10 01 11 02 12 03 13)\n        movdqa  xmm2, XMMWORD [wk(1)]   ; xmm2=(04 14 05 15 06 16 07 17)\n\n        movdqa    xmm4,xmm3             ; transpose coefficients(phase 1)\n        punpcklwd xmm3,xmm1             ; xmm3=(20 30 21 31 22 32 23 33)\n        punpckhwd xmm4,xmm1             ; xmm4=(24 34 25 35 26 36 27 37)\n        movdqa    xmm6,xmm0             ; transpose coefficients(phase 1)\n        punpcklwd xmm0,xmm5             ; xmm0=(40 50 41 51 42 52 43 53)\n        punpckhwd xmm6,xmm5             ; xmm6=(44 54 45 55 46 56 47 57)\n\n        movdqa    xmm1,xmm7             ; transpose coefficients(phase 2)\n        punpckldq xmm7,xmm3             ; xmm7=(00 10 20 30 01 11 21 31)\n        punpckhdq xmm1,xmm3             ; xmm1=(02 12 22 32 03 13 23 33)\n        movdqa    xmm5,xmm2             ; transpose coefficients(phase 2)\n        punpckldq xmm2,xmm4             ; xmm2=(04 14 24 34 05 15 25 35)\n        punpckhdq xmm5,xmm4             ; xmm5=(06 16 26 36 07 17 27 37)\n\n        movdqa  xmm3, XMMWORD [wk(4)]   ; xmm3=(60 70 61 71 62 72 63 73)\n        movdqa  xmm4, XMMWORD [wk(5)]   ; xmm4=(64 74 65 75 66 76 67 77)\n\n        movdqa  XMMWORD [wk(6)], xmm2   ; wk(6)=(04 14 24 34 05 15 25 35)\n        movdqa  XMMWORD [wk(7)], xmm5   ; wk(7)=(06 16 26 36 07 17 27 37)\n\n        movdqa    xmm2,xmm0             ; transpose coefficients(phase 2)\n        punpckldq xmm0,xmm3             ; xmm0=(40 50 60 70 41 51 61 71)\n        punpckhdq xmm2,xmm3             ; xmm2=(42 52 62 72 43 53 63 73)\n        movdqa    xmm5,xmm6             ; transpose coefficients(phase 2)\n        punpckldq xmm6,xmm4             ; xmm6=(44 54 64 74 45 55 65 75)\n        punpckhdq xmm5,xmm4             ; xmm5=(46 56 66 76 47 57 67 77)\n\n        movdqa     xmm3,xmm7            ; transpose coefficients(phase 3)\n        punpcklqdq xmm7,xmm0            ; xmm7=col0=(00 10 20 30 40 50 60 70)\n        punpckhqdq xmm3,xmm0            ; xmm3=col1=(01 11 21 31 41 51 61 71)\n        movdqa     xmm4,xmm1            ; transpose coefficients(phase 3)\n        punpcklqdq xmm1,xmm2            ; xmm1=col2=(02 12 22 32 42 52 62 72)\n        punpckhqdq xmm4,xmm2            ; xmm4=col3=(03 13 23 33 43 53 63 73)\n\n        movdqa  xmm0, XMMWORD [wk(6)]   ; xmm0=(04 14 24 34 05 15 25 35)\n        movdqa  xmm2, XMMWORD [wk(7)]   ; xmm2=(06 16 26 36 07 17 27 37)\n\n        movdqa  XMMWORD [wk(8)], xmm3   ; wk(8)=col1\n        movdqa  XMMWORD [wk(9)], xmm4   ; wk(9)=col3\n\n        movdqa     xmm3,xmm0            ; transpose coefficients(phase 3)\n        punpcklqdq xmm0,xmm6            ; xmm0=col4=(04 14 24 34 44 54 64 74)\n        punpckhqdq xmm3,xmm6            ; xmm3=col5=(05 15 25 35 45 55 65 75)\n        movdqa     xmm4,xmm2            ; transpose coefficients(phase 3)\n        punpcklqdq xmm2,xmm5            ; xmm2=col6=(06 16 26 36 46 56 66 76)\n        punpckhqdq xmm4,xmm5            ; xmm4=col7=(07 17 27 37 47 57 67 77)\n\n        movdqa  XMMWORD [wk(10)], xmm3  ; wk(10)=col5\n        movdqa  XMMWORD [wk(11)], xmm4  ; wk(11)=col7\n.column_end:\n\n        ; -- Prefetch the next coefficient block\n\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n        ; ---- Pass 2: process rows from work array, store into output array.\n\n        mov     eax, [original_ebp]\n        mov     edi, JSAMPARRAY [output_buf(eax)]       ; (JSAMPROW *)\n        mov     eax, JDIMENSION [output_col(eax)]\n\n        ; -- Even part\n\n        ; xmm7=col0, xmm1=col2, xmm0=col4, xmm2=col6\n\n        ; (Original)\n        ; z1 = (z2 + z3) * 0.541196100;\n        ; tmp2 = z1 + z3 * -1.847759065;\n        ; tmp3 = z1 + z2 * 0.765366865;\n        ;\n        ; (This implementation)\n        ; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065);\n        ; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100;\n\n        movdqa    xmm6,xmm1             ; xmm1=in2=z2\n        movdqa    xmm5,xmm1\n        punpcklwd xmm6,xmm2             ; xmm2=in6=z3\n        punpckhwd xmm5,xmm2\n        movdqa    xmm1,xmm6\n        movdqa    xmm2,xmm5\n        pmaddwd   xmm6,[GOTOFF(ebx,PW_F130_F054)]       ; xmm6=tmp3L\n        pmaddwd   xmm5,[GOTOFF(ebx,PW_F130_F054)]       ; xmm5=tmp3H\n        pmaddwd   xmm1,[GOTOFF(ebx,PW_F054_MF130)]      ; xmm1=tmp2L\n        pmaddwd   xmm2,[GOTOFF(ebx,PW_F054_MF130)]      ; xmm2=tmp2H\n\n        movdqa    xmm3,xmm7\n        paddw     xmm7,xmm0             ; xmm7=in0+in4\n        psubw     xmm3,xmm0             ; xmm3=in0-in4\n\n        pxor      xmm4,xmm4\n        pxor      xmm0,xmm0\n        punpcklwd xmm4,xmm7             ; xmm4=tmp0L\n        punpckhwd xmm0,xmm7             ; xmm0=tmp0H\n        psrad     xmm4,(16-CONST_BITS)  ; psrad xmm4,16 & pslld xmm4,CONST_BITS\n        psrad     xmm0,(16-CONST_BITS)  ; psrad xmm0,16 & pslld xmm0,CONST_BITS\n\n        movdqa  xmm7,xmm4\n        paddd   xmm4,xmm6               ; xmm4=tmp10L\n        psubd   xmm7,xmm6               ; xmm7=tmp13L\n        movdqa  xmm6,xmm0\n        paddd   xmm0,xmm5               ; xmm0=tmp10H\n        psubd   xmm6,xmm5               ; xmm6=tmp13H\n\n        movdqa  XMMWORD [wk(0)], xmm4   ; wk(0)=tmp10L\n        movdqa  XMMWORD [wk(1)], xmm0   ; wk(1)=tmp10H\n        movdqa  XMMWORD [wk(2)], xmm7   ; wk(2)=tmp13L\n        movdqa  XMMWORD [wk(3)], xmm6   ; wk(3)=tmp13H\n\n        pxor      xmm5,xmm5\n        pxor      xmm4,xmm4\n        punpcklwd xmm5,xmm3             ; xmm5=tmp1L\n        punpckhwd xmm4,xmm3             ; xmm4=tmp1H\n        psrad     xmm5,(16-CONST_BITS)  ; psrad xmm5,16 & pslld xmm5,CONST_BITS\n        psrad     xmm4,(16-CONST_BITS)  ; psrad xmm4,16 & pslld xmm4,CONST_BITS\n\n        movdqa  xmm0,xmm5\n        paddd   xmm5,xmm1               ; xmm5=tmp11L\n        psubd   xmm0,xmm1               ; xmm0=tmp12L\n        movdqa  xmm7,xmm4\n        paddd   xmm4,xmm2               ; xmm4=tmp11H\n        psubd   xmm7,xmm2               ; xmm7=tmp12H\n\n        movdqa  XMMWORD [wk(4)], xmm5   ; wk(4)=tmp11L\n        movdqa  XMMWORD [wk(5)], xmm4   ; wk(5)=tmp11H\n        movdqa  XMMWORD [wk(6)], xmm0   ; wk(6)=tmp12L\n        movdqa  XMMWORD [wk(7)], xmm7   ; wk(7)=tmp12H\n\n        ; -- Odd part\n\n        movdqa  xmm6, XMMWORD [wk(9)]   ; xmm6=col3\n        movdqa  xmm3, XMMWORD [wk(8)]   ; xmm3=col1\n        movdqa  xmm1, XMMWORD [wk(11)]  ; xmm1=col7\n        movdqa  xmm2, XMMWORD [wk(10)]  ; xmm2=col5\n\n        movdqa  xmm5,xmm6\n        movdqa  xmm4,xmm3\n        paddw   xmm5,xmm1               ; xmm5=z3\n        paddw   xmm4,xmm2               ; xmm4=z4\n\n        ; (Original)\n        ; z5 = (z3 + z4) * 1.175875602;\n        ; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n        ; z3 += z5;  z4 += z5;\n        ;\n        ; (This implementation)\n        ; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n        ; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n        movdqa    xmm0,xmm5\n        movdqa    xmm7,xmm5\n        punpcklwd xmm0,xmm4\n        punpckhwd xmm7,xmm4\n        movdqa    xmm5,xmm0\n        movdqa    xmm4,xmm7\n        pmaddwd   xmm0,[GOTOFF(ebx,PW_MF078_F117)]      ; xmm0=z3L\n        pmaddwd   xmm7,[GOTOFF(ebx,PW_MF078_F117)]      ; xmm7=z3H\n        pmaddwd   xmm5,[GOTOFF(ebx,PW_F117_F078)]       ; xmm5=z4L\n        pmaddwd   xmm4,[GOTOFF(ebx,PW_F117_F078)]       ; xmm4=z4H\n\n        movdqa  XMMWORD [wk(10)], xmm0  ; wk(10)=z3L\n        movdqa  XMMWORD [wk(11)], xmm7  ; wk(11)=z3H\n\n        ; (Original)\n        ; z1 = tmp0 + tmp3;  z2 = tmp1 + tmp2;\n        ; tmp0 = tmp0 * 0.298631336;  tmp1 = tmp1 * 2.053119869;\n        ; tmp2 = tmp2 * 3.072711026;  tmp3 = tmp3 * 1.501321110;\n        ; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n        ; tmp0 += z1 + z3;  tmp1 += z2 + z4;\n        ; tmp2 += z2 + z3;  tmp3 += z1 + z4;\n        ;\n        ; (This implementation)\n        ; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223;\n        ; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447;\n        ; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447);\n        ; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223);\n        ; tmp0 += z3;  tmp1 += z4;\n        ; tmp2 += z3;  tmp3 += z4;\n\n        movdqa    xmm0,xmm1\n        movdqa    xmm7,xmm1\n        punpcklwd xmm0,xmm3\n        punpckhwd xmm7,xmm3\n        movdqa    xmm1,xmm0\n        movdqa    xmm3,xmm7\n        pmaddwd   xmm0,[GOTOFF(ebx,PW_MF060_MF089)]     ; xmm0=tmp0L\n        pmaddwd   xmm7,[GOTOFF(ebx,PW_MF060_MF089)]     ; xmm7=tmp0H\n        pmaddwd   xmm1,[GOTOFF(ebx,PW_MF089_F060)]      ; xmm1=tmp3L\n        pmaddwd   xmm3,[GOTOFF(ebx,PW_MF089_F060)]      ; xmm3=tmp3H\n\n        paddd   xmm0, XMMWORD [wk(10)]  ; xmm0=tmp0L\n        paddd   xmm7, XMMWORD [wk(11)]  ; xmm7=tmp0H\n        paddd   xmm1,xmm5               ; xmm1=tmp3L\n        paddd   xmm3,xmm4               ; xmm3=tmp3H\n\n        movdqa  XMMWORD [wk(8)], xmm0   ; wk(8)=tmp0L\n        movdqa  XMMWORD [wk(9)], xmm7   ; wk(9)=tmp0H\n\n        movdqa    xmm0,xmm2\n        movdqa    xmm7,xmm2\n        punpcklwd xmm0,xmm6\n        punpckhwd xmm7,xmm6\n        movdqa    xmm2,xmm0\n        movdqa    xmm6,xmm7\n        pmaddwd   xmm0,[GOTOFF(ebx,PW_MF050_MF256)]     ; xmm0=tmp1L\n        pmaddwd   xmm7,[GOTOFF(ebx,PW_MF050_MF256)]     ; xmm7=tmp1H\n        pmaddwd   xmm2,[GOTOFF(ebx,PW_MF256_F050)]      ; xmm2=tmp2L\n        pmaddwd   xmm6,[GOTOFF(ebx,PW_MF256_F050)]      ; xmm6=tmp2H\n\n        paddd   xmm0,xmm5               ; xmm0=tmp1L\n        paddd   xmm7,xmm4               ; xmm7=tmp1H\n        paddd   xmm2, XMMWORD [wk(10)]  ; xmm2=tmp2L\n        paddd   xmm6, XMMWORD [wk(11)]  ; xmm6=tmp2H\n\n        movdqa  XMMWORD [wk(10)], xmm0  ; wk(10)=tmp1L\n        movdqa  XMMWORD [wk(11)], xmm7  ; wk(11)=tmp1H\n\n        ; -- Final output stage\n\n        movdqa  xmm5, XMMWORD [wk(0)]   ; xmm5=tmp10L\n        movdqa  xmm4, XMMWORD [wk(1)]   ; xmm4=tmp10H\n\n        movdqa  xmm0,xmm5\n        movdqa  xmm7,xmm4\n        paddd   xmm5,xmm1               ; xmm5=data0L\n        paddd   xmm4,xmm3               ; xmm4=data0H\n        psubd   xmm0,xmm1               ; xmm0=data7L\n        psubd   xmm7,xmm3               ; xmm7=data7H\n\n        movdqa  xmm1,[GOTOFF(ebx,PD_DESCALE_P2)]        ; xmm1=[PD_DESCALE_P2]\n\n        paddd   xmm5,xmm1\n        paddd   xmm4,xmm1\n        psrad   xmm5,DESCALE_P2\n        psrad   xmm4,DESCALE_P2\n        paddd   xmm0,xmm1\n        paddd   xmm7,xmm1\n        psrad   xmm0,DESCALE_P2\n        psrad   xmm7,DESCALE_P2\n\n        packssdw  xmm5,xmm4             ; xmm5=data0=(00 10 20 30 40 50 60 70)\n        packssdw  xmm0,xmm7             ; xmm0=data7=(07 17 27 37 47 57 67 77)\n\n        movdqa  xmm3, XMMWORD [wk(4)]   ; xmm3=tmp11L\n        movdqa  xmm1, XMMWORD [wk(5)]   ; xmm1=tmp11H\n\n        movdqa  xmm4,xmm3\n        movdqa  xmm7,xmm1\n        paddd   xmm3,xmm2               ; xmm3=data1L\n        paddd   xmm1,xmm6               ; xmm1=data1H\n        psubd   xmm4,xmm2               ; xmm4=data6L\n        psubd   xmm7,xmm6               ; xmm7=data6H\n\n        movdqa  xmm2,[GOTOFF(ebx,PD_DESCALE_P2)]        ; xmm2=[PD_DESCALE_P2]\n\n        paddd   xmm3,xmm2\n        paddd   xmm1,xmm2\n        psrad   xmm3,DESCALE_P2\n        psrad   xmm1,DESCALE_P2\n        paddd   xmm4,xmm2\n        paddd   xmm7,xmm2\n        psrad   xmm4,DESCALE_P2\n        psrad   xmm7,DESCALE_P2\n\n        packssdw  xmm3,xmm1             ; xmm3=data1=(01 11 21 31 41 51 61 71)\n        packssdw  xmm4,xmm7             ; xmm4=data6=(06 16 26 36 46 56 66 76)\n\n        packsswb  xmm5,xmm4             ; xmm5=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n        packsswb  xmm3,xmm0             ; xmm3=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n        movdqa  xmm6, XMMWORD [wk(6)]   ; xmm6=tmp12L\n        movdqa  xmm2, XMMWORD [wk(7)]   ; xmm2=tmp12H\n        movdqa  xmm1, XMMWORD [wk(10)]  ; xmm1=tmp1L\n        movdqa  xmm7, XMMWORD [wk(11)]  ; xmm7=tmp1H\n\n        movdqa  XMMWORD [wk(0)], xmm5   ; wk(0)=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n        movdqa  XMMWORD [wk(1)], xmm3   ; wk(1)=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n        movdqa  xmm4,xmm6\n        movdqa  xmm0,xmm2\n        paddd   xmm6,xmm1               ; xmm6=data2L\n        paddd   xmm2,xmm7               ; xmm2=data2H\n        psubd   xmm4,xmm1               ; xmm4=data5L\n        psubd   xmm0,xmm7               ; xmm0=data5H\n\n        movdqa  xmm5,[GOTOFF(ebx,PD_DESCALE_P2)]        ; xmm5=[PD_DESCALE_P2]\n\n        paddd   xmm6,xmm5\n        paddd   xmm2,xmm5\n        psrad   xmm6,DESCALE_P2\n        psrad   xmm2,DESCALE_P2\n        paddd   xmm4,xmm5\n        paddd   xmm0,xmm5\n        psrad   xmm4,DESCALE_P2\n        psrad   xmm0,DESCALE_P2\n\n        packssdw  xmm6,xmm2             ; xmm6=data2=(02 12 22 32 42 52 62 72)\n        packssdw  xmm4,xmm0             ; xmm4=data5=(05 15 25 35 45 55 65 75)\n\n        movdqa  xmm3, XMMWORD [wk(2)]   ; xmm3=tmp13L\n        movdqa  xmm1, XMMWORD [wk(3)]   ; xmm1=tmp13H\n        movdqa  xmm7, XMMWORD [wk(8)]   ; xmm7=tmp0L\n        movdqa  xmm5, XMMWORD [wk(9)]   ; xmm5=tmp0H\n\n        movdqa  xmm2,xmm3\n        movdqa  xmm0,xmm1\n        paddd   xmm3,xmm7               ; xmm3=data3L\n        paddd   xmm1,xmm5               ; xmm1=data3H\n        psubd   xmm2,xmm7               ; xmm2=data4L\n        psubd   xmm0,xmm5               ; xmm0=data4H\n\n        movdqa  xmm7,[GOTOFF(ebx,PD_DESCALE_P2)]        ; xmm7=[PD_DESCALE_P2]\n\n        paddd   xmm3,xmm7\n        paddd   xmm1,xmm7\n        psrad   xmm3,DESCALE_P2\n        psrad   xmm1,DESCALE_P2\n        paddd   xmm2,xmm7\n        paddd   xmm0,xmm7\n        psrad   xmm2,DESCALE_P2\n        psrad   xmm0,DESCALE_P2\n\n        movdqa    xmm5,[GOTOFF(ebx,PB_CENTERJSAMP)]     ; xmm5=[PB_CENTERJSAMP]\n\n        packssdw  xmm3,xmm1             ; xmm3=data3=(03 13 23 33 43 53 63 73)\n        packssdw  xmm2,xmm0             ; xmm2=data4=(04 14 24 34 44 54 64 74)\n\n        movdqa    xmm7, XMMWORD [wk(0)] ; xmm7=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n        movdqa    xmm1, XMMWORD [wk(1)] ; xmm1=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n        packsswb  xmm6,xmm2             ; xmm6=(02 12 22 32 42 52 62 72 04 14 24 34 44 54 64 74)\n        packsswb  xmm3,xmm4             ; xmm3=(03 13 23 33 43 53 63 73 05 15 25 35 45 55 65 75)\n\n        paddb     xmm7,xmm5\n        paddb     xmm1,xmm5\n        paddb     xmm6,xmm5\n        paddb     xmm3,xmm5\n\n        movdqa    xmm0,xmm7     ; transpose coefficients(phase 1)\n        punpcklbw xmm7,xmm1     ; xmm7=(00 01 10 11 20 21 30 31 40 41 50 51 60 61 70 71)\n        punpckhbw xmm0,xmm1     ; xmm0=(06 07 16 17 26 27 36 37 46 47 56 57 66 67 76 77)\n        movdqa    xmm2,xmm6     ; transpose coefficients(phase 1)\n        punpcklbw xmm6,xmm3     ; xmm6=(02 03 12 13 22 23 32 33 42 43 52 53 62 63 72 73)\n        punpckhbw xmm2,xmm3     ; xmm2=(04 05 14 15 24 25 34 35 44 45 54 55 64 65 74 75)\n\n        movdqa    xmm4,xmm7     ; transpose coefficients(phase 2)\n        punpcklwd xmm7,xmm6     ; xmm7=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33)\n        punpckhwd xmm4,xmm6     ; xmm4=(40 41 42 43 50 51 52 53 60 61 62 63 70 71 72 73)\n        movdqa    xmm5,xmm2     ; transpose coefficients(phase 2)\n        punpcklwd xmm2,xmm0     ; xmm2=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37)\n        punpckhwd xmm5,xmm0     ; xmm5=(44 45 46 47 54 55 56 57 64 65 66 67 74 75 76 77)\n\n        movdqa    xmm1,xmm7     ; transpose coefficients(phase 3)\n        punpckldq xmm7,xmm2     ; xmm7=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17)\n        punpckhdq xmm1,xmm2     ; xmm1=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37)\n        movdqa    xmm3,xmm4     ; transpose coefficients(phase 3)\n        punpckldq xmm4,xmm5     ; xmm4=(40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57)\n        punpckhdq xmm3,xmm5     ; xmm3=(60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77)\n\n        pshufd  xmm6,xmm7,0x4E  ; xmm6=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07)\n        pshufd  xmm0,xmm1,0x4E  ; xmm0=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27)\n        pshufd  xmm2,xmm4,0x4E  ; xmm2=(50 51 52 53 54 55 56 57 40 41 42 43 44 45 46 47)\n        pshufd  xmm5,xmm3,0x4E  ; xmm5=(70 71 72 73 74 75 76 77 60 61 62 63 64 65 66 67)\n\n        mov     edx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n        mov     esi, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm7\n        movq    XMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm1\n        mov     edx, JSAMPROW [edi+4*SIZEOF_JSAMPROW]\n        mov     esi, JSAMPROW [edi+6*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm4\n        movq    XMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm3\n\n        mov     edx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n        mov     esi, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm6\n        movq    XMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm0\n        mov     edx, JSAMPROW [edi+5*SIZEOF_JSAMPROW]\n        mov     esi, JSAMPROW [edi+7*SIZEOF_JSAMPROW]\n        movq    XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm2\n        movq    XMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm5\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; unused\n        poppic  ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jidctred-mmx.asm",
    "content": ";\n; jidctred.asm - reduced-size IDCT (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains inverse-DCT routines that produce reduced-size\n; output: either 4x4 or 2x2 pixels from an 8x8 DCT block.\n; The following code is based directly on the IJG's original jidctred.c;\n; see the jidctred.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS      13\n%define PASS1_BITS      2\n\n%define DESCALE_P1_4    (CONST_BITS-PASS1_BITS+1)\n%define DESCALE_P2_4    (CONST_BITS+PASS1_BITS+3+1)\n%define DESCALE_P1_2    (CONST_BITS-PASS1_BITS+2)\n%define DESCALE_P2_2    (CONST_BITS+PASS1_BITS+3+2)\n\n%if CONST_BITS == 13\nF_0_211 equ      1730           ; FIX(0.211164243)\nF_0_509 equ      4176           ; FIX(0.509795579)\nF_0_601 equ      4926           ; FIX(0.601344887)\nF_0_720 equ      5906           ; FIX(0.720959822)\nF_0_765 equ      6270           ; FIX(0.765366865)\nF_0_850 equ      6967           ; FIX(0.850430095)\nF_0_899 equ      7373           ; FIX(0.899976223)\nF_1_061 equ      8697           ; FIX(1.061594337)\nF_1_272 equ     10426           ; FIX(1.272758580)\nF_1_451 equ     11893           ; FIX(1.451774981)\nF_1_847 equ     15137           ; FIX(1.847759065)\nF_2_172 equ     17799           ; FIX(2.172734803)\nF_2_562 equ     20995           ; FIX(2.562915447)\nF_3_624 equ     29692           ; FIX(3.624509785)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_211 equ     DESCALE( 226735879,30-CONST_BITS)       ; FIX(0.211164243)\nF_0_509 equ     DESCALE( 547388834,30-CONST_BITS)       ; FIX(0.509795579)\nF_0_601 equ     DESCALE( 645689155,30-CONST_BITS)       ; FIX(0.601344887)\nF_0_720 equ     DESCALE( 774124714,30-CONST_BITS)       ; FIX(0.720959822)\nF_0_765 equ     DESCALE( 821806413,30-CONST_BITS)       ; FIX(0.765366865)\nF_0_850 equ     DESCALE( 913142361,30-CONST_BITS)       ; FIX(0.850430095)\nF_0_899 equ     DESCALE( 966342111,30-CONST_BITS)       ; FIX(0.899976223)\nF_1_061 equ     DESCALE(1139878239,30-CONST_BITS)       ; FIX(1.061594337)\nF_1_272 equ     DESCALE(1366614119,30-CONST_BITS)       ; FIX(1.272758580)\nF_1_451 equ     DESCALE(1558831516,30-CONST_BITS)       ; FIX(1.451774981)\nF_1_847 equ     DESCALE(1984016188,30-CONST_BITS)       ; FIX(1.847759065)\nF_2_172 equ     DESCALE(2332956230,30-CONST_BITS)       ; FIX(2.172734803)\nF_2_562 equ     DESCALE(2751909506,30-CONST_BITS)       ; FIX(2.562915447)\nF_3_624 equ     DESCALE(3891787747,30-CONST_BITS)       ; FIX(3.624509785)\n%endif\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_idct_red_mmx)\n\nEXTN(jconst_idct_red_mmx):\n\nPW_F184_MF076   times 2 dw  F_1_847,-F_0_765\nPW_F256_F089    times 2 dw  F_2_562, F_0_899\nPW_F106_MF217   times 2 dw  F_1_061,-F_2_172\nPW_MF060_MF050  times 2 dw -F_0_601,-F_0_509\nPW_F145_MF021   times 2 dw  F_1_451,-F_0_211\nPW_F362_MF127   times 2 dw  F_3_624,-F_1_272\nPW_F085_MF072   times 2 dw  F_0_850,-F_0_720\nPD_DESCALE_P1_4 times 2 dd  1 << (DESCALE_P1_4-1)\nPD_DESCALE_P2_4 times 2 dd  1 << (DESCALE_P2_4-1)\nPD_DESCALE_P1_2 times 2 dd  1 << (DESCALE_P1_2-1)\nPD_DESCALE_P2_2 times 2 dd  1 << (DESCALE_P2_2-1)\nPB_CENTERJSAMP  times 8 db  CENTERJSAMPLE\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Perform dequantization and inverse DCT on one block of coefficients,\n; producing a reduced-size 4x4 output block.\n;\n; GLOBAL(void)\n; jsimd_idct_4x4_mmx (void *dct_table, JCOEFPTR coef_block,\n;                     JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)    (b)+8           ; void *dct_table\n%define coef_block(b)   (b)+12          ; JCOEFPTR coef_block\n%define output_buf(b)   (b)+16          ; JSAMPARRAY output_buf\n%define output_col(b)   (b)+20          ; JDIMENSION output_col\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_MMWORD  ; mmword wk[WK_NUM]\n%define WK_NUM          2\n%define workspace       wk(0)-DCTSIZE2*SIZEOF_JCOEF\n                                        ; JCOEF workspace[DCTSIZE2]\n\n        align   16\n        global  EXTN(jsimd_idct_4x4_mmx)\n\nEXTN(jsimd_idct_4x4_mmx):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_MMWORD)      ; align to 64 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [workspace]\n        pushpic ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process columns from input, store into work array.\n\n;       mov     eax, [original_ebp]\n        mov     edx, POINTER [dct_table(eax)]           ; quantptr\n        mov     esi, JCOEFPTR [coef_block(eax)]         ; inptr\n        lea     edi, [workspace]                        ; JCOEF *wsptr\n        mov     ecx, DCTSIZE/4                          ; ctr\n        alignx  16,7\n.columnloop:\n%ifndef NO_ZERO_COLUMN_TEST_4X4_MMX\n        mov     eax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        or      eax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        jnz     short .columnDCT\n\n        movq    mm0, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movq    mm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        por     mm0, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        por     mm1, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        por     mm0, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n        por     mm1, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        por     mm0,mm1\n        packsswb mm0,mm0\n        movd    eax,mm0\n        test    eax,eax\n        jnz     short .columnDCT\n\n        ; -- AC terms all zero\n\n        movq    mm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        psllw   mm0,PASS1_BITS\n\n        movq      mm2,mm0               ; mm0=in0=(00 01 02 03)\n        punpcklwd mm0,mm0               ; mm0=(00 00 01 01)\n        punpckhwd mm2,mm2               ; mm2=(02 02 03 03)\n\n        movq      mm1,mm0\n        punpckldq mm0,mm0               ; mm0=(00 00 00 00)\n        punpckhdq mm1,mm1               ; mm1=(01 01 01 01)\n        movq      mm3,mm2\n        punpckldq mm2,mm2               ; mm2=(02 02 02 02)\n        punpckhdq mm3,mm3               ; mm3=(03 03 03 03)\n\n        movq    MMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm0\n        movq    MMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm1\n        movq    MMWORD [MMBLOCK(2,0,edi,SIZEOF_JCOEF)], mm2\n        movq    MMWORD [MMBLOCK(3,0,edi,SIZEOF_JCOEF)], mm3\n        jmp     near .nextcolumn\n        alignx  16,7\n%endif\n.columnDCT:\n\n        ; -- Odd part\n\n        movq    mm0, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movq    mm1, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm0, MMWORD [MMBLOCK(1,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  mm1, MMWORD [MMBLOCK(3,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        movq    mm2, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        movq    mm3, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm2, MMWORD [MMBLOCK(5,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  mm3, MMWORD [MMBLOCK(7,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        movq      mm4,mm0\n        movq      mm5,mm0\n        punpcklwd mm4,mm1\n        punpckhwd mm5,mm1\n        movq      mm0,mm4\n        movq      mm1,mm5\n        pmaddwd   mm4,[GOTOFF(ebx,PW_F256_F089)]        ; mm4=(tmp2L)\n        pmaddwd   mm5,[GOTOFF(ebx,PW_F256_F089)]        ; mm5=(tmp2H)\n        pmaddwd   mm0,[GOTOFF(ebx,PW_F106_MF217)]       ; mm0=(tmp0L)\n        pmaddwd   mm1,[GOTOFF(ebx,PW_F106_MF217)]       ; mm1=(tmp0H)\n\n        movq      mm6,mm2\n        movq      mm7,mm2\n        punpcklwd mm6,mm3\n        punpckhwd mm7,mm3\n        movq      mm2,mm6\n        movq      mm3,mm7\n        pmaddwd   mm6,[GOTOFF(ebx,PW_MF060_MF050)]      ; mm6=(tmp2L)\n        pmaddwd   mm7,[GOTOFF(ebx,PW_MF060_MF050)]      ; mm7=(tmp2H)\n        pmaddwd   mm2,[GOTOFF(ebx,PW_F145_MF021)]       ; mm2=(tmp0L)\n        pmaddwd   mm3,[GOTOFF(ebx,PW_F145_MF021)]       ; mm3=(tmp0H)\n\n        paddd   mm6,mm4                 ; mm6=tmp2L\n        paddd   mm7,mm5                 ; mm7=tmp2H\n        paddd   mm2,mm0                 ; mm2=tmp0L\n        paddd   mm3,mm1                 ; mm3=tmp0H\n\n        movq    MMWORD [wk(0)], mm2     ; wk(0)=tmp0L\n        movq    MMWORD [wk(1)], mm3     ; wk(1)=tmp0H\n\n        ; -- Even part\n\n        movq    mm4, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        movq    mm5, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        movq    mm0, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm4, MMWORD [MMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  mm5, MMWORD [MMBLOCK(2,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  mm0, MMWORD [MMBLOCK(6,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        pxor      mm1,mm1\n        pxor      mm2,mm2\n        punpcklwd mm1,mm4               ; mm1=tmp0L\n        punpckhwd mm2,mm4               ; mm2=tmp0H\n        psrad     mm1,(16-CONST_BITS-1) ; psrad mm1,16 & pslld mm1,CONST_BITS+1\n        psrad     mm2,(16-CONST_BITS-1) ; psrad mm2,16 & pslld mm2,CONST_BITS+1\n\n        movq      mm3,mm5               ; mm5=in2=z2\n        punpcklwd mm5,mm0               ; mm0=in6=z3\n        punpckhwd mm3,mm0\n        pmaddwd   mm5,[GOTOFF(ebx,PW_F184_MF076)]       ; mm5=tmp2L\n        pmaddwd   mm3,[GOTOFF(ebx,PW_F184_MF076)]       ; mm3=tmp2H\n\n        movq    mm4,mm1\n        movq    mm0,mm2\n        paddd   mm1,mm5                 ; mm1=tmp10L\n        paddd   mm2,mm3                 ; mm2=tmp10H\n        psubd   mm4,mm5                 ; mm4=tmp12L\n        psubd   mm0,mm3                 ; mm0=tmp12H\n\n        ; -- Final output stage\n\n        movq    mm5,mm1\n        movq    mm3,mm2\n        paddd   mm1,mm6                 ; mm1=data0L\n        paddd   mm2,mm7                 ; mm2=data0H\n        psubd   mm5,mm6                 ; mm5=data3L\n        psubd   mm3,mm7                 ; mm3=data3H\n\n        movq    mm6,[GOTOFF(ebx,PD_DESCALE_P1_4)]       ; mm6=[PD_DESCALE_P1_4]\n\n        paddd   mm1,mm6\n        paddd   mm2,mm6\n        psrad   mm1,DESCALE_P1_4\n        psrad   mm2,DESCALE_P1_4\n        paddd   mm5,mm6\n        paddd   mm3,mm6\n        psrad   mm5,DESCALE_P1_4\n        psrad   mm3,DESCALE_P1_4\n\n        packssdw  mm1,mm2               ; mm1=data0=(00 01 02 03)\n        packssdw  mm5,mm3               ; mm5=data3=(30 31 32 33)\n\n        movq    mm7, MMWORD [wk(0)]     ; mm7=tmp0L\n        movq    mm6, MMWORD [wk(1)]     ; mm6=tmp0H\n\n        movq    mm2,mm4\n        movq    mm3,mm0\n        paddd   mm4,mm7                 ; mm4=data1L\n        paddd   mm0,mm6                 ; mm0=data1H\n        psubd   mm2,mm7                 ; mm2=data2L\n        psubd   mm3,mm6                 ; mm3=data2H\n\n        movq    mm7,[GOTOFF(ebx,PD_DESCALE_P1_4)]       ; mm7=[PD_DESCALE_P1_4]\n\n        paddd   mm4,mm7\n        paddd   mm0,mm7\n        psrad   mm4,DESCALE_P1_4\n        psrad   mm0,DESCALE_P1_4\n        paddd   mm2,mm7\n        paddd   mm3,mm7\n        psrad   mm2,DESCALE_P1_4\n        psrad   mm3,DESCALE_P1_4\n\n        packssdw  mm4,mm0               ; mm4=data1=(10 11 12 13)\n        packssdw  mm2,mm3               ; mm2=data2=(20 21 22 23)\n\n        movq      mm6,mm1               ; transpose coefficients(phase 1)\n        punpcklwd mm1,mm4               ; mm1=(00 10 01 11)\n        punpckhwd mm6,mm4               ; mm6=(02 12 03 13)\n        movq      mm7,mm2               ; transpose coefficients(phase 1)\n        punpcklwd mm2,mm5               ; mm2=(20 30 21 31)\n        punpckhwd mm7,mm5               ; mm7=(22 32 23 33)\n\n        movq      mm0,mm1               ; transpose coefficients(phase 2)\n        punpckldq mm1,mm2               ; mm1=(00 10 20 30)\n        punpckhdq mm0,mm2               ; mm0=(01 11 21 31)\n        movq      mm3,mm6               ; transpose coefficients(phase 2)\n        punpckldq mm6,mm7               ; mm6=(02 12 22 32)\n        punpckhdq mm3,mm7               ; mm3=(03 13 23 33)\n\n        movq    MMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm1\n        movq    MMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm0\n        movq    MMWORD [MMBLOCK(2,0,edi,SIZEOF_JCOEF)], mm6\n        movq    MMWORD [MMBLOCK(3,0,edi,SIZEOF_JCOEF)], mm3\n\n.nextcolumn:\n        add     esi, byte 4*SIZEOF_JCOEF                ; coef_block\n        add     edx, byte 4*SIZEOF_ISLOW_MULT_TYPE      ; quantptr\n        add     edi, byte 4*DCTSIZE*SIZEOF_JCOEF        ; wsptr\n        dec     ecx                                     ; ctr\n        jnz     near .columnloop\n\n        ; ---- Pass 2: process rows from work array, store into output array.\n\n        mov     eax, [original_ebp]\n        lea     esi, [workspace]                        ; JCOEF *wsptr\n        mov     edi, JSAMPARRAY [output_buf(eax)]       ; (JSAMPROW *)\n        mov     eax, JDIMENSION [output_col(eax)]\n\n        ; -- Odd part\n\n        movq    mm0, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movq    mm1, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        movq    mm2, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        movq    mm3, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\n        movq      mm4,mm0\n        movq      mm5,mm0\n        punpcklwd mm4,mm1\n        punpckhwd mm5,mm1\n        movq      mm0,mm4\n        movq      mm1,mm5\n        pmaddwd   mm4,[GOTOFF(ebx,PW_F256_F089)]        ; mm4=(tmp2L)\n        pmaddwd   mm5,[GOTOFF(ebx,PW_F256_F089)]        ; mm5=(tmp2H)\n        pmaddwd   mm0,[GOTOFF(ebx,PW_F106_MF217)]       ; mm0=(tmp0L)\n        pmaddwd   mm1,[GOTOFF(ebx,PW_F106_MF217)]       ; mm1=(tmp0H)\n\n        movq      mm6,mm2\n        movq      mm7,mm2\n        punpcklwd mm6,mm3\n        punpckhwd mm7,mm3\n        movq      mm2,mm6\n        movq      mm3,mm7\n        pmaddwd   mm6,[GOTOFF(ebx,PW_MF060_MF050)]      ; mm6=(tmp2L)\n        pmaddwd   mm7,[GOTOFF(ebx,PW_MF060_MF050)]      ; mm7=(tmp2H)\n        pmaddwd   mm2,[GOTOFF(ebx,PW_F145_MF021)]       ; mm2=(tmp0L)\n        pmaddwd   mm3,[GOTOFF(ebx,PW_F145_MF021)]       ; mm3=(tmp0H)\n\n        paddd   mm6,mm4                 ; mm6=tmp2L\n        paddd   mm7,mm5                 ; mm7=tmp2H\n        paddd   mm2,mm0                 ; mm2=tmp0L\n        paddd   mm3,mm1                 ; mm3=tmp0H\n\n        movq    MMWORD [wk(0)], mm2     ; wk(0)=tmp0L\n        movq    MMWORD [wk(1)], mm3     ; wk(1)=tmp0H\n\n        ; -- Even part\n\n        movq    mm4, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        movq    mm5, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        movq    mm0, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\n        pxor      mm1,mm1\n        pxor      mm2,mm2\n        punpcklwd mm1,mm4               ; mm1=tmp0L\n        punpckhwd mm2,mm4               ; mm2=tmp0H\n        psrad     mm1,(16-CONST_BITS-1) ; psrad mm1,16 & pslld mm1,CONST_BITS+1\n        psrad     mm2,(16-CONST_BITS-1) ; psrad mm2,16 & pslld mm2,CONST_BITS+1\n\n        movq      mm3,mm5               ; mm5=in2=z2\n        punpcklwd mm5,mm0               ; mm0=in6=z3\n        punpckhwd mm3,mm0\n        pmaddwd   mm5,[GOTOFF(ebx,PW_F184_MF076)]       ; mm5=tmp2L\n        pmaddwd   mm3,[GOTOFF(ebx,PW_F184_MF076)]       ; mm3=tmp2H\n\n        movq    mm4,mm1\n        movq    mm0,mm2\n        paddd   mm1,mm5                 ; mm1=tmp10L\n        paddd   mm2,mm3                 ; mm2=tmp10H\n        psubd   mm4,mm5                 ; mm4=tmp12L\n        psubd   mm0,mm3                 ; mm0=tmp12H\n\n        ; -- Final output stage\n\n        movq    mm5,mm1\n        movq    mm3,mm2\n        paddd   mm1,mm6                 ; mm1=data0L\n        paddd   mm2,mm7                 ; mm2=data0H\n        psubd   mm5,mm6                 ; mm5=data3L\n        psubd   mm3,mm7                 ; mm3=data3H\n\n        movq    mm6,[GOTOFF(ebx,PD_DESCALE_P2_4)]       ; mm6=[PD_DESCALE_P2_4]\n\n        paddd   mm1,mm6\n        paddd   mm2,mm6\n        psrad   mm1,DESCALE_P2_4\n        psrad   mm2,DESCALE_P2_4\n        paddd   mm5,mm6\n        paddd   mm3,mm6\n        psrad   mm5,DESCALE_P2_4\n        psrad   mm3,DESCALE_P2_4\n\n        packssdw  mm1,mm2               ; mm1=data0=(00 10 20 30)\n        packssdw  mm5,mm3               ; mm5=data3=(03 13 23 33)\n\n        movq    mm7, MMWORD [wk(0)]     ; mm7=tmp0L\n        movq    mm6, MMWORD [wk(1)]     ; mm6=tmp0H\n\n        movq    mm2,mm4\n        movq    mm3,mm0\n        paddd   mm4,mm7                 ; mm4=data1L\n        paddd   mm0,mm6                 ; mm0=data1H\n        psubd   mm2,mm7                 ; mm2=data2L\n        psubd   mm3,mm6                 ; mm3=data2H\n\n        movq    mm7,[GOTOFF(ebx,PD_DESCALE_P2_4)]       ; mm7=[PD_DESCALE_P2_4]\n\n        paddd   mm4,mm7\n        paddd   mm0,mm7\n        psrad   mm4,DESCALE_P2_4\n        psrad   mm0,DESCALE_P2_4\n        paddd   mm2,mm7\n        paddd   mm3,mm7\n        psrad   mm2,DESCALE_P2_4\n        psrad   mm3,DESCALE_P2_4\n\n        packssdw  mm4,mm0               ; mm4=data1=(01 11 21 31)\n        packssdw  mm2,mm3               ; mm2=data2=(02 12 22 32)\n\n        movq      mm6,[GOTOFF(ebx,PB_CENTERJSAMP)]      ; mm6=[PB_CENTERJSAMP]\n\n        packsswb  mm1,mm2               ; mm1=(00 10 20 30 02 12 22 32)\n        packsswb  mm4,mm5               ; mm4=(01 11 21 31 03 13 23 33)\n        paddb     mm1,mm6\n        paddb     mm4,mm6\n\n        movq      mm7,mm1               ; transpose coefficients(phase 1)\n        punpcklbw mm1,mm4               ; mm1=(00 01 10 11 20 21 30 31)\n        punpckhbw mm7,mm4               ; mm7=(02 03 12 13 22 23 32 33)\n\n        movq      mm0,mm1               ; transpose coefficients(phase 2)\n        punpcklwd mm1,mm7               ; mm1=(00 01 02 03 10 11 12 13)\n        punpckhwd mm0,mm7               ; mm0=(20 21 22 23 30 31 32 33)\n\n        mov     edx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n        mov     esi, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n        movd    DWORD [edx+eax*SIZEOF_JSAMPLE], mm1\n        movd    DWORD [esi+eax*SIZEOF_JSAMPLE], mm0\n\n        psrlq   mm1,4*BYTE_BIT\n        psrlq   mm0,4*BYTE_BIT\n\n        mov     edx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n        mov     esi, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n        movd    DWORD [edx+eax*SIZEOF_JSAMPLE], mm1\n        movd    DWORD [esi+eax*SIZEOF_JSAMPLE], mm0\n\n        emms            ; empty MMX state\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        poppic  ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n\n; --------------------------------------------------------------------------\n;\n; Perform dequantization and inverse DCT on one block of coefficients,\n; producing a reduced-size 2x2 output block.\n;\n; GLOBAL(void)\n; jsimd_idct_2x2_mmx (void *dct_table, JCOEFPTR coef_block,\n;                     JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)    (b)+8           ; void *dct_table\n%define coef_block(b)   (b)+12          ; JCOEFPTR coef_block\n%define output_buf(b)   (b)+16          ; JSAMPARRAY output_buf\n%define output_col(b)   (b)+20          ; JDIMENSION output_col\n\n        align   16\n        global  EXTN(jsimd_idct_2x2_mmx)\n\nEXTN(jsimd_idct_2x2_mmx):\n        push    ebp\n        mov     ebp,esp\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process columns from input.\n\n        mov     edx, POINTER [dct_table(ebp)]           ; quantptr\n        mov     esi, JCOEFPTR [coef_block(ebp)]         ; inptr\n\n        ; | input:                  | result:        |\n        ; | 00 01 ** 03 ** 05 ** 07 |                |\n        ; | 10 11 ** 13 ** 15 ** 17 |                |\n        ; | ** ** ** ** ** ** ** ** |                |\n        ; | 30 31 ** 33 ** 35 ** 37 | A0 A1 A3 A5 A7 |\n        ; | ** ** ** ** ** ** ** ** | B0 B1 B3 B5 B7 |\n        ; | 50 51 ** 53 ** 55 ** 57 |                |\n        ; | ** ** ** ** ** ** ** ** |                |\n        ; | 70 71 ** 73 ** 75 ** 77 |                |\n\n        ; -- Odd part\n\n        movq    mm0, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movq    mm1, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm0, MMWORD [MMBLOCK(1,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  mm1, MMWORD [MMBLOCK(3,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        movq    mm2, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        movq    mm3, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        pmullw  mm2, MMWORD [MMBLOCK(5,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  mm3, MMWORD [MMBLOCK(7,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        ; mm0=(10 11 ** 13), mm1=(30 31 ** 33)\n        ; mm2=(50 51 ** 53), mm3=(70 71 ** 73)\n\n        pcmpeqd   mm7,mm7\n        pslld     mm7,WORD_BIT          ; mm7={0x0000 0xFFFF 0x0000 0xFFFF}\n\n        movq      mm4,mm0               ; mm4=(10 11 ** 13)\n        movq      mm5,mm2               ; mm5=(50 51 ** 53)\n        punpcklwd mm4,mm1               ; mm4=(10 30 11 31)\n        punpcklwd mm5,mm3               ; mm5=(50 70 51 71)\n        pmaddwd   mm4,[GOTOFF(ebx,PW_F362_MF127)]\n        pmaddwd   mm5,[GOTOFF(ebx,PW_F085_MF072)]\n\n        psrld   mm0,WORD_BIT            ; mm0=(11 -- 13 --)\n        pand    mm1,mm7                 ; mm1=(-- 31 -- 33)\n        psrld   mm2,WORD_BIT            ; mm2=(51 -- 53 --)\n        pand    mm3,mm7                 ; mm3=(-- 71 -- 73)\n        por     mm0,mm1                 ; mm0=(11 31 13 33)\n        por     mm2,mm3                 ; mm2=(51 71 53 73)\n        pmaddwd mm0,[GOTOFF(ebx,PW_F362_MF127)]\n        pmaddwd mm2,[GOTOFF(ebx,PW_F085_MF072)]\n\n        paddd   mm4,mm5                 ; mm4=tmp0[col0 col1]\n\n        movq    mm6, MMWORD [MMBLOCK(1,1,esi,SIZEOF_JCOEF)]\n        movq    mm1, MMWORD [MMBLOCK(3,1,esi,SIZEOF_JCOEF)]\n        pmullw  mm6, MMWORD [MMBLOCK(1,1,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  mm1, MMWORD [MMBLOCK(3,1,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        movq    mm3, MMWORD [MMBLOCK(5,1,esi,SIZEOF_JCOEF)]\n        movq    mm5, MMWORD [MMBLOCK(7,1,esi,SIZEOF_JCOEF)]\n        pmullw  mm3, MMWORD [MMBLOCK(5,1,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  mm5, MMWORD [MMBLOCK(7,1,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        ; mm6=(** 15 ** 17), mm1=(** 35 ** 37)\n        ; mm3=(** 55 ** 57), mm5=(** 75 ** 77)\n\n        psrld   mm6,WORD_BIT            ; mm6=(15 -- 17 --)\n        pand    mm1,mm7                 ; mm1=(-- 35 -- 37)\n        psrld   mm3,WORD_BIT            ; mm3=(55 -- 57 --)\n        pand    mm5,mm7                 ; mm5=(-- 75 -- 77)\n        por     mm6,mm1                 ; mm6=(15 35 17 37)\n        por     mm3,mm5                 ; mm3=(55 75 57 77)\n        pmaddwd mm6,[GOTOFF(ebx,PW_F362_MF127)]\n        pmaddwd mm3,[GOTOFF(ebx,PW_F085_MF072)]\n\n        paddd   mm0,mm2                 ; mm0=tmp0[col1 col3]\n        paddd   mm6,mm3                 ; mm6=tmp0[col5 col7]\n\n        ; -- Even part\n\n        movq    mm1, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        movq    mm5, MMWORD [MMBLOCK(0,1,esi,SIZEOF_JCOEF)]\n        pmullw  mm1, MMWORD [MMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  mm5, MMWORD [MMBLOCK(0,1,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        ; mm1=(00 01 ** 03), mm5=(** 05 ** 07)\n\n        movq    mm2,mm1                         ; mm2=(00 01 ** 03)\n        pslld   mm1,WORD_BIT                    ; mm1=(-- 00 -- **)\n        psrad   mm1,(WORD_BIT-CONST_BITS-2)     ; mm1=tmp10[col0 ****]\n\n        pand    mm2,mm7                         ; mm2=(-- 01 -- 03)\n        pand    mm5,mm7                         ; mm5=(-- 05 -- 07)\n        psrad   mm2,(WORD_BIT-CONST_BITS-2)     ; mm2=tmp10[col1 col3]\n        psrad   mm5,(WORD_BIT-CONST_BITS-2)     ; mm5=tmp10[col5 col7]\n\n        ; -- Final output stage\n\n        movq      mm3,mm1\n        paddd     mm1,mm4               ; mm1=data0[col0 ****]=(A0 **)\n        psubd     mm3,mm4               ; mm3=data1[col0 ****]=(B0 **)\n        punpckldq mm1,mm3               ; mm1=(A0 B0)\n\n        movq    mm7,[GOTOFF(ebx,PD_DESCALE_P1_2)]       ; mm7=[PD_DESCALE_P1_2]\n\n        movq    mm4,mm2\n        movq    mm3,mm5\n        paddd   mm2,mm0                 ; mm2=data0[col1 col3]=(A1 A3)\n        paddd   mm5,mm6                 ; mm5=data0[col5 col7]=(A5 A7)\n        psubd   mm4,mm0                 ; mm4=data1[col1 col3]=(B1 B3)\n        psubd   mm3,mm6                 ; mm3=data1[col5 col7]=(B5 B7)\n\n        paddd   mm1,mm7\n        psrad   mm1,DESCALE_P1_2\n\n        paddd   mm2,mm7\n        paddd   mm5,mm7\n        psrad   mm2,DESCALE_P1_2\n        psrad   mm5,DESCALE_P1_2\n        paddd   mm4,mm7\n        paddd   mm3,mm7\n        psrad   mm4,DESCALE_P1_2\n        psrad   mm3,DESCALE_P1_2\n\n        ; ---- Pass 2: process rows, store into output array.\n\n        mov     edi, JSAMPARRAY [output_buf(ebp)]       ; (JSAMPROW *)\n        mov     eax, JDIMENSION [output_col(ebp)]\n\n        ; | input:| result:|\n        ; | A0 B0 |        |\n        ; | A1 B1 | C0 C1  |\n        ; | A3 B3 | D0 D1  |\n        ; | A5 B5 |        |\n        ; | A7 B7 |        |\n\n        ; -- Odd part\n\n        packssdw  mm2,mm4               ; mm2=(A1 A3 B1 B3)\n        packssdw  mm5,mm3               ; mm5=(A5 A7 B5 B7)\n        pmaddwd   mm2,[GOTOFF(ebx,PW_F362_MF127)]\n        pmaddwd   mm5,[GOTOFF(ebx,PW_F085_MF072)]\n\n        paddd     mm2,mm5               ; mm2=tmp0[row0 row1]\n\n        ; -- Even part\n\n        pslld     mm1,(CONST_BITS+2)    ; mm1=tmp10[row0 row1]\n\n        ; -- Final output stage\n\n        movq      mm0,[GOTOFF(ebx,PD_DESCALE_P2_2)]     ; mm0=[PD_DESCALE_P2_2]\n\n        movq      mm6,mm1\n        paddd     mm1,mm2               ; mm1=data0[row0 row1]=(C0 C1)\n        psubd     mm6,mm2               ; mm6=data1[row0 row1]=(D0 D1)\n\n        paddd     mm1,mm0\n        paddd     mm6,mm0\n        psrad     mm1,DESCALE_P2_2\n        psrad     mm6,DESCALE_P2_2\n\n        movq      mm7,mm1               ; transpose coefficients\n        punpckldq mm1,mm6               ; mm1=(C0 D0)\n        punpckhdq mm7,mm6               ; mm7=(C1 D1)\n\n        packssdw  mm1,mm7               ; mm1=(C0 D0 C1 D1)\n        packsswb  mm1,mm1               ; mm1=(C0 D0 C1 D1 C0 D0 C1 D1)\n        paddb     mm1,[GOTOFF(ebx,PB_CENTERJSAMP)]\n\n        movd    ecx,mm1\n        movd    ebx,mm1                 ; ebx=(C0 D0 C1 D1)\n        shr     ecx,2*BYTE_BIT          ; ecx=(C1 D1 -- --)\n\n        mov     edx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n        mov     esi, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n        mov     WORD [edx+eax*SIZEOF_JSAMPLE], bx\n        mov     WORD [esi+eax*SIZEOF_JSAMPLE], cx\n\n        emms            ; empty MMX state\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jidctred-sse2-64.asm",
    "content": ";\n; jidctred.asm - reduced-size IDCT (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains inverse-DCT routines that produce reduced-size\n; output: either 4x4 or 2x2 pixels from an 8x8 DCT block.\n; The following code is based directly on the IJG's original jidctred.c;\n; see the jidctred.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS      13\n%define PASS1_BITS      2\n\n%define DESCALE_P1_4    (CONST_BITS-PASS1_BITS+1)\n%define DESCALE_P2_4    (CONST_BITS+PASS1_BITS+3+1)\n%define DESCALE_P1_2    (CONST_BITS-PASS1_BITS+2)\n%define DESCALE_P2_2    (CONST_BITS+PASS1_BITS+3+2)\n\n%if CONST_BITS == 13\nF_0_211 equ      1730           ; FIX(0.211164243)\nF_0_509 equ      4176           ; FIX(0.509795579)\nF_0_601 equ      4926           ; FIX(0.601344887)\nF_0_720 equ      5906           ; FIX(0.720959822)\nF_0_765 equ      6270           ; FIX(0.765366865)\nF_0_850 equ      6967           ; FIX(0.850430095)\nF_0_899 equ      7373           ; FIX(0.899976223)\nF_1_061 equ      8697           ; FIX(1.061594337)\nF_1_272 equ     10426           ; FIX(1.272758580)\nF_1_451 equ     11893           ; FIX(1.451774981)\nF_1_847 equ     15137           ; FIX(1.847759065)\nF_2_172 equ     17799           ; FIX(2.172734803)\nF_2_562 equ     20995           ; FIX(2.562915447)\nF_3_624 equ     29692           ; FIX(3.624509785)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_211 equ     DESCALE( 226735879,30-CONST_BITS)       ; FIX(0.211164243)\nF_0_509 equ     DESCALE( 547388834,30-CONST_BITS)       ; FIX(0.509795579)\nF_0_601 equ     DESCALE( 645689155,30-CONST_BITS)       ; FIX(0.601344887)\nF_0_720 equ     DESCALE( 774124714,30-CONST_BITS)       ; FIX(0.720959822)\nF_0_765 equ     DESCALE( 821806413,30-CONST_BITS)       ; FIX(0.765366865)\nF_0_850 equ     DESCALE( 913142361,30-CONST_BITS)       ; FIX(0.850430095)\nF_0_899 equ     DESCALE( 966342111,30-CONST_BITS)       ; FIX(0.899976223)\nF_1_061 equ     DESCALE(1139878239,30-CONST_BITS)       ; FIX(1.061594337)\nF_1_272 equ     DESCALE(1366614119,30-CONST_BITS)       ; FIX(1.272758580)\nF_1_451 equ     DESCALE(1558831516,30-CONST_BITS)       ; FIX(1.451774981)\nF_1_847 equ     DESCALE(1984016188,30-CONST_BITS)       ; FIX(1.847759065)\nF_2_172 equ     DESCALE(2332956230,30-CONST_BITS)       ; FIX(2.172734803)\nF_2_562 equ     DESCALE(2751909506,30-CONST_BITS)       ; FIX(2.562915447)\nF_3_624 equ     DESCALE(3891787747,30-CONST_BITS)       ; FIX(3.624509785)\n%endif\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_idct_red_sse2)\n\nEXTN(jconst_idct_red_sse2):\n\nPW_F184_MF076   times 4 dw  F_1_847,-F_0_765\nPW_F256_F089    times 4 dw  F_2_562, F_0_899\nPW_F106_MF217   times 4 dw  F_1_061,-F_2_172\nPW_MF060_MF050  times 4 dw -F_0_601,-F_0_509\nPW_F145_MF021   times 4 dw  F_1_451,-F_0_211\nPW_F362_MF127   times 4 dw  F_3_624,-F_1_272\nPW_F085_MF072   times 4 dw  F_0_850,-F_0_720\nPD_DESCALE_P1_4 times 4 dd  1 << (DESCALE_P1_4-1)\nPD_DESCALE_P2_4 times 4 dd  1 << (DESCALE_P2_4-1)\nPD_DESCALE_P1_2 times 4 dd  1 << (DESCALE_P1_2-1)\nPD_DESCALE_P2_2 times 4 dd  1 << (DESCALE_P2_2-1)\nPB_CENTERJSAMP  times 16 db CENTERJSAMPLE\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n;\n; Perform dequantization and inverse DCT on one block of coefficients,\n; producing a reduced-size 4x4 output block.\n;\n; GLOBAL(void)\n; jsimd_idct_4x4_sse2 (void *dct_table, JCOEFPTR coef_block,\n;                      JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n; r10 = void *dct_table\n; r11 = JCOEFPTR coef_block\n; r12 = JSAMPARRAY output_buf\n; r13 = JDIMENSION output_col\n\n%define original_rbp    rbp+0\n%define wk(i)           rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          2\n\n        align   16\n        global  EXTN(jsimd_idct_4x4_sse2)\n\nEXTN(jsimd_idct_4x4_sse2):\n        push    rbp\n        mov     rax,rsp                         ; rax = original rbp\n        sub     rsp, byte 4\n        and     rsp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [rsp],rax\n        mov     rbp,rsp                         ; rbp = aligned rbp\n        lea     rsp, [wk(0)]\n        collect_args\n\n        ; ---- Pass 1: process columns from input.\n\n        mov     rdx, r10                ; quantptr\n        mov     rsi, r11                ; inptr\n\n%ifndef NO_ZERO_COLUMN_TEST_4X4_SSE2\n        mov     eax, DWORD [DWBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n        or      eax, DWORD [DWBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n        jnz     short .columnDCT\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n        por     xmm1, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n        por     xmm1, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n        por     xmm0,xmm1\n        packsswb xmm0,xmm0\n        packsswb xmm0,xmm0\n        movd    eax,xmm0\n        test    rax,rax\n        jnz     short .columnDCT\n\n        ; -- AC terms all zero\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        psllw   xmm0,PASS1_BITS\n\n        movdqa    xmm3,xmm0     ; xmm0=in0=(00 01 02 03 04 05 06 07)\n        punpcklwd xmm0,xmm0     ; xmm0=(00 00 01 01 02 02 03 03)\n        punpckhwd xmm3,xmm3     ; xmm3=(04 04 05 05 06 06 07 07)\n\n        pshufd  xmm1,xmm0,0x50  ; xmm1=[col0 col1]=(00 00 00 00 01 01 01 01)\n        pshufd  xmm0,xmm0,0xFA  ; xmm0=[col2 col3]=(02 02 02 02 03 03 03 03)\n        pshufd  xmm6,xmm3,0x50  ; xmm6=[col4 col5]=(04 04 04 04 05 05 05 05)\n        pshufd  xmm3,xmm3,0xFA  ; xmm3=[col6 col7]=(06 06 06 06 07 07 07 07)\n\n        jmp     near .column_end\n%endif\n.columnDCT:\n\n        ; -- Odd part\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm0, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm1, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n        movdqa  xmm2, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm2, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        movdqa    xmm4,xmm0\n        movdqa    xmm5,xmm0\n        punpcklwd xmm4,xmm1\n        punpckhwd xmm5,xmm1\n        movdqa    xmm0,xmm4\n        movdqa    xmm1,xmm5\n        pmaddwd   xmm4,[rel PW_F256_F089]       ; xmm4=(tmp2L)\n        pmaddwd   xmm5,[rel PW_F256_F089]       ; xmm5=(tmp2H)\n        pmaddwd   xmm0,[rel PW_F106_MF217]      ; xmm0=(tmp0L)\n        pmaddwd   xmm1,[rel PW_F106_MF217]      ; xmm1=(tmp0H)\n\n        movdqa    xmm6,xmm2\n        movdqa    xmm7,xmm2\n        punpcklwd xmm6,xmm3\n        punpckhwd xmm7,xmm3\n        movdqa    xmm2,xmm6\n        movdqa    xmm3,xmm7\n        pmaddwd   xmm6,[rel PW_MF060_MF050]     ; xmm6=(tmp2L)\n        pmaddwd   xmm7,[rel PW_MF060_MF050]     ; xmm7=(tmp2H)\n        pmaddwd   xmm2,[rel PW_F145_MF021]      ; xmm2=(tmp0L)\n        pmaddwd   xmm3,[rel PW_F145_MF021]      ; xmm3=(tmp0H)\n\n        paddd   xmm6,xmm4               ; xmm6=tmp2L\n        paddd   xmm7,xmm5               ; xmm7=tmp2H\n        paddd   xmm2,xmm0               ; xmm2=tmp0L\n        paddd   xmm3,xmm1               ; xmm3=tmp0H\n\n        movdqa  XMMWORD [wk(0)], xmm2   ; wk(0)=tmp0L\n        movdqa  XMMWORD [wk(1)], xmm3   ; wk(1)=tmp0H\n\n        ; -- Even part\n\n        movdqa  xmm4, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm5, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm0, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm4, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm5, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm0, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        pxor      xmm1,xmm1\n        pxor      xmm2,xmm2\n        punpcklwd xmm1,xmm4             ; xmm1=tmp0L\n        punpckhwd xmm2,xmm4             ; xmm2=tmp0H\n        psrad     xmm1,(16-CONST_BITS-1) ; psrad xmm1,16 & pslld xmm1,CONST_BITS+1\n        psrad     xmm2,(16-CONST_BITS-1) ; psrad xmm2,16 & pslld xmm2,CONST_BITS+1\n\n        movdqa    xmm3,xmm5             ; xmm5=in2=z2\n        punpcklwd xmm5,xmm0             ; xmm0=in6=z3\n        punpckhwd xmm3,xmm0\n        pmaddwd   xmm5,[rel PW_F184_MF076]      ; xmm5=tmp2L\n        pmaddwd   xmm3,[rel PW_F184_MF076]      ; xmm3=tmp2H\n\n        movdqa  xmm4,xmm1\n        movdqa  xmm0,xmm2\n        paddd   xmm1,xmm5               ; xmm1=tmp10L\n        paddd   xmm2,xmm3               ; xmm2=tmp10H\n        psubd   xmm4,xmm5               ; xmm4=tmp12L\n        psubd   xmm0,xmm3               ; xmm0=tmp12H\n\n        ; -- Final output stage\n\n        movdqa  xmm5,xmm1\n        movdqa  xmm3,xmm2\n        paddd   xmm1,xmm6               ; xmm1=data0L\n        paddd   xmm2,xmm7               ; xmm2=data0H\n        psubd   xmm5,xmm6               ; xmm5=data3L\n        psubd   xmm3,xmm7               ; xmm3=data3H\n\n        movdqa  xmm6,[rel PD_DESCALE_P1_4]      ; xmm6=[rel PD_DESCALE_P1_4]\n\n        paddd   xmm1,xmm6\n        paddd   xmm2,xmm6\n        psrad   xmm1,DESCALE_P1_4\n        psrad   xmm2,DESCALE_P1_4\n        paddd   xmm5,xmm6\n        paddd   xmm3,xmm6\n        psrad   xmm5,DESCALE_P1_4\n        psrad   xmm3,DESCALE_P1_4\n\n        packssdw  xmm1,xmm2             ; xmm1=data0=(00 01 02 03 04 05 06 07)\n        packssdw  xmm5,xmm3             ; xmm5=data3=(30 31 32 33 34 35 36 37)\n\n        movdqa  xmm7, XMMWORD [wk(0)]   ; xmm7=tmp0L\n        movdqa  xmm6, XMMWORD [wk(1)]   ; xmm6=tmp0H\n\n        movdqa  xmm2,xmm4\n        movdqa  xmm3,xmm0\n        paddd   xmm4,xmm7               ; xmm4=data1L\n        paddd   xmm0,xmm6               ; xmm0=data1H\n        psubd   xmm2,xmm7               ; xmm2=data2L\n        psubd   xmm3,xmm6               ; xmm3=data2H\n\n        movdqa  xmm7,[rel PD_DESCALE_P1_4]      ; xmm7=[rel PD_DESCALE_P1_4]\n\n        paddd   xmm4,xmm7\n        paddd   xmm0,xmm7\n        psrad   xmm4,DESCALE_P1_4\n        psrad   xmm0,DESCALE_P1_4\n        paddd   xmm2,xmm7\n        paddd   xmm3,xmm7\n        psrad   xmm2,DESCALE_P1_4\n        psrad   xmm3,DESCALE_P1_4\n\n        packssdw  xmm4,xmm0             ; xmm4=data1=(10 11 12 13 14 15 16 17)\n        packssdw  xmm2,xmm3             ; xmm2=data2=(20 21 22 23 24 25 26 27)\n\n        movdqa    xmm6,xmm1     ; transpose coefficients(phase 1)\n        punpcklwd xmm1,xmm4     ; xmm1=(00 10 01 11 02 12 03 13)\n        punpckhwd xmm6,xmm4     ; xmm6=(04 14 05 15 06 16 07 17)\n        movdqa    xmm7,xmm2     ; transpose coefficients(phase 1)\n        punpcklwd xmm2,xmm5     ; xmm2=(20 30 21 31 22 32 23 33)\n        punpckhwd xmm7,xmm5     ; xmm7=(24 34 25 35 26 36 27 37)\n\n        movdqa    xmm0,xmm1     ; transpose coefficients(phase 2)\n        punpckldq xmm1,xmm2     ; xmm1=[col0 col1]=(00 10 20 30 01 11 21 31)\n        punpckhdq xmm0,xmm2     ; xmm0=[col2 col3]=(02 12 22 32 03 13 23 33)\n        movdqa    xmm3,xmm6     ; transpose coefficients(phase 2)\n        punpckldq xmm6,xmm7     ; xmm6=[col4 col5]=(04 14 24 34 05 15 25 35)\n        punpckhdq xmm3,xmm7     ; xmm3=[col6 col7]=(06 16 26 36 07 17 27 37)\n.column_end:\n\n        ; -- Prefetch the next coefficient block\n\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n        ; ---- Pass 2: process rows, store into output array.\n\n        mov     rax, [original_rbp]\n        mov     rdi, r12        ; (JSAMPROW *)\n        mov     eax, r13d\n\n        ; -- Even part\n\n        pxor      xmm4,xmm4\n        punpcklwd xmm4,xmm1             ; xmm4=tmp0\n        psrad     xmm4,(16-CONST_BITS-1) ; psrad xmm4,16 & pslld xmm4,CONST_BITS+1\n\n        ; -- Odd part\n\n        punpckhwd xmm1,xmm0\n        punpckhwd xmm6,xmm3\n        movdqa    xmm5,xmm1\n        movdqa    xmm2,xmm6\n        pmaddwd   xmm1,[rel PW_F256_F089]       ; xmm1=(tmp2)\n        pmaddwd   xmm6,[rel PW_MF060_MF050]     ; xmm6=(tmp2)\n        pmaddwd   xmm5,[rel PW_F106_MF217]      ; xmm5=(tmp0)\n        pmaddwd   xmm2,[rel PW_F145_MF021]      ; xmm2=(tmp0)\n\n        paddd     xmm6,xmm1             ; xmm6=tmp2\n        paddd     xmm2,xmm5             ; xmm2=tmp0\n\n        ; -- Even part\n\n        punpcklwd xmm0,xmm3\n        pmaddwd   xmm0,[rel PW_F184_MF076]      ; xmm0=tmp2\n\n        movdqa    xmm7,xmm4\n        paddd     xmm4,xmm0             ; xmm4=tmp10\n        psubd     xmm7,xmm0             ; xmm7=tmp12\n\n        ; -- Final output stage\n\n        movdqa  xmm1,[rel PD_DESCALE_P2_4]      ; xmm1=[rel PD_DESCALE_P2_4]\n\n        movdqa  xmm5,xmm4\n        movdqa  xmm3,xmm7\n        paddd   xmm4,xmm6               ; xmm4=data0=(00 10 20 30)\n        paddd   xmm7,xmm2               ; xmm7=data1=(01 11 21 31)\n        psubd   xmm5,xmm6               ; xmm5=data3=(03 13 23 33)\n        psubd   xmm3,xmm2               ; xmm3=data2=(02 12 22 32)\n\n        paddd   xmm4,xmm1\n        paddd   xmm7,xmm1\n        psrad   xmm4,DESCALE_P2_4\n        psrad   xmm7,DESCALE_P2_4\n        paddd   xmm5,xmm1\n        paddd   xmm3,xmm1\n        psrad   xmm5,DESCALE_P2_4\n        psrad   xmm3,DESCALE_P2_4\n\n        packssdw  xmm4,xmm3             ; xmm4=(00 10 20 30 02 12 22 32)\n        packssdw  xmm7,xmm5             ; xmm7=(01 11 21 31 03 13 23 33)\n\n        movdqa    xmm0,xmm4             ; transpose coefficients(phase 1)\n        punpcklwd xmm4,xmm7             ; xmm4=(00 01 10 11 20 21 30 31)\n        punpckhwd xmm0,xmm7             ; xmm0=(02 03 12 13 22 23 32 33)\n\n        movdqa    xmm6,xmm4             ; transpose coefficients(phase 2)\n        punpckldq xmm4,xmm0             ; xmm4=(00 01 02 03 10 11 12 13)\n        punpckhdq xmm6,xmm0             ; xmm6=(20 21 22 23 30 31 32 33)\n\n        packsswb  xmm4,xmm6             ; xmm4=(00 01 02 03 10 11 12 13 20 ..)\n        paddb     xmm4,[rel PB_CENTERJSAMP]\n\n        pshufd    xmm2,xmm4,0x39        ; xmm2=(10 11 12 13 20 21 22 23 30 ..)\n        pshufd    xmm1,xmm4,0x4E        ; xmm1=(20 21 22 23 30 31 32 33 00 ..)\n        pshufd    xmm3,xmm4,0x93        ; xmm3=(30 31 32 33 00 01 02 03 10 ..)\n\n        mov     rdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW]\n        mov     rsi, JSAMPROW [rdi+1*SIZEOF_JSAMPROW]\n        movd    XMM_DWORD [rdx+rax*SIZEOF_JSAMPLE], xmm4\n        movd    XMM_DWORD [rsi+rax*SIZEOF_JSAMPLE], xmm2\n        mov     rdx, JSAMPROW [rdi+2*SIZEOF_JSAMPROW]\n        mov     rsi, JSAMPROW [rdi+3*SIZEOF_JSAMPROW]\n        movd    XMM_DWORD [rdx+rax*SIZEOF_JSAMPLE], xmm1\n        movd    XMM_DWORD [rsi+rax*SIZEOF_JSAMPLE], xmm3\n\n        uncollect_args\n        mov     rsp,rbp         ; rsp <- aligned rbp\n        pop     rsp             ; rsp <- original rbp\n        pop     rbp\n        ret\n\n\n; --------------------------------------------------------------------------\n;\n; Perform dequantization and inverse DCT on one block of coefficients,\n; producing a reduced-size 2x2 output block.\n;\n; GLOBAL(void)\n; jsimd_idct_2x2_sse2 (void *dct_table, JCOEFPTR coef_block,\n;                      JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n; r10 = void *dct_table\n; r11 = JCOEFPTR coef_block\n; r12 = JSAMPARRAY output_buf\n; r13 = JDIMENSION output_col\n\n        align   16\n        global  EXTN(jsimd_idct_2x2_sse2)\n\nEXTN(jsimd_idct_2x2_sse2):\n        push    rbp\n        mov     rax,rsp\n        mov     rbp,rsp\n        collect_args\n        push    rbx\n\n        ; ---- Pass 1: process columns from input.\n\n        mov     rdx, r10                ; quantptr\n        mov     rsi, r11                ; inptr\n\n        ; | input:                  | result:        |\n        ; | 00 01 ** 03 ** 05 ** 07 |                |\n        ; | 10 11 ** 13 ** 15 ** 17 |                |\n        ; | ** ** ** ** ** ** ** ** |                |\n        ; | 30 31 ** 33 ** 35 ** 37 | A0 A1 A3 A5 A7 |\n        ; | ** ** ** ** ** ** ** ** | B0 B1 B3 B5 B7 |\n        ; | 50 51 ** 53 ** 55 ** 57 |                |\n        ; | ** ** ** ** ** ** ** ** |                |\n        ; | 70 71 ** 73 ** 75 ** 77 |                |\n\n        ; -- Odd part\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm0, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm1, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n        movdqa  xmm2, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm2, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        ; xmm0=(10 11 ** 13 ** 15 ** 17), xmm1=(30 31 ** 33 ** 35 ** 37)\n        ; xmm2=(50 51 ** 53 ** 55 ** 57), xmm3=(70 71 ** 73 ** 75 ** 77)\n\n        pcmpeqd   xmm7,xmm7\n        pslld     xmm7,WORD_BIT         ; xmm7={0x0000 0xFFFF 0x0000 0xFFFF ..}\n\n        movdqa    xmm4,xmm0             ; xmm4=(10 11 ** 13 ** 15 ** 17)\n        movdqa    xmm5,xmm2             ; xmm5=(50 51 ** 53 ** 55 ** 57)\n        punpcklwd xmm4,xmm1             ; xmm4=(10 30 11 31 ** ** 13 33)\n        punpcklwd xmm5,xmm3             ; xmm5=(50 70 51 71 ** ** 53 73)\n        pmaddwd   xmm4,[rel PW_F362_MF127]\n        pmaddwd   xmm5,[rel PW_F085_MF072]\n\n        psrld   xmm0,WORD_BIT           ; xmm0=(11 -- 13 -- 15 -- 17 --)\n        pand    xmm1,xmm7               ; xmm1=(-- 31 -- 33 -- 35 -- 37)\n        psrld   xmm2,WORD_BIT           ; xmm2=(51 -- 53 -- 55 -- 57 --)\n        pand    xmm3,xmm7               ; xmm3=(-- 71 -- 73 -- 75 -- 77)\n        por     xmm0,xmm1               ; xmm0=(11 31 13 33 15 35 17 37)\n        por     xmm2,xmm3               ; xmm2=(51 71 53 73 55 75 57 77)\n        pmaddwd xmm0,[rel PW_F362_MF127]\n        pmaddwd xmm2,[rel PW_F085_MF072]\n\n        paddd   xmm4,xmm5               ; xmm4=tmp0[col0 col1 **** col3]\n        paddd   xmm0,xmm2               ; xmm0=tmp0[col1 col3 col5 col7]\n\n        ; -- Even part\n\n        movdqa  xmm6, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n        pmullw  xmm6, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        ; xmm6=(00 01 ** 03 ** 05 ** 07)\n\n        movdqa  xmm1,xmm6               ; xmm1=(00 01 ** 03 ** 05 ** 07)\n        pslld   xmm6,WORD_BIT           ; xmm6=(-- 00 -- ** -- ** -- **)\n        pand    xmm1,xmm7               ; xmm1=(-- 01 -- 03 -- 05 -- 07)\n        psrad   xmm6,(WORD_BIT-CONST_BITS-2) ; xmm6=tmp10[col0 **** **** ****]\n        psrad   xmm1,(WORD_BIT-CONST_BITS-2) ; xmm1=tmp10[col1 col3 col5 col7]\n\n        ; -- Final output stage\n\n        movdqa  xmm3,xmm6\n        movdqa  xmm5,xmm1\n        paddd   xmm6,xmm4       ; xmm6=data0[col0 **** **** ****]=(A0 ** ** **)\n        paddd   xmm1,xmm0       ; xmm1=data0[col1 col3 col5 col7]=(A1 A3 A5 A7)\n        psubd   xmm3,xmm4       ; xmm3=data1[col0 **** **** ****]=(B0 ** ** **)\n        psubd   xmm5,xmm0       ; xmm5=data1[col1 col3 col5 col7]=(B1 B3 B5 B7)\n\n        movdqa  xmm2,[rel PD_DESCALE_P1_2]      ; xmm2=[rel PD_DESCALE_P1_2]\n\n        punpckldq  xmm6,xmm3            ; xmm6=(A0 B0 ** **)\n\n        movdqa     xmm7,xmm1\n        punpcklqdq xmm1,xmm5            ; xmm1=(A1 A3 B1 B3)\n        punpckhqdq xmm7,xmm5            ; xmm7=(A5 A7 B5 B7)\n\n        paddd   xmm6,xmm2\n        psrad   xmm6,DESCALE_P1_2\n\n        paddd   xmm1,xmm2\n        paddd   xmm7,xmm2\n        psrad   xmm1,DESCALE_P1_2\n        psrad   xmm7,DESCALE_P1_2\n\n        ; -- Prefetch the next coefficient block\n\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n        prefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n        ; ---- Pass 2: process rows, store into output array.\n\n        mov     rdi, r12        ; (JSAMPROW *)\n        mov     eax, r13d\n\n        ; | input:| result:|\n        ; | A0 B0 |        |\n        ; | A1 B1 | C0 C1  |\n        ; | A3 B3 | D0 D1  |\n        ; | A5 B5 |        |\n        ; | A7 B7 |        |\n\n        ; -- Odd part\n\n        packssdw  xmm1,xmm1             ; xmm1=(A1 A3 B1 B3 A1 A3 B1 B3)\n        packssdw  xmm7,xmm7             ; xmm7=(A5 A7 B5 B7 A5 A7 B5 B7)\n        pmaddwd   xmm1,[rel PW_F362_MF127]\n        pmaddwd   xmm7,[rel PW_F085_MF072]\n\n        paddd     xmm1,xmm7             ; xmm1=tmp0[row0 row1 row0 row1]\n\n        ; -- Even part\n\n        pslld     xmm6,(CONST_BITS+2)   ; xmm6=tmp10[row0 row1 **** ****]\n\n        ; -- Final output stage\n\n        movdqa    xmm4,xmm6\n        paddd     xmm6,xmm1     ; xmm6=data0[row0 row1 **** ****]=(C0 C1 ** **)\n        psubd     xmm4,xmm1     ; xmm4=data1[row0 row1 **** ****]=(D0 D1 ** **)\n\n        punpckldq xmm6,xmm4     ; xmm6=(C0 D0 C1 D1)\n\n        paddd     xmm6,[rel PD_DESCALE_P2_2]\n        psrad     xmm6,DESCALE_P2_2\n\n        packssdw  xmm6,xmm6             ; xmm6=(C0 D0 C1 D1 C0 D0 C1 D1)\n        packsswb  xmm6,xmm6             ; xmm6=(C0 D0 C1 D1 C0 D0 C1 D1 ..)\n        paddb     xmm6,[rel PB_CENTERJSAMP]\n\n        pextrw  ebx,xmm6,0x00           ; ebx=(C0 D0 -- --)\n        pextrw  ecx,xmm6,0x01           ; ecx=(C1 D1 -- --)\n\n        mov     rdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW]\n        mov     rsi, JSAMPROW [rdi+1*SIZEOF_JSAMPROW]\n        mov     WORD [rdx+rax*SIZEOF_JSAMPLE], bx\n        mov     WORD [rsi+rax*SIZEOF_JSAMPLE], cx\n\n        pop     rbx\n        uncollect_args\n        pop     rbp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jidctred-sse2.asm",
    "content": ";\n; jidctred.asm - reduced-size IDCT (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains inverse-DCT routines that produce reduced-size\n; output: either 4x4 or 2x2 pixels from an 8x8 DCT block.\n; The following code is based directly on the IJG's original jidctred.c;\n; see the jidctred.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS      13\n%define PASS1_BITS      2\n\n%define DESCALE_P1_4    (CONST_BITS-PASS1_BITS+1)\n%define DESCALE_P2_4    (CONST_BITS+PASS1_BITS+3+1)\n%define DESCALE_P1_2    (CONST_BITS-PASS1_BITS+2)\n%define DESCALE_P2_2    (CONST_BITS+PASS1_BITS+3+2)\n\n%if CONST_BITS == 13\nF_0_211 equ      1730           ; FIX(0.211164243)\nF_0_509 equ      4176           ; FIX(0.509795579)\nF_0_601 equ      4926           ; FIX(0.601344887)\nF_0_720 equ      5906           ; FIX(0.720959822)\nF_0_765 equ      6270           ; FIX(0.765366865)\nF_0_850 equ      6967           ; FIX(0.850430095)\nF_0_899 equ      7373           ; FIX(0.899976223)\nF_1_061 equ      8697           ; FIX(1.061594337)\nF_1_272 equ     10426           ; FIX(1.272758580)\nF_1_451 equ     11893           ; FIX(1.451774981)\nF_1_847 equ     15137           ; FIX(1.847759065)\nF_2_172 equ     17799           ; FIX(2.172734803)\nF_2_562 equ     20995           ; FIX(2.562915447)\nF_3_624 equ     29692           ; FIX(3.624509785)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_211 equ     DESCALE( 226735879,30-CONST_BITS)       ; FIX(0.211164243)\nF_0_509 equ     DESCALE( 547388834,30-CONST_BITS)       ; FIX(0.509795579)\nF_0_601 equ     DESCALE( 645689155,30-CONST_BITS)       ; FIX(0.601344887)\nF_0_720 equ     DESCALE( 774124714,30-CONST_BITS)       ; FIX(0.720959822)\nF_0_765 equ     DESCALE( 821806413,30-CONST_BITS)       ; FIX(0.765366865)\nF_0_850 equ     DESCALE( 913142361,30-CONST_BITS)       ; FIX(0.850430095)\nF_0_899 equ     DESCALE( 966342111,30-CONST_BITS)       ; FIX(0.899976223)\nF_1_061 equ     DESCALE(1139878239,30-CONST_BITS)       ; FIX(1.061594337)\nF_1_272 equ     DESCALE(1366614119,30-CONST_BITS)       ; FIX(1.272758580)\nF_1_451 equ     DESCALE(1558831516,30-CONST_BITS)       ; FIX(1.451774981)\nF_1_847 equ     DESCALE(1984016188,30-CONST_BITS)       ; FIX(1.847759065)\nF_2_172 equ     DESCALE(2332956230,30-CONST_BITS)       ; FIX(2.172734803)\nF_2_562 equ     DESCALE(2751909506,30-CONST_BITS)       ; FIX(2.562915447)\nF_3_624 equ     DESCALE(3891787747,30-CONST_BITS)       ; FIX(3.624509785)\n%endif\n\n; --------------------------------------------------------------------------\n        SECTION SEG_CONST\n\n        alignz  16\n        global  EXTN(jconst_idct_red_sse2)\n\nEXTN(jconst_idct_red_sse2):\n\nPW_F184_MF076   times 4 dw  F_1_847,-F_0_765\nPW_F256_F089    times 4 dw  F_2_562, F_0_899\nPW_F106_MF217   times 4 dw  F_1_061,-F_2_172\nPW_MF060_MF050  times 4 dw -F_0_601,-F_0_509\nPW_F145_MF021   times 4 dw  F_1_451,-F_0_211\nPW_F362_MF127   times 4 dw  F_3_624,-F_1_272\nPW_F085_MF072   times 4 dw  F_0_850,-F_0_720\nPD_DESCALE_P1_4 times 4 dd  1 << (DESCALE_P1_4-1)\nPD_DESCALE_P2_4 times 4 dd  1 << (DESCALE_P2_4-1)\nPD_DESCALE_P1_2 times 4 dd  1 << (DESCALE_P1_2-1)\nPD_DESCALE_P2_2 times 4 dd  1 << (DESCALE_P2_2-1)\nPB_CENTERJSAMP  times 16 db CENTERJSAMPLE\n\n        alignz  16\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Perform dequantization and inverse DCT on one block of coefficients,\n; producing a reduced-size 4x4 output block.\n;\n; GLOBAL(void)\n; jsimd_idct_4x4_sse2 (void *dct_table, JCOEFPTR coef_block,\n;                      JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)    (b)+8           ; void *dct_table\n%define coef_block(b)   (b)+12          ; JCOEFPTR coef_block\n%define output_buf(b)   (b)+16          ; JSAMPARRAY output_buf\n%define output_col(b)   (b)+20          ; JDIMENSION output_col\n\n%define original_ebp    ebp+0\n%define wk(i)           ebp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]\n%define WK_NUM          2\n\n        align   16\n        global  EXTN(jsimd_idct_4x4_sse2)\n\nEXTN(jsimd_idct_4x4_sse2):\n        push    ebp\n        mov     eax,esp                         ; eax = original ebp\n        sub     esp, byte 4\n        and     esp, byte (-SIZEOF_XMMWORD)     ; align to 128 bits\n        mov     [esp],eax\n        mov     ebp,esp                         ; ebp = aligned ebp\n        lea     esp, [wk(0)]\n        pushpic ebx\n;       push    ecx             ; unused\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process columns from input.\n\n;       mov     eax, [original_ebp]\n        mov     edx, POINTER [dct_table(eax)]           ; quantptr\n        mov     esi, JCOEFPTR [coef_block(eax)]         ; inptr\n\n%ifndef NO_ZERO_COLUMN_TEST_4X4_SSE2\n        mov     eax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        or      eax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        jnz     short .columnDCT\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        por     xmm1, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        por     xmm0, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n        por     xmm1, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        por     xmm0,xmm1\n        packsswb xmm0,xmm0\n        packsswb xmm0,xmm0\n        movd    eax,xmm0\n        test    eax,eax\n        jnz     short .columnDCT\n\n        ; -- AC terms all zero\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        psllw   xmm0,PASS1_BITS\n\n        movdqa    xmm3,xmm0     ; xmm0=in0=(00 01 02 03 04 05 06 07)\n        punpcklwd xmm0,xmm0     ; xmm0=(00 00 01 01 02 02 03 03)\n        punpckhwd xmm3,xmm3     ; xmm3=(04 04 05 05 06 06 07 07)\n\n        pshufd  xmm1,xmm0,0x50  ; xmm1=[col0 col1]=(00 00 00 00 01 01 01 01)\n        pshufd  xmm0,xmm0,0xFA  ; xmm0=[col2 col3]=(02 02 02 02 03 03 03 03)\n        pshufd  xmm6,xmm3,0x50  ; xmm6=[col4 col5]=(04 04 04 04 05 05 05 05)\n        pshufd  xmm3,xmm3,0xFA  ; xmm3=[col6 col7]=(06 06 06 06 07 07 07 07)\n\n        jmp     near .column_end\n        alignx  16,7\n%endif\n.columnDCT:\n\n        ; -- Odd part\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm0, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm1, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        movdqa  xmm2, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm2, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm3, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        movdqa    xmm4,xmm0\n        movdqa    xmm5,xmm0\n        punpcklwd xmm4,xmm1\n        punpckhwd xmm5,xmm1\n        movdqa    xmm0,xmm4\n        movdqa    xmm1,xmm5\n        pmaddwd   xmm4,[GOTOFF(ebx,PW_F256_F089)]       ; xmm4=(tmp2L)\n        pmaddwd   xmm5,[GOTOFF(ebx,PW_F256_F089)]       ; xmm5=(tmp2H)\n        pmaddwd   xmm0,[GOTOFF(ebx,PW_F106_MF217)]      ; xmm0=(tmp0L)\n        pmaddwd   xmm1,[GOTOFF(ebx,PW_F106_MF217)]      ; xmm1=(tmp0H)\n\n        movdqa    xmm6,xmm2\n        movdqa    xmm7,xmm2\n        punpcklwd xmm6,xmm3\n        punpckhwd xmm7,xmm3\n        movdqa    xmm2,xmm6\n        movdqa    xmm3,xmm7\n        pmaddwd   xmm6,[GOTOFF(ebx,PW_MF060_MF050)]     ; xmm6=(tmp2L)\n        pmaddwd   xmm7,[GOTOFF(ebx,PW_MF060_MF050)]     ; xmm7=(tmp2H)\n        pmaddwd   xmm2,[GOTOFF(ebx,PW_F145_MF021)]      ; xmm2=(tmp0L)\n        pmaddwd   xmm3,[GOTOFF(ebx,PW_F145_MF021)]      ; xmm3=(tmp0H)\n\n        paddd   xmm6,xmm4               ; xmm6=tmp2L\n        paddd   xmm7,xmm5               ; xmm7=tmp2H\n        paddd   xmm2,xmm0               ; xmm2=tmp0L\n        paddd   xmm3,xmm1               ; xmm3=tmp0H\n\n        movdqa  XMMWORD [wk(0)], xmm2   ; wk(0)=tmp0L\n        movdqa  XMMWORD [wk(1)], xmm3   ; wk(1)=tmp0H\n\n        ; -- Even part\n\n        movdqa  xmm4, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm5, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm0, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm4, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm5, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm0, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        pxor      xmm1,xmm1\n        pxor      xmm2,xmm2\n        punpcklwd xmm1,xmm4             ; xmm1=tmp0L\n        punpckhwd xmm2,xmm4             ; xmm2=tmp0H\n        psrad     xmm1,(16-CONST_BITS-1) ; psrad xmm1,16 & pslld xmm1,CONST_BITS+1\n        psrad     xmm2,(16-CONST_BITS-1) ; psrad xmm2,16 & pslld xmm2,CONST_BITS+1\n\n        movdqa    xmm3,xmm5             ; xmm5=in2=z2\n        punpcklwd xmm5,xmm0             ; xmm0=in6=z3\n        punpckhwd xmm3,xmm0\n        pmaddwd   xmm5,[GOTOFF(ebx,PW_F184_MF076)]      ; xmm5=tmp2L\n        pmaddwd   xmm3,[GOTOFF(ebx,PW_F184_MF076)]      ; xmm3=tmp2H\n\n        movdqa  xmm4,xmm1\n        movdqa  xmm0,xmm2\n        paddd   xmm1,xmm5               ; xmm1=tmp10L\n        paddd   xmm2,xmm3               ; xmm2=tmp10H\n        psubd   xmm4,xmm5               ; xmm4=tmp12L\n        psubd   xmm0,xmm3               ; xmm0=tmp12H\n\n        ; -- Final output stage\n\n        movdqa  xmm5,xmm1\n        movdqa  xmm3,xmm2\n        paddd   xmm1,xmm6               ; xmm1=data0L\n        paddd   xmm2,xmm7               ; xmm2=data0H\n        psubd   xmm5,xmm6               ; xmm5=data3L\n        psubd   xmm3,xmm7               ; xmm3=data3H\n\n        movdqa  xmm6,[GOTOFF(ebx,PD_DESCALE_P1_4)]      ; xmm6=[PD_DESCALE_P1_4]\n\n        paddd   xmm1,xmm6\n        paddd   xmm2,xmm6\n        psrad   xmm1,DESCALE_P1_4\n        psrad   xmm2,DESCALE_P1_4\n        paddd   xmm5,xmm6\n        paddd   xmm3,xmm6\n        psrad   xmm5,DESCALE_P1_4\n        psrad   xmm3,DESCALE_P1_4\n\n        packssdw  xmm1,xmm2             ; xmm1=data0=(00 01 02 03 04 05 06 07)\n        packssdw  xmm5,xmm3             ; xmm5=data3=(30 31 32 33 34 35 36 37)\n\n        movdqa  xmm7, XMMWORD [wk(0)]   ; xmm7=tmp0L\n        movdqa  xmm6, XMMWORD [wk(1)]   ; xmm6=tmp0H\n\n        movdqa  xmm2,xmm4\n        movdqa  xmm3,xmm0\n        paddd   xmm4,xmm7               ; xmm4=data1L\n        paddd   xmm0,xmm6               ; xmm0=data1H\n        psubd   xmm2,xmm7               ; xmm2=data2L\n        psubd   xmm3,xmm6               ; xmm3=data2H\n\n        movdqa  xmm7,[GOTOFF(ebx,PD_DESCALE_P1_4)]      ; xmm7=[PD_DESCALE_P1_4]\n\n        paddd   xmm4,xmm7\n        paddd   xmm0,xmm7\n        psrad   xmm4,DESCALE_P1_4\n        psrad   xmm0,DESCALE_P1_4\n        paddd   xmm2,xmm7\n        paddd   xmm3,xmm7\n        psrad   xmm2,DESCALE_P1_4\n        psrad   xmm3,DESCALE_P1_4\n\n        packssdw  xmm4,xmm0             ; xmm4=data1=(10 11 12 13 14 15 16 17)\n        packssdw  xmm2,xmm3             ; xmm2=data2=(20 21 22 23 24 25 26 27)\n\n        movdqa    xmm6,xmm1     ; transpose coefficients(phase 1)\n        punpcklwd xmm1,xmm4     ; xmm1=(00 10 01 11 02 12 03 13)\n        punpckhwd xmm6,xmm4     ; xmm6=(04 14 05 15 06 16 07 17)\n        movdqa    xmm7,xmm2     ; transpose coefficients(phase 1)\n        punpcklwd xmm2,xmm5     ; xmm2=(20 30 21 31 22 32 23 33)\n        punpckhwd xmm7,xmm5     ; xmm7=(24 34 25 35 26 36 27 37)\n\n        movdqa    xmm0,xmm1     ; transpose coefficients(phase 2)\n        punpckldq xmm1,xmm2     ; xmm1=[col0 col1]=(00 10 20 30 01 11 21 31)\n        punpckhdq xmm0,xmm2     ; xmm0=[col2 col3]=(02 12 22 32 03 13 23 33)\n        movdqa    xmm3,xmm6     ; transpose coefficients(phase 2)\n        punpckldq xmm6,xmm7     ; xmm6=[col4 col5]=(04 14 24 34 05 15 25 35)\n        punpckhdq xmm3,xmm7     ; xmm3=[col6 col7]=(06 16 26 36 07 17 27 37)\n.column_end:\n\n        ; -- Prefetch the next coefficient block\n\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n        ; ---- Pass 2: process rows, store into output array.\n\n        mov     eax, [original_ebp]\n        mov     edi, JSAMPARRAY [output_buf(eax)]       ; (JSAMPROW *)\n        mov     eax, JDIMENSION [output_col(eax)]\n\n        ; -- Even part\n\n        pxor      xmm4,xmm4\n        punpcklwd xmm4,xmm1             ; xmm4=tmp0\n        psrad     xmm4,(16-CONST_BITS-1) ; psrad xmm4,16 & pslld xmm4,CONST_BITS+1\n\n        ; -- Odd part\n\n        punpckhwd xmm1,xmm0\n        punpckhwd xmm6,xmm3\n        movdqa    xmm5,xmm1\n        movdqa    xmm2,xmm6\n        pmaddwd   xmm1,[GOTOFF(ebx,PW_F256_F089)]       ; xmm1=(tmp2)\n        pmaddwd   xmm6,[GOTOFF(ebx,PW_MF060_MF050)]     ; xmm6=(tmp2)\n        pmaddwd   xmm5,[GOTOFF(ebx,PW_F106_MF217)]      ; xmm5=(tmp0)\n        pmaddwd   xmm2,[GOTOFF(ebx,PW_F145_MF021)]      ; xmm2=(tmp0)\n\n        paddd     xmm6,xmm1             ; xmm6=tmp2\n        paddd     xmm2,xmm5             ; xmm2=tmp0\n\n        ; -- Even part\n\n        punpcklwd xmm0,xmm3\n        pmaddwd   xmm0,[GOTOFF(ebx,PW_F184_MF076)]      ; xmm0=tmp2\n\n        movdqa    xmm7,xmm4\n        paddd     xmm4,xmm0             ; xmm4=tmp10\n        psubd     xmm7,xmm0             ; xmm7=tmp12\n\n        ; -- Final output stage\n\n        movdqa  xmm1,[GOTOFF(ebx,PD_DESCALE_P2_4)]      ; xmm1=[PD_DESCALE_P2_4]\n\n        movdqa  xmm5,xmm4\n        movdqa  xmm3,xmm7\n        paddd   xmm4,xmm6               ; xmm4=data0=(00 10 20 30)\n        paddd   xmm7,xmm2               ; xmm7=data1=(01 11 21 31)\n        psubd   xmm5,xmm6               ; xmm5=data3=(03 13 23 33)\n        psubd   xmm3,xmm2               ; xmm3=data2=(02 12 22 32)\n\n        paddd   xmm4,xmm1\n        paddd   xmm7,xmm1\n        psrad   xmm4,DESCALE_P2_4\n        psrad   xmm7,DESCALE_P2_4\n        paddd   xmm5,xmm1\n        paddd   xmm3,xmm1\n        psrad   xmm5,DESCALE_P2_4\n        psrad   xmm3,DESCALE_P2_4\n\n        packssdw  xmm4,xmm3             ; xmm4=(00 10 20 30 02 12 22 32)\n        packssdw  xmm7,xmm5             ; xmm7=(01 11 21 31 03 13 23 33)\n\n        movdqa    xmm0,xmm4             ; transpose coefficients(phase 1)\n        punpcklwd xmm4,xmm7             ; xmm4=(00 01 10 11 20 21 30 31)\n        punpckhwd xmm0,xmm7             ; xmm0=(02 03 12 13 22 23 32 33)\n\n        movdqa    xmm6,xmm4             ; transpose coefficients(phase 2)\n        punpckldq xmm4,xmm0             ; xmm4=(00 01 02 03 10 11 12 13)\n        punpckhdq xmm6,xmm0             ; xmm6=(20 21 22 23 30 31 32 33)\n\n        packsswb  xmm4,xmm6             ; xmm4=(00 01 02 03 10 11 12 13 20 ..)\n        paddb     xmm4,[GOTOFF(ebx,PB_CENTERJSAMP)]\n\n        pshufd    xmm2,xmm4,0x39        ; xmm2=(10 11 12 13 20 21 22 23 30 ..)\n        pshufd    xmm1,xmm4,0x4E        ; xmm1=(20 21 22 23 30 31 32 33 00 ..)\n        pshufd    xmm3,xmm4,0x93        ; xmm3=(30 31 32 33 00 01 02 03 10 ..)\n\n        mov     edx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n        mov     esi, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n        movd    XMM_DWORD [edx+eax*SIZEOF_JSAMPLE], xmm4\n        movd    XMM_DWORD [esi+eax*SIZEOF_JSAMPLE], xmm2\n        mov     edx, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n        mov     esi, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n        movd    XMM_DWORD [edx+eax*SIZEOF_JSAMPLE], xmm1\n        movd    XMM_DWORD [esi+eax*SIZEOF_JSAMPLE], xmm3\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; unused\n        poppic  ebx\n        mov     esp,ebp         ; esp <- aligned ebp\n        pop     esp             ; esp <- original ebp\n        pop     ebp\n        ret\n\n\n; --------------------------------------------------------------------------\n;\n; Perform dequantization and inverse DCT on one block of coefficients,\n; producing a reduced-size 2x2 output block.\n;\n; GLOBAL(void)\n; jsimd_idct_2x2_sse2 (void *dct_table, JCOEFPTR coef_block,\n;                      JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)    (b)+8           ; void *dct_table\n%define coef_block(b)   (b)+12          ; JCOEFPTR coef_block\n%define output_buf(b)   (b)+16          ; JSAMPARRAY output_buf\n%define output_col(b)   (b)+20          ; JDIMENSION output_col\n\n        align   16\n        global  EXTN(jsimd_idct_2x2_sse2)\n\nEXTN(jsimd_idct_2x2_sse2):\n        push    ebp\n        mov     ebp,esp\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        get_GOT ebx             ; get GOT address\n\n        ; ---- Pass 1: process columns from input.\n\n        mov     edx, POINTER [dct_table(ebp)]           ; quantptr\n        mov     esi, JCOEFPTR [coef_block(ebp)]         ; inptr\n\n        ; | input:                  | result:        |\n        ; | 00 01 ** 03 ** 05 ** 07 |                |\n        ; | 10 11 ** 13 ** 15 ** 17 |                |\n        ; | ** ** ** ** ** ** ** ** |                |\n        ; | 30 31 ** 33 ** 35 ** 37 | A0 A1 A3 A5 A7 |\n        ; | ** ** ** ** ** ** ** ** | B0 B1 B3 B5 B7 |\n        ; | 50 51 ** 53 ** 55 ** 57 |                |\n        ; | ** ** ** ** ** ** ** ** |                |\n        ; | 70 71 ** 73 ** 75 ** 77 |                |\n\n        ; -- Odd part\n\n        movdqa  xmm0, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm1, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm0, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm1, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        movdqa  xmm2, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n        movdqa  xmm3, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm2, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n        pmullw  xmm3, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        ; xmm0=(10 11 ** 13 ** 15 ** 17), xmm1=(30 31 ** 33 ** 35 ** 37)\n        ; xmm2=(50 51 ** 53 ** 55 ** 57), xmm3=(70 71 ** 73 ** 75 ** 77)\n\n        pcmpeqd   xmm7,xmm7\n        pslld     xmm7,WORD_BIT         ; xmm7={0x0000 0xFFFF 0x0000 0xFFFF ..}\n\n        movdqa    xmm4,xmm0             ; xmm4=(10 11 ** 13 ** 15 ** 17)\n        movdqa    xmm5,xmm2             ; xmm5=(50 51 ** 53 ** 55 ** 57)\n        punpcklwd xmm4,xmm1             ; xmm4=(10 30 11 31 ** ** 13 33)\n        punpcklwd xmm5,xmm3             ; xmm5=(50 70 51 71 ** ** 53 73)\n        pmaddwd   xmm4,[GOTOFF(ebx,PW_F362_MF127)]\n        pmaddwd   xmm5,[GOTOFF(ebx,PW_F085_MF072)]\n\n        psrld   xmm0,WORD_BIT           ; xmm0=(11 -- 13 -- 15 -- 17 --)\n        pand    xmm1,xmm7               ; xmm1=(-- 31 -- 33 -- 35 -- 37)\n        psrld   xmm2,WORD_BIT           ; xmm2=(51 -- 53 -- 55 -- 57 --)\n        pand    xmm3,xmm7               ; xmm3=(-- 71 -- 73 -- 75 -- 77)\n        por     xmm0,xmm1               ; xmm0=(11 31 13 33 15 35 17 37)\n        por     xmm2,xmm3               ; xmm2=(51 71 53 73 55 75 57 77)\n        pmaddwd xmm0,[GOTOFF(ebx,PW_F362_MF127)]\n        pmaddwd xmm2,[GOTOFF(ebx,PW_F085_MF072)]\n\n        paddd   xmm4,xmm5               ; xmm4=tmp0[col0 col1 **** col3]\n        paddd   xmm0,xmm2               ; xmm0=tmp0[col1 col3 col5 col7]\n\n        ; -- Even part\n\n        movdqa  xmm6, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n        pmullw  xmm6, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n        ; xmm6=(00 01 ** 03 ** 05 ** 07)\n\n        movdqa  xmm1,xmm6               ; xmm1=(00 01 ** 03 ** 05 ** 07)\n        pslld   xmm6,WORD_BIT           ; xmm6=(-- 00 -- ** -- ** -- **)\n        pand    xmm1,xmm7               ; xmm1=(-- 01 -- 03 -- 05 -- 07)\n        psrad   xmm6,(WORD_BIT-CONST_BITS-2) ; xmm6=tmp10[col0 **** **** ****]\n        psrad   xmm1,(WORD_BIT-CONST_BITS-2) ; xmm1=tmp10[col1 col3 col5 col7]\n\n        ; -- Final output stage\n\n        movdqa  xmm3,xmm6\n        movdqa  xmm5,xmm1\n        paddd   xmm6,xmm4       ; xmm6=data0[col0 **** **** ****]=(A0 ** ** **)\n        paddd   xmm1,xmm0       ; xmm1=data0[col1 col3 col5 col7]=(A1 A3 A5 A7)\n        psubd   xmm3,xmm4       ; xmm3=data1[col0 **** **** ****]=(B0 ** ** **)\n        psubd   xmm5,xmm0       ; xmm5=data1[col1 col3 col5 col7]=(B1 B3 B5 B7)\n\n        movdqa  xmm2,[GOTOFF(ebx,PD_DESCALE_P1_2)]      ; xmm2=[PD_DESCALE_P1_2]\n\n        punpckldq  xmm6,xmm3            ; xmm6=(A0 B0 ** **)\n\n        movdqa     xmm7,xmm1\n        punpcklqdq xmm1,xmm5            ; xmm1=(A1 A3 B1 B3)\n        punpckhqdq xmm7,xmm5            ; xmm7=(A5 A7 B5 B7)\n\n        paddd   xmm6,xmm2\n        psrad   xmm6,DESCALE_P1_2\n\n        paddd   xmm1,xmm2\n        paddd   xmm7,xmm2\n        psrad   xmm1,DESCALE_P1_2\n        psrad   xmm7,DESCALE_P1_2\n\n        ; -- Prefetch the next coefficient block\n\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n        prefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n        ; ---- Pass 2: process rows, store into output array.\n\n        mov     edi, JSAMPARRAY [output_buf(ebp)]       ; (JSAMPROW *)\n        mov     eax, JDIMENSION [output_col(ebp)]\n\n        ; | input:| result:|\n        ; | A0 B0 |        |\n        ; | A1 B1 | C0 C1  |\n        ; | A3 B3 | D0 D1  |\n        ; | A5 B5 |        |\n        ; | A7 B7 |        |\n\n        ; -- Odd part\n\n        packssdw  xmm1,xmm1             ; xmm1=(A1 A3 B1 B3 A1 A3 B1 B3)\n        packssdw  xmm7,xmm7             ; xmm7=(A5 A7 B5 B7 A5 A7 B5 B7)\n        pmaddwd   xmm1,[GOTOFF(ebx,PW_F362_MF127)]\n        pmaddwd   xmm7,[GOTOFF(ebx,PW_F085_MF072)]\n\n        paddd     xmm1,xmm7             ; xmm1=tmp0[row0 row1 row0 row1]\n\n        ; -- Even part\n\n        pslld     xmm6,(CONST_BITS+2)   ; xmm6=tmp10[row0 row1 **** ****]\n\n        ; -- Final output stage\n\n        movdqa    xmm4,xmm6\n        paddd     xmm6,xmm1     ; xmm6=data0[row0 row1 **** ****]=(C0 C1 ** **)\n        psubd     xmm4,xmm1     ; xmm4=data1[row0 row1 **** ****]=(D0 D1 ** **)\n\n        punpckldq xmm6,xmm4     ; xmm6=(C0 D0 C1 D1)\n\n        paddd     xmm6,[GOTOFF(ebx,PD_DESCALE_P2_2)]\n        psrad     xmm6,DESCALE_P2_2\n\n        packssdw  xmm6,xmm6             ; xmm6=(C0 D0 C1 D1 C0 D0 C1 D1)\n        packsswb  xmm6,xmm6             ; xmm6=(C0 D0 C1 D1 C0 D0 C1 D1 ..)\n        paddb     xmm6,[GOTOFF(ebx,PB_CENTERJSAMP)]\n\n        pextrw  ebx,xmm6,0x00           ; ebx=(C0 D0 -- --)\n        pextrw  ecx,xmm6,0x01           ; ecx=(C1 D1 -- --)\n\n        mov     edx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n        mov     esi, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n        mov     WORD [edx+eax*SIZEOF_JSAMPLE], bx\n        mov     WORD [esi+eax*SIZEOF_JSAMPLE], cx\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jpeg_nbits_table.inc",
    "content": "jpeg_nbits_table db  \\\n   0,  1,  2,  2,  3,  3,  3,  3,  4,  4,  4,  4,  4,  4,  4,  4,  \\\n   5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  \\\n   6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  \\\n   6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  6,  \\\n   7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  \\\n   7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  \\\n   7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  \\\n   7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  7,  \\\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  \\\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  \\\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  \\\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  \\\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  \\\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  \\\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  \\\n   8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  8,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n   9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,  \\\n  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jquant-3dn.asm",
    "content": ";\n; jquant.asm - sample data conversion and quantization (3DNow! & MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Load data into workspace, applying unsigned->signed conversion\n;\n; GLOBAL(void)\n; jsimd_convsamp_float_3dnow (JSAMPARRAY sample_data, JDIMENSION start_col,\n;                             FAST_FLOAT *workspace);\n;\n\n%define sample_data     ebp+8           ; JSAMPARRAY sample_data\n%define start_col       ebp+12          ; JDIMENSION start_col\n%define workspace       ebp+16          ; FAST_FLOAT *workspace\n\n        align   16\n        global  EXTN(jsimd_convsamp_float_3dnow)\n\nEXTN(jsimd_convsamp_float_3dnow):\n        push    ebp\n        mov     ebp,esp\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        pcmpeqw  mm7,mm7\n        psllw    mm7,7\n        packsswb mm7,mm7                ; mm7 = PB_CENTERJSAMPLE (0x808080..)\n\n        mov     esi, JSAMPARRAY [sample_data]   ; (JSAMPROW *)\n        mov     eax, JDIMENSION [start_col]\n        mov     edi, POINTER [workspace]        ; (DCTELEM *)\n        mov     ecx, DCTSIZE/2\n        alignx  16,7\n.convloop:\n        mov     ebx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n        mov     edx, JSAMPROW [esi+1*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n\n        movq    mm0, MMWORD [ebx+eax*SIZEOF_JSAMPLE]\n        movq    mm1, MMWORD [edx+eax*SIZEOF_JSAMPLE]\n\n        psubb   mm0,mm7                         ; mm0=(01234567)\n        psubb   mm1,mm7                         ; mm1=(89ABCDEF)\n\n        punpcklbw mm2,mm0                       ; mm2=(*0*1*2*3)\n        punpckhbw mm0,mm0                       ; mm0=(*4*5*6*7)\n        punpcklbw mm3,mm1                       ; mm3=(*8*9*A*B)\n        punpckhbw mm1,mm1                       ; mm1=(*C*D*E*F)\n\n        punpcklwd mm4,mm2                       ; mm4=(***0***1)\n        punpckhwd mm2,mm2                       ; mm2=(***2***3)\n        punpcklwd mm5,mm0                       ; mm5=(***4***5)\n        punpckhwd mm0,mm0                       ; mm0=(***6***7)\n\n        psrad   mm4,(DWORD_BIT-BYTE_BIT)        ; mm4=(01)\n        psrad   mm2,(DWORD_BIT-BYTE_BIT)        ; mm2=(23)\n        pi2fd   mm4,mm4\n        pi2fd   mm2,mm2\n        psrad   mm5,(DWORD_BIT-BYTE_BIT)        ; mm5=(45)\n        psrad   mm0,(DWORD_BIT-BYTE_BIT)        ; mm0=(67)\n        pi2fd   mm5,mm5\n        pi2fd   mm0,mm0\n\n        movq    MMWORD [MMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], mm4\n        movq    MMWORD [MMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], mm2\n        movq    MMWORD [MMBLOCK(0,2,edi,SIZEOF_FAST_FLOAT)], mm5\n        movq    MMWORD [MMBLOCK(0,3,edi,SIZEOF_FAST_FLOAT)], mm0\n\n        punpcklwd mm6,mm3                       ; mm6=(***8***9)\n        punpckhwd mm3,mm3                       ; mm3=(***A***B)\n        punpcklwd mm4,mm1                       ; mm4=(***C***D)\n        punpckhwd mm1,mm1                       ; mm1=(***E***F)\n\n        psrad   mm6,(DWORD_BIT-BYTE_BIT)        ; mm6=(89)\n        psrad   mm3,(DWORD_BIT-BYTE_BIT)        ; mm3=(AB)\n        pi2fd   mm6,mm6\n        pi2fd   mm3,mm3\n        psrad   mm4,(DWORD_BIT-BYTE_BIT)        ; mm4=(CD)\n        psrad   mm1,(DWORD_BIT-BYTE_BIT)        ; mm1=(EF)\n        pi2fd   mm4,mm4\n        pi2fd   mm1,mm1\n\n        movq    MMWORD [MMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], mm6\n        movq    MMWORD [MMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], mm3\n        movq    MMWORD [MMBLOCK(1,2,edi,SIZEOF_FAST_FLOAT)], mm4\n        movq    MMWORD [MMBLOCK(1,3,edi,SIZEOF_FAST_FLOAT)], mm1\n\n        add     esi, byte 2*SIZEOF_JSAMPROW\n        add     edi, byte 2*DCTSIZE*SIZEOF_FAST_FLOAT\n        dec     ecx\n        jnz     near .convloop\n\n        femms           ; empty MMX/3DNow! state\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        pop     ebp\n        ret\n\n\n; --------------------------------------------------------------------------\n;\n; Quantize/descale the coefficients, and store into coef_block\n;\n; GLOBAL(void)\n; jsimd_quantize_float_3dnow (JCOEFPTR coef_block, FAST_FLOAT *divisors,\n;                             FAST_FLOAT *workspace);\n;\n\n%define coef_block      ebp+8           ; JCOEFPTR coef_block\n%define divisors        ebp+12          ; FAST_FLOAT *divisors\n%define workspace       ebp+16          ; FAST_FLOAT *workspace\n\n        align   16\n        global  EXTN(jsimd_quantize_float_3dnow)\n\nEXTN(jsimd_quantize_float_3dnow):\n        push    ebp\n        mov     ebp,esp\n;       push    ebx             ; unused\n;       push    ecx             ; unused\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        mov       eax, 0x4B400000       ; (float)0x00C00000 (rndint_magic)\n        movd      mm7,eax\n        punpckldq mm7,mm7               ; mm7={12582912.0F 12582912.0F}\n\n        mov     esi, POINTER [workspace]\n        mov     edx, POINTER [divisors]\n        mov     edi, JCOEFPTR [coef_block]\n        mov     eax, DCTSIZE2/16\n        alignx  16,7\n.quantloop:\n        movq    mm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_FAST_FLOAT)]\n        movq    mm1, MMWORD [MMBLOCK(0,1,esi,SIZEOF_FAST_FLOAT)]\n        pfmul   mm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)]\n        pfmul   mm1, MMWORD [MMBLOCK(0,1,edx,SIZEOF_FAST_FLOAT)]\n        movq    mm2, MMWORD [MMBLOCK(0,2,esi,SIZEOF_FAST_FLOAT)]\n        movq    mm3, MMWORD [MMBLOCK(0,3,esi,SIZEOF_FAST_FLOAT)]\n        pfmul   mm2, MMWORD [MMBLOCK(0,2,edx,SIZEOF_FAST_FLOAT)]\n        pfmul   mm3, MMWORD [MMBLOCK(0,3,edx,SIZEOF_FAST_FLOAT)]\n\n        pfadd   mm0,mm7                 ; mm0=(00 ** 01 **)\n        pfadd   mm1,mm7                 ; mm1=(02 ** 03 **)\n        pfadd   mm2,mm7                 ; mm0=(04 ** 05 **)\n        pfadd   mm3,mm7                 ; mm1=(06 ** 07 **)\n\n        movq      mm4,mm0\n        punpcklwd mm0,mm1               ; mm0=(00 02 ** **)\n        punpckhwd mm4,mm1               ; mm4=(01 03 ** **)\n        movq      mm5,mm2\n        punpcklwd mm2,mm3               ; mm2=(04 06 ** **)\n        punpckhwd mm5,mm3               ; mm5=(05 07 ** **)\n\n        punpcklwd mm0,mm4               ; mm0=(00 01 02 03)\n        punpcklwd mm2,mm5               ; mm2=(04 05 06 07)\n\n        movq    mm6, MMWORD [MMBLOCK(1,0,esi,SIZEOF_FAST_FLOAT)]\n        movq    mm1, MMWORD [MMBLOCK(1,1,esi,SIZEOF_FAST_FLOAT)]\n        pfmul   mm6, MMWORD [MMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)]\n        pfmul   mm1, MMWORD [MMBLOCK(1,1,edx,SIZEOF_FAST_FLOAT)]\n        movq    mm3, MMWORD [MMBLOCK(1,2,esi,SIZEOF_FAST_FLOAT)]\n        movq    mm4, MMWORD [MMBLOCK(1,3,esi,SIZEOF_FAST_FLOAT)]\n        pfmul   mm3, MMWORD [MMBLOCK(1,2,edx,SIZEOF_FAST_FLOAT)]\n        pfmul   mm4, MMWORD [MMBLOCK(1,3,edx,SIZEOF_FAST_FLOAT)]\n\n        pfadd   mm6,mm7                 ; mm0=(10 ** 11 **)\n        pfadd   mm1,mm7                 ; mm4=(12 ** 13 **)\n        pfadd   mm3,mm7                 ; mm0=(14 ** 15 **)\n        pfadd   mm4,mm7                 ; mm4=(16 ** 17 **)\n\n        movq      mm5,mm6\n        punpcklwd mm6,mm1               ; mm6=(10 12 ** **)\n        punpckhwd mm5,mm1               ; mm5=(11 13 ** **)\n        movq      mm1,mm3\n        punpcklwd mm3,mm4               ; mm3=(14 16 ** **)\n        punpckhwd mm1,mm4               ; mm1=(15 17 ** **)\n\n        punpcklwd mm6,mm5               ; mm6=(10 11 12 13)\n        punpcklwd mm3,mm1               ; mm3=(14 15 16 17)\n\n        movq    MMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm0\n        movq    MMWORD [MMBLOCK(0,1,edi,SIZEOF_JCOEF)], mm2\n        movq    MMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm6\n        movq    MMWORD [MMBLOCK(1,1,edi,SIZEOF_JCOEF)], mm3\n\n        add     esi, byte 16*SIZEOF_FAST_FLOAT\n        add     edx, byte 16*SIZEOF_FAST_FLOAT\n        add     edi, byte 16*SIZEOF_JCOEF\n        dec     eax\n        jnz     near .quantloop\n\n        femms           ; empty MMX/3DNow! state\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; unused\n;       pop     ebx             ; unused\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jquant-mmx.asm",
    "content": ";\n; jquant.asm - sample data conversion and quantization (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Load data into workspace, applying unsigned->signed conversion\n;\n; GLOBAL(void)\n; jsimd_convsamp_mmx (JSAMPARRAY sample_data, JDIMENSION start_col,\n;                     DCTELEM *workspace);\n;\n\n%define sample_data     ebp+8           ; JSAMPARRAY sample_data\n%define start_col       ebp+12          ; JDIMENSION start_col\n%define workspace       ebp+16          ; DCTELEM *workspace\n\n        align   16\n        global  EXTN(jsimd_convsamp_mmx)\n\nEXTN(jsimd_convsamp_mmx):\n        push    ebp\n        mov     ebp,esp\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        pxor    mm6,mm6                 ; mm6=(all 0's)\n        pcmpeqw mm7,mm7\n        psllw   mm7,7                   ; mm7={0xFF80 0xFF80 0xFF80 0xFF80}\n\n        mov     esi, JSAMPARRAY [sample_data]   ; (JSAMPROW *)\n        mov     eax, JDIMENSION [start_col]\n        mov     edi, POINTER [workspace]        ; (DCTELEM *)\n        mov     ecx, DCTSIZE/4\n        alignx  16,7\n.convloop:\n        mov     ebx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n        mov     edx, JSAMPROW [esi+1*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n\n        movq    mm0, MMWORD [ebx+eax*SIZEOF_JSAMPLE]    ; mm0=(01234567)\n        movq    mm1, MMWORD [edx+eax*SIZEOF_JSAMPLE]    ; mm1=(89ABCDEF)\n\n        mov     ebx, JSAMPROW [esi+2*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n        mov     edx, JSAMPROW [esi+3*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n\n        movq    mm2, MMWORD [ebx+eax*SIZEOF_JSAMPLE]    ; mm2=(GHIJKLMN)\n        movq    mm3, MMWORD [edx+eax*SIZEOF_JSAMPLE]    ; mm3=(OPQRSTUV)\n\n        movq      mm4,mm0\n        punpcklbw mm0,mm6               ; mm0=(0123)\n        punpckhbw mm4,mm6               ; mm4=(4567)\n        movq      mm5,mm1\n        punpcklbw mm1,mm6               ; mm1=(89AB)\n        punpckhbw mm5,mm6               ; mm5=(CDEF)\n\n        paddw   mm0,mm7\n        paddw   mm4,mm7\n        paddw   mm1,mm7\n        paddw   mm5,mm7\n\n        movq    MMWORD [MMBLOCK(0,0,edi,SIZEOF_DCTELEM)], mm0\n        movq    MMWORD [MMBLOCK(0,1,edi,SIZEOF_DCTELEM)], mm4\n        movq    MMWORD [MMBLOCK(1,0,edi,SIZEOF_DCTELEM)], mm1\n        movq    MMWORD [MMBLOCK(1,1,edi,SIZEOF_DCTELEM)], mm5\n\n        movq      mm0,mm2\n        punpcklbw mm2,mm6               ; mm2=(GHIJ)\n        punpckhbw mm0,mm6               ; mm0=(KLMN)\n        movq      mm4,mm3\n        punpcklbw mm3,mm6               ; mm3=(OPQR)\n        punpckhbw mm4,mm6               ; mm4=(STUV)\n\n        paddw   mm2,mm7\n        paddw   mm0,mm7\n        paddw   mm3,mm7\n        paddw   mm4,mm7\n\n        movq    MMWORD [MMBLOCK(2,0,edi,SIZEOF_DCTELEM)], mm2\n        movq    MMWORD [MMBLOCK(2,1,edi,SIZEOF_DCTELEM)], mm0\n        movq    MMWORD [MMBLOCK(3,0,edi,SIZEOF_DCTELEM)], mm3\n        movq    MMWORD [MMBLOCK(3,1,edi,SIZEOF_DCTELEM)], mm4\n\n        add     esi, byte 4*SIZEOF_JSAMPROW\n        add     edi, byte 4*DCTSIZE*SIZEOF_DCTELEM\n        dec     ecx\n        jnz     short .convloop\n\n        emms            ; empty MMX state\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        pop     ebp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Quantize/descale the coefficients, and store into coef_block\n;\n; This implementation is based on an algorithm described in\n;   \"How to optimize for the Pentium family of microprocessors\"\n;   (http://www.agner.org/assem/).\n;\n; GLOBAL(void)\n; jsimd_quantize_mmx (JCOEFPTR coef_block, DCTELEM *divisors,\n;                     DCTELEM *workspace);\n;\n\n%define RECIPROCAL(m,n,b) MMBLOCK(DCTSIZE*0+(m),(n),(b),SIZEOF_DCTELEM)\n%define CORRECTION(m,n,b) MMBLOCK(DCTSIZE*1+(m),(n),(b),SIZEOF_DCTELEM)\n%define SCALE(m,n,b)      MMBLOCK(DCTSIZE*2+(m),(n),(b),SIZEOF_DCTELEM)\n%define SHIFT(m,n,b)      MMBLOCK(DCTSIZE*3+(m),(n),(b),SIZEOF_DCTELEM)\n\n%define coef_block      ebp+8           ; JCOEFPTR coef_block\n%define divisors        ebp+12          ; DCTELEM *divisors\n%define workspace       ebp+16          ; DCTELEM *workspace\n\n        align   16\n        global  EXTN(jsimd_quantize_mmx)\n\nEXTN(jsimd_quantize_mmx):\n        push    ebp\n        mov     ebp,esp\n;       push    ebx             ; unused\n;       push    ecx             ; unused\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        mov     esi, POINTER [workspace]\n        mov     edx, POINTER [divisors]\n        mov     edi, JCOEFPTR [coef_block]\n        mov     ah, 2\n        alignx  16,7\n.quantloop1:\n        mov     al, DCTSIZE2/8/2\n        alignx  16,7\n.quantloop2:\n        movq    mm2, MMWORD [MMBLOCK(0,0,esi,SIZEOF_DCTELEM)]\n        movq    mm3, MMWORD [MMBLOCK(0,1,esi,SIZEOF_DCTELEM)]\n\n        movq    mm0,mm2\n        movq    mm1,mm3\n\n        psraw   mm2,(WORD_BIT-1)  ; -1 if value < 0, 0 otherwise\n        psraw   mm3,(WORD_BIT-1)\n\n        pxor    mm0,mm2   ; val = -val\n        pxor    mm1,mm3\n        psubw   mm0,mm2\n        psubw   mm1,mm3\n\n        ;\n        ; MMX is an annoyingly crappy instruction set. It has two\n        ; misfeatures that are causing problems here:\n        ;\n        ; - All multiplications are signed.\n        ;\n        ; - The second operand for the shifts is not treated as packed.\n        ;\n        ;\n        ; We work around the first problem by implementing this algorithm:\n        ;\n        ; unsigned long unsigned_multiply(unsigned short x, unsigned short y)\n        ; {\n        ;   enum { SHORT_BIT = 16 };\n        ;   signed short sx = (signed short) x;\n        ;   signed short sy = (signed short) y;\n        ;   signed long sz;\n        ;\n        ;   sz = (long) sx * (long) sy;     /* signed multiply */\n        ;\n        ;   if (sx < 0) sz += (long) sy << SHORT_BIT;\n        ;   if (sy < 0) sz += (long) sx << SHORT_BIT;\n        ;\n        ;   return (unsigned long) sz;\n        ; }\n        ;\n        ; (note that a negative sx adds _sy_ and vice versa)\n        ;\n        ; For the second problem, we replace the shift by a multiplication.\n        ; Unfortunately that means we have to deal with the signed issue again.\n        ;\n\n        paddw   mm0, MMWORD [CORRECTION(0,0,edx)]   ; correction + roundfactor\n        paddw   mm1, MMWORD [CORRECTION(0,1,edx)]\n\n        movq    mm4,mm0   ; store current value for later\n        movq    mm5,mm1\n        pmulhw  mm0, MMWORD [RECIPROCAL(0,0,edx)]   ; reciprocal\n        pmulhw  mm1, MMWORD [RECIPROCAL(0,1,edx)]\n        paddw   mm0,mm4         ; reciprocal is always negative (MSB=1),\n        paddw   mm1,mm5   ; so we always need to add the initial value\n                        ; (input value is never negative as we\n                        ; inverted it at the start of this routine)\n\n        ; here it gets a bit tricky as both scale\n        ; and mm0/mm1 can be negative\n        movq    mm6, MMWORD [SCALE(0,0,edx)]    ; scale\n        movq    mm7, MMWORD [SCALE(0,1,edx)]\n        movq    mm4,mm0\n        movq    mm5,mm1\n        pmulhw  mm0,mm6\n        pmulhw  mm1,mm7\n\n        psraw   mm6,(WORD_BIT-1)    ; determine if scale is negative\n        psraw   mm7,(WORD_BIT-1)\n\n        pand    mm6,mm4             ; and add input if it is\n        pand    mm7,mm5\n        paddw   mm0,mm6\n        paddw   mm1,mm7\n\n        psraw   mm4,(WORD_BIT-1)    ; then check if negative input\n        psraw   mm5,(WORD_BIT-1)\n\n        pand    mm4, MMWORD [SCALE(0,0,edx)]    ; and add scale if it is\n        pand    mm5, MMWORD [SCALE(0,1,edx)]\n        paddw   mm0,mm4\n        paddw   mm1,mm5\n\n        pxor    mm0,mm2   ; val = -val\n        pxor    mm1,mm3\n        psubw   mm0,mm2\n        psubw   mm1,mm3\n\n        movq    MMWORD [MMBLOCK(0,0,edi,SIZEOF_DCTELEM)], mm0\n        movq    MMWORD [MMBLOCK(0,1,edi,SIZEOF_DCTELEM)], mm1\n\n        add     esi, byte 8*SIZEOF_DCTELEM\n        add     edx, byte 8*SIZEOF_DCTELEM\n        add     edi, byte 8*SIZEOF_JCOEF\n        dec     al\n        jnz     near .quantloop2\n        dec     ah\n        jnz     near .quantloop1        ; to avoid branch misprediction\n\n        emms            ; empty MMX state\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; unused\n;       pop     ebx             ; unused\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jquant-sse.asm",
    "content": ";\n; jquant.asm - sample data conversion and quantization (SSE & MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Load data into workspace, applying unsigned->signed conversion\n;\n; GLOBAL(void)\n; jsimd_convsamp_float_sse (JSAMPARRAY sample_data, JDIMENSION start_col,\n;                           FAST_FLOAT *workspace);\n;\n\n%define sample_data     ebp+8           ; JSAMPARRAY sample_data\n%define start_col       ebp+12          ; JDIMENSION start_col\n%define workspace       ebp+16          ; FAST_FLOAT *workspace\n\n        align   16\n        global  EXTN(jsimd_convsamp_float_sse)\n\nEXTN(jsimd_convsamp_float_sse):\n        push    ebp\n        mov     ebp,esp\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        pcmpeqw  mm7,mm7\n        psllw    mm7,7\n        packsswb mm7,mm7                ; mm7 = PB_CENTERJSAMPLE (0x808080..)\n\n        mov     esi, JSAMPARRAY [sample_data]   ; (JSAMPROW *)\n        mov     eax, JDIMENSION [start_col]\n        mov     edi, POINTER [workspace]        ; (DCTELEM *)\n        mov     ecx, DCTSIZE/2\n        alignx  16,7\n.convloop:\n        mov     ebx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n        mov     edx, JSAMPROW [esi+1*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n\n        movq    mm0, MMWORD [ebx+eax*SIZEOF_JSAMPLE]\n        movq    mm1, MMWORD [edx+eax*SIZEOF_JSAMPLE]\n\n        psubb   mm0,mm7                         ; mm0=(01234567)\n        psubb   mm1,mm7                         ; mm1=(89ABCDEF)\n\n        punpcklbw mm2,mm0                       ; mm2=(*0*1*2*3)\n        punpckhbw mm0,mm0                       ; mm0=(*4*5*6*7)\n        punpcklbw mm3,mm1                       ; mm3=(*8*9*A*B)\n        punpckhbw mm1,mm1                       ; mm1=(*C*D*E*F)\n\n        punpcklwd mm4,mm2                       ; mm4=(***0***1)\n        punpckhwd mm2,mm2                       ; mm2=(***2***3)\n        punpcklwd mm5,mm0                       ; mm5=(***4***5)\n        punpckhwd mm0,mm0                       ; mm0=(***6***7)\n\n        psrad     mm4,(DWORD_BIT-BYTE_BIT)      ; mm4=(01)\n        psrad     mm2,(DWORD_BIT-BYTE_BIT)      ; mm2=(23)\n        cvtpi2ps  xmm0,mm4                      ; xmm0=(01**)\n        cvtpi2ps  xmm1,mm2                      ; xmm1=(23**)\n        psrad     mm5,(DWORD_BIT-BYTE_BIT)      ; mm5=(45)\n        psrad     mm0,(DWORD_BIT-BYTE_BIT)      ; mm0=(67)\n        cvtpi2ps  xmm2,mm5                      ; xmm2=(45**)\n        cvtpi2ps  xmm3,mm0                      ; xmm3=(67**)\n\n        punpcklwd mm6,mm3                       ; mm6=(***8***9)\n        punpckhwd mm3,mm3                       ; mm3=(***A***B)\n        punpcklwd mm4,mm1                       ; mm4=(***C***D)\n        punpckhwd mm1,mm1                       ; mm1=(***E***F)\n\n        psrad     mm6,(DWORD_BIT-BYTE_BIT)      ; mm6=(89)\n        psrad     mm3,(DWORD_BIT-BYTE_BIT)      ; mm3=(AB)\n        cvtpi2ps  xmm4,mm6                      ; xmm4=(89**)\n        cvtpi2ps  xmm5,mm3                      ; xmm5=(AB**)\n        psrad     mm4,(DWORD_BIT-BYTE_BIT)      ; mm4=(CD)\n        psrad     mm1,(DWORD_BIT-BYTE_BIT)      ; mm1=(EF)\n        cvtpi2ps  xmm6,mm4                      ; xmm6=(CD**)\n        cvtpi2ps  xmm7,mm1                      ; xmm7=(EF**)\n\n        movlhps   xmm0,xmm1                     ; xmm0=(0123)\n        movlhps   xmm2,xmm3                     ; xmm2=(4567)\n        movlhps   xmm4,xmm5                     ; xmm4=(89AB)\n        movlhps   xmm6,xmm7                     ; xmm6=(CDEF)\n\n        movaps  XMMWORD [XMMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], xmm0\n        movaps  XMMWORD [XMMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], xmm2\n        movaps  XMMWORD [XMMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], xmm4\n        movaps  XMMWORD [XMMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], xmm6\n\n        add     esi, byte 2*SIZEOF_JSAMPROW\n        add     edi, byte 2*DCTSIZE*SIZEOF_FAST_FLOAT\n        dec     ecx\n        jnz     near .convloop\n\n        emms            ; empty MMX state\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        pop     ebp\n        ret\n\n\n; --------------------------------------------------------------------------\n;\n; Quantize/descale the coefficients, and store into coef_block\n;\n; GLOBAL(void)\n; jsimd_quantize_float_sse (JCOEFPTR coef_block, FAST_FLOAT *divisors,\n;                           FAST_FLOAT *workspace);\n;\n\n%define coef_block      ebp+8           ; JCOEFPTR coef_block\n%define divisors        ebp+12          ; FAST_FLOAT *divisors\n%define workspace       ebp+16          ; FAST_FLOAT *workspace\n\n        align   16\n        global  EXTN(jsimd_quantize_float_sse)\n\nEXTN(jsimd_quantize_float_sse):\n        push    ebp\n        mov     ebp,esp\n;       push    ebx             ; unused\n;       push    ecx             ; unused\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        mov     esi, POINTER [workspace]\n        mov     edx, POINTER [divisors]\n        mov     edi, JCOEFPTR [coef_block]\n        mov     eax, DCTSIZE2/16\n        alignx  16,7\n.quantloop:\n        movaps  xmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(0,1,esi,SIZEOF_FAST_FLOAT)]\n        mulps   xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)]\n        mulps   xmm1, XMMWORD [XMMBLOCK(0,1,edx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm2, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(1,1,esi,SIZEOF_FAST_FLOAT)]\n        mulps   xmm2, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)]\n        mulps   xmm3, XMMWORD [XMMBLOCK(1,1,edx,SIZEOF_FAST_FLOAT)]\n\n        movhlps  xmm4,xmm0\n        movhlps  xmm5,xmm1\n\n        cvtps2pi mm0,xmm0\n        cvtps2pi mm1,xmm1\n        cvtps2pi mm4,xmm4\n        cvtps2pi mm5,xmm5\n\n        movhlps  xmm6,xmm2\n        movhlps  xmm7,xmm3\n\n        cvtps2pi mm2,xmm2\n        cvtps2pi mm3,xmm3\n        cvtps2pi mm6,xmm6\n        cvtps2pi mm7,xmm7\n\n        packssdw mm0,mm4\n        packssdw mm1,mm5\n        packssdw mm2,mm6\n        packssdw mm3,mm7\n\n        movq    MMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm0\n        movq    MMWORD [MMBLOCK(0,1,edi,SIZEOF_JCOEF)], mm1\n        movq    MMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm2\n        movq    MMWORD [MMBLOCK(1,1,edi,SIZEOF_JCOEF)], mm3\n\n        add     esi, byte 16*SIZEOF_FAST_FLOAT\n        add     edx, byte 16*SIZEOF_FAST_FLOAT\n        add     edi, byte 16*SIZEOF_JCOEF\n        dec     eax\n        jnz     short .quantloop\n\n        emms            ; empty MMX state\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; unused\n;       pop     ebx             ; unused\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jquantf-sse2-64.asm",
    "content": ";\n; jquantf.asm - sample data conversion and quantization (64-bit SSE & SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n;\n; Load data into workspace, applying unsigned->signed conversion\n;\n; GLOBAL(void)\n; jsimd_convsamp_float_sse2 (JSAMPARRAY sample_data, JDIMENSION start_col,\n;                            FAST_FLOAT *workspace);\n;\n\n; r10 = JSAMPARRAY sample_data\n; r11 = JDIMENSION start_col\n; r12 = FAST_FLOAT *workspace\n\n        align   16\n        global  EXTN(jsimd_convsamp_float_sse2)\n\nEXTN(jsimd_convsamp_float_sse2):\n        push    rbp\n        mov     rax,rsp\n        mov     rbp,rsp\n        collect_args\n        push    rbx\n\n        pcmpeqw  xmm7,xmm7\n        psllw    xmm7,7\n        packsswb xmm7,xmm7              ; xmm7 = PB_CENTERJSAMPLE (0x808080..)\n\n        mov rsi, r10\n        mov     eax, r11d\n        mov rdi, r12\n        mov     rcx, DCTSIZE/2\n.convloop:\n        mov     rbx, JSAMPROW [rsi+0*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n        mov rdx, JSAMPROW [rsi+1*SIZEOF_JSAMPROW]       ; (JSAMPLE *)\n\n        movq    xmm0, XMM_MMWORD [rbx+rax*SIZEOF_JSAMPLE]\n        movq    xmm1, XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE]\n\n        psubb   xmm0,xmm7                       ; xmm0=(01234567)\n        psubb   xmm1,xmm7                       ; xmm1=(89ABCDEF)\n\n        punpcklbw xmm0,xmm0                     ; xmm0=(*0*1*2*3*4*5*6*7)\n        punpcklbw xmm1,xmm1                     ; xmm1=(*8*9*A*B*C*D*E*F)\n\n        punpcklwd xmm2,xmm0                     ; xmm2=(***0***1***2***3)\n        punpckhwd xmm0,xmm0                     ; xmm0=(***4***5***6***7)\n        punpcklwd xmm3,xmm1                     ; xmm3=(***8***9***A***B)\n        punpckhwd xmm1,xmm1                     ; xmm1=(***C***D***E***F)\n\n        psrad     xmm2,(DWORD_BIT-BYTE_BIT)     ; xmm2=(0123)\n        psrad     xmm0,(DWORD_BIT-BYTE_BIT)     ; xmm0=(4567)\n        cvtdq2ps  xmm2,xmm2                     ; xmm2=(0123)\n        cvtdq2ps  xmm0,xmm0                     ; xmm0=(4567)\n        psrad     xmm3,(DWORD_BIT-BYTE_BIT)     ; xmm3=(89AB)\n        psrad     xmm1,(DWORD_BIT-BYTE_BIT)     ; xmm1=(CDEF)\n        cvtdq2ps  xmm3,xmm3                     ; xmm3=(89AB)\n        cvtdq2ps  xmm1,xmm1                     ; xmm1=(CDEF)\n\n        movaps  XMMWORD [XMMBLOCK(0,0,rdi,SIZEOF_FAST_FLOAT)], xmm2\n        movaps  XMMWORD [XMMBLOCK(0,1,rdi,SIZEOF_FAST_FLOAT)], xmm0\n        movaps  XMMWORD [XMMBLOCK(1,0,rdi,SIZEOF_FAST_FLOAT)], xmm3\n        movaps  XMMWORD [XMMBLOCK(1,1,rdi,SIZEOF_FAST_FLOAT)], xmm1\n\n        add     rsi, byte 2*SIZEOF_JSAMPROW\n        add     rdi, byte 2*DCTSIZE*SIZEOF_FAST_FLOAT\n        dec     rcx\n        jnz     short .convloop\n\n        pop     rbx\n        uncollect_args\n        pop     rbp\n        ret\n\n\n; --------------------------------------------------------------------------\n;\n; Quantize/descale the coefficients, and store into coef_block\n;\n; GLOBAL(void)\n; jsimd_quantize_float_sse2 (JCOEFPTR coef_block, FAST_FLOAT *divisors,\n;                         FAST_FLOAT *workspace);\n;\n\n; r10 = JCOEFPTR coef_block\n; r11 = FAST_FLOAT *divisors\n; r12 = FAST_FLOAT *workspace\n\n        align   16\n        global  EXTN(jsimd_quantize_float_sse2)\n\nEXTN(jsimd_quantize_float_sse2):\n        push    rbp\n        mov     rax,rsp\n        mov     rbp,rsp\n        collect_args\n\n        mov rsi, r12\n        mov rdx, r11\n        mov rdi, r10\n        mov     rax, DCTSIZE2/16\n.quantloop:\n        movaps  xmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(0,1,rsi,SIZEOF_FAST_FLOAT)]\n        mulps   xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)]\n        mulps   xmm1, XMMWORD [XMMBLOCK(0,1,rdx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm2, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(1,1,rsi,SIZEOF_FAST_FLOAT)]\n        mulps   xmm2, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)]\n        mulps   xmm3, XMMWORD [XMMBLOCK(1,1,rdx,SIZEOF_FAST_FLOAT)]\n\n        cvtps2dq xmm0,xmm0\n        cvtps2dq xmm1,xmm1\n        cvtps2dq xmm2,xmm2\n        cvtps2dq xmm3,xmm3\n\n        packssdw xmm0,xmm1\n        packssdw xmm2,xmm3\n\n        movdqa  XMMWORD [XMMBLOCK(0,0,rdi,SIZEOF_JCOEF)], xmm0\n        movdqa  XMMWORD [XMMBLOCK(1,0,rdi,SIZEOF_JCOEF)], xmm2\n\n        add     rsi, byte 16*SIZEOF_FAST_FLOAT\n        add     rdx, byte 16*SIZEOF_FAST_FLOAT\n        add     rdi, byte 16*SIZEOF_JCOEF\n        dec     rax\n        jnz     short .quantloop\n\n        uncollect_args\n        pop     rbp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jquantf-sse2.asm",
    "content": ";\n; jquantf.asm - sample data conversion and quantization (SSE & SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Load data into workspace, applying unsigned->signed conversion\n;\n; GLOBAL(void)\n; jsimd_convsamp_float_sse2 (JSAMPARRAY sample_data, JDIMENSION start_col,\n;                            FAST_FLOAT *workspace);\n;\n\n%define sample_data     ebp+8           ; JSAMPARRAY sample_data\n%define start_col       ebp+12          ; JDIMENSION start_col\n%define workspace       ebp+16          ; FAST_FLOAT *workspace\n\n        align   16\n        global  EXTN(jsimd_convsamp_float_sse2)\n\nEXTN(jsimd_convsamp_float_sse2):\n        push    ebp\n        mov     ebp,esp\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        pcmpeqw  xmm7,xmm7\n        psllw    xmm7,7\n        packsswb xmm7,xmm7              ; xmm7 = PB_CENTERJSAMPLE (0x808080..)\n\n        mov     esi, JSAMPARRAY [sample_data]   ; (JSAMPROW *)\n        mov     eax, JDIMENSION [start_col]\n        mov     edi, POINTER [workspace]        ; (DCTELEM *)\n        mov     ecx, DCTSIZE/2\n        alignx  16,7\n.convloop:\n        mov     ebx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n        mov     edx, JSAMPROW [esi+1*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n\n        movq    xmm0, XMM_MMWORD [ebx+eax*SIZEOF_JSAMPLE]\n        movq    xmm1, XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE]\n\n        psubb   xmm0,xmm7                       ; xmm0=(01234567)\n        psubb   xmm1,xmm7                       ; xmm1=(89ABCDEF)\n\n        punpcklbw xmm0,xmm0                     ; xmm0=(*0*1*2*3*4*5*6*7)\n        punpcklbw xmm1,xmm1                     ; xmm1=(*8*9*A*B*C*D*E*F)\n\n        punpcklwd xmm2,xmm0                     ; xmm2=(***0***1***2***3)\n        punpckhwd xmm0,xmm0                     ; xmm0=(***4***5***6***7)\n        punpcklwd xmm3,xmm1                     ; xmm3=(***8***9***A***B)\n        punpckhwd xmm1,xmm1                     ; xmm1=(***C***D***E***F)\n\n        psrad     xmm2,(DWORD_BIT-BYTE_BIT)     ; xmm2=(0123)\n        psrad     xmm0,(DWORD_BIT-BYTE_BIT)     ; xmm0=(4567)\n        cvtdq2ps  xmm2,xmm2                     ; xmm2=(0123)\n        cvtdq2ps  xmm0,xmm0                     ; xmm0=(4567)\n        psrad     xmm3,(DWORD_BIT-BYTE_BIT)     ; xmm3=(89AB)\n        psrad     xmm1,(DWORD_BIT-BYTE_BIT)     ; xmm1=(CDEF)\n        cvtdq2ps  xmm3,xmm3                     ; xmm3=(89AB)\n        cvtdq2ps  xmm1,xmm1                     ; xmm1=(CDEF)\n\n        movaps  XMMWORD [XMMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], xmm2\n        movaps  XMMWORD [XMMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], xmm0\n        movaps  XMMWORD [XMMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], xmm3\n        movaps  XMMWORD [XMMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], xmm1\n\n        add     esi, byte 2*SIZEOF_JSAMPROW\n        add     edi, byte 2*DCTSIZE*SIZEOF_FAST_FLOAT\n        dec     ecx\n        jnz     short .convloop\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        pop     ebp\n        ret\n\n\n; --------------------------------------------------------------------------\n;\n; Quantize/descale the coefficients, and store into coef_block\n;\n; GLOBAL(void)\n; jsimd_quantize_float_sse2 (JCOEFPTR coef_block, FAST_FLOAT *divisors,\n;                            FAST_FLOAT *workspace);\n;\n\n%define coef_block      ebp+8           ; JCOEFPTR coef_block\n%define divisors        ebp+12          ; FAST_FLOAT *divisors\n%define workspace       ebp+16          ; FAST_FLOAT *workspace\n\n        align   16\n        global  EXTN(jsimd_quantize_float_sse2)\n\nEXTN(jsimd_quantize_float_sse2):\n        push    ebp\n        mov     ebp,esp\n;       push    ebx             ; unused\n;       push    ecx             ; unused\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        mov     esi, POINTER [workspace]\n        mov     edx, POINTER [divisors]\n        mov     edi, JCOEFPTR [coef_block]\n        mov     eax, DCTSIZE2/16\n        alignx  16,7\n.quantloop:\n        movaps  xmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm1, XMMWORD [XMMBLOCK(0,1,esi,SIZEOF_FAST_FLOAT)]\n        mulps   xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)]\n        mulps   xmm1, XMMWORD [XMMBLOCK(0,1,edx,SIZEOF_FAST_FLOAT)]\n        movaps  xmm2, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_FAST_FLOAT)]\n        movaps  xmm3, XMMWORD [XMMBLOCK(1,1,esi,SIZEOF_FAST_FLOAT)]\n        mulps   xmm2, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)]\n        mulps   xmm3, XMMWORD [XMMBLOCK(1,1,edx,SIZEOF_FAST_FLOAT)]\n\n        cvtps2dq xmm0,xmm0\n        cvtps2dq xmm1,xmm1\n        cvtps2dq xmm2,xmm2\n        cvtps2dq xmm3,xmm3\n\n        packssdw xmm0,xmm1\n        packssdw xmm2,xmm3\n\n        movdqa  XMMWORD [XMMBLOCK(0,0,edi,SIZEOF_JCOEF)], xmm0\n        movdqa  XMMWORD [XMMBLOCK(1,0,edi,SIZEOF_JCOEF)], xmm2\n\n        add     esi, byte 16*SIZEOF_FAST_FLOAT\n        add     edx, byte 16*SIZEOF_FAST_FLOAT\n        add     edi, byte 16*SIZEOF_JCOEF\n        dec     eax\n        jnz     short .quantloop\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; unused\n;       pop     ebx             ; unused\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jquanti-altivec.c",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2014-2015, D. R. Commander.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n/* INTEGER QUANTIZATION AND SAMPLE CONVERSION */\n\n#include \"jsimd_altivec.h\"\n\n\n/* NOTE: The address will either be aligned or offset by 8 bytes, so we can\n * always get the data we want by using a single vector load (although we may\n * have to permute the result.)\n */\n#if __BIG_ENDIAN__\n\n#define LOAD_ROW(row) {  \\\n  elemptr = sample_data[row] + start_col;  \\\n  in##row = vec_ld(0, elemptr);  \\\n  if ((size_t)elemptr & 15)  \\\n    in##row = vec_perm(in##row, in##row, vec_lvsl(0, elemptr));  \\\n}\n\n#else\n\n#define LOAD_ROW(row) {  \\\n  elemptr = sample_data[row] + start_col;  \\\n  in##row = vec_vsx_ld(0, elemptr);  \\\n}\n\n#endif\n\n\nvoid\njsimd_convsamp_altivec (JSAMPARRAY sample_data, JDIMENSION start_col,\n                        DCTELEM *workspace)\n{\n  JSAMPROW elemptr;\n\n  __vector unsigned char in0, in1, in2, in3, in4, in5, in6, in7;\n  __vector short out0, out1, out2, out3, out4, out5, out6, out7;\n\n  /* Constants */\n  __vector short pw_centerjsamp = { __8X(CENTERJSAMPLE) };\n  __vector unsigned char pb_zero = { __16X(0) };\n\n  LOAD_ROW(0);\n  LOAD_ROW(1);\n  LOAD_ROW(2);\n  LOAD_ROW(3);\n  LOAD_ROW(4);\n  LOAD_ROW(5);\n  LOAD_ROW(6);\n  LOAD_ROW(7);\n\n  out0 = (__vector short)VEC_UNPACKHU(in0);\n  out1 = (__vector short)VEC_UNPACKHU(in1);\n  out2 = (__vector short)VEC_UNPACKHU(in2);\n  out3 = (__vector short)VEC_UNPACKHU(in3);\n  out4 = (__vector short)VEC_UNPACKHU(in4);\n  out5 = (__vector short)VEC_UNPACKHU(in5);\n  out6 = (__vector short)VEC_UNPACKHU(in6);\n  out7 = (__vector short)VEC_UNPACKHU(in7);\n\n  out0 = vec_sub(out0, pw_centerjsamp);\n  out1 = vec_sub(out1, pw_centerjsamp);\n  out2 = vec_sub(out2, pw_centerjsamp);\n  out3 = vec_sub(out3, pw_centerjsamp);\n  out4 = vec_sub(out4, pw_centerjsamp);\n  out5 = vec_sub(out5, pw_centerjsamp);\n  out6 = vec_sub(out6, pw_centerjsamp);\n  out7 = vec_sub(out7, pw_centerjsamp);\n\n  vec_st(out0, 0, workspace);\n  vec_st(out1, 16, workspace);\n  vec_st(out2, 32, workspace);\n  vec_st(out3, 48, workspace);\n  vec_st(out4, 64, workspace);\n  vec_st(out5, 80, workspace);\n  vec_st(out6, 96, workspace);\n  vec_st(out7, 112, workspace);\n}\n\n\n#define WORD_BIT 16\n\n/* There is no AltiVec 16-bit unsigned multiply instruction, hence this.\n   We basically need an unsigned equivalent of vec_madds(). */\n\n#define MULTIPLY(vs0, vs1, out) {  \\\n  tmpe = vec_mule((__vector unsigned short)vs0,  \\\n                  (__vector unsigned short)vs1);  \\\n  tmpo = vec_mulo((__vector unsigned short)vs0,  \\\n                  (__vector unsigned short)vs1);  \\\n  out = (__vector short)vec_perm((__vector unsigned short)tmpe,  \\\n                                 (__vector unsigned short)tmpo,  \\\n                                 shift_pack_index);  \\\n}\n\nvoid\njsimd_quantize_altivec (JCOEFPTR coef_block, DCTELEM *divisors,\n                        DCTELEM *workspace)\n{\n  __vector short row0, row1, row2, row3, row4, row5, row6, row7,\n    row0s, row1s, row2s, row3s, row4s, row5s, row6s, row7s,\n    corr0, corr1, corr2, corr3, corr4, corr5, corr6, corr7,\n    recip0, recip1, recip2, recip3, recip4, recip5, recip6, recip7,\n    scale0, scale1, scale2, scale3, scale4, scale5, scale6, scale7;\n  __vector unsigned int tmpe, tmpo;\n\n  /* Constants */\n  __vector unsigned short pw_word_bit_m1 = { __8X(WORD_BIT - 1) };\n#if __BIG_ENDIAN__\n  __vector unsigned char shift_pack_index =\n    {0,1,16,17,4,5,20,21,8,9,24,25,12,13,28,29};\n#else\n  __vector unsigned char shift_pack_index =\n    {2,3,18,19,6,7,22,23,10,11,26,27,14,15,30,31};\n#endif\n\n  row0 = vec_ld(0, workspace);\n  row1 = vec_ld(16, workspace);\n  row2 = vec_ld(32, workspace);\n  row3 = vec_ld(48, workspace);\n  row4 = vec_ld(64, workspace);\n  row5 = vec_ld(80, workspace);\n  row6 = vec_ld(96, workspace);\n  row7 = vec_ld(112, workspace);\n\n  /* Branch-less absolute value */\n  row0s = vec_sra(row0, pw_word_bit_m1);\n  row1s = vec_sra(row1, pw_word_bit_m1);\n  row2s = vec_sra(row2, pw_word_bit_m1);\n  row3s = vec_sra(row3, pw_word_bit_m1);\n  row4s = vec_sra(row4, pw_word_bit_m1);\n  row5s = vec_sra(row5, pw_word_bit_m1);\n  row6s = vec_sra(row6, pw_word_bit_m1);\n  row7s = vec_sra(row7, pw_word_bit_m1);\n  row0 = vec_xor(row0, row0s);\n  row1 = vec_xor(row1, row1s);\n  row2 = vec_xor(row2, row2s);\n  row3 = vec_xor(row3, row3s);\n  row4 = vec_xor(row4, row4s);\n  row5 = vec_xor(row5, row5s);\n  row6 = vec_xor(row6, row6s);\n  row7 = vec_xor(row7, row7s);\n  row0 = vec_sub(row0, row0s);\n  row1 = vec_sub(row1, row1s);\n  row2 = vec_sub(row2, row2s);\n  row3 = vec_sub(row3, row3s);\n  row4 = vec_sub(row4, row4s);\n  row5 = vec_sub(row5, row5s);\n  row6 = vec_sub(row6, row6s);\n  row7 = vec_sub(row7, row7s);\n\n  corr0 = vec_ld(DCTSIZE2 * 2, divisors);\n  corr1 = vec_ld(DCTSIZE2 * 2 + 16, divisors);\n  corr2 = vec_ld(DCTSIZE2 * 2 + 32, divisors);\n  corr3 = vec_ld(DCTSIZE2 * 2 + 48, divisors);\n  corr4 = vec_ld(DCTSIZE2 * 2 + 64, divisors);\n  corr5 = vec_ld(DCTSIZE2 * 2 + 80, divisors);\n  corr6 = vec_ld(DCTSIZE2 * 2 + 96, divisors);\n  corr7 = vec_ld(DCTSIZE2 * 2 + 112, divisors);\n\n  row0 = vec_add(row0, corr0);\n  row1 = vec_add(row1, corr1);\n  row2 = vec_add(row2, corr2);\n  row3 = vec_add(row3, corr3);\n  row4 = vec_add(row4, corr4);\n  row5 = vec_add(row5, corr5);\n  row6 = vec_add(row6, corr6);\n  row7 = vec_add(row7, corr7);\n\n  recip0 = vec_ld(0, divisors);\n  recip1 = vec_ld(16, divisors);\n  recip2 = vec_ld(32, divisors);\n  recip3 = vec_ld(48, divisors);\n  recip4 = vec_ld(64, divisors);\n  recip5 = vec_ld(80, divisors);\n  recip6 = vec_ld(96, divisors);\n  recip7 = vec_ld(112, divisors);\n\n  MULTIPLY(row0, recip0, row0);\n  MULTIPLY(row1, recip1, row1);\n  MULTIPLY(row2, recip2, row2);\n  MULTIPLY(row3, recip3, row3);\n  MULTIPLY(row4, recip4, row4);\n  MULTIPLY(row5, recip5, row5);\n  MULTIPLY(row6, recip6, row6);\n  MULTIPLY(row7, recip7, row7);\n\n  scale0 = vec_ld(DCTSIZE2 * 4, divisors);\n  scale1 = vec_ld(DCTSIZE2 * 4 + 16, divisors);\n  scale2 = vec_ld(DCTSIZE2 * 4 + 32, divisors);\n  scale3 = vec_ld(DCTSIZE2 * 4 + 48, divisors);\n  scale4 = vec_ld(DCTSIZE2 * 4 + 64, divisors);\n  scale5 = vec_ld(DCTSIZE2 * 4 + 80, divisors);\n  scale6 = vec_ld(DCTSIZE2 * 4 + 96, divisors);\n  scale7 = vec_ld(DCTSIZE2 * 4 + 112, divisors);\n\n  MULTIPLY(row0, scale0, row0);\n  MULTIPLY(row1, scale1, row1);\n  MULTIPLY(row2, scale2, row2);\n  MULTIPLY(row3, scale3, row3);\n  MULTIPLY(row4, scale4, row4);\n  MULTIPLY(row5, scale5, row5);\n  MULTIPLY(row6, scale6, row6);\n  MULTIPLY(row7, scale7, row7);\n\n  row0 = vec_xor(row0, row0s);\n  row1 = vec_xor(row1, row1s);\n  row2 = vec_xor(row2, row2s);\n  row3 = vec_xor(row3, row3s);\n  row4 = vec_xor(row4, row4s);\n  row5 = vec_xor(row5, row5s);\n  row6 = vec_xor(row6, row6s);\n  row7 = vec_xor(row7, row7s);\n  row0 = vec_sub(row0, row0s);\n  row1 = vec_sub(row1, row1s);\n  row2 = vec_sub(row2, row2s);\n  row3 = vec_sub(row3, row3s);\n  row4 = vec_sub(row4, row4s);\n  row5 = vec_sub(row5, row5s);\n  row6 = vec_sub(row6, row6s);\n  row7 = vec_sub(row7, row7s);\n\n  vec_st(row0, 0, coef_block);\n  vec_st(row1, 16, coef_block);\n  vec_st(row2, 32, coef_block);\n  vec_st(row3, 48, coef_block);\n  vec_st(row4, 64, coef_block);\n  vec_st(row5, 80, coef_block);\n  vec_st(row6, 96, coef_block);\n  vec_st(row7, 112, coef_block);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jquanti-sse2-64.asm",
    "content": ";\n; jquanti.asm - sample data conversion and quantization (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2009, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    64\n;\n; Load data into workspace, applying unsigned->signed conversion\n;\n; GLOBAL(void)\n; jsimd_convsamp_sse2 (JSAMPARRAY sample_data, JDIMENSION start_col,\n;                      DCTELEM *workspace);\n;\n\n; r10 = JSAMPARRAY sample_data\n; r11 = JDIMENSION start_col\n; r12 = DCTELEM *workspace\n\n        align   16\n        global  EXTN(jsimd_convsamp_sse2)\n\nEXTN(jsimd_convsamp_sse2):\n        push    rbp\n        mov     rax,rsp\n        mov     rbp,rsp\n        collect_args\n        push    rbx\n\n        pxor    xmm6,xmm6               ; xmm6=(all 0's)\n        pcmpeqw xmm7,xmm7\n        psllw   xmm7,7                  ; xmm7={0xFF80 0xFF80 0xFF80 0xFF80 ..}\n\n        mov rsi, r10\n        mov eax, r11d\n        mov rdi, r12\n        mov     rcx, DCTSIZE/4\n.convloop:\n        mov     rbx, JSAMPROW [rsi+0*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n        mov rdx, JSAMPROW [rsi+1*SIZEOF_JSAMPROW]       ; (JSAMPLE *)\n\n        movq    xmm0, XMM_MMWORD [rbx+rax*SIZEOF_JSAMPLE]       ; xmm0=(01234567)\n        movq    xmm1, XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE]       ; xmm1=(89ABCDEF)\n\n        mov     rbx, JSAMPROW [rsi+2*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n        mov     rdx, JSAMPROW [rsi+3*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n\n        movq    xmm2, XMM_MMWORD [rbx+rax*SIZEOF_JSAMPLE]       ; xmm2=(GHIJKLMN)\n        movq    xmm3, XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE]       ; xmm3=(OPQRSTUV)\n\n        punpcklbw xmm0,xmm6             ; xmm0=(01234567)\n        punpcklbw xmm1,xmm6             ; xmm1=(89ABCDEF)\n        paddw     xmm0,xmm7\n        paddw     xmm1,xmm7\n        punpcklbw xmm2,xmm6             ; xmm2=(GHIJKLMN)\n        punpcklbw xmm3,xmm6             ; xmm3=(OPQRSTUV)\n        paddw     xmm2,xmm7\n        paddw     xmm3,xmm7\n\n        movdqa  XMMWORD [XMMBLOCK(0,0,rdi,SIZEOF_DCTELEM)], xmm0\n        movdqa  XMMWORD [XMMBLOCK(1,0,rdi,SIZEOF_DCTELEM)], xmm1\n        movdqa  XMMWORD [XMMBLOCK(2,0,rdi,SIZEOF_DCTELEM)], xmm2\n        movdqa  XMMWORD [XMMBLOCK(3,0,rdi,SIZEOF_DCTELEM)], xmm3\n\n        add     rsi, byte 4*SIZEOF_JSAMPROW\n        add     rdi, byte 4*DCTSIZE*SIZEOF_DCTELEM\n        dec     rcx\n        jnz     short .convloop\n\n        pop     rbx\n        uncollect_args\n        pop     rbp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Quantize/descale the coefficients, and store into coef_block\n;\n; This implementation is based on an algorithm described in\n;   \"How to optimize for the Pentium family of microprocessors\"\n;   (http://www.agner.org/assem/).\n;\n; GLOBAL(void)\n; jsimd_quantize_sse2 (JCOEFPTR coef_block, DCTELEM *divisors,\n;                      DCTELEM *workspace);\n;\n\n%define RECIPROCAL(m,n,b) XMMBLOCK(DCTSIZE*0+(m),(n),(b),SIZEOF_DCTELEM)\n%define CORRECTION(m,n,b) XMMBLOCK(DCTSIZE*1+(m),(n),(b),SIZEOF_DCTELEM)\n%define SCALE(m,n,b)      XMMBLOCK(DCTSIZE*2+(m),(n),(b),SIZEOF_DCTELEM)\n\n; r10 = JCOEFPTR coef_block\n; r11 = DCTELEM *divisors\n; r12 = DCTELEM *workspace\n\n        align   16\n        global  EXTN(jsimd_quantize_sse2)\n\nEXTN(jsimd_quantize_sse2):\n        push    rbp\n        mov     rax,rsp\n        mov     rbp,rsp\n        collect_args\n\n        mov rsi, r12\n        mov rdx, r11\n        mov rdi, r10\n        mov     rax, DCTSIZE2/32\n.quantloop:\n        movdqa  xmm4, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_DCTELEM)]\n        movdqa  xmm5, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_DCTELEM)]\n        movdqa  xmm6, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_DCTELEM)]\n        movdqa  xmm7, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_DCTELEM)]\n        movdqa  xmm0,xmm4\n        movdqa  xmm1,xmm5\n        movdqa  xmm2,xmm6\n        movdqa  xmm3,xmm7\n        psraw   xmm4,(WORD_BIT-1)\n        psraw   xmm5,(WORD_BIT-1)\n        psraw   xmm6,(WORD_BIT-1)\n        psraw   xmm7,(WORD_BIT-1)\n        pxor    xmm0,xmm4\n        pxor    xmm1,xmm5\n        pxor    xmm2,xmm6\n        pxor    xmm3,xmm7\n        psubw   xmm0,xmm4               ; if (xmm0 < 0) xmm0 = -xmm0;\n        psubw   xmm1,xmm5               ; if (xmm1 < 0) xmm1 = -xmm1;\n        psubw   xmm2,xmm6               ; if (xmm2 < 0) xmm2 = -xmm2;\n        psubw   xmm3,xmm7               ; if (xmm3 < 0) xmm3 = -xmm3;\n\n        paddw   xmm0, XMMWORD [CORRECTION(0,0,rdx)]  ; correction + roundfactor\n        paddw   xmm1, XMMWORD [CORRECTION(1,0,rdx)]\n        paddw   xmm2, XMMWORD [CORRECTION(2,0,rdx)]\n        paddw   xmm3, XMMWORD [CORRECTION(3,0,rdx)]\n        pmulhuw xmm0, XMMWORD [RECIPROCAL(0,0,rdx)]  ; reciprocal\n        pmulhuw xmm1, XMMWORD [RECIPROCAL(1,0,rdx)]\n        pmulhuw xmm2, XMMWORD [RECIPROCAL(2,0,rdx)]\n        pmulhuw xmm3, XMMWORD [RECIPROCAL(3,0,rdx)]\n        pmulhuw xmm0, XMMWORD [SCALE(0,0,rdx)]  ; scale\n        pmulhuw xmm1, XMMWORD [SCALE(1,0,rdx)]\n        pmulhuw xmm2, XMMWORD [SCALE(2,0,rdx)]\n        pmulhuw xmm3, XMMWORD [SCALE(3,0,rdx)]\n\n        pxor    xmm0,xmm4\n        pxor    xmm1,xmm5\n        pxor    xmm2,xmm6\n        pxor    xmm3,xmm7\n        psubw   xmm0,xmm4\n        psubw   xmm1,xmm5\n        psubw   xmm2,xmm6\n        psubw   xmm3,xmm7\n        movdqa  XMMWORD [XMMBLOCK(0,0,rdi,SIZEOF_DCTELEM)], xmm0\n        movdqa  XMMWORD [XMMBLOCK(1,0,rdi,SIZEOF_DCTELEM)], xmm1\n        movdqa  XMMWORD [XMMBLOCK(2,0,rdi,SIZEOF_DCTELEM)], xmm2\n        movdqa  XMMWORD [XMMBLOCK(3,0,rdi,SIZEOF_DCTELEM)], xmm3\n\n        add     rsi, byte 32*SIZEOF_DCTELEM\n        add     rdx, byte 32*SIZEOF_DCTELEM\n        add     rdi, byte 32*SIZEOF_JCOEF\n        dec     rax\n        jnz     near .quantloop\n\n        uncollect_args\n        pop     rbp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jquanti-sse2.asm",
    "content": ";\n; jquanti.asm - sample data conversion and quantization (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Load data into workspace, applying unsigned->signed conversion\n;\n; GLOBAL(void)\n; jsimd_convsamp_sse2 (JSAMPARRAY sample_data, JDIMENSION start_col,\n;                      DCTELEM *workspace);\n;\n\n%define sample_data     ebp+8           ; JSAMPARRAY sample_data\n%define start_col       ebp+12          ; JDIMENSION start_col\n%define workspace       ebp+16          ; DCTELEM *workspace\n\n        align   16\n        global  EXTN(jsimd_convsamp_sse2)\n\nEXTN(jsimd_convsamp_sse2):\n        push    ebp\n        mov     ebp,esp\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        pxor    xmm6,xmm6               ; xmm6=(all 0's)\n        pcmpeqw xmm7,xmm7\n        psllw   xmm7,7                  ; xmm7={0xFF80 0xFF80 0xFF80 0xFF80 ..}\n\n        mov     esi, JSAMPARRAY [sample_data]   ; (JSAMPROW *)\n        mov     eax, JDIMENSION [start_col]\n        mov     edi, POINTER [workspace]        ; (DCTELEM *)\n        mov     ecx, DCTSIZE/4\n        alignx  16,7\n.convloop:\n        mov     ebx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n        mov     edx, JSAMPROW [esi+1*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n\n        movq    xmm0, XMM_MMWORD [ebx+eax*SIZEOF_JSAMPLE]       ; xmm0=(01234567)\n        movq    xmm1, XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE]       ; xmm1=(89ABCDEF)\n\n        mov     ebx, JSAMPROW [esi+2*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n        mov     edx, JSAMPROW [esi+3*SIZEOF_JSAMPROW]   ; (JSAMPLE *)\n\n        movq    xmm2, XMM_MMWORD [ebx+eax*SIZEOF_JSAMPLE]       ; xmm2=(GHIJKLMN)\n        movq    xmm3, XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE]       ; xmm3=(OPQRSTUV)\n\n        punpcklbw xmm0,xmm6             ; xmm0=(01234567)\n        punpcklbw xmm1,xmm6             ; xmm1=(89ABCDEF)\n        paddw     xmm0,xmm7\n        paddw     xmm1,xmm7\n        punpcklbw xmm2,xmm6             ; xmm2=(GHIJKLMN)\n        punpcklbw xmm3,xmm6             ; xmm3=(OPQRSTUV)\n        paddw     xmm2,xmm7\n        paddw     xmm3,xmm7\n\n        movdqa  XMMWORD [XMMBLOCK(0,0,edi,SIZEOF_DCTELEM)], xmm0\n        movdqa  XMMWORD [XMMBLOCK(1,0,edi,SIZEOF_DCTELEM)], xmm1\n        movdqa  XMMWORD [XMMBLOCK(2,0,edi,SIZEOF_DCTELEM)], xmm2\n        movdqa  XMMWORD [XMMBLOCK(3,0,edi,SIZEOF_DCTELEM)], xmm3\n\n        add     esi, byte 4*SIZEOF_JSAMPROW\n        add     edi, byte 4*DCTSIZE*SIZEOF_DCTELEM\n        dec     ecx\n        jnz     short .convloop\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        pop     ebp\n        ret\n\n; --------------------------------------------------------------------------\n;\n; Quantize/descale the coefficients, and store into coef_block\n;\n; This implementation is based on an algorithm described in\n;   \"How to optimize for the Pentium family of microprocessors\"\n;   (http://www.agner.org/assem/).\n;\n; GLOBAL(void)\n; jsimd_quantize_sse2 (JCOEFPTR coef_block, DCTELEM *divisors,\n;                      DCTELEM *workspace);\n;\n\n%define RECIPROCAL(m,n,b) XMMBLOCK(DCTSIZE*0+(m),(n),(b),SIZEOF_DCTELEM)\n%define CORRECTION(m,n,b) XMMBLOCK(DCTSIZE*1+(m),(n),(b),SIZEOF_DCTELEM)\n%define SCALE(m,n,b)      XMMBLOCK(DCTSIZE*2+(m),(n),(b),SIZEOF_DCTELEM)\n\n%define coef_block      ebp+8           ; JCOEFPTR coef_block\n%define divisors        ebp+12          ; DCTELEM *divisors\n%define workspace       ebp+16          ; DCTELEM *workspace\n\n        align   16\n        global  EXTN(jsimd_quantize_sse2)\n\nEXTN(jsimd_quantize_sse2):\n        push    ebp\n        mov     ebp,esp\n;       push    ebx             ; unused\n;       push    ecx             ; unused\n;       push    edx             ; need not be preserved\n        push    esi\n        push    edi\n\n        mov     esi, POINTER [workspace]\n        mov     edx, POINTER [divisors]\n        mov     edi, JCOEFPTR [coef_block]\n        mov     eax, DCTSIZE2/32\n        alignx  16,7\n.quantloop:\n        movdqa  xmm4, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_DCTELEM)]\n        movdqa  xmm5, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_DCTELEM)]\n        movdqa  xmm6, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_DCTELEM)]\n        movdqa  xmm7, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_DCTELEM)]\n        movdqa  xmm0,xmm4\n        movdqa  xmm1,xmm5\n        movdqa  xmm2,xmm6\n        movdqa  xmm3,xmm7\n        psraw   xmm4,(WORD_BIT-1)\n        psraw   xmm5,(WORD_BIT-1)\n        psraw   xmm6,(WORD_BIT-1)\n        psraw   xmm7,(WORD_BIT-1)\n        pxor    xmm0,xmm4\n        pxor    xmm1,xmm5\n        pxor    xmm2,xmm6\n        pxor    xmm3,xmm7\n        psubw   xmm0,xmm4               ; if (xmm0 < 0) xmm0 = -xmm0;\n        psubw   xmm1,xmm5               ; if (xmm1 < 0) xmm1 = -xmm1;\n        psubw   xmm2,xmm6               ; if (xmm2 < 0) xmm2 = -xmm2;\n        psubw   xmm3,xmm7               ; if (xmm3 < 0) xmm3 = -xmm3;\n\n        paddw   xmm0, XMMWORD [CORRECTION(0,0,edx)]  ; correction + roundfactor\n        paddw   xmm1, XMMWORD [CORRECTION(1,0,edx)]\n        paddw   xmm2, XMMWORD [CORRECTION(2,0,edx)]\n        paddw   xmm3, XMMWORD [CORRECTION(3,0,edx)]\n        pmulhuw xmm0, XMMWORD [RECIPROCAL(0,0,edx)]  ; reciprocal\n        pmulhuw xmm1, XMMWORD [RECIPROCAL(1,0,edx)]\n        pmulhuw xmm2, XMMWORD [RECIPROCAL(2,0,edx)]\n        pmulhuw xmm3, XMMWORD [RECIPROCAL(3,0,edx)]\n        pmulhuw xmm0, XMMWORD [SCALE(0,0,edx)]  ; scale\n        pmulhuw xmm1, XMMWORD [SCALE(1,0,edx)]\n        pmulhuw xmm2, XMMWORD [SCALE(2,0,edx)]\n        pmulhuw xmm3, XMMWORD [SCALE(3,0,edx)]\n\n        pxor    xmm0,xmm4\n        pxor    xmm1,xmm5\n        pxor    xmm2,xmm6\n        pxor    xmm3,xmm7\n        psubw   xmm0,xmm4\n        psubw   xmm1,xmm5\n        psubw   xmm2,xmm6\n        psubw   xmm3,xmm7\n        movdqa  XMMWORD [XMMBLOCK(0,0,edi,SIZEOF_DCTELEM)], xmm0\n        movdqa  XMMWORD [XMMBLOCK(1,0,edi,SIZEOF_DCTELEM)], xmm1\n        movdqa  XMMWORD [XMMBLOCK(2,0,edi,SIZEOF_DCTELEM)], xmm2\n        movdqa  XMMWORD [XMMBLOCK(3,0,edi,SIZEOF_DCTELEM)], xmm3\n\n        add     esi, byte 32*SIZEOF_DCTELEM\n        add     edx, byte 32*SIZEOF_DCTELEM\n        add     edi, byte 32*SIZEOF_JCOEF\n        dec     eax\n        jnz     near .quantloop\n\n        pop     edi\n        pop     esi\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; unused\n;       pop     ebx             ; unused\n        pop     ebp\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jsimd.h",
    "content": "/*\n * simd/jsimd.h\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2011, 2014-2016, D. R. Commander.\n * Copyright (C) 2013-2014, MIPS Technologies, Inc., California.\n * Copyright (C) 2014, Linaro Limited.\n * Copyright (C) 2015-2016, Matthieu Darbois.\n *\n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n */\n\n/* Bitmask for supported acceleration methods */\n\n#define JSIMD_NONE       0x00\n#define JSIMD_MMX        0x01\n#define JSIMD_3DNOW      0x02\n#define JSIMD_SSE        0x04\n#define JSIMD_SSE2       0x08\n#define JSIMD_ARM_NEON   0x10\n#define JSIMD_MIPS_DSPR2 0x20\n#define JSIMD_ALTIVEC    0x40\n\n/* SIMD Ext: retrieve SIMD/CPU information */\nEXTERN(unsigned int) jpeg_simd_cpu_support (void);\n\n/* RGB & extended RGB --> YCC Colorspace Conversion */\nEXTERN(void) jsimd_rgb_ycc_convert_mmx\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgb_ycc_convert_mmx\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgbx_ycc_convert_mmx\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgr_ycc_convert_mmx\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgrx_ycc_convert_mmx\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxbgr_ycc_convert_mmx\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxrgb_ycc_convert_mmx\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\n\nextern const int jconst_rgb_ycc_convert_sse2[];\nEXTERN(void) jsimd_rgb_ycc_convert_sse2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgb_ycc_convert_sse2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgbx_ycc_convert_sse2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgr_ycc_convert_sse2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgrx_ycc_convert_sse2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxbgr_ycc_convert_sse2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxrgb_ycc_convert_sse2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\n\nEXTERN(void) jsimd_rgb_ycc_convert_neon\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgb_ycc_convert_neon\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgbx_ycc_convert_neon\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgr_ycc_convert_neon\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgrx_ycc_convert_neon\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxbgr_ycc_convert_neon\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxrgb_ycc_convert_neon\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\n\nEXTERN(void) jsimd_extrgb_ycc_convert_neon_slowld3\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgr_ycc_convert_neon_slowld3\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\n\nEXTERN(void) jsimd_rgb_ycc_convert_mips_dspr2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgb_ycc_convert_mips_dspr2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgbx_ycc_convert_mips_dspr2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgr_ycc_convert_mips_dspr2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgrx_ycc_convert_mips_dspr2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxbgr_ycc_convert_mips_dspr2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxrgb_ycc_convert_mips_dspr2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\n\nEXTERN(void) jsimd_rgb_ycc_convert_altivec\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgb_ycc_convert_altivec\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgbx_ycc_convert_altivec\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgr_ycc_convert_altivec\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgrx_ycc_convert_altivec\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxbgr_ycc_convert_altivec\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxrgb_ycc_convert_altivec\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\n\n/* RGB & extended RGB --> Grayscale Colorspace Conversion */\nEXTERN(void) jsimd_rgb_gray_convert_mmx\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgb_gray_convert_mmx\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgbx_gray_convert_mmx\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgr_gray_convert_mmx\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgrx_gray_convert_mmx\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxbgr_gray_convert_mmx\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxrgb_gray_convert_mmx\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\n\nextern const int jconst_rgb_gray_convert_sse2[];\nEXTERN(void) jsimd_rgb_gray_convert_sse2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgb_gray_convert_sse2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgbx_gray_convert_sse2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgr_gray_convert_sse2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgrx_gray_convert_sse2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxbgr_gray_convert_sse2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxrgb_gray_convert_sse2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\n\nEXTERN(void) jsimd_rgb_gray_convert_mips_dspr2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgb_gray_convert_mips_dspr2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgbx_gray_convert_mips_dspr2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgr_gray_convert_mips_dspr2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgrx_gray_convert_mips_dspr2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxbgr_gray_convert_mips_dspr2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxrgb_gray_convert_mips_dspr2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\n\nEXTERN(void) jsimd_rgb_gray_convert_altivec\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgb_gray_convert_altivec\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extrgbx_gray_convert_altivec\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgr_gray_convert_altivec\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extbgrx_gray_convert_altivec\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxbgr_gray_convert_altivec\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\nEXTERN(void) jsimd_extxrgb_gray_convert_altivec\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows);\n\n/* YCC --> RGB & extended RGB Colorspace Conversion */\nEXTERN(void) jsimd_ycc_rgb_convert_mmx\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extrgb_convert_mmx\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extrgbx_convert_mmx\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extbgr_convert_mmx\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extbgrx_convert_mmx\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extxbgr_convert_mmx\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extxrgb_convert_mmx\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\n\nextern const int jconst_ycc_rgb_convert_sse2[];\nEXTERN(void) jsimd_ycc_rgb_convert_sse2\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extrgb_convert_sse2\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extrgbx_convert_sse2\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extbgr_convert_sse2\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extbgrx_convert_sse2\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extxbgr_convert_sse2\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extxrgb_convert_sse2\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\n\nEXTERN(void) jsimd_ycc_rgb_convert_neon\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extrgb_convert_neon\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extrgbx_convert_neon\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extbgr_convert_neon\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extbgrx_convert_neon\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extxbgr_convert_neon\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extxrgb_convert_neon\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_rgb565_convert_neon\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\n\nEXTERN(void) jsimd_ycc_extrgb_convert_neon_slowst3\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extbgr_convert_neon_slowst3\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\n\nEXTERN(void) jsimd_ycc_rgb_convert_mips_dspr2\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extrgb_convert_mips_dspr2\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extrgbx_convert_mips_dspr2\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extbgr_convert_mips_dspr2\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extbgrx_convert_mips_dspr2\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extxbgr_convert_mips_dspr2\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extxrgb_convert_mips_dspr2\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\n\nEXTERN(void) jsimd_ycc_rgb_convert_altivec\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extrgb_convert_altivec\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extrgbx_convert_altivec\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extbgr_convert_altivec\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extbgrx_convert_altivec\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extxbgr_convert_altivec\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\nEXTERN(void) jsimd_ycc_extxrgb_convert_altivec\n        (JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,\n         JSAMPARRAY output_buf, int num_rows);\n\n/* NULL Colorspace Conversion */\nEXTERN(void) jsimd_c_null_convert_mips_dspr2\n        (JDIMENSION img_width, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n         JDIMENSION output_row, int num_rows, int num_components);\n\n/* h2v1 Downsampling */\nEXTERN(void) jsimd_h2v1_downsample_mmx\n        (JDIMENSION image_width, int max_v_samp_factor,\n         JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n         JSAMPARRAY input_data, JSAMPARRAY output_data);\n\nEXTERN(void) jsimd_h2v1_downsample_sse2\n        (JDIMENSION image_width, int max_v_samp_factor,\n         JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n         JSAMPARRAY input_data, JSAMPARRAY output_data);\n\nEXTERN(void) jsimd_h2v1_downsample_neon\n        (JDIMENSION image_width, int max_v_samp_factor,\n         JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n         JSAMPARRAY input_data, JSAMPARRAY output_data);\n\nEXTERN(void) jsimd_h2v1_downsample_mips_dspr2\n        (JDIMENSION image_width, int max_v_samp_factor,\n         JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n         JSAMPARRAY input_data, JSAMPARRAY output_data);\n\nEXTERN(void) jsimd_h2v1_downsample_altivec\n        (JDIMENSION image_width, int max_v_samp_factor,\n         JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n         JSAMPARRAY input_data, JSAMPARRAY output_data);\n\n/* h2v2 Downsampling */\nEXTERN(void) jsimd_h2v2_downsample_mmx\n        (JDIMENSION image_width, int max_v_samp_factor,\n         JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n         JSAMPARRAY input_data, JSAMPARRAY output_data);\n\nEXTERN(void) jsimd_h2v2_downsample_sse2\n        (JDIMENSION image_width, int max_v_samp_factor,\n         JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n         JSAMPARRAY input_data, JSAMPARRAY output_data);\n\nEXTERN(void) jsimd_h2v2_downsample_neon\n        (JDIMENSION image_width, int max_v_samp_factor,\n         JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n         JSAMPARRAY input_data, JSAMPARRAY output_data);\n\nEXTERN(void) jsimd_h2v2_downsample_mips_dspr2\n        (JDIMENSION image_width, int max_v_samp_factor,\n         JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n         JSAMPARRAY input_data, JSAMPARRAY output_data);\n\nEXTERN(void) jsimd_h2v2_downsample_altivec\n        (JDIMENSION image_width, int max_v_samp_factor,\n         JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n         JSAMPARRAY input_data, JSAMPARRAY output_data);\n\n/* h2v2 Smooth Downsampling */\nEXTERN(void) jsimd_h2v2_smooth_downsample_mips_dspr2\n        (JSAMPARRAY input_data, JSAMPARRAY output_data,\n         JDIMENSION v_samp_factor, int max_v_samp_factor,\n         int smoothing_factor, JDIMENSION width_blocks,\n         JDIMENSION image_width);\n\n\n/* Upsampling */\nEXTERN(void) jsimd_h2v1_upsample_mmx\n        (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data,\n         JSAMPARRAY *output_data_ptr);\nEXTERN(void) jsimd_h2v2_upsample_mmx\n        (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data,\n         JSAMPARRAY *output_data_ptr);\n\nEXTERN(void) jsimd_h2v1_upsample_sse2\n        (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data,\n         JSAMPARRAY *output_data_ptr);\nEXTERN(void) jsimd_h2v2_upsample_sse2\n        (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data,\n         JSAMPARRAY *output_data_ptr);\n\nEXTERN(void) jsimd_h2v1_upsample_mips_dspr2\n        (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data,\n         JSAMPARRAY *output_data_ptr);\nEXTERN(void) jsimd_h2v2_upsample_mips_dspr2\n        (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data,\n         JSAMPARRAY *output_data_ptr);\n\nEXTERN(void) jsimd_int_upsample_mips_dspr2\n        (UINT8 h_expand, UINT8 v_expand, JSAMPARRAY input_data,\n         JSAMPARRAY *output_data_ptr, JDIMENSION output_width,\n         int max_v_samp_factor);\n\nEXTERN(void) jsimd_h2v1_upsample_altivec\n        (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data,\n         JSAMPARRAY *output_data_ptr);\nEXTERN(void) jsimd_h2v2_upsample_altivec\n        (int max_v_samp_factor, JDIMENSION output_width, JSAMPARRAY input_data,\n         JSAMPARRAY *output_data_ptr);\n\n/* Fancy Upsampling */\nEXTERN(void) jsimd_h2v1_fancy_upsample_mmx\n        (int max_v_samp_factor, JDIMENSION downsampled_width,\n         JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);\nEXTERN(void) jsimd_h2v2_fancy_upsample_mmx\n        (int max_v_samp_factor, JDIMENSION downsampled_width,\n         JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);\n\nextern const int jconst_fancy_upsample_sse2[];\nEXTERN(void) jsimd_h2v1_fancy_upsample_sse2\n        (int max_v_samp_factor, JDIMENSION downsampled_width,\n         JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);\nEXTERN(void) jsimd_h2v2_fancy_upsample_sse2\n        (int max_v_samp_factor, JDIMENSION downsampled_width,\n         JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);\n\nEXTERN(void) jsimd_h2v1_fancy_upsample_neon\n        (int max_v_samp_factor, JDIMENSION downsampled_width,\n         JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);\n\nEXTERN(void) jsimd_h2v1_fancy_upsample_mips_dspr2\n        (int max_v_samp_factor, JDIMENSION downsampled_width,\n         JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);\nEXTERN(void) jsimd_h2v2_fancy_upsample_mips_dspr2\n        (int max_v_samp_factor, JDIMENSION downsampled_width,\n         JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);\n\nEXTERN(void) jsimd_h2v1_fancy_upsample_altivec\n        (int max_v_samp_factor, JDIMENSION downsampled_width,\n         JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);\nEXTERN(void) jsimd_h2v2_fancy_upsample_altivec\n        (int max_v_samp_factor, JDIMENSION downsampled_width,\n         JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr);\n\n/* Merged Upsampling */\nEXTERN(void) jsimd_h2v1_merged_upsample_mmx\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extrgb_merged_upsample_mmx\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_mmx\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extbgr_merged_upsample_mmx\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_mmx\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_mmx\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_mmx\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\n\nEXTERN(void) jsimd_h2v2_merged_upsample_mmx\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extrgb_merged_upsample_mmx\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_mmx\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extbgr_merged_upsample_mmx\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_mmx\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_mmx\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_mmx\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\n\nextern const int jconst_merged_upsample_sse2[];\nEXTERN(void) jsimd_h2v1_merged_upsample_sse2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extrgb_merged_upsample_sse2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_sse2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extbgr_merged_upsample_sse2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_sse2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_sse2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_sse2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\n\nEXTERN(void) jsimd_h2v2_merged_upsample_sse2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extrgb_merged_upsample_sse2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_sse2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extbgr_merged_upsample_sse2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_sse2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_sse2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_sse2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\n\nEXTERN(void) jsimd_h2v1_merged_upsample_mips_dspr2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);\nEXTERN(void) jsimd_h2v1_extrgb_merged_upsample_mips_dspr2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);\nEXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_mips_dspr2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);\nEXTERN(void) jsimd_h2v1_extbgr_merged_upsample_mips_dspr2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);\nEXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_mips_dspr2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);\nEXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_mips_dspr2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);\nEXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_mips_dspr2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);\n\nEXTERN(void) jsimd_h2v2_merged_upsample_mips_dspr2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);\nEXTERN(void) jsimd_h2v2_extrgb_merged_upsample_mips_dspr2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);\nEXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_mips_dspr2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);\nEXTERN(void) jsimd_h2v2_extbgr_merged_upsample_mips_dspr2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);\nEXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_mips_dspr2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);\nEXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_mips_dspr2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);\nEXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_mips_dspr2\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf, JSAMPLE* range);\n\nEXTERN(void) jsimd_h2v1_merged_upsample_altivec\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extrgb_merged_upsample_altivec\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_altivec\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extbgr_merged_upsample_altivec\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_altivec\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_altivec\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_altivec\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\n\nEXTERN(void) jsimd_h2v2_merged_upsample_altivec\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extrgb_merged_upsample_altivec\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_altivec\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extbgr_merged_upsample_altivec\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_altivec\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_altivec\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\nEXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_altivec\n        (JDIMENSION output_width, JSAMPIMAGE input_buf,\n         JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf);\n\n/* Sample Conversion */\nEXTERN(void) jsimd_convsamp_mmx\n        (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace);\n\nEXTERN(void) jsimd_convsamp_sse2\n        (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace);\n\nEXTERN(void) jsimd_convsamp_neon\n        (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace);\n\nEXTERN(void) jsimd_convsamp_mips_dspr2\n        (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace);\n\nEXTERN(void) jsimd_convsamp_altivec\n        (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace);\n\n/* Floating Point Sample Conversion */\nEXTERN(void) jsimd_convsamp_float_3dnow\n        (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace);\n\nEXTERN(void) jsimd_convsamp_float_sse\n        (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace);\n\nEXTERN(void) jsimd_convsamp_float_sse2\n        (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace);\n\nEXTERN(void) jsimd_convsamp_float_mips_dspr2\n        (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT *workspace);\n\n/* Slow Integer Forward DCT */\nEXTERN(void) jsimd_fdct_islow_mmx (DCTELEM *data);\n\nextern const int jconst_fdct_islow_sse2[];\nEXTERN(void) jsimd_fdct_islow_sse2 (DCTELEM *data);\n\nEXTERN(void) jsimd_fdct_islow_neon (DCTELEM *data);\n\nEXTERN(void) jsimd_fdct_islow_mips_dspr2 (DCTELEM *data);\n\nEXTERN(void) jsimd_fdct_islow_altivec (DCTELEM *data);\n\n/* Fast Integer Forward DCT */\nEXTERN(void) jsimd_fdct_ifast_mmx (DCTELEM *data);\n\nextern const int jconst_fdct_ifast_sse2[];\nEXTERN(void) jsimd_fdct_ifast_sse2 (DCTELEM *data);\n\nEXTERN(void) jsimd_fdct_ifast_neon (DCTELEM *data);\n\nEXTERN(void) jsimd_fdct_ifast_mips_dspr2 (DCTELEM *data);\n\nEXTERN(void) jsimd_fdct_ifast_altivec (DCTELEM *data);\n\n/* Floating Point Forward DCT */\nEXTERN(void) jsimd_fdct_float_3dnow (FAST_FLOAT *data);\n\nextern const int jconst_fdct_float_sse[];\nEXTERN(void) jsimd_fdct_float_sse (FAST_FLOAT *data);\n\n/* Quantization */\nEXTERN(void) jsimd_quantize_mmx\n        (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace);\n\nEXTERN(void) jsimd_quantize_sse2\n        (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace);\n\nEXTERN(void) jsimd_quantize_neon\n        (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace);\n\nEXTERN(void) jsimd_quantize_mips_dspr2\n        (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace);\n\nEXTERN(void) jsimd_quantize_altivec\n        (JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace);\n\n/* Floating Point Quantization */\nEXTERN(void) jsimd_quantize_float_3dnow\n        (JCOEFPTR coef_block, FAST_FLOAT *divisors, FAST_FLOAT *workspace);\n\nEXTERN(void) jsimd_quantize_float_sse\n        (JCOEFPTR coef_block, FAST_FLOAT *divisors, FAST_FLOAT *workspace);\n\nEXTERN(void) jsimd_quantize_float_sse2\n        (JCOEFPTR coef_block, FAST_FLOAT *divisors, FAST_FLOAT *workspace);\n\nEXTERN(void) jsimd_quantize_float_mips_dspr2\n        (JCOEFPTR coef_block, FAST_FLOAT *divisors, FAST_FLOAT *workspace);\n\n/* Scaled Inverse DCT */\nEXTERN(void) jsimd_idct_2x2_mmx\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\nEXTERN(void) jsimd_idct_4x4_mmx\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\n\nextern const int jconst_idct_red_sse2[];\nEXTERN(void) jsimd_idct_2x2_sse2\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\nEXTERN(void) jsimd_idct_4x4_sse2\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\n\nEXTERN(void) jsimd_idct_2x2_neon\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\nEXTERN(void) jsimd_idct_4x4_neon\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\n\nEXTERN(void) jsimd_idct_2x2_mips_dspr2\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\nEXTERN(void) jsimd_idct_4x4_mips_dspr2\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col, int *workspace);\nEXTERN(void) jsimd_idct_6x6_mips_dspr2\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\nEXTERN(void) jsimd_idct_12x12_pass1_mips_dspr2\n        (JCOEFPTR coef_block, void *dct_table, int *workspace);\nEXTERN(void) jsimd_idct_12x12_pass2_mips_dspr2\n        (int *workspace, int *output);\n\n/* Slow Integer Inverse DCT */\nEXTERN(void) jsimd_idct_islow_mmx\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\n\nextern const int jconst_idct_islow_sse2[];\nEXTERN(void) jsimd_idct_islow_sse2\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\n\nEXTERN(void) jsimd_idct_islow_neon\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\n\nEXTERN(void) jsimd_idct_islow_mips_dspr2\n        (void *dct_table, JCOEFPTR coef_block, int *output_buf,\n         JSAMPLE *output_col);\n\nEXTERN(void) jsimd_idct_islow_altivec\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\n\n/* Fast Integer Inverse DCT */\nEXTERN(void) jsimd_idct_ifast_mmx\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\n\nextern const int jconst_idct_ifast_sse2[];\nEXTERN(void) jsimd_idct_ifast_sse2\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\n\nEXTERN(void) jsimd_idct_ifast_neon\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\n\nEXTERN(void) jsimd_idct_ifast_cols_mips_dspr2\n        (JCOEF *inptr, IFAST_MULT_TYPE *quantptr, DCTELEM *wsptr,\n         const int *idct_coefs);\nEXTERN(void) jsimd_idct_ifast_rows_mips_dspr2\n        (DCTELEM *wsptr, JSAMPARRAY output_buf, JDIMENSION output_col,\n         const int *idct_coefs);\n\nEXTERN(void) jsimd_idct_ifast_altivec\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\n\n/* Floating Point Inverse DCT */\nEXTERN(void) jsimd_idct_float_3dnow\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\n\nextern const int jconst_idct_float_sse[];\nEXTERN(void) jsimd_idct_float_sse\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\n\nextern const int jconst_idct_float_sse2[];\nEXTERN(void) jsimd_idct_float_sse2\n        (void *dct_table, JCOEFPTR coef_block, JSAMPARRAY output_buf,\n         JDIMENSION output_col);\n\n/* Huffman coding */\nextern const int jconst_huff_encode_one_block[];\nEXTERN(JOCTET*) jsimd_huff_encode_one_block_sse2\n        (void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val,\n         c_derived_tbl *dctbl, c_derived_tbl *actbl);\n\nEXTERN(JOCTET*) jsimd_huff_encode_one_block_neon\n        (void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val,\n         c_derived_tbl *dctbl, c_derived_tbl *actbl);\n\nEXTERN(JOCTET*) jsimd_huff_encode_one_block_neon_slowtbl\n        (void *state, JOCTET *buffer, JCOEFPTR block, int last_dc_val,\n         c_derived_tbl *dctbl, c_derived_tbl *actbl);\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jsimd_altivec.h",
    "content": "/*\n * AltiVec optimizations for libjpeg-turbo\n *\n * Copyright (C) 2014-2015, D. R. Commander.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n#define JPEG_INTERNALS\n#include \"../jinclude.h\"\n#include \"../jpeglib.h\"\n#include \"../jsimd.h\"\n#include \"../jdct.h\"\n#include \"../jsimddct.h\"\n#include \"jsimd.h\"\n#include <altivec.h>\n\n\n/* Common code */\n\n#define __4X(a) a, a, a, a\n#define __4X2(a, b) a, b, a, b, a, b, a, b\n#define __8X(a) __4X(a), __4X(a)\n#define __16X(a) __8X(a), __8X(a)\n\n#define TRANSPOSE(row, col)  \\\n{  \\\n  __vector short row04l, row04h, row15l, row15h,  \\\n                 row26l, row26h, row37l, row37h;  \\\n  __vector short col01e, col01o, col23e, col23o,  \\\n                 col45e, col45o, col67e, col67o;  \\\n  \\\n                                       /* transpose coefficients (phase 1) */ \\\n  row04l = vec_mergeh(row##0, row##4); /* row04l=(00 40 01 41 02 42 03 43) */ \\\n  row04h = vec_mergel(row##0, row##4); /* row04h=(04 44 05 45 06 46 07 47) */ \\\n  row15l = vec_mergeh(row##1, row##5); /* row15l=(10 50 11 51 12 52 13 53) */ \\\n  row15h = vec_mergel(row##1, row##5); /* row15h=(14 54 15 55 16 56 17 57) */ \\\n  row26l = vec_mergeh(row##2, row##6); /* row26l=(20 60 21 61 22 62 23 63) */ \\\n  row26h = vec_mergel(row##2, row##6); /* row26h=(24 64 25 65 26 66 27 67) */ \\\n  row37l = vec_mergeh(row##3, row##7); /* row37l=(30 70 31 71 32 72 33 73) */ \\\n  row37h = vec_mergel(row##3, row##7); /* row37h=(34 74 35 75 36 76 37 77) */ \\\n  \\\n                                       /* transpose coefficients (phase 2) */ \\\n  col01e = vec_mergeh(row04l, row26l); /* col01e=(00 20 40 60 01 21 41 61) */ \\\n  col23e = vec_mergel(row04l, row26l); /* col23e=(02 22 42 62 03 23 43 63) */ \\\n  col45e = vec_mergeh(row04h, row26h); /* col45e=(04 24 44 64 05 25 45 65) */ \\\n  col67e = vec_mergel(row04h, row26h); /* col67e=(06 26 46 66 07 27 47 67) */ \\\n  col01o = vec_mergeh(row15l, row37l); /* col01o=(10 30 50 70 11 31 51 71) */ \\\n  col23o = vec_mergel(row15l, row37l); /* col23o=(12 32 52 72 13 33 53 73) */ \\\n  col45o = vec_mergeh(row15h, row37h); /* col45o=(14 34 54 74 15 35 55 75) */ \\\n  col67o = vec_mergel(row15h, row37h); /* col67o=(16 36 56 76 17 37 57 77) */ \\\n  \\\n                                       /* transpose coefficients (phase 3) */ \\\n  col##0 = vec_mergeh(col01e, col01o); /* col0=(00 10 20 30 40 50 60 70) */   \\\n  col##1 = vec_mergel(col01e, col01o); /* col1=(01 11 21 31 41 51 61 71) */   \\\n  col##2 = vec_mergeh(col23e, col23o); /* col2=(02 12 22 32 42 52 62 72) */   \\\n  col##3 = vec_mergel(col23e, col23o); /* col3=(03 13 23 33 43 53 63 73) */   \\\n  col##4 = vec_mergeh(col45e, col45o); /* col4=(04 14 24 34 44 54 64 74) */   \\\n  col##5 = vec_mergel(col45e, col45o); /* col5=(05 15 25 35 45 55 65 75) */   \\\n  col##6 = vec_mergeh(col67e, col67o); /* col6=(06 16 26 36 46 56 66 76) */   \\\n  col##7 = vec_mergel(col67e, col67o); /* col7=(07 17 27 37 47 57 67 77) */   \\\n}\n\n#ifndef min\n#define min(a,b) ((a) < (b) ? (a) : (b))\n#endif\n\n\n/* Macros to abstract big/little endian bit twiddling */\n\n#if __BIG_ENDIAN__\n\n#define VEC_LD(a, b) vec_ld(a, b)\n#define VEC_ST(a, b, c) vec_st(a, b, c)\n#define VEC_UNPACKHU(a) vec_mergeh(pb_zero, a)\n#define VEC_UNPACKLU(a) vec_mergel(pb_zero, a)\n\n#else\n\n#define VEC_LD(a, b) vec_vsx_ld(a, b)\n#define VEC_ST(a, b, c) vec_vsx_st(a, b, c)\n#define VEC_UNPACKHU(a) vec_mergeh(a, pb_zero)\n#define VEC_UNPACKLU(a) vec_mergel(a, pb_zero)\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jsimd_arm.c",
    "content": "/*\n * jsimd_arm.c\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander.\n * Copyright (C) 2015-2016, Matthieu Darbois.\n *\n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n * This file contains the interface between the \"normal\" portions\n * of the library and the SIMD implementations when running on a\n * 32-bit ARM architecture.\n */\n\n#define JPEG_INTERNALS\n#include \"../jinclude.h\"\n#include \"../jpeglib.h\"\n#include \"../jsimd.h\"\n#include \"../jdct.h\"\n#include \"../jsimddct.h\"\n#include \"jsimd.h\"\n\n#include <stdio.h>\n#include <string.h>\n#include <ctype.h>\n\nstatic unsigned int simd_support = ~0;\nstatic unsigned int simd_huffman = 1;\n\n#if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)\n\n#define SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT (1024 * 1024)\n\nLOCAL(int)\ncheck_feature (char *buffer, char *feature)\n{\n  char *p;\n  if (*feature == 0)\n    return 0;\n  if (strncmp(buffer, \"Features\", 8) != 0)\n    return 0;\n  buffer += 8;\n  while (isspace(*buffer))\n    buffer++;\n\n  /* Check if 'feature' is present in the buffer as a separate word */\n  while ((p = strstr(buffer, feature))) {\n    if (p > buffer && !isspace(*(p - 1))) {\n      buffer++;\n      continue;\n    }\n    p += strlen(feature);\n    if (*p != 0 && !isspace(*p)) {\n      buffer++;\n      continue;\n    }\n    return 1;\n  }\n  return 0;\n}\n\nLOCAL(int)\nparse_proc_cpuinfo (int bufsize)\n{\n  char *buffer = (char *)malloc(bufsize);\n  FILE *fd;\n  simd_support = 0;\n\n  if (!buffer)\n    return 0;\n\n  fd = fopen(\"/proc/cpuinfo\", \"r\");\n  if (fd) {\n    while (fgets(buffer, bufsize, fd)) {\n      if (!strchr(buffer, '\\n') && !feof(fd)) {\n        /* \"impossible\" happened - insufficient size of the buffer! */\n        fclose(fd);\n        free(buffer);\n        return 0;\n      }\n      if (check_feature(buffer, \"neon\"))\n        simd_support |= JSIMD_ARM_NEON;\n    }\n    fclose(fd);\n  }\n  free(buffer);\n  return 1;\n}\n\n#endif\n\n/*\n * Check what SIMD accelerations are supported.\n *\n * FIXME: This code is racy under a multi-threaded environment.\n */\nLOCAL(void)\ninit_simd (void)\n{\n  char *env = NULL;\n#if !defined(__ARM_NEON__) && defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)\n  int bufsize = 1024; /* an initial guess for the line buffer size limit */\n#endif\n\n  if (simd_support != ~0U)\n    return;\n\n  simd_support = 0;\n\n#if defined(__ARM_NEON__)\n  simd_support |= JSIMD_ARM_NEON;\n#elif defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)\n  /* We still have a chance to use NEON regardless of globally used\n   * -mcpu/-mfpu options passed to gcc by performing runtime detection via\n   * /proc/cpuinfo parsing on linux/android */\n  while (!parse_proc_cpuinfo(bufsize)) {\n    bufsize *= 2;\n    if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT)\n      break;\n  }\n#endif\n\n  /* Force different settings through environment variables */\n  env = getenv(\"JSIMD_FORCENEON\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support &= JSIMD_ARM_NEON;\n  env = getenv(\"JSIMD_FORCENONE\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support = 0;\n  env = getenv(\"JSIMD_NOHUFFENC\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_huffman = 0;\n}\n\nGLOBAL(int)\njsimd_can_rgb_ycc (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_rgb_gray (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb565 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_rgb_ycc_convert (j_compress_ptr cinfo,\n                       JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                       JDIMENSION output_row, int num_rows)\n{\n  void (*neonfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n\n  switch(cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      neonfct=jsimd_extrgb_ycc_convert_neon;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      neonfct=jsimd_extrgbx_ycc_convert_neon;\n      break;\n    case JCS_EXT_BGR:\n      neonfct=jsimd_extbgr_ycc_convert_neon;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      neonfct=jsimd_extbgrx_ycc_convert_neon;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      neonfct=jsimd_extxbgr_ycc_convert_neon;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      neonfct=jsimd_extxrgb_ycc_convert_neon;\n      break;\n    default:\n      neonfct=jsimd_extrgb_ycc_convert_neon;\n      break;\n  }\n\n  neonfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);\n}\n\nGLOBAL(void)\njsimd_rgb_gray_convert (j_compress_ptr cinfo,\n                        JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                        JDIMENSION output_row, int num_rows)\n{\n}\n\nGLOBAL(void)\njsimd_ycc_rgb_convert (j_decompress_ptr cinfo,\n                       JSAMPIMAGE input_buf, JDIMENSION input_row,\n                       JSAMPARRAY output_buf, int num_rows)\n{\n  void (*neonfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);\n\n  switch(cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      neonfct=jsimd_ycc_extrgb_convert_neon;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      neonfct=jsimd_ycc_extrgbx_convert_neon;\n      break;\n    case JCS_EXT_BGR:\n      neonfct=jsimd_ycc_extbgr_convert_neon;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      neonfct=jsimd_ycc_extbgrx_convert_neon;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      neonfct=jsimd_ycc_extxbgr_convert_neon;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      neonfct=jsimd_ycc_extxrgb_convert_neon;\n      break;\n    default:\n      neonfct=jsimd_ycc_extrgb_convert_neon;\n      break;\n  }\n\n  neonfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);\n}\n\nGLOBAL(void)\njsimd_ycc_rgb565_convert (j_decompress_ptr cinfo,\n                          JSAMPIMAGE input_buf, JDIMENSION input_row,\n                          JSAMPARRAY output_buf, int num_rows)\n{\n  jsimd_ycc_rgb565_convert_neon(cinfo->output_width, input_buf, input_row,\n                                output_buf, num_rows);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_downsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_downsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info *compptr,\n                     JSAMPARRAY input_data,\n                     JSAMPARRAY *output_data_ptr)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info *compptr,\n                     JSAMPARRAY input_data,\n                     JSAMPARRAY *output_data_ptr)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_fancy_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_fancy_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info *compptr,\n                           JSAMPARRAY input_data,\n                           JSAMPARRAY *output_data_ptr)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info *compptr,\n                           JSAMPARRAY input_data,\n                           JSAMPARRAY *output_data_ptr)\n{\n  jsimd_h2v1_fancy_upsample_neon(cinfo->max_v_samp_factor,\n                                 compptr->downsampled_width, input_data,\n                                 output_data_ptr);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_merged_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_merged_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n}\n\nGLOBAL(int)\njsimd_can_convsamp (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_convsamp_float (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,\n                DCTELEM *workspace)\n{\n  jsimd_convsamp_neon(sample_data, start_col, workspace);\n}\n\nGLOBAL(void)\njsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,\n                      FAST_FLOAT *workspace)\n{\n}\n\nGLOBAL(int)\njsimd_can_fdct_islow (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_float (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_fdct_islow (DCTELEM *data)\n{\n}\n\nGLOBAL(void)\njsimd_fdct_ifast (DCTELEM *data)\n{\n  jsimd_fdct_ifast_neon(data);\n}\n\nGLOBAL(void)\njsimd_fdct_float (FAST_FLOAT *data)\n{\n}\n\nGLOBAL(int)\njsimd_can_quantize (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_quantize_float (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors,\n                DCTELEM *workspace)\n{\n  jsimd_quantize_neon(coef_block, divisors, workspace);\n}\n\nGLOBAL(void)\njsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors,\n                      FAST_FLOAT *workspace)\n{\n}\n\nGLOBAL(int)\njsimd_can_idct_2x2 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_4x4 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  jsimd_idct_2x2_neon(compptr->dct_table, coef_block, output_buf,\n                      output_col);\n}\n\nGLOBAL(void)\njsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  jsimd_idct_4x4_neon(compptr->dct_table, coef_block, output_buf,\n                      output_col);\n}\n\nGLOBAL(int)\njsimd_can_idct_islow (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(IFAST_MULT_TYPE) != 2)\n    return 0;\n  if (IFAST_SCALE_BITS != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_float (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n  jsimd_idct_islow_neon(compptr->dct_table, coef_block, output_buf,\n                        output_col);\n}\n\nGLOBAL(void)\njsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n  jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf,\n                        output_col);\n}\n\nGLOBAL(void)\njsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n}\n\nGLOBAL(int)\njsimd_can_huff_encode_one_block (void)\n{\n  init_simd();\n\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON && simd_huffman)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(JOCTET*)\njsimd_huff_encode_one_block (void *state, JOCTET *buffer, JCOEFPTR block,\n                             int last_dc_val, c_derived_tbl *dctbl,\n                             c_derived_tbl *actbl)\n{\n  return jsimd_huff_encode_one_block_neon(state, buffer, block, last_dc_val,\n                                          dctbl, actbl);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jsimd_arm64.c",
    "content": "/*\n * jsimd_arm64.c\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander.\n * Copyright (C) 2015-2016, Matthieu Darbois.\n *\n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n * This file contains the interface between the \"normal\" portions\n * of the library and the SIMD implementations when running on a\n * 64-bit ARM architecture.\n */\n\n#define JPEG_INTERNALS\n#include \"../jinclude.h\"\n#include \"../jpeglib.h\"\n#include \"../jsimd.h\"\n#include \"../jdct.h\"\n#include \"../jsimddct.h\"\n#include \"jsimd.h\"\n\n#include <stdio.h>\n#include <string.h>\n#include <ctype.h>\n\n#define JSIMD_FASTLD3 1\n#define JSIMD_FASTST3 2\n#define JSIMD_FASTTBL 4\n\nstatic unsigned int simd_support = ~0;\nstatic unsigned int simd_huffman = 1;\nstatic unsigned int simd_features = JSIMD_FASTLD3 | JSIMD_FASTST3 |\n                                    JSIMD_FASTTBL;\n\n#if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)\n\n#define SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT (1024 * 1024)\n\nLOCAL(int)\ncheck_cpuinfo (char *buffer, const char *field, char *value)\n{\n  char *p;\n  if (*value == 0)\n    return 0;\n  if (strncmp(buffer, field, strlen(field)) != 0)\n    return 0;\n  buffer += strlen(field);\n  while (isspace(*buffer))\n    buffer++;\n\n  /* Check if 'value' is present in the buffer as a separate word */\n  while ((p = strstr(buffer, value))) {\n    if (p > buffer && !isspace(*(p - 1))) {\n      buffer++;\n      continue;\n    }\n    p += strlen(value);\n    if (*p != 0 && !isspace(*p)) {\n      buffer++;\n      continue;\n    }\n    return 1;\n  }\n  return 0;\n}\n\nLOCAL(int)\nparse_proc_cpuinfo (int bufsize)\n{\n  char *buffer = (char *)malloc(bufsize);\n  FILE *fd;\n\n  if (!buffer)\n    return 0;\n\n  fd = fopen(\"/proc/cpuinfo\", \"r\");\n  if (fd) {\n    while (fgets(buffer, bufsize, fd)) {\n      if (!strchr(buffer, '\\n') && !feof(fd)) {\n        /* \"impossible\" happened - insufficient size of the buffer! */\n        fclose(fd);\n        free(buffer);\n        return 0;\n      }\n      if (check_cpuinfo(buffer, \"CPU part\", \"0xd03\") ||\n          check_cpuinfo(buffer, \"CPU part\", \"0xd07\"))\n        /* The Cortex-A53 has a slow tbl implementation.  We can gain a few\n           percent speedup by disabling the use of that instruction.  The\n           speedup on Cortex-A57 is more subtle but still measurable. */\n        simd_features &= ~JSIMD_FASTTBL;\n      else if (check_cpuinfo(buffer, \"CPU part\", \"0x0a1\"))\n        /* The SIMD version of Huffman encoding is slower than the C version on\n           Cavium ThunderX.  Also, ld3 and st3 are abyssmally slow on that\n           CPU. */\n        simd_huffman = simd_features = 0;\n    }\n    fclose(fd);\n  }\n  free(buffer);\n  return 1;\n}\n\n#endif\n\n/*\n * Check what SIMD accelerations are supported.\n *\n * FIXME: This code is racy under a multi-threaded environment.\n */\n\n/*\n * ARMv8 architectures support NEON extensions by default.\n * It is no longer optional as it was with ARMv7.\n */\n\n\nLOCAL(void)\ninit_simd (void)\n{\n  char *env = NULL;\n#if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)\n  int bufsize = 1024; /* an initial guess for the line buffer size limit */\n#endif\n\n  if (simd_support != ~0U)\n    return;\n\n  simd_support = 0;\n\n  simd_support |= JSIMD_ARM_NEON;\n#if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)\n  while (!parse_proc_cpuinfo(bufsize)) {\n    bufsize *= 2;\n    if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT)\n      break;\n  }\n#endif\n\n  /* Force different settings through environment variables */\n  env = getenv(\"JSIMD_FORCENEON\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support &= JSIMD_ARM_NEON;\n  env = getenv(\"JSIMD_FORCENONE\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support = 0;\n  env = getenv(\"JSIMD_NOHUFFENC\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_huffman = 0;\n  env = getenv(\"JSIMD_FASTLD3\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_features |= JSIMD_FASTLD3;\n  if ((env != NULL) && (strcmp(env, \"0\") == 0))\n    simd_features &= ~JSIMD_FASTLD3;\n  env = getenv(\"JSIMD_FASTST3\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_features |= JSIMD_FASTST3;\n  if ((env != NULL) && (strcmp(env, \"0\") == 0))\n    simd_features &= ~JSIMD_FASTST3;\n}\n\nGLOBAL(int)\njsimd_can_rgb_ycc (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_rgb_gray (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb565 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_rgb_ycc_convert (j_compress_ptr cinfo,\n                       JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                       JDIMENSION output_row, int num_rows)\n{\n  void (*neonfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n\n  switch(cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      if (simd_features & JSIMD_FASTLD3)\n        neonfct=jsimd_extrgb_ycc_convert_neon;\n      else\n        neonfct=jsimd_extrgb_ycc_convert_neon_slowld3;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      neonfct=jsimd_extrgbx_ycc_convert_neon;\n      break;\n    case JCS_EXT_BGR:\n      if (simd_features & JSIMD_FASTLD3)\n        neonfct=jsimd_extbgr_ycc_convert_neon;\n      else\n        neonfct=jsimd_extbgr_ycc_convert_neon_slowld3;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      neonfct=jsimd_extbgrx_ycc_convert_neon;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      neonfct=jsimd_extxbgr_ycc_convert_neon;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      neonfct=jsimd_extxrgb_ycc_convert_neon;\n      break;\n    default:\n      if (simd_features & JSIMD_FASTLD3)\n        neonfct=jsimd_extrgb_ycc_convert_neon;\n      else\n        neonfct=jsimd_extrgb_ycc_convert_neon_slowld3;\n      break;\n  }\n\n  neonfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);\n}\n\nGLOBAL(void)\njsimd_rgb_gray_convert (j_compress_ptr cinfo,\n                        JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                        JDIMENSION output_row, int num_rows)\n{\n}\n\nGLOBAL(void)\njsimd_ycc_rgb_convert (j_decompress_ptr cinfo,\n                       JSAMPIMAGE input_buf, JDIMENSION input_row,\n                       JSAMPARRAY output_buf, int num_rows)\n{\n  void (*neonfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);\n\n  switch(cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      if (simd_features & JSIMD_FASTST3)\n        neonfct=jsimd_ycc_extrgb_convert_neon;\n      else\n        neonfct=jsimd_ycc_extrgb_convert_neon_slowst3;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      neonfct=jsimd_ycc_extrgbx_convert_neon;\n      break;\n    case JCS_EXT_BGR:\n      if (simd_features & JSIMD_FASTST3)\n        neonfct=jsimd_ycc_extbgr_convert_neon;\n      else\n        neonfct=jsimd_ycc_extbgr_convert_neon_slowst3;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      neonfct=jsimd_ycc_extbgrx_convert_neon;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      neonfct=jsimd_ycc_extxbgr_convert_neon;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      neonfct=jsimd_ycc_extxrgb_convert_neon;\n      break;\n    default:\n      if (simd_features & JSIMD_FASTST3)\n        neonfct=jsimd_ycc_extrgb_convert_neon;\n      else\n        neonfct=jsimd_ycc_extrgb_convert_neon_slowst3;\n      break;\n  }\n\n  neonfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);\n}\n\nGLOBAL(void)\njsimd_ycc_rgb565_convert (j_decompress_ptr cinfo,\n                          JSAMPIMAGE input_buf, JDIMENSION input_row,\n                          JSAMPARRAY output_buf, int num_rows)\n{\n  jsimd_ycc_rgb565_convert_neon(cinfo->output_width, input_buf, input_row,\n                                output_buf, num_rows);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_downsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_downsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  jsimd_h2v2_downsample_neon(cinfo->image_width, cinfo->max_v_samp_factor,\n                             compptr->v_samp_factor, compptr->width_in_blocks,\n                             input_data, output_data);\n}\n\nGLOBAL(void)\njsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  jsimd_h2v1_downsample_neon(cinfo->image_width, cinfo->max_v_samp_factor,\n                             compptr->v_samp_factor, compptr->width_in_blocks,\n                             input_data, output_data);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info *compptr,\n                     JSAMPARRAY input_data,\n                     JSAMPARRAY *output_data_ptr)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info *compptr,\n                     JSAMPARRAY input_data,\n                     JSAMPARRAY *output_data_ptr)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_fancy_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_fancy_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info *compptr,\n                           JSAMPARRAY input_data,\n                           JSAMPARRAY *output_data_ptr)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info *compptr,\n                           JSAMPARRAY input_data,\n                           JSAMPARRAY *output_data_ptr)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_merged_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_merged_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n}\n\nGLOBAL(int)\njsimd_can_convsamp (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_convsamp_float (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,\n                DCTELEM *workspace)\n{\n  jsimd_convsamp_neon(sample_data, start_col, workspace);\n}\n\nGLOBAL(void)\njsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,\n                      FAST_FLOAT *workspace)\n{\n}\n\nGLOBAL(int)\njsimd_can_fdct_islow (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_float (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_fdct_islow (DCTELEM *data)\n{\n  jsimd_fdct_islow_neon(data);\n}\n\nGLOBAL(void)\njsimd_fdct_ifast (DCTELEM *data)\n{\n  jsimd_fdct_ifast_neon(data);\n}\n\nGLOBAL(void)\njsimd_fdct_float (FAST_FLOAT *data)\n{\n}\n\nGLOBAL(int)\njsimd_can_quantize (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_quantize_float (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors,\n                DCTELEM *workspace)\n{\n  jsimd_quantize_neon(coef_block, divisors, workspace);\n}\n\nGLOBAL(void)\njsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors,\n                      FAST_FLOAT *workspace)\n{\n}\n\nGLOBAL(int)\njsimd_can_idct_2x2 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_4x4 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  jsimd_idct_2x2_neon(compptr->dct_table, coef_block, output_buf,\n                      output_col);\n}\n\nGLOBAL(void)\njsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  jsimd_idct_4x4_neon(compptr->dct_table, coef_block, output_buf,\n                      output_col);\n}\n\nGLOBAL(int)\njsimd_can_idct_islow (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(IFAST_MULT_TYPE) != 2)\n    return 0;\n  if (IFAST_SCALE_BITS != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_float (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n  jsimd_idct_islow_neon(compptr->dct_table, coef_block, output_buf,\n                        output_col);\n}\n\nGLOBAL(void)\njsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n  jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf,\n                        output_col);\n}\n\nGLOBAL(void)\njsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n}\n\nGLOBAL(int)\njsimd_can_huff_encode_one_block (void)\n{\n  init_simd();\n\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON && simd_huffman)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(JOCTET*)\njsimd_huff_encode_one_block (void *state, JOCTET *buffer, JCOEFPTR block,\n                             int last_dc_val, c_derived_tbl *dctbl,\n                             c_derived_tbl *actbl)\n{\n  if (simd_features & JSIMD_FASTTBL)\n    return jsimd_huff_encode_one_block_neon(state, buffer, block, last_dc_val,\n                                            dctbl, actbl);\n  else\n    return jsimd_huff_encode_one_block_neon_slowtbl(state, buffer, block,\n                                                    last_dc_val, dctbl, actbl);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jsimd_arm64_neon.S",
    "content": "/*\n * ARMv8 NEON optimizations for libjpeg-turbo\n *\n * Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies).\n * All Rights Reserved.\n * Author: Siarhei Siamashka <siarhei.siamashka@nokia.com>\n * Copyright (C) 2013-2014, Linaro Limited.  All Rights Reserved.\n * Author: Ragesh Radhakrishnan <ragesh.r@linaro.org>\n * Copyright (C) 2014-2016, D. R. Commander.  All Rights Reserved.\n * Copyright (C) 2015-2016, Matthieu Darbois.  All Rights Reserved.\n * Copyright (C) 2016, Siarhei Siamashka.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack, \"\", %progbits  /* mark stack as non-executable */\n#endif\n\n.text\n\n\n#define RESPECT_STRICT_ALIGNMENT 1\n\n\n/*****************************************************************************/\n\n/* Supplementary macro for setting function attributes */\n.macro asm_function fname\n#ifdef __APPLE__\n    .globl _\\fname\n_\\fname:\n#else\n    .global \\fname\n#ifdef __ELF__\n    .hidden \\fname\n    .type \\fname, %function\n#endif\n\\fname:\n#endif\n.endm\n\n/* Transpose elements of single 128 bit registers */\n.macro transpose_single x0, x1, xi, xilen, literal\n    ins             \\xi\\xilen[0], \\x0\\xilen[0]\n    ins             \\x1\\xilen[0], \\x0\\xilen[1]\n    trn1            \\x0\\literal, \\x0\\literal, \\x1\\literal\n    trn2            \\x1\\literal, \\xi\\literal, \\x1\\literal\n.endm\n\n/* Transpose elements of 2 differnet registers */\n.macro transpose x0, x1, xi, xilen, literal\n    mov             \\xi\\xilen, \\x0\\xilen\n    trn1            \\x0\\literal, \\x0\\literal, \\x1\\literal\n    trn2            \\x1\\literal, \\xi\\literal, \\x1\\literal\n.endm\n\n/* Transpose a block of 4x4 coefficients in four 64-bit registers */\n.macro transpose_4x4_32 x0, x0len, x1, x1len, x2, x2len, x3, x3len, xi, xilen\n    mov             \\xi\\xilen, \\x0\\xilen\n    trn1            \\x0\\x0len, \\x0\\x0len, \\x2\\x2len\n    trn2            \\x2\\x2len, \\xi\\x0len, \\x2\\x2len\n    mov             \\xi\\xilen, \\x1\\xilen\n    trn1            \\x1\\x1len, \\x1\\x1len, \\x3\\x3len\n    trn2            \\x3\\x3len, \\xi\\x1len, \\x3\\x3len\n.endm\n\n.macro transpose_4x4_16 x0, x0len, x1, x1len, x2, x2len, x3, x3len, xi, xilen\n    mov             \\xi\\xilen, \\x0\\xilen\n    trn1            \\x0\\x0len, \\x0\\x0len, \\x1\\x1len\n    trn2            \\x1\\x2len, \\xi\\x0len, \\x1\\x2len\n    mov             \\xi\\xilen, \\x2\\xilen\n    trn1            \\x2\\x2len, \\x2\\x2len, \\x3\\x3len\n    trn2            \\x3\\x2len, \\xi\\x1len, \\x3\\x3len\n.endm\n\n.macro transpose_4x4 x0, x1, x2, x3, x5\n    transpose_4x4_16 \\x0, .4h, \\x1, .4h, \\x2, .4h, \\x3, .4h, \\x5, .16b\n    transpose_4x4_32 \\x0, .2s, \\x1, .2s, \\x2, .2s, \\x3, .2s, \\x5, .16b\n.endm\n\n.macro transpose_8x8 l0, l1, l2, l3, l4, l5, l6, l7, t0, t1, t2, t3\n    trn1            \\t0\\().8h, \\l0\\().8h, \\l1\\().8h\n    trn1            \\t1\\().8h, \\l2\\().8h, \\l3\\().8h\n    trn1            \\t2\\().8h, \\l4\\().8h, \\l5\\().8h\n    trn1            \\t3\\().8h, \\l6\\().8h, \\l7\\().8h\n    trn2            \\l1\\().8h, \\l0\\().8h, \\l1\\().8h\n    trn2            \\l3\\().8h, \\l2\\().8h, \\l3\\().8h\n    trn2            \\l5\\().8h, \\l4\\().8h, \\l5\\().8h\n    trn2            \\l7\\().8h, \\l6\\().8h, \\l7\\().8h\n\n    trn1            \\l4\\().4s, \\t2\\().4s, \\t3\\().4s\n    trn2            \\t3\\().4s, \\t2\\().4s, \\t3\\().4s\n    trn1            \\t2\\().4s, \\t0\\().4s, \\t1\\().4s\n    trn2            \\l2\\().4s, \\t0\\().4s, \\t1\\().4s\n    trn1            \\t0\\().4s, \\l1\\().4s, \\l3\\().4s\n    trn2            \\l3\\().4s, \\l1\\().4s, \\l3\\().4s\n    trn2            \\t1\\().4s, \\l5\\().4s, \\l7\\().4s\n    trn1            \\l5\\().4s, \\l5\\().4s, \\l7\\().4s\n\n    trn2            \\l6\\().2d, \\l2\\().2d, \\t3\\().2d\n    trn1            \\l0\\().2d, \\t2\\().2d, \\l4\\().2d\n    trn1            \\l1\\().2d, \\t0\\().2d, \\l5\\().2d\n    trn2            \\l7\\().2d, \\l3\\().2d, \\t1\\().2d\n    trn1            \\l2\\().2d, \\l2\\().2d, \\t3\\().2d\n    trn2            \\l4\\().2d, \\t2\\().2d, \\l4\\().2d\n    trn1            \\l3\\().2d, \\l3\\().2d, \\t1\\().2d\n    trn2            \\l5\\().2d, \\t0\\().2d, \\l5\\().2d\n.endm\n\n\n#define CENTERJSAMPLE 128\n\n/*****************************************************************************/\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients.\n *\n * GLOBAL(void)\n * jsimd_idct_islow_neon (void *dct_table, JCOEFPTR coef_block,\n *                        JSAMPARRAY output_buf, JDIMENSION output_col)\n */\n\n#define CONST_BITS 13\n#define PASS1_BITS 2\n\n#define F_0_298  2446  /* FIX(0.298631336) */\n#define F_0_390  3196  /* FIX(0.390180644) */\n#define F_0_541  4433  /* FIX(0.541196100) */\n#define F_0_765  6270  /* FIX(0.765366865) */\n#define F_0_899  7373  /* FIX(0.899976223) */\n#define F_1_175  9633  /* FIX(1.175875602) */\n#define F_1_501 12299  /* FIX(1.501321110) */\n#define F_1_847 15137  /* FIX(1.847759065) */\n#define F_1_961 16069  /* FIX(1.961570560) */\n#define F_2_053 16819  /* FIX(2.053119869) */\n#define F_2_562 20995  /* FIX(2.562915447) */\n#define F_3_072 25172  /* FIX(3.072711026) */\n\n.balign 16\nLjsimd_idct_islow_neon_consts:\n  .short F_0_298\n  .short -F_0_390\n  .short F_0_541\n  .short F_0_765\n  .short - F_0_899\n  .short F_1_175\n  .short F_1_501\n  .short - F_1_847\n  .short - F_1_961\n  .short F_2_053\n  .short - F_2_562\n  .short F_3_072\n  .short 0          /* padding */\n  .short 0\n  .short 0\n  .short 0\n\n#undef F_0_298\n#undef F_0_390\n#undef F_0_541\n#undef F_0_765\n#undef F_0_899\n#undef F_1_175\n#undef F_1_501\n#undef F_1_847\n#undef F_1_961\n#undef F_2_053\n#undef F_2_562\n#undef F_3_072\n\n#define XFIX_P_0_298 v0.h[0]\n#define XFIX_N_0_390 v0.h[1]\n#define XFIX_P_0_541 v0.h[2]\n#define XFIX_P_0_765 v0.h[3]\n#define XFIX_N_0_899 v0.h[4]\n#define XFIX_P_1_175 v0.h[5]\n#define XFIX_P_1_501 v0.h[6]\n#define XFIX_N_1_847 v0.h[7]\n#define XFIX_N_1_961 v1.h[0]\n#define XFIX_P_2_053 v1.h[1]\n#define XFIX_N_2_562 v1.h[2]\n#define XFIX_P_3_072 v1.h[3]\n\nasm_function jsimd_idct_islow_neon\n    DCT_TABLE       .req x0\n    COEF_BLOCK      .req x1\n    OUTPUT_BUF      .req x2\n    OUTPUT_COL      .req x3\n    TMP1            .req x0\n    TMP2            .req x1\n    TMP3            .req x9\n    TMP4            .req x10\n    TMP5            .req x11\n    TMP6            .req x12\n    TMP7            .req x13\n    TMP8            .req x14\n\n    sub             sp, sp, #64\n    adr             x15, Ljsimd_idct_islow_neon_consts\n    st1             {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], #32\n    st1             {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], #32\n    ld1             {v0.8h, v1.8h}, [x15]\n    ld1             {v2.8h, v3.8h, v4.8h, v5.8h}, [COEF_BLOCK], #64\n    ld1             {v18.8h, v19.8h, v20.8h, v21.8h}, [DCT_TABLE], #64\n    ld1             {v6.8h, v7.8h, v8.8h, v9.8h}, [COEF_BLOCK], #64\n    ld1             {v22.8h, v23.8h, v24.8h, v25.8h}, [DCT_TABLE], #64\n\n    cmeq            v16.8h, v3.8h, #0\n    cmeq            v26.8h, v4.8h, #0\n    cmeq            v27.8h, v5.8h, #0\n    cmeq            v28.8h, v6.8h, #0\n    cmeq            v29.8h, v7.8h, #0\n    cmeq            v30.8h, v8.8h, #0\n    cmeq            v31.8h, v9.8h, #0\n\n    and             v10.16b, v16.16b, v26.16b\n    and             v11.16b, v27.16b, v28.16b\n    and             v12.16b, v29.16b, v30.16b\n    and             v13.16b, v31.16b, v10.16b\n    and             v14.16b, v11.16b, v12.16b\n    mul             v2.8h, v2.8h, v18.8h\n    and             v15.16b, v13.16b, v14.16b\n    shl             v10.8h, v2.8h, #(PASS1_BITS)\n    sqxtn           v16.8b, v15.8h\n    mov             TMP1, v16.d[0]\n    sub             sp, sp, #64\n    mvn             TMP2, TMP1\n\n    cbnz            TMP2, 2f\n    /* case all AC coeffs are zeros */\n    dup             v2.2d, v10.d[0]\n    dup             v6.2d, v10.d[1]\n    mov             v3.16b, v2.16b\n    mov             v7.16b, v6.16b\n    mov             v4.16b, v2.16b\n    mov             v8.16b, v6.16b\n    mov             v5.16b, v2.16b\n    mov             v9.16b, v6.16b\n1:\n    /* for this transpose, we should organise data like this:\n     * 00, 01, 02, 03, 40, 41, 42, 43\n     * 10, 11, 12, 13, 50, 51, 52, 53\n     * 20, 21, 22, 23, 60, 61, 62, 63\n     * 30, 31, 32, 33, 70, 71, 72, 73\n     * 04, 05, 06, 07, 44, 45, 46, 47\n     * 14, 15, 16, 17, 54, 55, 56, 57\n     * 24, 25, 26, 27, 64, 65, 66, 67\n     * 34, 35, 36, 37, 74, 75, 76, 77\n     */\n    trn1            v28.8h, v2.8h, v3.8h\n    trn1            v29.8h, v4.8h, v5.8h\n    trn1            v30.8h, v6.8h, v7.8h\n    trn1            v31.8h, v8.8h, v9.8h\n    trn2            v16.8h, v2.8h, v3.8h\n    trn2            v17.8h, v4.8h, v5.8h\n    trn2            v18.8h, v6.8h, v7.8h\n    trn2            v19.8h, v8.8h, v9.8h\n    trn1            v2.4s, v28.4s, v29.4s\n    trn1            v6.4s, v30.4s, v31.4s\n    trn1            v3.4s, v16.4s, v17.4s\n    trn1            v7.4s, v18.4s, v19.4s\n    trn2            v4.4s, v28.4s, v29.4s\n    trn2            v8.4s, v30.4s, v31.4s\n    trn2            v5.4s, v16.4s, v17.4s\n    trn2            v9.4s, v18.4s, v19.4s\n    /* Even part: reverse the even part of the forward DCT. */\n    add             v18.8h, v4.8h, v8.8h           /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */\n    add             v22.8h, v2.8h, v6.8h           /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */\n    smull2          v19.4s, v18.8h, XFIX_P_0_541   /* z1h z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */\n    sub             v26.8h, v2.8h, v6.8h           /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */\n    smull           v18.4s, v18.4h, XFIX_P_0_541   /* z1l z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */\n    sshll2          v23.4s, v22.8h, #(CONST_BITS)  /* tmp0h tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */\n    mov             v21.16b, v19.16b               /* tmp3 = z1 */\n    mov             v20.16b, v18.16b               /* tmp3 = z1 */\n    smlal2          v19.4s, v8.8h, XFIX_N_1_847    /* tmp2h tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */\n    smlal           v18.4s, v8.4h, XFIX_N_1_847    /* tmp2l tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */\n    sshll2          v27.4s, v26.8h, #(CONST_BITS)  /* tmp1h tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */\n    smlal2          v21.4s, v4.8h, XFIX_P_0_765    /* tmp3h tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */\n    smlal           v20.4s, v4.4h, XFIX_P_0_765    /* tmp3l tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */\n    sshll           v22.4s, v22.4h, #(CONST_BITS)  /* tmp0l tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */\n    sshll           v26.4s, v26.4h, #(CONST_BITS)  /* tmp1l tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */\n    add             v2.4s, v22.4s, v20.4s          /* tmp10l tmp10 = tmp0 + tmp3; */\n    sub             v6.4s, v22.4s, v20.4s          /* tmp13l tmp13 = tmp0 - tmp3; */\n    add             v8.4s, v26.4s, v18.4s          /* tmp11l tmp11 = tmp1 + tmp2; */\n    sub             v4.4s, v26.4s, v18.4s          /* tmp12l tmp12 = tmp1 - tmp2; */\n    add             v28.4s, v23.4s, v21.4s         /* tmp10h tmp10 = tmp0 + tmp3; */\n    sub             v31.4s, v23.4s, v21.4s         /* tmp13h tmp13 = tmp0 - tmp3; */\n    add             v29.4s, v27.4s, v19.4s         /* tmp11h tmp11 = tmp1 + tmp2; */\n    sub             v30.4s, v27.4s, v19.4s         /* tmp12h tmp12 = tmp1 - tmp2; */\n\n    /* Odd part per figure 8; the matrix is unitary and hence its\n     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.\n     */\n\n    add             v22.8h, v9.8h, v5.8h    /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */\n    add             v24.8h, v7.8h, v3.8h    /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */\n    add             v18.8h, v9.8h, v3.8h    /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */\n    add             v20.8h, v7.8h, v5.8h    /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */\n    add             v26.8h, v22.8h, v24.8h  /* z5 = z3 + z4 */\n\n    smull2          v11.4s, v9.8h, XFIX_P_0_298   /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */\n    smull2          v13.4s, v7.8h, XFIX_P_2_053   /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */\n    smull2          v15.4s, v5.8h, XFIX_P_3_072   /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */\n    smull2          v17.4s, v3.8h, XFIX_P_1_501   /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */\n    smull2          v27.4s, v26.8h, XFIX_P_1_175  /* z5h z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */\n    smull2          v23.4s, v22.8h, XFIX_N_1_961  /* z3 = MULTIPLY(z3, - FIX_1_961570560) */\n    smull2          v25.4s, v24.8h, XFIX_N_0_390  /* z4 = MULTIPLY(z4, - FIX_0_390180644) */\n    smull2          v19.4s, v18.8h, XFIX_N_0_899  /* z1 = MULTIPLY(z1, - FIX_0_899976223) */\n    smull2          v21.4s, v20.8h, XFIX_N_2_562  /* z2 = MULTIPLY(z2, - FIX_2_562915447) */\n\n    smull           v10.4s, v9.4h, XFIX_P_0_298   /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */\n    smull           v12.4s, v7.4h, XFIX_P_2_053   /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */\n    smull           v14.4s, v5.4h, XFIX_P_3_072   /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */\n    smull           v16.4s, v3.4h, XFIX_P_1_501   /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */\n    smull           v26.4s, v26.4h, XFIX_P_1_175  /* z5l z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */\n    smull           v22.4s, v22.4h, XFIX_N_1_961  /* z3 = MULTIPLY(z3, - FIX_1_961570560) */\n    smull           v24.4s, v24.4h, XFIX_N_0_390  /* z4 = MULTIPLY(z4, - FIX_0_390180644) */\n    smull           v18.4s, v18.4h, XFIX_N_0_899  /* z1 = MULTIPLY(z1, - FIX_0_899976223) */\n    smull           v20.4s, v20.4h, XFIX_N_2_562  /* z2 = MULTIPLY(z2, - FIX_2_562915447) */\n\n    add             v23.4s, v23.4s, v27.4s  /* z3 += z5 */\n    add             v22.4s, v22.4s, v26.4s  /* z3 += z5 */\n    add             v25.4s, v25.4s, v27.4s  /* z4 += z5 */\n    add             v24.4s, v24.4s, v26.4s  /* z4 += z5 */\n\n    add             v11.4s, v11.4s, v19.4s  /* tmp0 += z1 */\n    add             v10.4s, v10.4s, v18.4s  /* tmp0 += z1 */\n    add             v13.4s, v13.4s, v21.4s  /* tmp1 += z2 */\n    add             v12.4s, v12.4s, v20.4s  /* tmp1 += z2 */\n    add             v15.4s, v15.4s, v21.4s  /* tmp2 += z2 */\n    add             v14.4s, v14.4s, v20.4s  /* tmp2 += z2 */\n    add             v17.4s, v17.4s, v19.4s  /* tmp3 += z1 */\n    add             v16.4s, v16.4s, v18.4s  /* tmp3 += z1 */\n\n    add             v11.4s, v11.4s, v23.4s  /* tmp0 += z3 */\n    add             v10.4s, v10.4s, v22.4s  /* tmp0 += z3 */\n    add             v13.4s, v13.4s, v25.4s  /* tmp1 += z4 */\n    add             v12.4s, v12.4s, v24.4s  /* tmp1 += z4 */\n    add             v17.4s, v17.4s, v25.4s  /* tmp3 += z4 */\n    add             v16.4s, v16.4s, v24.4s  /* tmp3 += z4 */\n    add             v15.4s, v15.4s, v23.4s  /* tmp2 += z3 */\n    add             v14.4s, v14.4s, v22.4s  /* tmp2 += z3 */\n\n    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */\n\n    add             v18.4s, v2.4s, v16.4s   /* tmp10 + tmp3 */\n    add             v19.4s, v28.4s, v17.4s  /* tmp10 + tmp3 */\n    sub             v20.4s, v2.4s, v16.4s   /* tmp10 - tmp3 */\n    sub             v21.4s, v28.4s, v17.4s  /* tmp10 - tmp3 */\n    add             v22.4s, v8.4s, v14.4s   /* tmp11 + tmp2 */\n    add             v23.4s, v29.4s, v15.4s  /* tmp11 + tmp2 */\n    sub             v24.4s, v8.4s, v14.4s   /* tmp11 - tmp2 */\n    sub             v25.4s, v29.4s, v15.4s  /* tmp11 - tmp2 */\n    add             v26.4s, v4.4s, v12.4s   /* tmp12 + tmp1 */\n    add             v27.4s, v30.4s, v13.4s  /* tmp12 + tmp1 */\n    sub             v28.4s, v4.4s, v12.4s   /* tmp12 - tmp1 */\n    sub             v29.4s, v30.4s, v13.4s  /* tmp12 - tmp1 */\n    add             v14.4s, v6.4s, v10.4s   /* tmp13 + tmp0 */\n    add             v15.4s, v31.4s, v11.4s  /* tmp13 + tmp0 */\n    sub             v16.4s, v6.4s, v10.4s   /* tmp13 - tmp0 */\n    sub             v17.4s, v31.4s, v11.4s  /* tmp13 - tmp0 */\n\n    shrn            v2.4h, v18.4s, #16  /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3) */\n    shrn            v9.4h, v20.4s, #16  /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3) */\n    shrn            v3.4h, v22.4s, #16  /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3) */\n    shrn            v8.4h, v24.4s, #16  /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3) */\n    shrn            v4.4h, v26.4s, #16  /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3) */\n    shrn            v7.4h, v28.4s, #16  /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3) */\n    shrn            v5.4h, v14.4s, #16  /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3) */\n    shrn            v6.4h, v16.4s, #16  /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3) */\n    shrn2           v2.8h, v19.4s, #16  /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3) */\n    shrn2           v9.8h, v21.4s, #16  /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3) */\n    shrn2           v3.8h, v23.4s, #16  /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3) */\n    shrn2           v8.8h, v25.4s, #16  /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3) */\n    shrn2           v4.8h, v27.4s, #16  /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3) */\n    shrn2           v7.8h, v29.4s, #16  /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3) */\n    shrn2           v5.8h, v15.4s, #16  /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3) */\n    shrn2           v6.8h, v17.4s, #16  /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3) */\n    movi            v0.16b, #(CENTERJSAMPLE)\n    /* Prepare pointers (dual-issue with NEON instructions) */\n      ldp             TMP1, TMP2, [OUTPUT_BUF], 16\n    sqrshrn         v28.8b, v2.8h, #(CONST_BITS+PASS1_BITS+3-16)\n      ldp             TMP3, TMP4, [OUTPUT_BUF], 16\n    sqrshrn         v29.8b, v3.8h, #(CONST_BITS+PASS1_BITS+3-16)\n      add             TMP1, TMP1, OUTPUT_COL\n    sqrshrn         v30.8b, v4.8h, #(CONST_BITS+PASS1_BITS+3-16)\n      add             TMP2, TMP2, OUTPUT_COL\n    sqrshrn         v31.8b, v5.8h, #(CONST_BITS+PASS1_BITS+3-16)\n      add             TMP3, TMP3, OUTPUT_COL\n    sqrshrn2        v28.16b, v6.8h, #(CONST_BITS+PASS1_BITS+3-16)\n      add             TMP4, TMP4, OUTPUT_COL\n    sqrshrn2        v29.16b, v7.8h, #(CONST_BITS+PASS1_BITS+3-16)\n      ldp             TMP5, TMP6, [OUTPUT_BUF], 16\n    sqrshrn2        v30.16b, v8.8h, #(CONST_BITS+PASS1_BITS+3-16)\n      ldp             TMP7, TMP8, [OUTPUT_BUF], 16\n    sqrshrn2        v31.16b, v9.8h, #(CONST_BITS+PASS1_BITS+3-16)\n      add             TMP5, TMP5, OUTPUT_COL\n    add             v16.16b, v28.16b, v0.16b\n      add             TMP6, TMP6, OUTPUT_COL\n    add             v18.16b, v29.16b, v0.16b\n      add             TMP7, TMP7, OUTPUT_COL\n    add             v20.16b, v30.16b, v0.16b\n      add             TMP8, TMP8, OUTPUT_COL\n    add             v22.16b, v31.16b, v0.16b\n\n    /* Transpose the final 8-bit samples */\n    trn1            v28.16b, v16.16b, v18.16b\n    trn1            v30.16b, v20.16b, v22.16b\n    trn2            v29.16b, v16.16b, v18.16b\n    trn2            v31.16b, v20.16b, v22.16b\n\n    trn1            v16.8h, v28.8h, v30.8h\n    trn2            v18.8h, v28.8h, v30.8h\n    trn1            v20.8h, v29.8h, v31.8h\n    trn2            v22.8h, v29.8h, v31.8h\n\n    uzp1            v28.4s, v16.4s, v18.4s\n    uzp2            v30.4s, v16.4s, v18.4s\n    uzp1            v29.4s, v20.4s, v22.4s\n    uzp2            v31.4s, v20.4s, v22.4s\n\n    /* Store results to the output buffer */\n    st1             {v28.d}[0], [TMP1]\n    st1             {v29.d}[0], [TMP2]\n    st1             {v28.d}[1], [TMP3]\n    st1             {v29.d}[1], [TMP4]\n    st1             {v30.d}[0], [TMP5]\n    st1             {v31.d}[0], [TMP6]\n    st1             {v30.d}[1], [TMP7]\n    st1             {v31.d}[1], [TMP8]\n    ld1             {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], #32\n    ld1             {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], #32\n    blr             x30\n\n.balign 16\n2:\n    mul             v3.8h, v3.8h, v19.8h\n    mul             v4.8h, v4.8h, v20.8h\n    mul             v5.8h, v5.8h, v21.8h\n    add             TMP4, xzr, TMP2, LSL #32\n    mul             v6.8h, v6.8h, v22.8h\n    mul             v7.8h, v7.8h, v23.8h\n    adds            TMP3, xzr, TMP2, LSR #32\n    mul             v8.8h, v8.8h, v24.8h\n    mul             v9.8h, v9.8h, v25.8h\n    b.ne            3f\n    /* Right AC coef is zero */\n    dup             v15.2d, v10.d[1]\n    /* Even part: reverse the even part of the forward DCT. */\n    add             v18.4h, v4.4h, v8.4h           /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */\n    add             v22.4h, v2.4h, v6.4h           /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */\n    sub             v26.4h, v2.4h, v6.4h           /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */\n    smull           v18.4s, v18.4h, XFIX_P_0_541   /* z1l z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */\n    sshll           v22.4s, v22.4h, #(CONST_BITS)  /* tmp0l tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */\n    mov             v20.16b, v18.16b               /* tmp3 = z1 */\n    sshll           v26.4s, v26.4h, #(CONST_BITS)  /* tmp1l tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */\n    smlal           v18.4s, v8.4h, XFIX_N_1_847    /* tmp2l tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */\n    smlal           v20.4s, v4.4h, XFIX_P_0_765    /* tmp3l tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */\n    add             v2.4s, v22.4s, v20.4s          /* tmp10l tmp10 = tmp0 + tmp3; */\n    sub             v6.4s, v22.4s, v20.4s          /* tmp13l tmp13 = tmp0 - tmp3; */\n    add             v8.4s, v26.4s, v18.4s          /* tmp11l tmp11 = tmp1 + tmp2; */\n    sub             v4.4s, v26.4s, v18.4s          /* tmp12l tmp12 = tmp1 - tmp2; */\n\n    /* Odd part per figure 8; the matrix is unitary and hence its\n     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.\n     */\n\n    add             v22.4h, v9.4h, v5.4h    /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */\n    add             v24.4h, v7.4h, v3.4h    /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */\n    add             v18.4h, v9.4h, v3.4h    /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */\n    add             v20.4h, v7.4h, v5.4h    /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */\n    add             v26.4h, v22.4h, v24.4h  /* z5 = z3 + z4 */\n\n    smull           v10.4s, v9.4h, XFIX_P_0_298   /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */\n    smull           v12.4s, v7.4h, XFIX_P_2_053   /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */\n    smull           v14.4s, v5.4h, XFIX_P_3_072   /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */\n    smull           v16.4s, v3.4h, XFIX_P_1_501   /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */\n    smull           v26.4s, v26.4h, XFIX_P_1_175  /* z5l z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */\n    smull           v22.4s, v22.4h, XFIX_N_1_961  /* z3 = MULTIPLY(z3, - FIX_1_961570560) */\n    smull           v24.4s, v24.4h, XFIX_N_0_390  /* z4 = MULTIPLY(z4, - FIX_0_390180644) */\n    smull           v18.4s, v18.4h, XFIX_N_0_899  /* z1 = MULTIPLY(z1, - FIX_0_899976223) */\n    smull           v20.4s, v20.4h, XFIX_N_2_562  /* z2 = MULTIPLY(z2, - FIX_2_562915447) */\n\n    add             v22.4s, v22.4s, v26.4s  /* z3 += z5 */\n    add             v24.4s, v24.4s, v26.4s  /* z4 += z5 */\n\n    add             v10.4s, v10.4s, v18.4s  /* tmp0 += z1 */\n    add             v12.4s, v12.4s, v20.4s  /* tmp1 += z2 */\n    add             v14.4s, v14.4s, v20.4s  /* tmp2 += z2 */\n    add             v16.4s, v16.4s, v18.4s  /* tmp3 += z1 */\n\n    add             v10.4s, v10.4s, v22.4s  /* tmp0 += z3 */\n    add             v12.4s, v12.4s, v24.4s  /* tmp1 += z4 */\n    add             v16.4s, v16.4s, v24.4s  /* tmp3 += z4 */\n    add             v14.4s, v14.4s, v22.4s  /* tmp2 += z3 */\n\n    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */\n\n    add             v18.4s, v2.4s, v16.4s  /* tmp10 + tmp3 */\n    sub             v20.4s, v2.4s, v16.4s  /* tmp10 - tmp3 */\n    add             v22.4s, v8.4s, v14.4s  /* tmp11 + tmp2 */\n    sub             v24.4s, v8.4s, v14.4s  /* tmp11 - tmp2 */\n    add             v26.4s, v4.4s, v12.4s  /* tmp12 + tmp1 */\n    sub             v28.4s, v4.4s, v12.4s  /* tmp12 - tmp1 */\n    add             v14.4s, v6.4s, v10.4s  /* tmp13 + tmp0 */\n    sub             v16.4s, v6.4s, v10.4s  /* tmp13 - tmp0 */\n\n    rshrn           v2.4h, v18.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */\n    rshrn           v3.4h, v22.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */\n    rshrn           v4.4h, v26.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */\n    rshrn           v5.4h, v14.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */\n    rshrn2          v2.8h, v16.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */\n    rshrn2          v3.8h, v28.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */\n    rshrn2          v4.8h, v24.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */\n    rshrn2          v5.8h, v20.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */\n    mov             v6.16b, v15.16b\n    mov             v7.16b, v15.16b\n    mov             v8.16b, v15.16b\n    mov             v9.16b, v15.16b\n    b               1b\n\n.balign 16\n3:\n    cbnz            TMP4, 4f\n    /* Left AC coef is zero */\n    dup             v14.2d, v10.d[0]\n    /* Even part: reverse the even part of the forward DCT. */\n    add             v18.8h, v4.8h, v8.8h           /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */\n    add             v22.8h, v2.8h, v6.8h           /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */\n    smull2          v19.4s, v18.8h, XFIX_P_0_541   /* z1h z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */\n    sub             v26.8h, v2.8h, v6.8h           /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */\n    sshll2          v23.4s, v22.8h, #(CONST_BITS)  /* tmp0h tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */\n    mov             v21.16b, v19.16b               /* tmp3 = z1 */\n    smlal2          v19.4s, v8.8h, XFIX_N_1_847    /* tmp2h tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */\n    sshll2          v27.4s, v26.8h, #(CONST_BITS)  /* tmp1h tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */\n    smlal2          v21.4s, v4.8h, XFIX_P_0_765    /* tmp3h tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */\n    add             v28.4s, v23.4s, v21.4s         /* tmp10h tmp10 = tmp0 + tmp3; */\n    sub             v31.4s, v23.4s, v21.4s         /* tmp13h tmp13 = tmp0 - tmp3; */\n    add             v29.4s, v27.4s, v19.4s         /* tmp11h tmp11 = tmp1 + tmp2; */\n    sub             v30.4s, v27.4s, v19.4s         /* tmp12h tmp12 = tmp1 - tmp2; */\n\n    /* Odd part per figure 8; the matrix is unitary and hence its\n     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.\n     */\n\n    add             v22.8h, v9.8h, v5.8h    /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */\n    add             v24.8h, v7.8h, v3.8h    /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */\n    add             v18.8h, v9.8h, v3.8h    /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */\n    add             v20.8h, v7.8h, v5.8h    /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */\n    add             v26.8h, v22.8h, v24.8h  /* z5 = z3 + z4 */\n\n    smull2          v11.4s, v9.8h, XFIX_P_0_298   /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */\n    smull2          v13.4s, v7.8h, XFIX_P_2_053   /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */\n    smull2          v15.4s, v5.8h, XFIX_P_3_072   /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */\n    smull2          v17.4s, v3.8h, XFIX_P_1_501   /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */\n    smull2          v27.4s, v26.8h, XFIX_P_1_175  /* z5h z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */\n    smull2          v23.4s, v22.8h, XFIX_N_1_961  /* z3 = MULTIPLY(z3, - FIX_1_961570560) */\n    smull2          v25.4s, v24.8h, XFIX_N_0_390  /* z4 = MULTIPLY(z4, - FIX_0_390180644) */\n    smull2          v19.4s, v18.8h, XFIX_N_0_899  /* z1 = MULTIPLY(z1, - FIX_0_899976223) */\n    smull2          v21.4s, v20.8h, XFIX_N_2_562  /* z2 = MULTIPLY(z2, - FIX_2_562915447) */\n\n    add             v23.4s, v23.4s, v27.4s  /* z3 += z5 */\n    add             v22.4s, v22.4s, v26.4s  /* z3 += z5 */\n    add             v25.4s, v25.4s, v27.4s  /* z4 += z5 */\n    add             v24.4s, v24.4s, v26.4s  /* z4 += z5 */\n\n    add             v11.4s, v11.4s, v19.4s  /* tmp0 += z1 */\n    add             v13.4s, v13.4s, v21.4s  /* tmp1 += z2 */\n    add             v15.4s, v15.4s, v21.4s  /* tmp2 += z2 */\n    add             v17.4s, v17.4s, v19.4s  /* tmp3 += z1 */\n\n    add             v11.4s, v11.4s, v23.4s  /* tmp0 += z3 */\n    add             v13.4s, v13.4s, v25.4s  /* tmp1 += z4 */\n    add             v17.4s, v17.4s, v25.4s  /* tmp3 += z4 */\n    add             v15.4s, v15.4s, v23.4s  /* tmp2 += z3 */\n\n    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */\n\n    add             v19.4s, v28.4s, v17.4s  /* tmp10 + tmp3 */\n    sub             v21.4s, v28.4s, v17.4s  /* tmp10 - tmp3 */\n    add             v23.4s, v29.4s, v15.4s  /* tmp11 + tmp2 */\n    sub             v25.4s, v29.4s, v15.4s  /* tmp11 - tmp2 */\n    add             v27.4s, v30.4s, v13.4s  /* tmp12 + tmp1 */\n    sub             v29.4s, v30.4s, v13.4s  /* tmp12 - tmp1 */\n    add             v15.4s, v31.4s, v11.4s  /* tmp13 + tmp0 */\n    sub             v17.4s, v31.4s, v11.4s  /* tmp13 - tmp0 */\n\n    mov             v2.16b, v14.16b\n    mov             v3.16b, v14.16b\n    mov             v4.16b, v14.16b\n    mov             v5.16b, v14.16b\n    rshrn           v6.4h, v19.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */\n    rshrn           v7.4h, v23.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */\n    rshrn           v8.4h, v27.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */\n    rshrn           v9.4h, v15.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */\n    rshrn2          v6.8h, v17.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */\n    rshrn2          v7.8h, v29.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */\n    rshrn2          v8.8h, v25.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */\n    rshrn2          v9.8h, v21.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */\n    b               1b\n\n.balign 16\n4:\n    /* \"No\" AC coef is zero */\n    /* Even part: reverse the even part of the forward DCT. */\n    add             v18.8h, v4.8h, v8.8h           /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]) + DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]) */\n    add             v22.8h, v2.8h, v6.8h           /* z2 + z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) + DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */\n    smull2          v19.4s, v18.8h, XFIX_P_0_541   /* z1h z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */\n    sub             v26.8h, v2.8h, v6.8h           /* z2 - z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) - DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]) */\n    smull           v18.4s, v18.4h, XFIX_P_0_541   /* z1l z1 = MULTIPLY(z2 + z3, FIX_0_541196100); */\n    sshll2          v23.4s, v22.8h, #(CONST_BITS)  /* tmp0h tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */\n    mov             v21.16b, v19.16b               /* tmp3 = z1 */\n    mov             v20.16b, v18.16b               /* tmp3 = z1 */\n    smlal2          v19.4s, v8.8h, XFIX_N_1_847    /* tmp2h tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */\n    smlal           v18.4s, v8.4h, XFIX_N_1_847    /* tmp2l tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065); */\n    sshll2          v27.4s, v26.8h, #(CONST_BITS)  /* tmp1h tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */\n    smlal2          v21.4s, v4.8h, XFIX_P_0_765    /* tmp3h tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */\n    smlal           v20.4s, v4.4h, XFIX_P_0_765    /* tmp3l tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865); */\n    sshll           v22.4s, v22.4h, #(CONST_BITS)  /* tmp0l tmp0 = LEFT_SHIFT(z2 + z3, CONST_BITS); */\n    sshll           v26.4s, v26.4h, #(CONST_BITS)  /* tmp1l tmp1 = LEFT_SHIFT(z2 - z3, CONST_BITS); */\n    add             v2.4s, v22.4s, v20.4s          /* tmp10l tmp10 = tmp0 + tmp3; */\n    sub             v6.4s, v22.4s, v20.4s          /* tmp13l tmp13 = tmp0 - tmp3; */\n    add             v8.4s, v26.4s, v18.4s          /* tmp11l tmp11 = tmp1 + tmp2; */\n    sub             v4.4s, v26.4s, v18.4s          /* tmp12l tmp12 = tmp1 - tmp2; */\n    add             v28.4s, v23.4s, v21.4s         /* tmp10h tmp10 = tmp0 + tmp3; */\n    sub             v31.4s, v23.4s, v21.4s         /* tmp13h tmp13 = tmp0 - tmp3; */\n    add             v29.4s, v27.4s, v19.4s         /* tmp11h tmp11 = tmp1 + tmp2; */\n    sub             v30.4s, v27.4s, v19.4s         /* tmp12h tmp12 = tmp1 - tmp2; */\n\n    /* Odd part per figure 8; the matrix is unitary and hence its\n     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.\n     */\n\n    add             v22.8h, v9.8h, v5.8h    /* z3 = tmp0 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */\n    add             v24.8h, v7.8h, v3.8h    /* z4 = tmp1 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */\n    add             v18.8h, v9.8h, v3.8h    /* z1 = tmp0 + tmp3 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]) + DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]) */\n    add             v20.8h, v7.8h, v5.8h    /* z2 = tmp1 + tmp2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]) + DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]) */\n    add             v26.8h, v22.8h, v24.8h  /* z5 = z3 + z4 */\n\n    smull2          v11.4s, v9.8h, XFIX_P_0_298   /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */\n    smull2          v13.4s, v7.8h, XFIX_P_2_053   /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */\n    smull2          v15.4s, v5.8h, XFIX_P_3_072   /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */\n    smull2          v17.4s, v3.8h, XFIX_P_1_501   /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */\n    smull2          v27.4s, v26.8h, XFIX_P_1_175  /* z5h z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */\n    smull2          v23.4s, v22.8h, XFIX_N_1_961  /* z3 = MULTIPLY(z3, - FIX_1_961570560) */\n    smull2          v25.4s, v24.8h, XFIX_N_0_390  /* z4 = MULTIPLY(z4, - FIX_0_390180644) */\n    smull2          v19.4s, v18.8h, XFIX_N_0_899  /* z1 = MULTIPLY(z1, - FIX_0_899976223) */\n    smull2          v21.4s, v20.8h, XFIX_N_2_562  /* z2 = MULTIPLY(z2, - FIX_2_562915447) */\n\n    smull           v10.4s, v9.4h, XFIX_P_0_298   /* tmp0 = MULTIPLY(tmp0, FIX_0_298631336) */\n    smull           v12.4s, v7.4h, XFIX_P_2_053   /* tmp1 = MULTIPLY(tmp1, FIX_2_053119869) */\n    smull           v14.4s, v5.4h, XFIX_P_3_072   /* tmp2 = MULTIPLY(tmp2, FIX_3_072711026) */\n    smull           v16.4s, v3.4h, XFIX_P_1_501   /* tmp3 = MULTIPLY(tmp3, FIX_1_501321110) */\n    smull           v26.4s, v26.4h, XFIX_P_1_175  /* z5l z5 = MULTIPLY(z3 + z4, FIX_1_175875602) */\n    smull           v22.4s, v22.4h, XFIX_N_1_961  /* z3 = MULTIPLY(z3, - FIX_1_961570560) */\n    smull           v24.4s, v24.4h, XFIX_N_0_390  /* z4 = MULTIPLY(z4, - FIX_0_390180644) */\n    smull           v18.4s, v18.4h, XFIX_N_0_899  /* z1 = MULTIPLY(z1, - FIX_0_899976223) */\n    smull           v20.4s, v20.4h, XFIX_N_2_562  /* z2 = MULTIPLY(z2, - FIX_2_562915447) */\n\n    add             v23.4s, v23.4s, v27.4s  /* z3 += z5 */\n    add             v22.4s, v22.4s, v26.4s  /* z3 += z5 */\n    add             v25.4s, v25.4s, v27.4s  /* z4 += z5 */\n    add             v24.4s, v24.4s, v26.4s  /* z4 += z5 */\n\n    add             v11.4s, v11.4s, v19.4s  /* tmp0 += z1 */\n    add             v10.4s, v10.4s, v18.4s  /* tmp0 += z1 */\n    add             v13.4s, v13.4s, v21.4s  /* tmp1 += z2 */\n    add             v12.4s, v12.4s, v20.4s  /* tmp1 += z2 */\n    add             v15.4s, v15.4s, v21.4s  /* tmp2 += z2 */\n    add             v14.4s, v14.4s, v20.4s  /* tmp2 += z2 */\n    add             v17.4s, v17.4s, v19.4s  /* tmp3 += z1 */\n    add             v16.4s, v16.4s, v18.4s  /* tmp3 += z1 */\n\n    add             v11.4s, v11.4s, v23.4s  /* tmp0 += z3 */\n    add             v10.4s, v10.4s, v22.4s  /* tmp0 += z3 */\n    add             v13.4s, v13.4s, v25.4s  /* tmp1 += z4 */\n    add             v12.4s, v12.4s, v24.4s  /* tmp1 += z4 */\n    add             v17.4s, v17.4s, v25.4s  /* tmp3 += z4 */\n    add             v16.4s, v16.4s, v24.4s  /* tmp3 += z4 */\n    add             v15.4s, v15.4s, v23.4s  /* tmp2 += z3 */\n    add             v14.4s, v14.4s, v22.4s  /* tmp2 += z3 */\n\n    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */\n\n    add             v18.4s, v2.4s, v16.4s   /* tmp10 + tmp3 */\n    add             v19.4s, v28.4s, v17.4s  /* tmp10 + tmp3 */\n    sub             v20.4s, v2.4s, v16.4s   /* tmp10 - tmp3 */\n    sub             v21.4s, v28.4s, v17.4s  /* tmp10 - tmp3 */\n    add             v22.4s, v8.4s, v14.4s   /* tmp11 + tmp2 */\n    add             v23.4s, v29.4s, v15.4s  /* tmp11 + tmp2 */\n    sub             v24.4s, v8.4s, v14.4s   /* tmp11 - tmp2 */\n    sub             v25.4s, v29.4s, v15.4s  /* tmp11 - tmp2 */\n    add             v26.4s, v4.4s, v12.4s   /* tmp12 + tmp1 */\n    add             v27.4s, v30.4s, v13.4s  /* tmp12 + tmp1 */\n    sub             v28.4s, v4.4s, v12.4s   /* tmp12 - tmp1 */\n    sub             v29.4s, v30.4s, v13.4s  /* tmp12 - tmp1 */\n    add             v14.4s, v6.4s, v10.4s   /* tmp13 + tmp0 */\n    add             v15.4s, v31.4s, v11.4s  /* tmp13 + tmp0 */\n    sub             v16.4s, v6.4s, v10.4s   /* tmp13 - tmp0 */\n    sub             v17.4s, v31.4s, v11.4s  /* tmp13 - tmp0 */\n\n    rshrn           v2.4h, v18.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */\n    rshrn           v3.4h, v22.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */\n    rshrn           v4.4h, v26.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */\n    rshrn           v5.4h, v14.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */\n    rshrn           v6.4h, v19.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS) */\n    rshrn           v7.4h, v23.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS) */\n    rshrn           v8.4h, v27.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS) */\n    rshrn           v9.4h, v15.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS) */\n    rshrn2          v2.8h, v16.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */\n    rshrn2          v3.8h, v28.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */\n    rshrn2          v4.8h, v24.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */\n    rshrn2          v5.8h, v20.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */\n    rshrn2          v6.8h, v17.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS) */\n    rshrn2          v7.8h, v29.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS) */\n    rshrn2          v8.8h, v25.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS) */\n    rshrn2          v9.8h, v21.4s, #(CONST_BITS-PASS1_BITS)  /* wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS) */\n    b               1b\n\n    .unreq          DCT_TABLE\n    .unreq          COEF_BLOCK\n    .unreq          OUTPUT_BUF\n    .unreq          OUTPUT_COL\n    .unreq          TMP1\n    .unreq          TMP2\n    .unreq          TMP3\n    .unreq          TMP4\n    .unreq          TMP5\n    .unreq          TMP6\n    .unreq          TMP7\n    .unreq          TMP8\n\n#undef CENTERJSAMPLE\n#undef CONST_BITS\n#undef PASS1_BITS\n#undef XFIX_P_0_298\n#undef XFIX_N_0_390\n#undef XFIX_P_0_541\n#undef XFIX_P_0_765\n#undef XFIX_N_0_899\n#undef XFIX_P_1_175\n#undef XFIX_P_1_501\n#undef XFIX_N_1_847\n#undef XFIX_N_1_961\n#undef XFIX_P_2_053\n#undef XFIX_N_2_562\n#undef XFIX_P_3_072\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_idct_ifast_neon\n *\n * This function contains a fast, not so accurate integer implementation of\n * the inverse DCT (Discrete Cosine Transform). It uses the same calculations\n * and produces exactly the same output as IJG's original 'jpeg_idct_ifast'\n * function from jidctfst.c\n *\n * Normally 1-D AAN DCT needs 5 multiplications and 29 additions.\n * But in ARM NEON case some extra additions are required because VQDMULH\n * instruction can't handle the constants larger than 1. So the expressions\n * like \"x * 1.082392200\" have to be converted to \"x * 0.082392200 + x\",\n * which introduces an extra addition. Overall, there are 6 extra additions\n * per 1-D IDCT pass, totalling to 5 VQDMULH and 35 VADD/VSUB instructions.\n */\n\n#define XFIX_1_082392200 v0.h[0]\n#define XFIX_1_414213562 v0.h[1]\n#define XFIX_1_847759065 v0.h[2]\n#define XFIX_2_613125930 v0.h[3]\n\n.balign 16\nLjsimd_idct_ifast_neon_consts:\n  .short (277 * 128 - 256 * 128)  /* XFIX_1_082392200 */\n  .short (362 * 128 - 256 * 128)  /* XFIX_1_414213562 */\n  .short (473 * 128 - 256 * 128)  /* XFIX_1_847759065 */\n  .short (669 * 128 - 512 * 128)  /* XFIX_2_613125930 */\n\nasm_function jsimd_idct_ifast_neon\n\n    DCT_TABLE       .req x0\n    COEF_BLOCK      .req x1\n    OUTPUT_BUF      .req x2\n    OUTPUT_COL      .req x3\n    TMP1            .req x0\n    TMP2            .req x1\n    TMP3            .req x9\n    TMP4            .req x10\n    TMP5            .req x11\n    TMP6            .req x12\n    TMP7            .req x13\n    TMP8            .req x14\n\n    /* Load and dequantize coefficients into NEON registers\n     * with the following allocation:\n     *       0 1 2 3 | 4 5 6 7\n     *      ---------+--------\n     *   0 | d16     | d17     ( v16.8h )\n     *   1 | d18     | d19     ( v17.8h )\n     *   2 | d20     | d21     ( v18.8h )\n     *   3 | d22     | d23     ( v19.8h )\n     *   4 | d24     | d25     ( v20.8h )\n     *   5 | d26     | d27     ( v21.8h )\n     *   6 | d28     | d29     ( v22.8h )\n     *   7 | d30     | d31     ( v23.8h )\n     */\n    /* Save NEON registers used in fast IDCT */\n    adr             TMP5, Ljsimd_idct_ifast_neon_consts\n    ld1             {v16.8h, v17.8h}, [COEF_BLOCK], 32\n    ld1             {v0.8h, v1.8h}, [DCT_TABLE], 32\n    ld1             {v18.8h, v19.8h}, [COEF_BLOCK], 32\n    mul             v16.8h, v16.8h, v0.8h\n    ld1             {v2.8h, v3.8h}, [DCT_TABLE], 32\n    mul             v17.8h, v17.8h, v1.8h\n    ld1             {v20.8h, v21.8h}, [COEF_BLOCK], 32\n    mul             v18.8h, v18.8h, v2.8h\n    ld1             {v0.8h, v1.8h}, [DCT_TABLE], 32\n    mul             v19.8h, v19.8h, v3.8h\n    ld1             {v22.8h, v23.8h}, [COEF_BLOCK], 32\n    mul             v20.8h, v20.8h, v0.8h\n    ld1             {v2.8h, v3.8h}, [DCT_TABLE], 32\n    mul             v22.8h, v22.8h, v2.8h\n    mul             v21.8h, v21.8h, v1.8h\n    ld1             {v0.4h}, [TMP5]        /* load constants */\n    mul             v23.8h, v23.8h, v3.8h\n\n    /* 1-D IDCT, pass 1 */\n    sub             v2.8h, v18.8h, v22.8h\n    add             v22.8h, v18.8h, v22.8h\n    sub             v1.8h, v19.8h, v21.8h\n    add             v21.8h, v19.8h, v21.8h\n    sub             v5.8h, v17.8h, v23.8h\n    add             v23.8h, v17.8h, v23.8h\n    sqdmulh         v4.8h, v2.8h, XFIX_1_414213562\n    sqdmulh         v6.8h, v1.8h, XFIX_2_613125930\n    add             v3.8h, v1.8h, v1.8h\n    sub             v1.8h, v5.8h, v1.8h\n    add             v18.8h, v2.8h, v4.8h\n    sqdmulh         v4.8h, v1.8h, XFIX_1_847759065\n    sub             v2.8h, v23.8h, v21.8h\n    add             v3.8h, v3.8h, v6.8h\n    sqdmulh         v6.8h, v2.8h, XFIX_1_414213562\n    add             v1.8h, v1.8h, v4.8h\n    sqdmulh         v4.8h, v5.8h, XFIX_1_082392200\n    sub             v18.8h, v18.8h, v22.8h\n    add             v2.8h, v2.8h, v6.8h\n    sub             v6.8h, v16.8h, v20.8h\n    add             v20.8h, v16.8h, v20.8h\n    add             v17.8h, v5.8h, v4.8h\n    add             v5.8h, v6.8h, v18.8h\n    sub             v18.8h, v6.8h, v18.8h\n    add             v6.8h, v23.8h, v21.8h\n    add             v16.8h, v20.8h, v22.8h\n    sub             v3.8h, v6.8h, v3.8h\n    sub             v20.8h, v20.8h, v22.8h\n    sub             v3.8h, v3.8h, v1.8h\n    sub             v1.8h, v17.8h, v1.8h\n    add             v2.8h, v3.8h, v2.8h\n    sub             v23.8h, v16.8h, v6.8h\n    add             v1.8h, v1.8h, v2.8h\n    add             v16.8h, v16.8h, v6.8h\n    add             v22.8h, v5.8h, v3.8h\n    sub             v17.8h, v5.8h, v3.8h\n    sub             v21.8h, v18.8h, v2.8h\n    add             v18.8h, v18.8h, v2.8h\n    sub             v19.8h, v20.8h, v1.8h\n    add             v20.8h, v20.8h, v1.8h\n    transpose_8x8   v16, v17, v18, v19, v20, v21, v22, v23, v28, v29, v30, v31\n    /* 1-D IDCT, pass 2 */\n    sub             v2.8h, v18.8h, v22.8h\n    add             v22.8h, v18.8h, v22.8h\n    sub             v1.8h, v19.8h, v21.8h\n    add             v21.8h, v19.8h, v21.8h\n    sub             v5.8h, v17.8h, v23.8h\n    add             v23.8h, v17.8h, v23.8h\n    sqdmulh         v4.8h, v2.8h, XFIX_1_414213562\n    sqdmulh         v6.8h, v1.8h, XFIX_2_613125930\n    add             v3.8h, v1.8h, v1.8h\n    sub             v1.8h, v5.8h, v1.8h\n    add             v18.8h, v2.8h, v4.8h\n    sqdmulh         v4.8h, v1.8h, XFIX_1_847759065\n    sub             v2.8h, v23.8h, v21.8h\n    add             v3.8h, v3.8h, v6.8h\n    sqdmulh         v6.8h, v2.8h, XFIX_1_414213562\n    add             v1.8h, v1.8h, v4.8h\n    sqdmulh         v4.8h, v5.8h, XFIX_1_082392200\n    sub             v18.8h, v18.8h, v22.8h\n    add             v2.8h, v2.8h, v6.8h\n    sub             v6.8h, v16.8h, v20.8h\n    add             v20.8h, v16.8h, v20.8h\n    add             v17.8h, v5.8h, v4.8h\n    add             v5.8h, v6.8h, v18.8h\n    sub             v18.8h, v6.8h, v18.8h\n    add             v6.8h, v23.8h, v21.8h\n    add             v16.8h, v20.8h, v22.8h\n    sub             v3.8h, v6.8h, v3.8h\n    sub             v20.8h, v20.8h, v22.8h\n    sub             v3.8h, v3.8h, v1.8h\n    sub             v1.8h, v17.8h, v1.8h\n    add             v2.8h, v3.8h, v2.8h\n    sub             v23.8h, v16.8h, v6.8h\n    add             v1.8h, v1.8h, v2.8h\n    add             v16.8h, v16.8h, v6.8h\n    add             v22.8h, v5.8h, v3.8h\n    sub             v17.8h, v5.8h, v3.8h\n    sub             v21.8h, v18.8h, v2.8h\n    add             v18.8h, v18.8h, v2.8h\n    sub             v19.8h, v20.8h, v1.8h\n    add             v20.8h, v20.8h, v1.8h\n    /* Descale to 8-bit and range limit */\n    movi            v0.16b, #0x80\n      /* Prepare pointers (dual-issue with NEON instructions) */\n      ldp             TMP1, TMP2, [OUTPUT_BUF], 16\n    sqshrn          v28.8b, v16.8h, #5\n      ldp             TMP3, TMP4, [OUTPUT_BUF], 16\n    sqshrn          v29.8b, v17.8h, #5\n      add             TMP1, TMP1, OUTPUT_COL\n    sqshrn          v30.8b, v18.8h, #5\n      add             TMP2, TMP2, OUTPUT_COL\n    sqshrn          v31.8b, v19.8h, #5\n      add             TMP3, TMP3, OUTPUT_COL\n    sqshrn2         v28.16b, v20.8h, #5\n      add             TMP4, TMP4, OUTPUT_COL\n    sqshrn2         v29.16b, v21.8h, #5\n      ldp             TMP5, TMP6, [OUTPUT_BUF], 16\n    sqshrn2         v30.16b, v22.8h, #5\n      ldp             TMP7, TMP8, [OUTPUT_BUF], 16\n    sqshrn2         v31.16b, v23.8h, #5\n      add             TMP5, TMP5, OUTPUT_COL\n    add             v16.16b, v28.16b, v0.16b\n      add             TMP6, TMP6, OUTPUT_COL\n    add             v18.16b, v29.16b, v0.16b\n      add             TMP7, TMP7, OUTPUT_COL\n    add             v20.16b, v30.16b, v0.16b\n      add             TMP8, TMP8, OUTPUT_COL\n    add             v22.16b, v31.16b, v0.16b\n\n    /* Transpose the final 8-bit samples */\n    trn1            v28.16b, v16.16b, v18.16b\n    trn1            v30.16b, v20.16b, v22.16b\n    trn2            v29.16b, v16.16b, v18.16b\n    trn2            v31.16b, v20.16b, v22.16b\n\n    trn1            v16.8h, v28.8h, v30.8h\n    trn2            v18.8h, v28.8h, v30.8h\n    trn1            v20.8h, v29.8h, v31.8h\n    trn2            v22.8h, v29.8h, v31.8h\n\n    uzp1            v28.4s, v16.4s, v18.4s\n    uzp2            v30.4s, v16.4s, v18.4s\n    uzp1            v29.4s, v20.4s, v22.4s\n    uzp2            v31.4s, v20.4s, v22.4s\n\n    /* Store results to the output buffer */\n    st1             {v28.d}[0], [TMP1]\n    st1             {v29.d}[0], [TMP2]\n    st1             {v28.d}[1], [TMP3]\n    st1             {v29.d}[1], [TMP4]\n    st1             {v30.d}[0], [TMP5]\n    st1             {v31.d}[0], [TMP6]\n    st1             {v30.d}[1], [TMP7]\n    st1             {v31.d}[1], [TMP8]\n    blr             x30\n\n    .unreq          DCT_TABLE\n    .unreq          COEF_BLOCK\n    .unreq          OUTPUT_BUF\n    .unreq          OUTPUT_COL\n    .unreq          TMP1\n    .unreq          TMP2\n    .unreq          TMP3\n    .unreq          TMP4\n    .unreq          TMP5\n    .unreq          TMP6\n    .unreq          TMP7\n    .unreq          TMP8\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_idct_4x4_neon\n *\n * This function contains inverse-DCT code for getting reduced-size\n * 4x4 pixels output from an 8x8 DCT block. It uses the same  calculations\n * and produces exactly the same output as IJG's original 'jpeg_idct_4x4'\n * function from jpeg-6b (jidctred.c).\n *\n * NOTE: jpeg-8 has an improved implementation of 4x4 inverse-DCT, which\n *       requires much less arithmetic operations and hence should be faster.\n *       The primary purpose of this particular NEON optimized function is\n *       bit exact compatibility with jpeg-6b.\n *\n * TODO: a bit better instructions scheduling can be achieved by expanding\n *       idct_helper/transpose_4x4 macros and reordering instructions,\n *       but readability will suffer somewhat.\n */\n\n#define CONST_BITS  13\n\n#define FIX_0_211164243 (1730)   /* FIX(0.211164243) */\n#define FIX_0_509795579 (4176)   /* FIX(0.509795579) */\n#define FIX_0_601344887 (4926)   /* FIX(0.601344887) */\n#define FIX_0_720959822 (5906)   /* FIX(0.720959822) */\n#define FIX_0_765366865 (6270)   /* FIX(0.765366865) */\n#define FIX_0_850430095 (6967)   /* FIX(0.850430095) */\n#define FIX_0_899976223 (7373)   /* FIX(0.899976223) */\n#define FIX_1_061594337 (8697)   /* FIX(1.061594337) */\n#define FIX_1_272758580 (10426)  /* FIX(1.272758580) */\n#define FIX_1_451774981 (11893)  /* FIX(1.451774981) */\n#define FIX_1_847759065 (15137)  /* FIX(1.847759065) */\n#define FIX_2_172734803 (17799)  /* FIX(2.172734803) */\n#define FIX_2_562915447 (20995)  /* FIX(2.562915447) */\n#define FIX_3_624509785 (29692)  /* FIX(3.624509785) */\n\n.balign 16\nLjsimd_idct_4x4_neon_consts:\n  .short FIX_1_847759065      /* v0.h[0] */\n  .short -FIX_0_765366865     /* v0.h[1] */\n  .short -FIX_0_211164243     /* v0.h[2] */\n  .short FIX_1_451774981      /* v0.h[3] */\n  .short -FIX_2_172734803     /* d1[0] */\n  .short FIX_1_061594337      /* d1[1] */\n  .short -FIX_0_509795579     /* d1[2] */\n  .short -FIX_0_601344887     /* d1[3] */\n  .short FIX_0_899976223      /* v2.h[0] */\n  .short FIX_2_562915447      /* v2.h[1] */\n  .short 1 << (CONST_BITS+1)  /* v2.h[2] */\n  .short 0                    /* v2.h[3] */\n\n.macro idct_helper x4, x6, x8, x10, x12, x14, x16, shift, y26, y27, y28, y29\n    smull           v28.4s, \\x4, v2.h[2]\n    smlal           v28.4s, \\x8, v0.h[0]\n    smlal           v28.4s, \\x14, v0.h[1]\n\n    smull           v26.4s, \\x16, v1.h[2]\n    smlal           v26.4s, \\x12, v1.h[3]\n    smlal           v26.4s, \\x10, v2.h[0]\n    smlal           v26.4s, \\x6, v2.h[1]\n\n    smull           v30.4s, \\x4, v2.h[2]\n    smlsl           v30.4s, \\x8, v0.h[0]\n    smlsl           v30.4s, \\x14, v0.h[1]\n\n    smull           v24.4s, \\x16, v0.h[2]\n    smlal           v24.4s, \\x12, v0.h[3]\n    smlal           v24.4s, \\x10, v1.h[0]\n    smlal           v24.4s, \\x6, v1.h[1]\n\n    add             v20.4s, v28.4s, v26.4s\n    sub             v28.4s, v28.4s, v26.4s\n\n  .if \\shift > 16\n    srshr           v20.4s, v20.4s, #\\shift\n    srshr           v28.4s, v28.4s, #\\shift\n    xtn             \\y26, v20.4s\n    xtn             \\y29, v28.4s\n  .else\n    rshrn           \\y26, v20.4s, #\\shift\n    rshrn           \\y29, v28.4s, #\\shift\n  .endif\n\n    add             v20.4s, v30.4s, v24.4s\n    sub             v30.4s, v30.4s, v24.4s\n\n  .if \\shift > 16\n    srshr           v20.4s, v20.4s, #\\shift\n    srshr           v30.4s, v30.4s, #\\shift\n    xtn             \\y27, v20.4s\n    xtn             \\y28, v30.4s\n  .else\n    rshrn           \\y27, v20.4s, #\\shift\n    rshrn           \\y28, v30.4s, #\\shift\n  .endif\n.endm\n\nasm_function jsimd_idct_4x4_neon\n\n    DCT_TABLE       .req x0\n    COEF_BLOCK      .req x1\n    OUTPUT_BUF      .req x2\n    OUTPUT_COL      .req x3\n    TMP1            .req x0\n    TMP2            .req x1\n    TMP3            .req x2\n    TMP4            .req x15\n\n    /* Save all used NEON registers */\n    sub             sp, sp, 272\n    str             x15, [sp], 16\n    /* Load constants (v3.4h is just used for padding) */\n    adr             TMP4, Ljsimd_idct_4x4_neon_consts\n    st1             {v0.8b, v1.8b, v2.8b, v3.8b}, [sp], 32\n    st1             {v4.8b, v5.8b, v6.8b, v7.8b}, [sp], 32\n    st1             {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32\n    st1             {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32\n    st1             {v16.8b, v17.8b, v18.8b, v19.8b}, [sp], 32\n    st1             {v20.8b, v21.8b, v22.8b, v23.8b}, [sp], 32\n    st1             {v24.8b, v25.8b, v26.8b, v27.8b}, [sp], 32\n    st1             {v28.8b, v29.8b, v30.8b, v31.8b}, [sp], 32\n    ld1             {v0.4h, v1.4h, v2.4h, v3.4h}, [TMP4]\n\n    /* Load all COEF_BLOCK into NEON registers with the following allocation:\n     *       0 1 2 3 | 4 5 6 7\n     *      ---------+--------\n     *   0 | v4.4h   | v5.4h\n     *   1 | v6.4h   | v7.4h\n     *   2 | v8.4h   | v9.4h\n     *   3 | v10.4h  | v11.4h\n     *   4 | -       | -\n     *   5 | v12.4h  | v13.4h\n     *   6 | v14.4h  | v15.4h\n     *   7 | v16.4h  | v17.4h\n     */\n    ld1             {v4.4h, v5.4h, v6.4h, v7.4h}, [COEF_BLOCK], 32\n    ld1             {v8.4h, v9.4h, v10.4h, v11.4h}, [COEF_BLOCK], 32\n    add             COEF_BLOCK, COEF_BLOCK, #16\n    ld1             {v12.4h, v13.4h, v14.4h, v15.4h}, [COEF_BLOCK], 32\n    ld1             {v16.4h, v17.4h}, [COEF_BLOCK], 16\n    /* dequantize */\n    ld1             {v18.4h, v19.4h, v20.4h, v21.4h}, [DCT_TABLE], 32\n    mul             v4.4h, v4.4h, v18.4h\n    mul             v5.4h, v5.4h, v19.4h\n    ins             v4.d[1], v5.d[0]              /* 128 bit q4 */\n    ld1             {v22.4h, v23.4h, v24.4h, v25.4h}, [DCT_TABLE], 32\n    mul             v6.4h, v6.4h, v20.4h\n    mul             v7.4h, v7.4h, v21.4h\n    ins             v6.d[1], v7.d[0]              /* 128 bit q6 */\n    mul             v8.4h, v8.4h, v22.4h\n    mul             v9.4h, v9.4h, v23.4h\n    ins             v8.d[1], v9.d[0]              /* 128 bit q8 */\n    add             DCT_TABLE, DCT_TABLE, #16\n    ld1             {v26.4h, v27.4h, v28.4h, v29.4h}, [DCT_TABLE], 32\n    mul             v10.4h, v10.4h, v24.4h\n    mul             v11.4h, v11.4h, v25.4h\n    ins             v10.d[1], v11.d[0]            /* 128 bit q10 */\n    mul             v12.4h, v12.4h, v26.4h\n    mul             v13.4h, v13.4h, v27.4h\n    ins             v12.d[1], v13.d[0]            /* 128 bit q12 */\n    ld1             {v30.4h, v31.4h}, [DCT_TABLE], 16\n    mul             v14.4h, v14.4h, v28.4h\n    mul             v15.4h, v15.4h, v29.4h\n    ins             v14.d[1], v15.d[0]            /* 128 bit q14 */\n    mul             v16.4h, v16.4h, v30.4h\n    mul             v17.4h, v17.4h, v31.4h\n    ins             v16.d[1], v17.d[0]            /* 128 bit q16 */\n\n    /* Pass 1 */\n    idct_helper     v4.4h, v6.4h, v8.4h, v10.4h, v12.4h, v14.4h, v16.4h, 12, \\\n                    v4.4h, v6.4h, v8.4h, v10.4h\n    transpose_4x4   v4, v6, v8, v10, v3\n    ins             v10.d[1], v11.d[0]\n    idct_helper     v5.4h, v7.4h, v9.4h, v11.4h, v13.4h, v15.4h, v17.4h, 12, \\\n                    v5.4h, v7.4h, v9.4h, v11.4h\n    transpose_4x4   v5, v7, v9, v11, v3\n    ins             v10.d[1], v11.d[0]\n\n    /* Pass 2 */\n    idct_helper     v4.4h, v6.4h, v8.4h, v10.4h, v7.4h, v9.4h, v11.4h, 19, \\\n                    v26.4h, v27.4h, v28.4h, v29.4h\n    transpose_4x4   v26, v27, v28, v29, v3\n\n    /* Range limit */\n    movi            v30.8h, #0x80\n    ins             v26.d[1], v27.d[0]\n    ins             v28.d[1], v29.d[0]\n    add             v26.8h, v26.8h, v30.8h\n    add             v28.8h, v28.8h, v30.8h\n    sqxtun          v26.8b, v26.8h\n    sqxtun          v27.8b, v28.8h\n\n    /* Store results to the output buffer */\n    ldp             TMP1, TMP2, [OUTPUT_BUF], 16\n    ldp             TMP3, TMP4, [OUTPUT_BUF]\n    add             TMP1, TMP1, OUTPUT_COL\n    add             TMP2, TMP2, OUTPUT_COL\n    add             TMP3, TMP3, OUTPUT_COL\n    add             TMP4, TMP4, OUTPUT_COL\n\n#if defined(__ARMEL__) && !RESPECT_STRICT_ALIGNMENT\n    /* We can use much less instructions on little endian systems if the\n     * OS kernel is not configured to trap unaligned memory accesses\n     */\n    st1             {v26.s}[0], [TMP1], 4\n    st1             {v27.s}[0], [TMP3], 4\n    st1             {v26.s}[1], [TMP2], 4\n    st1             {v27.s}[1], [TMP4], 4\n#else\n    st1             {v26.b}[0], [TMP1], 1\n    st1             {v27.b}[0], [TMP3], 1\n    st1             {v26.b}[1], [TMP1], 1\n    st1             {v27.b}[1], [TMP3], 1\n    st1             {v26.b}[2], [TMP1], 1\n    st1             {v27.b}[2], [TMP3], 1\n    st1             {v26.b}[3], [TMP1], 1\n    st1             {v27.b}[3], [TMP3], 1\n\n    st1             {v26.b}[4], [TMP2], 1\n    st1             {v27.b}[4], [TMP4], 1\n    st1             {v26.b}[5], [TMP2], 1\n    st1             {v27.b}[5], [TMP4], 1\n    st1             {v26.b}[6], [TMP2], 1\n    st1             {v27.b}[6], [TMP4], 1\n    st1             {v26.b}[7], [TMP2], 1\n    st1             {v27.b}[7], [TMP4], 1\n#endif\n\n    /* vpop            {v8.4h - v15.4h}    ;not available */\n    sub             sp, sp, #272\n    ldr             x15, [sp], 16\n    ld1             {v0.8b, v1.8b, v2.8b, v3.8b}, [sp], 32\n    ld1             {v4.8b, v5.8b, v6.8b, v7.8b}, [sp], 32\n    ld1             {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32\n    ld1             {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32\n    ld1             {v16.8b, v17.8b, v18.8b, v19.8b}, [sp], 32\n    ld1             {v20.8b, v21.8b, v22.8b, v23.8b}, [sp], 32\n    ld1             {v24.8b, v25.8b, v26.8b, v27.8b}, [sp], 32\n    ld1             {v28.8b, v29.8b, v30.8b, v31.8b}, [sp], 32\n    blr             x30\n\n    .unreq          DCT_TABLE\n    .unreq          COEF_BLOCK\n    .unreq          OUTPUT_BUF\n    .unreq          OUTPUT_COL\n    .unreq          TMP1\n    .unreq          TMP2\n    .unreq          TMP3\n    .unreq          TMP4\n\n.purgem idct_helper\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_idct_2x2_neon\n *\n * This function contains inverse-DCT code for getting reduced-size\n * 2x2 pixels output from an 8x8 DCT block. It uses the same  calculations\n * and produces exactly the same output as IJG's original 'jpeg_idct_2x2'\n * function from jpeg-6b (jidctred.c).\n *\n * NOTE: jpeg-8 has an improved implementation of 2x2 inverse-DCT, which\n *       requires much less arithmetic operations and hence should be faster.\n *       The primary purpose of this particular NEON optimized function is\n *       bit exact compatibility with jpeg-6b.\n */\n\n.balign 8\nLjsimd_idct_2x2_neon_consts:\n  .short -FIX_0_720959822  /* v14[0] */\n  .short FIX_0_850430095   /* v14[1] */\n  .short -FIX_1_272758580  /* v14[2] */\n  .short FIX_3_624509785   /* v14[3] */\n\n.macro idct_helper x4, x6, x10, x12, x16, shift, y26, y27\n    sshll           v15.4s, \\x4, #15\n    smull           v26.4s, \\x6, v14.h[3]\n    smlal           v26.4s, \\x10, v14.h[2]\n    smlal           v26.4s, \\x12, v14.h[1]\n    smlal           v26.4s, \\x16, v14.h[0]\n\n    add             v20.4s, v15.4s, v26.4s\n    sub             v15.4s, v15.4s, v26.4s\n\n  .if \\shift > 16\n    srshr           v20.4s, v20.4s, #\\shift\n    srshr           v15.4s, v15.4s, #\\shift\n    xtn             \\y26, v20.4s\n    xtn             \\y27, v15.4s\n  .else\n    rshrn           \\y26, v20.4s, #\\shift\n    rshrn           \\y27, v15.4s, #\\shift\n  .endif\n.endm\n\nasm_function jsimd_idct_2x2_neon\n\n    DCT_TABLE       .req x0\n    COEF_BLOCK      .req x1\n    OUTPUT_BUF      .req x2\n    OUTPUT_COL      .req x3\n    TMP1            .req x0\n    TMP2            .req x15\n\n    /* vpush           {v8.4h - v15.4h}            ; not available */\n    sub             sp, sp, 208\n    str             x15, [sp], 16\n\n    /* Load constants */\n    adr             TMP2, Ljsimd_idct_2x2_neon_consts\n    st1             {v4.8b, v5.8b, v6.8b, v7.8b}, [sp], 32\n    st1             {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32\n    st1             {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32\n    st1             {v16.8b, v17.8b, v18.8b, v19.8b}, [sp], 32\n    st1             {v21.8b, v22.8b}, [sp], 16\n    st1             {v24.8b, v25.8b, v26.8b, v27.8b}, [sp], 32\n    st1             {v30.8b, v31.8b}, [sp], 16\n    ld1             {v14.4h}, [TMP2]\n\n    /* Load all COEF_BLOCK into NEON registers with the following allocation:\n     *       0 1 2 3 | 4 5 6 7\n     *      ---------+--------\n     *   0 | v4.4h   | v5.4h\n     *   1 | v6.4h   | v7.4h\n     *   2 | -       | -\n     *   3 | v10.4h  | v11.4h\n     *   4 | -       | -\n     *   5 | v12.4h  | v13.4h\n     *   6 | -       | -\n     *   7 | v16.4h  | v17.4h\n     */\n    ld1             {v4.4h, v5.4h, v6.4h, v7.4h}, [COEF_BLOCK], 32\n    add             COEF_BLOCK, COEF_BLOCK, #16\n    ld1             {v10.4h, v11.4h}, [COEF_BLOCK], 16\n    add             COEF_BLOCK, COEF_BLOCK, #16\n    ld1             {v12.4h, v13.4h}, [COEF_BLOCK], 16\n    add             COEF_BLOCK, COEF_BLOCK, #16\n    ld1             {v16.4h, v17.4h}, [COEF_BLOCK], 16\n    /* Dequantize */\n    ld1             {v18.4h, v19.4h, v20.4h, v21.4h}, [DCT_TABLE], 32\n    mul             v4.4h, v4.4h, v18.4h\n    mul             v5.4h, v5.4h, v19.4h\n    ins             v4.d[1], v5.d[0]\n    mul             v6.4h, v6.4h, v20.4h\n    mul             v7.4h, v7.4h, v21.4h\n    ins             v6.d[1], v7.d[0]\n    add             DCT_TABLE, DCT_TABLE, #16\n    ld1             {v24.4h, v25.4h}, [DCT_TABLE], 16\n    mul             v10.4h, v10.4h, v24.4h\n    mul             v11.4h, v11.4h, v25.4h\n    ins             v10.d[1], v11.d[0]\n    add             DCT_TABLE, DCT_TABLE, #16\n    ld1             {v26.4h, v27.4h}, [DCT_TABLE], 16\n    mul             v12.4h, v12.4h, v26.4h\n    mul             v13.4h, v13.4h, v27.4h\n    ins             v12.d[1], v13.d[0]\n    add             DCT_TABLE, DCT_TABLE, #16\n    ld1             {v30.4h, v31.4h}, [DCT_TABLE], 16\n    mul             v16.4h, v16.4h, v30.4h\n    mul             v17.4h, v17.4h, v31.4h\n    ins             v16.d[1], v17.d[0]\n\n    /* Pass 1 */\n#if 0\n    idct_helper     v4.4h, v6.4h, v10.4h, v12.4h, v16.4h, 13, v4.4h, v6.4h\n    transpose_4x4   v4.4h, v6.4h, v8.4h, v10.4h\n    idct_helper     v5.4h, v7.4h, v11.4h, v13.4h, v17.4h, 13, v5.4h, v7.4h\n    transpose_4x4   v5.4h, v7.4h, v9.4h, v11.4h\n#else\n    smull           v26.4s, v6.4h, v14.h[3]\n    smlal           v26.4s, v10.4h, v14.h[2]\n    smlal           v26.4s, v12.4h, v14.h[1]\n    smlal           v26.4s, v16.4h, v14.h[0]\n    smull           v24.4s, v7.4h, v14.h[3]\n    smlal           v24.4s, v11.4h, v14.h[2]\n    smlal           v24.4s, v13.4h, v14.h[1]\n    smlal           v24.4s, v17.4h, v14.h[0]\n    sshll           v15.4s, v4.4h, #15\n    sshll           v30.4s, v5.4h, #15\n    add             v20.4s, v15.4s, v26.4s\n    sub             v15.4s, v15.4s, v26.4s\n    rshrn           v4.4h, v20.4s, #13\n    rshrn           v6.4h, v15.4s, #13\n    add             v20.4s, v30.4s, v24.4s\n    sub             v15.4s, v30.4s, v24.4s\n    rshrn           v5.4h, v20.4s, #13\n    rshrn           v7.4h, v15.4s, #13\n    ins             v4.d[1], v5.d[0]\n    ins             v6.d[1], v7.d[0]\n    transpose       v4, v6, v3, .16b, .8h\n    transpose       v6, v10, v3, .16b, .4s\n    ins             v11.d[0], v10.d[1]\n    ins             v7.d[0], v6.d[1]\n#endif\n\n    /* Pass 2 */\n    idct_helper     v4.4h, v6.4h, v10.4h, v7.4h, v11.4h, 20, v26.4h, v27.4h\n\n    /* Range limit */\n    movi            v30.8h, #0x80\n    ins             v26.d[1], v27.d[0]\n    add             v26.8h, v26.8h, v30.8h\n    sqxtun          v30.8b, v26.8h\n    ins             v26.d[0], v30.d[0]\n    sqxtun          v27.8b, v26.8h\n\n    /* Store results to the output buffer */\n    ldp             TMP1, TMP2, [OUTPUT_BUF]\n    add             TMP1, TMP1, OUTPUT_COL\n    add             TMP2, TMP2, OUTPUT_COL\n\n    st1             {v26.b}[0], [TMP1], 1\n    st1             {v27.b}[4], [TMP1], 1\n    st1             {v26.b}[1], [TMP2], 1\n    st1             {v27.b}[5], [TMP2], 1\n\n    sub             sp, sp, #208\n    ldr             x15, [sp], 16\n    ld1             {v4.8b, v5.8b, v6.8b, v7.8b}, [sp], 32\n    ld1             {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32\n    ld1             {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32\n    ld1             {v16.8b, v17.8b, v18.8b, v19.8b}, [sp], 32\n    ld1             {v21.8b, v22.8b}, [sp], 16\n    ld1             {v24.8b, v25.8b, v26.8b, v27.8b}, [sp], 32\n    ld1             {v30.8b, v31.8b}, [sp], 16\n    blr             x30\n\n    .unreq          DCT_TABLE\n    .unreq          COEF_BLOCK\n    .unreq          OUTPUT_BUF\n    .unreq          OUTPUT_COL\n    .unreq          TMP1\n    .unreq          TMP2\n\n.purgem idct_helper\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_ycc_extrgb_convert_neon\n * jsimd_ycc_extbgr_convert_neon\n * jsimd_ycc_extrgbx_convert_neon\n * jsimd_ycc_extbgrx_convert_neon\n * jsimd_ycc_extxbgr_convert_neon\n * jsimd_ycc_extxrgb_convert_neon\n *\n * Colorspace conversion YCbCr -> RGB\n */\n\n.macro do_load size\n  .if \\size == 8\n    ld1             {v4.8b}, [U], 8\n    ld1             {v5.8b}, [V], 8\n    ld1             {v0.8b}, [Y], 8\n    prfm            pldl1keep, [U, #64]\n    prfm            pldl1keep, [V, #64]\n    prfm            pldl1keep, [Y, #64]\n  .elseif \\size == 4\n    ld1             {v4.b}[0], [U], 1\n    ld1             {v4.b}[1], [U], 1\n    ld1             {v4.b}[2], [U], 1\n    ld1             {v4.b}[3], [U], 1\n    ld1             {v5.b}[0], [V], 1\n    ld1             {v5.b}[1], [V], 1\n    ld1             {v5.b}[2], [V], 1\n    ld1             {v5.b}[3], [V], 1\n    ld1             {v0.b}[0], [Y], 1\n    ld1             {v0.b}[1], [Y], 1\n    ld1             {v0.b}[2], [Y], 1\n    ld1             {v0.b}[3], [Y], 1\n  .elseif \\size == 2\n    ld1             {v4.b}[4], [U], 1\n    ld1             {v4.b}[5], [U], 1\n    ld1             {v5.b}[4], [V], 1\n    ld1             {v5.b}[5], [V], 1\n    ld1             {v0.b}[4], [Y], 1\n    ld1             {v0.b}[5], [Y], 1\n  .elseif \\size == 1\n    ld1             {v4.b}[6], [U], 1\n    ld1             {v5.b}[6], [V], 1\n    ld1             {v0.b}[6], [Y], 1\n  .else\n    .error unsupported macroblock size\n  .endif\n.endm\n\n.macro do_store bpp, size, fast_st3\n  .if \\bpp == 24\n    .if \\size == 8\n      .if \\fast_st3 == 1\n        st3         {v10.8b, v11.8b, v12.8b}, [RGB], 24\n      .else\n        st1         {v10.b}[0], [RGB], #1\n        st1         {v11.b}[0], [RGB], #1\n        st1         {v12.b}[0], [RGB], #1\n\n        st1         {v10.b}[1], [RGB], #1\n        st1         {v11.b}[1], [RGB], #1\n        st1         {v12.b}[1], [RGB], #1\n\n        st1         {v10.b}[2], [RGB], #1\n        st1         {v11.b}[2], [RGB], #1\n        st1         {v12.b}[2], [RGB], #1\n\n        st1         {v10.b}[3], [RGB], #1\n        st1         {v11.b}[3], [RGB], #1\n        st1         {v12.b}[3], [RGB], #1\n\n        st1         {v10.b}[4], [RGB], #1\n        st1         {v11.b}[4], [RGB], #1\n        st1         {v12.b}[4], [RGB], #1\n\n        st1         {v10.b}[5], [RGB], #1\n        st1         {v11.b}[5], [RGB], #1\n        st1         {v12.b}[5], [RGB], #1\n\n        st1         {v10.b}[6], [RGB], #1\n        st1         {v11.b}[6], [RGB], #1\n        st1         {v12.b}[6], [RGB], #1\n\n        st1         {v10.b}[7], [RGB], #1\n        st1         {v11.b}[7], [RGB], #1\n        st1         {v12.b}[7], [RGB], #1\n      .endif\n    .elseif \\size == 4\n      st3           {v10.b, v11.b, v12.b}[0], [RGB], 3\n      st3           {v10.b, v11.b, v12.b}[1], [RGB], 3\n      st3           {v10.b, v11.b, v12.b}[2], [RGB], 3\n      st3           {v10.b, v11.b, v12.b}[3], [RGB], 3\n    .elseif \\size == 2\n      st3           {v10.b, v11.b, v12.b}[4], [RGB], 3\n      st3           {v10.b, v11.b, v12.b}[5], [RGB], 3\n    .elseif \\size == 1\n      st3           {v10.b, v11.b, v12.b}[6], [RGB], 3\n    .else\n     .error unsupported macroblock size\n    .endif\n  .elseif \\bpp == 32\n    .if \\size == 8\n      st4           {v10.8b, v11.8b, v12.8b, v13.8b}, [RGB], 32\n    .elseif \\size == 4\n      st4           {v10.b, v11.b, v12.b, v13.b}[0], [RGB], 4\n      st4           {v10.b, v11.b, v12.b, v13.b}[1], [RGB], 4\n      st4           {v10.b, v11.b, v12.b, v13.b}[2], [RGB], 4\n      st4           {v10.b, v11.b, v12.b, v13.b}[3], [RGB], 4\n    .elseif \\size == 2\n      st4           {v10.b, v11.b, v12.b, v13.b}[4], [RGB], 4\n      st4           {v10.b, v11.b, v12.b, v13.b}[5], [RGB], 4\n    .elseif \\size == 1\n      st4           {v10.b, v11.b, v12.b, v13.b}[6], [RGB], 4\n    .else\n      .error unsupported macroblock size\n    .endif\n  .elseif \\bpp==16\n    .if \\size == 8\n      st1           {v25.8h}, [RGB], 16\n    .elseif \\size == 4\n      st1           {v25.4h}, [RGB], 8\n    .elseif \\size == 2\n      st1           {v25.h}[4], [RGB], 2\n      st1           {v25.h}[5], [RGB], 2\n    .elseif \\size == 1\n      st1           {v25.h}[6], [RGB], 2\n    .else\n      .error unsupported macroblock size\n    .endif\n  .else\n    .error unsupported bpp\n  .endif\n.endm\n\n.macro generate_jsimd_ycc_rgb_convert_neon colorid, bpp, r_offs, rsize, \\\n                                           g_offs, gsize, b_offs, bsize, \\\n                                           defsize, fast_st3\n\n/*\n * 2-stage pipelined YCbCr->RGB conversion\n */\n\n.macro do_yuv_to_rgb_stage1\n    uaddw           v6.8h, v2.8h, v4.8b     /* q3 = u - 128 */\n    uaddw           v8.8h, v2.8h, v5.8b     /* q2 = v - 128 */\n    smull           v20.4s, v6.4h, v1.h[1]  /* multiply by -11277 */\n    smlal           v20.4s, v8.4h, v1.h[2]  /* multiply by -23401 */\n    smull2          v22.4s, v6.8h, v1.h[1]  /* multiply by -11277 */\n    smlal2          v22.4s, v8.8h, v1.h[2]  /* multiply by -23401 */\n    smull           v24.4s, v8.4h, v1.h[0]  /* multiply by 22971 */\n    smull2          v26.4s, v8.8h, v1.h[0]  /* multiply by 22971 */\n    smull           v28.4s, v6.4h, v1.h[3]  /* multiply by 29033 */\n    smull2          v30.4s, v6.8h, v1.h[3]  /* multiply by 29033 */\n.endm\n\n.macro do_yuv_to_rgb_stage2\n    rshrn           v20.4h, v20.4s, #15\n    rshrn2          v20.8h, v22.4s, #15\n    rshrn           v24.4h, v24.4s, #14\n    rshrn2          v24.8h, v26.4s, #14\n    rshrn           v28.4h, v28.4s, #14\n    rshrn2          v28.8h, v30.4s, #14\n    uaddw           v20.8h, v20.8h, v0.8b\n    uaddw           v24.8h, v24.8h, v0.8b\n    uaddw           v28.8h, v28.8h, v0.8b\n  .if \\bpp != 16\n    sqxtun          v1\\g_offs\\defsize, v20.8h\n    sqxtun          v1\\r_offs\\defsize, v24.8h\n    sqxtun          v1\\b_offs\\defsize, v28.8h\n  .else\n    sqshlu          v21.8h, v20.8h, #8\n    sqshlu          v25.8h, v24.8h, #8\n    sqshlu          v29.8h, v28.8h, #8\n    sri             v25.8h, v21.8h, #5\n    sri             v25.8h, v29.8h, #11\n  .endif\n.endm\n\n.macro do_yuv_to_rgb_stage2_store_load_stage1 fast_st3\n    rshrn           v20.4h, v20.4s, #15\n    rshrn           v24.4h, v24.4s, #14\n    rshrn           v28.4h, v28.4s, #14\n    ld1             {v4.8b}, [U], 8\n    rshrn2          v20.8h, v22.4s, #15\n    rshrn2          v24.8h, v26.4s, #14\n    rshrn2          v28.8h, v30.4s, #14\n    ld1             {v5.8b}, [V], 8\n    uaddw           v20.8h, v20.8h, v0.8b\n    uaddw           v24.8h, v24.8h, v0.8b\n    uaddw           v28.8h, v28.8h, v0.8b\n  .if \\bpp != 16  /**************** rgb24/rgb32 ******************************/\n    sqxtun          v1\\g_offs\\defsize, v20.8h\n    ld1             {v0.8b}, [Y], 8\n    sqxtun          v1\\r_offs\\defsize, v24.8h\n    prfm            pldl1keep, [U, #64]\n    prfm            pldl1keep, [V, #64]\n    prfm            pldl1keep, [Y, #64]\n    sqxtun          v1\\b_offs\\defsize, v28.8h\n    uaddw           v6.8h, v2.8h, v4.8b     /* v6.16b = u - 128 */\n    uaddw           v8.8h, v2.8h, v5.8b     /* q2 = v - 128 */\n    smull           v20.4s, v6.4h, v1.h[1]  /* multiply by -11277 */\n    smlal           v20.4s, v8.4h, v1.h[2]  /* multiply by -23401 */\n    smull2          v22.4s, v6.8h, v1.h[1]  /* multiply by -11277 */\n    smlal2          v22.4s, v8.8h, v1.h[2]  /* multiply by -23401 */\n    smull           v24.4s, v8.4h, v1.h[0]  /* multiply by 22971 */\n    smull2          v26.4s, v8.8h, v1.h[0]  /* multiply by 22971 */\n  .else  /**************************** rgb565 ********************************/\n    sqshlu          v21.8h, v20.8h, #8\n    sqshlu          v25.8h, v24.8h, #8\n    sqshlu          v29.8h, v28.8h, #8\n    uaddw           v6.8h, v2.8h, v4.8b     /* v6.16b = u - 128 */\n    uaddw           v8.8h, v2.8h, v5.8b     /* q2 = v - 128 */\n    ld1             {v0.8b}, [Y], 8\n    smull           v20.4s, v6.4h, v1.h[1]  /* multiply by -11277 */\n    smlal           v20.4s, v8.4h, v1.h[2]  /* multiply by -23401 */\n    smull2          v22.4s, v6.8h, v1.h[1]  /* multiply by -11277 */\n    smlal2          v22.4s, v8.8h, v1.h[2]  /* multiply by -23401 */\n    sri             v25.8h, v21.8h, #5\n    smull           v24.4s, v8.4h, v1.h[0]  /* multiply by 22971 */\n    smull2          v26.4s, v8.8h, v1.h[0]  /* multiply by 22971 */\n    prfm            pldl1keep, [U, #64]\n    prfm            pldl1keep, [V, #64]\n    prfm            pldl1keep, [Y, #64]\n    sri             v25.8h, v29.8h, #11\n  .endif\n    do_store        \\bpp, 8, \\fast_st3\n    smull           v28.4s, v6.4h, v1.h[3]  /* multiply by 29033 */\n    smull2          v30.4s, v6.8h, v1.h[3]  /* multiply by 29033 */\n.endm\n\n.macro do_yuv_to_rgb\n    do_yuv_to_rgb_stage1\n    do_yuv_to_rgb_stage2\n.endm\n\n/* Apple gas crashes on adrl, work around that by using adr.\n * But this requires a copy of these constants for each function.\n */\n\n.balign 16\n.if \\fast_st3 == 1\nLjsimd_ycc_\\colorid\\()_neon_consts:\n.else\nLjsimd_ycc_\\colorid\\()_neon_slowst3_consts:\n.endif\n  .short 0,      0,     0,      0\n  .short 22971, -11277, -23401, 29033\n  .short -128,  -128,   -128,   -128\n  .short -128,  -128,   -128,   -128\n\n.if \\fast_st3 == 1\nasm_function jsimd_ycc_\\colorid\\()_convert_neon\n.else\nasm_function jsimd_ycc_\\colorid\\()_convert_neon_slowst3\n.endif\n    OUTPUT_WIDTH    .req x0\n    INPUT_BUF       .req x1\n    INPUT_ROW       .req x2\n    OUTPUT_BUF      .req x3\n    NUM_ROWS        .req x4\n\n    INPUT_BUF0      .req x5\n    INPUT_BUF1      .req x6\n    INPUT_BUF2      .req x1\n\n    RGB             .req x7\n    Y               .req x8\n    U               .req x9\n    V               .req x10\n    N               .req x15\n\n    sub             sp, sp, 336\n    str             x15, [sp], 16\n\n    /* Load constants to d1, d2, d3 (v0.4h is just used for padding) */\n    .if \\fast_st3 == 1\n      adr           x15, Ljsimd_ycc_\\colorid\\()_neon_consts\n    .else\n      adr           x15, Ljsimd_ycc_\\colorid\\()_neon_slowst3_consts\n    .endif\n\n    /* Save NEON registers */\n    st1             {v0.8b, v1.8b, v2.8b, v3.8b}, [sp], 32\n    st1             {v4.8b, v5.8b, v6.8b, v7.8b}, [sp], 32\n    st1             {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32\n    st1             {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32\n    st1             {v16.8b, v17.8b, v18.8b, v19.8b}, [sp], 32\n    st1             {v20.8b, v21.8b, v22.8b, v23.8b}, [sp], 32\n    st1             {v24.8b, v25.8b, v26.8b, v27.8b}, [sp], 32\n    st1             {v28.8b, v29.8b, v30.8b, v31.8b}, [sp], 32\n    ld1             {v0.4h, v1.4h}, [x15], 16\n    ld1             {v2.8h}, [x15]\n\n    /* Save ARM registers and handle input arguments */\n    /* push            {x4, x5, x6, x7, x8, x9, x10, x30} */\n    stp             x4, x5, [sp], 16\n    stp             x6, x7, [sp], 16\n    stp             x8, x9, [sp], 16\n    stp             x10, x30, [sp], 16\n    ldr             INPUT_BUF0, [INPUT_BUF]\n    ldr             INPUT_BUF1, [INPUT_BUF, #8]\n    ldr             INPUT_BUF2, [INPUT_BUF, #16]\n    .unreq          INPUT_BUF\n\n    /* Initially set v10, v11.4h, v12.8b, d13 to 0xFF */\n    movi            v10.16b, #255\n    movi            v13.16b, #255\n\n    /* Outer loop over scanlines */\n    cmp             NUM_ROWS, #1\n    b.lt            9f\n0:\n    lsl             x16, INPUT_ROW, #3\n    ldr             Y, [INPUT_BUF0, x16]\n    ldr             U, [INPUT_BUF1, x16]\n    mov             N, OUTPUT_WIDTH\n    ldr             V, [INPUT_BUF2, x16]\n    add             INPUT_ROW, INPUT_ROW, #1\n    ldr             RGB, [OUTPUT_BUF], #8\n\n    /* Inner loop over pixels */\n    subs            N, N, #8\n    b.lt            3f\n    do_load         8\n    do_yuv_to_rgb_stage1\n    subs            N, N, #8\n    b.lt            2f\n1:\n    do_yuv_to_rgb_stage2_store_load_stage1 \\fast_st3\n    subs            N, N, #8\n    b.ge            1b\n2:\n    do_yuv_to_rgb_stage2\n    do_store        \\bpp, 8, \\fast_st3\n    tst             N, #7\n    b.eq            8f\n3:\n    tst             N, #4\n    b.eq            3f\n    do_load         4\n3:\n    tst             N, #2\n    b.eq            4f\n    do_load         2\n4:\n    tst             N, #1\n    b.eq            5f\n    do_load         1\n5:\n    do_yuv_to_rgb\n    tst             N, #4\n    b.eq            6f\n    do_store        \\bpp, 4, \\fast_st3\n6:\n    tst             N, #2\n    b.eq            7f\n    do_store        \\bpp, 2, \\fast_st3\n7:\n    tst             N, #1\n    b.eq            8f\n    do_store        \\bpp, 1, \\fast_st3\n8:\n    subs            NUM_ROWS, NUM_ROWS, #1\n    b.gt            0b\n9:\n    /* Restore all registers and return */\n    sub             sp, sp, #336\n    ldr             x15, [sp], 16\n    ld1             {v0.8b, v1.8b, v2.8b, v3.8b}, [sp], 32\n    ld1             {v4.8b, v5.8b, v6.8b, v7.8b}, [sp], 32\n    ld1             {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32\n    ld1             {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32\n    ld1             {v16.8b, v17.8b, v18.8b, v19.8b}, [sp], 32\n    ld1             {v20.8b, v21.8b, v22.8b, v23.8b}, [sp], 32\n    ld1             {v24.8b, v25.8b, v26.8b, v27.8b}, [sp], 32\n    ld1             {v28.8b, v29.8b, v30.8b, v31.8b}, [sp], 32\n    /* pop             {r4, r5, r6, r7, r8, r9, r10, pc} */\n    ldp             x4, x5, [sp], 16\n    ldp             x6, x7, [sp], 16\n    ldp             x8, x9, [sp], 16\n    ldp             x10, x30, [sp], 16\n    br              x30\n    .unreq          OUTPUT_WIDTH\n    .unreq          INPUT_ROW\n    .unreq          OUTPUT_BUF\n    .unreq          NUM_ROWS\n    .unreq          INPUT_BUF0\n    .unreq          INPUT_BUF1\n    .unreq          INPUT_BUF2\n    .unreq          RGB\n    .unreq          Y\n    .unreq          U\n    .unreq          V\n    .unreq          N\n\n.purgem do_yuv_to_rgb\n.purgem do_yuv_to_rgb_stage1\n.purgem do_yuv_to_rgb_stage2\n.purgem do_yuv_to_rgb_stage2_store_load_stage1\n\n.endm\n\n/*--------------------------------- id ----- bpp R  rsize G  gsize B  bsize defsize fast_st3*/\ngenerate_jsimd_ycc_rgb_convert_neon extrgb,  24, 0, .4h,  1, .4h,  2, .4h,  .8b,    1\ngenerate_jsimd_ycc_rgb_convert_neon extbgr,  24, 2, .4h,  1, .4h,  0, .4h,  .8b,    1\ngenerate_jsimd_ycc_rgb_convert_neon extrgbx, 32, 0, .4h,  1, .4h,  2, .4h,  .8b,    1\ngenerate_jsimd_ycc_rgb_convert_neon extbgrx, 32, 2, .4h,  1, .4h,  0, .4h,  .8b,    1\ngenerate_jsimd_ycc_rgb_convert_neon extxbgr, 32, 3, .4h,  2, .4h,  1, .4h,  .8b,    1\ngenerate_jsimd_ycc_rgb_convert_neon extxrgb, 32, 1, .4h,  2, .4h,  3, .4h,  .8b,    1\ngenerate_jsimd_ycc_rgb_convert_neon rgb565,  16, 0, .4h,  0, .4h,  0, .4h,  .8b,    1\n\ngenerate_jsimd_ycc_rgb_convert_neon extrgb,  24, 0, .4h,  1, .4h,  2, .4h,  .8b,    0\ngenerate_jsimd_ycc_rgb_convert_neon extbgr,  24, 2, .4h,  1, .4h,  0, .4h,  .8b,    0\n\n.purgem do_load\n.purgem do_store\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_extrgb_ycc_convert_neon\n * jsimd_extbgr_ycc_convert_neon\n * jsimd_extrgbx_ycc_convert_neon\n * jsimd_extbgrx_ycc_convert_neon\n * jsimd_extxbgr_ycc_convert_neon\n * jsimd_extxrgb_ycc_convert_neon\n *\n * Colorspace conversion RGB -> YCbCr\n */\n\n.macro do_store size\n  .if \\size == 8\n    st1             {v20.8b}, [Y], #8\n    st1             {v21.8b}, [U], #8\n    st1             {v22.8b}, [V], #8\n  .elseif \\size == 4\n    st1             {v20.b}[0], [Y], #1\n    st1             {v20.b}[1], [Y], #1\n    st1             {v20.b}[2], [Y], #1\n    st1             {v20.b}[3], [Y], #1\n    st1             {v21.b}[0], [U], #1\n    st1             {v21.b}[1], [U], #1\n    st1             {v21.b}[2], [U], #1\n    st1             {v21.b}[3], [U], #1\n    st1             {v22.b}[0], [V], #1\n    st1             {v22.b}[1], [V], #1\n    st1             {v22.b}[2], [V], #1\n    st1             {v22.b}[3], [V], #1\n  .elseif \\size == 2\n    st1             {v20.b}[4], [Y], #1\n    st1             {v20.b}[5], [Y], #1\n    st1             {v21.b}[4], [U], #1\n    st1             {v21.b}[5], [U], #1\n    st1             {v22.b}[4], [V], #1\n    st1             {v22.b}[5], [V], #1\n  .elseif \\size == 1\n    st1             {v20.b}[6], [Y], #1\n    st1             {v21.b}[6], [U], #1\n    st1             {v22.b}[6], [V], #1\n  .else\n    .error unsupported macroblock size\n  .endif\n.endm\n\n.macro do_load bpp, size, fast_ld3\n  .if \\bpp == 24\n    .if \\size == 8\n      .if \\fast_ld3 == 1\n        ld3         {v10.8b, v11.8b, v12.8b}, [RGB], #24\n      .else\n        ld1         {v10.b}[0], [RGB], #1\n        ld1         {v11.b}[0], [RGB], #1\n        ld1         {v12.b}[0], [RGB], #1\n\n        ld1         {v10.b}[1], [RGB], #1\n        ld1         {v11.b}[1], [RGB], #1\n        ld1         {v12.b}[1], [RGB], #1\n\n        ld1         {v10.b}[2], [RGB], #1\n        ld1         {v11.b}[2], [RGB], #1\n        ld1         {v12.b}[2], [RGB], #1\n\n        ld1         {v10.b}[3], [RGB], #1\n        ld1         {v11.b}[3], [RGB], #1\n        ld1         {v12.b}[3], [RGB], #1\n\n        ld1         {v10.b}[4], [RGB], #1\n        ld1         {v11.b}[4], [RGB], #1\n        ld1         {v12.b}[4], [RGB], #1\n\n        ld1         {v10.b}[5], [RGB], #1\n        ld1         {v11.b}[5], [RGB], #1\n        ld1         {v12.b}[5], [RGB], #1\n\n        ld1         {v10.b}[6], [RGB], #1\n        ld1         {v11.b}[6], [RGB], #1\n        ld1         {v12.b}[6], [RGB], #1\n\n        ld1         {v10.b}[7], [RGB], #1\n        ld1         {v11.b}[7], [RGB], #1\n        ld1         {v12.b}[7], [RGB], #1\n      .endif\n      prfm          pldl1keep, [RGB, #128]\n    .elseif \\size == 4\n      ld3           {v10.b, v11.b, v12.b}[0], [RGB], #3\n      ld3           {v10.b, v11.b, v12.b}[1], [RGB], #3\n      ld3           {v10.b, v11.b, v12.b}[2], [RGB], #3\n      ld3           {v10.b, v11.b, v12.b}[3], [RGB], #3\n    .elseif \\size == 2\n      ld3           {v10.b, v11.b, v12.b}[4], [RGB], #3\n      ld3           {v10.b, v11.b, v12.b}[5], [RGB], #3\n    .elseif \\size == 1\n      ld3           {v10.b, v11.b, v12.b}[6], [RGB], #3\n    .else\n      .error unsupported macroblock size\n    .endif\n  .elseif \\bpp == 32\n    .if \\size == 8\n      ld4           {v10.8b, v11.8b, v12.8b, v13.8b}, [RGB], #32\n      prfm          pldl1keep, [RGB, #128]\n    .elseif \\size == 4\n      ld4           {v10.b, v11.b, v12.b, v13.b}[0], [RGB], #4\n      ld4           {v10.b, v11.b, v12.b, v13.b}[1], [RGB], #4\n      ld4           {v10.b, v11.b, v12.b, v13.b}[2], [RGB], #4\n      ld4           {v10.b, v11.b, v12.b, v13.b}[3], [RGB], #4\n    .elseif \\size == 2\n      ld4           {v10.b, v11.b, v12.b, v13.b}[4], [RGB], #4\n      ld4           {v10.b, v11.b, v12.b, v13.b}[5], [RGB], #4\n    .elseif \\size == 1\n      ld4           {v10.b, v11.b, v12.b, v13.b}[6], [RGB], #4\n    .else\n      .error unsupported macroblock size\n    .endif\n  .else\n    .error unsupported bpp\n  .endif\n.endm\n\n.macro generate_jsimd_rgb_ycc_convert_neon colorid, bpp, r_offs, g_offs, \\\n                                           b_offs, fast_ld3\n\n/*\n * 2-stage pipelined RGB->YCbCr conversion\n */\n\n.macro do_rgb_to_yuv_stage1\n    ushll           v4.8h, v1\\r_offs\\().8b, #0  /* r = v4 */\n    ushll           v6.8h, v1\\g_offs\\().8b, #0  /* g = v6 */\n    ushll           v8.8h, v1\\b_offs\\().8b, #0  /* b = v8 */\n    rev64           v18.4s, v1.4s\n    rev64           v26.4s, v1.4s\n    rev64           v28.4s, v1.4s\n    rev64           v30.4s, v1.4s\n    umull           v14.4s, v4.4h, v0.h[0]\n    umull2          v16.4s, v4.8h, v0.h[0]\n    umlsl           v18.4s, v4.4h, v0.h[3]\n    umlsl2          v26.4s, v4.8h, v0.h[3]\n    umlal           v28.4s, v4.4h, v0.h[5]\n    umlal2          v30.4s, v4.8h, v0.h[5]\n    umlal           v14.4s, v6.4h, v0.h[1]\n    umlal2          v16.4s, v6.8h, v0.h[1]\n    umlsl           v18.4s, v6.4h, v0.h[4]\n    umlsl2          v26.4s, v6.8h, v0.h[4]\n    umlsl           v28.4s, v6.4h, v0.h[6]\n    umlsl2          v30.4s, v6.8h, v0.h[6]\n    umlal           v14.4s, v8.4h, v0.h[2]\n    umlal2          v16.4s, v8.8h, v0.h[2]\n    umlal           v18.4s, v8.4h, v0.h[5]\n    umlal2          v26.4s, v8.8h, v0.h[5]\n    umlsl           v28.4s, v8.4h, v0.h[7]\n    umlsl2          v30.4s, v8.8h, v0.h[7]\n.endm\n\n.macro do_rgb_to_yuv_stage2\n    rshrn           v20.4h, v14.4s, #16\n    shrn            v22.4h, v18.4s, #16\n    shrn            v24.4h, v28.4s, #16\n    rshrn2          v20.8h, v16.4s, #16\n    shrn2           v22.8h, v26.4s, #16\n    shrn2           v24.8h, v30.4s, #16\n    xtn             v20.8b, v20.8h       /* v20 = y */\n    xtn             v21.8b, v22.8h       /* v21 = u */\n    xtn             v22.8b, v24.8h       /* v22 = v */\n.endm\n\n.macro do_rgb_to_yuv\n    do_rgb_to_yuv_stage1\n    do_rgb_to_yuv_stage2\n.endm\n\n/* TODO: expand macros and interleave instructions if some in-order\n *       ARM64 processor actually can dual-issue LOAD/STORE with ALU */\n.macro do_rgb_to_yuv_stage2_store_load_stage1 fast_ld3\n    do_rgb_to_yuv_stage2\n    do_load         \\bpp, 8, \\fast_ld3\n    st1             {v20.8b}, [Y], #8\n    st1             {v21.8b}, [U], #8\n    st1             {v22.8b}, [V], #8\n    do_rgb_to_yuv_stage1\n.endm\n\n.balign 16\n.if \\fast_ld3 == 1\nLjsimd_\\colorid\\()_ycc_neon_consts:\n.else\nLjsimd_\\colorid\\()_ycc_neon_slowld3_consts:\n.endif\n  .short 19595, 38470, 7471, 11059\n  .short 21709, 32768, 27439, 5329\n  .short 32767, 128, 32767, 128\n  .short 32767, 128, 32767, 128\n\n.if \\fast_ld3 == 1\nasm_function jsimd_\\colorid\\()_ycc_convert_neon\n.else\nasm_function jsimd_\\colorid\\()_ycc_convert_neon_slowld3\n.endif\n    OUTPUT_WIDTH    .req w0\n    INPUT_BUF       .req x1\n    OUTPUT_BUF      .req x2\n    OUTPUT_ROW      .req x3\n    NUM_ROWS        .req x4\n\n    OUTPUT_BUF0     .req x5\n    OUTPUT_BUF1     .req x6\n    OUTPUT_BUF2     .req x2  /* OUTPUT_BUF */\n\n    RGB             .req x7\n    Y               .req x9\n    U               .req x10\n    V               .req x11\n    N               .req w12\n\n    /* Load constants to d0, d1, d2, d3 */\n    .if \\fast_ld3 == 1\n      adr           x13, Ljsimd_\\colorid\\()_ycc_neon_consts\n    .else\n      adr           x13, Ljsimd_\\colorid\\()_ycc_neon_slowld3_consts\n    .endif\n    ld1             {v0.8h, v1.8h}, [x13]\n\n    ldr             OUTPUT_BUF0, [OUTPUT_BUF]\n    ldr             OUTPUT_BUF1, [OUTPUT_BUF, #8]\n    ldr             OUTPUT_BUF2, [OUTPUT_BUF, #16]\n    .unreq          OUTPUT_BUF\n\n    /* Save NEON registers */\n    sub             sp, sp, #64\n    st1             {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32\n    st1             {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32\n\n    /* Outer loop over scanlines */\n    cmp             NUM_ROWS, #1\n    b.lt            9f\n0:\n    ldr             Y, [OUTPUT_BUF0, OUTPUT_ROW, lsl #3]\n    ldr             U, [OUTPUT_BUF1, OUTPUT_ROW, lsl #3]\n    mov             N, OUTPUT_WIDTH\n    ldr             V, [OUTPUT_BUF2, OUTPUT_ROW, lsl #3]\n    add             OUTPUT_ROW, OUTPUT_ROW, #1\n    ldr             RGB, [INPUT_BUF], #8\n\n    /* Inner loop over pixels */\n    subs            N, N, #8\n    b.lt            3f\n    do_load         \\bpp, 8, \\fast_ld3\n    do_rgb_to_yuv_stage1\n    subs            N, N, #8\n    b.lt            2f\n1:\n    do_rgb_to_yuv_stage2_store_load_stage1 \\fast_ld3\n    subs            N, N, #8\n    b.ge            1b\n2:\n    do_rgb_to_yuv_stage2\n    do_store        8\n    tst             N, #7\n    b.eq            8f\n3:\n    tbz             N, #2, 3f\n    do_load         \\bpp, 4, \\fast_ld3\n3:\n    tbz             N, #1, 4f\n    do_load         \\bpp, 2, \\fast_ld3\n4:\n    tbz             N, #0, 5f\n    do_load         \\bpp, 1, \\fast_ld3\n5:\n    do_rgb_to_yuv\n    tbz             N, #2, 6f\n    do_store        4\n6:\n    tbz             N, #1, 7f\n    do_store        2\n7:\n    tbz             N, #0, 8f\n    do_store        1\n8:\n    subs            NUM_ROWS, NUM_ROWS, #1\n    b.gt            0b\n9:\n    /* Restore all registers and return */\n    sub             sp, sp, #64\n    ld1             {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32\n    ld1             {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32\n    br              x30\n\n    .unreq          OUTPUT_WIDTH\n    .unreq          OUTPUT_ROW\n    .unreq          INPUT_BUF\n    .unreq          NUM_ROWS\n    .unreq          OUTPUT_BUF0\n    .unreq          OUTPUT_BUF1\n    .unreq          OUTPUT_BUF2\n    .unreq          RGB\n    .unreq          Y\n    .unreq          U\n    .unreq          V\n    .unreq          N\n\n.purgem do_rgb_to_yuv\n.purgem do_rgb_to_yuv_stage1\n.purgem do_rgb_to_yuv_stage2\n.purgem do_rgb_to_yuv_stage2_store_load_stage1\n\n.endm\n\n/*--------------------------------- id ----- bpp R  G  B  Fast LD3 */\ngenerate_jsimd_rgb_ycc_convert_neon extrgb,  24, 0, 1, 2, 1\ngenerate_jsimd_rgb_ycc_convert_neon extbgr,  24, 2, 1, 0, 1\ngenerate_jsimd_rgb_ycc_convert_neon extrgbx, 32, 0, 1, 2, 1\ngenerate_jsimd_rgb_ycc_convert_neon extbgrx, 32, 2, 1, 0, 1\ngenerate_jsimd_rgb_ycc_convert_neon extxbgr, 32, 3, 2, 1, 1\ngenerate_jsimd_rgb_ycc_convert_neon extxrgb, 32, 1, 2, 3, 1\n\ngenerate_jsimd_rgb_ycc_convert_neon extrgb,  24, 0, 1, 2, 0\ngenerate_jsimd_rgb_ycc_convert_neon extbgr,  24, 2, 1, 0, 0\n\n.purgem do_load\n.purgem do_store\n\n\n/*****************************************************************************/\n\n/*\n * Load data into workspace, applying unsigned->signed conversion\n *\n * TODO: can be combined with 'jsimd_fdct_ifast_neon' to get\n *       rid of VST1.16 instructions\n */\n\nasm_function jsimd_convsamp_neon\n    SAMPLE_DATA     .req x0\n    START_COL       .req x1\n    WORKSPACE       .req x2\n    TMP1            .req x9\n    TMP2            .req x10\n    TMP3            .req x11\n    TMP4            .req x12\n    TMP5            .req x13\n    TMP6            .req x14\n    TMP7            .req x15\n    TMP8            .req x4\n    TMPDUP          .req w3\n\n    mov             TMPDUP, #128\n    ldp             TMP1, TMP2, [SAMPLE_DATA], 16\n    ldp             TMP3, TMP4, [SAMPLE_DATA], 16\n    dup             v0.8b, TMPDUP\n    add             TMP1, TMP1, START_COL\n    add             TMP2, TMP2, START_COL\n    ldp             TMP5, TMP6, [SAMPLE_DATA], 16\n    add             TMP3, TMP3, START_COL\n    add             TMP4, TMP4, START_COL\n    ldp             TMP7, TMP8, [SAMPLE_DATA], 16\n    add             TMP5, TMP5, START_COL\n    add             TMP6, TMP6, START_COL\n    ld1             {v16.8b}, [TMP1]\n    add             TMP7, TMP7, START_COL\n    add             TMP8, TMP8, START_COL\n    ld1             {v17.8b}, [TMP2]\n    usubl           v16.8h, v16.8b, v0.8b\n    ld1             {v18.8b}, [TMP3]\n    usubl           v17.8h, v17.8b, v0.8b\n    ld1             {v19.8b}, [TMP4]\n    usubl           v18.8h, v18.8b, v0.8b\n    ld1             {v20.8b}, [TMP5]\n    usubl           v19.8h, v19.8b, v0.8b\n    ld1             {v21.8b}, [TMP6]\n    st1             {v16.8h, v17.8h, v18.8h, v19.8h}, [WORKSPACE], 64\n    usubl           v20.8h, v20.8b, v0.8b\n    ld1             {v22.8b}, [TMP7]\n    usubl           v21.8h, v21.8b, v0.8b\n    ld1             {v23.8b}, [TMP8]\n    usubl           v22.8h, v22.8b, v0.8b\n    usubl           v23.8h, v23.8b, v0.8b\n    st1             {v20.8h, v21.8h, v22.8h, v23.8h}, [WORKSPACE], 64\n\n    br              x30\n\n    .unreq          SAMPLE_DATA\n    .unreq          START_COL\n    .unreq          WORKSPACE\n    .unreq          TMP1\n    .unreq          TMP2\n    .unreq          TMP3\n    .unreq          TMP4\n    .unreq          TMP5\n    .unreq          TMP6\n    .unreq          TMP7\n    .unreq          TMP8\n    .unreq          TMPDUP\n\n/*****************************************************************************/\n\n/*\n * jsimd_fdct_islow_neon\n *\n * This file contains a slow-but-accurate integer implementation of the\n * forward DCT (Discrete Cosine Transform). The following code is based\n * directly on the IJG''s original jfdctint.c; see the jfdctint.c for\n * more details.\n *\n * TODO: can be combined with 'jsimd_convsamp_neon' to get\n *       rid of a bunch of VLD1.16 instructions\n */\n\n#define CONST_BITS 13\n#define PASS1_BITS 2\n\n#define DESCALE_P1 (CONST_BITS-PASS1_BITS)\n#define DESCALE_P2 (CONST_BITS+PASS1_BITS)\n\n#define F_0_298  2446  /* FIX(0.298631336) */\n#define F_0_390  3196  /* FIX(0.390180644) */\n#define F_0_541  4433  /* FIX(0.541196100) */\n#define F_0_765  6270  /* FIX(0.765366865) */\n#define F_0_899  7373  /* FIX(0.899976223) */\n#define F_1_175  9633  /* FIX(1.175875602) */\n#define F_1_501 12299  /* FIX(1.501321110) */\n#define F_1_847 15137  /* FIX(1.847759065) */\n#define F_1_961 16069  /* FIX(1.961570560) */\n#define F_2_053 16819  /* FIX(2.053119869) */\n#define F_2_562 20995  /* FIX(2.562915447) */\n#define F_3_072 25172  /* FIX(3.072711026) */\n\n.balign 16\nLjsimd_fdct_islow_neon_consts:\n  .short F_0_298\n  .short -F_0_390\n  .short F_0_541\n  .short F_0_765\n  .short - F_0_899\n  .short F_1_175\n  .short F_1_501\n  .short - F_1_847\n  .short - F_1_961\n  .short F_2_053\n  .short - F_2_562\n  .short F_3_072\n  .short 0          /* padding */\n  .short 0\n  .short 0\n  .short 0\n\n#undef F_0_298\n#undef F_0_390\n#undef F_0_541\n#undef F_0_765\n#undef F_0_899\n#undef F_1_175\n#undef F_1_501\n#undef F_1_847\n#undef F_1_961\n#undef F_2_053\n#undef F_2_562\n#undef F_3_072\n#define XFIX_P_0_298 v0.h[0]\n#define XFIX_N_0_390 v0.h[1]\n#define XFIX_P_0_541 v0.h[2]\n#define XFIX_P_0_765 v0.h[3]\n#define XFIX_N_0_899 v0.h[4]\n#define XFIX_P_1_175 v0.h[5]\n#define XFIX_P_1_501 v0.h[6]\n#define XFIX_N_1_847 v0.h[7]\n#define XFIX_N_1_961 v1.h[0]\n#define XFIX_P_2_053 v1.h[1]\n#define XFIX_N_2_562 v1.h[2]\n#define XFIX_P_3_072 v1.h[3]\n\nasm_function jsimd_fdct_islow_neon\n\n    DATA            .req x0\n    TMP             .req x9\n\n    /* Load constants */\n    adr             TMP, Ljsimd_fdct_islow_neon_consts\n    ld1             {v0.8h, v1.8h}, [TMP]\n\n    /* Save NEON registers */\n    sub             sp, sp, #64\n    st1             {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32\n    st1             {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32\n\n    /* Load all DATA into NEON registers with the following allocation:\n     *       0 1 2 3 | 4 5 6 7\n     *      ---------+--------\n     *   0 | d16     | d17    | v16.8h\n     *   1 | d18     | d19    | v17.8h\n     *   2 | d20     | d21    | v18.8h\n     *   3 | d22     | d23    | v19.8h\n     *   4 | d24     | d25    | v20.8h\n     *   5 | d26     | d27    | v21.8h\n     *   6 | d28     | d29    | v22.8h\n     *   7 | d30     | d31    | v23.8h\n     */\n\n    ld1             {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64\n    ld1             {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA]\n    sub             DATA, DATA, #64\n\n    /* Transpose */\n    transpose_8x8   v16, v17, v18, v19, v20, v21, v22, v23, v31, v2, v3, v4\n    /* 1-D FDCT */\n    add             v24.8h, v16.8h, v23.8h  /* tmp0 = dataptr[0] + dataptr[7]; */\n    sub             v31.8h, v16.8h, v23.8h  /* tmp7 = dataptr[0] - dataptr[7]; */\n    add             v25.8h, v17.8h, v22.8h  /* tmp1 = dataptr[1] + dataptr[6]; */\n    sub             v30.8h, v17.8h, v22.8h  /* tmp6 = dataptr[1] - dataptr[6]; */\n    add             v26.8h, v18.8h, v21.8h  /* tmp2 = dataptr[2] + dataptr[5]; */\n    sub             v29.8h, v18.8h, v21.8h  /* tmp5 = dataptr[2] - dataptr[5]; */\n    add             v27.8h, v19.8h, v20.8h  /* tmp3 = dataptr[3] + dataptr[4]; */\n    sub             v28.8h, v19.8h, v20.8h  /* tmp4 = dataptr[3] - dataptr[4]; */\n\n    /* even part */\n\n    add             v8.8h, v24.8h, v27.8h   /* tmp10 = tmp0 + tmp3; */\n    sub             v9.8h, v24.8h, v27.8h   /* tmp13 = tmp0 - tmp3; */\n    add             v10.8h, v25.8h, v26.8h  /* tmp11 = tmp1 + tmp2; */\n    sub             v11.8h, v25.8h, v26.8h  /* tmp12 = tmp1 - tmp2; */\n\n    add             v16.8h, v8.8h, v10.8h  /* tmp10 + tmp11 */\n    sub             v20.8h, v8.8h, v10.8h  /* tmp10 - tmp11 */\n\n    add             v18.8h, v11.8h, v9.8h  /* tmp12 + tmp13 */\n\n    shl             v16.8h, v16.8h, #PASS1_BITS  /* dataptr[0] = (DCTELEM) LEFT_SHIFT(tmp10 + tmp11, PASS1_BITS); */\n    shl             v20.8h, v20.8h, #PASS1_BITS  /* dataptr[4] = (DCTELEM) LEFT_SHIFT(tmp10 - tmp11, PASS1_BITS); */\n\n    smull2          v24.4s, v18.8h, XFIX_P_0_541  /* z1 hi = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */\n    smull           v18.4s, v18.4h, XFIX_P_0_541  /* z1 lo = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */\n    mov             v22.16b, v18.16b\n    mov             v25.16b, v24.16b\n\n    smlal           v18.4s, v9.4h, XFIX_P_0_765   /* lo z1 + MULTIPLY(tmp13, XFIX_P_0_765) */\n    smlal2          v24.4s, v9.8h, XFIX_P_0_765   /* hi z1 + MULTIPLY(tmp13, XFIX_P_0_765) */\n    smlal           v22.4s, v11.4h, XFIX_N_1_847  /* lo z1 + MULTIPLY(tmp12, XFIX_N_1_847) */\n    smlal2          v25.4s, v11.8h, XFIX_N_1_847  /* hi z1 + MULTIPLY(tmp12, XFIX_N_1_847) */\n\n    rshrn           v18.4h, v18.4s, #DESCALE_P1\n    rshrn           v22.4h, v22.4s, #DESCALE_P1\n    rshrn2          v18.8h, v24.4s, #DESCALE_P1  /* dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, XFIX_P_0_765), CONST_BITS-PASS1_BITS); */\n    rshrn2          v22.8h, v25.4s, #DESCALE_P1  /* dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, XFIX_N_1_847), CONST_BITS-PASS1_BITS); */\n\n    /* Odd part */\n\n    add             v8.8h, v28.8h, v31.8h        /* z1 = tmp4 + tmp7; */\n    add             v9.8h, v29.8h, v30.8h        /* z2 = tmp5 + tmp6; */\n    add             v10.8h, v28.8h, v30.8h       /* z3 = tmp4 + tmp6; */\n    add             v11.8h, v29.8h, v31.8h       /* z4 = tmp5 + tmp7; */\n    smull           v4.4s, v10.4h, XFIX_P_1_175  /* z5 lo = z3 lo * XFIX_P_1_175 */\n    smull2          v5.4s, v10.8h, XFIX_P_1_175\n    smlal           v4.4s, v11.4h, XFIX_P_1_175  /* z5 = MULTIPLY(z3 + z4, FIX_1_175875602); */\n    smlal2          v5.4s, v11.8h, XFIX_P_1_175\n\n    smull2          v24.4s, v28.8h, XFIX_P_0_298\n    smull2          v25.4s, v29.8h, XFIX_P_2_053\n    smull2          v26.4s, v30.8h, XFIX_P_3_072\n    smull2          v27.4s, v31.8h, XFIX_P_1_501\n    smull           v28.4s, v28.4h, XFIX_P_0_298  /* tmp4 = MULTIPLY(tmp4, FIX_0_298631336); */\n    smull           v29.4s, v29.4h, XFIX_P_2_053  /* tmp5 = MULTIPLY(tmp5, FIX_2_053119869); */\n    smull           v30.4s, v30.4h, XFIX_P_3_072  /* tmp6 = MULTIPLY(tmp6, FIX_3_072711026); */\n    smull           v31.4s, v31.4h, XFIX_P_1_501  /* tmp7 = MULTIPLY(tmp7, FIX_1_501321110); */\n\n    smull2          v12.4s, v8.8h, XFIX_N_0_899\n    smull2          v13.4s, v9.8h, XFIX_N_2_562\n    smull2          v14.4s, v10.8h, XFIX_N_1_961\n    smull2          v15.4s, v11.8h, XFIX_N_0_390\n    smull           v8.4s, v8.4h, XFIX_N_0_899    /* z1 = MULTIPLY(z1, - FIX_0_899976223); */\n    smull           v9.4s, v9.4h, XFIX_N_2_562    /* z2 = MULTIPLY(z2, - FIX_2_562915447); */\n    smull           v10.4s, v10.4h, XFIX_N_1_961  /* z3 = MULTIPLY(z3, - FIX_1_961570560); */\n    smull           v11.4s, v11.4h, XFIX_N_0_390  /* z4 = MULTIPLY(z4, - FIX_0_390180644); */\n\n    add             v10.4s, v10.4s, v4.4s  /* z3 += z5 */\n    add             v14.4s, v14.4s, v5.4s\n    add             v11.4s, v11.4s, v4.4s  /* z4 += z5 */\n    add             v15.4s, v15.4s, v5.4s\n\n    add             v28.4s, v28.4s, v8.4s   /* tmp4 += z1 */\n    add             v24.4s, v24.4s, v12.4s\n    add             v29.4s, v29.4s, v9.4s   /* tmp5 += z2 */\n    add             v25.4s, v25.4s, v13.4s\n    add             v30.4s, v30.4s, v10.4s  /* tmp6 += z3 */\n    add             v26.4s, v26.4s, v14.4s\n    add             v31.4s, v31.4s, v11.4s  /* tmp7 += z4 */\n    add             v27.4s, v27.4s, v15.4s\n\n    add             v28.4s, v28.4s, v10.4s  /* tmp4 += z3 */\n    add             v24.4s, v24.4s, v14.4s\n    add             v29.4s, v29.4s, v11.4s  /* tmp5 += z4 */\n    add             v25.4s, v25.4s, v15.4s\n    add             v30.4s, v30.4s, v9.4s   /* tmp6 += z2 */\n    add             v26.4s, v26.4s, v13.4s\n    add             v31.4s, v31.4s, v8.4s   /* tmp7 += z1 */\n    add             v27.4s, v27.4s, v12.4s\n\n    rshrn           v23.4h, v28.4s, #DESCALE_P1\n    rshrn           v21.4h, v29.4s, #DESCALE_P1\n    rshrn           v19.4h, v30.4s, #DESCALE_P1\n    rshrn           v17.4h, v31.4s, #DESCALE_P1\n    rshrn2          v23.8h, v24.4s, #DESCALE_P1  /* dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); */\n    rshrn2          v21.8h, v25.4s, #DESCALE_P1  /* dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); */\n    rshrn2          v19.8h, v26.4s, #DESCALE_P1  /* dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); */\n    rshrn2          v17.8h, v27.4s, #DESCALE_P1  /* dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); */\n\n    /* Transpose */\n    transpose_8x8   v16, v17, v18, v19, v20, v21, v22, v23, v31, v2, v3, v4\n\n    /* 1-D FDCT */\n    add             v24.8h, v16.8h, v23.8h  /* tmp0 = dataptr[0] + dataptr[7]; */\n    sub             v31.8h, v16.8h, v23.8h  /* tmp7 = dataptr[0] - dataptr[7]; */\n    add             v25.8h, v17.8h, v22.8h  /* tmp1 = dataptr[1] + dataptr[6]; */\n    sub             v30.8h, v17.8h, v22.8h  /* tmp6 = dataptr[1] - dataptr[6]; */\n    add             v26.8h, v18.8h, v21.8h  /* tmp2 = dataptr[2] + dataptr[5]; */\n    sub             v29.8h, v18.8h, v21.8h  /* tmp5 = dataptr[2] - dataptr[5]; */\n    add             v27.8h, v19.8h, v20.8h  /* tmp3 = dataptr[3] + dataptr[4]; */\n    sub             v28.8h, v19.8h, v20.8h  /* tmp4 = dataptr[3] - dataptr[4]; */\n\n    /* even part */\n    add             v8.8h, v24.8h, v27.8h   /* tmp10 = tmp0 + tmp3; */\n    sub             v9.8h, v24.8h, v27.8h   /* tmp13 = tmp0 - tmp3; */\n    add             v10.8h, v25.8h, v26.8h  /* tmp11 = tmp1 + tmp2; */\n    sub             v11.8h, v25.8h, v26.8h  /* tmp12 = tmp1 - tmp2; */\n\n    add             v16.8h, v8.8h, v10.8h  /* tmp10 + tmp11 */\n    sub             v20.8h, v8.8h, v10.8h  /* tmp10 - tmp11 */\n\n    add             v18.8h, v11.8h, v9.8h  /* tmp12 + tmp13 */\n\n    srshr           v16.8h, v16.8h, #PASS1_BITS  /* dataptr[0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS); */\n    srshr           v20.8h, v20.8h, #PASS1_BITS  /* dataptr[4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS); */\n\n    smull2          v24.4s, v18.8h, XFIX_P_0_541  /* z1 hi = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */\n    smull           v18.4s, v18.4h, XFIX_P_0_541  /* z1 lo = MULTIPLY(tmp12 + tmp13, XFIX_P_0_541); */\n    mov             v22.16b, v18.16b\n    mov             v25.16b, v24.16b\n\n    smlal           v18.4s, v9.4h, XFIX_P_0_765   /* lo z1 + MULTIPLY(tmp13, XFIX_P_0_765) */\n    smlal2          v24.4s, v9.8h, XFIX_P_0_765   /* hi z1 + MULTIPLY(tmp13, XFIX_P_0_765) */\n    smlal           v22.4s, v11.4h, XFIX_N_1_847  /* lo z1 + MULTIPLY(tmp12, XFIX_N_1_847) */\n    smlal2          v25.4s, v11.8h, XFIX_N_1_847  /* hi z1 + MULTIPLY(tmp12, XFIX_N_1_847) */\n\n    rshrn           v18.4h, v18.4s, #DESCALE_P2\n    rshrn           v22.4h, v22.4s, #DESCALE_P2\n    rshrn2          v18.8h, v24.4s, #DESCALE_P2  /* dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, XFIX_P_0_765), CONST_BITS-PASS1_BITS); */\n    rshrn2          v22.8h, v25.4s, #DESCALE_P2  /* dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, XFIX_N_1_847), CONST_BITS-PASS1_BITS); */\n\n    /* Odd part */\n    add             v8.8h, v28.8h, v31.8h   /* z1 = tmp4 + tmp7; */\n    add             v9.8h, v29.8h, v30.8h   /* z2 = tmp5 + tmp6; */\n    add             v10.8h, v28.8h, v30.8h  /* z3 = tmp4 + tmp6; */\n    add             v11.8h, v29.8h, v31.8h  /* z4 = tmp5 + tmp7; */\n\n    smull           v4.4s, v10.4h, XFIX_P_1_175  /* z5 lo = z3 lo * XFIX_P_1_175 */\n    smull2          v5.4s, v10.8h, XFIX_P_1_175\n    smlal           v4.4s, v11.4h, XFIX_P_1_175  /* z5 = MULTIPLY(z3 + z4, FIX_1_175875602); */\n    smlal2          v5.4s, v11.8h, XFIX_P_1_175\n\n    smull2          v24.4s, v28.8h, XFIX_P_0_298\n    smull2          v25.4s, v29.8h, XFIX_P_2_053\n    smull2          v26.4s, v30.8h, XFIX_P_3_072\n    smull2          v27.4s, v31.8h, XFIX_P_1_501\n    smull           v28.4s, v28.4h, XFIX_P_0_298  /* tmp4 = MULTIPLY(tmp4, FIX_0_298631336); */\n    smull           v29.4s, v29.4h, XFIX_P_2_053  /* tmp5 = MULTIPLY(tmp5, FIX_2_053119869); */\n    smull           v30.4s, v30.4h, XFIX_P_3_072  /* tmp6 = MULTIPLY(tmp6, FIX_3_072711026); */\n    smull           v31.4s, v31.4h, XFIX_P_1_501  /* tmp7 = MULTIPLY(tmp7, FIX_1_501321110); */\n\n    smull2          v12.4s, v8.8h, XFIX_N_0_899\n    smull2          v13.4s, v9.8h, XFIX_N_2_562\n    smull2          v14.4s, v10.8h, XFIX_N_1_961\n    smull2          v15.4s, v11.8h, XFIX_N_0_390\n    smull           v8.4s, v8.4h, XFIX_N_0_899    /* z1 = MULTIPLY(z1, - FIX_0_899976223); */\n    smull           v9.4s, v9.4h, XFIX_N_2_562    /* z2 = MULTIPLY(z2, - FIX_2_562915447); */\n    smull           v10.4s, v10.4h, XFIX_N_1_961  /* z3 = MULTIPLY(z3, - FIX_1_961570560); */\n    smull           v11.4s, v11.4h, XFIX_N_0_390  /* z4 = MULTIPLY(z4, - FIX_0_390180644); */\n\n    add             v10.4s, v10.4s, v4.4s\n    add             v14.4s, v14.4s, v5.4s\n    add             v11.4s, v11.4s, v4.4s\n    add             v15.4s, v15.4s, v5.4s\n\n    add             v28.4s, v28.4s, v8.4s   /* tmp4 += z1 */\n    add             v24.4s, v24.4s, v12.4s\n    add             v29.4s, v29.4s, v9.4s   /* tmp5 += z2 */\n    add             v25.4s, v25.4s, v13.4s\n    add             v30.4s, v30.4s, v10.4s  /* tmp6 += z3 */\n    add             v26.4s, v26.4s, v14.4s\n    add             v31.4s, v31.4s, v11.4s  /* tmp7 += z4 */\n    add             v27.4s, v27.4s, v15.4s\n\n    add             v28.4s, v28.4s, v10.4s  /* tmp4 += z3 */\n    add             v24.4s, v24.4s, v14.4s\n    add             v29.4s, v29.4s, v11.4s  /* tmp5 += z4 */\n    add             v25.4s, v25.4s, v15.4s\n    add             v30.4s, v30.4s, v9.4s   /* tmp6 += z2 */\n    add             v26.4s, v26.4s, v13.4s\n    add             v31.4s, v31.4s, v8.4s   /* tmp7 += z1 */\n    add             v27.4s, v27.4s, v12.4s\n\n    rshrn           v23.4h, v28.4s, #DESCALE_P2\n    rshrn           v21.4h, v29.4s, #DESCALE_P2\n    rshrn           v19.4h, v30.4s, #DESCALE_P2\n    rshrn           v17.4h, v31.4s, #DESCALE_P2\n    rshrn2          v23.8h, v24.4s, #DESCALE_P2  /* dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); */\n    rshrn2          v21.8h, v25.4s, #DESCALE_P2  /* dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); */\n    rshrn2          v19.8h, v26.4s, #DESCALE_P2  /* dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); */\n    rshrn2          v17.8h, v27.4s, #DESCALE_P2  /* dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); */\n\n    /* store results */\n    st1             {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64\n    st1             {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA]\n\n    /* Restore NEON registers */\n    sub             sp, sp, #64\n    ld1             {v8.8b, v9.8b, v10.8b, v11.8b}, [sp], 32\n    ld1             {v12.8b, v13.8b, v14.8b, v15.8b}, [sp], 32\n\n    br              x30\n\n    .unreq          DATA\n    .unreq          TMP\n\n#undef XFIX_P_0_298\n#undef XFIX_N_0_390\n#undef XFIX_P_0_541\n#undef XFIX_P_0_765\n#undef XFIX_N_0_899\n#undef XFIX_P_1_175\n#undef XFIX_P_1_501\n#undef XFIX_N_1_847\n#undef XFIX_N_1_961\n#undef XFIX_P_2_053\n#undef XFIX_N_2_562\n#undef XFIX_P_3_072\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_fdct_ifast_neon\n *\n * This function contains a fast, not so accurate integer implementation of\n * the forward DCT (Discrete Cosine Transform). It uses the same calculations\n * and produces exactly the same output as IJG's original 'jpeg_fdct_ifast'\n * function from jfdctfst.c\n *\n * TODO: can be combined with 'jsimd_convsamp_neon' to get\n *       rid of a bunch of VLD1.16 instructions\n */\n\n#undef XFIX_0_541196100\n#define XFIX_0_382683433 v0.h[0]\n#define XFIX_0_541196100 v0.h[1]\n#define XFIX_0_707106781 v0.h[2]\n#define XFIX_1_306562965 v0.h[3]\n\n.balign 16\nLjsimd_fdct_ifast_neon_consts:\n  .short (98 * 128)               /* XFIX_0_382683433 */\n  .short (139 * 128)              /* XFIX_0_541196100 */\n  .short (181 * 128)              /* XFIX_0_707106781 */\n  .short (334 * 128 - 256 * 128)  /* XFIX_1_306562965 */\n\nasm_function jsimd_fdct_ifast_neon\n\n    DATA            .req x0\n    TMP             .req x9\n\n    /* Load constants */\n    adr             TMP, Ljsimd_fdct_ifast_neon_consts\n    ld1             {v0.4h}, [TMP]\n\n    /* Load all DATA into NEON registers with the following allocation:\n     *       0 1 2 3 | 4 5 6 7\n     *      ---------+--------\n     *   0 | d16     | d17    | v0.8h\n     *   1 | d18     | d19    | q9\n     *   2 | d20     | d21    | q10\n     *   3 | d22     | d23    | q11\n     *   4 | d24     | d25    | q12\n     *   5 | d26     | d27    | q13\n     *   6 | d28     | d29    | q14\n     *   7 | d30     | d31    | q15\n     */\n\n    ld1             {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64\n    ld1             {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA]\n    mov             TMP, #2\n    sub             DATA, DATA, #64\n1:\n    /* Transpose */\n    transpose_8x8   v16, v17, v18, v19, v20, v21, v22, v23, v1, v2, v3, v4\n    subs            TMP, TMP, #1\n    /* 1-D FDCT */\n    add             v4.8h, v19.8h, v20.8h\n    sub             v20.8h, v19.8h, v20.8h\n    sub             v28.8h, v18.8h, v21.8h\n    add             v18.8h, v18.8h, v21.8h\n    sub             v29.8h, v17.8h, v22.8h\n    add             v17.8h, v17.8h, v22.8h\n    sub             v21.8h, v16.8h, v23.8h\n    add             v16.8h, v16.8h, v23.8h\n    sub             v6.8h, v17.8h, v18.8h\n    sub             v7.8h, v16.8h, v4.8h\n    add             v5.8h, v17.8h, v18.8h\n    add             v6.8h, v6.8h, v7.8h\n    add             v4.8h, v16.8h, v4.8h\n    sqdmulh         v6.8h, v6.8h, XFIX_0_707106781\n    add             v19.8h, v20.8h, v28.8h\n    add             v16.8h, v4.8h, v5.8h\n    sub             v20.8h, v4.8h, v5.8h\n    add             v5.8h, v28.8h, v29.8h\n    add             v29.8h, v29.8h, v21.8h\n    sqdmulh         v5.8h, v5.8h, XFIX_0_707106781\n    sub             v28.8h, v19.8h, v29.8h\n    add             v18.8h, v7.8h, v6.8h\n    sqdmulh         v28.8h, v28.8h, XFIX_0_382683433\n    sub             v22.8h, v7.8h, v6.8h\n    sqdmulh         v19.8h, v19.8h, XFIX_0_541196100\n    sqdmulh         v7.8h, v29.8h, XFIX_1_306562965\n    add             v6.8h, v21.8h, v5.8h\n    sub             v5.8h, v21.8h, v5.8h\n    add             v29.8h, v29.8h, v28.8h\n    add             v19.8h, v19.8h, v28.8h\n    add             v29.8h, v29.8h, v7.8h\n    add             v21.8h, v5.8h, v19.8h\n    sub             v19.8h, v5.8h, v19.8h\n    add             v17.8h, v6.8h, v29.8h\n    sub             v23.8h, v6.8h, v29.8h\n\n    b.ne            1b\n\n    /* store results */\n    st1             {v16.8h, v17.8h, v18.8h, v19.8h}, [DATA], 64\n    st1             {v20.8h, v21.8h, v22.8h, v23.8h}, [DATA]\n\n    br              x30\n\n    .unreq          DATA\n    .unreq          TMP\n#undef XFIX_0_382683433\n#undef XFIX_0_541196100\n#undef XFIX_0_707106781\n#undef XFIX_1_306562965\n\n\n/*****************************************************************************/\n\n/*\n * GLOBAL(void)\n * jsimd_quantize_neon (JCOEFPTR coef_block, DCTELEM *divisors,\n *                      DCTELEM *workspace);\n *\n */\nasm_function jsimd_quantize_neon\n\n    COEF_BLOCK      .req x0\n    DIVISORS        .req x1\n    WORKSPACE       .req x2\n\n    RECIPROCAL      .req DIVISORS\n    CORRECTION      .req x9\n    SHIFT           .req x10\n    LOOP_COUNT      .req x11\n\n    mov             LOOP_COUNT, #2\n    add             CORRECTION, DIVISORS, #(64 * 2)\n    add             SHIFT, DIVISORS, #(64 * 6)\n1:\n    subs            LOOP_COUNT, LOOP_COUNT, #1\n    ld1             {v0.8h, v1.8h, v2.8h, v3.8h}, [WORKSPACE], 64\n    ld1             {v4.8h, v5.8h, v6.8h, v7.8h}, [CORRECTION], 64\n    abs             v20.8h, v0.8h\n    abs             v21.8h, v1.8h\n    abs             v22.8h, v2.8h\n    abs             v23.8h, v3.8h\n    ld1             {v28.8h, v29.8h, v30.8h, v31.8h}, [RECIPROCAL], 64\n    add             v20.8h, v20.8h, v4.8h  /* add correction */\n    add             v21.8h, v21.8h, v5.8h\n    add             v22.8h, v22.8h, v6.8h\n    add             v23.8h, v23.8h, v7.8h\n    umull           v4.4s, v20.4h, v28.4h  /* multiply by reciprocal */\n    umull2          v16.4s, v20.8h, v28.8h\n    umull           v5.4s, v21.4h, v29.4h\n    umull2          v17.4s, v21.8h, v29.8h\n    umull           v6.4s, v22.4h, v30.4h  /* multiply by reciprocal */\n    umull2          v18.4s, v22.8h, v30.8h\n    umull           v7.4s, v23.4h, v31.4h\n    umull2          v19.4s, v23.8h, v31.8h\n    ld1             {v24.8h, v25.8h, v26.8h, v27.8h}, [SHIFT], 64\n    shrn            v4.4h, v4.4s, #16\n    shrn            v5.4h, v5.4s, #16\n    shrn            v6.4h, v6.4s, #16\n    shrn            v7.4h, v7.4s, #16\n    shrn2           v4.8h, v16.4s, #16\n    shrn2           v5.8h, v17.4s, #16\n    shrn2           v6.8h, v18.4s, #16\n    shrn2           v7.8h, v19.4s, #16\n    neg             v24.8h, v24.8h\n    neg             v25.8h, v25.8h\n    neg             v26.8h, v26.8h\n    neg             v27.8h, v27.8h\n    sshr            v0.8h, v0.8h, #15  /* extract sign */\n    sshr            v1.8h, v1.8h, #15\n    sshr            v2.8h, v2.8h, #15\n    sshr            v3.8h, v3.8h, #15\n    ushl            v4.8h, v4.8h, v24.8h  /* shift */\n    ushl            v5.8h, v5.8h, v25.8h\n    ushl            v6.8h, v6.8h, v26.8h\n    ushl            v7.8h, v7.8h, v27.8h\n\n    eor             v4.16b, v4.16b, v0.16b  /* restore sign */\n    eor             v5.16b, v5.16b, v1.16b\n    eor             v6.16b, v6.16b, v2.16b\n    eor             v7.16b, v7.16b, v3.16b\n    sub             v4.8h, v4.8h, v0.8h\n    sub             v5.8h, v5.8h, v1.8h\n    sub             v6.8h, v6.8h, v2.8h\n    sub             v7.8h, v7.8h, v3.8h\n    st1             {v4.8h, v5.8h, v6.8h, v7.8h}, [COEF_BLOCK], 64\n\n    b.ne            1b\n\n    br              x30  /* return */\n\n    .unreq          COEF_BLOCK\n    .unreq          DIVISORS\n    .unreq          WORKSPACE\n    .unreq          RECIPROCAL\n    .unreq          CORRECTION\n    .unreq          SHIFT\n    .unreq          LOOP_COUNT\n\n\n/*****************************************************************************/\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the common case of 2:1 horizontal and 1:1 vertical,\n * without smoothing.\n *\n * GLOBAL(void)\n * jsimd_h2v1_downsample_neon (JDIMENSION image_width, int max_v_samp_factor,\n *                             JDIMENSION v_samp_factor,\n *                             JDIMENSION width_blocks, JSAMPARRAY input_data,\n *                             JSAMPARRAY output_data);\n */\n\n.balign 16\nLjsimd_h2_downsample_neon_consts:\n  .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \\\n        0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F  /* diff 0 */\n  .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \\\n        0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0E  /* diff 1 */\n  .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \\\n        0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0D, 0x0D  /* diff 2 */\n  .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \\\n        0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0C, 0x0C, 0x0C  /* diff 3 */\n  .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \\\n        0x08, 0x09, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B  /* diff 4 */\n  .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \\\n        0x08, 0x09, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A  /* diff 5 */\n  .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \\\n        0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09  /* diff 6 */\n  .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \\\n        0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08  /* diff 7 */\n  .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, \\\n        0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07  /* diff 8 */\n  .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, \\\n        0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06  /* diff 9 */\n  .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, \\\n        0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05  /* diff 10 */\n  .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x04, \\\n        0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04  /* diff 11 */\n  .byte 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, \\\n        0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03  /* diff 12 */\n  .byte 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, \\\n        0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02  /* diff 13 */\n  .byte 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, \\\n        0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01  /* diff 14 */\n  .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \\\n        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  /* diff 15 */\n\nasm_function jsimd_h2v1_downsample_neon\n    IMAGE_WIDTH     .req x0\n    MAX_V_SAMP      .req x1\n    V_SAMP          .req x2\n    BLOCK_WIDTH     .req x3\n    INPUT_DATA      .req x4\n    OUTPUT_DATA     .req x5\n    OUTPTR          .req x9\n    INPTR           .req x10\n    TMP1            .req x11\n    TMP2            .req x12\n    TMP3            .req x13\n    TMPDUP          .req w15\n\n    mov             TMPDUP, #0x10000\n    lsl             TMP2, BLOCK_WIDTH, #4\n    sub             TMP2, TMP2, IMAGE_WIDTH\n    adr             TMP3, Ljsimd_h2_downsample_neon_consts\n    add             TMP3, TMP3, TMP2, lsl #4\n    dup             v16.4s, TMPDUP\n    ld1             {v18.16b}, [TMP3]\n\n1:  /* row loop */\n    ldr             INPTR, [INPUT_DATA], #8\n    ldr             OUTPTR, [OUTPUT_DATA], #8\n    subs            TMP1, BLOCK_WIDTH, #1\n    b.eq            3f\n2:  /* columns */\n    ld1             {v0.16b}, [INPTR], #16\n    mov             v4.16b, v16.16b\n    subs            TMP1, TMP1, #1\n    uadalp          v4.8h, v0.16b\n    shrn            v6.8b, v4.8h, #1\n    st1             {v6.8b}, [OUTPTR], #8\n    b.ne            2b\n3:  /* last columns */\n    ld1             {v0.16b}, [INPTR]\n    mov             v4.16b, v16.16b\n    subs            V_SAMP, V_SAMP, #1\n    /* expand right */\n    tbl             v2.16b, {v0.16b}, v18.16b\n    uadalp          v4.8h, v2.16b\n    shrn            v6.8b, v4.8h, #1\n    st1             {v6.8b}, [OUTPTR], #8\n    b.ne            1b\n\n    br              x30\n\n    .unreq          IMAGE_WIDTH\n    .unreq          MAX_V_SAMP\n    .unreq          V_SAMP\n    .unreq          BLOCK_WIDTH\n    .unreq          INPUT_DATA\n    .unreq          OUTPUT_DATA\n    .unreq          OUTPTR\n    .unreq          INPTR\n    .unreq          TMP1\n    .unreq          TMP2\n    .unreq          TMP3\n    .unreq          TMPDUP\n\n\n/*****************************************************************************/\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the common case of 2:1 horizontal and 2:1 vertical,\n * without smoothing.\n *\n * GLOBAL(void)\n * jsimd_h2v2_downsample_neon (JDIMENSION image_width, int max_v_samp_factor,\n *                             JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n *                             JSAMPARRAY input_data, JSAMPARRAY output_data);\n */\n\n.balign 16\nasm_function jsimd_h2v2_downsample_neon\n    IMAGE_WIDTH     .req x0\n    MAX_V_SAMP      .req x1\n    V_SAMP          .req x2\n    BLOCK_WIDTH     .req x3\n    INPUT_DATA      .req x4\n    OUTPUT_DATA     .req x5\n    OUTPTR          .req x9\n    INPTR0          .req x10\n    INPTR1          .req x14\n    TMP1            .req x11\n    TMP2            .req x12\n    TMP3            .req x13\n    TMPDUP          .req w15\n\n    mov             TMPDUP, #1\n    lsl             TMP2, BLOCK_WIDTH, #4\n    lsl             TMPDUP, TMPDUP, #17\n    sub             TMP2, TMP2, IMAGE_WIDTH\n    adr             TMP3, Ljsimd_h2_downsample_neon_consts\n    orr             TMPDUP, TMPDUP, #1\n    add             TMP3, TMP3, TMP2, lsl #4\n    dup             v16.4s, TMPDUP\n    ld1             {v18.16b}, [TMP3]\n\n1:  /* row loop */\n    ldr             INPTR0, [INPUT_DATA], #8\n    ldr             OUTPTR, [OUTPUT_DATA], #8\n    ldr             INPTR1, [INPUT_DATA], #8\n    subs            TMP1, BLOCK_WIDTH, #1\n    b.eq            3f\n2:  /* columns */\n    ld1             {v0.16b}, [INPTR0], #16\n    ld1             {v1.16b}, [INPTR1], #16\n    mov             v4.16b, v16.16b\n    subs            TMP1, TMP1, #1\n    uadalp          v4.8h, v0.16b\n    uadalp          v4.8h, v1.16b\n    shrn            v6.8b, v4.8h, #2\n    st1             {v6.8b}, [OUTPTR], #8\n    b.ne            2b\n3:  /* last columns */\n    ld1             {v0.16b}, [INPTR0], #16\n    ld1             {v1.16b}, [INPTR1], #16\n    mov             v4.16b, v16.16b\n    subs            V_SAMP, V_SAMP, #1\n    /* expand right */\n    tbl             v2.16b, {v0.16b}, v18.16b\n    tbl             v3.16b, {v1.16b}, v18.16b\n    uadalp          v4.8h, v2.16b\n    uadalp          v4.8h, v3.16b\n    shrn            v6.8b, v4.8h, #2\n    st1             {v6.8b}, [OUTPTR], #8\n    b.ne            1b\n\n    br              x30\n\n    .unreq          IMAGE_WIDTH\n    .unreq          MAX_V_SAMP\n    .unreq          V_SAMP\n    .unreq          BLOCK_WIDTH\n    .unreq          INPUT_DATA\n    .unreq          OUTPUT_DATA\n    .unreq          OUTPTR\n    .unreq          INPTR0\n    .unreq          INPTR1\n    .unreq          TMP1\n    .unreq          TMP2\n    .unreq          TMP3\n    .unreq          TMPDUP\n\n\n/*****************************************************************************/\n\n/*\n * GLOBAL(JOCTET*)\n * jsimd_huff_encode_one_block (working_state *state, JOCTET *buffer,\n *                              JCOEFPTR block, int last_dc_val,\n *                              c_derived_tbl *dctbl, c_derived_tbl *actbl)\n *\n */\n\n    BUFFER          .req x1\n    PUT_BUFFER      .req x6\n    PUT_BITS        .req x7\n    PUT_BITSw       .req w7\n\n.macro emit_byte\n    sub             PUT_BITS, PUT_BITS, #0x8\n    lsr             x19, PUT_BUFFER, PUT_BITS\n    uxtb            w19, w19\n    strb            w19, [BUFFER, #1]!\n    cmp             w19, #0xff\n    b.ne            14f\n    strb            wzr, [BUFFER, #1]!\n14:\n.endm\n.macro put_bits CODE, SIZE\n    lsl             PUT_BUFFER, PUT_BUFFER, \\SIZE\n    add             PUT_BITS, PUT_BITS, \\SIZE\n    orr             PUT_BUFFER, PUT_BUFFER, \\CODE\n.endm\n.macro checkbuf31\n    cmp             PUT_BITS, #0x20\n    b.lt            31f\n    emit_byte\n    emit_byte\n    emit_byte\n    emit_byte\n31:\n.endm\n.macro checkbuf47\n    cmp             PUT_BITS, #0x30\n    b.lt            47f\n    emit_byte\n    emit_byte\n    emit_byte\n    emit_byte\n    emit_byte\n    emit_byte\n47:\n.endm\n\n.macro generate_jsimd_huff_encode_one_block fast_tbl\n\n.balign 16\n.if \\fast_tbl == 1\nLjsimd_huff_encode_one_block_neon_consts:\n.else\nLjsimd_huff_encode_one_block_neon_slowtbl_consts:\n.endif\n    .byte 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, \\\n          0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80\n.if \\fast_tbl == 1\n    .byte    0,   1,   2,   3,  16,  17,  32,  33, \\\n            18,  19,   4,   5,   6,   7,  20,  21  /* L0 => L3 : 4 lines OK */\n    .byte   34,  35,  48,  49, 255, 255,  50,  51, \\\n            36,  37,  22,  23,   8,   9,  10,  11  /* L0 => L3 : 4 lines OK */\n    .byte    8,   9,  22,  23,  36,  37,  50,  51, \\\n           255, 255, 255, 255, 255, 255,  52,  53  /* L1 => L4 : 4 lines OK */\n    .byte   54,  55,  40,  41,  26,  27,  12,  13, \\\n            14,  15,  28,  29,  42,  43,  56,  57  /* L0 => L3 : 4 lines OK */\n    .byte    6,   7,  20,  21,  34,  35,  48,  49, \\\n            50,  51,  36,  37,  22,  23,   8,   9  /* L4 => L7 : 4 lines OK */\n    .byte   42,  43,  28,  29,  14,  15,  30,  31, \\\n            44,  45,  58,  59, 255, 255, 255, 255  /* L1 => L4 : 4 lines OK */\n    .byte  255, 255, 255, 255,  56,  57,  42,  43, \\\n            28,  29,  14,  15,  30,  31,  44,  45  /* L3 => L6 : 4 lines OK */\n    .byte   26,  27,  40,  41,  42,  43,  28,  29, \\\n            14,  15,  30,  31,  44,  45,  46,  47  /* L5 => L7 : 3 lines OK */\n    .byte  255, 255, 255, 255,   0,   1, 255, 255, \\\n           255, 255, 255, 255, 255, 255, 255, 255  /* L4 : 1 lines OK */\n    .byte  255, 255, 255, 255, 255, 255, 255, 255, \\\n             0,   1,  16,  17,   2,   3, 255, 255  /* L5 => L6 : 2 lines OK */\n    .byte  255, 255, 255, 255, 255, 255, 255, 255, \\\n           255, 255, 255, 255,   8,   9,  22,  23  /* L5 => L6 : 2 lines OK */\n    .byte    4,   5,   6,   7, 255, 255, 255, 255, \\\n           255, 255, 255, 255, 255, 255, 255, 255  /* L7 : 1 line OK */\n.endif\n\n.if \\fast_tbl == 1\nasm_function jsimd_huff_encode_one_block_neon\n.else\nasm_function jsimd_huff_encode_one_block_neon_slowtbl\n.endif\n    sub             sp, sp, 272\n    sub             BUFFER, BUFFER, #0x1    /* BUFFER=buffer-- */\n    /* Save ARM registers */\n    stp             x19, x20, [sp], 16\n.if \\fast_tbl == 1\n    adr             x15, Ljsimd_huff_encode_one_block_neon_consts\n.else\n    adr             x15, Ljsimd_huff_encode_one_block_neon_slowtbl_consts\n.endif\n    ldr             PUT_BUFFER, [x0, #0x10]\n    ldr             PUT_BITSw, [x0, #0x18]\n    ldrsh           w12, [x2]               /* load DC coeff in w12 */\n    /* prepare data */\n.if \\fast_tbl == 1\n    ld1             {v23.16b}, [x15], #16\n    ld1             {v0.16b, v1.16b, v2.16b, v3.16b}, [x15], #64\n    ld1             {v4.16b, v5.16b, v6.16b, v7.16b}, [x15], #64\n    ld1             {v16.16b, v17.16b, v18.16b, v19.16b}, [x15], #64\n    ld1             {v24.16b, v25.16b, v26.16b, v27.16b}, [x2], #64\n    ld1             {v28.16b, v29.16b, v30.16b, v31.16b}, [x2], #64\n    sub             w12, w12, w3      /* last_dc_val, not used afterwards */\n    /* ZigZag 8x8 */\n    tbl             v0.16b, {v24.16b, v25.16b, v26.16b, v27.16b}, v0.16b\n    tbl             v1.16b, {v24.16b, v25.16b, v26.16b, v27.16b}, v1.16b\n    tbl             v2.16b, {v25.16b, v26.16b, v27.16b, v28.16b}, v2.16b\n    tbl             v3.16b, {v24.16b, v25.16b, v26.16b, v27.16b}, v3.16b\n    tbl             v4.16b, {v28.16b, v29.16b, v30.16b, v31.16b}, v4.16b\n    tbl             v5.16b, {v25.16b, v26.16b, v27.16b, v28.16b}, v5.16b\n    tbl             v6.16b, {v27.16b, v28.16b, v29.16b, v30.16b}, v6.16b\n    tbl             v7.16b, {v29.16b, v30.16b, v31.16b}, v7.16b\n    ins             v0.h[0], w12\n    tbx             v1.16b, {v28.16b}, v16.16b\n    tbx             v2.16b, {v29.16b, v30.16b}, v17.16b\n    tbx             v5.16b, {v29.16b, v30.16b}, v18.16b\n    tbx             v6.16b, {v31.16b}, v19.16b\n.else\n      add             x13, x2, #0x22\n      sub             w12, w12, w3    /* last_dc_val, not used afterwards */\n    ld1             {v23.16b}, [x15]\n      add             x14, x2, #0x18\n      add             x3, x2, #0x36\n    ins             v0.h[0], w12\n      add             x9, x2, #0x2\n    ld1             {v1.h}[0], [x13]\n      add             x15, x2, #0x30\n    ld1             {v2.h}[0], [x14]\n      add             x19, x2, #0x26\n    ld1             {v3.h}[0], [x3]\n      add             x20, x2, #0x28\n    ld1             {v0.h}[1], [x9]\n      add             x12, x2, #0x10\n    ld1             {v1.h}[1], [x15]\n      add             x13, x2, #0x40\n    ld1             {v2.h}[1], [x19]\n      add             x14, x2, #0x34\n    ld1             {v3.h}[1], [x20]\n      add             x3, x2, #0x1a\n    ld1             {v0.h}[2], [x12]\n      add             x9, x2, #0x20\n    ld1             {v1.h}[2], [x13]\n      add             x15, x2, #0x32\n    ld1             {v2.h}[2], [x14]\n      add             x19, x2, #0x42\n    ld1             {v3.h}[2], [x3]\n      add             x20, x2, #0xc\n    ld1             {v0.h}[3], [x9]\n      add             x12, x2, #0x12\n    ld1             {v1.h}[3], [x15]\n      add             x13, x2, #0x24\n    ld1             {v2.h}[3], [x19]\n      add             x14, x2, #0x50\n    ld1             {v3.h}[3], [x20]\n      add             x3, x2, #0xe\n    ld1             {v0.h}[4], [x12]\n      add             x9, x2, #0x4\n    ld1             {v1.h}[4], [x13]\n      add             x15, x2, #0x16\n    ld1             {v2.h}[4], [x14]\n      add             x19, x2, #0x60\n    ld1             {v3.h}[4], [x3]\n      add             x20, x2, #0x1c\n    ld1             {v0.h}[5], [x9]\n      add             x12, x2, #0x6\n    ld1             {v1.h}[5], [x15]\n      add             x13, x2, #0x8\n    ld1             {v2.h}[5], [x19]\n      add             x14, x2, #0x52\n    ld1             {v3.h}[5], [x20]\n      add             x3, x2, #0x2a\n    ld1             {v0.h}[6], [x12]\n      add             x9, x2, #0x14\n    ld1             {v1.h}[6], [x13]\n      add             x15, x2, #0xa\n    ld1             {v2.h}[6], [x14]\n      add             x19, x2, #0x44\n    ld1             {v3.h}[6], [x3]\n      add             x20, x2, #0x38\n    ld1             {v0.h}[7], [x9]\n      add             x12, x2, #0x46\n    ld1             {v1.h}[7], [x15]\n      add             x13, x2, #0x3a\n    ld1             {v2.h}[7], [x19]\n      add             x14, x2, #0x74\n    ld1             {v3.h}[7], [x20]\n      add             x3, x2, #0x6a\n    ld1             {v4.h}[0], [x12]\n      add             x9, x2, #0x54\n    ld1             {v5.h}[0], [x13]\n      add             x15, x2, #0x2c\n    ld1             {v6.h}[0], [x14]\n      add             x19, x2, #0x76\n    ld1             {v7.h}[0], [x3]\n      add             x20, x2, #0x78\n    ld1             {v4.h}[1], [x9]\n      add             x12, x2, #0x62\n    ld1             {v5.h}[1], [x15]\n      add             x13, x2, #0x1e\n    ld1             {v6.h}[1], [x19]\n      add             x14, x2, #0x68\n    ld1             {v7.h}[1], [x20]\n      add             x3, x2, #0x7a\n    ld1             {v4.h}[2], [x12]\n      add             x9, x2, #0x70\n    ld1             {v5.h}[2], [x13]\n      add             x15, x2, #0x2e\n    ld1             {v6.h}[2], [x14]\n      add             x19, x2, #0x5a\n    ld1             {v7.h}[2], [x3]\n      add             x20, x2, #0x6c\n    ld1             {v4.h}[3], [x9]\n      add             x12, x2, #0x72\n    ld1             {v5.h}[3], [x15]\n      add             x13, x2, #0x3c\n    ld1             {v6.h}[3], [x19]\n      add             x14, x2, #0x4c\n    ld1             {v7.h}[3], [x20]\n      add             x3, x2, #0x5e\n    ld1             {v4.h}[4], [x12]\n      add             x9, x2, #0x64\n    ld1             {v5.h}[4], [x13]\n      add             x15, x2, #0x4a\n    ld1             {v6.h}[4], [x14]\n      add             x19, x2, #0x3e\n    ld1             {v7.h}[4], [x3]\n      add             x20, x2, #0x6e\n    ld1             {v4.h}[5], [x9]\n      add             x12, x2, #0x56\n    ld1             {v5.h}[5], [x15]\n      add             x13, x2, #0x58\n    ld1             {v6.h}[5], [x19]\n      add             x14, x2, #0x4e\n    ld1             {v7.h}[5], [x20]\n      add             x3, x2, #0x7c\n    ld1             {v4.h}[6], [x12]\n      add             x9, x2, #0x48\n    ld1             {v5.h}[6], [x13]\n      add             x15, x2, #0x66\n    ld1             {v6.h}[6], [x14]\n      add             x19, x2, #0x5c\n    ld1             {v7.h}[6], [x3]\n      add             x20, x2, #0x7e\n    ld1             {v4.h}[7], [x9]\n    ld1             {v5.h}[7], [x15]\n    ld1             {v6.h}[7], [x19]\n    ld1             {v7.h}[7], [x20]\n.endif\n    cmlt            v24.8h, v0.8h, #0\n    cmlt            v25.8h, v1.8h, #0\n    cmlt            v26.8h, v2.8h, #0\n    cmlt            v27.8h, v3.8h, #0\n    cmlt            v28.8h, v4.8h, #0\n    cmlt            v29.8h, v5.8h, #0\n    cmlt            v30.8h, v6.8h, #0\n    cmlt            v31.8h, v7.8h, #0\n    abs             v0.8h, v0.8h\n    abs             v1.8h, v1.8h\n    abs             v2.8h, v2.8h\n    abs             v3.8h, v3.8h\n    abs             v4.8h, v4.8h\n    abs             v5.8h, v5.8h\n    abs             v6.8h, v6.8h\n    abs             v7.8h, v7.8h\n    eor             v24.16b, v24.16b, v0.16b\n    eor             v25.16b, v25.16b, v1.16b\n    eor             v26.16b, v26.16b, v2.16b\n    eor             v27.16b, v27.16b, v3.16b\n    eor             v28.16b, v28.16b, v4.16b\n    eor             v29.16b, v29.16b, v5.16b\n    eor             v30.16b, v30.16b, v6.16b\n    eor             v31.16b, v31.16b, v7.16b\n    cmeq            v16.8h, v0.8h, #0\n    cmeq            v17.8h, v1.8h, #0\n    cmeq            v18.8h, v2.8h, #0\n    cmeq            v19.8h, v3.8h, #0\n    cmeq            v20.8h, v4.8h, #0\n    cmeq            v21.8h, v5.8h, #0\n    cmeq            v22.8h, v6.8h, #0\n    xtn             v16.8b, v16.8h\n    xtn             v18.8b, v18.8h\n    xtn             v20.8b, v20.8h\n    xtn             v22.8b, v22.8h\n      umov            w14, v0.h[0]\n    xtn2            v16.16b, v17.8h\n      umov            w13, v24.h[0]\n    xtn2            v18.16b, v19.8h\n      clz             w14, w14\n    xtn2            v20.16b, v21.8h\n      lsl             w13, w13, w14\n    cmeq            v17.8h, v7.8h, #0\n      sub             w12, w14, #32\n    xtn2            v22.16b, v17.8h\n      lsr             w13, w13, w14\n    and             v16.16b, v16.16b, v23.16b\n      neg             w12, w12\n    and             v18.16b, v18.16b, v23.16b\n      add             x3, x4, #0x400           /* r1 = dctbl->ehufsi */\n    and             v20.16b, v20.16b, v23.16b\n      add             x15, sp, #0x80           /* x15 = t2 */\n    and             v22.16b, v22.16b, v23.16b\n      ldr             w10, [x4, x12, lsl #2]\n    addp            v16.16b, v16.16b, v18.16b\n      ldrb            w11, [x3, x12]\n    addp            v20.16b, v20.16b, v22.16b\n      checkbuf47\n    addp            v16.16b, v16.16b, v20.16b\n      put_bits        x10, x11\n    addp            v16.16b, v16.16b, v18.16b\n      checkbuf47\n    umov            x9,v16.D[0]\n      put_bits        x13, x12\n    cnt             v17.8b, v16.8b\n      mvn             x9, x9\n    addv            B18, v17.8b\n      add             x4, x5, #0x400   /* x4 = actbl->ehufsi */\n    umov            w12, v18.b[0]\n      lsr             x9, x9, #0x1     /* clear AC coeff */\n    ldr             w13, [x5, #0x3c0]  /* x13 = actbl->ehufco[0xf0] */\n    rbit            x9, x9             /* x9 = index0 */\n    ldrb            w14, [x4, #0xf0]   /* x14 = actbl->ehufsi[0xf0] */\n    cmp             w12, #(64-8)\n    mov             x11, sp\n    b.lt            4f\n    cbz             x9, 6f\n    st1             {v0.8h, v1.8h, v2.8h, v3.8h}, [x11], #64\n    st1             {v4.8h, v5.8h, v6.8h, v7.8h}, [x11], #64\n    st1             {v24.8h, v25.8h, v26.8h, v27.8h}, [x11], #64\n    st1             {v28.8h, v29.8h, v30.8h, v31.8h}, [x11], #64\n1:\n    clz             x2, x9\n    add             x15, x15, x2, lsl #1\n    lsl             x9, x9, x2\n    ldrh            w20, [x15, #-126]\n2:\n    cmp             x2, #0x10\n    b.lt            3f\n    sub             x2, x2, #0x10\n    checkbuf47\n    put_bits        x13, x14\n    b               2b\n3:\n    clz             w20, w20\n    ldrh            w3, [x15, #2]!\n    sub             w11, w20, #32\n    lsl             w3, w3, w20\n    neg             w11, w11\n    lsr             w3, w3, w20\n    add             x2, x11, x2, lsl #4\n    lsl             x9, x9, #0x1\n    ldr             w12, [x5, x2, lsl #2]\n    ldrb            w10, [x4, x2]\n    checkbuf31\n    put_bits        x12, x10\n    put_bits        x3, x11\n    cbnz            x9, 1b\n    b               6f\n4:\n    movi            v21.8h, #0x0010\n    clz             v0.8h, v0.8h\n    clz             v1.8h, v1.8h\n    clz             v2.8h, v2.8h\n    clz             v3.8h, v3.8h\n    clz             v4.8h, v4.8h\n    clz             v5.8h, v5.8h\n    clz             v6.8h, v6.8h\n    clz             v7.8h, v7.8h\n    ushl            v24.8h, v24.8h, v0.8h\n    ushl            v25.8h, v25.8h, v1.8h\n    ushl            v26.8h, v26.8h, v2.8h\n    ushl            v27.8h, v27.8h, v3.8h\n    ushl            v28.8h, v28.8h, v4.8h\n    ushl            v29.8h, v29.8h, v5.8h\n    ushl            v30.8h, v30.8h, v6.8h\n    ushl            v31.8h, v31.8h, v7.8h\n    neg             v0.8h, v0.8h\n    neg             v1.8h, v1.8h\n    neg             v2.8h, v2.8h\n    neg             v3.8h, v3.8h\n    neg             v4.8h, v4.8h\n    neg             v5.8h, v5.8h\n    neg             v6.8h, v6.8h\n    neg             v7.8h, v7.8h\n    ushl            v24.8h, v24.8h, v0.8h\n    ushl            v25.8h, v25.8h, v1.8h\n    ushl            v26.8h, v26.8h, v2.8h\n    ushl            v27.8h, v27.8h, v3.8h\n    ushl            v28.8h, v28.8h, v4.8h\n    ushl            v29.8h, v29.8h, v5.8h\n    ushl            v30.8h, v30.8h, v6.8h\n    ushl            v31.8h, v31.8h, v7.8h\n    add             v0.8h, v21.8h, v0.8h\n    add             v1.8h, v21.8h, v1.8h\n    add             v2.8h, v21.8h, v2.8h\n    add             v3.8h, v21.8h, v3.8h\n    add             v4.8h, v21.8h, v4.8h\n    add             v5.8h, v21.8h, v5.8h\n    add             v6.8h, v21.8h, v6.8h\n    add             v7.8h, v21.8h, v7.8h\n    st1             {v0.8h, v1.8h, v2.8h, v3.8h}, [x11], #64\n    st1             {v4.8h, v5.8h, v6.8h, v7.8h}, [x11], #64\n    st1             {v24.8h, v25.8h, v26.8h, v27.8h}, [x11], #64\n    st1             {v28.8h, v29.8h, v30.8h, v31.8h}, [x11], #64\n1:\n    clz             x2, x9\n    add             x15, x15, x2, lsl #1\n    lsl             x9, x9, x2\n    ldrh            w11, [x15, #-126]\n2:\n    cmp             x2, #0x10\n    b.lt            3f\n    sub             x2, x2, #0x10\n    checkbuf47\n    put_bits        x13, x14\n    b               2b\n3:\n    ldrh            w3, [x15, #2]!\n    add             x2, x11, x2, lsl #4\n    lsl             x9, x9, #0x1\n    ldr             w12, [x5, x2, lsl #2]\n    ldrb            w10, [x4, x2]\n    checkbuf31\n    put_bits        x12, x10\n    put_bits        x3, x11\n    cbnz            x9, 1b\n6:\n    add             x13, sp, #0xfe\n    cmp             x15, x13\n    b.hs            1f\n    ldr             w12, [x5]\n    ldrb            w14, [x4]\n    checkbuf47\n    put_bits        x12, x14\n1:\n    sub             sp, sp, 16\n    str             PUT_BUFFER, [x0, #0x10]\n    str             PUT_BITSw, [x0, #0x18]\n    ldp             x19, x20, [sp], 16\n    add             x0, BUFFER, #0x1\n    add             sp, sp, 256\n    br              x30\n\n.endm\n\ngenerate_jsimd_huff_encode_one_block 1\ngenerate_jsimd_huff_encode_one_block 0\n\n    .unreq          BUFFER\n    .unreq          PUT_BUFFER\n    .unreq          PUT_BITS\n    .unreq          PUT_BITSw\n\n.purgem emit_byte\n.purgem put_bits\n.purgem checkbuf31\n.purgem checkbuf47\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jsimd_arm_neon.S",
    "content": "/*\n * ARMv7 NEON optimizations for libjpeg-turbo\n *\n * Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies).\n * All Rights Reserved.\n * Author: Siarhei Siamashka <siarhei.siamashka@nokia.com>\n * Copyright (C) 2014, Siarhei Siamashka.  All Rights Reserved.\n * Copyright (C) 2014, Linaro Limited.  All Rights Reserved.\n * Copyright (C) 2015, D. R. Commander.  All Rights Reserved.\n * Copyright (C) 2015-2016, Matthieu Darbois.  All Rights Reserved.\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack, \"\", %progbits  /* mark stack as non-executable */\n#endif\n\n.text\n.fpu neon\n.arch armv7a\n.object_arch armv4\n.arm\n.syntax unified\n\n\n#define RESPECT_STRICT_ALIGNMENT 1\n\n\n/*****************************************************************************/\n\n/* Supplementary macro for setting function attributes */\n.macro asm_function fname\n#ifdef __APPLE__\n    .globl _\\fname\n_\\fname:\n#else\n    .global \\fname\n#ifdef __ELF__\n    .hidden \\fname\n    .type \\fname, %function\n#endif\n\\fname:\n#endif\n.endm\n\n/* Transpose a block of 4x4 coefficients in four 64-bit registers */\n.macro transpose_4x4 x0, x1, x2, x3\n    vtrn.16         \\x0, \\x1\n    vtrn.16         \\x2, \\x3\n    vtrn.32         \\x0, \\x2\n    vtrn.32         \\x1, \\x3\n.endm\n\n\n#define CENTERJSAMPLE 128\n\n/*****************************************************************************/\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients.\n *\n * GLOBAL(void)\n * jsimd_idct_islow_neon (void *dct_table, JCOEFPTR coef_block,\n *                        JSAMPARRAY output_buf, JDIMENSION output_col)\n */\n\n#define FIX_0_298631336 (2446)\n#define FIX_0_390180644 (3196)\n#define FIX_0_541196100 (4433)\n#define FIX_0_765366865 (6270)\n#define FIX_0_899976223 (7373)\n#define FIX_1_175875602 (9633)\n#define FIX_1_501321110 (12299)\n#define FIX_1_847759065 (15137)\n#define FIX_1_961570560 (16069)\n#define FIX_2_053119869 (16819)\n#define FIX_2_562915447 (20995)\n#define FIX_3_072711026 (25172)\n\n#define FIX_1_175875602_MINUS_1_961570560 (FIX_1_175875602 - FIX_1_961570560)\n#define FIX_1_175875602_MINUS_0_390180644 (FIX_1_175875602 - FIX_0_390180644)\n#define FIX_0_541196100_MINUS_1_847759065 (FIX_0_541196100 - FIX_1_847759065)\n#define FIX_3_072711026_MINUS_2_562915447 (FIX_3_072711026 - FIX_2_562915447)\n#define FIX_0_298631336_MINUS_0_899976223 (FIX_0_298631336 - FIX_0_899976223)\n#define FIX_1_501321110_MINUS_0_899976223 (FIX_1_501321110 - FIX_0_899976223)\n#define FIX_2_053119869_MINUS_2_562915447 (FIX_2_053119869 - FIX_2_562915447)\n#define FIX_0_541196100_PLUS_0_765366865  (FIX_0_541196100 + FIX_0_765366865)\n\n/*\n * Reference SIMD-friendly 1-D ISLOW iDCT C implementation.\n * Uses some ideas from the comments in 'simd/jiss2int-64.asm'\n */\n#define REF_1D_IDCT(xrow0, xrow1, xrow2, xrow3, xrow4, xrow5, xrow6, xrow7)   \\\n{                                                                             \\\n    DCTELEM row0, row1, row2, row3, row4, row5, row6, row7;                   \\\n    JLONG   q1, q2, q3, q4, q5, q6, q7;                                       \\\n    JLONG   tmp11_plus_tmp2, tmp11_minus_tmp2;                                \\\n                                                                              \\\n    /* 1-D iDCT input data */                                                 \\\n    row0 = xrow0;                                                             \\\n    row1 = xrow1;                                                             \\\n    row2 = xrow2;                                                             \\\n    row3 = xrow3;                                                             \\\n    row4 = xrow4;                                                             \\\n    row5 = xrow5;                                                             \\\n    row6 = xrow6;                                                             \\\n    row7 = xrow7;                                                             \\\n                                                                              \\\n    q5 = row7 + row3;                                                         \\\n    q4 = row5 + row1;                                                         \\\n    q6 = MULTIPLY(q5, FIX_1_175875602_MINUS_1_961570560) +                    \\\n         MULTIPLY(q4, FIX_1_175875602);                                       \\\n    q7 = MULTIPLY(q5, FIX_1_175875602) +                                      \\\n         MULTIPLY(q4, FIX_1_175875602_MINUS_0_390180644);                     \\\n    q2 = MULTIPLY(row2, FIX_0_541196100) +                                    \\\n         MULTIPLY(row6, FIX_0_541196100_MINUS_1_847759065);                   \\\n    q4 = q6;                                                                  \\\n    q3 = ((JLONG) row0 - (JLONG) row4) << 13;                                 \\\n    q6 += MULTIPLY(row5, -FIX_2_562915447) +                                  \\\n          MULTIPLY(row3, FIX_3_072711026_MINUS_2_562915447);                  \\\n    /* now we can use q1 (reloadable constants have been used up) */          \\\n    q1 = q3 + q2;                                                             \\\n    q4 += MULTIPLY(row7, FIX_0_298631336_MINUS_0_899976223) +                 \\\n          MULTIPLY(row1, -FIX_0_899976223);                                   \\\n    q5 = q7;                                                                  \\\n    q1 = q1 + q6;                                                             \\\n    q7 += MULTIPLY(row7, -FIX_0_899976223) +                                  \\\n          MULTIPLY(row1, FIX_1_501321110_MINUS_0_899976223);                  \\\n                                                                              \\\n    /* (tmp11 + tmp2) has been calculated (out_row1 before descale) */        \\\n    tmp11_plus_tmp2 = q1;                                                     \\\n    row1 = 0;                                                                 \\\n                                                                              \\\n    q1 = q1 - q6;                                                             \\\n    q5 += MULTIPLY(row5, FIX_2_053119869_MINUS_2_562915447) +                 \\\n          MULTIPLY(row3, -FIX_2_562915447);                                   \\\n    q1 = q1 - q6;                                                             \\\n    q6 = MULTIPLY(row2, FIX_0_541196100_PLUS_0_765366865) +                   \\\n         MULTIPLY(row6, FIX_0_541196100);                                     \\\n    q3 = q3 - q2;                                                             \\\n                                                                              \\\n    /* (tmp11 - tmp2) has been calculated (out_row6 before descale) */        \\\n    tmp11_minus_tmp2 = q1;                                                    \\\n                                                                              \\\n    q1 = ((JLONG) row0 + (JLONG) row4) << 13;                                 \\\n    q2 = q1 + q6;                                                             \\\n    q1 = q1 - q6;                                                             \\\n                                                                              \\\n    /* pick up the results */                                                 \\\n    tmp0  = q4;                                                               \\\n    tmp1  = q5;                                                               \\\n    tmp2  = (tmp11_plus_tmp2 - tmp11_minus_tmp2) / 2;                         \\\n    tmp3  = q7;                                                               \\\n    tmp10 = q2;                                                               \\\n    tmp11 = (tmp11_plus_tmp2 + tmp11_minus_tmp2) / 2;                         \\\n    tmp12 = q3;                                                               \\\n    tmp13 = q1;                                                               \\\n}\n\n#define XFIX_0_899976223                   d0[0]\n#define XFIX_0_541196100                   d0[1]\n#define XFIX_2_562915447                   d0[2]\n#define XFIX_0_298631336_MINUS_0_899976223 d0[3]\n#define XFIX_1_501321110_MINUS_0_899976223 d1[0]\n#define XFIX_2_053119869_MINUS_2_562915447 d1[1]\n#define XFIX_0_541196100_PLUS_0_765366865  d1[2]\n#define XFIX_1_175875602                   d1[3]\n#define XFIX_1_175875602_MINUS_0_390180644 d2[0]\n#define XFIX_0_541196100_MINUS_1_847759065 d2[1]\n#define XFIX_3_072711026_MINUS_2_562915447 d2[2]\n#define XFIX_1_175875602_MINUS_1_961570560 d2[3]\n\n.balign 16\njsimd_idct_islow_neon_consts:\n  .short FIX_0_899976223                    /* d0[0] */\n  .short FIX_0_541196100                    /* d0[1] */\n  .short FIX_2_562915447                    /* d0[2] */\n  .short FIX_0_298631336_MINUS_0_899976223  /* d0[3] */\n  .short FIX_1_501321110_MINUS_0_899976223  /* d1[0] */\n  .short FIX_2_053119869_MINUS_2_562915447  /* d1[1] */\n  .short FIX_0_541196100_PLUS_0_765366865   /* d1[2] */\n  .short FIX_1_175875602                    /* d1[3] */\n  /* reloadable constants */\n  .short FIX_1_175875602_MINUS_0_390180644  /* d2[0] */\n  .short FIX_0_541196100_MINUS_1_847759065  /* d2[1] */\n  .short FIX_3_072711026_MINUS_2_562915447  /* d2[2] */\n  .short FIX_1_175875602_MINUS_1_961570560  /* d2[3] */\n\nasm_function jsimd_idct_islow_neon\n\n    DCT_TABLE       .req r0\n    COEF_BLOCK      .req r1\n    OUTPUT_BUF      .req r2\n    OUTPUT_COL      .req r3\n    TMP1            .req r0\n    TMP2            .req r1\n    TMP3            .req r2\n    TMP4            .req ip\n\n    ROW0L           .req d16\n    ROW0R           .req d17\n    ROW1L           .req d18\n    ROW1R           .req d19\n    ROW2L           .req d20\n    ROW2R           .req d21\n    ROW3L           .req d22\n    ROW3R           .req d23\n    ROW4L           .req d24\n    ROW4R           .req d25\n    ROW5L           .req d26\n    ROW5R           .req d27\n    ROW6L           .req d28\n    ROW6R           .req d29\n    ROW7L           .req d30\n    ROW7R           .req d31\n\n    /* Load and dequantize coefficients into NEON registers\n     * with the following allocation:\n     *       0 1 2 3 | 4 5 6 7\n     *      ---------+--------\n     *   0 | d16     | d17     ( q8  )\n     *   1 | d18     | d19     ( q9  )\n     *   2 | d20     | d21     ( q10 )\n     *   3 | d22     | d23     ( q11 )\n     *   4 | d24     | d25     ( q12 )\n     *   5 | d26     | d27     ( q13 )\n     *   6 | d28     | d29     ( q14 )\n     *   7 | d30     | d31     ( q15 )\n     */\n    adr             ip, jsimd_idct_islow_neon_consts\n    vld1.16         {d16, d17, d18, d19}, [COEF_BLOCK, :128]!\n    vld1.16         {d0, d1, d2, d3}, [DCT_TABLE, :128]!\n    vld1.16         {d20, d21, d22, d23}, [COEF_BLOCK, :128]!\n    vmul.s16        q8, q8, q0\n    vld1.16         {d4, d5, d6, d7}, [DCT_TABLE, :128]!\n    vmul.s16        q9, q9, q1\n    vld1.16         {d24, d25, d26, d27}, [COEF_BLOCK, :128]!\n    vmul.s16        q10, q10, q2\n    vld1.16         {d0, d1, d2, d3}, [DCT_TABLE, :128]!\n    vmul.s16        q11, q11, q3\n    vld1.16         {d28, d29, d30, d31}, [COEF_BLOCK, :128]\n    vmul.s16        q12, q12, q0\n    vld1.16         {d4, d5, d6, d7}, [DCT_TABLE, :128]!\n    vmul.s16        q14, q14, q2\n    vmul.s16        q13, q13, q1\n    vld1.16         {d0, d1, d2, d3}, [ip, :128]  /* load constants */\n    add             ip, ip, #16\n    vmul.s16        q15, q15, q3\n    vpush           {d8-d15}                      /* save NEON registers */\n    /* 1-D IDCT, pass 1, left 4x8 half */\n    vadd.s16        d4, ROW7L, ROW3L\n    vadd.s16        d5, ROW5L, ROW1L\n    vmull.s16       q6, d4, XFIX_1_175875602_MINUS_1_961570560\n    vmlal.s16       q6, d5, XFIX_1_175875602\n    vmull.s16       q7, d4, XFIX_1_175875602\n      /* Check for the zero coefficients in the right 4x8 half */\n      push            {r4, r5}\n    vmlal.s16       q7, d5, XFIX_1_175875602_MINUS_0_390180644\n    vsubl.s16       q3, ROW0L, ROW4L\n      ldrd            r4, [COEF_BLOCK, #(-96 + 2 * (4 + 1 * 8))]\n    vmull.s16       q2, ROW2L, XFIX_0_541196100\n    vmlal.s16       q2, ROW6L, XFIX_0_541196100_MINUS_1_847759065\n      orr             r0, r4, r5\n    vmov            q4, q6\n    vmlsl.s16       q6, ROW5L, XFIX_2_562915447\n      ldrd            r4, [COEF_BLOCK, #(-96 + 2 * (4 + 2 * 8))]\n    vmlal.s16       q6, ROW3L, XFIX_3_072711026_MINUS_2_562915447\n    vshl.s32        q3, q3, #13\n      orr             r0, r0, r4\n    vmlsl.s16       q4, ROW1L, XFIX_0_899976223\n      orr             r0, r0, r5\n    vadd.s32        q1, q3, q2\n      ldrd            r4, [COEF_BLOCK, #(-96 + 2 * (4 + 3 * 8))]\n    vmov            q5, q7\n    vadd.s32        q1, q1, q6\n      orr             r0, r0, r4\n    vmlsl.s16       q7, ROW7L, XFIX_0_899976223\n      orr             r0, r0, r5\n    vmlal.s16       q7, ROW1L, XFIX_1_501321110_MINUS_0_899976223\n    vrshrn.s32      ROW1L, q1, #11\n      ldrd            r4, [COEF_BLOCK, #(-96 + 2 * (4 + 4 * 8))]\n    vsub.s32        q1, q1, q6\n    vmlal.s16       q5, ROW5L, XFIX_2_053119869_MINUS_2_562915447\n      orr             r0, r0, r4\n    vmlsl.s16       q5, ROW3L, XFIX_2_562915447\n      orr             r0, r0, r5\n    vsub.s32        q1, q1, q6\n    vmull.s16       q6, ROW2L, XFIX_0_541196100_PLUS_0_765366865\n      ldrd            r4, [COEF_BLOCK, #(-96 + 2 * (4 + 5 * 8))]\n    vmlal.s16       q6, ROW6L, XFIX_0_541196100\n    vsub.s32        q3, q3, q2\n      orr             r0, r0, r4\n    vrshrn.s32      ROW6L, q1, #11\n      orr             r0, r0, r5\n    vadd.s32        q1, q3, q5\n      ldrd            r4, [COEF_BLOCK, #(-96 + 2 * (4 + 6 * 8))]\n    vsub.s32        q3, q3, q5\n    vaddl.s16       q5, ROW0L, ROW4L\n      orr             r0, r0, r4\n    vrshrn.s32      ROW2L, q1, #11\n      orr             r0, r0, r5\n    vrshrn.s32      ROW5L, q3, #11\n      ldrd            r4, [COEF_BLOCK, #(-96 + 2 * (4 + 7 * 8))]\n    vshl.s32        q5, q5, #13\n    vmlal.s16       q4, ROW7L, XFIX_0_298631336_MINUS_0_899976223\n      orr             r0, r0, r4\n    vadd.s32        q2, q5, q6\n      orrs            r0, r0, r5\n    vsub.s32        q1, q5, q6\n    vadd.s32        q6, q2, q7\n      ldrd            r4, [COEF_BLOCK, #(-96 + 2 * (4 + 0 * 8))]\n    vsub.s32        q2, q2, q7\n    vadd.s32        q5, q1, q4\n      orr             r0, r4, r5\n    vsub.s32        q3, q1, q4\n      pop             {r4, r5}\n    vrshrn.s32      ROW7L, q2, #11\n    vrshrn.s32      ROW3L, q5, #11\n    vrshrn.s32      ROW0L, q6, #11\n    vrshrn.s32      ROW4L, q3, #11\n\n      beq             3f  /* Go to do some special handling for the sparse\n                             right 4x8 half */\n\n    /* 1-D IDCT, pass 1, right 4x8 half */\n    vld1.s16        {d2}, [ip, :64]  /* reload constants */\n    vadd.s16        d10, ROW7R, ROW3R\n    vadd.s16        d8, ROW5R, ROW1R\n      /* Transpose left 4x8 half */\n      vtrn.16         ROW6L, ROW7L\n    vmull.s16       q6, d10, XFIX_1_175875602_MINUS_1_961570560\n    vmlal.s16       q6, d8, XFIX_1_175875602\n      vtrn.16         ROW2L, ROW3L\n    vmull.s16       q7, d10, XFIX_1_175875602\n    vmlal.s16       q7, d8, XFIX_1_175875602_MINUS_0_390180644\n      vtrn.16         ROW0L, ROW1L\n    vsubl.s16       q3, ROW0R, ROW4R\n    vmull.s16       q2, ROW2R, XFIX_0_541196100\n    vmlal.s16       q2, ROW6R, XFIX_0_541196100_MINUS_1_847759065\n      vtrn.16         ROW4L, ROW5L\n    vmov            q4, q6\n    vmlsl.s16       q6, ROW5R, XFIX_2_562915447\n    vmlal.s16       q6, ROW3R, XFIX_3_072711026_MINUS_2_562915447\n      vtrn.32         ROW1L, ROW3L\n    vshl.s32        q3, q3, #13\n    vmlsl.s16       q4, ROW1R, XFIX_0_899976223\n      vtrn.32         ROW4L, ROW6L\n    vadd.s32        q1, q3, q2\n    vmov            q5, q7\n    vadd.s32        q1, q1, q6\n      vtrn.32         ROW0L, ROW2L\n    vmlsl.s16       q7, ROW7R, XFIX_0_899976223\n    vmlal.s16       q7, ROW1R, XFIX_1_501321110_MINUS_0_899976223\n    vrshrn.s32      ROW1R, q1, #11\n      vtrn.32         ROW5L, ROW7L\n    vsub.s32        q1, q1, q6\n    vmlal.s16       q5, ROW5R, XFIX_2_053119869_MINUS_2_562915447\n    vmlsl.s16       q5, ROW3R, XFIX_2_562915447\n    vsub.s32        q1, q1, q6\n    vmull.s16       q6, ROW2R, XFIX_0_541196100_PLUS_0_765366865\n    vmlal.s16       q6, ROW6R, XFIX_0_541196100\n    vsub.s32        q3, q3, q2\n    vrshrn.s32      ROW6R, q1, #11\n    vadd.s32        q1, q3, q5\n    vsub.s32        q3, q3, q5\n    vaddl.s16       q5, ROW0R, ROW4R\n    vrshrn.s32      ROW2R, q1, #11\n    vrshrn.s32      ROW5R, q3, #11\n    vshl.s32        q5, q5, #13\n    vmlal.s16       q4, ROW7R, XFIX_0_298631336_MINUS_0_899976223\n    vadd.s32        q2, q5, q6\n    vsub.s32        q1, q5, q6\n    vadd.s32        q6, q2, q7\n    vsub.s32        q2, q2, q7\n    vadd.s32        q5, q1, q4\n    vsub.s32        q3, q1, q4\n    vrshrn.s32      ROW7R, q2, #11\n    vrshrn.s32      ROW3R, q5, #11\n    vrshrn.s32      ROW0R, q6, #11\n    vrshrn.s32      ROW4R, q3, #11\n    /* Transpose right 4x8 half */\n    vtrn.16         ROW6R, ROW7R\n    vtrn.16         ROW2R, ROW3R\n    vtrn.16         ROW0R, ROW1R\n    vtrn.16         ROW4R, ROW5R\n    vtrn.32         ROW1R, ROW3R\n    vtrn.32         ROW4R, ROW6R\n    vtrn.32         ROW0R, ROW2R\n    vtrn.32         ROW5R, ROW7R\n\n1:  /* 1-D IDCT, pass 2 (normal variant), left 4x8 half */\n    vld1.s16        {d2}, [ip, :64]               /* reload constants */\n    vmull.s16       q6, ROW1R, XFIX_1_175875602   /* ROW5L <-> ROW1R */\n    vmlal.s16       q6, ROW1L, XFIX_1_175875602\n    vmlal.s16       q6, ROW3R, XFIX_1_175875602_MINUS_1_961570560  /* ROW7L <-> ROW3R */\n    vmlal.s16       q6, ROW3L, XFIX_1_175875602_MINUS_1_961570560\n    vmull.s16       q7, ROW3R, XFIX_1_175875602   /* ROW7L <-> ROW3R */\n    vmlal.s16       q7, ROW3L, XFIX_1_175875602\n    vmlal.s16       q7, ROW1R, XFIX_1_175875602_MINUS_0_390180644  /* ROW5L <-> ROW1R */\n    vmlal.s16       q7, ROW1L, XFIX_1_175875602_MINUS_0_390180644\n    vsubl.s16       q3, ROW0L, ROW0R              /* ROW4L <-> ROW0R */\n    vmull.s16       q2, ROW2L, XFIX_0_541196100\n    vmlal.s16       q2, ROW2R, XFIX_0_541196100_MINUS_1_847759065  /* ROW6L <-> ROW2R */\n    vmov            q4, q6\n    vmlsl.s16       q6, ROW1R, XFIX_2_562915447   /* ROW5L <-> ROW1R */\n    vmlal.s16       q6, ROW3L, XFIX_3_072711026_MINUS_2_562915447\n    vshl.s32        q3, q3, #13\n    vmlsl.s16       q4, ROW1L, XFIX_0_899976223\n    vadd.s32        q1, q3, q2\n    vmov            q5, q7\n    vadd.s32        q1, q1, q6\n    vmlsl.s16       q7, ROW3R, XFIX_0_899976223   /* ROW7L <-> ROW3R */\n    vmlal.s16       q7, ROW1L, XFIX_1_501321110_MINUS_0_899976223\n    vshrn.s32       ROW1L, q1, #16\n    vsub.s32        q1, q1, q6\n    vmlal.s16       q5, ROW1R, XFIX_2_053119869_MINUS_2_562915447  /* ROW5L <-> ROW1R */\n    vmlsl.s16       q5, ROW3L, XFIX_2_562915447\n    vsub.s32        q1, q1, q6\n    vmull.s16       q6, ROW2L, XFIX_0_541196100_PLUS_0_765366865\n    vmlal.s16       q6, ROW2R, XFIX_0_541196100   /* ROW6L <-> ROW2R */\n    vsub.s32        q3, q3, q2\n    vshrn.s32       ROW2R, q1, #16                /* ROW6L <-> ROW2R */\n    vadd.s32        q1, q3, q5\n    vsub.s32        q3, q3, q5\n    vaddl.s16       q5, ROW0L, ROW0R              /* ROW4L <-> ROW0R */\n    vshrn.s32       ROW2L, q1, #16\n    vshrn.s32       ROW1R, q3, #16                /* ROW5L <-> ROW1R */\n    vshl.s32        q5, q5, #13\n    vmlal.s16       q4, ROW3R, XFIX_0_298631336_MINUS_0_899976223  /* ROW7L <-> ROW3R */\n    vadd.s32        q2, q5, q6\n    vsub.s32        q1, q5, q6\n    vadd.s32        q6, q2, q7\n    vsub.s32        q2, q2, q7\n    vadd.s32        q5, q1, q4\n    vsub.s32        q3, q1, q4\n    vshrn.s32       ROW3R, q2, #16                /* ROW7L <-> ROW3R */\n    vshrn.s32       ROW3L, q5, #16\n    vshrn.s32       ROW0L, q6, #16\n    vshrn.s32       ROW0R, q3, #16                /* ROW4L <-> ROW0R */\n    /* 1-D IDCT, pass 2, right 4x8 half */\n    vld1.s16        {d2}, [ip, :64]               /* reload constants */\n    vmull.s16       q6, ROW5R, XFIX_1_175875602\n    vmlal.s16       q6, ROW5L, XFIX_1_175875602   /* ROW5L <-> ROW1R */\n    vmlal.s16       q6, ROW7R, XFIX_1_175875602_MINUS_1_961570560\n    vmlal.s16       q6, ROW7L, XFIX_1_175875602_MINUS_1_961570560  /* ROW7L <-> ROW3R */\n    vmull.s16       q7, ROW7R, XFIX_1_175875602\n    vmlal.s16       q7, ROW7L, XFIX_1_175875602   /* ROW7L <-> ROW3R */\n    vmlal.s16       q7, ROW5R, XFIX_1_175875602_MINUS_0_390180644\n    vmlal.s16       q7, ROW5L, XFIX_1_175875602_MINUS_0_390180644  /* ROW5L <-> ROW1R */\n    vsubl.s16       q3, ROW4L, ROW4R              /* ROW4L <-> ROW0R */\n    vmull.s16       q2, ROW6L, XFIX_0_541196100   /* ROW6L <-> ROW2R */\n    vmlal.s16       q2, ROW6R, XFIX_0_541196100_MINUS_1_847759065\n    vmov            q4, q6\n    vmlsl.s16       q6, ROW5R, XFIX_2_562915447\n    vmlal.s16       q6, ROW7L, XFIX_3_072711026_MINUS_2_562915447  /* ROW7L <-> ROW3R */\n    vshl.s32        q3, q3, #13\n    vmlsl.s16       q4, ROW5L, XFIX_0_899976223   /* ROW5L <-> ROW1R */\n    vadd.s32        q1, q3, q2\n    vmov            q5, q7\n    vadd.s32        q1, q1, q6\n    vmlsl.s16       q7, ROW7R, XFIX_0_899976223\n    vmlal.s16       q7, ROW5L, XFIX_1_501321110_MINUS_0_899976223  /* ROW5L <-> ROW1R */\n    vshrn.s32       ROW5L, q1, #16                /* ROW5L <-> ROW1R */\n    vsub.s32        q1, q1, q6\n    vmlal.s16       q5, ROW5R, XFIX_2_053119869_MINUS_2_562915447\n    vmlsl.s16       q5, ROW7L, XFIX_2_562915447   /* ROW7L <-> ROW3R */\n    vsub.s32        q1, q1, q6\n    vmull.s16       q6, ROW6L, XFIX_0_541196100_PLUS_0_765366865  /* ROW6L <-> ROW2R */\n    vmlal.s16       q6, ROW6R, XFIX_0_541196100\n    vsub.s32        q3, q3, q2\n    vshrn.s32       ROW6R, q1, #16\n    vadd.s32        q1, q3, q5\n    vsub.s32        q3, q3, q5\n    vaddl.s16       q5, ROW4L, ROW4R              /* ROW4L <-> ROW0R */\n    vshrn.s32       ROW6L, q1, #16                /* ROW6L <-> ROW2R */\n    vshrn.s32       ROW5R, q3, #16\n    vshl.s32        q5, q5, #13\n    vmlal.s16       q4, ROW7R, XFIX_0_298631336_MINUS_0_899976223\n    vadd.s32        q2, q5, q6\n    vsub.s32        q1, q5, q6\n    vadd.s32        q6, q2, q7\n    vsub.s32        q2, q2, q7\n    vadd.s32        q5, q1, q4\n    vsub.s32        q3, q1, q4\n    vshrn.s32       ROW7R, q2, #16\n    vshrn.s32       ROW7L, q5, #16                /* ROW7L <-> ROW3R */\n    vshrn.s32       ROW4L, q6, #16                /* ROW4L <-> ROW0R */\n    vshrn.s32       ROW4R, q3, #16\n\n2:  /* Descale to 8-bit and range limit */\n    vqrshrn.s16     d16, q8, #2\n    vqrshrn.s16     d17, q9, #2\n    vqrshrn.s16     d18, q10, #2\n    vqrshrn.s16     d19, q11, #2\n    vpop            {d8-d15}                      /* restore NEON registers */\n    vqrshrn.s16     d20, q12, #2\n      /* Transpose the final 8-bit samples and do signed->unsigned conversion */\n      vtrn.16         q8, q9\n    vqrshrn.s16     d21, q13, #2\n    vqrshrn.s16     d22, q14, #2\n      vmov.u8         q0, #(CENTERJSAMPLE)\n    vqrshrn.s16     d23, q15, #2\n      vtrn.8          d16, d17\n      vtrn.8          d18, d19\n      vadd.u8         q8, q8, q0\n      vadd.u8         q9, q9, q0\n      vtrn.16         q10, q11\n        /* Store results to the output buffer */\n        ldmia           OUTPUT_BUF!, {TMP1, TMP2}\n        add             TMP1, TMP1, OUTPUT_COL\n        add             TMP2, TMP2, OUTPUT_COL\n        vst1.8          {d16}, [TMP1]\n      vtrn.8          d20, d21\n        vst1.8          {d17}, [TMP2]\n        ldmia           OUTPUT_BUF!, {TMP1, TMP2}\n        add             TMP1, TMP1, OUTPUT_COL\n        add             TMP2, TMP2, OUTPUT_COL\n        vst1.8          {d18}, [TMP1]\n      vadd.u8         q10, q10, q0\n        vst1.8          {d19}, [TMP2]\n        ldmia           OUTPUT_BUF, {TMP1, TMP2, TMP3, TMP4}\n        add             TMP1, TMP1, OUTPUT_COL\n        add             TMP2, TMP2, OUTPUT_COL\n        add             TMP3, TMP3, OUTPUT_COL\n        add             TMP4, TMP4, OUTPUT_COL\n      vtrn.8          d22, d23\n        vst1.8          {d20}, [TMP1]\n      vadd.u8         q11, q11, q0\n        vst1.8          {d21}, [TMP2]\n        vst1.8          {d22}, [TMP3]\n        vst1.8          {d23}, [TMP4]\n    bx              lr\n\n3:  /* Left 4x8 half is done, right 4x8 half contains mostly zeros */\n\n    /* Transpose left 4x8 half */\n    vtrn.16         ROW6L, ROW7L\n    vtrn.16         ROW2L, ROW3L\n    vtrn.16         ROW0L, ROW1L\n    vtrn.16         ROW4L, ROW5L\n    vshl.s16        ROW0R, ROW0R, #2  /* PASS1_BITS */\n    vtrn.32         ROW1L, ROW3L\n    vtrn.32         ROW4L, ROW6L\n    vtrn.32         ROW0L, ROW2L\n    vtrn.32         ROW5L, ROW7L\n\n    cmp             r0, #0\n    beq             4f  /* Right 4x8 half has all zeros, go to 'sparse' second\n                           pass */\n\n    /* Only row 0 is non-zero for the right 4x8 half  */\n    vdup.s16        ROW1R, ROW0R[1]\n    vdup.s16        ROW2R, ROW0R[2]\n    vdup.s16        ROW3R, ROW0R[3]\n    vdup.s16        ROW4R, ROW0R[0]\n    vdup.s16        ROW5R, ROW0R[1]\n    vdup.s16        ROW6R, ROW0R[2]\n    vdup.s16        ROW7R, ROW0R[3]\n    vdup.s16        ROW0R, ROW0R[0]\n    b               1b  /* Go to 'normal' second pass */\n\n4:  /* 1-D IDCT, pass 2 (sparse variant with zero rows 4-7), left 4x8 half */\n    vld1.s16        {d2}, [ip, :64]               /* reload constants */\n    vmull.s16       q6, ROW1L, XFIX_1_175875602\n    vmlal.s16       q6, ROW3L, XFIX_1_175875602_MINUS_1_961570560\n    vmull.s16       q7, ROW3L, XFIX_1_175875602\n    vmlal.s16       q7, ROW1L, XFIX_1_175875602_MINUS_0_390180644\n    vmull.s16       q2, ROW2L, XFIX_0_541196100\n    vshll.s16       q3, ROW0L, #13\n    vmov            q4, q6\n    vmlal.s16       q6, ROW3L, XFIX_3_072711026_MINUS_2_562915447\n    vmlsl.s16       q4, ROW1L, XFIX_0_899976223\n    vadd.s32        q1, q3, q2\n    vmov            q5, q7\n    vmlal.s16       q7, ROW1L, XFIX_1_501321110_MINUS_0_899976223\n    vadd.s32        q1, q1, q6\n    vadd.s32        q6, q6, q6\n    vmlsl.s16       q5, ROW3L, XFIX_2_562915447\n    vshrn.s32       ROW1L, q1, #16\n    vsub.s32        q1, q1, q6\n    vmull.s16       q6, ROW2L, XFIX_0_541196100_PLUS_0_765366865\n    vsub.s32        q3, q3, q2\n    vshrn.s32       ROW2R, q1, #16                /* ROW6L <-> ROW2R */\n    vadd.s32        q1, q3, q5\n    vsub.s32        q3, q3, q5\n    vshll.s16       q5, ROW0L, #13\n    vshrn.s32       ROW2L, q1, #16\n    vshrn.s32       ROW1R, q3, #16                /* ROW5L <-> ROW1R */\n    vadd.s32        q2, q5, q6\n    vsub.s32        q1, q5, q6\n    vadd.s32        q6, q2, q7\n    vsub.s32        q2, q2, q7\n    vadd.s32        q5, q1, q4\n    vsub.s32        q3, q1, q4\n    vshrn.s32       ROW3R, q2, #16                /* ROW7L <-> ROW3R */\n    vshrn.s32       ROW3L, q5, #16\n    vshrn.s32       ROW0L, q6, #16\n    vshrn.s32       ROW0R, q3, #16                /* ROW4L <-> ROW0R */\n    /* 1-D IDCT, pass 2 (sparse variant with zero rows 4-7), right 4x8 half */\n    vld1.s16        {d2}, [ip, :64]               /* reload constants */\n    vmull.s16       q6, ROW5L, XFIX_1_175875602\n    vmlal.s16       q6, ROW7L, XFIX_1_175875602_MINUS_1_961570560\n    vmull.s16       q7, ROW7L, XFIX_1_175875602\n    vmlal.s16       q7, ROW5L, XFIX_1_175875602_MINUS_0_390180644\n    vmull.s16       q2, ROW6L, XFIX_0_541196100\n    vshll.s16       q3, ROW4L, #13\n    vmov            q4, q6\n    vmlal.s16       q6, ROW7L, XFIX_3_072711026_MINUS_2_562915447\n    vmlsl.s16       q4, ROW5L, XFIX_0_899976223\n    vadd.s32        q1, q3, q2\n    vmov            q5, q7\n    vmlal.s16       q7, ROW5L, XFIX_1_501321110_MINUS_0_899976223\n    vadd.s32        q1, q1, q6\n    vadd.s32        q6, q6, q6\n    vmlsl.s16       q5, ROW7L, XFIX_2_562915447\n    vshrn.s32       ROW5L, q1, #16                /* ROW5L <-> ROW1R */\n    vsub.s32        q1, q1, q6\n    vmull.s16       q6, ROW6L, XFIX_0_541196100_PLUS_0_765366865\n    vsub.s32        q3, q3, q2\n    vshrn.s32       ROW6R, q1, #16\n    vadd.s32        q1, q3, q5\n    vsub.s32        q3, q3, q5\n    vshll.s16       q5, ROW4L, #13\n    vshrn.s32       ROW6L, q1, #16                /* ROW6L <-> ROW2R */\n    vshrn.s32       ROW5R, q3, #16\n    vadd.s32        q2, q5, q6\n    vsub.s32        q1, q5, q6\n    vadd.s32        q6, q2, q7\n    vsub.s32        q2, q2, q7\n    vadd.s32        q5, q1, q4\n    vsub.s32        q3, q1, q4\n    vshrn.s32       ROW7R, q2, #16\n    vshrn.s32       ROW7L, q5, #16                /* ROW7L <-> ROW3R */\n    vshrn.s32       ROW4L, q6, #16                /* ROW4L <-> ROW0R */\n    vshrn.s32       ROW4R, q3, #16\n    b               2b                            /* Go to epilogue */\n\n    .unreq          DCT_TABLE\n    .unreq          COEF_BLOCK\n    .unreq          OUTPUT_BUF\n    .unreq          OUTPUT_COL\n    .unreq          TMP1\n    .unreq          TMP2\n    .unreq          TMP3\n    .unreq          TMP4\n\n    .unreq          ROW0L\n    .unreq          ROW0R\n    .unreq          ROW1L\n    .unreq          ROW1R\n    .unreq          ROW2L\n    .unreq          ROW2R\n    .unreq          ROW3L\n    .unreq          ROW3R\n    .unreq          ROW4L\n    .unreq          ROW4R\n    .unreq          ROW5L\n    .unreq          ROW5R\n    .unreq          ROW6L\n    .unreq          ROW6R\n    .unreq          ROW7L\n    .unreq          ROW7R\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_idct_ifast_neon\n *\n * This function contains a fast, not so accurate integer implementation of\n * the inverse DCT (Discrete Cosine Transform). It uses the same calculations\n * and produces exactly the same output as IJG's original 'jpeg_idct_ifast'\n * function from jidctfst.c\n *\n * Normally 1-D AAN DCT needs 5 multiplications and 29 additions.\n * But in ARM NEON case some extra additions are required because VQDMULH\n * instruction can't handle the constants larger than 1. So the expressions\n * like \"x * 1.082392200\" have to be converted to \"x * 0.082392200 + x\",\n * which introduces an extra addition. Overall, there are 6 extra additions\n * per 1-D IDCT pass, totalling to 5 VQDMULH and 35 VADD/VSUB instructions.\n */\n\n#define XFIX_1_082392200 d0[0]\n#define XFIX_1_414213562 d0[1]\n#define XFIX_1_847759065 d0[2]\n#define XFIX_2_613125930 d0[3]\n\n.balign 16\njsimd_idct_ifast_neon_consts:\n  .short (277 * 128 - 256 * 128)  /* XFIX_1_082392200 */\n  .short (362 * 128 - 256 * 128)  /* XFIX_1_414213562 */\n  .short (473 * 128 - 256 * 128)  /* XFIX_1_847759065 */\n  .short (669 * 128 - 512 * 128)  /* XFIX_2_613125930 */\n\nasm_function jsimd_idct_ifast_neon\n\n    DCT_TABLE       .req r0\n    COEF_BLOCK      .req r1\n    OUTPUT_BUF      .req r2\n    OUTPUT_COL      .req r3\n    TMP1            .req r0\n    TMP2            .req r1\n    TMP3            .req r2\n    TMP4            .req ip\n\n    /* Load and dequantize coefficients into NEON registers\n     * with the following allocation:\n     *       0 1 2 3 | 4 5 6 7\n     *      ---------+--------\n     *   0 | d16     | d17     ( q8  )\n     *   1 | d18     | d19     ( q9  )\n     *   2 | d20     | d21     ( q10 )\n     *   3 | d22     | d23     ( q11 )\n     *   4 | d24     | d25     ( q12 )\n     *   5 | d26     | d27     ( q13 )\n     *   6 | d28     | d29     ( q14 )\n     *   7 | d30     | d31     ( q15 )\n     */\n    adr             ip, jsimd_idct_ifast_neon_consts\n    vld1.16         {d16, d17, d18, d19}, [COEF_BLOCK, :128]!\n    vld1.16         {d0, d1, d2, d3}, [DCT_TABLE, :128]!\n    vld1.16         {d20, d21, d22, d23}, [COEF_BLOCK, :128]!\n    vmul.s16        q8, q8, q0\n    vld1.16         {d4, d5, d6, d7}, [DCT_TABLE, :128]!\n    vmul.s16        q9, q9, q1\n    vld1.16         {d24, d25, d26, d27}, [COEF_BLOCK, :128]!\n    vmul.s16        q10, q10, q2\n    vld1.16         {d0, d1, d2, d3}, [DCT_TABLE, :128]!\n    vmul.s16        q11, q11, q3\n    vld1.16         {d28, d29, d30, d31}, [COEF_BLOCK, :128]\n    vmul.s16        q12, q12, q0\n    vld1.16         {d4, d5, d6, d7}, [DCT_TABLE, :128]!\n    vmul.s16        q14, q14, q2\n    vmul.s16        q13, q13, q1\n    vld1.16         {d0}, [ip, :64]  /* load constants */\n    vmul.s16        q15, q15, q3\n    vpush           {d8-d13}         /* save NEON registers */\n    /* 1-D IDCT, pass 1 */\n    vsub.s16        q2, q10, q14\n    vadd.s16        q14, q10, q14\n    vsub.s16        q1, q11, q13\n    vadd.s16        q13, q11, q13\n    vsub.s16        q5, q9, q15\n    vadd.s16        q15, q9, q15\n    vqdmulh.s16     q4, q2, XFIX_1_414213562\n    vqdmulh.s16     q6, q1, XFIX_2_613125930\n    vadd.s16        q3, q1, q1\n    vsub.s16        q1, q5, q1\n    vadd.s16        q10, q2, q4\n    vqdmulh.s16     q4, q1, XFIX_1_847759065\n    vsub.s16        q2, q15, q13\n    vadd.s16        q3, q3, q6\n    vqdmulh.s16     q6, q2, XFIX_1_414213562\n    vadd.s16        q1, q1, q4\n    vqdmulh.s16     q4, q5, XFIX_1_082392200\n    vsub.s16        q10, q10, q14\n    vadd.s16        q2, q2, q6\n    vsub.s16        q6, q8, q12\n    vadd.s16        q12, q8, q12\n    vadd.s16        q9, q5, q4\n    vadd.s16        q5, q6, q10\n    vsub.s16        q10, q6, q10\n    vadd.s16        q6, q15, q13\n    vadd.s16        q8, q12, q14\n    vsub.s16        q3, q6, q3\n    vsub.s16        q12, q12, q14\n    vsub.s16        q3, q3, q1\n    vsub.s16        q1, q9, q1\n    vadd.s16        q2, q3, q2\n    vsub.s16        q15, q8, q6\n    vadd.s16        q1, q1, q2\n    vadd.s16        q8, q8, q6\n    vadd.s16        q14, q5, q3\n    vsub.s16        q9, q5, q3\n    vsub.s16        q13, q10, q2\n    vadd.s16        q10, q10, q2\n      /* Transpose */\n      vtrn.16         q8, q9\n    vsub.s16        q11, q12, q1\n      vtrn.16         q14, q15\n    vadd.s16        q12, q12, q1\n      vtrn.16         q10, q11\n      vtrn.16         q12, q13\n      vtrn.32         q9, q11\n      vtrn.32         q12, q14\n      vtrn.32         q8, q10\n      vtrn.32         q13, q15\n      vswp            d28, d21\n      vswp            d26, d19\n    /* 1-D IDCT, pass 2 */\n    vsub.s16        q2, q10, q14\n      vswp            d30, d23\n    vadd.s16        q14, q10, q14\n      vswp            d24, d17\n    vsub.s16        q1, q11, q13\n    vadd.s16        q13, q11, q13\n    vsub.s16        q5, q9, q15\n    vadd.s16        q15, q9, q15\n    vqdmulh.s16     q4, q2, XFIX_1_414213562\n    vqdmulh.s16     q6, q1, XFIX_2_613125930\n    vadd.s16        q3, q1, q1\n    vsub.s16        q1, q5, q1\n    vadd.s16        q10, q2, q4\n    vqdmulh.s16     q4, q1, XFIX_1_847759065\n    vsub.s16        q2, q15, q13\n    vadd.s16        q3, q3, q6\n    vqdmulh.s16     q6, q2, XFIX_1_414213562\n    vadd.s16        q1, q1, q4\n    vqdmulh.s16     q4, q5, XFIX_1_082392200\n    vsub.s16        q10, q10, q14\n    vadd.s16        q2, q2, q6\n    vsub.s16        q6, q8, q12\n    vadd.s16        q12, q8, q12\n    vadd.s16        q9, q5, q4\n    vadd.s16        q5, q6, q10\n    vsub.s16        q10, q6, q10\n    vadd.s16        q6, q15, q13\n    vadd.s16        q8, q12, q14\n    vsub.s16        q3, q6, q3\n    vsub.s16        q12, q12, q14\n    vsub.s16        q3, q3, q1\n    vsub.s16        q1, q9, q1\n    vadd.s16        q2, q3, q2\n    vsub.s16        q15, q8, q6\n    vadd.s16        q1, q1, q2\n    vadd.s16        q8, q8, q6\n    vadd.s16        q14, q5, q3\n    vsub.s16        q9, q5, q3\n    vsub.s16        q13, q10, q2\n    vpop            {d8-d13}      /* restore NEON registers */\n    vadd.s16        q10, q10, q2\n    vsub.s16        q11, q12, q1\n    vadd.s16        q12, q12, q1\n    /* Descale to 8-bit and range limit */\n    vmov.u8         q0, #0x80\n    vqshrn.s16      d16, q8, #5\n    vqshrn.s16      d17, q9, #5\n    vqshrn.s16      d18, q10, #5\n    vqshrn.s16      d19, q11, #5\n    vqshrn.s16      d20, q12, #5\n    vqshrn.s16      d21, q13, #5\n    vqshrn.s16      d22, q14, #5\n    vqshrn.s16      d23, q15, #5\n    vadd.u8         q8, q8, q0\n    vadd.u8         q9, q9, q0\n    vadd.u8         q10, q10, q0\n    vadd.u8         q11, q11, q0\n    /* Transpose the final 8-bit samples */\n    vtrn.16         q8, q9\n    vtrn.16         q10, q11\n    vtrn.32         q8, q10\n    vtrn.32         q9, q11\n    vtrn.8          d16, d17\n    vtrn.8          d18, d19\n      /* Store results to the output buffer */\n      ldmia           OUTPUT_BUF!, {TMP1, TMP2}\n      add             TMP1, TMP1, OUTPUT_COL\n      add             TMP2, TMP2, OUTPUT_COL\n      vst1.8          {d16}, [TMP1]\n      vst1.8          {d17}, [TMP2]\n      ldmia           OUTPUT_BUF!, {TMP1, TMP2}\n      add             TMP1, TMP1, OUTPUT_COL\n      add             TMP2, TMP2, OUTPUT_COL\n      vst1.8          {d18}, [TMP1]\n    vtrn.8          d20, d21\n      vst1.8          {d19}, [TMP2]\n      ldmia           OUTPUT_BUF, {TMP1, TMP2, TMP3, TMP4}\n      add             TMP1, TMP1, OUTPUT_COL\n      add             TMP2, TMP2, OUTPUT_COL\n      add             TMP3, TMP3, OUTPUT_COL\n      add             TMP4, TMP4, OUTPUT_COL\n      vst1.8          {d20}, [TMP1]\n    vtrn.8          d22, d23\n      vst1.8          {d21}, [TMP2]\n      vst1.8          {d22}, [TMP3]\n      vst1.8          {d23}, [TMP4]\n    bx              lr\n\n    .unreq          DCT_TABLE\n    .unreq          COEF_BLOCK\n    .unreq          OUTPUT_BUF\n    .unreq          OUTPUT_COL\n    .unreq          TMP1\n    .unreq          TMP2\n    .unreq          TMP3\n    .unreq          TMP4\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_idct_4x4_neon\n *\n * This function contains inverse-DCT code for getting reduced-size\n * 4x4 pixels output from an 8x8 DCT block. It uses the same  calculations\n * and produces exactly the same output as IJG's original 'jpeg_idct_4x4'\n * function from jpeg-6b (jidctred.c).\n *\n * NOTE: jpeg-8 has an improved implementation of 4x4 inverse-DCT, which\n *       requires much less arithmetic operations and hence should be faster.\n *       The primary purpose of this particular NEON optimized function is\n *       bit exact compatibility with jpeg-6b.\n *\n * TODO: a bit better instructions scheduling can be achieved by expanding\n *       idct_helper/transpose_4x4 macros and reordering instructions,\n *       but readability will suffer somewhat.\n */\n\n#define CONST_BITS  13\n\n#define FIX_0_211164243 (1730)   /* FIX(0.211164243) */\n#define FIX_0_509795579 (4176)   /* FIX(0.509795579) */\n#define FIX_0_601344887 (4926)   /* FIX(0.601344887) */\n#define FIX_0_720959822 (5906)   /* FIX(0.720959822) */\n#define FIX_0_765366865 (6270)   /* FIX(0.765366865) */\n#define FIX_0_850430095 (6967)   /* FIX(0.850430095) */\n#define FIX_0_899976223 (7373)   /* FIX(0.899976223) */\n#define FIX_1_061594337 (8697)   /* FIX(1.061594337) */\n#define FIX_1_272758580 (10426)  /* FIX(1.272758580) */\n#define FIX_1_451774981 (11893)  /* FIX(1.451774981) */\n#define FIX_1_847759065 (15137)  /* FIX(1.847759065) */\n#define FIX_2_172734803 (17799)  /* FIX(2.172734803) */\n#define FIX_2_562915447 (20995)  /* FIX(2.562915447) */\n#define FIX_3_624509785 (29692)  /* FIX(3.624509785) */\n\n.balign 16\njsimd_idct_4x4_neon_consts:\n  .short FIX_1_847759065      /* d0[0] */\n  .short -FIX_0_765366865     /* d0[1] */\n  .short -FIX_0_211164243     /* d0[2] */\n  .short FIX_1_451774981      /* d0[3] */\n  .short -FIX_2_172734803     /* d1[0] */\n  .short FIX_1_061594337      /* d1[1] */\n  .short -FIX_0_509795579     /* d1[2] */\n  .short -FIX_0_601344887     /* d1[3] */\n  .short FIX_0_899976223      /* d2[0] */\n  .short FIX_2_562915447      /* d2[1] */\n  .short 1 << (CONST_BITS+1)  /* d2[2] */\n  .short 0                    /* d2[3] */\n\n.macro idct_helper x4, x6, x8, x10, x12, x14, x16, shift, y26, y27, y28, y29\n    vmull.s16       q14, \\x4, d2[2]\n    vmlal.s16       q14, \\x8, d0[0]\n    vmlal.s16       q14, \\x14, d0[1]\n\n    vmull.s16       q13, \\x16, d1[2]\n    vmlal.s16       q13, \\x12, d1[3]\n    vmlal.s16       q13, \\x10, d2[0]\n    vmlal.s16       q13, \\x6, d2[1]\n\n    vmull.s16       q15, \\x4, d2[2]\n    vmlsl.s16       q15, \\x8, d0[0]\n    vmlsl.s16       q15, \\x14, d0[1]\n\n    vmull.s16       q12, \\x16, d0[2]\n    vmlal.s16       q12, \\x12, d0[3]\n    vmlal.s16       q12, \\x10, d1[0]\n    vmlal.s16       q12, \\x6, d1[1]\n\n    vadd.s32        q10, q14, q13\n    vsub.s32        q14, q14, q13\n\n  .if \\shift > 16\n    vrshr.s32       q10, q10, #\\shift\n    vrshr.s32       q14, q14, #\\shift\n    vmovn.s32       \\y26, q10\n    vmovn.s32       \\y29, q14\n  .else\n    vrshrn.s32      \\y26, q10, #\\shift\n    vrshrn.s32      \\y29, q14, #\\shift\n  .endif\n\n    vadd.s32        q10, q15, q12\n    vsub.s32        q15, q15, q12\n\n  .if \\shift > 16\n    vrshr.s32       q10, q10, #\\shift\n    vrshr.s32       q15, q15, #\\shift\n    vmovn.s32       \\y27, q10\n    vmovn.s32       \\y28, q15\n  .else\n    vrshrn.s32      \\y27, q10, #\\shift\n    vrshrn.s32      \\y28, q15, #\\shift\n  .endif\n.endm\n\nasm_function jsimd_idct_4x4_neon\n\n    DCT_TABLE       .req r0\n    COEF_BLOCK      .req r1\n    OUTPUT_BUF      .req r2\n    OUTPUT_COL      .req r3\n    TMP1            .req r0\n    TMP2            .req r1\n    TMP3            .req r2\n    TMP4            .req ip\n\n    vpush           {d8-d15}\n\n    /* Load constants (d3 is just used for padding) */\n    adr             TMP4, jsimd_idct_4x4_neon_consts\n    vld1.16         {d0, d1, d2, d3}, [TMP4, :128]\n\n    /* Load all COEF_BLOCK into NEON registers with the following allocation:\n     *       0 1 2 3 | 4 5 6 7\n     *      ---------+--------\n     *   0 | d4      | d5\n     *   1 | d6      | d7\n     *   2 | d8      | d9\n     *   3 | d10     | d11\n     *   4 | -       | -\n     *   5 | d12     | d13\n     *   6 | d14     | d15\n     *   7 | d16     | d17\n     */\n    vld1.16         {d4, d5, d6, d7}, [COEF_BLOCK, :128]!\n    vld1.16         {d8, d9, d10, d11}, [COEF_BLOCK, :128]!\n    add COEF_BLOCK, COEF_BLOCK, #16\n    vld1.16         {d12, d13, d14, d15}, [COEF_BLOCK, :128]!\n    vld1.16         {d16, d17}, [COEF_BLOCK, :128]!\n    /* dequantize */\n    vld1.16         {d18, d19, d20, d21}, [DCT_TABLE, :128]!\n    vmul.s16        q2, q2, q9\n    vld1.16         {d22, d23, d24, d25}, [DCT_TABLE, :128]!\n    vmul.s16        q3, q3, q10\n    vmul.s16        q4, q4, q11\n    add             DCT_TABLE, DCT_TABLE, #16\n    vld1.16         {d26, d27, d28, d29}, [DCT_TABLE, :128]!\n    vmul.s16        q5, q5, q12\n    vmul.s16        q6, q6, q13\n    vld1.16         {d30, d31}, [DCT_TABLE, :128]!\n    vmul.s16        q7, q7, q14\n    vmul.s16        q8, q8, q15\n\n    /* Pass 1 */\n    idct_helper     d4, d6, d8, d10, d12, d14, d16, 12, d4, d6, d8, d10\n    transpose_4x4   d4, d6, d8, d10\n    idct_helper     d5, d7, d9, d11, d13, d15, d17, 12, d5, d7, d9, d11\n    transpose_4x4   d5, d7, d9, d11\n\n    /* Pass 2 */\n    idct_helper     d4, d6, d8, d10, d7, d9, d11, 19, d26, d27, d28, d29\n    transpose_4x4   d26, d27, d28, d29\n\n    /* Range limit */\n    vmov.u16        q15, #0x80\n    vadd.s16        q13, q13, q15\n    vadd.s16        q14, q14, q15\n    vqmovun.s16     d26, q13\n    vqmovun.s16     d27, q14\n\n    /* Store results to the output buffer */\n    ldmia           OUTPUT_BUF, {TMP1, TMP2, TMP3, TMP4}\n    add             TMP1, TMP1, OUTPUT_COL\n    add             TMP2, TMP2, OUTPUT_COL\n    add             TMP3, TMP3, OUTPUT_COL\n    add             TMP4, TMP4, OUTPUT_COL\n\n#if defined(__ARMEL__) && !RESPECT_STRICT_ALIGNMENT\n    /* We can use much less instructions on little endian systems if the\n     * OS kernel is not configured to trap unaligned memory accesses\n     */\n    vst1.32         {d26[0]}, [TMP1]!\n    vst1.32         {d27[0]}, [TMP3]!\n    vst1.32         {d26[1]}, [TMP2]!\n    vst1.32         {d27[1]}, [TMP4]!\n#else\n    vst1.8          {d26[0]}, [TMP1]!\n    vst1.8          {d27[0]}, [TMP3]!\n    vst1.8          {d26[1]}, [TMP1]!\n    vst1.8          {d27[1]}, [TMP3]!\n    vst1.8          {d26[2]}, [TMP1]!\n    vst1.8          {d27[2]}, [TMP3]!\n    vst1.8          {d26[3]}, [TMP1]!\n    vst1.8          {d27[3]}, [TMP3]!\n\n    vst1.8          {d26[4]}, [TMP2]!\n    vst1.8          {d27[4]}, [TMP4]!\n    vst1.8          {d26[5]}, [TMP2]!\n    vst1.8          {d27[5]}, [TMP4]!\n    vst1.8          {d26[6]}, [TMP2]!\n    vst1.8          {d27[6]}, [TMP4]!\n    vst1.8          {d26[7]}, [TMP2]!\n    vst1.8          {d27[7]}, [TMP4]!\n#endif\n\n    vpop            {d8-d15}\n    bx              lr\n\n    .unreq          DCT_TABLE\n    .unreq          COEF_BLOCK\n    .unreq          OUTPUT_BUF\n    .unreq          OUTPUT_COL\n    .unreq          TMP1\n    .unreq          TMP2\n    .unreq          TMP3\n    .unreq          TMP4\n\n.purgem idct_helper\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_idct_2x2_neon\n *\n * This function contains inverse-DCT code for getting reduced-size\n * 2x2 pixels output from an 8x8 DCT block. It uses the same  calculations\n * and produces exactly the same output as IJG's original 'jpeg_idct_2x2'\n * function from jpeg-6b (jidctred.c).\n *\n * NOTE: jpeg-8 has an improved implementation of 2x2 inverse-DCT, which\n *       requires much less arithmetic operations and hence should be faster.\n *       The primary purpose of this particular NEON optimized function is\n *       bit exact compatibility with jpeg-6b.\n */\n\n.balign 8\njsimd_idct_2x2_neon_consts:\n  .short -FIX_0_720959822  /* d0[0] */\n  .short FIX_0_850430095   /* d0[1] */\n  .short -FIX_1_272758580  /* d0[2] */\n  .short FIX_3_624509785   /* d0[3] */\n\n.macro idct_helper x4, x6, x10, x12, x16, shift, y26, y27\n    vshll.s16       q14, \\x4, #15\n    vmull.s16       q13, \\x6, d0[3]\n    vmlal.s16       q13, \\x10, d0[2]\n    vmlal.s16       q13, \\x12, d0[1]\n    vmlal.s16       q13, \\x16, d0[0]\n\n    vadd.s32        q10, q14, q13\n    vsub.s32        q14, q14, q13\n\n  .if \\shift > 16\n    vrshr.s32       q10, q10, #\\shift\n    vrshr.s32       q14, q14, #\\shift\n    vmovn.s32       \\y26, q10\n    vmovn.s32       \\y27, q14\n  .else\n    vrshrn.s32      \\y26, q10, #\\shift\n    vrshrn.s32      \\y27, q14, #\\shift\n  .endif\n.endm\n\nasm_function jsimd_idct_2x2_neon\n\n    DCT_TABLE       .req r0\n    COEF_BLOCK      .req r1\n    OUTPUT_BUF      .req r2\n    OUTPUT_COL      .req r3\n    TMP1            .req r0\n    TMP2            .req ip\n\n    vpush           {d8-d15}\n\n    /* Load constants */\n    adr             TMP2, jsimd_idct_2x2_neon_consts\n    vld1.16         {d0}, [TMP2, :64]\n\n    /* Load all COEF_BLOCK into NEON registers with the following allocation:\n     *       0 1 2 3 | 4 5 6 7\n     *      ---------+--------\n     *   0 | d4      | d5\n     *   1 | d6      | d7\n     *   2 | -       | -\n     *   3 | d10     | d11\n     *   4 | -       | -\n     *   5 | d12     | d13\n     *   6 | -       | -\n     *   7 | d16     | d17\n     */\n    vld1.16         {d4, d5, d6, d7}, [COEF_BLOCK, :128]!\n    add             COEF_BLOCK, COEF_BLOCK, #16\n    vld1.16         {d10, d11}, [COEF_BLOCK, :128]!\n    add             COEF_BLOCK, COEF_BLOCK, #16\n    vld1.16         {d12, d13}, [COEF_BLOCK, :128]!\n    add             COEF_BLOCK, COEF_BLOCK, #16\n    vld1.16         {d16, d17}, [COEF_BLOCK, :128]!\n    /* Dequantize */\n    vld1.16         {d18, d19, d20, d21}, [DCT_TABLE, :128]!\n    vmul.s16        q2, q2, q9\n    vmul.s16        q3, q3, q10\n    add             DCT_TABLE, DCT_TABLE, #16\n    vld1.16         {d24, d25}, [DCT_TABLE, :128]!\n    vmul.s16        q5, q5, q12\n    add             DCT_TABLE, DCT_TABLE, #16\n    vld1.16         {d26, d27}, [DCT_TABLE, :128]!\n    vmul.s16        q6, q6, q13\n    add             DCT_TABLE, DCT_TABLE, #16\n    vld1.16         {d30, d31}, [DCT_TABLE, :128]!\n    vmul.s16        q8, q8, q15\n\n    /* Pass 1 */\n#if 0\n    idct_helper     d4, d6, d10, d12, d16, 13, d4, d6\n    transpose_4x4   d4, d6, d8, d10\n    idct_helper     d5, d7, d11, d13, d17, 13, d5, d7\n    transpose_4x4   d5, d7, d9, d11\n#else\n    vmull.s16       q13, d6, d0[3]\n    vmlal.s16       q13, d10, d0[2]\n    vmlal.s16       q13, d12, d0[1]\n    vmlal.s16       q13, d16, d0[0]\n    vmull.s16       q12, d7, d0[3]\n    vmlal.s16       q12, d11, d0[2]\n    vmlal.s16       q12, d13, d0[1]\n    vmlal.s16       q12, d17, d0[0]\n    vshll.s16       q14, d4, #15\n    vshll.s16       q15, d5, #15\n    vadd.s32        q10, q14, q13\n    vsub.s32        q14, q14, q13\n    vrshrn.s32      d4, q10, #13\n    vrshrn.s32      d6, q14, #13\n    vadd.s32        q10, q15, q12\n    vsub.s32        q14, q15, q12\n    vrshrn.s32      d5, q10, #13\n    vrshrn.s32      d7, q14, #13\n    vtrn.16         q2, q3\n    vtrn.32         q3, q5\n#endif\n\n    /* Pass 2 */\n    idct_helper     d4, d6, d10, d7, d11, 20, d26, d27\n\n    /* Range limit */\n    vmov.u16        q15, #0x80\n    vadd.s16        q13, q13, q15\n    vqmovun.s16     d26, q13\n    vqmovun.s16     d27, q13\n\n    /* Store results to the output buffer */\n    ldmia           OUTPUT_BUF, {TMP1, TMP2}\n    add             TMP1, TMP1, OUTPUT_COL\n    add             TMP2, TMP2, OUTPUT_COL\n\n    vst1.8          {d26[0]}, [TMP1]!\n    vst1.8          {d27[4]}, [TMP1]!\n    vst1.8          {d26[1]}, [TMP2]!\n    vst1.8          {d27[5]}, [TMP2]!\n\n    vpop            {d8-d15}\n    bx              lr\n\n    .unreq          DCT_TABLE\n    .unreq          COEF_BLOCK\n    .unreq          OUTPUT_BUF\n    .unreq          OUTPUT_COL\n    .unreq          TMP1\n    .unreq          TMP2\n\n.purgem idct_helper\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_ycc_extrgb_convert_neon\n * jsimd_ycc_extbgr_convert_neon\n * jsimd_ycc_extrgbx_convert_neon\n * jsimd_ycc_extbgrx_convert_neon\n * jsimd_ycc_extxbgr_convert_neon\n * jsimd_ycc_extxrgb_convert_neon\n *\n * Colorspace conversion YCbCr -> RGB\n */\n\n\n.macro do_load size\n  .if \\size == 8\n    vld1.8          {d4}, [U, :64]!\n    vld1.8          {d5}, [V, :64]!\n    vld1.8          {d0}, [Y, :64]!\n    pld             [U, #64]\n    pld             [V, #64]\n    pld             [Y, #64]\n  .elseif \\size == 4\n    vld1.8          {d4[0]}, [U]!\n    vld1.8          {d4[1]}, [U]!\n    vld1.8          {d4[2]}, [U]!\n    vld1.8          {d4[3]}, [U]!\n    vld1.8          {d5[0]}, [V]!\n    vld1.8          {d5[1]}, [V]!\n    vld1.8          {d5[2]}, [V]!\n    vld1.8          {d5[3]}, [V]!\n    vld1.8          {d0[0]}, [Y]!\n    vld1.8          {d0[1]}, [Y]!\n    vld1.8          {d0[2]}, [Y]!\n    vld1.8          {d0[3]}, [Y]!\n  .elseif \\size == 2\n    vld1.8          {d4[4]}, [U]!\n    vld1.8          {d4[5]}, [U]!\n    vld1.8          {d5[4]}, [V]!\n    vld1.8          {d5[5]}, [V]!\n    vld1.8          {d0[4]}, [Y]!\n    vld1.8          {d0[5]}, [Y]!\n  .elseif \\size == 1\n    vld1.8          {d4[6]}, [U]!\n    vld1.8          {d5[6]}, [V]!\n    vld1.8          {d0[6]}, [Y]!\n  .else\n    .error unsupported macroblock size\n  .endif\n.endm\n\n.macro do_store bpp, size\n  .if \\bpp == 24\n    .if \\size == 8\n      vst3.8        {d10, d11, d12}, [RGB]!\n    .elseif \\size == 4\n      vst3.8        {d10[0], d11[0], d12[0]}, [RGB]!\n      vst3.8        {d10[1], d11[1], d12[1]}, [RGB]!\n      vst3.8        {d10[2], d11[2], d12[2]}, [RGB]!\n      vst3.8        {d10[3], d11[3], d12[3]}, [RGB]!\n    .elseif \\size == 2\n      vst3.8        {d10[4], d11[4], d12[4]}, [RGB]!\n      vst3.8        {d10[5], d11[5], d12[5]}, [RGB]!\n    .elseif \\size == 1\n      vst3.8        {d10[6], d11[6], d12[6]}, [RGB]!\n    .else\n      .error unsupported macroblock size\n    .endif\n  .elseif \\bpp == 32\n    .if \\size == 8\n      vst4.8        {d10, d11, d12, d13}, [RGB]!\n    .elseif \\size == 4\n      vst4.8        {d10[0], d11[0], d12[0], d13[0]}, [RGB]!\n      vst4.8        {d10[1], d11[1], d12[1], d13[1]}, [RGB]!\n      vst4.8        {d10[2], d11[2], d12[2], d13[2]}, [RGB]!\n      vst4.8        {d10[3], d11[3], d12[3], d13[3]}, [RGB]!\n    .elseif \\size == 2\n      vst4.8        {d10[4], d11[4], d12[4], d13[4]}, [RGB]!\n      vst4.8        {d10[5], d11[5], d12[5], d13[5]}, [RGB]!\n    .elseif \\size == 1\n      vst4.8        {d10[6], d11[6], d12[6], d13[6]}, [RGB]!\n    .else\n      .error unsupported macroblock size\n    .endif\n  .elseif \\bpp == 16\n    .if \\size == 8\n      vst1.16       {q15}, [RGB]!\n    .elseif \\size == 4\n      vst1.16       {d30}, [RGB]!\n    .elseif \\size == 2\n      vst1.16       {d31[0]}, [RGB]!\n      vst1.16       {d31[1]}, [RGB]!\n    .elseif \\size == 1\n      vst1.16       {d31[2]}, [RGB]!\n    .else\n      .error unsupported macroblock size\n    .endif\n  .else\n    .error unsupported bpp\n  .endif\n.endm\n\n.macro generate_jsimd_ycc_rgb_convert_neon colorid, bpp, r_offs, g_offs, b_offs\n\n/*\n * 2-stage pipelined YCbCr->RGB conversion\n */\n\n.macro do_yuv_to_rgb_stage1\n    vaddw.u8        q3, q1, d4      /* q3 = u - 128 */\n    vaddw.u8        q4, q1, d5      /* q2 = v - 128 */\n    vmull.s16       q10, d6, d1[1]  /* multiply by -11277 */\n    vmlal.s16       q10, d8, d1[2]  /* multiply by -23401 */\n    vmull.s16       q11, d7, d1[1]  /* multiply by -11277 */\n    vmlal.s16       q11, d9, d1[2]  /* multiply by -23401 */\n    vmull.s16       q12, d8, d1[0]  /* multiply by 22971 */\n    vmull.s16       q13, d9, d1[0]  /* multiply by 22971 */\n    vmull.s16       q14, d6, d1[3]  /* multiply by 29033 */\n    vmull.s16       q15, d7, d1[3]  /* multiply by 29033 */\n.endm\n\n.macro do_yuv_to_rgb_stage2\n    vrshrn.s32      d20, q10, #15\n    vrshrn.s32      d21, q11, #15\n    vrshrn.s32      d24, q12, #14\n    vrshrn.s32      d25, q13, #14\n    vrshrn.s32      d28, q14, #14\n    vrshrn.s32      d29, q15, #14\n    vaddw.u8        q11, q10, d0\n    vaddw.u8        q12, q12, d0\n    vaddw.u8        q14, q14, d0\n  .if \\bpp != 16\n    vqmovun.s16     d1\\g_offs, q11\n    vqmovun.s16     d1\\r_offs, q12\n    vqmovun.s16     d1\\b_offs, q14\n  .else  /* rgb565 */\n    vqshlu.s16      q13, q11, #8\n    vqshlu.s16      q15, q12, #8\n    vqshlu.s16      q14, q14, #8\n    vsri.u16        q15, q13, #5\n    vsri.u16        q15, q14, #11\n  .endif\n.endm\n\n.macro do_yuv_to_rgb_stage2_store_load_stage1\n                                       /* \"do_yuv_to_rgb_stage2\" and \"store\" */\n                                       vrshrn.s32      d20, q10, #15\n    /* \"load\" and \"do_yuv_to_rgb_stage1\" */\n    pld             [U, #64]\n                                       vrshrn.s32      d21, q11, #15\n    pld             [V, #64]\n                                       vrshrn.s32      d24, q12, #14\n                                       vrshrn.s32      d25, q13, #14\n    vld1.8          {d4}, [U, :64]!\n                                       vrshrn.s32      d28, q14, #14\n    vld1.8          {d5}, [V, :64]!\n                                       vrshrn.s32      d29, q15, #14\n    vaddw.u8        q3, q1, d4      /* q3 = u - 128 */\n    vaddw.u8        q4, q1, d5      /* q2 = v - 128 */\n                                       vaddw.u8        q11, q10, d0\n    vmull.s16       q10, d6, d1[1]  /* multiply by -11277 */\n    vmlal.s16       q10, d8, d1[2]  /* multiply by -23401 */\n                                       vaddw.u8        q12, q12, d0\n                                       vaddw.u8        q14, q14, d0\n  .if \\bpp != 16  /**************** rgb24/rgb32 ******************************/\n                                       vqmovun.s16     d1\\g_offs, q11\n    pld             [Y, #64]\n                                       vqmovun.s16     d1\\r_offs, q12\n    vld1.8          {d0}, [Y, :64]!\n                                       vqmovun.s16     d1\\b_offs, q14\n    vmull.s16       q11, d7, d1[1]  /* multiply by -11277 */\n    vmlal.s16       q11, d9, d1[2]  /* multiply by -23401 */\n                                       do_store        \\bpp, 8\n    vmull.s16       q12, d8, d1[0]  /* multiply by 22971 */\n    vmull.s16       q13, d9, d1[0]  /* multiply by 22971 */\n    vmull.s16       q14, d6, d1[3]  /* multiply by 29033 */\n    vmull.s16       q15, d7, d1[3]  /* multiply by 29033 */\n  .else  /**************************** rgb565 ********************************/\n                                       vqshlu.s16      q13, q11, #8\n    pld             [Y, #64]\n                                       vqshlu.s16      q15, q12, #8\n                                       vqshlu.s16      q14, q14, #8\n    vld1.8          {d0}, [Y, :64]!\n    vmull.s16       q11, d7, d1[1]\n    vmlal.s16       q11, d9, d1[2]\n                                       vsri.u16        q15, q13, #5\n    vmull.s16       q12, d8, d1[0]\n                                       vsri.u16        q15, q14, #11\n    vmull.s16       q13, d9, d1[0]\n    vmull.s16       q14, d6, d1[3]\n                                       do_store        \\bpp, 8\n    vmull.s16       q15, d7, d1[3]\n  .endif\n.endm\n\n.macro do_yuv_to_rgb\n    do_yuv_to_rgb_stage1\n    do_yuv_to_rgb_stage2\n.endm\n\n/* Apple gas crashes on adrl, work around that by using adr.\n * But this requires a copy of these constants for each function.\n */\n\n.balign 16\njsimd_ycc_\\colorid\\()_neon_consts:\n  .short 0,      0,     0,      0\n  .short 22971, -11277, -23401, 29033\n  .short -128,  -128,   -128,   -128\n  .short -128,  -128,   -128,   -128\n\nasm_function jsimd_ycc_\\colorid\\()_convert_neon\n    OUTPUT_WIDTH    .req r0\n    INPUT_BUF       .req r1\n    INPUT_ROW       .req r2\n    OUTPUT_BUF      .req r3\n    NUM_ROWS        .req r4\n\n    INPUT_BUF0      .req r5\n    INPUT_BUF1      .req r6\n    INPUT_BUF2      .req INPUT_BUF\n\n    RGB             .req r7\n    Y               .req r8\n    U               .req r9\n    V               .req r10\n    N               .req ip\n\n    /* Load constants to d1, d2, d3 (d0 is just used for padding) */\n    adr             ip, jsimd_ycc_\\colorid\\()_neon_consts\n    vld1.16         {d0, d1, d2, d3}, [ip, :128]\n\n    /* Save ARM registers and handle input arguments */\n    push            {r4, r5, r6, r7, r8, r9, r10, lr}\n    ldr             NUM_ROWS, [sp, #(4 * 8)]\n    ldr             INPUT_BUF0, [INPUT_BUF]\n    ldr             INPUT_BUF1, [INPUT_BUF, #4]\n    ldr             INPUT_BUF2, [INPUT_BUF, #8]\n    .unreq          INPUT_BUF\n\n    /* Save NEON registers */\n    vpush           {d8-d15}\n\n    /* Initially set d10, d11, d12, d13 to 0xFF */\n    vmov.u8         q5, #255\n    vmov.u8         q6, #255\n\n    /* Outer loop over scanlines */\n    cmp             NUM_ROWS, #1\n    blt             9f\n0:\n    ldr             Y, [INPUT_BUF0, INPUT_ROW, lsl #2]\n    ldr             U, [INPUT_BUF1, INPUT_ROW, lsl #2]\n    mov             N, OUTPUT_WIDTH\n    ldr             V, [INPUT_BUF2, INPUT_ROW, lsl #2]\n    add             INPUT_ROW, INPUT_ROW, #1\n    ldr             RGB, [OUTPUT_BUF], #4\n\n    /* Inner loop over pixels */\n    subs            N, N, #8\n    blt             3f\n    do_load         8\n    do_yuv_to_rgb_stage1\n    subs            N, N, #8\n    blt             2f\n1:\n    do_yuv_to_rgb_stage2_store_load_stage1\n    subs            N, N, #8\n    bge             1b\n2:\n    do_yuv_to_rgb_stage2\n    do_store        \\bpp, 8\n    tst             N, #7\n    beq             8f\n3:\n    tst             N, #4\n    beq             3f\n    do_load         4\n3:\n    tst             N, #2\n    beq             4f\n    do_load         2\n4:\n    tst             N, #1\n    beq             5f\n    do_load         1\n5:\n    do_yuv_to_rgb\n    tst             N, #4\n    beq             6f\n    do_store        \\bpp, 4\n6:\n    tst             N, #2\n    beq             7f\n    do_store        \\bpp, 2\n7:\n    tst             N, #1\n    beq             8f\n    do_store        \\bpp, 1\n8:\n    subs            NUM_ROWS, NUM_ROWS, #1\n    bgt             0b\n9:\n    /* Restore all registers and return */\n    vpop            {d8-d15}\n    pop             {r4, r5, r6, r7, r8, r9, r10, pc}\n\n    .unreq          OUTPUT_WIDTH\n    .unreq          INPUT_ROW\n    .unreq          OUTPUT_BUF\n    .unreq          NUM_ROWS\n    .unreq          INPUT_BUF0\n    .unreq          INPUT_BUF1\n    .unreq          INPUT_BUF2\n    .unreq          RGB\n    .unreq          Y\n    .unreq          U\n    .unreq          V\n    .unreq          N\n\n.purgem do_yuv_to_rgb\n.purgem do_yuv_to_rgb_stage1\n.purgem do_yuv_to_rgb_stage2\n.purgem do_yuv_to_rgb_stage2_store_load_stage1\n\n.endm\n\n/*--------------------------------- id ----- bpp R  G  B */\ngenerate_jsimd_ycc_rgb_convert_neon extrgb,  24, 0, 1, 2\ngenerate_jsimd_ycc_rgb_convert_neon extbgr,  24, 2, 1, 0\ngenerate_jsimd_ycc_rgb_convert_neon extrgbx, 32, 0, 1, 2\ngenerate_jsimd_ycc_rgb_convert_neon extbgrx, 32, 2, 1, 0\ngenerate_jsimd_ycc_rgb_convert_neon extxbgr, 32, 3, 2, 1\ngenerate_jsimd_ycc_rgb_convert_neon extxrgb, 32, 1, 2, 3\ngenerate_jsimd_ycc_rgb_convert_neon rgb565,  16, 0, 0, 0\n\n.purgem do_load\n.purgem do_store\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_extrgb_ycc_convert_neon\n * jsimd_extbgr_ycc_convert_neon\n * jsimd_extrgbx_ycc_convert_neon\n * jsimd_extbgrx_ycc_convert_neon\n * jsimd_extxbgr_ycc_convert_neon\n * jsimd_extxrgb_ycc_convert_neon\n *\n * Colorspace conversion RGB -> YCbCr\n */\n\n.macro do_store size\n  .if \\size == 8\n    vst1.8          {d20}, [Y]!\n    vst1.8          {d21}, [U]!\n    vst1.8          {d22}, [V]!\n  .elseif \\size == 4\n    vst1.8          {d20[0]}, [Y]!\n    vst1.8          {d20[1]}, [Y]!\n    vst1.8          {d20[2]}, [Y]!\n    vst1.8          {d20[3]}, [Y]!\n    vst1.8          {d21[0]}, [U]!\n    vst1.8          {d21[1]}, [U]!\n    vst1.8          {d21[2]}, [U]!\n    vst1.8          {d21[3]}, [U]!\n    vst1.8          {d22[0]}, [V]!\n    vst1.8          {d22[1]}, [V]!\n    vst1.8          {d22[2]}, [V]!\n    vst1.8          {d22[3]}, [V]!\n  .elseif \\size == 2\n    vst1.8          {d20[4]}, [Y]!\n    vst1.8          {d20[5]}, [Y]!\n    vst1.8          {d21[4]}, [U]!\n    vst1.8          {d21[5]}, [U]!\n    vst1.8          {d22[4]}, [V]!\n    vst1.8          {d22[5]}, [V]!\n  .elseif \\size == 1\n    vst1.8          {d20[6]}, [Y]!\n    vst1.8          {d21[6]}, [U]!\n    vst1.8          {d22[6]}, [V]!\n  .else\n    .error unsupported macroblock size\n  .endif\n.endm\n\n.macro do_load bpp, size\n  .if \\bpp == 24\n    .if \\size == 8\n      vld3.8        {d10, d11, d12}, [RGB]!\n      pld           [RGB, #128]\n    .elseif \\size == 4\n      vld3.8        {d10[0], d11[0], d12[0]}, [RGB]!\n      vld3.8        {d10[1], d11[1], d12[1]}, [RGB]!\n      vld3.8        {d10[2], d11[2], d12[2]}, [RGB]!\n      vld3.8        {d10[3], d11[3], d12[3]}, [RGB]!\n    .elseif \\size == 2\n      vld3.8        {d10[4], d11[4], d12[4]}, [RGB]!\n      vld3.8        {d10[5], d11[5], d12[5]}, [RGB]!\n    .elseif \\size == 1\n      vld3.8        {d10[6], d11[6], d12[6]}, [RGB]!\n    .else\n      .error unsupported macroblock size\n    .endif\n  .elseif \\bpp == 32\n    .if \\size == 8\n      vld4.8        {d10, d11, d12, d13}, [RGB]!\n      pld           [RGB, #128]\n    .elseif \\size == 4\n      vld4.8        {d10[0], d11[0], d12[0], d13[0]}, [RGB]!\n      vld4.8        {d10[1], d11[1], d12[1], d13[1]}, [RGB]!\n      vld4.8        {d10[2], d11[2], d12[2], d13[2]}, [RGB]!\n      vld4.8        {d10[3], d11[3], d12[3], d13[3]}, [RGB]!\n    .elseif \\size == 2\n      vld4.8        {d10[4], d11[4], d12[4], d13[4]}, [RGB]!\n      vld4.8        {d10[5], d11[5], d12[5], d13[5]}, [RGB]!\n    .elseif \\size == 1\n      vld4.8        {d10[6], d11[6], d12[6], d13[6]}, [RGB]!\n    .else\n      .error unsupported macroblock size\n    .endif\n  .else\n    .error unsupported bpp\n  .endif\n.endm\n\n.macro generate_jsimd_rgb_ycc_convert_neon colorid, bpp, r_offs, g_offs, b_offs\n\n/*\n * 2-stage pipelined RGB->YCbCr conversion\n */\n\n.macro do_rgb_to_yuv_stage1\n    vmovl.u8        q2, d1\\r_offs  /* r = { d4, d5 } */\n    vmovl.u8        q3, d1\\g_offs  /* g = { d6, d7 } */\n    vmovl.u8        q4, d1\\b_offs  /* b = { d8, d9 } */\n    vmull.u16       q7, d4, d0[0]\n    vmlal.u16       q7, d6, d0[1]\n    vmlal.u16       q7, d8, d0[2]\n    vmull.u16       q8, d5, d0[0]\n    vmlal.u16       q8, d7, d0[1]\n    vmlal.u16       q8, d9, d0[2]\n    vrev64.32       q9, q1\n    vrev64.32       q13, q1\n    vmlsl.u16       q9, d4, d0[3]\n    vmlsl.u16       q9, d6, d1[0]\n    vmlal.u16       q9, d8, d1[1]\n    vmlsl.u16       q13, d5, d0[3]\n    vmlsl.u16       q13, d7, d1[0]\n    vmlal.u16       q13, d9, d1[1]\n    vrev64.32       q14, q1\n    vrev64.32       q15, q1\n    vmlal.u16       q14, d4, d1[1]\n    vmlsl.u16       q14, d6, d1[2]\n    vmlsl.u16       q14, d8, d1[3]\n    vmlal.u16       q15, d5, d1[1]\n    vmlsl.u16       q15, d7, d1[2]\n    vmlsl.u16       q15, d9, d1[3]\n.endm\n\n.macro do_rgb_to_yuv_stage2\n    vrshrn.u32      d20, q7, #16\n    vrshrn.u32      d21, q8, #16\n    vshrn.u32       d22, q9, #16\n    vshrn.u32       d23, q13, #16\n    vshrn.u32       d24, q14, #16\n    vshrn.u32       d25, q15, #16\n    vmovn.u16       d20, q10       /* d20 = y */\n    vmovn.u16       d21, q11       /* d21 = u */\n    vmovn.u16       d22, q12       /* d22 = v */\n.endm\n\n.macro do_rgb_to_yuv\n    do_rgb_to_yuv_stage1\n    do_rgb_to_yuv_stage2\n.endm\n\n.macro do_rgb_to_yuv_stage2_store_load_stage1\n      vrshrn.u32      d20, q7, #16\n      vrshrn.u32      d21, q8, #16\n      vshrn.u32       d22, q9, #16\n    vrev64.32       q9, q1\n      vshrn.u32       d23, q13, #16\n    vrev64.32       q13, q1\n      vshrn.u32       d24, q14, #16\n      vshrn.u32       d25, q15, #16\n    do_load         \\bpp, 8\n      vmovn.u16       d20, q10     /* d20 = y */\n    vmovl.u8        q2, d1\\r_offs  /* r = { d4, d5 } */\n      vmovn.u16       d21, q11     /* d21 = u */\n    vmovl.u8        q3, d1\\g_offs  /* g = { d6, d7 } */\n      vmovn.u16       d22, q12     /* d22 = v */\n    vmovl.u8        q4, d1\\b_offs  /* b = { d8, d9 } */\n    vmull.u16       q7, d4, d0[0]\n    vmlal.u16       q7, d6, d0[1]\n    vmlal.u16       q7, d8, d0[2]\n      vst1.8          {d20}, [Y]!\n    vmull.u16       q8, d5, d0[0]\n    vmlal.u16       q8, d7, d0[1]\n    vmlal.u16       q8, d9, d0[2]\n    vmlsl.u16       q9, d4, d0[3]\n    vmlsl.u16       q9, d6, d1[0]\n    vmlal.u16       q9, d8, d1[1]\n      vst1.8          {d21}, [U]!\n    vmlsl.u16       q13, d5, d0[3]\n    vmlsl.u16       q13, d7, d1[0]\n    vmlal.u16       q13, d9, d1[1]\n    vrev64.32       q14, q1\n    vrev64.32       q15, q1\n    vmlal.u16       q14, d4, d1[1]\n    vmlsl.u16       q14, d6, d1[2]\n    vmlsl.u16       q14, d8, d1[3]\n      vst1.8          {d22}, [V]!\n    vmlal.u16       q15, d5, d1[1]\n    vmlsl.u16       q15, d7, d1[2]\n    vmlsl.u16       q15, d9, d1[3]\n.endm\n\n.balign 16\njsimd_\\colorid\\()_ycc_neon_consts:\n  .short 19595, 38470, 7471,  11059\n  .short 21709, 32768, 27439, 5329\n  .short 32767, 128,   32767, 128\n  .short 32767, 128,   32767, 128\n\nasm_function jsimd_\\colorid\\()_ycc_convert_neon\n    OUTPUT_WIDTH    .req r0\n    INPUT_BUF       .req r1\n    OUTPUT_BUF      .req r2\n    OUTPUT_ROW      .req r3\n    NUM_ROWS        .req r4\n\n    OUTPUT_BUF0     .req r5\n    OUTPUT_BUF1     .req r6\n    OUTPUT_BUF2     .req OUTPUT_BUF\n\n    RGB             .req r7\n    Y               .req r8\n    U               .req r9\n    V               .req r10\n    N               .req ip\n\n    /* Load constants to d0, d1, d2, d3 */\n    adr             ip, jsimd_\\colorid\\()_ycc_neon_consts\n    vld1.16         {d0, d1, d2, d3}, [ip, :128]\n\n    /* Save ARM registers and handle input arguments */\n    push            {r4, r5, r6, r7, r8, r9, r10, lr}\n    ldr             NUM_ROWS, [sp, #(4 * 8)]\n    ldr             OUTPUT_BUF0, [OUTPUT_BUF]\n    ldr             OUTPUT_BUF1, [OUTPUT_BUF, #4]\n    ldr             OUTPUT_BUF2, [OUTPUT_BUF, #8]\n    .unreq          OUTPUT_BUF\n\n    /* Save NEON registers */\n    vpush           {d8-d15}\n\n    /* Outer loop over scanlines */\n    cmp             NUM_ROWS, #1\n    blt             9f\n0:\n    ldr             Y, [OUTPUT_BUF0, OUTPUT_ROW, lsl #2]\n    ldr             U, [OUTPUT_BUF1, OUTPUT_ROW, lsl #2]\n    mov             N, OUTPUT_WIDTH\n    ldr             V, [OUTPUT_BUF2, OUTPUT_ROW, lsl #2]\n    add             OUTPUT_ROW, OUTPUT_ROW, #1\n    ldr             RGB, [INPUT_BUF], #4\n\n    /* Inner loop over pixels */\n    subs            N, N, #8\n    blt             3f\n    do_load         \\bpp, 8\n    do_rgb_to_yuv_stage1\n    subs            N, N, #8\n    blt             2f\n1:\n    do_rgb_to_yuv_stage2_store_load_stage1\n    subs            N, N, #8\n    bge             1b\n2:\n    do_rgb_to_yuv_stage2\n    do_store        8\n    tst             N, #7\n    beq             8f\n3:\n    tst             N, #4\n    beq             3f\n    do_load         \\bpp, 4\n3:\n    tst             N, #2\n    beq             4f\n    do_load         \\bpp, 2\n4:\n    tst             N, #1\n    beq             5f\n    do_load         \\bpp, 1\n5:\n    do_rgb_to_yuv\n    tst             N, #4\n    beq             6f\n    do_store        4\n6:\n    tst             N, #2\n    beq             7f\n    do_store        2\n7:\n    tst             N, #1\n    beq             8f\n    do_store        1\n8:\n    subs            NUM_ROWS, NUM_ROWS, #1\n    bgt             0b\n9:\n    /* Restore all registers and return */\n    vpop            {d8-d15}\n    pop             {r4, r5, r6, r7, r8, r9, r10, pc}\n\n    .unreq          OUTPUT_WIDTH\n    .unreq          OUTPUT_ROW\n    .unreq          INPUT_BUF\n    .unreq          NUM_ROWS\n    .unreq          OUTPUT_BUF0\n    .unreq          OUTPUT_BUF1\n    .unreq          OUTPUT_BUF2\n    .unreq          RGB\n    .unreq          Y\n    .unreq          U\n    .unreq          V\n    .unreq          N\n\n.purgem do_rgb_to_yuv\n.purgem do_rgb_to_yuv_stage1\n.purgem do_rgb_to_yuv_stage2\n.purgem do_rgb_to_yuv_stage2_store_load_stage1\n\n.endm\n\n/*--------------------------------- id ----- bpp R  G  B */\ngenerate_jsimd_rgb_ycc_convert_neon extrgb,  24, 0, 1, 2\ngenerate_jsimd_rgb_ycc_convert_neon extbgr,  24, 2, 1, 0\ngenerate_jsimd_rgb_ycc_convert_neon extrgbx, 32, 0, 1, 2\ngenerate_jsimd_rgb_ycc_convert_neon extbgrx, 32, 2, 1, 0\ngenerate_jsimd_rgb_ycc_convert_neon extxbgr, 32, 3, 2, 1\ngenerate_jsimd_rgb_ycc_convert_neon extxrgb, 32, 1, 2, 3\n\n.purgem do_load\n.purgem do_store\n\n\n/*****************************************************************************/\n\n/*\n * Load data into workspace, applying unsigned->signed conversion\n *\n * TODO: can be combined with 'jsimd_fdct_ifast_neon' to get\n *       rid of VST1.16 instructions\n */\n\nasm_function jsimd_convsamp_neon\n    SAMPLE_DATA     .req r0\n    START_COL       .req r1\n    WORKSPACE       .req r2\n    TMP1            .req r3\n    TMP2            .req r4\n    TMP3            .req r5\n    TMP4            .req ip\n\n    push            {r4, r5}\n    vmov.u8         d0, #128\n\n    ldmia           SAMPLE_DATA!, {TMP1, TMP2, TMP3, TMP4}\n    add             TMP1, TMP1, START_COL\n    add             TMP2, TMP2, START_COL\n    add             TMP3, TMP3, START_COL\n    add             TMP4, TMP4, START_COL\n    vld1.8          {d16}, [TMP1]\n    vsubl.u8        q8, d16, d0\n    vld1.8          {d18}, [TMP2]\n    vsubl.u8        q9, d18, d0\n    vld1.8          {d20}, [TMP3]\n    vsubl.u8        q10, d20, d0\n    vld1.8          {d22}, [TMP4]\n    ldmia           SAMPLE_DATA!, {TMP1, TMP2, TMP3, TMP4}\n    vsubl.u8        q11, d22, d0\n    vst1.16         {d16, d17, d18, d19}, [WORKSPACE, :128]!\n    add             TMP1, TMP1, START_COL\n    add             TMP2, TMP2, START_COL\n    vst1.16         {d20, d21, d22, d23}, [WORKSPACE, :128]!\n    add             TMP3, TMP3, START_COL\n    add             TMP4, TMP4, START_COL\n    vld1.8          {d24}, [TMP1]\n    vsubl.u8        q12, d24, d0\n    vld1.8          {d26}, [TMP2]\n    vsubl.u8        q13, d26, d0\n    vld1.8          {d28}, [TMP3]\n    vsubl.u8        q14, d28, d0\n    vld1.8          {d30}, [TMP4]\n    vsubl.u8        q15, d30, d0\n    vst1.16         {d24, d25, d26, d27}, [WORKSPACE, :128]!\n    vst1.16         {d28, d29, d30, d31}, [WORKSPACE, :128]!\n    pop             {r4, r5}\n    bx              lr\n\n    .unreq          SAMPLE_DATA\n    .unreq          START_COL\n    .unreq          WORKSPACE\n    .unreq          TMP1\n    .unreq          TMP2\n    .unreq          TMP3\n    .unreq          TMP4\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_fdct_ifast_neon\n *\n * This function contains a fast, not so accurate integer implementation of\n * the forward DCT (Discrete Cosine Transform). It uses the same calculations\n * and produces exactly the same output as IJG's original 'jpeg_fdct_ifast'\n * function from jfdctfst.c\n *\n * TODO: can be combined with 'jsimd_convsamp_neon' to get\n *       rid of a bunch of VLD1.16 instructions\n */\n\n#define XFIX_0_382683433 d0[0]\n#define XFIX_0_541196100 d0[1]\n#define XFIX_0_707106781 d0[2]\n#define XFIX_1_306562965 d0[3]\n\n.balign 16\njsimd_fdct_ifast_neon_consts:\n  .short (98 * 128)               /* XFIX_0_382683433 */\n  .short (139 * 128)              /* XFIX_0_541196100 */\n  .short (181 * 128)              /* XFIX_0_707106781 */\n  .short (334 * 128 - 256 * 128)  /* XFIX_1_306562965 */\n\nasm_function jsimd_fdct_ifast_neon\n\n    DATA            .req r0\n    TMP             .req ip\n\n    vpush           {d8-d15}\n\n    /* Load constants */\n    adr             TMP, jsimd_fdct_ifast_neon_consts\n    vld1.16         {d0}, [TMP, :64]\n\n    /* Load all DATA into NEON registers with the following allocation:\n     *       0 1 2 3 | 4 5 6 7\n     *      ---------+--------\n     *   0 | d16     | d17    | q8\n     *   1 | d18     | d19    | q9\n     *   2 | d20     | d21    | q10\n     *   3 | d22     | d23    | q11\n     *   4 | d24     | d25    | q12\n     *   5 | d26     | d27    | q13\n     *   6 | d28     | d29    | q14\n     *   7 | d30     | d31    | q15\n     */\n\n    vld1.16         {d16, d17, d18, d19}, [DATA, :128]!\n    vld1.16         {d20, d21, d22, d23}, [DATA, :128]!\n    vld1.16         {d24, d25, d26, d27}, [DATA, :128]!\n    vld1.16         {d28, d29, d30, d31}, [DATA, :128]\n    sub             DATA, DATA, #(128 - 32)\n\n    mov             TMP, #2\n1:\n    /* Transpose */\n    vtrn.16         q12, q13\n    vtrn.16         q10, q11\n    vtrn.16         q8, q9\n    vtrn.16         q14, q15\n    vtrn.32         q9, q11\n    vtrn.32         q13, q15\n    vtrn.32         q8, q10\n    vtrn.32         q12, q14\n    vswp            d30, d23\n    vswp            d24, d17\n    vswp            d26, d19\n      /* 1-D FDCT */\n      vadd.s16        q2, q11, q12\n    vswp            d28, d21\n      vsub.s16        q12, q11, q12\n      vsub.s16        q6, q10, q13\n      vadd.s16        q10, q10, q13\n      vsub.s16        q7, q9, q14\n      vadd.s16        q9, q9, q14\n      vsub.s16        q1, q8, q15\n      vadd.s16        q8, q8, q15\n      vsub.s16        q4, q9, q10\n      vsub.s16        q5, q8, q2\n      vadd.s16        q3, q9, q10\n      vadd.s16        q4, q4, q5\n      vadd.s16        q2, q8, q2\n      vqdmulh.s16     q4, q4, XFIX_0_707106781\n      vadd.s16        q11, q12, q6\n      vadd.s16        q8, q2, q3\n      vsub.s16        q12, q2, q3\n      vadd.s16        q3, q6, q7\n      vadd.s16        q7, q7, q1\n      vqdmulh.s16     q3, q3, XFIX_0_707106781\n      vsub.s16        q6, q11, q7\n      vadd.s16        q10, q5, q4\n      vqdmulh.s16     q6, q6, XFIX_0_382683433\n      vsub.s16        q14, q5, q4\n      vqdmulh.s16     q11, q11, XFIX_0_541196100\n      vqdmulh.s16     q5, q7, XFIX_1_306562965\n      vadd.s16        q4, q1, q3\n      vsub.s16        q3, q1, q3\n      vadd.s16        q7, q7, q6\n      vadd.s16        q11, q11, q6\n      vadd.s16        q7, q7, q5\n      vadd.s16        q13, q3, q11\n      vsub.s16        q11, q3, q11\n      vadd.s16        q9, q4, q7\n      vsub.s16        q15, q4, q7\n    subs            TMP, TMP, #1\n    bne             1b\n\n    /* store results */\n    vst1.16         {d16, d17, d18, d19}, [DATA, :128]!\n    vst1.16         {d20, d21, d22, d23}, [DATA, :128]!\n    vst1.16         {d24, d25, d26, d27}, [DATA, :128]!\n    vst1.16         {d28, d29, d30, d31}, [DATA, :128]\n\n    vpop            {d8-d15}\n    bx              lr\n\n    .unreq          DATA\n    .unreq          TMP\n\n\n/*****************************************************************************/\n\n/*\n * GLOBAL(void)\n * jsimd_quantize_neon (JCOEFPTR coef_block, DCTELEM *divisors,\n *                      DCTELEM *workspace);\n *\n * Note: the code uses 2 stage pipelining in order to improve instructions\n *       scheduling and eliminate stalls (this provides ~15% better\n *       performance for this function on both ARM Cortex-A8 and\n *       ARM Cortex-A9 when compared to the non-pipelined variant).\n *       The instructions which belong to the second stage use different\n *       indentation for better readiability.\n */\nasm_function jsimd_quantize_neon\n\n    COEF_BLOCK      .req r0\n    DIVISORS        .req r1\n    WORKSPACE       .req r2\n\n    RECIPROCAL      .req DIVISORS\n    CORRECTION      .req r3\n    SHIFT           .req ip\n    LOOP_COUNT      .req r4\n\n    vld1.16         {d0, d1, d2, d3}, [WORKSPACE, :128]!\n    vabs.s16        q12, q0\n    add             CORRECTION, DIVISORS, #(64 * 2)\n    add             SHIFT, DIVISORS, #(64 * 6)\n    vld1.16         {d20, d21, d22, d23}, [CORRECTION, :128]!\n    vabs.s16        q13, q1\n    vld1.16         {d16, d17, d18, d19}, [RECIPROCAL, :128]!\n    vadd.u16        q12, q12, q10  /* add correction */\n    vadd.u16        q13, q13, q11\n    vmull.u16       q10, d24, d16  /* multiply by reciprocal */\n    vmull.u16       q11, d25, d17\n    vmull.u16       q8, d26, d18\n    vmull.u16       q9, d27, d19\n    vld1.16         {d24, d25, d26, d27}, [SHIFT, :128]!\n    vshrn.u32       d20, q10, #16\n    vshrn.u32       d21, q11, #16\n    vshrn.u32       d22, q8, #16\n    vshrn.u32       d23, q9, #16\n    vneg.s16        q12, q12\n    vneg.s16        q13, q13\n    vshr.s16        q2, q0, #15    /* extract sign */\n    vshr.s16        q3, q1, #15\n    vshl.u16        q14, q10, q12  /* shift */\n    vshl.u16        q15, q11, q13\n\n    push            {r4, r5}\n    mov             LOOP_COUNT, #3\n1:\n    vld1.16         {d0, d1, d2, d3}, [WORKSPACE, :128]!\n      veor.u16        q14, q14, q2  /* restore sign */\n    vabs.s16        q12, q0\n    vld1.16         {d20, d21, d22, d23}, [CORRECTION, :128]!\n    vabs.s16        q13, q1\n      veor.u16        q15, q15, q3\n    vld1.16         {d16, d17, d18, d19}, [RECIPROCAL, :128]!\n    vadd.u16        q12, q12, q10  /* add correction */\n    vadd.u16        q13, q13, q11\n    vmull.u16       q10, d24, d16  /* multiply by reciprocal */\n    vmull.u16       q11, d25, d17\n    vmull.u16       q8, d26, d18\n    vmull.u16       q9, d27, d19\n      vsub.u16        q14, q14, q2\n    vld1.16         {d24, d25, d26, d27}, [SHIFT, :128]!\n      vsub.u16        q15, q15, q3\n    vshrn.u32       d20, q10, #16\n    vshrn.u32       d21, q11, #16\n      vst1.16         {d28, d29, d30, d31}, [COEF_BLOCK, :128]!\n    vshrn.u32       d22, q8, #16\n    vshrn.u32       d23, q9, #16\n    vneg.s16        q12, q12\n    vneg.s16        q13, q13\n    vshr.s16        q2, q0, #15    /* extract sign */\n    vshr.s16        q3, q1, #15\n    vshl.u16        q14, q10, q12  /* shift */\n    vshl.u16        q15, q11, q13\n    subs            LOOP_COUNT, LOOP_COUNT, #1\n    bne             1b\n    pop             {r4, r5}\n\n      veor.u16        q14, q14, q2  /* restore sign */\n      veor.u16        q15, q15, q3\n      vsub.u16        q14, q14, q2\n      vsub.u16        q15, q15, q3\n      vst1.16         {d28, d29, d30, d31}, [COEF_BLOCK, :128]!\n\n    bx              lr  /* return */\n\n    .unreq          COEF_BLOCK\n    .unreq          DIVISORS\n    .unreq          WORKSPACE\n    .unreq          RECIPROCAL\n    .unreq          CORRECTION\n    .unreq          SHIFT\n    .unreq          LOOP_COUNT\n\n\n/*****************************************************************************/\n\n/*\n * GLOBAL(void)\n * jsimd_h2v1_fancy_upsample_neon (int max_v_samp_factor,\n *                                 JDIMENSION downsampled_width,\n *                                 JSAMPARRAY input_data,\n *                                 JSAMPARRAY *output_data_ptr);\n *\n * Note: the use of unaligned writes is the main remaining bottleneck in\n *       this code, which can be potentially solved to get up to tens\n *       of percents performance improvement on Cortex-A8/Cortex-A9.\n */\n\n/*\n * Upsample 16 source pixels to 32 destination pixels. The new 16 source\n * pixels are loaded to q0. The previous 16 source pixels are in q1. The\n * shifted-by-one source pixels are constructed in q2 by using q0 and q1.\n * Register d28 is used for multiplication by 3. Register q15 is used\n * for adding +1 bias.\n */\n.macro upsample16 OUTPTR, INPTR\n    vld1.8          {q0}, [\\INPTR]!\n    vmovl.u8        q8, d0\n    vext.8          q2, q1, q0, #15\n    vmovl.u8        q9, d1\n    vaddw.u8        q10, q15, d4\n    vaddw.u8        q11, q15, d5\n    vmlal.u8        q8, d4, d28\n    vmlal.u8        q9, d5, d28\n    vmlal.u8        q10, d0, d28\n    vmlal.u8        q11, d1, d28\n    vmov            q1, q0        /* backup source pixels to q1 */\n    vrshrn.u16      d6, q8, #2\n    vrshrn.u16      d7, q9, #2\n    vshrn.u16       d8, q10, #2\n    vshrn.u16       d9, q11, #2\n    vst2.8          {d6, d7, d8, d9}, [\\OUTPTR]!\n.endm\n\n/*\n * Upsample 32 source pixels to 64 destination pixels. Compared to 'usample16'\n * macro, the roles of q0 and q1 registers are reversed for even and odd\n * groups of 16 pixels, that's why \"vmov q1, q0\" instructions are not needed.\n * Also this unrolling allows to reorder loads and stores to compensate\n * multiplication latency and reduce stalls.\n */\n.macro upsample32 OUTPTR, INPTR\n    /* even 16 pixels group */\n    vld1.8          {q0}, [\\INPTR]!\n    vmovl.u8        q8, d0\n    vext.8          q2, q1, q0, #15\n    vmovl.u8        q9, d1\n    vaddw.u8        q10, q15, d4\n    vaddw.u8        q11, q15, d5\n    vmlal.u8        q8, d4, d28\n    vmlal.u8        q9, d5, d28\n    vmlal.u8        q10, d0, d28\n    vmlal.u8        q11, d1, d28\n      /* odd 16 pixels group */\n      vld1.8          {q1}, [\\INPTR]!\n    vrshrn.u16      d6, q8, #2\n    vrshrn.u16      d7, q9, #2\n    vshrn.u16       d8, q10, #2\n    vshrn.u16       d9, q11, #2\n      vmovl.u8        q8, d2\n      vext.8          q2, q0, q1, #15\n      vmovl.u8        q9, d3\n      vaddw.u8        q10, q15, d4\n      vaddw.u8        q11, q15, d5\n      vmlal.u8        q8, d4, d28\n      vmlal.u8        q9, d5, d28\n      vmlal.u8        q10, d2, d28\n      vmlal.u8        q11, d3, d28\n    vst2.8          {d6, d7, d8, d9}, [\\OUTPTR]!\n      vrshrn.u16      d6, q8, #2\n      vrshrn.u16      d7, q9, #2\n      vshrn.u16       d8, q10, #2\n      vshrn.u16       d9, q11, #2\n      vst2.8          {d6, d7, d8, d9}, [\\OUTPTR]!\n.endm\n\n/*\n * Upsample a row of WIDTH pixels from INPTR to OUTPTR.\n */\n.macro upsample_row OUTPTR, INPTR, WIDTH, TMP1\n    /* special case for the first and last pixels */\n    sub             \\WIDTH, \\WIDTH, #1\n    add             \\OUTPTR, \\OUTPTR, #1\n    ldrb            \\TMP1, [\\INPTR, \\WIDTH]\n    strb            \\TMP1, [\\OUTPTR, \\WIDTH, asl #1]\n    ldrb            \\TMP1, [\\INPTR], #1\n    strb            \\TMP1, [\\OUTPTR, #-1]\n    vmov.8          d3[7], \\TMP1\n\n    subs            \\WIDTH, \\WIDTH, #32\n    blt             5f\n0:  /* process 32 pixels per iteration */\n    upsample32      \\OUTPTR, \\INPTR\n    subs            \\WIDTH, \\WIDTH, #32\n    bge             0b\n5:\n    adds            \\WIDTH, \\WIDTH, #16\n    blt             1f\n0:  /* process 16 pixels if needed */\n    upsample16      \\OUTPTR, \\INPTR\n    subs            \\WIDTH, \\WIDTH, #16\n1:\n    adds            \\WIDTH, \\WIDTH, #16\n    beq             9f\n\n    /* load the remaining 1-15 pixels */\n    add             \\INPTR, \\INPTR, \\WIDTH\n    tst             \\WIDTH, #1\n    beq             2f\n    sub             \\INPTR, \\INPTR, #1\n    vld1.8          {d0[0]}, [\\INPTR]\n2:\n    tst             \\WIDTH, #2\n    beq             2f\n    vext.8          d0, d0, d0, #6\n    sub             \\INPTR, \\INPTR, #1\n    vld1.8          {d0[1]}, [\\INPTR]\n    sub             \\INPTR, \\INPTR, #1\n    vld1.8          {d0[0]}, [\\INPTR]\n2:\n    tst             \\WIDTH, #4\n    beq             2f\n    vrev64.32       d0, d0\n    sub             \\INPTR, \\INPTR, #1\n    vld1.8          {d0[3]}, [\\INPTR]\n    sub             \\INPTR, \\INPTR, #1\n    vld1.8          {d0[2]}, [\\INPTR]\n    sub             \\INPTR, \\INPTR, #1\n    vld1.8          {d0[1]}, [\\INPTR]\n    sub             \\INPTR, \\INPTR, #1\n    vld1.8          {d0[0]}, [\\INPTR]\n2:\n    tst             \\WIDTH, #8\n    beq             2f\n    vmov            d1, d0\n    sub             \\INPTR, \\INPTR, #8\n    vld1.8          {d0}, [\\INPTR]\n2:  /* upsample the remaining pixels */\n    vmovl.u8        q8, d0\n    vext.8          q2, q1, q0, #15\n    vmovl.u8        q9, d1\n    vaddw.u8        q10, q15, d4\n    vaddw.u8        q11, q15, d5\n    vmlal.u8        q8, d4, d28\n    vmlal.u8        q9, d5, d28\n    vmlal.u8        q10, d0, d28\n    vmlal.u8        q11, d1, d28\n    vrshrn.u16      d10, q8, #2\n    vrshrn.u16      d12, q9, #2\n    vshrn.u16       d11, q10, #2\n    vshrn.u16       d13, q11, #2\n    vzip.8          d10, d11\n    vzip.8          d12, d13\n    /* store the remaining pixels */\n    tst             \\WIDTH, #8\n    beq             2f\n    vst1.8          {d10, d11}, [\\OUTPTR]!\n    vmov            q5, q6\n2:\n    tst             \\WIDTH, #4\n    beq             2f\n    vst1.8          {d10}, [\\OUTPTR]!\n    vmov            d10, d11\n2:\n    tst             \\WIDTH, #2\n    beq             2f\n    vst1.8          {d10[0]}, [\\OUTPTR]!\n    vst1.8          {d10[1]}, [\\OUTPTR]!\n    vst1.8          {d10[2]}, [\\OUTPTR]!\n    vst1.8          {d10[3]}, [\\OUTPTR]!\n    vext.8          d10, d10, d10, #4\n2:\n    tst             \\WIDTH, #1\n    beq             2f\n    vst1.8          {d10[0]}, [\\OUTPTR]!\n    vst1.8          {d10[1]}, [\\OUTPTR]!\n2:\n9:\n.endm\n\nasm_function jsimd_h2v1_fancy_upsample_neon\n\n    MAX_V_SAMP_FACTOR .req r0\n    DOWNSAMPLED_WIDTH .req r1\n    INPUT_DATA        .req r2\n    OUTPUT_DATA_PTR   .req r3\n    OUTPUT_DATA       .req OUTPUT_DATA_PTR\n\n    OUTPTR            .req r4\n    INPTR             .req r5\n    WIDTH             .req ip\n    TMP               .req lr\n\n    push            {r4, r5, r6, lr}\n    vpush           {d8-d15}\n\n    ldr             OUTPUT_DATA, [OUTPUT_DATA_PTR]\n    cmp             MAX_V_SAMP_FACTOR, #0\n    ble             99f\n\n    /* initialize constants */\n    vmov.u8         d28, #3\n    vmov.u16        q15, #1\n11:\n    ldr             INPTR, [INPUT_DATA], #4\n    ldr             OUTPTR, [OUTPUT_DATA], #4\n    mov             WIDTH, DOWNSAMPLED_WIDTH\n    upsample_row    OUTPTR, INPTR, WIDTH, TMP\n    subs            MAX_V_SAMP_FACTOR, MAX_V_SAMP_FACTOR, #1\n    bgt             11b\n\n99:\n    vpop            {d8-d15}\n    pop             {r4, r5, r6, pc}\n\n    .unreq          MAX_V_SAMP_FACTOR\n    .unreq          DOWNSAMPLED_WIDTH\n    .unreq          INPUT_DATA\n    .unreq          OUTPUT_DATA_PTR\n    .unreq          OUTPUT_DATA\n\n    .unreq          OUTPTR\n    .unreq          INPTR\n    .unreq          WIDTH\n    .unreq          TMP\n\n.purgem upsample16\n.purgem upsample32\n.purgem upsample_row\n\n\n/*****************************************************************************/\n\n/*\n * GLOBAL(JOCTET*)\n * jsimd_huff_encode_one_block (working_state *state, JOCTET *buffer,\n *                              JCOEFPTR block, int last_dc_val,\n *                              c_derived_tbl *dctbl, c_derived_tbl *actbl)\n *\n */\n\n.macro emit_byte BUFFER, PUT_BUFFER, PUT_BITS, ZERO, TMP\n    sub             \\PUT_BITS, \\PUT_BITS, #0x8\n    lsr             \\TMP, \\PUT_BUFFER, \\PUT_BITS\n    uxtb            \\TMP, \\TMP\n    strb            \\TMP, [\\BUFFER, #1]!\n    cmp             \\TMP, #0xff\n    /*it eq*/\n    strbeq          \\ZERO, [\\BUFFER, #1]!\n.endm\n\n.macro put_bits PUT_BUFFER, PUT_BITS, CODE, SIZE\n    /*lsl             \\PUT_BUFFER, \\PUT_BUFFER, \\SIZE*/\n    add             \\PUT_BITS, \\SIZE\n    /*orr             \\PUT_BUFFER, \\PUT_BUFFER, \\CODE*/\n    orr             \\PUT_BUFFER, \\CODE, \\PUT_BUFFER, lsl \\SIZE\n.endm\n\n.macro checkbuf15 BUFFER, PUT_BUFFER, PUT_BITS, ZERO, TMP\n  cmp               \\PUT_BITS, #0x10\n  blt               15f\n    eor               \\ZERO, \\ZERO, \\ZERO\n    emit_byte         \\BUFFER, \\PUT_BUFFER, \\PUT_BITS, \\ZERO, \\TMP\n    emit_byte         \\BUFFER, \\PUT_BUFFER, \\PUT_BITS, \\ZERO, \\TMP\n15:\n.endm\n\n.balign 16\njsimd_huff_encode_one_block_neon_consts:\n  .byte 0x01\n  .byte 0x02\n  .byte 0x04\n  .byte 0x08\n  .byte 0x10\n  .byte 0x20\n  .byte 0x40\n  .byte 0x80\n\nasm_function jsimd_huff_encode_one_block_neon\n    push            {r4, r5, r6, r7, r8, r9, r10, r11, lr}\n    add             r7, sp, #0x1c\n    sub             r4, sp, #0x40\n    bfc             r4, #0, #5\n    mov             sp, r4           /* align sp on 32 bytes */\n    vst1.64         {d8, d9, d10, d11}, [r4, :128]!\n    vst1.64         {d12, d13, d14, d15}, [r4, :128]\n    sub             sp, #0x140       /* reserve 320 bytes */\n    str             r0, [sp, #0x18]  /* working state > sp + Ox18 */\n    add             r4, sp, #0x20    /* r4 = t1 */\n    ldr             lr, [r7, #0x8]   /* lr = dctbl */\n    sub             r10, r1, #0x1    /* r10=buffer-- */\n    ldrsh           r1, [r2]\n    mov             r9, #0x10\n    mov             r8, #0x1\n    adr             r5, jsimd_huff_encode_one_block_neon_consts\n    /* prepare data */\n    vld1.8          {d26}, [r5, :64]\n    veor            q8, q8, q8\n    veor            q9, q9, q9\n    vdup.16         q14, r9\n    vdup.16         q15, r8\n    veor            q10, q10, q10\n    veor            q11, q11, q11\n    sub             r1, r1, r3\n    add             r9, r2, #0x22\n    add             r8, r2, #0x18\n    add             r3, r2, #0x36\n    vmov.16         d0[0], r1\n    vld1.16         {d2[0]}, [r9, :16]\n    vld1.16         {d4[0]}, [r8, :16]\n    vld1.16         {d6[0]}, [r3, :16]\n    add             r1, r2, #0x2\n    add             r9, r2, #0x30\n    add             r8, r2, #0x26\n    add             r3, r2, #0x28\n    vld1.16         {d0[1]}, [r1, :16]\n    vld1.16         {d2[1]}, [r9, :16]\n    vld1.16         {d4[1]}, [r8, :16]\n    vld1.16         {d6[1]}, [r3, :16]\n    add             r1, r2, #0x10\n    add             r9, r2, #0x40\n    add             r8, r2, #0x34\n    add             r3, r2, #0x1a\n    vld1.16         {d0[2]}, [r1, :16]\n    vld1.16         {d2[2]}, [r9, :16]\n    vld1.16         {d4[2]}, [r8, :16]\n    vld1.16         {d6[2]}, [r3, :16]\n    add             r1, r2, #0x20\n    add             r9, r2, #0x32\n    add             r8, r2, #0x42\n    add             r3, r2, #0xc\n    vld1.16         {d0[3]}, [r1, :16]\n    vld1.16         {d2[3]}, [r9, :16]\n    vld1.16         {d4[3]}, [r8, :16]\n    vld1.16         {d6[3]}, [r3, :16]\n    add             r1, r2, #0x12\n    add             r9, r2, #0x24\n    add             r8, r2, #0x50\n    add             r3, r2, #0xe\n    vld1.16         {d1[0]}, [r1, :16]\n    vld1.16         {d3[0]}, [r9, :16]\n    vld1.16         {d5[0]}, [r8, :16]\n    vld1.16         {d7[0]}, [r3, :16]\n    add             r1, r2, #0x4\n    add             r9, r2, #0x16\n    add             r8, r2, #0x60\n    add             r3, r2, #0x1c\n    vld1.16         {d1[1]}, [r1, :16]\n    vld1.16         {d3[1]}, [r9, :16]\n    vld1.16         {d5[1]}, [r8, :16]\n    vld1.16         {d7[1]}, [r3, :16]\n    add             r1, r2, #0x6\n    add             r9, r2, #0x8\n    add             r8, r2, #0x52\n    add             r3, r2, #0x2a\n    vld1.16         {d1[2]}, [r1, :16]\n    vld1.16         {d3[2]}, [r9, :16]\n    vld1.16         {d5[2]}, [r8, :16]\n    vld1.16         {d7[2]}, [r3, :16]\n    add             r1, r2, #0x14\n    add             r9, r2, #0xa\n    add             r8, r2, #0x44\n    add             r3, r2, #0x38\n    vld1.16         {d1[3]}, [r1, :16]\n    vld1.16         {d3[3]}, [r9, :16]\n    vld1.16         {d5[3]}, [r8, :16]\n    vld1.16         {d7[3]}, [r3, :16]\n    vcgt.s16        q8, q8, q0\n    vcgt.s16        q9, q9, q1\n    vcgt.s16        q10, q10, q2\n    vcgt.s16        q11, q11, q3\n    vabs.s16        q0, q0\n    vabs.s16        q1, q1\n    vabs.s16        q2, q2\n    vabs.s16        q3, q3\n    veor            q8, q8, q0\n    veor            q9, q9, q1\n    veor            q10, q10, q2\n    veor            q11, q11, q3\n    add             r9, r4, #0x20\n    add             r8, r4, #0x80\n    add             r3, r4, #0xa0\n    vclz.i16        q0, q0\n    vclz.i16        q1, q1\n    vclz.i16        q2, q2\n    vclz.i16        q3, q3\n    vsub.i16        q0, q14, q0\n    vsub.i16        q1, q14, q1\n    vsub.i16        q2, q14, q2\n    vsub.i16        q3, q14, q3\n    vst1.16         {d0, d1, d2, d3}, [r4, :256]\n    vst1.16         {d4, d5, d6, d7}, [r9, :256]\n    vshl.s16        q0, q15, q0\n    vshl.s16        q1, q15, q1\n    vshl.s16        q2, q15, q2\n    vshl.s16        q3, q15, q3\n    vsub.i16        q0, q0, q15\n    vsub.i16        q1, q1, q15\n    vsub.i16        q2, q2, q15\n    vsub.i16        q3, q3, q15\n    vand            q8, q8, q0\n    vand            q9, q9, q1\n    vand            q10, q10, q2\n    vand            q11, q11, q3\n    vst1.16         {d16, d17, d18, d19}, [r8, :256]\n    vst1.16         {d20, d21, d22, d23}, [r3, :256]\n    add             r1, r2, #0x46\n    add             r9, r2, #0x3a\n    add             r8, r2, #0x74\n    add             r3, r2, #0x6a\n    vld1.16         {d8[0]}, [r1, :16]\n    vld1.16         {d10[0]}, [r9, :16]\n    vld1.16         {d12[0]}, [r8, :16]\n    vld1.16         {d14[0]}, [r3, :16]\n    veor            q8, q8, q8\n    veor            q9, q9, q9\n    veor            q10, q10, q10\n    veor            q11, q11, q11\n    add             r1, r2, #0x54\n    add             r9, r2, #0x2c\n    add             r8, r2, #0x76\n    add             r3, r2, #0x78\n    vld1.16         {d8[1]}, [r1, :16]\n    vld1.16         {d10[1]}, [r9, :16]\n    vld1.16         {d12[1]}, [r8, :16]\n    vld1.16         {d14[1]}, [r3, :16]\n    add             r1, r2, #0x62\n    add             r9, r2, #0x1e\n    add             r8, r2, #0x68\n    add             r3, r2, #0x7a\n    vld1.16         {d8[2]}, [r1, :16]\n    vld1.16         {d10[2]}, [r9, :16]\n    vld1.16         {d12[2]}, [r8, :16]\n    vld1.16         {d14[2]}, [r3, :16]\n    add             r1, r2, #0x70\n    add             r9, r2, #0x2e\n    add             r8, r2, #0x5a\n    add             r3, r2, #0x6c\n    vld1.16         {d8[3]}, [r1, :16]\n    vld1.16         {d10[3]}, [r9, :16]\n    vld1.16         {d12[3]}, [r8, :16]\n    vld1.16         {d14[3]}, [r3, :16]\n    add             r1, r2, #0x72\n    add             r9, r2, #0x3c\n    add             r8, r2, #0x4c\n    add             r3, r2, #0x5e\n    vld1.16         {d9[0]}, [r1, :16]\n    vld1.16         {d11[0]}, [r9, :16]\n    vld1.16         {d13[0]}, [r8, :16]\n    vld1.16         {d15[0]}, [r3, :16]\n    add             r1, r2, #0x64\n    add             r9, r2, #0x4a\n    add             r8, r2, #0x3e\n    add             r3, r2, #0x6e\n    vld1.16         {d9[1]}, [r1, :16]\n    vld1.16         {d11[1]}, [r9, :16]\n    vld1.16         {d13[1]}, [r8, :16]\n    vld1.16         {d15[1]}, [r3, :16]\n    add             r1, r2, #0x56\n    add             r9, r2, #0x58\n    add             r8, r2, #0x4e\n    add             r3, r2, #0x7c\n    vld1.16         {d9[2]}, [r1, :16]\n    vld1.16         {d11[2]}, [r9, :16]\n    vld1.16         {d13[2]}, [r8, :16]\n    vld1.16         {d15[2]}, [r3, :16]\n    add             r1, r2, #0x48\n    add             r9, r2, #0x66\n    add             r8, r2, #0x5c\n    add             r3, r2, #0x7e\n    vld1.16         {d9[3]}, [r1, :16]\n    vld1.16         {d11[3]}, [r9, :16]\n    vld1.16         {d13[3]}, [r8, :16]\n    vld1.16         {d15[3]}, [r3, :16]\n    vcgt.s16        q8, q8, q4\n    vcgt.s16        q9, q9, q5\n    vcgt.s16        q10, q10, q6\n    vcgt.s16        q11, q11, q7\n    vabs.s16        q4, q4\n    vabs.s16        q5, q5\n    vabs.s16        q6, q6\n    vabs.s16        q7, q7\n    veor            q8, q8, q4\n    veor            q9, q9, q5\n    veor            q10, q10, q6\n    veor            q11, q11, q7\n    add             r1, r4, #0x40\n    add             r9, r4, #0x60\n    add             r8, r4, #0xc0\n    add             r3, r4, #0xe0\n    vclz.i16        q4, q4\n    vclz.i16        q5, q5\n    vclz.i16        q6, q6\n    vclz.i16        q7, q7\n    vsub.i16        q4, q14, q4\n    vsub.i16        q5, q14, q5\n    vsub.i16        q6, q14, q6\n    vsub.i16        q7, q14, q7\n    vst1.16         {d8, d9, d10, d11}, [r1, :256]\n    vst1.16         {d12, d13, d14, d15}, [r9, :256]\n    vshl.s16        q4, q15, q4\n    vshl.s16        q5, q15, q5\n    vshl.s16        q6, q15, q6\n    vshl.s16        q7, q15, q7\n    vsub.i16        q4, q4, q15\n    vsub.i16        q5, q5, q15\n    vsub.i16        q6, q6, q15\n    vsub.i16        q7, q7, q15\n    vand            q8, q8, q4\n    vand            q9, q9, q5\n    vand            q10, q10, q6\n    vand            q11, q11, q7\n    vst1.16         {d16, d17, d18, d19}, [r8, :256]\n    vst1.16         {d20, d21, d22, d23}, [r3, :256]\n    ldr             r12, [r7, #0xc]       /* r12 = actbl */\n    add             r1, lr, #0x400        /* r1 = dctbl->ehufsi */\n    mov             r9, r12               /* r9 = actbl */\n    add             r6, r4, #0x80         /* r6 = t2 */\n    ldr             r11, [r0, #0x8]       /* r11 = put_buffer */\n    ldr             r4, [r0, #0xc]        /* r4  = put_bits */\n    ldrh            r2, [r6, #-128]       /* r2  = nbits */\n    ldrh            r3, [r6]              /* r3  = temp2 & (((JLONG) 1)<<nbits) - 1; */\n    ldr             r0, [lr, r2, lsl #2]\n    ldrb            r5, [r1, r2]\n    put_bits        r11, r4, r0, r5\n    checkbuf15      r10, r11, r4, r5, r0\n    put_bits        r11, r4, r3, r2\n    checkbuf15      r10, r11, r4, r5, r0\n    mov             lr, r6                /* lr = t2 */\n    add             r5, r9, #0x400        /* r5 = actbl->ehufsi */\n    ldrsb           r6, [r5, #0xf0]       /* r6 = actbl->ehufsi[0xf0] */\n    veor            q8, q8, q8\n    vceq.i16        q0, q0, q8\n    vceq.i16        q1, q1, q8\n    vceq.i16        q2, q2, q8\n    vceq.i16        q3, q3, q8\n    vceq.i16        q4, q4, q8\n    vceq.i16        q5, q5, q8\n    vceq.i16        q6, q6, q8\n    vceq.i16        q7, q7, q8\n    vmovn.i16       d0, q0\n    vmovn.i16       d2, q1\n    vmovn.i16       d4, q2\n    vmovn.i16       d6, q3\n    vmovn.i16       d8, q4\n    vmovn.i16       d10, q5\n    vmovn.i16       d12, q6\n    vmovn.i16       d14, q7\n    vand            d0, d0, d26\n    vand            d2, d2, d26\n    vand            d4, d4, d26\n    vand            d6, d6, d26\n    vand            d8, d8, d26\n    vand            d10, d10, d26\n    vand            d12, d12, d26\n    vand            d14, d14, d26\n    vpadd.i8        d0, d0, d2\n    vpadd.i8        d4, d4, d6\n    vpadd.i8        d8, d8, d10\n    vpadd.i8        d12, d12, d14\n    vpadd.i8        d0, d0, d4\n    vpadd.i8        d8, d8, d12\n    vpadd.i8        d0, d0, d8\n    vmov.32         r1, d0[1]\n    vmov.32         r8, d0[0]\n    mvn             r1, r1\n    mvn             r8, r8\n    lsrs            r1, r1, #0x1\n    rrx             r8, r8            /* shift in last r1 bit while shifting out DC bit */\n    rbit            r1, r1            /* r1 = index1 */\n    rbit            r8, r8            /* r8 = index0 */\n    ldr             r0, [r9, #0x3c0]  /* r0 = actbl->ehufco[0xf0] */\n    str             r1, [sp, #0x14]   /* index1 > sp + 0x14 */\n    cmp             r8, #0x0\n    beq             6f\n1:\n    clz             r2, r8\n    add             lr, lr, r2, lsl #1\n    lsl             r8, r8, r2\n    ldrh            r1, [lr, #-126]\n2:\n    cmp             r2, #0x10\n    blt             3f\n    sub             r2, r2, #0x10\n    put_bits        r11, r4, r0, r6\n    cmp             r4, #0x10\n    blt             2b\n    eor             r3, r3, r3\n    emit_byte       r10, r11, r4, r3, r12\n    emit_byte       r10, r11, r4, r3, r12\n    b               2b\n3:\n    add             r2, r1, r2, lsl #4\n    ldrh            r3, [lr, #2]!\n    ldr             r12, [r9, r2, lsl #2]\n    ldrb            r2, [r5, r2]\n    put_bits        r11, r4, r12, r2\n    checkbuf15      r10, r11, r4, r2, r12\n    put_bits        r11, r4, r3, r1\n    checkbuf15      r10, r11, r4, r2, r12\n    lsls            r8, r8, #0x1\n    bne             1b\n6:\n    add             r12, sp, #0x20   /* r12 = t1 */\n    ldr             r8, [sp, #0x14]  /* r8 = index1 */\n    adds            r12, #0xc0       /* r12 = t2 + (DCTSIZE2/2) */\n    cmp             r8, #0x0\n    beq             6f\n    clz             r2, r8\n    sub             r12, r12, lr\n    lsl             r8, r8, r2\n    add             r2, r2, r12, lsr #1\n    add             lr, lr, r2, lsl #1\n    b               7f\n1:\n    clz             r2, r8\n    add             lr, lr, r2, lsl #1\n    lsl             r8, r8, r2\n7:\n    ldrh            r1, [lr, #-126]\n2:\n    cmp             r2, #0x10\n    blt             3f\n    sub             r2, r2, #0x10\n    put_bits        r11, r4, r0, r6\n    cmp             r4, #0x10\n    blt             2b\n    eor             r3, r3, r3\n    emit_byte       r10, r11, r4, r3, r12\n    emit_byte       r10, r11, r4, r3, r12\n    b               2b\n3:\n    add             r2, r1, r2, lsl #4\n    ldrh            r3, [lr, #2]!\n    ldr             r12, [r9, r2, lsl #2]\n    ldrb            r2, [r5, r2]\n    put_bits        r11, r4, r12, r2\n    checkbuf15      r10, r11, r4, r2, r12\n    put_bits        r11, r4, r3, r1\n    checkbuf15      r10, r11, r4, r2, r12\n    lsls            r8, r8, #0x1\n    bne             1b\n6:\n    add             r0, sp, #0x20\n    add             r0, #0xfe\n    cmp             lr, r0\n    bhs             1f\n    ldr             r1, [r9]\n    ldrb            r0, [r5]\n    put_bits        r11, r4, r1, r0\n    checkbuf15      r10, r11, r4, r0, r1\n1:\n    ldr             r12, [sp, #0x18]\n    str             r11, [r12, #0x8]\n    str             r4, [r12, #0xc]\n    add             r0, r10, #0x1\n    add             r4, sp, #0x140\n    vld1.64         {d8, d9, d10, d11}, [r4, :128]!\n    vld1.64         {d12, d13, d14, d15}, [r4, :128]\n    sub             r4, r7, #0x1c\n    mov             sp, r4\n    pop             {r4, r5, r6, r7, r8, r9, r10, r11, pc}\n\n.purgem emit_byte\n.purgem put_bits\n.purgem checkbuf15\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jsimd_i386.c",
    "content": "/*\n * jsimd_i386.c\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander.\n * Copyright (C) 2015, Matthieu Darbois.\n *\n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n * This file contains the interface between the \"normal\" portions\n * of the library and the SIMD implementations when running on a\n * 32-bit x86 architecture.\n */\n\n#define JPEG_INTERNALS\n#include \"../jinclude.h\"\n#include \"../jpeglib.h\"\n#include \"../jsimd.h\"\n#include \"../jdct.h\"\n#include \"../jsimddct.h\"\n#include \"jsimd.h\"\n\n/*\n * In the PIC cases, we have no guarantee that constants will keep\n * their alignment. This macro allows us to verify it at runtime.\n */\n#define IS_ALIGNED(ptr, order) (((unsigned)ptr & ((1 << order) - 1)) == 0)\n\n#define IS_ALIGNED_SSE(ptr) (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */\n\nstatic unsigned int simd_support = ~0;\nstatic unsigned int simd_huffman = 1;\n\n/*\n * Check what SIMD accelerations are supported.\n *\n * FIXME: This code is racy under a multi-threaded environment.\n */\nLOCAL(void)\ninit_simd (void)\n{\n  char *env = NULL;\n\n  if (simd_support != ~0U)\n    return;\n\n  simd_support = jpeg_simd_cpu_support();\n\n  /* Force different settings through environment variables */\n  env = getenv(\"JSIMD_FORCEMMX\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support &= JSIMD_MMX;\n  env = getenv(\"JSIMD_FORCE3DNOW\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support &= JSIMD_3DNOW|JSIMD_MMX;\n  env = getenv(\"JSIMD_FORCESSE\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support &= JSIMD_SSE|JSIMD_MMX;\n  env = getenv(\"JSIMD_FORCESSE2\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support &= JSIMD_SSE2;\n  env = getenv(\"JSIMD_FORCENONE\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support = 0;\n  env = getenv(\"JSIMD_NOHUFFENC\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_huffman = 0;\n}\n\nGLOBAL(int)\njsimd_can_rgb_ycc (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_rgb_ycc_convert_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_rgb_gray (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_rgb_gray_convert_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_ycc_rgb_convert_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb565 (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_rgb_ycc_convert (j_compress_ptr cinfo,\n                       JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                       JDIMENSION output_row, int num_rows)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n  void (*mmxfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n\n  switch(cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_extrgb_ycc_convert_sse2;\n      mmxfct=jsimd_extrgb_ycc_convert_mmx;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_extrgbx_ycc_convert_sse2;\n      mmxfct=jsimd_extrgbx_ycc_convert_mmx;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_extbgr_ycc_convert_sse2;\n      mmxfct=jsimd_extbgr_ycc_convert_mmx;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_extbgrx_ycc_convert_sse2;\n      mmxfct=jsimd_extbgrx_ycc_convert_mmx;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_extxbgr_ycc_convert_sse2;\n      mmxfct=jsimd_extxbgr_ycc_convert_mmx;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_extxrgb_ycc_convert_sse2;\n      mmxfct=jsimd_extxrgb_ycc_convert_mmx;\n      break;\n    default:\n      sse2fct=jsimd_rgb_ycc_convert_sse2;\n      mmxfct=jsimd_rgb_ycc_convert_mmx;\n      break;\n  }\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_rgb_ycc_convert_sse2))\n    sse2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);\n  else if (simd_support & JSIMD_MMX)\n    mmxfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);\n}\n\nGLOBAL(void)\njsimd_rgb_gray_convert (j_compress_ptr cinfo,\n                        JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                        JDIMENSION output_row, int num_rows)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n  void (*mmxfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n\n  switch(cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_extrgb_gray_convert_sse2;\n      mmxfct=jsimd_extrgb_gray_convert_mmx;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_extrgbx_gray_convert_sse2;\n      mmxfct=jsimd_extrgbx_gray_convert_mmx;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_extbgr_gray_convert_sse2;\n      mmxfct=jsimd_extbgr_gray_convert_mmx;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_extbgrx_gray_convert_sse2;\n      mmxfct=jsimd_extbgrx_gray_convert_mmx;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_extxbgr_gray_convert_sse2;\n      mmxfct=jsimd_extxbgr_gray_convert_mmx;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_extxrgb_gray_convert_sse2;\n      mmxfct=jsimd_extxrgb_gray_convert_mmx;\n      break;\n    default:\n      sse2fct=jsimd_rgb_gray_convert_sse2;\n      mmxfct=jsimd_rgb_gray_convert_mmx;\n      break;\n  }\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_rgb_gray_convert_sse2))\n    sse2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);\n  else if (simd_support & JSIMD_MMX)\n    mmxfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);\n}\n\nGLOBAL(void)\njsimd_ycc_rgb_convert (j_decompress_ptr cinfo,\n                       JSAMPIMAGE input_buf, JDIMENSION input_row,\n                       JSAMPARRAY output_buf, int num_rows)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);\n  void (*mmxfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);\n\n  switch(cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_ycc_extrgb_convert_sse2;\n      mmxfct=jsimd_ycc_extrgb_convert_mmx;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_ycc_extrgbx_convert_sse2;\n      mmxfct=jsimd_ycc_extrgbx_convert_mmx;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_ycc_extbgr_convert_sse2;\n      mmxfct=jsimd_ycc_extbgr_convert_mmx;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_ycc_extbgrx_convert_sse2;\n      mmxfct=jsimd_ycc_extbgrx_convert_mmx;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_ycc_extxbgr_convert_sse2;\n      mmxfct=jsimd_ycc_extxbgr_convert_mmx;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_ycc_extxrgb_convert_sse2;\n      mmxfct=jsimd_ycc_extxrgb_convert_mmx;\n      break;\n    default:\n      sse2fct=jsimd_ycc_rgb_convert_sse2;\n      mmxfct=jsimd_ycc_rgb_convert_mmx;\n      break;\n  }\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_ycc_rgb_convert_sse2))\n    sse2fct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);\n  else if (simd_support & JSIMD_MMX)\n    mmxfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);\n}\n\nGLOBAL(void)\njsimd_ycc_rgb565_convert (j_decompress_ptr cinfo,\n                          JSAMPIMAGE input_buf, JDIMENSION input_row,\n                          JSAMPARRAY output_buf, int num_rows)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_downsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_downsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_h2v2_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor,\n                               compptr->v_samp_factor,\n                               compptr->width_in_blocks, input_data,\n                               output_data);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_h2v2_downsample_mmx(cinfo->image_width, cinfo->max_v_samp_factor,\n                              compptr->v_samp_factor, compptr->width_in_blocks,\n                              input_data, output_data);\n}\n\nGLOBAL(void)\njsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_h2v1_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor,\n                               compptr->v_samp_factor,\n                               compptr->width_in_blocks, input_data,\n                               output_data);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_h2v1_downsample_mmx(cinfo->image_width, cinfo->max_v_samp_factor,\n                              compptr->v_samp_factor, compptr->width_in_blocks,\n                              input_data, output_data);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info *compptr,\n                     JSAMPARRAY input_data,\n                     JSAMPARRAY *output_data_ptr)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_h2v2_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width,\n                             input_data, output_data_ptr);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_h2v2_upsample_mmx(cinfo->max_v_samp_factor, cinfo->output_width,\n                            input_data, output_data_ptr);\n}\n\nGLOBAL(void)\njsimd_h2v1_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info *compptr,\n                     JSAMPARRAY input_data,\n                     JSAMPARRAY *output_data_ptr)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_h2v1_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width,\n                             input_data, output_data_ptr);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_h2v1_upsample_mmx(cinfo->max_v_samp_factor, cinfo->output_width,\n                            input_data, output_data_ptr);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_fancy_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_fancy_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info *compptr,\n                           JSAMPARRAY input_data,\n                           JSAMPARRAY *output_data_ptr)\n{\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))\n    jsimd_h2v2_fancy_upsample_sse2(cinfo->max_v_samp_factor,\n                                   compptr->downsampled_width, input_data,\n                                   output_data_ptr);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_h2v2_fancy_upsample_mmx(cinfo->max_v_samp_factor,\n                                  compptr->downsampled_width, input_data,\n                                  output_data_ptr);\n}\n\nGLOBAL(void)\njsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info *compptr,\n                           JSAMPARRAY input_data,\n                           JSAMPARRAY *output_data_ptr)\n{\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))\n    jsimd_h2v1_fancy_upsample_sse2(cinfo->max_v_samp_factor,\n                                   compptr->downsampled_width, input_data,\n                                   output_data_ptr);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_h2v1_fancy_upsample_mmx(cinfo->max_v_samp_factor,\n                                  compptr->downsampled_width, input_data,\n                                  output_data_ptr);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_merged_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_merged_upsample_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_merged_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_merged_upsample_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);\n  void (*mmxfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);\n\n  switch(cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_h2v2_extrgb_merged_upsample_sse2;\n      mmxfct=jsimd_h2v2_extrgb_merged_upsample_mmx;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_h2v2_extrgbx_merged_upsample_sse2;\n      mmxfct=jsimd_h2v2_extrgbx_merged_upsample_mmx;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_h2v2_extbgr_merged_upsample_sse2;\n      mmxfct=jsimd_h2v2_extbgr_merged_upsample_mmx;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_h2v2_extbgrx_merged_upsample_sse2;\n      mmxfct=jsimd_h2v2_extbgrx_merged_upsample_mmx;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_h2v2_extxbgr_merged_upsample_sse2;\n      mmxfct=jsimd_h2v2_extxbgr_merged_upsample_mmx;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_h2v2_extxrgb_merged_upsample_sse2;\n      mmxfct=jsimd_h2v2_extxrgb_merged_upsample_mmx;\n      break;\n    default:\n      sse2fct=jsimd_h2v2_merged_upsample_sse2;\n      mmxfct=jsimd_h2v2_merged_upsample_mmx;\n      break;\n  }\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_merged_upsample_sse2))\n    sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);\n  else if (simd_support & JSIMD_MMX)\n    mmxfct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);\n}\n\nGLOBAL(void)\njsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);\n  void (*mmxfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);\n\n  switch(cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_h2v1_extrgb_merged_upsample_sse2;\n      mmxfct=jsimd_h2v1_extrgb_merged_upsample_mmx;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_h2v1_extrgbx_merged_upsample_sse2;\n      mmxfct=jsimd_h2v1_extrgbx_merged_upsample_mmx;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_h2v1_extbgr_merged_upsample_sse2;\n      mmxfct=jsimd_h2v1_extbgr_merged_upsample_mmx;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_h2v1_extbgrx_merged_upsample_sse2;\n      mmxfct=jsimd_h2v1_extbgrx_merged_upsample_mmx;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_h2v1_extxbgr_merged_upsample_sse2;\n      mmxfct=jsimd_h2v1_extxbgr_merged_upsample_mmx;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_h2v1_extxrgb_merged_upsample_sse2;\n      mmxfct=jsimd_h2v1_extxrgb_merged_upsample_mmx;\n      break;\n    default:\n      sse2fct=jsimd_h2v1_merged_upsample_sse2;\n      mmxfct=jsimd_h2v1_merged_upsample_mmx;\n      break;\n  }\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_merged_upsample_sse2))\n    sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);\n  else if (simd_support & JSIMD_MMX)\n    mmxfct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);\n}\n\nGLOBAL(int)\njsimd_can_convsamp (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_convsamp_float (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_SSE)\n    return 1;\n  if (simd_support & JSIMD_3DNOW)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,\n                DCTELEM *workspace)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_convsamp_sse2(sample_data, start_col, workspace);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_convsamp_mmx(sample_data, start_col, workspace);\n}\n\nGLOBAL(void)\njsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,\n                      FAST_FLOAT *workspace)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_convsamp_float_sse2(sample_data, start_col, workspace);\n  else if (simd_support & JSIMD_SSE)\n    jsimd_convsamp_float_sse(sample_data, start_col, workspace);\n  else if (simd_support & JSIMD_3DNOW)\n    jsimd_convsamp_float_3dnow(sample_data, start_col, workspace);\n}\n\nGLOBAL(int)\njsimd_can_fdct_islow (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_islow_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_ifast_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_float (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_fdct_float_sse))\n    return 1;\n  if (simd_support & JSIMD_3DNOW)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_fdct_islow (DCTELEM *data)\n{\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_islow_sse2))\n    jsimd_fdct_islow_sse2(data);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_fdct_islow_mmx(data);\n}\n\nGLOBAL(void)\njsimd_fdct_ifast (DCTELEM *data)\n{\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_islow_sse2))\n    jsimd_fdct_ifast_sse2(data);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_fdct_ifast_mmx(data);\n}\n\nGLOBAL(void)\njsimd_fdct_float (FAST_FLOAT *data)\n{\n  if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_fdct_float_sse))\n    jsimd_fdct_float_sse(data);\n  else if (simd_support & JSIMD_3DNOW)\n    jsimd_fdct_float_3dnow(data);\n}\n\nGLOBAL(int)\njsimd_can_quantize (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_quantize_float (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_SSE)\n    return 1;\n  if (simd_support & JSIMD_3DNOW)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors,\n                DCTELEM *workspace)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_quantize_sse2(coef_block, divisors, workspace);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_quantize_mmx(coef_block, divisors, workspace);\n}\n\nGLOBAL(void)\njsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors,\n                      FAST_FLOAT *workspace)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_quantize_float_sse2(coef_block, divisors, workspace);\n  else if (simd_support & JSIMD_SSE)\n    jsimd_quantize_float_sse(coef_block, divisors, workspace);\n  else if (simd_support & JSIMD_3DNOW)\n    jsimd_quantize_float_3dnow(coef_block, divisors, workspace);\n}\n\nGLOBAL(int)\njsimd_can_idct_2x2 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_4x4 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))\n    jsimd_idct_2x2_sse2(compptr->dct_table, coef_block, output_buf,\n                        output_col);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_idct_2x2_mmx(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(void)\njsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))\n    jsimd_idct_4x4_sse2(compptr->dct_table, coef_block, output_buf,\n                        output_col);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_idct_4x4_mmx(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(int)\njsimd_can_idct_islow (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_islow_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(IFAST_MULT_TYPE) != 2)\n    return 0;\n  if (IFAST_SCALE_BITS != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_ifast_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_float (void)\n{\n  init_simd();\n\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n  if (sizeof(FLOAT_MULT_TYPE) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_float_sse2))\n    return 1;\n  if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_idct_float_sse))\n    return 1;\n  if (simd_support & JSIMD_3DNOW)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_islow_sse2))\n    jsimd_idct_islow_sse2(compptr->dct_table, coef_block, output_buf,\n                          output_col);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_idct_islow_mmx(compptr->dct_table, coef_block, output_buf,\n                         output_col);\n}\n\nGLOBAL(void)\njsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_ifast_sse2))\n    jsimd_idct_ifast_sse2(compptr->dct_table, coef_block, output_buf,\n                          output_col);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_idct_ifast_mmx(compptr->dct_table, coef_block, output_buf,\n                         output_col);\n}\n\nGLOBAL(void)\njsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_float_sse2))\n    jsimd_idct_float_sse2(compptr->dct_table, coef_block, output_buf,\n                          output_col);\n  else if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_idct_float_sse))\n    jsimd_idct_float_sse(compptr->dct_table, coef_block, output_buf,\n                         output_col);\n  else if (simd_support & JSIMD_3DNOW)\n    jsimd_idct_float_3dnow(compptr->dct_table, coef_block, output_buf,\n                           output_col);\n}\n\nGLOBAL(int)\njsimd_can_huff_encode_one_block (void)\n{\n  init_simd();\n\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && simd_huffman &&\n      IS_ALIGNED_SSE(jconst_huff_encode_one_block))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(JOCTET*)\njsimd_huff_encode_one_block (void *state, JOCTET *buffer, JCOEFPTR block,\n                             int last_dc_val, c_derived_tbl *dctbl,\n                             c_derived_tbl *actbl)\n{\n  return jsimd_huff_encode_one_block_sse2(state, buffer, block, last_dc_val,\n                                          dctbl, actbl);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jsimd_mips.c",
    "content": "/*\n * jsimd_mips.c\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2009-2011, 2014, D. R. Commander.\n * Copyright (C) 2013-2014, MIPS Technologies, Inc., California.\n * Copyright (C) 2015, Matthieu Darbois.\n *\n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n * This file contains the interface between the \"normal\" portions\n * of the library and the SIMD implementations when running on a\n * MIPS architecture.\n */\n\n#define JPEG_INTERNALS\n#include \"../jinclude.h\"\n#include \"../jpeglib.h\"\n#include \"../jsimd.h\"\n#include \"../jdct.h\"\n#include \"../jsimddct.h\"\n#include \"jsimd.h\"\n\n#include <stdio.h>\n#include <string.h>\n#include <ctype.h>\n\nstatic unsigned int simd_support = ~0;\n\n#if defined(__linux__)\n\nLOCAL(int)\nparse_proc_cpuinfo(const char* search_string)\n{\n  const char* file_name = \"/proc/cpuinfo\";\n  char cpuinfo_line[256];\n  FILE* f = NULL;\n  simd_support = 0;\n\n  if ((f = fopen(file_name, \"r\")) != NULL) {\n    while (fgets(cpuinfo_line, sizeof(cpuinfo_line), f) != NULL) {\n      if (strstr(cpuinfo_line, search_string) != NULL) {\n        fclose(f);\n        simd_support |= JSIMD_MIPS_DSPR2;\n        return 1;\n      }\n    }\n    fclose(f);\n  }\n  /* Did not find string in the proc file, or not Linux ELF. */\n  return 0;\n}\n\n#endif\n\n/*\n * Check what SIMD accelerations are supported.\n *\n * FIXME: This code is racy under a multi-threaded environment.\n */\nLOCAL(void)\ninit_simd (void)\n{\n  if (simd_support != ~0U)\n    return;\n\n  simd_support = 0;\n\n#if defined(__MIPSEL__) && defined(__mips_dsp) && (__mips_dsp_rev >= 2)\n  simd_support |= JSIMD_MIPS_DSPR2;\n#elif defined(__linux__)\n  /* We still have a chance to use MIPS DSPR2 regardless of globally used\n   * -mdspr2 options passed to gcc by performing runtime detection via\n   * /proc/cpuinfo parsing on linux */\n  if (!parse_proc_cpuinfo(\"MIPS 74K\"))\n    return;\n#endif\n}\n\nstatic const int mips_idct_ifast_coefs[4] = {\n  0x45404540,           // FIX( 1.082392200 / 2) =  17734 = 0x4546\n  0x5A805A80,           // FIX( 1.414213562 / 2) =  23170 = 0x5A82\n  0x76407640,           // FIX( 1.847759065 / 2) =  30274 = 0x7642\n  0xAC60AC60            // FIX(-2.613125930 / 4) = -21407 = 0xAC61\n};\n\n/* The following struct is borrowed from jdsample.c */\ntypedef void (*upsample1_ptr) (j_decompress_ptr cinfo,\n                               jpeg_component_info *compptr,\n                               JSAMPARRAY input_data,\n                               JSAMPARRAY *output_data_ptr);\n\ntypedef struct {\n  struct jpeg_upsampler pub;\n  JSAMPARRAY color_buf[MAX_COMPONENTS];\n  upsample1_ptr methods[MAX_COMPONENTS];\n  int next_row_out;\n  JDIMENSION rows_to_go;\n  int rowgroup_height[MAX_COMPONENTS];\n  UINT8 h_expand[MAX_COMPONENTS];\n  UINT8 v_expand[MAX_COMPONENTS];\n} my_upsampler;\n\ntypedef my_upsampler *my_upsample_ptr;\n\nGLOBAL(int)\njsimd_can_rgb_ycc (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_rgb_gray (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb565 (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_c_can_null_convert (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_rgb_ycc_convert (j_compress_ptr cinfo,\n                       JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                       JDIMENSION output_row, int num_rows)\n{\n  void (*mipsdspr2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n\n  switch(cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      mipsdspr2fct=jsimd_extrgb_ycc_convert_mips_dspr2;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      mipsdspr2fct=jsimd_extrgbx_ycc_convert_mips_dspr2;\n      break;\n    case JCS_EXT_BGR:\n      mipsdspr2fct=jsimd_extbgr_ycc_convert_mips_dspr2;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      mipsdspr2fct=jsimd_extbgrx_ycc_convert_mips_dspr2;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      mipsdspr2fct=jsimd_extxbgr_ycc_convert_mips_dspr2;\n\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      mipsdspr2fct=jsimd_extxrgb_ycc_convert_mips_dspr2;\n      break;\n    default:\n      mipsdspr2fct=jsimd_extrgb_ycc_convert_mips_dspr2;\n      break;\n  }\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    mipsdspr2fct(cinfo->image_width, input_buf, output_buf, output_row,\n                 num_rows);\n}\n\nGLOBAL(void)\njsimd_rgb_gray_convert (j_compress_ptr cinfo,\n                        JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                        JDIMENSION output_row, int num_rows)\n{\n  void (*mipsdspr2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n\n  switch(cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      mipsdspr2fct=jsimd_extrgb_gray_convert_mips_dspr2;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      mipsdspr2fct=jsimd_extrgbx_gray_convert_mips_dspr2;\n      break;\n    case JCS_EXT_BGR:\n      mipsdspr2fct=jsimd_extbgr_gray_convert_mips_dspr2;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      mipsdspr2fct=jsimd_extbgrx_gray_convert_mips_dspr2;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      mipsdspr2fct=jsimd_extxbgr_gray_convert_mips_dspr2;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      mipsdspr2fct=jsimd_extxrgb_gray_convert_mips_dspr2;\n      break;\n    default:\n      mipsdspr2fct=jsimd_extrgb_gray_convert_mips_dspr2;\n      break;\n  }\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    mipsdspr2fct(cinfo->image_width, input_buf, output_buf, output_row,\n                 num_rows);\n}\n\nGLOBAL(void)\njsimd_ycc_rgb_convert (j_decompress_ptr cinfo,\n                       JSAMPIMAGE input_buf, JDIMENSION input_row,\n                       JSAMPARRAY output_buf, int num_rows)\n{\n  void (*mipsdspr2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);\n\n  switch(cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      mipsdspr2fct=jsimd_ycc_extrgb_convert_mips_dspr2;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      mipsdspr2fct=jsimd_ycc_extrgbx_convert_mips_dspr2;\n      break;\n    case JCS_EXT_BGR:\n      mipsdspr2fct=jsimd_ycc_extbgr_convert_mips_dspr2;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      mipsdspr2fct=jsimd_ycc_extbgrx_convert_mips_dspr2;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      mipsdspr2fct=jsimd_ycc_extxbgr_convert_mips_dspr2;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      mipsdspr2fct=jsimd_ycc_extxrgb_convert_mips_dspr2;\n      break;\n  default:\n      mipsdspr2fct=jsimd_ycc_extrgb_convert_mips_dspr2;\n      break;\n  }\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    mipsdspr2fct(cinfo->output_width, input_buf, input_row, output_buf,\n                 num_rows);\n}\n\nGLOBAL(void)\njsimd_ycc_rgb565_convert (j_decompress_ptr cinfo,\n                          JSAMPIMAGE input_buf, JDIMENSION input_row,\n                          JSAMPARRAY output_buf, int num_rows)\n{\n}\n\nGLOBAL(void)\njsimd_c_null_convert (j_compress_ptr cinfo,\n                      JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                      JDIMENSION output_row, int num_rows)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    jsimd_c_null_convert_mips_dspr2(cinfo->image_width, input_buf,\n                                    output_buf, output_row, num_rows,\n                                    cinfo->num_components);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_downsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v2_smooth_downsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if(DCTSIZE != 8)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_downsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    jsimd_h2v2_downsample_mips_dspr2(cinfo->image_width,\n                                     cinfo->max_v_samp_factor,\n                                     compptr->v_samp_factor,\n                                     compptr->width_in_blocks, input_data,\n                                     output_data);\n}\n\nGLOBAL(void)\njsimd_h2v2_smooth_downsample (j_compress_ptr cinfo,\n                              jpeg_component_info *compptr,\n                              JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  jsimd_h2v2_smooth_downsample_mips_dspr2(input_data, output_data,\n                                          compptr->v_samp_factor,\n                                          cinfo->max_v_samp_factor,\n                                          cinfo->smoothing_factor,\n                                          compptr->width_in_blocks,\n                                          cinfo->image_width);\n}\n\nGLOBAL(void)\njsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    jsimd_h2v1_downsample_mips_dspr2(cinfo->image_width,\n                                     cinfo->max_v_samp_factor,\n                                     compptr->v_samp_factor,\n                                     compptr->width_in_blocks,\n                                     input_data, output_data);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_int_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info *compptr,\n                     JSAMPARRAY input_data,\n                     JSAMPARRAY *output_data_ptr)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    jsimd_h2v2_upsample_mips_dspr2(cinfo->max_v_samp_factor,\n                                   cinfo->output_width, input_data,\n                                   output_data_ptr);\n}\n\nGLOBAL(void)\njsimd_h2v1_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info *compptr,\n                     JSAMPARRAY input_data,\n                     JSAMPARRAY *output_data_ptr)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    jsimd_h2v1_upsample_mips_dspr2(cinfo->max_v_samp_factor,\n                                   cinfo->output_width, input_data,\n                                   output_data_ptr);\n}\n\nGLOBAL(void)\njsimd_int_upsample (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                    JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n\n  jsimd_int_upsample_mips_dspr2(upsample->h_expand[compptr->component_index],\n                                upsample->v_expand[compptr->component_index],\n                                input_data, output_data_ptr,\n                                cinfo->output_width,\n                                cinfo->max_v_samp_factor);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_fancy_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_fancy_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info *compptr,\n                           JSAMPARRAY input_data,\n                           JSAMPARRAY *output_data_ptr)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    jsimd_h2v2_fancy_upsample_mips_dspr2(cinfo->max_v_samp_factor,\n                                         compptr->downsampled_width,\n                                         input_data, output_data_ptr);\n}\n\nGLOBAL(void)\njsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info *compptr,\n                           JSAMPARRAY input_data,\n                           JSAMPARRAY *output_data_ptr)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    jsimd_h2v1_fancy_upsample_mips_dspr2(cinfo->max_v_samp_factor,\n                                         compptr->downsampled_width,\n                                         input_data, output_data_ptr);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_merged_upsample (void)\n{\n  init_simd();\n\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_merged_upsample (void)\n{\n  init_simd();\n\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n  void (*mipsdspr2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY,\n                       JSAMPLE *);\n\n  switch(cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      mipsdspr2fct=jsimd_h2v2_extrgb_merged_upsample_mips_dspr2;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      mipsdspr2fct=jsimd_h2v2_extrgbx_merged_upsample_mips_dspr2;\n      break;\n    case JCS_EXT_BGR:\n      mipsdspr2fct=jsimd_h2v2_extbgr_merged_upsample_mips_dspr2;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      mipsdspr2fct=jsimd_h2v2_extbgrx_merged_upsample_mips_dspr2;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      mipsdspr2fct=jsimd_h2v2_extxbgr_merged_upsample_mips_dspr2;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      mipsdspr2fct=jsimd_h2v2_extxrgb_merged_upsample_mips_dspr2;\n      break;\n    default:\n      mipsdspr2fct=jsimd_h2v2_extrgb_merged_upsample_mips_dspr2;\n      break;\n  }\n\n  mipsdspr2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf,\n               cinfo->sample_range_limit);\n}\n\nGLOBAL(void)\njsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n  void (*mipsdspr2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY,\n                       JSAMPLE *);\n\n  switch(cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      mipsdspr2fct=jsimd_h2v1_extrgb_merged_upsample_mips_dspr2;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      mipsdspr2fct=jsimd_h2v1_extrgbx_merged_upsample_mips_dspr2;\n      break;\n    case JCS_EXT_BGR:\n      mipsdspr2fct=jsimd_h2v1_extbgr_merged_upsample_mips_dspr2;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      mipsdspr2fct=jsimd_h2v1_extbgrx_merged_upsample_mips_dspr2;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      mipsdspr2fct=jsimd_h2v1_extxbgr_merged_upsample_mips_dspr2;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      mipsdspr2fct=jsimd_h2v1_extxrgb_merged_upsample_mips_dspr2;\n      break;\n    default:\n      mipsdspr2fct=jsimd_h2v1_extrgb_merged_upsample_mips_dspr2;\n      break;\n  }\n\n  mipsdspr2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf,\n               cinfo->sample_range_limit);\n}\n\nGLOBAL(int)\njsimd_can_convsamp (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_convsamp_float (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,\n                DCTELEM *workspace)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    jsimd_convsamp_mips_dspr2(sample_data, start_col, workspace);\n}\n\nGLOBAL(void)\njsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,\n                      FAST_FLOAT *workspace)\n{\n  if ((simd_support & JSIMD_MIPS_DSPR2))\n    jsimd_convsamp_float_mips_dspr2(sample_data, start_col, workspace);\n}\n\nGLOBAL(int)\njsimd_can_fdct_islow (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_float (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_fdct_islow (DCTELEM *data)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    jsimd_fdct_islow_mips_dspr2(data);\n}\n\nGLOBAL(void)\njsimd_fdct_ifast (DCTELEM *data)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    jsimd_fdct_ifast_mips_dspr2(data);\n}\n\nGLOBAL(void)\njsimd_fdct_float (FAST_FLOAT *data)\n{\n}\n\nGLOBAL(int)\njsimd_can_quantize (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_quantize_float (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors,\n                DCTELEM *workspace)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    jsimd_quantize_mips_dspr2(coef_block, divisors, workspace);\n}\n\nGLOBAL(void)\njsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors,\n                      FAST_FLOAT *workspace)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    jsimd_quantize_float_mips_dspr2(coef_block, divisors, workspace);\n}\n\nGLOBAL(int)\njsimd_can_idct_2x2 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_4x4 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_6x6 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_12x12 (void)\n{\n  init_simd();\n\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    jsimd_idct_2x2_mips_dspr2(compptr->dct_table, coef_block, output_buf,\n                              output_col);\n}\n\nGLOBAL(void)\njsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2) {\n    int workspace[DCTSIZE*4];  /* buffers data between passes */\n    jsimd_idct_4x4_mips_dspr2(compptr->dct_table, coef_block, output_buf,\n                              output_col, workspace);\n  }\n}\n\nGLOBAL(void)\njsimd_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n           JCOEFPTR coef_block, JSAMPARRAY output_buf,\n           JDIMENSION output_col)\n{\n    if (simd_support & JSIMD_MIPS_DSPR2)\n      jsimd_idct_6x6_mips_dspr2(compptr->dct_table, coef_block, output_buf,\n                                output_col);\n}\n\nGLOBAL(void)\njsimd_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block,\n                  JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2) {\n    int workspace[96];\n    int output[12] = {\n      (int)(output_buf[0] + output_col),\n      (int)(output_buf[1] + output_col),\n      (int)(output_buf[2] + output_col),\n      (int)(output_buf[3] + output_col),\n      (int)(output_buf[4] + output_col),\n      (int)(output_buf[5] + output_col),\n      (int)(output_buf[6] + output_col),\n      (int)(output_buf[7] + output_col),\n      (int)(output_buf[8] + output_col),\n      (int)(output_buf[9] + output_col),\n      (int)(output_buf[10] + output_col),\n      (int)(output_buf[11] + output_col),\n    };\n    jsimd_idct_12x12_pass1_mips_dspr2(coef_block, compptr->dct_table,\n                                      workspace);\n    jsimd_idct_12x12_pass2_mips_dspr2(workspace, output);\n  }\n}\n\nGLOBAL(int)\njsimd_can_idct_islow (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(IFAST_MULT_TYPE) != 2)\n    return 0;\n  if (IFAST_SCALE_BITS != 2)\n    return 0;\n\n  if (simd_support & JSIMD_MIPS_DSPR2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_float (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2) {\n    int output[8] = {\n      (int)(output_buf[0] + output_col),\n      (int)(output_buf[1] + output_col),\n      (int)(output_buf[2] + output_col),\n      (int)(output_buf[3] + output_col),\n      (int)(output_buf[4] + output_col),\n      (int)(output_buf[5] + output_col),\n      (int)(output_buf[6] + output_col),\n      (int)(output_buf[7] + output_col),\n    };\n\n    jsimd_idct_islow_mips_dspr2(coef_block, compptr->dct_table,\n                                output, IDCT_range_limit(cinfo));\n  }\n}\n\nGLOBAL(void)\njsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n  if (simd_support & JSIMD_MIPS_DSPR2) {\n    JCOEFPTR inptr;\n    IFAST_MULT_TYPE *quantptr;\n    DCTELEM workspace[DCTSIZE2];  /* buffers data between passes */\n\n    /* Pass 1: process columns from input, store into work array. */\n\n    inptr = coef_block;\n    quantptr = (IFAST_MULT_TYPE *) compptr->dct_table;\n\n    jsimd_idct_ifast_cols_mips_dspr2(inptr, quantptr,\n                                     workspace, mips_idct_ifast_coefs);\n\n    /* Pass 2: process rows from work array, store into output array. */\n    /* Note that we must descale the results by a factor of 8 == 2**3, */\n    /* and also undo the PASS1_BITS scaling. */\n\n    jsimd_idct_ifast_rows_mips_dspr2(workspace, output_buf,\n                                     output_col, mips_idct_ifast_coefs);\n  }\n}\n\nGLOBAL(void)\njsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n}\n\nGLOBAL(int)\njsimd_can_huff_encode_one_block (void)\n{\n  return 0;\n}\n\nGLOBAL(JOCTET*)\njsimd_huff_encode_one_block (void *state, JOCTET *buffer, JCOEFPTR block,\n                             int last_dc_val, c_derived_tbl *dctbl,\n                             c_derived_tbl *actbl)\n{\n  return NULL;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jsimd_mips_dspr2.S",
    "content": "/*\n * MIPS DSPr2 optimizations for libjpeg-turbo\n *\n * Copyright (C) 2013-2014, MIPS Technologies, Inc., California.\n * All Rights Reserved.\n * Authors:  Teodora Novkovic (teodora.novkovic@imgtec.com)\n *           Darko Laus       (darko.laus@imgtec.com)\n * Copyright (C) 2015, D. R. Commander.  All Rights Reserved.\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n#include \"jsimd_mips_dspr2_asm.h\"\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_c_null_convert_mips_dspr2)\n/*\n * a0     - cinfo->image_width\n * a1     - input_buf\n * a2     - output_buf\n * a3     - output_row\n * 16(sp) - num_rows\n * 20(sp) - cinfo->num_components\n *\n * Null conversion for compression\n */\n\n    SAVE_REGS_ON_STACK 8, s0, s1\n\n    lw        t9, 24(sp)   // t9 = num_rows\n    lw        s0, 28(sp)   // s0 = cinfo->num_components\n    andi      t0, a0, 3    // t0 = cinfo->image_width & 3\n    beqz      t0, 4f       // no residual\n     nop\n0:\n    addiu     t9, t9, -1\n    bltz      t9, 7f\n     li       t1, 0\n1:\n    sll       t3, t1, 2\n    lwx       t5, t3(a2)   // t5 = outptr = output_buf[ci]\n    lw        t2, 0(a1)    // t2 = inptr = *input_buf\n    sll       t4, a3, 2\n    lwx       t5, t4(t5)   // t5 = outptr = output_buf[ci][output_row]\n    addu      t2, t2, t1\n    addu      s1, t5, a0\n    addu      t6, t5, t0\n2:\n    lbu       t3, 0(t2)\n    addiu     t5, t5, 1\n    sb        t3, -1(t5)\n    bne       t6, t5, 2b\n     addu     t2, t2, s0\n3:\n    lbu       t3, 0(t2)\n    addu      t4, t2, s0\n    addu      t7, t4, s0\n    addu      t8, t7, s0\n    addu      t2, t8, s0\n    lbu       t4, 0(t4)\n    lbu       t7, 0(t7)\n    lbu       t8, 0(t8)\n    addiu     t5, t5, 4\n    sb        t3, -4(t5)\n    sb        t4, -3(t5)\n    sb        t7, -2(t5)\n    bne       s1, t5, 3b\n     sb       t8, -1(t5)\n    addiu     t1, t1, 1\n    bne       t1, s0, 1b\n     nop\n    addiu     a1, a1, 4\n    bgez      t9, 0b\n     addiu    a3, a3, 1\n    b         7f\n     nop\n4:\n    addiu     t9, t9, -1\n    bltz      t9, 7f\n     li       t1, 0\n5:\n    sll       t3, t1, 2\n    lwx       t5, t3(a2)   // t5 = outptr = output_buf[ci]\n    lw        t2, 0(a1)    // t2 = inptr = *input_buf\n    sll       t4, a3, 2\n    lwx       t5, t4(t5)   // t5 = outptr = output_buf[ci][output_row]\n    addu      t2, t2, t1\n    addu      s1, t5, a0\n    addu      t6, t5, t0\n6:\n    lbu       t3, 0(t2)\n    addu      t4, t2, s0\n    addu      t7, t4, s0\n    addu      t8, t7, s0\n    addu      t2, t8, s0\n    lbu       t4, 0(t4)\n    lbu       t7, 0(t7)\n    lbu       t8, 0(t8)\n    addiu     t5, t5, 4\n    sb        t3, -4(t5)\n    sb        t4, -3(t5)\n    sb        t7, -2(t5)\n    bne       s1, t5, 6b\n     sb       t8, -1(t5)\n    addiu     t1, t1, 1\n    bne       t1, s0, 5b\n     nop\n    addiu     a1, a1, 4\n    bgez      t9, 4b\n     addiu    a3, a3, 1\n7:\n    RESTORE_REGS_FROM_STACK 8, s0, s1\n\n    j         ra\n     nop\n\nEND(jsimd_c_null_convert_mips_dspr2)\n\n/*****************************************************************************/\n/*\n * jsimd_extrgb_ycc_convert_mips_dspr2\n * jsimd_extbgr_ycc_convert_mips_dspr2\n * jsimd_extrgbx_ycc_convert_mips_dspr2\n * jsimd_extbgrx_ycc_convert_mips_dspr2\n * jsimd_extxbgr_ycc_convert_mips_dspr2\n * jsimd_extxrgb_ycc_convert_mips_dspr2\n *\n * Colorspace conversion RGB -> YCbCr\n */\n\n.macro GENERATE_JSIMD_RGB_YCC_CONVERT_MIPS_DSPR2 colorid, pixel_size, r_offs, g_offs, b_offs\n\n.macro DO_RGB_TO_YCC r,    \\\n                     g,    \\\n                     b,    \\\n                     inptr\n    lbu     \\r, \\r_offs(\\inptr)\n    lbu     \\g, \\g_offs(\\inptr)\n    lbu     \\b, \\b_offs(\\inptr)\n    addiu   \\inptr, \\pixel_size\n.endm\n\nLEAF_MIPS_DSPR2(jsimd_\\colorid\\()_ycc_convert_mips_dspr2)\n/*\n * a0     - cinfo->image_width\n * a1     - input_buf\n * a2     - output_buf\n * a3     - output_row\n * 16(sp) - num_rows\n */\n\n    SAVE_REGS_ON_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    lw      t7, 48(sp)        // t7 = num_rows\n    li      s0, 0x4c8b        // FIX(0.29900)\n    li      s1, 0x9646        // FIX(0.58700)\n    li      s2, 0x1d2f        // FIX(0.11400)\n    li      s3, 0xffffd4cd    // -FIX(0.16874)\n    li      s4, 0xffffab33    // -FIX(0.33126)\n    li      s5, 0x8000        // FIX(0.50000)\n    li      s6, 0xffff94d1    // -FIX(0.41869)\n    li      s7, 0xffffeb2f    // -FIX(0.08131)\n    li      t8, 0x807fff      // CBCR_OFFSET + ONE_HALF-1\n\n0:\n    addiu   t7, -1            // --num_rows\n    lw      t6, 0(a1)         // t6 = input_buf[0]\n    lw      t0, 0(a2)\n    lw      t1, 4(a2)\n    lw      t2, 8(a2)\n    sll     t3, a3, 2\n    lwx     t0, t3(t0)        // t0 = output_buf[0][output_row]\n    lwx     t1, t3(t1)        // t1 = output_buf[1][output_row]\n    lwx     t2, t3(t2)        // t2 = output_buf[2][output_row]\n\n    addu    t9, t2, a0        // t9 = end address\n    addiu   a3, 1\n\n1:\n    DO_RGB_TO_YCC t3, t4, t5, t6\n\n    mtlo    s5, $ac0\n    mtlo    t8, $ac1\n    mtlo    t8, $ac2\n    maddu   $ac0, s2, t5\n    maddu   $ac1, s5, t5\n    maddu   $ac2, s5, t3\n    maddu   $ac0, s0, t3\n    maddu   $ac1, s3, t3\n    maddu   $ac2, s6, t4\n    maddu   $ac0, s1, t4\n    maddu   $ac1, s4, t4\n    maddu   $ac2, s7, t5\n    extr.w  t3, $ac0, 16\n    extr.w  t4, $ac1, 16\n    extr.w  t5, $ac2, 16\n    sb      t3, 0(t0)\n    sb      t4, 0(t1)\n    sb      t5, 0(t2)\n    addiu   t0, 1\n    addiu   t2, 1\n    bne     t2, t9, 1b\n     addiu  t1, 1\n    bgtz    t7, 0b\n     addiu  a1, 4\n\n    RESTORE_REGS_FROM_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    j ra\n     nop\nEND(jsimd_\\colorid\\()_ycc_convert_mips_dspr2)\n\n.purgem DO_RGB_TO_YCC\n\n.endm\n\n/*------------------------------------------id -- pix R  G  B */\nGENERATE_JSIMD_RGB_YCC_CONVERT_MIPS_DSPR2 extrgb,  3, 0, 1, 2\nGENERATE_JSIMD_RGB_YCC_CONVERT_MIPS_DSPR2 extbgr,  3, 2, 1, 0\nGENERATE_JSIMD_RGB_YCC_CONVERT_MIPS_DSPR2 extrgbx, 4, 0, 1, 2\nGENERATE_JSIMD_RGB_YCC_CONVERT_MIPS_DSPR2 extbgrx, 4, 2, 1, 0\nGENERATE_JSIMD_RGB_YCC_CONVERT_MIPS_DSPR2 extxbgr, 4, 3, 2, 1\nGENERATE_JSIMD_RGB_YCC_CONVERT_MIPS_DSPR2 extxrgb, 4, 1, 2, 3\n\n/*****************************************************************************/\n/*\n * jsimd_ycc_extrgb_convert_mips_dspr2\n * jsimd_ycc_extbgr_convert_mips_dspr2\n * jsimd_ycc_extrgbx_convert_mips_dspr2\n * jsimd_ycc_extbgrx_convert_mips_dspr2\n * jsimd_ycc_extxbgr_convert_mips_dspr2\n * jsimd_ycc_extxrgb_convert_mips_dspr2\n *\n * Colorspace conversion YCbCr -> RGB\n */\n\n.macro GENERATE_JSIMD_YCC_RGB_CONVERT_MIPS_DSPR2 colorid, pixel_size, r_offs, g_offs, b_offs, a_offs\n\n.macro STORE_YCC_TO_RGB  scratch0 \\\n                         scratch1 \\\n                         scratch2 \\\n                         outptr\n    sb       \\scratch0, \\r_offs(\\outptr)\n    sb       \\scratch1, \\g_offs(\\outptr)\n    sb       \\scratch2, \\b_offs(\\outptr)\n.if (\\pixel_size == 4)\n    li       t0, 0xFF\n    sb       t0, \\a_offs(\\outptr)\n.endif\n    addiu    \\outptr, \\pixel_size\n.endm\n\nLEAF_MIPS_DSPR2(jsimd_ycc_\\colorid\\()_convert_mips_dspr2)\n/*\n * a0     - cinfo->image_width\n * a1     - input_buf\n * a2     - input_row\n * a3     - output_buf\n * 16(sp) - num_rows\n */\n\n    SAVE_REGS_ON_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    lw         s1, 48(sp)\n    li         t3, 0x8000\n    li         t4, 0x166e9     // FIX(1.40200)\n    li         t5, 0x1c5a2     // FIX(1.77200)\n    li         t6, 0xffff492e  // -FIX(0.71414)\n    li         t7, 0xffffa7e6  // -FIX(0.34414)\n    repl.ph    t8, 128\n\n0:\n    lw         s0, 0(a3)\n    lw         t0, 0(a1)\n    lw         t1, 4(a1)\n    lw         t2, 8(a1)\n    sll        s5, a2, 2\n    addiu      s1, -1\n    lwx        s2, s5(t0)\n    lwx        s3, s5(t1)\n    lwx        s4, s5(t2)\n    addu       t9, s2, a0\n    addiu      a2, 1\n\n1:\n    lbu        s7, 0(s4)       // cr\n    lbu        s6, 0(s3)       // cb\n    lbu        s5, 0(s2)       // y\n    addiu      s2, 1\n    addiu      s4, 1\n    addiu      s7, -128\n    addiu      s6, -128\n    mul        t2, t7, s6\n    mul        t0, t6, s7      // Crgtab[cr]\n    sll        s7, 15\n    mulq_rs.w  t1, t4, s7      // Crrtab[cr]\n    sll        s6, 15\n    addu       t2, t3          // Cbgtab[cb]\n    addu       t2, t0\n\n    mulq_rs.w  t0, t5, s6      // Cbbtab[cb]\n    sra        t2, 16\n    addu       t1, s5\n    addu       t2, s5          // add y\n    ins        t2, t1, 16, 16\n    subu.ph    t2, t2, t8\n    addu       t0, s5\n    shll_s.ph  t2, t2, 8\n    subu       t0, 128\n    shra.ph    t2, t2, 8\n    shll_s.w   t0, t0, 24\n    addu.ph    t2, t2, t8      // clip & store\n    sra        t0, t0, 24\n    sra        t1, t2, 16\n    addiu      t0, 128\n\n    STORE_YCC_TO_RGB t1, t2, t0, s0\n\n    bne        s2, t9, 1b\n     addiu     s3, 1\n    bgtz       s1, 0b\n     addiu     a3, 4\n\n    RESTORE_REGS_FROM_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    j ra\n     nop\nEND(jsimd_ycc_\\colorid\\()_convert_mips_dspr2)\n\n.purgem STORE_YCC_TO_RGB\n\n.endm\n\n/*------------------------------------------id -- pix R  G  B  A */\nGENERATE_JSIMD_YCC_RGB_CONVERT_MIPS_DSPR2 extrgb,  3, 0, 1, 2, 3\nGENERATE_JSIMD_YCC_RGB_CONVERT_MIPS_DSPR2 extbgr,  3, 2, 1, 0, 3\nGENERATE_JSIMD_YCC_RGB_CONVERT_MIPS_DSPR2 extrgbx, 4, 0, 1, 2, 3\nGENERATE_JSIMD_YCC_RGB_CONVERT_MIPS_DSPR2 extbgrx, 4, 2, 1, 0, 3\nGENERATE_JSIMD_YCC_RGB_CONVERT_MIPS_DSPR2 extxbgr, 4, 3, 2, 1, 0\nGENERATE_JSIMD_YCC_RGB_CONVERT_MIPS_DSPR2 extxrgb, 4, 1, 2, 3, 0\n\n/*****************************************************************************/\n/*\n * jsimd_extrgb_gray_convert_mips_dspr2\n * jsimd_extbgr_gray_convert_mips_dspr2\n * jsimd_extrgbx_gray_convert_mips_dspr2\n * jsimd_extbgrx_gray_convert_mips_dspr2\n * jsimd_extxbgr_gray_convert_mips_dspr2\n * jsimd_extxrgb_gray_convert_mips_dspr2\n *\n * Colorspace conversion RGB -> GRAY\n */\n\n.macro GENERATE_JSIMD_RGB_GRAY_CONVERT_MIPS_DSPR2 colorid, pixel_size, r_offs, g_offs, b_offs\n\n.macro DO_RGB_TO_GRAY r,    \\\n                      g,    \\\n                      b,    \\\n                      inptr\n    lbu     \\r, \\r_offs(\\inptr)\n    lbu     \\g, \\g_offs(\\inptr)\n    lbu     \\b, \\b_offs(\\inptr)\n    addiu   \\inptr, \\pixel_size\n.endm\n\nLEAF_MIPS_DSPR2(jsimd_\\colorid\\()_gray_convert_mips_dspr2)\n/*\n * a0     - cinfo->image_width\n * a1     - input_buf\n * a2     - output_buf\n * a3     - output_row\n * 16(sp) - num_rows\n */\n\n    SAVE_REGS_ON_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    li      s0, 0x4c8b             // s0 = FIX(0.29900)\n    li      s1, 0x9646             // s1 = FIX(0.58700)\n    li      s2, 0x1d2f             // s2 = FIX(0.11400)\n    li      s7, 0x8000             // s7 = FIX(0.50000)\n    lw      s6, 48(sp)\n    andi    t7, a0, 3\n\n0:\n    addiu   s6, -1                 // s6 = num_rows\n    lw      t0, 0(a1)\n    lw      t1, 0(a2)\n    sll     t3, a3, 2\n    lwx     t1, t3(t1)\n    addiu   a3, 1\n    addu    t9, t1, a0\n    subu    t8, t9, t7\n    beq     t1, t8, 2f\n     nop\n\n1:\n    DO_RGB_TO_GRAY t3, t4, t5, t0\n    DO_RGB_TO_GRAY s3, s4, s5, t0\n\n    mtlo    s7, $ac0\n    maddu   $ac0, s2, t5\n    maddu   $ac0, s1, t4\n    maddu   $ac0, s0, t3\n    mtlo    s7, $ac1\n    maddu   $ac1, s2, s5\n    maddu   $ac1, s1, s4\n    maddu   $ac1, s0, s3\n    extr.w  t6, $ac0, 16\n\n    DO_RGB_TO_GRAY t3, t4, t5, t0\n    DO_RGB_TO_GRAY s3, s4, s5, t0\n\n    mtlo    s7, $ac0\n    maddu   $ac0, s2, t5\n    maddu   $ac0, s1, t4\n    extr.w  t2, $ac1, 16\n    maddu   $ac0, s0, t3\n    mtlo    s7, $ac1\n    maddu   $ac1, s2, s5\n    maddu   $ac1, s1, s4\n    maddu   $ac1, s0, s3\n    extr.w  t5, $ac0, 16\n    sb      t6, 0(t1)\n    sb      t2, 1(t1)\n    extr.w  t3, $ac1, 16\n    addiu   t1, 4\n    sb      t5, -2(t1)\n    sb      t3, -1(t1)\n    bne     t1, t8, 1b\n     nop\n\n2:\n    beqz    t7, 4f\n     nop\n\n3:\n    DO_RGB_TO_GRAY t3, t4, t5, t0\n\n    mtlo    s7, $ac0\n    maddu   $ac0, s2, t5\n    maddu   $ac0, s1, t4\n    maddu   $ac0, s0, t3\n    extr.w  t6, $ac0, 16\n    sb      t6, 0(t1)\n    addiu   t1, 1\n    bne     t1, t9, 3b\n     nop\n\n4:\n    bgtz    s6, 0b\n     addiu  a1, 4\n\n    RESTORE_REGS_FROM_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    j ra\n     nop\nEND(jsimd_\\colorid\\()_gray_convert_mips_dspr2)\n\n.purgem DO_RGB_TO_GRAY\n\n.endm\n\n/*------------------------------------------id --  pix R  G  B */\nGENERATE_JSIMD_RGB_GRAY_CONVERT_MIPS_DSPR2 extrgb,  3, 0, 1, 2\nGENERATE_JSIMD_RGB_GRAY_CONVERT_MIPS_DSPR2 extbgr,  3, 2, 1, 0\nGENERATE_JSIMD_RGB_GRAY_CONVERT_MIPS_DSPR2 extrgbx, 4, 0, 1, 2\nGENERATE_JSIMD_RGB_GRAY_CONVERT_MIPS_DSPR2 extbgrx, 4, 2, 1, 0\nGENERATE_JSIMD_RGB_GRAY_CONVERT_MIPS_DSPR2 extxbgr, 4, 3, 2, 1\nGENERATE_JSIMD_RGB_GRAY_CONVERT_MIPS_DSPR2 extxrgb, 4, 1, 2, 3\n/*****************************************************************************/\n/*\n * jsimd_h2v2_merged_upsample_mips_dspr2\n * jsimd_h2v2_extrgb_merged_upsample_mips_dspr2\n * jsimd_h2v2_extrgbx_merged_upsample_mips_dspr2\n * jsimd_h2v2_extbgr_merged_upsample_mips_dspr2\n * jsimd_h2v2_extbgrx_merged_upsample_mips_dspr2\n * jsimd_h2v2_extxbgr_merged_upsample_mips_dspr2\n * jsimd_h2v2_extxrgb_merged_upsample_mips_dspr2\n *\n * Merged h2v2 upsample routines\n */\n.macro GENERATE_H2V2_MERGED_UPSAMPLE_MIPS_DSPR2 colorid,    \\\n                                                pixel_size, \\\n                                                r1_offs,    \\\n                                                g1_offs,    \\\n                                                b1_offs,    \\\n                                                a1_offs,    \\\n                                                r2_offs,    \\\n                                                g2_offs,    \\\n                                                b2_offs,    \\\n                                                a2_offs\n\n.macro STORE_H2V2_2_PIXELS  scratch0 \\\n                            scratch1 \\\n                            scratch2 \\\n                            scratch3 \\\n                            scratch4 \\\n                            scratch5 \\\n                            outptr\n    sb       \\scratch0, \\r1_offs(\\outptr)\n    sb       \\scratch1, \\g1_offs(\\outptr)\n    sb       \\scratch2, \\b1_offs(\\outptr)\n    sb       \\scratch3, \\r2_offs(\\outptr)\n    sb       \\scratch4, \\g2_offs(\\outptr)\n    sb       \\scratch5, \\b2_offs(\\outptr)\n.if (\\pixel_size == 8)\n    li       \\scratch0, 0xFF\n    sb       \\scratch0, \\a1_offs(\\outptr)\n    sb       \\scratch0, \\a2_offs(\\outptr)\n.endif\n    addiu    \\outptr, \\pixel_size\n.endm\n\n.macro STORE_H2V2_1_PIXEL  scratch0 \\\n                           scratch1 \\\n                           scratch2 \\\n                           outptr\n    sb    \\scratch0, \\r1_offs(\\outptr)\n    sb    \\scratch1, \\g1_offs(\\outptr)\n    sb    \\scratch2, \\b1_offs(\\outptr)\n\n.if (\\pixel_size == 8)\n    li    t0, 0xFF\n    sb    t0, \\a1_offs(\\outptr)\n.endif\n.endm\n\nLEAF_MIPS_DSPR2(jsimd_h2v2_\\colorid\\()_merged_upsample_mips_dspr2)\n/*\n * a0     - cinfo->output_width\n * a1     - input_buf\n * a2     - in_row_group_ctr\n * a3     - output_buf\n * 16(sp) - cinfo->sample_range_limit\n */\n\n    SAVE_REGS_ON_STACK 40, s0, s1, s2, s3, s4, s5, s6, s7, ra\n\n    lw           t9, 56(sp)        // cinfo->sample_range_limit\n    lw           v0, 0(a1)\n    lw           v1, 4(a1)\n    lw           t0, 8(a1)\n    sll          t1, a2, 3\n    addiu        t2, t1, 4\n    sll          t3, a2, 2\n    lw           t4, 0(a3)         // t4 = output_buf[0]\n    lwx          t1, t1(v0)        // t1 = input_buf[0][in_row_group_ctr*2]\n    lwx          t2, t2(v0)        // t2 = input_buf[0][in_row_group_ctr*2 + 1]\n    lwx          t5, t3(v1)        // t5 = input_buf[1][in_row_group_ctr]\n    lwx          t6, t3(t0)        // t6 = input_buf[2][in_row_group_ctr]\n    lw           t7, 4(a3)         // t7 = output_buf[1]\n    li           s1, 0xe6ea\n    addiu        t8, s1, 0x7fff    // t8 = 0x166e9 [FIX(1.40200)]\n    addiu        s0, t8, 0x5eb9    // s0 = 0x1c5a2 [FIX(1.77200)]\n    addiu        s1, zero, 0xa7e6  // s4 = 0xffffa7e6 [-FIX(0.34414)]\n    xori         s2, s1, 0xeec8    // s3 = 0xffff492e [-FIX(0.71414)]\n    srl          t3, a0, 1\n    blez         t3, 2f\n     addu        t0, t5, t3        // t0 = end address\n 1:\n    lbu          t3, 0(t5)\n    lbu          s3, 0(t6)\n    addiu        t5, t5, 1\n    addiu        t3, t3, -128      // (cb - 128)\n    addiu        s3, s3, -128      // (cr - 128)\n    mult         $ac1, s1, t3\n    madd         $ac1, s2, s3\n    sll          s3, s3, 15\n    sll          t3, t3, 15\n    mulq_rs.w    s4, t8, s3        // s4 = (C1 * cr + ONE_HALF)>> SCALEBITS\n    extr_r.w     s5, $ac1, 16\n    mulq_rs.w    s6, s0, t3        // s6 = (C2 * cb + ONE_HALF)>> SCALEBITS\n    lbu          v0, 0(t1)\n    addiu        t6, t6, 1\n    addiu        t1, t1, 2\n    addu         t3, v0, s4        // y+cred\n    addu         s3, v0, s5        // y+cgreen\n    addu         v1, v0, s6        // y+cblue\n    addu         t3, t9, t3        // y+cred\n    addu         s3, t9, s3        // y+cgreen\n    addu         v1, t9, v1        // y+cblue\n    lbu          AT, 0(t3)\n    lbu          s7, 0(s3)\n    lbu          ra, 0(v1)\n    lbu          v0, -1(t1)\n    addu         t3, v0, s4        // y+cred\n    addu         s3, v0, s5        // y+cgreen\n    addu         v1, v0, s6        // y+cblue\n    addu         t3, t9, t3        // y+cred\n    addu         s3, t9, s3        // y+cgreen\n    addu         v1, t9, v1        // y+cblue\n    lbu          t3, 0(t3)\n    lbu          s3, 0(s3)\n    lbu          v1, 0(v1)\n    lbu          v0, 0(t2)\n\n    STORE_H2V2_2_PIXELS AT, s7, ra, t3, s3, v1, t4\n\n    addu         t3, v0, s4        // y+cred\n    addu         s3, v0, s5        // y+cgreen\n    addu         v1, v0, s6        // y+cblue\n    addu         t3, t9, t3        // y+cred\n    addu         s3, t9, s3        // y+cgreen\n    addu         v1, t9, v1        // y+cblue\n    lbu          AT, 0(t3)\n    lbu          s7, 0(s3)\n    lbu          ra, 0(v1)\n    lbu          v0, 1(t2)\n    addiu        t2, t2, 2\n    addu         t3, v0, s4        // y+cred\n    addu         s3, v0, s5        // y+cgreen\n    addu         v1, v0, s6        // y+cblue\n    addu         t3, t9, t3        // y+cred\n    addu         s3, t9, s3        // y+cgreen\n    addu         v1, t9, v1        // y+cblue\n    lbu          t3, 0(t3)\n    lbu          s3, 0(s3)\n    lbu          v1, 0(v1)\n\n    STORE_H2V2_2_PIXELS AT, s7, ra, t3, s3, v1, t7\n\n    bne          t0, t5, 1b\n     nop\n2:\n    andi         t0, a0, 1\n    beqz         t0, 4f\n     lbu          t3, 0(t5)\n    lbu          s3, 0(t6)\n    addiu        t3, t3, -128      // (cb - 128)\n    addiu        s3, s3, -128      // (cr - 128)\n    mult         $ac1, s1, t3\n    madd         $ac1, s2, s3\n    sll          s3, s3, 15\n    sll          t3, t3, 15\n    lbu          v0, 0(t1)\n    extr_r.w     s5, $ac1, 16\n    mulq_rs.w    s4, t8, s3        // s4 = (C1 * cr + ONE_HALF)>> SCALEBITS\n    mulq_rs.w    s6, s0, t3        // s6 = (C2 * cb + ONE_HALF)>> SCALEBITS\n    addu         t3, v0, s4        // y+cred\n    addu         s3, v0, s5        // y+cgreen\n    addu         v1, v0, s6        // y+cblue\n    addu         t3, t9, t3        // y+cred\n    addu         s3, t9, s3        // y+cgreen\n    addu         v1, t9, v1        // y+cblue\n    lbu          t3, 0(t3)\n    lbu          s3, 0(s3)\n    lbu          v1, 0(v1)\n    lbu          v0, 0(t2)\n\n    STORE_H2V2_1_PIXEL t3, s3, v1, t4\n\n    addu         t3, v0, s4        // y+cred\n    addu         s3, v0, s5        // y+cgreen\n    addu         v1, v0, s6        // y+cblue\n    addu         t3, t9, t3        // y+cred\n    addu         s3, t9, s3        // y+cgreen\n    addu         v1, t9, v1        // y+cblue\n    lbu          t3, 0(t3)\n    lbu          s3, 0(s3)\n    lbu          v1, 0(v1)\n\n    STORE_H2V2_1_PIXEL t3, s3, v1, t7\n4:\n    RESTORE_REGS_FROM_STACK 40, s0, s1, s2, s3, s4, s5, s6, s7, ra\n\n    j           ra\n     nop\n\nEND(jsimd_h2v2_\\colorid\\()_merged_upsample_mips_dspr2)\n\n.purgem STORE_H2V2_1_PIXEL\n.purgem STORE_H2V2_2_PIXELS\n.endm\n\n/*-----------------------------------------id -- pix R1 G1 B1 A1 R2 G2 B2 A2 */\nGENERATE_H2V2_MERGED_UPSAMPLE_MIPS_DSPR2 extrgb,  6, 0, 1, 2, 6, 3, 4, 5, 6\nGENERATE_H2V2_MERGED_UPSAMPLE_MIPS_DSPR2 extbgr,  6, 2, 1, 0, 3, 5, 4, 3, 6\nGENERATE_H2V2_MERGED_UPSAMPLE_MIPS_DSPR2 extrgbx, 8, 0, 1, 2, 3, 4, 5, 6, 7\nGENERATE_H2V2_MERGED_UPSAMPLE_MIPS_DSPR2 extbgrx, 8, 2, 1, 0, 3, 6, 5, 4, 7\nGENERATE_H2V2_MERGED_UPSAMPLE_MIPS_DSPR2 extxbgr, 8, 3, 2, 1, 0, 7, 6, 5, 4\nGENERATE_H2V2_MERGED_UPSAMPLE_MIPS_DSPR2 extxrgb, 8, 1, 2, 3, 0, 5, 6, 7, 4\n/*****************************************************************************/\n/*\n * jsimd_h2v1_merged_upsample_mips_dspr2\n * jsimd_h2v1_extrgb_merged_upsample_mips_dspr2\n * jsimd_h2v1_extrgbx_merged_upsample_mips_dspr2\n * jsimd_h2v1_extbgr_merged_upsample_mips_dspr2\n * jsimd_h2v1_extbgrx_merged_upsample_mips_dspr2\n * jsimd_h2v1_extxbgr_merged_upsample_mips_dspr2\n * jsimd_h2v1_extxrgb_merged_upsample_mips_dspr2\n *\n * Merged h2v1 upsample routines\n */\n\n.macro GENERATE_H2V1_MERGED_UPSAMPLE_MIPS_DSPR2 colorid,    \\\n                                                pixel_size, \\\n                                                r1_offs,    \\\n                                                g1_offs,    \\\n                                                b1_offs,    \\\n                                                a1_offs,    \\\n                                                r2_offs,    \\\n                                                g2_offs,    \\\n                                                b2_offs,    \\\n                                                a2_offs\n\n.macro STORE_H2V1_2_PIXELS  scratch0 \\\n                            scratch1 \\\n                            scratch2 \\\n                            scratch3 \\\n                            scratch4 \\\n                            scratch5 \\\n                            outptr\n    sb       \\scratch0, \\r1_offs(\\outptr)\n    sb       \\scratch1, \\g1_offs(\\outptr)\n    sb       \\scratch2, \\b1_offs(\\outptr)\n    sb       \\scratch3, \\r2_offs(\\outptr)\n    sb       \\scratch4, \\g2_offs(\\outptr)\n    sb       \\scratch5, \\b2_offs(\\outptr)\n.if (\\pixel_size == 8)\n    li       t0, 0xFF\n    sb       t0, \\a1_offs(\\outptr)\n    sb       t0, \\a2_offs(\\outptr)\n.endif\n    addiu    \\outptr, \\pixel_size\n.endm\n\n.macro STORE_H2V1_1_PIXEL  scratch0 \\\n                           scratch1 \\\n                           scratch2 \\\n                           outptr\n    sb    \\scratch0, \\r1_offs(\\outptr)\n    sb    \\scratch1, \\g1_offs(\\outptr)\n    sb    \\scratch2, \\b1_offs(\\outptr)\n.if (\\pixel_size == 8)\n    li    t0, 0xFF\n    sb    t0, \\a1_offs(\\outptr)\n.endif\n.endm\n\nLEAF_MIPS_DSPR2(jsimd_h2v1_\\colorid\\()_merged_upsample_mips_dspr2)\n/*\n * a0     - cinfo->output_width\n * a1     - input_buf\n * a2     - in_row_group_ctr\n * a3     - output_buf\n * 16(sp) - range_limit\n */\n\n    SAVE_REGS_ON_STACK 40, s0, s1, s2, s3, s4, s5, s6, s7, ra\n\n    li           t0, 0xe6ea\n    lw           t1, 0(a1)         // t1 = input_buf[0]\n    lw           t2, 4(a1)         // t2 = input_buf[1]\n    lw           t3, 8(a1)         // t3 = input_buf[2]\n    lw           t8, 56(sp)        // t8 = range_limit\n    addiu        s1, t0, 0x7fff    // s1 = 0x166e9 [FIX(1.40200)]\n    addiu        s2, s1, 0x5eb9    // s2 = 0x1c5a2 [FIX(1.77200)]\n    addiu        s0, t0, 0x9916    // s0 = 0x8000\n    addiu        s4, zero, 0xa7e6  // s4 = 0xffffa7e6 [-FIX(0.34414)]\n    xori         s3, s4, 0xeec8    // s3 = 0xffff492e [-FIX(0.71414)]\n    srl          t0, a0, 1\n    sll          t4, a2, 2\n    lwx          s5, t4(t1)        // s5 = inptr0\n    lwx          s6, t4(t2)        // s6 = inptr1\n    lwx          s7, t4(t3)        // s7 = inptr2\n    lw           t7, 0(a3)         // t7 = outptr\n    blez         t0, 2f\n     addu        t9, s6, t0        // t9 = end address\n1:\n    lbu          t2, 0(s6)         // t2 = cb\n    lbu          t0, 0(s7)         // t0 = cr\n    lbu          t1, 0(s5)         // t1 = y\n    addiu        t2, t2, -128      // t2 = cb - 128\n    addiu        t0, t0, -128      // t0 = cr - 128\n    mult         $ac1, s4, t2\n    madd         $ac1, s3, t0\n    sll          t0, t0, 15\n    sll          t2, t2, 15\n    mulq_rs.w    t0, s1, t0        // t0 = (C1*cr + ONE_HALF)>> SCALEBITS\n    extr_r.w     t5, $ac1, 16\n    mulq_rs.w    t6, s2, t2        // t6 = (C2*cb + ONE_HALF)>> SCALEBITS\n    addiu        s7, s7, 1\n    addiu        s6, s6, 1\n    addu         t2, t1, t0        // t2 = y + cred\n    addu         t3, t1, t5        // t3 = y + cgreen\n    addu         t4, t1, t6        // t4 = y + cblue\n    addu         t2, t8, t2\n    addu         t3, t8, t3\n    addu         t4, t8, t4\n    lbu          t1, 1(s5)\n    lbu          v0, 0(t2)\n    lbu          v1, 0(t3)\n    lbu          ra, 0(t4)\n    addu         t2, t1, t0\n    addu         t3, t1, t5\n    addu         t4, t1, t6\n    addu         t2, t8, t2\n    addu         t3, t8, t3\n    addu         t4, t8, t4\n    lbu          t2, 0(t2)\n    lbu          t3, 0(t3)\n    lbu          t4, 0(t4)\n\n    STORE_H2V1_2_PIXELS v0, v1, ra, t2, t3, t4, t7\n\n    bne          t9, s6, 1b\n     addiu       s5, s5, 2\n2:\n    andi         t0, a0, 1\n    beqz         t0, 4f\n     nop\n3:\n    lbu          t2, 0(s6)\n    lbu          t0, 0(s7)\n    lbu          t1, 0(s5)\n    addiu        t2, t2, -128      //(cb - 128)\n    addiu        t0, t0, -128      //(cr - 128)\n    mul          t3, s4, t2\n    mul          t4, s3, t0\n    sll          t0, t0, 15\n    sll          t2, t2, 15\n    mulq_rs.w    t0, s1, t0       // (C1*cr + ONE_HALF)>> SCALEBITS\n    mulq_rs.w    t6, s2, t2       // (C2*cb + ONE_HALF)>> SCALEBITS\n    addu         t3, t3, s0\n    addu         t3, t4, t3\n    sra          t5, t3, 16       // (C4*cb + ONE_HALF + C3*cr)>> SCALEBITS\n    addu         t2, t1, t0       // y + cred\n    addu         t3, t1, t5       // y + cgreen\n    addu         t4, t1, t6       // y + cblue\n    addu         t2, t8, t2\n    addu         t3, t8, t3\n    addu         t4, t8, t4\n    lbu          t2, 0(t2)\n    lbu          t3, 0(t3)\n    lbu          t4, 0(t4)\n\n    STORE_H2V1_1_PIXEL t2, t3, t4, t7\n4:\n    RESTORE_REGS_FROM_STACK 40, s0, s1, s2, s3, s4, s5, s6, s7, ra\n\n    j            ra\n     nop\n\nEND(jsimd_h2v1_\\colorid\\()_merged_upsample_mips_dspr2)\n\n.purgem STORE_H2V1_1_PIXEL\n.purgem STORE_H2V1_2_PIXELS\n.endm\n\n/*-----------------------------------------id -- pix R1 G1 B1 A1 R2 G2 B2 A2 */\nGENERATE_H2V1_MERGED_UPSAMPLE_MIPS_DSPR2 extrgb,  6, 0, 1, 2, 6, 3, 4, 5, 6\nGENERATE_H2V1_MERGED_UPSAMPLE_MIPS_DSPR2 extbgr,  6, 2, 1, 0, 3, 5, 4, 3, 6\nGENERATE_H2V1_MERGED_UPSAMPLE_MIPS_DSPR2 extrgbx, 8, 0, 1, 2, 3, 4, 5, 6, 7\nGENERATE_H2V1_MERGED_UPSAMPLE_MIPS_DSPR2 extbgrx, 8, 2, 1, 0, 3, 6, 5, 4, 7\nGENERATE_H2V1_MERGED_UPSAMPLE_MIPS_DSPR2 extxbgr, 8, 3, 2, 1, 0, 7, 6, 5, 4\nGENERATE_H2V1_MERGED_UPSAMPLE_MIPS_DSPR2 extxrgb, 8, 1, 2, 3, 0, 5, 6, 7, 4\n/*****************************************************************************/\n/*\n * jsimd_h2v2_fancy_upsample_mips_dspr2\n *\n * Fancy processing for the common case of 2:1 horizontal and 2:1 vertical.\n */\nLEAF_MIPS_DSPR2(jsimd_h2v2_fancy_upsample_mips_dspr2)\n/*\n * a0     - cinfo->max_v_samp_factor\n * a1     - downsampled_width\n * a2     - input_data\n * a3     - output_data_ptr\n */\n\n    SAVE_REGS_ON_STACK 24, s0, s1, s2, s3, s4, s5\n\n    li             s4, 0\n    lw             s2, 0(a3)       // s2 = *output_data_ptr\n0:\n    li             t9, 2\n    lw             s1, -4(a2)      // s1 = inptr1\n\n1:\n    lw             s0, 0(a2)       // s0 = inptr0\n    lwx            s3, s4(s2)\n    addiu          s5, a1, -2      // s5 = downsampled_width - 2\n    srl            t4, s5, 1\n    sll            t4, t4, 1\n    lbu            t0, 0(s0)\n    lbu            t1, 1(s0)\n    lbu            t2, 0(s1)\n    lbu            t3, 1(s1)\n    addiu          s0, 2\n    addiu          s1, 2\n    addu           t8, s0, t4      // t8 = end address\n    andi           s5, s5, 1       // s5 = residual\n    sll            t4, t0, 1\n    sll            t6, t1, 1\n    addu           t0, t0, t4      // t0 = (*inptr0++) * 3\n    addu           t1, t1, t6      // t1 = (*inptr0++) * 3\n    addu           t7, t0, t2      // t7 = thiscolsum\n    addu           t6, t1, t3      // t5 = nextcolsum\n    sll            t0, t7, 2       // t0 = thiscolsum * 4\n    subu           t1, t0, t7      // t1 = thiscolsum * 3\n    shra_r.w       t0, t0, 4\n    addiu          t1, 7\n    addu           t1, t1, t6\n    srl            t1, t1, 4\n    sb             t0, 0(s3)\n    sb             t1, 1(s3)\n    beq            t8, s0, 22f     // skip to final iteration if width == 3\n     addiu          s3, 2\n2:\n    lh             t0, 0(s0)       // t0 = A3|A2\n    lh             t2, 0(s1)       // t2 = B3|B2\n    addiu          s0, 2\n    addiu          s1, 2\n    preceu.ph.qbr  t0, t0          // t0 = 0|A3|0|A2\n    preceu.ph.qbr  t2, t2          // t2 = 0|B3|0|B2\n    shll.ph        t1, t0, 1\n    sll            t3, t6, 1\n    addu.ph        t0, t1, t0      // t0 = A3*3|A2*3\n    addu           t3, t3, t6      // t3 = this * 3\n    addu.ph        t0, t0, t2      // t0 = next2|next1\n    addu           t1, t3, t7\n    andi           t7, t0, 0xFFFF  // t7 = next1\n    sll            t2, t7, 1\n    addu           t2, t7, t2      // t2 = next1*3\n    addu           t4, t2, t6\n    srl            t6, t0, 16      // t6 = next2\n    shra_r.w       t1, t1, 4       // t1 = (this*3 + last + 8) >> 4\n    addu           t0, t3, t7\n    addiu          t0, 7\n    srl            t0, t0, 4       // t0 = (this*3 + next1 + 7) >> 4\n    shra_r.w       t4, t4, 4       // t3 = (next1*3 + this + 8) >> 4\n    addu           t2, t2, t6\n    addiu          t2, 7\n    srl            t2, t2, 4       // t2 = (next1*3 + next2 + 7) >> 4\n    sb             t1, 0(s3)\n    sb             t0, 1(s3)\n    sb             t4, 2(s3)\n    sb             t2, 3(s3)\n    bne            t8, s0, 2b\n     addiu         s3, 4\n22:\n    beqz           s5, 4f\n     addu          t8, s0, s5\n3:\n    lbu            t0, 0(s0)\n    lbu            t2, 0(s1)\n    addiu          s0, 1\n    addiu          s1, 1\n    sll            t3, t6, 1\n    sll            t1, t0, 1\n    addu           t1, t0, t1      // t1 = inptr0 * 3\n    addu           t3, t3, t6      // t3 = thiscolsum * 3\n    addu           t5, t1, t2\n    addu           t1, t3, t7\n    shra_r.w       t1, t1, 4\n    addu           t0, t3, t5\n    addiu          t0, 7\n    srl            t0, t0, 4\n    sb             t1, 0(s3)\n    sb             t0, 1(s3)\n    addiu          s3, 2\n    move           t7, t6\n    bne            t8, s0, 3b\n     move          t6, t5\n4:\n    sll            t0, t6, 2       // t0 = thiscolsum * 4\n    subu           t1, t0, t6      // t1 = thiscolsum * 3\n    addu           t1, t1, t7\n    addiu          s4, 4\n    shra_r.w       t1, t1, 4\n    addiu          t0, 7\n    srl            t0, t0, 4\n    sb             t1, 0(s3)\n    sb             t0, 1(s3)\n    addiu          t9, -1\n    addiu          s3, 2\n    bnez           t9, 1b\n     lw            s1, 4(a2)\n    srl            t0, s4, 2\n    subu           t0, a0, t0\n    bgtz           t0, 0b\n     addiu         a2, 4\n\n    RESTORE_REGS_FROM_STACK 24, s0, s1, s2, s3, s4, s5\n\n    j ra\n     nop\nEND(jsimd_h2v2_fancy_upsample_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_h2v1_fancy_upsample_mips_dspr2)\n/*\n * a0     - cinfo->max_v_samp_factor\n * a1     - downsampled_width\n * a2     - input_data\n * a3     - output_data_ptr\n */\n\n    SAVE_REGS_ON_STACK 16, s0, s1, s2, s3\n\n    .set at\n\n    beqz           a0, 3f\n     sll           t0, a0, 2\n    lw             s1, 0(a3)\n    li             s3, 0x10001\n    addu           s0, s1, t0\n0:\n    addiu          t8, a1, -2\n    srl            t9, t8, 2\n    lw             t7, 0(a2)\n    lw             s2, 0(s1)\n    lbu            t0, 0(t7)\n    lbu            t1, 1(t7)   // t1 = inptr[1]\n    sll            t2, t0, 1\n    addu           t2, t2, t0  // t2 = invalue*3\n    addu           t2, t2, t1\n    shra_r.w       t2, t2, 2\n    sb             t0, 0(s2)\n    sb             t2, 1(s2)\n    beqz           t9, 11f\n     addiu         s2, 2\n1:\n    ulw            t0, 0(t7)   // t0 = |P3|P2|P1|P0|\n    ulw            t1, 1(t7)\n    ulh            t2, 4(t7)   // t2 = |0|0|P5|P4|\n    preceu.ph.qbl  t3, t0      // t3 = |0|P3|0|P2|\n    preceu.ph.qbr  t0, t0      // t0 = |0|P1|0|P0|\n    preceu.ph.qbr  t2, t2      // t2 = |0|P5|0|P4|\n    preceu.ph.qbl  t4, t1      // t4 = |0|P4|0|P3|\n    preceu.ph.qbr  t1, t1      // t1 = |0|P2|0|P1|\n    shll.ph        t5, t4, 1\n    shll.ph        t6, t1, 1\n    addu.ph        t5, t5, t4  // t5 = |P4*3|P3*3|\n    addu.ph        t6, t6, t1  // t6 = |P2*3|P1*3|\n    addu.ph        t4, t3, s3\n    addu.ph        t0, t0, s3\n    addu.ph        t4, t4, t5\n    addu.ph        t0, t0, t6\n    shrl.ph        t4, t4, 2   // t4 = |0|P3|0|P2|\n    shrl.ph        t0, t0, 2   // t0 = |0|P1|0|P0|\n    addu.ph        t2, t2, t5\n    addu.ph        t3, t3, t6\n    shra_r.ph      t2, t2, 2   // t2 = |0|P5|0|P4|\n    shra_r.ph      t3, t3, 2   // t3 = |0|P3|0|P2|\n    shll.ph        t2, t2, 8\n    shll.ph        t3, t3, 8\n    or             t2, t4, t2\n    or             t3, t3, t0\n    addiu          t9, -1\n    usw            t3, 0(s2)\n    usw            t2, 4(s2)\n    addiu          s2, 8\n    bgtz           t9, 1b\n     addiu         t7, 4\n11:\n    andi           t8, 3\n    beqz           t8, 22f\n     addiu         t7, 1\n\n2:\n    lbu            t0, 0(t7)\n    addiu          t7, 1\n    sll            t1, t0, 1\n    addu           t2, t0, t1  // t2 = invalue\n    lbu            t3, -2(t7)\n    lbu            t4, 0(t7)\n    addiu          t3, 1\n    addiu          t4, 2\n    addu           t3, t3, t2\n    addu           t4, t4, t2\n    srl            t3, 2\n    srl            t4, 2\n    sb             t3, 0(s2)\n    sb             t4, 1(s2)\n    addiu          t8, -1\n    bgtz           t8, 2b\n     addiu         s2, 2\n\n22:\n    lbu            t0, 0(t7)\n    lbu            t2, -1(t7)\n    sll            t1, t0, 1\n    addu           t1, t1, t0 // t1 = invalue * 3\n    addu           t1, t1, t2\n    addiu          t1, 1\n    srl            t1, t1, 2\n    sb             t1, 0(s2)\n    sb             t0, 1(s2)\n    addiu          s1, 4\n    bne            s1, s0, 0b\n     addiu         a2, 4\n3:\n    RESTORE_REGS_FROM_STACK 16, s0, s1, s2, s3\n\n    j              ra\n     nop\nEND(jsimd_h2v1_fancy_upsample_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_h2v1_downsample_mips_dspr2)\n/*\n * a0     - cinfo->image_width\n * a1     - cinfo->max_v_samp_factor\n * a2     - compptr->v_samp_factor\n * a3     - compptr->width_in_blocks\n * 16(sp) - input_data\n * 20(sp) - output_data\n */\n    .set at\n\n    SAVE_REGS_ON_STACK 24, s0, s1, s2, s3, s4\n\n    beqz        a2, 7f\n     lw         s1, 44(sp)  // s1 = output_data\n    lw          s0, 40(sp)  // s0 = input_data\n    srl         s2, a0, 2\n    andi        t9, a0, 2\n    srl         t7, t9, 1\n    addu        s2, t7, s2\n    sll         t0, a3, 3   // t0 = width_in_blocks*DCT\n    srl         t7, t0, 1\n    subu        s2, t7, s2\n0:\n    andi        t6, a0, 1   // t6 = temp_index\n    addiu       t6, -1\n    lw          t4, 0(s1)   // t4 = outptr\n    lw          t5, 0(s0)   // t5 = inptr0\n    li          s3, 0       // s3 = bias\n    srl         t7, a0, 1   // t7 = image_width1\n    srl         s4, t7, 2\n    andi        t8, t7, 3\n1:\n    ulhu        t0, 0(t5)\n    ulhu        t1, 2(t5)\n    ulhu        t2, 4(t5)\n    ulhu        t3, 6(t5)\n    raddu.w.qb  t0, t0\n    raddu.w.qb  t1, t1\n    raddu.w.qb  t2, t2\n    raddu.w.qb  t3, t3\n    shra.ph     t0, t0, 1\n    shra_r.ph   t1, t1, 1\n    shra.ph     t2, t2, 1\n    shra_r.ph   t3, t3, 1\n    sb          t0, 0(t4)\n    sb          t1, 1(t4)\n    sb          t2, 2(t4)\n    sb          t3, 3(t4)\n    addiu       s4, -1\n    addiu       t4, 4\n    bgtz        s4, 1b\n     addiu      t5, 8\n    beqz        t8, 3f\n     addu       s4, t4, t8\n2:\n    ulhu        t0, 0(t5)\n    raddu.w.qb  t0, t0\n    addqh.w     t0, t0, s3\n    xori        s3, s3, 1\n    sb          t0, 0(t4)\n    addiu       t4, 1\n    bne         t4, s4, 2b\n     addiu      t5, 2\n3:\n    lbux        t1, t6(t5)\n    sll         t1, 1\n    addqh.w     t2, t1, s3  // t2 = pixval1\n    xori        s3, s3, 1\n    addqh.w     t3, t1, s3  // t3 = pixval2\n    blez        s2, 5f\n     append     t3, t2,  8\n    addu        t5, t4, s2  // t5 = loop_end2\n4:\n    ush         t3, 0(t4)\n    addiu       s2, -1\n    bgtz        s2, 4b\n     addiu      t4,  2\n5:\n    beqz        t9, 6f\n     nop\n    sb          t2, 0(t4)\n6:\n    addiu       s1, 4\n    addiu       a2, -1\n    bnez        a2, 0b\n     addiu      s0, 4\n7:\n    RESTORE_REGS_FROM_STACK 24, s0, s1, s2, s3, s4\n\n    j           ra\n    nop\nEND(jsimd_h2v1_downsample_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_h2v2_downsample_mips_dspr2)\n\n/*\n * a0     - cinfo->image_width\n * a1     - cinfo->max_v_samp_factor\n * a2     - compptr->v_samp_factor\n * a3     - compptr->width_in_blocks\n * 16(sp) - input_data\n * 20(sp) - output_data\n */\n    .set at\n    SAVE_REGS_ON_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    beqz         a2, 8f\n     lw          s1, 52(sp)      // s1 = output_data\n    lw           s0, 48(sp)      // s0 = input_data\n\n    andi         t6, a0, 1       // t6 = temp_index\n    addiu        t6, -1\n    srl          t7, a0, 1       // t7 = image_width1\n    srl          s4, t7, 2\n    andi         t8, t7, 3\n    andi         t9, a0, 2\n    srl          s2, a0, 2\n    srl          t7, t9, 1\n    addu         s2, t7, s2\n    sll          t0, a3, 3       // s2 = width_in_blocks*DCT\n    srl          t7, t0, 1\n    subu         s2, t7, s2\n0:\n    lw           t4, 0(s1)       // t4 = outptr\n    lw           t5, 0(s0)       // t5 = inptr0\n    lw           s7, 4(s0)       // s7 = inptr1\n    li           s6, 1           // s6 = bias\n2:\n    ulw          t0, 0(t5)       // t0 = |P3|P2|P1|P0|\n    ulw          t1, 0(s7)       // t1 = |Q3|Q2|Q1|Q0|\n    ulw          t2, 4(t5)\n    ulw          t3, 4(s7)\n    precrq.ph.w  t7, t0, t1      // t2 = |P3|P2|Q3|Q2|\n    ins          t0, t1, 16, 16  // t0 = |Q1|Q0|P1|P0|\n    raddu.w.qb   t1, t7\n    raddu.w.qb   t0, t0\n    shra_r.w     t1, t1, 2\n    addiu        t0, 1\n    srl          t0, 2\n    precrq.ph.w  t7, t2, t3\n    ins          t2, t3, 16, 16\n    raddu.w.qb   t7, t7\n    raddu.w.qb   t2, t2\n    shra_r.w     t7, t7, 2\n    addiu        t2, 1\n    srl          t2, 2\n    sb           t0, 0(t4)\n    sb           t1, 1(t4)\n    sb           t2, 2(t4)\n    sb           t7, 3(t4)\n    addiu        t4, 4\n    addiu        t5, 8\n    addiu        s4, s4, -1\n    bgtz         s4, 2b\n     addiu       s7, 8\n    beqz         t8, 4f\n     addu        t8, t4, t8\n3:\n    ulhu         t0, 0(t5)\n    ulhu         t1, 0(s7)\n    ins          t0, t1, 16, 16\n    raddu.w.qb   t0, t0\n    addu         t0, t0, s6\n    srl          t0, 2\n    xori         s6, s6, 3\n    sb           t0, 0(t4)\n    addiu        t5, 2\n    addiu        t4, 1\n    bne          t8, t4, 3b\n     addiu       s7, 2\n4:\n    lbux         t1, t6(t5)\n    sll          t1, 1\n    lbux         t0, t6(s7)\n    sll          t0, 1\n    addu         t1, t1, t0\n    addu         t3, t1, s6\n    srl          t0, t3, 2       // t2 = pixval1\n    xori         s6, s6, 3\n    addu         t2, t1, s6\n    srl          t1, t2, 2       // t3 = pixval2\n    blez         s2, 6f\n     append      t1, t0, 8\n5:\n    ush          t1, 0(t4)\n    addiu        s2, -1\n    bgtz         s2, 5b\n     addiu       t4, 2\n6:\n    beqz         t9, 7f\n     nop\n    sb           t0, 0(t4)\n7:\n    addiu        s1, 4\n    addiu        a2, -1\n    bnez         a2, 0b\n     addiu       s0, 8\n8:\n    RESTORE_REGS_FROM_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    j            ra\n     nop\nEND(jsimd_h2v2_downsample_mips_dspr2)\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_h2v2_smooth_downsample_mips_dspr2)\n/*\n * a0     - input_data\n * a1     - output_data\n * a2     - compptr->v_samp_factor\n * a3     - cinfo->max_v_samp_factor\n * 16(sp) - cinfo->smoothing_factor\n * 20(sp) - compptr->width_in_blocks\n * 24(sp) - cinfo->image_width\n */\n\n    .set at\n\n    SAVE_REGS_ON_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    lw          s7, 52(sp)      // compptr->width_in_blocks\n    lw          s0, 56(sp)      // cinfo->image_width\n    lw          s6, 48(sp)      // cinfo->smoothing_factor\n    sll         s7, 3           // output_cols = width_in_blocks * DCTSIZE\n    sll         v0, s7, 1\n    subu        v0, v0, s0\n    blez        v0, 2f\n    move        v1, zero\n    addiu       t0, a3, 2       // t0 = cinfo->max_v_samp_factor + 2\n0:\n    addiu       t1, a0, -4\n    sll         t2, v1, 2\n    lwx         t1, t2(t1)\n    move        t3, v0\n    addu        t1, t1, s0\n    lbu         t2, -1(t1)\n1:\n    addiu       t3, t3, -1\n    sb          t2, 0(t1)\n    bgtz        t3, 1b\n    addiu       t1, t1, 1\n    addiu       v1, v1, 1\n    bne         v1, t0, 0b\n    nop\n2:\n    li          v0, 80\n    mul         v0, s6, v0\n    li          v1, 16384\n    move        t4, zero\n    move        t5, zero\n    subu        t6, v1, v0      // t6 = 16384 - tmp_smoot_f * 80\n    sll         t7, s6, 4       // t7 = tmp_smoot_f * 16\n3:\n/* Special case for first column: pretend column -1 is same as column 0 */\n    sll         v0, t4, 2\n    lwx         t8, v0(a1)      //  outptr = output_data[outrow]\n    sll         v1, t5, 2\n    addiu       t9, v1, 4\n    addiu       s0, v1, -4\n    addiu       s1, v1, 8\n    lwx         s2, v1(a0)      // inptr0 = input_data[inrow]\n    lwx         t9, t9(a0)      // inptr1 = input_data[inrow+1]\n    lwx         s0, s0(a0)      // above_ptr = input_data[inrow-1]\n    lwx         s1, s1(a0)      // below_ptr = input_data[inrow+2]\n    lh          v0, 0(s2)\n    lh          v1, 0(t9)\n    lh          t0, 0(s0)\n    lh          t1, 0(s1)\n    ins         v0, v1, 16, 16\n    ins         t0, t1, 16, 16\n    raddu.w.qb  t2, v0\n    raddu.w.qb  s3, t0\n    lbu         v0, 0(s2)\n    lbu         v1, 2(s2)\n    lbu         t0, 0(t9)\n    lbu         t1, 2(t9)\n    addu        v0, v0, v1\n    mult        $ac1,t2, t6\n    addu        t0, t0, t1\n    lbu         t2, 2(s0)\n    addu        t0, t0, v0\n    lbu         t3, 2(s1)\n    addu        s3, t0, s3\n    lbu         v0, 0(s0)\n    lbu         t0, 0(s1)\n    sll         s3, s3, 1\n    addu        v0, v0, t2\n    addu        t0, t0, t3\n    addu        t0, t0, v0\n    addu        s3, t0, s3\n    madd        $ac1,s3, t7\n    extr_r.w    v0, $ac1, 16\n    addiu       t8, t8, 1\n    addiu       s2, s2, 2\n    addiu       t9, t9, 2\n    addiu       s0, s0, 2\n    addiu       s1, s1, 2\n    sb          v0, -1(t8)\n    addiu       s4, s7, -2\n    and         s4, s4, 3\n    addu        s5, s4, t8      //end adress\n4:\n    lh          v0, 0(s2)\n    lh          v1, 0(t9)\n    lh          t0, 0(s0)\n    lh          t1, 0(s1)\n    ins         v0, v1, 16, 16\n    ins         t0, t1, 16, 16\n    raddu.w.qb  t2, v0\n    raddu.w.qb  s3, t0\n    lbu         v0, -1(s2)\n    lbu         v1, 2(s2)\n    lbu         t0, -1(t9)\n    lbu         t1, 2(t9)\n    addu        v0, v0, v1\n    mult        $ac1, t2, t6\n    addu        t0, t0, t1\n    lbu         t2, 2(s0)\n    addu        t0, t0, v0\n    lbu         t3, 2(s1)\n    addu        s3, t0, s3\n    lbu         v0, -1(s0)\n    lbu         t0, -1(s1)\n    sll         s3, s3, 1\n    addu        v0, v0, t2\n    addu        t0, t0, t3\n    addu        t0, t0, v0\n    addu        s3, t0, s3\n    madd        $ac1, s3, t7\n    extr_r.w    t2, $ac1, 16\n    addiu       t8, t8, 1\n    addiu       s2, s2, 2\n    addiu       t9, t9, 2\n    addiu       s0, s0, 2\n    sb          t2, -1(t8)\n    bne         s5, t8, 4b\n    addiu       s1, s1, 2\n    addiu       s5, s7, -2\n    subu        s5, s5, s4\n    addu        s5, s5, t8      //end adress\n5:\n    lh          v0, 0(s2)\n    lh          v1, 0(t9)\n    lh          t0, 0(s0)\n    lh          t1, 0(s1)\n    ins         v0, v1, 16, 16\n    ins         t0, t1, 16, 16\n    raddu.w.qb  t2, v0\n    raddu.w.qb  s3, t0\n    lbu         v0, -1(s2)\n    lbu         v1, 2(s2)\n    lbu         t0, -1(t9)\n    lbu         t1, 2(t9)\n    addu        v0, v0, v1\n    mult        $ac1, t2, t6\n    addu        t0, t0, t1\n    lbu         t2, 2(s0)\n    addu        t0, t0, v0\n    lbu         t3, 2(s1)\n    addu        s3, t0, s3\n    lbu         v0, -1(s0)\n    lbu         t0, -1(s1)\n    sll         s3, s3, 1\n    addu        v0, v0, t2\n    addu        t0, t0, t3\n    lh          v1, 2(t9)\n    addu        t0, t0, v0\n    lh          v0, 2(s2)\n    addu        s3, t0, s3\n    lh          t0, 2(s0)\n    lh          t1, 2(s1)\n    madd        $ac1, s3, t7\n    extr_r.w    t2, $ac1, 16\n    ins         t0, t1, 16, 16\n    ins         v0, v1, 16, 16\n    raddu.w.qb  s3, t0\n    lbu         v1, 4(s2)\n    lbu         t0, 1(t9)\n    lbu         t1, 4(t9)\n    sb          t2, 0(t8)\n    raddu.w.qb  t3, v0\n    lbu         v0, 1(s2)\n    addu        t0, t0, t1\n    mult        $ac1, t3, t6\n    addu        v0, v0, v1\n    lbu         t2, 4(s0)\n    addu        t0, t0, v0\n    lbu         v0, 1(s0)\n    addu        s3, t0, s3\n    lbu         t0, 1(s1)\n    lbu         t3, 4(s1)\n    addu        v0, v0, t2\n    sll         s3, s3, 1\n    addu        t0, t0, t3\n    lh          v1, 4(t9)\n    addu        t0, t0, v0\n    lh          v0, 4(s2)\n    addu        s3, t0, s3\n    lh          t0, 4(s0)\n    lh          t1, 4(s1)\n    madd        $ac1, s3, t7\n    extr_r.w    t2, $ac1, 16\n    ins         t0, t1, 16, 16\n    ins         v0, v1, 16, 16\n    raddu.w.qb  s3, t0\n    lbu         v1, 6(s2)\n    lbu         t0, 3(t9)\n    lbu         t1, 6(t9)\n    sb          t2, 1(t8)\n    raddu.w.qb  t3, v0\n    lbu         v0, 3(s2)\n    addu        t0, t0,t1\n    mult        $ac1, t3, t6\n    addu        v0, v0, v1\n    lbu         t2, 6(s0)\n    addu        t0, t0, v0\n    lbu         v0, 3(s0)\n    addu        s3, t0, s3\n    lbu         t0, 3(s1)\n    lbu         t3, 6(s1)\n    addu        v0, v0, t2\n    sll         s3, s3, 1\n    addu        t0, t0, t3\n    lh          v1, 6(t9)\n    addu        t0, t0, v0\n    lh          v0, 6(s2)\n    addu        s3, t0, s3\n    lh          t0, 6(s0)\n    lh          t1, 6(s1)\n    madd        $ac1, s3, t7\n    extr_r.w    t3, $ac1, 16\n    ins         t0, t1, 16, 16\n    ins         v0, v1, 16, 16\n    raddu.w.qb  s3, t0\n    lbu         v1, 8(s2)\n    lbu         t0, 5(t9)\n    lbu         t1, 8(t9)\n    sb          t3, 2(t8)\n    raddu.w.qb  t2, v0\n    lbu         v0, 5(s2)\n    addu        t0, t0, t1\n    mult        $ac1, t2, t6\n    addu        v0, v0, v1\n    lbu         t2, 8(s0)\n    addu        t0, t0, v0\n    lbu         v0, 5(s0)\n    addu        s3, t0, s3\n    lbu         t0, 5(s1)\n    lbu         t3, 8(s1)\n    addu        v0, v0, t2\n    sll         s3, s3, 1\n    addu        t0, t0, t3\n    addiu       t8, t8, 4\n    addu        t0, t0, v0\n    addiu       s2, s2, 8\n    addu        s3, t0, s3\n    addiu       t9, t9, 8\n    madd        $ac1, s3, t7\n    extr_r.w    t1, $ac1, 16\n    addiu       s0, s0, 8\n    addiu       s1, s1, 8\n    bne         s5, t8, 5b\n    sb          t1, -1(t8)\n/* Special case for last column */\n    lh          v0, 0(s2)\n    lh          v1, 0(t9)\n    lh          t0, 0(s0)\n    lh          t1, 0(s1)\n    ins         v0, v1, 16, 16\n    ins         t0, t1, 16, 16\n    raddu.w.qb  t2, v0\n    raddu.w.qb  s3, t0\n    lbu         v0, -1(s2)\n    lbu         v1, 1(s2)\n    lbu         t0, -1(t9)\n    lbu         t1, 1(t9)\n    addu        v0, v0, v1\n    mult        $ac1, t2, t6\n    addu        t0, t0, t1\n    lbu         t2, 1(s0)\n    addu        t0, t0, v0\n    lbu         t3, 1(s1)\n    addu        s3, t0, s3\n    lbu         v0, -1(s0)\n    lbu         t0, -1(s1)\n    sll         s3, s3, 1\n    addu        v0, v0, t2\n    addu        t0, t0, t3\n    addu        t0, t0, v0\n    addu        s3, t0, s3\n    madd        $ac1, s3, t7\n    extr_r.w    t0, $ac1, 16\n    addiu       t5, t5, 2\n    sb          t0, 0(t8)\n    addiu       t4, t4, 1\n    bne         t4, a2, 3b\n    addiu       t5, t5, 2\n\n    RESTORE_REGS_FROM_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    j           ra\n     nop\n\nEND(jsimd_h2v2_smooth_downsample_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_int_upsample_mips_dspr2)\n/*\n * a0     - upsample->h_expand[compptr->component_index]\n * a1     - upsample->v_expand[compptr->component_index]\n * a2     - input_data\n * a3     - output_data_ptr\n * 16(sp) - cinfo->output_width\n * 20(sp) - cinfo->max_v_samp_factor\n */\n    .set at\n\n    SAVE_REGS_ON_STACK 16, s0, s1, s2, s3\n\n    lw      s0, 0(a3)    // s0 = output_data\n    lw      s1, 32(sp)   // s1 = cinfo->output_width\n    lw      s2, 36(sp)   // s2 = cinfo->max_v_samp_factor\n    li      t6, 0        // t6 = inrow\n    beqz    s2, 10f\n     li     s3, 0        // s3 = outrow\n0:\n    addu    t0, a2, t6\n    addu    t7, s0, s3\n    lw      t3, 0(t0)    // t3 = inptr\n    lw      t8, 0(t7)    // t8 = outptr\n    beqz    s1, 4f\n     addu   t5, t8, s1   // t5 = outend\n1:\n    lb      t2, 0(t3)    // t2 = invalue = *inptr++\n    addiu   t3, 1\n    beqz    a0, 3f\n     move   t0, a0       // t0 = h_expand\n2:\n    sb      t2, 0(t8)\n    addiu   t0, -1\n    bgtz    t0, 2b\n     addiu  t8, 1\n3:\n    bgt     t5, t8, 1b\n     nop\n4:\n    addiu   t9, a1, -1   // t9 = v_expand - 1\n    blez    t9, 9f\n     nop\n5:\n    lw      t3, 0(s0)\n    lw      t4, 4(s0)\n    subu    t0, s1, 0xF\n    blez    t0, 7f\n     addu   t5, t3, s1   // t5 = end address\n    andi    t7, s1, 0xF  // t7 = residual\n    subu    t8, t5, t7\n6:\n    ulw     t0, 0(t3)\n    ulw     t1, 4(t3)\n    ulw     t2, 8(t3)\n    usw     t0, 0(t4)\n    ulw     t0, 12(t3)\n    usw     t1, 4(t4)\n    usw     t2, 8(t4)\n    usw     t0, 12(t4)\n    addiu   t3, 16\n    bne     t3, t8, 6b\n     addiu  t4, 16\n    beqz    t7, 8f\n     nop\n7:\n    lbu     t0, 0(t3)\n    sb      t0, 0(t4)\n    addiu   t3, 1\n    bne     t3, t5, 7b\n     addiu  t4, 1\n8:\n    addiu   t9, -1\n    bgtz    t9, 5b\n     addiu  s0, 8\n9:\n    addu    s3, s3, a1\n    bne     s3, s2, 0b\n     addiu  t6, 1\n10:\n    RESTORE_REGS_FROM_STACK 16, s0, s1, s2, s3\n\n    j       ra\n     nop\nEND(jsimd_int_upsample_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_h2v1_upsample_mips_dspr2)\n/*\n * a0     - cinfo->max_v_samp_factor\n * a1     - cinfo->output_width\n * a2     - input_data\n * a3     - output_data_ptr\n */\n    lw      t7, 0(a3)       // t7 = output_data\n    andi    t8, a1, 0xf     // t8 = residual\n    sll     t0, a0, 2\n    blez    a0, 4f\n     addu   t9, t7, t0      // t9 = output_data end address\n0:\n    lw      t5, 0(t7)       // t5 = outptr\n    lw      t6, 0(a2)       // t6 = inptr\n    addu    t3, t5, a1      // t3 = outptr + output_width (end address)\n    subu    t3, t8          // t3 = end address - residual\n    beq     t5, t3, 2f\n     move   t4, t8\n1:\n    ulw     t0, 0(t6)       // t0 = |P3|P2|P1|P0|\n    ulw     t2, 4(t6)       // t2 = |P7|P6|P5|P4|\n    srl     t1, t0, 16      // t1 = |X|X|P3|P2|\n    ins     t0, t0, 16, 16  // t0 = |P1|P0|P1|P0|\n    ins     t1, t1, 16, 16  // t1 = |P3|P2|P3|P2|\n    ins     t0, t0, 8, 16   // t0 = |P1|P1|P0|P0|\n    ins     t1, t1, 8, 16   // t1 = |P3|P3|P2|P2|\n    usw     t0, 0(t5)\n    usw     t1, 4(t5)\n    srl     t0, t2, 16      // t0 = |X|X|P7|P6|\n    ins     t2, t2, 16, 16  // t2 = |P5|P4|P5|P4|\n    ins     t0, t0, 16, 16  // t0 = |P7|P6|P7|P6|\n    ins     t2, t2, 8, 16   // t2 = |P5|P5|P4|P4|\n    ins     t0, t0, 8, 16   // t0 = |P7|P7|P6|P6|\n    usw     t2, 8(t5)\n    usw     t0, 12(t5)\n    addiu   t5, 16\n    bne     t5, t3, 1b\n     addiu  t6, 8\n    beqz    t8, 3f\n     move   t4, t8\n2:\n    lbu     t1, 0(t6)\n    sb      t1, 0(t5)\n    sb      t1, 1(t5)\n    addiu   t4, -2\n    addiu   t6, 1\n    bgtz    t4, 2b\n     addiu  t5, 2\n3:\n    addiu   t7, 4\n    bne     t9, t7, 0b\n     addiu  a2, 4\n4:\n    j       ra\n     nop\nEND(jsimd_h2v1_upsample_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_h2v2_upsample_mips_dspr2)\n/*\n * a0     - cinfo->max_v_samp_factor\n * a1     - cinfo->output_width\n * a2     - input_data\n * a3     - output_data_ptr\n */\n    lw      t7, 0(a3)\n    blez    a0, 7f\n     andi   t9, a1, 0xf     // t9 = residual\n0:\n    lw      t6, 0(a2)       // t6 = inptr\n    lw      t5, 0(t7)       // t5 = outptr\n    addu    t8, t5, a1      // t8 = outptr end address\n    subu    t8, t9          // t8 = end address - residual\n    beq     t5, t8, 2f\n     move   t4, t9\n1:\n    ulw     t0, 0(t6)\n    srl     t1, t0, 16\n    ins     t0, t0, 16, 16\n    ins     t0, t0, 8, 16\n    ins     t1, t1, 16, 16\n    ins     t1, t1, 8, 16\n    ulw     t2, 4(t6)\n    usw     t0, 0(t5)\n    usw     t1, 4(t5)\n    srl     t3, t2, 16\n    ins     t2, t2, 16, 16\n    ins     t2, t2, 8, 16\n    ins     t3, t3, 16, 16\n    ins     t3, t3, 8, 16\n    usw     t2, 8(t5)\n    usw     t3, 12(t5)\n    addiu   t5, 16\n    bne     t5, t8, 1b\n     addiu  t6, 8\n    beqz    t9, 3f\n     move   t4, t9\n2:\n    lbu     t0, 0(t6)\n    sb      t0, 0(t5)\n    sb      t0, 1(t5)\n    addiu   t4, -2\n    addiu   t6, 1\n    bgtz    t4, 2b\n     addiu  t5, 2\n3:\n    lw      t6, 0(t7)       // t6 = outptr[0]\n    lw      t5, 4(t7)       // t5 = outptr[1]\n    addu    t4, t6, a1      // t4 = new end address\n    beq     a1, t9, 5f\n     subu   t8, t4, t9\n4:\n    ulw     t0, 0(t6)\n    ulw     t1, 4(t6)\n    ulw     t2, 8(t6)\n    usw     t0, 0(t5)\n    ulw     t0, 12(t6)\n    usw     t1, 4(t5)\n    usw     t2, 8(t5)\n    usw     t0, 12(t5)\n    addiu   t6, 16\n    bne     t6, t8, 4b\n     addiu  t5, 16\n    beqz    t9, 6f\n     nop\n5:\n    lbu     t0, 0(t6)\n    sb      t0, 0(t5)\n    addiu   t6, 1\n    bne     t6, t4, 5b\n     addiu  t5, 1\n6:\n    addiu   t7, 8\n    addiu   a0, -2\n    bgtz    a0, 0b\n     addiu  a2, 4\n7:\n    j       ra\n     nop\nEND(jsimd_h2v2_upsample_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_idct_islow_mips_dspr2)\n/*\n * a0     - coef_block\n * a1     - compptr->dcttable\n * a2     - output\n * a3     - range_limit\n */\n\n    SAVE_REGS_ON_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    addiu     sp, sp, -256\n    move      v0, sp\n    addiu     v1, zero, 8      // v1 = DCTSIZE = 8\n1:\n    lh        s4, 32(a0)       // s4 = inptr[16]\n    lh        s5, 64(a0)       // s5 = inptr[32]\n    lh        s6, 96(a0)       // s6 = inptr[48]\n    lh        t1, 112(a0)      // t1 = inptr[56]\n    lh        t7, 16(a0)       // t7 = inptr[8]\n    lh        t5, 80(a0)       // t5 = inptr[40]\n    lh        t3, 48(a0)       // t3 = inptr[24]\n    or        s4, s4, t1\n    or        s4, s4, t3\n    or        s4, s4, t5\n    or        s4, s4, t7\n    or        s4, s4, s5\n    or        s4, s4, s6\n    bnez      s4, 2f\n     addiu    v1, v1, -1\n    lh        s5, 0(a1)        // quantptr[DCTSIZE*0]\n    lh        s6, 0(a0)        // inptr[DCTSIZE*0]\n    mul       s5, s5, s6       // DEQUANTIZE(inptr[0], quantptr[0])\n    sll       s5, s5, 2\n    sw        s5, 0(v0)\n    sw        s5, 32(v0)\n    sw        s5, 64(v0)\n    sw        s5, 96(v0)\n    sw        s5, 128(v0)\n    sw        s5, 160(v0)\n    sw        s5, 192(v0)\n    b         3f\n     sw       s5, 224(v0)\n2:\n    lh        t0, 112(a1)\n    lh        t2, 48(a1)\n    lh        t4, 80(a1)\n    lh        t6, 16(a1)\n    mul       t0, t0, t1       // DEQUANTIZE(inptr[DCTSIZE*7],quant[DCTSIZE*7])\n    mul       t1, t2, t3       // DEQUANTIZE(inptr[DCTSIZE*3],quant[DCTSIZE*3])\n    mul       t2, t4, t5       // DEQUANTIZE(inptr[DCTSIZE*5],quant[DCTSIZE*5])\n    mul       t3, t6, t7       // DEQUANTIZE(inptr[DCTSIZE*1],quant[DCTSIZE*1])\n    lh        t4, 32(a1)\n    lh        t5, 32(a0)\n    lh        t6, 96(a1)\n    lh        t7, 96(a0)\n    addu      s0, t0, t1       // z3 = tmp0 + tmp2\n    addu      s1, t1, t2       // z2 = tmp1 + tmp2\n    addu      s2, t2, t3       // z4 = tmp1 + tmp3\n    addu      s3, s0, s2       // z3 + z4\n    addiu     t9, zero, 9633   // FIX_1_175875602\n    mul       s3, s3, t9       // z5 = MULTIPLY(z3 + z4, FIX_1_175875602)\n    addu      t8, t0, t3       // z1 = tmp0 + tmp3\n    addiu     t9, zero, 2446   // FIX_0_298631336\n    mul       t0, t0, t9       // tmp0 = MULTIPLY(tmp0, FIX_0_298631336)\n    addiu     t9, zero, 16819  // FIX_2_053119869\n    mul       t2, t2, t9       // tmp1 = MULTIPLY(tmp1, FIX_2_053119869)\n    addiu     t9, zero, 25172  // FIX_3_072711026\n    mul       t1, t1, t9       // tmp2 = MULTIPLY(tmp2, FIX_3_072711026)\n    addiu     t9, zero, 12299  // FIX_1_501321110\n    mul       t3, t3, t9       // tmp3 = MULTIPLY(tmp3, FIX_1_501321110)\n    addiu     t9, zero, 16069  // FIX_1_961570560\n    mul       s0, s0, t9       // -z3 = MULTIPLY(z3, FIX_1_961570560)\n    addiu     t9, zero, 3196   // FIX_0_390180644\n    mul       s2, s2, t9       // -z4 = MULTIPLY(z4, FIX_0_390180644)\n    addiu     t9, zero, 7373   // FIX_0_899976223\n    mul       t8, t8, t9       // -z1 = MULTIPLY(z1, FIX_0_899976223)\n    addiu     t9, zero, 20995  // FIX_2_562915447\n    mul       s1, s1, t9       // -z2 = MULTIPLY(z2, FIX_2_562915447)\n    subu      s0, s3, s0       // z3 += z5\n    addu      t0, t0, s0       // tmp0 += z3\n    addu      t1, t1, s0       // tmp2 += z3\n    subu      s2, s3, s2       // z4 += z5\n    addu      t2, t2, s2       // tmp1 += z4\n    addu      t3, t3, s2       // tmp3 += z4\n    subu      t0, t0, t8       // tmp0 += z1\n    subu      t1, t1, s1       // tmp2 += z2\n    subu      t2, t2, s1       // tmp1 += z2\n    subu      t3, t3, t8       // tmp3 += z1\n    mul       s0, t4, t5       // DEQUANTIZE(inptr[DCTSIZE*2],quant[DCTSIZE*2])\n    addiu     t9, zero, 6270   // FIX_0_765366865\n    mul       s1, t6, t7       // DEQUANTIZE(inptr[DCTSIZE*6],quant[DCTSIZE*6])\n    lh        t4, 0(a1)\n    lh        t5, 0(a0)\n    lh        t6, 64(a1)\n    lh        t7, 64(a0)\n    mul       s2, t9, s0       // MULTIPLY(z2, FIX_0_765366865)\n    mul       t5, t4, t5       // DEQUANTIZE(inptr[DCTSIZE*0],quant[DCTSIZE*0])\n    mul       t6, t6, t7       // DEQUANTIZE(inptr[DCTSIZE*4],quant[DCTSIZE*4])\n    addiu     t9, zero, 4433   // FIX_0_541196100\n    addu      s3, s0, s1       // z2 + z3\n    mul       s3, s3, t9       // z1 = MULTIPLY(z2 + z3, FIX_0_541196100)\n    addiu     t9, zero, 15137  // FIX_1_847759065\n    mul       t8, s1, t9       // MULTIPLY(z3, FIX_1_847759065)\n    addu      t4, t5, t6\n    subu      t5, t5, t6\n    sll       t4, t4, 13       // tmp0 = (z2 + z3) << CONST_BITS\n    sll       t5, t5, 13       // tmp1 = (z2 - z3) << CONST_BITS\n    addu      t7, s3, s2       // tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865)\n    subu      t6, s3, t8       // tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065)\n    addu      s0, t4, t7\n    subu      s1, t4, t7\n    addu      s2, t5, t6\n    subu      s3, t5, t6\n    addu      t4, s0, t3\n    subu      s0, s0, t3\n    addu      t3, s2, t1\n    subu      s2, s2, t1\n    addu      t1, s3, t2\n    subu      s3, s3, t2\n    addu      t2, s1, t0\n    subu      s1, s1, t0\n    shra_r.w  t4, t4, 11\n    shra_r.w  t3, t3, 11\n    shra_r.w  t1, t1, 11\n    shra_r.w  t2, t2, 11\n    shra_r.w  s1, s1, 11\n    shra_r.w  s3, s3, 11\n    shra_r.w  s2, s2, 11\n    shra_r.w  s0, s0, 11\n    sw        t4, 0(v0)\n    sw        t3, 32(v0)\n    sw        t1, 64(v0)\n    sw        t2, 96(v0)\n    sw        s1, 128(v0)\n    sw        s3, 160(v0)\n    sw        s2, 192(v0)\n    sw        s0, 224(v0)\n3:\n    addiu     a1, a1, 2\n    addiu     a0, a0, 2\n    bgtz      v1, 1b\n     addiu    v0, v0, 4\n    move      v0, sp\n    addiu     v1, zero, 8\n4:\n    lw        t0, 8(v0)        // z2 = (JLONG) wsptr[2]\n    lw        t1, 24(v0)       // z3 = (JLONG) wsptr[6]\n    lw        t2, 0(v0)        // (JLONG) wsptr[0]\n    lw        t3, 16(v0)       // (JLONG) wsptr[4]\n    lw        s4, 4(v0)        // (JLONG) wsptr[1]\n    lw        s5, 12(v0)       // (JLONG) wsptr[3]\n    lw        s6, 20(v0)       // (JLONG) wsptr[5]\n    lw        s7, 28(v0)       // (JLONG) wsptr[7]\n    or        s4, s4, t0\n    or        s4, s4, t1\n    or        s4, s4, t3\n    or        s4, s4, s7\n    or        s4, s4, s5\n    or        s4, s4, s6\n    bnez      s4, 5f\n     addiu    v1, v1, -1\n    shra_r.w  s5, t2, 5\n    andi      s5, s5, 0x3ff\n    lbux      s5, s5(a3)\n    lw        s1, 0(a2)\n    replv.qb  s5, s5\n    usw       s5, 0(s1)\n    usw       s5, 4(s1)\n    b         6f\n     nop\n5:\n    addu      t4, t0, t1       // z2 + z3\n    addiu     t8, zero, 4433   // FIX_0_541196100\n    mul       t5, t4, t8       // z1 = MULTIPLY(z2 + z3, FIX_0_541196100)\n    addiu     t8, zero, 15137  // FIX_1_847759065\n    mul       t1, t1, t8       // MULTIPLY(z3, FIX_1_847759065)\n    addiu     t8, zero, 6270   // FIX_0_765366865\n    mul       t0, t0, t8       // MULTIPLY(z2, FIX_0_765366865)\n    addu      t4, t2, t3       // (JLONG) wsptr[0] + (JLONG) wsptr[4]\n    subu      t2, t2, t3       // (JLONG) wsptr[0] - (JLONG) wsptr[4]\n    sll       t4, t4, 13       // tmp0 = ((wsptr[0] + wsptr[4]) << CONST_BITS\n    sll       t2, t2, 13       // tmp1 = ((wsptr[0] - wsptr[4]) << CONST_BITS\n    subu      t1, t5, t1       // tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065)\n    subu      t3, t2, t1       // tmp12 = tmp1 - tmp2\n    addu      t2, t2, t1       // tmp11 = tmp1 + tmp2\n    addu      t5, t5, t0       // tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865)\n    subu      t1, t4, t5       // tmp13 = tmp0 - tmp3\n    addu      t0, t4, t5       // tmp10 = tmp0 + tmp3\n    lw        t4, 28(v0)       // tmp0 = (JLONG) wsptr[7]\n    lw        t6, 12(v0)       // tmp2 = (JLONG) wsptr[3]\n    lw        t5, 20(v0)       // tmp1 = (JLONG) wsptr[5]\n    lw        t7, 4(v0)        // tmp3 = (JLONG) wsptr[1]\n    addu      s0, t4, t6       // z3 = tmp0 + tmp2\n    addiu     t8, zero, 9633   // FIX_1_175875602\n    addu      s1, t5, t7       // z4 = tmp1 + tmp3\n    addu      s2, s0, s1       // z3 + z4\n    mul       s2, s2, t8       // z5 = MULTIPLY(z3 + z4, FIX_1_175875602)\n    addu      s3, t4, t7       // z1 = tmp0 + tmp3\n    addu      t9, t5, t6       // z2 = tmp1 + tmp2\n    addiu     t8, zero, 16069  // FIX_1_961570560\n    mul       s0, s0, t8       // -z3 = MULTIPLY(z3, FIX_1_961570560)\n    addiu     t8, zero, 3196   // FIX_0_390180644\n    mul       s1, s1, t8       // -z4 = MULTIPLY(z4, FIX_0_390180644)\n    addiu     t8, zero, 2446   // FIX_0_298631336\n    mul       t4, t4, t8       // tmp0 = MULTIPLY(tmp0, FIX_0_298631336)\n    addiu     t8, zero, 7373   // FIX_0_899976223\n    mul       s3, s3, t8       // -z1 = MULTIPLY(z1, FIX_0_899976223)\n    addiu     t8, zero, 16819  // FIX_2_053119869\n    mul       t5, t5, t8       // tmp1 = MULTIPLY(tmp1, FIX_2_053119869)\n    addiu     t8, zero, 20995  // FIX_2_562915447\n    mul       t9, t9, t8       // -z2 = MULTIPLY(z2, FIX_2_562915447)\n    addiu     t8, zero, 25172  // FIX_3_072711026\n    mul       t6, t6, t8       // tmp2 = MULTIPLY(tmp2, FIX_3_072711026)\n    addiu     t8, zero, 12299  // FIX_1_501321110\n    mul       t7, t7, t8       // tmp3 = MULTIPLY(tmp3, FIX_1_501321110)\n    subu      s0, s2, s0       // z3 += z5\n    subu      s1, s2, s1       // z4 += z5\n    addu      t4, t4, s0\n    subu      t4, t4, s3       // tmp0\n    addu      t5, t5, s1\n    subu      t5, t5, t9       // tmp1\n    addu      t6, t6, s0\n    subu      t6, t6, t9       // tmp2\n    addu      t7, t7, s1\n    subu      t7, t7, s3       // tmp3\n    addu      s0, t0, t7\n    subu      t0, t0, t7\n    addu      t7, t2, t6\n    subu      t2, t2, t6\n    addu      t6, t3, t5\n    subu      t3, t3, t5\n    addu      t5, t1, t4\n    subu      t1, t1, t4\n    shra_r.w  s0, s0, 18\n    shra_r.w  t7, t7, 18\n    shra_r.w  t6, t6, 18\n    shra_r.w  t5, t5, 18\n    shra_r.w  t1, t1, 18\n    shra_r.w  t3, t3, 18\n    shra_r.w  t2, t2, 18\n    shra_r.w  t0, t0, 18\n    andi      s0, s0, 0x3ff\n    andi      t7, t7, 0x3ff\n    andi      t6, t6, 0x3ff\n    andi      t5, t5, 0x3ff\n    andi      t1, t1, 0x3ff\n    andi      t3, t3, 0x3ff\n    andi      t2, t2, 0x3ff\n    andi      t0, t0, 0x3ff\n    lw        s1, 0(a2)\n    lbux      s0, s0(a3)\n    lbux      t7, t7(a3)\n    lbux      t6, t6(a3)\n    lbux      t5, t5(a3)\n    lbux      t1, t1(a3)\n    lbux      t3, t3(a3)\n    lbux      t2, t2(a3)\n    lbux      t0, t0(a3)\n    sb        s0, 0(s1)\n    sb        t7, 1(s1)\n    sb        t6, 2(s1)\n    sb        t5, 3(s1)\n    sb        t1, 4(s1)\n    sb        t3, 5(s1)\n    sb        t2, 6(s1)\n    sb        t0, 7(s1)\n6:\n    addiu     v0, v0, 32\n    bgtz      v1, 4b\n     addiu    a2, a2, 4\n    addiu     sp, sp, 256\n\n    RESTORE_REGS_FROM_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    j         ra\n     nop\n\nEND(jsimd_idct_islow_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_idct_ifast_cols_mips_dspr2)\n/*\n * a0     - inptr\n * a1     - quantptr\n * a2     - wsptr\n * a3     - mips_idct_ifast_coefs\n */\n\n    SAVE_REGS_ON_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    addiu          t9, a0, 16            // end address\n    or             AT, a3, zero\n\n0:\n    lw             s0, 0(a1)             // quantptr[DCTSIZE*0]\n    lw             t0, 0(a0)             // inptr[DCTSIZE*0]\n    lw             t1, 16(a0)            // inptr[DCTSIZE*1]\n    muleq_s.w.phl  v0, t0, s0            // tmp0 ...\n    lw             t2, 32(a0)            // inptr[DCTSIZE*2]\n    lw             t3, 48(a0)            // inptr[DCTSIZE*3]\n    lw             t4, 64(a0)            // inptr[DCTSIZE*4]\n    lw             t5, 80(a0)            // inptr[DCTSIZE*5]\n    muleq_s.w.phr  t0, t0, s0            // ... tmp0 ...\n    lw             t6, 96(a0)            // inptr[DCTSIZE*6]\n    lw             t7, 112(a0)           // inptr[DCTSIZE*7]\n    or             s4, t1, t2\n    or             s5, t3, t4\n    bnez           s4, 1f\n     ins           t0, v0, 16, 16        // ... tmp0\n    bnez           s5, 1f\n     or            s6, t5, t6\n    or             s6, s6, t7\n    bnez           s6, 1f\n     sw            t0, 0(a2)             // wsptr[DCTSIZE*0]\n    sw             t0, 16(a2)            // wsptr[DCTSIZE*1]\n    sw             t0, 32(a2)            // wsptr[DCTSIZE*2]\n    sw             t0, 48(a2)            // wsptr[DCTSIZE*3]\n    sw             t0, 64(a2)            // wsptr[DCTSIZE*4]\n    sw             t0, 80(a2)            // wsptr[DCTSIZE*5]\n    sw             t0, 96(a2)            // wsptr[DCTSIZE*6]\n    sw             t0, 112(a2)           // wsptr[DCTSIZE*7]\n    addiu          a0, a0, 4\n    b              2f\n     addiu         a1, a1, 4\n\n1:\n    lw             s1, 32(a1)            // quantptr[DCTSIZE*2]\n    lw             s2, 64(a1)            // quantptr[DCTSIZE*4]\n    muleq_s.w.phl  v0, t2, s1            // tmp1 ...\n    muleq_s.w.phr  t2, t2, s1            // ... tmp1 ...\n    lw             s0, 16(a1)            // quantptr[DCTSIZE*1]\n    lw             s1, 48(a1)            // quantptr[DCTSIZE*3]\n    lw             s3, 96(a1)            // quantptr[DCTSIZE*6]\n    muleq_s.w.phl  v1, t4, s2            // tmp2 ...\n    muleq_s.w.phr  t4, t4, s2            // ... tmp2 ...\n    lw             s2, 80(a1)            // quantptr[DCTSIZE*5]\n    lw             t8, 4(AT)             // FIX(1.414213562)\n    ins            t2, v0, 16, 16        // ... tmp1\n    muleq_s.w.phl  v0, t6, s3            // tmp3 ...\n    muleq_s.w.phr  t6, t6, s3            // ... tmp3 ...\n    ins            t4, v1, 16, 16        // ... tmp2\n    addq.ph        s4, t0, t4            // tmp10\n    subq.ph        s5, t0, t4            // tmp11\n    ins            t6, v0, 16, 16        // ... tmp3\n    subq.ph        s6, t2, t6            // tmp12 ...\n    addq.ph        s7, t2, t6            // tmp13\n    mulq_s.ph      s6, s6, t8            // ... tmp12 ...\n    addq.ph        t0, s4, s7            // tmp0\n    subq.ph        t6, s4, s7            // tmp3\n    muleq_s.w.phl  v0, t1, s0            // tmp4 ...\n    muleq_s.w.phr  t1, t1, s0            // ... tmp4 ...\n    shll_s.ph      s6, s6, 1             // x2\n    lw             s3, 112(a1)           // quantptr[DCTSIZE*7]\n    subq.ph        s6, s6, s7            // ... tmp12\n    muleq_s.w.phl  v1, t7, s3            // tmp7 ...\n    muleq_s.w.phr  t7, t7, s3            // ... tmp7 ...\n    ins            t1, v0, 16, 16        // ... tmp4\n    addq.ph        t2, s5, s6            // tmp1\n    subq.ph        t4, s5, s6            // tmp2\n    muleq_s.w.phl  v0, t5, s2            // tmp6 ...\n    muleq_s.w.phr  t5, t5, s2            // ... tmp6 ...\n    ins            t7, v1, 16, 16        // ... tmp7\n    addq.ph        s5, t1, t7            // z11\n    subq.ph        s6, t1, t7            // z12\n    muleq_s.w.phl  v1, t3, s1            // tmp5 ...\n    muleq_s.w.phr  t3, t3, s1            // ... tmp5 ...\n    ins            t5, v0, 16, 16        // ... tmp6\n    ins            t3, v1, 16, 16        // ... tmp5\n    addq.ph        s7, t5, t3            // z13\n    subq.ph        v0, t5, t3            // z10\n    addq.ph        t7, s5, s7            // tmp7\n    subq.ph        s5, s5, s7            // tmp11 ...\n    addq.ph        v1, v0, s6            // z5 ...\n    mulq_s.ph      s5, s5, t8            // ... tmp11\n    lw             t8, 8(AT)             // FIX(1.847759065)\n    lw             s4, 0(AT)             // FIX(1.082392200)\n    addq.ph        s0, t0, t7\n    subq.ph        s1, t0, t7\n    mulq_s.ph      v1, v1, t8            // ... z5\n    shll_s.ph      s5, s5, 1             // x2\n    lw             t8, 12(AT)            // FIX(-2.613125930)\n    sw             s0, 0(a2)             // wsptr[DCTSIZE*0]\n    shll_s.ph      v0, v0, 1             // x4\n    mulq_s.ph      v0, v0, t8            // tmp12 ...\n    mulq_s.ph      s4, s6, s4            // tmp10 ...\n    shll_s.ph      v1, v1, 1             // x2\n    addiu          a0, a0, 4\n    addiu          a1, a1, 4\n    sw             s1, 112(a2)           // wsptr[DCTSIZE*7]\n    shll_s.ph      s6, v0, 1             // x4\n    shll_s.ph      s4, s4, 1             // x2\n    addq.ph        s6, s6, v1            // ... tmp12\n    subq.ph        t5, s6, t7            // tmp6\n    subq.ph        s4, s4, v1            // ... tmp10\n    subq.ph        t3, s5, t5            // tmp5\n    addq.ph        s2, t2, t5\n    addq.ph        t1, s4, t3            // tmp4\n    subq.ph        s3, t2, t5\n    sw             s2, 16(a2)            // wsptr[DCTSIZE*1]\n    sw             s3, 96(a2)            // wsptr[DCTSIZE*6]\n    addq.ph        v0, t4, t3\n    subq.ph        v1, t4, t3\n    sw             v0, 32(a2)            // wsptr[DCTSIZE*2]\n    sw             v1, 80(a2)            // wsptr[DCTSIZE*5]\n    addq.ph        v0, t6, t1\n    subq.ph        v1, t6, t1\n    sw             v0, 64(a2)            // wsptr[DCTSIZE*4]\n    sw             v1, 48(a2)            // wsptr[DCTSIZE*3]\n\n2:\n    bne            a0, t9, 0b\n     addiu         a2, a2, 4\n\n    RESTORE_REGS_FROM_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    j              ra\n     nop\n\nEND(jsimd_idct_ifast_cols_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_idct_ifast_rows_mips_dspr2)\n/*\n * a0     - wsptr\n * a1     - output_buf\n * a2     - output_col\n * a3     - mips_idct_ifast_coefs\n */\n\n    SAVE_REGS_ON_STACK 40, s0, s1, s2, s3, s4, s5, s6, s7, s8, a3\n\n    addiu         t9, a0, 128        // end address\n    lui           s8, 0x8080\n    ori           s8, s8, 0x8080\n\n0:\n    lw            AT, 36(sp)         // restore $a3 (mips_idct_ifast_coefs)\n    lw            t0, 0(a0)          // wsptr[DCTSIZE*0+0/1]  b a\n    lw            s0, 16(a0)         // wsptr[DCTSIZE*1+0/1]  B A\n    lw            t2, 4(a0)          // wsptr[DCTSIZE*0+2/3]  d c\n    lw            s2, 20(a0)         // wsptr[DCTSIZE*1+2/3]  D C\n    lw            t4, 8(a0)          // wsptr[DCTSIZE*0+4/5]  f e\n    lw            s4, 24(a0)         // wsptr[DCTSIZE*1+4/5]  F E\n    lw            t6, 12(a0)         // wsptr[DCTSIZE*0+6/7]  h g\n    lw            s6, 28(a0)         // wsptr[DCTSIZE*1+6/7]  H G\n    precrq.ph.w   t1, s0, t0         // B b\n    ins           t0, s0, 16, 16     // A a\n    bnez          t1, 1f\n     or           s0, t2, s2\n    bnez          s0, 1f\n     or           s0, t4, s4\n    bnez          s0, 1f\n     or           s0, t6, s6\n    bnez          s0, 1f\n     shll_s.ph    s0, t0, 2          // A a\n    lw            a3, 0(a1)\n    lw            AT, 4(a1)\n    precrq.ph.w   t0, s0, s0         // A A\n    ins           s0, s0, 16, 16     // a a\n    addu          a3, a3, a2\n    addu          AT, AT, a2\n    precrq.qb.ph  t0, t0, t0         // A A A A\n    precrq.qb.ph  s0, s0, s0         // a a a a\n    addu.qb       s0, s0, s8\n    addu.qb       t0, t0, s8\n    sw            s0, 0(a3)\n    sw            s0, 4(a3)\n    sw            t0, 0(AT)\n    sw            t0, 4(AT)\n    addiu         a0, a0, 32\n    bne           a0, t9, 0b\n     addiu        a1, a1, 8\n    b             2f\n     nop\n\n1:\n    precrq.ph.w   t3, s2, t2\n    ins           t2, s2, 16, 16\n    precrq.ph.w   t5, s4, t4\n    ins           t4, s4, 16, 16\n    precrq.ph.w   t7, s6, t6\n    ins           t6, s6, 16, 16\n    lw            t8, 4(AT)          // FIX(1.414213562)\n    addq.ph       s4, t0, t4         // tmp10\n    subq.ph       s5, t0, t4         // tmp11\n    subq.ph       s6, t2, t6         // tmp12 ...\n    addq.ph       s7, t2, t6         // tmp13\n    mulq_s.ph     s6, s6, t8         // ... tmp12 ...\n    addq.ph       t0, s4, s7         // tmp0\n    subq.ph       t6, s4, s7         // tmp3\n    shll_s.ph     s6, s6, 1          // x2\n    subq.ph       s6, s6, s7         // ... tmp12\n    addq.ph       t2, s5, s6         // tmp1\n    subq.ph       t4, s5, s6         // tmp2\n    addq.ph       s5, t1, t7         // z11\n    subq.ph       s6, t1, t7         // z12\n    addq.ph       s7, t5, t3         // z13\n    subq.ph       v0, t5, t3         // z10\n    addq.ph       t7, s5, s7         // tmp7\n    subq.ph       s5, s5, s7         // tmp11 ...\n    addq.ph       v1, v0, s6         // z5 ...\n    mulq_s.ph     s5, s5, t8         // ... tmp11\n    lw            t8, 8(AT)          // FIX(1.847759065)\n    lw            s4, 0(AT)          // FIX(1.082392200)\n    addq.ph       s0, t0, t7         // tmp0 + tmp7\n    subq.ph       s7, t0, t7         // tmp0 - tmp7\n    mulq_s.ph     v1, v1, t8         // ... z5\n    lw            a3, 0(a1)\n    lw            t8, 12(AT)         // FIX(-2.613125930)\n    shll_s.ph     s5, s5, 1          // x2\n    addu          a3, a3, a2\n    shll_s.ph     v0, v0, 1          // x4\n    mulq_s.ph     v0, v0, t8         // tmp12 ...\n    mulq_s.ph     s4, s6, s4         // tmp10 ...\n    shll_s.ph     v1, v1, 1          // x2\n    addiu         a0, a0, 32\n    addiu         a1, a1, 8\n    shll_s.ph     s6, v0, 1          // x4\n    shll_s.ph     s4, s4, 1          // x2\n    addq.ph       s6, s6, v1         // ... tmp12\n    shll_s.ph     s0, s0, 2\n    subq.ph       t5, s6, t7         // tmp6\n    subq.ph       s4, s4, v1         // ... tmp10\n    subq.ph       t3, s5, t5         // tmp5\n    shll_s.ph     s7, s7, 2\n    addq.ph       t1, s4, t3         // tmp4\n    addq.ph       s1, t2, t5         // tmp1 + tmp6\n    subq.ph       s6, t2, t5         // tmp1 - tmp6\n    addq.ph       s2, t4, t3         // tmp2 + tmp5\n    subq.ph       s5, t4, t3         // tmp2 - tmp5\n    addq.ph       s4, t6, t1         // tmp3 + tmp4\n    subq.ph       s3, t6, t1         // tmp3 - tmp4\n    shll_s.ph     s1, s1, 2\n    shll_s.ph     s2, s2, 2\n    shll_s.ph     s3, s3, 2\n    shll_s.ph     s4, s4, 2\n    shll_s.ph     s5, s5, 2\n    shll_s.ph     s6, s6, 2\n    precrq.ph.w   t0, s1, s0         // B A\n    ins           s0, s1, 16, 16     // b a\n    precrq.ph.w   t2, s3, s2         // D C\n    ins           s2, s3, 16, 16     // d c\n    precrq.ph.w   t4, s5, s4         // F E\n    ins           s4, s5, 16, 16     // f e\n    precrq.ph.w   t6, s7, s6         // H G\n    ins           s6, s7, 16, 16     // h g\n    precrq.qb.ph  t0, t2, t0         // D C B A\n    precrq.qb.ph  s0, s2, s0         // d c b a\n    precrq.qb.ph  t4, t6, t4         // H G F E\n    precrq.qb.ph  s4, s6, s4         // h g f e\n    addu.qb       s0, s0, s8\n    addu.qb       s4, s4, s8\n    sw            s0, 0(a3)          // outptr[0/1/2/3]       d c b a\n    sw            s4, 4(a3)          // outptr[4/5/6/7]       h g f e\n    lw            a3, -4(a1)\n    addu.qb       t0, t0, s8\n    addu          a3, a3, a2\n    addu.qb       t4, t4, s8\n    sw            t0, 0(a3)          // outptr[0/1/2/3]       D C B A\n    bne           a0, t9, 0b\n     sw           t4, 4(a3)          // outptr[4/5/6/7]       H G F E\n\n2:\n\n    RESTORE_REGS_FROM_STACK 40, s0, s1, s2, s3, s4, s5, s6, s7, s8, a3\n\n    j             ra\n     nop\n\nEND(jsimd_idct_ifast_rows_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_fdct_islow_mips_dspr2)\n/*\n * a0     - data\n */\n\n    SAVE_REGS_ON_STACK 40, s0, s1, s2, s3, s4, s5, s6, s7, s8\n\n    lui       t0, 6437\n    ori       t0, 2260\n    lui       t1, 9633\n    ori       t1, 11363\n    lui       t2, 0xd39e\n    ori       t2, 0xe6dc\n    lui       t3, 0xf72d\n    ori       t3, 9633\n    lui       t4, 2261\n    ori       t4, 9633\n    lui       t5, 0xd39e\n    ori       t5, 6437\n    lui       t6, 9633\n    ori       t6, 0xd39d\n    lui       t7, 0xe6dc\n    ori       t7, 2260\n    lui       t8, 4433\n    ori       t8, 10703\n    lui       t9, 0xd630\n    ori       t9, 4433\n    li        s8, 8\n    move      a1, a0\n1:\n    lw        s0, 0(a1)     // tmp0 = 1|0\n    lw        s1, 4(a1)     // tmp1 = 3|2\n    lw        s2, 8(a1)     // tmp2 = 5|4\n    lw        s3, 12(a1)    // tmp3 = 7|6\n    packrl.ph s1, s1, s1    // tmp1 = 2|3\n    packrl.ph s3, s3, s3    // tmp3 = 6|7\n    subq.ph   s7, s1, s2    // tmp7 = 2-5|3-4 = t5|t4\n    subq.ph   s5, s0, s3    // tmp5 = 1-6|0-7 = t6|t7\n    mult      $0, $0        // ac0  = 0\n    dpa.w.ph  $ac0, s7, t0  // ac0 += t5*  6437 + t4*  2260\n    dpa.w.ph  $ac0, s5, t1  // ac0 += t6*  9633 + t7* 11363\n    mult      $ac1, $0, $0  // ac1  = 0\n    dpa.w.ph  $ac1, s7, t2  // ac1 += t5*-11362 + t4* -6436\n    dpa.w.ph  $ac1, s5, t3  // ac1 += t6* -2259 + t7*  9633\n    mult      $ac2, $0, $0  // ac2  = 0\n    dpa.w.ph  $ac2, s7, t4  // ac2 += t5*  2261 + t4*  9633\n    dpa.w.ph  $ac2, s5, t5  // ac2 += t6*-11362 + t7*  6437\n    mult      $ac3, $0, $0  // ac3  = 0\n    dpa.w.ph  $ac3, s7, t6  // ac3 += t5*  9633 + t4*-11363\n    dpa.w.ph  $ac3, s5, t7  // ac3 += t6* -6436 + t7*  2260\n    addq.ph   s6, s1, s2    // tmp6 = 2+5|3+4 = t2|t3\n    addq.ph   s4, s0, s3    // tmp4 = 1+6|0+7 = t1|t0\n    extr_r.w  s0, $ac0, 11  // tmp0 = (ac0 + 1024) >> 11\n    extr_r.w  s1, $ac1, 11  // tmp1 = (ac1 + 1024) >> 11\n    extr_r.w  s2, $ac2, 11  // tmp2 = (ac2 + 1024) >> 11\n    extr_r.w  s3, $ac3, 11  // tmp3 = (ac3 + 1024) >> 11\n    addq.ph   s5, s4, s6    // tmp5 = t1+t2|t0+t3 = t11|t10\n    subq.ph   s7, s4, s6    // tmp7 = t1-t2|t0-t3 = t12|t13\n    sh        s0, 2(a1)\n    sh        s1, 6(a1)\n    sh        s2, 10(a1)\n    sh        s3, 14(a1)\n    mult      $0, $0        // ac0  = 0\n    dpa.w.ph  $ac0, s7, t8  // ac0 += t12*  4433 + t13* 10703\n    mult      $ac1, $0, $0  // ac1  = 0\n    dpa.w.ph  $ac1, s7, t9  // ac1 += t12*-10704 + t13*  4433\n    sra       s4, s5, 16    // tmp4 = t11\n    addiu     a1, a1, 16\n    addiu     s8, s8, -1\n    extr_r.w  s0, $ac0, 11  // tmp0 = (ac0 + 1024) >> 11\n    extr_r.w  s1, $ac1, 11  // tmp1 = (ac1 + 1024) >> 11\n    addu      s2, s5, s4    // tmp2 = t10 + t11\n    subu      s3, s5, s4    // tmp3 = t10 - t11\n    sll       s2, s2, 2     // tmp2 = (t10 + t11) << 2\n    sll       s3, s3, 2     // tmp3 = (t10 - t11) << 2\n    sh        s2, -16(a1)\n    sh        s3, -8(a1)\n    sh        s0, -12(a1)\n    bgtz      s8, 1b\n     sh       s1, -4(a1)\n    li        t0, 2260\n    li        t1, 11363\n    li        t2, 9633\n    li        t3, 6436\n    li        t4, 6437\n    li        t5, 2261\n    li        t6, 11362\n    li        t7, 2259\n    li        t8, 4433\n    li        t9, 10703\n    li        a1, 10704\n    li        s8, 8\n\n2:\n    lh        a2, 0(a0)     // 0\n    lh        a3, 16(a0)    // 8\n    lh        v0, 32(a0)    // 16\n    lh        v1, 48(a0)    // 24\n    lh        s4, 64(a0)    // 32\n    lh        s5, 80(a0)    // 40\n    lh        s6, 96(a0)    // 48\n    lh        s7, 112(a0)   // 56\n    addu      s2, v0, s5    // tmp2 = 16 + 40\n    subu      s5, v0, s5    // tmp5 = 16 - 40\n    addu      s3, v1, s4    // tmp3 = 24 + 32\n    subu      s4, v1, s4    // tmp4 = 24 - 32\n    addu      s0, a2, s7    // tmp0 =  0 + 56\n    subu      s7, a2, s7    // tmp7 =  0 - 56\n    addu      s1, a3, s6    // tmp1 =  8 + 48\n    subu      s6, a3, s6    // tmp6 =  8 - 48\n    addu      a2, s0, s3    // tmp10 = tmp0 + tmp3\n    subu      v1, s0, s3    // tmp13 = tmp0 - tmp3\n    addu      a3, s1, s2    // tmp11 = tmp1 + tmp2\n    subu      v0, s1, s2    // tmp12 = tmp1 - tmp2\n    mult      s7, t1        // ac0  = tmp7 * c1\n    madd      s4, t0        // ac0 += tmp4 * c0\n    madd      s5, t4        // ac0 += tmp5 * c4\n    madd      s6, t2        // ac0 += tmp6 * c2\n    mult      $ac1, s7, t2  // ac1  = tmp7 * c2\n    msub      $ac1, s4, t3  // ac1 -= tmp4 * c3\n    msub      $ac1, s5, t6  // ac1 -= tmp5 * c6\n    msub      $ac1, s6, t7  // ac1 -= tmp6 * c7\n    mult      $ac2, s7, t4  // ac2  = tmp7 * c4\n    madd      $ac2, s4, t2  // ac2 += tmp4 * c2\n    madd      $ac2, s5, t5  // ac2 += tmp5 * c5\n    msub      $ac2, s6, t6  // ac2 -= tmp6 * c6\n    mult      $ac3, s7, t0  // ac3  = tmp7 * c0\n    msub      $ac3, s4, t1  // ac3 -= tmp4 * c1\n    madd      $ac3, s5, t2  // ac3 += tmp5 * c2\n    msub      $ac3, s6, t3  // ac3 -= tmp6 * c3\n    extr_r.w  s0, $ac0, 15  // tmp0 = (ac0 + 16384) >> 15\n    extr_r.w  s1, $ac1, 15  // tmp1 = (ac1 + 16384) >> 15\n    extr_r.w  s2, $ac2, 15  // tmp2 = (ac2 + 16384) >> 15\n    extr_r.w  s3, $ac3, 15  // tmp3 = (ac3 + 16384) >> 15\n    addiu     s8, s8, -1\n    addu      s4, a2, a3    // tmp4 = tmp10 + tmp11\n    subu      s5, a2, a3    // tmp5 = tmp10 - tmp11\n    sh        s0, 16(a0)\n    sh        s1, 48(a0)\n    sh        s2, 80(a0)\n    sh        s3, 112(a0)\n    mult      v0, t8        // ac0  = tmp12 * c8\n    madd      v1, t9        // ac0 += tmp13 * c9\n    mult      $ac1, v1, t8  // ac1  = tmp13 * c8\n    msub      $ac1, v0, a1  // ac1 -= tmp12 * c10\n    addiu     a0, a0, 2\n    extr_r.w  s6, $ac0, 15  // tmp6 = (ac0 + 16384) >> 15\n    extr_r.w  s7, $ac1, 15  // tmp7 = (ac1 + 16384) >> 15\n    shra_r.w  s4, s4, 2     // tmp4 = (tmp4 + 2) >> 2\n    shra_r.w  s5, s5, 2     // tmp5 = (tmp5 + 2) >> 2\n    sh        s4, -2(a0)\n    sh        s5, 62(a0)\n    sh        s6, 30(a0)\n    bgtz      s8, 2b\n     sh       s7, 94(a0)\n\n    RESTORE_REGS_FROM_STACK 40, s0, s1, s2, s3, s4, s5, s6, s7, s8\n\n    jr       ra\n     nop\n\nEND(jsimd_fdct_islow_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_fdct_ifast_mips_dspr2)\n/*\n * a0     - data\n */\n    .set at\n    SAVE_REGS_ON_STACK 8, s0, s1\n    li           a1, 0x014e014e  // FIX_1_306562965 (334 << 16)|(334 & 0xffff)\n    li           a2, 0x008b008b  // FIX_0_541196100 (139 << 16)|(139 & 0xffff)\n    li           a3, 0x00620062  // FIX_0_382683433 (98 << 16) |(98 & 0xffff)\n    li           s1, 0x00b500b5  // FIX_0_707106781 (181 << 16)|(181 & 0xffff)\n\n    move         v0, a0\n    addiu        v1, v0, 128     // end address\n\n0:\n    lw           t0, 0(v0)       // tmp0 = 1|0\n    lw           t1, 4(v0)       // tmp1 = 3|2\n    lw           t2, 8(v0)       // tmp2 = 5|4\n    lw           t3, 12(v0)      // tmp3 = 7|6\n    packrl.ph    t1, t1, t1      // tmp1 = 2|3\n    packrl.ph    t3, t3, t3      // tmp3 = 6|7\n    subq.ph      t7, t1, t2      // tmp7 = 2-5|3-4 = t5|t4\n    subq.ph      t5, t0, t3      // tmp5 = 1-6|0-7 = t6|t7\n    addq.ph      t6, t1, t2      // tmp6 = 2+5|3+4 = t2|t3\n    addq.ph      t4, t0, t3      // tmp4 = 1+6|0+7 = t1|t0\n    addq.ph      t8, t4, t6      // tmp5 = t1+t2|t0+t3 = t11|t10\n    subq.ph      t9, t4, t6      // tmp7 = t1-t2|t0-t3 = t12|t13\n    sra          t4, t8, 16      // tmp4 = t11\n    mult         $0, $0          // ac0  = 0\n    dpa.w.ph     $ac0, t9, s1\n    mult         $ac1, $0, $0    // ac1  = 0\n    dpa.w.ph     $ac1, t7, a3    // ac1 += t4*98 + t5*98\n    dpsx.w.ph    $ac1, t5, a3    // ac1 += t6*98 + t7*98\n    mult         $ac2, $0, $0    // ac2  = 0\n    dpa.w.ph     $ac2, t7, a2    // ac2 += t4*139 + t5*139\n    mult         $ac3, $0, $0    // ac3  = 0\n    dpa.w.ph     $ac3, t5, a1    // ac3 += t6*334 + t7*334\n    precrq.ph.w  t0, t5, t7      // t0 = t5|t6\n    addq.ph      t2, t8, t4      // tmp2 = t10 + t11\n    subq.ph      t3, t8, t4      // tmp3 = t10 - t11\n    extr.w       t4, $ac0, 8\n    mult         $0, $0          // ac0  = 0\n    dpa.w.ph     $ac0, t0, s1    // ac0 += t5*181 + t6*181\n    extr.w       t0, $ac1, 8     // t0 = z5\n    extr.w       t1, $ac2, 8     // t1 = MULTIPLY(tmp10, 139)\n    extr.w       t7, $ac3, 8     // t2 = MULTIPLY(tmp12, 334)\n    extr.w       t8, $ac0, 8     // t8 = z3 = MULTIPLY(tmp11, 181)\n    add          t6, t1, t0      // t6 = z2\n    add          t7, t7, t0      // t7 = z4\n    subq.ph      t0, t5, t8      // t0 = z13 = tmp7 - z3\n    addq.ph      t8, t5, t8      // t9 = z11 = tmp7 + z3\n    addq.ph      t1, t0, t6      // t1 = z13 + z2\n    subq.ph      t6, t0, t6      // t6 = z13 - z2\n    addq.ph      t0, t8, t7      // t0 = z11 + z4\n    subq.ph      t7, t8, t7      // t7 = z11 - z4\n    addq.ph      t5, t4, t9\n    subq.ph      t4, t9, t4\n    sh           t2, 0(v0)\n    sh           t5, 4(v0)\n    sh           t3, 8(v0)\n    sh           t4, 12(v0)\n    sh           t1, 10(v0)\n    sh           t6, 6(v0)\n    sh           t0, 2(v0)\n    sh           t7, 14(v0)\n    addiu        v0, 16\n    bne          v1, v0, 0b\n     nop\n    move         v0, a0\n    addiu        v1, v0, 16\n\n1:\n    lh           t0, 0(v0)       // 0\n    lh           t1, 16(v0)      // 8\n    lh           t2, 32(v0)      // 16\n    lh           t3, 48(v0)      // 24\n    lh           t4, 64(v0)      // 32\n    lh           t5, 80(v0)      // 40\n    lh           t6, 96(v0)      // 48\n    lh           t7, 112(v0)     // 56\n    add          t8, t0, t7      // t8 = tmp0\n    sub          t7, t0, t7      // t7 = tmp7\n    add          t0, t1, t6      // t0 = tmp1\n    sub          t1, t1, t6      // t1 = tmp6\n    add          t6, t2, t5      // t6 = tmp2\n    sub          t5, t2, t5      // t5 = tmp5\n    add          t2, t3, t4      // t2 = tmp3\n    sub          t3, t3, t4      // t3 = tmp4\n    add          t4, t8, t2      // t4 = tmp10 = tmp0 + tmp3\n    sub          t8, t8, t2      // t8 = tmp13 = tmp0 - tmp3\n    sub          s0, t0, t6      // s0 = tmp12 = tmp1 - tmp2\n    ins          t8, s0, 16, 16  // t8 = tmp12|tmp13\n    add          t2, t0, t6      // t2 = tmp11 = tmp1 + tmp2\n    mult         $0, $0          // ac0  = 0\n    dpa.w.ph     $ac0, t8, s1    // ac0 += t12*181 + t13*181\n    add          s0, t4, t2      // t8 = tmp10+tmp11\n    sub          t4, t4, t2      // t4 = tmp10-tmp11\n    sh           s0, 0(v0)\n    sh           t4, 64(v0)\n    extr.w       t2, $ac0, 8     // z1 = MULTIPLY(tmp12+tmp13,FIX_0_707106781)\n    addq.ph      t4, t8, t2      // t9 = tmp13 + z1\n    subq.ph      t8, t8, t2      // t2 = tmp13 - z1\n    sh           t4, 32(v0)\n    sh           t8, 96(v0)\n    add          t3, t3, t5      // t3 = tmp10 = tmp4 + tmp5\n    add          t0, t5, t1      // t0 = tmp11 = tmp5 + tmp6\n    add          t1, t1, t7      // t1 = tmp12 = tmp6 + tmp7\n    andi         t4, a1, 0xffff\n    mul          s0, t1, t4\n    sra          s0, s0, 8       // s0 = z4 = MULTIPLY(tmp12, FIX_1_306562965)\n    ins          t1, t3, 16, 16  // t1 = tmp10|tmp12\n    mult         $0, $0          // ac0  = 0\n    mulsa.w.ph   $ac0, t1, a3    // ac0 += t10*98 - t12*98\n    extr.w       t8, $ac0, 8     // z5 = MULTIPLY(tmp10-tmp12,FIX_0_382683433)\n    add          t2, t7, t8      // t2 = tmp7 + z5\n    sub          t7, t7, t8      // t7 = tmp7 - z5\n    andi         t4, a2, 0xffff\n    mul          t8, t3, t4\n    sra          t8, t8, 8       // t8 = z2 = MULTIPLY(tmp10, FIX_0_541196100)\n    andi         t4, s1, 0xffff\n    mul          t6, t0, t4\n    sra          t6, t6, 8       // t6 = z3 = MULTIPLY(tmp11, FIX_0_707106781)\n    add          t0, t6, t8      // t0 = z3 + z2\n    sub          t1, t6, t8      // t1 = z3 - z2\n    add          t3, t6, s0      // t3 = z3 + z4\n    sub          t4, t6, s0      // t4 = z3 - z4\n    sub          t5, t2, t1      // t5 = dataptr[5]\n    sub          t6, t7, t0      // t6 = dataptr[3]\n    add          t3, t2, t3      // t3 = dataptr[1]\n    add          t4, t7, t4      // t4 = dataptr[7]\n    sh           t5, 80(v0)\n    sh           t6, 48(v0)\n    sh           t3, 16(v0)\n    sh           t4, 112(v0)\n    addiu        v0, 2\n    bne          v0, v1, 1b\n     nop\n\n    RESTORE_REGS_FROM_STACK 8, s0, s1\n\n    j            ra\n     nop\nEND(jsimd_fdct_ifast_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_quantize_mips_dspr2)\n/*\n * a0     - coef_block\n * a1     - divisors\n * a2     - workspace\n */\n\n    .set at\n\n    SAVE_REGS_ON_STACK 16, s0, s1, s2\n\n    addiu   v0, a2, 124  // v0 = workspace_end\n    lh      t0, 0(a2)\n    lh      t1, 0(a1)\n    lh      t2, 128(a1)\n    sra     t3, t0, 15\n    sll     t3, t3, 1\n    addiu   t3, t3, 1\n    mul     t0, t0, t3\n    lh      t4, 384(a1)\n    lh      t5, 130(a1)\n    lh      t6, 2(a2)\n    lh      t7, 2(a1)\n    lh      t8, 386(a1)\n\n1:\n    andi    t1, 0xffff\n    add     t9, t0, t2\n    andi    t9, 0xffff\n    mul     v1, t9, t1\n    sra     s0, t6, 15\n    sll     s0, s0, 1\n    addiu   s0, s0, 1\n    addiu   t9, t4, 16\n    srav    v1, v1, t9\n    mul     v1, v1, t3\n    mul     t6, t6, s0\n    andi    t7, 0xffff\n    addiu   a2, a2, 4\n    addiu   a1, a1, 4\n    add     s1, t6, t5\n    andi    s1, 0xffff\n    sh      v1, 0(a0)\n\n    mul     s2, s1, t7\n    addiu   s1, t8, 16\n    srav    s2, s2, s1\n    mul     s2,s2, s0\n    lh      t0, 0(a2)\n    lh      t1, 0(a1)\n    sra     t3, t0, 15\n    sll     t3, t3, 1\n    addiu   t3, t3, 1\n    mul     t0, t0, t3\n    lh      t2, 128(a1)\n    lh      t4, 384(a1)\n    lh      t5, 130(a1)\n    lh      t8, 386(a1)\n    lh      t6, 2(a2)\n    lh      t7, 2(a1)\n    sh      s2, 2(a0)\n    lh      t0, 0(a2)\n    sra     t3, t0, 15\n    sll     t3, t3, 1\n    addiu   t3, t3, 1\n    mul     t0, t0,t3\n    bne     a2, v0, 1b\n     addiu  a0, a0, 4\n\n    andi    t1, 0xffff\n    add     t9, t0, t2\n    andi    t9, 0xffff\n    mul     v1, t9, t1\n    sra     s0, t6, 15\n    sll     s0, s0, 1\n    addiu   s0, s0, 1\n    addiu   t9, t4, 16\n    srav    v1, v1, t9\n    mul     v1, v1, t3\n    mul     t6, t6, s0\n    andi    t7, 0xffff\n    sh      v1, 0(a0)\n    add     s1, t6, t5\n    andi    s1, 0xffff\n    mul     s2, s1, t7\n    addiu   s1, t8, 16\n    addiu   a2, a2, 4\n    addiu   a1, a1, 4\n    srav    s2, s2, s1\n    mul     s2, s2, s0\n    sh      s2, 2(a0)\n\n    RESTORE_REGS_FROM_STACK 16, s0, s1, s2\n\n    j       ra\n     nop\n\nEND(jsimd_quantize_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_quantize_float_mips_dspr2)\n/*\n * a0     - coef_block\n * a1     - divisors\n * a2     - workspace\n */\n\n    .set at\n\n    li         t1, 0x46800100     //integer representation 16384.5\n    mtc1       t1, f0\n    li         t0, 63\n0:\n    lwc1       f2, 0(a2)\n    lwc1       f10, 0(a1)\n    lwc1       f4, 4(a2)\n    lwc1       f12, 4(a1)\n    lwc1       f6, 8(a2)\n    lwc1       f14, 8(a1)\n    lwc1       f8, 12(a2)\n    lwc1       f16, 12(a1)\n    madd.s     f2, f0, f2, f10\n    madd.s     f4, f0, f4, f12\n    madd.s     f6, f0, f6, f14\n    madd.s     f8, f0, f8, f16\n    lwc1       f10, 16(a1)\n    lwc1       f12, 20(a1)\n    trunc.w.s  f2, f2\n    trunc.w.s  f4, f4\n    trunc.w.s  f6, f6\n    trunc.w.s  f8, f8\n    lwc1       f14, 24(a1)\n    lwc1       f16, 28(a1)\n    mfc1       t1, f2\n    mfc1       t2, f4\n    mfc1       t3, f6\n    mfc1       t4, f8\n    lwc1       f2, 16(a2)\n    lwc1       f4, 20(a2)\n    lwc1       f6, 24(a2)\n    lwc1       f8, 28(a2)\n    madd.s     f2, f0, f2, f10\n    madd.s     f4, f0, f4, f12\n    madd.s     f6, f0, f6, f14\n    madd.s     f8, f0, f8, f16\n    addiu      t1, t1, -16384\n    addiu      t2, t2, -16384\n    addiu      t3, t3, -16384\n    addiu      t4, t4, -16384\n    trunc.w.s  f2, f2\n    trunc.w.s  f4, f4\n    trunc.w.s  f6, f6\n    trunc.w.s  f8, f8\n    sh         t1, 0(a0)\n    sh         t2, 2(a0)\n    sh         t3, 4(a0)\n    sh         t4, 6(a0)\n    mfc1       t1, f2\n    mfc1       t2, f4\n    mfc1       t3, f6\n    mfc1       t4, f8\n    addiu      t0, t0, -8\n    addiu      a2, a2, 32\n    addiu      a1, a1, 32\n    addiu      t1, t1, -16384\n    addiu      t2, t2, -16384\n    addiu      t3, t3, -16384\n    addiu      t4, t4, -16384\n    sh         t1, 8(a0)\n    sh         t2, 10(a0)\n    sh         t3, 12(a0)\n    sh         t4, 14(a0)\n    bgez       t0, 0b\n     addiu     a0, a0, 16\n\n    j          ra\n     nop\n\nEND(jsimd_quantize_float_mips_dspr2)\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_idct_2x2_mips_dspr2)\n/*\n * a0     - compptr->dct_table\n * a1     - coef_block\n * a2     - output_buf\n * a3     - output_col\n */\n    .set at\n\n    SAVE_REGS_ON_STACK 24, s0, s1, s2, s3, s4, s5\n\n    addiu     sp, sp, -40\n    move      v0, sp\n    addiu     s2, zero, 29692\n    addiu     s3, zero, -10426\n    addiu     s4, zero, 6967\n    addiu     s5, zero, -5906\n    lh        t0, 0(a1)         // t0 = inptr[DCTSIZE*0]\n    lh        t5, 0(a0)         // t5 = quantptr[DCTSIZE*0]\n    lh        t1, 48(a1)        // t1 = inptr[DCTSIZE*3]\n    lh        t6, 48(a0)        // t6 = quantptr[DCTSIZE*3]\n    mul       t4, t5, t0\n    lh        t0, 16(a1)        // t0 = inptr[DCTSIZE*1]\n    lh        t5, 16(a0)        // t5 = quantptr[DCTSIZE*1]\n    mul       t6, t6, t1\n    mul       t5, t5, t0\n    lh        t2, 80(a1)        // t2 = inptr[DCTSIZE*5]\n    lh        t7, 80(a0)        // t7 = quantptr[DCTSIZE*5]\n    lh        t3, 112(a1)       // t3 = inptr[DCTSIZE*7]\n    lh        t8, 112(a0)       // t8 = quantptr[DCTSIZE*7]\n    mul       t7, t7, t2\n    mult      zero, zero\n    mul       t8, t8, t3\n    li        s0, 0x73FCD746    // s0 = (29692 << 16) | (-10426 & 0xffff)\n    li        s1, 0x1B37E8EE    // s1 = (6967 << 16) | (-5906 & 0xffff)\n    ins       t6, t5, 16, 16    // t6 = t5|t6\n    sll       t4, t4, 15\n    dpa.w.ph  $ac0, t6, s0\n    lh        t1, 2(a1)\n    lh        t6, 2(a0)\n    ins       t8, t7, 16, 16    // t8 = t7|t8\n    dpa.w.ph  $ac0, t8, s1\n    mflo      t0, $ac0\n    mul       t5, t6, t1\n    lh        t1, 18(a1)\n    lh        t6, 18(a0)\n    lh        t2, 50(a1)\n    lh        t7, 50(a0)\n    mul       t6, t6, t1\n    subu      t8, t4, t0\n    mul       t7, t7, t2\n    addu      t0, t4, t0\n    shra_r.w  t0, t0, 13\n    lh        t1, 82(a1)\n    lh        t2, 82(a0)\n    lh        t3, 114(a1)\n    lh        t4, 114(a0)\n    shra_r.w  t8, t8, 13\n    mul       t1, t1, t2\n    mul       t3, t3, t4\n    sw        t0, 0(v0)\n    sw        t8, 20(v0)\n    sll       t4, t5, 15\n    ins       t7, t6, 16, 16\n    mult      zero, zero\n    dpa.w.ph  $ac0, t7, s0\n    ins       t3, t1, 16, 16\n    lh        t1, 6(a1)\n    lh        t6, 6(a0)\n    dpa.w.ph  $ac0, t3, s1\n    mflo      t0, $ac0\n    mul       t5, t6, t1\n    lh        t1, 22(a1)\n    lh        t6, 22(a0)\n    lh        t2, 54(a1)\n    lh        t7, 54(a0)\n    mul       t6, t6, t1\n    subu      t8, t4, t0\n    mul       t7, t7, t2\n    addu      t0, t4, t0\n    shra_r.w  t0, t0, 13\n    lh        t1, 86(a1)\n    lh        t2, 86(a0)\n    lh        t3, 118(a1)\n    lh        t4, 118(a0)\n    shra_r.w  t8, t8, 13\n    mul       t1, t1, t2\n    mul       t3, t3, t4\n    sw        t0, 4(v0)\n    sw        t8, 24(v0)\n    sll       t4, t5, 15\n    ins       t7, t6, 16, 16\n    mult      zero, zero\n    dpa.w.ph  $ac0, t7, s0\n    ins       t3, t1, 16, 16\n    lh        t1, 10(a1)\n    lh        t6, 10(a0)\n    dpa.w.ph  $ac0, t3, s1\n    mflo      t0, $ac0\n    mul       t5, t6, t1\n    lh        t1, 26(a1)\n    lh        t6, 26(a0)\n    lh        t2, 58(a1)\n    lh        t7, 58(a0)\n    mul       t6, t6, t1\n    subu      t8, t4, t0\n    mul       t7, t7, t2\n    addu      t0, t4, t0\n    shra_r.w  t0, t0, 13\n    lh        t1, 90(a1)\n    lh        t2, 90(a0)\n    lh        t3, 122(a1)\n    lh        t4, 122(a0)\n    shra_r.w  t8, t8, 13\n    mul       t1, t1, t2\n    mul       t3, t3, t4\n    sw        t0, 8(v0)\n    sw        t8, 28(v0)\n    sll       t4, t5, 15\n    ins       t7, t6, 16, 16\n    mult      zero, zero\n    dpa.w.ph  $ac0, t7, s0\n    ins       t3, t1, 16, 16\n    lh        t1, 14(a1)\n    lh        t6, 14(a0)\n    dpa.w.ph  $ac0, t3, s1\n    mflo      t0, $ac0\n    mul       t5, t6, t1\n    lh        t1, 30(a1)\n    lh        t6, 30(a0)\n    lh        t2, 62(a1)\n    lh        t7, 62(a0)\n    mul       t6, t6, t1\n    subu      t8, t4, t0\n    mul       t7, t7, t2\n    addu      t0, t4, t0\n    shra_r.w  t0, t0, 13\n    lh        t1, 94(a1)\n    lh        t2, 94(a0)\n    lh        t3, 126(a1)\n    lh        t4, 126(a0)\n    shra_r.w  t8, t8, 13\n    mul       t1, t1, t2\n    mul       t3, t3, t4\n    sw        t0, 12(v0)\n    sw        t8, 32(v0)\n    sll       t4, t5, 15\n    ins       t7, t6, 16, 16\n    mult      zero, zero\n    dpa.w.ph  $ac0, t7, s0\n    ins       t3, t1, 16, 16\n    dpa.w.ph  $ac0, t3, s1\n    mflo      t0, $ac0\n    lw        t9, 0(a2)\n    lw        t3, 0(v0)\n    lw        t7, 4(v0)\n    lw        t1, 8(v0)\n    addu      t9, t9, a3\n    sll       t3, t3, 15\n    subu      t8, t4, t0\n    addu      t0, t4, t0\n    shra_r.w  t0, t0, 13\n    shra_r.w  t8, t8, 13\n    sw        t0, 16(v0)\n    sw        t8, 36(v0)\n    lw        t5, 12(v0)\n    lw        t6, 16(v0)\n    mult      t7, s2\n    madd      t1, s3\n    madd      t5, s4\n    madd      t6, s5\n    lw        t5, 24(v0)\n    lw        t7, 28(v0)\n    mflo      t0, $ac0\n    lw        t8, 32(v0)\n    lw        t2, 36(v0)\n    mult      $ac1, t5, s2\n    madd      $ac1, t7, s3\n    madd      $ac1, t8, s4\n    madd      $ac1, t2, s5\n    addu      t1, t3, t0\n    subu      t6, t3, t0\n    shra_r.w  t1, t1, 20\n    shra_r.w  t6, t6, 20\n    mflo      t4, $ac1\n    shll_s.w  t1, t1, 24\n    shll_s.w  t6, t6, 24\n    sra       t1, t1, 24\n    sra       t6, t6, 24\n    addiu     t1, t1, 128\n    addiu     t6, t6, 128\n    lw        t0, 20(v0)\n    sb        t1, 0(t9)\n    sb        t6, 1(t9)\n    sll       t0, t0, 15\n    lw        t9, 4(a2)\n    addu      t1, t0, t4\n    subu      t6, t0, t4\n    addu      t9, t9, a3\n    shra_r.w  t1, t1, 20\n    shra_r.w  t6, t6, 20\n    shll_s.w  t1, t1, 24\n    shll_s.w  t6, t6, 24\n    sra       t1, t1, 24\n    sra       t6, t6, 24\n    addiu     t1, t1, 128\n    addiu     t6, t6, 128\n    sb        t1, 0(t9)\n    sb        t6, 1(t9)\n    addiu     sp, sp, 40\n\n    RESTORE_REGS_FROM_STACK 24, s0, s1, s2, s3, s4, s5\n\n    j         ra\n     nop\n\nEND(jsimd_idct_2x2_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_idct_4x4_mips_dspr2)\n/*\n * a0     - compptr->dct_table\n * a1     - coef_block\n * a2     - output_buf\n * a3     - output_col\n * 16(sp) - workspace[DCTSIZE*4];  // buffers data between passes\n */\n\n    .set at\n    SAVE_REGS_ON_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    lw        v1, 48(sp)\n    move      t0, a1\n    move      t1, v1\n    li        t9, 4\n    li        s0, 0x2e75f93e\n    li        s1, 0x21f9ba79\n    li        s2, 0xecc2efb0\n    li        s3, 0x52031ccd\n\n0:\n    lh        s6, 32(t0)        // inptr[DCTSIZE*2]\n    lh        t6, 32(a0)        // quantptr[DCTSIZE*2]\n    lh        s7, 96(t0)        // inptr[DCTSIZE*6]\n    lh        t7, 96(a0)        // quantptr[DCTSIZE*6]\n    mul       t6, s6, t6        // z2 = (inptr[DCTSIZE*2] * quantptr[DCTSIZE*2])\n    lh        s4, 0(t0)         // inptr[DCTSIZE*0]\n    mul       t7, s7, t7        // z3 = (inptr[DCTSIZE*6] * quantptr[DCTSIZE*6])\n    lh        s5, 0(a0)         // quantptr[0]\n    li        s6, 15137\n    li        s7, 6270\n    mul       t2, s4, s5        // tmp0 = (inptr[0] * quantptr[0])\n    mul       t6, s6, t6        // z2 = (inptr[DCTSIZE*2] * quantptr[DCTSIZE*2])\n    lh        t5, 112(t0)       // inptr[DCTSIZE*7]\n    mul       t7, s7, t7        // z3 = (inptr[DCTSIZE*6] * quantptr[DCTSIZE*6])\n    lh        s4, 112(a0)       // quantptr[DCTSIZE*7]\n    lh        v0, 80(t0)        // inptr[DCTSIZE*5]\n    lh        s5, 80(a0)        // quantptr[DCTSIZE*5]\n    lh        s6, 48(a0)        // quantptr[DCTSIZE*3]\n    sll       t2, t2, 14        // tmp0 <<= (CONST_BITS+1)\n    lh        s7, 16(a0)        // quantptr[DCTSIZE*1]\n    lh        t8, 16(t0)        // inptr[DCTSIZE*1]\n    subu      t6, t6, t7        // tmp2 = MULTIPLY(z2, t5) - MULTIPLY(z3, t6)\n    lh        t7, 48(t0)        // inptr[DCTSIZE*3]\n    mul       t5, s4, t5        // z1 = (inptr[DCTSIZE*7] * quantptr[DCTSIZE*7])\n    mul       v0, s5, v0        // z2 = (inptr[DCTSIZE*5] * quantptr[DCTSIZE*5])\n    mul       t7, s6, t7        // z3 = (inptr[DCTSIZE*3] * quantptr[DCTSIZE*3])\n    mul       t8, s7, t8        // z4 = (inptr[DCTSIZE*1] * quantptr[DCTSIZE*1])\n    addu      t3, t2, t6        // tmp10 = tmp0 + z2\n    subu      t4, t2, t6        // tmp10 = tmp0 - z2\n    mult      $ac0, zero, zero\n    mult      $ac1, zero, zero\n    ins       t5, v0, 16, 16\n    ins       t7, t8, 16, 16\n    addiu     t9, t9, -1\n    dpa.w.ph  $ac0, t5, s0\n    dpa.w.ph  $ac0, t7, s1\n    dpa.w.ph  $ac1, t5, s2\n    dpa.w.ph  $ac1, t7, s3\n    mflo      s4, $ac0\n    mflo      s5, $ac1\n    addiu     a0, a0, 2\n    addiu     t1, t1, 4\n    addiu     t0, t0, 2\n    addu      t6, t4, s4\n    subu      t5, t4, s4\n    addu      s6, t3, s5\n    subu      s7, t3, s5\n    shra_r.w  t6, t6, 12        // DESCALE(tmp12 + temp1, 12)\n    shra_r.w  t5, t5, 12        // DESCALE(tmp12 - temp1, 12)\n    shra_r.w  s6, s6, 12        // DESCALE(tmp10 + temp2, 12)\n    shra_r.w  s7, s7, 12        // DESCALE(tmp10 - temp2, 12)\n    sw        t6, 28(t1)\n    sw        t5, 60(t1)\n    sw        s6, -4(t1)\n    bgtz      t9, 0b\n     sw       s7, 92(t1)\n    // second loop three pass\n    li        t9, 3\n1:\n    lh        s6, 34(t0)        // inptr[DCTSIZE*2]\n    lh        t6, 34(a0)        // quantptr[DCTSIZE*2]\n    lh        s7, 98(t0)        // inptr[DCTSIZE*6]\n    lh        t7, 98(a0)        // quantptr[DCTSIZE*6]\n    mul       t6, s6, t6        // z2 = (inptr[DCTSIZE*2] * quantptr[DCTSIZE*2])\n    lh        s4, 2(t0)         // inptr[DCTSIZE*0]\n    mul       t7, s7, t7        // z3 = (inptr[DCTSIZE*6] * quantptr[DCTSIZE*6])\n    lh        s5, 2(a0)         // quantptr[DCTSIZE*0]\n    li        s6, 15137\n    li        s7, 6270\n    mul       t2, s4, s5        // tmp0 = (inptr[0] * quantptr[0])\n    mul       v0, s6, t6        // z2 = (inptr[DCTSIZE*2] * quantptr[DCTSIZE*2])\n    lh        t5, 114(t0)       // inptr[DCTSIZE*7]\n    mul       t7, s7, t7        // z3 = (inptr[DCTSIZE*6] * quantptr[DCTSIZE*6])\n    lh        s4, 114(a0)       // quantptr[DCTSIZE*7]\n    lh        s5, 82(a0)        // quantptr[DCTSIZE*5]\n    lh        t6, 82(t0)        // inptr[DCTSIZE*5]\n    sll       t2, t2, 14        // tmp0 <<= (CONST_BITS+1)\n    lh        s6, 50(a0)        // quantptr[DCTSIZE*3]\n    lh        t8, 18(t0)        // inptr[DCTSIZE*1]\n    subu      v0, v0, t7        // tmp2 = MULTIPLY(z2, t5) - MULTIPLY(z3, t6)\n    lh        t7, 50(t0)        // inptr[DCTSIZE*3]\n    lh        s7, 18(a0)        // quantptr[DCTSIZE*1]\n    mul       t5, s4, t5        // z1 = (inptr[DCTSIZE*7] * quantptr[DCTSIZE*7])\n    mul       t6, s5, t6        // z2 = (inptr[DCTSIZE*5] * quantptr[DCTSIZE*5])\n    mul       t7, s6, t7        // z3 = (inptr[DCTSIZE*3] * quantptr[DCTSIZE*3])\n    mul       t8, s7, t8        // z4 = (inptr[DCTSIZE*1] * quantptr[DCTSIZE*1])\n    addu      t3, t2, v0        // tmp10 = tmp0 + z2\n    subu      t4, t2, v0        // tmp10 = tmp0 - z2\n    mult      $ac0, zero, zero\n    mult      $ac1, zero, zero\n    ins       t5, t6, 16, 16\n    ins       t7, t8, 16, 16\n    dpa.w.ph  $ac0, t5, s0\n    dpa.w.ph  $ac0, t7, s1\n    dpa.w.ph  $ac1, t5, s2\n    dpa.w.ph  $ac1, t7, s3\n    mflo      t5, $ac0\n    mflo      t6, $ac1\n    addiu     t9, t9, -1\n    addiu     t0, t0, 2\n    addiu     a0, a0, 2\n    addiu     t1, t1, 4\n    addu      s5, t4, t5\n    subu      s4, t4, t5\n    addu      s6, t3, t6\n    subu      s7, t3, t6\n    shra_r.w  s5, s5, 12        // DESCALE(tmp12 + temp1, 12)\n    shra_r.w  s4, s4, 12        // DESCALE(tmp12 - temp1, 12)\n    shra_r.w  s6, s6, 12        // DESCALE(tmp10 + temp2, 12)\n    shra_r.w  s7, s7, 12        // DESCALE(tmp10 - temp2, 12)\n    sw        s5, 32(t1)\n    sw        s4, 64(t1)\n    sw        s6, 0(t1)\n    bgtz      t9, 1b\n     sw       s7, 96(t1)\n    move      t1, v1\n    li        s4, 15137\n    lw        s6, 8(t1)         // wsptr[2]\n    li        s5, 6270\n    lw        s7, 24(t1)        // wsptr[6]\n    mul       s4, s4, s6        // MULTIPLY((JLONG) wsptr[2], FIX_1_847759065)\n    lw        t2, 0(t1)         // wsptr[0]\n    mul       s5, s5, s7        // MULTIPLY((JLONG) wsptr[6], - FIX_0_765366865)\n    lh        t5, 28(t1)        // wsptr[7]\n    lh        t6, 20(t1)        // wsptr[5]\n    lh        t7, 12(t1)        // wsptr[3]\n    lh        t8, 4(t1)         // wsptr[1]\n    ins       t5, t6, 16, 16\n    ins       t7, t8, 16, 16\n    mult      $ac0, zero, zero\n    dpa.w.ph  $ac0, t5, s0\n    dpa.w.ph  $ac0, t7, s1\n    mult      $ac1, zero, zero\n    dpa.w.ph  $ac1, t5, s2\n    dpa.w.ph  $ac1, t7, s3\n    sll       t2, t2, 14        // tmp0 = ((JLONG) wsptr[0]) << (CONST_BITS+1)\n    mflo      s6, $ac0\n    // MULTIPLY(wsptr[2], FIX_1_847759065 + MULTIPLY(wsptr[6], -FIX_0_765366865)\n    subu      s4, s4, s5\n    addu      t3, t2, s4        // tmp10 = tmp0 + z2\n    mflo      s7, $ac1\n    subu      t4, t2, s4        // tmp10 = tmp0 - z2\n    addu      t7, t4, s6\n    subu      t8, t4, s6\n    addu      t5, t3, s7\n    subu      t6, t3, s7\n    shra_r.w  t5, t5, 19        // DESCALE(tmp10 + temp2, 19)\n    shra_r.w  t6, t6, 19        // DESCALE(tmp10 - temp2, 19)\n    shra_r.w  t7, t7, 19        // DESCALE(tmp12 + temp1, 19)\n    shra_r.w  t8, t8, 19        // DESCALE(tmp12 - temp1, 19)\n    sll       s4, t9, 2\n    lw        v0, 0(a2)         // output_buf[ctr]\n    shll_s.w  t5, t5, 24\n    shll_s.w  t6, t6, 24\n    shll_s.w  t7, t7, 24\n    shll_s.w  t8, t8, 24\n    sra       t5, t5, 24\n    sra       t6, t6, 24\n    sra       t7, t7, 24\n    sra       t8, t8, 24\n    addu      v0, v0, a3        // outptr = output_buf[ctr] + output_col\n    addiu     t5, t5, 128\n    addiu     t6, t6, 128\n    addiu     t7, t7, 128\n    addiu     t8, t8, 128\n    sb        t5, 0(v0)\n    sb        t7, 1(v0)\n    sb        t8, 2(v0)\n    sb        t6, 3(v0)\n    // 2\n    li        s4, 15137\n    lw        s6, 40(t1)        // wsptr[2]\n    li        s5, 6270\n    lw        s7, 56(t1)        // wsptr[6]\n    mul       s4, s4, s6        // MULTIPLY((JLONG) wsptr[2], FIX_1_847759065)\n    lw        t2, 32(t1)        // wsptr[0]\n    mul       s5, s5, s7        // MULTIPLY((JLONG) wsptr[6], - FIX_0_765366865)\n    lh        t5, 60(t1)        // wsptr[7]\n    lh        t6, 52(t1)        // wsptr[5]\n    lh        t7, 44(t1)        // wsptr[3]\n    lh        t8, 36(t1)        // wsptr[1]\n    ins       t5, t6, 16, 16\n    ins       t7, t8, 16, 16\n    mult      $ac0, zero, zero\n    dpa.w.ph  $ac0, t5, s0\n    dpa.w.ph  $ac0, t7, s1\n    mult      $ac1, zero, zero\n    dpa.w.ph  $ac1, t5, s2\n    dpa.w.ph  $ac1, t7, s3\n    sll       t2, t2, 14        // tmp0 = ((JLONG) wsptr[0]) << (CONST_BITS+1)\n    mflo      s6, $ac0\n    // MULTIPLY(wsptr[2], FIX_1_847759065 + MULTIPLY(wsptr[6], -FIX_0_765366865)\n    subu      s4, s4, s5\n    addu      t3, t2, s4        // tmp10 = tmp0 + z2\n    mflo      s7, $ac1\n    subu      t4, t2, s4        // tmp10 = tmp0 - z2\n    addu      t7, t4, s6\n    subu      t8, t4, s6\n    addu      t5, t3, s7\n    subu      t6, t3, s7\n    shra_r.w  t5, t5, 19        // DESCALE(tmp10 + temp2, CONST_BITS-PASS1_BITS+1)\n    shra_r.w  t6, t6, 19        // DESCALE(tmp10 - temp2, CONST_BITS-PASS1_BITS+1)\n    shra_r.w  t7, t7, 19        // DESCALE(tmp12 + temp1, CONST_BITS-PASS1_BITS+1)\n    shra_r.w  t8, t8, 19        // DESCALE(tmp12 - temp1, CONST_BITS-PASS1_BITS+1)\n    sll       s4, t9, 2\n    lw        v0, 4(a2)         // output_buf[ctr]\n    shll_s.w  t5, t5, 24\n    shll_s.w  t6, t6, 24\n    shll_s.w  t7, t7, 24\n    shll_s.w  t8, t8, 24\n    sra       t5, t5, 24\n    sra       t6, t6, 24\n    sra       t7, t7, 24\n    sra       t8, t8, 24\n    addu      v0, v0, a3        // outptr = output_buf[ctr] + output_col\n    addiu     t5, t5, 128\n    addiu     t6, t6, 128\n    addiu     t7, t7, 128\n    addiu     t8, t8, 128\n    sb        t5, 0(v0)\n    sb        t7, 1(v0)\n    sb        t8, 2(v0)\n    sb        t6, 3(v0)\n    // 3\n    li        s4, 15137\n    lw        s6, 72(t1)        // wsptr[2]\n    li        s5, 6270\n    lw        s7, 88(t1)        // wsptr[6]\n    mul       s4, s4, s6        // MULTIPLY((JLONG) wsptr[2], FIX_1_847759065)\n    lw        t2, 64(t1)        // wsptr[0]\n    mul       s5, s5, s7        // MULTIPLY((JLONG) wsptr[6], - FIX_0_765366865)\n    lh        t5, 92(t1)        // wsptr[7]\n    lh        t6, 84(t1)        // wsptr[5]\n    lh        t7, 76(t1)        // wsptr[3]\n    lh        t8, 68(t1)        // wsptr[1]\n    ins       t5, t6, 16, 16\n    ins       t7, t8, 16, 16\n    mult      $ac0, zero, zero\n    dpa.w.ph  $ac0, t5, s0\n    dpa.w.ph  $ac0, t7, s1\n    mult      $ac1, zero, zero\n    dpa.w.ph  $ac1, t5, s2\n    dpa.w.ph  $ac1, t7, s3\n    sll       t2, t2, 14        // tmp0 = ((JLONG) wsptr[0]) << (CONST_BITS+1)\n    mflo      s6, $ac0\n    // MULTIPLY(wsptr[2], FIX_1_847759065 + MULTIPLY(wsptr[6], -FIX_0_765366865)\n    subu      s4, s4, s5\n    addu      t3, t2, s4        // tmp10 = tmp0 + z2\n    mflo      s7, $ac1\n    subu      t4, t2, s4        // tmp10 = tmp0 - z2\n    addu      t7, t4, s6\n    subu      t8, t4, s6\n    addu      t5, t3, s7\n    subu      t6, t3, s7\n    shra_r.w  t5, t5, 19        // DESCALE(tmp10 + temp2, 19)\n    shra_r.w  t6, t6, 19        // DESCALE(tmp10 - temp2, 19)\n    shra_r.w  t7, t7, 19        // DESCALE(tmp12 + temp1, 19)\n    shra_r.w  t8, t8, 19        // DESCALE(tmp12 - temp1, 19)\n    sll       s4, t9, 2\n    lw        v0, 8(a2)         // output_buf[ctr]\n    shll_s.w  t5, t5, 24\n    shll_s.w  t6, t6, 24\n    shll_s.w  t7, t7, 24\n    shll_s.w  t8, t8, 24\n    sra       t5, t5, 24\n    sra       t6, t6, 24\n    sra       t7, t7, 24\n    sra       t8, t8, 24\n    addu      v0, v0, a3        // outptr = output_buf[ctr] + output_col\n    addiu     t5, t5, 128\n    addiu     t6, t6, 128\n    addiu     t7, t7, 128\n    addiu     t8, t8, 128\n    sb        t5, 0(v0)\n    sb        t7, 1(v0)\n    sb        t8, 2(v0)\n    sb        t6, 3(v0)\n    li        s4, 15137\n    lw        s6, 104(t1)       // wsptr[2]\n    li        s5, 6270\n    lw        s7, 120(t1)       // wsptr[6]\n    mul       s4, s4, s6        // MULTIPLY((JLONG) wsptr[2], FIX_1_847759065)\n    lw        t2, 96(t1)        // wsptr[0]\n    mul       s5, s5, s7        // MULTIPLY((JLONG) wsptr[6], -FIX_0_765366865)\n    lh        t5, 124(t1)       // wsptr[7]\n    lh        t6, 116(t1)       // wsptr[5]\n    lh        t7, 108(t1)       // wsptr[3]\n    lh        t8, 100(t1)       // wsptr[1]\n    ins       t5, t6, 16, 16\n    ins       t7, t8, 16, 16\n    mult      $ac0, zero, zero\n    dpa.w.ph  $ac0, t5, s0\n    dpa.w.ph  $ac0, t7, s1\n    mult      $ac1, zero, zero\n    dpa.w.ph  $ac1, t5, s2\n    dpa.w.ph  $ac1, t7, s3\n    sll       t2, t2, 14        // tmp0 = ((JLONG) wsptr[0]) << (CONST_BITS+1)\n    mflo      s6, $ac0\n    // MULTIPLY(wsptr[2], FIX_1_847759065 + MULTIPLY(wsptr[6], -FIX_0_765366865)\n    subu      s4, s4, s5\n    addu      t3, t2, s4        // tmp10 = tmp0 + z2;\n    mflo      s7, $ac1\n    subu      t4, t2, s4        // tmp10 = tmp0 - z2;\n    addu      t7, t4, s6\n    subu      t8, t4, s6\n    addu      t5, t3, s7\n    subu      t6, t3, s7\n    shra_r.w  t5, t5, 19        // DESCALE(tmp10 + temp2, 19)\n    shra_r.w  t6, t6, 19        // DESCALE(tmp10 - temp2, 19)\n    shra_r.w  t7, t7, 19        // DESCALE(tmp12 + temp1, 19)\n    shra_r.w  t8, t8, 19        // DESCALE(tmp12 - temp1, 19)\n    sll       s4, t9, 2\n    lw        v0, 12(a2)        // output_buf[ctr]\n    shll_s.w  t5, t5, 24\n    shll_s.w  t6, t6, 24\n    shll_s.w  t7, t7, 24\n    shll_s.w  t8, t8, 24\n    sra       t5, t5, 24\n    sra       t6, t6, 24\n    sra       t7, t7, 24\n    sra       t8, t8, 24\n    addu      v0, v0, a3        // outptr = output_buf[ctr] + output_col\n    addiu     t5, t5, 128\n    addiu     t6, t6, 128\n    addiu     t7, t7, 128\n    addiu     t8, t8, 128\n    sb        t5, 0(v0)\n    sb        t7, 1(v0)\n    sb        t8, 2(v0)\n    sb        t6, 3(v0)\n\n    RESTORE_REGS_FROM_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    j         ra\n     nop\nEND(jsimd_idct_4x4_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_idct_6x6_mips_dspr2)\n/*\n * a0     - compptr->dct_table\n * a1     - coef_block\n * a2     - output_buf\n * a3     - output_col\n */\n    .set at\n\n    SAVE_REGS_ON_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    addiu     sp, sp, -144\n    move      v0, sp\n    addiu     v1, v0, 24\n    addiu     t9, zero, 5793\n    addiu     s0, zero, 10033\n    addiu     s1, zero, 2998\n\n1:\n    lh        s2, 0(a0)   // q0 = quantptr[ 0]\n    lh        s3, 32(a0)  // q1 = quantptr[16]\n    lh        s4, 64(a0)  // q2 = quantptr[32]\n    lh        t2, 64(a1)  // tmp2 = inptr[32]\n    lh        t1, 32(a1)  // tmp1 = inptr[16]\n    lh        t0, 0(a1)   // tmp0 = inptr[ 0]\n    mul       t2, t2, s4  // tmp2 = tmp2 * q2\n    mul       t1, t1, s3  // tmp1 = tmp1 * q1\n    mul       t0, t0, s2  // tmp0 = tmp0 * q0\n    lh        t6, 16(a1)  // z1 = inptr[ 8]\n    lh        t8, 80(a1)  // z3 = inptr[40]\n    lh        t7, 48(a1)  // z2 = inptr[24]\n    lh        s2, 16(a0)  // q0 = quantptr[ 8]\n    lh        s4, 80(a0)  // q2 = quantptr[40]\n    lh        s3, 48(a0)  // q1 = quantptr[24]\n    mul       t2, t2, t9  // tmp2 = tmp2 * 5793\n    mul       t1, t1, s0  // tmp1 = tmp1 * 10033\n    sll       t0, t0, 13  // tmp0 = tmp0 << 13\n    mul       t6, t6, s2  // z1 = z1 * q0\n    mul       t8, t8, s4  // z3 = z3 * q2\n    mul       t7, t7, s3  // z2 = z2 * q1\n    addu      t3, t0, t2  // tmp10 = tmp0 + tmp2\n    sll       t2, t2, 1   // tmp2 = tmp2 << 2\n    subu      t4, t0, t2  // tmp11 = tmp0 - tmp2;\n    subu      t5, t3, t1  // tmp12 = tmp10 - tmp1\n    addu      t3, t3, t1  // tmp10 = tmp10 + tmp1\n    addu      t1, t6, t8  // tmp1 = z1 + z3\n    mul       t1, t1, s1  // tmp1 = tmp1 * 2998\n    shra_r.w  t4, t4, 11  // tmp11 = (tmp11 + 1024) >> 11\n    subu      t2, t6, t8  // tmp2 = z1 - z3\n    subu      t2, t2, t7  // tmp2 = tmp2 - z2\n    sll       t2, t2, 2   // tmp2 = tmp2 << 2\n    addu      t0, t6, t7  // tmp0 = z1 + z2\n    sll       t0, t0, 13  // tmp0 = tmp0 << 13\n    subu      s2, t8, t7  // q0 = z3 - z2\n    sll       s2, s2, 13  // q0 = q0 << 13\n    addu      t0, t0, t1  // tmp0 = tmp0 + tmp1\n    addu      t1, s2, t1  // tmp1 = q0 + tmp1\n    addu      s2, t4, t2  // q0 = tmp11 + tmp2\n    subu      s3, t4, t2  // q1 = tmp11 - tmp2\n    addu      t6, t3, t0  // z1 = tmp10 + tmp0\n    subu      t7, t3, t0  // z2 = tmp10 - tmp0\n    addu      t4, t5, t1  // tmp11 = tmp12 + tmp1\n    subu      t5, t5, t1  // tmp12 = tmp12 - tmp1\n    shra_r.w  t6, t6, 11  // z1 = (z1 + 1024) >> 11\n    shra_r.w  t7, t7, 11  // z2 = (z2 + 1024) >> 11\n    shra_r.w  t4, t4, 11  // tmp11 = (tmp11 + 1024) >> 11\n    shra_r.w  t5, t5, 11  // tmp12 = (tmp12 + 1024) >> 11\n    sw        s2, 24(v0)\n    sw        s3, 96(v0)\n    sw        t6, 0(v0)\n    sw        t7, 120(v0)\n    sw        t4, 48(v0)\n    sw        t5, 72(v0)\n    addiu     v0, v0, 4\n    addiu     a1, a1, 2\n    bne       v0, v1, 1b\n     addiu    a0, a0, 2\n\n    /* Pass 2: process 6 rows from work array, store into output array. */\n    move      v0, sp\n    addiu     v1, v0, 144\n\n2:\n    lw        t0, 0(v0)\n    lw        t2, 16(v0)\n    lw        s5, 0(a2)\n    addiu     t0, t0, 16\n    sll       t0, t0, 13\n    mul       t3, t2, t9\n    lw        t6, 4(v0)\n    lw        t8, 20(v0)\n    lw        t7, 12(v0)\n    addu      s5, s5, a3\n    addu      s6, t6, t8\n    mul       s6, s6, s1\n    addu      t1, t0, t3\n    subu      t4, t0, t3\n    subu      t4, t4, t3\n    lw        t3, 8(v0)\n    mul       t0, t3, s0\n    addu      s7, t6, t7\n    sll       s7, s7, 13\n    addu      s7, s6, s7\n    subu      t2, t8, t7\n    sll       t2, t2, 13\n    addu      t2, s6, t2\n    subu      s6, t6, t7\n    subu      s6, s6, t8\n    sll       s6, s6, 13\n    addu      t3, t1, t0\n    subu      t5, t1, t0\n    addu      t6, t3, s7\n    subu      t3, t3, s7\n    addu      t7, t4, s6\n    subu      t4, t4, s6\n    addu      t8, t5, t2\n    subu      t5, t5, t2\n    shll_s.w  t6, t6, 6\n    shll_s.w  t3, t3, 6\n    shll_s.w  t7, t7, 6\n    shll_s.w  t4, t4, 6\n    shll_s.w  t8, t8, 6\n    shll_s.w  t5, t5, 6\n    sra       t6, t6, 24\n    addiu     t6, t6, 128\n    sra       t3, t3, 24\n    addiu     t3, t3, 128\n    sb        t6, 0(s5)\n    sra       t7, t7, 24\n    addiu     t7, t7, 128\n    sb        t3, 5(s5)\n    sra       t4, t4, 24\n    addiu     t4, t4, 128\n    sb        t7, 1(s5)\n    sra       t8, t8, 24\n    addiu     t8, t8, 128\n    sb        t4, 4(s5)\n    addiu     v0, v0, 24\n    sra       t5, t5, 24\n    addiu     t5, t5, 128\n    sb        t8, 2(s5)\n    addiu     a2, a2,  4\n    bne       v0, v1, 2b\n     sb       t5, 3(s5)\n\n    addiu     sp, sp, 144\n\n    RESTORE_REGS_FROM_STACK 32, s0, s1, s2, s3, s4, s5, s6, s7\n\n    j         ra\n     nop\n\nEND(jsimd_idct_6x6_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_idct_12x12_pass1_mips_dspr2)\n/*\n * a0     - compptr->dct_table\n * a1     - coef_block\n * a2     - workspace\n */\n\n    SAVE_REGS_ON_STACK 16, s0, s1, s2, s3\n\n    li         a3, 8\n\n1:\n    // odd part\n    lh         t0, 48(a1)\n    lh         t1, 48(a0)\n    lh         t2, 16(a1)\n    lh         t3, 16(a0)\n    lh         t4, 80(a1)\n    lh         t5, 80(a0)\n    lh         t6, 112(a1)\n    lh         t7, 112(a0)\n    mul        t0, t0, t1    // z2\n    mul        t1, t2, t3    // z1\n    mul        t2, t4, t5    // z3\n    mul        t3, t6, t7    // z4\n    li         t4, 10703     // FIX(1.306562965)\n    li         t5, 4433      // FIX_0_541196100\n    li         t6, 7053      // FIX(0.860918669)\n    mul        t4, t0,t4     // tmp11\n    mul        t5, t0,t5     // -tmp14\n    addu       t7, t1,t2     // tmp10\n    addu       t8, t7,t3     // tmp10 + z4\n    mul        t6, t6, t8    // tmp15\n    li         t8, 2139      // FIX(0.261052384)\n    mul        t8, t7, t8    // MULTIPLY(tmp10, FIX(0.261052384))\n    li         t7, 2295      // FIX(0.280143716)\n    mul        t7, t1, t7    // MULTIPLY(z1, FIX(0.280143716))\n    addu       t9, t2, t3    // z3 + z4\n    li         s0, 8565      // FIX(1.045510580)\n    mul        t9, t9, s0    // -tmp13\n    li         s0, 12112     // FIX(1.478575242)\n    mul        s0, t2, s0    // MULTIPLY(z3, FIX(1.478575242)\n    li         s1, 12998     // FIX(1.586706681)\n    mul        s1, t3, s1    // MULTIPLY(z4, FIX(1.586706681))\n    li         s2, 5540      // FIX(0.676326758)\n    mul        s2, t1, s2    // MULTIPLY(z1, FIX(0.676326758))\n    li         s3, 16244     // FIX(1.982889723)\n    mul        s3, t3, s3    // MULTIPLY(z4, FIX(1.982889723))\n    subu       t1, t1, t3    // z1-=z4\n    subu       t0, t0, t2    // z2-=z3\n    addu       t2, t0, t1    // z1+z2\n    li         t3, 4433      // FIX_0_541196100\n    mul        t2, t2, t3    // z3\n    li         t3, 6270      // FIX_0_765366865\n    mul        t1, t1, t3    // MULTIPLY(z1, FIX_0_765366865)\n    li         t3, 15137     // FIX_0_765366865\n    mul        t0, t0, t3    // MULTIPLY(z2, FIX_1_847759065)\n    addu       t8, t6, t8    // tmp12\n    addu       t3, t8, t4    // tmp12 + tmp11\n    addu       t3, t3, t7    // tmp10\n    subu       t8, t8, t9    // tmp12 + tmp13\n    addu       s0, t5, s0\n    subu       t8, t8, s0    // tmp12\n    subu       t9, t6, t9\n    subu       s1, s1, t4\n    addu       t9, t9, s1    // tmp13\n    subu       t6, t6, t5\n    subu       t6, t6, s2\n    subu       t6, t6, s3    // tmp15\n    // even part start\n    lh         t4, 64(a1)\n    lh         t5, 64(a0)\n    lh         t7, 32(a1)\n    lh         s0, 32(a0)\n    lh         s1, 0(a1)\n    lh         s2, 0(a0)\n    lh         s3, 96(a1)\n    lh         v0, 96(a0)\n    mul        t4, t4, t5    // DEQUANTIZE(inptr[DCTSIZE*4],quantptr[DCTSIZE*4])\n    mul        t5, t7, s0    // DEQUANTIZE(inptr[DCTSIZE*2],quantptr[DCTSIZE*2])\n    mul        t7, s1, s2    // DEQUANTIZE(inptr[DCTSIZE*0],quantptr[DCTSIZE*0])\n    mul        s0, s3, v0    // DEQUANTIZE(inptr[DCTSIZE*6],quantptr[DCTSIZE*6])\n    // odd part end\n    addu       t1, t2, t1    // tmp11\n    subu       t0, t2, t0    // tmp14\n    // update counter and pointers\n    addiu      a3, a3, -1\n    addiu      a0, a0, 2\n    addiu      a1, a1, 2\n    // even part rest\n    li         s1, 10033\n    li         s2, 11190\n    mul        t4, t4, s1    // z4\n    mul        s1, t5, s2    // z4\n    sll        t5, t5, 13    // z1\n    sll        t7, t7, 13\n    addiu      t7, t7, 1024  // z3\n    sll        s0, s0, 13    // z2\n    addu       s2, t7, t4    // tmp10\n    subu       t4, t7, t4    // tmp11\n    subu       s3, t5, s0    // tmp12\n    addu       t2, t7, s3    // tmp21\n    subu       s3, t7, s3    // tmp24\n    addu       t7, s1, s0    // tmp12\n    addu       v0, s2, t7    // tmp20\n    subu       s2, s2, t7    // tmp25\n    subu       s1, s1, t5    // z4 - z1\n    subu       s1, s1, s0    // tmp12\n    addu       s0, t4, s1    // tmp22\n    subu       t4, t4, s1    // tmp23\n    // final output stage\n    addu       t5, v0, t3\n    subu       v0, v0, t3\n    addu       t3, t2, t1\n    subu       t2, t2, t1\n    addu       t1, s0, t8\n    subu       s0, s0, t8\n    addu       t8, t4, t9\n    subu       t4, t4, t9\n    addu       t9, s3, t0\n    subu       s3, s3, t0\n    addu       t0, s2, t6\n    subu       s2, s2, t6\n    sra        t5, t5, 11\n    sra        t3, t3, 11\n    sra        t1, t1, 11\n    sra        t8, t8, 11\n    sra        t9, t9, 11\n    sra        t0, t0, 11\n    sra        s2, s2, 11\n    sra        s3, s3, 11\n    sra        t4, t4, 11\n    sra        s0, s0, 11\n    sra        t2, t2, 11\n    sra        v0, v0, 11\n    sw         t5, 0(a2)\n    sw         t3, 32(a2)\n    sw         t1, 64(a2)\n    sw         t8, 96(a2)\n    sw         t9, 128(a2)\n    sw         t0, 160(a2)\n    sw         s2, 192(a2)\n    sw         s3, 224(a2)\n    sw         t4, 256(a2)\n    sw         s0, 288(a2)\n    sw         t2, 320(a2)\n    sw         v0, 352(a2)\n    bgtz       a3, 1b\n     addiu     a2, a2, 4\n\n    RESTORE_REGS_FROM_STACK 16, s0, s1, s2, s3\n\n    j          ra\n     nop\n\nEND(jsimd_idct_12x12_pass1_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_idct_12x12_pass2_mips_dspr2)\n/*\n * a0     - workspace\n * a1     - output\n */\n\n    SAVE_REGS_ON_STACK 16, s0, s1, s2, s3\n\n    li        a3, 12\n\n1:\n    // Odd part\n    lw        t0, 12(a0)\n    lw        t1, 4(a0)\n    lw        t2, 20(a0)\n    lw        t3, 28(a0)\n    li        t4, 10703     // FIX(1.306562965)\n    li        t5, 4433      // FIX_0_541196100\n    mul       t4, t0, t4    // tmp11\n    mul       t5, t0, t5    // -tmp14\n    addu      t6, t1, t2    // tmp10\n    li        t7, 2139      // FIX(0.261052384)\n    mul       t7, t6, t7    // MULTIPLY(tmp10, FIX(0.261052384))\n    addu      t6, t6, t3    // tmp10 + z4\n    li        t8, 7053      // FIX(0.860918669)\n    mul       t6, t6, t8    // tmp15\n    li        t8, 2295      // FIX(0.280143716)\n    mul       t8, t1, t8    // MULTIPLY(z1, FIX(0.280143716))\n    addu      t9, t2, t3    // z3 + z4\n    li        s0, 8565      // FIX(1.045510580)\n    mul       t9, t9, s0    // -tmp13\n    li        s0, 12112     // FIX(1.478575242)\n    mul       s0, t2, s0    // MULTIPLY(z3, FIX(1.478575242))\n    li        s1, 12998     // FIX(1.586706681)\n    mul       s1, t3, s1    // MULTIPLY(z4, FIX(1.586706681))\n    li        s2, 5540      // FIX(0.676326758)\n    mul       s2, t1, s2    // MULTIPLY(z1, FIX(0.676326758))\n    li        s3, 16244     // FIX(1.982889723)\n    mul       s3, t3, s3    // MULTIPLY(z4, FIX(1.982889723))\n    subu      t1, t1, t3    // z1 -= z4\n    subu      t0, t0, t2    // z2 -= z3\n    addu      t2, t1, t0    // z1 + z2\n    li        t3, 4433      // FIX_0_541196100\n    mul       t2, t2, t3    // z3\n    li        t3, 6270      // FIX_0_765366865\n    mul       t1, t1, t3    // MULTIPLY(z1, FIX_0_765366865)\n    li        t3, 15137     // FIX_1_847759065\n    mul       t0, t0, t3    // MULTIPLY(z2, FIX_1_847759065)\n    addu      t3, t6, t7    // tmp12\n    addu      t7, t3, t4\n    addu      t7, t7, t8    // tmp10\n    subu      t3, t3, t9\n    subu      t3, t3, t5\n    subu      t3, t3, s0    // tmp12\n    subu      t9, t6, t9\n    subu      t9, t9, t4\n    addu      t9, t9, s1    // tmp13\n    subu      t6, t6, t5\n    subu      t6, t6, s2\n    subu      t6, t6, s3    // tmp15\n    addu      t1, t2, t1    // tmp11\n    subu      t0, t2, t0    // tmp14\n    // even part\n    lw        t2, 16(a0)    // z4\n    lw        t4, 8(a0)     // z1\n    lw        t5, 0(a0)     // z3\n    lw        t8, 24(a0)    // z2\n    li        s0, 10033     // FIX(1.224744871)\n    li        s1, 11190     // FIX(1.366025404)\n    mul       t2, t2, s0    // z4\n    mul       s0, t4, s1    // z4\n    addiu     t5, t5, 0x10\n    sll       t5, t5, 13    // z3\n    sll       t4, t4, 13    // z1\n    sll       t8, t8, 13    // z2\n    subu      s1, t4, t8    // tmp12\n    addu      s2, t5, t2    // tmp10\n    subu      t2, t5, t2    // tmp11\n    addu      s3, t5, s1    // tmp21\n    subu      s1, t5, s1    // tmp24\n    addu      t5, s0, t8    // tmp12\n    addu      v0, s2, t5    // tmp20\n    subu      t5, s2, t5    // tmp25\n    subu      t4, s0, t4\n    subu      t4, t4, t8    // tmp12\n    addu      t8, t2, t4    // tmp22\n    subu      t2, t2, t4    // tmp23\n    // increment counter and pointers\n    addiu     a3, a3, -1\n    addiu     a0, a0, 32\n    // Final stage\n    addu      t4, v0, t7\n    subu      v0, v0, t7\n    addu      t7, s3, t1\n    subu      s3, s3, t1\n    addu      t1, t8, t3\n    subu      t8, t8, t3\n    addu      t3, t2, t9\n    subu      t2, t2, t9\n    addu      t9, s1, t0\n    subu      s1, s1, t0\n    addu      t0, t5, t6\n    subu      t5, t5, t6\n    sll       t4, t4, 4\n    sll       t7, t7, 4\n    sll       t1, t1, 4\n    sll       t3, t3, 4\n    sll       t9, t9, 4\n    sll       t0, t0, 4\n    sll       t5, t5, 4\n    sll       s1, s1, 4\n    sll       t2, t2, 4\n    sll       t8, t8, 4\n    sll       s3, s3, 4\n    sll       v0, v0, 4\n    shll_s.w  t4, t4, 2\n    shll_s.w  t7, t7, 2\n    shll_s.w  t1, t1, 2\n    shll_s.w  t3, t3, 2\n    shll_s.w  t9, t9, 2\n    shll_s.w  t0, t0, 2\n    shll_s.w  t5, t5, 2\n    shll_s.w  s1, s1, 2\n    shll_s.w  t2, t2, 2\n    shll_s.w  t8, t8, 2\n    shll_s.w  s3, s3, 2\n    shll_s.w  v0, v0, 2\n    srl       t4, t4, 24\n    srl       t7, t7, 24\n    srl       t1, t1, 24\n    srl       t3, t3, 24\n    srl       t9, t9, 24\n    srl       t0, t0, 24\n    srl       t5, t5, 24\n    srl       s1, s1, 24\n    srl       t2, t2, 24\n    srl       t8, t8, 24\n    srl       s3, s3, 24\n    srl       v0, v0, 24\n    lw        t6, 0(a1)\n    addiu     t4, t4, 0x80\n    addiu     t7, t7, 0x80\n    addiu     t1, t1, 0x80\n    addiu     t3, t3, 0x80\n    addiu     t9, t9, 0x80\n    addiu     t0, t0, 0x80\n    addiu     t5, t5, 0x80\n    addiu     s1, s1, 0x80\n    addiu     t2, t2, 0x80\n    addiu     t8, t8, 0x80\n    addiu     s3, s3, 0x80\n    addiu     v0, v0, 0x80\n    sb        t4, 0(t6)\n    sb        t7, 1(t6)\n    sb        t1, 2(t6)\n    sb        t3, 3(t6)\n    sb        t9, 4(t6)\n    sb        t0, 5(t6)\n    sb        t5, 6(t6)\n    sb        s1, 7(t6)\n    sb        t2, 8(t6)\n    sb        t8, 9(t6)\n    sb        s3, 10(t6)\n    sb        v0, 11(t6)\n    bgtz      a3, 1b\n     addiu    a1, a1, 4\n\n    RESTORE_REGS_FROM_STACK 16, s0, s1, s2, s3\n\n    jr        ra\n     nop\n\nEND(jsimd_idct_12x12_pass2_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_convsamp_mips_dspr2)\n/*\n * a0     - sample_data\n * a1     - start_col\n * a2     - workspace\n */\n\n    lw             t0, 0(a0)\n    li             t7, 0xff80ff80\n    addu           t0, t0, a1\n    ulw            t1, 0(t0)\n    ulw            t2, 4(t0)\n    preceu.ph.qbr  t3, t1\n    preceu.ph.qbl  t4, t1\n    lw             t0, 4(a0)\n    preceu.ph.qbr  t5, t2\n    preceu.ph.qbl  t6, t2\n    addu           t0, t0, a1\n    addu.ph        t3, t3, t7\n    addu.ph        t4, t4, t7\n    ulw            t1, 0(t0)\n    ulw            t2, 4(t0)\n    addu.ph        t5, t5, t7\n    addu.ph        t6, t6, t7\n    usw            t3, 0(a2)\n    usw            t4, 4(a2)\n    preceu.ph.qbr  t3, t1\n    preceu.ph.qbl  t4, t1\n    usw            t5, 8(a2)\n    usw            t6, 12(a2)\n\n    lw             t0, 8(a0)\n    preceu.ph.qbr  t5, t2\n    preceu.ph.qbl  t6, t2\n    addu           t0, t0, a1\n    addu.ph        t3, t3, t7\n    addu.ph        t4, t4, t7\n    ulw            t1, 0(t0)\n    ulw            t2, 4(t0)\n    addu.ph        t5, t5, t7\n    addu.ph        t6, t6, t7\n    usw            t3, 16(a2)\n    usw            t4, 20(a2)\n    preceu.ph.qbr  t3, t1\n    preceu.ph.qbl  t4, t1\n    usw            t5, 24(a2)\n    usw            t6, 28(a2)\n\n    lw             t0, 12(a0)\n    preceu.ph.qbr  t5, t2\n    preceu.ph.qbl  t6, t2\n    addu           t0, t0, a1\n    addu.ph        t3, t3, t7\n    addu.ph        t4, t4, t7\n    ulw            t1, 0(t0)\n    ulw            t2, 4(t0)\n    addu.ph        t5, t5, t7\n    addu.ph        t6, t6, t7\n    usw            t3, 32(a2)\n    usw            t4, 36(a2)\n    preceu.ph.qbr  t3, t1\n    preceu.ph.qbl  t4, t1\n    usw            t5, 40(a2)\n    usw            t6, 44(a2)\n\n    lw             t0, 16(a0)\n    preceu.ph.qbr  t5, t2\n    preceu.ph.qbl  t6, t2\n    addu           t0, t0, a1\n    addu.ph        t3, t3, t7\n    addu.ph        t4, t4, t7\n    ulw            t1, 0(t0)\n    ulw            t2, 4(t0)\n    addu.ph        t5, t5, t7\n    addu.ph        t6, t6, t7\n    usw            t3, 48(a2)\n    usw            t4, 52(a2)\n    preceu.ph.qbr  t3, t1\n    preceu.ph.qbl  t4, t1\n    usw            t5, 56(a2)\n    usw            t6, 60(a2)\n\n    lw             t0, 20(a0)\n    preceu.ph.qbr  t5, t2\n    preceu.ph.qbl  t6, t2\n    addu           t0, t0, a1\n    addu.ph        t3, t3, t7\n    addu.ph        t4, t4, t7\n    ulw            t1, 0(t0)\n    ulw            t2, 4(t0)\n    addu.ph        t5, t5, t7\n    addu.ph        t6, t6, t7\n    usw            t3, 64(a2)\n    usw            t4, 68(a2)\n    preceu.ph.qbr  t3, t1\n    preceu.ph.qbl  t4, t1\n    usw            t5, 72(a2)\n    usw            t6, 76(a2)\n\n    lw             t0, 24(a0)\n    preceu.ph.qbr  t5, t2\n    preceu.ph.qbl  t6, t2\n    addu           t0, t0, a1\n    addu.ph        t3, t3, t7\n    addu.ph        t4, t4, t7\n    ulw            t1, 0(t0)\n    ulw            t2, 4(t0)\n    addu.ph        t5, t5, t7\n    addu.ph        t6, t6, t7\n    usw            t3, 80(a2)\n    usw            t4, 84(a2)\n    preceu.ph.qbr  t3, t1\n    preceu.ph.qbl  t4, t1\n    usw            t5, 88(a2)\n    usw            t6, 92(a2)\n\n    lw             t0, 28(a0)\n    preceu.ph.qbr  t5, t2\n    preceu.ph.qbl  t6, t2\n    addu           t0, t0, a1\n    addu.ph        t3, t3, t7\n    addu.ph        t4, t4, t7\n    ulw            t1, 0(t0)\n    ulw            t2, 4(t0)\n    addu.ph        t5, t5, t7\n    addu.ph        t6, t6, t7\n    usw            t3, 96(a2)\n    usw            t4, 100(a2)\n    preceu.ph.qbr  t3, t1\n    preceu.ph.qbl  t4, t1\n    usw            t5, 104(a2)\n    usw            t6, 108(a2)\n    preceu.ph.qbr  t5, t2\n    preceu.ph.qbl  t6, t2\n    addu.ph        t3, t3, t7\n    addu.ph        t4, t4, t7\n    addu.ph        t5, t5, t7\n    addu.ph        t6, t6, t7\n    usw            t3, 112(a2)\n    usw            t4, 116(a2)\n    usw            t5, 120(a2)\n    usw            t6, 124(a2)\n\n    j              ra\n     nop\n\nEND(jsimd_convsamp_mips_dspr2)\n\n/*****************************************************************************/\nLEAF_MIPS_DSPR2(jsimd_convsamp_float_mips_dspr2)\n/*\n * a0     - sample_data\n * a1     - start_col\n * a2     - workspace\n */\n\n    .set at\n\n    lw       t0, 0(a0)\n    addu     t0, t0, a1\n    lbu      t1, 0(t0)\n    lbu      t2, 1(t0)\n    lbu      t3, 2(t0)\n    lbu      t4, 3(t0)\n    lbu      t5, 4(t0)\n    lbu      t6, 5(t0)\n    lbu      t7, 6(t0)\n    lbu      t8, 7(t0)\n    addiu    t1, t1, -128\n    addiu    t2, t2, -128\n    addiu    t3, t3, -128\n    addiu    t4, t4, -128\n    addiu    t5, t5, -128\n    addiu    t6, t6, -128\n    addiu    t7, t7, -128\n    addiu    t8, t8, -128\n    mtc1     t1, f2\n    mtc1     t2, f4\n    mtc1     t3, f6\n    mtc1     t4, f8\n    mtc1     t5, f10\n    mtc1     t6, f12\n    mtc1     t7, f14\n    mtc1     t8, f16\n    cvt.s.w  f2, f2\n    cvt.s.w  f4, f4\n    cvt.s.w  f6, f6\n    cvt.s.w  f8, f8\n    cvt.s.w  f10, f10\n    cvt.s.w  f12, f12\n    cvt.s.w  f14, f14\n    cvt.s.w  f16, f16\n    lw       t0, 4(a0)\n    swc1     f2, 0(a2)\n    swc1     f4, 4(a2)\n    swc1     f6, 8(a2)\n    addu     t0, t0, a1\n    swc1     f8, 12(a2)\n    swc1     f10, 16(a2)\n    swc1     f12, 20(a2)\n    swc1     f14, 24(a2)\n    swc1     f16, 28(a2)\n    //elemr 1\n    lbu      t1, 0(t0)\n    lbu      t2, 1(t0)\n    lbu      t3, 2(t0)\n    lbu      t4, 3(t0)\n    lbu      t5, 4(t0)\n    lbu      t6, 5(t0)\n    lbu      t7, 6(t0)\n    lbu      t8, 7(t0)\n    addiu    t1, t1, -128\n    addiu    t2, t2, -128\n    addiu    t3, t3, -128\n    addiu    t4, t4, -128\n    addiu    t5, t5, -128\n    addiu    t6, t6, -128\n    addiu    t7, t7, -128\n    addiu    t8, t8, -128\n    mtc1     t1, f2\n    mtc1     t2, f4\n    mtc1     t3, f6\n    mtc1     t4, f8\n    mtc1     t5, f10\n    mtc1     t6, f12\n    mtc1     t7, f14\n    mtc1     t8, f16\n    cvt.s.w  f2, f2\n    cvt.s.w  f4, f4\n    cvt.s.w  f6, f6\n    cvt.s.w  f8, f8\n    cvt.s.w  f10, f10\n    cvt.s.w  f12, f12\n    cvt.s.w  f14, f14\n    cvt.s.w  f16, f16\n    lw       t0, 8(a0)\n    swc1     f2, 32(a2)\n    swc1     f4, 36(a2)\n    swc1     f6, 40(a2)\n    addu     t0, t0, a1\n    swc1     f8, 44(a2)\n    swc1     f10, 48(a2)\n    swc1     f12, 52(a2)\n    swc1     f14, 56(a2)\n    swc1     f16, 60(a2)\n    //elemr 2\n    lbu      t1, 0(t0)\n    lbu      t2, 1(t0)\n    lbu      t3, 2(t0)\n    lbu      t4, 3(t0)\n    lbu      t5, 4(t0)\n    lbu      t6, 5(t0)\n    lbu      t7, 6(t0)\n    lbu      t8, 7(t0)\n    addiu    t1, t1, -128\n    addiu    t2, t2, -128\n    addiu    t3, t3, -128\n    addiu    t4, t4, -128\n    addiu    t5, t5, -128\n    addiu    t6, t6, -128\n    addiu    t7, t7, -128\n    addiu    t8, t8, -128\n    mtc1     t1, f2\n    mtc1     t2, f4\n    mtc1     t3, f6\n    mtc1     t4, f8\n    mtc1     t5, f10\n    mtc1     t6, f12\n    mtc1     t7, f14\n    mtc1     t8, f16\n    cvt.s.w  f2, f2\n    cvt.s.w  f4, f4\n    cvt.s.w  f6, f6\n    cvt.s.w  f8, f8\n    cvt.s.w  f10, f10\n    cvt.s.w  f12, f12\n    cvt.s.w  f14, f14\n    cvt.s.w  f16, f16\n    lw       t0, 12(a0)\n    swc1     f2, 64(a2)\n    swc1     f4, 68(a2)\n    swc1     f6, 72(a2)\n    addu     t0, t0, a1\n    swc1     f8, 76(a2)\n    swc1     f10, 80(a2)\n    swc1     f12, 84(a2)\n    swc1     f14, 88(a2)\n    swc1     f16, 92(a2)\n    //elemr 3\n    lbu      t1, 0(t0)\n    lbu      t2, 1(t0)\n    lbu      t3, 2(t0)\n    lbu      t4, 3(t0)\n    lbu      t5, 4(t0)\n    lbu      t6, 5(t0)\n    lbu      t7, 6(t0)\n    lbu      t8, 7(t0)\n    addiu    t1, t1, -128\n    addiu    t2, t2, -128\n    addiu    t3, t3, -128\n    addiu    t4, t4, -128\n    addiu    t5, t5, -128\n    addiu    t6, t6, -128\n    addiu    t7, t7, -128\n    addiu    t8, t8, -128\n    mtc1     t1, f2\n    mtc1     t2, f4\n    mtc1     t3, f6\n    mtc1     t4, f8\n    mtc1     t5, f10\n    mtc1     t6, f12\n    mtc1     t7, f14\n    mtc1     t8, f16\n    cvt.s.w  f2, f2\n    cvt.s.w  f4, f4\n    cvt.s.w  f6, f6\n    cvt.s.w  f8, f8\n    cvt.s.w  f10, f10\n    cvt.s.w  f12, f12\n    cvt.s.w  f14, f14\n    cvt.s.w  f16, f16\n    lw       t0, 16(a0)\n    swc1     f2, 96(a2)\n    swc1     f4, 100(a2)\n    swc1     f6, 104(a2)\n    addu     t0, t0, a1\n    swc1     f8, 108(a2)\n    swc1     f10, 112(a2)\n    swc1     f12, 116(a2)\n    swc1     f14, 120(a2)\n    swc1     f16, 124(a2)\n    //elemr 4\n    lbu      t1, 0(t0)\n    lbu      t2, 1(t0)\n    lbu      t3, 2(t0)\n    lbu      t4, 3(t0)\n    lbu      t5, 4(t0)\n    lbu      t6, 5(t0)\n    lbu      t7, 6(t0)\n    lbu      t8, 7(t0)\n    addiu    t1, t1, -128\n    addiu    t2, t2, -128\n    addiu    t3, t3, -128\n    addiu    t4, t4, -128\n    addiu    t5, t5, -128\n    addiu    t6, t6, -128\n    addiu    t7, t7, -128\n    addiu    t8, t8, -128\n    mtc1     t1, f2\n    mtc1     t2, f4\n    mtc1     t3, f6\n    mtc1     t4, f8\n    mtc1     t5, f10\n    mtc1     t6, f12\n    mtc1     t7, f14\n    mtc1     t8, f16\n    cvt.s.w  f2, f2\n    cvt.s.w  f4, f4\n    cvt.s.w  f6, f6\n    cvt.s.w  f8, f8\n    cvt.s.w  f10, f10\n    cvt.s.w  f12, f12\n    cvt.s.w  f14, f14\n    cvt.s.w  f16, f16\n    lw       t0, 20(a0)\n    swc1     f2, 128(a2)\n    swc1     f4, 132(a2)\n    swc1     f6, 136(a2)\n    addu     t0, t0, a1\n    swc1     f8, 140(a2)\n    swc1     f10, 144(a2)\n    swc1     f12, 148(a2)\n    swc1     f14, 152(a2)\n    swc1     f16, 156(a2)\n    //elemr 5\n    lbu      t1, 0(t0)\n    lbu      t2, 1(t0)\n    lbu      t3, 2(t0)\n    lbu      t4, 3(t0)\n    lbu      t5, 4(t0)\n    lbu      t6, 5(t0)\n    lbu      t7, 6(t0)\n    lbu      t8, 7(t0)\n    addiu    t1, t1, -128\n    addiu    t2, t2, -128\n    addiu    t3, t3, -128\n    addiu    t4, t4, -128\n    addiu    t5, t5, -128\n    addiu    t6, t6, -128\n    addiu    t7, t7, -128\n    addiu    t8, t8, -128\n    mtc1     t1, f2\n    mtc1     t2, f4\n    mtc1     t3, f6\n    mtc1     t4, f8\n    mtc1     t5, f10\n    mtc1     t6, f12\n    mtc1     t7, f14\n    mtc1     t8, f16\n    cvt.s.w  f2, f2\n    cvt.s.w  f4, f4\n    cvt.s.w  f6, f6\n    cvt.s.w  f8, f8\n    cvt.s.w  f10, f10\n    cvt.s.w  f12, f12\n    cvt.s.w  f14, f14\n    cvt.s.w  f16, f16\n    lw       t0, 24(a0)\n    swc1     f2, 160(a2)\n    swc1     f4, 164(a2)\n    swc1     f6, 168(a2)\n    addu     t0, t0, a1\n    swc1     f8, 172(a2)\n    swc1     f10, 176(a2)\n    swc1     f12, 180(a2)\n    swc1     f14, 184(a2)\n    swc1     f16, 188(a2)\n    //elemr 6\n    lbu      t1, 0(t0)\n    lbu      t2, 1(t0)\n    lbu      t3, 2(t0)\n    lbu      t4, 3(t0)\n    lbu      t5, 4(t0)\n    lbu      t6, 5(t0)\n    lbu      t7, 6(t0)\n    lbu      t8, 7(t0)\n    addiu    t1, t1, -128\n    addiu    t2, t2, -128\n    addiu    t3, t3, -128\n    addiu    t4, t4, -128\n    addiu    t5, t5, -128\n    addiu    t6, t6, -128\n    addiu    t7, t7, -128\n    addiu    t8, t8, -128\n    mtc1     t1, f2\n    mtc1     t2, f4\n    mtc1     t3, f6\n    mtc1     t4, f8\n    mtc1     t5, f10\n    mtc1     t6, f12\n    mtc1     t7, f14\n    mtc1     t8, f16\n    cvt.s.w  f2, f2\n    cvt.s.w  f4, f4\n    cvt.s.w  f6, f6\n    cvt.s.w  f8, f8\n    cvt.s.w  f10, f10\n    cvt.s.w  f12, f12\n    cvt.s.w  f14, f14\n    cvt.s.w  f16, f16\n    lw       t0, 28(a0)\n    swc1     f2, 192(a2)\n    swc1     f4, 196(a2)\n    swc1     f6, 200(a2)\n    addu     t0, t0, a1\n    swc1     f8, 204(a2)\n    swc1     f10, 208(a2)\n    swc1     f12, 212(a2)\n    swc1     f14, 216(a2)\n    swc1     f16, 220(a2)\n    //elemr 7\n    lbu      t1, 0(t0)\n    lbu      t2, 1(t0)\n    lbu      t3, 2(t0)\n    lbu      t4, 3(t0)\n    lbu      t5, 4(t0)\n    lbu      t6, 5(t0)\n    lbu      t7, 6(t0)\n    lbu      t8, 7(t0)\n    addiu    t1, t1, -128\n    addiu    t2, t2, -128\n    addiu    t3, t3, -128\n    addiu    t4, t4, -128\n    addiu    t5, t5, -128\n    addiu    t6, t6, -128\n    addiu    t7, t7, -128\n    addiu    t8, t8, -128\n    mtc1     t1, f2\n    mtc1     t2, f4\n    mtc1     t3, f6\n    mtc1     t4, f8\n    mtc1     t5, f10\n    mtc1     t6, f12\n    mtc1     t7, f14\n    mtc1     t8, f16\n    cvt.s.w  f2, f2\n    cvt.s.w  f4, f4\n    cvt.s.w  f6, f6\n    cvt.s.w  f8, f8\n    cvt.s.w  f10, f10\n    cvt.s.w  f12, f12\n    cvt.s.w  f14, f14\n    cvt.s.w  f16, f16\n    swc1     f2, 224(a2)\n    swc1     f4, 228(a2)\n    swc1     f6, 232(a2)\n    swc1     f8, 236(a2)\n    swc1     f10, 240(a2)\n    swc1     f12, 244(a2)\n    swc1     f14, 248(a2)\n    swc1     f16, 252(a2)\n\n    j        ra\n     nop\n\nEND(jsimd_convsamp_float_mips_dspr2)\n\n/*****************************************************************************/\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jsimd_mips_dspr2_asm.h",
    "content": "/*\n * MIPS DSPr2 optimizations for libjpeg-turbo\n *\n * Copyright (C) 2013, MIPS Technologies, Inc., California.\n * All Rights Reserved.\n * Authors:  Teodora Novkovic (teodora.novkovic@imgtec.com)\n *           Darko Laus       (darko.laus@imgtec.com)\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n#define zero $0\n#define AT   $1\n#define v0   $2\n#define v1   $3\n#define a0   $4\n#define a1   $5\n#define a2   $6\n#define a3   $7\n#define t0   $8\n#define t1   $9\n#define t2   $10\n#define t3   $11\n#define t4   $12\n#define t5   $13\n#define t6   $14\n#define t7   $15\n#define s0   $16\n#define s1   $17\n#define s2   $18\n#define s3   $19\n#define s4   $20\n#define s5   $21\n#define s6   $22\n#define s7   $23\n#define t8   $24\n#define t9   $25\n#define k0   $26\n#define k1   $27\n#define gp   $28\n#define sp   $29\n#define fp   $30\n#define s8   $30\n#define ra   $31\n\n#define f0   $f0\n#define f1   $f1\n#define f2   $f2\n#define f3   $f3\n#define f4   $f4\n#define f5   $f5\n#define f6   $f6\n#define f7   $f7\n#define f8   $f8\n#define f9   $f9\n#define f10  $f10\n#define f11  $f11\n#define f12  $f12\n#define f13  $f13\n#define f14  $f14\n#define f15  $f15\n#define f16  $f16\n#define f17  $f17\n#define f18  $f18\n#define f19  $f19\n#define f20  $f20\n#define f21  $f21\n#define f22  $f22\n#define f23  $f23\n#define f24  $f24\n#define f25  $f25\n#define f26  $f26\n#define f27  $f27\n#define f28  $f28\n#define f29  $f29\n#define f30  $f30\n#define f31  $f31\n\n/*\n * LEAF_MIPS32R2 - declare leaf routine for MIPS32r2\n */\n#define LEAF_MIPS32R2(symbol)                           \\\n                .globl  symbol;                         \\\n                .align  2;                              \\\n                .type   symbol, @function;              \\\n                .ent    symbol, 0;                      \\\nsymbol:         .frame  sp, 0, ra;                      \\\n                .set    push;                           \\\n                .set    arch=mips32r2;                  \\\n                .set    noreorder;                      \\\n                .set    noat;\n\n/*\n * LEAF_MIPS_DSPR2 - declare leaf routine for MIPS DSPr2\n */\n#define LEAF_MIPS_DSPR2(symbol)                         \\\nLEAF_MIPS32R2(symbol)                                   \\\n                .set    dspr2;\n\n/*\n * END - mark end of function\n */\n#define END(function)                                   \\\n                .set    pop;                            \\\n                .end    function;                       \\\n                .size   function,.-function\n\n/*\n * Checks if stack offset is big enough for storing/restoring regs_num\n * number of register to/from stack. Stack offset must be greater than\n * or equal to the number of bytes needed for storing registers (regs_num*4).\n * Since MIPS ABI allows usage of first 16 bytes of stack frame (this is\n * preserved for input arguments of the functions, already stored in a0-a3),\n * stack size can be further optimized by utilizing this space.\n */\n.macro CHECK_STACK_OFFSET regs_num, stack_offset\n.if \\stack_offset < \\regs_num * 4 - 16\n.error \"Stack offset too small.\"\n.endif\n.endm\n\n/*\n * Saves set of registers on stack. Maximum number of registers that\n * can be saved on stack is limitted to 14 (a0-a3, v0-v1 and s0-s7).\n * Stack offset is number of bytes that are added to stack pointer (sp)\n * before registers are pushed in order to provide enough space on stack\n * (offset must be multiple of 4, and must be big enough, as described by\n * CHECK_STACK_OFFSET macro). This macro is intended to be used in\n * combination with RESTORE_REGS_FROM_STACK macro. Example:\n *  SAVE_REGS_ON_STACK      4, v0, v1, s0, s1\n *  RESTORE_REGS_FROM_STACK 4, v0, v1, s0, s1\n */\n.macro SAVE_REGS_ON_STACK stack_offset = 0, r1, \\\n                          r2  = 0, r3  = 0, r4  = 0, \\\n                          r5  = 0, r6  = 0, r7  = 0, \\\n                          r8  = 0, r9  = 0, r10 = 0, \\\n                          r11 = 0, r12 = 0, r13 = 0, \\\n                          r14 = 0\n    .if (\\stack_offset < 0) || (\\stack_offset - (\\stack_offset / 4) * 4)\n    .error \"Stack offset must be pozitive and multiple of 4.\"\n    .endif\n    .if \\stack_offset != 0\n    addiu           sp, sp, -\\stack_offset\n    .endif\n    sw              \\r1, 0(sp)\n    .if \\r2 != 0\n    sw              \\r2, 4(sp)\n    .endif\n    .if \\r3 != 0\n    sw              \\r3, 8(sp)\n    .endif\n    .if \\r4 != 0\n    sw              \\r4, 12(sp)\n    .endif\n    .if \\r5 != 0\n    CHECK_STACK_OFFSET 5, \\stack_offset\n    sw              \\r5, 16(sp)\n    .endif\n    .if \\r6 != 0\n    CHECK_STACK_OFFSET 6, \\stack_offset\n    sw              \\r6, 20(sp)\n    .endif\n    .if \\r7 != 0\n    CHECK_STACK_OFFSET 7, \\stack_offset\n    sw              \\r7, 24(sp)\n    .endif\n    .if \\r8 != 0\n    CHECK_STACK_OFFSET 8, \\stack_offset\n    sw              \\r8, 28(sp)\n    .endif\n    .if \\r9 != 0\n    CHECK_STACK_OFFSET 9, \\stack_offset\n    sw              \\r9, 32(sp)\n    .endif\n    .if \\r10 != 0\n    CHECK_STACK_OFFSET 10, \\stack_offset\n    sw              \\r10, 36(sp)\n    .endif\n    .if \\r11 != 0\n    CHECK_STACK_OFFSET 11, \\stack_offset\n    sw              \\r11, 40(sp)\n    .endif\n    .if \\r12 != 0\n    CHECK_STACK_OFFSET 12, \\stack_offset\n    sw              \\r12, 44(sp)\n    .endif\n    .if \\r13 != 0\n    CHECK_STACK_OFFSET 13, \\stack_offset\n    sw              \\r13, 48(sp)\n    .endif\n    .if \\r14 != 0\n    CHECK_STACK_OFFSET 14, \\stack_offset\n    sw              \\r14, 52(sp)\n    .endif\n.endm\n\n/*\n * Restores set of registers from stack. Maximum number of registers that\n * can be restored from stack is limitted to 14 (a0-a3, v0-v1 and s0-s7).\n * Stack offset is number of bytes that are added to stack pointer (sp)\n * after registers are restored (offset must be multiple of 4, and must\n * be big enough, as described by CHECK_STACK_OFFSET macro). This macro is\n * intended to be used in combination with RESTORE_REGS_FROM_STACK macro.\n * Example:\n *  SAVE_REGS_ON_STACK      4, v0, v1, s0, s1\n *  RESTORE_REGS_FROM_STACK 4, v0, v1, s0, s1\n */\n.macro RESTORE_REGS_FROM_STACK stack_offset = 0, r1, \\\n                               r2  = 0, r3  = 0, r4  = 0, \\\n                               r5  = 0, r6  = 0, r7  = 0, \\\n                               r8  = 0, r9  = 0, r10 = 0, \\\n                               r11 = 0, r12 = 0, r13 = 0, \\\n                               r14 = 0\n    .if (\\stack_offset < 0) || (\\stack_offset - (\\stack_offset/4)*4)\n    .error \"Stack offset must be pozitive and multiple of 4.\"\n    .endif\n    lw              \\r1, 0(sp)\n    .if \\r2 != 0\n    lw              \\r2, 4(sp)\n    .endif\n    .if \\r3 != 0\n    lw              \\r3, 8(sp)\n    .endif\n    .if \\r4 != 0\n    lw              \\r4, 12(sp)\n    .endif\n    .if \\r5 != 0\n    CHECK_STACK_OFFSET 5, \\stack_offset\n    lw              \\r5, 16(sp)\n    .endif\n    .if \\r6 != 0\n    CHECK_STACK_OFFSET 6, \\stack_offset\n    lw              \\r6, 20(sp)\n    .endif\n    .if \\r7 != 0\n    CHECK_STACK_OFFSET 7, \\stack_offset\n    lw              \\r7, 24(sp)\n    .endif\n    .if \\r8 != 0\n    CHECK_STACK_OFFSET 8, \\stack_offset\n    lw              \\r8, 28(sp)\n    .endif\n    .if \\r9 != 0\n    CHECK_STACK_OFFSET 9, \\stack_offset\n    lw              \\r9, 32(sp)\n    .endif\n    .if \\r10 != 0\n    CHECK_STACK_OFFSET 10, \\stack_offset\n    lw              \\r10, 36(sp)\n    .endif\n    .if \\r11 != 0\n    CHECK_STACK_OFFSET 11, \\stack_offset\n    lw              \\r11, 40(sp)\n    .endif\n    .if \\r12 != 0\n    CHECK_STACK_OFFSET 12, \\stack_offset\n    lw              \\r12, 44(sp)\n    .endif\n    .if \\r13 != 0\n    CHECK_STACK_OFFSET 13, \\stack_offset\n    lw              \\r13, 48(sp)\n    .endif\n    .if \\r14 != 0\n    CHECK_STACK_OFFSET 14, \\stack_offset\n    lw              \\r14, 52(sp)\n    .endif\n    .if \\stack_offset != 0\n    addiu           sp, sp, \\stack_offset\n    .endif\n.endm\n\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jsimd_powerpc.c",
    "content": "/*\n * jsimd_powerpc.c\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2009-2011, 2014-2015, D. R. Commander.\n * Copyright (C) 2015, Matthieu Darbois.\n *\n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n * This file contains the interface between the \"normal\" portions\n * of the library and the SIMD implementations when running on a\n * PowerPC architecture.\n */\n\n#define JPEG_INTERNALS\n#include \"../jinclude.h\"\n#include \"../jpeglib.h\"\n#include \"../jsimd.h\"\n#include \"../jdct.h\"\n#include \"../jsimddct.h\"\n#include \"jsimd.h\"\n\nstatic unsigned int simd_support = ~0;\n\nLOCAL(void)\ninit_simd (void)\n{\n  char *env = NULL;\n\n  if (simd_support != ~0U)\n    return;\n\n  simd_support = JSIMD_ALTIVEC;\n\n  /* Force different settings through environment variables */\n  env = getenv(\"JSIMD_FORCENONE\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support = 0;\n}\n\nGLOBAL(int)\njsimd_can_rgb_ycc (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_rgb_gray (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb565 (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_rgb_ycc_convert (j_compress_ptr cinfo,\n                       JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                       JDIMENSION output_row, int num_rows)\n{\n  void (*altivecfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n\n  switch(cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      altivecfct=jsimd_extrgb_ycc_convert_altivec;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      altivecfct=jsimd_extrgbx_ycc_convert_altivec;\n      break;\n    case JCS_EXT_BGR:\n      altivecfct=jsimd_extbgr_ycc_convert_altivec;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      altivecfct=jsimd_extbgrx_ycc_convert_altivec;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      altivecfct=jsimd_extxbgr_ycc_convert_altivec;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      altivecfct=jsimd_extxrgb_ycc_convert_altivec;\n      break;\n    default:\n      altivecfct=jsimd_rgb_ycc_convert_altivec;\n      break;\n  }\n\n  altivecfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);\n}\n\nGLOBAL(void)\njsimd_rgb_gray_convert (j_compress_ptr cinfo,\n                        JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                        JDIMENSION output_row, int num_rows)\n{\n  void (*altivecfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n\n  switch(cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      altivecfct=jsimd_extrgb_gray_convert_altivec;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      altivecfct=jsimd_extrgbx_gray_convert_altivec;\n      break;\n    case JCS_EXT_BGR:\n      altivecfct=jsimd_extbgr_gray_convert_altivec;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      altivecfct=jsimd_extbgrx_gray_convert_altivec;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      altivecfct=jsimd_extxbgr_gray_convert_altivec;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      altivecfct=jsimd_extxrgb_gray_convert_altivec;\n      break;\n    default:\n      altivecfct=jsimd_rgb_gray_convert_altivec;\n      break;\n  }\n\n  altivecfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);\n}\n\nGLOBAL(void)\njsimd_ycc_rgb_convert (j_decompress_ptr cinfo,\n                       JSAMPIMAGE input_buf, JDIMENSION input_row,\n                       JSAMPARRAY output_buf, int num_rows)\n{\n  void (*altivecfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);\n\n  switch(cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      altivecfct=jsimd_ycc_extrgb_convert_altivec;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      altivecfct=jsimd_ycc_extrgbx_convert_altivec;\n      break;\n    case JCS_EXT_BGR:\n      altivecfct=jsimd_ycc_extbgr_convert_altivec;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      altivecfct=jsimd_ycc_extbgrx_convert_altivec;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      altivecfct=jsimd_ycc_extxbgr_convert_altivec;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      altivecfct=jsimd_ycc_extxrgb_convert_altivec;\n      break;\n    default:\n      altivecfct=jsimd_ycc_rgb_convert_altivec;\n      break;\n  }\n\n  altivecfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);\n}\n\nGLOBAL(void)\njsimd_ycc_rgb565_convert (j_decompress_ptr cinfo,\n                          JSAMPIMAGE input_buf, JDIMENSION input_row,\n                          JSAMPARRAY output_buf, int num_rows)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_downsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_downsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  jsimd_h2v2_downsample_altivec(cinfo->image_width, cinfo->max_v_samp_factor,\n                                compptr->v_samp_factor,\n                                compptr->width_in_blocks,\n                                input_data, output_data);\n}\n\nGLOBAL(void)\njsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  jsimd_h2v1_downsample_altivec(cinfo->image_width, cinfo->max_v_samp_factor,\n                                compptr->v_samp_factor,\n                                compptr->width_in_blocks,\n                                input_data, output_data);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info *compptr,\n                     JSAMPARRAY input_data,\n                     JSAMPARRAY *output_data_ptr)\n{\n  jsimd_h2v2_upsample_altivec(cinfo->max_v_samp_factor, cinfo->output_width,\n                              input_data, output_data_ptr);\n}\n\nGLOBAL(void)\njsimd_h2v1_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info *compptr,\n                     JSAMPARRAY input_data,\n                     JSAMPARRAY *output_data_ptr)\n{\n  jsimd_h2v1_upsample_altivec(cinfo->max_v_samp_factor, cinfo->output_width,\n                              input_data, output_data_ptr);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_fancy_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_fancy_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info *compptr,\n                           JSAMPARRAY input_data,\n                           JSAMPARRAY *output_data_ptr)\n{\n  jsimd_h2v2_fancy_upsample_altivec(cinfo->max_v_samp_factor,\n                                    compptr->downsampled_width, input_data,\n                                    output_data_ptr);\n}\n\nGLOBAL(void)\njsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info *compptr,\n                           JSAMPARRAY input_data,\n                           JSAMPARRAY *output_data_ptr)\n{\n  jsimd_h2v1_fancy_upsample_altivec(cinfo->max_v_samp_factor,\n                                    compptr->downsampled_width, input_data,\n                                    output_data_ptr);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_merged_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_merged_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n  void (*altivecfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);\n\n  switch(cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      altivecfct=jsimd_h2v2_extrgb_merged_upsample_altivec;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      altivecfct=jsimd_h2v2_extrgbx_merged_upsample_altivec;\n      break;\n    case JCS_EXT_BGR:\n      altivecfct=jsimd_h2v2_extbgr_merged_upsample_altivec;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      altivecfct=jsimd_h2v2_extbgrx_merged_upsample_altivec;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      altivecfct=jsimd_h2v2_extxbgr_merged_upsample_altivec;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      altivecfct=jsimd_h2v2_extxrgb_merged_upsample_altivec;\n      break;\n    default:\n      altivecfct=jsimd_h2v2_merged_upsample_altivec;\n      break;\n  }\n\n  altivecfct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);\n}\n\nGLOBAL(void)\njsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n  void (*altivecfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);\n\n  switch(cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      altivecfct=jsimd_h2v1_extrgb_merged_upsample_altivec;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      altivecfct=jsimd_h2v1_extrgbx_merged_upsample_altivec;\n      break;\n    case JCS_EXT_BGR:\n      altivecfct=jsimd_h2v1_extbgr_merged_upsample_altivec;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      altivecfct=jsimd_h2v1_extbgrx_merged_upsample_altivec;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      altivecfct=jsimd_h2v1_extxbgr_merged_upsample_altivec;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      altivecfct=jsimd_h2v1_extxrgb_merged_upsample_altivec;\n      break;\n    default:\n      altivecfct=jsimd_h2v1_merged_upsample_altivec;\n      break;\n  }\n\n  altivecfct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);\n}\n\nGLOBAL(int)\njsimd_can_convsamp (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_convsamp_float (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,\n                DCTELEM *workspace)\n{\n  jsimd_convsamp_altivec(sample_data, start_col, workspace);\n}\n\nGLOBAL(void)\njsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,\n                      FAST_FLOAT *workspace)\n{\n}\n\nGLOBAL(int)\njsimd_can_fdct_islow (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_float (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_fdct_islow (DCTELEM *data)\n{\n  jsimd_fdct_islow_altivec(data);\n}\n\nGLOBAL(void)\njsimd_fdct_ifast (DCTELEM *data)\n{\n  jsimd_fdct_ifast_altivec(data);\n}\n\nGLOBAL(void)\njsimd_fdct_float (FAST_FLOAT *data)\n{\n}\n\nGLOBAL(int)\njsimd_can_quantize (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_quantize_float (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors,\n                DCTELEM *workspace)\n{\n  jsimd_quantize_altivec(coef_block, divisors, workspace);\n}\n\nGLOBAL(void)\njsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors,\n                      FAST_FLOAT *workspace)\n{\n}\n\nGLOBAL(int)\njsimd_can_idct_2x2 (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_4x4 (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n}\n\nGLOBAL(void)\njsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n}\n\nGLOBAL(int)\njsimd_can_idct_islow (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ALTIVEC)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_float (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n  jsimd_idct_islow_altivec(compptr->dct_table, coef_block, output_buf,\n                           output_col);\n}\n\nGLOBAL(void)\njsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n  jsimd_idct_ifast_altivec(compptr->dct_table, coef_block, output_buf,\n                           output_col);\n}\n\nGLOBAL(void)\njsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n}\n\nGLOBAL(int)\njsimd_can_huff_encode_one_block (void)\n{\n  return 0;\n}\n\nGLOBAL(JOCTET*)\njsimd_huff_encode_one_block (void *state, JOCTET *buffer, JCOEFPTR block,\n                             int last_dc_val, c_derived_tbl *dctbl,\n                             c_derived_tbl *actbl)\n{\n  return NULL;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jsimd_x86_64.c",
    "content": "/*\n * jsimd_x86_64.c\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2009-2011, 2014, 2016, D. R. Commander.\n * Copyright (C) 2015, Matthieu Darbois.\n *\n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n * This file contains the interface between the \"normal\" portions\n * of the library and the SIMD implementations when running on a\n * 64-bit x86 architecture.\n */\n\n#define JPEG_INTERNALS\n#include \"../jinclude.h\"\n#include \"../jpeglib.h\"\n#include \"../jsimd.h\"\n#include \"../jdct.h\"\n#include \"../jsimddct.h\"\n#include \"jsimd.h\"\n\n/*\n * In the PIC cases, we have no guarantee that constants will keep\n * their alignment. This macro allows us to verify it at runtime.\n */\n#define IS_ALIGNED(ptr, order) (((size_t)ptr & ((1 << order) - 1)) == 0)\n\n#define IS_ALIGNED_SSE(ptr) (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */\n\nstatic unsigned int simd_support = ~0;\nstatic unsigned int simd_huffman = 1;\n\n/*\n * Check what SIMD accelerations are supported.\n *\n * FIXME: This code is racy under a multi-threaded environment.\n */\nLOCAL(void)\ninit_simd (void)\n{\n  char *env = NULL;\n\n  if (simd_support != ~0U)\n    return;\n\n  simd_support = JSIMD_SSE2 | JSIMD_SSE;\n\n  /* Force different settings through environment variables */\n  env = getenv(\"JSIMD_FORCENONE\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support = 0;\n  env = getenv(\"JSIMD_NOHUFFENC\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_huffman = 0;\n}\n\nGLOBAL(int)\njsimd_can_rgb_ycc (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_rgb_ycc_convert_sse2))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_rgb_gray (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_rgb_gray_convert_sse2))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_ycc_rgb_convert_sse2))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb565 (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_rgb_ycc_convert (j_compress_ptr cinfo,\n                       JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                       JDIMENSION output_row, int num_rows)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n\n  switch(cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_extrgb_ycc_convert_sse2;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_extrgbx_ycc_convert_sse2;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_extbgr_ycc_convert_sse2;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_extbgrx_ycc_convert_sse2;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_extxbgr_ycc_convert_sse2;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_extxrgb_ycc_convert_sse2;\n      break;\n    default:\n      sse2fct=jsimd_rgb_ycc_convert_sse2;\n      break;\n  }\n\n  sse2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);\n}\n\nGLOBAL(void)\njsimd_rgb_gray_convert (j_compress_ptr cinfo,\n                        JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                        JDIMENSION output_row, int num_rows)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n\n  switch(cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_extrgb_gray_convert_sse2;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_extrgbx_gray_convert_sse2;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_extbgr_gray_convert_sse2;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_extbgrx_gray_convert_sse2;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_extxbgr_gray_convert_sse2;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_extxrgb_gray_convert_sse2;\n      break;\n    default:\n      sse2fct=jsimd_rgb_gray_convert_sse2;\n      break;\n  }\n\n  sse2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);\n}\n\nGLOBAL(void)\njsimd_ycc_rgb_convert (j_decompress_ptr cinfo,\n                       JSAMPIMAGE input_buf, JDIMENSION input_row,\n                       JSAMPARRAY output_buf, int num_rows)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);\n\n  switch(cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_ycc_extrgb_convert_sse2;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_ycc_extrgbx_convert_sse2;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_ycc_extbgr_convert_sse2;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_ycc_extbgrx_convert_sse2;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_ycc_extxbgr_convert_sse2;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_ycc_extxrgb_convert_sse2;\n      break;\n    default:\n      sse2fct=jsimd_ycc_rgb_convert_sse2;\n      break;\n  }\n\n  sse2fct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);\n}\n\nGLOBAL(void)\njsimd_ycc_rgb565_convert (j_decompress_ptr cinfo,\n                          JSAMPIMAGE input_buf, JDIMENSION input_row,\n                          JSAMPARRAY output_buf, int num_rows)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_downsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_downsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  jsimd_h2v2_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor,\n                             compptr->v_samp_factor, compptr->width_in_blocks,\n                             input_data, output_data);\n}\n\nGLOBAL(void)\njsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  jsimd_h2v1_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor,\n                             compptr->v_samp_factor, compptr->width_in_blocks,\n                             input_data, output_data);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info *compptr,\n                     JSAMPARRAY input_data,\n                     JSAMPARRAY *output_data_ptr)\n{\n  jsimd_h2v2_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width,\n                           input_data, output_data_ptr);\n}\n\nGLOBAL(void)\njsimd_h2v1_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info *compptr,\n                     JSAMPARRAY input_data,\n                     JSAMPARRAY *output_data_ptr)\n{\n  jsimd_h2v1_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width,\n                           input_data, output_data_ptr);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_fancy_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_fancy_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info *compptr,\n                           JSAMPARRAY input_data,\n                           JSAMPARRAY *output_data_ptr)\n{\n  jsimd_h2v2_fancy_upsample_sse2(cinfo->max_v_samp_factor,\n                                 compptr->downsampled_width, input_data,\n                                 output_data_ptr);\n}\n\nGLOBAL(void)\njsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info *compptr,\n                           JSAMPARRAY input_data,\n                           JSAMPARRAY *output_data_ptr)\n{\n  jsimd_h2v1_fancy_upsample_sse2(cinfo->max_v_samp_factor,\n                                 compptr->downsampled_width, input_data,\n                                 output_data_ptr);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_merged_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_merged_upsample_sse2))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_merged_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_merged_upsample_sse2))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);\n\n  switch(cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_h2v2_extrgb_merged_upsample_sse2;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_h2v2_extrgbx_merged_upsample_sse2;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_h2v2_extbgr_merged_upsample_sse2;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_h2v2_extbgrx_merged_upsample_sse2;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_h2v2_extxbgr_merged_upsample_sse2;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_h2v2_extxrgb_merged_upsample_sse2;\n      break;\n    default:\n      sse2fct=jsimd_h2v2_merged_upsample_sse2;\n      break;\n  }\n\n  sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);\n}\n\nGLOBAL(void)\njsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);\n\n  switch(cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_h2v1_extrgb_merged_upsample_sse2;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_h2v1_extrgbx_merged_upsample_sse2;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_h2v1_extbgr_merged_upsample_sse2;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_h2v1_extbgrx_merged_upsample_sse2;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_h2v1_extxbgr_merged_upsample_sse2;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_h2v1_extxrgb_merged_upsample_sse2;\n      break;\n    default:\n      sse2fct=jsimd_h2v1_merged_upsample_sse2;\n      break;\n  }\n\n  sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);\n}\n\nGLOBAL(int)\njsimd_can_convsamp (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_convsamp_float (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,\n                DCTELEM *workspace)\n{\n  jsimd_convsamp_sse2(sample_data, start_col, workspace);\n}\n\nGLOBAL(void)\njsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,\n                      FAST_FLOAT *workspace)\n{\n  jsimd_convsamp_float_sse2(sample_data, start_col, workspace);\n}\n\nGLOBAL(int)\njsimd_can_fdct_islow (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_islow_sse2))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_ifast_sse2))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_float (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_fdct_float_sse))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_fdct_islow (DCTELEM *data)\n{\n  jsimd_fdct_islow_sse2(data);\n}\n\nGLOBAL(void)\njsimd_fdct_ifast (DCTELEM *data)\n{\n  jsimd_fdct_ifast_sse2(data);\n}\n\nGLOBAL(void)\njsimd_fdct_float (FAST_FLOAT *data)\n{\n  jsimd_fdct_float_sse(data);\n}\n\nGLOBAL(int)\njsimd_can_quantize (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_quantize_float (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_quantize (JCOEFPTR coef_block, DCTELEM *divisors,\n                DCTELEM *workspace)\n{\n  jsimd_quantize_sse2(coef_block, divisors, workspace);\n}\n\nGLOBAL(void)\njsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT *divisors,\n                      FAST_FLOAT *workspace)\n{\n  jsimd_quantize_float_sse2(coef_block, divisors, workspace);\n}\n\nGLOBAL(int)\njsimd_can_idct_2x2 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_4x4 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  jsimd_idct_2x2_sse2(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(void)\njsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  jsimd_idct_4x4_sse2(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(int)\njsimd_can_idct_islow (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_islow_sse2))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(IFAST_MULT_TYPE) != 2)\n    return 0;\n  if (IFAST_SCALE_BITS != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_ifast_sse2))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_float (void)\n{\n  init_simd();\n\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n  if (sizeof(FLOAT_MULT_TYPE) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_float_sse2))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n  jsimd_idct_islow_sse2(compptr->dct_table, coef_block, output_buf,\n                        output_col);\n}\n\nGLOBAL(void)\njsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n  jsimd_idct_ifast_sse2(compptr->dct_table, coef_block, output_buf,\n                        output_col);\n}\n\nGLOBAL(void)\njsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info *compptr,\n                  JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                  JDIMENSION output_col)\n{\n  jsimd_idct_float_sse2(compptr->dct_table, coef_block, output_buf,\n                        output_col);\n}\n\nGLOBAL(int)\njsimd_can_huff_encode_one_block (void)\n{\n  init_simd();\n\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && simd_huffman &&\n      IS_ALIGNED_SSE(jconst_huff_encode_one_block))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(JOCTET*)\njsimd_huff_encode_one_block (void *state, JOCTET *buffer, JCOEFPTR block,\n                             int last_dc_val, c_derived_tbl *dctbl,\n                             c_derived_tbl *actbl)\n{\n  return jsimd_huff_encode_one_block_sse2(state, buffer, block, last_dc_val,\n                                          dctbl, actbl);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jsimdcfg.inc.h",
    "content": "// This file generates the include file for the assembly\n// implementations by abusing the C preprocessor.\n//\n// Note: Some things are manually defined as they need to\n// be mapped to NASM types.\n\n;\n; Automatically generated include file from jsimdcfg.inc.h\n;\n\n#define JPEG_INTERNALS\n\n#include \"../jpeglib.h\"\n#include \"../jconfig.h\"\n#include \"../jmorecfg.h\"\n#include \"jsimd.h\"\n\n;\n; -- jpeglib.h\n;\n\n%define _cpp_protection_DCTSIZE DCTSIZE\n%define _cpp_protection_DCTSIZE2 DCTSIZE2\n\n;\n; -- jmorecfg.h\n;\n\n%define _cpp_protection_RGB_RED RGB_RED\n%define _cpp_protection_RGB_GREEN RGB_GREEN\n%define _cpp_protection_RGB_BLUE RGB_BLUE\n%define _cpp_protection_RGB_PIXELSIZE RGB_PIXELSIZE\n\n%define _cpp_protection_EXT_RGB_RED EXT_RGB_RED\n%define _cpp_protection_EXT_RGB_GREEN EXT_RGB_GREEN\n%define _cpp_protection_EXT_RGB_BLUE EXT_RGB_BLUE\n%define _cpp_protection_EXT_RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n\n%define _cpp_protection_EXT_RGBX_RED EXT_RGBX_RED\n%define _cpp_protection_EXT_RGBX_GREEN EXT_RGBX_GREEN\n%define _cpp_protection_EXT_RGBX_BLUE EXT_RGBX_BLUE\n%define _cpp_protection_EXT_RGBX_PIXELSIZE EXT_RGBX_PIXELSIZE\n\n%define _cpp_protection_EXT_BGR_RED EXT_BGR_RED\n%define _cpp_protection_EXT_BGR_GREEN EXT_BGR_GREEN\n%define _cpp_protection_EXT_BGR_BLUE EXT_BGR_BLUE\n%define _cpp_protection_EXT_BGR_PIXELSIZE EXT_BGR_PIXELSIZE\n\n%define _cpp_protection_EXT_BGRX_RED EXT_BGRX_RED\n%define _cpp_protection_EXT_BGRX_GREEN EXT_BGRX_GREEN\n%define _cpp_protection_EXT_BGRX_BLUE EXT_BGRX_BLUE\n%define _cpp_protection_EXT_BGRX_PIXELSIZE EXT_BGRX_PIXELSIZE\n\n%define _cpp_protection_EXT_XBGR_RED EXT_XBGR_RED\n%define _cpp_protection_EXT_XBGR_GREEN EXT_XBGR_GREEN\n%define _cpp_protection_EXT_XBGR_BLUE EXT_XBGR_BLUE\n%define _cpp_protection_EXT_XBGR_PIXELSIZE EXT_XBGR_PIXELSIZE\n\n%define _cpp_protection_EXT_XRGB_RED EXT_XRGB_RED\n%define _cpp_protection_EXT_XRGB_GREEN EXT_XRGB_GREEN\n%define _cpp_protection_EXT_XRGB_BLUE EXT_XRGB_BLUE\n%define _cpp_protection_EXT_XRGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n\n%define RGBX_FILLER_0XFF        1\n\n; Representation of a single sample (pixel element value).\n; On this SIMD implementation, this must be 'unsigned char'.\n;\n\n%define JSAMPLE                 byte          ; unsigned char\n%define SIZEOF_JSAMPLE          SIZEOF_BYTE   ; sizeof(JSAMPLE)\n\n%define _cpp_protection_CENTERJSAMPLE CENTERJSAMPLE\n\n; Representation of a DCT frequency coefficient.\n; On this SIMD implementation, this must be 'short'.\n;\n%define JCOEF                   word          ; short\n%define SIZEOF_JCOEF            SIZEOF_WORD   ; sizeof(JCOEF)\n\n; Datatype used for image dimensions.\n; On this SIMD implementation, this must be 'unsigned int'.\n;\n%define JDIMENSION              dword         ; unsigned int\n%define SIZEOF_JDIMENSION       SIZEOF_DWORD  ; sizeof(JDIMENSION)\n\n%define JSAMPROW                POINTER       ; JSAMPLE *     (jpeglib.h)\n%define JSAMPARRAY              POINTER       ; JSAMPROW *    (jpeglib.h)\n%define JSAMPIMAGE              POINTER       ; JSAMPARRAY *  (jpeglib.h)\n%define JCOEFPTR                POINTER       ; JCOEF *       (jpeglib.h)\n%define SIZEOF_JSAMPROW         SIZEOF_POINTER  ; sizeof(JSAMPROW)\n%define SIZEOF_JSAMPARRAY       SIZEOF_POINTER  ; sizeof(JSAMPARRAY)\n%define SIZEOF_JSAMPIMAGE       SIZEOF_POINTER  ; sizeof(JSAMPIMAGE)\n%define SIZEOF_JCOEFPTR         SIZEOF_POINTER  ; sizeof(JCOEFPTR)\n\n;\n; -- jdct.h\n;\n\n; A forward DCT routine is given a pointer to a work area of type DCTELEM[];\n; the DCT is to be performed in-place in that buffer.\n; To maximize parallelism, Type DCTELEM is changed to short (originally, int).\n;\n%define DCTELEM                 word          ; short\n%define SIZEOF_DCTELEM          SIZEOF_WORD   ; sizeof(DCTELEM)\n\n%define FAST_FLOAT              FP32            ; float\n%define SIZEOF_FAST_FLOAT       SIZEOF_FP32     ; sizeof(FAST_FLOAT)\n\n; To maximize parallelism, Type MULTIPLIER is changed to short.\n;\n%define ISLOW_MULT_TYPE         word          ; must be short\n%define SIZEOF_ISLOW_MULT_TYPE  SIZEOF_WORD   ; sizeof(ISLOW_MULT_TYPE)\n\n%define IFAST_MULT_TYPE         word          ; must be short\n%define SIZEOF_IFAST_MULT_TYPE  SIZEOF_WORD   ; sizeof(IFAST_MULT_TYPE)\n%define IFAST_SCALE_BITS        2             ; fractional bits in scale factors\n\n%define FLOAT_MULT_TYPE         FP32          ; must be float\n%define SIZEOF_FLOAT_MULT_TYPE  SIZEOF_FP32   ; sizeof(FLOAT_MULT_TYPE)\n\n;\n; -- jsimd.h\n;\n\n%define _cpp_protection_JSIMD_NONE JSIMD_NONE\n%define _cpp_protection_JSIMD_MMX JSIMD_MMX\n%define _cpp_protection_JSIMD_3DNOW JSIMD_3DNOW\n%define _cpp_protection_JSIMD_SSE JSIMD_SSE\n%define _cpp_protection_JSIMD_SSE2 JSIMD_SSE2\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jsimdcpu.asm",
    "content": ";\n; jsimdcpu.asm - SIMD instruction support check\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on the x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n        SECTION SEG_TEXT\n        BITS    32\n;\n; Check if the CPU supports SIMD instructions\n;\n; GLOBAL(unsigned int)\n; jpeg_simd_cpu_support (void)\n;\n\n        align   16\n        global  EXTN(jpeg_simd_cpu_support)\n\nEXTN(jpeg_simd_cpu_support):\n        push    ebx\n;       push    ecx             ; need not be preserved\n;       push    edx             ; need not be preserved\n;       push    esi             ; unused\n        push    edi\n\n        xor     edi,edi                 ; simd support flag\n\n        pushfd\n        pop     eax\n        mov     edx,eax\n        xor     eax, 1<<21              ; flip ID bit in EFLAGS\n        push    eax\n        popfd\n        pushfd\n        pop     eax\n        xor     eax,edx\n        jz      short .return           ; CPUID is not supported\n\n        ; Check for MMX instruction support\n        xor     eax,eax\n        cpuid\n        test    eax,eax\n        jz      short .return\n\n        xor     eax,eax\n        inc     eax\n        cpuid\n        mov     eax,edx                 ; eax = Standard feature flags\n\n        test    eax, 1<<23              ; bit23:MMX\n        jz      short .no_mmx\n        or      edi, byte JSIMD_MMX\n.no_mmx:\n        test    eax, 1<<25              ; bit25:SSE\n        jz      short .no_sse\n        or      edi, byte JSIMD_SSE\n.no_sse:\n        test    eax, 1<<26              ; bit26:SSE2\n        jz      short .no_sse2\n        or      edi, byte JSIMD_SSE2\n.no_sse2:\n\n        ; Check for 3DNow! instruction support\n        mov     eax, 0x80000000\n        cpuid\n        cmp     eax, 0x80000000\n        jbe     short .return\n\n        mov     eax, 0x80000001\n        cpuid\n        mov     eax,edx                 ; eax = Extended feature flags\n\n        test    eax, 1<<31              ; bit31:3DNow!(vendor independent)\n        jz      short .no_3dnow\n        or      edi, byte JSIMD_3DNOW\n.no_3dnow:\n\n.return:\n        mov     eax,edi\n\n        pop     edi\n;       pop     esi             ; unused\n;       pop     edx             ; need not be preserved\n;       pop     ecx             ; need not be preserved\n        pop     ebx\n        ret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n        align   16\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/jsimdext.inc",
    "content": ";\n; jsimdext.inc - common declarations\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright (C) 2010, D. R. Commander.\n;\n; Based on the x86 SIMD extension for IJG JPEG library - version 1.02\n;\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n;\n; This software is provided 'as-is', without any express or implied\n; warranty.  In no event will the authors be held liable for any damages\n; arising from the use of this software.\n;\n; Permission is granted to anyone to use this software for any purpose,\n; including commercial applications, and to alter it and redistribute it\n; freely, subject to the following restrictions:\n;\n; 1. The origin of this software must not be misrepresented; you must not\n;    claim that you wrote the original software. If you use this software\n;    in a product, an acknowledgment in the product documentation would be\n;    appreciated but is not required.\n; 2. Altered source versions must be plainly marked as such, and must not be\n;    misrepresented as being the original software.\n; 3. This notice may not be removed or altered from any source distribution.\n;\n; [TAB8]\n\n; ==========================================================================\n;  System-dependent configurations\n\n%ifdef WIN32    ; ----(nasm -fwin32 -DWIN32 ...)--------\n; * Microsoft Visual C++\n; * MinGW (Minimalist GNU for Windows)\n; * CygWin\n; * LCC-Win32\n\n; -- segment definition --\n;\n%ifdef __YASM_VER__\n%define SEG_TEXT    .text  align=16\n%define SEG_CONST   .rdata align=16\n%else\n%define SEG_TEXT    .text  align=16 public use32 class=CODE\n%define SEG_CONST   .rdata align=16 public use32 class=CONST\n%endif\n\n%elifdef WIN64  ; ----(nasm -fwin64 -DWIN64 ...)--------\n; * Microsoft Visual C++\n\n; -- segment definition --\n;\n%ifdef __YASM_VER__\n%define SEG_TEXT    .text  align=16\n%define SEG_CONST   .rdata align=16\n%else\n%define SEG_TEXT    .text  align=16 public use64 class=CODE\n%define SEG_CONST   .rdata align=16 public use64 class=CONST\n%endif\n%define EXTN(name)  name                        ; foo() -> foo\n\n%elifdef OBJ32  ; ----(nasm -fobj -DOBJ32 ...)----------\n; * Borland C++ (Win32)\n\n; -- segment definition --\n;\n%define SEG_TEXT    _text  align=16 public use32 class=CODE\n%define SEG_CONST   _data  align=16 public use32 class=DATA\n\n%elifdef ELF    ; ----(nasm -felf[64] -DELF ...)------------\n; * Linux\n; * *BSD family Unix using elf format\n; * Unix System V, including Solaris x86, UnixWare and SCO Unix\n\n; mark stack as non-executable\nsection .note.GNU-stack noalloc noexec nowrite progbits\n\n; -- segment definition --\n;\n%ifdef __x86_64__\n%define SEG_TEXT    .text   progbits align=16\n%define SEG_CONST   .rodata progbits align=16\n%else\n%define SEG_TEXT    .text   progbits alloc exec   nowrite align=16\n%define SEG_CONST   .rodata progbits alloc noexec nowrite align=16\n%endif\n\n; To make the code position-independent, append -DPIC to the commandline\n;\n%define GOT_SYMBOL  _GLOBAL_OFFSET_TABLE_       ; ELF supports PIC\n%define EXTN(name)  name                        ; foo() -> foo\n\n%elifdef AOUT   ; ----(nasm -faoutb/aout -DAOUT ...)----\n; * Older Linux using a.out format  (nasm -f aout -DAOUT ...)\n; * *BSD family Unix using a.out format  (nasm -f aoutb -DAOUT ...)\n\n; -- segment definition --\n;\n%define SEG_TEXT    .text\n%define SEG_CONST   .data\n\n; To make the code position-independent, append -DPIC to the commandline\n;\n%define GOT_SYMBOL  __GLOBAL_OFFSET_TABLE_      ; BSD-style a.out supports PIC\n\n%elifdef MACHO  ; ----(nasm -fmacho -DMACHO ...)--------\n; * NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X (Mach-O format)\n\n; -- segment definition --\n;\n%define SEG_TEXT    .text  ;align=16    ; nasm doesn't accept align=16. why?\n%define SEG_CONST   .rodata align=16\n\n; The generation of position-independent code (PIC) is the default on Darwin.\n;\n%define PIC\n%define GOT_SYMBOL  _MACHO_PIC_         ; Mach-O style code-relative addressing\n\n%else           ; ----(Other case)----------------------\n\n; -- segment definition --\n;\n%define SEG_TEXT    .text\n%define SEG_CONST   .data\n\n%endif  ; ----------------------------------------------\n\n; ==========================================================================\n\n; --------------------------------------------------------------------------\n;  Common types\n;\n%ifdef __x86_64__\n%define POINTER                 qword           ; general pointer type\n%define SIZEOF_POINTER          SIZEOF_QWORD    ; sizeof(POINTER)\n%define POINTER_BIT             QWORD_BIT       ; sizeof(POINTER)*BYTE_BIT\n%else\n%define POINTER                 dword           ; general pointer type\n%define SIZEOF_POINTER          SIZEOF_DWORD    ; sizeof(POINTER)\n%define POINTER_BIT             DWORD_BIT       ; sizeof(POINTER)*BYTE_BIT\n%endif\n\n%define INT                     dword           ; signed integer type\n%define SIZEOF_INT              SIZEOF_DWORD    ; sizeof(INT)\n%define INT_BIT                 DWORD_BIT       ; sizeof(INT)*BYTE_BIT\n\n%define FP32                    dword           ; IEEE754 single\n%define SIZEOF_FP32             SIZEOF_DWORD    ; sizeof(FP32)\n%define FP32_BIT                DWORD_BIT       ; sizeof(FP32)*BYTE_BIT\n\n%define MMWORD                  qword           ; int64  (MMX register)\n%define SIZEOF_MMWORD           SIZEOF_QWORD    ; sizeof(MMWORD)\n%define MMWORD_BIT              QWORD_BIT       ; sizeof(MMWORD)*BYTE_BIT\n\n; NASM is buggy and doesn't properly handle operand sizes for SSE\n; instructions, so for now we have to define XMMWORD as blank.\n%define XMMWORD                                 ; int128 (SSE register)\n%define SIZEOF_XMMWORD          SIZEOF_OWORD    ; sizeof(XMMWORD)\n%define XMMWORD_BIT             OWORD_BIT       ; sizeof(XMMWORD)*BYTE_BIT\n\n; Similar hacks for when we load a dword or MMWORD into an xmm# register\n%define XMM_DWORD\n%define XMM_MMWORD\n\n%define SIZEOF_BYTE             1               ; sizeof(BYTE)\n%define SIZEOF_WORD             2               ; sizeof(WORD)\n%define SIZEOF_DWORD            4               ; sizeof(DWORD)\n%define SIZEOF_QWORD            8               ; sizeof(QWORD)\n%define SIZEOF_OWORD            16              ; sizeof(OWORD)\n\n%define BYTE_BIT                8               ; CHAR_BIT in C\n%define WORD_BIT                16              ; sizeof(WORD)*BYTE_BIT\n%define DWORD_BIT               32              ; sizeof(DWORD)*BYTE_BIT\n%define QWORD_BIT               64              ; sizeof(QWORD)*BYTE_BIT\n%define OWORD_BIT               128             ; sizeof(OWORD)*BYTE_BIT\n\n; --------------------------------------------------------------------------\n;  External Symbol Name\n;\n%ifndef EXTN\n%define EXTN(name)   _ %+ name          ; foo() -> _foo\n%endif\n\n; --------------------------------------------------------------------------\n;  Macros for position-independent code (PIC) support\n;\n%ifndef GOT_SYMBOL\n%undef PIC\n%endif\n\n%ifdef PIC ; -------------------------------------------\n\n%ifidn GOT_SYMBOL,_MACHO_PIC_ ; --------------------\n\n; At present, nasm doesn't seem to support PIC generation for Mach-O.\n; The PIC support code below is a little tricky.\n\n        SECTION SEG_CONST\nconst_base:\n\n%define GOTOFF(got,sym) (got) + (sym) - const_base\n\n%imacro get_GOT 1\n        ; NOTE: this macro destroys ecx resister.\n        call    %%geteip\n        add     ecx, byte (%%ref - $)\n        jmp     short %%adjust\n%%geteip:\n        mov     ecx, POINTER [esp]\n        ret\n%%adjust:\n        push    ebp\n        xor     ebp,ebp         ; ebp = 0\n%ifidni %1,ebx  ; (%1 == ebx)\n        ; db 0x8D,0x9C + jmp near const_base =\n        ;   lea ebx, [ecx+ebp*8+(const_base-%%ref)] ; 8D,9C,E9,(offset32)\n        db      0x8D,0x9C               ; 8D,9C\n        jmp     near const_base         ; E9,(const_base-%%ref)\n%%ref:\n%else  ; (%1 != ebx)\n        ; db 0x8D,0x8C + jmp near const_base =\n        ;   lea ecx, [ecx+ebp*8+(const_base-%%ref)] ; 8D,8C,E9,(offset32)\n        db      0x8D,0x8C               ; 8D,8C\n        jmp     near const_base         ; E9,(const_base-%%ref)\n%%ref:  mov     %1, ecx\n%endif ; (%1 == ebx)\n        pop     ebp\n%endmacro\n\n%else   ; GOT_SYMBOL != _MACHO_PIC_ ----------------\n\n%define GOTOFF(got,sym) (got) + (sym) wrt ..gotoff\n\n%imacro get_GOT 1\n        extern  GOT_SYMBOL\n        call    %%geteip\n        add     %1, GOT_SYMBOL + $$ - $ wrt ..gotpc\n        jmp     short %%done\n%%geteip:\n        mov     %1, POINTER [esp]\n        ret\n%%done:\n%endmacro\n\n%endif  ; GOT_SYMBOL == _MACHO_PIC_ ----------------\n\n%imacro pushpic 1.nolist\n        push    %1\n%endmacro\n%imacro poppic  1.nolist\n        pop     %1\n%endmacro\n%imacro movpic  2.nolist\n        mov     %1,%2\n%endmacro\n\n%else   ; !PIC -----------------------------------------\n\n%define GOTOFF(got,sym) (sym)\n\n%imacro get_GOT 1.nolist\n%endmacro\n%imacro pushpic 1.nolist\n%endmacro\n%imacro poppic  1.nolist\n%endmacro\n%imacro movpic  2.nolist\n%endmacro\n\n%endif  ;  PIC -----------------------------------------\n\n; --------------------------------------------------------------------------\n;  Align the next instruction on {2,4,8,16,..}-byte boundary.\n;  \".balign n,,m\" in GNU as\n;\n%define MSKLE(x,y)  (~(((y) & 0xFFFF) - ((x) & 0xFFFF)) >> 16)\n%define FILLB(b,n)  (($$-(b)) & ((n)-1))\n\n%imacro alignx 1-2.nolist 0xFFFF\n%%bs:   times MSKLE(FILLB(%%bs,%1),%2) & MSKLE(16,FILLB($,%1)) & FILLB($,%1) \\\n               db 0x90                               ; nop\n        times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/9 \\\n               db 0x8D,0x9C,0x23,0x00,0x00,0x00,0x00 ; lea ebx,[ebx+0x00000000]\n        times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/7 \\\n               db 0x8D,0xAC,0x25,0x00,0x00,0x00,0x00 ; lea ebp,[ebp+0x00000000]\n        times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/6 \\\n               db 0x8D,0xAD,0x00,0x00,0x00,0x00      ; lea ebp,[ebp+0x00000000]\n        times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/4 \\\n               db 0x8D,0x6C,0x25,0x00                ; lea ebp,[ebp+0x00]\n        times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/3 \\\n               db 0x8D,0x6D,0x00                     ; lea ebp,[ebp+0x00]\n        times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/2 \\\n               db 0x8B,0xED                          ; mov ebp,ebp\n        times MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/1 \\\n               db 0x90                               ; nop\n%endmacro\n\n; Align the next data on {2,4,8,16,..}-byte boundary.\n;\n%imacro alignz 1.nolist\n        align %1, db 0          ; filling zeros\n%endmacro\n\n%ifdef __x86_64__\n\n%ifdef WIN64\n\n%imacro collect_args 0\n        push r12\n        push r13\n        push r14\n        push r15\n        mov r10, rcx\n        mov r11, rdx\n        mov r12, r8\n        mov r13, r9\n        mov r14, [rax+48]\n        mov r15, [rax+56]\n        push rsi\n        push rdi\n        sub     rsp, SIZEOF_XMMWORD\n        movaps  XMMWORD [rsp], xmm6\n        sub     rsp, SIZEOF_XMMWORD\n        movaps  XMMWORD [rsp], xmm7\n%endmacro\n\n%imacro uncollect_args 0\n        movaps  xmm7, XMMWORD [rsp]\n        add     rsp, SIZEOF_XMMWORD\n        movaps  xmm6, XMMWORD [rsp]\n        add     rsp, SIZEOF_XMMWORD\n        pop rdi\n        pop rsi\n        pop r15\n        pop r14\n        pop r13\n        pop r12\n%endmacro\n\n%else\n\n%imacro collect_args 0\n        push r10\n        push r11\n        push r12\n        push r13\n        push r14\n        push r15\n        mov r10, rdi\n        mov r11, rsi\n        mov r12, rdx\n        mov r13, rcx\n        mov r14, r8\n        mov r15, r9\n%endmacro\n\n%imacro uncollect_args 0\n        pop r15\n        pop r14\n        pop r13\n        pop r12\n        pop r11\n        pop r10\n%endmacro\n\n%endif\n\n%endif\n\n; --------------------------------------------------------------------------\n;  Defines picked up from the C headers\n;\n%include \"jsimdcfg.inc\"\n\n; --------------------------------------------------------------------------\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/simd/nasm_lt.sh",
    "content": "#! /bin/sh\ncommand=\"\"\ninfile=\"\"\no_opt=no\npic=no\nwhile [ $# -gt 0 ]; do\n    case \"$1\" in\n        --silent)\n            exec > /dev/null\n            ;;\n        -DPIC|-fPIC|-fpic|-Kpic|-KPIC)\n            if [ \"$pic\" != \"yes\" ] ; then\n                command=\"$command -DPIC\"\n                pic=yes\n            fi\n            ;;\n        -f|-fbin|-faout|-faoutb|-fcoff|-felf|-felf64|-fas86| \\\n        -fobj|-fwin32|-fwin64|-frdf|-fieee|-fmacho|-fmacho64)\n            # it's a file format specifier for nasm.\n            command=\"$command $1\"\n            ;;\n        -f*)\n            # maybe a code-generation flag for gcc.\n            ;;\n        -[Ii]*)\n            incdir=`echo \"$1\" | sed 's/^-[Ii]//'`\n            if [ \"x$incdir\" = x -a \"x$2\" != x ] ; then\n                case \"$2\" in\n                    -*) ;;\n                    *) incdir=\"$2\"; shift;;\n                esac\n            fi\n            if [ \"x$incdir\" != x ] ; then\n                # In the case of NASM, the trailing slash is necessary.\n                incdir=`echo \"$incdir\" | sed 's%/*$%/%'`\n                command=\"$command -I$incdir\"\n            fi\n            ;;\n        -o*)\n            o_opt=yes\n            command=\"$command $1\"\n            ;;\n        *.asm)\n            infile=$1\n            command=\"$command $1\"\n            ;;\n        *)\n            command=\"$command $1\"\n            ;;\n    esac\n    shift\ndone\nif [ \"$o_opt\" != yes ] ; then\n    # By default, NASM creates an output file\n    # in the same directory as the input file.\n    outfile=\"-o `echo $infile | sed -e 's%^.*/%%' -e 's%\\.[^.]*$%%'`.o\"\n    command=\"$command $outfile\"\nfi\necho $command\nexec $command\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/structure.txt",
    "content": "IJG JPEG LIBRARY:  SYSTEM ARCHITECTURE\n\nThis file was part of the Independent JPEG Group's software:\nCopyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.\nIt was modified by The libjpeg-turbo Project to include only information\nrelevant to libjpeg-turbo.\nFor conditions of distribution and use, see the accompanying README.ijg file.\n\n\nThis file provides an overview of the architecture of the IJG JPEG software;\nthat is, the functions of the various modules in the system and the interfaces\nbetween modules.  For more precise details about any data structure or calling\nconvention, see the include files and comments in the source code.\n\nWe assume that the reader is already somewhat familiar with the JPEG standard.\nThe README.ijg file includes references for learning about JPEG.  The file\nlibjpeg.txt describes the library from the viewpoint of an application\nprogrammer using the library; it's best to read that file before this one.\nAlso, the file coderules.txt describes the coding style conventions we use.\n\nIn this document, JPEG-specific terminology follows the JPEG standard:\n  A \"component\" means a color channel, e.g., Red or Luminance.\n  A \"sample\" is a single component value (i.e., one number in the image data).\n  A \"coefficient\" is a frequency coefficient (a DCT transform output number).\n  A \"block\" is an 8x8 group of samples or coefficients.\n  An \"MCU\" (minimum coded unit) is an interleaved set of blocks of size\n        determined by the sampling factors, or a single block in a\n        noninterleaved scan.\nWe do not use the terms \"pixel\" and \"sample\" interchangeably.  When we say\npixel, we mean an element of the full-size image, while a sample is an element\nof the downsampled image.  Thus the number of samples may vary across\ncomponents while the number of pixels does not.  (This terminology is not used\nrigorously throughout the code, but it is used in places where confusion would\notherwise result.)\n\n\n*** System features ***\n\nThe IJG distribution contains two parts:\n  * A subroutine library for JPEG compression and decompression.\n  * cjpeg/djpeg, two sample applications that use the library to transform\n    JFIF JPEG files to and from several other image formats.\ncjpeg/djpeg are of no great intellectual complexity: they merely add a simple\ncommand-line user interface and I/O routines for several uncompressed image\nformats.  This document concentrates on the library itself.\n\nWe desire the library to be capable of supporting all JPEG baseline, extended\nsequential, and progressive DCT processes.  Hierarchical processes are not\nsupported.\n\nThe library does not support the lossless (spatial) JPEG process.  Lossless\nJPEG shares little or no code with lossy JPEG, and would normally be used\nwithout the extensive pre- and post-processing provided by this library.\nWe feel that lossless JPEG is better handled by a separate library.\n\nWithin these limits, any set of compression parameters allowed by the JPEG\nspec should be readable for decompression.  (We can be more restrictive about\nwhat formats we can generate.)  Although the system design allows for all\nparameter values, some uncommon settings are not yet implemented and may\nnever be; nonintegral sampling ratios are the prime example.  Furthermore,\nwe treat 8-bit vs. 12-bit data precision as a compile-time switch, not a\nrun-time option, because most machines can store 8-bit pixels much more\ncompactly than 12-bit.\n\nBy itself, the library handles only interchange JPEG datastreams --- in\nparticular the widely used JFIF file format.  The library can be used by\nsurrounding code to process interchange or abbreviated JPEG datastreams that\nare embedded in more complex file formats.  (For example, libtiff uses this\nlibrary to implement JPEG compression within the TIFF file format.)\n\nThe library includes a substantial amount of code that is not covered by the\nJPEG standard but is necessary for typical applications of JPEG.  These\nfunctions preprocess the image before JPEG compression or postprocess it after\ndecompression.  They include colorspace conversion, downsampling/upsampling,\nand color quantization.  This code can be omitted if not needed.\n\nA wide range of quality vs. speed tradeoffs are possible in JPEG processing,\nand even more so in decompression postprocessing.  The decompression library\nprovides multiple implementations that cover most of the useful tradeoffs,\nranging from very-high-quality down to fast-preview operation.  On the\ncompression side we have generally not provided low-quality choices, since\ncompression is normally less time-critical.  It should be understood that the\nlow-quality modes may not meet the JPEG standard's accuracy requirements;\nnonetheless, they are useful for viewers.\n\n\n*** System overview ***\n\nThe compressor and decompressor are each divided into two main sections:\nthe JPEG compressor or decompressor proper, and the preprocessing or\npostprocessing functions.  The interface between these two sections is the\nimage data that the official JPEG spec regards as its input or output: this\ndata is in the colorspace to be used for compression, and it is downsampled\nto the sampling factors to be used.  The preprocessing and postprocessing\nsteps are responsible for converting a normal image representation to or from\nthis form.  (Those few applications that want to deal with YCbCr downsampled\ndata can skip the preprocessing or postprocessing step.)\n\nLooking more closely, the compressor library contains the following main\nelements:\n\n  Preprocessing:\n    * Color space conversion (e.g., RGB to YCbCr).\n    * Edge expansion and downsampling.  Optionally, this step can do simple\n      smoothing --- this is often helpful for low-quality source data.\n  JPEG proper:\n    * MCU assembly, DCT, quantization.\n    * Entropy coding (sequential or progressive, Huffman or arithmetic).\n\nIn addition to these modules we need overall control, marker generation,\nand support code (memory management & error handling).  There is also a\nmodule responsible for physically writing the output data --- typically\nthis is just an interface to fwrite(), but some applications may need to\ndo something else with the data.\n\nThe decompressor library contains the following main elements:\n\n  JPEG proper:\n    * Entropy decoding (sequential or progressive, Huffman or arithmetic).\n    * Dequantization, inverse DCT, MCU disassembly.\n  Postprocessing:\n    * Upsampling.  Optionally, this step may be able to do more general\n      rescaling of the image.\n    * Color space conversion (e.g., YCbCr to RGB).  This step may also\n      provide gamma adjustment [ currently it does not ].\n    * Optional color quantization (e.g., reduction to 256 colors).\n    * Optional color precision reduction (e.g., 24-bit to 15-bit color).\n      [This feature is not currently implemented.]\n\nWe also need overall control, marker parsing, and a data source module.\nThe support code (memory management & error handling) can be shared with\nthe compression half of the library.\n\nThere may be several implementations of each of these elements, particularly\nin the decompressor, where a wide range of speed/quality tradeoffs is very\nuseful.  It must be understood that some of the best speedups involve\nmerging adjacent steps in the pipeline.  For example, upsampling, color space\nconversion, and color quantization might all be done at once when using a\nlow-quality ordered-dither technique.  The system architecture is designed to\nallow such merging where appropriate.\n\n\nNote: it is convenient to regard edge expansion (padding to block boundaries)\nas a preprocessing/postprocessing function, even though the JPEG spec includes\nit in compression/decompression.  We do this because downsampling/upsampling\ncan be simplified a little if they work on padded data: it's not necessary to\nhave special cases at the right and bottom edges.  Therefore the interface\nbuffer is always an integral number of blocks wide and high, and we expect\ncompression preprocessing to pad the source data properly.  Padding will occur\nonly to the next block (8-sample) boundary.  In an interleaved-scan situation,\nadditional dummy blocks may be used to fill out MCUs, but the MCU assembly and\ndisassembly logic will create or discard these blocks internally.  (This is\nadvantageous for speed reasons, since we avoid DCTing the dummy blocks.\nIt also permits a small reduction in file size, because the compressor can\nchoose dummy block contents so as to minimize their size in compressed form.\nFinally, it makes the interface buffer specification independent of whether\nthe file is actually interleaved or not.)  Applications that wish to deal\ndirectly with the downsampled data must provide similar buffering and padding\nfor odd-sized images.\n\n\n*** Poor man's object-oriented programming ***\n\nIt should be clear by now that we have a lot of quasi-independent processing\nsteps, many of which have several possible behaviors.  To avoid cluttering the\ncode with lots of switch statements, we use a simple form of object-style\nprogramming to separate out the different possibilities.\n\nFor example, two different color quantization algorithms could be implemented\nas two separate modules that present the same external interface; at runtime,\nthe calling code will access the proper module indirectly through an \"object\".\n\nWe can get the limited features we need while staying within portable C.\nThe basic tool is a function pointer.  An \"object\" is just a struct\ncontaining one or more function pointer fields, each of which corresponds to\na method name in real object-oriented languages.  During initialization we\nfill in the function pointers with references to whichever module we have\ndetermined we need to use in this run.  Then invocation of the module is done\nby indirecting through a function pointer; on most machines this is no more\nexpensive than a switch statement, which would be the only other way of\nmaking the required run-time choice.  The really significant benefit, of\ncourse, is keeping the source code clean and well structured.\n\nWe can also arrange to have private storage that varies between different\nimplementations of the same kind of object.  We do this by making all the\nmodule-specific object structs be separately allocated entities, which will\nbe accessed via pointers in the master compression or decompression struct.\nThe \"public\" fields or methods for a given kind of object are specified by\na commonly known struct.  But a module's initialization code can allocate\na larger struct that contains the common struct as its first member, plus\nadditional private fields.  With appropriate pointer casting, the module's\ninternal functions can access these private fields.  (For a simple example,\nsee jdatadst.c, which implements the external interface specified by struct\njpeg_destination_mgr, but adds extra fields.)\n\n(Of course this would all be a lot easier if we were using C++, but we are\nnot yet prepared to assume that everyone has a C++ compiler.)\n\nAn important benefit of this scheme is that it is easy to provide multiple\nversions of any method, each tuned to a particular case.  While a lot of\nprecalculation might be done to select an optimal implementation of a method,\nthe cost per invocation is constant.  For example, the upsampling step might\nhave a \"generic\" method, plus one or more \"hardwired\" methods for the most\npopular sampling factors; the hardwired methods would be faster because they'd\nuse straight-line code instead of for-loops.  The cost to determine which\nmethod to use is paid only once, at startup, and the selection criteria are\nhidden from the callers of the method.\n\nThis plan differs a little bit from usual object-oriented structures, in that\nonly one instance of each object class will exist during execution.  The\nreason for having the class structure is that on different runs we may create\ndifferent instances (choose to execute different modules).  You can think of\nthe term \"method\" as denoting the common interface presented by a particular\nset of interchangeable functions, and \"object\" as denoting a group of related\nmethods, or the total shared interface behavior of a group of modules.\n\n\n*** Overall control structure ***\n\nWe previously mentioned the need for overall control logic in the compression\nand decompression libraries.  In IJG implementations prior to v5, overall\ncontrol was mostly provided by \"pipeline control\" modules, which proved to be\nlarge, unwieldy, and hard to understand.  To improve the situation, the\ncontrol logic has been subdivided into multiple modules.  The control modules\nconsist of:\n\n1. Master control for module selection and initialization.  This has two\nresponsibilities:\n\n   1A.  Startup initialization at the beginning of image processing.\n        The individual processing modules to be used in this run are selected\n        and given initialization calls.\n\n   1B.  Per-pass control.  This determines how many passes will be performed\n        and calls each active processing module to configure itself\n        appropriately at the beginning of each pass.  End-of-pass processing,\n        where necessary, is also invoked from the master control module.\n\n   Method selection is partially distributed, in that a particular processing\n   module may contain several possible implementations of a particular method,\n   which it will select among when given its initialization call.  The master\n   control code need only be concerned with decisions that affect more than\n   one module.\n\n2. Data buffering control.  A separate control module exists for each\n   inter-processing-step data buffer.  This module is responsible for\n   invoking the processing steps that write or read that data buffer.\n\nEach buffer controller sees the world as follows:\n\ninput data => processing step A => buffer => processing step B => output data\n                      |              |               |\n              ------------------ controller ------------------\n\nThe controller knows the dataflow requirements of steps A and B: how much data\nthey want to accept in one chunk and how much they output in one chunk.  Its\nfunction is to manage its buffer and call A and B at the proper times.\n\nA data buffer control module may itself be viewed as a processing step by a\nhigher-level control module; thus the control modules form a binary tree with\nelementary processing steps at the leaves of the tree.\n\nThe control modules are objects.  A considerable amount of flexibility can\nbe had by replacing implementations of a control module.  For example:\n* Merging of adjacent steps in the pipeline is done by replacing a control\n  module and its pair of processing-step modules with a single processing-\n  step module.  (Hence the possible merges are determined by the tree of\n  control modules.)\n* In some processing modes, a given interstep buffer need only be a \"strip\"\n  buffer large enough to accommodate the desired data chunk sizes.  In other\n  modes, a full-image buffer is needed and several passes are required.\n  The control module determines which kind of buffer is used and manipulates\n  virtual array buffers as needed.  One or both processing steps may be\n  unaware of the multi-pass behavior.\n\nIn theory, we might be able to make all of the data buffer controllers\ninterchangeable and provide just one set of implementations for all.  In\npractice, each one contains considerable special-case processing for its\nparticular job.  The buffer controller concept should be regarded as an\noverall system structuring principle, not as a complete description of the\ntask performed by any one controller.\n\n\n*** Compression object structure ***\n\nHere is a sketch of the logical structure of the JPEG compression library:\n\n                                                 |-- Colorspace conversion\n                  |-- Preprocessing controller --|\n                  |                              |-- Downsampling\nMain controller --|\n                  |                            |-- Forward DCT, quantize\n                  |-- Coefficient controller --|\n                                               |-- Entropy encoding\n\nThis sketch also describes the flow of control (subroutine calls) during\ntypical image data processing.  Each of the components shown in the diagram is\nan \"object\" which may have several different implementations available.  One\nor more source code files contain the actual implementation(s) of each object.\n\nThe objects shown above are:\n\n* Main controller: buffer controller for the subsampled-data buffer, which\n  holds the preprocessed input data.  This controller invokes preprocessing to\n  fill the subsampled-data buffer, and JPEG compression to empty it.  There is\n  usually no need for a full-image buffer here; a strip buffer is adequate.\n\n* Preprocessing controller: buffer controller for the downsampling input data\n  buffer, which lies between colorspace conversion and downsampling.  Note\n  that a unified conversion/downsampling module would probably replace this\n  controller entirely.\n\n* Colorspace conversion: converts application image data into the desired\n  JPEG color space; also changes the data from pixel-interleaved layout to\n  separate component planes.  Processes one pixel row at a time.\n\n* Downsampling: performs reduction of chroma components as required.\n  Optionally may perform pixel-level smoothing as well.  Processes a \"row\n  group\" at a time, where a row group is defined as Vmax pixel rows of each\n  component before downsampling, and Vk sample rows afterwards (remember Vk\n  differs across components).  Some downsampling or smoothing algorithms may\n  require context rows above and below the current row group; the\n  preprocessing controller is responsible for supplying these rows via proper\n  buffering.  The downsampler is responsible for edge expansion at the right\n  edge (i.e., extending each sample row to a multiple of 8 samples); but the\n  preprocessing controller is responsible for vertical edge expansion (i.e.,\n  duplicating the bottom sample row as needed to make a multiple of 8 rows).\n\n* Coefficient controller: buffer controller for the DCT-coefficient data.\n  This controller handles MCU assembly, including insertion of dummy DCT\n  blocks when needed at the right or bottom edge.  When performing\n  Huffman-code optimization or emitting a multiscan JPEG file, this\n  controller is responsible for buffering the full image.  The equivalent of\n  one fully interleaved MCU row of subsampled data is processed per call,\n  even when the JPEG file is noninterleaved.\n\n* Forward DCT and quantization: Perform DCT, quantize, and emit coefficients.\n  Works on one or more DCT blocks at a time.  (Note: the coefficients are now\n  emitted in normal array order, which the entropy encoder is expected to\n  convert to zigzag order as necessary.  Prior versions of the IJG code did\n  the conversion to zigzag order within the quantization step.)\n\n* Entropy encoding: Perform Huffman or arithmetic entropy coding and emit the\n  coded data to the data destination module.  Works on one MCU per call.\n  For progressive JPEG, the same DCT blocks are fed to the entropy coder\n  during each pass, and the coder must emit the appropriate subset of\n  coefficients.\n\nIn addition to the above objects, the compression library includes these\nobjects:\n\n* Master control: determines the number of passes required, controls overall\n  and per-pass initialization of the other modules.\n\n* Marker writing: generates JPEG markers (except for RSTn, which is emitted\n  by the entropy encoder when needed).\n\n* Data destination manager: writes the output JPEG datastream to its final\n  destination (e.g., a file).  The destination manager supplied with the\n  library knows how to write to a stdio stream or to a memory buffer;\n  for other behaviors, the surrounding application may provide its own\n  destination manager.\n\n* Memory manager: allocates and releases memory, controls virtual arrays\n  (with backing store management, where required).\n\n* Error handler: performs formatting and output of error and trace messages;\n  determines handling of nonfatal errors.  The surrounding application may\n  override some or all of this object's methods to change error handling.\n\n* Progress monitor: supports output of \"percent-done\" progress reports.\n  This object represents an optional callback to the surrounding application:\n  if wanted, it must be supplied by the application.\n\nThe error handler, destination manager, and progress monitor objects are\ndefined as separate objects in order to simplify application-specific\ncustomization of the JPEG library.  A surrounding application may override\nindividual methods or supply its own all-new implementation of one of these\nobjects.  The object interfaces for these objects are therefore treated as\npart of the application interface of the library, whereas the other objects\nare internal to the library.\n\nThe error handler and memory manager are shared by JPEG compression and\ndecompression; the progress monitor, if used, may be shared as well.\n\n\n*** Decompression object structure ***\n\nHere is a sketch of the logical structure of the JPEG decompression library:\n\n                                               |-- Entropy decoding\n                  |-- Coefficient controller --|\n                  |                            |-- Dequantize, Inverse DCT\nMain controller --|\n                  |                               |-- Upsampling\n                  |-- Postprocessing controller --|   |-- Colorspace conversion\n                                                  |-- Color quantization\n                                                  |-- Color precision reduction\n\nAs before, this diagram also represents typical control flow.  The objects\nshown are:\n\n* Main controller: buffer controller for the subsampled-data buffer, which\n  holds the output of JPEG decompression proper.  This controller's primary\n  task is to feed the postprocessing procedure.  Some upsampling algorithms\n  may require context rows above and below the current row group; when this\n  is true, the main controller is responsible for managing its buffer so as\n  to make context rows available.  In the current design, the main buffer is\n  always a strip buffer; a full-image buffer is never required.\n\n* Coefficient controller: buffer controller for the DCT-coefficient data.\n  This controller handles MCU disassembly, including deletion of any dummy\n  DCT blocks at the right or bottom edge.  When reading a multiscan JPEG\n  file, this controller is responsible for buffering the full image.\n  (Buffering DCT coefficients, rather than samples, is necessary to support\n  progressive JPEG.)  The equivalent of one fully interleaved MCU row of\n  subsampled data is processed per call, even when the source JPEG file is\n  noninterleaved.\n\n* Entropy decoding: Read coded data from the data source module and perform\n  Huffman or arithmetic entropy decoding.  Works on one MCU per call.\n  For progressive JPEG decoding, the coefficient controller supplies the prior\n  coefficients of each MCU (initially all zeroes), which the entropy decoder\n  modifies in each scan.\n\n* Dequantization and inverse DCT: like it says.  Note that the coefficients\n  buffered by the coefficient controller have NOT been dequantized; we\n  merge dequantization and inverse DCT into a single step for speed reasons.\n  When scaled-down output is asked for, simplified DCT algorithms may be used\n  that emit fewer samples per DCT block, not the full 8x8.  Works on one DCT\n  block at a time.\n\n* Postprocessing controller: buffer controller for the color quantization\n  input buffer, when quantization is in use.  (Without quantization, this\n  controller just calls the upsampler.)  For two-pass quantization, this\n  controller is responsible for buffering the full-image data.\n\n* Upsampling: restores chroma components to full size.  (May support more\n  general output rescaling, too.  Note that if undersized DCT outputs have\n  been emitted by the DCT module, this module must adjust so that properly\n  sized outputs are created.)  Works on one row group at a time.  This module\n  also calls the color conversion module, so its top level is effectively a\n  buffer controller for the upsampling->color conversion buffer.  However, in\n  all but the highest-quality operating modes, upsampling and color\n  conversion are likely to be merged into a single step.\n\n* Colorspace conversion: convert from JPEG color space to output color space,\n  and change data layout from separate component planes to pixel-interleaved.\n  Works on one pixel row at a time.\n\n* Color quantization: reduce the data to colormapped form, using either an\n  externally specified colormap or an internally generated one.  This module\n  is not used for full-color output.  Works on one pixel row at a time; may\n  require two passes to generate a color map.  Note that the output will\n  always be a single component representing colormap indexes.  In the current\n  design, the output values are JSAMPLEs, so an 8-bit compilation cannot\n  quantize to more than 256 colors.  This is unlikely to be a problem in\n  practice.\n\n* Color reduction: this module handles color precision reduction, e.g.,\n  generating 15-bit color (5 bits/primary) from JPEG's 24-bit output.\n  Not quite clear yet how this should be handled... should we merge it with\n  colorspace conversion???\n\nNote that some high-speed operating modes might condense the entire\npostprocessing sequence to a single module (upsample, color convert, and\nquantize in one step).\n\nIn addition to the above objects, the decompression library includes these\nobjects:\n\n* Master control: determines the number of passes required, controls overall\n  and per-pass initialization of the other modules.  This is subdivided into\n  input and output control: jdinput.c controls only input-side processing,\n  while jdmaster.c handles overall initialization and output-side control.\n\n* Marker reading: decodes JPEG markers (except for RSTn).\n\n* Data source manager: supplies the input JPEG datastream.  The source\n  manager supplied with the library knows how to read from a stdio stream\n  or from a memory buffer;  for other behaviors, the surrounding application\n  may provide its own source manager.\n\n* Memory manager: same as for compression library.\n\n* Error handler: same as for compression library.\n\n* Progress monitor: same as for compression library.\n\nAs with compression, the data source manager, error handler, and progress\nmonitor are candidates for replacement by a surrounding application.\n\n\n*** Decompression input and output separation ***\n\nTo support efficient incremental display of progressive JPEG files, the\ndecompressor is divided into two sections that can run independently:\n\n1. Data input includes marker parsing, entropy decoding, and input into the\n   coefficient controller's DCT coefficient buffer.  Note that this\n   processing is relatively cheap and fast.\n\n2. Data output reads from the DCT coefficient buffer and performs the IDCT\n   and all postprocessing steps.\n\nFor a progressive JPEG file, the data input processing is allowed to get\narbitrarily far ahead of the data output processing.  (This occurs only\nif the application calls jpeg_consume_input(); otherwise input and output\nrun in lockstep, since the input section is called only when the output\nsection needs more data.)  In this way the application can avoid making\nextra display passes when data is arriving faster than the display pass\ncan run.  Furthermore, it is possible to abort an output pass without\nlosing anything, since the coefficient buffer is read-only as far as the\noutput section is concerned.  See libjpeg.txt for more detail.\n\nA full-image coefficient array is only created if the JPEG file has multiple\nscans (or if the application specifies buffered-image mode anyway).  When\nreading a single-scan file, the coefficient controller normally creates only\na one-MCU buffer, so input and output processing must run in lockstep in this\ncase.  jpeg_consume_input() is effectively a no-op in this situation.\n\nThe main impact of dividing the decompressor in this fashion is that we must\nbe very careful with shared variables in the cinfo data structure.  Each\nvariable that can change during the course of decompression must be\nclassified as belonging to data input or data output, and each section must\nlook only at its own variables.  For example, the data output section may not\ndepend on any of the variables that describe the current scan in the JPEG\nfile, because these may change as the data input section advances into a new\nscan.\n\nThe progress monitor is (somewhat arbitrarily) defined to treat input of the\nfile as one pass when buffered-image mode is not used, and to ignore data\ninput work completely when buffered-image mode is used.  Note that the\nlibrary has no reliable way to predict the number of passes when dealing\nwith a progressive JPEG file, nor can it predict the number of output passes\nin buffered-image mode.  So the work estimate is inherently bogus anyway.\n\nNo comparable division is currently made in the compression library, because\nthere isn't any real need for it.\n\n\n*** Data formats ***\n\nArrays of pixel sample values use the following data structure:\n\n    typedef something JSAMPLE;          a pixel component value, 0..MAXJSAMPLE\n    typedef JSAMPLE *JSAMPROW;          ptr to a row of samples\n    typedef JSAMPROW *JSAMPARRAY;       ptr to a list of rows\n    typedef JSAMPARRAY *JSAMPIMAGE;     ptr to a list of color-component arrays\n\nThe basic element type JSAMPLE will typically be one of unsigned char,\n(signed) char, or short.  Short will be used if samples wider than 8 bits are\nto be supported (this is a compile-time option).  Otherwise, unsigned char is\nused if possible.  If the compiler only supports signed chars, then it is\nnecessary to mask off the value when reading.  Thus, all reads of JSAMPLE\nvalues must be coded as \"GETJSAMPLE(value)\", where the macro will be defined\nas \"((value) & 0xFF)\" on signed-char machines and \"((int) (value))\" elsewhere.\n\nWith these conventions, JSAMPLE values can be assumed to be >= 0.  This helps\nsimplify correct rounding during downsampling, etc.  The JPEG standard's\nspecification that sample values run from -128..127 is accommodated by\nsubtracting 128 from the sample value in the DCT step.  Similarly, during\ndecompression the output of the IDCT step will be immediately shifted back to\n0..255.  (NB: different values are required when 12-bit samples are in use.\nThe code is written in terms of MAXJSAMPLE and CENTERJSAMPLE, which will be\ndefined as 255 and 128 respectively in an 8-bit implementation, and as 4095\nand 2048 in a 12-bit implementation.)\n\nWe use a pointer per row, rather than a two-dimensional JSAMPLE array.  This\nchoice costs only a small amount of memory and has several benefits:\n* Code using the data structure doesn't need to know the allocated width of\n  the rows.  This simplifies edge expansion/compression, since we can work\n  in an array that's wider than the logical picture width.\n* Indexing doesn't require multiplication; this is a performance win on many\n  machines.\n* Arrays with more than 64K total elements can be supported even on machines\n  where malloc() cannot allocate chunks larger than 64K.\n* The rows forming a component array may be allocated at different times\n  without extra copying.  This trick allows some speedups in smoothing steps\n  that need access to the previous and next rows.\n\nNote that each color component is stored in a separate array; we don't use the\ntraditional layout in which the components of a pixel are stored together.\nThis simplifies coding of modules that work on each component independently,\nbecause they don't need to know how many components there are.  Furthermore,\nwe can read or write each component to a temporary file independently, which\nis helpful when dealing with noninterleaved JPEG files.\n\nIn general, a specific sample value is accessed by code such as\n        GETJSAMPLE(image[colorcomponent][row][col])\nwhere col is measured from the image left edge, but row is measured from the\nfirst sample row currently in memory.  Either of the first two indexings can\nbe precomputed by copying the relevant pointer.\n\n\nSince most image-processing applications prefer to work on images in which\nthe components of a pixel are stored together, the data passed to or from the\nsurrounding application uses the traditional convention: a single pixel is\nrepresented by N consecutive JSAMPLE values, and an image row is an array of\n(# of color components)*(image width) JSAMPLEs.  One or more rows of data can\nbe represented by a pointer of type JSAMPARRAY in this scheme.  This scheme is\nconverted to component-wise storage inside the JPEG library.  (Applications\nthat want to skip JPEG preprocessing or postprocessing will have to contend\nwith component-wise storage.)\n\n\nArrays of DCT-coefficient values use the following data structure:\n\n    typedef short JCOEF;                a 16-bit signed integer\n    typedef JCOEF JBLOCK[DCTSIZE2];     an 8x8 block of coefficients\n    typedef JBLOCK *JBLOCKROW;          ptr to one horizontal row of 8x8 blocks\n    typedef JBLOCKROW *JBLOCKARRAY;     ptr to a list of such rows\n    typedef JBLOCKARRAY *JBLOCKIMAGE;   ptr to a list of color component arrays\n\nThe underlying type is at least a 16-bit signed integer; while \"short\" is big\nenough on all machines of interest, on some machines it is preferable to use\n\"int\" for speed reasons, despite the storage cost.  Coefficients are grouped\ninto 8x8 blocks (but we always use #defines DCTSIZE and DCTSIZE2 rather than\n\"8\" and \"64\").\n\nThe contents of a coefficient block may be in either \"natural\" or zigzagged\norder, and may be true values or divided by the quantization coefficients,\ndepending on where the block is in the processing pipeline.  In the current\nlibrary, coefficient blocks are kept in natural order everywhere; the entropy\ncodecs zigzag or dezigzag the data as it is written or read.  The blocks\ncontain quantized coefficients everywhere outside the DCT/IDCT subsystems.\n(This latter decision may need to be revisited to support variable\nquantization a la JPEG Part 3.)\n\nNotice that the allocation unit is now a row of 8x8 blocks, corresponding to\neight rows of samples.  Otherwise the structure is much the same as for\nsamples, and for the same reasons.\n\n\n*** Suspendable processing ***\n\nIn some applications it is desirable to use the JPEG library as an\nincremental, memory-to-memory filter.  In this situation the data source or\ndestination may be a limited-size buffer, and we can't rely on being able to\nempty or refill the buffer at arbitrary times.  Instead the application would\nlike to have control return from the library at buffer overflow/underrun, and\nthen resume compression or decompression at a later time.\n\nThis scenario is supported for simple cases.  (For anything more complex, we\nrecommend that the application \"bite the bullet\" and develop real multitasking\ncapability.)  The libjpeg.txt file goes into more detail about the usage and\nlimitations of this capability; here we address the implications for library\nstructure.\n\nThe essence of the problem is that the entropy codec (coder or decoder) must\nbe prepared to stop at arbitrary times.  In turn, the controllers that call\nthe entropy codec must be able to stop before having produced or consumed all\nthe data that they normally would handle in one call.  That part is reasonably\nstraightforward: we make the controller call interfaces include \"progress\ncounters\" which indicate the number of data chunks successfully processed, and\nwe require callers to test the counter rather than just assume all of the data\nwas processed.\n\nRather than trying to restart at an arbitrary point, the current Huffman\ncodecs are designed to restart at the beginning of the current MCU after a\nsuspension due to buffer overflow/underrun.  At the start of each call, the\ncodec's internal state is loaded from permanent storage (in the JPEG object\nstructures) into local variables.  On successful completion of the MCU, the\npermanent state is updated.  (This copying is not very expensive, and may even\nlead to *improved* performance if the local variables can be registerized.)\nIf a suspension occurs, the codec simply returns without updating the state,\nthus effectively reverting to the start of the MCU.  Note that this implies\nleaving some data unprocessed in the source/destination buffer (ie, the\ncompressed partial MCU).  The data source/destination module interfaces are\nspecified so as to make this possible.  This also implies that the data buffer\nmust be large enough to hold a worst-case compressed MCU; a couple thousand\nbytes should be enough.\n\nIn a successive-approximation AC refinement scan, the progressive Huffman\ndecoder has to be able to undo assignments of newly nonzero coefficients if it\nsuspends before the MCU is complete, since decoding requires distinguishing\npreviously-zero and previously-nonzero coefficients.  This is a bit tedious\nbut probably won't have much effect on performance.  Other variants of Huffman\ndecoding need not worry about this, since they will just store the same values\nagain if forced to repeat the MCU.\n\nThis approach would probably not work for an arithmetic codec, since its\nmodifiable state is quite large and couldn't be copied cheaply.  Instead it\nwould have to suspend and resume exactly at the point of the buffer end.\n\nThe JPEG marker reader is designed to cope with suspension at an arbitrary\npoint.  It does so by backing up to the start of the marker parameter segment,\nso the data buffer must be big enough to hold the largest marker of interest.\nAgain, a couple KB should be adequate.  (A special \"skip\" convention is used\nto bypass COM and APPn markers, so these can be larger than the buffer size\nwithout causing problems; otherwise a 64K buffer would be needed in the worst\ncase.)\n\nThe JPEG marker writer currently does *not* cope with suspension.\nWe feel that this is not necessary; it is much easier simply to require\nthe application to ensure there is enough buffer space before starting.  (An\nempty 2K buffer is more than sufficient for the header markers; and ensuring\nthere are a dozen or two bytes available before calling jpeg_finish_compress()\nwill suffice for the trailer.)  This would not work for writing multi-scan\nJPEG files, but we simply do not intend to support that capability with\nsuspension.\n\n\n*** Memory manager services ***\n\nThe JPEG library's memory manager controls allocation and deallocation of\nmemory, and it manages large \"virtual\" data arrays on machines where the\noperating system does not provide virtual memory.  Note that the same\nmemory manager serves both compression and decompression operations.\n\nIn all cases, allocated objects are tied to a particular compression or\ndecompression master record, and they will be released when that master\nrecord is destroyed.\n\nThe memory manager does not provide explicit deallocation of objects.\nInstead, objects are created in \"pools\" of free storage, and a whole pool\ncan be freed at once.  This approach helps prevent storage-leak bugs, and\nit speeds up operations whenever malloc/free are slow (as they often are).\nThe pools can be regarded as lifetime identifiers for objects.  Two\npools/lifetimes are defined:\n  * JPOOL_PERMANENT     lasts until master record is destroyed\n  * JPOOL_IMAGE         lasts until done with image (JPEG datastream)\nPermanent lifetime is used for parameters and tables that should be carried\nacross from one datastream to another; this includes all application-visible\nparameters.  Image lifetime is used for everything else.  (A third lifetime,\nJPOOL_PASS = one processing pass, was originally planned.  However it was\ndropped as not being worthwhile.  The actual usage patterns are such that the\npeak memory usage would be about the same anyway; and having per-pass storage\nsubstantially complicates the virtual memory allocation rules --- see below.)\n\nThe memory manager deals with three kinds of object:\n1. \"Small\" objects.  Typically these require no more than 10K-20K total.\n2. \"Large\" objects.  These may require tens to hundreds of K depending on\n   image size.  Semantically they behave the same as small objects, but we\n   distinguish them because pool allocation heuristics may differ for large and\n   small objects (historically, large objects were also referenced by far\n   pointers on MS-DOS machines.)  Note that individual \"large\" objects cannot\n   exceed the size allowed by type size_t, which may be 64K or less on some\n   machines.\n3. \"Virtual\" objects.  These are large 2-D arrays of JSAMPLEs or JBLOCKs\n   (typically large enough for the entire image being processed).  The\n   memory manager provides stripwise access to these arrays.  On machines\n   without virtual memory, the rest of the array may be swapped out to a\n   temporary file.\n\n(Note: JSAMPARRAY and JBLOCKARRAY data structures are a combination of large\nobjects for the data proper and small objects for the row pointers.  For\nconvenience and speed, the memory manager provides single routines to create\nthese structures.  Similarly, virtual arrays include a small control block\nand a JSAMPARRAY or JBLOCKARRAY working buffer, all created with one call.)\n\nIn the present implementation, virtual arrays are only permitted to have image\nlifespan.  (Permanent lifespan would not be reasonable, and pass lifespan is\nnot very useful since a virtual array's raison d'etre is to store data for\nmultiple passes through the image.)  We also expect that only \"small\" objects\nwill be given permanent lifespan, though this restriction is not required by\nthe memory manager.\n\nIn a non-virtual-memory machine, some performance benefit can be gained by\nmaking the in-memory buffers for virtual arrays be as large as possible.\n(For small images, the buffers might fit entirely in memory, so blind\nswapping would be very wasteful.)  The memory manager will adjust the height\nof the buffers to fit within a prespecified maximum memory usage.  In order\nto do this in a reasonably optimal fashion, the manager needs to allocate all\nof the virtual arrays at once.  Therefore, there isn't a one-step allocation\nroutine for virtual arrays; instead, there is a \"request\" routine that simply\nallocates the control block, and a \"realize\" routine (called just once) that\ndetermines space allocation and creates all of the actual buffers.  The\nrealize routine must allow for space occupied by non-virtual large objects.\n(We don't bother to factor in the space needed for small objects, on the\ngrounds that it isn't worth the trouble.)\n\nTo support all this, we establish the following protocol for doing business\nwith the memory manager:\n  1. Modules must request virtual arrays (which may have only image lifespan)\n     during the initial setup phase, i.e., in their jinit_xxx routines.\n  2. All \"large\" objects (including JSAMPARRAYs and JBLOCKARRAYs) must also be\n     allocated during initial setup.\n  3. realize_virt_arrays will be called at the completion of initial setup.\n     The above conventions ensure that sufficient information is available\n     for it to choose a good size for virtual array buffers.\nSmall objects of any lifespan may be allocated at any time.  We expect that\nthe total space used for small objects will be small enough to be negligible\nin the realize_virt_arrays computation.\n\nIn a virtual-memory machine, we simply pretend that the available space is\ninfinite, thus causing realize_virt_arrays to decide that it can allocate all\nthe virtual arrays as full-size in-memory buffers.  The overhead of the\nvirtual-array access protocol is very small when no swapping occurs.\n\nA virtual array can be specified to be \"pre-zeroed\"; when this flag is set,\nnever-yet-written sections of the array are set to zero before being made\navailable to the caller.  If this flag is not set, never-written sections\nof the array contain garbage.  (This feature exists primarily because the\nequivalent logic would otherwise be needed in jdcoefct.c for progressive\nJPEG mode; we may as well make it available for possible other uses.)\n\nThe first write pass on a virtual array is required to occur in top-to-bottom\norder; read passes, as well as any write passes after the first one, may\naccess the array in any order.  This restriction exists partly to simplify\nthe virtual array control logic, and partly because some file systems may not\nsupport seeking beyond the current end-of-file in a temporary file.  The main\nimplication of this restriction is that rearrangement of rows (such as\nconverting top-to-bottom data order to bottom-to-top) must be handled while\nreading data out of the virtual array, not while putting it in.\n\n\n*** Memory manager internal structure ***\n\nTo isolate system dependencies as much as possible, we have broken the\nmemory manager into two parts.  There is a reasonably system-independent\n\"front end\" (jmemmgr.c) and a \"back end\" that contains only the code\nlikely to change across systems.  All of the memory management methods\noutlined above are implemented by the front end.  The back end provides\nthe following routines for use by the front end (none of these routines\nare known to the rest of the JPEG code):\n\njpeg_mem_init, jpeg_mem_term    system-dependent initialization/shutdown\n\njpeg_get_small, jpeg_free_small interface to malloc and free library routines\n                                (or their equivalents)\n\njpeg_get_large, jpeg_free_large historically was used to interface with\n                                FAR malloc/free on MS-DOS machines;  now the\n                                same as jpeg_get_small/jpeg_free_small\n\njpeg_mem_available              estimate available memory\n\njpeg_open_backing_store         create a backing-store object\n\nread_backing_store,             manipulate a backing-store object\nwrite_backing_store,\nclose_backing_store\n\nOn some systems there will be more than one type of backing-store object\n(specifically, in MS-DOS a backing store file might be an area of extended\nmemory as well as a disk file).  jpeg_open_backing_store is responsible for\nchoosing how to implement a given object.  The read/write/close routines\nare method pointers in the structure that describes a given object; this\nlets them be different for different object types.\n\nIt may be necessary to ensure that backing store objects are explicitly\nreleased upon abnormal program termination.  For example, MS-DOS won't free\nextended memory by itself.  To support this, we will expect the main program\nor surrounding application to arrange to call self_destruct (typically via\njpeg_destroy) upon abnormal termination.  This may require a SIGINT signal\nhandler or equivalent.  We don't want to have the back end module install its\nown signal handler, because that would pre-empt the surrounding application's\nability to control signal handling.\n\nThe IJG distribution includes several memory manager back end implementations.\nUsually the same back end should be suitable for all applications on a given\nsystem, but it is possible for an application to supply its own back end at\nneed.\n\n\n*** Implications of DNL marker ***\n\nSome JPEG files may use a DNL marker to postpone definition of the image\nheight (this would be useful for a fax-like scanner's output, for instance).\nIn these files the SOF marker claims the image height is 0, and you only\nfind out the true image height at the end of the first scan.\n\nWe could read these files as follows:\n1. Upon seeing zero image height, replace it by 65535 (the maximum allowed).\n2. When the DNL is found, update the image height in the global image\n   descriptor.\nThis implies that control modules must avoid making copies of the image\nheight, and must re-test for termination after each MCU row.  This would\nbe easy enough to do.\n\nIn cases where image-size data structures are allocated, this approach will\nresult in very inefficient use of virtual memory or much-larger-than-necessary\ntemporary files.  This seems acceptable for something that probably won't be a\nmainstream usage.  People might have to forgo use of memory-hogging options\n(such as two-pass color quantization or noninterleaved JPEG files) if they\nwant efficient conversion of such files.  (One could improve efficiency by\ndemanding a user-supplied upper bound for the height, less than 65536; in most\ncases it could be much less.)\n\nThe standard also permits the SOF marker to overestimate the image height,\nwith a DNL to give the true, smaller height at the end of the first scan.\nThis would solve the space problems if the overestimate wasn't too great.\nHowever, it implies that you don't even know whether DNL will be used.\n\nThis leads to a couple of very serious objections:\n1. Testing for a DNL marker must occur in the inner loop of the decompressor's\n   Huffman decoder; this implies a speed penalty whether the feature is used\n   or not.\n2. There is no way to hide the last-minute change in image height from an\n   application using the decoder.  Thus *every* application using the IJG\n   library would suffer a complexity penalty whether it cared about DNL or\n   not.\nWe currently do not support DNL because of these problems.\n\nA different approach is to insist that DNL-using files be preprocessed by a\nseparate program that reads ahead to the DNL, then goes back and fixes the SOF\nmarker.  This is a much simpler solution and is probably far more efficient.\nEven if one wants piped input, buffering the first scan of the JPEG file needs\na lot smaller temp file than is implied by the maximum-height method.  For\nthis approach we'd simply treat DNL as a no-op in the decompressor (at most,\ncheck that it matches the SOF image height).\n\nWe will not worry about making the compressor capable of outputting DNL.\nSomething similar to the first scheme above could be applied if anyone ever\nwants to make that work.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/testimages/nightshot_iso_100.txt",
    "content": "libjpeg-turbo note:  This image was extracted from the 8-bit nightshot_iso_100\nimage.  The original can be downloaded at the link below.\n\nThe New Image Compression Test Set - Jan 2008\nhttp://www.imagecompression.info/test_images\n\nThe images historically used for compression research (lena, barbra, pepper etc...) have outlived their useful life and its about time they become a part of history only. They are too small, come from data sources too old and are available in only 8-bit precision.\n\nThese images have been carefully selected to aid in image compression algorithm research and evaluation. These are photographic images chosen to come from a wide variety of sources and each one picked to stress different aspects of algorithms. Images are available in 8-bit, 16-bit and 16-bit linear variations, RGB and gray.\n\nImages are available without any prohibitive copyright restrictions.\n\nThese images are (c) there respective owners. You are granted full redistribution and publication rights on these images provided:\n\n1. The origin of the pictures must not be misrepresented; you must not claim that you took the original pictures. If you use, publish or redistribute them, an acknowledgment would be appreciated but is not required.\n2. Altered versions must be plainly marked as such, and must not be misinterpreted as being the originals.\n3. No payment is required for distribution this material, it must be available freely under the conditions stated here. That is, it is prohibited to sell the material.\n4. This notice may not be removed or altered from any distribution.\n\nAcknowledgments: A lot of people contributed a lot of time and effort in making this test set possible. Thanks to everyone who voiced their opinion in any of the discussions online. Thanks to Axel Becker, Thomas Richter and Niels Fröhling for their extensive help in picking images, running all the various tests etc... Thanks to Pete Fraser, Tony Story, Wayne J. Cosshall, David Coffin, Bruce Lindbloom and raw.fotosite.pl for the images which make up this set.\n\nSachin Garg [India]\nsachingarg@c10n.info\n\nwww.sachingarg.com | www.c10n.info | www.imagecompression.info\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/testimages/testorig.ppm",
    "content": "P6\n227 149\n255\n0/-0/-10.21/51.51.62/62/83/83/:2/:2/:3-:3-:3-:3-:2/:2/91.80-80-91.:2/:2/80-80-80-80-80-80-80-80-6.+6.+6.+5-*5-*5-*4,)4,)4,)4,)4,)4,)4,)4,)4,)2-)/*$/,%0-&0-&1.'2/(30)30)63,63,74-85.96/96/:70:7.A:0B<0D>2F@4IA4JB5KC6KC6NE6MD5OC3NB2OC3OC3PD4RE5R?1Y?2b@4nB5}E6H8G9F7H;F;F;F=G>H@H@EBFLCLEMEICIBD?C=A;A:@:?<??B?@?<A7=/@.@.?-?-@-?-@-?.A.A-B,A-@+A+A,>-?/?/>.>,>,<+<+>->-=*=*>+>+?,@/?6>5=4?3B3D3D4D4?0B3F:H;G;oA2U9+C3&=52:659548437116005//5//72/72/72/61.61-61-50,41,//-.0-//-//-0/-0/-2.-2.-5,-4+,4*+3)*7(+=.1E69P:<jAE|HJNOOQW[dnot{~tz`aTKvQEiSJgPH_MH^TQbfdo|}{|lfgWYXFQNEUR[UQbUQb0/-0/-10.10.40-51.62/62/83/83/:2/:2/:3-:3-:3-:3-:2/91.80-80-80-80-91.:2/80-80-80-80-80-80-80-80-6.+6.+6.+5-*5-*4,)4,)4,)5-*5-*5-*5-*5-*5-*5-*3.*1,(0-&0-&1.'2/(30)41*41*63,63,74-85.85.96/:70:7.@9/B<0C=1E?3H@3IA4JB5JB5LC4LC4MA3MA1MA1NB2OC3QD4P>0U?1^A3jC4xD6F5E5C3C4A4@6B7D:E<F=C@EIBICIDHDGCE@C?C;A:@:?<??@@@@<@6>/@.?-?-?-?,?-@-?.A.A-B,@,@+@*A,>-?/?/>.>,=+<+<+>-=,=*=*=*>+?,@1A6?6>5?4A3D4C4D5A2C6F:H=G:l@3S9*B4)>63:65:6584382271160060072/72/72/61.61-61-50,41,//-.0-//-//-0/-0/-2.-2.-4..5,-5+,3)*5)+<-0C47N8:d=>vDCJIMNTVajl}r{{ou[[RIvOCiOFePH`PH_RN_[Yfnot~qjk[][LVSJXSZVRaXQa/.,0/-0/-10.40/40/51.51.72.72.72.72.92,92,92,92,91.80.80.7/-7/-80.80.91/80.80.80.80.80.80.80.80.6.,6.,5-+5-+5-+4,*4,*4,*6.,6.,6.,6.,6.,6.,6.,4/+2-)1.)2/*30+30+41,52-52-63.63.74/74/850961961:70?8.@:.B<0D>2G?4H@5H@3H@3J@4I@1K?1K?1K?1L@2MA1NB2MA3QA2YB4dC4qC4|C2B2A0<-;,;.=2@6D:F=D>CE@FBGCGDFCEAD?D;@:?;@=@@@B>@;@5=.@-@-@-?-?->,@,?-@-@.@-A,@+@*@+>-?/>.>.>.=-=+=+>,>,<+<+=,>-?.?0A6?5>3?3A4C5D5C5D8G<I=J=G;h@4Q:,B5,?74=77<66;5594183072/72/62/62/62/51.52-52-41,21,/1.-2./1./1.00.00.10.3/.5//4..5,-4*+4*+9-/>24I56[97l?:}FAIDOM[`fvnw}}u~glUUMEvLAkMAeOFcQHcNI_NK\\[[esty|xzlfhZZ[MVSLZU[ZT`[S`.-+/.,/.,0/-3/.40/40-51.61-61-61-61-81+81+81+80-80.7/-6.,6.,6.,6.,7/-80.80.80.80.80.80.80.80.80.5-+5-+5-+5-+4,*4,*3+)3+)6.,6.,6.,6.,6.,6.,6.,4/,30+30+30+41,41,52-52-52-52-63.63.74/85096196196/>7-?9-A;/B<0E=2E=2F>3F>1G=1G=1H<.I=/I=/J>0L@0JA0LE5NE4VE5^D3iD2sB1~A/?-9)9'9*=.@3E8H<F>DCACBEDEDEBC@C?A;@:?<A>@A@B=@9@3>.@,@,@,>,?,?,?+@-?,@-?,@+@*@)?*>,>.>.>.=-=-<*<*=+=+=+=+<+>,>-?/A6@6>2@4B6C8C7B7F<J?KBJ@|F:b@4L:.A7-@85>88=77<66:5294183083062/62/62/32.52-32-21,12--2.-2./1./1.00.00.10.10.5106005//5,-4+,6,-:01D22T71c;3rB8{E;IERU_lis}yx}owaeSRMDyL@pL@hPEgQFfLC^HCWNLZ^^fjnquyxy~xzvwzokoa`bUWYLTTL]WY]V]]V^------/.,/.,0/-10.3/,40-40-40-50,50,50,50,7/,7/,4/,4/,3.+3.+3.+3.+4/,4/,50-50-50-50-50-50-50-50-3.+3.+3.+2-*2-*1,)1,)1,)4/,4/,4/,4/,4/,4/,4/,4/,41,41,41,41,52-52-52-52-52-52-63.74/74/85096196/<5-=6,?8.@9/B90C;0C;0C;0E;/D:.F:.G;/H<.I=/J>0I@1JG6MH5RG5YF5bE3jD1uB/|?,;):):*=,B2F8J=J@GBDCDDEDCCAA=@<>:?;=<>?>B>C:A5?0?-@-?,?,?.>->-?->.?-?,?+?,?+>*?+>,?.?.>->-=,=,=,=,=,=,=,<,>->.@/B4A4@4@3A7C9B:A9C;H?LCKCtE;Z>2E9-=6,A96@86?75>64=53<4294183062/43/43/23.32.23.12-02--2.,2.-2.-2./1./1.00.10.3205105104..2,,5,-7./>0/N5.Y9.e=1oA4tC<yKKZehpzxu{lt_dTTOGLBwNAmNBhMAeJA`GBYHEXKKWMPU^bc`fbbia`f\\Z`VWZOUXMXXP^YV`WX`WZ,,,,,,.-+/.,/.,0/-3/.3/,2.+2.+3.*3.*3.*3.*5-*5-*3.+3.+2-*2-*2-*2-*3.+3.+3.+3.+3.+3.+3.+3.+3.+3.+3.+2-*2-*2-*1,)1,)1,)0+(4/,4/,4/,4/,4/,4/,4/,4/,40-41,41,41,41,41,41,41,41,52-52-63.74/85085096/;4,<5+=6,?8.@7.A8/A8/A9.C9/C9-E9-F:.G;/I=/J>0HA1JG6JI7NG5VF6\\E3dC2lA0t?-|=,<*;*=,@1F5J:J=H@EAFAE@CAA?>?;=;<:;<=@=C=C8@2?-?,@,@,?+?->,>,?,>-@-?,?-?+>*>)?*?,>->->-=,=,=,<+=,<+<+<+<-=,>/?0B4B3A3B5C9C:B:B<B:HBNGNEpH>T@5A;/96-@85A75?75>63=5394194173043/43/34/23.23.13.02-.3--3/-3/.3/.3/02/02/11/11/21/32032040/2.-1-,4..8.,G4-O4)X8+`<0e?6mGFyYdku||w|nudh[[SLLB~OArL@hI=cH>`HB^ECX@BO<AGCHKDMJJQJJQIIPHKQGOUKVWO^YS`YS`XU+++,,,,,,---/-.0/-0/-0/-1-*1-*1-*1-*2-)2-)2-)2-)2-*2,,1++1++1++1++2,,2,,1++1++1++1++1++1++1++1++2,,2,,2,,1++1++1++0**0**3--3--3--3--3--3--3--3.+40-40-40-40-3/,3/,3/,3/,40-40-51.62/730730841850:3-;4,<5-=6.?6/?6-?6-?6-C90C9/E8/F90G:1I=1J>2H@3HE6GE6KE5QD4YD3_B2g@/n=,v=,|:*9+:,=.B2F7F8G=F>F>E>D@C?@@>>::;:<<A<C;D6@/=)?-@-@-@->.>.=->-=.?.?-?-?,?+?*>)>+>->-=,=.=.<-<-<-=-;,<,</>.>1?/C4B3A3B6C:D=C=C=GBQKYSXQsRIWI>CC7<?6>93@72>63=60:5194083/63.43.43.34/23.13.13.02-.3--3/-3/.3/.3/.3/.3/02/02/00.11/22021/10./.,2.-4/,?0+D0)K3)T8-Z<4eGGu]js~tzmpeeVSLCK?qJ=hG;cE>_FB]DBW?AN;?H:BE>HGDMHGQIGQHJRGNVKUXM^ZOaYNaXO++++++,,,---.,-/-.0/-0/-1-,1-*1-*1-*2-)2-)2-)2-*2,,1++1++0**0**1++1++2,,0**0**0**0**0**0**0**0**2,,2,,2,,1++1++0**0**0**2,,2,,2,,2,,2,,2,,2,,2,,3/,3/,3/,3/,3/,3/,3/,3/,40-40-51.62/62/73084185092,:3+;4,<5->5.>5.>5.>5,B8/B8/E80F90G:1I<3J=4I?5FB6FB6JB5OA4UB3\\@2c?1j<-q<.w9*}8)7*:,>0B4B5F:E;F>G?G@FACAB@;;;;>;B;D:D4A.>(A-A-A-@.@.?-?->/>.@.?.?->+?*>)>+>->->-=,=.<-<-=-=-=/<.<.</=0>1?1D4C3B4C6C;D>D@EAPL[Tf]f]u_T[UIHNBCI?<92?82>71;6094.74-63.43.43.43.34/23.13.13..3-.3-.3/-3/.3/.3/.3/.3/02/02///-11/22022010.0/-0/-3/,8,,<-*C0*K70S<6^HJtbnzƄztwjlYWIDE=nG<dD<aC>^CAY@CV@DP>EKGQRKWUQ^WU`XT`VS]TT^SY_S^[LaZJaZJ,-/,-/--/--/------.,-.-+/.,/.,1-*0,)0,)0,)/+(/+(/+*/+*/+*/+*/+*/+*0,+0,+/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*0,+0,+1-,1-,2.-2.-2.-1-,1-,1-,1-,1-,1-,0,)1-*2.+3/,3/,3/,3/,3/,3/,3/,3/,3/,40-51.62/73080-92,:3-;4.=4/>5.>5.>5.@5/@6-B5-C6.D7/F91H;3G=4G>5H@5J@6P?5T>3X<1^90c7,m9.t8-|8-9.;/=0?1>0A3A4C8E:G=G>E?C@@?BADAE>D8B1A.B,A.@-?,>.=-=->.?/<,=,<->-=,=+=*=,<+<+=-<,<,<,:-;-=/=0=0=0>3@4A5A4E5D4E9I>G@D>EAMG[Sf_qfsh~rdjj^V^SJRGLLBJF=B>5=90:6-74+63,33+54/34.34/23.02-/1,.0-,1--2.-2.-2.-2./1./1./1./1.02/02/11/11/11/11/11/40/4+0;/3A32C41J;8]NQym{ϐكtzjn`cZ[LItHBdA>]>>X?BUAIVLU\\U`bbqno~yv|svlyohth_k_W_P^]Ib\\Fc]G,-/,-/--/--/------.,-.,-/.,/.,0,+0,)0,)/+(/+(/+(.*).*).*)/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*/+*0,+0,+1-,1-,1-,1-,1-,1-,1-,1-,1-,1-,1-,0,+1-*2.+2.+3/,3/,3/,2.+2.+2.+2.+2.+3/,40-62/62/80.91.:2/;4.=4/>50>50>5.?4.?4.B5/B5-D7/E80G:2H;3H>5H>5L=6O>6R>5V;2Z90_7/i81p7.x8.8/:/<1<1=1@3A3C6D8E:F<E=C>D@EAGBG>F:D3B/B-C.A/@.?-?-?->.?/=,>,=-=,=+>+=,=,<+=+<,<,<,;+;-<-</=/=1=1?3@6B8B6G9F8G<JBHDGCKHTNd\\qf~oo|mmseZfZNXMLNCKI=EC7A>5=:188.44,11)23-23-12-01,/1,/1,.0-.0-/1.-2./1./1./1./1./1./1.02/02/11/11/11/11/11/2015+49-7<15?54I?=^UVys}ʐԄyqykthn]`XZqSUjRWjT^hZgmfvvrt~~wzrqftgZeT[ZE`ZBb\\D-.0-.0-.0-.0-.0-.0.......,-.-+.-+-,*/+*.*).*'.*',+),*+,*+,*+,*+,*++)*+)*-+,-+,-+,-+,-+,-+,-+,-+,,*+-+,-+,-+,-+,.,-.,-.,-.,-/-./-./-./-./-./-./.,0,+0,+1-,2.-2.-2.-2.-1-,1-,1-,1-,1-,2.-3/.40/51.80.91/:20<41=31>42=31=4/?40?4.A4.A4.C60D71F93G:4H;5J;6K<7N=6P;6S:5W83[6.c60k6.t5,}7/9/;0<2=2@6@4@3@3C6D8E<D<F@HBIBI?E:C3B0A.B/A/?.>->->->/?0<-=-<.=.>-=,=.=-<,<,<,<,;-<-:-;-<0<0<2>3?4A8C:D9J=H;H>KDKFLGSM`Vsgqz{wsocqbXcUNRDMN@HI;DD8@@4:</46+/1&12*01+/0+/0+./*/0+//-//-//-.0-//-//-//-//-//-//-00.00.00.00.00.00.00.1/26+98,:8/4;63HE@_^Yzy~Ǆ}{|}}yq~o~n~~py|{j{k\\hTXX@]Y>_[@-.0-.0-.0-.0-.0-.0.......,-.,--,*-,*/+*.*).*'.*),*+,*++)*+)*+)*+)**()*(),*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+-+,-+,-+,-+,.,-.,-.,-.,-.,-/-./-./-./+*0,+1-,1-,1-,1-,0,+0,+0,+0,+0,+0,+1-,2.-3/.40/91/:20;31<42=31=31=31=31>3/>3/@2/@3-A4.C60D71E82F93H94I:5J;6L:6N94Q83T50^72e60o6/x8/90;2<2=3@7?4?2?1A2B5C9E:H?H@JAH@F:B5A0@.A/@.?->,>,>,=.?/=-=,=.=-=,=+=-<,<,;+;+;+;,;,;-;,;/<1=2>5@7C:D<E<KBH>G@JELIQL]Vj^oyzxm{lbm_SZJQUFKO@EI:@D6;=057,13(01)/0(./*.-).-)/.*0/-0/-0/-0/-0/-0/-0/-//-0/-//-10.00.10.00.00.00.00.3.27,:6*83-1961HJ?bfX{z}~}k|iXfOSU=ZV;^Z?+/2+/2-.2-.2-.0-.0..0..0------.-+-,*-,*-,*,+),+),*+,*+,*++)*+)**()*()*(),*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*+,*++)*+)*-+,-+,-+,.,-.,-/-./-./-./+*0,+0,+1-,0,+0,+/+*/+*0,+/+*/+*0,+0,+2.-3/.40/:12:12;31<42=32=32<20<20>31=2.?1.?1.@2/A30B41C52D63C84D95E:6G96H94K84N50X72_60i70s80}:1<1>2>2@6?5?5?3@3C5C6E8E;G=H>G=D8A5@1@/@-@-?.>-=,=-=/=/<.;-</<.<-=-;.<.;+;+:*:*;,:+:,:.:0<1=4?6B9D=F@H?KCH?GAKGPLYRf]vhw~}tqjue\\eTV_LNUCEL:?F6<@27:/58-12*/0(.-)/+(/+*0,+1-,2.-1-,1-,1-,1-,1-,/.,1-,/.,2.-0/-2.-0/-0/-0/-0/-2-18,:5)51++66,GL8aiRzp{xgzdTbIQT9VU9YX<,03,03./3./3./1./1//1//1....../.,.-+.-+.-+-,*-,*.,--+,-+,,*++)*+)**()*(),*+,*+,*+,*+,*+,*+,*+,*+,*+,*++)*+)*+)**()*()*(),*+,*+,*+-+,.,-/-./-./-./+*/+*0,+0,+0,+/+*.*)-)(0,+0,+0,+0,+1-,2.-3/.40/:12;23;31<42=32=32<21<20=20=20>0->0-?1.@2/A30?40@51@72@93A:4B94C84F74H5/Q51X5/a6/l8-v:/</>0=1?5>5?5?4B4B4C4D4B5D8E:E;B7@5>1>0?.@,>-=,<+<+<.<.;-<-<.;-<-<,;-;-:*:*:*:):+9+9-9-<1<3?6A8C<F?IBICIBG@HDOKVS`Zper}~~zuq|kdp\\]iUR^JJS@BK:>E5<@29<134,22*1-*/+(/))0**1++2,,1++1++1++1++1++0,+0,+0,+1-,1-,1-,1-,/.,/.,/.,2,.8*75(13+(56&EK1\\gGudyťέɭɰ˱Ȭ{wrdx]R`FNR7QQ5SR6,03,03,03,03./1./1./1./1000//////////.,/.,/.,.-+/-./-..,--+,,*++)*+)**()+)*+)*+)*+)*+)*+)*+)*+)*,*++)*+)*+)**()*())'()'(+)*+)*,*+-+,.,-/-./-.0.//+*/+*/+*/+*/+*.*)-)(,('0,+0,+0,+0,+1-,3/.40/510:12;23<34<34=34<21<21;10<1/<1/>0/=/.>0-?1.@2/>3/=52;62;83<94=:5>93@72C60G4.O4-Y4,d5+n8,x:-;.;.<4<5>3@3A2B1A2A1>1@4B7B9A7>5>3?2?-?->,=+;,<-<-<-;.;.<.;-;.:-;-;,9)9):):)9*9+~8,~8,=2=4@7B9E>HCKFMFICGAJHSO]Zhb{ny~wxnjwcdr[ZgSQ]IKTCEL<@D6<?467/44,3/,1,)1()1()3*+4+,2)*2)*2)*2)*2)*0**0**0**1++1++0,+0,+0,+0,+0,+1+-6)25)-4-%46!BI'Wc;qWm}ȔНӫҮѭ˥{{tqk_sWM]BIO3JM0KK/./1,01./1./1.0/.0/.0////00.00.00.10.0/-0/+/.,1-,2.-1-,1-,0,+/+,,*++)*+)*+)*+)*+)*+)*+)*+)*+),+)*+),+)*-(,*(),())'()'()'(+)*+)*,*+-,*.,-.-+/.,0/--,*-,*/+*/+*/+*.*),(',('1-,2-*2-*2-*3.+4/,50-61.;31;31<42<42=32<21;10;1/<1/<1/=/.=/.=/,>0-?1.=2.=4/=60;81::29:49:4;81?61C2+J1,T1+^3,g7-o9-u=.{=0=4=3?2@2@3@1?1=/</>2B6C7B7?4>2?2>/=.=-<,<.=.=.>/<.<.</;.;.:-:,;,:+:+;+~;+~;+|:,}9,|:.>2>5@7C:G?KCOHOGHEHFOL[Vg`uiu~|ytoj~ccz^]qXWfOO\\HIRAAH8>@399/85.7/,3+)2()2()3)*4*+0*,/+*0*,0**0*,0*,2),2),3*-1+-1+-1+-0,-0,-0,-1+/5*05+,4-%46!?F%T`8n}Rgtz~z{Ĉːəǝƚ~xvolfZnSJZ@GM3FJ1DF./0+.0+/0+01,01,12-12-21-43/43/43/62/51.41,3/,4/,50-50-4/,3.+3--1-,0,+0,+.,-.,-..0--/,,.++-*).))+.)/.)-/(/.)-/)-.)-.*+.*+/+*/+*-,*.-)--+./*./*./*------.,-/-./.,0/-2.+2.+2-*4,)5-*6.+90+:1,;2+;2+=4-=4->50>50>50=4/<3.<3.=2.<1-<1/;0.=/.>0/>0/@1.A0)@1*;4*77-39/39/560:3-?-+F*'L)'S*&Z/(`5,d<0k@0yA2A0A2B3@3=0;/8-;/>/A1B2C2A0>.;.:2:2;1>1?0?/?.>.@1?0>1<0;/:.:-;-{9+~@3w<.q7)w=/w=/v;-}?2{;/@4E<JALBMBPENEKISRb[oc}jq|~u{ouiib_[zXZsU[mSWeNPWEJK=C?6@93;0.6**4(*3'+3'+1&*,*-)+***,*(),'+.(,1(-2'-3(.3(.3(02(00)00)0/*1/*0/)-1++0-(//#<?,V\\BpzXgusvwvu{}|{~}~|yurmh|cYkUN[GIP>CH4?B/01+01+01+01+12,12,21,32-43.43.74/74/63.52-50,50,7/,7/,6.,6.,3.+2-*1-,0,+/-./-./-0..0-,1+*/)*.)(-.)//(//(//(//)-/)-.*+.*+/+*0,+.-).-)./*./*./)/0+.....0....../.,/.,2.+3.+5-*5-*7.)8/(:/)<1+<2)=3*>5,>5,>5.?6/>5.=4-=4/<3.=2.<1-<1/;0.=/.>0/>00@1.C0*C0)A2+>3-:5/94.:2/<1/?-+D*)I*(N+'T/)Z5-`;2e=1pA1x@/A0@2?4>4;3;19.</=0@0A1A1B2@2;2;2<2=0?1@/?/?.@1>/=0<.;.;,;-;,x8,x<1t:.n9+t?/s>.r8*u:,}=1A5E<H?KBMBPCOFJHSRf]wipww}oveiaaZ[Y{X\\wXZnSSaJNUCFH;C@7<737/-3*+2)*1(+.(*,*-**,+),+),-(,/)-2(02(04)13)13)21*20+2.+2.+4.+22-13/.0,)--%8:-SXDox]iolnpppw|xwy||{xuqnh{eYjWN[IEL<@D5;=/12,12,12,23-23-23-43.43.54/65085085085074/72.72.80-80-7/,7/,4/,3.+1-,1-,1-.0./0.1/-0..0,,.+*/+)./(/1'//)-/)-/)-/)-.*+.*+0,+0,+/.*/.*0/*0/*/0*/0+//-///0./0./0/-/.,1-*2-*6.+7/,90+:1*<1+=3*>4+?5,?6-@7.@7.@7.?6/>5.=4/=4/=2.<1-<1/;0.;0.<1/<1/?1.C2+E0+H/+K--L,/K+.I*/E+.A-,@.*A.(F/)N/*X1*b3-g5.j:,o;-x<1=4<6<5:4:4;4=2>2?3@4B6B5C6?2=/>1>.>/?-=.<,;.<,:-;+;,<)~=+{<+}=1z<1v:/v<0x@1x@1v<.v;-?5C9F=H?JALBNENFKITQf\\whnt{}yximae\\a\\`^a[|]UrVQgPHYGBPA:D93:2.3,+0**,)**(1(+1&*1&*1&*0'*1(+2).1+//*.-+.,+0+,0)-0(-0(-1)-01/23/./+(**\"57*QVBmu]|ik~jloo~mqx|zxvvuwyy}}ywtpmh{eYkUN[IDH9>@399-23-23-34.34.45/45/54/54/761761:72:72:72961:51940:2/:2/91.80-50-50-3/.3/.3/03/01/01/20.1..0--/-+.0)02).0*.0*.0*.0*,/+,/+*1-,2.-0/+0/+10+10+01+12-11/1111/010.10.2.+3.+3.*91.92,;2+<3,?5,@6-A7.A7.B8/A8/B90A8/A81@70>50>50=2.=2.<1/<1/<1/<1/=20=2.B3.E2.M//R+0W(0U&.P'/I).C/.<1+;2+?2)H1)S0*_.*d/)i9/k;/u<3}<6<9;9;7:6>9?9B9B9B9B9A7B6@1A/A/@.>-<,<,:+9+9*:*:)<){=(x>(x>*>3{7.z7.z<1v;-w=/|A3{@2B7E:H=I@KAMBOFQHSK\\Qh[tbgm~v|~}yqojifgfeggde_~_\\v[PhRK^KBPA8D62:/.4*,/(+*%2&(5%(4%(2&(1&*/)+/+,.,-++-*+-*+-(,-(,/',/',/*+-/+,1++0+(/,%99-PTCiqYve{hyh|kn}oyk{mrtq}p}p~s~v~x}x|x}zzwuqnje|bXlSN[GDF9?=1:8,45/45/45/560560671761761872983;83<94<94<94<73<73<41<41;30;3083072/61.61.5106216213123121/00./1-.2,04+.4+.4+.2,.2,,2,,2,,3/.3/,3/,40-21,21,32-32.22022032032051051.61.61-;30<5/>5.?6-A7.B8/E8/C9/E;2E;2E;2D:1C90B8/A60@5/>3/>3/=2.=2.=20=20>31>31@51F42M02T,4X)3W(2R)1K,1B30:6-77-:6*B4)M2)X/)^/)f:1j;3s<7z=:<:<;;;::;7>8@:C<C:C:@9@7C2C1B0?/>/<.:-9-8,8+9+:+~=+x>*v?*x=+9-|/'8/>4w4+t6+}A6}C7E:G<I>KBKBMDRHWJ}`N{iQpYu]|biu|~{}zwzp{lylwkumsmmgkd`rZ[hTR[JIM>@@4;7,70&5*$6('5''3''1'&.((,+)++)+-*(,+(,+*,+*,+++-,*-,*-.*+,#$3+(50*85,BC5UZFfpWn}^teqbuexivjshtiwkznxlwmxn{s{u{w|wyuzwwtsomhd{_WkPN[GCC7>:195,560671671671782782872983983:94=:5>;6>;6>;6>95>95?74?74>63>63;63:5294194184195495484384343151240/6-06-.6-06-.4..4..4..4/,40-40-40-51.32-32-43.43.43/442542540841850:51:5/>71>7/@7.A8/C90D:0G:1H;2G=4G=4F<3F<3E;2C90B71A60@51@51?40?40?42?42@53?53@72D63I35P16T/6S.5P05J22C52=90<:.=9-C7)I6(Q3)W2)]2+d3,l50v64}77877777~75}:4}<6~?8?9@8?;A8C4C1B1@0=/;.:.9-9,9,:,<,|=,y>,x?,|=,4,2,LEXQA8|90F;K=yH:zJ<{M@|NA}OBQEUJ_LrkOptS|uXw]ybiszz|~{y~vpoppr{pwmtlj~cfv\\_hSV[GOM>GA3A7+=0';,'9+(6+)3+(/,',-'+-().().(+-(-,*/+*3)*4(*7'*7'(3($<3,E>4IG:QR@^cMgqVjyZo^k\\l]pbqeodoerfumrjqitnxrzvyvyvvtwvurokkfc|^UlON\\ECC7@91;4,782782782782893893:94:94:94;:5>;6?<7@=8@=8@;7@;7B:7B:7A96@85=84=84<73<73<73<74<74<74;639529338308/09/.8/080.80.80.61.61-61-61-52-63.63.63.74/54/540651841952;74<94=84@93@70A8/C90D:0G:1H<0I=1J>2J=4J=4J=4I<3F<3D:1C90B8/A81A81@72?61?61@72A83A83?74@85B86E:8G96I:7H96H94E80E8/E9-E9+G9,I9*K9+Q7*Z/&d/'n3-z6398;9;:=;A>@:>7<4:3<4=8@9A5B3@2?2=1<0;/</=/}>/|>/|>/|>/}>/=/9/1+;8kf~yZTD=LAN@tJ<rN>pQ?qR@tSB{WG[J~eOmsOpzUy[u_ocmfqkwowz~~yvrrrrt}sxptpmiiedx]]kRV^GMP;ED0B;+@3+?2,;0,70*30)00(./)./)01+30+7-,;+,?),D',F%,D'+F5-LC4VP@[XE`bLgmSjxWj{Wl[gWgZl^ocnanbrfskpjoirnvsyxxwvvssuvsrnlkdb{[UmMN\\CGH:E<5@707827828938938939:4:94:94;:5<;6?<7@=8@=8@=8A<8A<8D<9C;8C;8B:7?:6>95>95=84>95>95>95>95=85<73:52<41:0/:0.91/91.91/91.91.72.61-61-63.63.63.74/74/74/540651952;83<94?:4B;5C<4A8/B:/D:0E;/H<0I=1J>2J>2K>5K>5K>5J=4F<3E;2C90B8/B92B92A83A83A83A83B94A:4@85A96B;5D=7F=8G<6K<5N;4M6.O7-Q6+Q6+R8+P9+P9)W7(f6*r6,~;3@9D@HDJGLFQJLDD;<17-8.91=6>5>7=6<5<5=4}=3z>3x@3vA3x@3z>3<3:38442(&=;{zhcG@K@xH:nM<jQ=fT>hV@lWBt[E`LhP{rQvUt\\l^__V\\Q[T\\ouzx̆~}xvrtuuuusr|nyju{anpZgbN_TBUE5R</O4-N2.I0,D/*>/(9/&7.'6/'92*;0*>/,B-,G*,I),L'.I)*TB6YQ<d^HgeLilOnuVm{Xl~Xn[hVgXm]pbqbrdvitlqkojrmwvzxxytuuuuusrokjeb{[UmMM]BMN@KB;F=69:49:49:49:4:;5;<6=<7=<7=<7=<7@=8@=8A>9B?:D?;D?;E@<E@<E@<D?;D?9C>8E>8E>8B;5B;5B;5B;5B:7B;5B:7A:4A75A83A75@72@64>71>71>71<71<71;60:5/96185074/74/961961961:72<73>93A:2B;1C:1D<1F<2J>2L@4L@2N@3N@5N@7N@7L?6K>5J=4H;2F<3E;2B90B90@91?80?82?82@93@93<5/MD?M@:K:3T?:S73O0+a<6\\3-`5.`4+^/'^/%f6,m=1q=0J>G;I?KAF>>7>7D;NDQFWKYKOBA5;0>698:9655284?8|@6r>1rB4oA2q=0w;17243-1',HIbaEDWUyvVOF<VFnS>i[AibFjeHj`En^D|dLjTbLl]nhX];L-E+H0L@YI\\[enr{|ۀ}ۃ؉~wwxxxyyxo~mxiocbYUM{IBxA>u:<i.2d04b14P&'G%#L0-M51G4.E2,D1-F1.F.,G+*K-/Q51YH6`V;f_CgdEkoNu|Zu]oYlWlZp_ratcudwfxhqisotqroutyx{|yzxysrmlkgidazZTmMO_DNOASJAQH?9:49:49:49:4:;5;<6>=8?>9>=8>=8A>9A>9B?:C@;D?;D?;FA=FA=E@<E@<D?9D?9E>8E>8E>8E>8E>8D=5D=7C<4D;4C:3B92B92B92B92B94A83@93@93>71<71<71;6096185085074/961961961:70<71>:1A:0B<0C;0E;/I=1J>0L@2L@2N@3N@3N@5N@7M?6K>5I<3H;2E;2E;2C:1B90A:2@91@93@93A:4B94E:4J71L.,V..j68u9;{;;ECE@IAIAH?IBNHPLOGD7B4B6D9>37-7-=2C5@1@0D5G6F6H:NELMHL@D9;98>:@8x>3o>0zI;LA?8-,).9DLWKNMM>=@?`\\YQ@5UEyaIe[@_^@ihIslOvgJ~dKcNdX_[UZAN,E&E&H'I.N3N<RI[P^Q]S]Xbbkfliomqqrutxwyw||yzvxqtkrfnak_k`nSaLXGQELEIm69H\u001c\u001bT1-M0*I2,J6/L92K:2O>7UE8[O7cZ;hbBifEnrO{^zbt^r_p_p`r`udwdwdwfskxt|x{x}z|rqmjhd`y[TmMP`ERSCVPDUOC8938938939:4;<6=>8?>9@?:@?:@?:C@;C@;C@;C@;E@<E@<FA;FA;FA;FA;E@:E@:G@8G@8JA:I@9I@9H?6F=6E<3F<3E;2D:1D:1D:1D:1D;4D;4D;4C<4?80?80<71;60;60:5/94.94.96/96/:5/;7.>7/@9/C:1C;0E;1F<0I=1K?1M?2NA1P@1P@3P?5M?4L>3K=2I<3H;2E;1E;1D;2C:1B;1A:0?;2@<3A=4D;4VE>U4/j25AGLWUb]f_cB>I?LANDQLUROSLM@6B0@0?1;.7+8+=/E6=-7$:'>-A1C2E;02:BDLLRMRKLA>71{8/v6,x2*1-37=GGWM[FI53:931NKc]K@[J}cLk`DgdEtoOpSgLhNhYbbQZDQ7I2K2N/M+I2O0K1J5N5N2K3L8Q@ZC[F_IaNcQfTjVkSjRiPjNiNlPoSsVug`}[uUlZmdrR]r-2^&'Y0,W:4Q?5C;.:8)>B3LN9VO3aV6e_?heDquTeixdxiuetdrcveyhzizjvzypmhc_vYTmMPcGTWDYVGYVG7827828939:4;<6=>8@?:A@;BA<BA<DA<DA<DA<DA<E@<E@<GB<GB<GB<GB<FA;FA;HA9HA9LC<KB9JA8I@7H>5G=3F<2E;1D:0D:0E;1E;2D;2E<3E<5E<5@91?80=82<71;60;60:5/:5/:70:70;7.;7.?8.@9/C;0D</F<0G>/J>0K?/M@0NA1P@1O?0O?2O>4L>3K=2J<3H;2E;1D:0D;2D;2B;1@<1@<3A=4B>5G=4S81[*&;@T`TeTgUcJO41;0?1A3F=IGBH?CB7F5B3@3?3>3B4E7G7B1<);(;*:*6&3(979=7>7<<BJLTSXS?74*,%61HKOWBR3@:9.*8474E@]UWKXGwW@veI~pSqRfLcLo[uiSWDP;J:J=N@Q;O4H?S9P4K3K1J/I0N6S3T4V6W7W:[=\\>`@aCfAg?e?g?hCmErIsOwQuUvSqTpaxfvWb~17j0/Y2+P8,G>/>A.;D/?G/QL/_T8g`CokN||`rv~q|q|t|szqzm}ou|sqh|c]tXSlNQdHRZCWYDYZH671671782893:;5<=7?>9@?:BA<BA<DA<DA<EB=EB=FA=FA=FC<GD=HC=HC=HD;HD;JC;JC;LC:KB9KA8J@6K>5I=1H<0H<0E;/E;/E;/E;1E;1E;1D;2D;2A:2@91@91?80<71;60;60:5/;7.;7.;7.<8/?8.A:0C;0D</G=1G>/K?1M@0NA1NA0P@0O?0O?2O>4N=3K=2I;0G;/D:0D:0D<1D<1B;1@<1A=2A?3B?6K=4\\50w32LS]iM_?S6E&+1+7(;'<)@3D=>?;<?5B4@3>3@5C9G=I>>/?/=+;)9):,;/<1FAEB>?797<BELNSPC>LDTLSMKJ@C5>274.7.1+:484@9[PTD{N9bIkPaG[FgUrdmhEK:D9C<DBHFKGMFMKTAO8I5H2G0G3M8R9V9X:X:Z;]=_?dAeCiDkDmCmCoCoCrCpGp@hGmMpIjOk[rcsYe?D`&$Q+\"V@3VO=IL7@D-RJ3eYCvkW{gyþþyvi{e\\sYTmORfJQ[BUZCW\\F560671671782893:;5=<7>=8@?:@?:C@;DA<EB=EB=GB>GB>GD=GD=HC=ID>IE<IE<LE=LE;LC:LD9LB8KA5L@4K?3J>2J>2G=1G=1F<0F<0E;1E;1D;2C:1A:2A:2@91@91=82<71<71;60;7.;7.<8/<8-@9/A;/D</E=0H?0J>0L?/M@0NA0NA0O?/O?/O?2N=3M<2L;1I;0G;/F90C9/C;0B<0B;1@<1@>2A?3B?6N;4n95FEY_WbCQ8F3;++1'8%:!9 ;&>.:2717,:-9/7,:1A9E<E:>2?0<,6'6)>0D;G=8-@6E@BB=A9>27.075GBSLNG=910/2671(</,\"713,7/g\\l^WCZCV?R=\\LlagbUUEK=F;@=>A>GDOMWWNSDM9G5F1F.D1G7N8S8T9W:X;\\>aAeCk<f<h>j?m>n>o=m:jHr;a?dJpKnNmUoYpr`jINt:8\\6-P9+PC2UM:^QAreU|nʿ~m~kau\\XoSVjNS`FV`EX`H560560560671782893:94;:5>=8>=8A>9C@;DA<FC>HC?HC?HE>HE>ID>JE?JF=JF=MF<MF<MD;ME:MC9MC7NB6NB4N@3MA3JA2JA2I@1H?0G=1F<0D<1D<1C:1C:1A:2@91?82?82<71<71<8/<8-<8-=9.@9/A;/D</E=0H?0K?1M@0NA1P@0P@0O@-O?/O=1O=1M<2L;1I;0F:.F90C9/B:/A;/A:0?;0?=1@>2@@4Q:2r1/KLRX>D0603//1)2\"9#>\";\u001f< =#;%6%6)8-6/4,92@:C<@6B7A4</8+:0C8E>@7>->-5+*&\"%%++2.4)*.+3,4,3,3-0-2+2%6&2&7,6.>7`UqeSVBM:WIf[d_RTCIFMAE??@<@8?9FAMLJP@K9H7H5H3E6G;M9Q7R6R6U6X9];a<g>k?m@qBtBuBuBtBpFmAaEeJlKkVt_z]vj~p~mx]aCAg6/hB7sUJye\\}vž˺tqexb\\sY[oS[jM\\iK]gL561561561560561671983983<;6=<7@=8B?:DA<FC<GD?HE>HE>HE>HE<JF=KG<KG;KG;NH:MG;MG;NF;MD;MD;MD=NC?NC=MC7MD5LC4JA2H>2G=1E=2D;2C:1C:3A:2A:4@93?74<73<71>7/>7/<8/=90>:1B;3C<2D=3H@5I?3L@2MA1NA1P@0O@-O@-L?/L>1M<2L;1J91I81E80C90@9/>:/;;/<<0=>0>?1A?0S8-<7\\[ZY86.*1+/&2#9&B*F,D)A&A&=$9#:+;0:07.<4C<E;A6=0=0;.=1E9MBE<8,6$;);.3,+*(+&+%'**.+2,4,3*3)2(3%:*2\u001f?07*8-?5A6l`gYRBNCcZhbRRAFCK>D;=<<@9>48,6.94HH@E:F;I:I8G;I?NAU?V<T9T8U9Z:^;c>i?m>o>p?r@r@tAqCjMmSsJhAaTsge]w_xg{pqxgg^X{ZQ~wļ«zxlzibu_`rZcqWcpTcmT21/320542651875984984984;:5<;6==5??7AA9CC9EE=EE=HH@HH>HH<JH;KJ8LK7ML8OL9NK:JF:HE<JFCNIMNIPICOE>ENE>LC4J@4KA5MC9LB8F=4B90E<5C:5@93@85@85@86<74<42C97B94A96>95?:7>:7?;8@<9B?:D@7G@6J@4L@0O@-O@+L?,G@.G@0I;0K81M53L76J88F;9C@;6904</9D4:A/69$?=(bC1j^JA7,5)7+5'7&=+8$<&@*@+=):'6%6%6'7)9+<.@2B4B2A1>.=.<,=/D7G;?22&9+8*8+8-8.5.3/1-/-.-0,1,5,8,:):(9&3\u001f3\"8'7'6(B5SIMETL[X\\\\PR>C9??GAFCDBB?9<3;/</<0KBKCFE>?<A?G?I;GDQCQDRDU@V<U<ZBdFkAj;g:g=nCtH{K{MyMtPsOpMiMjYxg_GlVx_{^nza^xpĻʻyxr}op{k}sxlv}k0./1/0320542653873873984;:5;:5==5??7AA7CC9DD:EE;HH@HH>HH<JH9KJ6LK6ML7NM8LK9KI=KJEPPRWU`YXjVTjSO`QHKMD?H?:F=8G>9H?:F=8B;5D:8A96?74?74@85@85=85<73=31=31=52=85=96>:9>=;>=9B?:D?9G@6J@4M@0O@-P?+L@*B?,B?.F<0H:1J65I56F35@65A=::=6;>5@@4E<-J9)^B4L>QB;-2#6&:'7$9%>*;%<(?,@.=,9*7)8*9):*:*<,?/A1B/@.?.:*=,F7H:?28+6)7+7,9.;-</:.8/4-1-.-/,1,3+7*:':&;(6#8%=,;*5&:/F<F?IFOOPQGK<A:ACHBEEDBA>8;1:-<-=.E5L?NEGC@A?B@I@JDMCLDPFTCT?T>XBaGiCi?i@jBpFvJzK|JzHtKpQs\\z_{WvNqEkDlEjKi^rnukLI~t̲Ŵ~/.,0/-10.21/43/651762761:94:94<<4>>6@@6BB8CC9DD:IF=JH<JH;LI:MJ7NK8OL9OL9KI:NKBTRS_^fihxmmlkkh`YiYQ\\OGRH@KH>GG=EE<AA;=D;<?:7=85<73=82>93>:1>:194.:5/;60<92>;4?<5?<5@<3E>4G?4I?3L@2O?0P?/P?-L?,<;&:=(?<+A;-B71A62>42;30=84B;5H94N2.Y,)l/.<>GF;02$1\"9)<)8%7$;(;&>*A-A/>.=.:-</<.<.:,9+<+>->-<,?-8(>/K>G:6*2&9.6,6+8,:.:/9/6/4-0-.+.+0+2'6&7$7#8%5#9'>/=.6)9,A7<5?9EAKIJJCC@BCCCAD?B==4:.8*:*;+8)D8NHJH?B=ABKHR@I@ICOGTEU@U?XA_EgCiCkFpIwK{L|JzFxHwKtOuZ|aUvCdIkTv?\\I`{||aC;{pճξ/.,/.,0/-10,21-43/54/650983983;;3==5??5AA7BB8CC9IF=JF;LI:MJ9PK8OL9QL9OL=LJ>QPL^]bmlzzz{urke_{YSmTLdMEZG@PB<HD?F@;?<87;63<71=90=90;8/:70991;;3>;2?=1@<1?;/A;-F?/H?0K?1M@0O?0O?/P>0L?/@=*?>,@=.?;/?;2>93=:5:94<94E:6M51V-+j)-188C=C8/7(:*?/?,9&8%;&:&<)?-@/?0=0=1>2?3=29.8*9+:,:,9*;,<.B5E9>32(2(9/5+5+6-7-7.7-4-1*0,/,.+0(2&4$5\"5!2\u001f0\u001f4&<.=/:/=2D:5-60;5EANJKIC?=8@9A8?5=09-9+9+;-4&?3HBHEAB@DGMNU?G?GBMHUHWBW@XA^AcCfFmIrMyO|L{IyDvN~R}KrMoVuUuMjGdLg>Vdtӏd92lJ@ypХº10,10,0/+0/+10,21,43.54/77/880::2;;3>>4??5AA7DA8IE:LF:NH:PJ:RK9RM:SL<RL@OJDVTUfdqwxÏƎ{wpmid_[~UPnNJaKGXFCN?=B<8995296/85,85.671783891;;1></@=,B=*C<)G?,J?-K@.L@0M@0M?2L@4K>5M@7K>5F<3B92=82:946;47<59<5>:1H4-Y2-x89?D>E8<;0=,@.A/@-<);'>*8%;(=,=.<-;.<0=3?6>3:/7,8-8+8+8+7+A5C89/1(3)8.5+4+3)4-6,6-4-2-/*/,/*/)1(3&4!5\u001f4\u001e2\u001f/\u001e2$6)9-;1?6E=F>@7<5@9KDNGE>;1=1=1</;,9+:+<-?09-<2@:C?BDDHJOOV@F>EBLIUJYFXCYC]@_BdElJsNzO|LyIvJwTT}JqImStVtNiD^F]Xk󝞎HFk.)ke͖ɿȾȿ¹65154/32.21,10+21,32-43.66.77/880::2<<2>>4@@6CA5JD8ME8OH8RK;TK:TM=SK>RKAQLIZW^li|~ؚ̙ޙڔԌɆ~xvnkfe^[xWTiMKYDAJ><?;:8;76875557457664872<:.?<+C>*F@*G?*H@+IA.IB0IA4HB6HA9G@:K=<I;;C9:=77875384/83/917<574+C1']80~C=GC>?52<0<+?-?-?->*?+?-8%9(:+9-9,:.:0<4>5;4918.8.9/8.6,8.C9A80&,#7/<42*3,1*2+3,3-2+/*-*/*/*/)1(4$5\"6 5\u001f7#3#3$3&5)8,<1?6YQRJIBC;F=J@E;>1:*;+:*:)9*;,>0A3A6=4=7A=EEGHIMMQBF@CBKKTN[JZF\\F_A_BaEiJpNwOzNxLvQ{R{OvOtVy]{SoD^TlQddt`dMMjgΏＸ=:5;8185063,41*41*52+63,74-85.:70;81>;2?<3A>5C?4KC8MC7PG8SJ;WK;UL=UK?SJCSJK]Wcomśڟꢩ뙛啘ݔ֐ʉzyrqfc~ZWlPN\\IGRFCNCAL??K==G;:@;9:=:5?;/C=-E@,F@*FA+EB/EC4CC7BC;AC>@ACB<FD>LD@NEEOCHNAIL?IJ?HECHAA=2L:.gF7OAJ=?48+>/>,=,>-@,@-?-=+8'8)9*9,8-8.91;5:4:3818192:2706/=6>5912(4*<3<34+1*1)1*1+0+/)-(,(.*/*0)2(5'6%6#7\"9%8%6%5&4(7+8.7/NGXPZSQIG>D9@7>/<*<(<(:'9(;*>0A4D;@7@:FCIHHGGJIKFHBDDKLSP\\O]L]K`D^DaFfIlNuOxOxPyUzUxTvYx]{ZwQkI`WkUgM^^mKZTaTcXcefȃ~嫧@=6>;4:7074-52+52+52+63,74-85.96/;81=:1?<3@=4B>3JB7MC7SG9VJ<WK;XL>WK?TICSJM^Xfpm˜㤬ꝡᙛ֕̒ĉzxji`]|XUpRPhOMeOKdKG^FBS@=H?:>?:6@<1A>/C@/CB0BC3BD7?D=>D@<ED;BJ>CVDHaMRhV[n\\br`dobbje`dfXWaJDlG>TFXFJ7@->+A0@/@/@-A.A/=+8'7(8+8+8-6-7/81;4728372939494836/A:8/3*8/>5=5916.2+0)/*0+/)-),(,(-)/)1)4)5'7&7$8#7\"8%8'6&7)9+7+5+5,NGd\\`YOFA7;29->)>'=';%9&9*</>2D;A9E?KHMJGDEEHGIICDFIMSSZR\\O^OaH^G`GdIiNrQxRyTzUuZx^}^|TrMgOiYn[mctM^UfO`UgL_R_^_vqלB>5A=4@<3>:1<8/:6-84+84+62)62)72,83-;60>93A<6E>6I@7MC7RF8UI;WJ:XK;ZLA[NHTIMXR`gd|~ʗ㠩쩫蟡ڙҍurhe]ZXR~XQ{YQxVOpNI`C?M?:@?;:B?8>>4AC6BE:?D=<B>:CB>FH?LUEWoSfbqistvxo_m[cXZWUVMM?@.:%:$=)=*?,@.@.?-=,;,6'7)6*7-7-8/91838495:693616183;4D==670@7[Rlc]T?63)2)2*/)*&(%((**-+0,2+1'0#1\"4$:(;&<(<)<*:,9+8,7-@881GAc^XQB<A<4*:&<$<&<&:(:+<0>2>6C;PJXTNK?;?:HDIHGEJKPTRWNVLYL\\RfOfJfJhMnQuRvRvWvXuXw[w\\xZsWnVkbuVg\\m[lFXDXQeVefgieʏ網C?6B>3A=4?;2=90;7.:6-95,73*73*72,83-:5/>93A<6D=5H?6LB8OE9TH8VI8WJ:YK@ZMGUJNXP_fay{ɔ⛦뢣㘘،ɀuqjfd_`W`V]TVPtMIbFCTBAIAAC<<:AB=FEACD?A?@DBEOMRWVdchqu}}||p`uYiVaQUHF@4;)<&>(8$7%9'9(9(9(7(6(3%4(7-:2<3=5<5<5>9<7<7>9B=C=C=A;@:B9@78/1(5,H?ZQ@66,,$)#-)//,-((0.4/616.3)2&2%6&:';'<(:(9*7)5)5):05-=6PJTQLHB?1(;(=&<';'9(9+:.:/>4B:NHXQRLD=C;HCLHJFMLSRTWPVNVOZVfUhSkRlQoRsStRuMmUt\\|_}\\vUoRiReUgRbZjZjN^ScYiS^`_^W}٩FB7EA5C?4A=2?;0=9.<8-;7,84+84+83-83-:5/=82?:4A=4F?5JB7ND8RF6TG6WG7WI<XKCWKKXP]b^ysuܘ뙗Ӄxusmk`i]cZ]WVRwNKhEDV@@L85<A<@KABL@BQ>B[FKpW]cus{{vpcSpF^K\\HR<<5.9*<'<%;);*:);*<,<-<-<.6*8.<1?5A8>7=4:484404093B<E?B<=5<45-4+7-2', 6*G:K>@64--),*-/+.*,*)/+3/5.4+2)1'3'7(:):(:);*:*8+8,4+<4:5<7ONYWEE3/<-<(;*;*9+9+8,8,=3A6JAUKSJG>D:G>KDJDLISPSTPSMSNWXdZh[pZrUoQnPnQrGmPvZ}[{VrSmVm\\mXiZh`n`l]gfnfm\\_]W{OFmfݺIE9HD8FB6EA5B>3A=2?;0>:/:6-:6-94.94.:5/<71?:4@;5C?6HA7LD7OF5SF5UE5UH8VJ>YNLXNW^Zqppԕ革ꗖ⌋׃}yumpgf`_ZYXQQuGGcB?R=5DH8BT=C`@EnCJOU^ggxknoi`WxIg;U2HAPDO;=82?0@,:$5$5%6%5&7(9,;-</@6@7@6@7=5936.4,.(-'.(3-:4<4815-5-,\"* 7,B6>25&.\u001fF7I<H?<9,,#%')/2-.0/2.3,1*0*/)0'7+9+:-<->/?0@3@36*LBJE50GFZ\\IKA?</;+:*:*:,:,9-8,<1>2F9OBPDH<C7C7H?F?JEPKROMLKMLQX`[gaqauWoNhMgMmOuRyUwTqTm[pcuizguboamdnflhjghfa^TeG<^UͫNH:MG9LF8JD6HB6F@4D=3D=3?80>7/=60=60=60?82@85?:4C>8EA8LD9NE6RE4RE2VF6VH;ZMGVMR[Whlk~Δ㜦铕⌋نу|vmkde_aY[RQsNHbWFY_CQmBLFPLVU^[dZhRpRuTuPlJbBW8J.?8ECMGL>>>8F:H6@,>-=-<->/?0B4D7E:E9B7>5;26-5,3+2*0*4-6090807/6.6-/&6,8,2#2#9)>-;+<-D8JADA56*-*-/26755411,0*/,0-1.8191;2;2=1=0?0>17+WLaZ;6;:PQFHPQ<4:/8,9,:-<.<0:.:-<.A3H9I;D6@2>0F<E<IBPIRMNKLLLOZ`^hethz]qOgMeNkVzTxRrTm]qhxjweret_m`kktrujfd\\la}fVYI:kXJ{tQK=PJ<OI;MG9KE9IC7G@6G@6B;3A:2@93?82?82@93A96@;7B?8EB9KE9MF6PE3RE2VG4UH7YLDUKLZScii|ȓޚ리훟閘㒔ޒډ|tyoumpigj_}y_xWjP_O\\S^T]PWHR@Q?RCRDPCK@D9<46JLIJAA8795A8D8>1E6E6F7E8F8G:G<G=>3;18/5-3*4+4,7.81;4=4<3905-5,7-.$;0=.1\".\u001e7&<+:(8'8):1=9@@<>37,/,.+**)+(/,44889;887573717-6*5(5&5(PEmcHA42CC?CVVA<>4807,:-</=1=0:,<-?0A2A2@.=.<-D7D9H?PGRLPJNLON_caiitm|dwVjQiUoWvVtXp^pnywksXa`m`mbos}숊́|thyjskXON<_VGrhSM=SM=QK=OI;MG;KE9JC9IB8E>6D=5B;5A:4@93A:4B:7@;7A@;CC;IE:MG7OG4RF0VG2UH5WJASIHXR^jg}Ēژ礧ퟤ蝢晞┙ۋ҆ʃymczXiQ_NZIRAI=A=;?9C9H:I8G4C0@1TIG?;76488;<9874:/<.;.:.8+7*3)2(5+3*3(3)3*5,6.8/>4<2;18/7.6-4*3)3&3%4%7'=)>*9$2\u001e:&4%1(51<<=@8>37-1-.--0/439:;=9=2603011/2+2(1%3$1$=1j_TL95@?:=RSJHC=946.9/;0<0=/;*?-A/?-;*;(;+<,>0>2D:LBPHNFLINL`dahhro{hxZkUjZrYs]tarjt}wy_dgtm|eulw좟Ĕ|ikVHQ<WUFtg^۾VO?TN>SK>PJ<OG<MG;LD9JC9H?6F?5E<5B;3B92A:2C:5A<6C@9DD:JF;MG7OG2QF0TH2UH5UH?QGFWQ]jh~œؙ矠뤩薠唟ߔו͚e]pRdIWBN>F<A<<@9A4E4I4I3F.B,?-SED<97>>DF@D8=65B;E9C8A5>29.5+2'2(3(4*5,5.4.4.4,A8>27,6,8/:.5)1%8(2 1!9(9(4\"7%C07&8*7-5.4053:9?>LKHFBB>?<=8;26+2+1)/,./.1+4*5)7(0!.\u001fdY]S@:DC;;MMRQHE<96/8.9/;/:+<,@-A.=*8%9&<)?.7)8,>3G<K@IAJBJEa_^`djnwku]iXe]m^sbtdqlr~qsryyaqXfЮ]jPDR9QTAjbUXNBWOBWMAUM@TJ>RJ=RH<PH=MC9KC8KA7H@5H>4G?4H>4F?5GC:GE9JF:NI6RJ5UJ4VK5VK9XNEULMZTbkh{~Ñט磤쥨ﭩ▟֦ζgzL]ER>M;G<D=B@@@@>?<=EB:4D;E<1)KFJICE>B<@<?=><=<;B;?7D;MAK>=06)9,7+6,5-2*/*0,2/50@79-2%3&9+;-8(2\u001f2\u001f4\u001f5!4\"4\"4%5(5)0&3)5)6*5)3&3'4)2)3.5233/2-2-4.5-3+/+,0.5.9,7(4%-\u001c3\"XHYN;3NI41HHOPJJBB<7808.:.<-=+;(9&;(<)>,=+<,8,;0=1?3?3@4@5A7japic_mjqqadgmpylzhxdobidjlnqoqoy{}Zlcwbp}u]rQJY:LR8snZ˷YOCYOCXNBVL@UK?TJ>SI=RH<ND8ND8LB6KA5J@4J@4J@4IA6GC8HD9LF8OH6RJ5SK4VK7TK:XNEULMYUckh{}Ӗ៞젞ퟧ袥襤ꩣᣜбqTbCO<F8A7?:=<?@AAC<C:@AD<<CA@>31OPDG@E;B8?8;9::8;7E?=5=5G>LAD6:,9+7*7+6-5.3/3/5584>5;-6)5&6(5'6#4\u001f9$9\"9%:&<+<,8.4,4.5-6-7)5&5#4!4\"2$2(0+.,,-,/-2/4+.,-0/2.5+5'8'9'?.*\u0019D5?2F>VPB?BAUVRRJJC@>6:/8-8*<+;(:'<)>-?-@/>.:,;0=0>1>2?1A4C5i\\mdb[kfolbakltxq~o|ht]fY`bfqpzxvwx~Rd[p]njk[sOO_;SZ;us\\ĺ\\PB[OA[OAZN@XL>WK=WK=VJ<SG9RF8QE7PD6OC5OC5OC5MC7KD:JF;MG9PI7SK6VK5VK7TK:WMCVMNZWbkiz|ˑ֘ޙ㚙隝蜤㜢៙㜘▛ߚڤбrYqCTAL>D=?==<?=?>C=D<C8=@BA@C?<896WWBC>B;A8>686696<7HA;15+A5K>H:=/8)6)7)7,6.507187=93*5*6,6*5*7):*>,4!4\u001f4!7#8)9*4*-%?=>8>6<.8)7$7\"8$7%3&/&.'/+/.//./,)0+5.5,3&4%9&>*A/1 SE;0A;C?KJTUTVTTOMIEC<<27-6(8'7%7&:'=+>-=-=,:,;/<1=/=0?0C4E7\\Qg]aYlgpoabfgjqR^^kgsem`gfjqqxwtunuJ]Rh[m񜡣b`VoHRd>W`Axx^\\PB\\PB[OA[OAZN@YM?XL>XL>UI;TH:SG9RF8RF8RF8RF8QG;LE;KG<OI;RK9TL7WL6WL8WK;VLBUMK\\V`jh~yyΓҕ֕ۖ㘛蘞욢훣뜥虡ߖڕՔՕ֑֒҅}sfW{Ga<KAJBCCAB?AA?C=F=F?F:>?@EDA<61>:ZYAB@C=B:?8997<8A8E;:.2(</E8E6>/9(8)9)9/:/9191;7>82,2*3,5,5-7.:/=/7(:)<+<,;/;0<695CBA=@7<19*8%:&;%=)7'1%1%1(3,1,/*2*5,7+6*5'7%;(>*;(<,^PF<3//-@@WXturqjg^YPIA75(. 8'8(8&;)<,=-=,<-;.=/</</;->0B3F9MA`Wa[plst_c]a]dHTYegrgoelkpsvvvpsenDXKbXk뒖_zYRkCSh?\\gEy|_\\PB\\PB[OA[OAZN@YM?YM?YM?WK=VJ<VJ<UI;UI;UI;UI;TJ>OG<OI=QI<SL:UM:XM9YL9XL<UKAVLJ\\U]hexut|~ÏȐϒԒܔߕޗܔ֎ΉǅŁ}~}tpg\\NvAc:U9KAGECGAGCEEAG<J=JBI>A@?IE?93-C<UPDCAC@A>??=@<D;F<=28*5)9*>0=-;+<):*;*;/;/8/9083:5:663202143402+0'2(7-;18/3/40;<?@8;76715,4&5\"7#:%=)8&4&5'8,;19/8->1;-8'8':(<)<);)>-:*>2C:/-::246753;7C?KFQITITHUG?0?.<,=-=.>0?/>0<.<0=/<.<,=.A3D6MBbZc]olrr`c`e`gkvozkv`h_flqy|y|ms^jAWD^Uh懍h^[tJ_vJhwPfǻ伺޺޼[OA[OA[OAZN@ZN@YM?YM?YM?XL>XL>WK=VJ<VJ<WK=WK=XL>QI>RJ?SK>UL;XM;YN:ZM:YL;XL@ULGYSWe^nnjut~}ȎώԏՏӐӋʄ|u|ovioljkdzYvPoBd7V4L9I@EFBJCJEGGCJ=N>NCIBDA>ID<54,JALFBA>?;;=<A>E?G<G:8*7*8*9(8)9':(;(;)=,<.;.8.6.6/5032./-10247794521.,4/6332/1/47>:D0602213,5)7'9(<(8$6$7);->2A5@7B7G8A1<):'<)=*<*8&:+8*0'C<2/?A.3*,1/6/83928.5*2&1#E5A2=.:+9+9+:,:,<0=0>/<.<+=-?0A4SIg_d_kinochjqoxp}s}mwbkdnrzx~quipWfAY@[Qf}zkn]oZy`rկӦЧӫԮֱں[N>[N>[N>[N>ZM=ZM=ZM=ZM=ZM=YL<YL<XK;XK;YL<YL<YM?SI?TJ>UL=XL<YN<ZM:ZM:ZM<ZN@VKEXOR_Wbd_sjfsozz|~~ƈˉ̉ʈȃ|}vwqrklfgl`_sV_N^J^@X7L3F9C?BD@HBICFIBJ=N>NAEFDA=HB:/7,PGC=>9642153>8E<G:D58*:*:*:'8'9&:':&:':):,9+7+5+4,3-*+*--3/4173949588;8<9?9A9D8G6H5G+5-2124/6-8+:,=,5&8*;/>3>4=4>6A6J<H8A1<,:*9'8*9)2'9/@8D>0/..59583/7.82:1;1;0:0;/L?F:@19*6)6*7*8*;-=/>0=/=,<+<.=0LBc[c^kiosinrzvfroyq{jslvwu|hocnRbB[<YKat{z}k{fhṷշˮǤÓș˝ˡͧҰٻǾ[N>[N>ZM=ZM=ZM=ZM=YL<YL<ZM=YL<YL<XK;XK;YL<ZM=ZL?VJ>VJ>XL>YN<ZM<[N;ZM:ZM<[OAWMDWML\\RZ^Xfb]qjfspwvxx|{~ňȉǂ}yzuxqvotkpgzaP\\HGEHHOBN:F6A:A==A=DAEBCHAK=M?M?BGDA<H@9.:/UK>783/,*(/*;4C9C6>/<-;+<):';(<);'8%5$7%8)7*6+3*3)3+33588<4:-2(-(/+1-3)0&1)6,?*A!:\u001a/\"1'0,10/2-3+4+6*6+90=6>7:4715192H=K<E7=/6(3%5+8-4,6-C<9321  89550*4+4+5+6+6*5+7+YNRFH;@4;/;0<1<19-;/>1=.;,9*9,:-<2YQb]ppvymrq|r}zxhqepq|ukv^jOaA^8WG^ntn}fgqͭܽٻԴ̩ÑřȡΪѵνȷZM=ZM=ZM=ZM=ZM=ZM=ZM=ZM=XK;XK;YL<YL<YL<ZM=ZM=ZL?ZLAZLA[M@[N=]M=^O<\\O<\\O>YM=YLCXMIXNO[QY]Ub`Yia\\rjfokspvq{u}Ɍǈ~yrstl\\GNB9@<C@@?:;=?DE><>=?@@CBICMANAL??@9?6>3</<0D8MD72:82.3.C<?46'>,6%:'<);(9%9&;(:(:'9(6(2$.\"0&7.=582400-**&(%'%'$)&,!)\".'7(>!;\u00197\u00171'8#.#++---+(.*416464776523./,,/,92:191SK#\u001b+#F@.&.*<7E@:7/*.*51<7>4;/5)3&5*;.;08.bXZOC:6,:/8-3'6*1&2&2&5&6':*<.=1:0C;\\Wppsvx|yq||wt}s{r~r~mygt`nI\\>\\>]@Xel|m}f~cjw|vzqyo|rvuwy§̹Կ̺ZM=ZM=ZM=ZM=ZM=ZM=ZM=ZM=XK;XK;YL<YL<YL<ZM=ZM=ZM=ZL?ZL?]M>]M=]N;^O<\\O<\\O>]P@[OC[NFYNJZPQ\\SX_U^_Wfd\\tibngqjxpyċď~tnqukW}<C5+6,<3@8>8?:A==;;<;@>D@IAI@KBG<9=4<1;/:,:-A5JAFBA=6351A:C8:,5#8';(=*=*;(;(;):)9(6&2%2%5*8.91911&0&.%,&+'+),+-.)/$,$0'7$;\u001d8\u00143\u00130\u001e0.93<+2(,.002+.:>7=4:26050325872-;582E?EA/+2.\"\u001e51?<E@=83-2,60:1:.9*5'5(9+<0<29/cYXN@84+91:06,9/5+5+4*5)6)5(7(6);0C:YTljqtx||v|yv~usp}kwdq_nI]>\\>\\DZdjyqzdu\\x]ckppmr`m]i]g^lbqeyizktv|}ƷǿϼƷ\\L<\\L<\\L<\\L<\\L<\\L<\\L<\\L<ZJ:ZJ:[K;[K;[K;\\L<\\L<\\L=\\L=\\L=^L>]M=]N;^O<^O<\\O<_RA]QA\\PD[NFZOK[PN]QS]RZ_SgcXvh]kbskv|}vpuviRv<D5/4+<0C7E9C8?9=<:>:A=E@GAH@E@B;6908-9,9)9*?3F>D>:775;7C=PFH<3#9(:';)=+=,<+:)9)7)3$/#5+=5@9:24+4&5&2%/$-%+%+(,)+-(+&/(6%:\u001d7\u00163\u00183%70;5A8C<E<E6?,62</;.9-7.3.1/1420,=964;9mkCA0./,;8@<A;<67.5-5+6*6'7&6'8);.<1<1;1`YTM<30(;3>6;3=6=8<7>7=3<2:.7*6);/@6TMgeorz~||yxwsn}gv`p[mG^<Z>\\FZ`c~gy]iQhOmRtX|^}`x\\qXazP_PaUfZnaug}j~mrtxyyz~ǹ˸ȶ[K;[K;[K;[K;[K;[K;[K;[K;ZJ:ZJ:[K;[K;[K;\\L<\\L<\\L<]K=]K=^M=^M=^M;^O<^O<^O<^Q@^Q@]OB[OC\\NE\\OG]PJ]OO^P_bTmdY{i^pg}u{{zxudMlFRA@A=E;H;G;E9A:@A<A=D?GBIBG@A?<?6<1:.;-9)9+>2D:<731;9A?D?SLUJ:+:*8%7%;)=,=,9*8)5'2&2)9/>7>850/&5+6)4*1'.)-)+)++),','1)9'=\"<\u001f>%A6H(6.<P\\`lP\\<I9G)8*8.:0:2701+*)&0-722/C@spVS==GF=<<9:5807-6*4&3#5#6$8&;,</9.:/<4XQMG700)<7A:<6<5>9=9?9@8?5<2:.9-9,<3OIc_no|~yyyxtn}et^nVhE\\8V<ZH\\YZmScrG]uC\\yCdzIm~QtVvXsYoWmZl\\obuh{nqqpqtuvvvx|~{~ȷǸ[K;[K;[K;[K;[K;[K;[K;[K;ZJ:ZJ:[K;[K;[K;\\L<\\L<\\L<]K=^K=_L=^M=^M;_N<^O<^O<^O<^N>^N>\\O?_OB]OB^PE^OJbNYcRecTqdZ}lexrwv}΂wlXwD_CUEQJPIHF?E<E>EACC@C@GBHDICDA?@8@7=/:+:*9)8*;.?6FB=;BBAA;6KCXLK>A38(3#8(<-:*7)8+0%3)8/;4:562/-,)0,1-10312537486;-5,6.=0C-F)H+N3R9L3?@M_lkyWfCS>P3D3A3@7=99834*/$2*.(72YT\\ZXVAAHFB@<7706-9.9+7'5#8%8&:(>.;-6+7.>6NGEA501->9@:815120215283:2:/9.:.5+7-IB_Ynl}v}w~yxsk}dv^pRgF_8V=ZL]TR{`CWh<Yq?[vCfyKn~QtVxZy_wayexhzm|qrrporttttrvw{xx[K;[K;[K;[K;[K;[K;[K;[K;ZJ:ZJ:[K;[K;[K;\\L<\\L<]L<^K=^K=_L=_L=^M;_N<^O<^O<]N;]N;^O<_O?`P@`P@aQAbPFbNPcN]_Pe`Usgato{t~rv̋ۂrduPd;R3L<QERDK?@@>CAEBEFBDAECFDGDCB<@5?3;-8(:)9)8*:-;3IE@@=>782/B;ZPh[QDA34'6':,9+7+8,0&6-;4;440/,-+--493;3=3=1>1>1=1>0A1D4K5N/P-Q2Y>_3HO\\an_nWfP`DX8JAQ:G2;/22-8-;+;+:/2(JBkcLGPK;9;9LJ@<817-</=,:);(;&;&<)>-9+3':1C=GAD>722.;7:62.2-,-,,/03171:1<1>26,4)B:YSjh|}v}xzxqi{bt]oPeIb:X@\\O_QNqX:Sf8]uEa|InSvY{]~`gll}m|o}ponllqqrroprtvtwï̫ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8ZK8[L9[L9[L9\\M:\\M:]L:^K<`J<_L=_L=^M=_N>^O<^O<^O<_P=aP>aP>aP>aP>aP>bOAeMMdMW`O_aUmgbuq|vsuΆ~qyclP[;M*F2Q<S<M<E@ECDBCCEBCADCEDBC>@8>3>19+7':)<*<,=1?7>;9903/24294NFlah]QC</:-:.7*6+8/4,7/93731//-1/152C0E-F*B&A#= : :&C*G.M/P+R)T2`AhCX`mhuVeKZL\\BU2C@R7C,3((.$8&?&@'?.:,YM]QG>D>63;7UQF@918-;-:)9(=)>)<&;'=*7(3(=4LFGAE@963073620+1-,/+-./1/4/81;1>29.3(;2NHa^yzz|{xn~ew^pZlL`Ia9W=YM]KHhQ1Qd6\\tDf~Nv[chjnsttr}pnmllnnoolknrttwƯο̻ʤ[J8ZK8[J8ZK8[J8ZK8[J8ZK8[J8ZK8\\K9[L9\\K9\\M:]L:]L:^K<^K<_L=^M=^M=^N>^N>\\O<aR?aR?aR?bQ?bQ?aP>aN=bL?hOKgNRbP\\cWkjfwv}|xzƄ}uzklY[DL0J5T<U=Q?LCMBH=@AC@C@AA?C?A9>4=0?1;+8(<,?.@1A7C=7485//30;70'5)UGvl[PC7<0;08+6+:0708263320112364<&7#9\"9\"9!8\u001f8\u001e6\u001e6\u001b4\u001f9%B)H&J'M3^Ehbu`lWcQ]P]MZ@M2==F7;/./(5';(@'>%9'8+VJ;2?8412/C@WSHA916,7)5%5$:(<(:&7%9*4&1%?5RJIDHC;62.411/-+22,/+.+-++-*1*4,8,=12(7.IB\\Xww}vj|_sXlTiE]D^6U:VLZHC^K-Mc5Wo?b}Ju\\glnrvzwr~m|i}ghikmmlh~ijosrxũʵ¶Ş]K7\\K7]K7\\K7]K7\\K7]K7\\K7^L8]L8^L8]L8^L8]L8^L8]L:]J<]K=^L>]M>\\L=[N=]P?^SA`SB_RA`P@bQAcRBdQBdNAdLBjMIhKMdPYf[lnkx{Ђy~sqjba^JW>Q:L?PCQ@M=H>F=C<A<=<:>9=4;0;-7'A0<,6(A5F=>67285715.6-8*<*:'6%;2SLYQE98*>.B3:-3+GB//5:6=,7BM'3&2)2(2\u001d'!+'0(0\u001e'\u001e)+7 .&7-C#;Xs.E]l_iZcU\\PWHM?@95>7A7?17&3\"6#;'<)8-80E?;7317554DCLHKED;:04)5(5*5*</9,/#(\u001e-$9/C;H?OHE=700*/-212414/2/2010.0.3.5-9/=02%>1=3_Ysqxh}_w[uUoLfEc:Y;[?Y]i@;VF-L^6ZuBhNw]}cgjpqnm~l}i}hfff~kmnk~gfgimrv|z]K7]K7]K7]K7]K7]K7]K7]K7^L8^L8^L8^L8^L8^L8^L8^K:]K=^L>`N@^N?[N>[N>\\P@^RB_SC]QC]OB_NDaOEbPFcOHeNHiMJgNQeS_h_tony~ʣxy|{vji`]aOZFRHUJYFS?J;E9A:>::=8?7?5</<,<+?-9):,A6=572<7505-5*5)7&:&;%9'6.A;MDJ=?08(9*</;4JF126;6A.<@N'4$,%(),+.+.(((*+,$'%(&-<E\u001a)4CAT&6jubjZaW]OSBC=9>68,D5H6>,/\u001f)\u001a(\u0019(\u001b-%;7TRHG5456==WUGBGAA99/3)6,7/81=3915.3.4.83?9F@JBA86-0*/-120303041202/00.2.4-9-=13$</=2^Wvstf|\\vXtQoIhAb:Z?_JaS\\|@8SG1M_9[vCgKsYx_wb{f}k}l|i|i|h{g{d}d~c~e|j}n}l}i|e}ccehkps|xdppR^^]L:]L:]L:]L:]L:]L:]L:]L:^M;^M;^M;^M;^M;^M;^M;^M;^K<_N>aP@`P@]P?\\O?\\P@[RC\\RF[QG\\OG\\OI_PMcQOfTTgUUhVVhW]h]nmhsv|ˊԘנʪ}π䄆vsjfhS\\GQFQGTEQ@L=G8>7:99<7@7A4?0>->-<+:,B6H?;21*:26/6.7,8,7(8&9&:*4-4.A9OCH:5%3$@2>5HD135;7@4@ES2?)0#&$'13-/''&'12)*8:+1)14@R^=M\\i^fV\\OTNSEI:;74?96,?2B5=17-3),%' %\u001e0+EC::--35AB^]@;C=A9=39/=4A9@;@<=;==@A>>::?=JGA;<45,2+1-311202040202/00.2.4-9->24%8+;0[Tzw~rdy[tTqNmFg=a<^FcTgAHp;3SH2Qa<^yFhNrZu^t_xc{g|hyfyfycxbyb{b}b|czh{j{h{e{a{`}`bjnstwuynpmTdYCOM4@>^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^M;^L8`N:aP<`Q>]P?ZN>YOCXPEXOH[QO_UTbXYeX_iYcl\\fk^glaimeroktty~ʆڍᎇןӭĳy{ށzwsrcgU\\MTGQCM>I;D6;8897<7@6B5A1?.:*>-=0F:SHH?5.1)9181<1=1;-6'6&8+5-2+>5NBL>:,8*B67.>:/0164<8BNZLU>E38$&/1,,22**/.::\u001b\u001d37,28BENXcNW=CBEBG>C:>8<88978391:2A:NHVSNNCB7295KIMLRSYZSRYV51>6B9@7?5B9C<A>?@8=9??C;@58>?MJ93603+3,4.41210102/2/2/0/.1.4-8-?36'5(:/VO|yzocwXqOlFh@c9^?`KdZh35g;0WO8XhDa{KjPsYt\\u^wbyezfwdvawav`xaxa{a|czfzg|fzdz`z]|]~_gntsuqtiidRbUFSL:G@_N<_N<_N<_N<_N<_N<_N<_N<^M;^M;^M;^M;^M;^M;^M;^M9]K5_M5`P9_P;\\O?ZNBXOFXQKYPQ`W\\g`hnfsshysg{sg}ri~pm~pqsvx||҅敍㝌ڠulnqvlvismllgi^`RYFM;D7=6<8998=7A7B5B0@/7)A4;1;1RH\\SME;2907-9/?4=16*4'6*3,70=5E9F9B3A2>20&720/.1.47?PX]dZ_OS.103,/DG66,,-.>@3637bh<C*2-4&*;=@E6:379=7;/043;;GFRS`chnek]c@>E@^[hgopjjKK=;40>7E=C;>5<493436<-9,6.8,6,39>JK3/3.3+3,5.404/2102/2/2.0/.1.3-7-?38*2%8-NG|ywl|atTnHg>b:_6\\BbNeWaq0,_?0[W>^lIf~NkSt\\u_v_xcyexdv`v`u_v_w_x`{a|bzd{e|d|by^y\\{\\}^agmpsr{nrjfwe[k^RbU_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N<_N:^L4_N4`N8^O<[N>YOEZSMZTT_Zahbprmzu}t{qzpvpqtrxu|y{φڍޖܙ͛~yl[R?MBQIWRWUSTKO>C5;9<9;;9>9@8B6B1?/:-A65+.$I?g\\dZUK=35+3):0;06,3)6-1*82;29/>0F7B59-1(5.31./*.17EJV[]b\\a9<9<+.JM890057()'+W\\>C:>7=\u001f#),<>BF49,21716(.37KNaehncl_k`lbkLLNJ\\ZVTMMHF423/A<KDOHJC@8:350.-1;,<*7'4)40:>CJL1.3,3,5,4-4/4/4202/2.2-0..0.2-7-=1;-2%7,D>yv|qhx_rRlDc9^6]8]GdN`IMe5+VD0[Y@^lIe|NkRt[w_x`{dzev`s]s\\s\\t]v^w_{azbzb{b|b{_x[xYzY{Z~_ekmsuu|rvpnlfwe_O?_O?_O?_O?_O?_O?_O?_O?^N>^N>^N>^N>^N>^N>^N>_N:aO7aP6aO9^O<[OC[RK\\VV_Zakgvso}z~|}w{uxvsys}z}ąɍΔ͚ǠɭŦmfJE2A4A5C:IEOOJK?C=?;=<;=:@:@7>1=0:2@84,1'J@bWg\\eYOB>24)7.905,2+601-507/8/>1D7>04'4*0+3/..-.1478BEMRY^FKQW48FJ8<AE7:/105HK8<7:#%:>8;;><A7=-6)21;<DLS]eksjs`lZhXh[hddZVWT@=104433C@JERKSLJA?7938133.80>0>*8.:;ECHAD1/4-4-5,4-3,4/5302/2.2-0..0.2-7-:/>01%7,;5sqvi}at[pPjCb8`8a;aLhO[~86]=0NF1VX@ZeEcxMjRr[v^ya{dxat]pZpYqZqXt\\u]y_x`y_y^z^y\\xYxWyV{X_dhloqoxjril~ddv^_O?_O?_O?_O?_O?_O?_O?_O?^N>^N>^N>^N>^N>^N>^N>_N<cQ9cQ9aP<]P@ZPG\\TR_Zaa_mtrzy}{xzvwww|x}ĂćȸоѻЬoT]HH6>0G?WQWVNO@C=?<=><=:=8:19080<7:3>5PFXM]PeXcUM?9/8.914-2,60403.5.<3C7B6:-3'5,.&0-0-3154-.35BFX]W\\ouDJHM=D[`ou>C}mqQT>@02:=IL9@8@=F7B-8>J]hmwjrcn]g^kap]nYe\\]OKJG7401540.95D?JDJB@86/4/7177'/0<2>,70:>E>C443.5.6-4,3*3,4/43/2/2.2-0..0.2-7-9.?20%6,61onpcx\\pXnOiBb9a<dAdRiQWd/'WD3GG/RT<U^?cuMiQq[v_zb|dx_rZnWnUnUoVrZt\\w]w]w[x[y[wXvWvUwTyXzZ~_cd~f{fr_kZ`vR[nPSfH\\L<^N>`P@`P@_O?_O?`P@aQAbRB_O?]M=^N>aQAcSCbRB`Q>dS?aP>]P@^QI[QPZSZeapsqyxz|~~~yysrnntwv{̀ʋƖäƳ̰ϬϧϣУ˜Ѩg_IzgtgH?QNccKL?A89:;:97553;67350B;=3I?XKOAdVcTXIG;:/6-7/6/4/0-2,70=4=17+5(7,0'/(/+1-2040517579JNY]OT8=6<X`~~ougoipfl\\aX[Z_U\\DL8B7C3A,:0>=IS_`igrepbmbp`o]gSSFA854111/.3194D=B:?7<4908193667<5<4<4<5=59351/3,5.7.6.3+2,2,310303/3.1//1/3.7.?58,6,/&;7XW{me|\\tPjHfCe;d9`NlRd=?R,!C;&CG.KM5Z`DZjEcxMqZxbx`t\\rYqYlSmRnSoTrXtZu]u[tXtWvXwWvWvUuTtS{[{]z^u[mUb~MXrCSj>AW0?U/<R,\\L<^N>`P@aQA`P@_O?`P@aQAcSC`P@_O?`P@bRBcSCbRB`P@fVG_QF]PH^TSaZad`omkvwxz{}}x|rvlompoquv|~ՉӘΨǹźαתۥޥݢۤأѠǛӼ|eŋw}mVJa[rpZ[KL?@>?>@<<6655=883?86.>3LAH;]Mo``QH:5)1'6-5-0)5195=7<38.5)4*5*7.5-2-0+0,2,4.5287>@JNW[]d\\d]eaiS[NVQ[_gjqflZ`NT4:,5*6-9'5!/'67DO\\Zdbldmencm[hQZEE<7646355302/62>9>7<5:3818295:68;7:6:6;7957312,4-6-7.6,2+1,1,200303/3.1//1/3.7.<3=28.1*74Z[s}fz^vVqNkGg@c<cAdOhLWy<9L2#<:#<B(EG/PT9VdA`rJnXu_v_tZqWpTkOkPlQmRpVrXs[sYuYuWuWuWtTrQqRqQoPlNiLbFXu?Ni6F]/@W+@W-AX.AX.YL<[N>^QA^QA^QA^QA_RB`SCaTD`SC_RB`SCbUEbUE`SC^PCbUM\\QM[QRcYbkdtqmvuz|y{y~x|oteibfjnru}}ׇݗ۩ػؿۧϡÞlpo`RG]Umiuu__JLAEAD>@8;68=;;6A:817,>3=/G9j\\i[\\NB63)4+6-2,52A>GC=62)1'3(0'4-1+.)/)2,80=4B9-(43CEVX^bZaS[Q[GRHSO[\\fmvntY_>D.5-42<2>+9'66EKWISPWW_^fck`iRYBI977175<8<<955160:3;290907194;7<8999987888866402+6-7-7.6,2+0)0,10131303/1//1/3.6.:1D9914./._blwbxWsPmLlBh:`<`IfSgDJm<5O>,=<':?(ED/FH0Q\\<YkEg|Qr[t\\qWmRlPiMiKjMkPnToUpXqYuYuWtVrTpRmMkMjLfHaE\\~AUt;Li3E`-AX*>U'D[/E_2Ic6WJ:ZM=]P@^QA^QA^QA_RBaTD`SC`SCaTDaTDaTDaTD_RB]QEZOM[RWbXcjcsqmvuxzz|w|symrdh]daglrx{ʉߕ夡䷴۪ө¡vqrcbWi`rmut[]LNDH@D;A;=:8<8F@C;:0:/6)1#I;aRj]SG:/4)6+4-42MKZXKF914+4+2(.&-&,%-%1)6,;0?4/'4,:8CBFHEIGNMVQ]VbXd\\ggrmuYa;@28.4.7*4%2)5<KS_?IAIGLQVY`X]GM795384<9@>@?=;957282918080718496;8:7;9:7:898845.3+6,8.8,6,2)0)/+0/232303010/1/3.6.8/F<914/,,fjygtbyTqKkGj=e6\\=^QhXeBBgC7[N;GF1AC-JH3EE-LU6Sc>btLlUpXoTmPiKiIhJhKjMlRnToXpXtXsUqSoQkNhKeHdG`D]AWy=Rq8Mi6Lf6Oe7Of8Ne7Oi9Sm>UH8XK;[N>\\O?]P@]P@_RBaTD_RB`SCaTDaTD`SC`SC_RB^QIVMR_Xhnf{uqxtxwxzy{txlqbf\\c`fkqv|ƀΓ䮭罼߹׶еƱy|qvksimeoi扄~sredWYMNDG?A:7;7B=E?<3=3B52$0\"J<XKN@=/7,7+3*42UUkh]XD>;3;2804-2,1+0)0'/$/$0#9,4'2*;6CAEGBG@HDOP[VcVa^igoYaBG:<5728282=9CHUVa7@4;6;ADJOIM<B135495=9=:;9:77381;2;1:29282736475:8;8:8:9;7956/3,7-8.9-6,3)1)0)1-233323011/1/3.6.7/C:701-13kqqzft]tPmBh>g9c8^EdZmV[wE>dJ=aYFTO;KI4PI7GE0GP3M]9ZlFf{PmSmRlMhJiIgHgJiLkRlSnWoWtXsUnRkOfKcHaF_F[CY}@St;Pn8Ok:Rl=Xn@ZqCWo?Vq>WqARE5UH8XK;ZM=[N>\\O?^QA`SC`SCaTDaTDaTD`SC`SCbUEbWQ^Vckf}yu~zzyxyvytxlqcj\\c^diow}ǁшәݣల㼾þŹyztyvqulelepha[`[smyu~}|yrqccSTHHDB>:<6B<:3C:UK>26)9,=.?/B4C5@17-30LM_]WSD?:48181939292:1:09,8+9*)\u00193\"@2I>D@;:7;:@8BHRUaXd^g`iU[AE@>?;@CGJLTQYT]V`3</5048;>B;?4804429697532020404.<4=4<5;4837343439998889997755/3,8.9-9-7*3)1)0(1,334323111/2/3.6.91<3710-@CnukubqRiHf;c5a6b?eNi]jGFjF:^M=^WDYR?RJ7OF5ID0DJ.GU2Sc>^sHgMjOjKgGgFfGfIhKiNkRmVmUqUpRkOgKcH`E_F_G^E[~DYwAVr?Uo@YpB]rG^uG[sCYtAXs@NB2QE5UI9WK;XL<ZN>\\P@^RBaUEbVFbVFaUE`TDaUEfZJi^Zngwup|x{ywxvwpujoch`g`femqx~͉؏ؙ֪֡۴ߺºɼĻqqquqppfewhenj_Yd_ZTf`sozv{yvuhhZXRNHB=8E><5G=\\R;0<07+7)>.C5B3A1B486>>CCB@=7817/7/:393:3;3>5B6E8G6-\u0018;%J8L==50+009>AJLWU`Ze]eYaLT>@4/7/;9@@CHDJBI?F5;26368<8:14/2142095850.,*0,3/4.=5>5=4<3:59565655757576866542.1+7.9-9-7*3(1&1(1,435333211/2/3.6.;34+:520VYpxcnZiI`Ef8b0^5bBhLePYk60^G7XK:UN;[O?VI9M@0JC0@F,AO.L\\7Xj@bxGfJhIfFeDcBdFeHgLhOjSkSnRmQhNeKbHaG`H`HaH_H_}I]yH]wH`wKcxOczN]uC[vA[vAJC3MF6RI:TK<WK=YM?\\O?^QAdWFeXGdXHbVF_UIbXNg^Ulcfwrzvzutssstulpbg\\`aeflntx{ȃӏݗޛՠөڮݱݲ۴ڶ۵ֳѮɫĪ¥~|xdbgiefdZ[j[X{c_yVPc]NFUM`Ykewr{zwnja\\TOGDOKB=G@WO,\"1'4'?/E6>-2\"7'E7E?973.61;5=5<4=4;4925.4+5)8+<,?-T?G2<);.=2;57435KPMRPUTYY]VXMQCB5+7+8052242618/94>3;5?9B4>+5(30:-35959./*+1/4351<6=4=4=4;6:687774635253455411-0(8,:+:+8(4&3$3&4,5253423/2/3-3.6.=4/&>935bgoy[iNcC]Eh:e0]6aFjJ]BHS-$WJ9SL:OH6[O?UI9F?/HF1>B'@J(IU1Sd:_rEe}KgJeHcCaBcDcEeJgMhPiQlPkMfJcIaGbFbHcJ_G^H_}I`|Ka{Kd{Mf|Nf~N]xC]z@^{CDB6FD8KG<PG>RH>XJ?]M>`P@`Q>aR?`SB_VGcZSgb_ojnso~wqzt~xywppgg`a\\_`bfhopyz̄֎ߖ眙栞ݡף٤ڦئץԦӥѤ͢ɢȟÙ|rn}igld^`g[[kYUrWP}WNWORI[QXPZSkdyr|uqus_]QMECZT712*7+7(7'7&9(;+=/?18.<2@5<15(4(:/A690907.7+7):*?,A/=.@4E:G<C;<43-+&<9EBPMVSYVXRNKC:;*:(8,5../*2(3'8->,@*?)?(?&?%=%=#:':+<,9,6.545;984:3;4;5:595735435465454535/5,5)8,9*9(9&8&7%6%4&5/41504.4.5+6-7,907/:6?BmwbsSjIcKj6[6_<g>cNjIV^$#E-!?:'HE4PM<PI9EB1>B1?G/BH&EK%KS.S]8[kDavKd~NdJcF`Ba@cBeFjJlPnRlLjIgGfHfJfIcHaGeKdIbIdJgKgIe~Ga}C\\|=\\=_B=?4@B7FC<JE?PE?TG>[K>^N>aP>`Q<^SA^VIc[Xhcinlysouovptppmgfaa]^]]edkjus}{φَ易囖ٜ՝֞מ֝՞ԝўќ͜ʛǚēxtk|mdif]^f[YiZSoWM{UJVKVK]SZSXRfaqjvo~wuugdUSZU2,/%7)7&8&8&8';*;-=/9,9,:,:,9+9+8+8,;1908.8,9*9(:&9&6*80=5@8A9?7<4:24->6IAOGQINFC;7*8&8$7)4,//+3)7);+B*A)A'B#@!<\u001e=\u001e;\u001f: ;%;);-9197:;;94:5;4;5:595735446466564716/5,5)9*9*9(9&9&8%8%6&5+3-4,4,5*5*7)8+<23.54TYes[pHcIhAd;`4\\<bMmLb8?S*&A5)7:);<,B@1F@0@?-=B.?H-=C\u001dKP'\\b<fpKhvRf{Rf}QeNaFaAa@c@gFjJkMmOmLjGhHgGgJgJfJeIfKdIdHdHgGgGfEb~A^?_?bB7:/;=2@@8EB;KB=OE<VH=YL<^N>]P?\\SD^WMc]]ifmom{sqsoqkjfc`\\[ZZ\\]\\_hjnowxʁ҇؋ܐݓӓГГДѓГϒΕ͓ǔĔzr|ewu^fi[[e\\Wd[RgYLrVHTHZQ`Y\\YZXcbkiokvq}ynhaX5,2&9*:'9&9%9':):+:,:-6*5'8*>/>/7)/\":.8-7,8,:+:)9&7$6*6,8.;1=3@6A7B8:1A7E;F<H>G=@67+6%6&7,5003-7+9*<'='=%=#;!:\u001e7\u001c7\u001b6\u001e8\u001f6$8*;2<6=8;::94:5;6;79585755436475565726/5,5)8)9)9'8%8%7$7$6%5)4)5*6(7)7(7*7+<21+88kr]nPi<[Hl7]>e5[>bVq?Qa#(L/+;7+18(37&:;)B=*A<(@>)BB&?F\u001dXa4s~Tdw`iTb|MaI`E`@a@dAhGjJkMlNnMkHiIgGhKhKhLgKfKeJcHdIfHfHeFbBcDeEhH25*69.;<4A>7G@:KB=SF>VJ>XL>YM?YQD^WOc^bigronrormjga_WWTUWX\\_aclnrs{|΂Ոًی܍אҏΏώΏώЎύΏʎƏxo_p|Y`lXYd[T^_Q_\\IjWF}SEUL\\YZ\\X\\cgkkplxs|xzu~{ka<28);(;(;&:%:'9(9)8*;/6*5'9*>.>.8(/!6)5)5)7*9+<+=*;):-:/909/:1;1<3=3E=E;A9=3=5A7@8;16(5)6/31/5+6*:)<&9&;'<'<&<%:$:#:#8#7&8,;5>9?8:8794:5;6;79585755447586665726/5,5*9+9)9)9'8'8%7%7%5%6(7'9(9(:(9):+:14/ILoyVjE`<_Ag3\\8b>cMlOe0=J\u001d C1-11'/7(5<,>A.B@+B<$E>$IF%U\\0p~Mr|mjW_{J]~E_CaAcBfCkJmMmOmOoNlKiIhHiLiLjNiMgLeJdIeHgIhIgHdDgHiIlL.4(36+891<;6B=9H@=MD=QG=SI=SK>UNDZUQa^eigumklkkib`XVPPQQXY`cfjorux|Ѓֆى؊ً֌ϋ͉̊ЉшъщЌϋȍ~wmYjSZnVTc\\RZaOZ_HeZDxUBMETRSWRY^dejkluqunoh~v{~l`?28(;(<(='<';':'9)7):/8.8,9+:+:*9)7(9+7+8,7+7*8*<,>-<0=0<2;/:09-7-5*@7@5=49.80;1:25,/%0)2025/8-9+;+>-?/@/@/@/A/?.@.@)9)8,80:6=8=774386:7;6:79777654448486776746/6,5*8*9(9(9&9&8&7&8&8%:&;'=(=(=*=,<.7/<9^eaqPi<[Ai4_5a1YKlYq>NZ%-C),:20.1*08-8A0=B,<<\"A<\u001eUH(`[5|Tnwo[aK^F`DcBgDlGoNpPoSoSoOlKiIgGiLiLiOhNgKeIdHeIhJhHgGeFiKiKlN+1%.4*470894>:7B=:HA;KD<NG=NG=PKEWSR_^ffeugggfba[YRRNORS[^eilouwz|փ؆ن׈ՉӇˆȆ˅΅Ѕ҇҇ЍҌˍ{v}k{VcPVnUQd^P[eMYcJb^EsXCOEWRUZT[\\caggjpoyrqh|tsjxm\\Q;+5#<)=(=(<(;(;)9*7*6,7-:.:,:)8';*=,=.@2A4>18*5'8)<,:,:,;/<.:/9+5+5(6,;/>4?3?6>37.,#+%-*02391;0>0A1B1A1@1@0=/<-9,9*70</;0:4;6;6955538697:6:7977765445959677674726-6*7+8)8)9'8'8%7'9%9$<%=&?'@(@*?.<161HIfrOdHf7[Am/]7a4XQkUfm19E(,E697325426926=-5:#38\u0018CC\u001fja:Tw͙Ǖ}vbeQ`F`BcBiFoJrOrRqUpToOlKhHfFhKiLjOiOgKfJeIfIiIjJiIgFjJkMnP(0#+1'14-561764<87@<9C>8IE<HE<KHCRPQ\\Zecbtbb|``_^ZXTTTT\\]gipsvx{~ۃބ݄؃օԆу˂ȃ˂̓хԈՈӍҋȋ|wpwfp~U[|PQnUNf_O^fNZdIaaGq]ETF]TZ[VZ[a]daellzsrjxoYP[PD85':)9(;(<)=(;*;+9,6+0'4*8,;,;*;(;(<);*C4K=H:=/5'6(;,9)9)9+9)8+9*8,7)6+<.?4@3A7A5:11)0.145:6>4>2?0@0@.</</907-5,2+2+23;4;5;6:575565758697:899877767465:5:7:7985726-6+7+8*8*9(9(9&8(9&9\":\"=&?'@(@*=-;196U\\^qGc?a;b7g3b8`FdNa@IT15A55@:<:46?56>6389+6<\"9C\u001eSZ.QqŊˎ˔Í}{ehR_E^@c@iDoJsPsSqUoSoNlJhGfEgJiLiNiNfKdIdIeJiJjIiHfEjLlNoQ&.!)/%-2+13.333764:97=<7GD=DD<HGCPPRZZd_ap``z\\\\~`_][YX]]ggrtz|܁ႅ䅆ㄅჃہՃ҃΄̃Ʉ̃΅Ӈ֊׌ԍЌċxsnuqbewXVtSLjVKg`NbfO_eIcaHp^F{R@\\NZSTSVZW\\Y`ceqnmeqhD;A71%4&C28':(;'<);,:,7-6-,#1&6)<,@-?+;'7$4#B2OAOAB47)7)>/;+:*8(7'6'6(8*8+;.;/9-6*7,<1<271888=;B9B4A0=,;,:/;192:4849483657376;9<69454476;986979899877767465:5:7:8995827/7+8+9+9+;*:*:(:*;(9\";#=$>'?(?,<.92<?\\fQhIf9]=h.]<h;\\\\pLV^-0G85BC><89?48F37C41=:)>D(GV-bs?aˌɋËz{efPZ|@^?a>iDoJrOrRpTnRoNlJgFeDfIhKiNiNfKeJdIeHgHhGjGgEkLmOpR)/#)/%(-&+-(///3317759:4==5?@8DE@KKKQQYVXe[[s^]}YX[Y^]eennwx؄⌌솇䂂܀ւӃ΂ȃǃ˄ΆЈӋҌϊŊ}xwozkegf]Xm[Qm[Mi\\Lf^Kd_IeaHh`Io_FoP;UA^PbZYXQTS[\\`ggYRD<707/:1<0;-9*:(:):)8+8,5,5-/%3)8,>/@/A.=*:(9)0\"WJL@/#=1</8(;+:)9(8'7&6&5&4&7);.>2<07,8->4C<BE9?3=4?2@-;-:2=7@5;5:788;9;8977;=<<::8777767575979899::9;9<9<8<7;6:8:9:;9;5907,8+9+9+:):););*<)9#=':#4\u001e9%D3?60.^eVgIb<\\1X0Y6cBiYoFQo33N3,B?6>C<A89@-1L/3K2.B9(DI)Zm?~_włɋ~nfRYwCY{?^?cAiFnImLlNkQlPjIfDcBcBfIhKgLfKhNhNgKfHeGgGkImLqSrUtW*0$)/#).',.)//-220561782;<4>?7CD>IIGOPTSUaXYk[[u\\Z^]dbkjut~·ߋ鍍년 ؀~Ҁρ˅Ɇȇˉ΋ό΍̎Ȋ|x{stknlb`e]Re_Oe^Lf^Kf^Kh]Ij^Hk_Io_Fw_G[CYFZLVPRSQXX_USKF>9606/909.9*7(8(9)8)7+5,4,4-0'5)9+>.A/@-<*9(8)<.REH<4(:-:,4&=,<+;*;*:)9)8)7)7*8,7,4*1'1(7.<5DG8>/9/:0=.;1<6?6=3624:8DDIIDC?>:7989796778798988788999:9;9<9<8<6:596888;8:59/7+8*:*:*;*<+<)<+<)9$@*:%5\u001f;(;/94<?]iPdA[8W6[;`>dIe?L?>`;3G;/:>08>2F<:R>=N0.S8/VK7ciEx[p}Ɓ}xr^YuETp=\\{B_@b@iEmHlKkMjPiOgGeCcBdEgJiLiNhMiOiMiKhHgGhGlImLpSqTtW-1#-1#,/&,.)//-11/34/56.:<1<>1@B7FGAKMLQRWVVbXWi\\Yt^]fdpnzx΍ߐꐎ튉燄߁|}ȀņǈƊʌɎɍŌ|v{pujpoeci_Vc]M_aL_aKc^Jg\\Jl[In\\Ho]Ir^FwaIxX?S=VDXOUSOTMS>=<784716/7/7+7(7&8&9'8'6)5*3,4-3(6*8+<->/>/<-8*5)I?F<A7<26*:-6&:):);*:*9*7)6(4(9-7,4+3*3+6/:3<8<=4907293<4<7@=C7;AANMYUYWQNB>84627274748596::::77888:9<8<9=8<8;58585777:7:48/7,8+:+;+<+<+<)<+<)9&@*9$6$;+0'40PT[iJ`:U7V@]HfHdNa89e?6R@2DA09=,57)?7,L:0F.$R=,g]B_t{z{zm]vLHb5Nh8\\wB_}?c@hDlGkJiJgLgNdDdCcDeFhKkNkOkOkOkOiMhJgHiHlKoMuVtWvY24&04&12*01+12-23.34.46+9;-;>-?A3DF9JKENPORQWTT^XVd\\Zoda~nlzwÌ֑㔑ꓐ뎋≅ق||~Ì}{vyn~rgmmaak^Vi[Pc\\J^aL]aJc^Jh[JmZKqZJtZIv[FsWAxR;Q=ZG[PTPFI>A2/5/51605.5+6)8)6&8&9'9'6)6*3,6-7*8*7(9*=->/;-8+3)UK=48.A64'<-<-8(8'9(:)9)7)6(3'6*3)2)5-:3>7?9=:45596<5;2:397=<@UVbbmjidVQA<635061716374859699::78898;9<8<8<8<7<6;686797<7<49/9,9*;*<*<)<+=)<+<(:'@,8&8';-+\"54`iTdG]<U=XH`OdO_SZvGAXH9KD2FE1BE0=?*:8#;3\u001e?3\u001dPG*nkHfvtsxl[K_:BW0Mb7Yq?`|Ad@iClFiHgIeKeJbBcBdEgHjMlOmQnRlPjNjLiJiHiGmKpOvYwZy\\78(68*77-56056167267/68+;>-=@-@C.DG4IK>MNFQPNRRRVUSYX]a_lkius}ǌӕᔑ␍܋ӄā}||~zxtznzrfjm_^j[Ti[PjZKfZJb_Lb_Le^Li\\Kn[Lr[Kw\\K|[HVBS>RAVFSIG@88331-3/514/3,3)6)9(8$9$;':'8)7*5,7-:+9)6%8';+>/;.7,90\\T=55+A54%:(?-;*:*:+:,;-:-8-7-3*1)1+71<7>:<87477;<<?6;285:BFMOxwqn`[JC832.75?<939372726475767679797;8<8>8>7=7;8<7;7:::=:=7;2;/8*:*;*<)<*<(;);)<)>+9(9*8-/)@ChrM^H[EZH[O^T]TWXUdM?PM:LG4KF2FD-@C(>E$?I$KV.\\g<xThmnr}udRcC?P0BS1Oa9Wm>b{BeBiCkEiHfHbHcGbBfCgHiJkNmPnRoSkOkOkMiKiIkIoMrQvYvZw[?=.=>0==3==5=<7<=7;=2;=/?B/@D-CG.FJ3KL:NOAQQIRRHYWJZZN`_]gerqn{yďяӍϊǃ~yzwyv{v|y|}}x|tzrvksrffn`]j\\Sk[NlZLl[Kk[Ki]Mg^Mi]Mj]Mo^Ns^Mz]M[J`OVGN@J=@7601+1+51705/4-2)4'6&;(9$;$<';':)9*7,9-=,:(5#6$9)<.;/7-?7[TIA:0@36&3 <):(7'7'7(7)7*7,7-<3;3:4<7>:>:854196;;::8:>@ORbeppheUQ=61+40;7=;;9;5;5948375655566697:7;8<8>8>7=7=8=8;8:;:>:>7=3</8):);)<)<(;';':(<)9(;)9*6*>8TXepK\\I]J^M[QZVVZR`RPI7IN:NI5H@+;5\u001b78\u0018>O%Lf6lTw\\edflt|mn}\\Q`C<J09F,AP1O_;Wj=d{EfCkDlFiHeFaFcGcCiFjKlMlOlOmQnRmQmOmPlLlLnLrOsR{]{_z^EB1DB3DB6CC;CC;CC;BB6BC3DF0EH-GJ-JM2ON9RQ?TREUSD\\ZC\\\\D\\]Oaaaihxrq{z~È{ystoqlqmrnvpwrwrtoskzrinmb`l_Wj\\Qk[Lm\\Lo\\Mp]Lq[Mq[No[Pm]Nl_Om`Os`O{`OZM_SQGA:;46.1*2)5,706/4.4-4*5(8&9%:\"=\">%>'<);*9,;-@-<(5!3!8(<.:/5-93NITMB9B5?.1\u001d=)=-9+7*7*7+9.;1<4E>A<?;>;=;;:8885969566;<JK\\]deba=9824.92A=E@=;42;5;3949484847788697:7<8<8>7=7?6<6;7:89;9>9>6<2</8););(;';(:':':&>+7%=+9)2'PKkm\\fP^J\\HYLVRS[RcQjUJM8DL7JB/H9$B7\u001bFH#Up=gV~pqh}YYcd|_XfCHU9:F.7C+:D,=J0JX7Wh>e|FiDlEmGiGdGaGaGfFlImNnOlOkNkOmQpTqSpSpPoPqPvSwV|^z^y]IC3JD6IE9JF;IF=IG;HF9HG5IH3JJ2LL2NN4RP;TQ>XRDYTA]Y>[Z>\\YH_\\Udahnk~xs}x{}|}wvooilfiejfmhmimh|lfrkbgj`^g]Th\\Nh[Kk\\Io^Lq_Kq^Mq^Mp]Op]Op]Os]Ow]N~]N\\LXLVIF<9/7/7/7.6-6-6/5.4,5-7,8*6'6$:$<$='=';);*:,<-A/<'4\"3 9'=.;/8.3+A;[TI@D7F72\u001f>,F7B5@5?2@4A7E<F?@;=9:7755465:8<9?9=8:5@<LIQL?;)#-&6.>7@;>9;8;;==9696968695:699::88888;8;9<8;6<6<6:6889:8=8>6<1;-8*;*;);(;'<);(;'?-5\"=.8*/&\\Xy|X_XdQ^KTLOVR`UhVnVPW8?J*<;\u001cC=\u001bUQ+lvDf~vs|bnMvR^u}V[b@;D)4<%5=(=D2<E29C+CP2Vf?g{HiFmHmGjGfGbGcGhJlMoPoPlMiKjJjLsUsUsSrQrQsRyV{ZvZu[sYRK;RK;RJ=RJ=RJ=RJ=RJ=RK;UN<VO=WP>XQ?YR@[TD\\UE\\UEc\\Ib[IaYLbYRe][kaiqftuj{zn|pss|puj{mbrf^kc`k`_g_\\c_Z^^ZY^YUaZRbZOe[Og[Ki\\Kk\\Il]Hm]Fm\\Hj^HibOqfTqZJuOBWJ\\PZMZLM?E5<,7(8-80411-6/7.7.7.7.7+7*7)8)8)9)9)9+9+8+;,;+>-9(1 2!:+</9.6,5-:2B:K>H9=,2#PFKAE=E<G?G@C>=;7487;;::777585=7F>B9:03)1&6*;/@4:0=4@8@;=;;;8;9<7:8:8:999797959551516576899:9;9;;>9;9;=:A=B;A6?19+<+=*<(:&9'8&9&A0<-/#0'LJmoloVZLNNOPOUOXP]RaTjSWZ/:M\u00167F\u000fTa)~Poyys~ahN\\mCYdBT]BHP9?D0:=,@C2=A2;?1<C3:C0AN2Rd>]sBgHpKoKlGjIiKgLlPmSoSnPmMkJmJmIqMqNrNrPtRvVzY{^ycmZcPWN?WN?WN?WN?WN?WN?WN?WN?XO@YPAZQB[RC\\SD]TE^UF_VGd[Jd[LcYMcYOf[Uj_]nbdpdhreltgpvirvirsfmm`gg[_bXY^[VZZRZWPXULXTIXTH\\VH^WGcZKcZIf[Ig\\Hi]Gj^Fk_IiaJcbMngTv\\MSFWNVORJRFG:B2=,9)8,8062406.8.8.8.8.8-7,7+7+7+7+7+8+8+8+:,<.>.9(1 2 :)>.<.:-5+4+;2E:OBQCOCF?@;;6:5=7=886448:7879787797=9B<A7@5:,6'5&8)=-@1A4@6@7=8:777587<6<6<7:89879595:592:3:5;6;8;8::8::=:=<=?=A;@7=2<.;+=*=+<);(:&8&9'9'8)5*<5QPee^aNNNLSOXQ\\R^S_T_VfQ`_/Sg*^r3zOn|pbjHbvCTe;KY8FP7@I69?158-:</AB4=?4:=2>B4:C0@M3Rd>^tEhIqMpLnHmJkLjNmSnToSoQlMkHlHmHpJpJpLsQuTxXxXx^mXbQYH]TE]TE]TE]TE]TE]TE]TE]TE\\SD\\SD]TE^UF_VG`WHaXIaXGe]Je]Jd[Je[Oe[Qf[Uh]Yi^\\j^^j^`k_ak__i^\\f[YbWU_VQZUOWTKUQHRNCQMBSOCWQCXRB^WG_XFaYFc[Fg\\Hi^Hk`LicMbaMngUy_PXN[UVQIEE@@8>3;/8+8+9.;/:/8.7-8.9.8-8-7,7+7+7+7+8+8+8+9+;,>0?/:(2 2 9'>,?/?08+2(4*<0F9N@ND:643204297=<<=;<9<5:27375899<:@:8-:+6'4%5%8(<+=.D7C9B8>8966666796;7;7:8888:6:6;4:3;4;6<6;8:999889:<<@>B=?9;27+7(;,<+<+;):(9&8%9&z6#y6%9,F=SOWTPOIFMHSLZQ^SaWaW_VePsrFzVn{|[[o<@S%AS+BQ0?L2:C06<.69058/9;.@A3=?4:=2=A3:C0@M3Qc=`vGiJsOrNpJoLmNlPpTqUoSnPlMlIlHnIpLpLpNuSxXy[uWqX_JVGOx@aXIaXIaXIaXIaXIaXIaXIaXI_VG`WH`WHaXIbYJcZKd[Ld[Je]Hf^If^Kg^Mg^Of\\Pf\\Rf\\Sh]Wh]Wh]Wh]Wg]Tf\\RdZPc[P]YNZVKVRFRNBPL@PM>TN@UO?XRBYTA[VC]XDaZGd]Jf_LfaMdcQleUv\\O[Qb\\ZXFD<:<9;6928-8,;+?.?/9-7,8-9-8-9-8,7+7+8+8+8+8+8+9+;,?1?/:(3 3\u001f7#=)@.?-:+7*5*7+:.</:26624123488<==?<?7<380625587765615(7'6&7&7&9(:):*A3B6A7?8;88776796:7:78868694:4;492:2:4;7:8;9:899<:A=C?A;<36+6'7(;*;););(:&9%7#9%=*w6$5'E:PHMGLGQLPJULZO^RaVbWaWgT_ztsYN`8/A\u001b->\u001c4C&:F.=F3;A3:=2:=4<=5::.?@2<>39<1<@29B/?L2Qc=awHjKtPsOrLqNoPnPrTsUpRoPmLmJnJpKqMrOtSyX|]w[mSeM[HS|DNw?d[Ld[Ld[Ld[Ld[Ld[Ld[Ld[LcZKcZKd[Ld[Le\\Mf]Nf]Ng^Mf^Ig_Hh`IiaLiaNi`Oh_Ph_Pj`Tj`Ti`Qh_Ph_Nh_Nh`MhaOd^N`ZL[UGVPBPM>NK:NK:NK:QN=RO>TQ@VS@XWC[ZF]\\H^]Kb`Qf^QmWJ[Rjdc`MMBC;=8984709-=+B-B+;+7)8*:+9+9*9*8)8)8)8)9)9)9)9);,?1>0:(6\"4\u001e7 =&B-;*;,:,9-8.:0=3;59<4<3928385938176<494:7:9<7621/*6*9*:(:(:(:(9&7&:+;/>3?7>9;896876866667484:3:3<3:2;2<5=7=:><=;>=@<C=A<>67-5(7(:*;)<);*:(9&8%7$8%@-u4\"{3%G:RJNFNGWNVMYMZN]O]R`U`YhWh|j]kHDS42@&$2\u0019-:&0;*5=.9?3<?4=>6;<4::099-?@2;=28;0;?18A.>K1Pb<bxIkLuQtPsMsPqRpRrSrSrSpOmMmKpLsOtQvUzY{^z_qVdJZD]JW~GRyBe\\Me\\Me\\Me\\Me\\Me\\Me\\Me\\Me\\Mf]Nf]Nf]Ng^Og^Oh_Ph_Nh`Kh`IiaLjbMjbOjbOjaPjaPjaPiaNh`Mh`Kh`Kh`IiaJjbKf_Mc^K^XHXRBSM=MJ9KH7IH6LK9LK9LM;NO=PQ?QTCSVETUE[YL^VIcQEzXNhaeaVURS@C:>8783;.?-C*A(;*8)8)9*:+9*9*9*8)9)9)9)9)9)9);,?1>0<):%6\u001f5\u001d;#A*B.@/;,7*2(4+;2=:5:3<6=8>:>;>:=9<587:9>=>=>962/0'9+=,=,>*=)<(:'8%6%7);0=3<5<7;8:787757585:4;4<4=4>5?7A:B<A>A?A>B?@:@8=38-5(5'9)<*;*<)<(;'9'7%6$7&}:)t3!~9*OAYNRGOEWKYN[MZM[M\\Q_T`YgY~wZy`r|ZVaC;E,/;%0;*0<.3=25=27=3<?6@A9?A6<<277+89+>?1:<17:/;?17@->K1Oa;bxIkLuQuQtNsPrSqRsRsPrOpMnLpNsOvTyX{\\|]z]qWgO]EXBaOYISzCg^Og^Og^Og^Og^Og^Og^Og^Og^Og^Og^Oh_Ph_Ph_Pi`Qi`OjaPjbOjbOjbOi`Oi`OiaNiaNiaNh`Kh`Kh`Ih`IhaGhaGhaGg`Me^Kb[I\\WDWR?PM:MJ9IH6IG8GH8GJ9GK:HL;IM>JN?KM?PPDXRF[OCiRDZNVLSLZYIJ?B9975;1@.B*<$:)7(8):*9*:*:*:*9):):):):):):);,=0=/=,<)8\"4\u001b9 A)C-A/=/6+/%0'6.:8596>;C?EAEBC@A@@1266:<=;;9824.4)<->+?,@,>+?)<(:'7%7'8+8.7094<9>;979595:4;4;4=4>4B7C9C<B;A=?<=;>9<3:/8+6(7'8):):(<+<*<):'9(7&6%}6$x3#x5%C3UEWKPCPDZLYMZN\\Q\\Q[T\\U\\WbUkbEWa>JS4=G,6?*3>-4>35?66=69@9=B;CF=EG<DE7@>/;9*78*=>0:<17:/:>07@-=J0N`:awHkLuQuQtNtQrSqRqOrNqMpLoKrNuTyX`~az^qWfL_G]E^IbPYKSzEh_Ph_Ph_Ph_Ph_Ph_Ph_Ph_Ph_Ph_Ph_Ph_Ph_Pi`Qi`Qi`QmdUlcTj`Ti`Qh_Pg^Oh_Nh`MiaNiaLiaLiaLiaJh`IhaGh`IgaKg`Me^Kb[H\\WDUR?QN=ML:EF6EH7DH7DH7CJ:CJ:CI;EI;IK>SQDSPAYM=eK:tD6I?YSQQDE::86<4>/=)8\":)9(:);*;*;*;*;*:):):):):):):);,;0:.<,>+9#3\u001c7\u001e?'9$<)>0=28.7/<5?==B?DDHDE@?;7501./,51:6<6:28.8,;,=->+?,@-@-A+?+=*;*:(7(5)5+90>9C><7;5;5<4<5=4>5@5D9D:C;B:?:<785937-8(5'6':)<,:)8&=*<+<*<)~9)}9&{6&{6&z2$8*G8SCQCL=RE_SWLYN[R]T^W\\VZU_RaX;EM(6@\u001e8A&>G2=F53=2-7.1817>6CF?GJ?HI;BC1?>*;:&78(=>09;069.:>06?,=J0N`:awHjKuQtPtNtQrSqRqMqLqLpKpLsQwV{\\edx^jP]EYA^HePcSZLSzEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi_Sj`Wj`Wj_Yj`Wj`Vj`Vj`TjaRjaRjaPjaPjbOjbOjbOjbMjbMg_Jg_Jf^Ie_Ib]IZXCSP=ML:HI9EH7AE6@D5?E7?G8?G:?E9GK=IK=BF5KJ6\\Q;aE0J9j]g`USFEA@A=>5=0=-4%5&6'7(7(9*;,=.<-<-<-<-<-;,;,<-2(7.;/:+7\"5\u001f7!9\"A-=,6)4*6/<7C?HEDEFICE9861808.4+9/9.9/8-9,:+<+<+=+=*>+?,@-@.A/@-;*:(7(6)7,8-;3<4=6=6?8A7A9B6@6@5H=E;A8;25/3-0,2+9-;*9+:*:);+;+<+:(~9)|9(|9(|9){8'y6&x3$w- A6PDMAMARFUJRG\\R\\RUMTLZUXSWTgZ]T5IQ*BL)BK,>H/7@+2=-4?14<1HPCZ]RX\\MMO:DF.AA'==%:;)>?1;=2:=2<@24=*;H.Pb<cyJlMuQsOrLrOrSrSrNqKrNrNsPvU{\\bfx^jO`G^GaJfPiUdS[LTyEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`Qi_Sj_Yj_]j_]j_[j_Yj`Wj`Vj`Tj`TjaRjaRjaRjaRjaRjaPjaPh`Mh`Kg_Jg_Jd]J^YEUR?ON<IJ:FI8BD6@D5?E7?G8>F9=E6@F8>E5>F1HL5MI0U?(P<sdcX_ZUTGG@>A>?9:09-<-=.=.;-:,:,:,:,:,:,:,:,:,:,;.?5B:B7=/7$2\u001e1\u001d2\u001f5#7(:0A8F@IDJFKHCAEDB@;59/=0?1=0?1>2?1>/=/>.@.?,=*;*<+=,>-?,>,?-@.=-:,8,8+8-:09/;3;4?5B8C9C9D9E8B6A4=3:06/5.5/7.</=,;,;+:*;*;,<,~;*|:*{9)y:)x9(w8'v7(w3&3)C9NCL@K?QDTIRGSJXOUOWQ]XWRSOcT]W5Xc9_jBZfBIT66C)4@*<H4OXGYbQ_fTW\\HJN7BE*??#<<\"9:(=>0:<1:=2<@25>+;H.Pb<dzKlMuQtPrLsPrSqQsPrLpLqNtSxY|_c{aoUcJ]DaJeNeNcOdS[LTyEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QjaRjaRjaRjaRjaRjaRjaRj`Vk`\\k__k__k`^k`\\k`ZkaXkaWkaWkaUkaUkaUkaUkaUkaWkaUlaOk`LiaNiaNf_Ma\\IYVESR@NL=IJ:DF8AE6AE6?F6>D6<D5=F57@-@H1IK3F?%W?'ZErbVJbZebTSFHGHCD:77-:,:,:,9,8+7*6)8+7+7+8,8,8,8,8.3-5/6-3(0\". 2!3$@4C7G?LFMIJGFBD@CADA@:;1</A1E4E3D3D4B2A0@0A/~A.@.:*9+:);*<+<+=,<*?.>.;+9*8+9-:/9/9090;0>3?4A5B4A4:.9.8-7+6+8-8/;1</=-;-;,:+;+;,<,};+{<-z;,w9*v8)u7(t6)v4&<2G=MDJ?H<OBTIRIOITOSQWS]ZYU[Tl[}X~^alxRLX46D#=J.LZ@eqYeoW]eMPU>EI0?C(=@#:<$89';<.9;09<1=A36?,<I/Pb<dzKmNvRtPsMsPrSpPuRpLnLpOwV{\\}a|bpUfM\\E\\EeMjRfN`IcRZLSxEi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QjaRjaRjaRjaRjaRjaRjaRj`Vk`\\k__k`^k`\\k`\\kaXkaXkaWkaUkaUkaUkaUkaWkaWkaXkaWnbRmbPjbOjbOibPe^L_YIYVERO@NL=GH:DF8CE7BD6@D5<C3<H4:C.FJ3MG1P;&qL9bQ^PA5SLc_^^SUJODJAC929-7-7+8/:/;2:0>6>4=6>4>7?5>7>7@<B>D>F=F<I>M@QESJQJMGIEFCC@A=B=FBD??7=0?/C2H4I6G5E3C3B2A0~A/zA0}@.:,8,9+:,:,;-;+;+:+9+9*9+9,;/=1<0:/9/:0:.:.:.9+8*7)7*6)6*7+8-9/<0<.<-;,:+:+~9*~;+};+|:,z;,y;,w9,s8*q6(r7)u5)C:I>KAH<I<ODTKTLQLTPQOSO\\X_Xh^~jpfuWYh?CR+?O*P`<crQetU\\iKOY>CL1?E+?C*=A(;='78(:;-79.9<1=A37@-<I/Oa;bxIlMvRuQtNtQrSpRsPoMoMsR|]~ay_tZcJ^E[D_HgOjPfL`HbQY~KRwDi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QjaRjaRjaRjaRjaRjaRjaRj`Tk`Zk`\\k`ZkaXkaXkaUkaUkbSkbSkbSkbSkaUkaWkaWkaXkaWocUnbRkbQlcRkbShaQd]M`ZJXRBSP?NK<IG8GE6DE5BC3>B1=I1?G/LG1S>+g=-ZL_S>63+?9XUigdeRUJNOQIDF<@7>4?7D:F>G>JBJAJCJBKDKCKEKESRTTSRSPSLSLTNUPLHIFEBC@B@C@EBGEIHDA?8=2?2B1E3G6E3D4B3A1?1~?0z?1|>/:.9.9.:/;-;-;-;-9*:+9+9,;,;-<.;/:19/9-:.9,9,8*8*8)8)8(8)9*:,:-;-:-:,9+8*}7+}7+|8+{9+{9-y9-x:-v8-q5*o5)q7+u:,H=J?I=I;L@RFWMXOQMUQSPVQ`YbWg[{enrQZi@JY0BS)IZ0WiAdvNj|VXiEL[:?L.:D)<D,>C-<A-:=,89+:;-79.9<1>B47@-;H.L^8_uFiJtPtPtNtQsTqSnMmLpPwY|az`rXjRZC\\EaIeMgMgKhJgMcPZ|JRtBi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QkbSkbSkbSkbSkbSkbSkbSkaUlbYlbYlbYlbVlbVlcRlcRldQldQldQlcRlcTlbVlbXlbXlbXocUnbRkbQlcRlcTkbSg`Pd]M^WGYSCTN@MJ;KH9GE6FC4@C0;H.@I.OC-a=-F;YSNJ,+:9=;SRpnvvehX^^_UQPFG@C:D=G>GAG?HCJBHDJCJFKDKGKGHHGIHHGGHDHDGDEDBAABBABBCBB@A>A?IIC@<6>3@3@2B3D3A2@1?1=1<2<1=1=1;1;1:3;1;1</<1=/</=-;/;,:,9*8+7*:/8.9-:/;.=.</>.9+:+:*:+;,;+;,:+:,9+8*~6(|6*{5){5){7*x6*x8,x:/s7,p4)o5)r:-w=1M@K>J<M=QCVHXMWNNITOVR]Ve\\|_QgWGa_HEO->N)?O(J\\4_qGk}SewMXj@N`8@Q-6E&7D*=F1=D4:>07;-8:,:;-68-9<1?C57@-9F,I[5[qBeFrNsOtNtQsTqSmLoOsUx\\z`s[iQ`HYB^GeMgMgKeGgGhLaNXzHQsAi`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QkbSkbSkbSkbSkbSkbSkbSkbSlbXlbVlbVlcRlcRldOldOldMldMldMldOldQlcTlbVlbVlbVocUnbTkbSlcTmdUlcTjaRf_Ob[K^WGXQARL<OI9JG6IC3AC.:G+AG+U@+xG9PLII8<39AE?@JIb`qpnpbeZ\\QNLDE@B;D?E>B>A:C?C=C@D?DBD@ECDCADADDFGHIHJIIIGHACADBEBEAA@>=:=:FF=<83<3@4?1>0A1=0<0;1:08193:4;4;3<3:4<3<3}=1}=3}=1|<0|=.|<0|=.};-{9)z8*{7*:.9.9-9.9.;.<.=-9+9+;+;*;+<*;+<+8*8,~6*}5)|3*z4*z4*y5*u2)v6,w9.s7,p4*o5*s:/x@3QCN?N=Q@VFXIUJSJPJSPTR\\Ve\\n[LPK7EK1AN0KZ9WgC`rLgyQdyNWm?G\\1AV-7H$1@!6B*=F5<D98=67:3:</;<.79.9<1?C57@-7D*FX2Vl=b~CoKqMsMtQtUrToPqQuWvZsYjRbJ[E^H`IdLfLhJhHfFeIaNXzHPr@i`Qi`Qi`Qi`Qi`Qi`Qi`Qi`QkbSkbSkbSkbSkbSkbSkbSkbSlbVlcTlcTlcRldQldOldOldMldMldOldOldQlcRlcTlbVlcTnbTmaSmaSmaSmdUlcTjaRg`Pd]M_YIZSCTN>PK8MH5ID1DC.@F*DD([B,TG\\X>A/5HO?E;>;<FGZ[efY[GHJGEBB?B>FBFBB>?8D?D?D@EAEBECDEDF@D@DBEEGGGFFBC>?BD@C>A=>>>A?C@ECCC9850;4?6>3=/?2</:0:081839494;5:3;3:2;2~<0~<0|<0|<0x8,y9-z:.z:.{<-{<-{<-z;,};/9/7.7,6*5*7*8)8,9*:-<-<-=,~<,~<,}9,}7-|6,z6+z4*x4)y5,x5,r2(u5+v8-r6+n4)n5*t;0xB6UGPBO@SDWIVJRGNGTNUPRKXOcUf[GGK2=J,IX9ZkIhyUcxQZoFSh?Pb:L^6;M'0?\u001e,9\u001d5>)=C5<B8:<79<5;=2;=079.9<1?C58?-8B)EU1Uh;azCnMrNrPtQtUrTtUuXv[tZoUfN^H[DdNaK`HcIhJiKeEaE`MWyGPr@i`Qi`QjaRjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbQkbQkbQkbQlcRlcRlcRlcRlcTlcTlcTnbTk]PqaRtdWrdWnbVj`TiaThbTgaSebQc]M[VCVQ=TO9NH2GA)KG,I?$bI3gWwnlgYWPRBEBEDGFHHKJKLMKMEEDEEDFEFBC?D=F<C:D;E<E?D@CCAD@DBFBDCDDEDEEFEDEECCB@@?@??>@=A>C?B??;9370:0=2>3>2?4?3=2<493839292;0<.<.;-;/;/:.:.~:-~:-~:/~:/};/};/};/};/}90}90~80~8.7.7.8/9-7.~8,}9.|8-{9-z8,x8,x8,x8.x8.w7-v8-v6,t6+s4+q5+m1'r6,n4)m3(o6+m4)q8-I=SHSJRJQJQIQJQKRLTMTK[NcQo_HYU:MV7O_;j~YbxQZpIUjCRg@Pa=IY5DR17D&4>#2:#6;'<>0@B5@@6<>358-39-4:.7:/9=/;?.=B,=F)S_;arFoRtUtStSsSsUuZ~e~epYbK^G^H^G`IbKdMfNeMcK`H^G_LTvDKm;i`Qi`QjaRjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTnbTrbSqaRrbUrdWrfZogZmeXjdVgcWliZmjYjgThcOc^H[U=RL4PJ0I?&Q?)kP=XINDE=EAWVTTQQPONMMMMKKJTTHI=>=:B@EAB;>4D9F:F=H?FBDDAEAEBFCDCDDEDEEFFDFDEAD@B?A>A=A=A=C?E?C<>6;190:/<0=1@4~@5~>4=4:3919290;.<-<-;,;-:,:,:,9-9-9/9/~:/~:/~:/~:/}90}90}90}90}90}90|90|90|90z:0z:0z:0y9/y9/x:/w9.w8/w8/t8.s7-r6,r6,p6+p6+l2'q7,m4)l3(o6+l3(p7,~H>SJSLQLQMQLPMQNSOOGSH[K{ePsiPilMfqQgxT^tMXnGPf@Ma<M^<L[:HU7CP4<F-8@)6;'7:)<=/?@2>>2;=04:04<15;16<0:</<?.>A,>D*Q[9^mDnSsUrSsSsSsVx^|exakT`I]F]F\\E`IaJdMeNeNbK`I^I]LRtBIk9i`Qi`QjaRjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTnbTqcVo_Rm\\Rm_Tqd[og\\ldYhbVfbWqma{xi~{jzj{vcqjWe`JTT<FF.C>(MB.S@/U8*]7*m>4n70u91~;5@:IBPJXPZT^YROGEB?DBEDD@@:A;C<E>G@GCFFEFDFCDCDCDDEDEEEECFDECDBD?C>C>C>C=C>E@F@B<>5:18-9.;/@2?3~>2>2:1919290;.<-:-:-;-:,:.:.9-9-~:/~:/~:/~:/~:/~:/}90}90}90}90|90|90|90{8/{;1{;1z:0y;0y;0x:/x:/x:/t8.t8.s7-s7-r6,q5+p6+o5*j1&p7,m4)k2'l6*i3'm7+}G=PIQJQKQLRMTOUPVPWO[P~^OtbNoiQorUlwYfwUQeBK_:EY6DU3EV6GV9GT8ER8@J2<D/9>*7;*:<.<>0;=/9;.6<25=26<26<0:</<>0=@-=C)MW5Zi@h{MnPpQsRuUtWz`w`nWcL\\E\\E\\E[D_HaJcLdMcLaJ_H]H[}JPr@Gh9i`Qi`QjaRjaRjaRkbSkbSkbSjaRjaRjaRjaRjaRjaRjaRjaRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTnbTrdWpbUm_Tl_VkaWlcZle[jf]jf]yujx~r}zg`cNOT>DG2GF2HC0F=,L<,VC4P9+R6*V4*Y4+\\6+a9/e=3n>4KBRLUQOLFFABDCGG@>A?B>E@ECFDEDEDDDCDCDDDDDEDFCFCFBFBE?E>D=D=D=E>D<F?F>A8;18,8-;.@0@1~?0>0:1:/:0:.:-;,:-:-:,:,9-9-9-9-~:/~:/~:/~:/~:/~:/}90|90}90{8/{8/{8/{8/y9/{;1z<1y;0y;0x:/x:/x:/v:/t8.s7-s7-r6,q5+o5*o5*m4)j1&o6+l3(h2&k5)h2&l6*|F<OGOJPKRMTOVPWPZQ]RaUy_Pj[Hd_IdhO\\fKN]@EU8AQ4>M0=L/?M3DQ7FR:GS;BK6>G2:A/9=,9=.9=.8<-7;-7=36=56;47=3:<1;=/<?,<A*JS4Ve>dwIlLpQuTwWxZ{ar[eN\\EZC\\E\\EZC_H`IaJbKaJ`I^G]HZ|INp>Ef7haQhaQibRibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTrfZth\\sf]ndZjaXle]snh{xq~wz{kdgTOR?GJ7EH5BE2BE2EH5KL<JH9GD5D>0B:-A7+@6*G5)S5*qB8PHPKHIGIEIBE@B@BBADCEAFBEBDADDDFDFDFDDEDEDEDFBFAF>E=E=F=E=F>A:C;E=B9>3:.;.=0?0?/>.>.;/:-;.;.:-;-;-:,:,9+9-9-9/~:/~:/~:/}:1}:1}:1}:1|91z:1|91y90y90x8/x8/w8/y:1y:1x90v:0v:0u9/u9/t:/r7/q6.q6.p5-o4,o4,n3+m4+j1(m7-j4*h2(j4*f2'j6+}D;NGNHQJTLUOWPYR\\R{YMw]PkZJ]UBYXDY^HOYA?K3:H/7E.5A+5A+8D.?H3CL7EN9BK8@I6<E4:A19@07>.5<,4:,5<45<56;56;49;0:</;>-;@)GP1Sb;buGkKqRwVyYy[x`nW`IZ}C\\E^G^G]F`IaJbKbKbK`I_H^IY{INo@Ef9haQhaQibRibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlcTkaUoe[pf\\lcZkd\\rmg|ľrgdUPQ?FI8>E3;D1:F28E38E38C3:B3<B6@C8CD<HE<>4*P:/e?6EAPOX[RWCIFJEFFFFEFCDBE@CADDDFDFDFDCDCDCDCEAFAF@F=F=G=G=E=?8@9C:C9A7=0=/=.>/?/>.>.<-;-;.;.;-:,:,:,9+:+9-~8,~:/~:/~:/~:/}:1}:1}:1}:1z:1z:1z:1y90x8/v7.v7.t8.w8/u9/u9/t:/t8.s9.s9.r8-q6.q6.p5-o4,o4,m4+l3*j4*h2(m7-i3)f2'i5*e1&i5*{B9MGMHPJTLVOXNZP|\\Qs\\Nl\\M`WFVSBQRBJQ?@I64@,3<+2;*09(09(2;*5>-9B1<E4?H7?H7>G6;F5:C25@/3>-1<,3:33954954928919;.;>-;@*CL/O^7`sEkMrSyYyYwYqYfOZ}CX{A\\E^G^G^G`I`I`I`I`I_H^G^KXzHLm@Cd7haQhaQibRibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlbVj`VjaXkdZlh_uplμzym]_YIKL:AF2<E0?K7>I8>F7;C6;>5:;3983872==3C<2N71a84HH]_`dWZQSNOMKKJHGFDDABBCFCGDFCECECEBBCBDCD@D?F?E>E>G=E=@:@:B:D;C:@4;/9+=/>.>->-<,;,<-<-:,:,:.9-9-9-~8.}9.~:/~:/}:1}:1}:1}:1}:2}:2{;2y:1y:1x90w8/t8.s7-r8-t8.s9.r8-q8-r8-p7,p7,p7,o6-o6-o6-n5,m4+l3*l3*i3)h2(k7,h4)f2'h4)b0%f4)zA8MGNIPJULXNYOxZOr\\Nk^N_XHRPAKN=EI:9B13;,08)17+17-06,06,06*17+2:+4<-9D4;F5=H7<I7;F56C13@,1>-.800621622717829;0:<.:?)?H+LZ6]pCjLsVy[wYsVgP^IVyAX{C[~F[~F[~F]H_J_J_J_J_J^I]H]JUvIJk@Ab7haQhaQibRibRibRjcSjcSjcSibRibRibRibRibRibRibRibRkbSkbSkbSkbSkbSkbSkbSkbSlcTlcTlcTlcTlcTlcTlcTlbVqh_ng_mhbtqj}ub^\\GKM7CH2AI2AH6@G7BD9BB:B=9C97?:6:=6>?7C82J.+e77QRhjnm\\\\ZWVSQNMLHHCDBEDGDGDFCECEBDBBBBDCCBC?D>E>E>G=E=C=A9B:D;E:A6:-6'</=.=->-<,<,<-<-:,:,:.9-9-~8,}9.}9.~:/~:/}:1}:1}:1}:1}:2{;2z;2w;1x90v:0u9/s9.r8-r8-r8-q8-p7,n8,p7,m7+o6+o6+o6-o6-n5,m4+m4+j4*i3)h4)f2'k7,h4)c1&f4)b0%e3(xB8NHOIRMVNXOzZOq[Mj]MZTDIJ:@D5>D69A219,/7*6<247058157247025.06,08-2:-6A3:E5=J9>K9<I77F33B-1>-,6..400511606718:/:<.:?+<E*IW4[nAiMrVx\\uXpU`IX{CSv>WzB[~FZ}EY|D\\G_J_J_J^I^I]H]H]LStIHhA@^8icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSjcSkbSkbSlcTlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUldWjc[gd]vsnɷƵibbFEH-EI0CG0FE3GC7F<3C60G53I;:>=9>?:B:7I75cGFjjœ譩ҋtn]XSPONKMFKFKDHIKEG<?>@GIDG:=@@@@A@B@C>C=A;A9C>A9@9A9B8@5:.8*=0>/>.>-=,=,<,<,:+9-9-~8,~8.}9.|8-|8-|90|90|90|90z:1z:1z:1z:1y=5w<4w;3u:2t91q8/p7.p7.o6-m7-m7-l8-m7-l8-m7-m7-i2+m6/p92p92l5.g2*g2*h3+e0(i7.d2)^.$`0&_/%b2(s>6OJQLQLRJ}XOx]RhXITN>DE5@D5:B37?24</3;04:049279478366457246116//6./7,.9+2=-6C2:G6:I68G44C.1?.*4+,2.-2./4.45/79.:</:?+6>&ES2YkCjRu]y_rYkR[~DXyDTu@Tu@XyDZ{F[|GZ{F^JbNbN^J\\}H_K`L_NTsJFd@<W6icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSlcTlcTlcTmdUmdUmdUmdUmdUmdUmdUmdUmdUmdUldYgd]onjͲcgjKLQ3GJ/EC.GA1H>4I:3L95K<9?:7CB@NIF]RPyjgβſ벩͂|c^VVRSHMADDEEEHHJKEF<><>AC????A@A@B>B=A<A:A<@;A:B:C;A6;18-=0>/>.>-=,=,<,<-9-9-9-~8,}9.}9.|8-|8-|90|90|90|90{;2{;2{;2z;2w<4u<3u:2s:1r90n8.p7.m7-m7-l8-l8-l8-l8-j8-l8-l8-k6.n70p92n91l7/i4,g2*e3*c1(d4*_/%^.$b2(^.$`0&p>7KFRNXR~XOrVKdRFRI:A?0<@18@15@23>04<14<15:37:379677577557246116/07//7,.9+1<.5B19F59H58G44E24B1.8//6/.3--2+23+46+8:-9=,7?(DQ3YkEjUv`ybpZgQY|DWxCTtBTu@VvDYzEYyGYzE[{I_K`N\\}H[{I^J^~L^{MSnKF_A9R5icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSkbSkbSlcTlcTlcTmdUmdUmdUmdUmdUmdUmdUneVneVneVlfZed_y{xشŠl`gEQX9EH-DC.JD4LD9KA8J?;C;9SJKia_wvecBEDIRVUTMKDACAFEEFDDCD=?>@@?@?B@B?B?A=@;@:C;E<D<B7<29.<0=0>/>.=-=-=-=-9-9/~:/}9.}9.}9.{8/{8/}:1}:1{;2{;2{;2{;2z;4x<4t;2q;1r90o9/n8.l8-l6,k7,l8-j8-j8-j8-j8-i9-j8-j8-n91m82m82m82m82i70f4-c1*e3,a0)],%_0(c4,\\-%_0(sD<}PKVP~YQpSK^J?OC7@=.46(3:*1<,1<.2=/5=26<27:37:379679668368357227018008-.9+0;-2?.6C27E48G49H59F54>33:205.,2(/0(13(57*7;*6>'ER6[lJmZyfyflZ`NWwEWuCUrBUsAWtDXvDYvFYwEZwG^|J_|L]{I]zJ_}K^{KZwKPgJAW@3I2icSicSicSicSicSicSicSicSicSicSicSicSicSicSicSicSjcSkbSlcTlcTlcTmdUmdUmdUmdUmdUmdUneVneVneVofWmg[jkfڴefmLNR7FH0JI7KI<HD9D@7OGDj`_収cf@?PKTMPHGAGBMJKH@?>>???>A?A?C@B?B=>9@:C=E?E>A9=5;2<1=0>/>.=/=-=-</9/9/~:/}9.}9.}9.{8/{8/~;2~;2|<3|<3{;2{;2z;4x<4r90o9/o9/m9.l8-k7,j6+h6+i7,i7,i7,h8,h8,h8,h8,h8.m;4l71j5/i70j81j81f4-a0)e4-a2*].&a2*b3+Y*\"a2*yNG\\VvWRjOHXD;I<3@:.:;-8<.08)/:*3;.4</6<26<27:169279479468349238139/19.19..9+/:,1<,2?.5B17E4;H6<I89C87?428.-3'./'/1&24'48'4<'ER8_pPtd}nyifXU|GSsBTqASp@Sp@TqAUrBVsCVsCXuE[xH]zJ]zJ^{K_|L\\yIWrIK_F<M;.?-gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSicSjcSkbSlcTlcTlcTmdUmdUmdUmdUmdUneVneVofWofWofWng]qqoѯ}bY]BIM6GJ9FJ;CF;AB:c^X}z騤idMBPDYN\\RQHD=A<DAA>@>@?A@C?C?C?C??;A<E@E@C>@9=7<4<1<2=1=0=1=/=/=/~:/~:/~:/}9.|90|90{8/{8/|<3|<3|<3{;2z;4y:3y:3w;3n70m80m80l7/k6.i7.h6-h6-i7.h8.h8.g8.g8.g8.g8.h8.k92h6/f4-g5.i70h70e4-b1*c2+c4,_0(]1(]1(W+\"c7.{ULtXTaNHN?8A7.=6,;9-9;.9<139-3;.5;/6<06<07:/68-47.69049238139/39/2:/19.19,08+.9+/:,1<.3>.6C2:E5<G7=E8:B55;/06(02'02%13%26%2:%GS;dtWyk~rsg]RJp?Oo>Qn>Qn>Qn>Qn>Ro?Sp@TqAWtD[xH]zJ]zJ_|L`}MZwGSmFCU?6D7(6)gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSicSjcSkbSlcTlcTlcTmdUmdUmdUmdUmdUneVneVofWpgXpgXoh^lnmz׹ĦrggONP;GK:FL>HPEKQG{{sžؓeSK;TFWIF;@8KEC>C?C@C@C>C>D>B=B<C?DAD?A==8;6<6;3<4=3=2=1=1=1=/~:/~:/~:/}9.|90|90{8/{8/|<3|<3{;2z:1y:3x92w81u91n70m80l7/j8/i7.i7.h6-g7-h8.h8.g8.g8.g8.g8.g8.g8.h70h6/g5.g5.h70h70g6/f5.a2*e6.^2)\\0'`4+a5,i=4uSJXG@E>6<5/:6-;8199/57,36+7:/5;/7:/7:/69.58-57,36+28,19,28.19,19.19,19,19,08+08+.9+/:,0;+3>.6A18C3<D5:C28>05;-57*35(13%04%18&HT>gw\\wmvlh_RwKBh9Kk<Nk;Pm=Pm=Ol<Nk;Pm=Qn>WtDZwG]zJ^{K`}M_|LVsCNg@<J90;3%/'gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSicSjcSkbSlcTlcTlcTmdUmdUmdUmdUmdUneVofWofWpgXqhYoh^hikmtzƯ}vn[ZWFPQCSVK\\c[fme񪔼o[VDRCPDLAJAG@E@E@E@E>D=C<B<C?E@EAC==9;5;5<6<5<6<5=4<3=1=1=1~:/~:/~:/}9.|90|90{80{80{;2{;2y:3x92w81v70v70t80n70k90j8/j8/j8/h8.h8.h8.g7-f7-f7-f7-d8-d8-d8-f7-g6/h70i81i81h70i81j;3l=5g80l=5c7.a5,oC:xLCtI@nMDD:167/45/891:;556.14+25,58/58/57,46+46+46+46)48*08).9)08+08)08+08)08)08)19,08+08+08+08+2:-3;.4<-9B1:C0;B2:A1:<.68*35'/3$29'IU?eu[oghbYyTInE?d8Hg;Li;Ol>Nk=Mj<Li;Mj<Ol>UrDYvH[xJ]zL^{M\\yKQn@G_;6B4+4/#)%gdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSgdSicSjcSjcSkcVlbVlbVmcWmdUmdUmdUleUmfVngWogZoi]oh^mjekormtzη|ubb_NXZL^dXmwn|}̻pRESFTIC:IAH@F@F>F>E=C;C;G>G>G>C;>5;3;4>6=5=6=5=4<3<1;1;1~:/~:/~:1}90|90|90{80{80z:1z:1x92w81v70v70u6/q6.m80k90k90j8/i9/i9/i9/i9/g7-f7-g7-f7-f7-f7-f7-f7-f5.j81m;4k:3j92j:0m>4oC8mA6oD;e=3d>3zVJdZyWMbLA>:13814927<569214-25,9<336-25,24)03(13(25*46+47,/7*-8*/7*/7*/7*/7*/7*/7*19.08-08-/7,/7,/7,08-08+7?09B1<E4=D4;A38<.26'-4$2;*JVBcr[i{a^uXRmLGeAAa:Hd;Kh<Nk?Nk?Kh<Jg9Li=Nk=TqEXuIZwK[xL]zNZvMNjAC[;2>4*00!''heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVjdVjdVkeYldYlcZmeZmeXmfVg`NkfSnkXol]he\\feasqrԶ|qtY_dMdkYr}lا`XE>NGMCF>D9F=I@KAH@G<G8H8J8H8E5B4B5C5B7B6A5>3<2:19191:2~:1|91|91{80z7/w7.w7.w7.w7.w8/w8/v7.u6-q5+o4,l7/i81i81h70h70g6/g6/g6/f5.g6/i70i81i81g6/f5.e3,h3-j5/m80k90j:0i;.j>1kA3gB2jI:dH:v_O~k\\xjoRJ=79.4:04:039/39/39/28.28.17-17-36-06,25,06,14+/5+/4-.5-/4-/4-/4-/4-/4-/4-05.05./4-.3,.3,/4-05./6.1;23=26@59C89D67B45@03>-4?.DQ=XfO[kQRbHEX<BU9BW6Jd?Ke>Ke>Ke>Je<Je:Mh?Oj?UpGYtK\\vO]wP]wRWqNHaA;N8&1+&+.$),heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVkdZkdZlc\\md[meZmfVidQjhSmjWjk[gg_lll~ϰvkqUZbJbkVuo~uKAMBJ?L@K>E9=4?6E9F7J7L:I9F6C4C6E7C7B8A7>5<4:39193:3}:2{;2z:1y90x8/v7.v7.v7.v7.u9/u9/t8.r6,p6+m4+l7/i81j81h70i70h70g6/g6/e3,f4-g5.h6/j81j81k92k92k60l71k90k;1l<0j>1j@0iD2gH6lQ>gRAvgTuesrKL<69.39/39/39/28.28.28.28.17-17-17-06,06,06,/5+/5+/4./4./4./4./4./4./4./4.05//4./4..3-.3-/4./4./6/.80/:22>44@66B66B66B45B16C1CP>P]IR`IIW@AO6BP7FV;Jb@Ke@LfAKe@Ic<Hc:Id;Je<SnEXrK\\vQ]wT\\uUTmOC\\?6I5&1-',0%*.heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVkdZkdZlc\\md[meZmfVmhUljUmjWjk[kkcwwwۿʫyuy`kpZt{i؞M?RDL=@1G;YMUJ@4D7H:K@I=C8?5@7D=@9B:@:>8~>5}=4<4}=4z;4x<4x<4w;3u:2t91t91t91r90r90r90r90o9/n8.l6,k5+m80j81l71j81k60i70i70h6/g5.g5.f5.g6/h70i81k:3l;4l;4j;3i:0h<1k?2jC4iD2fE2gJ8lVAjYGujVm{mDG658-39/28.28.17-17-17-17-17-17-17-06,06,06,/5+/5+/4./4./4./4./4./4./4./4./4./4..3--2,-2,.3-/4..5.+5-+6.-9//;12>25A56B47D38E3?L:ER>CQ:;I28F->L3DT9J_@Jb@LdBKc?Ia=G`9F_8G`9RkDXpL]uS^vVZqTPgK=T8.A.&1-',0%*.heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVkdZkdZlc\\md[meZmfVniVljUlkWlm]pqiؼǫ}ſ²pP@O?XJM?E9G<A6E;IAF>@9;6=8B??;@<@<}@;z?9y@9y@9y@9v=4v=4v=4u<3s=3r<2r<2r<2o;0o;0o;0n:/k9.k9.j8-i7.m82n72n72l71l71k60i70i70l:3j92h70f7/f7/g80h91g;2j?6f>4e=1f>2hC3iE5fG3cG2cJ6hV@i\\IskVozor_9=,28,28.28.17-17-06,06,06,17-17-17-06,06,06,/5+/5+.3-.3-.3-.3-.3-.3-.3-.3-.3-.3--2,-2,-2,-2,.3--4-*4,)4,*6,+7-.:01=14@46B46C2:G5<I78E12?+2@)8F/>N4DX<E]=K`AJb@K`?G_;H^:F^:ShGXpN`uV^uX[oTLcI9M4):(%.+%*.$)-heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVkdZkdZlc\\md[meZmfVlgTljUnmYop`tumؿʱ½ŜbPJ:L<QAL>@7C;F@D?>;:8::>==;?<@=}@=xA<tB;rC;rC;q?6s>6s>6r=5r=5r=5p>5p>5n>4m=3l<2k;1j;1i:0i:0j:0n72p62p62n72m61l71i70i70l;4k:3h91e90e90e90f;2d<2fB6dB6cC4dD5dG5dI6bI3_I2^L6eV?jbMrmWor\\aM3:(28,28.28.17-17-06,06,06,17-17-17-06,06,06,/5+/5+.3-.3-.3-.3-.3-.3-.3-.3-.3--2,,1+,1+,1+,1+-2,-4-,6.+5-*4,*4+,6-.8-0:/2=/2=-5@/7B15A-2>*1=)5A-8F/=O7@T9FX>H\\@J]?I^=K^>K`?TgI[oScvZauZZlTJ]G6G4'5&$-*$),\"'*heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVkdZkdZlc\\md[meZlfVjgTkjUlnYorasvmθκƶøͧkX[GWEL;D:D<E>E?A>=::9:;=<?=?=~A<wB<sD<oD;oD;p?8q?6q?8q?6q?8q?6p?8o?5o@8n?5m>6k<2i=4h<1h<3l;4o83r73p62p62n72l71j81i81h70g80e90e:1d<2e?4f@5dB6_C5aG8cL:dM;cM8`K6^L4]M4^R:bX?mhRss[nv{eFO:4=*39-39/28.28.17-17-17-17-17-17-17-06,06,06,/5+/5+.3-.3-.3-.3-.3-.3-.3-.3--2,,1+,1++0*+0*,1+,1+,3,/6/,6.+5-*4,*4++5,-7,.8--8*0;+4?/5@/4?.3?+4?.3@,7F19K3@O8CU;GW<H[?M]BM`DUeJ\\nTdtZ`rZXgRGXE4B1$2%$-*$),\"'*heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVjdVjdVkdZkdZlc\\md[lfZlfVliVlkVkmXlo^lrhz~оλwbQ:\\HN>J=I>I@G@D>=::7=9>:?9A:yB;tD:pF:pE<p?8q?8q>:q?8q>:q?8p?:p?8qB<pA9n?9l=5j=7j>5j=7n=6o83r73q73p62n72l71j81i81d8/d90d<2d>3d@4cA5cA5_C5ZE4_N<gVBhWCcS<^O8[O5\\R7]V<]Y>nlUtv^|kcmU2>(6B.3;.39/39/39/28.28.28.28.17-17-17-06,06,06,/5+/5+-2,-2,-2,-2,-2,-2,-2,-2,,1+,1++0*+0*+0*+0*,1++2+-4-+5-*4,*4,+5,+5,,6--7,,6+/:,2=/6A17B27B15@04?.2?-4C.:G3=L5AO8DT:JX?L\\BTbI\\kTcp\\^mZUbQDRC2>0#/%'0-&,,$**heVheVheVheVheVheVheVheVheVheVheVheVheVheVheVheVjdVjdVkdZkdZlc\\md[lfZlfVolYmlWjlWgkZgmcr{x׭oYWDQ@O>OAOBK@C<<5>7?6@9A7{B7uD6qE8qE:p?8q>:s>:q>:q>:q>:r?;q@;sB=qB<p?:m>8l=7k>8m>8o>9o83q73o83m82m82j92h91f:1f;2d>3d@4bB5`C5]A3\\@2WB1TG4\\T?f^Gj_IbX?ZS9ZS7\\W:[W<XW;kmUsw^u}fUaI&2\u001c8D03;.4:04:039/39/39/28.28.17-17-17-06,06,06,/5+/5+-2,-2,-2,-2,-2,-2,-2,-2,,1++0*+0**/)*/)+0*+0*,1++2+)3+*4,+5-,6-,6--7.-7.-7./9.2<16A39D69D47B46A10;+2?-6C19F2<I5AO8FT=JX?R`I[hTan\\]jYQ]OBN@0<0\",#+1/(..&,,ifWheVheVheVheVheVheVheVifWifWifWifWifWifWifWifWkeWkeWle[le[md]ne\\mg[mgWqn[kmWknYkr`kshpyvѺibKO9T?ZFRAK;M?<0=0>2=/x=/t?/sB3uE7r=7s>:t=:t?;u@<u@<t?;q>:s@<rA<r?;q@;p?:o@:o>9o>9k92m82l:3l;4l;4h<3g<3d>3c?3^>1dG9cG9T=-N9(M8'@1\u001eXR<PN7KI0OK2]Y>ieJeaDVU7XX<^aDpt[zfdlU>J2-9#2>*4</5;15;14:04:039/39/39/39/39/39/28.28.17-17-06,16016005/05/05//4./4./4.,1+,1+,1+,1+,1+,1+,1++0*.5..5.-4--4--4--4-.5./6.+2*-4,1805=29A6=E8@H=?J<7B26A03>-1=)3?+9E/BN8IU?O[GWcO]hWZeULWI<F;/90)3+)/+(.,'-+heVheVheVheVheVheVheVheVifWifWifWifWifWifWifWifWkeWkeWle[le[md]ne\\mg[khWonZjlVknYlsajtiq|x౗u\\\\DZBYCVCSAG5F6E4D3|C2wB0s@/o>/u@8t?9u>;u@:t?;p>7p=9tB;q>:p?8p?:o>7o>9m>6n=8m>6k<4l=5m>6k?6j?6gA6eA5bB5dG9[A2^G7_J9O>,F7$G8%?7\"LL4HL3DG,CF+MM1[[?baC`aBZZ>dgJsw^sy_X`I:D,/;%7C/6>17=36<26<26<25;15;15;15;15;15;14:04:04:039/39/27127127116016016005/05/.3-.3--2,-2,,1+,1++0*+0**1**1*)0))0)*1**1*+2+,3,.5..5-.5-07/4;3:B7?F>BJ?;F8:E57B14?.3?+6B.<H2@L6LXDS_KYdTWbRLVK=G<1;2+5-+1-*0,)/-heVheVheVheVheVheVheVheVifWifWifWifWifWifWifWifWkeWkeWmd[md[md]ne\\mg[khWnmYimVjoYktaiuiq}y㿧jYBR<[F]IS?F2u>)r>)tA,tD0vE6q?4n<3q<6tB9tB;o?5q@9xH>n=6m>4m>6m>4l=5j>3l=5j>5g?5gA6hB7gC7eC7cC6aD6^D5bK;UB1ZI7`S@RG3D<'E=(FA+BF-BH.AE*<@%?B%LO2_`AijKaaEnqTvzagmSJO95=&5=(=F39?38>48>48>47=37=37=37=38>48>48>47=37=37=36<26<25:45:449349338238238238205/05//4..3--2,,1++0*+0*).*).*).*).*).**/++0,,1-162/4.,1+,1+05/6;4=B<AH@@K=>K:<I78E34A-2?+3A*5C,DQ=KXDQ^MQ^MHTH<H<2>4.8/-4--4-,2.gdUgdUheVheVheVifWifWifWifWifWifWifWifWifWifWifWkeWkeWmd[md[md]mf\\mg[jiWkmXimVjoYjs`hthn}xڻּҽzyS>tJ4uH3vI4zM8~O;yL7nA.e7'{M@tE;qB8sD:oC8g;0d8-g=1i?3i?3i?3g?3g?3f>2f>2e?2cA5bB5`C5`D6_C5[D4ZE4WD3XI6OB/\\T?oiSc^HMK4IG0IK3>D*?H-@F*<B&<A#EJ,XY:deFmmQxx\\tv^[_FAD/6;%:?+>B19?39?59?58>48>48>47=37=39?59?58>48>48>48>48>48>47<67<67<66;56;56;55:45:438238227105//4.-2,,1+,1++0,+0,+0,+0,+0,,1--2.-2.051.3/+0,+0*-2.3828=9;B:AL>@M;@M;=J68E14A-1?(1?(=J6BO;IVDJWFDPB;G;2>4.:0,6..5.-4-gdUgdUgdUheVheVifWifWifWifWifWifWifWifWifWifWifWkeWldWmd[md[md]mf\\mg[jiWlnYinWiqZgs_drejytܿչйѾϴuawVClI6mH6rM=uP@mF7jC4gB2kF6nI9nJ:oK;pL<eA1cB1cB1cB1cB1cB1bC1`C3]F6\\G6]H7ZG6ZG6WH5TG4RG3PH3OI3fdM~~frrZVX@JL4GM3<E*<F+?H+AG+AF(CH*MN/TU6xw[{z^nnVUU=CB.?A,?@.;>-;>39?59?58>48>47=37=37=38>48>48>48>48>48>48>48>49>89>89>89>88=78=77<67<66;56;55:438227105//4./4.-2.-2.,1-,1-,1-,1--2.-2.-10,0/,0/-2..211623764;4;G9=L9@O<@O:<K67F/4C,2A*6E.:I4@O<BP??M>8F71?2-9-,6--4,,3+fcTgdUgdUheVheVifWjgXjgXifWifWifWifWifWifWifWifWldWldWmd[md[md]mf\\mg[jiWkmXinWiqZgs_bpcgxrڽѵ˴˺ҿԺurd|]K}^LtUCbE3X;)Y<*[>,X=*`E2`E2`E2`G3`G3`G3`G3^I4\\K7\\M:\\M:ZM:XM9UM8SM7QL6NL5QQ9jlT|gmqXSY?FL2>G,<F+<F+?H+DJ.EJ,DG*HI*LM.yx\\tsWfdMTR;LI6KJ6FE3<=-<?4:@69?59?58>48>48>48>47=37=38>48>48>49?59?59?5;@::?9:?9:?99>89>89>89>89>88=77<66;55:4493382382/40.3/-2.,1-+0,+0,+0,+0,+/.,0/-10.21/32/32/32.5.4@27F3=L7@O:?N7<K49H18G05D-8G0<K6>M:<J97E61?2-9-+5,-4,,3+fcTfcTgdUheVifWifWjgXjgXifWifWifWifWifWifWifWifWldWldWmd[md[md]mf\\mg[jiWjlWhmVhrZfs_cqdhysչ̳İĴɿʴxt^GeO8cM6\\H0^J2\\J2\\J2]K3]K3^L4^L4\\M6YN8XP;XP;VP:UO9SN8PN7NN6MO7PT;`fLfoTU^CEO4AK0<F+?I.?I.CL/HN2HM/GJ-OP1YX:qmRkgLa\\F[V@YTATQ>MJ9BC3>A6;A7;A7;A7:@6:@6:@69?58>48>48>49?59?5:@6:@6:@6;@:;@:;@::?9:?99>89>89>8:?9:?9:?99>88=78=78=77<6495384162/40-2.,1-,0/+/.,0/-10-10.21.23.23-12,2.+9*/@-6H2<N8=O7<N6:L2:L25G/7I1:L6<M:;L:6G70@3-;.,6--4,,3+cdTcdRdeUgfThfWigXigXjhYhfWifWifWifWifWifWifWkeWkeWkeWmeZle[md]mf\\kg[jiWikVhmWis[gt`dqgk|vѸǱžƾüÞu`P7RB)XH/XH.[M3[M3ZN4ZN4[O5[O5\\P6[Q8UO7TO9TO9QO8PN7NN6KM5IM4JN5LR8S\\APY>@I,<E(AL.?J,DM0EN1JP4MR4KN1LL0YY=kjNhdIb^E^ZA_ZD`[GZUAQO:KJ8AB4@B5@B5>A6>A6>A6=@7=@79?59?59?5:@6:@6:B7:B7;C8;@9;@9;@::?8:?9:?89>89>7;@:;@9;@:;@9:?9:?8:?9:?98?87=94;4382160/4..3/.3/.21.21-2.,2.,3,,3+,3+)6%$6\u001e*>\"2F+8L3;O6<N6;M5;M58J29K3;M5=O7<N87H51B0.<--7..5--4,]eP^fO_gRbgQdiUfiVgjWijXfgUhgUheVheVjdVkeWlfZlfXlfXkhYmg[kg\\mf^jf]ieZgeVghVfkUenYbo]dqhtҾϼ·ƏnUN2WM2TK.SJ+WN1WN1UN1UN1TO2TO2TN4SO4QM4RN5QO6PP6MO7KO6HM6GL5JP6FO4AJ-=F)@G(DK*FM+EL*PV4PS4KN/IL/TT8bbFccIZZ@[Y@\\ZA][B][B[Y@XV=US:SQ8HF1GD1EB1B@1A?2>>2??5>@5;>59?59?59A69A48C58C59C8:B79A69@88@58?79A69@8:B7:A9:B7:A9:B7;B:<D9=D<>E=8B:8B:8B98@56>14</39/271.40/51070.8-.;)0@&6F)7M';V+:W+;U0;T4;R8=P<>O<>O<:L6@R8EW=FY=DX=@T;5H2+<*,6+-4,+2*ZfN[gO^hP_iQbjSckTglXhkXhiWghVifWifWkeWlfXmeZmgYmgYkhYkg[kg\\je_jf]hfZfgWhiWglVfo\\erajwnz˹ʿǋlRM0SN1RK.QK+UO/UO/TO1TO1SO2SO2QP4QO6QM2PO3PN5NQ6MO7JP6HM6EM5HQ6FO4BK.?H)CH(GM+JP,KQ-OS0PT1VZ9^aB_bCZ]@VV<UU=VV>WU>XV=YW>YW>XW;WV:XT9QK3PJ4LG4ID1DA2B@3A?3>@5<=59?59?59A67B48C57C57C5:B7:B79A68@58@59A6:B7:B7:B7:B7:B7:B7;C8<D9=E:<F;=G?<H><F;;F6<D5:B39?38=67>76=63=52>04C,9L,BY/Ga1Qo;Mm;Li=Fa>BY?<R=<M=:K9=O9DV<K^BNaCL`DH\\A:Q71D0+5*+2*)0(ZfN[gO\\hP`jRbjSdlUglXilYijXijXkhYkhYmgYmgYog\\nhZmgYkhYkg[jf[je_jf]hfZfgWhiWejTdmZgtco|s˸öƉjPK.RM0QJ-QJ-UO/UO/UP2UP2TP3SO2QP4PO3QM2ON2PN5MP5MO7JP6IN7GO7HQ6FO4CL/CL-GL,KQ/OU1SY5QY2X`9jpLy]qvVY^@LO4MP5QQ9QQ9RP9SQ8TR9VT;YU<ZV=XR<VP:RM:NI6HE6DB5CA5?A6<=59?5:@69A67B48C57C57C5:B7:B79A69A69A69A6:B7:B7:B7:B7:B7:B7;C8<D9>F;<F;?IA>J@?I>?J:@H9>F7>D8=B;>E><C<7A95A39H1BU5Pg=XrB`~J\\|JXuINiFD[A9O:6G74E3<N8EW=NaESfHSgKNbG@W=6I5/9./6.-4,ZfN[gO\\hP^jRblTemVhmYinZklZklZlj[liZnhZnhZph]oi[liZkhYkg[jf[id^ie\\hfZghXfgUbgQajWerao|s~˸Ƴþ÷ǹɊmPJ0RM0SL/SL/UO/UO/UP2VQ3TP3SO2PO3ON2PL1ON2OM4LO4MO7KQ7JO8HP8JS8GP5GP3IR3NS3PV4W]9\\d=grHtUjulnuTZaBSW<MO7NN6MM5NL5OM6RP9WR<YT>ZT>XR<TO<QL9KH9GE8EC7AC8=>6:@6:@69A67B47B46B46B4;C8:B7:B79A69A6:B7:B7;C8;C8:B7:B7;C8<D9=E:>F;=G<=G?=I?>H=>I9?G8>F7>D8=B;=D=;B;6@85A3:I2DW7Ri?[uE\\zFXxFTqEIdA>U;2H3/@0.?-6H2@R8L_CReGSgKOcH@W=6I51;007/-4,YgNZhO\\hP^jRblTemVinZjo[mn\\lm[mk\\mj[oi[oi[oi]oi[liZkhYjfZieZid^ie\\ig[ghXghVchRajWerao|s{ѿɸıþʾŸ̌oRL2TO2TM0UN1UO/UO/VQ3VQ3UQ4SO2ON2NM1PL1NM1NL3KN3LN6KQ7LQ:JR:LU:IR7JS6OX9TY9U[9]c?fnGcszpr{\\\\bFLP7LN6LK6LJ5LJ5QL8TM:VP:WQ;VP:SN;QL9MJ;IG:GE9CE:=>6:@6:@69A67B47B46B46B4;C8;C8:B7:B7:B7:B7;C8;C8;C8;C8;C8;C8<D9=E:>F;=G<=G?<H>=G<=H8?G8=E6=C7=B;:A:9@96@85A39H1BU5Ne;Vp@Vt@SsAPmAE`=9P6-C.+<,+<*1C-<N4H[?PcERfJNbG@W=5H4,6++2*'.&"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/tjbench.c",
    "content": "/*\n * Copyright (C)2009-2016 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <ctype.h>\n#include <math.h>\n#include <errno.h>\n#include <cdjpeg.h>\n#include \"./bmp.h\"\n#include \"./tjutil.h\"\n#include \"./turbojpeg.h\"\n\n\n#define _throw(op, err) {  \\\n\tprintf(\"ERROR in line %d while %s:\\n%s\\n\", __LINE__, op, err);  \\\n  retval=-1;  goto bailout;}\n#define _throwunix(m) _throw(m, strerror(errno))\n#define _throwtj(m) _throw(m, tjGetErrorStr())\n#define _throwbmp(m) _throw(m, bmpgeterr())\n\nint flags=TJFLAG_NOREALLOC, componly=0, decomponly=0, doyuv=0, quiet=0,\n\tdotile=0, pf=TJPF_BGR, yuvpad=1, warmup=1, dowrite=1;\nchar *ext=\"ppm\";\nconst char *pixFormatStr[TJ_NUMPF]=\n{\n\t\"RGB\", \"BGR\", \"RGBX\", \"BGRX\", \"XBGR\", \"XRGB\", \"GRAY\", \"\", \"\", \"\", \"\", \"CMYK\"\n};\nconst char *subNameLong[TJ_NUMSAMP]=\n{\n\t\"4:4:4\", \"4:2:2\", \"4:2:0\", \"GRAY\", \"4:4:0\", \"4:1:1\"\n};\nconst char *csName[TJ_NUMCS]=\n{\n\t\"RGB\", \"YCbCr\", \"GRAY\", \"CMYK\", \"YCCK\"\n};\nconst char *subName[TJ_NUMSAMP]={\"444\", \"422\", \"420\", \"GRAY\", \"440\", \"411\"};\ntjscalingfactor *scalingfactors=NULL, sf={1, 1};  int nsf=0;\nint xformop=TJXOP_NONE, xformopt=0;\nint (*customFilter)(short *, tjregion, tjregion, int, int, tjtransform *);\ndouble benchtime=5.0;\n\n\nchar *formatName(int subsamp, int cs, char *buf)\n{\n\tif(cs==TJCS_YCbCr) return (char *)subNameLong[subsamp];\n\telse if(cs==TJCS_YCCK)\n\t{\n\t\tsnprintf(buf, 80, \"%s %s\", csName[cs], subNameLong[subsamp]);\n\t\treturn buf;\n\t}\n\telse return (char *)csName[cs];\n}\n\n\nchar *sigfig(double val, int figs, char *buf, int len)\n{\n\tchar format[80];\n\tint digitsafterdecimal=figs-(int)ceil(log10(fabs(val)));\n\tif(digitsafterdecimal<1) snprintf(format, 80, \"%%.0f\");\n\telse snprintf(format, 80, \"%%.%df\", digitsafterdecimal);\n\tsnprintf(buf, len, format, val);\n\treturn buf;\n}\n\n\n/* Custom DCT filter which produces a negative of the image */\nint dummyDCTFilter(short *coeffs, tjregion arrayRegion, tjregion planeRegion,\n\tint componentIndex, int transformIndex, tjtransform *transform)\n{\n\tint i;\n\tfor(i=0; i<arrayRegion.w*arrayRegion.h; i++) coeffs[i]=-coeffs[i];\n\treturn 0;\n}\n\n\n/* Decompression test */\nint decomp(unsigned char *srcbuf, unsigned char **jpegbuf,\n\tunsigned long *jpegsize, unsigned char *dstbuf, int w, int h,\n\tint subsamp, int jpegqual, char *filename, int tilew, int tileh)\n{\n\tchar tempstr[1024], sizestr[20]=\"\\0\", qualstr[6]=\"\\0\", *ptr;\n\tFILE *file=NULL;  tjhandle handle=NULL;\n\tint row, col, iter=0, dstbufalloc=0, retval=0;\n\tdouble elapsed, elapsedDecode;\n\tint ps=tjPixelSize[pf];\n\tint scaledw=TJSCALED(w, sf);\n\tint scaledh=TJSCALED(h, sf);\n\tint pitch=scaledw*ps;\n\tint ntilesw=(w+tilew-1)/tilew, ntilesh=(h+tileh-1)/tileh;\n\tunsigned char *dstptr, *dstptr2, *yuvbuf=NULL;\n\n\tif(jpegqual>0)\n\t{\n\t\tsnprintf(qualstr, 6, \"_Q%d\", jpegqual);\n\t\tqualstr[5]=0;\n\t}\n\n\tif((handle=tjInitDecompress())==NULL)\n\t\t_throwtj(\"executing tjInitDecompress()\");\n\n\tif(dstbuf==NULL)\n\t{\n\t\tif((dstbuf=(unsigned char *)malloc(pitch*scaledh))==NULL)\n\t\t\t_throwunix(\"allocating destination buffer\");\n\t\tdstbufalloc=1;\n\t}\n\t/* Set the destination buffer to gray so we know whether the decompressor\n\t   attempted to write to it */\n\tmemset(dstbuf, 127, pitch*scaledh);\n\n\tif(doyuv)\n\t{\n\t\tint width=dotile? tilew:scaledw;\n\t\tint height=dotile? tileh:scaledh;\n\t\tint yuvsize=tjBufSizeYUV2(width, yuvpad, height, subsamp);\n\t\tif((yuvbuf=(unsigned char *)malloc(yuvsize))==NULL)\n\t\t\t_throwunix(\"allocating YUV buffer\");\n\t\tmemset(yuvbuf, 127, yuvsize);\n\t}\n\n\t/* Benchmark */\n\titer=-warmup;\n\telapsed=elapsedDecode=0.;\n\twhile(1)\n\t{\n\t\tint tile=0;\n\t\tdouble start=gettime();\n\t\tfor(row=0, dstptr=dstbuf; row<ntilesh; row++, dstptr+=pitch*tileh)\n\t\t{\n\t\t\tfor(col=0, dstptr2=dstptr; col<ntilesw; col++, tile++, dstptr2+=ps*tilew)\n\t\t\t{\n\t\t\t\tint width=dotile? min(tilew, w-col*tilew):scaledw;\n\t\t\t\tint height=dotile? min(tileh, h-row*tileh):scaledh;\n\t\t\t\tif(doyuv)\n\t\t\t\t{\n\t\t\t\t\tdouble startDecode;\n\t\t\t\t\tif(tjDecompressToYUV2(handle, jpegbuf[tile], jpegsize[tile], yuvbuf,\n\t\t\t\t\t\twidth, yuvpad, height, flags)==-1)\n\t\t\t\t\t\t_throwtj(\"executing tjDecompressToYUV2()\");\n\t\t\t\t\tstartDecode=gettime();\n\t\t\t\t\tif(tjDecodeYUV(handle, yuvbuf, yuvpad, subsamp, dstptr2, width,\n\t\t\t\t\t\tpitch, height, pf, flags)==-1)\n\t\t\t\t\t\t_throwtj(\"executing tjDecodeYUV()\");\n\t\t\t\t\tif(iter>=0) elapsedDecode+=gettime()-startDecode;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tif(tjDecompress2(handle, jpegbuf[tile], jpegsize[tile], dstptr2,\n\t\t\t\t\t\twidth, pitch, height, pf, flags)==-1)\n\t\t\t\t\t\t_throwtj(\"executing tjDecompress2()\");\n\t\t\t}\n\t\t}\n\t\titer++;\n\t\tif(iter>=1)\n\t\t{\n\t\t\telapsed+=gettime()-start;\n\t\t\tif(elapsed>=benchtime) break;\n\t\t}\n\t}\n\tif(doyuv) elapsed-=elapsedDecode;\n\n\tif(tjDestroy(handle)==-1) _throwtj(\"executing tjDestroy()\");\n\thandle=NULL;\n\n\tif(quiet)\n\t{\n\t\tprintf(\"%-6s%s\",\n\t\t\tsigfig((double)(w*h)/1000000.*(double)iter/elapsed, 4, tempstr, 1024),\n\t\t\tquiet==2? \"\\n\":\"  \");\n\t\tif(doyuv)\n\t\t\tprintf(\"%s\\n\",\n\t\t\t\tsigfig((double)(w*h)/1000000.*(double)iter/elapsedDecode, 4, tempstr,\n\t\t\t\t\t1024));\n\t\telse if(quiet!=2) printf(\"\\n\");\n\t}\n\telse\n\t{\n\t\tprintf(\"%s --> Frame rate:         %f fps\\n\",\n\t\t\tdoyuv? \"Decomp to YUV\":\"Decompress   \", (double)iter/elapsed);\n\t\tprintf(\"                  Throughput:         %f Megapixels/sec\\n\",\n\t\t\t(double)(w*h)/1000000.*(double)iter/elapsed);\n\t\tif(doyuv)\n\t\t{\n\t\t\tprintf(\"YUV Decode    --> Frame rate:        \u0004 %f fps\\n\",\n\t\t\t\t(double)iter/elapsedDecode);\n\t\t\tprintf(\"                  Throughput:         %f Megapixels/sec\\n\",\n\t\t\t\t(double)(w*h)/1000000.*(double)iter/elapsedDecode);\n\t\t}\n\t}\n\n\tif (!dowrite) goto bailout;\n\n\tif(sf.num!=1 || sf.denom!=1)\n\t\tsnprintf(sizestr, 20, \"%d_%d\", sf.num, sf.denom);\n\telse if(tilew!=w || tileh!=h)\n\t\tsnprintf(sizestr, 20, \"%dx%d\", tilew, tileh);\n\telse snprintf(sizestr, 20, \"full\");\n\tif(decomponly)\n\t\tsnprintf(tempstr, 1024, \"%s_%s.%s\", filename, sizestr, ext);\n\telse\n\t\tsnprintf(tempstr, 1024, \"%s_%s%s_%s.%s\", filename, subName[subsamp],\n\t\t\tqualstr, sizestr, ext);\n\n\tif(savebmp(tempstr, dstbuf, scaledw, scaledh, pf,\n\t\t(flags&TJFLAG_BOTTOMUP)!=0)==-1)\n\t\t_throwbmp(\"saving bitmap\");\n\tptr=strrchr(tempstr, '.');\n\tsnprintf(ptr, 1024-(ptr-tempstr), \"-err.%s\", ext);\n\tif(srcbuf && sf.num==1 && sf.denom==1)\n\t{\n\t\tif(!quiet) printf(\"Compression error written to %s.\\n\", tempstr);\n\t\tif(subsamp==TJ_GRAYSCALE)\n\t\t{\n\t\t\tint index, index2;\n\t\t\tfor(row=0, index=0; row<h; row++, index+=pitch)\n\t\t\t{\n\t\t\t\tfor(col=0, index2=index; col<w; col++, index2+=ps)\n\t\t\t\t{\n\t\t\t\t\tint rindex=index2+tjRedOffset[pf];\n\t\t\t\t\tint gindex=index2+tjGreenOffset[pf];\n\t\t\t\t\tint bindex=index2+tjBlueOffset[pf];\n\t\t\t\t\tint y=(int)((double)srcbuf[rindex]*0.299\n\t\t\t\t\t\t+ (double)srcbuf[gindex]*0.587\n\t\t\t\t\t\t+ (double)srcbuf[bindex]*0.114 + 0.5);\n\t\t\t\t\tif(y>255) y=255;  if(y<0) y=0;\n\t\t\t\t\tdstbuf[rindex]=abs(dstbuf[rindex]-y);\n\t\t\t\t\tdstbuf[gindex]=abs(dstbuf[gindex]-y);\n\t\t\t\t\tdstbuf[bindex]=abs(dstbuf[bindex]-y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor(row=0; row<h; row++)\n\t\t\t\tfor(col=0; col<w*ps; col++)\n\t\t\t\t\tdstbuf[pitch*row+col]\n\t\t\t\t\t\t=abs(dstbuf[pitch*row+col]-srcbuf[pitch*row+col]);\n\t\t}\n\t\tif(savebmp(tempstr, dstbuf, w, h, pf,\n\t\t\t(flags&TJFLAG_BOTTOMUP)!=0)==-1)\n\t\t\t_throwbmp(\"saving bitmap\");\n\t}\n\n\tbailout:\n\tif(file) fclose(file);\n\tif(handle) tjDestroy(handle);\n\tif(dstbuf && dstbufalloc) free(dstbuf);\n\tif(yuvbuf) free(yuvbuf);\n\treturn retval;\n}\n\n\nint fullTest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual,\n\tchar *filename)\n{\n\tchar tempstr[1024], tempstr2[80];\n\tFILE *file=NULL;  tjhandle handle=NULL;\n\tunsigned char **jpegbuf=NULL, *yuvbuf=NULL, *tmpbuf=NULL, *srcptr, *srcptr2;\n\tdouble start, elapsed, elapsedEncode;\n\tint totaljpegsize=0, row, col, i, tilew=w, tileh=h, retval=0;\n\tint iter, yuvsize=0;\n\tunsigned long *jpegsize=NULL;\n\tint ps=tjPixelSize[pf];\n\tint ntilesw=1, ntilesh=1, pitch=w*ps;\n\tconst char *pfStr=pixFormatStr[pf];\n\n\tif((tmpbuf=(unsigned char *)malloc(pitch*h)) == NULL)\n\t\t_throwunix(\"allocating temporary image buffer\");\n\n\tif(!quiet)\n\t\tprintf(\">>>>>  %s (%s) <--> JPEG %s Q%d  <<<<<\\n\", pfStr,\n\t\t\t(flags&TJFLAG_BOTTOMUP)? \"Bottom-up\":\"Top-down\", subNameLong[subsamp],\n\t\t\tjpegqual);\n\n\tfor(tilew=dotile? 8:w, tileh=dotile? 8:h; ; tilew*=2, tileh*=2)\n\t{\n\t\tif(tilew>w) tilew=w;  if(tileh>h) tileh=h;\n\t\tntilesw=(w+tilew-1)/tilew;  ntilesh=(h+tileh-1)/tileh;\n\n\t\tif((jpegbuf=(unsigned char **)malloc(sizeof(unsigned char *)\n\t\t\t*ntilesw*ntilesh))==NULL)\n\t\t\t_throwunix(\"allocating JPEG tile array\");\n\t\tmemset(jpegbuf, 0, sizeof(unsigned char *)*ntilesw*ntilesh);\n\t\tif((jpegsize=(unsigned long *)malloc(sizeof(unsigned long)\n\t\t\t*ntilesw*ntilesh))==NULL)\n\t\t\t_throwunix(\"allocating JPEG size array\");\n\t\tmemset(jpegsize, 0, sizeof(unsigned long)*ntilesw*ntilesh);\n\n\t\tif((flags&TJFLAG_NOREALLOC)!=0)\n\t\t\tfor(i=0; i<ntilesw*ntilesh; i++)\n\t\t\t{\n\t\t\t\tif((jpegbuf[i]=(unsigned char *)tjAlloc(tjBufSize(tilew, tileh,\n\t\t\t\t\tsubsamp)))==NULL)\n\t\t\t\t\t_throwunix(\"allocating JPEG tiles\");\n\t\t\t}\n\n\t\t/* Compression test */\n\t\tif(quiet==1)\n\t\t\tprintf(\"%-4s (%s)  %-5s    %-3d   \", pfStr,\n\t\t\t\t(flags&TJFLAG_BOTTOMUP)? \"BU\":\"TD\", subNameLong[subsamp], jpegqual);\n\t\tfor(i=0; i<h; i++)\n\t\t\tmemcpy(&tmpbuf[pitch*i], &srcbuf[w*ps*i], w*ps);\n\t\tif((handle=tjInitCompress())==NULL)\n\t\t\t_throwtj(\"executing tjInitCompress()\");\n\n\t\tif(doyuv)\n\t\t{\n\t\t\tyuvsize=tjBufSizeYUV2(tilew, yuvpad, tileh, subsamp);\n\t\t\tif((yuvbuf=(unsigned char *)malloc(yuvsize))==NULL)\n\t\t\t\t_throwunix(\"allocating YUV buffer\");\n\t\t\tmemset(yuvbuf, 127, yuvsize);\n\t\t}\n\n\t\t/* Benchmark */\n\t\titer=-warmup;\n\t\telapsed=elapsedEncode=0.;\n\t\twhile(1)\n\t\t{\n\t\t\tint tile=0;\n\t\t\ttotaljpegsize=0;\n\t\t\tstart=gettime();\n\t\t\tfor(row=0, srcptr=srcbuf; row<ntilesh; row++, srcptr+=pitch*tileh)\n\t\t\t{\n\t\t\t\tfor(col=0, srcptr2=srcptr; col<ntilesw; col++, tile++,\n\t\t\t\t\tsrcptr2+=ps*tilew)\n\t\t\t\t{\n\t\t\t\t\tint width=min(tilew, w-col*tilew);\n\t\t\t\t\tint height=min(tileh, h-row*tileh);\n\t\t\t\t\tif(doyuv)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble startEncode=gettime();\n\t\t\t\t\t\tif(tjEncodeYUV3(handle, srcptr2, width, pitch, height, pf, yuvbuf,\n\t\t\t\t\t\t\tyuvpad, subsamp, flags)==-1)\n\t\t\t\t\t\t\t_throwtj(\"executing tjEncodeYUV3()\");\n\t\t\t\t\t\tif(iter>=0) elapsedEncode+=gettime()-startEncode;\n\t\t\t\t\t\tif(tjCompressFromYUV(handle, yuvbuf, width, yuvpad, height,\n\t\t\t\t\t\t\tsubsamp, &jpegbuf[tile], &jpegsize[tile], jpegqual, flags)==-1)\n\t\t\t\t\t\t\t_throwtj(\"executing tjCompressFromYUV()\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(tjCompress2(handle, srcptr2, width, pitch, height, pf,\n\t\t\t\t\t\t\t&jpegbuf[tile], &jpegsize[tile], subsamp, jpegqual, flags)==-1)\n\t\t\t\t\t\t\t_throwtj(\"executing tjCompress2()\");\n\t\t\t\t\t}\n\t\t\t\t\ttotaljpegsize+=jpegsize[tile];\n\t\t\t\t}\n\t\t\t}\n\t\t\titer++;\n\t\t\tif(iter>=1)\n\t\t\t{\n\t\t\t\telapsed+=gettime()-start;\n\t\t\t\tif(elapsed>=benchtime) break;\n\t\t\t}\n\t\t}\n\t\tif(doyuv) elapsed-=elapsedEncode;\n\n\t\tif(tjDestroy(handle)==-1) _throwtj(\"executing tjDestroy()\");\n\t\thandle=NULL;\n\n\t\tif(quiet==1) printf(\"%-5d  %-5d   \", tilew, tileh);\n\t\tif(quiet)\n\t\t{\n\t\t\tif(doyuv)\n\t\t\t\tprintf(\"%-6s%s\",\n\t\t\t\t\tsigfig((double)(w*h)/1000000.*(double)iter/elapsedEncode, 4, tempstr,\n\t\t\t\t\t\t1024), quiet==2? \"\\n\":\"  \");\n\t\t\tprintf(\"%-6s%s\",\n\t\t\t\tsigfig((double)(w*h)/1000000.*(double)iter/elapsed, 4,\ttempstr, 1024),\n\t\t\t\tquiet==2? \"\\n\":\"  \");\n\t\t\tprintf(\"%-6s%s\",\n\t\t\t\tsigfig((double)(w*h*ps)/(double)totaljpegsize, 4, tempstr2, 80),\n\t\t\t\tquiet==2? \"\\n\":\"  \");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprintf(\"\\n%s size: %d x %d\\n\", dotile? \"Tile\":\"Image\", tilew,\n\t\t\t\ttileh);\n\t\t\tif(doyuv)\n\t\t\t{\n\t\t\t\tprintf(\"Encode YUV    --> Frame rate:         %f fps\\n\",\n\t\t\t\t\t(double)iter/elapsedEncode);\n\t\t\t\tprintf(\"                  Output image size:  %d bytes\\n\", yuvsize);\n\t\t\t\tprintf(\"                  Compression ratio:  %f:1\\n\",\n\t\t\t\t\t(double)(w*h*ps)/(double)yuvsize);\n\t\t\t\tprintf(\"                  Throughput:         %f Megapixels/sec\\n\",\n\t\t\t\t\t(double)(w*h)/1000000.*(double)iter/elapsedEncode);\n\t\t\t\tprintf(\"                  Output bit stream:  %f Megabits/sec\\n\",\n\t\t\t\t\t(double)yuvsize*8./1000000.*(double)iter/elapsedEncode);\n\t\t\t}\n\t\t\tprintf(\"%s --> Frame rate:         %f fps\\n\",\n\t\t\t\tdoyuv? \"Comp from YUV\":\"Compress     \", (double)iter/elapsed);\n\t\t\tprintf(\"                  Output image size:  %d bytes\\n\",\n\t\t\t\ttotaljpegsize);\n\t\t\tprintf(\"                  Compression ratio:  %f:1\\n\",\n\t\t\t\t(double)(w*h*ps)/(double)totaljpegsize);\n\t\t\tprintf(\"                  Throughput:         %f Megapixels/sec\\n\",\n\t\t\t\t(double)(w*h)/1000000.*(double)iter/elapsed);\n\t\t\tprintf(\"                  Output bit stream:  %f Megabits/sec\\n\",\n\t\t\t\t(double)totaljpegsize*8./1000000.*(double)iter/elapsed);\n\t\t}\n\t\tif(tilew==w && tileh==h && dowrite)\n\t\t{\n\t\t\tsnprintf(tempstr, 1024, \"%s_%s_Q%d.jpg\", filename, subName[subsamp],\n\t\t\t\tjpegqual);\n\t\t\tif((file=fopen(tempstr, \"wb\"))==NULL)\n\t\t\t\t_throwunix(\"opening reference image\");\n\t\t\tif(fwrite(jpegbuf[0], jpegsize[0], 1, file)!=1)\n\t\t\t\t_throwunix(\"writing reference image\");\n\t\t\tfclose(file);  file=NULL;\n\t\t\tif(!quiet) printf(\"Reference image written to %s\\n\", tempstr);\n\t\t}\n\n\t\t/* Decompression test */\n\t\tif(!componly)\n\t\t{\n\t\t\tif(decomp(srcbuf, jpegbuf, jpegsize, tmpbuf, w, h, subsamp, jpegqual,\n\t\t\t\tfilename, tilew, tileh)==-1)\n\t\t\t\tgoto bailout;\n\t\t}\n\n\t\tfor(i=0; i<ntilesw*ntilesh; i++)\n\t\t{\n\t\t\tif(jpegbuf[i]) tjFree(jpegbuf[i]);  jpegbuf[i]=NULL;\n\t\t}\n\t\tfree(jpegbuf);  jpegbuf=NULL;\n\t\tfree(jpegsize);  jpegsize=NULL;\n\t\tif(doyuv)\n\t\t{\n\t\t\tfree(yuvbuf);  yuvbuf=NULL;\n\t\t}\n\n\t\tif(tilew==w && tileh==h) break;\n\t}\n\n\tbailout:\n\tif(file) {fclose(file);  file=NULL;}\n\tif(jpegbuf)\n\t{\n\t\tfor(i=0; i<ntilesw*ntilesh; i++)\n\t\t{\n\t\t\tif(jpegbuf[i]) tjFree(jpegbuf[i]);  jpegbuf[i]=NULL;\n\t\t}\n\t\tfree(jpegbuf);  jpegbuf=NULL;\n\t}\n\tif(yuvbuf) {free(yuvbuf);  yuvbuf=NULL;}\n\tif(jpegsize) {free(jpegsize);  jpegsize=NULL;}\n\tif(tmpbuf) {free(tmpbuf);  tmpbuf=NULL;}\n\tif(handle) {tjDestroy(handle);  handle=NULL;}\n\treturn retval;\n}\n\n\nint decompTest(char *filename)\n{\n\tFILE *file=NULL;  tjhandle handle=NULL;\n\tunsigned char **jpegbuf=NULL, *srcbuf=NULL;\n\tunsigned long *jpegsize=NULL, srcsize, totaljpegsize;\n\ttjtransform *t=NULL;\n\tint w=0, h=0, subsamp=-1, cs=-1, _w, _h, _tilew, _tileh,\n\t\t_ntilesw, _ntilesh, _subsamp;\n\tchar *temp=NULL, tempstr[80], tempstr2[80];\n\tint row, col, i, iter, tilew, tileh, ntilesw=1, ntilesh=1, retval=0;\n\tdouble start, elapsed;\n\tint ps=tjPixelSize[pf], tile;\n\n\tif((file=fopen(filename, \"rb\"))==NULL)\n\t\t_throwunix(\"opening file\");\n\tif(fseek(file, 0, SEEK_END)<0 || (srcsize=ftell(file))==(unsigned long)-1)\n\t\t_throwunix(\"determining file size\");\n\tif((srcbuf=(unsigned char *)malloc(srcsize))==NULL)\n\t\t_throwunix(\"allocating memory\");\n\tif(fseek(file, 0, SEEK_SET)<0)\n\t\t_throwunix(\"setting file position\");\n\tif(fread(srcbuf, srcsize, 1, file)<1)\n\t\t_throwunix(\"reading JPEG data\");\n\tfclose(file);  file=NULL;\n\n\ttemp=strrchr(filename, '.');\n\tif(temp!=NULL) *temp='\\0';\n\n\tif((handle=tjInitTransform())==NULL)\n\t\t_throwtj(\"executing tjInitTransform()\");\n\tif(tjDecompressHeader3(handle, srcbuf, srcsize, &w, &h, &subsamp, &cs)==-1)\n\t\t_throwtj(\"executing tjDecompressHeader3()\");\n\tif(cs==TJCS_YCCK || cs==TJCS_CMYK)\n\t{\n\t\tpf=TJPF_CMYK;  ps=tjPixelSize[pf];\n\t}\n\n\tif(quiet==1)\n\t{\n\t\tprintf(\"All performance values in Mpixels/sec\\n\\n\");\n\t\tprintf(\"Bitmap     JPEG   JPEG     %s  %s   Xform   Comp    Decomp  \",\n\t\t\tdotile? \"Tile \":\"Image\", dotile? \"Tile \":\"Image\");\n\t\tif(doyuv) printf(\"Decode\");\n\t\tprintf(\"\\n\");\n\t\tprintf(\"Format     CS     Subsamp  Width  Height  Perf    Ratio   Perf    \");\n\t\tif(doyuv) printf(\"Perf\");\n\t\tprintf(\"\\n\\n\");\n\t}\n\telse if(!quiet)\n\t\tprintf(\">>>>>  JPEG %s --> %s (%s)  <<<<<\\n\",\n\t\t\tformatName(subsamp, cs, tempstr), pixFormatStr[pf],\n\t\t\t(flags&TJFLAG_BOTTOMUP)? \"Bottom-up\":\"Top-down\");\n\n\tfor(tilew=dotile? 16:w, tileh=dotile? 16:h; ; tilew*=2, tileh*=2)\n\t{\n\t\tif(tilew>w) tilew=w;  if(tileh>h) tileh=h;\n\t\tntilesw=(w+tilew-1)/tilew;  ntilesh=(h+tileh-1)/tileh;\n\n\t\tif((jpegbuf=(unsigned char **)malloc(sizeof(unsigned char *)\n\t\t\t*ntilesw*ntilesh))==NULL)\n\t\t\t_throwunix(\"allocating JPEG tile array\");\n\t\tmemset(jpegbuf, 0, sizeof(unsigned char *)*ntilesw*ntilesh);\n\t\tif((jpegsize=(unsigned long *)malloc(sizeof(unsigned long)\n\t\t\t*ntilesw*ntilesh))==NULL)\n\t\t\t_throwunix(\"allocating JPEG size array\");\n\t\tmemset(jpegsize, 0, sizeof(unsigned long)*ntilesw*ntilesh);\n\n\t\tif((flags&TJFLAG_NOREALLOC)!=0 || !dotile)\n\t\t\tfor(i=0; i<ntilesw*ntilesh; i++)\n\t\t\t{\n\t\t\t\tif((jpegbuf[i]=(unsigned char *)tjAlloc(tjBufSize(tilew, tileh,\n\t\t\t\t\tsubsamp)))==NULL)\n\t\t\t\t\t_throwunix(\"allocating JPEG tiles\");\n\t\t\t}\n\n\t\t_w=w;  _h=h;  _tilew=tilew;  _tileh=tileh;\n\t\tif(!quiet)\n\t\t{\n\t\t\tprintf(\"\\n%s size: %d x %d\", dotile? \"Tile\":\"Image\", _tilew,\n\t\t\t\t_tileh);\n\t\t\tif(sf.num!=1 || sf.denom!=1)\n\t\t\t\tprintf(\" --> %d x %d\", TJSCALED(_w, sf), TJSCALED(_h, sf));\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t\telse if(quiet==1)\n\t\t{\n\t\t\tprintf(\"%-4s (%s)  %-5s  %-5s    \", pixFormatStr[pf],\n\t\t\t\t(flags&TJFLAG_BOTTOMUP)? \"BU\":\"TD\", csName[cs], subNameLong[subsamp]);\n\t\t\tprintf(\"%-5d  %-5d   \", tilew, tileh);\n\t\t}\n\n\t\t_subsamp=subsamp;\n\t\tif(dotile || xformop!=TJXOP_NONE || xformopt!=0 || customFilter)\n\t\t{\n\t\t\tif((t=(tjtransform *)malloc(sizeof(tjtransform)*ntilesw*ntilesh))\n\t\t\t\t==NULL)\n\t\t\t\t_throwunix(\"allocating image transform array\");\n\n\t\t\tif(xformop==TJXOP_TRANSPOSE || xformop==TJXOP_TRANSVERSE\n\t\t\t\t|| xformop==TJXOP_ROT90 || xformop==TJXOP_ROT270)\n\t\t\t{\n\t\t\t\t_w=h;  _h=w;  _tilew=tileh;  _tileh=tilew;\n\t\t\t}\n\n\t\t\tif(xformopt&TJXOPT_GRAY) _subsamp=TJ_GRAYSCALE;\n\t\t\tif(xformop==TJXOP_HFLIP || xformop==TJXOP_ROT180)\n\t\t\t\t_w=_w-(_w%tjMCUWidth[_subsamp]);\n\t\t\tif(xformop==TJXOP_VFLIP || xformop==TJXOP_ROT180)\n\t\t\t\t_h=_h-(_h%tjMCUHeight[_subsamp]);\n\t\t\tif(xformop==TJXOP_TRANSVERSE || xformop==TJXOP_ROT90)\n\t\t\t\t_w=_w-(_w%tjMCUHeight[_subsamp]);\n\t\t\tif(xformop==TJXOP_TRANSVERSE || xformop==TJXOP_ROT270)\n\t\t\t\t_h=_h-(_h%tjMCUWidth[_subsamp]);\n\t\t\t_ntilesw=(_w+_tilew-1)/_tilew;\n\t\t\t_ntilesh=(_h+_tileh-1)/_tileh;\n\n\t\t\tif(xformop==TJXOP_TRANSPOSE || xformop==TJXOP_TRANSVERSE\n\t\t\t\t|| xformop==TJXOP_ROT90 || xformop==TJXOP_ROT270)\n\t\t\t{\n\t\t\t\tif(_subsamp==TJSAMP_422) _subsamp=TJSAMP_440;\n\t\t\t\telse if(_subsamp==TJSAMP_440) _subsamp=TJSAMP_422;\n\t\t\t}\n\n\t\t\tfor(row=0, tile=0; row<_ntilesh; row++)\n\t\t\t{\n\t\t\t\tfor(col=0; col<_ntilesw; col++, tile++)\n\t\t\t\t{\n\t\t\t\t\tt[tile].r.w=min(_tilew, _w-col*_tilew);\n\t\t\t\t\tt[tile].r.h=min(_tileh, _h-row*_tileh);\n\t\t\t\t\tt[tile].r.x=col*_tilew;\n\t\t\t\t\tt[tile].r.y=row*_tileh;\n\t\t\t\t\tt[tile].op=xformop;\n\t\t\t\t\tt[tile].options=xformopt|TJXOPT_TRIM;\n\t\t\t\t\tt[tile].customFilter=customFilter;\n\t\t\t\t\tif(t[tile].options&TJXOPT_NOOUTPUT && jpegbuf[tile])\n\t\t\t\t\t{\n\t\t\t\t\t\ttjFree(jpegbuf[tile]);  jpegbuf[tile]=NULL;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\titer=-warmup;\n\t\t\telapsed=0.;\n\t\t\twhile(1)\n\t\t\t{\n\t\t\t\tstart=gettime();\n\t\t\t\tif(tjTransform(handle, srcbuf, srcsize, _ntilesw*_ntilesh, jpegbuf,\n\t\t\t\t\tjpegsize, t, flags)==-1)\n\t\t\t\t\t_throwtj(\"executing tjTransform()\");\n\t\t\t\titer++;\n\t\t\t\tif(iter>=1)\n\t\t\t\t{\n\t\t\t\t\telapsed+=gettime()-start;\n\t\t\t\t\tif(elapsed>=benchtime) break;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfree(t);  t=NULL;\n\n\t\t\tfor(tile=0, totaljpegsize=0; tile<_ntilesw*_ntilesh; tile++)\n\t\t\t\ttotaljpegsize+=jpegsize[tile];\n\n\t\t\tif(quiet)\n\t\t\t{\n\t\t\t\tprintf(\"%-6s%s%-6s%s\",\n\t\t\t\t\tsigfig((double)(w*h)/1000000./elapsed, 4, tempstr, 80),\n\t\t\t\t\tquiet==2? \"\\n\":\"  \",\n\t\t\t\t\tsigfig((double)(w*h*ps)/(double)totaljpegsize, 4, tempstr2, 80),\n\t\t\t\t\tquiet==2? \"\\n\":\"  \");\n\t\t\t}\n\t\t\telse if(!quiet)\n\t\t\t{\n\t\t\t\tprintf(\"Transform     --> Frame rate:         %f fps\\n\", 1.0/elapsed);\n\t\t\t\tprintf(\"                  Output image size:  %lu bytes\\n\", totaljpegsize);\n\t\t\t\tprintf(\"                  Compression ratio:  %f:1\\n\",\n\t\t\t\t\t(double)(w*h*ps)/(double)totaljpegsize);\n\t\t\t\tprintf(\"                  Throughput:         %f Megapixels/sec\\n\",\n\t\t\t\t\t(double)(w*h)/1000000./elapsed);\n\t\t\t\tprintf(\"                  Output bit stream:  %f Megabits/sec\\n\",\n\t\t\t\t\t(double)totaljpegsize*8./1000000./elapsed);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(quiet==1) printf(\"N/A     N/A     \");\n\t\t\tjpegsize[0]=srcsize;\n\t\t\tmemcpy(jpegbuf[0], srcbuf, srcsize);\n\t\t}\n\n\t\tif(w==tilew) _tilew=_w;\n\t\tif(h==tileh) _tileh=_h;\n\t\tif(!(xformopt&TJXOPT_NOOUTPUT))\n\t\t{\n\t\t\tif(decomp(NULL, jpegbuf, jpegsize, NULL, _w, _h, _subsamp, 0,\n\t\t\t\tfilename, _tilew, _tileh)==-1)\n\t\t\t\tgoto bailout;\n\t\t}\n\t\telse if(quiet==1) printf(\"N/A\\n\");\n\n\t\tfor(i=0; i<ntilesw*ntilesh; i++)\n\t\t{\n\t\t\ttjFree(jpegbuf[i]);  jpegbuf[i]=NULL;\n\t\t}\n\t\tfree(jpegbuf);  jpegbuf=NULL;\n\t\tif(jpegsize) {free(jpegsize);  jpegsize=NULL;}\n\n\t\tif(tilew==w && tileh==h) break;\n\t}\n\n\tbailout:\n\tif(file) {fclose(file);  file=NULL;}\n\tif(jpegbuf)\n\t{\n\t\tfor(i=0; i<ntilesw*ntilesh; i++)\n\t\t{\n\t\t\tif(jpegbuf[i]) tjFree(jpegbuf[i]);  jpegbuf[i]=NULL;\n\t\t}\n\t\tfree(jpegbuf);  jpegbuf=NULL;\n\t}\n\tif(jpegsize) {free(jpegsize);  jpegsize=NULL;}\n\tif(srcbuf) {free(srcbuf);  srcbuf=NULL;}\n\tif(t) {free(t);  t=NULL;}\n\tif(handle) {tjDestroy(handle);  handle=NULL;}\n\treturn retval;\n}\n\n\nvoid usage(char *progname)\n{\n\tint i;\n\tprintf(\"USAGE: %s\\n\", progname);\n\tprintf(\"       <Inputfile (BMP|PPM)> <Quality> [options]\\n\\n\");\n\tprintf(\"       %s\\n\", progname);\n\tprintf(\"       <Inputfile (JPG)> [options]\\n\\n\");\n\tprintf(\"Options:\\n\\n\");\n\tprintf(\"-alloc = Dynamically allocate JPEG image buffers\\n\");\n\tprintf(\"-bmp = Generate output images in Windows Bitmap format (default = PPM)\\n\");\n\tprintf(\"-bottomup = Test bottom-up compression/decompression\\n\");\n\tprintf(\"-tile = Test performance of the codec when the image is encoded as separate\\n\");\n\tprintf(\"     tiles of varying sizes.\\n\");\n\tprintf(\"-rgb, -bgr, -rgbx, -bgrx, -xbgr, -xrgb =\\n\");\n\tprintf(\"     Test the specified color conversion path in the codec (default = BGR)\\n\");\n\tprintf(\"-cmyk = Indirectly test YCCK JPEG compression/decompression (the source\\n\");\n\tprintf(\"     and destination bitmaps are still RGB.  The conversion is done\\n\");\n\tprintf(\"     internally prior to compression or after decompression.)\\n\");\n\tprintf(\"-fastupsample = Use the fastest chrominance upsampling algorithm available in\\n\");\n\tprintf(\"     the underlying codec\\n\");\n\tprintf(\"-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying\\n\");\n\tprintf(\"     codec\\n\");\n\tprintf(\"-accuratedct = Use the most accurate DCT/IDCT algorithms available in the\\n\");\n\tprintf(\"     underlying codec\\n\");\n\tprintf(\"-subsamp <s> = When testing JPEG compression, this option specifies the level\\n\");\n\tprintf(\"     of chrominance subsampling to use (<s> = 444, 422, 440, 420, 411, or\\n\");\n\tprintf(\"     GRAY).  The default is to test Grayscale, 4:2:0, 4:2:2, and 4:4:4 in\\n\");\n\tprintf(\"     sequence.\\n\");\n\tprintf(\"-quiet = Output results in tabular rather than verbose format\\n\");\n\tprintf(\"-yuv = Test YUV encoding/decoding functions\\n\");\n\tprintf(\"-yuvpad <p> = If testing YUV encoding/decoding, this specifies the number of\\n\");\n\tprintf(\"     bytes to which each row of each plane in the intermediate YUV image is\\n\");\n\tprintf(\"     padded (default = 1)\\n\");\n\tprintf(\"-scale M/N = Scale down the width/height of the decompressed JPEG image by a\\n\");\n\tprintf(\"     factor of M/N (M/N = \");\n\tfor(i=0; i<nsf; i++)\n\t{\n\t\tprintf(\"%d/%d\", scalingfactors[i].num, scalingfactors[i].denom);\n\t\tif(nsf==2 && i!=nsf-1) printf(\" or \");\n\t\telse if(nsf>2)\n\t\t{\n\t\t\tif(i!=nsf-1) printf(\", \");\n\t\t\tif(i==nsf-2) printf(\"or \");\n\t\t}\n\t\tif(i%8==0 && i!=0) printf(\"\\n     \");\n\t}\n\tprintf(\")\\n\");\n\tprintf(\"-hflip, -vflip, -transpose, -transverse, -rot90, -rot180, -rot270 =\\n\");\n\tprintf(\"     Perform the corresponding lossless transform prior to\\n\");\n\tprintf(\"     decompression (these options are mutually exclusive)\\n\");\n\tprintf(\"-grayscale = Perform lossless grayscale conversion prior to decompression\\n\");\n\tprintf(\"     test (can be combined with the other transforms above)\\n\");\n\tprintf(\"-benchtime <t> = Run each benchmark for at least <t> seconds (default = 5.0)\\n\");\n\tprintf(\"-warmup <w> = Execute each benchmark <w> times to prime the cache before\\n\");\n\tprintf(\"     taking performance measurements (default = 1)\\n\");\n\tprintf(\"-componly = Stop after running compression tests.  Do not test decompression.\\n\");\n\tprintf(\"-nowrite = Do not write reference or output images (improves consistency of\\n\");\n\tprintf(\"     performance measurements.)\\n\\n\");\n\tprintf(\"NOTE:  If the quality is specified as a range (e.g. 90-100), a separate\\n\");\n\tprintf(\"test will be performed for all quality values in the range.\\n\\n\");\n\texit(1);\n}\n\n\nint main(int argc, char *argv[])\n{\n\tunsigned char *srcbuf=NULL;  int w=0, h=0, i, j;\n\tint minqual=-1, maxqual=-1;  char *temp;\n\tint minarg=2, retval=0, subsamp=-1;\n\n\tif((scalingfactors=tjGetScalingFactors(&nsf))==NULL || nsf==0)\n\t\t_throwtj(\"executing tjGetScalingFactors()\");\n\n\tif(argc<minarg) usage(argv[0]);\n\n\ttemp=strrchr(argv[1], '.');\n\tif(temp!=NULL)\n\t{\n\t\tif(!strcasecmp(temp, \".bmp\")) ext=\"bmp\";\n\t\tif(!strcasecmp(temp, \".jpg\") || !strcasecmp(temp, \".jpeg\")) decomponly=1;\n\t}\n\n\tprintf(\"\\n\");\n\n\tif(!decomponly)\n\t{\n\t\tminarg=3;\n\t\tif(argc<minarg) usage(argv[0]);\n\t\tif((minqual=atoi(argv[2]))<1 || minqual>100)\n\t\t{\n\t\t\tputs(\"ERROR: Quality must be between 1 and 100.\");\n\t\t\texit(1);\n\t\t}\n\t\tif((temp=strchr(argv[2], '-'))!=NULL && strlen(temp)>1\n\t\t\t&& sscanf(&temp[1], \"%d\", &maxqual)==1 && maxqual>minqual && maxqual>=1\n\t\t\t&& maxqual<=100) {}\n\t\telse maxqual=minqual;\n\t}\n\n\tif(argc>minarg)\n\t{\n\t\tfor(i=minarg; i<argc; i++)\n\t\t{\n\t\t\tif(!strcasecmp(argv[i], \"-tile\"))\n\t\t\t{\n\t\t\t\tdotile=1;  xformopt|=TJXOPT_CROP;\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-fastupsample\"))\n\t\t\t{\n\t\t\t\tprintf(\"Using fast upsampling code\\n\\n\");\n\t\t\t\tflags|=TJFLAG_FASTUPSAMPLE;\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-fastdct\"))\n\t\t\t{\n\t\t\t\tprintf(\"Using fastest DCT/IDCT algorithm\\n\\n\");\n\t\t\t\tflags|=TJFLAG_FASTDCT;\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-accuratedct\"))\n\t\t\t{\n\t\t\t\tprintf(\"Using most accurate DCT/IDCT algorithm\\n\\n\");\n\t\t\t\tflags|=TJFLAG_ACCURATEDCT;\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-rgb\")) pf=TJPF_RGB;\n\t\t\tif(!strcasecmp(argv[i], \"-rgbx\")) pf=TJPF_RGBX;\n\t\t\tif(!strcasecmp(argv[i], \"-bgr\")) pf=TJPF_BGR;\n\t\t\tif(!strcasecmp(argv[i], \"-bgrx\")) pf=TJPF_BGRX;\n\t\t\tif(!strcasecmp(argv[i], \"-xbgr\")) pf=TJPF_XBGR;\n\t\t\tif(!strcasecmp(argv[i], \"-xrgb\")) pf=TJPF_XRGB;\n\t\t\tif(!strcasecmp(argv[i], \"-cmyk\")) pf=TJPF_CMYK;\n\t\t\tif(!strcasecmp(argv[i], \"-bottomup\")) flags|=TJFLAG_BOTTOMUP;\n\t\t\tif(!strcasecmp(argv[i], \"-quiet\")) quiet=1;\n\t\t\tif(!strcasecmp(argv[i], \"-qq\")) quiet=2;\n\t\t\tif(!strcasecmp(argv[i], \"-scale\") && i<argc-1)\n\t\t\t{\n\t\t\t\tint temp1=0, temp2=0, match=0;\n\t\t\t\tif(sscanf(argv[++i], \"%d/%d\", &temp1, &temp2)==2)\n\t\t\t\t{\n\t\t\t\t\tfor(j=0; j<nsf; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif((double)temp1/(double)temp2\n\t\t\t\t\t\t\t== (double)scalingfactors[j].num/(double)scalingfactors[j].denom)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsf=scalingfactors[j];\n\t\t\t\t\t\t\tmatch=1;  break;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!match) usage(argv[0]);\n\t\t\t\t}\n\t\t\t\telse usage(argv[0]);\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-hflip\")) xformop=TJXOP_HFLIP;\n\t\t\tif(!strcasecmp(argv[i], \"-vflip\")) xformop=TJXOP_VFLIP;\n\t\t\tif(!strcasecmp(argv[i], \"-transpose\")) xformop=TJXOP_TRANSPOSE;\n\t\t\tif(!strcasecmp(argv[i], \"-transverse\")) xformop=TJXOP_TRANSVERSE;\n\t\t\tif(!strcasecmp(argv[i], \"-rot90\")) xformop=TJXOP_ROT90;\n\t\t\tif(!strcasecmp(argv[i], \"-rot180\")) xformop=TJXOP_ROT180;\n\t\t\tif(!strcasecmp(argv[i], \"-rot270\")) xformop=TJXOP_ROT270;\n\t\t\tif(!strcasecmp(argv[i], \"-grayscale\")) xformopt|=TJXOPT_GRAY;\n\t\t\tif(!strcasecmp(argv[i], \"-custom\")) customFilter=dummyDCTFilter;\n\t\t\tif(!strcasecmp(argv[i], \"-nooutput\")) xformopt|=TJXOPT_NOOUTPUT;\n\t\t\tif(!strcasecmp(argv[i], \"-benchtime\") && i<argc-1)\n\t\t\t{\n\t\t\t\tdouble temp=atof(argv[++i]);\n\t\t\t\tif(temp>0.0) benchtime=temp;\n\t\t\t\telse usage(argv[0]);\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-warmup\") && i<argc-1)\n\t\t\t{\n\t\t\t\tint temp=atoi(argv[++i]);\n\t\t\t\tif(temp>=0)\n\t\t\t\t{\n\t\t\t\t\twarmup=temp;\n\t\t\t\t\tprintf(\"Warmup runs = %d\\n\\n\", warmup);\n\t\t\t\t}\n\t\t\t\telse usage(argv[0]);\n\t\t\t}\n\t\t\tif(!strcmp(argv[i], \"-?\")) usage(argv[0]);\n\t\t\tif(!strcasecmp(argv[i], \"-alloc\")) flags&=(~TJFLAG_NOREALLOC);\n\t\t\tif(!strcasecmp(argv[i], \"-bmp\")) ext=\"bmp\";\n\t\t\tif(!strcasecmp(argv[i], \"-yuv\"))\n\t\t\t{\n\t\t\t\tprintf(\"Testing YUV planar encoding/decoding\\n\\n\");\n\t\t\t\tdoyuv=1;\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-yuvpad\") && i<argc-1)\n\t\t\t{\n\t\t\t\tint temp=atoi(argv[++i]);\n\t\t\t\tif(temp>=1) yuvpad=temp;\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-subsamp\") && i<argc-1)\n\t\t\t{\n\t\t\t\ti++;\n\t\t\t\tif(toupper(argv[i][0])=='G') subsamp=TJSAMP_GRAY;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tint temp=atoi(argv[i]);\n\t\t\t\t\tswitch(temp)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 444:  subsamp=TJSAMP_444;  break;\n\t\t\t\t\t\tcase 422:  subsamp=TJSAMP_422;  break;\n\t\t\t\t\t\tcase 440:  subsamp=TJSAMP_440;  break;\n\t\t\t\t\t\tcase 420:  subsamp=TJSAMP_420;  break;\n\t\t\t\t\t\tcase 411:  subsamp=TJSAMP_411;  break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-componly\")) componly=1;\n\t\t\tif(!strcasecmp(argv[i], \"-nowrite\")) dowrite=0;\n\t\t}\n\t}\n\n\tif((sf.num!=1 || sf.denom!=1) && dotile)\n\t{\n\t\tprintf(\"Disabling tiled compression/decompression tests, because those tests do not\\n\");\n\t\tprintf(\"work when scaled decompression is enabled.\\n\");\n\t\tdotile=0;\n\t}\n\n\tif((flags&TJFLAG_NOREALLOC)==0 && dotile)\n\t{\n\t\tprintf(\"Disabling tiled compression/decompression tests, because those tests do not\\n\");\n\t\tprintf(\"work when dynamic JPEG buffer allocation is enabled.\\n\\n\");\n\t\tdotile=0;\n\t}\n\n\tif(!decomponly)\n\t{\n\t\tif(loadbmp(argv[1], &srcbuf, &w, &h, pf, (flags&TJFLAG_BOTTOMUP)!=0)==-1)\n\t\t\t_throwbmp(\"loading bitmap\");\n\t\ttemp=strrchr(argv[1], '.');\n\t\tif(temp!=NULL) *temp='\\0';\n\t}\n\n\tif(quiet==1 && !decomponly)\n\t{\n\t\tprintf(\"All performance values in Mpixels/sec\\n\\n\");\n\t\tprintf(\"Bitmap     JPEG     JPEG  %s  %s   \",\n\t\t\tdotile? \"Tile \":\"Image\", dotile? \"Tile \":\"Image\");\n\t\tif(doyuv) printf(\"Encode  \");\n\t\tprintf(\"Comp    Comp    Decomp  \");\n\t\tif(doyuv) printf(\"Decode\");\n\t\tprintf(\"\\n\");\n\t\tprintf(\"Format     Subsamp  Qual  Width  Height  \");\n\t\tif(doyuv) printf(\"Perf    \");\n\t\tprintf(\"Perf    Ratio   Perf    \");\n\t\tif(doyuv) printf(\"Perf\");\n\t\tprintf(\"\\n\\n\");\n\t}\n\n\tif(decomponly)\n\t{\n\t\tdecompTest(argv[1]);\n\t\tprintf(\"\\n\");\n\t\tgoto bailout;\n\t}\n\tif(subsamp>=0 && subsamp<TJ_NUMSAMP)\n\t{\n\t\tfor(i=maxqual; i>=minqual; i--)\n\t\t\tfullTest(srcbuf, w, h, subsamp, i, argv[1]);\n\t\tprintf(\"\\n\");\n\t}\n\telse\n\t{\n\t\tif(pf!=TJPF_CMYK)\n\t\t{\n\t\t\tfor(i=maxqual; i>=minqual; i--)\n\t\t\t\tfullTest(srcbuf, w, h, TJSAMP_GRAY, i, argv[1]);\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t\tfor(i=maxqual; i>=minqual; i--)\n\t\t\tfullTest(srcbuf, w, h, TJSAMP_420, i, argv[1]);\n\t\tprintf(\"\\n\");\n\t\tfor(i=maxqual; i>=minqual; i--)\n\t\t\tfullTest(srcbuf, w, h, TJSAMP_422, i, argv[1]);\n\t\tprintf(\"\\n\");\n\t\tfor(i=maxqual; i>=minqual; i--)\n\t\t\tfullTest(srcbuf, w, h, TJSAMP_444, i, argv[1]);\n\t\tprintf(\"\\n\");\n\t}\n\n\tbailout:\n\tif(srcbuf) free(srcbuf);\n\treturn retval;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/tjbenchtest.in",
    "content": "#!/bin/bash\n\nset -u\nset -e\ntrap onexit INT\ntrap onexit TERM\ntrap onexit EXIT\n\nonexit()\n{\n\tif [ -d $OUTDIR ]; then\n\t\trm -rf $OUTDIR\n\tfi\n}\n\nrunme()\n{\n\techo \\*\\*\\* $*\n\t$*\n}\n\nEXT=bmp\nIMAGES=\"vgl_5674_0098.${EXT} vgl_6434_0018a.${EXT} vgl_6548_0026a.${EXT} nightshot_iso_100.${EXT}\"\nIMGDIR=@srcdir@/testimages\nOUTDIR=`mktemp -d /tmp/__tjbenchtest_output.XXXXXX`\nEXEDIR=.\nBMPARG=\nNSARG=\nYUVARG=\nALLOC=0\nALLOCARG=\nif [ \"$EXT\" = \"bmp\" ]; then BMPARG=-bmp; fi\n\nif [ -d $OUTDIR ]; then\n\trm -rf $OUTDIR\nfi\nmkdir -p $OUTDIR\n\nexec >$EXEDIR/tjbenchtest.log\n\nif [ $# -gt 0 ]; then\n\tif [ \"$1\" = \"-yuv\" ]; then\n\t\tNSARG=-nosmooth\n\t\tYUVARG=-yuv\n\n# NOTE: The combination of tjEncodeYUV*() and tjCompressFromYUV*() does not\n# always produce bitwise-identical results to tjCompress*() if subsampling is\n# enabled.  In both cases, if the image width or height are not evenly\n# divisible by the MCU width/height, then the bottom and/or right edge are\n# expanded.  However, the libjpeg code performs this expansion prior to\n# downsampling, and TurboJPEG performs it in tjCompressFromYUV*(), which is\n# after downsampling.  Thus, the two will agree only if the width/height along\n# each downsampled dimension is an odd number or is evenly divisible by the MCU\n# width/height.  This disagreement basically amounts to a round-off error, but\n# there is no easy way around it, so for now, we just test the only image that\n# works.  (NOTE: nightshot_iso_100 does not suffer from the above issue, but\n# it suffers from an unrelated problem whereby the combination of\n# tjDecompressToYUV*() and tjDecodeYUV*() do not produce bitwise-identical\n# results to tjDecompress*() if decompression scaling is enabled.  This latter\n# phenomenon is not yet fully understood but is also believed to be some sort\n# of round-off error.)\n\t\tIMAGES=\"vgl_6548_0026a.${EXT}\"\n\tfi\n\tif [ \"$1\" = \"-alloc\" ]; then\n\t\tALLOCARG=-alloc\n\t\tALLOC=1\n\tfi\nfi\n\n# Standard tests\nfor image in $IMAGES; do\n\n\tcp $IMGDIR/$image $OUTDIR\n\tbasename=`basename $image .${EXT}`\n\trunme $EXEDIR/cjpeg -quality 95 -dct fast -grayscale -outfile $OUTDIR/${basename}_GRAY_fast_cjpeg.jpg $IMGDIR/${basename}.${EXT}\n\trunme $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x2 -outfile $OUTDIR/${basename}_420_fast_cjpeg.jpg $IMGDIR/${basename}.${EXT}\n\trunme $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x1 -outfile $OUTDIR/${basename}_422_fast_cjpeg.jpg $IMGDIR/${basename}.${EXT}\n\trunme $EXEDIR/cjpeg -quality 95 -dct fast -sample 1x1 -outfile $OUTDIR/${basename}_444_fast_cjpeg.jpg $IMGDIR/${basename}.${EXT}\n\trunme $EXEDIR/cjpeg -quality 95 -dct int -grayscale -outfile $OUTDIR/${basename}_GRAY_accurate_cjpeg.jpg $IMGDIR/${basename}.${EXT}\n\trunme $EXEDIR/cjpeg -quality 95 -dct int -sample 2x2 -outfile $OUTDIR/${basename}_420_accurate_cjpeg.jpg $IMGDIR/${basename}.${EXT}\n\trunme $EXEDIR/cjpeg -quality 95 -dct int -sample 2x1 -outfile $OUTDIR/${basename}_422_accurate_cjpeg.jpg $IMGDIR/${basename}.${EXT}\n\trunme $EXEDIR/cjpeg -quality 95 -dct int -sample 1x1 -outfile $OUTDIR/${basename}_444_accurate_cjpeg.jpg $IMGDIR/${basename}.${EXT}\n\tfor samp in GRAY 420 422 444; do\n\t\trunme $EXEDIR/djpeg -rgb $NSARG $BMPARG -outfile $OUTDIR/${basename}_${samp}_default_djpeg.${EXT} $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg\n\t\trunme $EXEDIR/djpeg -dct fast -rgb $NSARG $BMPARG -outfile $OUTDIR/${basename}_${samp}_fast_djpeg.${EXT} $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg\n\t\trunme $EXEDIR/djpeg -dct int -rgb $NSARG $BMPARG -outfile $OUTDIR/${basename}_${samp}_accurate_djpeg.${EXT} $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg\n\tdone\n\tfor samp in 420 422; do\n\t\trunme $EXEDIR/djpeg -nosmooth $BMPARG -outfile $OUTDIR/${basename}_${samp}_default_nosmooth_djpeg.${EXT} $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg\n\t\trunme $EXEDIR/djpeg -dct fast -nosmooth $BMPARG -outfile $OUTDIR/${basename}_${samp}_fast_nosmooth_djpeg.${EXT} $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg\n\t\trunme $EXEDIR/djpeg -dct int -nosmooth $BMPARG -outfile $OUTDIR/${basename}_${samp}_accurate_nosmooth_djpeg.${EXT} $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg\n\tdone\n\n\t# Compression\n\tfor dct in accurate fast; do\n\t\trunme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -quiet -benchtime 0.01 -warmup 0 -${dct}dct $YUVARG $ALLOCARG\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\trunme cmp $OUTDIR/${basename}_${samp}_Q95.jpg $OUTDIR/${basename}_${samp}_${dct}_cjpeg.jpg\n\t\tdone\n\tdone\n\n\tfor dct in fast accurate default; do\n\t\tdctarg=-${dct}dct\n\t\tif [ \"${dct}\" = \"default\" ]; then\n\t\t\tdctarg=\n\t\tfi\n\n\t\t# Tiled compression & decompression\n\t\trunme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -warmup 0 ${dctarg} $YUVARG $ALLOCARG\n\t\tfor samp in GRAY 444; do\n\t\t\tif [ $ALLOC = 1 ]; then\n\t\t\t\trunme cmp $OUTDIR/${basename}_${samp}_Q95_full.${EXT} $OUTDIR/${basename}_${samp}_${dct}_djpeg.${EXT}\n\t\t\t\trm $OUTDIR/${basename}_${samp}_Q95_full.${EXT}\n\t\t\telse\n\t\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \\\n\t\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do\n\t\t\t\t\trunme cmp $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.${EXT}\n\t\t\t\t\trm $i\n\t\t\t\tdone\n\t\t\tfi\n\t\tdone\n\t\trunme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample ${dctarg} $YUVARG $ALLOCARG\n\t\tfor samp in 420 422; do\n\t\t\tif [ $ALLOC = 1 ]; then\n\t\t\t\trunme cmp $OUTDIR/${basename}_${samp}_Q95_full.${EXT} $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.${EXT}\n\t\t\t\trm $OUTDIR/${basename}_${samp}_Q95_full.${EXT}\n\t\t\telse\n\t\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \\\n\t\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do\n\t\t\t\t\trunme cmp $i $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.${EXT}\n\t\t\t\t\trm $i\n\t\t\t\tdone\n\t\t\tfi\n\t\tdone\n\n\t\t# Tiled decompression\n\t\tfor samp in GRAY 444; do\n\t\t\trunme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01 -warmup 0 ${dctarg} $YUVARG $ALLOCARG\n\t\t\tif [ $ALLOC = 1 ]; then\n\t\t\t\trunme cmp $OUTDIR/${basename}_${samp}_Q95_full.${EXT} $OUTDIR/${basename}_${samp}_${dct}_djpeg.${EXT}\n\t\t\t\trm $OUTDIR/${basename}_${samp}_Q95_full.${EXT}\n\t\t\telse\n\t\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \\\n\t\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do\n\t\t\t\t\trunme cmp $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.${EXT}\n\t\t\t\t\trm $i\n\t\t\t\tdone\n\t\t\tfi\n\t\tdone\n\t\tfor samp in 420 422; do\n\t\t\trunme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample ${dctarg} $YUVARG $ALLOCARG\n\t\t\tif [ $ALLOC = 1 ]; then\n\t\t\t\trunme cmp $OUTDIR/${basename}_${samp}_Q95_full.${EXT} $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.${EXT}\n\t\t\t\trm $OUTDIR/${basename}_${samp}_Q95_full.${EXT}\n\t\t\telse\n\t\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \\\n\t\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do\n\t\t\t\t\trunme cmp $i $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.${EXT}\n\t\t\t\t\trm $i\n\t\t\t\tdone\n\t\t\tfi\n\t\tdone\n\tdone\n\n\t# Scaled decompression\n\tfor scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do\n\t\tscalearg=`echo $scale | sed s@_@/@g`\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\trunme $EXEDIR/djpeg -rgb -scale ${scalearg} $NSARG $BMPARG -outfile $OUTDIR/${basename}_${samp}_${scale}_djpeg.${EXT} $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg\n\t\t\trunme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -scale ${scalearg} -quiet -benchtime 0.01 -warmup 0 $YUVARG $ALLOCARG\n\t\t\trunme cmp $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT} $OUTDIR/${basename}_${samp}_${scale}_djpeg.${EXT}\n\t\t\trm $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT}\n\t\tdone\n\tdone\n\n\t# Transforms\n\tfor samp in GRAY 420 422 444; do\n\t\trunme $EXEDIR/jpegtran -flip horizontal -trim -outfile $OUTDIR/${basename}_${samp}_hflip_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg\n\t\trunme $EXEDIR/jpegtran -flip vertical -trim -outfile $OUTDIR/${basename}_${samp}_vflip_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg\n\t\trunme $EXEDIR/jpegtran -transpose -trim -outfile $OUTDIR/${basename}_${samp}_transpose_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg\n\t\trunme $EXEDIR/jpegtran -transverse -trim -outfile $OUTDIR/${basename}_${samp}_transverse_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg\n\t\trunme $EXEDIR/jpegtran -rotate 90 -trim -outfile $OUTDIR/${basename}_${samp}_rot90_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg\n\t\trunme $EXEDIR/jpegtran -rotate 180 -trim -outfile $OUTDIR/${basename}_${samp}_rot180_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg\n\t\trunme $EXEDIR/jpegtran -rotate 270 -trim -outfile $OUTDIR/${basename}_${samp}_rot270_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg\n\tdone\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444; do\n\t\t\trunme $EXEDIR/djpeg -rgb $BMPARG -outfile $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg\n\t\t\trunme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -warmup 0 $YUVARG $ALLOCARG\n\t\t\tif [ $ALLOC = 1 ]; then\n\t\t\t\trunme cmp $OUTDIR/${basename}_${samp}_Q95_full.${EXT} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT}\n\t\t\t\trm $OUTDIR/${basename}_${samp}_Q95_full.${EXT}\n\t\t\telse\n\t\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \\\n\t\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do\n\t\t\t\t\trunme cmp $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT}\n\t\t\t\t\trm $i\n\t\t\t\tdone\n\t\t\tfi\n\t\tdone\n\t\tfor samp in 420 422; do\n\t\t\trunme $EXEDIR/djpeg -nosmooth -rgb $BMPARG -outfile $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg\n\t\t\trunme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample $YUVARG $ALLOCARG\n\t\t\tif [ $ALLOC = 1 ]; then\n\t\t\t\trunme cmp $OUTDIR/${basename}_${samp}_Q95_full.${EXT} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT}\n\t\t\t\trm $OUTDIR/${basename}_${samp}_Q95_full.${EXT}\n\t\t\telse\n\t\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \\\n\t\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do\n\t\t\t\t\trunme cmp $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT}\n\t\t\t\t\trm $i\n\t\t\t\tdone\n\t\t\tfi\n\t\tdone\n\tdone\n\n\t# Grayscale transform\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444 422 420; do\n\t\t\trunme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -warmup 0 -grayscale $YUVARG $ALLOCARG\n\t\t\tif [ $ALLOC = 1 ]; then\n\t\t\t\trunme cmp $OUTDIR/${basename}_${samp}_Q95_full.${EXT} $OUTDIR/${basename}_GRAY_${xform}_jpegtran.${EXT}\n\t\t\t\trm $OUTDIR/${basename}_${samp}_Q95_full.${EXT}\n\t\t\telse\n\t\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \\\n\t\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do\n\t\t\t\t\trunme cmp $i $OUTDIR/${basename}_GRAY_${xform}_jpegtran.${EXT}\n\t\t\t\t\trm $i\n\t\t\t\tdone\n\t\t\tfi\n\t\tdone\n\tdone\n\n\t# Transforms with scaling\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444 422 420; do\n\t\t\tfor scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do\n\t\t\t\tscalearg=`echo $scale | sed s@_@/@g`\n\t\t\t\trunme $EXEDIR/djpeg -rgb -scale ${scalearg} $NSARG $BMPARG -outfile $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.${EXT} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg\n\t\t\t\trunme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -scale ${scalearg} -quiet -benchtime 0.01 -warmup 0 $YUVARG $ALLOCARG\n\t\t\t\trunme cmp $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT} $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.${EXT}\n\t\t\t\trm $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT}\n\t\t\tdone\n\t\tdone\n\tdone\n\ndone\n\necho SUCCESS!\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/tjbenchtest.java.in",
    "content": "#!/bin/bash\n\nset -u\nset -e\ntrap onexit INT\ntrap onexit TERM\ntrap onexit EXIT\n\nonexit()\n{\n\tif [ -d $OUTDIR ]; then\n\t\trm -rf $OUTDIR\n\tfi\n}\n\nrunme()\n{\n\techo \\*\\*\\* $*\n\t$*\n}\n\nIMAGES=\"vgl_5674_0098.bmp vgl_6434_0018a.bmp vgl_6548_0026a.bmp nightshot_iso_100.bmp\"\nIMGDIR=@srcdir@/testimages\nOUTDIR=`mktemp -d /tmp/__tjbenchtest_java_output.XXXXXX`\nEXEDIR=.\nJAVA=\"@JAVA@ -cp java/turbojpeg.jar -Djava.library.path=.libs\"\nBMPARG=\nNSARG=\nYUVARG=\n\nif [ -d $OUTDIR ]; then\n\trm -rf $OUTDIR\nfi\nmkdir -p $OUTDIR\n\nexec >$EXEDIR/tjbenchtest-java.log\n\nif [ $# -gt 0 ]; then\n\tif [ \"$1\" = \"-yuv\" ]; then\n\t\tNSARG=-nosmooth\n\t\tYUVARG=-yuv\n\n# NOTE: The combination of tjEncodeYUV*() and tjCompressFromYUV*() does not\n# always produce bitwise-identical results to tjCompress*() if subsampling is\n# enabled.  In both cases, if the image width or height are not evenly\n# divisible by the MCU width/height, then the bottom and/or right edge are\n# expanded.  However, the libjpeg code performs this expansion prior to\n# downsampling, and TurboJPEG performs it in tjCompressFromYUV*(), which is\n# after downsampling.  Thus, the two will agree only if the width/height along\n# each downsampled dimension is an odd number or is evenly divisible by the MCU\n# width/height.  This disagreement basically amounts to a round-off error, but\n# there is no easy way around it, so for now, we just test the only image that\n# works.  (NOTE: nightshot_iso_100 does not suffer from the above issue, but\n# it suffers from an unrelated problem whereby the combination of\n# tjDecompressToYUV*() and tjDecodeYUV*() do not produce bitwise-identical\n# results to tjDecompress*() if decompression scaling is enabled.  This latter\n# phenomenon is not yet fully understood but is also believed to be some sort\n# of round-off error.)\n\t\tIMAGES=\"vgl_6548_0026a.bmp\"\n\tfi\nfi\n\n# Standard tests\nfor image in $IMAGES; do\n\n\tcp $IMGDIR/$image $OUTDIR\n\tbasename=`basename $image .bmp`\n\trunme $EXEDIR/cjpeg -quality 95 -dct fast -grayscale -outfile $OUTDIR/${basename}_GRAY_fast_cjpeg.jpg $IMGDIR/${basename}.bmp\n\trunme $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x2 -outfile $OUTDIR/${basename}_420_fast_cjpeg.jpg $IMGDIR/${basename}.bmp\n\trunme $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x1 -outfile $OUTDIR/${basename}_422_fast_cjpeg.jpg $IMGDIR/${basename}.bmp\n\trunme $EXEDIR/cjpeg -quality 95 -dct fast -sample 1x1 -outfile $OUTDIR/${basename}_444_fast_cjpeg.jpg $IMGDIR/${basename}.bmp\n\trunme $EXEDIR/cjpeg -quality 95 -dct int -grayscale -outfile $OUTDIR/${basename}_GRAY_accurate_cjpeg.jpg $IMGDIR/${basename}.bmp\n\trunme $EXEDIR/cjpeg -quality 95 -dct int -sample 2x2 -outfile $OUTDIR/${basename}_420_accurate_cjpeg.jpg $IMGDIR/${basename}.bmp\n\trunme $EXEDIR/cjpeg -quality 95 -dct int -sample 2x1 -outfile $OUTDIR/${basename}_422_accurate_cjpeg.jpg $IMGDIR/${basename}.bmp\n\trunme $EXEDIR/cjpeg -quality 95 -dct int -sample 1x1 -outfile $OUTDIR/${basename}_444_accurate_cjpeg.jpg $IMGDIR/${basename}.bmp\n\tfor samp in GRAY 420 422 444; do\n\t\trunme $EXEDIR/djpeg -rgb -bmp -outfile $OUTDIR/${basename}_${samp}_default_djpeg.bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg\n\t\trunme $EXEDIR/djpeg -dct fast -rgb -bmp -outfile $OUTDIR/${basename}_${samp}_fast_djpeg.bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg\n\t\trunme $EXEDIR/djpeg -dct int -rgb -bmp -outfile $OUTDIR/${basename}_${samp}_accurate_djpeg.bmp $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg\n\tdone\n\tfor samp in 420 422; do\n\t\trunme $EXEDIR/djpeg -nosmooth -bmp -outfile $OUTDIR/${basename}_${samp}_default_nosmooth_djpeg.bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg\n\t\trunme $EXEDIR/djpeg -dct fast -nosmooth -bmp -outfile $OUTDIR/${basename}_${samp}_fast_nosmooth_djpeg.bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg\n\t\trunme $EXEDIR/djpeg -dct int -nosmooth -bmp -outfile $OUTDIR/${basename}_${samp}_accurate_nosmooth_djpeg.bmp $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg\n\tdone\n\n\t# Compression\n\tfor dct in accurate fast; do\n\t\trunme $JAVA TJBench $OUTDIR/$image 95 -rgb -quiet -benchtime 0.01 -warmup 0 -${dct}dct $YUVARG\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\trunme cmp $OUTDIR/${basename}_${samp}_Q95.jpg $OUTDIR/${basename}_${samp}_${dct}_cjpeg.jpg\n\t\tdone\n\tdone\n\n\tfor dct in fast accurate default; do\n\t\tdctarg=-${dct}dct\n\t\tif [ \"${dct}\" = \"default\" ]; then\n\t\t\tdctarg=\n\t\tfi\n\n\t\t# Tiled compression & decompression\n\t\trunme $JAVA TJBench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -warmup 0 ${dctarg} $YUVARG\n\t\tfor samp in GRAY 444; do\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.bmp; do\n\t\t\t\trunme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.bmp\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\t\trunme $JAVA TJBench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample ${dctarg} $YUVARG\n\t\tfor samp in 420 422; do\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.bmp; do\n\t\t\t\trunme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.bmp\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\n\t\t# Tiled decompression\n\t\tfor samp in GRAY 444; do\n\t\t\trunme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -tile -quiet -benchtime 0.01 -warmup 0 ${dctarg} $YUVARG\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.bmp; do\n\t\t\t\trunme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.bmp\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\t\tfor samp in 420 422; do\n\t\t\trunme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample ${dctarg} $YUVARG\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.bmp; do\n\t\t\t\trunme cmp $i -i 54:54 $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.bmp\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\tdone\n\n\t# Scaled decompression\n\tfor scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do\n\t\tscalearg=`echo $scale | sed s@_@/@g`\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\trunme $EXEDIR/djpeg -rgb -scale ${scalearg} $NSARG -bmp -outfile $OUTDIR/${basename}_${samp}_${scale}_djpeg.bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg\n\t\t\trunme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -scale ${scalearg} -quiet -benchtime 0.01 -warmup 0 $YUVARG\n\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp $OUTDIR/${basename}_${samp}_${scale}_djpeg.bmp\n\t\t\trm $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp\n\t\tdone\n\tdone\n\n\t# Transforms\n\tfor samp in GRAY 420 422 444; do\n\t\trunme $EXEDIR/jpegtran -flip horizontal -trim -outfile $OUTDIR/${basename}_${samp}_hflip_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg\n\t\trunme $EXEDIR/jpegtran -flip vertical -trim -outfile $OUTDIR/${basename}_${samp}_vflip_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg\n\t\trunme $EXEDIR/jpegtran -transpose -trim -outfile $OUTDIR/${basename}_${samp}_transpose_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg\n\t\trunme $EXEDIR/jpegtran -transverse -trim -outfile $OUTDIR/${basename}_${samp}_transverse_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg\n\t\trunme $EXEDIR/jpegtran -rotate 90 -trim -outfile $OUTDIR/${basename}_${samp}_rot90_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg\n\t\trunme $EXEDIR/jpegtran -rotate 180 -trim -outfile $OUTDIR/${basename}_${samp}_rot180_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg\n\t\trunme $EXEDIR/jpegtran -rotate 270 -trim -outfile $OUTDIR/${basename}_${samp}_rot270_jpegtran.jpg $OUTDIR/${basename}_${samp}_Q95.jpg\n\tdone\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444; do\n\t\t\trunme $EXEDIR/djpeg -rgb -bmp -outfile $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg\n\t\t\trunme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -tile -quiet -benchtime 0.01 -warmup 0 $YUVARG\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.bmp; do\n\t\t\t\trunme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\t\tfor samp in 420 422; do\n\t\t\trunme $EXEDIR/djpeg -nosmooth -rgb -bmp -outfile $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg\n\t\t\trunme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample $YUVARG\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.bmp; do\n\t\t\t\trunme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\tdone\n\n\t# Grayscale transform\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444 422 420; do\n\t\t\trunme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -tile -quiet -benchtime 0.01 -warmup 0 -grayscale $YUVARG\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.bmp; do\n\t\t\t\trunme cmp -i 54:54 $i $OUTDIR/${basename}_GRAY_${xform}_jpegtran.bmp\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\tdone\n\n\t# Transforms with scaling\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444 422 420; do\n\t\t\tfor scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do\n\t\t\t\tscalearg=`echo $scale | sed s@_@/@g`\n\t\t\t\trunme $EXEDIR/djpeg -rgb -scale ${scalearg} $NSARG -bmp -outfile $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg\n\t\t\t\trunme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -scale ${scalearg} -quiet -benchtime 0.01 -warmup 0 $YUVARG\n\t\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.bmp\n\t\t\t\trm $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp\n\t\t\tdone\n\t\tdone\n\tdone\n\ndone\n\necho SUCCESS!\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/tjexampletest.in",
    "content": "#!/bin/bash\n\nset -u\nset -e\ntrap onexit INT\ntrap onexit TERM\ntrap onexit EXIT\n\nonexit()\n{\n\tif [ -d $OUTDIR ]; then\n\t\trm -rf $OUTDIR\n\tfi\n}\n\nrunme()\n{\n\techo \\*\\*\\* $*\n\t$*\n}\n\nIMAGES=\"vgl_5674_0098.bmp vgl_6434_0018a.bmp vgl_6548_0026a.bmp nightshot_iso_100.bmp\"\nIMGDIR=@srcdir@/testimages\nOUTDIR=__tjexampletest_output\nEXEDIR=.\nJAVA=\"@JAVA@ -cp java/turbojpeg.jar -Djava.library.path=.libs\"\n\nif [ -d $OUTDIR ]; then\n\trm -rf $OUTDIR\nfi\nmkdir -p $OUTDIR\n\nexec >$EXEDIR/tjexampletest.log\n\nfor image in $IMAGES; do\n\n\tcp $IMGDIR/$image $OUTDIR\n\tbasename=`basename $image .bmp`\n\t$EXEDIR/cjpeg -quality 95 -dct fast -grayscale $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_GRAY_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct fast -sample 2x2 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_420_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct fast -sample 2x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_422_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct fast -sample 1x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_444_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -grayscale $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_GRAY_accurate_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -sample 2x2 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_420_accurate_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -sample 2x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_422_accurate_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -sample 1x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_444_accurate_cjpeg.jpg\n\tfor samp in GRAY 420 422 444; do\n\t\t$EXEDIR/djpeg -rgb -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_djpeg.bmp\n\t\t$EXEDIR/djpeg -dct fast -rgb -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_djpeg.bmp\n\t\t$EXEDIR/djpeg -dct int -rgb -bmp $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_djpeg.bmp\n\tdone\n\tfor samp in 420 422; do\n\t\t$EXEDIR/djpeg -nosmooth -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_nosmooth_djpeg.bmp\n\t\t$EXEDIR/djpeg -dct fast -nosmooth -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_nosmooth_djpeg.bmp\n\t\t$EXEDIR/djpeg -dct int -nosmooth -bmp $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_nosmooth_djpeg.bmp\n\tdone\n\n\t# Compression\n\tfor dct in fast accurate; do\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\trunme $JAVA TJExample $OUTDIR/$image $OUTDIR/${basename}_${samp}_${dct}.jpg -q 95 -samp ${samp} -${dct}dct\n\t\t\trunme cmp $OUTDIR/${basename}_${samp}_${dct}.jpg $OUTDIR/${basename}_${samp}_${dct}_cjpeg.jpg\n\t\tdone\n\tdone\n\n\t# Decompression\n\tfor dct in fast accurate default; do\n\t\tsrcdct=${dct}\n\t\tdctarg=-${dct}dct\n\t\tif [ \"${dct}\" = \"default\" ]; then\n\t\t\tsrcdct=fast\n\t\t\tdctarg=\n\t\tfi\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_${srcdct}.jpg $OUTDIR/${basename}_${samp}_${dct}.bmp ${dctarg}\n\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${dct}.bmp $OUTDIR/${basename}_${samp}_${dct}_djpeg.bmp\n\t\t\trm $OUTDIR/${basename}_${samp}_${dct}.bmp\n\t\tdone\n\t\tfor samp in 420 422; do\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_${srcdct}.jpg $OUTDIR/${basename}_${samp}_${dct}_nosmooth.bmp -fastupsample ${dctarg}\n\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${dct}_nosmooth.bmp $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.bmp\n\t\t\trm $OUTDIR/${basename}_${samp}_${dct}_nosmooth.bmp\n\t\tdone\n\tdone\n\n\t# Scaled decompression\n\tfor scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do\n\t\tscalearg=`echo $scale | sed s@_@/@g`\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\t$EXEDIR/djpeg -rgb -bmp -scale ${scalearg} $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_${scale}_djpeg.bmp\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${scale}.bmp -scale ${scalearg}\n\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${scale}.bmp $OUTDIR/${basename}_${samp}_${scale}_djpeg.bmp\n\t\t\trm $OUTDIR/${basename}_${samp}_${scale}.bmp\n\t\tdone\n\tdone\n\n\t# Transforms\n\tfor samp in GRAY 420 422 444; do\n\t\t$EXEDIR/jpegtran -crop 70x60+16+16 -flip horizontal -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_hflip_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -crop 70x60+16+16 -flip vertical -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_vflip_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -crop 70x60+16+16 -transpose -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_transpose_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -crop 70x60+16+16 -transverse -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_transverse_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -crop 70x60+16+16 -rotate 90 -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_rot90_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -crop 70x60+16+16 -rotate 180 -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_rot180_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -crop 70x60+16+16 -rotate 270 -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_rot270_jpegtran.jpg\n\tdone\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}.jpg -$xform -crop 16,16,70x60\n\t\t\trunme cmp $OUTDIR/${basename}_${samp}_${xform}.jpg $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg\n\t\t\t$EXEDIR/djpeg -rgb -bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}.bmp -$xform -crop 16,16,70x60\n\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${xform}.bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp\n\t\t\trm $OUTDIR/${basename}_${samp}_${xform}.bmp\n\t\tdone\n\t\tfor samp in 420 422; do\n\t\t\t$EXEDIR/djpeg -nosmooth -rgb -bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}.bmp -$xform -crop 16,16,70x60 -fastupsample\n\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${xform}.bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp\n\t\t\trm $OUTDIR/${basename}_${samp}_${xform}.bmp\n\t\tdone\n\tdone\n\n\t# Grayscale transform\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444 422 420; do\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}.jpg -$xform -grayscale -crop 16,16,70x60\n\t\t\trunme cmp $OUTDIR/${basename}_${samp}_${xform}.jpg $OUTDIR/${basename}_GRAY_${xform}_jpegtran.jpg\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}.bmp -$xform -grayscale -crop 16,16,70x60\n\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${xform}.bmp $OUTDIR/${basename}_GRAY_${xform}_jpegtran.bmp\n\t\t\trm $OUTDIR/${basename}_${samp}_${xform}.bmp\n\t\tdone\n\tdone\n\n\t# Transforms with scaling\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444 422 420; do\n\t\t\tfor scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do\n\t\t\t\tscalearg=`echo $scale | sed s@_@/@g`\n\t\t\t\t$EXEDIR/djpeg -rgb -bmp -scale ${scalearg} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.bmp\n\t\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}_${scale}.bmp -$xform -scale ${scalearg} -crop 16,16,70x60\n\t\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${xform}_${scale}.bmp $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.bmp\n\t\t\t\trm $OUTDIR/${basename}_${samp}_${xform}_${scale}.bmp\n\t\t\tdone\n\t\tdone\n\tdone\n\ndone\n\necho SUCCESS!\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/tjunittest.c",
    "content": "/*\n * Copyright (C)2009-2014 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * This program tests the various code paths in the TurboJPEG C Wrapper\n */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <errno.h>\n#include \"./tjutil.h\"\n#include \"./turbojpeg.h\"\n#ifdef _WIN32\n #include <time.h>\n #define random() rand()\n#endif\n\n\nvoid usage(char *progName)\n{\n\tprintf(\"\\nUSAGE: %s [options]\\n\", progName);\n\tprintf(\"Options:\\n\");\n\tprintf(\"-yuv = test YUV encoding/decoding support\\n\");\n\tprintf(\"-noyuvpad = do not pad each line of each Y, U, and V plane to the nearest\\n\");\n\tprintf(\"            4-byte boundary\\n\");\n\tprintf(\"-alloc = test automatic buffer allocation\\n\");\n\texit(1);\n}\n\n\n#define _throwtj() {printf(\"TurboJPEG ERROR:\\n%s\\n\", tjGetErrorStr());  \\\n\tbailout();}\n#define _tj(f) {if((f)==-1) _throwtj();}\n#define _throw(m) {printf(\"ERROR: %s\\n\", m);  bailout();}\n\nconst char *subNameLong[TJ_NUMSAMP]=\n{\n\t\"4:4:4\", \"4:2:2\", \"4:2:0\", \"GRAY\", \"4:4:0\", \"4:1:1\"\n};\nconst char *subName[TJ_NUMSAMP]={\"444\", \"422\", \"420\", \"GRAY\", \"440\", \"411\"};\n\nconst char *pixFormatStr[TJ_NUMPF]=\n{\n\t\"RGB\", \"BGR\", \"RGBX\", \"BGRX\", \"XBGR\", \"XRGB\", \"Grayscale\",\n\t\"RGBA\", \"BGRA\", \"ABGR\", \"ARGB\", \"CMYK\"\n};\n\nconst int alphaOffset[TJ_NUMPF] = {-1, -1, -1, -1, -1, -1, -1, 3, 3, 0, 0, -1};\n\nconst int _3byteFormats[]={TJPF_RGB, TJPF_BGR};\nconst int _4byteFormats[]={TJPF_RGBX, TJPF_BGRX, TJPF_XBGR, TJPF_XRGB,\n\tTJPF_CMYK};\nconst int _onlyGray[]={TJPF_GRAY};\nconst int _onlyRGB[]={TJPF_RGB};\n\nint doyuv=0, alloc=0, pad=4;\n\nint exitStatus=0;\n#define bailout() {exitStatus=-1;  goto bailout;}\n\n\nvoid initBuf(unsigned char *buf, int w, int h, int pf, int flags)\n{\n\tint roffset=tjRedOffset[pf];\n\tint goffset=tjGreenOffset[pf];\n\tint boffset=tjBlueOffset[pf];\n\tint ps=tjPixelSize[pf];\n\tint index, row, col, halfway=16;\n\n\tif(pf==TJPF_GRAY)\n\t{\n\t\tmemset(buf, 0, w*h*ps);\n\t\tfor(row=0; row<h; row++)\n\t\t{\n\t\t\tfor(col=0; col<w; col++)\n\t\t\t{\n\t\t\t\tif(flags&TJFLAG_BOTTOMUP) index=(h-row-1)*w+col;\n\t\t\t\telse index=row*w+col;\n\t\t\t\tif(((row/8)+(col/8))%2==0) buf[index]=(row<halfway)? 255:0;\n\t\t\t\telse buf[index]=(row<halfway)? 76:226;\n\t\t\t}\n\t\t}\n\t}\n\telse if(pf==TJPF_CMYK)\n\t{\n\t\tmemset(buf, 255, w*h*ps);\n\t\tfor(row=0; row<h; row++)\n\t\t{\n\t\t\tfor(col=0; col<w; col++)\n\t\t\t{\n\t\t\t\tif(flags&TJFLAG_BOTTOMUP) index=(h-row-1)*w+col;\n\t\t\t\telse index=row*w+col;\n\t\t\t\tif(((row/8)+(col/8))%2==0)\n\t\t\t\t{\n\t\t\t\t\tif(row>=halfway) buf[index*ps+3]=0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbuf[index*ps+2]=0;\n\t\t\t\t\tif(row<halfway) buf[index*ps+1]=0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\tmemset(buf, 0, w*h*ps);\n\t\tfor(row=0; row<h; row++)\n\t\t{\n\t\t\tfor(col=0; col<w; col++)\n\t\t\t{\n\t\t\t\tif(flags&TJFLAG_BOTTOMUP) index=(h-row-1)*w+col;\n\t\t\t\telse index=row*w+col;\n\t\t\t\tif(((row/8)+(col/8))%2==0)\n\t\t\t\t{\n\t\t\t\t\tif(row<halfway)\n\t\t\t\t\t{\n\t\t\t\t\t\tbuf[index*ps+roffset]=255;\n\t\t\t\t\t\tbuf[index*ps+goffset]=255;\n\t\t\t\t\t\tbuf[index*ps+boffset]=255;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbuf[index*ps+roffset]=255;\n\t\t\t\t\tif(row>=halfway) buf[index*ps+goffset]=255;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n#define checkval(v, cv) { \\\n\tif(v<cv-1 || v>cv+1) { \\\n\t\tprintf(\"\\nComp. %s at %d,%d should be %d, not %d\\n\",  \\\n\t\t\t#v, row, col, cv, v); \\\n\t\tretval=0;  exitStatus=-1;  goto bailout; \\\n\t}}\n\n#define checkval0(v) { \\\n\tif(v>1) { \\\n\t\tprintf(\"\\nComp. %s at %d,%d should be 0, not %d\\n\", #v, row, col, v); \\\n\t\tretval=0;  exitStatus=-1;  goto bailout; \\\n\t}}\n\n#define checkval255(v) { \\\n\tif(v<254) { \\\n\t\tprintf(\"\\nComp. %s at %d,%d should be 255, not %d\\n\", #v, row, col, v); \\\n\t\tretval=0;  exitStatus=-1;  goto bailout; \\\n\t}}\n\n\nint checkBuf(unsigned char *buf, int w, int h, int pf, int subsamp,\n\ttjscalingfactor sf, int flags)\n{\n\tint roffset=tjRedOffset[pf];\n\tint goffset=tjGreenOffset[pf];\n\tint boffset=tjBlueOffset[pf];\n\tint aoffset=alphaOffset[pf];\n\tint ps=tjPixelSize[pf];\n\tint index, row, col, retval=1;\n\tint halfway=16*sf.num/sf.denom;\n\tint blocksize=8*sf.num/sf.denom;\n\n\tif(pf==TJPF_CMYK)\n\t{\n\t\tfor(row=0; row<h; row++)\n\t\t{\n\t\t\tfor(col=0; col<w; col++)\n\t\t\t{\n\t\t\t\tunsigned char c, m, y, k;\n\t\t\t\tif(flags&TJFLAG_BOTTOMUP) index=(h-row-1)*w+col;\n\t\t\t\telse index=row*w+col;\n\t\t\t\tc=buf[index*ps];\n\t\t\t\tm=buf[index*ps+1];\n\t\t\t\ty=buf[index*ps+2];\n\t\t\t\tk=buf[index*ps+3];\n\t\t\t\tif(((row/blocksize)+(col/blocksize))%2==0)\n\t\t\t\t{\n\t\t\t\t\tcheckval255(c);  checkval255(m);  checkval255(y);\n\t\t\t\t\tif(row<halfway) checkval255(k)\n\t\t\t\t\telse checkval0(k)\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcheckval255(c);  checkval0(y);  checkval255(k);\n\t\t\t\t\tif(row<halfway) checkval0(m)\n\t\t\t\t\telse checkval255(m)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 1;\n\t}\n\n\tfor(row=0; row<h; row++)\n\t{\n\t\tfor(col=0; col<w; col++)\n\t\t{\n\t\t\tunsigned char r, g, b, a;\n\t\t\tif(flags&TJFLAG_BOTTOMUP) index=(h-row-1)*w+col;\n\t\t\telse index=row*w+col;\n\t\t\tr=buf[index*ps+roffset];\n\t\t\tg=buf[index*ps+goffset];\n\t\t\tb=buf[index*ps+boffset];\n\t\t\ta=aoffset>=0? buf[index*ps+aoffset]:0xFF;\n\t\t\tif(((row/blocksize)+(col/blocksize))%2==0)\n\t\t\t{\n\t\t\t\tif(row<halfway)\n\t\t\t\t{\n\t\t\t\t\tcheckval255(r);  checkval255(g);  checkval255(b);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcheckval0(r);  checkval0(g);  checkval0(b);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(subsamp==TJSAMP_GRAY)\n\t\t\t\t{\n\t\t\t\t\tif(row<halfway)\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckval(r, 76);  checkval(g, 76);  checkval(b, 76);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckval(r, 226);  checkval(g, 226);  checkval(b, 226);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(row<halfway)\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckval255(r);  checkval0(g);  checkval0(b);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckval255(r);  checkval255(g);  checkval0(b);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcheckval255(a);\n\t\t}\n\t}\n\n\tbailout:\n\tif(retval==0)\n\t{\n\t\tfor(row=0; row<h; row++)\n\t\t{\n\t\t\tfor(col=0; col<w; col++)\n\t\t\t{\n\t\t\t\tif(pf==TJPF_CMYK)\n\t\t\t\t\tprintf(\"%.3d/%.3d/%.3d/%.3d \", buf[(row*w+col)*ps],\n\t\t\t\t\t\tbuf[(row*w+col)*ps+1], buf[(row*w+col)*ps+2],\n\t\t\t\t\t\tbuf[(row*w+col)*ps+3]);\n\t\t\t\telse\n\t\t\t\t\tprintf(\"%.3d/%.3d/%.3d \", buf[(row*w+col)*ps+roffset],\n\t\t\t\t\t\tbuf[(row*w+col)*ps+goffset], buf[(row*w+col)*ps+boffset]);\n\t\t\t}\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t}\n\treturn retval;\n}\n\n\n#define PAD(v, p) ((v+(p)-1)&(~((p)-1)))\n\nint checkBufYUV(unsigned char *buf, int w, int h, int subsamp,\n\ttjscalingfactor sf)\n{\n\tint row, col;\n\tint hsf=tjMCUWidth[subsamp]/8, vsf=tjMCUHeight[subsamp]/8;\n\tint pw=PAD(w, hsf), ph=PAD(h, vsf);\n\tint cw=pw/hsf, ch=ph/vsf;\n\tint ypitch=PAD(pw, pad), uvpitch=PAD(cw, pad);\n\tint retval=1;\n\tint halfway=16*sf.num/sf.denom;\n\tint blocksize=8*sf.num/sf.denom;\n\n\tfor(row=0; row<ph; row++)\n\t{\n\t\tfor(col=0; col<pw; col++)\n\t\t{\n\t\t\tunsigned char y=buf[ypitch*row+col];\n\t\t\tif(((row/blocksize)+(col/blocksize))%2==0)\n\t\t\t{\n\t\t\t\tif(row<halfway) checkval255(y)  else checkval0(y);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(row<halfway) checkval(y, 76)  else checkval(y, 226);\n\t\t\t}\n\t\t}\n\t}\n\tif(subsamp!=TJSAMP_GRAY)\n\t{\n\t\tint halfway=16/vsf*sf.num/sf.denom;\n\t\tfor(row=0; row<ch; row++)\n\t\t{\n\t\t\tfor(col=0; col<cw; col++)\n\t\t\t{\n\t\t\t\tunsigned char u=buf[ypitch*ph + (uvpitch*row+col)],\n\t\t\t\t\tv=buf[ypitch*ph + uvpitch*ch + (uvpitch*row+col)];\n\t\t\t\tif(((row*vsf/blocksize)+(col*hsf/blocksize))%2==0)\n\t\t\t\t{\n\t\t\t\t\tcheckval(u, 128);  checkval(v, 128);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(row<halfway)\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckval(u, 85);  checkval255(v);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckval0(u);  checkval(v, 149);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tbailout:\n\tif(retval==0)\n\t{\n\t\tfor(row=0; row<ph; row++)\n\t\t{\n\t\t\tfor(col=0; col<pw; col++)\n\t\t\t\tprintf(\"%.3d \", buf[ypitch*row+col]);\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t\tprintf(\"\\n\");\n\t\tfor(row=0; row<ch; row++)\n\t\t{\n\t\t\tfor(col=0; col<cw; col++)\n\t\t\t\tprintf(\"%.3d \", buf[ypitch*ph + (uvpitch*row+col)]);\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t\tprintf(\"\\n\");\n\t\tfor(row=0; row<ch; row++)\n\t\t{\n\t\t\tfor(col=0; col<cw; col++)\n\t\t\t\tprintf(\"%.3d \", buf[ypitch*ph + uvpitch*ch + (uvpitch*row+col)]);\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t}\n\n\treturn retval;\n}\n\n\nvoid writeJPEG(unsigned char *jpegBuf, unsigned long jpegSize, char *filename)\n{\n\tFILE *file=fopen(filename, \"wb\");\n\tif(!file || fwrite(jpegBuf, jpegSize, 1, file)!=1)\n\t{\n\t\tprintf(\"ERROR: Could not write to %s.\\n%s\\n\", filename, strerror(errno));\n\t\tbailout();\n\t}\n\n\tbailout:\n\tif(file) fclose(file);\n}\n\n\nvoid compTest(tjhandle handle, unsigned char **dstBuf,\n\tunsigned long *dstSize, int w, int h, int pf, char *basename,\n\tint subsamp, int jpegQual, int flags)\n{\n\tchar tempStr[1024];  unsigned char *srcBuf=NULL, *yuvBuf=NULL;\n\tconst char *pfStr=pixFormatStr[pf];\n\tconst char *buStrLong=(flags&TJFLAG_BOTTOMUP)? \"Bottom-Up\":\"Top-Down \";\n\tconst char *buStr=(flags&TJFLAG_BOTTOMUP)? \"BU\":\"TD\";\n\n\tif((srcBuf=(unsigned char *)malloc(w*h*tjPixelSize[pf]))==NULL)\n\t\t_throw(\"Memory allocation failure\");\n\tinitBuf(srcBuf, w, h, pf, flags);\n\n\tif(*dstBuf && *dstSize>0) memset(*dstBuf, 0, *dstSize);\n\n\n\tif(!alloc) flags|=TJFLAG_NOREALLOC;\n\tif(doyuv)\n\t{\n\t\tunsigned long yuvSize=tjBufSizeYUV2(w, pad, h, subsamp);\n\t\ttjscalingfactor sf={1, 1};\n\t\ttjhandle handle2=tjInitCompress();\n\t\tif(!handle2) _throwtj();\n\n\t\tif((yuvBuf=(unsigned char *)malloc(yuvSize))==NULL)\n\t\t\t_throw(\"Memory allocation failure\");\n\t\tmemset(yuvBuf, 0, yuvSize);\n\n\t\tprintf(\"%s %s -> YUV %s ... \", pfStr, buStrLong, subNameLong[subsamp]);\n\t\t_tj(tjEncodeYUV3(handle2, srcBuf, w, 0, h, pf, yuvBuf, pad, subsamp,\n\t\t\tflags));\n\t\ttjDestroy(handle2);\n\t\tif(checkBufYUV(yuvBuf, w, h, subsamp, sf)) printf(\"Passed.\\n\");\n\t\telse printf(\"FAILED!\\n\");\n\n\t\tprintf(\"YUV %s %s -> JPEG Q%d ... \", subNameLong[subsamp], buStrLong,\n\t\t\tjpegQual);\n\t\t_tj(tjCompressFromYUV(handle, yuvBuf, w, pad, h, subsamp, dstBuf,\n\t\t\tdstSize, jpegQual, flags));\n\t}\n\telse\n\t{\n\t\tprintf(\"%s %s -> %s Q%d ... \", pfStr, buStrLong, subNameLong[subsamp],\n\t\t\tjpegQual);\n\t\t_tj(tjCompress2(handle, srcBuf, w, 0, h, pf, dstBuf, dstSize, subsamp,\n\t\t\tjpegQual, flags));\n\t}\n\n\tsnprintf(tempStr, 1024, \"%s_enc_%s_%s_%s_Q%d.jpg\", basename, pfStr, buStr,\n\t\tsubName[subsamp], jpegQual);\n\twriteJPEG(*dstBuf, *dstSize, tempStr);\n\tprintf(\"Done.\\n  Result in %s\\n\", tempStr);\n\n\tbailout:\n\tif(yuvBuf) free(yuvBuf);\n\tif(srcBuf) free(srcBuf);\n}\n\n\nvoid _decompTest(tjhandle handle, unsigned char *jpegBuf,\n\tunsigned long jpegSize, int w, int h, int pf, char *basename, int subsamp,\n\tint flags, tjscalingfactor sf)\n{\n\tunsigned char *dstBuf=NULL, *yuvBuf=NULL;\n\tint _hdrw=0, _hdrh=0, _hdrsubsamp=-1;\n\tint scaledWidth=TJSCALED(w, sf);\n\tint scaledHeight=TJSCALED(h, sf);\n\tunsigned long dstSize=0;\n\n\t_tj(tjDecompressHeader2(handle, jpegBuf, jpegSize, &_hdrw, &_hdrh,\n\t\t&_hdrsubsamp));\n\tif(_hdrw!=w || _hdrh!=h || _hdrsubsamp!=subsamp)\n\t\t_throw(\"Incorrect JPEG header\");\n\n\tdstSize=scaledWidth*scaledHeight*tjPixelSize[pf];\n\tif((dstBuf=(unsigned char *)malloc(dstSize))==NULL)\n\t\t_throw(\"Memory allocation failure\");\n\tmemset(dstBuf, 0, dstSize);\n\n\tif(doyuv)\n\t{\n\t\tunsigned long yuvSize=tjBufSizeYUV2(scaledWidth, pad, scaledHeight,\n\t\t\tsubsamp);\n\t\ttjhandle handle2=tjInitDecompress();\n\t\tif(!handle2) _throwtj();\n\n\t\tif((yuvBuf=(unsigned char *)malloc(yuvSize))==NULL)\n\t\t\t_throw(\"Memory allocation failure\");\n\t\tmemset(yuvBuf, 0, yuvSize);\n\n\t\tprintf(\"JPEG -> YUV %s \", subNameLong[subsamp]);\n\t\tif(sf.num!=1 || sf.denom!=1)\n\t\t\tprintf(\"%d/%d ... \", sf.num, sf.denom);\n\t\telse printf(\"... \");\n\t\t_tj(tjDecompressToYUV2(handle, jpegBuf, jpegSize, yuvBuf, scaledWidth,\n\t\t\tpad, scaledHeight, flags));\n\t\tif(checkBufYUV(yuvBuf, scaledWidth, scaledHeight, subsamp, sf))\n\t\t\tprintf(\"Passed.\\n\");\n\t\telse printf(\"FAILED!\\n\");\n\n\t\tprintf(\"YUV %s -> %s %s ... \", subNameLong[subsamp], pixFormatStr[pf],\n\t\t\t(flags&TJFLAG_BOTTOMUP)? \"Bottom-Up\":\"Top-Down \");\n\t\t_tj(tjDecodeYUV(handle2, yuvBuf, pad, subsamp, dstBuf, scaledWidth, 0,\n\t\t\tscaledHeight, pf, flags));\n\t\ttjDestroy(handle2);\n\t}\n\telse\n\t{\n\t\tprintf(\"JPEG -> %s %s \", pixFormatStr[pf],\n\t\t\t(flags&TJFLAG_BOTTOMUP)? \"Bottom-Up\":\"Top-Down \");\n\t\tif(sf.num!=1 || sf.denom!=1)\n\t\t\tprintf(\"%d/%d ... \", sf.num, sf.denom);\n\t\telse printf(\"... \");\n\t\t_tj(tjDecompress2(handle, jpegBuf, jpegSize, dstBuf, scaledWidth, 0,\n\t\t\tscaledHeight, pf, flags));\n\t}\n\n\tif(checkBuf(dstBuf, scaledWidth, scaledHeight, pf, subsamp, sf, flags))\n\t\tprintf(\"Passed.\");\n\telse printf(\"FAILED!\");\n\tprintf(\"\\n\");\n\n\tbailout:\n\tif(yuvBuf) free(yuvBuf);\n\tif(dstBuf) free(dstBuf);\n}\n\n\nvoid decompTest(tjhandle handle, unsigned char *jpegBuf,\n\tunsigned long jpegSize, int w, int h, int pf, char *basename, int subsamp,\n\tint flags)\n{\n\tint i, n=0;\n\ttjscalingfactor *sf=tjGetScalingFactors(&n);\n\tif(!sf || !n) _throwtj();\n\n\tfor(i=0; i<n; i++)\n\t{\n\t\tif(subsamp==TJSAMP_444 || subsamp==TJSAMP_GRAY ||\n\t\t\t(subsamp==TJSAMP_411 && sf[i].num==1 &&\n\t\t\t\t(sf[i].denom==2 || sf[i].denom==1)) ||\n\t\t\t(subsamp!=TJSAMP_411 && sf[i].num==1 &&\n\t\t\t\t(sf[i].denom==4 || sf[i].denom==2 || sf[i].denom==1)))\n\t\t\t_decompTest(handle, jpegBuf, jpegSize, w, h, pf, basename, subsamp,\n\t\t\t\tflags, sf[i]);\n\t}\n\n\tbailout:\n\treturn;\n}\n\n\nvoid doTest(int w, int h, const int *formats, int nformats, int subsamp,\n\tchar *basename)\n{\n\ttjhandle chandle=NULL, dhandle=NULL;\n\tunsigned char *dstBuf=NULL;\n\tunsigned long size=0;  int pfi, pf, i;\n\n\tif(!alloc)\n\t\tsize=tjBufSize(w, h, subsamp);\n\tif(size!=0)\n\t\tif((dstBuf=(unsigned char *)tjAlloc(size))==NULL)\n\t\t\t_throw(\"Memory allocation failure.\");\n\n\tif((chandle=tjInitCompress())==NULL || (dhandle=tjInitDecompress())==NULL)\n\t\t_throwtj();\n\n\tfor(pfi=0; pfi<nformats; pfi++)\n\t{\n\t\tfor(i=0; i<2; i++)\n\t\t{\n\t\t\tint flags=0;\n\t\t\tif(subsamp==TJSAMP_422 || subsamp==TJSAMP_420 || subsamp==TJSAMP_440 ||\n\t\t\t\tsubsamp==TJSAMP_411)\n\t\t\t\tflags|=TJFLAG_FASTUPSAMPLE;\n\t\t\tif(i==1) flags|=TJFLAG_BOTTOMUP;\n\t\t\tpf=formats[pfi];\n\t\t\tcompTest(chandle, &dstBuf, &size, w, h, pf, basename, subsamp, 100,\n\t\t\t\tflags);\n\t\t\tdecompTest(dhandle, dstBuf, size, w, h, pf, basename, subsamp,\n\t\t\t\tflags);\n\t\t\tif(pf>=TJPF_RGBX && pf<=TJPF_XRGB)\n\t\t\t{\n\t\t\t\tprintf(\"\\n\");\n\t\t\t\tdecompTest(dhandle, dstBuf, size, w, h, pf+(TJPF_RGBA-TJPF_RGBX),\n\t\t\t\t\tbasename, subsamp, flags);\n\t\t\t}\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t}\n\tprintf(\"--------------------\\n\\n\");\n\n\tbailout:\n\tif(chandle) tjDestroy(chandle);\n\tif(dhandle) tjDestroy(dhandle);\n\n\tif(dstBuf) tjFree(dstBuf);\n}\n\n\nvoid bufSizeTest(void)\n{\n\tint w, h, i, subsamp;\n\tunsigned char *srcBuf=NULL, *dstBuf=NULL;\n\ttjhandle handle=NULL;\n\tunsigned long dstSize=0;\n\n\tif((handle=tjInitCompress())==NULL) _throwtj();\n\n\tprintf(\"Buffer size regression test\\n\");\n\tfor(subsamp=0; subsamp<TJ_NUMSAMP; subsamp++)\n\t{\n\t\tfor(w=1; w<48; w++)\n\t\t{\n\t\t\tint maxh=(w==1)? 2048:48;\n\t\t\tfor(h=1; h<maxh; h++)\n\t\t\t{\n\t\t\t\tif(h%100==0) printf(\"%.4d x %.4d\\b\\b\\b\\b\\b\\b\\b\\b\\b\\b\\b\", w, h);\n\t\t\t\tif((srcBuf=(unsigned char *)malloc(w*h*4))==NULL)\n\t\t\t\t\t_throw(\"Memory allocation failure\");\n\t\t\t\tif(!alloc || doyuv)\n\t\t\t\t{\n\t\t\t\t\tif(doyuv) dstSize=tjBufSizeYUV2(w, pad, h, subsamp);\n\t\t\t\t\telse dstSize=tjBufSize(w, h, subsamp);\n\t\t\t\t\tif((dstBuf=(unsigned char *)tjAlloc(dstSize))==NULL)\n\t\t\t\t\t\t_throw(\"Memory allocation failure\");\n\t\t\t\t}\n\n\t\t\t\tfor(i=0; i<w*h*4; i++)\n\t\t\t\t{\n\t\t\t\t\tif(random()<RAND_MAX/2) srcBuf[i]=0;\n\t\t\t\t\telse srcBuf[i]=255;\n\t\t\t\t}\n\n\t\t\t\tif(doyuv)\n\t\t\t\t{\n\t\t\t\t\t_tj(tjEncodeYUV3(handle, srcBuf, w, 0, h, TJPF_BGRX, dstBuf, pad,\n\t\t\t\t\t\tsubsamp, 0));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_tj(tjCompress2(handle, srcBuf, w, 0, h, TJPF_BGRX, &dstBuf,\n\t\t\t\t\t\t&dstSize, subsamp, 100, alloc? 0:TJFLAG_NOREALLOC));\n\t\t\t\t}\n\t\t\t\tfree(srcBuf);  srcBuf=NULL;\n\t\t\t\tif(!alloc || doyuv)\n\t\t\t\t{\n\t\t\t\t\ttjFree(dstBuf);  dstBuf=NULL;\n\t\t\t\t}\n\n\t\t\t\tif((srcBuf=(unsigned char *)malloc(h*w*4))==NULL)\n\t\t\t\t\t_throw(\"Memory allocation failure\");\n\t\t\t\tif(!alloc || doyuv)\n\t\t\t\t{\n\t\t\t\t\tif(doyuv) dstSize=tjBufSizeYUV2(h, pad, w, subsamp);\n\t\t\t\t\telse dstSize=tjBufSize(h, w, subsamp);\n\t\t\t\t\tif((dstBuf=(unsigned char *)tjAlloc(dstSize))==NULL)\n\t\t\t\t\t\t_throw(\"Memory allocation failure\");\n\t\t\t\t}\n\n\t\t\t\tfor(i=0; i<h*w*4; i++)\n\t\t\t\t{\n\t\t\t\t\tif(random()<RAND_MAX/2) srcBuf[i]=0;\n\t\t\t\t\telse srcBuf[i]=255;\n\t\t\t\t}\n\n\t\t\t\tif(doyuv)\n\t\t\t\t{\n\t\t\t\t\t_tj(tjEncodeYUV3(handle, srcBuf, h, 0, w, TJPF_BGRX, dstBuf, pad,\n\t\t\t\t\t\tsubsamp, 0));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_tj(tjCompress2(handle, srcBuf, h, 0, w, TJPF_BGRX, &dstBuf,\n\t\t\t\t\t\t&dstSize, subsamp, 100, alloc? 0:TJFLAG_NOREALLOC));\n\t\t\t\t}\n\t\t\t\tfree(srcBuf);  srcBuf=NULL;\n\t\t\t\tif(!alloc || doyuv)\n\t\t\t\t{\n\t\t\t\t\ttjFree(dstBuf);  dstBuf=NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"Done.      \\n\");\n\n\tbailout:\n\tif(srcBuf) free(srcBuf);\n\tif(dstBuf) tjFree(dstBuf);\n\tif(handle) tjDestroy(handle);\n}\n\n\nint main(int argc, char *argv[])\n{\n\tint i, num4bf=5;\n\t#ifdef _WIN32\n\tsrand((unsigned int)time(NULL));\n\t#endif\n\tif(argc>1)\n\t{\n\t\tfor(i=1; i<argc; i++)\n\t\t{\n\t\t\tif(!strcasecmp(argv[i], \"-yuv\")) doyuv=1;\n\t\t\tif(!strcasecmp(argv[i], \"-noyuvpad\")) pad=1;\n\t\t\tif(!strcasecmp(argv[i], \"-alloc\")) alloc=1;\n\t\t\tif(!strncasecmp(argv[i], \"-h\", 2) || !strcasecmp(argv[i], \"-?\"))\n\t\t\t\tusage(argv[0]);\n\t\t}\n\t}\n\tif(alloc) printf(\"Testing automatic buffer allocation\\n\");\n\tif(doyuv) num4bf=4;\n\tdoTest(35, 39, _3byteFormats, 2, TJSAMP_444, \"test\");\n\tdoTest(39, 41, _4byteFormats, num4bf, TJSAMP_444, \"test\");\n\tdoTest(41, 35, _3byteFormats, 2, TJSAMP_422, \"test\");\n\tdoTest(35, 39, _4byteFormats, num4bf, TJSAMP_422, \"test\");\n\tdoTest(39, 41, _3byteFormats, 2, TJSAMP_420, \"test\");\n\tdoTest(41, 35, _4byteFormats, num4bf, TJSAMP_420, \"test\");\n\tdoTest(35, 39, _3byteFormats, 2, TJSAMP_440, \"test\");\n\tdoTest(39, 41, _4byteFormats, num4bf, TJSAMP_440, \"test\");\n\tdoTest(41, 35, _3byteFormats, 2, TJSAMP_411, \"test\");\n\tdoTest(35, 39, _4byteFormats, num4bf, TJSAMP_411, \"test\");\n\tdoTest(39, 41, _onlyGray, 1, TJSAMP_GRAY, \"test\");\n\tdoTest(41, 35, _3byteFormats, 2, TJSAMP_GRAY, \"test\");\n\tdoTest(35, 39, _4byteFormats, 4, TJSAMP_GRAY, \"test\");\n\tbufSizeTest();\n\tif(doyuv)\n\t{\n\t\tprintf(\"\\n--------------------\\n\\n\");\n\t\tdoTest(48, 48, _onlyRGB, 1, TJSAMP_444, \"test_yuv0\");\n\t\tdoTest(48, 48, _onlyRGB, 1, TJSAMP_422, \"test_yuv0\");\n\t\tdoTest(48, 48, _onlyRGB, 1, TJSAMP_420, \"test_yuv0\");\n\t\tdoTest(48, 48, _onlyRGB, 1, TJSAMP_440, \"test_yuv0\");\n\t\tdoTest(48, 48, _onlyRGB, 1, TJSAMP_411, \"test_yuv0\");\n\t\tdoTest(48, 48, _onlyRGB, 1, TJSAMP_GRAY, \"test_yuv0\");\n\t\tdoTest(48, 48, _onlyGray, 1, TJSAMP_GRAY, \"test_yuv0\");\n\t}\n\n\treturn exitStatus;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/tjutil.c",
    "content": "/*\n * Copyright (C)2011 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifdef _WIN32\n\n#include <windows.h>\n\nstatic double getfreq(void)\n{\n\tLARGE_INTEGER freq;\n\tif(!QueryPerformanceFrequency(&freq)) return 0.0;\n\treturn (double)freq.QuadPart;\n}\n\nstatic double f=-1.0;\n\ndouble gettime(void)\n{\n\tLARGE_INTEGER t;\n\tif(f<0.0) f=getfreq();\n\tif(f==0.0) return (double)GetTickCount()/1000.;\n\telse\n\t{\n\t\tQueryPerformanceCounter(&t);\n\t\treturn (double)t.QuadPart/f;\n\t}\n}\n\n#else\n\n#include <stdlib.h>\n#include <sys/time.h>\n\ndouble gettime(void)\n{\n\tstruct timeval tv;\n\tif(gettimeofday(&tv, NULL)<0) return 0.0;\n\telse return (double)tv.tv_sec+((double)tv.tv_usec/1000000.);\n}\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/tjutil.h",
    "content": "/*\n * Copyright (C)2011 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifdef _WIN32\n\t#ifndef __MINGW32__\n\t\t#include <stdio.h>\n\t\t#define snprintf(str, n, format, ...)  \\\n\t\t\t_snprintf_s(str, n, _TRUNCATE, format, __VA_ARGS__)\n\t#endif\n\t#define strcasecmp stricmp\n\t#define strncasecmp strnicmp\n#endif\n\n#ifndef min\n #define min(a,b) ((a)<(b)?(a):(b))\n#endif\n\n#ifndef max\n #define max(a,b) ((a)>(b)?(a):(b))\n#endif\n\nextern double gettime(void);\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/transupp.c",
    "content": "/*\n * transupp.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains image transformation routines and other utility code\n * used by the jpegtran sample application.  These are NOT part of the core\n * JPEG library.  But we keep these routines separate from jpegtran.c to\n * ease the task of maintaining jpegtran-like programs that have other user\n * interfaces.\n */\n\n/* Although this file really shouldn't have access to the library internals,\n * it's helpful to let it call jround_up() and jcopy_block_row().\n */\n#define JPEG_INTERNALS\n\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"transupp.h\"           /* My own external interface */\n#include \"jpegcomp.h\"\n#include <ctype.h>              /* to declare isdigit() */\n\n\n#if JPEG_LIB_VERSION >= 70\n#define dstinfo_min_DCT_h_scaled_size dstinfo->min_DCT_h_scaled_size\n#define dstinfo_min_DCT_v_scaled_size dstinfo->min_DCT_v_scaled_size\n#else\n#define dstinfo_min_DCT_h_scaled_size DCTSIZE\n#define dstinfo_min_DCT_v_scaled_size DCTSIZE\n#endif\n\n\n#if TRANSFORMS_SUPPORTED\n\n/*\n * Lossless image transformation routines.  These routines work on DCT\n * coefficient arrays and thus do not require any lossy decompression\n * or recompression of the image.\n * Thanks to Guido Vollbeding for the initial design and code of this feature,\n * and to Ben Jackson for introducing the cropping feature.\n *\n * Horizontal flipping is done in-place, using a single top-to-bottom\n * pass through the virtual source array.  It will thus be much the\n * fastest option for images larger than main memory.\n *\n * The other routines require a set of destination virtual arrays, so they\n * need twice as much memory as jpegtran normally does.  The destination\n * arrays are always written in normal scan order (top to bottom) because\n * the virtual array manager expects this.  The source arrays will be scanned\n * in the corresponding order, which means multiple passes through the source\n * arrays for most of the transforms.  That could result in much thrashing\n * if the image is larger than main memory.\n *\n * If cropping or trimming is involved, the destination arrays may be smaller\n * than the source arrays.  Note it is not possible to do horizontal flip\n * in-place when a nonzero Y crop offset is specified, since we'd have to move\n * data from one block row to another but the virtual array manager doesn't\n * guarantee we can touch more than one row at a time.  So in that case,\n * we have to use a separate destination array.\n *\n * Some notes about the operating environment of the individual transform\n * routines:\n * 1. Both the source and destination virtual arrays are allocated from the\n *    source JPEG object, and therefore should be manipulated by calling the\n *    source's memory manager.\n * 2. The destination's component count should be used.  It may be smaller\n *    than the source's when forcing to grayscale.\n * 3. Likewise the destination's sampling factors should be used.  When\n *    forcing to grayscale the destination's sampling factors will be all 1,\n *    and we may as well take that as the effective iMCU size.\n * 4. When \"trim\" is in effect, the destination's dimensions will be the\n *    trimmed values but the source's will be untrimmed.\n * 5. When \"crop\" is in effect, the destination's dimensions will be the\n *    cropped values but the source's will be uncropped.  Each transform\n *    routine is responsible for picking up source data starting at the\n *    correct X and Y offset for the crop region.  (The X and Y offsets\n *    passed to the transform routines are measured in iMCU blocks of the\n *    destination.)\n * 6. All the routines assume that the source and destination buffers are\n *    padded out to a full iMCU boundary.  This is true, although for the\n *    source buffer it is an undocumented property of jdcoefct.c.\n */\n\n\nLOCAL(void)\ndo_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n         JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n         jvirt_barray_ptr *src_coef_arrays,\n         jvirt_barray_ptr *dst_coef_arrays)\n/* Crop.  This is only used when no rotate/flip is requested with the crop. */\n{\n  JDIMENSION dst_blk_y, x_crop_blocks, y_crop_blocks;\n  int ci, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  jpeg_component_info *compptr;\n\n  /* We simply have to copy the right amount of data (the destination's\n   * image size) starting at the given X and Y offsets in the source.\n   */\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n         dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n        ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n         (JDIMENSION) compptr->v_samp_factor, TRUE);\n      src_buffer = (*srcinfo->mem->access_virt_barray)\n        ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n         dst_blk_y + y_crop_blocks,\n         (JDIMENSION) compptr->v_samp_factor, FALSE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n        jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,\n                        dst_buffer[offset_y],\n                        compptr->width_in_blocks);\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_flip_h_no_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n                   JDIMENSION x_crop_offset,\n                   jvirt_barray_ptr *src_coef_arrays)\n/* Horizontal flip; done in-place, so no separate dest array is required.\n * NB: this only works when y_crop_offset is zero.\n */\n{\n  JDIMENSION MCU_cols, comp_width, blk_x, blk_y, x_crop_blocks;\n  int ci, k, offset_y;\n  JBLOCKARRAY buffer;\n  JCOEFPTR ptr1, ptr2;\n  JCOEF temp1, temp2;\n  jpeg_component_info *compptr;\n\n  /* Horizontal mirroring of DCT blocks is accomplished by swapping\n   * pairs of blocks in-place.  Within a DCT block, we perform horizontal\n   * mirroring by changing the signs of odd-numbered columns.\n   * Partial iMCUs at the right edge are left untouched.\n   */\n  MCU_cols = srcinfo->output_width /\n    (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    for (blk_y = 0; blk_y < compptr->height_in_blocks;\n         blk_y += compptr->v_samp_factor) {\n      buffer = (*srcinfo->mem->access_virt_barray)\n        ((j_common_ptr) srcinfo, src_coef_arrays[ci], blk_y,\n         (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n        /* Do the mirroring */\n        for (blk_x = 0; blk_x * 2 < comp_width; blk_x++) {\n          ptr1 = buffer[offset_y][blk_x];\n          ptr2 = buffer[offset_y][comp_width - blk_x - 1];\n          /* this unrolled loop doesn't need to know which row it's on... */\n          for (k = 0; k < DCTSIZE2; k += 2) {\n            temp1 = *ptr1;      /* swap even column */\n            temp2 = *ptr2;\n            *ptr1++ = temp2;\n            *ptr2++ = temp1;\n            temp1 = *ptr1;      /* swap odd column with sign change */\n            temp2 = *ptr2;\n            *ptr1++ = -temp2;\n            *ptr2++ = -temp1;\n          }\n        }\n        if (x_crop_blocks > 0) {\n          /* Now left-justify the portion of the data to be kept.\n           * We can't use a single jcopy_block_row() call because that routine\n           * depends on memcpy(), whose behavior is unspecified for overlapping\n           * source and destination areas.  Sigh.\n           */\n          for (blk_x = 0; blk_x < compptr->width_in_blocks; blk_x++) {\n            jcopy_block_row(buffer[offset_y] + blk_x + x_crop_blocks,\n                            buffer[offset_y] + blk_x,\n                            (JDIMENSION) 1);\n          }\n        }\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_flip_h (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n           JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n           jvirt_barray_ptr *src_coef_arrays,\n           jvirt_barray_ptr *dst_coef_arrays)\n/* Horizontal flip in general cropping case */\n{\n  JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, k, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JBLOCKROW src_row_ptr, dst_row_ptr;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  /* Here we must output into a separate array because we can't touch\n   * different rows of a single virtual array simultaneously.  Otherwise,\n   * this is essentially the same as the routine above.\n   */\n  MCU_cols = srcinfo->output_width /\n    (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n         dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n        ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n         (JDIMENSION) compptr->v_samp_factor, TRUE);\n      src_buffer = (*srcinfo->mem->access_virt_barray)\n        ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n         dst_blk_y + y_crop_blocks,\n         (JDIMENSION) compptr->v_samp_factor, FALSE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n        dst_row_ptr = dst_buffer[offset_y];\n        src_row_ptr = src_buffer[offset_y];\n        for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {\n          if (x_crop_blocks + dst_blk_x < comp_width) {\n            /* Do the mirrorable blocks */\n            dst_ptr = dst_row_ptr[dst_blk_x];\n            src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];\n            /* this unrolled loop doesn't need to know which row it's on... */\n            for (k = 0; k < DCTSIZE2; k += 2) {\n              *dst_ptr++ = *src_ptr++;   /* copy even column */\n              *dst_ptr++ = - *src_ptr++; /* copy odd column with sign change */\n            }\n          } else {\n            /* Copy last partial block(s) verbatim */\n            jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,\n                            dst_row_ptr + dst_blk_x,\n                            (JDIMENSION) 1);\n          }\n        }\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_flip_v (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n           JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n           jvirt_barray_ptr *src_coef_arrays,\n           jvirt_barray_ptr *dst_coef_arrays)\n/* Vertical flip */\n{\n  JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JBLOCKROW src_row_ptr, dst_row_ptr;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  /* We output into a separate array because we can't touch different\n   * rows of the source virtual array simultaneously.  Otherwise, this\n   * is a pretty straightforward analog of horizontal flip.\n   * Within a DCT block, vertical mirroring is done by changing the signs\n   * of odd-numbered rows.\n   * Partial iMCUs at the bottom edge are copied verbatim.\n   */\n  MCU_rows = srcinfo->output_height /\n    (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_height = MCU_rows * compptr->v_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n         dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n        ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n         (JDIMENSION) compptr->v_samp_factor, TRUE);\n      if (y_crop_blocks + dst_blk_y < comp_height) {\n        /* Row is within the mirrorable area. */\n        src_buffer = (*srcinfo->mem->access_virt_barray)\n          ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n           comp_height - y_crop_blocks - dst_blk_y -\n           (JDIMENSION) compptr->v_samp_factor,\n           (JDIMENSION) compptr->v_samp_factor, FALSE);\n      } else {\n        /* Bottom-edge blocks will be copied verbatim. */\n        src_buffer = (*srcinfo->mem->access_virt_barray)\n          ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n           dst_blk_y + y_crop_blocks,\n           (JDIMENSION) compptr->v_samp_factor, FALSE);\n      }\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n        if (y_crop_blocks + dst_blk_y < comp_height) {\n          /* Row is within the mirrorable area. */\n          dst_row_ptr = dst_buffer[offset_y];\n          src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];\n          src_row_ptr += x_crop_blocks;\n          for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;\n               dst_blk_x++) {\n            dst_ptr = dst_row_ptr[dst_blk_x];\n            src_ptr = src_row_ptr[dst_blk_x];\n            for (i = 0; i < DCTSIZE; i += 2) {\n              /* copy even row */\n              for (j = 0; j < DCTSIZE; j++)\n                *dst_ptr++ = *src_ptr++;\n              /* copy odd row with sign change */\n              for (j = 0; j < DCTSIZE; j++)\n                *dst_ptr++ = - *src_ptr++;\n            }\n          }\n        } else {\n          /* Just copy row verbatim. */\n          jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,\n                          dst_buffer[offset_y],\n                          compptr->width_in_blocks);\n        }\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_transpose (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n              JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n              jvirt_barray_ptr *src_coef_arrays,\n              jvirt_barray_ptr *dst_coef_arrays)\n/* Transpose source into destination */\n{\n  JDIMENSION dst_blk_x, dst_blk_y, x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_x, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  /* Transposing pixels within a block just requires transposing the\n   * DCT coefficients.\n   * Partial iMCUs at the edges require no special treatment; we simply\n   * process all the available DCT blocks for every component.\n   */\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n         dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n        ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n         (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n        for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;\n             dst_blk_x += compptr->h_samp_factor) {\n          src_buffer = (*srcinfo->mem->access_virt_barray)\n            ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n             dst_blk_x + x_crop_blocks,\n             (JDIMENSION) compptr->h_samp_factor, FALSE);\n          for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {\n            dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];\n            src_ptr = src_buffer[offset_x][dst_blk_y + offset_y + y_crop_blocks];\n            for (i = 0; i < DCTSIZE; i++)\n              for (j = 0; j < DCTSIZE; j++)\n                dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n          }\n        }\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_rot_90 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n           JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n           jvirt_barray_ptr *src_coef_arrays,\n           jvirt_barray_ptr *dst_coef_arrays)\n/* 90 degree rotation is equivalent to\n *   1. Transposing the image;\n *   2. Horizontal mirroring.\n * These two steps are merged into a single processing routine.\n */\n{\n  JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_x, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  /* Because of the horizontal mirror step, we can't process partial iMCUs\n   * at the (output) right edge properly.  They just get transposed and\n   * not mirrored.\n   */\n  MCU_cols = srcinfo->output_height /\n    (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n         dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n        ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n         (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n        for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;\n             dst_blk_x += compptr->h_samp_factor) {\n          if (x_crop_blocks + dst_blk_x < comp_width) {\n            /* Block is within the mirrorable area. */\n            src_buffer = (*srcinfo->mem->access_virt_barray)\n              ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n               comp_width - x_crop_blocks - dst_blk_x -\n               (JDIMENSION) compptr->h_samp_factor,\n               (JDIMENSION) compptr->h_samp_factor, FALSE);\n          } else {\n            /* Edge blocks are transposed but not mirrored. */\n            src_buffer = (*srcinfo->mem->access_virt_barray)\n              ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n               dst_blk_x + x_crop_blocks,\n               (JDIMENSION) compptr->h_samp_factor, FALSE);\n          }\n          for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {\n            dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];\n            if (x_crop_blocks + dst_blk_x < comp_width) {\n              /* Block is within the mirrorable area. */\n              src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]\n                [dst_blk_y + offset_y + y_crop_blocks];\n              for (i = 0; i < DCTSIZE; i++) {\n                for (j = 0; j < DCTSIZE; j++)\n                  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n                i++;\n                for (j = 0; j < DCTSIZE; j++)\n                  dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n              }\n            } else {\n              /* Edge blocks are transposed but not mirrored. */\n              src_ptr = src_buffer[offset_x]\n                [dst_blk_y + offset_y + y_crop_blocks];\n              for (i = 0; i < DCTSIZE; i++)\n                for (j = 0; j < DCTSIZE; j++)\n                  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n            }\n          }\n        }\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_rot_270 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n            JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n            jvirt_barray_ptr *src_coef_arrays,\n            jvirt_barray_ptr *dst_coef_arrays)\n/* 270 degree rotation is equivalent to\n *   1. Horizontal mirroring;\n *   2. Transposing the image.\n * These two steps are merged into a single processing routine.\n */\n{\n  JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_x, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  /* Because of the horizontal mirror step, we can't process partial iMCUs\n   * at the (output) bottom edge properly.  They just get transposed and\n   * not mirrored.\n   */\n  MCU_rows = srcinfo->output_width /\n    (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_height = MCU_rows * compptr->v_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n         dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n        ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n         (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n        for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;\n             dst_blk_x += compptr->h_samp_factor) {\n          src_buffer = (*srcinfo->mem->access_virt_barray)\n            ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n             dst_blk_x + x_crop_blocks,\n             (JDIMENSION) compptr->h_samp_factor, FALSE);\n          for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {\n            dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];\n            if (y_crop_blocks + dst_blk_y < comp_height) {\n              /* Block is within the mirrorable area. */\n              src_ptr = src_buffer[offset_x]\n                [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];\n              for (i = 0; i < DCTSIZE; i++) {\n                for (j = 0; j < DCTSIZE; j++) {\n                  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n                  j++;\n                  dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n                }\n              }\n            } else {\n              /* Edge blocks are transposed but not mirrored. */\n              src_ptr = src_buffer[offset_x]\n                [dst_blk_y + offset_y + y_crop_blocks];\n              for (i = 0; i < DCTSIZE; i++)\n                for (j = 0; j < DCTSIZE; j++)\n                  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n            }\n          }\n        }\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_rot_180 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n            JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n            jvirt_barray_ptr *src_coef_arrays,\n            jvirt_barray_ptr *dst_coef_arrays)\n/* 180 degree rotation is equivalent to\n *   1. Vertical mirroring;\n *   2. Horizontal mirroring.\n * These two steps are merged into a single processing routine.\n */\n{\n  JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JBLOCKROW src_row_ptr, dst_row_ptr;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  MCU_cols = srcinfo->output_width /\n    (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);\n  MCU_rows = srcinfo->output_height /\n    (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    comp_height = MCU_rows * compptr->v_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n         dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n        ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n         (JDIMENSION) compptr->v_samp_factor, TRUE);\n      if (y_crop_blocks + dst_blk_y < comp_height) {\n        /* Row is within the vertically mirrorable area. */\n        src_buffer = (*srcinfo->mem->access_virt_barray)\n          ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n           comp_height - y_crop_blocks - dst_blk_y -\n           (JDIMENSION) compptr->v_samp_factor,\n           (JDIMENSION) compptr->v_samp_factor, FALSE);\n      } else {\n        /* Bottom-edge rows are only mirrored horizontally. */\n        src_buffer = (*srcinfo->mem->access_virt_barray)\n          ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n           dst_blk_y + y_crop_blocks,\n           (JDIMENSION) compptr->v_samp_factor, FALSE);\n      }\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n        dst_row_ptr = dst_buffer[offset_y];\n        if (y_crop_blocks + dst_blk_y < comp_height) {\n          /* Row is within the mirrorable area. */\n          src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];\n          for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {\n            dst_ptr = dst_row_ptr[dst_blk_x];\n            if (x_crop_blocks + dst_blk_x < comp_width) {\n              /* Process the blocks that can be mirrored both ways. */\n              src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];\n              for (i = 0; i < DCTSIZE; i += 2) {\n                /* For even row, negate every odd column. */\n                for (j = 0; j < DCTSIZE; j += 2) {\n                  *dst_ptr++ = *src_ptr++;\n                  *dst_ptr++ = - *src_ptr++;\n                }\n                /* For odd row, negate every even column. */\n                for (j = 0; j < DCTSIZE; j += 2) {\n                  *dst_ptr++ = - *src_ptr++;\n                  *dst_ptr++ = *src_ptr++;\n                }\n              }\n            } else {\n              /* Any remaining right-edge blocks are only mirrored vertically. */\n              src_ptr = src_row_ptr[x_crop_blocks + dst_blk_x];\n              for (i = 0; i < DCTSIZE; i += 2) {\n                for (j = 0; j < DCTSIZE; j++)\n                  *dst_ptr++ = *src_ptr++;\n                for (j = 0; j < DCTSIZE; j++)\n                  *dst_ptr++ = - *src_ptr++;\n              }\n            }\n          }\n        } else {\n          /* Remaining rows are just mirrored horizontally. */\n          src_row_ptr = src_buffer[offset_y];\n          for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {\n            if (x_crop_blocks + dst_blk_x < comp_width) {\n              /* Process the blocks that can be mirrored. */\n              dst_ptr = dst_row_ptr[dst_blk_x];\n              src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];\n              for (i = 0; i < DCTSIZE2; i += 2) {\n                *dst_ptr++ = *src_ptr++;\n                *dst_ptr++ = - *src_ptr++;\n              }\n            } else {\n              /* Any remaining right-edge blocks are only copied. */\n              jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,\n                              dst_row_ptr + dst_blk_x,\n                              (JDIMENSION) 1);\n            }\n          }\n        }\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_transverse (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n               JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n               jvirt_barray_ptr *src_coef_arrays,\n               jvirt_barray_ptr *dst_coef_arrays)\n/* Transverse transpose is equivalent to\n *   1. 180 degree rotation;\n *   2. Transposition;\n * or\n *   1. Horizontal mirroring;\n *   2. Transposition;\n *   3. Horizontal mirroring.\n * These steps are merged into a single processing routine.\n */\n{\n  JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_x, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  MCU_cols = srcinfo->output_height /\n    (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);\n  MCU_rows = srcinfo->output_width /\n    (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    comp_height = MCU_rows * compptr->v_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n         dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n        ((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n         (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n        for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;\n             dst_blk_x += compptr->h_samp_factor) {\n          if (x_crop_blocks + dst_blk_x < comp_width) {\n            /* Block is within the mirrorable area. */\n            src_buffer = (*srcinfo->mem->access_virt_barray)\n              ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n               comp_width - x_crop_blocks - dst_blk_x -\n               (JDIMENSION) compptr->h_samp_factor,\n               (JDIMENSION) compptr->h_samp_factor, FALSE);\n          } else {\n            src_buffer = (*srcinfo->mem->access_virt_barray)\n              ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n               dst_blk_x + x_crop_blocks,\n               (JDIMENSION) compptr->h_samp_factor, FALSE);\n          }\n          for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {\n            dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];\n            if (y_crop_blocks + dst_blk_y < comp_height) {\n              if (x_crop_blocks + dst_blk_x < comp_width) {\n                /* Block is within the mirrorable area. */\n                src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]\n                  [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];\n                for (i = 0; i < DCTSIZE; i++) {\n                  for (j = 0; j < DCTSIZE; j++) {\n                    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n                    j++;\n                    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n                  }\n                  i++;\n                  for (j = 0; j < DCTSIZE; j++) {\n                    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n                    j++;\n                    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n                  }\n                }\n              } else {\n                /* Right-edge blocks are mirrored in y only */\n                src_ptr = src_buffer[offset_x]\n                  [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];\n                for (i = 0; i < DCTSIZE; i++) {\n                  for (j = 0; j < DCTSIZE; j++) {\n                    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n                    j++;\n                    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n                  }\n                }\n              }\n            } else {\n              if (x_crop_blocks + dst_blk_x < comp_width) {\n                /* Bottom-edge blocks are mirrored in x only */\n                src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]\n                  [dst_blk_y + offset_y + y_crop_blocks];\n                for (i = 0; i < DCTSIZE; i++) {\n                  for (j = 0; j < DCTSIZE; j++)\n                    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n                  i++;\n                  for (j = 0; j < DCTSIZE; j++)\n                    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n                }\n              } else {\n                /* At lower right corner, just transpose, no mirroring */\n                src_ptr = src_buffer[offset_x]\n                  [dst_blk_y + offset_y + y_crop_blocks];\n                for (i = 0; i < DCTSIZE; i++)\n                  for (j = 0; j < DCTSIZE; j++)\n                    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n\n\n/* Parse an unsigned integer: subroutine for jtransform_parse_crop_spec.\n * Returns TRUE if valid integer found, FALSE if not.\n * *strptr is advanced over the digit string, and *result is set to its value.\n */\n\nLOCAL(boolean)\njt_read_integer (const char **strptr, JDIMENSION *result)\n{\n  const char *ptr = *strptr;\n  JDIMENSION val = 0;\n\n  for (; isdigit(*ptr); ptr++) {\n    val = val * 10 + (JDIMENSION) (*ptr - '0');\n  }\n  *result = val;\n  if (ptr == *strptr)\n    return FALSE;               /* oops, no digits */\n  *strptr = ptr;\n  return TRUE;\n}\n\n\n/* Parse a crop specification (written in X11 geometry style).\n * The routine returns TRUE if the spec string is valid, FALSE if not.\n *\n * The crop spec string should have the format\n *      <width>[f]x<height>[f]{+-}<xoffset>{+-}<yoffset>\n * where width, height, xoffset, and yoffset are unsigned integers.\n * Each of the elements can be omitted to indicate a default value.\n * (A weakness of this style is that it is not possible to omit xoffset\n * while specifying yoffset, since they look alike.)\n *\n * This code is loosely based on XParseGeometry from the X11 distribution.\n */\n\nGLOBAL(boolean)\njtransform_parse_crop_spec (jpeg_transform_info *info, const char *spec)\n{\n  info->crop = FALSE;\n  info->crop_width_set = JCROP_UNSET;\n  info->crop_height_set = JCROP_UNSET;\n  info->crop_xoffset_set = JCROP_UNSET;\n  info->crop_yoffset_set = JCROP_UNSET;\n\n  if (isdigit(*spec)) {\n    /* fetch width */\n    if (! jt_read_integer(&spec, &info->crop_width))\n      return FALSE;\n    if (*spec == 'f' || *spec == 'F') {\n      spec++;\n      info->crop_width_set = JCROP_FORCE;\n    } else\n      info->crop_width_set = JCROP_POS;\n  }\n  if (*spec == 'x' || *spec == 'X') {\n    /* fetch height */\n    spec++;\n    if (! jt_read_integer(&spec, &info->crop_height))\n      return FALSE;\n    if (*spec == 'f' || *spec == 'F') {\n      spec++;\n      info->crop_height_set = JCROP_FORCE;\n    } else\n      info->crop_height_set = JCROP_POS;\n  }\n  if (*spec == '+' || *spec == '-') {\n    /* fetch xoffset */\n    info->crop_xoffset_set = (*spec == '-') ? JCROP_NEG : JCROP_POS;\n    spec++;\n    if (! jt_read_integer(&spec, &info->crop_xoffset))\n      return FALSE;\n  }\n  if (*spec == '+' || *spec == '-') {\n    /* fetch yoffset */\n    info->crop_yoffset_set = (*spec == '-') ? JCROP_NEG : JCROP_POS;\n    spec++;\n    if (! jt_read_integer(&spec, &info->crop_yoffset))\n      return FALSE;\n  }\n  /* We had better have gotten to the end of the string. */\n  if (*spec != '\\0')\n    return FALSE;\n  info->crop = TRUE;\n  return TRUE;\n}\n\n\n/* Trim off any partial iMCUs on the indicated destination edge */\n\nLOCAL(void)\ntrim_right_edge (jpeg_transform_info *info, JDIMENSION full_width)\n{\n  JDIMENSION MCU_cols;\n\n  MCU_cols = info->output_width / info->iMCU_sample_width;\n  if (MCU_cols > 0 && info->x_crop_offset + MCU_cols ==\n      full_width / info->iMCU_sample_width)\n    info->output_width = MCU_cols * info->iMCU_sample_width;\n}\n\nLOCAL(void)\ntrim_bottom_edge (jpeg_transform_info *info, JDIMENSION full_height)\n{\n  JDIMENSION MCU_rows;\n\n  MCU_rows = info->output_height / info->iMCU_sample_height;\n  if (MCU_rows > 0 && info->y_crop_offset + MCU_rows ==\n      full_height / info->iMCU_sample_height)\n    info->output_height = MCU_rows * info->iMCU_sample_height;\n}\n\n\n/* Request any required workspace.\n *\n * This routine figures out the size that the output image will be\n * (which implies that all the transform parameters must be set before\n * it is called).\n *\n * We allocate the workspace virtual arrays from the source decompression\n * object, so that all the arrays (both the original data and the workspace)\n * will be taken into account while making memory management decisions.\n * Hence, this routine must be called after jpeg_read_header (which reads\n * the image dimensions) and before jpeg_read_coefficients (which realizes\n * the source's virtual arrays).\n *\n * This function returns FALSE right away if -perfect is given\n * and transformation is not perfect.  Otherwise returns TRUE.\n */\n\nGLOBAL(boolean)\njtransform_request_workspace (j_decompress_ptr srcinfo,\n                              jpeg_transform_info *info)\n{\n  jvirt_barray_ptr *coef_arrays;\n  boolean need_workspace, transpose_it;\n  jpeg_component_info *compptr;\n  JDIMENSION xoffset, yoffset;\n  JDIMENSION width_in_iMCUs, height_in_iMCUs;\n  JDIMENSION width_in_blocks, height_in_blocks;\n  int ci, h_samp_factor, v_samp_factor;\n\n  /* Determine number of components in output image */\n  if (info->force_grayscale &&\n      srcinfo->jpeg_color_space == JCS_YCbCr &&\n      srcinfo->num_components == 3)\n    /* We'll only process the first component */\n    info->num_components = 1;\n  else\n    /* Process all the components */\n    info->num_components = srcinfo->num_components;\n\n  /* Compute output image dimensions and related values. */\n#if JPEG_LIB_VERSION >= 80\n  jpeg_core_output_dimensions(srcinfo);\n#else\n  srcinfo->output_width = srcinfo->image_width;\n  srcinfo->output_height = srcinfo->image_height;\n#endif\n\n  /* Return right away if -perfect is given and transformation is not perfect.\n   */\n  if (info->perfect) {\n    if (info->num_components == 1) {\n      if (!jtransform_perfect_transform(srcinfo->output_width,\n          srcinfo->output_height,\n          srcinfo->_min_DCT_h_scaled_size,\n          srcinfo->_min_DCT_v_scaled_size,\n          info->transform))\n        return FALSE;\n    } else {\n      if (!jtransform_perfect_transform(srcinfo->output_width,\n          srcinfo->output_height,\n          srcinfo->max_h_samp_factor * srcinfo->_min_DCT_h_scaled_size,\n          srcinfo->max_v_samp_factor * srcinfo->_min_DCT_v_scaled_size,\n          info->transform))\n        return FALSE;\n    }\n  }\n\n  /* If there is only one output component, force the iMCU size to be 1;\n   * else use the source iMCU size.  (This allows us to do the right thing\n   * when reducing color to grayscale, and also provides a handy way of\n   * cleaning up \"funny\" grayscale images whose sampling factors are not 1x1.)\n   */\n  switch (info->transform) {\n  case JXFORM_TRANSPOSE:\n  case JXFORM_TRANSVERSE:\n  case JXFORM_ROT_90:\n  case JXFORM_ROT_270:\n    info->output_width = srcinfo->output_height;\n    info->output_height = srcinfo->output_width;\n    if (info->num_components == 1) {\n      info->iMCU_sample_width = srcinfo->_min_DCT_v_scaled_size;\n      info->iMCU_sample_height = srcinfo->_min_DCT_h_scaled_size;\n    } else {\n      info->iMCU_sample_width =\n        srcinfo->max_v_samp_factor * srcinfo->_min_DCT_v_scaled_size;\n      info->iMCU_sample_height =\n        srcinfo->max_h_samp_factor * srcinfo->_min_DCT_h_scaled_size;\n    }\n    break;\n  default:\n    info->output_width = srcinfo->output_width;\n    info->output_height = srcinfo->output_height;\n    if (info->num_components == 1) {\n      info->iMCU_sample_width = srcinfo->_min_DCT_h_scaled_size;\n      info->iMCU_sample_height = srcinfo->_min_DCT_v_scaled_size;\n    } else {\n      info->iMCU_sample_width =\n        srcinfo->max_h_samp_factor * srcinfo->_min_DCT_h_scaled_size;\n      info->iMCU_sample_height =\n        srcinfo->max_v_samp_factor * srcinfo->_min_DCT_v_scaled_size;\n    }\n    break;\n  }\n\n  /* If cropping has been requested, compute the crop area's position and\n   * dimensions, ensuring that its upper left corner falls at an iMCU boundary.\n   */\n  if (info->crop) {\n    /* Insert default values for unset crop parameters */\n    if (info->crop_xoffset_set == JCROP_UNSET)\n      info->crop_xoffset = 0;   /* default to +0 */\n    if (info->crop_yoffset_set == JCROP_UNSET)\n      info->crop_yoffset = 0;   /* default to +0 */\n    if (info->crop_xoffset >= info->output_width ||\n        info->crop_yoffset >= info->output_height)\n      ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);\n    if (info->crop_width_set == JCROP_UNSET)\n      info->crop_width = info->output_width - info->crop_xoffset;\n    if (info->crop_height_set == JCROP_UNSET)\n      info->crop_height = info->output_height - info->crop_yoffset;\n    /* Ensure parameters are valid */\n    if (info->crop_width <= 0 || info->crop_width > info->output_width ||\n        info->crop_height <= 0 || info->crop_height > info->output_height ||\n        info->crop_xoffset > info->output_width - info->crop_width ||\n        info->crop_yoffset > info->output_height - info->crop_height)\n      ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);\n    /* Convert negative crop offsets into regular offsets */\n    if (info->crop_xoffset_set == JCROP_NEG)\n      xoffset = info->output_width - info->crop_width - info->crop_xoffset;\n    else\n      xoffset = info->crop_xoffset;\n    if (info->crop_yoffset_set == JCROP_NEG)\n      yoffset = info->output_height - info->crop_height - info->crop_yoffset;\n    else\n      yoffset = info->crop_yoffset;\n    /* Now adjust so that upper left corner falls at an iMCU boundary */\n    if (info->crop_width_set == JCROP_FORCE)\n      info->output_width = info->crop_width;\n    else\n      info->output_width =\n        info->crop_width + (xoffset % info->iMCU_sample_width);\n    if (info->crop_height_set == JCROP_FORCE)\n      info->output_height = info->crop_height;\n    else\n      info->output_height =\n        info->crop_height + (yoffset % info->iMCU_sample_height);\n    /* Save x/y offsets measured in iMCUs */\n    info->x_crop_offset = xoffset / info->iMCU_sample_width;\n    info->y_crop_offset = yoffset / info->iMCU_sample_height;\n  } else {\n    info->x_crop_offset = 0;\n    info->y_crop_offset = 0;\n  }\n\n  /* Figure out whether we need workspace arrays,\n   * and if so whether they are transposed relative to the source.\n   */\n  need_workspace = FALSE;\n  transpose_it = FALSE;\n  switch (info->transform) {\n  case JXFORM_NONE:\n    if (info->x_crop_offset != 0 || info->y_crop_offset != 0)\n      need_workspace = TRUE;\n    /* No workspace needed if neither cropping nor transforming */\n    break;\n  case JXFORM_FLIP_H:\n    if (info->trim)\n      trim_right_edge(info, srcinfo->output_width);\n    if (info->y_crop_offset != 0 || info->slow_hflip)\n      need_workspace = TRUE;\n    /* do_flip_h_no_crop doesn't need a workspace array */\n    break;\n  case JXFORM_FLIP_V:\n    if (info->trim)\n      trim_bottom_edge(info, srcinfo->output_height);\n    /* Need workspace arrays having same dimensions as source image. */\n    need_workspace = TRUE;\n    break;\n  case JXFORM_TRANSPOSE:\n    /* transpose does NOT have to trim anything */\n    /* Need workspace arrays having transposed dimensions. */\n    need_workspace = TRUE;\n    transpose_it = TRUE;\n    break;\n  case JXFORM_TRANSVERSE:\n    if (info->trim) {\n      trim_right_edge(info, srcinfo->output_height);\n      trim_bottom_edge(info, srcinfo->output_width);\n    }\n    /* Need workspace arrays having transposed dimensions. */\n    need_workspace = TRUE;\n    transpose_it = TRUE;\n    break;\n  case JXFORM_ROT_90:\n    if (info->trim)\n      trim_right_edge(info, srcinfo->output_height);\n    /* Need workspace arrays having transposed dimensions. */\n    need_workspace = TRUE;\n    transpose_it = TRUE;\n    break;\n  case JXFORM_ROT_180:\n    if (info->trim) {\n      trim_right_edge(info, srcinfo->output_width);\n      trim_bottom_edge(info, srcinfo->output_height);\n    }\n    /* Need workspace arrays having same dimensions as source image. */\n    need_workspace = TRUE;\n    break;\n  case JXFORM_ROT_270:\n    if (info->trim)\n      trim_bottom_edge(info, srcinfo->output_width);\n    /* Need workspace arrays having transposed dimensions. */\n    need_workspace = TRUE;\n    transpose_it = TRUE;\n    break;\n  }\n\n  /* Allocate workspace if needed.\n   * Note that we allocate arrays padded out to the next iMCU boundary,\n   * so that transform routines need not worry about missing edge blocks.\n   */\n  if (need_workspace) {\n    coef_arrays = (jvirt_barray_ptr *)\n      (*srcinfo->mem->alloc_small) ((j_common_ptr) srcinfo, JPOOL_IMAGE,\n                sizeof(jvirt_barray_ptr) * info->num_components);\n    width_in_iMCUs = (JDIMENSION)\n      jdiv_round_up((long) info->output_width,\n                    (long) info->iMCU_sample_width);\n    height_in_iMCUs = (JDIMENSION)\n      jdiv_round_up((long) info->output_height,\n                    (long) info->iMCU_sample_height);\n    for (ci = 0; ci < info->num_components; ci++) {\n      compptr = srcinfo->comp_info + ci;\n      if (info->num_components == 1) {\n        /* we're going to force samp factors to 1x1 in this case */\n        h_samp_factor = v_samp_factor = 1;\n      } else if (transpose_it) {\n        h_samp_factor = compptr->v_samp_factor;\n        v_samp_factor = compptr->h_samp_factor;\n      } else {\n        h_samp_factor = compptr->h_samp_factor;\n        v_samp_factor = compptr->v_samp_factor;\n      }\n      width_in_blocks = width_in_iMCUs * h_samp_factor;\n      height_in_blocks = height_in_iMCUs * v_samp_factor;\n      coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)\n        ((j_common_ptr) srcinfo, JPOOL_IMAGE, FALSE,\n         width_in_blocks, height_in_blocks, (JDIMENSION) v_samp_factor);\n    }\n    info->workspace_coef_arrays = coef_arrays;\n  } else\n    info->workspace_coef_arrays = NULL;\n\n  return TRUE;\n}\n\n\n/* Transpose destination image parameters */\n\nLOCAL(void)\ntranspose_critical_parameters (j_compress_ptr dstinfo)\n{\n  int tblno, i, j, ci, itemp;\n  jpeg_component_info *compptr;\n  JQUANT_TBL *qtblptr;\n  JDIMENSION jtemp;\n  UINT16 qtemp;\n\n  /* Transpose image dimensions */\n  jtemp = dstinfo->image_width;\n  dstinfo->image_width = dstinfo->image_height;\n  dstinfo->image_height = jtemp;\n#if JPEG_LIB_VERSION >= 70\n  itemp = dstinfo->min_DCT_h_scaled_size;\n  dstinfo->min_DCT_h_scaled_size = dstinfo->min_DCT_v_scaled_size;\n  dstinfo->min_DCT_v_scaled_size = itemp;\n#endif\n\n  /* Transpose sampling factors */\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    itemp = compptr->h_samp_factor;\n    compptr->h_samp_factor = compptr->v_samp_factor;\n    compptr->v_samp_factor = itemp;\n  }\n\n  /* Transpose quantization tables */\n  for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {\n    qtblptr = dstinfo->quant_tbl_ptrs[tblno];\n    if (qtblptr != NULL) {\n      for (i = 0; i < DCTSIZE; i++) {\n        for (j = 0; j < i; j++) {\n          qtemp = qtblptr->quantval[i*DCTSIZE+j];\n          qtblptr->quantval[i*DCTSIZE+j] = qtblptr->quantval[j*DCTSIZE+i];\n          qtblptr->quantval[j*DCTSIZE+i] = qtemp;\n        }\n      }\n    }\n  }\n}\n\n\n/* Adjust Exif image parameters.\n *\n * We try to adjust the Tags ExifImageWidth and ExifImageHeight if possible.\n */\n\n#if JPEG_LIB_VERSION >= 70\nLOCAL(void)\nadjust_exif_parameters (JOCTET *data, unsigned int length,\n                        JDIMENSION new_width, JDIMENSION new_height)\n{\n  boolean is_motorola; /* Flag for byte order */\n  unsigned int number_of_tags, tagnum;\n  unsigned int firstoffset, offset;\n  JDIMENSION new_value;\n\n  if (length < 12) return; /* Length of an IFD entry */\n\n  /* Discover byte order */\n  if (GETJOCTET(data[0]) == 0x49 && GETJOCTET(data[1]) == 0x49)\n    is_motorola = FALSE;\n  else if (GETJOCTET(data[0]) == 0x4D && GETJOCTET(data[1]) == 0x4D)\n    is_motorola = TRUE;\n  else\n    return;\n\n  /* Check Tag Mark */\n  if (is_motorola) {\n    if (GETJOCTET(data[2]) != 0) return;\n    if (GETJOCTET(data[3]) != 0x2A) return;\n  } else {\n    if (GETJOCTET(data[3]) != 0) return;\n    if (GETJOCTET(data[2]) != 0x2A) return;\n  }\n\n  /* Get first IFD offset (offset to IFD0) */\n  if (is_motorola) {\n    if (GETJOCTET(data[4]) != 0) return;\n    if (GETJOCTET(data[5]) != 0) return;\n    firstoffset = GETJOCTET(data[6]);\n    firstoffset <<= 8;\n    firstoffset += GETJOCTET(data[7]);\n  } else {\n    if (GETJOCTET(data[7]) != 0) return;\n    if (GETJOCTET(data[6]) != 0) return;\n    firstoffset = GETJOCTET(data[5]);\n    firstoffset <<= 8;\n    firstoffset += GETJOCTET(data[4]);\n  }\n  if (firstoffset > length - 2) return; /* check end of data segment */\n\n  /* Get the number of directory entries contained in this IFD */\n  if (is_motorola) {\n    number_of_tags = GETJOCTET(data[firstoffset]);\n    number_of_tags <<= 8;\n    number_of_tags += GETJOCTET(data[firstoffset+1]);\n  } else {\n    number_of_tags = GETJOCTET(data[firstoffset+1]);\n    number_of_tags <<= 8;\n    number_of_tags += GETJOCTET(data[firstoffset]);\n  }\n  if (number_of_tags == 0) return;\n  firstoffset += 2;\n\n  /* Search for ExifSubIFD offset Tag in IFD0 */\n  for (;;) {\n    if (firstoffset > length - 12) return; /* check end of data segment */\n    /* Get Tag number */\n    if (is_motorola) {\n      tagnum = GETJOCTET(data[firstoffset]);\n      tagnum <<= 8;\n      tagnum += GETJOCTET(data[firstoffset+1]);\n    } else {\n      tagnum = GETJOCTET(data[firstoffset+1]);\n      tagnum <<= 8;\n      tagnum += GETJOCTET(data[firstoffset]);\n    }\n    if (tagnum == 0x8769) break; /* found ExifSubIFD offset Tag */\n    if (--number_of_tags == 0) return;\n    firstoffset += 12;\n  }\n\n  /* Get the ExifSubIFD offset */\n  if (is_motorola) {\n    if (GETJOCTET(data[firstoffset+8]) != 0) return;\n    if (GETJOCTET(data[firstoffset+9]) != 0) return;\n    offset = GETJOCTET(data[firstoffset+10]);\n    offset <<= 8;\n    offset += GETJOCTET(data[firstoffset+11]);\n  } else {\n    if (GETJOCTET(data[firstoffset+11]) != 0) return;\n    if (GETJOCTET(data[firstoffset+10]) != 0) return;\n    offset = GETJOCTET(data[firstoffset+9]);\n    offset <<= 8;\n    offset += GETJOCTET(data[firstoffset+8]);\n  }\n  if (offset > length - 2) return; /* check end of data segment */\n\n  /* Get the number of directory entries contained in this SubIFD */\n  if (is_motorola) {\n    number_of_tags = GETJOCTET(data[offset]);\n    number_of_tags <<= 8;\n    number_of_tags += GETJOCTET(data[offset+1]);\n  } else {\n    number_of_tags = GETJOCTET(data[offset+1]);\n    number_of_tags <<= 8;\n    number_of_tags += GETJOCTET(data[offset]);\n  }\n  if (number_of_tags < 2) return;\n  offset += 2;\n\n  /* Search for ExifImageWidth and ExifImageHeight Tags in this SubIFD */\n  do {\n    if (offset > length - 12) return; /* check end of data segment */\n    /* Get Tag number */\n    if (is_motorola) {\n      tagnum = GETJOCTET(data[offset]);\n      tagnum <<= 8;\n      tagnum += GETJOCTET(data[offset+1]);\n    } else {\n      tagnum = GETJOCTET(data[offset+1]);\n      tagnum <<= 8;\n      tagnum += GETJOCTET(data[offset]);\n    }\n    if (tagnum == 0xA002 || tagnum == 0xA003) {\n      if (tagnum == 0xA002)\n        new_value = new_width; /* ExifImageWidth Tag */\n      else\n        new_value = new_height; /* ExifImageHeight Tag */\n      if (is_motorola) {\n        data[offset+2] = 0; /* Format = unsigned long (4 octets) */\n        data[offset+3] = 4;\n        data[offset+4] = 0; /* Number Of Components = 1 */\n        data[offset+5] = 0;\n        data[offset+6] = 0;\n        data[offset+7] = 1;\n        data[offset+8] = 0;\n        data[offset+9] = 0;\n        data[offset+10] = (JOCTET)((new_value >> 8) & 0xFF);\n        data[offset+11] = (JOCTET)(new_value & 0xFF);\n      } else {\n        data[offset+2] = 4; /* Format = unsigned long (4 octets) */\n        data[offset+3] = 0;\n        data[offset+4] = 1; /* Number Of Components = 1 */\n        data[offset+5] = 0;\n        data[offset+6] = 0;\n        data[offset+7] = 0;\n        data[offset+8] = (JOCTET)(new_value & 0xFF);\n        data[offset+9] = (JOCTET)((new_value >> 8) & 0xFF);\n        data[offset+10] = 0;\n        data[offset+11] = 0;\n      }\n    }\n    offset += 12;\n  } while (--number_of_tags);\n}\n#endif\n\n\n/* Adjust output image parameters as needed.\n *\n * This must be called after jpeg_copy_critical_parameters()\n * and before jpeg_write_coefficients().\n *\n * The return value is the set of virtual coefficient arrays to be written\n * (either the ones allocated by jtransform_request_workspace, or the\n * original source data arrays).  The caller will need to pass this value\n * to jpeg_write_coefficients().\n */\n\nGLOBAL(jvirt_barray_ptr *)\njtransform_adjust_parameters (j_decompress_ptr srcinfo,\n                              j_compress_ptr dstinfo,\n                              jvirt_barray_ptr *src_coef_arrays,\n                              jpeg_transform_info *info)\n{\n  /* If force-to-grayscale is requested, adjust destination parameters */\n  if (info->force_grayscale) {\n    /* First, ensure we have YCbCr or grayscale data, and that the source's\n     * Y channel is full resolution.  (No reasonable person would make Y\n     * be less than full resolution, so actually coping with that case\n     * isn't worth extra code space.  But we check it to avoid crashing.)\n     */\n    if (((dstinfo->jpeg_color_space == JCS_YCbCr &&\n          dstinfo->num_components == 3) ||\n         (dstinfo->jpeg_color_space == JCS_GRAYSCALE &&\n          dstinfo->num_components == 1)) &&\n        srcinfo->comp_info[0].h_samp_factor == srcinfo->max_h_samp_factor &&\n        srcinfo->comp_info[0].v_samp_factor == srcinfo->max_v_samp_factor) {\n      /* We use jpeg_set_colorspace to make sure subsidiary settings get fixed\n       * properly.  Among other things, it sets the target h_samp_factor &\n       * v_samp_factor to 1, which typically won't match the source.\n       * We have to preserve the source's quantization table number, however.\n       */\n      int sv_quant_tbl_no = dstinfo->comp_info[0].quant_tbl_no;\n      jpeg_set_colorspace(dstinfo, JCS_GRAYSCALE);\n      dstinfo->comp_info[0].quant_tbl_no = sv_quant_tbl_no;\n    } else {\n      /* Sorry, can't do it */\n      ERREXIT(dstinfo, JERR_CONVERSION_NOTIMPL);\n    }\n  } else if (info->num_components == 1) {\n    /* For a single-component source, we force the destination sampling factors\n     * to 1x1, with or without force_grayscale.  This is useful because some\n     * decoders choke on grayscale images with other sampling factors.\n     */\n    dstinfo->comp_info[0].h_samp_factor = 1;\n    dstinfo->comp_info[0].v_samp_factor = 1;\n  }\n\n  /* Correct the destination's image dimensions as necessary\n   * for rotate/flip, resize, and crop operations.\n   */\n#if JPEG_LIB_VERSION >= 70\n  dstinfo->jpeg_width = info->output_width;\n  dstinfo->jpeg_height = info->output_height;\n#endif\n\n  /* Transpose destination image parameters */\n  switch (info->transform) {\n  case JXFORM_TRANSPOSE:\n  case JXFORM_TRANSVERSE:\n  case JXFORM_ROT_90:\n  case JXFORM_ROT_270:\n#if JPEG_LIB_VERSION < 70\n    dstinfo->image_width = info->output_height;\n    dstinfo->image_height = info->output_width;\n#endif\n    transpose_critical_parameters(dstinfo);\n    break;\n  default:\n#if JPEG_LIB_VERSION < 70\n    dstinfo->image_width = info->output_width;\n    dstinfo->image_height = info->output_height;\n#endif\n    break;\n  }\n\n  /* Adjust Exif properties */\n  if (srcinfo->marker_list != NULL &&\n      srcinfo->marker_list->marker == JPEG_APP0+1 &&\n      srcinfo->marker_list->data_length >= 6 &&\n      GETJOCTET(srcinfo->marker_list->data[0]) == 0x45 &&\n      GETJOCTET(srcinfo->marker_list->data[1]) == 0x78 &&\n      GETJOCTET(srcinfo->marker_list->data[2]) == 0x69 &&\n      GETJOCTET(srcinfo->marker_list->data[3]) == 0x66 &&\n      GETJOCTET(srcinfo->marker_list->data[4]) == 0 &&\n      GETJOCTET(srcinfo->marker_list->data[5]) == 0) {\n    /* Suppress output of JFIF marker */\n    dstinfo->write_JFIF_header = FALSE;\n#if JPEG_LIB_VERSION >= 70\n    /* Adjust Exif image parameters */\n    if (dstinfo->jpeg_width != srcinfo->image_width ||\n        dstinfo->jpeg_height != srcinfo->image_height)\n      /* Align data segment to start of TIFF structure for parsing */\n      adjust_exif_parameters(srcinfo->marker_list->data + 6,\n        srcinfo->marker_list->data_length - 6,\n        dstinfo->jpeg_width, dstinfo->jpeg_height);\n#endif\n  }\n\n  /* Return the appropriate output data set */\n  if (info->workspace_coef_arrays != NULL)\n    return info->workspace_coef_arrays;\n  return src_coef_arrays;\n}\n\n\n/* Execute the actual transformation, if any.\n *\n * This must be called *after* jpeg_write_coefficients, because it depends\n * on jpeg_write_coefficients to have computed subsidiary values such as\n * the per-component width and height fields in the destination object.\n *\n * Note that some transformations will modify the source data arrays!\n */\n\nGLOBAL(void)\njtransform_execute_transform (j_decompress_ptr srcinfo,\n                              j_compress_ptr dstinfo,\n                              jvirt_barray_ptr *src_coef_arrays,\n                              jpeg_transform_info *info)\n{\n  jvirt_barray_ptr *dst_coef_arrays = info->workspace_coef_arrays;\n\n  /* Note: conditions tested here should match those in switch statement\n   * in jtransform_request_workspace()\n   */\n  switch (info->transform) {\n  case JXFORM_NONE:\n    if (info->x_crop_offset != 0 || info->y_crop_offset != 0)\n      do_crop(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n              src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_FLIP_H:\n    if (info->y_crop_offset != 0 || info->slow_hflip)\n      do_flip_h(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n                src_coef_arrays, dst_coef_arrays);\n    else\n      do_flip_h_no_crop(srcinfo, dstinfo, info->x_crop_offset,\n                        src_coef_arrays);\n    break;\n  case JXFORM_FLIP_V:\n    do_flip_v(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n              src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_TRANSPOSE:\n    do_transpose(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n                 src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_TRANSVERSE:\n    do_transverse(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n                  src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_ROT_90:\n    do_rot_90(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n              src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_ROT_180:\n    do_rot_180(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n               src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_ROT_270:\n    do_rot_270(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n               src_coef_arrays, dst_coef_arrays);\n    break;\n  }\n}\n\n/* jtransform_perfect_transform\n *\n * Determine whether lossless transformation is perfectly\n * possible for a specified image and transformation.\n *\n * Inputs:\n *   image_width, image_height: source image dimensions.\n *   MCU_width, MCU_height: pixel dimensions of MCU.\n *   transform: transformation identifier.\n * Parameter sources from initialized jpeg_struct\n * (after reading source header):\n *   image_width = cinfo.image_width\n *   image_height = cinfo.image_height\n *   MCU_width = cinfo.max_h_samp_factor * cinfo.block_size\n *   MCU_height = cinfo.max_v_samp_factor * cinfo.block_size\n * Result:\n *   TRUE = perfect transformation possible\n *   FALSE = perfect transformation not possible\n *           (may use custom action then)\n */\n\nGLOBAL(boolean)\njtransform_perfect_transform(JDIMENSION image_width, JDIMENSION image_height,\n                             int MCU_width, int MCU_height,\n                             JXFORM_CODE transform)\n{\n  boolean result = TRUE; /* initialize TRUE */\n\n  switch (transform) {\n  case JXFORM_FLIP_H:\n  case JXFORM_ROT_270:\n    if (image_width % (JDIMENSION) MCU_width)\n      result = FALSE;\n    break;\n  case JXFORM_FLIP_V:\n  case JXFORM_ROT_90:\n    if (image_height % (JDIMENSION) MCU_height)\n      result = FALSE;\n    break;\n  case JXFORM_TRANSVERSE:\n  case JXFORM_ROT_180:\n    if (image_width % (JDIMENSION) MCU_width)\n      result = FALSE;\n    if (image_height % (JDIMENSION) MCU_height)\n      result = FALSE;\n    break;\n  default:\n    break;\n  }\n\n  return result;\n}\n\n#endif /* TRANSFORMS_SUPPORTED */\n\n\n/* Setup decompression object to save desired markers in memory.\n * This must be called before jpeg_read_header() to have the desired effect.\n */\n\nGLOBAL(void)\njcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option)\n{\n#ifdef SAVE_MARKERS_SUPPORTED\n  int m;\n\n  /* Save comments except under NONE option */\n  if (option != JCOPYOPT_NONE) {\n    jpeg_save_markers(srcinfo, JPEG_COM, 0xFFFF);\n  }\n  /* Save all types of APPn markers iff ALL option */\n  if (option == JCOPYOPT_ALL) {\n    for (m = 0; m < 16; m++)\n      jpeg_save_markers(srcinfo, JPEG_APP0 + m, 0xFFFF);\n  }\n#endif /* SAVE_MARKERS_SUPPORTED */\n}\n\n/* Copy markers saved in the given source object to the destination object.\n * This should be called just after jpeg_start_compress() or\n * jpeg_write_coefficients().\n * Note that those routines will have written the SOI, and also the\n * JFIF APP0 or Adobe APP14 markers if selected.\n */\n\nGLOBAL(void)\njcopy_markers_execute (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n                       JCOPY_OPTION option)\n{\n  jpeg_saved_marker_ptr marker;\n\n  /* In the current implementation, we don't actually need to examine the\n   * option flag here; we just copy everything that got saved.\n   * But to avoid confusion, we do not output JFIF and Adobe APP14 markers\n   * if the encoder library already wrote one.\n   */\n  for (marker = srcinfo->marker_list; marker != NULL; marker = marker->next) {\n    if (dstinfo->write_JFIF_header &&\n        marker->marker == JPEG_APP0 &&\n        marker->data_length >= 5 &&\n        GETJOCTET(marker->data[0]) == 0x4A &&\n        GETJOCTET(marker->data[1]) == 0x46 &&\n        GETJOCTET(marker->data[2]) == 0x49 &&\n        GETJOCTET(marker->data[3]) == 0x46 &&\n        GETJOCTET(marker->data[4]) == 0)\n      continue;                 /* reject duplicate JFIF */\n    if (dstinfo->write_Adobe_marker &&\n        marker->marker == JPEG_APP0+14 &&\n        marker->data_length >= 5 &&\n        GETJOCTET(marker->data[0]) == 0x41 &&\n        GETJOCTET(marker->data[1]) == 0x64 &&\n        GETJOCTET(marker->data[2]) == 0x6F &&\n        GETJOCTET(marker->data[3]) == 0x62 &&\n        GETJOCTET(marker->data[4]) == 0x65)\n      continue;                 /* reject duplicate Adobe */\n    jpeg_write_marker(dstinfo, marker->marker,\n                      marker->data, marker->data_length);\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/transupp.h",
    "content": "/*\n * transupp.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding.\n * It was modified by The libjpeg-turbo Project to include only code relevant\n * to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains declarations for image transformation routines and\n * other utility code used by the jpegtran sample application.  These are\n * NOT part of the core JPEG library.  But we keep these routines separate\n * from jpegtran.c to ease the task of maintaining jpegtran-like programs\n * that have other user interfaces.\n *\n * NOTE: all the routines declared here have very specific requirements\n * about when they are to be executed during the reading and writing of the\n * source and destination files.  See the comments in transupp.c, or see\n * jpegtran.c for an example of correct usage.\n */\n\n/* If you happen not to want the image transform support, disable it here */\n#ifndef TRANSFORMS_SUPPORTED\n#define TRANSFORMS_SUPPORTED 1          /* 0 disables transform code */\n#endif\n\n/*\n * Although rotating and flipping data expressed as DCT coefficients is not\n * hard, there is an asymmetry in the JPEG format specification for images\n * whose dimensions aren't multiples of the iMCU size.  The right and bottom\n * image edges are padded out to the next iMCU boundary with junk data; but\n * no padding is possible at the top and left edges.  If we were to flip\n * the whole image including the pad data, then pad garbage would become\n * visible at the top and/or left, and real pixels would disappear into the\n * pad margins --- perhaps permanently, since encoders & decoders may not\n * bother to preserve DCT blocks that appear to be completely outside the\n * nominal image area.  So, we have to exclude any partial iMCUs from the\n * basic transformation.\n *\n * Transpose is the only transformation that can handle partial iMCUs at the\n * right and bottom edges completely cleanly.  flip_h can flip partial iMCUs\n * at the bottom, but leaves any partial iMCUs at the right edge untouched.\n * Similarly flip_v leaves any partial iMCUs at the bottom edge untouched.\n * The other transforms are defined as combinations of these basic transforms\n * and process edge blocks in a way that preserves the equivalence.\n *\n * The \"trim\" option causes untransformable partial iMCUs to be dropped;\n * this is not strictly lossless, but it usually gives the best-looking\n * result for odd-size images.  Note that when this option is active,\n * the expected mathematical equivalences between the transforms may not hold.\n * (For example, -rot 270 -trim trims only the bottom edge, but -rot 90 -trim\n * followed by -rot 180 -trim trims both edges.)\n *\n * We also offer a lossless-crop option, which discards data outside a given\n * image region but losslessly preserves what is inside.  Like the rotate and\n * flip transforms, lossless crop is restricted by the JPEG format: the upper\n * left corner of the selected region must fall on an iMCU boundary.  If this\n * does not hold for the given crop parameters, we silently move the upper left\n * corner up and/or left to make it so, simultaneously increasing the region\n * dimensions to keep the lower right crop corner unchanged.  (Thus, the\n * output image covers at least the requested region, but may cover more.)\n * The adjustment of the region dimensions may be optionally disabled.\n *\n * We also provide a lossless-resize option, which is kind of a lossless-crop\n * operation in the DCT coefficient block domain - it discards higher-order\n * coefficients and losslessly preserves lower-order coefficients of a\n * sub-block.\n *\n * Rotate/flip transform, resize, and crop can be requested together in a\n * single invocation.  The crop is applied last --- that is, the crop region\n * is specified in terms of the destination image after transform/resize.\n *\n * We also offer a \"force to grayscale\" option, which simply discards the\n * chrominance channels of a YCbCr image.  This is lossless in the sense that\n * the luminance channel is preserved exactly.  It's not the same kind of\n * thing as the rotate/flip transformations, but it's convenient to handle it\n * as part of this package, mainly because the transformation routines have to\n * be aware of the option to know how many components to work on.\n */\n\n\n/*\n * Codes for supported types of image transformations.\n */\n\ntypedef enum {\n  JXFORM_NONE,            /* no transformation */\n  JXFORM_FLIP_H,          /* horizontal flip */\n  JXFORM_FLIP_V,          /* vertical flip */\n  JXFORM_TRANSPOSE,       /* transpose across UL-to-LR axis */\n  JXFORM_TRANSVERSE,      /* transpose across UR-to-LL axis */\n  JXFORM_ROT_90,          /* 90-degree clockwise rotation */\n  JXFORM_ROT_180,         /* 180-degree rotation */\n  JXFORM_ROT_270          /* 270-degree clockwise (or 90 ccw) */\n} JXFORM_CODE;\n\n/*\n * Codes for crop parameters, which can individually be unspecified,\n * positive or negative for xoffset or yoffset,\n * positive or forced for width or height.\n */\n\ntypedef enum {\n  JCROP_UNSET,\n  JCROP_POS,\n  JCROP_NEG,\n  JCROP_FORCE\n} JCROP_CODE;\n\n/*\n * Transform parameters struct.\n * NB: application must not change any elements of this struct after\n * calling jtransform_request_workspace.\n */\n\ntypedef struct {\n  /* Options: set by caller */\n  JXFORM_CODE transform;        /* image transform operator */\n  boolean perfect;              /* if TRUE, fail if partial MCUs are requested */\n  boolean trim;                 /* if TRUE, trim partial MCUs as needed */\n  boolean force_grayscale;      /* if TRUE, convert color image to grayscale */\n  boolean crop;                 /* if TRUE, crop source image */\n  boolean slow_hflip;  /* For best performance, the JXFORM_FLIP_H transform\n                          normally modifies the source coefficients in place.\n                          Setting this to TRUE will instead use a slower,\n                          double-buffered algorithm, which leaves the source\n                          coefficients in tact (necessary if other transformed\n                          images must be generated from the same set of\n                          coefficients. */\n\n  /* Crop parameters: application need not set these unless crop is TRUE.\n   * These can be filled in by jtransform_parse_crop_spec().\n   */\n  JDIMENSION crop_width;        /* Width of selected region */\n  JCROP_CODE crop_width_set;    /* (forced disables adjustment) */\n  JDIMENSION crop_height;       /* Height of selected region */\n  JCROP_CODE crop_height_set;   /* (forced disables adjustment) */\n  JDIMENSION crop_xoffset;      /* X offset of selected region */\n  JCROP_CODE crop_xoffset_set;  /* (negative measures from right edge) */\n  JDIMENSION crop_yoffset;      /* Y offset of selected region */\n  JCROP_CODE crop_yoffset_set;  /* (negative measures from bottom edge) */\n\n  /* Internal workspace: caller should not touch these */\n  int num_components;           /* # of components in workspace */\n  jvirt_barray_ptr *workspace_coef_arrays; /* workspace for transformations */\n  JDIMENSION output_width;      /* cropped destination dimensions */\n  JDIMENSION output_height;\n  JDIMENSION x_crop_offset;     /* destination crop offsets measured in iMCUs */\n  JDIMENSION y_crop_offset;\n  int iMCU_sample_width;        /* destination iMCU size */\n  int iMCU_sample_height;\n} jpeg_transform_info;\n\n\n#if TRANSFORMS_SUPPORTED\n\n/* Parse a crop specification (written in X11 geometry style) */\nEXTERN(boolean) jtransform_parse_crop_spec\n        (jpeg_transform_info *info, const char *spec);\n/* Request any required workspace */\nEXTERN(boolean) jtransform_request_workspace\n        (j_decompress_ptr srcinfo, jpeg_transform_info *info);\n/* Adjust output image parameters */\nEXTERN(jvirt_barray_ptr *) jtransform_adjust_parameters\n        (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n         jvirt_barray_ptr *src_coef_arrays, jpeg_transform_info *info);\n/* Execute the actual transformation, if any */\nEXTERN(void) jtransform_execute_transform\n        (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n         jvirt_barray_ptr *src_coef_arrays, jpeg_transform_info *info);\n/* Determine whether lossless transformation is perfectly\n * possible for a specified image and transformation.\n */\nEXTERN(boolean) jtransform_perfect_transform\n        (JDIMENSION image_width, JDIMENSION image_height, int MCU_width,\n         int MCU_height, JXFORM_CODE transform);\n\n/* jtransform_execute_transform used to be called\n * jtransform_execute_transformation, but some compilers complain about\n * routine names that long.  This macro is here to avoid breaking any\n * old source code that uses the original name...\n */\n#define jtransform_execute_transformation       jtransform_execute_transform\n\n#endif /* TRANSFORMS_SUPPORTED */\n\n\n/*\n * Support for copying optional markers from source to destination file.\n */\n\ntypedef enum {\n  JCOPYOPT_NONE,          /* copy no optional markers */\n  JCOPYOPT_COMMENTS,      /* copy only comment (COM) markers */\n  JCOPYOPT_ALL            /* copy all optional markers */\n} JCOPY_OPTION;\n\n#define JCOPYOPT_DEFAULT  JCOPYOPT_COMMENTS     /* recommended default */\n\n/* Setup decompression object to save desired markers in memory */\nEXTERN(void) jcopy_markers_setup\n        (j_decompress_ptr srcinfo, JCOPY_OPTION option);\n/* Copy markers saved in the given source object to the destination object */\nEXTERN(void) jcopy_markers_execute\n        (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n         JCOPY_OPTION option);\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/turbojpeg-jni.c",
    "content": "/*\n * Copyright (C)2011-2016 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include <stdlib.h>\n#include <string.h>\n#include \"turbojpeg.h\"\n#ifdef WIN32\n#include \"tjutil.h\"\n#endif\n#include <jni.h>\n#include \"java/org_libjpegturbo_turbojpeg_TJCompressor.h\"\n#include \"java/org_libjpegturbo_turbojpeg_TJDecompressor.h\"\n#include \"java/org_libjpegturbo_turbojpeg_TJ.h\"\n\n#define PAD(v, p) ((v+(p)-1)&(~((p)-1)))\n\n#define _throw(msg, exceptionClass) {  \\\n\tjclass _exccls=(*env)->FindClass(env, exceptionClass);  \\\n\tif(!_exccls || (*env)->ExceptionCheck(env)) goto bailout;  \\\n\t(*env)->ThrowNew(env, _exccls, msg);  \\\n\tgoto bailout;  \\\n}\n\n#define _throwtj() _throw(tjGetErrorStr(), \"org/libjpegturbo/turbojpeg/TJException\")\n\n#define _throwarg(msg) _throw(msg, \"java/lang/IllegalArgumentException\")\n\n#define _throwmem() _throw(\"Memory allocation failure\", \"java/lang/OutOfMemoryError\");\n\n#define bailif0(f) {if(!(f) || (*env)->ExceptionCheck(env)) {  \\\n\tgoto bailout;  \\\n}}\n\n#define gethandle()  \\\n\tjclass _cls=(*env)->GetObjectClass(env, obj);  \\\n\tjfieldID _fid;  \\\n\tif(!_cls || (*env)->ExceptionCheck(env)) goto bailout;  \\\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"handle\", \"J\"));  \\\n\thandle=(tjhandle)(size_t)(*env)->GetLongField(env, obj, _fid);  \\\n\n#ifdef _WIN32\n#define setenv(envvar, value, dummy) _putenv_s(envvar, value)\n#endif\n\n#define prop2env(property, envvar)  \\\n{  \\\n\tif((jName=(*env)->NewStringUTF(env, property))!=NULL  \\\n\t\t&& (jValue=(*env)->CallStaticObjectMethod(env, cls, mid, jName))!=NULL)  \\\n\t{  \\\n\t\tif((value=(*env)->GetStringUTFChars(env, jValue, 0))!=NULL)  \\\n\t\t{  \\\n\t\t\tsetenv(envvar, value, 1);  \\\n\t\t\t(*env)->ReleaseStringUTFChars(env, jValue, value);  \\\n\t\t}  \\\n\t}  \\\n}\n\nint ProcessSystemProperties(JNIEnv *env)\n{\n\tjclass cls;  jmethodID mid;\n\tjstring jName, jValue;\n\tconst char *value;\n\n\tbailif0(cls=(*env)->FindClass(env, \"java/lang/System\"));\n\tbailif0(mid=(*env)->GetStaticMethodID(env, cls, \"getProperty\",\n\t\t\"(Ljava/lang/String;)Ljava/lang/String;\"));\n\n\tprop2env(\"turbojpeg.optimize\", \"TJ_OPTIMIZE\");\n\tprop2env(\"turbojpeg.arithmetic\", \"TJ_ARITHMETIC\");\n\tprop2env(\"turbojpeg.restart\", \"TJ_RESTART\");\n\tprop2env(\"turbojpeg.progressive\", \"TJ_PROGRESSIVE\");\n\treturn 0;\n\n\tbailout:\n\treturn -1;\n}\n\n/* TurboJPEG 1.2.x: TJ::bufSize() */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSize\n\t(JNIEnv *env, jclass cls, jint width, jint height, jint jpegSubsamp)\n{\n\tjint retval=(jint)tjBufSize(width, height, jpegSubsamp);\n\tif(retval==-1) _throwarg(tjGetErrorStr());\n\n\tbailout:\n\treturn retval;\n}\n\n/* TurboJPEG 1.4.x: TJ::bufSizeYUV() */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__IIII\n\t(JNIEnv *env, jclass cls, jint width, jint pad, jint height, jint subsamp)\n{\n\tjint retval=(jint)tjBufSizeYUV2(width, pad, height, subsamp);\n\tif(retval==-1) _throwarg(tjGetErrorStr());\n\n\tbailout:\n\treturn retval;\n}\n\n/* TurboJPEG 1.2.x: TJ::bufSizeYUV() */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__III\n\t(JNIEnv *env, jclass cls, jint width, jint height, jint subsamp)\n{\n\treturn Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__IIII(env, cls, width,\n\t\t4, height, subsamp);\n}\n\n/* TurboJPEG 1.4.x: TJ::planeSizeYUV() */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeSizeYUV__IIIII\n\t(JNIEnv *env, jclass cls, jint componentID, jint width, jint stride,\n\t\tjint height, jint subsamp)\n{\n\tjint retval=(jint)tjPlaneSizeYUV(componentID, width, stride, height,\n\t\tsubsamp);\n\tif(retval==-1) _throwarg(tjGetErrorStr());\n\n\tbailout:\n\treturn retval;\n}\n\n/* TurboJPEG 1.4.x: TJ::planeWidth() */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeWidth__III\n\t(JNIEnv *env, jclass cls, jint componentID, jint width, jint subsamp)\n{\n\tjint retval=(jint)tjPlaneWidth(componentID, width, subsamp);\n\tif(retval==-1) _throwarg(tjGetErrorStr());\n\n\tbailout:\n\treturn retval;\n}\n\n/* TurboJPEG 1.4.x: TJ::planeHeight() */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeHeight__III\n\t(JNIEnv *env, jclass cls, jint componentID, jint height, jint subsamp)\n{\n\tjint retval=(jint)tjPlaneHeight(componentID, height, subsamp);\n\tif(retval==-1) _throwarg(tjGetErrorStr());\n\n\tbailout:\n\treturn retval;\n}\n\n/* TurboJPEG 1.2.x: TJCompressor::init() */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_init\n\t(JNIEnv *env, jobject obj)\n{\n\tjclass cls;\n\tjfieldID fid;\n\ttjhandle handle;\n\n\tif((handle=tjInitCompress())==NULL)\n\t\t_throwtj();\n\n\tbailif0(cls=(*env)->GetObjectClass(env, obj));\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"handle\", \"J\"));\n\t(*env)->SetLongField(env, obj, fid, (size_t)handle);\n\n\tbailout:\n\treturn;\n}\n\nstatic jint TJCompressor_compress\n\t(JNIEnv *env, jobject obj, jarray src, jint srcElementSize, jint x, jint y,\n\t\tjint width, jint pitch, jint height, jint pf, jbyteArray dst,\n\t\tjint jpegSubsamp, jint jpegQual, jint flags)\n{\n\ttjhandle handle=0;\n\tunsigned long jpegSize=0;\n\tjsize arraySize=0, actualPitch;\n\tunsigned char *srcBuf=NULL, *jpegBuf=NULL;\n\n\tgethandle();\n\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF || width<1 || height<1\n\t\t|| pitch<0)\n\t\t_throwarg(\"Invalid argument in compress()\");\n\tif(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF)\n\t\t_throwarg(\"Mismatch between Java and C API\");\n\n\tactualPitch=(pitch==0)? width*tjPixelSize[pf]:pitch;\n\tarraySize=(y+height-1)*actualPitch + (x+width)*tjPixelSize[pf];\n\tif((*env)->GetArrayLength(env, src)*srcElementSize<arraySize)\n\t\t_throwarg(\"Source buffer is not large enough\");\n\tjpegSize=tjBufSize(width, height, jpegSubsamp);\n\tif((*env)->GetArrayLength(env, dst)<(jsize)jpegSize)\n\t\t_throwarg(\"Destination buffer is not large enough\");\n\n\tbailif0(srcBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));\n\tbailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));\n\n\tif(ProcessSystemProperties(env)<0) goto bailout;\n\n\tif(tjCompress2(handle, &srcBuf[y*actualPitch + x*tjPixelSize[pf]], width,\n\t\tpitch, height, pf, &jpegBuf, &jpegSize, jpegSubsamp, jpegQual,\n\t\tflags|TJFLAG_NOREALLOC)==-1)\n\t\t_throwtj();\n\n\tbailout:\n\tif(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, jpegBuf, 0);\n\tif(srcBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);\n\treturn (jint)jpegSize;\n}\n\n/* TurboJPEG 1.3.x: TJCompressor::compress() byte source */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIIIII_3BIII\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint x, jint y, jint width,\n\t\tjint pitch, jint height, jint pf, jbyteArray dst, jint jpegSubsamp,\n\t\tjint jpegQual, jint flags)\n{\n\treturn TJCompressor_compress(env, obj, src, 1, x, y, width, pitch, height,\n\t\tpf, dst, jpegSubsamp, jpegQual, flags);\n}\n\n/* TurboJPEG 1.2.x: TJCompressor::compress() byte source */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIII_3BIII\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint width, jint pitch,\n\t\tjint height, jint pf, jbyteArray dst, jint jpegSubsamp, jint jpegQual,\n\t\tjint flags)\n{\n\treturn TJCompressor_compress(env, obj, src, 1, 0, 0, width, pitch, height,\n\t\tpf, dst, jpegSubsamp, jpegQual, flags);\n}\n\n/* TurboJPEG 1.3.x: TJCompressor::compress() int source */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIIIII_3BIII\n\t(JNIEnv *env, jobject obj, jintArray src, jint x, jint y, jint width,\n\t\tjint stride, jint height, jint pf, jbyteArray dst, jint jpegSubsamp,\n\t\tjint jpegQual, jint flags)\n{\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF)\n\t\t_throwarg(\"Invalid argument in compress()\");\n\tif(tjPixelSize[pf]!=sizeof(jint))\n\t\t_throwarg(\"Pixel format must be 32-bit when compressing from an integer buffer.\");\n\n\treturn TJCompressor_compress(env, obj, src, sizeof(jint), x, y, width,\n\t\tstride*sizeof(jint), height, pf, dst, jpegSubsamp, jpegQual, flags);\n\n\tbailout:\n\treturn 0;\n}\n\n/* TurboJPEG 1.2.x: TJCompressor::compress() int source */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIII_3BIII\n\t(JNIEnv *env, jobject obj, jintArray src, jint width, jint stride,\n\t\tjint height, jint pf, jbyteArray dst, jint jpegSubsamp, jint jpegQual,\n\t\tjint flags)\n{\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF)\n\t\t_throwarg(\"Invalid argument in compress()\");\n\tif(tjPixelSize[pf]!=sizeof(jint))\n\t\t_throwarg(\"Pixel format must be 32-bit when compressing from an integer buffer.\");\n\n\treturn TJCompressor_compress(env, obj, src, sizeof(jint), 0, 0, width,\n\t\tstride*sizeof(jint), height, pf, dst, jpegSubsamp, jpegQual, flags);\n\n\tbailout:\n\treturn 0;\n}\n\n/* TurboJPEG 1.4.x: TJCompressor::compressFromYUV() */\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII\n\t(JNIEnv *env, jobject obj, jobjectArray srcobjs, jintArray jSrcOffsets,\n\t\tjint width, jintArray jSrcStrides, jint height, jint subsamp,\n\t\tjbyteArray dst, jint jpegQual, jint flags)\n{\n\ttjhandle handle=0;\n\tunsigned long jpegSize=0;\n\tjbyteArray jSrcPlanes[3]={NULL, NULL, NULL};\n\tconst unsigned char *srcPlanes[3];\n\tunsigned char *jpegBuf=NULL;\n\tint *srcOffsets=NULL, *srcStrides=NULL;\n\tint nc=(subsamp==org_libjpegturbo_turbojpeg_TJ_SAMP_GRAY? 1:3), i;\n\n\tgethandle();\n\n\tif(subsamp<0 || subsamp>=org_libjpegturbo_turbojpeg_TJ_NUMSAMP)\n\t\t_throwarg(\"Invalid argument in compressFromYUV()\");\n\tif(org_libjpegturbo_turbojpeg_TJ_NUMSAMP!=TJ_NUMSAMP)\n\t\t_throwarg(\"Mismatch between Java and C API\");\n\n\tif((*env)->GetArrayLength(env, srcobjs)<nc)\n\t\t_throwarg(\"Planes array is too small for the subsampling type\");\n\tif((*env)->GetArrayLength(env, jSrcOffsets)<nc)\n\t\t_throwarg(\"Offsets array is too small for the subsampling type\");\n\tif((*env)->GetArrayLength(env, jSrcStrides)<nc)\n\t\t_throwarg(\"Strides array is too small for the subsampling type\");\n\n\tjpegSize=tjBufSize(width, height, subsamp);\n\tif((*env)->GetArrayLength(env, dst)<(jsize)jpegSize)\n\t\t_throwarg(\"Destination buffer is not large enough\");\n\n\tbailif0(srcOffsets=(*env)->GetPrimitiveArrayCritical(env, jSrcOffsets, 0));\n\tbailif0(srcStrides=(*env)->GetPrimitiveArrayCritical(env, jSrcStrides, 0));\n\tfor(i=0; i<nc; i++)\n\t{\n\t\tint planeSize=tjPlaneSizeYUV(i, width, srcStrides[i], height, subsamp);\n\t\tint pw=tjPlaneWidth(i, width, subsamp);\n\n\t\tif(planeSize<0 || pw<0)\n\t\t\t_throwarg(tjGetErrorStr());\n\n\t\tif(srcOffsets[i]<0)\n\t\t\t_throwarg(\"Invalid argument in compressFromYUV()\");\n\t\tif(srcStrides[i]<0 && srcOffsets[i]-planeSize+pw<0)\n\t\t\t_throwarg(\"Negative plane stride would cause memory to be accessed below plane boundary\");\n\n\t\tbailif0(jSrcPlanes[i]=(*env)->GetObjectArrayElement(env, srcobjs, i));\n\t\tif((*env)->GetArrayLength(env, jSrcPlanes[i])<srcOffsets[i]+planeSize)\n\t\t\t_throwarg(\"Source plane is not large enough\");\n\n\t\tbailif0(srcPlanes[i]=(*env)->GetPrimitiveArrayCritical(env, jSrcPlanes[i],\n\t\t\t0));\n\t\tsrcPlanes[i]=&srcPlanes[i][srcOffsets[i]];\n\t}\n\tbailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));\n\n\tif(ProcessSystemProperties(env)<0) goto bailout;\n\n\tif(tjCompressFromYUVPlanes(handle, srcPlanes, width, srcStrides, height,\n\t\tsubsamp, &jpegBuf, &jpegSize, jpegQual, flags|TJFLAG_NOREALLOC)==-1)\n\t\t_throwtj();\n\n\tbailout:\n\tif(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, jpegBuf, 0);\n\tfor(i=0; i<nc; i++)\n\t{\n\t\tif(srcPlanes[i] && jSrcPlanes[i])\n\t\t\t(*env)->ReleasePrimitiveArrayCritical(env, jSrcPlanes[i],\n\t\t\t\t(unsigned char *)srcPlanes[i], 0);\n\t}\n\tif(srcStrides)\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, jSrcStrides, srcStrides, 0);\n\tif(srcOffsets)\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, jSrcOffsets, srcOffsets, 0);\n\treturn (jint)jpegSize;\n}\n\nstatic void TJCompressor_encodeYUV\n\t(JNIEnv *env, jobject obj, jarray src, jint srcElementSize, jint x, jint y,\n\t\tjint width, jint pitch, jint height, jint pf, jobjectArray dstobjs,\n\t\tjintArray jDstOffsets, jintArray jDstStrides, jint subsamp, jint flags)\n{\n\ttjhandle handle=0;\n\tjsize arraySize=0, actualPitch;\n\tjbyteArray jDstPlanes[3]={NULL, NULL, NULL};\n\tunsigned char *srcBuf=NULL, *dstPlanes[3];\n\tint *dstOffsets=NULL, *dstStrides=NULL;\n\tint nc=(subsamp==org_libjpegturbo_turbojpeg_TJ_SAMP_GRAY? 1:3), i;\n\n\tgethandle();\n\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF || width<1 || height<1\n\t\t|| pitch<0 || subsamp<0 || subsamp>=org_libjpegturbo_turbojpeg_TJ_NUMSAMP)\n\t\t_throwarg(\"Invalid argument in encodeYUV()\");\n\tif(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF\n\t\t|| org_libjpegturbo_turbojpeg_TJ_NUMSAMP!=TJ_NUMSAMP)\n\t\t_throwarg(\"Mismatch between Java and C API\");\n\n\tif((*env)->GetArrayLength(env, dstobjs)<nc)\n\t\t_throwarg(\"Planes array is too small for the subsampling type\");\n\tif((*env)->GetArrayLength(env, jDstOffsets)<nc)\n\t\t_throwarg(\"Offsets array is too small for the subsampling type\");\n\tif((*env)->GetArrayLength(env, jDstStrides)<nc)\n\t\t_throwarg(\"Strides array is too small for the subsampling type\");\n\n\tactualPitch=(pitch==0)? width*tjPixelSize[pf]:pitch;\n\tarraySize=(y+height-1)*actualPitch + (x+width)*tjPixelSize[pf];\n\tif((*env)->GetArrayLength(env, src)*srcElementSize<arraySize)\n\t\t_throwarg(\"Source buffer is not large enough\");\n\n\tbailif0(dstOffsets=(*env)->GetPrimitiveArrayCritical(env, jDstOffsets, 0));\n\tbailif0(dstStrides=(*env)->GetPrimitiveArrayCritical(env, jDstStrides, 0));\n\tfor(i=0; i<nc; i++)\n\t{\n\t\tint planeSize=tjPlaneSizeYUV(i, width, dstStrides[i], height, subsamp);\n\t\tint pw=tjPlaneWidth(i, width, subsamp);\n\n\t\tif(planeSize<0 || pw<0)\n\t\t\t_throwarg(tjGetErrorStr());\n\n\t\tif(dstOffsets[i]<0)\n\t\t\t_throwarg(\"Invalid argument in encodeYUV()\");\n\t\tif(dstStrides[i]<0 && dstOffsets[i]-planeSize+pw<0)\n\t\t\t_throwarg(\"Negative plane stride would cause memory to be accessed below plane boundary\");\n\n\t\tbailif0(jDstPlanes[i]=(*env)->GetObjectArrayElement(env, dstobjs, i));\n\t\tif((*env)->GetArrayLength(env, jDstPlanes[i])<dstOffsets[i]+planeSize)\n\t\t\t_throwarg(\"Destination plane is not large enough\");\n\n\t\tbailif0(dstPlanes[i]=(*env)->GetPrimitiveArrayCritical(env, jDstPlanes[i],\n\t\t\t0));\n\t\tdstPlanes[i]=&dstPlanes[i][dstOffsets[i]];\n\t}\n\tbailif0(srcBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));\n\n\tif(tjEncodeYUVPlanes(handle, &srcBuf[y*actualPitch + x*tjPixelSize[pf]],\n\t\twidth, pitch, height, pf, dstPlanes, dstStrides, subsamp, flags)==-1)\n\t\t_throwtj();\n\n\tbailout:\n\tif(srcBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);\n\tfor(i=0; i<nc; i++)\n\t{\n\t\tif(dstPlanes[i] && jDstPlanes[i])\n\t\t\t(*env)->ReleasePrimitiveArrayCritical(env, jDstPlanes[i], dstPlanes[i],\n\t\t\t\t0);\n\t}\n\tif(dstStrides)\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, jDstStrides, dstStrides, 0);\n\tif(dstOffsets)\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, jDstOffsets, dstOffsets, 0);\n\treturn;\n}\n\n/* TurboJPEG 1.4.x: TJCompressor::encodeYUV() byte source */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIIIII_3_3B_3I_3III\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint x, jint y, jint width,\n\t\tjint pitch, jint height, jint pf, jobjectArray dstobjs,\n\t\tjintArray jDstOffsets, jintArray jDstStrides, jint subsamp, jint flags)\n{\n\tTJCompressor_encodeYUV(env, obj, src, 1, x, y, width, pitch, height, pf,\n\t\tdstobjs, jDstOffsets, jDstStrides, subsamp, flags);\n}\n\n/* TurboJPEG 1.4.x: TJCompressor::encodeYUV() int source */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3_3B_3I_3III\n\t(JNIEnv *env, jobject obj, jintArray src, jint x, jint y, jint width,\n\t\tjint stride, jint height, jint pf, jobjectArray dstobjs,\n\t\tjintArray jDstOffsets, jintArray jDstStrides, jint subsamp, jint flags)\n{\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF)\n\t\t_throwarg(\"Invalid argument in encodeYUV()\");\n\tif(tjPixelSize[pf]!=sizeof(jint))\n\t\t_throwarg(\"Pixel format must be 32-bit when encoding from an integer buffer.\");\n\n\tTJCompressor_encodeYUV(env, obj, src, sizeof(jint), x, y, width,\n\t\tstride*sizeof(jint), height, pf, dstobjs, jDstOffsets, jDstStrides,\n\t\tsubsamp, flags);\n\n\tbailout:\n\treturn;\n}\n\nJNIEXPORT void JNICALL TJCompressor_encodeYUV_12\n\t(JNIEnv *env, jobject obj, jarray src, jint srcElementSize, jint width,\n\t\tjint pitch, jint height, jint pf, jbyteArray dst, jint subsamp, jint flags)\n{\n\ttjhandle handle=0;\n\tjsize arraySize=0;\n\tunsigned char *srcBuf=NULL, *dstBuf=NULL;\n\n\tgethandle();\n\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF || width<1 || height<1\n\t\t|| pitch<0)\n\t\t_throwarg(\"Invalid argument in encodeYUV()\");\n\tif(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF)\n\t\t_throwarg(\"Mismatch between Java and C API\");\n\n\tarraySize=(pitch==0)? width*tjPixelSize[pf]*height:pitch*height;\n\tif((*env)->GetArrayLength(env, src)*srcElementSize<arraySize)\n\t\t_throwarg(\"Source buffer is not large enough\");\n\tif((*env)->GetArrayLength(env, dst)\n\t\t<(jsize)tjBufSizeYUV(width, height, subsamp))\n\t\t_throwarg(\"Destination buffer is not large enough\");\n\n\tbailif0(srcBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));\n\tbailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));\n\n\tif(tjEncodeYUV2(handle, srcBuf, width, pitch, height, pf, dstBuf, subsamp,\n\t\tflags)==-1)\n\t\t_throwtj();\n\n\tbailout:\n\tif(dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);\n\tif(srcBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);\n\treturn;\n}\n\n/* TurboJPEG 1.2.x: TJCompressor::encodeYUV() byte source */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIII_3BII\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint width, jint pitch,\n\t\tjint height, jint pf, jbyteArray dst, jint subsamp, jint flags)\n{\n\tTJCompressor_encodeYUV_12(env, obj, src, 1, width, pitch, height, pf, dst,\n\t\tsubsamp, flags);\n}\n\n/* TurboJPEG 1.2.x: TJCompressor::encodeYUV() int source */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIII_3BII\n\t(JNIEnv *env, jobject obj, jintArray src, jint width, jint stride,\n\t\tjint height, jint pf, jbyteArray dst, jint subsamp, jint flags)\n{\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF)\n\t\t_throwarg(\"Invalid argument in encodeYUV()\");\n\tif(tjPixelSize[pf]!=sizeof(jint))\n\t\t_throwarg(\"Pixel format must be 32-bit when encoding from an integer buffer.\");\n\n\tTJCompressor_encodeYUV_12(env, obj, src, sizeof(jint), width,\n\t\tstride*sizeof(jint), height, pf, dst, subsamp, flags);\n\n\tbailout:\n\treturn;\n}\n\n/* TurboJPEG 1.2.x: TJCompressor::destroy() */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_destroy\n\t(JNIEnv *env, jobject obj)\n{\n\ttjhandle handle=0;\n\n\tgethandle();\n\n\tif(tjDestroy(handle)==-1) _throwtj();\n\t(*env)->SetLongField(env, obj, _fid, 0);\n\n\tbailout:\n\treturn;\n}\n\n/* TurboJPEG 1.2.x: TJDecompressor::init() */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_init\n\t(JNIEnv *env, jobject obj)\n{\n\tjclass cls;\n\tjfieldID fid;\n\ttjhandle handle;\n\n\tif((handle=tjInitDecompress())==NULL) _throwtj();\n\n\tbailif0(cls=(*env)->GetObjectClass(env, obj));\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"handle\", \"J\"));\n\t(*env)->SetLongField(env, obj, fid, (size_t)handle);\n\n\tbailout:\n\treturn;\n}\n\n/* TurboJPEG 1.2.x: TJDecompressor::getScalingFactors() */\nJNIEXPORT jobjectArray JNICALL Java_org_libjpegturbo_turbojpeg_TJ_getScalingFactors\n\t(JNIEnv *env, jclass cls)\n{\n\tjclass sfcls=NULL;  jfieldID fid=0;\n\ttjscalingfactor *sf=NULL;  int n=0, i;\n\tjobject sfobj=NULL;\n\tjobjectArray sfjava=NULL;\n\n\tif((sf=tjGetScalingFactors(&n))==NULL || n==0)\n\t\t_throwarg(tjGetErrorStr());\n\n\tbailif0(sfcls=(*env)->FindClass(env, \"org/libjpegturbo/turbojpeg/TJScalingFactor\"));\n\tbailif0(sfjava=(jobjectArray)(*env)->NewObjectArray(env, n, sfcls, 0));\n\n\tfor(i=0; i<n; i++)\n\t{\n\t\tbailif0(sfobj=(*env)->AllocObject(env, sfcls));\n\t\tbailif0(fid=(*env)->GetFieldID(env, sfcls, \"num\", \"I\"));\n\t\t(*env)->SetIntField(env, sfobj, fid, sf[i].num);\n\t\tbailif0(fid=(*env)->GetFieldID(env, sfcls, \"denom\", \"I\"));\n\t\t(*env)->SetIntField(env, sfobj, fid, sf[i].denom);\n\t\t(*env)->SetObjectArrayElement(env, sfjava, i, sfobj);\n\t}\n\n\tbailout:\n\treturn sfjava;\n}\n\n/* TurboJPEG 1.2.x: TJDecompressor::decompressHeader() */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize)\n{\n\ttjhandle handle=0;\n\tunsigned char *jpegBuf=NULL;\n\tint width=0, height=0, jpegSubsamp=-1, jpegColorspace=-1;\n\n\tgethandle();\n\n\tif((*env)->GetArrayLength(env, src)<jpegSize)\n\t\t_throwarg(\"Source buffer is not large enough\");\n\n\tbailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));\n\n\tif(tjDecompressHeader3(handle, jpegBuf, (unsigned long)jpegSize,\n\t\t&width, &height, &jpegSubsamp, &jpegColorspace)==-1)\n\t\t_throwtj();\n\n\t(*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0);  jpegBuf=NULL;\n\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegSubsamp\", \"I\"));\n\t(*env)->SetIntField(env, obj, _fid, jpegSubsamp);\n\tif((_fid=(*env)->GetFieldID(env, _cls, \"jpegColorspace\", \"I\"))==0)\n\t\t(*env)->ExceptionClear(env);\n\telse\n\t\t(*env)->SetIntField(env, obj, _fid, jpegColorspace);\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegWidth\", \"I\"));\n\t(*env)->SetIntField(env, obj, _fid, width);\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegHeight\", \"I\"));\n\t(*env)->SetIntField(env, obj, _fid, height);\n\n\tbailout:\n\tif(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0);\n\treturn;\n}\n\nstatic void TJDecompressor_decompress\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jarray dst,\n\t\tjint dstElementSize, jint x, jint y, jint width, jint pitch, jint height,\n\t\tjint pf, jint flags)\n{\n\ttjhandle handle=0;\n\tjsize arraySize=0, actualPitch;\n\tunsigned char *jpegBuf=NULL, *dstBuf=NULL;\n\n\tgethandle();\n\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF)\n\t\t_throwarg(\"Invalid argument in decompress()\");\n\tif(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF)\n\t\t_throwarg(\"Mismatch between Java and C API\");\n\n\tif((*env)->GetArrayLength(env, src)<jpegSize)\n\t\t_throwarg(\"Source buffer is not large enough\");\n\tactualPitch=(pitch==0)? width*tjPixelSize[pf]:pitch;\n\tarraySize=(y+height-1)*actualPitch + (x+width)*tjPixelSize[pf];\n\tif((*env)->GetArrayLength(env, dst)*dstElementSize<arraySize)\n\t\t_throwarg(\"Destination buffer is not large enough\");\n\n\tbailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));\n\tbailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));\n\n\tif(tjDecompress2(handle, jpegBuf, (unsigned long)jpegSize,\n\t\t&dstBuf[y*actualPitch + x*tjPixelSize[pf]], width, pitch, height, pf,\n\t\tflags)==-1)\n\t\t_throwtj();\n\n\tbailout:\n\tif(dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);\n\tif(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0);\n\treturn;\n}\n\n/* TurboJPEG 1.3.x: TJDecompressor::decompress() byte destination */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIIIII\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jbyteArray dst,\n\t\tjint x, jint y, jint width, jint pitch, jint height, jint pf, jint flags)\n{\n\tTJDecompressor_decompress(env, obj, src, jpegSize, dst, 1, x, y, width,\n\t\tpitch, height, pf, flags);\n}\n\n/* TurboJPEG 1.2.x: TJDecompressor::decompress() byte destination */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIII\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jbyteArray dst,\n\t\tjint width, jint pitch, jint height, jint pf, jint flags)\n{\n\tTJDecompressor_decompress(env, obj, src, jpegSize, dst, 1, 0, 0, width,\n\t\tpitch, height, pf, flags);\n}\n\n/* TurboJPEG 1.3.x: TJDecompressor::decompress() int destination */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIIIII\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jintArray dst,\n\t\tjint x, jint y, jint width, jint stride, jint height, jint pf, jint flags)\n{\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF)\n\t\t_throwarg(\"Invalid argument in decompress()\");\n\tif(tjPixelSize[pf]!=sizeof(jint))\n\t\t_throwarg(\"Pixel format must be 32-bit when decompressing to an integer buffer.\");\n\n\tTJDecompressor_decompress(env, obj, src, jpegSize, dst, sizeof(jint), x, y,\n\t\twidth, stride*sizeof(jint), height, pf, flags);\n\n\tbailout:\n\treturn;\n}\n\n/* TurboJPEG 1.2.x: TJDecompressor::decompress() int destination */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIII\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jintArray dst,\n\t\tjint width, jint stride, jint height, jint pf, jint flags)\n{\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF)\n\t\t_throwarg(\"Invalid argument in decompress()\");\n\tif(tjPixelSize[pf]!=sizeof(jint))\n\t\t_throwarg(\"Pixel format must be 32-bit when decompressing to an integer buffer.\");\n\n\tTJDecompressor_decompress(env, obj, src, jpegSize, dst, sizeof(jint), 0, 0,\n\t\twidth, stride*sizeof(jint), height, pf, flags);\n\n\tbailout:\n\treturn;\n\n}\n\n/* TurboJPEG 1.4.x: TJDecompressor::decompressToYUV() */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize,\n\t\tjobjectArray dstobjs, jintArray jDstOffsets, jint desiredWidth,\n\t\tjintArray jDstStrides, jint desiredHeight, jint flags)\n{\n\ttjhandle handle=0;\n\tjbyteArray jDstPlanes[3]={NULL, NULL, NULL};\n\tunsigned char *jpegBuf=NULL, *dstPlanes[3];\n\tint *dstOffsets=NULL, *dstStrides=NULL;\n\tint jpegSubsamp=-1, jpegWidth=0, jpegHeight=0;\n\tint nc=0, i, width, height, scaledWidth, scaledHeight, nsf=0;\n\ttjscalingfactor *sf;\n\n\n\tgethandle();\n\n\tif((*env)->GetArrayLength(env, src)<jpegSize)\n\t\t_throwarg(\"Source buffer is not large enough\");\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegSubsamp\", \"I\"));\n\tjpegSubsamp=(int)(*env)->GetIntField(env, obj, _fid);\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegWidth\", \"I\"));\n\tjpegWidth=(int)(*env)->GetIntField(env, obj, _fid);\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegHeight\", \"I\"));\n\tjpegHeight=(int)(*env)->GetIntField(env, obj, _fid);\n\n\tnc=(jpegSubsamp==org_libjpegturbo_turbojpeg_TJ_SAMP_GRAY? 1:3);\n\n\twidth=desiredWidth;  height=desiredHeight;\n\tif(width==0) width=jpegWidth;\n\tif(height==0) height=jpegHeight;\n\tsf=tjGetScalingFactors(&nsf);\n\tif(!sf || nsf<1)\n\t\t_throwarg(tjGetErrorStr());\n\tfor(i=0; i<nsf; i++)\n\t{\n\t\tscaledWidth=TJSCALED(jpegWidth, sf[i]);\n\t\tscaledHeight=TJSCALED(jpegHeight, sf[i]);\n\t\tif(scaledWidth<=width && scaledHeight<=height)\n\t\t\tbreak;\n\t}\n\tif(i>=nsf)\n\t\t_throwarg(\"Could not scale down to desired image dimensions\");\n\n\tbailif0(dstOffsets=(*env)->GetPrimitiveArrayCritical(env, jDstOffsets, 0));\n\tbailif0(dstStrides=(*env)->GetPrimitiveArrayCritical(env, jDstStrides, 0));\n\tfor(i=0; i<nc; i++)\n\t{\n\t\tint planeSize=tjPlaneSizeYUV(i, scaledWidth, dstStrides[i], scaledHeight,\n\t\t\tjpegSubsamp);\n\t\tint pw=tjPlaneWidth(i, scaledWidth, jpegSubsamp);\n\n\t\tif(planeSize<0 || pw<0)\n\t\t\t_throwarg(tjGetErrorStr());\n\n\t\tif(dstOffsets[i]<0)\n\t\t\t_throwarg(\"Invalid argument in decompressToYUV()\");\n\t\tif(dstStrides[i]<0 && dstOffsets[i]-planeSize+pw<0)\n\t\t\t_throwarg(\"Negative plane stride would cause memory to be accessed below plane boundary\");\n\n\t\tbailif0(jDstPlanes[i]=(*env)->GetObjectArrayElement(env, dstobjs, i));\n\t\tif((*env)->GetArrayLength(env, jDstPlanes[i])<dstOffsets[i]+planeSize)\n\t\t\t_throwarg(\"Destination plane is not large enough\");\n\n\t\tbailif0(dstPlanes[i]=(*env)->GetPrimitiveArrayCritical(env, jDstPlanes[i],\n\t\t\t0));\n\t\tdstPlanes[i]=&dstPlanes[i][dstOffsets[i]];\n\t}\n\tbailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));\n\n\tif(tjDecompressToYUVPlanes(handle, jpegBuf, (unsigned long)jpegSize,\n\t\tdstPlanes, desiredWidth, dstStrides, desiredHeight, flags)==-1)\n\t\t_throwtj();\n\n\tbailout:\n\tif(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0);\n\tfor(i=0; i<nc; i++)\n\t{\n\t\tif(dstPlanes[i] && jDstPlanes[i])\n\t\t\t(*env)->ReleasePrimitiveArrayCritical(env, jDstPlanes[i], dstPlanes[i],\n\t\t\t\t0);\n\t}\n\tif(dstStrides)\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, jDstStrides, dstStrides, 0);\n\tif(dstOffsets)\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, jDstOffsets, dstOffsets, 0);\n\treturn;\n}\n\n/* TurboJPEG 1.2.x: TJDecompressor::decompressToYUV() */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jbyteArray dst,\n\t\tjint flags)\n{\n\ttjhandle handle=0;\n\tunsigned char *jpegBuf=NULL, *dstBuf=NULL;\n\tint jpegSubsamp=-1, jpegWidth=0, jpegHeight=0;\n\n\tgethandle();\n\n\tif((*env)->GetArrayLength(env, src)<jpegSize)\n\t\t_throwarg(\"Source buffer is not large enough\");\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegSubsamp\", \"I\"));\n\tjpegSubsamp=(int)(*env)->GetIntField(env, obj, _fid);\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegWidth\", \"I\"));\n\tjpegWidth=(int)(*env)->GetIntField(env, obj, _fid);\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegHeight\", \"I\"));\n\tjpegHeight=(int)(*env)->GetIntField(env, obj, _fid);\n\tif((*env)->GetArrayLength(env, dst)\n\t\t<(jsize)tjBufSizeYUV(jpegWidth, jpegHeight, jpegSubsamp))\n\t\t_throwarg(\"Destination buffer is not large enough\");\n\n\tbailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));\n\tbailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));\n\n\tif(tjDecompressToYUV(handle, jpegBuf, (unsigned long)jpegSize, dstBuf,\n\t\tflags)==-1)\n\t\t_throwtj();\n\n\tbailout:\n\tif(dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);\n\tif(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0);\n\treturn;\n}\n\nstatic void TJDecompressor_decodeYUV\n\t(JNIEnv *env, jobject obj, jobjectArray srcobjs, jintArray jSrcOffsets,\n\t\tjintArray jSrcStrides, jint subsamp, jarray dst, jint dstElementSize,\n\t\tjint x, jint y, jint width, jint pitch, jint height, jint pf, jint flags)\n{\n\ttjhandle handle=0;\n\tjsize arraySize=0, actualPitch;\n\tjbyteArray jSrcPlanes[3]={NULL, NULL, NULL};\n\tconst unsigned char *srcPlanes[3];\n\tunsigned char *dstBuf=NULL;\n\tint *srcOffsets=NULL, *srcStrides=NULL;\n\tint nc=(subsamp==org_libjpegturbo_turbojpeg_TJ_SAMP_GRAY? 1:3), i;\n\n\tgethandle();\n\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF || subsamp<0\n\t\t|| subsamp>=org_libjpegturbo_turbojpeg_TJ_NUMSAMP)\n\t\t_throwarg(\"Invalid argument in decodeYUV()\");\n\tif(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF\n\t\t|| org_libjpegturbo_turbojpeg_TJ_NUMSAMP!=TJ_NUMSAMP)\n\t\t_throwarg(\"Mismatch between Java and C API\");\n\n\tif((*env)->GetArrayLength(env, srcobjs)<nc)\n\t\t_throwarg(\"Planes array is too small for the subsampling type\");\n\tif((*env)->GetArrayLength(env, jSrcOffsets)<nc)\n\t\t_throwarg(\"Offsets array is too small for the subsampling type\");\n\tif((*env)->GetArrayLength(env, jSrcStrides)<nc)\n\t\t_throwarg(\"Strides array is too small for the subsampling type\");\n\n\tactualPitch=(pitch==0)? width*tjPixelSize[pf]:pitch;\n\tarraySize=(y+height-1)*actualPitch + (x+width)*tjPixelSize[pf];\n\tif((*env)->GetArrayLength(env, dst)*dstElementSize<arraySize)\n\t\t_throwarg(\"Destination buffer is not large enough\");\n\n\tbailif0(srcOffsets=(*env)->GetPrimitiveArrayCritical(env, jSrcOffsets, 0));\n\tbailif0(srcStrides=(*env)->GetPrimitiveArrayCritical(env, jSrcStrides, 0));\n\tfor(i=0; i<nc; i++)\n\t{\n\t\tint planeSize=tjPlaneSizeYUV(i, width, srcStrides[i], height, subsamp);\n\t\tint pw=tjPlaneWidth(i, width, subsamp);\n\n\t\tif(planeSize<0 || pw<0)\n\t\t\t_throwarg(tjGetErrorStr());\n\n\t\tif(srcOffsets[i]<0)\n\t\t\t_throwarg(\"Invalid argument in decodeYUV()\");\n\t\tif(srcStrides[i]<0 && srcOffsets[i]-planeSize+pw<0)\n\t\t\t_throwarg(\"Negative plane stride would cause memory to be accessed below plane boundary\");\n\n\t\tbailif0(jSrcPlanes[i]=(*env)->GetObjectArrayElement(env, srcobjs, i));\n\t\tif((*env)->GetArrayLength(env, jSrcPlanes[i])<srcOffsets[i]+planeSize)\n\t\t\t_throwarg(\"Source plane is not large enough\");\n\n\t\tbailif0(srcPlanes[i]=(*env)->GetPrimitiveArrayCritical(env, jSrcPlanes[i],\n\t\t\t0));\n\t\tsrcPlanes[i]=&srcPlanes[i][srcOffsets[i]];\n\t}\n\tbailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));\n\n\tif(tjDecodeYUVPlanes(handle, srcPlanes, srcStrides, subsamp,\n\t\t&dstBuf[y*actualPitch + x*tjPixelSize[pf]], width, pitch, height, pf,\n\t\tflags)==-1)\n\t\t_throwtj();\n\n\tbailout:\n\tif(dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);\n\tfor(i=0; i<nc; i++)\n\t{\n\t\tif(srcPlanes[i] && jSrcPlanes[i])\n\t\t\t(*env)->ReleasePrimitiveArrayCritical(env, jSrcPlanes[i],\n\t\t\t\t(unsigned char *)srcPlanes[i], 0);\n\t}\n\tif(srcStrides)\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, jSrcStrides, srcStrides, 0);\n\tif(srcOffsets)\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, jSrcOffsets, srcOffsets, 0);\n\treturn;\n}\n\n/* TurboJPEG 1.4.x: TJDecompressor::decodeYUV() byte destination */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3BIIIIIII\n\t(JNIEnv *env, jobject obj, jobjectArray srcobjs, jintArray jSrcOffsets,\n\t\tjintArray jSrcStrides, jint subsamp, jbyteArray dst, jint x, jint y,\n\t\tjint width, jint pitch, jint height, jint pf, jint flags)\n{\n\tTJDecompressor_decodeYUV(env, obj, srcobjs, jSrcOffsets, jSrcStrides,\n\t\tsubsamp, dst, 1, x, y, width, pitch, height, pf, flags);\n}\n\n/* TurboJPEG 1.4.x: TJDecompressor::decodeYUV() int destination */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3IIIIIIII\n\t(JNIEnv *env, jobject obj, jobjectArray srcobjs, jintArray jSrcOffsets,\n\t\tjintArray jSrcStrides, jint subsamp, jintArray dst, jint x, jint y,\n\t\tjint width, jint stride, jint height, jint pf, jint flags)\n{\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF)\n\t\t_throwarg(\"Invalid argument in decodeYUV()\");\n\tif(tjPixelSize[pf]!=sizeof(jint))\n\t\t_throwarg(\"Pixel format must be 32-bit when decoding to an integer buffer.\");\n\n\tTJDecompressor_decodeYUV(env, obj, srcobjs, jSrcOffsets, jSrcStrides,\n\t\tsubsamp, dst, sizeof(jint), x, y, width, stride*sizeof(jint), height, pf,\n\t\tflags);\n\n\tbailout:\n\treturn;\n}\n\n/* TurboJPEG 1.2.x: TJTransformer::init() */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_init\n\t(JNIEnv *env, jobject obj)\n{\n\tjclass cls;\n\tjfieldID fid;\n\ttjhandle handle;\n\n\tif((handle=tjInitTransform())==NULL) _throwtj();\n\n\tbailif0(cls=(*env)->GetObjectClass(env, obj));\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"handle\", \"J\"));\n\t(*env)->SetLongField(env, obj, fid, (size_t)handle);\n\n\tbailout:\n\treturn;\n}\n\ntypedef struct _JNICustomFilterParams\n{\n\tJNIEnv *env;\n\tjobject tobj;\n\tjobject cfobj;\n} JNICustomFilterParams;\n\nstatic int JNICustomFilter(short *coeffs, tjregion arrayRegion,\n\ttjregion planeRegion, int componentIndex, int transformIndex,\n\ttjtransform *transform)\n{\n\tJNICustomFilterParams *params=(JNICustomFilterParams *)transform->data;\n\tJNIEnv *env=params->env;\n\tjobject tobj=params->tobj, cfobj=params->cfobj;\n\tjobject arrayRegionObj, planeRegionObj, bufobj, borobj;\n\tjclass cls;  jmethodID mid;  jfieldID fid;\n\n\tbailif0(bufobj=(*env)->NewDirectByteBuffer(env, coeffs,\n\t\tsizeof(short)*arrayRegion.w*arrayRegion.h));\n\tbailif0(cls=(*env)->FindClass(env, \"java/nio/ByteOrder\"));\n\tbailif0(mid=(*env)->GetStaticMethodID(env, cls, \"nativeOrder\",\n\t\t\"()Ljava/nio/ByteOrder;\"));\n\tbailif0(borobj=(*env)->CallStaticObjectMethod(env, cls, mid));\n\tbailif0(cls=(*env)->GetObjectClass(env, bufobj));\n\tbailif0(mid=(*env)->GetMethodID(env, cls, \"order\",\n\t\t\"(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;\"));\n\t(*env)->CallObjectMethod(env, bufobj, mid, borobj);\n\tbailif0(mid=(*env)->GetMethodID(env, cls, \"asShortBuffer\",\n\t\t\"()Ljava/nio/ShortBuffer;\"));\n\tbailif0(bufobj=(*env)->CallObjectMethod(env, bufobj, mid));\n\n\tbailif0(cls=(*env)->FindClass(env, \"java/awt/Rectangle\"));\n\tbailif0(arrayRegionObj=(*env)->AllocObject(env, cls));\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"x\", \"I\"));\n\t(*env)->SetIntField(env, arrayRegionObj, fid, arrayRegion.x);\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"y\", \"I\"));\n\t(*env)->SetIntField(env, arrayRegionObj, fid, arrayRegion.y);\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"width\", \"I\"));\n\t(*env)->SetIntField(env, arrayRegionObj, fid, arrayRegion.w);\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"height\", \"I\"));\n\t(*env)->SetIntField(env, arrayRegionObj, fid, arrayRegion.h);\n\n\tbailif0(planeRegionObj=(*env)->AllocObject(env, cls));\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"x\", \"I\"));\n\t(*env)->SetIntField(env, planeRegionObj, fid, planeRegion.x);\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"y\", \"I\"));\n\t(*env)->SetIntField(env, planeRegionObj, fid, planeRegion.y);\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"width\", \"I\"));\n\t(*env)->SetIntField(env, planeRegionObj, fid, planeRegion.w);\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"height\", \"I\"));\n\t(*env)->SetIntField(env, planeRegionObj, fid, planeRegion.h);\n\n\tbailif0(cls=(*env)->GetObjectClass(env, cfobj));\n\tbailif0(mid=(*env)->GetMethodID(env, cls, \"customFilter\",\n\t\t\"(Ljava/nio/ShortBuffer;Ljava/awt/Rectangle;Ljava/awt/Rectangle;IILorg/libjpegturbo/turbojpeg/TJTransform;)V\"));\n\t(*env)->CallVoidMethod(env, cfobj, mid, bufobj, arrayRegionObj,\n\t\tplaneRegionObj, componentIndex, transformIndex, tobj);\n\n\treturn 0;\n\n\tbailout:\n\treturn -1;\n}\n\n/* TurboJPEG 1.2.x: TJTransformer::transform() */\nJNIEXPORT jintArray JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_transform\n\t(JNIEnv *env, jobject obj, jbyteArray jsrcBuf, jint jpegSize,\n\t\tjobjectArray dstobjs, jobjectArray tobjs, jint flags)\n{\n\ttjhandle handle=0;  int i;\n\tunsigned char *jpegBuf=NULL, **dstBufs=NULL;  jsize n=0;\n\tunsigned long *dstSizes=NULL;  tjtransform *t=NULL;\n\tjbyteArray *jdstBufs=NULL;\n\tint jpegWidth=0, jpegHeight=0, jpegSubsamp;\n\tjintArray jdstSizes=0;  jint *dstSizesi=NULL;\n\tJNICustomFilterParams *params=NULL;\n\n\tgethandle();\n\n\tif((*env)->GetArrayLength(env, jsrcBuf)<jpegSize)\n\t\t_throwarg(\"Source buffer is not large enough\");\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegWidth\", \"I\"));\n\tjpegWidth=(int)(*env)->GetIntField(env, obj, _fid);\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegHeight\", \"I\"));\n\tjpegHeight=(int)(*env)->GetIntField(env, obj, _fid);\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegSubsamp\", \"I\"));\n\tjpegSubsamp=(int)(*env)->GetIntField(env, obj, _fid);\n\n\tn=(*env)->GetArrayLength(env, dstobjs);\n\tif(n!=(*env)->GetArrayLength(env, tobjs))\n\t\t_throwarg(\"Mismatch between size of transforms array and destination buffers array\");\n\n\tif((dstBufs=(unsigned char **)malloc(sizeof(unsigned char *)*n))==NULL)\n\t\t_throwmem();\n\tif((jdstBufs=(jbyteArray *)malloc(sizeof(jbyteArray)*n))==NULL)\n\t\t_throwmem();\n\tif((dstSizes=(unsigned long *)malloc(sizeof(unsigned long)*n))==NULL)\n\t\t_throwmem();\n\tif((t=(tjtransform *)malloc(sizeof(tjtransform)*n))==NULL)\n\t\t_throwmem();\n\tif((params=(JNICustomFilterParams *)malloc(sizeof(JNICustomFilterParams)*n))\n\t\t==NULL)\n\t\t_throwmem();\n\tfor(i=0; i<n; i++)\n\t{\n\t\tdstBufs[i]=NULL;  jdstBufs[i]=NULL;  dstSizes[i]=0;\n\t\tmemset(&t[i], 0, sizeof(tjtransform));\n\t\tmemset(&params[i], 0, sizeof(JNICustomFilterParams));\n\t}\n\n\tfor(i=0; i<n; i++)\n\t{\n\t\tjobject tobj, cfobj;\n\n\t\tbailif0(tobj=(*env)->GetObjectArrayElement(env, tobjs, i));\n\t\tbailif0(_cls=(*env)->GetObjectClass(env, tobj));\n\t\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"op\", \"I\"));\n\t\tt[i].op=(*env)->GetIntField(env, tobj, _fid);\n\t\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"options\", \"I\"));\n\t\tt[i].options=(*env)->GetIntField(env, tobj, _fid);\n\t\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"x\", \"I\"));\n\t\tt[i].r.x=(*env)->GetIntField(env, tobj, _fid);\n\t\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"y\", \"I\"));\n\t\tt[i].r.y=(*env)->GetIntField(env, tobj, _fid);\n\t\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"width\", \"I\"));\n\t\tt[i].r.w=(*env)->GetIntField(env, tobj, _fid);\n\t\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"height\", \"I\"));\n\t\tt[i].r.h=(*env)->GetIntField(env, tobj, _fid);\n\n\t\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"cf\",\n\t\t\t\"Lorg/libjpegturbo/turbojpeg/TJCustomFilter;\"));\n\t\tcfobj=(*env)->GetObjectField(env, tobj, _fid);\n\t\tif(cfobj)\n\t\t{\n\t\t\tparams[i].env=env;\n\t\t\tparams[i].tobj=tobj;\n\t\t\tparams[i].cfobj=cfobj;\n\t\t\tt[i].customFilter=JNICustomFilter;\n\t\t\tt[i].data=(void *)&params[i];\n\t\t}\n\t}\n\n\tfor(i=0; i<n; i++)\n\t{\n\t\tint w=jpegWidth, h=jpegHeight;\n\t\tif(t[i].r.w!=0) w=t[i].r.w;\n\t\tif(t[i].r.h!=0) h=t[i].r.h;\n\t\tbailif0(jdstBufs[i]=(*env)->GetObjectArrayElement(env, dstobjs, i));\n\t\tif((unsigned long)(*env)->GetArrayLength(env, jdstBufs[i])\n\t\t\t<tjBufSize(w, h, jpegSubsamp))\n\t\t\t_throwarg(\"Destination buffer is not large enough\");\n\t}\n\tbailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, jsrcBuf, 0));\n\tfor(i=0; i<n; i++)\n\t\tbailif0(dstBufs[i]=(*env)->GetPrimitiveArrayCritical(env, jdstBufs[i], 0));\n\n\tif(tjTransform(handle, jpegBuf, jpegSize, n, dstBufs, dstSizes, t,\n\t\tflags|TJFLAG_NOREALLOC)==-1)\n\t\t_throwtj();\n\n\tfor(i=0; i<n; i++)\n\t{\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, jdstBufs[i], dstBufs[i], 0);\n\t\tdstBufs[i]=NULL;\n\t}\n\t(*env)->ReleasePrimitiveArrayCritical(env, jsrcBuf, jpegBuf, 0);\n\tjpegBuf=NULL;\n\n\tjdstSizes=(*env)->NewIntArray(env, n);\n\tbailif0(dstSizesi=(*env)->GetIntArrayElements(env, jdstSizes, 0));\n\tfor(i=0; i<n; i++) dstSizesi[i]=(int)dstSizes[i];\n\n\tbailout:\n\tif(dstSizesi) (*env)->ReleaseIntArrayElements(env, jdstSizes, dstSizesi, 0);\n\tif(dstBufs)\n\t{\n\t\tfor(i=0; i<n; i++)\n\t\t{\n\t\t\tif(dstBufs[i] && jdstBufs && jdstBufs[i])\n\t\t\t\t(*env)->ReleasePrimitiveArrayCritical(env, jdstBufs[i], dstBufs[i], 0);\n\t\t}\n\t\tfree(dstBufs);\n\t}\n\tif(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, jsrcBuf, jpegBuf, 0);\n\tif(jdstBufs) free(jdstBufs);\n\tif(dstSizes) free(dstSizes);\n\tif(t) free(t);\n\treturn jdstSizes;\n}\n\n/* TurboJPEG 1.2.x: TJDecompressor::destroy() */\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_destroy\n\t(JNIEnv *env, jobject obj)\n{\n\tJava_org_libjpegturbo_turbojpeg_TJCompressor_destroy(env, obj);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/turbojpeg-mapfile",
    "content": "TURBOJPEG_1.0\n{\n\tglobal:\n\t\ttjInitCompress;\n\t\ttjCompress;\n\t\tTJBUFSIZE;\n\t\ttjInitDecompress;\n\t\ttjDecompressHeader;\n\t\ttjDecompress;\n\t\ttjDestroy;\n\t\ttjGetErrorStr;\n\tlocal:\n\t\t*;\n};\n\nTURBOJPEG_1.1\n{\n\tglobal:\n\t\tTJBUFSIZEYUV;\n\t\ttjDecompressHeader2;\n\t\ttjDecompressToYUV;\n\t\ttjEncodeYUV;\n} TURBOJPEG_1.0;\n\nTURBOJPEG_1.2\n{\n\tglobal:\n\t\ttjAlloc;\n\t\ttjBufSize;\n\t\ttjBufSizeYUV;\n\t\ttjCompress2;\n\t\ttjDecompress2;\n\t\ttjEncodeYUV2;\n\t\ttjFree;\n\t\ttjGetScalingFactors;\n\t\ttjInitTransform;\n\t\ttjTransform;\n} TURBOJPEG_1.1;\n\nTURBOJPEG_1.4\n{\n\tglobal:\n\t\ttjBufSizeYUV2;\n\t\ttjCompressFromYUV;\n\t\ttjCompressFromYUVPlanes;\n\t\ttjDecodeYUV;\n\t\ttjDecodeYUVPlanes;\n\t\ttjDecompressHeader3;\n\t\ttjDecompressToYUV2;\n\t\ttjDecompressToYUVPlanes;\n\t\ttjEncodeYUV3;\n\t\ttjEncodeYUVPlanes;\n\t\ttjPlaneHeight;\n\t\ttjPlaneSizeYUV;\n\t\ttjPlaneWidth;\n} TURBOJPEG_1.2;\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/turbojpeg-mapfile.jni",
    "content": "TURBOJPEG_1.0\n{\n\tglobal:\n\t\ttjInitCompress;\n\t\ttjCompress;\n\t\tTJBUFSIZE;\n\t\ttjInitDecompress;\n\t\ttjDecompressHeader;\n\t\ttjDecompress;\n\t\ttjDestroy;\n\t\ttjGetErrorStr;\n\tlocal:\n\t\t*;\n};\n\nTURBOJPEG_1.1\n{\n\tglobal:\n\t\tTJBUFSIZEYUV;\n\t\ttjDecompressHeader2;\n\t\ttjDecompressToYUV;\n\t\ttjEncodeYUV;\n} TURBOJPEG_1.0;\n\nTURBOJPEG_1.2\n{\n\tglobal:\n\t\ttjAlloc;\n\t\ttjBufSize;\n\t\ttjBufSizeYUV;\n\t\ttjCompress2;\n\t\ttjDecompress2;\n\t\ttjEncodeYUV2;\n\t\ttjFree;\n\t\ttjGetScalingFactors;\n\t\ttjInitTransform;\n\t\ttjTransform;\n\t\tJava_org_libjpegturbo_turbojpeg_TJ_bufSize;\n\t\tJava_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__III;\n\t\tJava_org_libjpegturbo_turbojpeg_TJ_getScalingFactors;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_init;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIII_3BIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIII_3BIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIII_3BII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIII_3BII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_destroy;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_init;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BI;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_destroy;\n\t\tJava_org_libjpegturbo_turbojpeg_TJTransformer_init;\n\t\tJava_org_libjpegturbo_turbojpeg_TJTransformer_transform;\n} TURBOJPEG_1.1;\n\nTURBOJPEG_1.3\n{\n\tglobal:\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIIIII_3BIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIIIII_3BIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIIIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIIIII;\n} TURBOJPEG_1.2;\n\nTURBOJPEG_1.4\n{\n\tglobal:\n\t\ttjBufSizeYUV2;\n\t\ttjCompressFromYUV;\n\t\ttjCompressFromYUVPlanes;\n\t\ttjDecodeYUV;\n\t\ttjDecodeYUVPlanes;\n\t\ttjDecompressHeader3;\n\t\ttjDecompressToYUV2;\n\t\ttjDecompressToYUVPlanes;\n\t\ttjEncodeYUV3;\n\t\ttjEncodeYUVPlanes;\n\t\ttjPlaneHeight;\n\t\ttjPlaneSizeYUV;\n\t\ttjPlaneWidth;\n\t\tJava_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__IIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIIIII_3_3B_3I_3III;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3_3B_3I_3III;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3BIIIIIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3IIIIIIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJ_planeHeight__III;\n\t\tJava_org_libjpegturbo_turbojpeg_TJ_planeSizeYUV__IIIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJ_planeWidth__III;\n} TURBOJPEG_1.3;\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/turbojpeg.c",
    "content": "/*\n * Copyright (C)2009-2016 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* TurboJPEG/LJT:  this implements the TurboJPEG API using libjpeg or\n   libjpeg-turbo */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <ctype.h>\n#include <jinclude.h>\n#define JPEG_INTERNALS\n#include <jpeglib.h>\n#include <jerror.h>\n#include <setjmp.h>\n#include \"./turbojpeg.h\"\n#include \"./tjutil.h\"\n#include \"transupp.h\"\n#include \"./jpegcomp.h\"\n\nextern void jpeg_mem_dest_tj(j_compress_ptr, unsigned char **,\n\tunsigned long *, boolean);\nextern void jpeg_mem_src_tj(j_decompress_ptr, const unsigned char *,\n\tunsigned long);\n\n#define PAD(v, p) ((v+(p)-1)&(~((p)-1)))\n#define isPow2(x) (((x)&(x-1))==0)\n\n\n/* Error handling (based on example in example.c) */\n\nstatic char errStr[JMSG_LENGTH_MAX]=\"No error\";\n\nstruct my_error_mgr\n{\n\tstruct jpeg_error_mgr pub;\n\tjmp_buf setjmp_buffer;\n\tvoid (*emit_message)(j_common_ptr, int);\n\tboolean warning;\n};\ntypedef struct my_error_mgr *my_error_ptr;\n\nstatic void my_error_exit(j_common_ptr cinfo)\n{\n\tmy_error_ptr myerr=(my_error_ptr)cinfo->err;\n\t(*cinfo->err->output_message)(cinfo);\n\tlongjmp(myerr->setjmp_buffer, 1);\n}\n\n/* Based on output_message() in jerror.c */\n\nstatic void my_output_message(j_common_ptr cinfo)\n{\n\t(*cinfo->err->format_message)(cinfo, errStr);\n}\n\nstatic void my_emit_message(j_common_ptr cinfo, int msg_level)\n{\n\tmy_error_ptr myerr=(my_error_ptr)cinfo->err;\n\tmyerr->emit_message(cinfo, msg_level);\n\tif(msg_level<0) myerr->warning=TRUE;\n}\n\n\n/* Global structures, macros, etc. */\n\nenum {COMPRESS=1, DECOMPRESS=2};\n\ntypedef struct _tjinstance\n{\n\tstruct jpeg_compress_struct cinfo;\n\tstruct jpeg_decompress_struct dinfo;\n\tstruct my_error_mgr jerr;\n\tint init, headerRead;\n} tjinstance;\n\nstatic const int pixelsize[TJ_NUMSAMP]={3, 3, 3, 1, 3, 3};\n\nstatic const JXFORM_CODE xformtypes[TJ_NUMXOP]=\n{\n\tJXFORM_NONE, JXFORM_FLIP_H, JXFORM_FLIP_V, JXFORM_TRANSPOSE,\n\tJXFORM_TRANSVERSE, JXFORM_ROT_90, JXFORM_ROT_180, JXFORM_ROT_270\n};\n\n#define NUMSF 16\nstatic const tjscalingfactor sf[NUMSF]={\n\t{2, 1},\n\t{15, 8},\n\t{7, 4},\n\t{13, 8},\n\t{3, 2},\n\t{11, 8},\n\t{5, 4},\n\t{9, 8},\n\t{1, 1},\n\t{7, 8},\n\t{3, 4},\n\t{5, 8},\n\t{1, 2},\n\t{3, 8},\n\t{1, 4},\n\t{1, 8}\n};\n\n#define _throw(m) {snprintf(errStr, JMSG_LENGTH_MAX, \"%s\", m);  \\\n\tretval=-1;  goto bailout;}\n#define getinstance(handle) tjinstance *this=(tjinstance *)handle;  \\\n\tj_compress_ptr cinfo=NULL;  j_decompress_ptr dinfo=NULL;  \\\n\tif(!this) {snprintf(errStr, JMSG_LENGTH_MAX, \"Invalid handle\");  \\\n\t\treturn -1;}  \\\n\tcinfo=&this->cinfo;  dinfo=&this->dinfo;  \\\n\tthis->jerr.warning=FALSE;\n#define getcinstance(handle) tjinstance *this=(tjinstance *)handle;  \\\n\tj_compress_ptr cinfo=NULL;  \\\n\tif(!this) {snprintf(errStr, JMSG_LENGTH_MAX, \"Invalid handle\");  \\\n\t\treturn -1;}  \\\n\tcinfo=&this->cinfo;  \\\n\tthis->jerr.warning=FALSE;\n#define getdinstance(handle) tjinstance *this=(tjinstance *)handle;  \\\n\tj_decompress_ptr dinfo=NULL;  \\\n\tif(!this) {snprintf(errStr, JMSG_LENGTH_MAX, \"Invalid handle\");  \\\n\t\treturn -1;}  \\\n\tdinfo=&this->dinfo;  \\\n\tthis->jerr.warning=FALSE;\n\nstatic int getPixelFormat(int pixelSize, int flags)\n{\n\tif(pixelSize==1) return TJPF_GRAY;\n\tif(pixelSize==3)\n\t{\n\t\tif(flags&TJ_BGR) return TJPF_BGR;\n\t\telse return TJPF_RGB;\n\t}\n\tif(pixelSize==4)\n\t{\n\t\tif(flags&TJ_ALPHAFIRST)\n\t\t{\n\t\t\tif(flags&TJ_BGR) return TJPF_XBGR;\n\t\t\telse return TJPF_XRGB;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(flags&TJ_BGR) return TJPF_BGRX;\n\t\t\telse return TJPF_RGBX;\n\t\t}\n\t}\n\treturn -1;\n}\n\nstatic int setCompDefaults(struct jpeg_compress_struct *cinfo,\n\tint pixelFormat, int subsamp, int jpegQual, int flags)\n{\n\tint retval=0;\n\tchar *env=NULL;\n\n\tswitch(pixelFormat)\n\t{\n\t\tcase TJPF_GRAY:\n\t\t\tcinfo->in_color_space=JCS_GRAYSCALE;  break;\n\t\t#if JCS_EXTENSIONS==1\n\t\tcase TJPF_RGB:\n\t\t\tcinfo->in_color_space=JCS_EXT_RGB;  break;\n\t\tcase TJPF_BGR:\n\t\t\tcinfo->in_color_space=JCS_EXT_BGR;  break;\n\t\tcase TJPF_RGBX:\n\t\tcase TJPF_RGBA:\n\t\t\tcinfo->in_color_space=JCS_EXT_RGBX;  break;\n\t\tcase TJPF_BGRX:\n\t\tcase TJPF_BGRA:\n\t\t\tcinfo->in_color_space=JCS_EXT_BGRX;  break;\n\t\tcase TJPF_XRGB:\n\t\tcase TJPF_ARGB:\n\t\t\tcinfo->in_color_space=JCS_EXT_XRGB;  break;\n\t\tcase TJPF_XBGR:\n\t\tcase TJPF_ABGR:\n\t\t\tcinfo->in_color_space=JCS_EXT_XBGR;  break;\n\t\t#else\n\t\tcase TJPF_RGB:\n\t\tcase TJPF_BGR:\n\t\tcase TJPF_RGBX:\n\t\tcase TJPF_BGRX:\n\t\tcase TJPF_XRGB:\n\t\tcase TJPF_XBGR:\n\t\tcase TJPF_RGBA:\n\t\tcase TJPF_BGRA:\n\t\tcase TJPF_ARGB:\n\t\tcase TJPF_ABGR:\n\t\t\tcinfo->in_color_space=JCS_RGB;  pixelFormat=TJPF_RGB;\n\t\t\tbreak;\n\t\t#endif\n\t\tcase TJPF_CMYK:\n\t\t\tcinfo->in_color_space=JCS_CMYK;  break;\n\t}\n\n\tcinfo->input_components=tjPixelSize[pixelFormat];\n\tjpeg_set_defaults(cinfo);\n\n#ifndef NO_GETENV\n\tif((env=getenv(\"TJ_OPTIMIZE\"))!=NULL && strlen(env)>0 && !strcmp(env, \"1\"))\n\t\tcinfo->optimize_coding=TRUE;\n\tif((env=getenv(\"TJ_ARITHMETIC\"))!=NULL && strlen(env)>0\t&& !strcmp(env, \"1\"))\n\t\tcinfo->arith_code=TRUE;\n\tif((env=getenv(\"TJ_RESTART\"))!=NULL && strlen(env)>0)\n\t{\n\t\tint temp=-1;  char tempc=0;\n\t\tif(sscanf(env, \"%d%c\", &temp, &tempc)>=1 && temp>=0 && temp<=65535)\n\t\t{\n\t\t\tif(toupper(tempc)=='B')\n\t\t\t{\n\t\t\t\tcinfo->restart_interval=temp;\n\t\t\t\tcinfo->restart_in_rows=0;\n\t\t\t}\n\t\t\telse\n\t\t\t\tcinfo->restart_in_rows=temp;\n\t\t}\n\t}\n#endif\n\n\tif(jpegQual>=0)\n\t{\n\t\tjpeg_set_quality(cinfo, jpegQual, TRUE);\n\t\tif(jpegQual>=96 || flags&TJFLAG_ACCURATEDCT) cinfo->dct_method=JDCT_ISLOW;\n\t\telse cinfo->dct_method=JDCT_FASTEST;\n\t}\n\tif(subsamp==TJSAMP_GRAY)\n\t\tjpeg_set_colorspace(cinfo, JCS_GRAYSCALE);\n\telse if(pixelFormat==TJPF_CMYK)\n\t\tjpeg_set_colorspace(cinfo, JCS_YCCK);\n\telse jpeg_set_colorspace(cinfo, JCS_YCbCr);\n\n#ifndef NO_GETENV\n\tif((env=getenv(\"TJ_PROGRESSIVE\"))!=NULL && strlen(env)>0\n\t\t&& !strcmp(env, \"1\"))\n\t\tjpeg_simple_progression(cinfo);\n#endif\n\n\tcinfo->comp_info[0].h_samp_factor=tjMCUWidth[subsamp]/8;\n\tcinfo->comp_info[1].h_samp_factor=1;\n\tcinfo->comp_info[2].h_samp_factor=1;\n\tif(cinfo->num_components>3)\n\t\tcinfo->comp_info[3].h_samp_factor=tjMCUWidth[subsamp]/8;\n\tcinfo->comp_info[0].v_samp_factor=tjMCUHeight[subsamp]/8;\n\tcinfo->comp_info[1].v_samp_factor=1;\n\tcinfo->comp_info[2].v_samp_factor=1;\n\tif(cinfo->num_components>3)\n\t\tcinfo->comp_info[3].v_samp_factor=tjMCUHeight[subsamp]/8;\n\n\treturn retval;\n}\n\nstatic int setDecompDefaults(struct jpeg_decompress_struct *dinfo,\n\tint pixelFormat, int flags)\n{\n\tint retval=0;\n\n\tswitch(pixelFormat)\n\t{\n\t\tcase TJPF_GRAY:\n\t\t\tdinfo->out_color_space=JCS_GRAYSCALE;  break;\n\t\t#if JCS_EXTENSIONS==1\n\t\tcase TJPF_RGB:\n\t\t\tdinfo->out_color_space=JCS_EXT_RGB;  break;\n\t\tcase TJPF_BGR:\n\t\t\tdinfo->out_color_space=JCS_EXT_BGR;  break;\n\t\tcase TJPF_RGBX:\n\t\t\tdinfo->out_color_space=JCS_EXT_RGBX;  break;\n\t\tcase TJPF_BGRX:\n\t\t\tdinfo->out_color_space=JCS_EXT_BGRX;  break;\n\t\tcase TJPF_XRGB:\n\t\t\tdinfo->out_color_space=JCS_EXT_XRGB;  break;\n\t\tcase TJPF_XBGR:\n\t\t\tdinfo->out_color_space=JCS_EXT_XBGR;  break;\n\t\t#if JCS_ALPHA_EXTENSIONS==1\n\t\tcase TJPF_RGBA:\n\t\t\tdinfo->out_color_space=JCS_EXT_RGBA;  break;\n\t\tcase TJPF_BGRA:\n\t\t\tdinfo->out_color_space=JCS_EXT_BGRA;  break;\n\t\tcase TJPF_ARGB:\n\t\t\tdinfo->out_color_space=JCS_EXT_ARGB;  break;\n\t\tcase TJPF_ABGR:\n\t\t\tdinfo->out_color_space=JCS_EXT_ABGR;  break;\n\t\t#endif\n\t\t#else\n\t\tcase TJPF_RGB:\n\t\tcase TJPF_BGR:\n\t\tcase TJPF_RGBX:\n\t\tcase TJPF_BGRX:\n\t\tcase TJPF_XRGB:\n\t\tcase TJPF_XBGR:\n\t\tcase TJPF_RGBA:\n\t\tcase TJPF_BGRA:\n\t\tcase TJPF_ARGB:\n\t\tcase TJPF_ABGR:\n\t\t\tdinfo->out_color_space=JCS_RGB;  break;\n\t\t#endif\n\t\tcase TJPF_CMYK:\n\t\t\tdinfo->out_color_space=JCS_CMYK;  break;\n\t\tdefault:\n\t\t\t_throw(\"Unsupported pixel format\");\n\t}\n\n\tif(flags&TJFLAG_FASTDCT) dinfo->dct_method=JDCT_FASTEST;\n\n\tbailout:\n\treturn retval;\n}\n\n\nstatic int getSubsamp(j_decompress_ptr dinfo)\n{\n\tint retval=-1, i, k;\n\n\t/* The sampling factors actually have no meaning with grayscale JPEG files,\n\t   and in fact it's possible to generate grayscale JPEGs with sampling\n\t   factors > 1 (even though those sampling factors are ignored by the\n\t   decompressor.)  Thus, we need to treat grayscale as a special case. */\n\tif(dinfo->num_components==1 && dinfo->jpeg_color_space==JCS_GRAYSCALE)\n\t\treturn TJSAMP_GRAY;\n\n\tfor(i=0; i<NUMSUBOPT; i++)\n\t{\n\t\tif(dinfo->num_components==pixelsize[i]\n\t\t\t|| ((dinfo->jpeg_color_space==JCS_YCCK\n\t\t\t\t|| dinfo->jpeg_color_space==JCS_CMYK)\n\t\t\t\t\t&& pixelsize[i]==3 && dinfo->num_components==4))\n\t\t{\n\t\t\tif(dinfo->comp_info[0].h_samp_factor==tjMCUWidth[i]/8\n\t\t\t\t&& dinfo->comp_info[0].v_samp_factor==tjMCUHeight[i]/8)\n\t\t\t{\n\t\t\t\tint match=0;\n\t\t\t\tfor(k=1; k<dinfo->num_components; k++)\n\t\t\t\t{\n\t\t\t\t\tint href=1, vref=1;\n\t\t\t\t\tif(dinfo->jpeg_color_space==JCS_YCCK && k==3)\n\t\t\t\t\t{\n\t\t\t\t\t\thref=tjMCUWidth[i]/8;  vref=tjMCUHeight[i]/8;\n\t\t\t\t\t}\n\t\t\t\t\tif(dinfo->comp_info[k].h_samp_factor==href\n\t\t\t\t\t\t&& dinfo->comp_info[k].v_samp_factor==vref)\n\t\t\t\t\t\tmatch++;\n\t\t\t\t}\n\t\t\t\tif(match==dinfo->num_components-1)\n\t\t\t\t{\n\t\t\t\t\tretval=i;  break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn retval;\n}\n\n\n#ifndef JCS_EXTENSIONS\n\n/* Conversion functions to emulate the colorspace extensions.  This allows the\n   TurboJPEG wrapper to be used with libjpeg */\n\n#define TORGB(PS, ROFFSET, GOFFSET, BOFFSET) {  \\\n\tint rowPad=pitch-width*PS;  \\\n\twhile(height--)  \\\n\t{  \\\n\t\tunsigned char *endOfRow=src+width*PS;  \\\n\t\twhile(src<endOfRow)  \\\n\t\t{  \\\n\t\t\tdst[RGB_RED]=src[ROFFSET];  \\\n\t\t\tdst[RGB_GREEN]=src[GOFFSET];  \\\n\t\t\tdst[RGB_BLUE]=src[BOFFSET];  \\\n\t\t\tdst+=RGB_PIXELSIZE;  src+=PS;  \\\n\t\t}  \\\n\t\tsrc+=rowPad;  \\\n\t}  \\\n}\n\nstatic unsigned char *toRGB(unsigned char *src, int width, int pitch,\n\tint height, int pixelFormat, unsigned char *dst)\n{\n\tunsigned char *retval=src;\n\tswitch(pixelFormat)\n\t{\n\t\tcase TJPF_RGB:\n\t\t\t#if RGB_RED!=0 || RGB_GREEN!=1 || RGB_BLUE!=2 || RGB_PIXELSIZE!=3\n\t\t\tretval=dst;  TORGB(3, 0, 1, 2);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_BGR:\n\t\t\t#if RGB_RED!=2 || RGB_GREEN!=1 || RGB_BLUE!=0 || RGB_PIXELSIZE!=3\n\t\t\tretval=dst;  TORGB(3, 2, 1, 0);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_RGBX:\n\t\tcase TJPF_RGBA:\n\t\t\t#if RGB_RED!=0 || RGB_GREEN!=1 || RGB_BLUE!=2 || RGB_PIXELSIZE!=4\n\t\t\tretval=dst;  TORGB(4, 0, 1, 2);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_BGRX:\n\t\tcase TJPF_BGRA:\n\t\t\t#if RGB_RED!=2 || RGB_GREEN!=1 || RGB_BLUE!=0 || RGB_PIXELSIZE!=4\n\t\t\tretval=dst;  TORGB(4, 2, 1, 0);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_XRGB:\n\t\tcase TJPF_ARGB:\n\t\t\t#if RGB_RED!=1 || RGB_GREEN!=2 || RGB_BLUE!=3 || RGB_PIXELSIZE!=4\n\t\t\tretval=dst;  TORGB(4, 1, 2, 3);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_XBGR:\n\t\tcase TJPF_ABGR:\n\t\t\t#if RGB_RED!=3 || RGB_GREEN!=2 || RGB_BLUE!=1 || RGB_PIXELSIZE!=4\n\t\t\tretval=dst;  TORGB(4, 3, 2, 1);\n\t\t\t#endif\n\t\t\tbreak;\n\t}\n\treturn retval;\n}\n\n#define FROMRGB(PS, ROFFSET, GOFFSET, BOFFSET, SETALPHA) {  \\\n\tint rowPad=pitch-width*PS;  \\\n\twhile(height--)  \\\n\t{  \\\n\t\tunsigned char *endOfRow=dst+width*PS;  \\\n\t\twhile(dst<endOfRow)  \\\n\t\t{  \\\n\t\t\tdst[ROFFSET]=src[RGB_RED];  \\\n\t\t\tdst[GOFFSET]=src[RGB_GREEN];  \\\n\t\t\tdst[BOFFSET]=src[RGB_BLUE];  \\\n\t\t\tSETALPHA  \\\n\t\t\tdst+=PS;  src+=RGB_PIXELSIZE;  \\\n\t\t}  \\\n\t\tdst+=rowPad;  \\\n\t}  \\\n}\n\nstatic void fromRGB(unsigned char *src, unsigned char *dst, int width,\n\tint pitch, int height, int pixelFormat)\n{\n\tswitch(pixelFormat)\n\t{\n\t\tcase TJPF_RGB:\n\t\t\t#if RGB_RED!=0 || RGB_GREEN!=1 || RGB_BLUE!=2 || RGB_PIXELSIZE!=3\n\t\t\tFROMRGB(3, 0, 1, 2,);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_BGR:\n\t\t\t#if RGB_RED!=2 || RGB_GREEN!=1 || RGB_BLUE!=0 || RGB_PIXELSIZE!=3\n\t\t\tFROMRGB(3, 2, 1, 0,);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_RGBX:\n\t\t\t#if RGB_RED!=0 || RGB_GREEN!=1 || RGB_BLUE!=2 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 0, 1, 2,);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_RGBA:\n\t\t\t#if RGB_RED!=0 || RGB_GREEN!=1 || RGB_BLUE!=2 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 0, 1, 2, dst[3]=0xFF;);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_BGRX:\n\t\t\t#if RGB_RED!=2 || RGB_GREEN!=1 || RGB_BLUE!=0 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 2, 1, 0,);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_BGRA:\n\t\t\t#if RGB_RED!=2 || RGB_GREEN!=1 || RGB_BLUE!=0 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 2, 1, 0, dst[3]=0xFF;);  return;\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_XRGB:\n\t\t\t#if RGB_RED!=1 || RGB_GREEN!=2 || RGB_BLUE!=3 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 1, 2, 3,);  return;\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_ARGB:\n\t\t\t#if RGB_RED!=1 || RGB_GREEN!=2 || RGB_BLUE!=3 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 1, 2, 3, dst[0]=0xFF;);  return;\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_XBGR:\n\t\t\t#if RGB_RED!=3 || RGB_GREEN!=2 || RGB_BLUE!=1 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 3, 2, 1,);  return;\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_ABGR:\n\t\t\t#if RGB_RED!=3 || RGB_GREEN!=2 || RGB_BLUE!=1 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 3, 2, 1, dst[0]=0xFF;);  return;\n\t\t\t#endif\n\t\t\tbreak;\n\t}\n}\n\n#endif\n\n\n/* General API functions */\n\nDLLEXPORT char* DLLCALL tjGetErrorStr(void)\n{\n\treturn errStr;\n}\n\n\nDLLEXPORT int DLLCALL tjDestroy(tjhandle handle)\n{\n\tgetinstance(handle);\n\tif(setjmp(this->jerr.setjmp_buffer)) return -1;\n\tif(this->init&COMPRESS) jpeg_destroy_compress(cinfo);\n\tif(this->init&DECOMPRESS) jpeg_destroy_decompress(dinfo);\n\tfree(this);\n\treturn 0;\n}\n\n\n/* These are exposed mainly because Windows can't malloc() and free() across\n   DLL boundaries except when the CRT DLL is used, and we don't use the CRT DLL\n   with turbojpeg.dll for compatibility reasons.  However, these functions\n   can potentially be used for other purposes by different implementations. */\n\nDLLEXPORT void DLLCALL tjFree(unsigned char *buf)\n{\n\tif(buf) free(buf);\n}\n\n\nDLLEXPORT unsigned char *DLLCALL tjAlloc(int bytes)\n{\n\treturn (unsigned char *)malloc(bytes);\n}\n\n\n/* Compressor  */\n\nstatic tjhandle _tjInitCompress(tjinstance *this)\n{\n\tstatic unsigned char buffer[1];\n\tunsigned char *buf=buffer;  unsigned long size=1;\n\n\t/* This is also straight out of example.c */\n\tthis->cinfo.err=jpeg_std_error(&this->jerr.pub);\n\tthis->jerr.pub.error_exit=my_error_exit;\n\tthis->jerr.pub.output_message=my_output_message;\n\tthis->jerr.emit_message=this->jerr.pub.emit_message;\n\tthis->jerr.pub.emit_message=my_emit_message;\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tif(this) free(this);  return NULL;\n\t}\n\n\tjpeg_create_compress(&this->cinfo);\n\t/* Make an initial call so it will create the destination manager */\n\tjpeg_mem_dest_tj(&this->cinfo, &buf, &size, 0);\n\n\tthis->init|=COMPRESS;\n\treturn (tjhandle)this;\n}\n\nDLLEXPORT tjhandle DLLCALL tjInitCompress(void)\n{\n\ttjinstance *this=NULL;\n\tif((this=(tjinstance *)malloc(sizeof(tjinstance)))==NULL)\n\t{\n\t\tsnprintf(errStr, JMSG_LENGTH_MAX,\n\t\t\t\"tjInitCompress(): Memory allocation failure\");\n\t\treturn NULL;\n\t}\n\tMEMZERO(this, sizeof(tjinstance));\n\treturn _tjInitCompress(this);\n}\n\n\nDLLEXPORT unsigned long DLLCALL tjBufSize(int width, int height,\n\tint jpegSubsamp)\n{\n\tunsigned long retval=0;  int mcuw, mcuh, chromasf;\n\tif(width<1 || height<1 || jpegSubsamp<0 || jpegSubsamp>=NUMSUBOPT)\n\t\t_throw(\"tjBufSize(): Invalid argument\");\n\n\t/* This allows for rare corner cases in which a JPEG image can actually be\n\t   larger than the uncompressed input (we wouldn't mention it if it hadn't\n\t   happened before.) */\n\tmcuw=tjMCUWidth[jpegSubsamp];\n\tmcuh=tjMCUHeight[jpegSubsamp];\n\tchromasf=jpegSubsamp==TJSAMP_GRAY? 0: 4*64/(mcuw*mcuh);\n\tretval=PAD(width, mcuw) * PAD(height, mcuh) * (2 + chromasf) + 2048;\n\n\tbailout:\n\treturn retval;\n}\n\nDLLEXPORT unsigned long DLLCALL TJBUFSIZE(int width, int height)\n{\n\tunsigned long retval=0;\n\tif(width<1 || height<1)\n\t\t_throw(\"TJBUFSIZE(): Invalid argument\");\n\n\t/* This allows for rare corner cases in which a JPEG image can actually be\n\t   larger than the uncompressed input (we wouldn't mention it if it hadn't\n\t   happened before.) */\n\tretval=PAD(width, 16) * PAD(height, 16) * 6 + 2048;\n\n\tbailout:\n\treturn retval;\n}\n\n\nDLLEXPORT unsigned long DLLCALL tjBufSizeYUV2(int width, int pad, int height,\n\tint subsamp)\n{\n\tint retval=0, nc, i;\n\n\tif(subsamp<0 || subsamp>=NUMSUBOPT)\n\t\t_throw(\"tjBufSizeYUV2(): Invalid argument\");\n\n\tnc=(subsamp==TJSAMP_GRAY? 1:3);\n\tfor(i=0; i<nc; i++)\n\t{\n\t\tint pw=tjPlaneWidth(i, width, subsamp);\n\t\tint stride=PAD(pw, pad);\n\t\tint ph=tjPlaneHeight(i, height, subsamp);\n\t\tif(pw<0 || ph<0) return -1;\n\t\telse retval+=stride*ph;\n\t}\n\n\tbailout:\n\treturn retval;\n}\n\nDLLEXPORT unsigned long DLLCALL tjBufSizeYUV(int width, int height,\n\tint subsamp)\n{\n\treturn tjBufSizeYUV2(width, 4, height, subsamp);\n}\n\nDLLEXPORT unsigned long DLLCALL TJBUFSIZEYUV(int width, int height,\n\tint subsamp)\n{\n\treturn tjBufSizeYUV(width, height, subsamp);\n}\n\n\nDLLEXPORT int tjPlaneWidth(int componentID, int width, int subsamp)\n{\n\tint pw, nc, retval=0;\n\n\tif(width<1 || subsamp<0 || subsamp>=TJ_NUMSAMP)\n\t\t_throw(\"tjPlaneWidth(): Invalid argument\");\n\tnc=(subsamp==TJSAMP_GRAY? 1:3);\n\tif(componentID<0 || componentID>=nc)\n\t\t_throw(\"tjPlaneWidth(): Invalid argument\");\n\n\tpw=PAD(width, tjMCUWidth[subsamp]/8);\n\tif(componentID==0)\n\t\tretval=pw;\n\telse\n\t\tretval=pw*8/tjMCUWidth[subsamp];\n\n\tbailout:\n\treturn retval;\n}\n\n\nDLLEXPORT int tjPlaneHeight(int componentID, int height, int subsamp)\n{\n\tint ph, nc, retval=0;\n\n\tif(height<1 || subsamp<0 || subsamp>=TJ_NUMSAMP)\n\t\t_throw(\"tjPlaneHeight(): Invalid argument\");\n\tnc=(subsamp==TJSAMP_GRAY? 1:3);\n\tif(componentID<0 || componentID>=nc)\n\t\t_throw(\"tjPlaneHeight(): Invalid argument\");\n\n\tph=PAD(height, tjMCUHeight[subsamp]/8);\n\tif(componentID==0)\n\t\tretval=ph;\n\telse\n\t\tretval=ph*8/tjMCUHeight[subsamp];\n\n\tbailout:\n\treturn retval;\n}\n\n\nDLLEXPORT unsigned long DLLCALL tjPlaneSizeYUV(int componentID, int width,\n\tint stride, int height, int subsamp)\n{\n\tunsigned long retval=0;\n\tint pw, ph;\n\n\tif(width<1 || height<1 || subsamp<0 || subsamp>=NUMSUBOPT)\n\t\t_throw(\"tjPlaneSizeYUV(): Invalid argument\");\n\n\tpw=tjPlaneWidth(componentID, width, subsamp);\n\tph=tjPlaneHeight(componentID, height, subsamp);\n\tif(pw<0 || ph<0) return -1;\n\n\tif(stride==0) stride=pw;\n\telse stride=abs(stride);\n\n\tretval=stride*(ph-1)+pw;\n\n\tbailout:\n\treturn retval;\n}\n\n\nDLLEXPORT int DLLCALL tjCompress2(tjhandle handle, const unsigned char *srcBuf,\n\tint width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf,\n\tunsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags)\n{\n\tint i, retval=0, alloc=1;  JSAMPROW *row_pointer=NULL;\n\t#ifndef JCS_EXTENSIONS\n\tunsigned char *rgbBuf=NULL;\n\t#endif\n\n\tgetcinstance(handle)\n\tif((this->init&COMPRESS)==0)\n\t\t_throw(\"tjCompress2(): Instance has not been initialized for compression\");\n\n\tif(srcBuf==NULL || width<=0 || pitch<0 || height<=0 || pixelFormat<0\n\t\t|| pixelFormat>=TJ_NUMPF || jpegBuf==NULL || jpegSize==NULL\n\t\t|| jpegSubsamp<0 || jpegSubsamp>=NUMSUBOPT || jpegQual<0 || jpegQual>100)\n\t\t_throw(\"tjCompress2(): Invalid argument\");\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;\n\t\tgoto bailout;\n\t}\n\n\tif(pitch==0) pitch=width*tjPixelSize[pixelFormat];\n\n\t#ifndef JCS_EXTENSIONS\n\tif(pixelFormat!=TJPF_GRAY && pixelFormat!=TJPF_CMYK)\n\t{\n\t\trgbBuf=(unsigned char *)malloc(width*height*RGB_PIXELSIZE);\n\t\tif(!rgbBuf) _throw(\"tjCompress2(): Memory allocation failure\");\n\t\tsrcBuf=toRGB(srcBuf, width, pitch, height, pixelFormat, rgbBuf);\n\t\tpitch=width*RGB_PIXELSIZE;\n\t}\n\t#endif\n\n\tcinfo->image_width=width;\n\tcinfo->image_height=height;\n\n\tif(flags&TJFLAG_FORCEMMX) putenv(\"JSIMD_FORCEMMX=1\");\n\telse if(flags&TJFLAG_FORCESSE) putenv(\"JSIMD_FORCESSE=1\");\n\telse if(flags&TJFLAG_FORCESSE2) putenv(\"JSIMD_FORCESSE2=1\");\n\n\tif(flags&TJFLAG_NOREALLOC)\n\t{\n\t\talloc=0;  *jpegSize=tjBufSize(width, height, jpegSubsamp);\n\t}\n\tjpeg_mem_dest_tj(cinfo, jpegBuf, jpegSize, alloc);\n\tif(setCompDefaults(cinfo, pixelFormat, jpegSubsamp, jpegQual, flags)==-1)\n\t\treturn -1;\n\n\tjpeg_start_compress(cinfo, TRUE);\n\tif((row_pointer=(JSAMPROW *)malloc(sizeof(JSAMPROW)*height))==NULL)\n\t\t_throw(\"tjCompress2(): Memory allocation failure\");\n\tfor(i=0; i<height; i++)\n\t{\n\t\tif(flags&TJFLAG_BOTTOMUP)\n\t\t\trow_pointer[i]=(JSAMPROW)&srcBuf[(height-i-1)*pitch];\n\t\telse row_pointer[i]=(JSAMPROW)&srcBuf[i*pitch];\n\t}\n\twhile(cinfo->next_scanline<cinfo->image_height)\n\t{\n\t\tjpeg_write_scanlines(cinfo, &row_pointer[cinfo->next_scanline],\n\t\t\tcinfo->image_height-cinfo->next_scanline);\n\t}\n\tjpeg_finish_compress(cinfo);\n\n\tbailout:\n\tif(cinfo->global_state>CSTATE_START) jpeg_abort_compress(cinfo);\n\t#ifndef JCS_EXTENSIONS\n\tif(rgbBuf) free(rgbBuf);\n\t#endif\n\tif(row_pointer) free(row_pointer);\n\tif(this->jerr.warning) retval=-1;\n\treturn retval;\n}\n\nDLLEXPORT int DLLCALL tjCompress(tjhandle handle, unsigned char *srcBuf,\n\tint width, int pitch, int height, int pixelSize, unsigned char *jpegBuf,\n\tunsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags)\n{\n\tint retval=0;  unsigned long size;\n\tif(flags&TJ_YUV)\n\t{\n\t\tsize=tjBufSizeYUV(width, height, jpegSubsamp);\n\t\tretval=tjEncodeYUV2(handle, srcBuf, width, pitch, height,\n\t\t\tgetPixelFormat(pixelSize, flags), jpegBuf, jpegSubsamp, flags);\n\t}\n\telse\n\t{\n\t\tretval=tjCompress2(handle, srcBuf, width, pitch, height,\n\t\t\tgetPixelFormat(pixelSize, flags), &jpegBuf, &size, jpegSubsamp, jpegQual,\n\t\t\tflags|TJFLAG_NOREALLOC);\n\t}\n\t*jpegSize=size;\n\treturn retval;\n}\n\n\nDLLEXPORT int DLLCALL tjEncodeYUVPlanes(tjhandle handle,\n\tconst unsigned char *srcBuf, int width, int pitch, int height,\n\tint pixelFormat, unsigned char **dstPlanes, int *strides, int subsamp,\n\tint flags)\n{\n\tint i, retval=0;  JSAMPROW *row_pointer=NULL;\n\tJSAMPLE *_tmpbuf[MAX_COMPONENTS], *_tmpbuf2[MAX_COMPONENTS];\n\tJSAMPROW *tmpbuf[MAX_COMPONENTS], *tmpbuf2[MAX_COMPONENTS];\n\tJSAMPROW *outbuf[MAX_COMPONENTS];\n\tint row, pw0, ph0, pw[MAX_COMPONENTS], ph[MAX_COMPONENTS];\n\tJSAMPLE *ptr;\n\tjpeg_component_info *compptr;\n\t#ifndef JCS_EXTENSIONS\n\tunsigned char *rgbBuf=NULL;\n\t#endif\n\n\tgetcinstance(handle);\n\n\tfor(i=0; i<MAX_COMPONENTS; i++)\n\t{\n\t\ttmpbuf[i]=NULL;  _tmpbuf[i]=NULL;\n\t\ttmpbuf2[i]=NULL;  _tmpbuf2[i]=NULL;  outbuf[i]=NULL;\n\t}\n\n\tif((this->init&COMPRESS)==0)\n\t\t_throw(\"tjEncodeYUVPlanes(): Instance has not been initialized for compression\");\n\n\tif(srcBuf==NULL || width<=0 || pitch<0 || height<=0 || pixelFormat<0\n\t\t|| pixelFormat>=TJ_NUMPF || !dstPlanes || !dstPlanes[0] || subsamp<0\n\t\t|| subsamp>=NUMSUBOPT)\n\t\t_throw(\"tjEncodeYUVPlanes(): Invalid argument\");\n\tif(subsamp!=TJSAMP_GRAY && (!dstPlanes[1] || !dstPlanes[2]))\n\t\t_throw(\"tjEncodeYUVPlanes(): Invalid argument\");\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;\n\t\tgoto bailout;\n\t}\n\n\tif(pixelFormat==TJPF_CMYK)\n\t\t_throw(\"tjEncodeYUVPlanes(): Cannot generate YUV images from CMYK pixels\");\n\n\tif(pitch==0) pitch=width*tjPixelSize[pixelFormat];\n\n\t#ifndef JCS_EXTENSIONS\n\tif(pixelFormat!=TJPF_GRAY && pixelFormat!=TJPF_CMYK)\n\t{\n\t\trgbBuf=(unsigned char *)malloc(width*height*RGB_PIXELSIZE);\n\t\tif(!rgbBuf) _throw(\"tjEncodeYUVPlanes(): Memory allocation failure\");\n\t\tsrcBuf=toRGB(srcBuf, width, pitch, height, pixelFormat, rgbBuf);\n\t\tpitch=width*RGB_PIXELSIZE;\n\t}\n\t#endif\n\n\tcinfo->image_width=width;\n\tcinfo->image_height=height;\n\n\tif(flags&TJFLAG_FORCEMMX) putenv(\"JSIMD_FORCEMMX=1\");\n\telse if(flags&TJFLAG_FORCESSE) putenv(\"JSIMD_FORCESSE=1\");\n\telse if(flags&TJFLAG_FORCESSE2) putenv(\"JSIMD_FORCESSE2=1\");\n\n\tif(setCompDefaults(cinfo, pixelFormat, subsamp, -1, flags)==-1) return -1;\n\n\t/* Execute only the parts of jpeg_start_compress() that we need.  If we\n\t   were to call the whole jpeg_start_compress() function, then it would try\n\t   to write the file headers, which could overflow the output buffer if the\n\t   YUV image were very small. */\n\tif(cinfo->global_state!=CSTATE_START)\n\t\t_throw(\"tjEncodeYUVPlanes(): libjpeg API is in the wrong state\");\n\t(*cinfo->err->reset_error_mgr)((j_common_ptr)cinfo);\n\tjinit_c_master_control(cinfo, FALSE);\n\tjinit_color_converter(cinfo);\n\tjinit_downsampler(cinfo);\n\t(*cinfo->cconvert->start_pass)(cinfo);\n\n\tpw0=PAD(width, cinfo->max_h_samp_factor);\n\tph0=PAD(height, cinfo->max_v_samp_factor);\n\n\tif((row_pointer=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph0))==NULL)\n\t\t_throw(\"tjEncodeYUVPlanes(): Memory allocation failure\");\n\tfor(i=0; i<height; i++)\n\t{\n\t\tif(flags&TJFLAG_BOTTOMUP)\n\t\t\trow_pointer[i]=(JSAMPROW)&srcBuf[(height-i-1)*pitch];\n\t\telse row_pointer[i]=(JSAMPROW)&srcBuf[i*pitch];\n\t}\n\tif(height<ph0)\n\t\tfor(i=height; i<ph0; i++) row_pointer[i]=row_pointer[height-1];\n\n\tfor(i=0; i<cinfo->num_components; i++)\n\t{\n\t\tcompptr=&cinfo->comp_info[i];\n\t\t_tmpbuf[i]=(JSAMPLE *)malloc(\n\t\t\tPAD((compptr->width_in_blocks*cinfo->max_h_samp_factor*DCTSIZE)\n\t\t\t\t/compptr->h_samp_factor, 16) * cinfo->max_v_samp_factor + 16);\n\t\tif(!_tmpbuf[i]) _throw(\"tjEncodeYUVPlanes(): Memory allocation failure\");\n\t\ttmpbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*cinfo->max_v_samp_factor);\n\t\tif(!tmpbuf[i]) _throw(\"tjEncodeYUVPlanes(): Memory allocation failure\");\n\t\tfor(row=0; row<cinfo->max_v_samp_factor; row++)\n\t\t{\n\t\t\tunsigned char *_tmpbuf_aligned=\n\t\t\t\t(unsigned char *)PAD((size_t)_tmpbuf[i], 16);\n\t\t\ttmpbuf[i][row]=&_tmpbuf_aligned[\n\t\t\t\tPAD((compptr->width_in_blocks*cinfo->max_h_samp_factor*DCTSIZE)\n\t\t\t\t\t/compptr->h_samp_factor, 16) * row];\n\t\t}\n\t\t_tmpbuf2[i]=(JSAMPLE *)malloc(PAD(compptr->width_in_blocks*DCTSIZE, 16)\n\t\t\t* compptr->v_samp_factor + 16);\n\t\tif(!_tmpbuf2[i]) _throw(\"tjEncodeYUVPlanes(): Memory allocation failure\");\n\t\ttmpbuf2[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*compptr->v_samp_factor);\n\t\tif(!tmpbuf2[i]) _throw(\"tjEncodeYUVPlanes(): Memory allocation failure\");\n\t\tfor(row=0; row<compptr->v_samp_factor; row++)\n\t\t{\n\t\t\tunsigned char *_tmpbuf2_aligned=\n\t\t\t\t(unsigned char *)PAD((size_t)_tmpbuf2[i], 16);\n\t\t\ttmpbuf2[i][row]=&_tmpbuf2_aligned[\n\t\t\t\tPAD(compptr->width_in_blocks*DCTSIZE, 16) * row];\n\t\t}\n\t\tpw[i]=pw0*compptr->h_samp_factor/cinfo->max_h_samp_factor;\n\t\tph[i]=ph0*compptr->v_samp_factor/cinfo->max_v_samp_factor;\n\t\toutbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph[i]);\n\t\tif(!outbuf[i]) _throw(\"tjEncodeYUVPlanes(): Memory allocation failure\");\n\t\tptr=dstPlanes[i];\n\t\tfor(row=0; row<ph[i]; row++)\n\t\t{\n\t\t\toutbuf[i][row]=ptr;\n\t\t\tptr+=(strides && strides[i]!=0)? strides[i]:pw[i];\n\t\t}\n\t}\n\n\tfor(row=0; row<ph0; row+=cinfo->max_v_samp_factor)\n\t{\n\t\t(*cinfo->cconvert->color_convert)(cinfo, &row_pointer[row], tmpbuf, 0,\n\t\t\tcinfo->max_v_samp_factor);\n\t\t(cinfo->downsample->downsample)(cinfo, tmpbuf, 0, tmpbuf2, 0);\n\t\tfor(i=0, compptr=cinfo->comp_info; i<cinfo->num_components; i++, compptr++)\n\t\t\tjcopy_sample_rows(tmpbuf2[i], 0, outbuf[i],\n\t\t\t\trow*compptr->v_samp_factor/cinfo->max_v_samp_factor,\n\t\t\t\tcompptr->v_samp_factor, pw[i]);\n\t}\n\tcinfo->next_scanline+=height;\n\tjpeg_abort_compress(cinfo);\n\n\tbailout:\n\tif(cinfo->global_state>CSTATE_START) jpeg_abort_compress(cinfo);\n\t#ifndef JCS_EXTENSIONS\n\tif(rgbBuf) free(rgbBuf);\n\t#endif\n\tif(row_pointer) free(row_pointer);\n\tfor(i=0; i<MAX_COMPONENTS; i++)\n\t{\n\t\tif(tmpbuf[i]!=NULL) free(tmpbuf[i]);\n\t\tif(_tmpbuf[i]!=NULL) free(_tmpbuf[i]);\n\t\tif(tmpbuf2[i]!=NULL) free(tmpbuf2[i]);\n\t\tif(_tmpbuf2[i]!=NULL) free(_tmpbuf2[i]);\n\t\tif(outbuf[i]!=NULL) free(outbuf[i]);\n\t}\n\tif(this->jerr.warning) retval=-1;\n\treturn retval;\n}\n\nDLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle,\n\tconst unsigned char *srcBuf, int width, int pitch, int height,\n\tint pixelFormat, unsigned char *dstBuf, int pad, int subsamp, int flags)\n{\n\tunsigned char *dstPlanes[3];\n\tint pw0, ph0, strides[3], retval=-1;\n\n\tif(width<=0 || height<=0 || dstBuf==NULL || pad<0 || !isPow2(pad)\n\t\t|| subsamp<0 || subsamp>=NUMSUBOPT)\n\t\t_throw(\"tjEncodeYUV3(): Invalid argument\");\n\n\tpw0=tjPlaneWidth(0, width, subsamp);\n\tph0=tjPlaneHeight(0, height, subsamp);\n\tdstPlanes[0]=dstBuf;\n\tstrides[0]=PAD(pw0, pad);\n\tif(subsamp==TJSAMP_GRAY)\n\t{\n\t\tstrides[1]=strides[2]=0;\n\t\tdstPlanes[1]=dstPlanes[2]=NULL;\n\t}\n\telse\n\t{\n\t\tint pw1=tjPlaneWidth(1, width, subsamp);\n\t\tint ph1=tjPlaneHeight(1, height, subsamp);\n\t\tstrides[1]=strides[2]=PAD(pw1, pad);\n\t\tdstPlanes[1]=dstPlanes[0]+strides[0]*ph0;\n\t\tdstPlanes[2]=dstPlanes[1]+strides[1]*ph1;\n\t}\n\n\treturn tjEncodeYUVPlanes(handle, srcBuf, width, pitch, height, pixelFormat,\n\t\tdstPlanes, strides, subsamp, flags);\n\n\tbailout:\n\treturn retval;\n}\n\nDLLEXPORT int DLLCALL tjEncodeYUV2(tjhandle handle, unsigned char *srcBuf,\n\tint width, int pitch, int height, int pixelFormat, unsigned char *dstBuf,\n\tint subsamp, int flags)\n{\n\treturn tjEncodeYUV3(handle, srcBuf, width, pitch, height, pixelFormat,\n\t\tdstBuf, 4, subsamp, flags);\n}\n\nDLLEXPORT int DLLCALL tjEncodeYUV(tjhandle handle, unsigned char *srcBuf,\n\tint width, int pitch, int height, int pixelSize, unsigned char *dstBuf,\n\tint subsamp, int flags)\n{\n\treturn tjEncodeYUV2(handle, srcBuf, width, pitch, height,\n\t\tgetPixelFormat(pixelSize, flags), dstBuf, subsamp, flags);\n}\n\n\nDLLEXPORT int DLLCALL tjCompressFromYUVPlanes(tjhandle handle,\n\tconst unsigned char **srcPlanes, int width, const int *strides, int height,\n\tint subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual,\n\tint flags)\n{\n\tint i, row, retval=0, alloc=1;  JSAMPROW *inbuf[MAX_COMPONENTS];\n\tint pw[MAX_COMPONENTS], ph[MAX_COMPONENTS], iw[MAX_COMPONENTS],\n\t\ttmpbufsize=0, usetmpbuf=0, th[MAX_COMPONENTS];\n\tJSAMPLE *_tmpbuf=NULL, *ptr;  JSAMPROW *tmpbuf[MAX_COMPONENTS];\n\n\tgetcinstance(handle)\n\n\tfor(i=0; i<MAX_COMPONENTS; i++)\n\t{\n\t\ttmpbuf[i]=NULL;  inbuf[i]=NULL;\n\t}\n\n\tif((this->init&COMPRESS)==0)\n\t\t_throw(\"tjCompressFromYUVPlanes(): Instance has not been initialized for compression\");\n\n\tif(!srcPlanes || !srcPlanes[0] || width<=0 || height<=0 || subsamp<0\n\t\t|| subsamp>=NUMSUBOPT || jpegBuf==NULL || jpegSize==NULL || jpegQual<0\n\t\t|| jpegQual>100)\n\t\t_throw(\"tjCompressFromYUVPlanes(): Invalid argument\");\n\tif(subsamp!=TJSAMP_GRAY && (!srcPlanes[1] || !srcPlanes[2]))\n\t\t_throw(\"tjCompressFromYUVPlanes(): Invalid argument\");\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;\n\t\tgoto bailout;\n\t}\n\n\tcinfo->image_width=width;\n\tcinfo->image_height=height;\n\n\tif(flags&TJFLAG_FORCEMMX) putenv(\"JSIMD_FORCEMMX=1\");\n\telse if(flags&TJFLAG_FORCESSE) putenv(\"JSIMD_FORCESSE=1\");\n\telse if(flags&TJFLAG_FORCESSE2) putenv(\"JSIMD_FORCESSE2=1\");\n\n\tif(flags&TJFLAG_NOREALLOC)\n\t{\n\t\talloc=0;  *jpegSize=tjBufSize(width, height, subsamp);\n\t}\n\tjpeg_mem_dest_tj(cinfo, jpegBuf, jpegSize, alloc);\n\tif(setCompDefaults(cinfo, TJPF_RGB, subsamp, jpegQual, flags)==-1)\n\t\treturn -1;\n\tcinfo->raw_data_in=TRUE;\n\n\tjpeg_start_compress(cinfo, TRUE);\n\tfor(i=0; i<cinfo->num_components; i++)\n\t{\n\t\tjpeg_component_info *compptr=&cinfo->comp_info[i];\n\t\tint ih;\n\t\tiw[i]=compptr->width_in_blocks*DCTSIZE;\n\t\tih=compptr->height_in_blocks*DCTSIZE;\n\t\tpw[i]=PAD(cinfo->image_width, cinfo->max_h_samp_factor)\n\t\t\t*compptr->h_samp_factor/cinfo->max_h_samp_factor;\n\t\tph[i]=PAD(cinfo->image_height, cinfo->max_v_samp_factor)\n\t\t\t*compptr->v_samp_factor/cinfo->max_v_samp_factor;\n\t\tif(iw[i]!=pw[i] || ih!=ph[i]) usetmpbuf=1;\n\t\tth[i]=compptr->v_samp_factor*DCTSIZE;\n\t\ttmpbufsize+=iw[i]*th[i];\n\t\tif((inbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph[i]))==NULL)\n\t\t\t_throw(\"tjCompressFromYUVPlanes(): Memory allocation failure\");\n\t\tptr=(JSAMPLE *)srcPlanes[i];\n\t\tfor(row=0; row<ph[i]; row++)\n\t\t{\n\t\t\tinbuf[i][row]=ptr;\n\t\t\tptr+=(strides && strides[i]!=0)? strides[i]:pw[i];\n\t\t}\n\t}\n\tif(usetmpbuf)\n\t{\n\t\tif((_tmpbuf=(JSAMPLE *)malloc(sizeof(JSAMPLE)*tmpbufsize))==NULL)\n\t\t\t_throw(\"tjCompressFromYUVPlanes(): Memory allocation failure\");\n\t\tptr=_tmpbuf;\n\t\tfor(i=0; i<cinfo->num_components; i++)\n\t\t{\n\t\t\tif((tmpbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*th[i]))==NULL)\n\t\t\t\t_throw(\"tjCompressFromYUVPlanes(): Memory allocation failure\");\n\t\t\tfor(row=0; row<th[i]; row++)\n\t\t\t{\n\t\t\t\ttmpbuf[i][row]=ptr;\n\t\t\t\tptr+=iw[i];\n\t\t\t}\n\t\t}\n\t}\n\n\tfor(row=0; row<(int)cinfo->image_height;\n\t\trow+=cinfo->max_v_samp_factor*DCTSIZE)\n\t{\n\t\tJSAMPARRAY yuvptr[MAX_COMPONENTS];\n\t\tint crow[MAX_COMPONENTS];\n\t\tfor(i=0; i<cinfo->num_components; i++)\n\t\t{\n\t\t\tjpeg_component_info *compptr=&cinfo->comp_info[i];\n\t\t\tcrow[i]=row*compptr->v_samp_factor/cinfo->max_v_samp_factor;\n\t\t\tif(usetmpbuf)\n\t\t\t{\n\t\t\t\tint j, k;\n\t\t\t\tfor(j=0; j<min(th[i], ph[i]-crow[i]); j++)\n\t\t\t\t{\n\t\t\t\t\tmemcpy(tmpbuf[i][j], inbuf[i][crow[i]+j], pw[i]);\n\t\t\t\t\t/* Duplicate last sample in row to fill out MCU */\n\t\t\t\t\tfor(k=pw[i]; k<iw[i]; k++) tmpbuf[i][j][k]=tmpbuf[i][j][pw[i]-1];\n\t\t\t\t}\n\t\t\t\t/* Duplicate last row to fill out MCU */\n\t\t\t\tfor(j=ph[i]-crow[i]; j<th[i]; j++)\n\t\t\t\t\tmemcpy(tmpbuf[i][j], tmpbuf[i][ph[i]-crow[i]-1], iw[i]);\n\t\t\t\tyuvptr[i]=tmpbuf[i];\n\t\t\t}\n\t\t\telse\n\t\t\t\tyuvptr[i]=&inbuf[i][crow[i]];\n\t\t}\n\t\tjpeg_write_raw_data(cinfo, yuvptr, cinfo->max_v_samp_factor*DCTSIZE);\n\t}\n\tjpeg_finish_compress(cinfo);\n\n\tbailout:\n\tif(cinfo->global_state>CSTATE_START) jpeg_abort_compress(cinfo);\n\tfor(i=0; i<MAX_COMPONENTS; i++)\n\t{\n\t\tif(tmpbuf[i]) free(tmpbuf[i]);\n\t\tif(inbuf[i]) free(inbuf[i]);\n\t}\n\tif(_tmpbuf) free(_tmpbuf);\n\tif(this->jerr.warning) retval=-1;\n\treturn retval;\n}\n\nDLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle,\n\tconst unsigned char *srcBuf, int width, int pad, int height, int subsamp,\n\tunsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)\n{\n\tconst unsigned char *srcPlanes[3];\n\tint pw0, ph0, strides[3], retval=-1;\n\n\tif(srcBuf==NULL || width<=0 || pad<1 || height<=0 || subsamp<0\n\t\t|| subsamp>=NUMSUBOPT)\n\t\t_throw(\"tjCompressFromYUV(): Invalid argument\");\n\n\tpw0=tjPlaneWidth(0, width, subsamp);\n\tph0=tjPlaneHeight(0, height, subsamp);\n\tsrcPlanes[0]=srcBuf;\n\tstrides[0]=PAD(pw0, pad);\n\tif(subsamp==TJSAMP_GRAY)\n\t{\n\t\tstrides[1]=strides[2]=0;\n\t\tsrcPlanes[1]=srcPlanes[2]=NULL;\n\t}\n\telse\n\t{\n\t\tint pw1=tjPlaneWidth(1, width, subsamp);\n\t\tint ph1=tjPlaneHeight(1, height, subsamp);\n\t\tstrides[1]=strides[2]=PAD(pw1, pad);\n\t\tsrcPlanes[1]=srcPlanes[0]+strides[0]*ph0;\n\t\tsrcPlanes[2]=srcPlanes[1]+strides[1]*ph1;\n\t}\n\n\treturn tjCompressFromYUVPlanes(handle, srcPlanes, width, strides, height,\n\t\tsubsamp, jpegBuf, jpegSize, jpegQual, flags);\n\n\tbailout:\n\treturn retval;\n}\n\n\n/* Decompressor */\n\nstatic tjhandle _tjInitDecompress(tjinstance *this)\n{\n\tstatic unsigned char buffer[1];\n\n\t/* This is also straight out of example.c */\n\tthis->dinfo.err=jpeg_std_error(&this->jerr.pub);\n\tthis->jerr.pub.error_exit=my_error_exit;\n\tthis->jerr.pub.output_message=my_output_message;\n\tthis->jerr.emit_message=this->jerr.pub.emit_message;\n\tthis->jerr.pub.emit_message=my_emit_message;\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tif(this) free(this);  return NULL;\n\t}\n\n\tjpeg_create_decompress(&this->dinfo);\n\t/* Make an initial call so it will create the source manager */\n\tjpeg_mem_src_tj(&this->dinfo, buffer, 1);\n\n\tthis->init|=DECOMPRESS;\n\treturn (tjhandle)this;\n}\n\nDLLEXPORT tjhandle DLLCALL tjInitDecompress(void)\n{\n\ttjinstance *this;\n\tif((this=(tjinstance *)malloc(sizeof(tjinstance)))==NULL)\n\t{\n\t\tsnprintf(errStr, JMSG_LENGTH_MAX,\n\t\t\t\"tjInitDecompress(): Memory allocation failure\");\n\t\treturn NULL;\n\t}\n\tMEMZERO(this, sizeof(tjinstance));\n\treturn _tjInitDecompress(this);\n}\n\n\nDLLEXPORT int DLLCALL tjDecompressHeader3(tjhandle handle,\n\tconst unsigned char *jpegBuf, unsigned long jpegSize, int *width,\n\tint *height, int *jpegSubsamp, int *jpegColorspace)\n{\n\tint retval=0;\n\n\tgetdinstance(handle);\n\tif((this->init&DECOMPRESS)==0)\n\t\t_throw(\"tjDecompressHeader3(): Instance has not been initialized for decompression\");\n\n\tif(jpegBuf==NULL || jpegSize<=0 || width==NULL || height==NULL\n\t\t|| jpegSubsamp==NULL || jpegColorspace==NULL)\n\t\t_throw(\"tjDecompressHeader3(): Invalid argument\");\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\treturn -1;\n\t}\n\n\tjpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);\n\tjpeg_read_header(dinfo, TRUE);\n\n\t*width=dinfo->image_width;\n\t*height=dinfo->image_height;\n\t*jpegSubsamp=getSubsamp(dinfo);\n\tswitch(dinfo->jpeg_color_space)\n\t{\n\t\tcase JCS_GRAYSCALE:  *jpegColorspace=TJCS_GRAY;  break;\n\t\tcase JCS_RGB:        *jpegColorspace=TJCS_RGB;  break;\n\t\tcase JCS_YCbCr:      *jpegColorspace=TJCS_YCbCr;  break;\n\t\tcase JCS_CMYK:       *jpegColorspace=TJCS_CMYK;  break;\n\t\tcase JCS_YCCK:       *jpegColorspace=TJCS_YCCK;  break;\n\t\tdefault:             *jpegColorspace=-1;  break;\n\t}\n\n\tjpeg_abort_decompress(dinfo);\n\n\tif(*jpegSubsamp<0)\n\t\t_throw(\"tjDecompressHeader3(): Could not determine subsampling type for JPEG image\");\n\tif(*jpegColorspace<0)\n\t\t_throw(\"tjDecompressHeader3(): Could not determine colorspace of JPEG image\");\n\tif(*width<1 || *height<1)\n\t\t_throw(\"tjDecompressHeader3(): Invalid data returned in header\");\n\n\tbailout:\n\tif(this->jerr.warning) retval=-1;\n\treturn retval;\n}\n\nDLLEXPORT int DLLCALL tjDecompressHeader2(tjhandle handle,\n\tunsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height,\n\tint *jpegSubsamp)\n{\n\tint jpegColorspace;\n\treturn tjDecompressHeader3(handle, jpegBuf, jpegSize, width, height,\n\t\tjpegSubsamp, &jpegColorspace);\n}\n\nDLLEXPORT int DLLCALL tjDecompressHeader(tjhandle handle,\n\tunsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height)\n{\n\tint jpegSubsamp;\n\treturn tjDecompressHeader2(handle, jpegBuf, jpegSize, width, height,\n\t\t&jpegSubsamp);\n}\n\n\nDLLEXPORT tjscalingfactor* DLLCALL tjGetScalingFactors(int *numscalingfactors)\n{\n\tif(numscalingfactors==NULL)\n\t{\n\t\tsnprintf(errStr, JMSG_LENGTH_MAX,\n\t\t\t\"tjGetScalingFactors(): Invalid argument\");\n\t\treturn NULL;\n\t}\n\n\t*numscalingfactors=NUMSF;\n\treturn (tjscalingfactor *)sf;\n}\n\n\nDLLEXPORT int DLLCALL tjDecompress2(tjhandle handle,\n\tconst unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,\n\tint width, int pitch, int height, int pixelFormat, int flags)\n{\n\tint i, retval=0;  JSAMPROW *row_pointer=NULL;\n\tint jpegwidth, jpegheight, scaledw, scaledh;\n\t#ifndef JCS_EXTENSIONS\n\tunsigned char *rgbBuf=NULL;\n\tunsigned char *_dstBuf=NULL;  int _pitch=0;\n\t#endif\n\n\tgetdinstance(handle);\n\tif((this->init&DECOMPRESS)==0)\n\t\t_throw(\"tjDecompress2(): Instance has not been initialized for decompression\");\n\n\tif(jpegBuf==NULL || jpegSize<=0 || dstBuf==NULL || width<0 || pitch<0\n\t\t|| height<0 || pixelFormat<0 || pixelFormat>=TJ_NUMPF)\n\t\t_throw(\"tjDecompress2(): Invalid argument\");\n\n\tif(flags&TJFLAG_FORCEMMX) putenv(\"JSIMD_FORCEMMX=1\");\n\telse if(flags&TJFLAG_FORCESSE) putenv(\"JSIMD_FORCESSE=1\");\n\telse if(flags&TJFLAG_FORCESSE2) putenv(\"JSIMD_FORCESSE2=1\");\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;\n\t\tgoto bailout;\n\t}\n\n\tjpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);\n\tjpeg_read_header(dinfo, TRUE);\n\tif(setDecompDefaults(dinfo, pixelFormat, flags)==-1)\n\t{\n\t\tretval=-1;  goto bailout;\n\t}\n\n\tif(flags&TJFLAG_FASTUPSAMPLE) dinfo->do_fancy_upsampling=FALSE;\n\n\tjpegwidth=dinfo->image_width;  jpegheight=dinfo->image_height;\n\tif(width==0) width=jpegwidth;\n\tif(height==0) height=jpegheight;\n\tfor(i=0; i<NUMSF; i++)\n\t{\n\t\tscaledw=TJSCALED(jpegwidth, sf[i]);\n\t\tscaledh=TJSCALED(jpegheight, sf[i]);\n\t\tif(scaledw<=width && scaledh<=height)\n\t\t\tbreak;\n\t}\n\tif(i>=NUMSF)\n\t\t_throw(\"tjDecompress2(): Could not scale down to desired image dimensions\");\n\twidth=scaledw;  height=scaledh;\n\tdinfo->scale_num=sf[i].num;\n\tdinfo->scale_denom=sf[i].denom;\n\n\tjpeg_start_decompress(dinfo);\n\tif(pitch==0) pitch=dinfo->output_width*tjPixelSize[pixelFormat];\n\n\t#ifndef JCS_EXTENSIONS\n\tif(pixelFormat!=TJPF_GRAY && pixelFormat!=TJPF_CMYK &&\n\t\t(RGB_RED!=tjRedOffset[pixelFormat] ||\n\t\t\tRGB_GREEN!=tjGreenOffset[pixelFormat] ||\n\t\t\tRGB_BLUE!=tjBlueOffset[pixelFormat] ||\n\t\t\tRGB_PIXELSIZE!=tjPixelSize[pixelFormat]))\n\t{\n\t\trgbBuf=(unsigned char *)malloc(width*height*3);\n\t\tif(!rgbBuf) _throw(\"tjDecompress2(): Memory allocation failure\");\n\t\t_pitch=pitch;  pitch=width*3;\n\t\t_dstBuf=dstBuf;  dstBuf=rgbBuf;\n\t}\n\t#endif\n\n\tif((row_pointer=(JSAMPROW *)malloc(sizeof(JSAMPROW)\n\t\t*dinfo->output_height))==NULL)\n\t\t_throw(\"tjDecompress2(): Memory allocation failure\");\n\tfor(i=0; i<(int)dinfo->output_height; i++)\n\t{\n\t\tif(flags&TJFLAG_BOTTOMUP)\n\t\t\trow_pointer[i]=&dstBuf[(dinfo->output_height-i-1)*pitch];\n\t\telse row_pointer[i]=&dstBuf[i*pitch];\n\t}\n\twhile(dinfo->output_scanline<dinfo->output_height)\n\t{\n\t\tjpeg_read_scanlines(dinfo, &row_pointer[dinfo->output_scanline],\n\t\t\tdinfo->output_height-dinfo->output_scanline);\n\t}\n\tjpeg_finish_decompress(dinfo);\n\n\t#ifndef JCS_EXTENSIONS\n\tfromRGB(rgbBuf, _dstBuf, width, _pitch, height, pixelFormat);\n\t#endif\n\n\tbailout:\n\tif(dinfo->global_state>DSTATE_START) jpeg_abort_decompress(dinfo);\n\t#ifndef JCS_EXTENSIONS\n\tif(rgbBuf) free(rgbBuf);\n\t#endif\n\tif(row_pointer) free(row_pointer);\n\tif(this->jerr.warning) retval=-1;\n\treturn retval;\n}\n\nDLLEXPORT int DLLCALL tjDecompress(tjhandle handle, unsigned char *jpegBuf,\n\tunsigned long jpegSize, unsigned char *dstBuf, int width, int pitch,\n\tint height, int pixelSize, int flags)\n{\n\tif(flags&TJ_YUV)\n\t\treturn tjDecompressToYUV(handle, jpegBuf, jpegSize, dstBuf, flags);\n\telse\n\t\treturn tjDecompress2(handle, jpegBuf, jpegSize, dstBuf, width, pitch,\n\t\t\theight, getPixelFormat(pixelSize, flags), flags);\n}\n\n\nstatic int setDecodeDefaults(struct jpeg_decompress_struct *dinfo,\n\tint pixelFormat, int subsamp, int flags)\n{\n\tint i;\n\n\tdinfo->scale_num=dinfo->scale_denom=1;\n\n\tif(subsamp==TJSAMP_GRAY)\n\t{\n\t\tdinfo->num_components=dinfo->comps_in_scan=1;\n\t\tdinfo->jpeg_color_space=JCS_GRAYSCALE;\n\t}\n\telse\n\t{\n\t\tdinfo->num_components=dinfo->comps_in_scan=3;\n\t\tdinfo->jpeg_color_space=JCS_YCbCr;\n\t}\n\n\tdinfo->comp_info=(jpeg_component_info *)\n\t\t(*dinfo->mem->alloc_small)((j_common_ptr)dinfo, JPOOL_IMAGE,\n\t\t\tdinfo->num_components*sizeof(jpeg_component_info));\n\n\tfor(i=0; i<dinfo->num_components; i++)\n\t{\n\t\tjpeg_component_info *compptr=&dinfo->comp_info[i];\n\t\tcompptr->h_samp_factor=(i==0)? tjMCUWidth[subsamp]/8:1;\n\t\tcompptr->v_samp_factor=(i==0)? tjMCUHeight[subsamp]/8:1;\n\t\tcompptr->component_index=i;\n\t\tcompptr->component_id=i+1;\n\t\tcompptr->quant_tbl_no=compptr->dc_tbl_no=compptr->ac_tbl_no=\n\t\t\t(i==0)? 0:1;\n\t\tdinfo->cur_comp_info[i]=compptr;\n\t}\n\tdinfo->data_precision=8;\n\tfor(i=0; i<2; i++)\n\t{\n\t\tif(dinfo->quant_tbl_ptrs[i]==NULL)\n\t\t\tdinfo->quant_tbl_ptrs[i]=jpeg_alloc_quant_table((j_common_ptr)dinfo);\n\t}\n\n\treturn 0;\n}\n\n\nint my_read_markers(j_decompress_ptr dinfo)\n{\n\treturn JPEG_REACHED_SOS;\n}\n\nvoid my_reset_marker_reader(j_decompress_ptr dinfo)\n{\n}\n\nDLLEXPORT int DLLCALL tjDecodeYUVPlanes(tjhandle handle,\n\tconst unsigned char **srcPlanes, const int *strides, int subsamp,\n\tunsigned char *dstBuf, int width, int pitch, int height, int pixelFormat,\n\tint flags)\n{\n\tint i, retval=0;  JSAMPROW *row_pointer=NULL;\n\tJSAMPLE *_tmpbuf[MAX_COMPONENTS];\n\tJSAMPROW *tmpbuf[MAX_COMPONENTS], *inbuf[MAX_COMPONENTS];\n\tint row, pw0, ph0, pw[MAX_COMPONENTS], ph[MAX_COMPONENTS];\n\tJSAMPLE *ptr;\n\tjpeg_component_info *compptr;\n\t#ifndef JCS_EXTENSIONS\n\tunsigned char *rgbBuf=NULL;\n\tunsigned char *_dstBuf=NULL;  int _pitch=0;\n\t#endif\n\tint (*old_read_markers)(j_decompress_ptr);\n\tvoid (*old_reset_marker_reader)(j_decompress_ptr);\n\n\tgetdinstance(handle);\n\n\tfor(i=0; i<MAX_COMPONENTS; i++)\n\t{\n\t\ttmpbuf[i]=NULL;  _tmpbuf[i]=NULL;  inbuf[i]=NULL;\n\t}\n\n\tif((this->init&DECOMPRESS)==0)\n\t\t_throw(\"tjDecodeYUVPlanes(): Instance has not been initialized for decompression\");\n\n\tif(!srcPlanes || !srcPlanes[0] || subsamp<0 || subsamp>=NUMSUBOPT\n\t\t|| dstBuf==NULL || width<=0 || pitch<0 || height<=0 || pixelFormat<0\n\t\t|| pixelFormat>=TJ_NUMPF)\n\t\t_throw(\"tjDecodeYUVPlanes(): Invalid argument\");\n\tif(subsamp!=TJSAMP_GRAY && (!srcPlanes[1] || !srcPlanes[2]))\n\t\t_throw(\"tjDecodeYUVPlanes(): Invalid argument\");\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;\n\t\tgoto bailout;\n\t}\n\n\tif(pixelFormat==TJPF_CMYK)\n\t\t_throw(\"tjDecodeYUVPlanes(): Cannot decode YUV images into CMYK pixels.\");\n\n\tif(pitch==0) pitch=width*tjPixelSize[pixelFormat];\n\tdinfo->image_width=width;\n\tdinfo->image_height=height;\n\n\tif(flags&TJFLAG_FORCEMMX) putenv(\"JSIMD_FORCEMMX=1\");\n\telse if(flags&TJFLAG_FORCESSE) putenv(\"JSIMD_FORCESSE=1\");\n\telse if(flags&TJFLAG_FORCESSE2) putenv(\"JSIMD_FORCESSE2=1\");\n\n\tif(setDecodeDefaults(dinfo, pixelFormat, subsamp, flags)==-1)\n\t{\n\t\tretval=-1;  goto bailout;\n\t}\n\told_read_markers=dinfo->marker->read_markers;\n\tdinfo->marker->read_markers=my_read_markers;\n\told_reset_marker_reader=dinfo->marker->reset_marker_reader;\n\tdinfo->marker->reset_marker_reader=my_reset_marker_reader;\n\tjpeg_read_header(dinfo, TRUE);\n\tdinfo->marker->read_markers=old_read_markers;\n\tdinfo->marker->reset_marker_reader=old_reset_marker_reader;\n\n\tif(setDecompDefaults(dinfo, pixelFormat, flags)==-1)\n\t{\n\t\tretval=-1;  goto bailout;\n\t}\n\tdinfo->do_fancy_upsampling=FALSE;\n\tdinfo->Se=DCTSIZE2-1;\n\tjinit_master_decompress(dinfo);\n\t(*dinfo->upsample->start_pass)(dinfo);\n\n\tpw0=PAD(width, dinfo->max_h_samp_factor);\n\tph0=PAD(height, dinfo->max_v_samp_factor);\n\n\tif(pitch==0) pitch=dinfo->output_width*tjPixelSize[pixelFormat];\n\n\t#ifndef JCS_EXTENSIONS\n\tif(pixelFormat!=TJPF_GRAY && pixelFormat!=TJPF_CMYK &&\n\t\t(RGB_RED!=tjRedOffset[pixelFormat] ||\n\t\t\tRGB_GREEN!=tjGreenOffset[pixelFormat] ||\n\t\t\tRGB_BLUE!=tjBlueOffset[pixelFormat] ||\n\t\t\tRGB_PIXELSIZE!=tjPixelSize[pixelFormat]))\n\t{\n\t\trgbBuf=(unsigned char *)malloc(width*height*3);\n\t\tif(!rgbBuf) _throw(\"tjDecodeYUVPlanes(): Memory allocation failure\");\n\t\t_pitch=pitch;  pitch=width*3;\n\t\t_dstBuf=dstBuf;  dstBuf=rgbBuf;\n\t}\n\t#endif\n\n\tif((row_pointer=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph0))==NULL)\n\t\t_throw(\"tjDecodeYUVPlanes(): Memory allocation failure\");\n\tfor(i=0; i<height; i++)\n\t{\n\t\tif(flags&TJFLAG_BOTTOMUP) row_pointer[i]=&dstBuf[(height-i-1)*pitch];\n\t\telse row_pointer[i]=&dstBuf[i*pitch];\n\t}\n\tif(height<ph0)\n\t\tfor(i=height; i<ph0; i++) row_pointer[i]=row_pointer[height-1];\n\n\tfor(i=0; i<dinfo->num_components; i++)\n\t{\n\t\tcompptr=&dinfo->comp_info[i];\n\t\t_tmpbuf[i]=(JSAMPLE *)malloc(PAD(compptr->width_in_blocks*DCTSIZE, 16)\n\t\t\t* compptr->v_samp_factor + 16);\n\t\tif(!_tmpbuf[i]) _throw(\"tjDecodeYUVPlanes(): Memory allocation failure\");\n\t\ttmpbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*compptr->v_samp_factor);\n\t\tif(!tmpbuf[i]) _throw(\"tjDecodeYUVPlanes(): Memory allocation failure\");\n\t\tfor(row=0; row<compptr->v_samp_factor; row++)\n\t\t{\n\t\t\tunsigned char *_tmpbuf_aligned=\n\t\t\t\t(unsigned char *)PAD((size_t)_tmpbuf[i], 16);\n\t\t\ttmpbuf[i][row]=&_tmpbuf_aligned[\n\t\t\t\tPAD(compptr->width_in_blocks*DCTSIZE, 16) * row];\n\t\t}\n\t\tpw[i]=pw0*compptr->h_samp_factor/dinfo->max_h_samp_factor;\n\t\tph[i]=ph0*compptr->v_samp_factor/dinfo->max_v_samp_factor;\n\t\tinbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph[i]);\n\t\tif(!inbuf[i]) _throw(\"tjDecodeYUVPlanes(): Memory allocation failure\");\n\t\tptr=(JSAMPLE *)srcPlanes[i];\n\t\tfor(row=0; row<ph[i]; row++)\n\t\t{\n\t\t\tinbuf[i][row]=ptr;\n\t\t\tptr+=(strides && strides[i]!=0)? strides[i]:pw[i];\n\t\t}\n\t}\n\n\tfor(row=0; row<ph0; row+=dinfo->max_v_samp_factor)\n\t{\n\t\tJDIMENSION inrow=0, outrow=0;\n\t\tfor(i=0, compptr=dinfo->comp_info; i<dinfo->num_components; i++, compptr++)\n\t\t\tjcopy_sample_rows(inbuf[i],\n\t\t\t\trow*compptr->v_samp_factor/dinfo->max_v_samp_factor, tmpbuf[i], 0,\n\t\t\t\tcompptr->v_samp_factor, pw[i]);\n\t\t(dinfo->upsample->upsample)(dinfo, tmpbuf, &inrow,\n\t\t\tdinfo->max_v_samp_factor, &row_pointer[row], &outrow,\n\t\t\tdinfo->max_v_samp_factor);\n\t}\n\tjpeg_abort_decompress(dinfo);\n\n\t#ifndef JCS_EXTENSIONS\n\tfromRGB(rgbBuf, _dstBuf, width, _pitch, height, pixelFormat);\n\t#endif\n\n\tbailout:\n\tif(dinfo->global_state>DSTATE_START) jpeg_abort_decompress(dinfo);\n\t#ifndef JCS_EXTENSIONS\n\tif(rgbBuf) free(rgbBuf);\n\t#endif\n\tif(row_pointer) free(row_pointer);\n\tfor(i=0; i<MAX_COMPONENTS; i++)\n\t{\n\t\tif(tmpbuf[i]!=NULL) free(tmpbuf[i]);\n\t\tif(_tmpbuf[i]!=NULL) free(_tmpbuf[i]);\n\t\tif(inbuf[i]!=NULL) free(inbuf[i]);\n\t}\n\tif(this->jerr.warning) retval=-1;\n\treturn retval;\n}\n\nDLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, const unsigned char *srcBuf,\n\tint pad, int subsamp, unsigned char *dstBuf, int width, int pitch,\n\tint height, int pixelFormat, int flags)\n{\n\tconst unsigned char *srcPlanes[3];\n\tint pw0, ph0, strides[3], retval=-1;\n\n\tif(srcBuf==NULL || pad<0 || !isPow2(pad) || subsamp<0 || subsamp>=NUMSUBOPT\n\t\t|| width<=0 || height<=0)\n\t\t_throw(\"tjDecodeYUV(): Invalid argument\");\n\n\tpw0=tjPlaneWidth(0, width, subsamp);\n\tph0=tjPlaneHeight(0, height, subsamp);\n\tsrcPlanes[0]=srcBuf;\n\tstrides[0]=PAD(pw0, pad);\n\tif(subsamp==TJSAMP_GRAY)\n\t{\n\t\tstrides[1]=strides[2]=0;\n\t\tsrcPlanes[1]=srcPlanes[2]=NULL;\n\t}\n\telse\n\t{\n\t\tint pw1=tjPlaneWidth(1, width, subsamp);\n\t\tint ph1=tjPlaneHeight(1, height, subsamp);\n\t\tstrides[1]=strides[2]=PAD(pw1, pad);\n\t\tsrcPlanes[1]=srcPlanes[0]+strides[0]*ph0;\n\t\tsrcPlanes[2]=srcPlanes[1]+strides[1]*ph1;\n\t}\n\n\treturn tjDecodeYUVPlanes(handle, srcPlanes, strides, subsamp, dstBuf, width,\n\t\tpitch, height, pixelFormat, flags);\n\n\tbailout:\n\treturn retval;\n}\n\nDLLEXPORT int DLLCALL tjDecompressToYUVPlanes(tjhandle handle,\n\tconst unsigned char *jpegBuf, unsigned long jpegSize,\n\tunsigned char **dstPlanes, int width, int *strides, int height, int flags)\n{\n\tint i, sfi, row, retval=0;  JSAMPROW *outbuf[MAX_COMPONENTS];\n\tint jpegwidth, jpegheight, jpegSubsamp, scaledw, scaledh;\n\tint pw[MAX_COMPONENTS], ph[MAX_COMPONENTS], iw[MAX_COMPONENTS],\n\t\ttmpbufsize=0, usetmpbuf=0, th[MAX_COMPONENTS];\n\tJSAMPLE *_tmpbuf=NULL, *ptr;  JSAMPROW *tmpbuf[MAX_COMPONENTS];\n\tint dctsize;\n\n\tgetdinstance(handle);\n\n\tfor(i=0; i<MAX_COMPONENTS; i++)\n\t{\n\t\ttmpbuf[i]=NULL;  outbuf[i]=NULL;\n\t}\n\n\tif((this->init&DECOMPRESS)==0)\n\t\t_throw(\"tjDecompressToYUVPlanes(): Instance has not been initialized for decompression\");\n\n\tif(jpegBuf==NULL || jpegSize<=0 || !dstPlanes || !dstPlanes[0] || width<0\n\t\t|| height<0)\n\t\t_throw(\"tjDecompressToYUVPlanes(): Invalid argument\");\n\n\tif(flags&TJFLAG_FORCEMMX) putenv(\"JSIMD_FORCEMMX=1\");\n\telse if(flags&TJFLAG_FORCESSE) putenv(\"JSIMD_FORCESSE=1\");\n\telse if(flags&TJFLAG_FORCESSE2) putenv(\"JSIMD_FORCESSE2=1\");\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;\n\t\tgoto bailout;\n\t}\n\n\tif(!this->headerRead)\n\t{\n\t\tjpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);\n\t\tjpeg_read_header(dinfo, TRUE);\n\t}\n\tthis->headerRead=0;\n\tjpegSubsamp=getSubsamp(dinfo);\n\tif(jpegSubsamp<0)\n\t\t_throw(\"tjDecompressToYUVPlanes(): Could not determine subsampling type for JPEG image\");\n\n\tif(jpegSubsamp!=TJSAMP_GRAY && (!dstPlanes[1] || !dstPlanes[2]))\n\t\t_throw(\"tjDecompressToYUVPlanes(): Invalid argument\");\n\n\tjpegwidth=dinfo->image_width;  jpegheight=dinfo->image_height;\n\tif(width==0) width=jpegwidth;\n\tif(height==0) height=jpegheight;\n\tfor(i=0; i<NUMSF; i++)\n\t{\n\t\tscaledw=TJSCALED(jpegwidth, sf[i]);\n\t\tscaledh=TJSCALED(jpegheight, sf[i]);\n\t\tif(scaledw<=width && scaledh<=height)\n\t\t\tbreak;\n\t}\n\tif(i>=NUMSF)\n\t\t_throw(\"tjDecompressToYUVPlanes(): Could not scale down to desired image dimensions\");\n\tif(dinfo->num_components>3)\n\t\t_throw(\"tjDecompressToYUVPlanes(): JPEG image must have 3 or fewer components\");\n\n\twidth=scaledw;  height=scaledh;\n\tdinfo->scale_num=sf[i].num;\n\tdinfo->scale_denom=sf[i].denom;\n\tsfi=i;\n\tjpeg_calc_output_dimensions(dinfo);\n\n\tdctsize=DCTSIZE*sf[sfi].num/sf[sfi].denom;\n\n\tfor(i=0; i<dinfo->num_components; i++)\n\t{\n\t\tjpeg_component_info *compptr=&dinfo->comp_info[i];\n\t\tint ih;\n\t\tiw[i]=compptr->width_in_blocks*dctsize;\n\t\tih=compptr->height_in_blocks*dctsize;\n\t\tpw[i]=PAD(dinfo->output_width, dinfo->max_h_samp_factor)\n\t\t\t*compptr->h_samp_factor/dinfo->max_h_samp_factor;\n\t\tph[i]=PAD(dinfo->output_height, dinfo->max_v_samp_factor)\n\t\t\t*compptr->v_samp_factor/dinfo->max_v_samp_factor;\n\t\tif(iw[i]!=pw[i] || ih!=ph[i]) usetmpbuf=1;\n\t\tth[i]=compptr->v_samp_factor*dctsize;\n\t\ttmpbufsize+=iw[i]*th[i];\n\t\tif((outbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph[i]))==NULL)\n\t\t\t_throw(\"tjDecompressToYUVPlanes(): Memory allocation failure\");\n\t\tptr=dstPlanes[i];\n\t\tfor(row=0; row<ph[i]; row++)\n\t\t{\n\t\t\toutbuf[i][row]=ptr;\n\t\t\tptr+=(strides && strides[i]!=0)? strides[i]:pw[i];\n\t\t}\n\t}\n\tif(usetmpbuf)\n\t{\n\t\tif((_tmpbuf=(JSAMPLE *)malloc(sizeof(JSAMPLE)*tmpbufsize))==NULL)\n\t\t\t_throw(\"tjDecompressToYUVPlanes(): Memory allocation failure\");\n\t\tptr=_tmpbuf;\n\t\tfor(i=0; i<dinfo->num_components; i++)\n\t\t{\n\t\t\tif((tmpbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*th[i]))==NULL)\n\t\t\t\t_throw(\"tjDecompressToYUVPlanes(): Memory allocation failure\");\n\t\t\tfor(row=0; row<th[i]; row++)\n\t\t\t{\n\t\t\t\ttmpbuf[i][row]=ptr;\n\t\t\t\tptr+=iw[i];\n\t\t\t}\n\t\t}\n\t}\n\n\tif(flags&TJFLAG_FASTUPSAMPLE) dinfo->do_fancy_upsampling=FALSE;\n\tif(flags&TJFLAG_FASTDCT) dinfo->dct_method=JDCT_FASTEST;\n\tdinfo->raw_data_out=TRUE;\n\n\tjpeg_start_decompress(dinfo);\n\tfor(row=0; row<(int)dinfo->output_height;\n\t\trow+=dinfo->max_v_samp_factor*dinfo->_min_DCT_scaled_size)\n\t{\n\t\tJSAMPARRAY yuvptr[MAX_COMPONENTS];\n\t\tint crow[MAX_COMPONENTS];\n\t\tfor(i=0; i<dinfo->num_components; i++)\n\t\t{\n\t\t\tjpeg_component_info *compptr=&dinfo->comp_info[i];\n\t\t\tif(jpegSubsamp==TJ_420)\n\t\t\t{\n\t\t\t\t/* When 4:2:0 subsampling is used with IDCT scaling, libjpeg will try\n\t\t\t\t   to be clever and use the IDCT to perform upsampling on the U and V\n\t\t\t\t   planes.  For instance, if the output image is to be scaled by 1/2\n\t\t\t\t   relative to the JPEG image, then the scaling factor and upsampling\n\t\t\t\t   effectively cancel each other, so a normal 8x8 IDCT can be used.\n\t\t\t\t   However, this is not desirable when using the decompress-to-YUV\n\t\t\t\t   functionality in TurboJPEG, since we want to output the U and V\n\t\t\t\t   planes in their subsampled form.  Thus, we have to override some\n\t\t\t\t   internal libjpeg parameters to force it to use the \"scaled\" IDCT\n\t\t\t\t   functions on the U and V planes. */\n\t\t\t\tcompptr->_DCT_scaled_size=dctsize;\n\t\t\t\tcompptr->MCU_sample_width=tjMCUWidth[jpegSubsamp]*\n\t\t\t\t\tsf[sfi].num/sf[sfi].denom*\n\t\t\t\t\tcompptr->v_samp_factor/dinfo->max_v_samp_factor;\n\t\t\t\tdinfo->idct->inverse_DCT[i] = dinfo->idct->inverse_DCT[0];\n\t\t\t}\n\t\t\tcrow[i]=row*compptr->v_samp_factor/dinfo->max_v_samp_factor;\n\t\t\tif(usetmpbuf) yuvptr[i]=tmpbuf[i];\n\t\t\telse yuvptr[i]=&outbuf[i][crow[i]];\n\t\t}\n\t\tjpeg_read_raw_data(dinfo, yuvptr,\n\t\t\tdinfo->max_v_samp_factor*dinfo->_min_DCT_scaled_size);\n\t\tif(usetmpbuf)\n\t\t{\n\t\t\tint j;\n\t\t\tfor(i=0; i<dinfo->num_components; i++)\n\t\t\t{\n\t\t\t\tfor(j=0; j<min(th[i], ph[i]-crow[i]); j++)\n\t\t\t\t{\n\t\t\t\t\tmemcpy(outbuf[i][crow[i]+j], tmpbuf[i][j], pw[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tjpeg_finish_decompress(dinfo);\n\n\tbailout:\n\tif(dinfo->global_state>DSTATE_START) jpeg_abort_decompress(dinfo);\n\tfor(i=0; i<MAX_COMPONENTS; i++)\n\t{\n\t\tif(tmpbuf[i]) free(tmpbuf[i]);\n\t\tif(outbuf[i]) free(outbuf[i]);\n\t}\n\tif(_tmpbuf) free(_tmpbuf);\n\tif(this->jerr.warning) retval=-1;\n\treturn retval;\n}\n\nDLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,\n\tconst unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,\n\tint width, int pad, int height, int flags)\n{\n\tunsigned char *dstPlanes[3];\n\tint pw0, ph0, strides[3], retval=-1, jpegSubsamp=-1;\n\tint i, jpegwidth, jpegheight, scaledw, scaledh;\n\n\tgetdinstance(handle);\n\n\tif(jpegBuf==NULL || jpegSize<=0 || dstBuf==NULL || width<0 || pad<1\n\t\t|| !isPow2(pad) || height<0)\n\t\t_throw(\"tjDecompressToYUV2(): Invalid argument\");\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\treturn -1;\n\t}\n\n\tjpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);\n\tjpeg_read_header(dinfo, TRUE);\n\tjpegSubsamp=getSubsamp(dinfo);\n\tif(jpegSubsamp<0)\n\t\t_throw(\"tjDecompressToYUV2(): Could not determine subsampling type for JPEG image\");\n\n\tjpegwidth=dinfo->image_width;  jpegheight=dinfo->image_height;\n\tif(width==0) width=jpegwidth;\n\tif(height==0) height=jpegheight;\n\n\tfor(i=0; i<NUMSF; i++)\n\t{\n\t\tscaledw=TJSCALED(jpegwidth, sf[i]);\n\t\tscaledh=TJSCALED(jpegheight, sf[i]);\n\t\tif(scaledw<=width && scaledh<=height)\n\t\t\tbreak;\n\t}\n\tif(i>=NUMSF)\n\t\t_throw(\"tjDecompressToYUV2(): Could not scale down to desired image dimensions\");\n\n\tpw0=tjPlaneWidth(0, width, jpegSubsamp);\n\tph0=tjPlaneHeight(0, height, jpegSubsamp);\n\tdstPlanes[0]=dstBuf;\n\tstrides[0]=PAD(pw0, pad);\n\tif(jpegSubsamp==TJSAMP_GRAY)\n\t{\n\t\tstrides[1]=strides[2]=0;\n\t\tdstPlanes[1]=dstPlanes[2]=NULL;\n\t}\n\telse\n\t{\n\t\tint pw1=tjPlaneWidth(1, width, jpegSubsamp);\n\t\tint ph1=tjPlaneHeight(1, height, jpegSubsamp);\n\t\tstrides[1]=strides[2]=PAD(pw1, pad);\n\t\tdstPlanes[1]=dstPlanes[0]+strides[0]*ph0;\n\t\tdstPlanes[2]=dstPlanes[1]+strides[1]*ph1;\n\t}\n\n\tthis->headerRead=1;\n\treturn tjDecompressToYUVPlanes(handle, jpegBuf, jpegSize, dstPlanes, width,\n\t\tstrides, height, flags);\n\n\tbailout:\n\treturn retval;\n\n}\n\nDLLEXPORT int DLLCALL tjDecompressToYUV(tjhandle handle,\n\tunsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,\n\tint flags)\n{\n\treturn tjDecompressToYUV2(handle, jpegBuf, jpegSize, dstBuf, 0, 4, 0, flags);\n}\n\n\n/* Transformer */\n\nDLLEXPORT tjhandle DLLCALL tjInitTransform(void)\n{\n\ttjinstance *this=NULL;  tjhandle handle=NULL;\n\tif((this=(tjinstance *)malloc(sizeof(tjinstance)))==NULL)\n\t{\n\t\tsnprintf(errStr, JMSG_LENGTH_MAX,\n\t\t\t\"tjInitTransform(): Memory allocation failure\");\n\t\treturn NULL;\n\t}\n\tMEMZERO(this, sizeof(tjinstance));\n\thandle=_tjInitCompress(this);\n\tif(!handle) return NULL;\n\thandle=_tjInitDecompress(this);\n\treturn handle;\n}\n\n\nDLLEXPORT int DLLCALL tjTransform(tjhandle handle,\n\tconst unsigned char *jpegBuf, unsigned long jpegSize, int n,\n\tunsigned char **dstBufs, unsigned long *dstSizes, tjtransform *t, int flags)\n{\n\tjpeg_transform_info *xinfo=NULL;\n\tjvirt_barray_ptr *srccoefs, *dstcoefs;\n\tint retval=0, i, jpegSubsamp;\n\n\tgetinstance(handle);\n\tif((this->init&COMPRESS)==0 || (this->init&DECOMPRESS)==0)\n\t\t_throw(\"tjTransform(): Instance has not been initialized for transformation\");\n\n\tif(jpegBuf==NULL || jpegSize<=0 || n<1 || dstBufs==NULL || dstSizes==NULL\n\t\t|| t==NULL || flags<0)\n\t\t_throw(\"tjTransform(): Invalid argument\");\n\n\tif(flags&TJFLAG_FORCEMMX) putenv(\"JSIMD_FORCEMMX=1\");\n\telse if(flags&TJFLAG_FORCESSE) putenv(\"JSIMD_FORCESSE=1\");\n\telse if(flags&TJFLAG_FORCESSE2) putenv(\"JSIMD_FORCESSE2=1\");\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;\n\t\tgoto bailout;\n\t}\n\n\tjpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);\n\n\tif((xinfo=(jpeg_transform_info *)malloc(sizeof(jpeg_transform_info)*n))\n\t\t==NULL)\n\t\t_throw(\"tjTransform(): Memory allocation failure\");\n\tMEMZERO(xinfo, sizeof(jpeg_transform_info)*n);\n\n\tfor(i=0; i<n; i++)\n\t{\n\t\txinfo[i].transform=xformtypes[t[i].op];\n\t\txinfo[i].perfect=(t[i].options&TJXOPT_PERFECT)? 1:0;\n\t\txinfo[i].trim=(t[i].options&TJXOPT_TRIM)? 1:0;\n\t\txinfo[i].force_grayscale=(t[i].options&TJXOPT_GRAY)? 1:0;\n\t\txinfo[i].crop=(t[i].options&TJXOPT_CROP)? 1:0;\n\t\tif(n!=1 && t[i].op==TJXOP_HFLIP) xinfo[i].slow_hflip=1;\n\t\telse xinfo[i].slow_hflip=0;\n\n\t\tif(xinfo[i].crop)\n\t\t{\n\t\t\txinfo[i].crop_xoffset=t[i].r.x;  xinfo[i].crop_xoffset_set=JCROP_POS;\n\t\t\txinfo[i].crop_yoffset=t[i].r.y;  xinfo[i].crop_yoffset_set=JCROP_POS;\n\t\t\tif(t[i].r.w!=0)\n\t\t\t{\n\t\t\t\txinfo[i].crop_width=t[i].r.w;  xinfo[i].crop_width_set=JCROP_POS;\n\t\t\t}\n\t\t\telse xinfo[i].crop_width=JCROP_UNSET;\n\t\t\tif(t[i].r.h!=0)\n\t\t\t{\n\t\t\t\txinfo[i].crop_height=t[i].r.h;  xinfo[i].crop_height_set=JCROP_POS;\n\t\t\t}\n\t\t\telse xinfo[i].crop_height=JCROP_UNSET;\n\t\t}\n\t}\n\n\tjcopy_markers_setup(dinfo, JCOPYOPT_ALL);\n\tjpeg_read_header(dinfo, TRUE);\n\tjpegSubsamp=getSubsamp(dinfo);\n\tif(jpegSubsamp<0)\n\t\t_throw(\"tjTransform(): Could not determine subsampling type for JPEG image\");\n\n\tfor(i=0; i<n; i++)\n\t{\n\t\tif(!jtransform_request_workspace(dinfo, &xinfo[i]))\n\t\t\t_throw(\"tjTransform(): Transform is not perfect\");\n\n\t\tif(xinfo[i].crop)\n\t\t{\n\t\t\tif((t[i].r.x%xinfo[i].iMCU_sample_width)!=0\n\t\t\t\t|| (t[i].r.y%xinfo[i].iMCU_sample_height)!=0)\n\t\t\t{\n\t\t\t\tsnprintf(errStr, JMSG_LENGTH_MAX,\n\t\t\t\t\t\"To crop this JPEG image, x must be a multiple of %d\\n\"\n\t\t\t\t\t\"and y must be a multiple of %d.\\n\",\n\t\t\t\t\txinfo[i].iMCU_sample_width, xinfo[i].iMCU_sample_height);\n\t\t\t\tretval=-1;  goto bailout;\n\t\t\t}\n\t\t}\n\t}\n\n\tsrccoefs=jpeg_read_coefficients(dinfo);\n\n\tfor(i=0; i<n; i++)\n\t{\n\t\tint w, h, alloc=1;\n\t\tif(!xinfo[i].crop)\n\t\t{\n\t\t\tw=dinfo->image_width;  h=dinfo->image_height;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tw=xinfo[i].crop_width;  h=xinfo[i].crop_height;\n\t\t}\n\t\tif(flags&TJFLAG_NOREALLOC)\n\t\t{\n\t\t\talloc=0;  dstSizes[i]=tjBufSize(w, h, jpegSubsamp);\n\t\t}\n\t\tif(!(t[i].options&TJXOPT_NOOUTPUT))\n\t\t\tjpeg_mem_dest_tj(cinfo, &dstBufs[i], &dstSizes[i], alloc);\n\t\tjpeg_copy_critical_parameters(dinfo, cinfo);\n\t\tdstcoefs=jtransform_adjust_parameters(dinfo, cinfo, srccoefs,\n\t\t\t&xinfo[i]);\n\t\tif(!(t[i].options&TJXOPT_NOOUTPUT))\n\t\t{\n\t\t\tjpeg_write_coefficients(cinfo, dstcoefs);\n\t\t\tjcopy_markers_execute(dinfo, cinfo, JCOPYOPT_ALL);\n\t\t}\n\t\telse jinit_c_master_control(cinfo, TRUE);\n\t\tjtransform_execute_transformation(dinfo, cinfo, srccoefs,\n\t\t\t&xinfo[i]);\n\t\tif(t[i].customFilter)\n\t\t{\n\t\t\tint ci, y;  JDIMENSION by;\n\t\t\tfor(ci=0; ci<cinfo->num_components; ci++)\n\t\t\t{\n\t\t\t\tjpeg_component_info *compptr=&cinfo->comp_info[ci];\n\t\t\t\ttjregion arrayRegion={0, 0, compptr->width_in_blocks*DCTSIZE,\n\t\t\t\t\tDCTSIZE};\n\t\t\t\ttjregion planeRegion={0, 0, compptr->width_in_blocks*DCTSIZE,\n\t\t\t\t\tcompptr->height_in_blocks*DCTSIZE};\n\t\t\t\tfor(by=0; by<compptr->height_in_blocks; by+=compptr->v_samp_factor)\n\t\t\t\t{\n\t\t\t\t\tJBLOCKARRAY barray=(dinfo->mem->access_virt_barray)\n\t\t\t\t\t\t((j_common_ptr)dinfo, dstcoefs[ci], by, compptr->v_samp_factor,\n\t\t\t\t\t\tTRUE);\n\t\t\t\t\tfor(y=0; y<compptr->v_samp_factor; y++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(t[i].customFilter(barray[y][0], arrayRegion, planeRegion,\n\t\t\t\t\t\t\tci, i, &t[i])==-1)\n\t\t\t\t\t\t\t_throw(\"tjTransform(): Error in custom filter\");\n\t\t\t\t\t\tarrayRegion.y+=DCTSIZE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!(t[i].options&TJXOPT_NOOUTPUT)) jpeg_finish_compress(cinfo);\n\t}\n\n\tjpeg_finish_decompress(dinfo);\n\n\tbailout:\n\tif(cinfo->global_state>CSTATE_START) jpeg_abort_compress(cinfo);\n\tif(dinfo->global_state>DSTATE_START) jpeg_abort_decompress(dinfo);\n\tif(xinfo) free(xinfo);\n\tif(this->jerr.warning) retval=-1;\n\treturn retval;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/turbojpeg.h",
    "content": "/*\n * Copyright (C)2009-2015 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef __TURBOJPEG_H__\n#define __TURBOJPEG_H__\n\n#if defined(_WIN32) && defined(DLLDEFINE)\n#define DLLEXPORT __declspec(dllexport)\n#else\n#define DLLEXPORT\n#endif\n#define DLLCALL\n\n\n/**\n * @addtogroup TurboJPEG\n * TurboJPEG API.  This API provides an interface for generating, decoding, and\n * transforming planar YUV and JPEG images in memory.\n *\n * @anchor YUVnotes\n * YUV Image Format Notes\n * ----------------------\n * Technically, the JPEG format uses the YCbCr colorspace (which is technically\n * not a colorspace but a color transform), but per the convention of the\n * digital video community, the TurboJPEG API uses \"YUV\" to refer to an image\n * format consisting of Y, Cb, and Cr image planes.\n *\n * Each plane is simply a 2D array of bytes, each byte representing the value\n * of one of the components (Y, Cb, or Cr) at a particular location in the\n * image.  The width and height of each plane are determined by the image\n * width, height, and level of chrominance subsampling.   The luminance plane\n * width is the image width padded to the nearest multiple of the horizontal\n * subsampling factor (2 in the case of 4:2:0 and 4:2:2, 4 in the case of\n * 4:1:1, 1 in the case of 4:4:4 or grayscale.)  Similarly, the luminance plane\n * height is the image height padded to the nearest multiple of the vertical\n * subsampling factor (2 in the case of 4:2:0 or 4:4:0, 1 in the case of 4:4:4\n * or grayscale.)  This is irrespective of any additional padding that may be\n * specified as an argument to the various YUV functions.  The chrominance\n * plane width is equal to the luminance plane width divided by the horizontal\n * subsampling factor, and the chrominance plane height is equal to the\n * luminance plane height divided by the vertical subsampling factor.\n *\n * For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is\n * used, then the luminance plane would be 36 x 35 bytes, and each of the\n * chrominance planes would be 18 x 35 bytes.  If you specify a line padding of\n * 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and\n * each of the chrominance planes would be 20 x 35 bytes.\n *\n * @{\n */\n\n\n/**\n * The number of chrominance subsampling options\n */\n#define TJ_NUMSAMP 6\n\n/**\n * Chrominance subsampling options.\n * When pixels are converted from RGB to YCbCr (see #TJCS_YCbCr) or from CMYK\n * to YCCK (see #TJCS_YCCK) as part of the JPEG compression process, some of\n * the Cb and Cr (chrominance) components can be discarded or averaged together\n * to produce a smaller image with little perceptible loss of image clarity\n * (the human eye is more sensitive to small changes in brightness than to\n * small changes in color.)  This is called \"chrominance subsampling\".\n */\nenum TJSAMP\n{\n  /**\n   * 4:4:4 chrominance subsampling (no chrominance subsampling).  The JPEG or\n   * YUV image will contain one chrominance component for every pixel in the\n   * source image.\n   */\n  TJSAMP_444=0,\n  /**\n   * 4:2:2 chrominance subsampling.  The JPEG or YUV image will contain one\n   * chrominance component for every 2x1 block of pixels in the source image.\n   */\n  TJSAMP_422,\n  /**\n   * 4:2:0 chrominance subsampling.  The JPEG or YUV image will contain one\n   * chrominance component for every 2x2 block of pixels in the source image.\n   */\n  TJSAMP_420,\n  /**\n   * Grayscale.  The JPEG or YUV image will contain no chrominance components.\n   */\n  TJSAMP_GRAY,\n  /**\n   * 4:4:0 chrominance subsampling.  The JPEG or YUV image will contain one\n   * chrominance component for every 1x2 block of pixels in the source image.\n   *\n   * @note 4:4:0 subsampling is not fully accelerated in libjpeg-turbo.\n   */\n  TJSAMP_440,\n  /**\n   * 4:1:1 chrominance subsampling.  The JPEG or YUV image will contain one\n   * chrominance component for every 4x1 block of pixels in the source image.\n   * JPEG images compressed with 4:1:1 subsampling will be almost exactly the\n   * same size as those compressed with 4:2:0 subsampling, and in the\n   * aggregate, both subsampling methods produce approximately the same\n   * perceptual quality.  However, 4:1:1 is better able to reproduce sharp\n   * horizontal features.\n   *\n   * @note 4:1:1 subsampling is not fully accelerated in libjpeg-turbo.\n   */\n  TJSAMP_411\n};\n\n/**\n * MCU block width (in pixels) for a given level of chrominance subsampling.\n * MCU block sizes:\n * - 8x8 for no subsampling or grayscale\n * - 16x8 for 4:2:2\n * - 8x16 for 4:4:0\n * - 16x16 for 4:2:0\n * - 32x8 for 4:1:1\n */\nstatic const int tjMCUWidth[TJ_NUMSAMP]  = {8, 16, 16, 8, 8, 32};\n\n/**\n * MCU block height (in pixels) for a given level of chrominance subsampling.\n * MCU block sizes:\n * - 8x8 for no subsampling or grayscale\n * - 16x8 for 4:2:2\n * - 8x16 for 4:4:0\n * - 16x16 for 4:2:0\n * - 32x8 for 4:1:1\n */\nstatic const int tjMCUHeight[TJ_NUMSAMP] = {8, 8, 16, 8, 16, 8};\n\n\n/**\n * The number of pixel formats\n */\n#define TJ_NUMPF 12\n\n/**\n * Pixel formats\n */\nenum TJPF\n{\n  /**\n   * RGB pixel format.  The red, green, and blue components in the image are\n   * stored in 3-byte pixels in the order R, G, B from lowest to highest byte\n   * address within each pixel.\n   */\n  TJPF_RGB=0,\n  /**\n   * BGR pixel format.  The red, green, and blue components in the image are\n   * stored in 3-byte pixels in the order B, G, R from lowest to highest byte\n   * address within each pixel.\n   */\n  TJPF_BGR,\n  /**\n   * RGBX pixel format.  The red, green, and blue components in the image are\n   * stored in 4-byte pixels in the order R, G, B from lowest to highest byte\n   * address within each pixel.  The X component is ignored when compressing\n   * and undefined when decompressing.\n   */\n  TJPF_RGBX,\n  /**\n   * BGRX pixel format.  The red, green, and blue components in the image are\n   * stored in 4-byte pixels in the order B, G, R from lowest to highest byte\n   * address within each pixel.  The X component is ignored when compressing\n   * and undefined when decompressing.\n   */\n  TJPF_BGRX,\n  /**\n   * XBGR pixel format.  The red, green, and blue components in the image are\n   * stored in 4-byte pixels in the order R, G, B from highest to lowest byte\n   * address within each pixel.  The X component is ignored when compressing\n   * and undefined when decompressing.\n   */\n  TJPF_XBGR,\n  /**\n   * XRGB pixel format.  The red, green, and blue components in the image are\n   * stored in 4-byte pixels in the order B, G, R from highest to lowest byte\n   * address within each pixel.  The X component is ignored when compressing\n   * and undefined when decompressing.\n   */\n  TJPF_XRGB,\n  /**\n   * Grayscale pixel format.  Each 1-byte pixel represents a luminance\n   * (brightness) level from 0 to 255.\n   */\n  TJPF_GRAY,\n  /**\n   * RGBA pixel format.  This is the same as @ref TJPF_RGBX, except that when\n   * decompressing, the X component is guaranteed to be 0xFF, which can be\n   * interpreted as an opaque alpha channel.\n   */\n  TJPF_RGBA,\n  /**\n   * BGRA pixel format.  This is the same as @ref TJPF_BGRX, except that when\n   * decompressing, the X component is guaranteed to be 0xFF, which can be\n   * interpreted as an opaque alpha channel.\n   */\n  TJPF_BGRA,\n  /**\n   * ABGR pixel format.  This is the same as @ref TJPF_XBGR, except that when\n   * decompressing, the X component is guaranteed to be 0xFF, which can be\n   * interpreted as an opaque alpha channel.\n   */\n  TJPF_ABGR,\n  /**\n   * ARGB pixel format.  This is the same as @ref TJPF_XRGB, except that when\n   * decompressing, the X component is guaranteed to be 0xFF, which can be\n   * interpreted as an opaque alpha channel.\n   */\n  TJPF_ARGB,\n  /**\n   * CMYK pixel format.  Unlike RGB, which is an additive color model used\n   * primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive\n   * color model used primarily for printing.  In the CMYK color model, the\n   * value of each color component typically corresponds to an amount of cyan,\n   * magenta, yellow, or black ink that is applied to a white background.  In\n   * order to convert between CMYK and RGB, it is necessary to use a color\n   * management system (CMS.)  A CMS will attempt to map colors within the\n   * printer's gamut to perceptually similar colors in the display's gamut and\n   * vice versa, but the mapping is typically not 1:1 or reversible, nor can it\n   * be defined with a simple formula.  Thus, such a conversion is out of scope\n   * for a codec library.  However, the TurboJPEG API allows for compressing\n   * CMYK pixels into a YCCK JPEG image (see #TJCS_YCCK) and decompressing YCCK\n   * JPEG images into CMYK pixels.\n   */\n  TJPF_CMYK\n};\n\n\n/**\n * Red offset (in bytes) for a given pixel format.  This specifies the number\n * of bytes that the red component is offset from the start of the pixel.  For\n * instance, if a pixel of format TJ_BGRX is stored in <tt>char pixel[]</tt>,\n * then the red component will be <tt>pixel[tjRedOffset[TJ_BGRX]]</tt>.\n */\nstatic const int tjRedOffset[TJ_NUMPF] = {0, 2, 0, 2, 3, 1, 0, 0, 2, 3, 1, -1};\n/**\n * Green offset (in bytes) for a given pixel format.  This specifies the number\n * of bytes that the green component is offset from the start of the pixel.\n * For instance, if a pixel of format TJ_BGRX is stored in\n * <tt>char pixel[]</tt>, then the green component will be\n * <tt>pixel[tjGreenOffset[TJ_BGRX]]</tt>.\n */\nstatic const int tjGreenOffset[TJ_NUMPF] = {1, 1, 1, 1, 2, 2, 0, 1, 1, 2, 2, -1};\n/**\n * Blue offset (in bytes) for a given pixel format.  This specifies the number\n * of bytes that the Blue component is offset from the start of the pixel.  For\n * instance, if a pixel of format TJ_BGRX is stored in <tt>char pixel[]</tt>,\n * then the blue component will be <tt>pixel[tjBlueOffset[TJ_BGRX]]</tt>.\n */\nstatic const int tjBlueOffset[TJ_NUMPF] = {2, 0, 2, 0, 1, 3, 0, 2, 0, 1, 3, -1};\n\n/**\n * Pixel size (in bytes) for a given pixel format.\n */\nstatic const int tjPixelSize[TJ_NUMPF] = {3, 3, 4, 4, 4, 4, 1, 4, 4, 4, 4, 4};\n\n\n/**\n * The number of JPEG colorspaces\n */\n#define TJ_NUMCS 5\n\n/**\n * JPEG colorspaces\n */\nenum TJCS\n{\n  /**\n   * RGB colorspace.  When compressing the JPEG image, the R, G, and B\n   * components in the source image are reordered into image planes, but no\n   * colorspace conversion or subsampling is performed.  RGB JPEG images can be\n   * decompressed to any of the extended RGB pixel formats or grayscale, but\n   * they cannot be decompressed to YUV images.\n   */\n  TJCS_RGB=0,\n  /**\n   * YCbCr colorspace.  YCbCr is not an absolute colorspace but rather a\n   * mathematical transformation of RGB designed solely for storage and\n   * transmission.  YCbCr images must be converted to RGB before they can\n   * actually be displayed.  In the YCbCr colorspace, the Y (luminance)\n   * component represents the black & white portion of the original image, and\n   * the Cb and Cr (chrominance) components represent the color portion of the\n   * original image.  Originally, the analog equivalent of this transformation\n   * allowed the same signal to drive both black & white and color televisions,\n   * but JPEG images use YCbCr primarily because it allows the color data to be\n   * optionally subsampled for the purposes of reducing bandwidth or disk\n   * space.  YCbCr is the most common JPEG colorspace, and YCbCr JPEG images\n   * can be compressed from and decompressed to any of the extended RGB pixel\n   * formats or grayscale, or they can be decompressed to YUV planar images.\n   */\n  TJCS_YCbCr,\n  /**\n   * Grayscale colorspace.  The JPEG image retains only the luminance data (Y\n   * component), and any color data from the source image is discarded.\n   * Grayscale JPEG images can be compressed from and decompressed to any of\n   * the extended RGB pixel formats or grayscale, or they can be decompressed\n   * to YUV planar images.\n   */\n  TJCS_GRAY,\n  /**\n   * CMYK colorspace.  When compressing the JPEG image, the C, M, Y, and K\n   * components in the source image are reordered into image planes, but no\n   * colorspace conversion or subsampling is performed.  CMYK JPEG images can\n   * only be decompressed to CMYK pixels.\n   */\n  TJCS_CMYK,\n  /**\n   * YCCK colorspace.  YCCK (AKA \"YCbCrK\") is not an absolute colorspace but\n   * rather a mathematical transformation of CMYK designed solely for storage\n   * and transmission.  It is to CMYK as YCbCr is to RGB.  CMYK pixels can be\n   * reversibly transformed into YCCK, and as with YCbCr, the chrominance\n   * components in the YCCK pixels can be subsampled without incurring major\n   * perceptual loss.  YCCK JPEG images can only be compressed from and\n   * decompressed to CMYK pixels.\n   */\n  TJCS_YCCK\n};\n\n\n/**\n * The uncompressed source/destination image is stored in bottom-up (Windows,\n * OpenGL) order, not top-down (X11) order.\n */\n#define TJFLAG_BOTTOMUP        2\n/**\n * When decompressing an image that was compressed using chrominance\n * subsampling, use the fastest chrominance upsampling algorithm available in\n * the underlying codec.  The default is to use smooth upsampling, which\n * creates a smooth transition between neighboring chrominance components in\n * order to reduce upsampling artifacts in the decompressed image.\n */\n#define TJFLAG_FASTUPSAMPLE  256\n/**\n * Disable buffer (re)allocation.  If passed to #tjCompress2() or\n * #tjTransform(), this flag will cause those functions to generate an error if\n * the JPEG image buffer is invalid or too small rather than attempting to\n * allocate or reallocate that buffer.  This reproduces the behavior of earlier\n * versions of TurboJPEG.\n */\n#define TJFLAG_NOREALLOC     1024\n/**\n * Use the fastest DCT/IDCT algorithm available in the underlying codec.  The\n * default if this flag is not specified is implementation-specific.  For\n * example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast\n * algorithm by default when compressing, because this has been shown to have\n * only a very slight effect on accuracy, but it uses the accurate algorithm\n * when decompressing, because this has been shown to have a larger effect.\n */\n#define TJFLAG_FASTDCT       2048\n/**\n * Use the most accurate DCT/IDCT algorithm available in the underlying codec.\n * The default if this flag is not specified is implementation-specific.  For\n * example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast\n * algorithm by default when compressing, because this has been shown to have\n * only a very slight effect on accuracy, but it uses the accurate algorithm\n * when decompressing, because this has been shown to have a larger effect.\n */\n#define TJFLAG_ACCURATEDCT   4096\n\n\n/**\n * The number of transform operations\n */\n#define TJ_NUMXOP 8\n\n/**\n * Transform operations for #tjTransform()\n */\nenum TJXOP\n{\n  /**\n   * Do not transform the position of the image pixels\n   */\n  TJXOP_NONE=0,\n  /**\n   * Flip (mirror) image horizontally.  This transform is imperfect if there\n   * are any partial MCU blocks on the right edge (see #TJXOPT_PERFECT.)\n   */\n  TJXOP_HFLIP,\n  /**\n   * Flip (mirror) image vertically.  This transform is imperfect if there are\n   * any partial MCU blocks on the bottom edge (see #TJXOPT_PERFECT.)\n   */\n  TJXOP_VFLIP,\n  /**\n   * Transpose image (flip/mirror along upper left to lower right axis.)  This\n   * transform is always perfect.\n   */\n  TJXOP_TRANSPOSE,\n  /**\n   * Transverse transpose image (flip/mirror along upper right to lower left\n   * axis.)  This transform is imperfect if there are any partial MCU blocks in\n   * the image (see #TJXOPT_PERFECT.)\n   */\n  TJXOP_TRANSVERSE,\n  /**\n   * Rotate image clockwise by 90 degrees.  This transform is imperfect if\n   * there are any partial MCU blocks on the bottom edge (see\n   * #TJXOPT_PERFECT.)\n   */\n  TJXOP_ROT90,\n  /**\n   * Rotate image 180 degrees.  This transform is imperfect if there are any\n   * partial MCU blocks in the image (see #TJXOPT_PERFECT.)\n   */\n  TJXOP_ROT180,\n  /**\n   * Rotate image counter-clockwise by 90 degrees.  This transform is imperfect\n   * if there are any partial MCU blocks on the right edge (see\n   * #TJXOPT_PERFECT.)\n   */\n  TJXOP_ROT270\n};\n\n\n/**\n * This option will cause #tjTransform() to return an error if the transform is\n * not perfect.  Lossless transforms operate on MCU blocks, whose size depends\n * on the level of chrominance subsampling used (see #tjMCUWidth\n * and #tjMCUHeight.)  If the image's width or height is not evenly divisible\n * by the MCU block size, then there will be partial MCU blocks on the right\n * and/or bottom edges.  It is not possible to move these partial MCU blocks to\n * the top or left of the image, so any transform that would require that is\n * \"imperfect.\"  If this option is not specified, then any partial MCU blocks\n * that cannot be transformed will be left in place, which will create\n * odd-looking strips on the right or bottom edge of the image.\n */\n#define TJXOPT_PERFECT  1\n/**\n * This option will cause #tjTransform() to discard any partial MCU blocks that\n * cannot be transformed.\n */\n#define TJXOPT_TRIM     2\n/**\n * This option will enable lossless cropping.  See #tjTransform() for more\n * information.\n */\n#define TJXOPT_CROP     4\n/**\n * This option will discard the color data in the input image and produce\n * a grayscale output image.\n */\n#define TJXOPT_GRAY     8\n/**\n * This option will prevent #tjTransform() from outputting a JPEG image for\n * this particular transform (this can be used in conjunction with a custom\n * filter to capture the transformed DCT coefficients without transcoding\n * them.)\n */\n#define TJXOPT_NOOUTPUT 16\n\n\n/**\n * Scaling factor\n */\ntypedef struct\n{\n  /**\n   * Numerator\n   */\n  int num;\n  /**\n   * Denominator\n   */\n  int denom;\n} tjscalingfactor;\n\n/**\n * Cropping region\n */\ntypedef struct\n{\n  /**\n   * The left boundary of the cropping region.  This must be evenly divisible\n   * by the MCU block width (see #tjMCUWidth.)\n   */\n  int x;\n  /**\n   * The upper boundary of the cropping region.  This must be evenly divisible\n   * by the MCU block height (see #tjMCUHeight.)\n   */\n  int y;\n  /**\n   * The width of the cropping region. Setting this to 0 is the equivalent of\n   * setting it to the width of the source JPEG image - x.\n   */\n  int w;\n  /**\n   * The height of the cropping region. Setting this to 0 is the equivalent of\n   * setting it to the height of the source JPEG image - y.\n   */\n  int h;\n} tjregion;\n\n/**\n * Lossless transform\n */\ntypedef struct tjtransform\n{\n  /**\n   * Cropping region\n   */\n  tjregion r;\n  /**\n   * One of the @ref TJXOP \"transform operations\"\n   */\n  int op;\n  /**\n   * The bitwise OR of one of more of the @ref TJXOPT_CROP \"transform options\"\n   */\n  int options;\n  /**\n   * Arbitrary data that can be accessed within the body of the callback\n   * function\n   */\n  void *data;\n  /**\n   * A callback function that can be used to modify the DCT coefficients\n   * after they are losslessly transformed but before they are transcoded to a\n   * new JPEG image.  This allows for custom filters or other transformations\n   * to be applied in the frequency domain.\n   *\n   * @param coeffs pointer to an array of transformed DCT coefficients.  (NOTE:\n   * this pointer is not guaranteed to be valid once the callback returns, so\n   * applications wishing to hand off the DCT coefficients to another function\n   * or library should make a copy of them within the body of the callback.)\n   *\n   * @param arrayRegion #tjregion structure containing the width and height of\n   * the array pointed to by <tt>coeffs</tt> as well as its offset relative to\n   * the component plane.  TurboJPEG implementations may choose to split each\n   * component plane into multiple DCT coefficient arrays and call the callback\n   * function once for each array.\n   *\n   * @param planeRegion #tjregion structure containing the width and height of\n   * the component plane to which <tt>coeffs</tt> belongs\n   *\n   * @param componentID ID number of the component plane to which\n   * <tt>coeffs</tt> belongs (Y, Cb, and Cr have, respectively, ID's of 0, 1,\n   * and 2 in typical JPEG images.)\n   *\n   * @param transformID ID number of the transformed image to which\n   * <tt>coeffs</tt> belongs.  This is the same as the index of the transform\n   * in the <tt>transforms</tt> array that was passed to #tjTransform().\n   *\n   * @param transform a pointer to a #tjtransform structure that specifies the\n   * parameters and/or cropping region for this transform\n   *\n   * @return 0 if the callback was successful, or -1 if an error occurred.\n   */\n  int (*customFilter)(short *coeffs, tjregion arrayRegion,\n    tjregion planeRegion, int componentIndex, int transformIndex,\n    struct tjtransform *transform);\n} tjtransform;\n\n/**\n * TurboJPEG instance handle\n */\ntypedef void* tjhandle;\n\n\n/**\n * Pad the given width to the nearest 32-bit boundary\n */\n#define TJPAD(width) (((width)+3)&(~3))\n\n/**\n * Compute the scaled value of <tt>dimension</tt> using the given scaling\n * factor.  This macro performs the integer equivalent of <tt>ceil(dimension *\n * scalingFactor)</tt>.\n */\n#define TJSCALED(dimension, scalingFactor) ((dimension * scalingFactor.num \\\n  + scalingFactor.denom - 1) / scalingFactor.denom)\n\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\n/**\n * Create a TurboJPEG compressor instance.\n *\n * @return a handle to the newly-created instance, or NULL if an error\n * occurred (see #tjGetErrorStr().)\n */\nDLLEXPORT tjhandle DLLCALL tjInitCompress(void);\n\n\n/**\n * Compress an RGB, grayscale, or CMYK image into a JPEG image.\n *\n * @param handle a handle to a TurboJPEG compressor or transformer instance\n *\n * @param srcBuf pointer to an image buffer containing RGB, grayscale, or\n * CMYK pixels to be compressed\n *\n * @param width width (in pixels) of the source image\n *\n * @param pitch bytes per line in the source image.  Normally, this should be\n * <tt>width * #tjPixelSize[pixelFormat]</tt> if the image is unpadded, or\n * <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line of the image\n * is padded to the nearest 32-bit boundary, as is the case for Windows\n * bitmaps.  You can also be clever and use this parameter to skip lines, etc.\n * Setting this parameter to 0 is the equivalent of setting it to\n * <tt>width * #tjPixelSize[pixelFormat]</tt>.\n *\n * @param height height (in pixels) of the source image\n *\n * @param pixelFormat pixel format of the source image (see @ref TJPF\n * \"Pixel formats\".)\n *\n * @param jpegBuf address of a pointer to an image buffer that will receive the\n * JPEG image.  TurboJPEG has the ability to reallocate the JPEG buffer\n * to accommodate the size of the JPEG image.  Thus, you can choose to:\n * -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and\n * let TurboJPEG grow the buffer as needed,\n * -# set <tt>*jpegBuf</tt> to NULL to tell TurboJPEG to allocate the buffer\n * for you, or\n * -# pre-allocate the buffer to a \"worst case\" size determined by calling\n * #tjBufSize().  This should ensure that the buffer never has to be\n * re-allocated (setting #TJFLAG_NOREALLOC guarantees this.)\n * .\n * If you choose option 1, <tt>*jpegSize</tt> should be set to the size of your\n * pre-allocated buffer.  In any case, unless you have set #TJFLAG_NOREALLOC,\n * you should always check <tt>*jpegBuf</tt> upon return from this function, as\n * it may have changed.\n *\n * @param jpegSize pointer to an unsigned long variable that holds the size of\n * the JPEG image buffer.  If <tt>*jpegBuf</tt> points to a pre-allocated\n * buffer, then <tt>*jpegSize</tt> should be set to the size of the buffer.\n * Upon return, <tt>*jpegSize</tt> will contain the size of the JPEG image (in\n * bytes.)  If <tt>*jpegBuf</tt> points to a JPEG image buffer that is being\n * reused from a previous call to one of the JPEG compression functions, then\n * <tt>*jpegSize</tt> is ignored.\n *\n * @param jpegSubsamp the level of chrominance subsampling to be used when\n * generating the JPEG image (see @ref TJSAMP\n * \"Chrominance subsampling options\".)\n *\n * @param jpegQual the image quality of the generated JPEG image (1 = worst,\n * 100 = best)\n *\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n * \"flags\"\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n*/\nDLLEXPORT int DLLCALL tjCompress2(tjhandle handle, const unsigned char *srcBuf,\n  int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf,\n  unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags);\n\n\n/**\n * Compress a YUV planar image into a JPEG image.\n *\n * @param handle a handle to a TurboJPEG compressor or transformer instance\n *\n * @param srcBuf pointer to an image buffer containing a YUV planar image to be\n * compressed.  The size of this buffer should match the value returned by\n * #tjBufSizeYUV2() for the given image width, height, padding, and level of\n * chrominance subsampling.  The Y, U (Cb), and V (Cr) image planes should be\n * stored sequentially in the source buffer (refer to @ref YUVnotes\n * \"YUV Image Format Notes\".)\n *\n * @param width width (in pixels) of the source image.  If the width is not an\n * even multiple of the MCU block width (see #tjMCUWidth), then an intermediate\n * buffer copy will be performed within TurboJPEG.\n *\n * @param pad the line padding used in the source image.  For instance, if each\n * line in each plane of the YUV image is padded to the nearest multiple of 4\n * bytes, then <tt>pad</tt> should be set to 4.\n *\n * @param height height (in pixels) of the source image.  If the height is not\n * an even multiple of the MCU block height (see #tjMCUHeight), then an\n * intermediate buffer copy will be performed within TurboJPEG.\n *\n * @param subsamp the level of chrominance subsampling used in the source\n * image (see @ref TJSAMP \"Chrominance subsampling options\".)\n *\n * @param jpegBuf address of a pointer to an image buffer that will receive the\n * JPEG image.  TurboJPEG has the ability to reallocate the JPEG buffer to\n * accommodate the size of the JPEG image.  Thus, you can choose to:\n * -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and\n * let TurboJPEG grow the buffer as needed,\n * -# set <tt>*jpegBuf</tt> to NULL to tell TurboJPEG to allocate the buffer\n * for you, or\n * -# pre-allocate the buffer to a \"worst case\" size determined by calling\n * #tjBufSize().  This should ensure that the buffer never has to be\n * re-allocated (setting #TJFLAG_NOREALLOC guarantees this.)\n * .\n * If you choose option 1, <tt>*jpegSize</tt> should be set to the size of your\n * pre-allocated buffer.  In any case, unless you have set #TJFLAG_NOREALLOC,\n * you should always check <tt>*jpegBuf</tt> upon return from this function, as\n * it may have changed.\n *\n * @param jpegSize pointer to an unsigned long variable that holds the size of\n * the JPEG image buffer.  If <tt>*jpegBuf</tt> points to a pre-allocated\n * buffer, then <tt>*jpegSize</tt> should be set to the size of the buffer.\n * Upon return, <tt>*jpegSize</tt> will contain the size of the JPEG image (in\n * bytes.)  If <tt>*jpegBuf</tt> points to a JPEG image buffer that is being\n * reused from a previous call to one of the JPEG compression functions, then\n * <tt>*jpegSize</tt> is ignored.\n *\n * @param jpegQual the image quality of the generated JPEG image (1 = worst,\n * 100 = best)\n *\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n * \"flags\"\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n*/\nDLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle,\n  const unsigned char *srcBuf, int width, int pad, int height, int subsamp,\n  unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags);\n\n\n/**\n * Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image.\n *\n * @param handle a handle to a TurboJPEG compressor or transformer instance\n *\n * @param srcPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes\n * (or just a Y plane, if compressing a grayscale image) that contain a YUV\n * image to be compressed.  These planes can be contiguous or non-contiguous in\n * memory.  The size of each plane should match the value returned by\n * #tjPlaneSizeYUV() for the given image width, height, strides, and level of\n * chrominance subsampling.  Refer to @ref YUVnotes \"YUV Image Format Notes\"\n * for more details.\n *\n * @param width width (in pixels) of the source image.  If the width is not an\n * even multiple of the MCU block width (see #tjMCUWidth), then an intermediate\n * buffer copy will be performed within TurboJPEG.\n *\n * @param strides an array of integers, each specifying the number of bytes per\n * line in the corresponding plane of the YUV source image.  Setting the stride\n * for any plane to 0 is the same as setting it to the plane width (see\n * @ref YUVnotes \"YUV Image Format Notes\".)  If <tt>strides</tt> is NULL, then\n * the strides for all planes will be set to their respective plane widths.\n * You can adjust the strides in order to specify an arbitrary amount of line\n * padding in each plane or to create a JPEG image from a subregion of a larger\n * YUV planar image.\n *\n * @param height height (in pixels) of the source image.  If the height is not\n * an even multiple of the MCU block height (see #tjMCUHeight), then an\n * intermediate buffer copy will be performed within TurboJPEG.\n *\n * @param subsamp the level of chrominance subsampling used in the source\n * image (see @ref TJSAMP \"Chrominance subsampling options\".)\n *\n * @param jpegBuf address of a pointer to an image buffer that will receive the\n * JPEG image.  TurboJPEG has the ability to reallocate the JPEG buffer to\n * accommodate the size of the JPEG image.  Thus, you can choose to:\n * -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and\n * let TurboJPEG grow the buffer as needed,\n * -# set <tt>*jpegBuf</tt> to NULL to tell TurboJPEG to allocate the buffer\n * for you, or\n * -# pre-allocate the buffer to a \"worst case\" size determined by calling\n * #tjBufSize().  This should ensure that the buffer never has to be\n * re-allocated (setting #TJFLAG_NOREALLOC guarantees this.)\n * .\n * If you choose option 1, <tt>*jpegSize</tt> should be set to the size of your\n * pre-allocated buffer.  In any case, unless you have set #TJFLAG_NOREALLOC,\n * you should always check <tt>*jpegBuf</tt> upon return from this function, as\n * it may have changed.\n *\n * @param jpegSize pointer to an unsigned long variable that holds the size of\n * the JPEG image buffer.  If <tt>*jpegBuf</tt> points to a pre-allocated\n * buffer, then <tt>*jpegSize</tt> should be set to the size of the buffer.\n * Upon return, <tt>*jpegSize</tt> will contain the size of the JPEG image (in\n * bytes.)  If <tt>*jpegBuf</tt> points to a JPEG image buffer that is being\n * reused from a previous call to one of the JPEG compression functions, then\n * <tt>*jpegSize</tt> is ignored.\n *\n * @param jpegQual the image quality of the generated JPEG image (1 = worst,\n * 100 = best)\n *\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n * \"flags\"\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n*/\nDLLEXPORT int DLLCALL tjCompressFromYUVPlanes(tjhandle handle,\n  const unsigned char **srcPlanes, int width, const int *strides, int height,\n  int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual,\n  int flags);\n\n\n/**\n * The maximum size of the buffer (in bytes) required to hold a JPEG image with\n * the given parameters.  The number of bytes returned by this function is\n * larger than the size of the uncompressed source image.  The reason for this\n * is that the JPEG format uses 16-bit coefficients, and it is thus possible\n * for a very high-quality JPEG image with very high-frequency content to\n * expand rather than compress when converted to the JPEG format.  Such images\n * represent a very rare corner case, but since there is no way to predict the\n * size of a JPEG image prior to compression, the corner case has to be\n * handled.\n *\n * @param width width (in pixels) of the image\n *\n * @param height height (in pixels) of the image\n *\n * @param jpegSubsamp the level of chrominance subsampling to be used when\n * generating the JPEG image (see @ref TJSAMP\n * \"Chrominance subsampling options\".)\n *\n * @return the maximum size of the buffer (in bytes) required to hold the\n * image, or -1 if the arguments are out of bounds.\n */\nDLLEXPORT unsigned long DLLCALL tjBufSize(int width, int height,\n  int jpegSubsamp);\n\n\n/**\n * The size of the buffer (in bytes) required to hold a YUV planar image with\n * the given parameters.\n *\n * @param width width (in pixels) of the image\n *\n * @param pad the width of each line in each plane of the image is padded to\n * the nearest multiple of this number of bytes (must be a power of 2.)\n *\n * @param height height (in pixels) of the image\n *\n * @param subsamp level of chrominance subsampling in the image (see\n * @ref TJSAMP \"Chrominance subsampling options\".)\n *\n * @return the size of the buffer (in bytes) required to hold the image, or\n * -1 if the arguments are out of bounds.\n */\nDLLEXPORT unsigned long DLLCALL tjBufSizeYUV2(int width, int pad, int height,\n  int subsamp);\n\n\n/**\n * The size of the buffer (in bytes) required to hold a YUV image plane with\n * the given parameters.\n *\n * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)\n *\n * @param width width (in pixels) of the YUV image.  NOTE: this is the width of\n * the whole image, not the plane width.\n *\n * @param stride bytes per line in the image plane.  Setting this to 0 is the\n * equivalent of setting it to the plane width.\n *\n * @param height height (in pixels) of the YUV image.  NOTE: this is the height\n * of the whole image, not the plane height.\n *\n * @param subsamp level of chrominance subsampling in the image (see\n * @ref TJSAMP \"Chrominance subsampling options\".)\n *\n * @return the size of the buffer (in bytes) required to hold the YUV image\n * plane, or -1 if the arguments are out of bounds.\n */\nDLLEXPORT unsigned long DLLCALL tjPlaneSizeYUV(int componentID, int width,\n  int stride, int height, int subsamp);\n\n\n/**\n * The plane width of a YUV image plane with the given parameters.  Refer to\n * @ref YUVnotes \"YUV Image Format Notes\" for a description of plane width.\n *\n * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)\n *\n * @param width width (in pixels) of the YUV image\n *\n * @param subsamp level of chrominance subsampling in the image (see\n * @ref TJSAMP \"Chrominance subsampling options\".)\n *\n * @return the plane width of a YUV image plane with the given parameters, or\n * -1 if the arguments are out of bounds.\n */\nDLLEXPORT int tjPlaneWidth(int componentID, int width, int subsamp);\n\n\n/**\n * The plane height of a YUV image plane with the given parameters.  Refer to\n * @ref YUVnotes \"YUV Image Format Notes\" for a description of plane height.\n *\n * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)\n *\n * @param height height (in pixels) of the YUV image\n *\n * @param subsamp level of chrominance subsampling in the image (see\n * @ref TJSAMP \"Chrominance subsampling options\".)\n *\n * @return the plane height of a YUV image plane with the given parameters, or\n * -1 if the arguments are out of bounds.\n */\nDLLEXPORT int tjPlaneHeight(int componentID, int height, int subsamp);\n\n\n/**\n * Encode an RGB or grayscale image into a YUV planar image.  This function\n * uses the accelerated color conversion routines in the underlying\n * codec but does not execute any of the other steps in the JPEG compression\n * process.\n *\n * @param handle a handle to a TurboJPEG compressor or transformer instance\n *\n * @param srcBuf pointer to an image buffer containing RGB or grayscale pixels\n * to be encoded\n *\n * @param width width (in pixels) of the source image\n *\n * @param pitch bytes per line in the source image.  Normally, this should be\n * <tt>width * #tjPixelSize[pixelFormat]</tt> if the image is unpadded, or\n * <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line of the image\n * is padded to the nearest 32-bit boundary, as is the case for Windows\n * bitmaps.  You can also be clever and use this parameter to skip lines, etc.\n * Setting this parameter to 0 is the equivalent of setting it to\n * <tt>width * #tjPixelSize[pixelFormat]</tt>.\n *\n * @param height height (in pixels) of the source image\n *\n * @param pixelFormat pixel format of the source image (see @ref TJPF\n * \"Pixel formats\".)\n *\n * @param dstBuf pointer to an image buffer that will receive the YUV image.\n * Use #tjBufSizeYUV2() to determine the appropriate size for this buffer based\n * on the image width, height, padding, and level of chrominance subsampling.\n * The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the\n * buffer (refer to @ref YUVnotes \"YUV Image Format Notes\".)\n *\n * @param pad the width of each line in each plane of the YUV image will be\n * padded to the nearest multiple of this number of bytes (must be a power of\n * 2.)  To generate images suitable for X Video, <tt>pad</tt> should be set to\n * 4.\n *\n * @param subsamp the level of chrominance subsampling to be used when\n * generating the YUV image (see @ref TJSAMP\n * \"Chrominance subsampling options\".)  To generate images suitable for X\n * Video, <tt>subsamp</tt> should be set to @ref TJSAMP_420.  This produces an\n * image compatible with the I420 (AKA \"YUV420P\") format.\n *\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n * \"flags\"\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n*/\nDLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle,\n  const unsigned char *srcBuf, int width, int pitch, int height,\n  int pixelFormat, unsigned char *dstBuf, int pad, int subsamp, int flags);\n\n\n/**\n * Encode an RGB or grayscale image into separate Y, U (Cb), and V (Cr) image\n * planes.  This function uses the accelerated color conversion routines in the\n * underlying codec but does not execute any of the other steps in the JPEG\n * compression process.\n *\n * @param handle a handle to a TurboJPEG compressor or transformer instance\n *\n * @param srcBuf pointer to an image buffer containing RGB or grayscale pixels\n * to be encoded\n *\n * @param width width (in pixels) of the source image\n *\n * @param pitch bytes per line in the source image.  Normally, this should be\n * <tt>width * #tjPixelSize[pixelFormat]</tt> if the image is unpadded, or\n * <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line of the image\n * is padded to the nearest 32-bit boundary, as is the case for Windows\n * bitmaps.  You can also be clever and use this parameter to skip lines, etc.\n * Setting this parameter to 0 is the equivalent of setting it to\n * <tt>width * #tjPixelSize[pixelFormat]</tt>.\n *\n * @param height height (in pixels) of the source image\n *\n * @param pixelFormat pixel format of the source image (see @ref TJPF\n * \"Pixel formats\".)\n *\n * @param dstPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes\n * (or just a Y plane, if generating a grayscale image) that will receive the\n * encoded image.  These planes can be contiguous or non-contiguous in memory.\n * Use #tjPlaneSizeYUV() to determine the appropriate size for each plane based\n * on the image width, height, strides, and level of chrominance subsampling.\n * Refer to @ref YUVnotes \"YUV Image Format Notes\" for more details.\n *\n * @param strides an array of integers, each specifying the number of bytes per\n * line in the corresponding plane of the output image.  Setting the stride for\n * any plane to 0 is the same as setting it to the plane width (see\n * @ref YUVnotes \"YUV Image Format Notes\".)  If <tt>strides</tt> is NULL, then\n * the strides for all planes will be set to their respective plane widths.\n * You can adjust the strides in order to add an arbitrary amount of line\n * padding to each plane or to encode an RGB or grayscale image into a\n * subregion of a larger YUV planar image.\n *\n * @param subsamp the level of chrominance subsampling to be used when\n * generating the YUV image (see @ref TJSAMP\n * \"Chrominance subsampling options\".)  To generate images suitable for X\n * Video, <tt>subsamp</tt> should be set to @ref TJSAMP_420.  This produces an\n * image compatible with the I420 (AKA \"YUV420P\") format.\n *\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n * \"flags\"\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n*/\nDLLEXPORT int DLLCALL tjEncodeYUVPlanes(tjhandle handle,\n  const unsigned char *srcBuf, int width, int pitch, int height,\n  int pixelFormat, unsigned char **dstPlanes, int *strides, int subsamp,\n  int flags);\n\n\n/**\n * Create a TurboJPEG decompressor instance.\n *\n * @return a handle to the newly-created instance, or NULL if an error\n * occurred (see #tjGetErrorStr().)\n*/\nDLLEXPORT tjhandle DLLCALL tjInitDecompress(void);\n\n\n/**\n * Retrieve information about a JPEG image without decompressing it.\n *\n * @param handle a handle to a TurboJPEG decompressor or transformer instance\n *\n * @param jpegBuf pointer to a buffer containing a JPEG image\n *\n * @param jpegSize size of the JPEG image (in bytes)\n *\n * @param width pointer to an integer variable that will receive the width (in\n * pixels) of the JPEG image\n *\n * @param height pointer to an integer variable that will receive the height\n * (in pixels) of the JPEG image\n *\n * @param jpegSubsamp pointer to an integer variable that will receive the\n * level of chrominance subsampling used when the JPEG image was compressed\n * (see @ref TJSAMP \"Chrominance subsampling options\".)\n *\n * @param jpegColorspace pointer to an integer variable that will receive one\n * of the JPEG colorspace constants, indicating the colorspace of the JPEG\n * image (see @ref TJCS \"JPEG colorspaces\".)\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n*/\nDLLEXPORT int DLLCALL tjDecompressHeader3(tjhandle handle,\n  const unsigned char *jpegBuf, unsigned long jpegSize, int *width,\n  int *height, int *jpegSubsamp, int *jpegColorspace);\n\n\n/**\n * Returns a list of fractional scaling factors that the JPEG decompressor in\n * this implementation of TurboJPEG supports.\n *\n * @param numscalingfactors pointer to an integer variable that will receive\n * the number of elements in the list\n *\n * @return a pointer to a list of fractional scaling factors, or NULL if an\n * error is encountered (see #tjGetErrorStr().)\n*/\nDLLEXPORT tjscalingfactor* DLLCALL tjGetScalingFactors(int *numscalingfactors);\n\n\n/**\n * Decompress a JPEG image to an RGB, grayscale, or CMYK image.\n *\n * @param handle a handle to a TurboJPEG decompressor or transformer instance\n *\n * @param jpegBuf pointer to a buffer containing the JPEG image to decompress\n *\n * @param jpegSize size of the JPEG image (in bytes)\n *\n * @param dstBuf pointer to an image buffer that will receive the decompressed\n * image.  This buffer should normally be <tt>pitch * scaledHeight</tt> bytes\n * in size, where <tt>scaledHeight</tt> can be determined by calling\n * #TJSCALED() with the JPEG image height and one of the scaling factors\n * returned by #tjGetScalingFactors().  The <tt>dstBuf</tt> pointer may also be\n * used to decompress into a specific region of a larger buffer.\n *\n * @param width desired width (in pixels) of the destination image.  If this is\n * different than the width of the JPEG image being decompressed, then\n * TurboJPEG will use scaling in the JPEG decompressor to generate the largest\n * possible image that will fit within the desired width.  If <tt>width</tt> is\n * set to 0, then only the height will be considered when determining the\n * scaled image size.\n *\n * @param pitch bytes per line in the destination image.  Normally, this is\n * <tt>scaledWidth * #tjPixelSize[pixelFormat]</tt> if the decompressed image\n * is unpadded, else <tt>#TJPAD(scaledWidth * #tjPixelSize[pixelFormat])</tt>\n * if each line of the decompressed image is padded to the nearest 32-bit\n * boundary, as is the case for Windows bitmaps.  (NOTE: <tt>scaledWidth</tt>\n * can be determined by calling #TJSCALED() with the JPEG image width and one\n * of the scaling factors returned by #tjGetScalingFactors().)  You can also be\n * clever and use the pitch parameter to skip lines, etc.  Setting this\n * parameter to 0 is the equivalent of setting it to\n * <tt>scaledWidth * #tjPixelSize[pixelFormat]</tt>.\n *\n * @param height desired height (in pixels) of the destination image.  If this\n * is different than the height of the JPEG image being decompressed, then\n * TurboJPEG will use scaling in the JPEG decompressor to generate the largest\n * possible image that will fit within the desired height.  If <tt>height</tt>\n * is set to 0, then only the width will be considered when determining the\n * scaled image size.\n *\n * @param pixelFormat pixel format of the destination image (see @ref\n * TJPF \"Pixel formats\".)\n *\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n * \"flags\"\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n */\nDLLEXPORT int DLLCALL tjDecompress2(tjhandle handle,\n  const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,\n  int width, int pitch, int height, int pixelFormat, int flags);\n\n\n/**\n * Decompress a JPEG image to a YUV planar image.  This function performs JPEG\n * decompression but leaves out the color conversion step, so a planar YUV\n * image is generated instead of an RGB image.\n *\n * @param handle a handle to a TurboJPEG decompressor or transformer instance\n *\n * @param jpegBuf pointer to a buffer containing the JPEG image to decompress\n *\n * @param jpegSize size of the JPEG image (in bytes)\n *\n * @param dstBuf pointer to an image buffer that will receive the YUV image.\n * Use #tjBufSizeYUV2() to determine the appropriate size for this buffer based\n * on the image width, height, padding, and level of subsampling.  The Y,\n * U (Cb), and V (Cr) image planes will be stored sequentially in the buffer\n * (refer to @ref YUVnotes \"YUV Image Format Notes\".)\n *\n * @param width desired width (in pixels) of the YUV image.  If this is\n * different than the width of the JPEG image being decompressed, then\n * TurboJPEG will use scaling in the JPEG decompressor to generate the largest\n * possible image that will fit within the desired width.  If <tt>width</tt> is\n * set to 0, then only the height will be considered when determining the\n * scaled image size.  If the scaled width is not an even multiple of the MCU\n * block width (see #tjMCUWidth), then an intermediate buffer copy will be\n * performed within TurboJPEG.\n *\n * @param pad the width of each line in each plane of the YUV image will be\n * padded to the nearest multiple of this number of bytes (must be a power of\n * 2.)  To generate images suitable for X Video, <tt>pad</tt> should be set to\n * 4.\n *\n * @param height desired height (in pixels) of the YUV image.  If this is\n * different than the height of the JPEG image being decompressed, then\n * TurboJPEG will use scaling in the JPEG decompressor to generate the largest\n * possible image that will fit within the desired height.  If <tt>height</tt>\n * is set to 0, then only the width will be considered when determining the\n * scaled image size.  If the scaled height is not an even multiple of the MCU\n * block height (see #tjMCUHeight), then an intermediate buffer copy will be\n * performed within TurboJPEG.\n *\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n * \"flags\"\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n */\nDLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,\n  const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,\n  int width, int pad, int height, int flags);\n\n\n/**\n * Decompress a JPEG image into separate Y, U (Cb), and V (Cr) image\n * planes.  This function performs JPEG decompression but leaves out the color\n * conversion step, so a planar YUV image is generated instead of an RGB image.\n *\n * @param handle a handle to a TurboJPEG decompressor or transformer instance\n *\n * @param jpegBuf pointer to a buffer containing the JPEG image to decompress\n *\n * @param jpegSize size of the JPEG image (in bytes)\n *\n * @param dstPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes\n * (or just a Y plane, if decompressing a grayscale image) that will receive\n * the YUV image.  These planes can be contiguous or non-contiguous in memory.\n * Use #tjPlaneSizeYUV() to determine the appropriate size for each plane based\n * on the scaled image width, scaled image height, strides, and level of\n * chrominance subsampling.  Refer to @ref YUVnotes \"YUV Image Format Notes\"\n * for more details.\n *\n * @param width desired width (in pixels) of the YUV image.  If this is\n * different than the width of the JPEG image being decompressed, then\n * TurboJPEG will use scaling in the JPEG decompressor to generate the largest\n * possible image that will fit within the desired width.  If <tt>width</tt> is\n * set to 0, then only the height will be considered when determining the\n * scaled image size.  If the scaled width is not an even multiple of the MCU\n * block width (see #tjMCUWidth), then an intermediate buffer copy will be\n * performed within TurboJPEG.\n *\n * @param strides an array of integers, each specifying the number of bytes per\n * line in the corresponding plane of the output image.  Setting the stride for\n * any plane to 0 is the same as setting it to the scaled plane width (see\n * @ref YUVnotes \"YUV Image Format Notes\".)  If <tt>strides</tt> is NULL, then\n * the strides for all planes will be set to their respective scaled plane\n * widths.  You can adjust the strides in order to add an arbitrary amount of\n * line padding to each plane or to decompress the JPEG image into a subregion\n * of a larger YUV planar image.\n *\n * @param height desired height (in pixels) of the YUV image.  If this is\n * different than the height of the JPEG image being decompressed, then\n * TurboJPEG will use scaling in the JPEG decompressor to generate the largest\n * possible image that will fit within the desired height.  If <tt>height</tt>\n * is set to 0, then only the width will be considered when determining the\n * scaled image size.  If the scaled height is not an even multiple of the MCU\n * block height (see #tjMCUHeight), then an intermediate buffer copy will be\n * performed within TurboJPEG.\n *\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n * \"flags\"\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n */\nDLLEXPORT int DLLCALL tjDecompressToYUVPlanes(tjhandle handle,\n  const unsigned char *jpegBuf, unsigned long jpegSize,\n  unsigned char **dstPlanes, int width, int *strides, int height, int flags);\n\n\n/**\n * Decode a YUV planar image into an RGB or grayscale image.  This function\n * uses the accelerated color conversion routines in the underlying\n * codec but does not execute any of the other steps in the JPEG decompression\n * process.\n *\n * @param handle a handle to a TurboJPEG decompressor or transformer instance\n *\n * @param srcBuf pointer to an image buffer containing a YUV planar image to be\n * decoded.  The size of this buffer should match the value returned by\n * #tjBufSizeYUV2() for the given image width, height, padding, and level of\n * chrominance subsampling.  The Y, U (Cb), and V (Cr) image planes should be\n * stored sequentially in the source buffer (refer to @ref YUVnotes\n * \"YUV Image Format Notes\".)\n *\n * @param pad Use this parameter to specify that the width of each line in each\n * plane of the YUV source image is padded to the nearest multiple of this\n * number of bytes (must be a power of 2.)\n *\n * @param subsamp the level of chrominance subsampling used in the YUV source\n * image (see @ref TJSAMP \"Chrominance subsampling options\".)\n *\n * @param dstBuf pointer to an image buffer that will receive the decoded\n * image.  This buffer should normally be <tt>pitch * height</tt> bytes in\n * size, but the <tt>dstBuf</tt> pointer can also be used to decode into a\n * specific region of a larger buffer.\n *\n * @param width width (in pixels) of the source and destination images\n *\n * @param pitch bytes per line in the destination image.  Normally, this should\n * be <tt>width * #tjPixelSize[pixelFormat]</tt> if the destination image is\n * unpadded, or <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line\n * of the destination image should be padded to the nearest 32-bit boundary, as\n * is the case for Windows bitmaps.  You can also be clever and use the pitch\n * parameter to skip lines, etc.  Setting this parameter to 0 is the equivalent\n * of setting it to <tt>width * #tjPixelSize[pixelFormat]</tt>.\n *\n * @param height height (in pixels) of the source and destination images\n *\n * @param pixelFormat pixel format of the destination image (see @ref TJPF\n * \"Pixel formats\".)\n *\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n * \"flags\"\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n */\nDLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, const unsigned char *srcBuf,\n  int pad, int subsamp, unsigned char *dstBuf, int width, int pitch,\n  int height, int pixelFormat, int flags);\n\n\n/**\n * Decode a set of Y, U (Cb), and V (Cr) image planes into an RGB or grayscale\n * image.  This function uses the accelerated color conversion routines in the\n * underlying codec but does not execute any of the other steps in the JPEG\n * decompression process.\n *\n * @param handle a handle to a TurboJPEG decompressor or transformer instance\n *\n * @param srcPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes\n * (or just a Y plane, if decoding a grayscale image) that contain a YUV image\n * to be decoded.  These planes can be contiguous or non-contiguous in memory.\n * The size of each plane should match the value returned by #tjPlaneSizeYUV()\n * for the given image width, height, strides, and level of chrominance\n * subsampling.  Refer to @ref YUVnotes \"YUV Image Format Notes\" for more\n * details.\n *\n * @param strides an array of integers, each specifying the number of bytes per\n * line in the corresponding plane of the YUV source image.  Setting the stride\n * for any plane to 0 is the same as setting it to the plane width (see\n * @ref YUVnotes \"YUV Image Format Notes\".)  If <tt>strides</tt> is NULL, then\n * the strides for all planes will be set to their respective plane widths.\n * You can adjust the strides in order to specify an arbitrary amount of line\n * padding in each plane or to decode a subregion of a larger YUV planar image.\n *\n * @param subsamp the level of chrominance subsampling used in the YUV source\n * image (see @ref TJSAMP \"Chrominance subsampling options\".)\n *\n * @param dstBuf pointer to an image buffer that will receive the decoded\n * image.  This buffer should normally be <tt>pitch * height</tt> bytes in\n * size, but the <tt>dstBuf</tt> pointer can also be used to decode into a\n * specific region of a larger buffer.\n *\n * @param width width (in pixels) of the source and destination images\n *\n * @param pitch bytes per line in the destination image.  Normally, this should\n * be <tt>width * #tjPixelSize[pixelFormat]</tt> if the destination image is\n * unpadded, or <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line\n * of the destination image should be padded to the nearest 32-bit boundary, as\n * is the case for Windows bitmaps.  You can also be clever and use the pitch\n * parameter to skip lines, etc.  Setting this parameter to 0 is the equivalent\n * of setting it to <tt>width * #tjPixelSize[pixelFormat]</tt>.\n *\n * @param height height (in pixels) of the source and destination images\n *\n * @param pixelFormat pixel format of the destination image (see @ref TJPF\n * \"Pixel formats\".)\n *\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n * \"flags\"\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n */\nDLLEXPORT int DLLCALL tjDecodeYUVPlanes(tjhandle handle,\n  const unsigned char **srcPlanes, const int *strides, int subsamp,\n  unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat,\n  int flags);\n\n\n/**\n * Create a new TurboJPEG transformer instance.\n *\n * @return a handle to the newly-created instance, or NULL if an error\n * occurred (see #tjGetErrorStr().)\n */\nDLLEXPORT tjhandle DLLCALL tjInitTransform(void);\n\n\n/**\n * Losslessly transform a JPEG image into another JPEG image.  Lossless\n * transforms work by moving the raw DCT coefficients from one JPEG image\n * structure to another without altering the values of the coefficients.  While\n * this is typically faster than decompressing the image, transforming it, and\n * re-compressing it, lossless transforms are not free.  Each lossless\n * transform requires reading and performing Huffman decoding on all of the\n * coefficients in the source image, regardless of the size of the destination\n * image.  Thus, this function provides a means of generating multiple\n * transformed images from the same source or  applying multiple\n * transformations simultaneously, in order to eliminate the need to read the\n * source coefficients multiple times.\n *\n * @param handle a handle to a TurboJPEG transformer instance\n *\n * @param jpegBuf pointer to a buffer containing the JPEG source image to\n * transform\n *\n * @param jpegSize size of the JPEG source image (in bytes)\n *\n * @param n the number of transformed JPEG images to generate\n *\n * @param dstBufs pointer to an array of n image buffers.  <tt>dstBufs[i]</tt>\n * will receive a JPEG image that has been transformed using the parameters in\n * <tt>transforms[i]</tt>.  TurboJPEG has the ability to reallocate the JPEG\n * buffer to accommodate the size of the JPEG image.  Thus, you can choose to:\n * -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and\n * let TurboJPEG grow the buffer as needed,\n * -# set <tt>dstBufs[i]</tt> to NULL to tell TurboJPEG to allocate the buffer\n * for you, or\n * -# pre-allocate the buffer to a \"worst case\" size determined by calling\n * #tjBufSize() with the transformed or cropped width and height.  This should\n * ensure that the buffer never has to be re-allocated (setting\n * #TJFLAG_NOREALLOC guarantees this.)\n * .\n * If you choose option 1, <tt>dstSizes[i]</tt> should be set to the size of\n * your pre-allocated buffer.  In any case, unless you have set\n * #TJFLAG_NOREALLOC, you should always check <tt>dstBufs[i]</tt> upon return\n * from this function, as it may have changed.\n *\n * @param dstSizes pointer to an array of n unsigned long variables that will\n * receive the actual sizes (in bytes) of each transformed JPEG image.  If\n * <tt>dstBufs[i]</tt> points to a pre-allocated buffer, then\n * <tt>dstSizes[i]</tt> should be set to the size of the buffer.  Upon return,\n * <tt>dstSizes[i]</tt> will contain the size of the JPEG image (in bytes.)\n *\n * @param transforms pointer to an array of n #tjtransform structures, each of\n * which specifies the transform parameters and/or cropping region for the\n * corresponding transformed output image.\n *\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n * \"flags\"\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n */\nDLLEXPORT int DLLCALL tjTransform(tjhandle handle,\n  const unsigned char *jpegBuf, unsigned long jpegSize, int n,\n  unsigned char **dstBufs, unsigned long *dstSizes, tjtransform *transforms,\n  int flags);\n\n\n/**\n * Destroy a TurboJPEG compressor, decompressor, or transformer instance.\n *\n * @param handle a handle to a TurboJPEG compressor, decompressor or\n * transformer instance\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n */\nDLLEXPORT int DLLCALL tjDestroy(tjhandle handle);\n\n\n/**\n * Allocate an image buffer for use with TurboJPEG.  You should always use\n * this function to allocate the JPEG destination buffer(s) for #tjCompress2()\n * and #tjTransform() unless you are disabling automatic buffer\n * (re)allocation (by setting #TJFLAG_NOREALLOC.)\n *\n * @param bytes the number of bytes to allocate\n *\n * @return a pointer to a newly-allocated buffer with the specified number of\n * bytes.\n *\n * @sa tjFree()\n */\nDLLEXPORT unsigned char* DLLCALL tjAlloc(int bytes);\n\n\n/**\n * Free an image buffer previously allocated by TurboJPEG.  You should always\n * use this function to free JPEG destination buffer(s) that were automatically\n * (re)allocated by #tjCompress2() or #tjTransform() or that were manually\n * allocated using #tjAlloc().\n *\n * @param buffer address of the buffer to free\n *\n * @sa tjAlloc()\n */\nDLLEXPORT void DLLCALL tjFree(unsigned char *buffer);\n\n\n/**\n * Returns a descriptive error message explaining why the last command failed.\n *\n * @return a descriptive error message explaining why the last command failed.\n */\nDLLEXPORT char* DLLCALL tjGetErrorStr(void);\n\n\n/* Deprecated functions and macros */\n#define TJFLAG_FORCEMMX        8\n#define TJFLAG_FORCESSE       16\n#define TJFLAG_FORCESSE2      32\n#define TJFLAG_FORCESSE3     128\n\n\n/* Backward compatibility functions and macros (nothing to see here) */\n#define NUMSUBOPT TJ_NUMSAMP\n#define TJ_444 TJSAMP_444\n#define TJ_422 TJSAMP_422\n#define TJ_420 TJSAMP_420\n#define TJ_411 TJSAMP_420\n#define TJ_GRAYSCALE TJSAMP_GRAY\n\n#define TJ_BGR 1\n#define TJ_BOTTOMUP TJFLAG_BOTTOMUP\n#define TJ_FORCEMMX TJFLAG_FORCEMMX\n#define TJ_FORCESSE TJFLAG_FORCESSE\n#define TJ_FORCESSE2 TJFLAG_FORCESSE2\n#define TJ_ALPHAFIRST 64\n#define TJ_FORCESSE3 TJFLAG_FORCESSE3\n#define TJ_FASTUPSAMPLE TJFLAG_FASTUPSAMPLE\n#define TJ_YUV 512\n\nDLLEXPORT unsigned long DLLCALL TJBUFSIZE(int width, int height);\n\nDLLEXPORT unsigned long DLLCALL TJBUFSIZEYUV(int width, int height,\n  int jpegSubsamp);\n\nDLLEXPORT unsigned long DLLCALL tjBufSizeYUV(int width, int height,\n  int subsamp);\n\nDLLEXPORT int DLLCALL tjCompress(tjhandle handle, unsigned char *srcBuf,\n  int width, int pitch, int height, int pixelSize, unsigned char *dstBuf,\n  unsigned long *compressedSize, int jpegSubsamp, int jpegQual, int flags);\n\nDLLEXPORT int DLLCALL tjEncodeYUV(tjhandle handle,\n  unsigned char *srcBuf, int width, int pitch, int height, int pixelSize,\n  unsigned char *dstBuf, int subsamp, int flags);\n\nDLLEXPORT int DLLCALL tjEncodeYUV2(tjhandle handle,\n  unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat,\n  unsigned char *dstBuf, int subsamp, int flags);\n\nDLLEXPORT int DLLCALL tjDecompressHeader(tjhandle handle,\n  unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height);\n\nDLLEXPORT int DLLCALL tjDecompressHeader2(tjhandle handle,\n  unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height,\n  int *jpegSubsamp);\n\nDLLEXPORT int DLLCALL tjDecompress(tjhandle handle,\n  unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,\n  int width, int pitch, int height, int pixelSize, int flags);\n\nDLLEXPORT int DLLCALL tjDecompressToYUV(tjhandle handle,\n  unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,\n  int flags);\n\n\n/**\n * @}\n */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/usage.txt",
    "content": "NOTE:  This file was modified by The libjpeg-turbo Project to include only\ninformation relevant to libjpeg-turbo and to wordsmith certain sections.\n\nUSAGE instructions for the Independent JPEG Group's JPEG software\n=================================================================\n\nThis file describes usage of the JPEG conversion programs cjpeg and djpeg,\nas well as the utility programs jpegtran, rdjpgcom and wrjpgcom.  (See\nthe other documentation files if you wish to use the JPEG library within\nyour own programs.)\n\nIf you are on a Unix machine you may prefer to read the Unix-style manual\npages in files cjpeg.1, djpeg.1, jpegtran.1, rdjpgcom.1, wrjpgcom.1.\n\n\nINTRODUCTION\n\nThese programs implement JPEG image encoding, decoding, and transcoding.\nJPEG (pronounced \"jay-peg\") is a standardized compression method for\nfull-color and grayscale images.\n\n\nGENERAL USAGE\n\nWe provide two programs, cjpeg to compress an image file into JPEG format,\nand djpeg to decompress a JPEG file back into a conventional image format.\n\nOn Unix-like systems, you say:\n        cjpeg [switches] [imagefile] >jpegfile\nor\n        djpeg [switches] [jpegfile]  >imagefile\nThe programs read the specified input file, or standard input if none is\nnamed.  They always write to standard output (with trace/error messages to\nstandard error).  These conventions are handy for piping images between\nprograms.\n\nOn most non-Unix systems, you say:\n        cjpeg [switches] imagefile jpegfile\nor\n        djpeg [switches] jpegfile  imagefile\ni.e., both the input and output files are named on the command line.  This\nstyle is a little more foolproof, and it loses no functionality if you don't\nhave pipes.  (You can get this style on Unix too, if you prefer, by defining\nTWO_FILE_COMMANDLINE when you compile the programs; see install.txt.)\n\nYou can also say:\n        cjpeg [switches] -outfile jpegfile  imagefile\nor\n        djpeg [switches] -outfile imagefile  jpegfile\nThis syntax works on all systems, so it is useful for scripts.\n\nThe currently supported image file formats are: PPM (PBMPLUS color format),\nPGM (PBMPLUS grayscale format), BMP, Targa, and RLE (Utah Raster Toolkit\nformat).  (RLE is supported only if the URT library is available, which it\nisn't on most non-Unix systems.)  cjpeg recognizes the input image format\nautomatically, with the exception of some Targa files.  You have to tell djpeg\nwhich format to generate.\n\nJPEG files are in the defacto standard JFIF file format.  There are other,\nless widely used JPEG-based file formats, but we don't support them.\n\nAll switch names may be abbreviated; for example, -grayscale may be written\n-gray or -gr.  Most of the \"basic\" switches can be abbreviated to as little as\none letter.  Upper and lower case are equivalent (-BMP is the same as -bmp).\nBritish spellings are also accepted (e.g., -greyscale), though for brevity\nthese are not mentioned below.\n\n\nCJPEG DETAILS\n\nThe basic command line switches for cjpeg are:\n\n        -quality N[,...]  Scale quantization tables to adjust image quality.\n                          Quality is 0 (worst) to 100 (best); default is 75.\n                          (See below for more info.)\n\n        -grayscale      Create monochrome JPEG file from color input.\n                        Be sure to use this switch when compressing a grayscale\n                        BMP file, because cjpeg isn't bright enough to notice\n                        whether a BMP file uses only shades of gray.  By\n                        saying -grayscale, you'll get a smaller JPEG file that\n                        takes less time to process.\n\n        -rgb            Create RGB JPEG file.\n                        Using this switch suppresses the conversion from RGB\n                        colorspace input to the default YCbCr JPEG colorspace.\n\n        -optimize       Perform optimization of entropy encoding parameters.\n                        Without this, default encoding parameters are used.\n                        -optimize usually makes the JPEG file a little smaller,\n                        but cjpeg runs somewhat slower and needs much more\n                        memory.  Image quality and speed of decompression are\n                        unaffected by -optimize.\n\n        -progressive    Create progressive JPEG file (see below).\n\n        -targa          Input file is Targa format.  Targa files that contain\n                        an \"identification\" field will not be automatically\n                        recognized by cjpeg; for such files you must specify\n                        -targa to make cjpeg treat the input as Targa format.\n                        For most Targa files, you won't need this switch.\n\nThe -quality switch lets you trade off compressed file size against quality of\nthe reconstructed image: the higher the quality setting, the larger the JPEG\nfile, and the closer the output image will be to the original input.  Normally\nyou want to use the lowest quality setting (smallest file) that decompresses\ninto something visually indistinguishable from the original image.  For this\npurpose the quality setting should generally be between 50 and 95 (the default\nis 75) for photographic images.  If you see defects at -quality 75, then go up\n5 or 10 counts at a time until you are happy with the output image.  (The\noptimal setting will vary from one image to another.)\n\n-quality 100 will generate a quantization table of all 1's, minimizing loss\nin the quantization step (but there is still information loss in subsampling,\nas well as roundoff error.)  For most images, specifying a quality value above\nabout 95 will increase the size of the compressed file dramatically, and while\nthe quality gain from these higher quality values is measurable (using metrics\nsuch as PSNR or SSIM), it is rarely perceivable by human vision.\n\nIn the other direction, quality values below 50 will produce very small files\nof low image quality.  Settings around 5 to 10 might be useful in preparing an\nindex of a large image library, for example.  Try -quality 2 (or so) for some\namusing Cubist effects.  (Note: quality values below about 25 generate 2-byte\nquantization tables, which are considered optional in the JPEG standard.\ncjpeg emits a warning message when you give such a quality value, because some\nother JPEG programs may be unable to decode the resulting file.  Use -baseline\nif you need to ensure compatibility at low quality values.)\n\nThe -quality option has been extended in this version of cjpeg to support\nseparate quality settings for luminance and chrominance (or, in general,\nseparate settings for every quantization table slot.)  The principle is the\nsame as chrominance subsampling:  since the human eye is more sensitive to\nspatial changes in brightness than spatial changes in color, the chrominance\ncomponents can be quantized more than the luminance components without\nincurring any visible image quality loss.  However, unlike subsampling, this\nfeature reduces data in the frequency domain instead of the spatial domain,\nwhich allows for more fine-grained control.  This option is useful in\nquality-sensitive applications, for which the artifacts generated by\nsubsampling may be unacceptable.\n\nThe -quality option accepts a comma-separated list of parameters, which\nrespectively refer to the quality levels that should be assigned to the\nquantization table slots.  If there are more q-table slots than parameters,\nthen the last parameter is replicated.  Thus, if only one quality parameter is\ngiven, this is used for both luminance and chrominance (slots 0 and 1,\nrespectively), preserving the legacy behavior of cjpeg v6b and prior.  More (or\ncustomized) quantization tables can be set with the -qtables option and\nassigned to components with the -qslots option (see the \"wizard\" switches\nbelow.)\n\nJPEG  files  generated  with separate luminance and chrominance quality are\nfully compliant with standard JPEG decoders.\n\nCAUTION: For this setting to be useful, be sure to pass an argument of\n-sample 1x1 to cjpeg to disable chrominance subsampling.  Otherwise, the\ndefault subsampling level (2x2, AKA \"4:2:0\") will be used.\n\nThe -progressive switch creates a \"progressive JPEG\" file.  In this type of\nJPEG file, the data is stored in multiple scans of increasing quality.  If the\nfile is being transmitted over a slow communications link, the decoder can use\nthe first scan to display a low-quality image very quickly, and can then\nimprove the display with each subsequent scan.  The final image is exactly\nequivalent to a standard JPEG file of the same quality setting, and the total\nfile size is about the same --- often a little smaller.\n\nSwitches for advanced users:\n\n        -arithmetic     Use arithmetic coding.  CAUTION: arithmetic coded JPEG\n                        is not yet widely implemented, so many decoders will\n                        be unable to view an arithmetic coded JPEG file at\n                        all.\n\n        -dct int        Use integer DCT method (default).\n        -dct fast       Use fast integer DCT (less accurate).\n                        In libjpeg-turbo, the fast method is generally about\n                        5-15% faster than the int method when using the\n                        x86/x86-64 SIMD extensions (results may vary with other\n                        SIMD implementations, or when using libjpeg-turbo\n                        without SIMD extensions.)  For quality levels of 90 and\n                        below, there should be little or no perceptible\n                        difference between the two algorithms.  For quality\n                        levels above 90, however, the difference between\n                        the fast and the int methods becomes more pronounced.\n                        With quality=97, for instance, the fast method incurs\n                        generally about a 1-3 dB loss (in PSNR) relative to\n                        the int method, but this can be larger for some images.\n                        Do not use the fast method with quality levels above\n                        97.  The algorithm often degenerates at quality=98 and\n                        above and can actually produce a more lossy image than\n                        if lower quality levels had been used.  Also, in\n                        libjpeg-turbo, the fast method is not fully accerated\n                        for quality levels above 97, so it will be slower than\n                        the int method.\n        -dct float      Use floating-point DCT method.\n                        The float method is mainly a legacy feature.  It does\n                        not produce significantly more accurate results than\n                        the int method, and it is much slower.  The float\n                        method may also give different results on different\n                        machines due to varying roundoff behavior, whereas the\n                        integer methods should give the same results on all\n                        machines.\n\n        -restart N      Emit a JPEG restart marker every N MCU rows, or every\n                        N MCU blocks if \"B\" is attached to the number.\n                        -restart 0 (the default) means no restart markers.\n\n        -smooth N       Smooth the input image to eliminate dithering noise.\n                        N, ranging from 1 to 100, indicates the strength of\n                        smoothing.  0 (the default) means no smoothing.\n\n        -maxmemory N    Set limit for amount of memory to use in processing\n                        large images.  Value is in thousands of bytes, or\n                        millions of bytes if \"M\" is attached to the number.\n                        For example, -max 4m selects 4000000 bytes.  If more\n                        space is needed, temporary files will be used.\n\n        -verbose        Enable debug printout.  More -v's give more printout.\n        or  -debug      Also, version information is printed at startup.\n\nThe -restart option inserts extra markers that allow a JPEG decoder to\nresynchronize after a transmission error.  Without restart markers, any damage\nto a compressed file will usually ruin the image from the point of the error\nto the end of the image; with restart markers, the damage is usually confined\nto the portion of the image up to the next restart marker.  Of course, the\nrestart markers occupy extra space.  We recommend -restart 1 for images that\nwill be transmitted across unreliable networks such as Usenet.\n\nThe -smooth option filters the input to eliminate fine-scale noise.  This is\noften useful when converting dithered images to JPEG: a moderate smoothing\nfactor of 10 to 50 gets rid of dithering patterns in the input file, resulting\nin a smaller JPEG file and a better-looking image.  Too large a smoothing\nfactor will visibly blur the image, however.\n\nSwitches for wizards:\n\n        -baseline       Force baseline-compatible quantization tables to be\n                        generated.  This clamps quantization values to 8 bits\n                        even at low quality settings.  (This switch is poorly\n                        named, since it does not ensure that the output is\n                        actually baseline JPEG.  For example, you can use\n                        -baseline and -progressive together.)\n\n        -qtables file   Use the quantization tables given in the specified\n                        text file.\n\n        -qslots N[,...] Select which quantization table to use for each color\n                        component.\n\n        -sample HxV[,...]  Set JPEG sampling factors for each color component.\n\n        -scans file     Use the scan script given in the specified text file.\n\nThe \"wizard\" switches are intended for experimentation with JPEG.  If you\ndon't know what you are doing, DON'T USE THEM.  These switches are documented\nfurther in the file wizard.txt.\n\n\nDJPEG DETAILS\n\nThe basic command line switches for djpeg are:\n\n        -colors N       Reduce image to at most N colors.  This reduces the\n        or -quantize N  number of colors used in the output image, so that it\n                        can be displayed on a colormapped display or stored in\n                        a colormapped file format.  For example, if you have\n                        an 8-bit display, you'd need to reduce to 256 or fewer\n                        colors.  (-colors is the recommended name, -quantize\n                        is provided only for backwards compatibility.)\n\n        -fast           Select recommended processing options for fast, low\n                        quality output.  (The default options are chosen for\n                        highest quality output.)  Currently, this is equivalent\n                        to \"-dct fast -nosmooth -onepass -dither ordered\".\n\n        -grayscale      Force grayscale output even if JPEG file is color.\n                        Useful for viewing on monochrome displays; also,\n                        djpeg runs noticeably faster in this mode.\n\n        -rgb            Force RGB output even if JPEG file is grayscale.\n\n        -scale M/N      Scale the output image by a factor M/N.  Currently\n                        the scale factor must be M/8, where M is an integer\n                        between 1 and 16 inclusive, or any reduced fraction\n                        thereof (such as 1/2, 3/4, etc.  Scaling is handy if\n                        the image is larger than your screen; also, djpeg runs\n                        much faster when scaling down the output.\n\n        -bmp            Select BMP output format (Windows flavor).  8-bit\n                        colormapped format is emitted if -colors or -grayscale\n                        is specified, or if the JPEG file is grayscale;\n                        otherwise, 24-bit full-color format is emitted.\n\n        -gif            Select GIF output format.  Since GIF does not support\n                        more than 256 colors, -colors 256 is assumed (unless\n                        you specify a smaller number of colors).  If you\n                        specify -fast, the default number of colors is 216.\n\n        -os2            Select BMP output format (OS/2 1.x flavor).  8-bit\n                        colormapped format is emitted if -colors or -grayscale\n                        is specified, or if the JPEG file is grayscale;\n                        otherwise, 24-bit full-color format is emitted.\n\n        -pnm            Select PBMPLUS (PPM/PGM) output format (this is the\n                        default format).  PGM is emitted if the JPEG file is\n                        grayscale or if -grayscale is specified; otherwise\n                        PPM is emitted.\n\n        -rle            Select RLE output format.  (Requires URT library.)\n\n        -targa          Select Targa output format.  Grayscale format is\n                        emitted if the JPEG file is grayscale or if\n                        -grayscale is specified; otherwise, colormapped format\n                        is emitted if -colors is specified; otherwise, 24-bit\n                        full-color format is emitted.\n\nSwitches for advanced users:\n\n        -dct int        Use integer DCT method (default).\n        -dct fast       Use fast integer DCT (less accurate).\n                        In libjpeg-turbo, the fast method is generally about\n                        5-15% faster than the int method when using the\n                        x86/x86-64 SIMD extensions (results may vary with other\n                        SIMD implementations, or when using libjpeg-turbo\n                        without SIMD extensions.)  If the JPEG image was\n                        compressed using a quality level of 85 or below, then\n                        there should be little or no perceptible difference\n                        between the two algorithms.  When decompressing images\n                        that were compressed using quality levels above 85,\n                        however, the difference between the fast and int\n                        methods becomes more pronounced.  With images\n                        compressed using quality=97, for instance, the fast\n                        method incurs generally about a 4-6 dB loss (in PSNR)\n                        relative to the int method, but this can be larger for\n                        some images.  If you can avoid it, do not use the fast\n                        method when decompressing images that were compressed\n                        using quality levels above 97.  The algorithm often\n                        degenerates for such images and can actually produce\n                        a more lossy output image than if the JPEG image had\n                        been compressed using lower quality levels.\n        -dct float      Use floating-point DCT method.\n                        The float method is mainly a legacy feature.  It does\n                        not produce significantly more accurate results than\n                        the int method, and it is much slower.  The float\n                        method may also give different results on different\n                        machines due to varying roundoff behavior, whereas the\n                        integer methods should give the same results on all\n                        machines.\n\n        -dither fs      Use Floyd-Steinberg dithering in color quantization.\n        -dither ordered Use ordered dithering in color quantization.\n        -dither none    Do not use dithering in color quantization.\n                        By default, Floyd-Steinberg dithering is applied when\n                        quantizing colors; this is slow but usually produces\n                        the best results.  Ordered dither is a compromise\n                        between speed and quality; no dithering is fast but\n                        usually looks awful.  Note that these switches have\n                        no effect unless color quantization is being done.\n                        Ordered dither is only available in -onepass mode.\n\n        -map FILE       Quantize to the colors used in the specified image\n                        file.  This is useful for producing multiple files\n                        with identical color maps, or for forcing a predefined\n                        set of colors to be used.  The FILE must be a GIF\n                        or PPM file.  This option overrides -colors and\n                        -onepass.\n\n        -nosmooth       Use a faster, lower-quality upsampling routine.\n\n        -onepass        Use one-pass instead of two-pass color quantization.\n                        The one-pass method is faster and needs less memory,\n                        but it produces a lower-quality image.  -onepass is\n                        ignored unless you also say -colors N.  Also,\n                        the one-pass method is always used for grayscale\n                        output (the two-pass method is no improvement then).\n\n        -maxmemory N    Set limit for amount of memory to use in processing\n                        large images.  Value is in thousands of bytes, or\n                        millions of bytes if \"M\" is attached to the number.\n                        For example, -max 4m selects 4000000 bytes.  If more\n                        space is needed, temporary files will be used.\n\n        -verbose        Enable debug printout.  More -v's give more printout.\n        or  -debug      Also, version information is printed at startup.\n\n\nHINTS FOR CJPEG\n\nColor GIF files are not the ideal input for JPEG; JPEG is really intended for\ncompressing full-color (24-bit) images.  In particular, don't try to convert\ncartoons, line drawings, and other images that have only a few distinct\ncolors.  GIF works great on these, JPEG does not.  If you want to convert a\nGIF to JPEG, you should experiment with cjpeg's -quality and -smooth options\nto get a satisfactory conversion.  -smooth 10 or so is often helpful.\n\nAvoid running an image through a series of JPEG compression/decompression\ncycles.  Image quality loss will accumulate; after ten or so cycles the image\nmay be noticeably worse than it was after one cycle.  It's best to use a\nlossless format while manipulating an image, then convert to JPEG format when\nyou are ready to file the image away.\n\nThe -optimize option to cjpeg is worth using when you are making a \"final\"\nversion for posting or archiving.  It's also a win when you are using low\nquality settings to make very small JPEG files; the percentage improvement\nis often a lot more than it is on larger files.  (At present, -optimize\nmode is always selected when generating progressive JPEG files.)\n\nSupport for GIF input files was removed in cjpeg v6b due to concerns over\nthe Unisys LZW patent.  Although this patent expired in 2006, cjpeg still\nlacks GIF support, for these historical reasons.  (Conversion of GIF files to\nJPEG is usually a bad idea anyway.)\n\n\nHINTS FOR DJPEG\n\nTo get a quick preview of an image, use the -grayscale and/or -scale switches.\n\"-grayscale -scale 1/8\" is the fastest case.\n\nSeveral options are available that trade off image quality to gain speed.\n\"-fast\" turns on the recommended settings.\n\n\"-dct fast\" and/or \"-nosmooth\" gain speed at a small sacrifice in quality.\nWhen producing a color-quantized image, \"-onepass -dither ordered\" is fast but\nmuch lower quality than the default behavior.  \"-dither none\" may give\nacceptable results in two-pass mode, but is seldom tolerable in one-pass mode.\n\nTwo-pass color quantization requires a good deal of memory; on MS-DOS machines\nit may run out of memory even with -maxmemory 0.  In that case you can still\ndecompress, with some loss of image quality, by specifying -onepass for\none-pass quantization.\n\nTo avoid the Unisys LZW patent (now expired), djpeg produces uncompressed GIF\nfiles.  These are larger than they should be, but are readable by standard GIF\ndecoders.\n\n\nHINTS FOR BOTH PROGRAMS\n\nIf more space is needed than will fit in the available main memory (as\ndetermined by -maxmemory), temporary files will be used.  (MS-DOS versions\nwill try to get extended or expanded memory first.)  The temporary files are\noften rather large: in typical cases they occupy three bytes per pixel, for\nexample 3*800*600 = 1.44Mb for an 800x600 image.  If you don't have enough\nfree disk space, leave out -progressive and -optimize (for cjpeg) or specify\n-onepass (for djpeg).\n\nOn MS-DOS, the temporary files are created in the directory named by the TMP\nor TEMP environment variable, or in the current directory if neither of those\nexist.  Amiga implementations put the temp files in the directory named by\nJPEGTMP:, so be sure to assign JPEGTMP: to a disk partition with adequate free\nspace.\n\nThe default memory usage limit (-maxmemory) is set when the software is\ncompiled.  If you get an \"insufficient memory\" error, try specifying a smaller\n-maxmemory value, even -maxmemory 0 to use the absolute minimum space.  You\nmay want to recompile with a smaller default value if this happens often.\n\nOn machines that have \"environment\" variables, you can define the environment\nvariable JPEGMEM to set the default memory limit.  The value is specified as\ndescribed for the -maxmemory switch.  JPEGMEM overrides the default value\nspecified when the program was compiled, and itself is overridden by an\nexplicit -maxmemory switch.\n\nOn MS-DOS machines, -maxmemory is the amount of main (conventional) memory to\nuse.  (Extended or expanded memory is also used if available.)  Most\nDOS-specific versions of this software do their own memory space estimation\nand do not need you to specify -maxmemory.\n\n\nJPEGTRAN\n\njpegtran performs various useful transformations of JPEG files.\nIt can translate the coded representation from one variant of JPEG to another,\nfor example from baseline JPEG to progressive JPEG or vice versa.  It can also\nperform some rearrangements of the image data, for example turning an image\nfrom landscape to portrait format by rotation.  For EXIF files and JPEG files\ncontaining Exif data, you may prefer to use exiftran instead.\n\njpegtran works by rearranging the compressed data (DCT coefficients), without\never fully decoding the image.  Therefore, its transformations are lossless:\nthere is no image degradation at all, which would not be true if you used\ndjpeg followed by cjpeg to accomplish the same conversion.  But by the same\ntoken, jpegtran cannot perform lossy operations such as changing the image\nquality.  However, while the image data is losslessly transformed, metadata\ncan be removed.  See the -copy option for specifics.\n\njpegtran uses a command line syntax similar to cjpeg or djpeg.\nOn Unix-like systems, you say:\n        jpegtran [switches] [inputfile] >outputfile\nOn most non-Unix systems, you say:\n        jpegtran [switches] inputfile outputfile\nwhere both the input and output files are JPEG files.\n\nTo specify the coded JPEG representation used in the output file,\njpegtran accepts a subset of the switches recognized by cjpeg:\n        -optimize       Perform optimization of entropy encoding parameters.\n        -progressive    Create progressive JPEG file.\n        -arithmetic     Use arithmetic coding.\n        -restart N      Emit a JPEG restart marker every N MCU rows, or every\n                        N MCU blocks if \"B\" is attached to the number.\n        -scans file     Use the scan script given in the specified text file.\nSee the previous discussion of cjpeg for more details about these switches.\nIf you specify none of these switches, you get a plain baseline-JPEG output\nfile.  The quality setting and so forth are determined by the input file.\n\nThe image can be losslessly transformed by giving one of these switches:\n        -flip horizontal        Mirror image horizontally (left-right).\n        -flip vertical          Mirror image vertically (top-bottom).\n        -rotate 90              Rotate image 90 degrees clockwise.\n        -rotate 180             Rotate image 180 degrees.\n        -rotate 270             Rotate image 270 degrees clockwise (or 90 ccw).\n        -transpose              Transpose image (across UL-to-LR axis).\n        -transverse             Transverse transpose (across UR-to-LL axis).\n\nThe transpose transformation has no restrictions regarding image dimensions.\nThe other transformations operate rather oddly if the image dimensions are not\na multiple of the iMCU size (usually 8 or 16 pixels), because they can only\ntransform complete blocks of DCT coefficient data in the desired way.\n\njpegtran's default behavior when transforming an odd-size image is designed\nto preserve exact reversibility and mathematical consistency of the\ntransformation set.  As stated, transpose is able to flip the entire image\narea.  Horizontal mirroring leaves any partial iMCU column at the right edge\nuntouched, but is able to flip all rows of the image.  Similarly, vertical\nmirroring leaves any partial iMCU row at the bottom edge untouched, but is\nable to flip all columns.  The other transforms can be built up as sequences\nof transpose and flip operations; for consistency, their actions on edge\npixels are defined to be the same as the end result of the corresponding\ntranspose-and-flip sequence.\n\nFor practical use, you may prefer to discard any untransformable edge pixels\nrather than having a strange-looking strip along the right and/or bottom edges\nof a transformed image.  To do this, add the -trim switch:\n        -trim           Drop non-transformable edge blocks.\nObviously, a transformation with -trim is not reversible, so strictly speaking\njpegtran with this switch is not lossless.  Also, the expected mathematical\nequivalences between the transformations no longer hold.  For example,\n\"-rot 270 -trim\" trims only the bottom edge, but \"-rot 90 -trim\" followed by\n\"-rot 180 -trim\" trims both edges.\n\nIf you are only interested in perfect transformations, add the -perfect switch:\n        -perfect        Fail with an error if the transformation is not\n                        perfect.\nFor example, you may want to do\n  jpegtran -rot 90 -perfect foo.jpg || djpeg foo.jpg | pnmflip -r90 | cjpeg\nto do a perfect rotation, if available, or an approximated one if not.\n\nThis version of jpegtran also offers a lossless crop option, which discards\ndata outside of a given image region but losslessly preserves what is inside.\nLike the rotate and flip transforms, lossless crop is restricted by the current\nJPEG format; the upper left corner of the selected region must fall on an iMCU\nboundary.  If it doesn't, then it is silently moved up and/or left to the\nnearest iMCU boundary (the lower right corner is unchanged.)  Thus, the output\nimage covers at least the requested region, but it may cover more.  The\nadjustment of the region dimensions may be optionally disabled by attaching an\n'f' character (\"force\") to the width or height number.\n\nThe image can be losslessly cropped by giving the switch:\n        -crop WxH+X+Y   Crop to a rectangular region of width W and height H,\n                        starting at point X,Y.\n\nOther not-strictly-lossless transformation switches are:\n\n        -grayscale      Force grayscale output.\nThis option discards the chrominance channels if the input image is YCbCr\n(ie, a standard color JPEG), resulting in a grayscale JPEG file.  The\nluminance channel is preserved exactly, so this is a better method of reducing\nto grayscale than decompression, conversion, and recompression.  This switch\nis particularly handy for fixing a monochrome picture that was mistakenly\nencoded as a color JPEG.  (In such a case, the space savings from getting rid\nof the near-empty chroma channels won't be large; but the decoding time for\na grayscale JPEG is substantially less than that for a color JPEG.)\n\njpegtran also recognizes these switches that control what to do with \"extra\"\nmarkers, such as comment blocks:\n        -copy none      Copy no extra markers from source file.  This setting\n                        suppresses all comments and other metadata in the\n                        source file.\n        -copy comments  Copy only comment markers.  This setting copies\n                        comments from the source file but discards any other\n                        metadata.\n        -copy all       Copy all extra markers.  This setting preserves\n                        miscellaneous markers found in the source file, such\n                        as JFIF thumbnails, Exif data, and Photoshop settings.\n                        In some files, these extra markers can be sizable.\n                        Note that this option will copy thumbnails as-is;\n                        they will not be transformed.\nThe default behavior is -copy comments.  (Note: in IJG releases v6 and v6a,\njpegtran always did the equivalent of -copy none.)\n\nAdditional switches recognized by jpegtran are:\n        -outfile filename\n        -maxmemory N\n        -verbose\n        -debug\nThese work the same as in cjpeg or djpeg.\n\n\nTHE COMMENT UTILITIES\n\nThe JPEG standard allows \"comment\" (COM) blocks to occur within a JPEG file.\nAlthough the standard doesn't actually define what COM blocks are for, they\nare widely used to hold user-supplied text strings.  This lets you add\nannotations, titles, index terms, etc to your JPEG files, and later retrieve\nthem as text.  COM blocks do not interfere with the image stored in the JPEG\nfile.  The maximum size of a COM block is 64K, but you can have as many of\nthem as you like in one JPEG file.\n\nWe provide two utility programs to display COM block contents and add COM\nblocks to a JPEG file.\n\nrdjpgcom searches a JPEG file and prints the contents of any COM blocks on\nstandard output.  The command line syntax is\n        rdjpgcom [-raw] [-verbose] [inputfilename]\nThe switch \"-raw\" (or just \"-r\") causes rdjpgcom to output non-printable\ncharacters in JPEG comments.  These characters are normally escaped for\nsecurity reasons.\nThe switch \"-verbose\" (or just \"-v\") causes rdjpgcom to also display the JPEG\nimage dimensions.  If you omit the input file name from the command line,\nthe JPEG file is read from standard input.  (This may not work on some\noperating systems, if binary data can't be read from stdin.)\n\nwrjpgcom adds a COM block, containing text you provide, to a JPEG file.\nOrdinarily, the COM block is added after any existing COM blocks, but you\ncan delete the old COM blocks if you wish.  wrjpgcom produces a new JPEG\nfile; it does not modify the input file.  DO NOT try to overwrite the input\nfile by directing wrjpgcom's output back into it; on most systems this will\njust destroy your file.\n\nThe command line syntax for wrjpgcom is similar to cjpeg's.  On Unix-like\nsystems, it is\n        wrjpgcom [switches] [inputfilename]\nThe output file is written to standard output.  The input file comes from\nthe named file, or from standard input if no input file is named.\n\nOn most non-Unix systems, the syntax is\n        wrjpgcom [switches] inputfilename outputfilename\nwhere both input and output file names must be given explicitly.\n\nwrjpgcom understands three switches:\n        -replace                 Delete any existing COM blocks from the file.\n        -comment \"Comment text\"  Supply new COM text on command line.\n        -cfile name              Read text for new COM block from named file.\n(Switch names can be abbreviated.)  If you have only one line of comment text\nto add, you can provide it on the command line with -comment.  The comment\ntext must be surrounded with quotes so that it is treated as a single\nargument.  Longer comments can be read from a text file.\n\nIf you give neither -comment nor -cfile, then wrjpgcom will read the comment\ntext from standard input.  (In this case an input image file name MUST be\nsupplied, so that the source JPEG file comes from somewhere else.)  You can\nenter multiple lines, up to 64KB worth.  Type an end-of-file indicator\n(usually control-D or control-Z) to terminate the comment text entry.\n\nwrjpgcom will not add a COM block if the provided comment string is empty.\nTherefore -replace -comment \"\" can be used to delete all COM blocks from a\nfile.\n\nThese utility programs do not depend on the IJG JPEG library.  In\nparticular, the source code for rdjpgcom is intended as an illustration of\nthe minimum amount of code required to parse a JPEG file header correctly.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/win/jconfig.h.in",
    "content": "/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */\n/* see jconfig.txt for explanations */\n\n#define JPEG_LIB_VERSION @JPEG_LIB_VERSION@\n#define LIBJPEG_TURBO_VERSION @VERSION@\n#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@\n#cmakedefine C_ARITH_CODING_SUPPORTED\n#cmakedefine D_ARITH_CODING_SUPPORTED\n#cmakedefine MEM_SRCDST_SUPPORTED\n\n/*\n * Define BITS_IN_JSAMPLE as either\n *   8   for 8-bit sample values (the usual setting)\n *   12  for 12-bit sample values\n * Only 8 and 12 are legal data precisions for lossy JPEG according to the\n * JPEG standard, and the IJG code does not support anything else!\n * We do not support run-time selection of data precision, sorry.\n */\n\n#define BITS_IN_JSAMPLE  @BITS_IN_JSAMPLE@      /* use 8 or 12 */\n\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n/* #define void char */\n/* #define const */\n#undef __CHAR_UNSIGNED__\n#define HAVE_STDDEF_H\n#define HAVE_STDLIB_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#undef NEED_FAR_POINTERS\t/* we presume a 32-bit flat memory model */\n#undef INCOMPLETE_TYPES_BROKEN\n\n/* Define \"boolean\" as unsigned char, not int, per Windows custom */\n#ifndef __RPCNDR_H__\t\t/* don't conflict if rpcndr.h already read */\ntypedef unsigned char boolean;\n#endif\n#define HAVE_BOOLEAN\t\t/* prevent jmorecfg.h from redefining it */\n\n/* Define \"INT32\" as int, not long, per Windows custom */\n#if !(defined(_BASETSD_H_) || defined(_BASETSD_H))   /* don't conflict if basetsd.h already read */\ntypedef short INT16;\ntypedef signed int INT32;\n#endif\n#define XMD_H                   /* prevent jmorecfg.h from redefining it */\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n#endif /* JPEG_INTERNALS */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/win/jconfigint.h.in",
    "content": "#define VERSION \"@VERSION@\"\n#define BUILD \"@BUILD@\"\n#define PACKAGE_NAME \"@CMAKE_PROJECT_NAME@\"\n\n#ifndef INLINE\n#if defined(__GNUC__)\n#define INLINE inline __attribute__((always_inline))\n#elif defined(_MSC_VER)\n#define INLINE __forceinline\n#else\n#define INLINE\n#endif\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/win/jpeg62-memsrcdst.def",
    "content": "EXPORTS\n\tjcopy_block_row @ 1 ; \n\tjcopy_sample_rows @ 2 ; \n\tjdiv_round_up @ 3 ; \n\tjinit_1pass_quantizer @ 4 ; \n\tjinit_2pass_quantizer @ 5 ; \n\tjinit_c_coef_controller @ 6 ; \n\tjinit_c_main_controller @ 7 ; \n\tjinit_c_master_control @ 8 ; \n\tjinit_c_prep_controller @ 9 ; \n\tjinit_color_converter @ 10 ; \n\tjinit_color_deconverter @ 11 ; \n\tjinit_compress_master @ 12 ; \n\tjinit_d_coef_controller @ 13 ; \n\tjinit_d_main_controller @ 14 ; \n\tjinit_d_post_controller @ 15 ; \n\tjinit_downsampler @ 16 ; \n\tjinit_forward_dct @ 17 ; \n\tjinit_huff_decoder @ 18 ; \n\tjinit_huff_encoder @ 19 ; \n\tjinit_input_controller @ 20 ; \n\tjinit_inverse_dct @ 21 ; \n\tjinit_marker_reader @ 22 ; \n\tjinit_marker_writer @ 23 ; \n\tjinit_master_decompress @ 24 ; \n\tjinit_memory_mgr @ 25 ; \n\tjinit_merged_upsampler @ 26 ; \n\tjinit_phuff_decoder @ 27 ; \n\tjinit_phuff_encoder @ 28 ; \n\tjinit_upsampler @ 29 ; \n\tjpeg_CreateCompress @ 30 ; \n\tjpeg_CreateDecompress @ 31 ; \n\tjpeg_abort @ 32 ; \n\tjpeg_abort_compress @ 33 ; \n\tjpeg_abort_decompress @ 34 ; \n\tjpeg_add_quant_table @ 35 ; \n\tjpeg_alloc_huff_table @ 36 ; \n\tjpeg_alloc_quant_table @ 37 ; \n\tjpeg_calc_output_dimensions @ 38 ; \n\tjpeg_consume_input @ 39 ; \n\tjpeg_copy_critical_parameters @ 40 ; \n\tjpeg_default_colorspace @ 41 ; \n\tjpeg_destroy @ 42 ; \n\tjpeg_destroy_compress @ 43 ; \n\tjpeg_destroy_decompress @ 44 ; \n\tjpeg_fdct_float @ 45 ; \n\tjpeg_fdct_ifast @ 46 ; \n\tjpeg_fdct_islow @ 47 ; \n\tjpeg_fill_bit_buffer @ 48 ; \n\tjpeg_finish_compress @ 49 ; \n\tjpeg_finish_decompress @ 50 ; \n\tjpeg_finish_output @ 51 ; \n\tjpeg_free_large @ 52 ; \n\tjpeg_free_small @ 53 ; \n\tjpeg_gen_optimal_table @ 54 ; \n\tjpeg_get_large @ 55 ; \n\tjpeg_get_small @ 56 ; \n\tjpeg_has_multiple_scans @ 57 ; \n\tjpeg_huff_decode @ 58 ; \n\tjpeg_idct_1x1 @ 59 ; \n\tjpeg_idct_2x2 @ 60 ; \n\tjpeg_idct_4x4 @ 61 ; \n\tjpeg_idct_float @ 62 ; \n\tjpeg_idct_ifast @ 63 ; \n\tjpeg_idct_islow @ 64 ; \n\tjpeg_input_complete @ 65 ; \n\tjpeg_make_c_derived_tbl @ 66 ; \n\tjpeg_make_d_derived_tbl @ 67 ; \n\tjpeg_mem_available @ 68 ; \n\tjpeg_mem_init @ 69 ; \n\tjpeg_mem_term @ 70 ; \n\tjpeg_new_colormap @ 71 ; \n\tjpeg_open_backing_store @ 72 ; \n\tjpeg_quality_scaling @ 73 ; \n\tjpeg_read_coefficients @ 74 ; \n\tjpeg_read_header @ 75 ; \n\tjpeg_read_raw_data @ 76 ; \n\tjpeg_read_scanlines @ 77 ; \n\tjpeg_resync_to_restart @ 78 ; \n\tjpeg_save_markers @ 79 ; \n\tjpeg_set_colorspace @ 80 ; \n\tjpeg_set_defaults @ 81 ; \n\tjpeg_set_linear_quality @ 82 ; \n\tjpeg_set_marker_processor @ 83 ; \n\tjpeg_set_quality @ 84 ; \n\tjpeg_simple_progression @ 85 ; \n\tjpeg_start_compress @ 86 ; \n\tjpeg_start_decompress @ 87 ; \n\tjpeg_start_output @ 88 ; \n\tjpeg_std_error @ 89 ; \n\tjpeg_stdio_dest @ 90 ; \n\tjpeg_stdio_src @ 91 ; \n\tjpeg_suppress_tables @ 92 ; \n\tjpeg_write_coefficients @ 93 ; \n\tjpeg_write_m_byte @ 94 ; \n\tjpeg_write_m_header @ 95 ; \n\tjpeg_write_marker @ 96 ; \n\tjpeg_write_raw_data @ 97 ; \n\tjpeg_write_scanlines @ 98 ; \n\tjpeg_write_tables @ 99 ; \n\tjround_up @ 100 ; \n\tjzero_far @ 101 ; \n\tjpeg_mem_dest @ 102 ; \n\tjpeg_mem_src @ 103 ; \n\tjpeg_skip_scanlines @ 104 ; \n\tjpeg_crop_scanline @ 105 ; \n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/win/jpeg62.def",
    "content": "EXPORTS\n\tjcopy_block_row @ 1 ; \n\tjcopy_sample_rows @ 2 ; \n\tjdiv_round_up @ 3 ; \n\tjinit_1pass_quantizer @ 4 ; \n\tjinit_2pass_quantizer @ 5 ; \n\tjinit_c_coef_controller @ 6 ; \n\tjinit_c_main_controller @ 7 ; \n\tjinit_c_master_control @ 8 ; \n\tjinit_c_prep_controller @ 9 ; \n\tjinit_color_converter @ 10 ; \n\tjinit_color_deconverter @ 11 ; \n\tjinit_compress_master @ 12 ; \n\tjinit_d_coef_controller @ 13 ; \n\tjinit_d_main_controller @ 14 ; \n\tjinit_d_post_controller @ 15 ; \n\tjinit_downsampler @ 16 ; \n\tjinit_forward_dct @ 17 ; \n\tjinit_huff_decoder @ 18 ; \n\tjinit_huff_encoder @ 19 ; \n\tjinit_input_controller @ 20 ; \n\tjinit_inverse_dct @ 21 ; \n\tjinit_marker_reader @ 22 ; \n\tjinit_marker_writer @ 23 ; \n\tjinit_master_decompress @ 24 ; \n\tjinit_memory_mgr @ 25 ; \n\tjinit_merged_upsampler @ 26 ; \n\tjinit_phuff_decoder @ 27 ; \n\tjinit_phuff_encoder @ 28 ; \n\tjinit_upsampler @ 29 ; \n\tjpeg_CreateCompress @ 30 ; \n\tjpeg_CreateDecompress @ 31 ; \n\tjpeg_abort @ 32 ; \n\tjpeg_abort_compress @ 33 ; \n\tjpeg_abort_decompress @ 34 ; \n\tjpeg_add_quant_table @ 35 ; \n\tjpeg_alloc_huff_table @ 36 ; \n\tjpeg_alloc_quant_table @ 37 ; \n\tjpeg_calc_output_dimensions @ 38 ; \n\tjpeg_consume_input @ 39 ; \n\tjpeg_copy_critical_parameters @ 40 ; \n\tjpeg_default_colorspace @ 41 ; \n\tjpeg_destroy @ 42 ; \n\tjpeg_destroy_compress @ 43 ; \n\tjpeg_destroy_decompress @ 44 ; \n\tjpeg_fdct_float @ 45 ; \n\tjpeg_fdct_ifast @ 46 ; \n\tjpeg_fdct_islow @ 47 ; \n\tjpeg_fill_bit_buffer @ 48 ; \n\tjpeg_finish_compress @ 49 ; \n\tjpeg_finish_decompress @ 50 ; \n\tjpeg_finish_output @ 51 ; \n\tjpeg_free_large @ 52 ; \n\tjpeg_free_small @ 53 ; \n\tjpeg_gen_optimal_table @ 54 ; \n\tjpeg_get_large @ 55 ; \n\tjpeg_get_small @ 56 ; \n\tjpeg_has_multiple_scans @ 57 ; \n\tjpeg_huff_decode @ 58 ; \n\tjpeg_idct_1x1 @ 59 ; \n\tjpeg_idct_2x2 @ 60 ; \n\tjpeg_idct_4x4 @ 61 ; \n\tjpeg_idct_float @ 62 ; \n\tjpeg_idct_ifast @ 63 ; \n\tjpeg_idct_islow @ 64 ; \n\tjpeg_input_complete @ 65 ; \n\tjpeg_make_c_derived_tbl @ 66 ; \n\tjpeg_make_d_derived_tbl @ 67 ; \n\tjpeg_mem_available @ 68 ; \n\tjpeg_mem_init @ 69 ; \n\tjpeg_mem_term @ 70 ; \n\tjpeg_new_colormap @ 71 ; \n\tjpeg_open_backing_store @ 72 ; \n\tjpeg_quality_scaling @ 73 ; \n\tjpeg_read_coefficients @ 74 ; \n\tjpeg_read_header @ 75 ; \n\tjpeg_read_raw_data @ 76 ; \n\tjpeg_read_scanlines @ 77 ; \n\tjpeg_resync_to_restart @ 78 ; \n\tjpeg_save_markers @ 79 ; \n\tjpeg_set_colorspace @ 80 ; \n\tjpeg_set_defaults @ 81 ; \n\tjpeg_set_linear_quality @ 82 ; \n\tjpeg_set_marker_processor @ 83 ; \n\tjpeg_set_quality @ 84 ; \n\tjpeg_simple_progression @ 85 ; \n\tjpeg_start_compress @ 86 ; \n\tjpeg_start_decompress @ 87 ; \n\tjpeg_start_output @ 88 ; \n\tjpeg_std_error @ 89 ; \n\tjpeg_stdio_dest @ 90 ; \n\tjpeg_stdio_src @ 91 ; \n\tjpeg_suppress_tables @ 92 ; \n\tjpeg_write_coefficients @ 93 ; \n\tjpeg_write_m_byte @ 94 ; \n\tjpeg_write_m_header @ 95 ; \n\tjpeg_write_marker @ 96 ; \n\tjpeg_write_raw_data @ 97 ; \n\tjpeg_write_scanlines @ 98 ; \n\tjpeg_write_tables @ 99 ; \n\tjround_up @ 100 ; \n\tjzero_far @ 101 ; \n\tjpeg_skip_scanlines @ 102 ; \n\tjpeg_crop_scanline @ 103 ; \n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/win/jpeg7-memsrcdst.def",
    "content": "EXPORTS\n\tjcopy_block_row @ 1 ; \n\tjcopy_sample_rows @ 2 ; \n\tjdiv_round_up @ 3 ; \n\tjinit_1pass_quantizer @ 4 ; \n\tjinit_2pass_quantizer @ 5 ; \n\tjinit_c_coef_controller @ 6 ; \n\tjinit_c_main_controller @ 7 ; \n\tjinit_c_master_control @ 8 ; \n\tjinit_c_prep_controller @ 9 ; \n\tjinit_color_converter @ 10 ; \n\tjinit_color_deconverter @ 11 ; \n\tjinit_compress_master @ 12 ; \n\tjinit_d_coef_controller @ 13 ; \n\tjinit_d_main_controller @ 14 ; \n\tjinit_d_post_controller @ 15 ; \n\tjinit_downsampler @ 16 ; \n\tjinit_forward_dct @ 17 ; \n\tjinit_huff_decoder @ 18 ; \n\tjinit_huff_encoder @ 19 ; \n\tjinit_input_controller @ 20 ; \n\tjinit_inverse_dct @ 21 ; \n\tjinit_marker_reader @ 22 ; \n\tjinit_marker_writer @ 23 ; \n\tjinit_master_decompress @ 24 ; \n\tjinit_memory_mgr @ 25 ; \n\tjinit_merged_upsampler @ 26 ; \n\tjinit_phuff_decoder @ 27 ; \n\tjinit_phuff_encoder @ 28 ; \n\tjinit_upsampler @ 29 ; \n\tjpeg_CreateCompress @ 30 ; \n\tjpeg_CreateDecompress @ 31 ; \n\tjpeg_abort @ 32 ; \n\tjpeg_abort_compress @ 33 ; \n\tjpeg_abort_decompress @ 34 ; \n\tjpeg_add_quant_table @ 35 ; \n\tjpeg_alloc_huff_table @ 36 ; \n\tjpeg_alloc_quant_table @ 37 ; \n\tjpeg_calc_jpeg_dimensions @ 38 ; \n\tjpeg_calc_output_dimensions @ 39 ; \n\tjpeg_consume_input @ 40 ; \n\tjpeg_copy_critical_parameters @ 41 ; \n\tjpeg_default_colorspace @ 42 ; \n\tjpeg_default_qtables @ 43 ;\n\tjpeg_destroy @ 44 ; \n\tjpeg_destroy_compress @ 45 ; \n\tjpeg_destroy_decompress @ 46 ; \n\tjpeg_fdct_float @ 47 ; \n\tjpeg_fdct_ifast @ 48 ; \n\tjpeg_fdct_islow @ 49 ; \n\tjpeg_fill_bit_buffer @ 50 ; \n\tjpeg_finish_compress @ 51 ; \n\tjpeg_finish_decompress @ 52 ; \n\tjpeg_finish_output @ 53 ; \n\tjpeg_free_large @ 54 ; \n\tjpeg_free_small @ 55 ; \n\tjpeg_gen_optimal_table @ 56 ; \n\tjpeg_get_large @ 57 ; \n\tjpeg_get_small @ 58 ; \n\tjpeg_has_multiple_scans @ 59 ; \n\tjpeg_huff_decode @ 60 ; \n\tjpeg_idct_1x1 @ 61 ; \n\tjpeg_idct_2x2 @ 62 ; \n\tjpeg_idct_4x4 @ 63 ; \n\tjpeg_idct_float @ 64 ; \n\tjpeg_idct_ifast @ 65 ; \n\tjpeg_idct_islow @ 66 ; \n\tjpeg_input_complete @ 67 ; \n\tjpeg_make_c_derived_tbl @ 68 ; \n\tjpeg_make_d_derived_tbl @ 69 ; \n\tjpeg_mem_available @ 70 ; \n\tjpeg_mem_init @ 71 ; \n\tjpeg_mem_term @ 72 ; \n\tjpeg_new_colormap @ 73 ; \n\tjpeg_open_backing_store @ 74 ; \n\tjpeg_quality_scaling @ 75 ; \n\tjpeg_read_coefficients @ 76 ; \n\tjpeg_read_header @ 77 ; \n\tjpeg_read_raw_data @ 78 ; \n\tjpeg_read_scanlines @ 79 ; \n\tjpeg_resync_to_restart @ 80 ; \n\tjpeg_save_markers @ 81 ; \n\tjpeg_set_colorspace @ 82 ; \n\tjpeg_set_defaults @ 83 ; \n\tjpeg_set_linear_quality @ 84 ; \n\tjpeg_set_marker_processor @ 85 ; \n\tjpeg_set_quality @ 86 ; \n\tjpeg_simple_progression @ 87 ; \n\tjpeg_start_compress @ 88 ; \n\tjpeg_start_decompress @ 89 ; \n\tjpeg_start_output @ 90 ; \n\tjpeg_std_error @ 91 ; \n\tjpeg_stdio_dest @ 92 ; \n\tjpeg_stdio_src @ 93 ; \n\tjpeg_suppress_tables @ 94 ; \n\tjpeg_write_coefficients @ 95 ; \n\tjpeg_write_m_byte @ 96 ; \n\tjpeg_write_m_header @ 97 ; \n\tjpeg_write_marker @ 98 ; \n\tjpeg_write_raw_data @ 99 ; \n\tjpeg_write_scanlines @ 100 ; \n\tjpeg_write_tables @ 101 ; \n\tjround_up @ 102 ; \n\tjzero_far @ 103 ; \n\tjpeg_mem_dest @ 104 ; \n\tjpeg_mem_src @ 105 ; \n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/win/jpeg7.def",
    "content": "EXPORTS\n\tjcopy_block_row @ 1 ; \n\tjcopy_sample_rows @ 2 ; \n\tjdiv_round_up @ 3 ; \n\tjinit_1pass_quantizer @ 4 ; \n\tjinit_2pass_quantizer @ 5 ; \n\tjinit_c_coef_controller @ 6 ; \n\tjinit_c_main_controller @ 7 ; \n\tjinit_c_master_control @ 8 ; \n\tjinit_c_prep_controller @ 9 ; \n\tjinit_color_converter @ 10 ; \n\tjinit_color_deconverter @ 11 ; \n\tjinit_compress_master @ 12 ; \n\tjinit_d_coef_controller @ 13 ; \n\tjinit_d_main_controller @ 14 ; \n\tjinit_d_post_controller @ 15 ; \n\tjinit_downsampler @ 16 ; \n\tjinit_forward_dct @ 17 ; \n\tjinit_huff_decoder @ 18 ; \n\tjinit_huff_encoder @ 19 ; \n\tjinit_input_controller @ 20 ; \n\tjinit_inverse_dct @ 21 ; \n\tjinit_marker_reader @ 22 ; \n\tjinit_marker_writer @ 23 ; \n\tjinit_master_decompress @ 24 ; \n\tjinit_memory_mgr @ 25 ; \n\tjinit_merged_upsampler @ 26 ; \n\tjinit_phuff_decoder @ 27 ; \n\tjinit_phuff_encoder @ 28 ; \n\tjinit_upsampler @ 29 ; \n\tjpeg_CreateCompress @ 30 ; \n\tjpeg_CreateDecompress @ 31 ; \n\tjpeg_abort @ 32 ; \n\tjpeg_abort_compress @ 33 ; \n\tjpeg_abort_decompress @ 34 ; \n\tjpeg_add_quant_table @ 35 ; \n\tjpeg_alloc_huff_table @ 36 ; \n\tjpeg_alloc_quant_table @ 37 ; \n\tjpeg_calc_jpeg_dimensions @ 38 ; \n\tjpeg_calc_output_dimensions @ 39 ; \n\tjpeg_consume_input @ 40 ; \n\tjpeg_copy_critical_parameters @ 41 ; \n\tjpeg_default_colorspace @ 42 ; \n\tjpeg_default_qtables @ 43 ;\n\tjpeg_destroy @ 44 ; \n\tjpeg_destroy_compress @ 45 ; \n\tjpeg_destroy_decompress @ 46 ; \n\tjpeg_fdct_float @ 47 ; \n\tjpeg_fdct_ifast @ 48 ; \n\tjpeg_fdct_islow @ 49 ; \n\tjpeg_fill_bit_buffer @ 50 ; \n\tjpeg_finish_compress @ 51 ; \n\tjpeg_finish_decompress @ 52 ; \n\tjpeg_finish_output @ 53 ; \n\tjpeg_free_large @ 54 ; \n\tjpeg_free_small @ 55 ; \n\tjpeg_gen_optimal_table @ 56 ; \n\tjpeg_get_large @ 57 ; \n\tjpeg_get_small @ 58 ; \n\tjpeg_has_multiple_scans @ 59 ; \n\tjpeg_huff_decode @ 60 ; \n\tjpeg_idct_1x1 @ 61 ; \n\tjpeg_idct_2x2 @ 62 ; \n\tjpeg_idct_4x4 @ 63 ; \n\tjpeg_idct_float @ 64 ; \n\tjpeg_idct_ifast @ 65 ; \n\tjpeg_idct_islow @ 66 ; \n\tjpeg_input_complete @ 67 ; \n\tjpeg_make_c_derived_tbl @ 68 ; \n\tjpeg_make_d_derived_tbl @ 69 ; \n\tjpeg_mem_available @ 70 ; \n\tjpeg_mem_init @ 71 ; \n\tjpeg_mem_term @ 72 ; \n\tjpeg_new_colormap @ 73 ; \n\tjpeg_open_backing_store @ 74 ; \n\tjpeg_quality_scaling @ 75 ; \n\tjpeg_read_coefficients @ 76 ; \n\tjpeg_read_header @ 77 ; \n\tjpeg_read_raw_data @ 78 ; \n\tjpeg_read_scanlines @ 79 ; \n\tjpeg_resync_to_restart @ 80 ; \n\tjpeg_save_markers @ 81 ; \n\tjpeg_set_colorspace @ 82 ; \n\tjpeg_set_defaults @ 83 ; \n\tjpeg_set_linear_quality @ 84 ; \n\tjpeg_set_marker_processor @ 85 ; \n\tjpeg_set_quality @ 86 ; \n\tjpeg_simple_progression @ 87 ; \n\tjpeg_start_compress @ 88 ; \n\tjpeg_start_decompress @ 89 ; \n\tjpeg_start_output @ 90 ; \n\tjpeg_std_error @ 91 ; \n\tjpeg_stdio_dest @ 92 ; \n\tjpeg_stdio_src @ 93 ; \n\tjpeg_suppress_tables @ 94 ; \n\tjpeg_write_coefficients @ 95 ; \n\tjpeg_write_m_byte @ 96 ; \n\tjpeg_write_m_header @ 97 ; \n\tjpeg_write_marker @ 98 ; \n\tjpeg_write_raw_data @ 99 ; \n\tjpeg_write_scanlines @ 100 ; \n\tjpeg_write_tables @ 101 ; \n\tjround_up @ 102 ; \n\tjzero_far @ 103 ; \n\tjpeg_skip_scanlines @ 104 ; \n\tjpeg_crop_scanline @ 105 ; \n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/win/jpeg8.def",
    "content": "EXPORTS\n\tjcopy_block_row @ 1 ; \n\tjcopy_sample_rows @ 2 ; \n\tjdiv_round_up @ 3 ; \n\tjinit_1pass_quantizer @ 4 ; \n\tjinit_2pass_quantizer @ 5 ; \n\tjinit_c_coef_controller @ 6 ; \n\tjinit_c_main_controller @ 7 ; \n\tjinit_c_master_control @ 8 ; \n\tjinit_c_prep_controller @ 9 ; \n\tjinit_color_converter @ 10 ; \n\tjinit_color_deconverter @ 11 ; \n\tjinit_compress_master @ 12 ; \n\tjinit_d_coef_controller @ 13 ; \n\tjinit_d_main_controller @ 14 ; \n\tjinit_d_post_controller @ 15 ; \n\tjinit_downsampler @ 16 ; \n\tjinit_forward_dct @ 17 ; \n\tjinit_huff_decoder @ 18 ; \n\tjinit_huff_encoder @ 19 ; \n\tjinit_input_controller @ 20 ; \n\tjinit_inverse_dct @ 21 ; \n\tjinit_marker_reader @ 22 ; \n\tjinit_marker_writer @ 23 ; \n\tjinit_master_decompress @ 24 ; \n\tjinit_memory_mgr @ 25 ; \n\tjinit_merged_upsampler @ 26 ; \n\tjinit_phuff_decoder @ 27 ; \n\tjinit_phuff_encoder @ 28 ; \n\tjinit_upsampler @ 29 ; \n\tjpeg_CreateCompress @ 30 ; \n\tjpeg_CreateDecompress @ 31 ; \n\tjpeg_abort @ 32 ; \n\tjpeg_abort_compress @ 33 ; \n\tjpeg_abort_decompress @ 34 ; \n\tjpeg_add_quant_table @ 35 ; \n\tjpeg_alloc_huff_table @ 36 ; \n\tjpeg_alloc_quant_table @ 37 ; \n\tjpeg_calc_jpeg_dimensions @ 38 ; \n\tjpeg_calc_output_dimensions @ 39 ; \n\tjpeg_consume_input @ 40 ; \n\tjpeg_copy_critical_parameters @ 41 ; \n\tjpeg_core_output_dimensions @ 42 ; \n\tjpeg_default_colorspace @ 43 ; \n\tjpeg_default_qtables @ 44 ;\n\tjpeg_destroy @ 45 ; \n\tjpeg_destroy_compress @ 46 ; \n\tjpeg_destroy_decompress @ 47 ; \n\tjpeg_fdct_float @ 48 ; \n\tjpeg_fdct_ifast @ 49 ; \n\tjpeg_fdct_islow @ 50 ; \n\tjpeg_fill_bit_buffer @ 51 ; \n\tjpeg_finish_compress @ 52 ; \n\tjpeg_finish_decompress @ 53 ; \n\tjpeg_finish_output @ 54 ; \n\tjpeg_free_large @ 55 ; \n\tjpeg_free_small @ 56 ; \n\tjpeg_gen_optimal_table @ 57 ; \n\tjpeg_get_large @ 58 ; \n\tjpeg_get_small @ 59 ; \n\tjpeg_has_multiple_scans @ 60 ; \n\tjpeg_huff_decode @ 61 ; \n\tjpeg_idct_1x1 @ 62 ; \n\tjpeg_idct_2x2 @ 63 ; \n\tjpeg_idct_4x4 @ 64 ; \n\tjpeg_idct_float @ 65 ; \n\tjpeg_idct_ifast @ 66 ; \n\tjpeg_idct_islow @ 67 ; \n\tjpeg_input_complete @ 68 ; \n\tjpeg_make_c_derived_tbl @ 69 ; \n\tjpeg_make_d_derived_tbl @ 70 ; \n\tjpeg_mem_available @ 71 ; \n\tjpeg_mem_dest @ 72 ;\n\tjpeg_mem_init @ 73 ; \n\tjpeg_mem_src @ 74 ;\n\tjpeg_mem_term @ 75 ; \n\tjpeg_new_colormap @ 76 ; \n\tjpeg_open_backing_store @ 77 ; \n\tjpeg_quality_scaling @ 78 ; \n\tjpeg_read_coefficients @ 79 ; \n\tjpeg_read_header @ 80 ; \n\tjpeg_read_raw_data @ 81 ; \n\tjpeg_read_scanlines @ 82 ; \n\tjpeg_resync_to_restart @ 83 ; \n\tjpeg_save_markers @ 84 ; \n\tjpeg_set_colorspace @ 85 ; \n\tjpeg_set_defaults @ 86 ; \n\tjpeg_set_linear_quality @ 87 ; \n\tjpeg_set_marker_processor @ 88 ; \n\tjpeg_set_quality @ 89 ; \n\tjpeg_simple_progression @ 90 ; \n\tjpeg_start_compress @ 91 ; \n\tjpeg_start_decompress @ 92 ; \n\tjpeg_start_output @ 93 ; \n\tjpeg_std_error @ 94 ; \n\tjpeg_stdio_dest @ 95 ; \n\tjpeg_stdio_src @ 96 ; \n\tjpeg_suppress_tables @ 97 ; \n\tjpeg_write_coefficients @ 98 ; \n\tjpeg_write_m_byte @ 99 ; \n\tjpeg_write_m_header @ 100 ; \n\tjpeg_write_marker @ 101 ; \n\tjpeg_write_raw_data @ 102 ; \n\tjpeg_write_scanlines @ 103 ; \n\tjpeg_write_tables @ 104 ; \n\tjround_up @ 105 ; \n\tjzero_far @ 106 ; \n\tjpeg_skip_scanlines @ 107 ; \n\tjpeg_crop_scanline @ 108 ; \n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/win/jsimdcfg.inc",
    "content": ";\n; Automatically generated include file from jsimdcfg.inc.h\n;\n;\n; -- jpeglib.h\n;\n%define DCTSIZE 8\n%define DCTSIZE2 64\n;\n; -- jmorecfg.h\n;\n%define RGB_RED 0\n%define RGB_GREEN 1\n%define RGB_BLUE 2\n%define RGB_PIXELSIZE 3\n%define EXT_RGB_RED 0\n%define EXT_RGB_GREEN 1\n%define EXT_RGB_BLUE 2\n%define EXT_RGB_PIXELSIZE 3\n%define EXT_RGBX_RED 0\n%define EXT_RGBX_GREEN 1\n%define EXT_RGBX_BLUE 2\n%define EXT_RGBX_PIXELSIZE 4\n%define EXT_BGR_RED 2\n%define EXT_BGR_GREEN 1\n%define EXT_BGR_BLUE 0\n%define EXT_BGR_PIXELSIZE 3\n%define EXT_BGRX_RED 2\n%define EXT_BGRX_GREEN 1\n%define EXT_BGRX_BLUE 0\n%define EXT_BGRX_PIXELSIZE 4\n%define EXT_XBGR_RED 3\n%define EXT_XBGR_GREEN 2\n%define EXT_XBGR_BLUE 1\n%define EXT_XBGR_PIXELSIZE 4\n%define EXT_XRGB_RED 1\n%define EXT_XRGB_GREEN 2\n%define EXT_XRGB_BLUE 3\n%define EXT_XRGB_PIXELSIZE 4\n%define RGBX_FILLER_0XFF 1\n; Representation of a single sample (pixel element value).\n; On this SIMD implementation, this must be 'unsigned char'.\n;\n%define JSAMPLE byte ; unsigned char\n%define SIZEOF_JSAMPLE SIZEOF_BYTE ; sizeof(JSAMPLE)\n%define CENTERJSAMPLE 128\n; Representation of a DCT frequency coefficient.\n; On this SIMD implementation, this must be 'short'.\n;\n%define JCOEF word ; short\n%define SIZEOF_JCOEF SIZEOF_WORD ; sizeof(JCOEF)\n; Datatype used for image dimensions.\n; On this SIMD implementation, this must be 'unsigned int'.\n;\n%define JDIMENSION dword ; unsigned int\n%define SIZEOF_JDIMENSION SIZEOF_DWORD ; sizeof(JDIMENSION)\n%define JSAMPROW POINTER ; JSAMPLE * (jpeglib.h)\n%define JSAMPARRAY POINTER ; JSAMPROW * (jpeglib.h)\n%define JSAMPIMAGE POINTER ; JSAMPARRAY * (jpeglib.h)\n%define JCOEFPTR POINTER ; JCOEF * (jpeglib.h)\n%define SIZEOF_JSAMPROW SIZEOF_POINTER ; sizeof(JSAMPROW)\n%define SIZEOF_JSAMPARRAY SIZEOF_POINTER ; sizeof(JSAMPARRAY)\n%define SIZEOF_JSAMPIMAGE SIZEOF_POINTER ; sizeof(JSAMPIMAGE)\n%define SIZEOF_JCOEFPTR SIZEOF_POINTER ; sizeof(JCOEFPTR)\n;\n; -- jdct.h\n;\n; A forward DCT routine is given a pointer to a work area of type DCTELEM[];\n; the DCT is to be performed in-place in that buffer.\n; To maximize parallelism, Type DCTELEM is changed to short (originally, int).\n;\n%define DCTELEM word ; short\n%define SIZEOF_DCTELEM SIZEOF_WORD ; sizeof(DCTELEM)\n%define float FP32 ; float\n%define SIZEOF_FAST_FLOAT SIZEOF_FP32 ; sizeof(float)\n; To maximize parallelism, Type short is changed to short.\n;\n%define ISLOW_MULT_TYPE word ; must be short\n%define SIZEOF_ISLOW_MULT_TYPE SIZEOF_WORD ; sizeof(ISLOW_MULT_TYPE)\n%define IFAST_MULT_TYPE word ; must be short\n%define SIZEOF_IFAST_MULT_TYPE SIZEOF_WORD ; sizeof(IFAST_MULT_TYPE)\n%define IFAST_SCALE_BITS 2 ; fractional bits in scale factors\n%define FLOAT_MULT_TYPE FP32 ; must be float\n%define SIZEOF_FLOAT_MULT_TYPE SIZEOF_FP32 ; sizeof(FLOAT_MULT_TYPE)\n;\n; -- jsimd.h\n;\n%define JSIMD_NONE 0x00\n%define JSIMD_MMX 0x01\n%define JSIMD_3DNOW 0x02\n%define JSIMD_SSE 0x04\n%define JSIMD_SSE2 0x08\n; Short forms of external names for systems with brain-damaged linkers.\n;\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/wizard.txt",
    "content": "Advanced usage instructions for the Independent JPEG Group's JPEG software\n==========================================================================\n\nThis file describes cjpeg's \"switches for wizards\".\n\nThe \"wizard\" switches are intended for experimentation with JPEG by persons\nwho are reasonably knowledgeable about the JPEG standard.  If you don't know\nwhat you are doing, DON'T USE THESE SWITCHES.  You'll likely produce files\nwith worse image quality and/or poorer compression than you'd get from the\ndefault settings.  Furthermore, these switches must be used with caution\nwhen making files intended for general use, because not all JPEG decoders\nwill support unusual JPEG parameter settings.\n\n\nQuantization Table Adjustment\n-----------------------------\n\nOrdinarily, cjpeg starts with a default set of tables (the same ones given\nas examples in the JPEG standard) and scales them up or down according to\nthe -quality setting.  The details of the scaling algorithm can be found in\njcparam.c.  At very low quality settings, some quantization table entries\ncan get scaled up to values exceeding 255.  Although 2-byte quantization\nvalues are supported by the IJG software, this feature is not in baseline\nJPEG and is not supported by all implementations.  If you need to ensure\nwide compatibility of low-quality files, you can constrain the scaled\nquantization values to no more than 255 by giving the -baseline switch.\nNote that use of -baseline will result in poorer quality for the same file\nsize, since more bits than necessary are expended on higher AC coefficients.\n\nYou can substitute a different set of quantization values by using the\n-qtables switch:\n\n        -qtables file   Use the quantization tables given in the named file.\n\nThe specified file should be a text file containing decimal quantization\nvalues.  The file should contain one to four tables, each of 64 elements.\nThe tables are implicitly numbered 0,1,etc. in order of appearance.  Table\nentries appear in normal array order (NOT in the zigzag order in which they\nwill be stored in the JPEG file).\n\nQuantization table files are free format, in that arbitrary whitespace can\nappear between numbers.  Also, comments can be included: a comment starts\nwith '#' and extends to the end of the line.  Here is an example file that\nduplicates the default quantization tables:\n\n        # Quantization tables given in JPEG spec, section K.1\n\n        # This is table 0 (the luminance table):\n          16  11  10  16  24  40  51  61\n          12  12  14  19  26  58  60  55\n          14  13  16  24  40  57  69  56\n          14  17  22  29  51  87  80  62\n          18  22  37  56  68 109 103  77\n          24  35  55  64  81 104 113  92\n          49  64  78  87 103 121 120 101\n          72  92  95  98 112 100 103  99\n\n        # This is table 1 (the chrominance table):\n          17  18  24  47  99  99  99  99\n          18  21  26  66  99  99  99  99\n          24  26  56  99  99  99  99  99\n          47  66  99  99  99  99  99  99\n          99  99  99  99  99  99  99  99\n          99  99  99  99  99  99  99  99\n          99  99  99  99  99  99  99  99\n          99  99  99  99  99  99  99  99\n\nIf the -qtables switch is used without -quality, then the specified tables\nare used exactly as-is.  If both -qtables and -quality are used, then the\ntables taken from the file are scaled in the same fashion that the default\ntables would be scaled for that quality setting.  If -baseline appears, then\nthe quantization values are constrained to the range 1-255.\n\nBy default, cjpeg will use quantization table 0 for luminance components and\ntable 1 for chrominance components.  To override this choice, use the -qslots\nswitch:\n\n        -qslots N[,...]         Select which quantization table to use for\n                                each color component.\n\nThe -qslots switch specifies a quantization table number for each color\ncomponent, in the order in which the components appear in the JPEG SOF marker.\nFor example, to create a separate table for each of Y,Cb,Cr, you could\nprovide a -qtables file that defines three quantization tables and say\n\"-qslots 0,1,2\".  If -qslots gives fewer table numbers than there are color\ncomponents, then the last table number is repeated as necessary.\n\n\nSampling Factor Adjustment\n--------------------------\n\nBy default, cjpeg uses 2:1 horizontal and vertical downsampling when\ncompressing YCbCr data, and no downsampling for all other color spaces.\nYou can override this default with the -sample switch:\n\n        -sample HxV[,...]       Set JPEG sampling factors for each color\n                                component.\n\nThe -sample switch specifies the JPEG sampling factors for each color\ncomponent, in the order in which they appear in the JPEG SOF marker.\nIf you specify fewer HxV pairs than there are components, the remaining\ncomponents are set to 1x1 sampling.  For example, the default YCbCr setting\nis equivalent to \"-sample 2x2,1x1,1x1\", which can be abbreviated to\n\"-sample 2x2\".\n\nThere are still some JPEG decoders in existence that support only 2x1\nsampling (also called 4:2:2 sampling).  Compatibility with such decoders can\nbe achieved by specifying \"-sample 2x1\".  This is not recommended unless\nreally necessary, since it increases file size and encoding/decoding time\nwith very little quality gain.\n\n\nMultiple Scan / Progression Control\n-----------------------------------\n\nBy default, cjpeg emits a single-scan sequential JPEG file.  The\n-progressive switch generates a progressive JPEG file using a default series\nof progression parameters.  You can create multiple-scan sequential JPEG\nfiles or progressive JPEG files with custom progression parameters by using\nthe -scans switch:\n\n        -scans file     Use the scan sequence given in the named file.\n\nThe specified file should be a text file containing a \"scan script\".\nThe script specifies the contents and ordering of the scans to be emitted.\nEach entry in the script defines one scan.  A scan definition specifies\nthe components to be included in the scan, and for progressive JPEG it also\nspecifies the progression parameters Ss,Se,Ah,Al for the scan.  Scan\ndefinitions are separated by semicolons (';').  A semicolon after the last\nscan definition is optional.\n\nEach scan definition contains one to four component indexes, optionally\nfollowed by a colon (':') and the four progressive-JPEG parameters.  The\ncomponent indexes denote which color component(s) are to be transmitted in\nthe scan.  Components are numbered in the order in which they appear in the\nJPEG SOF marker, with the first component being numbered 0.  (Note that these\nindexes are not the \"component ID\" codes assigned to the components, just\npositional indexes.)\n\nThe progression parameters for each scan are:\n        Ss      Zigzag index of first coefficient included in scan\n        Se      Zigzag index of last coefficient included in scan\n        Ah      Zero for first scan of a coefficient, else Al of prior scan\n        Al      Successive approximation low bit position for scan\nIf the progression parameters are omitted, the values 0,63,0,0 are used,\nproducing a sequential JPEG file.  cjpeg automatically determines whether\nthe script represents a progressive or sequential file, by observing whether\nSs and Se values other than 0 and 63 appear.  (The -progressive switch is\nnot needed to specify this; in fact, it is ignored when -scans appears.)\nThe scan script must meet the JPEG restrictions on progression sequences.\n(cjpeg checks that the spec's requirements are obeyed.)\n\nScan script files are free format, in that arbitrary whitespace can appear\nbetween numbers and around punctuation.  Also, comments can be included: a\ncomment starts with '#' and extends to the end of the line.  For additional\nlegibility, commas or dashes can be placed between values.  (Actually, any\nsingle punctuation character other than ':' or ';' can be inserted.)  For\nexample, the following two scan definitions are equivalent:\n        0 1 2: 0 63 0 0;\n        0,1,2 : 0-63, 0,0 ;\n\nHere is an example of a scan script that generates a partially interleaved\nsequential JPEG file:\n\n        0;                      # Y only in first scan\n        1 2;                    # Cb and Cr in second scan\n\nHere is an example of a progressive scan script using only spectral selection\n(no successive approximation):\n\n        # Interleaved DC scan for Y,Cb,Cr:\n        0,1,2: 0-0,   0, 0 ;\n        # AC scans:\n        0:     1-2,   0, 0 ;    # First two Y AC coefficients\n        0:     3-5,   0, 0 ;    # Three more\n        1:     1-63,  0, 0 ;    # All AC coefficients for Cb\n        2:     1-63,  0, 0 ;    # All AC coefficients for Cr\n        0:     6-9,   0, 0 ;    # More Y coefficients\n        0:     10-63, 0, 0 ;    # Remaining Y coefficients\n\nHere is an example of a successive-approximation script.  This is equivalent\nto the default script used by \"cjpeg -progressive\" for YCbCr images:\n\n        # Initial DC scan for Y,Cb,Cr (lowest bit not sent)\n        0,1,2: 0-0,   0, 1 ;\n        # First AC scan: send first 5 Y AC coefficients, minus 2 lowest bits:\n        0:     1-5,   0, 2 ;\n        # Send all Cr,Cb AC coefficients, minus lowest bit:\n        # (chroma data is usually too small to be worth subdividing further;\n        #  but note we send Cr first since eye is least sensitive to Cb)\n        2:     1-63,  0, 1 ;\n        1:     1-63,  0, 1 ;\n        # Send remaining Y AC coefficients, minus 2 lowest bits:\n        0:     6-63,  0, 2 ;\n        # Send next-to-lowest bit of all Y AC coefficients:\n        0:     1-63,  2, 1 ;\n        # At this point we've sent all but the lowest bit of all coefficients.\n        # Send lowest bit of DC coefficients\n        0,1,2: 0-0,   1, 0 ;\n        # Send lowest bit of AC coefficients\n        2:     1-63,  1, 0 ;\n        1:     1-63,  1, 0 ;\n        # Y AC lowest bit scan is last; it's usually the largest scan\n        0:     1-63,  1, 0 ;\n\nIt may be worth pointing out that this script is tuned for quality settings\nof around 50 to 75.  For lower quality settings, you'd probably want to use\na script with fewer stages of successive approximation (otherwise the\ninitial scans will be really bad).  For higher quality settings, you might\nwant to use more stages of successive approximation (so that the initial\nscans are not too large).\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/wrbmp.c",
    "content": "/*\n * wrbmp.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2013, Linaro Limited.\n * Copyright (C) 2014-2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains routines to write output images in Microsoft \"BMP\"\n * format (MS Windows 3.x and OS/2 1.x flavors).\n * Either 8-bit colormapped or 24-bit full-color format can be written.\n * No compression is supported.\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume output to\n * an ordinary stdio stream.\n *\n * This code contributed by James Arthur Boucher.\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n#include \"jconfigint.h\"\n\n#ifdef BMP_SUPPORTED\n\n\n/*\n * To support 12-bit JPEG data, we'd have to scale output down to 8 bits.\n * This is not yet implemented.\n */\n\n#if BITS_IN_JSAMPLE != 8\n  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */\n#endif\n\n/*\n * Since BMP stores scanlines bottom-to-top, we have to invert the image\n * from JPEG's top-to-bottom order.  To do this, we save the outgoing data\n * in a virtual array during put_pixel_row calls, then actually emit the\n * BMP file during finish_output.  The virtual array contains one JSAMPLE per\n * pixel if the output is grayscale or colormapped, three if it is full color.\n */\n\n/* Private version of data destination object */\n\ntypedef struct {\n  struct djpeg_dest_struct pub; /* public fields */\n\n  boolean is_os2;               /* saves the OS2 format request flag */\n\n  jvirt_sarray_ptr whole_image; /* needed to reverse row order */\n  JDIMENSION data_width;        /* JSAMPLEs per row */\n  JDIMENSION row_width;         /* physical width of one row in the BMP file */\n  int pad_bytes;                /* number of padding bytes needed per row */\n  JDIMENSION cur_output_row;    /* next row# to write to virtual array */\n} bmp_dest_struct;\n\ntypedef bmp_dest_struct *bmp_dest_ptr;\n\n\n/* Forward declarations */\nLOCAL(void) write_colormap\n        (j_decompress_ptr cinfo, bmp_dest_ptr dest, int map_colors,\n         int map_entry_size);\n\n\nstatic INLINE boolean is_big_endian(void)\n{\n  int test_value = 1;\n  if(*(char *)&test_value != 1)\n    return TRUE;\n  return FALSE;\n}\n\n\n/*\n * Write some pixel data.\n * In this module rows_supplied will always be 1.\n */\n\nMETHODDEF(void)\nput_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n                JDIMENSION rows_supplied)\n/* This version is for writing 24-bit pixels */\n{\n  bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;\n  JSAMPARRAY image_ptr;\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n  int pad;\n\n  /* Access next row in virtual array */\n  image_ptr = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, dest->whole_image,\n     dest->cur_output_row, (JDIMENSION) 1, TRUE);\n  dest->cur_output_row++;\n\n  /* Transfer data.  Note destination values must be in BGR order\n   * (even though Microsoft's own documents say the opposite).\n   */\n  inptr = dest->pub.buffer[0];\n  outptr = image_ptr[0];\n\n  if(cinfo->out_color_space == JCS_RGB565) {\n    boolean big_endian = is_big_endian();\n    unsigned short *inptr2 = (unsigned short *)inptr;\n    for (col = cinfo->output_width; col > 0; col--) {\n      if (big_endian) {\n        outptr[0] = (*inptr2 >> 5) & 0xF8;\n        outptr[1] = ((*inptr2 << 5) & 0xE0) | ((*inptr2 >> 11) & 0x1C);\n        outptr[2] = *inptr2 & 0xF8;\n      } else {\n        outptr[0] = (*inptr2 << 3) & 0xF8;\n        outptr[1] = (*inptr2 >> 3) & 0xFC;\n        outptr[2] = (*inptr2 >> 8) & 0xF8;\n      }\n      outptr += 3;\n      inptr2++;\n    }\n  } else {\n    for (col = cinfo->output_width; col > 0; col--) {\n      outptr[2] = *inptr++;       /* can omit GETJSAMPLE() safely */\n      outptr[1] = *inptr++;\n      outptr[0] = *inptr++;\n      outptr += 3;\n    }\n  }\n\n  /* Zero out the pad bytes. */\n  pad = dest->pad_bytes;\n  while (--pad >= 0)\n    *outptr++ = 0;\n}\n\nMETHODDEF(void)\nput_gray_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n               JDIMENSION rows_supplied)\n/* This version is for grayscale OR quantized color output */\n{\n  bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;\n  JSAMPARRAY image_ptr;\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n  int pad;\n\n  /* Access next row in virtual array */\n  image_ptr = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, dest->whole_image,\n     dest->cur_output_row, (JDIMENSION) 1, TRUE);\n  dest->cur_output_row++;\n\n  /* Transfer data. */\n  inptr = dest->pub.buffer[0];\n  outptr = image_ptr[0];\n  for (col = cinfo->output_width; col > 0; col--) {\n    *outptr++ = *inptr++;       /* can omit GETJSAMPLE() safely */\n  }\n\n  /* Zero out the pad bytes. */\n  pad = dest->pad_bytes;\n  while (--pad >= 0)\n    *outptr++ = 0;\n}\n\n\n/*\n * Startup: normally writes the file header.\n * In this module we may as well postpone everything until finish_output.\n */\n\nMETHODDEF(void)\nstart_output_bmp (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  /* no work here */\n}\n\n\n/*\n * Finish up at the end of the file.\n *\n * Here is where we really output the BMP file.\n *\n * First, routines to write the Windows and OS/2 variants of the file header.\n */\n\nLOCAL(void)\nwrite_bmp_header (j_decompress_ptr cinfo, bmp_dest_ptr dest)\n/* Write a Windows-style BMP file header, including colormap if needed */\n{\n  char bmpfileheader[14];\n  char bmpinfoheader[40];\n#define PUT_2B(array,offset,value)  \\\n        (array[offset] = (char) ((value) & 0xFF), \\\n         array[offset+1] = (char) (((value) >> 8) & 0xFF))\n#define PUT_4B(array,offset,value)  \\\n        (array[offset] = (char) ((value) & 0xFF), \\\n         array[offset+1] = (char) (((value) >> 8) & 0xFF), \\\n         array[offset+2] = (char) (((value) >> 16) & 0xFF), \\\n         array[offset+3] = (char) (((value) >> 24) & 0xFF))\n  long headersize, bfSize;\n  int bits_per_pixel, cmap_entries;\n\n  /* Compute colormap size and total file size */\n  if (cinfo->out_color_space == JCS_RGB) {\n    if (cinfo->quantize_colors) {\n      /* Colormapped RGB */\n      bits_per_pixel = 8;\n      cmap_entries = 256;\n    } else {\n      /* Unquantized, full color RGB */\n      bits_per_pixel = 24;\n      cmap_entries = 0;\n    }\n  } else if (cinfo->out_color_space == JCS_RGB565) {\n    bits_per_pixel = 24;\n    cmap_entries   = 0;\n  } else {\n    /* Grayscale output.  We need to fake a 256-entry colormap. */\n    bits_per_pixel = 8;\n    cmap_entries = 256;\n  }\n  /* File size */\n  headersize = 14 + 40 + cmap_entries * 4; /* Header and colormap */\n  bfSize = headersize + (long) dest->row_width * (long) cinfo->output_height;\n\n  /* Set unused fields of header to 0 */\n  MEMZERO(bmpfileheader, sizeof(bmpfileheader));\n  MEMZERO(bmpinfoheader, sizeof(bmpinfoheader));\n\n  /* Fill the file header */\n  bmpfileheader[0] = 0x42;      /* first 2 bytes are ASCII 'B', 'M' */\n  bmpfileheader[1] = 0x4D;\n  PUT_4B(bmpfileheader, 2, bfSize); /* bfSize */\n  /* we leave bfReserved1 & bfReserved2 = 0 */\n  PUT_4B(bmpfileheader, 10, headersize); /* bfOffBits */\n\n  /* Fill the info header (Microsoft calls this a BITMAPINFOHEADER) */\n  PUT_2B(bmpinfoheader, 0, 40); /* biSize */\n  PUT_4B(bmpinfoheader, 4, cinfo->output_width); /* biWidth */\n  PUT_4B(bmpinfoheader, 8, cinfo->output_height); /* biHeight */\n  PUT_2B(bmpinfoheader, 12, 1); /* biPlanes - must be 1 */\n  PUT_2B(bmpinfoheader, 14, bits_per_pixel); /* biBitCount */\n  /* we leave biCompression = 0, for none */\n  /* we leave biSizeImage = 0; this is correct for uncompressed data */\n  if (cinfo->density_unit == 2) { /* if have density in dots/cm, then */\n    PUT_4B(bmpinfoheader, 24, (long) (cinfo->X_density*100)); /* XPels/M */\n    PUT_4B(bmpinfoheader, 28, (long) (cinfo->Y_density*100)); /* XPels/M */\n  }\n  PUT_2B(bmpinfoheader, 32, cmap_entries); /* biClrUsed */\n  /* we leave biClrImportant = 0 */\n\n  if (JFWRITE(dest->pub.output_file, bmpfileheader, 14) != (size_t) 14)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n  if (JFWRITE(dest->pub.output_file, bmpinfoheader, 40) != (size_t) 40)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n\n  if (cmap_entries > 0)\n    write_colormap(cinfo, dest, cmap_entries, 4);\n}\n\n\nLOCAL(void)\nwrite_os2_header (j_decompress_ptr cinfo, bmp_dest_ptr dest)\n/* Write an OS2-style BMP file header, including colormap if needed */\n{\n  char bmpfileheader[14];\n  char bmpcoreheader[12];\n  long headersize, bfSize;\n  int bits_per_pixel, cmap_entries;\n\n  /* Compute colormap size and total file size */\n  if (cinfo->out_color_space == JCS_RGB) {\n    if (cinfo->quantize_colors) {\n      /* Colormapped RGB */\n      bits_per_pixel = 8;\n      cmap_entries = 256;\n    } else {\n      /* Unquantized, full color RGB */\n      bits_per_pixel = 24;\n      cmap_entries = 0;\n    }\n  } else if (cinfo->out_color_space == JCS_RGB565) {\n    bits_per_pixel = 24;\n    cmap_entries   = 0;\n  } else {\n    /* Grayscale output.  We need to fake a 256-entry colormap. */\n    bits_per_pixel = 8;\n    cmap_entries = 256;\n  }\n  /* File size */\n  headersize = 14 + 12 + cmap_entries * 3; /* Header and colormap */\n  bfSize = headersize + (long) dest->row_width * (long) cinfo->output_height;\n\n  /* Set unused fields of header to 0 */\n  MEMZERO(bmpfileheader, sizeof(bmpfileheader));\n  MEMZERO(bmpcoreheader, sizeof(bmpcoreheader));\n\n  /* Fill the file header */\n  bmpfileheader[0] = 0x42;      /* first 2 bytes are ASCII 'B', 'M' */\n  bmpfileheader[1] = 0x4D;\n  PUT_4B(bmpfileheader, 2, bfSize); /* bfSize */\n  /* we leave bfReserved1 & bfReserved2 = 0 */\n  PUT_4B(bmpfileheader, 10, headersize); /* bfOffBits */\n\n  /* Fill the info header (Microsoft calls this a BITMAPCOREHEADER) */\n  PUT_2B(bmpcoreheader, 0, 12); /* bcSize */\n  PUT_2B(bmpcoreheader, 4, cinfo->output_width); /* bcWidth */\n  PUT_2B(bmpcoreheader, 6, cinfo->output_height); /* bcHeight */\n  PUT_2B(bmpcoreheader, 8, 1);  /* bcPlanes - must be 1 */\n  PUT_2B(bmpcoreheader, 10, bits_per_pixel); /* bcBitCount */\n\n  if (JFWRITE(dest->pub.output_file, bmpfileheader, 14) != (size_t) 14)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n  if (JFWRITE(dest->pub.output_file, bmpcoreheader, 12) != (size_t) 12)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n\n  if (cmap_entries > 0)\n    write_colormap(cinfo, dest, cmap_entries, 3);\n}\n\n\n/*\n * Write the colormap.\n * Windows uses BGR0 map entries; OS/2 uses BGR entries.\n */\n\nLOCAL(void)\nwrite_colormap (j_decompress_ptr cinfo, bmp_dest_ptr dest,\n                int map_colors, int map_entry_size)\n{\n  JSAMPARRAY colormap = cinfo->colormap;\n  int num_colors = cinfo->actual_number_of_colors;\n  FILE *outfile = dest->pub.output_file;\n  int i;\n\n  if (colormap != NULL) {\n    if (cinfo->out_color_components == 3) {\n      /* Normal case with RGB colormap */\n      for (i = 0; i < num_colors; i++) {\n        putc(GETJSAMPLE(colormap[2][i]), outfile);\n        putc(GETJSAMPLE(colormap[1][i]), outfile);\n        putc(GETJSAMPLE(colormap[0][i]), outfile);\n        if (map_entry_size == 4)\n          putc(0, outfile);\n      }\n    } else {\n      /* Grayscale colormap (only happens with grayscale quantization) */\n      for (i = 0; i < num_colors; i++) {\n        putc(GETJSAMPLE(colormap[0][i]), outfile);\n        putc(GETJSAMPLE(colormap[0][i]), outfile);\n        putc(GETJSAMPLE(colormap[0][i]), outfile);\n        if (map_entry_size == 4)\n          putc(0, outfile);\n      }\n    }\n  } else {\n    /* If no colormap, must be grayscale data.  Generate a linear \"map\". */\n    for (i = 0; i < 256; i++) {\n      putc(i, outfile);\n      putc(i, outfile);\n      putc(i, outfile);\n      if (map_entry_size == 4)\n        putc(0, outfile);\n    }\n  }\n  /* Pad colormap with zeros to ensure specified number of colormap entries */\n  if (i > map_colors)\n    ERREXIT1(cinfo, JERR_TOO_MANY_COLORS, i);\n  for (; i < map_colors; i++) {\n    putc(0, outfile);\n    putc(0, outfile);\n    putc(0, outfile);\n    if (map_entry_size == 4)\n      putc(0, outfile);\n  }\n}\n\n\nMETHODDEF(void)\nfinish_output_bmp (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;\n  register FILE *outfile = dest->pub.output_file;\n  JSAMPARRAY image_ptr;\n  register JSAMPROW data_ptr;\n  JDIMENSION row;\n  register JDIMENSION col;\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n\n  /* Write the header and colormap */\n  if (dest->is_os2)\n    write_os2_header(cinfo, dest);\n  else\n    write_bmp_header(cinfo, dest);\n\n  /* Write the file body from our virtual array */\n  for (row = cinfo->output_height; row > 0; row--) {\n    if (progress != NULL) {\n      progress->pub.pass_counter = (long) (cinfo->output_height - row);\n      progress->pub.pass_limit = (long) cinfo->output_height;\n      (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n    }\n    image_ptr = (*cinfo->mem->access_virt_sarray)\n      ((j_common_ptr) cinfo, dest->whole_image, row-1, (JDIMENSION) 1, FALSE);\n    data_ptr = image_ptr[0];\n    for (col = dest->row_width; col > 0; col--) {\n      putc(GETJSAMPLE(*data_ptr), outfile);\n      data_ptr++;\n    }\n  }\n  if (progress != NULL)\n    progress->completed_extra_passes++;\n\n  /* Make sure we wrote the output file OK */\n  fflush(outfile);\n  if (ferror(outfile))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * The module selection routine for BMP format output.\n */\n\nGLOBAL(djpeg_dest_ptr)\njinit_write_bmp (j_decompress_ptr cinfo, boolean is_os2)\n{\n  bmp_dest_ptr dest;\n  JDIMENSION row_width;\n\n  /* Create module interface object, fill in method pointers */\n  dest = (bmp_dest_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(bmp_dest_struct));\n  dest->pub.start_output = start_output_bmp;\n  dest->pub.finish_output = finish_output_bmp;\n  dest->is_os2 = is_os2;\n\n  if (cinfo->out_color_space == JCS_GRAYSCALE) {\n    dest->pub.put_pixel_rows = put_gray_rows;\n  } else if (cinfo->out_color_space == JCS_RGB) {\n    if (cinfo->quantize_colors)\n      dest->pub.put_pixel_rows = put_gray_rows;\n    else\n      dest->pub.put_pixel_rows = put_pixel_rows;\n  } else if(cinfo->out_color_space == JCS_RGB565 ) {\n      dest->pub.put_pixel_rows = put_pixel_rows;\n  } else {\n    ERREXIT(cinfo, JERR_BMP_COLORSPACE);\n  }\n\n  /* Calculate output image dimensions so we can allocate space */\n  jpeg_calc_output_dimensions(cinfo);\n\n  /* Determine width of rows in the BMP file (padded to 4-byte boundary). */\n  if (cinfo->out_color_space == JCS_RGB565) {\n    row_width = cinfo->output_width * 2;\n    dest->row_width = dest->data_width = cinfo->output_width * 3;\n  } else {\n    row_width = cinfo->output_width * cinfo->output_components;\n    dest->row_width = dest->data_width = row_width;\n  }\n  while ((dest->row_width & 3) != 0) dest->row_width++;\n  dest->pad_bytes = (int) (dest->row_width - dest->data_width);\n  if (cinfo->out_color_space == JCS_RGB565) {\n    while ((row_width & 3) != 0) row_width++;\n  } else {\n    row_width = dest->row_width;\n  }\n\n\n  /* Allocate space for inversion array, prepare for write pass */\n  dest->whole_image = (*cinfo->mem->request_virt_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n     dest->row_width, cinfo->output_height, (JDIMENSION) 1);\n  dest->cur_output_row = 0;\n  if (cinfo->progress != NULL) {\n    cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n    progress->total_extra_passes++; /* count file input as separate pass */\n  }\n\n  /* Create decompressor output buffer. */\n  dest->pub.buffer = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, row_width, (JDIMENSION) 1);\n  dest->pub.buffer_height = 1;\n\n  return (djpeg_dest_ptr) dest;\n}\n\n#endif /* BMP_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/wrgif.c",
    "content": "/*\n * wrgif.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2015, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains routines to write output images in GIF format.\n *\n **************************************************************************\n * NOTE: to avoid entanglements with Unisys' patent on LZW compression,   *\n * this code has been modified to output \"uncompressed GIF\" files.        *\n * There is no trace of the LZW algorithm in this file.                   *\n **************************************************************************\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume output to\n * an ordinary stdio stream.\n */\n\n/*\n * This code is loosely based on ppmtogif from the PBMPLUS distribution\n * of Feb. 1991.  That file contains the following copyright notice:\n *    Based on GIFENCODE by David Rowley <mgardi@watdscu.waterloo.edu>.\n *    Lempel-Ziv compression based on \"compress\" by Spencer W. Thomas et al.\n *    Copyright (C) 1989 by Jef Poskanzer.\n *    Permission to use, copy, modify, and distribute this software and its\n *    documentation for any purpose and without fee is hereby granted, provided\n *    that the above copyright notice appear in all copies and that both that\n *    copyright notice and this permission notice appear in supporting\n *    documentation.  This software is provided \"as is\" without express or\n *    implied warranty.\n *\n * We are also required to state that\n *    \"The Graphics Interchange Format(c) is the Copyright property of\n *    CompuServe Incorporated. GIF(sm) is a Service Mark property of\n *    CompuServe Incorporated.\"\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n\n#ifdef GIF_SUPPORTED\n\n\n/* Private version of data destination object */\n\ntypedef struct {\n  struct djpeg_dest_struct pub; /* public fields */\n\n  j_decompress_ptr cinfo;       /* back link saves passing separate parm */\n\n  /* State for packing variable-width codes into a bitstream */\n  int n_bits;                   /* current number of bits/code */\n  int maxcode;                  /* maximum code, given n_bits */\n  long cur_accum;               /* holds bits not yet output */\n  int cur_bits;                 /* # of bits in cur_accum */\n\n  /* State for GIF code assignment */\n  int ClearCode;                /* clear code (doesn't change) */\n  int EOFCode;                  /* EOF code (ditto) */\n  int code_counter;             /* counts output symbols */\n\n  /* GIF data packet construction buffer */\n  int bytesinpkt;               /* # of bytes in current packet */\n  char packetbuf[256];          /* workspace for accumulating packet */\n\n} gif_dest_struct;\n\ntypedef gif_dest_struct *gif_dest_ptr;\n\n/* Largest value that will fit in N bits */\n#define MAXCODE(n_bits) ((1 << (n_bits)) - 1)\n\n\n/*\n * Routines to package finished data bytes into GIF data blocks.\n * A data block consists of a count byte (1..255) and that many data bytes.\n */\n\nLOCAL(void)\nflush_packet (gif_dest_ptr dinfo)\n/* flush any accumulated data */\n{\n  if (dinfo->bytesinpkt > 0) {  /* never write zero-length packet */\n    dinfo->packetbuf[0] = (char) dinfo->bytesinpkt++;\n    if (JFWRITE(dinfo->pub.output_file, dinfo->packetbuf, dinfo->bytesinpkt)\n        != (size_t) dinfo->bytesinpkt)\n      ERREXIT(dinfo->cinfo, JERR_FILE_WRITE);\n    dinfo->bytesinpkt = 0;\n  }\n}\n\n\n/* Add a character to current packet; flush to disk if necessary */\n#define CHAR_OUT(dinfo,c)  \\\n        { (dinfo)->packetbuf[++(dinfo)->bytesinpkt] = (char) (c);  \\\n            if ((dinfo)->bytesinpkt >= 255)  \\\n              flush_packet(dinfo);  \\\n        }\n\n\n/* Routine to convert variable-width codes into a byte stream */\n\nLOCAL(void)\noutput (gif_dest_ptr dinfo, int code)\n/* Emit a code of n_bits bits */\n/* Uses cur_accum and cur_bits to reblock into 8-bit bytes */\n{\n  dinfo->cur_accum |= ((long) code) << dinfo->cur_bits;\n  dinfo->cur_bits += dinfo->n_bits;\n\n  while (dinfo->cur_bits >= 8) {\n    CHAR_OUT(dinfo, dinfo->cur_accum & 0xFF);\n    dinfo->cur_accum >>= 8;\n    dinfo->cur_bits -= 8;\n  }\n}\n\n\n/* The pseudo-compression algorithm.\n *\n * In this module we simply output each pixel value as a separate symbol;\n * thus, no compression occurs.  In fact, there is expansion of one bit per\n * pixel, because we use a symbol width one bit wider than the pixel width.\n *\n * GIF ordinarily uses variable-width symbols, and the decoder will expect\n * to ratchet up the symbol width after a fixed number of symbols.\n * To simplify the logic and keep the expansion penalty down, we emit a\n * GIF Clear code to reset the decoder just before the width would ratchet up.\n * Thus, all the symbols in the output file will have the same bit width.\n * Note that emitting the Clear codes at the right times is a mere matter of\n * counting output symbols and is in no way dependent on the LZW patent.\n *\n * With a small basic pixel width (low color count), Clear codes will be\n * needed very frequently, causing the file to expand even more.  So this\n * simplistic approach wouldn't work too well on bilevel images, for example.\n * But for output of JPEG conversions the pixel width will usually be 8 bits\n * (129 to 256 colors), so the overhead added by Clear symbols is only about\n * one symbol in every 256.\n */\n\nLOCAL(void)\ncompress_init (gif_dest_ptr dinfo, int i_bits)\n/* Initialize pseudo-compressor */\n{\n  /* init all the state variables */\n  dinfo->n_bits = i_bits;\n  dinfo->maxcode = MAXCODE(dinfo->n_bits);\n  dinfo->ClearCode = (1 << (i_bits - 1));\n  dinfo->EOFCode = dinfo->ClearCode + 1;\n  dinfo->code_counter = dinfo->ClearCode + 2;\n  /* init output buffering vars */\n  dinfo->bytesinpkt = 0;\n  dinfo->cur_accum = 0;\n  dinfo->cur_bits = 0;\n  /* GIF specifies an initial Clear code */\n  output(dinfo, dinfo->ClearCode);\n}\n\n\nLOCAL(void)\ncompress_pixel (gif_dest_ptr dinfo, int c)\n/* Accept and \"compress\" one pixel value.\n * The given value must be less than n_bits wide.\n */\n{\n  /* Output the given pixel value as a symbol. */\n  output(dinfo, c);\n  /* Issue Clear codes often enough to keep the reader from ratcheting up\n   * its symbol size.\n   */\n  if (dinfo->code_counter < dinfo->maxcode) {\n    dinfo->code_counter++;\n  } else {\n    output(dinfo, dinfo->ClearCode);\n    dinfo->code_counter = dinfo->ClearCode + 2; /* reset the counter */\n  }\n}\n\n\nLOCAL(void)\ncompress_term (gif_dest_ptr dinfo)\n/* Clean up at end */\n{\n  /* Send an EOF code */\n  output(dinfo, dinfo->EOFCode);\n  /* Flush the bit-packing buffer */\n  if (dinfo->cur_bits > 0) {\n    CHAR_OUT(dinfo, dinfo->cur_accum & 0xFF);\n  }\n  /* Flush the packet buffer */\n  flush_packet(dinfo);\n}\n\n\n/* GIF header construction */\n\n\nLOCAL(void)\nput_word (gif_dest_ptr dinfo, unsigned int w)\n/* Emit a 16-bit word, LSB first */\n{\n  putc(w & 0xFF, dinfo->pub.output_file);\n  putc((w >> 8) & 0xFF, dinfo->pub.output_file);\n}\n\n\nLOCAL(void)\nput_3bytes (gif_dest_ptr dinfo, int val)\n/* Emit 3 copies of same byte value --- handy subr for colormap construction */\n{\n  putc(val, dinfo->pub.output_file);\n  putc(val, dinfo->pub.output_file);\n  putc(val, dinfo->pub.output_file);\n}\n\n\nLOCAL(void)\nemit_header (gif_dest_ptr dinfo, int num_colors, JSAMPARRAY colormap)\n/* Output the GIF file header, including color map */\n/* If colormap==NULL, synthesize a grayscale colormap */\n{\n  int BitsPerPixel, ColorMapSize, InitCodeSize, FlagByte;\n  int cshift = dinfo->cinfo->data_precision - 8;\n  int i;\n\n  if (num_colors > 256)\n    ERREXIT1(dinfo->cinfo, JERR_TOO_MANY_COLORS, num_colors);\n  /* Compute bits/pixel and related values */\n  BitsPerPixel = 1;\n  while (num_colors > (1 << BitsPerPixel))\n    BitsPerPixel++;\n  ColorMapSize = 1 << BitsPerPixel;\n  if (BitsPerPixel <= 1)\n    InitCodeSize = 2;\n  else\n    InitCodeSize = BitsPerPixel;\n  /*\n   * Write the GIF header.\n   * Note that we generate a plain GIF87 header for maximum compatibility.\n   */\n  putc('G', dinfo->pub.output_file);\n  putc('I', dinfo->pub.output_file);\n  putc('F', dinfo->pub.output_file);\n  putc('8', dinfo->pub.output_file);\n  putc('7', dinfo->pub.output_file);\n  putc('a', dinfo->pub.output_file);\n  /* Write the Logical Screen Descriptor */\n  put_word(dinfo, (unsigned int) dinfo->cinfo->output_width);\n  put_word(dinfo, (unsigned int) dinfo->cinfo->output_height);\n  FlagByte = 0x80;              /* Yes, there is a global color table */\n  FlagByte |= (BitsPerPixel-1) << 4; /* color resolution */\n  FlagByte |= (BitsPerPixel-1); /* size of global color table */\n  putc(FlagByte, dinfo->pub.output_file);\n  putc(0, dinfo->pub.output_file); /* Background color index */\n  putc(0, dinfo->pub.output_file); /* Reserved (aspect ratio in GIF89) */\n  /* Write the Global Color Map */\n  /* If the color map is more than 8 bits precision, */\n  /* we reduce it to 8 bits by shifting */\n  for (i=0; i < ColorMapSize; i++) {\n    if (i < num_colors) {\n      if (colormap != NULL) {\n        if (dinfo->cinfo->out_color_space == JCS_RGB) {\n          /* Normal case: RGB color map */\n          putc(GETJSAMPLE(colormap[0][i]) >> cshift, dinfo->pub.output_file);\n          putc(GETJSAMPLE(colormap[1][i]) >> cshift, dinfo->pub.output_file);\n          putc(GETJSAMPLE(colormap[2][i]) >> cshift, dinfo->pub.output_file);\n        } else {\n          /* Grayscale \"color map\": possible if quantizing grayscale image */\n          put_3bytes(dinfo, GETJSAMPLE(colormap[0][i]) >> cshift);\n        }\n      } else {\n        /* Create a grayscale map of num_colors values, range 0..255 */\n        put_3bytes(dinfo, (i * 255 + (num_colors-1)/2) / (num_colors-1));\n      }\n    } else {\n      /* fill out the map to a power of 2 */\n      put_3bytes(dinfo, 0);\n    }\n  }\n  /* Write image separator and Image Descriptor */\n  putc(',', dinfo->pub.output_file); /* separator */\n  put_word(dinfo, 0);           /* left/top offset */\n  put_word(dinfo, 0);\n  put_word(dinfo, (unsigned int) dinfo->cinfo->output_width); /* image size */\n  put_word(dinfo, (unsigned int) dinfo->cinfo->output_height);\n  /* flag byte: not interlaced, no local color map */\n  putc(0x00, dinfo->pub.output_file);\n  /* Write Initial Code Size byte */\n  putc(InitCodeSize, dinfo->pub.output_file);\n\n  /* Initialize for \"compression\" of image data */\n  compress_init(dinfo, InitCodeSize+1);\n}\n\n\n/*\n * Startup: write the file header.\n */\n\nMETHODDEF(void)\nstart_output_gif (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  gif_dest_ptr dest = (gif_dest_ptr) dinfo;\n\n  if (cinfo->quantize_colors)\n    emit_header(dest, cinfo->actual_number_of_colors, cinfo->colormap);\n  else\n    emit_header(dest, 256, (JSAMPARRAY) NULL);\n}\n\n\n/*\n * Write some pixel data.\n * In this module rows_supplied will always be 1.\n */\n\nMETHODDEF(void)\nput_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n                JDIMENSION rows_supplied)\n{\n  gif_dest_ptr dest = (gif_dest_ptr) dinfo;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n\n  ptr = dest->pub.buffer[0];\n  for (col = cinfo->output_width; col > 0; col--) {\n    compress_pixel(dest, GETJSAMPLE(*ptr++));\n  }\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_output_gif (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  gif_dest_ptr dest = (gif_dest_ptr) dinfo;\n\n  /* Flush \"compression\" mechanism */\n  compress_term(dest);\n  /* Write a zero-length data block to end the series */\n  putc(0, dest->pub.output_file);\n  /* Write the GIF terminator mark */\n  putc(';', dest->pub.output_file);\n  /* Make sure we wrote the output file OK */\n  fflush(dest->pub.output_file);\n  if (ferror(dest->pub.output_file))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * The module selection routine for GIF format output.\n */\n\nGLOBAL(djpeg_dest_ptr)\njinit_write_gif (j_decompress_ptr cinfo)\n{\n  gif_dest_ptr dest;\n\n  /* Create module interface object, fill in method pointers */\n  dest = (gif_dest_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(gif_dest_struct));\n  dest->cinfo = cinfo;          /* make back link for subroutines */\n  dest->pub.start_output = start_output_gif;\n  dest->pub.put_pixel_rows = put_pixel_rows;\n  dest->pub.finish_output = finish_output_gif;\n\n  if (cinfo->out_color_space != JCS_GRAYSCALE &&\n      cinfo->out_color_space != JCS_RGB)\n    ERREXIT(cinfo, JERR_GIF_COLORSPACE);\n\n  /* Force quantization if color or if > 8 bits input */\n  if (cinfo->out_color_space != JCS_GRAYSCALE || cinfo->data_precision > 8) {\n    /* Force quantization to at most 256 colors */\n    cinfo->quantize_colors = TRUE;\n    if (cinfo->desired_number_of_colors > 256)\n      cinfo->desired_number_of_colors = 256;\n  }\n\n  /* Calculate output image dimensions so we can allocate space */\n  jpeg_calc_output_dimensions(cinfo);\n\n  if (cinfo->output_components != 1) /* safety check: just one component? */\n    ERREXIT(cinfo, JERR_GIF_BUG);\n\n  /* Create decompressor output buffer. */\n  dest->pub.buffer = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, cinfo->output_width, (JDIMENSION) 1);\n  dest->pub.buffer_height = 1;\n\n  return (djpeg_dest_ptr) dest;\n}\n\n#endif /* GIF_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/wrjpgcom.1",
    "content": ".TH WRJPGCOM 1 \"15 June 1995\"\n.SH NAME\nwrjpgcom \\- insert text comments into a JPEG file\n.SH SYNOPSIS\n.B wrjpgcom\n[\n.B \\-replace\n]\n[\n.BI \\-comment \" text\"\n]\n[\n.BI \\-cfile \" name\"\n]\n[\n.I filename\n]\n.LP\n.SH DESCRIPTION\n.LP\n.B wrjpgcom\nreads the named JPEG/JFIF file, or the standard input if no file is named,\nand generates a new JPEG/JFIF file on standard output.  A comment block is\nadded to the file.\n.PP\nThe JPEG standard allows \"comment\" (COM) blocks to occur within a JPEG file.\nAlthough the standard doesn't actually define what COM blocks are for, they\nare widely used to hold user-supplied text strings.  This lets you add\nannotations, titles, index terms, etc to your JPEG files, and later retrieve\nthem as text.  COM blocks do not interfere with the image stored in the JPEG\nfile.  The maximum size of a COM block is 64K, but you can have as many of\nthem as you like in one JPEG file.\n.PP\n.B wrjpgcom\nadds a COM block, containing text you provide, to a JPEG file.\nOrdinarily, the COM block is added after any existing COM blocks; but you\ncan delete the old COM blocks if you wish.\n.SH OPTIONS\nSwitch names may be abbreviated, and are not case sensitive.\n.TP\n.B \\-replace\nDelete any existing COM blocks from the file.\n.TP\n.BI \\-comment \" text\"\nSupply text for new COM block on command line.\n.TP\n.BI \\-cfile \" name\"\nRead text for new COM block from named file.\n.PP\nIf you have only one line of comment text to add, you can provide it on the\ncommand line with\n.BR \\-comment .\nThe comment text must be surrounded with quotes so that it is treated as a\nsingle argument.  Longer comments can be read from a text file.\n.PP\nIf you give neither\n.B \\-comment\nnor\n.BR \\-cfile ,\nthen\n.B wrjpgcom\nwill read the comment text from standard input.  (In this case an input image\nfile name MUST be supplied, so that the source JPEG file comes from somewhere\nelse.)  You can enter multiple lines, up to 64KB worth.  Type an end-of-file\nindicator (usually control-D) to terminate the comment text entry.\n.PP\n.B wrjpgcom\nwill not add a COM block if the provided comment string is empty.  Therefore\n\\fB\\-replace \\-comment \"\"\\fR can be used to delete all COM blocks from a file.\n.SH EXAMPLES\n.LP\nAdd a short comment to in.jpg, producing out.jpg:\n.IP\n.B wrjpgcom \\-c\n\\fI\"View of my back yard\" in.jpg\n.B >\n.I out.jpg\n.PP\nAttach a long comment previously stored in comment.txt:\n.IP\n.B wrjpgcom\n.I in.jpg\n.B <\n.I comment.txt\n.B >\n.I out.jpg\n.PP\nor equivalently\n.IP\n.B wrjpgcom\n.B -cfile\n.I comment.txt\n.B <\n.I in.jpg\n.B >\n.I out.jpg\n.SH SEE ALSO\n.BR cjpeg (1),\n.BR djpeg (1),\n.BR jpegtran (1),\n.BR rdjpgcom (1)\n.SH AUTHOR\nIndependent JPEG Group\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/wrjpgcom.c",
    "content": "/*\n * wrjpgcom.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2014, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains a very simple stand-alone application that inserts\n * user-supplied text as a COM (comment) marker in a JFIF file.\n * This may be useful as an example of the minimum logic needed to parse\n * JPEG markers.\n */\n\n#define JPEG_CJPEG_DJPEG        /* to get the command-line config symbols */\n#include \"jinclude.h\"           /* get auto-config symbols, <stdio.h> */\n\n#ifndef HAVE_STDLIB_H           /* <stdlib.h> should declare malloc() */\nextern void *malloc ();\n#endif\n#include <ctype.h>              /* to declare isupper(), tolower() */\n#ifdef USE_SETMODE\n#include <fcntl.h>              /* to declare setmode()'s parameter macros */\n/* If you have setmode() but not <io.h>, just delete this line: */\n#include <io.h>                 /* to declare setmode() */\n#endif\n\n#ifdef USE_CCOMMAND             /* command-line reader for Macintosh */\n#ifdef __MWERKS__\n#include <SIOUX.h>              /* Metrowerks needs this */\n#include <console.h>            /* ... and this */\n#endif\n#ifdef THINK_C\n#include <console.h>            /* Think declares it here */\n#endif\n#endif\n\n#ifdef DONT_USE_B_MODE          /* define mode parameters for fopen() */\n#define READ_BINARY     \"r\"\n#define WRITE_BINARY    \"w\"\n#else\n#define READ_BINARY     \"rb\"\n#define WRITE_BINARY    \"wb\"\n#endif\n\n#ifndef EXIT_FAILURE            /* define exit() codes if not provided */\n#define EXIT_FAILURE  1\n#endif\n#ifndef EXIT_SUCCESS\n#define EXIT_SUCCESS  0\n#endif\n\n/* Reduce this value if your malloc() can't allocate blocks up to 64K.\n * On DOS, compiling in large model is usually a better solution.\n */\n\n#ifndef MAX_COM_LENGTH\n#define MAX_COM_LENGTH 65000L   /* must be <= 65533 in any case */\n#endif\n\n\n/*\n * These macros are used to read the input file and write the output file.\n * To reuse this code in another application, you might need to change these.\n */\n\nstatic FILE *infile;            /* input JPEG file */\n\n/* Return next input byte, or EOF if no more */\n#define NEXTBYTE()  getc(infile)\n\nstatic FILE *outfile;           /* output JPEG file */\n\n/* Emit an output byte */\n#define PUTBYTE(x)  putc((x), outfile)\n\n\n/* Error exit handler */\n#define ERREXIT(msg)  (fprintf(stderr, \"%s\\n\", msg), exit(EXIT_FAILURE))\n\n\n/* Read one byte, testing for EOF */\nstatic int\nread_1_byte (void)\n{\n  int c;\n\n  c = NEXTBYTE();\n  if (c == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  return c;\n}\n\n/* Read 2 bytes, convert to unsigned int */\n/* All 2-byte quantities in JPEG markers are MSB first */\nstatic unsigned int\nread_2_bytes (void)\n{\n  int c1, c2;\n\n  c1 = NEXTBYTE();\n  if (c1 == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  c2 = NEXTBYTE();\n  if (c2 == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  return (((unsigned int) c1) << 8) + ((unsigned int) c2);\n}\n\n\n/* Routines to write data to output file */\n\nstatic void\nwrite_1_byte (int c)\n{\n  PUTBYTE(c);\n}\n\nstatic void\nwrite_2_bytes (unsigned int val)\n{\n  PUTBYTE((val >> 8) & 0xFF);\n  PUTBYTE(val & 0xFF);\n}\n\nstatic void\nwrite_marker (int marker)\n{\n  PUTBYTE(0xFF);\n  PUTBYTE(marker);\n}\n\nstatic void\ncopy_rest_of_file (void)\n{\n  int c;\n\n  while ((c = NEXTBYTE()) != EOF)\n    PUTBYTE(c);\n}\n\n\n/*\n * JPEG markers consist of one or more 0xFF bytes, followed by a marker\n * code byte (which is not an FF).  Here are the marker codes of interest\n * in this program.  (See jdmarker.c for a more complete list.)\n */\n\n#define M_SOF0  0xC0            /* Start Of Frame N */\n#define M_SOF1  0xC1            /* N indicates which compression process */\n#define M_SOF2  0xC2            /* Only SOF0-SOF2 are now in common use */\n#define M_SOF3  0xC3\n#define M_SOF5  0xC5            /* NB: codes C4 and CC are NOT SOF markers */\n#define M_SOF6  0xC6\n#define M_SOF7  0xC7\n#define M_SOF9  0xC9\n#define M_SOF10 0xCA\n#define M_SOF11 0xCB\n#define M_SOF13 0xCD\n#define M_SOF14 0xCE\n#define M_SOF15 0xCF\n#define M_SOI   0xD8            /* Start Of Image (beginning of datastream) */\n#define M_EOI   0xD9            /* End Of Image (end of datastream) */\n#define M_SOS   0xDA            /* Start Of Scan (begins compressed data) */\n#define M_COM   0xFE            /* COMment */\n\n\n/*\n * Find the next JPEG marker and return its marker code.\n * We expect at least one FF byte, possibly more if the compressor used FFs\n * to pad the file.  (Padding FFs will NOT be replicated in the output file.)\n * There could also be non-FF garbage between markers.  The treatment of such\n * garbage is unspecified; we choose to skip over it but emit a warning msg.\n * NB: this routine must not be used after seeing SOS marker, since it will\n * not deal correctly with FF/00 sequences in the compressed image data...\n */\n\nstatic int\nnext_marker (void)\n{\n  int c;\n  int discarded_bytes = 0;\n\n  /* Find 0xFF byte; count and skip any non-FFs. */\n  c = read_1_byte();\n  while (c != 0xFF) {\n    discarded_bytes++;\n    c = read_1_byte();\n  }\n  /* Get marker code byte, swallowing any duplicate FF bytes.  Extra FFs\n   * are legal as pad bytes, so don't count them in discarded_bytes.\n   */\n  do {\n    c = read_1_byte();\n  } while (c == 0xFF);\n\n  if (discarded_bytes != 0) {\n    fprintf(stderr, \"Warning: garbage data found in JPEG file\\n\");\n  }\n\n  return c;\n}\n\n\n/*\n * Read the initial marker, which should be SOI.\n * For a JFIF file, the first two bytes of the file should be literally\n * 0xFF M_SOI.  To be more general, we could use next_marker, but if the\n * input file weren't actually JPEG at all, next_marker might read the whole\n * file and then return a misleading error message...\n */\n\nstatic int\nfirst_marker (void)\n{\n  int c1, c2;\n\n  c1 = NEXTBYTE();\n  c2 = NEXTBYTE();\n  if (c1 != 0xFF || c2 != M_SOI)\n    ERREXIT(\"Not a JPEG file\");\n  return c2;\n}\n\n\n/*\n * Most types of marker are followed by a variable-length parameter segment.\n * This routine skips over the parameters for any marker we don't otherwise\n * want to process.\n * Note that we MUST skip the parameter segment explicitly in order not to\n * be fooled by 0xFF bytes that might appear within the parameter segment;\n * such bytes do NOT introduce new markers.\n */\n\nstatic void\ncopy_variable (void)\n/* Copy an unknown or uninteresting variable-length marker */\n{\n  unsigned int length;\n\n  /* Get the marker parameter length count */\n  length = read_2_bytes();\n  write_2_bytes(length);\n  /* Length includes itself, so must be at least 2 */\n  if (length < 2)\n    ERREXIT(\"Erroneous JPEG marker length\");\n  length -= 2;\n  /* Skip over the remaining bytes */\n  while (length > 0) {\n    write_1_byte(read_1_byte());\n    length--;\n  }\n}\n\nstatic void\nskip_variable (void)\n/* Skip over an unknown or uninteresting variable-length marker */\n{\n  unsigned int length;\n\n  /* Get the marker parameter length count */\n  length = read_2_bytes();\n  /* Length includes itself, so must be at least 2 */\n  if (length < 2)\n    ERREXIT(\"Erroneous JPEG marker length\");\n  length -= 2;\n  /* Skip over the remaining bytes */\n  while (length > 0) {\n    (void) read_1_byte();\n    length--;\n  }\n}\n\n\n/*\n * Parse the marker stream until SOFn or EOI is seen;\n * copy data to output, but discard COM markers unless keep_COM is true.\n */\n\nstatic int\nscan_JPEG_header (int keep_COM)\n{\n  int marker;\n\n  /* Expect SOI at start of file */\n  if (first_marker() != M_SOI)\n    ERREXIT(\"Expected SOI marker first\");\n  write_marker(M_SOI);\n\n  /* Scan miscellaneous markers until we reach SOFn. */\n  for (;;) {\n    marker = next_marker();\n    switch (marker) {\n      /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be,\n       * treated as SOFn.  C4 in particular is actually DHT.\n       */\n    case M_SOF0:                /* Baseline */\n    case M_SOF1:                /* Extended sequential, Huffman */\n    case M_SOF2:                /* Progressive, Huffman */\n    case M_SOF3:                /* Lossless, Huffman */\n    case M_SOF5:                /* Differential sequential, Huffman */\n    case M_SOF6:                /* Differential progressive, Huffman */\n    case M_SOF7:                /* Differential lossless, Huffman */\n    case M_SOF9:                /* Extended sequential, arithmetic */\n    case M_SOF10:               /* Progressive, arithmetic */\n    case M_SOF11:               /* Lossless, arithmetic */\n    case M_SOF13:               /* Differential sequential, arithmetic */\n    case M_SOF14:               /* Differential progressive, arithmetic */\n    case M_SOF15:               /* Differential lossless, arithmetic */\n      return marker;\n\n    case M_SOS:                 /* should not see compressed data before SOF */\n      ERREXIT(\"SOS without prior SOFn\");\n      break;\n\n    case M_EOI:                 /* in case it's a tables-only JPEG stream */\n      return marker;\n\n    case M_COM:                 /* Existing COM: conditionally discard */\n      if (keep_COM) {\n        write_marker(marker);\n        copy_variable();\n      } else {\n        skip_variable();\n      }\n      break;\n\n    default:                    /* Anything else just gets copied */\n      write_marker(marker);\n      copy_variable();          /* we assume it has a parameter count... */\n      break;\n    }\n  } /* end loop */\n}\n\n\n/* Command line parsing code */\n\nstatic const char *progname;    /* program name for error messages */\n\n\nstatic void\nusage (void)\n/* complain about bad command line */\n{\n  fprintf(stderr, \"wrjpgcom inserts a textual comment in a JPEG file.\\n\");\n  fprintf(stderr, \"You can add to or replace any existing comment(s).\\n\");\n\n  fprintf(stderr, \"Usage: %s [switches] \", progname);\n#ifdef TWO_FILE_COMMANDLINE\n  fprintf(stderr, \"inputfile outputfile\\n\");\n#else\n  fprintf(stderr, \"[inputfile]\\n\");\n#endif\n\n  fprintf(stderr, \"Switches (names may be abbreviated):\\n\");\n  fprintf(stderr, \"  -replace         Delete any existing comments\\n\");\n  fprintf(stderr, \"  -comment \\\"text\\\"  Insert comment with given text\\n\");\n  fprintf(stderr, \"  -cfile name      Read comment from named file\\n\");\n  fprintf(stderr, \"Notice that you must put quotes around the comment text\\n\");\n  fprintf(stderr, \"when you use -comment.\\n\");\n  fprintf(stderr, \"If you do not give either -comment or -cfile on the command line,\\n\");\n  fprintf(stderr, \"then the comment text is read from standard input.\\n\");\n  fprintf(stderr, \"It can be multiple lines, up to %u characters total.\\n\",\n          (unsigned int) MAX_COM_LENGTH);\n#ifndef TWO_FILE_COMMANDLINE\n  fprintf(stderr, \"You must specify an input JPEG file name when supplying\\n\");\n  fprintf(stderr, \"comment text from standard input.\\n\");\n#endif\n\n  exit(EXIT_FAILURE);\n}\n\n\nstatic int\nkeymatch (char *arg, const char *keyword, int minchars)\n/* Case-insensitive matching of (possibly abbreviated) keyword switches. */\n/* keyword is the constant keyword (must be lower case already), */\n/* minchars is length of minimum legal abbreviation. */\n{\n  register int ca, ck;\n  register int nmatched = 0;\n\n  while ((ca = *arg++) != '\\0') {\n    if ((ck = *keyword++) == '\\0')\n      return 0;                 /* arg longer than keyword, no good */\n    if (isupper(ca))            /* force arg to lcase (assume ck is already) */\n      ca = tolower(ca);\n    if (ca != ck)\n      return 0;                 /* no good */\n    nmatched++;                 /* count matched characters */\n  }\n  /* reached end of argument; fail if it's too short for unique abbrev */\n  if (nmatched < minchars)\n    return 0;\n  return 1;                     /* A-OK */\n}\n\n\n/*\n * The main program.\n */\n\nint\nmain (int argc, char **argv)\n{\n  int argn;\n  char *arg;\n  int keep_COM = 1;\n  char *comment_arg = NULL;\n  FILE *comment_file = NULL;\n  unsigned int comment_length = 0;\n  int marker;\n\n  /* On Mac, fetch a command line. */\n#ifdef USE_CCOMMAND\n  argc = ccommand(&argv);\n#endif\n\n  progname = argv[0];\n  if (progname == NULL || progname[0] == 0)\n    progname = \"wrjpgcom\";      /* in case C library doesn't provide it */\n\n  /* Parse switches, if any */\n  for (argn = 1; argn < argc; argn++) {\n    arg = argv[argn];\n    if (arg[0] != '-')\n      break;                    /* not switch, must be file name */\n    arg++;                      /* advance over '-' */\n    if (keymatch(arg, \"replace\", 1)) {\n      keep_COM = 0;\n    } else if (keymatch(arg, \"cfile\", 2)) {\n      if (++argn >= argc) usage();\n      if ((comment_file = fopen(argv[argn], \"r\")) == NULL) {\n        fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[argn]);\n        exit(EXIT_FAILURE);\n      }\n    } else if (keymatch(arg, \"comment\", 1)) {\n      if (++argn >= argc) usage();\n      comment_arg = argv[argn];\n      /* If the comment text starts with '\"', then we are probably running\n       * under MS-DOG and must parse out the quoted string ourselves.  Sigh.\n       */\n      if (comment_arg[0] == '\"') {\n        comment_arg = (char *) malloc((size_t) MAX_COM_LENGTH);\n        if (comment_arg == NULL)\n          ERREXIT(\"Insufficient memory\");\n        if (strlen(argv[argn]) + 2 >= (size_t) MAX_COM_LENGTH) {\n          fprintf(stderr, \"Comment text may not exceed %u bytes\\n\",\n                  (unsigned int) MAX_COM_LENGTH);\n          exit(EXIT_FAILURE);\n        }\n        strcpy(comment_arg, argv[argn]+1);\n        for (;;) {\n          comment_length = (unsigned int) strlen(comment_arg);\n          if (comment_length > 0 && comment_arg[comment_length-1] == '\"') {\n            comment_arg[comment_length-1] = '\\0'; /* zap terminating quote */\n            break;\n          }\n          if (++argn >= argc)\n            ERREXIT(\"Missing ending quote mark\");\n          if (strlen(comment_arg) + strlen(argv[argn]) + 2 >=\n              (size_t) MAX_COM_LENGTH) {\n            fprintf(stderr, \"Comment text may not exceed %u bytes\\n\",\n                    (unsigned int) MAX_COM_LENGTH);\n            exit(EXIT_FAILURE);\n          }\n          strcat(comment_arg, \" \");\n          strcat(comment_arg, argv[argn]);\n        }\n      } else if (strlen(argv[argn]) >= (size_t) MAX_COM_LENGTH) {\n        fprintf(stderr, \"Comment text may not exceed %u bytes\\n\",\n                (unsigned int) MAX_COM_LENGTH);\n        exit(EXIT_FAILURE);\n      }\n      comment_length = (unsigned int) strlen(comment_arg);\n    } else\n      usage();\n  }\n\n  /* Cannot use both -comment and -cfile. */\n  if (comment_arg != NULL && comment_file != NULL)\n    usage();\n  /* If there is neither -comment nor -cfile, we will read the comment text\n   * from stdin; in this case there MUST be an input JPEG file name.\n   */\n  if (comment_arg == NULL && comment_file == NULL && argn >= argc)\n    usage();\n\n  /* Open the input file. */\n  if (argn < argc) {\n    if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[argn]);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default input file is stdin */\n#ifdef USE_SETMODE              /* need to hack file mode? */\n    setmode(fileno(stdin), O_BINARY);\n#endif\n#ifdef USE_FDOPEN               /* need to re-open in binary mode? */\n    if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open stdin\\n\", progname);\n      exit(EXIT_FAILURE);\n    }\n#else\n    infile = stdin;\n#endif\n  }\n\n  /* Open the output file. */\n#ifdef TWO_FILE_COMMANDLINE\n  /* Must have explicit output file name */\n  if (argn != argc-2) {\n    fprintf(stderr, \"%s: must name one input and one output file\\n\",\n            progname);\n    usage();\n  }\n  if ((outfile = fopen(argv[argn+1], WRITE_BINARY)) == NULL) {\n    fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[argn+1]);\n    exit(EXIT_FAILURE);\n  }\n#else\n  /* Unix style: expect zero or one file name */\n  if (argn < argc-1) {\n    fprintf(stderr, \"%s: only one input file\\n\", progname);\n    usage();\n  }\n  /* default output file is stdout */\n#ifdef USE_SETMODE              /* need to hack file mode? */\n  setmode(fileno(stdout), O_BINARY);\n#endif\n#ifdef USE_FDOPEN               /* need to re-open in binary mode? */\n  if ((outfile = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) {\n    fprintf(stderr, \"%s: can't open stdout\\n\", progname);\n    exit(EXIT_FAILURE);\n  }\n#else\n  outfile = stdout;\n#endif\n#endif /* TWO_FILE_COMMANDLINE */\n\n  /* Collect comment text from comment_file or stdin, if necessary */\n  if (comment_arg == NULL) {\n    FILE *src_file;\n    int c;\n\n    comment_arg = (char *) malloc((size_t) MAX_COM_LENGTH);\n    if (comment_arg == NULL)\n      ERREXIT(\"Insufficient memory\");\n    comment_length = 0;\n    src_file = (comment_file != NULL ? comment_file : stdin);\n    while ((c = getc(src_file)) != EOF) {\n      if (comment_length >= (unsigned int) MAX_COM_LENGTH) {\n        fprintf(stderr, \"Comment text may not exceed %u bytes\\n\",\n                (unsigned int) MAX_COM_LENGTH);\n        exit(EXIT_FAILURE);\n      }\n      comment_arg[comment_length++] = (char) c;\n    }\n    if (comment_file != NULL)\n      fclose(comment_file);\n  }\n\n  /* Copy JPEG headers until SOFn marker;\n   * we will insert the new comment marker just before SOFn.\n   * This (a) causes the new comment to appear after, rather than before,\n   * existing comments; and (b) ensures that comments come after any JFIF\n   * or JFXX markers, as required by the JFIF specification.\n   */\n  marker = scan_JPEG_header(keep_COM);\n  /* Insert the new COM marker, but only if nonempty text has been supplied */\n  if (comment_length > 0) {\n    write_marker(M_COM);\n    write_2_bytes(comment_length + 2);\n    while (comment_length > 0) {\n      write_1_byte(*comment_arg++);\n      comment_length--;\n    }\n  }\n  /* Duplicate the remainder of the source file.\n   * Note that any COM markers occuring after SOF will not be touched.\n   */\n  write_marker(marker);\n  copy_rest_of_file();\n\n  /* All done. */\n  exit(EXIT_SUCCESS);\n  return 0;                     /* suppress no-return-value warnings */\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/wrppm.c",
    "content": "/*\n * wrppm.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * Modified 2009 by Guido Vollbeding.\n * It was modified by The libjpeg-turbo Project to include only code and\n * information relevant to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains routines to write output images in PPM/PGM format.\n * The extended 2-byte-per-sample raw PPM/PGM formats are supported.\n * The PBMPLUS library is NOT required to compile this software\n * (but it is highly useful as a set of PPM image manipulation programs).\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume output to\n * an ordinary stdio stream.\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n#include \"wrppm.h\"\n\n#ifdef PPM_SUPPORTED\n\n\n/*\n * For 12-bit JPEG data, we either downscale the values to 8 bits\n * (to write standard byte-per-sample PPM/PGM files), or output\n * nonstandard word-per-sample PPM/PGM files.  Downscaling is done\n * if PPM_NORAWWORD is defined (this can be done in the Makefile\n * or in jconfig.h).\n * (When the core library supports data precision reduction, a cleaner\n * implementation will be to ask for that instead.)\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define PUTPPMSAMPLE(ptr,v)  *ptr++ = (char) (v)\n#define BYTESPERSAMPLE 1\n#define PPM_MAXVAL 255\n#else\n#ifdef PPM_NORAWWORD\n#define PUTPPMSAMPLE(ptr,v)  *ptr++ = (char) ((v) >> (BITS_IN_JSAMPLE-8))\n#define BYTESPERSAMPLE 1\n#define PPM_MAXVAL 255\n#else\n/* The word-per-sample format always puts the MSB first. */\n#define PUTPPMSAMPLE(ptr,v)                     \\\n        { register int val_ = v;                \\\n          *ptr++ = (char) ((val_ >> 8) & 0xFF); \\\n          *ptr++ = (char) (val_ & 0xFF);        \\\n        }\n#define BYTESPERSAMPLE 2\n#define PPM_MAXVAL ((1<<BITS_IN_JSAMPLE)-1)\n#endif\n#endif\n\n\n/*\n * When JSAMPLE is the same size as char, we can just fwrite() the\n * decompressed data to the PPM or PGM file.\n */\n\n\n/*\n * Write some pixel data.\n * In this module rows_supplied will always be 1.\n *\n * put_pixel_rows handles the \"normal\" 8-bit case where the decompressor\n * output buffer is physically the same as the fwrite buffer.\n */\n\nMETHODDEF(void)\nput_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n                JDIMENSION rows_supplied)\n{\n  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;\n\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\n/*\n * This code is used when we have to copy the data and apply a pixel\n * format translation.  Typically this only happens in 12-bit mode.\n */\n\nMETHODDEF(void)\ncopy_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n                 JDIMENSION rows_supplied)\n{\n  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;\n  register char *bufferptr;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n\n  ptr = dest->pub.buffer[0];\n  bufferptr = dest->iobuffer;\n  for (col = dest->samples_per_row; col > 0; col--) {\n    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(*ptr++));\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\n/*\n * Write some pixel data when color quantization is in effect.\n * We have to demap the color index values to straight data.\n */\n\nMETHODDEF(void)\nput_demapped_rgb (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n                  JDIMENSION rows_supplied)\n{\n  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;\n  register char *bufferptr;\n  register int pixval;\n  register JSAMPROW ptr;\n  register JSAMPROW color_map0 = cinfo->colormap[0];\n  register JSAMPROW color_map1 = cinfo->colormap[1];\n  register JSAMPROW color_map2 = cinfo->colormap[2];\n  register JDIMENSION col;\n\n  ptr = dest->pub.buffer[0];\n  bufferptr = dest->iobuffer;\n  for (col = cinfo->output_width; col > 0; col--) {\n    pixval = GETJSAMPLE(*ptr++);\n    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map0[pixval]));\n    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map1[pixval]));\n    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map2[pixval]));\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\nMETHODDEF(void)\nput_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n                   JDIMENSION rows_supplied)\n{\n  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;\n  register char *bufferptr;\n  register JSAMPROW ptr;\n  register JSAMPROW color_map = cinfo->colormap[0];\n  register JDIMENSION col;\n\n  ptr = dest->pub.buffer[0];\n  bufferptr = dest->iobuffer;\n  for (col = cinfo->output_width; col > 0; col--) {\n    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map[GETJSAMPLE(*ptr++)]));\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\n/*\n * Startup: write the file header.\n */\n\nMETHODDEF(void)\nstart_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;\n\n  /* Emit file header */\n  switch (cinfo->out_color_space) {\n  case JCS_GRAYSCALE:\n    /* emit header for raw PGM format */\n    fprintf(dest->pub.output_file, \"P5\\n%ld %ld\\n%d\\n\",\n            (long) cinfo->output_width, (long) cinfo->output_height,\n            PPM_MAXVAL);\n    break;\n  case JCS_RGB:\n    /* emit header for raw PPM format */\n    fprintf(dest->pub.output_file, \"P6\\n%ld %ld\\n%d\\n\",\n            (long) cinfo->output_width, (long) cinfo->output_height,\n            PPM_MAXVAL);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_PPM_COLORSPACE);\n  }\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  /* Make sure we wrote the output file OK */\n  fflush(dinfo->output_file);\n  if (ferror(dinfo->output_file))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * The module selection routine for PPM format output.\n */\n\nGLOBAL(djpeg_dest_ptr)\njinit_write_ppm (j_decompress_ptr cinfo)\n{\n  ppm_dest_ptr dest;\n\n  /* Create module interface object, fill in method pointers */\n  dest = (ppm_dest_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(ppm_dest_struct));\n  dest->pub.start_output = start_output_ppm;\n  dest->pub.finish_output = finish_output_ppm;\n\n  /* Calculate output image dimensions so we can allocate space */\n  jpeg_calc_output_dimensions(cinfo);\n\n  /* Create physical I/O buffer */\n  dest->samples_per_row = cinfo->output_width * cinfo->out_color_components;\n  dest->buffer_width = dest->samples_per_row * (BYTESPERSAMPLE * sizeof(char));\n  dest->iobuffer = (char *) (*cinfo->mem->alloc_small)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width);\n\n  if (cinfo->quantize_colors || BITS_IN_JSAMPLE != 8 ||\n      sizeof(JSAMPLE) != sizeof(char)) {\n    /* When quantizing, we need an output buffer for colormap indexes\n     * that's separate from the physical I/O buffer.  We also need a\n     * separate buffer if pixel format translation must take place.\n     */\n    dest->pub.buffer = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       cinfo->output_width * cinfo->output_components, (JDIMENSION) 1);\n    dest->pub.buffer_height = 1;\n    if (! cinfo->quantize_colors)\n      dest->pub.put_pixel_rows = copy_pixel_rows;\n    else if (cinfo->out_color_space == JCS_GRAYSCALE)\n      dest->pub.put_pixel_rows = put_demapped_gray;\n    else\n      dest->pub.put_pixel_rows = put_demapped_rgb;\n  } else {\n    /* We will fwrite() directly from decompressor output buffer. */\n    /* Synthesize a JSAMPARRAY pointer structure */\n    dest->pixrow = (JSAMPROW) dest->iobuffer;\n    dest->pub.buffer = & dest->pixrow;\n    dest->pub.buffer_height = 1;\n    dest->pub.put_pixel_rows = put_pixel_rows;\n  }\n\n  return (djpeg_dest_ptr) dest;\n}\n\n#endif /* PPM_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/wrppm.h",
    "content": "/*\n * wrppm.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994, Thomas G. Lane.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n */\n\n#ifdef PPM_SUPPORTED\n\n/* Private version of data destination object */\n\ntypedef struct {\n  struct djpeg_dest_struct pub; /* public fields */\n\n  /* Usually these two pointers point to the same place: */\n  char *iobuffer;               /* fwrite's I/O buffer */\n  JSAMPROW pixrow;              /* decompressor output buffer */\n  size_t buffer_width;          /* width of I/O buffer */\n  JDIMENSION samples_per_row;   /* JSAMPLEs per output row */\n} ppm_dest_struct;\n\ntypedef ppm_dest_struct *ppm_dest_ptr;\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/wrrle.c",
    "content": "/*\n * wrrle.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code and\n * information relevant to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains routines to write output images in RLE format.\n * The Utah Raster Toolkit library is required (version 3.1 or later).\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume output to\n * an ordinary stdio stream.\n *\n * Based on code contributed by Mike Lijewski,\n * with updates from Robert Hutchinson.\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n\n#ifdef RLE_SUPPORTED\n\n/* rle.h is provided by the Utah Raster Toolkit. */\n\n#include <rle.h>\n\n/*\n * We assume that JSAMPLE has the same representation as rle_pixel,\n * to wit, \"unsigned char\".  Hence we can't cope with 12- or 16-bit samples.\n */\n\n#if BITS_IN_JSAMPLE != 8\n  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */\n#endif\n\n\n/*\n * Since RLE stores scanlines bottom-to-top, we have to invert the image\n * from JPEG's top-to-bottom order.  To do this, we save the outgoing data\n * in a virtual array during put_pixel_row calls, then actually emit the\n * RLE file during finish_output.\n */\n\n\n/*\n * For now, if we emit an RLE color map then it is always 256 entries long,\n * though not all of the entries need be used.\n */\n\n#define CMAPBITS        8\n#define CMAPLENGTH      (1<<(CMAPBITS))\n\ntypedef struct {\n  struct djpeg_dest_struct pub; /* public fields */\n\n  jvirt_sarray_ptr image;       /* virtual array to store the output image */\n  rle_map *colormap;            /* RLE-style color map, or NULL if none */\n  rle_pixel **rle_row;          /* To pass rows to rle_putrow() */\n\n} rle_dest_struct;\n\ntypedef rle_dest_struct *rle_dest_ptr;\n\n/* Forward declarations */\nMETHODDEF(void) rle_put_pixel_rows\n        (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n         JDIMENSION rows_supplied);\n\n\n/*\n * Write the file header.\n *\n * In this module it's easier to wait till finish_output to write anything.\n */\n\nMETHODDEF(void)\nstart_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  rle_dest_ptr dest = (rle_dest_ptr) dinfo;\n  size_t cmapsize;\n  int i, ci;\n#ifdef PROGRESS_REPORT\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n#endif\n\n  /*\n   * Make sure the image can be stored in RLE format.\n   *\n   * - RLE stores image dimensions as *signed* 16 bit integers.  JPEG\n   *   uses unsigned, so we have to check the width.\n   *\n   * - Colorspace is expected to be grayscale or RGB.\n   *\n   * - The number of channels (components) is expected to be 1 (grayscale/\n   *   pseudocolor) or 3 (truecolor/directcolor).\n   *   (could be 2 or 4 if using an alpha channel, but we aren't)\n   */\n\n  if (cinfo->output_width > 32767 || cinfo->output_height > 32767)\n    ERREXIT2(cinfo, JERR_RLE_DIMENSIONS, cinfo->output_width,\n             cinfo->output_height);\n\n  if (cinfo->out_color_space != JCS_GRAYSCALE &&\n      cinfo->out_color_space != JCS_RGB)\n    ERREXIT(cinfo, JERR_RLE_COLORSPACE);\n\n  if (cinfo->output_components != 1 && cinfo->output_components != 3)\n    ERREXIT1(cinfo, JERR_RLE_TOOMANYCHANNELS, cinfo->num_components);\n\n  /* Convert colormap, if any, to RLE format. */\n\n  dest->colormap = NULL;\n\n  if (cinfo->quantize_colors) {\n    /* Allocate storage for RLE-style cmap, zero any extra entries */\n    cmapsize = cinfo->out_color_components * CMAPLENGTH * sizeof(rle_map);\n    dest->colormap = (rle_map *) (*cinfo->mem->alloc_small)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE, cmapsize);\n    MEMZERO(dest->colormap, cmapsize);\n\n    /* Save away data in RLE format --- note 8-bit left shift! */\n    /* Shifting would need adjustment for JSAMPLEs wider than 8 bits. */\n    for (ci = 0; ci < cinfo->out_color_components; ci++) {\n      for (i = 0; i < cinfo->actual_number_of_colors; i++) {\n        dest->colormap[ci * CMAPLENGTH + i] =\n          GETJSAMPLE(cinfo->colormap[ci][i]) << 8;\n      }\n    }\n  }\n\n  /* Set the output buffer to the first row */\n  dest->pub.buffer = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, dest->image, (JDIMENSION) 0, (JDIMENSION) 1, TRUE);\n  dest->pub.buffer_height = 1;\n\n  dest->pub.put_pixel_rows = rle_put_pixel_rows;\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL) {\n    progress->total_extra_passes++;  /* count file writing as separate pass */\n  }\n#endif\n}\n\n\n/*\n * Write some pixel data.\n *\n * This routine just saves the data away in a virtual array.\n */\n\nMETHODDEF(void)\nrle_put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n                    JDIMENSION rows_supplied)\n{\n  rle_dest_ptr dest = (rle_dest_ptr) dinfo;\n\n  if (cinfo->output_scanline < cinfo->output_height) {\n    dest->pub.buffer = (*cinfo->mem->access_virt_sarray)\n      ((j_common_ptr) cinfo, dest->image,\n       cinfo->output_scanline, (JDIMENSION) 1, TRUE);\n  }\n}\n\n/*\n * Finish up at the end of the file.\n *\n * Here is where we really output the RLE file.\n */\n\nMETHODDEF(void)\nfinish_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  rle_dest_ptr dest = (rle_dest_ptr) dinfo;\n  rle_hdr header;               /* Output file information */\n  rle_pixel **rle_row, *red, *green, *blue;\n  JSAMPROW output_row;\n  char cmapcomment[80];\n  int row, col;\n  int ci;\n#ifdef PROGRESS_REPORT\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n#endif\n\n  /* Initialize the header info */\n  header = *rle_hdr_init(NULL);\n  header.rle_file = dest->pub.output_file;\n  header.xmin     = 0;\n  header.xmax     = cinfo->output_width  - 1;\n  header.ymin     = 0;\n  header.ymax     = cinfo->output_height - 1;\n  header.alpha    = 0;\n  header.ncolors  = cinfo->output_components;\n  for (ci = 0; ci < cinfo->output_components; ci++) {\n    RLE_SET_BIT(header, ci);\n  }\n  if (cinfo->quantize_colors) {\n    header.ncmap   = cinfo->out_color_components;\n    header.cmaplen = CMAPBITS;\n    header.cmap    = dest->colormap;\n    /* Add a comment to the output image with the true colormap length. */\n    sprintf(cmapcomment, \"color_map_length=%d\", cinfo->actual_number_of_colors);\n    rle_putcom(cmapcomment, &header);\n  }\n\n  /* Emit the RLE header and color map (if any) */\n  rle_put_setup(&header);\n\n  /* Now output the RLE data from our virtual array.\n   * We assume here that rle_pixel is represented the same as JSAMPLE.\n   */\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL) {\n    progress->pub.pass_limit = cinfo->output_height;\n    progress->pub.pass_counter = 0;\n    (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n  }\n#endif\n\n  if (cinfo->output_components == 1) {\n    for (row = cinfo->output_height-1; row >= 0; row--) {\n      rle_row = (rle_pixel **) (*cinfo->mem->access_virt_sarray)\n        ((j_common_ptr) cinfo, dest->image,\n         (JDIMENSION) row, (JDIMENSION) 1, FALSE);\n      rle_putrow(rle_row, (int) cinfo->output_width, &header);\n#ifdef PROGRESS_REPORT\n      if (progress != NULL) {\n        progress->pub.pass_counter++;\n        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n      }\n#endif\n    }\n  } else {\n    for (row = cinfo->output_height-1; row >= 0; row--) {\n      rle_row = (rle_pixel **) dest->rle_row;\n      output_row = *(*cinfo->mem->access_virt_sarray)\n        ((j_common_ptr) cinfo, dest->image,\n         (JDIMENSION) row, (JDIMENSION) 1, FALSE);\n      red = rle_row[0];\n      green = rle_row[1];\n      blue = rle_row[2];\n      for (col = cinfo->output_width; col > 0; col--) {\n        *red++ = GETJSAMPLE(*output_row++);\n        *green++ = GETJSAMPLE(*output_row++);\n        *blue++ = GETJSAMPLE(*output_row++);\n      }\n      rle_putrow(rle_row, (int) cinfo->output_width, &header);\n#ifdef PROGRESS_REPORT\n      if (progress != NULL) {\n        progress->pub.pass_counter++;\n        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n      }\n#endif\n    }\n  }\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL)\n    progress->completed_extra_passes++;\n#endif\n\n  /* Emit file trailer */\n  rle_puteof(&header);\n  fflush(dest->pub.output_file);\n  if (ferror(dest->pub.output_file))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * The module selection routine for RLE format output.\n */\n\nGLOBAL(djpeg_dest_ptr)\njinit_write_rle (j_decompress_ptr cinfo)\n{\n  rle_dest_ptr dest;\n\n  /* Create module interface object, fill in method pointers */\n  dest = (rle_dest_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(rle_dest_struct));\n  dest->pub.start_output = start_output_rle;\n  dest->pub.finish_output = finish_output_rle;\n\n  /* Calculate output image dimensions so we can allocate space */\n  jpeg_calc_output_dimensions(cinfo);\n\n  /* Allocate a work array for output to the RLE library. */\n  dest->rle_row = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE,\n     cinfo->output_width, (JDIMENSION) cinfo->output_components);\n\n  /* Allocate a virtual array to hold the image. */\n  dest->image = (*cinfo->mem->request_virt_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n     (JDIMENSION) (cinfo->output_width * cinfo->output_components),\n     cinfo->output_height, (JDIMENSION) 1);\n\n  return (djpeg_dest_ptr) dest;\n}\n\n#endif /* RLE_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libjpeg-turbo-1.5.0/wrtarga.c",
    "content": "/*\n * wrtarga.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * It was modified by The libjpeg-turbo Project to include only code and\n * information relevant to libjpeg-turbo.\n * For conditions of distribution and use, see the accompanying README.ijg\n * file.\n *\n * This file contains routines to write output images in Targa format.\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume output to\n * an ordinary stdio stream.\n *\n * Based on code contributed by Lee Daniel Crocker.\n */\n\n#include \"cdjpeg.h\"             /* Common decls for cjpeg/djpeg applications */\n\n#ifdef TARGA_SUPPORTED\n\n\n/*\n * To support 12-bit JPEG data, we'd have to scale output down to 8 bits.\n * This is not yet implemented.\n */\n\n#if BITS_IN_JSAMPLE != 8\n  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */\n#endif\n\n\n/* Private version of data destination object */\n\ntypedef struct {\n  struct djpeg_dest_struct pub; /* public fields */\n\n  char *iobuffer;               /* physical I/O buffer */\n  JDIMENSION buffer_width;      /* width of one row */\n} tga_dest_struct;\n\ntypedef tga_dest_struct *tga_dest_ptr;\n\n\nLOCAL(void)\nwrite_header (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, int num_colors)\n/* Create and write a Targa header */\n{\n  char targaheader[18];\n\n  /* Set unused fields of header to 0 */\n  MEMZERO(targaheader, sizeof(targaheader));\n\n  if (num_colors > 0) {\n    targaheader[1] = 1;         /* color map type 1 */\n    targaheader[5] = (char) (num_colors & 0xFF);\n    targaheader[6] = (char) (num_colors >> 8);\n    targaheader[7] = 24;        /* 24 bits per cmap entry */\n  }\n\n  targaheader[12] = (char) (cinfo->output_width & 0xFF);\n  targaheader[13] = (char) (cinfo->output_width >> 8);\n  targaheader[14] = (char) (cinfo->output_height & 0xFF);\n  targaheader[15] = (char) (cinfo->output_height >> 8);\n  targaheader[17] = 0x20;       /* Top-down, non-interlaced */\n\n  if (cinfo->out_color_space == JCS_GRAYSCALE) {\n    targaheader[2] = 3;         /* image type = uncompressed grayscale */\n    targaheader[16] = 8;        /* bits per pixel */\n  } else {                      /* must be RGB */\n    if (num_colors > 0) {\n      targaheader[2] = 1;       /* image type = colormapped RGB */\n      targaheader[16] = 8;\n    } else {\n      targaheader[2] = 2;       /* image type = uncompressed RGB */\n      targaheader[16] = 24;\n    }\n  }\n\n  if (JFWRITE(dinfo->output_file, targaheader, 18) != (size_t) 18)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * Write some pixel data.\n * In this module rows_supplied will always be 1.\n */\n\nMETHODDEF(void)\nput_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n                JDIMENSION rows_supplied)\n/* used for unquantized full-color output */\n{\n  tga_dest_ptr dest = (tga_dest_ptr) dinfo;\n  register JSAMPROW inptr;\n  register char *outptr;\n  register JDIMENSION col;\n\n  inptr = dest->pub.buffer[0];\n  outptr = dest->iobuffer;\n  for (col = cinfo->output_width; col > 0; col--) {\n    outptr[0] = (char) GETJSAMPLE(inptr[2]); /* RGB to BGR order */\n    outptr[1] = (char) GETJSAMPLE(inptr[1]);\n    outptr[2] = (char) GETJSAMPLE(inptr[0]);\n    inptr += 3, outptr += 3;\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\nMETHODDEF(void)\nput_gray_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n               JDIMENSION rows_supplied)\n/* used for grayscale OR quantized color output */\n{\n  tga_dest_ptr dest = (tga_dest_ptr) dinfo;\n  register JSAMPROW inptr;\n  register char *outptr;\n  register JDIMENSION col;\n\n  inptr = dest->pub.buffer[0];\n  outptr = dest->iobuffer;\n  for (col = cinfo->output_width; col > 0; col--) {\n    *outptr++ = (char) GETJSAMPLE(*inptr++);\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\n/*\n * Write some demapped pixel data when color quantization is in effect.\n * For Targa, this is only applied to grayscale data.\n */\n\nMETHODDEF(void)\nput_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n                   JDIMENSION rows_supplied)\n{\n  tga_dest_ptr dest = (tga_dest_ptr) dinfo;\n  register JSAMPROW inptr;\n  register char *outptr;\n  register JSAMPROW color_map0 = cinfo->colormap[0];\n  register JDIMENSION col;\n\n  inptr = dest->pub.buffer[0];\n  outptr = dest->iobuffer;\n  for (col = cinfo->output_width; col > 0; col--) {\n    *outptr++ = (char) GETJSAMPLE(color_map0[GETJSAMPLE(*inptr++)]);\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\n/*\n * Startup: write the file header.\n */\n\nMETHODDEF(void)\nstart_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  tga_dest_ptr dest = (tga_dest_ptr) dinfo;\n  int num_colors, i;\n  FILE *outfile;\n\n  if (cinfo->out_color_space == JCS_GRAYSCALE) {\n    /* Targa doesn't have a mapped grayscale format, so we will */\n    /* demap quantized gray output.  Never emit a colormap. */\n    write_header(cinfo, dinfo, 0);\n    if (cinfo->quantize_colors)\n      dest->pub.put_pixel_rows = put_demapped_gray;\n    else\n      dest->pub.put_pixel_rows = put_gray_rows;\n  } else if (cinfo->out_color_space == JCS_RGB) {\n    if (cinfo->quantize_colors) {\n      /* We only support 8-bit colormap indexes, so only 256 colors */\n      num_colors = cinfo->actual_number_of_colors;\n      if (num_colors > 256)\n        ERREXIT1(cinfo, JERR_TOO_MANY_COLORS, num_colors);\n      write_header(cinfo, dinfo, num_colors);\n      /* Write the colormap.  Note Targa uses BGR byte order */\n      outfile = dest->pub.output_file;\n      for (i = 0; i < num_colors; i++) {\n        putc(GETJSAMPLE(cinfo->colormap[2][i]), outfile);\n        putc(GETJSAMPLE(cinfo->colormap[1][i]), outfile);\n        putc(GETJSAMPLE(cinfo->colormap[0][i]), outfile);\n      }\n      dest->pub.put_pixel_rows = put_gray_rows;\n    } else {\n      write_header(cinfo, dinfo, 0);\n      dest->pub.put_pixel_rows = put_pixel_rows;\n    }\n  } else {\n    ERREXIT(cinfo, JERR_TGA_COLORSPACE);\n  }\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  /* Make sure we wrote the output file OK */\n  fflush(dinfo->output_file);\n  if (ferror(dinfo->output_file))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * The module selection routine for Targa format output.\n */\n\nGLOBAL(djpeg_dest_ptr)\njinit_write_targa (j_decompress_ptr cinfo)\n{\n  tga_dest_ptr dest;\n\n  /* Create module interface object, fill in method pointers */\n  dest = (tga_dest_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  sizeof(tga_dest_struct));\n  dest->pub.start_output = start_output_tga;\n  dest->pub.finish_output = finish_output_tga;\n\n  /* Calculate output image dimensions so we can allocate space */\n  jpeg_calc_output_dimensions(cinfo);\n\n  /* Create I/O buffer. */\n  dest->buffer_width = cinfo->output_width * cinfo->output_components;\n  dest->iobuffer = (char *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                (size_t) (dest->buffer_width * sizeof(char)));\n\n  /* Create decompressor output buffer. */\n  dest->pub.buffer = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width, (JDIMENSION) 1);\n  dest->pub.buffer_height = 1;\n\n  return (djpeg_dest_ptr) dest;\n}\n\n#endif /* TARGA_SUPPORTED */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/.private/README.txt",
    "content": "This directory contains private internal scripts used by the libusb\nproject maintainers.\n\nThese scripts are not intended for general usage and will not be\nexported when producing release archives.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/.private/bd.cmd",
    "content": "@echo off\nrem produce the DDK binary files for snapshots\nrem !!!THIS SCRIPT IS FOR INTERNAL DEVELOPER USE ONLY!!!\n\nif NOT x%DDK_TARGET_OS%==xWinXP goto usage\n\nset IWD=%~dp0\ncd ..\nmkdir E:\\dailies\\%DATE%\nfor %%A in (MS32 MS64) do mkdir E:\\dailies\\%DATE%\\%%A\nfor %%A in (MS32 MS64) do mkdir E:\\dailies\\%DATE%\\%%A\\static\nfor %%A in (MS32 MS64) do mkdir E:\\dailies\\%DATE%\\%%A\\dll\nfor %%A in (source bin32 bin64) do mkdir E:\\dailies\\%DATE%\\examples\\%%A\ncopy examples\\listdevs.c E:\\dailies\\%DATE%\\examples\\source\ncopy examples\\xusb.c E:\\dailies\\%DATE%\\examples\\source\ncopy examples\\ezusb.? E:\\dailies\\%DATE%\\examples\\source\ncopy examples\\fxload.c E:\\dailies\\%DATE%\\examples\\source\ncopy msvc\\stdint.h E:\\dailies\\%DATE%\\examples\\source\ncopy .private\\wbs.txt E:\\dailies\\%DATE%\\README.txt\n\nset ORG_BUILD_ALT_DIR=%BUILD_ALT_DIR%\nset ORG_BUILDARCH=%_BUILDARCH%\nset ORG_PATH=%PATH%\nset ORG_BUILD_DEFAULT_TARGETS=%BUILD_DEFAULT_TARGETS%\n\nset 386=1\nset AMD64=\nset BUILD_DEFAULT_TARGETS=-386\nset _AMD64bit=\nset _BUILDARCH=x86\nset PATH=%BASEDIR%\\bin\\x86;%BASEDIR%\\bin\\x86\\x86\n\ncd msvc\ncall ddk_build\ncd ..\n\n@echo off\ncopy Win32\\Release\\lib\\libusb-1.0.lib E:\\dailies\\%DATE%\\MS32\\static\ncopy Win32\\Release\\examples\\listdevs.exe E:\\dailies\\%DATE%\\examples\\bin32\ncopy Win32\\Release\\examples\\xusb.exe E:\\dailies\\%DATE%\\examples\\bin32\ncopy Win32\\Release\\examples\\fxload.exe E:\\dailies\\%DATE%\\examples\\bin32\n\ncd msvc\ncall ddk_build DLL\ncd ..\n\n@echo off\ncopy Win32\\Release\\lib\\libusb-1.0.lib E:\\dailies\\%DATE%\\MS32\\dll\ncopy Win32\\Release\\dll\\libusb-1.0.dll E:\\dailies\\%DATE%\\MS32\\dll\ncopy Win32\\Release\\dll\\libusb-1.0.pdb E:\\dailies\\%DATE%\\MS32\\dll\n\nset 386=\nset AMD64=1\nset BUILD_DEFAULT_TARGETS=-amd64\nset _AMD64bit=true\nset _BUILDARCH=AMD64\nset PATH=%BASEDIR%\\bin\\x86\\amd64;%BASEDIR%\\bin\\x86\n\ncd msvc\ncall ddk_build\ncd ..\n\n@echo off\ncopy x64\\Release\\lib\\libusb-1.0.lib E:\\dailies\\%DATE%\\MS64\\static\ncopy x64\\Release\\examples\\listdevs.exe E:\\dailies\\%DATE%\\examples\\bin64\ncopy x64\\Release\\examples\\xusb.exe E:\\dailies\\%DATE%\\examples\\bin64\ncopy x64\\Release\\examples\\fxload.exe E:\\dailies\\%DATE%\\examples\\bin64\n\ncd msvc\ncall ddk_build DLL\ncd ..\n\n@echo off\ncopy x64\\Release\\lib\\libusb-1.0.lib E:\\dailies\\%DATE%\\MS64\\dll\ncopy x64\\Release\\dll\\libusb-1.0.dll E:\\dailies\\%DATE%\\MS64\\dll\ncopy x64\\Release\\dll\\libusb-1.0.pdb E:\\dailies\\%DATE%\\MS64\\dll\n\nset BUILD_ALT_DIR=%ORG_BUILD_ALT_DIR%\nset _BUILDARCH=%ORG_BUILDARCH%\nset PATH=%ORG_PATH%\nset BUILD_DEFAULT_TARGETS=%ORG_BUILD_DEFAULT_TARGETS%\n\ngoto done\n\n:usage\necho must be run in a WXP build environment!\n\n:done\ncd %IWD%"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/.private/bm.sh",
    "content": "#!/bin/sh\n# produce the MinGW binary files for snapshots\n# !!!THIS SCRIPT IS FOR INTERNAL DEVELOPER USE ONLY!!!\n\nPWD=`pwd`\ncd ..\ndate=`date +%Y.%m.%d`\ntarget=e:/dailies/$date\nmkdir -p $target/include/libusb-1.0\ncp -v libusb/libusb-1.0.def $target\ncp -v libusb/libusb.h $target/include/libusb-1.0\n\n#\n# 32 bit binaries\n#\ntarget=e:/dailies/$date/MinGW32\ngit clean -fdx\n# Not using debug (-g) in CFLAGS DRAMATICALLY reduces the size of the binaries\nexport CFLAGS=\"-O2 -m32\"\nexport LDFLAGS=\"-m32\"\nexport RCFLAGS=\"--target=pe-i386\"\nexport DLLTOOLFLAGS=\"-m i386 -f --32\"\necho `pwd`\n(glibtoolize --version) < /dev/null > /dev/null 2>&1 && LIBTOOLIZE=glibtoolize || LIBTOOLIZE=libtoolize\n$LIBTOOLIZE --copy --force || exit 1\naclocal || exit 1\nautoheader || exit 1\nautoconf || exit 1\nautomake -a -c || exit 1\n./configure\nmake -j2\nmkdir -p $target/static\nmkdir -p $target/dll\ncp -v libusb/.libs/libusb-1.0.a $target/static\ncp -v libusb/.libs/libusb-1.0.dll $target/dll\ncp -v libusb/.libs/libusb-1.0.dll.a $target/dll\nmake clean -j2\n\n#\n# 64 bit binaries\n#\ntarget=e:/dailies/$date/MinGW64\nexport CFLAGS=\"-O2\"\nexport LDFLAGS=\"\"\nexport RCFLAGS=\"\"\nexport DLLTOOLFLAGS=\"\"\n./configure\nmake -j2\nmkdir -p $target/static\nmkdir -p $target/dll\ncp -v libusb/.libs/libusb-1.0.a $target/static\ncp -v libusb/.libs/libusb-1.0.dll $target/dll\ncp -v libusb/.libs/libusb-1.0.dll.a $target/dll\ncd $PWD"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/.private/bwince.cmd",
    "content": "@echo off\nrem produce the Win CE binary files for snapshots\nrem !!!THIS SCRIPT IS FOR INTERNAL DEVELOPER USE ONLY!!!\n\nif \"x%VSINSTALLDIR%\"==\"x\" goto usage\n\nif \"x%WINCE_TARGET_DIR_BASE%\"==\"x\" set WINCE_TARGET_DIR_BASE=E:\\dailies\nif \"x%WINCE_TARGET_ARCHES%\"==\"x\" set WINCE_TARGET_ARCHES=ARMV4I MIPSII MIPSII_FP MIPSIV MIPSIV_FP SH4 x86\n\n\nset WINCE_TARGET_DIR=%WINCE_TARGET_DIR_BASE%\\%DATE:/=-%\nset MSBUILD_CMD=msbuild.exe\nset MSBUILD_TARGET=Rebuild\nset MSBUILD_CONFIGURATION=Release\nset WINCE_SLN=msvc\\libusb_wince.sln\nset PLATFORM_PREFIX=STANDARDSDK_500 (\nset PLATFORM_POSTFIX=)\n\n\nset PWD=%~dp0\ncd ..\n\nmkdir %WINCE_TARGET_DIR%\nmkdir %WINCE_TARGET_DIR%\\include\\libusb-1.0\ncopy libusb\\libusb-1.0.def %WINCE_TARGET_DIR%\ncopy libusb\\libusb.h %WINCE_TARGET_DIR%\\include\\libusb-1.0\nfor %%A in (%WINCE_TARGET_ARCHES%) do mkdir %WINCE_TARGET_DIR%\\%%A\nfor %%A in (%WINCE_TARGET_ARCHES%) do mkdir %WINCE_TARGET_DIR%\\%%A\\static\nfor %%A in (%WINCE_TARGET_ARCHES%) do mkdir %WINCE_TARGET_DIR%\\%%A\\dll\nfor %%A in (%WINCE_TARGET_ARCHES%) do mkdir %WINCE_TARGET_DIR%\\examples\\%%A\nmkdir %WINCE_TARGET_DIR%\\examples\\source\ncopy examples\\listdevs.c %WINCE_TARGET_DIR%\\examples\\source\ncopy examples\\xusb.c %WINCE_TARGET_DIR%\\examples\\source\ncopy msvc\\stdint.h %WINCE_TARGET_DIR%\\examples\\source\ncopy .private\\wbs_wince.txt %WINCE_TARGET_DIR%\\README.txt\ncopy COPYING %WINCE_TARGET_DIR%\\COPYING\n\nrem Perform the rebuild\nfor %%A in (%WINCE_TARGET_ARCHES%) do %MSBUILD_CMD% %WINCE_SLN% /property:Platform=\"%PLATFORM_PREFIX%%%A%PLATFORM_POSTFIX%\" /property:Configuration=%MSBUILD_CONFIGURATION% /target:%MSBUILD_TARGET%\"\n\n\nrem Copy across the binaries\nfor %%A in (%WINCE_TARGET_ARCHES%) do (\n\tcopy %%A\\%MSBUILD_CONFIGURATION%\\lib\\libusb-1.0.lib %WINCE_TARGET_DIR%\\%%A\\static\n\tcopy %%A\\%MSBUILD_CONFIGURATION%\\examples\\listdevs.exe %WINCE_TARGET_DIR%\\examples\\%%A\n\tcopy %%A\\%MSBUILD_CONFIGURATION%\\examples\\xusb.exe %WINCE_TARGET_DIR%\\examples\\%%A\n\tcopy %%A\\%MSBUILD_CONFIGURATION%\\dll\\libusb-1.0.lib %WINCE_TARGET_DIR%\\%%A\\dll\n\tcopy %%A\\%MSBUILD_CONFIGURATION%\\dll\\libusb-1.0.dll %WINCE_TARGET_DIR%\\%%A\\dll\n\tcopy %%A\\%MSBUILD_CONFIGURATION%\\dll\\libusb-1.0.pdb %WINCE_TARGET_DIR%\\%%A\\dll )\n\ngoto done\n\n:usage\necho must be run in a Visual Studio 2005 build environment!\n\n:done\ncd %PWD%"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/.private/post-rewrite.sh",
    "content": "#!/bin/sh\n#\n# Detect amended commits and warn user if .amend is missing\n#\n# To have git run this script on commit, create a \"post-rewrite\" text file in\n# .git/hooks/ with the following content:\n# #!/bin/sh\n# if [ -x .private/post-rewrite.sh ]; then\n#   source .private/post-rewrite.sh\n# fi\n#\n# NOTE: These versioning hooks are intended to be used *INTERNALLY* by the\n# libusb development team and are NOT intended to solve versioning for any\n# derivative branch, such as one you would create for private development.\n#\n\ncase \"$1\" in\n  amend)\n    # Check if a .amend exists. If none, create one and warn user to re-commit.\n    if [ -f .amend ]; then\n      rm .amend\n    else\n      echo \"Amend commit detected, but no .amend file - One has now been created.\"\n      echo \"Please re-commit as is (amend), so that the version number is correct.\"\n      touch .amend\n    fi ;;\n  *) ;;\nesac\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/.private/pre-commit.sh",
    "content": "#!/bin/sh\n#\n# Sets the nano version according to the number of commits on this branch, as\n# well as the branch offset.\n#\n# To have git run this script on commit, first make sure you change\n# BRANCH_OFFSET to 60000 or higher, then create a \"pre-commit\" text file in\n# .git/hooks/ with the following content:\n# #!/bin/sh\n# if [ -x .private/pre-commit.sh ]; then\n#   source .private/pre-commit.sh\n# fi\n#\n# NOTE: These versioning hooks are intended to be used *INTERNALLY* by the\n# libusb development team and are NOT intended to solve versioning for any\n# derivative branch, such as one you would create for private development.\n#\n# Should you wish to reuse these scripts for your own versioning, in your own\n# private branch, we kindly ask you to first set BRANCH_OFFSET to 60000, or\n# higher, as any offset below below 60000 is *RESERVED* for libusb official\n# usage.\n\n################################################################################\n##  YOU *MUST* SET THE FOLLOWING TO 60000 OR HIGHER IF YOU REUSE THIS SCRIPT  ##\n################################################################################\nBRANCH_OFFSET=10000\n################################################################################\n\ntype -P git &>/dev/null || { echo \"git command not found. Aborting.\" >&2; exit 1; }\n\nNANO=`git log --oneline | wc -l`\nNANO=`expr $NANO + $BRANCH_OFFSET`\n# Amended commits need to have the nano corrected. Current versions of git hooks\n# only allow detection of amending post commit, so we require a .amend file,\n# which will be created post commit with a user warning if none exists when an\n# amend is detected.\nif [ -f .amend ]; then\n  NANO=`expr $NANO - 1`\nfi\necho \"setting nano to $NANO\"\necho \"#define LIBUSB_NANO $NANO\" > libusb/version_nano.h\ngit add libusb/version_nano.h\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/.private/wbs.txt",
    "content": "              libusb 1.0 Windows binary snapshot - README\n\n   *********************************************************************\n   *  The latest version of this snapshot can always be downloaded at: *\n   *         https://sourceforge.net/projects/libusb/files/           *\n   *********************************************************************\n\no Visual Studio:\n  - Open existing or create a new project for your application\n  - Copy libusb.h, from the include\\libusb-1.0\\ directory, into your project and\n    make sure that the location where the file reside appears in the 'Additional\n    Include Directories' section (Configuration Properties -> C/C++ -> General).\n  - Copy the relevant .lib file from MS32\\ or MS64\\ and add 'libusb-1.0.lib' to\n    your 'Additional Dependencies' (Configuration Properties -> Linker -> Input)\n    Also make sure that the directory where libusb-1.0.lib resides is added to\n    'Additional Library Directories' (Configuration Properties -> Linker\n    -> General)\n  - If you use the static version of the libusb library, make sure that\n    'Runtime Library' is set to 'Multi-threaded DLL (/MD)' (Configuration\n    Properties -> C/C++ -> Code Generation).\n    NB: If your application requires /MT (Multi-threaded/libCMT), you need to\n    recompile a static libusb 1.0 library from source.\n  - Compile and run your application. If you use the DLL version of libusb-1.0,\n    remember that you need to have a copy of the DLL either in the runtime\n    directory or in system32\n\no WDK/DDK:\n  - The following is an example of a sources files that you can use to compile\n    a libusb 1.0 based console application. In this sample ..\\libusb\\ is the\n    directory where you would have copied libusb.h as well as the relevant \n    libusb-1.0.lib\n\n\tTARGETNAME=your_app\n\tTARGETTYPE=PROGRAM\n\tUSE_MSVCRT=1\n\tUMTYPE=console\n\tINCLUDES=..\\libusb;$(DDK_INC_PATH)\n\tTARGETLIBS=..\\libusb\\libusb-1.0.lib\n\tSOURCES=your_app.c\n\n  - Note that if you plan to use libCMT instead of MSVCRT (USE_LIBCMT=1 instead\n    of USE_MSVCRT=1), you will need to recompile libusb to use libCMT. This can\n    easily be achieved, in the DDK environment, by running 'ddk_build /MT'\n\no MinGW/cygwin\n  - Copy libusb.h, from include/libusb-1.0/ to your default include directory,\n    and copy the MinGW32/ or MinGW64/ .a files to your default library directory.\n    Or, if you don't want to use the default locations, make sure that you feed\n    the relevant -I and -L options to the compiler.\n  - Add the '-lusb-1.0' linker option when compiling.\n\no Additional information:\n  - The libusb 1.0 API documentation can be accessed at:\n    http://api.libusb.info\n  - For some libusb samples (including source), please have a look in examples/\n  - For additional information on the libusb 1.0 Windows backend please visit:\n    http://windows.libusb.info\n  - The MinGW and MS generated DLLs are fully interchangeable, provided that you\n    use the import libs provided or generate one from the .def also provided.\n  - If you find any issue, please visit http://libusb.info/ and check the\n    Support section\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/.private/wbs_wince.txt",
    "content": "              libusb 1.0 Windows CE binary snapshot - README\n\n   *********************************************************************\n   *  The latest version of this snapshot can always be downloaded at: *\n   *         https://sourceforge.net/projects/libusb/files/           *\n   *********************************************************************\n\nThe binaries contained in this snapshot are licensed under the\nGNU Lesser General Public License version 2.1 or, at your option, any later\nversion (see COPYING for further details). The source code for these binaries\nis available for download at the same location as this binary snapshot.\n\no Visual Studio:\n  - Open existing or create a new project for your application\n  - Copy libusb.h, from the include\\libusb-1.0\\ directory, into your project and\n    make sure that the location where the file reside appears in the 'Additional\n    Include Directories' section (Configuration Properties -> C/C++ -> General).\n  - Copy the relevant .lib file from ARMV4I, MIPSII, MIPSII_FP, MIPSIV, MIPSIV_FP,\n    SH4 or x86 and add 'libusb-1.0.lib' to  your 'Additional Dependencies'\n    (Configuration Properties -> Linker -> Input). Also make sure that the\n    directory where libusb-1.0.lib resides is added to 'Additional Library\n    Directories' (Configuration Properties -> Linker -> General)\n  - If you use the static version of the libusb library, make sure that\n    'Runtime Library' is set to 'Multi-threaded DLL (/MD)' (Configuration\n    Properties -> C/C++ -> Code Generation).\n    NB: If your application requires /MT (Multi-threaded/libCMT), you need to\n    recompile a static libusb 1.0 library from source.\n  - Compile and run your application. If you use the DLL version of libusb-1.0,\n    remember that you need to have a copy of the DLL either in the runtime\n    directory or in system32\n\no Additional information:\n  - The libusb 1.0 API documentation can be accessed at:\n    http://api.libusb.info\n  - For some libusb samples (including source), please have a look in examples/\n  - For additional information on the libusb 1.0 Windows backend please visit:\n    http://windows.libusb.info\n  - It is necessary to install the CE USB Kernel Wrapper driver for libusb to\n    function on a device. This is obtainable from:\n    https://github.com/RealVNC/CEUSBKWrapper\n  - If you find any issue, please visit http://libusb.info/ and check the\n    Support section\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/AUTHORS",
    "content": "Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>\nCopyright © 2007-2009 Daniel Drake <dsd@gentoo.org>\nCopyright © 2010-2012 Peter Stuge <peter@stuge.se>\nCopyright © 2008-2013 Nathan Hjelm <hjelmn@users.sourceforge.net>\nCopyright © 2009-2013 Pete Batard <pete@akeo.ie>\nCopyright © 2009-2013 Ludovic Rousseau <ludovic.rousseau@gmail.com>\nCopyright © 2010-2012 Michael Plante <michael.plante@gmail.com>\nCopyright © 2011-2013 Hans de Goede <hdegoede@redhat.com>\nCopyright © 2012-2013 Martin Pieuchot <mpi@openbsd.org>\nCopyright © 2012-2013 Toby Gray <toby.gray@realvnc.com>\n\nOther contributors:\nAlan Ott\nAlan Stern\nAlex Vatchenko\nAndrew Fernandes\nAnthony Clay\nArtem Egorkine\nAurelien Jarno\nBastien Nocera\nBei Zhang\nBenjamin Dobell\nChris Dickens\nColin Walters\nDave Camarillo\nDavid Engraf\nDavid Moore\nDavidlohr Bueso\nFederico Manzan\nFelipe Balbi\nFlorian Albrechtskirchinger\nFrancesco Montorsi\nFrancisco Facioni\nGraeme Gill\nGustavo Zacarias\nHans Ulrich Niedermann\nHector Martin\nHoi-Ho Chan\nIlya Konstantinov\nJames Hanko\nJoshua Blake\nKarsten Koenig\nKonrad Rzepecki\nKuangye Guo\nLars Wirzenius\nLuca Longinotti\nMartin Koegler\nMatthias Bolte\nMike Frysinger\nMikhail Gusarov\nMoritz Fischer\nNicholas Corgan\nOmri Iluz\nOrin Eman\nPaul Fertser\nPekka Nikander\nRob Walker\nSean McBride\nSebastian Pipping\nSimon Haggett\nThomas Röfer\nTim Roberts\nToby Peterson\nTrygve Laugstøl\nUri Lublin\nVasily Khoruzhick\nVegard Storheil Eriksen\nVitali Lovich\nXiaofan Chen\nZoltán Kovács\nРоман Донченко\nxantares\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/COPYING",
    "content": "\t\t  GNU LESSER GENERAL PUBLIC LICENSE\n\t\t       Version 2.1, February 1999\n\n Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n[This is the first released version of the Lesser GPL.  It also counts\n as the successor of the GNU Library Public License, version 2, hence\n the version number 2.1.]\n\n\t\t\t    Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicenses are intended to guarantee your freedom to share and change\nfree software--to make sure the software is free for all its users.\n\n  This license, the Lesser General Public License, applies to some\nspecially designated software packages--typically libraries--of the\nFree Software Foundation and other authors who decide to use it.  You\ncan use it too, but we suggest you first think carefully about whether\nthis license or the ordinary General Public License is the better\nstrategy to use in any particular case, based on the explanations below.\n\n  When we speak of free software, we are referring to freedom of use,\nnot price.  Our General Public Licenses are designed to make sure that\nyou have the freedom to distribute copies of free software (and charge\nfor this service if you wish); that you receive source code or can get\nit if you want it; that you can change the software and use pieces of\nit in new free programs; and that you are informed that you can do\nthese things.\n\n  To protect your rights, we need to make restrictions that forbid\ndistributors to deny you these rights or to ask you to surrender these\nrights.  These restrictions translate to certain responsibilities for\nyou if you distribute copies of the library or if you modify it.\n\n  For example, if you distribute copies of the library, whether gratis\nor for a fee, you must give the recipients all the rights that we gave\nyou.  You must make sure that they, too, receive or can get the source\ncode.  If you link other code with the library, you must provide\ncomplete object files to the recipients, so that they can relink them\nwith the library after making changes to the library and recompiling\nit.  And you must show them these terms so they know their rights.\n\n  We protect your rights with a two-step method: (1) we copyright the\nlibrary, and (2) we offer you this license, which gives you legal\npermission to copy, distribute and/or modify the library.\n\n  To protect each distributor, we want to make it very clear that\nthere is no warranty for the free library.  Also, if the library is\nmodified by someone else and passed on, the recipients should know\nthat what they have is not the original version, so that the original\nauthor's reputation will not be affected by problems that might be\nintroduced by others.\n\f\n  Finally, software patents pose a constant threat to the existence of\nany free program.  We wish to make sure that a company cannot\neffectively restrict the users of a free program by obtaining a\nrestrictive license from a patent holder.  Therefore, we insist that\nany patent license obtained for a version of the library must be\nconsistent with the full freedom of use specified in this license.\n\n  Most GNU software, including some libraries, is covered by the\nordinary GNU General Public License.  This license, the GNU Lesser\nGeneral Public License, applies to certain designated libraries, and\nis quite different from the ordinary General Public License.  We use\nthis license for certain libraries in order to permit linking those\nlibraries into non-free programs.\n\n  When a program is linked with a library, whether statically or using\na shared library, the combination of the two is legally speaking a\ncombined work, a derivative of the original library.  The ordinary\nGeneral Public License therefore permits such linking only if the\nentire combination fits its criteria of freedom.  The Lesser General\nPublic License permits more lax criteria for linking other code with\nthe library.\n\n  We call this license the \"Lesser\" General Public License because it\ndoes Less to protect the user's freedom than the ordinary General\nPublic License.  It also provides other free software developers Less\nof an advantage over competing non-free programs.  These disadvantages\nare the reason we use the ordinary General Public License for many\nlibraries.  However, the Lesser license provides advantages in certain\nspecial circumstances.\n\n  For example, on rare occasions, there may be a special need to\nencourage the widest possible use of a certain library, so that it becomes\na de-facto standard.  To achieve this, non-free programs must be\nallowed to use the library.  A more frequent case is that a free\nlibrary does the same job as widely used non-free libraries.  In this\ncase, there is little to gain by limiting the free library to free\nsoftware only, so we use the Lesser General Public License.\n\n  In other cases, permission to use a particular library in non-free\nprograms enables a greater number of people to use a large body of\nfree software.  For example, permission to use the GNU C Library in\nnon-free programs enables many more people to use the whole GNU\noperating system, as well as its variant, the GNU/Linux operating\nsystem.\n\n  Although the Lesser General Public License is Less protective of the\nusers' freedom, it does ensure that the user of a program that is\nlinked with the Library has the freedom and the wherewithal to run\nthat program using a modified version of the Library.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.  Pay close attention to the difference between a\n\"work based on the library\" and a \"work that uses the library\".  The\nformer contains code derived from the library, whereas the latter must\nbe combined with the library in order to run.\n\f\n\t\t  GNU LESSER GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License Agreement applies to any software library or other\nprogram which contains a notice placed by the copyright holder or\nother authorized party saying it may be distributed under the terms of\nthis Lesser General Public License (also called \"this License\").\nEach licensee is addressed as \"you\".\n\n  A \"library\" means a collection of software functions and/or data\nprepared so as to be conveniently linked with application programs\n(which use some of those functions and data) to form executables.\n\n  The \"Library\", below, refers to any such software library or work\nwhich has been distributed under these terms.  A \"work based on the\nLibrary\" means either the Library or any derivative work under\ncopyright law: that is to say, a work containing the Library or a\nportion of it, either verbatim or with modifications and/or translated\nstraightforwardly into another language.  (Hereinafter, translation is\nincluded without limitation in the term \"modification\".)\n\n  \"Source code\" for a work means the preferred form of the work for\nmaking modifications to it.  For a library, complete source code means\nall the source code for all modules it contains, plus any associated\ninterface definition files, plus the scripts used to control compilation\nand installation of the library.\n\n  Activities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning a program using the Library is not restricted, and output from\nsuch a program is covered only if its contents constitute a work based\non the Library (independent of the use of the Library in a tool for\nwriting it).  Whether that is true depends on what the Library does\nand what the program that uses the Library does.\n  \n  1. You may copy and distribute verbatim copies of the Library's\ncomplete source code as you receive it, in any medium, provided that\nyou conspicuously and appropriately publish on each copy an\nappropriate copyright notice and disclaimer of warranty; keep intact\nall the notices that refer to this License and to the absence of any\nwarranty; and distribute a copy of this License along with the\nLibrary.\n\n  You may charge a fee for the physical act of transferring a copy,\nand you may at your option offer warranty protection in exchange for a\nfee.\n\f\n  2. You may modify your copy or copies of the Library or any portion\nof it, thus forming a work based on the Library, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) The modified work must itself be a software library.\n\n    b) You must cause the files modified to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    c) You must cause the whole of the work to be licensed at no\n    charge to all third parties under the terms of this License.\n\n    d) If a facility in the modified Library refers to a function or a\n    table of data to be supplied by an application program that uses\n    the facility, other than as an argument passed when the facility\n    is invoked, then you must make a good faith effort to ensure that,\n    in the event an application does not supply such function or\n    table, the facility still operates, and performs whatever part of\n    its purpose remains meaningful.\n\n    (For example, a function in a library to compute square roots has\n    a purpose that is entirely well-defined independent of the\n    application.  Therefore, Subsection 2d requires that any\n    application-supplied function or table used by this function must\n    be optional: if the application does not supply it, the square\n    root function must still compute square roots.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Library,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Library, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote\nit.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Library.\n\nIn addition, mere aggregation of another work not based on the Library\nwith the Library (or with a work based on the Library) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may opt to apply the terms of the ordinary GNU General Public\nLicense instead of this License to a given copy of the Library.  To do\nthis, you must alter all the notices that refer to this License, so\nthat they refer to the ordinary GNU General Public License, version 2,\ninstead of to this License.  (If a newer version than version 2 of the\nordinary GNU General Public License has appeared, then you can specify\nthat version instead if you wish.)  Do not make any other change in\nthese notices.\n\f\n  Once this change is made in a given copy, it is irreversible for\nthat copy, so the ordinary GNU General Public License applies to all\nsubsequent copies and derivative works made from that copy.\n\n  This option is useful when you wish to copy part of the code of\nthe Library into a program that is not a library.\n\n  4. You may copy and distribute the Library (or a portion or\nderivative of it, under Section 2) in object code or executable form\nunder the terms of Sections 1 and 2 above provided that you accompany\nit with the complete corresponding machine-readable source code, which\nmust be distributed under the terms of Sections 1 and 2 above on a\nmedium customarily used for software interchange.\n\n  If distribution of object code is made by offering access to copy\nfrom a designated place, then offering equivalent access to copy the\nsource code from the same place satisfies the requirement to\ndistribute the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  5. A program that contains no derivative of any portion of the\nLibrary, but is designed to work with the Library by being compiled or\nlinked with it, is called a \"work that uses the Library\".  Such a\nwork, in isolation, is not a derivative work of the Library, and\ntherefore falls outside the scope of this License.\n\n  However, linking a \"work that uses the Library\" with the Library\ncreates an executable that is a derivative of the Library (because it\ncontains portions of the Library), rather than a \"work that uses the\nlibrary\".  The executable is therefore covered by this License.\nSection 6 states terms for distribution of such executables.\n\n  When a \"work that uses the Library\" uses material from a header file\nthat is part of the Library, the object code for the work may be a\nderivative work of the Library even though the source code is not.\nWhether this is true is especially significant if the work can be\nlinked without the Library, or if the work is itself a library.  The\nthreshold for this to be true is not precisely defined by law.\n\n  If such an object file uses only numerical parameters, data\nstructure layouts and accessors, and small macros and small inline\nfunctions (ten lines or less in length), then the use of the object\nfile is unrestricted, regardless of whether it is legally a derivative\nwork.  (Executables containing this object code plus portions of the\nLibrary will still fall under Section 6.)\n\n  Otherwise, if the work is a derivative of the Library, you may\ndistribute the object code for the work under the terms of Section 6.\nAny executables containing that work also fall under Section 6,\nwhether or not they are linked directly with the Library itself.\n\f\n  6. As an exception to the Sections above, you may also combine or\nlink a \"work that uses the Library\" with the Library to produce a\nwork containing portions of the Library, and distribute that work\nunder terms of your choice, provided that the terms permit\nmodification of the work for the customer's own use and reverse\nengineering for debugging such modifications.\n\n  You must give prominent notice with each copy of the work that the\nLibrary is used in it and that the Library and its use are covered by\nthis License.  You must supply a copy of this License.  If the work\nduring execution displays copyright notices, you must include the\ncopyright notice for the Library among them, as well as a reference\ndirecting the user to the copy of this License.  Also, you must do one\nof these things:\n\n    a) Accompany the work with the complete corresponding\n    machine-readable source code for the Library including whatever\n    changes were used in the work (which must be distributed under\n    Sections 1 and 2 above); and, if the work is an executable linked\n    with the Library, with the complete machine-readable \"work that\n    uses the Library\", as object code and/or source code, so that the\n    user can modify the Library and then relink to produce a modified\n    executable containing the modified Library.  (It is understood\n    that the user who changes the contents of definitions files in the\n    Library will not necessarily be able to recompile the application\n    to use the modified definitions.)\n\n    b) Use a suitable shared library mechanism for linking with the\n    Library.  A suitable mechanism is one that (1) uses at run time a\n    copy of the library already present on the user's computer system,\n    rather than copying library functions into the executable, and (2)\n    will operate properly with a modified version of the library, if\n    the user installs one, as long as the modified version is\n    interface-compatible with the version that the work was made with.\n\n    c) Accompany the work with a written offer, valid for at\n    least three years, to give the same user the materials\n    specified in Subsection 6a, above, for a charge no more\n    than the cost of performing this distribution.\n\n    d) If distribution of the work is made by offering access to copy\n    from a designated place, offer equivalent access to copy the above\n    specified materials from the same place.\n\n    e) Verify that the user has already received a copy of these\n    materials or that you have already sent this user a copy.\n\n  For an executable, the required form of the \"work that uses the\nLibrary\" must include any data and utility programs needed for\nreproducing the executable from it.  However, as a special exception,\nthe materials to be distributed need not include anything that is\nnormally distributed (in either source or binary form) with the major\ncomponents (compiler, kernel, and so on) of the operating system on\nwhich the executable runs, unless that component itself accompanies\nthe executable.\n\n  It may happen that this requirement contradicts the license\nrestrictions of other proprietary libraries that do not normally\naccompany the operating system.  Such a contradiction means you cannot\nuse both them and the Library together in an executable that you\ndistribute.\n\f\n  7. You may place library facilities that are a work based on the\nLibrary side-by-side in a single library together with other library\nfacilities not covered by this License, and distribute such a combined\nlibrary, provided that the separate distribution of the work based on\nthe Library and of the other library facilities is otherwise\npermitted, and provided that you do these two things:\n\n    a) Accompany the combined library with a copy of the same work\n    based on the Library, uncombined with any other library\n    facilities.  This must be distributed under the terms of the\n    Sections above.\n\n    b) Give prominent notice with the combined library of the fact\n    that part of it is a work based on the Library, and explaining\n    where to find the accompanying uncombined form of the same work.\n\n  8. You may not copy, modify, sublicense, link with, or distribute\nthe Library except as expressly provided under this License.  Any\nattempt otherwise to copy, modify, sublicense, link with, or\ndistribute the Library is void, and will automatically terminate your\nrights under this License.  However, parties who have received copies,\nor rights, from you under this License will not have their licenses\nterminated so long as such parties remain in full compliance.\n\n  9. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Library or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Library (or any work based on the\nLibrary), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Library or works based on it.\n\n  10. Each time you redistribute the Library (or any work based on the\nLibrary), the recipient automatically receives a license from the\noriginal licensor to copy, distribute, link with or modify the Library\nsubject to these terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties with\nthis License.\n\f\n  11. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Library at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Library by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Library.\n\nIf any portion of this section is held invalid or unenforceable under any\nparticular circumstance, the balance of the section is intended to apply,\nand the section as a whole is intended to apply in other circumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  12. If the distribution and/or use of the Library is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Library under this License may add\nan explicit geographical distribution limitation excluding those countries,\nso that distribution is permitted only in or among countries not thus\nexcluded.  In such case, this License incorporates the limitation as if\nwritten in the body of this License.\n\n  13. The Free Software Foundation may publish revised and/or new\nversions of the Lesser General Public License from time to time.\nSuch new versions will be similar in spirit to the present version,\nbut may differ in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Library\nspecifies a version number of this License which applies to it and\n\"any later version\", you have the option of following the terms and\nconditions either of that version or of any later version published by\nthe Free Software Foundation.  If the Library does not specify a\nlicense version number, you may choose any version ever published by\nthe Free Software Foundation.\n\f\n  14. If you wish to incorporate parts of the Library into other free\nprograms whose distribution conditions are incompatible with these,\nwrite to the author to ask for permission.  For software which is\ncopyrighted by the Free Software Foundation, write to the Free\nSoftware Foundation; we sometimes make exceptions for this.  Our\ndecision will be guided by the two goals of preserving the free status\nof all derivatives of our free software and of promoting the sharing\nand reuse of software generally.\n\n\t\t\t    NO WARRANTY\n\n  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\nWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\nEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\nOTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY\nKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\nLIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\nTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\nWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\nAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\nFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\nCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\nLIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\nRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\nFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\nSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGES.\n\n\t\t     END OF TERMS AND CONDITIONS\n\f\n           How to Apply These Terms to Your New Libraries\n\n  If you develop a new library, and you want it to be of the greatest\npossible use to the public, we recommend making it free software that\neveryone can redistribute and change.  You can do so by permitting\nredistribution under these terms (or, alternatively, under the terms of the\nordinary General Public License).\n\n  To apply these terms, attach the following notices to the library.  It is\nsafest to attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least the\n\"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the library's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\nAlso add information on how to contact you by electronic and paper mail.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the library, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the\n  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\n\n  <signature of Ty Coon>, 1 April 1990\n  Ty Coon, President of Vice\n\nThat's all there is to it!\n\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/ChangeLog",
    "content": "For detailed information about the changes below, please see the git log or\nvisit: http://log.libusb.info\n\n2014-01-25: v1.0.18\n* Fix multiple memory leaks\n* Fix a crash when HID transfers return no data on Windows\n* Ensure all pending events are consumed\n* Improve Android and ucLinux support\n* Multiple Windows improvements (error logging, VS2013, VIA xHCI support)\n* Multiple OS X improvements (broken compilation, SIGFPE, 64bit support)\n\n2013-09-06: v1.0.17\n* Hotplug callbacks now always get passed a libusb_context, even if it is\n  the default context. Previously NULL would be passed for the default context,\n  but since the first context created is the default context, and most apps\n  use only 1 context, this meant that apps explicitly creating a context would\n  still get passed NULL\n* Android: Add .mk files to build with the Android NDK\n* Darwin: Add Xcode project\n* Darwin: Fix crash on unplug (#121)\n* Linux: Fix hang (deadlock) on libusb_exit\n* Linux: Fix libusb build failure with --disable-udev (#124)\n* Linux: Fix libusb_get_device_list() hang with --disable-udev (#130)\n* OpenBSD: Update OpenBSD backend with support for control transfers to\n  non-ugen(4) devices and make get_configuration() no longer generate I/O.\n  Note that using this libusb version on OpenBSD requires using\n  OpenBSD 5.3-current or later. Users of older OpenBSD versions are advised\n  to stay with the libusb shipped with OpenBSD (mpi)\n* Windows: fix libusb_dll_2010.vcxproj link errors (#129)\n* Various other bug fixes and improvements\nThe (#xx) numbers are libusbx issue numbers, see ie:\nhttps://github.com/libusbx/libusbx/issues/121\n\n2013-07-11: v1.0.16\n* Add hotplug support for Darwin and Linux (#9)\n* Add superspeed endpoint companion descriptor support (#15)\n* Add BOS descriptor support (#15)\n* Make descriptor parsing code more robust\n* New libusb_get_port_numbers API, this is libusb_get_port_path without\n  the unnecessary context parameter, libusb_get_port_path is now deprecated\n* New libusb_strerror API (#14)\n* New libusb_set_auto_detach_kernel_driver API (#17)\n* Improve topology API docs (#95)\n* Logging now use a single write call per log-message, avoiding log-message\n  \"interlacing\" when using multiple threads.\n* Android: use Android logging when building on Android (#101)\n* Darwin: make libusb_reset reenumerate device on descriptors change (#89)\n* Darwin: add support for the LIBUSB_TRANSFER_ADD_ZERO_PACKET flag (#91)\n* Darwin: add a device cache (#112, #114)\n* Examples: Add sam3u_benchmark isochronous example by Harald Welte (#109)\n* Many other bug fixes and improvements\nThe (#xx) numbers are libusbx issue numbers, see ie:\nhttps://github.com/libusbx/libusbx/issues/9\n\n2013-04-15: v1.0.15\n* Improve transfer cancellation and avoid short read failures on broken descriptors\n* Filter out 8-bit characters in libusb_get_string_descriptor_ascii()\n* Add WinCE support\n* Add library stress tests\n* Add Cypress FX3 firmware upload support for fxload sample\n* Add HID and kernel driver detach support capabilities detection\n* Add SuperSpeed detection on OS X\n* Fix bInterval value interpretation on OS X\n* Fix issues with autoclaim, composite HID devices, interface autoclaim and\n  early abort in libusb_close() on Windows. Also add VS2012 solution files.\n* Improve fd event handling on Linux\n* Other bug fixes and improvements\n\n2012-09-26: v1.0.14\n* Reverts the previous API change with regards to bMaxPower.\n  If this doesn't matter to you, you are encouraged to keep using v1.0.13,\n  as it will use the same attribute as v2.0, to be released soon.\n* Note that LIBUSB_API_VERSION is *decreased* to 0x010000FF and the previous\n  guidelines with regards to concurrent use of MaxPower/bMaxPower still apply.\n\n2012-09-20: v1.0.13\n* [MAJOR] Fix a typo in the API with struct libusb_config_descriptor where\n  MaxPower was used instead of bMaxPower, as defined in the specs. If your \n  application was accessing the MaxPower attribute, and you need to maintain\n  compatibility with libusb or older versions, see APPENDIX A below.\n* Fix broken support for the 0.1 -> 1.0 libusb-compat layer\n* Fix unwanted cancellation of pending timeouts as well as major timeout related bugs\n* Fix handling of HID and composite devices on Windows\n* Introduce LIBUSB_API_VERSION macro\n* Add Cypress FX/FX2 firmware upload sample, based on fxload from\n  http://linux-hotplug.sourceforge.net\n* Add libusb0 (libusb-win32) and libusbK driver support on Windows. Note that while\n  the drivers allow it, isochronous transfers are not supported yet in libusb. Also\n  not supported yet is the use of libusb-win32 filter drivers on composite interfaces\n* Add support for the new get_capabilities ioctl on Linux and avoid unnecessary\n  splitting of bulk transfers\n* Improve support for newer Intel and Renesas USB 3.0 controllers on Windows\n* Harmonize the device number for root hubs across platforms\n* Other bug fixes and improvements\n\n2012-06-15: v1.0.12\n* Fix a potential major regression with pthread on Linux\n* Fix missing thread ID from debug log output on cygwin\n* Fix possible crash when using longjmp and MinGW's gcc 4.6\n* Add topology calls: libusb_get_port_number(), libusb_get_parent() & libusb_get_port_path()\n* Add toggleable debug, using libusb_set_debug() or the LIBUSB_DEBUG environment variable\n* Define log levels in libusb.h and set timestamp origin to first libusb_init() call\n* All logging is now sent to to stderr (info was sent to stdout previously)\n* Update log messages severity and avoid polluting log output on OS-X\n* Add HID driver support on Windows\n* Enable interchangeability of MSVC and MinGW DLLs\n* Additional bug fixes and improvements\n\n2012-05-08: v1.0.11\n* Revert removal of critical Windows event handling that was introduced in 1.0.10\n* Fix a possible deadlock in Windows when submitting transfers\n* Add timestamped logging\n* Add NetBSD support (experimental) and BSD libusb_get_device_speed() data\n* Add bootstrap.sh alongside autogen.sh (bootstrap.sh doesn't invoke configure)\n* Search for device nodes in /dev for Android support\n* Other bug fixes\n\n2012-04-17: v1.0.10\n* Public release\n* Add libusb_get_version\n* Add Visual Studio 2010 project files\n* Some Windows code cleanup\n* Fix xusb sample warnings \n\n2012-04-02: v1.0.9\n* First libusbx release\n* Add libusb_get_device_speed (all, except BSD) and libusb_error_name\n* Add Windows support (WinUSB driver only)\n* Add OpenBSD support\n* Add xusb sample\n* Tons of bug fixes\n\n2010-05-07: v1.0.8\n* Bug fixes\n\n2010-04-19: v1.0.7\n* Bug fixes and documentation tweaks\n* Add more interface class definitions\n\n2009-11-22: v1.0.6\n* Bug fixes\n* Increase libusb_handle_events() timeout to 60s for powersaving\n\n2009-11-15: v1.0.5\n * Use timerfd when available for timer management\n * Small fixes/updates\n\n2009-11-06: v1.0.4 release\n * Bug fixes including transfer locking to fix some potential threading races\n * More flexibility with clock types on Linux\n * Use new bulk continuation tracking in Linux 2.6.32 for improved handling\n   of short/failed transfers\n\n2009-08-27: v1.0.3 release\n * Bug fixes\n * Add libusb_get_max_iso_packet_size()\n\n2009-06-13: v1.0.2 release\n * Bug fixes\n\n2009-05-12: v1.0.1 release\n * Bug fixes\n * Darwin backend\n\n2008-12-13: v1.0.0 release\n * Bug fixes\n\n2008-11-21: v0.9.4 release\n * Bug fixes\n * Add libusb_attach_kernel_driver()\n\n2008-08-23: v0.9.3 release\n * Bug fixes\n\n2008-07-19: v0.9.2 release\n * Bug fixes\n\n2008-06-28: v0.9.1 release\n * Bug fixes\n * Introduce contexts to the API\n * Compatibility with new Linux kernel features\n\n2008-05-25: v0.9.0 release\n * First libusb-1.0 beta release\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAPPENDIX A - How to maintain code compatibility with versions of libusb and\nlibusb that use MaxPower:\n\nIf you must to maintain compatibility with versions of the library that aren't\nusing the bMaxPower attribute in struct libusb_config_descriptor, the \nrecommended way is to use the new LIBUSB_API_VERSION macro with an #ifdef.\nFor instance, if your code was written as follows:\n\n  if (dev->config[0].MaxPower < 250)\n\nThen you should modify it to have:\n\n#if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01000100)\n  if (dev->config[0].bMaxPower < 250)\n#else\n  if (dev->config[0].MaxPower < 250)\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/INSTALL",
    "content": "Installation Instructions\n*************************\n\nCopyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,\n2006 Free Software Foundation, Inc.\n\nThis file is free documentation; the Free Software Foundation gives\nunlimited permission to copy, distribute and modify it.\n\nBasic Installation\n==================\n\nBriefly, the shell commands `./configure; make; make install' should\nconfigure, build, and install this package.  The following\nmore-detailed instructions are generic; see the `README' file for\ninstructions specific to this package.\n\n   The `configure' shell script attempts to guess correct values for\nvarious system-dependent variables used during compilation.  It uses\nthose values to create a `Makefile' in each directory of the package.\nIt may also create one or more `.h' files containing system-dependent\ndefinitions.  Finally, it creates a shell script `config.status' that\nyou can run in the future to recreate the current configuration, and a\nfile `config.log' containing compiler output (useful mainly for\ndebugging `configure').\n\n   It can also use an optional file (typically called `config.cache'\nand enabled with `--cache-file=config.cache' or simply `-C') that saves\nthe results of its tests to speed up reconfiguring.  Caching is\ndisabled by default to prevent problems with accidental use of stale\ncache files.\n\n   If you need to do unusual things to compile the package, please try\nto figure out how `configure' could check whether to do them, and mail\ndiffs or instructions to the address given in the `README' so they can\nbe considered for the next release.  If you are using the cache, and at\nsome point `config.cache' contains results you don't want to keep, you\nmay remove or edit it.\n\n   The file `configure.ac' (or `configure.in') is used to create\n`configure' by a program called `autoconf'.  You need `configure.ac' if\nyou want to change it or regenerate `configure' using a newer version\nof `autoconf'.\n\nThe simplest way to compile this package is:\n\n  1. `cd' to the directory containing the package's source code and type\n     `./configure' to configure the package for your system.\n\n     Running `configure' might take a while.  While running, it prints\n     some messages telling which features it is checking for.\n\n  2. Type `make' to compile the package.\n\n  3. Optionally, type `make check' to run any self-tests that come with\n     the package.\n\n  4. Type `make install' to install the programs and any data files and\n     documentation.\n\n  5. You can remove the program binaries and object files from the\n     source code directory by typing `make clean'.  To also remove the\n     files that `configure' created (so you can compile the package for\n     a different kind of computer), type `make distclean'.  There is\n     also a `make maintainer-clean' target, but that is intended mainly\n     for the package's developers.  If you use it, you may have to get\n     all sorts of other programs in order to regenerate files that came\n     with the distribution.\n\nCompilers and Options\n=====================\n\nSome systems require unusual options for compilation or linking that the\n`configure' script does not know about.  Run `./configure --help' for\ndetails on some of the pertinent environment variables.\n\n   You can give `configure' initial values for configuration parameters\nby setting variables in the command line or in the environment.  Here\nis an example:\n\n     ./configure CC=c99 CFLAGS=-g LIBS=-lposix\n\n   *Note Defining Variables::, for more details.\n\nCompiling For Multiple Architectures\n====================================\n\nYou can compile the package for more than one kind of computer at the\nsame time, by placing the object files for each architecture in their\nown directory.  To do this, you can use GNU `make'.  `cd' to the\ndirectory where you want the object files and executables to go and run\nthe `configure' script.  `configure' automatically checks for the\nsource code in the directory that `configure' is in and in `..'.\n\n   With a non-GNU `make', it is safer to compile the package for one\narchitecture at a time in the source code directory.  After you have\ninstalled the package for one architecture, use `make distclean' before\nreconfiguring for another architecture.\n\nInstallation Names\n==================\n\nBy default, `make install' installs the package's commands under\n`/usr/local/bin', include files under `/usr/local/include', etc.  You\ncan specify an installation prefix other than `/usr/local' by giving\n`configure' the option `--prefix=PREFIX'.\n\n   You can specify separate installation prefixes for\narchitecture-specific files and architecture-independent files.  If you\npass the option `--exec-prefix=PREFIX' to `configure', the package uses\nPREFIX as the prefix for installing programs and libraries.\nDocumentation and other data files still use the regular prefix.\n\n   In addition, if you use an unusual directory layout you can give\noptions like `--bindir=DIR' to specify different values for particular\nkinds of files.  Run `configure --help' for a list of the directories\nyou can set and what kinds of files go in them.\n\n   If the package supports it, you can cause programs to be installed\nwith an extra prefix or suffix on their names by giving `configure' the\noption `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.\n\nOptional Features\n=================\n\nSome packages pay attention to `--enable-FEATURE' options to\n`configure', where FEATURE indicates an optional part of the package.\nThey may also pay attention to `--with-PACKAGE' options, where PACKAGE\nis something like `gnu-as' or `x' (for the X Window System).  The\n`README' should mention any `--enable-' and `--with-' options that the\npackage recognizes.\n\n   For packages that use the X Window System, `configure' can usually\nfind the X include and library files automatically, but if it doesn't,\nyou can use the `configure' options `--x-includes=DIR' and\n`--x-libraries=DIR' to specify their locations.\n\nSpecifying the System Type\n==========================\n\nThere may be some features `configure' cannot figure out automatically,\nbut needs to determine by the type of machine the package will run on.\nUsually, assuming the package is built to be run on the _same_\narchitectures, `configure' can figure that out, but if it prints a\nmessage saying it cannot guess the machine type, give it the\n`--build=TYPE' option.  TYPE can either be a short name for the system\ntype, such as `sun4', or a canonical name which has the form:\n\n     CPU-COMPANY-SYSTEM\n\nwhere SYSTEM can have one of these forms:\n\n     OS KERNEL-OS\n\n   See the file `config.sub' for the possible values of each field.  If\n`config.sub' isn't included in this package, then this package doesn't\nneed to know the machine type.\n\n   If you are _building_ compiler tools for cross-compiling, you should\nuse the option `--target=TYPE' to select the type of system they will\nproduce code for.\n\n   If you want to _use_ a cross compiler, that generates code for a\nplatform different from the build platform, you should specify the\n\"host\" platform (i.e., that on which the generated programs will\neventually be run) with `--host=TYPE'.\n\nSharing Defaults\n================\n\nIf you want to set default values for `configure' scripts to share, you\ncan create a site shell script called `config.site' that gives default\nvalues for variables like `CC', `cache_file', and `prefix'.\n`configure' looks for `PREFIX/share/config.site' if it exists, then\n`PREFIX/etc/config.site' if it exists.  Or, you can set the\n`CONFIG_SITE' environment variable to the location of the site script.\nA warning: not all `configure' scripts look for a site script.\n\nDefining Variables\n==================\n\nVariables not defined in a site shell script can be set in the\nenvironment passed to `configure'.  However, some packages may run\nconfigure again during the build, and the customized values of these\nvariables may be lost.  In order to avoid this problem, you should set\nthem in the `configure' command line, using `VAR=value'.  For example:\n\n     ./configure CC=/usr/local2/bin/gcc\n\ncauses the specified `gcc' to be used as the C compiler (unless it is\noverridden in the site shell script).\n\nUnfortunately, this technique does not work for `CONFIG_SHELL' due to\nan Autoconf bug.  Until the bug is fixed you can use this workaround:\n\n     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash\n\n`configure' Invocation\n======================\n\n`configure' recognizes the following options to control how it operates.\n\n`--help'\n`-h'\n     Print a summary of the options to `configure', and exit.\n\n`--version'\n`-V'\n     Print the version of Autoconf used to generate the `configure'\n     script, and exit.\n\n`--cache-file=FILE'\n     Enable the cache: use and save the results of the tests in FILE,\n     traditionally `config.cache'.  FILE defaults to `/dev/null' to\n     disable caching.\n\n`--config-cache'\n`-C'\n     Alias for `--cache-file=config.cache'.\n\n`--quiet'\n`--silent'\n`-q'\n     Do not print messages saying which checks are being made.  To\n     suppress all normal output, redirect it to `/dev/null' (any error\n     messages will still be shown).\n\n`--srcdir=DIR'\n     Look for the package's source code in directory DIR.  Usually\n     `configure' can determine that directory automatically.\n\n`configure' also accepts some other, not widely useful, options.  Run\n`configure --help' for more details.\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/INSTALL_WIN.txt",
    "content": "Installation Instructions for Windows\n*************************************\n\nIf you are compiling for MinGW or cygwin, please refer to the INSTALL file.\n\nIf you are using Microsoft Visual Studio:\n- Open the relevant solution file in /msvc:\n  libusb.dsw for MSVC6, libusb_2005.sln for Visual Studio 2005 or 2008,\n  libusb_2010.sln for Visual Studio 2010,\n  libusb_2012.sln for Visual Studio 2012 or later,\n  libusb_wince.sln for Windows CE support in Visual Studio 2005.\n- If you want to debug the library, uncomment the ENABLE_DEBUG_LOGGING define\n  in msvc\\config.h\n- Select your configuration and compile the project\n\nNote that if you are using Visual Studio Express, you may have to install the\nWindows SDK to be able to compile the 64 bit version of the library.\n\nIf you are using the freely available Windows DDK/WDK (Driver Development Kit)\n- If you want to debug the library, uncomment the ENABLE_DEBUG_LOGGING define\n  in msvc\\config.h\n- Open one of the relevant Free Build or Checked Build prompt for your target\n  platform\n- Navigate to the msvc\\ directory where the ddk_build.cmd file is located, and\n  run 'ddk_build'\n- To produce a DLL rather than a static library, use: 'ddk_build DLL'\n- To produce a static library that uses LIBCMT[d] instead of MSVCRT[d] (/MT[d]\n  vs /MD[d] in Visual Studio) use: 'ddk_build /MT'\n\nNote that using the Windows DDK, it is possible to compile both the 32 and 64\nbit versions of the library.\n\nIf you are building for Windows CE then you will need the Windows CE Standard 5.00 SDK.\n\nDestination directories\n***********************\n\nThe 32 bit binaries compiled either from Visual Studio or the DDK are placed in\na Win32\\ directory at the root of the library\nThe 64 bit binaries are placed in an x64\\ directory\nWindows CE binaries are placed in one of the following directories, depending\non the target processor: ARMV4I, MIPSII, MIPSII_FP, MIPSIV, MIPSIV_FP, SH4 or x86.\n\n\nTroubleshooting\n***************\n\nIf the compilation process complains about missing libraries, ensure that the\ndefault library paths for your project points to the relevant directories.\nIf needed, these libraries can be obtained by installing either the latest\nWindows SDK or the DDK (Links provided at the end of this file).\n\nFor Windows CE it is necessary to install the CE USB Kernel Wrapper driver for\nlibusb to function on a device.\n\nLinks\n*****\n\nAdditional information related to the Windows backend:\n  http://windows.libusb.info\n\nLatest Windows Driver (Development) Kit (WDK):\n  http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=36a2630f-5d56-43b5-b996-7633f2ec14ff\n\nLatest Microsoft Windows SDK:\n  http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505\n\nWindows CE Standard 5.00 SDK:\n  http://www.microsoft.com/en-gb/download/details.aspx?id=17310\n\nWindows CE USB Kernel Wrapper Driver:\n  https://github.com/RealVNC/CEUSBKWrapper\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/Makefile.am",
    "content": "AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip\nACLOCAL_AMFLAGS = -I m4\nDISTCLEANFILES = libusb-1.0.pc\nEXTRA_DIST = TODO PORTING msvc libusb/libusb-1.0.def libusb/version_nano.h \\\n  examples/getopt/getopt.c examples/getopt/getopt1.c examples/getopt/getopt.h \\\n  android Xcode\nSUBDIRS = libusb doc\n\nif BUILD_EXAMPLES\nSUBDIRS += examples\nendif\n\nif BUILD_TESTS\nSUBDIRS += tests\nendif\n\npkgconfigdir=$(libdir)/pkgconfig\npkgconfig_DATA=libusb-1.0.pc\n\n.PHONY: dist-up\n\nreldir = .release/$(distdir)\ndist-up: dist\n\trm -rf $(reldir)\n\tmkdir -p $(reldir)\n\tcp $(distdir).tar.bz2 $(reldir)\n\trsync -rv $(reldir) frs.sourceforge.net:/home/frs/project/l/li/libusb/libusb-1.0/\n\trm -rf $(reldir)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/NEWS",
    "content": "For the latest libusb news, please refer to the ChangeLog file, or visit:\nhttp://libusb.info\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/PORTING",
    "content": "PORTING LIBUSB TO OTHER PLATFORMS\n\nIntroduction\n============\n\nThis document is aimed at developers wishing to port libusb to unsupported\nplatforms. I believe the libusb API is OS-independent, so by supporting\nmultiple operating systems we pave the way for cross-platform USB device\ndrivers.\n\nImplementation-wise, the basic idea is that you provide an interface to\nlibusb's internal \"backend\" API, which performs the appropriate operations on\nyour target platform.\n\nIn terms of USB I/O, your backend provides functionality to submit\nasynchronous transfers (synchronous transfers are implemented in the higher\nlayers, based on the async interface). Your backend must also provide\nfunctionality to cancel those transfers.\n\nYour backend must also provide an event handling function to \"reap\" ongoing\ntransfers and process their results.\n\nThe backend must also provide standard functions for other USB operations,\ne.g. setting configuration, obtaining descriptors, etc.\n\n\nFile descriptors for I/O polling\n================================\n\nFor libusb to work, your event handling function obviously needs to be called\nat various points in time. Your backend must provide a set of file descriptors\nwhich libusb and its users can pass to poll() or select() to determine when\nit is time to call the event handling function.\n\nOn Linux, this is easy: the usbfs kernel interface exposes a file descriptor\nwhich can be passed to poll(). If something similar is not true for your\nplatform, you can emulate this using an internal library thread to reap I/O as\nnecessary, and a pipe() with the main library to raise events. The file\ndescriptor of the pipe can then be provided to libusb as an event source.\n\n\nInterface semantics and documentation\n=====================================\n\nDocumentation of the backend interface can be found in libusbi.h inside the\nusbi_os_backend structure definition.\n\nYour implementations of these functions will need to call various internal\nlibusb functions, prefixed with \"usbi_\". Documentation for these functions\ncan be found in the .c files where they are implemented.\n\nYou probably want to skim over *all* the documentation before starting your\nimplementation. For example, you probably need to allocate and store private\nOS-specific data for device handles, but the documentation for the mechanism\nfor doing so is probably not the first thing you will see.\n\nThe Linux backend acts as a good example - view it as a reference\nimplementation which you should try to match the behaviour of.\n\n\nGetting started\n===============\n\n1. Modify configure.ac to detect your platform appropriately (see the OS_LINUX\nstuff for an example).\n\n2. Implement your backend in the libusb/os/ directory, modifying\nlibusb/os/Makefile.am appropriately.\n\n3. Add preprocessor logic to the top of libusb/core.c to statically assign the\nright usbi_backend for your platform.\n\n4. Produce and test your implementation.\n\n5. Send your implementation to libusb-devel mailing list.\n\n\nImplementation difficulties? Questions?\n=======================================\n\nIf you encounter difficulties porting libusb to your platform, please raise\nthese issues on the libusb-devel mailing list. Where possible and sensible, I\nam interested in solving problems preventing libusb from operating on other\nplatforms.\n\nThe libusb-devel mailing list is also a good place to ask questions and\nmake suggestions about the internal API. Hopefully we can produce some\nbetter documentation based on your questions and other input.\n\nYou are encouraged to get involved in the process; if the library needs\nsome infrastructure additions/modifications to better support your platform,\nyou are encouraged to make such changes (in cleanly distinct patch\nsubmissions). Even if you do not make such changes yourself, please do raise\nthe issues on the mailing list at the very minimum.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/README",
    "content": "libusb\n======\n\nlibusb is a library for USB device access from Linux, Mac OS X,\nWindows and OpenBSD/NetBSD userspace.\nIt is written in C and licensed under the GNU Lesser General Public\nLicense version 2.1 or, at your option, any later version (see COPYING).\n\nlibusb is abstracted internally in such a way that it can hopefully\nbe ported to other operating systems. Please see the PORTING file\nfor more information.\n\nlibusb homepage:\nhttp://libusb.info/\n\nDevelopers will wish to consult the API documentation:\nhttp://api.libusb.info\n\nUse the mailing list for questions, comments, etc:\nhttp://mailing-list.libusb.info\n\n- Pete Batard <pete@akeo.ie>\n- Hans de Goede <hdegoede@redhat.com>\n- Xiaofan Chen <xiaofanc@gmail.com>\n- Ludovic Rousseau <ludovic.rousseau@gmail.com>\n- Nathan Hjelm <hjelmn@users.sourceforge.net>\n(Please use the mailing list rather than mailing developers directly)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/README.git",
    "content": "Notes related to git compilation:\n--------------------------------\n\nIf you retrieved the libusb repository from git and are using a gcc based\ntoolchain, be mindful that you should have the autotools installed (autoconf,\nautomake) and will need to run either ./autogen.sh or ./bootstrap.sh to produce\nthe configure file.\n\nThe difference between autogen.sh and bootstrap.sh is that the former invokes\nconfigure with a default set of options, and will therefore generate a Makefile,\nwhereas the latter does not invoke configure at all. If using autogen.sh, note\nthat you can also append options, that will be passed as is to configure.\n\nOS X-specific notes:\n-------------------\n\nStarting with Xcode 4.3, neither Xcode.app nor the Xcode 'command line tools'\nincludes autotools and so running either autogen.sh or bootstrap.sh will result\nin the message:\n\nlibtoolize or glibtoolize was not found! Please install libtool.\n\nTo proceed, you must find and install it from somewhere.\n\nAlternatively, you can use the Xcode project at Xcode/libusb.xcodeproj.\n\nNotes related to submitting new developments:\n--------------------------------------------\n\nIf you submit a new development to libusb (eg: new backend), that is unlikely\nto fit in a couple of small patches, we would kindly suggest that you create a\npublic account on github, if you don't have one already, and then fork a new\nlibusb repository under this account from https://github.com/libusb/libusb.\n\nThen you can create a git branch for your work, that we will be able to better\nreference and test. \n\nWe also suggest that, if you are planning to bring in a large development, you\ntry to involve the libusb community early by letting the mailing list know, as\nyou may find that other people might be eager to help you out. \nSee http://mailing-list.libusb.info for details on how to join the mailing list."
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/TODO",
    "content": "Please see the libusb roadmap by visiting:\nhttps://github.com/libusb/libusb/issues/milestones?direction=asc&sort=due_date\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/Xcode/common.xcconfig",
    "content": "//\n// libusb Xcode configuration file\n// Copyright © 2012 Pete Batard <pete@akeo.ie>\n// For more information, please visit: <http://libusb.info>\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 2.1 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n// libusb does not follow C99 strict aliasing rules, so disable it.\nGCC_STRICT_ALIASING = NO\n\n// Use C99 dialect.\nGCC_C_LANGUAGE_STANDARD = c99\n\n// Compiler warnings.\nGCC_WARN_64_TO_32_BIT_CONVERSION = YES\nGCC_WARN_ABOUT_RETURN_TYPE = YES\nGCC_WARN_UNINITIALIZED_AUTOS = YES\nGCC_WARN_FOUR_CHARACTER_CONSTANTS = YES\nGCC_WARN_SHADOW = YES\nGCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES\nGCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES\nGCC_WARN_ABOUT_MISSING_PROTOTYPES = YES\nGCC_WARN_ABOUT_MISSING_NEWLINE = YES\nGCC_WARN_UNKNOWN_PRAGMAS = YES\nGCC_WARN_UNUSED_FUNCTION = YES\nGCC_WARN_UNUSED_LABEL = YES\nGCC_WARN_UNUSED_VARIABLE = YES\nCLANG_WARN_EMPTY_BODY = YES\nCLANG_WARN_CONSTANT_CONVERSION = YES\nCLANG_WARN_ENUM_CONVERSION = YES\nCLANG_WARN_INT_CONVERSION = YES\nCLANG_WARN_DOCUMENTATION_COMMENTS = YES\nCLANG_WARN_BOOL_CONVERSION = YES\n\n// Static analyzer warnings.\nCLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES\nCLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/Xcode/config.h",
    "content": "/* config.h.  Manually generated for Xcode.  */\n\n/* Default visibility */\n#define DEFAULT_VISIBILITY /**/\n\n/* Message logging */\n#define ENABLE_LOGGING 1\n\n/* Define to 1 if you have the `gettimeofday' function. */\n#define HAVE_GETTIMEOFDAY 1\n\n/* Define to 1 if you have the <poll.h> header file. */\n#define HAVE_POLL_H 1\n\n/* Define to 1 if you have the <sys/time.h> header file. */\n#define HAVE_SYS_TIME_H 1\n\n/* Darwin backend */\n#define OS_DARWIN 1\n\n/* type of second poll() argument */\n#define POLL_NFDS_TYPE nfds_t\n\n/* Use POSIX Threads */\n#define THREADS_POSIX 1\n\n/* Use GNU extensions */\n#define _GNU_SOURCE 1\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/Xcode/debug.xcconfig",
    "content": "//\n// libusb Xcode configuration file\n// Copyright © 2012 Pete Batard <pete@akeo.ie>\n// For more information, please visit: <http://libusb.info>\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 2.1 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n#include \"common.xcconfig\"\n\n// Embed debug symbols in binary itself.\nDEBUG_INFORMATION_FORMAT = dwarf\n\n// No optimizations in debug.\nGCC_OPTIMIZATION_LEVEL = 0\n\n// \nGCC_PREPROCESSOR_DEFINITIONS = $(inherited) DEBUG=1\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/Xcode/libusb.xcconfig",
    "content": "//\n// libusb Xcode configuration file\n// Copyright © 2012 Pete Batard <pete@akeo.ie>\n// For more information, please visit: <http://libusb.info>\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 2.1 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\nPRODUCT_NAME = libusb-1.0.0\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/Xcode/libusb.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\r{\r\tarchiveVersion = 1;\r\tclasses = {\r\t};\r\tobjectVersion = 45;\r\tobjects = {\r\r/* Begin PBXAggregateTarget section */\r\t\t008FC0321628BC9400BC5BE2 /* all */ = {\r\t\t\tisa = PBXAggregateTarget;\r\t\t\tbuildConfigurationList = 008FC0331628BC9400BC5BE2 /* Build configuration list for PBXAggregateTarget \"all\" */;\r\t\t\tbuildPhases = (\r\t\t\t);\r\t\t\tdependencies = (\r\t\t\t\t008FC0371628BC9A00BC5BE2 /* PBXTargetDependency */,\r\t\t\t\t008FC0391628BC9A00BC5BE2 /* PBXTargetDependency */,\r\t\t\t\t008FC03B1628BC9A00BC5BE2 /* PBXTargetDependency */,\r\t\t\t\t008FC03D1628BC9A00BC5BE2 /* PBXTargetDependency */,\r\t\t\t\t008FC03F1628BC9A00BC5BE2 /* PBXTargetDependency */,\r\t\t\t\t008FC0411628BC9A00BC5BE2 /* PBXTargetDependency */,\r\t\t\t);\r\t\t\tname = all;\r\t\t\tproductName = all;\r\t\t};\r/* End PBXAggregateTarget section */\r\r/* Begin PBXBuildFile section */\r\t\t008FBF861628B7E800BC5BE2 /* core.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBF541628B7E800BC5BE2 /* core.c */; };\r\t\t008FBF871628B7E800BC5BE2 /* descriptor.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBF551628B7E800BC5BE2 /* descriptor.c */; };\r\t\t008FBF881628B7E800BC5BE2 /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBF561628B7E800BC5BE2 /* io.c */; };\r\t\t008FBF891628B7E800BC5BE2 /* libusb.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBF5A1628B7E800BC5BE2 /* libusb.h */; };\r\t\t008FBF901628B7E800BC5BE2 /* libusbi.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBF671628B7E800BC5BE2 /* libusbi.h */; };\r\t\t008FBF921628B7E800BC5BE2 /* darwin_usb.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBF6C1628B7E800BC5BE2 /* darwin_usb.c */; };\r\t\t008FBF931628B7E800BC5BE2 /* darwin_usb.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBF6D1628B7E800BC5BE2 /* darwin_usb.h */; };\r\t\t008FBF971628B7E800BC5BE2 /* poll_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBF711628B7E800BC5BE2 /* poll_posix.h */; };\r\t\t008FBF9A1628B7E800BC5BE2 /* threads_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBF741628B7E800BC5BE2 /* threads_posix.c */; };\r\t\t008FBF9B1628B7E800BC5BE2 /* threads_posix.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBF751628B7E800BC5BE2 /* threads_posix.h */; };\r\t\t008FBFA01628B7E800BC5BE2 /* sync.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBF7A1628B7E800BC5BE2 /* sync.c */; };\r\t\t008FBFA11628B7E800BC5BE2 /* version.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBF7B1628B7E800BC5BE2 /* version.h */; };\r\t\t008FBFA21628B7E800BC5BE2 /* version_nano.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBF7C1628B7E800BC5BE2 /* version_nano.h */; };\r\t\t008FBFA51628B84200BC5BE2 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 008FBFA41628B84200BC5BE2 /* config.h */; };\r\t\t008FBFA71628B87000BC5BE2 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBFA61628B87000BC5BE2 /* CoreFoundation.framework */; };\r\t\t008FBFA91628B88000BC5BE2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBFA81628B88000BC5BE2 /* IOKit.framework */; };\r\t\t008FBFAB1628B8CB00BC5BE2 /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBFAA1628B8CB00BC5BE2 /* libobjc.dylib */; };\r\t\t008FBFEF1628BA3500BC5BE2 /* xusb.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBFED1628BA0E00BC5BE2 /* xusb.c */; };\r\t\t008FBFF01628BA3A00BC5BE2 /* libusb-1.0.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */; };\r\t\t008FBFFF1628BB9600BC5BE2 /* dpfp.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBFD71628BA0E00BC5BE2 /* dpfp.c */; };\r\t\t008FC0001628BBCD00BC5BE2 /* libusb-1.0.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */; };\r\t\t008FC00F1628BBE400BC5BE2 /* dpfp_threaded.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBFDB1628BA0E00BC5BE2 /* dpfp_threaded.c */; };\r\t\t008FC0101628BBE900BC5BE2 /* libusb-1.0.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */; };\r\t\t008FC01F1628BC1500BC5BE2 /* fxload.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBFE11628BA0E00BC5BE2 /* fxload.c */; };\r\t\t008FC0201628BC1B00BC5BE2 /* libusb-1.0.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */; };\r\t\t008FC0211628BC5200BC5BE2 /* ezusb.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBFDC1628BA0E00BC5BE2 /* ezusb.c */; };\r\t\t008FC0301628BC7400BC5BE2 /* listdevs.c in Sources */ = {isa = PBXBuildFile; fileRef = 008FBFE71628BA0E00BC5BE2 /* listdevs.c */; };\r\t\t008FC0311628BC7800BC5BE2 /* libusb-1.0.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */; };\r\t\t1438D77A17A2ED9F00166101 /* hotplug.c in Sources */ = {isa = PBXBuildFile; fileRef = 1438D77817A2ED9F00166101 /* hotplug.c */; };\r\t\t1438D77B17A2ED9F00166101 /* hotplug.h in Headers */ = {isa = PBXBuildFile; fileRef = 1438D77917A2ED9F00166101 /* hotplug.h */; };\r\t\t1438D77D17A2EDCD00166101 /* poll_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 1438D77C17A2EDCD00166101 /* poll_posix.c */; };\r\t\t1438D77F17A2F0EA00166101 /* strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 1438D77E17A2F0EA00166101 /* strerror.c */; };\r/* End PBXBuildFile section */\r\r/* Begin PBXContainerItemProxy section */\r\t\t008FC0361628BC9A00BC5BE2 /* PBXContainerItemProxy */ = {\r\t\t\tisa = PBXContainerItemProxy;\r\t\t\tcontainerPortal = 008FBF281628B79300BC5BE2 /* Project object */;\r\t\t\tproxyType = 1;\r\t\t\tremoteGlobalIDString = 008FBF301628B79300BC5BE2;\r\t\t\tremoteInfo = libusb;\r\t\t};\r\t\t008FC0381628BC9A00BC5BE2 /* PBXContainerItemProxy */ = {\r\t\t\tisa = PBXContainerItemProxy;\r\t\t\tcontainerPortal = 008FBF281628B79300BC5BE2 /* Project object */;\r\t\t\tproxyType = 1;\r\t\t\tremoteGlobalIDString = 008FBFBC1628B9FE00BC5BE2;\r\t\t\tremoteInfo = xusb;\r\t\t};\r\t\t008FC03A1628BC9A00BC5BE2 /* PBXContainerItemProxy */ = {\r\t\t\tisa = PBXContainerItemProxy;\r\t\t\tcontainerPortal = 008FBF281628B79300BC5BE2 /* Project object */;\r\t\t\tproxyType = 1;\r\t\t\tremoteGlobalIDString = 008FBFF41628BB8B00BC5BE2;\r\t\t\tremoteInfo = dpfp;\r\t\t};\r\t\t008FC03C1628BC9A00BC5BE2 /* PBXContainerItemProxy */ = {\r\t\t\tisa = PBXContainerItemProxy;\r\t\t\tcontainerPortal = 008FBF281628B79300BC5BE2 /* Project object */;\r\t\t\tproxyType = 1;\r\t\t\tremoteGlobalIDString = 008FC0041628BBDB00BC5BE2;\r\t\t\tremoteInfo = dpfp_threaded;\r\t\t};\r\t\t008FC03E1628BC9A00BC5BE2 /* PBXContainerItemProxy */ = {\r\t\t\tisa = PBXContainerItemProxy;\r\t\t\tcontainerPortal = 008FBF281628B79300BC5BE2 /* Project object */;\r\t\t\tproxyType = 1;\r\t\t\tremoteGlobalIDString = 008FC0141628BC0300BC5BE2;\r\t\t\tremoteInfo = fxload;\r\t\t};\r\t\t008FC0401628BC9A00BC5BE2 /* PBXContainerItemProxy */ = {\r\t\t\tisa = PBXContainerItemProxy;\r\t\t\tcontainerPortal = 008FBF281628B79300BC5BE2 /* Project object */;\r\t\t\tproxyType = 1;\r\t\t\tremoteGlobalIDString = 008FC0251628BC6B00BC5BE2;\r\t\t\tremoteInfo = listdevs;\r\t\t};\r\t\t1443EE8B1641926D007E0579 /* PBXContainerItemProxy */ = {\r\t\t\tisa = PBXContainerItemProxy;\r\t\t\tcontainerPortal = 008FBF281628B79300BC5BE2 /* Project object */;\r\t\t\tproxyType = 1;\r\t\t\tremoteGlobalIDString = 008FBF301628B79300BC5BE2;\r\t\t\tremoteInfo = libusb;\r\t\t};\r\t\t1443EE8D16419273007E0579 /* PBXContainerItemProxy */ = {\r\t\t\tisa = PBXContainerItemProxy;\r\t\t\tcontainerPortal = 008FBF281628B79300BC5BE2 /* Project object */;\r\t\t\tproxyType = 1;\r\t\t\tremoteGlobalIDString = 008FBF301628B79300BC5BE2;\r\t\t\tremoteInfo = libusb;\r\t\t};\r\t\t1443EE8F16419276007E0579 /* PBXContainerItemProxy */ = {\r\t\t\tisa = PBXContainerItemProxy;\r\t\t\tcontainerPortal = 008FBF281628B79300BC5BE2 /* Project object */;\r\t\t\tproxyType = 1;\r\t\t\tremoteGlobalIDString = 008FBF301628B79300BC5BE2;\r\t\t\tremoteInfo = libusb;\r\t\t};\r\t\t1443EE911641927A007E0579 /* PBXContainerItemProxy */ = {\r\t\t\tisa = PBXContainerItemProxy;\r\t\t\tcontainerPortal = 008FBF281628B79300BC5BE2 /* Project object */;\r\t\t\tproxyType = 1;\r\t\t\tremoteGlobalIDString = 008FBF301628B79300BC5BE2;\r\t\t\tremoteInfo = libusb;\r\t\t};\r\t\t1443EE931641927D007E0579 /* PBXContainerItemProxy */ = {\r\t\t\tisa = PBXContainerItemProxy;\r\t\t\tcontainerPortal = 008FBF281628B79300BC5BE2 /* Project object */;\r\t\t\tproxyType = 1;\r\t\t\tremoteGlobalIDString = 008FBF301628B79300BC5BE2;\r\t\t\tremoteInfo = libusb;\r\t\t};\r/* End PBXContainerItemProxy section */\r\r/* Begin PBXCopyFilesBuildPhase section */\r\t\t008FBFBB1628B9FE00BC5BE2 /* CopyFiles */ = {\r\t\t\tisa = PBXCopyFilesBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tdstPath = /usr/share/man/man1/;\r\t\t\tdstSubfolderSpec = 0;\r\t\t\tfiles = (\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 1;\r\t\t};\r\t\t008FBFF31628BB8B00BC5BE2 /* CopyFiles */ = {\r\t\t\tisa = PBXCopyFilesBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tdstPath = /usr/share/man/man1/;\r\t\t\tdstSubfolderSpec = 0;\r\t\t\tfiles = (\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 1;\r\t\t};\r\t\t008FC0031628BBDB00BC5BE2 /* CopyFiles */ = {\r\t\t\tisa = PBXCopyFilesBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tdstPath = /usr/share/man/man1/;\r\t\t\tdstSubfolderSpec = 0;\r\t\t\tfiles = (\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 1;\r\t\t};\r\t\t008FC0131628BC0300BC5BE2 /* CopyFiles */ = {\r\t\t\tisa = PBXCopyFilesBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tdstPath = /usr/share/man/man1/;\r\t\t\tdstSubfolderSpec = 0;\r\t\t\tfiles = (\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 1;\r\t\t};\r\t\t008FC0241628BC6B00BC5BE2 /* CopyFiles */ = {\r\t\t\tisa = PBXCopyFilesBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tdstPath = /usr/share/man/man1/;\r\t\t\tdstSubfolderSpec = 0;\r\t\t\tfiles = (\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 1;\r\t\t};\r/* End PBXCopyFilesBuildPhase section */\r\r/* Begin PBXFileReference section */\r\t\t008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */ = {isa = PBXFileReference; explicitFileType = \"compiled.mach-o.dylib\"; includeInIndex = 0; path = \"libusb-1.0.0.dylib\"; sourceTree = BUILT_PRODUCTS_DIR; };\r\t\t008FBF541628B7E800BC5BE2 /* core.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = core.c; sourceTree = \"<group>\"; };\r\t\t008FBF551628B7E800BC5BE2 /* descriptor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = descriptor.c; sourceTree = \"<group>\"; };\r\t\t008FBF561628B7E800BC5BE2 /* io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = io.c; sourceTree = \"<group>\"; };\r\t\t008FBF5A1628B7E800BC5BE2 /* libusb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libusb.h; sourceTree = \"<group>\"; };\r\t\t008FBF671628B7E800BC5BE2 /* libusbi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libusbi.h; sourceTree = \"<group>\"; };\r\t\t008FBF6C1628B7E800BC5BE2 /* darwin_usb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = darwin_usb.c; sourceTree = \"<group>\"; };\r\t\t008FBF6D1628B7E800BC5BE2 /* darwin_usb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = darwin_usb.h; sourceTree = \"<group>\"; };\r\t\t008FBF711628B7E800BC5BE2 /* poll_posix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = poll_posix.h; sourceTree = \"<group>\"; };\r\t\t008FBF741628B7E800BC5BE2 /* threads_posix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = threads_posix.c; sourceTree = \"<group>\"; };\r\t\t008FBF751628B7E800BC5BE2 /* threads_posix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = threads_posix.h; sourceTree = \"<group>\"; };\r\t\t008FBF7A1628B7E800BC5BE2 /* sync.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sync.c; sourceTree = \"<group>\"; };\r\t\t008FBF7B1628B7E800BC5BE2 /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = \"<group>\"; };\r\t\t008FBF7C1628B7E800BC5BE2 /* version_nano.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = version_nano.h; sourceTree = \"<group>\"; };\r\t\t008FBFA41628B84200BC5BE2 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = \"<group>\"; };\r\t\t008FBFA61628B87000BC5BE2 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };\r\t\t008FBFA81628B88000BC5BE2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };\r\t\t008FBFAA1628B8CB00BC5BE2 /* libobjc.dylib */ = {isa = PBXFileReference; lastKnownFileType = \"compiled.mach-o.dylib\"; name = libobjc.dylib; path = usr/lib/libobjc.dylib; sourceTree = SDKROOT; };\r\t\t008FBFBD1628B9FE00BC5BE2 /* xusb */ = {isa = PBXFileReference; explicitFileType = \"compiled.mach-o.executable\"; includeInIndex = 0; path = xusb; sourceTree = BUILT_PRODUCTS_DIR; };\r\t\t008FBFD71628BA0E00BC5BE2 /* dpfp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = dpfp.c; sourceTree = \"<group>\"; };\r\t\t008FBFDB1628BA0E00BC5BE2 /* dpfp_threaded.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = dpfp_threaded.c; sourceTree = \"<group>\"; };\r\t\t008FBFDC1628BA0E00BC5BE2 /* ezusb.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ezusb.c; sourceTree = \"<group>\"; };\r\t\t008FBFDD1628BA0E00BC5BE2 /* ezusb.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ezusb.h; sourceTree = \"<group>\"; };\r\t\t008FBFE11628BA0E00BC5BE2 /* fxload.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fxload.c; sourceTree = \"<group>\"; };\r\t\t008FBFE71628BA0E00BC5BE2 /* listdevs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = listdevs.c; sourceTree = \"<group>\"; };\r\t\t008FBFED1628BA0E00BC5BE2 /* xusb.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = xusb.c; sourceTree = \"<group>\"; };\r\t\t008FBFF51628BB8B00BC5BE2 /* dpfp */ = {isa = PBXFileReference; explicitFileType = \"compiled.mach-o.executable\"; includeInIndex = 0; path = dpfp; sourceTree = BUILT_PRODUCTS_DIR; };\r\t\t008FC0051628BBDB00BC5BE2 /* dpfp_threaded */ = {isa = PBXFileReference; explicitFileType = \"compiled.mach-o.executable\"; includeInIndex = 0; path = dpfp_threaded; sourceTree = BUILT_PRODUCTS_DIR; };\r\t\t008FC0151628BC0300BC5BE2 /* fxload */ = {isa = PBXFileReference; explicitFileType = \"compiled.mach-o.executable\"; includeInIndex = 0; path = fxload; sourceTree = BUILT_PRODUCTS_DIR; };\r\t\t008FC0261628BC6B00BC5BE2 /* listdevs */ = {isa = PBXFileReference; explicitFileType = \"compiled.mach-o.executable\"; includeInIndex = 0; path = listdevs; sourceTree = BUILT_PRODUCTS_DIR; };\r\t\t1438D77817A2ED9F00166101 /* hotplug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hotplug.c; sourceTree = \"<group>\"; };\r\t\t1438D77917A2ED9F00166101 /* hotplug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hotplug.h; sourceTree = \"<group>\"; };\r\t\t1438D77C17A2EDCD00166101 /* poll_posix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = poll_posix.c; sourceTree = \"<group>\"; };\r\t\t1438D77E17A2F0EA00166101 /* strerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strerror.c; sourceTree = \"<group>\"; };\r\t\t1443EE8416417E63007E0579 /* common.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = common.xcconfig; sourceTree = SOURCE_ROOT; };\r\t\t1443EE8516417E63007E0579 /* debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = debug.xcconfig; sourceTree = SOURCE_ROOT; };\r\t\t1443EE8616417E63007E0579 /* libusb_debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = libusb_debug.xcconfig; sourceTree = SOURCE_ROOT; };\r\t\t1443EE8716417E63007E0579 /* libusb.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = libusb.xcconfig; sourceTree = SOURCE_ROOT; };\r\t\t1443EE8816417E63007E0579 /* release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = release.xcconfig; sourceTree = SOURCE_ROOT; };\r\t\t1443EE8916417EA6007E0579 /* libusb_release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = libusb_release.xcconfig; sourceTree = SOURCE_ROOT; };\r/* End PBXFileReference section */\r\r/* Begin PBXFrameworksBuildPhase section */\r\t\t008FBF2E1628B79300BC5BE2 /* Frameworks */ = {\r\t\t\tisa = PBXFrameworksBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tfiles = (\r\t\t\t\t008FBFAB1628B8CB00BC5BE2 /* libobjc.dylib in Frameworks */,\r\t\t\t\t008FBFA91628B88000BC5BE2 /* IOKit.framework in Frameworks */,\r\t\t\t\t008FBFA71628B87000BC5BE2 /* CoreFoundation.framework in Frameworks */,\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 0;\r\t\t};\r\t\t008FBFBA1628B9FE00BC5BE2 /* Frameworks */ = {\r\t\t\tisa = PBXFrameworksBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tfiles = (\r\t\t\t\t008FBFF01628BA3A00BC5BE2 /* libusb-1.0.0.dylib in Frameworks */,\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 0;\r\t\t};\r\t\t008FBFF21628BB8B00BC5BE2 /* Frameworks */ = {\r\t\t\tisa = PBXFrameworksBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tfiles = (\r\t\t\t\t008FC0001628BBCD00BC5BE2 /* libusb-1.0.0.dylib in Frameworks */,\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 0;\r\t\t};\r\t\t008FC0021628BBDB00BC5BE2 /* Frameworks */ = {\r\t\t\tisa = PBXFrameworksBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tfiles = (\r\t\t\t\t008FC0101628BBE900BC5BE2 /* libusb-1.0.0.dylib in Frameworks */,\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 0;\r\t\t};\r\t\t008FC0121628BC0300BC5BE2 /* Frameworks */ = {\r\t\t\tisa = PBXFrameworksBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tfiles = (\r\t\t\t\t008FC0201628BC1B00BC5BE2 /* libusb-1.0.0.dylib in Frameworks */,\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 0;\r\t\t};\r\t\t008FC0231628BC6B00BC5BE2 /* Frameworks */ = {\r\t\t\tisa = PBXFrameworksBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tfiles = (\r\t\t\t\t008FC0311628BC7800BC5BE2 /* libusb-1.0.0.dylib in Frameworks */,\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 0;\r\t\t};\r/* End PBXFrameworksBuildPhase section */\r\r/* Begin PBXGroup section */\r\t\t008FBF261628B79300BC5BE2 = {\r\t\t\tisa = PBXGroup;\r\t\t\tchildren = (\r\t\t\t\t1443EE8316417DE3007E0579 /* xcconfig */,\r\t\t\t\t008FBFA41628B84200BC5BE2 /* config.h */,\r\t\t\t\t008FBF3B1628B7E800BC5BE2 /* libusb */,\r\t\t\t\t008FBFC81628BA0E00BC5BE2 /* examples */,\r\t\t\t\t1443EE8A16419057007E0579 /* Apple */,\r\t\t\t\t008FBF321628B79300BC5BE2 /* Products */,\r\t\t\t);\r\t\t\tsourceTree = \"<group>\";\r\t\t};\r\t\t008FBF321628B79300BC5BE2 /* Products */ = {\r\t\t\tisa = PBXGroup;\r\t\t\tchildren = (\r\t\t\t\t008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */,\r\t\t\t\t008FBFBD1628B9FE00BC5BE2 /* xusb */,\r\t\t\t\t008FBFF51628BB8B00BC5BE2 /* dpfp */,\r\t\t\t\t008FC0051628BBDB00BC5BE2 /* dpfp_threaded */,\r\t\t\t\t008FC0151628BC0300BC5BE2 /* fxload */,\r\t\t\t\t008FC0261628BC6B00BC5BE2 /* listdevs */,\r\t\t\t);\r\t\t\tname = Products;\r\t\t\tsourceTree = \"<group>\";\r\t\t};\r\t\t008FBF3B1628B7E800BC5BE2 /* libusb */ = {\r\t\t\tisa = PBXGroup;\r\t\t\tchildren = (\r\t\t\t\t008FBF541628B7E800BC5BE2 /* core.c */,\r\t\t\t\t008FBF551628B7E800BC5BE2 /* descriptor.c */,\r\t\t\t\t1438D77817A2ED9F00166101 /* hotplug.c */,\r\t\t\t\t1438D77917A2ED9F00166101 /* hotplug.h */,\r\t\t\t\t008FBF561628B7E800BC5BE2 /* io.c */,\r\t\t\t\t008FBF5A1628B7E800BC5BE2 /* libusb.h */,\r\t\t\t\t008FBF671628B7E800BC5BE2 /* libusbi.h */,\r\t\t\t\t008FBF6B1628B7E800BC5BE2 /* os */,\r\t\t\t\t1438D77E17A2F0EA00166101 /* strerror.c */,\r\t\t\t\t008FBF7A1628B7E800BC5BE2 /* sync.c */,\r\t\t\t\t008FBF7B1628B7E800BC5BE2 /* version.h */,\r\t\t\t\t008FBF7C1628B7E800BC5BE2 /* version_nano.h */,\r\t\t\t);\r\t\t\tname = libusb;\r\t\t\tpath = ../libusb;\r\t\t\tsourceTree = \"<group>\";\r\t\t};\r\t\t008FBF6B1628B7E800BC5BE2 /* os */ = {\r\t\t\tisa = PBXGroup;\r\t\t\tchildren = (\r\t\t\t\t008FBF6C1628B7E800BC5BE2 /* darwin_usb.c */,\r\t\t\t\t008FBF6D1628B7E800BC5BE2 /* darwin_usb.h */,\r\t\t\t\t1438D77C17A2EDCD00166101 /* poll_posix.c */,\r\t\t\t\t008FBF711628B7E800BC5BE2 /* poll_posix.h */,\r\t\t\t\t008FBF741628B7E800BC5BE2 /* threads_posix.c */,\r\t\t\t\t008FBF751628B7E800BC5BE2 /* threads_posix.h */,\r\t\t\t);\r\t\t\tpath = os;\r\t\t\tsourceTree = \"<group>\";\r\t\t};\r\t\t008FBFC81628BA0E00BC5BE2 /* examples */ = {\r\t\t\tisa = PBXGroup;\r\t\t\tchildren = (\r\t\t\t\t008FBFD71628BA0E00BC5BE2 /* dpfp.c */,\r\t\t\t\t008FBFDB1628BA0E00BC5BE2 /* dpfp_threaded.c */,\r\t\t\t\t008FBFDC1628BA0E00BC5BE2 /* ezusb.c */,\r\t\t\t\t008FBFE11628BA0E00BC5BE2 /* fxload.c */,\r\t\t\t\t008FBFE71628BA0E00BC5BE2 /* listdevs.c */,\r\t\t\t\t008FBFED1628BA0E00BC5BE2 /* xusb.c */,\r\t\t\t\t008FBFDD1628BA0E00BC5BE2 /* ezusb.h */,\r\t\t\t);\r\t\t\tname = examples;\r\t\t\tpath = ../examples;\r\t\t\tsourceTree = \"<group>\";\r\t\t};\r\t\t1443EE8316417DE3007E0579 /* xcconfig */ = {\r\t\t\tisa = PBXGroup;\r\t\t\tchildren = (\r\t\t\t\t1443EE8416417E63007E0579 /* common.xcconfig */,\r\t\t\t\t1443EE8516417E63007E0579 /* debug.xcconfig */,\r\t\t\t\t1443EE8816417E63007E0579 /* release.xcconfig */,\r\t\t\t\t1443EE8716417E63007E0579 /* libusb.xcconfig */,\r\t\t\t\t1443EE8616417E63007E0579 /* libusb_debug.xcconfig */,\r\t\t\t\t1443EE8916417EA6007E0579 /* libusb_release.xcconfig */,\r\t\t\t);\r\t\t\tname = xcconfig;\r\t\t\tpath = ../libusb;\r\t\t\tsourceTree = \"<group>\";\r\t\t};\r\t\t1443EE8A16419057007E0579 /* Apple */ = {\r\t\t\tisa = PBXGroup;\r\t\t\tchildren = (\r\t\t\t\t008FBFAA1628B8CB00BC5BE2 /* libobjc.dylib */,\r\t\t\t\t008FBFA81628B88000BC5BE2 /* IOKit.framework */,\r\t\t\t\t008FBFA61628B87000BC5BE2 /* CoreFoundation.framework */,\r\t\t\t);\r\t\t\tname = Apple;\r\t\t\tpath = ../libusb;\r\t\t\tsourceTree = \"<group>\";\r\t\t};\r/* End PBXGroup section */\r\r/* Begin PBXHeadersBuildPhase section */\r\t\t008FBF2F1628B79300BC5BE2 /* Headers */ = {\r\t\t\tisa = PBXHeadersBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tfiles = (\r\t\t\t\t008FBF891628B7E800BC5BE2 /* libusb.h in Headers */,\r\t\t\t\t008FBF901628B7E800BC5BE2 /* libusbi.h in Headers */,\r\t\t\t\t008FBF931628B7E800BC5BE2 /* darwin_usb.h in Headers */,\r\t\t\t\t008FBF971628B7E800BC5BE2 /* poll_posix.h in Headers */,\r\t\t\t\t008FBF9B1628B7E800BC5BE2 /* threads_posix.h in Headers */,\r\t\t\t\t008FBFA11628B7E800BC5BE2 /* version.h in Headers */,\r\t\t\t\t008FBFA21628B7E800BC5BE2 /* version_nano.h in Headers */,\r\t\t\t\t008FBFA51628B84200BC5BE2 /* config.h in Headers */,\r\t\t\t\t1438D77B17A2ED9F00166101 /* hotplug.h in Headers */,\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 0;\r\t\t};\r/* End PBXHeadersBuildPhase section */\r\r/* Begin PBXNativeTarget section */\r\t\t008FBF301628B79300BC5BE2 /* libusb */ = {\r\t\t\tisa = PBXNativeTarget;\r\t\t\tbuildConfigurationList = 008FBF351628B79300BC5BE2 /* Build configuration list for PBXNativeTarget \"libusb\" */;\r\t\t\tbuildPhases = (\r\t\t\t\t008FBF2D1628B79300BC5BE2 /* Sources */,\r\t\t\t\t008FBF2E1628B79300BC5BE2 /* Frameworks */,\r\t\t\t\t008FBF2F1628B79300BC5BE2 /* Headers */,\r\t\t\t);\r\t\t\tbuildRules = (\r\t\t\t);\r\t\t\tdependencies = (\r\t\t\t);\r\t\t\tname = libusb;\r\t\t\tproductName = libusb;\r\t\t\tproductReference = 008FBF311628B79300BC5BE2 /* libusb-1.0.0.dylib */;\r\t\t\tproductType = \"com.apple.product-type.library.dynamic\";\r\t\t};\r\t\t008FBFBC1628B9FE00BC5BE2 /* xusb */ = {\r\t\t\tisa = PBXNativeTarget;\r\t\t\tbuildConfigurationList = 008FBFC61628B9FE00BC5BE2 /* Build configuration list for PBXNativeTarget \"xusb\" */;\r\t\t\tbuildPhases = (\r\t\t\t\t008FBFB91628B9FE00BC5BE2 /* Sources */,\r\t\t\t\t008FBFBA1628B9FE00BC5BE2 /* Frameworks */,\r\t\t\t\t008FBFBB1628B9FE00BC5BE2 /* CopyFiles */,\r\t\t\t);\r\t\t\tbuildRules = (\r\t\t\t);\r\t\t\tdependencies = (\r\t\t\t\t1443EE941641927D007E0579 /* PBXTargetDependency */,\r\t\t\t);\r\t\t\tname = xusb;\r\t\t\tproductName = xusb;\r\t\t\tproductReference = 008FBFBD1628B9FE00BC5BE2 /* xusb */;\r\t\t\tproductType = \"com.apple.product-type.tool\";\r\t\t};\r\t\t008FBFF41628BB8B00BC5BE2 /* dpfp */ = {\r\t\t\tisa = PBXNativeTarget;\r\t\t\tbuildConfigurationList = 008FBFFC1628BB8C00BC5BE2 /* Build configuration list for PBXNativeTarget \"dpfp\" */;\r\t\t\tbuildPhases = (\r\t\t\t\t008FBFF11628BB8B00BC5BE2 /* Sources */,\r\t\t\t\t008FBFF21628BB8B00BC5BE2 /* Frameworks */,\r\t\t\t\t008FBFF31628BB8B00BC5BE2 /* CopyFiles */,\r\t\t\t);\r\t\t\tbuildRules = (\r\t\t\t);\r\t\t\tdependencies = (\r\t\t\t\t1443EE921641927A007E0579 /* PBXTargetDependency */,\r\t\t\t);\r\t\t\tname = dpfp;\r\t\t\tproductName = dpfp;\r\t\t\tproductReference = 008FBFF51628BB8B00BC5BE2 /* dpfp */;\r\t\t\tproductType = \"com.apple.product-type.tool\";\r\t\t};\r\t\t008FC0041628BBDB00BC5BE2 /* dpfp_threaded */ = {\r\t\t\tisa = PBXNativeTarget;\r\t\t\tbuildConfigurationList = 008FC00C1628BBDB00BC5BE2 /* Build configuration list for PBXNativeTarget \"dpfp_threaded\" */;\r\t\t\tbuildPhases = (\r\t\t\t\t008FC0011628BBDB00BC5BE2 /* Sources */,\r\t\t\t\t008FC0021628BBDB00BC5BE2 /* Frameworks */,\r\t\t\t\t008FC0031628BBDB00BC5BE2 /* CopyFiles */,\r\t\t\t);\r\t\t\tbuildRules = (\r\t\t\t);\r\t\t\tdependencies = (\r\t\t\t\t1443EE9016419276007E0579 /* PBXTargetDependency */,\r\t\t\t);\r\t\t\tname = dpfp_threaded;\r\t\t\tproductName = dpfp_threaded;\r\t\t\tproductReference = 008FC0051628BBDB00BC5BE2 /* dpfp_threaded */;\r\t\t\tproductType = \"com.apple.product-type.tool\";\r\t\t};\r\t\t008FC0141628BC0300BC5BE2 /* fxload */ = {\r\t\t\tisa = PBXNativeTarget;\r\t\t\tbuildConfigurationList = 008FC01C1628BC0300BC5BE2 /* Build configuration list for PBXNativeTarget \"fxload\" */;\r\t\t\tbuildPhases = (\r\t\t\t\t008FC0111628BC0300BC5BE2 /* Sources */,\r\t\t\t\t008FC0121628BC0300BC5BE2 /* Frameworks */,\r\t\t\t\t008FC0131628BC0300BC5BE2 /* CopyFiles */,\r\t\t\t);\r\t\t\tbuildRules = (\r\t\t\t);\r\t\t\tdependencies = (\r\t\t\t\t1443EE8E16419273007E0579 /* PBXTargetDependency */,\r\t\t\t);\r\t\t\tname = fxload;\r\t\t\tproductName = fxload;\r\t\t\tproductReference = 008FC0151628BC0300BC5BE2 /* fxload */;\r\t\t\tproductType = \"com.apple.product-type.tool\";\r\t\t};\r\t\t008FC0251628BC6B00BC5BE2 /* listdevs */ = {\r\t\t\tisa = PBXNativeTarget;\r\t\t\tbuildConfigurationList = 008FC02D1628BC6B00BC5BE2 /* Build configuration list for PBXNativeTarget \"listdevs\" */;\r\t\t\tbuildPhases = (\r\t\t\t\t008FC0221628BC6B00BC5BE2 /* Sources */,\r\t\t\t\t008FC0231628BC6B00BC5BE2 /* Frameworks */,\r\t\t\t\t008FC0241628BC6B00BC5BE2 /* CopyFiles */,\r\t\t\t);\r\t\t\tbuildRules = (\r\t\t\t);\r\t\t\tdependencies = (\r\t\t\t\t1443EE8C1641926D007E0579 /* PBXTargetDependency */,\r\t\t\t);\r\t\t\tname = listdevs;\r\t\t\tproductName = listdevs;\r\t\t\tproductReference = 008FC0261628BC6B00BC5BE2 /* listdevs */;\r\t\t\tproductType = \"com.apple.product-type.tool\";\r\t\t};\r/* End PBXNativeTarget section */\r\r/* Begin PBXProject section */\r\t\t008FBF281628B79300BC5BE2 /* Project object */ = {\r\t\t\tisa = PBXProject;\r\t\t\tattributes = {\r\t\t\t\tLastUpgradeCheck = 0450;\r\t\t\t\tORGANIZATIONNAME = libusb;\r\t\t\t};\r\t\t\tbuildConfigurationList = 008FBF2B1628B79300BC5BE2 /* Build configuration list for PBXProject \"libusb\" */;\r\t\t\tcompatibilityVersion = \"Xcode 3.1\";\r\t\t\tdevelopmentRegion = English;\r\t\t\thasScannedForEncodings = 0;\r\t\t\tknownRegions = (\r\t\t\t\ten,\r\t\t\t);\r\t\t\tmainGroup = 008FBF261628B79300BC5BE2;\r\t\t\tproductRefGroup = 008FBF321628B79300BC5BE2 /* Products */;\r\t\t\tprojectDirPath = \"\";\r\t\t\tprojectRoot = \"\";\r\t\t\ttargets = (\r\t\t\t\t008FBF301628B79300BC5BE2 /* libusb */,\r\t\t\t\t008FBFBC1628B9FE00BC5BE2 /* xusb */,\r\t\t\t\t008FBFF41628BB8B00BC5BE2 /* dpfp */,\r\t\t\t\t008FC0041628BBDB00BC5BE2 /* dpfp_threaded */,\r\t\t\t\t008FC0141628BC0300BC5BE2 /* fxload */,\r\t\t\t\t008FC0251628BC6B00BC5BE2 /* listdevs */,\r\t\t\t\t008FC0321628BC9400BC5BE2 /* all */,\r\t\t\t);\r\t\t};\r/* End PBXProject section */\r\r/* Begin PBXSourcesBuildPhase section */\r\t\t008FBF2D1628B79300BC5BE2 /* Sources */ = {\r\t\t\tisa = PBXSourcesBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tfiles = (\r\t\t\t\t008FBF861628B7E800BC5BE2 /* core.c in Sources */,\r\t\t\t\t008FBF871628B7E800BC5BE2 /* descriptor.c in Sources */,\r\t\t\t\t008FBF881628B7E800BC5BE2 /* io.c in Sources */,\r\t\t\t\t008FBF921628B7E800BC5BE2 /* darwin_usb.c in Sources */,\r\t\t\t\t008FBF9A1628B7E800BC5BE2 /* threads_posix.c in Sources */,\r\t\t\t\t008FBFA01628B7E800BC5BE2 /* sync.c in Sources */,\r\t\t\t\t1438D77A17A2ED9F00166101 /* hotplug.c in Sources */,\r\t\t\t\t1438D77D17A2EDCD00166101 /* poll_posix.c in Sources */,\r\t\t\t\t1438D77F17A2F0EA00166101 /* strerror.c in Sources */,\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 0;\r\t\t};\r\t\t008FBFB91628B9FE00BC5BE2 /* Sources */ = {\r\t\t\tisa = PBXSourcesBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tfiles = (\r\t\t\t\t008FBFEF1628BA3500BC5BE2 /* xusb.c in Sources */,\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 0;\r\t\t};\r\t\t008FBFF11628BB8B00BC5BE2 /* Sources */ = {\r\t\t\tisa = PBXSourcesBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tfiles = (\r\t\t\t\t008FBFFF1628BB9600BC5BE2 /* dpfp.c in Sources */,\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 0;\r\t\t};\r\t\t008FC0011628BBDB00BC5BE2 /* Sources */ = {\r\t\t\tisa = PBXSourcesBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tfiles = (\r\t\t\t\t008FC00F1628BBE400BC5BE2 /* dpfp_threaded.c in Sources */,\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 0;\r\t\t};\r\t\t008FC0111628BC0300BC5BE2 /* Sources */ = {\r\t\t\tisa = PBXSourcesBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tfiles = (\r\t\t\t\t008FC0211628BC5200BC5BE2 /* ezusb.c in Sources */,\r\t\t\t\t008FC01F1628BC1500BC5BE2 /* fxload.c in Sources */,\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 0;\r\t\t};\r\t\t008FC0221628BC6B00BC5BE2 /* Sources */ = {\r\t\t\tisa = PBXSourcesBuildPhase;\r\t\t\tbuildActionMask = 2147483647;\r\t\t\tfiles = (\r\t\t\t\t008FC0301628BC7400BC5BE2 /* listdevs.c in Sources */,\r\t\t\t);\r\t\t\trunOnlyForDeploymentPostprocessing = 0;\r\t\t};\r/* End PBXSourcesBuildPhase section */\r\r/* Begin PBXTargetDependency section */\r\t\t008FC0371628BC9A00BC5BE2 /* PBXTargetDependency */ = {\r\t\t\tisa = PBXTargetDependency;\r\t\t\ttarget = 008FBF301628B79300BC5BE2 /* libusb */;\r\t\t\ttargetProxy = 008FC0361628BC9A00BC5BE2 /* PBXContainerItemProxy */;\r\t\t};\r\t\t008FC0391628BC9A00BC5BE2 /* PBXTargetDependency */ = {\r\t\t\tisa = PBXTargetDependency;\r\t\t\ttarget = 008FBFBC1628B9FE00BC5BE2 /* xusb */;\r\t\t\ttargetProxy = 008FC0381628BC9A00BC5BE2 /* PBXContainerItemProxy */;\r\t\t};\r\t\t008FC03B1628BC9A00BC5BE2 /* PBXTargetDependency */ = {\r\t\t\tisa = PBXTargetDependency;\r\t\t\ttarget = 008FBFF41628BB8B00BC5BE2 /* dpfp */;\r\t\t\ttargetProxy = 008FC03A1628BC9A00BC5BE2 /* PBXContainerItemProxy */;\r\t\t};\r\t\t008FC03D1628BC9A00BC5BE2 /* PBXTargetDependency */ = {\r\t\t\tisa = PBXTargetDependency;\r\t\t\ttarget = 008FC0041628BBDB00BC5BE2 /* dpfp_threaded */;\r\t\t\ttargetProxy = 008FC03C1628BC9A00BC5BE2 /* PBXContainerItemProxy */;\r\t\t};\r\t\t008FC03F1628BC9A00BC5BE2 /* PBXTargetDependency */ = {\r\t\t\tisa = PBXTargetDependency;\r\t\t\ttarget = 008FC0141628BC0300BC5BE2 /* fxload */;\r\t\t\ttargetProxy = 008FC03E1628BC9A00BC5BE2 /* PBXContainerItemProxy */;\r\t\t};\r\t\t008FC0411628BC9A00BC5BE2 /* PBXTargetDependency */ = {\r\t\t\tisa = PBXTargetDependency;\r\t\t\ttarget = 008FC0251628BC6B00BC5BE2 /* listdevs */;\r\t\t\ttargetProxy = 008FC0401628BC9A00BC5BE2 /* PBXContainerItemProxy */;\r\t\t};\r\t\t1443EE8C1641926D007E0579 /* PBXTargetDependency */ = {\r\t\t\tisa = PBXTargetDependency;\r\t\t\ttarget = 008FBF301628B79300BC5BE2 /* libusb */;\r\t\t\ttargetProxy = 1443EE8B1641926D007E0579 /* PBXContainerItemProxy */;\r\t\t};\r\t\t1443EE8E16419273007E0579 /* PBXTargetDependency */ = {\r\t\t\tisa = PBXTargetDependency;\r\t\t\ttarget = 008FBF301628B79300BC5BE2 /* libusb */;\r\t\t\ttargetProxy = 1443EE8D16419273007E0579 /* PBXContainerItemProxy */;\r\t\t};\r\t\t1443EE9016419276007E0579 /* PBXTargetDependency */ = {\r\t\t\tisa = PBXTargetDependency;\r\t\t\ttarget = 008FBF301628B79300BC5BE2 /* libusb */;\r\t\t\ttargetProxy = 1443EE8F16419276007E0579 /* PBXContainerItemProxy */;\r\t\t};\r\t\t1443EE921641927A007E0579 /* PBXTargetDependency */ = {\r\t\t\tisa = PBXTargetDependency;\r\t\t\ttarget = 008FBF301628B79300BC5BE2 /* libusb */;\r\t\t\ttargetProxy = 1443EE911641927A007E0579 /* PBXContainerItemProxy */;\r\t\t};\r\t\t1443EE941641927D007E0579 /* PBXTargetDependency */ = {\r\t\t\tisa = PBXTargetDependency;\r\t\t\ttarget = 008FBF301628B79300BC5BE2 /* libusb */;\r\t\t\ttargetProxy = 1443EE931641927D007E0579 /* PBXContainerItemProxy */;\r\t\t};\r/* End PBXTargetDependency section */\r\r/* Begin XCBuildConfiguration section */\r\t\t008FBF331628B79300BC5BE2 /* Debug */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbuildSettings = {\r\t\t\t};\r\t\t\tname = Debug;\r\t\t};\r\t\t008FBF341628B79300BC5BE2 /* Release */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbuildSettings = {\r\t\t\t};\r\t\t\tname = Release;\r\t\t};\r\t\t008FBF361628B79300BC5BE2 /* Debug */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbaseConfigurationReference = 1443EE8616417E63007E0579 /* libusb_debug.xcconfig */;\r\t\t\tbuildSettings = {\r\t\t\t};\r\t\t\tname = Debug;\r\t\t};\r\t\t008FBF371628B79300BC5BE2 /* Release */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbaseConfigurationReference = 1443EE8916417EA6007E0579 /* libusb_release.xcconfig */;\r\t\t\tbuildSettings = {\r\t\t\t};\r\t\t\tname = Release;\r\t\t};\r\t\t008FBFC41628B9FE00BC5BE2 /* Debug */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbaseConfigurationReference = 1443EE8516417E63007E0579 /* debug.xcconfig */;\r\t\t\tbuildSettings = {\r\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\r\t\t\t};\r\t\t\tname = Debug;\r\t\t};\r\t\t008FBFC51628B9FE00BC5BE2 /* Release */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbaseConfigurationReference = 1443EE8816417E63007E0579 /* release.xcconfig */;\r\t\t\tbuildSettings = {\r\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\r\t\t\t};\r\t\t\tname = Release;\r\t\t};\r\t\t008FBFFD1628BB8C00BC5BE2 /* Debug */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbaseConfigurationReference = 1443EE8516417E63007E0579 /* debug.xcconfig */;\r\t\t\tbuildSettings = {\r\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\r\t\t\t};\r\t\t\tname = Debug;\r\t\t};\r\t\t008FBFFE1628BB8C00BC5BE2 /* Release */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbaseConfigurationReference = 1443EE8816417E63007E0579 /* release.xcconfig */;\r\t\t\tbuildSettings = {\r\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\r\t\t\t};\r\t\t\tname = Release;\r\t\t};\r\t\t008FC00D1628BBDB00BC5BE2 /* Debug */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbaseConfigurationReference = 1443EE8516417E63007E0579 /* debug.xcconfig */;\r\t\t\tbuildSettings = {\r\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\r\t\t\t};\r\t\t\tname = Debug;\r\t\t};\r\t\t008FC00E1628BBDB00BC5BE2 /* Release */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbaseConfigurationReference = 1443EE8816417E63007E0579 /* release.xcconfig */;\r\t\t\tbuildSettings = {\r\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\r\t\t\t};\r\t\t\tname = Release;\r\t\t};\r\t\t008FC01D1628BC0300BC5BE2 /* Debug */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbaseConfigurationReference = 1443EE8516417E63007E0579 /* debug.xcconfig */;\r\t\t\tbuildSettings = {\r\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\r\t\t\t};\r\t\t\tname = Debug;\r\t\t};\r\t\t008FC01E1628BC0300BC5BE2 /* Release */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbaseConfigurationReference = 1443EE8816417E63007E0579 /* release.xcconfig */;\r\t\t\tbuildSettings = {\r\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\r\t\t\t};\r\t\t\tname = Release;\r\t\t};\r\t\t008FC02E1628BC6B00BC5BE2 /* Debug */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbaseConfigurationReference = 1443EE8516417E63007E0579 /* debug.xcconfig */;\r\t\t\tbuildSettings = {\r\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\r\t\t\t};\r\t\t\tname = Debug;\r\t\t};\r\t\t008FC02F1628BC6B00BC5BE2 /* Release */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbaseConfigurationReference = 1443EE8816417E63007E0579 /* release.xcconfig */;\r\t\t\tbuildSettings = {\r\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\r\t\t\t};\r\t\t\tname = Release;\r\t\t};\r\t\t008FC0341628BC9400BC5BE2 /* Debug */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbuildSettings = {\r\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\r\t\t\t};\r\t\t\tname = Debug;\r\t\t};\r\t\t008FC0351628BC9400BC5BE2 /* Release */ = {\r\t\t\tisa = XCBuildConfiguration;\r\t\t\tbuildSettings = {\r\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\r\t\t\t};\r\t\t\tname = Release;\r\t\t};\r/* End XCBuildConfiguration section */\r\r/* Begin XCConfigurationList section */\r\t\t008FBF2B1628B79300BC5BE2 /* Build configuration list for PBXProject \"libusb\" */ = {\r\t\t\tisa = XCConfigurationList;\r\t\t\tbuildConfigurations = (\r\t\t\t\t008FBF331628B79300BC5BE2 /* Debug */,\r\t\t\t\t008FBF341628B79300BC5BE2 /* Release */,\r\t\t\t);\r\t\t\tdefaultConfigurationIsVisible = 0;\r\t\t\tdefaultConfigurationName = Release;\r\t\t};\r\t\t008FBF351628B79300BC5BE2 /* Build configuration list for PBXNativeTarget \"libusb\" */ = {\r\t\t\tisa = XCConfigurationList;\r\t\t\tbuildConfigurations = (\r\t\t\t\t008FBF361628B79300BC5BE2 /* Debug */,\r\t\t\t\t008FBF371628B79300BC5BE2 /* Release */,\r\t\t\t);\r\t\t\tdefaultConfigurationIsVisible = 0;\r\t\t\tdefaultConfigurationName = Release;\r\t\t};\r\t\t008FBFC61628B9FE00BC5BE2 /* Build configuration list for PBXNativeTarget \"xusb\" */ = {\r\t\t\tisa = XCConfigurationList;\r\t\t\tbuildConfigurations = (\r\t\t\t\t008FBFC41628B9FE00BC5BE2 /* Debug */,\r\t\t\t\t008FBFC51628B9FE00BC5BE2 /* Release */,\r\t\t\t);\r\t\t\tdefaultConfigurationIsVisible = 0;\r\t\t\tdefaultConfigurationName = Release;\r\t\t};\r\t\t008FBFFC1628BB8C00BC5BE2 /* Build configuration list for PBXNativeTarget \"dpfp\" */ = {\r\t\t\tisa = XCConfigurationList;\r\t\t\tbuildConfigurations = (\r\t\t\t\t008FBFFD1628BB8C00BC5BE2 /* Debug */,\r\t\t\t\t008FBFFE1628BB8C00BC5BE2 /* Release */,\r\t\t\t);\r\t\t\tdefaultConfigurationIsVisible = 0;\r\t\t\tdefaultConfigurationName = Release;\r\t\t};\r\t\t008FC00C1628BBDB00BC5BE2 /* Build configuration list for PBXNativeTarget \"dpfp_threaded\" */ = {\r\t\t\tisa = XCConfigurationList;\r\t\t\tbuildConfigurations = (\r\t\t\t\t008FC00D1628BBDB00BC5BE2 /* Debug */,\r\t\t\t\t008FC00E1628BBDB00BC5BE2 /* Release */,\r\t\t\t);\r\t\t\tdefaultConfigurationIsVisible = 0;\r\t\t\tdefaultConfigurationName = Release;\r\t\t};\r\t\t008FC01C1628BC0300BC5BE2 /* Build configuration list for PBXNativeTarget \"fxload\" */ = {\r\t\t\tisa = XCConfigurationList;\r\t\t\tbuildConfigurations = (\r\t\t\t\t008FC01D1628BC0300BC5BE2 /* Debug */,\r\t\t\t\t008FC01E1628BC0300BC5BE2 /* Release */,\r\t\t\t);\r\t\t\tdefaultConfigurationIsVisible = 0;\r\t\t\tdefaultConfigurationName = Release;\r\t\t};\r\t\t008FC02D1628BC6B00BC5BE2 /* Build configuration list for PBXNativeTarget \"listdevs\" */ = {\r\t\t\tisa = XCConfigurationList;\r\t\t\tbuildConfigurations = (\r\t\t\t\t008FC02E1628BC6B00BC5BE2 /* Debug */,\r\t\t\t\t008FC02F1628BC6B00BC5BE2 /* Release */,\r\t\t\t);\r\t\t\tdefaultConfigurationIsVisible = 0;\r\t\t\tdefaultConfigurationName = Release;\r\t\t};\r\t\t008FC0331628BC9400BC5BE2 /* Build configuration list for PBXAggregateTarget \"all\" */ = {\r\t\t\tisa = XCConfigurationList;\r\t\t\tbuildConfigurations = (\r\t\t\t\t008FC0341628BC9400BC5BE2 /* Debug */,\r\t\t\t\t008FC0351628BC9400BC5BE2 /* Release */,\r\t\t\t);\r\t\t\tdefaultConfigurationIsVisible = 0;\r\t\t\tdefaultConfigurationName = Release;\r\t\t};\r/* End XCConfigurationList section */\r\t};\r\trootObject = 008FBF281628B79300BC5BE2 /* Project object */;\r}\r"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/Xcode/libusb_debug.xcconfig",
    "content": "//\n// libusb Xcode configuration file\n// Copyright © 2012 Pete Batard <pete@akeo.ie>\n// For more information, please visit: <http://libusb.info>\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 2.1 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n#include \"debug.xcconfig\"\n#include \"libusb.xcconfig\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/Xcode/libusb_release.xcconfig",
    "content": "//\n// libusb Xcode configuration file\n// Copyright © 2012 Pete Batard <pete@akeo.ie>\n// For more information, please visit: <http://libusb.info>\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 2.1 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n#include \"release.xcconfig\"\n#include \"libusb.xcconfig\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/Xcode/release.xcconfig",
    "content": "//\n// libusb Xcode configuration file\n// Copyright © 2012 Pete Batard <pete@akeo.ie>\n// For more information, please visit: <http://libusb.info>\n//\n// This library is free software; you can redistribute it and/or\n// modify it under the terms of the GNU Lesser General Public\n// License as published by the Free Software Foundation; either\n// version 2.1 of the License, or (at your option) any later version.\n//\n// This library is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n// Lesser General Public License for more details.\n//\n// You should have received a copy of the GNU Lesser General Public\n// License along with this library; if not, write to the Free Software\n// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n\n#include \"common.xcconfig\"\n\n// Put debug symbols in separate .dym file.\nDEBUG_INFORMATION_FORMAT = dwarf-with-dsym\n\n// Optimizations in release.\nGCC_OPTIMIZATION_LEVEL = s\nLLVM_LTO = YES\n\n// Define NDEBUG so asserts go away in release.\nGCC_PREPROCESSOR_DEFINITIONS = $(inherited) NDEBUG=1\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/android/README",
    "content": "libusb for Android\n==================\n\nBuilding:\n---------\n\nTo build libusb for Android do the following:\n\n 1. Download the latest NDK from:\n    http://developer.android.com/tools/sdk/ndk/index.html\n\n 2. Extract the NDK.\n\n 3. Open a shell and make sure there exist an NDK global variable\n    set to the directory where you extracted the NDK.\n\n 4. Change directory to libusb's \"android/jni\"\n\n 5. Run \"$NDK/ndk-build\".\n\nThe libusb library, examples and tests can then be found in:\n    \"android/libs/$ARCH\"\n\nWhere $ARCH is one of:\n    armeabi\n    armeabi-v7a\n    x86\n\n\nInstalling:\n-----------\n\nIf you wish to use libusb from native code in own Android application\nthen you should add the following line to your Android.mk file:\n\n  include $(PATH_TO_LIBUSB_SRC)/android/jni/libusb.mk\n\nYou will then need to add the following lines to the build\nconfiguration for each native binary which uses libusb:\n\n  LOCAL_C_INCLUDES += $(LIBUSB_ROOT_ABS)\n  LOCAL_SHARED_LIBRARIES += libusb1.0\n\nThe Android build system will then correctly include libusb in the\napplication package (APK) file, provided ndk-build is invoked before\nthe package is built.\n\n\nFor a rooted device it is possible to install libusb into the system\nimage of a running device:\n\n 1. Enable ADB on the device.\n\n 2. Connect the device to a machine running ADB.\n\n 3. Execute the following commands on the machine\n    running ADB:\n\n    # Make the system partition writable\n    adb shell su -c \"mount -o remount,rw /system\"\n\n    # Install libusb\n    adb push obj/local/armeabi/libusb1.0.so /sdcard/\n    adb shell su -c \"cat > /system/lib/libusb1.0.so < /sdcard/libusb1.0.so\"\n    adb shell rm /system/lib/libusb1.0.so\n\n    # Install the samples and tests\n    for B in listdevs fxload xusb sam3u_benchmark hotplugtest stress\n    do\n      adb push \"obj/local/armeabi/$B\" /sdcard/\n      adb shell su -c \"cat > /system/bin/$B < /sdcard/$B\"\n      adb shell su -c \"chmod 0755 /system/bin/$B\"\n      adb shell rm \"/sdcard/$B\"\n    done\n\n    # Make the system partition read only again\n    adb shell su -c \"mount -o remount,ro /system\"\n\n    # Run listdevs to\n    adb shell su -c \"listdevs\"\n\n 4. If your device only has a single OTG port then ADB can generally\n    be switched to using Wifi with the following commands when connected\n    via USB:\n\n    adb shell netcfg\n    # Note the wifi IP address of the phone\n    adb tcpip 5555\n    # Use the IP address from netcfg\n    adb connect 192.168.1.123:5555\n\nRuntime Permissions:\n--------------------\n\nThe default system configuration on most Android device will not allow\naccess to USB devices. There are several options for changing this.\n\nIf you have control of the system image then you can modify the\nueventd.rc used in the image to change the permissions on\n/dev/bus/usb/*/*. If using this approach then it is advisable to\ncreate a new Android permission to protect access to these files.\nIt is not advisable to give all applications read and write permissions\nto these files.\n\nFor rooted devices the code using libusb could be executed as root\nusing the \"su\" command. An alternative would be to use the \"su\" command\nto change the permissions on the appropriate /dev/bus/usb/ files.\n\nUsers have reported success in using android.hardware.usb.UsbManager\nto request permission to use the UsbDevice and then opening the\ndevice. The difficulties in this method is that there is no guarantee\nthat it will continue to work in the future Android versions, it\nrequires invoking Java APIs and running code to match each\nandroid.hardware.usb.UsbDevice to a libusb_device.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/android/config.h",
    "content": "/*\n * Android build config for libusb\n * Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n/* Start with debug message logging enabled */\n/* #undef ENABLE_DEBUG_LOGGING */\n\n/* Message logging */\n#define ENABLE_LOGGING\n\n/* Define to 1 if you have the <dlfcn.h> header file. */\n#define HAVE_DLFCN_H 1\n\n/* Define to 1 if you have the `gettimeofday' function. */\n#define HAVE_GETTIMEOFDAY 1\n\n/* Define to 1 if you have the <inttypes.h> header file. */\n#define HAVE_INTTYPES_H 1\n\n/* Android backend */\n#define OS_ANDROID 1\n\n/* Enable output to system log */\n#define USE_SYSTEM_LOGGING_FACILITY 1\n\n/* type of second poll() argument */\n#define POLL_NFDS_TYPE nfds_t\n\n/* Use POSIX Threads */\n#define THREADS_POSIX 1\n\n/* Default visibility */\n#define DEFAULT_VISIBILITY __attribute__((visibility(\"default\")))\n\n/* Define to 1 if you have the <memory.h> header file. */\n#define HAVE_MEMORY_H 1\n\n/* Define to 1 if you have the <poll.h> header file. */\n#define HAVE_POLL_H 1\n\n/* Define to 1 if you have the <signal.h> header file. */\n#define HAVE_SIGNAL_H 1\n\n/* Define to 1 if you have the <sys/stat.h> header file. */\n#define HAVE_SYS_STAT_H 1\n\n/* Define to 1 if you have the <sys/time.h> header file. */\n#define HAVE_SYS_TIME_H 1\n\n/* Define to 1 if you have the <sys/types.h> header file. */\n#define HAVE_SYS_TYPES_H 1\n\n/* Define to 1 if you have the <unistd.h> header file. */\n#define HAVE_UNISTD_H 1\n\n/* Define to 1 if you have the <linux/filter.h> header file. */\n#define HAVE_LINUX_FILTER_H 1\n\n/* Define to 1 if you have the <linux/netlink.h> header file. */\n#define HAVE_LINUX_NETLINK_H 1\n\n/* Define to 1 if you have the <asm/types.h> header file. */\n#define HAVE_ASM_TYPES_H 1\n\n/* Define to 1 if you have the <sys/socket.h> header file. */\n#define HAVE_SYS_SOCKET_H 1\n\n#include \"utilbase.h\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/android/config_original.h",
    "content": "/*\n * Android build config for libusb\n * Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n/* Start with debug message logging enabled */\n/* #undef ENABLE_DEBUG_LOGGING */\n\n/* Message logging */\n#define ENABLE_LOGGING\n\n/* Define to 1 if you have the <dlfcn.h> header file. */\n#define HAVE_DLFCN_H 1\n\n/* Define to 1 if you have the `gettimeofday' function. */\n#define HAVE_GETTIMEOFDAY 1\n\n/* Define to 1 if you have the <inttypes.h> header file. */\n#define HAVE_INTTYPES_H 1\n\n/* Linux backend */\n#define OS_LINUX 1\n\n/* Enable output to system log */\n#define USE_SYSTEM_LOGGING_FACILITY 1\n\n/* type of second poll() argument */\n#define POLL_NFDS_TYPE nfds_t\n\n/* Use POSIX Threads */\n#define THREADS_POSIX 1\n\n/* Default visibility */\n#define DEFAULT_VISIBILITY __attribute__((visibility(\"default\")))\n\n/* Define to 1 if you have the <memory.h> header file. */\n#define HAVE_MEMORY_H 1\n\n/* Define to 1 if you have the <poll.h> header file. */\n#define HAVE_POLL_H 1\n\n/* Define to 1 if you have the <signal.h> header file. */\n#define HAVE_SIGNAL_H 1\n\n/* Define to 1 if you have the <sys/stat.h> header file. */\n#define HAVE_SYS_STAT_H 1\n\n/* Define to 1 if you have the <sys/time.h> header file. */\n#define HAVE_SYS_TIME_H 1\n\n/* Define to 1 if you have the <sys/types.h> header file. */\n#define HAVE_SYS_TYPES_H 1\n\n/* Define to 1 if you have the <unistd.h> header file. */\n#define HAVE_UNISTD_H 1\n\n/* Define to 1 if you have the <linux/filter.h> header file. */\n#define HAVE_LINUX_FILTER_H 1\n\n/* Define to 1 if you have the <linux/netlink.h> header file. */\n#define HAVE_LINUX_NETLINK_H 1\n\n/* Define to 1 if you have the <asm/types.h> header file. */\n#define HAVE_ASM_TYPES_H 1\n\n/* Define to 1 if you have the <sys/socket.h> header file. */\n#define HAVE_SYS_SOCKET_H 1\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/android/jni/Android.mk",
    "content": "# Android build config for libusb, examples and tests\n# Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n#\n\nLOCAL_PATH:= $(call my-dir)\n\ninclude $(LOCAL_PATH)/libusb.mk\n#include $(LOCAL_PATH)/examples.mk\n#include $(LOCAL_PATH)/tests.mk\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/android/jni/Android_original.mk",
    "content": "# Android build config for libusb, examples and tests\n# Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n#\n\nLOCAL_PATH:= $(call my-dir)\n\ninclude $(LOCAL_PATH)/libusb.mk\ninclude $(LOCAL_PATH)/examples.mk\ninclude $(LOCAL_PATH)/tests.mk\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/android/jni/Application.mk",
    "content": "# Android application build config for libusb\n# Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n#\n\nAPP_ABI := all\n\n# Workaround for MIPS toolchain linker being unable to find liblog dependency\n# of shared object in NDK versions at least up to r9.\n#\nAPP_LDFLAGS := -llog\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/android/jni/examples.mk",
    "content": "# Android build config for libusb examples\n# Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n#\n\nLOCAL_PATH:= $(call my-dir)\nLIBUSB_ROOT_REL:= ../..\nLIBUSB_ROOT_ABS:= $(LOCAL_PATH)/../..\n\n# listdevs\n\ninclude $(CLEAR_VARS)\n\nLOCAL_SRC_FILES := \\\n  $(LIBUSB_ROOT_REL)/examples/listdevs.c\n\nLOCAL_C_INCLUDES += \\\n  $(LIBUSB_ROOT_ABS)\n\nLOCAL_SHARED_LIBRARIES += libusb1.0\n\nLOCAL_MODULE:= listdevs\n\ninclude $(BUILD_EXECUTABLE)\n\n# xusb\n\ninclude $(CLEAR_VARS)\n\nLOCAL_SRC_FILES := \\\n  $(LIBUSB_ROOT_REL)/examples/xusb.c\n\nLOCAL_C_INCLUDES += \\\n  $(LIBUSB_ROOT_ABS)\n\nLOCAL_SHARED_LIBRARIES += libusb1.0\n\nLOCAL_MODULE:= xusb\n\ninclude $(BUILD_EXECUTABLE)\n\n# hotplugtest\n\ninclude $(CLEAR_VARS)\n\nLOCAL_SRC_FILES := \\\n  $(LIBUSB_ROOT_REL)/examples/hotplugtest.c\n\nLOCAL_C_INCLUDES += \\\n  $(LIBUSB_ROOT_ABS)\n\nLOCAL_SHARED_LIBRARIES += libusb1.0\n\nLOCAL_MODULE:= hotplugtest\n\ninclude $(BUILD_EXECUTABLE)\n\n# fxload\n\ninclude $(CLEAR_VARS)\n\nLOCAL_SRC_FILES := \\\n  $(LIBUSB_ROOT_REL)/examples/fxload.c \\\n  $(LIBUSB_ROOT_REL)/examples/ezusb.c\n\nLOCAL_C_INCLUDES += \\\n  $(LIBUSB_ROOT_ABS)\n\nLOCAL_SHARED_LIBRARIES += libusb1.0\n\nLOCAL_MODULE:= fxload\n\ninclude $(BUILD_EXECUTABLE)\n\n# sam3u_benchmake\n\ninclude $(CLEAR_VARS)\n\nLOCAL_SRC_FILES := \\\n  $(LIBUSB_ROOT_REL)/examples/sam3u_benchmark.c\n\nLOCAL_C_INCLUDES += \\\n  $(LIBUSB_ROOT_ABS)\n\nLOCAL_SHARED_LIBRARIES += libusb1.0\n\nLOCAL_MODULE:= sam3u_benchmark\n\ninclude $(BUILD_EXECUTABLE)\n\n# dpfp\n\ninclude $(CLEAR_VARS)\n\nLOCAL_SRC_FILES := \\\n  $(LIBUSB_ROOT_REL)/examples/dpfp.c\n\nLOCAL_C_INCLUDES += \\\n  $(LIBUSB_ROOT_ABS)\n\nLOCAL_SHARED_LIBRARIES += libusb1.0\n\nLOCAL_MODULE:= dpfp\n\ninclude $(BUILD_EXECUTABLE)\n\n# dpfp_threaded\n\ninclude $(CLEAR_VARS)\n\nLOCAL_SRC_FILES := \\\n  $(LIBUSB_ROOT_REL)/examples/dpfp_threaded.c\n\nLOCAL_C_INCLUDES += \\\n  $(LIBUSB_ROOT_ABS)\n\nLOCAL_SHARED_LIBRARIES += libusb1.0\n\nLOCAL_MODULE:= dpfp_threaded\n\ninclude $(BUILD_EXECUTABLE)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/android/jni/libusb.mk",
    "content": "# modified saki@serenegiant <t_saki@serenegiant.com>\n# Copyright (C)2014-2016\n#\n# Android build config for libusb\n# Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n#\n######################################################################\n# libusb.a\n######################################################################\nLOCAL_PATH\t\t\t:= $(call my-dir)/../..\ninclude $(CLEAR_VARS)\n\n# changed linux_usbfs.c => android_usbfs.c\n# changed linux_netlink.c => android_netlink.c\n# these sources are also modified.\nLOCAL_SRC_FILES := \\\n\tlibusb/core.c \\\n\tlibusb/descriptor.c \\\n\tlibusb/hotplug.c \\\n\tlibusb/io.c \\\n\tlibusb/sync.c \\\n\tlibusb/strerror.c \\\n\tlibusb/os/android_usbfs.c \\\n\tlibusb/os/poll_posix.c \\\n\tlibusb/os/threads_posix.c \\\n\tlibusb/os/android_netlink.c\n\nLOCAL_C_INCLUDES += \\\n\t$(LOCAL_PATH)/ \\\n\t$(LOCAL_PATH)/libusb \\\n\t$(LOCAL_PATH)/libusb/os \\\n\t$(LOCAL_PATH)/../ \\\n\t$(LOCAL_PATH)/../include \\\n\t$(LOCAL_PATH)/android \\\n\nLOCAL_EXPORT_C_INCLUDES := \\\n\t$(LOCAL_PATH)/ \\\n\t$(LOCAL_PATH)/libusb\n\n# add some flags\nLOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%)\nLOCAL_CFLAGS += -DANDROID_NDK\nLOCAL_CFLAGS += -DLOG_NDEBUG\nLOCAL_CFLAGS += -DACCESS_RAW_DESCRIPTORS\nLOCAL_CFLAGS += -O3 -fstrict-aliasing -fprefetch-loop-arrays\nLOCAL_EXPORT_LDLIBS += -llog\nLOCAL_ARM_MODE := arm\n\nLOCAL_MODULE := libusb100_static\ninclude $(BUILD_STATIC_LIBRARY)\n\n######################################################################\n# libusb100.so\n######################################################################\ninclude $(CLEAR_VARS)\nLOCAL_MODULE_TAGS := optional\nLOCAL_EXPORT_LDLIBS += -llog\n\nLOCAL_WHOLE_STATIC_LIBRARIES = libusb100_static\n\nLOCAL_MODULE := libusb100\ninclude $(BUILD_SHARED_LIBRARY)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/android/jni/libusb_original.mk",
    "content": "# Android build config for libusb\n# Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n#\n\nLOCAL_PATH:= $(call my-dir)\nLIBUSB_ROOT_REL:= ../..\nLIBUSB_ROOT_ABS:= $(LOCAL_PATH)/../..\n\n# libusb\n\ninclude $(CLEAR_VARS)\n\nLIBUSB_ROOT_REL:= ../..\nLIBUSB_ROOT_ABS:= $(LOCAL_PATH)/../..\n\n# changed linux_usbfs.c => android_usbfs.c\n# changed linux_netlink.c => android_netlink.c\n# these sources are also modified.\nLOCAL_SRC_FILES := \\\n  $(LIBUSB_ROOT_REL)/libusb/core.c \\\n  $(LIBUSB_ROOT_REL)/libusb/descriptor.c \\\n  $(LIBUSB_ROOT_REL)/libusb/hotplug.c \\\n  $(LIBUSB_ROOT_REL)/libusb/io.c \\\n  $(LIBUSB_ROOT_REL)/libusb/sync.c \\\n  $(LIBUSB_ROOT_REL)/libusb/strerror.c \\\n  $(LIBUSB_ROOT_REL)/libusb/os/android_usbfs.c \\\n  $(LIBUSB_ROOT_REL)/libusb/os/poll_posix.c \\\n  $(LIBUSB_ROOT_REL)/libusb/os/threads_posix.c \\\n  $(LIBUSB_ROOT_REL)/libusb/os/android_netlink.c\n\nLOCAL_C_INCLUDES += \\\n  $(LOCAL_PATH)/.. \\\n  $(LIBUSB_ROOT_ABS)/../ \\\n  $(LIBUSB_ROOT_ABS)/libusb \\\n  $(LIBUSB_ROOT_ABS)/libusb/os\n\nLOCAL_EXPORT_C_INCLUDES := \\\n  $(LIBUSB_ROOT_ABS)/libusb\n\nLOCAL_LDLIBS := -llog\n# added\nLOCAL_ARM_MODE := arm\n\nLOCAL_MODULE := libusb1.0\n\ninclude $(BUILD_SHARED_LIBRARY)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/android/jni/tests.mk",
    "content": "# Android build config for libusb tests\n# Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n#\n\nLOCAL_PATH:= $(call my-dir)\nLIBUSB_ROOT_REL:= ../..\nLIBUSB_ROOT_ABS:= $(LOCAL_PATH)/../..\n\n# testlib\n\ninclude $(CLEAR_VARS)\n\nLOCAL_SRC_FILES := \\\n  $(LIBUSB_ROOT_REL)/tests/testlib.c\n\nLOCAL_C_INCLUDES += \\\n  $(LIBUSB_ROOT_ABS)/tests\n\nLOCAL_EXPORT_C_INCLUDES := \\\n  $(LIBUSB_ROOT_ABS)/tests\n\nLOCAL_MODULE := testlib\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n\n# stress\n\ninclude $(CLEAR_VARS)\n\nLOCAL_SRC_FILES := \\\n  $(LIBUSB_ROOT_REL)/tests/stress.c\n\nLOCAL_C_INCLUDES += \\\n  $(LIBUSB_ROOT_ABS)\n\nLOCAL_SHARED_LIBRARIES += libusb1.0\nLOCAL_STATIC_LIBRARIES += testlib\n\nLOCAL_MODULE:= stress\n\ninclude $(BUILD_EXECUTABLE)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/autogen.sh",
    "content": "#!/bin/sh\n\nset -e\n\n./bootstrap.sh\nif test -z \"$NOCONFIGURE\"; then\n    exec ./configure --enable-maintainer-mode --enable-examples-build --enable-tests-build \"$@\"\nfi\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/bootstrap.sh",
    "content": "#!/bin/sh\n\nset -e\n\n# use libtoolize if available, otherwise look for glibtoolize (darwin)\nif (libtoolize --version) < /dev/null > /dev/null 2>&1; then\n  LIBTOOLIZE=libtoolize\nelif (glibtoolize --version) < /dev/null > /dev/null 2>&1; then\n  LIBTOOLIZE=glibtoolize\nelse\n  echo \"libtoolize or glibtoolize was not found! Please install libtool.\" 1>&2\n  exit 1\nfi\n\n$LIBTOOLIZE --copy --force || exit 1\naclocal || exit 1\nautoheader || exit 1\nautoconf || exit 1\nautomake -a -c || exit 1\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/configure.ac",
    "content": "dnl These m4 macros are whitespace sensitive and break if moved around much.\nm4_define([LU_VERSION_H], m4_include([libusb/version.h]))\nm4_define([LU_DEFINE_VERSION_ATOM],\n\t[m4_define([$1], m4_bregexp(LU_VERSION_H,\n\t[^#define\\s*$1\\s*\\([0-9]*\\).*], [\\1]))])\nm4_define([LU_DEFINE_VERSION_RC_ATOM],\n\t[m4_define([$1], m4_bregexp(LU_VERSION_H,\n\t[^#define\\s*$1\\s*\"\\(-rc[0-9]*\\)\".*], [\\1]))])\ndnl The m4_bregexp() returns (only) the numbers following the #define named\ndnl in the first macro parameter. m4_define() then defines the name for use\ndnl in AC_INIT.\n\nLU_DEFINE_VERSION_ATOM([LIBUSB_MAJOR])\nLU_DEFINE_VERSION_ATOM([LIBUSB_MINOR])\nLU_DEFINE_VERSION_ATOM([LIBUSB_MICRO])\nLU_DEFINE_VERSION_RC_ATOM([LIBUSB_RC])\n\nAC_INIT([libusb],[LIBUSB_MAJOR[.]LIBUSB_MINOR[.]LIBUSB_MICRO[]LIBUSB_RC],[libusb-devel@lists.sourceforge.net],[libusb],[http://libusb.info])\n\n# Library versioning\n# These numbers should be tweaked on every release. Read carefully:\n# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html\n# http://sourceware.org/autobook/autobook/autobook_91.html\nlt_current=\"1\"\nlt_revision=\"0\"\nlt_age=\"1\"\nLTLDFLAGS=\"-version-info ${lt_current}:${lt_revision}:${lt_age}\"\n\nAM_INIT_AUTOMAKE\nAM_MAINTAINER_MODE\n\nAC_CONFIG_SRCDIR([libusb/core.c])\nAC_CONFIG_MACRO_DIR([m4])\nAC_CONFIG_HEADERS([config.h])\nm4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])\n\nAC_PREREQ([2.50])\nAC_PROG_CC\nLT_INIT\nLT_LANG([Windows Resource])\nAC_C_INLINE\nAM_PROG_CC_C_O\nAC_DEFINE([_GNU_SOURCE], 1, [Use GNU extensions])\n\nLTLDFLAGS=\"${LTLDFLAGS} -no-undefined\"\n\nAC_MSG_CHECKING([operating system])\n\ndnl on linux-android platform, some functions are in different places\ncase $host in\n*-linux-android*)\n\tAC_MSG_RESULT([This is a Linux-Android system])\n\tis_backend_android=\"yes\"\n\t;;\n*)\n\tis_backend_android=\"no\"\nesac\n\ncase $host in\n*-linux* | *-uclinux*)\n\tAC_MSG_RESULT([Linux])\n\tbackend=\"linux\"\n\tthreads=\"posix\"\n\t;;\n*-darwin*)\n\tAC_MSG_RESULT([Darwin/Mac OS X])\n\tbackend=\"darwin\"\n\tthreads=\"posix\"\n\t;;\n*-openbsd*)\n\tAC_MSG_RESULT([OpenBSD])\n\tbackend=\"openbsd\"\n\tthreads=\"posix\"\n\t;;\n*-netbsd*)\n\tAC_MSG_RESULT([NetBSD])\n\tbackend=\"netbsd\"\n\tthreads=\"posix\"\n\t;;\n*-mingw*)\n\tAC_MSG_RESULT([Windows])\n\tbackend=\"windows\"\n\tthreads=\"windows\"\n\tcreate_import_lib=\"yes\"\n\tAM_CFLAGS=\"${AM_CFLAGS} -fno-omit-frame-pointer\"\n\t;;\n*-cygwin*)\n\tAC_MSG_RESULT([Cygwin (using Windows backend)])\n\tbackend=\"windows\"\n\tthreads=\"posix\"\n\t;;\n*)\n\tAC_MSG_ERROR([unsupported operating system])\nesac\n\ncase $backend in\nlinux)\n\tAC_DEFINE(OS_LINUX, 1, [Linux backend])\n\tAC_SUBST(OS_LINUX)\n\tAC_SEARCH_LIBS(clock_gettime, rt, [], [], -pthread)\n\tAC_ARG_ENABLE([udev],\n\t\t[AC_HELP_STRING([--enable-udev], [use udev for device enumeration and hotplug support (recommended) [default=yes]])],\n\t\t[], [enable_udev=\"yes\"])\n\t\tif test \"x$enable_udev\" = \"xyes\" ; then\n\t\t\t# system has udev. use it or fail!\n\t\t\tAC_CHECK_HEADERS([libudev.h],[],[AC_ERROR([\"udev support requested but libudev not installed\"])])\n\t\t\tAC_CHECK_LIB([udev], [udev_new], [], [AC_ERROR([\"udev support requested but libudev not installed\"])])\n\t\t\tAC_DEFINE(USE_UDEV, 1, [Use udev for device enumeration/hotplug])\n\t\telse\n\t\t\tAC_CHECK_HEADERS([asm/types.h sys/socket.h], [], [])\n\t\t\tAC_CHECK_HEADERS([linux/netlink.h linux/filter.h], [], [AC_ERROR([\"Linux netlink headers not found\"])], [\n#ifdef HAVE_ASM_TYPES_H\n#include <asm/types.h>\n#endif\n#ifdef HAVE_SYS_SOCKET_H\n#include <sys/socket.h>\n#endif\n])\n\t\tfi\n\t\tAC_SUBST(USE_UDEV)\n\ncase $is_backend_android in\nyes)\n\tdnl some pthread functions is in libc\n\tTHREAD_CFLAGS=\"-c\"\n\tLIBS=\"${LIBS} -c\"\n\tdnl there are gettimeofday function but configure doesn't seem to be able to find it.\n\tAC_DEFINE([HAVE_GETTIMEOFDAY], [1], [Define if you have gettimeofday])\n\t;;\n*)\n\tTHREAD_CFLAGS=\"-pthread\"\n\tLIBS=\"${LIBS} -pthread\"\nesac\n\n\tAC_CHECK_HEADERS([poll.h])\n\tAC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])\n\t;;\ndarwin)\n\tAC_DEFINE(OS_DARWIN, 1, [Darwin backend])\n\tAC_SUBST(OS_DARWIN)\n\tLIBS=\"-lobjc -Wl,-framework,IOKit -Wl,-framework,CoreFoundation\"\n\tLTLDFLAGS=\"${LTLDFLAGS} -Wl,-prebind\"\n\tAC_CHECK_HEADERS([poll.h])\n\tAC_CHECK_TYPE([nfds_t],\n\t\t[AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])],\n\t\t[AC_DEFINE([POLL_NFDS_TYPE],[unsigned int],[type of second poll() argument])],\n\t\t[#include <poll.h>])\n\t;;\nopenbsd)\n\tAC_DEFINE(OS_OPENBSD, 1, [OpenBSD backend])\n\tAC_SUBST(OS_OPENBSD)\n\tTHREAD_CFLAGS=\"-pthread\"\n\tLIBS=\"-pthread\"\n\tAC_CHECK_HEADERS([poll.h])\n\tAC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])\n\t;;\nnetbsd)\n\tAC_DEFINE(OS_NETBSD, 1, [NetBSD backend])\n\tAC_SUBST(OS_NETBSD)\n\tTHREAD_CFLAGS=\"-pthread\"\n\tLIBS=\"-pthread\"\n\tAC_CHECK_HEADERS([poll.h])\n\tAC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])\n\t;;\nwindows)\n\tAC_DEFINE(OS_WINDOWS, 1, [Windows backend])\n\tAC_SUBST(OS_WINDOWS)\n\tLIBS=\"\"\n\tLTLDFLAGS=\"${LTLDFLAGS} -avoid-version -Wl,--add-stdcall-alias\"\n\tAC_DEFINE([POLL_NFDS_TYPE],[unsigned int],[type of second poll() argument])\n\t;;\nesac\n\nAC_SUBST(LIBS)\n\nAM_CONDITIONAL(OS_LINUX, test \"x$backend\" = xlinux)\nAM_CONDITIONAL(OS_DARWIN, test \"x$backend\" = xdarwin)\nAM_CONDITIONAL(OS_OPENBSD, test \"x$backend\" = xopenbsd)\nAM_CONDITIONAL(OS_NETBSD, test \"x$backend\" = xnetbsd)\nAM_CONDITIONAL(OS_WINDOWS, test \"x$backend\" = xwindows)\nAM_CONDITIONAL(THREADS_POSIX, test \"x$threads\" = xposix)\nAM_CONDITIONAL(CREATE_IMPORT_LIB, test \"x$create_import_lib\" = \"xyes\")\nAM_CONDITIONAL(USE_UDEV, test \"x$enable_udev\" = xyes)\nif test \"$threads\" = posix; then\n\tAC_DEFINE(THREADS_POSIX, 1, [Use POSIX Threads])\nfi\n\n# timerfd\nAC_CHECK_HEADER([sys/timerfd.h], [timerfd_h=1], [timerfd_h=0])\nAC_ARG_ENABLE([timerfd],\n\t[AS_HELP_STRING([--enable-timerfd],\n\t\t[use timerfd for timing [default=auto]])],\n\t[use_timerfd=$enableval], [use_timerfd='auto'])\n\nif test \"x$use_timerfd\" = \"xyes\" -a \"x$timerfd_h\" = \"x0\"; then\n\tAC_MSG_ERROR([timerfd header not available; glibc 2.9+ required])\nfi\n\nAC_CHECK_DECL([TFD_NONBLOCK], [tfd_hdr_ok=yes], [tfd_hdr_ok=no], [#include <sys/timerfd.h>])\nif test \"x$use_timerfd\" = \"xyes\" -a \"x$tfd_hdr_ok\" = \"xno\"; then\n\tAC_MSG_ERROR([timerfd header not usable; glibc 2.9+ required])\nfi\n\nAC_MSG_CHECKING([whether to use timerfd for timing])\nif test \"x$use_timerfd\" = \"xno\"; then\n\tAC_MSG_RESULT([no (disabled by user)])\nelse\n\tif test \"x$timerfd_h\" = \"x1\" -a \"x$tfd_hdr_ok\" = \"xyes\"; then\n\t\tAC_MSG_RESULT([yes])\n\t\tAC_DEFINE(USBI_TIMERFD_AVAILABLE, 1, [timerfd headers available])\n\telse\n\t\tAC_MSG_RESULT([no (header not available)])\n\tfi\nfi\n\nAC_CHECK_TYPES(struct timespec)\n\n# Message logging\nAC_ARG_ENABLE([log], [AS_HELP_STRING([--disable-log], [disable all logging])],\n\t[log_enabled=$enableval],\n\t[log_enabled='yes'])\nif test \"x$log_enabled\" != \"xno\"; then\n\tAC_DEFINE([ENABLE_LOGGING], 1, [Message logging])\nfi\n\nAC_ARG_ENABLE([debug-log], [AS_HELP_STRING([--enable-debug-log],\n\t[start with debug message logging enabled [default=no]])],\n\t[debug_log_enabled=$enableval],\n\t[debug_log_enabled='no'])\nif test \"x$debug_log_enabled\" != \"xno\"; then\n\tAC_DEFINE([ENABLE_DEBUG_LOGGING], 1, [Start with debug message logging enabled])\nfi\n\nAC_ARG_ENABLE([system-log], [AS_HELP_STRING([--enable-system-log],\n\t[output logging messages to system wide log, if supported by the OS [default=no]])],\n\t[system_log_enabled=$enableval],\n\t[system_log_enabled='no'])\nif test \"x$system_log_enabled\" != \"xno\"; then\n\tAC_DEFINE([USE_SYSTEM_LOGGING_FACILITY], 1, [Enable output to system log])\nfi\n\n# Check if syslog is available in standard C library\nAC_CHECK_HEADERS(syslog.h)\nAC_CHECK_FUNC([syslog], [have_syslog=yes], [have_syslog=no])\nif test \"x$have_syslog\" != \"xno\"; then\n\tAC_DEFINE([HAVE_SYSLOG_FUNC], 1, [syslog() function available])\nfi\n\n# Examples build\nAC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build],\n\t[build example applications [default=no]])],\n\t[build_examples=$enableval],\n\t[build_examples='no'])\nAM_CONDITIONAL([BUILD_EXAMPLES], [test \"x$build_examples\" != \"xno\"])\n\n# Tests build\nAC_ARG_ENABLE([tests-build], [AS_HELP_STRING([--enable-tests-build],\n\t[build test applications [default=no]])],\n\t[build_tests=$enableval],\n\t[build_tests='no'])\nAM_CONDITIONAL([BUILD_TESTS], [test \"x$build_tests\" != \"xno\"])\n\n# check for -fvisibility=hidden compiler support (GCC >= 3.4)\nsaved_cflags=\"$CFLAGS\"\n# -Werror required for cygwin\nCFLAGS=\"$CFLAGS -Werror -fvisibility=hidden\"\nAC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],\n\t[VISIBILITY_CFLAGS=\"-fvisibility=hidden\"\n\t AC_DEFINE([DEFAULT_VISIBILITY], [__attribute__((visibility(\"default\")))], [Default visibility]) ],\n\t[ VISIBILITY_CFLAGS=\"\"\n\t AC_DEFINE([DEFAULT_VISIBILITY], [], [Default visibility]) ],\n\t])\nCFLAGS=\"$saved_cflags\"\n\n# check for -Wno-pointer-sign compiler support (GCC >= 4)\nsaved_cflags=\"$CFLAGS\"\nCFLAGS=\"$CFLAGS -Wno-pointer-sign\"\nAC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],\n\tnopointersign_cflags=\"-Wno-pointer-sign\", nopointersign_cflags=\"\")\nCFLAGS=\"$saved_cflags\"\n\n# sigaction not available on MinGW\nAC_CHECK_FUNC([sigaction], [have_sigaction=yes], [have_sigaction=no])\nAM_CONDITIONAL([HAVE_SIGACTION], [test \"x$have_sigaction\" = \"xyes\"])\n\n# headers not available on all platforms but required on others\nAC_CHECK_HEADERS([sys/time.h])\nAC_CHECK_FUNCS(gettimeofday)\nAC_CHECK_HEADERS([signal.h])\n\nAM_CFLAGS=\"${AM_CFLAGS} -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow ${THREAD_CFLAGS} ${VISIBILITY_CFLAGS}\"\n\nAC_SUBST(AM_CFLAGS)\nAC_SUBST(LTLDFLAGS)\n\nAC_CONFIG_FILES([libusb-1.0.pc])\nAC_CONFIG_FILES([Makefile])\nAC_CONFIG_FILES([libusb/Makefile])\nAC_CONFIG_FILES([examples/Makefile])\nAC_CONFIG_FILES([tests/Makefile])\nAC_CONFIG_FILES([doc/Makefile])\nAC_CONFIG_FILES([doc/doxygen.cfg])\nAC_OUTPUT\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/doc/Makefile.am",
    "content": "EXTRA_DIST = doxygen.cfg.in\n\ndocs: doxygen.cfg\n\tdoxygen $^\n\ndocs-upload: docs\n\tln -s html api-1.0\n\tscp -r api-1.0 pbatard@web.sourceforge.net:/home/project-web/libusb/htdocs\n\trm -f api-1.0\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/doc/doxygen.cfg.in",
    "content": "# Doxyfile 1.5.3\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) for a project\n#\n# All text after a hash (#) is considered a comment and will be ignored\n# The format is:\n#       TAG = value [value, ...]\n# For lists items can also be appended using:\n#       TAG += value [value, ...]\n# Values that contain spaces should be placed between quotes (\" \")\n\n#---------------------------------------------------------------------------\n# Project related configuration options\n#---------------------------------------------------------------------------\n\n# This tag specifies the encoding used for all characters in the config file that \n# follow. The default is UTF-8 which is also the encoding used for all text before \n# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into \n# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of \n# possible encodings.\n\nDOXYFILE_ENCODING      = UTF-8\n\n# The PROJECT_NAME tag is a single word (or a sequence of words surrounded \n# by quotes) that should identify the project.\n\nPROJECT_NAME           =\n\n# The PROJECT_NUMBER tag can be used to enter a project or revision number. \n# This could be handy for archiving the generated documentation or \n# if some version control system is used.\n\nPROJECT_NUMBER         =\n\n# Using the PROJECT_BRIEF tag one can provide an optional one line description\n# for a project that appears at the top of each page and should give viewer a\n# quick idea about the purpose of the project. Keep the description short.\n\nPROJECT_BRIEF          = \"A cross-platform user library to access USB devices\"\n\n# With the PROJECT_LOGO tag one can specify an logo or icon that is included\n# in the documentation. The maximum height of the logo should not exceed 55\n# pixels and the maximum width should not exceed 200 pixels. Doxygen will\n# copy the logo to the output directory.\n\nPROJECT_LOGO           = libusb.png\n\n# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) \n# base path where the generated documentation will be put. \n# If a relative path is entered, it will be relative to the location \n# where doxygen was started. If left blank the current directory will be used.\n\nOUTPUT_DIRECTORY       = \n\n# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create \n# 4096 sub-directories (in 2 levels) under the output directory of each output \n# format and will distribute the generated files over these directories. \n# Enabling this option can be useful when feeding doxygen a huge amount of \n# source files, where putting all generated files in the same directory would \n# otherwise cause performance problems for the file system.\n\nCREATE_SUBDIRS         = NO\n\n# The OUTPUT_LANGUAGE tag is used to specify the language in which all \n# documentation generated by doxygen is written. Doxygen will use this \n# information to generate all constant output in the proper language. \n# The default language is English, other supported languages are: \n# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, \n# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, \n# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, \n# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, \n# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.\n\nOUTPUT_LANGUAGE        = English\n\n# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will \n# include brief member descriptions after the members that are listed in \n# the file and class documentation (similar to JavaDoc). \n# Set to NO to disable this.\n\nBRIEF_MEMBER_DESC      = YES\n\n# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend \n# the brief description of a member or function before the detailed description. \n# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the \n# brief descriptions will be completely suppressed.\n\nREPEAT_BRIEF           = YES\n\n# This tag implements a quasi-intelligent brief description abbreviator \n# that is used to form the text in various listings. Each string \n# in this list, if found as the leading text of the brief description, will be \n# stripped from the text and the result after processing the whole list, is \n# used as the annotated text. Otherwise, the brief description is used as-is. \n# If left blank, the following values are used (\"$name\" is automatically \n# replaced with the name of the entity): \"The $name class\" \"The $name widget\" \n# \"The $name file\" \"is\" \"provides\" \"specifies\" \"contains\" \n# \"represents\" \"a\" \"an\" \"the\"\n\nABBREVIATE_BRIEF       = \n\n# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then \n# Doxygen will generate a detailed section even if there is only a brief \n# description.\n\nALWAYS_DETAILED_SEC    = NO\n\n# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all \n# inherited members of a class in the documentation of that class as if those \n# members were ordinary class members. Constructors, destructors and assignment \n# operators of the base classes will not be shown.\n\nINLINE_INHERITED_MEMB  = NO\n\n# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full \n# path before files name in the file list and in the header files. If set \n# to NO the shortest path that makes the file name unique will be used.\n\nFULL_PATH_NAMES        = NO\n\n# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag \n# can be used to strip a user-defined part of the path. Stripping is \n# only done if one of the specified strings matches the left-hand part of \n# the path. The tag can be used to show relative paths in the file list. \n# If left blank the directory from which doxygen is run is used as the \n# path to strip.\n\nSTRIP_FROM_PATH        = \n\n# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of \n# the path mentioned in the documentation of a class, which tells \n# the reader which header file to include in order to use a class. \n# If left blank only the name of the header file containing the class \n# definition is used. Otherwise one should specify the include paths that \n# are normally passed to the compiler using the -I flag.\n\nSTRIP_FROM_INC_PATH    = \n\n# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter \n# (but less readable) file names. This can be useful is your file systems \n# doesn't support long names like on DOS, Mac, or CD-ROM.\n\nSHORT_NAMES            = NO\n\n# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen \n# will interpret the first line (until the first dot) of a JavaDoc-style \n# comment as the brief description. If set to NO, the JavaDoc \n# comments will behave just like regular Qt-style comments \n# (thus requiring an explicit @brief command for a brief description.)\n\nJAVADOC_AUTOBRIEF      = YES\n\n# If the QT_AUTOBRIEF tag is set to YES then Doxygen will \n# interpret the first line (until the first dot) of a Qt-style \n# comment as the brief description. If set to NO, the comments \n# will behave just like regular Qt-style comments (thus requiring \n# an explicit \\brief command for a brief description.)\n\nQT_AUTOBRIEF           = NO\n\n# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen \n# treat a multi-line C++ special comment block (i.e. a block of //! or /// \n# comments) as a brief description. This used to be the default behaviour. \n# The new default is to treat a multi-line C++ comment block as a detailed \n# description. Set this tag to YES if you prefer the old behaviour instead.\n\nMULTILINE_CPP_IS_BRIEF = NO\n\n# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented \n# member inherits the documentation from any documented member that it \n# re-implements.\n\nINHERIT_DOCS           = YES\n\n# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce \n# a new page for each member. If set to NO, the documentation of a member will \n# be part of the file/class/namespace that contains it.\n\nSEPARATE_MEMBER_PAGES  = NO\n\n# The TAB_SIZE tag can be used to set the number of spaces in a tab. \n# Doxygen uses this value to replace tabs by spaces in code fragments.\n\nTAB_SIZE               = 4\n\n# This tag can be used to specify a number of aliases that acts \n# as commands in the documentation. An alias has the form \"name=value\". \n# For example adding \"sideeffect=\\par Side Effects:\\n\" will allow you to \n# put the command \\sideeffect (or @sideeffect) in the documentation, which \n# will result in a user-defined paragraph with heading \"Side Effects:\". \n# You can put \\n's in the value part of an alias to insert newlines.\n\nALIASES                = \n\n# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C \n# sources only. Doxygen will then generate output that is more tailored for C. \n# For instance, some of the names that are used will be different. The list \n# of all members will be omitted, etc.\n\nOPTIMIZE_OUTPUT_FOR_C  = YES\n\n# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java \n# sources only. Doxygen will then generate output that is more tailored for Java. \n# For instance, namespaces will be presented as packages, qualified scopes \n# will look different, etc.\n\nOPTIMIZE_OUTPUT_JAVA   = NO\n\n# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to \n# include (a tag file for) the STL sources as input, then you should \n# set this tag to YES in order to let doxygen match functions declarations and \n# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. \n# func(std::string) {}). This also make the inheritance and collaboration \n# diagrams that involve STL classes more complete and accurate.\n\nBUILTIN_STL_SUPPORT    = NO\n\n# If you use Microsoft's C++/CLI language, you should set this option to YES to\n# enable parsing support.\n\nCPP_CLI_SUPPORT        = NO\n\n# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC \n# tag is set to YES, then doxygen will reuse the documentation of the first \n# member in the group (if any) for the other members of the group. By default \n# all members of a group must be documented explicitly.\n\nDISTRIBUTE_GROUP_DOC   = NO\n\n# Set the SUBGROUPING tag to YES (the default) to allow class member groups of \n# the same type (for instance a group of public functions) to be put as a \n# subgroup of that type (e.g. under the Public Functions section). Set it to \n# NO to prevent subgrouping. Alternatively, this can be done per class using \n# the \\nosubgrouping command.\n\nSUBGROUPING            = YES\n\n#---------------------------------------------------------------------------\n# Build related configuration options\n#---------------------------------------------------------------------------\n\n# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in \n# documentation are documented, even if no documentation was available. \n# Private class members and static file members will be hidden unless \n# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES\n\nEXTRACT_ALL            = NO\n\n# If the EXTRACT_PRIVATE tag is set to YES all private members of a class \n# will be included in the documentation.\n\nEXTRACT_PRIVATE        = NO\n\n# If the EXTRACT_STATIC tag is set to YES all static members of a file \n# will be included in the documentation.\n\nEXTRACT_STATIC         = YES\n\n# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) \n# defined locally in source files will be included in the documentation. \n# If set to NO only classes defined in header files are included.\n\nEXTRACT_LOCAL_CLASSES  = YES\n\n# This flag is only useful for Objective-C code. When set to YES local \n# methods, which are defined in the implementation section but not in \n# the interface are included in the documentation. \n# If set to NO (the default) only methods in the interface are included.\n\nEXTRACT_LOCAL_METHODS  = NO\n\n# If this flag is set to YES, the members of anonymous namespaces will be extracted \n# and appear in the documentation as a namespace called 'anonymous_namespace{file}', \n# where file will be replaced with the base name of the file that contains the anonymous \n# namespace. By default anonymous namespace are hidden.\n\nEXTRACT_ANON_NSPACES   = NO\n\n# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all \n# undocumented members of documented classes, files or namespaces. \n# If set to NO (the default) these members will be included in the \n# various overviews, but no documentation section is generated. \n# This option has no effect if EXTRACT_ALL is enabled.\n\nHIDE_UNDOC_MEMBERS     = NO\n\n# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all \n# undocumented classes that are normally visible in the class hierarchy. \n# If set to NO (the default) these classes will be included in the various \n# overviews. This option has no effect if EXTRACT_ALL is enabled.\n\nHIDE_UNDOC_CLASSES     = NO\n\n# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all \n# friend (class|struct|union) declarations. \n# If set to NO (the default) these declarations will be included in the \n# documentation.\n\nHIDE_FRIEND_COMPOUNDS  = NO\n\n# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any \n# documentation blocks found inside the body of a function. \n# If set to NO (the default) these blocks will be appended to the \n# function's detailed documentation block.\n\nHIDE_IN_BODY_DOCS      = NO\n\n# The INTERNAL_DOCS tag determines if documentation \n# that is typed after a \\internal command is included. If the tag is set \n# to NO (the default) then the documentation will be excluded. \n# Set it to YES to include the internal documentation.\n\nINTERNAL_DOCS          = NO\n\n# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate \n# file names in lower-case letters. If set to YES upper-case letters are also \n# allowed. This is useful if you have classes or files whose names only differ \n# in case and if your file system supports case sensitive file names. Windows \n# and Mac users are advised to set this option to NO.\n\nCASE_SENSE_NAMES       = YES\n\n# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen \n# will show members with their full class and namespace scopes in the \n# documentation. If set to YES the scope will be hidden.\n\nHIDE_SCOPE_NAMES       = NO\n\n# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen \n# will put a list of the files that are included by a file in the documentation \n# of that file.\n\nSHOW_INCLUDE_FILES     = YES\n\n# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] \n# is inserted in the documentation for inline members.\n\nINLINE_INFO            = YES\n\n# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen \n# will sort the (detailed) documentation of file and class members \n# alphabetically by member name. If set to NO the members will appear in \n# declaration order.\n\nSORT_MEMBER_DOCS       = NO\n\n# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the \n# brief documentation of file, namespace and class members alphabetically \n# by member name. If set to NO (the default) the members will appear in \n# declaration order.\n\nSORT_BRIEF_DOCS        = NO\n\n# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be \n# sorted by fully-qualified names, including namespaces. If set to \n# NO (the default), the class list will be sorted only by class name, \n# not including the namespace part. \n# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.\n# Note: This option applies only to the class list, not to the \n# alphabetical list.\n\nSORT_BY_SCOPE_NAME     = NO\n\n# The GENERATE_TODOLIST tag can be used to enable (YES) or \n# disable (NO) the todo list. This list is created by putting \\todo \n# commands in the documentation.\n\nGENERATE_TODOLIST      = YES\n\n# The GENERATE_TESTLIST tag can be used to enable (YES) or \n# disable (NO) the test list. This list is created by putting \\test \n# commands in the documentation.\n\nGENERATE_TESTLIST      = YES\n\n# The GENERATE_BUGLIST tag can be used to enable (YES) or \n# disable (NO) the bug list. This list is created by putting \\bug \n# commands in the documentation.\n\nGENERATE_BUGLIST       = YES\n\n# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or \n# disable (NO) the deprecated list. This list is created by putting \n# \\deprecated commands in the documentation.\n\nGENERATE_DEPRECATEDLIST= YES\n\n# The ENABLED_SECTIONS tag can be used to enable conditional \n# documentation sections, marked by \\if sectionname ... \\endif.\n\nENABLED_SECTIONS       = \n\n# The MAX_INITIALIZER_LINES tag determines the maximum number of lines \n# the initial value of a variable or define consists of for it to appear in \n# the documentation. If the initializer consists of more lines than specified \n# here it will be hidden. Use a value of 0 to hide initializers completely. \n# The appearance of the initializer of individual variables and defines in the \n# documentation can be controlled using \\showinitializer or \\hideinitializer \n# command in the documentation regardless of this setting.\n\nMAX_INITIALIZER_LINES  = 30\n\n# Set the SHOW_USED_FILES tag to NO to disable the list of files generated \n# at the bottom of the documentation of classes and structs. If set to YES the \n# list will mention the files that were used to generate the documentation.\n\nSHOW_USED_FILES        = YES\n\n# The FILE_VERSION_FILTER tag can be used to specify a program or script that \n# doxygen should invoke to get the current version for each file (typically from the \n# version control system). Doxygen will invoke the program by executing (via \n# popen()) the command <command> <input-file>, where <command> is the value of \n# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file \n# provided by doxygen. Whatever the program writes to standard output \n# is used as the file version. See the manual for examples.\n\nFILE_VERSION_FILTER    = \n\n#---------------------------------------------------------------------------\n# configuration options related to warning and progress messages\n#---------------------------------------------------------------------------\n\n# The QUIET tag can be used to turn on/off the messages that are generated \n# by doxygen. Possible values are YES and NO. If left blank NO is used.\n\nQUIET                  = YES\n\n# The WARNINGS tag can be used to turn on/off the warning messages that are \n# generated by doxygen. Possible values are YES and NO. If left blank \n# NO is used.\n\nWARNINGS               = YES\n\n# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings \n# for undocumented members. If EXTRACT_ALL is set to YES then this flag will \n# automatically be disabled.\n\nWARN_IF_UNDOCUMENTED   = YES\n\n# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for \n# potential errors in the documentation, such as not documenting some \n# parameters in a documented function, or documenting parameters that \n# don't exist or using markup commands wrongly.\n\nWARN_IF_DOC_ERROR      = YES\n\n# This WARN_NO_PARAMDOC option can be abled to get warnings for \n# functions that are documented, but have no documentation for their parameters \n# or return value. If set to NO (the default) doxygen will only warn about \n# wrong or incomplete parameter documentation, but not about the absence of \n# documentation.\n\nWARN_NO_PARAMDOC       = NO\n\n# The WARN_FORMAT tag determines the format of the warning messages that \n# doxygen can produce. The string should contain the $file, $line, and $text \n# tags, which will be replaced by the file and line number from which the \n# warning originated and the warning text. Optionally the format may contain \n# $version, which will be replaced by the version of the file (if it could \n# be obtained via FILE_VERSION_FILTER)\n\nWARN_FORMAT            = \"$file:$line: $text\"\n\n# The WARN_LOGFILE tag can be used to specify a file to which warning \n# and error messages should be written. If left blank the output is written \n# to stderr.\n\nWARN_LOGFILE           = \n\n#---------------------------------------------------------------------------\n# configuration options related to the input files\n#---------------------------------------------------------------------------\n\n# The INPUT tag can be used to specify the files and/or directories that contain \n# documented source files. You may enter file names like \"myfile.cpp\" or \n# directories like \"/usr/src/myproject\". Separate the files or directories \n# with spaces.\n\nINPUT                  = @top_srcdir@/libusb\n\n# This tag can be used to specify the character encoding of the source files that \n# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default \n# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. \n# See http://www.gnu.org/software/libiconv for the list of possible encodings.\n\nINPUT_ENCODING         = UTF-8\n\n# If the value of the INPUT tag contains directories, you can use the \n# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp \n# and *.h) to filter out the source-files in the directories. If left \n# blank the following patterns are tested: \n# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx \n# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py\n\nFILE_PATTERNS          = \n\n# The RECURSIVE tag can be used to turn specify whether or not subdirectories \n# should be searched for input files as well. Possible values are YES and NO. \n# If left blank NO is used.\n\nRECURSIVE              = NO\n\n# The EXCLUDE tag can be used to specify files and/or directories that should \n# excluded from the INPUT source files. This way you can easily exclude a \n# subdirectory from a directory tree whose root is specified with the INPUT tag.\n\nEXCLUDE                = @top_srcdir@/libusb/libusbi.h @top_srcdir@/libusb/hotplug.h\n\n# The EXCLUDE_SYMLINKS tag can be used select whether or not files or \n# directories that are symbolic links (a Unix filesystem feature) are excluded \n# from the input.\n\nEXCLUDE_SYMLINKS       = NO\n\n# If the value of the INPUT tag contains directories, you can use the \n# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude \n# certain files from those directories. Note that the wildcards are matched \n# against the file with absolute path, so to exclude all test directories \n# for example use the pattern */test/*\n\nEXCLUDE_PATTERNS       = \n\n# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names \n# (namespaces, classes, functions, etc.) that should be excluded from the output. \n# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, \n# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test\n\nEXCLUDE_SYMBOLS        = \n\n# The EXAMPLE_PATH tag can be used to specify one or more files or \n# directories that contain example code fragments that are included (see \n# the \\include command).\n\nEXAMPLE_PATH           = \n\n# If the value of the EXAMPLE_PATH tag contains directories, you can use the \n# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp \n# and *.h) to filter out the source-files in the directories. If left \n# blank all files are included.\n\nEXAMPLE_PATTERNS       = \n\n# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be \n# searched for input files to be used with the \\include or \\dontinclude \n# commands irrespective of the value of the RECURSIVE tag. \n# Possible values are YES and NO. If left blank NO is used.\n\nEXAMPLE_RECURSIVE      = NO\n\n# The IMAGE_PATH tag can be used to specify one or more files or \n# directories that contain image that are included in the documentation (see \n# the \\image command).\n\nIMAGE_PATH             = \n\n# The INPUT_FILTER tag can be used to specify a program that doxygen should \n# invoke to filter for each input file. Doxygen will invoke the filter program \n# by executing (via popen()) the command <filter> <input-file>, where <filter> \n# is the value of the INPUT_FILTER tag, and <input-file> is the name of an \n# input file. Doxygen will then use the output that the filter program writes \n# to standard output.  If FILTER_PATTERNS is specified, this tag will be \n# ignored.\n\nINPUT_FILTER           = \n\n# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern \n# basis.  Doxygen will compare the file name with each pattern and apply the \n# filter if there is a match.  The filters are a list of the form: \n# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further \n# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER \n# is applied to all files.\n\nFILTER_PATTERNS        = \n\n# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using \n# INPUT_FILTER) will be used to filter the input files when producing source \n# files to browse (i.e. when SOURCE_BROWSER is set to YES).\n\nFILTER_SOURCE_FILES    = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to source browsing\n#---------------------------------------------------------------------------\n\n# If the SOURCE_BROWSER tag is set to YES then a list of source files will \n# be generated. Documented entities will be cross-referenced with these sources. \n# Note: To get rid of all source code in the generated output, make sure also \n# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH \n# then you must also enable this option. If you don't then doxygen will produce \n# a warning and turn it on anyway\n\nSOURCE_BROWSER         = NO\n\n# Setting the INLINE_SOURCES tag to YES will include the body \n# of functions and classes directly in the documentation.\n\nINLINE_SOURCES         = NO\n\n# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct \n# doxygen to hide any special comment blocks from generated source code \n# fragments. Normal C and C++ comments will always remain visible.\n\nSTRIP_CODE_COMMENTS    = YES\n\n# If the REFERENCED_BY_RELATION tag is set to YES (the default) \n# then for each documented function all documented \n# functions referencing it will be listed.\n\nREFERENCED_BY_RELATION = NO\n\n# If the REFERENCES_RELATION tag is set to YES (the default) \n# then for each documented function all documented entities \n# called/used by that function will be listed.\n\nREFERENCES_RELATION    = NO\n\n# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)\n# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from\n# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will\n# link to the source code.  Otherwise they will link to the documentstion.\n\nREFERENCES_LINK_SOURCE = YES\n\n# If the USE_HTAGS tag is set to YES then the references to source code \n# will point to the HTML generated by the htags(1) tool instead of doxygen \n# built-in source browser. The htags tool is part of GNU's global source \n# tagging system (see http://www.gnu.org/software/global/global.html). You \n# will need version 4.8.6 or higher.\n\nUSE_HTAGS              = NO\n\n# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen \n# will generate a verbatim copy of the header file for each class for \n# which an include is specified. Set to NO to disable this.\n\nVERBATIM_HEADERS       = YES\n\n#---------------------------------------------------------------------------\n# configuration options related to the alphabetical class index\n#---------------------------------------------------------------------------\n\n# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index \n# of all compounds will be generated. Enable this if the project \n# contains a lot of classes, structs, unions or interfaces.\n\nALPHABETICAL_INDEX     = YES\n\n# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then \n# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns \n# in which this list will be split (can be a number in the range [1..20])\n\nCOLS_IN_ALPHA_INDEX    = 5\n\n# In case all classes in a project start with a common prefix, all \n# classes will be put under the same header in the alphabetical index. \n# The IGNORE_PREFIX tag can be used to specify one or more prefixes that \n# should be ignored while generating the index headers.\n\nIGNORE_PREFIX          = \n\n#---------------------------------------------------------------------------\n# configuration options related to the HTML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_HTML tag is set to YES (the default) Doxygen will \n# generate HTML output.\n\nGENERATE_HTML          = YES\n\n# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `html' will be used as the default path.\n\nHTML_OUTPUT            = html\n\n# The HTML_FILE_EXTENSION tag can be used to specify the file extension for \n# each generated HTML page (for example: .htm,.php,.asp). If it is left blank \n# doxygen will generate files with .html extension.\n\nHTML_FILE_EXTENSION    = .html\n\n# The HTML_HEADER tag can be used to specify a personal HTML header for \n# each generated HTML page. If it is left blank doxygen will generate a \n# standard header.\n\nHTML_HEADER            = \n\n# The HTML_FOOTER tag can be used to specify a personal HTML footer for \n# each generated HTML page. If it is left blank doxygen will generate a \n# standard footer.\n\nHTML_FOOTER            = \n\n# The HTML_STYLESHEET tag can be used to specify a user-defined cascading \n# style sheet that is used by each HTML page. It can be used to \n# fine-tune the look of the HTML output. If the tag is left blank doxygen \n# will generate a default style sheet. Note that doxygen will try to copy \n# the style sheet file to the HTML output directory, so don't put your own \n# stylesheet in the HTML output directory as well, or it will be erased!\n\nHTML_STYLESHEET        = \n\n# If the GENERATE_HTMLHELP tag is set to YES, additional index files \n# will be generated that can be used as input for tools like the \n# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) \n# of the generated HTML documentation.\n\nGENERATE_HTMLHELP      = NO\n\n# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML \n# documentation will contain sections that can be hidden and shown after the \n# page has loaded. For this to work a browser that supports \n# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox \n# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).\n\nHTML_DYNAMIC_SECTIONS  = YES\n\n# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can \n# be used to specify the file name of the resulting .chm file. You \n# can add a path in front of the file if the result should not be \n# written to the html output directory.\n\nCHM_FILE               = \n\n# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can \n# be used to specify the location (absolute path including file name) of \n# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run \n# the HTML help compiler on the generated index.hhp.\n\nHHC_LOCATION           = \n\n# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag \n# controls if a separate .chi index file is generated (YES) or that \n# it should be included in the master .chm file (NO).\n\nGENERATE_CHI           = NO\n\n# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag \n# controls whether a binary table of contents is generated (YES) or a \n# normal table of contents (NO) in the .chm file.\n\nBINARY_TOC             = NO\n\n# The TOC_EXPAND flag can be set to YES to add extra items for group members \n# to the contents of the HTML help documentation and to the tree view.\n\nTOC_EXPAND             = NO\n\n# The DISABLE_INDEX tag can be used to turn on/off the condensed index at \n# top of each HTML page. The value NO (the default) enables the index and \n# the value YES disables it.\n\nDISABLE_INDEX          = NO\n\n# This tag can be used to set the number of enum values (range [1..20]) \n# that doxygen will group on one line in the generated HTML documentation.\n\nENUM_VALUES_PER_LINE   = 4\n\n# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be\n# generated containing a tree-like index structure (just like the one that \n# is generated for HTML Help). For this to work a browser that supports \n# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, \n# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are \n# probably better off using the HTML help feature.\n\nGENERATE_TREEVIEW      = NO\n\n# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be \n# used to set the initial width (in pixels) of the frame in which the tree \n# is shown.\n\nTREEVIEW_WIDTH         = 250\n\n#---------------------------------------------------------------------------\n# configuration options related to the LaTeX output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will \n# generate Latex output.\n\nGENERATE_LATEX         = NO\n\n# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `latex' will be used as the default path.\n\nLATEX_OUTPUT           = latex\n\n# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be \n# invoked. If left blank `latex' will be used as the default command name.\n\nLATEX_CMD_NAME         = latex\n\n# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to \n# generate index for LaTeX. If left blank `makeindex' will be used as the \n# default command name.\n\nMAKEINDEX_CMD_NAME     = makeindex\n\n# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact \n# LaTeX documents. This may be useful for small projects and may help to \n# save some trees in general.\n\nCOMPACT_LATEX          = NO\n\n# The PAPER_TYPE tag can be used to set the paper type that is used \n# by the printer. Possible values are: a4, a4wide, letter, legal and \n# executive. If left blank a4wide will be used.\n\nPAPER_TYPE             = a4wide\n\n# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX \n# packages that should be included in the LaTeX output.\n\nEXTRA_PACKAGES         = \n\n# The LATEX_HEADER tag can be used to specify a personal LaTeX header for \n# the generated latex document. The header should contain everything until \n# the first chapter. If it is left blank doxygen will generate a \n# standard header. Notice: only use this tag if you know what you are doing!\n\nLATEX_HEADER           = \n\n# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated \n# is prepared for conversion to pdf (using ps2pdf). The pdf file will \n# contain links (just like the HTML output) instead of page references \n# This makes the output suitable for online browsing using a pdf viewer.\n\nPDF_HYPERLINKS         = NO\n\n# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of \n# plain latex in the generated Makefile. Set this option to YES to get a \n# higher quality PDF documentation.\n\nUSE_PDFLATEX           = NO\n\n# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\\\batchmode. \n# command to the generated LaTeX files. This will instruct LaTeX to keep \n# running if errors occur, instead of asking the user for help. \n# This option is also used when generating formulas in HTML.\n\nLATEX_BATCHMODE        = NO\n\n# If LATEX_HIDE_INDICES is set to YES then doxygen will not \n# include the index chapters (such as File Index, Compound Index, etc.) \n# in the output.\n\nLATEX_HIDE_INDICES     = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to the RTF output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output \n# The RTF output is optimized for Word 97 and may not look very pretty with \n# other RTF readers or editors.\n\nGENERATE_RTF           = NO\n\n# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `rtf' will be used as the default path.\n\nRTF_OUTPUT             = rtf\n\n# If the COMPACT_RTF tag is set to YES Doxygen generates more compact \n# RTF documents. This may be useful for small projects and may help to \n# save some trees in general.\n\nCOMPACT_RTF            = NO\n\n# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated \n# will contain hyperlink fields. The RTF file will \n# contain links (just like the HTML output) instead of page references. \n# This makes the output suitable for online browsing using WORD or other \n# programs which support those fields. \n# Note: wordpad (write) and others do not support links.\n\nRTF_HYPERLINKS         = NO\n\n# Load stylesheet definitions from file. Syntax is similar to doxygen's \n# config file, i.e. a series of assignments. You only have to provide \n# replacements, missing definitions are set to their default value.\n\nRTF_STYLESHEET_FILE    = \n\n# Set optional variables used in the generation of an rtf document. \n# Syntax is similar to doxygen's config file.\n\nRTF_EXTENSIONS_FILE    = \n\n#---------------------------------------------------------------------------\n# configuration options related to the man page output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_MAN tag is set to YES (the default) Doxygen will \n# generate man pages\n\nGENERATE_MAN           = NO\n\n# The MAN_OUTPUT tag is used to specify where the man pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `man' will be used as the default path.\n\nMAN_OUTPUT             = man\n\n# The MAN_EXTENSION tag determines the extension that is added to \n# the generated man pages (default is the subroutine's section .3)\n\nMAN_EXTENSION          = .3\n\n# If the MAN_LINKS tag is set to YES and Doxygen generates man output, \n# then it will generate one additional man file for each entity \n# documented in the real man page(s). These additional files \n# only source the real man page, but without them the man command \n# would be unable to find the correct page. The default is NO.\n\nMAN_LINKS              = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to the XML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_XML tag is set to YES Doxygen will \n# generate an XML file that captures the structure of \n# the code including all documentation.\n\nGENERATE_XML           = NO\n\n# The XML_OUTPUT tag is used to specify where the XML pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `xml' will be used as the default path.\n\nXML_OUTPUT             = xml\n\n# The XML_SCHEMA tag can be used to specify an XML schema, \n# which can be used by a validating XML parser to check the \n# syntax of the XML files.\n\nXML_SCHEMA             = \n\n# The XML_DTD tag can be used to specify an XML DTD, \n# which can be used by a validating XML parser to check the \n# syntax of the XML files.\n\nXML_DTD                = \n\n# If the XML_PROGRAMLISTING tag is set to YES Doxygen will \n# dump the program listings (including syntax highlighting \n# and cross-referencing information) to the XML output. Note that \n# enabling this will significantly increase the size of the XML output.\n\nXML_PROGRAMLISTING     = YES\n\n#---------------------------------------------------------------------------\n# configuration options for the AutoGen Definitions output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will \n# generate an AutoGen Definitions (see autogen.sf.net) file \n# that captures the structure of the code including all \n# documentation. Note that this feature is still experimental \n# and incomplete at the moment.\n\nGENERATE_AUTOGEN_DEF   = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to the Perl module output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_PERLMOD tag is set to YES Doxygen will \n# generate a Perl module file that captures the structure of \n# the code including all documentation. Note that this \n# feature is still experimental and incomplete at the \n# moment.\n\nGENERATE_PERLMOD       = NO\n\n# If the PERLMOD_LATEX tag is set to YES Doxygen will generate \n# the necessary Makefile rules, Perl scripts and LaTeX code to be able \n# to generate PDF and DVI output from the Perl module output.\n\nPERLMOD_LATEX          = NO\n\n# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be \n# nicely formatted so it can be parsed by a human reader.  This is useful \n# if you want to understand what is going on.  On the other hand, if this \n# tag is set to NO the size of the Perl module output will be much smaller \n# and Perl will parse it just the same.\n\nPERLMOD_PRETTY         = YES\n\n# The names of the make variables in the generated doxyrules.make file \n# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. \n# This is useful so different doxyrules.make files included by the same \n# Makefile don't overwrite each other's variables.\n\nPERLMOD_MAKEVAR_PREFIX = \n\n#---------------------------------------------------------------------------\n# Configuration options related to the preprocessor   \n#---------------------------------------------------------------------------\n\n# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will \n# evaluate all C-preprocessor directives found in the sources and include \n# files.\n\nENABLE_PREPROCESSING   = YES\n\n# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro \n# names in the source code. If set to NO (the default) only conditional \n# compilation will be performed. Macro expansion can be done in a controlled \n# way by setting EXPAND_ONLY_PREDEF to YES.\n\nMACRO_EXPANSION        = YES\n\n# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES \n# then the macro expansion is limited to the macros specified with the \n# PREDEFINED and EXPAND_AS_DEFINED tags.\n\nEXPAND_ONLY_PREDEF     = YES\n\n# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files \n# in the INCLUDE_PATH (see below) will be search if a #include is found.\n\nSEARCH_INCLUDES        = YES\n\n# The INCLUDE_PATH tag can be used to specify one or more directories that \n# contain include files that are not input files but should be processed by \n# the preprocessor.\n\nINCLUDE_PATH           = \n\n# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard \n# patterns (like *.h and *.hpp) to filter out the header-files in the \n# directories. If left blank, the patterns specified with FILE_PATTERNS will \n# be used.\n\nINCLUDE_FILE_PATTERNS  = \n\n# The PREDEFINED tag can be used to specify one or more macro names that \n# are defined before the preprocessor is started (similar to the -D option of \n# gcc). The argument of the tag is a list of macros of the form: name \n# or name=definition (no spaces). If the definition and the = are \n# omitted =1 is assumed. To prevent a macro definition from being \n# undefined via #undef or recursively expanded use the := operator \n# instead of the = operator.\n\nPREDEFINED             = API_EXPORTED= LIBUSB_CALL= DEFAULT_VISIBILITY=\n\n# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then \n# this tag can be used to specify a list of macro names that should be expanded. \n# The macro definition that is found in the sources will be used. \n# Use the PREDEFINED tag if you want to use a different macro definition.\n\nEXPAND_AS_DEFINED      = \n\n# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then \n# doxygen's preprocessor will remove all function-like macros that are alone \n# on a line, have an all uppercase name, and do not end with a semicolon. Such \n# function macros are typically used for boiler-plate code, and will confuse \n# the parser if not removed.\n\nSKIP_FUNCTION_MACROS   = YES\n\n#---------------------------------------------------------------------------\n# Configuration::additions related to external references   \n#---------------------------------------------------------------------------\n\n# The TAGFILES option can be used to specify one or more tagfiles. \n# Optionally an initial location of the external documentation \n# can be added for each tagfile. The format of a tag file without \n# this location is as follows: \n#   TAGFILES = file1 file2 ... \n# Adding location for the tag files is done as follows: \n#   TAGFILES = file1=loc1 \"file2 = loc2\" ... \n# where \"loc1\" and \"loc2\" can be relative or absolute paths or \n# URLs. If a location is present for each tag, the installdox tool \n# does not have to be run to correct the links.\n# Note that each tag file must have a unique name\n# (where the name does NOT include the path)\n# If a tag file is not located in the directory in which doxygen \n# is run, you must also specify the path to the tagfile here.\n\nTAGFILES               = \n\n# When a file name is specified after GENERATE_TAGFILE, doxygen will create \n# a tag file that is based on the input files it reads.\n\nGENERATE_TAGFILE       = \n\n# If the ALLEXTERNALS tag is set to YES all external classes will be listed \n# in the class index. If set to NO only the inherited external classes \n# will be listed.\n\nALLEXTERNALS           = NO\n\n# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed \n# in the modules index. If set to NO, only the current project's groups will \n# be listed.\n\nEXTERNAL_GROUPS        = YES\n\n# The PERL_PATH should be the absolute path and name of the perl script \n# interpreter (i.e. the result of `which perl').\n\nPERL_PATH              = /usr/bin/perl\n\n#---------------------------------------------------------------------------\n# Configuration options related to the dot tool   \n#---------------------------------------------------------------------------\n\n# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will \n# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base \n# or super classes. Setting the tag to NO turns the diagrams off. Note that \n# this option is superseded by the HAVE_DOT option below. This is only a \n# fallback. It is recommended to install and use dot, since it yields more \n# powerful graphs.\n\nCLASS_DIAGRAMS         = YES\n\n# You can define message sequence charts within doxygen comments using the \\msc \n# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to \n# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to \n# specify the directory where the mscgen tool resides. If left empty the tool is assumed to \n# be found in the default search path.\n\nMSCGEN_PATH            = \n\n# If set to YES, the inheritance and collaboration graphs will hide \n# inheritance and usage relations if the target is undocumented \n# or is not a class.\n\nHIDE_UNDOC_RELATIONS   = YES\n\n# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is \n# available from the path. This tool is part of Graphviz, a graph visualization \n# toolkit from AT&T and Lucent Bell Labs. The other options in this section \n# have no effect if this option is set to NO (the default)\n\nHAVE_DOT               = NO\n\n# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for each documented class showing the direct and \n# indirect inheritance relations. Setting this tag to YES will force the \n# the CLASS_DIAGRAMS tag to NO.\n\nCLASS_GRAPH            = YES\n\n# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for each documented class showing the direct and \n# indirect implementation dependencies (inheritance, containment, and \n# class references variables) of the class with other documented classes.\n\nCOLLABORATION_GRAPH    = YES\n\n# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for groups, showing the direct groups dependencies\n\nGROUP_GRAPHS           = YES\n\n# If the UML_LOOK tag is set to YES doxygen will generate inheritance and \n# collaboration diagrams in a style similar to the OMG's Unified Modeling \n# Language.\n\nUML_LOOK               = NO\n\n# If set to YES, the inheritance and collaboration graphs will show the \n# relations between templates and their instances.\n\nTEMPLATE_RELATIONS     = NO\n\n# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT \n# tags are set to YES then doxygen will generate a graph for each documented \n# file showing the direct and indirect include dependencies of the file with \n# other documented files.\n\nINCLUDE_GRAPH          = YES\n\n# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and \n# HAVE_DOT tags are set to YES then doxygen will generate a graph for each \n# documented header file showing the documented files that directly or \n# indirectly include this file.\n\nINCLUDED_BY_GRAPH      = YES\n\n# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will \n# generate a call dependency graph for every global function or class method. \n# Note that enabling this option will significantly increase the time of a run. \n# So in most cases it will be better to enable call graphs for selected \n# functions only using the \\callgraph command.\n\nCALL_GRAPH             = NO\n\n# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will \n# generate a caller dependency graph for every global function or class method. \n# Note that enabling this option will significantly increase the time of a run. \n# So in most cases it will be better to enable caller graphs for selected \n# functions only using the \\callergraph command.\n\nCALLER_GRAPH           = NO\n\n# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen \n# will graphical hierarchy of all classes instead of a textual one.\n\nGRAPHICAL_HIERARCHY    = YES\n\n# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES \n# then doxygen will show the dependencies a directory has on other directories \n# in a graphical way. The dependency relations are determined by the #include\n# relations between the files in the directories.\n\nDIRECTORY_GRAPH        = YES\n\n# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images \n# generated by dot. Possible values are png, jpg, or gif\n# If left blank png will be used.\n\nDOT_IMAGE_FORMAT       = png\n\n# The tag DOT_PATH can be used to specify the path where the dot tool can be \n# found. If left blank, it is assumed the dot tool can be found in the path.\n\nDOT_PATH               = \n\n# The DOTFILE_DIRS tag can be used to specify one or more directories that \n# contain dot files that are included in the documentation (see the \n# \\dotfile command).\n\nDOTFILE_DIRS           = \n\n# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of \n# nodes that will be shown in the graph. If the number of nodes in a graph \n# becomes larger than this value, doxygen will truncate the graph, which is \n# visualized by representing a node as a red box. Note that doxygen if the number \n# of direct children of the root node in a graph is already larger than \n# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note \n# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n\nDOT_GRAPH_MAX_NODES    = 50\n\n# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the \n# graphs generated by dot. A depth value of 3 means that only nodes reachable \n# from the root by following a path via at most 3 edges will be shown. Nodes \n# that lay further from the root node will be omitted. Note that setting this \n# option to 1 or 2 may greatly reduce the computation time needed for large \n# code bases. Also note that the size of a graph can be further restricted by \n# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n\nMAX_DOT_GRAPH_DEPTH    = 0\n\n# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent \n# background. This is disabled by default, which results in a white background. \n# Warning: Depending on the platform used, enabling this option may lead to \n# badly anti-aliased labels on the edges of a graph (i.e. they become hard to \n# read).\n\nDOT_TRANSPARENT        = NO\n\n# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output \n# files in one run (i.e. multiple -o and -T options on the command line). This \n# makes dot run faster, but since only newer versions of dot (>1.8.10) \n# support this, this feature is disabled by default.\n\nDOT_MULTI_TARGETS      = NO\n\n# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will \n# generate a legend page explaining the meaning of the various boxes and \n# arrows in the dot generated graphs.\n\nGENERATE_LEGEND        = YES\n\n# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will \n# remove the intermediate dot files that are used to generate \n# the various graphs.\n\nDOT_CLEANUP            = YES\n\n#---------------------------------------------------------------------------\n# Configuration::additions related to the search engine   \n#---------------------------------------------------------------------------\n\n# The SEARCHENGINE tag specifies whether or not a search engine should be \n# used. If set to NO the values of all tags below this one will be ignored.\n\nSEARCHENGINE           = NO\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/examples/Makefile.am",
    "content": "AM_CPPFLAGS = -I$(top_srcdir)/libusb\nLDADD = ../libusb/libusb-1.0.la\n\nnoinst_PROGRAMS = listdevs xusb fxload hotplugtest\n\nif HAVE_SIGACTION\nnoinst_PROGRAMS += dpfp\n\nif THREADS_POSIX\ndpfp_threaded_CFLAGS = $(AM_CFLAGS)\nnoinst_PROGRAMS += dpfp_threaded\nendif\n\nsam3u_benchmark_SOURCES = sam3u_benchmark.c\nnoinst_PROGRAMS += sam3u_benchmark\nendif\n\nfxload_SOURCES = ezusb.c ezusb.h fxload.c\nfxload_CFLAGS = $(THREAD_CFLAGS) $(AM_CFLAGS)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/examples/dpfp.c",
    "content": "/*\n * libusb example program to manipulate U.are.U 4000B fingerprint scanner.\n * Copyright © 2007 Daniel Drake <dsd@gentoo.org>\n *\n * Basic image capture program only, does not consider the powerup quirks or\n * the fact that image encryption may be enabled. Not expected to work\n * flawlessly all of the time.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <errno.h>\n#include <signal.h>\n#include <string.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"libusb.h\"\n\n#define EP_INTR\t\t\t(1 | LIBUSB_ENDPOINT_IN)\n#define EP_DATA\t\t\t(2 | LIBUSB_ENDPOINT_IN)\n#define CTRL_IN\t\t\t(LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN)\n#define CTRL_OUT\t\t(LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT)\n#define USB_RQ\t\t\t0x04\n#define INTR_LENGTH\t\t64\n\nenum {\n\tMODE_INIT = 0x00,\n\tMODE_AWAIT_FINGER_ON = 0x10,\n\tMODE_AWAIT_FINGER_OFF = 0x12,\n\tMODE_CAPTURE = 0x20,\n\tMODE_SHUT_UP = 0x30,\n\tMODE_READY = 0x80,\n};\n\nstatic int next_state(void);\n\nenum {\n\tSTATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON = 1,\n\tSTATE_AWAIT_IRQ_FINGER_DETECTED,\n\tSTATE_AWAIT_MODE_CHANGE_CAPTURE,\n\tSTATE_AWAIT_IMAGE,\n\tSTATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF,\n\tSTATE_AWAIT_IRQ_FINGER_REMOVED,\n};\n\nstatic int state = 0;\nstatic struct libusb_device_handle *devh = NULL;\nstatic unsigned char imgbuf[0x1b340];\nstatic unsigned char irqbuf[INTR_LENGTH];\nstatic struct libusb_transfer *img_transfer = NULL;\nstatic struct libusb_transfer *irq_transfer = NULL;\nstatic int img_idx = 0;\nstatic int do_exit = 0;\n\nstatic int find_dpfp_device(void)\n{\n\tdevh = libusb_open_device_with_vid_pid(NULL, 0x05ba, 0x000a);\n\treturn devh ? 0 : -EIO;\n}\n\nstatic int print_f0_data(void)\n{\n\tunsigned char data[0x10];\n\tint r;\n\tunsigned int i;\n\n\tr = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0xf0, 0, data,\n\t\tsizeof(data), 0);\n\tif (r < 0) {\n\t\tfprintf(stderr, \"F0 error %d\\n\", r);\n\t\treturn r;\n\t}\n\tif ((unsigned int) r < sizeof(data)) {\n\t\tfprintf(stderr, \"short read (%d)\\n\", r);\n\t\treturn -1;\n\t}\n\n\tprintf(\"F0 data:\");\n\tfor (i = 0; i < sizeof(data); i++)\n\t\tprintf(\"%02x \", data[i]);\n\tprintf(\"\\n\");\n\treturn 0;\n}\n\nstatic int get_hwstat(unsigned char *status)\n{\n\tint r;\n\n\tr = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0x07, 0, status, 1, 0);\n\tif (r < 0) {\n\t\tfprintf(stderr, \"read hwstat error %d\\n\", r);\n\t\treturn r;\n\t}\n\tif ((unsigned int) r < 1) {\n\t\tfprintf(stderr, \"short read (%d)\\n\", r);\n\t\treturn -1;\n\t}\n\n\tprintf(\"hwstat reads %02x\\n\", *status);\n\treturn 0;\n}\n\nstatic int set_hwstat(unsigned char data)\n{\n\tint r;\n\n\tprintf(\"set hwstat to %02x\\n\", data);\n\tr = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x07, 0, &data, 1, 0);\n\tif (r < 0) {\n\t\tfprintf(stderr, \"set hwstat error %d\\n\", r);\n\t\treturn r;\n\t}\n\tif ((unsigned int) r < 1) {\n\t\tfprintf(stderr, \"short write (%d)\", r);\n\t\treturn -1;\n\t}\n\n\treturn 0;\n}\n\nstatic int set_mode(unsigned char data)\n{\n\tint r;\n\tprintf(\"set mode %02x\\n\", data);\n\n\tr = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x4e, 0, &data, 1, 0);\n\tif (r < 0) {\n\t\tfprintf(stderr, \"set mode error %d\\n\", r);\n\t\treturn r;\n\t}\n\tif ((unsigned int) r < 1) {\n\t\tfprintf(stderr, \"short write (%d)\", r);\n\t\treturn -1;\n\t}\n\n\treturn 0;\n}\n\nstatic void LIBUSB_CALL cb_mode_changed(struct libusb_transfer *transfer)\n{\n\tif (transfer->status != LIBUSB_TRANSFER_COMPLETED) {\n\t\tfprintf(stderr, \"mode change transfer not completed!\\n\");\n\t\tdo_exit = 2;\n\t}\n\n\tprintf(\"async cb_mode_changed length=%d actual_length=%d\\n\",\n\t\ttransfer->length, transfer->actual_length);\n\tif (next_state() < 0)\n\t\tdo_exit = 2;\n}\n\nstatic int set_mode_async(unsigned char data)\n{\n\tunsigned char *buf = (unsigned char*) malloc(LIBUSB_CONTROL_SETUP_SIZE + 1);\n\tstruct libusb_transfer *transfer;\n\n\tif (!buf)\n\t\treturn -ENOMEM;\n\n\ttransfer = libusb_alloc_transfer(0);\n\tif (!transfer) {\n\t\tfree(buf);\n\t\treturn -ENOMEM;\n\t}\n\n\tprintf(\"async set mode %02x\\n\", data);\n\tlibusb_fill_control_setup(buf, CTRL_OUT, USB_RQ, 0x4e, 0, 1);\n\tbuf[LIBUSB_CONTROL_SETUP_SIZE] = data;\n\tlibusb_fill_control_transfer(transfer, devh, buf, cb_mode_changed, NULL,\n\t\t1000);\n\n\ttransfer->flags = LIBUSB_TRANSFER_SHORT_NOT_OK\n\t\t| LIBUSB_TRANSFER_FREE_BUFFER | LIBUSB_TRANSFER_FREE_TRANSFER;\n\treturn libusb_submit_transfer(transfer);\n}\n\nstatic int do_sync_intr(unsigned char *data)\n{\n\tint r;\n\tint transferred;\n\n\tr = libusb_interrupt_transfer(devh, EP_INTR, data, INTR_LENGTH,\n\t\t&transferred, 1000);\n\tif (r < 0) {\n\t\tfprintf(stderr, \"intr error %d\\n\", r);\n\t\treturn r;\n\t}\n\tif (transferred < INTR_LENGTH) {\n\t\tfprintf(stderr, \"short read (%d)\\n\", r);\n\t\treturn -1;\n\t}\n\n\tprintf(\"recv interrupt %04x\\n\", *((uint16_t *) data));\n\treturn 0;\n}\n\nstatic int sync_intr(unsigned char type)\n{\n\tint r;\n\tunsigned char data[INTR_LENGTH];\n\n\twhile (1) {\n\t\tr = do_sync_intr(data);\n\t\tif (r < 0)\n\t\t\treturn r;\n\t\tif (data[0] == type)\n\t\t\treturn 0;\n\t}\n}\n\nstatic int save_to_file(unsigned char *data)\n{\n\tFILE *fd;\n\tchar filename[64];\n\n\tsnprintf(filename, sizeof(filename), \"finger%d.pgm\", img_idx++);\n\tfd = fopen(filename, \"w\");\n\tif (!fd)\n\t\treturn -1;\n\n\tfputs(\"P5 384 289 255 \", fd);\n\t(void) fwrite(data + 64, 1, 384*289, fd);\n\tfclose(fd);\n\tprintf(\"saved image to %s\\n\", filename);\n\treturn 0;\n}\n\nstatic int next_state(void)\n{\n\tint r = 0;\n\tprintf(\"old state: %d\\n\", state);\n\tswitch (state) {\n\tcase STATE_AWAIT_IRQ_FINGER_REMOVED:\n\t\tstate = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON;\n\t\tr = set_mode_async(MODE_AWAIT_FINGER_ON);\n\t\tbreak;\n\tcase STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON:\n\t\tstate = STATE_AWAIT_IRQ_FINGER_DETECTED;\n\t\tbreak;\n\tcase STATE_AWAIT_IRQ_FINGER_DETECTED:\n\t\tstate = STATE_AWAIT_MODE_CHANGE_CAPTURE;\n\t\tr = set_mode_async(MODE_CAPTURE);\n\t\tbreak;\n\tcase STATE_AWAIT_MODE_CHANGE_CAPTURE:\n\t\tstate = STATE_AWAIT_IMAGE;\n\t\tbreak;\n\tcase STATE_AWAIT_IMAGE:\n\t\tstate = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF;\n\t\tr = set_mode_async(MODE_AWAIT_FINGER_OFF);\n\t\tbreak;\n\tcase STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF:\n\t\tstate = STATE_AWAIT_IRQ_FINGER_REMOVED;\n\t\tbreak;\n\tdefault:\n\t\tprintf(\"unrecognised state %d\\n\", state);\n\t}\n\tif (r < 0) {\n\t\tfprintf(stderr, \"error detected changing state\\n\");\n\t\treturn r;\n\t}\n\n\tprintf(\"new state: %d\\n\", state);\n\treturn 0;\n}\n\nstatic void LIBUSB_CALL cb_irq(struct libusb_transfer *transfer)\n{\n\tunsigned char irqtype = transfer->buffer[0];\n\n\tif (transfer->status != LIBUSB_TRANSFER_COMPLETED) {\n\t\tfprintf(stderr, \"irq transfer status %d?\\n\", transfer->status);\n\t\tdo_exit = 2;\n\t\tlibusb_free_transfer(transfer);\n\t\tirq_transfer = NULL;\n\t\treturn;\n\t}\n\n\tprintf(\"IRQ callback %02x\\n\", irqtype);\n\tswitch (state) {\n\tcase STATE_AWAIT_IRQ_FINGER_DETECTED:\n\t\tif (irqtype == 0x01) {\n\t\t\tif (next_state() < 0) {\n\t\t\t\tdo_exit = 2;\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tprintf(\"finger-on-sensor detected in wrong state!\\n\");\n\t\t}\n\t\tbreak;\n\tcase STATE_AWAIT_IRQ_FINGER_REMOVED:\n\t\tif (irqtype == 0x02) {\n\t\t\tif (next_state() < 0) {\n\t\t\t\tdo_exit = 2;\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tprintf(\"finger-on-sensor detected in wrong state!\\n\");\n\t\t}\n\t\tbreak;\n\t}\n\tif (libusb_submit_transfer(irq_transfer) < 0)\n\t\tdo_exit = 2;\n}\n\nstatic void LIBUSB_CALL cb_img(struct libusb_transfer *transfer)\n{\n\tif (transfer->status != LIBUSB_TRANSFER_COMPLETED) {\n\t\tfprintf(stderr, \"img transfer status %d?\\n\", transfer->status);\n\t\tdo_exit = 2;\n\t\tlibusb_free_transfer(transfer);\n\t\timg_transfer = NULL;\n\t\treturn;\n\t}\n\n\tprintf(\"Image callback\\n\");\n\tsave_to_file(imgbuf);\n\tif (next_state() < 0) {\n\t\tdo_exit = 2;\n\t\treturn;\n\t}\n\tif (libusb_submit_transfer(img_transfer) < 0)\n\t\tdo_exit = 2;\n}\n\nstatic int init_capture(void)\n{\n\tint r;\n\n\tr = libusb_submit_transfer(irq_transfer);\n\tif (r < 0)\n\t\treturn r;\n\n\tr = libusb_submit_transfer(img_transfer);\n\tif (r < 0) {\n\t\tlibusb_cancel_transfer(irq_transfer);\n\t\twhile (irq_transfer)\n\t\t\tif (libusb_handle_events(NULL) < 0)\n\t\t\t\tbreak;\n\t\treturn r;\n\t}\n\n\t/* start state machine */\n\tstate = STATE_AWAIT_IRQ_FINGER_REMOVED;\n\treturn next_state();\n}\n\nstatic int do_init(void)\n{\n\tunsigned char status;\n\tint r;\n\n\tr = get_hwstat(&status);\n\tif (r < 0)\n\t\treturn r;\n\n\tif (!(status & 0x80)) {\n\t\tr = set_hwstat(status | 0x80);\n\t\tif (r < 0)\n\t\t\treturn r;\n\t\tr = get_hwstat(&status);\n\t\tif (r < 0)\n\t\t\treturn r;\n\t}\n\n\tstatus &= ~0x80;\n\tr = set_hwstat(status);\n\tif (r < 0)\n\t\treturn r;\n\n\tr = get_hwstat(&status);\n\tif (r < 0)\n\t\treturn r;\n\n\tr = sync_intr(0x56);\n\tif (r < 0)\n\t\treturn r;\n\n\treturn 0;\n}\n\nstatic int alloc_transfers(void)\n{\n\timg_transfer = libusb_alloc_transfer(0);\n\tif (!img_transfer)\n\t\treturn -ENOMEM;\n\n\tirq_transfer = libusb_alloc_transfer(0);\n\tif (!irq_transfer)\n\t\treturn -ENOMEM;\n\n\tlibusb_fill_bulk_transfer(img_transfer, devh, EP_DATA, imgbuf,\n\t\tsizeof(imgbuf), cb_img, NULL, 0);\n\tlibusb_fill_interrupt_transfer(irq_transfer, devh, EP_INTR, irqbuf,\n\t\tsizeof(irqbuf), cb_irq, NULL, 0);\n\n\treturn 0;\n}\n\nstatic void sighandler(int signum)\n{\n\tdo_exit = 1;\n}\n\nint main(void)\n{\n\tstruct sigaction sigact;\n\tint r = 1;\n\n\tr = libusb_init(NULL);\n\tif (r < 0) {\n\t\tfprintf(stderr, \"failed to initialise libusb\\n\");\n\t\texit(1);\n\t}\n\n\tr = find_dpfp_device();\n\tif (r < 0) {\n\t\tfprintf(stderr, \"Could not find/open device\\n\");\n\t\tgoto out;\n\t}\n\n\tr = libusb_claim_interface(devh, 0);\n\tif (r < 0) {\n\t\tfprintf(stderr, \"usb_claim_interface error %d\\n\", r);\n\t\tgoto out;\n\t}\n\tprintf(\"claimed interface\\n\");\n\n\tr = print_f0_data();\n\tif (r < 0)\n\t\tgoto out_release;\n\n\tr = do_init();\n\tif (r < 0)\n\t\tgoto out_deinit;\n\n\t/* async from here onwards */\n\n\tr = alloc_transfers();\n\tif (r < 0)\n\t\tgoto out_deinit;\n\n\tr = init_capture();\n\tif (r < 0)\n\t\tgoto out_deinit;\n\n\tsigact.sa_handler = sighandler;\n\tsigemptyset(&sigact.sa_mask);\n\tsigact.sa_flags = 0;\n\tsigaction(SIGINT, &sigact, NULL);\n\tsigaction(SIGTERM, &sigact, NULL);\n\tsigaction(SIGQUIT, &sigact, NULL);\n\n\twhile (!do_exit) {\n\t\tr = libusb_handle_events(NULL);\n\t\tif (r < 0)\n\t\t\tgoto out_deinit;\n\t}\n\n\tprintf(\"shutting down...\\n\");\n\n\tif (irq_transfer) {\n\t\tr = libusb_cancel_transfer(irq_transfer);\n\t\tif (r < 0)\n\t\t\tgoto out_deinit;\n\t}\n\n\tif (img_transfer) {\n\t\tr = libusb_cancel_transfer(img_transfer);\n\t\tif (r < 0)\n\t\t\tgoto out_deinit;\n\t}\n\n\twhile (irq_transfer || img_transfer)\n\t\tif (libusb_handle_events(NULL) < 0)\n\t\t\tbreak;\n\n\tif (do_exit == 1)\n\t\tr = 0;\n\telse\n\t\tr = 1;\n\nout_deinit:\n\tlibusb_free_transfer(img_transfer);\n\tlibusb_free_transfer(irq_transfer);\n\tset_mode(0);\n\tset_hwstat(0x80);\nout_release:\n\tlibusb_release_interface(devh, 0);\nout:\n\tlibusb_close(devh);\n\tlibusb_exit(NULL);\n\treturn r >= 0 ? r : -r;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/examples/dpfp_threaded.c",
    "content": "/*\n * libusb example program to manipulate U.are.U 4000B fingerprint scanner.\n * Copyright © 2007 Daniel Drake <dsd@gentoo.org>\n *\n * Basic image capture program only, does not consider the powerup quirks or\n * the fact that image encryption may be enabled. Not expected to work\n * flawlessly all of the time.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <errno.h>\n#include <pthread.h>\n#include <signal.h>\n#include <string.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"libusb.h\"\n\n#define EP_INTR\t\t\t(1 | LIBUSB_ENDPOINT_IN)\n#define EP_DATA\t\t\t(2 | LIBUSB_ENDPOINT_IN)\n#define CTRL_IN\t\t\t(LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN)\n#define CTRL_OUT\t\t(LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT)\n#define USB_RQ\t\t\t0x04\n#define INTR_LENGTH\t\t64\n\nenum {\n\tMODE_INIT = 0x00,\n\tMODE_AWAIT_FINGER_ON = 0x10,\n\tMODE_AWAIT_FINGER_OFF = 0x12,\n\tMODE_CAPTURE = 0x20,\n\tMODE_SHUT_UP = 0x30,\n\tMODE_READY = 0x80,\n};\n\nstatic int next_state(void);\n\nenum {\n\tSTATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON = 1,\n\tSTATE_AWAIT_IRQ_FINGER_DETECTED,\n\tSTATE_AWAIT_MODE_CHANGE_CAPTURE,\n\tSTATE_AWAIT_IMAGE,\n\tSTATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF,\n\tSTATE_AWAIT_IRQ_FINGER_REMOVED,\n};\n\nstatic int state = 0;\nstatic struct libusb_device_handle *devh = NULL;\nstatic unsigned char imgbuf[0x1b340];\nstatic unsigned char irqbuf[INTR_LENGTH];\nstatic struct libusb_transfer *img_transfer = NULL;\nstatic struct libusb_transfer *irq_transfer = NULL;\nstatic int img_idx = 0;\nstatic int do_exit = 0;\n\nstatic pthread_t poll_thread;\nstatic pthread_cond_t exit_cond = PTHREAD_COND_INITIALIZER;\nstatic pthread_mutex_t exit_cond_lock = PTHREAD_MUTEX_INITIALIZER;\n\nstatic void request_exit(int code)\n{\n\tdo_exit = code;\n\tpthread_cond_signal(&exit_cond);\n}\n\nstatic void *poll_thread_main(void *arg)\n{\n\tint r = 0;\n\tprintf(\"poll thread running\\n\");\n\n\twhile (!do_exit) {\n\t\tstruct timeval tv = { 1, 0 };\n\t\tr = libusb_handle_events_timeout(NULL, &tv);\n\t\tif (r < 0) {\n\t\t\trequest_exit(2);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tprintf(\"poll thread shutting down\\n\");\n\treturn NULL;\n}\n\nstatic int find_dpfp_device(void)\n{\n\tdevh = libusb_open_device_with_vid_pid(NULL, 0x05ba, 0x000a);\n\treturn devh ? 0 : -EIO;\n}\n\nstatic int print_f0_data(void)\n{\n\tunsigned char data[0x10];\n\tint r;\n\tunsigned int i;\n\n\tr = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0xf0, 0, data,\n\t\tsizeof(data), 0);\n\tif (r < 0) {\n\t\tfprintf(stderr, \"F0 error %d\\n\", r);\n\t\treturn r;\n\t}\n\tif ((unsigned int) r < sizeof(data)) {\n\t\tfprintf(stderr, \"short read (%d)\\n\", r);\n\t\treturn -1;\n\t}\n\n\tprintf(\"F0 data:\");\n\tfor (i = 0; i < sizeof(data); i++)\n\t\tprintf(\"%02x \", data[i]);\n\tprintf(\"\\n\");\n\treturn 0;\n}\n\nstatic int get_hwstat(unsigned char *status)\n{\n\tint r;\n\n\tr = libusb_control_transfer(devh, CTRL_IN, USB_RQ, 0x07, 0, status, 1, 0);\n\tif (r < 0) {\n\t\tfprintf(stderr, \"read hwstat error %d\\n\", r);\n\t\treturn r;\n\t}\n\tif ((unsigned int) r < 1) {\n\t\tfprintf(stderr, \"short read (%d)\\n\", r);\n\t\treturn -1;\n\t}\n\n\tprintf(\"hwstat reads %02x\\n\", *status);\n\treturn 0;\n}\n\nstatic int set_hwstat(unsigned char data)\n{\n\tint r;\n\n\tprintf(\"set hwstat to %02x\\n\", data);\n\tr = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x07, 0, &data, 1, 0);\n\tif (r < 0) {\n\t\tfprintf(stderr, \"set hwstat error %d\\n\", r);\n\t\treturn r;\n\t}\n\tif ((unsigned int) r < 1) {\n\t\tfprintf(stderr, \"short write (%d)\", r);\n\t\treturn -1;\n\t}\n\n\treturn 0;\n}\n\nstatic int set_mode(unsigned char data)\n{\n\tint r;\n\tprintf(\"set mode %02x\\n\", data);\n\n\tr = libusb_control_transfer(devh, CTRL_OUT, USB_RQ, 0x4e, 0, &data, 1, 0);\n\tif (r < 0) {\n\t\tfprintf(stderr, \"set mode error %d\\n\", r);\n\t\treturn r;\n\t}\n\tif ((unsigned int) r < 1) {\n\t\tfprintf(stderr, \"short write (%d)\", r);\n\t\treturn -1;\n\t}\n\n\treturn 0;\n}\n\nstatic void LIBUSB_CALL cb_mode_changed(struct libusb_transfer *transfer)\n{\n\tif (transfer->status != LIBUSB_TRANSFER_COMPLETED) {\n\t\tfprintf(stderr, \"mode change transfer not completed!\\n\");\n\t\trequest_exit(2);\n\t}\n\n\tprintf(\"async cb_mode_changed length=%d actual_length=%d\\n\",\n\t\ttransfer->length, transfer->actual_length);\n\tif (next_state() < 0)\n\t\trequest_exit(2);\n}\n\nstatic int set_mode_async(unsigned char data)\n{\n\tunsigned char *buf = (unsigned char*) malloc(LIBUSB_CONTROL_SETUP_SIZE + 1);\n\tstruct libusb_transfer *transfer;\n\n\tif (!buf)\n\t\treturn -ENOMEM;\n\n\ttransfer = libusb_alloc_transfer(0);\n\tif (!transfer) {\n\t\tfree(buf);\n\t\treturn -ENOMEM;\n\t}\n\n\tprintf(\"async set mode %02x\\n\", data);\n\tlibusb_fill_control_setup(buf, CTRL_OUT, USB_RQ, 0x4e, 0, 1);\n\tbuf[LIBUSB_CONTROL_SETUP_SIZE] = data;\n\tlibusb_fill_control_transfer(transfer, devh, buf, cb_mode_changed, NULL,\n\t\t1000);\n\n\ttransfer->flags = LIBUSB_TRANSFER_SHORT_NOT_OK\n\t\t| LIBUSB_TRANSFER_FREE_BUFFER | LIBUSB_TRANSFER_FREE_TRANSFER;\n\treturn libusb_submit_transfer(transfer);\n}\n\nstatic int do_sync_intr(unsigned char *data)\n{\n\tint r;\n\tint transferred;\n\n\tr = libusb_interrupt_transfer(devh, EP_INTR, data, INTR_LENGTH,\n\t\t&transferred, 1000);\n\tif (r < 0) {\n\t\tfprintf(stderr, \"intr error %d\\n\", r);\n\t\treturn r;\n\t}\n\tif (transferred < INTR_LENGTH) {\n\t\tfprintf(stderr, \"short read (%d)\\n\", r);\n\t\treturn -1;\n\t}\n\n\tprintf(\"recv interrupt %04x\\n\", *((uint16_t *) data));\n\treturn 0;\n}\n\nstatic int sync_intr(unsigned char type)\n{\n\tint r;\n\tunsigned char data[INTR_LENGTH];\n\n\twhile (1) {\n\t\tr = do_sync_intr(data);\n\t\tif (r < 0)\n\t\t\treturn r;\n\t\tif (data[0] == type)\n\t\t\treturn 0;\n\t}\n}\n\nstatic int save_to_file(unsigned char *data)\n{\n\tFILE *fd;\n\tchar filename[64];\n\n\tsnprintf(filename, sizeof(filename), \"finger%d.pgm\", img_idx++);\n\tfd = fopen(filename, \"w\");\n\tif (!fd)\n\t\treturn -1;\n\n\tfputs(\"P5 384 289 255 \", fd);\n\t(void) fwrite(data + 64, 1, 384*289, fd);\n\tfclose(fd);\n\tprintf(\"saved image to %s\\n\", filename);\n\treturn 0;\n}\n\nstatic int next_state(void)\n{\n\tint r = 0;\n\tprintf(\"old state: %d\\n\", state);\n\tswitch (state) {\n\tcase STATE_AWAIT_IRQ_FINGER_REMOVED:\n\t\tstate = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON;\n\t\tr = set_mode_async(MODE_AWAIT_FINGER_ON);\n\t\tbreak;\n\tcase STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_ON:\n\t\tstate = STATE_AWAIT_IRQ_FINGER_DETECTED;\n\t\tbreak;\n\tcase STATE_AWAIT_IRQ_FINGER_DETECTED:\n\t\tstate = STATE_AWAIT_MODE_CHANGE_CAPTURE;\n\t\tr = set_mode_async(MODE_CAPTURE);\n\t\tbreak;\n\tcase STATE_AWAIT_MODE_CHANGE_CAPTURE:\n\t\tstate = STATE_AWAIT_IMAGE;\n\t\tbreak;\n\tcase STATE_AWAIT_IMAGE:\n\t\tstate = STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF;\n\t\tr = set_mode_async(MODE_AWAIT_FINGER_OFF);\n\t\tbreak;\n\tcase STATE_AWAIT_MODE_CHANGE_AWAIT_FINGER_OFF:\n\t\tstate = STATE_AWAIT_IRQ_FINGER_REMOVED;\n\t\tbreak;\n\tdefault:\n\t\tprintf(\"unrecognised state %d\\n\", state);\n\t}\n\tif (r < 0) {\n\t\tfprintf(stderr, \"error detected changing state\\n\");\n\t\treturn r;\n\t}\n\n\tprintf(\"new state: %d\\n\", state);\n\treturn 0;\n}\n\nstatic void LIBUSB_CALL cb_irq(struct libusb_transfer *transfer)\n{\n\tunsigned char irqtype = transfer->buffer[0];\n\n\tif (transfer->status != LIBUSB_TRANSFER_COMPLETED) {\n\t\tfprintf(stderr, \"irq transfer status %d?\\n\", transfer->status);\n\t\tirq_transfer = NULL;\n\t\trequest_exit(2);\n\t\treturn;\n\t}\n\n\tprintf(\"IRQ callback %02x\\n\", irqtype);\n\tswitch (state) {\n\tcase STATE_AWAIT_IRQ_FINGER_DETECTED:\n\t\tif (irqtype == 0x01) {\n\t\t\tif (next_state() < 0) {\n\t\t\t\trequest_exit(2);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tprintf(\"finger-on-sensor detected in wrong state!\\n\");\n\t\t}\n\t\tbreak;\n\tcase STATE_AWAIT_IRQ_FINGER_REMOVED:\n\t\tif (irqtype == 0x02) {\n\t\t\tif (next_state() < 0) {\n\t\t\t\trequest_exit(2);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tprintf(\"finger-on-sensor detected in wrong state!\\n\");\n\t\t}\n\t\tbreak;\n\t}\n\tif (libusb_submit_transfer(irq_transfer) < 0)\n\t\trequest_exit(2);\n}\n\nstatic void LIBUSB_CALL cb_img(struct libusb_transfer *transfer)\n{\n\tif (transfer->status != LIBUSB_TRANSFER_COMPLETED) {\n\t\tfprintf(stderr, \"img transfer status %d?\\n\", transfer->status);\n\t\timg_transfer = NULL;\n\t\trequest_exit(2);\n\t\treturn;\n\t}\n\n\tprintf(\"Image callback\\n\");\n\tsave_to_file(imgbuf);\n\tif (next_state() < 0) {\n\t\trequest_exit(2);\n\t\treturn;\n\t}\n\tif (libusb_submit_transfer(img_transfer) < 0)\n\t\trequest_exit(2);\n}\n\nstatic int init_capture(void)\n{\n\tint r;\n\n\tr = libusb_submit_transfer(irq_transfer);\n\tif (r < 0)\n\t\treturn r;\n\n\tr = libusb_submit_transfer(img_transfer);\n\tif (r < 0) {\n\t\tlibusb_cancel_transfer(irq_transfer);\n\t\twhile (irq_transfer)\n\t\t\tif (libusb_handle_events(NULL) < 0)\n\t\t\t\tbreak;\n\t\treturn r;\n\t}\n\n\t/* start state machine */\n\tstate = STATE_AWAIT_IRQ_FINGER_REMOVED;\n\treturn next_state();\n}\n\nstatic int do_init(void)\n{\n\tunsigned char status;\n\tint r;\n\n\tr = get_hwstat(&status);\n\tif (r < 0)\n\t\treturn r;\n\n\tif (!(status & 0x80)) {\n\t\tr = set_hwstat(status | 0x80);\n\t\tif (r < 0)\n\t\t\treturn r;\n\t\tr = get_hwstat(&status);\n\t\tif (r < 0)\n\t\t\treturn r;\n\t}\n\n\tstatus &= ~0x80;\n\tr = set_hwstat(status);\n\tif (r < 0)\n\t\treturn r;\n\n\tr = get_hwstat(&status);\n\tif (r < 0)\n\t\treturn r;\n\n\tr = sync_intr(0x56);\n\tif (r < 0)\n\t\treturn r;\n\n\treturn 0;\n}\n\nstatic int alloc_transfers(void)\n{\n\timg_transfer = libusb_alloc_transfer(0);\n\tif (!img_transfer)\n\t\treturn -ENOMEM;\n\n\tirq_transfer = libusb_alloc_transfer(0);\n\tif (!irq_transfer)\n\t\treturn -ENOMEM;\n\n\tlibusb_fill_bulk_transfer(img_transfer, devh, EP_DATA, imgbuf,\n\t\tsizeof(imgbuf), cb_img, NULL, 0);\n\tlibusb_fill_interrupt_transfer(irq_transfer, devh, EP_INTR, irqbuf,\n\t\tsizeof(irqbuf), cb_irq, NULL, 0);\n\n\treturn 0;\n}\n\nstatic void sighandler(int signum)\n{\n\trequest_exit(1);\n}\n\nint main(void)\n{\n\tstruct sigaction sigact;\n\tint r = 1;\n\n\tr = libusb_init(NULL);\n\tif (r < 0) {\n\t\tfprintf(stderr, \"failed to initialise libusb\\n\");\n\t\texit(1);\n\t}\n\n\tr = find_dpfp_device();\n\tif (r < 0) {\n\t\tfprintf(stderr, \"Could not find/open device\\n\");\n\t\tgoto out;\n\t}\n\n\tr = libusb_claim_interface(devh, 0);\n\tif (r < 0) {\n\t\tfprintf(stderr, \"usb_claim_interface error %d %s\\n\", r, strerror(-r));\n\t\tgoto out;\n\t}\n\tprintf(\"claimed interface\\n\");\n\n\tr = print_f0_data();\n\tif (r < 0)\n\t\tgoto out_release;\n\n\tr = do_init();\n\tif (r < 0)\n\t\tgoto out_deinit;\n\n\t/* async from here onwards */\n\n\tsigact.sa_handler = sighandler;\n\tsigemptyset(&sigact.sa_mask);\n\tsigact.sa_flags = 0;\n\tsigaction(SIGINT, &sigact, NULL);\n\tsigaction(SIGTERM, &sigact, NULL);\n\tsigaction(SIGQUIT, &sigact, NULL);\n\n\tr = pthread_create(&poll_thread, NULL, poll_thread_main, NULL);\n\tif (r)\n\t\tgoto out_deinit;\n\n\tr = alloc_transfers();\n\tif (r < 0) {\n\t\trequest_exit(1);\n\t\tpthread_join(poll_thread, NULL);\n\t\tgoto out_deinit;\n\t}\n\n\tr = init_capture();\n\tif (r < 0) {\n\t\trequest_exit(1);\n\t\tpthread_join(poll_thread, NULL);\n\t\tgoto out_deinit;\n\t}\n\n\twhile (!do_exit) {\n\t\tpthread_mutex_lock(&exit_cond_lock);\n\t\tpthread_cond_wait(&exit_cond, &exit_cond_lock);\n\t\tpthread_mutex_unlock(&exit_cond_lock);\n\t}\n\n\tprintf(\"shutting down...\\n\");\n\tpthread_join(poll_thread, NULL);\n\n\tr = libusb_cancel_transfer(irq_transfer);\n\tif (r < 0) {\n\t\trequest_exit(1);\n\t\tgoto out_deinit;\n\t}\n\n\tr = libusb_cancel_transfer(img_transfer);\n\tif (r < 0) {\n\t\trequest_exit(1);\n\t\tgoto out_deinit;\n\t}\n\n\twhile (img_transfer || irq_transfer)\n\t\tif (libusb_handle_events(NULL) < 0)\n\t\t\tbreak;\n\n\tif (do_exit == 1)\n\t\tr = 0;\n\telse\n\t\tr = 1;\n\nout_deinit:\n\tlibusb_free_transfer(img_transfer);\n\tlibusb_free_transfer(irq_transfer);\n\tset_mode(0);\n\tset_hwstat(0x80);\nout_release:\n\tlibusb_release_interface(devh, 0);\nout:\n\tlibusb_close(devh);\n\tlibusb_exit(NULL);\n\treturn r >= 0 ? r : -r;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/examples/ezusb.c",
    "content": "/*\n * Copyright © 2001 Stephen Williams (steve@icarus.com)\n * Copyright © 2001-2002 David Brownell (dbrownell@users.sourceforge.net)\n * Copyright © 2008 Roger Williams (rawqux@users.sourceforge.net)\n * Copyright © 2012 Pete Batard (pete@akeo.ie)\n * Copyright © 2013 Federico Manzan (f.manzan@gmail.com)\n *\n *    This source code is free software; you can redistribute it\n *    and/or modify it in source code form under the terms of the GNU\n *    General Public License as published by the Free Software\n *    Foundation; either version 2 of the License, or (at your option)\n *    any later version.\n *\n *    This program is distributed in the hope that it will be useful,\n *    but WITHOUT ANY WARRANTY; without even the implied warranty of\n *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *    GNU General Public License for more details.\n *\n *    You should have received a copy of the GNU General Public License\n *    along with this program; if not, write to the Free Software\n *    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\n */\n#include <stdio.h>\n#include <errno.h>\n#include <stdlib.h>\n#include <string.h>\n#include <stdint.h>\n\n#include \"libusb.h\"\n#include \"ezusb.h\"\n\nextern void logerror(const char *format, ...)\n\t__attribute__ ((format(printf, 1, 2)));\n\n/*\n * This file contains functions for uploading firmware into Cypress\n * EZ-USB microcontrollers. These chips use control endpoint 0 and vendor\n * specific commands to support writing into the on-chip SRAM. They also\n * support writing into the CPUCS register, which is how we reset the\n * processor after loading firmware (including the reset vector).\n *\n * These Cypress devices are 8-bit 8051 based microcontrollers with\n * special support for USB I/O.  They come in several packages, and\n * some can be set up with external memory when device costs allow.\n * Note that the design was originally by AnchorChips, so you may find\n * references to that vendor (which was later merged into Cypress).\n * The Cypress FX parts are largely compatible with the Anchorhip ones.\n */\n\nint verbose = 1;\n\n/*\n * return true if [addr,addr+len] includes external RAM\n * for Anchorchips EZ-USB or Cypress EZ-USB FX\n */\nstatic bool fx_is_external(uint32_t addr, size_t len)\n{\n\t/* with 8KB RAM, 0x0000-0x1b3f can be written\n\t * we can't tell if it's a 4KB device here\n\t */\n\tif (addr <= 0x1b3f)\n\t\treturn ((addr + len) > 0x1b40);\n\n\t/* there may be more RAM; unclear if we can write it.\n\t * some bulk buffers may be unused, 0x1b3f-0x1f3f\n\t * firmware can set ISODISAB for 2KB at 0x2000-0x27ff\n\t */\n\treturn true;\n}\n\n/*\n * return true if [addr,addr+len] includes external RAM\n * for Cypress EZ-USB FX2\n */\nstatic bool fx2_is_external(uint32_t addr, size_t len)\n{\n\t/* 1st 8KB for data/code, 0x0000-0x1fff */\n\tif (addr <= 0x1fff)\n\t\treturn ((addr + len) > 0x2000);\n\n\t/* and 512 for data, 0xe000-0xe1ff */\n\telse if (addr >= 0xe000 && addr <= 0xe1ff)\n\t\treturn ((addr + len) > 0xe200);\n\n\t/* otherwise, it's certainly external */\n\telse\n\t\treturn true;\n}\n\n/*\n * return true if [addr,addr+len] includes external RAM\n * for Cypress EZ-USB FX2LP\n */\nstatic bool fx2lp_is_external(uint32_t addr, size_t len)\n{\n\t/* 1st 16KB for data/code, 0x0000-0x3fff */\n\tif (addr <= 0x3fff)\n\t\treturn ((addr + len) > 0x4000);\n\n\t/* and 512 for data, 0xe000-0xe1ff */\n\telse if (addr >= 0xe000 && addr <= 0xe1ff)\n\t\treturn ((addr + len) > 0xe200);\n\n\t/* otherwise, it's certainly external */\n\telse\n\t\treturn true;\n}\n\n\n/*****************************************************************************/\n\n/*\n * These are the requests (bRequest) that the bootstrap loader is expected\n * to recognize.  The codes are reserved by Cypress, and these values match\n * what EZ-USB hardware, or \"Vend_Ax\" firmware (2nd stage loader) uses.\n * Cypress' \"a3load\" is nice because it supports both FX and FX2, although\n * it doesn't have the EEPROM support (subset of \"Vend_Ax\").\n */\n#define RW_INTERNAL     0xA0\t/* hardware implements this one */\n#define RW_MEMORY       0xA3\n\n/*\n * Issues the specified vendor-specific write request.\n */\nstatic int ezusb_write(libusb_device_handle *device, const char *label,\n\tuint8_t opcode, uint32_t addr, const unsigned char *data, size_t len)\n{\n\tint status;\n\n\tif (verbose > 1)\n\t\tlogerror(\"%s, addr 0x%08x len %4u (0x%04x)\\n\", label, addr, (unsigned)len, (unsigned)len);\n\tstatus = libusb_control_transfer(device,\n\t\tLIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,\n\t\topcode, addr & 0xFFFF, addr >> 16,\n\t\t(unsigned char*)data, (uint16_t)len, 1000);\n\tif (status != len) {\n\t\tif (status < 0)\n\t\t\tlogerror(\"%s: %s\\n\", label, libusb_error_name(status));\n\t\telse\n\t\t\tlogerror(\"%s ==> %d\\n\", label, status);\n\t}\n\treturn (status < 0) ? -EIO : 0;\n}\n\n/*\n * Issues the specified vendor-specific read request.\n */\nstatic int ezusb_read(libusb_device_handle *device, const char *label,\n\tuint8_t opcode, uint32_t addr, const unsigned char *data, size_t len)\n{\n\tint status;\n\n\tif (verbose > 1)\n\t\tlogerror(\"%s, addr 0x%08x len %4u (0x%04x)\\n\", label, addr, (unsigned)len, (unsigned)len);\n\tstatus = libusb_control_transfer(device,\n\t\tLIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,\n\t\topcode, addr & 0xFFFF, addr >> 16,\n\t\t(unsigned char*)data, (uint16_t)len, 1000);\n\tif (status != len) {\n\t\tif (status < 0)\n\t\t\tlogerror(\"%s: %s\\n\", label, libusb_error_name(status));\n\t\telse\n\t\t\tlogerror(\"%s ==> %d\\n\", label, status);\n\t}\n\treturn (status < 0) ? -EIO : 0;\n}\n\n/*\n * Modifies the CPUCS register to stop or reset the CPU.\n * Returns false on error.\n */\nstatic bool ezusb_cpucs(libusb_device_handle *device, uint32_t addr, bool doRun)\n{\n\tint status;\n\tuint8_t data = doRun ? 0x00 : 0x01;\n\n\tif (verbose)\n\t\tlogerror(\"%s\\n\", data ? \"stop CPU\" : \"reset CPU\");\n\tstatus = libusb_control_transfer(device,\n\t\tLIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,\n\t\tRW_INTERNAL, addr & 0xFFFF, addr >> 16,\n\t\t&data, 1, 1000);\n\tif ((status != 1) &&\n\t\t/* We may get an I/O error from libusb as the device disappears */\n\t\t((!doRun) || (status != LIBUSB_ERROR_IO)))\n\t{\n\t\tconst char *mesg = \"can't modify CPUCS\";\n\t\tif (status < 0)\n\t\t\tlogerror(\"%s: %s\\n\", mesg, libusb_error_name(status));\n\t\telse\n\t\t\tlogerror(\"%s\\n\", mesg);\n\t\treturn false;\n\t} else\n\t\treturn true;\n}\n\n/*\n * Send an FX3 jumpt to address command\n * Returns false on error.\n */\nstatic bool ezusb_fx3_jump(libusb_device_handle *device, uint32_t addr)\n{\n\tint status;\n\n\tif (verbose)\n\t\tlogerror(\"transfer execution to Program Entry at 0x%08x\\n\", addr);\n\tstatus = libusb_control_transfer(device,\n\t\tLIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,\n\t\tRW_INTERNAL, addr & 0xFFFF, addr >> 16,\n\t\tNULL, 0, 1000);\n\t/* We may get an I/O error from libusb as the device disappears */\n\tif ((status != 0) && (status != LIBUSB_ERROR_IO))\n\t{\n\t\tconst char *mesg = \"failed to send jump command\";\n\t\tif (status < 0)\n\t\t\tlogerror(\"%s: %s\\n\", mesg, libusb_error_name(status));\n\t\telse\n\t\t\tlogerror(\"%s\\n\", mesg);\n\t\treturn false;\n\t} else\n\t\treturn true;\n}\n\n/*****************************************************************************/\n\n/*\n * Parse an Intel HEX image file and invoke the poke() function on the\n * various segments to implement policies such as writing to RAM (with\n * a one or two stage loader setup, depending on the firmware) or to\n * EEPROM (two stages required).\n *\n * image       - the hex image file\n * context     - for use by poke()\n * is_external - if non-null, used to check which segments go into\n *               external memory (writable only by software loader)\n * poke        - called with each memory segment; errors indicated\n *               by returning negative values.\n *\n * Caller is responsible for halting CPU as needed, such as when\n * overwriting a second stage loader.\n */\nstatic int parse_ihex(FILE *image, void *context,\n\tbool (*is_external)(uint32_t addr, size_t len),\n\tint (*poke) (void *context, uint32_t addr, bool external,\n\tconst unsigned char *data, size_t len))\n{\n\tunsigned char data[1023];\n\tuint32_t data_addr = 0;\n\tsize_t data_len = 0;\n\tint rc;\n\tint first_line = 1;\n\tbool external = false;\n\n\t/* Read the input file as an IHEX file, and report the memory segments\n\t * as we go.  Each line holds a max of 16 bytes, but uploading is\n\t * faster (and EEPROM space smaller) if we merge those lines into larger\n\t * chunks.  Most hex files keep memory segments together, which makes\n\t * such merging all but free.  (But it may still be worth sorting the\n\t * hex files to make up for undesirable behavior from tools.)\n\t *\n\t * Note that EEPROM segments max out at 1023 bytes; the upload protocol\n\t * allows segments of up to 64 KBytes (more than a loader could handle).\n\t */\n\tfor (;;) {\n\t\tchar buf[512], *cp;\n\t\tchar tmp, type;\n\t\tsize_t len;\n\t\tunsigned idx, off;\n\n\t\tcp = fgets(buf, sizeof(buf), image);\n\t\tif (cp == NULL) {\n\t\t\tlogerror(\"EOF without EOF record!\\n\");\n\t\t\tbreak;\n\t\t}\n\n\t\t/* EXTENSION: \"# comment-till-end-of-line\", for copyrights etc */\n\t\tif (buf[0] == '#')\n\t\t\tcontinue;\n\n\t\tif (buf[0] != ':') {\n\t\t\tlogerror(\"not an ihex record: %s\", buf);\n\t\t\treturn -2;\n\t\t}\n\n\t\t/* ignore any newline */\n\t\tcp = strchr(buf, '\\n');\n\t\tif (cp)\n\t\t\t*cp = 0;\n\n\t\tif (verbose >= 3)\n\t\t\tlogerror(\"** LINE: %s\\n\", buf);\n\n\t\t/* Read the length field (up to 16 bytes) */\n\t\ttmp = buf[3];\n\t\tbuf[3] = 0;\n\t\tlen = strtoul(buf+1, NULL, 16);\n\t\tbuf[3] = tmp;\n\n\t\t/* Read the target offset (address up to 64KB) */\n\t\ttmp = buf[7];\n\t\tbuf[7] = 0;\n\t\toff = (int)strtoul(buf+3, NULL, 16);\n\t\tbuf[7] = tmp;\n\n\t\t/* Initialize data_addr */\n\t\tif (first_line) {\n\t\t\tdata_addr = off;\n\t\t\tfirst_line = 0;\n\t\t}\n\n\t\t/* Read the record type */\n\t\ttmp = buf[9];\n\t\tbuf[9] = 0;\n\t\ttype = (char)strtoul(buf+7, NULL, 16);\n\t\tbuf[9] = tmp;\n\n\t\t/* If this is an EOF record, then make it so. */\n\t\tif (type == 1) {\n\t\t\tif (verbose >= 2)\n\t\t\t\tlogerror(\"EOF on hexfile\\n\");\n\t\t\tbreak;\n\t\t}\n\n\t\tif (type != 0) {\n\t\t\tlogerror(\"unsupported record type: %u\\n\", type);\n\t\t\treturn -3;\n\t\t}\n\n\t\tif ((len * 2) + 11 > strlen(buf)) {\n\t\t\tlogerror(\"record too short?\\n\");\n\t\t\treturn -4;\n\t\t}\n\n\t\t/* FIXME check for _physically_ contiguous not just virtually\n\t\t * e.g. on FX2 0x1f00-0x2100 includes both on-chip and external\n\t\t * memory so it's not really contiguous */\n\n\t\t/* flush the saved data if it's not contiguous,\n\t\t* or when we've buffered as much as we can.\n\t\t*/\n\t\tif (data_len != 0\n\t\t\t&& (off != (data_addr + data_len)\n\t\t\t/* || !merge */\n\t\t\t|| (data_len + len) > sizeof(data))) {\n\t\t\t\tif (is_external)\n\t\t\t\t\texternal = is_external(data_addr, data_len);\n\t\t\t\trc = poke(context, data_addr, external, data, data_len);\n\t\t\t\tif (rc < 0)\n\t\t\t\t\treturn -1;\n\t\t\t\tdata_addr = off;\n\t\t\t\tdata_len = 0;\n\t\t}\n\n\t\t/* append to saved data, flush later */\n\t\tfor (idx = 0, cp = buf+9 ;  idx < len ;  idx += 1, cp += 2) {\n\t\t\ttmp = cp[2];\n\t\t\tcp[2] = 0;\n\t\t\tdata[data_len + idx] = (uint8_t)strtoul(cp, NULL, 16);\n\t\t\tcp[2] = tmp;\n\t\t}\n\t\tdata_len += len;\n\t}\n\n\n\t/* flush any data remaining */\n\tif (data_len != 0) {\n\t\tif (is_external)\n\t\t\texternal = is_external(data_addr, data_len);\n\t\trc = poke(context, data_addr, external, data, data_len);\n\t\tif (rc < 0)\n\t\t\treturn -1;\n\t}\n\treturn 0;\n}\n\n/*\n * Parse a binary image file and write it as is to the target.\n * Applies to Cypress BIX images for RAM or Cypress IIC images\n * for EEPROM.\n *\n * image       - the BIX image file\n * context     - for use by poke()\n * is_external - if non-null, used to check which segments go into\n *               external memory (writable only by software loader)\n * poke        - called with each memory segment; errors indicated\n *               by returning negative values.\n *\n * Caller is responsible for halting CPU as needed, such as when\n * overwriting a second stage loader.\n */\nstatic int parse_bin(FILE *image, void *context,\n\tbool (*is_external)(uint32_t addr, size_t len), int (*poke)(void *context,\n\tuint32_t addr, bool external, const unsigned char *data, size_t len))\n{\n\tunsigned char data[4096];\n\tuint32_t data_addr = 0;\n\tsize_t data_len = 0;\n\tint rc;\n\tbool external = false;\n\n\tfor (;;) {\n\t\tdata_len = fread(data, 1, 4096, image);\n\t\tif (data_len == 0)\n\t\t\tbreak;\n\t\tif (is_external)\n\t\t\texternal = is_external(data_addr, data_len);\n\t\trc = poke(context, data_addr, external, data, data_len);\n\t\tif (rc < 0)\n\t\t\treturn -1;\n\t\tdata_addr += (uint32_t)data_len;\n\t}\n\treturn feof(image)?0:-1;\n}\n\n/*\n * Parse a Cypress IIC image file and invoke the poke() function on the\n * various segments for writing to RAM\n *\n * image       - the IIC image file\n * context     - for use by poke()\n * is_external - if non-null, used to check which segments go into\n *               external memory (writable only by software loader)\n * poke        - called with each memory segment; errors indicated\n *               by returning negative values.\n *\n * Caller is responsible for halting CPU as needed, such as when\n * overwriting a second stage loader.\n */\nstatic int parse_iic(FILE *image, void *context,\n\tbool (*is_external)(uint32_t addr, size_t len),\n\tint (*poke)(void *context, uint32_t addr, bool external, const unsigned char *data, size_t len))\n{\n\tunsigned char data[4096];\n\tuint32_t data_addr = 0;\n\tsize_t data_len = 0, read_len;\n\tuint8_t block_header[4];\n\tint rc;\n\tbool external = false;\n\tlong file_size, initial_pos;\n\n\tinitial_pos = ftell(image);\n\tif (initial_pos < 0)\n\t\treturn -1;\n\n\tfseek(image, 0L, SEEK_END);\n\tfile_size = ftell(image);\n\tfseek(image, initial_pos, SEEK_SET);\n\tfor (;;) {\n\t\t/* Ignore the trailing reset IIC data (5 bytes) */\n\t\tif (ftell(image) >= (file_size - 5))\n\t\t\tbreak;\n\t\tif (fread(&block_header, 1, sizeof(block_header), image) != 4) {\n\t\t\tlogerror(\"unable to read IIC block header\\n\");\n\t\t\treturn -1;\n\t\t}\n\t\tdata_len = (block_header[0] << 8) + block_header[1];\n\t\tdata_addr = (block_header[2] << 8) + block_header[3];\n\t\tif (data_len > sizeof(data)) {\n\t\t\t/* If this is ever reported as an error, switch to using malloc/realloc */\n\t\t\tlogerror(\"IIC data block too small - please report this error to libusb.info\\n\");\n\t\t\treturn -1;\n\t\t}\n\t\tread_len = fread(data, 1, data_len, image);\n\t\tif (read_len != data_len) {\n\t\t\tlogerror(\"read error\\n\");\n\t\t\treturn -1;\n\t\t}\n\t\tif (is_external)\n\t\t\texternal = is_external(data_addr, data_len);\n\t\trc = poke(context, data_addr, external, data, data_len);\n\t\tif (rc < 0)\n\t\t\treturn -1;\n\t}\n\treturn 0;\n}\n\n/* the parse call will be selected according to the image type */\nstatic int (*parse[IMG_TYPE_MAX])(FILE *image, void *context, bool (*is_external)(uint32_t addr, size_t len),\n           int (*poke)(void *context, uint32_t addr, bool external, const unsigned char *data, size_t len))\n           = { parse_ihex, parse_iic, parse_bin };\n\n/*****************************************************************************/\n\n/*\n * For writing to RAM using a first (hardware) or second (software)\n * stage loader and 0xA0 or 0xA3 vendor requests\n */\ntypedef enum {\n\t_undef = 0,\n\tinternal_only,\t\t/* hardware first-stage loader */\n\tskip_internal,\t\t/* first phase, second-stage loader */\n\tskip_external\t\t/* second phase, second-stage loader */\n} ram_mode;\n\nstruct ram_poke_context {\n\tlibusb_device_handle *device;\n\tram_mode mode;\n\tsize_t total, count;\n};\n\n#define RETRY_LIMIT 5\n\nstatic int ram_poke(void *context, uint32_t addr, bool external,\n\tconst unsigned char *data, size_t len)\n{\n\tstruct ram_poke_context *ctx = (struct ram_poke_context*)context;\n\tint rc;\n\tunsigned retry = 0;\n\n\tswitch (ctx->mode) {\n\tcase internal_only:\t\t/* CPU should be stopped */\n\t\tif (external) {\n\t\t\tlogerror(\"can't write %u bytes external memory at 0x%08x\\n\",\n\t\t\t\t(unsigned)len, addr);\n\t\t\treturn -EINVAL;\n\t\t}\n\t\tbreak;\n\tcase skip_internal:\t\t/* CPU must be running */\n\t\tif (!external) {\n\t\t\tif (verbose >= 2) {\n\t\t\t\tlogerror(\"SKIP on-chip RAM, %u bytes at 0x%08x\\n\",\n\t\t\t\t\t(unsigned)len, addr);\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\tbreak;\n\tcase skip_external:\t\t/* CPU should be stopped */\n\t\tif (external) {\n\t\t\tif (verbose >= 2) {\n\t\t\t\tlogerror(\"SKIP external RAM, %u bytes at 0x%08x\\n\",\n\t\t\t\t\t(unsigned)len, addr);\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\t\tbreak;\n\tcase _undef:\n\tdefault:\n\t\tlogerror(\"bug\\n\");\n\t\treturn -EDOM;\n\t}\n\n\tctx->total += len;\n\tctx->count++;\n\n\t/* Retry this till we get a real error. Control messages are not\n\t * NAKed (just dropped) so time out means is a real problem.\n\t */\n\twhile ((rc = ezusb_write(ctx->device,\n\t\texternal ? \"write external\" : \"write on-chip\",\n\t\texternal ? RW_MEMORY : RW_INTERNAL,\n\t\taddr, data, len)) < 0\n\t\t&& retry < RETRY_LIMIT) {\n\t\tif (rc != LIBUSB_ERROR_TIMEOUT)\n\t\t\tbreak;\n\t\tretry += 1;\n\t}\n\treturn rc;\n}\n\n/*\n * Load a Cypress Image file into target RAM.\n * See http://www.cypress.com/?docID=41351 (AN76405 PDF) for more info.\n */\nstatic int fx3_load_ram(libusb_device_handle *device, const char *path)\n{\n\tuint32_t dCheckSum, dExpectedCheckSum, dAddress, i, dLen, dLength;\n\tuint32_t* dImageBuf;\n\tunsigned char *bBuf, hBuf[4], blBuf[4], rBuf[4096];\n\tFILE *image;\n\tint ret = 0;\n\n\timage = fopen(path, \"rb\");\n\tif (image == NULL) {\n\t\tlogerror(\"unable to open '%s' for input\\n\", path);\n\t\treturn -2;\n\t} else if (verbose)\n\t\tlogerror(\"open firmware image %s for RAM upload\\n\", path);\n\n\t// Read header\n\tif (fread(hBuf, sizeof(char), sizeof(hBuf), image) != sizeof(hBuf)) {\n\t\tlogerror(\"could not read image header\");\n\t\tret = -3;\n\t\tgoto exit;\n\t}\n\n\t// check \"CY\" signature byte and format\n\tif ((hBuf[0] != 'C') || (hBuf[1] != 'Y')) {\n\t\tlogerror(\"image doesn't have a CYpress signature\\n\");\n\t\tret = -3;\n\t\tgoto exit;\n\t}\n\n\t// Check bImageType\n\tswitch(hBuf[3]) {\n\tcase 0xB0:\n\t\tif (verbose)\n\t\t\tlogerror(\"normal FW binary %s image with checksum\\n\", (hBuf[2]&0x01)?\"data\":\"executable\");\n\t\tbreak;\n\tcase 0xB1:\n\t\tlogerror(\"security binary image is not currently supported\\n\");\n\t\tret = -3;\n\t\tgoto exit;\n\tcase 0xB2:\n\t\tlogerror(\"VID:PID image is not currently supported\\n\");\n\t\tret = -3;\n\t\tgoto exit;\n\tdefault:\n\t\tlogerror(\"invalid image type 0x%02X\\n\", hBuf[3]);\n\t\tret = -3;\n\t\tgoto exit;\n\t}\n\n\t// Read the bootloader version\n\tif (verbose) {\n\t\tif ((ezusb_read(device, \"read bootloader version\", RW_INTERNAL, 0xFFFF0020, blBuf, 4) < 0)) {\n\t\t\tlogerror(\"Could not read bootloader version\\n\");\n\t\t\tret = -8;\n\t\t\tgoto exit;\n\t\t}\n\t\tlogerror(\"FX3 bootloader version: 0x%02X%02X%02X%02X\\n\", blBuf[3], blBuf[2], blBuf[1], blBuf[0]);\n\t}\n\n\tdCheckSum = 0;\n\tif (verbose)\n\t\tlogerror(\"writing image...\\n\");\n\twhile (1) {\n\t\tif ((fread(&dLength, sizeof(uint32_t), 1, image) != 1) ||  // read dLength\n\t\t\t(fread(&dAddress, sizeof(uint32_t), 1, image) != 1)) { // read dAddress\n\t\t\tlogerror(\"could not read image\");\n\t\t\tret = -3;\n\t\t\tgoto exit;\n\t\t}\n\t\tif (dLength == 0)\n\t\t\tbreak; // done\n\n\t\tdImageBuf = calloc(dLength, sizeof(uint32_t));\n\t\tif (dImageBuf == NULL) {\n\t\t\tlogerror(\"could not allocate buffer for image chunk\\n\");\n\t\t\tret = -4;\n\t\t\tgoto exit;\n\t\t}\n\n\t\t// read sections\n\t\tif (fread(dImageBuf, sizeof(uint32_t), dLength, image) != dLength) {\n\t\t\tlogerror(\"could not read image\");\n\t\t\tfree(dImageBuf);\n\t\t\tret = -3;\n\t\t\tgoto exit;\n\t\t}\n\t\tfor (i = 0; i < dLength; i++)\n\t\t\tdCheckSum += dImageBuf[i];\n\t\tdLength <<= 2; // convert to Byte length\n\t\tbBuf = (unsigned char*) dImageBuf;\n\n\t\twhile (dLength > 0) {\n\t\t\tdLen = 4096; // 4K max\n\t\t\tif (dLen > dLength)\n\t\t\t\tdLen = dLength;\n\t\t\tif ((ezusb_write(device, \"write firmware\", RW_INTERNAL, dAddress, bBuf, dLen) < 0) ||\n\t\t\t\t(ezusb_read(device, \"read firmware\", RW_INTERNAL, dAddress, rBuf, dLen) < 0)) {\n\t\t\t\tlogerror(\"R/W error\\n\");\n\t\t\t\tfree(dImageBuf);\n\t\t\t\tret = -5;\n\t\t\t\tgoto exit;\n\t\t\t}\n\t\t\t// Verify data: rBuf with bBuf\n\t\t\tfor (i = 0; i < dLen; i++) {\n\t\t\t\tif (rBuf[i] != bBuf[i]) {\n\t\t\t\t\tlogerror(\"verify error\");\n\t\t\t\t\tfree(dImageBuf);\n\t\t\t\t\tret = -6;\n\t\t\t\t\tgoto exit;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdLength -= dLen;\n\t\t\tbBuf += dLen;\n\t\t\tdAddress += dLen;\n\t\t}\n\t\tfree(dImageBuf);\n\t}\n\n\t// read pre-computed checksum data\n\tif ((fread(&dExpectedCheckSum, sizeof(uint32_t), 1, image) != 1) ||\n\t\t(dCheckSum != dExpectedCheckSum)) {\n\t\tlogerror(\"checksum error\\n\");\n\t\tret = -7;\n\t\tgoto exit;\n\t}\n\n\t// transfer execution to Program Entry\n\tif (!ezusb_fx3_jump(device, dAddress)) {\n\t\tret = -6;\n\t}\n\nexit:\n\tfclose(image);\n\treturn ret;\n}\n\n/*\n * Load a firmware file into target RAM. device is the open libusb\n * device, and the path is the name of the source file. Open the file,\n * parse the bytes, and write them in one or two phases.\n *\n * If stage == 0, this uses the first stage loader, built into EZ-USB\n * hardware but limited to writing on-chip memory or CPUCS.  Everything\n * is written during one stage, unless there's an error such as the image\n * holding data that needs to be written to external memory.\n *\n * Otherwise, things are written in two stages.  First the external\n * memory is written, expecting a second stage loader to have already\n * been loaded.  Then file is re-parsed and on-chip memory is written.\n */\nint ezusb_load_ram(libusb_device_handle *device, const char *path, int fx_type, int img_type, int stage)\n{\n\tFILE *image;\n\tuint32_t cpucs_addr;\n\tbool (*is_external)(uint32_t off, size_t len);\n\tstruct ram_poke_context ctx;\n\tint status;\n\tuint8_t iic_header[8] = { 0 };\n\tint ret = 0;\n\n\tif (fx_type == FX_TYPE_FX3)\n\t\treturn fx3_load_ram(device, path);\n\n\timage = fopen(path, \"rb\");\n\tif (image == NULL) {\n\t\tlogerror(\"%s: unable to open for input.\\n\", path);\n\t\treturn -2;\n\t} else if (verbose > 1)\n\t\tlogerror(\"open firmware image %s for RAM upload\\n\", path);\n\n\tif (img_type == IMG_TYPE_IIC) {\n\t\tif ( (fread(iic_header, 1, sizeof(iic_header), image) != sizeof(iic_header))\n\t\t  || (((fx_type == FX_TYPE_FX2LP) || (fx_type == FX_TYPE_FX2)) && (iic_header[0] != 0xC2))\n\t\t  || ((fx_type == FX_TYPE_AN21) && (iic_header[0] != 0xB2))\n\t\t  || ((fx_type == FX_TYPE_FX1) && (iic_header[0] != 0xB6)) ) {\n\t\t\tlogerror(\"IIC image does not contain executable code - cannot load to RAM.\\n\");\n\t\t\tret = -1;\n\t\t\tgoto exit;\n\t\t}\n\t}\n\n\t/* EZ-USB original/FX and FX2 devices differ, apart from the 8051 core */\n\tswitch(fx_type) {\n\tcase FX_TYPE_FX2LP:\n\t\tcpucs_addr = 0xe600;\n\t\tis_external = fx2lp_is_external;\n\t\tbreak;\n\tcase FX_TYPE_FX2:\n\t\tcpucs_addr = 0xe600;\n\t\tis_external = fx2_is_external;\n\t\tbreak;\n\tdefault:\n\t\tcpucs_addr = 0x7f92;\n\t\tis_external = fx_is_external;\n\t\tbreak;\n\t}\n\n\t/* use only first stage loader? */\n\tif (stage == 0) {\n\t\tctx.mode = internal_only;\n\n\t\t/* if required, halt the CPU while we overwrite its code/data */\n\t\tif (cpucs_addr && !ezusb_cpucs(device, cpucs_addr, false))\n\t\t{\n\t\t\tret = -1;\n\t\t\tgoto exit;\n\t\t}\n\n\t\t/* 2nd stage, first part? loader was already uploaded */\n\t} else {\n\t\tctx.mode = skip_internal;\n\n\t\t/* let CPU run; overwrite the 2nd stage loader later */\n\t\tif (verbose)\n\t\t\tlogerror(\"2nd stage: write external memory\\n\");\n\t}\n\n\t/* scan the image, first (maybe only) time */\n\tctx.device = device;\n\tctx.total = ctx.count = 0;\n\tstatus = parse[img_type](image, &ctx, is_external, ram_poke);\n\tif (status < 0) {\n\t\tlogerror(\"unable to upload %s\\n\", path);\n\t\tret = status;\n\t\tgoto exit;\n\t}\n\n\t/* second part of 2nd stage: rescan */\n\t// TODO: what should we do for non HEX images there?\n\tif (stage) {\n\t\tctx.mode = skip_external;\n\n\t\t/* if needed, halt the CPU while we overwrite the 1st stage loader */\n\t\tif (cpucs_addr && !ezusb_cpucs(device, cpucs_addr, false))\n\t\t{\n\t\t\tret = -1;\n\t\t\tgoto exit;\n\t\t}\n\n\t\t/* at least write the interrupt vectors (at 0x0000) for reset! */\n\t\trewind(image);\n\t\tif (verbose)\n\t\t\tlogerror(\"2nd stage: write on-chip memory\\n\");\n\t\tstatus = parse_ihex(image, &ctx, is_external, ram_poke);\n\t\tif (status < 0) {\n\t\t\tlogerror(\"unable to completely upload %s\\n\", path);\n\t\t\tret = status;\n\t\t\tgoto exit;\n\t\t}\n\t}\n\n\tif (verbose)\n\t\tlogerror(\"... WROTE: %d bytes, %d segments, avg %d\\n\",\n\t\t(int)ctx.total, (int)ctx.count, (int)(ctx.total/ctx.count));\n\n\t/* if required, reset the CPU so it runs what we just uploaded */\n\tif (cpucs_addr && !ezusb_cpucs(device, cpucs_addr, true))\n\t\tret = -1;\n\nexit:\n\tfclose(image);\n\treturn ret;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/examples/ezusb.h",
    "content": "#ifndef __ezusb_H\n#define __ezusb_H\n/*\n * Copyright © 2001 Stephen Williams (steve@icarus.com)\n * Copyright © 2002 David Brownell (dbrownell@users.sourceforge.net)\n * Copyright © 2013 Federico Manzan (f.manzan@gmail.com)\n *\n *    This source code is free software; you can redistribute it\n *    and/or modify it in source code form under the terms of the GNU\n *    General Public License as published by the Free Software\n *    Foundation; either version 2 of the License, or (at your option)\n *    any later version.\n *\n *    This program is distributed in the hope that it will be useful,\n *    but WITHOUT ANY WARRANTY; without even the implied warranty of\n *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *    GNU General Public License for more details.\n *\n *    You should have received a copy of the GNU General Public License\n *    along with this program; if not, write to the Free Software\n *    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\n */\n#if !defined(_MSC_VER)\n#include <stdbool.h>\n#else\n#define __attribute__(x)\n#if !defined(bool)\n#define bool int\n#endif\n#if !defined(true)\n#define true (1 == 1)\n#endif\n#if !defined(false)\n#define false (!true)\n#endif\n#if defined(_PREFAST_)\n#pragma warning(disable:28193)\n#endif\n#endif\n\n#define FX_TYPE_UNDEFINED  -1\n#define FX_TYPE_AN21       0\t/* Original AnchorChips parts */\n#define FX_TYPE_FX1        1\t/* Updated Cypress versions */\n#define FX_TYPE_FX2        2\t/* USB 2.0 versions */\n#define FX_TYPE_FX2LP      3\t/* Updated FX2 */\n#define FX_TYPE_FX3        4\t/* USB 3.0 versions */\n#define FX_TYPE_MAX        5\n#define FX_TYPE_NAMES      { \"an21\", \"fx\", \"fx2\", \"fx2lp\", \"fx3\" }\n\n#define IMG_TYPE_UNDEFINED -1\n#define IMG_TYPE_HEX       0\t/* Intel HEX */\n#define IMG_TYPE_IIC       1\t/* Cypress 8051 IIC */\n#define IMG_TYPE_BIX       2\t/* Cypress 8051 BIX */\n#define IMG_TYPE_IMG       3\t/* Cypress IMG format */\n#define IMG_TYPE_MAX       4\n#define IMG_TYPE_NAMES     { \"Intel HEX\", \"Cypress 8051 IIC\", \"Cypress 8051 BIX\", \"Cypress IMG format\" }\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* \n * Automatically identified devices (VID, PID, type, designation).\n * TODO: Could use some validation. Also where's the FX2?\n */\ntypedef struct {\n\tuint16_t vid;\n\tuint16_t pid;\n\tint type;\n\tconst char* designation;\n} fx_known_device;\n\n#define FX_KNOWN_DEVICES { \\\n\t{ 0x0547, 0x2122, FX_TYPE_AN21, \"Cypress EZ-USB (2122S)\" },\\\n\t{ 0x0547, 0x2125, FX_TYPE_AN21, \"Cypress EZ-USB (2121S/2125S)\" },\\\n\t{ 0x0547, 0x2126, FX_TYPE_AN21, \"Cypress EZ-USB (2126S)\" },\\\n\t{ 0x0547, 0x2131, FX_TYPE_AN21, \"Cypress EZ-USB (2131Q/2131S/2135S)\" },\\\n\t{ 0x0547, 0x2136, FX_TYPE_AN21, \"Cypress EZ-USB (2136S)\" },\\\n\t{ 0x0547, 0x2225, FX_TYPE_AN21, \"Cypress EZ-USB (2225)\" },\\\n\t{ 0x0547, 0x2226, FX_TYPE_AN21, \"Cypress EZ-USB (2226)\" },\\\n\t{ 0x0547, 0x2235, FX_TYPE_AN21, \"Cypress EZ-USB (2235)\" },\\\n\t{ 0x0547, 0x2236, FX_TYPE_AN21, \"Cypress EZ-USB (2236)\" },\\\n\t{ 0x04b4, 0x6473, FX_TYPE_FX1, \"Cypress EZ-USB FX1\" },\\\n\t{ 0x04b4, 0x8613, FX_TYPE_FX2LP, \"Cypress EZ-USB FX2LP (68013A/68014A/68015A/68016A)\" }, \\\n\t{ 0x04b4, 0x00f3, FX_TYPE_FX3, \"Cypress FX3\" },\\\n}\n\n/*\n * This function uploads the firmware from the given file into RAM.\n * Stage == 0 means this is a single stage load (or the first of\n * two stages).  Otherwise it's the second of two stages; the \n * caller having preloaded the second stage loader.\n *\n * The target processor is reset at the end of this upload.\n */\nextern int ezusb_load_ram(libusb_device_handle *device,\n\tconst char *path, int fx_type, int img_type, int stage);\n\n/*\n * This function uploads the firmware from the given file into EEPROM.\n * This uses the right CPUCS address to terminate the EEPROM load with\n * a reset command where FX parts behave differently than FX2 ones.\n * The configuration byte is as provided here (zero for an21xx parts)\n * and the EEPROM type is set so that the microcontroller will boot\n * from it.\n *\n * The caller must have preloaded a second stage loader that knows\n * how to respond to the EEPROM write request.\n */\nextern int ezusb_load_eeprom(libusb_device_handle *device,\n\tconst char *path, int fx_type, int img_type, int config);\n\n/* Verbosity level (default 1). Can be increased or decreased with options v/q  */\nextern int verbose;\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/examples/fxload.c",
    "content": "/*\n * Copyright © 2001 Stephen Williams (steve@icarus.com)\n * Copyright © 2001-2002 David Brownell (dbrownell@users.sourceforge.net)\n * Copyright © 2008 Roger Williams (rawqux@users.sourceforge.net)\n * Copyright © 2012 Pete Batard (pete@akeo.ie)\n * Copyright © 2013 Federico Manzan (f.manzan@gmail.com)\n *\n *    This source code is free software; you can redistribute it\n *    and/or modify it in source code form under the terms of the GNU\n *    General Public License as published by the Free Software\n *    Foundation; either version 2 of the License, or (at your option)\n *    any later version.\n *\n *    This program is distributed in the hope that it will be useful,\n *    but WITHOUT ANY WARRANTY; without even the implied warranty of\n *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *    GNU General Public License for more details.\n *\n *    You should have received a copy of the GNU General Public License\n *    along with this program; if not, write to the Free Software\n *    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA\n */\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <stdint.h>\n#include <stdarg.h>\n#include <sys/types.h>\n#include <getopt.h>\n\n#include \"libusb.h\"\n#include \"ezusb.h\"\n\n#if !defined(_WIN32) || defined(__CYGWIN__ )\n#include <syslog.h>\nstatic bool dosyslog = false;\n#include <strings.h>\n#define _stricmp strcasecmp\n#endif\n\n#ifndef FXLOAD_VERSION\n#define FXLOAD_VERSION (__DATE__ \" (libusb)\")\n#endif\n\n#ifndef ARRAYSIZE\n#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))\n#endif\n\nvoid logerror(const char *format, ...)\n\t__attribute__ ((format (__printf__, 1, 2)));\n\nvoid logerror(const char *format, ...)\n{\n\tva_list ap;\n\tva_start(ap, format);\n\n#if !defined(_WIN32) || defined(__CYGWIN__ )\n\tif (dosyslog)\n\t\tvsyslog(LOG_ERR, format, ap);\n\telse\n#endif\n\t\tvfprintf(stderr, format, ap);\n\tva_end(ap);\n}\n\nstatic int print_usage(int error_code) {\n\tfprintf(stderr, \"\\nUsage: fxload [-v] [-V] [-t type] [-d vid:pid] [-p bus,addr] -i firmware\\n\");\n\tfprintf(stderr, \"  -i <path>       -- Firmware to upload\\n\");\n\tfprintf(stderr, \"  -t <type>       -- Target type: an21, fx, fx2, fx2lp, fx3\\n\");\n\tfprintf(stderr, \"  -d <vid:pid>    -- Target device, as an USB VID:PID\\n\");\n\tfprintf(stderr, \"  -p <bus,addr>   -- Target device, as a libusb bus number and device address path\\n\");\n\tfprintf(stderr, \"  -v              -- Increase verbosity\\n\");\n\tfprintf(stderr, \"  -q              -- Decrease verbosity (silent mode)\\n\");\n\tfprintf(stderr, \"  -V              -- Print program version\\n\");\n\treturn error_code;\n}\n\n#define FIRMWARE 0\n#define LOADER 1\nint main(int argc, char*argv[])\n{\n\tfx_known_device known_device[] = FX_KNOWN_DEVICES;\n\tconst char *path[] = { NULL, NULL };\n\tconst char *device_id = NULL;\n\tconst char *device_path = getenv(\"DEVICE\");\n\tconst char *type = NULL;\n\tconst char *fx_name[FX_TYPE_MAX] = FX_TYPE_NAMES;\n\tconst char *ext, *img_name[] = IMG_TYPE_NAMES;\n\tint fx_type = FX_TYPE_UNDEFINED, img_type[ARRAYSIZE(path)];\n\tint i, j, opt, status;\n\tunsigned vid = 0, pid = 0;\n\tunsigned busnum = 0, devaddr = 0, _busnum, _devaddr;\n\tlibusb_device *dev, **devs;\n\tlibusb_device_handle *device = NULL;\n\tstruct libusb_device_descriptor desc;\n\n\twhile ((opt = getopt(argc, argv, \"qvV?hd:p:i:I:t:\")) != EOF)\n\t\tswitch (opt) {\n\n\t\tcase 'd':\n\t\t\tdevice_id = optarg;\n\t\t\tif (sscanf(device_id, \"%x:%x\" , &vid, &pid) != 2 ) {\n\t\t\t\tfputs (\"please specify VID & PID as \\\"vid:pid\\\" in hexadecimal format\\n\", stderr);\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'p':\n\t\t\tdevice_path = optarg;\n\t\t\tif (sscanf(device_path, \"%u,%u\", &busnum, &devaddr) != 2 ) {\n\t\t\t\tfputs (\"please specify bus number & device number as \\\"bus,dev\\\" in decimal format\\n\", stderr);\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'i':\n\t\tcase 'I':\n\t\t\tpath[FIRMWARE] = optarg;\n\t\t\tbreak;\n\n\t\tcase 'V':\n\t\t\tputs(FXLOAD_VERSION);\n\t\t\treturn 0;\n\n\t\tcase 't':\n\t\t\ttype = optarg;\n\t\t\tbreak;\n\n\t\tcase 'v':\n\t\t\tverbose++;\n\t\t\tbreak;\n\n\t\tcase 'q':\n\t\t\tverbose--;\n\t\t\tbreak;\n\n\t\tcase '?':\n\t\tcase 'h':\n\t\tdefault:\n\t\t\treturn print_usage(-1);\n\n\t}\n\n\tif (path[FIRMWARE] == NULL) {\n\t\tlogerror(\"no firmware specified!\\n\");\n\t\treturn print_usage(-1);\n\t}\n\tif ((device_id != NULL) && (device_path != NULL)) {\n\t\tlogerror(\"only one of -d or -p can be specified\\n\");\n\t\treturn print_usage(-1);\n\t}\n\n\t/* determine the target type */\n\tif (type != NULL) {\n\t\tfor (i=0; i<FX_TYPE_MAX; i++) {\n\t\t\tif (strcmp(type, fx_name[i]) == 0) {\n\t\t\t\tfx_type = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (i >= FX_TYPE_MAX) {\n\t\t\tlogerror(\"illegal microcontroller type: %s\\n\", type);\n\t\t\treturn print_usage(-1);\n\t\t}\n\t}\n\n\t/* open the device using libusb */\n\tstatus = libusb_init(NULL);\n\tif (status < 0) {\n\t\tlogerror(\"libusb_init() failed: %s\\n\", libusb_error_name(status));\n\t\treturn -1;\n\t}\n\tlibusb_set_debug(NULL, verbose);\n\n\t/* try to pick up missing parameters from known devices */\n\tif ((type == NULL) || (device_id == NULL) || (device_path != NULL)) {\n\t\tif (libusb_get_device_list(NULL, &devs) < 0) {\n\t\t\tlogerror(\"libusb_get_device_list() failed: %s\\n\", libusb_error_name(status));\n\t\t\tgoto err;\n\t\t}\n\t\tfor (i=0; (dev=devs[i]) != NULL; i++) {\n\t\t\t_busnum = libusb_get_bus_number(dev);\n\t\t\t_devaddr = libusb_get_device_address(dev);\n\t\t\tif ((type != NULL) && (device_path != NULL)) {\n\t\t\t\t// if both a type and bus,addr were specified, we just need to find our match\n\t\t\t\tif ((libusb_get_bus_number(dev) == busnum) && (libusb_get_device_address(dev) == devaddr))\n\t\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tstatus = libusb_get_device_descriptor(dev, &desc);\n\t\t\t\tif (status >= 0) {\n\t\t\t\t\tif (verbose >= 3) {\n\t\t\t\t\t\tlogerror(\"examining %04x:%04x (%d,%d)\\n\",\n\t\t\t\t\t\t\tdesc.idVendor, desc.idProduct, _busnum, _devaddr);\n\t\t\t\t\t}\n\t\t\t\t\tfor (j=0; j<ARRAYSIZE(known_device); j++) {\n\t\t\t\t\t\tif ((desc.idVendor == known_device[j].vid)\n\t\t\t\t\t\t\t&& (desc.idProduct == known_device[j].pid)) {\n\t\t\t\t\t\t\tif (// nothing was specified\n\t\t\t\t\t\t\t\t((type == NULL) && (device_id == NULL) && (device_path == NULL)) ||\n\t\t\t\t\t\t\t\t// vid:pid was specified and we have a match\n\t\t\t\t\t\t\t\t((type == NULL) && (device_id != NULL) && (vid == desc.idVendor) && (pid == desc.idProduct)) ||\n\t\t\t\t\t\t\t\t// bus,addr was specified and we have a match\n\t\t\t\t\t\t\t\t((type == NULL) && (device_path != NULL) && (busnum == _busnum) && (devaddr == _devaddr)) ||\n\t\t\t\t\t\t\t\t// type was specified and we have a match\n\t\t\t\t\t\t\t\t((type != NULL) && (device_id == NULL) && (device_path == NULL) && (fx_type == known_device[j].type)) ) {\n\t\t\t\t\t\t\t\tfx_type = known_device[j].type;\n\t\t\t\t\t\t\t\tvid = desc.idVendor;\n\t\t\t\t\t\t\t\tpid = desc.idProduct;\n\t\t\t\t\t\t\t\tbusnum = _busnum;\n\t\t\t\t\t\t\t\tdevaddr = _devaddr;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (j < ARRAYSIZE(known_device)) {\n\t\t\t\t\t\tif (verbose)\n\t\t\t\t\t\t\tlogerror(\"found device '%s' [%04x:%04x] (%d,%d)\\n\",\n\t\t\t\t\t\t\t\tknown_device[j].designation, vid, pid, busnum, devaddr);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (dev == NULL) {\n\t\t\tlibusb_free_device_list(devs, 1);\n\t\t\tlogerror(\"could not find a known device - please specify type and/or vid:pid and/or bus,dev\\n\");\n\t\t\treturn print_usage(-1);\n\t\t}\n\t\tstatus = libusb_open(dev, &device);\n\t\tif (status < 0) {\n\t\t\tlogerror(\"libusb_open() failed: %s\\n\", libusb_error_name(status));\n\t\t\tgoto err;\n\t\t}\n\t\tlibusb_free_device_list(devs, 1);\n\t} else if (device_id != NULL) {\n\t\tdevice = libusb_open_device_with_vid_pid(NULL, (uint16_t)vid, (uint16_t)pid);\n\t\tif (device == NULL) {\n\t\t\tlogerror(\"libusb_open() failed\\n\");\n\t\t\tgoto err;\n\t\t}\n\t}\n\n\t/* We need to claim the first interface */\n\tlibusb_set_auto_detach_kernel_driver(device, 1);\n\tstatus = libusb_claim_interface(device, 0);\n\tif (status != LIBUSB_SUCCESS) {\n\t\tlogerror(\"libusb_claim_interface failed: %s\\n\", libusb_error_name(status));\n\t\tgoto err;\n\t}\n\n\tif (verbose)\n\t\tlogerror(\"microcontroller type: %s\\n\", fx_name[fx_type]);\n\n\tfor (i=0; i<ARRAYSIZE(path); i++) {\n\t\tif (path[i] != NULL) {\n\t\t\text = path[i] + strlen(path[i]) - 4;\n\t\t\tif ((_stricmp(ext, \".hex\") == 0) || (strcmp(ext, \".ihx\") == 0))\n\t\t\t\timg_type[i] = IMG_TYPE_HEX;\n\t\t\telse if (_stricmp(ext, \".iic\") == 0)\n\t\t\t\timg_type[i] = IMG_TYPE_IIC;\n\t\t\telse if (_stricmp(ext, \".bix\") == 0)\n\t\t\t\timg_type[i] = IMG_TYPE_BIX;\n\t\t\telse if (_stricmp(ext, \".img\") == 0)\n\t\t\t\timg_type[i] = IMG_TYPE_IMG;\n\t\t\telse {\n\t\t\t\tlogerror(\"%s is not a recognized image type\\n\", path[i]);\n\t\t\t\tgoto err;\n\t\t\t}\n\t\t}\n\t\tif (verbose && path[i] != NULL)\n\t\t\tlogerror(\"%s: type %s\\n\", path[i], img_name[img_type[i]]);\n\t}\n\n\t/* single stage, put into internal memory */\n\tif (verbose > 1)\n\t\tlogerror(\"single stage: load on-chip memory\\n\");\n\tstatus = ezusb_load_ram(device, path[FIRMWARE], fx_type, img_type[FIRMWARE], 0);\n\n\tlibusb_release_interface(device, 0);\n\tlibusb_close(device);\n\tlibusb_exit(NULL);\n\treturn status;\nerr:\n\tlibusb_exit(NULL);\n\treturn -1;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/examples/getopt/getopt.c",
    "content": "/* Getopt for GNU.\n   NOTE: getopt is now part of the C library, so if you don't know what\n   \"Keep this file name-space clean\" means, talk to drepper@gnu.org\n   before changing it!\n   Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001\n   \tFree Software Foundation, Inc.\n   This file is part of the GNU C Library.\n\n   The GNU C Library is free software; you can redistribute it and/or\n   modify it under the terms of the GNU Lesser General Public\n   License as published by the Free Software Foundation; either\n   version 2.1 of the License, or (at your option) any later version.\n\n   The GNU C Library is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Lesser General Public License for more details.\n\n   You should have received a copy of the GNU Lesser General Public\n   License along with the GNU C Library; if not, write to the Free\n   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n   02111-1307 USA.  */\n\f\n/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.\n   Ditto for AIX 3.2 and <stdlib.h>.  */\n#ifndef _NO_PROTO\n# define _NO_PROTO\n#endif\n\n#ifdef HAVE_CONFIG_H\n# include <config.h>\n#endif\n\n#if !defined __STDC__ || !__STDC__\n/* This is a separate conditional since some stdc systems\n   reject `defined (const)'.  */\n# ifndef const\n#  define const\n# endif\n#endif\n\n#include <stdio.h>\n\n/* Comment out all this code if we are using the GNU C Library, and are not\n   actually compiling the library itself.  This code is part of the GNU C\n   Library, but also included in many other GNU distributions.  Compiling\n   and linking in this code is a waste when using the GNU C library\n   (especially if it is a shared library).  Rather than having every GNU\n   program understand `configure --with-gnu-libc' and omit the object files,\n   it is simpler to just do this in the source for each such file.  */\n\n#define GETOPT_INTERFACE_VERSION 2\n#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2\n# include <gnu-versions.h>\n# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION\n#  define ELIDE_CODE\n# endif\n#endif\n\n#ifndef ELIDE_CODE\n\n\n/* This needs to come after some library #include\n   to get __GNU_LIBRARY__ defined.  */\n#ifdef\t__GNU_LIBRARY__\n/* Don't include stdlib.h for non-GNU C libraries because some of them\n   contain conflicting prototypes for getopt.  */\n# include <stdlib.h>\n# include <unistd.h>\n#endif\t/* GNU C library.  */\n\n#ifdef VMS\n# include <unixlib.h>\n# if HAVE_STRING_H - 0\n#  include <string.h>\n# endif\n#endif\n\n#ifndef _\n/* This is for other GNU distributions with internationalized messages.  */\n# if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC\n#  include <libintl.h>\n#  ifndef _\n#   define _(msgid)\tgettext (msgid)\n#  endif\n# else\n#  define _(msgid)\t(msgid)\n# endif\n#endif\n\n/* This version of `getopt' appears to the caller like standard Unix `getopt'\n   but it behaves differently for the user, since it allows the user\n   to intersperse the options with the other arguments.\n\n   As `getopt' works, it permutes the elements of ARGV so that,\n   when it is done, all the options precede everything else.  Thus\n   all application programs are extended to handle flexible argument order.\n\n   Setting the environment variable POSIXLY_CORRECT disables permutation.\n   Then the behavior is completely standard.\n\n   GNU application programs can use a third alternative mode in which\n   they can distinguish the relative order of options and other arguments.  */\n\n#include \"getopt.h\"\n\n/* For communication from `getopt' to the caller.\n   When `getopt' finds an option that takes an argument,\n   the argument value is returned here.\n   Also, when `ordering' is RETURN_IN_ORDER,\n   each non-option ARGV-element is returned here.  */\n\nchar *optarg;\n\n/* Index in ARGV of the next element to be scanned.\n   This is used for communication to and from the caller\n   and for communication between successive calls to `getopt'.\n\n   On entry to `getopt', zero means this is the first call; initialize.\n\n   When `getopt' returns -1, this is the index of the first of the\n   non-option elements that the caller should itself scan.\n\n   Otherwise, `optind' communicates from one call to the next\n   how much of ARGV has been scanned so far.  */\n\n/* 1003.2 says this must be 1 before any call.  */\nint optind = 1;\n\n/* Formerly, initialization of getopt depended on optind==0, which\n   causes problems with re-calling getopt as programs generally don't\n   know that. */\n\nint __getopt_initialized;\n\n/* The next char to be scanned in the option-element\n   in which the last option character we returned was found.\n   This allows us to pick up the scan where we left off.\n\n   If this is zero, or a null string, it means resume the scan\n   by advancing to the next ARGV-element.  */\n\nstatic char *nextchar;\n\n/* Callers store zero here to inhibit the error message\n   for unrecognized options.  */\n\nint opterr = 1;\n\n/* Set to an option character which was unrecognized.\n   This must be initialized on some systems to avoid linking in the\n   system's own getopt implementation.  */\n\nint optopt = '?';\n\n/* Describe how to deal with options that follow non-option ARGV-elements.\n\n   If the caller did not specify anything,\n   the default is REQUIRE_ORDER if the environment variable\n   POSIXLY_CORRECT is defined, PERMUTE otherwise.\n\n   REQUIRE_ORDER means don't recognize them as options;\n   stop option processing when the first non-option is seen.\n   This is what Unix does.\n   This mode of operation is selected by either setting the environment\n   variable POSIXLY_CORRECT, or using `+' as the first character\n   of the list of option characters.\n\n   PERMUTE is the default.  We permute the contents of ARGV as we scan,\n   so that eventually all the non-options are at the end.  This allows options\n   to be given in any order, even with programs that were not written to\n   expect this.\n\n   RETURN_IN_ORDER is an option available to programs that were written\n   to expect options and other ARGV-elements in any order and that care about\n   the ordering of the two.  We describe each non-option ARGV-element\n   as if it were the argument of an option with character code 1.\n   Using `-' as the first character of the list of option characters\n   selects this mode of operation.\n\n   The special argument `--' forces an end of option-scanning regardless\n   of the value of `ordering'.  In the case of RETURN_IN_ORDER, only\n   `--' can cause `getopt' to return -1 with `optind' != ARGC.  */\n\nstatic enum\n{\n  REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER\n} ordering;\n\n/* Value of POSIXLY_CORRECT environment variable.  */\nstatic char *posixly_correct;\n\f\n#ifdef\t__GNU_LIBRARY__\n/* We want to avoid inclusion of string.h with non-GNU libraries\n   because there are many ways it can cause trouble.\n   On some systems, it contains special magic macros that don't work\n   in GCC.  */\n# include <string.h>\n# define my_index\tstrchr\n#else\n\n# if HAVE_STRING_H\n#  include <string.h>\n# else\n#  include <strings.h>\n# endif\n\n/* Avoid depending on library functions or files\n   whose names are inconsistent.  */\n\n#ifndef getenv\n#ifdef _MSC_VER\n// DDK will complain if you don't use the stdlib defined getenv\n#include <stdlib.h>\n#else\nextern char *getenv ();\n#endif\n#endif\n\nstatic char *\nmy_index (str, chr)\n     const char *str;\n     int chr;\n{\n  while (*str)\n    {\n      if (*str == chr)\n\treturn (char *) str;\n      str++;\n    }\n  return 0;\n}\n\n/* If using GCC, we can safely declare strlen this way.\n   If not using GCC, it is ok not to declare it.  */\n#ifdef __GNUC__\n/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.\n   That was relevant to code that was here before.  */\n# if (!defined __STDC__ || !__STDC__) && !defined strlen\n/* gcc with -traditional declares the built-in strlen to return int,\n   and has done so at least since version 2.4.5. -- rms.  */\nextern int strlen (const char *);\n# endif /* not __STDC__ */\n#endif /* __GNUC__ */\n\n#endif /* not __GNU_LIBRARY__ */\n\f\n/* Handle permutation of arguments.  */\n\n/* Describe the part of ARGV that contains non-options that have\n   been skipped.  `first_nonopt' is the index in ARGV of the first of them;\n   `last_nonopt' is the index after the last of them.  */\n\nstatic int first_nonopt;\nstatic int last_nonopt;\n\n#ifdef _LIBC\n/* Stored original parameters.\n   XXX This is no good solution.  We should rather copy the args so\n   that we can compare them later.  But we must not use malloc(3).  */\nextern int __libc_argc;\nextern char **__libc_argv;\n\n/* Bash 2.0 gives us an environment variable containing flags\n   indicating ARGV elements that should not be considered arguments.  */\n\n# ifdef USE_NONOPTION_FLAGS\n/* Defined in getopt_init.c  */\nextern char *__getopt_nonoption_flags;\n\nstatic int nonoption_flags_max_len;\nstatic int nonoption_flags_len;\n# endif\n\n# ifdef USE_NONOPTION_FLAGS\n#  define SWAP_FLAGS(ch1, ch2) \\\n  if (nonoption_flags_len > 0)\t\t\t\t\t\t      \\\n    {\t\t\t\t\t\t\t\t\t      \\\n      char __tmp = __getopt_nonoption_flags[ch1];\t\t\t      \\\n      __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2];\t      \\\n      __getopt_nonoption_flags[ch2] = __tmp;\t\t\t\t      \\\n    }\n# else\n#  define SWAP_FLAGS(ch1, ch2)\n# endif\n#else\t/* !_LIBC */\n# define SWAP_FLAGS(ch1, ch2)\n#endif\t/* _LIBC */\n\n/* Exchange two adjacent subsequences of ARGV.\n   One subsequence is elements [first_nonopt,last_nonopt)\n   which contains all the non-options that have been skipped so far.\n   The other is elements [last_nonopt,optind), which contains all\n   the options processed since those non-options were skipped.\n\n   `first_nonopt' and `last_nonopt' are relocated so that they describe\n   the new indices of the non-options in ARGV after they are moved.  */\n\n#if defined __STDC__ && __STDC__\nstatic void exchange (char **);\n#endif\n\nstatic void\nexchange (argv)\n     char **argv;\n{\n  int bottom = first_nonopt;\n  int middle = last_nonopt;\n  int top = optind;\n  char *tem;\n\n  /* Exchange the shorter segment with the far end of the longer segment.\n     That puts the shorter segment into the right place.\n     It leaves the longer segment in the right place overall,\n     but it consists of two parts that need to be swapped next.  */\n\n#if defined _LIBC && defined USE_NONOPTION_FLAGS\n  /* First make sure the handling of the `__getopt_nonoption_flags'\n     string can work normally.  Our top argument must be in the range\n     of the string.  */\n  if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)\n    {\n      /* We must extend the array.  The user plays games with us and\n\t presents new arguments.  */\n      char *new_str = malloc (top + 1);\n      if (new_str == NULL)\n\tnonoption_flags_len = nonoption_flags_max_len = 0;\n      else\n\t{\n\t  memset (__mempcpy (new_str, __getopt_nonoption_flags,\n\t\t\t     nonoption_flags_max_len),\n\t\t  '\\0', top + 1 - nonoption_flags_max_len);\n\t  nonoption_flags_max_len = top + 1;\n\t  __getopt_nonoption_flags = new_str;\n\t}\n    }\n#endif\n\n  while (top > middle && middle > bottom)\n    {\n      if (top - middle > middle - bottom)\n\t{\n\t  /* Bottom segment is the short one.  */\n\t  int len = middle - bottom;\n\t  register int i;\n\n\t  /* Swap it with the top part of the top segment.  */\n\t  for (i = 0; i < len; i++)\n\t    {\n\t      tem = argv[bottom + i];\n\t      argv[bottom + i] = argv[top - (middle - bottom) + i];\n\t      argv[top - (middle - bottom) + i] = tem;\n\t      SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);\n\t    }\n\t  /* Exclude the moved bottom segment from further swapping.  */\n\t  top -= len;\n\t}\n      else\n\t{\n\t  /* Top segment is the short one.  */\n\t  int len = top - middle;\n\t  register int i;\n\n\t  /* Swap it with the bottom part of the bottom segment.  */\n\t  for (i = 0; i < len; i++)\n\t    {\n\t      tem = argv[bottom + i];\n\t      argv[bottom + i] = argv[middle + i];\n\t      argv[middle + i] = tem;\n\t      SWAP_FLAGS (bottom + i, middle + i);\n\t    }\n\t  /* Exclude the moved top segment from further swapping.  */\n\t  bottom += len;\n\t}\n    }\n\n  /* Update records for the slots the non-options now occupy.  */\n\n  first_nonopt += (optind - last_nonopt);\n  last_nonopt = optind;\n}\n\n/* Initialize the internal data when the first call is made.  */\n\n#if defined __STDC__ && __STDC__\nstatic const char *_getopt_initialize (int, char *const *, const char *);\n#endif\nstatic const char *\n_getopt_initialize (argc, argv, optstring)\n     int argc;\n     char *const *argv;\n     const char *optstring;\n{\n  /* Start processing options with ARGV-element 1 (since ARGV-element 0\n     is the program name); the sequence of previously skipped\n     non-option ARGV-elements is empty.  */\n\n  first_nonopt = last_nonopt = optind;\n\n  nextchar = NULL;\n\n  posixly_correct = getenv (\"POSIXLY_CORRECT\");\n\n  /* Determine how to handle the ordering of options and nonoptions.  */\n\n  if (optstring[0] == '-')\n    {\n      ordering = RETURN_IN_ORDER;\n      ++optstring;\n    }\n  else if (optstring[0] == '+')\n    {\n      ordering = REQUIRE_ORDER;\n      ++optstring;\n    }\n  else if (posixly_correct != NULL)\n    ordering = REQUIRE_ORDER;\n  else\n    ordering = PERMUTE;\n\n#if defined _LIBC && defined USE_NONOPTION_FLAGS\n  if (posixly_correct == NULL\n      && argc == __libc_argc && argv == __libc_argv)\n    {\n      if (nonoption_flags_max_len == 0)\n\t{\n\t  if (__getopt_nonoption_flags == NULL\n\t      || __getopt_nonoption_flags[0] == '\\0')\n\t    nonoption_flags_max_len = -1;\n\t  else\n\t    {\n\t      const char *orig_str = __getopt_nonoption_flags;\n\t      int len = nonoption_flags_max_len = strlen (orig_str);\n\t      if (nonoption_flags_max_len < argc)\n\t\tnonoption_flags_max_len = argc;\n\t      __getopt_nonoption_flags =\n\t\t(char *) malloc (nonoption_flags_max_len);\n\t      if (__getopt_nonoption_flags == NULL)\n\t\tnonoption_flags_max_len = -1;\n\t      else\n\t\tmemset (__mempcpy (__getopt_nonoption_flags, orig_str, len),\n\t\t\t'\\0', nonoption_flags_max_len - len);\n\t    }\n\t}\n      nonoption_flags_len = nonoption_flags_max_len;\n    }\n  else\n    nonoption_flags_len = 0;\n#endif\n\n  return optstring;\n}\n\f\n/* Scan elements of ARGV (whose length is ARGC) for option characters\n   given in OPTSTRING.\n\n   If an element of ARGV starts with '-', and is not exactly \"-\" or \"--\",\n   then it is an option element.  The characters of this element\n   (aside from the initial '-') are option characters.  If `getopt'\n   is called repeatedly, it returns successively each of the option characters\n   from each of the option elements.\n\n   If `getopt' finds another option character, it returns that character,\n   updating `optind' and `nextchar' so that the next call to `getopt' can\n   resume the scan with the following option character or ARGV-element.\n\n   If there are no more option characters, `getopt' returns -1.\n   Then `optind' is the index in ARGV of the first ARGV-element\n   that is not an option.  (The ARGV-elements have been permuted\n   so that those that are not options now come last.)\n\n   OPTSTRING is a string containing the legitimate option characters.\n   If an option character is seen that is not listed in OPTSTRING,\n   return '?' after printing an error message.  If you set `opterr' to\n   zero, the error message is suppressed but we still return '?'.\n\n   If a char in OPTSTRING is followed by a colon, that means it wants an arg,\n   so the following text in the same ARGV-element, or the text of the following\n   ARGV-element, is returned in `optarg'.  Two colons mean an option that\n   wants an optional arg; if there is text in the current ARGV-element,\n   it is returned in `optarg', otherwise `optarg' is set to zero.\n\n   If OPTSTRING starts with `-' or `+', it requests different methods of\n   handling the non-option ARGV-elements.\n   See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.\n\n   Long-named options begin with `--' instead of `-'.\n   Their names may be abbreviated as long as the abbreviation is unique\n   or is an exact match for some defined option.  If they have an\n   argument, it follows the option name in the same ARGV-element, separated\n   from the option name by a `=', or else the in next ARGV-element.\n   When `getopt' finds a long-named option, it returns 0 if that option's\n   `flag' field is nonzero, the value of the option's `val' field\n   if the `flag' field is zero.\n\n   The elements of ARGV aren't really const, because we permute them.\n   But we pretend they're const in the prototype to be compatible\n   with other systems.\n\n   LONGOPTS is a vector of `struct option' terminated by an\n   element containing a name which is zero.\n\n   LONGIND returns the index in LONGOPT of the long-named option found.\n   It is only valid when a long-named option has been found by the most\n   recent call.\n\n   If LONG_ONLY is nonzero, '-' as well as '--' can introduce\n   long-named options.  */\n\nint\n_getopt_internal (argc, argv, optstring, longopts, longind, long_only)\n     int argc;\n     char *const *argv;\n     const char *optstring;\n     const struct option *longopts;\n     int *longind;\n     int long_only;\n{\n  int print_errors = opterr;\n  if (optstring[0] == ':')\n    print_errors = 0;\n\n  if (argc < 1)\n    return -1;\n\n  optarg = NULL;\n\n  if (optind == 0 || !__getopt_initialized)\n    {\n      if (optind == 0)\n\toptind = 1;\t/* Don't scan ARGV[0], the program name.  */\n      optstring = _getopt_initialize (argc, argv, optstring);\n      __getopt_initialized = 1;\n    }\n\n  /* Test whether ARGV[optind] points to a non-option argument.\n     Either it does not have option syntax, or there is an environment flag\n     from the shell indicating it is not an option.  The later information\n     is only used when the used in the GNU libc.  */\n#if defined _LIBC && defined USE_NONOPTION_FLAGS\n# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\\0'\t      \\\n\t\t      || (optind < nonoption_flags_len\t\t\t      \\\n\t\t\t  && __getopt_nonoption_flags[optind] == '1'))\n#else\n# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\\0')\n#endif\n\n  if (nextchar == NULL || *nextchar == '\\0')\n    {\n      /* Advance to the next ARGV-element.  */\n\n      /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been\n\t moved back by the user (who may also have changed the arguments).  */\n      if (last_nonopt > optind)\n\tlast_nonopt = optind;\n      if (first_nonopt > optind)\n\tfirst_nonopt = optind;\n\n      if (ordering == PERMUTE)\n\t{\n\t  /* If we have just processed some options following some non-options,\n\t     exchange them so that the options come first.  */\n\n\t  if (first_nonopt != last_nonopt && last_nonopt != optind)\n\t    exchange ((char **) argv);\n\t  else if (last_nonopt != optind)\n\t    first_nonopt = optind;\n\n\t  /* Skip any additional non-options\n\t     and extend the range of non-options previously skipped.  */\n\n\t  while (optind < argc && NONOPTION_P)\n\t    optind++;\n\t  last_nonopt = optind;\n\t}\n\n      /* The special ARGV-element `--' means premature end of options.\n\t Skip it like a null option,\n\t then exchange with previous non-options as if it were an option,\n\t then skip everything else like a non-option.  */\n\n      if (optind != argc && !strcmp (argv[optind], \"--\"))\n\t{\n\t  optind++;\n\n\t  if (first_nonopt != last_nonopt && last_nonopt != optind)\n\t    exchange ((char **) argv);\n\t  else if (first_nonopt == last_nonopt)\n\t    first_nonopt = optind;\n\t  last_nonopt = argc;\n\n\t  optind = argc;\n\t}\n\n      /* If we have done all the ARGV-elements, stop the scan\n\t and back over any non-options that we skipped and permuted.  */\n\n      if (optind == argc)\n\t{\n\t  /* Set the next-arg-index to point at the non-options\n\t     that we previously skipped, so the caller will digest them.  */\n\t  if (first_nonopt != last_nonopt)\n\t    optind = first_nonopt;\n\t  return -1;\n\t}\n\n      /* If we have come to a non-option and did not permute it,\n\t either stop the scan or describe it to the caller and pass it by.  */\n\n      if (NONOPTION_P)\n\t{\n\t  if (ordering == REQUIRE_ORDER)\n\t    return -1;\n\t  optarg = argv[optind++];\n\t  return 1;\n\t}\n\n      /* We have found another option-ARGV-element.\n\t Skip the initial punctuation.  */\n\n      nextchar = (argv[optind] + 1\n\t\t  + (longopts != NULL && argv[optind][1] == '-'));\n    }\n\n  /* Decode the current option-ARGV-element.  */\n\n  /* Check whether the ARGV-element is a long option.\n\n     If long_only and the ARGV-element has the form \"-f\", where f is\n     a valid short option, don't consider it an abbreviated form of\n     a long option that starts with f.  Otherwise there would be no\n     way to give the -f short option.\n\n     On the other hand, if there's a long option \"fubar\" and\n     the ARGV-element is \"-fu\", do consider that an abbreviation of\n     the long option, just like \"--fu\", and not \"-f\" with arg \"u\".\n\n     This distinction seems to be the most useful approach.  */\n\n  if (longopts != NULL\n      && (argv[optind][1] == '-'\n\t  || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))\n    {\n      char *nameend;\n      const struct option *p;\n      const struct option *pfound = NULL;\n      int exact = 0;\n      int ambig = 0;\n      int indfound = -1;\n      int option_index;\n\n      for (nameend = nextchar; *nameend && *nameend != '='; nameend++)\n\t/* Do nothing.  */ ;\n\n      /* Test all long options for either exact match\n\t or abbreviated matches.  */\n      for (p = longopts, option_index = 0; p->name; p++, option_index++)\n\tif (!strncmp (p->name, nextchar, nameend - nextchar))\n\t  {\n\t    if ((unsigned int) (nameend - nextchar)\n\t\t== (unsigned int) strlen (p->name))\n\t      {\n\t\t/* Exact match found.  */\n\t\tpfound = p;\n\t\tindfound = option_index;\n\t\texact = 1;\n\t\tbreak;\n\t      }\n\t    else if (pfound == NULL)\n\t      {\n\t\t/* First nonexact match found.  */\n\t\tpfound = p;\n\t\tindfound = option_index;\n\t      }\n\t    else if (long_only\n\t\t     || pfound->has_arg != p->has_arg\n\t\t     || pfound->flag != p->flag\n\t\t     || pfound->val != p->val)\n\t      /* Second or later nonexact match found.  */\n\t      ambig = 1;\n\t  }\n\n      if (ambig && !exact)\n\t{\n\t  if (print_errors)\n\t    fprintf (stderr, _(\"%s: option `%s' is ambiguous\\n\"),\n\t\t     argv[0], argv[optind]);\n\t  nextchar += strlen (nextchar);\n\t  optind++;\n\t  optopt = 0;\n\t  return '?';\n\t}\n\n      if (pfound != NULL)\n\t{\n\t  option_index = indfound;\n\t  optind++;\n\t  if (*nameend)\n\t    {\n\t      /* Don't test has_arg with >, because some C compilers don't\n\t\t allow it to be used on enums.  */\n\t      if (pfound->has_arg)\n\t\toptarg = nameend + 1;\n\t      else\n\t\t{\n\t\t  if (print_errors)\n\t\t    {\n\t\t      if (argv[optind - 1][1] == '-')\n\t\t\t/* --option */\n\t\t\tfprintf (stderr,\n\t\t\t\t _(\"%s: option `--%s' doesn't allow an argument\\n\"),\n\t\t\t\t argv[0], pfound->name);\n\t\t      else\n\t\t\t/* +option or -option */\n\t\t\tfprintf (stderr,\n\t\t\t\t _(\"%s: option `%c%s' doesn't allow an argument\\n\"),\n\t\t\t\t argv[0], argv[optind - 1][0], pfound->name);\n\t\t    }\n\n\t\t  nextchar += strlen (nextchar);\n\n\t\t  optopt = pfound->val;\n\t\t  return '?';\n\t\t}\n\t    }\n\t  else if (pfound->has_arg == 1)\n\t    {\n\t      if (optind < argc)\n\t\toptarg = argv[optind++];\n\t      else\n\t\t{\n\t\t  if (print_errors)\n\t\t    fprintf (stderr,\n\t\t\t   _(\"%s: option `%s' requires an argument\\n\"),\n\t\t\t   argv[0], argv[optind - 1]);\n\t\t  nextchar += strlen (nextchar);\n\t\t  optopt = pfound->val;\n\t\t  return optstring[0] == ':' ? ':' : '?';\n\t\t}\n\t    }\n\t  nextchar += strlen (nextchar);\n\t  if (longind != NULL)\n\t    *longind = option_index;\n\t  if (pfound->flag)\n\t    {\n\t      *(pfound->flag) = pfound->val;\n\t      return 0;\n\t    }\n\t  return pfound->val;\n\t}\n\n      /* Can't find it as a long option.  If this is not getopt_long_only,\n\t or the option starts with '--' or is not a valid short\n\t option, then it's an error.\n\t Otherwise interpret it as a short option.  */\n      if (!long_only || argv[optind][1] == '-'\n\t  || my_index (optstring, *nextchar) == NULL)\n\t{\n\t  if (print_errors)\n\t    {\n\t      if (argv[optind][1] == '-')\n\t\t/* --option */\n\t\tfprintf (stderr, _(\"%s: unrecognized option `--%s'\\n\"),\n\t\t\t argv[0], nextchar);\n\t      else\n\t\t/* +option or -option */\n\t\tfprintf (stderr, _(\"%s: unrecognized option `%c%s'\\n\"),\n\t\t\t argv[0], argv[optind][0], nextchar);\n\t    }\n\t  nextchar = (char *) \"\";\n\t  optind++;\n\t  optopt = 0;\n\t  return '?';\n\t}\n    }\n\n  /* Look at and handle the next short option-character.  */\n\n  {\n    char c = *nextchar++;\n    char *temp = my_index (optstring, c);\n\n    /* Increment `optind' when we start to process its last character.  */\n    if (*nextchar == '\\0')\n      ++optind;\n\n    if (temp == NULL || c == ':')\n      {\n\tif (print_errors)\n\t  {\n\t    if (posixly_correct)\n\t      /* 1003.2 specifies the format of this message.  */\n\t      fprintf (stderr, _(\"%s: illegal option -- %c\\n\"),\n\t\t       argv[0], c);\n\t    else\n\t      fprintf (stderr, _(\"%s: invalid option -- %c\\n\"),\n\t\t       argv[0], c);\n\t  }\n\toptopt = c;\n\treturn '?';\n      }\n    /* Convenience. Treat POSIX -W foo same as long option --foo */\n    if (temp[0] == 'W' && temp[1] == ';')\n      {\n\tchar *nameend;\n\tconst struct option *p;\n\tconst struct option *pfound = NULL;\n\tint exact = 0;\n\tint ambig = 0;\n\tint indfound = 0;\n\tint option_index;\n\n\t/* This is an option that requires an argument.  */\n\tif (*nextchar != '\\0')\n\t  {\n\t    optarg = nextchar;\n\t    /* If we end this ARGV-element by taking the rest as an arg,\n\t       we must advance to the next element now.  */\n\t    optind++;\n\t  }\n\telse if (optind == argc)\n\t  {\n\t    if (print_errors)\n\t      {\n\t\t/* 1003.2 specifies the format of this message.  */\n\t\tfprintf (stderr, _(\"%s: option requires an argument -- %c\\n\"),\n\t\t\t argv[0], c);\n\t      }\n\t    optopt = c;\n\t    if (optstring[0] == ':')\n\t      c = ':';\n\t    else\n\t      c = '?';\n\t    return c;\n\t  }\n\telse\n\t  /* We already incremented `optind' once;\n\t     increment it again when taking next ARGV-elt as argument.  */\n\t  optarg = argv[optind++];\n\n\t/* optarg is now the argument, see if it's in the\n\t   table of longopts.  */\n\n\tfor (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)\n\t  /* Do nothing.  */ ;\n\n\t/* Test all long options for either exact match\n\t   or abbreviated matches.  */\n\tfor (p = longopts, option_index = 0; p != NULL && p->name; p++, option_index++)\n\t  if (!strncmp (p->name, nextchar, nameend - nextchar))\n\t    {\n\t      if ((unsigned int) (nameend - nextchar) == strlen (p->name))\n\t\t{\n\t\t  /* Exact match found.  */\n\t\t  pfound = p;\n\t\t  indfound = option_index;\n\t\t  exact = 1;\n\t\t  break;\n\t\t}\n\t      else if (pfound == NULL)\n\t\t{\n\t\t  /* First nonexact match found.  */\n\t\t  pfound = p;\n\t\t  indfound = option_index;\n\t\t}\n\t      else\n\t\t/* Second or later nonexact match found.  */\n\t\tambig = 1;\n\t    }\n\tif (ambig && !exact)\n\t  {\n\t    if (print_errors)\n\t      fprintf (stderr, _(\"%s: option `-W %s' is ambiguous\\n\"),\n\t\t       argv[0], argv[optind]);\n\t    nextchar += strlen (nextchar);\n\t    optind++;\n\t    return '?';\n\t  }\n\tif (pfound != NULL)\n\t  {\n\t    option_index = indfound;\n\t    if (*nameend)\n\t      {\n\t\t/* Don't test has_arg with >, because some C compilers don't\n\t\t   allow it to be used on enums.  */\n\t\tif (pfound->has_arg)\n\t\t  optarg = nameend + 1;\n\t\telse\n\t\t  {\n\t\t    if (print_errors)\n\t\t      fprintf (stderr, _(\"\\\n%s: option `-W %s' doesn't allow an argument\\n\"),\n\t\t\t       argv[0], pfound->name);\n\n\t\t    nextchar += strlen (nextchar);\n\t\t    return '?';\n\t\t  }\n\t      }\n\t    else if (pfound->has_arg == 1)\n\t      {\n\t\tif (optind < argc)\n\t\t  optarg = argv[optind++];\n\t\telse\n\t\t  {\n\t\t    if (print_errors)\n\t\t      fprintf (stderr,\n\t\t\t       _(\"%s: option `%s' requires an argument\\n\"),\n\t\t\t       argv[0], argv[optind - 1]);\n\t\t    nextchar += strlen (nextchar);\n\t\t    return optstring[0] == ':' ? ':' : '?';\n\t\t  }\n\t      }\n\t    nextchar += strlen (nextchar);\n\t    if (longind != NULL)\n\t      *longind = option_index;\n\t    if (pfound->flag)\n\t      {\n\t\t*(pfound->flag) = pfound->val;\n\t\treturn 0;\n\t      }\n\t    return pfound->val;\n\t  }\n\t  nextchar = NULL;\n\t  return 'W';\t/* Let the application handle it.   */\n      }\n    if (temp[1] == ':')\n      {\n\tif (temp[2] == ':')\n\t  {\n\t    /* This is an option that accepts an argument optionally.  */\n\t    if (*nextchar != '\\0')\n\t      {\n\t\toptarg = nextchar;\n\t\toptind++;\n\t      }\n\t    else\n\t      optarg = NULL;\n\t    nextchar = NULL;\n\t  }\n\telse\n\t  {\n\t    /* This is an option that requires an argument.  */\n\t    if (*nextchar != '\\0')\n\t      {\n\t\toptarg = nextchar;\n\t\t/* If we end this ARGV-element by taking the rest as an arg,\n\t\t   we must advance to the next element now.  */\n\t\toptind++;\n\t      }\n\t    else if (optind == argc)\n\t      {\n\t\tif (print_errors)\n\t\t  {\n\t\t    /* 1003.2 specifies the format of this message.  */\n\t\t    fprintf (stderr,\n\t\t\t     _(\"%s: option requires an argument -- %c\\n\"),\n\t\t\t     argv[0], c);\n\t\t  }\n\t\toptopt = c;\n\t\tif (optstring[0] == ':')\n\t\t  c = ':';\n\t\telse\n\t\t  c = '?';\n\t      }\n\t    else\n\t      /* We already incremented `optind' once;\n\t\t increment it again when taking next ARGV-elt as argument.  */\n\t      optarg = argv[optind++];\n\t    nextchar = NULL;\n\t  }\n      }\n    return c;\n  }\n}\n\nint\ngetopt (argc, argv, optstring)\n     int argc;\n     char *const *argv;\n     const char *optstring;\n{\n  return _getopt_internal (argc, argv, optstring,\n\t\t\t   (const struct option *) 0,\n\t\t\t   (int *) 0,\n\t\t\t   0);\n}\n\n#endif\t/* Not ELIDE_CODE.  */\n\f\n#ifdef TEST\n\n/* Compile with -DTEST to make an executable for use in testing\n   the above definition of `getopt'.  */\n\nint\nmain (argc, argv)\n     int argc;\n     char **argv;\n{\n  int c;\n  int digit_optind = 0;\n\n  while (1)\n    {\n      int this_option_optind = optind ? optind : 1;\n\n      c = getopt (argc, argv, \"abc:d:0123456789\");\n      if (c == -1)\n\tbreak;\n\n      switch (c)\n\t{\n\tcase '0':\n\tcase '1':\n\tcase '2':\n\tcase '3':\n\tcase '4':\n\tcase '5':\n\tcase '6':\n\tcase '7':\n\tcase '8':\n\tcase '9':\n\t  if (digit_optind != 0 && digit_optind != this_option_optind)\n\t    printf (\"digits occur in two different argv-elements.\\n\");\n\t  digit_optind = this_option_optind;\n\t  printf (\"option %c\\n\", c);\n\t  break;\n\n\tcase 'a':\n\t  printf (\"option a\\n\");\n\t  break;\n\n\tcase 'b':\n\t  printf (\"option b\\n\");\n\t  break;\n\n\tcase 'c':\n\t  printf (\"option c with value `%s'\\n\", optarg);\n\t  break;\n\n\tcase '?':\n\t  break;\n\n\tdefault:\n\t  printf (\"?? getopt returned character code 0%o ??\\n\", c);\n\t}\n    }\n\n  if (optind < argc)\n    {\n      printf (\"non-option ARGV-elements: \");\n      while (optind < argc)\n\tprintf (\"%s \", argv[optind++]);\n      printf (\"\\n\");\n    }\n\n  exit (0);\n}\n\n#endif /* TEST */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/examples/getopt/getopt.h",
    "content": "/* Declarations for getopt.\n   Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc.\n   This file is part of the GNU C Library.\n\n   The GNU C Library is free software; you can redistribute it and/or\n   modify it under the terms of the GNU Lesser General Public\n   License as published by the Free Software Foundation; either\n   version 2.1 of the License, or (at your option) any later version.\n\n   The GNU C Library is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Lesser General Public License for more details.\n\n   You should have received a copy of the GNU Lesser General Public\n   License along with the GNU C Library; if not, write to the Free\n   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n   02111-1307 USA.  */\n\n#ifndef _GETOPT_H\n\n#ifndef __need_getopt\n# define _GETOPT_H 1\n#endif\n\n/* If __GNU_LIBRARY__ is not already defined, either we are being used\n   standalone, or this is the first header included in the source file.\n   If we are being used with glibc, we need to include <features.h>, but\n   that does not exist if we are standalone.  So: if __GNU_LIBRARY__ is\n   not defined, include <ctype.h>, which will pull in <features.h> for us\n   if it's from glibc.  (Why ctype.h?  It's guaranteed to exist and it\n   doesn't flood the namespace with stuff the way some other headers do.)  */\n#if !defined __GNU_LIBRARY__\n# include <ctype.h>\n#endif\n\n#ifdef\t__cplusplus\nextern \"C\" {\n#endif\n\n/* For communication from `getopt' to the caller.\n   When `getopt' finds an option that takes an argument,\n   the argument value is returned here.\n   Also, when `ordering' is RETURN_IN_ORDER,\n   each non-option ARGV-element is returned here.  */\n\nextern char *optarg;\n\n/* Index in ARGV of the next element to be scanned.\n   This is used for communication to and from the caller\n   and for communication between successive calls to `getopt'.\n\n   On entry to `getopt', zero means this is the first call; initialize.\n\n   When `getopt' returns -1, this is the index of the first of the\n   non-option elements that the caller should itself scan.\n\n   Otherwise, `optind' communicates from one call to the next\n   how much of ARGV has been scanned so far.  */\n\nextern int optind;\n\n/* Callers store zero here to inhibit the error message `getopt' prints\n   for unrecognized options.  */\n\nextern int opterr;\n\n/* Set to an option character which was unrecognized.  */\n\nextern int optopt;\n\n#ifndef __need_getopt\n/* Describe the long-named options requested by the application.\n   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector\n   of `struct option' terminated by an element containing a name which is\n   zero.\n\n   The field `has_arg' is:\n   no_argument\t\t(or 0) if the option does not take an argument,\n   required_argument\t(or 1) if the option requires an argument,\n   optional_argument \t(or 2) if the option takes an optional argument.\n\n   If the field `flag' is not NULL, it points to a variable that is set\n   to the value given in the field `val' when the option is found, but\n   left unchanged if the option is not found.\n\n   To have a long-named option do something other than set an `int' to\n   a compiled-in constant, such as set a value from `optarg', set the\n   option's `flag' field to zero and its `val' field to a nonzero\n   value (the equivalent single-letter option character, if there is\n   one).  For long options that have a zero `flag' field, `getopt'\n   returns the contents of the `val' field.  */\n\nstruct option\n{\n# if (defined __STDC__ && __STDC__) || defined __cplusplus\n  const char *name;\n# else\n  char *name;\n# endif\n  /* has_arg can't be an enum because some compilers complain about\n     type mismatches in all the code that assumes it is an int.  */\n  int has_arg;\n  int *flag;\n  int val;\n};\n\n/* Names for the values of the `has_arg' field of `struct option'.  */\n\n# define no_argument\t\t0\n# define required_argument\t1\n# define optional_argument\t2\n#endif\t/* need getopt */\n\n\n/* Get definitions and prototypes for functions to process the\n   arguments in ARGV (ARGC of them, minus the program name) for\n   options given in OPTS.\n\n   Return the option character from OPTS just read.  Return -1 when\n   there are no more options.  For unrecognized options, or options\n   missing arguments, `optopt' is set to the option letter, and '?' is\n   returned.\n\n   The OPTS string is a list of characters which are recognized option\n   letters, optionally followed by colons, specifying that that letter\n   takes an argument, to be placed in `optarg'.\n\n   If a letter in OPTS is followed by two colons, its argument is\n   optional.  This behavior is specific to the GNU `getopt'.\n\n   The argument `--' causes premature termination of argument\n   scanning, explicitly telling `getopt' that there are no more\n   options.\n\n   If OPTS begins with `--', then non-option arguments are treated as\n   arguments to the option '\\0'.  This behavior is specific to the GNU\n   `getopt'.  */\n\n#if (defined __STDC__ && __STDC__) || defined __cplusplus\n# ifdef __GNU_LIBRARY__\n/* Many other libraries have conflicting prototypes for getopt, with\n   differences in the consts, in stdlib.h.  To avoid compilation\n   errors, only prototype getopt for the GNU C library.  */\nextern int getopt (int __argc, char *const *__argv, const char *__shortopts);\n# else /* not __GNU_LIBRARY__ */\nextern int getopt ();\n# endif /* __GNU_LIBRARY__ */\n\n# ifndef __need_getopt\nextern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,\n\t\t        const struct option *__longopts, int *__longind);\nextern int getopt_long_only (int __argc, char *const *__argv,\n\t\t\t     const char *__shortopts,\n\t\t             const struct option *__longopts, int *__longind);\n\n/* Internal only.  Users should not call this directly.  */\nextern int _getopt_internal (int __argc, char *const *__argv,\n\t\t\t     const char *__shortopts,\n\t\t             const struct option *__longopts, int *__longind,\n\t\t\t     int __long_only);\n# endif\n#else /* not __STDC__ */\nextern int getopt ();\n# ifndef __need_getopt\nextern int getopt_long ();\nextern int getopt_long_only ();\n\nextern int _getopt_internal ();\n# endif\n#endif /* __STDC__ */\n\n#ifdef\t__cplusplus\n}\n#endif\n\n/* Make sure we later can get all the definitions and declarations.  */\n#undef __need_getopt\n\n#endif /* getopt.h */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/examples/getopt/getopt1.c",
    "content": "/* getopt_long and getopt_long_only entry points for GNU getopt.\n   Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98\n     Free Software Foundation, Inc.\n   This file is part of the GNU C Library.\n\n   The GNU C Library is free software; you can redistribute it and/or\n   modify it under the terms of the GNU Lesser General Public\n   License as published by the Free Software Foundation; either\n   version 2.1 of the License, or (at your option) any later version.\n\n   The GNU C Library is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Lesser General Public License for more details.\n\n   You should have received a copy of the GNU Lesser General Public\n   License along with the GNU C Library; if not, write to the Free\n   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n   02111-1307 USA.  */\n\f\n#ifdef HAVE_CONFIG_H\n#include <config.h>\n#endif\n\n#include \"getopt.h\"\n\n#if !defined __STDC__ || !__STDC__\n/* This is a separate conditional since some stdc systems\n   reject `defined (const)'.  */\n#ifndef const\n#define const\n#endif\n#endif\n\n#include <stdio.h>\n\n/* Comment out all this code if we are using the GNU C Library, and are not\n   actually compiling the library itself.  This code is part of the GNU C\n   Library, but also included in many other GNU distributions.  Compiling\n   and linking in this code is a waste when using the GNU C library\n   (especially if it is a shared library).  Rather than having every GNU\n   program understand `configure --with-gnu-libc' and omit the object files,\n   it is simpler to just do this in the source for each such file.  */\n\n#define GETOPT_INTERFACE_VERSION 2\n#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2\n#include <gnu-versions.h>\n#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION\n#define ELIDE_CODE\n#endif\n#endif\n\n#ifndef ELIDE_CODE\n\n\n/* This needs to come after some library #include\n   to get __GNU_LIBRARY__ defined.  */\n#ifdef __GNU_LIBRARY__\n#include <stdlib.h>\n#endif\n\n#ifndef\tNULL\n#define NULL 0\n#endif\n\nint\ngetopt_long (argc, argv, options, long_options, opt_index)\n     int argc;\n     char *const *argv;\n     const char *options;\n     const struct option *long_options;\n     int *opt_index;\n{\n  return _getopt_internal (argc, argv, options, long_options, opt_index, 0);\n}\n\n/* Like getopt_long, but '-' as well as '--' can indicate a long option.\n   If an option that starts with '-' (not '--') doesn't match a long option,\n   but does match a short option, it is parsed as a short option\n   instead.  */\n\nint\ngetopt_long_only (argc, argv, options, long_options, opt_index)\n     int argc;\n     char *const *argv;\n     const char *options;\n     const struct option *long_options;\n     int *opt_index;\n{\n  return _getopt_internal (argc, argv, options, long_options, opt_index, 1);\n}\n\n\n#endif\t/* Not ELIDE_CODE.  */\n\f\n#ifdef TEST\n\n#include <stdio.h>\n\nint\nmain (argc, argv)\n     int argc;\n     char **argv;\n{\n  int c;\n  int digit_optind = 0;\n\n  while (1)\n    {\n      int this_option_optind = optind ? optind : 1;\n      int option_index = 0;\n      static struct option long_options[] =\n      {\n\t{\"add\", 1, 0, 0},\n\t{\"append\", 0, 0, 0},\n\t{\"delete\", 1, 0, 0},\n\t{\"verbose\", 0, 0, 0},\n\t{\"create\", 0, 0, 0},\n\t{\"file\", 1, 0, 0},\n\t{0, 0, 0, 0}\n      };\n\n      c = getopt_long (argc, argv, \"abc:d:0123456789\",\n\t\t       long_options, &option_index);\n      if (c == -1)\n\tbreak;\n\n      switch (c)\n\t{\n\tcase 0:\n\t  printf (\"option %s\", long_options[option_index].name);\n\t  if (optarg)\n\t    printf (\" with arg %s\", optarg);\n\t  printf (\"\\n\");\n\t  break;\n\n\tcase '0':\n\tcase '1':\n\tcase '2':\n\tcase '3':\n\tcase '4':\n\tcase '5':\n\tcase '6':\n\tcase '7':\n\tcase '8':\n\tcase '9':\n\t  if (digit_optind != 0 && digit_optind != this_option_optind)\n\t    printf (\"digits occur in two different argv-elements.\\n\");\n\t  digit_optind = this_option_optind;\n\t  printf (\"option %c\\n\", c);\n\t  break;\n\n\tcase 'a':\n\t  printf (\"option a\\n\");\n\t  break;\n\n\tcase 'b':\n\t  printf (\"option b\\n\");\n\t  break;\n\n\tcase 'c':\n\t  printf (\"option c with value `%s'\\n\", optarg);\n\t  break;\n\n\tcase 'd':\n\t  printf (\"option d with value `%s'\\n\", optarg);\n\t  break;\n\n\tcase '?':\n\t  break;\n\n\tdefault:\n\t  printf (\"?? getopt returned character code 0%o ??\\n\", c);\n\t}\n    }\n\n  if (optind < argc)\n    {\n      printf (\"non-option ARGV-elements: \");\n      while (optind < argc)\n\tprintf (\"%s \", argv[optind++]);\n      printf (\"\\n\");\n    }\n\n  exit (0);\n}\n\n#endif /* TEST */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/examples/hotplugtest.c",
    "content": "/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */\n/*\n * libusb example program for hotplug API\n * Copyright © 2012-2013 Nathan Hjelm <hjelmn@mac.ccom>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <stdlib.h>\n#include <stdio.h>\n\n#include \"libusb.h\"\n\nint done = 0;\nlibusb_device_handle *handle;\n\nstatic int LIBUSB_CALL hotplug_callback(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *user_data)\n{\n\tstruct libusb_device_descriptor desc;\n\tint rc;\n\n\trc = libusb_get_device_descriptor(dev, &desc);\n\tif (LIBUSB_SUCCESS != rc) {\n\t\tfprintf (stderr, \"Error getting device descriptor\\n\");\n\t}\n\n\tprintf (\"Device attached: %04x:%04x\\n\", desc.idVendor, desc.idProduct);\n\n\tlibusb_open (dev, &handle);\n\n\tdone++;\n\n\treturn 0;\n}\n\nstatic int LIBUSB_CALL hotplug_callback_detach(libusb_context *ctx, libusb_device *dev, libusb_hotplug_event event, void *user_data)\n{\n\tprintf (\"Device detached\\n\");\n\n\tlibusb_close (handle);\n\n\tdone++;\n\treturn 0;\n}\n\nint main(int argc, char *argv[])\n{\n\tlibusb_hotplug_callback_handle hp[2];\n\tint product_id, vendor_id, class_id;\n\tint rc;\n\n\tvendor_id  = (argc > 1) ? strtol (argv[1], NULL, 0) : 0x045a;\n\tproduct_id = (argc > 2) ? strtol (argv[2], NULL, 0) : 0x5005;\n\tclass_id   = (argc > 3) ? strtol (argv[3], NULL, 0) : LIBUSB_HOTPLUG_MATCH_ANY;\n\n\trc = libusb_init (NULL);\n\tif (rc < 0)\n\t{\n\t\tprintf(\"failed to initialise libusb: %s\\n\", libusb_error_name(rc));\n\t\treturn EXIT_FAILURE;\n\t}\n\n\tif (!libusb_has_capability (LIBUSB_CAP_HAS_HOTPLUG)) {\n\t\tprintf (\"Hotplug capabilites are not supported on this platform\\n\");\n\t\tlibusb_exit (NULL);\n\t\treturn EXIT_FAILURE;\n\t}\n\n\trc = libusb_hotplug_register_callback (NULL, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED, 0, vendor_id,\n\t\tproduct_id, class_id, hotplug_callback, NULL, &hp[0]);\n\tif (LIBUSB_SUCCESS != rc) {\n\t\tfprintf (stderr, \"Error registering callback 0\\n\");\n\t\tlibusb_exit (NULL);\n\t\treturn EXIT_FAILURE;\n\t}\n\n\trc = libusb_hotplug_register_callback (NULL, LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, 0, vendor_id,\n\t\tproduct_id,class_id, hotplug_callback_detach, NULL, &hp[1]);\n\tif (LIBUSB_SUCCESS != rc) {\n\t\tfprintf (stderr, \"Error registering callback 1\\n\");\n\t\tlibusb_exit (NULL);\n\t\treturn EXIT_FAILURE;\n\t}\n\n\twhile (done < 2) {\n\t\trc = libusb_handle_events (NULL);\n\t\tif (rc < 0)\n\t\t\tprintf(\"libusb_handle_events() failed: %s\\n\", libusb_error_name(rc));\n\t}\n\n\tlibusb_exit (NULL);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/examples/listdevs.c",
    "content": "/*\n * libusb example program to list devices on the bus\n * Copyright © 2007 Daniel Drake <dsd@gentoo.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <stdio.h>\n\n#include \"libusb.h\"\n\nstatic void print_devs(libusb_device **devs)\n{\n\tlibusb_device *dev;\n\tint i = 0, j = 0;\n\tuint8_t path[8]; \n\n\twhile ((dev = devs[i++]) != NULL) {\n\t\tstruct libusb_device_descriptor desc;\n\t\tint r = libusb_get_device_descriptor(dev, &desc);\n\t\tif (r < 0) {\n\t\t\tfprintf(stderr, \"failed to get device descriptor\");\n\t\t\treturn;\n\t\t}\n\n\t\tprintf(\"%04x:%04x (bus %d, device %d)\",\n\t\t\tdesc.idVendor, desc.idProduct,\n\t\t\tlibusb_get_bus_number(dev), libusb_get_device_address(dev));\n\n\t\tr = libusb_get_port_numbers(dev, path, sizeof(path));\n\t\tif (r > 0) {\n\t\t\tprintf(\" path: %d\", path[0]);\n\t\t\tfor (j = 1; j < r; j++)\n\t\t\t\tprintf(\".%d\", path[j]);\n\t\t}\n\t\tprintf(\"\\n\");\n\t}\n}\n\nint main(void)\n{\n\tlibusb_device **devs;\n\tint r;\n\tssize_t cnt;\n\n\tr = libusb_init(NULL);\n\tif (r < 0)\n\t\treturn r;\n\n\tcnt = libusb_get_device_list(NULL, &devs);\n\tif (cnt < 0)\n\t\treturn (int) cnt;\n\n\tprint_devs(devs);\n\tlibusb_free_device_list(devs, 1);\n\n\tlibusb_exit(NULL);\n\treturn 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/examples/sam3u_benchmark.c",
    "content": "/*\n * libusb example program to measure Atmel SAM3U isochronous performance\n * Copyright (C) 2012 Harald Welte <laforge@gnumonks.org>\n *\n * Copied with the author's permission under LGPL-2.1 from\n * http://git.gnumonks.org/cgi-bin/gitweb.cgi?p=sam3u-tests.git;a=blob;f=usb-benchmark-project/host/benchmark.c;h=74959f7ee88f1597286cd435f312a8ff52c56b7e\n *\n * An Atmel SAM3U test firmware is also available in the above repository.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <unistd.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <errno.h>\n#include <signal.h>\n\n#include <libusb.h>\n\n\n#define EP_DATA_IN\t0x82\n#define EP_ISO_IN\t0x86\n\nstatic int do_exit = 0;\nstatic struct libusb_device_handle *devh = NULL;\n\nstatic unsigned long num_bytes = 0, num_xfer = 0;\nstatic struct timeval tv_start;\n\nstatic void LIBUSB_CALL cb_xfr(struct libusb_transfer *xfr)\n{\n\tunsigned int i;\n\n\tif (xfr->status != LIBUSB_TRANSFER_COMPLETED) {\n\t\tfprintf(stderr, \"transfer status %d\\n\", xfr->status);\n\t\tlibusb_free_transfer(xfr);\n\t\texit(3);\n\t}\n\n\tif (xfr->type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS) {\n\t\tfor (i = 0; i < xfr->num_iso_packets; i++) {\n\t\t\tstruct libusb_iso_packet_descriptor *pack = &xfr->iso_packet_desc[i];\n\n\t\t\tif (pack->status != LIBUSB_TRANSFER_COMPLETED) {\n\t\t\t\tfprintf(stderr, \"Error: pack %u status %d\\n\", i, pack->status);\n\t\t\t\texit(5);\n\t\t\t}\n\n\t\t\tprintf(\"pack%u length:%u, actual_length:%u\\n\", i, pack->length, pack->actual_length);\n\t\t}\n\t}\n\n\tprintf(\"length:%u, actual_length:%u\\n\", xfr->length, xfr->actual_length);\n\tfor (i = 0; i < xfr->actual_length; i++) {\n\t\tprintf(\"%02x\", xfr->buffer[i]);\n\t\tif (i % 16)\n\t\t\tprintf(\"\\n\");\n\t\telse if (i % 8)\n\t\t\tprintf(\"  \");\n\t\telse\n\t\t\tprintf(\" \");\n\t}\n\tnum_bytes += xfr->actual_length;\n\tnum_xfer++;\n\n\tif (libusb_submit_transfer(xfr) < 0) {\n\t\tfprintf(stderr, \"error re-submitting URB\\n\");\n\t\texit(1);\n\t}\n}\n\nstatic int benchmark_in(uint8_t ep)\n{\n\tstatic uint8_t buf[2048];\n\tstatic struct libusb_transfer *xfr;\n\tint num_iso_pack = 0;\n\n\tif (ep == EP_ISO_IN)\n\t\tnum_iso_pack = 16;\n\n\txfr = libusb_alloc_transfer(num_iso_pack);\n\tif (!xfr)\n\t\treturn -ENOMEM;\n\n\tif (ep == EP_ISO_IN) {\n\t\tlibusb_fill_iso_transfer(xfr, devh, ep, buf,\n\t\t\t\tsizeof(buf), num_iso_pack, cb_xfr, NULL, 0);\n\t\tlibusb_set_iso_packet_lengths(xfr, sizeof(buf)/num_iso_pack);\n\t} else\n\t\tlibusb_fill_bulk_transfer(xfr, devh, ep, buf,\n\t\t\t\tsizeof(buf), cb_xfr, NULL, 0);\n\n\tgettimeofday(&tv_start, NULL);\n\n\t/* NOTE: To reach maximum possible performance the program must\n\t * submit *multiple* transfers here, not just one.\n\t *\n\t * When only one transfer is submitted there is a gap in the bus\n\t * schedule from when the transfer completes until a new transfer\n\t * is submitted by the callback. This causes some jitter for\n\t * isochronous transfers and loss of throughput for bulk transfers.\n\t *\n\t * This is avoided by queueing multiple transfers in advance, so\n\t * that the host controller is always kept busy, and will schedule\n\t * more transfers on the bus while the callback is running for\n\t * transfers which have completed on the bus.\n\t */\n\n\treturn libusb_submit_transfer(xfr);\n}\n\nstatic void measure(void)\n{\n\tstruct timeval tv_stop;\n\tunsigned int diff_msec;\n\n\tgettimeofday(&tv_stop, NULL);\n\n\tdiff_msec = (tv_stop.tv_sec - tv_start.tv_sec)*1000;\n\tdiff_msec += (tv_stop.tv_usec - tv_start.tv_usec)/1000;\n\n\tprintf(\"%lu transfers (total %lu bytes) in %u miliseconds => %lu bytes/sec\\n\",\n\t\tnum_xfer, num_bytes, diff_msec, (num_bytes*1000)/diff_msec);\n}\n\nstatic void sig_hdlr(int signum)\n{\n\tswitch (signum) {\n\tcase SIGINT:\n\t\tmeasure();\n\t\tdo_exit = 1;\n\t\tbreak;\n\t}\n}\n\nint main(int argc, char **argv)\n{\n\tint rc;\n\tstruct sigaction sigact;\n\n\tsigact.sa_handler = sig_hdlr;\n\tsigemptyset(&sigact.sa_mask);\n\tsigact.sa_flags = 0;\n\tsigaction(SIGINT, &sigact, NULL);\n\n\trc = libusb_init(NULL);\n\tif (rc < 0) {\n\t\tfprintf(stderr, \"Error initializing libusb: %s\\n\", libusb_error_name(rc));\n\t\texit(1);\n\t}\n\n\tdevh = libusb_open_device_with_vid_pid(NULL, 0x16c0, 0x0763);\n\tif (!devh) {\n\t\tfprintf(stderr, \"Error finding USB device\\n\");\n\t\tgoto out;\n\t}\n\n\trc = libusb_claim_interface(devh, 2);\n\tif (rc < 0) {\n\t\tfprintf(stderr, \"Error claiming interface: %s\\n\", libusb_error_name(rc));\n\t\tgoto out;\n\t}\n\n\tbenchmark_in(EP_ISO_IN);\n\n\twhile (!do_exit) {\n\t\trc = libusb_handle_events(NULL);\n\t\tif (rc != LIBUSB_SUCCESS)\n\t\t\tbreak;\n\t}\n\n\t/* Measurement has already been done by the signal handler. */\n\n\tlibusb_release_interface(devh, 0);\nout:\n\tif (devh)\n\t\tlibusb_close(devh);\n\tlibusb_exit(NULL);\n\treturn rc;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/examples/xusb.c",
    "content": "/*\n * xusb: Generic USB test program\n * Copyright © 2009-2012 Pete Batard <pete@akeo.ie>\n * Contributions to Mass Storage by Alan Stern.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <stdio.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n#include <stdarg.h>\n\n#include \"libusb.h\"\n\n#if defined(_WIN32)\n#define msleep(msecs) Sleep(msecs)\n#else\n#include <unistd.h>\n#define msleep(msecs) usleep(1000*msecs)\n#endif\n\n#if !defined(bool)\n#define bool int\n#endif\n#if !defined(true)\n#define true (1 == 1)\n#endif\n#if !defined(false)\n#define false (!true)\n#endif\n\n// Future versions of libusb will use usb_interface instead of interface\n// in libusb_config_descriptor => catter for that\n#define usb_interface interface\n\n// Global variables\nstatic bool binary_dump = false;\nstatic bool extra_info = false;\nstatic bool force_device_request = false;\t// For WCID descriptor queries\nstatic const char* binary_name = NULL;\n\nstatic int perr(char const *format, ...)\n{\n\tva_list args;\n\tint r;\n\n\tva_start (args, format);\n\tr = vfprintf(stderr, format, args);\n\tva_end(args);\n\n\treturn r;\n}\n\n#define ERR_EXIT(errcode) do { perr(\"   %s\\n\", libusb_strerror((enum libusb_error)errcode)); return -1; } while (0)\n#define CALL_CHECK(fcall) do { r=fcall; if (r < 0) ERR_EXIT(r); } while (0);\n#define B(x) (((x)!=0)?1:0)\n#define be_to_int32(buf) (((buf)[0]<<24)|((buf)[1]<<16)|((buf)[2]<<8)|(buf)[3])\n\n#define RETRY_MAX                     5\n#define REQUEST_SENSE_LENGTH          0x12\n#define INQUIRY_LENGTH                0x24\n#define READ_CAPACITY_LENGTH          0x08\n\n// HID Class-Specific Requests values. See section 7.2 of the HID specifications\n#define HID_GET_REPORT                0x01\n#define HID_GET_IDLE                  0x02\n#define HID_GET_PROTOCOL              0x03\n#define HID_SET_REPORT                0x09\n#define HID_SET_IDLE                  0x0A\n#define HID_SET_PROTOCOL              0x0B\n#define HID_REPORT_TYPE_INPUT         0x01\n#define HID_REPORT_TYPE_OUTPUT        0x02\n#define HID_REPORT_TYPE_FEATURE       0x03\n\n// Mass Storage Requests values. See section 3 of the Bulk-Only Mass Storage Class specifications\n#define BOMS_RESET                    0xFF\n#define BOMS_GET_MAX_LUN              0xFE\n\n// Section 5.1: Command Block Wrapper (CBW)\nstruct command_block_wrapper {\n\tuint8_t dCBWSignature[4];\n\tuint32_t dCBWTag;\n\tuint32_t dCBWDataTransferLength;\n\tuint8_t bmCBWFlags;\n\tuint8_t bCBWLUN;\n\tuint8_t bCBWCBLength;\n\tuint8_t CBWCB[16];\n};\n\n// Section 5.2: Command Status Wrapper (CSW)\nstruct command_status_wrapper {\n\tuint8_t dCSWSignature[4];\n\tuint32_t dCSWTag;\n\tuint32_t dCSWDataResidue;\n\tuint8_t bCSWStatus;\n};\n\nstatic uint8_t cdb_length[256] = {\n//\t 0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F\n\t06,06,06,06,06,06,06,06,06,06,06,06,06,06,06,06,  //  0\n\t06,06,06,06,06,06,06,06,06,06,06,06,06,06,06,06,  //  1\n\t10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,  //  2\n\t10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,  //  3\n\t10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,  //  4\n\t10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,  //  5\n\t00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,  //  6\n\t00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,  //  7\n\t16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,  //  8\n\t16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,  //  9\n\t12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,  //  A\n\t12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,  //  B\n\t00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,  //  C\n\t00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,  //  D\n\t00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,  //  E\n\t00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,  //  F\n};\n\nstatic enum test_type {\n\tUSE_GENERIC,\n\tUSE_PS3,\n\tUSE_XBOX,\n\tUSE_SCSI,\n\tUSE_HID,\n} test_mode;\nstatic uint16_t VID, PID;\n\nstatic void display_buffer_hex(unsigned char *buffer, unsigned size)\n{\n\tunsigned i, j, k;\n\n\tfor (i=0; i<size; i+=16) {\n\t\tprintf(\"\\n  %08x  \", i);\n\t\tfor(j=0,k=0; k<16; j++,k++) {\n\t\t\tif (i+j < size) {\n\t\t\t\tprintf(\"%02x\", buffer[i+j]);\n\t\t\t} else {\n\t\t\t\tprintf(\"  \");\n\t\t\t}\n\t\t\tprintf(\" \");\n\t\t}\n\t\tprintf(\" \");\n\t\tfor(j=0,k=0; k<16; j++,k++) {\n\t\t\tif (i+j < size) {\n\t\t\t\tif ((buffer[i+j] < 32) || (buffer[i+j] > 126)) {\n\t\t\t\t\tprintf(\".\");\n\t\t\t\t} else {\n\t\t\t\t\tprintf(\"%c\", buffer[i+j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"\\n\" );\n}\n\nstatic char* uuid_to_string(const uint8_t* uuid)\n{\n\tstatic char uuid_string[40];\n\tif (uuid == NULL) return NULL;\n\tsprintf(uuid_string, \"{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x}\",\n\t\tuuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7],\n\t\tuuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]);\n\treturn uuid_string;\n}\n\n// The PS3 Controller is really a HID device that got its HID Report Descriptors\n// removed by Sony\nstatic int display_ps3_status(libusb_device_handle *handle)\n{\n\tint r;\n\tuint8_t input_report[49];\n\tuint8_t master_bt_address[8];\n\tuint8_t device_bt_address[18];\n\n\t// Get the controller's bluetooth address of its master device\n\tCALL_CHECK(libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE,\n\t\tHID_GET_REPORT, 0x03f5, 0, master_bt_address, sizeof(master_bt_address), 100));\n\tprintf(\"\\nMaster's bluetooth address: %02X:%02X:%02X:%02X:%02X:%02X\\n\", master_bt_address[2], master_bt_address[3],\n\t\tmaster_bt_address[4], master_bt_address[5], master_bt_address[6], master_bt_address[7]);\n\n\t// Get the controller's bluetooth address\n\tCALL_CHECK(libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE,\n\t\tHID_GET_REPORT, 0x03f2, 0, device_bt_address, sizeof(device_bt_address), 100));\n\tprintf(\"\\nMaster's bluetooth address: %02X:%02X:%02X:%02X:%02X:%02X\\n\", device_bt_address[4], device_bt_address[5],\n\t\tdevice_bt_address[6], device_bt_address[7], device_bt_address[8], device_bt_address[9]);\n\n\t// Get the status of the controller's buttons via its HID report\n\tprintf(\"\\nReading PS3 Input Report...\\n\");\n\tCALL_CHECK(libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE,\n\t\tHID_GET_REPORT, (HID_REPORT_TYPE_INPUT<<8)|0x01, 0, input_report, sizeof(input_report), 1000));\n\tswitch(input_report[2]){\t/** Direction pad plus start, select, and joystick buttons */\n\t\tcase 0x01:\n\t\t\tprintf(\"\\tSELECT pressed\\n\");\n\t\t\tbreak;\n\t\tcase 0x02:\n\t\t\tprintf(\"\\tLEFT 3 pressed\\n\");\n\t\t\tbreak;\n\t\tcase 0x04:\n\t\t\tprintf(\"\\tRIGHT 3 pressed\\n\");\n\t\t\tbreak;\n\t\tcase 0x08:\n\t\t\tprintf(\"\\tSTART presed\\n\");\n\t\t\tbreak;\n\t\tcase 0x10:\n\t\t\tprintf(\"\\tUP pressed\\n\");\n\t\t\tbreak;\n\t\tcase 0x20:\n\t\t\tprintf(\"\\tRIGHT pressed\\n\");\n\t\t\tbreak;\n\t\tcase 0x40:\n\t\t\tprintf(\"\\tDOWN pressed\\n\");\n\t\t\tbreak;\n\t\tcase 0x80:\n\t\t\tprintf(\"\\tLEFT pressed\\n\");\n\t\t\tbreak;\n\t}\n\tswitch(input_report[3]){\t/** Shapes plus top right and left buttons */\n\t\tcase 0x01:\n\t\t\tprintf(\"\\tLEFT 2 pressed\\n\");\n\t\t\tbreak;\n\t\tcase 0x02:\n\t\t\tprintf(\"\\tRIGHT 2 pressed\\n\");\n\t\t\tbreak;\n\t\tcase 0x04:\n\t\t\tprintf(\"\\tLEFT 1 pressed\\n\");\n\t\t\tbreak;\n\t\tcase 0x08:\n\t\t\tprintf(\"\\tRIGHT 1 presed\\n\");\n\t\t\tbreak;\n\t\tcase 0x10:\n\t\t\tprintf(\"\\tTRIANGLE pressed\\n\");\n\t\t\tbreak;\n\t\tcase 0x20:\n\t\t\tprintf(\"\\tCIRCLE pressed\\n\");\n\t\t\tbreak;\n\t\tcase 0x40:\n\t\t\tprintf(\"\\tCROSS pressed\\n\");\n\t\t\tbreak;\n\t\tcase 0x80:\n\t\t\tprintf(\"\\tSQUARE pressed\\n\");\n\t\t\tbreak;\n\t}\n\tprintf(\"\\tPS button: %d\\n\", input_report[4]);\n\tprintf(\"\\tLeft Analog (X,Y): (%d,%d)\\n\", input_report[6], input_report[7]);\n\tprintf(\"\\tRight Analog (X,Y): (%d,%d)\\n\", input_report[8], input_report[9]);\n\tprintf(\"\\tL2 Value: %d\\tR2 Value: %d\\n\", input_report[18], input_report[19]);\n\tprintf(\"\\tL1 Value: %d\\tR1 Value: %d\\n\", input_report[20], input_report[21]);\n\tprintf(\"\\tRoll (x axis): %d Yaw (y axis): %d Pitch (z axis) %d\\n\",\n\t\t\t//(((input_report[42] + 128) % 256) - 128),\n\t\t\t(int8_t)(input_report[42]),\n\t\t\t(int8_t)(input_report[44]),\n\t\t\t(int8_t)(input_report[46]));\n\tprintf(\"\\tAcceleration: %d\\n\\n\", (int8_t)(input_report[48]));\n\treturn 0;\n}\n// The XBOX Controller is really a HID device that got its HID Report Descriptors\n// removed by Microsoft.\n// Input/Output reports described at http://euc.jp/periphs/xbox-controller.ja.html\nstatic int display_xbox_status(libusb_device_handle *handle)\n{\n\tint r;\n\tuint8_t input_report[20];\n\tprintf(\"\\nReading XBox Input Report...\\n\");\n\tCALL_CHECK(libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE,\n\t\tHID_GET_REPORT, (HID_REPORT_TYPE_INPUT<<8)|0x00, 0, input_report, 20, 1000));\n\tprintf(\"   D-pad: %02X\\n\", input_report[2]&0x0F);\n\tprintf(\"   Start:%d, Back:%d, Left Stick Press:%d, Right Stick Press:%d\\n\", B(input_report[2]&0x10), B(input_report[2]&0x20),\n\t\tB(input_report[2]&0x40), B(input_report[2]&0x80));\n\t// A, B, X, Y, Black, White are pressure sensitive\n\tprintf(\"   A:%d, B:%d, X:%d, Y:%d, White:%d, Black:%d\\n\", input_report[4], input_report[5],\n\t\tinput_report[6], input_report[7], input_report[9], input_report[8]);\n\tprintf(\"   Left Trigger: %d, Right Trigger: %d\\n\", input_report[10], input_report[11]);\n\tprintf(\"   Left Analog (X,Y): (%d,%d)\\n\", (int16_t)((input_report[13]<<8)|input_report[12]),\n\t\t(int16_t)((input_report[15]<<8)|input_report[14]));\n\tprintf(\"   Right Analog (X,Y): (%d,%d)\\n\", (int16_t)((input_report[17]<<8)|input_report[16]),\n\t\t(int16_t)((input_report[19]<<8)|input_report[18]));\n\treturn 0;\n}\n\nstatic int set_xbox_actuators(libusb_device_handle *handle, uint8_t left, uint8_t right)\n{\n\tint r;\n\tuint8_t output_report[6];\n\n\tprintf(\"\\nWriting XBox Controller Output Report...\\n\");\n\n\tmemset(output_report, 0, sizeof(output_report));\n\toutput_report[1] = sizeof(output_report);\n\toutput_report[3] = left;\n\toutput_report[5] = right;\n\n\tCALL_CHECK(libusb_control_transfer(handle, LIBUSB_ENDPOINT_OUT|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE,\n\t\tHID_SET_REPORT, (HID_REPORT_TYPE_OUTPUT<<8)|0x00, 0, output_report, 06, 1000));\n\treturn 0;\n}\n\nstatic int send_mass_storage_command(libusb_device_handle *handle, uint8_t endpoint, uint8_t lun,\n\tuint8_t *cdb, uint8_t direction, int data_length, uint32_t *ret_tag)\n{\n\tstatic uint32_t tag = 1;\n\tuint8_t cdb_len;\n\tint i, r, size;\n\tstruct command_block_wrapper cbw;\n\n\tif (cdb == NULL) {\n\t\treturn -1;\n\t}\n\n\tif (endpoint & LIBUSB_ENDPOINT_IN) {\n\t\tperr(\"send_mass_storage_command: cannot send command on IN endpoint\\n\");\n\t\treturn -1;\n\t}\n\n\tcdb_len = cdb_length[cdb[0]];\n\tif ((cdb_len == 0) || (cdb_len > sizeof(cbw.CBWCB))) {\n\t\tperr(\"send_mass_storage_command: don't know how to handle this command (%02X, length %d)\\n\",\n\t\t\tcdb[0], cdb_len);\n\t\treturn -1;\n\t}\n\n\tmemset(&cbw, 0, sizeof(cbw));\n\tcbw.dCBWSignature[0] = 'U';\n\tcbw.dCBWSignature[1] = 'S';\n\tcbw.dCBWSignature[2] = 'B';\n\tcbw.dCBWSignature[3] = 'C';\n\t*ret_tag = tag;\n\tcbw.dCBWTag = tag++;\n\tcbw.dCBWDataTransferLength = data_length;\n\tcbw.bmCBWFlags = direction;\n\tcbw.bCBWLUN = lun;\n\t// Subclass is 1 or 6 => cdb_len\n\tcbw.bCBWCBLength = cdb_len;\n\tmemcpy(cbw.CBWCB, cdb, cdb_len);\n\n\ti = 0;\n\tdo {\n\t\t// The transfer length must always be exactly 31 bytes.\n\t\tr = libusb_bulk_transfer(handle, endpoint, (unsigned char*)&cbw, 31, &size, 1000);\n\t\tif (r == LIBUSB_ERROR_PIPE) {\n\t\t\tlibusb_clear_halt(handle, endpoint);\n\t\t}\n\t\ti++;\n\t} while ((r == LIBUSB_ERROR_PIPE) && (i<RETRY_MAX));\n\tif (r != LIBUSB_SUCCESS) {\n\t\tperr(\"   send_mass_storage_command: %s\\n\", libusb_strerror((enum libusb_error)r));\n\t\treturn -1;\n\t}\n\n\tprintf(\"   sent %d CDB bytes\\n\", cdb_len);\n\treturn 0;\n}\n\nstatic int get_mass_storage_status(libusb_device_handle *handle, uint8_t endpoint, uint32_t expected_tag)\n{\n\tint i, r, size;\n\tstruct command_status_wrapper csw;\n\n\t// The device is allowed to STALL this transfer. If it does, you have to\n\t// clear the stall and try again.\n\ti = 0;\n\tdo {\n\t\tr = libusb_bulk_transfer(handle, endpoint, (unsigned char*)&csw, 13, &size, 1000);\n\t\tif (r == LIBUSB_ERROR_PIPE) {\n\t\t\tlibusb_clear_halt(handle, endpoint);\n\t\t}\n\t\ti++;\n\t} while ((r == LIBUSB_ERROR_PIPE) && (i<RETRY_MAX));\n\tif (r != LIBUSB_SUCCESS) {\n\t\tperr(\"   get_mass_storage_status: %s\\n\", libusb_strerror((enum libusb_error)r));\n\t\treturn -1;\n\t}\n\tif (size != 13) {\n\t\tperr(\"   get_mass_storage_status: received %d bytes (expected 13)\\n\", size);\n\t\treturn -1;\n\t}\n\tif (csw.dCSWTag != expected_tag) {\n\t\tperr(\"   get_mass_storage_status: mismatched tags (expected %08X, received %08X)\\n\",\n\t\t\texpected_tag, csw.dCSWTag);\n\t\treturn -1;\n\t}\n\t// For this test, we ignore the dCSWSignature check for validity...\n\tprintf(\"   Mass Storage Status: %02X (%s)\\n\", csw.bCSWStatus, csw.bCSWStatus?\"FAILED\":\"Success\");\n\tif (csw.dCSWTag != expected_tag)\n\t\treturn -1;\n\tif (csw.bCSWStatus) {\n\t\t// REQUEST SENSE is appropriate only if bCSWStatus is 1, meaning that the\n\t\t// command failed somehow.  Larger values (2 in particular) mean that\n\t\t// the command couldn't be understood.\n\t\tif (csw.bCSWStatus == 1)\n\t\t\treturn -2;\t// request Get Sense\n\t\telse\n\t\t\treturn -1;\n\t}\n\n\t// In theory we also should check dCSWDataResidue.  But lots of devices\n\t// set it wrongly.\n\treturn 0;\n}\n\nstatic void get_sense(libusb_device_handle *handle, uint8_t endpoint_in, uint8_t endpoint_out)\n{\n\tuint8_t cdb[16];\t// SCSI Command Descriptor Block\n\tuint8_t sense[18];\n\tuint32_t expected_tag;\n\tint size;\n\tint rc;\n\n\t// Request Sense\n\tprintf(\"Request Sense:\\n\");\n\tmemset(sense, 0, sizeof(sense));\n\tmemset(cdb, 0, sizeof(cdb));\n\tcdb[0] = 0x03;\t// Request Sense\n\tcdb[4] = REQUEST_SENSE_LENGTH;\n\n\tsend_mass_storage_command(handle, endpoint_out, 0, cdb, LIBUSB_ENDPOINT_IN, REQUEST_SENSE_LENGTH, &expected_tag);\n\trc = libusb_bulk_transfer(handle, endpoint_in, (unsigned char*)&sense, REQUEST_SENSE_LENGTH, &size, 1000);\n\tif (rc < 0)\n\t{\n\t\tprintf(\"libusb_bulk_transfer failed: %s\\n\", libusb_error_name(rc));\n\t\treturn;\n\t}\n\tprintf(\"   received %d bytes\\n\", size);\n\n\tif ((sense[0] != 0x70) && (sense[0] != 0x71)) {\n\t\tperr(\"   ERROR No sense data\\n\");\n\t} else {\n\t\tperr(\"   ERROR Sense: %02X %02X %02X\\n\", sense[2]&0x0F, sense[12], sense[13]);\n\t}\n\t// Strictly speaking, the get_mass_storage_status() call should come\n\t// before these perr() lines.  If the status is nonzero then we must\n\t// assume there's no data in the buffer.  For xusb it doesn't matter.\n\tget_mass_storage_status(handle, endpoint_in, expected_tag);\n}\n\n// Mass Storage device to test bulk transfers (non destructive test)\nstatic int test_mass_storage(libusb_device_handle *handle, uint8_t endpoint_in, uint8_t endpoint_out)\n{\n\tint r, size;\n\tuint8_t lun;\n\tuint32_t expected_tag;\n\tuint32_t i, max_lba, block_size;\n\tdouble device_size;\n\tuint8_t cdb[16];\t// SCSI Command Descriptor Block\n\tuint8_t buffer[64];\n\tchar vid[9], pid[9], rev[5];\n\tunsigned char *data;\n\tFILE *fd;\n\n\tprintf(\"Reading Max LUN:\\n\");\n\tr = libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE,\n\t\tBOMS_GET_MAX_LUN, 0, 0, &lun, 1, 1000);\n\t// Some devices send a STALL instead of the actual value.\n\t// In such cases we should set lun to 0.\n\tif (r == 0) {\n\t\tlun = 0;\n\t} else if (r < 0) {\n\t\tperr(\"   Failed: %s\", libusb_strerror((enum libusb_error)r));\n\t}\n\tprintf(\"   Max LUN = %d\\n\", lun);\n\n\t// Send Inquiry\n\tprintf(\"Sending Inquiry:\\n\");\n\tmemset(buffer, 0, sizeof(buffer));\n\tmemset(cdb, 0, sizeof(cdb));\n\tcdb[0] = 0x12;\t// Inquiry\n\tcdb[4] = INQUIRY_LENGTH;\n\n\tsend_mass_storage_command(handle, endpoint_out, lun, cdb, LIBUSB_ENDPOINT_IN, INQUIRY_LENGTH, &expected_tag);\n\tCALL_CHECK(libusb_bulk_transfer(handle, endpoint_in, (unsigned char*)&buffer, INQUIRY_LENGTH, &size, 1000));\n\tprintf(\"   received %d bytes\\n\", size);\n\t// The following strings are not zero terminated\n\tfor (i=0; i<8; i++) {\n\t\tvid[i] = buffer[8+i];\n\t\tpid[i] = buffer[16+i];\n\t\trev[i/2] = buffer[32+i/2];\t// instead of another loop\n\t}\n\tvid[8] = 0;\n\tpid[8] = 0;\n\trev[4] = 0;\n\tprintf(\"   VID:PID:REV \\\"%8s\\\":\\\"%8s\\\":\\\"%4s\\\"\\n\", vid, pid, rev);\n\tif (get_mass_storage_status(handle, endpoint_in, expected_tag) == -2) {\n\t\tget_sense(handle, endpoint_in, endpoint_out);\n\t}\n\n\t// Read capacity\n\tprintf(\"Reading Capacity:\\n\");\n\tmemset(buffer, 0, sizeof(buffer));\n\tmemset(cdb, 0, sizeof(cdb));\n\tcdb[0] = 0x25;\t// Read Capacity\n\n\tsend_mass_storage_command(handle, endpoint_out, lun, cdb, LIBUSB_ENDPOINT_IN, READ_CAPACITY_LENGTH, &expected_tag);\n\tCALL_CHECK(libusb_bulk_transfer(handle, endpoint_in, (unsigned char*)&buffer, READ_CAPACITY_LENGTH, &size, 1000));\n\tprintf(\"   received %d bytes\\n\", size);\n\tmax_lba = be_to_int32(&buffer[0]);\n\tblock_size = be_to_int32(&buffer[4]);\n\tdevice_size = ((double)(max_lba+1))*block_size/(1024*1024*1024);\n\tprintf(\"   Max LBA: %08X, Block Size: %08X (%.2f GB)\\n\", max_lba, block_size, device_size);\n\tif (get_mass_storage_status(handle, endpoint_in, expected_tag) == -2) {\n\t\tget_sense(handle, endpoint_in, endpoint_out);\n\t}\n\n\tdata = (unsigned char*) calloc(1, block_size);\n\tif (data == NULL) {\n\t\tperr(\"   unable to allocate data buffer\\n\");\n\t\treturn -1;\n\t}\n\n\t// Send Read\n\tprintf(\"Attempting to read %d bytes:\\n\", block_size);\n\tmemset(cdb, 0, sizeof(cdb));\n\n\tcdb[0] = 0x28;\t// Read(10)\n\tcdb[8] = 0x01;\t// 1 block\n\n\tsend_mass_storage_command(handle, endpoint_out, lun, cdb, LIBUSB_ENDPOINT_IN, block_size, &expected_tag);\n\tlibusb_bulk_transfer(handle, endpoint_in, data, block_size, &size, 5000);\n\tprintf(\"   READ: received %d bytes\\n\", size);\n\tif (get_mass_storage_status(handle, endpoint_in, expected_tag) == -2) {\n\t\tget_sense(handle, endpoint_in, endpoint_out);\n\t} else {\n\t\tdisplay_buffer_hex(data, size);\n\t\tif ((binary_dump) && ((fd = fopen(binary_name, \"w\")) != NULL)) {\n\t\t\tif (fwrite(data, 1, (size_t)size, fd) != (unsigned int)size) {\n\t\t\t\tperr(\"   unable to write binary data\\n\");\n\t\t\t}\n\t\t\tfclose(fd);\n\t\t}\n\t}\n\tfree(data);\n\n\treturn 0;\n}\n\n// HID\nstatic int get_hid_record_size(uint8_t *hid_report_descriptor, int size, int type)\n{\n\tuint8_t i, j = 0;\n\tuint8_t offset;\n\tint record_size[3] = {0, 0, 0};\n\tint nb_bits = 0, nb_items = 0;\n\tbool found_record_marker;\n\n\tfound_record_marker = false;\n\tfor (i = hid_report_descriptor[0]+1; i < size; i += offset) {\n\t\toffset = (hid_report_descriptor[i]&0x03) + 1;\n\t\tif (offset == 4)\n\t\t\toffset = 5;\n\t\tswitch (hid_report_descriptor[i] & 0xFC) {\n\t\tcase 0x74:\t// bitsize\n\t\t\tnb_bits = hid_report_descriptor[i+1];\n\t\t\tbreak;\n\t\tcase 0x94:\t// count\n\t\t\tnb_items = 0;\n\t\t\tfor (j=1; j<offset; j++) {\n\t\t\t\tnb_items = ((uint32_t)hid_report_descriptor[i+j]) << (8*(j-1));\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 0x80:\t// input\n\t\t\tfound_record_marker = true;\n\t\t\tj = 0;\n\t\t\tbreak;\n\t\tcase 0x90:\t// output\n\t\t\tfound_record_marker = true;\n\t\t\tj = 1;\n\t\t\tbreak;\n\t\tcase 0xb0:\t// feature\n\t\t\tfound_record_marker = true;\n\t\t\tj = 2;\n\t\t\tbreak;\n\t\tcase 0xC0:\t// end of collection\n\t\t\tnb_items = 0;\n\t\t\tnb_bits = 0;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcontinue;\n\t\t}\n\t\tif (found_record_marker) {\n\t\t\tfound_record_marker = false;\n\t\t\trecord_size[j] += nb_items*nb_bits;\n\t\t}\n\t}\n\tif ((type < HID_REPORT_TYPE_INPUT) || (type > HID_REPORT_TYPE_FEATURE)) {\n\t\treturn 0;\n\t} else {\n\t\treturn (record_size[type - HID_REPORT_TYPE_INPUT]+7)/8;\n\t}\n}\n\nstatic int test_hid(libusb_device_handle *handle, uint8_t endpoint_in)\n{\n\tint r, size, descriptor_size;\n\tuint8_t hid_report_descriptor[256];\n\tuint8_t *report_buffer;\n\tFILE *fd;\n\n\tprintf(\"\\nReading HID Report Descriptors:\\n\");\n\tdescriptor_size = libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_STANDARD|LIBUSB_RECIPIENT_INTERFACE,\n\t\tLIBUSB_REQUEST_GET_DESCRIPTOR, LIBUSB_DT_REPORT<<8, 0, hid_report_descriptor, sizeof(hid_report_descriptor), 1000);\n\tif (descriptor_size < 0) {\n\t\tprintf(\"   Failed\\n\");\n\t\treturn -1;\n\t}\n\tdisplay_buffer_hex(hid_report_descriptor, descriptor_size);\n\tif ((binary_dump) && ((fd = fopen(binary_name, \"w\")) != NULL)) {\n\t\tif (fwrite(hid_report_descriptor, 1, descriptor_size, fd) != descriptor_size) {\n\t\t\tprintf(\"   Error writing descriptor to file\\n\");\n\t\t}\n\t\tfclose(fd);\n\t}\n\n\tsize = get_hid_record_size(hid_report_descriptor, descriptor_size, HID_REPORT_TYPE_FEATURE);\n\tif (size <= 0) {\n\t\tprintf(\"\\nSkipping Feature Report readout (None detected)\\n\");\n\t} else {\n\t\treport_buffer = (uint8_t*) calloc(size, 1);\n\t\tif (report_buffer == NULL) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tprintf(\"\\nReading Feature Report (length %d)...\\n\", size);\n\t\tr = libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE,\n\t\t\tHID_GET_REPORT, (HID_REPORT_TYPE_FEATURE<<8)|0, 0, report_buffer, (uint16_t)size, 5000);\n\t\tif (r >= 0) {\n\t\t\tdisplay_buffer_hex(report_buffer, size);\n\t\t} else {\n\t\t\tswitch(r) {\n\t\t\tcase LIBUSB_ERROR_NOT_FOUND:\n\t\t\t\tprintf(\"   No Feature Report available for this device\\n\");\n\t\t\t\tbreak;\n\t\t\tcase LIBUSB_ERROR_PIPE:\n\t\t\t\tprintf(\"   Detected stall - resetting pipe...\\n\");\n\t\t\t\tlibusb_clear_halt(handle, 0);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tprintf(\"   Error: %s\\n\", libusb_strerror((enum libusb_error)r));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfree(report_buffer);\n\t}\n\n\tsize = get_hid_record_size(hid_report_descriptor, descriptor_size, HID_REPORT_TYPE_INPUT);\n\tif (size <= 0) {\n\t\tprintf(\"\\nSkipping Input Report readout (None detected)\\n\");\n\t} else {\n\t\treport_buffer = (uint8_t*) calloc(size, 1);\n\t\tif (report_buffer == NULL) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tprintf(\"\\nReading Input Report (length %d)...\\n\", size);\n\t\tr = libusb_control_transfer(handle, LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE,\n\t\t\tHID_GET_REPORT, (HID_REPORT_TYPE_INPUT<<8)|0x00, 0, report_buffer, (uint16_t)size, 5000);\n\t\tif (r >= 0) {\n\t\t\tdisplay_buffer_hex(report_buffer, size);\n\t\t} else {\n\t\t\tswitch(r) {\n\t\t\tcase LIBUSB_ERROR_TIMEOUT:\n\t\t\t\tprintf(\"   Timeout! Please make sure you act on the device within the 5 seconds allocated...\\n\");\n\t\t\t\tbreak;\n\t\t\tcase LIBUSB_ERROR_PIPE:\n\t\t\t\tprintf(\"   Detected stall - resetting pipe...\\n\");\n\t\t\t\tlibusb_clear_halt(handle, 0);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tprintf(\"   Error: %s\\n\", libusb_strerror((enum libusb_error)r));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Attempt a bulk read from endpoint 0 (this should just return a raw input report)\n\t\tprintf(\"\\nTesting interrupt read using endpoint %02X...\\n\", endpoint_in);\n\t\tr = libusb_interrupt_transfer(handle, endpoint_in, report_buffer, size, &size, 5000);\n\t\tif (r >= 0) {\n\t\t\tdisplay_buffer_hex(report_buffer, size);\n\t\t} else {\n\t\t\tprintf(\"   %s\\n\", libusb_strerror((enum libusb_error)r));\n\t\t}\n\n\t\tfree(report_buffer);\n\t}\n\treturn 0;\n}\n\n// Read the MS WinUSB Feature Descriptors, that are used on Windows 8 for automated driver installation\nstatic void read_ms_winsub_feature_descriptors(libusb_device_handle *handle, uint8_t bRequest, int iface_number)\n{\n#define MAX_OS_FD_LENGTH 256\n\tint i, r;\n\tuint8_t os_desc[MAX_OS_FD_LENGTH];\n\tuint32_t length;\n\tvoid* le_type_punning_IS_fine;\n\tstruct {\n\t\tconst char* desc;\n\t\tuint8_t recipient;\n\t\tuint16_t index;\n\t\tuint16_t header_size;\n\t} os_fd[2] = {\n\t\t{\"Extended Compat ID\", LIBUSB_RECIPIENT_DEVICE, 0x0004, 0x10},\n\t\t{\"Extended Properties\", LIBUSB_RECIPIENT_INTERFACE, 0x0005, 0x0A}\n\t};\n\n\tif (iface_number < 0) return;\n\t// WinUSB has a limitation that forces wIndex to the interface number when issuing\n\t// an Interface Request. To work around that, we can force a Device Request for\n\t// the Extended Properties, assuming the device answers both equally.\n\tif (force_device_request)\n\t\tos_fd[1].recipient = LIBUSB_RECIPIENT_DEVICE;\n\n\tfor (i=0; i<2; i++) {\n\t\tprintf(\"\\nReading %s OS Feature Descriptor (wIndex = 0x%04d):\\n\", os_fd[i].desc, os_fd[i].index);\n\n\t\t// Read the header part\n\t\tr = libusb_control_transfer(handle, (uint8_t)(LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_VENDOR|os_fd[i].recipient),\n\t\t\tbRequest, (uint16_t)(((iface_number)<< 8)|0x00), os_fd[i].index, os_desc, os_fd[i].header_size, 1000);\n\t\tif (r < os_fd[i].header_size) {\n\t\t\tperr(\"   Failed: %s\", (r<0)?libusb_strerror((enum libusb_error)r):\"header size is too small\");\n\t\t\treturn;\n\t\t}\n\t\tle_type_punning_IS_fine = (void*)os_desc;\n\t\tlength = *((uint32_t*)le_type_punning_IS_fine);\n\t\tif (length > MAX_OS_FD_LENGTH) {\n\t\t\tlength = MAX_OS_FD_LENGTH;\n\t\t}\n\n\t\t// Read the full feature descriptor\n\t\tr = libusb_control_transfer(handle, (uint8_t)(LIBUSB_ENDPOINT_IN|LIBUSB_REQUEST_TYPE_VENDOR|os_fd[i].recipient),\n\t\t\tbRequest, (uint16_t)(((iface_number)<< 8)|0x00), os_fd[i].index, os_desc, (uint16_t)length, 1000);\n\t\tif (r < 0) {\n\t\t\tperr(\"   Failed: %s\", libusb_strerror((enum libusb_error)r));\n\t\t\treturn;\n\t\t} else {\n\t\t\tdisplay_buffer_hex(os_desc, r);\n\t\t}\n\t}\n}\n\nstatic void print_device_cap(struct libusb_bos_dev_capability_descriptor *dev_cap)\n{\n\tswitch(dev_cap->bDevCapabilityType) {\n\tcase LIBUSB_BT_USB_2_0_EXTENSION: {\n\t\tstruct libusb_usb_2_0_extension_descriptor *usb_2_0_ext = NULL;\n\t\tlibusb_get_usb_2_0_extension_descriptor(NULL, dev_cap, &usb_2_0_ext);\n\t\tif (usb_2_0_ext) {\n\t\t\tprintf(\"    USB 2.0 extension:\\n\");\n\t\t\tprintf(\"      attributes             : %02X\\n\", usb_2_0_ext->bmAttributes);\n\t\t\tlibusb_free_usb_2_0_extension_descriptor(usb_2_0_ext);\n\t\t}\n\t\tbreak;\n\t}\n\tcase LIBUSB_BT_SS_USB_DEVICE_CAPABILITY: {\n\t\tstruct libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap = NULL;\n\t\tlibusb_get_ss_usb_device_capability_descriptor(NULL, dev_cap, &ss_usb_device_cap);\n\t\tif (ss_usb_device_cap) {\n\t\t\tprintf(\"    USB 3.0 capabilities:\\n\");\n\t\t\tprintf(\"      attributes             : %02X\\n\", ss_usb_device_cap->bmAttributes);\n\t\t\tprintf(\"      supported speeds       : %04X\\n\", ss_usb_device_cap->wSpeedSupported);\n\t\t\tprintf(\"      supported functionality: %02X\\n\", ss_usb_device_cap->bFunctionalitySupport);\n\t\t\tlibusb_free_ss_usb_device_capability_descriptor(ss_usb_device_cap);\n\t\t}\n\t\tbreak;\n\t}\n\tcase LIBUSB_BT_CONTAINER_ID: {\n\t\tstruct libusb_container_id_descriptor *container_id = NULL;\n\t\tlibusb_get_container_id_descriptor(NULL, dev_cap, &container_id);\n\t\tif (container_id) {\n\t\t\tprintf(\"    Container ID:\\n      %s\\n\", uuid_to_string(container_id->ContainerID));\n\t\t\tlibusb_free_container_id_descriptor(container_id);\n\t\t}\n\t\tbreak;\n\t}\n\tdefault:\n\t\tprintf(\"    Unknown BOS device capability %02x:\\n\", dev_cap->bDevCapabilityType);\n\t}\t\n}\n\nstatic int test_device(uint16_t vid, uint16_t pid)\n{\n\tlibusb_device_handle *handle;\n\tlibusb_device *dev;\n\tuint8_t bus, port_path[8];\n\tstruct libusb_bos_descriptor *bos_desc;\n\tstruct libusb_config_descriptor *conf_desc;\n\tconst struct libusb_endpoint_descriptor *endpoint;\n\tint i, j, k, r;\n\tint iface, nb_ifaces, first_iface = -1;\n\tstruct libusb_device_descriptor dev_desc;\n\tconst char* speed_name[5] = { \"Unknown\", \"1.5 Mbit/s (USB LowSpeed)\", \"12 Mbit/s (USB FullSpeed)\",\n\t\t\"480 Mbit/s (USB HighSpeed)\", \"5000 Mbit/s (USB SuperSpeed)\"};\n\tchar string[128];\n\tuint8_t string_index[3];\t// indexes of the string descriptors\n\tuint8_t endpoint_in = 0, endpoint_out = 0;\t// default IN and OUT endpoints\n\n\tprintf(\"Opening device %04X:%04X...\\n\", vid, pid);\n\thandle = libusb_open_device_with_vid_pid(NULL, vid, pid);\n\n\tif (handle == NULL) {\n\t\tperr(\"  Failed.\\n\");\n\t\treturn -1;\n\t}\n\n\tdev = libusb_get_device(handle);\n\tbus = libusb_get_bus_number(dev);\n\tif (extra_info) {\n\t\tr = libusb_get_port_numbers(dev, port_path, sizeof(port_path));\n\t\tif (r > 0) {\n\t\t\tprintf(\"\\nDevice properties:\\n\");\n\t\t\tprintf(\"        bus number: %d\\n\", bus);\n\t\t\tprintf(\"         port path: %d\", port_path[0]);\n\t\t\tfor (i=1; i<r; i++) {\n\t\t\t\tprintf(\"->%d\", port_path[i]);\n\t\t\t}\n\t\t\tprintf(\" (from root hub)\\n\");\n\t\t}\n\t\tr = libusb_get_device_speed(dev);\n\t\tif ((r<0) || (r>4)) r=0;\n\t\tprintf(\"             speed: %s\\n\", speed_name[r]);\n\t}\n\n\tprintf(\"\\nReading device descriptor:\\n\");\n\tCALL_CHECK(libusb_get_device_descriptor(dev, &dev_desc));\n\tprintf(\"            length: %d\\n\", dev_desc.bLength);\n\tprintf(\"      device class: %d\\n\", dev_desc.bDeviceClass);\n\tprintf(\"               S/N: %d\\n\", dev_desc.iSerialNumber);\n\tprintf(\"           VID:PID: %04X:%04X\\n\", dev_desc.idVendor, dev_desc.idProduct);\n\tprintf(\"         bcdDevice: %04X\\n\", dev_desc.bcdDevice);\n\tprintf(\"   iMan:iProd:iSer: %d:%d:%d\\n\", dev_desc.iManufacturer, dev_desc.iProduct, dev_desc.iSerialNumber);\n\tprintf(\"          nb confs: %d\\n\", dev_desc.bNumConfigurations);\n\t// Copy the string descriptors for easier parsing\n\tstring_index[0] = dev_desc.iManufacturer;\n\tstring_index[1] = dev_desc.iProduct;\n\tstring_index[2] = dev_desc.iSerialNumber;\n\n\tprintf(\"\\nReading BOS descriptor: \");\n\tif (libusb_get_bos_descriptor(handle, &bos_desc) == LIBUSB_SUCCESS) {\n\t\tprintf(\"%d caps\\n\", bos_desc->bNumDeviceCaps);\n\t\tfor (i = 0; i < bos_desc->bNumDeviceCaps; i++)\n\t\t\tprint_device_cap(bos_desc->dev_capability[i]);\n\t\tlibusb_free_bos_descriptor(bos_desc);\n\t} else {\n\t\tprintf(\"no descriptor\\n\");\n\t}\n\n\tprintf(\"\\nReading first configuration descriptor:\\n\");\n\tCALL_CHECK(libusb_get_config_descriptor(dev, 0, &conf_desc));\n\tnb_ifaces = conf_desc->bNumInterfaces;\n\tprintf(\"             nb interfaces: %d\\n\", nb_ifaces);\n\tif (nb_ifaces > 0)\n\t\tfirst_iface = conf_desc->usb_interface[0].altsetting[0].bInterfaceNumber;\n\tfor (i=0; i<nb_ifaces; i++) {\n\t\tprintf(\"              interface[%d]: id = %d\\n\", i,\n\t\t\tconf_desc->usb_interface[i].altsetting[0].bInterfaceNumber);\n\t\tfor (j=0; j<conf_desc->usb_interface[i].num_altsetting; j++) {\n\t\t\tprintf(\"interface[%d].altsetting[%d]: num endpoints = %d\\n\",\n\t\t\t\ti, j, conf_desc->usb_interface[i].altsetting[j].bNumEndpoints);\n\t\t\tprintf(\"   Class.SubClass.Protocol: %02X.%02X.%02X\\n\",\n\t\t\t\tconf_desc->usb_interface[i].altsetting[j].bInterfaceClass,\n\t\t\t\tconf_desc->usb_interface[i].altsetting[j].bInterfaceSubClass,\n\t\t\t\tconf_desc->usb_interface[i].altsetting[j].bInterfaceProtocol);\n\t\t\tif ( (conf_desc->usb_interface[i].altsetting[j].bInterfaceClass == LIBUSB_CLASS_MASS_STORAGE)\n\t\t\t  && ( (conf_desc->usb_interface[i].altsetting[j].bInterfaceSubClass == 0x01)\n\t\t\t  || (conf_desc->usb_interface[i].altsetting[j].bInterfaceSubClass == 0x06) )\n\t\t\t  && (conf_desc->usb_interface[i].altsetting[j].bInterfaceProtocol == 0x50) ) {\n\t\t\t\t// Mass storage devices that can use basic SCSI commands\n\t\t\t\ttest_mode = USE_SCSI;\n\t\t\t}\n\t\t\tfor (k=0; k<conf_desc->usb_interface[i].altsetting[j].bNumEndpoints; k++) {\n\t\t\t\tstruct libusb_ss_endpoint_companion_descriptor *ep_comp = NULL;\n\t\t\t\tendpoint = &conf_desc->usb_interface[i].altsetting[j].endpoint[k];\n\t\t\t\tprintf(\"       endpoint[%d].address: %02X\\n\", k, endpoint->bEndpointAddress);\n\t\t\t\t// Use the first interrupt or bulk IN/OUT endpoints as default for testing\n\t\t\t\tif ((endpoint->bmAttributes & LIBUSB_TRANSFER_TYPE_MASK) & (LIBUSB_TRANSFER_TYPE_BULK | LIBUSB_TRANSFER_TYPE_INTERRUPT)) {\n\t\t\t\t\tif (endpoint->bEndpointAddress & LIBUSB_ENDPOINT_IN) {\n\t\t\t\t\t\tif (!endpoint_in)\n\t\t\t\t\t\t\tendpoint_in = endpoint->bEndpointAddress;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!endpoint_out)\n\t\t\t\t\t\t\tendpoint_out = endpoint->bEndpointAddress;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tprintf(\"           max packet size: %04X\\n\", endpoint->wMaxPacketSize);\n\t\t\t\tprintf(\"          polling interval: %02X\\n\", endpoint->bInterval);\n\t\t\t\tlibusb_get_ss_endpoint_companion_descriptor(NULL, endpoint, &ep_comp);\n\t\t\t\tif (ep_comp) {\n\t\t\t\t\tprintf(\"                 max burst: %02X   (USB 3.0)\\n\", ep_comp->bMaxBurst);\n\t\t\t\t\tprintf(\"        bytes per interval: %04X (USB 3.0)\\n\", ep_comp->wBytesPerInterval);\n\t\t\t\t\tlibusb_free_ss_endpoint_companion_descriptor(ep_comp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tlibusb_free_config_descriptor(conf_desc);\n\n\tlibusb_set_auto_detach_kernel_driver(handle, 1);\n\tfor (iface = 0; iface < nb_ifaces; iface++)\n\t{\n\t\tprintf(\"\\nClaiming interface %d...\\n\", iface);\n\t\tr = libusb_claim_interface(handle, iface);\n\t\tif (r != LIBUSB_SUCCESS) {\n\t\t\tperr(\"   Failed.\\n\");\n\t\t}\n\t}\n\n\tprintf(\"\\nReading string descriptors:\\n\");\n\tfor (i=0; i<3; i++) {\n\t\tif (string_index[i] == 0) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (libusb_get_string_descriptor_ascii(handle, string_index[i], (unsigned char*)string, 128) >= 0) {\n\t\t\tprintf(\"   String (0x%02X): \\\"%s\\\"\\n\", string_index[i], string);\n\t\t}\n\t}\n\t// Read the OS String Descriptor\n\tif (libusb_get_string_descriptor_ascii(handle, 0xEE, (unsigned char*)string, 128) >= 0) {\n\t\tprintf(\"   String (0x%02X): \\\"%s\\\"\\n\", 0xEE, string);\n\t\t// If this is a Microsoft OS String Descriptor,\n\t\t// attempt to read the WinUSB extended Feature Descriptors\n\t\tif (strncmp(string, \"MSFT100\", 7) == 0)\n\t\t\tread_ms_winsub_feature_descriptors(handle, string[7], first_iface);\n\t}\n\n\tswitch(test_mode) {\n\tcase USE_PS3:\n\t\tCALL_CHECK(display_ps3_status(handle));\n\t\tbreak;\n\tcase USE_XBOX:\n\t\tCALL_CHECK(display_xbox_status(handle));\n\t\tCALL_CHECK(set_xbox_actuators(handle, 128, 222));\n\t\tmsleep(2000);\n\t\tCALL_CHECK(set_xbox_actuators(handle, 0, 0));\n\t\tbreak;\n\tcase USE_HID:\n\t\ttest_hid(handle, endpoint_in);\n\t\tbreak;\n\tcase USE_SCSI:\n\t\tCALL_CHECK(test_mass_storage(handle, endpoint_in, endpoint_out));\n\tcase USE_GENERIC:\n\t\tbreak;\n\t}\n\n\tprintf(\"\\n\");\n\tfor (iface = 0; iface<nb_ifaces; iface++) {\n\t\tprintf(\"Releasing interface %d...\\n\", iface);\n\t\tlibusb_release_interface(handle, iface);\n\t}\n\n\tprintf(\"Closing device...\\n\");\n\tlibusb_close(handle);\n\n\treturn 0;\n}\n\nint main(int argc, char** argv)\n{\n\tbool show_help = false;\n\tbool debug_mode = false;\n\tconst struct libusb_version* version;\n\tint j, r;\n\tsize_t i, arglen;\n\tunsigned tmp_vid, tmp_pid;\n\tuint16_t endian_test = 0xBE00;\n\tchar* error_lang = NULL;\n\n\t// Default to generic, expecting VID:PID\n\tVID = 0;\n\tPID = 0;\n\ttest_mode = USE_GENERIC;\n\n\tif (((uint8_t*)&endian_test)[0] == 0xBE) {\n\t\tprintf(\"Despite their natural superiority for end users, big endian\\n\"\n\t\t\t\"CPUs are not supported with this program, sorry.\\n\");\n\t\treturn 0;\n\t}\n\n\tif (argc >= 2) {\n\t\tfor (j = 1; j<argc; j++) {\n\t\t\targlen = strlen(argv[j]);\n\t\t\tif ( ((argv[j][0] == '-') || (argv[j][0] == '/'))\n\t\t\t  && (arglen >= 2) ) {\n\t\t\t\tswitch(argv[j][1]) {\n\t\t\t\tcase 'd':\n\t\t\t\t\tdebug_mode = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'i':\n\t\t\t\t\textra_info = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'w':\n\t\t\t\t\tforce_device_request = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'b':\n\t\t\t\t\tif ((j+1 >= argc) || (argv[j+1][0] == '-') || (argv[j+1][0] == '/')) {\n\t\t\t\t\t\tprintf(\"   Option -b requires a file name\\n\");\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\tbinary_name = argv[++j];\n\t\t\t\t\tbinary_dump = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'l':\n\t\t\t\t\tif ((j+1 >= argc) || (argv[j+1][0] == '-') || (argv[j+1][0] == '/')) {\n\t\t\t\t\t\tprintf(\"   Option -l requires an ISO 639-1 language parameter\\n\");\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\terror_lang = argv[++j];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'j':\n\t\t\t\t\t// OLIMEX ARM-USB-TINY JTAG, 2 channel composite device - 2 interfaces\n\t\t\t\t\tif (!VID && !PID) {\n\t\t\t\t\t\tVID = 0x15BA;\n\t\t\t\t\t\tPID = 0x0004;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'k':\n\t\t\t\t\t// Generic 2 GB USB Key (SCSI Transparent/Bulk Only) - 1 interface\n\t\t\t\t\tif (!VID && !PID) {\n\t\t\t\t\t\tVID = 0x0204;\n\t\t\t\t\t\tPID = 0x6025;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t// The following tests will force VID:PID if already provided\n\t\t\t\tcase 'p':\n\t\t\t\t\t// Sony PS3 Controller - 1 interface\n\t\t\t\t\tVID = 0x054C;\n\t\t\t\t\tPID = 0x0268;\n\t\t\t\t\ttest_mode = USE_PS3;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 's':\n\t\t\t\t\t// Microsoft Sidewinder Precision Pro Joystick - 1 HID interface\n\t\t\t\t\tVID = 0x045E;\n\t\t\t\t\tPID = 0x0008;\n\t\t\t\t\ttest_mode = USE_HID;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'x':\n\t\t\t\t\t// Microsoft XBox Controller Type S - 1 interface\n\t\t\t\t\tVID = 0x045E;\n\t\t\t\t\tPID = 0x0289;\n\t\t\t\t\ttest_mode = USE_XBOX;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tshow_help = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (i=0; i<arglen; i++) {\n\t\t\t\t\tif (argv[j][i] == ':')\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (i != arglen) {\n\t\t\t\t\tif (sscanf(argv[j], \"%x:%x\" , &tmp_vid, &tmp_pid) != 2) {\n\t\t\t\t\t\tprintf(\"   Please specify VID & PID as \\\"vid:pid\\\" in hexadecimal format\\n\");\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\tVID = (uint16_t)tmp_vid;\n\t\t\t\t\tPID = (uint16_t)tmp_pid;\n\t\t\t\t} else {\n\t\t\t\t\tshow_help = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ((show_help) || (argc == 1) || (argc > 7)) {\n\t\tprintf(\"usage: %s [-h] [-d] [-i] [-k] [-b file] [-l lang] [-j] [-x] [-s] [-p] [-w] [vid:pid]\\n\", argv[0]);\n\t\tprintf(\"   -h      : display usage\\n\");\n\t\tprintf(\"   -d      : enable debug output\\n\");\n\t\tprintf(\"   -i      : print topology and speed info\\n\");\n\t\tprintf(\"   -j      : test composite FTDI based JTAG device\\n\");\n\t\tprintf(\"   -k      : test Mass Storage device\\n\");\n\t\tprintf(\"   -b file : dump Mass Storage data to file 'file'\\n\");\n\t\tprintf(\"   -p      : test Sony PS3 SixAxis controller\\n\");\n\t\tprintf(\"   -s      : test Microsoft Sidewinder Precision Pro (HID)\\n\");\n\t\tprintf(\"   -x      : test Microsoft XBox Controller Type S\\n\");\n\t\tprintf(\"   -l lang : language to report errors in (ISO 639-1)\\n\");\n\t\tprintf(\"   -w      : force the use of device requests when querying WCID descriptors\\n\");\n\t\tprintf(\"If only the vid:pid is provided, xusb attempts to run the most appropriate test\\n\");\n\t\treturn 0;\n\t}\n\n\tversion = libusb_get_version();\n\tprintf(\"Using libusb v%d.%d.%d.%d\\n\\n\", version->major, version->minor, version->micro, version->nano);\n\tr = libusb_init(NULL);\n\tif (r < 0)\n\t\treturn r;\n\n\tlibusb_set_debug(NULL, debug_mode?LIBUSB_LOG_LEVEL_DEBUG:LIBUSB_LOG_LEVEL_INFO);\n\tif (error_lang != NULL) {\n\t\tr = libusb_setlocale(error_lang);\n\t\tif (r < 0)\n\t\t\tprintf(\"Invalid or unsupported locale '%s': %s\\n\", error_lang, libusb_strerror((enum libusb_error)r));\n\t}\n\n\ttest_device(VID, PID);\n\n\tlibusb_exit(NULL);\n\n\treturn 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/Makefile.am",
    "content": "all: libusb-1.0.la libusb-1.0.dll\n\nAUTOMAKE_OPTIONS = subdir-objects\n\nlib_LTLIBRARIES = libusb-1.0.la\n\nPOSIX_POLL_SRC = os/poll_posix.c\nLINUX_USBFS_SRC = os/linux_usbfs.c\nDARWIN_USB_SRC = os/darwin_usb.c\nOPENBSD_USB_SRC = os/openbsd_usb.c\nNETBSD_USB_SRC = os/netbsd_usb.c\nWINDOWS_USB_SRC = os/poll_windows.c os/windows_usb.c libusb-1.0.rc libusb-1.0.def\nWINCE_USB_SRC = os/wince_usb.c os/wince_usb.h\n\nEXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) $(OPENBSD_USB_SRC) \\\n\t$(NETBSD_USB_SRC) $(WINDOWS_USB_SRC) $(WINCE_USB_SRC) \\\n\t$(POSIX_POLL_SRC) \\\n\tos/threads_posix.c os/threads_windows.c \\\n\tos/linux_udev.c os/linux_netlink.c\n\nif OS_LINUX\n\nif USE_UDEV\nOS_SRC = $(LINUX_USBFS_SRC) $(POSIX_POLL_SRC) \\\n\tos/linux_udev.c\nelse\nOS_SRC = $(LINUX_USBFS_SRC) $(POSIX_POLL_SRC) \\\n\tos/linux_netlink.c\nendif\n\nendif\n\nif OS_DARWIN\nOS_SRC = $(DARWIN_USB_SRC) $(POSIX_POLL_SRC)\nAM_CFLAGS_EXT = -no-cpp-precomp\nendif\n\nif OS_OPENBSD\nOS_SRC = $(OPENBSD_USB_SRC) $(POSIX_POLL_SRC)\nendif\n\nif OS_NETBSD\nOS_SRC = $(NETBSD_USB_SRC) $(POSIX_POLL_SRC)\nendif\n\nif OS_WINDOWS\nOS_SRC = $(WINDOWS_USB_SRC)\n\n.rc.lo:\n\t$(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) -i $< -o $@\n\nlibusb-1.0.rc: version.h version_nano.h\nendif\n\nlibusb-1.0.dll: libusb-1.0.def libusb-1.0.la\nif CREATE_IMPORT_LIB\n# Rebuild the import lib from the .def so that MS and MinGW DLLs can be interchanged\n\t$(AM_V_GEN)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $(srcdir)/libusb-1.0.def --dllname $@ --output-lib .libs/$@.a\nendif\n\nif THREADS_POSIX\nTHREADS_SRC = os/threads_posix.h os/threads_posix.c\nelse\nTHREADS_SRC = os/threads_windows.h os/threads_windows.c\nendif\n\nlibusb_1_0_la_CFLAGS = $(AM_CFLAGS)\nlibusb_1_0_la_LDFLAGS = $(LTLDFLAGS)\nlibusb_1_0_la_SOURCES = libusbi.h core.c descriptor.c io.c strerror.c sync.c \\\n\tos/linux_usbfs.h os/darwin_usb.h os/windows_usb.h os/windows_common.h \\\n\thotplug.h hotplug.c $(THREADS_SRC) $(OS_SRC) \\\n\tos/poll_posix.h os/poll_windows.h\n\nhdrdir = $(includedir)/libusb-1.0\nhdr_HEADERS = libusb.h\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/config.h",
    "content": "/*\n * Android build config for libusb\n * Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n/* Start with debug message logging enabled */\n/* #undef ENABLE_DEBUG_LOGGING */\n\n/* Message logging */\n#define ENABLE_LOGGING\n\n/* Define to 1 if you have the <dlfcn.h> header file. */\n#define HAVE_DLFCN_H 1\n\n/* Define to 1 if you have the `gettimeofday' function. */\n#define HAVE_GETTIMEOFDAY 1\n\n/* Define to 1 if you have the <inttypes.h> header file. */\n#define HAVE_INTTYPES_H 1\n\n/* Android backend */\n#define OS_ANDROID 1\n\n/* Enable output to system log */\n#define USE_SYSTEM_LOGGING_FACILITY 1\n\n/* type of second poll() argument */\n#define POLL_NFDS_TYPE nfds_t\n\n/* Use POSIX Threads */\n#define THREADS_POSIX 1\n\n/* Default visibility */\n#define DEFAULT_VISIBILITY __attribute__((visibility(\"default\")))\n\n/* Define to 1 if you have the <memory.h> header file. */\n#define HAVE_MEMORY_H 1\n\n/* Define to 1 if you have the <poll.h> header file. */\n#define HAVE_POLL_H 1\n\n/* Define to 1 if you have the <signal.h> header file. */\n#define HAVE_SIGNAL_H 1\n\n/* Define to 1 if you have the <sys/stat.h> header file. */\n#define HAVE_SYS_STAT_H 1\n\n/* Define to 1 if you have the <sys/time.h> header file. */\n#define HAVE_SYS_TIME_H 1\n\n/* Define to 1 if you have the <sys/types.h> header file. */\n#define HAVE_SYS_TYPES_H 1\n\n/* Define to 1 if you have the <unistd.h> header file. */\n#define HAVE_UNISTD_H 1\n\n/* Define to 1 if you have the <linux/filter.h> header file. */\n#define HAVE_LINUX_FILTER_H 1\n\n/* Define to 1 if you have the <linux/netlink.h> header file. */\n#define HAVE_LINUX_NETLINK_H 1\n\n/* Define to 1 if you have the <asm/types.h> header file. */\n#define HAVE_ASM_TYPES_H 1\n\n/* Define to 1 if you have the <sys/socket.h> header file. */\n#define HAVE_SYS_SOCKET_H 1\n\n#include \"utilbase.h\"\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/core.c",
    "content": "/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */\n/*\n * add some functions for no-rooted Android\n * add optimaization when compiling with gcc\n * Copyright © 2014-2017 saki <t_saki@serenegiant.com>\n *\n * Core functions for libusb\n * Copyright © 2012-2013 Nathan Hjelm <hjelmn@cs.unm.edu>\n * Copyright © 2007-2008 Daniel Drake <dsd@gentoo.org>\n * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#define LOCAL_DEBUG 0\n\n#define LOG_TAG \"libusb/core\"\n#if 1\t// デバッグ情報を出さない時1\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// LOGV/LOGD/MARKを出力しない時\n\t\t#endif\n\t#undef USE_LOGALL\t\t\t// 指定したLOGxだけを出力\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n\t#undef NDEBUG\n\t#define GET_RAW_DESCRIPTOR\n#endif\n\n#include \"config.h\"\n#include <assert.h>\t\t// XXX add assert for debugging\n\n#include <errno.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#ifdef HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n#ifdef HAVE_SYS_TIME_H\n#include <sys/time.h>\n#endif\n#ifdef HAVE_SYSLOG_H\n#include <syslog.h>\n#endif\n\n#ifdef __ANDROID__\n#include <android/log.h>\n#endif\n\n#include \"libusbi.h\"\n#include \"hotplug.h\"\n\n#if defined(OS_ANDROID)\t// XXX for non rooted android device\nconst struct usbi_os_backend * const usbi_backend = &android_usbfs_backend;\n#elif defined(OS_LINUX)\nconst struct usbi_os_backend * const usbi_backend = &linux_usbfs_backend;\n#elif defined(OS_DARWIN)\nconst struct usbi_os_backend * const usbi_backend = &darwin_backend;\n#elif defined(OS_OPENBSD)\nconst struct usbi_os_backend * const usbi_backend = &openbsd_backend;\n#elif defined(OS_NETBSD)\nconst struct usbi_os_backend * const usbi_backend = &netbsd_backend;\n#elif defined(OS_WINDOWS)\nconst struct usbi_os_backend * const usbi_backend = &windows_backend;\n#elif defined(OS_WINCE)\nconst struct usbi_os_backend * const usbi_backend = &wince_backend;\n#else\n#error \"Unsupported OS\"\n#endif\n\nstruct libusb_context *usbi_default_context = NULL;\nstatic const struct libusb_version libusb_version_internal =\n\t{ LIBUSB_MAJOR, LIBUSB_MINOR, LIBUSB_MICRO, LIBUSB_NANO,\n\t  LIBUSB_RC, \"http://libusb.info\" };\nstatic int default_context_refcnt = 0;\nstatic usbi_mutex_static_t default_context_lock = USBI_MUTEX_INITIALIZER;\nstatic struct timeval timestamp_origin = { 0, 0 };\n\nusbi_mutex_static_t active_contexts_lock = USBI_MUTEX_INITIALIZER;\nstruct list_head active_contexts_list;\n\n#ifdef __ANDROID__\nint android_generate_device(struct libusb_context *ctx, struct libusb_device **dev,\n\tint vid, int pid, const char *serial, int fd, int busnum, int devaddr);\n#endif\n\n/**\n * \\mainpage libusb-1.0 API Reference\n *\n * \\section intro Introduction\n *\n * libusb is an open source library that allows you to communicate with USB\n * devices from userspace. For more info, see the\n * <a href=\"http://libusb.info\">libusb homepage</a>.\n *\n * This documentation is aimed at application developers wishing to\n * communicate with USB peripherals from their own software. After reviewing\n * this documentation, feedback and questions can be sent to the\n * <a href=\"http://mailing-list.libusb.info\">libusb-devel mailing list</a>.\n *\n * This documentation assumes knowledge of how to operate USB devices from\n * a software standpoint (descriptors, configurations, interfaces, endpoints,\n * control/bulk/interrupt/isochronous transfers, etc). Full information\n * can be found in the <a href=\"http://www.usb.org/developers/docs/\">USB 3.0\n * Specification</a> which is available for free download. You can probably\n * find less verbose introductions by searching the web.\n *\n * \\section features Library features\n *\n * - All transfer types supported (control/bulk/interrupt/isochronous)\n * - 2 transfer interfaces:\n *    -# Synchronous (simple)\n *    -# Asynchronous (more complicated, but more powerful)\n * - Thread safe (although the asynchronous interface means that you\n *   usually won't need to thread)\n * - Lightweight with lean API\n * - Compatible with libusb-0.1 through the libusb-compat-0.1 translation layer\n * - Hotplug support (on some platforms). See \\ref hotplug.\n *\n * \\section gettingstarted Getting Started\n *\n * To begin reading the API documentation, start with the Modules page which\n * links to the different categories of libusb's functionality.\n *\n * One decision you will have to make is whether to use the synchronous\n * or the asynchronous data transfer interface. The \\ref io documentation\n * provides some insight into this topic.\n *\n * Some example programs can be found in the libusb source distribution under\n * the \"examples\" subdirectory. The libusb homepage includes a list of\n * real-life project examples which use libusb.\n *\n * \\section errorhandling Error handling\n *\n * libusb functions typically return 0 on success or a negative error code\n * on failure. These negative error codes relate to LIBUSB_ERROR constants\n * which are listed on the \\ref misc \"miscellaneous\" documentation page.\n *\n * \\section msglog Debug message logging\n *\n * libusb uses stderr for all logging. By default, logging is set to NONE,\n * which means that no output will be produced. However, unless the library\n * has been compiled with logging disabled, then any application calls to\n * libusb_set_debug(), or the setting of the environmental variable\n * LIBUSB_DEBUG outside of the application, can result in logging being\n * produced. Your application should therefore not close stderr, but instead\n * direct it to the null device if its output is undesireable.\n *\n * The libusb_set_debug() function can be used to enable logging of certain\n * messages. Under standard configuration, libusb doesn't really log much\n * so you are advised to use this function to enable all error/warning/\n * informational messages. It will help debug problems with your software.\n *\n * The logged messages are unstructured. There is no one-to-one correspondence\n * between messages being logged and success or failure return codes from\n * libusb functions. There is no format to the messages, so you should not\n * try to capture or parse them. They are not and will not be localized.\n * These messages are not intended to being passed to your application user;\n * instead, you should interpret the error codes returned from libusb functions\n * and provide appropriate notification to the user. The messages are simply\n * there to aid you as a programmer, and if you're confused because you're\n * getting a strange error code from a libusb function, enabling message\n * logging may give you a suitable explanation.\n *\n * The LIBUSB_DEBUG environment variable can be used to enable message logging\n * at run-time. This environment variable should be set to a log level number,\n * which is interpreted the same as the libusb_set_debug() parameter. When this\n * environment variable is set, the message logging verbosity level is fixed\n * and libusb_set_debug() effectively does nothing.\n *\n * libusb can be compiled without any logging functions, useful for embedded\n * systems. In this case, libusb_set_debug() and the LIBUSB_DEBUG environment\n * variable have no effects.\n *\n * libusb can also be compiled with verbose debugging messages always. When\n * the library is compiled in this way, all messages of all verbosities are\n * always logged. libusb_set_debug() and the LIBUSB_DEBUG environment variable\n * have no effects.\n *\n * \\section remarks Other remarks\n *\n * libusb does have imperfections. The \\ref caveats \"caveats\" page attempts\n * to document these.\n */\n\n/**\n * \\page caveats Caveats\n *\n * \\section devresets Device resets\n *\n * The libusb_reset_device() function allows you to reset a device. If your\n * program has to call such a function, it should obviously be aware that\n * the reset will cause device state to change (e.g. register values may be\n * reset).\n *\n * The problem is that any other program could reset the device your program\n * is working with, at any time. libusb does not offer a mechanism to inform\n * you when this has happened, so if someone else resets your device it will\n * not be clear to your own program why the device state has changed.\n *\n * Ultimately, this is a limitation of writing drivers in userspace.\n * Separation from the USB stack in the underlying kernel makes it difficult\n * for the operating system to deliver such notifications to your program.\n * The Linux kernel USB stack allows such reset notifications to be delivered\n * to in-kernel USB drivers, but it is not clear how such notifications could\n * be delivered to second-class drivers that live in userspace.\n *\n * \\section blockonly Blocking-only functionality\n *\n * The functionality listed below is only available through synchronous,\n * blocking functions. There are no asynchronous/non-blocking alternatives,\n * and no clear ways of implementing these.\n *\n * - Configuration activation (libusb_set_configuration())\n * - Interface/alternate setting activation (libusb_set_interface_alt_setting())\n * - Releasing of interfaces (libusb_release_interface())\n * - Clearing of halt/stall condition (libusb_clear_halt())\n * - Device resets (libusb_reset_device())\n *\n * \\section configsel Configuration selection and handling\n *\n * When libusb presents a device handle to an application, there is a chance\n * that the corresponding device may be in unconfigured state. For devices\n * with multiple configurations, there is also a chance that the configuration\n * currently selected is not the one that the application wants to use.\n *\n * The obvious solution is to add a call to libusb_set_configuration() early\n * on during your device initialization routines, but there are caveats to\n * be aware of:\n * -# If the device is already in the desired configuration, calling\n *    libusb_set_configuration() using the same configuration value will cause\n *    a lightweight device reset. This may not be desirable behaviour.\n * -# libusb will be unable to change configuration if the device is in\n *    another configuration and other programs or drivers have claimed\n *    interfaces under that configuration.\n * -# In the case where the desired configuration is already active, libusb\n *    may not even be able to perform a lightweight device reset. For example,\n *    take my USB keyboard with fingerprint reader: I'm interested in driving\n *    the fingerprint reader interface through libusb, but the kernel's\n *    USB-HID driver will almost always have claimed the keyboard interface.\n *    Because the kernel has claimed an interface, it is not even possible to\n *    perform the lightweight device reset, so libusb_set_configuration() will\n *    fail. (Luckily the device in question only has a single configuration.)\n *\n * One solution to some of the above problems is to consider the currently\n * active configuration. If the configuration we want is already active, then\n * we don't have to select any configuration:\n \\code\n cfg = libusb_get_configuration(dev);\n if (cfg != desired)\n libusb_set_configuration(dev, desired);\n \\endcode\n *\n * This is probably suitable for most scenarios, but is inherently racy:\n * another application or driver may change the selected configuration\n * <em>after</em> the libusb_get_configuration() call.\n *\n * Even in cases where libusb_set_configuration() succeeds, consider that other\n * applications or drivers may change configuration after your application\n * calls libusb_set_configuration().\n *\n * One possible way to lock your device into a specific configuration is as\n * follows:\n * -# Set the desired configuration (or use the logic above to realise that\n *    it is already in the desired configuration)\n * -# Claim the interface that you wish to use\n * -# Check that the currently active configuration is the one that you want\n *    to use.\n *\n * The above method works because once an interface is claimed, no application\n * or driver is able to select another configuration.\n *\n * \\section earlycomp Early transfer completion\n *\n * NOTE: This section is currently Linux-centric. I am not sure if any of these\n * considerations apply to Darwin or other platforms.\n *\n * When a transfer completes early (i.e. when less data is received/sent in\n * any one packet than the transfer buffer allows for) then libusb is designed\n * to terminate the transfer immediately, not transferring or receiving any\n * more data unless other transfers have been queued by the user.\n *\n * On legacy platforms, libusb is unable to do this in all situations. After\n * the incomplete packet occurs, \"surplus\" data may be transferred. For recent\n * versions of libusb, this information is kept (the data length of the\n * transfer is updated) and, for device-to-host transfers, any surplus data was\n * added to the buffer. Still, this is not a nice solution because it loses the\n * information about the end of the short packet, and the user probably wanted\n * that surplus data to arrive in the next logical transfer.\n *\n *\n * \\section zlp Zero length packets\n *\n * - libusb is able to send a packet of zero length to an endpoint simply by\n * submitting a transfer of zero length.\n * - The \\ref libusb_transfer_flags::LIBUSB_TRANSFER_ADD_ZERO_PACKET\n * \"LIBUSB_TRANSFER_ADD_ZERO_PACKET\" flag is currently only supported on Linux.\n */\n\n/**\n * \\page contexts Contexts\n *\n * It is possible that libusb may be used simultaneously from two independent\n * libraries linked into the same executable. For example, if your application\n * has a plugin-like system which allows the user to dynamically load a range\n * of modules into your program, it is feasible that two independently\n * developed modules may both use libusb.\n *\n * libusb is written to allow for these multiple user scenarios. The two\n * \"instances\" of libusb will not interfere: libusb_set_debug() calls\n * from one user will not affect the same settings for other users, other\n * users can continue using libusb after one of them calls libusb_exit(), etc.\n *\n * This is made possible through libusb's <em>context</em> concept. When you\n * call libusb_init(), you are (optionally) given a context. You can then pass\n * this context pointer back into future libusb functions.\n *\n * In order to keep things simple for more simplistic applications, it is\n * legal to pass NULL to all functions requiring a context pointer (as long as\n * you're sure no other code will attempt to use libusb from the same process).\n * When you pass NULL, the default context will be used. The default context\n * is created the first time a process calls libusb_init() when no other\n * context is alive. Contexts are destroyed during libusb_exit().\n *\n * The default context is reference-counted and can be shared. That means that\n * if libusb_init(NULL) is called twice within the same process, the two\n * users end up sharing the same context. The deinitialization and freeing of\n * the default context will only happen when the last user calls libusb_exit().\n * In other words, the default context is created and initialized when its\n * reference count goes from 0 to 1, and is deinitialized and destroyed when\n * its reference count goes from 1 to 0.\n *\n * You may be wondering why only a subset of libusb functions require a\n * context pointer in their function definition. Internally, libusb stores\n * context pointers in other objects (e.g. libusb_device instances) and hence\n * can infer the context from those objects.\n */\n\n/**\n * @defgroup lib Library initialization/deinitialization\n * This page details how to initialize and deinitialize libusb. Initialization\n * must be performed before using any libusb functionality, and similarly you\n * must not call any libusb functions after deinitialization.\n */\n\n/**\n * @defgroup dev Device handling and enumeration\n * The functionality documented below is designed to help with the following\n * operations:\n * - Enumerating the USB devices currently attached to the system\n * - Choosing a device to operate from your software\n * - Opening and closing the chosen device\n *\n * \\section nutshell In a nutshell...\n *\n * The description below really makes things sound more complicated than they\n * actually are. The following sequence of function calls will be suitable\n * for almost all scenarios and does not require you to have such a deep\n * understanding of the resource management issues:\n * \\code\n // discover devices\n libusb_device **list;\n libusb_device *found = NULL;\n ssize_t cnt = libusb_get_device_list(NULL, &list);\n ssize_t i = 0;\n int err = 0;\n if (cnt < 0)\n error();\n\n for (i = 0; i < cnt; i++) {\n libusb_device *device = list[i];\n if (is_interesting(device)) {\n found = device;\n break;\n }\n }\n\n if (found) {\n libusb_device_handle *handle;\n\n err = libusb_open(found, &handle);\n if (err)\n error();\n // etc\n }\n\n libusb_free_device_list(list, 1);\n \\endcode\n *\n * The two important points:\n * - You asked libusb_free_device_list() to unreference the devices (2nd\n *   parameter)\n * - You opened the device before freeing the list and unreferencing the\n *   devices\n *\n * If you ended up with a handle, you can now proceed to perform I/O on the\n * device.\n *\n * \\section devshandles Devices and device handles\n * libusb has a concept of a USB device, represented by the\n * \\ref libusb_device opaque type. A device represents a USB device that\n * is currently or was previously connected to the system. Using a reference\n * to a device, you can determine certain information about the device (e.g.\n * you can read the descriptor data).\n *\n * The libusb_get_device_list() function can be used to obtain a list of\n * devices currently connected to the system. This is known as device\n * discovery.\n *\n * Just because you have a reference to a device does not mean it is\n * necessarily usable. The device may have been unplugged, you may not have\n * permission to operate such device, or another program or driver may be\n * using the device.\n *\n * When you've found a device that you'd like to operate, you must ask\n * libusb to open the device using the libusb_open() function. Assuming\n * success, libusb then returns you a <em>device handle</em>\n * (a \\ref libusb_device_handle pointer). All \"real\" I/O operations then\n * operate on the handle rather than the original device pointer.\n *\n * \\section devref Device discovery and reference counting\n *\n * Device discovery (i.e. calling libusb_get_device_list()) returns a\n * freshly-allocated list of devices. The list itself must be freed when\n * you are done with it. libusb also needs to know when it is OK to free\n * the contents of the list - the devices themselves.\n *\n * To handle these issues, libusb provides you with two separate items:\n * - A function to free the list itself\n * - A reference counting system for the devices inside\n *\n * New devices presented by the libusb_get_device_list() function all have a\n * reference count of 1. You can increase and decrease reference count using\n * libusb_ref_device() and libusb_unref_device(). A device is destroyed when\n * its reference count reaches 0.\n *\n * With the above information in mind, the process of opening a device can\n * be viewed as follows:\n * -# Discover devices using libusb_get_device_list().\n * -# Choose the device that you want to operate, and call libusb_open().\n * -# Unref all devices in the discovered device list.\n * -# Free the discovered device list.\n *\n * The order is important - you must not unreference the device before\n * attempting to open it, because unreferencing it may destroy the device.\n *\n * For convenience, the libusb_free_device_list() function includes a\n * parameter to optionally unreference all the devices in the list before\n * freeing the list itself. This combines steps 3 and 4 above.\n *\n * As an implementation detail, libusb_open() actually adds a reference to\n * the device in question. This is because the device remains available\n * through the handle via libusb_get_device(). The reference is deleted during\n * libusb_close().\n */\n\n/** @defgroup misc Miscellaneous */\n\n/* we traverse usbfs without knowing how many devices we are going to find.\n * so we create this discovered_devs model which is similar to a linked-list\n * which grows when required. it can be freed once discovery has completed,\n * eliminating the need for a list node in the libusb_device structure\n * itself. */\n#define DISCOVERED_DEVICES_SIZE_STEP 8\n\nstatic struct discovered_devs *discovered_devs_alloc(void) {\n\n\tstruct discovered_devs *ret =\n\t\tmalloc(sizeof(*ret) + (sizeof(void *) * DISCOVERED_DEVICES_SIZE_STEP));\n\n\tif (ret) {\n\t\tret->len = 0;\n\t\tret->capacity = DISCOVERED_DEVICES_SIZE_STEP;\n\t}\n\treturn ret;\n}\n\n/* append a device to the discovered devices collection. may realloc itself,\n * returning new discdevs. returns NULL on realloc failure. */\nstruct discovered_devs *discovered_devs_append(\n\tstruct discovered_devs *discdevs, struct libusb_device *dev) {\n\t\n\tsize_t len = discdevs->len;\n\tsize_t capacity;\n\n\t/* if there is space, just append the device */\n\tif (LIKELY(len < discdevs->capacity)) {\n\t\tdiscdevs->devices[len] = libusb_ref_device(dev);\n\t\tdiscdevs->len++;\n\t\treturn discdevs;\n\t}\n\n\t/* exceeded capacity, need to grow */\n\tusbi_dbg(\"need to increase capacity\");\n\tcapacity = discdevs->capacity + DISCOVERED_DEVICES_SIZE_STEP;\n\tdiscdevs = usbi_reallocf(discdevs,\n\t\t\tsizeof(*discdevs) + (sizeof(void *) * capacity));\n\tif (LIKELY(discdevs)) {\n\t\tdiscdevs->capacity = capacity;\n\t\tdiscdevs->devices[len] = libusb_ref_device(dev);\n\t\tdiscdevs->len++;\n\t}\n\n\treturn discdevs;\n}\n\nstatic void discovered_devs_free(struct discovered_devs *discdevs) {\n\n\tsize_t i;\n\n\tfor (i = 0; i < discdevs->len; i++)\n\t\tlibusb_unref_device(discdevs->devices[i]);\n\n\tfree(discdevs);\n}\n\n/* Allocate a new device with a specific session ID. The returned device has\n * a reference count of 1. */\nstruct libusb_device *usbi_alloc_device(struct libusb_context *ctx,\n\tunsigned long session_id) {\n\t\n\tsize_t priv_size = usbi_backend->device_priv_size;\n\tstruct libusb_device *dev = calloc(1, sizeof(*dev) + priv_size);\n\tint r;\n\n\tif (UNLIKELY(!dev))\n\t\treturn NULL ;\n\n\tr = usbi_mutex_init(&dev->lock, NULL);\n\tif (UNLIKELY(r)) {\n\t\tfree(dev);\n\t\treturn NULL;\n\t}\n\n\tdev->ctx = ctx;\n\tdev->refcnt = 1;\n\tdev->session_data = session_id;\n\tdev->speed = LIBUSB_SPEED_UNKNOWN;\n\n\tif (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {\n\t\tusbi_connect_device(dev);\n\t}\n\n\treturn dev;\n}\n\nvoid usbi_connect_device(struct libusb_device *dev) {\n\n\tlibusb_hotplug_message message;\n\tssize_t ret;\n\n\tmemset(&message, 0, sizeof(message));\n\tmessage.event = LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED;\n\tmessage.device = dev;\n\tdev->attached = 1;\n\n\tusbi_mutex_lock(&dev->ctx->usb_devs_lock);\n\t{\n\t\tlist_add(&dev->list, &dev->ctx->usb_devs);\n\t}\n\tusbi_mutex_unlock(&dev->ctx->usb_devs_lock);\n\n\t/* Signal that an event has occurred for this device if we support hotplug AND\n\t * the hotplug pipe is ready. This prevents an event from getting raised during\n\t * initial enumeration. */\n\tif (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)\n\t\t\t&& dev->ctx->hotplug_pipe[1] > 0) {\n\t\tret = usbi_write(dev->ctx->hotplug_pipe[1], &message, sizeof(message));\n\t\tif (UNLIKELY(sizeof(message) != ret)) {\n\t\t\tusbi_err(DEVICE_CTX(dev), \"error writing hotplug message\");\n\t\t}\n\t}\n}\n\nvoid usbi_disconnect_device(struct libusb_device *dev) {\n\n\tlibusb_hotplug_message message;\n\tstruct libusb_context *ctx = dev->ctx;\n\tssize_t ret;\n\n\tmemset(&message, 0, sizeof(message));\n\tmessage.event = LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT;\n\tmessage.device = dev;\n\tusbi_mutex_lock(&dev->lock);\n\t{\n\t\tdev->attached = 0;\n\t}\n\tusbi_mutex_unlock(&dev->lock);\n\n\tusbi_mutex_lock(&ctx->usb_devs_lock);\n\t{\n\t\tlist_del(&dev->list);\n\t}\n\tusbi_mutex_unlock(&ctx->usb_devs_lock);\n\n\t/* Signal that an event has occurred for this device if we support hotplug AND\n\t * the hotplug pipe is ready. This prevents an event from getting raised during\n\t * initial enumeration. libusb_handle_events will take care of dereferencing the\n\t * device. */\n\tif (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)\n\t\t\t&& dev->ctx->hotplug_pipe[1] > 0) {\n\t\tret = usbi_write(dev->ctx->hotplug_pipe[1], &message, sizeof(message));\n\t\tif (UNLIKELY(sizeof(message) != ret)) {\n\t\t\tusbi_err(DEVICE_CTX(dev), \"error writing hotplug message\");\n\t\t}\n\t}\n}\n\n/* Perform some final sanity checks on a newly discovered device. If this\n * function fails (negative return code), the device should not be added\n * to the discovered device list. */\nint usbi_sanitize_device(struct libusb_device *dev) {\n\n\tint r;\n\tuint8_t num_configurations;\n\n\tr = usbi_device_cache_descriptor(dev);\n\tif (UNLIKELY(r < 0))\n\t\treturn r;\n\n\tnum_configurations = dev->device_descriptor.bNumConfigurations;\n\tif UNLIKELY(num_configurations > USB_MAXCONFIG) {\n\t\tusbi_err(DEVICE_CTX(dev), \"too many configurations\");\n\t\treturn LIBUSB_ERROR_IO;\n\t} else if (0 == num_configurations)\n\t\tusbi_dbg(\"zero configurations, maybe an unauthorized device\");\n\n\tdev->num_configurations = num_configurations;\n\treturn LIBUSB_SUCCESS;\n}\n\n/* Examine libusb's internal list of known devices, looking for one with\n * a specific session ID. Returns the matching device if it was found, and\n * NULL otherwise. */\nstruct libusb_device *usbi_get_device_by_session_id(struct libusb_context *ctx,\n\t\tunsigned long session_id) {\n\t\t\n\tstruct libusb_device *dev;\n\tstruct libusb_device *ret = NULL;\n\n\tusbi_mutex_lock(&ctx->usb_devs_lock);\n\t{\n\t\tlist_for_each_entry(dev, &ctx->usb_devs, list, struct libusb_device)\n\t\t\tif (dev->session_data == session_id) {\n\t\t\t\tret = libusb_ref_device(dev);\n\t\t\t\tbreak;\n\t\t\t}\n\t}\n\tusbi_mutex_unlock(&ctx->usb_devs_lock);\n\n\treturn ret;\n}\n\n/** @ingroup dev\n * Returns a list of USB devices currently attached to the system. This is\n * your entry point into finding a USB device to operate.\n *\n * You are expected to unreference all the devices when you are done with\n * them, and then free the list with libusb_free_device_list(). Note that\n * libusb_free_device_list() can unref all the devices for you. Be careful\n * not to unreference a device you are about to open until after you have\n * opened it.\n *\n * This return value of this function indicates the number of devices in\n * the resultant list. The list is actually one element larger, as it is\n * NULL-terminated.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param list output location for a list of devices. Must be later freed with\n * libusb_free_device_list().\n * \\returns the number of devices in the outputted list, or any\n * \\ref libusb_error according to errors encountered by the backend.\n */\nssize_t API_EXPORTED libusb_get_device_list(libusb_context *ctx,\n\t\tlibusb_device ***list) {\n\n\tENTER();\n\n\tstruct discovered_devs *discdevs = discovered_devs_alloc();\n\tstruct libusb_device **ret;\n\tint r = 0;\n\tssize_t i, len;\n\tUSBI_GET_CONTEXT(ctx);\n\tusbi_dbg(\"\");\n\n\tif (UNLIKELY(!discdevs))\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tif (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {\n\t\tLOGD(\"backend provides hotplug support\");\n\t\tstruct libusb_device *dev;\n\n\t\tif (usbi_backend->hotplug_poll)\n\t\t\tusbi_backend->hotplug_poll();\n\n\t\tusbi_mutex_lock(&ctx->usb_devs_lock);\n\t\t{\n\t\t\tlist_for_each_entry(dev, &ctx->usb_devs, list, struct libusb_device)\n\t\t\t{\n\t\t\t\tdiscdevs = discovered_devs_append(discdevs, dev);\n\n\t\t\t\tif (UNLIKELY(!discdevs)) {\n\t\t\t\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tusbi_mutex_unlock(&ctx->usb_devs_lock);\n\t} else {\n\t\tLOGD(\"backend does not provide hotplug support\");\n\t\tr = usbi_backend->get_device_list(ctx, &discdevs);\n\t}\n\n\tif (UNLIKELY(r < 0)) {\n\t\tlen = r;\n\t\tgoto out;\n\t}\n\n\t/* convert discovered_devs into a list */\n\tlen = discdevs->len;\n\tret = calloc(len + 1, sizeof(struct libusb_device *));\n\tif (UNLIKELY(!ret)) {\n\t\tLOGE(\"LIBUSB_ERROR_NO_MEM\");\n\t\tlen = LIBUSB_ERROR_NO_MEM;\n\t\tgoto out;\n\t}\n\n\tret[len] = NULL;\n\tfor (i = 0; i < len; i++) {\n\t\tstruct libusb_device *dev = discdevs->devices[i];\n\t\tret[i] = libusb_ref_device(dev);\n\t}\n\t*list = ret;\n\nout:\n\tdiscovered_devs_free(discdevs);\n\tRETURN(len, int);\n}\n\n/**\n * search device with specific vender ID and product ID\n * TODO it is better to check serial number for multiple device connection with same vender ID and product ID\n * @return null if not found\n * @param vid: vender ID, 0 means don't care\n * @param pid: product ID, 0 means don't care\n * @param sn: serial number(currently not use)\n * @param fd: file descripter that need to access device on no-rooted Android\n * @return null if not found\n */\nlibusb_device *libusb_find_device(libusb_context *ctx, const int vid,\n\t\tconst int pid, const char* sn, int fd) {\n\n\tENTER();\n\n\tlibusb_device **devs;\n\t// get list of devices\n\tint cnt = libusb_get_device_list(ctx, &devs);\n\tif (UNLIKELY(cnt < 0)) {\n\t\tLOGI(\"failed to get device list\");\n\t\tusbi_dbg(\"failed to get device list\");\n\t\treturn NULL ;\n\t}\n\n\tint r, i;\n\tlibusb_device *device = NULL;\n\tstruct libusb_device_descriptor desc;\n\tLOGI(\"try to find specific device:cnt=%d\", cnt);\n\tfor (i = 0; i < cnt; i++) {\n\t\tr = libusb_get_device_descriptor(devs[i], &desc);\n\t\tif (UNLIKELY(r < 0)) {\n\t\t\tLOGI(\"failed to get device descriptor\");\n\t\t\tusbi_dbg(\"failed to get device descriptor\");\n\t\t\tcontinue;\n\t\t}\n\t\tif ((!vid || (desc.idVendor == vid))\n\t\t\t\t&& (!pid || (desc.idProduct == pid))) {\n\t\t\tLOGI(\"found\");\n\t\t\tdevice = devs[i];\n\t\t\tlibusb_ref_device(device);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tlibusb_free_device_list(devs, 1);\n\tRET(device);\n}\n\n/** \\ingroup dev\n * Frees a list of devices previously discovered using\n * libusb_get_device_list(). If the unref_devices parameter is set, the\n * reference count of each device in the list is decremented by 1.\n * \\param list the list to free\n * \\param unref_devices whether to unref the devices in the list\n */\nvoid API_EXPORTED libusb_free_device_list(libusb_device **list,\n\t\tint unref_devices) {\n\t\t\n\tif (UNLIKELY(!list))\n\t\treturn;\n\n\tif (unref_devices) {\n\t\tint i = 0;\n\t\tstruct libusb_device *dev;\n\n\t\twhile ((dev = list[i++]) != NULL)\n\t\t\tlibusb_unref_device(dev);\n\t}\n\tfree(list);\n}\n\n/** \\ingroup dev\n * Get the number of the bus that a device is connected to.\n * \\param dev a device\n * \\returns the bus number\n */\nuint8_t API_EXPORTED libusb_get_bus_number(libusb_device *dev) {\n\n\treturn dev->bus_number;\n}\n\n/** \\ingroup dev\n * Get the number of the port that a device is connected to.\n * Unless the OS does something funky, or you are hot-plugging USB extension cards,\n * the port number returned by this call is usually guaranteed to be uniquely tied\n * to a physical port, meaning that different devices plugged on the same physical\n * port should return the same port number.\n *\n * But outside of this, there is no guarantee that the port number returned by this\n * call will remain the same, or even match the order in which ports have been\n * numbered by the HUB/HCD manufacturer.\n *\n * \\param dev a device\n * \\returns the port number (0 if not available)\n */\nuint8_t API_EXPORTED libusb_get_port_number(libusb_device *dev) {\n\n\treturn dev->port_number;\n}\n\n/** \\ingroup dev\n * Get the list of all port numbers from root for the specified device\n *\n * Since version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102\n * \\param dev a device\n * \\param port_numbers the array that should contain the port numbers\n * \\param port_numbers_len the maximum length of the array. As per the USB 3.0\n * specs, the current maximum limit for the depth is 7.\n * \\returns the number of elements filled\n * \\returns LIBUSB_ERROR_OVERFLOW if the array is too small\n */\nint API_EXPORTED libusb_get_port_numbers(libusb_device *dev,\n\t\tuint8_t* port_numbers, int port_numbers_len) {\n\n\tint i = port_numbers_len;\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\n\tif UNLIKELY(port_numbers_len <= 0)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\t// HCDs can be listed as devices with port #0\n\twhile ((dev) && (dev->port_number != 0)) {\n\t\tif (--i < 0) {\n\t\t\tusbi_warn(ctx, \"port numbers array is too small\");\n\t\t\treturn LIBUSB_ERROR_OVERFLOW;\n\t\t}\n\t\tport_numbers[i] = dev->port_number;\n\t\tdev = dev->parent_dev;\n\t}\n\tif (i < port_numbers_len)\n\t\tmemmove(port_numbers, &port_numbers[i], port_numbers_len - i);\n\treturn port_numbers_len - i;\n}\n\n/** \\ingroup dev\n * Deprecated please use libusb_get_port_numbers instead.\n */\nint API_EXPORTED libusb_get_port_path(libusb_context *ctx, libusb_device *dev,\n\t\tuint8_t* port_numbers, uint8_t port_numbers_len) {\n\t\t\n\tUNUSED(ctx);\n\n\treturn libusb_get_port_numbers(dev, port_numbers, port_numbers_len);\n}\n\n/** \\ingroup dev\n * Get the the parent from the specified device.\n * \\param dev a device\n * \\returns the device parent or NULL if not available\n * You should issue a \\ref libusb_get_device_list() before calling this\n * function and make sure that you only access the parent before issuing\n * \\ref libusb_free_device_list(). The reason is that libusb currently does\n * not maintain a permanent list of device instances, and therefore can\n * only guarantee that parents are fully instantiated within a \n * libusb_get_device_list() - libusb_free_device_list() block.\n */\nDEFAULT_VISIBILITY\nlibusb_device * LIBUSB_CALL libusb_get_parent(libusb_device *dev) {\n\n\treturn dev->parent_dev;\n}\n\n/** \\ingroup dev\n * Get the address of the device on the bus it is connected to.\n * \\param dev a device\n * \\returns the device address\n */\nuint8_t API_EXPORTED libusb_get_device_address(libusb_device *dev) {\n\n\treturn dev->device_address;\n}\n\n/** \\ingroup dev\n * Get the negotiated connection speed for a device.\n * \\param dev a device\n * \\returns a \\ref libusb_speed code, where LIBUSB_SPEED_UNKNOWN means that\n * the OS doesn't know or doesn't support returning the negotiated speed.\n */\nint API_EXPORTED libusb_get_device_speed(libusb_device *dev) {\n\n\treturn dev->speed;\n}\n\nstatic const struct libusb_endpoint_descriptor *find_endpoint(\n\tstruct libusb_config_descriptor *config, unsigned char endpoint) {\n\t\n\tint iface_idx;\n\tfor (iface_idx = 0; iface_idx < config->bNumInterfaces; iface_idx++) {\n\t\tconst struct libusb_interface *iface = &config->interface[iface_idx];\n\t\tint altsetting_idx;\n\n\t\tfor (altsetting_idx = 0; altsetting_idx < iface->num_altsetting;\n\t\t\t\taltsetting_idx++) {\n\t\t\tconst struct libusb_interface_descriptor *altsetting\n\t\t\t\t= &iface->altsetting[altsetting_idx];\n\t\t\tint ep_idx;\n\n\t\t\tfor (ep_idx = 0; ep_idx < altsetting->bNumEndpoints; ep_idx++) {\n\t\t\t\tconst struct libusb_endpoint_descriptor *ep =\n\t\t\t\t\t\t&altsetting->endpoint[ep_idx];\n\t\t\t\tif (ep->bEndpointAddress == endpoint)\n\t\t\t\t\treturn ep;\n\t\t\t}\n\t\t}\n\t}\n\treturn NULL;\n}\n\n/** \\ingroup dev\n * Convenience function to retrieve the wMaxPacketSize value for a particular\n * endpoint in the active device configuration.\n *\n * This function was originally intended to be of assistance when setting up\n * isochronous transfers, but a design mistake resulted in this function\n * instead. It simply returns the wMaxPacketSize value without considering\n * its contents. If you're dealing with isochronous transfers, you probably\n * want libusb_get_max_iso_packet_size() instead.\n *\n * \\param dev a device\n * \\param endpoint address of the endpoint in question\n * \\returns the wMaxPacketSize value\n * \\returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist\n * \\returns LIBUSB_ERROR_OTHER on other failure\n */\nint API_EXPORTED libusb_get_max_packet_size(libusb_device *dev,\n\t\tunsigned char endpoint) {\n\n\tstruct libusb_config_descriptor *config;\n\tconst struct libusb_endpoint_descriptor *ep;\n\tint r;\n\n\tr = libusb_get_active_config_descriptor(dev, &config);\n\tif (UNLIKELY(r < 0)) {\n\t\tusbi_err(DEVICE_CTX(dev),\n\t\t\t\t\"could not retrieve active config descriptor\");\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\tep = find_endpoint(config, endpoint);\n\tif (UNLIKELY(!ep)) {\n\t\tr = LIBUSB_ERROR_NOT_FOUND;\n\t\tgoto out;\n\t}\n\n\tr = ep->wMaxPacketSize;\n\nout:\n\tlibusb_free_config_descriptor(config);\n\treturn r;\n}\n\n/** \\ingroup dev\n * Calculate the maximum packet size which a specific endpoint is capable is\n * sending or receiving in the duration of 1 microframe\n *\n * Only the active configuration is examined. The calculation is based on the\n * wMaxPacketSize field in the endpoint descriptor as described in section\n * 9.6.6 in the USB 2.0 specifications.\n *\n * If acting on an isochronous or interrupt endpoint, this function will\n * multiply the value found in bits 0:10 by the number of transactions per\n * microframe (determined by bits 11:12). Otherwise, this function just\n * returns the numeric value found in bits 0:10.\n *\n * This function is useful for setting up isochronous transfers, for example\n * you might pass the return value from this function to\n * libusb_set_iso_packet_lengths() in order to set the length field of every\n * isochronous packet in a transfer.\n *\n * Since v1.0.3.\n *\n * \\param dev a device\n * \\param endpoint address of the endpoint in question\n * \\returns the maximum packet size which can be sent/received on this endpoint\n * \\returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist\n * \\returns LIBUSB_ERROR_OTHER on other failure\n */\nint API_EXPORTED libusb_get_max_iso_packet_size(libusb_device *dev,\n\t\tunsigned char endpoint) {\n\n\tstruct libusb_config_descriptor *config;\n\tconst struct libusb_endpoint_descriptor *ep;\n\tenum libusb_transfer_type ep_type;\n\tuint16_t val;\n\tint r;\n\n\tr = libusb_get_active_config_descriptor(dev, &config);\n\tif (UNLIKELY(r < 0)) {\n\t\tusbi_err(DEVICE_CTX(dev),\n\t\t\t\t\"could not retrieve active config descriptor\");\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\tep = find_endpoint(config, endpoint);\n\tif (UNLIKELY(!ep)) {\n\t\tr = LIBUSB_ERROR_NOT_FOUND;\n\t\tgoto out;\n\t}\n\n\tval = ep->wMaxPacketSize;\n\tep_type = (enum libusb_transfer_type) (ep->bmAttributes & 0x3);\n\n\tr = val & 0x07ff;\n\tif (ep_type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS\n\t\t\t|| ep_type == LIBUSB_TRANSFER_TYPE_INTERRUPT)\n\t\tr *= (1 + ((val >> 11) & 3));\n\nout:\n\tlibusb_free_config_descriptor(config);\n\treturn r;\n}\n\n/** \\ingroup dev\n * Increment the reference count of a device.\n * \\param dev the device to reference\n * \\returns the same device\n */\nDEFAULT_VISIBILITY\nlibusb_device * LIBUSB_CALL libusb_ref_device(libusb_device *dev) {\n\n\tint refcnt;\n\tusbi_mutex_lock(&dev->lock);\n\t{\n\t\trefcnt = ++dev->refcnt;\n\t}\n\tusbi_mutex_unlock(&dev->lock);\n//\tLOGI(\"refcnt=%d\", refcnt);\n\treturn dev;\n}\n\n/** \\ingroup dev\n * Decrement the reference count of a device. If the decrement operation\n * causes the reference count to reach zero, the device shall be destroyed.\n * \\param dev the device to unreference\n */\nvoid API_EXPORTED libusb_unref_device(libusb_device *dev) {\n\n\tint refcnt;\n\n\tif (UNLIKELY(!dev))\n\t\treturn;\n\n\tusbi_mutex_lock(&dev->lock);\n\t{\n\t\trefcnt = --dev->refcnt;\n\t}\n\tusbi_mutex_unlock(&dev->lock);\n//\tLOGI(\"refcnt=%d\", dev->refcnt);\n\n\tif (refcnt == 0) {\n\t\tusbi_dbg(\"destroy device %d.%d\", dev->bus_number, dev->device_address);\n\n\t\tlibusb_unref_device(dev->parent_dev);\n\n\t\tif (usbi_backend->destroy_device)\n\t\t\tusbi_backend->destroy_device(dev);\n\n\t\tif (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {\n\t\t\t/* backend does not support hotplug */\n\t\t\tusbi_disconnect_device(dev);\n\t\t}\n\n\t\tusbi_mutex_destroy(&dev->lock);\n\t\tfree(dev);\n\t}\n}\n\n/*\n * Interrupt the iteration of the event handling thread, so that it picks\n * up the new fd.\n */\nvoid usbi_fd_notification(struct libusb_context *ctx) {\n\n\tunsigned char dummy = 1;\n\tssize_t r;\n\n\tif (UNLIKELY(ctx == NULL))\n\t\treturn;\n\n\t/* record that we are messing with poll fds */\n\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\t{\n\t\tctx->pollfd_modify++;\n\t}\n\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\n\t/* write some data on control pipe to interrupt event handlers */\n\tr = usbi_write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy));\n\tif (UNLIKELY(r <= 0)) {\n\t\tusbi_warn(ctx, \"internal signalling write failed\");\n\t\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\t\t{\n\t\t\tctx->pollfd_modify--;\n\t\t}\n\t\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\t\treturn;\n\t}\n\n\t/* take event handling lock */\n\tlibusb_lock_events(ctx);\n\t{\n\t\t/* read the dummy data */\n\t\tr = usbi_read(ctx->ctrl_pipe[0], &dummy, sizeof(dummy));\n\t\tif (UNLIKELY(r <= 0))\n\t\t\tusbi_warn(ctx, \"internal signalling read failed\");\n\n\t\t/* we're done with modifying poll fds */\n\t\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\t\t{\n\t\t\tctx->pollfd_modify--;\n\t\t}\n\t\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\t}\n\t/* Release event handling lock and wake up event waiters */\n\tlibusb_unlock_events(ctx);\n}\n\n/** \\ingroup dev\n * Open a device and obtain a device handle. A handle allows you to perform\n * I/O on the device in question.\n *\n * Internally, this function adds a reference to the device and makes it\n * available to you through libusb_get_device(). This reference is removed\n * during libusb_close().\n *\n * This is a non-blocking function; no requests are sent over the bus.\n *\n * \\param dev the device to open\n * \\param handle output location for the returned device handle pointer. Only\n * populated when the return code is 0.\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NO_MEM on memory allocation failure\n * \\returns LIBUSB_ERROR_ACCESS if the user has insufficient permissions\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failure\n */\nint API_EXPORTED libusb_open(libusb_device *dev, libusb_device_handle **handle) {\n\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\tstruct libusb_device_handle *_handle;\n\tsize_t priv_size = usbi_backend->device_handle_priv_size;\n\tint r;\n\tusbi_dbg(\"open (bus/addr)=(%d.%d)\", dev->bus_number, dev->device_address);\n\n\tif (UNLIKELY(!dev->attached)) {\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t}\n\n\t_handle = malloc(sizeof(*_handle) + priv_size);\n\tif (UNLIKELY(!_handle))\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tr = usbi_mutex_init(&_handle->lock, NULL);\n\tif (UNLIKELY(r)) {\n\t\tfree(_handle);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\t_handle->dev = libusb_ref_device(dev);\n\t_handle->auto_detach_kernel_driver = 0;\n\t_handle->claimed_interfaces = 0;\n\tmemset(&_handle->os_priv, 0, priv_size);\n\n\tr = usbi_backend->open(_handle);\n\tif (UNLIKELY(r < 0)) {\n\t\tusbi_dbg(\"open %d.%d returns %d\", dev->bus_number, dev->device_address, r);\n\t\tlibusb_unref_device(dev);\n\t\tusbi_mutex_destroy(&_handle->lock);\n\t\tfree(_handle);\n\t\treturn r;\n\t}\n\n\tusbi_mutex_lock(&ctx->open_devs_lock);\n\t{\n\t\tlist_add(&_handle->list, &ctx->open_devs);\n\t}\n\tusbi_mutex_unlock(&ctx->open_devs_lock);\n\t*handle = _handle;\n\n\t/* At this point, we want to interrupt any existing event handlers so\n\t * that they realise the addition of the new device's poll fd. One\n\t * example when this is desirable is if the user is running a separate\n\t * dedicated libusb events handling thread, which is running with a long\n\t * or infinite timeout. We want to interrupt that iteration of the loop,\n\t * so that it picks up the new fd, and then continues. */\n\tusbi_fd_notification(ctx);\n\n\treturn LIBUSB_SUCCESS;\n}\n\nint API_EXPORTED libusb_set_device_fd(libusb_device *dev, int fd) {\n\n\treturn usbi_backend->set_device_fd(dev, fd);\n}\n\nlibusb_device * LIBUSB_CALL libusb_get_device_with_fd(libusb_context *ctx,\n\tint vid, int pid, const char *serial, int fd, int busnum, int devaddr) {\n\n\tENTER();\n\n\tstruct libusb_device *device = NULL;\n\t// android_generate_device内でusbi_alloc_deviceが呼ばれた時に参照カウンタは1\n\tint ret = android_generate_device(ctx, &device, vid, pid, serial, fd, busnum, devaddr);\n\tif (ret) {\n\t\tLOGD(\"android_generate_device failed:err=%d\", ret);\n\t\tdevice = NULL;\n\t}\n\n\tRET(device);\n}\n\n/** \\ingroup dev\n * Convenience function for finding a device with a particular\n * <tt>idVendor</tt>/<tt>idProduct</tt> combination. This function is intended\n * for those scenarios where you are using libusb to knock up a quick test\n * application - it allows you to avoid calling libusb_get_device_list() and\n * worrying about traversing/freeing the list.\n *\n * This function has limitations and is hence not intended for use in real\n * applications: if multiple devices have the same IDs it will only\n * give you the first one, etc.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param vendor_id the idVendor value to search for\n * \\param product_id the idProduct value to search for\n * \\returns a handle for the first found device, or NULL on error or if the\n * device could not be found. */\nDEFAULT_VISIBILITY\nlibusb_device_handle * LIBUSB_CALL libusb_open_device_with_vid_pid(\n\t\tlibusb_context *ctx, uint16_t vendor_id, uint16_t product_id) {\n\n\tstruct libusb_device **devs;\n\tstruct libusb_device *found = NULL;\n\tstruct libusb_device *dev;\n\tstruct libusb_device_handle *handle = NULL;\n\tsize_t i = 0;\n\tint r;\n\n\tif (libusb_get_device_list(ctx, &devs) < 0)\n\t\treturn NULL;\n\n\twhile ((dev = devs[i++]) != NULL) {\n\t\tstruct libusb_device_descriptor desc;\n\t\tr = libusb_get_device_descriptor(dev, &desc);\n\t\tif (UNLIKELY(r < 0))\n\t\t\tgoto out;\n\t\tif (desc.idVendor == vendor_id && desc.idProduct == product_id) {\n\t\t\tfound = dev;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (found) {\n\t\tr = libusb_open(found, &handle);\n\t\tif (UNLIKELY(r < 0))\n\t\t\thandle = NULL;\n\t}\n\nout:\n\tlibusb_free_device_list(devs, 1);\n\treturn handle;\n}\n\nstatic void do_close(struct libusb_context *ctx,\n\tstruct libusb_device_handle *dev_handle) {\n\n\tstruct usbi_transfer *itransfer;\n\tstruct usbi_transfer *tmp;\n\n\tlibusb_lock_events(ctx);\n\t{\n\t\t/* remove any transfers in flight that are for this device */\n\t\tusbi_mutex_lock(&ctx->flying_transfers_lock);\n\t\t{\n\t\t\t/* safe iteration because transfers may be being deleted */\n\t\t\tlist_for_each_entry_safe(itransfer, tmp, &ctx->flying_transfers, list, struct usbi_transfer)\n\t\t\t{\n\t\t\t\tstruct libusb_transfer *transfer =\n\t\t\t\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n\t\t\t\tif (transfer->dev_handle != dev_handle)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif (!(itransfer->flags & USBI_TRANSFER_DEVICE_DISAPPEARED)) {\n\t\t\t\t\tusbi_err(ctx,\n\t\t\t\t\t\t\"Device handle closed while transfer was still being processed, but the device is still connected as far as we know\");\n\n\t\t\t\t\tif (itransfer->flags & USBI_TRANSFER_CANCELLING)\n\t\t\t\t\t\tusbi_warn(ctx,\n\t\t\t\t\t\t\t\"A cancellation for an in-flight transfer hasn't completed but closing the device handle\");\n\t\t\t\t\telse\n\t\t\t\t\t\tusbi_err(ctx,\n\t\t\t\t\t\t\t\"A cancellation hasn't even been scheduled on the transfer for which the device is closing\");\n\t\t\t\t}\n\n\t\t\t\t/* remove from the list of in-flight transfers and make sure\n\t\t\t\t * we don't accidentally use the device handle in the future\n\t\t\t\t * (or that such accesses will be easily caught and identified as a crash)\n\t\t\t\t */\n\t\t\t\tusbi_mutex_lock(&itransfer->lock);\n\t\t\t\t{\n\t\t\t\t\tlist_del(&itransfer->list);\n\t\t\t\t\ttransfer->dev_handle = NULL;\n\t\t\t\t}\n\t\t\t\tusbi_mutex_unlock(&itransfer->lock);\n\n\t\t\t\t/* it is up to the user to free up the actual transfer struct.  this is\n\t\t\t\t * just making sure that we don't attempt to process the transfer after\n\t\t\t\t * the device handle is invalid\n\t\t\t\t */\n\t\t\t\tusbi_dbg(\n\t\t\t\t\t\t\"Removed transfer %p from the in-flight list because device handle %p closed\",\n\t\t\t\t\t\ttransfer, dev_handle);\n\t\t\t}\n\t\t}\n\t\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\t}\n\tlibusb_unlock_events(ctx);\n\n\tusbi_mutex_lock(&ctx->open_devs_lock);\n\t{\n\t\tlist_del(&dev_handle->list);\n\t}\n\tusbi_mutex_unlock(&ctx->open_devs_lock);\n\n\tusbi_backend->close(dev_handle);\n\tlibusb_unref_device(dev_handle->dev);\n\tusbi_mutex_destroy(&dev_handle->lock);\n\tfree(dev_handle);\n}\n\n/** \\ingroup dev\n * Close a device handle. Should be called on all open handles before your\n * application exits.\n *\n * Internally, this function destroys the reference that was added by\n * libusb_open() on the given device.\n *\n * This is a non-blocking function; no requests are sent over the bus.\n *\n * \\param dev_handle the handle to close\n */\nvoid API_EXPORTED libusb_close(libusb_device_handle *dev_handle) {\n\n\tstruct libusb_context *ctx;\n\tunsigned char dummy = 1;\n\tssize_t r;\n\n\tif (UNLIKELY(!dev_handle))\n\t\treturn;\n\tusbi_dbg(\"\");\n\n\tctx = HANDLE_CTX(dev_handle);\n\n\t/* Similarly to libusb_open(), we want to interrupt all event handlers\n\t * at this point. More importantly, we want to perform the actual close of\n\t * the device while holding the event handling lock (preventing any other\n\t * thread from doing event handling) because we will be removing a file\n\t * descriptor from the polling loop. */\n\n\t/* record that we are messing with poll fds */\n\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\t{\n\t\tctx->pollfd_modify++;\n\t}\n\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\n\t/* write some data on control pipe to interrupt event handlers */\n\tr = usbi_write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy));\n\tif (UNLIKELY(r <= 0)) {\n\t\tusbi_warn(ctx, \"internal signalling write failed, closing anyway\");\n\t\tdo_close(ctx, dev_handle);\n\t\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\t\t{\n\t\t\tctx->pollfd_modify--;\n\t\t}\n\t\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\t\treturn;\n\t}\n\n\t/* take event handling lock */\n\tlibusb_lock_events(ctx);\t// XXX crash\n\t{\n\t\t/* read the dummy data */\n\t\tr = usbi_read(ctx->ctrl_pipe[0], &dummy, sizeof(dummy));\t// XXX crash\n\t\tif (UNLIKELY(r <= 0)) {\n\t\t\tusbi_warn(ctx, \"internal signalling read failed, closing anyway\");\n\t\t}\n\n\t\t/* Close the device */\n\t\tdo_close(ctx, dev_handle);\t// XXX this function internally call libusb_lock_events/libusb_unlock_events\n\t\t\t\t\t\t\t\t\t// while libusb_lock_events is already called and will hang-up on some OS?\n\n\t\t/* we're done with modifying poll fds */\n\t\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\t\t{\n\t\t\tctx->pollfd_modify--;\n\t\t}\n\t\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\t}\n\t/* Release event handling lock and wake up event waiters */\n\tlibusb_unlock_events(ctx);\n}\n\n/** \\ingroup dev\n * Get the underlying device for a handle. This function does not modify\n * the reference count of the returned device, so do not feel compelled to\n * unreference it when you are done.\n * \\param dev_handle a device handle\n * \\returns the underlying device\n */\nDEFAULT_VISIBILITY\nlibusb_device * LIBUSB_CALL libusb_get_device(libusb_device_handle *dev_handle) {\n\n\treturn dev_handle->dev;\n}\n\n/** \\ingroup dev\n * Determine the bConfigurationValue of the currently active configuration.\n *\n * You could formulate your own control request to obtain this information,\n * but this function has the advantage that it may be able to retrieve the\n * information from operating system caches (no I/O involved).\n *\n * If the OS does not cache this information, then this function will block\n * while a control transfer is submitted to retrieve the information.\n *\n * This function will return a value of 0 in the <tt>config</tt> output\n * parameter if the device is in unconfigured state.\n *\n * \\param dev a device handle\n * \\param config output location for the bConfigurationValue of the active\n * configuration (only valid for return code 0)\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failure\n */\nint API_EXPORTED libusb_get_configuration(libusb_device_handle *dev,\n\t\tint *config) {\n\tint r = LIBUSB_ERROR_NOT_SUPPORTED;\n\n\tusbi_dbg(\"\");\n\tif (usbi_backend->get_configuration)\n\t\tr = usbi_backend->get_configuration(dev, config);\n\n\tif (r == LIBUSB_ERROR_NOT_SUPPORTED) {\n\t\tuint8_t tmp = 0;\n\t\tusbi_dbg(\"falling back to control message\");\n\t\tr = libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN,\n\t\t\t\tLIBUSB_REQUEST_GET_CONFIGURATION, 0, 0, &tmp, 1, 1000);\n\t\tif (r == 0) {\n\t\t\tusbi_err(HANDLE_CTX(dev), \"zero bytes returned in ctrl transfer?\");\n\t\t\tr = LIBUSB_ERROR_IO;\n\t\t} else if (r == 1) {\n\t\t\tr = 0;\n\t\t\t*config = tmp;\n\t\t} else {\n\t\t\tusbi_dbg(\"control failed, error %d\", r);\n\t\t}\n\t}\n\n\tif (r == 0)\n\t\tusbi_dbg(\"active config %d\", *config);\n\n\treturn r;\n}\n\n/** \\ingroup dev\n * Set the active configuration for a device.\n *\n * The operating system may or may not have already set an active\n * configuration on the device. It is up to your application to ensure the\n * correct configuration is selected before you attempt to claim interfaces\n * and perform other operations.\n *\n * If you call this function on a device already configured with the selected\n * configuration, then this function will act as a lightweight device reset:\n * it will issue a SET_CONFIGURATION request using the current configuration,\n * causing most USB-related device state to be reset (altsetting reset to zero,\n * endpoint halts cleared, toggles reset).\n *\n * You cannot change/reset configuration if your application has claimed\n * interfaces. It is advised to set the desired configuration before claiming\n * interfaces.\n *\n * Alternatively you can call libusb_release_interface() first. Note if you\n * do things this way you must ensure that auto_detach_kernel_driver for\n * <tt>dev</tt> is 0, otherwise the kernel driver will be re-attached when you\n * release the interface(s).\n *\n * You cannot change/reset configuration if other applications or drivers have\n * claimed interfaces.\n *\n * A configuration value of -1 will put the device in unconfigured state.\n * The USB specifications state that a configuration value of 0 does this,\n * however buggy devices exist which actually have a configuration 0.\n *\n * You should always use this function rather than formulating your own\n * SET_CONFIGURATION control request. This is because the underlying operating\n * system needs to know when such changes happen.\n *\n * This is a blocking function.\n *\n * \\param dev a device handle\n * \\param configuration the bConfigurationValue of the configuration you\n * wish to activate, or -1 if you wish to put the device in unconfigured state\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the requested configuration does not exist\n * \\returns LIBUSB_ERROR_BUSY if interfaces are currently claimed\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failure\n * \\see libusb_set_auto_detach_kernel_driver()\n */\nint API_EXPORTED libusb_set_configuration(libusb_device_handle *dev,\n\t\tint configuration) {\n\n\tusbi_dbg(\"configuration %d\", configuration);\n\treturn usbi_backend->set_configuration(dev, configuration);\n}\n\n/** \\ingroup dev\n * Claim an interface on a given device handle. You must claim the interface\n * you wish to use before you can perform I/O on any of its endpoints.\n *\n * It is legal to attempt to claim an already-claimed interface, in which\n * case libusb just returns 0 without doing anything.\n *\n * If auto_detach_kernel_driver is set to 1 for <tt>dev</tt>, the kernel driver\n * will be detached if necessary, on failure the detach error is returned.\n *\n * Claiming of interfaces is a purely logical operation; it does not cause\n * any requests to be sent over the bus. Interface claiming is used to\n * instruct the underlying operating system that your application wishes\n * to take ownership of the interface.\n *\n * This is a non-blocking function.\n *\n * \\param dev a device handle\n * \\param interface_number the <tt>bInterfaceNumber</tt> of the interface you\n * wish to claim\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the requested interface does not exist\n * \\returns LIBUSB_ERROR_BUSY if another program or driver has claimed the\n * interface\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns a LIBUSB_ERROR code on other failure\n * \\see libusb_set_auto_detach_kernel_driver()\n */\nint API_EXPORTED libusb_claim_interface(libusb_device_handle *dev,\n\t\tint interface_number) {\n\n\tENTER();\n\n\tint r = LIBUSB_SUCCESS;\n\n\tusbi_dbg(\"interface %d\", interface_number);\n\tLOGD(\"interface %d\", interface_number);\n\n\tif (interface_number >= USB_MAXINTERFACES) {\n\t\tRETURN(LIBUSB_ERROR_INVALID_PARAM, int);\n\t}\n\n\tif (UNLIKELY(!dev->dev->attached)) {\n\t\tRETURN(LIBUSB_ERROR_NO_DEVICE, int);\n\t}\n\n\tusbi_mutex_lock(&dev->lock);\n\tif (!(dev->claimed_interfaces & (1 << interface_number))) {\n\t\tr = usbi_backend->claim_interface(dev, interface_number);\n\t\tif (r == LIBUSB_ERROR_BUSY) {\n\t\t\t// EBUSYが返ってきた時はたぶんカーネルドライバーがアタッチされているから\n\t\t\t// デタッチ要求してから再度claimしてみる\n\t\t\tLOGV(\"request detach kernel driver and retry claim interface\");\n\t\t\tr = usbi_backend->release_interface(dev, interface_number);\n\t\t\tlibusb_detach_kernel_driver(dev, interface_number);\n\t\t\tif (!r) {\n\t\t\t\tr = usbi_backend->claim_interface(dev, interface_number);\n\t\t\t}\n\t\t}\n\t\tif (!r) {\n\t\t\tdev->claimed_interfaces |= 1 << interface_number;\n\t\t}\n\t} else {\n\t\tLOGV(\"already claimed\");\n\t}\n\tusbi_mutex_unlock(&dev->lock);\n\n\tRETURN(r, int);\n}\n\n/** \\ingroup dev\n * Release an interface previously claimed with libusb_claim_interface(). You\n * should release all claimed interfaces before closing a device handle.\n *\n * This is a blocking function. A SET_INTERFACE control request will be sent\n * to the device, resetting interface state to the first alternate setting.\n *\n * If auto_detach_kernel_driver is set to 1 for <tt>dev</tt>, the kernel\n * driver will be re-attached after releasing the interface.\n *\n * \\param dev a device handle\n * \\param interface_number the <tt>bInterfaceNumber</tt> of the\n * previously-claimed interface\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the interface was not claimed\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failure\n * \\see libusb_set_auto_detach_kernel_driver()\n */\nint API_EXPORTED libusb_release_interface(libusb_device_handle *dev,\n\t\tint interface_number) {\n\n\tENTER();\n\n\tint r;\n\n\tLOGD(\"interface %d\", interface_number);\n\tusbi_dbg(\"interface %d\", interface_number);\n\tif (UNLIKELY(interface_number >= USB_MAXINTERFACES))\n\t\tRETURN(LIBUSB_ERROR_INVALID_PARAM, int);\n\n\tusbi_mutex_lock(&dev->lock);\n\t{\n\t\tif (dev->claimed_interfaces & (1 << interface_number)) {\n\t\t\tr = usbi_backend->release_interface(dev, interface_number);\n\t\t\tif (!r) {\n\t\t\t\tLOGV(\"released\");\n\t\t\t\tdev->claimed_interfaces &= ~(1 << interface_number);\n\t\t\t}\n\t\t} else {\n\t\t\t// already released\n\t\t\tr = LIBUSB_ERROR_NOT_FOUND;\n\t\t}\n\t}\n\tusbi_mutex_unlock(&dev->lock);\n\n\tRETURN(r, int);\n}\n\n/** \\ingroup dev\n * Activate an alternate setting for an interface. The interface must have\n * been previously claimed with libusb_claim_interface().\n *\n * You should always use this function rather than formulating your own\n * SET_INTERFACE control request. This is because the underlying operating\n * system needs to know when such changes happen.\n *\n * This is a blocking function.\n *\n * \\param dev a device handle\n * \\param interface_number the <tt>bInterfaceNumber</tt> of the\n * previously-claimed interface\n * \\param alternate_setting the <tt>bAlternateSetting</tt> of the alternate\n * setting to activate\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the interface was not claimed, or the\n * requested alternate setting does not exist\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failure\n */\nint API_EXPORTED libusb_set_interface_alt_setting(libusb_device_handle *dev,\n\t\tint interface_number, int alternate_setting) {\n\n\tusbi_dbg(\"interface %d altsetting %d\", interface_number, alternate_setting);\n\tif (interface_number >= USB_MAXINTERFACES)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\tusbi_mutex_lock(&dev->lock);\n\t{\n\t\tif (UNLIKELY(!dev->dev->attached)) {\n\t\t\tusbi_mutex_unlock(&dev->lock);\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t\t}\n\n\t\tif (UNLIKELY(!(dev->claimed_interfaces & (1 << interface_number)))) {\n\t\t\tusbi_mutex_unlock(&dev->lock);\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\t}\n\t}\n\tusbi_mutex_unlock(&dev->lock);\n\n\treturn usbi_backend->set_interface_altsetting(dev, interface_number,\n\t\t\talternate_setting);\n}\n\n/** \\ingroup dev\n * Clear the halt/stall condition for an endpoint. Endpoints with halt status\n * are unable to receive or transmit data until the halt condition is stalled.\n *\n * You should cancel all pending transfers before attempting to clear the halt\n * condition.\n *\n * This is a blocking function.\n *\n * \\param dev a device handle\n * \\param endpoint the endpoint to clear halt status\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failure\n */\nint API_EXPORTED libusb_clear_halt(libusb_device_handle *dev,\n\t\tunsigned char endpoint) {\n\n\tusbi_dbg(\"endpoint %x\", endpoint);\n\tif (UNLIKELY(!dev->dev->attached))\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\treturn usbi_backend->clear_halt(dev, endpoint);\n}\n\n/** \\ingroup dev\n * Perform a USB port reset to reinitialize a device. The system will attempt\n * to restore the previous configuration and alternate settings after the\n * reset has completed.\n *\n * If the reset fails, the descriptors change, or the previous state cannot be\n * restored, the device will appear to be disconnected and reconnected. This\n * means that the device handle is no longer valid (you should close it) and\n * rediscover the device. A return code of LIBUSB_ERROR_NOT_FOUND indicates\n * when this is the case.\n *\n * This is a blocking function which usually incurs a noticeable delay.\n *\n * \\param dev a handle of the device to reset\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if re-enumeration is required, or if the\n * device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failure\n */\nint API_EXPORTED libusb_reset_device(libusb_device_handle *dev) {\n\n\tusbi_dbg(\"\");\n\tif (UNLIKELY(!dev->dev->attached))\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\treturn usbi_backend->reset_device(dev);\n}\n\n/** \\ingroup asyncio\n * Allocate up to num_streams usb bulk streams on the specified endpoints. This\n * function takes an array of endpoints rather then a single endpoint because\n * some protocols require that endpoints are setup with similar stream ids.\n * All endpoints passed in must belong to the same interface.\n *\n * Note this function may return less streams then requested. Also note that the\n * same number of streams are allocated for each endpoint in the endpoint array.\n *\n * Stream id 0 is reserved, and should not be used to communicate with devices.\n * If libusb_alloc_streams() returns with a value of N, you may use stream ids\n * 1 to N.\n *\n * Since version 1.0.19, \\ref LIBUSB_API_VERSION >= 0x01000103\n *\n * \\param dev a device handle\n * \\param num_streams number of streams to try to allocate\n * \\param endpoints array of endpoints to allocate streams on\n * \\param num_endpoints length of the endpoints array\n * \\returns number of streams allocated, or a LIBUSB_ERROR code on failure\n */\nint API_EXPORTED libusb_alloc_streams(libusb_device_handle *dev,\n\tuint32_t num_streams, unsigned char *endpoints, int num_endpoints)\n{\n\tusbi_dbg(\"streams %u eps %d\", (unsigned) num_streams, num_endpoints);\n\n\tif UNLIKELY(!dev->dev->attached)\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\tif LIKELY(usbi_backend->alloc_streams)\n\t\treturn usbi_backend->alloc_streams(dev, num_streams, endpoints,\n\t\t\t\t\t\t   num_endpoints);\n\telse\n\t\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n}\n\n/** \\ingroup asyncio\n * Free usb bulk streams allocated with libusb_alloc_streams().\n *\n * Note streams are automatically free-ed when releasing an interface.\n *\n * Since version 1.0.19, \\ref LIBUSB_API_VERSION >= 0x01000103\n *\n * \\param dev a device handle\n * \\param endpoints array of endpoints to free streams on\n * \\param num_endpoints length of the endpoints array\n * \\returns LIBUSB_SUCCESS, or a LIBUSB_ERROR code on failure\n */\nint API_EXPORTED libusb_free_streams(libusb_device_handle *dev,\n\tunsigned char *endpoints, int num_endpoints)\n{\n\tENTER();\n\n\tLOGD(\"eps %d\", num_endpoints);\n\tusbi_dbg(\"eps %d\", num_endpoints);\n\n\tif UNLIKELY(!dev->dev->attached) {\n\t\tRETURN(LIBUSB_ERROR_NO_DEVICE, int);\n\t}\n\n\tif LIKELY(usbi_backend->free_streams) {\n\t\tRETURN(usbi_backend->free_streams(dev, endpoints, num_endpoints), int);\n\t} else {\n\t\tRETURN(LIBUSB_ERROR_NOT_SUPPORTED, int);\n\t}\n}\n\n/** \\ingroup dev\n * Determine if a kernel driver is active on an interface. If a kernel driver\n * is active, you cannot claim the interface, and libusb will be unable to\n * perform I/O.\n *\n * This functionality is not available on Windows.\n *\n * \\param dev a device handle\n * \\param interface_number the interface to check\n * \\returns 0 if no kernel driver is active\n * \\returns 1 if a kernel driver is active\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality\n * is not available\n * \\returns another LIBUSB_ERROR code on other failure\n * \\see libusb_detach_kernel_driver()\n */\nint API_EXPORTED libusb_kernel_driver_active(libusb_device_handle *dev,\n\t\tint interface_number) {\n\n\tENTER();\n\n\tLOGD(\"interface %d\", interface_number);\n\tusbi_dbg(\"interface %d\", interface_number);\n\n\tif (UNLIKELY(!dev->dev->attached)) {\n\t\tRETURN(LIBUSB_ERROR_NO_DEVICE, int);\n\t}\n\n\tif LIKELY(usbi_backend->kernel_driver_active) {\n\t\tRETURN(usbi_backend->kernel_driver_active(dev, interface_number), int);\n\t} else {\n\t\tRETURN(LIBUSB_ERROR_NOT_SUPPORTED, int);\n\t}\n}\n\n/** \\ingroup dev\n * Detach a kernel driver from an interface. If successful, you will then be\n * able to claim the interface and perform I/O.\n *\n * This functionality is not available on Darwin or Windows.\n *\n * Note that libusb itself also talks to the device through a special kernel\n * driver, if this driver is already attached to the device, this call will\n * not detach it and return LIBUSB_ERROR_NOT_FOUND.\n *\n * \\param dev a device handle\n * \\param interface_number the interface to detach the driver from\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if no kernel driver was active\n * \\returns LIBUSB_ERROR_INVALID_PARAM if the interface does not exist\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality\n * is not available\n * \\returns another LIBUSB_ERROR code on other failure\n * \\see libusb_kernel_driver_active()\n */\nint API_EXPORTED libusb_detach_kernel_driver(libusb_device_handle *dev,\n\t\tint interface_number) {\n\n\tusbi_dbg(\"interface %d\", interface_number);\n\n\tif (UNLIKELY(!dev->dev->attached))\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\tif (LIKELY(usbi_backend->detach_kernel_driver))\n\t\treturn usbi_backend->detach_kernel_driver(dev, interface_number);\n\telse\n\t\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n}\n\n/** \\ingroup dev\n * Re-attach an interface's kernel driver, which was previously detached\n * using libusb_detach_kernel_driver(). This call is only effective on\n * Linux and returns LIBUSB_ERROR_NOT_SUPPORTED on all other platforms.\n *\n * This functionality is not available on Darwin or Windows.\n *\n * \\param dev a device handle\n * \\param interface_number the interface to attach the driver from\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if no kernel driver was active\n * \\returns LIBUSB_ERROR_INVALID_PARAM if the interface does not exist\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality\n * is not available\n * \\returns LIBUSB_ERROR_BUSY if the driver cannot be attached because the\n * interface is claimed by a program or driver\n * \\returns another LIBUSB_ERROR code on other failure\n * \\see libusb_kernel_driver_active()\n */\nint API_EXPORTED libusb_attach_kernel_driver(libusb_device_handle *dev,\n\t\tint interface_number) {\n\n\tENTER();\n\n\tLOGD(\"interface %d\", interface_number);\n\tusbi_dbg(\"interface %d\", interface_number);\n\n\tif (UNLIKELY(!dev->dev->attached)) {\n\t\tRETURN(LIBUSB_ERROR_NO_DEVICE, int);\n\t}\n\n\tif (LIKELY(usbi_backend->attach_kernel_driver)) {\n\t\tRETURN(usbi_backend->attach_kernel_driver(dev, interface_number), int);\n\t} else {\n\t\tRETURN(LIBUSB_ERROR_NOT_SUPPORTED, int);\n\t}\n}\n\n/** \\ingroup dev\n * Enable/disable libusb's automatic kernel driver detachment. When this is\n * enabled libusb will automatically detach the kernel driver on an interface\n * when claiming the interface, and attach it when releasing the interface.\n *\n * Automatic kernel driver detachment is disabled on newly opened device\n * handles by default.\n *\n * On platforms which do not have LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER\n * this function will return LIBUSB_ERROR_NOT_SUPPORTED, and libusb will\n * continue as if this function was never called.\n *\n * \\param dev a device handle\n * \\param enable whether to enable or disable auto kernel driver detachment\n *\n * \\returns LIBUSB_SUCCESS on success\n * \\returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality\n * is not available\n * \\see libusb_claim_interface()\n * \\see libusb_release_interface()\n * \\see libusb_set_configuration()\n */\nint API_EXPORTED libusb_set_auto_detach_kernel_driver(libusb_device_handle *dev,\n\t\tint enable) {\n\n\tENTER();\n\n\tLOGD(\"enable=%d\", enable);\n\tif (!(usbi_backend->caps & USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER)) {\n\t\tLOGD(\"does not support detach kernel driver\");\n\t\tRETURN(LIBUSB_ERROR_NOT_SUPPORTED, int);\n\t}\n\n\tdev->auto_detach_kernel_driver = enable;\n\tRETURN(LIBUSB_SUCCESS, int);\n}\n\n/** \\ingroup lib\n * Set log message verbosity.\n *\n * The default level is LIBUSB_LOG_LEVEL_NONE, which means no messages are ever\n * printed. If you choose to increase the message verbosity level, ensure\n * that your application does not close the stdout/stderr file descriptors.\n *\n * You are advised to use level LIBUSB_LOG_LEVEL_WARNING. libusb is conservative\n * with its message logging and most of the time, will only log messages that\n * explain error conditions and other oddities. This will help you debug\n * your software.\n *\n * If the LIBUSB_DEBUG environment variable was set when libusb was\n * initialized, this function does nothing: the message verbosity is fixed\n * to the value in the environment variable.\n *\n * If libusb was compiled without any message logging, this function does\n * nothing: you'll never get any messages.\n *\n * If libusb was compiled with verbose debug message logging, this function\n * does nothing: you'll always get messages from all levels.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param level debug level to set\n */\nvoid API_EXPORTED libusb_set_debug(libusb_context *ctx, int level) {\n\n\tUSBI_GET_CONTEXT(ctx);\n\tif (!ctx->debug_fixed)\n\t\tctx->debug = level;\n}\n\nint API_EXPORTED libusb_init2(libusb_context **context, const char *usbfs) {\n\tENTER();\n\tstruct libusb_device *dev, *next;\n\tchar *dbg = getenv(\"LIBUSB_DEBUG\");\n\tstruct libusb_context *ctx;\n\tstatic int first_init = 1;\n\tint r = 0;\n\n\tusbi_mutex_static_lock(&default_context_lock);\n\t{\n\t\tif (!timestamp_origin.tv_sec) {\n\t\t\tusbi_gettimeofday(&timestamp_origin, NULL);\n\t\t}\n\n\t\tif (!context && usbi_default_context) {\n\t\t\tusbi_dbg(\"reusing default context\");\n\t\t\tLOGI(\"reusing default context\");\n\t\t\tdefault_context_refcnt++;\n\t\t\tusbi_mutex_static_unlock(&default_context_lock);\n\t\t\treturn LIBUSB_SUCCESS;\n\t\t}\n\n\t\tctx = calloc(1, sizeof(*ctx));\n\t\tif (UNLIKELY(!ctx)) {\n\t\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\t\tgoto err_unlock;\n\t\t}\n\n#ifdef ENABLE_DEBUG_LOGGING\n\t\tctx->debug = LIBUSB_LOG_LEVEL_DEBUG;\n#endif\n\n\t\tif (UNLIKELY(dbg)) {\n\t\t\tctx->debug = atoi(dbg);\n\t\t\tif (ctx->debug)\n\t\t\t\tctx->debug_fixed = 1;\n\t\t}\n\n\t\t/* default context should be initialized before calling usbi_dbg */\n\t\tif (!usbi_default_context) {\n\t\t\tusbi_default_context = ctx;\n\t\t\tdefault_context_refcnt++;\n\t\t\tusbi_dbg(\"created default context\");\n\t\t}\n\n\t\tLOGI(\"libusb v%d.%d.%d.%d\", libusb_version_internal.major, libusb_version_internal.minor,\n\t\t\tlibusb_version_internal.micro, libusb_version_internal.nano);\n\n\t\tusbi_dbg(\"libusb v%d.%d.%d.%d\", libusb_version_internal.major, libusb_version_internal.minor,\n\t\t\tlibusb_version_internal.micro, libusb_version_internal.nano);\n\n\t\tusbi_mutex_init(&ctx->usb_devs_lock, NULL);\n\t\tusbi_mutex_init(&ctx->open_devs_lock, NULL);\n\t\tusbi_mutex_init(&ctx->hotplug_cbs_lock, NULL);\n\t\tlist_init(&ctx->usb_devs);\n\t\tlist_init(&ctx->open_devs);\n\t\tlist_init(&ctx->hotplug_cbs);\n\n\t\tusbi_mutex_static_lock(&active_contexts_lock);\n\t\t{\n\t\t\tif (first_init) {\n\t\t\t\tfirst_init = 0;\n\t\t\t\tlist_init(&active_contexts_list);\n\t\t\t}\n\t\t\tlist_add(&ctx->list, &active_contexts_list);\n\t\t}\n\t\tusbi_mutex_static_unlock(&active_contexts_lock);\n\n\t\tif (LIKELY(usbfs && strlen(usbfs) > 0)) {\n\t\t\tLOGD(\"call usbi_backend->init2\");\n\t\t\tif (usbi_backend->init2) {\n\t\t\t\tr = usbi_backend->init2(ctx, usbfs);\n\t\t\t\tif (UNLIKELY(r)) {\n\t\t\t\t\tLOGE(\"failed to call usbi_backend->init2, err=%d\", r);\n\t\t\t\t\tgoto err_free_ctx;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tLOGE(\"has no usbi_backend->init2\");\n\t\t\t\tgoto err_free_ctx;\n\t\t\t}\n\t\t} else {\n\t\t\tLOGD(\"call usbi_backend->init\");\n\t\t\tif (usbi_backend->init) {\n\t\t\t\tr = usbi_backend->init(ctx);\n\t\t\t\tif (UNLIKELY(r))\n\t\t\t\t\tgoto err_free_ctx;\n\t\t\t} else\n\t\t\t\tgoto err_free_ctx;\n\t\t}\n\n\t\tr = usbi_io_init(ctx);\n\t\tif (UNLIKELY(r < 0))\n\t\t\tgoto err_backend_exit;\n\t}\n\tusbi_mutex_static_unlock(&default_context_lock);\n\n\tif (context)\n\t\t*context = ctx;\n\n\tRETURN(LIBUSB_SUCCESS, int);\n\nerr_backend_exit:\n\tLOGI(\"err_backend_exit\");\n\tif (usbi_backend->exit)\n\t\tusbi_backend->exit();\nerr_free_ctx:\n\tLOGI(\"err_free_ctx\");\n\tif (ctx == usbi_default_context)\n\t\tusbi_default_context = NULL;\n\n\tusbi_mutex_static_lock(&active_contexts_lock);\n\t{\n\t\tlist_del(&ctx->list);\n\t}\n\tusbi_mutex_static_unlock(&active_contexts_lock);\n\n\tusbi_mutex_lock(&ctx->usb_devs_lock);\n\t{\n\t\tlist_for_each_entry_safe(dev, next, &ctx->usb_devs, list, struct libusb_device)\n\t\t{\n\t\t\tlist_del(&dev->list);\n\t\t\tlibusb_unref_device(dev);\n\t\t}\n\t}\n\tusbi_mutex_unlock(&ctx->usb_devs_lock);\n\n\tusbi_mutex_destroy(&ctx->open_devs_lock);\n\tusbi_mutex_destroy(&ctx->usb_devs_lock);\n\tusbi_mutex_destroy(&ctx->hotplug_cbs_lock);\n\n\tfree(ctx);\nerr_unlock:\n\tLOGI(\"err_unlock\");\n\tusbi_mutex_static_unlock(&default_context_lock);\n\tRETURN(r, int);\n}\n\n/** \\ingroup lib\n * Initialize libusb. This function must be called before calling any other\n * libusb function.\n *\n * If you do not provide an output location for a context pointer, a default\n * context will be created. If there was already a default context, it will\n * be reused (and nothing will be initialized/reinitialized).\n *\n * \\param context Optional output location for context pointer.\n * Only valid on return code 0.\n * \\returns 0 on success, or a LIBUSB_ERROR code on failure\n * \\see contexts\n */\nint API_EXPORTED libusb_init(libusb_context **context) {\n\n\treturn libusb_init2(context, NULL);\n#if 0\n\tstruct libusb_device *dev, *next;\n\tchar *dbg = getenv(\"LIBUSB_DEBUG\");\n\tstruct libusb_context *ctx;\n\tstatic int first_init = 1;\n\tint r = 0;\n\n\tusbi_mutex_static_lock(&default_context_lock);\n\t{\n\t\tif (!timestamp_origin.tv_sec) {\n\t\t\tusbi_gettimeofday(&timestamp_origin, NULL);\n\t\t}\n\n\t\tif (!context && usbi_default_context) {\n\t\t\tusbi_dbg(\"reusing default context\");\n\t\t\tdefault_context_refcnt++;\n\t\t\tusbi_mutex_static_unlock(&default_context_lock);\n\t\t\treturn LIBUSB_SUCCESS;\n\t\t}\n\n\t\tctx = calloc(1, sizeof(*ctx));\n\t\tif (UNLIKELY(!ctx)) {\n\t\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\t\tgoto err_unlock;\n\t\t}\n\n#ifdef ENABLE_DEBUG_LOGGING\n\t\tctx->debug = LIBUSB_LOG_LEVEL_DEBUG;\n#endif\n\n\t\tif (UNLIKELY(dbg)) {\n\t\t\tctx->debug = atoi(dbg);\n\t\t\tif (ctx->debug)\n\t\t\t\tctx->debug_fixed = 1;\n\t\t}\n\n\t\t/* default context should be initialized before calling usbi_dbg */\n\t\tif (!usbi_default_context) {\n\t\t\tusbi_default_context = ctx;\n\t\t\tdefault_context_refcnt++;\n\t\t\tusbi_dbg(\"created default context\");\n\t\t}\n\n\t\tusbi_dbg(\"libusb v%d.%d.%d.%d\", libusb_version_internal.major, libusb_version_internal.minor,\n\t\t\tlibusb_version_internal.micro, libusb_version_internal.nano);\n\n\t\tusbi_mutex_init(&ctx->usb_devs_lock, NULL);\n\t\tusbi_mutex_init(&ctx->open_devs_lock, NULL);\n\t\tusbi_mutex_init(&ctx->hotplug_cbs_lock, NULL);\n\t\tlist_init(&ctx->usb_devs);\n\t\tlist_init(&ctx->open_devs);\n\t\tlist_init(&ctx->hotplug_cbs);\n\n\t\tusbi_mutex_static_lock(&active_contexts_lock);\n\t\t{\n\t\t\tif (first_init) {\n\t\t\t\tfirst_init = 0;\n\t\t\t\tlist_init(&active_contexts_list);\n\t\t\t}\n\t\t\tlist_add(&ctx->list, &active_contexts_list);\n\t\t}\n\t\tusbi_mutex_static_unlock(&active_contexts_lock);\n\n\t\tif (usbi_backend->init) {\n\t\t\tr = usbi_backend->init(ctx);\n\t\t\tif (UNLIKELY(r))\n\t\t\t\tgoto err_free_ctx;\n\t\t}\n\n\t\tr = usbi_io_init(ctx);\n\t\tif (UNLIKELY(r < 0))\n\t\t\tgoto err_backend_exit;\n\t}\n\tusbi_mutex_static_unlock(&default_context_lock);\n\n\tif (context)\n\t\t*context = ctx;\n\n\treturn LIBUSB_SUCCESS;\n\nerr_backend_exit:\n\tif (usbi_backend->exit)\n\t\tusbi_backend->exit();\nerr_free_ctx:\n\tif (ctx == usbi_default_context)\n\t\tusbi_default_context = NULL;\n\n\tusbi_mutex_static_lock(&active_contexts_lock);\n\t{\n\t\tlist_del(&ctx->list);\n\t}\n\tusbi_mutex_static_unlock(&active_contexts_lock);\n\n\tusbi_mutex_lock(&ctx->usb_devs_lock);\n\t{\n\t\tlist_for_each_entry_safe(dev, next, &ctx->usb_devs, list, struct libusb_device)\n\t\t{\n\t\t\tlist_del(&dev->list);\n\t\t\tlibusb_unref_device(dev);\n\t\t}\n\t}\n\tusbi_mutex_unlock(&ctx->usb_devs_lock);\n\n\tusbi_mutex_destroy(&ctx->open_devs_lock);\n\tusbi_mutex_destroy(&ctx->usb_devs_lock);\n\tusbi_mutex_destroy(&ctx->hotplug_cbs_lock);\n\n\tfree(ctx);\nerr_unlock:\n\tusbi_mutex_static_unlock(&default_context_lock);\n\treturn r;\n#endif\n}\n\n/** \\ingroup lib\n * Deinitialize libusb. Should be called after closing all open devices and\n * before your application terminates.\n * \\param ctx the context to deinitialize, or NULL for the default context\n */\nvoid API_EXPORTED libusb_exit(struct libusb_context *ctx) {\n\n\tstruct libusb_device *dev, *next;\n\tstruct timeval tv = { 0, 0 };\n\n\tusbi_dbg(\"\");\n\tUSBI_GET_CONTEXT(ctx);\n\n\t/* if working with default context, only actually do the deinitialization\n\t * if we're the last user */\n\tusbi_mutex_static_lock(&default_context_lock);\n\tif (ctx == usbi_default_context) {\n\t\tif (--default_context_refcnt > 0) {\n\t\t\tusbi_dbg(\"not destroying default context\");\n\t\t\tusbi_mutex_static_unlock(&default_context_lock);\n\t\t\treturn;\n\t\t}\n\t\tusbi_dbg(\"destroying default context\");\n\t\tusbi_default_context = NULL;\n\t}\n\tusbi_mutex_static_unlock(&default_context_lock);\n\n\tusbi_mutex_static_lock(&active_contexts_lock);\n\t{\n\t\tlist_del(&ctx->list);\n\t}\n\tusbi_mutex_static_unlock(&active_contexts_lock);\n\n\tif (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {\n\t\tusbi_hotplug_deregister_all(ctx);\n\n\t\t/*\n\t\t * Ensure any pending unplug events are read from the hotplug\n\t\t * pipe. The usb_device-s hold in the events are no longer part\n\t\t * of usb_devs, but the events still hold a reference!\n\t\t *\n\t\t * Note we don't do this if the application has left devices\n\t\t * open (which implies a buggy app) to avoid packet completion\n\t\t * handlers running when the app does not expect them to run.\n\t\t */\n\t\tif (list_empty(&ctx->open_devs))\n\t\t\tlibusb_handle_events_timeout(ctx, &tv);\n\n\t\tusbi_mutex_lock(&ctx->usb_devs_lock);\n\t\t{\n\t\t\tlist_for_each_entry_safe(dev, next, &ctx->usb_devs, list, struct libusb_device)\n\t\t\t{\n\t\t\t\tlist_del(&dev->list);\n\t\t\t\tlibusb_unref_device(dev);\n\t\t\t}\n\t\t}\n\t\tusbi_mutex_unlock(&ctx->usb_devs_lock);\n\t}\n\n\t/* a few sanity checks. don't bother with locking because unless\n\t * there is an application bug, nobody will be accessing these. */\n\tif (!list_empty(&ctx->usb_devs))\n\t\tusbi_warn(ctx, \"some libusb_devices were leaked\");\n\tif (!list_empty(&ctx->open_devs))\n\t\tusbi_warn(ctx, \"application left some devices open\");\n\n\tusbi_io_exit(ctx);\n\tif (usbi_backend->exit)\n\t\tusbi_backend->exit();\n\n\tusbi_mutex_destroy(&ctx->open_devs_lock);\n\tusbi_mutex_destroy(&ctx->usb_devs_lock);\n\tusbi_mutex_destroy(&ctx->hotplug_cbs_lock);\n\tfree(ctx);\n}\n\n/** \\ingroup misc\n * Check at runtime if the loaded library has a given capability.\n * This call should be performed after \\ref libusb_init(), to ensure the\n * backend has updated its capability set.\n *\n * \\param capability the \\ref libusb_capability to check for\n * \\returns nonzero if the running library has the capability, 0 otherwise\n */\nint API_EXPORTED libusb_has_capability(uint32_t capability) {\n\n\tswitch (capability) {\n\tcase LIBUSB_CAP_HAS_CAPABILITY:\n\t\treturn 1;\n\tcase LIBUSB_CAP_HAS_HOTPLUG:\n\t\treturn !(usbi_backend->get_device_list);\n\tcase LIBUSB_CAP_HAS_HID_ACCESS:\n\t\treturn (usbi_backend->caps & USBI_CAP_HAS_HID_ACCESS);\n\tcase LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER:\n\t\treturn (usbi_backend->caps & USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER);\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\n/* this is defined in libusbi.h if needed */\n#ifdef LIBUSB_GETTIMEOFDAY_WIN32\n/*\n * gettimeofday\n * Implementation according to:\n * The Open Group Base Specifications Issue 6\n * IEEE Std 1003.1, 2004 Edition\n */\n\n/*\n *  THIS SOFTWARE IS NOT COPYRIGHTED\n *\n *  This source code is offered for use in the public domain. You may\n *  use, modify or distribute it freely.\n *\n *  This code is distributed in the hope that it will be useful but\n *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY\n *  DISCLAIMED. This includes but is not limited to warranties of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n *\n *  Contributed by:\n *  Danny Smith <dannysmith@users.sourceforge.net>\n */\n\n/* Offset between 1/1/1601 and 1/1/1970 in 100 nanosec units */\n#define _W32_FT_OFFSET (116444736000000000)\n\nint usbi_gettimeofday(struct timeval *tp, void *tzp)\n{\n\tunion {\n\t\tunsigned __int64 ns100; /* Time since 1 Jan 1601, in 100ns units */\n\t\tFILETIME ft;\n\t} _now;\n\tUNUSED(tzp);\n\n\tif(tp) {\n#if defined(OS_WINCE)\n\t\tSYSTEMTIME st;\n\t\tGetSystemTime(&st);\n\t\tSystemTimeToFileTime(&st, &_now.ft);\n#else\n\t\tGetSystemTimeAsFileTime (&_now.ft);\n#endif\n\t\ttp->tv_usec=(long)((_now.ns100 / 10) % 1000000 );\n\t\ttp->tv_sec= (long)((_now.ns100 - _W32_FT_OFFSET) / 10000000);\n\t}\n\t/* Always return 0 as per Open Group Base Specifications Issue 6.\n\t Do not set errno on error.  */\n\treturn LIBUSB_SUCCESS;\n}\n#endif\n\nstatic void usbi_log_str(struct libusb_context *ctx,\n\tenum libusb_log_level level, const char * str) {\n\n#if defined(USE_SYSTEM_LOGGING_FACILITY)\n#if defined(OS_WINDOWS) || defined(OS_WINCE)\n\t/* Windows CE only supports the Unicode version of OutputDebugString. */\n\tWCHAR wbuf[USBI_MAX_LOG_LEN];\n\tMultiByteToWideChar(CP_UTF8, 0, str, -1, wbuf, sizeof(wbuf));\n\tOutputDebugStringW(wbuf);\n#elif defined(__ANDROID__)\n\tint priority = ANDROID_LOG_UNKNOWN;\n\tswitch (level) {\n\tcase LIBUSB_LOG_LEVEL_NONE: break;\t// XXX add to avoid warning when compiling with clang\n\tcase LIBUSB_LOG_LEVEL_INFO: priority = ANDROID_LOG_INFO; break;\n\tcase LIBUSB_LOG_LEVEL_WARNING: priority = ANDROID_LOG_WARN; break;\n\tcase LIBUSB_LOG_LEVEL_ERROR: priority = ANDROID_LOG_ERROR; break;\n\tcase LIBUSB_LOG_LEVEL_DEBUG: priority = ANDROID_LOG_DEBUG; break;\n\t}\n\t__android_log_write(priority, \"libusb\", str);\n#elif defined(HAVE_SYSLOG_FUNC)\n\tint syslog_level = LOG_INFO;\n\tswitch (level) {\n\tcase LIBUSB_LOG_LEVEL_INFO: syslog_level = LOG_INFO; break;\n\tcase LIBUSB_LOG_LEVEL_WARNING: syslog_level = LOG_WARNING; break;\n\tcase LIBUSB_LOG_LEVEL_ERROR: syslog_level = LOG_ERR; break;\n\tcase LIBUSB_LOG_LEVEL_DEBUG: syslog_level = LOG_DEBUG; break;\n\t}\n\tsyslog(syslog_level, \"%s\", str);\n#else /* All of gcc, Clang, XCode seem to use #warning */\n#warning System logging is not supported on this platform. Logging to stderr will be used instead.\n\tfputs(str, stderr);\n#endif\n#else\n\tfputs(str, stderr);\n#endif /* USE_SYSTEM_LOGGING_FACILITY */\n\tUNUSED(ctx);\n\tUNUSED(level);\n}\n\nvoid usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level,\n\tconst char *function, const char *format, va_list args) {\n\n#ifndef __ANDROID__\n\tconst char *prefix = \"\";\n#endif\n\tchar buf[USBI_MAX_LOG_LEN];\n\tstruct timeval now;\n\tint global_debug, header_len, text_len;\n\tstatic int has_debug_header_been_displayed = 0;\n\n#ifdef ENABLE_DEBUG_LOGGING\n\tglobal_debug = 1;\n\tUNUSED(ctx);\n#else\n\tint ctx_level = 0;\n\n\tUSBI_GET_CONTEXT(ctx);\n\tif (ctx) {\n\t\tctx_level = ctx->debug;\n\t} else {\n\t\tchar *dbg = getenv(\"LIBUSB_DEBUG\");\n\t\tif (dbg)\n\t\t\tctx_level = atoi(dbg);\n\t}\n#ifdef __ANDROID__\n\tglobal_debug = 0;\n#else\n\tglobal_debug = (ctx_level == LIBUSB_LOG_LEVEL_DEBUG);\n#endif\n\tif (!ctx_level)\n\t\treturn;\n\tif (level == LIBUSB_LOG_LEVEL_WARNING && ctx_level < LIBUSB_LOG_LEVEL_WARNING)\n\t\treturn;\n\tif (level == LIBUSB_LOG_LEVEL_INFO && ctx_level < LIBUSB_LOG_LEVEL_INFO)\n\t\treturn;\n\tif (level == LIBUSB_LOG_LEVEL_DEBUG && ctx_level < LIBUSB_LOG_LEVEL_DEBUG)\n\t\treturn;\n#endif\n\n\tusbi_gettimeofday(&now, NULL);\n\tif ((global_debug) && (!has_debug_header_been_displayed)) {\n\t\thas_debug_header_been_displayed = 1;\n\t\tusbi_log_str(ctx, LIBUSB_LOG_LEVEL_DEBUG, \"[timestamp] [threadID] facility level [function call] <message>\\n\");\n\t\tusbi_log_str(ctx, LIBUSB_LOG_LEVEL_DEBUG, \"--------------------------------------------------------------------------------\\n\");\n\t}\n\tif (now.tv_usec < timestamp_origin.tv_usec) {\n\t\tnow.tv_sec--;\n\t\tnow.tv_usec += 1000000;\n\t}\n\tnow.tv_sec -= timestamp_origin.tv_sec;\n\tnow.tv_usec -= timestamp_origin.tv_usec;\n#ifndef __ANDROID__\n\tswitch (level) {\n\tcase LIBUSB_LOG_LEVEL_INFO:\n\t\tprefix = \"info\";\n\t\tbreak;\n\tcase LIBUSB_LOG_LEVEL_WARNING:\n\t\tprefix = \"warning\";\n\t\tbreak;\n\tcase LIBUSB_LOG_LEVEL_ERROR:\n\t\tprefix = \"error\";\n\t\tbreak;\n\tcase LIBUSB_LOG_LEVEL_DEBUG:\n\t\tprefix = \"debug\";\n\t\tbreak;\n\tcase LIBUSB_LOG_LEVEL_NONE:\n\t\treturn;\n\tdefault:\n\t\tprefix = \"unknown\";\n\t\tbreak;\n\t}\n#endif\n#ifdef __ANDROID__\n\theader_len = snprintf(buf, sizeof(buf), \"[%s] \", function);\n#else\n\tif (global_debug) {\n\t\theader_len = snprintf(buf, sizeof(buf),\n\t\t\t\"[%2d.%06d] [%08x] libusb: %s [%s] \", (int) now.tv_sec,\n\t\t\t(int) now.tv_usec, usbi_get_tid(), prefix, function);\n\t} else {\n\t\theader_len = snprintf(buf, sizeof(buf),\n\t\t\t\"libusb:%s [%s] \", prefix, function);\n\t}\n#endif\n\n\tif (header_len < 0 || header_len >= sizeof(buf)) {\n\t\t/* Somehow snprintf failed to write to the buffer,\n\t\t * remove the header so something useful is output. */\n\t\theader_len = 0;\n\t}\n\t/* Make sure buffer is NUL terminated */\n\tbuf[header_len] = '\\0';\n\ttext_len = vsnprintf(buf + header_len, sizeof(buf) - header_len, format, args);\n\tif (text_len < 0 || text_len + header_len >= sizeof(buf)) {\n\t\t/* Truncated log output. On some platforms a -1 return value means\n\t\t * that the output was truncated. */\n\t\ttext_len = sizeof(buf) - header_len;\n\t}\n\tif (header_len + text_len + sizeof(USBI_LOG_LINE_END) >= sizeof(buf)) {\n\t\t/* Need to truncate the text slightly to fit on the terminator. */\n\t\ttext_len -= (header_len + text_len + sizeof(USBI_LOG_LINE_END)) - sizeof(buf);\n\t}\n\tstrcpy(buf + header_len + text_len, USBI_LOG_LINE_END);\n\n\tusbi_log_str(ctx, level, buf);\n}\n\nvoid usbi_log(struct libusb_context *ctx, enum libusb_log_level level,\n\tconst char *function, const char *format, ...) {\n\n\tva_list args;\n\n\tva_start(args, format);\n\tusbi_log_v(ctx, level, function, format, args);\n\tva_end(args);\n}\n\n/** \\ingroup misc\n * Returns a constant NULL-terminated string with the ASCII name of a libusb\n * error or transfer status code. The caller must not free() the returned\n * string.\n *\n * \\param error_code The \\ref libusb_error or libusb_transfer_status code to\n * return the name of.\n * \\returns The error name, or the string **UNKNOWN** if the value of\n * error_code is not a known error / status code.\n */\nDEFAULT_VISIBILITY const char * LIBUSB_CALL libusb_error_name(int error_code) {\n\n\tswitch (error_code) {\n\tcase LIBUSB_ERROR_IO:\n\t\treturn \"LIBUSB_ERROR_IO\";\n\tcase LIBUSB_ERROR_INVALID_PARAM:\n\t\treturn \"LIBUSB_ERROR_INVALID_PARAM\";\n\tcase LIBUSB_ERROR_ACCESS:\n\t\treturn \"LIBUSB_ERROR_ACCESS\";\n\tcase LIBUSB_ERROR_NO_DEVICE:\n\t\treturn \"LIBUSB_ERROR_NO_DEVICE\";\n\tcase LIBUSB_ERROR_NOT_FOUND:\n\t\treturn \"LIBUSB_ERROR_NOT_FOUND\";\n\tcase LIBUSB_ERROR_BUSY:\n\t\treturn \"LIBUSB_ERROR_BUSY\";\n\tcase LIBUSB_ERROR_TIMEOUT:\n\t\treturn \"LIBUSB_ERROR_TIMEOUT\";\n\tcase LIBUSB_ERROR_OVERFLOW:\n\t\treturn \"LIBUSB_ERROR_OVERFLOW\";\n\tcase LIBUSB_ERROR_PIPE:\n\t\treturn \"LIBUSB_ERROR_PIPE\";\n\tcase LIBUSB_ERROR_INTERRUPTED:\n\t\treturn \"LIBUSB_ERROR_INTERRUPTED\";\n\tcase LIBUSB_ERROR_NO_MEM:\n\t\treturn \"LIBUSB_ERROR_NO_MEM\";\n\tcase LIBUSB_ERROR_NOT_SUPPORTED:\n\t\treturn \"LIBUSB_ERROR_NOT_SUPPORTED\";\n\tcase LIBUSB_ERROR_OTHER:\n\t\treturn \"LIBUSB_ERROR_OTHER\";\n\n\tcase LIBUSB_TRANSFER_ERROR:\n\t\treturn \"LIBUSB_TRANSFER_ERROR\";\n\tcase LIBUSB_TRANSFER_TIMED_OUT:\n\t\treturn \"LIBUSB_TRANSFER_TIMED_OUT\";\n\tcase LIBUSB_TRANSFER_CANCELLED:\n\t\treturn \"LIBUSB_TRANSFER_CANCELLED\";\n\tcase LIBUSB_TRANSFER_STALL:\n\t\treturn \"LIBUSB_TRANSFER_STALL\";\n\tcase LIBUSB_TRANSFER_NO_DEVICE:\n\t\treturn \"LIBUSB_TRANSFER_NO_DEVICE\";\n\tcase LIBUSB_TRANSFER_OVERFLOW:\n\t\treturn \"LIBUSB_TRANSFER_OVERFLOW\";\n\n\tcase 0:\n\t\treturn \"LIBUSB_SUCCESS / LIBUSB_TRANSFER_COMPLETED\";\n\tdefault:\n\t\treturn \"**UNKNOWN**\";\n\t}\n}\n\n/** \\ingroup misc\n * Returns a pointer to const struct libusb_version with the version\n * (major, minor, micro, nano and rc) of the running library.\n */\nDEFAULT_VISIBILITY\nconst struct libusb_version * LIBUSB_CALL libusb_get_version(void) {\n\n\treturn &libusb_version_internal;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/core_original.c",
    "content": "/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */\n/*\n * Core functions for libusb\n * Copyright © 2012-2013 Nathan Hjelm <hjelmn@cs.unm.edu>\n * Copyright © 2007-2008 Daniel Drake <dsd@gentoo.org>\n * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"config.h\"\n\n#include <errno.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#ifdef HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n#ifdef HAVE_SYS_TIME_H\n#include <sys/time.h>\n#endif\n#ifdef HAVE_SYSLOG_H\n#include <syslog.h>\n#endif\n\n#ifdef __ANDROID__\n#include <android/log.h>\n#endif\n\n#include \"libusbi.h\"\n#include \"hotplug.h\"\n\n#if defined(OS_LINUX)\nconst struct usbi_os_backend * const usbi_backend = &linux_usbfs_backend;\n#elif defined(OS_DARWIN)\nconst struct usbi_os_backend * const usbi_backend = &darwin_backend;\n#elif defined(OS_OPENBSD)\nconst struct usbi_os_backend * const usbi_backend = &openbsd_backend;\n#elif defined(OS_NETBSD)\nconst struct usbi_os_backend * const usbi_backend = &netbsd_backend;\n#elif defined(OS_WINDOWS)\nconst struct usbi_os_backend * const usbi_backend = &windows_backend;\n#elif defined(OS_WINCE)\nconst struct usbi_os_backend * const usbi_backend = &wince_backend;\n#else\n#error \"Unsupported OS\"\n#endif\n\nstruct libusb_context *usbi_default_context = NULL;\nstatic const struct libusb_version libusb_version_internal =\n\t{ LIBUSB_MAJOR, LIBUSB_MINOR, LIBUSB_MICRO, LIBUSB_NANO,\n\t  LIBUSB_RC, \"http://libusb.info\" };\nstatic int default_context_refcnt = 0;\nstatic usbi_mutex_static_t default_context_lock = USBI_MUTEX_INITIALIZER;\nstatic struct timeval timestamp_origin = { 0, 0 };\n\nusbi_mutex_static_t active_contexts_lock = USBI_MUTEX_INITIALIZER;\nstruct list_head active_contexts_list;\n\n/**\n * \\mainpage libusb-1.0 API Reference\n *\n * \\section intro Introduction\n *\n * libusb is an open source library that allows you to communicate with USB\n * devices from userspace. For more info, see the\n * <a href=\"http://libusb.info\">libusb homepage</a>.\n *\n * This documentation is aimed at application developers wishing to\n * communicate with USB peripherals from their own software. After reviewing\n * this documentation, feedback and questions can be sent to the\n * <a href=\"http://mailing-list.libusb.info\">libusb-devel mailing list</a>.\n *\n * This documentation assumes knowledge of how to operate USB devices from\n * a software standpoint (descriptors, configurations, interfaces, endpoints,\n * control/bulk/interrupt/isochronous transfers, etc). Full information\n * can be found in the <a href=\"http://www.usb.org/developers/docs/\">USB 3.0\n * Specification</a> which is available for free download. You can probably\n * find less verbose introductions by searching the web.\n *\n * \\section features Library features\n *\n * - All transfer types supported (control/bulk/interrupt/isochronous)\n * - 2 transfer interfaces:\n *    -# Synchronous (simple)\n *    -# Asynchronous (more complicated, but more powerful)\n * - Thread safe (although the asynchronous interface means that you\n *   usually won't need to thread)\n * - Lightweight with lean API\n * - Compatible with libusb-0.1 through the libusb-compat-0.1 translation layer\n * - Hotplug support (on some platforms). See \\ref hotplug.\n *\n * \\section gettingstarted Getting Started\n *\n * To begin reading the API documentation, start with the Modules page which\n * links to the different categories of libusb's functionality.\n *\n * One decision you will have to make is whether to use the synchronous\n * or the asynchronous data transfer interface. The \\ref io documentation\n * provides some insight into this topic.\n *\n * Some example programs can be found in the libusb source distribution under\n * the \"examples\" subdirectory. The libusb homepage includes a list of\n * real-life project examples which use libusb.\n *\n * \\section errorhandling Error handling\n *\n * libusb functions typically return 0 on success or a negative error code\n * on failure. These negative error codes relate to LIBUSB_ERROR constants\n * which are listed on the \\ref misc \"miscellaneous\" documentation page.\n *\n * \\section msglog Debug message logging\n *\n * libusb uses stderr for all logging. By default, logging is set to NONE,\n * which means that no output will be produced. However, unless the library\n * has been compiled with logging disabled, then any application calls to\n * libusb_set_debug(), or the setting of the environmental variable\n * LIBUSB_DEBUG outside of the application, can result in logging being\n * produced. Your application should therefore not close stderr, but instead\n * direct it to the null device if its output is undesireable.\n *\n * The libusb_set_debug() function can be used to enable logging of certain\n * messages. Under standard configuration, libusb doesn't really log much\n * so you are advised to use this function to enable all error/warning/\n * informational messages. It will help debug problems with your software.\n *\n * The logged messages are unstructured. There is no one-to-one correspondence\n * between messages being logged and success or failure return codes from\n * libusb functions. There is no format to the messages, so you should not\n * try to capture or parse them. They are not and will not be localized.\n * These messages are not intended to being passed to your application user;\n * instead, you should interpret the error codes returned from libusb functions\n * and provide appropriate notification to the user. The messages are simply\n * there to aid you as a programmer, and if you're confused because you're\n * getting a strange error code from a libusb function, enabling message\n * logging may give you a suitable explanation.\n *\n * The LIBUSB_DEBUG environment variable can be used to enable message logging\n * at run-time. This environment variable should be set to a log level number,\n * which is interpreted the same as the libusb_set_debug() parameter. When this\n * environment variable is set, the message logging verbosity level is fixed\n * and libusb_set_debug() effectively does nothing.\n *\n * libusb can be compiled without any logging functions, useful for embedded\n * systems. In this case, libusb_set_debug() and the LIBUSB_DEBUG environment\n * variable have no effects.\n *\n * libusb can also be compiled with verbose debugging messages always. When\n * the library is compiled in this way, all messages of all verbosities are\n * always logged. libusb_set_debug() and the LIBUSB_DEBUG environment variable\n * have no effects.\n *\n * \\section remarks Other remarks\n *\n * libusb does have imperfections. The \\ref caveats \"caveats\" page attempts\n * to document these.\n */\n\n/**\n * \\page caveats Caveats\n *\n * \\section devresets Device resets\n *\n * The libusb_reset_device() function allows you to reset a device. If your\n * program has to call such a function, it should obviously be aware that\n * the reset will cause device state to change (e.g. register values may be\n * reset).\n *\n * The problem is that any other program could reset the device your program\n * is working with, at any time. libusb does not offer a mechanism to inform\n * you when this has happened, so if someone else resets your device it will\n * not be clear to your own program why the device state has changed.\n *\n * Ultimately, this is a limitation of writing drivers in userspace.\n * Separation from the USB stack in the underlying kernel makes it difficult\n * for the operating system to deliver such notifications to your program.\n * The Linux kernel USB stack allows such reset notifications to be delivered\n * to in-kernel USB drivers, but it is not clear how such notifications could\n * be delivered to second-class drivers that live in userspace.\n *\n * \\section blockonly Blocking-only functionality\n *\n * The functionality listed below is only available through synchronous,\n * blocking functions. There are no asynchronous/non-blocking alternatives,\n * and no clear ways of implementing these.\n *\n * - Configuration activation (libusb_set_configuration())\n * - Interface/alternate setting activation (libusb_set_interface_alt_setting())\n * - Releasing of interfaces (libusb_release_interface())\n * - Clearing of halt/stall condition (libusb_clear_halt())\n * - Device resets (libusb_reset_device())\n *\n * \\section configsel Configuration selection and handling\n *\n * When libusb presents a device handle to an application, there is a chance\n * that the corresponding device may be in unconfigured state. For devices\n * with multiple configurations, there is also a chance that the configuration\n * currently selected is not the one that the application wants to use.\n *\n * The obvious solution is to add a call to libusb_set_configuration() early\n * on during your device initialization routines, but there are caveats to\n * be aware of:\n * -# If the device is already in the desired configuration, calling\n *    libusb_set_configuration() using the same configuration value will cause\n *    a lightweight device reset. This may not be desirable behaviour.\n * -# libusb will be unable to change configuration if the device is in\n *    another configuration and other programs or drivers have claimed\n *    interfaces under that configuration.\n * -# In the case where the desired configuration is already active, libusb\n *    may not even be able to perform a lightweight device reset. For example,\n *    take my USB keyboard with fingerprint reader: I'm interested in driving\n *    the fingerprint reader interface through libusb, but the kernel's\n *    USB-HID driver will almost always have claimed the keyboard interface.\n *    Because the kernel has claimed an interface, it is not even possible to\n *    perform the lightweight device reset, so libusb_set_configuration() will\n *    fail. (Luckily the device in question only has a single configuration.)\n *\n * One solution to some of the above problems is to consider the currently\n * active configuration. If the configuration we want is already active, then\n * we don't have to select any configuration:\n\\code\ncfg = libusb_get_configuration(dev);\nif (cfg != desired)\n\tlibusb_set_configuration(dev, desired);\n\\endcode\n *\n * This is probably suitable for most scenarios, but is inherently racy:\n * another application or driver may change the selected configuration\n * <em>after</em> the libusb_get_configuration() call.\n *\n * Even in cases where libusb_set_configuration() succeeds, consider that other\n * applications or drivers may change configuration after your application\n * calls libusb_set_configuration().\n *\n * One possible way to lock your device into a specific configuration is as\n * follows:\n * -# Set the desired configuration (or use the logic above to realise that\n *    it is already in the desired configuration)\n * -# Claim the interface that you wish to use\n * -# Check that the currently active configuration is the one that you want\n *    to use.\n *\n * The above method works because once an interface is claimed, no application\n * or driver is able to select another configuration.\n *\n * \\section earlycomp Early transfer completion\n *\n * NOTE: This section is currently Linux-centric. I am not sure if any of these\n * considerations apply to Darwin or other platforms.\n *\n * When a transfer completes early (i.e. when less data is received/sent in\n * any one packet than the transfer buffer allows for) then libusb is designed\n * to terminate the transfer immediately, not transferring or receiving any\n * more data unless other transfers have been queued by the user.\n *\n * On legacy platforms, libusb is unable to do this in all situations. After\n * the incomplete packet occurs, \"surplus\" data may be transferred. For recent\n * versions of libusb, this information is kept (the data length of the\n * transfer is updated) and, for device-to-host transfers, any surplus data was\n * added to the buffer. Still, this is not a nice solution because it loses the\n * information about the end of the short packet, and the user probably wanted\n * that surplus data to arrive in the next logical transfer.\n *\n *\n * \\section zlp Zero length packets\n *\n * - libusb is able to send a packet of zero length to an endpoint simply by\n * submitting a transfer of zero length.\n * - The \\ref libusb_transfer_flags::LIBUSB_TRANSFER_ADD_ZERO_PACKET\n * \"LIBUSB_TRANSFER_ADD_ZERO_PACKET\" flag is currently only supported on Linux.\n */\n\n/**\n * \\page contexts Contexts\n *\n * It is possible that libusb may be used simultaneously from two independent\n * libraries linked into the same executable. For example, if your application\n * has a plugin-like system which allows the user to dynamically load a range\n * of modules into your program, it is feasible that two independently\n * developed modules may both use libusb.\n *\n * libusb is written to allow for these multiple user scenarios. The two\n * \"instances\" of libusb will not interfere: libusb_set_debug() calls\n * from one user will not affect the same settings for other users, other\n * users can continue using libusb after one of them calls libusb_exit(), etc.\n *\n * This is made possible through libusb's <em>context</em> concept. When you\n * call libusb_init(), you are (optionally) given a context. You can then pass\n * this context pointer back into future libusb functions.\n *\n * In order to keep things simple for more simplistic applications, it is\n * legal to pass NULL to all functions requiring a context pointer (as long as\n * you're sure no other code will attempt to use libusb from the same process).\n * When you pass NULL, the default context will be used. The default context\n * is created the first time a process calls libusb_init() when no other\n * context is alive. Contexts are destroyed during libusb_exit().\n *\n * The default context is reference-counted and can be shared. That means that\n * if libusb_init(NULL) is called twice within the same process, the two\n * users end up sharing the same context. The deinitialization and freeing of\n * the default context will only happen when the last user calls libusb_exit().\n * In other words, the default context is created and initialized when its\n * reference count goes from 0 to 1, and is deinitialized and destroyed when\n * its reference count goes from 1 to 0.\n *\n * You may be wondering why only a subset of libusb functions require a\n * context pointer in their function definition. Internally, libusb stores\n * context pointers in other objects (e.g. libusb_device instances) and hence\n * can infer the context from those objects.\n */\n\n/**\n * @defgroup lib Library initialization/deinitialization\n * This page details how to initialize and deinitialize libusb. Initialization\n * must be performed before using any libusb functionality, and similarly you\n * must not call any libusb functions after deinitialization.\n */\n\n/**\n * @defgroup dev Device handling and enumeration\n * The functionality documented below is designed to help with the following\n * operations:\n * - Enumerating the USB devices currently attached to the system\n * - Choosing a device to operate from your software\n * - Opening and closing the chosen device\n *\n * \\section nutshell In a nutshell...\n *\n * The description below really makes things sound more complicated than they\n * actually are. The following sequence of function calls will be suitable\n * for almost all scenarios and does not require you to have such a deep\n * understanding of the resource management issues:\n * \\code\n// discover devices\nlibusb_device **list;\nlibusb_device *found = NULL;\nssize_t cnt = libusb_get_device_list(NULL, &list);\nssize_t i = 0;\nint err = 0;\nif (cnt < 0)\n\terror();\n\nfor (i = 0; i < cnt; i++) {\n\tlibusb_device *device = list[i];\n\tif (is_interesting(device)) {\n\t\tfound = device;\n\t\tbreak;\n\t}\n}\n\nif (found) {\n\tlibusb_device_handle *handle;\n\n\terr = libusb_open(found, &handle);\n\tif (err)\n\t\terror();\n\t// etc\n}\n\nlibusb_free_device_list(list, 1);\n\\endcode\n *\n * The two important points:\n * - You asked libusb_free_device_list() to unreference the devices (2nd\n *   parameter)\n * - You opened the device before freeing the list and unreferencing the\n *   devices\n *\n * If you ended up with a handle, you can now proceed to perform I/O on the\n * device.\n *\n * \\section devshandles Devices and device handles\n * libusb has a concept of a USB device, represented by the\n * \\ref libusb_device opaque type. A device represents a USB device that\n * is currently or was previously connected to the system. Using a reference\n * to a device, you can determine certain information about the device (e.g.\n * you can read the descriptor data).\n *\n * The libusb_get_device_list() function can be used to obtain a list of\n * devices currently connected to the system. This is known as device\n * discovery.\n *\n * Just because you have a reference to a device does not mean it is\n * necessarily usable. The device may have been unplugged, you may not have\n * permission to operate such device, or another program or driver may be\n * using the device.\n *\n * When you've found a device that you'd like to operate, you must ask\n * libusb to open the device using the libusb_open() function. Assuming\n * success, libusb then returns you a <em>device handle</em>\n * (a \\ref libusb_device_handle pointer). All \"real\" I/O operations then\n * operate on the handle rather than the original device pointer.\n *\n * \\section devref Device discovery and reference counting\n *\n * Device discovery (i.e. calling libusb_get_device_list()) returns a\n * freshly-allocated list of devices. The list itself must be freed when\n * you are done with it. libusb also needs to know when it is OK to free\n * the contents of the list - the devices themselves.\n *\n * To handle these issues, libusb provides you with two separate items:\n * - A function to free the list itself\n * - A reference counting system for the devices inside\n *\n * New devices presented by the libusb_get_device_list() function all have a\n * reference count of 1. You can increase and decrease reference count using\n * libusb_ref_device() and libusb_unref_device(). A device is destroyed when\n * its reference count reaches 0.\n *\n * With the above information in mind, the process of opening a device can\n * be viewed as follows:\n * -# Discover devices using libusb_get_device_list().\n * -# Choose the device that you want to operate, and call libusb_open().\n * -# Unref all devices in the discovered device list.\n * -# Free the discovered device list.\n *\n * The order is important - you must not unreference the device before\n * attempting to open it, because unreferencing it may destroy the device.\n *\n * For convenience, the libusb_free_device_list() function includes a\n * parameter to optionally unreference all the devices in the list before\n * freeing the list itself. This combines steps 3 and 4 above.\n *\n * As an implementation detail, libusb_open() actually adds a reference to\n * the device in question. This is because the device remains available\n * through the handle via libusb_get_device(). The reference is deleted during\n * libusb_close().\n */\n\n/** @defgroup misc Miscellaneous */\n\n/* we traverse usbfs without knowing how many devices we are going to find.\n * so we create this discovered_devs model which is similar to a linked-list\n * which grows when required. it can be freed once discovery has completed,\n * eliminating the need for a list node in the libusb_device structure\n * itself. */\n#define DISCOVERED_DEVICES_SIZE_STEP 8\n\nstatic struct discovered_devs *discovered_devs_alloc(void)\n{\n\tstruct discovered_devs *ret =\n\t\tmalloc(sizeof(*ret) + (sizeof(void *) * DISCOVERED_DEVICES_SIZE_STEP));\n\n\tif (ret) {\n\t\tret->len = 0;\n\t\tret->capacity = DISCOVERED_DEVICES_SIZE_STEP;\n\t}\n\treturn ret;\n}\n\n/* append a device to the discovered devices collection. may realloc itself,\n * returning new discdevs. returns NULL on realloc failure. */\nstruct discovered_devs *discovered_devs_append(\n\tstruct discovered_devs *discdevs, struct libusb_device *dev)\n{\n\tsize_t len = discdevs->len;\n\tsize_t capacity;\n\n\t/* if there is space, just append the device */\n\tif (len < discdevs->capacity) {\n\t\tdiscdevs->devices[len] = libusb_ref_device(dev);\n\t\tdiscdevs->len++;\n\t\treturn discdevs;\n\t}\n\n\t/* exceeded capacity, need to grow */\n\tusbi_dbg(\"need to increase capacity\");\n\tcapacity = discdevs->capacity + DISCOVERED_DEVICES_SIZE_STEP;\n\tdiscdevs = usbi_reallocf(discdevs,\n\t\tsizeof(*discdevs) + (sizeof(void *) * capacity));\n\tif (discdevs) {\n\t\tdiscdevs->capacity = capacity;\n\t\tdiscdevs->devices[len] = libusb_ref_device(dev);\n\t\tdiscdevs->len++;\n\t}\n\n\treturn discdevs;\n}\n\nstatic void discovered_devs_free(struct discovered_devs *discdevs)\n{\n\tsize_t i;\n\n\tfor (i = 0; i < discdevs->len; i++)\n\t\tlibusb_unref_device(discdevs->devices[i]);\n\n\tfree(discdevs);\n}\n\n/* Allocate a new device with a specific session ID. The returned device has\n * a reference count of 1. */\nstruct libusb_device *usbi_alloc_device(struct libusb_context *ctx,\n\tunsigned long session_id)\n{\n\tsize_t priv_size = usbi_backend->device_priv_size;\n\tstruct libusb_device *dev = calloc(1, sizeof(*dev) + priv_size);\n\tint r;\n\n\tif (!dev)\n\t\treturn NULL;\n\n\tr = usbi_mutex_init(&dev->lock, NULL);\n\tif (r) {\n\t\tfree(dev);\n\t\treturn NULL;\n\t}\n\n\tdev->ctx = ctx;\n\tdev->refcnt = 1;\n\tdev->session_data = session_id;\n\tdev->speed = LIBUSB_SPEED_UNKNOWN;\n\n\tif (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {\n\t\tusbi_connect_device (dev);\n\t}\n\n\treturn dev;\n}\n\nvoid usbi_connect_device(struct libusb_device *dev)\n{\n\tlibusb_hotplug_message message;\n\tssize_t ret;\n\n\tmemset(&message, 0, sizeof(message));\n\tmessage.event = LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED;\n\tmessage.device = dev;\n\tdev->attached = 1;\n\n\tusbi_mutex_lock(&dev->ctx->usb_devs_lock);\n\tlist_add(&dev->list, &dev->ctx->usb_devs);\n\tusbi_mutex_unlock(&dev->ctx->usb_devs_lock);\n\n\t/* Signal that an event has occurred for this device if we support hotplug AND\n\t * the hotplug pipe is ready. This prevents an event from getting raised during\n\t * initial enumeration. */\n\tif (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) && dev->ctx->hotplug_pipe[1] > 0) {\n\t\tret = usbi_write(dev->ctx->hotplug_pipe[1], &message, sizeof(message));\n\t\tif (sizeof (message) != ret) {\n\t\t\tusbi_err(DEVICE_CTX(dev), \"error writing hotplug message\");\n\t\t}\n\t}\n}\n\nvoid usbi_disconnect_device(struct libusb_device *dev)\n{\n\tlibusb_hotplug_message message;\n\tstruct libusb_context *ctx = dev->ctx;\n\tssize_t ret;\n\n\tmemset(&message, 0, sizeof(message));\n\tmessage.event = LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT;\n\tmessage.device = dev;\n\tusbi_mutex_lock(&dev->lock);\n\tdev->attached = 0;\n\tusbi_mutex_unlock(&dev->lock);\n\n\tusbi_mutex_lock(&ctx->usb_devs_lock);\n\tlist_del(&dev->list);\n\tusbi_mutex_unlock(&ctx->usb_devs_lock);\n\n\t/* Signal that an event has occurred for this device if we support hotplug AND\n\t * the hotplug pipe is ready. This prevents an event from getting raised during\n\t * initial enumeration. libusb_handle_events will take care of dereferencing the\n\t * device. */\n\tif (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) && dev->ctx->hotplug_pipe[1] > 0) {\n\t\tret = usbi_write(dev->ctx->hotplug_pipe[1], &message, sizeof(message));\n\t\tif (sizeof(message) != ret) {\n\t\t\tusbi_err(DEVICE_CTX(dev), \"error writing hotplug message\");\n\t\t}\n\t}\n}\n\n/* Perform some final sanity checks on a newly discovered device. If this\n * function fails (negative return code), the device should not be added\n * to the discovered device list. */\nint usbi_sanitize_device(struct libusb_device *dev)\n{\n\tint r;\n\tuint8_t num_configurations;\n\n\tr = usbi_device_cache_descriptor(dev);\n\tif (r < 0)\n\t\treturn r;\n\n\tnum_configurations = dev->device_descriptor.bNumConfigurations;\n\tif (num_configurations > USB_MAXCONFIG) {\n\t\tusbi_err(DEVICE_CTX(dev), \"too many configurations\");\n\t\treturn LIBUSB_ERROR_IO;\n\t} else if (0 == num_configurations)\n\t\tusbi_dbg(\"zero configurations, maybe an unauthorized device\");\n\n\tdev->num_configurations = num_configurations;\n\treturn 0;\n}\n\n/* Examine libusb's internal list of known devices, looking for one with\n * a specific session ID. Returns the matching device if it was found, and\n * NULL otherwise. */\nstruct libusb_device *usbi_get_device_by_session_id(struct libusb_context *ctx,\n\tunsigned long session_id)\n{\n\tstruct libusb_device *dev;\n\tstruct libusb_device *ret = NULL;\n\n\tusbi_mutex_lock(&ctx->usb_devs_lock);\n\tlist_for_each_entry(dev, &ctx->usb_devs, list, struct libusb_device)\n\t\tif (dev->session_data == session_id) {\n\t\t\tret = libusb_ref_device(dev);\n\t\t\tbreak;\n\t\t}\n\tusbi_mutex_unlock(&ctx->usb_devs_lock);\n\n\treturn ret;\n}\n\n/** @ingroup dev\n * Returns a list of USB devices currently attached to the system. This is\n * your entry point into finding a USB device to operate.\n *\n * You are expected to unreference all the devices when you are done with\n * them, and then free the list with libusb_free_device_list(). Note that\n * libusb_free_device_list() can unref all the devices for you. Be careful\n * not to unreference a device you are about to open until after you have\n * opened it.\n *\n * This return value of this function indicates the number of devices in\n * the resultant list. The list is actually one element larger, as it is\n * NULL-terminated.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param list output location for a list of devices. Must be later freed with\n * libusb_free_device_list().\n * \\returns the number of devices in the outputted list, or any\n * \\ref libusb_error according to errors encountered by the backend.\n */\nssize_t API_EXPORTED libusb_get_device_list(libusb_context *ctx,\n\tlibusb_device ***list)\n{\n\tstruct discovered_devs *discdevs = discovered_devs_alloc();\n\tstruct libusb_device **ret;\n\tint r = 0;\n\tssize_t i, len;\n\tUSBI_GET_CONTEXT(ctx);\n\tusbi_dbg(\"\");\n\n\tif (!discdevs)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tif (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {\n\t\t/* backend provides hotplug support */\n\t\tstruct libusb_device *dev;\n\n\t\tif (usbi_backend->hotplug_poll)\n\t\t\tusbi_backend->hotplug_poll();\n\n\t\tusbi_mutex_lock(&ctx->usb_devs_lock);\n\t\tlist_for_each_entry(dev, &ctx->usb_devs, list, struct libusb_device) {\n\t\t\tdiscdevs = discovered_devs_append(discdevs, dev);\n\n\t\t\tif (!discdevs) {\n\t\t\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tusbi_mutex_unlock(&ctx->usb_devs_lock);\n\t} else {\n\t\t/* backend does not provide hotplug support */\n\t\tr = usbi_backend->get_device_list(ctx, &discdevs);\n\t}\n\n\tif (r < 0) {\n\t\tlen = r;\n\t\tgoto out;\n\t}\n\n\t/* convert discovered_devs into a list */\n\tlen = discdevs->len;\n\tret = calloc(len + 1, sizeof(struct libusb_device *));\n\tif (!ret) {\n\t\tlen = LIBUSB_ERROR_NO_MEM;\n\t\tgoto out;\n\t}\n\n\tret[len] = NULL;\n\tfor (i = 0; i < len; i++) {\n\t\tstruct libusb_device *dev = discdevs->devices[i];\n\t\tret[i] = libusb_ref_device(dev);\n\t}\n\t*list = ret;\n\nout:\n\tdiscovered_devs_free(discdevs);\n\treturn len;\n}\n\n/** \\ingroup dev\n * Frees a list of devices previously discovered using\n * libusb_get_device_list(). If the unref_devices parameter is set, the\n * reference count of each device in the list is decremented by 1.\n * \\param list the list to free\n * \\param unref_devices whether to unref the devices in the list\n */\nvoid API_EXPORTED libusb_free_device_list(libusb_device **list,\n\tint unref_devices)\n{\n\tif (!list)\n\t\treturn;\n\n\tif (unref_devices) {\n\t\tint i = 0;\n\t\tstruct libusb_device *dev;\n\n\t\twhile ((dev = list[i++]) != NULL)\n\t\t\tlibusb_unref_device(dev);\n\t}\n\tfree(list);\n}\n\n/** \\ingroup dev\n * Get the number of the bus that a device is connected to.\n * \\param dev a device\n * \\returns the bus number\n */\nuint8_t API_EXPORTED libusb_get_bus_number(libusb_device *dev)\n{\n\treturn dev->bus_number;\n}\n\n/** \\ingroup dev\n * Get the number of the port that a device is connected to.\n * Unless the OS does something funky, or you are hot-plugging USB extension cards,\n * the port number returned by this call is usually guaranteed to be uniquely tied\n * to a physical port, meaning that different devices plugged on the same physical\n * port should return the same port number.\n *\n * But outside of this, there is no guarantee that the port number returned by this\n * call will remain the same, or even match the order in which ports have been\n * numbered by the HUB/HCD manufacturer.\n *\n * \\param dev a device\n * \\returns the port number (0 if not available)\n */\nuint8_t API_EXPORTED libusb_get_port_number(libusb_device *dev)\n{\n\treturn dev->port_number;\n}\n\n/** \\ingroup dev\n * Get the list of all port numbers from root for the specified device\n *\n * Since version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102\n * \\param dev a device\n * \\param port_numbers the array that should contain the port numbers\n * \\param port_numbers_len the maximum length of the array. As per the USB 3.0\n * specs, the current maximum limit for the depth is 7.\n * \\returns the number of elements filled\n * \\returns LIBUSB_ERROR_OVERFLOW if the array is too small\n */\nint API_EXPORTED libusb_get_port_numbers(libusb_device *dev,\n\tuint8_t* port_numbers, int port_numbers_len)\n{\n\tint i = port_numbers_len;\n\n\twhile(dev) {\n\t\t// HCDs can be listed as devices and would have port #0\n\t\t// TODO: see how the other backends want to implement HCDs as parents\n\t\tif (dev->port_number == 0)\n\t\t\tbreak;\n\t\ti--;\n\t\tif (i < 0) {\n\t\t\tusbi_warn(DEVICE_CTX(dev),\n\t\t\t\t\"port numbers array too small\");\n\t\t\treturn LIBUSB_ERROR_OVERFLOW;\n\t\t}\n\t\tport_numbers[i] = dev->port_number;\n\t\tdev = dev->parent_dev;\n\t}\n\tmemmove(port_numbers, &port_numbers[i], port_numbers_len - i);\n\treturn port_numbers_len - i;\n}\n\n/** \\ingroup dev\n * Deprecated please use libusb_get_port_numbers instead.\n */\nint API_EXPORTED libusb_get_port_path(libusb_context *ctx, libusb_device *dev,\n\tuint8_t* port_numbers, uint8_t port_numbers_len)\n{\n\tUNUSED(ctx);\n\n\treturn libusb_get_port_numbers(dev, port_numbers, port_numbers_len);\n}\n\n/** \\ingroup dev\n * Get the the parent from the specified device.\n * \\param dev a device\n * \\returns the device parent or NULL if not available\n * You should issue a \\ref libusb_get_device_list() before calling this\n * function and make sure that you only access the parent before issuing\n * \\ref libusb_free_device_list(). The reason is that libusb currently does\n * not maintain a permanent list of device instances, and therefore can\n * only guarantee that parents are fully instantiated within a \n * libusb_get_device_list() - libusb_free_device_list() block.\n */\nDEFAULT_VISIBILITY\nlibusb_device * LIBUSB_CALL libusb_get_parent(libusb_device *dev)\n{\n\treturn dev->parent_dev;\n}\n\n/** \\ingroup dev\n * Get the address of the device on the bus it is connected to.\n * \\param dev a device\n * \\returns the device address\n */\nuint8_t API_EXPORTED libusb_get_device_address(libusb_device *dev)\n{\n\treturn dev->device_address;\n}\n\n/** \\ingroup dev\n * Get the negotiated connection speed for a device.\n * \\param dev a device\n * \\returns a \\ref libusb_speed code, where LIBUSB_SPEED_UNKNOWN means that\n * the OS doesn't know or doesn't support returning the negotiated speed.\n */\nint API_EXPORTED libusb_get_device_speed(libusb_device *dev)\n{\n\treturn dev->speed;\n}\n\nstatic const struct libusb_endpoint_descriptor *find_endpoint(\n\tstruct libusb_config_descriptor *config, unsigned char endpoint)\n{\n\tint iface_idx;\n\tfor (iface_idx = 0; iface_idx < config->bNumInterfaces; iface_idx++) {\n\t\tconst struct libusb_interface *iface = &config->interface[iface_idx];\n\t\tint altsetting_idx;\n\n\t\tfor (altsetting_idx = 0; altsetting_idx < iface->num_altsetting;\n\t\t\t\taltsetting_idx++) {\n\t\t\tconst struct libusb_interface_descriptor *altsetting\n\t\t\t\t= &iface->altsetting[altsetting_idx];\n\t\t\tint ep_idx;\n\n\t\t\tfor (ep_idx = 0; ep_idx < altsetting->bNumEndpoints; ep_idx++) {\n\t\t\t\tconst struct libusb_endpoint_descriptor *ep =\n\t\t\t\t\t&altsetting->endpoint[ep_idx];\n\t\t\t\tif (ep->bEndpointAddress == endpoint)\n\t\t\t\t\treturn ep;\n\t\t\t}\n\t\t}\n\t}\n\treturn NULL;\n}\n\n/** \\ingroup dev\n * Convenience function to retrieve the wMaxPacketSize value for a particular\n * endpoint in the active device configuration.\n *\n * This function was originally intended to be of assistance when setting up\n * isochronous transfers, but a design mistake resulted in this function\n * instead. It simply returns the wMaxPacketSize value without considering\n * its contents. If you're dealing with isochronous transfers, you probably\n * want libusb_get_max_iso_packet_size() instead.\n *\n * \\param dev a device\n * \\param endpoint address of the endpoint in question\n * \\returns the wMaxPacketSize value\n * \\returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist\n * \\returns LIBUSB_ERROR_OTHER on other failure\n */\nint API_EXPORTED libusb_get_max_packet_size(libusb_device *dev,\n\tunsigned char endpoint)\n{\n\tstruct libusb_config_descriptor *config;\n\tconst struct libusb_endpoint_descriptor *ep;\n\tint r;\n\n\tr = libusb_get_active_config_descriptor(dev, &config);\n\tif (r < 0) {\n\t\tusbi_err(DEVICE_CTX(dev),\n\t\t\t\"could not retrieve active config descriptor\");\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\tep = find_endpoint(config, endpoint);\n\tif (!ep)\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\tr = ep->wMaxPacketSize;\n\tlibusb_free_config_descriptor(config);\n\treturn r;\n}\n\n/** \\ingroup dev\n * Calculate the maximum packet size which a specific endpoint is capable is\n * sending or receiving in the duration of 1 microframe\n *\n * Only the active configuration is examined. The calculation is based on the\n * wMaxPacketSize field in the endpoint descriptor as described in section\n * 9.6.6 in the USB 2.0 specifications.\n *\n * If acting on an isochronous or interrupt endpoint, this function will\n * multiply the value found in bits 0:10 by the number of transactions per\n * microframe (determined by bits 11:12). Otherwise, this function just\n * returns the numeric value found in bits 0:10.\n *\n * This function is useful for setting up isochronous transfers, for example\n * you might pass the return value from this function to\n * libusb_set_iso_packet_lengths() in order to set the length field of every\n * isochronous packet in a transfer.\n *\n * Since v1.0.3.\n *\n * \\param dev a device\n * \\param endpoint address of the endpoint in question\n * \\returns the maximum packet size which can be sent/received on this endpoint\n * \\returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist\n * \\returns LIBUSB_ERROR_OTHER on other failure\n */\nint API_EXPORTED libusb_get_max_iso_packet_size(libusb_device *dev,\n\tunsigned char endpoint)\n{\n\tstruct libusb_config_descriptor *config;\n\tconst struct libusb_endpoint_descriptor *ep;\n\tenum libusb_transfer_type ep_type;\n\tuint16_t val;\n\tint r;\n\n\tr = libusb_get_active_config_descriptor(dev, &config);\n\tif (r < 0) {\n\t\tusbi_err(DEVICE_CTX(dev),\n\t\t\t\"could not retrieve active config descriptor\");\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\tep = find_endpoint(config, endpoint);\n\tif (!ep)\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\tval = ep->wMaxPacketSize;\n\tep_type = (enum libusb_transfer_type) (ep->bmAttributes & 0x3);\n\tlibusb_free_config_descriptor(config);\n\n\tr = val & 0x07ff;\n\tif (ep_type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS\n\t\t\t|| ep_type == LIBUSB_TRANSFER_TYPE_INTERRUPT)\n\t\tr *= (1 + ((val >> 11) & 3));\n\treturn r;\n}\n\n/** \\ingroup dev\n * Increment the reference count of a device.\n * \\param dev the device to reference\n * \\returns the same device\n */\nDEFAULT_VISIBILITY\nlibusb_device * LIBUSB_CALL libusb_ref_device(libusb_device *dev)\n{\n\tusbi_mutex_lock(&dev->lock);\n\tdev->refcnt++;\n\tusbi_mutex_unlock(&dev->lock);\n\treturn dev;\n}\n\n/** \\ingroup dev\n * Decrement the reference count of a device. If the decrement operation\n * causes the reference count to reach zero, the device shall be destroyed.\n * \\param dev the device to unreference\n */\nvoid API_EXPORTED libusb_unref_device(libusb_device *dev)\n{\n\tint refcnt;\n\n\tif (!dev)\n\t\treturn;\n\n\tusbi_mutex_lock(&dev->lock);\n\trefcnt = --dev->refcnt;\n\tusbi_mutex_unlock(&dev->lock);\n\n\tif (refcnt == 0) {\n\t\tusbi_dbg(\"destroy device %d.%d\", dev->bus_number, dev->device_address);\n\n\t\tlibusb_unref_device(dev->parent_dev);\n\n\t\tif (usbi_backend->destroy_device)\n\t\t\tusbi_backend->destroy_device(dev);\n\n\t\tif (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {\n\t\t\t/* backend does not support hotplug */\n\t\t\tusbi_disconnect_device(dev);\n\t\t}\n\n\t\tusbi_mutex_destroy(&dev->lock);\n\t\tfree(dev);\n\t}\n}\n\n/*\n * Interrupt the iteration of the event handling thread, so that it picks\n * up the new fd.\n */\nvoid usbi_fd_notification(struct libusb_context *ctx)\n{\n\tunsigned char dummy = 1;\n\tssize_t r;\n\n\tif (ctx == NULL)\n\t\treturn;\n\n\t/* record that we are messing with poll fds */\n\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\tctx->pollfd_modify++;\n\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\n\t/* write some data on control pipe to interrupt event handlers */\n\tr = usbi_write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy));\n\tif (r <= 0) {\n\t\tusbi_warn(ctx, \"internal signalling write failed\");\n\t\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\t\tctx->pollfd_modify--;\n\t\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\t\treturn;\n\t}\n\n\t/* take event handling lock */\n\tlibusb_lock_events(ctx);\n\n\t/* read the dummy data */\n\tr = usbi_read(ctx->ctrl_pipe[0], &dummy, sizeof(dummy));\n\tif (r <= 0)\n\t\tusbi_warn(ctx, \"internal signalling read failed\");\n\n\t/* we're done with modifying poll fds */\n\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\tctx->pollfd_modify--;\n\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\n\t/* Release event handling lock and wake up event waiters */\n\tlibusb_unlock_events(ctx);\n}\n\n/** \\ingroup dev\n * Open a device and obtain a device handle. A handle allows you to perform\n * I/O on the device in question.\n *\n * Internally, this function adds a reference to the device and makes it\n * available to you through libusb_get_device(). This reference is removed\n * during libusb_close().\n *\n * This is a non-blocking function; no requests are sent over the bus.\n *\n * \\param dev the device to open\n * \\param handle output location for the returned device handle pointer. Only\n * populated when the return code is 0.\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NO_MEM on memory allocation failure\n * \\returns LIBUSB_ERROR_ACCESS if the user has insufficient permissions\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failure\n */\nint API_EXPORTED libusb_open(libusb_device *dev,\n\tlibusb_device_handle **handle)\n{\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\tstruct libusb_device_handle *_handle;\n\tsize_t priv_size = usbi_backend->device_handle_priv_size;\n\tint r;\n\tusbi_dbg(\"open %d.%d\", dev->bus_number, dev->device_address);\n\n\tif (!dev->attached) {\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t}\n\n\t_handle = malloc(sizeof(*_handle) + priv_size);\n\tif (!_handle)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tr = usbi_mutex_init(&_handle->lock, NULL);\n\tif (r) {\n\t\tfree(_handle);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\t_handle->dev = libusb_ref_device(dev);\n\t_handle->auto_detach_kernel_driver = 0;\n\t_handle->claimed_interfaces = 0;\n\tmemset(&_handle->os_priv, 0, priv_size);\n\n\tr = usbi_backend->open(_handle);\n\tif (r < 0) {\n\t\tusbi_dbg(\"open %d.%d returns %d\", dev->bus_number, dev->device_address, r);\n\t\tlibusb_unref_device(dev);\n\t\tusbi_mutex_destroy(&_handle->lock);\n\t\tfree(_handle);\n\t\treturn r;\n\t}\n\n\tusbi_mutex_lock(&ctx->open_devs_lock);\n\tlist_add(&_handle->list, &ctx->open_devs);\n\tusbi_mutex_unlock(&ctx->open_devs_lock);\n\t*handle = _handle;\n\n\t/* At this point, we want to interrupt any existing event handlers so\n\t * that they realise the addition of the new device's poll fd. One\n\t * example when this is desirable is if the user is running a separate\n\t * dedicated libusb events handling thread, which is running with a long\n\t * or infinite timeout. We want to interrupt that iteration of the loop,\n\t * so that it picks up the new fd, and then continues. */\n\tusbi_fd_notification(ctx);\n\n\treturn 0;\n}\n\n/** \\ingroup dev\n * Convenience function for finding a device with a particular\n * <tt>idVendor</tt>/<tt>idProduct</tt> combination. This function is intended\n * for those scenarios where you are using libusb to knock up a quick test\n * application - it allows you to avoid calling libusb_get_device_list() and\n * worrying about traversing/freeing the list.\n *\n * This function has limitations and is hence not intended for use in real\n * applications: if multiple devices have the same IDs it will only\n * give you the first one, etc.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param vendor_id the idVendor value to search for\n * \\param product_id the idProduct value to search for\n * \\returns a handle for the first found device, or NULL on error or if the\n * device could not be found. */\nDEFAULT_VISIBILITY\nlibusb_device_handle * LIBUSB_CALL libusb_open_device_with_vid_pid(\n\tlibusb_context *ctx, uint16_t vendor_id, uint16_t product_id)\n{\n\tstruct libusb_device **devs;\n\tstruct libusb_device *found = NULL;\n\tstruct libusb_device *dev;\n\tstruct libusb_device_handle *handle = NULL;\n\tsize_t i = 0;\n\tint r;\n\n\tif (libusb_get_device_list(ctx, &devs) < 0)\n\t\treturn NULL;\n\n\twhile ((dev = devs[i++]) != NULL) {\n\t\tstruct libusb_device_descriptor desc;\n\t\tr = libusb_get_device_descriptor(dev, &desc);\n\t\tif (r < 0)\n\t\t\tgoto out;\n\t\tif (desc.idVendor == vendor_id && desc.idProduct == product_id) {\n\t\t\tfound = dev;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (found) {\n\t\tr = libusb_open(found, &handle);\n\t\tif (r < 0)\n\t\t\thandle = NULL;\n\t}\n\nout:\n\tlibusb_free_device_list(devs, 1);\n\treturn handle;\n}\n\nstatic void do_close(struct libusb_context *ctx,\n\tstruct libusb_device_handle *dev_handle)\n{\n\tstruct usbi_transfer *itransfer;\n\tstruct usbi_transfer *tmp;\n\n\tlibusb_lock_events(ctx);\n\n\t/* remove any transfers in flight that are for this device */\n\tusbi_mutex_lock(&ctx->flying_transfers_lock);\n\n\t/* safe iteration because transfers may be being deleted */\n\tlist_for_each_entry_safe(itransfer, tmp, &ctx->flying_transfers, list, struct usbi_transfer) {\n\t\tstruct libusb_transfer *transfer =\n\t\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n\t\tif (transfer->dev_handle != dev_handle)\n\t\t\tcontinue;\n\n\t\tif (!(itransfer->flags & USBI_TRANSFER_DEVICE_DISAPPEARED)) {\n\t\t\tusbi_err(ctx, \"Device handle closed while transfer was still being processed, but the device is still connected as far as we know\");\n\n\t\t\tif (itransfer->flags & USBI_TRANSFER_CANCELLING)\n\t\t\t\tusbi_warn(ctx, \"A cancellation for an in-flight transfer hasn't completed but closing the device handle\");\n\t\t\telse\n\t\t\t\tusbi_err(ctx, \"A cancellation hasn't even been scheduled on the transfer for which the device is closing\");\n\t\t}\n\n\t\t/* remove from the list of in-flight transfers and make sure\n\t\t * we don't accidentally use the device handle in the future\n\t\t * (or that such accesses will be easily caught and identified as a crash)\n\t\t */\n\t\tusbi_mutex_lock(&itransfer->lock);\n\t\tlist_del(&itransfer->list);\n\t\ttransfer->dev_handle = NULL;\n\t\tusbi_mutex_unlock(&itransfer->lock);\n\n\t\t/* it is up to the user to free up the actual transfer struct.  this is\n\t\t * just making sure that we don't attempt to process the transfer after\n\t\t * the device handle is invalid\n\t\t */\n\t\tusbi_dbg(\"Removed transfer %p from the in-flight list because device handle %p closed\",\n\t\t\t transfer, dev_handle);\n\t}\n\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\n\tlibusb_unlock_events(ctx);\n\n\tusbi_mutex_lock(&ctx->open_devs_lock);\n\tlist_del(&dev_handle->list);\n\tusbi_mutex_unlock(&ctx->open_devs_lock);\n\n\tusbi_backend->close(dev_handle);\n\tlibusb_unref_device(dev_handle->dev);\n\tusbi_mutex_destroy(&dev_handle->lock);\n\tfree(dev_handle);\n}\n\n/** \\ingroup dev\n * Close a device handle. Should be called on all open handles before your\n * application exits.\n *\n * Internally, this function destroys the reference that was added by\n * libusb_open() on the given device.\n *\n * This is a non-blocking function; no requests are sent over the bus.\n *\n * \\param dev_handle the handle to close\n */\nvoid API_EXPORTED libusb_close(libusb_device_handle *dev_handle)\n{\n\tstruct libusb_context *ctx;\n\tunsigned char dummy = 1;\n\tssize_t r;\n\n\tif (!dev_handle)\n\t\treturn;\n\tusbi_dbg(\"\");\n\n\tctx = HANDLE_CTX(dev_handle);\n\n\t/* Similarly to libusb_open(), we want to interrupt all event handlers\n\t * at this point. More importantly, we want to perform the actual close of\n\t * the device while holding the event handling lock (preventing any other\n\t * thread from doing event handling) because we will be removing a file\n\t * descriptor from the polling loop. */\n\n\t/* record that we are messing with poll fds */\n\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\tctx->pollfd_modify++;\n\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\n\t/* write some data on control pipe to interrupt event handlers */\n\tr = usbi_write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy));\n\tif (r <= 0) {\n\t\tusbi_warn(ctx, \"internal signalling write failed, closing anyway\");\n\t\tdo_close(ctx, dev_handle);\n\t\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\t\tctx->pollfd_modify--;\n\t\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\t\treturn;\n\t}\n\n\t/* take event handling lock */\n\tlibusb_lock_events(ctx);\n\n\t/* read the dummy data */\n\tr = usbi_read(ctx->ctrl_pipe[0], &dummy, sizeof(dummy));\n\tif (r <= 0)\n\t\tusbi_warn(ctx, \"internal signalling read failed, closing anyway\");\n\n\t/* Close the device */\n\tdo_close(ctx, dev_handle);\n\n\t/* we're done with modifying poll fds */\n\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\tctx->pollfd_modify--;\n\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\n\t/* Release event handling lock and wake up event waiters */\n\tlibusb_unlock_events(ctx);\n}\n\n/** \\ingroup dev\n * Get the underlying device for a handle. This function does not modify\n * the reference count of the returned device, so do not feel compelled to\n * unreference it when you are done.\n * \\param dev_handle a device handle\n * \\returns the underlying device\n */\nDEFAULT_VISIBILITY\nlibusb_device * LIBUSB_CALL libusb_get_device(libusb_device_handle *dev_handle)\n{\n\treturn dev_handle->dev;\n}\n\n/** \\ingroup dev\n * Determine the bConfigurationValue of the currently active configuration.\n *\n * You could formulate your own control request to obtain this information,\n * but this function has the advantage that it may be able to retrieve the\n * information from operating system caches (no I/O involved).\n *\n * If the OS does not cache this information, then this function will block\n * while a control transfer is submitted to retrieve the information.\n *\n * This function will return a value of 0 in the <tt>config</tt> output\n * parameter if the device is in unconfigured state.\n *\n * \\param dev a device handle\n * \\param config output location for the bConfigurationValue of the active\n * configuration (only valid for return code 0)\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failure\n */\nint API_EXPORTED libusb_get_configuration(libusb_device_handle *dev,\n\tint *config)\n{\n\tint r = LIBUSB_ERROR_NOT_SUPPORTED;\n\n\tusbi_dbg(\"\");\n\tif (usbi_backend->get_configuration)\n\t\tr = usbi_backend->get_configuration(dev, config);\n\n\tif (r == LIBUSB_ERROR_NOT_SUPPORTED) {\n\t\tuint8_t tmp = 0;\n\t\tusbi_dbg(\"falling back to control message\");\n\t\tr = libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN,\n\t\t\tLIBUSB_REQUEST_GET_CONFIGURATION, 0, 0, &tmp, 1, 1000);\n\t\tif (r == 0) {\n\t\t\tusbi_err(HANDLE_CTX(dev), \"zero bytes returned in ctrl transfer?\");\n\t\t\tr = LIBUSB_ERROR_IO;\n\t\t} else if (r == 1) {\n\t\t\tr = 0;\n\t\t\t*config = tmp;\n\t\t} else {\n\t\t\tusbi_dbg(\"control failed, error %d\", r);\n\t\t}\n\t}\n\n\tif (r == 0)\n\t\tusbi_dbg(\"active config %d\", *config);\n\n\treturn r;\n}\n\n/** \\ingroup dev\n * Set the active configuration for a device.\n *\n * The operating system may or may not have already set an active\n * configuration on the device. It is up to your application to ensure the\n * correct configuration is selected before you attempt to claim interfaces\n * and perform other operations.\n *\n * If you call this function on a device already configured with the selected\n * configuration, then this function will act as a lightweight device reset:\n * it will issue a SET_CONFIGURATION request using the current configuration,\n * causing most USB-related device state to be reset (altsetting reset to zero,\n * endpoint halts cleared, toggles reset).\n *\n * You cannot change/reset configuration if your application has claimed\n * interfaces. It is advised to set the desired configuration before claiming\n * interfaces.\n *\n * Alternatively you can call libusb_release_interface() first. Note if you\n * do things this way you must ensure that auto_detach_kernel_driver for\n * <tt>dev</tt> is 0, otherwise the kernel driver will be re-attached when you\n * release the interface(s).\n *\n * You cannot change/reset configuration if other applications or drivers have\n * claimed interfaces.\n *\n * A configuration value of -1 will put the device in unconfigured state.\n * The USB specifications state that a configuration value of 0 does this,\n * however buggy devices exist which actually have a configuration 0.\n *\n * You should always use this function rather than formulating your own\n * SET_CONFIGURATION control request. This is because the underlying operating\n * system needs to know when such changes happen.\n *\n * This is a blocking function.\n *\n * \\param dev a device handle\n * \\param configuration the bConfigurationValue of the configuration you\n * wish to activate, or -1 if you wish to put the device in unconfigured state\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the requested configuration does not exist\n * \\returns LIBUSB_ERROR_BUSY if interfaces are currently claimed\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failure\n * \\see libusb_set_auto_detach_kernel_driver()\n */\nint API_EXPORTED libusb_set_configuration(libusb_device_handle *dev,\n\tint configuration)\n{\n\tusbi_dbg(\"configuration %d\", configuration);\n\treturn usbi_backend->set_configuration(dev, configuration);\n}\n\n/** \\ingroup dev\n * Claim an interface on a given device handle. You must claim the interface\n * you wish to use before you can perform I/O on any of its endpoints.\n *\n * It is legal to attempt to claim an already-claimed interface, in which\n * case libusb just returns 0 without doing anything.\n *\n * If auto_detach_kernel_driver is set to 1 for <tt>dev</tt>, the kernel driver\n * will be detached if necessary, on failure the detach error is returned.\n *\n * Claiming of interfaces is a purely logical operation; it does not cause\n * any requests to be sent over the bus. Interface claiming is used to\n * instruct the underlying operating system that your application wishes\n * to take ownership of the interface.\n *\n * This is a non-blocking function.\n *\n * \\param dev a device handle\n * \\param interface_number the <tt>bInterfaceNumber</tt> of the interface you\n * wish to claim\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the requested interface does not exist\n * \\returns LIBUSB_ERROR_BUSY if another program or driver has claimed the\n * interface\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns a LIBUSB_ERROR code on other failure\n * \\see libusb_set_auto_detach_kernel_driver()\n */\nint API_EXPORTED libusb_claim_interface(libusb_device_handle *dev,\n\tint interface_number)\n{\n\tint r = 0;\n\n\tusbi_dbg(\"interface %d\", interface_number);\n\tif (interface_number >= USB_MAXINTERFACES)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\tif (!dev->dev->attached)\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\tusbi_mutex_lock(&dev->lock);\n\tif (dev->claimed_interfaces & (1 << interface_number))\n\t\tgoto out;\n\n\tr = usbi_backend->claim_interface(dev, interface_number);\n\tif (r == 0)\n\t\tdev->claimed_interfaces |= 1 << interface_number;\n\nout:\n\tusbi_mutex_unlock(&dev->lock);\n\treturn r;\n}\n\n/** \\ingroup dev\n * Release an interface previously claimed with libusb_claim_interface(). You\n * should release all claimed interfaces before closing a device handle.\n *\n * This is a blocking function. A SET_INTERFACE control request will be sent\n * to the device, resetting interface state to the first alternate setting.\n *\n * If auto_detach_kernel_driver is set to 1 for <tt>dev</tt>, the kernel\n * driver will be re-attached after releasing the interface.\n *\n * \\param dev a device handle\n * \\param interface_number the <tt>bInterfaceNumber</tt> of the\n * previously-claimed interface\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the interface was not claimed\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failure\n * \\see libusb_set_auto_detach_kernel_driver()\n */\nint API_EXPORTED libusb_release_interface(libusb_device_handle *dev,\n\tint interface_number)\n{\n\tint r;\n\n\tusbi_dbg(\"interface %d\", interface_number);\n\tif (interface_number >= USB_MAXINTERFACES)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\tusbi_mutex_lock(&dev->lock);\n\tif (!(dev->claimed_interfaces & (1 << interface_number))) {\n\t\tr = LIBUSB_ERROR_NOT_FOUND;\n\t\tgoto out;\n\t}\n\n\tr = usbi_backend->release_interface(dev, interface_number);\n\tif (r == 0)\n\t\tdev->claimed_interfaces &= ~(1 << interface_number);\n\nout:\n\tusbi_mutex_unlock(&dev->lock);\n\treturn r;\n}\n\n/** \\ingroup dev\n * Activate an alternate setting for an interface. The interface must have\n * been previously claimed with libusb_claim_interface().\n *\n * You should always use this function rather than formulating your own\n * SET_INTERFACE control request. This is because the underlying operating\n * system needs to know when such changes happen.\n *\n * This is a blocking function.\n *\n * \\param dev a device handle\n * \\param interface_number the <tt>bInterfaceNumber</tt> of the\n * previously-claimed interface\n * \\param alternate_setting the <tt>bAlternateSetting</tt> of the alternate\n * setting to activate\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the interface was not claimed, or the\n * requested alternate setting does not exist\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failure\n */\nint API_EXPORTED libusb_set_interface_alt_setting(libusb_device_handle *dev,\n\tint interface_number, int alternate_setting)\n{\n\tusbi_dbg(\"interface %d altsetting %d\",\n\t\tinterface_number, alternate_setting);\n\tif (interface_number >= USB_MAXINTERFACES)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\tusbi_mutex_lock(&dev->lock);\n\tif (!dev->dev->attached) {\n\t\tusbi_mutex_unlock(&dev->lock);\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t}\n\n\tif (!(dev->claimed_interfaces & (1 << interface_number))) {\n\t\tusbi_mutex_unlock(&dev->lock);\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\tusbi_mutex_unlock(&dev->lock);\n\n\treturn usbi_backend->set_interface_altsetting(dev, interface_number,\n\t\talternate_setting);\n}\n\n/** \\ingroup dev\n * Clear the halt/stall condition for an endpoint. Endpoints with halt status\n * are unable to receive or transmit data until the halt condition is stalled.\n *\n * You should cancel all pending transfers before attempting to clear the halt\n * condition.\n *\n * This is a blocking function.\n *\n * \\param dev a device handle\n * \\param endpoint the endpoint to clear halt status\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failure\n */\nint API_EXPORTED libusb_clear_halt(libusb_device_handle *dev,\n\tunsigned char endpoint)\n{\n\tusbi_dbg(\"endpoint %x\", endpoint);\n\tif (!dev->dev->attached)\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\treturn usbi_backend->clear_halt(dev, endpoint);\n}\n\n/** \\ingroup dev\n * Perform a USB port reset to reinitialize a device. The system will attempt\n * to restore the previous configuration and alternate settings after the\n * reset has completed.\n *\n * If the reset fails, the descriptors change, or the previous state cannot be\n * restored, the device will appear to be disconnected and reconnected. This\n * means that the device handle is no longer valid (you should close it) and\n * rediscover the device. A return code of LIBUSB_ERROR_NOT_FOUND indicates\n * when this is the case.\n *\n * This is a blocking function which usually incurs a noticeable delay.\n *\n * \\param dev a handle of the device to reset\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if re-enumeration is required, or if the\n * device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failure\n */\nint API_EXPORTED libusb_reset_device(libusb_device_handle *dev)\n{\n\tusbi_dbg(\"\");\n\tif (!dev->dev->attached)\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\treturn usbi_backend->reset_device(dev);\n}\n\n/** \\ingroup dev\n * Determine if a kernel driver is active on an interface. If a kernel driver\n * is active, you cannot claim the interface, and libusb will be unable to\n * perform I/O.\n *\n * This functionality is not available on Windows.\n *\n * \\param dev a device handle\n * \\param interface_number the interface to check\n * \\returns 0 if no kernel driver is active\n * \\returns 1 if a kernel driver is active\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality\n * is not available\n * \\returns another LIBUSB_ERROR code on other failure\n * \\see libusb_detach_kernel_driver()\n */\nint API_EXPORTED libusb_kernel_driver_active(libusb_device_handle *dev,\n\tint interface_number)\n{\n\tusbi_dbg(\"interface %d\", interface_number);\n\n\tif (!dev->dev->attached)\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\tif (usbi_backend->kernel_driver_active)\n\t\treturn usbi_backend->kernel_driver_active(dev, interface_number);\n\telse\n\t\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n}\n\n/** \\ingroup dev\n * Detach a kernel driver from an interface. If successful, you will then be\n * able to claim the interface and perform I/O.\n *\n * This functionality is not available on Darwin or Windows.\n *\n * Note that libusb itself also talks to the device through a special kernel\n * driver, if this driver is already attached to the device, this call will\n * not detach it and return LIBUSB_ERROR_NOT_FOUND.\n *\n * \\param dev a device handle\n * \\param interface_number the interface to detach the driver from\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if no kernel driver was active\n * \\returns LIBUSB_ERROR_INVALID_PARAM if the interface does not exist\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality\n * is not available\n * \\returns another LIBUSB_ERROR code on other failure\n * \\see libusb_kernel_driver_active()\n */\nint API_EXPORTED libusb_detach_kernel_driver(libusb_device_handle *dev,\n\tint interface_number)\n{\n\tusbi_dbg(\"interface %d\", interface_number);\n\n\tif (!dev->dev->attached)\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\tif (usbi_backend->detach_kernel_driver)\n\t\treturn usbi_backend->detach_kernel_driver(dev, interface_number);\n\telse\n\t\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n}\n\n/** \\ingroup dev\n * Re-attach an interface's kernel driver, which was previously detached\n * using libusb_detach_kernel_driver(). This call is only effective on\n * Linux and returns LIBUSB_ERROR_NOT_SUPPORTED on all other platforms.\n *\n * This functionality is not available on Darwin or Windows.\n *\n * \\param dev a device handle\n * \\param interface_number the interface to attach the driver from\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if no kernel driver was active\n * \\returns LIBUSB_ERROR_INVALID_PARAM if the interface does not exist\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality\n * is not available\n * \\returns LIBUSB_ERROR_BUSY if the driver cannot be attached because the\n * interface is claimed by a program or driver\n * \\returns another LIBUSB_ERROR code on other failure\n * \\see libusb_kernel_driver_active()\n */\nint API_EXPORTED libusb_attach_kernel_driver(libusb_device_handle *dev,\n\tint interface_number)\n{\n\tusbi_dbg(\"interface %d\", interface_number);\n\n\tif (!dev->dev->attached)\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\tif (usbi_backend->attach_kernel_driver)\n\t\treturn usbi_backend->attach_kernel_driver(dev, interface_number);\n\telse\n\t\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n}\n\n/** \\ingroup dev\n * Enable/disable libusb's automatic kernel driver detachment. When this is\n * enabled libusb will automatically detach the kernel driver on an interface\n * when claiming the interface, and attach it when releasing the interface.\n *\n * Automatic kernel driver detachment is disabled on newly opened device\n * handles by default.\n *\n * On platforms which do not have LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER\n * this function will return LIBUSB_ERROR_NOT_SUPPORTED, and libusb will\n * continue as if this function was never called.\n *\n * \\param dev a device handle\n * \\param enable whether to enable or disable auto kernel driver detachment\n *\n * \\returns LIBUSB_SUCCESS on success\n * \\returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality\n * is not available\n * \\see libusb_claim_interface()\n * \\see libusb_release_interface()\n * \\see libusb_set_configuration()\n */\nint API_EXPORTED libusb_set_auto_detach_kernel_driver(\n\tlibusb_device_handle *dev, int enable)\n{\n\tif (!(usbi_backend->caps & USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER))\n\t\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n\n\tdev->auto_detach_kernel_driver = enable;\n\treturn LIBUSB_SUCCESS;\n}\n\n/** \\ingroup lib\n * Set log message verbosity.\n *\n * The default level is LIBUSB_LOG_LEVEL_NONE, which means no messages are ever\n * printed. If you choose to increase the message verbosity level, ensure\n * that your application does not close the stdout/stderr file descriptors.\n *\n * You are advised to use level LIBUSB_LOG_LEVEL_WARNING. libusb is conservative\n * with its message logging and most of the time, will only log messages that\n * explain error conditions and other oddities. This will help you debug\n * your software.\n *\n * If the LIBUSB_DEBUG environment variable was set when libusb was\n * initialized, this function does nothing: the message verbosity is fixed\n * to the value in the environment variable.\n *\n * If libusb was compiled without any message logging, this function does\n * nothing: you'll never get any messages.\n *\n * If libusb was compiled with verbose debug message logging, this function\n * does nothing: you'll always get messages from all levels.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param level debug level to set\n */\nvoid API_EXPORTED libusb_set_debug(libusb_context *ctx, int level)\n{\n\tUSBI_GET_CONTEXT(ctx);\n\tif (!ctx->debug_fixed)\n\t\tctx->debug = level;\n}\n\n/** \\ingroup lib\n * Initialize libusb. This function must be called before calling any other\n * libusb function.\n *\n * If you do not provide an output location for a context pointer, a default\n * context will be created. If there was already a default context, it will\n * be reused (and nothing will be initialized/reinitialized).\n *\n * \\param context Optional output location for context pointer.\n * Only valid on return code 0.\n * \\returns 0 on success, or a LIBUSB_ERROR code on failure\n * \\see contexts\n */\nint API_EXPORTED libusb_init(libusb_context **context)\n{\n\tstruct libusb_device *dev, *next;\n\tchar *dbg = getenv(\"LIBUSB_DEBUG\");\n\tstruct libusb_context *ctx;\n\tstatic int first_init = 1;\n\tint r = 0;\n\n\tusbi_mutex_static_lock(&default_context_lock);\n\n\tif (!timestamp_origin.tv_sec) {\n\t\tusbi_gettimeofday(&timestamp_origin, NULL);\n\t}\n\n\tif (!context && usbi_default_context) {\n\t\tusbi_dbg(\"reusing default context\");\n\t\tdefault_context_refcnt++;\n\t\tusbi_mutex_static_unlock(&default_context_lock);\n\t\treturn 0;\n\t}\n\n\tctx = calloc(1, sizeof(*ctx));\n\tif (!ctx) {\n\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\tgoto err_unlock;\n\t}\n\n#ifdef ENABLE_DEBUG_LOGGING\n\tctx->debug = LIBUSB_LOG_LEVEL_DEBUG;\n#endif\n\n\tif (dbg) {\n\t\tctx->debug = atoi(dbg);\n\t\tif (ctx->debug)\n\t\t\tctx->debug_fixed = 1;\n\t}\n\n\t/* default context should be initialized before calling usbi_dbg */\n\tif (!usbi_default_context) {\n\t\tusbi_default_context = ctx;\n\t\tdefault_context_refcnt++;\n\t\tusbi_dbg(\"created default context\");\n\t}\n\n\tusbi_dbg(\"libusb v%d.%d.%d.%d\", libusb_version_internal.major, libusb_version_internal.minor,\n\t\tlibusb_version_internal.micro, libusb_version_internal.nano);\n\n\tusbi_mutex_init(&ctx->usb_devs_lock, NULL);\n\tusbi_mutex_init(&ctx->open_devs_lock, NULL);\n\tusbi_mutex_init(&ctx->hotplug_cbs_lock, NULL);\n\tlist_init(&ctx->usb_devs);\n\tlist_init(&ctx->open_devs);\n\tlist_init(&ctx->hotplug_cbs);\n\n\tusbi_mutex_static_lock(&active_contexts_lock);\n\tif (first_init) {\n\t\tfirst_init = 0;\n\t\tlist_init (&active_contexts_list);\n\t}\n\tlist_add (&ctx->list, &active_contexts_list);\n\tusbi_mutex_static_unlock(&active_contexts_lock);\n\n\tif (usbi_backend->init) {\n\t\tr = usbi_backend->init(ctx);\n\t\tif (r)\n\t\t\tgoto err_free_ctx;\n\t}\n\n\tr = usbi_io_init(ctx);\n\tif (r < 0)\n\t\tgoto err_backend_exit;\n\n\tusbi_mutex_static_unlock(&default_context_lock);\n\n\tif (context)\n\t\t*context = ctx;\n\n\treturn 0;\n\nerr_backend_exit:\n\tif (usbi_backend->exit)\n\t\tusbi_backend->exit();\nerr_free_ctx:\n\tif (ctx == usbi_default_context)\n\t\tusbi_default_context = NULL;\n\n\tusbi_mutex_static_lock(&active_contexts_lock);\n\tlist_del (&ctx->list);\n\tusbi_mutex_static_unlock(&active_contexts_lock);\n\n\tusbi_mutex_lock(&ctx->usb_devs_lock);\n\tlist_for_each_entry_safe(dev, next, &ctx->usb_devs, list, struct libusb_device) {\n\t\tlist_del(&dev->list);\n\t\tlibusb_unref_device(dev);\n\t}\n\tusbi_mutex_unlock(&ctx->usb_devs_lock);\n\n\tusbi_mutex_destroy(&ctx->open_devs_lock);\n\tusbi_mutex_destroy(&ctx->usb_devs_lock);\n\tusbi_mutex_destroy(&ctx->hotplug_cbs_lock);\n\n\tfree(ctx);\nerr_unlock:\n\tusbi_mutex_static_unlock(&default_context_lock);\n\treturn r;\n}\n\n/** \\ingroup lib\n * Deinitialize libusb. Should be called after closing all open devices and\n * before your application terminates.\n * \\param ctx the context to deinitialize, or NULL for the default context\n */\nvoid API_EXPORTED libusb_exit(struct libusb_context *ctx)\n{\n\tstruct libusb_device *dev, *next;\n\tstruct timeval tv = { 0, 0 };\n\n\tusbi_dbg(\"\");\n\tUSBI_GET_CONTEXT(ctx);\n\n\t/* if working with default context, only actually do the deinitialization\n\t * if we're the last user */\n\tusbi_mutex_static_lock(&default_context_lock);\n\tif (ctx == usbi_default_context) {\n\t\tif (--default_context_refcnt > 0) {\n\t\t\tusbi_dbg(\"not destroying default context\");\n\t\t\tusbi_mutex_static_unlock(&default_context_lock);\n\t\t\treturn;\n\t\t}\n\t\tusbi_dbg(\"destroying default context\");\n\t\tusbi_default_context = NULL;\n\t}\n\tusbi_mutex_static_unlock(&default_context_lock);\n\n\tusbi_mutex_static_lock(&active_contexts_lock);\n\tlist_del (&ctx->list);\n\tusbi_mutex_static_unlock(&active_contexts_lock);\n\n\tif (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {\n\t\tusbi_hotplug_deregister_all(ctx);\n\n\t\t/*\n\t\t * Ensure any pending unplug events are read from the hotplug\n\t\t * pipe. The usb_device-s hold in the events are no longer part\n\t\t * of usb_devs, but the events still hold a reference!\n\t\t *\n\t\t * Note we don't do this if the application has left devices\n\t\t * open (which implies a buggy app) to avoid packet completion\n\t\t * handlers running when the app does not expect them to run.\n\t\t */\n\t\tif (list_empty(&ctx->open_devs))\n\t\t\tlibusb_handle_events_timeout(ctx, &tv);\n\n\t\tusbi_mutex_lock(&ctx->usb_devs_lock);\n\t\tlist_for_each_entry_safe(dev, next, &ctx->usb_devs, list, struct libusb_device) {\n\t\t\tlist_del(&dev->list);\n\t\t\tlibusb_unref_device(dev);\n\t\t}\n\t\tusbi_mutex_unlock(&ctx->usb_devs_lock);\n\t}\n\n\t/* a few sanity checks. don't bother with locking because unless\n\t * there is an application bug, nobody will be accessing these. */\n\tif (!list_empty(&ctx->usb_devs))\n\t\tusbi_warn(ctx, \"some libusb_devices were leaked\");\n\tif (!list_empty(&ctx->open_devs))\n\t\tusbi_warn(ctx, \"application left some devices open\");\n\n\tusbi_io_exit(ctx);\n\tif (usbi_backend->exit)\n\t\tusbi_backend->exit();\n\n\tusbi_mutex_destroy(&ctx->open_devs_lock);\n\tusbi_mutex_destroy(&ctx->usb_devs_lock);\n\tusbi_mutex_destroy(&ctx->hotplug_cbs_lock);\n\tfree(ctx);\n}\n\n/** \\ingroup misc\n * Check at runtime if the loaded library has a given capability.\n * This call should be performed after \\ref libusb_init(), to ensure the\n * backend has updated its capability set.\n *\n * \\param capability the \\ref libusb_capability to check for\n * \\returns nonzero if the running library has the capability, 0 otherwise\n */\nint API_EXPORTED libusb_has_capability(uint32_t capability)\n{\n\tswitch (capability) {\n\tcase LIBUSB_CAP_HAS_CAPABILITY:\n\t\treturn 1;\n\tcase LIBUSB_CAP_HAS_HOTPLUG:\n\t\treturn !(usbi_backend->get_device_list);\n\tcase LIBUSB_CAP_HAS_HID_ACCESS:\n\t\treturn (usbi_backend->caps & USBI_CAP_HAS_HID_ACCESS);\n\tcase LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER:\n\t\treturn (usbi_backend->caps & USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER);\n\t}\n\treturn 0;\n}\n\n/* this is defined in libusbi.h if needed */\n#ifdef LIBUSB_GETTIMEOFDAY_WIN32\n/*\n * gettimeofday\n * Implementation according to:\n * The Open Group Base Specifications Issue 6\n * IEEE Std 1003.1, 2004 Edition\n */\n\n/*\n *  THIS SOFTWARE IS NOT COPYRIGHTED\n *\n *  This source code is offered for use in the public domain. You may\n *  use, modify or distribute it freely.\n *\n *  This code is distributed in the hope that it will be useful but\n *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY\n *  DISCLAIMED. This includes but is not limited to warranties of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n *\n *  Contributed by:\n *  Danny Smith <dannysmith@users.sourceforge.net>\n */\n\n/* Offset between 1/1/1601 and 1/1/1970 in 100 nanosec units */\n#define _W32_FT_OFFSET (116444736000000000)\n\nint usbi_gettimeofday(struct timeval *tp, void *tzp)\n{\n\tunion {\n\t\tunsigned __int64 ns100; /* Time since 1 Jan 1601, in 100ns units */\n\t\tFILETIME ft;\n\t} _now;\n\tUNUSED(tzp);\n\n\tif(tp) {\n#if defined(OS_WINCE)\n\t\tSYSTEMTIME st;\n\t\tGetSystemTime(&st);\n\t\tSystemTimeToFileTime(&st, &_now.ft);\n#else\n\t\tGetSystemTimeAsFileTime (&_now.ft);\n#endif\n\t\ttp->tv_usec=(long)((_now.ns100 / 10) % 1000000 );\n\t\ttp->tv_sec= (long)((_now.ns100 - _W32_FT_OFFSET) / 10000000);\n\t}\n\t/* Always return 0 as per Open Group Base Specifications Issue 6.\n\t   Do not set errno on error.  */\n\treturn 0;\n}\n#endif\n\nstatic void usbi_log_str(struct libusb_context *ctx,\n\tenum libusb_log_level level, const char * str)\n{\n#if defined(USE_SYSTEM_LOGGING_FACILITY)\n#if defined(OS_WINDOWS) || defined(OS_WINCE)\n\t/* Windows CE only supports the Unicode version of OutputDebugString. */\n\tWCHAR wbuf[USBI_MAX_LOG_LEN];\n\tMultiByteToWideChar(CP_UTF8, 0, str, -1, wbuf, sizeof(wbuf));\n\tOutputDebugStringW(wbuf);\n#elif defined(__ANDROID__)\n\tint priority = ANDROID_LOG_UNKNOWN;\n\tswitch (level) {\n\tcase LIBUSB_LOG_LEVEL_INFO: priority = ANDROID_LOG_INFO; break;\n\tcase LIBUSB_LOG_LEVEL_WARNING: priority = ANDROID_LOG_WARN; break;\n\tcase LIBUSB_LOG_LEVEL_ERROR: priority = ANDROID_LOG_ERROR; break;\n\tcase LIBUSB_LOG_LEVEL_DEBUG: priority = ANDROID_LOG_DEBUG; break;\n\t}\n\t__android_log_write(priority, \"libusb\", str);\n#elif defined(HAVE_SYSLOG_FUNC)\n\tint syslog_level = LOG_INFO;\n\tswitch (level) {\n\tcase LIBUSB_LOG_LEVEL_INFO: syslog_level = LOG_INFO; break;\n\tcase LIBUSB_LOG_LEVEL_WARNING: syslog_level = LOG_WARNING; break;\n\tcase LIBUSB_LOG_LEVEL_ERROR: syslog_level = LOG_ERR; break;\n\tcase LIBUSB_LOG_LEVEL_DEBUG: syslog_level = LOG_DEBUG; break;\n\t}\n\tsyslog(syslog_level, \"%s\", str);\n#else /* All of gcc, Clang, XCode seem to use #warning */\n#warning System logging is not supported on this platform. Logging to stderr will be used instead.\n\tfputs(str, stderr);\n#endif\n#else\n\tfputs(str, stderr);\n#endif /* USE_SYSTEM_LOGGING_FACILITY */\n\tUNUSED(ctx);\n\tUNUSED(level);\n}\n\nvoid usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level,\n\tconst char *function, const char *format, va_list args)\n{\n\tconst char *prefix = \"\";\n\tchar buf[USBI_MAX_LOG_LEN];\n\tstruct timeval now;\n\tint global_debug, header_len, text_len;\n\tstatic int has_debug_header_been_displayed = 0;\n\n#ifdef ENABLE_DEBUG_LOGGING\n\tglobal_debug = 1;\n\tUNUSED(ctx);\n#else\n\tint ctx_level = 0;\n\n\tUSBI_GET_CONTEXT(ctx);\n\tif (ctx) {\n\t\tctx_level = ctx->debug;\n\t} else {\n\t\tchar *dbg = getenv(\"LIBUSB_DEBUG\");\n\t\tif (dbg)\n\t\t\tctx_level = atoi(dbg);\n\t}\n\tglobal_debug = (ctx_level == LIBUSB_LOG_LEVEL_DEBUG);\n\tif (!ctx_level)\n\t\treturn;\n\tif (level == LIBUSB_LOG_LEVEL_WARNING && ctx_level < LIBUSB_LOG_LEVEL_WARNING)\n\t\treturn;\n\tif (level == LIBUSB_LOG_LEVEL_INFO && ctx_level < LIBUSB_LOG_LEVEL_INFO)\n\t\treturn;\n\tif (level == LIBUSB_LOG_LEVEL_DEBUG && ctx_level < LIBUSB_LOG_LEVEL_DEBUG)\n\t\treturn;\n#endif\n\n\tusbi_gettimeofday(&now, NULL);\n\tif ((global_debug) && (!has_debug_header_been_displayed)) {\n\t\thas_debug_header_been_displayed = 1;\n\t\tusbi_log_str(ctx, LIBUSB_LOG_LEVEL_DEBUG, \"[timestamp] [threadID] facility level [function call] <message>\\n\");\n\t\tusbi_log_str(ctx, LIBUSB_LOG_LEVEL_DEBUG, \"--------------------------------------------------------------------------------\\n\");\n\t}\n\tif (now.tv_usec < timestamp_origin.tv_usec) {\n\t\tnow.tv_sec--;\n\t\tnow.tv_usec += 1000000;\n\t}\n\tnow.tv_sec -= timestamp_origin.tv_sec;\n\tnow.tv_usec -= timestamp_origin.tv_usec;\n\n\tswitch (level) {\n\tcase LIBUSB_LOG_LEVEL_INFO:\n\t\tprefix = \"info\";\n\t\tbreak;\n\tcase LIBUSB_LOG_LEVEL_WARNING:\n\t\tprefix = \"warning\";\n\t\tbreak;\n\tcase LIBUSB_LOG_LEVEL_ERROR:\n\t\tprefix = \"error\";\n\t\tbreak;\n\tcase LIBUSB_LOG_LEVEL_DEBUG:\n\t\tprefix = \"debug\";\n\t\tbreak;\n\tcase LIBUSB_LOG_LEVEL_NONE:\n\t\treturn;\n\tdefault:\n\t\tprefix = \"unknown\";\n\t\tbreak;\n\t}\n\n\tif (global_debug) {\n\t\theader_len = snprintf(buf, sizeof(buf),\n\t\t\t\"[%2d.%06d] [%08x] libusb: %s [%s] \",\n\t\t\t(int)now.tv_sec, (int)now.tv_usec, usbi_get_tid(), prefix, function);\n\t} else {\n\t\theader_len = snprintf(buf, sizeof(buf),\n\t\t\t\"libusb: %s [%s] \", prefix, function);\n\t}\n\n\tif (header_len < 0 || header_len >= sizeof(buf)) {\n\t\t/* Somehow snprintf failed to write to the buffer,\n\t\t * remove the header so something useful is output. */\n\t\theader_len = 0;\n\t}\n\t/* Make sure buffer is NUL terminated */\n\tbuf[header_len] = '\\0';\n\ttext_len = vsnprintf(buf + header_len, sizeof(buf) - header_len,\n\t\tformat, args);\n\tif (text_len < 0 || text_len + header_len >= sizeof(buf)) {\n\t\t/* Truncated log output. On some platforms a -1 return value means\n\t\t * that the output was truncated. */\n\t\ttext_len = sizeof(buf) - header_len;\n\t}\n\tif (header_len + text_len + sizeof(USBI_LOG_LINE_END) >= sizeof(buf)) {\n\t\t/* Need to truncate the text slightly to fit on the terminator. */\n\t\ttext_len -= (header_len + text_len + sizeof(USBI_LOG_LINE_END)) - sizeof(buf);\n\t}\n\tstrcpy(buf + header_len + text_len, USBI_LOG_LINE_END);\n\n\tusbi_log_str(ctx, level, buf);\n}\n\nvoid usbi_log(struct libusb_context *ctx, enum libusb_log_level level,\n\tconst char *function, const char *format, ...)\n{\n\tva_list args;\n\n\tva_start (args, format);\n\tusbi_log_v(ctx, level, function, format, args);\n\tva_end (args);\n}\n\n/** \\ingroup misc\n * Returns a constant NULL-terminated string with the ASCII name of a libusb\n * error or transfer status code. The caller must not free() the returned\n * string.\n *\n * \\param error_code The \\ref libusb_error or libusb_transfer_status code to\n * return the name of.\n * \\returns The error name, or the string **UNKNOWN** if the value of\n * error_code is not a known error / status code.\n */\nDEFAULT_VISIBILITY const char * LIBUSB_CALL libusb_error_name(int error_code)\n{\n\tswitch (error_code) {\n\tcase LIBUSB_ERROR_IO:\n\t\treturn \"LIBUSB_ERROR_IO\";\n\tcase LIBUSB_ERROR_INVALID_PARAM:\n\t\treturn \"LIBUSB_ERROR_INVALID_PARAM\";\n\tcase LIBUSB_ERROR_ACCESS:\n\t\treturn \"LIBUSB_ERROR_ACCESS\";\n\tcase LIBUSB_ERROR_NO_DEVICE:\n\t\treturn \"LIBUSB_ERROR_NO_DEVICE\";\n\tcase LIBUSB_ERROR_NOT_FOUND:\n\t\treturn \"LIBUSB_ERROR_NOT_FOUND\";\n\tcase LIBUSB_ERROR_BUSY:\n\t\treturn \"LIBUSB_ERROR_BUSY\";\n\tcase LIBUSB_ERROR_TIMEOUT:\n\t\treturn \"LIBUSB_ERROR_TIMEOUT\";\n\tcase LIBUSB_ERROR_OVERFLOW:\n\t\treturn \"LIBUSB_ERROR_OVERFLOW\";\n\tcase LIBUSB_ERROR_PIPE:\n\t\treturn \"LIBUSB_ERROR_PIPE\";\n\tcase LIBUSB_ERROR_INTERRUPTED:\n\t\treturn \"LIBUSB_ERROR_INTERRUPTED\";\n\tcase LIBUSB_ERROR_NO_MEM:\n\t\treturn \"LIBUSB_ERROR_NO_MEM\";\n\tcase LIBUSB_ERROR_NOT_SUPPORTED:\n\t\treturn \"LIBUSB_ERROR_NOT_SUPPORTED\";\n\tcase LIBUSB_ERROR_OTHER:\n\t\treturn \"LIBUSB_ERROR_OTHER\";\n\n\tcase LIBUSB_TRANSFER_ERROR:\n\t\treturn \"LIBUSB_TRANSFER_ERROR\";\n\tcase LIBUSB_TRANSFER_TIMED_OUT:\n\t\treturn \"LIBUSB_TRANSFER_TIMED_OUT\";\n\tcase LIBUSB_TRANSFER_CANCELLED:\n\t\treturn \"LIBUSB_TRANSFER_CANCELLED\";\n\tcase LIBUSB_TRANSFER_STALL:\n\t\treturn \"LIBUSB_TRANSFER_STALL\";\n\tcase LIBUSB_TRANSFER_NO_DEVICE:\n\t\treturn \"LIBUSB_TRANSFER_NO_DEVICE\";\n\tcase LIBUSB_TRANSFER_OVERFLOW:\n\t\treturn \"LIBUSB_TRANSFER_OVERFLOW\";\n\n\tcase 0:\n\t\treturn \"LIBUSB_SUCCESS / LIBUSB_TRANSFER_COMPLETED\";\n\tdefault:\n\t\treturn \"**UNKNOWN**\";\n\t}\n}\n\n/** \\ingroup misc\n * Returns a pointer to const struct libusb_version with the version\n * (major, minor, micro, nano and rc) of the running library.\n */\nDEFAULT_VISIBILITY\nconst struct libusb_version * LIBUSB_CALL libusb_get_version(void)\n{\n\treturn &libusb_version_internal;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/descriptor.c",
    "content": "/**\n * modified to improve compatibility with some cameras.\n * Copyright(c) 2014 saki saki@serenegiant.com\n */\n/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */\n/*\n * USB descriptor handling functions for libusb\n * Copyright © 2007 Daniel Drake <dsd@gentoo.org>\n * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <errno.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"libusbi.h\"\n\n// comment out because duplicate definitions already exit in libusb.h\n//#define DESC_HEADER_LENGTH\t\t\t2\t// XXX this is same as LIBUSB_DT_HEADER_SIZE in libusb.h\n//#define DEVICE_DESC_LENGTH\t\t\t18\t// XXX this is same as LIBUSB_DT_DEVICE_SIZE in libusb.h\n//#define CONFIG_DESC_LENGTH\t\t\t9\t// XXX this is same as LIBUSB_DT_CONFIG_SIZE in libusb.h\n//#define INTERFACE_DESC_LENGTH\t\t\t9\t// XXX this is same as LIBUSB_DT_INTERFACE_SIZE in libusb.h\n//#define ENDPOINT_DESC_LENGTH\t\t\t7\t// XXX this is same as LIBUSB_DT_ENDPOINT_SIZE in libusb.h\n//#define ENDPOINT_AUDIO_DESC_LENGTH\t9\t// XXX this is same as LIBUSB_DT_ENDPOINT_AUDIO_SIZE in libusb.h\n//#define ASSOCIATION_DESC_LENGTH\t\t8\t// XXX this is same as LIBUSB_DT_ASSOCIATION_SIZE in libusb.h\n\n/** @defgroup desc USB descriptors\n * This page details how to examine the various standard USB descriptors\n * for detected devices\n */\n\nstatic inline int is_known_descriptor_type(int type) {\n\treturn ((type == LIBUSB_DT_ENDPOINT)\n\t\t|| (type == LIBUSB_DT_INTERFACE)\n\t\t|| (type == LIBUSB_DT_CONFIG)\n\t\t|| (type == LIBUSB_DT_DEVICE)\n\t\t|| (type == LIBUSB_DT_ASSOCIATION) );\n}\n\n/* set host_endian if the w values are already in host endian format,\n * as opposed to bus endian. */\nint usbi_parse_descriptor(const unsigned char *source, const char *descriptor,\n\tvoid *dest, int host_endian)\n{\n\tconst unsigned char *sp = source;\n\tunsigned char *dp = dest;\n\tuint16_t w;\n\tconst char *cp;\n\tuint32_t d;\n\n\tfor (cp = descriptor; *cp; cp++) {\n\t\tswitch (*cp) {\n\t\t\tcase 'b':\t/* 8-bit byte */\n\t\t\t\t*dp++ = *sp++;\n\t\t\t\tbreak;\n\t\t\tcase 'w':\t/* 16-bit word, convert from little endian to CPU */\n\t\t\t\tdp += ((uintptr_t)dp & 1);\t/* Align to word boundary */\n\n\t\t\t\tif (host_endian) {\n\t\t\t\t\tmemcpy(dp, sp, 2);\n\t\t\t\t} else {\n\t\t\t\t\tw = (sp[1] << 8) | sp[0];\n\t\t\t\t\t*((uint16_t *)dp) = w;\n\t\t\t\t}\n\t\t\t\tsp += 2;\n\t\t\t\tdp += 2;\n\t\t\t\tbreak;\n\t\t\tcase 'd':\t/* 32-bit word, convert from little endian to CPU */\n\t\t\t\tdp += ((uintptr_t)dp & 1);\t/* Align to word boundary */\n\n\t\t\t\tif (host_endian) {\n\t\t\t\t\tmemcpy(dp, sp, 4);\n\t\t\t\t} else {\n\t\t\t\t\td = (sp[3] << 24) | (sp[2] << 16) |\n\t\t\t\t\t\t(sp[1] << 8) | sp[0];\n\t\t\t\t\t*((uint32_t *)dp) = d;\n\t\t\t\t}\n\t\t\t\tsp += 4;\n\t\t\t\tdp += 4;\n\t\t\t\tbreak;\n\t\t\tcase 'u':\t/* 16 byte UUID */\n\t\t\t\tmemcpy(dp, sp, 16);\n\t\t\t\tsp += 16;\n\t\t\t\tdp += 16;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn (int) (sp - source);\n}\n\nstatic void clear_endpoint(struct libusb_endpoint_descriptor *endpoint)\n{\n\tif LIKELY(endpoint && endpoint->extra) {\n\t\tfree((unsigned char *) endpoint->extra);\n\t\tendpoint->extra = NULL; // XXX\n\t\tendpoint->extra_length = 0;\n\t}\n}\n\nstatic int parse_endpoint(struct libusb_context *ctx,\n\tstruct libusb_endpoint_descriptor *endpoint, unsigned char *buffer,\n\tint size, int host_endian)\n{\n\tENTER();\n\n\tstruct usb_descriptor_header header;\n\tunsigned char *extra;\n\tunsigned char *begin;\n\tint parsed = 0;\n\tint len;\n\n\tif UNLIKELY(size < LIBUSB_DT_HEADER_SIZE/*DESC_HEADER_LENGTH*/) {\n\t\tusbi_err(ctx, \"short endpoint descriptor read %d/%d\",\n\t\t\t size, LIBUSB_DT_HEADER_SIZE/*DESC_HEADER_LENGTH*/);\n\t\tRETURN(LIBUSB_ERROR_IO, int);\n\t}\n\n\tusbi_parse_descriptor(buffer, \"bb\", &header, 0);\n\tif UNLIKELY(header.bDescriptorType != LIBUSB_DT_ENDPOINT) {\n\t\tusbi_err(ctx, \"unexpected descriptor %x (expected %x)\",\n\t\t\theader.bDescriptorType, LIBUSB_DT_ENDPOINT);\n\t\tRETURN(parsed, int);\n\t}\n\tif UNLIKELY(header.bLength > size) {\n\t\tusbi_warn(ctx, \"short endpoint descriptor read %d/%d\",\n\t\t\t  size, header.bLength);\n\t\tRETURN(parsed, int);\n\t}\n\tif (header.bLength >= LIBUSB_DT_ENDPOINT_AUDIO_SIZE/*ENDPOINT_AUDIO_DESC_LENGTH*/)\n\t\tusbi_parse_descriptor(buffer, \"bbbbwbbb\", endpoint, host_endian);\n\telse if (header.bLength >= LIBUSB_DT_ENDPOINT_SIZE/*ENDPOINT_DESC_LENGTH*/)\n\t\tusbi_parse_descriptor(buffer, \"bbbbwb\", endpoint, host_endian);\n\telse {\n\t\tusbi_err(ctx, \"invalid endpoint bLength (%d)\", header.bLength);\n\t\tRETURN(LIBUSB_ERROR_IO, int);\n\t}\n\n\tbuffer += header.bLength;\n\tsize -= header.bLength;\n\tparsed += header.bLength;\n\n\t/* Skip over the rest of the Class Specific or Vendor Specific */\n\t/*  descriptors */\n\tbegin = buffer;\n\twhile (size >= LIBUSB_DT_HEADER_SIZE/*DESC_HEADER_LENGTH*/) {\n\t\tusbi_parse_descriptor(buffer, \"bb\", &header, 0);\n\t\tif UNLIKELY(header.bLength < LIBUSB_DT_HEADER_SIZE/*DESC_HEADER_LENGTH*/) {\n\t\t\tusbi_err(ctx, \"invalid extra ep desc len (%d)\",\n\t\t\t\t header.bLength);\n\t\t\tRETURN(LIBUSB_ERROR_IO, int);\n\t\t} else if (header.bLength > size) {\n\t\t\tusbi_warn(ctx, \"short extra ep desc read %d/%d\",\n\t\t\t\t  size, header.bLength);\n\t\t\tRETURN(parsed, int);\n\t\t}\n\n\t\t/* If we find another \"proper\" descriptor then we're done  */\n\t\tif (is_known_descriptor_type(header.bDescriptorType))\n\t\t\tbreak;\n\n\t\tusbi_dbg(\"skipping descriptor 0x%02x\", header.bDescriptorType);\n\t\tbuffer += header.bLength;\n\t\tsize -= header.bLength;\n\t\tparsed += header.bLength;\n\t}\n\n\t/* Copy any unknown descriptors into a storage area for drivers */\n\t/*  to later parse */\n\tlen = (int)(buffer - begin);\n\tif (!len) {\n\t\tendpoint->extra = NULL;\n\t\tendpoint->extra_length = 0;\n\t\tRETURN(parsed, int);\n\t}\n\n\tendpoint->extra = extra = malloc(len);\n\tif UNLIKELY(!extra) {\n\t\tendpoint->extra_length = 0;\n\t\tRETURN(LIBUSB_ERROR_NO_MEM, int);\n\t}\n\n\tmemcpy(extra, begin, len);\n\tendpoint->extra_length = len;\n\n\tRETURN(parsed, int);\n}\n\nstatic void clear_interface(struct libusb_interface *usb_interface)\n{\n\tint i;\n\tint j;\n\n\tif (usb_interface->altsetting) {\n\t\tfor (i = 0; i < usb_interface->num_altsetting; i++) {\n\t\t\tstruct libusb_interface_descriptor *ifp =\n\t\t\t\t(struct libusb_interface_descriptor *)\n\t\t\t\tusb_interface->altsetting + i;\n\t\t\tif (ifp->extra)\n\t\t\t\tfree((void *) ifp->extra);\n\t\t\tif (ifp->endpoint) {\n\t\t\t\tfor (j = 0; j < ifp->bNumEndpoints; j++)\n\t\t\t\t\tclear_endpoint((struct libusb_endpoint_descriptor *)\n\t\t\t\t\t\tifp->endpoint + j);\n\t\t\t\tfree((void *) ifp->endpoint);\n\t\t\t}\n\t\t}\n\t\tfree((void *) usb_interface->altsetting);\n\t\tusb_interface->altsetting = NULL;\n\t}\n\n}\n\nstatic int parse_interface(libusb_context *ctx,\n\tstruct libusb_interface *usb_interface, unsigned char *buffer, int size,\n\tint host_endian)\n{\n\tENTER();\n\n\tint i;\n\tint len;\n\tint r;\n\tint parsed = 0;\n\tint interface_number = -1;\n\tsize_t tmp;\n\tstruct usb_descriptor_header header;\n\tstruct libusb_interface_descriptor *ifp;\n\tunsigned char *begin;\n\n\tusb_interface->num_altsetting = 0;\n\n\twhile (size >= LIBUSB_DT_INTERFACE_SIZE/*INTERFACE_DESC_LENGTH*/) {\n\t\tstruct libusb_interface_descriptor *altsetting =\n\t\t\t(struct libusb_interface_descriptor *) usb_interface->altsetting;\n\t\taltsetting = usbi_reallocf(altsetting,\n\t\t\tsizeof(struct libusb_interface_descriptor) * (usb_interface->num_altsetting + 1));\n\t\tif UNLIKELY(!altsetting) {\n\t\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\t\tgoto err;\n\t\t}\n\t\tusb_interface->altsetting = altsetting;\n\n\t\tifp = altsetting + usb_interface->num_altsetting;\n\t\tusbi_parse_descriptor(buffer, \"bbbbbbbbb\", ifp, 0);\n\t\tif UNLIKELY(ifp->bDescriptorType != LIBUSB_DT_INTERFACE) {\n\t\t\tusbi_err(ctx, \"unexpected descriptor %x (expected %x)\",\n\t\t\t\t ifp->bDescriptorType, LIBUSB_DT_INTERFACE);\n\t\t\tRETURN(parsed, int);\n\t\t}\n\t\tif UNLIKELY(ifp->bLength < LIBUSB_DT_INTERFACE_SIZE/*INTERFACE_DESC_LENGTH*/) {\n\t\t\tusbi_err(ctx, \"invalid interface bLength (%d)\",\n\t\t\t\t ifp->bLength);\n\t\t\tr = LIBUSB_ERROR_IO;\n\t\t\tgoto err;\n\t\t}\n\t\tif UNLIKELY(ifp->bLength > size) {\n\t\t\tusbi_warn(ctx, \"short intf descriptor read %d/%d\",\n\t\t\t\t size, ifp->bLength);\n\t\t\tRETURN(parsed, int);\n\t\t}\n\t\tif UNLIKELY(ifp->bNumEndpoints > USB_MAXENDPOINTS) {\n\t\t\tusbi_err(ctx, \"too many endpoints (%d)\", ifp->bNumEndpoints);\n\t\t\tr = LIBUSB_ERROR_IO;\n\t\t\tgoto err;\n\t\t}\n\n\t\tusb_interface->num_altsetting++;\n\t\tifp->extra = NULL;\n\t\tifp->extra_length = 0;\n\t\tifp->endpoint = NULL;\n\n\t\tif (interface_number == -1)\n\t\t\tinterface_number = ifp->bInterfaceNumber;\n\n\t\t/* Skip over the interface */\n\t\tbuffer += ifp->bLength;\n\t\tparsed += ifp->bLength;\n\t\tsize -= ifp->bLength;\n\n\t\tbegin = buffer;\n\n\t\t/* Skip over any interface, class or vendor descriptors */\n\t\twhile (size >= LIBUSB_DT_HEADER_SIZE/*DESC_HEADER_LENGTH*/) {\n\t\t\tusbi_parse_descriptor(buffer, \"bb\", &header, 0);\n\t\t\tif UNLIKELY(header.bLength < LIBUSB_DT_HEADER_SIZE/*DESC_HEADER_LENGTH*/) {\n\t\t\t\tusbi_err(ctx,\n\t\t\t\t\t \"invalid extra intf desc len (%d)\",\n\t\t\t\t\t header.bLength);\n\t\t\t\tr = LIBUSB_ERROR_IO;\n\t\t\t\tgoto err;\n\t\t\t} else if (header.bLength > size) {\n\t\t\t\tusbi_warn(ctx,\n\t\t\t\t\t  \"short extra intf desc read %d/%d\",\n\t\t\t\t\t  size, header.bLength);\n\t\t\t\tRETURN(parsed, int);\n\t\t\t}\n\n\t\t\tMARK(\"bDescriptorType=0x%02x\", header.bDescriptorType);\n\t\t\t/* If we find another \"proper\" descriptor then we're done */\n\t\t\tif (is_known_descriptor_type(header.bDescriptorType))\n\t\t\t\tbreak;\n\n\t\t\tbuffer += header.bLength;\n\t\t\tparsed += header.bLength;\n\t\t\tsize -= header.bLength;\n\t\t}\n\n\t\t/* Copy any unknown descriptors into a storage area for */\n\t\t/*  drivers to later parse */\n\t\tlen = (int)(buffer - begin);\n\t\tif (len) {\n\t\t\tMARK(\"save unknown descriptors into ifp->extra:lebgth=%d\", len);\n\t\t\tifp->extra = usbi_reallocf((unsigned char *)ifp->extra, ifp->extra_length + len);\n\t\t\tif UNLIKELY(!ifp->extra) {\n\t\t\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\t\t\tgoto err;\n\t\t\t}\n\t\t\tmemcpy((unsigned char *)(ifp->extra + ifp->extra_length), begin, len);\n\t\t\tifp->extra_length += len;\n\t\t}\n\n\t\tMARK(\"bNumEndpoints=%d\", ifp->bNumEndpoints);\n\t\tif (ifp->bNumEndpoints > 0) {\n\t\t\tstruct libusb_endpoint_descriptor *endpoint;\n\t\t\ttmp = ifp->bNumEndpoints * sizeof(struct libusb_endpoint_descriptor);\n\t\t\tifp->endpoint = endpoint = malloc(tmp);\n\t\t\tif UNLIKELY(!endpoint) {\n\t\t\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\t\t\tgoto err;\n\t\t\t}\n\n\t\t\tmemset(endpoint, 0, tmp);\n\t\t\tfor (i = 0; i < ifp->bNumEndpoints; i++) {\n\t\t\t\tMARK(\"parse endpoint%d\", i);\n\t\t\t\tr = parse_endpoint(ctx, endpoint + i, buffer, size,\n\t\t\t\t\thost_endian);\n\t\t\t\tif UNLIKELY(r < 0)\n\t\t\t\t\tgoto err;\n\t\t\t\tif (r == 0) {\n\t\t\t\t\tifp->bNumEndpoints = (uint8_t)i;\n\t\t\t\t\tbreak;;\n\t\t\t\t}\n\n\t\t\t\tbuffer += r;\n\t\t\t\tparsed += r;\n\t\t\t\tsize -= r;\n\t\t\t}\n\t\t}\n\n\t\t/* We check to see if it's an alternate to this one */\n\t\tifp = (struct libusb_interface_descriptor *) buffer;\n\t\tif (size < LIBUSB_DT_INTERFACE_SIZE ||\n\t\t\t\tifp->bDescriptorType != LIBUSB_DT_INTERFACE ||\n\t\t\t\tifp->bInterfaceNumber != interface_number)\n\t\t\tRETURN(parsed, int);\n\t}\n\n\tRETURN(parsed, int);\nerr:\n\tclear_interface(usb_interface);\n\tRETURN(r, int);\n}\n\nstatic void clear_association(struct libusb_association_descriptor *association) {\n\tif LIKELY(association && association->extra) {\n\t\tfree((unsigned char *) association->extra);\n\t\tassociation->extra = NULL;\n\t\tassociation->extra_length = 0;\n\t}\n}\n\nstatic int parse_association(struct libusb_context *ctx,\n\t\tstruct libusb_config_descriptor *config, unsigned char *buffer,\n\tint size, int host_endian) {\n\n\tENTER();\n\n\tstruct usb_descriptor_header header;\n\tstruct libusb_association_descriptor *association, *temp;\n\tunsigned char *begin;\n\tint parsed = 0;\n\tint len;\n\n\tif UNLIKELY(size < LIBUSB_DT_HEADER_SIZE/*DESC_HEADER_LENGTH*/) {\n\t\tusbi_err(ctx, \"short association descriptor read %d/%d\",\n\t\t\t size, LIBUSB_DT_HEADER_SIZE/*DESC_HEADER_LENGTH*/);\n\t\tRETURN(LIBUSB_ERROR_IO, int);\n\t}\n\t// ディスクリプタの先頭2バイトだけ解析して長さとディスクリプタの種類を取得\n\tusbi_parse_descriptor(buffer, \"bb\", &header, 0);\n\tif UNLIKELY(header.bDescriptorType != LIBUSB_DT_ASSOCIATION) {\t// 種類が違う時\n\t\tusbi_err(ctx, \"unexpected descriptor %x (expected %x)\",\n\t\t\theader.bDescriptorType, LIBUSB_DT_ASSOCIATION);\n\t\tRETURN(parsed, int);\t// return 0;\n\t}\n\tif UNLIKELY(header.bLength > size) {\t// IADに長さが足りない時\n\t\tusbi_warn(ctx, \"short association descriptor read %d/%d\",\n\t\t\t  size, header.bLength);\n\t\tRETURN(parsed, int);\t// return 0;\n\t}\n\tif (header.bLength >= LIBUSB_DT_ASSOCIATION_SIZE/*ASSOCIATION_DESC_LENGTH*/) {\n\t\tconfig->association_descriptor = usbi_reallocf(config->association_descriptor,\n\t\t\tsizeof(struct libusb_association_descriptor) * (config->num_associations + 1));\n\t\tif UNLIKELY(!config->association_descriptor) {\n\t\t\tparsed = LIBUSB_ERROR_NO_MEM;\n\t\t\tgoto err;\n\t\t}\n\t\tassociation = config->association_descriptor + config->num_associations;\n\t\tassociation->extra = NULL;\n\t\tassociation->extra_length = 0;\n\t\tlen = usbi_parse_descriptor(buffer, \"bbbbbbbb\", association, host_endian);\n\t\tif LIKELY(len > 0) {\n\t\t\tconfig->num_associations++;\n#if 0\n\t\t\tLOGI(\"\\t association:bLength=%d\", association->bLength);\n\t\t\tLOGI(\"\\t association:bDescriptorType=0x%02d\", association->bDescriptorType);\n\t\t\tLOGI(\"\\t association:bFirstInterface=%d\", association->bFirstInterface);\n\t\t\tLOGI(\"\\t association:bInterfaceCount=%d\", association->bInterfaceCount);\n\t\t\tLOGI(\"\\t association:bFunctionClass=0x%02x\", association->bFunctionClass);\n\t\t\tLOGI(\"\\t association:bFunctionSubClass=0x%02x\", association->bFunctionSubClass);\n\t\t\tLOGI(\"\\t association:bFunctionProtocol=0x%02x\", association->bFunctionProtocol);\n\t\t\tLOGI(\"\\t association:iFunction=%d\", association->iFunction);\n#endif\n\t\t} else {\n\t\t\t// 解析に失敗した時は未使用部分を削除\n\t\t\tconfig->association_descriptor = usbi_reallocf(association,\n\t\t\t\tsizeof(struct libusb_association_descriptor) * config->num_associations);\n\t\t}\n\t} else {\n\t\t// 種類はIADで有るにも関わらず長さが足りない時\n\t\tusbi_err(ctx, \"invalid interface association descriptor bLength (%d)\", header.bLength);\n\t\tRETURN(LIBUSB_ERROR_IO, int);\n\t}\n\t// 次の解析開始位置・残りサイズをセット\n\tbuffer += header.bLength;\n\tsize -= header.bLength;\n\tparsed += header.bLength;\n\n\t/* Skip over the rest of the Class Specific or Vendor Specific descriptors */\n\tbegin = buffer;\n\twhile (size >= LIBUSB_DT_HEADER_SIZE/*DESC_HEADER_LENGTH*/) {\n\t\tusbi_parse_descriptor(buffer, \"bb\", &header, 0);\n\t\tif UNLIKELY(header.bLength < LIBUSB_DT_HEADER_SIZE/*DESC_HEADER_LENGTH*/) {\n\t\t\tusbi_err(ctx, \"invalid extra ia desc len (%d)\",\n\t\t\t\t header.bLength);\n\t\t\tRETURN(LIBUSB_ERROR_IO, int);\n\t\t} else if (header.bLength > size) {\n\t\t\tusbi_warn(ctx, \"short extra ia desc read %d/%d\",\n\t\t\t\t  size, header.bLength);\n\t\t\tRETURN(parsed, int);\n\t\t}\n\n\t\tMARK(\"bDescriptorType=0x%02x\", header.bDescriptorType);\n\t\t/* If we find another \"proper\" descriptor then we're done  */\n\t\tif (is_known_descriptor_type(header.bDescriptorType))\n\t\t\tbreak;\n\n\t\tusbi_dbg(\"skipping descriptor 0x%02x\", header.bDescriptorType);\n\t\tbuffer += header.bLength;\n\t\tsize -= header.bLength;\n\t\tparsed += header.bLength;\n\t}\n\n\t// Append/Copy any unknown descriptors into a storage area for drivers to later parse\n\tlen = (int)(buffer - begin);\n\tif (!len) {\n\t\tRETURN(parsed, int);\n\t}\n\n\tMARK(\"save unknown descriptors into config->extra:length=%d\", len);\n\tconfig->extra = usbi_reallocf((unsigned char *)config->extra, config->extra_length + len);\n\tif UNLIKELY(!config->extra) {\n\t\tconfig->extra_length = 0;\n\t\tRETURN(LIBUSB_ERROR_NO_MEM, int);\n\t}\n\tmemcpy((unsigned char *)config->extra + config->extra_length, begin, len);\n\tconfig->extra_length += len;\n\n\tRETURN(parsed, int);\nerr:\n\tclear_association(config->association_descriptor);\n\tconfig->association_descriptor = NULL;\n\tRETURN(parsed, int);\n}\n\nstatic void clear_configuration(struct libusb_config_descriptor *config)\n{\n\tif UNLIKELY(!config) return;\n\n\tif LIKELY(config->interface) {\n\t\tint i;\n\t\tfor (i = 0; i < config->bNumInterfaces; i++)\n\t\t\tclear_interface((struct libusb_interface *)\n\t\t\t\tconfig->interface + i);\n\t\tfree((void *) config->interface);\n\t\tconfig->interface = NULL;\t// XXX\n\t}\n\tif (config->extra) {\n\t\tfree((void *) config->extra);\n\t\tconfig->extra = NULL;\t// XXX\n\t}\n\tif LIKELY(config->association_descriptor) {\n\t\tint i;\n\t\tfor (i = 0; i < config->num_associations; i++)\n\t\t\tclear_association(config->association_descriptor + i);\n\t\tfree((void *)config->association_descriptor);\n\t\tconfig->association_descriptor = NULL;\n\t}\n}\n\nstatic int parse_configuration(struct libusb_context *ctx,\n\tstruct libusb_config_descriptor *config, unsigned char *buffer,\n\tint size, int host_endian) {\n\n\tENTER();\n\n\tint parsed_if;\n\tint r;\n\tsize_t tmp;\n\tstruct usb_descriptor_header header;\n\tstruct libusb_interface *usb_interface;\n\tstruct libusb_association_descriptor *association_desc;\n\n\tif UNLIKELY(size < LIBUSB_DT_CONFIG_SIZE) {\n\t\tusbi_err(ctx, \"short config descriptor read %d/%d\",\n\t\t\t size, LIBUSB_DT_CONFIG_SIZE);\n\t\tRETURN(LIBUSB_ERROR_IO, int);\n\t}\n\n\tusbi_parse_descriptor(buffer, \"bbwbbbbb\", config, host_endian);\n\tif UNLIKELY(config->bDescriptorType != LIBUSB_DT_CONFIG) {\n\t\tusbi_err(ctx, \"unexpected descriptor %x (expected %x)\",\n\t\t\t config->bDescriptorType, LIBUSB_DT_CONFIG);\n\t\tRETURN(LIBUSB_ERROR_IO, int);\n\t}\n\tif UNLIKELY(config->bLength < LIBUSB_DT_CONFIG_SIZE) {\n\t\tusbi_err(ctx, \"invalid config bLength (%d)\", config->bLength);\n\t\tRETURN(LIBUSB_ERROR_IO, int);\n\t}\n\tif UNLIKELY(config->bLength > size) {\n\t\tusbi_err(ctx, \"short config descriptor read %d/%d\",\n\t\t\t size, config->bLength);\n\t\tRETURN(LIBUSB_ERROR_IO, int);\n\t}\n\tif UNLIKELY(config->bNumInterfaces > USB_MAXINTERFACES) {\n\t\tusbi_err(ctx, \"too many interfaces (%d)\", config->bNumInterfaces);\n\t\tRETURN(LIBUSB_ERROR_IO, int);\n\t}\n\t// インターフェースディスクリプタ配列を確保(長さはconfig->bNumInterfaces)\n\ttmp = config->bNumInterfaces * sizeof(struct libusb_interface);\n\tconfig->interface = usb_interface = malloc(tmp);\n\t// インターフェースディスクリプタ配列を確保できなかった\n\tif UNLIKELY(!config->interface)\n\t\tRETURN(LIBUSB_ERROR_NO_MEM, int);\n\n\tconfig->association_descriptor = NULL;\n\tconfig->num_associations = 0;\n\n\tmemset(usb_interface, 0, tmp);\n\tbuffer += config->bLength;\n\tsize -= config->bLength;\n\n\tconfig->extra = NULL;\n\tconfig->extra_length = 0;\n\tMARK(\"bNumInterfaces=%d\", config->bNumInterfaces);\n\tfor (parsed_if = 0; (parsed_if < config->bNumInterfaces) && (size > 0); /*parsed_if++*/) {\n\t\tint len;\n\t\tunsigned char *begin;\n\n\t\t/* Skip over the rest of the Class Specific or Vendor Specific descriptors */\n\t\tbegin = buffer;\n\t\twhile (size >= LIBUSB_DT_HEADER_SIZE/*DESC_HEADER_LENGTH*/) {\n\t\t\tusbi_parse_descriptor(buffer, \"bb\", &header, 0);\n\n\t\t\tif UNLIKELY(header.bLength < LIBUSB_DT_HEADER_SIZE/*DESC_HEADER_LENGTH*/) {\n\t\t\t\tusbi_err(ctx,\n\t\t\t\t\t \"invalid extra config desc len (%d)\",\n\t\t\t\t\t header.bLength);\n\t\t\t\tr = LIBUSB_ERROR_IO;\n\t\t\t\tgoto err;\n\t\t\t} else if UNLIKELY(header.bLength > size) {\n\t\t\t\tusbi_warn(ctx,\n\t\t\t\t\t  \"short extra config desc read %d/%d\",\n\t\t\t\t\t  size, header.bLength);\n\t\t\t\tconfig->bNumInterfaces = (uint8_t)parsed_if;\n\t\t\t\treturn size;\n\t\t\t}\n\n\t\t\tMARK(\"bDescriptorType=0x%02x\", header.bDescriptorType);\n\t\t\t/* If we find another \"proper\" descriptor then we're done */\n\t\t\tif (is_known_descriptor_type(header.bDescriptorType))\n\t\t\t\tbreak;\n\n\t\t\tusbi_dbg(\"skipping descriptor 0x%02x\\n\", header.bDescriptorType);\n\t\t\tbuffer += header.bLength;\n\t\t\tsize -= header.bLength;\n\t\t}\n\n\t\t/* Copy any unknown descriptors into a storage area for */\n\t\t/*  drivers to later parse */\n\t\tlen = (int)(buffer - begin);\n\t\tif (len) {\n\t\t\tMARK(\"save skipped unknown descriptors into config->extra:len=%d\", len);\n\t\t\tconfig->extra = usbi_reallocf((void *) config->extra, config->extra_length + len);\n\t\t\tif UNLIKELY(!config->extra) {\n\t\t\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\t\t\tgoto err;\n\t\t\t}\n\t\t\tmemcpy((unsigned char *)(config->extra + config->extra_length), begin, len);\n\t\t\tconfig->extra_length += len;\n\t\t}\n\t\tswitch (header.bDescriptorType) {\n\t\tcase LIBUSB_DT_ASSOCIATION:\n\t\t\tr = parse_association(ctx, config, buffer, size, host_endian);\n\t\t\tif (r < 0)\n\t\t\t\tgoto err;\n\t\t\tbreak;\n\t\tdefault:\n\t\tcase LIBUSB_DT_INTERFACE:\n\t\t\tr = parse_interface(ctx, usb_interface + parsed_if, buffer, size, host_endian);\n\t\t\tparsed_if++;\n\t\t\tif (r < 0)\n\t\t\t\tgoto err;\n\t\t\tbreak;\n\t\t}\n\t\tif (r == 0) {\n\t\t\tconfig->bNumInterfaces = (uint8_t)parsed_if;\n\t\t\tbreak;\n\t\t}\n\n\t\tbuffer += r;\n\t\tsize -= r;\n\t}\n\tRETURN(size, int);\n\nerr:\n\tclear_configuration(config);\n\tRETURN(r, int);\n}\n\n#if PRINT_DIAG\nstatic void dump_descriptors(unsigned char *buffer, int size) {\n\tstruct usb_descriptor_header header;\n\tstruct libusb_config_descriptor config;\n\tstruct libusb_interface_descriptor interface;\n\tstruct libusb_endpoint_descriptor endpoint;\n\tint i;\n\n\tLOGI(\"DUMP DESCRIPTIONS\");\n\tfor (i = 0; size >= 0; i += header.bLength, size -= header.bLength) {\n\t\tif (size == 0) {\n\t\t\tLOGI(\"END\");\n\t\t\treturn;\n\t\t}\n\n\t\tif (size < LIBUSB_DT_HEADER_SIZE) {\n\t\t\tLOGE(\"short descriptor read %d/2\", size);\n\t\t\treturn;\n\t\t}\n\t\tusbi_parse_descriptor(buffer + i, \"bb\", &header, 0);\n\t\tswitch (header.bDescriptorType) {\n\t\tcase LIBUSB_DT_DEVICE:\n\t\t\tLOGI(\"LIBUSB_DT_DEVICE(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_CONFIG:\n\t\t\tusbi_parse_descriptor(buffer, \"bbwbbbbb\", &config, 0);\n\t\t\tLOGI(\"LIBUSB_DT_CONFIG(0x%02x)\", config.bDescriptorType);\n\t\t\tLOGI(\"\\tbLength=%d\", config.bLength);\n\t\t\tLOGI(\"\\tbDescriptorType=0x%02x\", config.bDescriptorType);\n\t\t\tLOGI(\"\\twTotalLength=%d\", config.wTotalLength);\n\t\t\tLOGI(\"\\tbNumInterfaces=%d\", config.bNumInterfaces);\n\t\t\tLOGI(\"\\tbConfigurationValue=%d\", config.bConfigurationValue);\n\t\t\tLOGI(\"\\tiConfiguration=%d\", config.iConfiguration);\n\t\t\tLOGI(\"\\tbmAttributes=%d\", config.bmAttributes);\n\t\t\tLOGI(\"\\tMaxPower=%d\", config.MaxPower);\n\t\t\tLOGI(\"\\textra_length=%d\", config.bLength - LIBUSB_DT_CONFIG_SIZE);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_STRING:\n\t\t\tLOGI(\"LIBUSB_DT_STRING(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_INTERFACE:\n\t\t\tusbi_parse_descriptor(buffer + i, \"bbbbbbbbb\", &interface, 0);\n\t\t\tLOGI(\"LIBUSB_DT_INTERFACE(0x%02x):\", header.bDescriptorType);\n\t\t\tLOGI(\"\\tbLength=%d\", interface.bLength);\n\t\t\tLOGI(\"\\tbDescriptorType=0x%02x\", interface.bDescriptorType);\n\t\t\tLOGI(\"\\tbInterfaceNumber=%d\", interface.bInterfaceNumber);\n\t\t\tLOGI(\"\\tbAlternateSetting=%d\", interface.bAlternateSetting);\n\t\t\tLOGI(\"\\tbNumEndpoints=%d\", interface.bNumEndpoints);\n\t\t\tLOGI(\"\\tbInterfaceClass=0x%02x\", interface.bInterfaceClass);\n\t\t\tLOGI(\"\\tbInterfaceSubClass=0x%02x\", interface.bInterfaceSubClass);\n\t\t\tLOGI(\"\\tbInterfaceProtocol=0x%02x\", interface.bInterfaceProtocol);\n\t\t\tLOGI(\"\\tiInterface=%d\", interface.iInterface);\n\t\t\tLOGI(\"\\textra_length=%d\", interface.bLength - LIBUSB_DT_INTERFACE_SIZE);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_ENDPOINT:\n\t\t\tusbi_parse_descriptor(buffer + i, \"bbbbwbbb\", &endpoint, 0);\n\t\t\tLOGI(\"LIBUSB_DT_ENDPOINT(0x%02x):\", header.bDescriptorType);\n\t\t\tLOGI(\"\\tbLength=%d\", endpoint.bLength);\n\t\t\tLOGI(\"\\tbDescriptorType=0x%02x\", endpoint.bDescriptorType);\n\t\t\tLOGI(\"\\tbEndpointAddress=%d\", endpoint.bEndpointAddress);\n\t\t\tLOGI(\"\\tbmAttributes=%d\", endpoint.bmAttributes);\n\t\t\tLOGI(\"\\twMaxPacketSize=%d\", endpoint.wMaxPacketSize);\n\t\t\tLOGI(\"\\tbInterval=%d\", endpoint.bInterval);\n\t\t\tLOGI(\"\\tbRefresh=%d\", endpoint.bRefresh);\n\t\t\tLOGI(\"\\tbSynchAddress=%d\", endpoint.bSynchAddress);\n\t\t\tLOGI(\"\\textra_length=%d\", endpoint.bLength - LIBUSB_DT_ENDPOINT_SIZE);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_DEVICE_QUALIFIER:\n\t\t\tLOGI(\"LIBUSB_DT_DEVICE_QUALIFIER(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tLOGI(\"\\textra_length=%d\", header.bLength - LIBUSB_DT_QUALIFER_SIZE);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_OTHER_SPEED_CONFIGURATION:\n\t\t\tLOGI(\"LIBUSB_DT_OTHER_SPEED_CONFIGURATION(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tLOGI(\"\\textra_length=%d\", header.bLength - LIBUSB_DT_OTHER_SPEED_SIZE);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_INTERFACE_POWER:\n\t\t\tLOGI(\"LIBUSB_DT_INTERFACE_POWER(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_OTG:\n\t\t\tLOGI(\"LIBUSB_DT_OTG(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_DEBUG:\n\t\t\tLOGI(\"LIBUSB_DT_DEBUG(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_ASSOCIATION:\n\t\t\tLOGI(\"LIBUSB_DT_ASSOCIATION(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tLOGI(\"\\textra_length=%d\", header.bLength - LIBUSB_DT_ASSOCIATION_SIZE);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_BOS:\n\t\t\tLOGI(\"LIBUSB_DT_BOS(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tLOGI(\"\\textra_length=%d\", header.bLength - LIBUSB_DT_BOS_SIZE);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_DEVICE_CAPABILITY:\n\t\t\tLOGI(\"LIBUSB_DT_DEVICE_CAPABILITY(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tLOGI(\"\\textra_length=%d\", header.bLength - LIBUSB_DT_DEVICE_CAPABILITY_SIZE);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_HID:\n\t\t\tLOGI(\"LIBUSB_DT_HID(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_HID_REPORT:\n\t\t\tLOGI(\"LIBUSB_DT_REPORT(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_HID_PHYSICAL:\n\t\t\tLOGI(\"LIBUSB_DT_PHYSICAL(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_CS_INTERFACE:\n\t\t\tLOGI(\"LIBUSB_DT_CS_INTERFACE(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_CS_ENDPOINT:\n\t\t\tLOGI(\"LIBUSB_DT_CS_ENDPOINT(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_HUB:\n\t\t\tLOGI(\"LIBUSB_DT_HUB(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_SUPERSPEED_HUB:\n\t\t\tLOGI(\"LIBUSB_DT_SUPERSPEED_HUB(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tbreak;\n\t\tcase LIBUSB_DT_SS_ENDPOINT_COMPANION:\n\t\t\tLOGI(\"LIBUSB_DT_SS_ENDPOINT_COMPANION(0x%02x),length=%d\", header.bDescriptorType, header.bLength);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tLOGI(\"unknown Descriptor(0x%02x),length=0x%02x\", header.bDescriptorType, header.bLength);\n\t\t\tbreak;\n\t\t}\n\t}\n}\n#endif\n\nstatic int raw_desc_to_config(struct libusb_context *ctx,\n\tunsigned char *buf, int size, int host_endian,\n\tstruct libusb_config_descriptor **config)\n{\n\tENTER();\n\n\tstruct libusb_config_descriptor *_config = malloc(sizeof(*_config));\n\tint r;\n\t\n\tif UNLIKELY(!_config)\n\t\tRETURN(LIBUSB_ERROR_NO_MEM, int);\n\n#if PRINT_DIAG\n\tdump_descriptors(buf, size);\n#endif\n\tr = parse_configuration(ctx, _config, buf, size, host_endian);\n\tif UNLIKELY(r < 0) {\n\t\tusbi_err(ctx, \"parse_configuration failed with error %d\", r);\n\t\tfree(_config);\n\t\treturn r;\n\t} else if (r > 0) {\n\t\tusbi_warn(ctx, \"still %d bytes of descriptor data left\", r);\n\t}\n\t\n\t*config = _config;\n\tRETURN(LIBUSB_SUCCESS, int);\n}\n\nint usbi_device_cache_descriptor(libusb_device *dev)\n{\n\tint r, host_endian = 0;\n\n\tr = usbi_backend->get_device_descriptor(dev, (unsigned char *) &dev->device_descriptor,\n\t\t\t\t\t\t&host_endian);\n\tif UNLIKELY(r < 0)\n\t\treturn r;\n\n\tif (!host_endian) {\n\t\tdev->device_descriptor.bcdUSB = libusb_le16_to_cpu(dev->device_descriptor.bcdUSB);\n\t\tdev->device_descriptor.idVendor = libusb_le16_to_cpu(dev->device_descriptor.idVendor);\n\t\tdev->device_descriptor.idProduct = libusb_le16_to_cpu(dev->device_descriptor.idProduct);\n\t\tdev->device_descriptor.bcdDevice = libusb_le16_to_cpu(dev->device_descriptor.bcdDevice);\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nint API_EXPORTED libusb_get_raw_descriptor(libusb_device *dev,\n\t\tunsigned char **buffer, int *descriptors_len, int *host_endian)\n{\n\tif UNLIKELY(!buffer || !descriptors_len || !host_endian)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\tint len, r;\n\tr = usbi_backend->get_raw_descriptor(dev, NULL, &len, host_endian);\n\tif (!r) {\n\t\tunsigned char *temp = realloc(*buffer, len);\n\t\tif UNLIKELY(!temp)\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\t*buffer = temp;\n\t\t*descriptors_len = len;\n\t\tr = usbi_backend->get_raw_descriptor(dev, temp, &len, host_endian);\n\t}\n\treturn r;\n}\n\n/** \\ingroup desc\n * Get the USB device descriptor for a given device.\n *\n * This is a non-blocking function; the device descriptor is cached in memory.\n *\n * Note since libusb-1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102, this\n * function always succeeds.\n *\n * \\param dev the device\n * \\param desc output location for the descriptor data\n * \\returns 0 on success or a LIBUSB_ERROR code on failure\n */\nint API_EXPORTED libusb_get_device_descriptor(libusb_device *dev,\n\tstruct libusb_device_descriptor *desc)\n{\n\tusbi_dbg(\"\");\n\t// FIXME add IAD support\n\tLOGD(\"desc=%p,dev=%p,device_descriptor=%p\", desc, dev, &dev->device_descriptor);\n\tmemcpy((unsigned char *) desc, (unsigned char *) &dev->device_descriptor,\n\t       sizeof (dev->device_descriptor));\n\treturn 0;\n}\n\n/** \\ingroup desc\n * Get the USB configuration descriptor for the currently active configuration.\n * This is a non-blocking function which does not involve any requests being\n * sent to the device.\n *\n * \\param dev a device\n * \\param config output location for the USB configuration descriptor. Only\n * valid if 0 was returned. Must be freed with libusb_free_config_descriptor()\n * after use.\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state\n * \\returns another LIBUSB_ERROR code on error\n * \\see libusb_get_config_descriptor\n */\nint API_EXPORTED libusb_get_active_config_descriptor(libusb_device *dev,\n\tstruct libusb_config_descriptor **config)\n{\n\tstruct libusb_config_descriptor _config;\n\tunsigned char tmp[LIBUSB_DT_CONFIG_SIZE];\n\tunsigned char *buf = NULL;\n\tint host_endian = 0;\n\tint r;\n\n\tr = usbi_backend->get_active_config_descriptor(dev, tmp,\t// XXX this function will return error on some buggy device\n\t\tLIBUSB_DT_CONFIG_SIZE, &host_endian);\n\tif UNLIKELY(r < 0)\n\t\treturn r;\n\tif UNLIKELY(r < LIBUSB_DT_CONFIG_SIZE) {\n\t\tusbi_err(dev->ctx, \"short config descriptor read %d/%d\",\n\t\t\t r, LIBUSB_DT_CONFIG_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tusbi_parse_descriptor(tmp, \"bbw\", &_config, host_endian);\n\tbuf = malloc(_config.wTotalLength);\n\tif UNLIKELY(!buf)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tr = usbi_backend->get_active_config_descriptor(dev, buf,\t// XXX this function will return error on some buggy device\n\t\t_config.wTotalLength, &host_endian);\n\tif (r >= 0)\n\t\tr = raw_desc_to_config(dev->ctx, buf, r, host_endian, config);\n\n\tfree(buf);\n\treturn r;\n}\n\n/** \\ingroup desc\n * Get a USB configuration descriptor based on its index.\n * This is a non-blocking function which does not involve any requests being\n * sent to the device.\n *\n * \\param dev a device\n * \\param config_index the index of the configuration you wish to retrieve\n * \\param config output location for the USB configuration descriptor. Only\n * valid if 0 was returned. Must be freed with libusb_free_config_descriptor()\n * after use.\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist\n * \\returns another LIBUSB_ERROR code on error\n * \\see libusb_get_active_config_descriptor()\n * \\see libusb_get_config_descriptor_by_value()\n */\nint API_EXPORTED libusb_get_config_descriptor(libusb_device *dev,\n\tuint8_t config_index, struct libusb_config_descriptor **config)\n{\n\tstruct libusb_config_descriptor _config;\n\tunsigned char tmp[LIBUSB_DT_CONFIG_SIZE];\n\tunsigned char *buf = NULL;\n\tint host_endian = 0;\n\tint r;\n\n\tusbi_dbg(\"index %d\", config_index);\n\tif UNLIKELY(config_index >= dev->num_configurations)\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\tr = usbi_backend->get_config_descriptor(dev, config_index, tmp,\n\t\tLIBUSB_DT_CONFIG_SIZE, &host_endian);\n\tif UNLIKELY(r < 0)\n\t\treturn r;\n\tif UNLIKELY(r < LIBUSB_DT_CONFIG_SIZE) {\n\t\tusbi_err(dev->ctx, \"short config descriptor read %d/%d\",\n\t\t\t r, LIBUSB_DT_CONFIG_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tusbi_parse_descriptor(tmp, \"bbw\", &_config, host_endian);\n\tbuf = malloc(_config.wTotalLength);\n\tif UNLIKELY(!buf)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tr = usbi_backend->get_config_descriptor(dev, config_index, buf,\n\t\t_config.wTotalLength, &host_endian);\n\tif LIKELY(r >= 0)\n\t\tr = raw_desc_to_config(dev->ctx, buf, r, host_endian, config);\n\n\tfree(buf);\n\treturn r;\n}\n\n/* iterate through all configurations, returning the index of the configuration\n * matching a specific bConfigurationValue in the idx output parameter, or -1\n * if the config was not found.\n * returns 0 on success or a LIBUSB_ERROR code\n */\nint usbi_get_config_index_by_value(struct libusb_device *dev,\n\tuint8_t bConfigurationValue, int *idx)\n{\n\tuint8_t i;\n\n\tusbi_dbg(\"value %d\", bConfigurationValue);\n\tfor (i = 0; i < dev->num_configurations; i++) {\n\t\tunsigned char tmp[6];\n\t\tint host_endian;\n\t\tint r = usbi_backend->get_config_descriptor(dev, i, tmp, sizeof(tmp),\n\t\t\t&host_endian);\n\t\tif UNLIKELY(r < 0) {\n\t\t\t*idx = -1;\n\t\t\treturn r;\n\t\t}\n\t\tif (tmp[5] == bConfigurationValue) {\n\t\t\t*idx = i;\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\t*idx = -1;\n\treturn 0;\n}\n\n/** \\ingroup desc\n * Get a USB configuration descriptor with a specific bConfigurationValue.\n * This is a non-blocking function which does not involve any requests being\n * sent to the device.\n *\n * \\param dev a device\n * \\param bConfigurationValue the bConfigurationValue of the configuration you\n * wish to retrieve\n * \\param config output location for the USB configuration descriptor. Only\n * valid if 0 was returned. Must be freed with libusb_free_config_descriptor()\n * after use.\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist\n * \\returns another LIBUSB_ERROR code on error\n * \\see libusb_get_active_config_descriptor()\n * \\see libusb_get_config_descriptor()\n */\nint API_EXPORTED libusb_get_config_descriptor_by_value(libusb_device *dev,\n\tuint8_t bConfigurationValue, struct libusb_config_descriptor **config)\n{\n\tint r, idx, host_endian;\n\tunsigned char *buf = NULL;\n\n\tif (usbi_backend->get_config_descriptor_by_value) {\n\t\tr = usbi_backend->get_config_descriptor_by_value(dev,\n\t\t\tbConfigurationValue, &buf, &host_endian);\n\t\tif UNLIKELY(r < 0)\n\t\t\treturn r;\n\t\treturn raw_desc_to_config(dev->ctx, buf, r, host_endian, config);\n\t}\n\n\tr = usbi_get_config_index_by_value(dev, bConfigurationValue, &idx);\n\tif UNLIKELY(r < 0)\n\t\treturn r;\n\telse if UNLIKELY(idx == -1)\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\telse\n\t\treturn libusb_get_config_descriptor(dev, (uint8_t) idx, config);\n}\n\n/** \\ingroup desc\n * Free a configuration descriptor obtained from\n * libusb_get_active_config_descriptor() or libusb_get_config_descriptor().\n * It is safe to call this function with a NULL config parameter, in which\n * case the function simply returns.\n *\n * \\param config the configuration descriptor to free\n */\nvoid API_EXPORTED libusb_free_config_descriptor(\n\tstruct libusb_config_descriptor *config)\n{\n\tif UNLIKELY(!config)\n\t\treturn;\n\n\tclear_configuration(config);\n\tfree(config);\n}\n\n/** \\ingroup desc\n * Get an endpoints superspeed endpoint companion descriptor (if any)\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param endpoint endpoint descriptor from which to get the superspeed\n * endpoint companion descriptor\n * \\param ep_comp output location for the superspeed endpoint companion\n * descriptor. Only valid if 0 was returned. Must be freed with\n * libusb_free_ss_endpoint_companion_descriptor() after use.\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist\n * \\returns another LIBUSB_ERROR code on error\n */\nint API_EXPORTED libusb_get_ss_endpoint_companion_descriptor(\n\tstruct libusb_context *ctx,\n\tconst struct libusb_endpoint_descriptor *endpoint,\n\tstruct libusb_ss_endpoint_companion_descriptor **ep_comp)\n{\n\tstruct usb_descriptor_header header;\n\tint size = endpoint->extra_length;\n\tconst unsigned char *buffer = endpoint->extra;\n\n\t*ep_comp = NULL;\n\n\twhile (size >= LIBUSB_DT_HEADER_SIZE/*DESC_HEADER_LENGTH*/) {\n\t\tusbi_parse_descriptor(buffer, \"bb\", &header, 0);\n\t\tif UNLIKELY(header.bLength < 2 || header.bLength > size) {\n\t\t\tusbi_err(ctx, \"invalid descriptor length %d\",\n\t\t\t\t header.bLength);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t}\n\t\tif (header.bDescriptorType != LIBUSB_DT_SS_ENDPOINT_COMPANION) {\n\t\t\tbuffer += header.bLength;\n\t\t\tsize -= header.bLength;\n\t\t\tcontinue;\n\t\t}\n\t\tif UNLIKELY(header.bLength < LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE) {\n\t\t\tusbi_err(ctx, \"invalid ss-ep-comp-desc length %d\",\n\t\t\t\t header.bLength);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t}\n\t\t*ep_comp = malloc(sizeof(**ep_comp));\n\t\tif UNLIKELY(!*ep_comp)\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\tusbi_parse_descriptor(buffer, \"bbbbw\", *ep_comp, 0);\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\treturn LIBUSB_ERROR_NOT_FOUND;\n}\n\n/** \\ingroup desc\n * Free a superspeed endpoint companion descriptor obtained from\n * libusb_get_ss_endpoint_companion_descriptor().\n * It is safe to call this function with a NULL ep_comp parameter, in which\n * case the function simply returns.\n *\n * \\param ep_comp the superspeed endpoint companion descriptor to free\n */\nvoid API_EXPORTED libusb_free_ss_endpoint_companion_descriptor(\n\tstruct libusb_ss_endpoint_companion_descriptor *ep_comp)\n{\n\tfree(ep_comp);\n}\n\nstatic int parse_bos(struct libusb_context *ctx,\n\tstruct libusb_bos_descriptor **bos,\n\tunsigned char *buffer, int size, int host_endian)\n{\n\tstruct libusb_bos_descriptor bos_header, *_bos;\n\tstruct libusb_bos_dev_capability_descriptor dev_cap;\n\tint i;\n\n\tif UNLIKELY(size < LIBUSB_DT_BOS_SIZE) {\n\t\tusbi_err(ctx, \"short bos descriptor read %d/%d\",\n\t\t\t size, LIBUSB_DT_BOS_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tusbi_parse_descriptor(buffer, \"bbwb\", &bos_header, host_endian);\n\tif UNLIKELY(bos_header.bDescriptorType != LIBUSB_DT_BOS) {\n\t\tusbi_err(ctx, \"unexpected descriptor %x (expected %x)\",\n\t\t\t bos_header.bDescriptorType, LIBUSB_DT_BOS);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\tif UNLIKELY(bos_header.bLength < LIBUSB_DT_BOS_SIZE) {\n\t\tusbi_err(ctx, \"invalid bos bLength (%d)\", bos_header.bLength);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\tif UNLIKELY(bos_header.bLength > size) {\n\t\tusbi_err(ctx, \"short bos descriptor read %d/%d\",\n\t\t\t size, bos_header.bLength);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\t_bos = calloc (1,\n\t\tsizeof(*_bos) + bos_header.bNumDeviceCaps * sizeof(void *));\n\tif UNLIKELY(!_bos)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tusbi_parse_descriptor(buffer, \"bbwb\", _bos, host_endian);\n\tbuffer += bos_header.bLength;\n\tsize -= bos_header.bLength;\n\n\t/* Get the device capability descriptors */\n\tfor (i = 0; i < bos_header.bNumDeviceCaps; i++) {\n\t\tif (size < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) {\n\t\t\tusbi_warn(ctx, \"short dev-cap descriptor read %d/%d\",\n\t\t\t\t  size, LIBUSB_DT_DEVICE_CAPABILITY_SIZE);\n\t\t\tbreak;\n\t\t}\n\t\tusbi_parse_descriptor(buffer, \"bbb\", &dev_cap, host_endian);\n\t\tif (dev_cap.bDescriptorType != LIBUSB_DT_DEVICE_CAPABILITY) {\n\t\t\tusbi_warn(ctx, \"unexpected descriptor %x (expected %x)\",\n\t\t\t\t  dev_cap.bDescriptorType, LIBUSB_DT_DEVICE_CAPABILITY);\n\t\t\tbreak;\n\t\t}\n\t\tif UNLIKELY(dev_cap.bLength < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) {\n\t\t\tusbi_err(ctx, \"invalid dev-cap bLength (%d)\",\n\t\t\t\t dev_cap.bLength);\n\t\t\tlibusb_free_bos_descriptor(_bos);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t}\n\t\tif (dev_cap.bLength > size) {\n\t\t\tusbi_warn(ctx, \"short dev-cap descriptor read %d/%d\",\n\t\t\t\t  size, dev_cap.bLength);\n\t\t\tbreak;\n\t\t}\n\n\t\t_bos->dev_capability[i] = malloc(dev_cap.bLength);\n\t\tif UNLIKELY(!_bos->dev_capability[i]) {\n\t\t\tlibusb_free_bos_descriptor(_bos);\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\t}\n\t\tmemcpy(_bos->dev_capability[i], buffer, dev_cap.bLength);\n\t\tbuffer += dev_cap.bLength;\n\t\tsize -= dev_cap.bLength;\n\t}\n\t_bos->bNumDeviceCaps = (uint8_t)i;\n\t*bos = _bos;\n\n\treturn LIBUSB_SUCCESS;\n}\n\n/** \\ingroup desc\n * Get a Binary Object Store (BOS) descriptor\n * This is a BLOCKING function, which will send requests to the device.\n *\n * \\param handle the handle of an open libusb device\n * \\param bos output location for the BOS descriptor. Only valid if 0 was returned.\n * Must be freed with \\ref libusb_free_bos_descriptor() after use.\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the device doesn't have a BOS descriptor\n * \\returns another LIBUSB_ERROR code on error\n */\nint API_EXPORTED libusb_get_bos_descriptor(libusb_device_handle *handle,\n\tstruct libusb_bos_descriptor **bos)\n{\n\tstruct libusb_bos_descriptor _bos;\n\tuint8_t bos_header[LIBUSB_DT_BOS_SIZE] = {0};\n\tunsigned char *bos_data = NULL;\n\tconst int host_endian = 0;\n\tint r;\n\n\t/* Read the BOS. This generates 2 requests on the bus,\n\t * one for the header, and one for the full BOS */\n\tr = libusb_get_descriptor(handle, LIBUSB_DT_BOS, 0, bos_header,\n\t\t\t\t  LIBUSB_DT_BOS_SIZE);\n\tif UNLIKELY(r < 0) {\n\t\tif (r != LIBUSB_ERROR_PIPE)\n\t\t\tusbi_err(handle->dev->ctx, \"failed to read BOS (%d)\", r);\n\t\treturn r;\n\t}\n\tif UNLIKELY(r < LIBUSB_DT_BOS_SIZE) {\n\t\tusbi_err(handle->dev->ctx, \"short BOS read %d/%d\",\n\t\t\t r, LIBUSB_DT_BOS_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tusbi_parse_descriptor(bos_header, \"bbwb\", &_bos, host_endian);\n\tusbi_dbg(\"found BOS descriptor: size %d bytes, %d capabilities\",\n\t\t _bos.wTotalLength, _bos.bNumDeviceCaps);\n\tbos_data = calloc(_bos.wTotalLength, 1);\n\tif UNLIKELY(!bos_data)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tr = libusb_get_descriptor(handle, LIBUSB_DT_BOS, 0, bos_data,\n\t\t\t\t  _bos.wTotalLength);\n\tif LIKELY(r >= 0)\n\t\tr = parse_bos(handle->dev->ctx, bos, bos_data, r, host_endian);\n\telse\n\t\tusbi_err(handle->dev->ctx, \"failed to read BOS (%d)\", r);\n\n\tfree(bos_data);\n\treturn r;\n}\n\n/** \\ingroup desc\n * Free a BOS descriptor obtained from libusb_get_bos_descriptor().\n * It is safe to call this function with a NULL bos parameter, in which\n * case the function simply returns.\n *\n * \\param bos the BOS descriptor to free\n */\nvoid API_EXPORTED libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos)\n{\n\tint i;\n\n\tif (!bos)\n\t\treturn;\n\n\tfor (i = 0; i < bos->bNumDeviceCaps; i++)\n\t\tfree(bos->dev_capability[i]);\n\tfree(bos);\n}\n\n/** \\ingroup desc\n * Get an USB 2.0 Extension descriptor\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param dev_cap Device Capability descriptor with a bDevCapabilityType of\n * \\ref libusb_capability_type::LIBUSB_BT_USB_2_0_EXTENSION\n * LIBUSB_BT_USB_2_0_EXTENSION\n * \\param usb_2_0_extension output location for the USB 2.0 Extension\n * descriptor. Only valid if 0 was returned. Must be freed with\n * libusb_free_usb_2_0_extension_descriptor() after use.\n * \\returns 0 on success\n * \\returns a LIBUSB_ERROR code on error\n */\nint API_EXPORTED libusb_get_usb_2_0_extension_descriptor(\n\tstruct libusb_context *ctx,\n\tstruct libusb_bos_dev_capability_descriptor *dev_cap,\n\tstruct libusb_usb_2_0_extension_descriptor **usb_2_0_extension)\n{\n\tstruct libusb_usb_2_0_extension_descriptor *_usb_2_0_extension;\n\tconst int host_endian = 0;\n\n\tif UNLIKELY(dev_cap->bDevCapabilityType != LIBUSB_BT_USB_2_0_EXTENSION) {\n\t\tusbi_err(ctx, \"unexpected bDevCapabilityType %x (expected %x)\",\n\t\t\t dev_cap->bDevCapabilityType,\n\t\t\t LIBUSB_BT_USB_2_0_EXTENSION);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\tif UNLIKELY(dev_cap->bLength < LIBUSB_BT_USB_2_0_EXTENSION_SIZE) {\n\t\tusbi_err(ctx, \"short dev-cap descriptor read %d/%d\",\n\t\t\t dev_cap->bLength, LIBUSB_BT_USB_2_0_EXTENSION_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\t_usb_2_0_extension = malloc(sizeof(*_usb_2_0_extension));\n\tif UNLIKELY(!_usb_2_0_extension)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tusbi_parse_descriptor((unsigned char *)dev_cap, \"bbbd\",\n\t\t\t      _usb_2_0_extension, host_endian);\n\n\t*usb_2_0_extension = _usb_2_0_extension;\n\treturn LIBUSB_SUCCESS;\n}\n\n/** \\ingroup desc\n * Free a USB 2.0 Extension descriptor obtained from\n * libusb_get_usb_2_0_extension_descriptor().\n * It is safe to call this function with a NULL usb_2_0_extension parameter,\n * in which case the function simply returns.\n *\n * \\param usb_2_0_extension the USB 2.0 Extension descriptor to free\n */\nvoid API_EXPORTED libusb_free_usb_2_0_extension_descriptor(\n\tstruct libusb_usb_2_0_extension_descriptor *usb_2_0_extension)\n{\n\tfree(usb_2_0_extension);\n}\n\n/** \\ingroup desc\n * Get a SuperSpeed USB Device Capability descriptor\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param dev_cap Device Capability descriptor with a bDevCapabilityType of\n * \\ref libusb_capability_type::LIBUSB_BT_SS_USB_DEVICE_CAPABILITY\n * LIBUSB_BT_SS_USB_DEVICE_CAPABILITY\n * \\param ss_usb_device_cap output location for the SuperSpeed USB Device\n * Capability descriptor. Only valid if 0 was returned. Must be freed with\n * libusb_free_ss_usb_device_capability_descriptor() after use.\n * \\returns 0 on success\n * \\returns a LIBUSB_ERROR code on error\n */\nint API_EXPORTED libusb_get_ss_usb_device_capability_descriptor(\n\tstruct libusb_context *ctx,\n\tstruct libusb_bos_dev_capability_descriptor *dev_cap,\n\tstruct libusb_ss_usb_device_capability_descriptor **ss_usb_device_cap)\n{\n\tstruct libusb_ss_usb_device_capability_descriptor *_ss_usb_device_cap;\n\tconst int host_endian = 0;\n\n\tif UNLIKELY(dev_cap->bDevCapabilityType != LIBUSB_BT_SS_USB_DEVICE_CAPABILITY) {\n\t\tusbi_err(ctx, \"unexpected bDevCapabilityType %x (expected %x)\",\n\t\t\t dev_cap->bDevCapabilityType,\n\t\t\t LIBUSB_BT_SS_USB_DEVICE_CAPABILITY);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\tif UNLIKELY(dev_cap->bLength < LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE) {\n\t\tusbi_err(ctx, \"short dev-cap descriptor read %d/%d\",\n\t\t\t dev_cap->bLength, LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\t_ss_usb_device_cap = malloc(sizeof(*_ss_usb_device_cap));\n\tif UNLIKELY(!_ss_usb_device_cap)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tusbi_parse_descriptor((unsigned char *)dev_cap, \"bbbbwbbw\",\n\t\t\t      _ss_usb_device_cap, host_endian);\n\n\t*ss_usb_device_cap = _ss_usb_device_cap;\n\treturn LIBUSB_SUCCESS;\n}\n\n/** \\ingroup desc\n * Free a SuperSpeed USB Device Capability descriptor obtained from\n * libusb_get_ss_usb_device_capability_descriptor().\n * It is safe to call this function with a NULL ss_usb_device_cap\n * parameter, in which case the function simply returns.\n *\n * \\param ss_usb_device_cap the USB 2.0 Extension descriptor to free\n */\nvoid API_EXPORTED libusb_free_ss_usb_device_capability_descriptor(\n\tstruct libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap)\n{\n\tfree(ss_usb_device_cap);\n}\n\n/** \\ingroup desc\n * Get a Container ID descriptor\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param dev_cap Device Capability descriptor with a bDevCapabilityType of\n * \\ref libusb_capability_type::LIBUSB_BT_CONTAINER_ID\n * LIBUSB_BT_CONTAINER_ID\n * \\param container_id output location for the Container ID descriptor.\n * Only valid if 0 was returned. Must be freed with\n * libusb_free_container_id_descriptor() after use.\n * \\returns 0 on success\n * \\returns a LIBUSB_ERROR code on error\n */\nint API_EXPORTED libusb_get_container_id_descriptor(struct libusb_context *ctx,\n\tstruct libusb_bos_dev_capability_descriptor *dev_cap,\n\tstruct libusb_container_id_descriptor **container_id)\n{\n\tstruct libusb_container_id_descriptor *_container_id;\n\tconst int host_endian = 0;\n\n\tif UNLIKELY(dev_cap->bDevCapabilityType != LIBUSB_BT_CONTAINER_ID) {\n\t\tusbi_err(ctx, \"unexpected bDevCapabilityType %x (expected %x)\",\n\t\t\t dev_cap->bDevCapabilityType,\n\t\t\t LIBUSB_BT_CONTAINER_ID);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\tif UNLIKELY(dev_cap->bLength < LIBUSB_BT_CONTAINER_ID_SIZE) {\n\t\tusbi_err(ctx, \"short dev-cap descriptor read %d/%d\",\n\t\t\t dev_cap->bLength, LIBUSB_BT_CONTAINER_ID_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\t_container_id = malloc(sizeof(*_container_id));\n\tif UNLIKELY(!_container_id)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tusbi_parse_descriptor((unsigned char *)dev_cap, \"bbbbu\",\n\t\t\t      _container_id, host_endian);\n\n\t*container_id = _container_id;\n\treturn LIBUSB_SUCCESS;\n}\n\n/** \\ingroup desc\n * Free a Container ID descriptor obtained from\n * libusb_get_container_id_descriptor().\n * It is safe to call this function with a NULL container_id parameter,\n * in which case the function simply returns.\n *\n * \\param container_id the USB 2.0 Extension descriptor to free\n */\nvoid API_EXPORTED libusb_free_container_id_descriptor(\n\tstruct libusb_container_id_descriptor *container_id)\n{\n\tfree(container_id);\n}\n\n/** \\ingroup desc\n * Retrieve a string descriptor in C style ASCII.\n *\n * Wrapper around libusb_get_string_descriptor(). Uses the first language\n * supported by the device.\n *\n * \\param dev a device handle\n * \\param desc_index the index of the descriptor to retrieve\n * \\param data output buffer for ASCII string descriptor\n * \\param length size of data buffer\n * \\returns number of bytes returned in data, or LIBUSB_ERROR code on failure\n */\nint API_EXPORTED libusb_get_string_descriptor_ascii(libusb_device_handle *dev,\n\tuint8_t desc_index, unsigned char *data, int length)\n{\n\tunsigned char tbuf[255]; /* Some devices choke on size > 255 */\n\tint r, si, di;\n\tuint16_t langid;\n\n\t/* Asking for the zero'th index is special - it returns a string\n\t * descriptor that contains all the language IDs supported by the\n\t * device. Typically there aren't many - often only one. Language\n\t * IDs are 16 bit numbers, and they start at the third byte in the\n\t * descriptor. There's also no point in trying to read descriptor 0\n\t * with this function. See USB 2.0 specification section 9.6.7 for\n\t * more information.\n\t */\n\n\tif UNLIKELY(!desc_index)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\tr = libusb_get_string_descriptor(dev, 0, 0, tbuf, sizeof(tbuf));\n\tif UNLIKELY(r < 0)\n\t\treturn r;\n\n\tif UNLIKELY(r < 4)\n\t\treturn LIBUSB_ERROR_IO;\n\n\tlangid = tbuf[2] | (tbuf[3] << 8);\n\n\tr = libusb_get_string_descriptor(dev, desc_index, langid, tbuf, sizeof(tbuf));\n\tif UNLIKELY(r < 0)\n\t\treturn r;\n\n\tif UNLIKELY(tbuf[1] != LIBUSB_DT_STRING)\n\t\treturn LIBUSB_ERROR_IO;\n\n\tif UNLIKELY(tbuf[0] > r)\n\t\treturn LIBUSB_ERROR_IO;\n\n\tfor (di = 0, si = 2; si < tbuf[0]; si += 2) {\n\t\tif (di >= (length - 1))\n\t\t\tbreak;\n\n\t\tif ((tbuf[si] & 0x80) || (tbuf[si + 1])) /* non-ASCII */\n\t\t\tdata[di++] = '?';\n\t\telse\n\t\t\tdata[di++] = tbuf[si];\n\t}\n\n\tdata[di] = 0;\n\treturn di;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/descriptor_original.c",
    "content": "/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */\n/*\n * USB descriptor handling functions for libusb\n * Copyright © 2007 Daniel Drake <dsd@gentoo.org>\n * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <errno.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"libusbi.h\"\n\n#define DESC_HEADER_LENGTH\t\t2\n#define DEVICE_DESC_LENGTH\t\t18\n#define CONFIG_DESC_LENGTH\t\t9\n#define INTERFACE_DESC_LENGTH\t\t9\n#define ENDPOINT_DESC_LENGTH\t\t7\n#define ENDPOINT_AUDIO_DESC_LENGTH\t9\n\n/** @defgroup desc USB descriptors\n * This page details how to examine the various standard USB descriptors\n * for detected devices\n */\n\n/* set host_endian if the w values are already in host endian format,\n * as opposed to bus endian. */\nint usbi_parse_descriptor(const unsigned char *source, const char *descriptor,\n\tvoid *dest, int host_endian)\n{\n\tconst unsigned char *sp = source;\n\tunsigned char *dp = dest;\n\tuint16_t w;\n\tconst char *cp;\n\tuint32_t d;\n\n\tfor (cp = descriptor; *cp; cp++) {\n\t\tswitch (*cp) {\n\t\t\tcase 'b':\t/* 8-bit byte */\n\t\t\t\t*dp++ = *sp++;\n\t\t\t\tbreak;\n\t\t\tcase 'w':\t/* 16-bit word, convert from little endian to CPU */\n\t\t\t\tdp += ((uintptr_t)dp & 1);\t/* Align to word boundary */\n\n\t\t\t\tif (host_endian) {\n\t\t\t\t\tmemcpy(dp, sp, 2);\n\t\t\t\t} else {\n\t\t\t\t\tw = (sp[1] << 8) | sp[0];\n\t\t\t\t\t*((uint16_t *)dp) = w;\n\t\t\t\t}\n\t\t\t\tsp += 2;\n\t\t\t\tdp += 2;\n\t\t\t\tbreak;\n\t\t\tcase 'd':\t/* 32-bit word, convert from little endian to CPU */\n\t\t\t\tdp += ((uintptr_t)dp & 1);\t/* Align to word boundary */\n\n\t\t\t\tif (host_endian) {\n\t\t\t\t\tmemcpy(dp, sp, 4);\n\t\t\t\t} else {\n\t\t\t\t\td = (sp[3] << 24) | (sp[2] << 16) |\n\t\t\t\t\t\t(sp[1] << 8) | sp[0];\n\t\t\t\t\t*((uint32_t *)dp) = d;\n\t\t\t\t}\n\t\t\t\tsp += 4;\n\t\t\t\tdp += 4;\n\t\t\t\tbreak;\n\t\t\tcase 'u':\t/* 16 byte UUID */\n\t\t\t\tmemcpy(dp, sp, 16);\n\t\t\t\tsp += 16;\n\t\t\t\tdp += 16;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn (int) (sp - source);\n}\n\nstatic void clear_endpoint(struct libusb_endpoint_descriptor *endpoint)\n{\n\tif (endpoint->extra)\n\t\tfree((unsigned char *) endpoint->extra);\n}\n\nstatic int parse_endpoint(struct libusb_context *ctx,\n\tstruct libusb_endpoint_descriptor *endpoint, unsigned char *buffer,\n\tint size, int host_endian)\n{\n\tstruct usb_descriptor_header header;\n\tunsigned char *extra;\n\tunsigned char *begin;\n\tint parsed = 0;\n\tint len;\n\n\tif (size < DESC_HEADER_LENGTH) {\n\t\tusbi_err(ctx, \"short endpoint descriptor read %d/%d\",\n\t\t\t size, DESC_HEADER_LENGTH);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tusbi_parse_descriptor(buffer, \"bb\", &header, 0);\n\tif (header.bDescriptorType != LIBUSB_DT_ENDPOINT) {\n\t\tusbi_err(ctx, \"unexpected descriptor %x (expected %x)\",\n\t\t\theader.bDescriptorType, LIBUSB_DT_ENDPOINT);\n\t\treturn parsed;\n\t}\n\tif (header.bLength > size) {\n\t\tusbi_warn(ctx, \"short endpoint descriptor read %d/%d\",\n\t\t\t  size, header.bLength);\n\t\treturn parsed;\n\t}\n\tif (header.bLength >= ENDPOINT_AUDIO_DESC_LENGTH)\n\t\tusbi_parse_descriptor(buffer, \"bbbbwbbb\", endpoint, host_endian);\n\telse if (header.bLength >= ENDPOINT_DESC_LENGTH)\n\t\tusbi_parse_descriptor(buffer, \"bbbbwb\", endpoint, host_endian);\n\telse {\n\t\tusbi_err(ctx, \"invalid endpoint bLength (%d)\", header.bLength);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tbuffer += header.bLength;\n\tsize -= header.bLength;\n\tparsed += header.bLength;\n\n\t/* Skip over the rest of the Class Specific or Vendor Specific */\n\t/*  descriptors */\n\tbegin = buffer;\n\twhile (size >= DESC_HEADER_LENGTH) {\n\t\tusbi_parse_descriptor(buffer, \"bb\", &header, 0);\n\t\tif (header.bLength < DESC_HEADER_LENGTH) {\n\t\t\tusbi_err(ctx, \"invalid extra ep desc len (%d)\",\n\t\t\t\t header.bLength);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t} else if (header.bLength > size) {\n\t\t\tusbi_warn(ctx, \"short extra ep desc read %d/%d\",\n\t\t\t\t  size, header.bLength);\n\t\t\treturn parsed;\n\t\t}\n\n\t\t/* If we find another \"proper\" descriptor then we're done  */\n\t\tif ((header.bDescriptorType == LIBUSB_DT_ENDPOINT) ||\n\t\t\t\t(header.bDescriptorType == LIBUSB_DT_INTERFACE) ||\n\t\t\t\t(header.bDescriptorType == LIBUSB_DT_CONFIG) ||\n\t\t\t\t(header.bDescriptorType == LIBUSB_DT_DEVICE))\n\t\t\tbreak;\n\n\t\tusbi_dbg(\"skipping descriptor %x\", header.bDescriptorType);\n\t\tbuffer += header.bLength;\n\t\tsize -= header.bLength;\n\t\tparsed += header.bLength;\n\t}\n\n\t/* Copy any unknown descriptors into a storage area for drivers */\n\t/*  to later parse */\n\tlen = (int)(buffer - begin);\n\tif (!len) {\n\t\tendpoint->extra = NULL;\n\t\tendpoint->extra_length = 0;\n\t\treturn parsed;\n\t}\n\n\textra = malloc(len);\n\tendpoint->extra = extra;\n\tif (!extra) {\n\t\tendpoint->extra_length = 0;\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\tmemcpy(extra, begin, len);\n\tendpoint->extra_length = len;\n\n\treturn parsed;\n}\n\nstatic void clear_interface(struct libusb_interface *usb_interface)\n{\n\tint i;\n\tint j;\n\n\tif (usb_interface->altsetting) {\n\t\tfor (i = 0; i < usb_interface->num_altsetting; i++) {\n\t\t\tstruct libusb_interface_descriptor *ifp =\n\t\t\t\t(struct libusb_interface_descriptor *)\n\t\t\t\tusb_interface->altsetting + i;\n\t\t\tif (ifp->extra)\n\t\t\t\tfree((void *) ifp->extra);\n\t\t\tif (ifp->endpoint) {\n\t\t\t\tfor (j = 0; j < ifp->bNumEndpoints; j++)\n\t\t\t\t\tclear_endpoint((struct libusb_endpoint_descriptor *)\n\t\t\t\t\t\tifp->endpoint + j);\n\t\t\t\tfree((void *) ifp->endpoint);\n\t\t\t}\n\t\t}\n\t\tfree((void *) usb_interface->altsetting);\n\t\tusb_interface->altsetting = NULL;\n\t}\n\n}\n\nstatic int parse_interface(libusb_context *ctx,\n\tstruct libusb_interface *usb_interface, unsigned char *buffer, int size,\n\tint host_endian)\n{\n\tint i;\n\tint len;\n\tint r;\n\tint parsed = 0;\n\tint interface_number = -1;\n\tsize_t tmp;\n\tstruct usb_descriptor_header header;\n\tstruct libusb_interface_descriptor *ifp;\n\tunsigned char *begin;\n\n\tusb_interface->num_altsetting = 0;\n\n\twhile (size >= INTERFACE_DESC_LENGTH) {\n\t\tstruct libusb_interface_descriptor *altsetting =\n\t\t\t(struct libusb_interface_descriptor *) usb_interface->altsetting;\n\t\taltsetting = usbi_reallocf(altsetting,\n\t\t\tsizeof(struct libusb_interface_descriptor) *\n\t\t\t(usb_interface->num_altsetting + 1));\n\t\tif (!altsetting) {\n\t\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\t\tgoto err;\n\t\t}\n\t\tusb_interface->altsetting = altsetting;\n\n\t\tifp = altsetting + usb_interface->num_altsetting;\n\t\tusbi_parse_descriptor(buffer, \"bbbbbbbbb\", ifp, 0);\n\t\tif (ifp->bDescriptorType != LIBUSB_DT_INTERFACE) {\n\t\t\tusbi_err(ctx, \"unexpected descriptor %x (expected %x)\",\n\t\t\t\t ifp->bDescriptorType, LIBUSB_DT_INTERFACE);\n\t\t\treturn parsed;\n\t\t}\n\t\tif (ifp->bLength < INTERFACE_DESC_LENGTH) {\n\t\t\tusbi_err(ctx, \"invalid interface bLength (%d)\",\n\t\t\t\t ifp->bLength);\n\t\t\tr = LIBUSB_ERROR_IO;\n\t\t\tgoto err;\n\t\t}\n\t\tif (ifp->bLength > size) {\n\t\t\tusbi_warn(ctx, \"short intf descriptor read %d/%d\",\n\t\t\t\t size, ifp->bLength);\n\t\t\treturn parsed;\n\t\t}\n\t\tif (ifp->bNumEndpoints > USB_MAXENDPOINTS) {\n\t\t\tusbi_err(ctx, \"too many endpoints (%d)\", ifp->bNumEndpoints);\n\t\t\tr = LIBUSB_ERROR_IO;\n\t\t\tgoto err;\n\t\t}\n\n\t\tusb_interface->num_altsetting++;\n\t\tifp->extra = NULL;\n\t\tifp->extra_length = 0;\n\t\tifp->endpoint = NULL;\n\n\t\tif (interface_number == -1)\n\t\t\tinterface_number = ifp->bInterfaceNumber;\n\n\t\t/* Skip over the interface */\n\t\tbuffer += ifp->bLength;\n\t\tparsed += ifp->bLength;\n\t\tsize -= ifp->bLength;\n\n\t\tbegin = buffer;\n\n\t\t/* Skip over any interface, class or vendor descriptors */\n\t\twhile (size >= DESC_HEADER_LENGTH) {\n\t\t\tusbi_parse_descriptor(buffer, \"bb\", &header, 0);\n\t\t\tif (header.bLength < DESC_HEADER_LENGTH) {\n\t\t\t\tusbi_err(ctx,\n\t\t\t\t\t \"invalid extra intf desc len (%d)\",\n\t\t\t\t\t header.bLength);\n\t\t\t\tr = LIBUSB_ERROR_IO;\n\t\t\t\tgoto err;\n\t\t\t} else if (header.bLength > size) {\n\t\t\t\tusbi_warn(ctx,\n\t\t\t\t\t  \"short extra intf desc read %d/%d\",\n\t\t\t\t\t  size, header.bLength);\n\t\t\t\treturn parsed;\n\t\t\t}\n\n\t\t\t/* If we find another \"proper\" descriptor then we're done */\n\t\t\tif ((header.bDescriptorType == LIBUSB_DT_INTERFACE) ||\n\t\t\t\t\t(header.bDescriptorType == LIBUSB_DT_ENDPOINT) ||\n\t\t\t\t\t(header.bDescriptorType == LIBUSB_DT_CONFIG) ||\n\t\t\t\t\t(header.bDescriptorType == LIBUSB_DT_DEVICE))\n\t\t\t\tbreak;\n\n\t\t\tbuffer += header.bLength;\n\t\t\tparsed += header.bLength;\n\t\t\tsize -= header.bLength;\n\t\t}\n\n\t\t/* Copy any unknown descriptors into a storage area for */\n\t\t/*  drivers to later parse */\n\t\tlen = (int)(buffer - begin);\n\t\tif (len) {\n\t\t\tifp->extra = malloc(len);\n\t\t\tif (!ifp->extra) {\n\t\t\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\t\t\tgoto err;\n\t\t\t}\n\t\t\tmemcpy((unsigned char *) ifp->extra, begin, len);\n\t\t\tifp->extra_length = len;\n\t\t}\n\n\t\tif (ifp->bNumEndpoints > 0) {\n\t\t\tstruct libusb_endpoint_descriptor *endpoint;\n\t\t\ttmp = ifp->bNumEndpoints * sizeof(struct libusb_endpoint_descriptor);\n\t\t\tendpoint = malloc(tmp);\n\t\t\tifp->endpoint = endpoint;\n\t\t\tif (!endpoint) {\n\t\t\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\t\t\tgoto err;\n\t\t\t}\n\n\t\t\tmemset(endpoint, 0, tmp);\n\t\t\tfor (i = 0; i < ifp->bNumEndpoints; i++) {\n\t\t\t\tr = parse_endpoint(ctx, endpoint + i, buffer, size,\n\t\t\t\t\thost_endian);\n\t\t\t\tif (r < 0)\n\t\t\t\t\tgoto err;\n\t\t\t\tif (r == 0) {\n\t\t\t\t\tifp->bNumEndpoints = (uint8_t)i;\n\t\t\t\t\tbreak;;\n\t\t\t\t}\n\n\t\t\t\tbuffer += r;\n\t\t\t\tparsed += r;\n\t\t\t\tsize -= r;\n\t\t\t}\n\t\t}\n\n\t\t/* We check to see if it's an alternate to this one */\n\t\tifp = (struct libusb_interface_descriptor *) buffer;\n\t\tif (size < LIBUSB_DT_INTERFACE_SIZE ||\n\t\t\t\tifp->bDescriptorType != LIBUSB_DT_INTERFACE ||\n\t\t\t\tifp->bInterfaceNumber != interface_number)\n\t\t\treturn parsed;\n\t}\n\n\treturn parsed;\nerr:\n\tclear_interface(usb_interface);\n\treturn r;\n}\n\nstatic void clear_configuration(struct libusb_config_descriptor *config)\n{\n\tif (config->interface) {\n\t\tint i;\n\t\tfor (i = 0; i < config->bNumInterfaces; i++)\n\t\t\tclear_interface((struct libusb_interface *)\n\t\t\t\tconfig->interface + i);\n\t\tfree((void *) config->interface);\n\t}\n\tif (config->extra)\n\t\tfree((void *) config->extra);\n}\n\nstatic int parse_configuration(struct libusb_context *ctx,\n\tstruct libusb_config_descriptor *config, unsigned char *buffer,\n\tint size, int host_endian)\n{\n\tint i;\n\tint r;\n\tsize_t tmp;\n\tstruct usb_descriptor_header header;\n\tstruct libusb_interface *usb_interface;\n\n\tif (size < LIBUSB_DT_CONFIG_SIZE) {\n\t\tusbi_err(ctx, \"short config descriptor read %d/%d\",\n\t\t\t size, LIBUSB_DT_CONFIG_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tusbi_parse_descriptor(buffer, \"bbwbbbbb\", config, host_endian);\n\tif (config->bDescriptorType != LIBUSB_DT_CONFIG) {\n\t\tusbi_err(ctx, \"unexpected descriptor %x (expected %x)\",\n\t\t\t config->bDescriptorType, LIBUSB_DT_CONFIG);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\tif (config->bLength < LIBUSB_DT_CONFIG_SIZE) {\n\t\tusbi_err(ctx, \"invalid config bLength (%d)\", config->bLength);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\tif (config->bLength > size) {\n\t\tusbi_err(ctx, \"short config descriptor read %d/%d\",\n\t\t\t size, config->bLength);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\tif (config->bNumInterfaces > USB_MAXINTERFACES) {\n\t\tusbi_err(ctx, \"too many interfaces (%d)\", config->bNumInterfaces);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\ttmp = config->bNumInterfaces * sizeof(struct libusb_interface);\n\tusb_interface = malloc(tmp);\n\tconfig->interface = usb_interface;\n\tif (!config->interface)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tmemset(usb_interface, 0, tmp);\n\tbuffer += config->bLength;\n\tsize -= config->bLength;\n\n\tconfig->extra = NULL;\n\tconfig->extra_length = 0;\n\n\tfor (i = 0; i < config->bNumInterfaces; i++) {\n\t\tint len;\n\t\tunsigned char *begin;\n\n\t\t/* Skip over the rest of the Class Specific or Vendor */\n\t\t/*  Specific descriptors */\n\t\tbegin = buffer;\n\t\twhile (size >= DESC_HEADER_LENGTH) {\n\t\t\tusbi_parse_descriptor(buffer, \"bb\", &header, 0);\n\n\t\t\tif (header.bLength < DESC_HEADER_LENGTH) {\n\t\t\t\tusbi_err(ctx,\n\t\t\t\t\t \"invalid extra config desc len (%d)\",\n\t\t\t\t\t header.bLength);\n\t\t\t\tr = LIBUSB_ERROR_IO;\n\t\t\t\tgoto err;\n\t\t\t} else if (header.bLength > size) {\n\t\t\t\tusbi_warn(ctx,\n\t\t\t\t\t  \"short extra config desc read %d/%d\",\n\t\t\t\t\t  size, header.bLength);\n\t\t\t\tconfig->bNumInterfaces = (uint8_t)i;\n\t\t\t\treturn size;\n\t\t\t}\n\n\t\t\t/* If we find another \"proper\" descriptor then we're done */\n\t\t\tif ((header.bDescriptorType == LIBUSB_DT_ENDPOINT) ||\n\t\t\t\t\t(header.bDescriptorType == LIBUSB_DT_INTERFACE) ||\n\t\t\t\t\t(header.bDescriptorType == LIBUSB_DT_CONFIG) ||\n\t\t\t\t\t(header.bDescriptorType == LIBUSB_DT_DEVICE))\n\t\t\t\tbreak;\n\n\t\t\tusbi_dbg(\"skipping descriptor 0x%x\\n\", header.bDescriptorType);\n\t\t\tbuffer += header.bLength;\n\t\t\tsize -= header.bLength;\n\t\t}\n\n\t\t/* Copy any unknown descriptors into a storage area for */\n\t\t/*  drivers to later parse */\n\t\tlen = (int)(buffer - begin);\n\t\tif (len) {\n\t\t\t/* FIXME: We should realloc and append here */\n\t\t\tif (!config->extra_length) {\n\t\t\t\tconfig->extra = malloc(len);\n\t\t\t\tif (!config->extra) {\n\t\t\t\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\t\t\t\tgoto err;\n\t\t\t\t}\n\n\t\t\t\tmemcpy((unsigned char *) config->extra, begin, len);\n\t\t\t\tconfig->extra_length = len;\n\t\t\t}\n\t\t}\n\n\t\tr = parse_interface(ctx, usb_interface + i, buffer, size, host_endian);\n\t\tif (r < 0)\n\t\t\tgoto err;\n\t\tif (r == 0) {\n\t\t\tconfig->bNumInterfaces = (uint8_t)i;\n\t\t\tbreak;\n\t\t}\n\n\t\tbuffer += r;\n\t\tsize -= r;\n\t}\n\n\treturn size;\n\nerr:\n\tclear_configuration(config);\n\treturn r;\n}\n\nstatic int raw_desc_to_config(struct libusb_context *ctx,\n\tunsigned char *buf, int size, int host_endian,\n\tstruct libusb_config_descriptor **config)\n{\n\tstruct libusb_config_descriptor *_config = malloc(sizeof(*_config));\n\tint r;\n\t\n\tif (!_config)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tr = parse_configuration(ctx, _config, buf, size, host_endian);\n\tif (r < 0) {\n\t\tusbi_err(ctx, \"parse_configuration failed with error %d\", r);\n\t\tfree(_config);\n\t\treturn r;\n\t} else if (r > 0) {\n\t\tusbi_warn(ctx, \"still %d bytes of descriptor data left\", r);\n\t}\n\t\n\t*config = _config;\n\treturn LIBUSB_SUCCESS;\n}\n\nint usbi_device_cache_descriptor(libusb_device *dev)\n{\n\tint r, host_endian = 0;\n\n\tr = usbi_backend->get_device_descriptor(dev, (unsigned char *) &dev->device_descriptor,\n\t\t\t\t\t\t&host_endian);\n\tif (r < 0)\n\t\treturn r;\n\n\tif (!host_endian) {\n\t\tdev->device_descriptor.bcdUSB = libusb_le16_to_cpu(dev->device_descriptor.bcdUSB);\n\t\tdev->device_descriptor.idVendor = libusb_le16_to_cpu(dev->device_descriptor.idVendor);\n\t\tdev->device_descriptor.idProduct = libusb_le16_to_cpu(dev->device_descriptor.idProduct);\n\t\tdev->device_descriptor.bcdDevice = libusb_le16_to_cpu(dev->device_descriptor.bcdDevice);\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\n/** \\ingroup desc\n * Get the USB device descriptor for a given device.\n *\n * This is a non-blocking function; the device descriptor is cached in memory.\n *\n * Note since libusb-1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102, this\n * function always succeeds.\n *\n * \\param dev the device\n * \\param desc output location for the descriptor data\n * \\returns 0 on success or a LIBUSB_ERROR code on failure\n */\nint API_EXPORTED libusb_get_device_descriptor(libusb_device *dev,\n\tstruct libusb_device_descriptor *desc)\n{\n\tusbi_dbg(\"\");\n\tmemcpy((unsigned char *) desc, (unsigned char *) &dev->device_descriptor,\n\t       sizeof (dev->device_descriptor));\n\treturn 0;\n}\n\n/** \\ingroup desc\n * Get the USB configuration descriptor for the currently active configuration.\n * This is a non-blocking function which does not involve any requests being\n * sent to the device.\n *\n * \\param dev a device\n * \\param config output location for the USB configuration descriptor. Only\n * valid if 0 was returned. Must be freed with libusb_free_config_descriptor()\n * after use.\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state\n * \\returns another LIBUSB_ERROR code on error\n * \\see libusb_get_config_descriptor\n */\nint API_EXPORTED libusb_get_active_config_descriptor(libusb_device *dev,\n\tstruct libusb_config_descriptor **config)\n{\n\tstruct libusb_config_descriptor _config;\n\tunsigned char tmp[LIBUSB_DT_CONFIG_SIZE];\n\tunsigned char *buf = NULL;\n\tint host_endian = 0;\n\tint r;\n\n\tr = usbi_backend->get_active_config_descriptor(dev, tmp,\n\t\tLIBUSB_DT_CONFIG_SIZE, &host_endian);\n\tif (r < 0)\n\t\treturn r;\n\tif (r < LIBUSB_DT_CONFIG_SIZE) {\n\t\tusbi_err(dev->ctx, \"short config descriptor read %d/%d\",\n\t\t\t r, LIBUSB_DT_CONFIG_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tusbi_parse_descriptor(tmp, \"bbw\", &_config, host_endian);\n\tbuf = malloc(_config.wTotalLength);\n\tif (!buf)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tr = usbi_backend->get_active_config_descriptor(dev, buf,\n\t\t_config.wTotalLength, &host_endian);\n\tif (r >= 0)\n\t\tr = raw_desc_to_config(dev->ctx, buf, r, host_endian, config);\n\n\tfree(buf);\n\treturn r;\n}\n\n/** \\ingroup desc\n * Get a USB configuration descriptor based on its index.\n * This is a non-blocking function which does not involve any requests being\n * sent to the device.\n *\n * \\param dev a device\n * \\param config_index the index of the configuration you wish to retrieve\n * \\param config output location for the USB configuration descriptor. Only\n * valid if 0 was returned. Must be freed with libusb_free_config_descriptor()\n * after use.\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist\n * \\returns another LIBUSB_ERROR code on error\n * \\see libusb_get_active_config_descriptor()\n * \\see libusb_get_config_descriptor_by_value()\n */\nint API_EXPORTED libusb_get_config_descriptor(libusb_device *dev,\n\tuint8_t config_index, struct libusb_config_descriptor **config)\n{\n\tstruct libusb_config_descriptor _config;\n\tunsigned char tmp[LIBUSB_DT_CONFIG_SIZE];\n\tunsigned char *buf = NULL;\n\tint host_endian = 0;\n\tint r;\n\n\tusbi_dbg(\"index %d\", config_index);\n\tif (config_index >= dev->num_configurations)\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\tr = usbi_backend->get_config_descriptor(dev, config_index, tmp,\n\t\tLIBUSB_DT_CONFIG_SIZE, &host_endian);\n\tif (r < 0)\n\t\treturn r;\n\tif (r < LIBUSB_DT_CONFIG_SIZE) {\n\t\tusbi_err(dev->ctx, \"short config descriptor read %d/%d\",\n\t\t\t r, LIBUSB_DT_CONFIG_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tusbi_parse_descriptor(tmp, \"bbw\", &_config, host_endian);\n\tbuf = malloc(_config.wTotalLength);\n\tif (!buf)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tr = usbi_backend->get_config_descriptor(dev, config_index, buf,\n\t\t_config.wTotalLength, &host_endian);\n\tif (r >= 0)\n\t\tr = raw_desc_to_config(dev->ctx, buf, r, host_endian, config);\n\n\tfree(buf);\n\treturn r;\n}\n\n/* iterate through all configurations, returning the index of the configuration\n * matching a specific bConfigurationValue in the idx output parameter, or -1\n * if the config was not found.\n * returns 0 on success or a LIBUSB_ERROR code\n */\nint usbi_get_config_index_by_value(struct libusb_device *dev,\n\tuint8_t bConfigurationValue, int *idx)\n{\n\tuint8_t i;\n\n\tusbi_dbg(\"value %d\", bConfigurationValue);\n\tfor (i = 0; i < dev->num_configurations; i++) {\n\t\tunsigned char tmp[6];\n\t\tint host_endian;\n\t\tint r = usbi_backend->get_config_descriptor(dev, i, tmp, sizeof(tmp),\n\t\t\t&host_endian);\n\t\tif (r < 0) {\n\t\t\t*idx = -1;\n\t\t\treturn r;\n\t\t}\n\t\tif (tmp[5] == bConfigurationValue) {\n\t\t\t*idx = i;\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\t*idx = -1;\n\treturn 0;\n}\n\n/** \\ingroup desc\n * Get a USB configuration descriptor with a specific bConfigurationValue.\n * This is a non-blocking function which does not involve any requests being\n * sent to the device.\n *\n * \\param dev a device\n * \\param bConfigurationValue the bConfigurationValue of the configuration you\n * wish to retrieve\n * \\param config output location for the USB configuration descriptor. Only\n * valid if 0 was returned. Must be freed with libusb_free_config_descriptor()\n * after use.\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist\n * \\returns another LIBUSB_ERROR code on error\n * \\see libusb_get_active_config_descriptor()\n * \\see libusb_get_config_descriptor()\n */\nint API_EXPORTED libusb_get_config_descriptor_by_value(libusb_device *dev,\n\tuint8_t bConfigurationValue, struct libusb_config_descriptor **config)\n{\n\tint r, idx, host_endian;\n\tunsigned char *buf = NULL;\n\n\tif (usbi_backend->get_config_descriptor_by_value) {\n\t\tr = usbi_backend->get_config_descriptor_by_value(dev,\n\t\t\tbConfigurationValue, &buf, &host_endian);\n\t\tif (r < 0)\n\t\t\treturn r;\n\t\treturn raw_desc_to_config(dev->ctx, buf, r, host_endian, config);\n\t}\n\n\tr = usbi_get_config_index_by_value(dev, bConfigurationValue, &idx);\n\tif (r < 0)\n\t\treturn r;\n\telse if (idx == -1)\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\telse\n\t\treturn libusb_get_config_descriptor(dev, (uint8_t) idx, config);\n}\n\n/** \\ingroup desc\n * Free a configuration descriptor obtained from\n * libusb_get_active_config_descriptor() or libusb_get_config_descriptor().\n * It is safe to call this function with a NULL config parameter, in which\n * case the function simply returns.\n *\n * \\param config the configuration descriptor to free\n */\nvoid API_EXPORTED libusb_free_config_descriptor(\n\tstruct libusb_config_descriptor *config)\n{\n\tif (!config)\n\t\treturn;\n\n\tclear_configuration(config);\n\tfree(config);\n}\n\n/** \\ingroup desc\n * Get an endpoints superspeed endpoint companion descriptor (if any)\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param endpoint endpoint descriptor from which to get the superspeed\n * endpoint companion descriptor\n * \\param ep_comp output location for the superspeed endpoint companion\n * descriptor. Only valid if 0 was returned. Must be freed with\n * libusb_free_ss_endpoint_companion_descriptor() after use.\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the configuration does not exist\n * \\returns another LIBUSB_ERROR code on error\n */\nint API_EXPORTED libusb_get_ss_endpoint_companion_descriptor(\n\tstruct libusb_context *ctx,\n\tconst struct libusb_endpoint_descriptor *endpoint,\n\tstruct libusb_ss_endpoint_companion_descriptor **ep_comp)\n{\n\tstruct usb_descriptor_header header;\n\tint size = endpoint->extra_length;\n\tconst unsigned char *buffer = endpoint->extra;\n\n\t*ep_comp = NULL;\n\n\twhile (size >= DESC_HEADER_LENGTH) {\n\t\tusbi_parse_descriptor(buffer, \"bb\", &header, 0);\n\t\tif (header.bLength < 2 || header.bLength > size) {\n\t\t\tusbi_err(ctx, \"invalid descriptor length %d\",\n\t\t\t\t header.bLength);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t}\n\t\tif (header.bDescriptorType != LIBUSB_DT_SS_ENDPOINT_COMPANION) {\n\t\t\tbuffer += header.bLength;\n\t\t\tsize -= header.bLength;\n\t\t\tcontinue;\n\t\t}\n\t\tif (header.bLength < LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE) {\n\t\t\tusbi_err(ctx, \"invalid ss-ep-comp-desc length %d\",\n\t\t\t\t header.bLength);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t}\n\t\t*ep_comp = malloc(sizeof(**ep_comp));\n\t\tif (*ep_comp == NULL)\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\tusbi_parse_descriptor(buffer, \"bbbbw\", *ep_comp, 0);\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\treturn LIBUSB_ERROR_NOT_FOUND;\n}\n\n/** \\ingroup desc\n * Free a superspeed endpoint companion descriptor obtained from\n * libusb_get_ss_endpoint_companion_descriptor().\n * It is safe to call this function with a NULL ep_comp parameter, in which\n * case the function simply returns.\n *\n * \\param ep_comp the superspeed endpoint companion descriptor to free\n */\nvoid API_EXPORTED libusb_free_ss_endpoint_companion_descriptor(\n\tstruct libusb_ss_endpoint_companion_descriptor *ep_comp)\n{\n\tfree(ep_comp);\n}\n\nstatic int parse_bos(struct libusb_context *ctx,\n\tstruct libusb_bos_descriptor **bos,\n\tunsigned char *buffer, int size, int host_endian)\n{\n\tstruct libusb_bos_descriptor bos_header, *_bos;\n\tstruct libusb_bos_dev_capability_descriptor dev_cap;\n\tint i;\n\n\tif (size < LIBUSB_DT_BOS_SIZE) {\n\t\tusbi_err(ctx, \"short bos descriptor read %d/%d\",\n\t\t\t size, LIBUSB_DT_BOS_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tusbi_parse_descriptor(buffer, \"bbwb\", &bos_header, host_endian);\n\tif (bos_header.bDescriptorType != LIBUSB_DT_BOS) {\n\t\tusbi_err(ctx, \"unexpected descriptor %x (expected %x)\",\n\t\t\t bos_header.bDescriptorType, LIBUSB_DT_BOS);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\tif (bos_header.bLength < LIBUSB_DT_BOS_SIZE) {\n\t\tusbi_err(ctx, \"invalid bos bLength (%d)\", bos_header.bLength);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\tif (bos_header.bLength > size) {\n\t\tusbi_err(ctx, \"short bos descriptor read %d/%d\",\n\t\t\t size, bos_header.bLength);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\t_bos = calloc (1,\n\t\tsizeof(*_bos) + bos_header.bNumDeviceCaps * sizeof(void *));\n\tif (!_bos)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tusbi_parse_descriptor(buffer, \"bbwb\", _bos, host_endian);\n\tbuffer += bos_header.bLength;\n\tsize -= bos_header.bLength;\n\n\t/* Get the device capability descriptors */\n\tfor (i = 0; i < bos_header.bNumDeviceCaps; i++) {\n\t\tif (size < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) {\n\t\t\tusbi_warn(ctx, \"short dev-cap descriptor read %d/%d\",\n\t\t\t\t  size, LIBUSB_DT_DEVICE_CAPABILITY_SIZE);\n\t\t\tbreak;\n\t\t}\n\t\tusbi_parse_descriptor(buffer, \"bbb\", &dev_cap, host_endian);\n\t\tif (dev_cap.bDescriptorType != LIBUSB_DT_DEVICE_CAPABILITY) {\n\t\t\tusbi_warn(ctx, \"unexpected descriptor %x (expected %x)\",\n\t\t\t\t  dev_cap.bDescriptorType, LIBUSB_DT_DEVICE_CAPABILITY);\n\t\t\tbreak;\n\t\t}\n\t\tif (dev_cap.bLength < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) {\n\t\t\tusbi_err(ctx, \"invalid dev-cap bLength (%d)\",\n\t\t\t\t dev_cap.bLength);\n\t\t\tlibusb_free_bos_descriptor(_bos);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t}\n\t\tif (dev_cap.bLength > size) {\n\t\t\tusbi_warn(ctx, \"short dev-cap descriptor read %d/%d\",\n\t\t\t\t  size, dev_cap.bLength);\n\t\t\tbreak;\n\t\t}\n\n\t\t_bos->dev_capability[i] = malloc(dev_cap.bLength);\n\t\tif (!_bos->dev_capability[i]) {\n\t\t\tlibusb_free_bos_descriptor(_bos);\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\t}\n\t\tmemcpy(_bos->dev_capability[i], buffer, dev_cap.bLength);\n\t\tbuffer += dev_cap.bLength;\n\t\tsize -= dev_cap.bLength;\n\t}\n\t_bos->bNumDeviceCaps = (uint8_t)i;\n\t*bos = _bos;\n\n\treturn LIBUSB_SUCCESS;\n}\n\n/** \\ingroup desc\n * Get a Binary Object Store (BOS) descriptor\n * This is a BLOCKING function, which will send requests to the device.\n *\n * \\param handle the handle of an open libusb device\n * \\param bos output location for the BOS descriptor. Only valid if 0 was returned.\n * Must be freed with \\ref libusb_free_bos_descriptor() after use.\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the device doesn't have a BOS descriptor\n * \\returns another LIBUSB_ERROR code on error\n */\nint API_EXPORTED libusb_get_bos_descriptor(libusb_device_handle *handle,\n\tstruct libusb_bos_descriptor **bos)\n{\n\tstruct libusb_bos_descriptor _bos;\n\tuint8_t bos_header[LIBUSB_DT_BOS_SIZE] = {0};\n\tunsigned char *bos_data = NULL;\n\tconst int host_endian = 0;\n\tint r;\n\n\t/* Read the BOS. This generates 2 requests on the bus,\n\t * one for the header, and one for the full BOS */\n\tr = libusb_get_descriptor(handle, LIBUSB_DT_BOS, 0, bos_header,\n\t\t\t\t  LIBUSB_DT_BOS_SIZE);\n\tif (r < 0) {\n\t\tif (r != LIBUSB_ERROR_PIPE)\n\t\t\tusbi_err(handle->dev->ctx, \"failed to read BOS (%d)\", r);\n\t\treturn r;\n\t}\n\tif (r < LIBUSB_DT_BOS_SIZE) {\n\t\tusbi_err(handle->dev->ctx, \"short BOS read %d/%d\",\n\t\t\t r, LIBUSB_DT_BOS_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tusbi_parse_descriptor(bos_header, \"bbwb\", &_bos, host_endian);\n\tusbi_dbg(\"found BOS descriptor: size %d bytes, %d capabilities\",\n\t\t _bos.wTotalLength, _bos.bNumDeviceCaps);\n\tbos_data = calloc(_bos.wTotalLength, 1);\n\tif (bos_data == NULL)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tr = libusb_get_descriptor(handle, LIBUSB_DT_BOS, 0, bos_data,\n\t\t\t\t  _bos.wTotalLength);\n\tif (r >= 0)\n\t\tr = parse_bos(handle->dev->ctx, bos, bos_data, r, host_endian);\n\telse\n\t\tusbi_err(handle->dev->ctx, \"failed to read BOS (%d)\", r);\n\n\tfree(bos_data);\n\treturn r;\n}\n\n/** \\ingroup desc\n * Free a BOS descriptor obtained from libusb_get_bos_descriptor().\n * It is safe to call this function with a NULL bos parameter, in which\n * case the function simply returns.\n *\n * \\param bos the BOS descriptor to free\n */\nvoid API_EXPORTED libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos)\n{\n\tint i;\n\n\tif (!bos)\n\t\treturn;\n\n\tfor (i = 0; i < bos->bNumDeviceCaps; i++)\n\t\tfree(bos->dev_capability[i]);\n\tfree(bos);\n}\n\n/** \\ingroup desc\n * Get an USB 2.0 Extension descriptor\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param dev_cap Device Capability descriptor with a bDevCapabilityType of\n * \\ref libusb_capability_type::LIBUSB_BT_USB_2_0_EXTENSION\n * LIBUSB_BT_USB_2_0_EXTENSION\n * \\param usb_2_0_extension output location for the USB 2.0 Extension\n * descriptor. Only valid if 0 was returned. Must be freed with\n * libusb_free_usb_2_0_extension_descriptor() after use.\n * \\returns 0 on success\n * \\returns a LIBUSB_ERROR code on error\n */\nint API_EXPORTED libusb_get_usb_2_0_extension_descriptor(\n\tstruct libusb_context *ctx,\n\tstruct libusb_bos_dev_capability_descriptor *dev_cap,\n\tstruct libusb_usb_2_0_extension_descriptor **usb_2_0_extension)\n{\n\tstruct libusb_usb_2_0_extension_descriptor *_usb_2_0_extension;\n\tconst int host_endian = 0;\n\n\tif (dev_cap->bDevCapabilityType != LIBUSB_BT_USB_2_0_EXTENSION) {\n\t\tusbi_err(ctx, \"unexpected bDevCapabilityType %x (expected %x)\",\n\t\t\t dev_cap->bDevCapabilityType,\n\t\t\t LIBUSB_BT_USB_2_0_EXTENSION);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\tif (dev_cap->bLength < LIBUSB_BT_USB_2_0_EXTENSION_SIZE) {\n\t\tusbi_err(ctx, \"short dev-cap descriptor read %d/%d\",\n\t\t\t dev_cap->bLength, LIBUSB_BT_USB_2_0_EXTENSION_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\t_usb_2_0_extension = malloc(sizeof(*_usb_2_0_extension));\n\tif (!_usb_2_0_extension)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tusbi_parse_descriptor((unsigned char *)dev_cap, \"bbbd\",\n\t\t\t      _usb_2_0_extension, host_endian);\n\n\t*usb_2_0_extension = _usb_2_0_extension;\n\treturn LIBUSB_SUCCESS;\n}\n\n/** \\ingroup desc\n * Free a USB 2.0 Extension descriptor obtained from\n * libusb_get_usb_2_0_extension_descriptor().\n * It is safe to call this function with a NULL usb_2_0_extension parameter,\n * in which case the function simply returns.\n *\n * \\param usb_2_0_extension the USB 2.0 Extension descriptor to free\n */\nvoid API_EXPORTED libusb_free_usb_2_0_extension_descriptor(\n\tstruct libusb_usb_2_0_extension_descriptor *usb_2_0_extension)\n{\n\tfree(usb_2_0_extension);\n}\n\n/** \\ingroup desc\n * Get a SuperSpeed USB Device Capability descriptor\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param dev_cap Device Capability descriptor with a bDevCapabilityType of\n * \\ref libusb_capability_type::LIBUSB_BT_SS_USB_DEVICE_CAPABILITY\n * LIBUSB_BT_SS_USB_DEVICE_CAPABILITY\n * \\param ss_usb_device_cap output location for the SuperSpeed USB Device\n * Capability descriptor. Only valid if 0 was returned. Must be freed with\n * libusb_free_ss_usb_device_capability_descriptor() after use.\n * \\returns 0 on success\n * \\returns a LIBUSB_ERROR code on error\n */\nint API_EXPORTED libusb_get_ss_usb_device_capability_descriptor(\n\tstruct libusb_context *ctx,\n\tstruct libusb_bos_dev_capability_descriptor *dev_cap,\n\tstruct libusb_ss_usb_device_capability_descriptor **ss_usb_device_cap)\n{\n\tstruct libusb_ss_usb_device_capability_descriptor *_ss_usb_device_cap;\n\tconst int host_endian = 0;\n\n\tif (dev_cap->bDevCapabilityType != LIBUSB_BT_SS_USB_DEVICE_CAPABILITY) {\n\t\tusbi_err(ctx, \"unexpected bDevCapabilityType %x (expected %x)\",\n\t\t\t dev_cap->bDevCapabilityType,\n\t\t\t LIBUSB_BT_SS_USB_DEVICE_CAPABILITY);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\tif (dev_cap->bLength < LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE) {\n\t\tusbi_err(ctx, \"short dev-cap descriptor read %d/%d\",\n\t\t\t dev_cap->bLength, LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\t_ss_usb_device_cap = malloc(sizeof(*_ss_usb_device_cap));\n\tif (!_ss_usb_device_cap)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tusbi_parse_descriptor((unsigned char *)dev_cap, \"bbbbwbbw\",\n\t\t\t      _ss_usb_device_cap, host_endian);\n\n\t*ss_usb_device_cap = _ss_usb_device_cap;\n\treturn LIBUSB_SUCCESS;\n}\n\n/** \\ingroup desc\n * Free a SuperSpeed USB Device Capability descriptor obtained from\n * libusb_get_ss_usb_device_capability_descriptor().\n * It is safe to call this function with a NULL ss_usb_device_cap\n * parameter, in which case the function simply returns.\n *\n * \\param ss_usb_device_cap the USB 2.0 Extension descriptor to free\n */\nvoid API_EXPORTED libusb_free_ss_usb_device_capability_descriptor(\n\tstruct libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap)\n{\n\tfree(ss_usb_device_cap);\n}\n\n/** \\ingroup desc\n * Get a Container ID descriptor\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param dev_cap Device Capability descriptor with a bDevCapabilityType of\n * \\ref libusb_capability_type::LIBUSB_BT_CONTAINER_ID\n * LIBUSB_BT_CONTAINER_ID\n * \\param container_id output location for the Container ID descriptor.\n * Only valid if 0 was returned. Must be freed with\n * libusb_free_container_id_descriptor() after use.\n * \\returns 0 on success\n * \\returns a LIBUSB_ERROR code on error\n */\nint API_EXPORTED libusb_get_container_id_descriptor(struct libusb_context *ctx,\n\tstruct libusb_bos_dev_capability_descriptor *dev_cap,\n\tstruct libusb_container_id_descriptor **container_id)\n{\n\tstruct libusb_container_id_descriptor *_container_id;\n\tconst int host_endian = 0;\n\n\tif (dev_cap->bDevCapabilityType != LIBUSB_BT_CONTAINER_ID) {\n\t\tusbi_err(ctx, \"unexpected bDevCapabilityType %x (expected %x)\",\n\t\t\t dev_cap->bDevCapabilityType,\n\t\t\t LIBUSB_BT_CONTAINER_ID);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\tif (dev_cap->bLength < LIBUSB_BT_CONTAINER_ID_SIZE) {\n\t\tusbi_err(ctx, \"short dev-cap descriptor read %d/%d\",\n\t\t\t dev_cap->bLength, LIBUSB_BT_CONTAINER_ID_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\t_container_id = malloc(sizeof(*_container_id));\n\tif (!_container_id)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tusbi_parse_descriptor((unsigned char *)dev_cap, \"bbbbu\",\n\t\t\t      _container_id, host_endian);\n\n\t*container_id = _container_id;\n\treturn LIBUSB_SUCCESS;\n}\n\n/** \\ingroup desc\n * Free a Container ID descriptor obtained from\n * libusb_get_container_id_descriptor().\n * It is safe to call this function with a NULL container_id parameter,\n * in which case the function simply returns.\n *\n * \\param container_id the USB 2.0 Extension descriptor to free\n */\nvoid API_EXPORTED libusb_free_container_id_descriptor(\n\tstruct libusb_container_id_descriptor *container_id)\n{\n\tfree(container_id);\n}\n\n/** \\ingroup desc\n * Retrieve a string descriptor in C style ASCII.\n *\n * Wrapper around libusb_get_string_descriptor(). Uses the first language\n * supported by the device.\n *\n * \\param dev a device handle\n * \\param desc_index the index of the descriptor to retrieve\n * \\param data output buffer for ASCII string descriptor\n * \\param length size of data buffer\n * \\returns number of bytes returned in data, or LIBUSB_ERROR code on failure\n */\nint API_EXPORTED libusb_get_string_descriptor_ascii(libusb_device_handle *dev,\n\tuint8_t desc_index, unsigned char *data, int length)\n{\n\tunsigned char tbuf[255]; /* Some devices choke on size > 255 */\n\tint r, si, di;\n\tuint16_t langid;\n\n\t/* Asking for the zero'th index is special - it returns a string\n\t * descriptor that contains all the language IDs supported by the\n\t * device. Typically there aren't many - often only one. Language\n\t * IDs are 16 bit numbers, and they start at the third byte in the\n\t * descriptor. There's also no point in trying to read descriptor 0\n\t * with this function. See USB 2.0 specification section 9.6.7 for\n\t * more information.\n\t */\n\n\tif (desc_index == 0)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\tr = libusb_get_string_descriptor(dev, 0, 0, tbuf, sizeof(tbuf));\n\tif (r < 0)\n\t\treturn r;\n\n\tif (r < 4)\n\t\treturn LIBUSB_ERROR_IO;\n\n\tlangid = tbuf[2] | (tbuf[3] << 8);\n\n\tr = libusb_get_string_descriptor(dev, desc_index, langid, tbuf,\n\t\tsizeof(tbuf));\n\tif (r < 0)\n\t\treturn r;\n\n\tif (tbuf[1] != LIBUSB_DT_STRING)\n\t\treturn LIBUSB_ERROR_IO;\n\n\tif (tbuf[0] > r)\n\t\treturn LIBUSB_ERROR_IO;\n\n\tfor (di = 0, si = 2; si < tbuf[0]; si += 2) {\n\t\tif (di >= (length - 1))\n\t\t\tbreak;\n\n\t\tif ((tbuf[si] & 0x80) || (tbuf[si + 1])) /* non-ASCII */\n\t\t\tdata[di++] = '?';\n\t\telse\n\t\t\tdata[di++] = tbuf[si];\n\t}\n\n\tdata[di] = 0;\n\treturn di;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/hotplug.c",
    "content": "/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */\n/*\n * Hotplug functions for libusb\n * Copyright © 2012-2013 Nathan Hjelm <hjelmn@mac.com>\n * Copyright © 2012-2013 Peter Stuge <peter@stuge.se>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <config.h>\n\n#include <errno.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#ifdef HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n#include <assert.h>\n\n#include \"libusbi.h\"\n#include \"hotplug.h\"\n\n/**\n * @defgroup hotplug  Device hotplug event notification\n * This page details how to use the libusb hotplug interface, where available.\n *\n * Be mindful that not all platforms currently implement hotplug notification and\n * that you should first call on \\ref libusb_has_capability() with parameter\n * \\ref LIBUSB_CAP_HAS_HOTPLUG to confirm that hotplug support is available.\n *\n * \\page hotplug Device hotplug event notification\n *\n * \\section intro Introduction\n *\n * Version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102, has added support\n * for hotplug events on <b>some</b> platforms (you should test if your platform\n * supports hotplug notification by calling \\ref libusb_has_capability() with\n * parameter \\ref LIBUSB_CAP_HAS_HOTPLUG). \n *\n * This interface allows you to request notification for the arrival and departure\n * of matching USB devices.\n *\n * To receive hotplug notification you register a callback by calling\n * \\ref libusb_hotplug_register_callback(). This function will optionally return\n * a handle that can be passed to \\ref libusb_hotplug_deregister_callback().\n *\n * A callback function must return an int (0 or 1) indicating whether the callback is\n * expecting additional events. Returning 0 will rearm the callback and 1 will cause\n * the callback to be deregistered. Note that when callbacks are called from\n * libusb_hotplug_register_callback() because of the \\ref LIBUSB_HOTPLUG_ENUMERATE\n * flag, the callback return value is ignored, iow you cannot cause a callback\n * to be deregistered by returning 1 when it is called from\n * libusb_hotplug_register_callback().\n *\n * Callbacks for a particular context are automatically deregistered by libusb_exit().\n *\n * As of 1.0.16 there are two supported hotplug events:\n *  - LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED: A device has arrived and is ready to use\n *  - LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT: A device has left and is no longer available\n *\n * A hotplug event can listen for either or both of these events.\n *\n * Note: If you receive notification that a device has left and you have any\n * a libusb_device_handles for the device it is up to you to call libusb_close()\n * on each handle to free up any remaining resources associated with the device.\n * Once a device has left any libusb_device_handle associated with the device\n * are invalid and will remain so even if the device comes back.\n *\n * When handling a LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED event it is considered\n * safe to call any libusb function that takes a libusb_device. On the other hand,\n * when handling a LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT event the only safe function\n * is libusb_get_device_descriptor().\n *\n * The following code provides an example of the usage of the hotplug interface:\n\\code\n#include <stdio.h>\n#include <stdlib.h>\n#include <libusb.h>\n\nstatic int count = 0;\n\nint hotplug_callback(struct libusb_context *ctx, struct libusb_device *dev,\n                     libusb_hotplug_event event, void *user_data) {\n  static libusb_device_handle *handle = NULL;\n  struct libusb_device_descriptor desc;\n  int rc;\n\n  (void)libusb_get_device_descriptor(dev, &desc);\n\n  if (LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED == event) {\n    rc = libusb_open(dev, &handle);\n    if (LIBUSB_SUCCESS != rc) {\n      printf(\"Could not open USB device\\n\");\n    }\n  } else if (LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT == event) {\n    if (handle) {\n      libusb_close(handle);\n      handle = NULL;\n    }\n  } else {\n    printf(\"Unhandled event %d\\n\", event);\n  }\n  count++;\n\n  return 0;\n}\n\nint main (void) {\n  libusb_hotplug_callback_handle handle;\n  int rc;\n\n  libusb_init(NULL);\n\n  rc = libusb_hotplug_register_callback(NULL, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED |\n                                        LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, 0, 0x045a, 0x5005,\n                                        LIBUSB_HOTPLUG_MATCH_ANY, hotplug_callback, NULL,\n                                        &handle);\n  if (LIBUSB_SUCCESS != rc) {\n    printf(\"Error creating a hotplug callback\\n\");\n    libusb_exit(NULL);\n    return EXIT_FAILURE;\n  }\n\n  while (count < 2) {\n    libusb_handle_events_completed(NULL, NULL);\n    usleep(10000);\n  }\n\n  libusb_hotplug_deregister_callback(NULL, handle);\n  libusb_exit(NULL);\n\n  return 0;\n}\n\\endcode\n */\n\nstatic int usbi_hotplug_match_cb (struct libusb_context *ctx,\n\tstruct libusb_device *dev, libusb_hotplug_event event,\n\tstruct libusb_hotplug_callback *hotplug_cb)\n{\n\t/* Handle lazy deregistration of callback */\n\tif (hotplug_cb->needs_free) {\n\t\t/* Free callback */\n\t\treturn 1;\n\t}\n\n\tif (!(hotplug_cb->events & event)) {\n\t\treturn 0;\n\t}\n\n\tif (LIBUSB_HOTPLUG_MATCH_ANY != hotplug_cb->vendor_id &&\n\t    hotplug_cb->vendor_id != dev->device_descriptor.idVendor) {\n\t\treturn 0;\n\t}\n\n\tif (LIBUSB_HOTPLUG_MATCH_ANY != hotplug_cb->product_id &&\n\t    hotplug_cb->product_id != dev->device_descriptor.idProduct) {\n\t\treturn 0;\n\t}\n\n\tif (LIBUSB_HOTPLUG_MATCH_ANY != hotplug_cb->dev_class &&\n\t    hotplug_cb->dev_class != dev->device_descriptor.bDeviceClass) {\n\t\treturn 0;\n\t}\n\n\treturn hotplug_cb->cb (ctx, dev, event, hotplug_cb->user_data);\n}\n\nvoid usbi_hotplug_match(struct libusb_context *ctx, struct libusb_device *dev,\n\tlibusb_hotplug_event event)\n{\n\tstruct libusb_hotplug_callback *hotplug_cb, *next;\n\tint ret;\n\n\tusbi_mutex_lock(&ctx->hotplug_cbs_lock);\n\n\tlist_for_each_entry_safe(hotplug_cb, next, &ctx->hotplug_cbs, list, struct libusb_hotplug_callback) {\n\t\tusbi_mutex_unlock(&ctx->hotplug_cbs_lock);\n\t\tret = usbi_hotplug_match_cb (ctx, dev, event, hotplug_cb);\n\t\tusbi_mutex_lock(&ctx->hotplug_cbs_lock);\n\n\t\tif (ret) {\n\t\t\tlist_del(&hotplug_cb->list);\n\t\t\tfree(hotplug_cb);\n\t\t}\n\t}\n\n\tusbi_mutex_unlock(&ctx->hotplug_cbs_lock);\n\n\t/* the backend is expected to call the callback for each active transfer */\n}\n\nint API_EXPORTED libusb_hotplug_register_callback(libusb_context *ctx,\n\tlibusb_hotplug_event events, libusb_hotplug_flag flags,\n\tint vendor_id, int product_id, int dev_class,\n\tlibusb_hotplug_callback_fn cb_fn, void *user_data,\n\tlibusb_hotplug_callback_handle *handle)\n{\n\tlibusb_hotplug_callback *new_callback;\n\tstatic int handle_id = 1;\n\n\t/* check for hotplug support */\n\tif (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {\n\t\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n\t}\n\n\t/* check for sane values */\n\tif ((LIBUSB_HOTPLUG_MATCH_ANY != vendor_id && (~0xffff & vendor_id)) ||\n\t    (LIBUSB_HOTPLUG_MATCH_ANY != product_id && (~0xffff & product_id)) ||\n\t    (LIBUSB_HOTPLUG_MATCH_ANY != dev_class && (~0xff & dev_class)) ||\n\t    !cb_fn) {\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\n\tUSBI_GET_CONTEXT(ctx);\n\n\tnew_callback = (libusb_hotplug_callback *)calloc(1, sizeof (*new_callback));\n\tif (LIKELY(!new_callback)) {\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\tnew_callback->ctx = ctx;\n\tnew_callback->vendor_id = vendor_id;\n\tnew_callback->product_id = product_id;\n\tnew_callback->dev_class = dev_class;\n\tnew_callback->flags = flags;\n\tnew_callback->events = events;\n\tnew_callback->cb = cb_fn;\n\tnew_callback->user_data = user_data;\n\tnew_callback->needs_free = 0;\n\n\tusbi_mutex_lock(&ctx->hotplug_cbs_lock);\n\n\t/* protect the handle by the context hotplug lock. it doesn't matter if the same handle\n\t * is used for different contexts only that the handle is unique for this context */\n\tnew_callback->handle = handle_id++;\n\n\tlist_add(&new_callback->list, &ctx->hotplug_cbs);\n\n\tusbi_mutex_unlock(&ctx->hotplug_cbs_lock);\n\n\n\tif (flags & LIBUSB_HOTPLUG_ENUMERATE) {\n\t\tint i, len;\n\t\tstruct libusb_device **devs;\n\n\t\tlen = (int) libusb_get_device_list(ctx, &devs);\n\t\tif (len < 0) {\n\t\t\tlibusb_hotplug_deregister_callback(ctx,\n\t\t\t\t\t\t\tnew_callback->handle);\n\t\t\treturn len;\n\t\t}\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tusbi_hotplug_match_cb(ctx, devs[i],\n\t\t\t\t\tLIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED,\n\t\t\t\t\tnew_callback);\n\t\t}\n\n\t\tlibusb_free_device_list(devs, 1);\n\t}\n\n\n\tif (handle) {\n\t\t*handle = new_callback->handle;\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nvoid API_EXPORTED libusb_hotplug_deregister_callback (struct libusb_context *ctx,\n\tlibusb_hotplug_callback_handle handle)\n{\n\tstruct libusb_hotplug_callback *hotplug_cb;\n\tlibusb_hotplug_message message;\n\tssize_t ret;\n\n\t/* check for hotplug support */\n\tif (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {\n\t\treturn;\n\t}\n\n\tUSBI_GET_CONTEXT(ctx);\n\n\tusbi_mutex_lock(&ctx->hotplug_cbs_lock);\n\tlist_for_each_entry(hotplug_cb, &ctx->hotplug_cbs, list,\n\t\t\t    struct libusb_hotplug_callback) {\n\t\tif (handle == hotplug_cb->handle) {\n\t\t\t/* Mark this callback for deregistration */\n\t\t\thotplug_cb->needs_free = 1;\n\t\t}\n\t}\n\tusbi_mutex_unlock(&ctx->hotplug_cbs_lock);\n\n\t/* wakeup handle_events to do the actual free */\n\tmemset(&message, 0, sizeof(message));\n\tret = usbi_write(ctx->hotplug_pipe[1], &message, sizeof(message));\n\tif (sizeof(message) != ret) {\n\t\tusbi_err(ctx, \"error writing hotplug message\");\n\t}\n}\n\nvoid usbi_hotplug_deregister_all(struct libusb_context *ctx) {\n\tstruct libusb_hotplug_callback *hotplug_cb, *next;\n\n\tusbi_mutex_lock(&ctx->hotplug_cbs_lock);\n\tlist_for_each_entry_safe(hotplug_cb, next, &ctx->hotplug_cbs, list,\n\t\t\t\t struct libusb_hotplug_callback) {\n\t\tlist_del(&hotplug_cb->list);\n\t\tfree(hotplug_cb);\n\t}\n\n\tusbi_mutex_unlock(&ctx->hotplug_cbs_lock);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/hotplug.h",
    "content": "/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */\n/*\n * Hotplug support for libusb\n * Copyright © 2012-2013 Nathan Hjelm <hjelmn@mac.com>\n * Copyright © 2012-2013 Peter Stuge <peter@stuge.se>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#if !defined(USBI_HOTPLUG_H)\n#define USBI_HOTPLUG_H\n\n#ifndef LIBUSBI_H\n#include \"libusbi.h\"\n#endif\n\n/** \\ingroup hotplug\n * The hotplug callback structure. The user populates this structure with\n * libusb_hotplug_prepare_callback() and then calls libusb_hotplug_register_callback()\n * to receive notification of hotplug events.\n */\nstruct libusb_hotplug_callback {\n\t/** Context this callback is associated with */\n\tstruct libusb_context *ctx;\n\n\t/** Vendor ID to match or LIBUSB_HOTPLUG_MATCH_ANY */\n\tint vendor_id;\n\n\t/** Product ID to match or LIBUSB_HOTPLUG_MATCH_ANY */\n\tint product_id;\n\n\t/** Device class to match or LIBUSB_HOTPLUG_MATCH_ANY */\n\tint dev_class;\n\n\t/** Hotplug callback flags */\n\tlibusb_hotplug_flag flags;\n\n\t/** Event(s) that will trigger this callback */\n\tlibusb_hotplug_event events;\n\n\t/** Callback function to invoke for matching event/device */\n\tlibusb_hotplug_callback_fn cb;\n\n\t/** Handle for this callback (used to match on deregister) */\n\tlibusb_hotplug_callback_handle handle;\n\n\t/** User data that will be passed to the callback function */\n\tvoid *user_data;\n\n\t/** Callback is marked for deletion */\n\tint needs_free;\n\n\t/** List this callback is registered in (ctx->hotplug_cbs) */\n\tstruct list_head list;\n};\n\ntypedef struct libusb_hotplug_callback libusb_hotplug_callback;\n\nstruct libusb_hotplug_message {\n\tlibusb_hotplug_event event;\n\tstruct libusb_device *device;\n};\n\ntypedef struct libusb_hotplug_message libusb_hotplug_message;\n\nvoid usbi_hotplug_deregister_all(struct libusb_context *ctx);\nvoid usbi_hotplug_match(struct libusb_context *ctx, struct libusb_device *dev,\n\t\t\tlibusb_hotplug_event event);\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/hotplug_original.c",
    "content": "/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */\n/*\n * Hotplug functions for libusb\n * Copyright © 2012-2013 Nathan Hjelm <hjelmn@mac.com>\n * Copyright © 2012-2013 Peter Stuge <peter@stuge.se>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <config.h>\n\n#include <errno.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#ifdef HAVE_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n#include <assert.h>\n\n#include \"libusbi.h\"\n#include \"hotplug.h\"\n\n/**\n * @defgroup hotplug  Device hotplug event notification\n * This page details how to use the libusb hotplug interface, where available.\n *\n * Be mindful that not all platforms currently implement hotplug notification and\n * that you should first call on \\ref libusb_has_capability() with parameter\n * \\ref LIBUSB_CAP_HAS_HOTPLUG to confirm that hotplug support is available.\n *\n * \\page hotplug Device hotplug event notification\n *\n * \\section intro Introduction\n *\n * Version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102, has added support\n * for hotplug events on <b>some</b> platforms (you should test if your platform\n * supports hotplug notification by calling \\ref libusb_has_capability() with\n * parameter \\ref LIBUSB_CAP_HAS_HOTPLUG). \n *\n * This interface allows you to request notification for the arrival and departure\n * of matching USB devices.\n *\n * To receive hotplug notification you register a callback by calling\n * \\ref libusb_hotplug_register_callback(). This function will optionally return\n * a handle that can be passed to \\ref libusb_hotplug_deregister_callback().\n *\n * A callback function must return an int (0 or 1) indicating whether the callback is\n * expecting additional events. Returning 0 will rearm the callback and 1 will cause\n * the callback to be deregistered. Note that when callbacks are called from\n * libusb_hotplug_register_callback() because of the \\ref LIBUSB_HOTPLUG_ENUMERATE\n * flag, the callback return value is ignored, iow you cannot cause a callback\n * to be deregistered by returning 1 when it is called from\n * libusb_hotplug_register_callback().\n *\n * Callbacks for a particular context are automatically deregistered by libusb_exit().\n *\n * As of 1.0.16 there are two supported hotplug events:\n *  - LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED: A device has arrived and is ready to use\n *  - LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT: A device has left and is no longer available\n *\n * A hotplug event can listen for either or both of these events.\n *\n * Note: If you receive notification that a device has left and you have any\n * a libusb_device_handles for the device it is up to you to call libusb_close()\n * on each handle to free up any remaining resources associated with the device.\n * Once a device has left any libusb_device_handle associated with the device\n * are invalid and will remain so even if the device comes back.\n *\n * When handling a LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED event it is considered\n * safe to call any libusb function that takes a libusb_device. On the other hand,\n * when handling a LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT event the only safe function\n * is libusb_get_device_descriptor().\n *\n * The following code provides an example of the usage of the hotplug interface:\n\\code\n#include <stdio.h>\n#include <stdlib.h>\n#include <libusb.h>\n\nstatic int count = 0;\n\nint hotplug_callback(struct libusb_context *ctx, struct libusb_device *dev,\n                     libusb_hotplug_event event, void *user_data) {\n  static libusb_device_handle *handle = NULL;\n  struct libusb_device_descriptor desc;\n  int rc;\n\n  (void)libusb_get_device_descriptor(dev, &desc);\n\n  if (LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED == event) {\n    rc = libusb_open(dev, &handle);\n    if (LIBUSB_SUCCESS != rc) {\n      printf(\"Could not open USB device\\n\");\n    }\n  } else if (LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT == event) {\n    if (handle) {\n      libusb_close(handle);\n      handle = NULL;\n    }\n  } else {\n    printf(\"Unhandled event %d\\n\", event);\n  }\n  count++;\n\n  return 0;\n}\n\nint main (void) {\n  libusb_hotplug_callback_handle handle;\n  int rc;\n\n  libusb_init(NULL);\n\n  rc = libusb_hotplug_register_callback(NULL, LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED |\n                                        LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, 0, 0x045a, 0x5005,\n                                        LIBUSB_HOTPLUG_MATCH_ANY, hotplug_callback, NULL,\n                                        &handle);\n  if (LIBUSB_SUCCESS != rc) {\n    printf(\"Error creating a hotplug callback\\n\");\n    libusb_exit(NULL);\n    return EXIT_FAILURE;\n  }\n\n  while (count < 2) {\n    libusb_handle_events_completed(NULL, NULL);\n    usleep(10000);\n  }\n\n  libusb_hotplug_deregister_callback(NULL, handle);\n  libusb_exit(NULL);\n\n  return 0;\n}\n\\endcode\n */\n\nstatic int usbi_hotplug_match_cb (struct libusb_context *ctx,\n\tstruct libusb_device *dev, libusb_hotplug_event event,\n\tstruct libusb_hotplug_callback *hotplug_cb)\n{\n\t/* Handle lazy deregistration of callback */\n\tif (hotplug_cb->needs_free) {\n\t\t/* Free callback */\n\t\treturn 1;\n\t}\n\n\tif (!(hotplug_cb->events & event)) {\n\t\treturn 0;\n\t}\n\n\tif (LIBUSB_HOTPLUG_MATCH_ANY != hotplug_cb->vendor_id &&\n\t    hotplug_cb->vendor_id != dev->device_descriptor.idVendor) {\n\t\treturn 0;\n\t}\n\n\tif (LIBUSB_HOTPLUG_MATCH_ANY != hotplug_cb->product_id &&\n\t    hotplug_cb->product_id != dev->device_descriptor.idProduct) {\n\t\treturn 0;\n\t}\n\n\tif (LIBUSB_HOTPLUG_MATCH_ANY != hotplug_cb->dev_class &&\n\t    hotplug_cb->dev_class != dev->device_descriptor.bDeviceClass) {\n\t\treturn 0;\n\t}\n\n\treturn hotplug_cb->cb (ctx, dev, event, hotplug_cb->user_data);\n}\n\nvoid usbi_hotplug_match(struct libusb_context *ctx, struct libusb_device *dev,\n\tlibusb_hotplug_event event)\n{\n\tstruct libusb_hotplug_callback *hotplug_cb, *next;\n\tint ret;\n\n\tusbi_mutex_lock(&ctx->hotplug_cbs_lock);\n\n\tlist_for_each_entry_safe(hotplug_cb, next, &ctx->hotplug_cbs, list, struct libusb_hotplug_callback) {\n\t\tusbi_mutex_unlock(&ctx->hotplug_cbs_lock);\n\t\tret = usbi_hotplug_match_cb (ctx, dev, event, hotplug_cb);\n\t\tusbi_mutex_lock(&ctx->hotplug_cbs_lock);\n\n\t\tif (ret) {\n\t\t\tlist_del(&hotplug_cb->list);\n\t\t\tfree(hotplug_cb);\n\t\t}\n\t}\n\n\tusbi_mutex_unlock(&ctx->hotplug_cbs_lock);\n\n\t/* the backend is expected to call the callback for each active transfer */\n}\n\nint API_EXPORTED libusb_hotplug_register_callback(libusb_context *ctx,\n\tlibusb_hotplug_event events, libusb_hotplug_flag flags,\n\tint vendor_id, int product_id, int dev_class,\n\tlibusb_hotplug_callback_fn cb_fn, void *user_data,\n\tlibusb_hotplug_callback_handle *handle)\n{\n\tlibusb_hotplug_callback *new_callback;\n\tstatic int handle_id = 1;\n\n\t/* check for hotplug support */\n\tif (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {\n\t\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n\t}\n\n\t/* check for sane values */\n\tif ((LIBUSB_HOTPLUG_MATCH_ANY != vendor_id && (~0xffff & vendor_id)) ||\n\t    (LIBUSB_HOTPLUG_MATCH_ANY != product_id && (~0xffff & product_id)) ||\n\t    (LIBUSB_HOTPLUG_MATCH_ANY != dev_class && (~0xff & dev_class)) ||\n\t    !cb_fn) {\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\n\tUSBI_GET_CONTEXT(ctx);\n\n\tnew_callback = (libusb_hotplug_callback *)calloc(1, sizeof (*new_callback));\n\tif (!new_callback) {\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\tnew_callback->ctx = ctx;\n\tnew_callback->vendor_id = vendor_id;\n\tnew_callback->product_id = product_id;\n\tnew_callback->dev_class = dev_class;\n\tnew_callback->flags = flags;\n\tnew_callback->events = events;\n\tnew_callback->cb = cb_fn;\n\tnew_callback->user_data = user_data;\n\tnew_callback->needs_free = 0;\n\n\tusbi_mutex_lock(&ctx->hotplug_cbs_lock);\n\n\t/* protect the handle by the context hotplug lock. it doesn't matter if the same handle\n\t * is used for different contexts only that the handle is unique for this context */\n\tnew_callback->handle = handle_id++;\n\n\tlist_add(&new_callback->list, &ctx->hotplug_cbs);\n\n\tusbi_mutex_unlock(&ctx->hotplug_cbs_lock);\n\n\n\tif (flags & LIBUSB_HOTPLUG_ENUMERATE) {\n\t\tint i, len;\n\t\tstruct libusb_device **devs;\n\n\t\tlen = (int) libusb_get_device_list(ctx, &devs);\n\t\tif (len < 0) {\n\t\t\tlibusb_hotplug_deregister_callback(ctx,\n\t\t\t\t\t\t\tnew_callback->handle);\n\t\t\treturn len;\n\t\t}\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tusbi_hotplug_match_cb(ctx, devs[i],\n\t\t\t\t\tLIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED,\n\t\t\t\t\tnew_callback);\n\t\t}\n\n\t\tlibusb_free_device_list(devs, 1);\n\t}\n\n\n\tif (handle) {\n\t\t*handle = new_callback->handle;\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nvoid API_EXPORTED libusb_hotplug_deregister_callback (struct libusb_context *ctx,\n\tlibusb_hotplug_callback_handle handle)\n{\n\tstruct libusb_hotplug_callback *hotplug_cb;\n\tlibusb_hotplug_message message;\n\tssize_t ret;\n\n\t/* check for hotplug support */\n\tif (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG)) {\n\t\treturn;\n\t}\n\n\tUSBI_GET_CONTEXT(ctx);\n\n\tusbi_mutex_lock(&ctx->hotplug_cbs_lock);\n\tlist_for_each_entry(hotplug_cb, &ctx->hotplug_cbs, list,\n\t\t\t    struct libusb_hotplug_callback) {\n\t\tif (handle == hotplug_cb->handle) {\n\t\t\t/* Mark this callback for deregistration */\n\t\t\thotplug_cb->needs_free = 1;\n\t\t}\n\t}\n\tusbi_mutex_unlock(&ctx->hotplug_cbs_lock);\n\n\t/* wakeup handle_events to do the actual free */\n\tmemset(&message, 0, sizeof(message));\n\tret = usbi_write(ctx->hotplug_pipe[1], &message, sizeof(message));\n\tif (sizeof(message) != ret) {\n\t\tusbi_err(ctx, \"error writing hotplug message\");\n\t}\n}\n\nvoid usbi_hotplug_deregister_all(struct libusb_context *ctx) {\n\tstruct libusb_hotplug_callback *hotplug_cb, *next;\n\n\tusbi_mutex_lock(&ctx->hotplug_cbs_lock);\n\tlist_for_each_entry_safe(hotplug_cb, next, &ctx->hotplug_cbs, list,\n\t\t\t\t struct libusb_hotplug_callback) {\n\t\tlist_del(&hotplug_cb->list);\n\t\tfree(hotplug_cb);\n\t}\n\n\tusbi_mutex_unlock(&ctx->hotplug_cbs_lock);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/io.c",
    "content": "/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */\n/*\n * I/O functions for libusb\n * Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org>\n * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"config.h\"\n#include <assert.h>\t\t// XXX add assert for debugging\n#include <errno.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n#include <time.h>\n#ifdef HAVE_SIGNAL_H\n#include <signal.h>\n#endif\n#ifdef HAVE_SYS_TIME_H\n#include <sys/time.h>\n#endif\n#ifdef USBI_TIMERFD_AVAILABLE\n#include <sys/timerfd.h>\n#endif\n\n#include \"libusbi.h\"\n#include \"hotplug.h\"\n\n/**\n * \\page io Synchronous and asynchronous device I/O\n *\n * \\section intro Introduction\n *\n * If you're using libusb in your application, you're probably wanting to\n * perform I/O with devices - you want to perform USB data transfers.\n *\n * libusb offers two separate interfaces for device I/O. This page aims to\n * introduce the two in order to help you decide which one is more suitable\n * for your application. You can also choose to use both interfaces in your\n * application by considering each transfer on a case-by-case basis.\n *\n * Once you have read through the following discussion, you should consult the\n * detailed API documentation pages for the details:\n * - \\ref syncio\n * - \\ref asyncio\n *\n * \\section theory Transfers at a logical level\n *\n * At a logical level, USB transfers typically happen in two parts. For\n * example, when reading data from a endpoint:\n * -# A request for data is sent to the device\n * -# Some time later, the incoming data is received by the host\n *\n * or when writing data to an endpoint:\n *\n * -# The data is sent to the device\n * -# Some time later, the host receives acknowledgement from the device that\n *    the data has been transferred.\n *\n * There may be an indefinite delay between the two steps. Consider a\n * fictional USB input device with a button that the user can press. In order\n * to determine when the button is pressed, you would likely submit a request\n * to read data on a bulk or interrupt endpoint and wait for data to arrive.\n * Data will arrive when the button is pressed by the user, which is\n * potentially hours later.\n *\n * libusb offers both a synchronous and an asynchronous interface to performing\n * USB transfers. The main difference is that the synchronous interface\n * combines both steps indicated above into a single function call, whereas\n * the asynchronous interface separates them.\n *\n * \\section sync The synchronous interface\n *\n * The synchronous I/O interface allows you to perform a USB transfer with\n * a single function call. When the function call returns, the transfer has\n * completed and you can parse the results.\n *\n * If you have used the libusb-0.1 before, this I/O style will seem familar to\n * you. libusb-0.1 only offered a synchronous interface.\n *\n * In our input device example, to read button presses you might write code\n * in the following style:\n\\code\nunsigned char data[4];\nint actual_length;\nint r = libusb_bulk_transfer(handle, LIBUSB_ENDPOINT_IN, data, sizeof(data), &actual_length, 0);\nif (r == 0 && actual_length == sizeof(data)) {\n\t// results of the transaction can now be found in the data buffer\n\t// parse them here and report button press\n} else {\n\terror();\n}\n\\endcode\n *\n * The main advantage of this model is simplicity: you did everything with\n * a single simple function call.\n *\n * However, this interface has its limitations. Your application will sleep\n * inside libusb_bulk_transfer() until the transaction has completed. If it\n * takes the user 3 hours to press the button, your application will be\n * sleeping for that long. Execution will be tied up inside the library -\n * the entire thread will be useless for that duration.\n *\n * Another issue is that by tieing up the thread with that single transaction\n * there is no possibility of performing I/O with multiple endpoints and/or\n * multiple devices simultaneously, unless you resort to creating one thread\n * per transaction.\n *\n * Additionally, there is no opportunity to cancel the transfer after the\n * request has been submitted.\n *\n * For details on how to use the synchronous API, see the\n * \\ref syncio \"synchronous I/O API documentation\" pages.\n *\n * \\section async The asynchronous interface\n *\n * Asynchronous I/O is the most significant new feature in libusb-1.0.\n * Although it is a more complex interface, it solves all the issues detailed\n * above.\n *\n * Instead of providing which functions that block until the I/O has complete,\n * libusb's asynchronous interface presents non-blocking functions which\n * begin a transfer and then return immediately. Your application passes a\n * callback function pointer to this non-blocking function, which libusb will\n * call with the results of the transaction when it has completed.\n *\n * Transfers which have been submitted through the non-blocking functions\n * can be cancelled with a separate function call.\n *\n * The non-blocking nature of this interface allows you to be simultaneously\n * performing I/O to multiple endpoints on multiple devices, without having\n * to use threads.\n *\n * This added flexibility does come with some complications though:\n * - In the interest of being a lightweight library, libusb does not create\n * threads and can only operate when your application is calling into it. Your\n * application must call into libusb from it's main loop when events are ready\n * to be handled, or you must use some other scheme to allow libusb to\n * undertake whatever work needs to be done.\n * - libusb also needs to be called into at certain fixed points in time in\n * order to accurately handle transfer timeouts.\n * - Memory handling becomes more complex. You cannot use stack memory unless\n * the function with that stack is guaranteed not to return until the transfer\n * callback has finished executing.\n * - You generally lose some linearity from your code flow because submitting\n * the transfer request is done in a separate function from where the transfer\n * results are handled. This becomes particularly obvious when you want to\n * submit a second transfer based on the results of an earlier transfer.\n *\n * Internally, libusb's synchronous interface is expressed in terms of function\n * calls to the asynchronous interface.\n *\n * For details on how to use the asynchronous API, see the\n * \\ref asyncio \"asynchronous I/O API\" documentation pages.\n */\n\n\n/**\n * \\page packetoverflow Packets and overflows\n *\n * \\section packets Packet abstraction\n *\n * The USB specifications describe how data is transmitted in packets, with\n * constraints on packet size defined by endpoint descriptors. The host must\n * not send data payloads larger than the endpoint's maximum packet size.\n *\n * libusb and the underlying OS abstract out the packet concept, allowing you\n * to request transfers of any size. Internally, the request will be divided\n * up into correctly-sized packets. You do not have to be concerned with\n * packet sizes, but there is one exception when considering overflows.\n *\n * \\section overflow Bulk/interrupt transfer overflows\n *\n * When requesting data on a bulk endpoint, libusb requires you to supply a\n * buffer and the maximum number of bytes of data that libusb can put in that\n * buffer. However, the size of the buffer is not communicated to the device -\n * the device is just asked to send any amount of data.\n *\n * There is no problem if the device sends an amount of data that is less than\n * or equal to the buffer size. libusb reports this condition to you through\n * the \\ref libusb_transfer::actual_length \"libusb_transfer.actual_length\"\n * field.\n *\n * Problems may occur if the device attempts to send more data than can fit in\n * the buffer. libusb reports LIBUSB_TRANSFER_OVERFLOW for this condition but\n * other behaviour is largely undefined: actual_length may or may not be\n * accurate, the chunk of data that can fit in the buffer (before overflow)\n * may or may not have been transferred.\n *\n * Overflows are nasty, but can be avoided. Even though you were told to\n * ignore packets above, think about the lower level details: each transfer is\n * split into packets (typically small, with a maximum size of 512 bytes).\n * Overflows can only happen if the final packet in an incoming data transfer\n * is smaller than the actual packet that the device wants to transfer.\n * Therefore, you will never see an overflow if your transfer buffer size is a\n * multiple of the endpoint's packet size: the final packet will either\n * fill up completely or will be only partially filled.\n */\n\n/**\n * @defgroup asyncio Asynchronous device I/O\n *\n * This page details libusb's asynchronous (non-blocking) API for USB device\n * I/O. This interface is very powerful but is also quite complex - you will\n * need to read this page carefully to understand the necessary considerations\n * and issues surrounding use of this interface. Simplistic applications\n * may wish to consider the \\ref syncio \"synchronous I/O API\" instead.\n *\n * The asynchronous interface is built around the idea of separating transfer\n * submission and handling of transfer completion (the synchronous model\n * combines both of these into one). There may be a long delay between\n * submission and completion, however the asynchronous submission function\n * is non-blocking so will return control to your application during that\n * potentially long delay.\n *\n * \\section asyncabstraction Transfer abstraction\n *\n * For the asynchronous I/O, libusb implements the concept of a generic\n * transfer entity for all types of I/O (control, bulk, interrupt,\n * isochronous). The generic transfer object must be treated slightly\n * differently depending on which type of I/O you are performing with it.\n *\n * This is represented by the public libusb_transfer structure type.\n *\n * \\section asynctrf Asynchronous transfers\n *\n * We can view asynchronous I/O as a 5 step process:\n * -# <b>Allocation</b>: allocate a libusb_transfer\n * -# <b>Filling</b>: populate the libusb_transfer instance with information\n *    about the transfer you wish to perform\n * -# <b>Submission</b>: ask libusb to submit the transfer\n * -# <b>Completion handling</b>: examine transfer results in the\n *    libusb_transfer structure\n * -# <b>Deallocation</b>: clean up resources\n *\n *\n * \\subsection asyncalloc Allocation\n *\n * This step involves allocating memory for a USB transfer. This is the\n * generic transfer object mentioned above. At this stage, the transfer\n * is \"blank\" with no details about what type of I/O it will be used for.\n *\n * Allocation is done with the libusb_alloc_transfer() function. You must use\n * this function rather than allocating your own transfers.\n *\n * \\subsection asyncfill Filling\n *\n * This step is where you take a previously allocated transfer and fill it\n * with information to determine the message type and direction, data buffer,\n * callback function, etc.\n *\n * You can either fill the required fields yourself or you can use the\n * helper functions: libusb_fill_control_transfer(), libusb_fill_bulk_transfer()\n * and libusb_fill_interrupt_transfer().\n *\n * \\subsection asyncsubmit Submission\n *\n * When you have allocated a transfer and filled it, you can submit it using\n * libusb_submit_transfer(). This function returns immediately but can be\n * regarded as firing off the I/O request in the background.\n *\n * \\subsection asynccomplete Completion handling\n *\n * After a transfer has been submitted, one of four things can happen to it:\n *\n * - The transfer completes (i.e. some data was transferred)\n * - The transfer has a timeout and the timeout expires before all data is\n * transferred\n * - The transfer fails due to an error\n * - The transfer is cancelled\n *\n * Each of these will cause the user-specified transfer callback function to\n * be invoked. It is up to the callback function to determine which of the\n * above actually happened and to act accordingly.\n *\n * The user-specified callback is passed a pointer to the libusb_transfer\n * structure which was used to setup and submit the transfer. At completion\n * time, libusb has populated this structure with results of the transfer:\n * success or failure reason, number of bytes of data transferred, etc. See\n * the libusb_transfer structure documentation for more information.\n *\n * \\subsection Deallocation\n *\n * When a transfer has completed (i.e. the callback function has been invoked),\n * you are advised to free the transfer (unless you wish to resubmit it, see\n * below). Transfers are deallocated with libusb_free_transfer().\n *\n * It is undefined behaviour to free a transfer which has not completed.\n *\n * \\section asyncresubmit Resubmission\n *\n * You may be wondering why allocation, filling, and submission are all\n * separated above where they could reasonably be combined into a single\n * operation.\n *\n * The reason for separation is to allow you to resubmit transfers without\n * having to allocate new ones every time. This is especially useful for\n * common situations dealing with interrupt endpoints - you allocate one\n * transfer, fill and submit it, and when it returns with results you just\n * resubmit it for the next interrupt.\n *\n * \\section asynccancel Cancellation\n *\n * Another advantage of using the asynchronous interface is that you have\n * the ability to cancel transfers which have not yet completed. This is\n * done by calling the libusb_cancel_transfer() function.\n *\n * libusb_cancel_transfer() is asynchronous/non-blocking in itself. When the\n * cancellation actually completes, the transfer's callback function will\n * be invoked, and the callback function should check the transfer status to\n * determine that it was cancelled.\n *\n * Freeing the transfer after it has been cancelled but before cancellation\n * has completed will result in undefined behaviour.\n *\n * When a transfer is cancelled, some of the data may have been transferred.\n * libusb will communicate this to you in the transfer callback. Do not assume\n * that no data was transferred.\n *\n * \\section bulk_overflows Overflows on device-to-host bulk/interrupt endpoints\n *\n * If your device does not have predictable transfer sizes (or it misbehaves),\n * your application may submit a request for data on an IN endpoint which is\n * smaller than the data that the device wishes to send. In some circumstances\n * this will cause an overflow, which is a nasty condition to deal with. See\n * the \\ref packetoverflow page for discussion.\n *\n * \\section asyncctrl Considerations for control transfers\n *\n * The <tt>libusb_transfer</tt> structure is generic and hence does not\n * include specific fields for the control-specific setup packet structure.\n *\n * In order to perform a control transfer, you must place the 8-byte setup\n * packet at the start of the data buffer. To simplify this, you could\n * cast the buffer pointer to type struct libusb_control_setup, or you can\n * use the helper function libusb_fill_control_setup().\n *\n * The wLength field placed in the setup packet must be the length you would\n * expect to be sent in the setup packet: the length of the payload that\n * follows (or the expected maximum number of bytes to receive). However,\n * the length field of the libusb_transfer object must be the length of\n * the data buffer - i.e. it should be wLength <em>plus</em> the size of\n * the setup packet (LIBUSB_CONTROL_SETUP_SIZE).\n *\n * If you use the helper functions, this is simplified for you:\n * -# Allocate a buffer of size LIBUSB_CONTROL_SETUP_SIZE plus the size of the\n * data you are sending/requesting.\n * -# Call libusb_fill_control_setup() on the data buffer, using the transfer\n * request size as the wLength value (i.e. do not include the extra space you\n * allocated for the control setup).\n * -# If this is a host-to-device transfer, place the data to be transferred\n * in the data buffer, starting at offset LIBUSB_CONTROL_SETUP_SIZE.\n * -# Call libusb_fill_control_transfer() to associate the data buffer with\n * the transfer (and to set the remaining details such as callback and timeout).\n *   - Note that there is no parameter to set the length field of the transfer.\n *     The length is automatically inferred from the wLength field of the setup\n *     packet.\n * -# Submit the transfer.\n *\n * The multi-byte control setup fields (wValue, wIndex and wLength) must\n * be given in little-endian byte order (the endianness of the USB bus).\n * Endianness conversion is transparently handled by\n * libusb_fill_control_setup() which is documented to accept host-endian\n * values.\n *\n * Further considerations are needed when handling transfer completion in\n * your callback function:\n * - As you might expect, the setup packet will still be sitting at the start\n * of the data buffer.\n * - If this was a device-to-host transfer, the received data will be sitting\n * at offset LIBUSB_CONTROL_SETUP_SIZE into the buffer.\n * - The actual_length field of the transfer structure is relative to the\n * wLength of the setup packet, rather than the size of the data buffer. So,\n * if your wLength was 4, your transfer's <tt>length</tt> was 12, then you\n * should expect an <tt>actual_length</tt> of 4 to indicate that the data was\n * transferred in entirity.\n *\n * To simplify parsing of setup packets and obtaining the data from the\n * correct offset, you may wish to use the libusb_control_transfer_get_data()\n * and libusb_control_transfer_get_setup() functions within your transfer\n * callback.\n *\n * Even though control endpoints do not halt, a completed control transfer\n * may have a LIBUSB_TRANSFER_STALL status code. This indicates the control\n * request was not supported.\n *\n * \\section asyncintr Considerations for interrupt transfers\n *\n * All interrupt transfers are performed using the polling interval presented\n * by the bInterval value of the endpoint descriptor.\n *\n * \\section asynciso Considerations for isochronous transfers\n *\n * Isochronous transfers are more complicated than transfers to\n * non-isochronous endpoints.\n *\n * To perform I/O to an isochronous endpoint, allocate the transfer by calling\n * libusb_alloc_transfer() with an appropriate number of isochronous packets.\n *\n * During filling, set \\ref libusb_transfer::type \"type\" to\n * \\ref libusb_transfer_type::LIBUSB_TRANSFER_TYPE_ISOCHRONOUS\n * \"LIBUSB_TRANSFER_TYPE_ISOCHRONOUS\", and set\n * \\ref libusb_transfer::num_iso_packets \"num_iso_packets\" to a value less than\n * or equal to the number of packets you requested during allocation.\n * libusb_alloc_transfer() does not set either of these fields for you, given\n * that you might not even use the transfer on an isochronous endpoint.\n *\n * Next, populate the length field for the first num_iso_packets entries in\n * the \\ref libusb_transfer::iso_packet_desc \"iso_packet_desc\" array. Section\n * 5.6.3 of the USB2 specifications describe how the maximum isochronous\n * packet length is determined by the wMaxPacketSize field in the endpoint\n * descriptor.\n * Two functions can help you here:\n *\n * - libusb_get_max_iso_packet_size() is an easy way to determine the max\n *   packet size for an isochronous endpoint. Note that the maximum packet\n *   size is actually the maximum number of bytes that can be transmitted in\n *   a single microframe, therefore this function multiplies the maximum number\n *   of bytes per transaction by the number of transaction opportunities per\n *   microframe.\n * - libusb_set_iso_packet_lengths() assigns the same length to all packets\n *   within a transfer, which is usually what you want.\n *\n * For outgoing transfers, you'll obviously fill the buffer and populate the\n * packet descriptors in hope that all the data gets transferred. For incoming\n * transfers, you must ensure the buffer has sufficient capacity for\n * the situation where all packets transfer the full amount of requested data.\n *\n * Completion handling requires some extra consideration. The\n * \\ref libusb_transfer::actual_length \"actual_length\" field of the transfer\n * is meaningless and should not be examined; instead you must refer to the\n * \\ref libusb_iso_packet_descriptor::actual_length \"actual_length\" field of\n * each individual packet.\n *\n * The \\ref libusb_transfer::status \"status\" field of the transfer is also a\n * little misleading:\n *  - If the packets were submitted and the isochronous data microframes\n *    completed normally, status will have value\n *    \\ref libusb_transfer_status::LIBUSB_TRANSFER_COMPLETED\n *    \"LIBUSB_TRANSFER_COMPLETED\". Note that bus errors and software-incurred\n *    delays are not counted as transfer errors; the transfer.status field may\n *    indicate COMPLETED even if some or all of the packets failed. Refer to\n *    the \\ref libusb_iso_packet_descriptor::status \"status\" field of each\n *    individual packet to determine packet failures.\n *  - The status field will have value\n *    \\ref libusb_transfer_status::LIBUSB_TRANSFER_ERROR\n *    \"LIBUSB_TRANSFER_ERROR\" only when serious errors were encountered.\n *  - Other transfer status codes occur with normal behaviour.\n *\n * The data for each packet will be found at an offset into the buffer that\n * can be calculated as if each prior packet completed in full. The\n * libusb_get_iso_packet_buffer() and libusb_get_iso_packet_buffer_simple()\n * functions may help you here.\n *\n * \\section asyncmem Memory caveats\n *\n * In most circumstances, it is not safe to use stack memory for transfer\n * buffers. This is because the function that fired off the asynchronous\n * transfer may return before libusb has finished using the buffer, and when\n * the function returns it's stack gets destroyed. This is true for both\n * host-to-device and device-to-host transfers.\n *\n * The only case in which it is safe to use stack memory is where you can\n * guarantee that the function owning the stack space for the buffer does not\n * return until after the transfer's callback function has completed. In every\n * other case, you need to use heap memory instead.\n *\n * \\section asyncflags Fine control\n *\n * Through using this asynchronous interface, you may find yourself repeating\n * a few simple operations many times. You can apply a bitwise OR of certain\n * flags to a transfer to simplify certain things:\n * - \\ref libusb_transfer_flags::LIBUSB_TRANSFER_SHORT_NOT_OK\n *   \"LIBUSB_TRANSFER_SHORT_NOT_OK\" results in transfers which transferred\n *   less than the requested amount of data being marked with status\n *   \\ref libusb_transfer_status::LIBUSB_TRANSFER_ERROR \"LIBUSB_TRANSFER_ERROR\"\n *   (they would normally be regarded as COMPLETED)\n * - \\ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_BUFFER\n *   \"LIBUSB_TRANSFER_FREE_BUFFER\" allows you to ask libusb to free the transfer\n *   buffer when freeing the transfer.\n * - \\ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_TRANSFER\n *   \"LIBUSB_TRANSFER_FREE_TRANSFER\" causes libusb to automatically free the\n *   transfer after the transfer callback returns.\n *\n * \\section asyncevent Event handling\n *\n * An asynchronous model requires that libusb perform work at various\n * points in time - namely processing the results of previously-submitted\n * transfers and invoking the user-supplied callback function.\n *\n * This gives rise to the libusb_handle_events() function which your\n * application must call into when libusb has work do to. This gives libusb\n * the opportunity to reap pending transfers, invoke callbacks, etc.\n *\n * There are 2 different approaches to dealing with libusb_handle_events:\n *\n * -# Repeatedly call libusb_handle_events() in blocking mode from a dedicated\n *    thread.\n * -# Integrate libusb with your application's main event loop. libusb\n *    exposes a set of file descriptors which allow you to do this.\n *\n * The first approach has the big advantage that it will also work on Windows\n * were libusb' poll API for select / poll integration is not available. So\n * if you want to support Windows and use the async API, you must use this\n * approach, see the \\ref eventthread \"Using an event handling thread\" section\n * below for details.\n *\n * If you prefer a single threaded approach with a single central event loop,\n * see the \\ref poll \"polling and timing\" section for how to integrate libusb\n * into your application's main event loop.\n *\n * \\section eventthread Using an event handling thread\n *\n * Lets begin with stating the obvious: If you're going to use a separate\n * thread for libusb event handling, your callback functions MUST be\n * threadsafe.\n *\n * Other then that doing event handling from a separate thread, is mostly\n * simple. You can use an event thread function as follows:\n\\code\nvoid *event_thread_func(void *ctx)\n{\n    while (event_thread_run)\n        libusb_handle_events(ctx);\n\n    return NULL;\n}\n\\endcode\n *\n * There is one caveat though, stopping this thread requires setting the\n * event_thread_run variable to 0, and after that libusb_handle_events() needs\n * to return control to event_thread_func. But unless some event happens,\n * libusb_handle_events() will not return.\n *\n * There are 2 different ways of dealing with this, depending on if your\n * application uses libusb' \\ref hotplug \"hotplug\" support or not.\n *\n * Applications which do not use hotplug support, should not start the event\n * thread until after their first call to libusb_open(), and should stop the\n * thread when closing the last open device as follows:\n\\code\nvoid my_close_handle(libusb_device_handle *handle)\n{\n    if (open_devs == 1)\n        event_thread_run = 0;\n\n    libusb_close(handle); // This wakes up libusb_handle_events()\n\n    if (open_devs == 1)\n        pthread_join(event_thread);\n\n    open_devs--;\n}\n\\endcode\n *\n * Applications using hotplug support should start the thread at program init,\n * after having successfully called libusb_hotplug_register_callback(), and\n * should stop the thread at program exit as follows:\n\\code\nvoid my_libusb_exit(void)\n{ \n    event_thread_run = 0;\n    libusb_hotplug_deregister_callback(ctx, hotplug_cb_handle); // This wakes up libusb_handle_events()\n    pthread_join(event_thread);\n    libusb_exit(ctx);\n}\n\\endcode\n */\n\n/**\n * @defgroup poll Polling and timing\n *\n * This page documents libusb's functions for polling events and timing.\n * These functions are only necessary for users of the\n * \\ref asyncio \"asynchronous API\". If you are only using the simpler\n * \\ref syncio \"synchronous API\" then you do not need to ever call these\n * functions.\n *\n * The justification for the functionality described here has already been\n * discussed in the \\ref asyncevent \"event handling\" section of the\n * asynchronous API documentation. In summary, libusb does not create internal\n * threads for event processing and hence relies on your application calling\n * into libusb at certain points in time so that pending events can be handled.\n *\n * Your main loop is probably already calling poll() or select() or a\n * variant on a set of file descriptors for other event sources (e.g. keyboard\n * button presses, mouse movements, network sockets, etc). You then add\n * libusb's file descriptors to your poll()/select() calls, and when activity\n * is detected on such descriptors you know it is time to call\n * libusb_handle_events().\n *\n * There is one final event handling complication. libusb supports\n * asynchronous transfers which time out after a specified time period.\n *\n * On some platforms a timerfd is used, so the timeout handling is just another\n * fd, on other platforms this requires that libusb is called into at or after\n * the timeout to handle it. So, in addition to considering libusb's file\n * descriptors in your main event loop, you must also consider that libusb\n * sometimes needs to be called into at fixed points in time even when there\n * is no file descriptor activity, see \\ref polltime details.\n * \n * In order to know precisely when libusb needs to be called into, libusb\n * offers you a set of pollable file descriptors and information about when\n * the next timeout expires.\n *\n * If you are using the asynchronous I/O API, you must take one of the two\n * following options, otherwise your I/O will not complete.\n *\n * \\section pollsimple The simple option\n *\n * If your application revolves solely around libusb and does not need to\n * handle other event sources, you can have a program structure as follows:\n\\code\n// initialize libusb\n// find and open device\n// maybe fire off some initial async I/O\n\nwhile (user_has_not_requested_exit)\n\tlibusb_handle_events(ctx);\n\n// clean up and exit\n\\endcode\n *\n * With such a simple main loop, you do not have to worry about managing\n * sets of file descriptors or handling timeouts. libusb_handle_events() will\n * handle those details internally.\n *\n * \\section pollmain The more advanced option\n *\n * \\note This functionality is currently only available on Unix-like platforms.\n * On Windows, libusb_get_pollfds() simply returns NULL. Applications which\n * want to support Windows are advised to use an \\ref eventthread\n * \"event handling thread\" instead.\n *\n * In more advanced applications, you will already have a main loop which\n * is monitoring other event sources: network sockets, X11 events, mouse\n * movements, etc. Through exposing a set of file descriptors, libusb is\n * designed to cleanly integrate into such main loops.\n *\n * In addition to polling file descriptors for the other event sources, you\n * take a set of file descriptors from libusb and monitor those too. When you\n * detect activity on libusb's file descriptors, you call\n * libusb_handle_events_timeout() in non-blocking mode.\n *\n * What's more, libusb may also need to handle events at specific moments in\n * time. No file descriptor activity is generated at these times, so your\n * own application needs to be continually aware of when the next one of these\n * moments occurs (through calling libusb_get_next_timeout()), and then it\n * needs to call libusb_handle_events_timeout() in non-blocking mode when\n * these moments occur. This means that you need to adjust your\n * poll()/select() timeout accordingly.\n *\n * libusb provides you with a set of file descriptors to poll and expects you\n * to poll all of them, treating them as a single entity. The meaning of each\n * file descriptor in the set is an internal implementation detail,\n * platform-dependent and may vary from release to release. Don't try and\n * interpret the meaning of the file descriptors, just do as libusb indicates,\n * polling all of them at once.\n *\n * In pseudo-code, you want something that looks like:\n\\code\n// initialise libusb\n\nlibusb_get_pollfds(ctx)\nwhile (user has not requested application exit) {\n\tlibusb_get_next_timeout(ctx);\n\tpoll(on libusb file descriptors plus any other event sources of interest,\n\t\tusing a timeout no larger than the value libusb just suggested)\n\tif (poll() indicated activity on libusb file descriptors)\n\t\tlibusb_handle_events_timeout(ctx, &zero_tv);\n\tif (time has elapsed to or beyond the libusb timeout)\n\t\tlibusb_handle_events_timeout(ctx, &zero_tv);\n\t// handle events from other sources here\n}\n\n// clean up and exit\n\\endcode\n *\n * \\subsection polltime Notes on time-based events\n *\n * The above complication with having to track time and call into libusb at\n * specific moments is a bit of a headache. For maximum compatibility, you do\n * need to write your main loop as above, but you may decide that you can\n * restrict the supported platforms of your application and get away with\n * a more simplistic scheme.\n *\n * These time-based event complications are \\b not required on the following\n * platforms:\n *  - Darwin\n *  - Linux, provided that the following version requirements are satisfied:\n *   - Linux v2.6.27 or newer, compiled with timerfd support\n *   - glibc v2.9 or newer\n *   - libusb v1.0.5 or newer\n *\n * Under these configurations, libusb_get_next_timeout() will \\em always return\n * 0, so your main loop can be simplified to:\n\\code\n// initialise libusb\n\nlibusb_get_pollfds(ctx)\nwhile (user has not requested application exit) {\n\tpoll(on libusb file descriptors plus any other event sources of interest,\n\t\tusing any timeout that you like)\n\tif (poll() indicated activity on libusb file descriptors)\n\t\tlibusb_handle_events_timeout(ctx, &zero_tv);\n\t// handle events from other sources here\n}\n\n// clean up and exit\n\\endcode\n *\n * Do remember that if you simplify your main loop to the above, you will\n * lose compatibility with some platforms (including legacy Linux platforms,\n * and <em>any future platforms supported by libusb which may have time-based\n * event requirements</em>). The resultant problems will likely appear as\n * strange bugs in your application.\n *\n * You can use the libusb_pollfds_handle_timeouts() function to do a runtime\n * check to see if it is safe to ignore the time-based event complications.\n * If your application has taken the shortcut of ignoring libusb's next timeout\n * in your main loop, then you are advised to check the return value of\n * libusb_pollfds_handle_timeouts() during application startup, and to abort\n * if the platform does suffer from these timing complications.\n *\n * \\subsection fdsetchange Changes in the file descriptor set\n *\n * The set of file descriptors that libusb uses as event sources may change\n * during the life of your application. Rather than having to repeatedly\n * call libusb_get_pollfds(), you can set up notification functions for when\n * the file descriptor set changes using libusb_set_pollfd_notifiers().\n *\n * \\subsection mtissues Multi-threaded considerations\n *\n * Unfortunately, the situation is complicated further when multiple threads\n * come into play. If two threads are monitoring the same file descriptors,\n * the fact that only one thread will be woken up when an event occurs causes\n * some headaches.\n *\n * The events lock, event waiters lock, and libusb_handle_events_locked()\n * entities are added to solve these problems. You do not need to be concerned\n * with these entities otherwise.\n *\n * See the extra documentation: \\ref mtasync\n */\n\n/** \\page mtasync Multi-threaded applications and asynchronous I/O\n *\n * libusb is a thread-safe library, but extra considerations must be applied\n * to applications which interact with libusb from multiple threads.\n *\n * The underlying issue that must be addressed is that all libusb I/O\n * revolves around monitoring file descriptors through the poll()/select()\n * system calls. This is directly exposed at the\n * \\ref asyncio \"asynchronous interface\" but it is important to note that the\n * \\ref syncio \"synchronous interface\" is implemented on top of the\n * asynchonrous interface, therefore the same considerations apply.\n *\n * The issue is that if two or more threads are concurrently calling poll()\n * or select() on libusb's file descriptors then only one of those threads\n * will be woken up when an event arrives. The others will be completely\n * oblivious that anything has happened.\n *\n * Consider the following pseudo-code, which submits an asynchronous transfer\n * then waits for its completion. This style is one way you could implement a\n * synchronous interface on top of the asynchronous interface (and libusb\n * does something similar, albeit more advanced due to the complications\n * explained on this page).\n *\n\\code\nvoid cb(struct libusb_transfer *transfer)\n{\n\tint *completed = transfer->user_data;\n\t*completed = 1;\n}\n\nvoid myfunc() {\n\tstruct libusb_transfer *transfer;\n\tunsigned char buffer[LIBUSB_CONTROL_SETUP_SIZE] __attribute__ ((aligned (2)));\n\tint completed = 0;\n\n\ttransfer = libusb_alloc_transfer(0);\n\tlibusb_fill_control_setup(buffer,\n\t\tLIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT, 0x04, 0x01, 0, 0);\n\tlibusb_fill_control_transfer(transfer, dev, buffer, cb, &completed, 1000);\n\tlibusb_submit_transfer(transfer);\n\n\twhile (!completed) {\n\t\tpoll(libusb file descriptors, 120*1000);\n\t\tif (poll indicates activity)\n\t\t\tlibusb_handle_events_timeout(ctx, &zero_tv);\n\t}\n\tprintf(\"completed!\");\n\t// other code here\n}\n\\endcode\n *\n * Here we are <em>serializing</em> completion of an asynchronous event\n * against a condition - the condition being completion of a specific transfer.\n * The poll() loop has a long timeout to minimize CPU usage during situations\n * when nothing is happening (it could reasonably be unlimited).\n *\n * If this is the only thread that is polling libusb's file descriptors, there\n * is no problem: there is no danger that another thread will swallow up the\n * event that we are interested in. On the other hand, if there is another\n * thread polling the same descriptors, there is a chance that it will receive\n * the event that we were interested in. In this situation, <tt>myfunc()</tt>\n * will only realise that the transfer has completed on the next iteration of\n * the loop, <em>up to 120 seconds later.</em> Clearly a two-minute delay is\n * undesirable, and don't even think about using short timeouts to circumvent\n * this issue!\n *\n * The solution here is to ensure that no two threads are ever polling the\n * file descriptors at the same time. A naive implementation of this would\n * impact the capabilities of the library, so libusb offers the scheme\n * documented below to ensure no loss of functionality.\n *\n * Before we go any further, it is worth mentioning that all libusb-wrapped\n * event handling procedures fully adhere to the scheme documented below.\n * This includes libusb_handle_events() and its variants, and all the\n * synchronous I/O functions - libusb hides this headache from you.\n *\n * \\section Using libusb_handle_events() from multiple threads\n *\n * Even when only using libusb_handle_events() and synchronous I/O functions,\n * you can still have a race condition. You might be tempted to solve the\n * above with libusb_handle_events() like so:\n *\n\\code\n\tlibusb_submit_transfer(transfer);\n\n\twhile (!completed) {\n\t\tlibusb_handle_events(ctx);\n\t}\n\tprintf(\"completed!\");\n\\endcode\n *\n * This however has a race between the checking of completed and\n * libusb_handle_events() acquiring the events lock, so another thread\n * could have completed the transfer, resulting in this thread hanging\n * until either a timeout or another event occurs. See also commit\n * 6696512aade99bb15d6792af90ae329af270eba6 which fixes this in the\n * synchronous API implementation of libusb.\n *\n * Fixing this race requires checking the variable completed only after\n * taking the event lock, which defeats the concept of just calling\n * libusb_handle_events() without worrying about locking. This is why\n * libusb-1.0.9 introduces the new libusb_handle_events_timeout_completed()\n * and libusb_handle_events_completed() functions, which handles doing the\n * completion check for you after they have acquired the lock:\n *\n\\code\n\tlibusb_submit_transfer(transfer);\n\n\twhile (!completed) {\n\t\tlibusb_handle_events_completed(ctx, &completed);\n\t}\n\tprintf(\"completed!\");\n\\endcode\n *\n * This nicely fixes the race in our example. Note that if all you want to\n * do is submit a single transfer and wait for its completion, then using\n * one of the synchronous I/O functions is much easier.\n *\n * \\section eventlock The events lock\n *\n * The problem is when we consider the fact that libusb exposes file\n * descriptors to allow for you to integrate asynchronous USB I/O into\n * existing main loops, effectively allowing you to do some work behind\n * libusb's back. If you do take libusb's file descriptors and pass them to\n * poll()/select() yourself, you need to be aware of the associated issues.\n *\n * The first concept to be introduced is the events lock. The events lock\n * is used to serialize threads that want to handle events, such that only\n * one thread is handling events at any one time.\n *\n * You must take the events lock before polling libusb file descriptors,\n * using libusb_lock_events(). You must release the lock as soon as you have\n * aborted your poll()/select() loop, using libusb_unlock_events().\n *\n * \\section threadwait Letting other threads do the work for you\n *\n * Although the events lock is a critical part of the solution, it is not\n * enough on it's own. You might wonder if the following is sufficient...\n\\code\n\tlibusb_lock_events(ctx);\n\twhile (!completed) {\n\t\tpoll(libusb file descriptors, 120*1000);\n\t\tif (poll indicates activity)\n\t\t\tlibusb_handle_events_timeout(ctx, &zero_tv);\n\t}\n\tlibusb_unlock_events(ctx);\n\\endcode\n * ...and the answer is that it is not. This is because the transfer in the\n * code shown above may take a long time (say 30 seconds) to complete, and\n * the lock is not released until the transfer is completed.\n *\n * Another thread with similar code that wants to do event handling may be\n * working with a transfer that completes after a few milliseconds. Despite\n * having such a quick completion time, the other thread cannot check that\n * status of its transfer until the code above has finished (30 seconds later)\n * due to contention on the lock.\n *\n * To solve this, libusb offers you a mechanism to determine when another\n * thread is handling events. It also offers a mechanism to block your thread\n * until the event handling thread has completed an event (and this mechanism\n * does not involve polling of file descriptors).\n *\n * After determining that another thread is currently handling events, you\n * obtain the <em>event waiters</em> lock using libusb_lock_event_waiters().\n * You then re-check that some other thread is still handling events, and if\n * so, you call libusb_wait_for_event().\n *\n * libusb_wait_for_event() puts your application to sleep until an event\n * occurs, or until a thread releases the events lock. When either of these\n * things happen, your thread is woken up, and should re-check the condition\n * it was waiting on. It should also re-check that another thread is handling\n * events, and if not, it should start handling events itself.\n *\n * This looks like the following, as pseudo-code:\n\\code\nretry:\nif (libusb_try_lock_events(ctx) == 0) {\n\t// we obtained the event lock: do our own event handling\n\twhile (!completed) {\n\t\tif (!libusb_event_handling_ok(ctx)) {\n\t\t\tlibusb_unlock_events(ctx);\n\t\t\tgoto retry;\n\t\t}\n\t\tpoll(libusb file descriptors, 120*1000);\n\t\tif (poll indicates activity)\n\t\t\tlibusb_handle_events_locked(ctx, 0);\n\t}\n\tlibusb_unlock_events(ctx);\n} else {\n\t// another thread is doing event handling. wait for it to signal us that\n\t// an event has completed\n\tlibusb_lock_event_waiters(ctx);\n\n\twhile (!completed) {\n\t\t// now that we have the event waiters lock, double check that another\n\t\t// thread is still handling events for us. (it may have ceased handling\n\t\t// events in the time it took us to reach this point)\n\t\tif (!libusb_event_handler_active(ctx)) {\n\t\t\t// whoever was handling events is no longer doing so, try again\n\t\t\tlibusb_unlock_event_waiters(ctx);\n\t\t\tgoto retry;\n\t\t}\n\n\t\tlibusb_wait_for_event(ctx, NULL);\n\t}\n\tlibusb_unlock_event_waiters(ctx);\n}\nprintf(\"completed!\\n\");\n\\endcode\n *\n * A naive look at the above code may suggest that this can only support\n * one event waiter (hence a total of 2 competing threads, the other doing\n * event handling), because the event waiter seems to have taken the event\n * waiters lock while waiting for an event. However, the system does support\n * multiple event waiters, because libusb_wait_for_event() actually drops\n * the lock while waiting, and reaquires it before continuing.\n *\n * We have now implemented code which can dynamically handle situations where\n * nobody is handling events (so we should do it ourselves), and it can also\n * handle situations where another thread is doing event handling (so we can\n * piggyback onto them). It is also equipped to handle a combination of\n * the two, for example, another thread is doing event handling, but for\n * whatever reason it stops doing so before our condition is met, so we take\n * over the event handling.\n *\n * Four functions were introduced in the above pseudo-code. Their importance\n * should be apparent from the code shown above.\n * -# libusb_try_lock_events() is a non-blocking function which attempts\n *    to acquire the events lock but returns a failure code if it is contended.\n * -# libusb_event_handling_ok() checks that libusb is still happy for your\n *    thread to be performing event handling. Sometimes, libusb needs to\n *    interrupt the event handler, and this is how you can check if you have\n *    been interrupted. If this function returns 0, the correct behaviour is\n *    for you to give up the event handling lock, and then to repeat the cycle.\n *    The following libusb_try_lock_events() will fail, so you will become an\n *    events waiter. For more information on this, read \\ref fullstory below.\n * -# libusb_handle_events_locked() is a variant of\n *    libusb_handle_events_timeout() that you can call while holding the\n *    events lock. libusb_handle_events_timeout() itself implements similar\n *    logic to the above, so be sure not to call it when you are\n *    \"working behind libusb's back\", as is the case here.\n * -# libusb_event_handler_active() determines if someone is currently\n *    holding the events lock\n *\n * You might be wondering why there is no function to wake up all threads\n * blocked on libusb_wait_for_event(). This is because libusb can do this\n * internally: it will wake up all such threads when someone calls\n * libusb_unlock_events() or when a transfer completes (at the point after its\n * callback has returned).\n *\n * \\subsection fullstory The full story\n *\n * The above explanation should be enough to get you going, but if you're\n * really thinking through the issues then you may be left with some more\n * questions regarding libusb's internals. If you're curious, read on, and if\n * not, skip to the next section to avoid confusing yourself!\n *\n * The immediate question that may spring to mind is: what if one thread\n * modifies the set of file descriptors that need to be polled while another\n * thread is doing event handling?\n *\n * There are 2 situations in which this may happen.\n * -# libusb_open() will add another file descriptor to the poll set,\n *    therefore it is desirable to interrupt the event handler so that it\n *    restarts, picking up the new descriptor.\n * -# libusb_close() will remove a file descriptor from the poll set. There\n *    are all kinds of race conditions that could arise here, so it is\n *    important that nobody is doing event handling at this time.\n *\n * libusb handles these issues internally, so application developers do not\n * have to stop their event handlers while opening/closing devices. Here's how\n * it works, focusing on the libusb_close() situation first:\n *\n * -# During initialization, libusb opens an internal pipe, and it adds the read\n *    end of this pipe to the set of file descriptors to be polled.\n * -# During libusb_close(), libusb writes some dummy data on this control pipe.\n *    This immediately interrupts the event handler. libusb also records\n *    internally that it is trying to interrupt event handlers for this\n *    high-priority event.\n * -# At this point, some of the functions described above start behaving\n *    differently:\n *   - libusb_event_handling_ok() starts returning 1, indicating that it is NOT\n *     OK for event handling to continue.\n *   - libusb_try_lock_events() starts returning 1, indicating that another\n *     thread holds the event handling lock, even if the lock is uncontended.\n *   - libusb_event_handler_active() starts returning 1, indicating that\n *     another thread is doing event handling, even if that is not true.\n * -# The above changes in behaviour result in the event handler stopping and\n *    giving up the events lock very quickly, giving the high-priority\n *    libusb_close() operation a \"free ride\" to acquire the events lock. All\n *    threads that are competing to do event handling become event waiters.\n * -# With the events lock held inside libusb_close(), libusb can safely remove\n *    a file descriptor from the poll set, in the safety of knowledge that\n *    nobody is polling those descriptors or trying to access the poll set.\n * -# After obtaining the events lock, the close operation completes very\n *    quickly (usually a matter of milliseconds) and then immediately releases\n *    the events lock.\n * -# At the same time, the behaviour of libusb_event_handling_ok() and friends\n *    reverts to the original, documented behaviour.\n * -# The release of the events lock causes the threads that are waiting for\n *    events to be woken up and to start competing to become event handlers\n *    again. One of them will succeed; it will then re-obtain the list of poll\n *    descriptors, and USB I/O will then continue as normal.\n *\n * libusb_open() is similar, and is actually a more simplistic case. Upon a\n * call to libusb_open():\n *\n * -# The device is opened and a file descriptor is added to the poll set.\n * -# libusb sends some dummy data on the control pipe, and records that it\n *    is trying to modify the poll descriptor set.\n * -# The event handler is interrupted, and the same behaviour change as for\n *    libusb_close() takes effect, causing all event handling threads to become\n *    event waiters.\n * -# The libusb_open() implementation takes its free ride to the events lock.\n * -# Happy that it has successfully paused the events handler, libusb_open()\n *    releases the events lock.\n * -# The event waiter threads are all woken up and compete to become event\n *    handlers again. The one that succeeds will obtain the list of poll\n *    descriptors again, which will include the addition of the new device.\n *\n * \\subsection concl Closing remarks\n *\n * The above may seem a little complicated, but hopefully I have made it clear\n * why such complications are necessary. Also, do not forget that this only\n * applies to applications that take libusb's file descriptors and integrate\n * them into their own polling loops.\n *\n * You may decide that it is OK for your multi-threaded application to ignore\n * some of the rules and locks detailed above, because you don't think that\n * two threads can ever be polling the descriptors at the same time. If that\n * is the case, then that's good news for you because you don't have to worry.\n * But be careful here; remember that the synchronous I/O functions do event\n * handling internally. If you have one thread doing event handling in a loop\n * (without implementing the rules and locking semantics documented above)\n * and another trying to send a synchronous USB transfer, you will end up with\n * two threads monitoring the same descriptors, and the above-described\n * undesirable behaviour occuring. The solution is for your polling thread to\n * play by the rules; the synchronous I/O functions do so, and this will result\n * in them getting along in perfect harmony.\n *\n * If you do have a dedicated thread doing event handling, it is perfectly\n * legal for it to take the event handling lock for long periods of time. Any\n * synchronous I/O functions you call from other threads will transparently\n * fall back to the \"event waiters\" mechanism detailed above. The only\n * consideration that your event handling thread must apply is the one related\n * to libusb_event_handling_ok(): you must call this before every poll(), and\n * give up the events lock if instructed.\n */\n\nint usbi_io_init(struct libusb_context *ctx) {\n\n\tint r;\n\n\tusbi_mutex_init(&ctx->flying_transfers_lock, NULL);\n\tusbi_mutex_init(&ctx->pollfds_lock, NULL);\n\tusbi_mutex_init(&ctx->pollfd_modify_lock, NULL);\n\tusbi_mutex_init_recursive(&ctx->events_lock, NULL);\n\tusbi_mutex_init(&ctx->event_waiters_lock, NULL);\n\tusbi_cond_init(&ctx->event_waiters_cond, NULL);\n\tlist_init(&ctx->flying_transfers);\n\tlist_init(&ctx->pollfds);\n\n\t/* FIXME should use an eventfd on kernels that support it */\n\tr = usbi_pipe(ctx->ctrl_pipe);\n\tif (UNLIKELY(r < 0)) {\n\t\tr = LIBUSB_ERROR_OTHER;\n\t\tgoto err;\n\t}\n\n\tr = usbi_add_pollfd(ctx, ctx->ctrl_pipe[0], POLLIN);\n\tif (UNLIKELY(r < 0))\n\t\tgoto err_close_pipe;\n\n\t/* create hotplug pipe */\n\tr = usbi_pipe(ctx->hotplug_pipe);\n\tif (UNLIKELY(r < 0)) {\n\t\tr = LIBUSB_ERROR_OTHER;\n\t\tgoto err;\n\t}\n\n\tr = usbi_add_pollfd(ctx, ctx->hotplug_pipe[0], POLLIN);\n\tif (UNLIKELY(r < 0))\n\t\tgoto err_close_hp_pipe;\n\n#ifdef USBI_TIMERFD_AVAILABLE\n\tctx->timerfd = timerfd_create(usbi_backend->get_timerfd_clockid(),\n\t\tTFD_NONBLOCK);\n\tif (UNLIKELY(ctx->timerfd >= 0)) {\n\t\tusbi_dbg(\"using timerfd for timeouts\");\n\t\tr = usbi_add_pollfd(ctx, ctx->timerfd, POLLIN);\n\t\tif (UNLIKELY(r < 0)) {\n\t\t\tusbi_remove_pollfd(ctx, ctx->ctrl_pipe[0]);\n\t\t\tclose(ctx->timerfd);\n\t\t\tgoto err_close_hp_pipe;\n\t\t}\n\t} else {\n\t\tusbi_dbg(\"timerfd not available (code %d error %d)\", ctx->timerfd, errno);\n\t\tctx->timerfd = -1;\n\t}\n#endif\n\n\treturn LIBUSB_SUCCESS;\n\nerr_close_hp_pipe:\n\tusbi_close(ctx->hotplug_pipe[0]);\n\tusbi_close(ctx->hotplug_pipe[1]);\nerr_close_pipe:\n\tusbi_close(ctx->ctrl_pipe[0]);\n\tusbi_close(ctx->ctrl_pipe[1]);\nerr:\n\tusbi_mutex_destroy(&ctx->flying_transfers_lock);\n\tusbi_mutex_destroy(&ctx->pollfds_lock);\n\tusbi_mutex_destroy(&ctx->pollfd_modify_lock);\n\tusbi_mutex_destroy(&ctx->events_lock);\n\tusbi_mutex_destroy(&ctx->event_waiters_lock);\n\tusbi_cond_destroy(&ctx->event_waiters_cond);\n\treturn r;\n}\n\nvoid usbi_io_exit(struct libusb_context *ctx) {\n\n\tusbi_remove_pollfd(ctx, ctx->ctrl_pipe[0]);\n\tusbi_close(ctx->ctrl_pipe[0]);\n\tusbi_close(ctx->ctrl_pipe[1]);\n\tusbi_remove_pollfd(ctx, ctx->hotplug_pipe[0]);\n\tusbi_close(ctx->hotplug_pipe[0]);\n\tusbi_close(ctx->hotplug_pipe[1]);\n#ifdef USBI_TIMERFD_AVAILABLE\n\tif (usbi_using_timerfd(ctx)) {\n\t\tusbi_remove_pollfd(ctx, ctx->timerfd);\n\t\tclose(ctx->timerfd);\n\t}\n#endif\n\tusbi_mutex_destroy(&ctx->flying_transfers_lock);\n\tusbi_mutex_destroy(&ctx->pollfds_lock);\n\tusbi_mutex_destroy(&ctx->pollfd_modify_lock);\n\tusbi_mutex_destroy(&ctx->events_lock);\n\tusbi_mutex_destroy(&ctx->event_waiters_lock);\n\tusbi_cond_destroy(&ctx->event_waiters_cond);\n}\n\nstatic int calculate_timeout(struct usbi_transfer *transfer) {\n\n\tint r;\n\tstruct timespec current_time;\n\tunsigned int timeout =\n\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout;\n\n\tif (!timeout)\n\t\treturn LIBUSB_SUCCESS;\n\n\tr = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, &current_time);\n\tif (UNLIKELY(r < 0)) {\n\t\tusbi_err(ITRANSFER_CTX(transfer),\n\t\t\t\"failed to read monotonic clock, errno=%d\", errno);\n\t\treturn r;\n\t}\n\n\tcurrent_time.tv_sec += timeout / 1000;\n\tcurrent_time.tv_nsec += (timeout % 1000) * 1000000;\n\n\twhile (current_time.tv_nsec >= 1000000000) {\n\t\tcurrent_time.tv_nsec -= 1000000000;\n\t\tcurrent_time.tv_sec++;\n\t}\n\n\tTIMESPEC_TO_TIMEVAL(&transfer->timeout, &current_time);\n\treturn LIBUSB_SUCCESS;\n}\n\n/* add a transfer to the (timeout-sorted) active transfers list.\n * Callers of this function must hold the flying_transfers_lock.\n * This function *always* adds the transfer to the flying_transfers list,\n * it will return non 0 if it fails to update the timer, but even then the\n * transfer is added to the flying_transfers list. */\nstatic int add_to_flying_list(struct usbi_transfer *transfer) {\n\n\tstruct usbi_transfer *cur;\n\tstruct timeval *timeout = &transfer->timeout;\n\tstruct libusb_context *ctx = ITRANSFER_CTX(transfer);\n\tint r = 0;\n\tint first = 1;\n\n\t/* if we have no other flying transfers, start the list with this one */\n\tif (list_empty(&ctx->flying_transfers)) {\n\t\tlist_add(&transfer->list, &ctx->flying_transfers);\n\t\tgoto out;\n\t}\n\n\t/* if we have infinite timeout, append to end of list */\n\tif (!timerisset(timeout)) {\n\t\tlist_add_tail(&transfer->list, &ctx->flying_transfers);\n\t\t/* first is irrelevant in this case */\n\t\tgoto out;\n\t}\n\n\t/* otherwise, find appropriate place in list */\n\tlist_for_each_entry(cur, &ctx->flying_transfers, list, struct usbi_transfer) {\n\t\t/* find first timeout that occurs after the transfer in question */\n\t\tstruct timeval *cur_tv = &cur->timeout;\n\n\t\tif (!timerisset(cur_tv) || (cur_tv->tv_sec > timeout->tv_sec) ||\n\t\t\t\t(cur_tv->tv_sec == timeout->tv_sec &&\n\t\t\t\t\tcur_tv->tv_usec > timeout->tv_usec)) {\n\t\t\tlist_add_tail(&transfer->list, &cur->list);\n\t\t\tgoto out;\n\t\t}\n\t\tfirst = 0;\n\t}\n\t/* first is 0 at this stage (list not empty) */\n\n\t/* otherwise we need to be inserted at the end */\n\tlist_add_tail(&transfer->list, &ctx->flying_transfers);\nout:\n#ifdef USBI_TIMERFD_AVAILABLE\n\tif (first && usbi_using_timerfd(ctx) && timerisset(timeout)) {\n\t\t/* if this transfer has the lowest timeout of all active transfers,\n\t\t * rearm the timerfd with this transfer's timeout */\n\t\tconst struct itimerspec it = { {0, 0},\n\t\t\t{ timeout->tv_sec, timeout->tv_usec * 1000 } };\n\t\tusbi_dbg(\"arm timerfd for timeout in %dms (first in line)\",\n\t\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout);\n\t\tr = timerfd_settime(ctx->timerfd, TFD_TIMER_ABSTIME, &it, NULL);\n\t\tif (r < 0) {\n\t\t\tusbi_warn(ctx, \"failed to arm first timerfd (errno %d)\", errno);\n\t\t\tr = LIBUSB_ERROR_OTHER;\n\t\t}\n\t}\n#else\n\tUNUSED(first);\n#endif\n\n\treturn r;\n}\n\n/** \\ingroup asyncio\n * Allocate a libusb transfer with a specified number of isochronous packet\n * descriptors. The returned transfer is pre-initialized for you. When the new\n * transfer is no longer needed, it should be freed with\n * libusb_free_transfer().\n *\n * Transfers intended for non-isochronous endpoints (e.g. control, bulk,\n * interrupt) should specify an iso_packets count of zero.\n *\n * For transfers intended for isochronous endpoints, specify an appropriate\n * number of packet descriptors to be allocated as part of the transfer.\n * The returned transfer is not specially initialized for isochronous I/O;\n * you are still required to set the\n * \\ref libusb_transfer::num_iso_packets \"num_iso_packets\" and\n * \\ref libusb_transfer::type \"type\" fields accordingly.\n *\n * It is safe to allocate a transfer with some isochronous packets and then\n * use it on a non-isochronous endpoint. If you do this, ensure that at time\n * of submission, num_iso_packets is 0 and that type is set appropriately.\n *\n * \\param iso_packets number of isochronous packet descriptors to allocate\n * \\returns a newly allocated transfer, or NULL on error\n */\nDEFAULT_VISIBILITY\nstruct libusb_transfer * LIBUSB_CALL libusb_alloc_transfer(\n\tint iso_packets) {\n\n\tsize_t os_alloc_size = usbi_backend->transfer_priv_size\n\t\t+ (usbi_backend->add_iso_packet_size * iso_packets);\n\tsize_t alloc_size = sizeof(struct usbi_transfer)\n\t\t+ sizeof(struct libusb_transfer)\n\t\t+ (sizeof(struct libusb_iso_packet_descriptor) * iso_packets)\n\t\t+ os_alloc_size;\n\tstruct usbi_transfer *itransfer = calloc(1, alloc_size);\n\tif (UNLIKELY(!itransfer))\n\t\treturn NULL;\n\n\titransfer->num_iso_packets = iso_packets;\n\tusbi_mutex_init(&itransfer->lock, NULL);\n\treturn USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n}\n\n/** \\ingroup asyncio\n * Free a transfer structure. This should be called for all transfers\n * allocated with libusb_alloc_transfer().\n *\n * If the \\ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_BUFFER\n * \"LIBUSB_TRANSFER_FREE_BUFFER\" flag is set and the transfer buffer is\n * non-NULL, this function will also free the transfer buffer using the\n * standard system memory allocator (e.g. free()).\n *\n * It is legal to call this function with a NULL transfer. In this case,\n * the function will simply return safely.\n *\n * It is not legal to free an active transfer (one which has been submitted\n * and has not yet completed).\n *\n * \\param transfer the transfer to free\n */\nvoid API_EXPORTED libusb_free_transfer(struct libusb_transfer *transfer) {\n\n\tstruct usbi_transfer *itransfer;\n\tif (UNLIKELY(!transfer))\n\t\treturn;\n\n\tif (transfer->flags & LIBUSB_TRANSFER_FREE_BUFFER && transfer->buffer)\n\t\tfree(transfer->buffer);\n\n\titransfer = LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);\n\tusbi_mutex_destroy(&itransfer->lock);\n\tfree(itransfer);\n\ttransfer->user_data = NULL;\t// XXX\n}\n\n#ifdef USBI_TIMERFD_AVAILABLE\nstatic int disarm_timerfd(struct libusb_context *ctx) {\n\n\tconst struct itimerspec disarm_timer = { { 0, 0 }, { 0, 0 } };\n\tint r;\n\n\tusbi_dbg(\"\");\n\tr = timerfd_settime(ctx->timerfd, 0, &disarm_timer, NULL);\n\tif (UNLIKELY(r < 0))\n\t\treturn LIBUSB_ERROR_OTHER;\n\telse\n\t\treturn LIBUSB_SUCCESS;\n}\n\n/* iterates through the flying transfers, and rearms the timerfd based on the\n * next upcoming timeout.\n * must be called with flying_list locked.\n * returns 0 if there was no timeout to arm, 1 if the next timeout was armed,\n * or a LIBUSB_ERROR code on failure.\n */\nstatic int arm_timerfd_for_next_timeout(struct libusb_context *ctx) {\n\n\tstruct usbi_transfer *transfer;\n\n\tlist_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) {\n\t\tstruct timeval *cur_tv = &transfer->timeout;\n\n\t\t/* if we've reached transfers of infinite timeout, then we have no\n\t\t * arming to do */\n\t\tif (!timerisset(cur_tv))\n\t\t\tgoto disarm;\n\n\t\t/* act on first transfer that is not already cancelled */\n\t\tif (!(transfer->flags & USBI_TRANSFER_TIMED_OUT)) {\n\t\t\tint r;\n\t\t\tconst struct itimerspec it = { {0, 0},\n\t\t\t\t{ cur_tv->tv_sec, cur_tv->tv_usec * 1000 } };\n\t\t\tusbi_dbg(\"next timeout originally %dms\", USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout);\n\t\t\tr = timerfd_settime(ctx->timerfd, TFD_TIMER_ABSTIME, &it, NULL);\n\t\t\tif (r < 0)\n\t\t\t\treturn LIBUSB_ERROR_OTHER;\n\t\t\treturn 1;\n\t\t}\n\t}\n\ndisarm:\n\treturn disarm_timerfd(ctx);\n}\n#else\nstatic int arm_timerfd_for_next_timeout(struct libusb_context *ctx) {\n\n\t(void)ctx;\n\treturn LIBUSB_SUCCESS;\n}\n#endif\n\n/** \\ingroup asyncio\n * Submit a transfer. This function will fire off the USB transfer and then\n * return immediately.\n *\n * \\param transfer the transfer to submit\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns LIBUSB_ERROR_BUSY if the transfer has already been submitted.\n * \\returns LIBUSB_ERROR_NOT_SUPPORTED if the transfer flags are not supported\n * by the operating system.\n * \\returns another LIBUSB_ERROR code on other failure\n */\nint API_EXPORTED libusb_submit_transfer(struct libusb_transfer *transfer) {\n\n\tstruct libusb_context *ctx = TRANSFER_CTX(transfer);\n\tstruct usbi_transfer *itransfer =\n\t\tLIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);\n\tint r;\n\tint updated_fds;\n\n\tusbi_mutex_lock(&ctx->flying_transfers_lock);\n\tusbi_mutex_lock(&itransfer->lock);\n\t{\n\t\titransfer->transferred = 0;\n\t\titransfer->flags = 0;\n\t\tr = calculate_timeout(itransfer);\n\t\tif (UNLIKELY(r < 0)) {\n\t\t\tr = LIBUSB_ERROR_OTHER;\n\t\t\tgoto out;\n\t\t}\n\n\t\tr = add_to_flying_list(itransfer);\n\t\tif (LIKELY(r == LIBUSB_SUCCESS)) {\n\t\t\tr = usbi_backend->submit_transfer(itransfer);\n\t\t}\n\t\tif (UNLIKELY(r != LIBUSB_SUCCESS)) {\n\t\t\tlist_del(&itransfer->list);\n\t\t\tarm_timerfd_for_next_timeout(ctx);\n\t\t} else {\n\t\t\t/* keep a reference to this device */\n\t\t\tlibusb_ref_device(transfer->dev_handle->dev);\n\t\t}\nout:\n\t\tupdated_fds = (itransfer->flags & USBI_TRANSFER_UPDATED_FDS);\n\t}\n\tusbi_mutex_unlock(&itransfer->lock);\n\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\tif (updated_fds)\n\t\tusbi_fd_notification(ctx);\n\treturn r;\n}\n\n/** \\ingroup asyncio\n * Asynchronously cancel a previously submitted transfer.\n * This function returns immediately, but this does not indicate cancellation\n * is complete. Your callback function will be invoked at some later time\n * with a transfer status of\n * \\ref libusb_transfer_status::LIBUSB_TRANSFER_CANCELLED\n * \"LIBUSB_TRANSFER_CANCELLED.\"\n *\n * \\param transfer the transfer to cancel\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the transfer is already complete or\n * cancelled.\n * \\returns a LIBUSB_ERROR code on failure\n */\nint API_EXPORTED libusb_cancel_transfer(struct libusb_transfer *transfer) {\n\n\tstruct usbi_transfer *itransfer = LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);\n\tint r;\n\n\tusbi_dbg(\"\");\n\tusbi_mutex_lock(&itransfer->lock);\n\t{\n\t\tr = usbi_backend->cancel_transfer(itransfer);\n\t\tif (UNLIKELY(r < 0)) {\n\t\t\tif (r != LIBUSB_ERROR_NOT_FOUND &&\n\t\t\t    r != LIBUSB_ERROR_NO_DEVICE) {\n\t\t\t\tusbi_err(TRANSFER_CTX(transfer), \"cancel transfer failed error %d\", r);\n\t\t\t} else {\n\t\t\t\tusbi_dbg(\"cancel transfer failed error %d\", r);\n\t\t\t}\n\t\t\tif (r == LIBUSB_ERROR_NO_DEVICE)\n\t\t\t\titransfer->flags |= USBI_TRANSFER_DEVICE_DISAPPEARED;\n\t\t}\n\n\t\titransfer->flags |= USBI_TRANSFER_CANCELLING;\n\t}\n\tusbi_mutex_unlock(&itransfer->lock);\n\treturn r;\n}\n\n/** \\ingroup asyncio\n * Set a transfers bulk stream id. Note users are advised to use\n * libusb_fill_bulk_stream_transfer() instead of calling this function\n * directly.\n *\n * Since version 1.0.19, \\ref LIBUSB_API_VERSION >= 0x01000103\n *\n * \\param transfer the transfer to set the stream id for\n * \\param stream_id the stream id to set\n * \\see libusb_alloc_streams()\n */\nvoid API_EXPORTED libusb_transfer_set_stream_id(\n\tstruct libusb_transfer *transfer, uint32_t stream_id)\n{\n\tstruct usbi_transfer *itransfer =\n\t\tLIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);\n\n\titransfer->stream_id = stream_id;\n}\n\n/** \\ingroup asyncio\n * Get a transfers bulk stream id.\n *\n * Since version 1.0.19, \\ref LIBUSB_API_VERSION >= 0x01000103\n *\n * \\param transfer the transfer to get the stream id for\n * \\returns the stream id for the transfer\n */\nuint32_t API_EXPORTED libusb_transfer_get_stream_id(\n\tstruct libusb_transfer *transfer)\n{\n\tstruct usbi_transfer *itransfer =\n\t\tLIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);\n\n\treturn itransfer->stream_id;\n}\n\n/* Handle completion of a transfer (completion might be an error condition).\n * This will invoke the user-supplied callback function, which may end up\n * freeing the transfer. Therefore you cannot use the transfer structure\n * after calling this function, and you should free all backend-specific\n * data before calling it.\n * Do not call this function with the usbi_transfer lock held. User-specified\n * callback functions may attempt to directly resubmit the transfer, which\n * will attempt to take the lock. */\nint usbi_handle_transfer_completion(struct usbi_transfer *itransfer,\n\tenum libusb_transfer_status status) {\n\n\tstruct libusb_transfer *transfer =\n\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct libusb_context *ctx = TRANSFER_CTX(transfer);\n\tstruct libusb_device_handle *handle = transfer->dev_handle;\n\tuint8_t flags;\n\tint r = 0;\n\n\t/* FIXME: could be more intelligent with the timerfd here. we don't need\n\t * to disarm the timerfd if there was no timer running, and we only need\n\t * to rearm the timerfd if the transfer that expired was the one with\n\t * the shortest timeout. */\n\n\tusbi_mutex_lock(&ctx->flying_transfers_lock);\n\t{\n\t\tlist_del(&itransfer->list);\n\t\tif (usbi_using_timerfd(ctx))\n\t\t\tr = arm_timerfd_for_next_timeout(ctx);\n\t}\n\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\tif (usbi_using_timerfd(ctx) && (r < 0))\n\t\treturn r;\n\n\tif (status == LIBUSB_TRANSFER_COMPLETED\n\t\t\t&& transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) {\n\t\tint rqlen = transfer->length;\n\t\tif (transfer->type == LIBUSB_TRANSFER_TYPE_CONTROL)\n\t\t\trqlen -= LIBUSB_CONTROL_SETUP_SIZE;\n\t\tif (rqlen != itransfer->transferred) {\t// XXX itransfer->transferred is almost always zero on iso transfer mode...\n\t\t\tusbi_dbg(\"interpreting short transfer as error\");\n\t\t\tLOGI(\"interpreting short transfer as error:rqlen=%d,transferred=%d\", rqlen, itransfer->transferred);\n\t\t\tstatus = LIBUSB_TRANSFER_ERROR;\n\t\t}\n\t}\n\n\tflags = transfer->flags;\n\ttransfer->status = status;\n\ttransfer->actual_length = itransfer->transferred;\t// XXX therefore transfer->actual_length is also almost always zero on iso transfer mode\n\tusbi_dbg(\"transfer %p has callback %p\", transfer, transfer->callback);\n\tif LIKELY(transfer->callback)\n\t\ttransfer->callback(transfer);\n\t/* transfer might have been freed by the above call, do not use from\n\t * this point. */\n\tif (flags & LIBUSB_TRANSFER_FREE_TRANSFER)\n\t\tlibusb_free_transfer(transfer);\n\tusbi_mutex_lock(&ctx->event_waiters_lock);\n\t{\n\t\tusbi_cond_broadcast(&ctx->event_waiters_cond);\n\t}\n\tusbi_mutex_unlock(&ctx->event_waiters_lock);\n\tlibusb_unref_device(handle->dev);\n\treturn LIBUSB_SUCCESS;\n}\n\n/* Similar to usbi_handle_transfer_completion() but exclusively for transfers\n * that were asynchronously cancelled. The same concerns w.r.t. freeing of\n * transfers exist here.\n * Do not call this function with the usbi_transfer lock held. User-specified\n * callback functions may attempt to directly resubmit the transfer, which\n * will attempt to take the lock. */\nint usbi_handle_transfer_cancellation(struct usbi_transfer *transfer) {\n\n\t/* if the URB was cancelled due to timeout, report timeout to the user */\n\tif (transfer->flags & USBI_TRANSFER_TIMED_OUT) {\n\t\tusbi_dbg(\"detected timeout cancellation\");\n\t\treturn usbi_handle_transfer_completion(transfer, LIBUSB_TRANSFER_TIMED_OUT);\n\t}\n\n\t/* otherwise its a normal async cancel */\n\treturn usbi_handle_transfer_completion(transfer, LIBUSB_TRANSFER_CANCELLED);\n}\n\n/** \\ingroup poll\n * Attempt to acquire the event handling lock. This lock is used to ensure that\n * only one thread is monitoring libusb event sources at any one time.\n *\n * You only need to use this lock if you are developing an application\n * which calls poll() or select() on libusb's file descriptors directly.\n * If you stick to libusb's event handling loop functions (e.g.\n * libusb_handle_events()) then you do not need to be concerned with this\n * locking.\n *\n * While holding this lock, you are trusted to actually be handling events.\n * If you are no longer handling events, you must call libusb_unlock_events()\n * as soon as possible.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\returns 0 if the lock was obtained successfully\n * \\returns 1 if the lock was not obtained (i.e. another thread holds the lock)\n * \\ref mtasync\n */\nint API_EXPORTED libusb_try_lock_events(libusb_context *ctx) {\n\n\tint r;\n\tunsigned int ru;\n\tUSBI_GET_CONTEXT(ctx);\n\n\t/* is someone else waiting to modify poll fds? if so, don't let this thread\n\t * start event handling */\n\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\t{\n\t\tru = ctx->pollfd_modify;\n\t}\n\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\tif (UNLIKELY(ru)) {\n\t\tusbi_dbg(\"someone else is modifying poll fds\");\n\t\treturn 1;\n\t}\n\n\tr = usbi_mutex_trylock(&ctx->events_lock);\n\tif (UNLIKELY(r))\n\t\treturn 1;\n\n\tctx->event_handler_active = 1;\n\treturn LIBUSB_SUCCESS;\n}\n\n/** \\ingroup poll\n * Acquire the event handling lock, blocking until successful acquisition if\n * it is contended. This lock is used to ensure that only one thread is\n * monitoring libusb event sources at any one time.\n *\n * You only need to use this lock if you are developing an application\n * which calls poll() or select() on libusb's file descriptors directly.\n * If you stick to libusb's event handling loop functions (e.g.\n * libusb_handle_events()) then you do not need to be concerned with this\n * locking.\n *\n * While holding this lock, you are trusted to actually be handling events.\n * If you are no longer handling events, you must call libusb_unlock_events()\n * as soon as possible.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\ref mtasync\n */\nvoid API_EXPORTED libusb_lock_events(libusb_context *ctx) {\n\n\tUSBI_GET_CONTEXT(ctx);\n\tusbi_mutex_lock(&ctx->events_lock);\n\tctx->event_handler_active = 1;\n}\n\n/** \\ingroup poll\n * Release the lock previously acquired with libusb_try_lock_events() or\n * libusb_lock_events(). Releasing this lock will wake up any threads blocked\n * on libusb_wait_for_event().\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\ref mtasync\n */\nvoid API_EXPORTED libusb_unlock_events(libusb_context *ctx) {\n\n\tUSBI_GET_CONTEXT(ctx);\n\tctx->event_handler_active = 0;\n\tusbi_mutex_unlock(&ctx->events_lock);\n\n\t/* FIXME: perhaps we should be a bit more efficient by not broadcasting\n\t * the availability of the events lock when we are modifying pollfds\n\t * (check ctx->pollfd_modify)? */\n\tusbi_mutex_lock(&ctx->event_waiters_lock);\n\t{\n\t\tusbi_cond_broadcast(&ctx->event_waiters_cond);\n\t}\n\tusbi_mutex_unlock(&ctx->event_waiters_lock);\n}\n\n/** \\ingroup poll\n * Determine if it is still OK for this thread to be doing event handling.\n *\n * Sometimes, libusb needs to temporarily pause all event handlers, and this\n * is the function you should use before polling file descriptors to see if\n * this is the case.\n *\n * If this function instructs your thread to give up the events lock, you\n * should just continue the usual logic that is documented in \\ref mtasync.\n * On the next iteration, your thread will fail to obtain the events lock,\n * and will hence become an event waiter.\n *\n * This function should be called while the events lock is held: you don't\n * need to worry about the results of this function if your thread is not\n * the current event handler.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\returns 1 if event handling can start or continue\n * \\returns 0 if this thread must give up the events lock\n * \\ref fullstory \"Multi-threaded I/O: the full story\"\n */\nint API_EXPORTED libusb_event_handling_ok(libusb_context *ctx) {\n\n\tunsigned int r;\n\tUSBI_GET_CONTEXT(ctx);\n\n\t/* is someone else waiting to modify poll fds? if so, don't let this thread\n\t * continue event handling */\n\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\t{\n\t\tr = ctx->pollfd_modify;\n\t}\n\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\tif (r) {\n\t\tusbi_dbg(\"someone else is modifying poll fds\");\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\treturn 1;\n}\n\n\n/** \\ingroup poll\n * Determine if an active thread is handling events (i.e. if anyone is holding\n * the event handling lock).\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\returns 1 if a thread is handling events\n * \\returns 0 if there are no threads currently handling events\n * \\ref mtasync\n */\nint API_EXPORTED libusb_event_handler_active(libusb_context *ctx) {\n\n\tunsigned int r;\n\tUSBI_GET_CONTEXT(ctx);\n\n\t/* is someone else waiting to modify poll fds? if so, don't let this thread\n\t * start event handling -- indicate that event handling is happening */\n\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\t{\n\t\tr = ctx->pollfd_modify;\n\t}\n\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\tif (r) {\n\t\tusbi_dbg(\"someone else is modifying poll fds\");\n\t\treturn 1;\n\t}\n\n\treturn ctx->event_handler_active;\n}\n\n/** \\ingroup poll\n * Acquire the event waiters lock. This lock is designed to be obtained under\n * the situation where you want to be aware when events are completed, but\n * some other thread is event handling so calling libusb_handle_events() is not\n * allowed.\n *\n * You then obtain this lock, re-check that another thread is still handling\n * events, then call libusb_wait_for_event().\n *\n * You only need to use this lock if you are developing an application\n * which calls poll() or select() on libusb's file descriptors directly,\n * <b>and</b> may potentially be handling events from 2 threads simultaenously.\n * If you stick to libusb's event handling loop functions (e.g.\n * libusb_handle_events()) then you do not need to be concerned with this\n * locking.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\ref mtasync\n */\nvoid API_EXPORTED libusb_lock_event_waiters(libusb_context *ctx) {\n\tUSBI_GET_CONTEXT(ctx);\n\tusbi_mutex_lock(&ctx->event_waiters_lock);\n}\n\n/** \\ingroup poll\n * Release the event waiters lock.\n * \\param ctx the context to operate on, or NULL for the default context\n * \\ref mtasync\n */\nvoid API_EXPORTED libusb_unlock_event_waiters(libusb_context *ctx) {\n\tUSBI_GET_CONTEXT(ctx);\n\tusbi_mutex_unlock(&ctx->event_waiters_lock);\n}\n\n/** \\ingroup poll\n * Wait for another thread to signal completion of an event. Must be called\n * with the event waiters lock held, see libusb_lock_event_waiters().\n *\n * This function will block until any of the following conditions are met:\n * -# The timeout expires\n * -# A transfer completes\n * -# A thread releases the event handling lock through libusb_unlock_events()\n *\n * Condition 1 is obvious. Condition 2 unblocks your thread <em>after</em>\n * the callback for the transfer has completed. Condition 3 is important\n * because it means that the thread that was previously handling events is no\n * longer doing so, so if any events are to complete, another thread needs to\n * step up and start event handling.\n *\n * This function releases the event waiters lock before putting your thread\n * to sleep, and reacquires the lock as it is being woken up.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param tv maximum timeout for this blocking function. A NULL value\n * indicates unlimited timeout.\n * \\returns 0 after a transfer completes or another thread stops event handling\n * \\returns 1 if the timeout expired\n * \\ref mtasync\n */\nint API_EXPORTED libusb_wait_for_event(libusb_context *ctx, struct timeval *tv) {\n\n\tstruct timespec timeout;\n\tint r;\n\n\tUSBI_GET_CONTEXT(ctx);\n\tif (tv == NULL) {\n\t\tusbi_cond_wait(&ctx->event_waiters_cond, &ctx->event_waiters_lock);\n\t\treturn 0;\n\t}\n\n\tr = usbi_backend->clock_gettime(USBI_CLOCK_REALTIME, &timeout);\n\tif (UNLIKELY(r < 0)) {\n\t\tusbi_err(ctx, \"failed to read realtime clock, error %d\", errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\ttimeout.tv_sec += tv->tv_sec;\n\ttimeout.tv_nsec += tv->tv_usec * 1000;\n\twhile (timeout.tv_nsec >= 1000000000) {\n\t\ttimeout.tv_nsec -= 1000000000;\n\t\ttimeout.tv_sec++;\n\t}\n\n\tr = usbi_cond_timedwait(&ctx->event_waiters_cond,\n\t\t&ctx->event_waiters_lock, &timeout);\t// XXX crash 2014/10/02 SIGABRT/SI_TKILL\n\treturn (r == ETIMEDOUT);\n}\n\nstatic void handle_timeout(struct usbi_transfer *itransfer) {\n\n\tstruct libusb_transfer *transfer =\n\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tint r;\n\n\titransfer->flags |= USBI_TRANSFER_TIMED_OUT;\n\tr = libusb_cancel_transfer(transfer);\n\tif (UNLIKELY(r < 0))\n\t\tusbi_warn(TRANSFER_CTX(transfer),\n\t\t\t\"async cancel failed %d errno=%d\", r, errno);\n}\n\nstatic int handle_timeouts_locked(struct libusb_context *ctx) {\n\n\tint r;\n\tstruct timespec systime_ts;\n\tstruct timeval systime;\n\tstruct usbi_transfer *transfer;\n\n\tif (list_empty(&ctx->flying_transfers))\n\t\treturn 0;\n\n\t/* get current time */\n\tr = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, &systime_ts);\n\tif (UNLIKELY(r < 0))\n\t\treturn r;\n\n\tTIMESPEC_TO_TIMEVAL(&systime, &systime_ts);\n\n\t/* iterate through flying transfers list, finding all transfers that\n\t * have expired timeouts */\n\tlist_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) {\n\t\tstruct timeval *cur_tv = &transfer->timeout;\n\n\t\t/* if we've reached transfers of infinite timeout, we're all done */\n\t\tassert(cur_tv);\t\t\t\t// XXX add assert\n\t\tif (!timerisset(cur_tv))\t// XXX crash\n\t\t\treturn 0;\n\n\t\t/* ignore timeouts we've already handled */\n\t\tif (transfer->flags & (USBI_TRANSFER_TIMED_OUT | USBI_TRANSFER_OS_HANDLES_TIMEOUT))\n\t\t\tcontinue;\n\n\t\t/* if transfer has non-expired timeout, nothing more to do */\n\t\tif ((cur_tv->tv_sec > systime.tv_sec) ||\n\t\t\t\t(cur_tv->tv_sec == systime.tv_sec &&\n\t\t\t\t\tcur_tv->tv_usec > systime.tv_usec))\n\t\t\treturn 0;\n\n\t\t/* otherwise, we've got an expired timeout to handle */\n\t\thandle_timeout(transfer);\n\t}\n\treturn 0;\n}\n\nstatic int handle_timeouts(struct libusb_context *ctx) {\n\n\tint r;\n\tUSBI_GET_CONTEXT(ctx);\n\tusbi_mutex_lock(&ctx->flying_transfers_lock);\n\t{\n\t\tr = handle_timeouts_locked(ctx);\n\t}\n\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\treturn r;\n}\n\n#ifdef USBI_TIMERFD_AVAILABLE\nstatic int handle_timerfd_trigger(struct libusb_context *ctx) {\n\n\tint r;\n\n\tusbi_mutex_lock(&ctx->flying_transfers_lock);\n\t{\n\t\t/* process the timeout that just happened */\n\t\tr = handle_timeouts_locked(ctx);\n\t\tif (UNLIKELY(r < 0))\n\t\t\tgoto out;\n\n\t\t/* arm for next timeout*/\n\t\tr = arm_timerfd_for_next_timeout(ctx);\n\nout:\n\t\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\t}\n\treturn r;\n}\n#endif\n\n/* do the actual event handling. assumes that no other thread is concurrently\n * doing the same thing. */\nstatic int handle_events(struct libusb_context *ctx, struct timeval *tv) {\n\n\tint r;\n\tstruct usbi_pollfd *ipollfd;\n\tPOLL_NFDS_TYPE nfds = 0;\n\tstruct pollfd *fds = NULL;\n\tint i = -1;\n\tint timeout_ms;\n\tint special_event;\n\n\tusbi_mutex_lock(&ctx->pollfds_lock);\n\t{\n\t\tlist_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd)\n\t\t\tnfds++;\n\n\t\t/* TODO: malloc when number of fd's changes, not on every poll */\n\t\tif (nfds != 0)\n\t\t\tfds = malloc(sizeof(*fds) * nfds);\n\t\tif (UNLIKELY(!fds)) {\n\t\t\tusbi_mutex_unlock(&ctx->pollfds_lock);\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\t}\n\n\t\tlist_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd) {\n\t\t\tstruct libusb_pollfd *pollfd = &ipollfd->pollfd;\n\t\t\tint fd = pollfd->fd;\n\t\t\ti++;\n\t\t\tfds[i].fd = fd;\n\t\t\tfds[i].events = pollfd->events;\n\t\t\tfds[i].revents = 0;\n\t\t}\n\t}\n\tusbi_mutex_unlock(&ctx->pollfds_lock);\n\n\ttimeout_ms = (int)(tv->tv_sec * 1000) + (tv->tv_usec / 1000);\n\n\t/* round up to next millisecond */\n\tif (tv->tv_usec % 1000)\n\t\ttimeout_ms++;\n\nredo_poll:\n\tusbi_dbg(\"poll() %d fds with timeout in %dms\", nfds, timeout_ms);\n\tr = usbi_poll(fds, nfds, timeout_ms);\n\tusbi_dbg(\"poll() returned %d\", r);\n\tif (r == 0) {\n\t\tfree(fds);\n\t\treturn handle_timeouts(ctx);\n\t} else if (r == -1 && errno == EINTR) {\n\t\tfree(fds);\n\t\treturn LIBUSB_ERROR_INTERRUPTED;\n\t} else if (UNLIKELY(r < 0)) {\n\t\tfree(fds);\n\t\tusbi_err(ctx, \"poll failed %d err=%d\\n\", r, errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tspecial_event = 0;\n\n\t/* fd[0] is always the ctrl pipe */\n\tif (fds[0].revents) {\n\t\t/* another thread wanted to interrupt event handling, and it succeeded!\n\t\t * handle any other events that cropped up at the same time, and\n\t\t * simply return */\n\t\tusbi_dbg(\"caught a fish on the control pipe\");\n\n\t\tif (r == 1) {\n\t\t\tr = 0;\n\t\t\tgoto handled;\n\t\t} else {\n\t\t\t/* prevent OS backend from trying to handle events on ctrl pipe */\n\t\t\tfds[0].revents = 0;\n\t\t\tr--;\n\t\t}\n\t}\n\n\t/* fd[1] is always the hotplug pipe */\n\tif (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) && fds[1].revents) {\n\t\tlibusb_hotplug_message message;\n\t\tssize_t ret;\n\n\t\tusbi_dbg(\"caught a fish on the hotplug pipe\");\n\t\tspecial_event = 1;\n\n\t\t/* read the message from the hotplug thread */\n\t\tret = usbi_read(ctx->hotplug_pipe[0], &message, sizeof (message));\n\t\tif (ret != sizeof(message)) {\n\t\t\tusbi_err(ctx, \"hotplug pipe read error %d != %u\",\n\t\t\t\t ret, sizeof(message));\n\t\t\tr = LIBUSB_ERROR_OTHER;\n\t\t\tgoto handled;\n\t\t}\n\n\t\tusbi_hotplug_match(ctx, message.device, message.event);\n\n\t\t/* the device left. dereference the device */\n\t\tif (LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT == message.event)\n\t\t\tlibusb_unref_device(message.device);\n\n\t\tfds[1].revents = 0;\n\t\tif (1 == r--)\n\t\t\tgoto handled;\n\t} /* else there shouldn't be anything on this pipe */\n\n#ifdef USBI_TIMERFD_AVAILABLE\n\t/* on timerfd configurations, fds[2] is the timerfd */\n\tif (usbi_using_timerfd(ctx) && fds[2].revents) {\n\t\t/* timerfd indicates that a timeout has expired */\n\t\tint ret;\n\t\tusbi_dbg(\"timerfd triggered\");\n\t\tspecial_event = 1;\n\n\t\tret = handle_timerfd_trigger(ctx);\n\t\tif (UNLIKELY(ret < 0)) {\n\t\t\t/* return error code */\n\t\t\tr = ret;\n\t\t\tgoto handled;\n\t\t} else if (r == 1) {\n\t\t\t/* no more active file descriptors, nothing more to do */\n\t\t\tr = 0;\n\t\t\tgoto handled;\n\t\t} else {\n\t\t\t/* more events pending...\n\t\t\t * prevent OS backend from trying to handle events on timerfd */\n\t\t\tfds[2].revents = 0;\n\t\t\tr--;\n\t\t}\n\t}\n#endif\n\n\tr = usbi_backend->handle_events(ctx, fds, nfds, r);\n\tif (UNLIKELY(r))\n\t\tusbi_err(ctx, \"backend handle_events failed with error %d\", r);\n\nhandled:\n\tif (r == 0 && special_event) {\n\t\t\ttimeout_ms = 0;\n\t\t\tgoto redo_poll;\n\t}\n\n\tfree(fds);\n\treturn r;\n}\n\n/* returns the smallest of:\n *  1. timeout of next URB\n *  2. user-supplied timeout\n * returns 1 if there is an already-expired timeout, otherwise returns 0\n * and populates out\n */\nstatic int get_next_timeout(libusb_context *ctx, struct timeval *tv,\n\tstruct timeval *out) {\n\n\tstruct timeval timeout;\n\tint r = libusb_get_next_timeout(ctx, &timeout);\n\tif (r) {\n\t\t/* timeout already expired? */\n\t\tif (!timerisset(&timeout))\n\t\t\treturn 1;\n\n\t\t/* choose the smallest of next URB timeout or user specified timeout */\n\t\tif (timercmp(&timeout, tv, <))\n\t\t\t*out = timeout;\n\t\telse\n\t\t\t*out = *tv;\n\t} else {\n\t\t*out = *tv;\n\t}\n\treturn 0;\n}\n\n/** \\ingroup poll\n * Handle any pending events.\n *\n * libusb determines \"pending events\" by checking if any timeouts have expired\n * and by checking the set of file descriptors for activity.\n *\n * If a zero timeval is passed, this function will handle any already-pending\n * events and then immediately return in non-blocking style.\n *\n * If a non-zero timeval is passed and no events are currently pending, this\n * function will block waiting for events to handle up until the specified\n * timeout. If an event arrives or a signal is raised, this function will\n * return early.\n *\n * If the parameter completed is not NULL then <em>after obtaining the event\n * handling lock</em> this function will return immediately if the integer\n * pointed to is not 0. This allows for race free waiting for the completion\n * of a specific transfer.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param tv the maximum time to block waiting for events, or an all zero\n * timeval struct for non-blocking mode\n * \\param completed pointer to completion integer to check, or NULL\n * \\returns 0 on success, or a LIBUSB_ERROR code on failure\n * \\ref mtasync\n */\nint API_EXPORTED libusb_handle_events_timeout_completed(libusb_context *ctx,\n\tstruct timeval *tv, int *completed) {\n\t\n\tint r;\n\tstruct timeval poll_timeout;\n\n\tUSBI_GET_CONTEXT(ctx);\n\tr = get_next_timeout(ctx, tv, &poll_timeout);\n\tif (r) {\n\t\t/* timeout already expired */\n\t\treturn handle_timeouts(ctx);\n\t}\n\nretry:\n\tif (libusb_try_lock_events(ctx) == 0) {\n\t\tif (completed == NULL || !*completed) {\n\t\t\t/* we obtained the event lock: do our own event handling */\n\t\t\tusbi_dbg(\"doing our own event handling\");\n\t\t\tr = handle_events(ctx, &poll_timeout);\n\t\t}\n\t\tlibusb_unlock_events(ctx);\n\t\treturn r;\n\t}\n\n\t/* another thread is doing event handling. wait for thread events that\n\t * notify event completion. */\n\tlibusb_lock_event_waiters(ctx);\n\n\tif (completed && *completed)\n\t\tgoto already_done;\n\n\tif (!libusb_event_handler_active(ctx)) {\n\t\t/* we hit a race: whoever was event handling earlier finished in the\n\t\t * time it took us to reach this point. try the cycle again. */\n\t\tlibusb_unlock_event_waiters(ctx);\n\t\tusbi_dbg(\"event handler was active but went away, retrying\");\n\t\tgoto retry;\n\t}\n\n\tusbi_dbg(\"another thread is doing event handling\");\n\tr = libusb_wait_for_event(ctx, &poll_timeout);\n\nalready_done:\n\tlibusb_unlock_event_waiters(ctx);\n\n\tif (UNLIKELY(r < 0))\n\t\treturn r;\n\telse if (r == 1)\n\t\treturn handle_timeouts(ctx);\n\telse\n\t\treturn 0;\n}\n\n/** \\ingroup poll\n * Handle any pending events\n *\n * Like libusb_handle_events_timeout_completed(), but without the completed\n * parameter, calling this function is equivalent to calling\n * libusb_handle_events_timeout_completed() with a NULL completed parameter.\n *\n * This function is kept primarily for backwards compatibility.\n * All new code should call libusb_handle_events_completed() or\n * libusb_handle_events_timeout_completed() to avoid race conditions.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param tv the maximum time to block waiting for events, or an all zero\n * timeval struct for non-blocking mode\n * \\returns 0 on success, or a LIBUSB_ERROR code on failure\n */\nint API_EXPORTED libusb_handle_events_timeout(libusb_context *ctx,\n\tstruct timeval *tv) {\n\n\treturn libusb_handle_events_timeout_completed(ctx, tv, NULL);\n}\n\n/** \\ingroup poll\n * Handle any pending events in blocking mode. There is currently a timeout\n * hardcoded at 60 seconds but we plan to make it unlimited in future. For\n * finer control over whether this function is blocking or non-blocking, or\n * for control over the timeout, use libusb_handle_events_timeout_completed()\n * instead.\n *\n * This function is kept primarily for backwards compatibility.\n * All new code should call libusb_handle_events_completed() or\n * libusb_handle_events_timeout_completed() to avoid race conditions.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\returns 0 on success, or a LIBUSB_ERROR code on failure\n */\nint API_EXPORTED libusb_handle_events(libusb_context *ctx) {\n\n\tstruct timeval tv;\n\ttv.tv_sec = 60;\n\ttv.tv_usec = 0;\n\treturn libusb_handle_events_timeout_completed(ctx, &tv, NULL);\n}\n\n/** \\ingroup poll\n * Handle any pending events in blocking mode.\n *\n * Like libusb_handle_events(), with the addition of a completed parameter\n * to allow for race free waiting for the completion of a specific transfer.\n *\n * See libusb_handle_events_timeout_completed() for details on the completed\n * parameter.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param completed pointer to completion integer to check, or NULL\n * \\returns 0 on success, or a LIBUSB_ERROR code on failure\n * \\ref mtasync\n */\nint API_EXPORTED libusb_handle_events_completed(libusb_context *ctx,\n\tint *completed) {\n\n\tstruct timeval tv;\n\ttv.tv_sec = 60;\n\ttv.tv_usec = 0;\n\treturn libusb_handle_events_timeout_completed(ctx, &tv, completed);\n}\n\n/** \\ingroup poll\n * Handle any pending events by polling file descriptors, without checking if\n * any other threads are already doing so. Must be called with the event lock\n * held, see libusb_lock_events().\n *\n * This function is designed to be called under the situation where you have\n * taken the event lock and are calling poll()/select() directly on libusb's\n * file descriptors (as opposed to using libusb_handle_events() or similar).\n * You detect events on libusb's descriptors, so you then call this function\n * with a zero timeout value (while still holding the event lock).\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param tv the maximum time to block waiting for events, or zero for\n * non-blocking mode\n * \\returns 0 on success, or a LIBUSB_ERROR code on failure\n * \\ref mtasync\n */\nint API_EXPORTED libusb_handle_events_locked(libusb_context *ctx,\n\tstruct timeval *tv) {\n\t\n\tint r;\n\tstruct timeval poll_timeout;\n\n\tUSBI_GET_CONTEXT(ctx);\n\tr = get_next_timeout(ctx, tv, &poll_timeout);\n\tif (r) {\n\t\t/* timeout already expired */\n\t\treturn handle_timeouts(ctx);\n\t}\n\n\treturn handle_events(ctx, &poll_timeout);\n}\n\n/** \\ingroup poll\n * Determines whether your application must apply special timing considerations\n * when monitoring libusb's file descriptors.\n *\n * This function is only useful for applications which retrieve and poll\n * libusb's file descriptors in their own main loop (\\ref pollmain).\n *\n * Ordinarily, libusb's event handler needs to be called into at specific\n * moments in time (in addition to times when there is activity on the file\n * descriptor set). The usual approach is to use libusb_get_next_timeout()\n * to learn about when the next timeout occurs, and to adjust your\n * poll()/select() timeout accordingly so that you can make a call into the\n * library at that time.\n *\n * Some platforms supported by libusb do not come with this baggage - any\n * events relevant to timing will be represented by activity on the file\n * descriptor set, and libusb_get_next_timeout() will always return 0.\n * This function allows you to detect whether you are running on such a\n * platform.\n *\n * Since v1.0.5.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\returns 0 if you must call into libusb at times determined by\n * libusb_get_next_timeout(), or 1 if all timeout events are handled internally\n * or through regular activity on the file descriptors.\n * \\ref pollmain \"Polling libusb file descriptors for event handling\"\n */\nint API_EXPORTED libusb_pollfds_handle_timeouts(libusb_context *ctx) {\n\n#if defined(USBI_TIMERFD_AVAILABLE)\n\tUSBI_GET_CONTEXT(ctx);\n\treturn usbi_using_timerfd(ctx);\n#else\n\t(void)ctx;\n\treturn 0;\n#endif\n}\n\n/** \\ingroup poll\n * Determine the next internal timeout that libusb needs to handle. You only\n * need to use this function if you are calling poll() or select() or similar\n * on libusb's file descriptors yourself - you do not need to use it if you\n * are calling libusb_handle_events() or a variant directly.\n *\n * You should call this function in your main loop in order to determine how\n * long to wait for select() or poll() to return results. libusb needs to be\n * called into at this timeout, so you should use it as an upper bound on\n * your select() or poll() call.\n *\n * When the timeout has expired, call into libusb_handle_events_timeout()\n * (perhaps in non-blocking mode) so that libusb can handle the timeout.\n *\n * This function may return 1 (success) and an all-zero timeval. If this is\n * the case, it indicates that libusb has a timeout that has already expired\n * so you should call libusb_handle_events_timeout() or similar immediately.\n * A return code of 0 indicates that there are no pending timeouts.\n *\n * On some platforms, this function will always returns 0 (no pending\n * timeouts). See \\ref polltime.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param tv output location for a relative time against the current\n * clock in which libusb must be called into in order to process timeout events\n * \\returns 0 if there are no pending timeouts, 1 if a timeout was returned,\n * or LIBUSB_ERROR_OTHER on failure\n */\nint API_EXPORTED libusb_get_next_timeout(libusb_context *ctx,\n\tstruct timeval *tv) {\n\n\tstruct usbi_transfer *transfer;\n\tstruct timespec cur_ts;\n\tstruct timeval cur_tv;\n\tstruct timeval *next_timeout;\n\tint r;\n\tint found = 0;\n\n\tUSBI_GET_CONTEXT(ctx);\n\tif (usbi_using_timerfd(ctx))\n\t\treturn 0;\n\n\tusbi_mutex_lock(&ctx->flying_transfers_lock);\n\t{\n\t\tif (list_empty(&ctx->flying_transfers)) {\n\t\t\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\t\t\tusbi_dbg(\"no URBs, no timeout!\");\n\t\t\treturn 0;\n\t\t}\n\n\t\t/* find next transfer which hasn't already been processed as timed out */\n\t\tlist_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) {\n\t\t\tif (transfer->flags & (USBI_TRANSFER_TIMED_OUT | USBI_TRANSFER_OS_HANDLES_TIMEOUT))\n\t\t\t\tcontinue;\n\n\t\t\t/* no timeout for this transfer? */\n\t\t\tif (!timerisset(&transfer->timeout))\n\t\t\t\tcontinue;\n\n\t\t\tfound = 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\n\tif (!found) {\n\t\tusbi_dbg(\"no URB with timeout or all handled by OS; no timeout!\");\n\t\treturn 0;\n\t}\n\n\tnext_timeout = &transfer->timeout;\n\n\tr = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, &cur_ts);\n\tif (UNLIKELY(r < 0)) {\n\t\tusbi_err(ctx, \"failed to read monotonic clock, errno=%d\", errno);\n\t\treturn 0;\n\t}\n\tTIMESPEC_TO_TIMEVAL(&cur_tv, &cur_ts);\n\n\tif (!timercmp(&cur_tv, next_timeout, <)) {\n\t\tusbi_dbg(\"first timeout already expired\");\n\t\ttimerclear(tv);\n\t} else {\n\t\ttimersub(next_timeout, &cur_tv, tv);\n\t\tusbi_dbg(\"next timeout in %d.%06ds\", tv->tv_sec, tv->tv_usec);\n\t}\n\n\treturn 1;\n}\n\n/** \\ingroup poll\n * Register notification functions for file descriptor additions/removals.\n * These functions will be invoked for every new or removed file descriptor\n * that libusb uses as an event source.\n *\n * To remove notifiers, pass NULL values for the function pointers.\n *\n * Note that file descriptors may have been added even before you register\n * these notifiers (e.g. at libusb_init() time).\n *\n * Additionally, note that the removal notifier may be called during\n * libusb_exit() (e.g. when it is closing file descriptors that were opened\n * and added to the poll set at libusb_init() time). If you don't want this,\n * remove the notifiers immediately before calling libusb_exit().\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param added_cb pointer to function for addition notifications\n * \\param removed_cb pointer to function for removal notifications\n * \\param user_data User data to be passed back to callbacks (useful for\n * passing context information)\n */\nvoid API_EXPORTED libusb_set_pollfd_notifiers(libusb_context *ctx,\n\tlibusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb,\n\tvoid *user_data) {\n\n\tUSBI_GET_CONTEXT(ctx);\n\tctx->fd_added_cb = added_cb;\n\tctx->fd_removed_cb = removed_cb;\n\tctx->fd_cb_user_data = user_data;\n}\n\n/* Add a file descriptor to the list of file descriptors to be monitored.\n * events should be specified as a bitmask of events passed to poll(), e.g.\n * POLLIN and/or POLLOUT. */\nint usbi_add_pollfd(struct libusb_context *ctx, int fd, short events) {\n\n\tstruct usbi_pollfd *ipollfd = malloc(sizeof(*ipollfd));\n\tif (!ipollfd)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tusbi_dbg(\"add fd %d events %d\", fd, events);\n\tipollfd->pollfd.fd = fd;\n\tipollfd->pollfd.events = events;\n\tusbi_mutex_lock(&ctx->pollfds_lock);\n\t{\n\t\tlist_add_tail(&ipollfd->list, &ctx->pollfds);\n\t}\n\tusbi_mutex_unlock(&ctx->pollfds_lock);\n\n\tif (ctx->fd_added_cb)\n\t\tctx->fd_added_cb(fd, events, ctx->fd_cb_user_data);\n\treturn 0;\n}\n\n/* Remove a file descriptor from the list of file descriptors to be polled. */\nvoid usbi_remove_pollfd(struct libusb_context *ctx, int fd) {\n\n\tstruct usbi_pollfd *ipollfd;\n\tint found = 0;\n\n\tusbi_dbg(\"remove fd %d\", fd);\n\tusbi_mutex_lock(&ctx->pollfds_lock);\n\t{\n\t\tlist_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd)\n\t\t\tif (ipollfd->pollfd.fd == fd) {\n\t\t\t\tfound = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tif (!found) {\n\t\t\tusbi_dbg(\"couldn't find fd %d to remove\", fd);\n\t\t\tusbi_mutex_unlock(&ctx->pollfds_lock);\n\t\t\treturn;\n\t\t}\n\n\t\tlist_del(&ipollfd->list);\n\t}\n\tusbi_mutex_unlock(&ctx->pollfds_lock);\n\tfree(ipollfd);\n\tif (ctx->fd_removed_cb)\n\t\tctx->fd_removed_cb(fd, ctx->fd_cb_user_data);\n}\n\n/** \\ingroup poll\n * Retrieve a list of file descriptors that should be polled by your main loop\n * as libusb event sources.\n *\n * The returned list is NULL-terminated and should be freed with free() when\n * done. The actual list contents must not be touched.\n *\n * As file descriptors are a Unix-specific concept, this function is not\n * available on Windows and will always return NULL.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\returns a NULL-terminated list of libusb_pollfd structures\n * \\returns NULL on error\n * \\returns NULL on platforms where the functionality is not available\n */\nDEFAULT_VISIBILITY\nconst struct libusb_pollfd ** LIBUSB_CALL libusb_get_pollfds(\n\tlibusb_context *ctx) {\n\n#ifndef OS_WINDOWS\n\tstruct libusb_pollfd **ret = NULL;\n\tstruct usbi_pollfd *ipollfd;\n\tsize_t i = 0;\n\tsize_t cnt = 0;\n\tUSBI_GET_CONTEXT(ctx);\n\n\tusbi_mutex_lock(&ctx->pollfds_lock);\n\t{\n\t\tlist_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd)\n\t\t\tcnt++;\n\n\t\tret = calloc(cnt + 1, sizeof(struct libusb_pollfd *));\n\t\tif (!ret)\n\t\t\tgoto out;\n\n\t\tlist_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd)\n\t\t\tret[i++] = (struct libusb_pollfd *) ipollfd;\n\t\tret[cnt] = NULL;\n\t}\nout:\n\tusbi_mutex_unlock(&ctx->pollfds_lock);\n\treturn (const struct libusb_pollfd **) ret;\n#else\n\tusbi_err(ctx, \"external polling of libusb's internal descriptors \"\\\n\t\t\"is not yet supported on Windows platforms\");\n\treturn NULL;\n#endif\n}\n\n/* Backends may call this from handle_events to report disconnection of a\n * device. This function ensures transfers get cancelled appropriately.\n * Callers of this function must hold the events_lock.\n */\nvoid usbi_handle_disconnect(struct libusb_device_handle *handle) {\n\n\tstruct usbi_transfer *cur;\n\tstruct usbi_transfer *to_cancel;\n\n\tusbi_dbg(\"device %d.%d\",\n\t\thandle->dev->bus_number, handle->dev->device_address);\n\n\t/* terminate all pending transfers with the LIBUSB_TRANSFER_NO_DEVICE\n\t * status code.\n\t *\n\t * this is a bit tricky because:\n\t * 1. we can't do transfer completion while holding flying_transfers_lock\n\t *    because the completion handler may try to re-submit the transfer\n\t * 2. the transfers list can change underneath us - if we were to build a\n\t *    list of transfers to complete (while holding lock), the situation\n\t *    might be different by the time we come to free them\n\t *\n\t * so we resort to a loop-based approach as below\n\t *\n\t * This is safe because transfers are only removed from the\n\t * flying_transfer list by usbi_handle_transfer_completion and\n\t * libusb_close, both of which hold the events_lock while doing so,\n\t * so usbi_handle_disconnect cannot be running at the same time.\n\t *\n\t * Note that libusb_submit_transfer also removes the transfer from\n\t * the flying_transfer list on submission failure, but it keeps the\n\t * flying_transfer list locked between addition and removal, so\n\t * usbi_handle_disconnect never sees such transfers.\n\t */\n\n\twhile (1) {\n\t\tusbi_mutex_lock(&HANDLE_CTX(handle)->flying_transfers_lock);\n\t\tto_cancel = NULL;\n\t\tlist_for_each_entry(cur, &HANDLE_CTX(handle)->flying_transfers, list, struct usbi_transfer)\n\t\t\tif (USBI_TRANSFER_TO_LIBUSB_TRANSFER(cur)->dev_handle == handle) {\n\t\t\t\tto_cancel = cur;\n\t\t\t\tbreak;\n\t\t\t}\n\t\tusbi_mutex_unlock(&HANDLE_CTX(handle)->flying_transfers_lock);\n\n\t\tif (!to_cancel)\n\t\t\tbreak;\n\n\t\tusbi_dbg(\"cancelling transfer %p from disconnect\",\n\t\t\t USBI_TRANSFER_TO_LIBUSB_TRANSFER(to_cancel));\n\n\t\tusbi_backend->clear_transfer_priv(to_cancel);\n\t\tusbi_handle_transfer_completion(to_cancel, LIBUSB_TRANSFER_NO_DEVICE);\n\t}\n\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/io_original.c",
    "content": "/* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */\n/*\n * I/O functions for libusb\n * Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org>\n * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"config.h\"\n#include <errno.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n#include <time.h>\n#ifdef HAVE_SIGNAL_H\n#include <signal.h>\n#endif\n#ifdef HAVE_SYS_TIME_H\n#include <sys/time.h>\n#endif\n#ifdef USBI_TIMERFD_AVAILABLE\n#include <sys/timerfd.h>\n#endif\n\n#include \"libusbi.h\"\n#include \"hotplug.h\"\n\n/**\n * \\page io Synchronous and asynchronous device I/O\n *\n * \\section intro Introduction\n *\n * If you're using libusb in your application, you're probably wanting to\n * perform I/O with devices - you want to perform USB data transfers.\n *\n * libusb offers two separate interfaces for device I/O. This page aims to\n * introduce the two in order to help you decide which one is more suitable\n * for your application. You can also choose to use both interfaces in your\n * application by considering each transfer on a case-by-case basis.\n *\n * Once you have read through the following discussion, you should consult the\n * detailed API documentation pages for the details:\n * - \\ref syncio\n * - \\ref asyncio\n *\n * \\section theory Transfers at a logical level\n *\n * At a logical level, USB transfers typically happen in two parts. For\n * example, when reading data from a endpoint:\n * -# A request for data is sent to the device\n * -# Some time later, the incoming data is received by the host\n *\n * or when writing data to an endpoint:\n *\n * -# The data is sent to the device\n * -# Some time later, the host receives acknowledgement from the device that\n *    the data has been transferred.\n *\n * There may be an indefinite delay between the two steps. Consider a\n * fictional USB input device with a button that the user can press. In order\n * to determine when the button is pressed, you would likely submit a request\n * to read data on a bulk or interrupt endpoint and wait for data to arrive.\n * Data will arrive when the button is pressed by the user, which is\n * potentially hours later.\n *\n * libusb offers both a synchronous and an asynchronous interface to performing\n * USB transfers. The main difference is that the synchronous interface\n * combines both steps indicated above into a single function call, whereas\n * the asynchronous interface separates them.\n *\n * \\section sync The synchronous interface\n *\n * The synchronous I/O interface allows you to perform a USB transfer with\n * a single function call. When the function call returns, the transfer has\n * completed and you can parse the results.\n *\n * If you have used the libusb-0.1 before, this I/O style will seem familar to\n * you. libusb-0.1 only offered a synchronous interface.\n *\n * In our input device example, to read button presses you might write code\n * in the following style:\n\\code\nunsigned char data[4];\nint actual_length;\nint r = libusb_bulk_transfer(handle, LIBUSB_ENDPOINT_IN, data, sizeof(data), &actual_length, 0);\nif (r == 0 && actual_length == sizeof(data)) {\n\t// results of the transaction can now be found in the data buffer\n\t// parse them here and report button press\n} else {\n\terror();\n}\n\\endcode\n *\n * The main advantage of this model is simplicity: you did everything with\n * a single simple function call.\n *\n * However, this interface has its limitations. Your application will sleep\n * inside libusb_bulk_transfer() until the transaction has completed. If it\n * takes the user 3 hours to press the button, your application will be\n * sleeping for that long. Execution will be tied up inside the library -\n * the entire thread will be useless for that duration.\n *\n * Another issue is that by tieing up the thread with that single transaction\n * there is no possibility of performing I/O with multiple endpoints and/or\n * multiple devices simultaneously, unless you resort to creating one thread\n * per transaction.\n *\n * Additionally, there is no opportunity to cancel the transfer after the\n * request has been submitted.\n *\n * For details on how to use the synchronous API, see the\n * \\ref syncio \"synchronous I/O API documentation\" pages.\n *\n * \\section async The asynchronous interface\n *\n * Asynchronous I/O is the most significant new feature in libusb-1.0.\n * Although it is a more complex interface, it solves all the issues detailed\n * above.\n *\n * Instead of providing which functions that block until the I/O has complete,\n * libusb's asynchronous interface presents non-blocking functions which\n * begin a transfer and then return immediately. Your application passes a\n * callback function pointer to this non-blocking function, which libusb will\n * call with the results of the transaction when it has completed.\n *\n * Transfers which have been submitted through the non-blocking functions\n * can be cancelled with a separate function call.\n *\n * The non-blocking nature of this interface allows you to be simultaneously\n * performing I/O to multiple endpoints on multiple devices, without having\n * to use threads.\n *\n * This added flexibility does come with some complications though:\n * - In the interest of being a lightweight library, libusb does not create\n * threads and can only operate when your application is calling into it. Your\n * application must call into libusb from it's main loop when events are ready\n * to be handled, or you must use some other scheme to allow libusb to\n * undertake whatever work needs to be done.\n * - libusb also needs to be called into at certain fixed points in time in\n * order to accurately handle transfer timeouts.\n * - Memory handling becomes more complex. You cannot use stack memory unless\n * the function with that stack is guaranteed not to return until the transfer\n * callback has finished executing.\n * - You generally lose some linearity from your code flow because submitting\n * the transfer request is done in a separate function from where the transfer\n * results are handled. This becomes particularly obvious when you want to\n * submit a second transfer based on the results of an earlier transfer.\n *\n * Internally, libusb's synchronous interface is expressed in terms of function\n * calls to the asynchronous interface.\n *\n * For details on how to use the asynchronous API, see the\n * \\ref asyncio \"asynchronous I/O API\" documentation pages.\n */\n\n\n/**\n * \\page packetoverflow Packets and overflows\n *\n * \\section packets Packet abstraction\n *\n * The USB specifications describe how data is transmitted in packets, with\n * constraints on packet size defined by endpoint descriptors. The host must\n * not send data payloads larger than the endpoint's maximum packet size.\n *\n * libusb and the underlying OS abstract out the packet concept, allowing you\n * to request transfers of any size. Internally, the request will be divided\n * up into correctly-sized packets. You do not have to be concerned with\n * packet sizes, but there is one exception when considering overflows.\n *\n * \\section overflow Bulk/interrupt transfer overflows\n *\n * When requesting data on a bulk endpoint, libusb requires you to supply a\n * buffer and the maximum number of bytes of data that libusb can put in that\n * buffer. However, the size of the buffer is not communicated to the device -\n * the device is just asked to send any amount of data.\n *\n * There is no problem if the device sends an amount of data that is less than\n * or equal to the buffer size. libusb reports this condition to you through\n * the \\ref libusb_transfer::actual_length \"libusb_transfer.actual_length\"\n * field.\n *\n * Problems may occur if the device attempts to send more data than can fit in\n * the buffer. libusb reports LIBUSB_TRANSFER_OVERFLOW for this condition but\n * other behaviour is largely undefined: actual_length may or may not be\n * accurate, the chunk of data that can fit in the buffer (before overflow)\n * may or may not have been transferred.\n *\n * Overflows are nasty, but can be avoided. Even though you were told to\n * ignore packets above, think about the lower level details: each transfer is\n * split into packets (typically small, with a maximum size of 512 bytes).\n * Overflows can only happen if the final packet in an incoming data transfer\n * is smaller than the actual packet that the device wants to transfer.\n * Therefore, you will never see an overflow if your transfer buffer size is a\n * multiple of the endpoint's packet size: the final packet will either\n * fill up completely or will be only partially filled.\n */\n\n/**\n * @defgroup asyncio Asynchronous device I/O\n *\n * This page details libusb's asynchronous (non-blocking) API for USB device\n * I/O. This interface is very powerful but is also quite complex - you will\n * need to read this page carefully to understand the necessary considerations\n * and issues surrounding use of this interface. Simplistic applications\n * may wish to consider the \\ref syncio \"synchronous I/O API\" instead.\n *\n * The asynchronous interface is built around the idea of separating transfer\n * submission and handling of transfer completion (the synchronous model\n * combines both of these into one). There may be a long delay between\n * submission and completion, however the asynchronous submission function\n * is non-blocking so will return control to your application during that\n * potentially long delay.\n *\n * \\section asyncabstraction Transfer abstraction\n *\n * For the asynchronous I/O, libusb implements the concept of a generic\n * transfer entity for all types of I/O (control, bulk, interrupt,\n * isochronous). The generic transfer object must be treated slightly\n * differently depending on which type of I/O you are performing with it.\n *\n * This is represented by the public libusb_transfer structure type.\n *\n * \\section asynctrf Asynchronous transfers\n *\n * We can view asynchronous I/O as a 5 step process:\n * -# <b>Allocation</b>: allocate a libusb_transfer\n * -# <b>Filling</b>: populate the libusb_transfer instance with information\n *    about the transfer you wish to perform\n * -# <b>Submission</b>: ask libusb to submit the transfer\n * -# <b>Completion handling</b>: examine transfer results in the\n *    libusb_transfer structure\n * -# <b>Deallocation</b>: clean up resources\n *\n *\n * \\subsection asyncalloc Allocation\n *\n * This step involves allocating memory for a USB transfer. This is the\n * generic transfer object mentioned above. At this stage, the transfer\n * is \"blank\" with no details about what type of I/O it will be used for.\n *\n * Allocation is done with the libusb_alloc_transfer() function. You must use\n * this function rather than allocating your own transfers.\n *\n * \\subsection asyncfill Filling\n *\n * This step is where you take a previously allocated transfer and fill it\n * with information to determine the message type and direction, data buffer,\n * callback function, etc.\n *\n * You can either fill the required fields yourself or you can use the\n * helper functions: libusb_fill_control_transfer(), libusb_fill_bulk_transfer()\n * and libusb_fill_interrupt_transfer().\n *\n * \\subsection asyncsubmit Submission\n *\n * When you have allocated a transfer and filled it, you can submit it using\n * libusb_submit_transfer(). This function returns immediately but can be\n * regarded as firing off the I/O request in the background.\n *\n * \\subsection asynccomplete Completion handling\n *\n * After a transfer has been submitted, one of four things can happen to it:\n *\n * - The transfer completes (i.e. some data was transferred)\n * - The transfer has a timeout and the timeout expires before all data is\n * transferred\n * - The transfer fails due to an error\n * - The transfer is cancelled\n *\n * Each of these will cause the user-specified transfer callback function to\n * be invoked. It is up to the callback function to determine which of the\n * above actually happened and to act accordingly.\n *\n * The user-specified callback is passed a pointer to the libusb_transfer\n * structure which was used to setup and submit the transfer. At completion\n * time, libusb has populated this structure with results of the transfer:\n * success or failure reason, number of bytes of data transferred, etc. See\n * the libusb_transfer structure documentation for more information.\n *\n * \\subsection Deallocation\n *\n * When a transfer has completed (i.e. the callback function has been invoked),\n * you are advised to free the transfer (unless you wish to resubmit it, see\n * below). Transfers are deallocated with libusb_free_transfer().\n *\n * It is undefined behaviour to free a transfer which has not completed.\n *\n * \\section asyncresubmit Resubmission\n *\n * You may be wondering why allocation, filling, and submission are all\n * separated above where they could reasonably be combined into a single\n * operation.\n *\n * The reason for separation is to allow you to resubmit transfers without\n * having to allocate new ones every time. This is especially useful for\n * common situations dealing with interrupt endpoints - you allocate one\n * transfer, fill and submit it, and when it returns with results you just\n * resubmit it for the next interrupt.\n *\n * \\section asynccancel Cancellation\n *\n * Another advantage of using the asynchronous interface is that you have\n * the ability to cancel transfers which have not yet completed. This is\n * done by calling the libusb_cancel_transfer() function.\n *\n * libusb_cancel_transfer() is asynchronous/non-blocking in itself. When the\n * cancellation actually completes, the transfer's callback function will\n * be invoked, and the callback function should check the transfer status to\n * determine that it was cancelled.\n *\n * Freeing the transfer after it has been cancelled but before cancellation\n * has completed will result in undefined behaviour.\n *\n * When a transfer is cancelled, some of the data may have been transferred.\n * libusb will communicate this to you in the transfer callback. Do not assume\n * that no data was transferred.\n *\n * \\section bulk_overflows Overflows on device-to-host bulk/interrupt endpoints\n *\n * If your device does not have predictable transfer sizes (or it misbehaves),\n * your application may submit a request for data on an IN endpoint which is\n * smaller than the data that the device wishes to send. In some circumstances\n * this will cause an overflow, which is a nasty condition to deal with. See\n * the \\ref packetoverflow page for discussion.\n *\n * \\section asyncctrl Considerations for control transfers\n *\n * The <tt>libusb_transfer</tt> structure is generic and hence does not\n * include specific fields for the control-specific setup packet structure.\n *\n * In order to perform a control transfer, you must place the 8-byte setup\n * packet at the start of the data buffer. To simplify this, you could\n * cast the buffer pointer to type struct libusb_control_setup, or you can\n * use the helper function libusb_fill_control_setup().\n *\n * The wLength field placed in the setup packet must be the length you would\n * expect to be sent in the setup packet: the length of the payload that\n * follows (or the expected maximum number of bytes to receive). However,\n * the length field of the libusb_transfer object must be the length of\n * the data buffer - i.e. it should be wLength <em>plus</em> the size of\n * the setup packet (LIBUSB_CONTROL_SETUP_SIZE).\n *\n * If you use the helper functions, this is simplified for you:\n * -# Allocate a buffer of size LIBUSB_CONTROL_SETUP_SIZE plus the size of the\n * data you are sending/requesting.\n * -# Call libusb_fill_control_setup() on the data buffer, using the transfer\n * request size as the wLength value (i.e. do not include the extra space you\n * allocated for the control setup).\n * -# If this is a host-to-device transfer, place the data to be transferred\n * in the data buffer, starting at offset LIBUSB_CONTROL_SETUP_SIZE.\n * -# Call libusb_fill_control_transfer() to associate the data buffer with\n * the transfer (and to set the remaining details such as callback and timeout).\n *   - Note that there is no parameter to set the length field of the transfer.\n *     The length is automatically inferred from the wLength field of the setup\n *     packet.\n * -# Submit the transfer.\n *\n * The multi-byte control setup fields (wValue, wIndex and wLength) must\n * be given in little-endian byte order (the endianness of the USB bus).\n * Endianness conversion is transparently handled by\n * libusb_fill_control_setup() which is documented to accept host-endian\n * values.\n *\n * Further considerations are needed when handling transfer completion in\n * your callback function:\n * - As you might expect, the setup packet will still be sitting at the start\n * of the data buffer.\n * - If this was a device-to-host transfer, the received data will be sitting\n * at offset LIBUSB_CONTROL_SETUP_SIZE into the buffer.\n * - The actual_length field of the transfer structure is relative to the\n * wLength of the setup packet, rather than the size of the data buffer. So,\n * if your wLength was 4, your transfer's <tt>length</tt> was 12, then you\n * should expect an <tt>actual_length</tt> of 4 to indicate that the data was\n * transferred in entirity.\n *\n * To simplify parsing of setup packets and obtaining the data from the\n * correct offset, you may wish to use the libusb_control_transfer_get_data()\n * and libusb_control_transfer_get_setup() functions within your transfer\n * callback.\n *\n * Even though control endpoints do not halt, a completed control transfer\n * may have a LIBUSB_TRANSFER_STALL status code. This indicates the control\n * request was not supported.\n *\n * \\section asyncintr Considerations for interrupt transfers\n *\n * All interrupt transfers are performed using the polling interval presented\n * by the bInterval value of the endpoint descriptor.\n *\n * \\section asynciso Considerations for isochronous transfers\n *\n * Isochronous transfers are more complicated than transfers to\n * non-isochronous endpoints.\n *\n * To perform I/O to an isochronous endpoint, allocate the transfer by calling\n * libusb_alloc_transfer() with an appropriate number of isochronous packets.\n *\n * During filling, set \\ref libusb_transfer::type \"type\" to\n * \\ref libusb_transfer_type::LIBUSB_TRANSFER_TYPE_ISOCHRONOUS\n * \"LIBUSB_TRANSFER_TYPE_ISOCHRONOUS\", and set\n * \\ref libusb_transfer::num_iso_packets \"num_iso_packets\" to a value less than\n * or equal to the number of packets you requested during allocation.\n * libusb_alloc_transfer() does not set either of these fields for you, given\n * that you might not even use the transfer on an isochronous endpoint.\n *\n * Next, populate the length field for the first num_iso_packets entries in\n * the \\ref libusb_transfer::iso_packet_desc \"iso_packet_desc\" array. Section\n * 5.6.3 of the USB2 specifications describe how the maximum isochronous\n * packet length is determined by the wMaxPacketSize field in the endpoint\n * descriptor.\n * Two functions can help you here:\n *\n * - libusb_get_max_iso_packet_size() is an easy way to determine the max\n *   packet size for an isochronous endpoint. Note that the maximum packet\n *   size is actually the maximum number of bytes that can be transmitted in\n *   a single microframe, therefore this function multiplies the maximum number\n *   of bytes per transaction by the number of transaction opportunities per\n *   microframe.\n * - libusb_set_iso_packet_lengths() assigns the same length to all packets\n *   within a transfer, which is usually what you want.\n *\n * For outgoing transfers, you'll obviously fill the buffer and populate the\n * packet descriptors in hope that all the data gets transferred. For incoming\n * transfers, you must ensure the buffer has sufficient capacity for\n * the situation where all packets transfer the full amount of requested data.\n *\n * Completion handling requires some extra consideration. The\n * \\ref libusb_transfer::actual_length \"actual_length\" field of the transfer\n * is meaningless and should not be examined; instead you must refer to the\n * \\ref libusb_iso_packet_descriptor::actual_length \"actual_length\" field of\n * each individual packet.\n *\n * The \\ref libusb_transfer::status \"status\" field of the transfer is also a\n * little misleading:\n *  - If the packets were submitted and the isochronous data microframes\n *    completed normally, status will have value\n *    \\ref libusb_transfer_status::LIBUSB_TRANSFER_COMPLETED\n *    \"LIBUSB_TRANSFER_COMPLETED\". Note that bus errors and software-incurred\n *    delays are not counted as transfer errors; the transfer.status field may\n *    indicate COMPLETED even if some or all of the packets failed. Refer to\n *    the \\ref libusb_iso_packet_descriptor::status \"status\" field of each\n *    individual packet to determine packet failures.\n *  - The status field will have value\n *    \\ref libusb_transfer_status::LIBUSB_TRANSFER_ERROR\n *    \"LIBUSB_TRANSFER_ERROR\" only when serious errors were encountered.\n *  - Other transfer status codes occur with normal behaviour.\n *\n * The data for each packet will be found at an offset into the buffer that\n * can be calculated as if each prior packet completed in full. The\n * libusb_get_iso_packet_buffer() and libusb_get_iso_packet_buffer_simple()\n * functions may help you here.\n *\n * \\section asyncmem Memory caveats\n *\n * In most circumstances, it is not safe to use stack memory for transfer\n * buffers. This is because the function that fired off the asynchronous\n * transfer may return before libusb has finished using the buffer, and when\n * the function returns it's stack gets destroyed. This is true for both\n * host-to-device and device-to-host transfers.\n *\n * The only case in which it is safe to use stack memory is where you can\n * guarantee that the function owning the stack space for the buffer does not\n * return until after the transfer's callback function has completed. In every\n * other case, you need to use heap memory instead.\n *\n * \\section asyncflags Fine control\n *\n * Through using this asynchronous interface, you may find yourself repeating\n * a few simple operations many times. You can apply a bitwise OR of certain\n * flags to a transfer to simplify certain things:\n * - \\ref libusb_transfer_flags::LIBUSB_TRANSFER_SHORT_NOT_OK\n *   \"LIBUSB_TRANSFER_SHORT_NOT_OK\" results in transfers which transferred\n *   less than the requested amount of data being marked with status\n *   \\ref libusb_transfer_status::LIBUSB_TRANSFER_ERROR \"LIBUSB_TRANSFER_ERROR\"\n *   (they would normally be regarded as COMPLETED)\n * - \\ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_BUFFER\n *   \"LIBUSB_TRANSFER_FREE_BUFFER\" allows you to ask libusb to free the transfer\n *   buffer when freeing the transfer.\n * - \\ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_TRANSFER\n *   \"LIBUSB_TRANSFER_FREE_TRANSFER\" causes libusb to automatically free the\n *   transfer after the transfer callback returns.\n *\n * \\section asyncevent Event handling\n *\n * An asynchronous model requires that libusb perform work at various\n * points in time - namely processing the results of previously-submitted\n * transfers and invoking the user-supplied callback function.\n *\n * This gives rise to the libusb_handle_events() function which your\n * application must call into when libusb has work do to. This gives libusb\n * the opportunity to reap pending transfers, invoke callbacks, etc.\n *\n * There are 2 different approaches to dealing with libusb_handle_events:\n *\n * -# Repeatedly call libusb_handle_events() in blocking mode from a dedicated\n *    thread.\n * -# Integrate libusb with your application's main event loop. libusb\n *    exposes a set of file descriptors which allow you to do this.\n *\n * The first approach has the big advantage that it will also work on Windows\n * were libusb' poll API for select / poll integration is not available. So\n * if you want to support Windows and use the async API, you must use this\n * approach, see the \\ref eventthread \"Using an event handling thread\" section\n * below for details.\n *\n * If you prefer a single threaded approach with a single central event loop,\n * see the \\ref poll \"polling and timing\" section for how to integrate libusb\n * into your application's main event loop.\n *\n * \\section eventthread Using an event handling thread\n *\n * Lets begin with stating the obvious: If you're going to use a separate\n * thread for libusb event handling, your callback functions MUST be\n * threadsafe.\n *\n * Other then that doing event handling from a separate thread, is mostly\n * simple. You can use an event thread function as follows:\n\\code\nvoid *event_thread_func(void *ctx)\n{\n    while (event_thread_run)\n        libusb_handle_events(ctx);\n\n    return NULL;\n}\n\\endcode\n *\n * There is one caveat though, stopping this thread requires setting the\n * event_thread_run variable to 0, and after that libusb_handle_events() needs\n * to return control to event_thread_func. But unless some event happens,\n * libusb_handle_events() will not return.\n *\n * There are 2 different ways of dealing with this, depending on if your\n * application uses libusb' \\ref hotplug \"hotplug\" support or not.\n *\n * Applications which do not use hotplug support, should not start the event\n * thread until after their first call to libusb_open(), and should stop the\n * thread when closing the last open device as follows:\n\\code\nvoid my_close_handle(libusb_device_handle *handle)\n{\n    if (open_devs == 1)\n        event_thread_run = 0;\n\n    libusb_close(handle); // This wakes up libusb_handle_events()\n\n    if (open_devs == 1)\n        pthread_join(event_thread);\n\n    open_devs--;\n}\n\\endcode\n *\n * Applications using hotplug support should start the thread at program init,\n * after having successfully called libusb_hotplug_register_callback(), and\n * should stop the thread at program exit as follows:\n\\code\nvoid my_libusb_exit(void)\n{ \n    event_thread_run = 0;\n    libusb_hotplug_deregister_callback(ctx, hotplug_cb_handle); // This wakes up libusb_handle_events()\n    pthread_join(event_thread);\n    libusb_exit(ctx);\n}\n\\endcode\n */\n\n/**\n * @defgroup poll Polling and timing\n *\n * This page documents libusb's functions for polling events and timing.\n * These functions are only necessary for users of the\n * \\ref asyncio \"asynchronous API\". If you are only using the simpler\n * \\ref syncio \"synchronous API\" then you do not need to ever call these\n * functions.\n *\n * The justification for the functionality described here has already been\n * discussed in the \\ref asyncevent \"event handling\" section of the\n * asynchronous API documentation. In summary, libusb does not create internal\n * threads for event processing and hence relies on your application calling\n * into libusb at certain points in time so that pending events can be handled.\n *\n * Your main loop is probably already calling poll() or select() or a\n * variant on a set of file descriptors for other event sources (e.g. keyboard\n * button presses, mouse movements, network sockets, etc). You then add\n * libusb's file descriptors to your poll()/select() calls, and when activity\n * is detected on such descriptors you know it is time to call\n * libusb_handle_events().\n *\n * There is one final event handling complication. libusb supports\n * asynchronous transfers which time out after a specified time period.\n *\n * On some platforms a timerfd is used, so the timeout handling is just another\n * fd, on other platforms this requires that libusb is called into at or after\n * the timeout to handle it. So, in addition to considering libusb's file\n * descriptors in your main event loop, you must also consider that libusb\n * sometimes needs to be called into at fixed points in time even when there\n * is no file descriptor activity, see \\ref polltime details.\n * \n * In order to know precisely when libusb needs to be called into, libusb\n * offers you a set of pollable file descriptors and information about when\n * the next timeout expires.\n *\n * If you are using the asynchronous I/O API, you must take one of the two\n * following options, otherwise your I/O will not complete.\n *\n * \\section pollsimple The simple option\n *\n * If your application revolves solely around libusb and does not need to\n * handle other event sources, you can have a program structure as follows:\n\\code\n// initialize libusb\n// find and open device\n// maybe fire off some initial async I/O\n\nwhile (user_has_not_requested_exit)\n\tlibusb_handle_events(ctx);\n\n// clean up and exit\n\\endcode\n *\n * With such a simple main loop, you do not have to worry about managing\n * sets of file descriptors or handling timeouts. libusb_handle_events() will\n * handle those details internally.\n *\n * \\section pollmain The more advanced option\n *\n * \\note This functionality is currently only available on Unix-like platforms.\n * On Windows, libusb_get_pollfds() simply returns NULL. Applications which\n * want to support Windows are advised to use an \\ref eventthread\n * \"event handling thread\" instead.\n *\n * In more advanced applications, you will already have a main loop which\n * is monitoring other event sources: network sockets, X11 events, mouse\n * movements, etc. Through exposing a set of file descriptors, libusb is\n * designed to cleanly integrate into such main loops.\n *\n * In addition to polling file descriptors for the other event sources, you\n * take a set of file descriptors from libusb and monitor those too. When you\n * detect activity on libusb's file descriptors, you call\n * libusb_handle_events_timeout() in non-blocking mode.\n *\n * What's more, libusb may also need to handle events at specific moments in\n * time. No file descriptor activity is generated at these times, so your\n * own application needs to be continually aware of when the next one of these\n * moments occurs (through calling libusb_get_next_timeout()), and then it\n * needs to call libusb_handle_events_timeout() in non-blocking mode when\n * these moments occur. This means that you need to adjust your\n * poll()/select() timeout accordingly.\n *\n * libusb provides you with a set of file descriptors to poll and expects you\n * to poll all of them, treating them as a single entity. The meaning of each\n * file descriptor in the set is an internal implementation detail,\n * platform-dependent and may vary from release to release. Don't try and\n * interpret the meaning of the file descriptors, just do as libusb indicates,\n * polling all of them at once.\n *\n * In pseudo-code, you want something that looks like:\n\\code\n// initialise libusb\n\nlibusb_get_pollfds(ctx)\nwhile (user has not requested application exit) {\n\tlibusb_get_next_timeout(ctx);\n\tpoll(on libusb file descriptors plus any other event sources of interest,\n\t\tusing a timeout no larger than the value libusb just suggested)\n\tif (poll() indicated activity on libusb file descriptors)\n\t\tlibusb_handle_events_timeout(ctx, &zero_tv);\n\tif (time has elapsed to or beyond the libusb timeout)\n\t\tlibusb_handle_events_timeout(ctx, &zero_tv);\n\t// handle events from other sources here\n}\n\n// clean up and exit\n\\endcode\n *\n * \\subsection polltime Notes on time-based events\n *\n * The above complication with having to track time and call into libusb at\n * specific moments is a bit of a headache. For maximum compatibility, you do\n * need to write your main loop as above, but you may decide that you can\n * restrict the supported platforms of your application and get away with\n * a more simplistic scheme.\n *\n * These time-based event complications are \\b not required on the following\n * platforms:\n *  - Darwin\n *  - Linux, provided that the following version requirements are satisfied:\n *   - Linux v2.6.27 or newer, compiled with timerfd support\n *   - glibc v2.9 or newer\n *   - libusb v1.0.5 or newer\n *\n * Under these configurations, libusb_get_next_timeout() will \\em always return\n * 0, so your main loop can be simplified to:\n\\code\n// initialise libusb\n\nlibusb_get_pollfds(ctx)\nwhile (user has not requested application exit) {\n\tpoll(on libusb file descriptors plus any other event sources of interest,\n\t\tusing any timeout that you like)\n\tif (poll() indicated activity on libusb file descriptors)\n\t\tlibusb_handle_events_timeout(ctx, &zero_tv);\n\t// handle events from other sources here\n}\n\n// clean up and exit\n\\endcode\n *\n * Do remember that if you simplify your main loop to the above, you will\n * lose compatibility with some platforms (including legacy Linux platforms,\n * and <em>any future platforms supported by libusb which may have time-based\n * event requirements</em>). The resultant problems will likely appear as\n * strange bugs in your application.\n *\n * You can use the libusb_pollfds_handle_timeouts() function to do a runtime\n * check to see if it is safe to ignore the time-based event complications.\n * If your application has taken the shortcut of ignoring libusb's next timeout\n * in your main loop, then you are advised to check the return value of\n * libusb_pollfds_handle_timeouts() during application startup, and to abort\n * if the platform does suffer from these timing complications.\n *\n * \\subsection fdsetchange Changes in the file descriptor set\n *\n * The set of file descriptors that libusb uses as event sources may change\n * during the life of your application. Rather than having to repeatedly\n * call libusb_get_pollfds(), you can set up notification functions for when\n * the file descriptor set changes using libusb_set_pollfd_notifiers().\n *\n * \\subsection mtissues Multi-threaded considerations\n *\n * Unfortunately, the situation is complicated further when multiple threads\n * come into play. If two threads are monitoring the same file descriptors,\n * the fact that only one thread will be woken up when an event occurs causes\n * some headaches.\n *\n * The events lock, event waiters lock, and libusb_handle_events_locked()\n * entities are added to solve these problems. You do not need to be concerned\n * with these entities otherwise.\n *\n * See the extra documentation: \\ref mtasync\n */\n\n/** \\page mtasync Multi-threaded applications and asynchronous I/O\n *\n * libusb is a thread-safe library, but extra considerations must be applied\n * to applications which interact with libusb from multiple threads.\n *\n * The underlying issue that must be addressed is that all libusb I/O\n * revolves around monitoring file descriptors through the poll()/select()\n * system calls. This is directly exposed at the\n * \\ref asyncio \"asynchronous interface\" but it is important to note that the\n * \\ref syncio \"synchronous interface\" is implemented on top of the\n * asynchonrous interface, therefore the same considerations apply.\n *\n * The issue is that if two or more threads are concurrently calling poll()\n * or select() on libusb's file descriptors then only one of those threads\n * will be woken up when an event arrives. The others will be completely\n * oblivious that anything has happened.\n *\n * Consider the following pseudo-code, which submits an asynchronous transfer\n * then waits for its completion. This style is one way you could implement a\n * synchronous interface on top of the asynchronous interface (and libusb\n * does something similar, albeit more advanced due to the complications\n * explained on this page).\n *\n\\code\nvoid cb(struct libusb_transfer *transfer)\n{\n\tint *completed = transfer->user_data;\n\t*completed = 1;\n}\n\nvoid myfunc() {\n\tstruct libusb_transfer *transfer;\n\tunsigned char buffer[LIBUSB_CONTROL_SETUP_SIZE] __attribute__ ((aligned (2)));\n\tint completed = 0;\n\n\ttransfer = libusb_alloc_transfer(0);\n\tlibusb_fill_control_setup(buffer,\n\t\tLIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT, 0x04, 0x01, 0, 0);\n\tlibusb_fill_control_transfer(transfer, dev, buffer, cb, &completed, 1000);\n\tlibusb_submit_transfer(transfer);\n\n\twhile (!completed) {\n\t\tpoll(libusb file descriptors, 120*1000);\n\t\tif (poll indicates activity)\n\t\t\tlibusb_handle_events_timeout(ctx, &zero_tv);\n\t}\n\tprintf(\"completed!\");\n\t// other code here\n}\n\\endcode\n *\n * Here we are <em>serializing</em> completion of an asynchronous event\n * against a condition - the condition being completion of a specific transfer.\n * The poll() loop has a long timeout to minimize CPU usage during situations\n * when nothing is happening (it could reasonably be unlimited).\n *\n * If this is the only thread that is polling libusb's file descriptors, there\n * is no problem: there is no danger that another thread will swallow up the\n * event that we are interested in. On the other hand, if there is another\n * thread polling the same descriptors, there is a chance that it will receive\n * the event that we were interested in. In this situation, <tt>myfunc()</tt>\n * will only realise that the transfer has completed on the next iteration of\n * the loop, <em>up to 120 seconds later.</em> Clearly a two-minute delay is\n * undesirable, and don't even think about using short timeouts to circumvent\n * this issue!\n *\n * The solution here is to ensure that no two threads are ever polling the\n * file descriptors at the same time. A naive implementation of this would\n * impact the capabilities of the library, so libusb offers the scheme\n * documented below to ensure no loss of functionality.\n *\n * Before we go any further, it is worth mentioning that all libusb-wrapped\n * event handling procedures fully adhere to the scheme documented below.\n * This includes libusb_handle_events() and its variants, and all the\n * synchronous I/O functions - libusb hides this headache from you.\n *\n * \\section Using libusb_handle_events() from multiple threads\n *\n * Even when only using libusb_handle_events() and synchronous I/O functions,\n * you can still have a race condition. You might be tempted to solve the\n * above with libusb_handle_events() like so:\n *\n\\code\n\tlibusb_submit_transfer(transfer);\n\n\twhile (!completed) {\n\t\tlibusb_handle_events(ctx);\n\t}\n\tprintf(\"completed!\");\n\\endcode\n *\n * This however has a race between the checking of completed and\n * libusb_handle_events() acquiring the events lock, so another thread\n * could have completed the transfer, resulting in this thread hanging\n * until either a timeout or another event occurs. See also commit\n * 6696512aade99bb15d6792af90ae329af270eba6 which fixes this in the\n * synchronous API implementation of libusb.\n *\n * Fixing this race requires checking the variable completed only after\n * taking the event lock, which defeats the concept of just calling\n * libusb_handle_events() without worrying about locking. This is why\n * libusb-1.0.9 introduces the new libusb_handle_events_timeout_completed()\n * and libusb_handle_events_completed() functions, which handles doing the\n * completion check for you after they have acquired the lock:\n *\n\\code\n\tlibusb_submit_transfer(transfer);\n\n\twhile (!completed) {\n\t\tlibusb_handle_events_completed(ctx, &completed);\n\t}\n\tprintf(\"completed!\");\n\\endcode\n *\n * This nicely fixes the race in our example. Note that if all you want to\n * do is submit a single transfer and wait for its completion, then using\n * one of the synchronous I/O functions is much easier.\n *\n * \\section eventlock The events lock\n *\n * The problem is when we consider the fact that libusb exposes file\n * descriptors to allow for you to integrate asynchronous USB I/O into\n * existing main loops, effectively allowing you to do some work behind\n * libusb's back. If you do take libusb's file descriptors and pass them to\n * poll()/select() yourself, you need to be aware of the associated issues.\n *\n * The first concept to be introduced is the events lock. The events lock\n * is used to serialize threads that want to handle events, such that only\n * one thread is handling events at any one time.\n *\n * You must take the events lock before polling libusb file descriptors,\n * using libusb_lock_events(). You must release the lock as soon as you have\n * aborted your poll()/select() loop, using libusb_unlock_events().\n *\n * \\section threadwait Letting other threads do the work for you\n *\n * Although the events lock is a critical part of the solution, it is not\n * enough on it's own. You might wonder if the following is sufficient...\n\\code\n\tlibusb_lock_events(ctx);\n\twhile (!completed) {\n\t\tpoll(libusb file descriptors, 120*1000);\n\t\tif (poll indicates activity)\n\t\t\tlibusb_handle_events_timeout(ctx, &zero_tv);\n\t}\n\tlibusb_unlock_events(ctx);\n\\endcode\n * ...and the answer is that it is not. This is because the transfer in the\n * code shown above may take a long time (say 30 seconds) to complete, and\n * the lock is not released until the transfer is completed.\n *\n * Another thread with similar code that wants to do event handling may be\n * working with a transfer that completes after a few milliseconds. Despite\n * having such a quick completion time, the other thread cannot check that\n * status of its transfer until the code above has finished (30 seconds later)\n * due to contention on the lock.\n *\n * To solve this, libusb offers you a mechanism to determine when another\n * thread is handling events. It also offers a mechanism to block your thread\n * until the event handling thread has completed an event (and this mechanism\n * does not involve polling of file descriptors).\n *\n * After determining that another thread is currently handling events, you\n * obtain the <em>event waiters</em> lock using libusb_lock_event_waiters().\n * You then re-check that some other thread is still handling events, and if\n * so, you call libusb_wait_for_event().\n *\n * libusb_wait_for_event() puts your application to sleep until an event\n * occurs, or until a thread releases the events lock. When either of these\n * things happen, your thread is woken up, and should re-check the condition\n * it was waiting on. It should also re-check that another thread is handling\n * events, and if not, it should start handling events itself.\n *\n * This looks like the following, as pseudo-code:\n\\code\nretry:\nif (libusb_try_lock_events(ctx) == 0) {\n\t// we obtained the event lock: do our own event handling\n\twhile (!completed) {\n\t\tif (!libusb_event_handling_ok(ctx)) {\n\t\t\tlibusb_unlock_events(ctx);\n\t\t\tgoto retry;\n\t\t}\n\t\tpoll(libusb file descriptors, 120*1000);\n\t\tif (poll indicates activity)\n\t\t\tlibusb_handle_events_locked(ctx, 0);\n\t}\n\tlibusb_unlock_events(ctx);\n} else {\n\t// another thread is doing event handling. wait for it to signal us that\n\t// an event has completed\n\tlibusb_lock_event_waiters(ctx);\n\n\twhile (!completed) {\n\t\t// now that we have the event waiters lock, double check that another\n\t\t// thread is still handling events for us. (it may have ceased handling\n\t\t// events in the time it took us to reach this point)\n\t\tif (!libusb_event_handler_active(ctx)) {\n\t\t\t// whoever was handling events is no longer doing so, try again\n\t\t\tlibusb_unlock_event_waiters(ctx);\n\t\t\tgoto retry;\n\t\t}\n\n\t\tlibusb_wait_for_event(ctx, NULL);\n\t}\n\tlibusb_unlock_event_waiters(ctx);\n}\nprintf(\"completed!\\n\");\n\\endcode\n *\n * A naive look at the above code may suggest that this can only support\n * one event waiter (hence a total of 2 competing threads, the other doing\n * event handling), because the event waiter seems to have taken the event\n * waiters lock while waiting for an event. However, the system does support\n * multiple event waiters, because libusb_wait_for_event() actually drops\n * the lock while waiting, and reaquires it before continuing.\n *\n * We have now implemented code which can dynamically handle situations where\n * nobody is handling events (so we should do it ourselves), and it can also\n * handle situations where another thread is doing event handling (so we can\n * piggyback onto them). It is also equipped to handle a combination of\n * the two, for example, another thread is doing event handling, but for\n * whatever reason it stops doing so before our condition is met, so we take\n * over the event handling.\n *\n * Four functions were introduced in the above pseudo-code. Their importance\n * should be apparent from the code shown above.\n * -# libusb_try_lock_events() is a non-blocking function which attempts\n *    to acquire the events lock but returns a failure code if it is contended.\n * -# libusb_event_handling_ok() checks that libusb is still happy for your\n *    thread to be performing event handling. Sometimes, libusb needs to\n *    interrupt the event handler, and this is how you can check if you have\n *    been interrupted. If this function returns 0, the correct behaviour is\n *    for you to give up the event handling lock, and then to repeat the cycle.\n *    The following libusb_try_lock_events() will fail, so you will become an\n *    events waiter. For more information on this, read \\ref fullstory below.\n * -# libusb_handle_events_locked() is a variant of\n *    libusb_handle_events_timeout() that you can call while holding the\n *    events lock. libusb_handle_events_timeout() itself implements similar\n *    logic to the above, so be sure not to call it when you are\n *    \"working behind libusb's back\", as is the case here.\n * -# libusb_event_handler_active() determines if someone is currently\n *    holding the events lock\n *\n * You might be wondering why there is no function to wake up all threads\n * blocked on libusb_wait_for_event(). This is because libusb can do this\n * internally: it will wake up all such threads when someone calls\n * libusb_unlock_events() or when a transfer completes (at the point after its\n * callback has returned).\n *\n * \\subsection fullstory The full story\n *\n * The above explanation should be enough to get you going, but if you're\n * really thinking through the issues then you may be left with some more\n * questions regarding libusb's internals. If you're curious, read on, and if\n * not, skip to the next section to avoid confusing yourself!\n *\n * The immediate question that may spring to mind is: what if one thread\n * modifies the set of file descriptors that need to be polled while another\n * thread is doing event handling?\n *\n * There are 2 situations in which this may happen.\n * -# libusb_open() will add another file descriptor to the poll set,\n *    therefore it is desirable to interrupt the event handler so that it\n *    restarts, picking up the new descriptor.\n * -# libusb_close() will remove a file descriptor from the poll set. There\n *    are all kinds of race conditions that could arise here, so it is\n *    important that nobody is doing event handling at this time.\n *\n * libusb handles these issues internally, so application developers do not\n * have to stop their event handlers while opening/closing devices. Here's how\n * it works, focusing on the libusb_close() situation first:\n *\n * -# During initialization, libusb opens an internal pipe, and it adds the read\n *    end of this pipe to the set of file descriptors to be polled.\n * -# During libusb_close(), libusb writes some dummy data on this control pipe.\n *    This immediately interrupts the event handler. libusb also records\n *    internally that it is trying to interrupt event handlers for this\n *    high-priority event.\n * -# At this point, some of the functions described above start behaving\n *    differently:\n *   - libusb_event_handling_ok() starts returning 1, indicating that it is NOT\n *     OK for event handling to continue.\n *   - libusb_try_lock_events() starts returning 1, indicating that another\n *     thread holds the event handling lock, even if the lock is uncontended.\n *   - libusb_event_handler_active() starts returning 1, indicating that\n *     another thread is doing event handling, even if that is not true.\n * -# The above changes in behaviour result in the event handler stopping and\n *    giving up the events lock very quickly, giving the high-priority\n *    libusb_close() operation a \"free ride\" to acquire the events lock. All\n *    threads that are competing to do event handling become event waiters.\n * -# With the events lock held inside libusb_close(), libusb can safely remove\n *    a file descriptor from the poll set, in the safety of knowledge that\n *    nobody is polling those descriptors or trying to access the poll set.\n * -# After obtaining the events lock, the close operation completes very\n *    quickly (usually a matter of milliseconds) and then immediately releases\n *    the events lock.\n * -# At the same time, the behaviour of libusb_event_handling_ok() and friends\n *    reverts to the original, documented behaviour.\n * -# The release of the events lock causes the threads that are waiting for\n *    events to be woken up and to start competing to become event handlers\n *    again. One of them will succeed; it will then re-obtain the list of poll\n *    descriptors, and USB I/O will then continue as normal.\n *\n * libusb_open() is similar, and is actually a more simplistic case. Upon a\n * call to libusb_open():\n *\n * -# The device is opened and a file descriptor is added to the poll set.\n * -# libusb sends some dummy data on the control pipe, and records that it\n *    is trying to modify the poll descriptor set.\n * -# The event handler is interrupted, and the same behaviour change as for\n *    libusb_close() takes effect, causing all event handling threads to become\n *    event waiters.\n * -# The libusb_open() implementation takes its free ride to the events lock.\n * -# Happy that it has successfully paused the events handler, libusb_open()\n *    releases the events lock.\n * -# The event waiter threads are all woken up and compete to become event\n *    handlers again. The one that succeeds will obtain the list of poll\n *    descriptors again, which will include the addition of the new device.\n *\n * \\subsection concl Closing remarks\n *\n * The above may seem a little complicated, but hopefully I have made it clear\n * why such complications are necessary. Also, do not forget that this only\n * applies to applications that take libusb's file descriptors and integrate\n * them into their own polling loops.\n *\n * You may decide that it is OK for your multi-threaded application to ignore\n * some of the rules and locks detailed above, because you don't think that\n * two threads can ever be polling the descriptors at the same time. If that\n * is the case, then that's good news for you because you don't have to worry.\n * But be careful here; remember that the synchronous I/O functions do event\n * handling internally. If you have one thread doing event handling in a loop\n * (without implementing the rules and locking semantics documented above)\n * and another trying to send a synchronous USB transfer, you will end up with\n * two threads monitoring the same descriptors, and the above-described\n * undesirable behaviour occuring. The solution is for your polling thread to\n * play by the rules; the synchronous I/O functions do so, and this will result\n * in them getting along in perfect harmony.\n *\n * If you do have a dedicated thread doing event handling, it is perfectly\n * legal for it to take the event handling lock for long periods of time. Any\n * synchronous I/O functions you call from other threads will transparently\n * fall back to the \"event waiters\" mechanism detailed above. The only\n * consideration that your event handling thread must apply is the one related\n * to libusb_event_handling_ok(): you must call this before every poll(), and\n * give up the events lock if instructed.\n */\n\nint usbi_io_init(struct libusb_context *ctx)\n{\n\tint r;\n\n\tusbi_mutex_init(&ctx->flying_transfers_lock, NULL);\n\tusbi_mutex_init(&ctx->pollfds_lock, NULL);\n\tusbi_mutex_init(&ctx->pollfd_modify_lock, NULL);\n\tusbi_mutex_init_recursive(&ctx->events_lock, NULL);\n\tusbi_mutex_init(&ctx->event_waiters_lock, NULL);\n\tusbi_cond_init(&ctx->event_waiters_cond, NULL);\n\tlist_init(&ctx->flying_transfers);\n\tlist_init(&ctx->pollfds);\n\n\t/* FIXME should use an eventfd on kernels that support it */\n\tr = usbi_pipe(ctx->ctrl_pipe);\n\tif (r < 0) {\n\t\tr = LIBUSB_ERROR_OTHER;\n\t\tgoto err;\n\t}\n\n\tr = usbi_add_pollfd(ctx, ctx->ctrl_pipe[0], POLLIN);\n\tif (r < 0)\n\t\tgoto err_close_pipe;\n\n\t/* create hotplug pipe */\n\tr = usbi_pipe(ctx->hotplug_pipe);\n\tif (r < 0) {\n\t\tr = LIBUSB_ERROR_OTHER;\n\t\tgoto err;\n\t}\n\n\tr = usbi_add_pollfd(ctx, ctx->hotplug_pipe[0], POLLIN);\n\tif (r < 0)\n\t\tgoto err_close_hp_pipe;\n\n#ifdef USBI_TIMERFD_AVAILABLE\n\tctx->timerfd = timerfd_create(usbi_backend->get_timerfd_clockid(),\n\t\tTFD_NONBLOCK);\n\tif (ctx->timerfd >= 0) {\n\t\tusbi_dbg(\"using timerfd for timeouts\");\n\t\tr = usbi_add_pollfd(ctx, ctx->timerfd, POLLIN);\n\t\tif (r < 0) {\n\t\t\tusbi_remove_pollfd(ctx, ctx->ctrl_pipe[0]);\n\t\t\tclose(ctx->timerfd);\n\t\t\tgoto err_close_hp_pipe;\n\t\t}\n\t} else {\n\t\tusbi_dbg(\"timerfd not available (code %d error %d)\", ctx->timerfd, errno);\n\t\tctx->timerfd = -1;\n\t}\n#endif\n\n\treturn 0;\n\nerr_close_hp_pipe:\n\tusbi_close(ctx->hotplug_pipe[0]);\n\tusbi_close(ctx->hotplug_pipe[1]);\nerr_close_pipe:\n\tusbi_close(ctx->ctrl_pipe[0]);\n\tusbi_close(ctx->ctrl_pipe[1]);\nerr:\n\tusbi_mutex_destroy(&ctx->flying_transfers_lock);\n\tusbi_mutex_destroy(&ctx->pollfds_lock);\n\tusbi_mutex_destroy(&ctx->pollfd_modify_lock);\n\tusbi_mutex_destroy(&ctx->events_lock);\n\tusbi_mutex_destroy(&ctx->event_waiters_lock);\n\tusbi_cond_destroy(&ctx->event_waiters_cond);\n\treturn r;\n}\n\nvoid usbi_io_exit(struct libusb_context *ctx)\n{\n\tusbi_remove_pollfd(ctx, ctx->ctrl_pipe[0]);\n\tusbi_close(ctx->ctrl_pipe[0]);\n\tusbi_close(ctx->ctrl_pipe[1]);\n\tusbi_remove_pollfd(ctx, ctx->hotplug_pipe[0]);\n\tusbi_close(ctx->hotplug_pipe[0]);\n\tusbi_close(ctx->hotplug_pipe[1]);\n#ifdef USBI_TIMERFD_AVAILABLE\n\tif (usbi_using_timerfd(ctx)) {\n\t\tusbi_remove_pollfd(ctx, ctx->timerfd);\n\t\tclose(ctx->timerfd);\n\t}\n#endif\n\tusbi_mutex_destroy(&ctx->flying_transfers_lock);\n\tusbi_mutex_destroy(&ctx->pollfds_lock);\n\tusbi_mutex_destroy(&ctx->pollfd_modify_lock);\n\tusbi_mutex_destroy(&ctx->events_lock);\n\tusbi_mutex_destroy(&ctx->event_waiters_lock);\n\tusbi_cond_destroy(&ctx->event_waiters_cond);\n}\n\nstatic int calculate_timeout(struct usbi_transfer *transfer)\n{\n\tint r;\n\tstruct timespec current_time;\n\tunsigned int timeout =\n\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout;\n\n\tif (!timeout)\n\t\treturn 0;\n\n\tr = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, &current_time);\n\tif (r < 0) {\n\t\tusbi_err(ITRANSFER_CTX(transfer),\n\t\t\t\"failed to read monotonic clock, errno=%d\", errno);\n\t\treturn r;\n\t}\n\n\tcurrent_time.tv_sec += timeout / 1000;\n\tcurrent_time.tv_nsec += (timeout % 1000) * 1000000;\n\n\twhile (current_time.tv_nsec >= 1000000000) {\n\t\tcurrent_time.tv_nsec -= 1000000000;\n\t\tcurrent_time.tv_sec++;\n\t}\n\n\tTIMESPEC_TO_TIMEVAL(&transfer->timeout, &current_time);\n\treturn 0;\n}\n\n/* add a transfer to the (timeout-sorted) active transfers list.\n * Callers of this function must hold the flying_transfers_lock.\n * This function *always* adds the transfer to the flying_transfers list,\n * it will return non 0 if it fails to update the timer, but even then the\n * transfer is added to the flying_transfers list. */\nstatic int add_to_flying_list(struct usbi_transfer *transfer)\n{\n\tstruct usbi_transfer *cur;\n\tstruct timeval *timeout = &transfer->timeout;\n\tstruct libusb_context *ctx = ITRANSFER_CTX(transfer);\n\tint r = 0;\n\tint first = 1;\n\n\t/* if we have no other flying transfers, start the list with this one */\n\tif (list_empty(&ctx->flying_transfers)) {\n\t\tlist_add(&transfer->list, &ctx->flying_transfers);\n\t\tgoto out;\n\t}\n\n\t/* if we have infinite timeout, append to end of list */\n\tif (!timerisset(timeout)) {\n\t\tlist_add_tail(&transfer->list, &ctx->flying_transfers);\n\t\t/* first is irrelevant in this case */\n\t\tgoto out;\n\t}\n\n\t/* otherwise, find appropriate place in list */\n\tlist_for_each_entry(cur, &ctx->flying_transfers, list, struct usbi_transfer) {\n\t\t/* find first timeout that occurs after the transfer in question */\n\t\tstruct timeval *cur_tv = &cur->timeout;\n\n\t\tif (!timerisset(cur_tv) || (cur_tv->tv_sec > timeout->tv_sec) ||\n\t\t\t\t(cur_tv->tv_sec == timeout->tv_sec &&\n\t\t\t\t\tcur_tv->tv_usec > timeout->tv_usec)) {\n\t\t\tlist_add_tail(&transfer->list, &cur->list);\n\t\t\tgoto out;\n\t\t}\n\t\tfirst = 0;\n\t}\n\t/* first is 0 at this stage (list not empty) */\n\n\t/* otherwise we need to be inserted at the end */\n\tlist_add_tail(&transfer->list, &ctx->flying_transfers);\nout:\n#ifdef USBI_TIMERFD_AVAILABLE\n\tif (first && usbi_using_timerfd(ctx) && timerisset(timeout)) {\n\t\t/* if this transfer has the lowest timeout of all active transfers,\n\t\t * rearm the timerfd with this transfer's timeout */\n\t\tconst struct itimerspec it = { {0, 0},\n\t\t\t{ timeout->tv_sec, timeout->tv_usec * 1000 } };\n\t\tusbi_dbg(\"arm timerfd for timeout in %dms (first in line)\",\n\t\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout);\n\t\tr = timerfd_settime(ctx->timerfd, TFD_TIMER_ABSTIME, &it, NULL);\n\t\tif (r < 0) {\n\t\t\tusbi_warn(ctx, \"failed to arm first timerfd (errno %d)\", errno);\n\t\t\tr = LIBUSB_ERROR_OTHER;\n\t\t}\n\t}\n#else\n\tUNUSED(first);\n#endif\n\n\treturn r;\n}\n\n/** \\ingroup asyncio\n * Allocate a libusb transfer with a specified number of isochronous packet\n * descriptors. The returned transfer is pre-initialized for you. When the new\n * transfer is no longer needed, it should be freed with\n * libusb_free_transfer().\n *\n * Transfers intended for non-isochronous endpoints (e.g. control, bulk,\n * interrupt) should specify an iso_packets count of zero.\n *\n * For transfers intended for isochronous endpoints, specify an appropriate\n * number of packet descriptors to be allocated as part of the transfer.\n * The returned transfer is not specially initialized for isochronous I/O;\n * you are still required to set the\n * \\ref libusb_transfer::num_iso_packets \"num_iso_packets\" and\n * \\ref libusb_transfer::type \"type\" fields accordingly.\n *\n * It is safe to allocate a transfer with some isochronous packets and then\n * use it on a non-isochronous endpoint. If you do this, ensure that at time\n * of submission, num_iso_packets is 0 and that type is set appropriately.\n *\n * \\param iso_packets number of isochronous packet descriptors to allocate\n * \\returns a newly allocated transfer, or NULL on error\n */\nDEFAULT_VISIBILITY\nstruct libusb_transfer * LIBUSB_CALL libusb_alloc_transfer(\n\tint iso_packets)\n{\n\tsize_t os_alloc_size = usbi_backend->transfer_priv_size\n\t\t+ (usbi_backend->add_iso_packet_size * iso_packets);\n\tsize_t alloc_size = sizeof(struct usbi_transfer)\n\t\t+ sizeof(struct libusb_transfer)\n\t\t+ (sizeof(struct libusb_iso_packet_descriptor) * iso_packets)\n\t\t+ os_alloc_size;\n\tstruct usbi_transfer *itransfer = calloc(1, alloc_size);\n\tif (!itransfer)\n\t\treturn NULL;\n\n\titransfer->num_iso_packets = iso_packets;\n\tusbi_mutex_init(&itransfer->lock, NULL);\n\treturn USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n}\n\n/** \\ingroup asyncio\n * Free a transfer structure. This should be called for all transfers\n * allocated with libusb_alloc_transfer().\n *\n * If the \\ref libusb_transfer_flags::LIBUSB_TRANSFER_FREE_BUFFER\n * \"LIBUSB_TRANSFER_FREE_BUFFER\" flag is set and the transfer buffer is\n * non-NULL, this function will also free the transfer buffer using the\n * standard system memory allocator (e.g. free()).\n *\n * It is legal to call this function with a NULL transfer. In this case,\n * the function will simply return safely.\n *\n * It is not legal to free an active transfer (one which has been submitted\n * and has not yet completed).\n *\n * \\param transfer the transfer to free\n */\nvoid API_EXPORTED libusb_free_transfer(struct libusb_transfer *transfer)\n{\n\tstruct usbi_transfer *itransfer;\n\tif (!transfer)\n\t\treturn;\n\n\tif (transfer->flags & LIBUSB_TRANSFER_FREE_BUFFER && transfer->buffer)\n\t\tfree(transfer->buffer);\n\n\titransfer = LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);\n\tusbi_mutex_destroy(&itransfer->lock);\n\tfree(itransfer);\n}\n\n#ifdef USBI_TIMERFD_AVAILABLE\nstatic int disarm_timerfd(struct libusb_context *ctx)\n{\n\tconst struct itimerspec disarm_timer = { { 0, 0 }, { 0, 0 } };\n\tint r;\n\n\tusbi_dbg(\"\");\n\tr = timerfd_settime(ctx->timerfd, 0, &disarm_timer, NULL);\n\tif (r < 0)\n\t\treturn LIBUSB_ERROR_OTHER;\n\telse\n\t\treturn 0;\n}\n\n/* iterates through the flying transfers, and rearms the timerfd based on the\n * next upcoming timeout.\n * must be called with flying_list locked.\n * returns 0 if there was no timeout to arm, 1 if the next timeout was armed,\n * or a LIBUSB_ERROR code on failure.\n */\nstatic int arm_timerfd_for_next_timeout(struct libusb_context *ctx)\n{\n\tstruct usbi_transfer *transfer;\n\n\tlist_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) {\n\t\tstruct timeval *cur_tv = &transfer->timeout;\n\n\t\t/* if we've reached transfers of infinite timeout, then we have no\n\t\t * arming to do */\n\t\tif (!timerisset(cur_tv))\n\t\t\tgoto disarm;\n\n\t\t/* act on first transfer that is not already cancelled */\n\t\tif (!(transfer->flags & USBI_TRANSFER_TIMED_OUT)) {\n\t\t\tint r;\n\t\t\tconst struct itimerspec it = { {0, 0},\n\t\t\t\t{ cur_tv->tv_sec, cur_tv->tv_usec * 1000 } };\n\t\t\tusbi_dbg(\"next timeout originally %dms\", USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout);\n\t\t\tr = timerfd_settime(ctx->timerfd, TFD_TIMER_ABSTIME, &it, NULL);\n\t\t\tif (r < 0)\n\t\t\t\treturn LIBUSB_ERROR_OTHER;\n\t\t\treturn 1;\n\t\t}\n\t}\n\ndisarm:\n\treturn disarm_timerfd(ctx);\n}\n#else\nstatic int arm_timerfd_for_next_timeout(struct libusb_context *ctx)\n{\n\t(void)ctx;\n\treturn 0;\n}\n#endif\n\n/** \\ingroup asyncio\n * Submit a transfer. This function will fire off the USB transfer and then\n * return immediately.\n *\n * \\param transfer the transfer to submit\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns LIBUSB_ERROR_BUSY if the transfer has already been submitted.\n * \\returns LIBUSB_ERROR_NOT_SUPPORTED if the transfer flags are not supported\n * by the operating system.\n * \\returns another LIBUSB_ERROR code on other failure\n */\nint API_EXPORTED libusb_submit_transfer(struct libusb_transfer *transfer)\n{\n\tstruct libusb_context *ctx = TRANSFER_CTX(transfer);\n\tstruct usbi_transfer *itransfer =\n\t\tLIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);\n\tint r;\n\tint updated_fds;\n\n\tusbi_mutex_lock(&itransfer->lock);\n\titransfer->transferred = 0;\n\titransfer->flags = 0;\n\tr = calculate_timeout(itransfer);\n\tif (r < 0) {\n\t\tr = LIBUSB_ERROR_OTHER;\n\t\tgoto out;\n\t}\n\n\tusbi_mutex_lock(&ctx->flying_transfers_lock);\n\tr = add_to_flying_list(itransfer);\n\tif (r == LIBUSB_SUCCESS) {\n\t\tr = usbi_backend->submit_transfer(itransfer);\n\t}\n\tif (r != LIBUSB_SUCCESS) {\n\t\tlist_del(&itransfer->list);\n\t\tarm_timerfd_for_next_timeout(ctx);\n\t}\n\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\n\t/* keep a reference to this device */\n\tlibusb_ref_device(transfer->dev_handle->dev);\nout:\n\tupdated_fds = (itransfer->flags & USBI_TRANSFER_UPDATED_FDS);\n\tusbi_mutex_unlock(&itransfer->lock);\n\tif (updated_fds)\n\t\tusbi_fd_notification(ctx);\n\treturn r;\n}\n\n/** \\ingroup asyncio\n * Asynchronously cancel a previously submitted transfer.\n * This function returns immediately, but this does not indicate cancellation\n * is complete. Your callback function will be invoked at some later time\n * with a transfer status of\n * \\ref libusb_transfer_status::LIBUSB_TRANSFER_CANCELLED\n * \"LIBUSB_TRANSFER_CANCELLED.\"\n *\n * \\param transfer the transfer to cancel\n * \\returns 0 on success\n * \\returns LIBUSB_ERROR_NOT_FOUND if the transfer is already complete or\n * cancelled.\n * \\returns a LIBUSB_ERROR code on failure\n */\nint API_EXPORTED libusb_cancel_transfer(struct libusb_transfer *transfer)\n{\n\tstruct usbi_transfer *itransfer =\n\t\tLIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer);\n\tint r;\n\n\tusbi_dbg(\"\");\n\tusbi_mutex_lock(&itransfer->lock);\n\tr = usbi_backend->cancel_transfer(itransfer);\n\tif (r < 0) {\n\t\tif (r != LIBUSB_ERROR_NOT_FOUND &&\n\t\t    r != LIBUSB_ERROR_NO_DEVICE)\n\t\t\tusbi_err(TRANSFER_CTX(transfer),\n\t\t\t\t\"cancel transfer failed error %d\", r);\n\t\telse\n\t\t\tusbi_dbg(\"cancel transfer failed error %d\", r);\n\n\t\tif (r == LIBUSB_ERROR_NO_DEVICE)\n\t\t\titransfer->flags |= USBI_TRANSFER_DEVICE_DISAPPEARED;\n\t}\n\n\titransfer->flags |= USBI_TRANSFER_CANCELLING;\n\n\tusbi_mutex_unlock(&itransfer->lock);\n\treturn r;\n}\n\n/* Handle completion of a transfer (completion might be an error condition).\n * This will invoke the user-supplied callback function, which may end up\n * freeing the transfer. Therefore you cannot use the transfer structure\n * after calling this function, and you should free all backend-specific\n * data before calling it.\n * Do not call this function with the usbi_transfer lock held. User-specified\n * callback functions may attempt to directly resubmit the transfer, which\n * will attempt to take the lock. */\nint usbi_handle_transfer_completion(struct usbi_transfer *itransfer,\n\tenum libusb_transfer_status status)\n{\n\tstruct libusb_transfer *transfer =\n\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct libusb_context *ctx = TRANSFER_CTX(transfer);\n\tstruct libusb_device_handle *handle = transfer->dev_handle;\n\tuint8_t flags;\n\tint r = 0;\n\n\t/* FIXME: could be more intelligent with the timerfd here. we don't need\n\t * to disarm the timerfd if there was no timer running, and we only need\n\t * to rearm the timerfd if the transfer that expired was the one with\n\t * the shortest timeout. */\n\n\tusbi_mutex_lock(&ctx->flying_transfers_lock);\n\tlist_del(&itransfer->list);\n\tif (usbi_using_timerfd(ctx))\n\t\tr = arm_timerfd_for_next_timeout(ctx);\n\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\tif (usbi_using_timerfd(ctx) && (r < 0))\n\t\treturn r;\n\n\tif (status == LIBUSB_TRANSFER_COMPLETED\n\t\t\t&& transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) {\n\t\tint rqlen = transfer->length;\n\t\tif (transfer->type == LIBUSB_TRANSFER_TYPE_CONTROL)\n\t\t\trqlen -= LIBUSB_CONTROL_SETUP_SIZE;\n\t\tif (rqlen != itransfer->transferred) {\n\t\t\tusbi_dbg(\"interpreting short transfer as error\");\n\t\t\tstatus = LIBUSB_TRANSFER_ERROR;\n\t\t}\n\t}\n\n\tflags = transfer->flags;\n\ttransfer->status = status;\n\ttransfer->actual_length = itransfer->transferred;\n\tusbi_dbg(\"transfer %p has callback %p\", transfer, transfer->callback);\n\tif (transfer->callback)\n\t\ttransfer->callback(transfer);\n\t/* transfer might have been freed by the above call, do not use from\n\t * this point. */\n\tif (flags & LIBUSB_TRANSFER_FREE_TRANSFER)\n\t\tlibusb_free_transfer(transfer);\n\tusbi_mutex_lock(&ctx->event_waiters_lock);\n\tusbi_cond_broadcast(&ctx->event_waiters_cond);\n\tusbi_mutex_unlock(&ctx->event_waiters_lock);\n\tlibusb_unref_device(handle->dev);\n\treturn 0;\n}\n\n/* Similar to usbi_handle_transfer_completion() but exclusively for transfers\n * that were asynchronously cancelled. The same concerns w.r.t. freeing of\n * transfers exist here.\n * Do not call this function with the usbi_transfer lock held. User-specified\n * callback functions may attempt to directly resubmit the transfer, which\n * will attempt to take the lock. */\nint usbi_handle_transfer_cancellation(struct usbi_transfer *transfer)\n{\n\t/* if the URB was cancelled due to timeout, report timeout to the user */\n\tif (transfer->flags & USBI_TRANSFER_TIMED_OUT) {\n\t\tusbi_dbg(\"detected timeout cancellation\");\n\t\treturn usbi_handle_transfer_completion(transfer, LIBUSB_TRANSFER_TIMED_OUT);\n\t}\n\n\t/* otherwise its a normal async cancel */\n\treturn usbi_handle_transfer_completion(transfer, LIBUSB_TRANSFER_CANCELLED);\n}\n\n/** \\ingroup poll\n * Attempt to acquire the event handling lock. This lock is used to ensure that\n * only one thread is monitoring libusb event sources at any one time.\n *\n * You only need to use this lock if you are developing an application\n * which calls poll() or select() on libusb's file descriptors directly.\n * If you stick to libusb's event handling loop functions (e.g.\n * libusb_handle_events()) then you do not need to be concerned with this\n * locking.\n *\n * While holding this lock, you are trusted to actually be handling events.\n * If you are no longer handling events, you must call libusb_unlock_events()\n * as soon as possible.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\returns 0 if the lock was obtained successfully\n * \\returns 1 if the lock was not obtained (i.e. another thread holds the lock)\n * \\ref mtasync\n */\nint API_EXPORTED libusb_try_lock_events(libusb_context *ctx)\n{\n\tint r;\n\tunsigned int ru;\n\tUSBI_GET_CONTEXT(ctx);\n\n\t/* is someone else waiting to modify poll fds? if so, don't let this thread\n\t * start event handling */\n\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\tru = ctx->pollfd_modify;\n\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\tif (ru) {\n\t\tusbi_dbg(\"someone else is modifying poll fds\");\n\t\treturn 1;\n\t}\n\n\tr = usbi_mutex_trylock(&ctx->events_lock);\n\tif (r)\n\t\treturn 1;\n\n\tctx->event_handler_active = 1;\n\treturn 0;\n}\n\n/** \\ingroup poll\n * Acquire the event handling lock, blocking until successful acquisition if\n * it is contended. This lock is used to ensure that only one thread is\n * monitoring libusb event sources at any one time.\n *\n * You only need to use this lock if you are developing an application\n * which calls poll() or select() on libusb's file descriptors directly.\n * If you stick to libusb's event handling loop functions (e.g.\n * libusb_handle_events()) then you do not need to be concerned with this\n * locking.\n *\n * While holding this lock, you are trusted to actually be handling events.\n * If you are no longer handling events, you must call libusb_unlock_events()\n * as soon as possible.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\ref mtasync\n */\nvoid API_EXPORTED libusb_lock_events(libusb_context *ctx)\n{\n\tUSBI_GET_CONTEXT(ctx);\n\tusbi_mutex_lock(&ctx->events_lock);\n\tctx->event_handler_active = 1;\n}\n\n/** \\ingroup poll\n * Release the lock previously acquired with libusb_try_lock_events() or\n * libusb_lock_events(). Releasing this lock will wake up any threads blocked\n * on libusb_wait_for_event().\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\ref mtasync\n */\nvoid API_EXPORTED libusb_unlock_events(libusb_context *ctx)\n{\n\tUSBI_GET_CONTEXT(ctx);\n\tctx->event_handler_active = 0;\n\tusbi_mutex_unlock(&ctx->events_lock);\n\n\t/* FIXME: perhaps we should be a bit more efficient by not broadcasting\n\t * the availability of the events lock when we are modifying pollfds\n\t * (check ctx->pollfd_modify)? */\n\tusbi_mutex_lock(&ctx->event_waiters_lock);\n\tusbi_cond_broadcast(&ctx->event_waiters_cond);\n\tusbi_mutex_unlock(&ctx->event_waiters_lock);\n}\n\n/** \\ingroup poll\n * Determine if it is still OK for this thread to be doing event handling.\n *\n * Sometimes, libusb needs to temporarily pause all event handlers, and this\n * is the function you should use before polling file descriptors to see if\n * this is the case.\n *\n * If this function instructs your thread to give up the events lock, you\n * should just continue the usual logic that is documented in \\ref mtasync.\n * On the next iteration, your thread will fail to obtain the events lock,\n * and will hence become an event waiter.\n *\n * This function should be called while the events lock is held: you don't\n * need to worry about the results of this function if your thread is not\n * the current event handler.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\returns 1 if event handling can start or continue\n * \\returns 0 if this thread must give up the events lock\n * \\ref fullstory \"Multi-threaded I/O: the full story\"\n */\nint API_EXPORTED libusb_event_handling_ok(libusb_context *ctx)\n{\n\tunsigned int r;\n\tUSBI_GET_CONTEXT(ctx);\n\n\t/* is someone else waiting to modify poll fds? if so, don't let this thread\n\t * continue event handling */\n\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\tr = ctx->pollfd_modify;\n\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\tif (r) {\n\t\tusbi_dbg(\"someone else is modifying poll fds\");\n\t\treturn 0;\n\t}\n\n\treturn 1;\n}\n\n\n/** \\ingroup poll\n * Determine if an active thread is handling events (i.e. if anyone is holding\n * the event handling lock).\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\returns 1 if a thread is handling events\n * \\returns 0 if there are no threads currently handling events\n * \\ref mtasync\n */\nint API_EXPORTED libusb_event_handler_active(libusb_context *ctx)\n{\n\tunsigned int r;\n\tUSBI_GET_CONTEXT(ctx);\n\n\t/* is someone else waiting to modify poll fds? if so, don't let this thread\n\t * start event handling -- indicate that event handling is happening */\n\tusbi_mutex_lock(&ctx->pollfd_modify_lock);\n\tr = ctx->pollfd_modify;\n\tusbi_mutex_unlock(&ctx->pollfd_modify_lock);\n\tif (r) {\n\t\tusbi_dbg(\"someone else is modifying poll fds\");\n\t\treturn 1;\n\t}\n\n\treturn ctx->event_handler_active;\n}\n\n/** \\ingroup poll\n * Acquire the event waiters lock. This lock is designed to be obtained under\n * the situation where you want to be aware when events are completed, but\n * some other thread is event handling so calling libusb_handle_events() is not\n * allowed.\n *\n * You then obtain this lock, re-check that another thread is still handling\n * events, then call libusb_wait_for_event().\n *\n * You only need to use this lock if you are developing an application\n * which calls poll() or select() on libusb's file descriptors directly,\n * <b>and</b> may potentially be handling events from 2 threads simultaenously.\n * If you stick to libusb's event handling loop functions (e.g.\n * libusb_handle_events()) then you do not need to be concerned with this\n * locking.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\ref mtasync\n */\nvoid API_EXPORTED libusb_lock_event_waiters(libusb_context *ctx)\n{\n\tUSBI_GET_CONTEXT(ctx);\n\tusbi_mutex_lock(&ctx->event_waiters_lock);\n}\n\n/** \\ingroup poll\n * Release the event waiters lock.\n * \\param ctx the context to operate on, or NULL for the default context\n * \\ref mtasync\n */\nvoid API_EXPORTED libusb_unlock_event_waiters(libusb_context *ctx)\n{\n\tUSBI_GET_CONTEXT(ctx);\n\tusbi_mutex_unlock(&ctx->event_waiters_lock);\n}\n\n/** \\ingroup poll\n * Wait for another thread to signal completion of an event. Must be called\n * with the event waiters lock held, see libusb_lock_event_waiters().\n *\n * This function will block until any of the following conditions are met:\n * -# The timeout expires\n * -# A transfer completes\n * -# A thread releases the event handling lock through libusb_unlock_events()\n *\n * Condition 1 is obvious. Condition 2 unblocks your thread <em>after</em>\n * the callback for the transfer has completed. Condition 3 is important\n * because it means that the thread that was previously handling events is no\n * longer doing so, so if any events are to complete, another thread needs to\n * step up and start event handling.\n *\n * This function releases the event waiters lock before putting your thread\n * to sleep, and reacquires the lock as it is being woken up.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param tv maximum timeout for this blocking function. A NULL value\n * indicates unlimited timeout.\n * \\returns 0 after a transfer completes or another thread stops event handling\n * \\returns 1 if the timeout expired\n * \\ref mtasync\n */\nint API_EXPORTED libusb_wait_for_event(libusb_context *ctx, struct timeval *tv)\n{\n\tstruct timespec timeout;\n\tint r;\n\n\tUSBI_GET_CONTEXT(ctx);\n\tif (tv == NULL) {\n\t\tusbi_cond_wait(&ctx->event_waiters_cond, &ctx->event_waiters_lock);\n\t\treturn 0;\n\t}\n\n\tr = usbi_backend->clock_gettime(USBI_CLOCK_REALTIME, &timeout);\n\tif (r < 0) {\n\t\tusbi_err(ctx, \"failed to read realtime clock, error %d\", errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\ttimeout.tv_sec += tv->tv_sec;\n\ttimeout.tv_nsec += tv->tv_usec * 1000;\n\twhile (timeout.tv_nsec >= 1000000000) {\n\t\ttimeout.tv_nsec -= 1000000000;\n\t\ttimeout.tv_sec++;\n\t}\n\n\tr = usbi_cond_timedwait(&ctx->event_waiters_cond,\n\t\t&ctx->event_waiters_lock, &timeout);\n\treturn (r == ETIMEDOUT);\n}\n\nstatic void handle_timeout(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer =\n\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tint r;\n\n\titransfer->flags |= USBI_TRANSFER_TIMED_OUT;\n\tr = libusb_cancel_transfer(transfer);\n\tif (r < 0)\n\t\tusbi_warn(TRANSFER_CTX(transfer),\n\t\t\t\"async cancel failed %d errno=%d\", r, errno);\n}\n\nstatic int handle_timeouts_locked(struct libusb_context *ctx)\n{\n\tint r;\n\tstruct timespec systime_ts;\n\tstruct timeval systime;\n\tstruct usbi_transfer *transfer;\n\n\tif (list_empty(&ctx->flying_transfers))\n\t\treturn 0;\n\n\t/* get current time */\n\tr = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, &systime_ts);\n\tif (r < 0)\n\t\treturn r;\n\n\tTIMESPEC_TO_TIMEVAL(&systime, &systime_ts);\n\n\t/* iterate through flying transfers list, finding all transfers that\n\t * have expired timeouts */\n\tlist_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) {\n\t\tstruct timeval *cur_tv = &transfer->timeout;\n\n\t\t/* if we've reached transfers of infinite timeout, we're all done */\n\t\tif (!timerisset(cur_tv))\n\t\t\treturn 0;\n\n\t\t/* ignore timeouts we've already handled */\n\t\tif (transfer->flags & (USBI_TRANSFER_TIMED_OUT | USBI_TRANSFER_OS_HANDLES_TIMEOUT))\n\t\t\tcontinue;\n\n\t\t/* if transfer has non-expired timeout, nothing more to do */\n\t\tif ((cur_tv->tv_sec > systime.tv_sec) ||\n\t\t\t\t(cur_tv->tv_sec == systime.tv_sec &&\n\t\t\t\t\tcur_tv->tv_usec > systime.tv_usec))\n\t\t\treturn 0;\n\n\t\t/* otherwise, we've got an expired timeout to handle */\n\t\thandle_timeout(transfer);\n\t}\n\treturn 0;\n}\n\nstatic int handle_timeouts(struct libusb_context *ctx)\n{\n\tint r;\n\tUSBI_GET_CONTEXT(ctx);\n\tusbi_mutex_lock(&ctx->flying_transfers_lock);\n\tr = handle_timeouts_locked(ctx);\n\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\treturn r;\n}\n\n#ifdef USBI_TIMERFD_AVAILABLE\nstatic int handle_timerfd_trigger(struct libusb_context *ctx)\n{\n\tint r;\n\n\tusbi_mutex_lock(&ctx->flying_transfers_lock);\n\n\t/* process the timeout that just happened */\n\tr = handle_timeouts_locked(ctx);\n\tif (r < 0)\n\t\tgoto out;\n\n\t/* arm for next timeout*/\n\tr = arm_timerfd_for_next_timeout(ctx);\n\nout:\n\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\treturn r;\n}\n#endif\n\n/* do the actual event handling. assumes that no other thread is concurrently\n * doing the same thing. */\nstatic int handle_events(struct libusb_context *ctx, struct timeval *tv)\n{\n\tint r;\n\tstruct usbi_pollfd *ipollfd;\n\tPOLL_NFDS_TYPE nfds = 0;\n\tstruct pollfd *fds = NULL;\n\tint i = -1;\n\tint timeout_ms;\n\tint special_event;\n\n\tusbi_mutex_lock(&ctx->pollfds_lock);\n\tlist_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd)\n\t\tnfds++;\n\n\t/* TODO: malloc when number of fd's changes, not on every poll */\n\tif (nfds != 0)\n\t\tfds = malloc(sizeof(*fds) * nfds);\n\tif (!fds) {\n\t\tusbi_mutex_unlock(&ctx->pollfds_lock);\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\tlist_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd) {\n\t\tstruct libusb_pollfd *pollfd = &ipollfd->pollfd;\n\t\tint fd = pollfd->fd;\n\t\ti++;\n\t\tfds[i].fd = fd;\n\t\tfds[i].events = pollfd->events;\n\t\tfds[i].revents = 0;\n\t}\n\tusbi_mutex_unlock(&ctx->pollfds_lock);\n\n\ttimeout_ms = (int)(tv->tv_sec * 1000) + (tv->tv_usec / 1000);\n\n\t/* round up to next millisecond */\n\tif (tv->tv_usec % 1000)\n\t\ttimeout_ms++;\n\nredo_poll:\n\tusbi_dbg(\"poll() %d fds with timeout in %dms\", nfds, timeout_ms);\n\tr = usbi_poll(fds, nfds, timeout_ms);\n\tusbi_dbg(\"poll() returned %d\", r);\n\tif (r == 0) {\n\t\tfree(fds);\n\t\treturn handle_timeouts(ctx);\n\t} else if (r == -1 && errno == EINTR) {\n\t\tfree(fds);\n\t\treturn LIBUSB_ERROR_INTERRUPTED;\n\t} else if (r < 0) {\n\t\tfree(fds);\n\t\tusbi_err(ctx, \"poll failed %d err=%d\\n\", r, errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tspecial_event = 0;\n\n\t/* fd[0] is always the ctrl pipe */\n\tif (fds[0].revents) {\n\t\t/* another thread wanted to interrupt event handling, and it succeeded!\n\t\t * handle any other events that cropped up at the same time, and\n\t\t * simply return */\n\t\tusbi_dbg(\"caught a fish on the control pipe\");\n\n\t\tif (r == 1) {\n\t\t\tr = 0;\n\t\t\tgoto handled;\n\t\t} else {\n\t\t\t/* prevent OS backend from trying to handle events on ctrl pipe */\n\t\t\tfds[0].revents = 0;\n\t\t\tr--;\n\t\t}\n\t}\n\n\t/* fd[1] is always the hotplug pipe */\n\tif (libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) && fds[1].revents) {\n\t\tlibusb_hotplug_message message;\n\t\tssize_t ret;\n\n\t\tusbi_dbg(\"caught a fish on the hotplug pipe\");\n\t\tspecial_event = 1;\n\n\t\t/* read the message from the hotplug thread */\n\t\tret = usbi_read(ctx->hotplug_pipe[0], &message, sizeof (message));\n\t\tif (ret != sizeof(message)) {\n\t\t\tusbi_err(ctx, \"hotplug pipe read error %d != %u\",\n\t\t\t\t ret, sizeof(message));\n\t\t\tr = LIBUSB_ERROR_OTHER;\n\t\t\tgoto handled;\n\t\t}\n\n\t\tusbi_hotplug_match(ctx, message.device, message.event);\n\n\t\t/* the device left. dereference the device */\n\t\tif (LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT == message.event)\n\t\t\tlibusb_unref_device(message.device);\n\n\t\tfds[1].revents = 0;\n\t\tif (1 == r--)\n\t\t\tgoto handled;\n\t} /* else there shouldn't be anything on this pipe */\n\n#ifdef USBI_TIMERFD_AVAILABLE\n\t/* on timerfd configurations, fds[2] is the timerfd */\n\tif (usbi_using_timerfd(ctx) && fds[2].revents) {\n\t\t/* timerfd indicates that a timeout has expired */\n\t\tint ret;\n\t\tusbi_dbg(\"timerfd triggered\");\n\t\tspecial_event = 1;\n\n\t\tret = handle_timerfd_trigger(ctx);\n\t\tif (ret < 0) {\n\t\t\t/* return error code */\n\t\t\tr = ret;\n\t\t\tgoto handled;\n\t\t} else if (r == 1) {\n\t\t\t/* no more active file descriptors, nothing more to do */\n\t\t\tr = 0;\n\t\t\tgoto handled;\n\t\t} else {\n\t\t\t/* more events pending...\n\t\t\t * prevent OS backend from trying to handle events on timerfd */\n\t\t\tfds[2].revents = 0;\n\t\t\tr--;\n\t\t}\n\t}\n#endif\n\n\tr = usbi_backend->handle_events(ctx, fds, nfds, r);\n\tif (r)\n\t\tusbi_err(ctx, \"backend handle_events failed with error %d\", r);\n\nhandled:\n        if (r == 0 && special_event) {\n                timeout_ms = 0;\n                goto redo_poll;\n        }\n\n\tfree(fds);\n\treturn r;\n}\n\n/* returns the smallest of:\n *  1. timeout of next URB\n *  2. user-supplied timeout\n * returns 1 if there is an already-expired timeout, otherwise returns 0\n * and populates out\n */\nstatic int get_next_timeout(libusb_context *ctx, struct timeval *tv,\n\tstruct timeval *out)\n{\n\tstruct timeval timeout;\n\tint r = libusb_get_next_timeout(ctx, &timeout);\n\tif (r) {\n\t\t/* timeout already expired? */\n\t\tif (!timerisset(&timeout))\n\t\t\treturn 1;\n\n\t\t/* choose the smallest of next URB timeout or user specified timeout */\n\t\tif (timercmp(&timeout, tv, <))\n\t\t\t*out = timeout;\n\t\telse\n\t\t\t*out = *tv;\n\t} else {\n\t\t*out = *tv;\n\t}\n\treturn 0;\n}\n\n/** \\ingroup poll\n * Handle any pending events.\n *\n * libusb determines \"pending events\" by checking if any timeouts have expired\n * and by checking the set of file descriptors for activity.\n *\n * If a zero timeval is passed, this function will handle any already-pending\n * events and then immediately return in non-blocking style.\n *\n * If a non-zero timeval is passed and no events are currently pending, this\n * function will block waiting for events to handle up until the specified\n * timeout. If an event arrives or a signal is raised, this function will\n * return early.\n *\n * If the parameter completed is not NULL then <em>after obtaining the event\n * handling lock</em> this function will return immediately if the integer\n * pointed to is not 0. This allows for race free waiting for the completion\n * of a specific transfer.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param tv the maximum time to block waiting for events, or an all zero\n * timeval struct for non-blocking mode\n * \\param completed pointer to completion integer to check, or NULL\n * \\returns 0 on success, or a LIBUSB_ERROR code on failure\n * \\ref mtasync\n */\nint API_EXPORTED libusb_handle_events_timeout_completed(libusb_context *ctx,\n\tstruct timeval *tv, int *completed)\n{\n\tint r;\n\tstruct timeval poll_timeout;\n\n\tUSBI_GET_CONTEXT(ctx);\n\tr = get_next_timeout(ctx, tv, &poll_timeout);\n\tif (r) {\n\t\t/* timeout already expired */\n\t\treturn handle_timeouts(ctx);\n\t}\n\nretry:\n\tif (libusb_try_lock_events(ctx) == 0) {\n\t\tif (completed == NULL || !*completed) {\n\t\t\t/* we obtained the event lock: do our own event handling */\n\t\t\tusbi_dbg(\"doing our own event handling\");\n\t\t\tr = handle_events(ctx, &poll_timeout);\n\t\t}\n\t\tlibusb_unlock_events(ctx);\n\t\treturn r;\n\t}\n\n\t/* another thread is doing event handling. wait for thread events that\n\t * notify event completion. */\n\tlibusb_lock_event_waiters(ctx);\n\n\tif (completed && *completed)\n\t\tgoto already_done;\n\n\tif (!libusb_event_handler_active(ctx)) {\n\t\t/* we hit a race: whoever was event handling earlier finished in the\n\t\t * time it took us to reach this point. try the cycle again. */\n\t\tlibusb_unlock_event_waiters(ctx);\n\t\tusbi_dbg(\"event handler was active but went away, retrying\");\n\t\tgoto retry;\n\t}\n\n\tusbi_dbg(\"another thread is doing event handling\");\n\tr = libusb_wait_for_event(ctx, &poll_timeout);\n\nalready_done:\n\tlibusb_unlock_event_waiters(ctx);\n\n\tif (r < 0)\n\t\treturn r;\n\telse if (r == 1)\n\t\treturn handle_timeouts(ctx);\n\telse\n\t\treturn 0;\n}\n\n/** \\ingroup poll\n * Handle any pending events\n *\n * Like libusb_handle_events_timeout_completed(), but without the completed\n * parameter, calling this function is equivalent to calling\n * libusb_handle_events_timeout_completed() with a NULL completed parameter.\n *\n * This function is kept primarily for backwards compatibility.\n * All new code should call libusb_handle_events_completed() or\n * libusb_handle_events_timeout_completed() to avoid race conditions.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param tv the maximum time to block waiting for events, or an all zero\n * timeval struct for non-blocking mode\n * \\returns 0 on success, or a LIBUSB_ERROR code on failure\n */\nint API_EXPORTED libusb_handle_events_timeout(libusb_context *ctx,\n\tstruct timeval *tv)\n{\n\treturn libusb_handle_events_timeout_completed(ctx, tv, NULL);\n}\n\n/** \\ingroup poll\n * Handle any pending events in blocking mode. There is currently a timeout\n * hardcoded at 60 seconds but we plan to make it unlimited in future. For\n * finer control over whether this function is blocking or non-blocking, or\n * for control over the timeout, use libusb_handle_events_timeout_completed()\n * instead.\n *\n * This function is kept primarily for backwards compatibility.\n * All new code should call libusb_handle_events_completed() or\n * libusb_handle_events_timeout_completed() to avoid race conditions.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\returns 0 on success, or a LIBUSB_ERROR code on failure\n */\nint API_EXPORTED libusb_handle_events(libusb_context *ctx)\n{\n\tstruct timeval tv;\n\ttv.tv_sec = 60;\n\ttv.tv_usec = 0;\n\treturn libusb_handle_events_timeout_completed(ctx, &tv, NULL);\n}\n\n/** \\ingroup poll\n * Handle any pending events in blocking mode.\n *\n * Like libusb_handle_events(), with the addition of a completed parameter\n * to allow for race free waiting for the completion of a specific transfer.\n *\n * See libusb_handle_events_timeout_completed() for details on the completed\n * parameter.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param completed pointer to completion integer to check, or NULL\n * \\returns 0 on success, or a LIBUSB_ERROR code on failure\n * \\ref mtasync\n */\nint API_EXPORTED libusb_handle_events_completed(libusb_context *ctx,\n\tint *completed)\n{\n\tstruct timeval tv;\n\ttv.tv_sec = 60;\n\ttv.tv_usec = 0;\n\treturn libusb_handle_events_timeout_completed(ctx, &tv, completed);\n}\n\n/** \\ingroup poll\n * Handle any pending events by polling file descriptors, without checking if\n * any other threads are already doing so. Must be called with the event lock\n * held, see libusb_lock_events().\n *\n * This function is designed to be called under the situation where you have\n * taken the event lock and are calling poll()/select() directly on libusb's\n * file descriptors (as opposed to using libusb_handle_events() or similar).\n * You detect events on libusb's descriptors, so you then call this function\n * with a zero timeout value (while still holding the event lock).\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param tv the maximum time to block waiting for events, or zero for\n * non-blocking mode\n * \\returns 0 on success, or a LIBUSB_ERROR code on failure\n * \\ref mtasync\n */\nint API_EXPORTED libusb_handle_events_locked(libusb_context *ctx,\n\tstruct timeval *tv)\n{\n\tint r;\n\tstruct timeval poll_timeout;\n\n\tUSBI_GET_CONTEXT(ctx);\n\tr = get_next_timeout(ctx, tv, &poll_timeout);\n\tif (r) {\n\t\t/* timeout already expired */\n\t\treturn handle_timeouts(ctx);\n\t}\n\n\treturn handle_events(ctx, &poll_timeout);\n}\n\n/** \\ingroup poll\n * Determines whether your application must apply special timing considerations\n * when monitoring libusb's file descriptors.\n *\n * This function is only useful for applications which retrieve and poll\n * libusb's file descriptors in their own main loop (\\ref pollmain).\n *\n * Ordinarily, libusb's event handler needs to be called into at specific\n * moments in time (in addition to times when there is activity on the file\n * descriptor set). The usual approach is to use libusb_get_next_timeout()\n * to learn about when the next timeout occurs, and to adjust your\n * poll()/select() timeout accordingly so that you can make a call into the\n * library at that time.\n *\n * Some platforms supported by libusb do not come with this baggage - any\n * events relevant to timing will be represented by activity on the file\n * descriptor set, and libusb_get_next_timeout() will always return 0.\n * This function allows you to detect whether you are running on such a\n * platform.\n *\n * Since v1.0.5.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\returns 0 if you must call into libusb at times determined by\n * libusb_get_next_timeout(), or 1 if all timeout events are handled internally\n * or through regular activity on the file descriptors.\n * \\ref pollmain \"Polling libusb file descriptors for event handling\"\n */\nint API_EXPORTED libusb_pollfds_handle_timeouts(libusb_context *ctx)\n{\n#if defined(USBI_TIMERFD_AVAILABLE)\n\tUSBI_GET_CONTEXT(ctx);\n\treturn usbi_using_timerfd(ctx);\n#else\n\t(void)ctx;\n\treturn 0;\n#endif\n}\n\n/** \\ingroup poll\n * Determine the next internal timeout that libusb needs to handle. You only\n * need to use this function if you are calling poll() or select() or similar\n * on libusb's file descriptors yourself - you do not need to use it if you\n * are calling libusb_handle_events() or a variant directly.\n *\n * You should call this function in your main loop in order to determine how\n * long to wait for select() or poll() to return results. libusb needs to be\n * called into at this timeout, so you should use it as an upper bound on\n * your select() or poll() call.\n *\n * When the timeout has expired, call into libusb_handle_events_timeout()\n * (perhaps in non-blocking mode) so that libusb can handle the timeout.\n *\n * This function may return 1 (success) and an all-zero timeval. If this is\n * the case, it indicates that libusb has a timeout that has already expired\n * so you should call libusb_handle_events_timeout() or similar immediately.\n * A return code of 0 indicates that there are no pending timeouts.\n *\n * On some platforms, this function will always returns 0 (no pending\n * timeouts). See \\ref polltime.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param tv output location for a relative time against the current\n * clock in which libusb must be called into in order to process timeout events\n * \\returns 0 if there are no pending timeouts, 1 if a timeout was returned,\n * or LIBUSB_ERROR_OTHER on failure\n */\nint API_EXPORTED libusb_get_next_timeout(libusb_context *ctx,\n\tstruct timeval *tv)\n{\n\tstruct usbi_transfer *transfer;\n\tstruct timespec cur_ts;\n\tstruct timeval cur_tv;\n\tstruct timeval *next_timeout;\n\tint r;\n\tint found = 0;\n\n\tUSBI_GET_CONTEXT(ctx);\n\tif (usbi_using_timerfd(ctx))\n\t\treturn 0;\n\n\tusbi_mutex_lock(&ctx->flying_transfers_lock);\n\tif (list_empty(&ctx->flying_transfers)) {\n\t\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\t\tusbi_dbg(\"no URBs, no timeout!\");\n\t\treturn 0;\n\t}\n\n\t/* find next transfer which hasn't already been processed as timed out */\n\tlist_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) {\n\t\tif (transfer->flags & (USBI_TRANSFER_TIMED_OUT | USBI_TRANSFER_OS_HANDLES_TIMEOUT))\n\t\t\tcontinue;\n\n\t\t/* no timeout for this transfer? */\n\t\tif (!timerisset(&transfer->timeout))\n\t\t\tcontinue;\n\n\t\tfound = 1;\n\t\tbreak;\n\t}\n\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\n\tif (!found) {\n\t\tusbi_dbg(\"no URB with timeout or all handled by OS; no timeout!\");\n\t\treturn 0;\n\t}\n\n\tnext_timeout = &transfer->timeout;\n\n\tr = usbi_backend->clock_gettime(USBI_CLOCK_MONOTONIC, &cur_ts);\n\tif (r < 0) {\n\t\tusbi_err(ctx, \"failed to read monotonic clock, errno=%d\", errno);\n\t\treturn 0;\n\t}\n\tTIMESPEC_TO_TIMEVAL(&cur_tv, &cur_ts);\n\n\tif (!timercmp(&cur_tv, next_timeout, <)) {\n\t\tusbi_dbg(\"first timeout already expired\");\n\t\ttimerclear(tv);\n\t} else {\n\t\ttimersub(next_timeout, &cur_tv, tv);\n\t\tusbi_dbg(\"next timeout in %d.%06ds\", tv->tv_sec, tv->tv_usec);\n\t}\n\n\treturn 1;\n}\n\n/** \\ingroup poll\n * Register notification functions for file descriptor additions/removals.\n * These functions will be invoked for every new or removed file descriptor\n * that libusb uses as an event source.\n *\n * To remove notifiers, pass NULL values for the function pointers.\n *\n * Note that file descriptors may have been added even before you register\n * these notifiers (e.g. at libusb_init() time).\n *\n * Additionally, note that the removal notifier may be called during\n * libusb_exit() (e.g. when it is closing file descriptors that were opened\n * and added to the poll set at libusb_init() time). If you don't want this,\n * remove the notifiers immediately before calling libusb_exit().\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\param added_cb pointer to function for addition notifications\n * \\param removed_cb pointer to function for removal notifications\n * \\param user_data User data to be passed back to callbacks (useful for\n * passing context information)\n */\nvoid API_EXPORTED libusb_set_pollfd_notifiers(libusb_context *ctx,\n\tlibusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb,\n\tvoid *user_data)\n{\n\tUSBI_GET_CONTEXT(ctx);\n\tctx->fd_added_cb = added_cb;\n\tctx->fd_removed_cb = removed_cb;\n\tctx->fd_cb_user_data = user_data;\n}\n\n/* Add a file descriptor to the list of file descriptors to be monitored.\n * events should be specified as a bitmask of events passed to poll(), e.g.\n * POLLIN and/or POLLOUT. */\nint usbi_add_pollfd(struct libusb_context *ctx, int fd, short events)\n{\n\tstruct usbi_pollfd *ipollfd = malloc(sizeof(*ipollfd));\n\tif (!ipollfd)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tusbi_dbg(\"add fd %d events %d\", fd, events);\n\tipollfd->pollfd.fd = fd;\n\tipollfd->pollfd.events = events;\n\tusbi_mutex_lock(&ctx->pollfds_lock);\n\tlist_add_tail(&ipollfd->list, &ctx->pollfds);\n\tusbi_mutex_unlock(&ctx->pollfds_lock);\n\n\tif (ctx->fd_added_cb)\n\t\tctx->fd_added_cb(fd, events, ctx->fd_cb_user_data);\n\treturn 0;\n}\n\n/* Remove a file descriptor from the list of file descriptors to be polled. */\nvoid usbi_remove_pollfd(struct libusb_context *ctx, int fd)\n{\n\tstruct usbi_pollfd *ipollfd;\n\tint found = 0;\n\n\tusbi_dbg(\"remove fd %d\", fd);\n\tusbi_mutex_lock(&ctx->pollfds_lock);\n\tlist_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd)\n\t\tif (ipollfd->pollfd.fd == fd) {\n\t\t\tfound = 1;\n\t\t\tbreak;\n\t\t}\n\n\tif (!found) {\n\t\tusbi_dbg(\"couldn't find fd %d to remove\", fd);\n\t\tusbi_mutex_unlock(&ctx->pollfds_lock);\n\t\treturn;\n\t}\n\n\tlist_del(&ipollfd->list);\n\tusbi_mutex_unlock(&ctx->pollfds_lock);\n\tfree(ipollfd);\n\tif (ctx->fd_removed_cb)\n\t\tctx->fd_removed_cb(fd, ctx->fd_cb_user_data);\n}\n\n/** \\ingroup poll\n * Retrieve a list of file descriptors that should be polled by your main loop\n * as libusb event sources.\n *\n * The returned list is NULL-terminated and should be freed with free() when\n * done. The actual list contents must not be touched.\n *\n * As file descriptors are a Unix-specific concept, this function is not\n * available on Windows and will always return NULL.\n *\n * \\param ctx the context to operate on, or NULL for the default context\n * \\returns a NULL-terminated list of libusb_pollfd structures\n * \\returns NULL on error\n * \\returns NULL on platforms where the functionality is not available\n */\nDEFAULT_VISIBILITY\nconst struct libusb_pollfd ** LIBUSB_CALL libusb_get_pollfds(\n\tlibusb_context *ctx)\n{\n#ifndef OS_WINDOWS\n\tstruct libusb_pollfd **ret = NULL;\n\tstruct usbi_pollfd *ipollfd;\n\tsize_t i = 0;\n\tsize_t cnt = 0;\n\tUSBI_GET_CONTEXT(ctx);\n\n\tusbi_mutex_lock(&ctx->pollfds_lock);\n\tlist_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd)\n\t\tcnt++;\n\n\tret = calloc(cnt + 1, sizeof(struct libusb_pollfd *));\n\tif (!ret)\n\t\tgoto out;\n\n\tlist_for_each_entry(ipollfd, &ctx->pollfds, list, struct usbi_pollfd)\n\t\tret[i++] = (struct libusb_pollfd *) ipollfd;\n\tret[cnt] = NULL;\n\nout:\n\tusbi_mutex_unlock(&ctx->pollfds_lock);\n\treturn (const struct libusb_pollfd **) ret;\n#else\n\tusbi_err(ctx, \"external polling of libusb's internal descriptors \"\\\n\t\t\"is not yet supported on Windows platforms\");\n\treturn NULL;\n#endif\n}\n\n/* Backends may call this from handle_events to report disconnection of a\n * device. This function ensures transfers get cancelled appropriately.\n * Callers of this function must hold the events_lock.\n */\nvoid usbi_handle_disconnect(struct libusb_device_handle *handle)\n{\n\tstruct usbi_transfer *cur;\n\tstruct usbi_transfer *to_cancel;\n\n\tusbi_dbg(\"device %d.%d\",\n\t\thandle->dev->bus_number, handle->dev->device_address);\n\n\t/* terminate all pending transfers with the LIBUSB_TRANSFER_NO_DEVICE\n\t * status code.\n\t *\n\t * this is a bit tricky because:\n\t * 1. we can't do transfer completion while holding flying_transfers_lock\n\t *    because the completion handler may try to re-submit the transfer\n\t * 2. the transfers list can change underneath us - if we were to build a\n\t *    list of transfers to complete (while holding lock), the situation\n\t *    might be different by the time we come to free them\n\t *\n\t * so we resort to a loop-based approach as below\n\t *\n\t * This is safe because transfers are only removed from the\n\t * flying_transfer list by usbi_handle_transfer_completion and\n\t * libusb_close, both of which hold the events_lock while doing so,\n\t * so usbi_handle_disconnect cannot be running at the same time.\n\t *\n\t * Note that libusb_submit_transfer also removes the transfer from\n\t * the flying_transfer list on submission failure, but it keeps the\n\t * flying_transfer list locked between addition and removal, so\n\t * usbi_handle_disconnect never sees such transfers.\n\t */\n\n\twhile (1) {\n\t\tusbi_mutex_lock(&HANDLE_CTX(handle)->flying_transfers_lock);\n\t\tto_cancel = NULL;\n\t\tlist_for_each_entry(cur, &HANDLE_CTX(handle)->flying_transfers, list, struct usbi_transfer)\n\t\t\tif (USBI_TRANSFER_TO_LIBUSB_TRANSFER(cur)->dev_handle == handle) {\n\t\t\t\tto_cancel = cur;\n\t\t\t\tbreak;\n\t\t\t}\n\t\tusbi_mutex_unlock(&HANDLE_CTX(handle)->flying_transfers_lock);\n\n\t\tif (!to_cancel)\n\t\t\tbreak;\n\n\t\tusbi_dbg(\"cancelling transfer %p from disconnect\",\n\t\t\t USBI_TRANSFER_TO_LIBUSB_TRANSFER(to_cancel));\n\n\t\tusbi_backend->clear_transfer_priv(to_cancel);\n\t\tusbi_handle_transfer_completion(to_cancel, LIBUSB_TRANSFER_NO_DEVICE);\n\t}\n\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/libusb-1.0.def",
    "content": "LIBRARY \"libusb-1.0.dll\"\nEXPORTS\n  libusb_alloc_transfer\n  libusb_alloc_transfer@4 = libusb_alloc_transfer\n  libusb_attach_kernel_driver\n  libusb_attach_kernel_driver@8 = libusb_attach_kernel_driver\n  libusb_bulk_transfer\n  libusb_bulk_transfer@24 = libusb_bulk_transfer\n  libusb_cancel_transfer\n  libusb_cancel_transfer@4 = libusb_cancel_transfer\n  libusb_claim_interface\n  libusb_claim_interface@8 = libusb_claim_interface\n  libusb_clear_halt\n  libusb_clear_halt@8 = libusb_clear_halt\n  libusb_close\n  libusb_close@4 = libusb_close\n  libusb_control_transfer\n  libusb_control_transfer@32 = libusb_control_transfer\n  libusb_detach_kernel_driver\n  libusb_detach_kernel_driver@8 = libusb_detach_kernel_driver\n  libusb_error_name\n  libusb_error_name@4 = libusb_error_name\n  libusb_event_handler_active\n  libusb_event_handler_active@4 = libusb_event_handler_active\n  libusb_event_handling_ok\n  libusb_event_handling_ok@4 = libusb_event_handling_ok\n  libusb_exit\n  libusb_exit@4 = libusb_exit\n  libusb_free_bos_descriptor\n  libusb_free_bos_descriptor@4 = libusb_free_bos_descriptor\n  libusb_free_config_descriptor\n  libusb_free_config_descriptor@4 = libusb_free_config_descriptor\n  libusb_free_container_id_descriptor\n  libusb_free_container_id_descriptor@4 = libusb_free_container_id_descriptor\n  libusb_free_device_list\n  libusb_free_device_list@8 = libusb_free_device_list\n  libusb_free_ss_endpoint_companion_descriptor\n  libusb_free_ss_endpoint_companion_descriptor@4 = libusb_free_ss_endpoint_companion_descriptor\n  libusb_free_ss_usb_device_capability_descriptor\n  libusb_free_ss_usb_device_capability_descriptor@4 = libusb_free_ss_usb_device_capability_descriptor\n  libusb_free_transfer\n  libusb_free_transfer@4 = libusb_free_transfer\n  libusb_free_usb_2_0_extension_descriptor\n  libusb_free_usb_2_0_extension_descriptor@4 = libusb_free_usb_2_0_extension_descriptor\n  libusb_get_active_config_descriptor\n  libusb_get_active_config_descriptor@8 = libusb_get_active_config_descriptor\n  libusb_get_bos_descriptor\n  libusb_get_bos_descriptor@8 = libusb_get_bos_descriptor\n  libusb_get_bus_number\n  libusb_get_bus_number@4 = libusb_get_bus_number\n  libusb_get_config_descriptor\n  libusb_get_config_descriptor@12 = libusb_get_config_descriptor\n  libusb_get_config_descriptor_by_value\n  libusb_get_config_descriptor_by_value@12 = libusb_get_config_descriptor_by_value\n  libusb_get_configuration\n  libusb_get_configuration@8 = libusb_get_configuration\n  libusb_get_container_id_descriptor\n  libusb_get_container_id_descriptor@12 = libusb_get_container_id_descriptor\n  libusb_get_device\n  libusb_get_device@4 = libusb_get_device\n  libusb_get_device_address\n  libusb_get_device_address@4 = libusb_get_device_address\n  libusb_get_device_descriptor\n  libusb_get_device_descriptor@8 = libusb_get_device_descriptor\n  libusb_get_device_list\n  libusb_get_device_list@8 = libusb_get_device_list\n  libusb_get_device_speed\n  libusb_get_device_speed@4 = libusb_get_device_speed\n  libusb_get_max_iso_packet_size\n  libusb_get_max_iso_packet_size@8 = libusb_get_max_iso_packet_size\n  libusb_get_max_packet_size\n  libusb_get_max_packet_size@8 = libusb_get_max_packet_size\n  libusb_get_next_timeout\n  libusb_get_next_timeout@8 = libusb_get_next_timeout\n  libusb_get_parent\n  libusb_get_parent@4 = libusb_get_parent\n  libusb_get_pollfds\n  libusb_get_pollfds@4 = libusb_get_pollfds\n  libusb_get_port_number\n  libusb_get_port_number@4 = libusb_get_port_number\n  libusb_get_port_numbers\n  libusb_get_port_numbers@12 = libusb_get_port_numbers\n  libusb_get_port_path\n  libusb_get_port_path@16 = libusb_get_port_path\n  libusb_get_ss_endpoint_companion_descriptor\n  libusb_get_ss_endpoint_companion_descriptor@12 = libusb_get_ss_endpoint_companion_descriptor\n  libusb_get_ss_usb_device_capability_descriptor\n  libusb_get_ss_usb_device_capability_descriptor@12 = libusb_get_ss_usb_device_capability_descriptor\n  libusb_get_string_descriptor_ascii\n  libusb_get_string_descriptor_ascii@16 = libusb_get_string_descriptor_ascii\n  libusb_get_usb_2_0_extension_descriptor\n  libusb_get_usb_2_0_extension_descriptor@12 = libusb_get_usb_2_0_extension_descriptor\n  libusb_get_version\n  libusb_get_version@0 = libusb_get_version\n  libusb_handle_events\n  libusb_handle_events@4 = libusb_handle_events\n  libusb_handle_events_completed\n  libusb_handle_events_completed@8 = libusb_handle_events_completed\n  libusb_handle_events_locked\n  libusb_handle_events_locked@8 = libusb_handle_events_locked\n  libusb_handle_events_timeout\n  libusb_handle_events_timeout@8 = libusb_handle_events_timeout\n  libusb_handle_events_timeout_completed\n  libusb_handle_events_timeout_completed@12 = libusb_handle_events_timeout_completed\n  libusb_has_capability\n  libusb_has_capability@4 = libusb_has_capability\n  libusb_hotplug_deregister_callback\n  libusb_hotplug_deregister_callback@8 = libusb_hotplug_deregister_callback\n  libusb_hotplug_register_callback\n  libusb_hotplug_register_callback@36 = libusb_hotplug_register_callback\n  libusb_init\n  libusb_init@4 = libusb_init\n  libusb_interrupt_transfer\n  libusb_interrupt_transfer@24 = libusb_interrupt_transfer\n  libusb_kernel_driver_active\n  libusb_kernel_driver_active@8 = libusb_kernel_driver_active\n  libusb_lock_event_waiters\n  libusb_lock_event_waiters@4 = libusb_lock_event_waiters\n  libusb_lock_events\n  libusb_lock_events@4 = libusb_lock_events\n  libusb_open\n  libusb_open@8 = libusb_open\n  libusb_open_device_with_vid_pid\n  libusb_open_device_with_vid_pid@12 = libusb_open_device_with_vid_pid\n  libusb_pollfds_handle_timeouts\n  libusb_pollfds_handle_timeouts@4 = libusb_pollfds_handle_timeouts\n  libusb_ref_device\n  libusb_ref_device@4 = libusb_ref_device\n  libusb_release_interface\n  libusb_release_interface@8 = libusb_release_interface\n  libusb_reset_device\n  libusb_reset_device@4 = libusb_reset_device\n  libusb_set_auto_detach_kernel_driver\n  libusb_set_auto_detach_kernel_driver@8 = libusb_set_auto_detach_kernel_driver\n  libusb_set_configuration\n  libusb_set_configuration@8 = libusb_set_configuration\n  libusb_set_debug\n  libusb_set_debug@8 = libusb_set_debug\n  libusb_set_interface_alt_setting\n  libusb_set_interface_alt_setting@12 = libusb_set_interface_alt_setting\n  libusb_set_pollfd_notifiers\n  libusb_set_pollfd_notifiers@16 = libusb_set_pollfd_notifiers\n  libusb_setlocale\n  libusb_setlocale@4 = libusb_setlocale\n  libusb_strerror\n  libusb_strerror@4 = libusb_strerror\n  libusb_submit_transfer\n  libusb_submit_transfer@4 = libusb_submit_transfer\n  libusb_try_lock_events\n  libusb_try_lock_events@4 = libusb_try_lock_events\n  libusb_unlock_event_waiters\n  libusb_unlock_event_waiters@4 = libusb_unlock_event_waiters\n  libusb_unlock_events\n  libusb_unlock_events@4 = libusb_unlock_events\n  libusb_unref_device\n  libusb_unref_device@4 = libusb_unref_device\n  libusb_wait_for_event\n  libusb_wait_for_event@8 = libusb_wait_for_event\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/libusb-1.0.rc",
    "content": "/*\n * For Windows: input this file to the Resoure Compiler to produce a binary\n * .res file. This is then embedded in the resultant library (like any other\n * compilation object).\n * The information can then be queried using standard APIs and can also be\n * viewed with utilities such as Windows Explorer.\n */\n#ifndef _WIN32_WCE\n#include \"winresrc.h\"\n#endif\n\n#include \"version.h\"\n#ifndef LIBUSB_VERSIONSTRING\n#define LU_STR(s) #s\n#define LU_XSTR(s) LU_STR(s)\n#if LIBUSB_NANO > 0\n#define LIBUSB_VERSIONSTRING \\\n\tLU_XSTR(LIBUSB_MAJOR) \".\" LU_XSTR(LIBUSB_MINOR) \".\" \\\n\tLU_XSTR(LIBUSB_MICRO) \".\" LU_XSTR(LIBUSB_NANO) LIBUSB_RC \"\\0\"\n#else\n#define LIBUSB_VERSIONSTRING \\\n\tLU_XSTR(LIBUSB_MAJOR) \".\" LU_XSTR(LIBUSB_MINOR) \".\" \\\n\tLU_XSTR(LIBUSB_MICRO) LIBUSB_RC \"\\0\"\n#endif\n#endif\n\nVS_VERSION_INFO VERSIONINFO\n FILEVERSION LIBUSB_MAJOR,LIBUSB_MINOR,LIBUSB_MICRO,LIBUSB_NANO\n PRODUCTVERSION LIBUSB_MAJOR,LIBUSB_MINOR,LIBUSB_MICRO,LIBUSB_NANO\n FILEFLAGSMASK 0x3fL\n#ifdef _DEBUG\n FILEFLAGS 0x1L\n#else\n FILEFLAGS 0x0L\n#endif\n FILEOS 0x40004L\n FILETYPE 0x2L\n FILESUBTYPE 0x0L\nBEGIN\n\tBLOCK \"StringFileInfo\"\n\tBEGIN\n\t\tBLOCK \"040904b0\"\n\t\tBEGIN\n\t\t\tVALUE \"CompanyName\", \"libusb.info\\0\"\n\t\t\tVALUE \"FileDescription\", \"C library for writing portable USB drivers in userspace\\0\"\n\t\t\tVALUE \"FileVersion\", LIBUSB_VERSIONSTRING\n\t\t\tVALUE \"InternalName\", \"libusb\\0\"\n\t\t\tVALUE \"LegalCopyright\", \"See individual source files, GNU LGPL v2.1 or later.\\0\"\n\t\t\tVALUE \"LegalTrademarks\", \"http://www.gnu.org/licenses/lgpl-2.1.html\\0\"\n\t\t\tVALUE \"OriginalFilename\", \"libusb-1.0.dll\\0\"\n\t\t\tVALUE \"PrivateBuild\", \"\\0\"\n\t\t\tVALUE \"ProductName\", \"libusb-1.0\\0\"\n\t\t\tVALUE \"ProductVersion\", LIBUSB_VERSIONSTRING\n\t\t\tVALUE \"SpecialBuild\", \"\\0\"\n\t\tEND\n\tEND\n\tBLOCK \"VarFileInfo\"\n\tBEGIN\n\t\tVALUE \"Translation\", 0x409, 1200\n\tEND\nEND\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/libusb.h",
    "content": "/*\n * Public libusb header file\n * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>\n * Copyright © 2007-2008 Daniel Drake <dsd@gentoo.org>\n * Copyright © 2012 Pete Batard <pete@akeo.ie>\n * Copyright © 2012 Nathan Hjelm <hjelmn@cs.unm.edu>\n * For more information, please visit: http://libusb.info\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef LIBUSB_H\n#define LIBUSB_H\n\n#ifdef _MSC_VER\n/* on MS environments, the inline keyword is available in C++ only */\n#if !defined(__cplusplus)\n#define inline __inline\n#endif\n/* ssize_t is also not available (copy/paste from MinGW) */\n#ifndef _SSIZE_T_DEFINED\n#define _SSIZE_T_DEFINED\n#undef ssize_t\n#ifdef _WIN64\n  typedef __int64 ssize_t;\n#else\n  typedef int ssize_t;\n#endif /* _WIN64 */\n#endif /* _SSIZE_T_DEFINED */\n#endif /* _MSC_VER */\n\n/* stdint.h is not available on older MSVC */\n#if defined(_MSC_VER) && (_MSC_VER < 1600) && (!defined(_STDINT)) && (!defined(_STDINT_H))\ntypedef unsigned __int8   uint8_t;\ntypedef unsigned __int16  uint16_t;\ntypedef unsigned __int32  uint32_t;\n#else\n#include <stdint.h>\n#endif\n\n#if !defined(_WIN32_WCE)\n#include <sys/types.h>\n#endif\n\n#if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__)\n#include <sys/time.h>\n#endif\n\n#include <time.h>\n#include <limits.h>\n\n/* 'interface' might be defined as a macro on Windows, so we need to\n * undefine it so as not to break the current libusb API, because\n * libusb_config_descriptor has an 'interface' member\n * As this can be problematic if you include windows.h after libusb.h\n * in your sources, we force windows.h to be included first. */\n#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)\n#include <windows.h>\n#if defined(interface)\n#undef interface\n#endif\n#if !defined(__CYGWIN__)\n#include <winsock.h>\n#endif\n#endif\n\n#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)\n#define LIBUSB_DEPRECATED_FOR(f) \\\n  __attribute__((deprecated(\"Use \" #f \" instead\")))\n#else\n#define LIBUSB_DEPRECATED_FOR(f)\n#endif /* __GNUC__ */\n\n/** \\def LIBUSB_CALL\n * \\ingroup misc\n * libusb's Windows calling convention.\n *\n * Under Windows, the selection of available compilers and configurations\n * means that, unlike other platforms, there is not <em>one true calling\n * convention</em> (calling convention: the manner in which parameters are\n * passed to funcions in the generated assembly code).\n *\n * Matching the Windows API itself, libusb uses the WINAPI convention (which\n * translates to the <tt>stdcall</tt> convention) and guarantees that the\n * library is compiled in this way. The public header file also includes\n * appropriate annotations so that your own software will use the right\n * convention, even if another convention is being used by default within\n * your codebase.\n *\n * The one consideration that you must apply in your software is to mark\n * all functions which you use as libusb callbacks with this LIBUSB_CALL\n * annotation, so that they too get compiled for the correct calling\n * convention.\n *\n * On non-Windows operating systems, this macro is defined as nothing. This\n * means that you can apply it to your code without worrying about\n * cross-platform compatibility.\n */\n/* LIBUSB_CALL must be defined on both definition and declaration of libusb\n * functions. You'd think that declaration would be enough, but cygwin will\n * complain about conflicting types unless both are marked this way.\n * The placement of this macro is important too; it must appear after the\n * return type, before the function name. See internal documentation for\n * API_EXPORTED.\n */\n#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)\n#define LIBUSB_CALL WINAPI\n#else\n#define LIBUSB_CALL\n#endif\n\n/** \\def LIBUSB_API_VERSION\n * \\ingroup misc\n * libusb's API version.\n *\n * Since version 1.0.13, to help with feature detection, libusb defines\n * a LIBUSB_API_VERSION macro that gets increased every time there is a\n * significant change to the API, such as the introduction of a new call,\n * the definition of a new macro/enum member, or any other element that\n * libusb applications may want to detect at compilation time.\n *\n * The macro is typically used in an application as follows:\n * \\code\n * #if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01001234)\n * // Use one of the newer features from the libusb API\n * #endif\n * \\endcode\n *\n * Another feature of LIBUSB_API_VERSION is that it can be used to detect\n * whether you are compiling against the libusb or the libusb library.\n *\n * Internally, LIBUSB_API_VERSION is defined as follows:\n * (libusb major << 24) | (libusb minor << 16) | (16 bit incremental)\n */\n#define LIBUSB_API_VERSION 0x01000103\n\n/* The following is kept for compatibility, but will be deprecated in the future */\n#define LIBUSBX_API_VERSION LIBUSB_API_VERSION\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/**\n * \\ingroup misc\n * Convert a 16-bit value from host-endian to little-endian format. On\n * little endian systems, this function does nothing. On big endian systems,\n * the bytes are swapped.\n * \\param x the host-endian value to convert\n * \\returns the value in little-endian byte order\n */\nstatic inline uint16_t libusb_cpu_to_le16(const uint16_t x)\n{\n\tunion {\n\t\tuint8_t  b8[2];\n\t\tuint16_t b16;\n\t} _tmp;\n\t_tmp.b8[1] = (uint8_t) (x >> 8);\n\t_tmp.b8[0] = (uint8_t) (x & 0xff);\n\treturn _tmp.b16;\n}\n\n/** \\def libusb_le16_to_cpu\n * \\ingroup misc\n * Convert a 16-bit value from little-endian to host-endian format. On\n * little endian systems, this function does nothing. On big endian systems,\n * the bytes are swapped.\n * \\param x the little-endian value to convert\n * \\returns the value in host-endian byte order\n */\n#define libusb_le16_to_cpu libusb_cpu_to_le16\n\n/* standard USB stuff */\n\n/** \\ingroup desc\n * Device and/or Interface Class codes */\nenum libusb_class_code {\n\t/** In the context of a \\ref libusb_device_descriptor \"device descriptor\",\n\t * this bDeviceClass value indicates that each interface specifies its\n\t * own class information and all interfaces operate independently.\n\t */\n\tLIBUSB_CLASS_PER_INTERFACE = 0,\n\n\t/** Audio class */\n\tLIBUSB_CLASS_AUDIO = 1,\n\n\t/** Communications class */\n\tLIBUSB_CLASS_COMM = 2,\n\n\t/** Human Interface Device class */\n\tLIBUSB_CLASS_HID = 3,\n\n\t/** Physical */\n\tLIBUSB_CLASS_PHYSICAL = 5,\n\n\t/** Image class */\n\tLIBUSB_CLASS_PTP = 6, /* legacy name from libusb-0.1 usb.h */\n\tLIBUSB_CLASS_IMAGE = 6,\n\n\t/** Printer class */\n\tLIBUSB_CLASS_PRINTER = 7,\n\n\t/** Mass storage class */\n\tLIBUSB_CLASS_MASS_STORAGE = 8,\n\n\t/** Hub class */\n\tLIBUSB_CLASS_HUB = 9,\n\n\t/** Data class */\n\tLIBUSB_CLASS_DATA = 10,\n\n\t/** Smart Card */\n\tLIBUSB_CLASS_SMART_CARD = 0x0b,\n\n\t/** Content Security */\n\tLIBUSB_CLASS_CONTENT_SECURITY = 0x0d,\n\n\t/** Video */\n\tLIBUSB_CLASS_VIDEO = 0x0e,\n\n\t/** Personal Healthcare */\n\tLIBUSB_CLASS_PERSONAL_HEALTHCARE = 0x0f,\n\n\t/** Diagnostic Device */\n\tLIBUSB_CLASS_DIAGNOSTIC_DEVICE = 0xdc,\n\n\t/** Wireless class */\n\tLIBUSB_CLASS_WIRELESS = 0xe0,\n\n\t/** Application class */\n\tLIBUSB_CLASS_APPLICATION = 0xfe,\n\n\t/** Class is vendor-specific */\n\tLIBUSB_CLASS_VENDOR_SPEC = 0xff\n};\n\n/** \\ingroup desc\n * Descriptor types as defined by the USB specification. */\nenum libusb_descriptor_type {\n\t/** Device descriptor. See libusb_device_descriptor. */\n\tLIBUSB_DT_DEVICE = 0x01,\n\n\t/** Configuration descriptor. See libusb_config_descriptor. */\n\tLIBUSB_DT_CONFIG = 0x02,\n\n\t/** String descriptor */\n\tLIBUSB_DT_STRING = 0x03,\n\n\t/** Interface descriptor. See libusb_interface_descriptor. */\n\tLIBUSB_DT_INTERFACE = 0x04,\n\n\t/** Endpoint descriptor. See libusb_endpoint_descriptor. */\n\tLIBUSB_DT_ENDPOINT = 0x05,\n\n\t/** XXX */\n\tLIBUSB_DT_DEVICE_QUALIFIER = 0x06,\t\t\t\t// deprecated on USB3.0\n\n\t/** XXX */\n\tLIBUSB_DT_OTHER_SPEED_CONFIGURATION = 0x07,\t\t// deprecated on USB3.0\n\n\t/** XXX */\n\tLIBUSB_DT_INTERFACE_POWER = 0x08,\n\n\t/** XXX */\n\tLIBUSB_DT_OTG = 0x09,\n\n\t/** XXX */\n\tLIBUSB_DT_DEBUG = 0x0a,\n\n\t/** XXX Interface Association descriptor(IAD) See libusb_association_descriptor */\n\tLIBUSB_DT_ASSOCIATION = 0x0b,\n\n\t/** BOS descriptor */\n\tLIBUSB_DT_BOS = 0x0f,\n\n\t/** Device Capability descriptor */\n\tLIBUSB_DT_DEVICE_CAPABILITY = 0x10,\n// Class specified descriptors\n\t/** HID descriptor */\n\tLIBUSB_DT_HID = 0x21,\n\n\t/** HID report descriptor */\n\tLIBUSB_DT_HID_REPORT = 0x22,\n\n\t/** Physical descriptor */\n\tLIBUSB_DT_HID_PHYSICAL = 0x23,\n\n\t/* Class specific interface descriptor */\n\tLIBUSB_DT_CS_INTERFACE = 0x24,\n\n\t/* Class specific endpoint descriptor */\n\tLIBUSB_DT_CS_ENDPOINT = 0x25,\n\n\t/** Hub descriptor */\n\tLIBUSB_DT_HUB = 0x29,\n\n\t/** SuperSpeed Hub descriptor */\n\tLIBUSB_DT_SUPERSPEED_HUB = 0x2a,\n\n\t/** SuperSpeed Endpoint Companion descriptor */\n\tLIBUSB_DT_SS_ENDPOINT_COMPANION = 0x30\t\t// defined on USB 3.0\n};\n\n/* Descriptor sizes per descriptor type */\n#define LIBUSB_DT_HEADER_SIZE\t\t\t\t\t2\t// XXX\n#define LIBUSB_DT_DEVICE_SIZE\t\t\t\t\t18\n#define LIBUSB_DT_CONFIG_SIZE\t\t\t\t\t9\n#define LIBUSB_DT_INTERFACE_SIZE\t\t\t\t9\n#define LIBUSB_DT_ENDPOINT_SIZE\t\t\t\t\t7\n#define LIBUSB_DT_ENDPOINT_AUDIO_SIZE\t\t\t9\t/* Audio extension */\n#define LIBUSB_DT_HUB_NONVAR_SIZE\t\t\t\t7\n#define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE\t6\n#define LIBUSB_DT_BOS_SIZE\t\t\t\t\t\t5\n#define LIBUSB_DT_DEVICE_CAPABILITY_SIZE\t\t3\n#define LIBUSB_DT_QUALIFER_SIZE\t\t\t\t\t10\t// XXX\n#define LIBUSB_DT_OTHER_SPEED_SIZE\t\t\t\t9\t// XXX\n#define LIBUSB_DT_ASSOCIATION_SIZE\t\t\t\t8\t// XXX add to support IAD\n\n/* BOS descriptor sizes */\n#define LIBUSB_BT_USB_2_0_EXTENSION_SIZE\t\t7\n#define LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE\t10\n#define LIBUSB_BT_CONTAINER_ID_SIZE\t\t\t\t20\n\n/* We unwrap the BOS => define its max size */\n#define LIBUSB_DT_BOS_MAX_SIZE\t\t((LIBUSB_DT_BOS_SIZE)     +\\\n\t\t\t\t\t(LIBUSB_BT_USB_2_0_EXTENSION_SIZE)       +\\\n\t\t\t\t\t(LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE) +\\\n\t\t\t\t\t(LIBUSB_BT_CONTAINER_ID_SIZE))\n\n#define LIBUSB_ENDPOINT_ADDRESS_MASK\t0x0f    /* in bEndpointAddress */\n#define LIBUSB_ENDPOINT_DIR_MASK\t\t0x80\n\n/** \\ingroup desc\n * Endpoint direction. Values for bit 7 of the\n * \\ref libusb_endpoint_descriptor::bEndpointAddress \"endpoint address\" scheme.\n */\nenum libusb_endpoint_direction {\n\t/** In: device-to-host */\n\tLIBUSB_ENDPOINT_IN = 0x80,\n\n\t/** Out: host-to-device */\n\tLIBUSB_ENDPOINT_OUT = 0x00\n};\n\n#define LIBUSB_TRANSFER_TYPE_MASK\t\t\t0x03    /* in bmAttributes */\n\n/** \\ingroup desc\n * Endpoint transfer type. Values for bits 0:1 of the\n * \\ref libusb_endpoint_descriptor::bmAttributes \"endpoint attributes\" field.\n */\nenum libusb_transfer_type {\n\t/** Control endpoint */\n\tLIBUSB_TRANSFER_TYPE_CONTROL = 0,\n\n\t/** Isochronous endpoint */\n\tLIBUSB_TRANSFER_TYPE_ISOCHRONOUS = 1,\n\n\t/** Bulk endpoint */\n\tLIBUSB_TRANSFER_TYPE_BULK = 2,\n\n\t/** Interrupt endpoint */\n\tLIBUSB_TRANSFER_TYPE_INTERRUPT = 3,\n\n\t/** Stream endpoint */\n\tLIBUSB_TRANSFER_TYPE_BULK_STREAM = 4,\n};\n\n/** \\ingroup misc\n * Standard requests, as defined in table 9-5 of the USB 3.0 specifications */\nenum libusb_standard_request {\n\t/** Request status of the specific recipient */\n\tLIBUSB_REQUEST_GET_STATUS = 0x00,\n\n\t/** Clear or disable a specific feature */\n\tLIBUSB_REQUEST_CLEAR_FEATURE = 0x01,\n\n\t/* 0x02 is reserved */\n\n\t/** Set or enable a specific feature */\n\tLIBUSB_REQUEST_SET_FEATURE = 0x03,\n\n\t/* 0x04 is reserved */\n\n\t/** Set device address for all future accesses */\n\tLIBUSB_REQUEST_SET_ADDRESS = 0x05,\n\n\t/** Get the specified descriptor */\n\tLIBUSB_REQUEST_GET_DESCRIPTOR = 0x06,\n\n\t/** Used to update existing descriptors or add new descriptors */\n\tLIBUSB_REQUEST_SET_DESCRIPTOR = 0x07,\n\n\t/** Get the current device configuration value */\n\tLIBUSB_REQUEST_GET_CONFIGURATION = 0x08,\n\n\t/** Set device configuration */\n\tLIBUSB_REQUEST_SET_CONFIGURATION = 0x09,\n\n\t/** Return the selected alternate setting for the specified interface */\n\tLIBUSB_REQUEST_GET_INTERFACE = 0x0A,\n\n\t/** Select an alternate interface for the specified interface */\n\tLIBUSB_REQUEST_SET_INTERFACE = 0x0B,\n\n\t/** Set then report an endpoint's synchronization frame */\n\tLIBUSB_REQUEST_SYNCH_FRAME = 0x0C,\n\n\t/** Sets both the U1 and U2 Exit Latency */\n\tLIBUSB_REQUEST_SET_SEL = 0x30,\n\n\t/** Delay from the time a host transmits a packet to the time it is\n\t  * received by the device. */\n\tLIBUSB_SET_ISOCH_DELAY = 0x31,\n};\n\n/** \\ingroup misc\n * Request type bits of the\n * \\ref libusb_control_setup::bmRequestType \"bmRequestType\" field in control\n * transfers. */\nenum libusb_request_type {\n\t/** Standard */\n\tLIBUSB_REQUEST_TYPE_STANDARD = (0x00 << 5),\n\n\t/** Class */\n\tLIBUSB_REQUEST_TYPE_CLASS = (0x01 << 5),\n\n\t/** Vendor */\n\tLIBUSB_REQUEST_TYPE_VENDOR = (0x02 << 5),\n\n\t/** Reserved */\n\tLIBUSB_REQUEST_TYPE_RESERVED = (0x03 << 5)\n};\n\n/** \\ingroup misc\n * Recipient bits of the\n * \\ref libusb_control_setup::bmRequestType \"bmRequestType\" field in control\n * transfers. Values 4 through 31 are reserved. */\nenum libusb_request_recipient {\n\t/** Device */\n\tLIBUSB_RECIPIENT_DEVICE = 0x00,\n\n\t/** Interface */\n\tLIBUSB_RECIPIENT_INTERFACE = 0x01,\n\n\t/** Endpoint */\n\tLIBUSB_RECIPIENT_ENDPOINT = 0x02,\n\n\t/** Other */\n\tLIBUSB_RECIPIENT_OTHER = 0x03,\n};\n\n#define LIBUSB_ISO_SYNC_TYPE_MASK\t\t0x0C\n\n/** \\ingroup desc\n * Synchronization type for isochronous endpoints. Values for bits 2:3 of the\n * \\ref libusb_endpoint_descriptor::bmAttributes \"bmAttributes\" field in\n * libusb_endpoint_descriptor.\n */\nenum libusb_iso_sync_type {\n\t/** No synchronization */\n\tLIBUSB_ISO_SYNC_TYPE_NONE = 0,\n\n\t/** Asynchronous */\n\tLIBUSB_ISO_SYNC_TYPE_ASYNC = 1,\n\n\t/** Adaptive */\n\tLIBUSB_ISO_SYNC_TYPE_ADAPTIVE = 2,\n\n\t/** Synchronous */\n\tLIBUSB_ISO_SYNC_TYPE_SYNC = 3\n};\n\n#define LIBUSB_ISO_USAGE_TYPE_MASK 0x30\n\n/** \\ingroup desc\n * Usage type for isochronous endpoints. Values for bits 4:5 of the\n * \\ref libusb_endpoint_descriptor::bmAttributes \"bmAttributes\" field in\n * libusb_endpoint_descriptor.\n */\nenum libusb_iso_usage_type {\n\t/** Data endpoint */\n\tLIBUSB_ISO_USAGE_TYPE_DATA = 0,\n\n\t/** Feedback endpoint */\n\tLIBUSB_ISO_USAGE_TYPE_FEEDBACK = 1,\n\n\t/** Implicit feedback Data endpoint */\n\tLIBUSB_ISO_USAGE_TYPE_IMPLICIT = 2,\n};\n\n/** \\ingroup desc\n * A structure representing the standard USB device descriptor. This\n * descriptor is documented in section 9.6.1 of the USB 3.0 specification.\n * All multiple-byte fields are represented in host-endian format.\n */\nstruct libusb_device_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_DEVICE LIBUSB_DT_DEVICE in this\n\t * context. */\n\tuint8_t  bDescriptorType;\n\n\t/** USB specification release number in binary-coded decimal. A value of\n\t * 0x0200 indicates USB 2.0, 0x0110 indicates USB 1.1, etc. */\n\tuint16_t bcdUSB;\n\n\t/** USB-IF class code for the device. See \\ref libusb_class_code. */\n\tuint8_t  bDeviceClass;\n\n\t/** USB-IF subclass code for the device, qualified by the bDeviceClass\n\t * value */\n\tuint8_t  bDeviceSubClass;\n\n\t/** USB-IF protocol code for the device, qualified by the bDeviceClass and\n\t * bDeviceSubClass values */\n\tuint8_t  bDeviceProtocol;\n\n\t/** Maximum packet size for endpoint 0 */\n\tuint8_t  bMaxPacketSize0;\n\n\t/** USB-IF vendor ID */\n\tuint16_t idVendor;\n\n\t/** USB-IF product ID */\n\tuint16_t idProduct;\n\n\t/** Device release number in binary-coded decimal */\n\tuint16_t bcdDevice;\n\n\t/** Index of string descriptor describing manufacturer */\n\tuint8_t  iManufacturer;\n\n\t/** Index of string descriptor describing product */\n\tuint8_t  iProduct;\n\n\t/** Index of string descriptor containing device serial number */\n\tuint8_t  iSerialNumber;\n\n\t/** Number of possible configurations */\n\tuint8_t  bNumConfigurations;\n};\n\n/** \\ingroup desc\n * A structure representing the standard USB endpoint descriptor. This\n * descriptor is documented in section 9.6.6 of the USB 3.0 specification.\n * All multiple-byte fields are represented in host-endian format.\n */\nstruct libusb_endpoint_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_ENDPOINT LIBUSB_DT_ENDPOINT in\n\t * this context. */\n\tuint8_t  bDescriptorType;\n\n\t/** The address of the endpoint described by this descriptor. Bits 0:3 are\n\t * the endpoint number. Bits 4:6 are reserved. Bit 7 indicates direction,\n\t * see \\ref libusb_endpoint_direction.\n\t */\n\tuint8_t  bEndpointAddress;\n\n\t/** Attributes which apply to the endpoint when it is configured using\n\t * the bConfigurationValue. Bits 0:1 determine the transfer type and\n\t * correspond to \\ref libusb_transfer_type. Bits 2:3 are only used for\n\t * isochronous endpoints and correspond to \\ref libusb_iso_sync_type.\n\t * Bits 4:5 are also only used for isochronous endpoints and correspond to\n\t * \\ref libusb_iso_usage_type. Bits 6:7 are reserved.\n\t */\n\tuint8_t  bmAttributes;\n\n\t/** Maximum packet size this endpoint is capable of sending/receiving. */\n\tuint16_t wMaxPacketSize;\n\n\t/** Interval for polling endpoint for data transfers. */\n\tuint8_t  bInterval;\n\n\t/** For audio devices only: the rate at which synchronization feedback\n\t * is provided. */\n\tuint8_t  bRefresh;\n\n\t/** For audio devices only: the address if the synch endpoint */\n\tuint8_t  bSynchAddress;\n\n\t/** Extra descriptors. If libusb encounters unknown endpoint descriptors,\n\t * it will store them here, should you wish to parse them. */\n\tconst unsigned char *extra;\n\n\t/** Length of the extra descriptors, in bytes. */\n\tint extra_length;\n};\n\n/** \\ingroup desc\n * A structure representing the standard USB interface descriptor. This\n * descriptor is documented in section 9.6.5 of the USB 3.0 specification.\n * All multiple-byte fields are represented in host-endian format.\n */\nstruct libusb_interface_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_INTERFACE LIBUSB_DT_INTERFACE\n\t * in this context. */\n\tuint8_t  bDescriptorType;\n\n\t/** Number of this interface */\n\tuint8_t  bInterfaceNumber;\n\n\t/** Value used to select this alternate setting for this interface */\n\tuint8_t  bAlternateSetting;\n\n\t/** Number of endpoints used by this interface (excluding the control\n\t * endpoint). */\n\tuint8_t  bNumEndpoints;\n\n\t/** USB-IF class code for this interface. See \\ref libusb_class_code. */\n\tuint8_t  bInterfaceClass;\n\n\t/** USB-IF subclass code for this interface, qualified by the\n\t * bInterfaceClass value */\n\tuint8_t  bInterfaceSubClass;\n\n\t/** USB-IF protocol code for this interface, qualified by the\n\t * bInterfaceClass and bInterfaceSubClass values */\n\tuint8_t  bInterfaceProtocol;\n\n\t/** Index of string descriptor describing this interface */\n\tuint8_t  iInterface;\n\n\t/** Array of endpoint descriptors. This length of this array is determined\n\t * by the bNumEndpoints field. */\n\tconst struct libusb_endpoint_descriptor *endpoint;\n\n\t/** Extra descriptors. If libusb encounters unknown interface descriptors,\n\t * it will store them here, should you wish to parse them. */\n\tconst unsigned char *extra;\n\n\t/** Length of the extra descriptors, in bytes. */\n\tint extra_length;\n};\n\n/** \\ingroup desc\n * A collection of alternate settings for a particular USB interface.\n */\nstruct libusb_interface {\n\t/** Array of interface descriptors. The length of this array is determined\n\t * by the num_altsetting field. */\n\tconst struct libusb_interface_descriptor *altsetting;\n\n\t/** The number of alternate settings that belong to this interface */\n\tint num_altsetting;\n};\n\n/** \\ingroup desc\n * A structure representing the Interface Association descriptor(IAD).\n */\nstruct libusb_association_descriptor {\t// XXX added to support composit device\n\tuint8_t \tbLength;\t\t\t// Size of this descriptor (in bytes)\n\tuint8_t \tbDescriptorType;\t// Descriptor type(LIBUSB_DT_ASSOCIATION)\n\tuint8_t \tbFirstInterface;\t// First interface number of the set of interfaces that follow this descriptor.\n\tuint8_t \tbInterfaceCount;\t// The Number of interfaces follow this descriptor that are considered \"associated\".\n\tuint8_t \tbFunctionClass;\t\t// bInterfaceClass used for this associated interfaces\n\tuint8_t \tbFunctionSubClass;\t// bInterfaceSubClass used for the associated interfaces\n\tuint8_t \tbFunctionProtocol;\t// bInterfaceProtocol used for the associated interfaces\n\tuint8_t \tiFunction;\t\t\t// Index of string descriptor describing the associated interfaces.\n\n\t/** Extra descriptors. If libusb encounters unknown configuration\n\t * descriptors, it will store them here, should you wish to parse them. */\n\tconst unsigned char *extra;\n\n\t/** Length of the extra descriptors, in bytes. */\n\tint extra_length;\n};\n\n/** \\ingroup desc\n * A structure representing the standard USB configuration descriptor. This\n * descriptor is documented in section 9.6.3 of the USB 3.0 specification.\n * All multiple-byte fields are represented in host-endian format.\n */\nstruct libusb_config_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_CONFIG LIBUSB_DT_CONFIG\n\t * in this context. */\n\tuint8_t  bDescriptorType;\n\n\t/** Total length of data returned for this configuration */\n\tuint16_t wTotalLength;\n\n\t/** Number of interfaces supported by this configuration */\n\tuint8_t  bNumInterfaces;\n\n\t/** Identifier value for this configuration */\n\tuint8_t  bConfigurationValue;\n\n\t/** Index of string descriptor describing this configuration */\n\tuint8_t  iConfiguration;\n\n\t/** Configuration characteristics */\n\tuint8_t  bmAttributes;\n\n\t/** Maximum power consumption of the USB device from this bus in this\n\t * configuration when the device is fully opreation. Expressed in units\n\t * of 2 mA. */\n\tuint8_t  MaxPower;\n\n\t/** Array of interfaces supported by this configuration. The length of\n\t * this array is determined by the bNumInterfaces field. */\n\tconst struct libusb_interface *interface;\n\n\t/** Single link list of interface association descriptors related to this configuration.\n\t * The length of this list is determined by the num_associations field. */\n\tstruct libusb_association_descriptor *association_descriptor;\n\tuint8_t num_associations;\n\tuint8_t selected_iad;\n\n\t/** Extra descriptors. If libusb encounters unknown configuration\n\t * descriptors, it will store them here, should you wish to parse them. */\n\tconst unsigned char *extra;\n\n\t/** Length of the extra descriptors, in bytes. */\n\tint extra_length;\n};\n\n/** \\ingroup desc\n * A structure representing the superspeed endpoint companion\n * descriptor. This descriptor is documented in section 9.6.7 of\n * the USB 3.0 specification. All multiple-byte fields are represented in\n * host-endian format.\n */\nstruct libusb_ss_endpoint_companion_descriptor {\n\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_SS_ENDPOINT_COMPANION in\n\t * this context. */\n\tuint8_t  bDescriptorType;\n\n\n\t/** The maximum number of packets the endpoint can send or\n\t *  recieve as part of a burst. */\n\tuint8_t  bMaxBurst;\n\n\t/** In bulk EP:\tbits 4:0 represents the\tmaximum\tnumber of\n\t *  streams the\tEP supports. In\tisochronous EP:\tbits 1:0\n\t *  represents the Mult\t- a zero based value that determines\n\t *  the\tmaximum\tnumber of packets within a service interval  */\n\tuint8_t  bmAttributes;\n\n\t/** The\ttotal number of bytes this EP will transfer every\n\t *  service interval. valid only for periodic EPs. */\n\tuint16_t wBytesPerInterval;\n};\n\n/** \\ingroup desc\n * A generic representation of a BOS Device Capability descriptor. It is\n * advised to check bDevCapabilityType and call the matching\n * libusb_get_*_descriptor function to get a structure fully matching the type.\n */\nstruct libusb_bos_dev_capability_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t bLength;\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY\n\t * LIBUSB_DT_DEVICE_CAPABILITY in this context. */\n\tuint8_t bDescriptorType;\n\t/** Device Capability type */\n\tuint8_t bDevCapabilityType;\n\t/** Device Capability data (bLength - 3 bytes) */\n\tuint8_t dev_capability_data\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)\n\t[] /* valid C99 code */\n#else\n\t[0] /* non-standard, but usually working code */\n#endif\n\t;\n};\n\n/** \\ingroup desc\n * A structure representing the Binary Device Object Store (BOS) descriptor.\n * This descriptor is documented in section 9.6.2 of the USB 3.0 specification.\n * All multiple-byte fields are represented in host-endian format.\n */\nstruct libusb_bos_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_BOS LIBUSB_DT_BOS\n\t * in this context. */\n\tuint8_t  bDescriptorType;\n\n\t/** Length of this descriptor and all of its sub descriptors */\n\tuint16_t wTotalLength;\n\n\t/** The number of separate device capability descriptors in\n\t * the BOS */\n\tuint8_t  bNumDeviceCaps;\n\n\t/** bNumDeviceCap Device Capability Descriptors */\n\tstruct libusb_bos_dev_capability_descriptor *dev_capability\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)\n\t[] /* valid C99 code */\n#else\n\t[0] /* non-standard, but usually working code */\n#endif\n\t;\n};\n\n/** \\ingroup desc\n * A structure representing the USB 2.0 Extension descriptor\n * This descriptor is documented in section 9.6.2.1 of the USB 3.0 specification.\n * All multiple-byte fields are represented in host-endian format.\n */\nstruct libusb_usb_2_0_extension_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY\n\t * LIBUSB_DT_DEVICE_CAPABILITY in this context. */\n\tuint8_t  bDescriptorType;\n\n\t/** Capability type. Will have value\n\t * \\ref libusb_capability_type::LIBUSB_BT_USB_2_0_EXTENSION\n\t * LIBUSB_BT_USB_2_0_EXTENSION in this context. */\n\tuint8_t  bDevCapabilityType;\n\n\t/** Bitmap encoding of supported device level features.\n\t * A value of one in a bit location indicates a feature is\n\t * supported; a value of zero indicates it is not supported.\n\t * See \\ref libusb_usb_2_0_extension_attributes. */\n\tuint32_t  bmAttributes;\n};\n\n/** \\ingroup desc\n * A structure representing the SuperSpeed USB Device Capability descriptor\n * This descriptor is documented in section 9.6.2.2 of the USB 3.0 specification.\n * All multiple-byte fields are represented in host-endian format.\n */\nstruct libusb_ss_usb_device_capability_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY\n\t * LIBUSB_DT_DEVICE_CAPABILITY in this context. */\n\tuint8_t  bDescriptorType;\n\n\t/** Capability type. Will have value\n\t * \\ref libusb_capability_type::LIBUSB_BT_SS_USB_DEVICE_CAPABILITY\n\t * LIBUSB_BT_SS_USB_DEVICE_CAPABILITY in this context. */\n\tuint8_t  bDevCapabilityType;\n\n\t/** Bitmap encoding of supported device level features.\n\t * A value of one in a bit location indicates a feature is\n\t * supported; a value of zero indicates it is not supported.\n\t * See \\ref libusb_ss_usb_device_capability_attributes. */\n\tuint8_t  bmAttributes;\n\n\t/** Bitmap encoding of the speed supported by this device when\n\t * operating in SuperSpeed mode. See \\ref libusb_supported_speed. */\n\tuint16_t wSpeedSupported;\n\n\t/** The lowest speed at which all the functionality supported\n\t * by the device is available to the user. For example if the\n\t * device supports all its functionality when connected at\n\t * full speed and above then it sets this value to 1. */\n\tuint8_t  bFunctionalitySupport;\n\n\t/** U1 Device Exit Latency. */\n\tuint8_t  bU1DevExitLat;\n\n\t/** U2 Device Exit Latency. */\n\tuint16_t bU2DevExitLat;\n};\n\n/** \\ingroup desc\n * A structure representing the Container ID descriptor.\n * This descriptor is documented in section 9.6.2.3 of the USB 3.0 specification.\n * All multiple-byte fields, except UUIDs, are represented in host-endian format.\n */\nstruct libusb_container_id_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY\n\t * LIBUSB_DT_DEVICE_CAPABILITY in this context. */\n\tuint8_t  bDescriptorType;\n\n\t/** Capability type. Will have value\n\t * \\ref libusb_capability_type::LIBUSB_BT_CONTAINER_ID\n\t * LIBUSB_BT_CONTAINER_ID in this context. */\n\tuint8_t  bDevCapabilityType;\n\n\t/** Reserved field */\n\tuint8_t bReserved;\n\n\t/** 128 bit UUID */\n\tuint8_t  ContainerID[16];\n};\n\n/** \\ingroup asyncio\n * Setup packet for control transfers. */\nstruct libusb_control_setup {\n\t/** Request type. Bits 0:4 determine recipient, see\n\t * \\ref libusb_request_recipient. Bits 5:6 determine type, see\n\t * \\ref libusb_request_type. Bit 7 determines data transfer direction, see\n\t * \\ref libusb_endpoint_direction.\n\t */\n\tuint8_t  bmRequestType;\n\n\t/** Request. If the type bits of bmRequestType are equal to\n\t * \\ref libusb_request_type::LIBUSB_REQUEST_TYPE_STANDARD\n\t * \"LIBUSB_REQUEST_TYPE_STANDARD\" then this field refers to\n\t * \\ref libusb_standard_request. For other cases, use of this field is\n\t * application-specific. */\n\tuint8_t  bRequest;\n\n\t/** Value. Varies according to request */\n\tuint16_t wValue;\n\n\t/** Index. Varies according to request, typically used to pass an index\n\t * or offset */\n\tuint16_t wIndex;\n\n\t/** Number of bytes to transfer */\n\tuint16_t wLength;\n};\n\n#define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup))\n\n/* libusb */\n\nstruct libusb_context;\nstruct libusb_device;\nstruct libusb_device_handle;\nstruct libusb_hotplug_callback;\n\n/** \\ingroup lib\n * Structure providing the version of the libusb runtime\n */\nstruct libusb_version {\n\t/** Library major version. */\n\tconst uint16_t major;\n\n\t/** Library minor version. */\n\tconst uint16_t minor;\n\n\t/** Library micro version. */\n\tconst uint16_t micro;\n\n\t/** Library nano version. */\n\tconst uint16_t nano;\n\n\t/** Library release candidate suffix string, e.g. \"-rc4\". */\n\tconst char *rc;\n\n\t/** For ABI compatibility only. */\n\tconst char* describe;\n};\n\n/** \\ingroup lib\n * Structure representing a libusb session. The concept of individual libusb\n * sessions allows for your program to use two libraries (or dynamically\n * load two modules) which both independently use libusb. This will prevent\n * interference between the individual libusb users - for example\n * libusb_set_debug() will not affect the other user of the library, and\n * libusb_exit() will not destroy resources that the other user is still\n * using.\n *\n * Sessions are created by libusb_init() and destroyed through libusb_exit().\n * If your application is guaranteed to only ever include a single libusb\n * user (i.e. you), you do not have to worry about contexts: pass NULL in\n * every function call where a context is required. The default context\n * will be used.\n *\n * For more information, see \\ref contexts.\n */\ntypedef struct libusb_context libusb_context;\n\n/** \\ingroup dev\n * Structure representing a USB device detected on the system. This is an\n * opaque type for which you are only ever provided with a pointer, usually\n * originating from libusb_get_device_list().\n *\n * Certain operations can be performed on a device, but in order to do any\n * I/O you will have to first obtain a device handle using libusb_open().\n *\n * Devices are reference counted with libusb_ref_device() and\n * libusb_unref_device(), and are freed when the reference count reaches 0.\n * New devices presented by libusb_get_device_list() have a reference count of\n * 1, and libusb_free_device_list() can optionally decrease the reference count\n * on all devices in the list. libusb_open() adds another reference which is\n * later destroyed by libusb_close().\n */\ntypedef struct libusb_device libusb_device;\n\n\n/** \\ingroup dev\n * Structure representing a handle on a USB device. This is an opaque type for\n * which you are only ever provided with a pointer, usually originating from\n * libusb_open().\n *\n * A device handle is used to perform I/O and other operations. When finished\n * with a device handle, you should call libusb_close().\n */\ntypedef struct libusb_device_handle libusb_device_handle;\n\n/** \\ingroup dev\n * Speed codes. Indicates the speed at which the device is operating.\n */\nenum libusb_speed {\n\t/** The OS doesn't report or know the device speed. */\n\tLIBUSB_SPEED_UNKNOWN = 0,\n\n\t/** The device is operating at low speed (1.5MBit/s). */\n\tLIBUSB_SPEED_LOW = 1,\n\n\t/** The device is operating at full speed (12MBit/s). */\n\tLIBUSB_SPEED_FULL = 2,\n\n\t/** The device is operating at high speed (480MBit/s). */\n\tLIBUSB_SPEED_HIGH = 3,\n\n\t/** The device is operating at super speed (5000MBit/s). */\n\tLIBUSB_SPEED_SUPER = 4,\n};\n\n/** \\ingroup dev\n * Supported speeds (wSpeedSupported) bitfield. Indicates what\n * speeds the device supports.\n */\nenum libusb_supported_speed {\n\t/** Low speed operation supported (1.5MBit/s). */\n\tLIBUSB_LOW_SPEED_OPERATION   = 1,\n\n\t/** Full speed operation supported (12MBit/s). */\n\tLIBUSB_FULL_SPEED_OPERATION  = 2,\n\n\t/** High speed operation supported (480MBit/s). */\n\tLIBUSB_HIGH_SPEED_OPERATION  = 4,\n\n\t/** Superspeed operation supported (5000MBit/s). */\n\tLIBUSB_SUPER_SPEED_OPERATION = 8,\n};\n\n/** \\ingroup dev\n * Masks for the bits of the\n * \\ref libusb_usb_2_0_extension_descriptor::bmAttributes \"bmAttributes\" field\n * of the USB 2.0 Extension descriptor.\n */\nenum libusb_usb_2_0_extension_attributes {\n\t/** Supports Link Power Management (LPM) */\n\tLIBUSB_BM_LPM_SUPPORT = 2,\n};\n\n/** \\ingroup dev\n * Masks for the bits of the\n * \\ref libusb_ss_usb_device_capability_descriptor::bmAttributes \"bmAttributes\" field\n * field of the SuperSpeed USB Device Capability descriptor.\n */\nenum libusb_ss_usb_device_capability_attributes {\n\t/** Supports Latency Tolerance Messages (LTM) */\n\tLIBUSB_BM_LTM_SUPPORT = 2,\n};\n\n/** \\ingroup dev\n * USB capability types\n */\nenum libusb_bos_type {\n\t/** Wireless USB device capability */\n\tLIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY\t= 1,\n\n\t/** USB 2.0 extensions */\n\tLIBUSB_BT_USB_2_0_EXTENSION\t\t\t= 2,\n\n\t/** SuperSpeed USB device capability */\n\tLIBUSB_BT_SS_USB_DEVICE_CAPABILITY\t\t= 3,\n\n\t/** Container ID type */\n\tLIBUSB_BT_CONTAINER_ID\t\t\t\t= 4,\n};\n\n/** \\ingroup misc\n * Error codes. Most libusb functions return 0 on success or one of these\n * codes on failure.\n * You can call libusb_error_name() to retrieve a string representation of an\n * error code or libusb_strerror() to get an end-user suitable description of\n * an error code.\n */\nenum libusb_error {\n\t/** Success (no error) */\n\tLIBUSB_SUCCESS = 0,\n\n\t/** Input/output error */\n\tLIBUSB_ERROR_IO = -1,\n\n\t/** Invalid parameter */\n\tLIBUSB_ERROR_INVALID_PARAM = -2,\n\n\t/** Access denied (insufficient permissions) */\n\tLIBUSB_ERROR_ACCESS = -3,\n\n\t/** No such device (it may have been disconnected) */\n\tLIBUSB_ERROR_NO_DEVICE = -4,\n\n\t/** Entity not found */\n\tLIBUSB_ERROR_NOT_FOUND = -5,\n\n\t/** Resource busy */\n\tLIBUSB_ERROR_BUSY = -6,\n\n\t/** Operation timed out */\n\tLIBUSB_ERROR_TIMEOUT = -7,\n\n\t/** Overflow */\n\tLIBUSB_ERROR_OVERFLOW = -8,\n\n\t/** Pipe error */\n\tLIBUSB_ERROR_PIPE = -9,\n\n\t/** System call interrupted (perhaps due to signal) */\n\tLIBUSB_ERROR_INTERRUPTED = -10,\n\n\t/** Insufficient memory */\n\tLIBUSB_ERROR_NO_MEM = -11,\n\n\t/** Operation not supported or unimplemented on this platform */\n\tLIBUSB_ERROR_NOT_SUPPORTED = -12,\n\n\t/* NB: Remember to update LIBUSB_ERROR_COUNT below as well as the\n\t   message strings in strerror.c when adding new error codes here. */\n\n\t/** Other error */\n\tLIBUSB_ERROR_OTHER = -99,\n};\n\n/* Total number of error codes in enum libusb_error */\n#define LIBUSB_ERROR_COUNT 14\n\n/** \\ingroup asyncio\n * Transfer status codes */\nenum libusb_transfer_status {\n\t/** Transfer completed without error. Note that this does not indicate\n\t * that the entire amount of requested data was transferred. */\n\tLIBUSB_TRANSFER_COMPLETED,\n\n\t/** Transfer failed */\n\tLIBUSB_TRANSFER_ERROR,\n\n\t/** Transfer timed out */\n\tLIBUSB_TRANSFER_TIMED_OUT,\n\n\t/** Transfer was cancelled */\n\tLIBUSB_TRANSFER_CANCELLED,\n\n\t/** For bulk/interrupt endpoints: halt condition detected (endpoint\n\t * stalled). For control endpoints: control request not supported. */\n\tLIBUSB_TRANSFER_STALL,\n\n\t/** Device was disconnected */\n\tLIBUSB_TRANSFER_NO_DEVICE,\n\n\t/** Device sent more data than requested */\n\tLIBUSB_TRANSFER_OVERFLOW,\n\n\t/* NB! Remember to update libusb_error_name()\n\t   when adding new status codes here. */\n};\n\n/** \\ingroup asyncio\n * libusb_transfer.flags values */\nenum libusb_transfer_flags {\n\t/** Report short frames as errors */\n\tLIBUSB_TRANSFER_SHORT_NOT_OK = 1<<0,\n\n\t/** Automatically free() transfer buffer during libusb_free_transfer() */\n\tLIBUSB_TRANSFER_FREE_BUFFER = 1<<1,\n\n\t/** Automatically call libusb_free_transfer() after callback returns.\n\t * If this flag is set, it is illegal to call libusb_free_transfer()\n\t * from your transfer callback, as this will result in a double-free\n\t * when this flag is acted upon. */\n\tLIBUSB_TRANSFER_FREE_TRANSFER = 1<<2,\n\n\t/** Terminate transfers that are a multiple of the endpoint's\n\t * wMaxPacketSize with an extra zero length packet. This is useful\n\t * when a device protocol mandates that each logical request is\n\t * terminated by an incomplete packet (i.e. the logical requests are\n\t * not separated by other means).\n\t *\n\t * This flag only affects host-to-device transfers to bulk and interrupt\n\t * endpoints. In other situations, it is ignored.\n\t *\n\t * This flag only affects transfers with a length that is a multiple of\n\t * the endpoint's wMaxPacketSize. On transfers of other lengths, this\n\t * flag has no effect. Therefore, if you are working with a device that\n\t * needs a ZLP whenever the end of the logical request falls on a packet\n\t * boundary, then it is sensible to set this flag on <em>every</em>\n\t * transfer (you do not have to worry about only setting it on transfers\n\t * that end on the boundary).\n\t *\n\t * This flag is currently only supported on Linux.\n\t * On other systems, libusb_submit_transfer() will return\n\t * LIBUSB_ERROR_NOT_SUPPORTED for every transfer where this flag is set.\n\t *\n\t * Available since libusb-1.0.9.\n\t */\n\tLIBUSB_TRANSFER_ADD_ZERO_PACKET = 1 << 3,\n};\n\n/** \\ingroup asyncio\n * Isochronous packet descriptor. */\nstruct libusb_iso_packet_descriptor {\n\t/** Length of data to request in this packet */\n\tunsigned int length;\n\n\t/** Amount of data that was actually transferred */\n\tunsigned int actual_length;\n\n\t/** Status code for this packet */\n\tenum libusb_transfer_status status;\n};\n\nstruct libusb_transfer;\n\n/** \\ingroup asyncio\n * Asynchronous transfer callback function type. When submitting asynchronous\n * transfers, you pass a pointer to a callback function of this type via the\n * \\ref libusb_transfer::callback \"callback\" member of the libusb_transfer\n * structure. libusb will call this function later, when the transfer has\n * completed or failed. See \\ref asyncio for more information.\n * \\param transfer The libusb_transfer struct the callback function is being\n * notified about.\n */\ntypedef void (LIBUSB_CALL *libusb_transfer_cb_fn)(struct libusb_transfer *transfer);\n\n/** \\ingroup asyncio\n * The generic USB transfer structure. The user populates this structure and\n * then submits it in order to request a transfer. After the transfer has\n * completed, the library populates the transfer with the results and passes\n * it back to the user.\n */\nstruct libusb_transfer {\n\t/** Handle of the device that this transfer will be submitted to */\n\tlibusb_device_handle *dev_handle;\n\n\t/** A bitwise OR combination of \\ref libusb_transfer_flags. */\n\tuint8_t flags;\n\n\t/** Address of the endpoint where this transfer will be sent. */\n\tunsigned char endpoint;\n\n\t/** Type of the endpoint from \\ref libusb_transfer_type */\n\tunsigned char type;\n\n\t/** Timeout for this transfer in millseconds. A value of 0 indicates no\n\t * timeout. */\n\tunsigned int timeout;\n\n\t/** The status of the transfer. Read-only, and only for use within\n\t * transfer callback function.\n\t *\n\t * If this is an isochronous transfer, this field may read COMPLETED even\n\t * if there were errors in the frames. Use the\n\t * \\ref libusb_iso_packet_descriptor::status \"status\" field in each packet\n\t * to determine if errors occurred. */\n\tenum libusb_transfer_status status;\n\n\t/** Length of the data buffer */\n\tint length;\n\n\t/** Actual length of data that was transferred. Read-only, and only for\n\t * use within transfer callback function. Not valid for isochronous\n\t * endpoint transfers. */\n\tint actual_length;\n\n\t/** Callback function. This will be invoked when the transfer completes,\n\t * fails, or is cancelled. */\n\tlibusb_transfer_cb_fn callback;\n\n\t/** User context data to pass to the callback function. */\n\tvoid *user_data;\n\n\t/** Data buffer */\n\tunsigned char *buffer;\n\n\t/** Number of isochronous packets. Only used for I/O with isochronous\n\t * endpoints. */\n\tint num_iso_packets;\n\n\t/** Isochronous packet descriptors, for isochronous transfers only. */\n\tstruct libusb_iso_packet_descriptor iso_packet_desc\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)\n\t[] /* valid C99 code */\n#else\n\t[0] /* non-standard, but usually working code */\n#endif\n\t;\n};\n\n/** \\ingroup misc\n * Capabilities supported by an instance of libusb on the current running\n * platform. Test if the loaded library supports a given capability by calling\n * \\ref libusb_has_capability().\n */\nenum libusb_capability {\n\t/** The libusb_has_capability() API is available. */\n\tLIBUSB_CAP_HAS_CAPABILITY = 0x0000,\n\t/** Hotplug support is available on this platform. */\n\tLIBUSB_CAP_HAS_HOTPLUG = 0x0001,\n\t/** The library can access HID devices without requiring user intervention.\n\t * Note that before being able to actually access an HID device, you may\n\t * still have to call additional libusb functions such as\n\t * \\ref libusb_detach_kernel_driver(). */\n\tLIBUSB_CAP_HAS_HID_ACCESS = 0x0100,\n\t/** The library supports detaching of the default USB driver, using \n\t * \\ref libusb_detach_kernel_driver(), if one is set by the OS kernel */\n\tLIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER = 0x0101\n};\n\n/** \\ingroup lib\n *  Log message levels.\n *  - LIBUSB_LOG_LEVEL_NONE (0)    : no messages ever printed by the library (default)\n *  - LIBUSB_LOG_LEVEL_ERROR (1)   : error messages are printed to stderr\n *  - LIBUSB_LOG_LEVEL_WARNING (2) : warning and error messages are printed to stderr\n *  - LIBUSB_LOG_LEVEL_INFO (3)    : informational messages are printed to stdout, warning\n *    and error messages are printed to stderr\n *  - LIBUSB_LOG_LEVEL_DEBUG (4)   : debug and informational messages are printed to stdout,\n *    warnings and errors to stderr\n */\nenum libusb_log_level {\n\tLIBUSB_LOG_LEVEL_NONE = 0,\n\tLIBUSB_LOG_LEVEL_ERROR,\n\tLIBUSB_LOG_LEVEL_WARNING,\n\tLIBUSB_LOG_LEVEL_INFO,\n\tLIBUSB_LOG_LEVEL_DEBUG,\n};\n\nint LIBUSB_CALL libusb_init(libusb_context **ctx);\nint LIBUSB_CALL libusb_init2(libusb_context **ctx, const char *usbfs);\nvoid LIBUSB_CALL libusb_exit(libusb_context *ctx);\nvoid LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);\nconst struct libusb_version * LIBUSB_CALL libusb_get_version(void);\nint LIBUSB_CALL libusb_has_capability(uint32_t capability);\nconst char * LIBUSB_CALL libusb_error_name(int errcode);\nint LIBUSB_CALL libusb_setlocale(const char *locale);\nconst char * LIBUSB_CALL libusb_strerror(enum libusb_error errcode);\n\nssize_t LIBUSB_CALL libusb_get_device_list(libusb_context *ctx,\n\tlibusb_device ***list);\nvoid LIBUSB_CALL libusb_free_device_list(libusb_device **list,\n\tint unref_devices);\nlibusb_device * LIBUSB_CALL libusb_ref_device(libusb_device *dev);\nvoid LIBUSB_CALL libusb_unref_device(libusb_device *dev);\nlibusb_device *libusb_find_device(libusb_context *ctx,\n\tconst int vid, const int pid, const char *sn, int fd);\t// XXX add for mainly non-rooted Android\n\nint LIBUSB_CALL libusb_get_raw_descriptor(libusb_device *dev,\n\t\tunsigned char **buffer, int *descriptors_len, int *host_endian);\nint LIBUSB_CALL libusb_get_configuration(libusb_device_handle *dev,\n\tint *config);\nint LIBUSB_CALL libusb_get_device_descriptor(libusb_device *dev,\n\tstruct libusb_device_descriptor *desc);\nint LIBUSB_CALL libusb_get_active_config_descriptor(libusb_device *dev,\n\tstruct libusb_config_descriptor **config);\nint LIBUSB_CALL libusb_get_config_descriptor(libusb_device *dev,\n\tuint8_t config_index, struct libusb_config_descriptor **config);\nint LIBUSB_CALL libusb_get_config_descriptor_by_value(libusb_device *dev,\n\tuint8_t bConfigurationValue, struct libusb_config_descriptor **config);\nvoid LIBUSB_CALL libusb_free_config_descriptor(\n\tstruct libusb_config_descriptor *config);\nint LIBUSB_CALL libusb_get_ss_endpoint_companion_descriptor(\n\tstruct libusb_context *ctx,\n\tconst struct libusb_endpoint_descriptor *endpoint,\n\tstruct libusb_ss_endpoint_companion_descriptor **ep_comp);\nvoid LIBUSB_CALL libusb_free_ss_endpoint_companion_descriptor(\n\tstruct libusb_ss_endpoint_companion_descriptor *ep_comp);\nint LIBUSB_CALL libusb_get_bos_descriptor(libusb_device_handle *handle,\n\tstruct libusb_bos_descriptor **bos);\nvoid LIBUSB_CALL libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos);\nint LIBUSB_CALL libusb_get_usb_2_0_extension_descriptor(\n\tstruct libusb_context *ctx,\n\tstruct libusb_bos_dev_capability_descriptor *dev_cap,\n\tstruct libusb_usb_2_0_extension_descriptor **usb_2_0_extension);\nvoid LIBUSB_CALL libusb_free_usb_2_0_extension_descriptor(\n\tstruct libusb_usb_2_0_extension_descriptor *usb_2_0_extension);\nint LIBUSB_CALL libusb_get_ss_usb_device_capability_descriptor(\n\tstruct libusb_context *ctx,\n\tstruct libusb_bos_dev_capability_descriptor *dev_cap,\n\tstruct libusb_ss_usb_device_capability_descriptor **ss_usb_device_cap);\nvoid LIBUSB_CALL libusb_free_ss_usb_device_capability_descriptor(\n\tstruct libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap);\nint LIBUSB_CALL libusb_get_container_id_descriptor(struct libusb_context *ctx,\n\tstruct libusb_bos_dev_capability_descriptor *dev_cap,\n\tstruct libusb_container_id_descriptor **container_id);\nvoid LIBUSB_CALL libusb_free_container_id_descriptor(\n\tstruct libusb_container_id_descriptor *container_id);\nuint8_t LIBUSB_CALL libusb_get_bus_number(libusb_device *dev);\nuint8_t LIBUSB_CALL libusb_get_port_number(libusb_device *dev);\nint LIBUSB_CALL libusb_get_port_numbers(libusb_device *dev, uint8_t* port_numbers, int port_numbers_len);\nLIBUSB_DEPRECATED_FOR(libusb_get_port_numbers)\nint LIBUSB_CALL libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t* path, uint8_t path_length);\nlibusb_device * LIBUSB_CALL libusb_get_parent(libusb_device *dev);\nuint8_t LIBUSB_CALL libusb_get_device_address(libusb_device *dev);\nint LIBUSB_CALL libusb_get_device_speed(libusb_device *dev);\nint LIBUSB_CALL libusb_get_max_packet_size(libusb_device *dev,\n\tunsigned char endpoint);\nint LIBUSB_CALL libusb_get_max_iso_packet_size(libusb_device *dev,\n\tunsigned char endpoint);\n\nint LIBUSB_CALL libusb_set_device_fd(libusb_device *dev, int fd);\t// XXX add for mainly non-rooted Android\nlibusb_device * LIBUSB_CALL libusb_get_device_with_fd(libusb_context *ctx,\n\tint vid, int pid, const char *serial, int fd, int busnum, int devaddr);\nint LIBUSB_CALL libusb_open(libusb_device *dev, libusb_device_handle **handle);\nvoid LIBUSB_CALL libusb_close(libusb_device_handle *dev_handle);\nlibusb_device * LIBUSB_CALL libusb_get_device(libusb_device_handle *dev_handle);\n\nint LIBUSB_CALL libusb_set_configuration(libusb_device_handle *dev,\n\tint configuration);\nint LIBUSB_CALL libusb_claim_interface(libusb_device_handle *dev,\n\tint interface_number);\nint LIBUSB_CALL libusb_release_interface(libusb_device_handle *dev,\n\tint interface_number);\n\nlibusb_device_handle * LIBUSB_CALL libusb_open_device_with_vid_pid(\n\tlibusb_context *ctx, uint16_t vendor_id, uint16_t product_id);\n\nint LIBUSB_CALL libusb_set_interface_alt_setting(libusb_device_handle *dev,\n\tint interface_number, int alternate_setting);\nint LIBUSB_CALL libusb_clear_halt(libusb_device_handle *dev,\n\tunsigned char endpoint);\nint LIBUSB_CALL libusb_reset_device(libusb_device_handle *dev);\n\nint LIBUSB_CALL libusb_alloc_streams(libusb_device_handle *dev,\n\tuint32_t num_streams, unsigned char *endpoints, int num_endpoints);\nint LIBUSB_CALL libusb_free_streams(libusb_device_handle *dev,\n\tunsigned char *endpoints, int num_endpoints);\n\nint LIBUSB_CALL libusb_kernel_driver_active(libusb_device_handle *dev,\n\tint interface_number);\nint LIBUSB_CALL libusb_detach_kernel_driver(libusb_device_handle *dev,\n\tint interface_number);\nint LIBUSB_CALL libusb_attach_kernel_driver(libusb_device_handle *dev,\n\tint interface_number);\nint LIBUSB_CALL libusb_set_auto_detach_kernel_driver(\n\tlibusb_device_handle *dev, int enable);\n\n/* async I/O */\n\n/** \\ingroup asyncio\n * Get the data section of a control transfer. This convenience function is here\n * to remind you that the data does not start until 8 bytes into the actual\n * buffer, as the setup packet comes first.\n *\n * Calling this function only makes sense from a transfer callback function,\n * or situations where you have already allocated a suitably sized buffer at\n * transfer->buffer.\n *\n * \\param transfer a transfer\n * \\returns pointer to the first byte of the data section\n */\nstatic inline unsigned char *libusb_control_transfer_get_data(\n\tstruct libusb_transfer *transfer)\n{\n\treturn transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE;\n}\n\n/** \\ingroup asyncio\n * Get the control setup packet of a control transfer. This convenience\n * function is here to remind you that the control setup occupies the first\n * 8 bytes of the transfer data buffer.\n *\n * Calling this function only makes sense from a transfer callback function,\n * or situations where you have already allocated a suitably sized buffer at\n * transfer->buffer.\n *\n * \\param transfer a transfer\n * \\returns a casted pointer to the start of the transfer data buffer\n */\nstatic inline struct libusb_control_setup *libusb_control_transfer_get_setup(\n\tstruct libusb_transfer *transfer)\n{\n\treturn (struct libusb_control_setup *)(void *) transfer->buffer;\n}\n\n/** \\ingroup asyncio\n * Helper function to populate the setup packet (first 8 bytes of the data\n * buffer) for a control transfer. The wIndex, wValue and wLength values should\n * be given in host-endian byte order.\n *\n * \\param buffer buffer to output the setup packet into\n * This pointer must be aligned to at least 2 bytes boundary.\n * \\param bmRequestType see the\n * \\ref libusb_control_setup::bmRequestType \"bmRequestType\" field of\n * \\ref libusb_control_setup\n * \\param bRequest see the\n * \\ref libusb_control_setup::bRequest \"bRequest\" field of\n * \\ref libusb_control_setup\n * \\param wValue see the\n * \\ref libusb_control_setup::wValue \"wValue\" field of\n * \\ref libusb_control_setup\n * \\param wIndex see the\n * \\ref libusb_control_setup::wIndex \"wIndex\" field of\n * \\ref libusb_control_setup\n * \\param wLength see the\n * \\ref libusb_control_setup::wLength \"wLength\" field of\n * \\ref libusb_control_setup\n */\nstatic inline void libusb_fill_control_setup(unsigned char *buffer,\n\tuint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,\n\tuint16_t wLength)\n{\n\tstruct libusb_control_setup *setup = (struct libusb_control_setup *)(void *) buffer;\n\tsetup->bmRequestType = bmRequestType;\n\tsetup->bRequest = bRequest;\n\tsetup->wValue = libusb_cpu_to_le16(wValue);\n\tsetup->wIndex = libusb_cpu_to_le16(wIndex);\n\tsetup->wLength = libusb_cpu_to_le16(wLength);\n}\n\nstruct libusb_transfer * LIBUSB_CALL libusb_alloc_transfer(int iso_packets);\nint LIBUSB_CALL libusb_submit_transfer(struct libusb_transfer *transfer);\nint LIBUSB_CALL libusb_cancel_transfer(struct libusb_transfer *transfer);\nvoid LIBUSB_CALL libusb_free_transfer(struct libusb_transfer *transfer);\nvoid LIBUSB_CALL libusb_transfer_set_stream_id(\n\tstruct libusb_transfer *transfer, uint32_t stream_id);\nuint32_t LIBUSB_CALL libusb_transfer_get_stream_id(\n\tstruct libusb_transfer *transfer);\n\n/** \\ingroup asyncio\n * Helper function to populate the required \\ref libusb_transfer fields\n * for a control transfer.\n *\n * If you pass a transfer buffer to this function, the first 8 bytes will\n * be interpreted as a control setup packet, and the wLength field will be\n * used to automatically populate the \\ref libusb_transfer::length \"length\"\n * field of the transfer. Therefore the recommended approach is:\n * -# Allocate a suitably sized data buffer (including space for control setup)\n * -# Call libusb_fill_control_setup()\n * -# If this is a host-to-device transfer with a data stage, put the data\n *    in place after the setup packet\n * -# Call this function\n * -# Call libusb_submit_transfer()\n *\n * It is also legal to pass a NULL buffer to this function, in which case this\n * function will not attempt to populate the length field. Remember that you\n * must then populate the buffer and length fields later.\n *\n * \\param transfer the transfer to populate\n * \\param dev_handle handle of the device that will handle the transfer\n * \\param buffer data buffer. If provided, this function will interpret the\n * first 8 bytes as a setup packet and infer the transfer length from that.\n * This pointer must be aligned to at least 2 bytes boundary.\n * \\param callback callback function to be invoked on transfer completion\n * \\param user_data user data to pass to callback function\n * \\param timeout timeout for the transfer in milliseconds\n */\nstatic inline void libusb_fill_control_transfer(\n\tstruct libusb_transfer *transfer, libusb_device_handle *dev_handle,\n\tunsigned char *buffer, libusb_transfer_cb_fn callback, void *user_data,\n\tunsigned int timeout)\n{\n\tstruct libusb_control_setup *setup = (struct libusb_control_setup *)(void *) buffer;\n\ttransfer->dev_handle = dev_handle;\n\ttransfer->endpoint = 0;\n\ttransfer->type = LIBUSB_TRANSFER_TYPE_CONTROL;\n\ttransfer->timeout = timeout;\n\ttransfer->buffer = buffer;\n\tif (setup)\n\t\ttransfer->length = (int) (LIBUSB_CONTROL_SETUP_SIZE\n\t\t\t+ libusb_le16_to_cpu(setup->wLength));\n\ttransfer->user_data = user_data;\n\ttransfer->callback = callback;\n}\n\n/** \\ingroup asyncio\n * Helper function to populate the required \\ref libusb_transfer fields\n * for a bulk transfer.\n *\n * \\param transfer the transfer to populate\n * \\param dev_handle handle of the device that will handle the transfer\n * \\param endpoint address of the endpoint where this transfer will be sent\n * \\param buffer data buffer\n * \\param length length of data buffer\n * \\param callback callback function to be invoked on transfer completion\n * \\param user_data user data to pass to callback function\n * \\param timeout timeout for the transfer in milliseconds\n */\nstatic inline void libusb_fill_bulk_transfer(struct libusb_transfer *transfer,\n\tlibusb_device_handle *dev_handle, unsigned char endpoint,\n\tunsigned char *buffer, int length, libusb_transfer_cb_fn callback,\n\tvoid *user_data, unsigned int timeout)\n{\n\ttransfer->dev_handle = dev_handle;\n\ttransfer->endpoint = endpoint;\n\ttransfer->type = LIBUSB_TRANSFER_TYPE_BULK;\n\ttransfer->timeout = timeout;\n\ttransfer->buffer = buffer;\n\ttransfer->length = length;\n\ttransfer->user_data = user_data;\n\ttransfer->callback = callback;\n}\n\n/** \\ingroup asyncio\n * Helper function to populate the required \\ref libusb_transfer fields\n * for a bulk transfer using bulk streams.\n *\n * Since version 1.0.19, \\ref LIBUSB_API_VERSION >= 0x01000103\n *\n * \\param transfer the transfer to populate\n * \\param dev_handle handle of the device that will handle the transfer\n * \\param endpoint address of the endpoint where this transfer will be sent\n * \\param stream_id bulk stream id for this transfer\n * \\param buffer data buffer\n * \\param length length of data buffer\n * \\param callback callback function to be invoked on transfer completion\n * \\param user_data user data to pass to callback function\n * \\param timeout timeout for the transfer in milliseconds\n */\nstatic inline void libusb_fill_bulk_stream_transfer(\n\tstruct libusb_transfer *transfer, libusb_device_handle *dev_handle,\n\tunsigned char endpoint, uint32_t stream_id,\n\tunsigned char *buffer, int length, libusb_transfer_cb_fn callback,\n\tvoid *user_data, unsigned int timeout)\n{\n\tlibusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer,\n\t\t\t\t  length, callback, user_data, timeout);\n\ttransfer->type = LIBUSB_TRANSFER_TYPE_BULK_STREAM;\n\tlibusb_transfer_set_stream_id(transfer, stream_id);\n}\n\n/** \\ingroup asyncio\n * Helper function to populate the required \\ref libusb_transfer fields\n * for an interrupt transfer.\n *\n * \\param transfer the transfer to populate\n * \\param dev_handle handle of the device that will handle the transfer\n * \\param endpoint address of the endpoint where this transfer will be sent\n * \\param buffer data buffer\n * \\param length length of data buffer\n * \\param callback callback function to be invoked on transfer completion\n * \\param user_data user data to pass to callback function\n * \\param timeout timeout for the transfer in milliseconds\n */\nstatic inline void libusb_fill_interrupt_transfer(\n\tstruct libusb_transfer *transfer, libusb_device_handle *dev_handle,\n\tunsigned char endpoint, unsigned char *buffer, int length,\n\tlibusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)\n{\n\ttransfer->dev_handle = dev_handle;\n\ttransfer->endpoint = endpoint;\n\ttransfer->type = LIBUSB_TRANSFER_TYPE_INTERRUPT;\n\ttransfer->timeout = timeout;\n\ttransfer->buffer = buffer;\n\ttransfer->length = length;\n\ttransfer->user_data = user_data;\n\ttransfer->callback = callback;\n}\n\n/** \\ingroup asyncio\n * Helper function to populate the required \\ref libusb_transfer fields\n * for an isochronous transfer.\n *\n * \\param transfer the transfer to populate\n * \\param dev_handle handle of the device that will handle the transfer\n * \\param endpoint address of the endpoint where this transfer will be sent\n * \\param buffer data buffer\n * \\param length length of data buffer\n * \\param num_iso_packets the number of isochronous packets\n * \\param callback callback function to be invoked on transfer completion\n * \\param user_data user data to pass to callback function\n * \\param timeout timeout for the transfer in milliseconds\n */\nstatic inline void libusb_fill_iso_transfer(struct libusb_transfer *transfer,\n\tlibusb_device_handle *dev_handle, unsigned char endpoint,\n\tunsigned char *buffer, int length, int num_iso_packets,\n\tlibusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)\n{\n\ttransfer->dev_handle = dev_handle;\n\ttransfer->endpoint = endpoint;\n\ttransfer->type = LIBUSB_TRANSFER_TYPE_ISOCHRONOUS;\n\ttransfer->timeout = timeout;\n\ttransfer->buffer = buffer;\n\ttransfer->length = length;\n\ttransfer->num_iso_packets = num_iso_packets;\n\ttransfer->user_data = user_data;\n\ttransfer->callback = callback;\n}\n\n/** \\ingroup asyncio\n * Convenience function to set the length of all packets in an isochronous\n * transfer, based on the num_iso_packets field in the transfer structure.\n *\n * \\param transfer a transfer\n * \\param length the length to set in each isochronous packet descriptor\n * \\see libusb_get_max_packet_size()\n */\nstatic inline void libusb_set_iso_packet_lengths(\n\tstruct libusb_transfer *transfer, unsigned int length)\n{\n\tint i;\n\tfor (i = 0; i < transfer->num_iso_packets; i++)\n\t\ttransfer->iso_packet_desc[i].length = length;\n}\n\n/** \\ingroup asyncio\n * Convenience function to locate the position of an isochronous packet\n * within the buffer of an isochronous transfer.\n *\n * This is a thorough function which loops through all preceding packets,\n * accumulating their lengths to find the position of the specified packet.\n * Typically you will assign equal lengths to each packet in the transfer,\n * and hence the above method is sub-optimal. You may wish to use\n * libusb_get_iso_packet_buffer_simple() instead.\n *\n * \\param transfer a transfer\n * \\param packet the packet to return the address of\n * \\returns the base address of the packet buffer inside the transfer buffer,\n * or NULL if the packet does not exist.\n * \\see libusb_get_iso_packet_buffer_simple()\n */\nstatic inline unsigned char *libusb_get_iso_packet_buffer(\n\tstruct libusb_transfer *transfer, unsigned int packet)\n{\n\tint i;\n\tsize_t offset = 0;\n\tint _packet;\n\n\t/* oops..slight bug in the API. packet is an unsigned int, but we use\n\t * signed integers almost everywhere else. range-check and convert to\n\t * signed to avoid compiler warnings. FIXME for libusb-2. */\n\tif (packet > INT_MAX)\n\t\treturn NULL;\n\t_packet = (int) packet;\n\n\tif (_packet >= transfer->num_iso_packets)\n\t\treturn NULL;\n\n\tfor (i = 0; i < _packet; i++)\n\t\toffset += transfer->iso_packet_desc[i].length;\n\n\treturn transfer->buffer + offset;\n}\n\n/** \\ingroup asyncio\n * Convenience function to locate the position of an isochronous packet\n * within the buffer of an isochronous transfer, for transfers where each\n * packet is of identical size.\n *\n * This function relies on the assumption that every packet within the transfer\n * is of identical size to the first packet. Calculating the location of\n * the packet buffer is then just a simple calculation:\n * <tt>buffer + (packet_size * packet)</tt>\n *\n * Do not use this function on transfers other than those that have identical\n * packet lengths for each packet.\n *\n * \\param transfer a transfer\n * \\param packet the packet to return the address of\n * \\returns the base address of the packet buffer inside the transfer buffer,\n * or NULL if the packet does not exist.\n * \\see libusb_get_iso_packet_buffer()\n */\nstatic inline unsigned char *libusb_get_iso_packet_buffer_simple(\n\tstruct libusb_transfer *transfer, unsigned int packet)\n{\n\tint _packet;\n\n\t/* oops..slight bug in the API. packet is an unsigned int, but we use\n\t * signed integers almost everywhere else. range-check and convert to\n\t * signed to avoid compiler warnings. FIXME for libusb-2. */\n\tif (packet > INT_MAX)\n\t\treturn NULL;\n\t_packet = (int) packet;\n\n\tif (_packet >= transfer->num_iso_packets)\n\t\treturn NULL;\n\n\treturn transfer->buffer + ((int) transfer->iso_packet_desc[0].length * _packet);\n}\n\n/* sync I/O */\n\nint LIBUSB_CALL libusb_control_transfer(libusb_device_handle *dev_handle,\n\tuint8_t request_type, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,\n\tunsigned char *data, uint16_t wLength, unsigned int timeout);\n\nint LIBUSB_CALL libusb_bulk_transfer(libusb_device_handle *dev_handle,\n\tunsigned char endpoint, unsigned char *data, int length,\n\tint *actual_length, unsigned int timeout);\n\nint LIBUSB_CALL libusb_interrupt_transfer(libusb_device_handle *dev_handle,\n\tunsigned char endpoint, unsigned char *data, int length,\n\tint *actual_length, unsigned int timeout);\n\n/** \\ingroup desc\n * Retrieve a descriptor from the default control pipe.\n * This is a convenience function which formulates the appropriate control\n * message to retrieve the descriptor.\n *\n * \\param dev a device handle\n * \\param desc_type the descriptor type, see \\ref libusb_descriptor_type\n * \\param desc_index the index of the descriptor to retrieve\n * \\param data output buffer for descriptor\n * \\param length size of data buffer\n * \\returns number of bytes returned in data, or LIBUSB_ERROR code on failure\n */\nstatic inline int libusb_get_descriptor(libusb_device_handle *dev,\n\tuint8_t desc_type, uint8_t desc_index, unsigned char *data, int length)\n{\n\treturn libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN,\n\t\tLIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t) ((desc_type << 8) | desc_index),\n\t\t0, data, (uint16_t) length, 1000);\n}\n\n/** \\ingroup desc\n * Retrieve a descriptor from a device.\n * This is a convenience function which formulates the appropriate control\n * message to retrieve the descriptor. The string returned is Unicode, as\n * detailed in the USB specifications.\n *\n * \\param dev a device handle\n * \\param desc_index the index of the descriptor to retrieve\n * \\param langid the language ID for the string descriptor\n * \\param data output buffer for descriptor\n * \\param length size of data buffer\n * \\returns number of bytes returned in data, or LIBUSB_ERROR code on failure\n * \\see libusb_get_string_descriptor_ascii()\n */\nstatic inline int libusb_get_string_descriptor(libusb_device_handle *dev,\n\tuint8_t desc_index, uint16_t langid, unsigned char *data, int length)\n{\n\treturn libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN,\n\t\tLIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t)((LIBUSB_DT_STRING << 8) | desc_index),\n\t\tlangid, data, (uint16_t) length, 1000);\n}\n\nint LIBUSB_CALL libusb_get_string_descriptor_ascii(libusb_device_handle *dev,\n\tuint8_t desc_index, unsigned char *data, int length);\n\n/* polling and timeouts */\n\nint LIBUSB_CALL libusb_try_lock_events(libusb_context *ctx);\nvoid LIBUSB_CALL libusb_lock_events(libusb_context *ctx);\nvoid LIBUSB_CALL libusb_unlock_events(libusb_context *ctx);\nint LIBUSB_CALL libusb_event_handling_ok(libusb_context *ctx);\nint LIBUSB_CALL libusb_event_handler_active(libusb_context *ctx);\nvoid LIBUSB_CALL libusb_lock_event_waiters(libusb_context *ctx);\nvoid LIBUSB_CALL libusb_unlock_event_waiters(libusb_context *ctx);\nint LIBUSB_CALL libusb_wait_for_event(libusb_context *ctx, struct timeval *tv);\n\nint LIBUSB_CALL libusb_handle_events_timeout(libusb_context *ctx,\n\tstruct timeval *tv);\nint LIBUSB_CALL libusb_handle_events_timeout_completed(libusb_context *ctx,\n\tstruct timeval *tv, int *completed);\nint LIBUSB_CALL libusb_handle_events(libusb_context *ctx);\nint LIBUSB_CALL libusb_handle_events_completed(libusb_context *ctx, int *completed);\nint LIBUSB_CALL libusb_handle_events_locked(libusb_context *ctx,\n\tstruct timeval *tv);\nint LIBUSB_CALL libusb_pollfds_handle_timeouts(libusb_context *ctx);\nint LIBUSB_CALL libusb_get_next_timeout(libusb_context *ctx,\n\tstruct timeval *tv);\n\n/** \\ingroup poll\n * File descriptor for polling\n */\nstruct libusb_pollfd {\n\t/** Numeric file descriptor */\n\tint fd;\n\n\t/** Event flags to poll for from <poll.h>. POLLIN indicates that you\n\t * should monitor this file descriptor for becoming ready to read from,\n\t * and POLLOUT indicates that you should monitor this file descriptor for\n\t * nonblocking write readiness. */\n\tshort events;\n};\n\n/** \\ingroup poll\n * Callback function, invoked when a new file descriptor should be added\n * to the set of file descriptors monitored for events.\n * \\param fd the new file descriptor\n * \\param events events to monitor for, see \\ref libusb_pollfd for a\n * description\n * \\param user_data User data pointer specified in\n * libusb_set_pollfd_notifiers() call\n * \\see libusb_set_pollfd_notifiers()\n */\ntypedef void (LIBUSB_CALL *libusb_pollfd_added_cb)(int fd, short events,\n\tvoid *user_data);\n\n/** \\ingroup poll\n * Callback function, invoked when a file descriptor should be removed from\n * the set of file descriptors being monitored for events. After returning\n * from this callback, do not use that file descriptor again.\n * \\param fd the file descriptor to stop monitoring\n * \\param user_data User data pointer specified in\n * libusb_set_pollfd_notifiers() call\n * \\see libusb_set_pollfd_notifiers()\n */\ntypedef void (LIBUSB_CALL *libusb_pollfd_removed_cb)(int fd, void *user_data);\n\nconst struct libusb_pollfd ** LIBUSB_CALL libusb_get_pollfds(\n\tlibusb_context *ctx);\nvoid LIBUSB_CALL libusb_set_pollfd_notifiers(libusb_context *ctx,\n\tlibusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb,\n\tvoid *user_data);\n\n/** \\ingroup hotplug\n * Callback handle.\n *\n * Callbacks handles are generated by libusb_hotplug_register_callback()\n * and can be used to deregister callbacks. Callback handles are unique\n * per libusb_context and it is safe to call libusb_hotplug_deregister_callback()\n * on an already deregisted callback.\n *\n * Since version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102\n *\n * For more information, see \\ref hotplug.\n */\ntypedef int libusb_hotplug_callback_handle;\n\n/** \\ingroup hotplug\n *\n * Since version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102\n *\n * Flags for hotplug events */\ntypedef enum {\n\t/** Arm the callback and fire it for all matching currently attached devices. */\n\tLIBUSB_HOTPLUG_ENUMERATE = 1,\n} libusb_hotplug_flag;\n\n/** \\ingroup hotplug\n *\n * Since version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102\n *\n * Hotplug events */\ntypedef enum {\n\t/** A device has been plugged in and is ready to use */\n\tLIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED = 0x01,\n\n\t/** A device has left and is no longer available.\n\t * It is the user's responsibility to call libusb_close on any handle associated with a disconnected device.\n\t * It is safe to call libusb_get_device_descriptor on a device that has left */\n\tLIBUSB_HOTPLUG_EVENT_DEVICE_LEFT    = 0x02,\n} libusb_hotplug_event;\n\n/** \\ingroup hotplug\n * Wildcard matching for hotplug events */\n#define LIBUSB_HOTPLUG_MATCH_ANY -1\n\n/** \\ingroup hotplug\n * Hotplug callback function type. When requesting hotplug event notifications,\n * you pass a pointer to a callback function of this type.\n *\n * This callback may be called by an internal event thread and as such it is\n * recommended the callback do minimal processing before returning.\n *\n * libusb will call this function later, when a matching event had happened on\n * a matching device. See \\ref hotplug for more information.\n *\n * It is safe to call either libusb_hotplug_register_callback() or\n * libusb_hotplug_deregister_callback() from within a callback function.\n *\n * Since version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102\n *\n * \\param ctx            context of this notification\n * \\param device         libusb_device this event occurred on\n * \\param event          event that occurred\n * \\param user_data      user data provided when this callback was registered\n * \\returns bool whether this callback is finished processing events.\n *                       returning 1 will cause this callback to be deregistered\n */\ntypedef int (LIBUSB_CALL *libusb_hotplug_callback_fn)(libusb_context *ctx,\n\t\t\t\t\t\tlibusb_device *device,\n\t\t\t\t\t\tlibusb_hotplug_event event,\n\t\t\t\t\t\tvoid *user_data);\n\n/** \\ingroup hotplug\n * Register a hotplug callback function\n *\n * Register a callback with the libusb_context. The callback will fire\n * when a matching event occurs on a matching device. The callback is\n * armed until either it is deregistered with libusb_hotplug_deregister_callback()\n * or the supplied callback returns 1 to indicate it is finished processing events.\n *\n * If the \\ref LIBUSB_HOTPLUG_ENUMERATE is passed the callback will be\n * called with a \\ref LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED for all devices\n * already plugged into the machine. Note that libusb modifies its internal\n * device list from a separate thread, while calling hotplug callbacks from\n * libusb_handle_events(), so it is possible for a device to already be present\n * on, or removed from, its internal device list, while the hotplug callbacks\n * still need to be dispatched. This means that when using \\ref\n * LIBUSB_HOTPLUG_ENUMERATE, your callback may be called twice for the arrival\n * of the same device, once from libusb_hotplug_register_callback() and once\n * from libusb_handle_events(); and/or your callback may be called for the\n * removal of a device for which an arrived call was never made.\n *\n * Since version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102\n *\n * \\param[in] ctx context to register this callback with\n * \\param[in] events bitwise or of events that will trigger this callback. See \\ref\n *            libusb_hotplug_event\n * \\param[in] flags hotplug callback flags. See \\ref libusb_hotplug_flag\n * \\param[in] vendor_id the vendor id to match or \\ref LIBUSB_HOTPLUG_MATCH_ANY\n * \\param[in] product_id the product id to match or \\ref LIBUSB_HOTPLUG_MATCH_ANY\n * \\param[in] dev_class the device class to match or \\ref LIBUSB_HOTPLUG_MATCH_ANY\n * \\param[in] cb_fn the function to be invoked on a matching event/device\n * \\param[in] user_data user data to pass to the callback function\n * \\param[out] handle pointer to store the handle of the allocated callback (can be NULL)\n * \\returns LIBUSB_SUCCESS on success LIBUSB_ERROR code on failure\n */\nint LIBUSB_CALL libusb_hotplug_register_callback(libusb_context *ctx,\n\t\t\t\t\t\tlibusb_hotplug_event events,\n\t\t\t\t\t\tlibusb_hotplug_flag flags,\n\t\t\t\t\t\tint vendor_id, int product_id,\n\t\t\t\t\t\tint dev_class,\n\t\t\t\t\t\tlibusb_hotplug_callback_fn cb_fn,\n\t\t\t\t\t\tvoid *user_data,\n\t\t\t\t\t\tlibusb_hotplug_callback_handle *handle);\n\n/** \\ingroup hotplug\n * Deregisters a hotplug callback.\n *\n * Deregister a callback from a libusb_context. This function is safe to call from within\n * a hotplug callback.\n *\n * Since version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102\n *\n * \\param[in] ctx context this callback is registered with\n * \\param[in] handle the handle of the callback to deregister\n */\nvoid LIBUSB_CALL libusb_hotplug_deregister_callback(libusb_context *ctx,\n\t\t\t\t\t\tlibusb_hotplug_callback_handle handle);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/libusb_original.h",
    "content": "/*\n * Public libusb header file\n * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>\n * Copyright © 2007-2008 Daniel Drake <dsd@gentoo.org>\n * Copyright © 2012 Pete Batard <pete@akeo.ie>\n * Copyright © 2012 Nathan Hjelm <hjelmn@cs.unm.edu>\n * For more information, please visit: http://libusb.info\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef LIBUSB_H\n#define LIBUSB_H\n\n#ifdef _MSC_VER\n/* on MS environments, the inline keyword is available in C++ only */\n#if !defined(__cplusplus)\n#define inline __inline\n#endif\n/* ssize_t is also not available (copy/paste from MinGW) */\n#ifndef _SSIZE_T_DEFINED\n#define _SSIZE_T_DEFINED\n#undef ssize_t\n#ifdef _WIN64\n  typedef __int64 ssize_t;\n#else\n  typedef int ssize_t;\n#endif /* _WIN64 */\n#endif /* _SSIZE_T_DEFINED */\n#endif /* _MSC_VER */\n\n/* stdint.h is not available on older MSVC */\n#if defined(_MSC_VER) && (_MSC_VER < 1600) && (!defined(_STDINT)) && (!defined(_STDINT_H))\ntypedef unsigned __int8   uint8_t;\ntypedef unsigned __int16  uint16_t;\ntypedef unsigned __int32  uint32_t;\n#else\n#include <stdint.h>\n#endif\n\n#if !defined(_WIN32_WCE)\n#include <sys/types.h>\n#endif\n\n#if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__)\n#include <sys/time.h>\n#endif\n\n#include <time.h>\n#include <limits.h>\n\n/* 'interface' might be defined as a macro on Windows, so we need to\n * undefine it so as not to break the current libusb API, because\n * libusb_config_descriptor has an 'interface' member\n * As this can be problematic if you include windows.h after libusb.h\n * in your sources, we force windows.h to be included first. */\n#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)\n#include <windows.h>\n#if defined(interface)\n#undef interface\n#endif\n#if !defined(__CYGWIN__)\n#include <winsock.h>\n#endif\n#endif\n\n#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)\n#define LIBUSB_DEPRECATED_FOR(f) \\\n  __attribute__((deprecated(\"Use \" #f \" instead\")))\n#else\n#define LIBUSB_DEPRECATED_FOR(f)\n#endif /* __GNUC__ */\n\n/** \\def LIBUSB_CALL\n * \\ingroup misc\n * libusb's Windows calling convention.\n *\n * Under Windows, the selection of available compilers and configurations\n * means that, unlike other platforms, there is not <em>one true calling\n * convention</em> (calling convention: the manner in which parameters are\n * passed to funcions in the generated assembly code).\n *\n * Matching the Windows API itself, libusb uses the WINAPI convention (which\n * translates to the <tt>stdcall</tt> convention) and guarantees that the\n * library is compiled in this way. The public header file also includes\n * appropriate annotations so that your own software will use the right\n * convention, even if another convention is being used by default within\n * your codebase.\n *\n * The one consideration that you must apply in your software is to mark\n * all functions which you use as libusb callbacks with this LIBUSB_CALL\n * annotation, so that they too get compiled for the correct calling\n * convention.\n *\n * On non-Windows operating systems, this macro is defined as nothing. This\n * means that you can apply it to your code without worrying about\n * cross-platform compatibility.\n */\n/* LIBUSB_CALL must be defined on both definition and declaration of libusb\n * functions. You'd think that declaration would be enough, but cygwin will\n * complain about conflicting types unless both are marked this way.\n * The placement of this macro is important too; it must appear after the\n * return type, before the function name. See internal documentation for\n * API_EXPORTED.\n */\n#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)\n#define LIBUSB_CALL WINAPI\n#else\n#define LIBUSB_CALL\n#endif\n\n/** \\def LIBUSB_API_VERSION\n * \\ingroup misc\n * libusb's API version.\n *\n * Since version 1.0.13, to help with feature detection, libusb defines\n * a LIBUSB_API_VERSION macro that gets increased every time there is a\n * significant change to the API, such as the introduction of a new call,\n * the definition of a new macro/enum member, or any other element that\n * libusb applications may want to detect at compilation time.\n *\n * The macro is typically used in an application as follows:\n * \\code\n * #if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01001234)\n * // Use one of the newer features from the libusb API\n * #endif\n * \\endcode\n *\n * Another feature of LIBUSB_API_VERSION is that it can be used to detect\n * whether you are compiling against the libusb or the libusb library.\n *\n * Internally, LIBUSB_API_VERSION is defined as follows:\n * (libusb major << 24) | (libusb minor << 16) | (16 bit incremental)\n */\n#define LIBUSB_API_VERSION 0x01000102\n\n/* The following is kept for compatibility, but will be deprecated in the future */\n#define LIBUSBX_API_VERSION LIBUSB_API_VERSION\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/**\n * \\ingroup misc\n * Convert a 16-bit value from host-endian to little-endian format. On\n * little endian systems, this function does nothing. On big endian systems,\n * the bytes are swapped.\n * \\param x the host-endian value to convert\n * \\returns the value in little-endian byte order\n */\nstatic inline uint16_t libusb_cpu_to_le16(const uint16_t x)\n{\n\tunion {\n\t\tuint8_t  b8[2];\n\t\tuint16_t b16;\n\t} _tmp;\n\t_tmp.b8[1] = (uint8_t) (x >> 8);\n\t_tmp.b8[0] = (uint8_t) (x & 0xff);\n\treturn _tmp.b16;\n}\n\n/** \\def libusb_le16_to_cpu\n * \\ingroup misc\n * Convert a 16-bit value from little-endian to host-endian format. On\n * little endian systems, this function does nothing. On big endian systems,\n * the bytes are swapped.\n * \\param x the little-endian value to convert\n * \\returns the value in host-endian byte order\n */\n#define libusb_le16_to_cpu libusb_cpu_to_le16\n\n/* standard USB stuff */\n\n/** \\ingroup desc\n * Device and/or Interface Class codes */\nenum libusb_class_code {\n\t/** In the context of a \\ref libusb_device_descriptor \"device descriptor\",\n\t * this bDeviceClass value indicates that each interface specifies its\n\t * own class information and all interfaces operate independently.\n\t */\n\tLIBUSB_CLASS_PER_INTERFACE = 0,\n\n\t/** Audio class */\n\tLIBUSB_CLASS_AUDIO = 1,\n\n\t/** Communications class */\n\tLIBUSB_CLASS_COMM = 2,\n\n\t/** Human Interface Device class */\n\tLIBUSB_CLASS_HID = 3,\n\n\t/** Physical */\n\tLIBUSB_CLASS_PHYSICAL = 5,\n\n\t/** Printer class */\n\tLIBUSB_CLASS_PRINTER = 7,\n\n\t/** Image class */\n\tLIBUSB_CLASS_PTP = 6, /* legacy name from libusb-0.1 usb.h */\n\tLIBUSB_CLASS_IMAGE = 6,\n\n\t/** Mass storage class */\n\tLIBUSB_CLASS_MASS_STORAGE = 8,\n\n\t/** Hub class */\n\tLIBUSB_CLASS_HUB = 9,\n\n\t/** Data class */\n\tLIBUSB_CLASS_DATA = 10,\n\n\t/** Smart Card */\n\tLIBUSB_CLASS_SMART_CARD = 0x0b,\n\n\t/** Content Security */\n\tLIBUSB_CLASS_CONTENT_SECURITY = 0x0d,\n\n\t/** Video */\n\tLIBUSB_CLASS_VIDEO = 0x0e,\n\n\t/** Personal Healthcare */\n\tLIBUSB_CLASS_PERSONAL_HEALTHCARE = 0x0f,\n\n\t/** Diagnostic Device */\n\tLIBUSB_CLASS_DIAGNOSTIC_DEVICE = 0xdc,\n\n\t/** Wireless class */\n\tLIBUSB_CLASS_WIRELESS = 0xe0,\n\n\t/** Application class */\n\tLIBUSB_CLASS_APPLICATION = 0xfe,\n\n\t/** Class is vendor-specific */\n\tLIBUSB_CLASS_VENDOR_SPEC = 0xff\n};\n\n/** \\ingroup desc\n * Descriptor types as defined by the USB specification. */\nenum libusb_descriptor_type {\n\t/** Device descriptor. See libusb_device_descriptor. */\n\tLIBUSB_DT_DEVICE = 0x01,\n\n\t/** Configuration descriptor. See libusb_config_descriptor. */\n\tLIBUSB_DT_CONFIG = 0x02,\n\n\t/** String descriptor */\n\tLIBUSB_DT_STRING = 0x03,\n\n\t/** Interface descriptor. See libusb_interface_descriptor. */\n\tLIBUSB_DT_INTERFACE = 0x04,\n\n\t/** Endpoint descriptor. See libusb_endpoint_descriptor. */\n\tLIBUSB_DT_ENDPOINT = 0x05,\n\n\t/** BOS descriptor */\n\tLIBUSB_DT_BOS = 0x0f,\n\n\t/** Device Capability descriptor */\n\tLIBUSB_DT_DEVICE_CAPABILITY = 0x10,\n\n\t/** HID descriptor */\n\tLIBUSB_DT_HID = 0x21,\n\n\t/** HID report descriptor */\n\tLIBUSB_DT_REPORT = 0x22,\n\n\t/** Physical descriptor */\n\tLIBUSB_DT_PHYSICAL = 0x23,\n\n\t/** Hub descriptor */\n\tLIBUSB_DT_HUB = 0x29,\n\n\t/** SuperSpeed Hub descriptor */\n\tLIBUSB_DT_SUPERSPEED_HUB = 0x2a,\n\n\t/** SuperSpeed Endpoint Companion descriptor */\n\tLIBUSB_DT_SS_ENDPOINT_COMPANION = 0x30\n};\n\n/* Descriptor sizes per descriptor type */\n#define LIBUSB_DT_DEVICE_SIZE\t\t\t18\n#define LIBUSB_DT_CONFIG_SIZE\t\t\t9\n#define LIBUSB_DT_INTERFACE_SIZE\t\t9\n#define LIBUSB_DT_ENDPOINT_SIZE\t\t\t7\n#define LIBUSB_DT_ENDPOINT_AUDIO_SIZE\t\t9\t/* Audio extension */\n#define LIBUSB_DT_HUB_NONVAR_SIZE\t\t7\n#define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE\t6\n#define LIBUSB_DT_BOS_SIZE\t\t\t5\n#define LIBUSB_DT_DEVICE_CAPABILITY_SIZE\t3\n\n/* BOS descriptor sizes */\n#define LIBUSB_BT_USB_2_0_EXTENSION_SIZE\t7\n#define LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE\t10\n#define LIBUSB_BT_CONTAINER_ID_SIZE\t\t20\n\n/* We unwrap the BOS => define its max size */\n#define LIBUSB_DT_BOS_MAX_SIZE\t\t((LIBUSB_DT_BOS_SIZE)     +\\\n\t\t\t\t\t(LIBUSB_BT_USB_2_0_EXTENSION_SIZE)       +\\\n\t\t\t\t\t(LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE) +\\\n\t\t\t\t\t(LIBUSB_BT_CONTAINER_ID_SIZE))\n\n#define LIBUSB_ENDPOINT_ADDRESS_MASK\t0x0f    /* in bEndpointAddress */\n#define LIBUSB_ENDPOINT_DIR_MASK\t\t0x80\n\n/** \\ingroup desc\n * Endpoint direction. Values for bit 7 of the\n * \\ref libusb_endpoint_descriptor::bEndpointAddress \"endpoint address\" scheme.\n */\nenum libusb_endpoint_direction {\n\t/** In: device-to-host */\n\tLIBUSB_ENDPOINT_IN = 0x80,\n\n\t/** Out: host-to-device */\n\tLIBUSB_ENDPOINT_OUT = 0x00\n};\n\n#define LIBUSB_TRANSFER_TYPE_MASK\t\t\t0x03    /* in bmAttributes */\n\n/** \\ingroup desc\n * Endpoint transfer type. Values for bits 0:1 of the\n * \\ref libusb_endpoint_descriptor::bmAttributes \"endpoint attributes\" field.\n */\nenum libusb_transfer_type {\n\t/** Control endpoint */\n\tLIBUSB_TRANSFER_TYPE_CONTROL = 0,\n\n\t/** Isochronous endpoint */\n\tLIBUSB_TRANSFER_TYPE_ISOCHRONOUS = 1,\n\n\t/** Bulk endpoint */\n\tLIBUSB_TRANSFER_TYPE_BULK = 2,\n\n\t/** Interrupt endpoint */\n\tLIBUSB_TRANSFER_TYPE_INTERRUPT = 3\n};\n\n/** \\ingroup misc\n * Standard requests, as defined in table 9-5 of the USB 3.0 specifications */\nenum libusb_standard_request {\n\t/** Request status of the specific recipient */\n\tLIBUSB_REQUEST_GET_STATUS = 0x00,\n\n\t/** Clear or disable a specific feature */\n\tLIBUSB_REQUEST_CLEAR_FEATURE = 0x01,\n\n\t/* 0x02 is reserved */\n\n\t/** Set or enable a specific feature */\n\tLIBUSB_REQUEST_SET_FEATURE = 0x03,\n\n\t/* 0x04 is reserved */\n\n\t/** Set device address for all future accesses */\n\tLIBUSB_REQUEST_SET_ADDRESS = 0x05,\n\n\t/** Get the specified descriptor */\n\tLIBUSB_REQUEST_GET_DESCRIPTOR = 0x06,\n\n\t/** Used to update existing descriptors or add new descriptors */\n\tLIBUSB_REQUEST_SET_DESCRIPTOR = 0x07,\n\n\t/** Get the current device configuration value */\n\tLIBUSB_REQUEST_GET_CONFIGURATION = 0x08,\n\n\t/** Set device configuration */\n\tLIBUSB_REQUEST_SET_CONFIGURATION = 0x09,\n\n\t/** Return the selected alternate setting for the specified interface */\n\tLIBUSB_REQUEST_GET_INTERFACE = 0x0A,\n\n\t/** Select an alternate interface for the specified interface */\n\tLIBUSB_REQUEST_SET_INTERFACE = 0x0B,\n\n\t/** Set then report an endpoint's synchronization frame */\n\tLIBUSB_REQUEST_SYNCH_FRAME = 0x0C,\n\n\t/** Sets both the U1 and U2 Exit Latency */\n\tLIBUSB_REQUEST_SET_SEL = 0x30,\n\n\t/** Delay from the time a host transmits a packet to the time it is\n\t  * received by the device. */\n\tLIBUSB_SET_ISOCH_DELAY = 0x31,\n};\n\n/** \\ingroup misc\n * Request type bits of the\n * \\ref libusb_control_setup::bmRequestType \"bmRequestType\" field in control\n * transfers. */\nenum libusb_request_type {\n\t/** Standard */\n\tLIBUSB_REQUEST_TYPE_STANDARD = (0x00 << 5),\n\n\t/** Class */\n\tLIBUSB_REQUEST_TYPE_CLASS = (0x01 << 5),\n\n\t/** Vendor */\n\tLIBUSB_REQUEST_TYPE_VENDOR = (0x02 << 5),\n\n\t/** Reserved */\n\tLIBUSB_REQUEST_TYPE_RESERVED = (0x03 << 5)\n};\n\n/** \\ingroup misc\n * Recipient bits of the\n * \\ref libusb_control_setup::bmRequestType \"bmRequestType\" field in control\n * transfers. Values 4 through 31 are reserved. */\nenum libusb_request_recipient {\n\t/** Device */\n\tLIBUSB_RECIPIENT_DEVICE = 0x00,\n\n\t/** Interface */\n\tLIBUSB_RECIPIENT_INTERFACE = 0x01,\n\n\t/** Endpoint */\n\tLIBUSB_RECIPIENT_ENDPOINT = 0x02,\n\n\t/** Other */\n\tLIBUSB_RECIPIENT_OTHER = 0x03,\n};\n\n#define LIBUSB_ISO_SYNC_TYPE_MASK\t\t0x0C\n\n/** \\ingroup desc\n * Synchronization type for isochronous endpoints. Values for bits 2:3 of the\n * \\ref libusb_endpoint_descriptor::bmAttributes \"bmAttributes\" field in\n * libusb_endpoint_descriptor.\n */\nenum libusb_iso_sync_type {\n\t/** No synchronization */\n\tLIBUSB_ISO_SYNC_TYPE_NONE = 0,\n\n\t/** Asynchronous */\n\tLIBUSB_ISO_SYNC_TYPE_ASYNC = 1,\n\n\t/** Adaptive */\n\tLIBUSB_ISO_SYNC_TYPE_ADAPTIVE = 2,\n\n\t/** Synchronous */\n\tLIBUSB_ISO_SYNC_TYPE_SYNC = 3\n};\n\n#define LIBUSB_ISO_USAGE_TYPE_MASK 0x30\n\n/** \\ingroup desc\n * Usage type for isochronous endpoints. Values for bits 4:5 of the\n * \\ref libusb_endpoint_descriptor::bmAttributes \"bmAttributes\" field in\n * libusb_endpoint_descriptor.\n */\nenum libusb_iso_usage_type {\n\t/** Data endpoint */\n\tLIBUSB_ISO_USAGE_TYPE_DATA = 0,\n\n\t/** Feedback endpoint */\n\tLIBUSB_ISO_USAGE_TYPE_FEEDBACK = 1,\n\n\t/** Implicit feedback Data endpoint */\n\tLIBUSB_ISO_USAGE_TYPE_IMPLICIT = 2,\n};\n\n/** \\ingroup desc\n * A structure representing the standard USB device descriptor. This\n * descriptor is documented in section 9.6.1 of the USB 3.0 specification.\n * All multiple-byte fields are represented in host-endian format.\n */\nstruct libusb_device_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_DEVICE LIBUSB_DT_DEVICE in this\n\t * context. */\n\tuint8_t  bDescriptorType;\n\n\t/** USB specification release number in binary-coded decimal. A value of\n\t * 0x0200 indicates USB 2.0, 0x0110 indicates USB 1.1, etc. */\n\tuint16_t bcdUSB;\n\n\t/** USB-IF class code for the device. See \\ref libusb_class_code. */\n\tuint8_t  bDeviceClass;\n\n\t/** USB-IF subclass code for the device, qualified by the bDeviceClass\n\t * value */\n\tuint8_t  bDeviceSubClass;\n\n\t/** USB-IF protocol code for the device, qualified by the bDeviceClass and\n\t * bDeviceSubClass values */\n\tuint8_t  bDeviceProtocol;\n\n\t/** Maximum packet size for endpoint 0 */\n\tuint8_t  bMaxPacketSize0;\n\n\t/** USB-IF vendor ID */\n\tuint16_t idVendor;\n\n\t/** USB-IF product ID */\n\tuint16_t idProduct;\n\n\t/** Device release number in binary-coded decimal */\n\tuint16_t bcdDevice;\n\n\t/** Index of string descriptor describing manufacturer */\n\tuint8_t  iManufacturer;\n\n\t/** Index of string descriptor describing product */\n\tuint8_t  iProduct;\n\n\t/** Index of string descriptor containing device serial number */\n\tuint8_t  iSerialNumber;\n\n\t/** Number of possible configurations */\n\tuint8_t  bNumConfigurations;\n};\n\n/** \\ingroup desc\n * A structure representing the standard USB endpoint descriptor. This\n * descriptor is documented in section 9.6.6 of the USB 3.0 specification.\n * All multiple-byte fields are represented in host-endian format.\n */\nstruct libusb_endpoint_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_ENDPOINT LIBUSB_DT_ENDPOINT in\n\t * this context. */\n\tuint8_t  bDescriptorType;\n\n\t/** The address of the endpoint described by this descriptor. Bits 0:3 are\n\t * the endpoint number. Bits 4:6 are reserved. Bit 7 indicates direction,\n\t * see \\ref libusb_endpoint_direction.\n\t */\n\tuint8_t  bEndpointAddress;\n\n\t/** Attributes which apply to the endpoint when it is configured using\n\t * the bConfigurationValue. Bits 0:1 determine the transfer type and\n\t * correspond to \\ref libusb_transfer_type. Bits 2:3 are only used for\n\t * isochronous endpoints and correspond to \\ref libusb_iso_sync_type.\n\t * Bits 4:5 are also only used for isochronous endpoints and correspond to\n\t * \\ref libusb_iso_usage_type. Bits 6:7 are reserved.\n\t */\n\tuint8_t  bmAttributes;\n\n\t/** Maximum packet size this endpoint is capable of sending/receiving. */\n\tuint16_t wMaxPacketSize;\n\n\t/** Interval for polling endpoint for data transfers. */\n\tuint8_t  bInterval;\n\n\t/** For audio devices only: the rate at which synchronization feedback\n\t * is provided. */\n\tuint8_t  bRefresh;\n\n\t/** For audio devices only: the address if the synch endpoint */\n\tuint8_t  bSynchAddress;\n\n\t/** Extra descriptors. If libusb encounters unknown endpoint descriptors,\n\t * it will store them here, should you wish to parse them. */\n\tconst unsigned char *extra;\n\n\t/** Length of the extra descriptors, in bytes. */\n\tint extra_length;\n};\n\n/** \\ingroup desc\n * A structure representing the standard USB interface descriptor. This\n * descriptor is documented in section 9.6.5 of the USB 3.0 specification.\n * All multiple-byte fields are represented in host-endian format.\n */\nstruct libusb_interface_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_INTERFACE LIBUSB_DT_INTERFACE\n\t * in this context. */\n\tuint8_t  bDescriptorType;\n\n\t/** Number of this interface */\n\tuint8_t  bInterfaceNumber;\n\n\t/** Value used to select this alternate setting for this interface */\n\tuint8_t  bAlternateSetting;\n\n\t/** Number of endpoints used by this interface (excluding the control\n\t * endpoint). */\n\tuint8_t  bNumEndpoints;\n\n\t/** USB-IF class code for this interface. See \\ref libusb_class_code. */\n\tuint8_t  bInterfaceClass;\n\n\t/** USB-IF subclass code for this interface, qualified by the\n\t * bInterfaceClass value */\n\tuint8_t  bInterfaceSubClass;\n\n\t/** USB-IF protocol code for this interface, qualified by the\n\t * bInterfaceClass and bInterfaceSubClass values */\n\tuint8_t  bInterfaceProtocol;\n\n\t/** Index of string descriptor describing this interface */\n\tuint8_t  iInterface;\n\n\t/** Array of endpoint descriptors. This length of this array is determined\n\t * by the bNumEndpoints field. */\n\tconst struct libusb_endpoint_descriptor *endpoint;\n\n\t/** Extra descriptors. If libusb encounters unknown interface descriptors,\n\t * it will store them here, should you wish to parse them. */\n\tconst unsigned char *extra;\n\n\t/** Length of the extra descriptors, in bytes. */\n\tint extra_length;\n};\n\n/** \\ingroup desc\n * A collection of alternate settings for a particular USB interface.\n */\nstruct libusb_interface {\n\t/** Array of interface descriptors. The length of this array is determined\n\t * by the num_altsetting field. */\n\tconst struct libusb_interface_descriptor *altsetting;\n\n\t/** The number of alternate settings that belong to this interface */\n\tint num_altsetting;\n};\n\n/** \\ingroup desc\n * A structure representing the standard USB configuration descriptor. This\n * descriptor is documented in section 9.6.3 of the USB 3.0 specification.\n * All multiple-byte fields are represented in host-endian format.\n */\nstruct libusb_config_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_CONFIG LIBUSB_DT_CONFIG\n\t * in this context. */\n\tuint8_t  bDescriptorType;\n\n\t/** Total length of data returned for this configuration */\n\tuint16_t wTotalLength;\n\n\t/** Number of interfaces supported by this configuration */\n\tuint8_t  bNumInterfaces;\n\n\t/** Identifier value for this configuration */\n\tuint8_t  bConfigurationValue;\n\n\t/** Index of string descriptor describing this configuration */\n\tuint8_t  iConfiguration;\n\n\t/** Configuration characteristics */\n\tuint8_t  bmAttributes;\n\n\t/** Maximum power consumption of the USB device from this bus in this\n\t * configuration when the device is fully opreation. Expressed in units\n\t * of 2 mA. */\n\tuint8_t  MaxPower;\n\n\t/** Array of interfaces supported by this configuration. The length of\n\t * this array is determined by the bNumInterfaces field. */\n\tconst struct libusb_interface *interface;\n\n\t/** Extra descriptors. If libusb encounters unknown configuration\n\t * descriptors, it will store them here, should you wish to parse them. */\n\tconst unsigned char *extra;\n\n\t/** Length of the extra descriptors, in bytes. */\n\tint extra_length;\n};\n\n/** \\ingroup desc\n * A structure representing the superspeed endpoint companion\n * descriptor. This descriptor is documented in section 9.6.7 of\n * the USB 3.0 specification. All multiple-byte fields are represented in\n * host-endian format.\n */\nstruct libusb_ss_endpoint_companion_descriptor {\n\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_SS_ENDPOINT_COMPANION in\n\t * this context. */\n\tuint8_t  bDescriptorType;\n\n\n\t/** The maximum number of packets the endpoint can send or\n\t *  recieve as part of a burst. */\n\tuint8_t  bMaxBurst;\n\n\t/** In bulk EP:\tbits 4:0 represents the\tmaximum\tnumber of\n\t *  streams the\tEP supports. In\tisochronous EP:\tbits 1:0\n\t *  represents the Mult\t- a zero based value that determines\n\t *  the\tmaximum\tnumber of packets within a service interval  */\n\tuint8_t  bmAttributes;\n\n\t/** The\ttotal number of bytes this EP will transfer every\n\t *  service interval. valid only for periodic EPs. */\n\tuint16_t wBytesPerInterval;\n};\n\n/** \\ingroup desc\n * A generic representation of a BOS Device Capability descriptor. It is\n * advised to check bDevCapabilityType and call the matching\n * libusb_get_*_descriptor function to get a structure fully matching the type.\n */\nstruct libusb_bos_dev_capability_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t bLength;\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY\n\t * LIBUSB_DT_DEVICE_CAPABILITY in this context. */\n\tuint8_t bDescriptorType;\n\t/** Device Capability type */\n\tuint8_t bDevCapabilityType;\n\t/** Device Capability data (bLength - 3 bytes) */\n\tuint8_t dev_capability_data\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)\n\t[] /* valid C99 code */\n#else\n\t[0] /* non-standard, but usually working code */\n#endif\n\t;\n};\n\n/** \\ingroup desc\n * A structure representing the Binary Device Object Store (BOS) descriptor.\n * This descriptor is documented in section 9.6.2 of the USB 3.0 specification.\n * All multiple-byte fields are represented in host-endian format.\n */\nstruct libusb_bos_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_BOS LIBUSB_DT_BOS\n\t * in this context. */\n\tuint8_t  bDescriptorType;\n\n\t/** Length of this descriptor and all of its sub descriptors */\n\tuint16_t wTotalLength;\n\n\t/** The number of separate device capability descriptors in\n\t * the BOS */\n\tuint8_t  bNumDeviceCaps;\n\n\t/** bNumDeviceCap Device Capability Descriptors */\n\tstruct libusb_bos_dev_capability_descriptor *dev_capability\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)\n\t[] /* valid C99 code */\n#else\n\t[0] /* non-standard, but usually working code */\n#endif\n\t;\n};\n\n/** \\ingroup desc\n * A structure representing the USB 2.0 Extension descriptor\n * This descriptor is documented in section 9.6.2.1 of the USB 3.0 specification.\n * All multiple-byte fields are represented in host-endian format.\n */\nstruct libusb_usb_2_0_extension_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY\n\t * LIBUSB_DT_DEVICE_CAPABILITY in this context. */\n\tuint8_t  bDescriptorType;\n\n\t/** Capability type. Will have value\n\t * \\ref libusb_capability_type::LIBUSB_BT_USB_2_0_EXTENSION\n\t * LIBUSB_BT_USB_2_0_EXTENSION in this context. */\n\tuint8_t  bDevCapabilityType;\n\n\t/** Bitmap encoding of supported device level features.\n\t * A value of one in a bit location indicates a feature is\n\t * supported; a value of zero indicates it is not supported.\n\t * See \\ref libusb_usb_2_0_extension_attributes. */\n\tuint32_t  bmAttributes;\n};\n\n/** \\ingroup desc\n * A structure representing the SuperSpeed USB Device Capability descriptor\n * This descriptor is documented in section 9.6.2.2 of the USB 3.0 specification.\n * All multiple-byte fields are represented in host-endian format.\n */\nstruct libusb_ss_usb_device_capability_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY\n\t * LIBUSB_DT_DEVICE_CAPABILITY in this context. */\n\tuint8_t  bDescriptorType;\n\n\t/** Capability type. Will have value\n\t * \\ref libusb_capability_type::LIBUSB_BT_SS_USB_DEVICE_CAPABILITY\n\t * LIBUSB_BT_SS_USB_DEVICE_CAPABILITY in this context. */\n\tuint8_t  bDevCapabilityType;\n\n\t/** Bitmap encoding of supported device level features.\n\t * A value of one in a bit location indicates a feature is\n\t * supported; a value of zero indicates it is not supported.\n\t * See \\ref libusb_ss_usb_device_capability_attributes. */\n\tuint8_t  bmAttributes;\n\n\t/** Bitmap encoding of the speed supported by this device when\n\t * operating in SuperSpeed mode. See \\ref libusb_supported_speed. */\n\tuint16_t wSpeedSupported;\n\n\t/** The lowest speed at which all the functionality supported\n\t * by the device is available to the user. For example if the\n\t * device supports all its functionality when connected at\n\t * full speed and above then it sets this value to 1. */\n\tuint8_t  bFunctionalitySupport;\n\n\t/** U1 Device Exit Latency. */\n\tuint8_t  bU1DevExitLat;\n\n\t/** U2 Device Exit Latency. */\n\tuint16_t bU2DevExitLat;\n};\n\n/** \\ingroup desc\n * A structure representing the Container ID descriptor.\n * This descriptor is documented in section 9.6.2.3 of the USB 3.0 specification.\n * All multiple-byte fields, except UUIDs, are represented in host-endian format.\n */\nstruct libusb_container_id_descriptor {\n\t/** Size of this descriptor (in bytes) */\n\tuint8_t  bLength;\n\n\t/** Descriptor type. Will have value\n\t * \\ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY\n\t * LIBUSB_DT_DEVICE_CAPABILITY in this context. */\n\tuint8_t  bDescriptorType;\n\n\t/** Capability type. Will have value\n\t * \\ref libusb_capability_type::LIBUSB_BT_CONTAINER_ID\n\t * LIBUSB_BT_CONTAINER_ID in this context. */\n\tuint8_t  bDevCapabilityType;\n\n\t/** Reserved field */\n\tuint8_t bReserved;\n\n\t/** 128 bit UUID */\n\tuint8_t  ContainerID[16];\n};\n\n/** \\ingroup asyncio\n * Setup packet for control transfers. */\nstruct libusb_control_setup {\n\t/** Request type. Bits 0:4 determine recipient, see\n\t * \\ref libusb_request_recipient. Bits 5:6 determine type, see\n\t * \\ref libusb_request_type. Bit 7 determines data transfer direction, see\n\t * \\ref libusb_endpoint_direction.\n\t */\n\tuint8_t  bmRequestType;\n\n\t/** Request. If the type bits of bmRequestType are equal to\n\t * \\ref libusb_request_type::LIBUSB_REQUEST_TYPE_STANDARD\n\t * \"LIBUSB_REQUEST_TYPE_STANDARD\" then this field refers to\n\t * \\ref libusb_standard_request. For other cases, use of this field is\n\t * application-specific. */\n\tuint8_t  bRequest;\n\n\t/** Value. Varies according to request */\n\tuint16_t wValue;\n\n\t/** Index. Varies according to request, typically used to pass an index\n\t * or offset */\n\tuint16_t wIndex;\n\n\t/** Number of bytes to transfer */\n\tuint16_t wLength;\n};\n\n#define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup))\n\n/* libusb */\n\nstruct libusb_context;\nstruct libusb_device;\nstruct libusb_device_handle;\nstruct libusb_hotplug_callback;\n\n/** \\ingroup lib\n * Structure providing the version of the libusb runtime\n */\nstruct libusb_version {\n\t/** Library major version. */\n\tconst uint16_t major;\n\n\t/** Library minor version. */\n\tconst uint16_t minor;\n\n\t/** Library micro version. */\n\tconst uint16_t micro;\n\n\t/** Library nano version. */\n\tconst uint16_t nano;\n\n\t/** Library release candidate suffix string, e.g. \"-rc4\". */\n\tconst char *rc;\n\n\t/** For ABI compatibility only. */\n\tconst char* describe;\n};\n\n/** \\ingroup lib\n * Structure representing a libusb session. The concept of individual libusb\n * sessions allows for your program to use two libraries (or dynamically\n * load two modules) which both independently use libusb. This will prevent\n * interference between the individual libusb users - for example\n * libusb_set_debug() will not affect the other user of the library, and\n * libusb_exit() will not destroy resources that the other user is still\n * using.\n *\n * Sessions are created by libusb_init() and destroyed through libusb_exit().\n * If your application is guaranteed to only ever include a single libusb\n * user (i.e. you), you do not have to worry about contexts: pass NULL in\n * every function call where a context is required. The default context\n * will be used.\n *\n * For more information, see \\ref contexts.\n */\ntypedef struct libusb_context libusb_context;\n\n/** \\ingroup dev\n * Structure representing a USB device detected on the system. This is an\n * opaque type for which you are only ever provided with a pointer, usually\n * originating from libusb_get_device_list().\n *\n * Certain operations can be performed on a device, but in order to do any\n * I/O you will have to first obtain a device handle using libusb_open().\n *\n * Devices are reference counted with libusb_ref_device() and\n * libusb_unref_device(), and are freed when the reference count reaches 0.\n * New devices presented by libusb_get_device_list() have a reference count of\n * 1, and libusb_free_device_list() can optionally decrease the reference count\n * on all devices in the list. libusb_open() adds another reference which is\n * later destroyed by libusb_close().\n */\ntypedef struct libusb_device libusb_device;\n\n\n/** \\ingroup dev\n * Structure representing a handle on a USB device. This is an opaque type for\n * which you are only ever provided with a pointer, usually originating from\n * libusb_open().\n *\n * A device handle is used to perform I/O and other operations. When finished\n * with a device handle, you should call libusb_close().\n */\ntypedef struct libusb_device_handle libusb_device_handle;\n\n/** \\ingroup dev\n * Speed codes. Indicates the speed at which the device is operating.\n */\nenum libusb_speed {\n\t/** The OS doesn't report or know the device speed. */\n\tLIBUSB_SPEED_UNKNOWN = 0,\n\n\t/** The device is operating at low speed (1.5MBit/s). */\n\tLIBUSB_SPEED_LOW = 1,\n\n\t/** The device is operating at full speed (12MBit/s). */\n\tLIBUSB_SPEED_FULL = 2,\n\n\t/** The device is operating at high speed (480MBit/s). */\n\tLIBUSB_SPEED_HIGH = 3,\n\n\t/** The device is operating at super speed (5000MBit/s). */\n\tLIBUSB_SPEED_SUPER = 4,\n};\n\n/** \\ingroup dev\n * Supported speeds (wSpeedSupported) bitfield. Indicates what\n * speeds the device supports.\n */\nenum libusb_supported_speed {\n\t/** Low speed operation supported (1.5MBit/s). */\n\tLIBUSB_LOW_SPEED_OPERATION   = 1,\n\n\t/** Full speed operation supported (12MBit/s). */\n\tLIBUSB_FULL_SPEED_OPERATION  = 2,\n\n\t/** High speed operation supported (480MBit/s). */\n\tLIBUSB_HIGH_SPEED_OPERATION  = 4,\n\n\t/** Superspeed operation supported (5000MBit/s). */\n\tLIBUSB_SUPER_SPEED_OPERATION = 8,\n};\n\n/** \\ingroup dev\n * Masks for the bits of the\n * \\ref libusb_usb_2_0_extension_descriptor::bmAttributes \"bmAttributes\" field\n * of the USB 2.0 Extension descriptor.\n */\nenum libusb_usb_2_0_extension_attributes {\n\t/** Supports Link Power Management (LPM) */\n\tLIBUSB_BM_LPM_SUPPORT = 2,\n};\n\n/** \\ingroup dev\n * Masks for the bits of the\n * \\ref libusb_ss_usb_device_capability_descriptor::bmAttributes \"bmAttributes\" field\n * field of the SuperSpeed USB Device Capability descriptor.\n */\nenum libusb_ss_usb_device_capability_attributes {\n\t/** Supports Latency Tolerance Messages (LTM) */\n\tLIBUSB_BM_LTM_SUPPORT = 2,\n};\n\n/** \\ingroup dev\n * USB capability types\n */\nenum libusb_bos_type {\n\t/** Wireless USB device capability */\n\tLIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY\t= 1,\n\n\t/** USB 2.0 extensions */\n\tLIBUSB_BT_USB_2_0_EXTENSION\t\t\t= 2,\n\n\t/** SuperSpeed USB device capability */\n\tLIBUSB_BT_SS_USB_DEVICE_CAPABILITY\t\t= 3,\n\n\t/** Container ID type */\n\tLIBUSB_BT_CONTAINER_ID\t\t\t\t= 4,\n};\n\n/** \\ingroup misc\n * Error codes. Most libusb functions return 0 on success or one of these\n * codes on failure.\n * You can call libusb_error_name() to retrieve a string representation of an\n * error code or libusb_strerror() to get an end-user suitable description of\n * an error code.\n */\nenum libusb_error {\n\t/** Success (no error) */\n\tLIBUSB_SUCCESS = 0,\n\n\t/** Input/output error */\n\tLIBUSB_ERROR_IO = -1,\n\n\t/** Invalid parameter */\n\tLIBUSB_ERROR_INVALID_PARAM = -2,\n\n\t/** Access denied (insufficient permissions) */\n\tLIBUSB_ERROR_ACCESS = -3,\n\n\t/** No such device (it may have been disconnected) */\n\tLIBUSB_ERROR_NO_DEVICE = -4,\n\n\t/** Entity not found */\n\tLIBUSB_ERROR_NOT_FOUND = -5,\n\n\t/** Resource busy */\n\tLIBUSB_ERROR_BUSY = -6,\n\n\t/** Operation timed out */\n\tLIBUSB_ERROR_TIMEOUT = -7,\n\n\t/** Overflow */\n\tLIBUSB_ERROR_OVERFLOW = -8,\n\n\t/** Pipe error */\n\tLIBUSB_ERROR_PIPE = -9,\n\n\t/** System call interrupted (perhaps due to signal) */\n\tLIBUSB_ERROR_INTERRUPTED = -10,\n\n\t/** Insufficient memory */\n\tLIBUSB_ERROR_NO_MEM = -11,\n\n\t/** Operation not supported or unimplemented on this platform */\n\tLIBUSB_ERROR_NOT_SUPPORTED = -12,\n\n\t/* NB: Remember to update LIBUSB_ERROR_COUNT below as well as the\n\t   message strings in strerror.c when adding new error codes here. */\n\n\t/** Other error */\n\tLIBUSB_ERROR_OTHER = -99,\n};\n\n/* Total number of error codes in enum libusb_error */\n#define LIBUSB_ERROR_COUNT 14\n\n/** \\ingroup asyncio\n * Transfer status codes */\nenum libusb_transfer_status {\n\t/** Transfer completed without error. Note that this does not indicate\n\t * that the entire amount of requested data was transferred. */\n\tLIBUSB_TRANSFER_COMPLETED,\n\n\t/** Transfer failed */\n\tLIBUSB_TRANSFER_ERROR,\n\n\t/** Transfer timed out */\n\tLIBUSB_TRANSFER_TIMED_OUT,\n\n\t/** Transfer was cancelled */\n\tLIBUSB_TRANSFER_CANCELLED,\n\n\t/** For bulk/interrupt endpoints: halt condition detected (endpoint\n\t * stalled). For control endpoints: control request not supported. */\n\tLIBUSB_TRANSFER_STALL,\n\n\t/** Device was disconnected */\n\tLIBUSB_TRANSFER_NO_DEVICE,\n\n\t/** Device sent more data than requested */\n\tLIBUSB_TRANSFER_OVERFLOW,\n\n\t/* NB! Remember to update libusb_error_name()\n\t   when adding new status codes here. */\n};\n\n/** \\ingroup asyncio\n * libusb_transfer.flags values */\nenum libusb_transfer_flags {\n\t/** Report short frames as errors */\n\tLIBUSB_TRANSFER_SHORT_NOT_OK = 1<<0,\n\n\t/** Automatically free() transfer buffer during libusb_free_transfer() */\n\tLIBUSB_TRANSFER_FREE_BUFFER = 1<<1,\n\n\t/** Automatically call libusb_free_transfer() after callback returns.\n\t * If this flag is set, it is illegal to call libusb_free_transfer()\n\t * from your transfer callback, as this will result in a double-free\n\t * when this flag is acted upon. */\n\tLIBUSB_TRANSFER_FREE_TRANSFER = 1<<2,\n\n\t/** Terminate transfers that are a multiple of the endpoint's\n\t * wMaxPacketSize with an extra zero length packet. This is useful\n\t * when a device protocol mandates that each logical request is\n\t * terminated by an incomplete packet (i.e. the logical requests are\n\t * not separated by other means).\n\t *\n\t * This flag only affects host-to-device transfers to bulk and interrupt\n\t * endpoints. In other situations, it is ignored.\n\t *\n\t * This flag only affects transfers with a length that is a multiple of\n\t * the endpoint's wMaxPacketSize. On transfers of other lengths, this\n\t * flag has no effect. Therefore, if you are working with a device that\n\t * needs a ZLP whenever the end of the logical request falls on a packet\n\t * boundary, then it is sensible to set this flag on <em>every</em>\n\t * transfer (you do not have to worry about only setting it on transfers\n\t * that end on the boundary).\n\t *\n\t * This flag is currently only supported on Linux.\n\t * On other systems, libusb_submit_transfer() will return\n\t * LIBUSB_ERROR_NOT_SUPPORTED for every transfer where this flag is set.\n\t *\n\t * Available since libusb-1.0.9.\n\t */\n\tLIBUSB_TRANSFER_ADD_ZERO_PACKET = 1 << 3,\n};\n\n/** \\ingroup asyncio\n * Isochronous packet descriptor. */\nstruct libusb_iso_packet_descriptor {\n\t/** Length of data to request in this packet */\n\tunsigned int length;\n\n\t/** Amount of data that was actually transferred */\n\tunsigned int actual_length;\n\n\t/** Status code for this packet */\n\tenum libusb_transfer_status status;\n};\n\nstruct libusb_transfer;\n\n/** \\ingroup asyncio\n * Asynchronous transfer callback function type. When submitting asynchronous\n * transfers, you pass a pointer to a callback function of this type via the\n * \\ref libusb_transfer::callback \"callback\" member of the libusb_transfer\n * structure. libusb will call this function later, when the transfer has\n * completed or failed. See \\ref asyncio for more information.\n * \\param transfer The libusb_transfer struct the callback function is being\n * notified about.\n */\ntypedef void (LIBUSB_CALL *libusb_transfer_cb_fn)(struct libusb_transfer *transfer);\n\n/** \\ingroup asyncio\n * The generic USB transfer structure. The user populates this structure and\n * then submits it in order to request a transfer. After the transfer has\n * completed, the library populates the transfer with the results and passes\n * it back to the user.\n */\nstruct libusb_transfer {\n\t/** Handle of the device that this transfer will be submitted to */\n\tlibusb_device_handle *dev_handle;\n\n\t/** A bitwise OR combination of \\ref libusb_transfer_flags. */\n\tuint8_t flags;\n\n\t/** Address of the endpoint where this transfer will be sent. */\n\tunsigned char endpoint;\n\n\t/** Type of the endpoint from \\ref libusb_transfer_type */\n\tunsigned char type;\n\n\t/** Timeout for this transfer in millseconds. A value of 0 indicates no\n\t * timeout. */\n\tunsigned int timeout;\n\n\t/** The status of the transfer. Read-only, and only for use within\n\t * transfer callback function.\n\t *\n\t * If this is an isochronous transfer, this field may read COMPLETED even\n\t * if there were errors in the frames. Use the\n\t * \\ref libusb_iso_packet_descriptor::status \"status\" field in each packet\n\t * to determine if errors occurred. */\n\tenum libusb_transfer_status status;\n\n\t/** Length of the data buffer */\n\tint length;\n\n\t/** Actual length of data that was transferred. Read-only, and only for\n\t * use within transfer callback function. Not valid for isochronous\n\t * endpoint transfers. */\n\tint actual_length;\n\n\t/** Callback function. This will be invoked when the transfer completes,\n\t * fails, or is cancelled. */\n\tlibusb_transfer_cb_fn callback;\n\n\t/** User context data to pass to the callback function. */\n\tvoid *user_data;\n\n\t/** Data buffer */\n\tunsigned char *buffer;\n\n\t/** Number of isochronous packets. Only used for I/O with isochronous\n\t * endpoints. */\n\tint num_iso_packets;\n\n\t/** Isochronous packet descriptors, for isochronous transfers only. */\n\tstruct libusb_iso_packet_descriptor iso_packet_desc\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)\n\t[] /* valid C99 code */\n#else\n\t[0] /* non-standard, but usually working code */\n#endif\n\t;\n};\n\n/** \\ingroup misc\n * Capabilities supported by an instance of libusb on the current running\n * platform. Test if the loaded library supports a given capability by calling\n * \\ref libusb_has_capability().\n */\nenum libusb_capability {\n\t/** The libusb_has_capability() API is available. */\n\tLIBUSB_CAP_HAS_CAPABILITY = 0x0000,\n\t/** Hotplug support is available on this platform. */\n\tLIBUSB_CAP_HAS_HOTPLUG = 0x0001,\n\t/** The library can access HID devices without requiring user intervention.\n\t * Note that before being able to actually access an HID device, you may\n\t * still have to call additional libusb functions such as\n\t * \\ref libusb_detach_kernel_driver(). */\n\tLIBUSB_CAP_HAS_HID_ACCESS = 0x0100,\n\t/** The library supports detaching of the default USB driver, using \n\t * \\ref libusb_detach_kernel_driver(), if one is set by the OS kernel */\n\tLIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER = 0x0101\n};\n\n/** \\ingroup lib\n *  Log message levels.\n *  - LIBUSB_LOG_LEVEL_NONE (0)    : no messages ever printed by the library (default)\n *  - LIBUSB_LOG_LEVEL_ERROR (1)   : error messages are printed to stderr\n *  - LIBUSB_LOG_LEVEL_WARNING (2) : warning and error messages are printed to stderr\n *  - LIBUSB_LOG_LEVEL_INFO (3)    : informational messages are printed to stdout, warning\n *    and error messages are printed to stderr\n *  - LIBUSB_LOG_LEVEL_DEBUG (4)   : debug and informational messages are printed to stdout,\n *    warnings and errors to stderr\n */\nenum libusb_log_level {\n\tLIBUSB_LOG_LEVEL_NONE = 0,\n\tLIBUSB_LOG_LEVEL_ERROR,\n\tLIBUSB_LOG_LEVEL_WARNING,\n\tLIBUSB_LOG_LEVEL_INFO,\n\tLIBUSB_LOG_LEVEL_DEBUG,\n};\n\nint LIBUSB_CALL libusb_init(libusb_context **ctx);\nvoid LIBUSB_CALL libusb_exit(libusb_context *ctx);\nvoid LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);\nconst struct libusb_version * LIBUSB_CALL libusb_get_version(void);\nint LIBUSB_CALL libusb_has_capability(uint32_t capability);\nconst char * LIBUSB_CALL libusb_error_name(int errcode);\nint LIBUSB_CALL libusb_setlocale(const char *locale);\nconst char * LIBUSB_CALL libusb_strerror(enum libusb_error errcode);\n\nssize_t LIBUSB_CALL libusb_get_device_list(libusb_context *ctx,\n\tlibusb_device ***list);\nvoid LIBUSB_CALL libusb_free_device_list(libusb_device **list,\n\tint unref_devices);\nlibusb_device * LIBUSB_CALL libusb_ref_device(libusb_device *dev);\nvoid LIBUSB_CALL libusb_unref_device(libusb_device *dev);\n\nint LIBUSB_CALL libusb_get_configuration(libusb_device_handle *dev,\n\tint *config);\nint LIBUSB_CALL libusb_get_device_descriptor(libusb_device *dev,\n\tstruct libusb_device_descriptor *desc);\nint LIBUSB_CALL libusb_get_active_config_descriptor(libusb_device *dev,\n\tstruct libusb_config_descriptor **config);\nint LIBUSB_CALL libusb_get_config_descriptor(libusb_device *dev,\n\tuint8_t config_index, struct libusb_config_descriptor **config);\nint LIBUSB_CALL libusb_get_config_descriptor_by_value(libusb_device *dev,\n\tuint8_t bConfigurationValue, struct libusb_config_descriptor **config);\nvoid LIBUSB_CALL libusb_free_config_descriptor(\n\tstruct libusb_config_descriptor *config);\nint LIBUSB_CALL libusb_get_ss_endpoint_companion_descriptor(\n\tstruct libusb_context *ctx,\n\tconst struct libusb_endpoint_descriptor *endpoint,\n\tstruct libusb_ss_endpoint_companion_descriptor **ep_comp);\nvoid LIBUSB_CALL libusb_free_ss_endpoint_companion_descriptor(\n\tstruct libusb_ss_endpoint_companion_descriptor *ep_comp);\nint LIBUSB_CALL libusb_get_bos_descriptor(libusb_device_handle *handle,\n\tstruct libusb_bos_descriptor **bos);\nvoid LIBUSB_CALL libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos);\nint LIBUSB_CALL libusb_get_usb_2_0_extension_descriptor(\n\tstruct libusb_context *ctx,\n\tstruct libusb_bos_dev_capability_descriptor *dev_cap,\n\tstruct libusb_usb_2_0_extension_descriptor **usb_2_0_extension);\nvoid LIBUSB_CALL libusb_free_usb_2_0_extension_descriptor(\n\tstruct libusb_usb_2_0_extension_descriptor *usb_2_0_extension);\nint LIBUSB_CALL libusb_get_ss_usb_device_capability_descriptor(\n\tstruct libusb_context *ctx,\n\tstruct libusb_bos_dev_capability_descriptor *dev_cap,\n\tstruct libusb_ss_usb_device_capability_descriptor **ss_usb_device_cap);\nvoid LIBUSB_CALL libusb_free_ss_usb_device_capability_descriptor(\n\tstruct libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap);\nint LIBUSB_CALL libusb_get_container_id_descriptor(struct libusb_context *ctx,\n\tstruct libusb_bos_dev_capability_descriptor *dev_cap,\n\tstruct libusb_container_id_descriptor **container_id);\nvoid LIBUSB_CALL libusb_free_container_id_descriptor(\n\tstruct libusb_container_id_descriptor *container_id);\nuint8_t LIBUSB_CALL libusb_get_bus_number(libusb_device *dev);\nuint8_t LIBUSB_CALL libusb_get_port_number(libusb_device *dev);\nint LIBUSB_CALL libusb_get_port_numbers(libusb_device *dev, uint8_t* port_numbers, int port_numbers_len);\nLIBUSB_DEPRECATED_FOR(libusb_get_port_numbers)\nint LIBUSB_CALL libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t* path, uint8_t path_length);\nlibusb_device * LIBUSB_CALL libusb_get_parent(libusb_device *dev);\nuint8_t LIBUSB_CALL libusb_get_device_address(libusb_device *dev);\nint LIBUSB_CALL libusb_get_device_speed(libusb_device *dev);\nint LIBUSB_CALL libusb_get_max_packet_size(libusb_device *dev,\n\tunsigned char endpoint);\nint LIBUSB_CALL libusb_get_max_iso_packet_size(libusb_device *dev,\n\tunsigned char endpoint);\n\nint LIBUSB_CALL libusb_open(libusb_device *dev, libusb_device_handle **handle);\nvoid LIBUSB_CALL libusb_close(libusb_device_handle *dev_handle);\nlibusb_device * LIBUSB_CALL libusb_get_device(libusb_device_handle *dev_handle);\n\nint LIBUSB_CALL libusb_set_configuration(libusb_device_handle *dev,\n\tint configuration);\nint LIBUSB_CALL libusb_claim_interface(libusb_device_handle *dev,\n\tint interface_number);\nint LIBUSB_CALL libusb_release_interface(libusb_device_handle *dev,\n\tint interface_number);\n\nlibusb_device_handle * LIBUSB_CALL libusb_open_device_with_vid_pid(\n\tlibusb_context *ctx, uint16_t vendor_id, uint16_t product_id);\n\nint LIBUSB_CALL libusb_set_interface_alt_setting(libusb_device_handle *dev,\n\tint interface_number, int alternate_setting);\nint LIBUSB_CALL libusb_clear_halt(libusb_device_handle *dev,\n\tunsigned char endpoint);\nint LIBUSB_CALL libusb_reset_device(libusb_device_handle *dev);\n\nint LIBUSB_CALL libusb_kernel_driver_active(libusb_device_handle *dev,\n\tint interface_number);\nint LIBUSB_CALL libusb_detach_kernel_driver(libusb_device_handle *dev,\n\tint interface_number);\nint LIBUSB_CALL libusb_attach_kernel_driver(libusb_device_handle *dev,\n\tint interface_number);\nint LIBUSB_CALL libusb_set_auto_detach_kernel_driver(\n\tlibusb_device_handle *dev, int enable);\n\n/* async I/O */\n\n/** \\ingroup asyncio\n * Get the data section of a control transfer. This convenience function is here\n * to remind you that the data does not start until 8 bytes into the actual\n * buffer, as the setup packet comes first.\n *\n * Calling this function only makes sense from a transfer callback function,\n * or situations where you have already allocated a suitably sized buffer at\n * transfer->buffer.\n *\n * \\param transfer a transfer\n * \\returns pointer to the first byte of the data section\n */\nstatic inline unsigned char *libusb_control_transfer_get_data(\n\tstruct libusb_transfer *transfer)\n{\n\treturn transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE;\n}\n\n/** \\ingroup asyncio\n * Get the control setup packet of a control transfer. This convenience\n * function is here to remind you that the control setup occupies the first\n * 8 bytes of the transfer data buffer.\n *\n * Calling this function only makes sense from a transfer callback function,\n * or situations where you have already allocated a suitably sized buffer at\n * transfer->buffer.\n *\n * \\param transfer a transfer\n * \\returns a casted pointer to the start of the transfer data buffer\n */\nstatic inline struct libusb_control_setup *libusb_control_transfer_get_setup(\n\tstruct libusb_transfer *transfer)\n{\n\treturn (struct libusb_control_setup *)(void *) transfer->buffer;\n}\n\n/** \\ingroup asyncio\n * Helper function to populate the setup packet (first 8 bytes of the data\n * buffer) for a control transfer. The wIndex, wValue and wLength values should\n * be given in host-endian byte order.\n *\n * \\param buffer buffer to output the setup packet into\n * This pointer must be aligned to at least 2 bytes boundary.\n * \\param bmRequestType see the\n * \\ref libusb_control_setup::bmRequestType \"bmRequestType\" field of\n * \\ref libusb_control_setup\n * \\param bRequest see the\n * \\ref libusb_control_setup::bRequest \"bRequest\" field of\n * \\ref libusb_control_setup\n * \\param wValue see the\n * \\ref libusb_control_setup::wValue \"wValue\" field of\n * \\ref libusb_control_setup\n * \\param wIndex see the\n * \\ref libusb_control_setup::wIndex \"wIndex\" field of\n * \\ref libusb_control_setup\n * \\param wLength see the\n * \\ref libusb_control_setup::wLength \"wLength\" field of\n * \\ref libusb_control_setup\n */\nstatic inline void libusb_fill_control_setup(unsigned char *buffer,\n\tuint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,\n\tuint16_t wLength)\n{\n\tstruct libusb_control_setup *setup = (struct libusb_control_setup *)(void *) buffer;\n\tsetup->bmRequestType = bmRequestType;\n\tsetup->bRequest = bRequest;\n\tsetup->wValue = libusb_cpu_to_le16(wValue);\n\tsetup->wIndex = libusb_cpu_to_le16(wIndex);\n\tsetup->wLength = libusb_cpu_to_le16(wLength);\n}\n\nstruct libusb_transfer * LIBUSB_CALL libusb_alloc_transfer(int iso_packets);\nint LIBUSB_CALL libusb_submit_transfer(struct libusb_transfer *transfer);\nint LIBUSB_CALL libusb_cancel_transfer(struct libusb_transfer *transfer);\nvoid LIBUSB_CALL libusb_free_transfer(struct libusb_transfer *transfer);\n\n/** \\ingroup asyncio\n * Helper function to populate the required \\ref libusb_transfer fields\n * for a control transfer.\n *\n * If you pass a transfer buffer to this function, the first 8 bytes will\n * be interpreted as a control setup packet, and the wLength field will be\n * used to automatically populate the \\ref libusb_transfer::length \"length\"\n * field of the transfer. Therefore the recommended approach is:\n * -# Allocate a suitably sized data buffer (including space for control setup)\n * -# Call libusb_fill_control_setup()\n * -# If this is a host-to-device transfer with a data stage, put the data\n *    in place after the setup packet\n * -# Call this function\n * -# Call libusb_submit_transfer()\n *\n * It is also legal to pass a NULL buffer to this function, in which case this\n * function will not attempt to populate the length field. Remember that you\n * must then populate the buffer and length fields later.\n *\n * \\param transfer the transfer to populate\n * \\param dev_handle handle of the device that will handle the transfer\n * \\param buffer data buffer. If provided, this function will interpret the\n * first 8 bytes as a setup packet and infer the transfer length from that.\n * This pointer must be aligned to at least 2 bytes boundary.\n * \\param callback callback function to be invoked on transfer completion\n * \\param user_data user data to pass to callback function\n * \\param timeout timeout for the transfer in milliseconds\n */\nstatic inline void libusb_fill_control_transfer(\n\tstruct libusb_transfer *transfer, libusb_device_handle *dev_handle,\n\tunsigned char *buffer, libusb_transfer_cb_fn callback, void *user_data,\n\tunsigned int timeout)\n{\n\tstruct libusb_control_setup *setup = (struct libusb_control_setup *)(void *) buffer;\n\ttransfer->dev_handle = dev_handle;\n\ttransfer->endpoint = 0;\n\ttransfer->type = LIBUSB_TRANSFER_TYPE_CONTROL;\n\ttransfer->timeout = timeout;\n\ttransfer->buffer = buffer;\n\tif (setup)\n\t\ttransfer->length = (int) (LIBUSB_CONTROL_SETUP_SIZE\n\t\t\t+ libusb_le16_to_cpu(setup->wLength));\n\ttransfer->user_data = user_data;\n\ttransfer->callback = callback;\n}\n\n/** \\ingroup asyncio\n * Helper function to populate the required \\ref libusb_transfer fields\n * for a bulk transfer.\n *\n * \\param transfer the transfer to populate\n * \\param dev_handle handle of the device that will handle the transfer\n * \\param endpoint address of the endpoint where this transfer will be sent\n * \\param buffer data buffer\n * \\param length length of data buffer\n * \\param callback callback function to be invoked on transfer completion\n * \\param user_data user data to pass to callback function\n * \\param timeout timeout for the transfer in milliseconds\n */\nstatic inline void libusb_fill_bulk_transfer(struct libusb_transfer *transfer,\n\tlibusb_device_handle *dev_handle, unsigned char endpoint,\n\tunsigned char *buffer, int length, libusb_transfer_cb_fn callback,\n\tvoid *user_data, unsigned int timeout)\n{\n\ttransfer->dev_handle = dev_handle;\n\ttransfer->endpoint = endpoint;\n\ttransfer->type = LIBUSB_TRANSFER_TYPE_BULK;\n\ttransfer->timeout = timeout;\n\ttransfer->buffer = buffer;\n\ttransfer->length = length;\n\ttransfer->user_data = user_data;\n\ttransfer->callback = callback;\n}\n\n/** \\ingroup asyncio\n * Helper function to populate the required \\ref libusb_transfer fields\n * for an interrupt transfer.\n *\n * \\param transfer the transfer to populate\n * \\param dev_handle handle of the device that will handle the transfer\n * \\param endpoint address of the endpoint where this transfer will be sent\n * \\param buffer data buffer\n * \\param length length of data buffer\n * \\param callback callback function to be invoked on transfer completion\n * \\param user_data user data to pass to callback function\n * \\param timeout timeout for the transfer in milliseconds\n */\nstatic inline void libusb_fill_interrupt_transfer(\n\tstruct libusb_transfer *transfer, libusb_device_handle *dev_handle,\n\tunsigned char endpoint, unsigned char *buffer, int length,\n\tlibusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)\n{\n\ttransfer->dev_handle = dev_handle;\n\ttransfer->endpoint = endpoint;\n\ttransfer->type = LIBUSB_TRANSFER_TYPE_INTERRUPT;\n\ttransfer->timeout = timeout;\n\ttransfer->buffer = buffer;\n\ttransfer->length = length;\n\ttransfer->user_data = user_data;\n\ttransfer->callback = callback;\n}\n\n/** \\ingroup asyncio\n * Helper function to populate the required \\ref libusb_transfer fields\n * for an isochronous transfer.\n *\n * \\param transfer the transfer to populate\n * \\param dev_handle handle of the device that will handle the transfer\n * \\param endpoint address of the endpoint where this transfer will be sent\n * \\param buffer data buffer\n * \\param length length of data buffer\n * \\param num_iso_packets the number of isochronous packets\n * \\param callback callback function to be invoked on transfer completion\n * \\param user_data user data to pass to callback function\n * \\param timeout timeout for the transfer in milliseconds\n */\nstatic inline void libusb_fill_iso_transfer(struct libusb_transfer *transfer,\n\tlibusb_device_handle *dev_handle, unsigned char endpoint,\n\tunsigned char *buffer, int length, int num_iso_packets,\n\tlibusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)\n{\n\ttransfer->dev_handle = dev_handle;\n\ttransfer->endpoint = endpoint;\n\ttransfer->type = LIBUSB_TRANSFER_TYPE_ISOCHRONOUS;\n\ttransfer->timeout = timeout;\n\ttransfer->buffer = buffer;\n\ttransfer->length = length;\n\ttransfer->num_iso_packets = num_iso_packets;\n\ttransfer->user_data = user_data;\n\ttransfer->callback = callback;\n}\n\n/** \\ingroup asyncio\n * Convenience function to set the length of all packets in an isochronous\n * transfer, based on the num_iso_packets field in the transfer structure.\n *\n * \\param transfer a transfer\n * \\param length the length to set in each isochronous packet descriptor\n * \\see libusb_get_max_packet_size()\n */\nstatic inline void libusb_set_iso_packet_lengths(\n\tstruct libusb_transfer *transfer, unsigned int length)\n{\n\tint i;\n\tfor (i = 0; i < transfer->num_iso_packets; i++)\n\t\ttransfer->iso_packet_desc[i].length = length;\n}\n\n/** \\ingroup asyncio\n * Convenience function to locate the position of an isochronous packet\n * within the buffer of an isochronous transfer.\n *\n * This is a thorough function which loops through all preceding packets,\n * accumulating their lengths to find the position of the specified packet.\n * Typically you will assign equal lengths to each packet in the transfer,\n * and hence the above method is sub-optimal. You may wish to use\n * libusb_get_iso_packet_buffer_simple() instead.\n *\n * \\param transfer a transfer\n * \\param packet the packet to return the address of\n * \\returns the base address of the packet buffer inside the transfer buffer,\n * or NULL if the packet does not exist.\n * \\see libusb_get_iso_packet_buffer_simple()\n */\nstatic inline unsigned char *libusb_get_iso_packet_buffer(\n\tstruct libusb_transfer *transfer, unsigned int packet)\n{\n\tint i;\n\tsize_t offset = 0;\n\tint _packet;\n\n\t/* oops..slight bug in the API. packet is an unsigned int, but we use\n\t * signed integers almost everywhere else. range-check and convert to\n\t * signed to avoid compiler warnings. FIXME for libusb-2. */\n\tif (packet > INT_MAX)\n\t\treturn NULL;\n\t_packet = (int) packet;\n\n\tif (_packet >= transfer->num_iso_packets)\n\t\treturn NULL;\n\n\tfor (i = 0; i < _packet; i++)\n\t\toffset += transfer->iso_packet_desc[i].length;\n\n\treturn transfer->buffer + offset;\n}\n\n/** \\ingroup asyncio\n * Convenience function to locate the position of an isochronous packet\n * within the buffer of an isochronous transfer, for transfers where each\n * packet is of identical size.\n *\n * This function relies on the assumption that every packet within the transfer\n * is of identical size to the first packet. Calculating the location of\n * the packet buffer is then just a simple calculation:\n * <tt>buffer + (packet_size * packet)</tt>\n *\n * Do not use this function on transfers other than those that have identical\n * packet lengths for each packet.\n *\n * \\param transfer a transfer\n * \\param packet the packet to return the address of\n * \\returns the base address of the packet buffer inside the transfer buffer,\n * or NULL if the packet does not exist.\n * \\see libusb_get_iso_packet_buffer()\n */\nstatic inline unsigned char *libusb_get_iso_packet_buffer_simple(\n\tstruct libusb_transfer *transfer, unsigned int packet)\n{\n\tint _packet;\n\n\t/* oops..slight bug in the API. packet is an unsigned int, but we use\n\t * signed integers almost everywhere else. range-check and convert to\n\t * signed to avoid compiler warnings. FIXME for libusb-2. */\n\tif (packet > INT_MAX)\n\t\treturn NULL;\n\t_packet = (int) packet;\n\n\tif (_packet >= transfer->num_iso_packets)\n\t\treturn NULL;\n\n\treturn transfer->buffer + ((int) transfer->iso_packet_desc[0].length * _packet);\n}\n\n/* sync I/O */\n\nint LIBUSB_CALL libusb_control_transfer(libusb_device_handle *dev_handle,\n\tuint8_t request_type, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,\n\tunsigned char *data, uint16_t wLength, unsigned int timeout);\n\nint LIBUSB_CALL libusb_bulk_transfer(libusb_device_handle *dev_handle,\n\tunsigned char endpoint, unsigned char *data, int length,\n\tint *actual_length, unsigned int timeout);\n\nint LIBUSB_CALL libusb_interrupt_transfer(libusb_device_handle *dev_handle,\n\tunsigned char endpoint, unsigned char *data, int length,\n\tint *actual_length, unsigned int timeout);\n\n/** \\ingroup desc\n * Retrieve a descriptor from the default control pipe.\n * This is a convenience function which formulates the appropriate control\n * message to retrieve the descriptor.\n *\n * \\param dev a device handle\n * \\param desc_type the descriptor type, see \\ref libusb_descriptor_type\n * \\param desc_index the index of the descriptor to retrieve\n * \\param data output buffer for descriptor\n * \\param length size of data buffer\n * \\returns number of bytes returned in data, or LIBUSB_ERROR code on failure\n */\nstatic inline int libusb_get_descriptor(libusb_device_handle *dev,\n\tuint8_t desc_type, uint8_t desc_index, unsigned char *data, int length)\n{\n\treturn libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN,\n\t\tLIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t) ((desc_type << 8) | desc_index),\n\t\t0, data, (uint16_t) length, 1000);\n}\n\n/** \\ingroup desc\n * Retrieve a descriptor from a device.\n * This is a convenience function which formulates the appropriate control\n * message to retrieve the descriptor. The string returned is Unicode, as\n * detailed in the USB specifications.\n *\n * \\param dev a device handle\n * \\param desc_index the index of the descriptor to retrieve\n * \\param langid the language ID for the string descriptor\n * \\param data output buffer for descriptor\n * \\param length size of data buffer\n * \\returns number of bytes returned in data, or LIBUSB_ERROR code on failure\n * \\see libusb_get_string_descriptor_ascii()\n */\nstatic inline int libusb_get_string_descriptor(libusb_device_handle *dev,\n\tuint8_t desc_index, uint16_t langid, unsigned char *data, int length)\n{\n\treturn libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN,\n\t\tLIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t)((LIBUSB_DT_STRING << 8) | desc_index),\n\t\tlangid, data, (uint16_t) length, 1000);\n}\n\nint LIBUSB_CALL libusb_get_string_descriptor_ascii(libusb_device_handle *dev,\n\tuint8_t desc_index, unsigned char *data, int length);\n\n/* polling and timeouts */\n\nint LIBUSB_CALL libusb_try_lock_events(libusb_context *ctx);\nvoid LIBUSB_CALL libusb_lock_events(libusb_context *ctx);\nvoid LIBUSB_CALL libusb_unlock_events(libusb_context *ctx);\nint LIBUSB_CALL libusb_event_handling_ok(libusb_context *ctx);\nint LIBUSB_CALL libusb_event_handler_active(libusb_context *ctx);\nvoid LIBUSB_CALL libusb_lock_event_waiters(libusb_context *ctx);\nvoid LIBUSB_CALL libusb_unlock_event_waiters(libusb_context *ctx);\nint LIBUSB_CALL libusb_wait_for_event(libusb_context *ctx, struct timeval *tv);\n\nint LIBUSB_CALL libusb_handle_events_timeout(libusb_context *ctx,\n\tstruct timeval *tv);\nint LIBUSB_CALL libusb_handle_events_timeout_completed(libusb_context *ctx,\n\tstruct timeval *tv, int *completed);\nint LIBUSB_CALL libusb_handle_events(libusb_context *ctx);\nint LIBUSB_CALL libusb_handle_events_completed(libusb_context *ctx, int *completed);\nint LIBUSB_CALL libusb_handle_events_locked(libusb_context *ctx,\n\tstruct timeval *tv);\nint LIBUSB_CALL libusb_pollfds_handle_timeouts(libusb_context *ctx);\nint LIBUSB_CALL libusb_get_next_timeout(libusb_context *ctx,\n\tstruct timeval *tv);\n\n/** \\ingroup poll\n * File descriptor for polling\n */\nstruct libusb_pollfd {\n\t/** Numeric file descriptor */\n\tint fd;\n\n\t/** Event flags to poll for from <poll.h>. POLLIN indicates that you\n\t * should monitor this file descriptor for becoming ready to read from,\n\t * and POLLOUT indicates that you should monitor this file descriptor for\n\t * nonblocking write readiness. */\n\tshort events;\n};\n\n/** \\ingroup poll\n * Callback function, invoked when a new file descriptor should be added\n * to the set of file descriptors monitored for events.\n * \\param fd the new file descriptor\n * \\param events events to monitor for, see \\ref libusb_pollfd for a\n * description\n * \\param user_data User data pointer specified in\n * libusb_set_pollfd_notifiers() call\n * \\see libusb_set_pollfd_notifiers()\n */\ntypedef void (LIBUSB_CALL *libusb_pollfd_added_cb)(int fd, short events,\n\tvoid *user_data);\n\n/** \\ingroup poll\n * Callback function, invoked when a file descriptor should be removed from\n * the set of file descriptors being monitored for events. After returning\n * from this callback, do not use that file descriptor again.\n * \\param fd the file descriptor to stop monitoring\n * \\param user_data User data pointer specified in\n * libusb_set_pollfd_notifiers() call\n * \\see libusb_set_pollfd_notifiers()\n */\ntypedef void (LIBUSB_CALL *libusb_pollfd_removed_cb)(int fd, void *user_data);\n\nconst struct libusb_pollfd ** LIBUSB_CALL libusb_get_pollfds(\n\tlibusb_context *ctx);\nvoid LIBUSB_CALL libusb_set_pollfd_notifiers(libusb_context *ctx,\n\tlibusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb,\n\tvoid *user_data);\n\n/** \\ingroup hotplug\n * Callback handle.\n *\n * Callbacks handles are generated by libusb_hotplug_register_callback()\n * and can be used to deregister callbacks. Callback handles are unique\n * per libusb_context and it is safe to call libusb_hotplug_deregister_callback()\n * on an already deregisted callback.\n *\n * Since version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102\n *\n * For more information, see \\ref hotplug.\n */\ntypedef int libusb_hotplug_callback_handle;\n\n/** \\ingroup hotplug\n *\n * Since version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102\n *\n * Flags for hotplug events */\ntypedef enum {\n\t/** Arm the callback and fire it for all matching currently attached devices. */\n\tLIBUSB_HOTPLUG_ENUMERATE = 1,\n} libusb_hotplug_flag;\n\n/** \\ingroup hotplug\n *\n * Since version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102\n *\n * Hotplug events */\ntypedef enum {\n\t/** A device has been plugged in and is ready to use */\n\tLIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED = 0x01,\n\n\t/** A device has left and is no longer available.\n\t * It is the user's responsibility to call libusb_close on any handle associated with a disconnected device.\n\t * It is safe to call libusb_get_device_descriptor on a device that has left */\n\tLIBUSB_HOTPLUG_EVENT_DEVICE_LEFT    = 0x02,\n} libusb_hotplug_event;\n\n/** \\ingroup hotplug\n * Wildcard matching for hotplug events */\n#define LIBUSB_HOTPLUG_MATCH_ANY -1\n\n/** \\ingroup hotplug\n * Hotplug callback function type. When requesting hotplug event notifications,\n * you pass a pointer to a callback function of this type.\n *\n * This callback may be called by an internal event thread and as such it is\n * recommended the callback do minimal processing before returning.\n *\n * libusb will call this function later, when a matching event had happened on\n * a matching device. See \\ref hotplug for more information.\n *\n * It is safe to call either libusb_hotplug_register_callback() or\n * libusb_hotplug_deregister_callback() from within a callback function.\n *\n * Since version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102\n *\n * \\param ctx            context of this notification\n * \\param device         libusb_device this event occurred on\n * \\param event          event that occurred\n * \\param user_data      user data provided when this callback was registered\n * \\returns bool whether this callback is finished processing events.\n *                       returning 1 will cause this callback to be deregistered\n */\ntypedef int (LIBUSB_CALL *libusb_hotplug_callback_fn)(libusb_context *ctx,\n\t\t\t\t\t\tlibusb_device *device,\n\t\t\t\t\t\tlibusb_hotplug_event event,\n\t\t\t\t\t\tvoid *user_data);\n\n/** \\ingroup hotplug\n * Register a hotplug callback function\n *\n * Register a callback with the libusb_context. The callback will fire\n * when a matching event occurs on a matching device. The callback is\n * armed until either it is deregistered with libusb_hotplug_deregister_callback()\n * or the supplied callback returns 1 to indicate it is finished processing events.\n *\n * If the \\ref LIBUSB_HOTPLUG_ENUMERATE is passed the callback will be\n * called with a \\ref LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED for all devices\n * already plugged into the machine. Note that libusb modifies its internal\n * device list from a separate thread, while calling hotplug callbacks from\n * libusb_handle_events(), so it is possible for a device to already be present\n * on, or removed from, its internal device list, while the hotplug callbacks\n * still need to be dispatched. This means that when using \\ref\n * LIBUSB_HOTPLUG_ENUMERATE, your callback may be called twice for the arrival\n * of the same device, once from libusb_hotplug_register_callback() and once\n * from libusb_handle_events(); and/or your callback may be called for the\n * removal of a device for which an arrived call was never made.\n *\n * Since version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102\n *\n * \\param[in] ctx context to register this callback with\n * \\param[in] events bitwise or of events that will trigger this callback. See \\ref\n *            libusb_hotplug_event\n * \\param[in] flags hotplug callback flags. See \\ref libusb_hotplug_flag\n * \\param[in] vendor_id the vendor id to match or \\ref LIBUSB_HOTPLUG_MATCH_ANY\n * \\param[in] product_id the product id to match or \\ref LIBUSB_HOTPLUG_MATCH_ANY\n * \\param[in] dev_class the device class to match or \\ref LIBUSB_HOTPLUG_MATCH_ANY\n * \\param[in] cb_fn the function to be invoked on a matching event/device\n * \\param[in] user_data user data to pass to the callback function\n * \\param[out] handle pointer to store the handle of the allocated callback (can be NULL)\n * \\returns LIBUSB_SUCCESS on success LIBUSB_ERROR code on failure\n */\nint LIBUSB_CALL libusb_hotplug_register_callback(libusb_context *ctx,\n\t\t\t\t\t\tlibusb_hotplug_event events,\n\t\t\t\t\t\tlibusb_hotplug_flag flags,\n\t\t\t\t\t\tint vendor_id, int product_id,\n\t\t\t\t\t\tint dev_class,\n\t\t\t\t\t\tlibusb_hotplug_callback_fn cb_fn,\n\t\t\t\t\t\tvoid *user_data,\n\t\t\t\t\t\tlibusb_hotplug_callback_handle *handle);\n\n/** \\ingroup hotplug\n * Deregisters a hotplug callback.\n *\n * Deregister a callback from a libusb_context. This function is safe to call from within\n * a hotplug callback.\n *\n * Since version 1.0.16, \\ref LIBUSB_API_VERSION >= 0x01000102\n *\n * \\param[in] ctx context this callback is registered with\n * \\param[in] handle the handle of the callback to deregister\n */\nvoid LIBUSB_CALL libusb_hotplug_deregister_callback(libusb_context *ctx,\n\t\t\t\t\t\tlibusb_hotplug_callback_handle handle);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/libusbi.h",
    "content": "/*\n * Internal header for libusb\n * Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org>\n * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef LIBUSBI_H\n#define LIBUSBI_H\n\n#include \"config.h\"\n\n#include <stdlib.h>\n\n#include <stddef.h>\n#include <stdint.h>\n#include <time.h>\n#include <stdarg.h>\n#ifdef HAVE_POLL_H\n#include <poll.h>\n#endif\n\n#ifdef HAVE_MISSING_H\n#include \"missing.h\"\n#endif\n#include \"libusb.h\"\n#include \"version.h\"\n#include \"utilbase.h\"\n\n/* Inside the libusb code, mark all public functions as follows:\n *   return_type API_EXPORTED function_name(params) { ... }\n * But if the function returns a pointer, mark it as follows:\n *   DEFAULT_VISIBILITY return_type * LIBUSB_CALL function_name(params) { ... }\n * In the libusb public header, mark all declarations as:\n *   return_type LIBUSB_CALL function_name(params);\n */\n#define API_EXPORTED LIBUSB_CALL DEFAULT_VISIBILITY\n\n#define DEVICE_DESC_LENGTH\t\t18\n\n#define USB_MAXENDPOINTS\t32\n#define USB_MAXINTERFACES\t32\n#define USB_MAXCONFIG\t\t8\n\n/* Backend specific capabilities */\n#define USBI_CAP_HAS_HID_ACCESS\t\t\t\t\t0x00010000\n#define USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER\t0x00020000\n\n/* Maximum number of bytes in a log line */\n#define USBI_MAX_LOG_LEN\t1024\n/* Terminator for log lines */\n#define USBI_LOG_LINE_END\t\"\\n\"\n\n/* The following is used to silence warnings for unused variables */\n#define UNUSED(var)\t\t\tdo { (void)(var); } while(0)\n\n#if !defined(ARRAYSIZE)\n#define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))\n#endif\n\nstruct list_head {\n\tstruct list_head *prev, *next;\n};\n\n/* Get an entry from the list\n *  ptr - the address of this list_head element in \"type\"\n *  type - the data type that contains \"member\"\n *  member - the list_head element in \"type\"\n */\n#define list_entry(ptr, type, member) \\\n\t((type *)((uintptr_t)(ptr) - (uintptr_t)offsetof(type, member)))\n\n/* Get each entry from a list\n *  pos - A structure pointer has a \"member\" element\n *  head - list head\n *  member - the list_head element in \"pos\"\n *  type - the type of the first parameter\n */\n#define list_for_each_entry(pos, head, member, type)\t\t\t\\\n\tfor (pos = list_entry((head)->next, type, member);\t\t\t\\\n\t\t &pos->member != (head);\t\t\t\t\t\t\t\t\\\n\t\t pos = list_entry(pos->member.next, type, member))\n\n#define list_for_each_entry_safe(pos, n, head, member, type)\t\\\n\tfor (pos = list_entry((head)->next, type, member),\t\t\t\\\n\t\t n = list_entry(pos->member.next, type, member);\t\t\\\n\t\t &pos->member != (head);\t\t\t\t\t\t\t\t\\\n\t\t pos = n, n = list_entry(n->member.next, type, member))\n\n#define list_empty(entry) ((entry)->next == (entry))\n\nstatic inline void list_init(struct list_head *entry) {\n\tentry->prev = entry->next = entry;\n}\n\nstatic inline void list_add(struct list_head *entry, struct list_head *head) {\n\tentry->next = head->next;\n\tentry->prev = head;\n\n\thead->next->prev = entry;\n\thead->next = entry;\n}\n\nstatic inline void list_add_tail(struct list_head *entry, struct list_head *head) {\n\tentry->next = head;\n\tentry->prev = head->prev;\n\n\thead->prev->next = entry;\n\thead->prev = entry;\n}\n\nstatic inline void list_del(struct list_head *entry) {\n\tif (!list_empty(entry)) {\t// XXX add saki@serenegiant because sometimes crash\n\t\tentry->next->prev = entry->prev;\n\t\tentry->prev->next = entry->next;\n\t\tentry->next = entry->prev = NULL;\n\t}\n}\n\nstatic inline void *usbi_reallocf(void *ptr, size_t size) {\n\tvoid *ret = realloc(ptr, size);\n\tif (UNLIKELY(!ret))\n\t\tfree(ptr);\n\treturn ret;\n}\n\n#define container_of(ptr, type, member) ({                      \\\n        const typeof( ((type *)0)->member ) *mptr = (ptr);    \\\n        (type *)( (char *)mptr - offsetof(type,member) );})\n\n#define MIN(a, b)\t((a) < (b) ? (a) : (b))\n#define MAX(a, b)\t((a) > (b) ? (a) : (b))\n\n#define TIMESPEC_IS_SET(ts) ((ts)->tv_sec != 0 || (ts)->tv_nsec != 0)\n\n/* Some platforms don't have this define */\n#ifndef TIMESPEC_TO_TIMEVAL\n#define TIMESPEC_TO_TIMEVAL(tv, ts)                                     \\\n        do {                                                            \\\n                (tv)->tv_sec = (ts)->tv_sec;                            \\\n                (tv)->tv_usec = (ts)->tv_nsec / 1000;                   \\\n        } while (0)\n#endif\n\nvoid usbi_log(struct libusb_context *ctx, enum libusb_log_level level,\n\t\tconst char *function, const char *format, ...);\n\nvoid usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level,\n\t\tconst char *function, const char *format, va_list args);\n\n#if !defined(_MSC_VER) || _MSC_VER >= 1400\n\n#ifdef ENABLE_LOGGING\n#define _usbi_log(ctx, level, ...) usbi_log(ctx, level, __FUNCTION__, __VA_ARGS__)\n#define usbi_dbg(...) _usbi_log(NULL, LIBUSB_LOG_LEVEL_DEBUG, __VA_ARGS__)\n#else\n#define _usbi_log(ctx, level, ...) do { (void)(ctx); } while(0)\n#define usbi_dbg(...) do {} while(0)\n#endif\n\n#define usbi_info(ctx, ...) _usbi_log(ctx, LIBUSB_LOG_LEVEL_INFO, __VA_ARGS__)\n#define usbi_warn(ctx, ...) _usbi_log(ctx, LIBUSB_LOG_LEVEL_WARNING, __VA_ARGS__)\n#define usbi_err(ctx, ...) _usbi_log(ctx, LIBUSB_LOG_LEVEL_ERROR, __VA_ARGS__)\n\n#else /* !defined(_MSC_VER) || _MSC_VER >= 1400 */\n\n#ifdef ENABLE_LOGGING\n#define LOG_BODY(ctxt, level) \\\n{                             \\\n\tva_list args;             \\\n\tva_start (args, format);  \\\n\tusbi_log_v(ctxt, level, \"\", format, args); \\\n\tva_end(args);             \\\n}\n#else\n#define LOG_BODY(ctxt, level) do { (void)(ctxt); } while(0)\n#endif\n\nstatic inline void usbi_info(struct libusb_context *ctx, const char *format,\n\t\t...)\nLOG_BODY(ctx,LIBUSB_LOG_LEVEL_INFO)\nstatic inline void usbi_warn(struct libusb_context *ctx, const char *format,\n\t\t...)\nLOG_BODY(ctx,LIBUSB_LOG_LEVEL_WARNING)\nstatic inline void usbi_err( struct libusb_context *ctx, const char *format,\n\t\t...)\nLOG_BODY(ctx,LIBUSB_LOG_LEVEL_ERROR)\n\nstatic inline void usbi_dbg(const char *format, ...)\nLOG_BODY(NULL,LIBUSB_LOG_LEVEL_DEBUG)\n\n#endif /* !defined(_MSC_VER) || _MSC_VER >= 1400 */\n\n#define USBI_GET_CONTEXT(ctx) if (!(ctx)) (ctx) = usbi_default_context\n#define DEVICE_CTX(dev) ((dev)->ctx)\n#define HANDLE_CTX(handle) (DEVICE_CTX((handle)->dev))\n#define TRANSFER_CTX(transfer) (HANDLE_CTX((transfer)->dev_handle))\n#define ITRANSFER_CTX(transfer) \\\n\t(TRANSFER_CTX(USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)))\n\n#define IS_EPIN(ep) (0 != ((ep) & LIBUSB_ENDPOINT_IN))\n#define IS_EPOUT(ep) (!IS_EPIN(ep))\n#define IS_XFERIN(xfer) (0 != ((xfer)->endpoint & LIBUSB_ENDPOINT_IN))\n#define IS_XFEROUT(xfer) (!IS_XFERIN(xfer))\n\n/* Internal abstraction for thread synchronization */\n#if defined(THREADS_POSIX)\n#include \"os/threads_posix.h\"\n#elif defined(OS_WINDOWS) || defined(OS_WINCE)\n#include <os/threads_windows.h>\n#endif\n\nextern struct libusb_context *usbi_default_context;\n\nstruct libusb_context {\n\tint debug;\n\tint debug_fixed;\n\n\t/* internal control pipe, used for interrupting event handling when\n\t * something needs to modify poll fds. */\n\tint ctrl_pipe[2];\n\n\tstruct list_head usb_devs;\n\tusbi_mutex_t usb_devs_lock;\n\n\t/* A list of open handles. Backends are free to traverse this if required.\n\t */\n\tstruct list_head open_devs;\n\tusbi_mutex_t open_devs_lock;\n\n\t/* A list of registered hotplug callbacks */\n\tstruct list_head hotplug_cbs;\n\tusbi_mutex_t hotplug_cbs_lock;\n\tint hotplug_pipe[2];\n\n\t/* this is a list of in-flight transfer handles, sorted by timeout\n\t * expiration. URBs to timeout the soonest are placed at the beginning of\n\t * the list, URBs that will time out later are placed after, and urbs with\n\t * infinite timeout are always placed at the very end. */\n\tstruct list_head flying_transfers;\n\tusbi_mutex_t flying_transfers_lock;\n\n\t/* list of poll fds */\n\tstruct list_head pollfds;\n\tusbi_mutex_t pollfds_lock;\n\n\t/* a counter that is set when we want to interrupt event handling, in order\n\t * to modify the poll fd set. and a lock to protect it. */\n\tunsigned int pollfd_modify;\n\tusbi_mutex_t pollfd_modify_lock;\n\n\t/* user callbacks for pollfd changes */\n\tlibusb_pollfd_added_cb fd_added_cb;\n\tlibusb_pollfd_removed_cb fd_removed_cb;\n\tvoid *fd_cb_user_data;\n\n\t/* ensures that only one thread is handling events at any one time */\n\tusbi_mutex_t events_lock;\n\n\t/* used to see if there is an active thread doing event handling */\n\tint event_handler_active;\n\n\t/* used to wait for event completion in threads other than the one that is\n\t * event handling */\n\tusbi_mutex_t event_waiters_lock;\n\tusbi_cond_t event_waiters_cond;\n\n#ifdef USBI_TIMERFD_AVAILABLE\n\t/* used for timeout handling, if supported by OS.\n\t * this timerfd is maintained to trigger on the next pending timeout */\n\tint timerfd;\n#endif\n\n\tstruct list_head list;\n};\n\n#ifdef USBI_TIMERFD_AVAILABLE\n#define usbi_using_timerfd(ctx) ((ctx)->timerfd >= 0)\n#else\n#define usbi_using_timerfd(ctx) (0)\n#endif\n\nstruct libusb_device {\n\t/* lock protects refcnt, everything else is finalized at initialization\n\t * time */\n\tusbi_mutex_t lock;\n\tint refcnt;\n\n\tstruct libusb_context *ctx;\n\n\tuint8_t bus_number;\n\tuint8_t port_number;\n\tstruct libusb_device* parent_dev;\n\tuint8_t device_address;\n\tuint8_t num_configurations;\n\tenum libusb_speed speed;\n\n\tstruct list_head list;\n\tunsigned long session_data;\n\n\tstruct libusb_device_descriptor device_descriptor;\n\tint attached;\n\n\tunsigned char os_priv\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)\n\t[] /* valid C99 code */\n#else\n\t[0] /* non-standard, but usually working code */\n#endif\n\t;\n};\n\nstruct libusb_device_handle {\n\t/* lock protects claimed_interfaces */\n\tusbi_mutex_t lock;\n\tunsigned long claimed_interfaces;\n\n\tstruct list_head list;\n\tstruct libusb_device *dev;\n\tint auto_detach_kernel_driver;\n\tunsigned char os_priv\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)\n\t[] /* valid C99 code */\n#else\n\t[0] /* non-standard, but usually working code */\n#endif\n\t;\n};\n\nenum {\n\tUSBI_CLOCK_MONOTONIC,\n\tUSBI_CLOCK_REALTIME\n};\n\n/* in-memory transfer layout:\n *\n * 1. struct usbi_transfer\n * 2. struct libusb_transfer (which includes iso packets) [variable size]\n * 3. os private data [variable size]\n *\n * from a libusb_transfer, you can get the usbi_transfer by rewinding the\n * appropriate number of bytes.\n * the usbi_transfer includes the number of allocated packets, so you can\n * determine the size of the transfer and hence the start and length of the\n * OS-private data.\n */\n\nstruct usbi_transfer {\n\tint num_iso_packets;\n\tstruct list_head list;\n\tstruct timeval timeout;\n\tint transferred;\n\tuint32_t stream_id;\n\tuint8_t flags;\n\n\t/* this lock is held during libusb_submit_transfer() and\n\t * libusb_cancel_transfer() (allowing the OS backend to prevent duplicate\n\t * cancellation, submission-during-cancellation, etc). the OS backend\n\t * should also take this lock in the handle_events path, to prevent the user\n\t * cancelling the transfer from another thread while you are processing\n\t * its completion (presumably there would be races within your OS backend\n\t * if this were possible). */\n\tusbi_mutex_t lock;\n};\n\nenum usbi_transfer_flags {\n\t/* The transfer has timed out */\n\tUSBI_TRANSFER_TIMED_OUT = 1 << 0,\n\n\t/* Set by backend submit_transfer() if the OS handles timeout */\n\tUSBI_TRANSFER_OS_HANDLES_TIMEOUT = 1 << 1,\n\n\t/* Cancellation was requested via libusb_cancel_transfer() */\n\tUSBI_TRANSFER_CANCELLING = 1 << 2,\n\n\t/* Operation on the transfer failed because the device disappeared */\n\tUSBI_TRANSFER_DEVICE_DISAPPEARED = 1 << 3,\n\n\t/* Set by backend submit_transfer() if the fds in use have been updated */\n\tUSBI_TRANSFER_UPDATED_FDS = 1 << 4,\n};\n\n#define USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer) \\\n\t((struct libusb_transfer *)(((unsigned char *)(transfer)) \\\n\t\t+ sizeof(struct usbi_transfer)))\n#define LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer) \\\n\t((struct usbi_transfer *)(((unsigned char *)(transfer)) \\\n\t\t- sizeof(struct usbi_transfer)))\n\nstatic inline void *usbi_transfer_get_os_priv(struct usbi_transfer *transfer) {\n\treturn ((unsigned char *) transfer) + sizeof(struct usbi_transfer)\n\t\t\t+ sizeof(struct libusb_transfer)\n\t\t\t+ (transfer->num_iso_packets\n\t\t\t\t\t* sizeof(struct libusb_iso_packet_descriptor));\n}\n\n/* bus structures */\n\n/* All standard descriptors have these 2 fields in common */\nstruct usb_descriptor_header {\n\tuint8_t bLength;\n\tuint8_t bDescriptorType;\n};\n\n/* shared data and functions */\n\nint usbi_io_init(struct libusb_context *ctx);\nvoid usbi_io_exit(struct libusb_context *ctx);\n\nstruct libusb_device *usbi_alloc_device(struct libusb_context *ctx,\n\t\tunsigned long session_id);\nstruct libusb_device *usbi_get_device_by_session_id(struct libusb_context *ctx,\n\t\tunsigned long session_id);\nint usbi_sanitize_device(struct libusb_device *dev);\nvoid usbi_handle_disconnect(struct libusb_device_handle *handle);\n\nint usbi_handle_transfer_completion(struct usbi_transfer *itransfer,\n\t\tenum libusb_transfer_status status);\nint usbi_handle_transfer_cancellation(struct usbi_transfer *transfer);\n\nint usbi_parse_descriptor(const unsigned char *source, const char *descriptor,\n\t\tvoid *dest, int host_endian);\nint usbi_device_cache_descriptor(libusb_device *dev);\nint usbi_get_config_index_by_value(struct libusb_device *dev,\n\t\tuint8_t bConfigurationValue, int *idx);\n\nvoid usbi_connect_device(struct libusb_device *dev);\nvoid usbi_disconnect_device(struct libusb_device *dev);\n\n/* Internal abstraction for poll (needs struct usbi_transfer on Windows) */\n#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_OPENBSD) || defined(OS_NETBSD)\t// XXX\n#include <unistd.h>\n#include \"os/poll_posix.h\"\n#elif defined(OS_WINDOWS) || defined(OS_WINCE)\n#include \"os/poll_windows.h\"\n#endif\n\n#if (defined(OS_WINDOWS) || defined(OS_WINCE)) && !defined(__GNUC__)\n#define snprintf _snprintf\n#define vsnprintf _vsnprintf\nint usbi_gettimeofday(struct timeval *tp, void *tzp);\n#define LIBUSB_GETTIMEOFDAY_WIN32\n#define HAVE_USBI_GETTIMEOFDAY\n#else\n#ifdef HAVE_GETTIMEOFDAY\n#define usbi_gettimeofday(tv, tz) gettimeofday((tv), (tz))\n#define HAVE_USBI_GETTIMEOFDAY\n#endif\n#endif\n\nstruct usbi_pollfd {\n\t/* must come first */\n\tstruct libusb_pollfd pollfd;\n\n\tstruct list_head list;\n};\n\nint usbi_add_pollfd(struct libusb_context *ctx, int fd, short events);\nvoid usbi_remove_pollfd(struct libusb_context *ctx, int fd);\nvoid usbi_fd_notification(struct libusb_context *ctx);\n\n/* device discovery */\n\n/* we traverse usbfs without knowing how many devices we are going to find.\n * so we create this discovered_devs model which is similar to a linked-list\n * which grows when required. it can be freed once discovery has completed,\n * eliminating the need for a list node in the libusb_device structure\n * itself. */\nstruct discovered_devs {\n\tsize_t len;\n\tsize_t capacity;\n\tstruct libusb_device *devices\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)\n\t[] /* valid C99 code */\n#else\n\t[0] /* non-standard, but usually working code */\n#endif\n\t;\n};\n\nstruct discovered_devs *discovered_devs_append(struct discovered_devs *discdevs,\n\t\tstruct libusb_device *dev);\n\n/* OS abstraction */\n\n/* This is the interface that OS backends need to implement.\n * All fields are mandatory, except ones explicitly noted as optional. */\nstruct usbi_os_backend {\n\t/* A human-readable name for your backend, e.g. \"Linux usbfs\" */\n\tconst char *name;\n\n\t/* Binary mask for backend specific capabilities */\n\tuint32_t caps;\n\n\t/* Perform initialization of your backend. You might use this function\n\t * to determine specific capabilities of the system, allocate required\n\t * data structures for later, etc.\n\t *\n\t * This function is called when a libusb user initializes the library\n\t * prior to use.\n\t *\n\t * Return 0 on success, or a LIBUSB_ERROR code on failure.\n\t */\n\tint (*init)(struct libusb_context *ctx);\n\tint (*init2)(struct libusb_context *ctx, const char *usbfs);\n\n\t/* Deinitialization. Optional. This function should destroy anything\n\t * that was set up by init.\n\t *\n\t * This function is called when the user deinitializes the library.\n\t */\n\tvoid (*exit)(void);\n\n\t/* Enumerate all the USB devices on the system, returning them in a list\n\t * of discovered devices.\n\t *\n\t * Your implementation should enumerate all devices on the system,\n\t * regardless of whether they have been seen before or not.\n\t *\n\t * When you have found a device, compute a session ID for it. The session\n\t * ID should uniquely represent that particular device for that particular\n\t * connection session since boot (i.e. if you disconnect and reconnect a\n\t * device immediately after, it should be assigned a different session ID).\n\t * If your OS cannot provide a unique session ID as described above,\n\t * presenting a session ID of (bus_number << 8 | device_address) should\n\t * be sufficient. Bus numbers and device addresses wrap and get reused,\n\t * but that is an unlikely case.\n\t *\n\t * After computing a session ID for a device, call\n\t * usbi_get_device_by_session_id(). This function checks if libusb already\n\t * knows about the device, and if so, it provides you with a reference\n\t * to a libusb_device structure for it.\n\t *\n\t * If usbi_get_device_by_session_id() returns NULL, it is time to allocate\n\t * a new device structure for the device. Call usbi_alloc_device() to\n\t * obtain a new libusb_device structure with reference count 1. Populate\n\t * the bus_number and device_address attributes of the new device, and\n\t * perform any other internal backend initialization you need to do. At\n\t * this point, you should be ready to provide device descriptors and so\n\t * on through the get_*_descriptor functions. Finally, call\n\t * usbi_sanitize_device() to perform some final sanity checks on the\n\t * device. Assuming all of the above succeeded, we can now continue.\n\t * If any of the above failed, remember to unreference the device that\n\t * was returned by usbi_alloc_device().\n\t *\n\t * At this stage we have a populated libusb_device structure (either one\n\t * that was found earlier, or one that we have just allocated and\n\t * populated). This can now be added to the discovered devices list\n\t * using discovered_devs_append(). Note that discovered_devs_append()\n\t * may reallocate the list, returning a new location for it, and also\n\t * note that reallocation can fail. Your backend should handle these\n\t * error conditions appropriately.\n\t *\n\t * This function should not generate any bus I/O and should not block.\n\t * If I/O is required (e.g. reading the active configuration value), it is\n\t * OK to ignore these suggestions :)\n\t *\n\t * This function is executed when the user wishes to retrieve a list\n\t * of USB devices connected to the system.\n\t *\n\t * If the backend has hotplug support, this function is not used!\n\t *\n\t * Return 0 on success, or a LIBUSB_ERROR code on failure.\n\t */\n\tint (*get_device_list)(struct libusb_context *ctx,\n\t\t\tstruct discovered_devs **discdevs);\n\n\t/* Apps which were written before hotplug support, may listen for\n\t * hotplug events on their own and call libusb_get_device_list on\n\t * device addition. In this case libusb_get_device_list will likely\n\t * return a list without the new device in there, as the hotplug\n\t * event thread will still be busy enumerating the device, which may\n\t * take a while, or may not even have seen the event yet.\n\t *\n\t * To avoid this libusb_get_device_list will call this optional\n\t * function for backends with hotplug support before copying\n\t * ctx->usb_devs to the user. In this function the backend should\n\t * ensure any pending hotplug events are fully processed before\n\t * returning.\n\t *\n\t * Optional, should be implemented by backends with hotplug support.\n\t */\n\tvoid (*hotplug_poll)(void);\n\n\t/* Open a device for I/O and other USB operations. The device handle\n\t * is preallocated for you, you can retrieve the device in question\n\t * through handle->dev.\n\t *\n\t * Your backend should allocate any internal resources required for I/O\n\t * and other operations so that those operations can happen (hopefully)\n\t * without hiccup. This is also a good place to inform libusb that it\n\t * should monitor certain file descriptors related to this device -\n\t * see the usbi_add_pollfd() function.\n\t *\n\t * This function should not generate any bus I/O and should not block.\n\t *\n\t * This function is called when the user attempts to obtain a device\n\t * handle for a device.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_ACCESS if the user has insufficient permissions\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since\n\t *   discovery\n\t * - another LIBUSB_ERROR code on other failure\n\t *\n\t * Do not worry about freeing the handle on failed open, the upper layers\n\t * do this for you.\n\t */\n\tint (*open)(struct libusb_device_handle *handle);\n\n\t/*\n\t * XXX function to set file descriptor, added for mainly non-rooted Android\n\t */\n\tint (*set_device_fd)(struct libusb_device *device, int fd);\n\t/* Close a device such that the handle cannot be used again. Your backend\n\t * should destroy any resources that were allocated in the open path.\n\t * This may also be a good place to call usbi_remove_pollfd() to inform\n\t * libusb of any file descriptors associated with this device that should\n\t * no longer be monitored.\n\t *\n\t * This function is called when the user closes a device handle.\n\t */\n\tvoid (*close)(struct libusb_device_handle *handle);\n\n#ifdef ACCESS_RAW_DESCRIPTORS\n\tint (*get_raw_descriptor)(struct libusb_device *device,\n\t\t\tunsigned char *buffer, int *descriptors_len, int *host_endian);\t// XXX\n#endif\n\t/* Retrieve the device descriptor from a device.\n\t *\n\t * The descriptor should be retrieved from memory, NOT via bus I/O to the\n\t * device. This means that you may have to cache it in a private structure\n\t * during get_device_list enumeration. Alternatively, you may be able\n\t * to retrieve it from a kernel interface (some Linux setups can do this)\n\t * still without generating bus I/O.\n\t *\n\t * This function is expected to write DEVICE_DESC_LENGTH (18) bytes into\n\t * buffer, which is guaranteed to be big enough.\n\t *\n\t * This function is called when sanity-checking a device before adding\n\t * it to the list of discovered devices, and also when the user requests\n\t * to read the device descriptor.\n\t *\n\t * This function is expected to return the descriptor in bus-endian format\n\t * (LE). If it returns the multi-byte values in host-endian format,\n\t * set the host_endian output parameter to \"1\".\n\t *\n\t * Return 0 on success or a LIBUSB_ERROR code on failure.\n\t */\n\tint (*get_device_descriptor)(struct libusb_device *device,\n\t\t\tunsigned char *buffer, int *host_endian);\n\n\t/* Get the ACTIVE configuration descriptor for a device.\n\t *\n\t * The descriptor should be retrieved from memory, NOT via bus I/O to the\n\t * device. This means that you may have to cache it in a private structure\n\t * during get_device_list enumeration. You may also have to keep track\n\t * of which configuration is active when the user changes it.\n\t *\n\t * This function is expected to write len bytes of data into buffer, which\n\t * is guaranteed to be big enough. If you can only do a partial write,\n\t * return an error code.\n\t *\n\t * This function is expected to return the descriptor in bus-endian format\n\t * (LE). If it returns the multi-byte values in host-endian format,\n\t * set the host_endian output parameter to \"1\".\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*get_active_config_descriptor)(struct libusb_device *device,\n\t\t\tunsigned char *buffer, size_t len, int *host_endian);\n\n\t/* Get a specific configuration descriptor for a device.\n\t *\n\t * The descriptor should be retrieved from memory, NOT via bus I/O to the\n\t * device. This means that you may have to cache it in a private structure\n\t * during get_device_list enumeration.\n\t *\n\t * The requested descriptor is expressed as a zero-based index (i.e. 0\n\t * indicates that we are requesting the first descriptor). The index does\n\t * not (necessarily) equal the bConfigurationValue of the configuration\n\t * being requested.\n\t *\n\t * This function is expected to write len bytes of data into buffer, which\n\t * is guaranteed to be big enough. If you can only do a partial write,\n\t * return an error code.\n\t *\n\t * This function is expected to return the descriptor in bus-endian format\n\t * (LE). If it returns the multi-byte values in host-endian format,\n\t * set the host_endian output parameter to \"1\".\n\t *\n\t * Return the length read on success or a LIBUSB_ERROR code on failure.\n\t */\n\tint (*get_config_descriptor)(struct libusb_device *device,\n\t\t\tuint8_t config_index, unsigned char *buffer, size_t len,\n\t\t\tint *host_endian);\n\n\t/* Like get_config_descriptor but then by bConfigurationValue instead\n\t * of by index.\n\t *\n\t * Optional, if not present the core will call get_config_descriptor\n\t * for all configs until it finds the desired bConfigurationValue.\n\t *\n\t * Returns a pointer to the raw-descriptor in *buffer, this memory\n\t * is valid as long as device is valid.\n\t *\n\t * Returns the length of the returned raw-descriptor on success,\n\t * or a LIBUSB_ERROR code on failure.\n\t */\n\tint (*get_config_descriptor_by_value)(struct libusb_device *device,\n\t\t\tuint8_t bConfigurationValue, unsigned char **buffer,\n\t\t\tint *host_endian);\n\n\t/* Get the bConfigurationValue for the active configuration for a device.\n\t * Optional. This should only be implemented if you can retrieve it from\n\t * cache (don't generate I/O).\n\t *\n\t * If you cannot retrieve this from cache, either do not implement this\n\t * function, or return LIBUSB_ERROR_NOT_SUPPORTED. This will cause\n\t * libusb to retrieve the information through a standard control transfer.\n\t *\n\t * This function must be non-blocking.\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - LIBUSB_ERROR_NOT_SUPPORTED if the value cannot be retrieved without\n\t *   blocking\n\t * - another LIBUSB_ERROR code on other failure.\n\t */\n\tint (*get_configuration)(struct libusb_device_handle *handle, int *config);\n\n\t/* Set the active configuration for a device.\n\t *\n\t * A configuration value of -1 should put the device in unconfigured state.\n\t *\n\t * This function can block.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if the configuration does not exist\n\t * - LIBUSB_ERROR_BUSY if interfaces are currently claimed (and hence\n\t *   configuration cannot be changed)\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - another LIBUSB_ERROR code on other failure.\n\t */\n\tint (*set_configuration)(struct libusb_device_handle *handle, int config);\n\n\t/* Claim an interface. When claimed, the application can then perform\n\t * I/O to an interface's endpoints.\n\t *\n\t * This function should not generate any bus I/O and should not block.\n\t * Interface claiming is a logical operation that simply ensures that\n\t * no other drivers/applications are using the interface, and after\n\t * claiming, no other drivers/applicatiosn can use the interface because\n\t * we now \"own\" it.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if the interface does not exist\n\t * - LIBUSB_ERROR_BUSY if the interface is in use by another driver/app\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*claim_interface)(struct libusb_device_handle *handle, int interface_number);\n\n\t/* Release a previously claimed interface.\n\t *\n\t * This function should also generate a SET_INTERFACE control request,\n\t * resetting the alternate setting of that interface to 0. It's OK for\n\t * this function to block as a result.\n\t *\n\t * You will only ever be asked to release an interface which was\n\t * successfully claimed earlier.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*release_interface)(struct libusb_device_handle *handle, int interface_number);\n\n\t/* Set the alternate setting for an interface.\n\t *\n\t * You will only ever be asked to set the alternate setting for an\n\t * interface which was successfully claimed earlier.\n\t *\n\t * It's OK for this function to block.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if the alternate setting does not exist\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*set_interface_altsetting)(struct libusb_device_handle *handle,\n\t\t\tint interface_number, int altsetting);\n\n\t/* Clear a halt/stall condition on an endpoint.\n\t *\n\t * It's OK for this function to block.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*clear_halt)(struct libusb_device_handle *handle,\n\t\t\tunsigned char endpoint);\n\n\t/* Perform a USB port reset to reinitialize a device.\n\t *\n\t * If possible, the handle should still be usable after the reset\n\t * completes, assuming that the device descriptors did not change during\n\t * reset and all previous interface state can be restored.\n\t *\n\t * If something changes, or you cannot easily locate/verify the resetted\n\t * device, return LIBUSB_ERROR_NOT_FOUND. This prompts the application\n\t * to close the old handle and re-enumerate the device.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if re-enumeration is required, or if the device\n\t *   has been disconnected since it was opened\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*reset_device)(struct libusb_device_handle *handle);\n\n\t/* Alloc num_streams usb3 bulk streams on the passed in endpoints */\n\tint (*alloc_streams)(struct libusb_device_handle *handle,\n\t\tuint32_t num_streams, unsigned char *endpoints, int num_endpoints);\n\n\t/* Free usb3 bulk streams allocated with alloc_streams */\n\tint (*free_streams)(struct libusb_device_handle *handle,\n\t\tunsigned char *endpoints, int num_endpoints);\n\n\t/* Determine if a kernel driver is active on an interface. Optional.\n\t *\n\t * The presence of a kernel driver on an interface indicates that any\n\t * calls to claim_interface would fail with the LIBUSB_ERROR_BUSY code.\n\t *\n\t * Return:\n\t * - 0 if no driver is active\n\t * - 1 if a driver is active\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*kernel_driver_active)(struct libusb_device_handle *handle,\n\t\t\tint interface_number);\n\n\t/* Detach a kernel driver from an interface. Optional.\n\t *\n\t * After detaching a kernel driver, the interface should be available\n\t * for claim.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if no kernel driver was active\n\t * - LIBUSB_ERROR_INVALID_PARAM if the interface does not exist\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*detach_kernel_driver)(struct libusb_device_handle *handle,\n\t\t\tint interface_number);\n\n\t/* Attach a kernel driver to an interface. Optional.\n\t *\n\t * Reattach a kernel driver to the device.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if no kernel driver was active\n\t * - LIBUSB_ERROR_INVALID_PARAM if the interface does not exist\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - LIBUSB_ERROR_BUSY if a program or driver has claimed the interface,\n\t *   preventing reattachment\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*attach_kernel_driver)(struct libusb_device_handle *handle,\n\t\t\tint interface_number);\n\n\t/* Destroy a device. Optional.\n\t *\n\t * This function is called when the last reference to a device is\n\t * destroyed. It should free any resources allocated in the get_device_list\n\t * path.\n\t */\n\tvoid (*destroy_device)(struct libusb_device *dev);\n\n\t/* Submit a transfer. Your implementation should take the transfer,\n\t * morph it into whatever form your platform requires, and submit it\n\t * asynchronously.\n\t *\n\t * This function must not block.\n\t *\n\t * This function gets called with the flying_transfers_lock locked!\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*submit_transfer)(struct usbi_transfer *itransfer);\n\n\t/* Cancel a previously submitted transfer.\n\t *\n\t * This function must not block. The transfer cancellation must complete\n\t * later, resulting in a call to usbi_handle_transfer_cancellation()\n\t * from the context of handle_events.\n\t */\n\tint (*cancel_transfer)(struct usbi_transfer *itransfer);\n\n\t/* Clear a transfer as if it has completed or cancelled, but do not\n\t * report any completion/cancellation to the library. You should free\n\t * all private data from the transfer as if you were just about to report\n\t * completion or cancellation.\n\t *\n\t * This function might seem a bit out of place. It is used when libusb\n\t * detects a disconnected device - it calls this function for all pending\n\t * transfers before reporting completion (with the disconnect code) to\n\t * the user. Maybe we can improve upon this internal interface in future.\n\t */\n\tvoid (*clear_transfer_priv)(struct usbi_transfer *itransfer);\n\n\t/* Handle any pending events. This involves monitoring any active\n\t * transfers and processing their completion or cancellation.\n\t *\n\t * The function is passed an array of pollfd structures (size nfds)\n\t * as a result of the poll() system call. The num_ready parameter\n\t * indicates the number of file descriptors that have reported events\n\t * (i.e. the poll() return value). This should be enough information\n\t * for you to determine which actions need to be taken on the currently\n\t * active transfers.\n\t *\n\t * For any cancelled transfers, call usbi_handle_transfer_cancellation().\n\t * For completed transfers, call usbi_handle_transfer_completion().\n\t * For control/bulk/interrupt transfers, populate the \"transferred\"\n\t * element of the appropriate usbi_transfer structure before calling the\n\t * above functions. For isochronous transfers, populate the status and\n\t * transferred fields of the iso packet descriptors of the transfer.\n\t *\n\t * This function should also be able to detect disconnection of the\n\t * device, reporting that situation with usbi_handle_disconnect().\n\t *\n\t * When processing an event related to a transfer, you probably want to\n\t * take usbi_transfer.lock to prevent races. See the documentation for\n\t * the usbi_transfer structure.\n\t *\n\t * Return 0 on success, or a LIBUSB_ERROR code on failure.\n\t */\n\tint (*handle_events)(struct libusb_context *ctx, struct pollfd *fds,\n\t\t\tPOLL_NFDS_TYPE nfds, int num_ready);\n\n\t/* Get time from specified clock. At least two clocks must be implemented\n\t by the backend: USBI_CLOCK_REALTIME, and USBI_CLOCK_MONOTONIC.\n\n\t Description of clocks:\n\t USBI_CLOCK_REALTIME : clock returns time since system epoch.\n\t USBI_CLOCK_MONOTONIC: clock returns time since unspecified start\n\t time (usually boot).\n\t */\n\tint (*clock_gettime)(int clkid, struct timespec *tp);\n\n#ifdef USBI_TIMERFD_AVAILABLE\n\t/* clock ID of the clock that should be used for timerfd */\n\tclockid_t (*get_timerfd_clockid)(void);\n#endif\n\n\t/* Number of bytes to reserve for per-device private backend data.\n\t * This private data area is accessible through the \"os_priv\" field of\n\t * struct libusb_device. */\n\tsize_t device_priv_size;\n\n\t/* Number of bytes to reserve for per-handle private backend data.\n\t * This private data area is accessible through the \"os_priv\" field of\n\t * struct libusb_device. */\n\tsize_t device_handle_priv_size;\n\n\t/* Number of bytes to reserve for per-transfer private backend data.\n\t * This private data area is accessible by calling\n\t * usbi_transfer_get_os_priv() on the appropriate usbi_transfer instance.\n\t */\n\tsize_t transfer_priv_size;\n\n\t/* Mumber of additional bytes for os_priv for each iso packet.\n\t * Can your backend use this? */\n\t/* FIXME: linux can't use this any more. if other OS's cannot either,\n\t * then remove this */\n\tsize_t add_iso_packet_size;\n};\n\nextern const struct usbi_os_backend * const usbi_backend;\n\nextern const struct usbi_os_backend android_usbfs_backend;\t// XXX added for mainly non-rooted Android\nextern const struct usbi_os_backend linux_usbfs_backend;\nextern const struct usbi_os_backend darwin_backend;\nextern const struct usbi_os_backend openbsd_backend;\nextern const struct usbi_os_backend netbsd_backend;\nextern const struct usbi_os_backend windows_backend;\nextern const struct usbi_os_backend wince_backend;\n\nextern struct list_head active_contexts_list;\nextern usbi_mutex_static_t active_contexts_lock;\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/libusbi_original.h",
    "content": "/*\n * Internal header for libusb\n * Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org>\n * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef LIBUSBI_H\n#define LIBUSBI_H\n\n#include \"config.h\"\n\n#include <stdlib.h>\n\n#include <stddef.h>\n#include <stdint.h>\n#include <time.h>\n#include <stdarg.h>\n#ifdef HAVE_POLL_H\n#include <poll.h>\n#endif\n\n#ifdef HAVE_MISSING_H\n#include \"missing.h\"\n#endif\n#include \"libusb.h\"\n#include \"version.h\"\n\n/* Inside the libusb code, mark all public functions as follows:\n *   return_type API_EXPORTED function_name(params) { ... }\n * But if the function returns a pointer, mark it as follows:\n *   DEFAULT_VISIBILITY return_type * LIBUSB_CALL function_name(params) { ... }\n * In the libusb public header, mark all declarations as:\n *   return_type LIBUSB_CALL function_name(params);\n */\n#define API_EXPORTED LIBUSB_CALL DEFAULT_VISIBILITY\n\n#define DEVICE_DESC_LENGTH\t\t18\n\n#define USB_MAXENDPOINTS\t32\n#define USB_MAXINTERFACES\t32\n#define USB_MAXCONFIG\t\t8\n\n/* Backend specific capabilities */\n#define USBI_CAP_HAS_HID_ACCESS\t\t\t\t\t0x00010000\n#define USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER\t0x00020000\n\n/* Maximum number of bytes in a log line */\n#define USBI_MAX_LOG_LEN\t1024\n/* Terminator for log lines */\n#define USBI_LOG_LINE_END\t\"\\n\"\n\n/* The following is used to silence warnings for unused variables */\n#define UNUSED(var)\t\t\tdo { (void)(var); } while(0)\n\n#if !defined(ARRAYSIZE)\n#define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))\n#endif\n\nstruct list_head {\n\tstruct list_head *prev, *next;\n};\n\n/* Get an entry from the list\n *  ptr - the address of this list_head element in \"type\"\n *  type - the data type that contains \"member\"\n *  member - the list_head element in \"type\"\n */\n#define list_entry(ptr, type, member) \\\n\t((type *)((uintptr_t)(ptr) - (uintptr_t)offsetof(type, member)))\n\n/* Get each entry from a list\n *  pos - A structure pointer has a \"member\" element\n *  head - list head\n *  member - the list_head element in \"pos\"\n *  type - the type of the first parameter\n */\n#define list_for_each_entry(pos, head, member, type)\t\t\t\\\n\tfor (pos = list_entry((head)->next, type, member);\t\t\t\\\n\t\t &pos->member != (head);\t\t\t\t\t\t\t\t\\\n\t\t pos = list_entry(pos->member.next, type, member))\n\n#define list_for_each_entry_safe(pos, n, head, member, type)\t\\\n\tfor (pos = list_entry((head)->next, type, member),\t\t\t\\\n\t\t n = list_entry(pos->member.next, type, member);\t\t\\\n\t\t &pos->member != (head);\t\t\t\t\t\t\t\t\\\n\t\t pos = n, n = list_entry(n->member.next, type, member))\n\n#define list_empty(entry) ((entry)->next == (entry))\n\nstatic inline void list_init(struct list_head *entry)\n{\n\tentry->prev = entry->next = entry;\n}\n\nstatic inline void list_add(struct list_head *entry, struct list_head *head)\n{\n\tentry->next = head->next;\n\tentry->prev = head;\n\n\thead->next->prev = entry;\n\thead->next = entry;\n}\n\nstatic inline void list_add_tail(struct list_head *entry,\n\tstruct list_head *head)\n{\n\tentry->next = head;\n\tentry->prev = head->prev;\n\n\thead->prev->next = entry;\n\thead->prev = entry;\n}\n\nstatic inline void list_del(struct list_head *entry)\n{\n\tentry->next->prev = entry->prev;\n\tentry->prev->next = entry->next;\n\tentry->next = entry->prev = NULL;\n}\n\nstatic inline void *usbi_reallocf(void *ptr, size_t size)\n{\n\tvoid *ret = realloc(ptr, size);\n\tif (!ret)\n\t\tfree(ptr);\n\treturn ret;\n}\n\n#define container_of(ptr, type, member) ({                      \\\n        const typeof( ((type *)0)->member ) *mptr = (ptr);    \\\n        (type *)( (char *)mptr - offsetof(type,member) );})\n\n#define MIN(a, b)\t((a) < (b) ? (a) : (b))\n#define MAX(a, b)\t((a) > (b) ? (a) : (b))\n\n#define TIMESPEC_IS_SET(ts) ((ts)->tv_sec != 0 || (ts)->tv_nsec != 0)\n\n/* Some platforms don't have this define */\n#ifndef TIMESPEC_TO_TIMEVAL\n#define TIMESPEC_TO_TIMEVAL(tv, ts)                                     \\\n        do {                                                            \\\n                (tv)->tv_sec = (ts)->tv_sec;                            \\\n                (tv)->tv_usec = (ts)->tv_nsec / 1000;                   \\\n        } while (0)\n#endif\n\nvoid usbi_log(struct libusb_context *ctx, enum libusb_log_level level,\n\tconst char *function, const char *format, ...);\n\nvoid usbi_log_v(struct libusb_context *ctx, enum libusb_log_level level,\n\tconst char *function, const char *format, va_list args);\n\n#if !defined(_MSC_VER) || _MSC_VER >= 1400\n\n#ifdef ENABLE_LOGGING\n#define _usbi_log(ctx, level, ...) usbi_log(ctx, level, __FUNCTION__, __VA_ARGS__)\n#define usbi_dbg(...) _usbi_log(NULL, LIBUSB_LOG_LEVEL_DEBUG, __VA_ARGS__)\n#else\n#define _usbi_log(ctx, level, ...) do { (void)(ctx); } while(0)\n#define usbi_dbg(...) do {} while(0)\n#endif\n\n#define usbi_info(ctx, ...) _usbi_log(ctx, LIBUSB_LOG_LEVEL_INFO, __VA_ARGS__)\n#define usbi_warn(ctx, ...) _usbi_log(ctx, LIBUSB_LOG_LEVEL_WARNING, __VA_ARGS__)\n#define usbi_err(ctx, ...) _usbi_log(ctx, LIBUSB_LOG_LEVEL_ERROR, __VA_ARGS__)\n\n#else /* !defined(_MSC_VER) || _MSC_VER >= 1400 */\n\n#ifdef ENABLE_LOGGING\n#define LOG_BODY(ctxt, level) \\\n{                             \\\n\tva_list args;             \\\n\tva_start (args, format);  \\\n\tusbi_log_v(ctxt, level, \"\", format, args); \\\n\tva_end(args);             \\\n}\n#else\n#define LOG_BODY(ctxt, level) do { (void)(ctxt); } while(0)\n#endif\n\nstatic inline void usbi_info(struct libusb_context *ctx, const char *format,\n\t...)\n\tLOG_BODY(ctx,LIBUSB_LOG_LEVEL_INFO)\nstatic inline void usbi_warn(struct libusb_context *ctx, const char *format,\n\t...)\n\tLOG_BODY(ctx,LIBUSB_LOG_LEVEL_WARNING)\nstatic inline void usbi_err( struct libusb_context *ctx, const char *format,\n\t...)\n\tLOG_BODY(ctx,LIBUSB_LOG_LEVEL_ERROR)\n\nstatic inline void usbi_dbg(const char *format, ...)\n\tLOG_BODY(NULL,LIBUSB_LOG_LEVEL_DEBUG)\n\n#endif /* !defined(_MSC_VER) || _MSC_VER >= 1400 */\n\n#define USBI_GET_CONTEXT(ctx) if (!(ctx)) (ctx) = usbi_default_context\n#define DEVICE_CTX(dev) ((dev)->ctx)\n#define HANDLE_CTX(handle) (DEVICE_CTX((handle)->dev))\n#define TRANSFER_CTX(transfer) (HANDLE_CTX((transfer)->dev_handle))\n#define ITRANSFER_CTX(transfer) \\\n\t(TRANSFER_CTX(USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)))\n\n#define IS_EPIN(ep) (0 != ((ep) & LIBUSB_ENDPOINT_IN))\n#define IS_EPOUT(ep) (!IS_EPIN(ep))\n#define IS_XFERIN(xfer) (0 != ((xfer)->endpoint & LIBUSB_ENDPOINT_IN))\n#define IS_XFEROUT(xfer) (!IS_XFERIN(xfer))\n\n/* Internal abstraction for thread synchronization */\n#if defined(THREADS_POSIX)\n#include \"os/threads_posix.h\"\n#elif defined(OS_WINDOWS) || defined(OS_WINCE)\n#include <os/threads_windows.h>\n#endif\n\nextern struct libusb_context *usbi_default_context;\n\nstruct libusb_context {\n\tint debug;\n\tint debug_fixed;\n\n\t/* internal control pipe, used for interrupting event handling when\n\t * something needs to modify poll fds. */\n\tint ctrl_pipe[2];\n\n\tstruct list_head usb_devs;\n\tusbi_mutex_t usb_devs_lock;\n\n\t/* A list of open handles. Backends are free to traverse this if required.\n\t */\n\tstruct list_head open_devs;\n\tusbi_mutex_t open_devs_lock;\n\n\t/* A list of registered hotplug callbacks */\n\tstruct list_head hotplug_cbs;\n\tusbi_mutex_t hotplug_cbs_lock;\n\tint hotplug_pipe[2];\n\n\t/* this is a list of in-flight transfer handles, sorted by timeout\n\t * expiration. URBs to timeout the soonest are placed at the beginning of\n\t * the list, URBs that will time out later are placed after, and urbs with\n\t * infinite timeout are always placed at the very end. */\n\tstruct list_head flying_transfers;\n\tusbi_mutex_t flying_transfers_lock;\n\n\t/* list of poll fds */\n\tstruct list_head pollfds;\n\tusbi_mutex_t pollfds_lock;\n\n\t/* a counter that is set when we want to interrupt event handling, in order\n\t * to modify the poll fd set. and a lock to protect it. */\n\tunsigned int pollfd_modify;\n\tusbi_mutex_t pollfd_modify_lock;\n\n\t/* user callbacks for pollfd changes */\n\tlibusb_pollfd_added_cb fd_added_cb;\n\tlibusb_pollfd_removed_cb fd_removed_cb;\n\tvoid *fd_cb_user_data;\n\n\t/* ensures that only one thread is handling events at any one time */\n\tusbi_mutex_t events_lock;\n\n\t/* used to see if there is an active thread doing event handling */\n\tint event_handler_active;\n\n\t/* used to wait for event completion in threads other than the one that is\n\t * event handling */\n\tusbi_mutex_t event_waiters_lock;\n\tusbi_cond_t event_waiters_cond;\n\n#ifdef USBI_TIMERFD_AVAILABLE\n\t/* used for timeout handling, if supported by OS.\n\t * this timerfd is maintained to trigger on the next pending timeout */\n\tint timerfd;\n#endif\n\n\tstruct list_head list;\n};\n\n#ifdef USBI_TIMERFD_AVAILABLE\n#define usbi_using_timerfd(ctx) ((ctx)->timerfd >= 0)\n#else\n#define usbi_using_timerfd(ctx) (0)\n#endif\n\nstruct libusb_device {\n\t/* lock protects refcnt, everything else is finalized at initialization\n\t * time */\n\tusbi_mutex_t lock;\n\tint refcnt;\n\n\tstruct libusb_context *ctx;\n\n\tuint8_t bus_number;\n\tuint8_t port_number;\n\tstruct libusb_device* parent_dev;\n\tuint8_t device_address;\n\tuint8_t num_configurations;\n\tenum libusb_speed speed;\n\n\tstruct list_head list;\n\tunsigned long session_data;\n\n\tstruct libusb_device_descriptor device_descriptor;\n\tint attached;\n\n\tunsigned char os_priv\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)\n\t[] /* valid C99 code */\n#else\n\t[0] /* non-standard, but usually working code */\n#endif\n\t;\n};\n\nstruct libusb_device_handle {\n\t/* lock protects claimed_interfaces */\n\tusbi_mutex_t lock;\n\tunsigned long claimed_interfaces;\n\n\tstruct list_head list;\n\tstruct libusb_device *dev;\n\tint auto_detach_kernel_driver;\n\tunsigned char os_priv\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)\n\t[] /* valid C99 code */\n#else\n\t[0] /* non-standard, but usually working code */\n#endif\n\t;\n};\n\nenum {\n  USBI_CLOCK_MONOTONIC,\n  USBI_CLOCK_REALTIME\n};\n\n/* in-memory transfer layout:\n *\n * 1. struct usbi_transfer\n * 2. struct libusb_transfer (which includes iso packets) [variable size]\n * 3. os private data [variable size]\n *\n * from a libusb_transfer, you can get the usbi_transfer by rewinding the\n * appropriate number of bytes.\n * the usbi_transfer includes the number of allocated packets, so you can\n * determine the size of the transfer and hence the start and length of the\n * OS-private data.\n */\n\nstruct usbi_transfer {\n\tint num_iso_packets;\n\tstruct list_head list;\n\tstruct timeval timeout;\n\tint transferred;\n\tuint8_t flags;\n\n\t/* this lock is held during libusb_submit_transfer() and\n\t * libusb_cancel_transfer() (allowing the OS backend to prevent duplicate\n\t * cancellation, submission-during-cancellation, etc). the OS backend\n\t * should also take this lock in the handle_events path, to prevent the user\n\t * cancelling the transfer from another thread while you are processing\n\t * its completion (presumably there would be races within your OS backend\n\t * if this were possible). */\n\tusbi_mutex_t lock;\n};\n\nenum usbi_transfer_flags {\n\t/* The transfer has timed out */\n\tUSBI_TRANSFER_TIMED_OUT = 1 << 0,\n\n\t/* Set by backend submit_transfer() if the OS handles timeout */\n\tUSBI_TRANSFER_OS_HANDLES_TIMEOUT = 1 << 1,\n\n\t/* Cancellation was requested via libusb_cancel_transfer() */\n\tUSBI_TRANSFER_CANCELLING = 1 << 2,\n\n\t/* Operation on the transfer failed because the device disappeared */\n\tUSBI_TRANSFER_DEVICE_DISAPPEARED = 1 << 3,\n\n\t/* Set by backend submit_transfer() if the fds in use have been updated */\n\tUSBI_TRANSFER_UPDATED_FDS = 1 << 4,\n};\n\n#define USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer) \\\n\t((struct libusb_transfer *)(((unsigned char *)(transfer)) \\\n\t\t+ sizeof(struct usbi_transfer)))\n#define LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer) \\\n\t((struct usbi_transfer *)(((unsigned char *)(transfer)) \\\n\t\t- sizeof(struct usbi_transfer)))\n\nstatic inline void *usbi_transfer_get_os_priv(struct usbi_transfer *transfer)\n{\n\treturn ((unsigned char *)transfer) + sizeof(struct usbi_transfer)\n\t\t+ sizeof(struct libusb_transfer)\n\t\t+ (transfer->num_iso_packets\n\t\t\t* sizeof(struct libusb_iso_packet_descriptor));\n}\n\n/* bus structures */\n\n/* All standard descriptors have these 2 fields in common */\nstruct usb_descriptor_header {\n\tuint8_t  bLength;\n\tuint8_t  bDescriptorType;\n};\n\n/* shared data and functions */\n\nint usbi_io_init(struct libusb_context *ctx);\nvoid usbi_io_exit(struct libusb_context *ctx);\n\nstruct libusb_device *usbi_alloc_device(struct libusb_context *ctx,\n\tunsigned long session_id);\nstruct libusb_device *usbi_get_device_by_session_id(struct libusb_context *ctx,\n\tunsigned long session_id);\nint usbi_sanitize_device(struct libusb_device *dev);\nvoid usbi_handle_disconnect(struct libusb_device_handle *handle);\n\nint usbi_handle_transfer_completion(struct usbi_transfer *itransfer,\n\tenum libusb_transfer_status status);\nint usbi_handle_transfer_cancellation(struct usbi_transfer *transfer);\n\nint usbi_parse_descriptor(const unsigned char *source, const char *descriptor,\n\tvoid *dest, int host_endian);\nint usbi_device_cache_descriptor(libusb_device *dev);\nint usbi_get_config_index_by_value(struct libusb_device *dev,\n\tuint8_t bConfigurationValue, int *idx);\n\nvoid usbi_connect_device (struct libusb_device *dev);\nvoid usbi_disconnect_device (struct libusb_device *dev);\n\n/* Internal abstraction for poll (needs struct usbi_transfer on Windows) */\n#if defined(OS_LINUX) || defined(OS_DARWIN) || defined(OS_OPENBSD) || defined(OS_NETBSD)\n#include <unistd.h>\n#include \"os/poll_posix.h\"\n#elif defined(OS_WINDOWS) || defined(OS_WINCE)\n#include \"os/poll_windows.h\"\n#endif\n\n#if (defined(OS_WINDOWS) || defined(OS_WINCE)) && !defined(__GNUC__)\n#define snprintf _snprintf\n#define vsnprintf _vsnprintf\nint usbi_gettimeofday(struct timeval *tp, void *tzp);\n#define LIBUSB_GETTIMEOFDAY_WIN32\n#define HAVE_USBI_GETTIMEOFDAY\n#else\n#ifdef HAVE_GETTIMEOFDAY\n#define usbi_gettimeofday(tv, tz) gettimeofday((tv), (tz))\n#define HAVE_USBI_GETTIMEOFDAY\n#endif\n#endif\n\nstruct usbi_pollfd {\n\t/* must come first */\n\tstruct libusb_pollfd pollfd;\n\n\tstruct list_head list;\n};\n\nint usbi_add_pollfd(struct libusb_context *ctx, int fd, short events);\nvoid usbi_remove_pollfd(struct libusb_context *ctx, int fd);\nvoid usbi_fd_notification(struct libusb_context *ctx);\n\n/* device discovery */\n\n/* we traverse usbfs without knowing how many devices we are going to find.\n * so we create this discovered_devs model which is similar to a linked-list\n * which grows when required. it can be freed once discovery has completed,\n * eliminating the need for a list node in the libusb_device structure\n * itself. */\nstruct discovered_devs {\n\tsize_t len;\n\tsize_t capacity;\n\tstruct libusb_device *devices\n#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)\n\t[] /* valid C99 code */\n#else\n\t[0] /* non-standard, but usually working code */\n#endif\n\t;\n};\n\nstruct discovered_devs *discovered_devs_append(\n\tstruct discovered_devs *discdevs, struct libusb_device *dev);\n\n/* OS abstraction */\n\n/* This is the interface that OS backends need to implement.\n * All fields are mandatory, except ones explicitly noted as optional. */\nstruct usbi_os_backend {\n\t/* A human-readable name for your backend, e.g. \"Linux usbfs\" */\n\tconst char *name;\n\n\t/* Binary mask for backend specific capabilities */\n\tuint32_t caps;\n\n\t/* Perform initialization of your backend. You might use this function\n\t * to determine specific capabilities of the system, allocate required\n\t * data structures for later, etc.\n\t *\n\t * This function is called when a libusb user initializes the library\n\t * prior to use.\n\t *\n\t * Return 0 on success, or a LIBUSB_ERROR code on failure.\n\t */\n\tint (*init)(struct libusb_context *ctx);\n\n\t/* Deinitialization. Optional. This function should destroy anything\n\t * that was set up by init.\n\t *\n\t * This function is called when the user deinitializes the library.\n\t */\n\tvoid (*exit)(void);\n\n\t/* Enumerate all the USB devices on the system, returning them in a list\n\t * of discovered devices.\n\t *\n\t * Your implementation should enumerate all devices on the system,\n\t * regardless of whether they have been seen before or not.\n\t *\n\t * When you have found a device, compute a session ID for it. The session\n\t * ID should uniquely represent that particular device for that particular\n\t * connection session since boot (i.e. if you disconnect and reconnect a\n\t * device immediately after, it should be assigned a different session ID).\n\t * If your OS cannot provide a unique session ID as described above,\n\t * presenting a session ID of (bus_number << 8 | device_address) should\n\t * be sufficient. Bus numbers and device addresses wrap and get reused,\n\t * but that is an unlikely case.\n\t *\n\t * After computing a session ID for a device, call\n\t * usbi_get_device_by_session_id(). This function checks if libusb already\n\t * knows about the device, and if so, it provides you with a reference\n\t * to a libusb_device structure for it.\n\t *\n\t * If usbi_get_device_by_session_id() returns NULL, it is time to allocate\n\t * a new device structure for the device. Call usbi_alloc_device() to\n\t * obtain a new libusb_device structure with reference count 1. Populate\n\t * the bus_number and device_address attributes of the new device, and\n\t * perform any other internal backend initialization you need to do. At\n\t * this point, you should be ready to provide device descriptors and so\n\t * on through the get_*_descriptor functions. Finally, call\n\t * usbi_sanitize_device() to perform some final sanity checks on the\n\t * device. Assuming all of the above succeeded, we can now continue.\n\t * If any of the above failed, remember to unreference the device that\n\t * was returned by usbi_alloc_device().\n\t *\n\t * At this stage we have a populated libusb_device structure (either one\n\t * that was found earlier, or one that we have just allocated and\n\t * populated). This can now be added to the discovered devices list\n\t * using discovered_devs_append(). Note that discovered_devs_append()\n\t * may reallocate the list, returning a new location for it, and also\n\t * note that reallocation can fail. Your backend should handle these\n\t * error conditions appropriately.\n\t *\n\t * This function should not generate any bus I/O and should not block.\n\t * If I/O is required (e.g. reading the active configuration value), it is\n\t * OK to ignore these suggestions :)\n\t *\n\t * This function is executed when the user wishes to retrieve a list\n\t * of USB devices connected to the system.\n\t *\n\t * If the backend has hotplug support, this function is not used!\n\t *\n\t * Return 0 on success, or a LIBUSB_ERROR code on failure.\n\t */\n\tint (*get_device_list)(struct libusb_context *ctx,\n\t\tstruct discovered_devs **discdevs);\n\n\t/* Apps which were written before hotplug support, may listen for\n\t * hotplug events on their own and call libusb_get_device_list on\n\t * device addition. In this case libusb_get_device_list will likely\n\t * return a list without the new device in there, as the hotplug\n\t * event thread will still be busy enumerating the device, which may\n\t * take a while, or may not even have seen the event yet.\n\t *\n\t * To avoid this libusb_get_device_list will call this optional\n\t * function for backends with hotplug support before copying\n\t * ctx->usb_devs to the user. In this function the backend should\n\t * ensure any pending hotplug events are fully processed before\n\t * returning.\n\t *\n\t * Optional, should be implemented by backends with hotplug support.\n\t */\n\tvoid (*hotplug_poll)(void);\n\n\t/* Open a device for I/O and other USB operations. The device handle\n\t * is preallocated for you, you can retrieve the device in question\n\t * through handle->dev.\n\t *\n\t * Your backend should allocate any internal resources required for I/O\n\t * and other operations so that those operations can happen (hopefully)\n\t * without hiccup. This is also a good place to inform libusb that it\n\t * should monitor certain file descriptors related to this device -\n\t * see the usbi_add_pollfd() function.\n\t *\n\t * This function should not generate any bus I/O and should not block.\n\t *\n\t * This function is called when the user attempts to obtain a device\n\t * handle for a device.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_ACCESS if the user has insufficient permissions\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since\n\t *   discovery\n\t * - another LIBUSB_ERROR code on other failure\n\t *\n\t * Do not worry about freeing the handle on failed open, the upper layers\n\t * do this for you.\n\t */\n\tint (*open)(struct libusb_device_handle *handle);\n\n\t/* Close a device such that the handle cannot be used again. Your backend\n\t * should destroy any resources that were allocated in the open path.\n\t * This may also be a good place to call usbi_remove_pollfd() to inform\n\t * libusb of any file descriptors associated with this device that should\n\t * no longer be monitored.\n\t *\n\t * This function is called when the user closes a device handle.\n\t */\n\tvoid (*close)(struct libusb_device_handle *handle);\n\n\t/* Retrieve the device descriptor from a device.\n\t *\n\t * The descriptor should be retrieved from memory, NOT via bus I/O to the\n\t * device. This means that you may have to cache it in a private structure\n\t * during get_device_list enumeration. Alternatively, you may be able\n\t * to retrieve it from a kernel interface (some Linux setups can do this)\n\t * still without generating bus I/O.\n\t *\n\t * This function is expected to write DEVICE_DESC_LENGTH (18) bytes into\n\t * buffer, which is guaranteed to be big enough.\n\t *\n\t * This function is called when sanity-checking a device before adding\n\t * it to the list of discovered devices, and also when the user requests\n\t * to read the device descriptor.\n\t *\n\t * This function is expected to return the descriptor in bus-endian format\n\t * (LE). If it returns the multi-byte values in host-endian format,\n\t * set the host_endian output parameter to \"1\".\n\t *\n\t * Return 0 on success or a LIBUSB_ERROR code on failure.\n\t */\n\tint (*get_device_descriptor)(struct libusb_device *device,\n\t\tunsigned char *buffer, int *host_endian);\n\n\t/* Get the ACTIVE configuration descriptor for a device.\n\t *\n\t * The descriptor should be retrieved from memory, NOT via bus I/O to the\n\t * device. This means that you may have to cache it in a private structure\n\t * during get_device_list enumeration. You may also have to keep track\n\t * of which configuration is active when the user changes it.\n\t *\n\t * This function is expected to write len bytes of data into buffer, which\n\t * is guaranteed to be big enough. If you can only do a partial write,\n\t * return an error code.\n\t *\n\t * This function is expected to return the descriptor in bus-endian format\n\t * (LE). If it returns the multi-byte values in host-endian format,\n\t * set the host_endian output parameter to \"1\".\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*get_active_config_descriptor)(struct libusb_device *device,\n\t\tunsigned char *buffer, size_t len, int *host_endian);\n\n\t/* Get a specific configuration descriptor for a device.\n\t *\n\t * The descriptor should be retrieved from memory, NOT via bus I/O to the\n\t * device. This means that you may have to cache it in a private structure\n\t * during get_device_list enumeration.\n\t *\n\t * The requested descriptor is expressed as a zero-based index (i.e. 0\n\t * indicates that we are requesting the first descriptor). The index does\n\t * not (necessarily) equal the bConfigurationValue of the configuration\n\t * being requested.\n\t *\n\t * This function is expected to write len bytes of data into buffer, which\n\t * is guaranteed to be big enough. If you can only do a partial write,\n\t * return an error code.\n\t *\n\t * This function is expected to return the descriptor in bus-endian format\n\t * (LE). If it returns the multi-byte values in host-endian format,\n\t * set the host_endian output parameter to \"1\".\n\t *\n\t * Return the length read on success or a LIBUSB_ERROR code on failure.\n\t */\n\tint (*get_config_descriptor)(struct libusb_device *device,\n\t\tuint8_t config_index, unsigned char *buffer, size_t len,\n\t\tint *host_endian);\n\n\t/* Like get_config_descriptor but then by bConfigurationValue instead\n\t * of by index.\n\t *\n\t * Optional, if not present the core will call get_config_descriptor\n\t * for all configs until it finds the desired bConfigurationValue.\n\t *\n\t * Returns a pointer to the raw-descriptor in *buffer, this memory\n\t * is valid as long as device is valid.\n\t *\n\t * Returns the length of the returned raw-descriptor on success,\n\t * or a LIBUSB_ERROR code on failure.\n\t */\n\tint (*get_config_descriptor_by_value)(struct libusb_device *device,\n\t\tuint8_t bConfigurationValue, unsigned char **buffer,\n\t\tint *host_endian);\n\n\t/* Get the bConfigurationValue for the active configuration for a device.\n\t * Optional. This should only be implemented if you can retrieve it from\n\t * cache (don't generate I/O).\n\t *\n\t * If you cannot retrieve this from cache, either do not implement this\n\t * function, or return LIBUSB_ERROR_NOT_SUPPORTED. This will cause\n\t * libusb to retrieve the information through a standard control transfer.\n\t *\n\t * This function must be non-blocking.\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - LIBUSB_ERROR_NOT_SUPPORTED if the value cannot be retrieved without\n\t *   blocking\n\t * - another LIBUSB_ERROR code on other failure.\n\t */\n\tint (*get_configuration)(struct libusb_device_handle *handle, int *config);\n\n\t/* Set the active configuration for a device.\n\t *\n\t * A configuration value of -1 should put the device in unconfigured state.\n\t *\n\t * This function can block.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if the configuration does not exist\n\t * - LIBUSB_ERROR_BUSY if interfaces are currently claimed (and hence\n\t *   configuration cannot be changed)\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - another LIBUSB_ERROR code on other failure.\n\t */\n\tint (*set_configuration)(struct libusb_device_handle *handle, int config);\n\n\t/* Claim an interface. When claimed, the application can then perform\n\t * I/O to an interface's endpoints.\n\t *\n\t * This function should not generate any bus I/O and should not block.\n\t * Interface claiming is a logical operation that simply ensures that\n\t * no other drivers/applications are using the interface, and after\n\t * claiming, no other drivers/applicatiosn can use the interface because\n\t * we now \"own\" it.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if the interface does not exist\n\t * - LIBUSB_ERROR_BUSY if the interface is in use by another driver/app\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*claim_interface)(struct libusb_device_handle *handle, int interface_number);\n\n\t/* Release a previously claimed interface.\n\t *\n\t * This function should also generate a SET_INTERFACE control request,\n\t * resetting the alternate setting of that interface to 0. It's OK for\n\t * this function to block as a result.\n\t *\n\t * You will only ever be asked to release an interface which was\n\t * successfully claimed earlier.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*release_interface)(struct libusb_device_handle *handle, int interface_number);\n\n\t/* Set the alternate setting for an interface.\n\t *\n\t * You will only ever be asked to set the alternate setting for an\n\t * interface which was successfully claimed earlier.\n\t *\n\t * It's OK for this function to block.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if the alternate setting does not exist\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*set_interface_altsetting)(struct libusb_device_handle *handle,\n\t\tint interface_number, int altsetting);\n\n\t/* Clear a halt/stall condition on an endpoint.\n\t *\n\t * It's OK for this function to block.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*clear_halt)(struct libusb_device_handle *handle,\n\t\tunsigned char endpoint);\n\n\t/* Perform a USB port reset to reinitialize a device.\n\t *\n\t * If possible, the handle should still be usable after the reset\n\t * completes, assuming that the device descriptors did not change during\n\t * reset and all previous interface state can be restored.\n\t *\n\t * If something changes, or you cannot easily locate/verify the resetted\n\t * device, return LIBUSB_ERROR_NOT_FOUND. This prompts the application\n\t * to close the old handle and re-enumerate the device.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if re-enumeration is required, or if the device\n\t *   has been disconnected since it was opened\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*reset_device)(struct libusb_device_handle *handle);\n\n\t/* Determine if a kernel driver is active on an interface. Optional.\n\t *\n\t * The presence of a kernel driver on an interface indicates that any\n\t * calls to claim_interface would fail with the LIBUSB_ERROR_BUSY code.\n\t *\n\t * Return:\n\t * - 0 if no driver is active\n\t * - 1 if a driver is active\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*kernel_driver_active)(struct libusb_device_handle *handle,\n\t\tint interface_number);\n\n\t/* Detach a kernel driver from an interface. Optional.\n\t *\n\t * After detaching a kernel driver, the interface should be available\n\t * for claim.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if no kernel driver was active\n\t * - LIBUSB_ERROR_INVALID_PARAM if the interface does not exist\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*detach_kernel_driver)(struct libusb_device_handle *handle,\n\t\tint interface_number);\n\n\t/* Attach a kernel driver to an interface. Optional.\n\t *\n\t * Reattach a kernel driver to the device.\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NOT_FOUND if no kernel driver was active\n\t * - LIBUSB_ERROR_INVALID_PARAM if the interface does not exist\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected since it\n\t *   was opened\n\t * - LIBUSB_ERROR_BUSY if a program or driver has claimed the interface,\n\t *   preventing reattachment\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*attach_kernel_driver)(struct libusb_device_handle *handle,\n\t\tint interface_number);\n\n\t/* Destroy a device. Optional.\n\t *\n\t * This function is called when the last reference to a device is\n\t * destroyed. It should free any resources allocated in the get_device_list\n\t * path.\n\t */\n\tvoid (*destroy_device)(struct libusb_device *dev);\n\n\t/* Submit a transfer. Your implementation should take the transfer,\n\t * morph it into whatever form your platform requires, and submit it\n\t * asynchronously.\n\t *\n\t * This function must not block.\n\t *\n\t * This function gets called with the flying_transfers_lock locked!\n\t *\n\t * Return:\n\t * - 0 on success\n\t * - LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n\t * - another LIBUSB_ERROR code on other failure\n\t */\n\tint (*submit_transfer)(struct usbi_transfer *itransfer);\n\n\t/* Cancel a previously submitted transfer.\n\t *\n\t * This function must not block. The transfer cancellation must complete\n\t * later, resulting in a call to usbi_handle_transfer_cancellation()\n\t * from the context of handle_events.\n\t */\n\tint (*cancel_transfer)(struct usbi_transfer *itransfer);\n\n\t/* Clear a transfer as if it has completed or cancelled, but do not\n\t * report any completion/cancellation to the library. You should free\n\t * all private data from the transfer as if you were just about to report\n\t * completion or cancellation.\n\t *\n\t * This function might seem a bit out of place. It is used when libusb\n\t * detects a disconnected device - it calls this function for all pending\n\t * transfers before reporting completion (with the disconnect code) to\n\t * the user. Maybe we can improve upon this internal interface in future.\n\t */\n\tvoid (*clear_transfer_priv)(struct usbi_transfer *itransfer);\n\n\t/* Handle any pending events. This involves monitoring any active\n\t * transfers and processing their completion or cancellation.\n\t *\n\t * The function is passed an array of pollfd structures (size nfds)\n\t * as a result of the poll() system call. The num_ready parameter\n\t * indicates the number of file descriptors that have reported events\n\t * (i.e. the poll() return value). This should be enough information\n\t * for you to determine which actions need to be taken on the currently\n\t * active transfers.\n\t *\n\t * For any cancelled transfers, call usbi_handle_transfer_cancellation().\n\t * For completed transfers, call usbi_handle_transfer_completion().\n\t * For control/bulk/interrupt transfers, populate the \"transferred\"\n\t * element of the appropriate usbi_transfer structure before calling the\n\t * above functions. For isochronous transfers, populate the status and\n\t * transferred fields of the iso packet descriptors of the transfer.\n\t *\n\t * This function should also be able to detect disconnection of the\n\t * device, reporting that situation with usbi_handle_disconnect().\n\t *\n\t * When processing an event related to a transfer, you probably want to\n\t * take usbi_transfer.lock to prevent races. See the documentation for\n\t * the usbi_transfer structure.\n\t *\n\t * Return 0 on success, or a LIBUSB_ERROR code on failure.\n\t */\n\tint (*handle_events)(struct libusb_context *ctx,\n\t\tstruct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready);\n\n\t/* Get time from specified clock. At least two clocks must be implemented\n\t   by the backend: USBI_CLOCK_REALTIME, and USBI_CLOCK_MONOTONIC.\n\n\t   Description of clocks:\n\t     USBI_CLOCK_REALTIME : clock returns time since system epoch.\n\t     USBI_CLOCK_MONOTONIC: clock returns time since unspecified start\n\t                             time (usually boot).\n\t */\n\tint (*clock_gettime)(int clkid, struct timespec *tp);\n\n#ifdef USBI_TIMERFD_AVAILABLE\n\t/* clock ID of the clock that should be used for timerfd */\n\tclockid_t (*get_timerfd_clockid)(void);\n#endif\n\n\t/* Number of bytes to reserve for per-device private backend data.\n\t * This private data area is accessible through the \"os_priv\" field of\n\t * struct libusb_device. */\n\tsize_t device_priv_size;\n\n\t/* Number of bytes to reserve for per-handle private backend data.\n\t * This private data area is accessible through the \"os_priv\" field of\n\t * struct libusb_device. */\n\tsize_t device_handle_priv_size;\n\n\t/* Number of bytes to reserve for per-transfer private backend data.\n\t * This private data area is accessible by calling\n\t * usbi_transfer_get_os_priv() on the appropriate usbi_transfer instance.\n\t */\n\tsize_t transfer_priv_size;\n\n\t/* Mumber of additional bytes for os_priv for each iso packet.\n\t * Can your backend use this? */\n\t/* FIXME: linux can't use this any more. if other OS's cannot either,\n\t * then remove this */\n\tsize_t add_iso_packet_size;\n};\n\nextern const struct usbi_os_backend * const usbi_backend;\n\nextern const struct usbi_os_backend linux_usbfs_backend;\nextern const struct usbi_os_backend darwin_backend;\nextern const struct usbi_os_backend openbsd_backend;\nextern const struct usbi_os_backend netbsd_backend;\nextern const struct usbi_os_backend windows_backend;\nextern const struct usbi_os_backend wince_backend;\n\nextern struct list_head active_contexts_list;\nextern usbi_mutex_static_t active_contexts_lock;\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/android_netlink.c",
    "content": "/* -*- Mode: C; c-basic-offset:8 ; indent-tabs-mode:t -*- */\n/*\n * non-rooted Android usbfs backend for libusb\n * Copyright (C) 2007-2009 Daniel Drake <dsd@gentoo.org>\n * Copyright (c) 2001 Johannes Erdfelt <johannes@erdfelt.com>\n * Copyright (c) 2013 Nathan Hjelm <hjelmn@mac.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#define LOG_TAG \"libusb/netlink\"\n#if 0\t// デバッグ情報を出さない時1\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// LOGV/LOGD/MARKを出力しない時\n\t\t#endif\n\t#undef USE_LOGALL\t\t\t// 指定したLOGxだけを出力\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n\t#undef NDEBUG\n\t#define GET_RAW_DESCRIPTOR\n#endif\n\n#include \"config.h\"\n#include \"libusb.h\"\n#include \"libusbi.h\"\n#include \"android_usbfs.h\"\n\n#include <ctype.h>\n#include <dirent.h>\n#include <errno.h>\n#include <fcntl.h>\n#include <poll.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/types.h>\n\n#ifdef HAVE_ASM_TYPES_H\n#include <asm/types.h>\n#endif\n\n#ifdef HAVE_SYS_SOCKET_H\n#include <sys/socket.h>\n#endif\n\n#include <arpa/inet.h>\n\n#ifdef HAVE_LINUX_NETLINK_H\n#include <linux/netlink.h>\n#endif\n\n#ifdef HAVE_LINUX_FILTER_H\n#include <linux/filter.h>\n#endif\n\n#define KERNEL 1\n\nstatic int android_netlink_socket = -1;\nstatic int netlink_control_pipe[2] = { -1, -1 };\nstatic pthread_t libusb_android_event_thread;\n\nstatic void *android_netlink_event_thread_main(void *arg);\n\nstruct sockaddr_nl snl = { .nl_family=AF_NETLINK, .nl_groups=KERNEL };\n\nstatic int set_fd_cloexec_nb (int fd)\n{\n\tint flags;\n\n#if defined(FD_CLOEXEC)\n\tflags = fcntl (android_netlink_socket, F_GETFD);\n\tif (0 > flags) {\n\t\treturn -1;\n\t}\n\n\tif (!(flags & FD_CLOEXEC)) {\n\t\tfcntl (android_netlink_socket, F_SETFD, flags | FD_CLOEXEC);\n\t}\n#endif\n\n\tflags = fcntl (android_netlink_socket, F_GETFL);\n\tif (0 > flags) {\n\t\treturn -1;\n\t}\n\n\tif (!(flags & O_NONBLOCK)) {\n\t\tfcntl (android_netlink_socket, F_SETFL, flags | O_NONBLOCK);\n\t}\n\n\treturn 0;\n}\n\nint android_netlink_start_event_monitor(void)\n{\n\tENTER();\n\tint socktype = SOCK_RAW;\n\tint ret;\n\n\tsnl.nl_groups = KERNEL;\n\n#if defined(SOCK_CLOEXEC)\n\tsocktype |= SOCK_CLOEXEC;\n#endif\n#if defined(SOCK_NONBLOCK)\n\tsocktype |= SOCK_NONBLOCK;\n#endif\n\n\tandroid_netlink_socket = socket(PF_NETLINK, socktype, NETLINK_KOBJECT_UEVENT);\n\tif (-1 == android_netlink_socket && EINVAL == errno) {\n\t\tandroid_netlink_socket = socket(PF_NETLINK, SOCK_RAW, NETLINK_KOBJECT_UEVENT);\n\t}\n\n\tif (-1 == android_netlink_socket) {\n\t\tLOGE(\"failed to create android_netlink_socket:errno=%d\", errno);\t// 13:Permission deniedが返ってくる\n\t\tRETURN(LIBUSB_ERROR_OTHER, int);\n\t}\n\n\tret = set_fd_cloexec_nb (android_netlink_socket);\n\tif (0 != ret) {\n\t\tclose (android_netlink_socket);\n\t\tandroid_netlink_socket = -1;\n\t\tRETURN(LIBUSB_ERROR_OTHER, int);\n\t}\n\n\tret = bind(android_netlink_socket, (struct sockaddr *) &snl, sizeof(snl));\n\tif (0 != ret) {\n\t\tclose(android_netlink_socket);\n\t\tRETURN(LIBUSB_ERROR_OTHER, int);\n\t}\n\n\t/* TODO -- add authentication */\n\t/* setsockopt(android_netlink_socket, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)); */\n\n\tret = usbi_pipe(netlink_control_pipe);\n\tif (ret) {\n\t\tLOGE(\"could not create netlink control pipe\");\n\t\tusbi_err(NULL, \"could not create netlink control pipe\");\n\t        close(android_netlink_socket);\n\t\tRETURN(LIBUSB_ERROR_OTHER, int);\n\t}\n\n\tret = pthread_create(&libusb_android_event_thread, NULL, android_netlink_event_thread_main, NULL);\n\tif (0 != ret) {\n\t\tclose(netlink_control_pipe[0]);\n        close(netlink_control_pipe[1]);\n        close(android_netlink_socket);\n\t\tRETURN(LIBUSB_ERROR_OTHER, int);\n\t}\n\n\tRETURN(LIBUSB_SUCCESS, int);\n}\n\nint android_netlink_stop_event_monitor(void)\n{\n\tint r;\n\tchar dummy = 1;\n\n\tif (-1 == android_netlink_socket) {\n\t\t/* already closed. nothing to do */\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\t/* Write some dummy data to the control pipe and\n\t * wait for the thread to exit */\n\tr = usbi_write(netlink_control_pipe[1], &dummy, sizeof(dummy));\n\tif (r <= 0) {\n\t\tusbi_warn(NULL, \"netlink control pipe signal failed\");\n\t}\n\tpthread_join(libusb_android_event_thread, NULL);\n\n\tclose(android_netlink_socket);\n\tandroid_netlink_socket = -1;\n\n\t/* close and reset control pipe */\n\tclose(netlink_control_pipe[0]);\n\tclose(netlink_control_pipe[1]);\n\tnetlink_control_pipe[0] = -1;\n\tnetlink_control_pipe[1] = -1;\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic const char *netlink_message_parse (const char *buffer, size_t len, const char *key)\n{\n\tsize_t keylen = strlen(key);\n\tsize_t offset;\n\n\tfor (offset = 0 ; offset < len && '\\0' != buffer[offset] ; offset += strlen(buffer + offset) + 1) {\n\t\tif (0 == strncmp(buffer + offset, key, keylen) &&\n\t\t    '=' == buffer[offset + keylen]) {\n\t\t\treturn buffer + offset + keylen + 1;\n\t\t}\n\t}\n\n\treturn NULL;\n}\n\n/* parse parts of netlink message common to both libudev and the kernel */\nstatic int android_netlink_parse(char *buffer, size_t len, int *detached, const char **sys_name,\n\t\t\t       uint8_t *busnum, uint8_t *devaddr) {\n\tconst char *tmp;\n\tint i;\n\n\terrno = 0;\n\n\t*sys_name = NULL;\n\t*detached = 0;\n\t*busnum   = 0;\n\t*devaddr  = 0;\n\n\ttmp = netlink_message_parse((const char *) buffer, len, \"ACTION\");\n\tif (tmp == NULL)\n\t\treturn -1;\n\tif (0 == strcmp(tmp, \"remove\")) {\n\t\t*detached = 1;\n\t} else if (0 == strcmp(tmp, \"add\")) {\n\t\t// pass through\n\t} else if (0 != strcmp(tmp, \"change\")) {\n\t\tusbi_dbg(\"unknown device action [%s]\", tmp);\n\t\treturn -1;\n\t}\n\n\t/* check that this is a usb message */\n\ttmp = netlink_message_parse(buffer, len, \"SUBSYSTEM\");\n\tif (NULL == tmp || 0 != strcmp(tmp, \"usb\")) {\n\t\t/* not usb. ignore */\n\t\treturn -1;\n\t}\n\n\ttmp = netlink_message_parse(buffer, len, \"BUSNUM\");\n\tif (NULL == tmp) {\n\t\t/* no bus number. try \"DEVICE\" */\n\t\ttmp = netlink_message_parse(buffer, len, \"DEVICE\");\n\t\tif (NULL == tmp) {\n\t\t\t/* not usb. ignore */\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\t/* Parse a device path such as /dev/bus/usb/003/004 */\n\t\tchar *pLastSlash = (char*)strrchr(tmp,'/');\n\t\tif(NULL == pLastSlash) {\n\t\t\treturn -1;\n\t\t}\n\n\t\t*devaddr = strtoul(pLastSlash + 1, NULL, 10);\n\t\tif (errno) {\n\t\t\terrno = 0;\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\t*busnum = strtoul(pLastSlash - 3, NULL, 10);\n\t\tif (errno) {\n\t\t\terrno = 0;\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\treturn 0;\n\t}\n\n\t*busnum = (uint8_t)(strtoul(tmp, NULL, 10) & 0xff);\n\tif (errno) {\n\t\terrno = 0;\n\t\treturn -1;\n\t}\n\n\ttmp = netlink_message_parse(buffer, len, \"DEVNUM\");\n\tif (NULL == tmp) {\n\t\treturn -1;\n\t}\n\n\t*devaddr = (uint8_t)(strtoul(tmp, NULL, 10) & 0xff);\n\tif (errno) {\n\t\terrno = 0;\n\t\treturn -1;\n\t}\n\n\ttmp = netlink_message_parse(buffer, len, \"DEVPATH\");\n\tif (NULL == tmp) {\n\t\treturn -1;\n\t}\n\n\tfor (i = strlen(tmp) - 1 ; i ; --i) {\n\t\tif ('/' ==tmp[i]) {\n\t\t\t*sys_name = tmp + i + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* found a usb device */\n\treturn 0;\n}\n\nstatic int android_netlink_read_message(void)\n{\n\tchar buffer[1024];\t// XXX changed from unsigned char to char because the first argument of android_netlink_parse is char *\n\tstruct iovec iov = {.iov_base = buffer, .iov_len = sizeof(buffer)};\n\tstruct msghdr meh = { .msg_iov=&iov, .msg_iovlen=1,\n\t\t\t     .msg_name=&snl, .msg_namelen=sizeof(snl) };\n\tconst char *sys_name = NULL;\n\tuint8_t busnum, devaddr;\n\tint detached, r;\n\tsize_t len;\n\n\t/* read netlink message */\n\tmemset(buffer, 0, sizeof(buffer));\n\tlen = recvmsg(android_netlink_socket, &meh, 0);\n\tif (len < 32) {\n\t\tif (errno != EAGAIN)\n\t\t\tusbi_dbg(\"error recieving message from netlink\");\n\t\treturn -1;\n\t}\n\n\t/* TODO -- authenticate this message is from the kernel or udevd */\n\n\tr = android_netlink_parse(buffer, len, &detached, &sys_name, &busnum, &devaddr);\n\tif (r)\n\t\treturn r;\n\n\tusbi_dbg(\"netlink hotplug found device busnum: %hhu, devaddr: %hhu, sys_name: %s, removed: %s\",\n\t\t busnum, devaddr, sys_name, detached ? \"yes\" : \"no\");\n\n\t/* signal device is available (or not) to all contexts */\n\tif (detached)\n\t\tandroid_device_disconnected(busnum, devaddr, sys_name);\n\telse\n\t\tandroid_hotplug_enumerate(busnum, devaddr, sys_name);\n\n\treturn 0;\n}\n\nstatic void *android_netlink_event_thread_main(void *arg)\n{\n\tchar dummy;\n\tint r;\n\tstruct pollfd fds[] = {\n\t\t{ .fd = netlink_control_pipe[0],\n\t\t  .events = POLLIN },\n\t\t{ .fd = android_netlink_socket,\n\t\t  .events = POLLIN },\n\t};\n\n\t/* silence compiler warning */\n\t(void) arg;\n\n\twhile (poll(fds, 2, -1) >= 0) {\n\t\tif (fds[0].revents & POLLIN) {\n\t\t\t/* activity on control pipe, read the byte and exit */\n\t\t\tr = usbi_read(netlink_control_pipe[0], &dummy, sizeof(dummy));\n\t\t\tif (r <= 0) {\n\t\t\t\tusbi_warn(NULL, \"netlink control pipe read failed\");\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tif (fds[1].revents & POLLIN) {\n        \t\tusbi_mutex_static_lock(&android_hotplug_lock);\n\t        \tandroid_netlink_read_message();\n\t        \tusbi_mutex_static_unlock(&android_hotplug_lock);\n\t\t}\n\t}\n\n\treturn NULL;\n}\n\nvoid android_netlink_hotplug_poll(void)\n{\n\tint r;\n\n\tusbi_mutex_static_lock(&android_hotplug_lock);\n\tdo {\n\t\tr = android_netlink_read_message();\n\t} while (r == 0);\n\tusbi_mutex_static_unlock(&android_hotplug_lock);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/android_usbfs.c",
    "content": "/* -*- Mode: C; c-basic-offset:8 ; indent-tabs-mode:t -*- */\n/*********************************************************************\n * modified some function to avoid crash, support Android\n * Copyright (C) 2014-2016 saki@serenegiant All rights reserved.\n *********************************************************************/\n/*\n * Android usbfs backend for libusb\n * Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org>\n * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>\n * Copyright © 2013 Nathan Hjelm <hjelmn@mac.com>\n * Copyright © 2012-2013 Hans de Goede <hdegoede@redhat.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#define LOCAL_DEBUG 0\n\n#define LOG_TAG \"libusb/usbfs\"\n#if 1\t// デバッグ情報を出さない時1\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// LOGV/LOGD/MARKを出力しない時\n\t\t#endif\n\t#undef USE_LOGALL\t\t\t// 指定したLOGxだけを出力\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n\t#undef NDEBUG\n\t#define GET_RAW_DESCRIPTOR\n#endif\n\n#include \"config.h\"\n#include <assert.h>\n#include <ctype.h>\n#include <dirent.h>\n#include <errno.h>\n#include <fcntl.h>\n#include <poll.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/ioctl.h>\n#include <sys/stat.h>\n#include <sys/types.h>\n#include <sys/utsname.h>\n#include <unistd.h>\n\n#include \"libusb.h\"\n#include \"libusbi.h\"\n#include \"android_usbfs.h\"\n\n/* sysfs vs usbfs:\n * opening a usbfs node causes the device to be resumed, so we attempt to\n * avoid this during enumeration.\n *\n * sysfs allows us to read the kernel's in-memory copies of device descriptors\n * and so forth, avoiding the need to open the device:\n *  - The binary \"descriptors\" file contains all config descriptors since\n *    2.6.26, commit 217a9081d8e69026186067711131b77f0ce219ed\n *  - The binary \"descriptors\" file was added in 2.6.23, commit\n *    69d42a78f935d19384d1f6e4f94b65bb162b36df, but it only contains the\n *    active config descriptors\n *  - The \"busnum\" file was added in 2.6.22, commit\n *    83f7d958eab2fbc6b159ee92bf1493924e1d0f72\n *  - The \"devnum\" file has been present since pre-2.6.18\n *  - the \"bConfigurationValue\" file has been present since pre-2.6.18\n *\n * If we have bConfigurationValue, busnum, and devnum, then we can determine\n * the active configuration without having to open the usbfs node in RDWR mode.\n * The busnum file is important as that is the only way we can relate sysfs\n * devices to usbfs nodes.\n *\n * If we also have all descriptors, we can obtain the device descriptor and\n * configuration without touching usbfs at all.\n */\n\n/* endianness for multi-byte fields:\n *\n * Descriptors exposed by usbfs have the multi-byte fields in the device\n * descriptor as host endian. Multi-byte fields in the other descriptors are\n * bus-endian. The kernel documentation says otherwise, but it is wrong.\n *\n * In sysfs all descriptors are bus-endian.\n */\n\nstatic const char *usbfs_path = NULL;\n\n/* use usbdev*.* device names in /dev instead of the usbfs bus directories */\nstatic int usbdev_names = 0;\n\n/* Linux 2.6.32 adds support for a bulk continuation URB flag. this basically\n * allows us to mark URBs as being part of a specific logical transfer when\n * we submit them to the kernel. then, on any error except a cancellation, all\n * URBs within that transfer will be cancelled and no more URBs will be\n * accepted for the transfer, meaning that no more data can creep in.\n *\n * The BULK_CONTINUATION flag must be set on all URBs within a bulk transfer\n * (in either direction) except the first.\n * For IN transfers, we must also set SHORT_NOT_OK on all URBs except the\n * last; it means that the kernel should treat a short reply as an error.\n * For OUT transfers, SHORT_NOT_OK must not be set. it isn't needed (OUT\n * transfers can't be short unless there's already some sort of error), and\n * setting this flag is disallowed (a kernel with USB debugging enabled will\n * reject such URBs).\n */\nstatic int supports_flag_bulk_continuation = -1;\n\n/* Linux 2.6.31 fixes support for the zero length packet URB flag. This\n * allows us to mark URBs that should be followed by a zero length data\n * packet, which can be required by device- or class-specific protocols.\n */\nstatic int supports_flag_zero_packet = -1;\n\n/* clock ID for monotonic clock, as not all clock sources are available on all\n * systems. appropriate choice made at initialization time. */\nstatic clockid_t monotonic_clkid = -1;\n\n/* Linux 2.6.22 (commit 83f7d958eab2fbc6b159ee92bf1493924e1d0f72) adds a busnum\n * to sysfs, so we can relate devices. This also implies that we can read\n * the active configuration through bConfigurationValue */\nstatic int sysfs_can_relate_devices = -1;\n\n/* Linux 2.6.26 (commit 217a9081d8e69026186067711131b77f0ce219ed) adds all\n * config descriptors (rather then just the active config) to the sysfs\n * descriptors file, so from then on we can use them. */\nstatic int sysfs_has_descriptors = -1;\n\n/* how many times have we initted (and not exited) ? */\nstatic int init_count = 0;\n\n/* Serialize hotplug start/stop */\nusbi_mutex_static_t android_hotplug_startstop_lock = USBI_MUTEX_INITIALIZER;\n/* Serialize scan-devices, event-thread, and poll */\nusbi_mutex_static_t android_hotplug_lock = USBI_MUTEX_INITIALIZER;\n\nstatic int android_start_event_monitor(void);\nstatic int android_stop_event_monitor(void);\nstatic int android_scan_devices(struct libusb_context *ctx);\nstatic int sysfs_scan_device(struct libusb_context *ctx, const char *devname);\nstatic int detach_kernel_driver_and_claim(struct libusb_device_handle *, int);\n\n#if !defined(USE_UDEV)\nstatic int android_default_scan_devices(struct libusb_context *ctx);\n#endif\n\nstruct android_device_priv {\n\tchar *sysfs_dir;\n\tunsigned char *descriptors;\n\tint descriptors_len;\n\tint active_config; /* cache val for !sysfs_can_relate_devices  */\n\tint fd;\n};\n\nstruct android_device_handle_priv {\n\tint fd;\n\tuint32_t caps;\n};\n\nenum reap_action {\n\tNORMAL = 0,\n\t/* submission failed after the first URB, so await cancellation/completion\n\t * of all the others */\n\tSUBMIT_FAILED,\n\n\t/* cancelled by user or timeout */\n\tCANCELLED,\n\n\t/* completed multi-URB transfer in non-final URB */\n\tCOMPLETED_EARLY,\n\n\t/* one or more urbs encountered a low-level error */\n\tERROR,\n};\n\nstruct android_transfer_priv {\n\tunion {\n\t\tstruct usbfs_urb *urbs;\n\t\tstruct usbfs_urb **iso_urbs;\n\t};\n\n\tenum reap_action reap_action;\n\tint num_urbs;\n\tint num_retired;\n\tenum libusb_transfer_status reap_status;\n\n\t/* next iso packet in user-supplied transfer to be populated */\n\tint iso_packet_offset;\n};\n\n#if LOCAL_DEBUG\nstatic void dump_urb(int ix, int fd, struct usbfs_urb *urb) {\n\tLOGI(\"%d:fd=%d\", ix, fd);\n\tint ret = fcntl(fd, F_GETFL);\n\tif (UNLIKELY(ret == -1)) {\n\t\tLOGE(\"Failed to get fd flags: %d\", errno);\n\t}\n\tLOGI(\"ファイフディスクリプタフラグ:%x\", ret);\n\tLOGI(\"O_ACCMODE:%x\", ret & O_ACCMODE);\t\t\t\t// 0:読み込み専用, 1:書き込み専用, 2;読み書き可\n\tLOGI(\"ノンブロッキングかどうか:%d\", ret & O_NONBLOCK);\t// 0:ブロッキング\n\tLOGI(\"%d:type=%d,endpopint=0x%02x,status=%d,flag=%d\", ix, urb->type, urb->endpoint, urb->status, urb->flags);\n\tLOGI(\"%d:buffer=%p,buffer_length=%d,actual_length=%d,start_frame=%d\", ix, urb->buffer, urb->buffer_length, urb->actual_length, urb->start_frame);\n\tLOGI(\"%d:number_of_packets=%d,error_count=%d,signr=%d\", ix, urb->number_of_packets, urb->error_count, urb->signr);\n\tLOGI(\"%d:usercontext=%p,iso_frame_desc=%p\", ix, urb->usercontext, urb->iso_frame_desc);\n}\n#endif\n\n/**\n * this is original _get_usbfs_fd (name changed to __get_usbfs_fd)\n */\nstatic int __get_usbfs_fd(struct libusb_device *dev, mode_t mode, int silent) {\n\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\tchar path[PATH_MAX];\n\tint fd;\n\tint delay = 10000;\n\n\tif (usbdev_names)\n\t\tsnprintf(path, PATH_MAX, \"%s/usbdev%d.%d\",\n\t\t\tusbfs_path, dev->bus_number, dev->device_address);\n\telse\n\t\tsnprintf(path, PATH_MAX, \"%s/%03d/%03d\",\n\t\t\tusbfs_path, dev->bus_number, dev->device_address);\n\n\tfd = open(path, mode);\n\tif (LIKELY(fd != -1))\n\t\treturn fd; /* Success */\n\n\tif (errno == ENOENT) {\n\t\tif (!silent)\n\t\t\tusbi_err(ctx, \"File doesn't exist, wait %d ms and try again\\n\", delay / 1000);\n\n\t\t/* Wait 10ms for USB device path creation.*/\n\t\tusleep(delay);\n\n\t\tfd = open(path, mode);\n\t\tif (LIKELY(fd != -1))\n\t\t\treturn fd; /* Success */\n\t}\n\n\tif (!silent) {\n\t\tusbi_err(ctx, \"libusb couldn't open USB device %s: %s\",\n\t\t\tpath, strerror(errno));\n\t\tif (errno == EACCES && mode == O_RDWR)\n\t\t\tusbi_err(ctx, \"libusb requires write access to USB \"\n\t\t\t\t\t\"device nodes.\");\n\t}\n\n\tif (errno == EACCES)\n\t\treturn LIBUSB_ERROR_ACCESS;\n\tif (errno == ENOENT)\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\treturn LIBUSB_ERROR_IO;\n}\n\nstatic struct android_device_priv *_device_priv(struct libusb_device *device);\nstatic int _get_usbfs_fd(struct libusb_device *device, mode_t mode, int silent) {\n#ifdef __ANDROID__\n\tstruct android_device_priv *dpriv = _device_priv(device);\n\n\tif (LIKELY(dpriv->fd > 0))\n\t\treturn dpriv->fd;\n\telse {\n\t\t// fall back to original _get_usbfs_fd function\n\t\t// but this call will fail on Android devices without root\n#if !defined(__LP64__)\n\t\tusbi_dbg(\"fd have not set yet. device=%x,fd=%d\", (int )device, dpriv->fd);\n#else\n\t\tusbi_dbg(\"fd have not set yet. device=%x,fd=%d\", (long )device, dpriv->fd);\n#endif\n\t\treturn __get_usbfs_fd(device, mode, silent);\n\t}\n#else\n\treturn __get_usbfs_fd(device, mode, silent);\n#endif\n}\n\nstatic struct android_device_priv *_device_priv(struct libusb_device *dev) {\n\treturn (struct android_device_priv *) dev->os_priv;\n}\n\nstatic struct android_device_handle_priv *_device_handle_priv(\n\t\tstruct libusb_device_handle *handle) {\n\treturn (struct android_device_handle_priv *) handle->os_priv;\n}\n\n/* check dirent for a /dev/usbdev%d.%d name\n * optionally return bus/device on success */\nstatic int _is_usbdev_entry(struct dirent *entry, int *bus_p, int *dev_p) {\n\tint busnum, devnum;\n\n\tif (sscanf(entry->d_name, \"usbdev%d.%d\", &busnum, &devnum) != 2)\n\t\treturn LIBUSB_SUCCESS;\n\n\tusbi_dbg(\"found: %s\", entry->d_name);\n\tif (bus_p != NULL)\n\t\t*bus_p = busnum;\n\tif (dev_p != NULL)\n\t\t*dev_p = devnum;\n\treturn 1;\n}\n\nstatic int check_usb_vfs(const char *dirname) {\n\tDIR *dir;\n\tstruct dirent *entry;\n\tint found = 0;\n\n\tdir = opendir(dirname);\n\tif (!dir)\n\t\treturn LIBUSB_SUCCESS;\n\n\twhile ((entry = readdir(dir)) != NULL ) {\n\t\tif (entry->d_name[0] == '.')\n\t\t\tcontinue;\n\n\t\t/* We assume if we find any files that it must be the right place */\n\t\tfound = 1;\n\t\tbreak;\n\t}\n\n\tclosedir(dir);\n\treturn found;\n}\n\nstatic const char *find_usbfs_path(void) {\n\tconst char *path = \"/dev/bus/usb\";\n\tconst char *ret = NULL;\n\n\tif (check_usb_vfs(path)) {\n\t\tret = path;\n\t} else {\n\t\tpath = \"/proc/bus/usb\";\n\t\tif (check_usb_vfs(path))\n\t\t\tret = path;\n\t}\n\n\t/* look for /dev/usbdev*.* if the normal places fail */\n\tif (ret == NULL) {\n\t\tstruct dirent *entry;\n\t\tDIR *dir;\n\n\t\tpath = \"/dev\";\n\t\tdir = opendir(path);\n\t\tif (dir != NULL) {\n\t\t\twhile ((entry = readdir(dir)) != NULL ) {\n\t\t\t\tif (_is_usbdev_entry(entry, NULL, NULL)) {\n\t\t\t\t\t/* found one; that's enough */\n\t\t\t\t\tret = path;\n\t\t\t\t\tusbdev_names = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir(dir);\n\t\t}\n\t}\n\n\tif (ret != NULL)\n\t\tusbi_dbg(\"found usbfs at %s\", ret);\n\n\treturn ret;\n}\n\n/* the monotonic clock is not usable on all systems (e.g. embedded ones often\n * seem to lack it). fall back to REALTIME if we have to. */\nstatic clockid_t find_monotonic_clock(void) {\n#ifdef CLOCK_MONOTONIC\n\tstruct timespec ts;\n\tint r;\n\n\t/* Linux 2.6.28 adds CLOCK_MONOTONIC_RAW but we don't use it\n\t * because it's not available through timerfd */\n\tr = clock_gettime(CLOCK_MONOTONIC, &ts);\n\tif (r == 0)\n\t\treturn CLOCK_MONOTONIC;\n\tusbi_dbg(\"monotonic clock doesn't work, errno %d\", errno);\n#endif\n\n\treturn CLOCK_REALTIME;\n}\n\nstatic int kernel_version_ge(int major, int minor, int sublevel) {\n\tstruct utsname uts;\n\tint atoms, kmajor, kminor, ksublevel;\n\n\tif (uname(&uts) < 0)\n\t\treturn -1;\n\tatoms = sscanf(uts.release, \"%d.%d.%d\", &kmajor, &kminor, &ksublevel);\n\tif (UNLIKELY(atoms < 1))\n\t\treturn -1;\n\n\tif (kmajor > major)\n\t\treturn 1;\n\tif (kmajor < major)\n\t\treturn 0;\n\n\t/* kmajor == major */\n\tif (atoms < 2)\n\t\treturn 0 == minor && 0 == sublevel;\n\tif (kminor > minor)\n\t\treturn 1;\n\tif (kminor < minor)\n\t\treturn 0;\n\n\t/* kminor == minor */\n\tif (atoms < 3)\n\t\treturn 0 == sublevel;\n\n\treturn ksublevel >= sublevel;\n}\n\nstatic int op_init2(struct libusb_context *ctx, const char *usbfs) {\t// XXX\n\tstruct stat statbuf;\n\tint r;\n\n\tENTER();\n\tif (!usbfs || !strlen(usbfs)) {\n\t\tusbfs_path = find_usbfs_path();\n\t} else {\n\t\tusbfs_path = usbfs;\n\t}\n\tif (UNLIKELY(!usbfs_path)) {\n\t\tLOGE(\"could not find usbfs\");\n\t\tusbi_err(ctx, \"could not find usbfs\");\n\t\tRETURN(LIBUSB_ERROR_OTHER, int);\n\t}\n\n\tif (monotonic_clkid == -1)\n\t\tmonotonic_clkid = find_monotonic_clock();\n\n\tif (supports_flag_bulk_continuation == -1) {\n\t\t/* bulk continuation URB flag available from Linux 2.6.32 */\n\t\tsupports_flag_bulk_continuation = kernel_version_ge(2, 6, 32);\n\t\tif (supports_flag_bulk_continuation == -1) {\n\t\t\tLOGE(\"error checking for bulk continuation support\");\n\t\t\tusbi_err(ctx, \"error checking for bulk continuation support\");\n\t\t\tRETURN(LIBUSB_ERROR_OTHER, int);\n\t\t}\n\t}\n\n\tif (supports_flag_bulk_continuation)\n\t\tusbi_dbg(\"bulk continuation flag supported\");\n\n\tif (-1 == supports_flag_zero_packet) {\n\t\t/* zero length packet URB flag fixed since Linux 2.6.31 */\n\t\tsupports_flag_zero_packet = kernel_version_ge(2, 6, 31);\n\t\tif (-1 == supports_flag_zero_packet) {\n\t\t\tLOGE(\"error checking for zero length packet support\");\n\t\t\tusbi_err(ctx, \"error checking for zero length packet support\");\n\t\t\tRETURN(LIBUSB_ERROR_OTHER, int);\n\t\t}\n\t}\n\n\tif (supports_flag_zero_packet)\n\t\tusbi_dbg(\"zero length packet flag supported\");\n\n\tif (-1 == sysfs_has_descriptors) {\n\t\t/* sysfs descriptors has all descriptors since Linux 2.6.26 */\n\t\tsysfs_has_descriptors = kernel_version_ge(2, 6, 26);\n\t\tif (UNLIKELY(-1 == sysfs_has_descriptors)) {\n\t\t\tLOGE(\"error checking for sysfs descriptors\");\n\t\t\tusbi_err(ctx, \"error checking for sysfs descriptors\");\n\t\t\tRETURN(LIBUSB_ERROR_OTHER, int);\n\t\t}\n\t}\n\n\tif (-1 == sysfs_can_relate_devices) {\n\t\t/* sysfs has busnum since Linux 2.6.22 */\n\t\tsysfs_can_relate_devices = kernel_version_ge(2, 6, 22);\n\t\tif (UNLIKELY(-1 == sysfs_can_relate_devices)) {\n\t\t\tLOGE(\"error checking for sysfs busnum\");\n\t\t\tusbi_err(ctx, \"error checking for sysfs busnum\");\n\t\t\tRETURN(LIBUSB_ERROR_OTHER, int);\n\t\t}\n\t}\n\n\tif (sysfs_can_relate_devices || sysfs_has_descriptors) {\n\t\tr = stat(SYSFS_DEVICE_PATH, &statbuf);\n\t\tif (r != 0 || !S_ISDIR(statbuf.st_mode)) {\n\t\t\tusbi_warn(ctx, \"sysfs not mounted\");\n\t\t\tsysfs_can_relate_devices = 0;\n\t\t\tsysfs_has_descriptors = 0;\n\t\t}\n\t}\n\n\tif (sysfs_can_relate_devices)\n\t\tusbi_dbg(\"sysfs can relate devices\");\n\n\tif (sysfs_has_descriptors)\n\t\tusbi_dbg(\"sysfs has complete descriptors\");\n\n\tusbi_mutex_static_lock(&android_hotplug_startstop_lock);\n\tr = LIBUSB_SUCCESS;\n\tif (init_count == 0) {\n\t\tLOGI(\"start up hotplug event handler\");\n\t\tint r = android_start_event_monitor();\n\t\tif (r != LIBUSB_SUCCESS) {\n\t\t\tLOGE(\"warning: error starting hotplug event monitor\");\n\t\t\tusbi_err(ctx, \"warning: error starting hotplug event monitor\");\n\t\t}\n\t}\n\tif (r == LIBUSB_SUCCESS) {\n\t\tLOGI(\"call android_scan_devices\");\n\t\tr = android_scan_devices(ctx);\n\t\tif (r == LIBUSB_SUCCESS)\n\t\t\tinit_count++;\n\t\telse if (init_count == 0)\n\t\t\tandroid_stop_event_monitor();\n\t} else {\n\t\tLOGE(\"error starting hotplug event monitor\");\n\t\tusbi_err(ctx, \"error starting hotplug event monitor\");\n\t}\n\tusbi_mutex_static_unlock(&android_hotplug_startstop_lock);\n\n\tRETURN(r, int);\n}\n\nstatic int op_init(struct libusb_context *ctx) {\n\treturn op_init2(ctx, NULL);\n#if 0\n\tstruct stat statbuf;\n\tint r;\n\n\tusbfs_path = find_usbfs_path();\n\tif (UNLIKELY(!usbfs_path)) {\n\t\tusbi_err(ctx, \"could not find usbfs\");\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\tif (monotonic_clkid == -1)\n\t\tmonotonic_clkid = find_monotonic_clock();\n\n\tif (supports_flag_bulk_continuation == -1) {\n\t\t/* bulk continuation URB flag available from Linux 2.6.32 */\n\t\tsupports_flag_bulk_continuation = kernel_version_ge(2, 6, 32);\n\t\tif (supports_flag_bulk_continuation == -1) {\n\t\t\tusbi_err(ctx, \"error checking for bulk continuation support\");\n\t\t\treturn LIBUSB_ERROR_OTHER;\n\t\t}\n\t}\n\n\tif (supports_flag_bulk_continuation)\n\t\tusbi_dbg(\"bulk continuation flag supported\");\n\n\tif (-1 == supports_flag_zero_packet) {\n\t\t/* zero length packet URB flag fixed since Linux 2.6.31 */\n\t\tsupports_flag_zero_packet = kernel_version_ge(2, 6, 31);\n\t\tif (-1 == supports_flag_zero_packet) {\n\t\t\tusbi_err(ctx, \"error checking for zero length packet support\");\n\t\t\treturn LIBUSB_ERROR_OTHER;\n\t\t}\n\t}\n\n\tif (supports_flag_zero_packet)\n\t\tusbi_dbg(\"zero length packet flag supported\");\n\n\tif (-1 == sysfs_has_descriptors) {\n\t\t/* sysfs descriptors has all descriptors since Linux 2.6.26 */\n\t\tsysfs_has_descriptors = kernel_version_ge(2, 6, 26);\n\t\tif (UNLIKELY(-1 == sysfs_has_descriptors)) {\n\t\t\tusbi_err(ctx, \"error checking for sysfs descriptors\");\n\t\t\treturn LIBUSB_ERROR_OTHER;\n\t\t}\n\t}\n\n\tif (-1 == sysfs_can_relate_devices) {\n\t\t/* sysfs has busnum since Linux 2.6.22 */\n\t\tsysfs_can_relate_devices = kernel_version_ge(2, 6, 22);\n\t\tif (UNLIKELY(-1 == sysfs_can_relate_devices)) {\n\t\t\tusbi_err(ctx, \"error checking for sysfs busnum\");\n\t\t\treturn LIBUSB_ERROR_OTHER;\n\t\t}\n\t}\n\n\tif (sysfs_can_relate_devices || sysfs_has_descriptors) {\n\t\tr = stat(SYSFS_DEVICE_PATH, &statbuf);\n\t\tif (r != 0 || !S_ISDIR(statbuf.st_mode)) {\n\t\t\tusbi_warn(ctx, \"sysfs not mounted\");\n\t\t\tsysfs_can_relate_devices = 0;\n\t\t\tsysfs_has_descriptors = 0;\n\t\t}\n\t}\n\n\tif (sysfs_can_relate_devices)\n\t\tusbi_dbg(\"sysfs can relate devices\");\n\n\tif (sysfs_has_descriptors)\n\t\tusbi_dbg(\"sysfs has complete descriptors\");\n\n\tusbi_mutex_static_lock(&android_hotplug_startstop_lock);\n\tr = LIBUSB_SUCCESS;\n\tif (init_count == 0) {\n\t\tLOGI(\"start up hotplug event handler\");\n\t\tr = android_start_event_monitor();\n\t}\n\tif (r == LIBUSB_SUCCESS) {\n\t\tr = android_scan_devices(ctx);\n\t\tif (r == LIBUSB_SUCCESS)\n\t\t\tinit_count++;\n\t\telse if (init_count == 0)\n\t\t\tandroid_stop_event_monitor();\n\t} else\n\t\tusbi_err(ctx, \"error starting hotplug event monitor\");\n\tusbi_mutex_static_unlock(&android_hotplug_startstop_lock);\n\n\treturn r;\n#endif\n}\n\n\nstatic void op_exit(void) {\n\tENTER();\n\n\tusbi_mutex_static_lock(&android_hotplug_startstop_lock);\n\tassert(init_count != 0);\n\tif (!--init_count) {\n\t\t/* tear down event handler */\n\t\t(void) android_stop_event_monitor();\n\t}\n\tusbi_mutex_static_unlock(&android_hotplug_startstop_lock);\n\n\tEXIT();\n}\n\nstatic int android_start_event_monitor(void) {\n\tENTER();\n#ifdef __ANDROID__\n\t// do nothing\n\tRETURN(LIBUSB_SUCCESS, int);\n#else\n#if defined(USE_UDEV)\n\tRETURN(android_udev_start_event_monitor(), int);\n#else\n\tRETURN(android_netlink_start_event_monitor(), int);\n#endif\n#endif\n}\n\nstatic int android_stop_event_monitor(void) {\n\tENTER();\n#ifdef __ANDROID__\n\tRETURN(LIBUSB_SUCCESS, int);\n#else\n#if defined(USE_UDEV)\n\tRETURN(android_udev_stop_event_monitor(), int);\n#else\n\tRETURN(android_netlink_stop_event_monitor(), int);\n#endif\n#endif\n}\n\nstatic int android_scan_devices(struct libusb_context *ctx) {\n\tENTER();\n\tint ret = LIBUSB_SUCCESS;\n\n#ifdef __ANDROID__\n\t// do nothing\n#else\n\tusbi_mutex_static_lock(&android_hotplug_lock);\n\n#if defined(USE_UDEV)\n\tret = android_udev_scan_devices(ctx);\n#else\n\tret = android_default_scan_devices(ctx);\n#endif\n\n\tusbi_mutex_static_unlock(&android_hotplug_lock);\n#endif\n\tRETURN(ret, int);\n}\n\nstatic void op_hotplug_poll(void) {\n\tENTER();\n#ifdef __ANDROID__\n\t// do nothing\n#else\n#if defined(USE_UDEV)\n\tandroid_udev_hotplug_poll();\n#else\n\tandroid_netlink_hotplug_poll();\n#endif\n#endif\n\tEXIT();\n}\n\nstatic int _open_sysfs_attr(struct libusb_device *dev, const char *attr) {\n\tstruct android_device_priv *priv = _device_priv(dev);\n\tchar filename[PATH_MAX];\n\tint fd;\n\n\tsnprintf(filename, PATH_MAX, \"%s/%s/%s\",\n\t\tSYSFS_DEVICE_PATH, priv->sysfs_dir, attr);\n\tfd = open(filename, O_RDONLY);\n\tif (UNLIKELY(fd < 0)) {\n\t\tusbi_err(DEVICE_CTX(dev),\n\t\t\t\"open %s failed ret=%d errno=%d\", filename, fd, errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\treturn fd;\n}\n\n/* Note only suitable for attributes which always read >= 0, < 0 is error */\nstatic int __read_sysfs_attr(struct libusb_context *ctx, const char *devname,\n\t\tconst char *attr) {\n\tchar filename[PATH_MAX];\n\tFILE *f;\n\tint r, value;\n\n\tsnprintf(filename, PATH_MAX, \"%s/%s/%s\", SYSFS_DEVICE_PATH, devname, attr);\n\tf = fopen(filename, \"r\");\n\tif (UNLIKELY(f == NULL)) {\n\t\tif (errno == ENOENT) {\n\t\t\t/* File doesn't exist. Assume the device has been\n\t\t\t disconnected (see trac ticket #70). */\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t\t}\n\t\tusbi_err(ctx, \"open %s failed errno=%d\", filename, errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tr = fscanf(f, \"%d\", &value);\n\tfclose(f);\n\tif (UNLIKELY(r != 1)) {\n\t\tusbi_err(ctx, \"fscanf %s returned %d, errno=%d\", attr, r, errno);\n\t\treturn LIBUSB_ERROR_NO_DEVICE; /* For unplug race (trac #70) */\n\t}\n\tif (UNLIKELY(value < 0)) {\n\t\tusbi_err(ctx, \"%s contains a negative value\", filename);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\treturn value;\n}\n\n// XXX\nstatic int op_get_raw_descriptor(struct libusb_device *dev,\n\t\tunsigned char *buffer, int *descriptors_len, int *host_endian) {\n\tstruct android_device_priv *priv = _device_priv(dev);\n\n\tif (!descriptors_len || !host_endian)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t*host_endian = sysfs_has_descriptors ? 0 : 1;\n\tif (buffer && (*descriptors_len >= priv->descriptors_len)) {\n\t\tmemcpy(buffer, priv->descriptors, priv->descriptors_len);\n\t}\n\t*descriptors_len = priv->descriptors_len;\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int op_get_device_descriptor(struct libusb_device *dev,\n\t\tunsigned char *buffer, int *host_endian) {\n\tstruct android_device_priv *priv = _device_priv(dev);\n\n\tif (!host_endian)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t*host_endian = sysfs_has_descriptors ? 0 : 1;\n\tmemcpy(buffer, priv->descriptors, DEVICE_DESC_LENGTH);\n\n\treturn LIBUSB_SUCCESS;\n}\n\n/* read the bConfigurationValue for a device */\nstatic int sysfs_get_active_config(struct libusb_device *dev, int *config) {\n\tchar *endptr;\n\tchar tmp[5] = { 0, 0, 0, 0, 0 };\n\tlong num;\n\tint fd;\n\tssize_t r;\n\n\tfd = _open_sysfs_attr(dev, \"bConfigurationValue\");\n\tif (UNLIKELY(fd < 0))\n\t\treturn fd;\n\n\tr = read(fd, tmp, sizeof(tmp));\n\tclose(fd);\n\tif (UNLIKELY(r < 0)) {\n\t\tusbi_err(DEVICE_CTX(dev),\n\t\t\t\"read bConfigurationValue failed ret=%d errno=%d\", r, errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t} else if (r == 0) {\n\t\tusbi_dbg(\"device unconfigured\");\n\t\t*config = -1;\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\tif (tmp[sizeof(tmp) - 1] != 0) {\n\t\tusbi_err(DEVICE_CTX(dev), \"not null-terminated?\");\n\t\treturn LIBUSB_ERROR_IO;\n\t} else if (tmp[0] == 0) {\n\t\tusbi_err(DEVICE_CTX(dev), \"no configuration value?\");\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tnum = strtol(tmp, &endptr, 10);\n\tif (endptr == tmp) {\n\t\tusbi_err(DEVICE_CTX(dev), \"error converting '%s' to integer\", tmp);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\t*config = (int) num;\n\treturn LIBUSB_SUCCESS;\n}\n\nint android_get_device_address(struct libusb_context *ctx, int detached,\n\t\tuint8_t *busnum, uint8_t *devaddr, const char *dev_node,\n\t\tconst char *sys_name) {\n\tint sysfs_attr;\n\n\tusbi_dbg(\"getting address for device: %s detached: %d\", sys_name, detached);\n\t/* can't use sysfs to read the bus and device number if the\n\t * device has been detached */\n\tif (!sysfs_can_relate_devices || detached || NULL == sys_name) {\n\t\tif (NULL == dev_node) {\n\t\t\treturn LIBUSB_ERROR_OTHER;\n\t\t}\n\n\t\t/* will this work with all supported kernel versions? */\n\t\tif (!strncmp(dev_node, \"/dev/bus/usb\", 12)) {\n\t\t\tsscanf(dev_node, \"/dev/bus/usb/%hhd/%hhd\", busnum, devaddr);\n\t\t} else if (!strncmp(dev_node, \"/proc/bus/usb\", 13)) {\n\t\t\tsscanf(dev_node, \"/proc/bus/usb/%hhd/%hhd\", busnum, devaddr);\n\t\t}\n\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\tusbi_dbg(\"scan %s\", sys_name);\n\n\tsysfs_attr = __read_sysfs_attr(ctx, sys_name, \"busnum\");\n\tif (0 > sysfs_attr)\n\t\treturn sysfs_attr;\n\tif (sysfs_attr > 255)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t*busnum = (uint8_t) sysfs_attr;\n\n\tsysfs_attr = __read_sysfs_attr(ctx, sys_name, \"devnum\");\n\tif (0 > sysfs_attr)\n\t\treturn sysfs_attr;\n\tif (sysfs_attr > 255)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\t*devaddr = (uint8_t) sysfs_attr;\n\n\tusbi_dbg(\"bus=%d dev=%d\", *busnum, *devaddr);\n\n\treturn LIBUSB_SUCCESS;\n}\n\n/*\n * Return offset of the first descriptor with the given type\n * return 0 if the buffer is already placed at the specific descriptor.\n * this is the difference from seek_to_next_descriptor\n */\nstatic int seek_to_first_descriptor(struct libusb_context *ctx,\n\t\tuint8_t descriptor_type, unsigned char *buffer, int size) {\n\tstruct usb_descriptor_header header;\n\tint i;\n\n\tfor (i = 0; size >= 0; i += header.bLength, size -= header.bLength) {\n\t\tif (size == 0)\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\t\tif (size < LIBUSB_DT_HEADER_SIZE) {\n\t\t\tusbi_err(ctx, \"short descriptor read %d/2\", size);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t}\n\t\tusbi_parse_descriptor(buffer + i, \"bb\", &header, 0);\n\n\t\tif (header.bDescriptorType == descriptor_type)\t// XXX\n\t\t\treturn i;\n\t}\n\tusbi_err(ctx, \"bLength overflow by %d bytes\", -size);\n\treturn LIBUSB_ERROR_IO;\n}\n\n\n/* Return offset of the next descriptor with the given type */\nstatic int seek_to_next_descriptor(struct libusb_context *ctx,\n\t\tuint8_t descriptor_type, unsigned char *buffer, int size) {\n\tstruct usb_descriptor_header header;\n\tint i;\n\n\tfor (i = 0; size >= 0; i += header.bLength, size -= header.bLength) {\n\t\tif (size == 0)\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\t\tif (size < LIBUSB_DT_HEADER_SIZE) {\n\t\t\tusbi_err(ctx, \"short descriptor read %d/2\", size);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t}\n\t\tusbi_parse_descriptor(buffer + i, \"bb\", &header, 0);\n\n\t\tif (i && header.bDescriptorType == descriptor_type)\n\t\t\treturn i;\n\t}\n\tusbi_err(ctx, \"bLength overflow by %d bytes\", -size);\n\treturn LIBUSB_ERROR_IO;\n}\n\n/* Return offset to next config */\nstatic int seek_to_next_config(struct libusb_context *ctx,\n\t\tunsigned char *buffer, int size) {\n\tstruct libusb_config_descriptor config;\n\tstruct usb_descriptor_header header;\n\n\tif (size == 0)\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\tif (size < LIBUSB_DT_HEADER_SIZE) {\n\t\tusbi_err(ctx, \"short descriptor read %d/%d\",\n\t\t\tsize, LIBUSB_DT_CONFIG_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\tif (size < LIBUSB_DT_CONFIG_SIZE) {\n\t\tusbi_err(ctx, \"short descriptor read %d/%d\",\n\t\t\tsize, LIBUSB_DT_CONFIG_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tusbi_parse_descriptor(buffer, \"bbwbbbbb\", &config, 0);\n\tif (config.bDescriptorType != LIBUSB_DT_CONFIG) {\n\t\tusbi_err(ctx, \"descriptor is not a config desc (type 0x%02x)\",\n\t\t\tconfig.bDescriptorType);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\t/*\n\t * In usbfs the config descriptors are config.wTotalLength bytes apart,\n\t * with any short reads from the device appearing as holes in the file.\n\t *\n\t * In sysfs wTotalLength is ignored, instead the kernel returns a\n\t * config descriptor with verified bLength fields, with descriptors\n\t * with an invalid bLength removed.\n\t */\n\tif (sysfs_has_descriptors) {\n\t\tint next = seek_to_next_descriptor(ctx, LIBUSB_DT_CONFIG, buffer, size);\n\t\tif (next == LIBUSB_ERROR_NOT_FOUND)\n\t\t\tnext = size;\n\t\tif (next < 0)\n\t\t\treturn next;\n\n\t\tif (next != config.wTotalLength)\n\t\t\tusbi_warn(ctx, \"config length mismatch wTotalLength \"\n\t\t\t\t\"%d real %d\", config.wTotalLength, next);\n\t\treturn next;\n\t} else {\n\t\tif (config.wTotalLength < LIBUSB_DT_CONFIG_SIZE) {\n\t\t\tusbi_err(ctx, \"invalid wTotalLength %d\",\n\t\t\t\tconfig.wTotalLength);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t} else if (config.wTotalLength > size) {\n\t\t\tusbi_warn(ctx, \"short descriptor read %d/%d\",\n\t\t\t\tsize, config.wTotalLength);\n\t\t\treturn size;\n\t\t} else\n\t\t\treturn config.wTotalLength;\n\t}\n}\n\nstatic int op_get_config_descriptor_by_value(struct libusb_device *dev,\n\t\tuint8_t value, unsigned char **buffer, int *host_endian) {\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\tstruct android_device_priv *priv = _device_priv(dev);\n\tunsigned char *descriptors = priv->descriptors;\n\tint size = priv->descriptors_len, r;\n\tstruct libusb_config_descriptor *config;\n\n\t*buffer = NULL;\n\t/* Unlike the device desc. config descs. are always in raw format */\n\t*host_endian = 0;\n\n\t/* Skip device header */\n\tdescriptors += DEVICE_DESC_LENGTH;\n\tsize -= DEVICE_DESC_LENGTH;\n\t// XXX at this point, we skipped device descriptor only and the next one\n\t// will not be a config descriptor. It may be a qualifer descriptor\n\t// or other speed config descriptor on some device.\n\t// Therefor we need to find the first config descriptor.\n\t// FIXME On current implementation, any descriptor other than config descriptor\n\t// are skipped if they placed before config descriptor.\n\tr = seek_to_first_descriptor(ctx, LIBUSB_DT_CONFIG, descriptors, size);\n\tif UNLIKELY(r < 0) {\n\t\tLOGE(\"could not find config descriptor:r=%d\", r);\n\t\treturn r;\n\t}\n\tdescriptors += r;\n\tsize -= r;\n\t/* Seek till the config is found, or till \"EOF\" */\n\tfor (; ;) {\n\t\tregister int next = seek_to_next_config(ctx, descriptors, size);\n\t\tif UNLIKELY(next < 0)\n\t\t\treturn next;\n\t\tconfig = (struct libusb_config_descriptor *) descriptors;\n\t\tif (config->bConfigurationValue == value) {\n\t\t\t*buffer = descriptors;\n\t\t\treturn next;\n\t\t}\n\t\tsize -= next;\n\t\tdescriptors += next;\n\t}\n}\n\nstatic int op_get_active_config_descriptor(struct libusb_device *dev,\n\t\tunsigned char *buffer, size_t len, int *host_endian) {\n\tint r, config;\n\tunsigned char *config_desc;\n\n\tif (sysfs_can_relate_devices) {\n\t\tr = sysfs_get_active_config(dev, &config);\n\t\tif (UNLIKELY(r < 0))\n\t\t\treturn r;\n\t} else {\n\t\t/* Use cached bConfigurationValue */\n\t\tstruct android_device_priv *priv = _device_priv(dev);\n\t\tconfig = priv->active_config;\n\t}\n\tif (config == -1)\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\tr = op_get_config_descriptor_by_value(dev, config, &config_desc,\n\t\t\thost_endian);\n\tif (UNLIKELY(r < 0))\n\t\treturn r;\n\n\tlen = MIN(len, r);\n\tmemcpy(buffer, config_desc, len);\n\treturn len;\n}\n\nstatic int op_get_config_descriptor(struct libusb_device *dev,\n\t\tuint8_t config_index, unsigned char *buffer, size_t len,\n\t\tint *host_endian) {\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\tstruct android_device_priv *priv = _device_priv(dev);\n\tunsigned char *descriptors = priv->descriptors;\n\tint i, r, size = priv->descriptors_len;\n\n\t/* Unlike the device desc. config descs. are always in raw format */\n\t*host_endian = 0;\n\n\t/* Skip device header (device descriptor) */\n\tdescriptors += DEVICE_DESC_LENGTH;\n\tsize -= DEVICE_DESC_LENGTH;\n\t// XXX at this point, we skipped device descriptor only and the next one\n\t// will not be a config descriptor. It may be a qualifer descriptor\n\t// or other speed config descriptor on some device.\n\t// Therefor we need to find the first config descriptor.\n\t// FIXME On current implementation, any descriptor other than config descriptor\n\t// are skipped if they placed before config descriptor.\n\tr = seek_to_first_descriptor(ctx, LIBUSB_DT_CONFIG, descriptors, size);\n\tif UNLIKELY(r < 0) {\n\t\tLOGE(\"could not find config descriptor:r=%d\", r);\n\t\treturn r;\n\t}\n\tdescriptors += r;\n\tsize -= r;\n\t/* Seek till the config is found, or till \"EOF\" */\n\tfor (i = 0; ; i++) {\n\t\tr = seek_to_next_config(ctx, descriptors, size);\n\t\tif (UNLIKELY(r < 0))\t// if error\n\t\t\treturn r;\n\t\tif (i == config_index)\n\t\t\tbreak;\n\t\tsize -= r;\n\t\tdescriptors += r;\n\t}\n\n\tlen = MIN(len, r);\n\tmemcpy(buffer, descriptors, len);\n\treturn len;\n}\n\n/* send a control message to retrieve active configuration */\nstatic int usbfs_get_active_config(struct libusb_device *dev, int fd) {\n\tunsigned char active_config = 0;\n\tint r;\n\n\tstruct usbfs_ctrltransfer ctrl = {\n\t\t.bmRequestType = LIBUSB_ENDPOINT_IN,\n\t\t.bRequest = LIBUSB_REQUEST_GET_CONFIGURATION,\n\t\t.wValue = 0,\n\t\t.wIndex = 0,\n\t\t.wLength = 1,\n\t\t.timeout = 1000,\n\t\t.data = &active_config\n\t};\n\n\tr = ioctl(fd, IOCTL_USBFS_CONTROL, &ctrl);\n\tif (UNLIKELY(r < 0)) {\n\t\tif (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\t/* we hit this error path frequently with buggy devices :( */\n\t\tusbi_warn(DEVICE_CTX(dev),\n\t\t\t\"get_configuration failed ret=%d errno=%d\", r, errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\treturn active_config;\n}\n\nstatic int initialize_device(struct libusb_device *dev, uint8_t busnum,\n\t\tuint8_t devaddr, const char *sysfs_dir) {\n\n\tstruct android_device_priv *priv = _device_priv(dev);\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\tint descriptors_size = 512; /* Begin with a 1024 byte alloc */\n\tint fd, speed;\n\tssize_t r;\n\n\tdev->bus_number = busnum;\n\tdev->device_address = devaddr;\n\n\tif (sysfs_dir) {\n\t\tpriv->sysfs_dir = malloc(strlen(sysfs_dir) + 1);\n\t\tif (!priv->sysfs_dir)\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\tstrcpy(priv->sysfs_dir, sysfs_dir);\n\n\t\t/* Note speed can contain 1.5, in this case __read_sysfs_attr\n\t\t will stop parsing at the '.' and return 1 */\n\t\tspeed = __read_sysfs_attr(DEVICE_CTX(dev), sysfs_dir, \"speed\");\n\t\tif (speed >= 0) {\n\t\t\tswitch (speed) {\n\t\t\tcase    1: dev->speed = LIBUSB_SPEED_LOW;\tbreak;\n\t\t\tcase   12: dev->speed = LIBUSB_SPEED_FULL;\tbreak;\n\t\t\tcase  480: dev->speed = LIBUSB_SPEED_HIGH;\tbreak;\n\t\t\tcase 5000: dev->speed = LIBUSB_SPEED_SUPER;\tbreak;\n\t\t\tdefault:\n\t\t\t\tusbi_warn(DEVICE_CTX(dev), \"Unknown device speed: %d Mbps\", speed);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* cache descriptors in memory */\n\tif (sysfs_has_descriptors) {\n\t\tfd = _open_sysfs_attr(dev, \"descriptors\");\n\t} else {\n\t\tfd = _get_usbfs_fd(dev, O_RDONLY, 0);\n\t}\n\tif (fd < 0)\n\t\treturn fd;\n\n\tdo {\n\t\tdescriptors_size *= 2;\n\t\tpriv->descriptors = usbi_reallocf(priv->descriptors, descriptors_size);\n\t\tif (UNLIKELY(!priv->descriptors)) {\n\t\t\tclose(fd);\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\t}\n\t\t/* usbfs has holes in the file */\n\t\tif (!sysfs_has_descriptors) {\n\t\t\tmemset(priv->descriptors + priv->descriptors_len, 0,\n\t\t\t\t\tdescriptors_size - priv->descriptors_len);\n\t\t}\n\t\tr = read(fd, priv->descriptors + priv->descriptors_len,\n\t\t\t\tdescriptors_size - priv->descriptors_len);\n\t\tif (UNLIKELY(r < 0)) {\n\t\t\tusbi_err(ctx, \"read descriptor failed ret=%d errno=%d\", fd, errno);\n\t\t\tclose(fd);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t}\n\t\tpriv->descriptors_len += r;\n\t} while (priv->descriptors_len == descriptors_size);\n\n\tclose(fd);\n\n\tif (UNLIKELY(priv->descriptors_len < DEVICE_DESC_LENGTH)) {\n\t\tusbi_err(ctx, \"short descriptor read (%d)\", priv->descriptors_len);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tif (sysfs_can_relate_devices)\n\t\treturn LIBUSB_SUCCESS;\n\n\t/* cache active config */\n\tfd = _get_usbfs_fd(dev, O_RDWR, 1);\n\tif (fd < 0) {\t// if could not get fd of usbfs with read/write access\n\t\t/* cannot send a control message to determine the active\n\t\t * config. just assume the first one is active. */\n\t\tusbi_warn(ctx, \"Missing rw usbfs access; cannot determine \"\n\t\t\t\t\"active configuration descriptor\");\n\t\tif (priv->descriptors_len\n\t\t\t\t>= (DEVICE_DESC_LENGTH + LIBUSB_DT_CONFIG_SIZE)) {\n\t\t\tstruct libusb_config_descriptor config;\n\t\t\tusbi_parse_descriptor(priv->descriptors + DEVICE_DESC_LENGTH,\n\t\t\t\t\"bbwbbbbb\", &config, 0);\n\t\t\tpriv->active_config = config.bConfigurationValue;\n\t\t} else\n\t\t\tpriv->active_config = -1; /* No config dt */\n\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\t// if we could get fd of usbfs with read/write access\n\tr = usbfs_get_active_config(dev, fd);\n\tif (r > 0) {\n\t\tpriv->active_config = r;\n\t\tr = LIBUSB_SUCCESS;\n\t} else if (r == 0) {\n\t\t/* some buggy devices have a configuration 0, but we're\n\t\t * reaching into the corner of a corner case here, so let's\n\t\t * not support buggy devices in these circumstances.\n\t\t * stick to the specs: a configuration value of 0 means\n\t\t * unconfigured. */\n\t\tusbi_dbg(\"active cfg 0? assuming unconfigured device\");\n\t\tpriv->active_config = -1;\n\t\tr = LIBUSB_SUCCESS;\n\t} else if (r == LIBUSB_ERROR_IO) {\n\t\t/* buggy devices sometimes fail to report their active config.\n\t\t * assume unconfigured and continue the probing */\n\t\tusbi_warn(ctx, \"couldn't query active configuration, assuming\"\n\t\t\t\t\t\" unconfigured\");\n\t\tpriv->active_config = -1;\n\t\tr = LIBUSB_SUCCESS;\n\t} /* else r < 0, just return the error code */\n\n\tclose(fd);\n\treturn r;\n}\n\nstatic int android_get_parent_info(struct libusb_device *dev,\n\t\tconst char *sysfs_dir) {\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\tstruct libusb_device *it;\n\tchar *parent_sysfs_dir, *tmp;\n\tint ret, add_parent = 1;\n\n\t/* XXX -- can we figure out the topology when using usbfs? */\n\tif (NULL == sysfs_dir || 0 == strncmp(sysfs_dir, \"usb\", 3)) {\n\t\t/* either using usbfs or finding the parent of a root hub */\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\tparent_sysfs_dir = strdup(sysfs_dir);\n\tif (NULL != (tmp = strrchr(parent_sysfs_dir, '.')) ||\n\tNULL != (tmp = strrchr(parent_sysfs_dir, '-'))) {\n\t\tdev->port_number = atoi(tmp + 1);\n\t\t*tmp = '\\0';\n\t} else {\n\t\tusbi_warn(ctx, \"Can not parse sysfs_dir: %s, no parent info\",\n\t\t\tparent_sysfs_dir);\n\t\tfree(parent_sysfs_dir);\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\t/* is the parent a root hub? */\n\tif (NULL == strchr(parent_sysfs_dir, '-')) {\n\t\ttmp = parent_sysfs_dir;\n\t\tret = asprintf(&parent_sysfs_dir, \"usb%s\", tmp);\n\t\tfree(tmp);\n\t\tif (0 > ret) {\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\t}\n\t}\n\nretry:\n\t/* find the parent in the context */\n\tusbi_mutex_lock(&ctx->usb_devs_lock);\n\tlist_for_each_entry(it, &ctx->usb_devs, list, struct libusb_device)\n\t{\n\t\tstruct android_device_priv *priv = _device_priv(it);\n\t\tif (0 == strcmp(priv->sysfs_dir, parent_sysfs_dir)) {\n\t\t\tdev->parent_dev = libusb_ref_device(it);\n\t\t\tbreak;\n\t\t}\n\t}\n\tusbi_mutex_unlock(&ctx->usb_devs_lock);\n\n\tif (!dev->parent_dev && add_parent) {\n\t\tusbi_dbg(\"parent_dev %s not enumerated yet, enumerating now\",\n\t\t\tparent_sysfs_dir);\n\t\tsysfs_scan_device(ctx, parent_sysfs_dir);\n\t\tadd_parent = 0;\n\t\tgoto retry;\n\t}\n\n\tusbi_dbg(\"Dev %p (%s) has parent %p (%s) port %d\", dev, sysfs_dir,\n\t\tdev->parent_dev, parent_sysfs_dir, dev->port_number);\n\n\tfree(parent_sysfs_dir);\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int android_initialize_device(struct libusb_device *dev,\n\tuint8_t busnum, uint8_t devaddr, int fd) {\n\n\tENTER();\n\n\tstruct android_device_priv *priv = _device_priv(dev);\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\tuint8_t desc[4096]; // max descriptor size is 4096 bytes\n\tint speed;\n\tssize_t r;\n\n\tdev->bus_number = busnum;\n\tdev->device_address = devaddr;\n\n\tLOGD(\"cache descriptors in memory\");\n\n\tpriv->descriptors_len = 0;\n\tpriv->fd = 0;\n\tmemset(desc, 0, sizeof(desc));\n    if (!lseek(fd, 0, SEEK_SET)) {\n        // ディスクリプタを読み込んでローカルキャッシュする\n        int length = read(fd, desc, sizeof(desc));\n        LOGD(\"Device::init read returned %d errno %d\\n\", length, errno);\n\t\tif (length > 0) {\n\t\t\tpriv->fd = fd;\n\t\t\tpriv->descriptors = usbi_reallocf(priv->descriptors, length);\n\t\t\tif (UNLIKELY(!priv->descriptors)) {\n\t\t\t\tRETURN(LIBUSB_ERROR_NO_MEM, int);\n\t\t\t}\n\t\t\tpriv->descriptors_len = length;\n\t\t\tmemcpy(priv->descriptors, desc, length);\n\t\t}\n\t}\n\n\tif (UNLIKELY(priv->descriptors_len < DEVICE_DESC_LENGTH)) {\n\t\tusbi_err(ctx, \"short descriptor read (%d)\", priv->descriptors_len);\n\t\tLOGE(\"short descriptor read (%d)\", priv->descriptors_len);\n\t\tRETURN(LIBUSB_ERROR_IO, int);\n\t}\n\n\tif (fd < 0) {\t// if could not get fd of usbfs with read/write access\n\t\t/* cannot send a control message to determine the active\n\t\t * config. just assume the first one is active. */\n\t\tusbi_warn(ctx, \"Missing rw usbfs access; cannot determine \"\n\t\t\t\t\"active configuration descriptor\");\n\t\tif (priv->descriptors_len\n\t\t\t\t>= (DEVICE_DESC_LENGTH + LIBUSB_DT_CONFIG_SIZE)) {\n\t\t\tstruct libusb_config_descriptor config;\n\t\t\tusbi_parse_descriptor(priv->descriptors + DEVICE_DESC_LENGTH,\n\t\t\t\t\"bbwbbbbb\", &config, 0);\n\t\t\tpriv->active_config = config.bConfigurationValue;\n\t\t} else\n\t\t\tpriv->active_config = -1; /* No config dt */\n\n\t\tRETURN(LIBUSB_SUCCESS, int);\n\t}\n\t// if we could get fd of usbfs with read/write access\n\tr = usbfs_get_active_config(dev, fd);\n\tif (r > 0) {\n\t\tpriv->active_config = r;\n\t\tr = LIBUSB_SUCCESS;\n\t} else if (r == 0) {\n\t\t/* some buggy devices have a configuration 0, but we're\n\t\t * reaching into the corner of a corner case here, so let's\n\t\t * not support buggy devices in these circumstances.\n\t\t * stick to the specs: a configuration value of 0 means\n\t\t * unconfigured. */\n\t\tusbi_dbg(\"active cfg 0? assuming unconfigured device\");\n\t\tpriv->active_config = -1;\n\t\tr = LIBUSB_SUCCESS;\n\t} else if (r == LIBUSB_ERROR_IO) {\n\t\t/* buggy devices sometimes fail to report their active config.\n\t\t * assume unconfigured and continue the probing */\n\t\tusbi_warn(ctx, \"couldn't query active configuration, assuming\"\n\t\t\t\t\t\" unconfigured\");\n\t\tpriv->active_config = -1;\n\t\tr = LIBUSB_SUCCESS;\n\t} /* else r < 0, just return the error code */\n\n\tRETURN(r, int);\n}\n\nint android_generate_device(struct libusb_context *ctx, struct libusb_device **dev,\n\tint vid, int pid, const char *serial, int fd, int busnum, int devaddr) {\n\n\tENTER();\n\n\tunsigned long session_id;\n\tint r = 0;\n\n\t*dev = NULL;\n \t/* FIXME: session ID is not guaranteed unique as addresses can wrap and\n \t * will be reused. instead we should add a simple sysfs attribute with\n \t * a session ID. */\n\tsession_id = busnum << 8 | devaddr;\n \tLOGD(\"allocating new device for %d/%d (session %ld)\", busnum, devaddr, session_id);\n \t*dev = usbi_alloc_device(ctx, session_id);\t// この時点で参照カウンタ=1\n \tif (UNLIKELY(!dev)) {\n \t\tRETURN(LIBUSB_ERROR_NO_MEM, int);\n \t}\n\n \tr = android_initialize_device(*dev, busnum, devaddr, fd);\n \tif (UNLIKELY(r < 0)) {\n \t\tLOGE(\"initialize_device failed: ret=%d\", r);\n \t\tgoto out;\n \t}\n \tr = usbi_sanitize_device(*dev);\n \tif (UNLIKELY(r < 0)) {\n \t\tLOGE(\"usbi_sanitize_device failed: ret=%d\", r);\n \t\tgoto out;\n \t}\n\nout:\n \tif (UNLIKELY(r < 0)) {\n \t\tlibusb_unref_device(*dev);\t// ここで参照カウンタが0になって破棄される\n \t\t*dev = NULL;\n \t} else {\n \t\tusbi_connect_device(*dev);\n \t}\n\n \tRETURN(r, int);\n}\n\n\nint android_enumerate_device(struct libusb_context *ctx, uint8_t busnum,\n\t\tuint8_t devaddr, const char *sysfs_dir) {\n\n\tunsigned long session_id;\n\tstruct libusb_device *dev;\n\tint r = 0;\n\n\t/* FIXME: session ID is not guaranteed unique as addresses can wrap and\n\t * will be reused. instead we should add a simple sysfs attribute with\n\t * a session ID. */\n\tsession_id = busnum << 8 | devaddr;\n\tusbi_dbg(\"busnum %d devaddr %d session_id %ld\",\n\t\tbusnum, devaddr, session_id);\n\n\tdev = usbi_get_device_by_session_id(ctx, session_id);\n\tif (dev) {\n\t\t/* device already exists in the context */\n\t\tusbi_dbg(\"session_id %ld already exists\", session_id);\n\t\tlibusb_unref_device(dev);\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\tusbi_dbg(\"allocating new device for %d/%d (session %ld)\",\n\t\tbusnum, devaddr, session_id);\n\tdev = usbi_alloc_device(ctx, session_id);\n\tif (UNLIKELY(!dev))\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tr = initialize_device(dev, busnum, devaddr, sysfs_dir);\n\tif (UNLIKELY(r < 0))\n\t\tgoto out;\n\tr = usbi_sanitize_device(dev);\n\tif (UNLIKELY(r < 0))\n\t\tgoto out;\n\n\tr = android_get_parent_info(dev, sysfs_dir);\n\tif (UNLIKELY(r < 0))\n\t\tgoto out;\nout:\n\tif (UNLIKELY(r < 0))\n\t\tlibusb_unref_device(dev);\n\telse\n\t\tusbi_connect_device(dev);\n\n\treturn r;\n}\n\nvoid android_hotplug_enumerate(uint8_t busnum, uint8_t devaddr,\n\t\tconst char *sys_name) {\n\tstruct libusb_context *ctx;\n\n\tusbi_mutex_static_lock(&active_contexts_lock);\n\tlist_for_each_entry(ctx, &active_contexts_list, list, struct libusb_context)\n\t{\n\t\tandroid_enumerate_device(ctx, busnum, devaddr, sys_name);\n\t}\n\tusbi_mutex_static_unlock(&active_contexts_lock);\n}\n\nvoid android_device_disconnected(uint8_t busnum, uint8_t devaddr,\n\t\tconst char *sys_name) {\n\tstruct libusb_context *ctx;\n\tstruct libusb_device *dev;\n\tunsigned long session_id = busnum << 8 | devaddr;\n\n\tusbi_mutex_static_lock(&active_contexts_lock);\n\tlist_for_each_entry(ctx, &active_contexts_list, list, struct libusb_context)\n\t{\n\t\tdev = usbi_get_device_by_session_id(ctx, session_id);\n\t\tif (NULL != dev) {\n\t\t\tusbi_disconnect_device(dev);\n\t\t\tlibusb_unref_device(dev);\n\t\t} else {\n\t\t\tusbi_dbg(\"device not found for session %x\", session_id);\n\t\t}\n\t}\n\tusbi_mutex_static_unlock(&active_contexts_lock);\n}\n\n#if !defined(USE_UDEV)\n/* open a bus directory and adds all discovered devices to the context */\nstatic int usbfs_scan_busdir(struct libusb_context *ctx, uint8_t busnum) {\n\tDIR *dir;\n\tchar dirpath[PATH_MAX];\n\tstruct dirent *entry;\n\tint r = LIBUSB_ERROR_IO;\n\n\tsnprintf(dirpath, PATH_MAX, \"%s/%03d\", usbfs_path, busnum);\n\tusbi_dbg(\"%s\", dirpath);\n\tdir = opendir(dirpath);\n\tif (UNLIKELY(!dir)) {\n\t\tusbi_err(ctx, \"opendir '%s' failed, errno=%d\", dirpath, errno);\n\t\t/* FIXME: should handle valid race conditions like hub unplugged\n\t\t * during directory iteration - this is not an error */\n\t\treturn r;\n\t}\n\n\twhile ((entry = readdir(dir))) {\n\t\tint devaddr;\n\n\t\tif (entry->d_name[0] == '.')\n\t\t\tcontinue;\n\n\t\tdevaddr = atoi(entry->d_name);\n\t\tif (devaddr == 0) {\n\t\t\tusbi_dbg(\"unknown dir entry %s\", entry->d_name);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (android_enumerate_device(ctx, busnum, (uint8_t) devaddr, NULL)) {\n\t\t\tusbi_dbg(\"failed to enumerate dir entry %s\", entry->d_name);\n\t\t\tcontinue;\n\t\t}\n\n\t\tr = 0;\n\t}\n\n\tclosedir(dir);\n\treturn r;\n}\n\nstatic int usbfs_get_device_list(struct libusb_context *ctx) {\n\tstruct dirent *entry;\n\tDIR *buses = opendir(usbfs_path);\n\tint r = 0;\n\n\tif (!buses) {\n\t\tusbi_err(ctx, \"opendir buses failed errno=%d\", errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\twhile ((entry = readdir(buses))) {\n\t\tint busnum;\n\n\t\tif (entry->d_name[0] == '.')\n\t\t\tcontinue;\n\n\t\tif (usbdev_names) {\n\t\t\tint devaddr;\n\t\t\tif (!_is_usbdev_entry(entry, &busnum, &devaddr))\n\t\t\t\tcontinue;\n\n\t\t\tr = android_enumerate_device(ctx, busnum, (uint8_t) devaddr, NULL);\n\t\t\tif (UNLIKELY(r < 0)) {\n\t\t\t\tusbi_dbg(\"failed to enumerate dir entry %s\", entry->d_name);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t} else {\n\t\t\tbusnum = atoi(entry->d_name);\n\t\t\tif (UNLIKELY(busnum == 0)) {\n\t\t\t\tusbi_dbg(\"unknown dir entry %s\", entry->d_name);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tr = usbfs_scan_busdir(ctx, busnum);\n\t\t\tif (UNLIKELY(r < 0))\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tclosedir(buses);\n\treturn r;\n\n}\n#endif\n\nstatic int sysfs_scan_device(struct libusb_context *ctx, const char *devname) {\n\tuint8_t busnum, devaddr;\n\tint ret;\n\n\tret = android_get_device_address(ctx, 0, &busnum, &devaddr, NULL, devname);\n\tif (UNLIKELY(LIBUSB_SUCCESS != ret)) {\n\t\treturn ret;\n\t}\n\n\treturn android_enumerate_device(ctx, busnum & 0xff, devaddr & 0xff, devname);\n}\n\n#if !defined(USE_UDEV)\nstatic int sysfs_get_device_list(struct libusb_context *ctx) {\n\tDIR *devices = opendir(SYSFS_DEVICE_PATH);\n\tstruct dirent *entry;\n\tint r = LIBUSB_ERROR_IO;\n\n\tif (UNLIKELY(!devices)) {\n\t\tusbi_err(ctx, \"opendir devices failed errno=%d\", errno);\n\t\treturn r;\n\t}\n\n\twhile ((entry = readdir(devices))) {\n\t\tif ((!isdigit(entry->d_name[0]) && strncmp(entry->d_name, \"usb\", 3))\n\t\t\t\t|| strchr(entry->d_name, ':'))\n\t\t\tcontinue;\n\n\t\tif (sysfs_scan_device(ctx, entry->d_name)) {\n\t\t\tusbi_dbg(\"failed to enumerate dir entry %s\", entry->d_name);\n\t\t\tcontinue;\n\t\t}\n\n\t\tr = 0;\n\t}\n\n\tclosedir(devices);\n\treturn r;\n}\n\nstatic int android_default_scan_devices(struct libusb_context *ctx) {\n\t/* we can retrieve device list and descriptors from sysfs or usbfs.\n\t * sysfs is preferable, because if we use usbfs we end up resuming\n\t * any autosuspended USB devices. however, sysfs is not available\n\t * everywhere, so we need a usbfs fallback too.\n\t *\n\t * as described in the \"sysfs vs usbfs\" comment at the top of this\n\t * file, sometimes we have sysfs but not enough information to\n\t * relate sysfs devices to usbfs nodes.  op_init() determines the\n\t * adequacy of sysfs and sets sysfs_can_relate_devices.\n\t */\n\tif (sysfs_can_relate_devices != 0)\n\t\treturn sysfs_get_device_list(ctx);\n\telse\n\t\treturn usbfs_get_device_list(ctx);\n}\n#endif\n\n// this function is mainly for Android\n// because native code can not open USB device on Android when without root\n// so we need to defer real open/close operation to Java code\nstatic int op_set_device_fd(struct libusb_device *device, int fd) {\n\tstruct android_device_priv *dpriv = _device_priv(device);\n\tdpriv->fd = fd;\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int op_open(struct libusb_device_handle *handle) {\n\tstruct android_device_handle_priv *hpriv = _device_handle_priv(handle);\n\tint r;\n\n\thpriv->fd = _get_usbfs_fd(handle->dev, O_RDWR, 0);\n\tif (hpriv->fd < 0) {\n\t\tif (hpriv->fd == LIBUSB_ERROR_NO_DEVICE) {\n\t\t\t/* device will still be marked as attached if hotplug monitor thread\n\t\t\t * hasn't processed remove event yet */\n\t\t\tusbi_mutex_static_lock(&android_hotplug_lock);\n\t\t\tif (handle->dev->attached) {\n\t\t\t\tusbi_dbg(\"open failed with no device, but device still attached\");\n\t\t\t\tandroid_device_disconnected(handle->dev->bus_number,\n\t\t\t\t\t\thandle->dev->device_address, NULL);\n\t\t\t}\n\t\t\tusbi_mutex_static_unlock(&android_hotplug_lock);\n\t\t}\n\t\treturn hpriv->fd;\n\t}\n\n\tr = ioctl(hpriv->fd, IOCTL_USBFS_GET_CAPABILITIES, &hpriv->caps);\n\tif (UNLIKELY(r < 0)) {\n\t\tif (errno == ENOTTY)\n\t\t\tusbi_dbg(\"getcap not available\");\n\t\telse\n\t\t\tusbi_err(HANDLE_CTX(handle), \"getcap failed (%d)\", errno);\n\t\thpriv->caps = 0;\n\t\tif (supports_flag_zero_packet)\n\t\t\thpriv->caps |= USBFS_CAP_ZERO_PACKET;\n\t\tif (supports_flag_bulk_continuation)\n\t\t\thpriv->caps |= USBFS_CAP_BULK_CONTINUATION;\n\t}\n\n\treturn usbi_add_pollfd(HANDLE_CTX(handle), hpriv->fd, POLLOUT);\n}\n\nstatic void op_close(struct libusb_device_handle *dev_handle) {\n\tint fd = _device_handle_priv(dev_handle)->fd;\n\tusbi_remove_pollfd(HANDLE_CTX(dev_handle), fd);\n#ifndef __ANDROID__\n\t// We can not (re)open USB device in the native code on no-rooted Android devices\n\t// so keep open and defer real open/close operation on Java side\n\tclose(fd);\n#endif\n}\n\nstatic int op_get_configuration(struct libusb_device_handle *handle,\n\t\tint *config) {\n\tint r;\n\n\tif (sysfs_can_relate_devices) {\n\t\tr = sysfs_get_active_config(handle->dev, config);\n\t} else {\n\t\tr = usbfs_get_active_config(handle->dev,\n\t\t\t\t_device_handle_priv(handle)->fd);\n\t}\n\tif (UNLIKELY(r < 0))\n\t\treturn r;\n\n\tif (*config == -1) {\n\t\tusbi_err(HANDLE_CTX(handle), \"device unconfigured\");\n\t\t*config = 0;\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int op_set_configuration(struct libusb_device_handle *handle, int config) {\n\tstruct android_device_priv *priv = _device_priv(handle->dev);\n\tconst int fd = _device_handle_priv(handle)->fd;\n\tint r = ioctl(fd, IOCTL_USBFS_SETCONFIG, &config);\n\tif (UNLIKELY(r)) {\n\t\tif (errno == EINVAL) {\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\t} else if (errno == EBUSY) {\n\t\t\treturn LIBUSB_ERROR_BUSY;\n\t\t} else if (errno == ENODEV) {\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t\t}\n\t\tusbi_err(HANDLE_CTX(handle), \"failed, error %d errno %d\", r, errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\t/* update our cached active config descriptor */\n\tpriv->active_config = config;\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int claim_interface(struct libusb_device_handle *handle, int iface) {\n\n\tENTER();\n\n\tconst int fd = _device_handle_priv(handle)->fd;\n\tLOGD(\"interface=%d, fd=%d\", iface, fd);\n\n\tint r = ioctl(fd, IOCTL_USBFS_CLAIMINTF, &iface);\n\tif (UNLIKELY(r)) {\n\t\tif (errno == ENOENT) {\n\t\t\tRETURN(LIBUSB_ERROR_NOT_FOUND, int);\n\t\t} else if (errno == EBUSY) {\n\t\t\tRETURN(LIBUSB_ERROR_BUSY, int);\n\t\t} else if (errno == ENODEV) {\n\t\t\tRETURN(LIBUSB_ERROR_NO_DEVICE, int);\n\t}\n\t\tLOGE(\"claim interface failed, error %d errno %d\", r, errno);\n\t\tRETURN(LIBUSB_ERROR_OTHER, int);\n\t}\n\n\tRETURN(LIBUSB_SUCCESS, int);\n}\n\nstatic int release_interface(struct libusb_device_handle *handle, int iface) {\n\n\tENTER();\n\n\tconst int fd = _device_handle_priv(handle)->fd;\n\tLOGD(\"interface=%d, fd=%d\", iface, fd);\n\n\tint r = ioctl(fd, IOCTL_USBFS_RELEASEINTF, &iface);\n\tif (UNLIKELY(r)) {\n\t\tif (errno == ENODEV) {\n\t\t\tRETURN(LIBUSB_ERROR_NO_DEVICE, int);\n\t}\n\t\tLOGE(\"release interface failed, error %d errno %d\", r, errno);\n\t\tRETURN(LIBUSB_ERROR_OTHER, int);\n\t}\n\n\tRETURN(LIBUSB_SUCCESS, int);\n}\n\nstatic int op_set_interface(struct libusb_device_handle *handle, int iface, int altsetting) {\n\n\tENTER();\n\n\tconst int fd = _device_handle_priv(handle)->fd;\n\tstruct usbfs_setinterface setintf;\n\tint r;\n\n\tsetintf.interface = iface;\n\tsetintf.altsetting = altsetting;\n\tr = ioctl(fd, IOCTL_USBFS_SETINTF, &setintf);\n\tif (UNLIKELY(r)) {\n\t\tif (errno == EINVAL) {\n\t\t\tRETURN(LIBUSB_ERROR_NOT_FOUND, int);\n\t\t} else if (errno == ENODEV) {\n\t\t\tRETURN(LIBUSB_ERROR_NO_DEVICE, int);\n\t\t}\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"setintf failed error %d errno %d\", r, errno);\n\t\tRETURN(LIBUSB_ERROR_OTHER, int);\n\t}\n\n\tRETURN(LIBUSB_SUCCESS, int);\n}\n\nstatic int op_clear_halt(struct libusb_device_handle *handle,\n\t\tunsigned char endpoint) {\n\tconst int fd = _device_handle_priv(handle)->fd;\n\tunsigned int _endpoint = endpoint;\n\tint r = ioctl(fd, IOCTL_USBFS_CLEAR_HALT, &_endpoint);\n\tif (UNLIKELY(r)) {\n\t\tif (errno == ENOENT)\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\telse if (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"clear_halt failed error %d errno %d\", r, errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int op_reset_device(struct libusb_device_handle *handle) {\n\tconst int fd = _device_handle_priv(handle)->fd;\n\tint i, r, ret = 0;\n\n\t/* Doing a device reset will cause the usbfs driver to get unbound\n\t   from any interfaces it is bound to. By voluntarily unbinding\n\t   the usbfs driver ourself, we stop the kernel from rebinding\n\t   the interface after reset (which would end up with the interface\n\t   getting bound to the in kernel driver if any). */\n\tfor (i = 0; i < USB_MAXINTERFACES; i++) {\n\t\tif (handle->claimed_interfaces & (1L << i)) {\n\t\t\trelease_interface(handle, i);\n\t\t}\n\t}\n\n\tusbi_mutex_lock(&handle->lock);\n\tr = ioctl(fd, IOCTL_USBFS_RESET, NULL);\n\tif (UNLIKELY(r)) {\n\t\tif (errno == ENODEV) {\n\t\t\tret = LIBUSB_ERROR_NOT_FOUND;\n\t\t\tgoto out;\n\t\t}\n\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"reset failed error %d errno %d\", r, errno);\n\t\tret = LIBUSB_ERROR_OTHER;\n\t\tgoto out;\n\t}\n\n\t/* And re-claim any interfaces which were claimed before the reset */\n\tfor (i = 0; i < USB_MAXINTERFACES; i++) {\n\t\tif (handle->claimed_interfaces & (1L << i)) {\n\t\t\t/*\n\t\t\t * A driver may have completed modprobing during\n\t\t\t * IOCTL_USBFS_RESET, and bound itself as soon as\n\t\t\t * IOCTL_USBFS_RESET released the device lock\n\t\t\t */\n\t\t\tr = detach_kernel_driver_and_claim(handle, i);\n\t\t\tif (UNLIKELY(r)) {\n\t\t\t\tusbi_warn(HANDLE_CTX(handle),\n\t\t\t\t\t\"failed to re-claim interface %d after reset: %s\",\n\t\t\t\t\ti, libusb_error_name(r));\n\t\t\t\thandle->claimed_interfaces &= ~(1L << i);\n\t\t\t\tret = LIBUSB_ERROR_NOT_FOUND;\n\t\t\t}\n\t\t}\n\t}\nout:\n\tusbi_mutex_unlock(&handle->lock);\n\treturn ret;\n}\n\nstatic int do_streams_ioctl(struct libusb_device_handle *handle, long req,\n\tuint32_t num_streams, unsigned char *endpoints, int num_endpoints) {\n\tconst int fd = _device_handle_priv(handle)->fd;\n\tint r;\n\tstruct usbfs_streams *streams;\n\n\tif (num_endpoints > 30) /* Max 15 in + 15 out eps */\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\tstreams = malloc(sizeof(struct usbfs_streams) + num_endpoints);\n\tif (!streams)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tstreams->num_streams = num_streams;\n\tstreams->num_eps = num_endpoints;\n\tmemcpy(streams->eps, endpoints, num_endpoints);\n\n\tr = ioctl(fd, req, streams);\n\n\tfree(streams);\n\n\tif (r < 0) {\n\t\tif (errno == ENOTTY)\n\t\t\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n\t\telse if (errno == EINVAL)\n\t\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t\telse if (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"streams-ioctl failed error %d errno %d\", r, errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\treturn r;\n}\n\nstatic int op_alloc_streams(struct libusb_device_handle *handle,\n\tuint32_t num_streams, unsigned char *endpoints, int num_endpoints)\n{\n\treturn do_streams_ioctl(handle, IOCTL_USBFS_ALLOC_STREAMS,\n\t\t\t\tnum_streams, endpoints, num_endpoints);\n}\n\nstatic int op_free_streams(struct libusb_device_handle *handle,\n\t\tunsigned char *endpoints, int num_endpoints)\n{\n\treturn do_streams_ioctl(handle, IOCTL_USBFS_FREE_STREAMS, 0,\n\t\t\t\tendpoints, num_endpoints);\n}\n\nstatic int op_kernel_driver_active(struct libusb_device_handle *handle, int interface) {\n\tconst int fd = _device_handle_priv(handle)->fd;\n\tstruct usbfs_getdriver getdrv;\n\tint r;\n\n\tgetdrv.interface = interface;\n\tr = ioctl(fd, IOCTL_USBFS_GETDRIVER, &getdrv);\n\tif (UNLIKELY(r)) {\n\t\tif (errno == ENODATA)\n\t\t\treturn LIBUSB_SUCCESS;\n\t\telse if (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"get driver failed error %d errno %d\", r, errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\treturn (strcmp(getdrv.driver, \"usbfs\") == 0) ? 0 : 1;\n}\n\nstatic int op_detach_kernel_driver(struct libusb_device_handle *handle, int interface) {\n\tconst int fd = _device_handle_priv(handle)->fd;\n\tstruct usbfs_ioctl command;\n\tstruct usbfs_getdriver getdrv;\n\tint r;\n\n\tcommand.ifno = interface;\n\tcommand.ioctl_code = IOCTL_USBFS_DISCONNECT;\n\tcommand.data = NULL;\n\n\tgetdrv.interface = interface;\n\tr = ioctl(fd, IOCTL_USBFS_GETDRIVER, &getdrv);\n\tif (r == 0 && strcmp(getdrv.driver, \"usbfs\") == 0)\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\tr = ioctl(fd, IOCTL_USBFS_IOCTL, &command);\n\tif (UNLIKELY(r)) {\n\t\tif (errno == ENODATA)\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\telse if (errno == EINVAL)\n\t\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t\telse if (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"detach failed error %d errno %d\", r, errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int op_attach_kernel_driver(struct libusb_device_handle *handle, int interface) {\n\tconst int fd = _device_handle_priv(handle)->fd;\n\tstruct usbfs_ioctl command;\n\tint r;\n\n\tcommand.ifno = interface;\n\tcommand.ioctl_code = IOCTL_USBFS_CONNECT;\n\tcommand.data = NULL;\n\n\tr = ioctl(fd, IOCTL_USBFS_IOCTL, &command);\n\tif (UNLIKELY(r < 0)) {\n\t\tif (errno == ENODATA)\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\telse if (errno == EINVAL)\n\t\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t\telse if (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t\telse if (errno == EBUSY)\n\t\t\treturn LIBUSB_ERROR_BUSY;\n\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"attach failed error %d errno %d\", r, errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t} else if (UNLIKELY(r == 0)) {\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int detach_kernel_driver_and_claim(struct libusb_device_handle *handle, int interface) {\n\n\tENTER();\n\n\tconst int fd = _device_handle_priv(handle)->fd;\n\tstruct usbfs_disconnect_claim dc;\n\tint r;\n\n\tdc.interface = interface;\n\tstrcpy(dc.driver, \"usbfs\");\n\tdc.flags = USBFS_DISCONNECT_CLAIM_EXCEPT_DRIVER;\n\tr = ioctl(fd, IOCTL_USBFS_DISCONNECT_CLAIM, &dc);\n\tif (r == 0 || (r != 0 && errno != ENOTTY)) {\n\t\tif (r == 0) {\n\t\t\tRETURN(LIBUSB_SUCCESS, int);\n\t\t}\n\n\t\tswitch (errno) {\n\t\tcase EBUSY:\n\t\t\tRETURN(LIBUSB_ERROR_BUSY, int);\n\t\tcase EINVAL:\n\t\t\tRETURN(LIBUSB_ERROR_INVALID_PARAM, int);\n\t\tcase ENODEV:\n\t\t\tRETURN(LIBUSB_ERROR_NO_DEVICE, int);\n\t\t}\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"disconnect-and-claim failed errno %d\", errno);\n\t\tRETURN(LIBUSB_ERROR_OTHER, int);\n\t}\n\n\t/* Fallback code for kernels which don't support the\n\t   disconnect-and-claim ioctl */\n\tr = op_detach_kernel_driver(handle, interface);\n\tif (r != 0 && r != LIBUSB_ERROR_NOT_FOUND) {\n\t\tRETURN(r, int);\n\t}\n\n\tr = claim_interface(handle, interface);\n\tRETURN(r, int);\n}\n\nstatic int op_claim_interface(struct libusb_device_handle *handle, int iface) {\n\tif (handle->auto_detach_kernel_driver)\n\t\treturn detach_kernel_driver_and_claim(handle, iface);\n\telse\n\t\treturn claim_interface(handle, iface);\n}\n\nstatic int op_release_interface(struct libusb_device_handle *handle, int iface) {\n\tint r;\n\n\tr = release_interface(handle, iface);\n\tif (UNLIKELY(r))\n\t\treturn r;\n\n\tif (handle->auto_detach_kernel_driver)\n\t\top_attach_kernel_driver(handle, iface);\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic void op_destroy_device(struct libusb_device *dev) {\n\tstruct android_device_priv *priv = _device_priv(dev);\n\tif (priv->descriptors)\n\t\tfree(priv->descriptors);\n\tif (priv->sysfs_dir)\n\t\tfree(priv->sysfs_dir);\n}\n\n/* URBs are discarded in reverse order of submission to avoid races. */\nstatic int discard_urbs(struct usbi_transfer *itransfer, int first, int last_plus_one) {\n\tENTER();\n\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct android_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\tstruct android_device_handle_priv *dpriv = _device_handle_priv(transfer->dev_handle);\n\tint i, ret = 0;\n\tstruct usbfs_urb *urb;\n\n\tfor (i = last_plus_one - 1; i >= first; i--) {\n\t\tif (LIBUSB_TRANSFER_TYPE_ISOCHRONOUS == transfer->type)\n\t\t\turb = tpriv->iso_urbs[i];\n\t\telse\n\t\t\turb = &tpriv->urbs[i];\n\n\t\t// XXX this function call may always fail on non-rooted Android devices with errno=22(EINVAL)...\n\t\tif (0 == ioctl(dpriv->fd, IOCTL_USBFS_DISCARDURB, urb))\n\t\t\tcontinue;\n\n\t\tif (EINVAL == errno) {\n\t\t\tusbi_dbg(\"URB not found --> assuming ready to be reaped\");\n\t\t\tif (i == (last_plus_one - 1))\n\t\t\t\tret = LIBUSB_ERROR_NOT_FOUND;\n\t\t} else if (ENODEV == errno) {\n\t\t\tusbi_dbg(\"Device not found for URB --> assuming ready to be reaped\");\n\t\t\tret = LIBUSB_ERROR_NO_DEVICE;\n\t\t} else {\n\t\t\tusbi_warn(TRANSFER_CTX(transfer),\n\t\t\t\t\"unrecognised discard errno %d\", errno);\n\t\t\tret = LIBUSB_ERROR_OTHER;\n\t\t}\n\t}\n\tRETURN(ret, int);\n}\n\nstatic void free_iso_urbs(struct android_transfer_priv *tpriv) {\n\tint i;\n\tfor (i = 0; i < tpriv->num_urbs; i++) {\n\t\tstruct usbfs_urb *urb = tpriv->iso_urbs[i];\n\t\tif (UNLIKELY(!urb))\n\t\t\tbreak;\n\t\tfree(urb);\n\t}\n\n\tfree(tpriv->iso_urbs);\n\ttpriv->iso_urbs = NULL;\n}\n\nstatic int submit_bulk_transfer(struct usbi_transfer *itransfer) {\n\n\tstruct libusb_transfer *transfer\n\t\t= USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct android_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\tstruct android_device_handle_priv *dpriv\n\t\t= _device_handle_priv(transfer->dev_handle);\n\tstruct usbfs_urb *urbs;\n\tint is_out = (transfer->endpoint & LIBUSB_ENDPOINT_DIR_MASK)\n\t\t== LIBUSB_ENDPOINT_OUT;\n\tint bulk_buffer_len, use_bulk_continuation;\n\tint r;\n\tint i;\n\tsize_t alloc_size;\n\n\tif (UNLIKELY(tpriv->urbs))\n\t\treturn LIBUSB_ERROR_BUSY;\n\n\tif (UNLIKELY(is_out && (transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET))\n\t\t\t&& !(dpriv->caps & USBFS_CAP_ZERO_PACKET))\n\t\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n\n\t/*\n\t * Older versions of usbfs place a 16kb limit on bulk URBs. We work\n\t * around this by splitting large transfers into 16k blocks, and then\n\t * submit all urbs at once. it would be simpler to submit one urb at\n\t * a time, but there is a big performance gain doing it this way.\n\t *\n\t * Newer versions lift the 16k limit (USBFS_CAP_NO_PACKET_SIZE_LIM),\n\t * using arbritary large transfers can still be a bad idea though, as\n\t * the kernel needs to allocate physical contiguous memory for this,\n\t * which may fail for large buffers.\n\t *\n\t * The kernel solves this problem by splitting the transfer into\n\t * blocks itself when the host-controller is scatter-gather capable\n\t * (USBFS_CAP_BULK_SCATTER_GATHER), which most controllers are.\n\t *\n\t * Last, there is the issue of short-transfers when splitting, for\n\t * short split-transfers to work reliable USBFS_CAP_BULK_CONTINUATION\n\t * is needed, but this is not always available.\n\t */\n\tif (dpriv->caps & USBFS_CAP_BULK_SCATTER_GATHER) {\n\t\t/* Good! Just submit everything in one go */\n\t\tbulk_buffer_len = transfer->length ? transfer->length : 1;\n\t\tuse_bulk_continuation = 0;\n\t} else if (dpriv->caps & USBFS_CAP_BULK_CONTINUATION) {\n\t\t/* Split the transfers and use bulk-continuation to\n\t\t   avoid issues with short-transfers */\n\t\tbulk_buffer_len = MAX_BULK_BUFFER_LENGTH;\n\t\tuse_bulk_continuation = 1;\n\t} else if (dpriv->caps & USBFS_CAP_NO_PACKET_SIZE_LIM) {\n\t\t/* Don't split, assume the kernel can alloc the buffer\n\t\t   (otherwise the submit will fail with -ENOMEM) */\n\t\tbulk_buffer_len = transfer->length ? transfer->length : 1;\n\t\tuse_bulk_continuation = 0;\n\t} else {\n\t\t/* Bad, splitting without bulk-continuation, short transfers\n\t\t   which end before the last urb will not work reliable! */\n\t\t/* Note we don't warn here as this is \"normal\" on kernels <\n\t\t   2.6.32 and not a problem for most applications */\n\t\tbulk_buffer_len = MAX_BULK_BUFFER_LENGTH;\n\t\tuse_bulk_continuation = 0;\n\t}\n\n\tint num_urbs = transfer->length / bulk_buffer_len;\n\tint last_urb_partial = 0;\n\n\tif (transfer->length == 0) {\n\t\tnum_urbs = 1;\n\t} else if ((transfer->length % bulk_buffer_len) > 0) {\n\t\tlast_urb_partial = 1;\n\t\tnum_urbs++;\n\t}\n\tusbi_dbg(\"need %d urbs for new transfer with length %d\", num_urbs, transfer->length);\n\talloc_size = num_urbs * sizeof(struct usbfs_urb);\n\turbs = calloc(1, alloc_size);\n\tif (UNLIKELY(!urbs))\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\ttpriv->urbs = urbs;\n\ttpriv->num_urbs = num_urbs;\n\ttpriv->num_retired = 0;\n\ttpriv->reap_action = NORMAL;\n\ttpriv->reap_status = LIBUSB_TRANSFER_COMPLETED;\n\n\tfor (i = 0; i < num_urbs; i++) {\n\t\tstruct usbfs_urb *urb = &urbs[i];\n\t\turb->usercontext = itransfer;\n\t\tswitch (transfer->type) {\n\t\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\t\t\turb->type = USBFS_URB_TYPE_BULK;\n\t\t\turb->stream_id = 0;\n\t\t\tbreak;\n\t\tcase LIBUSB_TRANSFER_TYPE_BULK_STREAM:\n\t\t\turb->type = USBFS_URB_TYPE_BULK;\n\t\t\turb->stream_id = itransfer->stream_id;\n\t\t\tbreak;\n\t\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\t\t\turb->type = USBFS_URB_TYPE_INTERRUPT;\n\t\t\tbreak;\n\t\t}\n\t\turb->endpoint = transfer->endpoint;\n\t\turb->buffer = transfer->buffer + (i * bulk_buffer_len);\n\t\t/* don't set the short not ok flag for the last URB */\n\t\tif (use_bulk_continuation && !is_out && (i < num_urbs - 1))\n\t\t\turb->flags = USBFS_URB_SHORT_NOT_OK;\n\t\tif (i == num_urbs - 1 && last_urb_partial)\n\t\t\turb->buffer_length = transfer->length % bulk_buffer_len;\n\t\telse if (transfer->length == 0)\n\t\t\turb->buffer_length = 0;\n\t\telse\n\t\t\turb->buffer_length = bulk_buffer_len;\n\n\t\tif (i > 0 && use_bulk_continuation)\n\t\t\turb->flags |= USBFS_URB_BULK_CONTINUATION;\n\n\t\t/* we have already checked that the flag is supported */\n\t\tif (is_out && i == num_urbs - 1\n\t\t\t\t&& transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET)\n\t\t\turb->flags |= USBFS_URB_ZERO_PACKET;\n#if LOCAL_DEBUG\n\t\tdump_urb(i, dpriv->fd, urb);\n#endif\n\t\tr = ioctl(dpriv->fd, IOCTL_USBFS_SUBMITURB, urb);\n\t\tif (UNLIKELY(r < 0)) {\n\t\t\tif (errno == ENODEV) {\n\t\t\t\tr = LIBUSB_ERROR_NO_DEVICE;\n\t\t\t} else {\n\t\t\t\tusbi_err(TRANSFER_CTX(transfer),\n\t\t\t\t\t\"submiturb failed error %d errno=%d\", r, errno);\n\t\t\t\tr = LIBUSB_ERROR_IO;\n\t\t\t}\n\n\t\t\t/* if the first URB submission fails, we can simply free up and\n\t\t\t * return failure immediately. */\n\t\t\tif (UNLIKELY(i == 0)) {\n\t\t\t\tusbi_dbg(\"first URB failed, easy peasy\");\n\t\t\t\tfree(urbs);\n\t\t\t\ttpriv->urbs = NULL;\n\t\t\t\treturn r;\n\t\t\t}\n\n\t\t\t/* if it's not the first URB that failed, the situation is a bit\n\t\t\t * tricky. we may need to discard all previous URBs. there are\n\t\t\t * complications:\n\t\t\t *  - discarding is asynchronous - discarded urbs will be reaped\n\t\t\t *    later. the user must not have freed the transfer when the\n\t\t\t *    discarded URBs are reaped, otherwise libusb will be using\n\t\t\t *    freed memory.\n\t\t\t *  - the earlier URBs may have completed successfully and we do\n\t\t\t *    not want to throw away any data.\n\t\t\t *  - this URB failing may be no error; EREMOTEIO means that\n\t\t\t *    this transfer simply didn't need all the URBs we submitted\n\t\t\t * so, we report that the transfer was submitted successfully and\n\t\t\t * in case of error we discard all previous URBs. later when\n\t\t\t * the final reap completes we can report error to the user,\n\t\t\t * or success if an earlier URB was completed successfully.\n\t\t\t */\n\t\t\ttpriv->reap_action =\n\t\t\t\t\tEREMOTEIO == errno ? COMPLETED_EARLY : SUBMIT_FAILED;\n\n\t\t\t/* The URBs we haven't submitted yet we count as already\n\t\t\t * retired. */\n\t\t\ttpriv->num_retired += num_urbs - i;\n\n\t\t\t/* If we completed short then don't try to discard. */\n\t\t\tif (COMPLETED_EARLY == tpriv->reap_action)\n\t\t\t\treturn LIBUSB_SUCCESS;\n\n\t\t\tdiscard_urbs(itransfer, 0, i);\n\n\t\t\tusbi_dbg(\"reporting successful submission but waiting for %d \"\n\t\t\t\t\"discards before reporting error\", i);\n\t\t\treturn LIBUSB_SUCCESS;\n\t\t}\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int submit_iso_transfer(struct usbi_transfer *itransfer) {\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct android_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\tstruct android_device_handle_priv *dpriv = _device_handle_priv(transfer->dev_handle);\n\tstruct usbfs_urb **urbs;\n\tsize_t alloc_size;\n\tconst int num_packets = transfer->num_iso_packets;\n\tint i;\n\tint this_urb_len = 0;\n\tint num_urbs = 1;\n\tint packet_offset = 0;\n\tunsigned int packet_len;\n\tunsigned char *urb_buffer = transfer->buffer;\n\n\tif (UNLIKELY(tpriv->iso_urbs))\n\t\treturn LIBUSB_ERROR_BUSY;\n\n\t/* usbfs places a 32kb limit on iso URBs. we divide up larger requests\n\t * into smaller units to meet such restriction, then fire off all the\n\t * units at once. it would be simpler if we just fired one unit at a time,\n\t * but there is a big performance gain through doing it this way.\n\t *\n\t * Newer kernels lift the 32k limit (USBFS_CAP_NO_PACKET_SIZE_LIM),\n\t * using arbritary large transfers is still be a bad idea though, as\n\t * the kernel needs to allocate physical contiguous memory for this,\n\t * which may fail for large buffers.\n\t */\n\n\t/* calculate how many URBs we need */\n\tfor (i = 0; i < num_packets; i++) {\n\t\tunsigned int space_remaining = MAX_ISO_BUFFER_LENGTH - this_urb_len;\n\t\tpacket_len = transfer->iso_packet_desc[i].length;\n\n\t\tif (packet_len > space_remaining) {\n\t\t\tnum_urbs++;\n\t\t\tthis_urb_len = packet_len;\n\t\t} else {\n\t\t\tthis_urb_len += packet_len;\n\t\t}\n\t}\n\tusbi_dbg(\"need %d of 32k URBs for transfer\", num_urbs);\n\n\talloc_size = num_urbs * sizeof(*urbs);\n\turbs = calloc(1, alloc_size);\n\tif (UNLIKELY(!urbs))\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\ttpriv->iso_urbs = urbs;\n\ttpriv->num_urbs = num_urbs;\n\ttpriv->num_retired = 0;\n\ttpriv->reap_action = NORMAL;\n\ttpriv->iso_packet_offset = 0;\n\n\t/* allocate + initialize each URB with the correct number of packets */\n\tfor (i = 0; i < num_urbs; i++) {\n\t\tstruct usbfs_urb *urb;\n\t\tunsigned int space_remaining_in_urb = MAX_ISO_BUFFER_LENGTH;\n\t\tint urb_packet_offset = 0;\n\t\tunsigned char *urb_buffer_orig = urb_buffer;\n\t\tint j;\n\t\tint k;\n\n\t\t/* swallow up all the packets we can fit into this URB */\n\t\twhile (packet_offset < num_packets) {\n\t\t\tpacket_len = transfer->iso_packet_desc[packet_offset].length;\n\t\t\tif (packet_len <= space_remaining_in_urb) {\n\t\t\t\t/* throw it in */\n\t\t\t\turb_packet_offset++;\n\t\t\t\tpacket_offset++;\n\t\t\t\tspace_remaining_in_urb -= packet_len;\n\t\t\t\turb_buffer += packet_len;\n\t\t\t} else {\n\t\t\t\t/* it can't fit, save it for the next URB */\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\talloc_size = sizeof(*urb)\n\t\t\t+ (urb_packet_offset * sizeof(struct usbfs_iso_packet_desc));\n\t\turb = calloc(1, alloc_size);\n\t\tif (UNLIKELY(!urb)) {\n\t\t\tfree_iso_urbs(tpriv);\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\t}\n\t\turbs[i] = urb;\n\n\t\t/* populate packet lengths */\n\t\tfor (j = 0, k = packet_offset - urb_packet_offset;\n\t\t\t\tk < packet_offset; k++, j++) {\n\t\t\tpacket_len = transfer->iso_packet_desc[k].length;\n\t\t\turb->iso_frame_desc[j].length = packet_len;\n\t\t}\n\n\t\turb->usercontext = itransfer;\n\t\turb->type = USBFS_URB_TYPE_ISO;\n\t\t/* FIXME: interface for non-ASAP data? */\n\t\turb->flags = USBFS_URB_ISO_ASAP;\n\t\turb->endpoint = transfer->endpoint;\n\t\turb->number_of_packets = urb_packet_offset;\n\t\turb->buffer = urb_buffer_orig;\n\t}\n\n\t/* submit URBs */\n\tfor (i = 0; i < num_urbs; i++) {\n\t\tint r = ioctl(dpriv->fd, IOCTL_USBFS_SUBMITURB, urbs[i]);\n\t\tif (UNLIKELY(r < 0)) {\n\t\t\tif (errno == ENODEV) {\n\t\t\t\tr = LIBUSB_ERROR_NO_DEVICE;\n\t\t\t} else {\n\t\t\t\tusbi_err(TRANSFER_CTX(transfer),\n\t\t\t\t\t\"submiturb failed error %d errno=%d\", r, errno);\n\t\t\t\tr = LIBUSB_ERROR_IO;\n\t\t\t}\n\n\t\t\t/* if the first URB submission fails, we can simply free up and\n\t\t\t * return failure immediately. */\n\t\t\tif (UNLIKELY(i == 0)) {\n\t\t\t\tusbi_dbg(\"first URB failed, easy peasy\");\n\t\t\t\tfree_iso_urbs(tpriv);\n\t\t\t\treturn r;\n\t\t\t}\n\n\t\t\t/* if it's not the first URB that failed, the situation is a bit\n\t\t\t * tricky. we must discard all previous URBs. there are\n\t\t\t * complications:\n\t\t\t *  - discarding is asynchronous - discarded urbs will be reaped\n\t\t\t *    later. the user must not have freed the transfer when the\n\t\t\t *    discarded URBs are reaped, otherwise libusb will be using\n\t\t\t *    freed memory.\n\t\t\t *  - the earlier URBs may have completed successfully and we do\n\t\t\t *    not want to throw away any data.\n\t\t\t * so, in this case we discard all the previous URBs BUT we report\n\t\t\t * that the transfer was submitted successfully. then later when\n\t\t\t * the final discard completes we can report error to the user.\n\t\t\t */\n\t\t\ttpriv->reap_action = SUBMIT_FAILED;\n\n\t\t\t/* The URBs we haven't submitted yet we count as already\n\t\t\t * retired. */\n\t\t\ttpriv->num_retired = num_urbs - i;\n\t\t\tdiscard_urbs(itransfer, 0, i);\n\n\t\t\tusbi_dbg(\"reporting successful submission but waiting for %d \"\n\t\t\t\t\"discards before reporting error\", i);\n\t\t\treturn LIBUSB_SUCCESS;\n\t\t}\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int submit_control_transfer(struct usbi_transfer *itransfer) {\n\tstruct android_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\tstruct libusb_transfer *transfer\n\t\t= USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct android_device_handle_priv *dpriv\n\t\t= _device_handle_priv(transfer->dev_handle);\n\tstruct usbfs_urb *urb;\n\tint r;\n\n\tif (UNLIKELY(tpriv->urbs))\n\t\treturn LIBUSB_ERROR_BUSY;\n\n\tif (UNLIKELY(transfer->length - LIBUSB_CONTROL_SETUP_SIZE > MAX_CTRL_BUFFER_LENGTH))\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\turb = calloc(1, sizeof(struct usbfs_urb));\n\tif (UNLIKELY(!urb))\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\ttpriv->urbs = urb;\n\ttpriv->num_urbs = 1;\n\ttpriv->reap_action = NORMAL;\n\n\turb->usercontext = itransfer;\n\turb->type = USBFS_URB_TYPE_CONTROL;\n\turb->endpoint = transfer->endpoint;\n\turb->buffer = transfer->buffer;\n\turb->buffer_length = transfer->length;\n\n\tr = ioctl(dpriv->fd, IOCTL_USBFS_SUBMITURB, urb);\n\tif (UNLIKELY(r < 0)) {\n\t\tfree(urb);\n\t\ttpriv->urbs = NULL;\n\t\tif (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\tusbi_err(TRANSFER_CTX(transfer),\n\t\t\t\"submiturb failed error %d errno=%d\", r, errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int op_submit_transfer(struct usbi_transfer *itransfer) {\n\tstruct libusb_transfer *transfer\n\t\t= USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n\tswitch (transfer->type) {\n\tcase LIBUSB_TRANSFER_TYPE_CONTROL:\n\t\treturn submit_control_transfer(itransfer);\n\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\tcase LIBUSB_TRANSFER_TYPE_BULK_STREAM:\n\t\treturn submit_bulk_transfer(itransfer);\n\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\t\treturn submit_bulk_transfer(itransfer);\n\tcase LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n\t\treturn submit_iso_transfer(itransfer);\n\tdefault:\n\t\tusbi_err(TRANSFER_CTX(transfer),\n\t\t\t\"unknown endpoint type %d\", transfer->type);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n}\n\nstatic int op_cancel_transfer(struct usbi_transfer *itransfer) {\n\tENTER();\n\tstruct android_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n\tswitch (transfer->type) {\n\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\tcase LIBUSB_TRANSFER_TYPE_BULK_STREAM:\n\t\tif (tpriv->reap_action == ERROR)\n\t\t\tbreak;\n\t\t/* else, fall through */\n\tcase LIBUSB_TRANSFER_TYPE_CONTROL:\n\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\tcase LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n\t\ttpriv->reap_action = CANCELLED;\n\t\tbreak;\n\tdefault:\n\t\tusbi_err(TRANSFER_CTX(transfer),\n\t\t\t\"unknown endpoint type %d\", transfer->type);\n\t\tRETURN(LIBUSB_ERROR_INVALID_PARAM, int);\n\t}\n\n\tif (UNLIKELY(!tpriv->urbs))\n\t\tRETURN(LIBUSB_ERROR_NOT_FOUND, int);\n\n\tRETURN(discard_urbs(itransfer, 0, tpriv->num_urbs), int);\n}\n\nstatic void op_clear_transfer_priv(struct usbi_transfer *itransfer) {\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct android_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\n\t/* urbs can be freed also in submit_transfer so lock mutex first */\n\tswitch (transfer->type) {\n\tcase LIBUSB_TRANSFER_TYPE_CONTROL:\n\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\tcase LIBUSB_TRANSFER_TYPE_BULK_STREAM:\n\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\t\tusbi_mutex_lock(&itransfer->lock);\n\t\tif (tpriv->urbs)\n\t\t\tfree(tpriv->urbs);\n\t\ttpriv->urbs = NULL;\n\t\tusbi_mutex_unlock(&itransfer->lock);\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n\t\tusbi_mutex_lock(&itransfer->lock);\n\t\tif (tpriv->iso_urbs)\n\t\t\tfree_iso_urbs(tpriv);\n\t\tusbi_mutex_unlock(&itransfer->lock);\n\t\tbreak;\n\tdefault:\n\t\tusbi_err(TRANSFER_CTX(transfer),\n\t\t\t\"unknown endpoint type %d\", transfer->type);\n\t}\n}\n\nstatic int handle_bulk_completion(struct libusb_device_handle *handle,\t// XXX added saki\n\t\tstruct usbi_transfer *itransfer,\n\t\tstruct usbfs_urb *urb) {\n\tstruct android_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tint urb_idx = urb - tpriv->urbs;\n\n\tusbi_mutex_lock(&itransfer->lock);\n\tusbi_dbg(\"handling completion status %d of bulk urb %d/%d\",\n\t\t\turb->status, urb_idx + 1, tpriv->num_urbs);\n\n\ttpriv->num_retired++;\n\n\tif (UNLIKELY(tpriv->reap_action != NORMAL)) {\n\t\t/* cancelled, submit_fail, or completed early */\n\t\tusbi_dbg(\"abnormal reap: urb status %d\", urb->status);\n\n\t\t/* even though we're in the process of cancelling, it's possible that\n\t\t * we may receive some data in these URBs that we don't want to lose.\n\t\t * examples:\n\t\t * 1. while the kernel is cancelling all the packets that make up an\n\t\t *    URB, a few of them might complete. so we get back a successful\n\t\t *    cancellation *and* some data.\n\t\t * 2. we receive a short URB which marks the early completion condition,\n\t\t *    so we start cancelling the remaining URBs. however, we're too\n\t\t *    slow and another URB completes (or at least completes partially).\n\t\t *    (this can't happen since we always use BULK_CONTINUATION.)\n\t\t *\n\t\t * When this happens, our objectives are not to lose any \"surplus\" data,\n\t\t * and also to stick it at the end of the previously-received data\n\t\t * (closing any holes), so that libusb reports the total amount of\n\t\t * transferred data and presents it in a contiguous chunk.\n\t\t */\n\t\tif (urb->actual_length > 0) {\n\t\t\tunsigned char *target = transfer->buffer + itransfer->transferred;\n\t\t\tusbi_dbg(\"received %d bytes of surplus data\", urb->actual_length);\n\t\t\tif (urb->buffer != target) {\n\t\t\t\tusbi_dbg(\"moving surplus data from offset %d to offset %d\",\n\t\t\t\t\t(unsigned char *) urb->buffer - transfer->buffer,\n\t\t\t\t\ttarget - transfer->buffer);\n\t\t\t\tmemmove(target, urb->buffer, urb->actual_length);\n\t\t\t}\n\t\t\titransfer->transferred += urb->actual_length;\n\t\t}\n\n\t\tif (tpriv->num_retired == tpriv->num_urbs) {\n\t\t\tusbi_dbg(\"abnormal reap: last URB handled, reporting\");\n\t\t\tif (tpriv->reap_action != COMPLETED_EARLY\n\t\t\t\t\t&& tpriv->reap_status == LIBUSB_TRANSFER_COMPLETED)\n\t\t\t\ttpriv->reap_status = LIBUSB_TRANSFER_ERROR;\n\t\t\tgoto completed;\n\t\t}\n\t\tgoto out_unlock;\n\t}\n\n\titransfer->transferred += urb->actual_length;\n\n\t/* Many of these errors can occur on *any* urb of a multi-urb\n\t * transfer.  When they do, we tear down the rest of the transfer.\n\t */\n\tswitch (urb->status) {\n\tcase 0:\n\t\tbreak;\n\tcase -EREMOTEIO: /* short transfer */\n\t\tbreak;\n\tcase -ENOENT: /* cancelled */\n\tcase -ECONNRESET:\n\t\tbreak;\n\tcase -ENODEV:\n\tcase -ESHUTDOWN:\n\t\tusbi_dbg(\"device removed\");\n\t\ttpriv->reap_status = LIBUSB_TRANSFER_NO_DEVICE;\n\t\tgoto cancel_remaining;\n\tcase -EPIPE:\n\t\tusbi_dbg(\"detected endpoint stall\");\n\t\tif (tpriv->reap_status == LIBUSB_TRANSFER_COMPLETED)\n\t\t\ttpriv->reap_status = LIBUSB_TRANSFER_STALL;\n\t\tLOGE(\"LIBUSB_TRANSFER_STALL\");\n\t\top_clear_halt(handle, urb->endpoint);\t// XXX added saki\n\t\tgoto cancel_remaining;\n\tcase -EOVERFLOW:\n\t\t/* overflow can only ever occur in the last urb */\n\t\tusbi_dbg(\"overflow, actual_length=%d\", urb->actual_length);\n\t\tif (tpriv->reap_status == LIBUSB_TRANSFER_COMPLETED)\n\t\t\ttpriv->reap_status = LIBUSB_TRANSFER_OVERFLOW;\n\t\tgoto completed;\n\tcase -ETIME:\n\tcase -EPROTO:\n\tcase -EILSEQ:\n\tcase -ECOMM:\n\tcase -ENOSR:\n\t\tusbi_dbg(\"low level error %d\", urb->status);\n\t\ttpriv->reap_action = ERROR;\n\t\tgoto cancel_remaining;\n\tdefault:\n\t\tusbi_warn(ITRANSFER_CTX(itransfer),\n\t\t\t\"unrecognised urb status %d\", urb->status);\n\t\ttpriv->reap_action = ERROR;\n\t\tgoto cancel_remaining;\n\t}\n\n\t/* if we're the last urb or we got less data than requested then we're done */\n\tif (urb_idx == tpriv->num_urbs - 1) {\n\t\tusbi_dbg(\"last URB in transfer --> complete!\");\n\t\tgoto completed;\n\t} else if (urb->actual_length < urb->buffer_length) {\n\t\tusbi_dbg(\"short transfer %d/%d --> complete!\",\n\t\t\turb->actual_length, urb->buffer_length);\n\t\tif (tpriv->reap_action == NORMAL)\n\t\t\ttpriv->reap_action = COMPLETED_EARLY;\n\t} else\n\t\tgoto out_unlock;\n\ncancel_remaining:\n\tif (ERROR == tpriv->reap_action\n\t\t\t&& LIBUSB_TRANSFER_COMPLETED == tpriv->reap_status)\n\t\ttpriv->reap_status = LIBUSB_TRANSFER_ERROR;\n\n\tif (tpriv->num_retired == tpriv->num_urbs) /* nothing to cancel */\n\t\tgoto completed;\n\n\t/* cancel remaining urbs and wait for their completion before reporting results */\n\tdiscard_urbs(itransfer, urb_idx + 1, tpriv->num_urbs);\n\nout_unlock:\n\tusbi_mutex_unlock(&itransfer->lock);\n\treturn LIBUSB_SUCCESS;\n\ncompleted:\n\tif (tpriv->urbs)\n\t\tfree(tpriv->urbs);\n\ttpriv->urbs = NULL;\n\tusbi_mutex_unlock(&itransfer->lock);\n\treturn CANCELLED == tpriv->reap_action ?\n\t\tusbi_handle_transfer_cancellation(itransfer) :\n\t\tusbi_handle_transfer_completion(itransfer, tpriv->reap_status);\n}\n\nstatic int handle_iso_completion(struct libusb_device_handle *handle,\t// XXX added saki\n\t\tstruct usbi_transfer *itransfer,\n\t\tstruct usbfs_urb *urb) {\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct android_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\tint num_urbs = tpriv->num_urbs;\n\tint urb_idx = 0;\n\tint i;\n\tenum libusb_transfer_status status = LIBUSB_TRANSFER_COMPLETED;\n\n\tusbi_mutex_lock(&itransfer->lock);\n\tfor (i = 0; i < num_urbs; i++) {\n\t\tif (urb == tpriv->iso_urbs[i]) {\n\t\t\turb_idx = i + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (UNLIKELY(urb_idx == 0)) {\n\t\tusbi_err(TRANSFER_CTX(transfer), \"could not locate urb!\");\t// crash 2014/09/29 SIGSEGV/SEGV_MAPERR\n\t\tusbi_mutex_unlock(&itransfer->lock);\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\tusbi_dbg(\"handling completion status %d of iso urb %d/%d\",\n\t\turb->status, urb_idx, num_urbs);\n\n\t/* copy isochronous results back in */\n\n\tfor (i = 0; i < urb->number_of_packets; i++) {\n\t\tstruct usbfs_iso_packet_desc *urb_desc = &urb->iso_frame_desc[i];\n\t\tstruct libusb_iso_packet_descriptor *lib_desc =\n\t\t\t\t&transfer->iso_packet_desc[tpriv->iso_packet_offset++];\n\t\tlib_desc->status = LIBUSB_TRANSFER_COMPLETED;\n\t\tswitch (urb_desc->status) {\n\t\tcase 0:\n\t\t\tbreak;\n\t\tcase -ENOENT: /* cancelled */\n\t\tcase -ECONNRESET:\n\t\t\tbreak;\n\t\tcase -ENODEV:\n\t\tcase -ESHUTDOWN:\n\t\t\tusbi_dbg(\"device removed\");\n\t\t\tlib_desc->status = LIBUSB_TRANSFER_NO_DEVICE;\n\t\t\tbreak;\n\t\tcase -EPIPE:\n\t\t\tusbi_dbg(\"detected endpoint stall\");\n\t\t\tlib_desc->status = LIBUSB_TRANSFER_STALL;\n\t\t\tLOGE(\"LIBUSB_TRANSFER_STALL\");\n\t\t\top_clear_halt(handle, urb->endpoint);\t// XXX added saki\n\t\t\tbreak;\n\t\tcase -EOVERFLOW:\n\t\t\tusbi_dbg(\"overflow error\");\n\t\t\tlib_desc->status = LIBUSB_TRANSFER_OVERFLOW;\n\t\t\tbreak;\n\t\tcase -ETIME:\n\t\tcase -EPROTO:\n\t\tcase -EILSEQ:\n\t\tcase -ECOMM:\n\t\tcase -ENOSR:\n\t\tcase -EXDEV:\n\t\t\tusbi_dbg(\"low-level USB error %d\", urb_desc->status);\n\t\t\tlib_desc->status = LIBUSB_TRANSFER_ERROR;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tusbi_warn(TRANSFER_CTX(transfer),\n\t\t\t\t\"unrecognised urb status %d\", urb_desc->status);\n\t\t\tlib_desc->status = LIBUSB_TRANSFER_ERROR;\n\t\t\tbreak;\n\t\t}\n\t\tlib_desc->actual_length = urb_desc->actual_length;\n\t}\n\n\ttpriv->num_retired++;\n\n\tif (UNLIKELY(tpriv->reap_action != NORMAL)) { /* cancelled or submit_fail */\n\t\tusbi_dbg(\"CANCEL: urb status %d\", urb->status);\n\n\t\tif (tpriv->num_retired == num_urbs) {\n\t\t\tusbi_dbg(\"CANCEL: last URB handled, reporting\");\n\t\t\tfree_iso_urbs(tpriv);\n\t\t\tif (tpriv->reap_action == CANCELLED) {\n\t\t\t\tusbi_mutex_unlock(&itransfer->lock);\n\t\t\t\treturn usbi_handle_transfer_cancellation(itransfer);\n\t\t\t} else {\n\t\t\t\tusbi_mutex_unlock(&itransfer->lock);\n\t\t\t\treturn usbi_handle_transfer_completion(itransfer, LIBUSB_TRANSFER_ERROR);\n\t\t\t}\n\t\t}\n\t\tgoto out;\n\t}\n\n\tswitch (urb->status) {\n\tcase 0:\n\t\tbreak;\n\tcase -ENOENT: /* cancelled */\n\tcase -ECONNRESET:\n\t\tbreak;\n\tcase -ESHUTDOWN:\n\t\tusbi_dbg(\"device removed\");\n\t\tstatus = LIBUSB_TRANSFER_NO_DEVICE;\n\t\tbreak;\n\tdefault:\n\t\tusbi_warn(TRANSFER_CTX(transfer),\n\t\t\t\"unrecognised urb status %d\", urb->status);\n\t\tstatus = LIBUSB_TRANSFER_ERROR;\n\t\tbreak;\n\t}\n\n\t/* if we're the last urb then we're done */\n\tif (urb_idx == num_urbs) {\n\t\tusbi_dbg(\"last URB in transfer --> complete!\");\n\t\tfree_iso_urbs(tpriv);\n\t\tusbi_mutex_unlock(&itransfer->lock);\n\t\treturn usbi_handle_transfer_completion(itransfer, status);\n\t}\n\nout:\n\tusbi_mutex_unlock(&itransfer->lock);\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int handle_control_completion(struct libusb_device_handle *handle,\t// XXX added saki\n\t\tstruct usbi_transfer *itransfer,\n\t\tstruct usbfs_urb *urb) {\n\tstruct android_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\tint status;\n\n\tusbi_mutex_lock(&itransfer->lock);\n\tusbi_dbg(\"handling completion status %d\", urb->status);\n\n\titransfer->transferred += urb->actual_length;\n\n\tif (UNLIKELY(tpriv->reap_action == CANCELLED)) {\n\t\tif (urb->status != 0 && urb->status != -ENOENT)\n\t\t\tusbi_warn(ITRANSFER_CTX(itransfer),\n\t\t\t\t\"cancel: unrecognised urb status %d\", urb->status);\n\t\tif (tpriv->urbs) {\n\t\t\tfree(tpriv->urbs);\n\t\t\ttpriv->urbs = NULL;\n\t\t}\n\t\tusbi_mutex_unlock(&itransfer->lock);\n\t\treturn usbi_handle_transfer_cancellation(itransfer);\n\t}\n\n\tswitch (urb->status) {\n\tcase 0:\n\t\tstatus = LIBUSB_TRANSFER_COMPLETED;\n\t\tbreak;\n\tcase -ENOENT: /* cancelled */\n\t\tstatus = LIBUSB_TRANSFER_CANCELLED;\n\t\tbreak;\n\tcase -ENODEV:\n\tcase -ESHUTDOWN:\n\t\tusbi_dbg(\"device removed\");\n\t\tstatus = LIBUSB_TRANSFER_NO_DEVICE;\n\t\tbreak;\n\tcase -EPIPE:\n\t\tusbi_dbg(\"unsupported control request\");\n\t\tstatus = LIBUSB_TRANSFER_STALL;\n\t\tLOGE(\"LIBUSB_TRANSFER_STALL\");\n\t\top_clear_halt(handle, urb->endpoint);\t// XXX added saki\n\t\tbreak;\n\tcase -EOVERFLOW:\n\t\tusbi_dbg(\"control overflow error\");\n\t\tstatus = LIBUSB_TRANSFER_OVERFLOW;\n\t\tbreak;\n\tcase -ETIME:\n\tcase -EPROTO:\n\tcase -EILSEQ:\n\tcase -ECOMM:\n\tcase -ENOSR:\n\t\tusbi_dbg(\"low-level bus error occurred\");\n\t\tstatus = LIBUSB_TRANSFER_ERROR;\n\t\tbreak;\n\tdefault:\n\t\tusbi_warn(ITRANSFER_CTX(itransfer),\n\t\t\t\"unrecognised urb status %d\", urb->status);\n\t\tstatus = LIBUSB_TRANSFER_ERROR;\n\t\tbreak;\n\t}\n\n\tif (tpriv->urbs) {\n\t\tfree(tpriv->urbs);\t// crash\n\t\ttpriv->urbs = NULL;\n\t}\n\tusbi_mutex_unlock(&itransfer->lock);\n\treturn usbi_handle_transfer_completion(itransfer, status);\n}\n\nstatic int reap_for_handle(struct libusb_device_handle *handle) {\n\tstruct android_device_handle_priv *hpriv = _device_handle_priv(handle);\n\tint r;\n\tstruct usbfs_urb *urb;\n\tstruct usbi_transfer *itransfer;\n\tstruct libusb_transfer *transfer;\n\n\tr = ioctl(hpriv->fd, IOCTL_USBFS_REAPURBNDELAY, &urb);\n\tif (r == -1 && errno == EAGAIN)\n\t\treturn 1;\n\tif (UNLIKELY(r < 0)) {\n\t\tif (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\tusbi_err(HANDLE_CTX(handle), \"reap failed error %d errno=%d\", r, errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\titransfer = urb->usercontext;\n\ttransfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n\tusbi_dbg(\"urb type=%d status=%d transferred=%d\",\n\t\turb->type, urb->status, urb->actual_length);\n\n\tswitch (transfer->type) {\n\tcase LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n\t\treturn handle_iso_completion(handle, itransfer, urb);\n\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\tcase LIBUSB_TRANSFER_TYPE_BULK_STREAM:\n\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\t\treturn handle_bulk_completion(handle, itransfer, urb);\n\tcase LIBUSB_TRANSFER_TYPE_CONTROL:\n\t\treturn handle_control_completion(handle, itransfer, urb);\n\tdefault:\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"unrecognised endpoint type %x\", transfer->type);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n}\n\nstatic int op_handle_events(struct libusb_context *ctx, struct pollfd *fds,\n\t\tPOLL_NFDS_TYPE nfds, int num_ready) {\n\tint r;\n\tunsigned int i = 0;\n\n\tusbi_mutex_lock(&ctx->open_devs_lock);\n\tfor (i = 0; i < nfds && num_ready > 0; i++) {\n\t\tstruct pollfd *pollfd = &fds[i];\n\t\tstruct libusb_device_handle *handle;\n\t\tstruct android_device_handle_priv *hpriv = NULL;\n\n\t\tif (!pollfd->revents)\n\t\t\tcontinue;\n\n\t\tnum_ready--;\n\t\tlist_for_each_entry(handle, &ctx->open_devs, list, struct libusb_device_handle)\n\t\t{\n\t\t\thpriv = _device_handle_priv(handle);\n\t\t\tif (hpriv->fd == pollfd->fd)\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (!hpriv || hpriv->fd != pollfd->fd) {\n\t\t\tusbi_err(ctx, \"cannot find handle for fd %d\\n\",\n\t\t\t\t pollfd->fd);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (pollfd->revents & POLLERR) {\n\t\t\tusbi_remove_pollfd(HANDLE_CTX(handle), hpriv->fd);\n\t\t\tusbi_mutex_lock(&ctx->events_lock);\t\t// XXX as a note of usbi_handle_disconnect shows that need event_lock locked\n\t\t\tusbi_handle_disconnect(handle);\n\t\t\tusbi_mutex_unlock(&ctx->events_lock);\t// XXX\n\t\t\t/* device will still be marked as attached if hotplug monitor thread\n\t\t\t * hasn't processed remove event yet */\n\t\t\tusbi_mutex_static_lock(&android_hotplug_lock);\n\t\t\tif (handle->dev->attached)\n\t\t\t\tandroid_device_disconnected(handle->dev->bus_number,\n\t\t\t\t\t\thandle->dev->device_address, NULL);\n\t\t\tusbi_mutex_static_unlock(&android_hotplug_lock);\n\t\t\tcontinue;\n\t\t}\n\n\t\tdo {\n\t\t\tr = reap_for_handle(handle);\n\t\t} while (r == 0);\n\t\tif (r == 1 || r == LIBUSB_ERROR_NO_DEVICE)\n\t\t\tcontinue;\n\t\telse if (r < 0)\n\t\t\tgoto out;\n\t}\n\n\tr = 0;\nout:\n\tusbi_mutex_unlock(&ctx->open_devs_lock);\n\treturn r;\n}\n\nstatic int op_clock_gettime(int clk_id, struct timespec *tp) {\n\tswitch (clk_id) {\n\tcase USBI_CLOCK_MONOTONIC:\n\t\treturn clock_gettime(monotonic_clkid, tp);\n\tcase USBI_CLOCK_REALTIME:\n\t\treturn clock_gettime(CLOCK_REALTIME, tp);\n\tdefault:\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n}\n\n#ifdef USBI_TIMERFD_AVAILABLE\nstatic clockid_t op_get_timerfd_clockid(void)\n{\n\treturn monotonic_clkid;\n\n}\n#endif\n\nconst struct usbi_os_backend android_usbfs_backend = {\n\t.name = \"Android usbfs\",\n\t.caps = USBI_CAP_HAS_HID_ACCESS | USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER,\n\t.init = op_init,\n\t.init2 = op_init2,\t// XXX\n\t.exit = op_exit,\n\t.get_device_list = NULL,\n\t.hotplug_poll = op_hotplug_poll,\n\t.get_raw_descriptor = op_get_raw_descriptor,\t// XXX\n\t.get_device_descriptor = op_get_device_descriptor,\n\t.get_active_config_descriptor = op_get_active_config_descriptor,\n\t.get_config_descriptor = op_get_config_descriptor,\n\t.get_config_descriptor_by_value = op_get_config_descriptor_by_value,\n\t.set_device_fd = op_set_device_fd,\t// XXX add for no-rooted Android devices\n\t.open = op_open,\n\t.close = op_close,\n\t.get_configuration = op_get_configuration,\n\t.set_configuration = op_set_configuration,\n\t.claim_interface = op_claim_interface,\n\t.release_interface = op_release_interface,\n\n\t.set_interface_altsetting = op_set_interface,\n\t.clear_halt = op_clear_halt,\n\t.reset_device = op_reset_device,\n\n\t.alloc_streams = op_alloc_streams,\n\t.free_streams = op_free_streams,\n\n\t.kernel_driver_active = op_kernel_driver_active,\n\t.detach_kernel_driver = op_detach_kernel_driver,\n\t.attach_kernel_driver = op_attach_kernel_driver,\n\n\t.destroy_device = op_destroy_device,\n\n\t.submit_transfer = op_submit_transfer,\n\t.cancel_transfer = op_cancel_transfer,\n\t.clear_transfer_priv = op_clear_transfer_priv,\n\n\t.handle_events = op_handle_events,\n\n\t.clock_gettime = op_clock_gettime,\n\n#ifdef USBI_TIMERFD_AVAILABLE\n\t.get_timerfd_clockid = op_get_timerfd_clockid,\n#endif\n\n\t.device_priv_size = sizeof(struct android_device_priv),\n\t.device_handle_priv_size = sizeof(struct android_device_handle_priv),\n\t.transfer_priv_size = sizeof(struct android_transfer_priv),\n\t.add_iso_packet_size = 0,\n};\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/android_usbfs.h",
    "content": "/*\n * usbfs header structures\n * Copyright © 2007 Daniel Drake <dsd@gentoo.org>\n * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef LIBUSB_USBFS_H\n#define LIBUSB_USBFS_H\n\n#include <linux/types.h>\n\n#define SYSFS_DEVICE_PATH \"/sys/bus/usb/devices\"\n\nstruct usbfs_ctrltransfer {\n\t/* keep in sync with usbdevice_fs.h:usbdevfs_ctrltransfer */\n\tuint8_t  bmRequestType;\n\tuint8_t  bRequest;\n\tuint16_t wValue;\n\tuint16_t wIndex;\n\tuint16_t wLength;\n\n\tuint32_t timeout;\t/* in milliseconds */\n\n\t/* pointer to data */\n\tvoid *data;\n};\n\nstruct usbfs_bulktransfer {\n\t/* keep in sync with usbdevice_fs.h:usbdevfs_bulktransfer */\n\tunsigned int ep;\n\tunsigned int len;\n\tunsigned int timeout;\t/* in milliseconds */\n\n\t/* pointer to data */\n\tvoid *data;\n};\n\nstruct usbfs_setinterface {\n\t/* keep in sync with usbdevice_fs.h:usbdevfs_setinterface */\n\tunsigned int interface;\n\tunsigned int altsetting;\n};\n\n#define USBFS_MAXDRIVERNAME 255\n\nstruct usbfs_getdriver {\n\tunsigned int interface;\n\tchar driver[USBFS_MAXDRIVERNAME + 1];\n};\n\n#define USBFS_URB_SHORT_NOT_OK\t\t0x01\n#define USBFS_URB_ISO_ASAP\t\t\t0x02\n#define USBFS_URB_BULK_CONTINUATION\t0x04\n#define USBFS_URB_QUEUE_BULK\t\t0x10\n#define USBFS_URB_ZERO_PACKET\t\t0x40\n\nenum usbfs_urb_type {\n\tUSBFS_URB_TYPE_ISO = 0,\n\tUSBFS_URB_TYPE_INTERRUPT = 1,\n\tUSBFS_URB_TYPE_CONTROL = 2,\n\tUSBFS_URB_TYPE_BULK = 3,\n};\n\nstruct usbfs_iso_packet_desc {\n\tunsigned int length;\n\tunsigned int actual_length;\n\tunsigned int status;\n};\n\n#define MAX_ISO_BUFFER_LENGTH\t\t32768\t// 32 x 1024 = 32KB\n#define MAX_BULK_BUFFER_LENGTH\t\t16384\t// 16 x 1024 = 16KB\n#define MAX_CTRL_BUFFER_LENGTH\t\t4096\t// 4 x 1024 = 4KB\n\nstruct usbfs_urb {\n\tunsigned char type;\n\tunsigned char endpoint;\n\tint status;\n\tunsigned int flags;\n\tvoid *buffer;\n\tint buffer_length;\n\tint actual_length;\n\tint start_frame;\n\tunion {\n\t\tint number_of_packets;\t/* Only used for isoc urbs */\n\t\tunsigned int stream_id;\t/* Only used with bulk streams */\n\t};\n\tint error_count;\n\tunsigned int signr;\n\tvoid *usercontext;\n\tstruct usbfs_iso_packet_desc iso_frame_desc[0];\n};\n\nstruct usbfs_connectinfo {\n\tunsigned int devnum;\n\tunsigned char slow;\n};\n\nstruct usbfs_ioctl {\n\tint ifno;\t\t/* interface 0..N ; negative numbers reserved */\n\tint ioctl_code;\t/* MUST encode size + direction of data so the\n\t\t\t \t \t * macros in <asm/ioctl.h> give correct values */\n\tvoid *data;\t\t/* param buffer (in, or out) */\n};\n\nstruct usbfs_hub_portinfo {\n\tunsigned char numports;\n\tunsigned char port[127];\t/* port to device num mapping */\n};\n\n#define USBFS_CAP_ZERO_PACKET\t\t\t\t\t0x01\n#define USBFS_CAP_BULK_CONTINUATION\t\t\t\t0x02\n#define USBFS_CAP_NO_PACKET_SIZE_LIM\t\t\t0x04\n#define USBFS_CAP_BULK_SCATTER_GATHER\t\t\t0x08\n\n#define USBFS_DISCONNECT_CLAIM_IF_DRIVER\t\t0x01\n#define USBFS_DISCONNECT_CLAIM_EXCEPT_DRIVER\t0x02\n\nstruct usbfs_disconnect_claim {\n\tunsigned int interface;\n\tunsigned int flags;\n\tchar driver[USBFS_MAXDRIVERNAME + 1];\n};\n\nstruct usbfs_streams {\n\tunsigned int num_streams; /* Not used by USBDEVFS_FREE_STREAMS */\n\tunsigned int num_eps;\n\tunsigned char eps[0];\n};\n\n#define IOCTL_USBFS_CONTROL\t\t\t\t_IOWR('U', 0, struct usbfs_ctrltransfer)\n#define IOCTL_USBFS_BULK\t\t\t\t_IOWR('U', 2, struct usbfs_bulktransfer)\n#define IOCTL_USBFS_RESETEP\t\t\t\t_IOR('U', 3, unsigned int)\n#define IOCTL_USBFS_SETINTF\t\t\t\t_IOR('U', 4, struct usbfs_setinterface)\n#define IOCTL_USBFS_SETCONFIG\t\t\t_IOR('U', 5, unsigned int)\n#define IOCTL_USBFS_GETDRIVER\t\t\t_IOW('U', 8, struct usbfs_getdriver)\n#define IOCTL_USBFS_SUBMITURB\t\t\t_IOR('U', 10, struct usbfs_urb)\n#define IOCTL_USBFS_DISCARDURB\t\t\t_IO('U', 11)\n#define IOCTL_USBFS_REAPURB\t\t\t\t_IOW('U', 12, void *)\n#define IOCTL_USBFS_REAPURBNDELAY\t\t_IOW('U', 13, void *)\n#define IOCTL_USBFS_CLAIMINTF\t\t\t_IOR('U', 15, unsigned int)\n#define IOCTL_USBFS_RELEASEINTF\t\t\t_IOR('U', 16, unsigned int)\n#define IOCTL_USBFS_CONNECTINFO\t\t\t_IOW('U', 17, struct usbfs_connectinfo)\n#define IOCTL_USBFS_IOCTL         \t\t_IOWR('U', 18, struct usbfs_ioctl)\n#define IOCTL_USBFS_HUB_PORTINFO\t\t_IOR('U', 19, struct usbfs_hub_portinfo)\n#define IOCTL_USBFS_RESET\t\t\t\t_IO('U', 20)\n#define IOCTL_USBFS_CLEAR_HALT\t\t\t_IOR('U', 21, unsigned int)\n#define IOCTL_USBFS_DISCONNECT\t\t\t_IO('U', 22)\n#define IOCTL_USBFS_CONNECT\t\t\t\t_IO('U', 23)\n#define IOCTL_USBFS_CLAIM_PORT\t\t\t_IOR('U', 24, unsigned int)\n#define IOCTL_USBFS_RELEASE_PORT\t\t_IOR('U', 25, unsigned int)\n#define IOCTL_USBFS_GET_CAPABILITIES\t_IOR('U', 26, __u32)\n#define IOCTL_USBFS_DISCONNECT_CLAIM\t_IOR('U', 27, struct usbfs_disconnect_claim)\n#define IOCTL_USBFS_ALLOC_STREAMS\t\t_IOR('U', 28, struct usbfs_streams)\n#define IOCTL_USBFS_FREE_STREAMS\t\t_IOR('U', 29, struct usbfs_streams)\n\nextern usbi_mutex_static_t android_hotplug_lock;\n\n#if defined(HAVE_LIBUDEV)\nint android_udev_start_event_monitor(void);\nint android_udev_stop_event_monitor(void);\nint android_udev_scan_devices(struct libusb_context *ctx);\nvoid android_udev_hotplug_poll(void);\n#else\nint android_netlink_start_event_monitor(void);\nint android_netlink_stop_event_monitor(void);\nvoid android_netlink_hotplug_poll(void);\n#endif\n\nvoid android_hotplug_enumerate(uint8_t busnum, uint8_t devaddr, const char *sys_name);\nvoid android_device_disconnected(uint8_t busnum, uint8_t devaddr, const char *sys_name);\n\nint android_get_device_address (struct libusb_context *ctx, int detached,\n\tuint8_t *busnum, uint8_t *devaddr, const char *dev_node,\n\tconst char *sys_name);\nint android_enumerate_device(struct libusb_context *ctx,\n\tuint8_t busnum, uint8_t devaddr, const char *sysfs_dir);\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/darwin_usb.c",
    "content": "/* -*- Mode: C; indent-tabs-mode:nil -*- */\n/*\n * darwin backend for libusb 1.0\n * Copyright © 2008-2013 Nathan Hjelm <hjelmn@users.sourceforge.net>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"config.h\"\n#include <ctype.h>\n#include <errno.h>\n#include <pthread.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/types.h>\n#include <unistd.h>\n#include <fcntl.h>\n#include <libkern/OSAtomic.h>\n\n#include <mach/clock.h>\n#include <mach/clock_types.h>\n#include <mach/mach_host.h>\n#include <mach/mach_port.h>\n\n#include <AvailabilityMacros.h>\n#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060\n  #include <objc/objc-auto.h>\n#endif\n\n#include \"darwin_usb.h\"\n\n/* async event thread */\nstatic pthread_mutex_t libusb_darwin_at_mutex = PTHREAD_MUTEX_INITIALIZER;\nstatic pthread_cond_t  libusb_darwin_at_cond = PTHREAD_COND_INITIALIZER;\n\nstatic clock_serv_t clock_realtime;\nstatic clock_serv_t clock_monotonic;\n\nstatic CFRunLoopRef libusb_darwin_acfl = NULL; /* event cf loop */\nstatic volatile int32_t initCount = 0;\n\nstatic usbi_mutex_t darwin_cached_devices_lock = PTHREAD_MUTEX_INITIALIZER;\nstatic struct list_head darwin_cached_devices = {&darwin_cached_devices, &darwin_cached_devices};\n\n#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))\n\n/* async event thread */\nstatic pthread_t libusb_darwin_at;\n\nstatic int darwin_get_config_descriptor(struct libusb_device *dev, uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian);\nstatic int darwin_claim_interface(struct libusb_device_handle *dev_handle, int iface);\nstatic int darwin_release_interface(struct libusb_device_handle *dev_handle, int iface);\nstatic int darwin_reset_device(struct libusb_device_handle *dev_handle);\nstatic void darwin_async_io_callback (void *refcon, IOReturn result, void *arg0);\n\nstatic int darwin_scan_devices(struct libusb_context *ctx);\nstatic int process_new_device (struct libusb_context *ctx, io_service_t service);\n\n#if defined(ENABLE_LOGGING)\nstatic const char *darwin_error_str (int result) {\n  static char string_buffer[50];\n  switch (result) {\n  case kIOReturnSuccess:\n    return \"no error\";\n  case kIOReturnNotOpen:\n    return \"device not opened for exclusive access\";\n  case kIOReturnNoDevice:\n    return \"no connection to an IOService\";\n  case kIOUSBNoAsyncPortErr:\n    return \"no async port has been opened for interface\";\n  case kIOReturnExclusiveAccess:\n    return \"another process has device opened for exclusive access\";\n  case kIOUSBPipeStalled:\n    return \"pipe is stalled\";\n  case kIOReturnError:\n    return \"could not establish a connection to the Darwin kernel\";\n  case kIOUSBTransactionTimeout:\n    return \"transaction timed out\";\n  case kIOReturnBadArgument:\n    return \"invalid argument\";\n  case kIOReturnAborted:\n    return \"transaction aborted\";\n  case kIOReturnNotResponding:\n    return \"device not responding\";\n  case kIOReturnOverrun:\n    return \"data overrun\";\n  case kIOReturnCannotWire:\n    return \"physical memory can not be wired down\";\n  case kIOReturnNoResources:\n    return \"out of resources\";\n  case kIOUSBHighSpeedSplitError:\n    return \"high speed split error\";\n  default:\n    snprintf(string_buffer, sizeof(string_buffer), \"unknown error (0x%x)\", result);\n    return string_buffer;\n  }\n}\n#endif\n\nstatic int darwin_to_libusb (int result) {\n  switch (result) {\n  case kIOReturnUnderrun:\n  case kIOReturnSuccess:\n    return LIBUSB_SUCCESS;\n  case kIOReturnNotOpen:\n  case kIOReturnNoDevice:\n    return LIBUSB_ERROR_NO_DEVICE;\n  case kIOReturnExclusiveAccess:\n    return LIBUSB_ERROR_ACCESS;\n  case kIOUSBPipeStalled:\n    return LIBUSB_ERROR_PIPE;\n  case kIOReturnBadArgument:\n    return LIBUSB_ERROR_INVALID_PARAM;\n  case kIOUSBTransactionTimeout:\n    return LIBUSB_ERROR_TIMEOUT;\n  case kIOReturnNotResponding:\n  case kIOReturnAborted:\n  case kIOReturnError:\n  case kIOUSBNoAsyncPortErr:\n  default:\n    return LIBUSB_ERROR_OTHER;\n  }\n}\n\n/* this function must be called with the darwin_cached_devices_lock held */\nstatic void darwin_deref_cached_device(struct darwin_cached_device *cached_dev) {\n  cached_dev->refcount--;\n  /* free the device and remove it from the cache */\n  if (0 == cached_dev->refcount) {\n    list_del(&cached_dev->list);\n\n    (*(cached_dev->device))->Release(cached_dev->device);\n    free (cached_dev);\n  }\n}\n\nstatic void darwin_ref_cached_device(struct darwin_cached_device *cached_dev) {\n  cached_dev->refcount++;\n}\n\nstatic int ep_to_pipeRef(struct libusb_device_handle *dev_handle, uint8_t ep, uint8_t *pipep, uint8_t *ifcp) {\n  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;\n\n  /* current interface */\n  struct darwin_interface *cInterface;\n\n  int8_t i, iface;\n\n  usbi_dbg (\"converting ep address 0x%02x to pipeRef and interface\", ep);\n\n  for (iface = 0 ; iface < USB_MAXINTERFACES ; iface++) {\n    cInterface = &priv->interfaces[iface];\n\n    if (dev_handle->claimed_interfaces & (1 << iface)) {\n      for (i = 0 ; i < cInterface->num_endpoints ; i++) {\n        if (cInterface->endpoint_addrs[i] == ep) {\n          *pipep = i + 1;\n          *ifcp = iface;\n          usbi_dbg (\"pipe %d on interface %d matches\", *pipep, *ifcp);\n          return 0;\n        }\n      }\n    }\n  }\n\n  /* No pipe found with the correct endpoint address */\n  usbi_warn (HANDLE_CTX(dev_handle), \"no pipeRef found with endpoint address 0x%02x.\", ep);\n\n  return -1;\n}\n\nstatic int usb_setup_device_iterator (io_iterator_t *deviceIterator, UInt32 location) {\n  CFMutableDictionaryRef matchingDict = IOServiceMatching(kIOUSBDeviceClassName);\n\n  if (!matchingDict)\n    return kIOReturnError;\n\n  if (location) {\n    CFMutableDictionaryRef propertyMatchDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,\n                                                                         &kCFTypeDictionaryKeyCallBacks,\n                                                                         &kCFTypeDictionaryValueCallBacks);\n\n    if (propertyMatchDict) {\n      /* there are no unsigned CFNumber types so treat the value as signed. the os seems to do this\n         internally (CFNumberType of locationID is 3) */\n      CFTypeRef locationCF = CFNumberCreate (NULL, kCFNumberSInt32Type, &location);\n\n      CFDictionarySetValue (propertyMatchDict, CFSTR(kUSBDevicePropertyLocationID), locationCF);\n      /* release our reference to the CFNumber (CFDictionarySetValue retains it) */\n      CFRelease (locationCF);\n\n      CFDictionarySetValue (matchingDict, CFSTR(kIOPropertyMatchKey), propertyMatchDict);\n      /* release out reference to the CFMutableDictionaryRef (CFDictionarySetValue retains it) */\n      CFRelease (propertyMatchDict);\n    }\n    /* else we can still proceed as long as the caller accounts for the possibility of other devices in the iterator */\n  }\n\n  return IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDict, deviceIterator);\n}\n\n/* Returns 1 on success, 0 on failure. */\nstatic int get_ioregistry_value_number (io_service_t service, CFStringRef property, CFNumberType type, void *p) {\n  CFTypeRef cfNumber = IORegistryEntryCreateCFProperty (service, property, kCFAllocatorDefault, 0);\n  int ret = 0;\n\n  if (cfNumber) {\n    if (CFGetTypeID(cfNumber) == CFNumberGetTypeID()) {\n      ret = CFNumberGetValue(cfNumber, type, p);\n    }\n\n    CFRelease (cfNumber);\n  }\n\n  return ret;\n}\n\nstatic usb_device_t **darwin_device_from_service (io_service_t service)\n{\n  io_cf_plugin_ref_t *plugInInterface = NULL;\n  usb_device_t **device;\n  kern_return_t result;\n  SInt32 score;\n\n  result = IOCreatePlugInInterfaceForService(service, kIOUSBDeviceUserClientTypeID,\n                                             kIOCFPlugInInterfaceID, &plugInInterface,\n                                             &score);\n\n  if (kIOReturnSuccess != result || !plugInInterface) {\n    usbi_dbg (\"could not set up plugin for service: %s\\n\", darwin_error_str (result));\n    return NULL;\n  }\n\n  (void)(*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(DeviceInterfaceID),\n                                           (LPVOID)&device);\n  /* Use release instead of IODestroyPlugInInterface to avoid stopping IOServices associated with this device */\n  (*plugInInterface)->Release (plugInInterface);\n\n  return device;\n}\n\nstatic void darwin_devices_attached (void *ptr, io_iterator_t add_devices) {\n  struct libusb_context *ctx;\n  io_service_t service;\n\n  usbi_mutex_lock(&active_contexts_lock);\n\n  while ((service = IOIteratorNext(add_devices))) {\n    /* add this device to each active context's device list */\n    list_for_each_entry(ctx, &active_contexts_list, list, struct libusb_context) {\n      process_new_device (ctx, service);;\n    }\n\n    IOObjectRelease(service);\n  }\n\n  usbi_mutex_unlock(&active_contexts_lock);\n}\n\nstatic void darwin_devices_detached (void *ptr, io_iterator_t rem_devices) {\n  struct libusb_device *dev = NULL;\n  struct libusb_context *ctx;\n\n  io_service_t device;\n  UInt64 session;\n  int ret;\n\n  while ((device = IOIteratorNext (rem_devices)) != 0) {\n    /* get the location from the i/o registry */\n    ret = get_ioregistry_value_number (device, CFSTR(\"sessionID\"), kCFNumberSInt64Type, &session);\n    IOObjectRelease (device);\n    if (!ret)\n      continue;\n\n    usbi_mutex_lock(&active_contexts_lock);\n\n    list_for_each_entry(ctx, &active_contexts_list, list, struct libusb_context) {\n      usbi_dbg (\"notifying context %p of device disconnect\", ctx);\n\n      dev = usbi_get_device_by_session_id(ctx, (unsigned long) session);\n      if (dev) {\n        /* signal the core that this device has been disconnected. the core will tear down this device\n           when the reference count reaches 0 */\n        usbi_disconnect_device(dev);\n        libusb_unref_device(dev);\n      }\n    }\n\n    usbi_mutex_unlock(&active_contexts_lock);\n  }\n}\n\nstatic void darwin_clear_iterator (io_iterator_t iter) {\n  io_service_t device;\n\n  while ((device = IOIteratorNext (iter)) != 0)\n    IOObjectRelease (device);\n}\n\nstatic void *darwin_event_thread_main (void *arg0) {\n  IOReturn kresult;\n  struct libusb_context *ctx = (struct libusb_context *)arg0;\n  CFRunLoopRef runloop;\n\n  /* Set this thread's name, so it can be seen in the debugger\n     and crash reports. */\n#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060\n  pthread_setname_np (\"org.libusb.device-hotplug\");\n\n  /* Tell the Objective-C garbage collector about this thread.\n     This is required because, unlike NSThreads, pthreads are\n     not automatically registered. Although we don't use\n     Objective-C, we use CoreFoundation, which does. */\n  objc_registerThreadWithCollector();\n#endif\n\n  /* hotplug (device arrival/removal) sources */\n  CFRunLoopSourceRef     libusb_notification_cfsource;\n  io_notification_port_t libusb_notification_port;\n  io_iterator_t          libusb_rem_device_iterator;\n  io_iterator_t          libusb_add_device_iterator;\n\n  usbi_dbg (\"creating hotplug event source\");\n\n  runloop = CFRunLoopGetCurrent ();\n  CFRetain (runloop);\n\n  /* add the notification port to the run loop */\n  libusb_notification_port     = IONotificationPortCreate (kIOMasterPortDefault);\n  libusb_notification_cfsource = IONotificationPortGetRunLoopSource (libusb_notification_port);\n  CFRunLoopAddSource(runloop, libusb_notification_cfsource, kCFRunLoopDefaultMode);\n\n  /* create notifications for removed devices */\n  kresult = IOServiceAddMatchingNotification (libusb_notification_port, kIOTerminatedNotification,\n                                              IOServiceMatching(kIOUSBDeviceClassName),\n                                              (IOServiceMatchingCallback)darwin_devices_detached,\n                                              (void *)ctx, &libusb_rem_device_iterator);\n\n  if (kresult != kIOReturnSuccess) {\n    usbi_err (ctx, \"could not add hotplug event source: %s\", darwin_error_str (kresult));\n\n    pthread_exit (NULL);\n  }\n\n  /* create notifications for attached devices */\n  kresult = IOServiceAddMatchingNotification(libusb_notification_port, kIOFirstMatchNotification,\n                                              IOServiceMatching(kIOUSBDeviceClassName),\n                                              (IOServiceMatchingCallback)darwin_devices_attached,\n                                              (void *)ctx, &libusb_add_device_iterator);\n\n  if (kresult != kIOReturnSuccess) {\n    usbi_err (ctx, \"could not add hotplug event source: %s\", darwin_error_str (kresult));\n\n    pthread_exit (NULL);\n  }\n\n  /* arm notifiers */\n  darwin_clear_iterator (libusb_rem_device_iterator);\n  darwin_clear_iterator (libusb_add_device_iterator);\n\n  usbi_dbg (\"darwin event thread ready to receive events\");\n\n  /* signal the main thread that the hotplug runloop has been created. */\n  pthread_mutex_lock (&libusb_darwin_at_mutex);\n  libusb_darwin_acfl = runloop;\n  pthread_cond_signal (&libusb_darwin_at_cond);\n  pthread_mutex_unlock (&libusb_darwin_at_mutex);\n\n  /* run the runloop */\n  CFRunLoopRun();\n\n  usbi_dbg (\"darwin event thread exiting\");\n\n  /* remove the notification cfsource */\n  CFRunLoopRemoveSource(runloop, libusb_notification_cfsource, kCFRunLoopDefaultMode);\n\n  /* delete notification port */\n  IONotificationPortDestroy (libusb_notification_port);\n\n  /* delete iterators */\n  IOObjectRelease (libusb_rem_device_iterator);\n  IOObjectRelease (libusb_add_device_iterator);\n\n  CFRelease (runloop);\n\n  libusb_darwin_acfl = NULL;\n\n  pthread_exit (NULL);\n}\n\n/* cleanup function to destroy cached devices */\nstatic void __attribute__((destructor)) _darwin_finalize(void) {\n  struct darwin_cached_device *dev, *next;\n\n  usbi_mutex_lock(&darwin_cached_devices_lock);\n  list_for_each_entry_safe(dev, next, &darwin_cached_devices, list, struct darwin_cached_device) {\n    darwin_deref_cached_device(dev);\n  }\n  usbi_mutex_unlock(&darwin_cached_devices_lock);\n}\n\nstatic int darwin_init(struct libusb_context *ctx) {\n  host_name_port_t host_self;\n  int rc;\n\n  rc = darwin_scan_devices (ctx);\n  if (LIBUSB_SUCCESS != rc) {\n    return rc;\n  }\n\n  if (OSAtomicIncrement32Barrier(&initCount) == 1) {\n    /* create the clocks that will be used */\n\n    host_self = mach_host_self();\n    host_get_clock_service(host_self, CALENDAR_CLOCK, &clock_realtime);\n    host_get_clock_service(host_self, SYSTEM_CLOCK, &clock_monotonic);\n    mach_port_deallocate(mach_task_self(), host_self);\n\n    pthread_create (&libusb_darwin_at, NULL, darwin_event_thread_main, (void *)ctx);\n\n    pthread_mutex_lock (&libusb_darwin_at_mutex);\n    while (!libusb_darwin_acfl)\n      pthread_cond_wait (&libusb_darwin_at_cond, &libusb_darwin_at_mutex);\n    pthread_mutex_unlock (&libusb_darwin_at_mutex);\n  }\n\n  return rc;\n}\n\nstatic void darwin_exit (void) {\n  if (OSAtomicDecrement32Barrier(&initCount) == 0) {\n    mach_port_deallocate(mach_task_self(), clock_realtime);\n    mach_port_deallocate(mach_task_self(), clock_monotonic);\n\n    /* stop the event runloop and wait for the thread to terminate. */\n    CFRunLoopStop (libusb_darwin_acfl);\n    pthread_join (libusb_darwin_at, NULL);\n  }\n}\n\nstatic int darwin_get_device_descriptor(struct libusb_device *dev, unsigned char *buffer, int *host_endian) {\n  struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev);\n\n  /* return cached copy */\n  memmove (buffer, &(priv->dev_descriptor), DEVICE_DESC_LENGTH);\n\n  *host_endian = 0;\n\n  return 0;\n}\n\nstatic int get_configuration_index (struct libusb_device *dev, int config_value) {\n  struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev);\n  UInt8 i, numConfig;\n  IOUSBConfigurationDescriptorPtr desc;\n  IOReturn kresult;\n\n  /* is there a simpler way to determine the index? */\n  kresult = (*(priv->device))->GetNumberOfConfigurations (priv->device, &numConfig);\n  if (kresult != kIOReturnSuccess)\n    return darwin_to_libusb (kresult);\n\n  for (i = 0 ; i < numConfig ; i++) {\n    (*(priv->device))->GetConfigurationDescriptorPtr (priv->device, i, &desc);\n\n    if (desc->bConfigurationValue == config_value)\n      return i;\n  }\n\n  /* configuration not found */\n  return LIBUSB_ERROR_NOT_FOUND;\n}\n\nstatic int darwin_get_active_config_descriptor(struct libusb_device *dev, unsigned char *buffer, size_t len, int *host_endian) {\n  struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev);\n  int config_index;\n\n  if (0 == priv->active_config)\n    return LIBUSB_ERROR_NOT_FOUND;\n\n  config_index = get_configuration_index (dev, priv->active_config);\n  if (config_index < 0)\n    return config_index;\n\n  return darwin_get_config_descriptor (dev, config_index, buffer, len, host_endian);\n}\n\nstatic int darwin_get_config_descriptor(struct libusb_device *dev, uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian) {\n  struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev);\n  IOUSBConfigurationDescriptorPtr desc;\n  IOReturn kresult;\n  int ret;\n\n  if (!priv || !priv->device)\n    return LIBUSB_ERROR_OTHER;\n\n  kresult = (*priv->device)->GetConfigurationDescriptorPtr (priv->device, config_index, &desc);\n  if (kresult == kIOReturnSuccess) {\n    /* copy descriptor */\n    if (libusb_le16_to_cpu(desc->wTotalLength) < len)\n      len = libusb_le16_to_cpu(desc->wTotalLength);\n\n    memmove (buffer, desc, len);\n\n    /* GetConfigurationDescriptorPtr returns the descriptor in USB bus order */\n    *host_endian = 0;\n  }\n\n  ret = darwin_to_libusb (kresult);\n  if (ret != LIBUSB_SUCCESS)\n    return ret;\n\n  return (int) len;\n}\n\n/* check whether the os has configured the device */\nstatic int darwin_check_configuration (struct libusb_context *ctx, struct darwin_cached_device *dev) {\n  usb_device_t **darwin_device = dev->device;\n\n  IOUSBConfigurationDescriptorPtr configDesc;\n  IOUSBFindInterfaceRequest request;\n  kern_return_t             kresult;\n  io_iterator_t             interface_iterator;\n  io_service_t              firstInterface;\n\n  if (dev->dev_descriptor.bNumConfigurations < 1) {\n    usbi_err (ctx, \"device has no configurations\");\n    return LIBUSB_ERROR_OTHER; /* no configurations at this speed so we can't use it */\n  }\n\n  /* find the first configuration */\n  kresult = (*darwin_device)->GetConfigurationDescriptorPtr (darwin_device, 0, &configDesc);\n  dev->first_config = (kIOReturnSuccess == kresult) ? configDesc->bConfigurationValue : 1;\n\n  /* check if the device is already configured. there is probably a better way than iterating over the\n     to accomplish this (the trick is we need to avoid a call to GetConfigurations since buggy devices\n     might lock up on the device request) */\n\n  /* Setup the Interface Request */\n  request.bInterfaceClass    = kIOUSBFindInterfaceDontCare;\n  request.bInterfaceSubClass = kIOUSBFindInterfaceDontCare;\n  request.bInterfaceProtocol = kIOUSBFindInterfaceDontCare;\n  request.bAlternateSetting  = kIOUSBFindInterfaceDontCare;\n\n  kresult = (*(darwin_device))->CreateInterfaceIterator(darwin_device, &request, &interface_iterator);\n  if (kresult)\n    return darwin_to_libusb (kresult);\n\n  /* iterate once */\n  firstInterface = IOIteratorNext(interface_iterator);\n\n  /* done with the interface iterator */\n  IOObjectRelease(interface_iterator);\n\n  if (firstInterface) {\n    IOObjectRelease (firstInterface);\n\n    /* device is configured */\n    if (dev->dev_descriptor.bNumConfigurations == 1)\n      /* to avoid problems with some devices get the configurations value from the configuration descriptor */\n      dev->active_config = dev->first_config;\n    else\n      /* devices with more than one configuration should work with GetConfiguration */\n      (*darwin_device)->GetConfiguration (darwin_device, &dev->active_config);\n  } else\n    /* not configured */\n    dev->active_config = 0;\n  \n  usbi_dbg (\"active config: %u, first config: %u\", dev->active_config, dev->first_config);\n\n  return 0;\n}\n\nstatic int darwin_request_descriptor (usb_device_t **device, UInt8 desc, UInt8 desc_index, void *buffer, size_t buffer_size) {\n  IOUSBDevRequestTO req;\n\n  memset (buffer, 0, buffer_size);\n\n  /* Set up request for descriptor/ */\n  req.bmRequestType = USBmakebmRequestType(kUSBIn, kUSBStandard, kUSBDevice);\n  req.bRequest      = kUSBRqGetDescriptor;\n  req.wValue        = desc << 8;\n  req.wIndex        = desc_index;\n  req.wLength       = buffer_size;\n  req.pData         = buffer;\n  req.noDataTimeout = 20;\n  req.completionTimeout = 100;\n\n  return (*device)->DeviceRequestTO (device, &req);\n}\n\nstatic int darwin_cache_device_descriptor (struct libusb_context *ctx, struct darwin_cached_device *dev) {\n  usb_device_t **device = dev->device;\n  int retries = 1, delay = 30000;\n  int unsuspended = 0, try_unsuspend = 1, try_reconfigure = 1;\n  int is_open = 0;\n  int ret = 0, ret2;\n  UInt8 bDeviceClass;\n  UInt16 idProduct, idVendor;\n\n  dev->can_enumerate = 0;\n\n  (*device)->GetDeviceClass (device, &bDeviceClass);\n  (*device)->GetDeviceProduct (device, &idProduct);\n  (*device)->GetDeviceVendor (device, &idVendor);\n\n  /* According to Apple's documentation the device must be open for DeviceRequest but we may not be able to open some\n   * devices and Apple's USB Prober doesn't bother to open the device before issuing a descriptor request.  Still,\n   * to follow the spec as closely as possible, try opening the device */\n  is_open = ((*device)->USBDeviceOpenSeize(device) == kIOReturnSuccess);\n\n  do {\n    /**** retrieve device descriptor ****/\n    ret = darwin_request_descriptor (device, kUSBDeviceDesc, 0, &dev->dev_descriptor, sizeof(dev->dev_descriptor));\n\n    if (kIOReturnOverrun == ret && kUSBDeviceDesc == dev->dev_descriptor.bDescriptorType)\n      /* received an overrun error but we still received a device descriptor */\n      ret = kIOReturnSuccess;\n\n    if (kIOUSBVendorIDAppleComputer == idVendor) {\n      /* NTH: don't bother retrying or unsuspending Apple devices */\n      break;\n    }\n\n    if (kIOReturnSuccess == ret && (0 == dev->dev_descriptor.bNumConfigurations ||\n                                    0 == dev->dev_descriptor.bcdUSB)) {\n      /* work around for incorrectly configured devices */\n      if (try_reconfigure && is_open) {\n        usbi_dbg(\"descriptor appears to be invalid. resetting configuration before trying again...\");\n\n        /* set the first configuration */\n        (*device)->SetConfiguration(device, 1);\n\n        /* don't try to reconfigure again */\n        try_reconfigure = 0;\n      }\n\n      ret = kIOUSBPipeStalled;\n    }\n\n    if (kIOReturnSuccess != ret && is_open && try_unsuspend) {\n      /* device may be suspended. unsuspend it and try again */\n#if DeviceVersion >= 320\n      UInt32 info = 0;\n\n      /* IOUSBFamily 320+ provides a way to detect device suspension but earlier versions do not */\n      (void)(*device)->GetUSBDeviceInformation (device, &info);\n\n      /* note that the device was suspended */\n      if (info & (1 << kUSBInformationDeviceIsSuspendedBit) || 0 == info)\n        try_unsuspend = 1;\n#endif\n\n      if (try_unsuspend) {\n        /* try to unsuspend the device */\n        ret2 = (*device)->USBDeviceSuspend (device, 0);\n        if (kIOReturnSuccess != ret2) {\n          /* prevent log spew from poorly behaving devices.  this indicates the\n             os actually had trouble communicating with the device */\n          usbi_dbg(\"could not retrieve device descriptor. failed to unsuspend: %s\",darwin_error_str(ret2));\n        } else\n          unsuspended = 1;\n\n        try_unsuspend = 0;\n      }\n    }\n\n    if (kIOReturnSuccess != ret) {\n      usbi_dbg(\"kernel responded with code: 0x%08x. sleeping for %d ms before trying again\", ret, delay/1000);\n      /* sleep for a little while before trying again */\n      usleep (delay);\n    }\n  } while (kIOReturnSuccess != ret && retries--);\n\n  if (unsuspended)\n    /* resuspend the device */\n    (void)(*device)->USBDeviceSuspend (device, 1);\n\n  if (is_open)\n    (void) (*device)->USBDeviceClose (device);\n\n  if (ret != kIOReturnSuccess) {\n    /* a debug message was already printed out for this error */\n    if (LIBUSB_CLASS_HUB == bDeviceClass)\n      usbi_dbg (\"could not retrieve device descriptor %.4x:%.4x: %s (%x). skipping device\",\n                idVendor, idProduct, darwin_error_str (ret), ret);\n    else\n      usbi_warn (ctx, \"could not retrieve device descriptor %.4x:%.4x: %s (%x). skipping device\",\n                 idVendor, idProduct, darwin_error_str (ret), ret);\n    return darwin_to_libusb (ret);\n  }\n\n  /* catch buggy hubs (which appear to be virtual). Apple's own USB prober has problems with these devices. */\n  if (libusb_le16_to_cpu (dev->dev_descriptor.idProduct) != idProduct) {\n    /* not a valid device */\n    usbi_warn (ctx, \"idProduct from iokit (%04x) does not match idProduct in descriptor (%04x). skipping device\",\n               idProduct, libusb_le16_to_cpu (dev->dev_descriptor.idProduct));\n    return LIBUSB_ERROR_NO_DEVICE;\n  }\n\n  usbi_dbg (\"cached device descriptor:\");\n  usbi_dbg (\"  bDescriptorType:    0x%02x\", dev->dev_descriptor.bDescriptorType);\n  usbi_dbg (\"  bcdUSB:             0x%04x\", dev->dev_descriptor.bcdUSB);\n  usbi_dbg (\"  bDeviceClass:       0x%02x\", dev->dev_descriptor.bDeviceClass);\n  usbi_dbg (\"  bDeviceSubClass:    0x%02x\", dev->dev_descriptor.bDeviceSubClass);\n  usbi_dbg (\"  bDeviceProtocol:    0x%02x\", dev->dev_descriptor.bDeviceProtocol);\n  usbi_dbg (\"  bMaxPacketSize0:    0x%02x\", dev->dev_descriptor.bMaxPacketSize0);\n  usbi_dbg (\"  idVendor:           0x%04x\", dev->dev_descriptor.idVendor);\n  usbi_dbg (\"  idProduct:          0x%04x\", dev->dev_descriptor.idProduct);\n  usbi_dbg (\"  bcdDevice:          0x%04x\", dev->dev_descriptor.bcdDevice);\n  usbi_dbg (\"  iManufacturer:      0x%02x\", dev->dev_descriptor.iManufacturer);\n  usbi_dbg (\"  iProduct:           0x%02x\", dev->dev_descriptor.iProduct);\n  usbi_dbg (\"  iSerialNumber:      0x%02x\", dev->dev_descriptor.iSerialNumber);\n  usbi_dbg (\"  bNumConfigurations: 0x%02x\", dev->dev_descriptor.bNumConfigurations);\n\n  dev->can_enumerate = 1;\n\n  return LIBUSB_SUCCESS;\n}\n\nstatic int darwin_get_cached_device(struct libusb_context *ctx, io_service_t service,\n                                    struct darwin_cached_device **cached_out) {\n  struct darwin_cached_device *new_device;\n  UInt64 sessionID = 0, parent_sessionID = 0;\n  int ret = LIBUSB_SUCCESS;\n  usb_device_t **device;\n  io_service_t parent;\n  kern_return_t result;\n  UInt8 port = 0;\n\n  /* get some info from the io registry */\n  (void) get_ioregistry_value_number (service, CFSTR(\"sessionID\"), kCFNumberSInt64Type, &sessionID);\n  (void) get_ioregistry_value_number (service, CFSTR(\"PortNum\"), kCFNumberSInt8Type, &port);\n\n  usbi_dbg(\"finding cached device for sessionID 0x%\" PRIx64, sessionID);\n\n  result = IORegistryEntryGetParentEntry (service, kIOUSBPlane, &parent);\n\n  if (kIOReturnSuccess == result) {\n    (void) get_ioregistry_value_number (parent, CFSTR(\"sessionID\"), kCFNumberSInt64Type, &parent_sessionID);\n    IOObjectRelease(parent);\n  }\n\n  usbi_mutex_lock(&darwin_cached_devices_lock);\n  do {\n    *cached_out = NULL;\n\n    list_for_each_entry(new_device, &darwin_cached_devices, list, struct darwin_cached_device) {\n      usbi_dbg(\"matching sessionID 0x%\" PRIx64 \" against cached device with sessionID 0x%\" PRIx64, sessionID, new_device->session);\n      if (new_device->session == sessionID) {\n        usbi_dbg(\"using cached device for device\");\n        *cached_out = new_device;\n        break;\n      }\n    }\n\n    if (*cached_out)\n      break;\n\n    usbi_dbg(\"caching new device with sessionID 0x%\" PRIx64, sessionID);\n\n    device = darwin_device_from_service (service);\n    if (!device) {\n      ret = LIBUSB_ERROR_NO_DEVICE;\n      break;\n    }\n\n    new_device = calloc (1, sizeof (*new_device));\n    if (!new_device) {\n      ret = LIBUSB_ERROR_NO_MEM;\n      break;\n    }\n\n    /* add this device to the cached device list */\n    list_add(&new_device->list, &darwin_cached_devices);\n\n    (*device)->GetDeviceAddress (device, (USBDeviceAddress *)&new_device->address);\n\n    /* keep a reference to this device */\n    darwin_ref_cached_device(new_device);\n\n    new_device->device = device;\n    new_device->session = sessionID;\n    (*device)->GetLocationID (device, &new_device->location);\n    new_device->port = port;\n    new_device->parent_session = parent_sessionID;\n\n    /* cache the device descriptor */\n    ret = darwin_cache_device_descriptor(ctx, new_device);\n    if (ret)\n      break;\n\n    if (new_device->can_enumerate) {\n      snprintf(new_device->sys_path, 20, \"%03i-%04x-%04x-%02x-%02x\", new_device->address,\n               new_device->dev_descriptor.idVendor, new_device->dev_descriptor.idProduct,\n               new_device->dev_descriptor.bDeviceClass, new_device->dev_descriptor.bDeviceSubClass);\n    }\n  } while (0);\n\n  usbi_mutex_unlock(&darwin_cached_devices_lock);\n\n  /* keep track of devices regardless of if we successfully enumerate them to\n     prevent them from being enumerated multiple times */\n\n  *cached_out = new_device;\n\n  return ret;\n}\n\nstatic int process_new_device (struct libusb_context *ctx, io_service_t service) {\n  struct darwin_device_priv *priv;\n  struct libusb_device *dev = NULL;\n  struct darwin_cached_device *cached_device;\n  UInt8 devSpeed;\n  int ret = 0;\n\n  do {\n    ret = darwin_get_cached_device (ctx, service, &cached_device);\n\n    if (ret < 0 || !cached_device->can_enumerate) {\n      return ret;\n    }\n\n    /* check current active configuration (and cache the first configuration value--\n       which may be used by claim_interface) */\n    ret = darwin_check_configuration (ctx, cached_device);\n    if (ret)\n      break;\n\n    usbi_dbg (\"allocating new device in context %p for with session 0x%\" PRIx64,\n              ctx, cached_device->session);\n\n    dev = usbi_alloc_device(ctx, (unsigned long) cached_device->session);\n    if (!dev) {\n      return LIBUSB_ERROR_NO_MEM;\n    }\n\n    priv = (struct darwin_device_priv *)dev->os_priv;\n\n    priv->dev = cached_device;\n    darwin_ref_cached_device (priv->dev);\n\n    if (cached_device->parent_session > 0) {\n      dev->parent_dev = usbi_get_device_by_session_id (ctx, (unsigned long) cached_device->parent_session);\n    } else {\n      dev->parent_dev = NULL;\n    }\n    dev->port_number    = cached_device->port;\n    dev->bus_number     = cached_device->location >> 24;\n    dev->device_address = cached_device->address;\n\n    (*(priv->dev->device))->GetDeviceSpeed (priv->dev->device, &devSpeed);\n\n    switch (devSpeed) {\n    case kUSBDeviceSpeedLow: dev->speed = LIBUSB_SPEED_LOW; break;\n    case kUSBDeviceSpeedFull: dev->speed = LIBUSB_SPEED_FULL; break;\n    case kUSBDeviceSpeedHigh: dev->speed = LIBUSB_SPEED_HIGH; break;\n#if DeviceVersion >= 500\n    case kUSBDeviceSpeedSuper: dev->speed = LIBUSB_SPEED_SUPER; break;\n#endif\n    default:\n      usbi_warn (ctx, \"Got unknown device speed %d\", devSpeed);\n    }\n\n    ret = usbi_sanitize_device (dev);\n    if (ret < 0)\n      break;\n\n    usbi_dbg (\"found device with address %d port = %d parent = %p at %p\", dev->device_address,\n              dev->port_number, (void *) dev->parent_dev, priv->dev->sys_path);\n  } while (0);\n\n  if (0 == ret) {\n    usbi_connect_device (dev);\n  } else {\n    libusb_unref_device (dev);\n  }\n\n  return ret;\n}\n\nstatic int darwin_scan_devices(struct libusb_context *ctx) {\n  io_iterator_t deviceIterator;\n  io_service_t service;\n  kern_return_t kresult;\n\n  kresult = usb_setup_device_iterator (&deviceIterator, 0);\n  if (kresult != kIOReturnSuccess)\n    return darwin_to_libusb (kresult);\n\n  while ((service = IOIteratorNext (deviceIterator))) {\n    (void) process_new_device (ctx, service);\n\n    IOObjectRelease(service);\n  }\n\n  IOObjectRelease(deviceIterator);\n\n  return 0;\n}\n\nstatic int darwin_open (struct libusb_device_handle *dev_handle) {\n  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;\n  struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);\n  IOReturn kresult;\n\n  if (0 == dpriv->open_count) {\n    /* try to open the device */\n    kresult = (*(dpriv->device))->USBDeviceOpenSeize (dpriv->device);\n    if (kresult != kIOReturnSuccess) {\n      usbi_warn (HANDLE_CTX (dev_handle), \"USBDeviceOpen: %s\", darwin_error_str(kresult));\n\n      if (kIOReturnExclusiveAccess != kresult) {\n        return darwin_to_libusb (kresult);\n      }\n\n      /* it is possible to perform some actions on a device that is not open so do not return an error */\n      priv->is_open = 0;\n    } else {\n      priv->is_open = 1;\n    }\n\n    /* create async event source */\n    kresult = (*(dpriv->device))->CreateDeviceAsyncEventSource (dpriv->device, &priv->cfSource);\n    if (kresult != kIOReturnSuccess) {\n      usbi_err (HANDLE_CTX (dev_handle), \"CreateDeviceAsyncEventSource: %s\", darwin_error_str(kresult));\n\n      if (priv->is_open) {\n        (*(dpriv->device))->USBDeviceClose (dpriv->device);\n      }\n\n      priv->is_open = 0;\n\n      return darwin_to_libusb (kresult);\n    }\n\n    CFRetain (libusb_darwin_acfl);\n\n    /* add the cfSource to the aync run loop */\n    CFRunLoopAddSource(libusb_darwin_acfl, priv->cfSource, kCFRunLoopCommonModes);\n  }\n\n  /* device opened successfully */\n  dpriv->open_count++;\n\n  /* create a file descriptor for notifications */\n  pipe (priv->fds);\n\n  /* set the pipe to be non-blocking */\n  fcntl (priv->fds[1], F_SETFD, O_NONBLOCK);\n\n  usbi_add_pollfd(HANDLE_CTX(dev_handle), priv->fds[0], POLLIN);\n\n  usbi_dbg (\"device open for access\");\n\n  return 0;\n}\n\nstatic void darwin_close (struct libusb_device_handle *dev_handle) {\n  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;\n  struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);\n  IOReturn kresult;\n  int i;\n\n  if (dpriv->open_count == 0) {\n    /* something is probably very wrong if this is the case */\n    usbi_err (HANDLE_CTX (dev_handle), \"Close called on a device that was not open!\\n\");\n    return;\n  }\n\n  dpriv->open_count--;\n\n  /* make sure all interfaces are released */\n  for (i = 0 ; i < USB_MAXINTERFACES ; i++)\n    if (dev_handle->claimed_interfaces & (1 << i))\n      libusb_release_interface (dev_handle, i);\n\n  if (0 == dpriv->open_count) {\n    /* delete the device's async event source */\n    if (priv->cfSource) {\n      CFRunLoopRemoveSource (libusb_darwin_acfl, priv->cfSource, kCFRunLoopDefaultMode);\n      CFRelease (priv->cfSource);\n      priv->cfSource = NULL;\n      CFRelease (libusb_darwin_acfl);\n    }\n\n    if (priv->is_open) {\n      /* close the device */\n      kresult = (*(dpriv->device))->USBDeviceClose(dpriv->device);\n      if (kresult) {\n        /* Log the fact that we had a problem closing the file, however failing a\n         * close isn't really an error, so return success anyway */\n        usbi_warn (HANDLE_CTX (dev_handle), \"USBDeviceClose: %s\", darwin_error_str(kresult));\n      }\n    }\n  }\n\n  /* file descriptors are maintained per-instance */\n  usbi_remove_pollfd (HANDLE_CTX (dev_handle), priv->fds[0]);\n  close (priv->fds[1]);\n  close (priv->fds[0]);\n\n  priv->fds[0] = priv->fds[1] = -1;\n}\n\nstatic int darwin_get_configuration(struct libusb_device_handle *dev_handle, int *config) {\n  struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);\n\n  *config = (int) dpriv->active_config;\n\n  return 0;\n}\n\nstatic int darwin_set_configuration(struct libusb_device_handle *dev_handle, int config) {\n  struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);\n  IOReturn kresult;\n  int i;\n\n  /* Setting configuration will invalidate the interface, so we need\n     to reclaim it. First, dispose of existing interfaces, if any. */\n  for (i = 0 ; i < USB_MAXINTERFACES ; i++)\n    if (dev_handle->claimed_interfaces & (1 << i))\n      darwin_release_interface (dev_handle, i);\n\n  kresult = (*(dpriv->device))->SetConfiguration (dpriv->device, config);\n  if (kresult != kIOReturnSuccess)\n    return darwin_to_libusb (kresult);\n\n  /* Reclaim any interfaces. */\n  for (i = 0 ; i < USB_MAXINTERFACES ; i++)\n    if (dev_handle->claimed_interfaces & (1 << i))\n      darwin_claim_interface (dev_handle, i);\n\n  dpriv->active_config = config;\n\n  return 0;\n}\n\nstatic int darwin_get_interface (usb_device_t **darwin_device, uint8_t ifc, io_service_t *usbInterfacep) {\n  IOUSBFindInterfaceRequest request;\n  kern_return_t             kresult;\n  io_iterator_t             interface_iterator;\n  UInt8                     bInterfaceNumber;\n  int                       ret;\n\n  *usbInterfacep = IO_OBJECT_NULL;\n\n  /* Setup the Interface Request */\n  request.bInterfaceClass    = kIOUSBFindInterfaceDontCare;\n  request.bInterfaceSubClass = kIOUSBFindInterfaceDontCare;\n  request.bInterfaceProtocol = kIOUSBFindInterfaceDontCare;\n  request.bAlternateSetting  = kIOUSBFindInterfaceDontCare;\n\n  kresult = (*(darwin_device))->CreateInterfaceIterator(darwin_device, &request, &interface_iterator);\n  if (kresult)\n    return kresult;\n\n  while ((*usbInterfacep = IOIteratorNext(interface_iterator))) {\n    /* find the interface number */\n    ret = get_ioregistry_value_number (*usbInterfacep, CFSTR(\"bInterfaceNumber\"), kCFNumberSInt8Type,\n                                       &bInterfaceNumber);\n\n    if (ret && bInterfaceNumber == ifc) {\n      break;\n    }\n\n    (void) IOObjectRelease (*usbInterfacep);\n  }\n\n  /* done with the interface iterator */\n  IOObjectRelease(interface_iterator);\n\n  return 0;\n}\n\nstatic int get_endpoints (struct libusb_device_handle *dev_handle, int iface) {\n  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;\n\n  /* current interface */\n  struct darwin_interface *cInterface = &priv->interfaces[iface];\n\n  kern_return_t kresult;\n\n  u_int8_t numep, direction, number;\n  u_int8_t dont_care1, dont_care3;\n  u_int16_t dont_care2;\n  int i;\n\n  usbi_dbg (\"building table of endpoints.\");\n\n  /* retrieve the total number of endpoints on this interface */\n  kresult = (*(cInterface->interface))->GetNumEndpoints(cInterface->interface, &numep);\n  if (kresult) {\n    usbi_err (HANDLE_CTX (dev_handle), \"can't get number of endpoints for interface: %s\", darwin_error_str(kresult));\n    return darwin_to_libusb (kresult);\n  }\n\n  /* iterate through pipe references */\n  for (i = 1 ; i <= numep ; i++) {\n    kresult = (*(cInterface->interface))->GetPipeProperties(cInterface->interface, i, &direction, &number, &dont_care1,\n                                                            &dont_care2, &dont_care3);\n\n    if (kresult != kIOReturnSuccess) {\n      usbi_err (HANDLE_CTX (dev_handle), \"error getting pipe information for pipe %d: %s\", i, darwin_error_str(kresult));\n\n      return darwin_to_libusb (kresult);\n    }\n\n    usbi_dbg (\"interface: %i pipe %i: dir: %i number: %i\", iface, i, direction, number);\n\n    cInterface->endpoint_addrs[i - 1] = ((direction << 7 & LIBUSB_ENDPOINT_DIR_MASK) | (number & LIBUSB_ENDPOINT_ADDRESS_MASK));\n  }\n\n  cInterface->num_endpoints = numep;\n\n  return 0;\n}\n\nstatic int darwin_claim_interface(struct libusb_device_handle *dev_handle, int iface) {\n  struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);\n  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;\n  io_service_t          usbInterface = IO_OBJECT_NULL;\n  IOReturn kresult;\n  IOCFPlugInInterface **plugInInterface = NULL;\n  SInt32                score;\n\n  /* current interface */\n  struct darwin_interface *cInterface = &priv->interfaces[iface];\n\n  kresult = darwin_get_interface (dpriv->device, iface, &usbInterface);\n  if (kresult != kIOReturnSuccess)\n    return darwin_to_libusb (kresult);\n\n  /* make sure we have an interface */\n  if (!usbInterface && dpriv->first_config != 0) {\n    usbi_info (HANDLE_CTX (dev_handle), \"no interface found; setting configuration: %d\", dpriv->first_config);\n\n    /* set the configuration */\n    kresult = darwin_set_configuration (dev_handle, dpriv->first_config);\n    if (kresult != LIBUSB_SUCCESS) {\n      usbi_err (HANDLE_CTX (dev_handle), \"could not set configuration\");\n      return kresult;\n    }\n\n    kresult = darwin_get_interface (dpriv->device, iface, &usbInterface);\n    if (kresult) {\n      usbi_err (HANDLE_CTX (dev_handle), \"darwin_get_interface: %s\", darwin_error_str(kresult));\n      return darwin_to_libusb (kresult);\n    }\n  }\n\n  if (!usbInterface) {\n    usbi_err (HANDLE_CTX (dev_handle), \"interface not found\");\n    return LIBUSB_ERROR_NOT_FOUND;\n  }\n\n  /* get an interface to the device's interface */\n  kresult = IOCreatePlugInInterfaceForService (usbInterface, kIOUSBInterfaceUserClientTypeID,\n                                               kIOCFPlugInInterfaceID, &plugInInterface, &score);\n\n  /* ignore release error */\n  (void)IOObjectRelease (usbInterface);\n\n  if (kresult) {\n    usbi_err (HANDLE_CTX (dev_handle), \"IOCreatePlugInInterfaceForService: %s\", darwin_error_str(kresult));\n    return darwin_to_libusb (kresult);\n  }\n\n  if (!plugInInterface) {\n    usbi_err (HANDLE_CTX (dev_handle), \"plugin interface not found\");\n    return LIBUSB_ERROR_NOT_FOUND;\n  }\n\n  /* Do the actual claim */\n  kresult = (*plugInInterface)->QueryInterface(plugInInterface,\n                                               CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID),\n                                               (LPVOID)&cInterface->interface);\n  /* We no longer need the intermediate plug-in */\n  /* Use release instead of IODestroyPlugInInterface to avoid stopping IOServices associated with this device */\n  (*plugInInterface)->Release (plugInInterface);\n  if (kresult || !cInterface->interface) {\n    usbi_err (HANDLE_CTX (dev_handle), \"QueryInterface: %s\", darwin_error_str(kresult));\n    return darwin_to_libusb (kresult);\n  }\n\n  /* claim the interface */\n  kresult = (*(cInterface->interface))->USBInterfaceOpen(cInterface->interface);\n  if (kresult) {\n    usbi_err (HANDLE_CTX (dev_handle), \"USBInterfaceOpen: %s\", darwin_error_str(kresult));\n    return darwin_to_libusb (kresult);\n  }\n\n  /* update list of endpoints */\n  kresult = get_endpoints (dev_handle, iface);\n  if (kresult) {\n    /* this should not happen */\n    darwin_release_interface (dev_handle, iface);\n    usbi_err (HANDLE_CTX (dev_handle), \"could not build endpoint table\");\n    return kresult;\n  }\n\n  cInterface->cfSource = NULL;\n\n  /* create async event source */\n  kresult = (*(cInterface->interface))->CreateInterfaceAsyncEventSource (cInterface->interface, &cInterface->cfSource);\n  if (kresult != kIOReturnSuccess) {\n    usbi_err (HANDLE_CTX (dev_handle), \"could not create async event source\");\n\n    /* can't continue without an async event source */\n    (void)darwin_release_interface (dev_handle, iface);\n\n    return darwin_to_libusb (kresult);\n  }\n\n  /* add the cfSource to the async thread's run loop */\n  CFRunLoopAddSource(libusb_darwin_acfl, cInterface->cfSource, kCFRunLoopDefaultMode);\n\n  usbi_dbg (\"interface opened\");\n\n  return 0;\n}\n\nstatic int darwin_release_interface(struct libusb_device_handle *dev_handle, int iface) {\n  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;\n  IOReturn kresult;\n\n  /* current interface */\n  struct darwin_interface *cInterface = &priv->interfaces[iface];\n\n  /* Check to see if an interface is open */\n  if (!cInterface->interface)\n    return LIBUSB_SUCCESS;\n\n  /* clean up endpoint data */\n  cInterface->num_endpoints = 0;\n\n  /* delete the interface's async event source */\n  if (cInterface->cfSource) {\n    CFRunLoopRemoveSource (libusb_darwin_acfl, cInterface->cfSource, kCFRunLoopDefaultMode);\n    CFRelease (cInterface->cfSource);\n  }\n\n  kresult = (*(cInterface->interface))->USBInterfaceClose(cInterface->interface);\n  if (kresult)\n    usbi_warn (HANDLE_CTX (dev_handle), \"USBInterfaceClose: %s\", darwin_error_str(kresult));\n\n  kresult = (*(cInterface->interface))->Release(cInterface->interface);\n  if (kresult != kIOReturnSuccess)\n    usbi_warn (HANDLE_CTX (dev_handle), \"Release: %s\", darwin_error_str(kresult));\n\n  cInterface->interface = IO_OBJECT_NULL;\n\n  return darwin_to_libusb (kresult);\n}\n\nstatic int darwin_set_interface_altsetting(struct libusb_device_handle *dev_handle, int iface, int altsetting) {\n  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;\n  IOReturn kresult;\n\n  /* current interface */\n  struct darwin_interface *cInterface = &priv->interfaces[iface];\n\n  if (!cInterface->interface)\n    return LIBUSB_ERROR_NO_DEVICE;\n\n  kresult = (*(cInterface->interface))->SetAlternateInterface (cInterface->interface, altsetting);\n  if (kresult != kIOReturnSuccess)\n    darwin_reset_device (dev_handle);\n\n  /* update list of endpoints */\n  kresult = get_endpoints (dev_handle, iface);\n  if (kresult) {\n    /* this should not happen */\n    darwin_release_interface (dev_handle, iface);\n    usbi_err (HANDLE_CTX (dev_handle), \"could not build endpoint table\");\n    return kresult;\n  }\n\n  return darwin_to_libusb (kresult);\n}\n\nstatic int darwin_clear_halt(struct libusb_device_handle *dev_handle, unsigned char endpoint) {\n  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)dev_handle->os_priv;\n\n  /* current interface */\n  struct darwin_interface *cInterface;\n  uint8_t pipeRef, iface;\n  IOReturn kresult;\n\n  /* determine the interface/endpoint to use */\n  if (ep_to_pipeRef (dev_handle, endpoint, &pipeRef, &iface) != 0) {\n    usbi_err (HANDLE_CTX (dev_handle), \"endpoint not found on any open interface\");\n\n    return LIBUSB_ERROR_NOT_FOUND;\n  }\n\n  cInterface = &priv->interfaces[iface];\n\n  /* newer versions of darwin support clearing additional bits on the device's endpoint */\n  kresult = (*(cInterface->interface))->ClearPipeStallBothEnds(cInterface->interface, pipeRef);\n  if (kresult)\n    usbi_warn (HANDLE_CTX (dev_handle), \"ClearPipeStall: %s\", darwin_error_str (kresult));\n\n  return darwin_to_libusb (kresult);\n}\n\nstatic int darwin_reset_device(struct libusb_device_handle *dev_handle) {\n  struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);\n  IOUSBDeviceDescriptor descriptor;\n  IOUSBConfigurationDescriptorPtr cached_configuration;\n  IOUSBConfigurationDescriptor configuration;\n  bool reenumerate = false;\n  IOReturn kresult;\n  int i;\n\n  kresult = (*(dpriv->device))->ResetDevice (dpriv->device);\n  if (kresult) {\n    usbi_err (HANDLE_CTX (dev_handle), \"ResetDevice: %s\", darwin_error_str (kresult));\n    return darwin_to_libusb (kresult);\n  }\n\n  do {\n    usbi_dbg (\"darwin/reset_device: checking if device descriptor changed\");\n\n    /* ignore return code. if we can't get a descriptor it might be worthwhile re-enumerating anway */\n    (void) darwin_request_descriptor (dpriv->device, kUSBDeviceDesc, 0, &descriptor, sizeof (descriptor));\n\n    /* check if the device descriptor has changed */\n    if (0 != memcmp (&dpriv->dev_descriptor, &descriptor, sizeof (descriptor))) {\n      reenumerate = true;\n      break;\n    }\n\n    /* check if any configuration descriptor has changed */\n    for (i = 0 ; i < descriptor.bNumConfigurations ; ++i) {\n      usbi_dbg (\"darwin/reset_device: checking if configuration descriptor %d changed\", i);\n\n      (void) darwin_request_descriptor (dpriv->device, kUSBConfDesc, i, &configuration, sizeof (configuration));\n      (*(dpriv->device))->GetConfigurationDescriptorPtr (dpriv->device, i, &cached_configuration);\n\n      if (!cached_configuration || 0 != memcmp (cached_configuration, &configuration, sizeof (configuration))) {\n        reenumerate = true;\n        break;\n      }\n    }\n  } while (0);\n\n  if (reenumerate) {\n    usbi_dbg (\"darwin/reset_device: device requires reenumeration\");\n    (void) (*(dpriv->device))->USBDeviceReEnumerate (dpriv->device, 0);\n    return LIBUSB_ERROR_NOT_FOUND;\n  }\n\n  usbi_dbg (\"darwin/reset_device: device reset complete\");\n\n  return LIBUSB_SUCCESS;\n}\n\nstatic int darwin_kernel_driver_active(struct libusb_device_handle *dev_handle, int interface) {\n  struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);\n  io_service_t usbInterface;\n  CFTypeRef driver;\n  IOReturn kresult;\n\n  kresult = darwin_get_interface (dpriv->device, interface, &usbInterface);\n  if (kresult) {\n    usbi_err (HANDLE_CTX (dev_handle), \"darwin_get_interface: %s\", darwin_error_str(kresult));\n\n    return darwin_to_libusb (kresult);\n  }\n\n  driver = IORegistryEntryCreateCFProperty (usbInterface, kIOBundleIdentifierKey, kCFAllocatorDefault, 0);\n  IOObjectRelease (usbInterface);\n\n  if (driver) {\n    CFRelease (driver);\n\n    return 1;\n  }\n\n  /* no driver */\n  return 0;\n}\n\n/* attaching/detaching kernel drivers is not currently supported (maybe in the future?) */\nstatic int darwin_attach_kernel_driver (struct libusb_device_handle *dev_handle, int interface) {\n  (void)dev_handle;\n  (void)interface;\n  return LIBUSB_ERROR_NOT_SUPPORTED;\n}\n\nstatic int darwin_detach_kernel_driver (struct libusb_device_handle *dev_handle, int interface) {\n  (void)dev_handle;\n  (void)interface;\n  return LIBUSB_ERROR_NOT_SUPPORTED;\n}\n\nstatic void darwin_destroy_device(struct libusb_device *dev) {\n  struct darwin_device_priv *dpriv = (struct darwin_device_priv *) dev->os_priv;\n\n  if (dpriv->dev) {\n    /* need to hold the lock in case this is the last reference to the device */\n    usbi_mutex_lock(&darwin_cached_devices_lock);\n    darwin_deref_cached_device (dpriv->dev);\n    dpriv->dev = NULL;\n    usbi_mutex_unlock(&darwin_cached_devices_lock);\n  }\n}\n\nstatic int submit_bulk_transfer(struct usbi_transfer *itransfer) {\n  struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;\n\n  IOReturn               ret;\n  uint8_t                transferType;\n  /* None of the values below are used in libusb for bulk transfers */\n  uint8_t                direction, number, interval, pipeRef, iface;\n  uint16_t               maxPacketSize;\n\n  struct darwin_interface *cInterface;\n\n  if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) {\n    usbi_err (TRANSFER_CTX (transfer), \"endpoint not found on any open interface\");\n\n    return LIBUSB_ERROR_NOT_FOUND;\n  }\n\n  cInterface = &priv->interfaces[iface];\n\n  ret = (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pipeRef, &direction, &number,\n                                                       &transferType, &maxPacketSize, &interval);\n\n  if (ret) {\n    usbi_err (TRANSFER_CTX (transfer), \"bulk transfer failed (dir = %s): %s (code = 0x%08x)\", IS_XFERIN(transfer) ? \"In\" : \"Out\",\n              darwin_error_str(ret), ret);\n    return darwin_to_libusb (ret);\n  }\n\n  if (0 != (transfer->length % maxPacketSize)) {\n    /* do not need a zero packet */\n    transfer->flags &= ~LIBUSB_TRANSFER_ADD_ZERO_PACKET;\n  }\n\n  /* submit the request */\n  /* timeouts are unavailable on interrupt endpoints */\n  if (transferType == kUSBInterrupt) {\n    if (IS_XFERIN(transfer))\n      ret = (*(cInterface->interface))->ReadPipeAsync(cInterface->interface, pipeRef, transfer->buffer,\n                                                      transfer->length, darwin_async_io_callback, itransfer);\n    else\n      ret = (*(cInterface->interface))->WritePipeAsync(cInterface->interface, pipeRef, transfer->buffer,\n                                                       transfer->length, darwin_async_io_callback, itransfer);\n  } else {\n    itransfer->flags |= USBI_TRANSFER_OS_HANDLES_TIMEOUT;\n\n    if (IS_XFERIN(transfer))\n      ret = (*(cInterface->interface))->ReadPipeAsyncTO(cInterface->interface, pipeRef, transfer->buffer,\n                                                        transfer->length, transfer->timeout, transfer->timeout,\n                                                        darwin_async_io_callback, (void *)itransfer);\n    else\n      ret = (*(cInterface->interface))->WritePipeAsyncTO(cInterface->interface, pipeRef, transfer->buffer,\n                                                         transfer->length, transfer->timeout, transfer->timeout,\n                                                         darwin_async_io_callback, (void *)itransfer);\n  }\n\n  if (ret)\n    usbi_err (TRANSFER_CTX (transfer), \"bulk transfer failed (dir = %s): %s (code = 0x%08x)\", IS_XFERIN(transfer) ? \"In\" : \"Out\",\n               darwin_error_str(ret), ret);\n\n  return darwin_to_libusb (ret);\n}\n\nstatic int submit_iso_transfer(struct usbi_transfer *itransfer) {\n  struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n  struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;\n\n  IOReturn kresult;\n  uint8_t direction, number, interval, pipeRef, iface, transferType;\n  uint16_t maxPacketSize;\n  UInt64 frame;\n  AbsoluteTime atTime;\n  int i;\n\n  struct darwin_interface *cInterface;\n\n  /* construct an array of IOUSBIsocFrames, reuse the old one if possible */\n  if (tpriv->isoc_framelist && tpriv->num_iso_packets != transfer->num_iso_packets) {\n    free(tpriv->isoc_framelist);\n    tpriv->isoc_framelist = NULL;\n  }\n\n  if (!tpriv->isoc_framelist) {\n    tpriv->num_iso_packets = transfer->num_iso_packets;\n    tpriv->isoc_framelist = (IOUSBIsocFrame*) calloc (transfer->num_iso_packets, sizeof(IOUSBIsocFrame));\n    if (!tpriv->isoc_framelist)\n      return LIBUSB_ERROR_NO_MEM;\n  }\n\n  /* copy the frame list from the libusb descriptor (the structures differ only is member order) */\n  for (i = 0 ; i < transfer->num_iso_packets ; i++)\n    tpriv->isoc_framelist[i].frReqCount = transfer->iso_packet_desc[i].length;\n\n  /* determine the interface/endpoint to use */\n  if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) {\n    usbi_err (TRANSFER_CTX (transfer), \"endpoint not found on any open interface\");\n\n    return LIBUSB_ERROR_NOT_FOUND;\n  }\n\n  cInterface = &priv->interfaces[iface];\n\n  /* determine the properties of this endpoint and the speed of the device */\n  (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pipeRef, &direction, &number,\n                                                 &transferType, &maxPacketSize, &interval);\n\n  /* Last but not least we need the bus frame number */\n  kresult = (*(cInterface->interface))->GetBusFrameNumber(cInterface->interface, &frame, &atTime);\n  if (kresult) {\n    usbi_err (TRANSFER_CTX (transfer), \"failed to get bus frame number: %d\", kresult);\n    free(tpriv->isoc_framelist);\n    tpriv->isoc_framelist = NULL;\n\n    return darwin_to_libusb (kresult);\n  }\n\n  (*(cInterface->interface))->GetPipeProperties (cInterface->interface, pipeRef, &direction, &number,\n                                                 &transferType, &maxPacketSize, &interval);\n\n  /* schedule for a frame a little in the future */\n  frame += 4;\n\n  if (cInterface->frames[transfer->endpoint] && frame < cInterface->frames[transfer->endpoint])\n    frame = cInterface->frames[transfer->endpoint];\n\n  /* submit the request */\n  if (IS_XFERIN(transfer))\n    kresult = (*(cInterface->interface))->ReadIsochPipeAsync(cInterface->interface, pipeRef, transfer->buffer, frame,\n                                                             transfer->num_iso_packets, tpriv->isoc_framelist, darwin_async_io_callback,\n                                                             itransfer);\n  else\n    kresult = (*(cInterface->interface))->WriteIsochPipeAsync(cInterface->interface, pipeRef, transfer->buffer, frame,\n                                                              transfer->num_iso_packets, tpriv->isoc_framelist, darwin_async_io_callback,\n                                                              itransfer);\n\n  if (LIBUSB_SPEED_FULL == transfer->dev_handle->dev->speed)\n    /* Full speed */\n    cInterface->frames[transfer->endpoint] = frame + transfer->num_iso_packets * (1 << (interval - 1));\n  else\n    /* High/super speed */\n    cInterface->frames[transfer->endpoint] = frame + transfer->num_iso_packets * (1 << (interval - 1)) / 8;\n\n  if (kresult != kIOReturnSuccess) {\n    usbi_err (TRANSFER_CTX (transfer), \"isochronous transfer failed (dir: %s): %s\", IS_XFERIN(transfer) ? \"In\" : \"Out\",\n               darwin_error_str(kresult));\n    free (tpriv->isoc_framelist);\n    tpriv->isoc_framelist = NULL;\n  }\n\n  return darwin_to_libusb (kresult);\n}\n\nstatic int submit_control_transfer(struct usbi_transfer *itransfer) {\n  struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n  struct libusb_control_setup *setup = (struct libusb_control_setup *) transfer->buffer;\n  struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(transfer->dev_handle->dev);\n  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;\n  struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\n  IOReturn               kresult;\n\n  bzero(&tpriv->req, sizeof(tpriv->req));\n\n  /* IOUSBDeviceInterface expects the request in cpu endianess */\n  tpriv->req.bmRequestType     = setup->bmRequestType;\n  tpriv->req.bRequest          = setup->bRequest;\n  /* these values should be in bus order from libusb_fill_control_setup */\n  tpriv->req.wValue            = OSSwapLittleToHostInt16 (setup->wValue);\n  tpriv->req.wIndex            = OSSwapLittleToHostInt16 (setup->wIndex);\n  tpriv->req.wLength           = OSSwapLittleToHostInt16 (setup->wLength);\n  /* data is stored after the libusb control block */\n  tpriv->req.pData             = transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE;\n  tpriv->req.completionTimeout = transfer->timeout;\n  tpriv->req.noDataTimeout     = transfer->timeout;\n\n  itransfer->flags |= USBI_TRANSFER_OS_HANDLES_TIMEOUT;\n\n  /* all transfers in libusb-1.0 are async */\n\n  if (transfer->endpoint) {\n    struct darwin_interface *cInterface;\n    uint8_t                 pipeRef, iface;\n\n    if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) {\n      usbi_err (TRANSFER_CTX (transfer), \"endpoint not found on any open interface\");\n\n      return LIBUSB_ERROR_NOT_FOUND;\n    }\n\n    cInterface = &priv->interfaces[iface];\n\n    kresult = (*(cInterface->interface))->ControlRequestAsyncTO (cInterface->interface, pipeRef, &(tpriv->req), darwin_async_io_callback, itransfer);\n  } else\n    /* control request on endpoint 0 */\n    kresult = (*(dpriv->device))->DeviceRequestAsyncTO(dpriv->device, &(tpriv->req), darwin_async_io_callback, itransfer);\n\n  if (kresult != kIOReturnSuccess)\n    usbi_err (TRANSFER_CTX (transfer), \"control request failed: %s\", darwin_error_str(kresult));\n\n  return darwin_to_libusb (kresult);\n}\n\nstatic int darwin_submit_transfer(struct usbi_transfer *itransfer) {\n  struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n  switch (transfer->type) {\n  case LIBUSB_TRANSFER_TYPE_CONTROL:\n    return submit_control_transfer(itransfer);\n  case LIBUSB_TRANSFER_TYPE_BULK:\n  case LIBUSB_TRANSFER_TYPE_INTERRUPT:\n    return submit_bulk_transfer(itransfer);\n  case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n    return submit_iso_transfer(itransfer);\n  default:\n    usbi_err (TRANSFER_CTX(transfer), \"unknown endpoint type %d\", transfer->type);\n    return LIBUSB_ERROR_INVALID_PARAM;\n  }\n}\n\nstatic int cancel_control_transfer(struct usbi_transfer *itransfer) {\n  struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n  struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(transfer->dev_handle->dev);\n  IOReturn kresult;\n\n  usbi_warn (ITRANSFER_CTX (itransfer), \"aborting all transactions control pipe\");\n\n  if (!dpriv->device)\n    return LIBUSB_ERROR_NO_DEVICE;\n\n  kresult = (*(dpriv->device))->USBDeviceAbortPipeZero (dpriv->device);\n\n  return darwin_to_libusb (kresult);\n}\n\nstatic int darwin_abort_transfers (struct usbi_transfer *itransfer) {\n  struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n  struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(transfer->dev_handle->dev);\n  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;\n  struct darwin_interface *cInterface;\n  uint8_t pipeRef, iface;\n  IOReturn kresult;\n\n  if (ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface) != 0) {\n    usbi_err (TRANSFER_CTX (transfer), \"endpoint not found on any open interface\");\n\n    return LIBUSB_ERROR_NOT_FOUND;\n  }\n\n  cInterface = &priv->interfaces[iface];\n\n  if (!dpriv->device)\n    return LIBUSB_ERROR_NO_DEVICE;\n\n  usbi_warn (ITRANSFER_CTX (itransfer), \"aborting all transactions on interface %d pipe %d\", iface, pipeRef);\n\n  /* abort transactions */\n  (*(cInterface->interface))->AbortPipe (cInterface->interface, pipeRef);\n\n  usbi_dbg (\"calling clear pipe stall to clear the data toggle bit\");\n\n  /* newer versions of darwin support clearing additional bits on the device's endpoint */\n  kresult = (*(cInterface->interface))->ClearPipeStallBothEnds(cInterface->interface, pipeRef);\n\n  return darwin_to_libusb (kresult);\n}\n\nstatic int darwin_cancel_transfer(struct usbi_transfer *itransfer) {\n  struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n  switch (transfer->type) {\n  case LIBUSB_TRANSFER_TYPE_CONTROL:\n    return cancel_control_transfer(itransfer);\n  case LIBUSB_TRANSFER_TYPE_BULK:\n  case LIBUSB_TRANSFER_TYPE_INTERRUPT:\n  case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n    return darwin_abort_transfers (itransfer);\n  default:\n    usbi_err (TRANSFER_CTX(transfer), \"unknown endpoint type %d\", transfer->type);\n    return LIBUSB_ERROR_INVALID_PARAM;\n  }\n}\n\nstatic void darwin_clear_transfer_priv (struct usbi_transfer *itransfer) {\n  struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n  struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\n  if (transfer->type == LIBUSB_TRANSFER_TYPE_ISOCHRONOUS && tpriv->isoc_framelist) {\n    free (tpriv->isoc_framelist);\n    tpriv->isoc_framelist = NULL;\n  }\n}\n\nstatic void darwin_async_io_callback (void *refcon, IOReturn result, void *arg0) {\n  struct usbi_transfer *itransfer = (struct usbi_transfer *)refcon;\n  struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n  struct darwin_device_handle_priv *priv = (struct darwin_device_handle_priv *)transfer->dev_handle->os_priv;\n  struct darwin_msg_async_io_complete message = {.itransfer = itransfer, .result = result,\n                                                 .size = (UInt32) (uintptr_t) arg0};\n\n  usbi_dbg (\"an async io operation has completed\");\n\n  /* if requested write a zero packet */\n  if (kIOReturnSuccess == result && IS_XFEROUT(transfer) && transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET) {\n    struct darwin_interface *cInterface;\n    uint8_t iface, pipeRef;\n\n    (void) ep_to_pipeRef (transfer->dev_handle, transfer->endpoint, &pipeRef, &iface);\n    cInterface = &priv->interfaces[iface];\n\n    (*(cInterface->interface))->WritePipe (cInterface->interface, pipeRef, transfer->buffer, 0);\n  }\n\n  /* send a completion message to the device's file descriptor */\n  write (priv->fds[1], &message, sizeof (message));\n}\n\nstatic int darwin_transfer_status (struct usbi_transfer *itransfer, kern_return_t result) {\n  if (itransfer->flags & USBI_TRANSFER_TIMED_OUT)\n    result = kIOUSBTransactionTimeout;\n\n  switch (result) {\n  case kIOReturnUnderrun:\n  case kIOReturnSuccess:\n    return LIBUSB_TRANSFER_COMPLETED;\n  case kIOReturnAborted:\n    return LIBUSB_TRANSFER_CANCELLED;\n  case kIOUSBPipeStalled:\n    usbi_dbg (\"transfer error: pipe is stalled\");\n    return LIBUSB_TRANSFER_STALL;\n  case kIOReturnOverrun:\n    usbi_warn (ITRANSFER_CTX (itransfer), \"transfer error: data overrun\");\n    return LIBUSB_TRANSFER_OVERFLOW;\n  case kIOUSBTransactionTimeout:\n    usbi_warn (ITRANSFER_CTX (itransfer), \"transfer error: timed out\");\n    itransfer->flags |= USBI_TRANSFER_TIMED_OUT;\n    return LIBUSB_TRANSFER_TIMED_OUT;\n  default:\n    usbi_warn (ITRANSFER_CTX (itransfer), \"transfer error: %s (value = 0x%08x)\", darwin_error_str (result), result);\n    return LIBUSB_TRANSFER_ERROR;\n  }\n}\n\nstatic void darwin_handle_callback (struct usbi_transfer *itransfer, kern_return_t result, UInt32 io_size) {\n  struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n  struct darwin_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n  int isIsoc      = LIBUSB_TRANSFER_TYPE_ISOCHRONOUS == transfer->type;\n  int isBulk      = LIBUSB_TRANSFER_TYPE_BULK == transfer->type;\n  int isControl   = LIBUSB_TRANSFER_TYPE_CONTROL == transfer->type;\n  int isInterrupt = LIBUSB_TRANSFER_TYPE_INTERRUPT == transfer->type;\n  int i;\n\n  if (!isIsoc && !isBulk && !isControl && !isInterrupt) {\n    usbi_err (TRANSFER_CTX(transfer), \"unknown endpoint type %d\", transfer->type);\n    return;\n  }\n\n  usbi_dbg (\"handling %s completion with kernel status %d\",\n             isControl ? \"control\" : isBulk ? \"bulk\" : isIsoc ? \"isoc\" : \"interrupt\", result);\n\n  if (kIOReturnSuccess == result || kIOReturnUnderrun == result) {\n    if (isIsoc && tpriv->isoc_framelist) {\n      /* copy isochronous results back */\n\n      for (i = 0; i < transfer->num_iso_packets ; i++) {\n        struct libusb_iso_packet_descriptor *lib_desc = &transfer->iso_packet_desc[i];\n        lib_desc->status = darwin_to_libusb (tpriv->isoc_framelist[i].frStatus);\n        lib_desc->actual_length = tpriv->isoc_framelist[i].frActCount;\n      }\n    } else if (!isIsoc)\n      itransfer->transferred += io_size;\n  }\n\n  /* it is ok to handle cancelled transfers without calling usbi_handle_transfer_cancellation (we catch timeout transfers) */\n  usbi_handle_transfer_completion (itransfer, darwin_transfer_status (itransfer, result));\n}\n\nstatic int op_handle_events(struct libusb_context *ctx, struct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready) {\n  struct darwin_msg_async_io_complete message;\n  POLL_NFDS_TYPE i = 0;\n  ssize_t ret;\n\n  usbi_mutex_lock(&ctx->open_devs_lock);\n\n  for (i = 0; i < nfds && num_ready > 0; i++) {\n    struct pollfd *pollfd = &fds[i];\n\n    usbi_dbg (\"checking fd %i with revents = %x\", pollfd->fd, pollfd->revents);\n\n    if (!pollfd->revents)\n      continue;\n\n    num_ready--;\n\n    if (pollfd->revents & POLLERR) {\n      /* this probably will never happen so ignore the error an move on. */\n      continue;\n    }\n\n    /* there is only one type of message */\n    ret = read (pollfd->fd, &message, sizeof (message));\n    if (ret < (ssize_t) sizeof (message)) {\n      usbi_dbg (\"WARNING: short read on async io completion pipe\\n\");\n      continue;\n    }\n\n    darwin_handle_callback (message.itransfer, message.result, message.size);\n  }\n\n  usbi_mutex_unlock(&ctx->open_devs_lock);\n\n  return 0;\n}\n\nstatic int darwin_clock_gettime(int clk_id, struct timespec *tp) {\n  mach_timespec_t sys_time;\n  clock_serv_t clock_ref;\n\n  switch (clk_id) {\n  case USBI_CLOCK_REALTIME:\n    /* CLOCK_REALTIME represents time since the epoch */\n    clock_ref = clock_realtime;\n    break;\n  case USBI_CLOCK_MONOTONIC:\n    /* use system boot time as reference for the monotonic clock */\n    clock_ref = clock_monotonic;\n    break;\n  default:\n    return LIBUSB_ERROR_INVALID_PARAM;\n  }\n\n  clock_get_time (clock_ref, &sys_time);\n\n  tp->tv_sec  = sys_time.tv_sec;\n  tp->tv_nsec = sys_time.tv_nsec;\n\n  return 0;\n}\n\nconst struct usbi_os_backend darwin_backend = {\n        .name = \"Darwin\",\n        .caps = 0,\n        .init = darwin_init,\n        .exit = darwin_exit,\n        .get_device_list = NULL, /* not needed */\n        .get_device_descriptor = darwin_get_device_descriptor,\n        .get_active_config_descriptor = darwin_get_active_config_descriptor,\n        .get_config_descriptor = darwin_get_config_descriptor,\n\n        .open = darwin_open,\n        .close = darwin_close,\n        .get_configuration = darwin_get_configuration,\n        .set_configuration = darwin_set_configuration,\n        .claim_interface = darwin_claim_interface,\n        .release_interface = darwin_release_interface,\n\n        .set_interface_altsetting = darwin_set_interface_altsetting,\n        .clear_halt = darwin_clear_halt,\n        .reset_device = darwin_reset_device,\n\n        .kernel_driver_active = darwin_kernel_driver_active,\n        .detach_kernel_driver = darwin_detach_kernel_driver,\n        .attach_kernel_driver = darwin_attach_kernel_driver,\n\n        .destroy_device = darwin_destroy_device,\n\n        .submit_transfer = darwin_submit_transfer,\n        .cancel_transfer = darwin_cancel_transfer,\n        .clear_transfer_priv = darwin_clear_transfer_priv,\n\n        .handle_events = op_handle_events,\n\n        .clock_gettime = darwin_clock_gettime,\n\n        .device_priv_size = sizeof(struct darwin_device_priv),\n        .device_handle_priv_size = sizeof(struct darwin_device_handle_priv),\n        .transfer_priv_size = sizeof(struct darwin_transfer_priv),\n        .add_iso_packet_size = 0,\n};\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/darwin_usb.h",
    "content": "/*\n * darwin backend for libusb 1.0\n * Copyright © 2008-2013 Nathan Hjelm <hjelmn@users.sourceforge.net>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#if !defined(LIBUSB_DARWIN_H)\n#define LIBUSB_DARWIN_H\n\n#include \"libusbi.h\"\n\n#include <IOKit/IOTypes.h>\n#include <IOKit/IOCFBundle.h>\n#include <IOKit/usb/IOUSBLib.h>\n#include <IOKit/IOCFPlugIn.h>\n\n/* IOUSBInterfaceInferface */\n#if defined (kIOUSBInterfaceInterfaceID550)\n\n#define usb_interface_t IOUSBInterfaceInterface550\n#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID550\n#define InterfaceVersion 550\n\n#elif defined (kIOUSBInterfaceInterfaceID500)\n\n#define usb_interface_t IOUSBInterfaceInterface500\n#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID500\n#define InterfaceVersion 500\n\n#elif defined (kIOUSBInterfaceInterfaceID300)\n\n#define usb_interface_t IOUSBInterfaceInterface300\n#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID300\n#define InterfaceVersion 300\n\n#elif defined (kIOUSBInterfaceInterfaceID245)\n\n#define usb_interface_t IOUSBInterfaceInterface245\n#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID245\n#define InterfaceVersion 245\n\n#elif defined (kIOUSBInterfaceInterfaceID220)\n\n#define usb_interface_t IOUSBInterfaceInterface220\n#define InterfaceInterfaceID kIOUSBInterfaceInterfaceID220\n#define InterfaceVersion 220\n\n#else\n\n#error \"IOUSBFamily is too old. Please upgrade your OS\"\n\n#endif\n\n/* IOUSBDeviceInterface */\n#if defined (kIOUSBDeviceInterfaceID500)\n\n#define usb_device_t    IOUSBDeviceInterface500\n#define DeviceInterfaceID kIOUSBDeviceInterfaceID500\n#define DeviceVersion 500\n\n#elif defined (kIOUSBDeviceInterfaceID320)\n\n#define usb_device_t    IOUSBDeviceInterface320\n#define DeviceInterfaceID kIOUSBDeviceInterfaceID320\n#define DeviceVersion 320\n\n#elif defined (kIOUSBDeviceInterfaceID300)\n\n#define usb_device_t    IOUSBDeviceInterface300\n#define DeviceInterfaceID kIOUSBDeviceInterfaceID300\n#define DeviceVersion 300\n\n#elif defined (kIOUSBDeviceInterfaceID245)\n\n#define usb_device_t    IOUSBDeviceInterface245\n#define DeviceInterfaceID kIOUSBDeviceInterfaceID245\n#define DeviceVersion 245\n\n#elif defined (kIOUSBDeviceInterfaceID220)\n#define usb_device_t    IOUSBDeviceInterface197\n#define DeviceInterfaceID kIOUSBDeviceInterfaceID197\n#define DeviceVersion 197\n\n#else\n\n#error \"IOUSBFamily is too old. Please upgrade your OS\"\n\n#endif\n\n#if !defined(IO_OBJECT_NULL)\n#define IO_OBJECT_NULL ((io_object_t) 0)\n#endif\n\ntypedef IOCFPlugInInterface *io_cf_plugin_ref_t;\ntypedef IONotificationPortRef io_notification_port_t;\n\n/* private structures */\nstruct darwin_cached_device {\n  struct list_head      list;\n  IOUSBDeviceDescriptor dev_descriptor;\n  UInt32                location;\n  UInt64                parent_session;\n  UInt64                session;\n  UInt16                address;\n  char                  sys_path[21];\n  usb_device_t        **device;\n  int                   open_count;\n  UInt8                 first_config, active_config, port;  \n  int                   can_enumerate;\n  int                   refcount;\n};\n\nstruct darwin_device_priv {\n  struct darwin_cached_device *dev;\n};\n\nstruct darwin_device_handle_priv {\n  int                  is_open;\n  CFRunLoopSourceRef   cfSource;\n  int                  fds[2];\n\n  struct darwin_interface {\n    usb_interface_t    **interface;\n    uint8_t              num_endpoints;\n    CFRunLoopSourceRef   cfSource;\n    uint64_t             frames[256];\n    uint8_t            endpoint_addrs[USB_MAXENDPOINTS];\n  } interfaces[USB_MAXINTERFACES];\n};\n\nstruct darwin_transfer_priv {\n  /* Isoc */\n  IOUSBIsocFrame *isoc_framelist;\n  int num_iso_packets;\n\n  /* Control */\n  IOUSBDevRequestTO req;\n\n  /* Bulk */\n};\n\n/* structure for signaling io completion */\nstruct darwin_msg_async_io_complete {\n  struct usbi_transfer *itransfer;\n  IOReturn result;\n  UInt32 size;\n};\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/linux_netlink.c",
    "content": "/* -*- Mode: C; c-basic-offset:8 ; indent-tabs-mode:t -*- */\n/*\n * Linux usbfs backend for libusb\n * Copyright (C) 2007-2009 Daniel Drake <dsd@gentoo.org>\n * Copyright (c) 2001 Johannes Erdfelt <johannes@erdfelt.com>\n * Copyright (c) 2013 Nathan Hjelm <hjelmn@mac.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"config.h\"\n#include \"libusb.h\"\n#include \"libusbi.h\"\n#include \"linux_usbfs.h\"\n\n#include <ctype.h>\n#include <dirent.h>\n#include <errno.h>\n#include <fcntl.h>\n#include <poll.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/types.h>\n\n#ifdef HAVE_ASM_TYPES_H\n#include <asm/types.h>\n#endif\n\n#ifdef HAVE_SYS_SOCKET_H\n#include <sys/socket.h>\n#endif\n\n#include <arpa/inet.h>\n\n#ifdef HAVE_LINUX_NETLINK_H\n#include <linux/netlink.h>\n#endif\n\n#ifdef HAVE_LINUX_FILTER_H\n#include <linux/filter.h>\n#endif\n\n#define KERNEL 1\n\nstatic int linux_netlink_socket = -1;\nstatic int netlink_control_pipe[2] = { -1, -1 };\nstatic pthread_t libusb_linux_event_thread;\n\nstatic void *linux_netlink_event_thread_main(void *arg);\n\nstruct sockaddr_nl snl = { .nl_family=AF_NETLINK, .nl_groups=KERNEL };\n\nstatic int set_fd_cloexec_nb (int fd)\n{\n\tint flags;\n\n#if defined(FD_CLOEXEC)\n\tflags = fcntl (linux_netlink_socket, F_GETFD);\n\tif (0 > flags) {\n\t\treturn -1;\n\t}\n\n\tif (!(flags & FD_CLOEXEC)) {\n\t\tfcntl (linux_netlink_socket, F_SETFD, flags | FD_CLOEXEC);\n\t}\n#endif\n\n\tflags = fcntl (linux_netlink_socket, F_GETFL);\n\tif (0 > flags) {\n\t\treturn -1;\n\t}\n\n\tif (!(flags & O_NONBLOCK)) {\n\t\tfcntl (linux_netlink_socket, F_SETFL, flags | O_NONBLOCK);\n\t}\n\n\treturn 0;\n}\n\nint linux_netlink_start_event_monitor(void)\n{\n\tint socktype = SOCK_RAW;\n\tint ret;\n\n\tsnl.nl_groups = KERNEL;\n\n#if defined(SOCK_CLOEXEC)\n\tsocktype |= SOCK_CLOEXEC;\n#endif\n#if defined(SOCK_NONBLOCK)\n\tsocktype |= SOCK_NONBLOCK;\n#endif\n\n\tlinux_netlink_socket = socket(PF_NETLINK, socktype, NETLINK_KOBJECT_UEVENT);\n\tif (-1 == linux_netlink_socket && EINVAL == errno) {\n\t\tlinux_netlink_socket = socket(PF_NETLINK, SOCK_RAW, NETLINK_KOBJECT_UEVENT);\n\t}\n\n\tif (-1 == linux_netlink_socket) {\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\tret = set_fd_cloexec_nb (linux_netlink_socket);\n\tif (0 != ret) {\n\t\tclose (linux_netlink_socket);\n\t\tlinux_netlink_socket = -1;\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\tret = bind(linux_netlink_socket, (struct sockaddr *) &snl, sizeof(snl));\n\tif (0 != ret) {\n\t        close(linux_netlink_socket);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\t/* TODO -- add authentication */\n\t/* setsockopt(linux_netlink_socket, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)); */\n\n\tret = usbi_pipe(netlink_control_pipe);\n\tif (ret) {\n\t\tusbi_err(NULL, \"could not create netlink control pipe\");\n\t        close(linux_netlink_socket);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\tret = pthread_create(&libusb_linux_event_thread, NULL, linux_netlink_event_thread_main, NULL);\n\tif (0 != ret) {\n        \tclose(netlink_control_pipe[0]);\n        \tclose(netlink_control_pipe[1]);\n\t        close(linux_netlink_socket);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nint linux_netlink_stop_event_monitor(void)\n{\n\tint r;\n\tchar dummy = 1;\n\n\tif (-1 == linux_netlink_socket) {\n\t\t/* already closed. nothing to do */\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\t/* Write some dummy data to the control pipe and\n\t * wait for the thread to exit */\n\tr = usbi_write(netlink_control_pipe[1], &dummy, sizeof(dummy));\n\tif (r <= 0) {\n\t\tusbi_warn(NULL, \"netlink control pipe signal failed\");\n\t}\n\tpthread_join(libusb_linux_event_thread, NULL);\n\n\tclose(linux_netlink_socket);\n\tlinux_netlink_socket = -1;\n\n\t/* close and reset control pipe */\n\tclose(netlink_control_pipe[0]);\n\tclose(netlink_control_pipe[1]);\n\tnetlink_control_pipe[0] = -1;\n\tnetlink_control_pipe[1] = -1;\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic const char *netlink_message_parse (const char *buffer, size_t len, const char *key)\n{\n\tsize_t keylen = strlen(key);\n\tsize_t offset;\n\n\tfor (offset = 0 ; offset < len && '\\0' != buffer[offset] ; offset += strlen(buffer + offset) + 1) {\n\t\tif (0 == strncmp(buffer + offset, key, keylen) &&\n\t\t    '=' == buffer[offset + keylen]) {\n\t\t\treturn buffer + offset + keylen + 1;\n\t\t}\n\t}\n\n\treturn NULL;\n}\n\n/* parse parts of netlink message common to both libudev and the kernel */\nstatic int linux_netlink_parse(char *buffer, size_t len, int *detached, const char **sys_name,\n\t\t\t       uint8_t *busnum, uint8_t *devaddr) {\n\tconst char *tmp;\n\tint i;\n\n\terrno = 0;\n\n\t*sys_name = NULL;\n\t*detached = 0;\n\t*busnum   = 0;\n\t*devaddr  = 0;\n\n\ttmp = netlink_message_parse((const char *) buffer, len, \"ACTION\");\n\tif (tmp == NULL)\n\t\treturn -1;\n\tif (0 == strcmp(tmp, \"remove\")) {\n\t\t*detached = 1;\n\t} else if (0 != strcmp(tmp, \"add\")) {\n\t\tusbi_dbg(\"unknown device action %s\", tmp);\n\t\treturn -1;\n\t}\n\n\t/* check that this is a usb message */\n\ttmp = netlink_message_parse(buffer, len, \"SUBSYSTEM\");\n\tif (NULL == tmp || 0 != strcmp(tmp, \"usb\")) {\n\t\t/* not usb. ignore */\n\t\treturn -1;\n\t}\n\n\ttmp = netlink_message_parse(buffer, len, \"BUSNUM\");\n\tif (NULL == tmp) {\n\t\t/* no bus number. try \"DEVICE\" */\n\t\ttmp = netlink_message_parse(buffer, len, \"DEVICE\");\n\t\tif (NULL == tmp) {\n\t\t\t/* not usb. ignore */\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\t/* Parse a device path such as /dev/bus/usb/003/004 */\n\t\tchar *pLastSlash = (char*)strrchr(tmp,'/');\n\t\tif(NULL == pLastSlash) {\n\t\t\treturn -1;\n\t\t}\n\n\t\t*devaddr = strtoul(pLastSlash + 1, NULL, 10);\n\t\tif (errno) {\n\t\t\terrno = 0;\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\t*busnum = strtoul(pLastSlash - 3, NULL, 10);\n\t\tif (errno) {\n\t\t\terrno = 0;\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\treturn 0;\n\t}\n\n\t*busnum = (uint8_t)(strtoul(tmp, NULL, 10) & 0xff);\n\tif (errno) {\n\t\terrno = 0;\n\t\treturn -1;\n\t}\n\n\ttmp = netlink_message_parse(buffer, len, \"DEVNUM\");\n\tif (NULL == tmp) {\n\t\treturn -1;\n\t}\n\n\t*devaddr = (uint8_t)(strtoul(tmp, NULL, 10) & 0xff);\n\tif (errno) {\n\t\terrno = 0;\n\t\treturn -1;\n\t}\n\n\ttmp = netlink_message_parse(buffer, len, \"DEVPATH\");\n\tif (NULL == tmp) {\n\t\treturn -1;\n\t}\n\n\tfor (i = strlen(tmp) - 1 ; i ; --i) {\n\t\tif ('/' ==tmp[i]) {\n\t\t\t*sys_name = tmp + i + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* found a usb device */\n\treturn 0;\n}\n\nstatic int linux_netlink_read_message(void)\n{\n\tunsigned char buffer[1024];\n\tstruct iovec iov = {.iov_base = buffer, .iov_len = sizeof(buffer)};\n\tstruct msghdr meh = { .msg_iov=&iov, .msg_iovlen=1,\n\t\t\t     .msg_name=&snl, .msg_namelen=sizeof(snl) };\n\tconst char *sys_name = NULL;\n\tuint8_t busnum, devaddr;\n\tint detached, r;\n\tsize_t len;\n\n\t/* read netlink message */\n\tmemset(buffer, 0, sizeof(buffer));\n\tlen = recvmsg(linux_netlink_socket, &meh, 0);\n\tif (len < 32) {\n\t\tif (errno != EAGAIN)\n\t\t\tusbi_dbg(\"error recieving message from netlink\");\n\t\treturn -1;\n\t}\n\n\t/* TODO -- authenticate this message is from the kernel or udevd */\n\n\tr = linux_netlink_parse(buffer, len, &detached, &sys_name,\n\t\t\t\t&busnum, &devaddr);\n\tif (r)\n\t\treturn r;\n\n\tusbi_dbg(\"netlink hotplug found device busnum: %hhu, devaddr: %hhu, sys_name: %s, removed: %s\",\n\t\t busnum, devaddr, sys_name, detached ? \"yes\" : \"no\");\n\n\t/* signal device is available (or not) to all contexts */\n\tif (detached)\n\t\tlinux_device_disconnected(busnum, devaddr, sys_name);\n\telse\n\t\tlinux_hotplug_enumerate(busnum, devaddr, sys_name);\n\n\treturn 0;\n}\n\nstatic void *linux_netlink_event_thread_main(void *arg)\n{\n\tchar dummy;\n\tint r;\n\tstruct pollfd fds[] = {\n\t\t{ .fd = netlink_control_pipe[0],\n\t\t  .events = POLLIN },\n\t\t{ .fd = linux_netlink_socket,\n\t\t  .events = POLLIN },\n\t};\n\n\t/* silence compiler warning */\n\t(void) arg;\n\n\twhile (poll(fds, 2, -1) >= 0) {\n\t\tif (fds[0].revents & POLLIN) {\n\t\t\t/* activity on control pipe, read the byte and exit */\n\t\t\tr = usbi_read(netlink_control_pipe[0], &dummy, sizeof(dummy));\n\t\t\tif (r <= 0) {\n\t\t\t\tusbi_warn(NULL, \"netlink control pipe read failed\");\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tif (fds[1].revents & POLLIN) {\n        \t\tusbi_mutex_static_lock(&linux_hotplug_lock);\n\t        \tlinux_netlink_read_message();\n\t        \tusbi_mutex_static_unlock(&linux_hotplug_lock);\n\t\t}\n\t}\n\n\treturn NULL;\n}\n\nvoid linux_netlink_hotplug_poll(void)\n{\n\tint r;\n\n\tusbi_mutex_static_lock(&linux_hotplug_lock);\n\tdo {\n\t\tr = linux_netlink_read_message();\n\t} while (r == 0);\n\tusbi_mutex_static_unlock(&linux_hotplug_lock);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/linux_udev.c",
    "content": "/* -*- Mode: C; c-basic-offset:8 ; indent-tabs-mode:t -*- */\n/*\n * Linux usbfs backend for libusb\n * Copyright (C) 2007-2009 Daniel Drake <dsd@gentoo.org>\n * Copyright (c) 2001 Johannes Erdfelt <johannes@erdfelt.com>\n * Copyright (c) 2012-2013 Nathan Hjelm <hjelmn@mac.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"config.h\"\n\n#include <assert.h>\n#include <ctype.h>\n#include <dirent.h>\n#include <errno.h>\n#include <fcntl.h>\n#include <poll.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/ioctl.h>\n#include <sys/stat.h>\n#include <sys/types.h>\n#include <sys/utsname.h>\n#include <sys/socket.h>\n#include <unistd.h>\n#include <libudev.h>\n\n#include \"libusb.h\"\n#include \"libusbi.h\"\n#include \"linux_usbfs.h\"\n\n/* udev context */\nstatic struct udev *udev_ctx = NULL;\nstatic int udev_monitor_fd = -1;\nstatic int udev_control_pipe[2] = {-1, -1};\nstatic struct udev_monitor *udev_monitor = NULL;\nstatic pthread_t linux_event_thread;\n\nstatic void udev_hotplug_event(struct udev_device* udev_dev);\nstatic void *linux_udev_event_thread_main(void *arg);\n\nint linux_udev_start_event_monitor(void)\n{\n\tint r;\n\n\tassert(udev_ctx == NULL);\n\tudev_ctx = udev_new();\n\tif (!udev_ctx) {\n\t\tusbi_err(NULL, \"could not create udev context\");\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\tudev_monitor = udev_monitor_new_from_netlink(udev_ctx, \"udev\");\n\tif (!udev_monitor) {\n\t\tusbi_err(NULL, \"could not initialize udev monitor\");\n\t\tgoto err_free_ctx;\n\t}\n\n\tr = udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, \"usb\", 0);\n\tif (r) {\n\t\tusbi_err(NULL, \"could not initialize udev monitor filter for \\\"usb\\\" subsystem\");\n\t\tgoto err_free_monitor;\n\t}\n\n\tif (udev_monitor_enable_receiving(udev_monitor)) {\n\t\tusbi_err(NULL, \"failed to enable the udev monitor\");\n\t\tgoto err_free_monitor;\n\t}\n\n\tudev_monitor_fd = udev_monitor_get_fd(udev_monitor);\n\n\t/* Some older versions of udev are not non-blocking by default,\n\t * so make sure this is set */\n\tr = fcntl(udev_monitor_fd, F_GETFL);\n\tif (r == -1) {\n\t\tusbi_err(NULL, \"getting udev monitor fd flags (%d)\", errno);\n\t\tgoto err_free_monitor;\n\t}\n\tr = fcntl(udev_monitor_fd, F_SETFL, r | O_NONBLOCK);\n\tif (r) {\n\t\tusbi_err(NULL, \"setting udev monitor fd flags (%d)\", errno);\n\t\tgoto err_free_monitor;\n\t}\n\n\tr = usbi_pipe(udev_control_pipe);\n\tif (r) {\n\t\tusbi_err(NULL, \"could not create udev control pipe\");\n\t\tgoto err_free_monitor;\n\t}\n\n\tr = pthread_create(&linux_event_thread, NULL, linux_udev_event_thread_main, NULL);\n\tif (r) {\n\t\tusbi_err(NULL, \"creating hotplug event thread (%d)\", r);\n\t\tgoto err_close_pipe;\n\t}\n\n\treturn LIBUSB_SUCCESS;\n\nerr_close_pipe:\n\tclose(udev_control_pipe[0]);\n\tclose(udev_control_pipe[1]);\nerr_free_monitor:\n\tudev_monitor_unref(udev_monitor);\n\tudev_monitor = NULL;\n\tudev_monitor_fd = -1;\nerr_free_ctx:\n\tudev_unref(udev_ctx);\n\tudev_ctx = NULL;\n\treturn LIBUSB_ERROR_OTHER;\n}\n\nint linux_udev_stop_event_monitor(void)\n{\n\tchar dummy = 1;\n\tint r;\n\n\tassert(udev_ctx != NULL);\n\tassert(udev_monitor != NULL);\n\tassert(udev_monitor_fd != -1);\n\n\t/* Write some dummy data to the control pipe and\n\t * wait for the thread to exit */\n\tr = usbi_write(udev_control_pipe[1], &dummy, sizeof(dummy));\n\tif (r <= 0) {\n\t\tusbi_warn(NULL, \"udev control pipe signal failed\");\n\t}\n\tpthread_join(linux_event_thread, NULL);\n\n\t/* Release the udev monitor */\n\tudev_monitor_unref(udev_monitor);\n\tudev_monitor = NULL;\n\tudev_monitor_fd = -1;\n\n\t/* Clean up the udev context */\n\tudev_unref(udev_ctx);\n\tudev_ctx = NULL;\n\n\t/* close and reset control pipe */\n\tclose(udev_control_pipe[0]);\n\tclose(udev_control_pipe[1]);\n\tudev_control_pipe[0] = -1;\n\tudev_control_pipe[1] = -1;\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic void *linux_udev_event_thread_main(void *arg)\n{\n\tchar dummy;\n\tint r;\n\tstruct udev_device* udev_dev;\n\tstruct pollfd fds[] = {\n\t\t{.fd = udev_control_pipe[0],\n\t\t .events = POLLIN},\n\t\t{.fd = udev_monitor_fd,\n\t\t .events = POLLIN},\n\t};\n\n\tusbi_dbg(\"udev event thread entering.\");\n\n\twhile (poll(fds, 2, -1) >= 0) {\n\t\tif (fds[0].revents & POLLIN) {\n\t\t\t/* activity on control pipe, read the byte and exit */\n\t\t\tr = usbi_read(udev_control_pipe[0], &dummy, sizeof(dummy));\n\t\t\tif (r <= 0) {\n\t\t\t\tusbi_warn(NULL, \"udev control pipe read failed\");\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tif (fds[1].revents & POLLIN) {\n\t\t\tusbi_mutex_static_lock(&linux_hotplug_lock);\n\t\t\tudev_dev = udev_monitor_receive_device(udev_monitor);\n\t\t\tif (udev_dev)\n\t\t\t\tudev_hotplug_event(udev_dev);\n\t\t\tusbi_mutex_static_unlock(&linux_hotplug_lock);\n\t\t}\n\t}\n\n\tusbi_dbg(\"udev event thread exiting\");\n\n\treturn NULL;\n}\n\nstatic int udev_device_info(struct libusb_context *ctx, int detached,\n\t\t\t    struct udev_device *udev_dev, uint8_t *busnum,\n\t\t\t    uint8_t *devaddr, const char **sys_name) {\n\tconst char *dev_node;\n\n\tdev_node = udev_device_get_devnode(udev_dev);\n\tif (!dev_node) {\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\t*sys_name = udev_device_get_sysname(udev_dev);\n\tif (!*sys_name) {\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\treturn linux_get_device_address(ctx, detached, busnum, devaddr,\n\t\t\t\t\tdev_node, *sys_name);\n}\n\nstatic void udev_hotplug_event(struct udev_device* udev_dev)\n{\n\tconst char* udev_action;\n\tconst char* sys_name = NULL;\n\tuint8_t busnum = 0, devaddr = 0;\n\tint detached;\n\tint r;\n\n\tdo {\n\t\tudev_action = udev_device_get_action(udev_dev);\n\t\tif (!udev_action) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdetached = !strncmp(udev_action, \"remove\", 6);\n\n\t\tr = udev_device_info(NULL, detached, udev_dev, &busnum, &devaddr, &sys_name);\n\t\tif (LIBUSB_SUCCESS != r) {\n\t\t\tbreak;\n\t\t}\n\n\t\tusbi_dbg(\"udev hotplug event. action: %s.\", udev_action);\n\n\t\tif (strncmp(udev_action, \"add\", 3) == 0) {\n\t\t\tlinux_hotplug_enumerate(busnum, devaddr, sys_name);\n\t\t} else if (detached) {\n\t\t\tlinux_device_disconnected(busnum, devaddr, sys_name);\n\t\t} else {\n\t\t\tusbi_err(NULL, \"ignoring udev action %s\", udev_action);\n\t\t}\n\t} while (0);\n\n\tudev_device_unref(udev_dev);\n}\n\nint linux_udev_scan_devices(struct libusb_context *ctx)\n{\n\tstruct udev_enumerate *enumerator;\n\tstruct udev_list_entry *devices, *entry;\n\tstruct udev_device *udev_dev;\n\tconst char *sys_name;\n\tint r;\n\n\tassert(udev_ctx != NULL);\n\n\tenumerator = udev_enumerate_new(udev_ctx);\n\tif (NULL == enumerator) {\n\t\tusbi_err(ctx, \"error creating udev enumerator\");\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\tudev_enumerate_add_match_subsystem(enumerator, \"usb\");\n\tudev_enumerate_scan_devices(enumerator);\n\tdevices = udev_enumerate_get_list_entry(enumerator);\n\n\tudev_list_entry_foreach(entry, devices) {\n\t\tconst char *path = udev_list_entry_get_name(entry);\n\t\tuint8_t busnum = 0, devaddr = 0;\n\n\t\tudev_dev = udev_device_new_from_syspath(udev_ctx, path);\n\n\t\tr = udev_device_info(ctx, 0, udev_dev, &busnum, &devaddr, &sys_name);\n\t\tif (r) {\n\t\t\tudev_device_unref(udev_dev);\n\t\t\tcontinue;\n\t\t}\n\n\t\tlinux_enumerate_device(ctx, busnum, devaddr, sys_name);\n\t\tudev_device_unref(udev_dev);\n\t}\n\n\tudev_enumerate_unref(enumerator);\n\n\treturn LIBUSB_SUCCESS;\n}\n\nvoid linux_udev_hotplug_poll(void)\n{\n\tstruct udev_device* udev_dev;\n\n\tusbi_mutex_static_lock(&linux_hotplug_lock);\n\tdo {\n\t\tudev_dev = udev_monitor_receive_device(udev_monitor);\n\t\tif (udev_dev) {\n\t\t\tusbi_dbg(\"Handling hotplug event from hotplug_poll\");\n\t\t\tudev_hotplug_event(udev_dev);\n\t\t}\n\t} while (udev_dev);\n\tusbi_mutex_static_unlock(&linux_hotplug_lock);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/linux_usbfs.c",
    "content": "/* -*- Mode: C; c-basic-offset:8 ; indent-tabs-mode:t -*- */\n/*\n * Linux usbfs backend for libusb\n * Copyright © 2007-2009 Daniel Drake <dsd@gentoo.org>\n * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>\n * Copyright © 2013 Nathan Hjelm <hjelmn@mac.com>\n * Copyright © 2012-2013 Hans de Goede <hdegoede@redhat.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"config.h\"\n\n#include <assert.h>\n#include <ctype.h>\n#include <dirent.h>\n#include <errno.h>\n#include <fcntl.h>\n#include <poll.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/ioctl.h>\n#include <sys/stat.h>\n#include <sys/types.h>\n#include <sys/utsname.h>\n#include <unistd.h>\n\n#include \"libusb.h\"\n#include \"libusbi.h\"\n#include \"linux_usbfs.h\"\n\n/* sysfs vs usbfs:\n * opening a usbfs node causes the device to be resumed, so we attempt to\n * avoid this during enumeration.\n *\n * sysfs allows us to read the kernel's in-memory copies of device descriptors\n * and so forth, avoiding the need to open the device:\n *  - The binary \"descriptors\" file contains all config descriptors since\n *    2.6.26, commit 217a9081d8e69026186067711131b77f0ce219ed\n *  - The binary \"descriptors\" file was added in 2.6.23, commit\n *    69d42a78f935d19384d1f6e4f94b65bb162b36df, but it only contains the\n *    active config descriptors\n *  - The \"busnum\" file was added in 2.6.22, commit\n *    83f7d958eab2fbc6b159ee92bf1493924e1d0f72\n *  - The \"devnum\" file has been present since pre-2.6.18\n *  - the \"bConfigurationValue\" file has been present since pre-2.6.18\n *\n * If we have bConfigurationValue, busnum, and devnum, then we can determine\n * the active configuration without having to open the usbfs node in RDWR mode.\n * The busnum file is important as that is the only way we can relate sysfs\n * devices to usbfs nodes.\n *\n * If we also have all descriptors, we can obtain the device descriptor and\n * configuration without touching usbfs at all.\n */\n\n/* endianness for multi-byte fields:\n *\n * Descriptors exposed by usbfs have the multi-byte fields in the device\n * descriptor as host endian. Multi-byte fields in the other descriptors are\n * bus-endian. The kernel documentation says otherwise, but it is wrong.\n *\n * In sysfs all descriptors are bus-endian.\n */\n\nstatic const char *usbfs_path = NULL;\n\n/* use usbdev*.* device names in /dev instead of the usbfs bus directories */\nstatic int usbdev_names = 0;\n\n/* Linux 2.6.32 adds support for a bulk continuation URB flag. this basically\n * allows us to mark URBs as being part of a specific logical transfer when\n * we submit them to the kernel. then, on any error except a cancellation, all\n * URBs within that transfer will be cancelled and no more URBs will be\n * accepted for the transfer, meaning that no more data can creep in.\n *\n * The BULK_CONTINUATION flag must be set on all URBs within a bulk transfer\n * (in either direction) except the first.\n * For IN transfers, we must also set SHORT_NOT_OK on all URBs except the\n * last; it means that the kernel should treat a short reply as an error.\n * For OUT transfers, SHORT_NOT_OK must not be set. it isn't needed (OUT\n * transfers can't be short unless there's already some sort of error), and\n * setting this flag is disallowed (a kernel with USB debugging enabled will\n * reject such URBs).\n */\nstatic int supports_flag_bulk_continuation = -1;\n\n/* Linux 2.6.31 fixes support for the zero length packet URB flag. This\n * allows us to mark URBs that should be followed by a zero length data\n * packet, which can be required by device- or class-specific protocols.\n */\nstatic int supports_flag_zero_packet = -1;\n\n/* clock ID for monotonic clock, as not all clock sources are available on all\n * systems. appropriate choice made at initialization time. */\nstatic clockid_t monotonic_clkid = -1;\n\n/* Linux 2.6.22 (commit 83f7d958eab2fbc6b159ee92bf1493924e1d0f72) adds a busnum\n * to sysfs, so we can relate devices. This also implies that we can read\n * the active configuration through bConfigurationValue */\nstatic int sysfs_can_relate_devices = -1;\n\n/* Linux 2.6.26 (commit 217a9081d8e69026186067711131b77f0ce219ed) adds all\n * config descriptors (rather then just the active config) to the sysfs\n * descriptors file, so from then on we can use them. */\nstatic int sysfs_has_descriptors = -1;\n\n/* how many times have we initted (and not exited) ? */\nstatic volatile int init_count = 0;\n\n/* Serialize hotplug start/stop */\nusbi_mutex_static_t linux_hotplug_startstop_lock = USBI_MUTEX_INITIALIZER;\n/* Serialize scan-devices, event-thread, and poll */\nusbi_mutex_static_t linux_hotplug_lock = USBI_MUTEX_INITIALIZER;\n\nstatic int linux_start_event_monitor(void);\nstatic int linux_stop_event_monitor(void);\nstatic int linux_scan_devices(struct libusb_context *ctx);\nstatic int sysfs_scan_device(struct libusb_context *ctx, const char *devname);\nstatic int detach_kernel_driver_and_claim(struct libusb_device_handle *, int);\n\n#if !defined(USE_UDEV)\nstatic int linux_default_scan_devices (struct libusb_context *ctx);\n#endif\n\nstruct linux_device_priv {\n\tchar *sysfs_dir;\n\tunsigned char *descriptors;\n\tint descriptors_len;\n\tint active_config; /* cache val for !sysfs_can_relate_devices  */\n};\n\nstruct linux_device_handle_priv {\n\tint fd;\n\tuint32_t caps;\n};\n\nenum reap_action {\n\tNORMAL = 0,\n\t/* submission failed after the first URB, so await cancellation/completion\n\t * of all the others */\n\tSUBMIT_FAILED,\n\n\t/* cancelled by user or timeout */\n\tCANCELLED,\n\n\t/* completed multi-URB transfer in non-final URB */\n\tCOMPLETED_EARLY,\n\n\t/* one or more urbs encountered a low-level error */\n\tERROR,\n};\n\nstruct linux_transfer_priv {\n\tunion {\n\t\tstruct usbfs_urb *urbs;\n\t\tstruct usbfs_urb **iso_urbs;\n\t};\n\n\tenum reap_action reap_action;\n\tint num_urbs;\n\tint num_retired;\n\tenum libusb_transfer_status reap_status;\n\n\t/* next iso packet in user-supplied transfer to be populated */\n\tint iso_packet_offset;\n};\n\nstatic int _get_usbfs_fd(struct libusb_device *dev, mode_t mode, int silent)\n{\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\tchar path[PATH_MAX];\n\tint fd;\n\tint delay = 10000;\n\n\tif (usbdev_names)\n\t\tsnprintf(path, PATH_MAX, \"%s/usbdev%d.%d\",\n\t\t\tusbfs_path, dev->bus_number, dev->device_address);\n\telse\n\t\tsnprintf(path, PATH_MAX, \"%s/%03d/%03d\",\n\t\t\tusbfs_path, dev->bus_number, dev->device_address);\n\n\tfd = open(path, mode);\n\tif (fd != -1)\n\t\treturn fd; /* Success */\n\n\tif (errno == ENOENT) {\n\t\tif (!silent) \n\t\t\tusbi_err(ctx, \"File doesn't exist, wait %d ms and try again\\n\", delay/1000);\n   \n\t\t/* Wait 10ms for USB device path creation.*/\n\t\tusleep(delay);\n\n\t\tfd = open(path, mode);\n\t\tif (fd != -1)\n\t\t\treturn fd; /* Success */\n\t}\n\t\n\tif (!silent) {\n\t\tusbi_err(ctx, \"libusb couldn't open USB device %s: %s\",\n\t\t\t path, strerror(errno));\n\t\tif (errno == EACCES && mode == O_RDWR)\n\t\t\tusbi_err(ctx, \"libusb requires write access to USB \"\n\t\t\t\t      \"device nodes.\");\n\t}\n\n\tif (errno == EACCES)\n\t\treturn LIBUSB_ERROR_ACCESS;\n\tif (errno == ENOENT)\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\treturn LIBUSB_ERROR_IO;\n}\n\nstatic struct linux_device_priv *_device_priv(struct libusb_device *dev)\n{\n\treturn (struct linux_device_priv *) dev->os_priv;\n}\n\nstatic struct linux_device_handle_priv *_device_handle_priv(\n\tstruct libusb_device_handle *handle)\n{\n\treturn (struct linux_device_handle_priv *) handle->os_priv;\n}\n\n/* check dirent for a /dev/usbdev%d.%d name\n * optionally return bus/device on success */\nstatic int _is_usbdev_entry(struct dirent *entry, int *bus_p, int *dev_p)\n{\n\tint busnum, devnum;\n\n\tif (sscanf(entry->d_name, \"usbdev%d.%d\", &busnum, &devnum) != 2)\n\t\treturn 0;\n\n\tusbi_dbg(\"found: %s\", entry->d_name);\n\tif (bus_p != NULL)\n\t\t*bus_p = busnum;\n\tif (dev_p != NULL)\n\t\t*dev_p = devnum;\n\treturn 1;\n}\n\nstatic int check_usb_vfs(const char *dirname)\n{\n\tDIR *dir;\n\tstruct dirent *entry;\n\tint found = 0;\n\n\tdir = opendir(dirname);\n\tif (!dir)\n\t\treturn 0;\n\n\twhile ((entry = readdir(dir)) != NULL) {\n\t\tif (entry->d_name[0] == '.')\n\t\t\tcontinue;\n\n\t\t/* We assume if we find any files that it must be the right place */\n\t\tfound = 1;\n\t\tbreak;\n\t}\n\n\tclosedir(dir);\n\treturn found;\n}\n\nstatic const char *find_usbfs_path(void)\n{\n\tconst char *path = \"/dev/bus/usb\";\n\tconst char *ret = NULL;\n\n\tif (check_usb_vfs(path)) {\n\t\tret = path;\n\t} else {\n\t\tpath = \"/proc/bus/usb\";\n\t\tif (check_usb_vfs(path))\n\t\t\tret = path;\n\t}\n\n\t/* look for /dev/usbdev*.* if the normal places fail */\n\tif (ret == NULL) {\n\t\tstruct dirent *entry;\n\t\tDIR *dir;\n\n\t\tpath = \"/dev\";\n\t\tdir = opendir(path);\n\t\tif (dir != NULL) {\n\t\t\twhile ((entry = readdir(dir)) != NULL) {\n\t\t\t\tif (_is_usbdev_entry(entry, NULL, NULL)) {\n\t\t\t\t\t/* found one; that's enough */\n\t\t\t\t\tret = path;\n\t\t\t\t\tusbdev_names = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir(dir);\n\t\t}\n\t}\n\n\tif (ret != NULL)\n\t\tusbi_dbg(\"found usbfs at %s\", ret);\n\n\treturn ret;\n}\n\n/* the monotonic clock is not usable on all systems (e.g. embedded ones often\n * seem to lack it). fall back to REALTIME if we have to. */\nstatic clockid_t find_monotonic_clock(void)\n{\n#ifdef CLOCK_MONOTONIC\n\tstruct timespec ts;\n\tint r;\n\n\t/* Linux 2.6.28 adds CLOCK_MONOTONIC_RAW but we don't use it\n\t * because it's not available through timerfd */\n\tr = clock_gettime(CLOCK_MONOTONIC, &ts);\n\tif (r == 0)\n\t\treturn CLOCK_MONOTONIC;\n\tusbi_dbg(\"monotonic clock doesn't work, errno %d\", errno);\n#endif\n\n\treturn CLOCK_REALTIME;\n}\n\nstatic int kernel_version_ge(int major, int minor, int sublevel)\n{\n\tstruct utsname uts;\n\tint atoms, kmajor, kminor, ksublevel;\n\n\tif (uname(&uts) < 0)\n\t\treturn -1;\n\tatoms = sscanf(uts.release, \"%d.%d.%d\", &kmajor, &kminor, &ksublevel);\n\tif (atoms < 1)\n\t\treturn -1;\n\n\tif (kmajor > major)\n\t\treturn 1;\n\tif (kmajor < major)\n\t\treturn 0;\n\n\t/* kmajor == major */\n\tif (atoms < 2)\n\t\treturn 0 == minor && 0 == sublevel;\n\tif (kminor > minor)\n\t\treturn 1;\n\tif (kminor < minor)\n\t\treturn 0;\n\n\t/* kminor == minor */\n\tif (atoms < 3)\n\t\treturn 0 == sublevel;\n\n\treturn ksublevel >= sublevel;\n}\n\nstatic int op_init(struct libusb_context *ctx)\n{\n\tstruct stat statbuf;\n\tint r;\n\n\tusbfs_path = find_usbfs_path();\n\tif (!usbfs_path) {\n\t\tusbi_err(ctx, \"could not find usbfs\");\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\tif (monotonic_clkid == -1)\n\t\tmonotonic_clkid = find_monotonic_clock();\n\n\tif (supports_flag_bulk_continuation == -1) {\n\t\t/* bulk continuation URB flag available from Linux 2.6.32 */\n\t\tsupports_flag_bulk_continuation = kernel_version_ge(2,6,32);\n\t\tif (supports_flag_bulk_continuation == -1) {\n\t\t\tusbi_err(ctx, \"error checking for bulk continuation support\");\n\t\t\treturn LIBUSB_ERROR_OTHER;\n\t\t}\n\t}\n\n\tif (supports_flag_bulk_continuation)\n\t\tusbi_dbg(\"bulk continuation flag supported\");\n\n\tif (-1 == supports_flag_zero_packet) {\n\t\t/* zero length packet URB flag fixed since Linux 2.6.31 */\n\t\tsupports_flag_zero_packet = kernel_version_ge(2,6,31);\n\t\tif (-1 == supports_flag_zero_packet) {\n\t\t\tusbi_err(ctx, \"error checking for zero length packet support\");\n\t\t\treturn LIBUSB_ERROR_OTHER;\n\t\t}\n\t}\n\n\tif (supports_flag_zero_packet)\n\t\tusbi_dbg(\"zero length packet flag supported\");\n\n\tif (-1 == sysfs_has_descriptors) {\n\t\t/* sysfs descriptors has all descriptors since Linux 2.6.26 */\n\t\tsysfs_has_descriptors = kernel_version_ge(2,6,26);\n\t\tif (-1 == sysfs_has_descriptors) {\n\t\t\tusbi_err(ctx, \"error checking for sysfs descriptors\");\n\t\t\treturn LIBUSB_ERROR_OTHER;\n\t\t}\n\t}\n\n\tif (-1 == sysfs_can_relate_devices) {\n\t\t/* sysfs has busnum since Linux 2.6.22 */\n\t\tsysfs_can_relate_devices = kernel_version_ge(2,6,22);\n\t\tif (-1 == sysfs_can_relate_devices) {\n\t\t\tusbi_err(ctx, \"error checking for sysfs busnum\");\n\t\t\treturn LIBUSB_ERROR_OTHER;\n\t\t}\n\t}\n\n\tif (sysfs_can_relate_devices || sysfs_has_descriptors) {\n\t\tr = stat(SYSFS_DEVICE_PATH, &statbuf);\n\t\tif (r != 0 || !S_ISDIR(statbuf.st_mode)) {\n\t\t\tusbi_warn(ctx, \"sysfs not mounted\");\n\t\t\tsysfs_can_relate_devices = 0;\n\t\t\tsysfs_has_descriptors = 0;\n\t\t}\n\t}\n\n\tif (sysfs_can_relate_devices)\n\t\tusbi_dbg(\"sysfs can relate devices\");\n\n\tif (sysfs_has_descriptors)\n\t\tusbi_dbg(\"sysfs has complete descriptors\");\n\n\tusbi_mutex_static_lock(&linux_hotplug_startstop_lock);\n\tr = LIBUSB_SUCCESS;\n\tif (init_count == 0) {\n\t\t/* start up hotplug event handler */\n\t\tr = linux_start_event_monitor();\n\t}\n\tif (r == LIBUSB_SUCCESS) {\n\t\tr = linux_scan_devices(ctx);\n\t\tif (r == LIBUSB_SUCCESS)\n\t\t\tinit_count++;\n\t\telse if (init_count == 0)\n\t\t\tlinux_stop_event_monitor();\n\t} else\n\t\tusbi_err(ctx, \"error starting hotplug event monitor\");\n\tusbi_mutex_static_unlock(&linux_hotplug_startstop_lock);\n\n\treturn r;\n}\n\nstatic void op_exit(void)\n{\n\tusbi_mutex_static_lock(&linux_hotplug_startstop_lock);\n\tassert(init_count != 0);\n\tif (!--init_count) {\n\t\t/* tear down event handler */\n\t\t(void)linux_stop_event_monitor();\n\t}\n\tusbi_mutex_static_unlock(&linux_hotplug_startstop_lock);\n}\n\nstatic int linux_start_event_monitor(void)\n{\n#if defined(USE_UDEV)\n\treturn linux_udev_start_event_monitor();\n#else\n\treturn linux_netlink_start_event_monitor();\n#endif\n}\n\nstatic int linux_stop_event_monitor(void)\n{\n#if defined(USE_UDEV)\n\treturn linux_udev_stop_event_monitor();\n#else\n\treturn linux_netlink_stop_event_monitor();\n#endif\n}\n\nstatic int linux_scan_devices(struct libusb_context *ctx)\n{\n\tint ret;\n\n\tusbi_mutex_static_lock(&linux_hotplug_lock);\n\n#if defined(USE_UDEV)\n\tret = linux_udev_scan_devices(ctx);\n#else\n\tret = linux_default_scan_devices(ctx);\n#endif\n\n\tusbi_mutex_static_unlock(&linux_hotplug_lock);\n\n\treturn ret;\n}\n\nstatic void op_hotplug_poll(void)\n{\n#if defined(USE_UDEV)\n\tlinux_udev_hotplug_poll();\n#else\n\tlinux_netlink_hotplug_poll();\n#endif\n}\n\nstatic int _open_sysfs_attr(struct libusb_device *dev, const char *attr)\n{\n\tstruct linux_device_priv *priv = _device_priv(dev);\n\tchar filename[PATH_MAX];\n\tint fd;\n\n\tsnprintf(filename, PATH_MAX, \"%s/%s/%s\",\n\t\tSYSFS_DEVICE_PATH, priv->sysfs_dir, attr);\n\tfd = open(filename, O_RDONLY);\n\tif (fd < 0) {\n\t\tusbi_err(DEVICE_CTX(dev),\n\t\t\t\"open %s failed ret=%d errno=%d\", filename, fd, errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\treturn fd;\n}\n\n/* Note only suitable for attributes which always read >= 0, < 0 is error */\nstatic int __read_sysfs_attr(struct libusb_context *ctx,\n\tconst char *devname, const char *attr)\n{\n\tchar filename[PATH_MAX];\n\tFILE *f;\n\tint r, value;\n\n\tsnprintf(filename, PATH_MAX, \"%s/%s/%s\", SYSFS_DEVICE_PATH,\n\t\t devname, attr);\n\tf = fopen(filename, \"r\");\n\tif (f == NULL) {\n\t\tif (errno == ENOENT) {\n\t\t\t/* File doesn't exist. Assume the device has been\n\t\t\t   disconnected (see trac ticket #70). */\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t\t}\n\t\tusbi_err(ctx, \"open %s failed errno=%d\", filename, errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tr = fscanf(f, \"%d\", &value);\n\tfclose(f);\n\tif (r != 1) {\n\t\tusbi_err(ctx, \"fscanf %s returned %d, errno=%d\", attr, r, errno);\n\t\treturn LIBUSB_ERROR_NO_DEVICE; /* For unplug race (trac #70) */\n\t}\n\tif (value < 0) {\n\t\tusbi_err(ctx, \"%s contains a negative value\", filename);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\treturn value;\n}\n\nstatic int op_get_device_descriptor(struct libusb_device *dev,\n\tunsigned char *buffer, int *host_endian)\n{\n\tstruct linux_device_priv *priv = _device_priv(dev);\n\n\t*host_endian = sysfs_has_descriptors ? 0 : 1;\n\tmemcpy(buffer, priv->descriptors, DEVICE_DESC_LENGTH);\n\n\treturn 0;\n}\n\n/* read the bConfigurationValue for a device */\nstatic int sysfs_get_active_config(struct libusb_device *dev, int *config)\n{\n\tchar *endptr;\n\tchar tmp[5] = {0, 0, 0, 0, 0};\n\tlong num;\n\tint fd;\n\tssize_t r;\n\n\tfd = _open_sysfs_attr(dev, \"bConfigurationValue\");\n\tif (fd < 0)\n\t\treturn fd;\n\n\tr = read(fd, tmp, sizeof(tmp));\n\tclose(fd);\n\tif (r < 0) {\n\t\tusbi_err(DEVICE_CTX(dev),\n\t\t\t\"read bConfigurationValue failed ret=%d errno=%d\", r, errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t} else if (r == 0) {\n\t\tusbi_dbg(\"device unconfigured\");\n\t\t*config = -1;\n\t\treturn 0;\n\t}\n\n\tif (tmp[sizeof(tmp) - 1] != 0) {\n\t\tusbi_err(DEVICE_CTX(dev), \"not null-terminated?\");\n\t\treturn LIBUSB_ERROR_IO;\n\t} else if (tmp[0] == 0) {\n\t\tusbi_err(DEVICE_CTX(dev), \"no configuration value?\");\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tnum = strtol(tmp, &endptr, 10);\n\tif (endptr == tmp) {\n\t\tusbi_err(DEVICE_CTX(dev), \"error converting '%s' to integer\", tmp);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\t*config = (int) num;\n\treturn 0;\n}\n\nint linux_get_device_address (struct libusb_context *ctx, int detached,\n\tuint8_t *busnum, uint8_t *devaddr,const char *dev_node,\n\tconst char *sys_name)\n{\n\tint sysfs_attr;\n\n\tusbi_dbg(\"getting address for device: %s detached: %d\", sys_name, detached);\n\t/* can't use sysfs to read the bus and device number if the\n\t * device has been detached */\n\tif (!sysfs_can_relate_devices || detached || NULL == sys_name) {\n\t\tif (NULL == dev_node) {\n\t\t\treturn LIBUSB_ERROR_OTHER;\n\t\t}\n\n\t\t/* will this work with all supported kernel versions? */\n\t\tif (!strncmp(dev_node, \"/dev/bus/usb\", 12)) {\n\t\t\tsscanf (dev_node, \"/dev/bus/usb/%hhd/%hhd\", busnum, devaddr);\n\t\t} else if (!strncmp(dev_node, \"/proc/bus/usb\", 13)) {\n\t\t\tsscanf (dev_node, \"/proc/bus/usb/%hhd/%hhd\", busnum, devaddr);\n\t\t}\n\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\tusbi_dbg(\"scan %s\", sys_name);\n\n\tsysfs_attr = __read_sysfs_attr(ctx, sys_name, \"busnum\");\n\tif (0 > sysfs_attr)\n\t\treturn sysfs_attr;\n\tif (sysfs_attr > 255)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t*busnum = (uint8_t) sysfs_attr;\n\n\tsysfs_attr = __read_sysfs_attr(ctx, sys_name, \"devnum\");\n\tif (0 > sysfs_attr)\n\t\treturn sysfs_attr;\n\tif (sysfs_attr > 255)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\t*devaddr = (uint8_t) sysfs_attr;\n\n\tusbi_dbg(\"bus=%d dev=%d\", *busnum, *devaddr);\n\n\treturn LIBUSB_SUCCESS;\n}\n\n/* Return offset of the next descriptor with the given type */\nstatic int seek_to_next_descriptor(struct libusb_context *ctx,\n\tuint8_t descriptor_type, unsigned char *buffer, int size)\n{\n\tstruct usb_descriptor_header header;\n\tint i;\n\n\tfor (i = 0; size >= 0; i += header.bLength, size -= header.bLength) {\n\t\tif (size == 0)\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\t\tif (size < 2) {\n\t\t\tusbi_err(ctx, \"short descriptor read %d/2\", size);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t}\n\t\tusbi_parse_descriptor(buffer + i, \"bb\", &header, 0);\n\n\t\tif (i && header.bDescriptorType == descriptor_type)\n\t\t\treturn i;\n\t}\n\tusbi_err(ctx, \"bLength overflow by %d bytes\", -size);\n\treturn LIBUSB_ERROR_IO;\n}\n\n/* Return offset to next config */\nstatic int seek_to_next_config(struct libusb_context *ctx,\n\tunsigned char *buffer, int size)\n{\n\tstruct libusb_config_descriptor config;\n\n\tif (size == 0)\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\tif (size < LIBUSB_DT_CONFIG_SIZE) {\n\t\tusbi_err(ctx, \"short descriptor read %d/%d\",\n\t\t\t size, LIBUSB_DT_CONFIG_SIZE);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tusbi_parse_descriptor(buffer, \"bbwbbbbb\", &config, 0);\n\tif (config.bDescriptorType != LIBUSB_DT_CONFIG) {\n\t\tusbi_err(ctx, \"descriptor is not a config desc (type 0x%02x)\",\n\t\t\t config.bDescriptorType);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\t/*\n\t * In usbfs the config descriptors are config.wTotalLength bytes apart,\n\t * with any short reads from the device appearing as holes in the file.\n\t *\n\t * In sysfs wTotalLength is ignored, instead the kernel returns a\n\t * config descriptor with verified bLength fields, with descriptors\n\t * with an invalid bLength removed.\n\t */\n\tif (sysfs_has_descriptors) {\n\t\tint next = seek_to_next_descriptor(ctx, LIBUSB_DT_CONFIG,\n\t\t\t\t\t\t   buffer, size);\n\t\tif (next == LIBUSB_ERROR_NOT_FOUND)\n\t\t\tnext = size;\n\t\tif (next < 0)\n\t\t\treturn next;\n\n\t\tif (next != config.wTotalLength)\n\t\t\tusbi_warn(ctx, \"config length mismatch wTotalLength \"\n\t\t\t\t  \"%d real %d\", config.wTotalLength, next);\n\t\treturn next;\n\t} else {\n\t\tif (config.wTotalLength < LIBUSB_DT_CONFIG_SIZE) {\n\t\t\tusbi_err(ctx, \"invalid wTotalLength %d\",\n\t\t\t\t config.wTotalLength);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t} else if (config.wTotalLength > size) {\n\t\t\tusbi_warn(ctx, \"short descriptor read %d/%d\",\n\t\t\t\t  size, config.wTotalLength);\n\t\t\treturn size;\n\t\t} else\n\t\t\treturn config.wTotalLength;\n\t}\n}\n\nstatic int op_get_config_descriptor_by_value(struct libusb_device *dev,\n\tuint8_t value, unsigned char **buffer, int *host_endian)\n{\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\tstruct linux_device_priv *priv = _device_priv(dev);\n\tunsigned char *descriptors = priv->descriptors;\n\tint size = priv->descriptors_len;\n\tstruct libusb_config_descriptor *config;\n\n\t*buffer = NULL;\n\t/* Unlike the device desc. config descs. are always in raw format */\n\t*host_endian = 0;\n\n\t/* Skip device header */\n\tdescriptors += DEVICE_DESC_LENGTH;\n\tsize -= DEVICE_DESC_LENGTH;\n\n\t/* Seek till the config is found, or till \"EOF\" */\n\twhile (1) {\n\t\tint next = seek_to_next_config(ctx, descriptors, size);\n\t\tif (next < 0)\n\t\t\treturn next;\n\t\tconfig = (struct libusb_config_descriptor *)descriptors;\n\t\tif (config->bConfigurationValue == value) {\n\t\t\t*buffer = descriptors;\n\t\t\treturn next;\n\t\t}\n\t\tsize -= next;\n\t\tdescriptors += next;\n\t}\n}\n\nstatic int op_get_active_config_descriptor(struct libusb_device *dev,\n\tunsigned char *buffer, size_t len, int *host_endian)\n{\n\tint r, config;\n\tunsigned char *config_desc;\n\n\tif (sysfs_can_relate_devices) {\n\t\tr = sysfs_get_active_config(dev, &config);\n\t\tif (r < 0)\n\t\t\treturn r;\n\t} else {\n\t\t/* Use cached bConfigurationValue */\n\t\tstruct linux_device_priv *priv = _device_priv(dev);\n\t\tconfig = priv->active_config;\n\t}\n\tif (config == -1)\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\tr = op_get_config_descriptor_by_value(dev, config, &config_desc,\n\t\t\t\t\t      host_endian);\n\tif (r < 0)\n\t\treturn r;\n\n\tlen = MIN(len, r);\n\tmemcpy(buffer, config_desc, len);\n\treturn len;\n}\n\nstatic int op_get_config_descriptor(struct libusb_device *dev,\n\tuint8_t config_index, unsigned char *buffer, size_t len, int *host_endian)\n{\n\tstruct linux_device_priv *priv = _device_priv(dev);\n\tunsigned char *descriptors = priv->descriptors;\n\tint i, r, size = priv->descriptors_len;\n\n\t/* Unlike the device desc. config descs. are always in raw format */\n\t*host_endian = 0;\n\n\t/* Skip device header */\n\tdescriptors += DEVICE_DESC_LENGTH;\n\tsize -= DEVICE_DESC_LENGTH;\n\n\t/* Seek till the config is found, or till \"EOF\" */\n\tfor (i = 0; ; i++) {\n\t\tr = seek_to_next_config(DEVICE_CTX(dev), descriptors, size);\n\t\tif (r < 0)\n\t\t\treturn r;\n\t\tif (i == config_index)\n\t\t\tbreak;\n\t\tsize -= r;\n\t\tdescriptors += r;\n\t}\n\n\tlen = MIN(len, r);\n\tmemcpy(buffer, descriptors, len);\n\treturn len;\n}\n\n/* send a control message to retrieve active configuration */\nstatic int usbfs_get_active_config(struct libusb_device *dev, int fd)\n{\n\tunsigned char active_config = 0;\n\tint r;\n\n\tstruct usbfs_ctrltransfer ctrl = {\n\t\t.bmRequestType = LIBUSB_ENDPOINT_IN,\n\t\t.bRequest = LIBUSB_REQUEST_GET_CONFIGURATION,\n\t\t.wValue = 0,\n\t\t.wIndex = 0,\n\t\t.wLength = 1,\n\t\t.timeout = 1000,\n\t\t.data = &active_config\n\t};\n\n\tr = ioctl(fd, IOCTL_USBFS_CONTROL, &ctrl);\n\tif (r < 0) {\n\t\tif (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\t/* we hit this error path frequently with buggy devices :( */\n\t\tusbi_warn(DEVICE_CTX(dev),\n\t\t\t\"get_configuration failed ret=%d errno=%d\", r, errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\treturn active_config;\n}\n\nstatic int initialize_device(struct libusb_device *dev, uint8_t busnum,\n\tuint8_t devaddr, const char *sysfs_dir)\n{\n\tstruct linux_device_priv *priv = _device_priv(dev);\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\tint descriptors_size = 512; /* Begin with a 1024 byte alloc */\n\tint fd, speed;\n\tssize_t r;\n\n\tdev->bus_number = busnum;\n\tdev->device_address = devaddr;\n\n\tif (sysfs_dir) {\n\t\tpriv->sysfs_dir = malloc(strlen(sysfs_dir) + 1);\n\t\tif (!priv->sysfs_dir)\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\tstrcpy(priv->sysfs_dir, sysfs_dir);\n\n\t\t/* Note speed can contain 1.5, in this case __read_sysfs_attr\n\t\t   will stop parsing at the '.' and return 1 */\n\t\tspeed = __read_sysfs_attr(DEVICE_CTX(dev), sysfs_dir, \"speed\");\n\t\tif (speed >= 0) {\n\t\t\tswitch (speed) {\n\t\t\tcase     1: dev->speed = LIBUSB_SPEED_LOW; break;\n\t\t\tcase    12: dev->speed = LIBUSB_SPEED_FULL; break;\n\t\t\tcase   480: dev->speed = LIBUSB_SPEED_HIGH; break;\n\t\t\tcase  5000: dev->speed = LIBUSB_SPEED_SUPER; break;\n\t\t\tdefault:\n\t\t\t\tusbi_warn(DEVICE_CTX(dev), \"Unknown device speed: %d Mbps\", speed);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* cache descriptors in memory */\n\tif (sysfs_has_descriptors)\n\t\tfd = _open_sysfs_attr(dev, \"descriptors\");\n\telse\n\t\tfd = _get_usbfs_fd(dev, O_RDONLY, 0);\n\tif (fd < 0)\n\t\treturn fd;\n\n\tdo {\n\t\tdescriptors_size *= 2;\n\t\tpriv->descriptors = usbi_reallocf(priv->descriptors,\n\t\t\t\t\t\t  descriptors_size);\n\t\tif (!priv->descriptors) {\n\t\t\tclose(fd);\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\t}\n\t\t/* usbfs has holes in the file */\n\t\tif (!sysfs_has_descriptors) {\n\t\t\tmemset(priv->descriptors + priv->descriptors_len,\n\t\t\t       0, descriptors_size - priv->descriptors_len);\n\t\t}\n\t\tr = read(fd, priv->descriptors + priv->descriptors_len,\n\t\t\t descriptors_size - priv->descriptors_len);\n\t\tif (r < 0) {\n\t\t\tusbi_err(ctx, \"read descriptor failed ret=%d errno=%d\",\n\t\t\t\t fd, errno);\n\t\t\tclose(fd);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t}\n\t\tpriv->descriptors_len += r;\n\t} while (priv->descriptors_len == descriptors_size);\n\n\tclose(fd);\n\n\tif (priv->descriptors_len < DEVICE_DESC_LENGTH) {\n\t\tusbi_err(ctx, \"short descriptor read (%d)\",\n\t\t\t priv->descriptors_len);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\tif (sysfs_can_relate_devices)\n\t\treturn LIBUSB_SUCCESS;\n\n\t/* cache active config */\n\tfd = _get_usbfs_fd(dev, O_RDWR, 1);\n\tif (fd < 0) {\n\t\t/* cannot send a control message to determine the active\n\t\t * config. just assume the first one is active. */\n\t\tusbi_warn(ctx, \"Missing rw usbfs access; cannot determine \"\n\t\t\t       \"active configuration descriptor\");\n\t\tif (priv->descriptors_len >=\n\t\t\t\t(DEVICE_DESC_LENGTH + LIBUSB_DT_CONFIG_SIZE)) {\n\t\t\tstruct libusb_config_descriptor config;\n\t\t\tusbi_parse_descriptor(\n\t\t\t\tpriv->descriptors + DEVICE_DESC_LENGTH,\n\t\t\t\t\"bbwbbbbb\", &config, 0);\n\t\t\tpriv->active_config = config.bConfigurationValue;\n\t\t} else\n\t\t\tpriv->active_config = -1; /* No config dt */\n\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\tr = usbfs_get_active_config(dev, fd);\n\tif (r > 0) {\n\t\tpriv->active_config = r;\n\t\tr = LIBUSB_SUCCESS;\n\t} else if (r == 0) {\n\t\t/* some buggy devices have a configuration 0, but we're\n\t\t * reaching into the corner of a corner case here, so let's\n\t\t * not support buggy devices in these circumstances.\n\t\t * stick to the specs: a configuration value of 0 means\n\t\t * unconfigured. */\n\t\tusbi_dbg(\"active cfg 0? assuming unconfigured device\");\n\t\tpriv->active_config = -1;\n\t\tr = LIBUSB_SUCCESS;\n\t} else if (r == LIBUSB_ERROR_IO) {\n\t\t/* buggy devices sometimes fail to report their active config.\n\t\t * assume unconfigured and continue the probing */\n\t\tusbi_warn(ctx, \"couldn't query active configuration, assuming\"\n\t\t\t       \" unconfigured\");\n\t\tpriv->active_config = -1;\n\t\tr = LIBUSB_SUCCESS;\n\t} /* else r < 0, just return the error code */\n\n\tclose(fd);\n\treturn r;\n}\n\nstatic int linux_get_parent_info(struct libusb_device *dev, const char *sysfs_dir)\n{\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\tstruct libusb_device *it;\n\tchar *parent_sysfs_dir, *tmp;\n\tint ret, add_parent = 1;\n\n\t/* XXX -- can we figure out the topology when using usbfs? */\n\tif (NULL == sysfs_dir || 0 == strncmp(sysfs_dir, \"usb\", 3)) {\n\t\t/* either using usbfs or finding the parent of a root hub */\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\tparent_sysfs_dir = strdup(sysfs_dir);\n\tif (NULL != (tmp = strrchr(parent_sysfs_dir, '.')) ||\n\t    NULL != (tmp = strrchr(parent_sysfs_dir, '-'))) {\n\t        dev->port_number = atoi(tmp + 1);\n\t\t*tmp = '\\0';\n\t} else {\n\t\tusbi_warn(ctx, \"Can not parse sysfs_dir: %s, no parent info\",\n\t\t\t  parent_sysfs_dir);\n\t\tfree (parent_sysfs_dir);\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\t/* is the parent a root hub? */\n\tif (NULL == strchr(parent_sysfs_dir, '-')) {\n\t\ttmp = parent_sysfs_dir;\n\t\tret = asprintf (&parent_sysfs_dir, \"usb%s\", tmp);\n\t\tfree (tmp);\n\t\tif (0 > ret) {\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\t}\n\t}\n\nretry:\n\t/* find the parent in the context */\n\tusbi_mutex_lock(&ctx->usb_devs_lock);\n\tlist_for_each_entry(it, &ctx->usb_devs, list, struct libusb_device) {\n\t\tstruct linux_device_priv *priv = _device_priv(it);\n\t\tif (0 == strcmp (priv->sysfs_dir, parent_sysfs_dir)) {\n\t\t\tdev->parent_dev = libusb_ref_device(it);\n\t\t\tbreak;\n\t\t}\n\t}\n\tusbi_mutex_unlock(&ctx->usb_devs_lock);\n\n\tif (!dev->parent_dev && add_parent) {\n\t\tusbi_dbg(\"parent_dev %s not enumerated yet, enumerating now\",\n\t\t\t parent_sysfs_dir);\n\t\tsysfs_scan_device(ctx, parent_sysfs_dir);\n\t\tadd_parent = 0;\n\t\tgoto retry;\n\t}\n\n\tusbi_dbg(\"Dev %p (%s) has parent %p (%s) port %d\", dev, sysfs_dir,\n\t\t dev->parent_dev, parent_sysfs_dir, dev->port_number);\n\n\tfree (parent_sysfs_dir);\n\n\treturn LIBUSB_SUCCESS;\n}\n\nint linux_enumerate_device(struct libusb_context *ctx,\n\tuint8_t busnum, uint8_t devaddr, const char *sysfs_dir)\n{\n\tunsigned long session_id;\n\tstruct libusb_device *dev;\n\tint r = 0;\n\n\t/* FIXME: session ID is not guaranteed unique as addresses can wrap and\n\t * will be reused. instead we should add a simple sysfs attribute with\n\t * a session ID. */\n\tsession_id = busnum << 8 | devaddr;\n\tusbi_dbg(\"busnum %d devaddr %d session_id %ld\", busnum, devaddr,\n\t\tsession_id);\n\n\tdev = usbi_get_device_by_session_id(ctx, session_id);\n\tif (dev) {\n\t\t/* device already exists in the context */\n\t\tusbi_dbg(\"session_id %ld already exists\", session_id);\n\t\tlibusb_unref_device(dev);\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\tusbi_dbg(\"allocating new device for %d/%d (session %ld)\",\n\t\t busnum, devaddr, session_id);\n\tdev = usbi_alloc_device(ctx, session_id);\n\tif (!dev)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tr = initialize_device(dev, busnum, devaddr, sysfs_dir);\n\tif (r < 0)\n\t\tgoto out;\n\tr = usbi_sanitize_device(dev);\n\tif (r < 0)\n\t\tgoto out;\n\n\tr = linux_get_parent_info(dev, sysfs_dir);\n\tif (r < 0)\n\t\tgoto out;\nout:\n\tif (r < 0)\n\t\tlibusb_unref_device(dev);\n\telse\n\t\tusbi_connect_device(dev);\n\n\treturn r;\n}\n\nvoid linux_hotplug_enumerate(uint8_t busnum, uint8_t devaddr, const char *sys_name)\n{\n\tstruct libusb_context *ctx;\n\n\tusbi_mutex_static_lock(&active_contexts_lock);\n\tlist_for_each_entry(ctx, &active_contexts_list, list, struct libusb_context) {\n\t\tlinux_enumerate_device(ctx, busnum, devaddr, sys_name);\n\t}\n\tusbi_mutex_static_unlock(&active_contexts_lock);\n}\n\nvoid linux_device_disconnected(uint8_t busnum, uint8_t devaddr, const char *sys_name)\n{\n\tstruct libusb_context *ctx;\n\tstruct libusb_device *dev;\n\tunsigned long session_id = busnum << 8 | devaddr;\n\n\tusbi_mutex_static_lock(&active_contexts_lock);\n\tlist_for_each_entry(ctx, &active_contexts_list, list, struct libusb_context) {\n\t\tdev = usbi_get_device_by_session_id (ctx, session_id);\n\t\tif (NULL != dev) {\n\t\t\tusbi_disconnect_device (dev);\n\t\t\tlibusb_unref_device(dev);\n\t\t} else {\n\t\t\tusbi_dbg(\"device not found for session %x\", session_id);\n\t\t}\n\t}\n\tusbi_mutex_static_unlock(&active_contexts_lock);\n}\n\n#if !defined(USE_UDEV)\n/* open a bus directory and adds all discovered devices to the context */\nstatic int usbfs_scan_busdir(struct libusb_context *ctx, uint8_t busnum)\n{\n\tDIR *dir;\n\tchar dirpath[PATH_MAX];\n\tstruct dirent *entry;\n\tint r = LIBUSB_ERROR_IO;\n\n\tsnprintf(dirpath, PATH_MAX, \"%s/%03d\", usbfs_path, busnum);\n\tusbi_dbg(\"%s\", dirpath);\n\tdir = opendir(dirpath);\n\tif (!dir) {\n\t\tusbi_err(ctx, \"opendir '%s' failed, errno=%d\", dirpath, errno);\n\t\t/* FIXME: should handle valid race conditions like hub unplugged\n\t\t * during directory iteration - this is not an error */\n\t\treturn r;\n\t}\n\n\twhile ((entry = readdir(dir))) {\n\t\tint devaddr;\n\n\t\tif (entry->d_name[0] == '.')\n\t\t\tcontinue;\n\n\t\tdevaddr = atoi(entry->d_name);\n\t\tif (devaddr == 0) {\n\t\t\tusbi_dbg(\"unknown dir entry %s\", entry->d_name);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (linux_enumerate_device(ctx, busnum, (uint8_t) devaddr, NULL)) {\n\t\t\tusbi_dbg(\"failed to enumerate dir entry %s\", entry->d_name);\n\t\t\tcontinue;\n\t\t}\n\n\t\tr = 0;\n\t}\n\n\tclosedir(dir);\n\treturn r;\n}\n\nstatic int usbfs_get_device_list(struct libusb_context *ctx)\n{\n\tstruct dirent *entry;\n\tDIR *buses = opendir(usbfs_path);\n\tint r = 0;\n\n\tif (!buses) {\n\t\tusbi_err(ctx, \"opendir buses failed errno=%d\", errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\twhile ((entry = readdir(buses))) {\n\t\tint busnum;\n\n\t\tif (entry->d_name[0] == '.')\n\t\t\tcontinue;\n\n\t\tif (usbdev_names) {\n\t\t\tint devaddr;\n\t\t\tif (!_is_usbdev_entry(entry, &busnum, &devaddr))\n\t\t\t\tcontinue;\n\n\t\t\tr = linux_enumerate_device(ctx, busnum, (uint8_t) devaddr, NULL);\n\t\t\tif (r < 0) {\n\t\t\t\tusbi_dbg(\"failed to enumerate dir entry %s\", entry->d_name);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t} else {\n\t\t\tbusnum = atoi(entry->d_name);\n\t\t\tif (busnum == 0) {\n\t\t\t\tusbi_dbg(\"unknown dir entry %s\", entry->d_name);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tr = usbfs_scan_busdir(ctx, busnum);\n\t\t\tif (r < 0)\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tclosedir(buses);\n\treturn r;\n\n}\n#endif\n\nstatic int sysfs_scan_device(struct libusb_context *ctx, const char *devname)\n{\n\tuint8_t busnum, devaddr;\n\tint ret;\n\n\tret = linux_get_device_address (ctx, 0, &busnum, &devaddr, NULL, devname);\n\tif (LIBUSB_SUCCESS != ret) {\n\t\treturn ret;\n\t}\n\n\treturn linux_enumerate_device(ctx, busnum & 0xff, devaddr & 0xff,\n\t\tdevname);\n}\n\n#if !defined(USE_UDEV)\nstatic int sysfs_get_device_list(struct libusb_context *ctx)\n{\n\tDIR *devices = opendir(SYSFS_DEVICE_PATH);\n\tstruct dirent *entry;\n\tint r = LIBUSB_ERROR_IO;\n\n\tif (!devices) {\n\t\tusbi_err(ctx, \"opendir devices failed errno=%d\", errno);\n\t\treturn r;\n\t}\n\n\twhile ((entry = readdir(devices))) {\n\t\tif ((!isdigit(entry->d_name[0]) && strncmp(entry->d_name, \"usb\", 3))\n\t\t\t\t|| strchr(entry->d_name, ':'))\n\t\t\tcontinue;\n\n\t\tif (sysfs_scan_device(ctx, entry->d_name)) {\n\t\t\tusbi_dbg(\"failed to enumerate dir entry %s\", entry->d_name);\n\t\t\tcontinue;\n\t\t}\n\n\t\tr = 0;\n\t}\n\n\tclosedir(devices);\n\treturn r;\n}\n\nstatic int linux_default_scan_devices (struct libusb_context *ctx)\n{\n\t/* we can retrieve device list and descriptors from sysfs or usbfs.\n\t * sysfs is preferable, because if we use usbfs we end up resuming\n\t * any autosuspended USB devices. however, sysfs is not available\n\t * everywhere, so we need a usbfs fallback too.\n\t *\n\t * as described in the \"sysfs vs usbfs\" comment at the top of this\n\t * file, sometimes we have sysfs but not enough information to\n\t * relate sysfs devices to usbfs nodes.  op_init() determines the\n\t * adequacy of sysfs and sets sysfs_can_relate_devices.\n\t */\n\tif (sysfs_can_relate_devices != 0)\n\t\treturn sysfs_get_device_list(ctx);\n\telse\n\t\treturn usbfs_get_device_list(ctx);\n}\n#endif\n\nstatic int op_open(struct libusb_device_handle *handle)\n{\n\tstruct linux_device_handle_priv *hpriv = _device_handle_priv(handle);\n\tint r;\n\n\thpriv->fd = _get_usbfs_fd(handle->dev, O_RDWR, 0);\n\tif (hpriv->fd < 0) {\n\t\tif (hpriv->fd == LIBUSB_ERROR_NO_DEVICE) {\n\t\t\t/* device will still be marked as attached if hotplug monitor thread\n\t\t\t * hasn't processed remove event yet */\n\t\t\tusbi_mutex_static_lock(&linux_hotplug_lock);\n\t\t\tif (handle->dev->attached) {\n\t\t\t\tusbi_dbg(\"open failed with no device, but device still attached\");\n\t\t\t\tlinux_device_disconnected(handle->dev->bus_number,\n\t\t\t\t\t\thandle->dev->device_address, NULL);\n\t\t\t}\n\t\t\tusbi_mutex_static_unlock(&linux_hotplug_lock);\n\t\t}\n\t\treturn hpriv->fd;\n\t}\n\n\tr = ioctl(hpriv->fd, IOCTL_USBFS_GET_CAPABILITIES, &hpriv->caps);\n\tif (r < 0) {\n\t\tif (errno == ENOTTY)\n\t\t\tusbi_dbg(\"getcap not available\");\n\t\telse\n\t\t\tusbi_err(HANDLE_CTX(handle), \"getcap failed (%d)\", errno);\n\t\thpriv->caps = 0;\n\t\tif (supports_flag_zero_packet)\n\t\t\thpriv->caps |= USBFS_CAP_ZERO_PACKET;\n\t\tif (supports_flag_bulk_continuation)\n\t\t\thpriv->caps |= USBFS_CAP_BULK_CONTINUATION;\n\t}\n\n\treturn usbi_add_pollfd(HANDLE_CTX(handle), hpriv->fd, POLLOUT);\n}\n\nstatic void op_close(struct libusb_device_handle *dev_handle)\n{\n\tint fd = _device_handle_priv(dev_handle)->fd;\n\tusbi_remove_pollfd(HANDLE_CTX(dev_handle), fd);\n\tclose(fd);\n}\n\nstatic int op_get_configuration(struct libusb_device_handle *handle,\n\tint *config)\n{\n\tint r;\n\n\tif (sysfs_can_relate_devices) {\n\t\tr = sysfs_get_active_config(handle->dev, config);\n\t} else {\n\t\tr = usbfs_get_active_config(handle->dev,\n\t\t\t\t\t    _device_handle_priv(handle)->fd);\n\t}\n\tif (r < 0)\n\t\treturn r;\n\n\tif (*config == -1) {\n\t\tusbi_err(HANDLE_CTX(handle), \"device unconfigured\");\n\t\t*config = 0;\n\t}\n\n\treturn 0;\n}\n\nstatic int op_set_configuration(struct libusb_device_handle *handle, int config)\n{\n\tstruct linux_device_priv *priv = _device_priv(handle->dev);\n\tint fd = _device_handle_priv(handle)->fd;\n\tint r = ioctl(fd, IOCTL_USBFS_SETCONFIG, &config);\n\tif (r) {\n\t\tif (errno == EINVAL)\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\telse if (errno == EBUSY)\n\t\t\treturn LIBUSB_ERROR_BUSY;\n\t\telse if (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\tusbi_err(HANDLE_CTX(handle), \"failed, error %d errno %d\", r, errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\t/* update our cached active config descriptor */\n\tpriv->active_config = config;\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int claim_interface(struct libusb_device_handle *handle, int iface)\n{\n\tint fd = _device_handle_priv(handle)->fd;\n\tint r = ioctl(fd, IOCTL_USBFS_CLAIMINTF, &iface);\n\tif (r) {\n\t\tif (errno == ENOENT)\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\telse if (errno == EBUSY)\n\t\t\treturn LIBUSB_ERROR_BUSY;\n\t\telse if (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"claim interface failed, error %d errno %d\", r, errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\treturn 0;\n}\n\nstatic int release_interface(struct libusb_device_handle *handle, int iface)\n{\n\tint fd = _device_handle_priv(handle)->fd;\n\tint r = ioctl(fd, IOCTL_USBFS_RELEASEINTF, &iface);\n\tif (r) {\n\t\tif (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"release interface failed, error %d errno %d\", r, errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\treturn 0;\n}\n\nstatic int op_set_interface(struct libusb_device_handle *handle, int iface,\n\tint altsetting)\n{\n\tint fd = _device_handle_priv(handle)->fd;\n\tstruct usbfs_setinterface setintf;\n\tint r;\n\n\tsetintf.interface = iface;\n\tsetintf.altsetting = altsetting;\n\tr = ioctl(fd, IOCTL_USBFS_SETINTF, &setintf);\n\tif (r) {\n\t\tif (errno == EINVAL)\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\telse if (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"setintf failed error %d errno %d\", r, errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\treturn 0;\n}\n\nstatic int op_clear_halt(struct libusb_device_handle *handle,\n\tunsigned char endpoint)\n{\n\tint fd = _device_handle_priv(handle)->fd;\n\tunsigned int _endpoint = endpoint;\n\tint r = ioctl(fd, IOCTL_USBFS_CLEAR_HALT, &_endpoint);\n\tif (r) {\n\t\tif (errno == ENOENT)\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\telse if (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"clear_halt failed error %d errno %d\", r, errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\treturn 0;\n}\n\nstatic int op_reset_device(struct libusb_device_handle *handle)\n{\n\tint fd = _device_handle_priv(handle)->fd;\n\tint i, r, ret = 0;\n\n\t/* Doing a device reset will cause the usbfs driver to get unbound\n\t   from any interfaces it is bound to. By voluntarily unbinding\n\t   the usbfs driver ourself, we stop the kernel from rebinding\n\t   the interface after reset (which would end up with the interface\n\t   getting bound to the in kernel driver if any). */\n\tfor (i = 0; i < USB_MAXINTERFACES; i++) {\n\t\tif (handle->claimed_interfaces & (1L << i)) {\n\t\t\trelease_interface(handle, i);\n\t\t}\n\t}\n\n\tusbi_mutex_lock(&handle->lock);\n\tr = ioctl(fd, IOCTL_USBFS_RESET, NULL);\n\tif (r) {\n\t\tif (errno == ENODEV) {\n\t\t\tret = LIBUSB_ERROR_NOT_FOUND;\n\t\t\tgoto out;\n\t\t}\n\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"reset failed error %d errno %d\", r, errno);\n\t\tret = LIBUSB_ERROR_OTHER;\n\t\tgoto out;\n\t}\n\n\t/* And re-claim any interfaces which were claimed before the reset */\n\tfor (i = 0; i < USB_MAXINTERFACES; i++) {\n\t\tif (handle->claimed_interfaces & (1L << i)) {\n\t\t\t/*\n\t\t\t * A driver may have completed modprobing during\n\t\t\t * IOCTL_USBFS_RESET, and bound itself as soon as\n\t\t\t * IOCTL_USBFS_RESET released the device lock\n\t\t\t */\n\t\t\tr = detach_kernel_driver_and_claim(handle, i);\n\t\t\tif (r) {\n\t\t\t\tusbi_warn(HANDLE_CTX(handle),\n\t\t\t\t\t\"failed to re-claim interface %d after reset: %s\",\n\t\t\t\t\ti, libusb_error_name(r));\n\t\t\t\thandle->claimed_interfaces &= ~(1L << i);\n\t\t\t\tret = LIBUSB_ERROR_NOT_FOUND;\n\t\t\t}\n\t\t}\n\t}\nout:\n\tusbi_mutex_unlock(&handle->lock);\n\treturn ret;\n}\n\nstatic int op_kernel_driver_active(struct libusb_device_handle *handle,\n\tint interface)\n{\n\tint fd = _device_handle_priv(handle)->fd;\n\tstruct usbfs_getdriver getdrv;\n\tint r;\n\n\tgetdrv.interface = interface;\n\tr = ioctl(fd, IOCTL_USBFS_GETDRIVER, &getdrv);\n\tif (r) {\n\t\tif (errno == ENODATA)\n\t\t\treturn 0;\n\t\telse if (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"get driver failed error %d errno %d\", r, errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\treturn (strcmp(getdrv.driver, \"usbfs\") == 0) ? 0 : 1;\n}\n\nstatic int op_detach_kernel_driver(struct libusb_device_handle *handle,\n\tint interface)\n{\n\tint fd = _device_handle_priv(handle)->fd;\n\tstruct usbfs_ioctl command;\n\tstruct usbfs_getdriver getdrv;\n\tint r;\n\n\tcommand.ifno = interface;\n\tcommand.ioctl_code = IOCTL_USBFS_DISCONNECT;\n\tcommand.data = NULL;\n\n\tgetdrv.interface = interface;\n\tr = ioctl(fd, IOCTL_USBFS_GETDRIVER, &getdrv);\n\tif (r == 0 && strcmp(getdrv.driver, \"usbfs\") == 0)\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\tr = ioctl(fd, IOCTL_USBFS_IOCTL, &command);\n\tif (r) {\n\t\tif (errno == ENODATA)\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\telse if (errno == EINVAL)\n\t\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t\telse if (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"detach failed error %d errno %d\", r, errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\treturn 0;\n}\n\nstatic int op_attach_kernel_driver(struct libusb_device_handle *handle,\n\tint interface)\n{\n\tint fd = _device_handle_priv(handle)->fd;\n\tstruct usbfs_ioctl command;\n\tint r;\n\n\tcommand.ifno = interface;\n\tcommand.ioctl_code = IOCTL_USBFS_CONNECT;\n\tcommand.data = NULL;\n\n\tr = ioctl(fd, IOCTL_USBFS_IOCTL, &command);\n\tif (r < 0) {\n\t\tif (errno == ENODATA)\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\telse if (errno == EINVAL)\n\t\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t\telse if (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t\telse if (errno == EBUSY)\n\t\t\treturn LIBUSB_ERROR_BUSY;\n\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"attach failed error %d errno %d\", r, errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t} else if (r == 0) {\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\treturn 0;\n}\n\nstatic int detach_kernel_driver_and_claim(struct libusb_device_handle *handle,\n\tint interface)\n{\n\tstruct usbfs_disconnect_claim dc;\n\tint r, fd = _device_handle_priv(handle)->fd;\n\n\tdc.interface = interface;\n\tstrcpy(dc.driver, \"usbfs\");\n\tdc.flags = USBFS_DISCONNECT_CLAIM_EXCEPT_DRIVER;\n\tr = ioctl(fd, IOCTL_USBFS_DISCONNECT_CLAIM, &dc);\n\tif (r == 0 || (r != 0 && errno != ENOTTY)) {\n\t\tif (r == 0)\n\t\t\treturn 0;\n\n\t\tswitch (errno) {\n\t\tcase EBUSY:\n\t\t\treturn LIBUSB_ERROR_BUSY;\n\t\tcase EINVAL:\n\t\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t\tcase ENODEV:\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t\t}\n\t\tusbi_err(HANDLE_CTX(handle),\n\t\t\t\"disconnect-and-claim failed errno %d\", errno);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\n\t/* Fallback code for kernels which don't support the\n\t   disconnect-and-claim ioctl */\n\tr = op_detach_kernel_driver(handle, interface);\n\tif (r != 0 && r != LIBUSB_ERROR_NOT_FOUND)\n\t\treturn r;\n\n\treturn claim_interface(handle, interface);\n}\n\nstatic int op_claim_interface(struct libusb_device_handle *handle, int iface)\n{\n\tif (handle->auto_detach_kernel_driver)\n\t\treturn detach_kernel_driver_and_claim(handle, iface);\n\telse\n\t\treturn claim_interface(handle, iface);\n}\n\nstatic int op_release_interface(struct libusb_device_handle *handle, int iface)\n{\n\tint r;\n\n\tr = release_interface(handle, iface);\n\tif (r)\n\t\treturn r;\n\n\tif (handle->auto_detach_kernel_driver)\n\t\top_attach_kernel_driver(handle, iface);\n\n\treturn 0;\n}\n\nstatic void op_destroy_device(struct libusb_device *dev)\n{\n\tstruct linux_device_priv *priv = _device_priv(dev);\n\tif (priv->descriptors)\n\t\tfree(priv->descriptors);\n\tif (priv->sysfs_dir)\n\t\tfree(priv->sysfs_dir);\n}\n\n/* URBs are discarded in reverse order of submission to avoid races. */\nstatic int discard_urbs(struct usbi_transfer *itransfer, int first, int last_plus_one)\n{\n\tstruct libusb_transfer *transfer =\n\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct linux_transfer_priv *tpriv =\n\t\tusbi_transfer_get_os_priv(itransfer);\n\tstruct linux_device_handle_priv *dpriv =\n\t\t_device_handle_priv(transfer->dev_handle);\n\tint i, ret = 0;\n\tstruct usbfs_urb *urb;\n\n\tfor (i = last_plus_one - 1; i >= first; i--) {\n\t\tif (LIBUSB_TRANSFER_TYPE_ISOCHRONOUS == transfer->type)\n\t\t\turb = tpriv->iso_urbs[i];\n\t\telse\n\t\t\turb = &tpriv->urbs[i];\n\n\t\tif (0 == ioctl(dpriv->fd, IOCTL_USBFS_DISCARDURB, urb))\n\t\t\tcontinue;\n\n\t\tif (EINVAL == errno) {\n\t\t\tusbi_dbg(\"URB not found --> assuming ready to be reaped\");\n\t\t\tif (i == (last_plus_one - 1))\n\t\t\t\tret = LIBUSB_ERROR_NOT_FOUND;\n\t\t} else if (ENODEV == errno) {\n\t\t\tusbi_dbg(\"Device not found for URB --> assuming ready to be reaped\");\n\t\t\tret = LIBUSB_ERROR_NO_DEVICE;\n\t\t} else {\n\t\t\tusbi_warn(TRANSFER_CTX(transfer),\n\t\t\t\t\"unrecognised discard errno %d\", errno);\n\t\t\tret = LIBUSB_ERROR_OTHER;\n\t\t}\n\t}\n\treturn ret;\n}\n\nstatic void free_iso_urbs(struct linux_transfer_priv *tpriv)\n{\n\tint i;\n\tfor (i = 0; i < tpriv->num_urbs; i++) {\n\t\tstruct usbfs_urb *urb = tpriv->iso_urbs[i];\n\t\tif (!urb)\n\t\t\tbreak;\n\t\tfree(urb);\n\t}\n\n\tfree(tpriv->iso_urbs);\n\ttpriv->iso_urbs = NULL;\n}\n\nstatic int submit_bulk_transfer(struct usbi_transfer *itransfer,\n\tunsigned char urb_type)\n{\n\tstruct libusb_transfer *transfer =\n\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\tstruct linux_device_handle_priv *dpriv =\n\t\t_device_handle_priv(transfer->dev_handle);\n\tstruct usbfs_urb *urbs;\n\tint is_out = (transfer->endpoint & LIBUSB_ENDPOINT_DIR_MASK)\n\t\t== LIBUSB_ENDPOINT_OUT;\n\tint bulk_buffer_len, use_bulk_continuation;\n\tint r;\n\tint i;\n\tsize_t alloc_size;\n\n\tif (tpriv->urbs)\n\t\treturn LIBUSB_ERROR_BUSY;\n\n\tif (is_out && (transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET) &&\n\t\t\t!(dpriv->caps & USBFS_CAP_ZERO_PACKET))\n\t\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n\n\t/*\n\t * Older versions of usbfs place a 16kb limit on bulk URBs. We work\n\t * around this by splitting large transfers into 16k blocks, and then\n\t * submit all urbs at once. it would be simpler to submit one urb at\n\t * a time, but there is a big performance gain doing it this way.\n\t *\n\t * Newer versions lift the 16k limit (USBFS_CAP_NO_PACKET_SIZE_LIM),\n\t * using arbritary large transfers can still be a bad idea though, as\n\t * the kernel needs to allocate physical contiguous memory for this,\n\t * which may fail for large buffers.\n\t *\n\t * The kernel solves this problem by splitting the transfer into\n\t * blocks itself when the host-controller is scatter-gather capable\n\t * (USBFS_CAP_BULK_SCATTER_GATHER), which most controllers are.\n\t *\n\t * Last, there is the issue of short-transfers when splitting, for\n\t * short split-transfers to work reliable USBFS_CAP_BULK_CONTINUATION\n\t * is needed, but this is not always available.\n\t */\n\tif (dpriv->caps & USBFS_CAP_BULK_SCATTER_GATHER) {\n\t\t/* Good! Just submit everything in one go */\n\t\tbulk_buffer_len = transfer->length ? transfer->length : 1;\n\t\tuse_bulk_continuation = 0;\n\t} else if (dpriv->caps & USBFS_CAP_BULK_CONTINUATION) {\n\t\t/* Split the transfers and use bulk-continuation to\n\t\t   avoid issues with short-transfers */\n\t\tbulk_buffer_len = MAX_BULK_BUFFER_LENGTH;\n\t\tuse_bulk_continuation = 1;\n\t} else if (dpriv->caps & USBFS_CAP_NO_PACKET_SIZE_LIM) {\n\t\t/* Don't split, assume the kernel can alloc the buffer\n\t\t   (otherwise the submit will fail with -ENOMEM) */\n\t\tbulk_buffer_len = transfer->length ? transfer->length : 1;\n\t\tuse_bulk_continuation = 0;\n\t} else {\n\t\t/* Bad, splitting without bulk-continuation, short transfers\n\t\t   which end before the last urb will not work reliable! */\n\t\t/* Note we don't warn here as this is \"normal\" on kernels <\n\t\t   2.6.32 and not a problem for most applications */\n\t\tbulk_buffer_len = MAX_BULK_BUFFER_LENGTH;\n\t\tuse_bulk_continuation = 0;\n\t}\n\n\tint num_urbs = transfer->length / bulk_buffer_len;\n\tint last_urb_partial = 0;\n\n\tif (transfer->length == 0) {\n\t\tnum_urbs = 1;\n\t} else if ((transfer->length % bulk_buffer_len) > 0) {\n\t\tlast_urb_partial = 1;\n\t\tnum_urbs++;\n\t}\n\tusbi_dbg(\"need %d urbs for new transfer with length %d\", num_urbs,\n\t\ttransfer->length);\n\talloc_size = num_urbs * sizeof(struct usbfs_urb);\n\turbs = calloc(1, alloc_size);\n\tif (!urbs)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\ttpriv->urbs = urbs;\n\ttpriv->num_urbs = num_urbs;\n\ttpriv->num_retired = 0;\n\ttpriv->reap_action = NORMAL;\n\ttpriv->reap_status = LIBUSB_TRANSFER_COMPLETED;\n\n\tfor (i = 0; i < num_urbs; i++) {\n\t\tstruct usbfs_urb *urb = &urbs[i];\n\t\turb->usercontext = itransfer;\n\t\turb->type = urb_type;\n\t\turb->endpoint = transfer->endpoint;\n\t\turb->buffer = transfer->buffer + (i * bulk_buffer_len);\n\t\t/* don't set the short not ok flag for the last URB */\n\t\tif (use_bulk_continuation && !is_out && (i < num_urbs - 1))\n\t\t\turb->flags = USBFS_URB_SHORT_NOT_OK;\n\t\tif (i == num_urbs - 1 && last_urb_partial)\n\t\t\turb->buffer_length = transfer->length % bulk_buffer_len;\n\t\telse if (transfer->length == 0)\n\t\t\turb->buffer_length = 0;\n\t\telse\n\t\t\turb->buffer_length = bulk_buffer_len;\n\n\t\tif (i > 0 && use_bulk_continuation)\n\t\t\turb->flags |= USBFS_URB_BULK_CONTINUATION;\n\n\t\t/* we have already checked that the flag is supported */\n\t\tif (is_out && i == num_urbs - 1 &&\n\t\t    transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET)\n\t\t\turb->flags |= USBFS_URB_ZERO_PACKET;\n\n\t\tr = ioctl(dpriv->fd, IOCTL_USBFS_SUBMITURB, urb);\n\t\tif (r < 0) {\n\t\t\tif (errno == ENODEV) {\n\t\t\t\tr = LIBUSB_ERROR_NO_DEVICE;\n\t\t\t} else {\n\t\t\t\tusbi_err(TRANSFER_CTX(transfer),\n\t\t\t\t\t\"submiturb failed error %d errno=%d\", r, errno);\n\t\t\t\tr = LIBUSB_ERROR_IO;\n\t\t\t}\n\n\t\t\t/* if the first URB submission fails, we can simply free up and\n\t\t\t * return failure immediately. */\n\t\t\tif (i == 0) {\n\t\t\t\tusbi_dbg(\"first URB failed, easy peasy\");\n\t\t\t\tfree(urbs);\n\t\t\t\ttpriv->urbs = NULL;\n\t\t\t\treturn r;\n\t\t\t}\n\n\t\t\t/* if it's not the first URB that failed, the situation is a bit\n\t\t\t * tricky. we may need to discard all previous URBs. there are\n\t\t\t * complications:\n\t\t\t *  - discarding is asynchronous - discarded urbs will be reaped\n\t\t\t *    later. the user must not have freed the transfer when the\n\t\t\t *    discarded URBs are reaped, otherwise libusb will be using\n\t\t\t *    freed memory.\n\t\t\t *  - the earlier URBs may have completed successfully and we do\n\t\t\t *    not want to throw away any data.\n\t\t\t *  - this URB failing may be no error; EREMOTEIO means that\n\t\t\t *    this transfer simply didn't need all the URBs we submitted\n\t\t\t * so, we report that the transfer was submitted successfully and\n\t\t\t * in case of error we discard all previous URBs. later when\n\t\t\t * the final reap completes we can report error to the user,\n\t\t\t * or success if an earlier URB was completed successfully.\n\t\t\t */\n\t\t\ttpriv->reap_action = EREMOTEIO == errno ? COMPLETED_EARLY : SUBMIT_FAILED;\n\n\t\t\t/* The URBs we haven't submitted yet we count as already\n\t\t\t * retired. */\n\t\t\ttpriv->num_retired += num_urbs - i;\n\n\t\t\t/* If we completed short then don't try to discard. */\n\t\t\tif (COMPLETED_EARLY == tpriv->reap_action)\n\t\t\t\treturn 0;\n\n\t\t\tdiscard_urbs(itransfer, 0, i);\n\n\t\t\tusbi_dbg(\"reporting successful submission but waiting for %d \"\n\t\t\t\t\"discards before reporting error\", i);\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\treturn 0;\n}\n\nstatic int submit_iso_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer =\n\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\tstruct linux_device_handle_priv *dpriv =\n\t\t_device_handle_priv(transfer->dev_handle);\n\tstruct usbfs_urb **urbs;\n\tsize_t alloc_size;\n\tint num_packets = transfer->num_iso_packets;\n\tint i;\n\tint this_urb_len = 0;\n\tint num_urbs = 1;\n\tint packet_offset = 0;\n\tunsigned int packet_len;\n\tunsigned char *urb_buffer = transfer->buffer;\n\n\tif (tpriv->iso_urbs)\n\t\treturn LIBUSB_ERROR_BUSY;\n\n\t/* usbfs places a 32kb limit on iso URBs. we divide up larger requests\n\t * into smaller units to meet such restriction, then fire off all the\n\t * units at once. it would be simpler if we just fired one unit at a time,\n\t * but there is a big performance gain through doing it this way.\n\t *\n\t * Newer kernels lift the 32k limit (USBFS_CAP_NO_PACKET_SIZE_LIM),\n\t * using arbritary large transfers is still be a bad idea though, as\n\t * the kernel needs to allocate physical contiguous memory for this,\n\t * which may fail for large buffers.\n\t */\n\n\t/* calculate how many URBs we need */\n\tfor (i = 0; i < num_packets; i++) {\n\t\tunsigned int space_remaining = MAX_ISO_BUFFER_LENGTH - this_urb_len;\n\t\tpacket_len = transfer->iso_packet_desc[i].length;\n\n\t\tif (packet_len > space_remaining) {\n\t\t\tnum_urbs++;\n\t\t\tthis_urb_len = packet_len;\n\t\t} else {\n\t\t\tthis_urb_len += packet_len;\n\t\t}\n\t}\n\tusbi_dbg(\"need %d 32k URBs for transfer\", num_urbs);\n\n\talloc_size = num_urbs * sizeof(*urbs);\n\turbs = calloc(1, alloc_size);\n\tif (!urbs)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\ttpriv->iso_urbs = urbs;\n\ttpriv->num_urbs = num_urbs;\n\ttpriv->num_retired = 0;\n\ttpriv->reap_action = NORMAL;\n\ttpriv->iso_packet_offset = 0;\n\n\t/* allocate + initialize each URB with the correct number of packets */\n\tfor (i = 0; i < num_urbs; i++) {\n\t\tstruct usbfs_urb *urb;\n\t\tunsigned int space_remaining_in_urb = MAX_ISO_BUFFER_LENGTH;\n\t\tint urb_packet_offset = 0;\n\t\tunsigned char *urb_buffer_orig = urb_buffer;\n\t\tint j;\n\t\tint k;\n\n\t\t/* swallow up all the packets we can fit into this URB */\n\t\twhile (packet_offset < transfer->num_iso_packets) {\n\t\t\tpacket_len = transfer->iso_packet_desc[packet_offset].length;\n\t\t\tif (packet_len <= space_remaining_in_urb) {\n\t\t\t\t/* throw it in */\n\t\t\t\turb_packet_offset++;\n\t\t\t\tpacket_offset++;\n\t\t\t\tspace_remaining_in_urb -= packet_len;\n\t\t\t\turb_buffer += packet_len;\n\t\t\t} else {\n\t\t\t\t/* it can't fit, save it for the next URB */\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\talloc_size = sizeof(*urb)\n\t\t\t+ (urb_packet_offset * sizeof(struct usbfs_iso_packet_desc));\n\t\turb = calloc(1, alloc_size);\n\t\tif (!urb) {\n\t\t\tfree_iso_urbs(tpriv);\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\t}\n\t\turbs[i] = urb;\n\n\t\t/* populate packet lengths */\n\t\tfor (j = 0, k = packet_offset - urb_packet_offset;\n\t\t\t\tk < packet_offset; k++, j++) {\n\t\t\tpacket_len = transfer->iso_packet_desc[k].length;\n\t\t\turb->iso_frame_desc[j].length = packet_len;\n\t\t}\n\n\t\turb->usercontext = itransfer;\n\t\turb->type = USBFS_URB_TYPE_ISO;\n\t\t/* FIXME: interface for non-ASAP data? */\n\t\turb->flags = USBFS_URB_ISO_ASAP;\n\t\turb->endpoint = transfer->endpoint;\n\t\turb->number_of_packets = urb_packet_offset;\n\t\turb->buffer = urb_buffer_orig;\n\t}\n\n\t/* submit URBs */\n\tfor (i = 0; i < num_urbs; i++) {\n\t\tint r = ioctl(dpriv->fd, IOCTL_USBFS_SUBMITURB, urbs[i]);\n\t\tif (r < 0) {\n\t\t\tif (errno == ENODEV) {\n\t\t\t\tr = LIBUSB_ERROR_NO_DEVICE;\n\t\t\t} else {\n\t\t\t\tusbi_err(TRANSFER_CTX(transfer),\n\t\t\t\t\t\"submiturb failed error %d errno=%d\", r, errno);\n\t\t\t\tr = LIBUSB_ERROR_IO;\n\t\t\t}\n\n\t\t\t/* if the first URB submission fails, we can simply free up and\n\t\t\t * return failure immediately. */\n\t\t\tif (i == 0) {\n\t\t\t\tusbi_dbg(\"first URB failed, easy peasy\");\n\t\t\t\tfree_iso_urbs(tpriv);\n\t\t\t\treturn r;\n\t\t\t}\n\n\t\t\t/* if it's not the first URB that failed, the situation is a bit\n\t\t\t * tricky. we must discard all previous URBs. there are\n\t\t\t * complications:\n\t\t\t *  - discarding is asynchronous - discarded urbs will be reaped\n\t\t\t *    later. the user must not have freed the transfer when the\n\t\t\t *    discarded URBs are reaped, otherwise libusb will be using\n\t\t\t *    freed memory.\n\t\t\t *  - the earlier URBs may have completed successfully and we do\n\t\t\t *    not want to throw away any data.\n\t\t\t * so, in this case we discard all the previous URBs BUT we report\n\t\t\t * that the transfer was submitted successfully. then later when\n\t\t\t * the final discard completes we can report error to the user.\n\t\t\t */\n\t\t\ttpriv->reap_action = SUBMIT_FAILED;\n\n\t\t\t/* The URBs we haven't submitted yet we count as already\n\t\t\t * retired. */\n\t\t\ttpriv->num_retired = num_urbs - i;\n\t\t\tdiscard_urbs(itransfer, 0, i);\n\n\t\t\tusbi_dbg(\"reporting successful submission but waiting for %d \"\n\t\t\t\t\"discards before reporting error\", i);\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\treturn 0;\n}\n\nstatic int submit_control_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\tstruct libusb_transfer *transfer =\n\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct linux_device_handle_priv *dpriv =\n\t\t_device_handle_priv(transfer->dev_handle);\n\tstruct usbfs_urb *urb;\n\tint r;\n\n\tif (tpriv->urbs)\n\t\treturn LIBUSB_ERROR_BUSY;\n\n\tif (transfer->length - LIBUSB_CONTROL_SETUP_SIZE > MAX_CTRL_BUFFER_LENGTH)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\turb = calloc(1, sizeof(struct usbfs_urb));\n\tif (!urb)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\ttpriv->urbs = urb;\n\ttpriv->num_urbs = 1;\n\ttpriv->reap_action = NORMAL;\n\n\turb->usercontext = itransfer;\n\turb->type = USBFS_URB_TYPE_CONTROL;\n\turb->endpoint = transfer->endpoint;\n\turb->buffer = transfer->buffer;\n\turb->buffer_length = transfer->length;\n\n\tr = ioctl(dpriv->fd, IOCTL_USBFS_SUBMITURB, urb);\n\tif (r < 0) {\n\t\tfree(urb);\n\t\ttpriv->urbs = NULL;\n\t\tif (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\tusbi_err(TRANSFER_CTX(transfer),\n\t\t\t\"submiturb failed error %d errno=%d\", r, errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\treturn 0;\n}\n\nstatic int op_submit_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer =\n\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n\tswitch (transfer->type) {\n\tcase LIBUSB_TRANSFER_TYPE_CONTROL:\n\t\treturn submit_control_transfer(itransfer);\n\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\t\treturn submit_bulk_transfer(itransfer, USBFS_URB_TYPE_BULK);\n\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\t\treturn submit_bulk_transfer(itransfer, USBFS_URB_TYPE_INTERRUPT);\n\tcase LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n\t\treturn submit_iso_transfer(itransfer);\n\tdefault:\n\t\tusbi_err(TRANSFER_CTX(transfer),\n\t\t\t\"unknown endpoint type %d\", transfer->type);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n}\n\nstatic int op_cancel_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\tstruct libusb_transfer *transfer =\n\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n\tswitch (transfer->type) {\n\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\t\tif (tpriv->reap_action == ERROR)\n\t\t\tbreak;\n\t\t/* else, fall through */\n\tcase LIBUSB_TRANSFER_TYPE_CONTROL:\n\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\tcase LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n\t\ttpriv->reap_action = CANCELLED;\n\t\tbreak;\n\tdefault:\n\t\tusbi_err(TRANSFER_CTX(transfer),\n\t\t\t\"unknown endpoint type %d\", transfer->type);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\n\tif (!tpriv->urbs)\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\treturn discard_urbs(itransfer, 0, tpriv->num_urbs);\n}\n\nstatic void op_clear_transfer_priv(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer =\n\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\n\t/* urbs can be freed also in submit_transfer so lock mutex first */\n\tswitch (transfer->type) {\n\tcase LIBUSB_TRANSFER_TYPE_CONTROL:\n\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\t\tusbi_mutex_lock(&itransfer->lock);\n\t\tif (tpriv->urbs)\n\t\t\tfree(tpriv->urbs);\n\t\ttpriv->urbs = NULL;\n\t\tusbi_mutex_unlock(&itransfer->lock);\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n\t\tusbi_mutex_lock(&itransfer->lock);\n\t\tif (tpriv->iso_urbs)\n\t\t\tfree_iso_urbs(tpriv);\n\t\tusbi_mutex_unlock(&itransfer->lock);\n\t\tbreak;\n\tdefault:\n\t\tusbi_err(TRANSFER_CTX(transfer),\n\t\t\t\"unknown endpoint type %d\", transfer->type);\n\t}\n}\n\nstatic int handle_bulk_completion(struct usbi_transfer *itransfer,\n\tstruct usbfs_urb *urb)\n{\n\tstruct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tint urb_idx = urb - tpriv->urbs;\n\n\tusbi_mutex_lock(&itransfer->lock);\n\tusbi_dbg(\"handling completion status %d of bulk urb %d/%d\", urb->status,\n\t\turb_idx + 1, tpriv->num_urbs);\n\n\ttpriv->num_retired++;\n\n\tif (tpriv->reap_action != NORMAL) {\n\t\t/* cancelled, submit_fail, or completed early */\n\t\tusbi_dbg(\"abnormal reap: urb status %d\", urb->status);\n\n\t\t/* even though we're in the process of cancelling, it's possible that\n\t\t * we may receive some data in these URBs that we don't want to lose.\n\t\t * examples:\n\t\t * 1. while the kernel is cancelling all the packets that make up an\n\t\t *    URB, a few of them might complete. so we get back a successful\n\t\t *    cancellation *and* some data.\n\t\t * 2. we receive a short URB which marks the early completion condition,\n\t\t *    so we start cancelling the remaining URBs. however, we're too\n\t\t *    slow and another URB completes (or at least completes partially).\n\t\t *    (this can't happen since we always use BULK_CONTINUATION.)\n\t\t *\n\t\t * When this happens, our objectives are not to lose any \"surplus\" data,\n\t\t * and also to stick it at the end of the previously-received data\n\t\t * (closing any holes), so that libusb reports the total amount of\n\t\t * transferred data and presents it in a contiguous chunk.\n\t\t */\n\t\tif (urb->actual_length > 0) {\n\t\t\tunsigned char *target = transfer->buffer + itransfer->transferred;\n\t\t\tusbi_dbg(\"received %d bytes of surplus data\", urb->actual_length);\n\t\t\tif (urb->buffer != target) {\n\t\t\t\tusbi_dbg(\"moving surplus data from offset %d to offset %d\",\n\t\t\t\t\t(unsigned char *) urb->buffer - transfer->buffer,\n\t\t\t\t\ttarget - transfer->buffer);\n\t\t\t\tmemmove(target, urb->buffer, urb->actual_length);\n\t\t\t}\n\t\t\titransfer->transferred += urb->actual_length;\n\t\t}\n\n\t\tif (tpriv->num_retired == tpriv->num_urbs) {\n\t\t\tusbi_dbg(\"abnormal reap: last URB handled, reporting\");\n\t\t\tif (tpriv->reap_action != COMPLETED_EARLY &&\n\t\t\t    tpriv->reap_status == LIBUSB_TRANSFER_COMPLETED)\n\t\t\t\ttpriv->reap_status = LIBUSB_TRANSFER_ERROR;\n\t\t\tgoto completed;\n\t\t}\n\t\tgoto out_unlock;\n\t}\n\n\titransfer->transferred += urb->actual_length;\n\n\t/* Many of these errors can occur on *any* urb of a multi-urb\n\t * transfer.  When they do, we tear down the rest of the transfer.\n\t */\n\tswitch (urb->status) {\n\tcase 0:\n\t\tbreak;\n\tcase -EREMOTEIO: /* short transfer */\n\t\tbreak;\n\tcase -ENOENT: /* cancelled */\n\tcase -ECONNRESET:\n\t\tbreak;\n\tcase -ENODEV:\n\tcase -ESHUTDOWN:\n\t\tusbi_dbg(\"device removed\");\n\t\ttpriv->reap_status = LIBUSB_TRANSFER_NO_DEVICE;\n\t\tgoto cancel_remaining;\n\tcase -EPIPE:\n\t\tusbi_dbg(\"detected endpoint stall\");\n\t\tif (tpriv->reap_status == LIBUSB_TRANSFER_COMPLETED)\n\t\t\ttpriv->reap_status = LIBUSB_TRANSFER_STALL;\n\t\tgoto cancel_remaining;\n\tcase -EOVERFLOW:\n\t\t/* overflow can only ever occur in the last urb */\n\t\tusbi_dbg(\"overflow, actual_length=%d\", urb->actual_length);\n\t\tif (tpriv->reap_status == LIBUSB_TRANSFER_COMPLETED)\n\t\t\ttpriv->reap_status = LIBUSB_TRANSFER_OVERFLOW;\n\t\tgoto completed;\n\tcase -ETIME:\n\tcase -EPROTO:\n\tcase -EILSEQ:\n\tcase -ECOMM:\n\tcase -ENOSR:\n\t\tusbi_dbg(\"low level error %d\", urb->status);\n\t\ttpriv->reap_action = ERROR;\n\t\tgoto cancel_remaining;\n\tdefault:\n\t\tusbi_warn(ITRANSFER_CTX(itransfer),\n\t\t\t\"unrecognised urb status %d\", urb->status);\n\t\ttpriv->reap_action = ERROR;\n\t\tgoto cancel_remaining;\n\t}\n\n\t/* if we're the last urb or we got less data than requested then we're\n\t * done */\n\tif (urb_idx == tpriv->num_urbs - 1) {\n\t\tusbi_dbg(\"last URB in transfer --> complete!\");\n\t\tgoto completed;\n\t} else if (urb->actual_length < urb->buffer_length) {\n\t\tusbi_dbg(\"short transfer %d/%d --> complete!\",\n\t\t\turb->actual_length, urb->buffer_length);\n\t\tif (tpriv->reap_action == NORMAL)\n\t\t\ttpriv->reap_action = COMPLETED_EARLY;\n\t} else\n\t\tgoto out_unlock;\n\ncancel_remaining:\n\tif (ERROR == tpriv->reap_action && LIBUSB_TRANSFER_COMPLETED == tpriv->reap_status)\n\t\ttpriv->reap_status = LIBUSB_TRANSFER_ERROR;\n\n\tif (tpriv->num_retired == tpriv->num_urbs) /* nothing to cancel */\n\t\tgoto completed;\n\n\t/* cancel remaining urbs and wait for their completion before\n\t * reporting results */\n\tdiscard_urbs(itransfer, urb_idx + 1, tpriv->num_urbs);\n\nout_unlock:\n\tusbi_mutex_unlock(&itransfer->lock);\n\treturn 0;\n\ncompleted:\n\tfree(tpriv->urbs);\n\ttpriv->urbs = NULL;\n\tusbi_mutex_unlock(&itransfer->lock);\n\treturn CANCELLED == tpriv->reap_action ?\n\t\tusbi_handle_transfer_cancellation(itransfer) :\n\t\tusbi_handle_transfer_completion(itransfer, tpriv->reap_status);\n}\n\nstatic int handle_iso_completion(struct usbi_transfer *itransfer,\n\tstruct usbfs_urb *urb)\n{\n\tstruct libusb_transfer *transfer =\n\t\tUSBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\tint num_urbs = tpriv->num_urbs;\n\tint urb_idx = 0;\n\tint i;\n\tenum libusb_transfer_status status = LIBUSB_TRANSFER_COMPLETED;\n\n\tusbi_mutex_lock(&itransfer->lock);\n\tfor (i = 0; i < num_urbs; i++) {\n\t\tif (urb == tpriv->iso_urbs[i]) {\n\t\t\turb_idx = i + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (urb_idx == 0) {\n\t\tusbi_err(TRANSFER_CTX(transfer), \"could not locate urb!\");\n\t\tusbi_mutex_unlock(&itransfer->lock);\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\tusbi_dbg(\"handling completion status %d of iso urb %d/%d\", urb->status,\n\t\turb_idx, num_urbs);\n\n\t/* copy isochronous results back in */\n\n\tfor (i = 0; i < urb->number_of_packets; i++) {\n\t\tstruct usbfs_iso_packet_desc *urb_desc = &urb->iso_frame_desc[i];\n\t\tstruct libusb_iso_packet_descriptor *lib_desc =\n\t\t\t&transfer->iso_packet_desc[tpriv->iso_packet_offset++];\n\t\tlib_desc->status = LIBUSB_TRANSFER_COMPLETED;\n\t\tswitch (urb_desc->status) {\n\t\tcase 0:\n\t\t\tbreak;\n\t\tcase -ENOENT: /* cancelled */\n\t\tcase -ECONNRESET:\n\t\t\tbreak;\n\t\tcase -ENODEV:\n\t\tcase -ESHUTDOWN:\n\t\t\tusbi_dbg(\"device removed\");\n\t\t\tlib_desc->status = LIBUSB_TRANSFER_NO_DEVICE;\n\t\t\tbreak;\n\t\tcase -EPIPE:\n\t\t\tusbi_dbg(\"detected endpoint stall\");\n\t\t\tlib_desc->status = LIBUSB_TRANSFER_STALL;\n\t\t\tbreak;\n\t\tcase -EOVERFLOW:\n\t\t\tusbi_dbg(\"overflow error\");\n\t\t\tlib_desc->status = LIBUSB_TRANSFER_OVERFLOW;\n\t\t\tbreak;\n\t\tcase -ETIME:\n\t\tcase -EPROTO:\n\t\tcase -EILSEQ:\n\t\tcase -ECOMM:\n\t\tcase -ENOSR:\n\t\tcase -EXDEV:\n\t\t\tusbi_dbg(\"low-level USB error %d\", urb_desc->status);\n\t\t\tlib_desc->status = LIBUSB_TRANSFER_ERROR;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tusbi_warn(TRANSFER_CTX(transfer),\n\t\t\t\t\"unrecognised urb status %d\", urb_desc->status);\n\t\t\tlib_desc->status = LIBUSB_TRANSFER_ERROR;\n\t\t\tbreak;\n\t\t}\n\t\tlib_desc->actual_length = urb_desc->actual_length;\n\t}\n\n\ttpriv->num_retired++;\n\n\tif (tpriv->reap_action != NORMAL) { /* cancelled or submit_fail */\n\t\tusbi_dbg(\"CANCEL: urb status %d\", urb->status);\n\n\t\tif (tpriv->num_retired == num_urbs) {\n\t\t\tusbi_dbg(\"CANCEL: last URB handled, reporting\");\n\t\t\tfree_iso_urbs(tpriv);\n\t\t\tif (tpriv->reap_action == CANCELLED) {\n\t\t\t\tusbi_mutex_unlock(&itransfer->lock);\n\t\t\t\treturn usbi_handle_transfer_cancellation(itransfer);\n\t\t\t} else {\n\t\t\t\tusbi_mutex_unlock(&itransfer->lock);\n\t\t\t\treturn usbi_handle_transfer_completion(itransfer,\n\t\t\t\t\tLIBUSB_TRANSFER_ERROR);\n\t\t\t}\n\t\t}\n\t\tgoto out;\n\t}\n\n\tswitch (urb->status) {\n\tcase 0:\n\t\tbreak;\n\tcase -ENOENT: /* cancelled */\n\tcase -ECONNRESET:\n\t\tbreak;\n\tcase -ESHUTDOWN:\n\t\tusbi_dbg(\"device removed\");\n\t\tstatus = LIBUSB_TRANSFER_NO_DEVICE;\n\t\tbreak;\n\tdefault:\n\t\tusbi_warn(TRANSFER_CTX(transfer),\n\t\t\t\"unrecognised urb status %d\", urb->status);\n\t\tstatus = LIBUSB_TRANSFER_ERROR;\n\t\tbreak;\n\t}\n\n\t/* if we're the last urb then we're done */\n\tif (urb_idx == num_urbs) {\n\t\tusbi_dbg(\"last URB in transfer --> complete!\");\n\t\tfree_iso_urbs(tpriv);\n\t\tusbi_mutex_unlock(&itransfer->lock);\n\t\treturn usbi_handle_transfer_completion(itransfer, status);\n\t}\n\nout:\n\tusbi_mutex_unlock(&itransfer->lock);\n\treturn 0;\n}\n\nstatic int handle_control_completion(struct usbi_transfer *itransfer,\n\tstruct usbfs_urb *urb)\n{\n\tstruct linux_transfer_priv *tpriv = usbi_transfer_get_os_priv(itransfer);\n\tint status;\n\n\tusbi_mutex_lock(&itransfer->lock);\n\tusbi_dbg(\"handling completion status %d\", urb->status);\n\n\titransfer->transferred += urb->actual_length;\n\n\tif (tpriv->reap_action == CANCELLED) {\n\t\tif (urb->status != 0 && urb->status != -ENOENT)\n\t\t\tusbi_warn(ITRANSFER_CTX(itransfer),\n\t\t\t\t\"cancel: unrecognised urb status %d\", urb->status);\n\t\tfree(tpriv->urbs);\n\t\ttpriv->urbs = NULL;\n\t\tusbi_mutex_unlock(&itransfer->lock);\n\t\treturn usbi_handle_transfer_cancellation(itransfer);\n\t}\n\n\tswitch (urb->status) {\n\tcase 0:\n\t\tstatus = LIBUSB_TRANSFER_COMPLETED;\n\t\tbreak;\n\tcase -ENOENT: /* cancelled */\n\t\tstatus = LIBUSB_TRANSFER_CANCELLED;\n\t\tbreak;\n\tcase -ENODEV:\n\tcase -ESHUTDOWN:\n\t\tusbi_dbg(\"device removed\");\n\t\tstatus = LIBUSB_TRANSFER_NO_DEVICE;\n\t\tbreak;\n\tcase -EPIPE:\n\t\tusbi_dbg(\"unsupported control request\");\n\t\tstatus = LIBUSB_TRANSFER_STALL;\n\t\tbreak;\n\tcase -EOVERFLOW:\n\t\tusbi_dbg(\"control overflow error\");\n\t\tstatus = LIBUSB_TRANSFER_OVERFLOW;\n\t\tbreak;\n\tcase -ETIME:\n\tcase -EPROTO:\n\tcase -EILSEQ:\n\tcase -ECOMM:\n\tcase -ENOSR:\n\t\tusbi_dbg(\"low-level bus error occurred\");\n\t\tstatus = LIBUSB_TRANSFER_ERROR;\n\t\tbreak;\n\tdefault:\n\t\tusbi_warn(ITRANSFER_CTX(itransfer),\n\t\t\t\"unrecognised urb status %d\", urb->status);\n\t\tstatus = LIBUSB_TRANSFER_ERROR;\n\t\tbreak;\n\t}\n\n\tfree(tpriv->urbs);\n\ttpriv->urbs = NULL;\n\tusbi_mutex_unlock(&itransfer->lock);\n\treturn usbi_handle_transfer_completion(itransfer, status);\n}\n\nstatic int reap_for_handle(struct libusb_device_handle *handle)\n{\n\tstruct linux_device_handle_priv *hpriv = _device_handle_priv(handle);\n\tint r;\n\tstruct usbfs_urb *urb;\n\tstruct usbi_transfer *itransfer;\n\tstruct libusb_transfer *transfer;\n\n\tr = ioctl(hpriv->fd, IOCTL_USBFS_REAPURBNDELAY, &urb);\n\tif (r == -1 && errno == EAGAIN)\n\t\treturn 1;\n\tif (r < 0) {\n\t\tif (errno == ENODEV)\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\n\t\tusbi_err(HANDLE_CTX(handle), \"reap failed error %d errno=%d\",\n\t\t\tr, errno);\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\titransfer = urb->usercontext;\n\ttransfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n\tusbi_dbg(\"urb type=%d status=%d transferred=%d\", urb->type, urb->status,\n\t\turb->actual_length);\n\n\tswitch (transfer->type) {\n\tcase LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n\t\treturn handle_iso_completion(itransfer, urb);\n\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\t\treturn handle_bulk_completion(itransfer, urb);\n\tcase LIBUSB_TRANSFER_TYPE_CONTROL:\n\t\treturn handle_control_completion(itransfer, urb);\n\tdefault:\n\t\tusbi_err(HANDLE_CTX(handle), \"unrecognised endpoint type %x\",\n\t\t\ttransfer->type);\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n}\n\nstatic int op_handle_events(struct libusb_context *ctx,\n\tstruct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready)\n{\n\tint r;\n\tunsigned int i = 0;\n\n\tusbi_mutex_lock(&ctx->open_devs_lock);\n\tfor (i = 0; i < nfds && num_ready > 0; i++) {\n\t\tstruct pollfd *pollfd = &fds[i];\n\t\tstruct libusb_device_handle *handle;\n\t\tstruct linux_device_handle_priv *hpriv = NULL;\n\n\t\tif (!pollfd->revents)\n\t\t\tcontinue;\n\n\t\tnum_ready--;\n\t\tlist_for_each_entry(handle, &ctx->open_devs, list, struct libusb_device_handle) {\n\t\t\thpriv = _device_handle_priv(handle);\n\t\t\tif (hpriv->fd == pollfd->fd)\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (pollfd->revents & POLLERR) {\n\t\t\tusbi_remove_pollfd(HANDLE_CTX(handle), hpriv->fd);\n\t\t\tusbi_handle_disconnect(handle);\n\t\t\t/* device will still be marked as attached if hotplug monitor thread\n\t\t\t * hasn't processed remove event yet */\n\t\t\tusbi_mutex_static_lock(&linux_hotplug_lock);\n\t\t\tif (handle->dev->attached)\n\t\t\t\tlinux_device_disconnected(handle->dev->bus_number,\n\t\t\t\t\t\thandle->dev->device_address, NULL);\n\t\t\tusbi_mutex_static_unlock(&linux_hotplug_lock);\n\t\t\tcontinue;\n\t\t}\n\n\t\tdo {\n\t\t\tr = reap_for_handle(handle);\n\t\t} while (r == 0);\n\t\tif (r == 1 || r == LIBUSB_ERROR_NO_DEVICE)\n\t\t\tcontinue;\n\t\telse if (r < 0)\n\t\t\tgoto out;\n\t}\n\n\tr = 0;\nout:\n\tusbi_mutex_unlock(&ctx->open_devs_lock);\n\treturn r;\n}\n\nstatic int op_clock_gettime(int clk_id, struct timespec *tp)\n{\n\tswitch (clk_id) {\n\tcase USBI_CLOCK_MONOTONIC:\n\t\treturn clock_gettime(monotonic_clkid, tp);\n\tcase USBI_CLOCK_REALTIME:\n\t\treturn clock_gettime(CLOCK_REALTIME, tp);\n\tdefault:\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n  }\n}\n\n#ifdef USBI_TIMERFD_AVAILABLE\nstatic clockid_t op_get_timerfd_clockid(void)\n{\n\treturn monotonic_clkid;\n\n}\n#endif\n\nconst struct usbi_os_backend linux_usbfs_backend = {\n\t.name = \"Linux usbfs\",\n\t.caps = USBI_CAP_HAS_HID_ACCESS|USBI_CAP_SUPPORTS_DETACH_KERNEL_DRIVER,\n\t.init = op_init,\n\t.exit = op_exit,\n\t.get_device_list = NULL,\n\t.hotplug_poll = op_hotplug_poll,\n\t.get_device_descriptor = op_get_device_descriptor,\n\t.get_active_config_descriptor = op_get_active_config_descriptor,\n\t.get_config_descriptor = op_get_config_descriptor,\n\t.get_config_descriptor_by_value = op_get_config_descriptor_by_value,\n\n\t.open = op_open,\n\t.close = op_close,\n\t.get_configuration = op_get_configuration,\n\t.set_configuration = op_set_configuration,\n\t.claim_interface = op_claim_interface,\n\t.release_interface = op_release_interface,\n\n\t.set_interface_altsetting = op_set_interface,\n\t.clear_halt = op_clear_halt,\n\t.reset_device = op_reset_device,\n\n\t.kernel_driver_active = op_kernel_driver_active,\n\t.detach_kernel_driver = op_detach_kernel_driver,\n\t.attach_kernel_driver = op_attach_kernel_driver,\n\n\t.destroy_device = op_destroy_device,\n\n\t.submit_transfer = op_submit_transfer,\n\t.cancel_transfer = op_cancel_transfer,\n\t.clear_transfer_priv = op_clear_transfer_priv,\n\n\t.handle_events = op_handle_events,\n\n\t.clock_gettime = op_clock_gettime,\n\n#ifdef USBI_TIMERFD_AVAILABLE\n\t.get_timerfd_clockid = op_get_timerfd_clockid,\n#endif\n\n\t.device_priv_size = sizeof(struct linux_device_priv),\n\t.device_handle_priv_size = sizeof(struct linux_device_handle_priv),\n\t.transfer_priv_size = sizeof(struct linux_transfer_priv),\n\t.add_iso_packet_size = 0,\n};\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/linux_usbfs.h",
    "content": "/*\n * usbfs header structures\n * Copyright © 2007 Daniel Drake <dsd@gentoo.org>\n * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef LIBUSB_USBFS_H\n#define LIBUSB_USBFS_H\n\n#include <linux/types.h>\n\n#define SYSFS_DEVICE_PATH \"/sys/bus/usb/devices\"\n\nstruct usbfs_ctrltransfer {\n\t/* keep in sync with usbdevice_fs.h:usbdevfs_ctrltransfer */\n\tuint8_t  bmRequestType;\n\tuint8_t  bRequest;\n\tuint16_t wValue;\n\tuint16_t wIndex;\n\tuint16_t wLength;\n\n\tuint32_t timeout;\t/* in milliseconds */\n\n\t/* pointer to data */\n\tvoid *data;\n};\n\nstruct usbfs_bulktransfer {\n\t/* keep in sync with usbdevice_fs.h:usbdevfs_bulktransfer */\n\tunsigned int ep;\n\tunsigned int len;\n\tunsigned int timeout;\t/* in milliseconds */\n\n\t/* pointer to data */\n\tvoid *data;\n};\n\nstruct usbfs_setinterface {\n\t/* keep in sync with usbdevice_fs.h:usbdevfs_setinterface */\n\tunsigned int interface;\n\tunsigned int altsetting;\n};\n\n#define USBFS_MAXDRIVERNAME 255\n\nstruct usbfs_getdriver {\n\tunsigned int interface;\n\tchar driver[USBFS_MAXDRIVERNAME + 1];\n};\n\n#define USBFS_URB_SHORT_NOT_OK\t\t0x01\n#define USBFS_URB_ISO_ASAP\t\t\t0x02\n#define USBFS_URB_BULK_CONTINUATION\t0x04\n#define USBFS_URB_QUEUE_BULK\t\t0x10\n#define USBFS_URB_ZERO_PACKET\t\t0x40\n\nenum usbfs_urb_type {\n\tUSBFS_URB_TYPE_ISO = 0,\n\tUSBFS_URB_TYPE_INTERRUPT = 1,\n\tUSBFS_URB_TYPE_CONTROL = 2,\n\tUSBFS_URB_TYPE_BULK = 3,\n};\n\nstruct usbfs_iso_packet_desc {\n\tunsigned int length;\n\tunsigned int actual_length;\n\tunsigned int status;\n};\n\n#define MAX_ISO_BUFFER_LENGTH\t\t32768\n#define MAX_BULK_BUFFER_LENGTH\t\t16384\n#define MAX_CTRL_BUFFER_LENGTH\t\t4096\n\nstruct usbfs_urb {\n\tunsigned char type;\n\tunsigned char endpoint;\n\tint status;\n\tunsigned int flags;\n\tvoid *buffer;\n\tint buffer_length;\n\tint actual_length;\n\tint start_frame;\n\tint number_of_packets;\n\tint error_count;\n\tunsigned int signr;\n\tvoid *usercontext;\n\tstruct usbfs_iso_packet_desc iso_frame_desc[0];\n};\n\nstruct usbfs_connectinfo {\n\tunsigned int devnum;\n\tunsigned char slow;\n};\n\nstruct usbfs_ioctl {\n\tint ifno;\t/* interface 0..N ; negative numbers reserved */\n\tint ioctl_code;\t/* MUST encode size + direction of data so the\n\t\t\t * macros in <asm/ioctl.h> give correct values */\n\tvoid *data;\t/* param buffer (in, or out) */\n};\n\nstruct usbfs_hub_portinfo {\n\tunsigned char numports;\n\tunsigned char port[127];\t/* port to device num mapping */\n};\n\n#define USBFS_CAP_ZERO_PACKET\t\t0x01\n#define USBFS_CAP_BULK_CONTINUATION\t0x02\n#define USBFS_CAP_NO_PACKET_SIZE_LIM\t0x04\n#define USBFS_CAP_BULK_SCATTER_GATHER\t0x08\n\n#define USBFS_DISCONNECT_CLAIM_IF_DRIVER\t0x01\n#define USBFS_DISCONNECT_CLAIM_EXCEPT_DRIVER\t0x02\n\nstruct usbfs_disconnect_claim {\n\tunsigned int interface;\n\tunsigned int flags;\n\tchar driver[USBFS_MAXDRIVERNAME + 1];\n};\n\n#define IOCTL_USBFS_CONTROL\t_IOWR('U', 0, struct usbfs_ctrltransfer)\n#define IOCTL_USBFS_BULK\t\t_IOWR('U', 2, struct usbfs_bulktransfer)\n#define IOCTL_USBFS_RESETEP\t_IOR('U', 3, unsigned int)\n#define IOCTL_USBFS_SETINTF\t_IOR('U', 4, struct usbfs_setinterface)\n#define IOCTL_USBFS_SETCONFIG\t_IOR('U', 5, unsigned int)\n#define IOCTL_USBFS_GETDRIVER\t_IOW('U', 8, struct usbfs_getdriver)\n#define IOCTL_USBFS_SUBMITURB\t_IOR('U', 10, struct usbfs_urb)\n#define IOCTL_USBFS_DISCARDURB\t_IO('U', 11)\n#define IOCTL_USBFS_REAPURB\t_IOW('U', 12, void *)\n#define IOCTL_USBFS_REAPURBNDELAY\t_IOW('U', 13, void *)\n#define IOCTL_USBFS_CLAIMINTF\t_IOR('U', 15, unsigned int)\n#define IOCTL_USBFS_RELEASEINTF\t_IOR('U', 16, unsigned int)\n#define IOCTL_USBFS_CONNECTINFO\t_IOW('U', 17, struct usbfs_connectinfo)\n#define IOCTL_USBFS_IOCTL         _IOWR('U', 18, struct usbfs_ioctl)\n#define IOCTL_USBFS_HUB_PORTINFO\t_IOR('U', 19, struct usbfs_hub_portinfo)\n#define IOCTL_USBFS_RESET\t\t_IO('U', 20)\n#define IOCTL_USBFS_CLEAR_HALT\t_IOR('U', 21, unsigned int)\n#define IOCTL_USBFS_DISCONNECT\t_IO('U', 22)\n#define IOCTL_USBFS_CONNECT\t_IO('U', 23)\n#define IOCTL_USBFS_CLAIM_PORT\t_IOR('U', 24, unsigned int)\n#define IOCTL_USBFS_RELEASE_PORT\t_IOR('U', 25, unsigned int)\n#define IOCTL_USBFS_GET_CAPABILITIES\t_IOR('U', 26, __u32)\n#define IOCTL_USBFS_DISCONNECT_CLAIM\t_IOR('U', 27, struct usbfs_disconnect_claim)\n\nextern usbi_mutex_static_t linux_hotplug_lock;\n\n#if defined(HAVE_LIBUDEV)\nint linux_udev_start_event_monitor(void);\nint linux_udev_stop_event_monitor(void);\nint linux_udev_scan_devices(struct libusb_context *ctx);\nvoid linux_udev_hotplug_poll(void);\n#else\nint linux_netlink_start_event_monitor(void);\nint linux_netlink_stop_event_monitor(void);\nvoid linux_netlink_hotplug_poll(void);\n#endif\n\nvoid linux_hotplug_enumerate(uint8_t busnum, uint8_t devaddr, const char *sys_name);\nvoid linux_device_disconnected(uint8_t busnum, uint8_t devaddr, const char *sys_name);\n\nint linux_get_device_address (struct libusb_context *ctx, int detached,\n\tuint8_t *busnum, uint8_t *devaddr, const char *dev_node,\n\tconst char *sys_name);\nint linux_enumerate_device(struct libusb_context *ctx,\n\tuint8_t busnum, uint8_t devaddr, const char *sysfs_dir);\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/netbsd_usb.c",
    "content": "/*\n * Copyright © 2011 Martin Pieuchot <mpi@openbsd.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <sys/time.h>\n#include <sys/types.h>\n\n#include <errno.h>\n#include <fcntl.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n\n#include <dev/usb/usb.h>\n\n#include \"libusb.h\"\n#include \"libusbi.h\"\n\nstruct device_priv {\n\tchar devnode[16];\n\tint fd;\n\n\tunsigned char *cdesc;\t\t\t/* active config descriptor */\n\tusb_device_descriptor_t ddesc;\t\t/* usb device descriptor */\n};\n\nstruct handle_priv {\n\tint pipe[2];\t\t\t\t/* for event notification */\n\tint endpoints[USB_MAX_ENDPOINTS];\n};\n\n/*\n * Backend functions\n */\nstatic int netbsd_get_device_list(struct libusb_context *,\n    struct discovered_devs **);\nstatic int netbsd_open(struct libusb_device_handle *);\nstatic void netbsd_close(struct libusb_device_handle *);\n\nstatic int netbsd_get_device_descriptor(struct libusb_device *, unsigned char *,\n    int *);\nstatic int netbsd_get_active_config_descriptor(struct libusb_device *,\n    unsigned char *, size_t, int *);\nstatic int netbsd_get_config_descriptor(struct libusb_device *, uint8_t,\n    unsigned char *, size_t, int *);\n\nstatic int netbsd_get_configuration(struct libusb_device_handle *, int *);\nstatic int netbsd_set_configuration(struct libusb_device_handle *, int);\n\nstatic int netbsd_claim_interface(struct libusb_device_handle *, int);\nstatic int netbsd_release_interface(struct libusb_device_handle *, int);\n\nstatic int netbsd_set_interface_altsetting(struct libusb_device_handle *, int,\n    int);\nstatic int netbsd_clear_halt(struct libusb_device_handle *, unsigned char);\nstatic int netbsd_reset_device(struct libusb_device_handle *);\nstatic void netbsd_destroy_device(struct libusb_device *);\n\nstatic int netbsd_submit_transfer(struct usbi_transfer *);\nstatic int netbsd_cancel_transfer(struct usbi_transfer *);\nstatic void netbsd_clear_transfer_priv(struct usbi_transfer *);\nstatic int netbsd_handle_events(struct libusb_context *ctx, struct pollfd *,\n    nfds_t, int);\nstatic int netbsd_clock_gettime(int, struct timespec *);\n\n/*\n * Private functions\n */\nstatic int _errno_to_libusb(int);\nstatic int _cache_active_config_descriptor(struct libusb_device *, int);\nstatic int _sync_control_transfer(struct usbi_transfer *);\nstatic int _sync_gen_transfer(struct usbi_transfer *);\nstatic int _access_endpoint(struct libusb_transfer *);\n\nconst struct usbi_os_backend netbsd_backend = {\n\t\"Synchronous NetBSD backend\",\n\t0,\n\tNULL,\t\t\t\t/* init() */\n\tNULL,\t\t\t\t/* exit() */\n\tnetbsd_get_device_list,\n\tNULL,\t\t\t\t/* hotplug_poll */\n\tnetbsd_open,\n\tnetbsd_close,\n\n\tnetbsd_get_device_descriptor,\n\tnetbsd_get_active_config_descriptor,\n\tnetbsd_get_config_descriptor,\n\tNULL,\t\t\t\t/* get_config_descriptor_by_value() */\n\n\tnetbsd_get_configuration,\n\tnetbsd_set_configuration,\n\n\tnetbsd_claim_interface,\n\tnetbsd_release_interface,\n\n\tnetbsd_set_interface_altsetting,\n\tnetbsd_clear_halt,\n\tnetbsd_reset_device,\n\n\tNULL,\t\t\t\t/* kernel_driver_active() */\n\tNULL,\t\t\t\t/* detach_kernel_driver() */\n\tNULL,\t\t\t\t/* attach_kernel_driver() */\n\n\tnetbsd_destroy_device,\n\n\tnetbsd_submit_transfer,\n\tnetbsd_cancel_transfer,\n\tnetbsd_clear_transfer_priv,\n\n\tnetbsd_handle_events,\n\n\tnetbsd_clock_gettime,\n\tsizeof(struct device_priv),\n\tsizeof(struct handle_priv),\n\t0,\t\t\t\t/* transfer_priv_size */\n\t0,\t\t\t\t/* add_iso_packet_size */\n};\n\nint\nnetbsd_get_device_list(struct libusb_context * ctx,\n\tstruct discovered_devs **discdevs)\n{\n\tstruct libusb_device *dev;\n\tstruct device_priv *dpriv;\n\tstruct usb_device_info di;\n\tunsigned long session_id;\n\tchar devnode[16];\n\tint fd, err, i;\n\n\tusbi_dbg(\"\");\n\n\t/* Only ugen(4) is supported */\n\tfor (i = 0; i < USB_MAX_DEVICES; i++) {\n\t\t/* Control endpoint is always .00 */\n\t\tsnprintf(devnode, sizeof(devnode), \"/dev/ugen%d.00\", i);\n\n\t\tif ((fd = open(devnode, O_RDONLY)) < 0) {\n\t\t\tif (errno != ENOENT && errno != ENXIO)\n\t\t\t\tusbi_err(ctx, \"could not open %s\", devnode);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (ioctl(fd, USB_GET_DEVICEINFO, &di) < 0)\n\t\t\tcontinue;\n\n\t\tsession_id = (di.udi_bus << 8 | di.udi_addr);\n\t\tdev = usbi_get_device_by_session_id(ctx, session_id);\n\n\t\tif (dev == NULL) {\n\t\t\tdev = usbi_alloc_device(ctx, session_id);\n\t\t\tif (dev == NULL)\n\t\t\t\treturn (LIBUSB_ERROR_NO_MEM);\n\n\t\t\tdev->bus_number = di.udi_bus;\n\t\t\tdev->device_address = di.udi_addr;\n\t\t\tdev->speed = di.udi_speed;\n\n\t\t\tdpriv = (struct device_priv *)dev->os_priv;\n\t\t\tstrlcpy(dpriv->devnode, devnode, sizeof(devnode));\n\t\t\tdpriv->fd = -1;\n\n\t\t\tif (ioctl(fd, USB_GET_DEVICE_DESC, &dpriv->ddesc) < 0) {\n\t\t\t\terr = errno;\n\t\t\t\tgoto error;\n\t\t\t}\n\n\t\t\tdpriv->cdesc = NULL;\n\t\t\tif (_cache_active_config_descriptor(dev, fd)) {\n\t\t\t\terr = errno;\n\t\t\t\tgoto error;\n\t\t\t}\n\n\t\t\tif ((err = usbi_sanitize_device(dev)))\n\t\t\t\tgoto error;\n\t\t}\n\t\tclose(fd);\n\n\t\tif (discovered_devs_append(*discdevs, dev) == NULL)\n\t\t\treturn (LIBUSB_ERROR_NO_MEM);\n\n\t\tlibusb_unref_device(dev);\n\t}\n\n\treturn (LIBUSB_SUCCESS);\n\nerror:\n\tclose(fd);\n\tlibusb_unref_device(dev);\n\treturn _errno_to_libusb(err);\n}\n\nint\nnetbsd_open(struct libusb_device_handle *handle)\n{\n\tstruct handle_priv *hpriv = (struct handle_priv *)handle->os_priv;\n\tstruct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;\n\n\tdpriv->fd = open(dpriv->devnode, O_RDWR);\n\tif (dpriv->fd < 0) {\n\t\tdpriv->fd = open(dpriv->devnode, O_RDONLY);\n\t\tif (dpriv->fd < 0)\n\t\t\treturn _errno_to_libusb(errno);\n\t}\n\n\tusbi_dbg(\"open %s: fd %d\", dpriv->devnode, dpriv->fd);\n\n\tif (pipe(hpriv->pipe) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\treturn usbi_add_pollfd(HANDLE_CTX(handle), hpriv->pipe[0], POLLIN);\n}\n\nvoid\nnetbsd_close(struct libusb_device_handle *handle)\n{\n\tstruct handle_priv *hpriv = (struct handle_priv *)handle->os_priv;\n\tstruct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;\n\n\tusbi_dbg(\"close: fd %d\", dpriv->fd);\n\n\tclose(dpriv->fd);\n\tdpriv->fd = -1;\n\n\tusbi_remove_pollfd(HANDLE_CTX(handle), hpriv->pipe[0]);\n\n\tclose(hpriv->pipe[0]);\n\tclose(hpriv->pipe[1]);\n}\n\nint\nnetbsd_get_device_descriptor(struct libusb_device *dev, unsigned char *buf,\n    int *host_endian)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)dev->os_priv;\n\n\tusbi_dbg(\"\");\n\n\tmemcpy(buf, &dpriv->ddesc, DEVICE_DESC_LENGTH);\n\n\t*host_endian = 0;\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nnetbsd_get_active_config_descriptor(struct libusb_device *dev,\n    unsigned char *buf, size_t len, int *host_endian)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)dev->os_priv;\n\tusb_config_descriptor_t *ucd;\n\n\tucd = (usb_config_descriptor_t *) dpriv->cdesc;\n\tlen = MIN(len, UGETW(ucd->wTotalLength));\n\n\tusbi_dbg(\"len %d\", len);\n\n\tmemcpy(buf, dpriv->cdesc, len);\n\n\t*host_endian = 0;\n\n\treturn len;\n}\n\nint\nnetbsd_get_config_descriptor(struct libusb_device *dev, uint8_t idx,\n    unsigned char *buf, size_t len, int *host_endian)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)dev->os_priv;\n\tstruct usb_full_desc ufd;\n\tint fd, err;\n\n\tusbi_dbg(\"index %d, len %d\", idx, len);\n\n\t/* A config descriptor may be requested before opening the device */\n\tif (dpriv->fd >= 0) {\n\t\tfd = dpriv->fd;\n\t} else {\n\t\tfd = open(dpriv->devnode, O_RDONLY);\n\t\tif (fd < 0)\n\t\t\treturn _errno_to_libusb(errno);\n\t}\n\n\tufd.ufd_config_index = idx;\n\tufd.ufd_size = len;\n\tufd.ufd_data = buf;\n\n\tif ((ioctl(fd, USB_GET_FULL_DESC, &ufd)) < 0) {\n\t\terr = errno;\n\t\tif (dpriv->fd < 0)\n\t\t\tclose(fd);\n\t\treturn _errno_to_libusb(err);\n\t}\n\n\tif (dpriv->fd < 0)\n\t\tclose(fd);\n\n\t*host_endian = 0;\n\n\treturn len;\n}\n\nint\nnetbsd_get_configuration(struct libusb_device_handle *handle, int *config)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;\n\n\tusbi_dbg(\"\");\n\n\tif (ioctl(dpriv->fd, USB_GET_CONFIG, config) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\tusbi_dbg(\"configuration %d\", *config);\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nnetbsd_set_configuration(struct libusb_device_handle *handle, int config)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;\n\n\tusbi_dbg(\"configuration %d\", config);\n\n\tif (ioctl(dpriv->fd, USB_SET_CONFIG, &config) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\treturn _cache_active_config_descriptor(handle->dev, dpriv->fd);\n}\n\nint\nnetbsd_claim_interface(struct libusb_device_handle *handle, int iface)\n{\n\tstruct handle_priv *hpriv = (struct handle_priv *)handle->os_priv;\n\tint i;\n\n\tfor (i = 0; i < USB_MAX_ENDPOINTS; i++)\n\t\thpriv->endpoints[i] = -1;\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nnetbsd_release_interface(struct libusb_device_handle *handle, int iface)\n{\n\tstruct handle_priv *hpriv = (struct handle_priv *)handle->os_priv;\n\tint i;\n\n\tfor (i = 0; i < USB_MAX_ENDPOINTS; i++)\n\t\tif (hpriv->endpoints[i] >= 0)\n\t\t\tclose(hpriv->endpoints[i]);\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nnetbsd_set_interface_altsetting(struct libusb_device_handle *handle, int iface,\n    int altsetting)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;\n\tstruct usb_alt_interface intf;\n\n\tusbi_dbg(\"iface %d, setting %d\", iface, altsetting);\n\n\tmemset(&intf, 0, sizeof(intf));\n\n\tintf.uai_interface_index = iface;\n\tintf.uai_alt_no = altsetting;\n\n\tif (ioctl(dpriv->fd, USB_SET_ALTINTERFACE, &intf) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nnetbsd_clear_halt(struct libusb_device_handle *handle, unsigned char endpoint)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;\n\tstruct usb_ctl_request req;\n\n\tusbi_dbg(\"\");\n\n\treq.ucr_request.bmRequestType = UT_WRITE_ENDPOINT;\n\treq.ucr_request.bRequest = UR_CLEAR_FEATURE;\n\tUSETW(req.ucr_request.wValue, UF_ENDPOINT_HALT);\n\tUSETW(req.ucr_request.wIndex, endpoint);\n\tUSETW(req.ucr_request.wLength, 0);\n\n\tif (ioctl(dpriv->fd, USB_DO_REQUEST, &req) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nnetbsd_reset_device(struct libusb_device_handle *handle)\n{\n\tusbi_dbg(\"\");\n\n\treturn (LIBUSB_ERROR_NOT_SUPPORTED);\n}\n\nvoid\nnetbsd_destroy_device(struct libusb_device *dev)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)dev->os_priv;\n\n\tusbi_dbg(\"\");\n\n\tfree(dpriv->cdesc);\n}\n\nint\nnetbsd_submit_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer;\n\tstruct handle_priv *hpriv;\n\tint err = 0;\n\n\tusbi_dbg(\"\");\n\n\ttransfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\thpriv = (struct handle_priv *)transfer->dev_handle->os_priv;\n\n\tswitch (transfer->type) {\n\tcase LIBUSB_TRANSFER_TYPE_CONTROL:\n\t\terr = _sync_control_transfer(itransfer);\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n\t\tif (IS_XFEROUT(transfer)) {\n\t\t\t/* Isochronous write is not supported */\n\t\t\terr = LIBUSB_ERROR_NOT_SUPPORTED;\n\t\t\tbreak;\n\t\t}\n\t\terr = _sync_gen_transfer(itransfer);\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\t\tif (IS_XFEROUT(transfer) &&\n\t\t    transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET) {\n\t\t\terr = LIBUSB_ERROR_NOT_SUPPORTED;\n\t\t\tbreak;\n\t\t}\n\t\terr = _sync_gen_transfer(itransfer);\n\t\tbreak;\n\t}\n\n\tif (err)\n\t\treturn (err);\n\n\tif (write(hpriv->pipe[1], &itransfer, sizeof(itransfer)) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nnetbsd_cancel_transfer(struct usbi_transfer *itransfer)\n{\n\tusbi_dbg(\"\");\n\n\treturn (LIBUSB_ERROR_NOT_SUPPORTED);\n}\n\nvoid\nnetbsd_clear_transfer_priv(struct usbi_transfer *itransfer)\n{\n\tusbi_dbg(\"\");\n\n\t/* Nothing to do */\n}\n\nint\nnetbsd_handle_events(struct libusb_context *ctx, struct pollfd *fds, nfds_t nfds,\n    int num_ready)\n{\n\tstruct libusb_device_handle *handle;\n\tstruct handle_priv *hpriv = NULL;\n\tstruct usbi_transfer *itransfer;\n\tstruct pollfd *pollfd;\n\tint i, err = 0;\n\n\tusbi_dbg(\"\");\n\n\tpthread_mutex_lock(&ctx->open_devs_lock);\n\tfor (i = 0; i < nfds && num_ready > 0; i++) {\n\t\tpollfd = &fds[i];\n\n\t\tif (!pollfd->revents)\n\t\t\tcontinue;\n\n\t\thpriv = NULL;\n\t\tnum_ready--;\n\t\tlist_for_each_entry(handle, &ctx->open_devs, list,\n\t\t    struct libusb_device_handle) {\n\t\t\thpriv = (struct handle_priv *)handle->os_priv;\n\n\t\t\tif (hpriv->pipe[0] == pollfd->fd)\n\t\t\t\tbreak;\n\n\t\t\thpriv = NULL;\n\t\t}\n\n\t\tif (NULL == hpriv) {\n\t\t\tusbi_dbg(\"fd %d is not an event pipe!\", pollfd->fd);\n\t\t\terr = ENOENT;\n\t\t\tbreak;\n\t\t}\n\n\t\tif (pollfd->revents & POLLERR) {\n\t\t\tusbi_remove_pollfd(HANDLE_CTX(handle), hpriv->pipe[0]);\n\t\t\tusbi_handle_disconnect(handle);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (read(hpriv->pipe[0], &itransfer, sizeof(itransfer)) < 0) {\n\t\t\terr = errno;\n\t\t\tbreak;\n\t\t}\n\n\t\tif ((err = usbi_handle_transfer_completion(itransfer,\n\t\t    LIBUSB_TRANSFER_COMPLETED)))\n\t\t\tbreak;\n\t}\n\tpthread_mutex_unlock(&ctx->open_devs_lock);\n\n\tif (err)\n\t\treturn _errno_to_libusb(err);\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nnetbsd_clock_gettime(int clkid, struct timespec *tp)\n{\n\tusbi_dbg(\"clock %d\", clkid);\n\n\tif (clkid == USBI_CLOCK_REALTIME)\n\t\treturn clock_gettime(CLOCK_REALTIME, tp);\n\n\tif (clkid == USBI_CLOCK_MONOTONIC)\n\t\treturn clock_gettime(CLOCK_MONOTONIC, tp);\n\n\treturn (LIBUSB_ERROR_INVALID_PARAM);\n}\n\nint\n_errno_to_libusb(int err)\n{\n\tswitch (err) {\n\tcase EIO:\n\t\treturn (LIBUSB_ERROR_IO);\n\tcase EACCES:\n\t\treturn (LIBUSB_ERROR_ACCESS);\n\tcase ENOENT:\n\t\treturn (LIBUSB_ERROR_NO_DEVICE);\n\tcase ENOMEM:\n\t\treturn (LIBUSB_ERROR_NO_MEM);\n\t}\n\n\tusbi_dbg(\"error: %s\", strerror(err));\n\n\treturn (LIBUSB_ERROR_OTHER);\n}\n\nint\n_cache_active_config_descriptor(struct libusb_device *dev, int fd)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)dev->os_priv;\n\tstruct usb_config_desc ucd;\n\tstruct usb_full_desc ufd;\n\tunsigned char* buf;\n\tint len;\n\n\tusbi_dbg(\"fd %d\", fd);\n\n\tucd.ucd_config_index = USB_CURRENT_CONFIG_INDEX;\n\n\tif ((ioctl(fd, USB_GET_CONFIG_DESC, &ucd)) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\tusbi_dbg(\"active bLength %d\", ucd.ucd_desc.bLength);\n\n\tlen = UGETW(ucd.ucd_desc.wTotalLength);\n\tbuf = malloc(len);\n\tif (buf == NULL)\n\t\treturn (LIBUSB_ERROR_NO_MEM);\n\n\tufd.ufd_config_index = ucd.ucd_config_index;\n\tufd.ufd_size = len;\n\tufd.ufd_data = buf;\n\n\tusbi_dbg(\"index %d, len %d\", ufd.ufd_config_index, len);\n\n\tif ((ioctl(fd, USB_GET_FULL_DESC, &ufd)) < 0) {\n\t\tfree(buf);\n\t\treturn _errno_to_libusb(errno);\n\t}\n\n\tif (dpriv->cdesc)\n\t\tfree(dpriv->cdesc);\n\tdpriv->cdesc = buf;\n\n\treturn (0);\n}\n\nint\n_sync_control_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer;\n\tstruct libusb_control_setup *setup;\n\tstruct device_priv *dpriv;\n\tstruct usb_ctl_request req;\n\n\ttransfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tdpriv = (struct device_priv *)transfer->dev_handle->dev->os_priv;\n\tsetup = (struct libusb_control_setup *)transfer->buffer;\n\n\tusbi_dbg(\"type %d request %d value %d index %d length %d timeout %d\",\n\t    setup->bmRequestType, setup->bRequest,\n\t    libusb_le16_to_cpu(setup->wValue),\n\t    libusb_le16_to_cpu(setup->wIndex),\n\t    libusb_le16_to_cpu(setup->wLength), transfer->timeout);\n\n\treq.ucr_request.bmRequestType = setup->bmRequestType;\n\treq.ucr_request.bRequest = setup->bRequest;\n\t/* Don't use USETW, libusb already deals with the endianness */\n\t(*(uint16_t *)req.ucr_request.wValue) = setup->wValue;\n\t(*(uint16_t *)req.ucr_request.wIndex) = setup->wIndex;\n\t(*(uint16_t *)req.ucr_request.wLength) = setup->wLength;\n\treq.ucr_data = transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE;\n\n\tif ((transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) == 0)\n\t\treq.ucr_flags = USBD_SHORT_XFER_OK;\n\n\tif ((ioctl(dpriv->fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\tif ((ioctl(dpriv->fd, USB_DO_REQUEST, &req)) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\titransfer->transferred = req.ucr_actlen;\n\n\tusbi_dbg(\"transferred %d\", itransfer->transferred);\n\n\treturn (0);\n}\n\nint\n_access_endpoint(struct libusb_transfer *transfer)\n{\n\tstruct handle_priv *hpriv;\n\tstruct device_priv *dpriv;\n\tchar *s, devnode[16];\n\tint fd, endpt;\n\tmode_t mode;\n\n\thpriv = (struct handle_priv *)transfer->dev_handle->os_priv;\n\tdpriv = (struct device_priv *)transfer->dev_handle->dev->os_priv;\n\n\tendpt = UE_GET_ADDR(transfer->endpoint);\n\tmode = IS_XFERIN(transfer) ? O_RDONLY : O_WRONLY;\n\n\tusbi_dbg(\"endpoint %d mode %d\", endpt, mode);\n\n\tif (hpriv->endpoints[endpt] < 0) {\n\t\t/* Pick the right node given the control one */\n\t\tstrlcpy(devnode, dpriv->devnode, sizeof(devnode));\n\t\ts = strchr(devnode, '.');\n\t\tsnprintf(s, 4, \".%02d\", endpt);\n\n\t\t/* We may need to read/write to the same endpoint later. */\n\t\tif (((fd = open(devnode, O_RDWR)) < 0) && (errno == ENXIO))\n\t\t\tif ((fd = open(devnode, mode)) < 0)\n\t\t\t\treturn (-1);\n\n\t\thpriv->endpoints[endpt] = fd;\n\t}\n\n\treturn (hpriv->endpoints[endpt]);\n}\n\nint\n_sync_gen_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer;\n\tint fd, nr = 1;\n\n\ttransfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n\t/*\n\t * Bulk, Interrupt or Isochronous transfer depends on the\n\t * endpoint and thus the node to open.\n\t */\n\tif ((fd = _access_endpoint(transfer)) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\tif ((ioctl(fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\tif (IS_XFERIN(transfer)) {\n\t\tif ((transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) == 0)\n\t\t\tif ((ioctl(fd, USB_SET_SHORT_XFER, &nr)) < 0)\n\t\t\t\treturn _errno_to_libusb(errno);\n\n\t\tnr = read(fd, transfer->buffer, transfer->length);\n\t} else {\n\t\tnr = write(fd, transfer->buffer, transfer->length);\n\t}\n\n\tif (nr < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\titransfer->transferred = nr;\n\n\treturn (0);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/openbsd_usb.c",
    "content": "/*\n * Copyright © 2011-2013 Martin Pieuchot <mpi@openbsd.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <sys/time.h>\n#include <sys/types.h>\n\n#include <errno.h>\n#include <fcntl.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n\n#include <dev/usb/usb.h>\n\n#include \"libusb.h\"\n#include \"libusbi.h\"\n\nstruct device_priv {\n\tchar *devname;\t\t\t\t/* name of the ugen(4) node */\n\tint fd;\t\t\t\t\t/* device file descriptor */\n\n\tunsigned char *cdesc;\t\t\t/* active config descriptor */\n\tusb_device_descriptor_t ddesc;\t\t/* usb device descriptor */\n};\n\nstruct handle_priv {\n\tint pipe[2];\t\t\t\t/* for event notification */\n\tint endpoints[USB_MAX_ENDPOINTS];\n};\n\n/*\n * Backend functions\n */\nstatic int obsd_get_device_list(struct libusb_context *,\n    struct discovered_devs **);\nstatic int obsd_open(struct libusb_device_handle *);\nstatic void obsd_close(struct libusb_device_handle *);\n\nstatic int obsd_get_device_descriptor(struct libusb_device *, unsigned char *,\n    int *);\nstatic int obsd_get_active_config_descriptor(struct libusb_device *,\n    unsigned char *, size_t, int *);\nstatic int obsd_get_config_descriptor(struct libusb_device *, uint8_t,\n    unsigned char *, size_t, int *);\n\nstatic int obsd_get_configuration(struct libusb_device_handle *, int *);\nstatic int obsd_set_configuration(struct libusb_device_handle *, int);\n\nstatic int obsd_claim_interface(struct libusb_device_handle *, int);\nstatic int obsd_release_interface(struct libusb_device_handle *, int);\n\nstatic int obsd_set_interface_altsetting(struct libusb_device_handle *, int,\n    int);\nstatic int obsd_clear_halt(struct libusb_device_handle *, unsigned char);\nstatic int obsd_reset_device(struct libusb_device_handle *);\nstatic void obsd_destroy_device(struct libusb_device *);\n\nstatic int obsd_submit_transfer(struct usbi_transfer *);\nstatic int obsd_cancel_transfer(struct usbi_transfer *);\nstatic void obsd_clear_transfer_priv(struct usbi_transfer *);\nstatic int obsd_handle_events(struct libusb_context *ctx, struct pollfd *,\n    nfds_t, int);\nstatic int obsd_clock_gettime(int, struct timespec *);\n\n/*\n * Private functions\n */\nstatic int _errno_to_libusb(int);\nstatic int _cache_active_config_descriptor(struct libusb_device *);\nstatic int _sync_control_transfer(struct usbi_transfer *);\nstatic int _sync_gen_transfer(struct usbi_transfer *);\nstatic int _access_endpoint(struct libusb_transfer *);\n\nstatic int _bus_open(int);\n\n\nconst struct usbi_os_backend openbsd_backend = {\n\t\"Synchronous OpenBSD backend\",\n\t0,\n\tNULL,\t\t\t\t/* init() */\n\tNULL,\t\t\t\t/* exit() */\n\tobsd_get_device_list,\n\tNULL,\t\t\t\t/* hotplug_poll */\n\tobsd_open,\n\tobsd_close,\n\n\tobsd_get_device_descriptor,\n\tobsd_get_active_config_descriptor,\n\tobsd_get_config_descriptor,\n\tNULL,\t\t\t\t/* get_config_descriptor_by_value() */\n\n\tobsd_get_configuration,\n\tobsd_set_configuration,\n\n\tobsd_claim_interface,\n\tobsd_release_interface,\n\n\tobsd_set_interface_altsetting,\n\tobsd_clear_halt,\n\tobsd_reset_device,\n\n\tNULL,\t\t\t\t/* kernel_driver_active() */\n\tNULL,\t\t\t\t/* detach_kernel_driver() */\n\tNULL,\t\t\t\t/* attach_kernel_driver() */\n\n\tobsd_destroy_device,\n\n\tobsd_submit_transfer,\n\tobsd_cancel_transfer,\n\tobsd_clear_transfer_priv,\n\n\tobsd_handle_events,\n\n\tobsd_clock_gettime,\n\tsizeof(struct device_priv),\n\tsizeof(struct handle_priv),\n\t0,\t\t\t\t/* transfer_priv_size */\n\t0,\t\t\t\t/* add_iso_packet_size */\n};\n\n#define DEVPATH\t\"/dev/\"\n#define USBDEV\tDEVPATH \"usb\"\n\nint\nobsd_get_device_list(struct libusb_context * ctx,\n\tstruct discovered_devs **discdevs)\n{\n\tstruct discovered_devs *ddd;\n\tstruct libusb_device *dev;\n\tstruct device_priv *dpriv;\n\tstruct usb_device_info di;\n\tstruct usb_device_ddesc dd;\n\tunsigned long session_id;\n\tchar devices[USB_MAX_DEVICES];\n\tchar busnode[16];\n\tchar *udevname;\n\tint fd, addr, i, j;\n\n\tusbi_dbg(\"\");\n\n\tfor (i = 0; i < 8; i++) {\n\t\tsnprintf(busnode, sizeof(busnode), USBDEV \"%d\", i);\n\n\t\tif ((fd = open(busnode, O_RDWR)) < 0) {\n\t\t\tif (errno != ENOENT && errno != ENXIO)\n\t\t\t\tusbi_err(ctx, \"could not open %s\", busnode);\n\t\t\tcontinue;\n\t\t}\n\n\t\tbzero(devices, sizeof(devices));\n\t\tfor (addr = 1; addr < USB_MAX_DEVICES; addr++) {\n\t\t\tif (devices[addr])\n\t\t\t\tcontinue;\n\n\t\t\tdi.udi_addr = addr;\n\t\t\tif (ioctl(fd, USB_DEVICEINFO, &di) < 0)\n\t\t\t\tcontinue;\n\n\t\t\t/*\n\t\t\t * XXX If ugen(4) is attached to the USB device\n\t\t\t * it will be used.\n\t\t\t */\n\t\t\tudevname = NULL;\n\t\t\tfor (j = 0; j < USB_MAX_DEVNAMES; j++)\n\t\t\t\tif (!strncmp(\"ugen\", di.udi_devnames[j], 4)) {\n\t\t\t\t\tudevname = strdup(di.udi_devnames[j]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\tsession_id = (di.udi_bus << 8 | di.udi_addr);\n\t\t\tdev = usbi_get_device_by_session_id(ctx, session_id);\n\n\t\t\tif (dev == NULL) {\n\t\t\t\tdev = usbi_alloc_device(ctx, session_id);\n\t\t\t\tif (dev == NULL) {\n\t\t\t\t\tclose(fd);\n\t\t\t\t\treturn (LIBUSB_ERROR_NO_MEM);\n\t\t\t\t}\n\n\t\t\t\tdev->bus_number = di.udi_bus;\n\t\t\t\tdev->device_address = di.udi_addr;\n\t\t\t\tdev->speed = di.udi_speed;\n\n\t\t\t\tdpriv = (struct device_priv *)dev->os_priv;\n\t\t\t\tdpriv->fd = -1;\n\t\t\t\tdpriv->cdesc = NULL;\n\t\t\t\tdpriv->devname = udevname;\n\n\t\t\t\tdd.udd_bus = di.udi_bus;\n\t\t\t\tdd.udd_addr = di.udi_addr;\n\t\t\t\tif (ioctl(fd, USB_DEVICE_GET_DDESC, &dd) < 0) {\n\t\t\t\t\tlibusb_unref_device(dev);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tdpriv->ddesc = dd.udd_desc;\n\n\t\t\t\tif (_cache_active_config_descriptor(dev)) {\n\t\t\t\t\tlibusb_unref_device(dev);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (usbi_sanitize_device(dev)) {\n\t\t\t\t\tlibusb_unref_device(dev);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tddd = discovered_devs_append(*discdevs, dev);\n\t\t\tif (ddd == NULL) {\n\t\t\t\tclose(fd);\n\t\t\t\treturn (LIBUSB_ERROR_NO_MEM);\n\t\t\t}\n\t\t\tlibusb_unref_device(dev);\n\n\t\t\t*discdevs = ddd;\n\t\t\tdevices[addr] = 1;\n\t\t}\n\n\t\tclose(fd);\n\t}\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nobsd_open(struct libusb_device_handle *handle)\n{\n\tstruct handle_priv *hpriv = (struct handle_priv *)handle->os_priv;\n\tstruct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;\n\tchar devnode[16];\n\n\tif (dpriv->devname) {\n\t\t/*\n\t\t * Only open ugen(4) attached devices read-write, all\n\t\t * read-only operations are done through the bus node.\n\t\t */\n\t\tsnprintf(devnode, sizeof(devnode), DEVPATH \"%s.00\",\n\t\t    dpriv->devname);\n\t\tdpriv->fd = open(devnode, O_RDWR);\n\t\tif (dpriv->fd < 0)\n\t\t\treturn _errno_to_libusb(errno);\n\n\t\tusbi_dbg(\"open %s: fd %d\", devnode, dpriv->fd);\n\t}\n\n\tif (pipe(hpriv->pipe) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\treturn usbi_add_pollfd(HANDLE_CTX(handle), hpriv->pipe[0], POLLIN);\n}\n\nvoid\nobsd_close(struct libusb_device_handle *handle)\n{\n\tstruct handle_priv *hpriv = (struct handle_priv *)handle->os_priv;\n\tstruct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;\n\n\tif (dpriv->devname) {\n\t\tusbi_dbg(\"close: fd %d\", dpriv->fd);\n\n\t\tclose(dpriv->fd);\n\t\tdpriv->fd = -1;\n\t}\n\n\tusbi_remove_pollfd(HANDLE_CTX(handle), hpriv->pipe[0]);\n\n\tclose(hpriv->pipe[0]);\n\tclose(hpriv->pipe[1]);\n}\n\nint\nobsd_get_device_descriptor(struct libusb_device *dev, unsigned char *buf,\n    int *host_endian)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)dev->os_priv;\n\n\tusbi_dbg(\"\");\n\n\tmemcpy(buf, &dpriv->ddesc, DEVICE_DESC_LENGTH);\n\n\t*host_endian = 0;\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nobsd_get_active_config_descriptor(struct libusb_device *dev,\n    unsigned char *buf, size_t len, int *host_endian)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)dev->os_priv;\n\tusb_config_descriptor_t *ucd = (usb_config_descriptor_t *)dpriv->cdesc;\n\n\tlen = MIN(len, UGETW(ucd->wTotalLength));\n\n\tusbi_dbg(\"len %d\", len);\n\n\tmemcpy(buf, dpriv->cdesc, len);\n\n\t*host_endian = 0;\n\n\treturn (len);\n}\n\nint\nobsd_get_config_descriptor(struct libusb_device *dev, uint8_t idx,\n    unsigned char *buf, size_t len, int *host_endian)\n{\n\tstruct usb_device_fdesc udf;\n\tint fd, err;\n\n\tif ((fd = _bus_open(dev->bus_number)) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\tudf.udf_bus = dev->bus_number;\n\tudf.udf_addr = dev->device_address;\n\tudf.udf_config_index = idx;\n\tudf.udf_size = len;\n\tudf.udf_data = buf;\n\n\tusbi_dbg(\"index %d, len %d\", udf.udf_config_index, len);\n\n\tif (ioctl(fd, USB_DEVICE_GET_FDESC, &udf) < 0) {\n\t\terr = errno;\n\t\tclose(fd);\n\t\treturn _errno_to_libusb(err);\n\t}\n\tclose(fd);\n\n\t*host_endian = 0;\n\n\treturn (len);\n}\n\nint\nobsd_get_configuration(struct libusb_device_handle *handle, int *config)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;\n\tusb_config_descriptor_t *ucd = (usb_config_descriptor_t *)dpriv->cdesc;\n\n\t*config = ucd->bConfigurationValue;\n\n\tusbi_dbg(\"bConfigurationValue %d\", *config);\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nobsd_set_configuration(struct libusb_device_handle *handle, int config)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;\n\n\tif (dpriv->devname == NULL)\n\t\treturn (LIBUSB_ERROR_NOT_SUPPORTED);\n\n\tusbi_dbg(\"bConfigurationValue %d\", config);\n\n\tif (ioctl(dpriv->fd, USB_SET_CONFIG, &config) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\treturn _cache_active_config_descriptor(handle->dev);\n}\n\nint\nobsd_claim_interface(struct libusb_device_handle *handle, int iface)\n{\n\tstruct handle_priv *hpriv = (struct handle_priv *)handle->os_priv;\n\tint i;\n\n\tfor (i = 0; i < USB_MAX_ENDPOINTS; i++)\n\t\thpriv->endpoints[i] = -1;\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nobsd_release_interface(struct libusb_device_handle *handle, int iface)\n{\n\tstruct handle_priv *hpriv = (struct handle_priv *)handle->os_priv;\n\tint i;\n\n\tfor (i = 0; i < USB_MAX_ENDPOINTS; i++)\n\t\tif (hpriv->endpoints[i] >= 0)\n\t\t\tclose(hpriv->endpoints[i]);\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nobsd_set_interface_altsetting(struct libusb_device_handle *handle, int iface,\n    int altsetting)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)handle->dev->os_priv;\n\tstruct usb_alt_interface intf;\n\n\tif (dpriv->devname == NULL)\n\t\treturn (LIBUSB_ERROR_NOT_SUPPORTED);\n\n\tusbi_dbg(\"iface %d, setting %d\", iface, altsetting);\n\n\tmemset(&intf, 0, sizeof(intf));\n\n\tintf.uai_interface_index = iface;\n\tintf.uai_alt_no = altsetting;\n\n\tif (ioctl(dpriv->fd, USB_SET_ALTINTERFACE, &intf) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nobsd_clear_halt(struct libusb_device_handle *handle, unsigned char endpoint)\n{\n\tstruct usb_ctl_request req;\n\tint fd, err;\n\n\tif ((fd = _bus_open(handle->dev->bus_number)) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\tusbi_dbg(\"\");\n\n\treq.ucr_addr = handle->dev->device_address;\n\treq.ucr_request.bmRequestType = UT_WRITE_ENDPOINT;\n\treq.ucr_request.bRequest = UR_CLEAR_FEATURE;\n\tUSETW(req.ucr_request.wValue, UF_ENDPOINT_HALT);\n\tUSETW(req.ucr_request.wIndex, endpoint);\n\tUSETW(req.ucr_request.wLength, 0);\n\n\tif (ioctl(fd, USB_REQUEST, &req) < 0) {\n\t\terr = errno;\n\t\tclose(fd);\n\t\treturn _errno_to_libusb(err);\n\t}\n\tclose(fd);\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nobsd_reset_device(struct libusb_device_handle *handle)\n{\n\tusbi_dbg(\"\");\n\n\treturn (LIBUSB_ERROR_NOT_SUPPORTED);\n}\n\nvoid\nobsd_destroy_device(struct libusb_device *dev)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)dev->os_priv;\n\n\tusbi_dbg(\"\");\n\n\tfree(dpriv->cdesc);\n\tfree(dpriv->devname);\n}\n\nint\nobsd_submit_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer;\n\tstruct handle_priv *hpriv;\n\tint err = 0;\n\n\tusbi_dbg(\"\");\n\n\ttransfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\thpriv = (struct handle_priv *)transfer->dev_handle->os_priv;\n\n\tswitch (transfer->type) {\n\tcase LIBUSB_TRANSFER_TYPE_CONTROL:\n\t\terr = _sync_control_transfer(itransfer);\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n\t\tif (IS_XFEROUT(transfer)) {\n\t\t\t/* Isochronous write is not supported */\n\t\t\terr = LIBUSB_ERROR_NOT_SUPPORTED;\n\t\t\tbreak;\n\t\t}\n\t\terr = _sync_gen_transfer(itransfer);\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\t\tif (IS_XFEROUT(transfer) &&\n\t\t    transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET) {\n\t\t\terr = LIBUSB_ERROR_NOT_SUPPORTED;\n\t\t\tbreak;\n\t\t}\n\t\terr = _sync_gen_transfer(itransfer);\n\t\tbreak;\n\t}\n\n\tif (err)\n\t\treturn (err);\n\n\tif (write(hpriv->pipe[1], &itransfer, sizeof(itransfer)) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nobsd_cancel_transfer(struct usbi_transfer *itransfer)\n{\n\tusbi_dbg(\"\");\n\n\treturn (LIBUSB_ERROR_NOT_SUPPORTED);\n}\n\nvoid\nobsd_clear_transfer_priv(struct usbi_transfer *itransfer)\n{\n\tusbi_dbg(\"\");\n\n\t/* Nothing to do */\n}\n\nint\nobsd_handle_events(struct libusb_context *ctx, struct pollfd *fds, nfds_t nfds,\n    int num_ready)\n{\n\tstruct libusb_device_handle *handle;\n\tstruct handle_priv *hpriv = NULL;\n\tstruct usbi_transfer *itransfer;\n\tstruct pollfd *pollfd;\n\tint i, err = 0;\n\n\tusbi_dbg(\"\");\n\n\tpthread_mutex_lock(&ctx->open_devs_lock);\n\tfor (i = 0; i < nfds && num_ready > 0; i++) {\n\t\tpollfd = &fds[i];\n\n\t\tif (!pollfd->revents)\n\t\t\tcontinue;\n\n\t\thpriv = NULL;\n\t\tnum_ready--;\n\t\tlist_for_each_entry(handle, &ctx->open_devs, list,\n\t\t    struct libusb_device_handle) {\n\t\t\thpriv = (struct handle_priv *)handle->os_priv;\n\n\t\t\tif (hpriv->pipe[0] == pollfd->fd)\n\t\t\t\tbreak;\n\n\t\t\thpriv = NULL;\n\t\t}\n\n\t\tif (NULL == hpriv) {\n\t\t\tusbi_dbg(\"fd %d is not an event pipe!\", pollfd->fd);\n\t\t\terr = ENOENT;\n\t\t\tbreak;\n\t\t}\n\n\t\tif (pollfd->revents & POLLERR) {\n\t\t\tusbi_remove_pollfd(HANDLE_CTX(handle), hpriv->pipe[0]);\n\t\t\tusbi_handle_disconnect(handle);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (read(hpriv->pipe[0], &itransfer, sizeof(itransfer)) < 0) {\n\t\t\terr = errno;\n\t\t\tbreak;\n\t\t}\n\n\t\tif ((err = usbi_handle_transfer_completion(itransfer,\n\t\t    LIBUSB_TRANSFER_COMPLETED)))\n\t\t\tbreak;\n\t}\n\tpthread_mutex_unlock(&ctx->open_devs_lock);\n\n\tif (err)\n\t\treturn _errno_to_libusb(err);\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\nobsd_clock_gettime(int clkid, struct timespec *tp)\n{\n\tusbi_dbg(\"clock %d\", clkid);\n\n\tif (clkid == USBI_CLOCK_REALTIME)\n\t\treturn clock_gettime(CLOCK_REALTIME, tp);\n\n\tif (clkid == USBI_CLOCK_MONOTONIC)\n\t\treturn clock_gettime(CLOCK_MONOTONIC, tp);\n\n\treturn (LIBUSB_ERROR_INVALID_PARAM);\n}\n\nint\n_errno_to_libusb(int err)\n{\n\tusbi_dbg(\"error: %s (%d)\", strerror(err), err);\n\n\tswitch (err) {\n\tcase EIO:\n\t\treturn (LIBUSB_ERROR_IO);\n\tcase EACCES:\n\t\treturn (LIBUSB_ERROR_ACCESS);\n\tcase ENOENT:\n\t\treturn (LIBUSB_ERROR_NO_DEVICE);\n\tcase ENOMEM:\n\t\treturn (LIBUSB_ERROR_NO_MEM);\n\tcase ETIMEDOUT:\n\t\treturn (LIBUSB_ERROR_TIMEOUT);\n\t}\n\n\treturn (LIBUSB_ERROR_OTHER);\n}\n\nint\n_cache_active_config_descriptor(struct libusb_device *dev)\n{\n\tstruct device_priv *dpriv = (struct device_priv *)dev->os_priv;\n\tstruct usb_device_cdesc udc;\n\tstruct usb_device_fdesc udf;\n\tunsigned char* buf;\n\tint fd, len, err;\n\n\tif ((fd = _bus_open(dev->bus_number)) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\tusbi_dbg(\"fd %d, addr %d\", fd, dev->device_address);\n\n\tudc.udc_bus = dev->bus_number;\n\tudc.udc_addr = dev->device_address;\n\tudc.udc_config_index = USB_CURRENT_CONFIG_INDEX;\n\tif (ioctl(fd, USB_DEVICE_GET_CDESC, &udc) < 0) {\n\t\terr = errno;\n\t\tclose(fd);\n\t\treturn _errno_to_libusb(errno);\n\t}\n\n\tusbi_dbg(\"active bLength %d\", udc.udc_desc.bLength);\n\n\tlen = UGETW(udc.udc_desc.wTotalLength);\n\tbuf = malloc(len);\n\tif (buf == NULL)\n\t\treturn (LIBUSB_ERROR_NO_MEM);\n\n\tudf.udf_bus = dev->bus_number;\n\tudf.udf_addr = dev->device_address;\n\tudf.udf_config_index = udc.udc_config_index;\n\tudf.udf_size = len;\n\tudf.udf_data = buf;\n\n\tusbi_dbg(\"index %d, len %d\", udf.udf_config_index, len);\n\n\tif (ioctl(fd, USB_DEVICE_GET_FDESC, &udf) < 0) {\n\t\terr = errno;\n\t\tclose(fd);\n\t\tfree(buf);\n\t\treturn _errno_to_libusb(err);\n\t}\n\tclose(fd);\n\n\tif (dpriv->cdesc)\n\t\tfree(dpriv->cdesc);\n\tdpriv->cdesc = buf;\n\n\treturn (LIBUSB_SUCCESS);\n}\n\nint\n_sync_control_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer;\n\tstruct libusb_control_setup *setup;\n\tstruct device_priv *dpriv;\n\tstruct usb_ctl_request req;\n\n\ttransfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tdpriv = (struct device_priv *)transfer->dev_handle->dev->os_priv;\n\tsetup = (struct libusb_control_setup *)transfer->buffer;\n\n\tusbi_dbg(\"type %x request %x value %x index %d length %d timeout %d\",\n\t    setup->bmRequestType, setup->bRequest,\n\t    libusb_le16_to_cpu(setup->wValue),\n\t    libusb_le16_to_cpu(setup->wIndex),\n\t    libusb_le16_to_cpu(setup->wLength), transfer->timeout);\n\n\treq.ucr_addr = transfer->dev_handle->dev->device_address;\n\treq.ucr_request.bmRequestType = setup->bmRequestType;\n\treq.ucr_request.bRequest = setup->bRequest;\n\t/* Don't use USETW, libusb already deals with the endianness */\n\t(*(uint16_t *)req.ucr_request.wValue) = setup->wValue;\n\t(*(uint16_t *)req.ucr_request.wIndex) = setup->wIndex;\n\t(*(uint16_t *)req.ucr_request.wLength) = setup->wLength;\n\treq.ucr_data = transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE;\n\n\tif ((transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) == 0)\n\t\treq.ucr_flags = USBD_SHORT_XFER_OK;\n\n\tif (dpriv->devname == NULL) {\n\t\t/*\n\t\t * XXX If the device is not attached to ugen(4) it is\n\t\t * XXX still possible to submit a control transfer but\n\t\t * XXX with the default timeout only.\n\t\t */\n\t\tint fd, err;\n\n\t\tif ((fd = _bus_open(transfer->dev_handle->dev->bus_number)) < 0)\n\t\t\treturn _errno_to_libusb(errno);\n\n\t\tif ((ioctl(fd, USB_REQUEST, &req)) < 0) {\n\t\t\terr = errno;\n\t\t\tclose(fd);\n\t\t\treturn _errno_to_libusb(err);\n\t\t}\n\t\tclose(fd);\n\t} else {\n\t\tif ((ioctl(dpriv->fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0)\n\t\t\treturn _errno_to_libusb(errno);\n\n\t\tif ((ioctl(dpriv->fd, USB_DO_REQUEST, &req)) < 0)\n\t\t\treturn _errno_to_libusb(errno);\n\t}\n\n\titransfer->transferred = req.ucr_actlen;\n\n\tusbi_dbg(\"transferred %d\", itransfer->transferred);\n\n\treturn (0);\n}\n\nint\n_access_endpoint(struct libusb_transfer *transfer)\n{\n\tstruct handle_priv *hpriv;\n\tstruct device_priv *dpriv;\n\tchar devnode[16];\n\tint fd, endpt;\n\tmode_t mode;\n\n\thpriv = (struct handle_priv *)transfer->dev_handle->os_priv;\n\tdpriv = (struct device_priv *)transfer->dev_handle->dev->os_priv;\n\n\tendpt = UE_GET_ADDR(transfer->endpoint);\n\tmode = IS_XFERIN(transfer) ? O_RDONLY : O_WRONLY;\n\n\tusbi_dbg(\"endpoint %d mode %d\", endpt, mode);\n\n\tif (hpriv->endpoints[endpt] < 0) {\n\t\t/* Pick the right endpoint node */\n\t\tsnprintf(devnode, sizeof(devnode), DEVPATH \"%s.%02d\",\n\t\t    dpriv->devname, endpt);\n\n\t\t/* We may need to read/write to the same endpoint later. */\n\t\tif (((fd = open(devnode, O_RDWR)) < 0) && (errno == ENXIO))\n\t\t\tif ((fd = open(devnode, mode)) < 0)\n\t\t\t\treturn (-1);\n\n\t\thpriv->endpoints[endpt] = fd;\n\t}\n\n\treturn (hpriv->endpoints[endpt]);\n}\n\nint\n_sync_gen_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer;\n\tstruct device_priv *dpriv;\n\tint fd, nr = 1;\n\n\ttransfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tdpriv = (struct device_priv *)transfer->dev_handle->dev->os_priv;\n\n\tif (dpriv->devname == NULL)\n\t\treturn (LIBUSB_ERROR_NOT_SUPPORTED);\n\n\t/*\n\t * Bulk, Interrupt or Isochronous transfer depends on the\n\t * endpoint and thus the node to open.\n\t */\n\tif ((fd = _access_endpoint(transfer)) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\tif ((ioctl(fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\tif (IS_XFERIN(transfer)) {\n\t\tif ((transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) == 0)\n\t\t\tif ((ioctl(fd, USB_SET_SHORT_XFER, &nr)) < 0)\n\t\t\t\treturn _errno_to_libusb(errno);\n\n\t\tnr = read(fd, transfer->buffer, transfer->length);\n\t} else {\n\t\tnr = write(fd, transfer->buffer, transfer->length);\n\t}\n\n\tif (nr < 0)\n\t\treturn _errno_to_libusb(errno);\n\n\titransfer->transferred = nr;\n\n\treturn (0);\n}\n\nint\n_bus_open(int number)\n{\n\tchar busnode[16];\n\n\tsnprintf(busnode, sizeof(busnode), USBDEV \"%d\", number);\n\n\treturn open(busnode, O_RDWR);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/poll_posix.c",
    "content": "/*\n * poll_posix: poll compatibility wrapper for POSIX systems\n * Copyright © 2013 RealVNC Ltd.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n *\n */\n\n#include <unistd.h>\n#include <fcntl.h>\n#include <errno.h>\n#include <stdlib.h>\n\n#include \"libusbi.h\"\n\nint usbi_pipe(int pipefd[2])\n{\n\tint ret = pipe(pipefd);\n\tif (ret != 0) {\n\t\treturn ret;\n\t}\n\tret = fcntl(pipefd[1], F_GETFL);\n\tif (UNLIKELY(ret == -1)) {\n\t\tusbi_dbg(\"Failed to get pipe fd flags: %d\", errno);\n\t\tgoto err_close_pipe;\n\t}\n\tret = fcntl(pipefd[1], F_SETFL, ret | O_NONBLOCK);\n\tif (UNLIKELY(ret != 0)) {\n\t\tusbi_dbg(\"Failed to set non-blocking on new pipe: %d\", errno);\n\t\tgoto err_close_pipe;\n\t}\n\n\treturn 0;\n\nerr_close_pipe:\n\tusbi_close(pipefd[0]);\n\tusbi_close(pipefd[1]);\n\treturn ret;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/poll_posix.h",
    "content": "#ifndef LIBUSB_POLL_POSIX_H\n#define LIBUSB_POLL_POSIX_H\n\n#define usbi_write write\n#define usbi_read read\n#define usbi_close close\n#define usbi_poll poll\n\nint usbi_pipe(int pipefd[2]);\n\n#endif /* LIBUSB_POLL_POSIX_H */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/poll_posix_original.c",
    "content": "/*\n * poll_posix: poll compatibility wrapper for POSIX systems\n * Copyright © 2013 RealVNC Ltd.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n *\n */\n\n#include <unistd.h>\n#include <fcntl.h>\n#include <errno.h>\n#include <stdlib.h>\n\n#include \"libusbi.h\"\n\nint usbi_pipe(int pipefd[2])\n{\n\tint ret = pipe(pipefd);\n\tif (ret != 0) {\n\t\treturn ret;\n\t}\n\tret = fcntl(pipefd[1], F_GETFL);\n\tif (ret == -1) {\n\t\tusbi_dbg(\"Failed to get pipe fd flags: %d\", errno);\n\t\tgoto err_close_pipe;\n\t}\n\tret = fcntl(pipefd[1], F_SETFL, ret | O_NONBLOCK);\n\tif (ret != 0) {\n\t\tusbi_dbg(\"Failed to set non-blocking on new pipe: %d\", errno);\n\t\tgoto err_close_pipe;\n\t}\n\n\treturn 0;\n\nerr_close_pipe:\n\tusbi_close(pipefd[0]);\n\tusbi_close(pipefd[1]);\n\treturn ret;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/poll_windows.c",
    "content": "/*\n * poll_windows: poll compatibility wrapper for Windows\n * Copyright © 2012-2013 RealVNC Ltd.\n * Copyright © 2009-2010 Pete Batard <pete@akeo.ie>\n * With contributions from Michael Plante, Orin Eman et al.\n * Parts of poll implementation from libusb-win32, by Stephan Meyer et al.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n *\n */\n\n/*\n * poll() and pipe() Windows compatibility layer for libusb 1.0\n *\n * The way this layer works is by using OVERLAPPED with async I/O transfers, as\n * OVERLAPPED have an associated event which is flagged for I/O completion.\n *\n * For USB pollable async I/O, you would typically:\n * - obtain a Windows HANDLE to a file or device that has been opened in\n *   OVERLAPPED mode\n * - call usbi_create_fd with this handle to obtain a custom fd.\n *   Note that if you need simultaneous R/W access, you need to call create_fd\n *   twice, once in RW_READ and once in RW_WRITE mode to obtain 2 separate\n *   pollable fds\n * - leave the core functions call the poll routine and flag POLLIN/POLLOUT\n *\n * The pipe pollable synchronous I/O works using the overlapped event associated\n * with a fake pipe. The read/write functions are only meant to be used in that\n * context.\n */\n#include <errno.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"libusbi.h\"\n\n// Uncomment to debug the polling layer\n//#define DEBUG_POLL_WINDOWS\n#if defined(DEBUG_POLL_WINDOWS)\n#define poll_dbg usbi_dbg\n#else\n// MSVC++ < 2005 cannot use a variadic argument and non MSVC\n// compilers produce warnings if parenthesis are ommitted.\n#if defined(_MSC_VER) && (_MSC_VER < 1400)\n#define poll_dbg\n#else\n#define poll_dbg(...)\n#endif\n#endif\n\n#if defined(_PREFAST_)\n#pragma warning(disable:28719)\n#endif\n\n#define CHECK_INIT_POLLING do {if(!is_polling_set) init_polling();} while(0)\n\n// public fd data\nconst struct winfd INVALID_WINFD = {-1, INVALID_HANDLE_VALUE, NULL, NULL, NULL, RW_NONE};\nstruct winfd poll_fd[MAX_FDS];\n// internal fd data\nstruct {\n\tCRITICAL_SECTION mutex; // lock for fds\n\t// Additional variables for XP CancelIoEx partial emulation\n\tHANDLE original_handle;\n\tDWORD thread_id;\n} _poll_fd[MAX_FDS];\n\n// globals\nBOOLEAN is_polling_set = FALSE;\nLONG pipe_number = 0;\nstatic volatile LONG compat_spinlock = 0;\n\n#if !defined(_WIN32_WCE)\n// CancelIoEx, available on Vista and later only, provides the ability to cancel\n// a single transfer (OVERLAPPED) when used. As it may not be part of any of the\n// platform headers, we hook into the Kernel32 system DLL directly to seek it.\nstatic BOOL (__stdcall *pCancelIoEx)(HANDLE, LPOVERLAPPED) = NULL;\n#define Use_Duplicate_Handles (pCancelIoEx == NULL)\n\nstatic inline void setup_cancel_io(void)\n{\n\tHMODULE hKernel32 = GetModuleHandleA(\"KERNEL32\");\n\tif (hKernel32 != NULL) {\n\t\tpCancelIoEx = (BOOL (__stdcall *)(HANDLE,LPOVERLAPPED))\n\t\t\tGetProcAddress(hKernel32, \"CancelIoEx\");\n\t}\n\tusbi_dbg(\"Will use CancelIo%s for I/O cancellation\",\n\t\tUse_Duplicate_Handles?\"\":\"Ex\");\n}\n\nstatic inline BOOL cancel_io(int _index)\n{\n\tif ((_index < 0) || (_index >= MAX_FDS)) {\n\t\treturn FALSE;\n\t}\n\n\tif ( (poll_fd[_index].fd < 0) || (poll_fd[_index].handle == INVALID_HANDLE_VALUE)\n\t  || (poll_fd[_index].handle == 0) || (poll_fd[_index].overlapped == NULL) ) {\n\t\treturn TRUE;\n\t}\n\tif (poll_fd[_index].itransfer && poll_fd[_index].cancel_fn) {\n\t\t// Cancel outstanding transfer via the specific callback\n\t\t(*poll_fd[_index].cancel_fn)(poll_fd[_index].itransfer);\n\t\treturn TRUE;\n\t}\n\tif (pCancelIoEx != NULL) {\n\t\treturn (*pCancelIoEx)(poll_fd[_index].handle, poll_fd[_index].overlapped);\n\t}\n\tif (_poll_fd[_index].thread_id == GetCurrentThreadId()) {\n\t\treturn CancelIo(poll_fd[_index].handle);\n\t}\n\tusbi_warn(NULL, \"Unable to cancel I/O that was started from another thread\");\n\treturn FALSE;\n}\n#else\n#define Use_Duplicate_Handles FALSE\n\nstatic __inline void setup_cancel_io()\n{\n\t// No setup needed on WinCE\n}\n\nstatic __inline BOOL cancel_io(int _index)\n{\n\tif ((_index < 0) || (_index >= MAX_FDS)) {\n\t\treturn FALSE;\n\t}\n\tif ( (poll_fd[_index].fd < 0) || (poll_fd[_index].handle == INVALID_HANDLE_VALUE)\n\t  || (poll_fd[_index].handle == 0) || (poll_fd[_index].overlapped == NULL) ) {\n\t\treturn TRUE;\n\t}\n\tif (poll_fd[_index].itransfer && poll_fd[_index].cancel_fn) {\n\t\t// Cancel outstanding transfer via the specific callback\n\t\t(*poll_fd[_index].cancel_fn)(poll_fd[_index].itransfer);\n\t}\n\treturn TRUE;\n}\n#endif\n\n// Init\nvoid init_polling(void)\n{\n\tint i;\n\n\twhile (InterlockedExchange((LONG *)&compat_spinlock, 1) == 1) {\n\t\tSleepEx(0, TRUE);\n\t}\n\tif (!is_polling_set) {\n\t\tsetup_cancel_io();\n\t\tfor (i=0; i<MAX_FDS; i++) {\n\t\t\tpoll_fd[i] = INVALID_WINFD;\n\t\t\t_poll_fd[i].original_handle = INVALID_HANDLE_VALUE;\n\t\t\t_poll_fd[i].thread_id = 0;\n\t\t\tInitializeCriticalSection(&_poll_fd[i].mutex);\n\t\t}\n\t\tis_polling_set = TRUE;\n\t}\n\tInterlockedExchange((LONG *)&compat_spinlock, 0);\n}\n\n// Internal function to retrieve the table index (and lock the fd mutex)\nstatic int _fd_to_index_and_lock(int fd)\n{\n\tint i;\n\n\tif (fd < 0)\n\t\treturn -1;\n\n\tfor (i=0; i<MAX_FDS; i++) {\n\t\tif (poll_fd[i].fd == fd) {\n\t\t\tEnterCriticalSection(&_poll_fd[i].mutex);\n\t\t\t// fd might have changed before we got to critical\n\t\t\tif (poll_fd[i].fd != fd) {\n\t\t\t\tLeaveCriticalSection(&_poll_fd[i].mutex);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\nstatic OVERLAPPED *create_overlapped(void)\n{\n\tOVERLAPPED *overlapped = (OVERLAPPED*) calloc(1, sizeof(OVERLAPPED));\n\tif (overlapped == NULL) {\n\t\treturn NULL;\n\t}\n\toverlapped->hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);\n\tif(overlapped->hEvent == NULL) {\n\t\tfree (overlapped);\n\t\treturn NULL;\n\t}\n\treturn overlapped;\n}\n\nstatic void free_overlapped(OVERLAPPED *overlapped)\n{\n\tif (overlapped == NULL)\n\t\treturn;\n\n\tif ( (overlapped->hEvent != 0)\n\t  && (overlapped->hEvent != INVALID_HANDLE_VALUE) ) {\n\t\tCloseHandle(overlapped->hEvent);\n\t}\n\tfree(overlapped);\n}\n\nvoid exit_polling(void)\n{\n\tint i;\n\n\twhile (InterlockedExchange((LONG *)&compat_spinlock, 1) == 1) {\n\t\tSleepEx(0, TRUE);\n\t}\n\tif (is_polling_set) {\n\t\tis_polling_set = FALSE;\n\n\t\tfor (i=0; i<MAX_FDS; i++) {\n\t\t\t// Cancel any async I/O (handle can be invalid)\n\t\t\tcancel_io(i);\n\t\t\t// If anything was pending on that I/O, it should be\n\t\t\t// terminating, and we should be able to access the fd\n\t\t\t// mutex lock before too long\n\t\t\tEnterCriticalSection(&_poll_fd[i].mutex);\n\t\t\tfree_overlapped(poll_fd[i].overlapped);\n\t\t\tif (Use_Duplicate_Handles) {\n\t\t\t\t// Close duplicate handle\n\t\t\t\tif (_poll_fd[i].original_handle != INVALID_HANDLE_VALUE) {\n\t\t\t\t\tCloseHandle(poll_fd[i].handle);\n\t\t\t\t}\n\t\t\t}\n\t\t\tpoll_fd[i] = INVALID_WINFD;\n\t\t\tLeaveCriticalSection(&_poll_fd[i].mutex);\n\t\t\tDeleteCriticalSection(&_poll_fd[i].mutex);\n\t\t}\n\t}\n\tInterlockedExchange((LONG *)&compat_spinlock, 0);\n}\n\n/*\n * Create a fake pipe.\n * As libusb only uses pipes for signaling, all we need from a pipe is an\n * event. To that extent, we create a single wfd and overlapped as a means\n * to access that event.\n */\nint usbi_pipe(int filedes[2])\n{\n\tint i;\n\tOVERLAPPED* overlapped;\n\n\tCHECK_INIT_POLLING;\n\n\toverlapped = create_overlapped();\n\n\tif (overlapped == NULL) {\n\t\treturn -1;\n\t}\n\t// The overlapped must have status pending for signaling to work in poll\n\toverlapped->Internal = STATUS_PENDING;\n\toverlapped->InternalHigh = 0;\n\n\tfor (i=0; i<MAX_FDS; i++) {\n\t\tif (poll_fd[i].fd < 0) {\n\t\t\tEnterCriticalSection(&_poll_fd[i].mutex);\n\t\t\t// fd might have been allocated before we got to critical\n\t\t\tif (poll_fd[i].fd >= 0) {\n\t\t\t\tLeaveCriticalSection(&_poll_fd[i].mutex);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Use index as the unique fd number\n\t\t\tpoll_fd[i].fd = i;\n\t\t\t// Read end of the \"pipe\"\n\t\t\tfiledes[0] = poll_fd[i].fd;\n\t\t\t// We can use the same handle for both ends\n\t\t\tfiledes[1] = filedes[0];\n\n\t\t\tpoll_fd[i].handle = DUMMY_HANDLE;\n\t\t\tpoll_fd[i].overlapped = overlapped;\n\t\t\t// There's no polling on the write end, so we just use READ for our needs\n\t\t\tpoll_fd[i].rw = RW_READ;\n\t\t\t_poll_fd[i].original_handle = INVALID_HANDLE_VALUE;\n\t\t\tLeaveCriticalSection(&_poll_fd[i].mutex);\n\t\t\treturn 0;\n\t\t}\n\t}\n\tfree_overlapped(overlapped);\n\treturn -1;\n}\n\n/*\n * Create both an fd and an OVERLAPPED from an open Windows handle, so that\n * it can be used with our polling function\n * The handle MUST support overlapped transfers (usually requires CreateFile\n * with FILE_FLAG_OVERLAPPED)\n * Return a pollable file descriptor struct, or INVALID_WINFD on error\n *\n * Note that the fd returned by this function is a per-transfer fd, rather\n * than a per-session fd and cannot be used for anything else but our\n * custom functions (the fd itself points to the NUL: device)\n * if you plan to do R/W on the same handle, you MUST create 2 fds: one for\n * read and one for write. Using a single R/W fd is unsupported and will\n * produce unexpected results\n */\nstruct winfd usbi_create_fd(HANDLE handle, int access_mode, struct usbi_transfer *itransfer, cancel_transfer *cancel_fn)\n{\n\tint i;\n\tstruct winfd wfd = INVALID_WINFD;\n\tOVERLAPPED* overlapped = NULL;\n\n\tCHECK_INIT_POLLING;\n\n\tif ((handle == 0) || (handle == INVALID_HANDLE_VALUE)) {\n\t\treturn INVALID_WINFD;\n\t}\n\n\twfd.itransfer = itransfer;\n\twfd.cancel_fn = cancel_fn;\n\n\tif ((access_mode != RW_READ) && (access_mode != RW_WRITE)) {\n\t\tusbi_warn(NULL, \"only one of RW_READ or RW_WRITE are supported.\\n\"\n\t\t\t\"If you want to poll for R/W simultaneously, create multiple fds from the same handle.\");\n\t\treturn INVALID_WINFD;\n\t}\n\tif (access_mode == RW_READ) {\n\t\twfd.rw = RW_READ;\n\t} else {\n\t\twfd.rw = RW_WRITE;\n\t}\n\n\toverlapped = create_overlapped();\n\tif(overlapped == NULL) {\n\t\treturn INVALID_WINFD;\n\t}\n\n\tfor (i=0; i<MAX_FDS; i++) {\n\t\tif (poll_fd[i].fd < 0) {\n\t\t\tEnterCriticalSection(&_poll_fd[i].mutex);\n\t\t\t// fd might have been removed before we got to critical\n\t\t\tif (poll_fd[i].fd >= 0) {\n\t\t\t\tLeaveCriticalSection(&_poll_fd[i].mutex);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Use index as the unique fd number\n\t\t\twfd.fd = i;\n\t\t\t// Attempt to emulate some of the CancelIoEx behaviour on platforms\n\t\t\t// that don't have it\n\t\t\tif (Use_Duplicate_Handles) {\n\t\t\t\t_poll_fd[i].thread_id = GetCurrentThreadId();\n\t\t\t\tif (!DuplicateHandle(GetCurrentProcess(), handle, GetCurrentProcess(),\n\t\t\t\t\t&wfd.handle, 0, TRUE, DUPLICATE_SAME_ACCESS)) {\n\t\t\t\t\tusbi_dbg(\"could not duplicate handle for CancelIo - using original one\");\n\t\t\t\t\twfd.handle = handle;\n\t\t\t\t\t// Make sure we won't close the original handle on fd deletion then\n\t\t\t\t\t_poll_fd[i].original_handle = INVALID_HANDLE_VALUE;\n\t\t\t\t} else {\n\t\t\t\t\t_poll_fd[i].original_handle = handle;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twfd.handle = handle;\n\t\t\t}\n\t\t\twfd.overlapped = overlapped;\n\t\t\tmemcpy(&poll_fd[i], &wfd, sizeof(struct winfd));\n\t\t\tLeaveCriticalSection(&_poll_fd[i].mutex);\n\t\t\treturn wfd;\n\t\t}\n\t}\n\tfree_overlapped(overlapped);\n\treturn INVALID_WINFD;\n}\n\nstatic void _free_index(int _index)\n{\n\t// Cancel any async IO (Don't care about the validity of our handles for this)\n\tcancel_io(_index);\n\t// close the duplicate handle (if we have an actual duplicate)\n\tif (Use_Duplicate_Handles) {\n\t\tif (_poll_fd[_index].original_handle != INVALID_HANDLE_VALUE) {\n\t\t\tCloseHandle(poll_fd[_index].handle);\n\t\t}\n\t\t_poll_fd[_index].original_handle = INVALID_HANDLE_VALUE;\n\t\t_poll_fd[_index].thread_id = 0;\n\t}\n\tfree_overlapped(poll_fd[_index].overlapped);\n\tpoll_fd[_index] = INVALID_WINFD;\n}\n\n/*\n * Release a pollable file descriptor.\n *\n * Note that the associated Windows handle is not closed by this call\n */\nvoid usbi_free_fd(struct winfd *wfd)\n{\n\tint _index;\n\n\tCHECK_INIT_POLLING;\n\n\t_index = _fd_to_index_and_lock(wfd->fd);\n\tif (_index < 0) {\n\t\treturn;\n\t}\n\t_free_index(_index);\n\t*wfd = INVALID_WINFD;\n\tLeaveCriticalSection(&_poll_fd[_index].mutex);\n}\n\n/*\n * The functions below perform various conversions between fd, handle and OVERLAPPED\n */\nstruct winfd fd_to_winfd(int fd)\n{\n\tint i;\n\tstruct winfd wfd;\n\n\tCHECK_INIT_POLLING;\n\n\tif (fd < 0)\n\t\treturn INVALID_WINFD;\n\n\tfor (i=0; i<MAX_FDS; i++) {\n\t\tif (poll_fd[i].fd == fd) {\n\t\t\tEnterCriticalSection(&_poll_fd[i].mutex);\n\t\t\t// fd might have been deleted before we got to critical\n\t\t\tif (poll_fd[i].fd != fd) {\n\t\t\t\tLeaveCriticalSection(&_poll_fd[i].mutex);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tmemcpy(&wfd, &poll_fd[i], sizeof(struct winfd));\n\t\t\tLeaveCriticalSection(&_poll_fd[i].mutex);\n\t\t\treturn wfd;\n\t\t}\n\t}\n\treturn INVALID_WINFD;\n}\n\nstruct winfd handle_to_winfd(HANDLE handle)\n{\n\tint i;\n\tstruct winfd wfd;\n\n\tCHECK_INIT_POLLING;\n\n\tif ((handle == 0) || (handle == INVALID_HANDLE_VALUE))\n\t\treturn INVALID_WINFD;\n\n\tfor (i=0; i<MAX_FDS; i++) {\n\t\tif (poll_fd[i].handle == handle) {\n\t\t\tEnterCriticalSection(&_poll_fd[i].mutex);\n\t\t\t// fd might have been deleted before we got to critical\n\t\t\tif (poll_fd[i].handle != handle) {\n\t\t\t\tLeaveCriticalSection(&_poll_fd[i].mutex);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tmemcpy(&wfd, &poll_fd[i], sizeof(struct winfd));\n\t\t\tLeaveCriticalSection(&_poll_fd[i].mutex);\n\t\t\treturn wfd;\n\t\t}\n\t}\n\treturn INVALID_WINFD;\n}\n\nstruct winfd overlapped_to_winfd(OVERLAPPED* overlapped)\n{\n\tint i;\n\tstruct winfd wfd;\n\n\tCHECK_INIT_POLLING;\n\n\tif (overlapped == NULL)\n\t\treturn INVALID_WINFD;\n\n\tfor (i=0; i<MAX_FDS; i++) {\n\t\tif (poll_fd[i].overlapped == overlapped) {\n\t\t\tEnterCriticalSection(&_poll_fd[i].mutex);\n\t\t\t// fd might have been deleted before we got to critical\n\t\t\tif (poll_fd[i].overlapped != overlapped) {\n\t\t\t\tLeaveCriticalSection(&_poll_fd[i].mutex);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tmemcpy(&wfd, &poll_fd[i], sizeof(struct winfd));\n\t\t\tLeaveCriticalSection(&_poll_fd[i].mutex);\n\t\t\treturn wfd;\n\t\t}\n\t}\n\treturn INVALID_WINFD;\n}\n\n/*\n * POSIX poll equivalent, using Windows OVERLAPPED\n * Currently, this function only accepts one of POLLIN or POLLOUT per fd\n * (but you can create multiple fds from the same handle for read and write)\n */\nint usbi_poll(struct pollfd *fds, unsigned int nfds, int timeout)\n{\n\tunsigned i;\n\tint _index, object_index, triggered;\n\tHANDLE *handles_to_wait_on;\n\tint *handle_to_index;\n\tDWORD nb_handles_to_wait_on = 0;\n\tDWORD ret;\n\n\tCHECK_INIT_POLLING;\n\n\ttriggered = 0;\n\thandles_to_wait_on = (HANDLE*) calloc(nfds+1, sizeof(HANDLE));\t// +1 for fd_update\n\thandle_to_index = (int*) calloc(nfds, sizeof(int));\n\tif ((handles_to_wait_on == NULL) || (handle_to_index == NULL)) {\n\t\terrno = ENOMEM;\n\t\ttriggered = -1;\n\t\tgoto poll_exit;\n\t}\n\n\tfor (i = 0; i < nfds; ++i) {\n\t\tfds[i].revents = 0;\n\n\t\t// Only one of POLLIN or POLLOUT can be selected with this version of poll (not both)\n\t\tif ((fds[i].events & ~POLLIN) && (!(fds[i].events & POLLOUT))) {\n\t\t\tfds[i].revents |= POLLERR;\n\t\t\terrno = EACCES;\n\t\t\tusbi_warn(NULL, \"unsupported set of events\");\n\t\t\ttriggered = -1;\n\t\t\tgoto poll_exit;\n\t\t}\n\n\t\t_index = _fd_to_index_and_lock(fds[i].fd);\n\t\tpoll_dbg(\"fd[%d]=%d: (overlapped=%p) got events %04X\", i, poll_fd[_index].fd, poll_fd[_index].overlapped, fds[i].events);\n\n\t\tif ( (_index < 0) || (poll_fd[_index].handle == INVALID_HANDLE_VALUE)\n\t\t  || (poll_fd[_index].handle == 0) || (poll_fd[_index].overlapped == NULL)) {\n\t\t\tfds[i].revents |= POLLNVAL | POLLERR;\n\t\t\terrno = EBADF;\n\t\t\tif (_index >= 0) {\n\t\t\t\tLeaveCriticalSection(&_poll_fd[_index].mutex);\n\t\t\t}\n\t\t\tusbi_warn(NULL, \"invalid fd\");\n\t\t\ttriggered = -1;\n\t\t\tgoto poll_exit;\n\t\t}\n\n\t\t// IN or OUT must match our fd direction\n\t\tif ((fds[i].events & POLLIN) && (poll_fd[_index].rw != RW_READ)) {\n\t\t\tfds[i].revents |= POLLNVAL | POLLERR;\n\t\t\terrno = EBADF;\n\t\t\tusbi_warn(NULL, \"attempted POLLIN on fd without READ access\");\n\t\t\tLeaveCriticalSection(&_poll_fd[_index].mutex);\n\t\t\ttriggered = -1;\n\t\t\tgoto poll_exit;\n\t\t}\n\n\t\tif ((fds[i].events & POLLOUT) && (poll_fd[_index].rw != RW_WRITE)) {\n\t\t\tfds[i].revents |= POLLNVAL | POLLERR;\n\t\t\terrno = EBADF;\n\t\t\tusbi_warn(NULL, \"attempted POLLOUT on fd without WRITE access\");\n\t\t\tLeaveCriticalSection(&_poll_fd[_index].mutex);\n\t\t\ttriggered = -1;\n\t\t\tgoto poll_exit;\n\t\t}\n\n\t\t// The following macro only works if overlapped I/O was reported pending\n\t\tif ( (HasOverlappedIoCompleted(poll_fd[_index].overlapped))\n\t\t  || (HasOverlappedIoCompletedSync(poll_fd[_index].overlapped)) ) {\n\t\t\tpoll_dbg(\"  completed\");\n\t\t\t// checks above should ensure this works:\n\t\t\tfds[i].revents = fds[i].events;\n\t\t\ttriggered++;\n\t\t} else {\n\t\t\thandles_to_wait_on[nb_handles_to_wait_on] = poll_fd[_index].overlapped->hEvent;\n\t\t\thandle_to_index[nb_handles_to_wait_on] = i;\n\t\t\tnb_handles_to_wait_on++;\n\t\t}\n\t\tLeaveCriticalSection(&_poll_fd[_index].mutex);\n\t}\n\n\t// If nothing was triggered, wait on all fds that require it\n\tif ((timeout != 0) && (triggered == 0) && (nb_handles_to_wait_on != 0)) {\n\t\tif (timeout < 0) {\n\t\t\tpoll_dbg(\"starting infinite wait for %d handles...\", (int)nb_handles_to_wait_on);\n\t\t} else {\n\t\t\tpoll_dbg(\"starting %d ms wait for %d handles...\", timeout, (int)nb_handles_to_wait_on);\n\t\t}\n\t\tret = WaitForMultipleObjects(nb_handles_to_wait_on, handles_to_wait_on,\n\t\t\tFALSE, (timeout<0)?INFINITE:(DWORD)timeout);\n\t\tobject_index = ret-WAIT_OBJECT_0;\n\t\tif ((object_index >= 0) && ((DWORD)object_index < nb_handles_to_wait_on)) {\n\t\t\tpoll_dbg(\"  completed after wait\");\n\t\t\ti = handle_to_index[object_index];\n\t\t\t_index = _fd_to_index_and_lock(fds[i].fd);\n\t\t\tfds[i].revents = fds[i].events;\n\t\t\ttriggered++;\n\t\t\tif (_index >= 0) {\n\t\t\t\tLeaveCriticalSection(&_poll_fd[_index].mutex);\n\t\t\t}\n\t\t} else if (ret == WAIT_TIMEOUT) {\n\t\t\tpoll_dbg(\"  timed out\");\n\t\t\ttriggered = 0;\t// 0 = timeout\n\t\t} else {\n\t\t\terrno = EIO;\n\t\t\ttriggered = -1;\t// error\n\t\t}\n\t}\n\npoll_exit:\n\tif (handles_to_wait_on != NULL) {\n\t\tfree(handles_to_wait_on);\n\t}\n\tif (handle_to_index != NULL) {\n\t\tfree(handle_to_index);\n\t}\n\treturn triggered;\n}\n\n/*\n * close a fake pipe fd\n */\nint usbi_close(int fd)\n{\n\tint _index;\n\tint r = -1;\n\n\tCHECK_INIT_POLLING;\n\n\t_index = _fd_to_index_and_lock(fd);\n\n\tif (_index < 0) {\n\t\terrno = EBADF;\n\t} else {\n\t\tfree_overlapped(poll_fd[_index].overlapped);\n\t\tpoll_fd[_index] = INVALID_WINFD;\n\t\tLeaveCriticalSection(&_poll_fd[_index].mutex);\n\t}\n\treturn r;\n}\n\n/*\n * synchronous write for fake \"pipe\" signaling\n */\nssize_t usbi_write(int fd, const void *buf, size_t count)\n{\n\tint _index;\n\tUNUSED(buf);\n\n\tCHECK_INIT_POLLING;\n\n\tif (count != sizeof(unsigned char)) {\n\t\tusbi_err(NULL, \"this function should only used for signaling\");\n\t\treturn -1;\n\t}\n\n\t_index = _fd_to_index_and_lock(fd);\n\n\tif ( (_index < 0) || (poll_fd[_index].overlapped == NULL) ) {\n\t\terrno = EBADF;\n\t\tif (_index >= 0) {\n\t\t\tLeaveCriticalSection(&_poll_fd[_index].mutex);\n\t\t}\n\t\treturn -1;\n\t}\n\n\tpoll_dbg(\"set pipe event (fd = %d, thread = %08X)\", _index, GetCurrentThreadId());\n\tSetEvent(poll_fd[_index].overlapped->hEvent);\n\tpoll_fd[_index].overlapped->Internal = STATUS_WAIT_0;\n\t// If two threads write on the pipe at the same time, we need to\n\t// process two separate reads => use the overlapped as a counter\n\tpoll_fd[_index].overlapped->InternalHigh++;\n\n\tLeaveCriticalSection(&_poll_fd[_index].mutex);\n\treturn sizeof(unsigned char);\n}\n\n/*\n * synchronous read for fake \"pipe\" signaling\n */\nssize_t usbi_read(int fd, void *buf, size_t count)\n{\n\tint _index;\n\tssize_t r = -1;\n\tUNUSED(buf);\n\n\tCHECK_INIT_POLLING;\n\n\tif (count != sizeof(unsigned char)) {\n\t\tusbi_err(NULL, \"this function should only used for signaling\");\n\t\treturn -1;\n\t}\n\n\t_index = _fd_to_index_and_lock(fd);\n\n\tif (_index < 0) {\n\t\terrno = EBADF;\n\t\treturn -1;\n\t}\n\n\tif (WaitForSingleObject(poll_fd[_index].overlapped->hEvent, INFINITE) != WAIT_OBJECT_0) {\n\t\tusbi_warn(NULL, \"waiting for event failed: %d\", (int)GetLastError());\n\t\terrno = EIO;\n\t\tgoto out;\n\t}\n\n\tpoll_dbg(\"clr pipe event (fd = %d, thread = %08X)\", _index, GetCurrentThreadId());\n\tpoll_fd[_index].overlapped->InternalHigh--;\n\t// Don't reset unless we don't have any more events to process\n\tif (poll_fd[_index].overlapped->InternalHigh <= 0) {\n\t\tResetEvent(poll_fd[_index].overlapped->hEvent);\n\t\tpoll_fd[_index].overlapped->Internal = STATUS_PENDING;\n\t}\n\n\tr = sizeof(unsigned char);\n\nout:\n\tLeaveCriticalSection(&_poll_fd[_index].mutex);\n\treturn r;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/poll_windows.h",
    "content": "/*\n * Windows compat: POSIX compatibility wrapper\n * Copyright © 2012-2013 RealVNC Ltd.\n * Copyright © 2009-2010 Pete Batard <pete@akeo.ie>\n * With contributions from Michael Plante, Orin Eman et al.\n * Parts of poll implementation from libusb-win32, by Stephan Meyer et al.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n *\n */\n#pragma once\n\n#if defined(_MSC_VER)\n// disable /W4 MSVC warnings that are benign\n#pragma warning(disable:4127) // conditional expression is constant\n#endif\n\n// Handle synchronous completion through the overlapped structure\n#if !defined(STATUS_REPARSE)\t// reuse the REPARSE status code\n#define STATUS_REPARSE ((LONG)0x00000104L)\n#endif\n#define STATUS_COMPLETED_SYNCHRONOUSLY\tSTATUS_REPARSE\n#if defined(_WIN32_WCE)\n// WinCE doesn't have a HasOverlappedIoCompleted() macro, so attempt to emulate it\n#define HasOverlappedIoCompleted(lpOverlapped) (((DWORD)(lpOverlapped)->Internal) != STATUS_PENDING)\n#endif\n#define HasOverlappedIoCompletedSync(lpOverlapped)\t(((DWORD)(lpOverlapped)->Internal) == STATUS_COMPLETED_SYNCHRONOUSLY)\n\n#define DUMMY_HANDLE ((HANDLE)(LONG_PTR)-2)\n\nenum windows_version {\n\tWINDOWS_UNSUPPORTED,\n\tWINDOWS_CE,\n\tWINDOWS_XP,\n\tWINDOWS_2003,\t// also includes XP 64\n\tWINDOWS_VISTA_AND_LATER,\n};\nextern enum windows_version windows_version;\n\n#define MAX_FDS     256\n\n#define POLLIN      0x0001    /* There is data to read */\n#define POLLPRI     0x0002    /* There is urgent data to read */\n#define POLLOUT     0x0004    /* Writing now will not block */\n#define POLLERR     0x0008    /* Error condition */\n#define POLLHUP     0x0010    /* Hung up */\n#define POLLNVAL    0x0020    /* Invalid request: fd not open */\n\nstruct pollfd {\n    int fd;           /* file descriptor */\n    short events;     /* requested events */\n    short revents;    /* returned events */\n};\n\n// access modes\nenum rw_type {\n\tRW_NONE,\n\tRW_READ,\n\tRW_WRITE,\n};\n\n// fd struct that can be used for polling on Windows\ntypedef int cancel_transfer(struct usbi_transfer *itransfer);\n\nstruct winfd {\n\tint fd;\t\t\t\t\t\t\t// what's exposed to libusb core\n\tHANDLE handle;\t\t\t\t\t// what we need to attach overlapped to the I/O op, so we can poll it\n\tOVERLAPPED* overlapped;\t\t\t// what will report our I/O status\n\tstruct usbi_transfer *itransfer;\t\t// Associated transfer, or NULL if completed\n\tcancel_transfer *cancel_fn;\t\t// Function pointer to cancel transfer API\n\tenum rw_type rw;\t\t\t\t// I/O transfer direction: read *XOR* write (NOT BOTH)\n};\nextern const struct winfd INVALID_WINFD;\n\nint usbi_pipe(int pipefd[2]);\nint usbi_poll(struct pollfd *fds, unsigned int nfds, int timeout);\nssize_t usbi_write(int fd, const void *buf, size_t count);\nssize_t usbi_read(int fd, void *buf, size_t count);\nint usbi_close(int fd);\n\nvoid init_polling(void);\nvoid exit_polling(void);\nstruct winfd usbi_create_fd(HANDLE handle, int access_mode, \n\tstruct usbi_transfer *transfer, cancel_transfer *cancel_fn);\nvoid usbi_free_fd(struct winfd* winfd);\nstruct winfd fd_to_winfd(int fd);\nstruct winfd handle_to_winfd(HANDLE handle);\nstruct winfd overlapped_to_winfd(OVERLAPPED* overlapped);\n\n/*\n * Timeval operations\n */\n#if defined(DDKBUILD)\n#include <winsock.h>\t// defines timeval functions on DDK\n#endif\n\n#if !defined(TIMESPEC_TO_TIMEVAL)\n#define TIMESPEC_TO_TIMEVAL(tv, ts) {                   \\\n\t(tv)->tv_sec = (long)(ts)->tv_sec;                  \\\n\t(tv)->tv_usec = (long)(ts)->tv_nsec / 1000;         \\\n}\n#endif\n#if !defined(timersub)\n#define timersub(a, b, result)                          \\\ndo {                                                    \\\n\t(result)->tv_sec = (a)->tv_sec - (b)->tv_sec;       \\\n\t(result)->tv_usec = (a)->tv_usec - (b)->tv_usec;    \\\n\tif ((result)->tv_usec < 0) {                        \\\n\t\t--(result)->tv_sec;                             \\\n\t\t(result)->tv_usec += 1000000;                   \\\n\t}                                                   \\\n} while (0)\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/threads_posix.c",
    "content": "/*\n * libusb synchronization using POSIX Threads\n *\n * Copyright © 2011 Vitali Lovich <vlovich@aliph.com>\n * Copyright © 2011 Peter Stuge <peter@stuge.se>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#if defined(__linux__) || defined(__OpenBSD__)\n# if defined(__linux__)\n#  define _GNU_SOURCE\n# else\n#  define _BSD_SOURCE\n# endif\n# include <unistd.h>\n# include <sys/syscall.h>\n#elif defined(__APPLE__)\n# include <mach/mach.h>\n#elif defined(__CYGWIN__)\n# include <windows.h>\n#endif\n\n#include \"threads_posix.h\"\n\nint usbi_mutex_init_recursive(pthread_mutex_t *mutex, pthread_mutexattr_t *attr) {\n\tint err;\n\tpthread_mutexattr_t stack_attr;\n\tif (!attr) {\n\t\tattr = &stack_attr;\n\t\terr = pthread_mutexattr_init(&stack_attr);\n\t\tif (err != 0)\n\t\t\treturn err;\n\t}\n\n\t/* mutexattr_settype requires _GNU_SOURCE or _XOPEN_SOURCE >= 500 on Linux */\n\terr = pthread_mutexattr_settype(attr, PTHREAD_MUTEX_RECURSIVE);\n\tif (err != 0)\n\t\tgoto finish;\n\n\terr = pthread_mutex_init(mutex, attr);\n\nfinish:\n\tif (attr == &stack_attr)\n\t\tpthread_mutexattr_destroy(&stack_attr);\n\n\treturn err;\n}\n\nint usbi_get_tid(void) {\n\tint ret = -1;\n#if defined(__ANDROID__)\n\tret = gettid();\n#elif defined(__linux__)\n\tret = syscall(SYS_gettid);\n#elif defined(__OpenBSD__)\n\t/* The following only works with OpenBSD > 5.1 as it requires\n\t real thread support. For 5.1 and earlier, -1 is returned. */\n\tret = syscall(SYS_getthrid);\n#elif defined(__APPLE__)\n\tret = mach_thread_self();\n\tmach_port_deallocate(mach_task_self(), ret);\n#elif defined(__CYGWIN__)\n\tret = GetCurrentThreadId();\n#endif\n\t/* TODO: NetBSD thread ID support */\n\treturn ret;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/threads_posix.h",
    "content": "/*\n * libusb synchronization using POSIX Threads\n *\n * Copyright © 2010 Peter Stuge <peter@stuge.se>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef LIBUSB_THREADS_POSIX_H\n#define LIBUSB_THREADS_POSIX_H\n\n#include <pthread.h>\n\n#define usbi_mutex_static_t\t\tpthread_mutex_t\n#define USBI_MUTEX_INITIALIZER\t\tPTHREAD_MUTEX_INITIALIZER\n#define usbi_mutex_static_lock\t\tpthread_mutex_lock\n#define usbi_mutex_static_unlock\tpthread_mutex_unlock\n\n#define usbi_mutex_t\t\t\tpthread_mutex_t\n#define usbi_mutex_init\t\t\tpthread_mutex_init\n#define usbi_mutex_lock\t\t\tpthread_mutex_lock\n#define usbi_mutex_unlock\t\tpthread_mutex_unlock\n#define usbi_mutex_trylock\t\tpthread_mutex_trylock\n#define usbi_mutex_destroy\t\tpthread_mutex_destroy\n\n#define usbi_cond_t\t\t\tpthread_cond_t\n#define usbi_cond_init\t\t\tpthread_cond_init\n#define usbi_cond_wait\t\t\tpthread_cond_wait\n#define usbi_cond_timedwait\t\tpthread_cond_timedwait\n#define usbi_cond_broadcast\t\tpthread_cond_broadcast\n#define usbi_cond_destroy\t\tpthread_cond_destroy\n#define usbi_cond_signal\t\tpthread_cond_signal\n\nextern int usbi_mutex_init_recursive(pthread_mutex_t *mutex, pthread_mutexattr_t *attr);\n\nint usbi_get_tid(void);\n\n#endif /* LIBUSB_THREADS_POSIX_H */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/threads_windows.c",
    "content": "/*\n * libusb synchronization on Microsoft Windows\n *\n * Copyright © 2010 Michael Plante <michael.plante@gmail.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <config.h>\n#include <objbase.h>\n#include <errno.h>\n#include <stdarg.h>\n\n#include \"libusbi.h\"\n\nextern const uint64_t epoch_time;\n\nint usbi_mutex_init(usbi_mutex_t *mutex,\n\t\t\t\t\tconst usbi_mutexattr_t *attr) {\n\tUNUSED(attr);\n\tif(! mutex) return ((errno=EINVAL));\n\t*mutex = CreateMutex(NULL, FALSE, NULL);\n\tif(!*mutex) return ((errno=ENOMEM));\n\treturn 0;\n}\nint usbi_mutex_destroy(usbi_mutex_t *mutex) {\n\t// It is not clear if CloseHandle failure is due to failure to unlock.\n\t//   If so, this should be errno=EBUSY.\n\tif(!mutex || !CloseHandle(*mutex)) return ((errno=EINVAL));\n\t*mutex = NULL;\n\treturn 0;\n}\nint usbi_mutex_trylock(usbi_mutex_t *mutex) {\n\tDWORD result;\n\tif(!mutex) return ((errno=EINVAL));\n\tresult = WaitForSingleObject(*mutex, 0);\n\tif(result == WAIT_OBJECT_0 || result == WAIT_ABANDONED)\n\t\treturn 0; // acquired (ToDo: check that abandoned is ok)\n\tif(result == WAIT_TIMEOUT)\n\t\treturn ((errno=EBUSY));\n\treturn ((errno=EINVAL)); // don't know how this would happen\n\t\t\t\t\t\t\t //   so don't know proper errno\n}\nint usbi_mutex_lock(usbi_mutex_t *mutex) {\n\tDWORD result;\n\tif(!mutex) return ((errno=EINVAL));\n\tresult = WaitForSingleObject(*mutex, INFINITE);\n\tif(result == WAIT_OBJECT_0 || result == WAIT_ABANDONED)\n\t\treturn 0; // acquired (ToDo: check that abandoned is ok)\n\treturn ((errno=EINVAL)); // don't know how this would happen\n\t\t\t\t\t\t\t //   so don't know proper errno\n}\nint usbi_mutex_unlock(usbi_mutex_t *mutex) {\n\tif(!mutex)                return ((errno=EINVAL));\n\tif(!ReleaseMutex(*mutex)) return ((errno=EPERM ));\n\treturn 0;\n}\n\nint usbi_mutex_static_lock(usbi_mutex_static_t *mutex) {\n\tif(!mutex)               return ((errno=EINVAL));\n\twhile (InterlockedExchange((LONG *)mutex, 1) == 1) {\n\t\tSleepEx(0, TRUE);\n\t}\n\treturn 0;\n}\nint usbi_mutex_static_unlock(usbi_mutex_static_t *mutex) {\n\tif(!mutex)               return ((errno=EINVAL));\n\t*mutex = 0;\n\treturn 0;\n}\n\nint usbi_cond_init(usbi_cond_t *cond,\n\t\t\t\t   const usbi_condattr_t *attr) {\n\tUNUSED(attr);\n\tif(!cond)           return ((errno=EINVAL));\n\tlist_init(&cond->waiters    );\n\tlist_init(&cond->not_waiting);\n\treturn 0;\n}\nint usbi_cond_destroy(usbi_cond_t *cond) {\n\t// This assumes no one is using this anymore.  The check MAY NOT BE safe.\n\tstruct usbi_cond_perthread *pos, *next_pos = NULL;\n\tif(!cond) return ((errno=EINVAL));\n\tif(!list_empty(&cond->waiters)) return ((errno=EBUSY )); // (!see above!)\n\tlist_for_each_entry_safe(pos, next_pos, &cond->not_waiting, list, struct usbi_cond_perthread) {\n\t\tCloseHandle(pos->event);\n\t\tlist_del(&pos->list);\n\t\tfree(pos);\n\t}\n\n\treturn 0;\n}\n\nint usbi_cond_broadcast(usbi_cond_t *cond) {\n\t// Assumes mutex is locked; this is not in keeping with POSIX spec, but\n\t//   libusb does this anyway, so we simplify by not adding more sync\n\t//   primitives to the CV definition!\n\tint fail = 0;\n\tstruct usbi_cond_perthread *pos;\n\tif(!cond)                      return ((errno=EINVAL));\n\tlist_for_each_entry(pos, &cond->waiters, list, struct usbi_cond_perthread) {\n\t\tif(!SetEvent(pos->event))\n\t\t\tfail = 1;\n\t}\n\t// The wait function will remove its respective item from the list.\n\treturn fail ? ((errno=EINVAL)) : 0;\n}\nint usbi_cond_signal(usbi_cond_t *cond) {\n\t// Assumes mutex is locked; this is not in keeping with POSIX spec, but\n\t//   libusb does this anyway, so we simplify by not adding more sync\n\t//   primitives to the CV definition!\n\tstruct usbi_cond_perthread *pos;\n\tif(!cond)                      return ((errno=EINVAL));\n\tif(list_empty(&cond->waiters)) return 0; // no one to wakeup.\n\tpos = list_entry(&cond->waiters.next, struct usbi_cond_perthread, list);\n\t// The wait function will remove its respective item from the list.\n\treturn SetEvent(pos->event) ? 0 : ((errno=EINVAL));\n}\n__inline static int usbi_cond_intwait(usbi_cond_t *cond,\n\t\t\t\t\t\t\t\t\t  usbi_mutex_t *mutex,\n\t\t\t\t\t\t\t\t\t  DWORD timeout_ms) {\n\tstruct usbi_cond_perthread *pos;\n\tint found = 0, r;\n\tDWORD r2,tid = GetCurrentThreadId();\n\tif(!cond || !mutex) return ((errno=EINVAL));\n\tlist_for_each_entry(pos, &cond->not_waiting, list, struct usbi_cond_perthread) {\n\t\tif(tid == pos->tid) {\n\t\t\tfound = 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif(!found) {\n\t\tpos      = (struct usbi_cond_perthread*) calloc(1, sizeof(struct usbi_cond_perthread));\n\t\tif(!pos) return ((errno=ENOMEM)); // This errno is not POSIX-allowed.\n\t\tpos->tid = tid;\n\t\tpos->event = CreateEvent(NULL, FALSE, FALSE, NULL); // auto-reset.\n\t\tif(!pos->event) {\n\t\t\tfree(pos);\n\t\t\treturn      ((errno=ENOMEM));\n\t\t}\n\t\tlist_add(&pos->list, &cond->not_waiting);\n\t}\n\n\tlist_del(&pos->list); // remove from not_waiting list.\n\tlist_add(&pos->list, &cond->waiters);\n\n\tr  = usbi_mutex_unlock(mutex);\n\tif(r) return r;\n\tr2 = WaitForSingleObject(pos->event, timeout_ms);\n\tr  = usbi_mutex_lock(mutex);\n\tif(r) return r;\n\n\tlist_del(&pos->list);\n\tlist_add(&pos->list, &cond->not_waiting);\n\n\tif(r2 == WAIT_TIMEOUT) return ((errno=ETIMEDOUT));\n\n\treturn 0;\n}\n// N.B.: usbi_cond_*wait() can also return ENOMEM, even though pthread_cond_*wait cannot!\nint usbi_cond_wait(usbi_cond_t *cond, usbi_mutex_t *mutex) {\n\treturn usbi_cond_intwait(cond, mutex, INFINITE);\n}\nint usbi_cond_timedwait(usbi_cond_t *cond,\n\t\t\t\t\t\tusbi_mutex_t *mutex,\n\t\t\t\t\t\tconst struct timespec *abstime) {\n\tFILETIME filetime;\n\tULARGE_INTEGER rtime;\n\tstruct timeval targ_time, cur_time, delta_time;\n\tstruct timespec cur_time_ns;\n\tDWORD millis;\n\n\t// GetSystemTimeAsFileTime() is not available on CE\n\tSYSTEMTIME st;\n\tGetSystemTime(&st);\n\tSystemTimeToFileTime(&st, &filetime);\n\trtime.LowPart   = filetime.dwLowDateTime;\n\trtime.HighPart  = filetime.dwHighDateTime;\n\trtime.QuadPart -= epoch_time;\n\tcur_time_ns.tv_sec = (long)(rtime.QuadPart / 10000000);\n\tcur_time_ns.tv_nsec = (long)((rtime.QuadPart % 10000000)*100);\n\tTIMESPEC_TO_TIMEVAL(&cur_time, &cur_time_ns);\n\n\tTIMESPEC_TO_TIMEVAL(&targ_time, abstime);\n\ttimersub(&targ_time, &cur_time, &delta_time);\n\tif(delta_time.tv_sec < 0) // abstime already passed?\n\t\tmillis = 0;\n\telse {\n\t\tmillis  = delta_time.tv_usec/1000;\n\t\tmillis += delta_time.tv_sec *1000;\n\t\tif (delta_time.tv_usec % 1000) // round up to next millisecond\n\t\t\tmillis++;\n\t}\n\n\treturn usbi_cond_intwait(cond, mutex, millis);\n}\n\nint usbi_get_tid(void) {\n\treturn GetCurrentThreadId();\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/threads_windows.h",
    "content": "/*\n * libusb synchronization on Microsoft Windows\n *\n * Copyright © 2010 Michael Plante <michael.plante@gmail.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef LIBUSB_THREADS_WINDOWS_H\n#define LIBUSB_THREADS_WINDOWS_H\n\n#define usbi_mutex_static_t     volatile LONG\n#define USBI_MUTEX_INITIALIZER  0\n\n#define usbi_mutex_t            HANDLE\n\nstruct usbi_cond_perthread {\n\tstruct list_head list;\n\tDWORD            tid;\n\tHANDLE           event;\n};\nstruct usbi_cond_t_ {\n\t// Every time a thread touches the CV, it winds up in one of these lists.\n\t//   It stays there until the CV is destroyed, even if the thread\n\t//   terminates.\n\tstruct list_head waiters;\n\tstruct list_head not_waiting;\n};\ntypedef struct usbi_cond_t_ usbi_cond_t;\n\n// We *were* getting timespec from pthread.h:\n#if (!defined(HAVE_STRUCT_TIMESPEC) && !defined(_TIMESPEC_DEFINED))\n#define HAVE_STRUCT_TIMESPEC 1\n#define _TIMESPEC_DEFINED 1\nstruct timespec {\n\t\tlong tv_sec;\n\t\tlong tv_nsec;\n};\n#endif /* HAVE_STRUCT_TIMESPEC | _TIMESPEC_DEFINED */\n\n// We *were* getting ETIMEDOUT from pthread.h:\n#ifndef ETIMEDOUT\n#  define ETIMEDOUT 10060     /* This is the value in winsock.h. */\n#endif\n\n#define usbi_mutexattr_t void\n#define usbi_condattr_t  void\n\n// all Windows mutexes are recursive\n#define usbi_mutex_init_recursive(mutex, attr) usbi_mutex_init((mutex), (attr))\n\nint usbi_mutex_static_lock(usbi_mutex_static_t *mutex);\nint usbi_mutex_static_unlock(usbi_mutex_static_t *mutex);\n\n\nint usbi_mutex_init(usbi_mutex_t *mutex,\n\t\t\t\t\tconst usbi_mutexattr_t *attr);\nint usbi_mutex_lock(usbi_mutex_t *mutex);\nint usbi_mutex_unlock(usbi_mutex_t *mutex);\nint usbi_mutex_trylock(usbi_mutex_t *mutex);\nint usbi_mutex_destroy(usbi_mutex_t *mutex);\n\nint usbi_cond_init(usbi_cond_t *cond,\n\t\t\t\t   const usbi_condattr_t *attr);\nint usbi_cond_destroy(usbi_cond_t *cond);\nint usbi_cond_wait(usbi_cond_t *cond, usbi_mutex_t *mutex);\nint usbi_cond_timedwait(usbi_cond_t *cond,\n\t\t\t\t\t\tusbi_mutex_t *mutex,\n\t\t\t\t\t\tconst struct timespec *abstime);\nint usbi_cond_broadcast(usbi_cond_t *cond);\nint usbi_cond_signal(usbi_cond_t *cond);\n\nint usbi_get_tid(void);\n\n#endif /* LIBUSB_THREADS_WINDOWS_H */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/wince_usb.c",
    "content": "/*\n * Windows CE backend for libusb 1.0\n * Copyright © 2011-2013 RealVNC Ltd.\n * Large portions taken from Windows backend, which is\n * Copyright © 2009-2010 Pete Batard <pbatard@gmail.com>\n * With contributions from Michael Plante, Orin Eman et al.\n * Parts of this code adapted from libusb-win32-v1 by Stephan Meyer\n * Major code testing contribution by Xiaofan Chen\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <libusbi.h>\n\n#include <stdint.h>\n#include <errno.h>\n#include <inttypes.h>\n\n#include \"wince_usb.h\"\n\n// Forward declares\nstatic int wince_clock_gettime(int clk_id, struct timespec *tp);\nunsigned __stdcall wince_clock_gettime_threaded(void* param);\n\n// Global variables\nuint64_t hires_frequency, hires_ticks_to_ps;\nint errno;\nconst uint64_t epoch_time = UINT64_C(116444736000000000);       // 1970.01.01 00:00:000 in MS Filetime\nenum windows_version windows_version = WINDOWS_CE;\nstatic int concurrent_usage = -1;\n// Timer thread\n// NB: index 0 is for monotonic and 1 is for the thread exit event\nHANDLE timer_thread = NULL;\nHANDLE timer_mutex = NULL;\nstruct timespec timer_tp;\nvolatile LONG request_count[2] = {0, 1};\t// last one must be > 0\nHANDLE timer_request[2] = { NULL, NULL };\nHANDLE timer_response = NULL;\nHANDLE driver_handle = INVALID_HANDLE_VALUE;\n\n/*\n * Converts a windows error to human readable string\n * uses retval as errorcode, or, if 0, use GetLastError()\n */\n#if defined(ENABLE_LOGGING)\nstatic char* windows_error_str(uint32_t retval)\n{\n\tstatic TCHAR wErr_string[ERR_BUFFER_SIZE];\n\tstatic char err_string[ERR_BUFFER_SIZE];\n\n\tDWORD size;\n\tsize_t i;\n\tuint32_t error_code, format_error;\n\n\terror_code = retval?retval:GetLastError();\n\t\n\tsafe_stprintf(wErr_string, ERR_BUFFER_SIZE, _T(\"[%d] \"), error_code);\n\t\n\tsize = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error_code,\n\t\tMAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), &wErr_string[safe_tcslen(wErr_string)],\n\t\tERR_BUFFER_SIZE - (DWORD)safe_tcslen(wErr_string), NULL);\n\tif (size == 0) {\n\t\tformat_error = GetLastError();\n\t\tif (format_error)\n\t\t\tsafe_stprintf(wErr_string, ERR_BUFFER_SIZE,\n\t\t\t\t_T(\"Windows error code %u (FormatMessage error code %u)\"), error_code, format_error);\n\t\telse\n\t\t\tsafe_stprintf(wErr_string, ERR_BUFFER_SIZE, _T(\"Unknown error code %u\"), error_code);\n\t} else {\n\t\t// Remove CR/LF terminators\n\t\tfor (i=safe_tcslen(wErr_string)-1; ((wErr_string[i]==0x0A) || (wErr_string[i]==0x0D)); i--) {\n\t\t\twErr_string[i] = 0;\n\t\t}\n\t}\n\tif (WideCharToMultiByte(CP_ACP, 0, wErr_string, -1, err_string, ERR_BUFFER_SIZE, NULL, NULL) < 0)\n\t{\n\t\tstrcpy(err_string, \"Unable to convert error string\");\n\t}\n\treturn err_string;\n}\n#endif\n\nstatic struct wince_device_priv *_device_priv(struct libusb_device *dev)\n{\n        return (struct wince_device_priv *) dev->os_priv;\n}\n\n// ceusbkwrapper to libusb error code mapping\nstatic int translate_driver_error(int error) \n{\n\tswitch (error) {\n\t\tcase ERROR_INVALID_PARAMETER:\n\t\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t\tcase ERROR_CALL_NOT_IMPLEMENTED:\n\t\tcase ERROR_NOT_SUPPORTED:\n\t\t\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n\t\tcase ERROR_NOT_ENOUGH_MEMORY:\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\tcase ERROR_INVALID_HANDLE:\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t\tcase ERROR_BUSY:\n\t\t\treturn LIBUSB_ERROR_BUSY;\n\n\t\t// Error codes that are either unexpected, or have \n\t\t// no suitable LIBUSB_ERROR equivilant.\n\t\tcase ERROR_CANCELLED:\n\t\tcase ERROR_INTERNAL_ERROR:\n\t\tdefault:\n\t\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n}\n\nstatic int init_dllimports()\n{\n\tDLL_LOAD(ceusbkwrapper.dll, UkwOpenDriver, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwGetDeviceList, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwReleaseDeviceList, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwGetDeviceAddress, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwGetDeviceDescriptor, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwGetConfigDescriptor, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwCloseDriver, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwCancelTransfer, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwIssueControlTransfer, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwClaimInterface, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwReleaseInterface, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwSetInterfaceAlternateSetting, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwClearHaltHost, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwClearHaltDevice, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwGetConfig, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwSetConfig, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwResetDevice, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwKernelDriverActive, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwAttachKernelDriver, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwDetachKernelDriver, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwIssueBulkTransfer, TRUE);\n\tDLL_LOAD(ceusbkwrapper.dll, UkwIsPipeHalted, TRUE);\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int init_device(struct libusb_device *dev, UKW_DEVICE drv_dev,\n\t\t\t\t\t   unsigned char bus_addr, unsigned char dev_addr)\n{\n\tstruct wince_device_priv *priv = _device_priv(dev);\n\tint r = LIBUSB_SUCCESS;\n\n\tdev->bus_number = bus_addr;\n\tdev->device_address = dev_addr;\n\tpriv->dev = drv_dev;\n\n\tif (!UkwGetDeviceDescriptor(priv->dev, &(priv->desc))) {\n\t\tr = translate_driver_error(GetLastError());\n\t}\n\treturn r;\n}\n\n// Internal API functions\nstatic int wince_init(struct libusb_context *ctx)\n{\n\tint i, r = LIBUSB_ERROR_OTHER;\n\tHANDLE semaphore;\n\tTCHAR sem_name[11+1+8]; // strlen(libusb_init)+'\\0'+(32-bit hex PID)\n\n\t_stprintf(sem_name, _T(\"libusb_init%08X\"), (unsigned int)GetCurrentProcessId()&0xFFFFFFFF);\n\tsemaphore = CreateSemaphore(NULL, 1, 1, sem_name);\n\tif (semaphore == NULL) {\n\t\tusbi_err(ctx, \"could not create semaphore: %s\", windows_error_str(0));\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\t// A successful wait brings our semaphore count to 0 (unsignaled)\n\t// => any concurent wait stalls until the semaphore's release\n\tif (WaitForSingleObject(semaphore, INFINITE) != WAIT_OBJECT_0) {\n\t\tusbi_err(ctx, \"failure to access semaphore: %s\", windows_error_str(0));\n\t\tCloseHandle(semaphore);\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\t// NB: concurrent usage supposes that init calls are equally balanced with\n\t// exit calls. If init is called more than exit, we will not exit properly\n\tif ( ++concurrent_usage == 0 ) {\t// First init?\n\t\t// Initialize pollable file descriptors\n\t\tinit_polling();\n\n\t\t// Load DLL imports\n\t\tif (init_dllimports() != LIBUSB_SUCCESS) {\n\t\t\tusbi_err(ctx, \"could not resolve DLL functions\");\n\t\t\tr = LIBUSB_ERROR_NOT_SUPPORTED;\n\t\t\tgoto init_exit;\n\t\t}\n\n\t\t// try to open a handle to the driver\n\t\tdriver_handle = UkwOpenDriver();\n\t\tif (driver_handle == INVALID_HANDLE_VALUE) {\n\t\t\tusbi_err(ctx, \"could not connect to driver\");\n\t\t\tr = LIBUSB_ERROR_NOT_SUPPORTED;\n\t\t\tgoto init_exit;\n\t\t}\n\n\t\t// Windows CE doesn't have a way of specifying thread affinity, so this code\n\t\t// just has  to hope QueryPerformanceCounter doesn't report different values when\n\t\t// running on different cores.\n\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\tfor (i = 0; i < 2; i++) {\n\t\t\ttimer_request[i] = CreateEvent(NULL, TRUE, FALSE, NULL);\n\t\t\tif (timer_request[i] == NULL) {\n\t\t\t\tusbi_err(ctx, \"could not create timer request event %d - aborting\", i);\n\t\t\t\tgoto init_exit;\n\t\t\t}\n\t\t}\n\t\ttimer_response = CreateSemaphore(NULL, 0, MAX_TIMER_SEMAPHORES, NULL);\n\t\tif (timer_response == NULL) {\n\t\t\tusbi_err(ctx, \"could not create timer response semaphore - aborting\");\n\t\t\tgoto init_exit;\n\t\t}\n\t\ttimer_mutex = CreateMutex(NULL, FALSE, NULL);\n\t\tif (timer_mutex == NULL) {\n\t\t\tusbi_err(ctx, \"could not create timer mutex - aborting\");\n\t\t\tgoto init_exit;\n\t\t}\n\t\ttimer_thread = CreateThread(NULL, 0, wince_clock_gettime_threaded, NULL, 0, NULL);\n\t\tif (timer_thread == NULL) {\n\t\t\tusbi_err(ctx, \"Unable to create timer thread - aborting\");\n\t\t\tgoto init_exit;\n\t\t}\n\n\t\t// Wait for timer thread to init before continuing.\n\t\tif (WaitForSingleObject(timer_response, INFINITE) != WAIT_OBJECT_0) {\n\t\t\tusbi_err(ctx, \"Failed to wait for timer thread to become ready - aborting\");\n\t\t\tgoto init_exit;\n\t\t}\n\t}\n\t// At this stage, either we went through full init successfully, or didn't need to\n\tr = LIBUSB_SUCCESS;\n\ninit_exit: // Holds semaphore here.\n\tif (!concurrent_usage && r != LIBUSB_SUCCESS) { // First init failed?\n\t\tif (driver_handle != INVALID_HANDLE_VALUE) {\n\t\t\tUkwCloseDriver(driver_handle);\n\t\t\tdriver_handle = INVALID_HANDLE_VALUE;\n\t\t}\n\t\tif (timer_thread) {\n\t\t\tSetEvent(timer_request[1]); // actually the signal to quit the thread.\n\t\t\tif (WAIT_OBJECT_0 != WaitForSingleObject(timer_thread, INFINITE)) {\n\t\t\t\tusbi_warn(ctx, \"could not wait for timer thread to quit\");\n\t\t\t\tTerminateThread(timer_thread, 1); // shouldn't happen, but we're destroying\n\t\t\t\t\t\t\t\t\t\t\t\t  // all objects it might have held anyway.\n\t\t\t}\n\t\t\tCloseHandle(timer_thread);\n\t\t\ttimer_thread = NULL;\n\t\t}\n\t\tfor (i = 0; i < 2; i++) {\n\t\t\tif (timer_request[i]) {\n\t\t\t\tCloseHandle(timer_request[i]);\n\t\t\t\ttimer_request[i] = NULL;\n\t\t\t}\n\t\t}\n\t\tif (timer_response) {\n\t\t\tCloseHandle(timer_response);\n\t\t\ttimer_response = NULL;\n\t\t}\n\t\tif (timer_mutex) {\n\t\t\tCloseHandle(timer_mutex);\n\t\t\ttimer_mutex = NULL;\n\t\t}\n\t}\n\n\tif (r != LIBUSB_SUCCESS)\n\t\t--concurrent_usage; // Not expected to call libusb_exit if we failed.\n\n\tReleaseSemaphore(semaphore, 1, NULL);\t// increase count back to 1\n\tCloseHandle(semaphore);\n\treturn r;\n}\n\nstatic void wince_exit(void)\n{\n\tint i;\n\tHANDLE semaphore;\n\tTCHAR sem_name[11+1+8]; // strlen(libusb_init)+'\\0'+(32-bit hex PID)\n\n\t_stprintf(sem_name, _T(\"libusb_init%08X\"), (unsigned int)GetCurrentProcessId()&0xFFFFFFFF);\n\tsemaphore = CreateSemaphore(NULL, 1, 1, sem_name);\n\tif (semaphore == NULL) {\n\t\treturn;\n\t}\n\n\t// A successful wait brings our semaphore count to 0 (unsignaled)\n\t// => any concurent wait stalls until the semaphore release\n\tif (WaitForSingleObject(semaphore, INFINITE) != WAIT_OBJECT_0) {\n\t\tCloseHandle(semaphore);\n\t\treturn;\n\t}\n\n\t// Only works if exits and inits are balanced exactly\n\tif (--concurrent_usage < 0) {\t// Last exit\n\t\texit_polling();\n\n\t\tif (timer_thread) {\n\t\t\tSetEvent(timer_request[1]); // actually the signal to quit the thread.\n\t\t\tif (WAIT_OBJECT_0 != WaitForSingleObject(timer_thread, INFINITE)) {\n\t\t\t\tusbi_dbg(\"could not wait for timer thread to quit\");\n\t\t\t\tTerminateThread(timer_thread, 1);\n\t\t\t}\n\t\t\tCloseHandle(timer_thread);\n\t\t\ttimer_thread = NULL;\n\t\t}\n\t\tfor (i = 0; i < 2; i++) {\n\t\t\tif (timer_request[i]) {\n\t\t\t\tCloseHandle(timer_request[i]);\n\t\t\t\ttimer_request[i] = NULL;\n\t\t\t}\n\t\t}\n\t\tif (timer_response) {\n\t\t\tCloseHandle(timer_response);\n\t\t\ttimer_response = NULL;\n\t\t}\n\t\tif (timer_mutex) {\n\t\t\tCloseHandle(timer_mutex);\n\t\t\ttimer_mutex = NULL;\n\t\t}\n\t\tif (driver_handle != INVALID_HANDLE_VALUE) {\n\t\t\tUkwCloseDriver(driver_handle);\n\t\t\tdriver_handle = INVALID_HANDLE_VALUE;\n\t\t}\n\t}\n\n\tReleaseSemaphore(semaphore, 1, NULL);\t// increase count back to 1\n\tCloseHandle(semaphore);\n}\n\nstatic int wince_get_device_list(\n\tstruct libusb_context *ctx,\n\tstruct discovered_devs **discdevs)\n{\n\tUKW_DEVICE devices[MAX_DEVICE_COUNT];\n\tstruct discovered_devs * new_devices = *discdevs;\n\tDWORD count = 0, i;\n\tstruct libusb_device *dev = NULL;\n\tunsigned char bus_addr, dev_addr;\n\tunsigned long session_id;\n\tBOOL success;\n\tDWORD release_list_offset = 0;\n\tint r = LIBUSB_SUCCESS;\n\n\tsuccess = UkwGetDeviceList(driver_handle, devices, MAX_DEVICE_COUNT, &count);\n\tif (!success) {\n\t\tint libusbErr = translate_driver_error(GetLastError());\n\t\tusbi_err(ctx, \"could not get devices: %s\", windows_error_str(0));\n\t\treturn libusbErr;\n\t}\n\tfor(i = 0; i < count; ++i) {\n\t\trelease_list_offset = i;\n\t\tsuccess = UkwGetDeviceAddress(devices[i], &bus_addr, &dev_addr, &session_id);\n\t\tif (!success) {\n\t\t\tr = translate_driver_error(GetLastError());\n\t\t\tusbi_err(ctx, \"could not get device address for %d: %s\", i, windows_error_str(0));\n\t\t\tgoto err_out;\n\t\t}\n\t\tdev = usbi_get_device_by_session_id(ctx, session_id);\n\t\tif (dev) {\n\t\t\tusbi_dbg(\"using existing device for %d/%d (session %ld)\",\n\t\t\t\t\tbus_addr, dev_addr, session_id);\n\t\t\t// Release just this element in the device list (as we already hold a \n\t\t\t// reference to it).\n\t\t\tUkwReleaseDeviceList(driver_handle, &devices[i], 1);\n\t\t\trelease_list_offset++;\n\t\t} else {\n\t\t\tusbi_dbg(\"allocating new device for %d/%d (session %ld)\",\n\t\t\t\t\tbus_addr, dev_addr, session_id);\n\t\t\tdev = usbi_alloc_device(ctx, session_id);\n\t\t\tif (!dev) {\n\t\t\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\t\t\tgoto err_out;\n\t\t\t}\n\t\t\tr = init_device(dev, devices[i], bus_addr, dev_addr);\n\t\t\tif (r < 0)\n\t\t\t\tgoto err_out;\n\t\t\tr = usbi_sanitize_device(dev);\n\t\t\tif (r < 0)\n\t\t\t\tgoto err_out;\n\t\t}\n\t\tnew_devices = discovered_devs_append(new_devices, dev);\n\t\tif (!discdevs) {\n\t\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\t\tgoto err_out;\n\t\t}\n\t\tsafe_unref_device(dev);\n\t}\n\t*discdevs = new_devices;\n\treturn r;\nerr_out:\n\t*discdevs = new_devices;\n\tsafe_unref_device(dev);\n\t// Release the remainder of the unprocessed device list.\n\t// The devices added to new_devices already will still be passed up to libusb, \n\t// which can dispose of them at its leisure.\n\tUkwReleaseDeviceList(driver_handle, &devices[release_list_offset], count - release_list_offset);\n\treturn r;\n}\n\nstatic int wince_open(struct libusb_device_handle *handle)\n{\n\t// Nothing to do to open devices as a handle to it has\n\t// been retrieved by wince_get_device_list\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic void wince_close(struct libusb_device_handle *handle)\n{\n\t// Nothing to do as wince_open does nothing.\n}\n\nstatic int wince_get_device_descriptor(\n   struct libusb_device *device,\n   unsigned char *buffer, int *host_endian)\n{\n\tstruct wince_device_priv *priv = _device_priv(device);\n\n\t*host_endian = 1;\n\tmemcpy(buffer, &priv->desc, DEVICE_DESC_LENGTH);\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int wince_get_active_config_descriptor(\n\tstruct libusb_device *device,\n\tunsigned char *buffer, size_t len, int *host_endian)\n{\n\tstruct wince_device_priv *priv = _device_priv(device);\n\tDWORD actualSize = len;\n\t*host_endian = 0;\n\tif (!UkwGetConfigDescriptor(priv->dev, UKW_ACTIVE_CONFIGURATION, buffer, len, &actualSize)) {\n\t\treturn translate_driver_error(GetLastError());\n\t}\n\treturn actualSize;\n}\n\nstatic int wince_get_config_descriptor(\n\tstruct libusb_device *device,\n\tuint8_t config_index,\n\tunsigned char *buffer, size_t len, int *host_endian)\n{\n\tstruct wince_device_priv *priv = _device_priv(device);\n\tDWORD actualSize = len;\n\t*host_endian = 0;\n\tif (!UkwGetConfigDescriptor(priv->dev, config_index, buffer, len, &actualSize)) {\n\t\treturn translate_driver_error(GetLastError());\n\t}\n\treturn actualSize;\n}\n\nstatic int wince_get_configuration(\n   struct libusb_device_handle *handle,\n   int *config)\n{\n\tstruct wince_device_priv *priv = _device_priv(handle->dev);\n\tUCHAR cv = 0;\n\tif (!UkwGetConfig(priv->dev, &cv)) {\n\t\treturn translate_driver_error(GetLastError());\n\t}\n\t(*config) = cv;\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int wince_set_configuration(\n\tstruct libusb_device_handle *handle,\n\tint config)\n{\n\tstruct wince_device_priv *priv = _device_priv(handle->dev);\n\t// Setting configuration 0 places the device in Address state.\n\t// This should correspond to the \"unconfigured state\" required by\n\t// libusb when the specified configuration is -1.\n\tUCHAR cv = (config < 0) ? 0 : config;\n\tif (!UkwSetConfig(priv->dev, cv)) {\n\t\treturn translate_driver_error(GetLastError());\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int wince_claim_interface(\n\tstruct libusb_device_handle *handle,\n\tint interface_number)\n{\n\tstruct wince_device_priv *priv = _device_priv(handle->dev);\n\tif (!UkwClaimInterface(priv->dev, interface_number)) {\n\t\treturn translate_driver_error(GetLastError());\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int wince_release_interface(\n\tstruct libusb_device_handle *handle,\n\tint interface_number)\n{\n\tstruct wince_device_priv *priv = _device_priv(handle->dev);\n\tif (!UkwSetInterfaceAlternateSetting(priv->dev, interface_number, 0)) {\n\t\treturn translate_driver_error(GetLastError());\n\t}\n\tif (!UkwReleaseInterface(priv->dev, interface_number)) {\n\t\treturn translate_driver_error(GetLastError());\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int wince_set_interface_altsetting(\n\tstruct libusb_device_handle *handle,\n\tint interface_number, int altsetting)\n{\n\tstruct wince_device_priv *priv = _device_priv(handle->dev);\n\tif (!UkwSetInterfaceAlternateSetting(priv->dev, interface_number, altsetting)) {\n\t\treturn translate_driver_error(GetLastError());\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int wince_clear_halt(\n\tstruct libusb_device_handle *handle,\n\tunsigned char endpoint)\n{\n\tstruct wince_device_priv *priv = _device_priv(handle->dev);\n\tif (!UkwClearHaltHost(priv->dev, endpoint)) {\n\t\treturn translate_driver_error(GetLastError());\n\t}\n\tif (!UkwClearHaltDevice(priv->dev, endpoint)) {\n\t\treturn translate_driver_error(GetLastError());\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int wince_reset_device(\n\tstruct libusb_device_handle *handle)\n{\n\tstruct wince_device_priv *priv = _device_priv(handle->dev);\n\tif (!UkwResetDevice(priv->dev)) {\n\t\treturn translate_driver_error(GetLastError());\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int wince_kernel_driver_active(\n\tstruct libusb_device_handle *handle,\n\tint interface_number)\n{\n\tstruct wince_device_priv *priv = _device_priv(handle->dev);\n\tBOOL result = FALSE;\n\tif (!UkwKernelDriverActive(priv->dev, interface_number, &result)) {\n\t\treturn translate_driver_error(GetLastError());\n\t}\n\treturn result ? 1 : 0;\n}\n\nstatic int wince_detach_kernel_driver(\n\tstruct libusb_device_handle *handle,\n\tint interface_number)\n{\n\tstruct wince_device_priv *priv = _device_priv(handle->dev);\n\tif (!UkwDetachKernelDriver(priv->dev, interface_number)) {\n\t\treturn translate_driver_error(GetLastError());\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int wince_attach_kernel_driver(\n\tstruct libusb_device_handle *handle,\n\tint interface_number)\n{\n\tstruct wince_device_priv *priv = _device_priv(handle->dev);\n\tif (!UkwAttachKernelDriver(priv->dev, interface_number)) {\n\t\treturn translate_driver_error(GetLastError());\n\t}\t\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic void wince_destroy_device(\n\tstruct libusb_device *dev)\n{\n\tstruct wince_device_priv *priv = _device_priv(dev);\n\tUkwReleaseDeviceList(driver_handle, &priv->dev, 1);\n}\n\nstatic void wince_clear_transfer_priv(\n\tstruct usbi_transfer *itransfer)\n{\n\tstruct wince_transfer_priv *transfer_priv = (struct wince_transfer_priv*)usbi_transfer_get_os_priv(itransfer);\n\tstruct winfd wfd = fd_to_winfd(transfer_priv->pollable_fd.fd);\n\t// No need to cancel transfer as it is either complete or abandoned\n\twfd.itransfer = NULL;\n\tCloseHandle(wfd.handle);\n\tusbi_free_fd(&transfer_priv->pollable_fd);\n}\n\nstatic int wince_cancel_transfer(\n\tstruct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct wince_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tstruct wince_transfer_priv *transfer_priv = (struct wince_transfer_priv*)usbi_transfer_get_os_priv(itransfer);\n\t\n\tif (!UkwCancelTransfer(priv->dev, transfer_priv->pollable_fd.overlapped, UKW_TF_NO_WAIT)) {\n\t\treturn translate_driver_error(GetLastError());\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int wince_submit_control_or_bulk_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);\n\tstruct wince_transfer_priv *transfer_priv = (struct wince_transfer_priv*)usbi_transfer_get_os_priv(itransfer);\n\tstruct wince_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tBOOL direction_in, ret;\n\tstruct winfd wfd;\n\tDWORD flags;\n\tHANDLE eventHandle;\n\tPUKW_CONTROL_HEADER setup = NULL;\n\tconst BOOL control_transfer = transfer->type == LIBUSB_TRANSFER_TYPE_CONTROL;\n\n\ttransfer_priv->pollable_fd = INVALID_WINFD;\n\tif (control_transfer) {\n\t\tsetup = (PUKW_CONTROL_HEADER) transfer->buffer;\n\t\tdirection_in = setup->bmRequestType & LIBUSB_ENDPOINT_IN;\n\t} else {\n\t\tdirection_in = transfer->endpoint & LIBUSB_ENDPOINT_IN;\n\t}\n\tflags = direction_in ? UKW_TF_IN_TRANSFER : UKW_TF_OUT_TRANSFER;\n\tflags |= UKW_TF_SHORT_TRANSFER_OK;\n\n\teventHandle = CreateEvent(NULL, FALSE, FALSE, NULL);\n\tif (eventHandle == NULL) {\n\t\tusbi_err(ctx, \"Failed to create event for async transfer\");\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\twfd = usbi_create_fd(eventHandle, direction_in ? RW_READ : RW_WRITE, itransfer, &wince_cancel_transfer);\n\tif (wfd.fd < 0) {\n\t\tCloseHandle(eventHandle);\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\ttransfer_priv->pollable_fd = wfd;\n\tif (control_transfer) {\n\t\t// Split out control setup header and data buffer\n\t\tDWORD bufLen = transfer->length - sizeof(UKW_CONTROL_HEADER);\n\t\tPVOID buf = (PVOID) &transfer->buffer[sizeof(UKW_CONTROL_HEADER)];\n\n\t\tret = UkwIssueControlTransfer(priv->dev, flags, setup, buf, bufLen, &transfer->actual_length, wfd.overlapped);\n\t} else {\n\t\tret = UkwIssueBulkTransfer(priv->dev, flags, transfer->endpoint, transfer->buffer, \n\t\t\ttransfer->length, &transfer->actual_length, wfd.overlapped);\n\t}\n\tif (!ret) {\n\t\tint libusbErr = translate_driver_error(GetLastError());\n\t\tusbi_err(ctx, \"UkwIssue%sTransfer failed: error %d\",\n\t\t\tcontrol_transfer ? \"Control\" : \"Bulk\", GetLastError());\n\t\twince_clear_transfer_priv(itransfer);\n\t\treturn libusbErr;\n\t}\n\tusbi_add_pollfd(ctx, transfer_priv->pollable_fd.fd, direction_in ? POLLIN : POLLOUT);\n\titransfer->flags |= USBI_TRANSFER_UPDATED_FDS;\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int wince_submit_iso_transfer(struct usbi_transfer *itransfer)\n{\n\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n}\n\nstatic int wince_submit_transfer(\n\tstruct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n\tswitch (transfer->type) {\n\tcase LIBUSB_TRANSFER_TYPE_CONTROL:\n\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\t\treturn wince_submit_control_or_bulk_transfer(itransfer);\n\tcase LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n\t\treturn wince_submit_iso_transfer(itransfer);\n\tdefault:\n\t\tusbi_err(TRANSFER_CTX(transfer), \"unknown endpoint type %d\", transfer->type);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n}\n\nstatic void wince_transfer_callback(struct usbi_transfer *itransfer, uint32_t io_result, uint32_t io_size)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct wince_transfer_priv *transfer_priv = (struct wince_transfer_priv*)usbi_transfer_get_os_priv(itransfer);\n\tstruct wince_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tint status;\n\n\tusbi_dbg(\"handling I/O completion with errcode %d\", io_result);\n\n\tif (io_result == ERROR_NOT_SUPPORTED && \n\t\ttransfer->type != LIBUSB_TRANSFER_TYPE_CONTROL) {\n\t\t/* For functional stalls, the WinCE USB layer (and therefore the USB Kernel Wrapper \n\t\t * Driver) will report USB_ERROR_STALL/ERROR_NOT_SUPPORTED in situations where the \n\t\t * endpoint isn't actually stalled.\n\t\t *\n\t\t * One example of this is that some devices will occasionally fail to reply to an IN\n\t\t * token. The WinCE USB layer carries on with the transaction until it is completed\n\t\t * (or cancelled) but then completes it with USB_ERROR_STALL.\n\t\t *\n\t\t * This code therefore needs to confirm that there really is a stall error, by both\n\t\t * checking the pipe status and requesting the endpoint status from the device.\n\t\t */\n\t\tBOOL halted = FALSE;\n\t\tusbi_dbg(\"checking I/O completion with errcode ERROR_NOT_SUPPORTED is really a stall\");\n\t\tif (UkwIsPipeHalted(priv->dev, transfer->endpoint, &halted)) {\n\t\t\t/* Pipe status retrieved, so now request endpoint status by sending a GET_STATUS\n\t\t\t * control request to the device. This is done synchronously, which is a bit \n\t\t\t * naughty, but this is a special corner case.\n\t\t\t */\n\t\t\tWORD wStatus = 0;\n\t\t\tDWORD written = 0;\n\t\t\tUKW_CONTROL_HEADER ctrlHeader;\n\t\t\tctrlHeader.bmRequestType = LIBUSB_REQUEST_TYPE_STANDARD |\n\t\t\t\tLIBUSB_ENDPOINT_IN | LIBUSB_RECIPIENT_ENDPOINT;\n\t\t\tctrlHeader.bRequest = LIBUSB_REQUEST_GET_STATUS;\n\t\t\tctrlHeader.wValue = 0;\n\t\t\tctrlHeader.wIndex = transfer->endpoint;\n\t\t\tctrlHeader.wLength = sizeof(wStatus);\n\t\t\tif (UkwIssueControlTransfer(priv->dev,\n\t\t\t\t\tUKW_TF_IN_TRANSFER | UKW_TF_SEND_TO_ENDPOINT,\n\t\t\t\t\t&ctrlHeader, &wStatus, sizeof(wStatus), &written, NULL)) {\n\t\t\t\tif (written == sizeof(wStatus) &&\n\t\t\t\t\t\t(wStatus & STATUS_HALT_FLAG) == 0) {\n\t\t\t\t\tif (!halted || UkwClearHaltHost(priv->dev, transfer->endpoint)) {\n\t\t\t\t\t\tusbi_dbg(\"Endpoint doesn't appear to be stalled, overriding error with success\");\n\t\t\t\t\t\tio_result = ERROR_SUCCESS;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tusbi_dbg(\"Endpoint doesn't appear to be stalled, but the host is halted, changing error\");\n\t\t\t\t\t\tio_result = ERROR_IO_DEVICE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tswitch(io_result) {\n\tcase ERROR_SUCCESS:\n\t\titransfer->transferred += io_size;\n\t\tstatus = LIBUSB_TRANSFER_COMPLETED;\n\t\tbreak;\n\tcase ERROR_CANCELLED:\n\t\tusbi_dbg(\"detected transfer cancel\");\n\t\tstatus = LIBUSB_TRANSFER_CANCELLED;\n\t\tbreak;\n\tcase ERROR_NOT_SUPPORTED:\n\tcase ERROR_GEN_FAILURE:\n\t\tusbi_dbg(\"detected endpoint stall\");\n\t\tstatus = LIBUSB_TRANSFER_STALL;\n\t\tbreak;\n\tcase ERROR_SEM_TIMEOUT:\n\t\tusbi_dbg(\"detected semaphore timeout\");\n\t\tstatus = LIBUSB_TRANSFER_TIMED_OUT;\n\t\tbreak;\n\tcase ERROR_OPERATION_ABORTED:\n\t\tif (itransfer->flags & USBI_TRANSFER_TIMED_OUT) {\n\t\t\tusbi_dbg(\"detected timeout\");\n\t\t\tstatus = LIBUSB_TRANSFER_TIMED_OUT;\n\t\t} else {\n\t\t\tusbi_dbg(\"detected operation aborted\");\n\t\t\tstatus = LIBUSB_TRANSFER_CANCELLED;\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tusbi_err(ITRANSFER_CTX(itransfer), \"detected I/O error: %s\", windows_error_str(io_result));\n\t\tstatus = LIBUSB_TRANSFER_ERROR;\n\t\tbreak;\n\t}\n\twince_clear_transfer_priv(itransfer);\n\tif (status == LIBUSB_TRANSFER_CANCELLED) {\n\t\tusbi_handle_transfer_cancellation(itransfer);\n\t} else {\n\t\tusbi_handle_transfer_completion(itransfer, (enum libusb_transfer_status)status);\n\t}\n}\n\nstatic void wince_handle_callback (struct usbi_transfer *itransfer, uint32_t io_result, uint32_t io_size)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n\tswitch (transfer->type) {\n\tcase LIBUSB_TRANSFER_TYPE_CONTROL:\n\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\tcase LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n\t\twince_transfer_callback (itransfer, io_result, io_size);\n\t\tbreak;\n\tdefault:\n\t\tusbi_err(ITRANSFER_CTX(itransfer), \"unknown endpoint type %d\", transfer->type);\n\t}\n}\n\nstatic int wince_handle_events(\n\tstruct libusb_context *ctx,\n\tstruct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready)\n{\n\tstruct wince_transfer_priv* transfer_priv = NULL;\n\tPOLL_NFDS_TYPE i = 0;\n\tBOOL found = FALSE;\n\tstruct usbi_transfer *transfer;\n\tDWORD io_size, io_result;\n\n\tusbi_mutex_lock(&ctx->open_devs_lock);\n\tfor (i = 0; i < nfds && num_ready > 0; i++) {\n\n\t\tusbi_dbg(\"checking fd %d with revents = %04x\", fds[i].fd, fds[i].revents);\n\n\t\tif (!fds[i].revents) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tnum_ready--;\n\n\t\t// Because a Windows OVERLAPPED is used for poll emulation,\n\t\t// a pollable fd is created and stored with each transfer\n\t\tusbi_mutex_lock(&ctx->flying_transfers_lock);\n\t\tlist_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) {\n\t\t\ttransfer_priv = usbi_transfer_get_os_priv(transfer);\n\t\t\tif (transfer_priv->pollable_fd.fd == fds[i].fd) {\n\t\t\t\tfound = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\n\t\tif (found && HasOverlappedIoCompleted(transfer_priv->pollable_fd.overlapped)) {\n\t\t\tio_result = (DWORD)transfer_priv->pollable_fd.overlapped->Internal;\n\t\t\tio_size = (DWORD)transfer_priv->pollable_fd.overlapped->InternalHigh;\n\t\t\tusbi_remove_pollfd(ctx, transfer_priv->pollable_fd.fd);\n\t\t\t// let handle_callback free the event using the transfer wfd\n\t\t\t// If you don't use the transfer wfd, you run a risk of trying to free a\n\t\t\t// newly allocated wfd that took the place of the one from the transfer.\n\t\t\twince_handle_callback(transfer, io_result, io_size);\n\t\t} else if (found) {\n\t\t\tusbi_err(ctx, \"matching transfer for fd %x has not completed\", fds[i]);\n\t\t\treturn LIBUSB_ERROR_OTHER;\n\t\t} else {\n\t\t\tusbi_err(ctx, \"could not find a matching transfer for fd %x\", fds[i]);\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\t}\n\t}\n\n\tusbi_mutex_unlock(&ctx->open_devs_lock);\n\treturn LIBUSB_SUCCESS;\n}\n\n/*\n * Monotonic and real time functions\n */\nunsigned __stdcall wince_clock_gettime_threaded(void* param)\n{\n\tLARGE_INTEGER hires_counter, li_frequency;\n\tLONG nb_responses;\n\tint timer_index;\n\n\t// Init - find out if we have access to a monotonic (hires) timer\n\tif (!QueryPerformanceFrequency(&li_frequency)) {\n\t\tusbi_dbg(\"no hires timer available on this platform\");\n\t\thires_frequency = 0;\n\t\thires_ticks_to_ps = UINT64_C(0);\n\t} else {\n\t\thires_frequency = li_frequency.QuadPart;\n\t\t// The hires frequency can go as high as 4 GHz, so we'll use a conversion\n\t\t// to picoseconds to compute the tv_nsecs part in clock_gettime\n\t\thires_ticks_to_ps = UINT64_C(1000000000000) / hires_frequency;\n\t\tusbi_dbg(\"hires timer available (Frequency: %\"PRIu64\" Hz)\", hires_frequency);\n\t}\n\n\t// Signal wince_init() that we're ready to service requests\n\tif (ReleaseSemaphore(timer_response, 1, NULL) == 0) {\n\t\tusbi_dbg(\"unable to release timer semaphore: %s\", windows_error_str(0));\n\t}\n\n\t// Main loop - wait for requests\n\twhile (1) {\n\t\ttimer_index = WaitForMultipleObjects(2, timer_request, FALSE, INFINITE) - WAIT_OBJECT_0;\n\t\tif ( (timer_index != 0) && (timer_index != 1) ) {\n\t\t\tusbi_dbg(\"failure to wait on requests: %s\", windows_error_str(0));\n\t\t\tcontinue;\n\t\t}\n\t\tif (request_count[timer_index] == 0) {\n\t\t\t// Request already handled\n\t\t\tResetEvent(timer_request[timer_index]);\n\t\t\t// There's still a possiblity that a thread sends a request between the\n\t\t\t// time we test request_count[] == 0 and we reset the event, in which case\n\t\t\t// the request would be ignored. The simple solution to that is to test\n\t\t\t// request_count again and process requests if non zero.\n\t\t\tif (request_count[timer_index] == 0)\n\t\t\t\tcontinue;\n\t\t}\n\t\tswitch (timer_index) {\n\t\tcase 0:\n\t\t\tWaitForSingleObject(timer_mutex, INFINITE);\n\t\t\t// Requests to this thread are for hires always\n\t\t\tif (QueryPerformanceCounter(&hires_counter) != 0) {\n\t\t\t\ttimer_tp.tv_sec = (long)(hires_counter.QuadPart / hires_frequency);\n\t\t\t\ttimer_tp.tv_nsec = (long)(((hires_counter.QuadPart % hires_frequency)/1000) * hires_ticks_to_ps);\n\t\t\t} else {\n\t\t\t\t// Fallback to real-time if we can't get monotonic value\n\t\t\t\t// Note that real-time clock does not wait on the mutex or this thread.\n\t\t\t\twince_clock_gettime(USBI_CLOCK_REALTIME, &timer_tp);\n\t\t\t}\n\t\t\tReleaseMutex(timer_mutex);\n\n\t\t\tnb_responses = InterlockedExchange((LONG*)&request_count[0], 0);\n\t\t\tif ( (nb_responses)\n\t\t\t  && (ReleaseSemaphore(timer_response, nb_responses, NULL) == 0) ) {\n\t\t\t\tusbi_dbg(\"unable to release timer semaphore: %s\", windows_error_str(0));\n\t\t\t}\n\t\t\tcontinue;\n\t\tcase 1: // time to quit\n\t\t\tusbi_dbg(\"timer thread quitting\");\n\t\t\treturn 0;\n\t\t}\n\t}\n\tusbi_dbg(\"ERROR: broken timer thread\");\n\treturn 1;\n}\n\nstatic int wince_clock_gettime(int clk_id, struct timespec *tp)\n{\n\tFILETIME filetime;\n\tULARGE_INTEGER rtime;\n\tDWORD r;\n\tSYSTEMTIME st;\n\tswitch(clk_id) {\n\tcase USBI_CLOCK_MONOTONIC:\n\t\tif (hires_frequency != 0) {\n\t\t\twhile (1) {\n\t\t\t\tInterlockedIncrement((LONG*)&request_count[0]);\n\t\t\t\tSetEvent(timer_request[0]);\n\t\t\t\tr = WaitForSingleObject(timer_response, TIMER_REQUEST_RETRY_MS);\n\t\t\t\tswitch(r) {\n\t\t\t\tcase WAIT_OBJECT_0:\n\t\t\t\t\tWaitForSingleObject(timer_mutex, INFINITE);\n\t\t\t\t\t*tp = timer_tp;\n\t\t\t\t\tReleaseMutex(timer_mutex);\n\t\t\t\t\treturn LIBUSB_SUCCESS;\n\t\t\t\tcase WAIT_TIMEOUT:\n\t\t\t\t\tusbi_dbg(\"could not obtain a timer value within reasonable timeframe - too much load?\");\n\t\t\t\t\tbreak; // Retry until successful\n\t\t\t\tdefault:\n\t\t\t\t\tusbi_dbg(\"WaitForSingleObject failed: %s\", windows_error_str(0));\n\t\t\t\t\treturn LIBUSB_ERROR_OTHER;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Fall through and return real-time if monotonic was not detected @ timer init\n\tcase USBI_CLOCK_REALTIME:\n\t\t// We follow http://msdn.microsoft.com/en-us/library/ms724928%28VS.85%29.aspx\n\t\t// with a predef epoch_time to have an epoch that starts at 1970.01.01 00:00\n\t\t// Note however that our resolution is bounded by the Windows system time\n\t\t// functions and is at best of the order of 1 ms (or, usually, worse)\n\t\tGetSystemTime(&st);\n\t\tSystemTimeToFileTime(&st, &filetime);\n\t\trtime.LowPart = filetime.dwLowDateTime;\n\t\trtime.HighPart = filetime.dwHighDateTime;\n\t\trtime.QuadPart -= epoch_time;\n\t\ttp->tv_sec = (long)(rtime.QuadPart / 10000000);\n\t\ttp->tv_nsec = (long)((rtime.QuadPart % 10000000)*100);\n\t\treturn LIBUSB_SUCCESS;\n\tdefault:\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n}\n\nconst struct usbi_os_backend wince_backend = {\n        \"Windows CE\",\n        0,\n        wince_init,\n        wince_exit,\n\n        wince_get_device_list,\n\tNULL,\t\t\t\t/* hotplug_poll */\n        wince_open,\n        wince_close,\n\n        wince_get_device_descriptor,\n        wince_get_active_config_descriptor,\n        wince_get_config_descriptor,\n\tNULL,\t\t\t\t/* get_config_descriptor_by_value() */\n\n        wince_get_configuration,\n        wince_set_configuration,\n        wince_claim_interface,\n        wince_release_interface,\n\n        wince_set_interface_altsetting,\n        wince_clear_halt,\n        wince_reset_device,\n\n        wince_kernel_driver_active,\n        wince_detach_kernel_driver,\n        wince_attach_kernel_driver,\n\n        wince_destroy_device,\n\n        wince_submit_transfer,\n        wince_cancel_transfer,\n        wince_clear_transfer_priv,\n\n        wince_handle_events,\n\n        wince_clock_gettime,\n        sizeof(struct wince_device_priv),\n        sizeof(struct wince_device_handle_priv),\n        sizeof(struct wince_transfer_priv),\n        0,\n};\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/wince_usb.h",
    "content": "/*\n * Windows CE backend for libusb 1.0\n * Copyright © 2011-2013 RealVNC Ltd.\n * Portions taken from Windows backend, which is\n * Copyright © 2009-2010 Pete Batard <pbatard@gmail.com>\n * With contributions from Michael Plante, Orin Eman et al.\n * Parts of this code adapted from libusb-win32-v1 by Stephan Meyer\n * Major code testing contribution by Xiaofan Chen\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n#pragma once\n\n#include \"windows_common.h\"\n\n#include <windows.h>\n#include \"poll_windows.h\"\n\n#define MAX_DEVICE_COUNT            256\n\n// This is a modified dump of the types in the ceusbkwrapper.h library header\n// with functions transformed into extern pointers.\n//\n// This backend dynamically loads ceusbkwrapper.dll and doesn't include\n// ceusbkwrapper.h directly to simplify the build process. The kernel\n// side wrapper driver is built using the platform image build tools,\n// which makes it difficult to reference directly from the libusb build\n// system.\nstruct UKW_DEVICE_PRIV;\ntypedef struct UKW_DEVICE_PRIV *UKW_DEVICE;\ntypedef UKW_DEVICE *PUKW_DEVICE, *LPUKW_DEVICE;\n\ntypedef struct {\n\tUINT8 bLength;\n\tUINT8 bDescriptorType;\n\tUINT16 bcdUSB;\n\tUINT8 bDeviceClass;\n\tUINT8 bDeviceSubClass;\n\tUINT8 bDeviceProtocol;\n\tUINT8 bMaxPacketSize0;\n\tUINT16 idVendor;\n\tUINT16 idProduct;\n\tUINT16 bcdDevice;\n\tUINT8 iManufacturer;\n\tUINT8 iProduct;\n\tUINT8 iSerialNumber;\n\tUINT8 bNumConfigurations;\n} UKW_DEVICE_DESCRIPTOR, *PUKW_DEVICE_DESCRIPTOR, *LPUKW_DEVICE_DESCRIPTOR;\n\ntypedef struct {\n\tUINT8 bmRequestType;\n\tUINT8 bRequest;\n\tUINT16 wValue;\n\tUINT16 wIndex;\n\tUINT16 wLength;\n} UKW_CONTROL_HEADER, *PUKW_CONTROL_HEADER, *LPUKW_CONTROL_HEADER;\n\n// Collection of flags which can be used when issuing transfer requests\n/* Indicates that the transfer direction is 'in' */\n#define UKW_TF_IN_TRANSFER        0x00000001\n/* Indicates that the transfer direction is 'out' */\n#define UKW_TF_OUT_TRANSFER       0x00000000\n/* Specifies that the transfer should complete as soon as possible,\n * even if no OVERLAPPED structure has been provided. */\n#define UKW_TF_NO_WAIT            0x00000100\n/* Indicates that transfers shorter than the buffer are ok */\n#define UKW_TF_SHORT_TRANSFER_OK  0x00000200\n#define UKW_TF_SEND_TO_DEVICE     0x00010000\n#define UKW_TF_SEND_TO_INTERFACE  0x00020000\n#define UKW_TF_SEND_TO_ENDPOINT   0x00040000\n/* Don't block when waiting for memory allocations */\n#define UKW_TF_DONT_BLOCK_FOR_MEM 0x00080000\n\n/* Value to use when dealing with configuration values, such as UkwGetConfigDescriptor, \n * to specify the currently active configuration for the device. */\n#define UKW_ACTIVE_CONFIGURATION -1\n\nDLL_DECLARE(WINAPI, HANDLE, UkwOpenDriver, ());\nDLL_DECLARE(WINAPI, BOOL, UkwGetDeviceList, (HANDLE, LPUKW_DEVICE, DWORD, LPDWORD));\nDLL_DECLARE(WINAPI, void, UkwReleaseDeviceList, (HANDLE, LPUKW_DEVICE, DWORD));\nDLL_DECLARE(WINAPI, BOOL, UkwGetDeviceAddress, (UKW_DEVICE, unsigned char*, unsigned char*, unsigned long*));\nDLL_DECLARE(WINAPI, BOOL, UkwGetDeviceDescriptor, (UKW_DEVICE, LPUKW_DEVICE_DESCRIPTOR));\nDLL_DECLARE(WINAPI, BOOL, UkwGetConfigDescriptor, (UKW_DEVICE, DWORD, LPVOID, DWORD, LPDWORD));\nDLL_DECLARE(WINAPI, void, UkwCloseDriver, (HANDLE));\nDLL_DECLARE(WINAPI, BOOL, UkwCancelTransfer, (UKW_DEVICE, LPOVERLAPPED, DWORD));\nDLL_DECLARE(WINAPI, BOOL, UkwIssueControlTransfer, (UKW_DEVICE, DWORD, LPUKW_CONTROL_HEADER, LPVOID, DWORD, LPDWORD, LPOVERLAPPED));\nDLL_DECLARE(WINAPI, BOOL, UkwClaimInterface, (UKW_DEVICE, DWORD));\nDLL_DECLARE(WINAPI, BOOL, UkwReleaseInterface, (UKW_DEVICE, DWORD));\nDLL_DECLARE(WINAPI, BOOL, UkwSetInterfaceAlternateSetting, (UKW_DEVICE, DWORD, DWORD));\nDLL_DECLARE(WINAPI, BOOL, UkwClearHaltHost, (UKW_DEVICE, UCHAR));\nDLL_DECLARE(WINAPI, BOOL, UkwClearHaltDevice, (UKW_DEVICE, UCHAR));\nDLL_DECLARE(WINAPI, BOOL, UkwGetConfig, (UKW_DEVICE, PUCHAR));\nDLL_DECLARE(WINAPI, BOOL, UkwSetConfig, (UKW_DEVICE, UCHAR));\nDLL_DECLARE(WINAPI, BOOL, UkwResetDevice, (UKW_DEVICE));\nDLL_DECLARE(WINAPI, BOOL, UkwKernelDriverActive, (UKW_DEVICE, DWORD, PBOOL));\nDLL_DECLARE(WINAPI, BOOL, UkwAttachKernelDriver, (UKW_DEVICE, DWORD));\nDLL_DECLARE(WINAPI, BOOL, UkwDetachKernelDriver, (UKW_DEVICE, DWORD));\nDLL_DECLARE(WINAPI, BOOL, UkwIssueBulkTransfer, (UKW_DEVICE, DWORD, UCHAR, LPVOID, DWORD, LPDWORD, LPOVERLAPPED));\nDLL_DECLARE(WINAPI, BOOL, UkwIsPipeHalted, (UKW_DEVICE, UCHAR, LPBOOL));\n\n// Used to determine if an endpoint status really is halted on a failed transfer.\n#define STATUS_HALT_FLAG 0x1\n\nstruct wince_device_priv {\n\tUKW_DEVICE dev;\n\tUKW_DEVICE_DESCRIPTOR desc;\n};\n\nstruct wince_device_handle_priv {\n\t// This member isn't used, but only exists to avoid an empty structure\n\t// for private data for the device handle.\n\tint reserved;\n};\n\nstruct wince_transfer_priv {\n\tstruct winfd pollable_fd;\n\tuint8_t interface_number;\n};\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/windows_common.h",
    "content": "/*\n * Windows backend common header for libusb 1.0\n *\n * This file brings together header code common between\n * the desktop Windows and Windows CE backends.\n * Copyright © 2012-2013 RealVNC Ltd.\n * Copyright © 2009-2012 Pete Batard <pete@akeo.ie>\n * With contributions from Michael Plante, Orin Eman et al.\n * Parts of this code adapted from libusb-win32-v1 by Stephan Meyer\n * Major code testing contribution by Xiaofan Chen\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#pragma once\n\n// Windows API default is uppercase - ugh!\n#if !defined(bool)\n#define bool BOOL\n#endif\n#if !defined(true)\n#define true TRUE\n#endif\n#if !defined(false)\n#define false FALSE\n#endif\n\n#define safe_free(p) do {if (p != NULL) {free((void*)p); p = NULL;}} while(0)\n#define safe_closehandle(h) do {if (h != INVALID_HANDLE_VALUE) {CloseHandle(h); h = INVALID_HANDLE_VALUE;}} while(0)\n#define safe_min(a, b) min((size_t)(a), (size_t)(b))\n#define safe_strcp(dst, dst_max, src, count) do {memcpy(dst, src, safe_min(count, dst_max)); \\\n\t((char*)dst)[safe_min(count, dst_max)-1] = 0;} while(0)\n#define safe_strcpy(dst, dst_max, src) safe_strcp(dst, dst_max, src, safe_strlen(src)+1)\n#define safe_strncat(dst, dst_max, src, count) strncat(dst, src, safe_min(count, dst_max - safe_strlen(dst) - 1))\n#define safe_strcat(dst, dst_max, src) safe_strncat(dst, dst_max, src, safe_strlen(src)+1)\n#define safe_strcmp(str1, str2) strcmp(((str1==NULL)?\"<NULL>\":str1), ((str2==NULL)?\"<NULL>\":str2))\n#define safe_stricmp(str1, str2) _stricmp(((str1==NULL)?\"<NULL>\":str1), ((str2==NULL)?\"<NULL>\":str2))\n#define safe_strncmp(str1, str2, count) strncmp(((str1==NULL)?\"<NULL>\":str1), ((str2==NULL)?\"<NULL>\":str2), count)\n#define safe_strlen(str) ((str==NULL)?0:strlen(str))\n#define safe_sprintf(dst, count, ...) do {_snprintf(dst, count, __VA_ARGS__); (dst)[(count)-1] = 0; } while(0)\n#define safe_stprintf _sntprintf\n#define safe_tcslen(str) ((str==NULL)?0:_tcslen(str))\n#define safe_unref_device(dev) do {if (dev != NULL) {libusb_unref_device(dev); dev = NULL;}} while(0)\n#define wchar_to_utf8_ms(wstr, str, strlen) WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, strlen, NULL, NULL)\n#ifndef ARRAYSIZE\n#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))\n#endif\n\n#define ERR_BUFFER_SIZE             256\n#define TIMER_REQUEST_RETRY_MS      100\n#define MAX_TIMER_SEMAPHORES        128\n\n\n/*\n * API macros - from libusb-win32 1.x\n */\n#define DLL_DECLARE_PREFIXNAME(api, ret, prefixname, name, args)    \\\n\ttypedef ret (api * __dll_##name##_t)args;                       \\\n\tstatic __dll_##name##_t prefixname = NULL\n\n#ifndef _WIN32_WCE\n#define DLL_STRINGIFY(dll) #dll\n#define DLL_GET_MODULE_HANDLE(dll) GetModuleHandleA(DLL_STRINGIFY(dll))\n#define DLL_LOAD_LIBRARY(dll) LoadLibraryA(DLL_STRINGIFY(dll))\n#else\n#define DLL_STRINGIFY(dll) L#dll\n#define DLL_GET_MODULE_HANDLE(dll) GetModuleHandle(DLL_STRINGIFY(dll))\n#define DLL_LOAD_LIBRARY(dll) LoadLibrary(DLL_STRINGIFY(dll))\n#endif\n\n#define DLL_LOAD_PREFIXNAME(dll, prefixname, name, ret_on_failure) \\\n\tdo {                                                           \\\n\t\tHMODULE h = DLL_GET_MODULE_HANDLE(dll);                    \\\n\tif (!h)                                                        \\\n\t\th = DLL_LOAD_LIBRARY(dll);                                 \\\n\tif (!h) {                                                      \\\n\t\tif (ret_on_failure) { return LIBUSB_ERROR_NOT_FOUND; }     \\\n\t\telse { break; }                                            \\\n\t}                                                              \\\n\tprefixname = (__dll_##name##_t)GetProcAddress(h,               \\\n\t                        DLL_STRINGIFY(name));                  \\\n\tif (prefixname) break;                                         \\\n\tprefixname = (__dll_##name##_t)GetProcAddress(h,               \\\n\t                        DLL_STRINGIFY(name) DLL_STRINGIFY(A)); \\\n\tif (prefixname) break;                                         \\\n\tprefixname = (__dll_##name##_t)GetProcAddress(h,               \\\n\t                        DLL_STRINGIFY(name) DLL_STRINGIFY(W)); \\\n\tif (prefixname) break;                                         \\\n\tif(ret_on_failure)                                             \\\n\t\treturn LIBUSB_ERROR_NOT_FOUND;                             \\\n\t} while(0)\n\n#define DLL_DECLARE(api, ret, name, args)   DLL_DECLARE_PREFIXNAME(api, ret, name, name, args)\n#define DLL_LOAD(dll, name, ret_on_failure) DLL_LOAD_PREFIXNAME(dll, name, name, ret_on_failure)\n#define DLL_DECLARE_PREFIXED(api, ret, prefix, name, args)   DLL_DECLARE_PREFIXNAME(api, ret, prefix##name, name, args)\n#define DLL_LOAD_PREFIXED(dll, prefix, name, ret_on_failure) DLL_LOAD_PREFIXNAME(dll, prefix##name, name, ret_on_failure)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/windows_usb.c",
    "content": "/*\n * windows backend for libusb 1.0\n * Copyright © 2009-2012 Pete Batard <pete@akeo.ie>\n * With contributions from Michael Plante, Orin Eman et al.\n * Parts of this code adapted from libusb-win32-v1 by Stephan Meyer\n * HID Reports IOCTLs inspired from HIDAPI by Alan Ott, Signal 11 Software\n * Hash table functions adapted from glibc, by Ulrich Drepper et al.\n * Major code testing contribution by Xiaofan Chen\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <config.h>\n#include <windows.h>\n#include <setupapi.h>\n#include <ctype.h>\n#include <errno.h>\n#include <fcntl.h>\n#include <process.h>\n#include <stdio.h>\n#include <inttypes.h>\n#include <objbase.h>\n#include <winioctl.h>\n\n#include \"libusbi.h\"\n#include \"poll_windows.h\"\n#include \"windows_usb.h\"\n\n// The 2 macros below are used in conjunction with safe loops.\n#define LOOP_CHECK(fcall) { r=fcall; if (r != LIBUSB_SUCCESS) continue; }\n#define LOOP_BREAK(err) { r=err; continue; }\n\n// Helper prototypes\nstatic int windows_get_active_config_descriptor(struct libusb_device *dev, unsigned char *buffer, size_t len, int *host_endian);\nstatic int windows_clock_gettime(int clk_id, struct timespec *tp);\nunsigned __stdcall windows_clock_gettime_threaded(void* param);\n// Common calls\nstatic int common_configure_endpoints(int sub_api, struct libusb_device_handle *dev_handle, int iface);\n\n// WinUSB-like API prototypes\nstatic int winusbx_init(int sub_api, struct libusb_context *ctx);\nstatic int winusbx_exit(int sub_api);\nstatic int winusbx_open(int sub_api, struct libusb_device_handle *dev_handle);\nstatic void winusbx_close(int sub_api, struct libusb_device_handle *dev_handle);\nstatic int winusbx_configure_endpoints(int sub_api, struct libusb_device_handle *dev_handle, int iface);\nstatic int winusbx_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);\nstatic int winusbx_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);\nstatic int winusbx_submit_control_transfer(int sub_api, struct usbi_transfer *itransfer);\nstatic int winusbx_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting);\nstatic int winusbx_submit_bulk_transfer(int sub_api, struct usbi_transfer *itransfer);\nstatic int winusbx_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint);\nstatic int winusbx_abort_transfers(int sub_api, struct usbi_transfer *itransfer);\nstatic int winusbx_abort_control(int sub_api, struct usbi_transfer *itransfer);\nstatic int winusbx_reset_device(int sub_api, struct libusb_device_handle *dev_handle);\nstatic int winusbx_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size);\n// HID API prototypes\nstatic int hid_init(int sub_api, struct libusb_context *ctx);\nstatic int hid_exit(int sub_api);\nstatic int hid_open(int sub_api, struct libusb_device_handle *dev_handle);\nstatic void hid_close(int sub_api, struct libusb_device_handle *dev_handle);\nstatic int hid_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);\nstatic int hid_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);\nstatic int hid_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting);\nstatic int hid_submit_control_transfer(int sub_api, struct usbi_transfer *itransfer);\nstatic int hid_submit_bulk_transfer(int sub_api, struct usbi_transfer *itransfer);\nstatic int hid_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint);\nstatic int hid_abort_transfers(int sub_api, struct usbi_transfer *itransfer);\nstatic int hid_reset_device(int sub_api, struct libusb_device_handle *dev_handle);\nstatic int hid_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size);\n// Composite API prototypes\nstatic int composite_init(int sub_api, struct libusb_context *ctx);\nstatic int composite_exit(int sub_api);\nstatic int composite_open(int sub_api, struct libusb_device_handle *dev_handle);\nstatic void composite_close(int sub_api, struct libusb_device_handle *dev_handle);\nstatic int composite_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);\nstatic int composite_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting);\nstatic int composite_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);\nstatic int composite_submit_control_transfer(int sub_api, struct usbi_transfer *itransfer);\nstatic int composite_submit_bulk_transfer(int sub_api, struct usbi_transfer *itransfer);\nstatic int composite_submit_iso_transfer(int sub_api, struct usbi_transfer *itransfer);\nstatic int composite_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint);\nstatic int composite_abort_transfers(int sub_api, struct usbi_transfer *itransfer);\nstatic int composite_abort_control(int sub_api, struct usbi_transfer *itransfer);\nstatic int composite_reset_device(int sub_api, struct libusb_device_handle *dev_handle);\nstatic int composite_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size);\n\n\n// Global variables\nuint64_t hires_frequency, hires_ticks_to_ps;\nconst uint64_t epoch_time = UINT64_C(116444736000000000);\t// 1970.01.01 00:00:000 in MS Filetime\nenum windows_version windows_version = WINDOWS_UNSUPPORTED;\n// Concurrency\nstatic int concurrent_usage = -1;\nusbi_mutex_t autoclaim_lock;\n// Timer thread\n// NB: index 0 is for monotonic and 1 is for the thread exit event\nHANDLE timer_thread = NULL;\nHANDLE timer_mutex = NULL;\nstruct timespec timer_tp;\nvolatile LONG request_count[2] = {0, 1};\t// last one must be > 0\nHANDLE timer_request[2] = { NULL, NULL };\nHANDLE timer_response = NULL;\n// API globals\n#define CHECK_WINUSBX_AVAILABLE(sub_api) do { if (sub_api == SUB_API_NOTSET) sub_api = priv->sub_api; \\\n\tif (!WinUSBX[sub_api].initialized) return LIBUSB_ERROR_ACCESS; } while(0)\nstatic struct winusb_interface WinUSBX[SUB_API_MAX];\nconst char* sub_api_name[SUB_API_MAX] = WINUSBX_DRV_NAMES;\nbool api_hid_available = false;\n#define CHECK_HID_AVAILABLE do { if (!api_hid_available) return LIBUSB_ERROR_ACCESS; } while (0)\n\nstatic inline BOOLEAN guid_eq(const GUID *guid1, const GUID *guid2) {\n\tif ((guid1 != NULL) && (guid2 != NULL)) {\n\t\treturn (memcmp(guid1, guid2, sizeof(GUID)) == 0);\n\t}\n\treturn false;\n}\n\n#if defined(ENABLE_LOGGING)\nstatic char* guid_to_string(const GUID* guid)\n{\n\tstatic char guid_string[MAX_GUID_STRING_LENGTH];\n\n\tif (guid == NULL) return NULL;\n\tsprintf(guid_string, \"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}\",\n\t\t(unsigned int)guid->Data1, guid->Data2, guid->Data3,\n\t\tguid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],\n\t\tguid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);\n\treturn guid_string;\n}\n#endif\n\n/*\n * Converts a windows error to human readable string\n * uses retval as errorcode, or, if 0, use GetLastError()\n */\n#if defined(ENABLE_LOGGING)\nstatic char *windows_error_str(uint32_t retval)\n{\nstatic char err_string[ERR_BUFFER_SIZE];\n\n\tDWORD size;\n\tssize_t i;\n\tuint32_t error_code, format_error;\n\n\terror_code = retval?retval:GetLastError();\n\n\tsafe_sprintf(err_string, ERR_BUFFER_SIZE, \"[%u] \", error_code);\n\n\t// Translate codes returned by SetupAPI. The ones we are dealing with are either\n\t// in 0x0000xxxx or 0xE000xxxx and can be distinguished from standard error codes.\n\t// See http://msdn.microsoft.com/en-us/library/windows/hardware/ff545011.aspx\n\tswitch (error_code & 0xE0000000) {\n\tcase 0:\n\t\terror_code = HRESULT_FROM_WIN32(error_code);\t// Still leaves ERROR_SUCCESS unmodified\n\t\tbreak;\n\tcase 0xE0000000:\n\t\terror_code =  0x80000000 | (FACILITY_SETUPAPI << 16) | (error_code & 0x0000FFFF);\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n\t}\n\n\tsize = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error_code,\n\t\tMAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), &err_string[safe_strlen(err_string)],\n\t\tERR_BUFFER_SIZE - (DWORD)safe_strlen(err_string), NULL);\n\tif (size == 0) {\n\t\tformat_error = GetLastError();\n\t\tif (format_error)\n\t\t\tsafe_sprintf(err_string, ERR_BUFFER_SIZE,\n\t\t\t\t\"Windows error code %u (FormatMessage error code %u)\", error_code, format_error);\n\t\telse\n\t\t\tsafe_sprintf(err_string, ERR_BUFFER_SIZE, \"Unknown error code %u\", error_code);\n\t} else {\n\t\t// Remove CR/LF terminators\n\t\tfor (i=safe_strlen(err_string)-1; (i>=0) && ((err_string[i]==0x0A) || (err_string[i]==0x0D)); i--) {\n\t\t\terr_string[i] = 0;\n\t\t}\n\t}\n\treturn err_string;\n}\n#endif\n\n/*\n * Sanitize Microsoft's paths: convert to uppercase, add prefix and fix backslashes.\n * Return an allocated sanitized string or NULL on error.\n */\nstatic char* sanitize_path(const char* path)\n{\n\tconst char root_prefix[] = \"\\\\\\\\.\\\\\";\n\tsize_t j, size, root_size;\n\tchar* ret_path = NULL;\n\tsize_t add_root = 0;\n\n\tif (path == NULL)\n\t\treturn NULL;\n\n\tsize = safe_strlen(path)+1;\n\troot_size = sizeof(root_prefix)-1;\n\n\t// Microsoft indiscriminatly uses '\\\\?\\', '\\\\.\\', '##?#\" or \"##.#\" for root prefixes.\n\tif (!((size > 3) && (((path[0] == '\\\\') && (path[1] == '\\\\') && (path[3] == '\\\\')) ||\n\t\t((path[0] == '#') && (path[1] == '#') && (path[3] == '#'))))) {\n\t\tadd_root = root_size;\n\t\tsize += add_root;\n\t}\n\n\tif ((ret_path = (char*) calloc(size, 1)) == NULL)\n\t\treturn NULL;\n\n\tsafe_strcpy(&ret_path[add_root], size-add_root, path);\n\n\t// Ensure consistancy with root prefix\n\tfor (j=0; j<root_size; j++)\n\t\tret_path[j] = root_prefix[j];\n\n\t// Same goes for '\\' and '#' after the root prefix. Ensure '#' is used\n\tfor(j=root_size; j<size; j++) {\n\t\tret_path[j] = (char)toupper((int)ret_path[j]);\t// Fix case too\n\t\tif (ret_path[j] == '\\\\')\n\t\t\tret_path[j] = '#';\n\t}\n\n\treturn ret_path;\n}\n\n/*\n * Cfgmgr32, OLE32 and SetupAPI DLL functions\n */\nstatic int init_dlls(void)\n{\n\tDLL_LOAD(Cfgmgr32.dll, CM_Get_Parent, TRUE);\n\tDLL_LOAD(Cfgmgr32.dll, CM_Get_Child, TRUE);\n\tDLL_LOAD(Cfgmgr32.dll, CM_Get_Sibling, TRUE);\n\tDLL_LOAD(Cfgmgr32.dll, CM_Get_Device_IDA, TRUE);\n\t// Prefixed to avoid conflict with header files\n\tDLL_LOAD_PREFIXED(OLE32.dll, p, CLSIDFromString, TRUE);\n\tDLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiGetClassDevsA, TRUE);\n\tDLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiEnumDeviceInfo, TRUE);\n\tDLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiEnumDeviceInterfaces, TRUE);\n\tDLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiGetDeviceInterfaceDetailA, TRUE);\n\tDLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiDestroyDeviceInfoList, TRUE);\n\tDLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiOpenDevRegKey, TRUE);\n\tDLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiGetDeviceRegistryPropertyA, TRUE);\n\tDLL_LOAD_PREFIXED(SetupAPI.dll, p, SetupDiOpenDeviceInterfaceRegKey, TRUE);\n\tDLL_LOAD_PREFIXED(AdvAPI32.dll, p, RegQueryValueExW, TRUE);\n\tDLL_LOAD_PREFIXED(AdvAPI32.dll, p, RegCloseKey, TRUE);\n\treturn LIBUSB_SUCCESS;\n}\n\n/*\n * enumerate interfaces for the whole USB class\n *\n * Parameters:\n * dev_info: a pointer to a dev_info list\n * dev_info_data: a pointer to an SP_DEVINFO_DATA to be filled (or NULL if not needed)\n * usb_class: the generic USB class for which to retrieve interface details\n * index: zero based index of the interface in the device info list\n *\n * Note: it is the responsibility of the caller to free the DEVICE_INTERFACE_DETAIL_DATA\n * structure returned and call this function repeatedly using the same guid (with an\n * incremented index starting at zero) until all interfaces have been returned.\n */\nstatic bool get_devinfo_data(struct libusb_context *ctx,\n\tHDEVINFO *dev_info, SP_DEVINFO_DATA *dev_info_data, const char* usb_class, unsigned _index)\n{\n\tif (_index <= 0) {\n\t\t*dev_info = pSetupDiGetClassDevsA(NULL, usb_class, NULL, DIGCF_PRESENT|DIGCF_ALLCLASSES);\n\t\tif (*dev_info == INVALID_HANDLE_VALUE) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tdev_info_data->cbSize = sizeof(SP_DEVINFO_DATA);\n\tif (!pSetupDiEnumDeviceInfo(*dev_info, _index, dev_info_data)) {\n\t\tif (GetLastError() != ERROR_NO_MORE_ITEMS) {\n\t\t\tusbi_err(ctx, \"Could not obtain device info data for index %u: %s\",\n\t\t\t\t_index, windows_error_str(0));\n\t\t}\n\t\tpSetupDiDestroyDeviceInfoList(*dev_info);\n\t\t*dev_info = INVALID_HANDLE_VALUE;\n\t\treturn false;\n\t}\n\treturn true;\n}\n\n/*\n * enumerate interfaces for a specific GUID\n *\n * Parameters:\n * dev_info: a pointer to a dev_info list\n * dev_info_data: a pointer to an SP_DEVINFO_DATA to be filled (or NULL if not needed)\n * guid: the GUID for which to retrieve interface details\n * index: zero based index of the interface in the device info list\n *\n * Note: it is the responsibility of the caller to free the DEVICE_INTERFACE_DETAIL_DATA\n * structure returned and call this function repeatedly using the same guid (with an\n * incremented index starting at zero) until all interfaces have been returned.\n */\nstatic SP_DEVICE_INTERFACE_DETAIL_DATA_A *get_interface_details(struct libusb_context *ctx,\n\tHDEVINFO *dev_info, SP_DEVINFO_DATA *dev_info_data, const GUID* guid, unsigned _index)\n{\n\tSP_DEVICE_INTERFACE_DATA dev_interface_data;\n\tSP_DEVICE_INTERFACE_DETAIL_DATA_A *dev_interface_details = NULL;\n\tDWORD size;\n\n\tif (_index <= 0) {\n\t\t*dev_info = pSetupDiGetClassDevsA(guid, NULL, NULL, DIGCF_PRESENT|DIGCF_DEVICEINTERFACE);\n\t}\n\n\tif (dev_info_data != NULL) {\n\t\tdev_info_data->cbSize = sizeof(SP_DEVINFO_DATA);\n\t\tif (!pSetupDiEnumDeviceInfo(*dev_info, _index, dev_info_data)) {\n\t\t\tif (GetLastError() != ERROR_NO_MORE_ITEMS) {\n\t\t\t\tusbi_err(ctx, \"Could not obtain device info data for index %u: %s\",\n\t\t\t\t\t_index, windows_error_str(0));\n\t\t\t}\n\t\t\tpSetupDiDestroyDeviceInfoList(*dev_info);\n\t\t\t*dev_info = INVALID_HANDLE_VALUE;\n\t\t\treturn NULL;\n\t\t}\n\t}\n\n\tdev_interface_data.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);\n\tif (!pSetupDiEnumDeviceInterfaces(*dev_info, NULL, guid, _index, &dev_interface_data)) {\n\t\tif (GetLastError() != ERROR_NO_MORE_ITEMS) {\n\t\t\tusbi_err(ctx, \"Could not obtain interface data for index %u: %s\",\n\t\t\t\t_index, windows_error_str(0));\n\t\t}\n\t\tpSetupDiDestroyDeviceInfoList(*dev_info);\n\t\t*dev_info = INVALID_HANDLE_VALUE;\n\t\treturn NULL;\n\t}\n\n\t// Read interface data (dummy + actual) to access the device path\n\tif (!pSetupDiGetDeviceInterfaceDetailA(*dev_info, &dev_interface_data, NULL, 0, &size, NULL)) {\n\t\t// The dummy call should fail with ERROR_INSUFFICIENT_BUFFER\n\t\tif (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {\n\t\t\tusbi_err(ctx, \"could not access interface data (dummy) for index %u: %s\",\n\t\t\t\t_index, windows_error_str(0));\n\t\t\tgoto err_exit;\n\t\t}\n\t} else {\n\t\tusbi_err(ctx, \"program assertion failed - http://msdn.microsoft.com/en-us/library/ms792901.aspx is wrong.\");\n\t\tgoto err_exit;\n\t}\n\n\tif ((dev_interface_details = (SP_DEVICE_INTERFACE_DETAIL_DATA_A*) calloc(size, 1)) == NULL) {\n\t\tusbi_err(ctx, \"could not allocate interface data for index %u.\", _index);\n\t\tgoto err_exit;\n\t}\n\n\tdev_interface_details->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A);\n\tif (!pSetupDiGetDeviceInterfaceDetailA(*dev_info, &dev_interface_data,\n\t\tdev_interface_details, size, &size, NULL)) {\n\t\tusbi_err(ctx, \"could not access interface data (actual) for index %u: %s\",\n\t\t\t_index, windows_error_str(0));\n\t}\n\n\treturn dev_interface_details;\n\nerr_exit:\n\tpSetupDiDestroyDeviceInfoList(*dev_info);\n\t*dev_info = INVALID_HANDLE_VALUE;\n\treturn NULL;\n}\n\n/* For libusb0 filter */\nstatic SP_DEVICE_INTERFACE_DETAIL_DATA_A *get_interface_details_filter(struct libusb_context *ctx,\n\tHDEVINFO *dev_info, SP_DEVINFO_DATA *dev_info_data, const GUID* guid, unsigned _index, char* filter_path){\n\tSP_DEVICE_INTERFACE_DATA dev_interface_data;\n\tSP_DEVICE_INTERFACE_DETAIL_DATA_A *dev_interface_details = NULL;\n\tDWORD size;\n\tif (_index <= 0) {\n\t\t*dev_info = pSetupDiGetClassDevsA(guid, NULL, NULL, DIGCF_PRESENT|DIGCF_DEVICEINTERFACE);\n\t}\n\tif (dev_info_data != NULL) {\n\t\tdev_info_data->cbSize = sizeof(SP_DEVINFO_DATA);\n\t\tif (!pSetupDiEnumDeviceInfo(*dev_info, _index, dev_info_data)) {\n\t\t\tif (GetLastError() != ERROR_NO_MORE_ITEMS) {\n\t\t\t\tusbi_err(ctx, \"Could not obtain device info data for index %u: %s\",\n\t\t\t\t\t_index, windows_error_str(0));\n\t\t\t}\n\t\t\tpSetupDiDestroyDeviceInfoList(*dev_info);\n\t\t\t*dev_info = INVALID_HANDLE_VALUE;\n\t\t\treturn NULL;\n\t\t}\n\t}\n\tdev_interface_data.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);\n\tif (!pSetupDiEnumDeviceInterfaces(*dev_info, NULL, guid, _index, &dev_interface_data)) {\n\t\tif (GetLastError() != ERROR_NO_MORE_ITEMS) {\n\t\t\tusbi_err(ctx, \"Could not obtain interface data for index %u: %s\",\n\t\t\t\t_index, windows_error_str(0));\n\t\t}\n\t\tpSetupDiDestroyDeviceInfoList(*dev_info);\n\t\t*dev_info = INVALID_HANDLE_VALUE;\n\t\treturn NULL;\n\t}\n\t// Read interface data (dummy + actual) to access the device path\n\tif (!pSetupDiGetDeviceInterfaceDetailA(*dev_info, &dev_interface_data, NULL, 0, &size, NULL)) {\n\t\t// The dummy call should fail with ERROR_INSUFFICIENT_BUFFER\n\t\tif (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {\n\t\t\tusbi_err(ctx, \"could not access interface data (dummy) for index %u: %s\",\n\t\t\t\t_index, windows_error_str(0));\n\t\t\tgoto err_exit;\n\t\t}\n\t} else {\n\t\tusbi_err(ctx, \"program assertion failed - http://msdn.microsoft.com/en-us/library/ms792901.aspx is wrong.\");\n\t\tgoto err_exit;\n\t}\n\tif ((dev_interface_details = malloc(size)) == NULL) {\n\t\tusbi_err(ctx, \"could not allocate interface data for index %u.\", _index);\n\t\tgoto err_exit;\n\t}\n\tdev_interface_details->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A);\n\tif (!pSetupDiGetDeviceInterfaceDetailA(*dev_info, &dev_interface_data,\n\t\tdev_interface_details, size, &size, NULL)) {\n\t\tusbi_err(ctx, \"could not access interface data (actual) for index %u: %s\",\n\t\t\t_index, windows_error_str(0));\n\t}\n\t// [trobinso] lookup the libusb0 symbolic index.\n\tif (dev_interface_details) {\n\t\tHKEY hkey_device_interface=pSetupDiOpenDeviceInterfaceRegKey(*dev_info,&dev_interface_data,0,KEY_READ);\n\t\tif (hkey_device_interface != INVALID_HANDLE_VALUE) {\n\t\t\tDWORD libusb0_symboliclink_index=0;\n\t\t\tDWORD value_length=sizeof(DWORD);\n\t\t\tDWORD value_type=0;\n\t\t\tLONG status;\n\t\t\tstatus = pRegQueryValueExW(hkey_device_interface, L\"LUsb0\", NULL, &value_type,\n\t\t\t\t(LPBYTE) &libusb0_symboliclink_index, &value_length);\n\t\t\tif (status == ERROR_SUCCESS) {\n\t\t\t\tif (libusb0_symboliclink_index < 256) {\n\t\t\t\t\t// libusb0.sys is connected to this device instance.\n\t\t\t\t\t// If the the device interface guid is {F9F3FF14-AE21-48A0-8A25-8011A7A931D9} then it's a filter.\n\t\t\t\t\tsafe_sprintf(filter_path, sizeof(\"\\\\\\\\.\\\\libusb0-0000\"), \"\\\\\\\\.\\\\libusb0-%04d\", libusb0_symboliclink_index);\n\t\t\t\t\tusbi_dbg(\"assigned libusb0 symbolic link %s\", filter_path);\n\t\t\t\t} else {\n\t\t\t\t\t// libusb0.sys was connected to this device instance at one time; but not anymore.\n\t\t\t\t}\n\t\t\t}\n\t\t\tpRegCloseKey(hkey_device_interface);\n\t\t}\n\t}\n\treturn dev_interface_details;\nerr_exit:\n\tpSetupDiDestroyDeviceInfoList(*dev_info);\n\t*dev_info = INVALID_HANDLE_VALUE;\n\treturn NULL;}\n\n/* Hash table functions - modified From glibc 2.3.2:\n   [Aho,Sethi,Ullman] Compilers: Principles, Techniques and Tools, 1986\n   [Knuth]            The Art of Computer Programming, part 3 (6.4)  */\ntypedef struct htab_entry {\n\tunsigned long used;\n\tchar* str;\n} htab_entry;\nhtab_entry* htab_table = NULL;\nusbi_mutex_t htab_write_mutex = NULL;\nunsigned long htab_size, htab_filled;\n\n/* For the used double hash method the table size has to be a prime. To\n   correct the user given table size we need a prime test.  This trivial\n   algorithm is adequate because the code is called only during init and\n   the number is likely to be small  */\nstatic int isprime(unsigned long number)\n{\n\t// no even number will be passed\n\tunsigned int divider = 3;\n\n\twhile((divider * divider < number) && (number % divider != 0))\n\t\tdivider += 2;\n\n\treturn (number % divider != 0);\n}\n\n/* Before using the hash table we must allocate memory for it.\n   We allocate one element more as the found prime number says.\n   This is done for more effective indexing as explained in the\n   comment for the hash function.  */\nstatic int htab_create(struct libusb_context *ctx, unsigned long nel)\n{\n\tif (htab_table != NULL) {\n\t\tusbi_err(ctx, \"hash table already allocated\");\n\t}\n\n\t// Create a mutex\n\tusbi_mutex_init(&htab_write_mutex, NULL);\n\n\t// Change nel to the first prime number not smaller as nel.\n\tnel |= 1;\n\twhile(!isprime(nel))\n\t\tnel += 2;\n\n\thtab_size = nel;\n\tusbi_dbg(\"using %d entries hash table\", nel);\n\thtab_filled = 0;\n\n\t// allocate memory and zero out.\n\thtab_table = (htab_entry*) calloc(htab_size + 1, sizeof(htab_entry));\n\tif (htab_table == NULL) {\n\t\tusbi_err(ctx, \"could not allocate space for hash table\");\n\t\treturn 0;\n\t}\n\n\treturn 1;\n}\n\n/* After using the hash table it has to be destroyed.  */\nstatic void htab_destroy(void)\n{\n\tsize_t i;\n\tif (htab_table == NULL) {\n\t\treturn;\n\t}\n\n\tfor (i=0; i<htab_size; i++) {\n\t\tif (htab_table[i].used) {\n\t\t\tsafe_free(htab_table[i].str);\n\t\t}\n\t}\n\tusbi_mutex_destroy(&htab_write_mutex);\n\tsafe_free(htab_table);\n}\n\n/* This is the search function. It uses double hashing with open addressing.\n   We use an trick to speed up the lookup. The table is created with one\n   more element available. This enables us to use the index zero special.\n   This index will never be used because we store the first hash index in\n   the field used where zero means not used. Every other value means used.\n   The used field can be used as a first fast comparison for equality of\n   the stored and the parameter value. This helps to prevent unnecessary\n   expensive calls of strcmp.  */\nstatic unsigned long htab_hash(char* str)\n{\n\tunsigned long hval, hval2;\n\tunsigned long idx;\n\tunsigned long r = 5381;\n\tint c;\n\tchar* sz = str;\n\n\tif (str == NULL)\n\t\treturn 0;\n\n\t// Compute main hash value (algorithm suggested by Nokia)\n\twhile ((c = *sz++) != 0)\n\t\tr = ((r << 5) + r) + c;\n\tif (r == 0)\n\t\t++r;\n\n\t// compute table hash: simply take the modulus\n\thval = r % htab_size;\n\tif (hval == 0)\n\t\t++hval;\n\n\t// Try the first index\n\tidx = hval;\n\n\tif (htab_table[idx].used) {\n\t\tif ( (htab_table[idx].used == hval)\n\t\t  && (safe_strcmp(str, htab_table[idx].str) == 0) ) {\n\t\t\t// existing hash\n\t\t\treturn idx;\n\t\t}\n\t\tusbi_dbg(\"hash collision ('%s' vs '%s')\", str, htab_table[idx].str);\n\n\t\t// Second hash function, as suggested in [Knuth]\n\t\thval2 = 1 + hval % (htab_size - 2);\n\n\t\tdo {\n\t\t\t// Because size is prime this guarantees to step through all available indexes\n\t\t\tif (idx <= hval2) {\n\t\t\t\tidx = htab_size + idx - hval2;\n\t\t\t} else {\n\t\t\t\tidx -= hval2;\n\t\t\t}\n\n\t\t\t// If we visited all entries leave the loop unsuccessfully\n\t\t\tif (idx == hval) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// If entry is found use it.\n\t\t\tif ( (htab_table[idx].used == hval)\n\t\t\t  && (safe_strcmp(str, htab_table[idx].str) == 0) ) {\n\t\t\t\treturn idx;\n\t\t\t}\n\t\t}\n\t\twhile (htab_table[idx].used);\n\t}\n\n\t// Not found => New entry\n\n\t// If the table is full return an error\n\tif (htab_filled >= htab_size) {\n\t\tusbi_err(NULL, \"hash table is full (%d entries)\", htab_size);\n\t\treturn 0;\n\t}\n\n\t// Concurrent threads might be storing the same entry at the same time\n\t// (eg. \"simultaneous\" enums from different threads) => use a mutex\n\tusbi_mutex_lock(&htab_write_mutex);\n\t// Just free any previously allocated string (which should be the same as\n\t// new one). The possibility of concurrent threads storing a collision\n\t// string (same hash, different string) at the same time is extremely low\n\tsafe_free(htab_table[idx].str);\n\thtab_table[idx].used = hval;\n\thtab_table[idx].str = (char*) malloc(safe_strlen(str)+1);\n\tif (htab_table[idx].str == NULL) {\n\t\tusbi_err(NULL, \"could not duplicate string for hash table\");\n\t\tusbi_mutex_unlock(&htab_write_mutex);\n\t\treturn 0;\n\t}\n\tmemcpy(htab_table[idx].str, str, safe_strlen(str)+1);\n\t++htab_filled;\n\tusbi_mutex_unlock(&htab_write_mutex);\n\n\treturn idx;\n}\n\n/*\n * Returns the session ID of a device's nth level ancestor\n * If there's no device at the nth level, return 0\n */\nstatic unsigned long get_ancestor_session_id(DWORD devinst, unsigned level)\n{\n\tDWORD parent_devinst;\n\tunsigned long session_id = 0;\n\tchar* sanitized_path = NULL;\n\tchar path[MAX_PATH_LENGTH];\n\tunsigned i;\n\n\tif (level < 1) return 0;\n\tfor (i = 0; i<level; i++) {\n\t\tif (CM_Get_Parent(&parent_devinst, devinst, 0) != CR_SUCCESS) {\n\t\t\treturn 0;\n\t\t}\n\t\tdevinst = parent_devinst;\n\t}\n\tif (CM_Get_Device_IDA(devinst, path, MAX_PATH_LENGTH, 0) != CR_SUCCESS) {\n\t\treturn 0;\n\t}\n\t// TODO: (post hotplug): try without sanitizing\n\tsanitized_path = sanitize_path(path);\n\tif (sanitized_path == NULL) {\n\t\treturn 0;\n\t}\n\tsession_id = htab_hash(sanitized_path);\n\tsafe_free(sanitized_path);\n\treturn session_id;\n}\n\n/*\n * Populate the endpoints addresses of the device_priv interface helper structs\n */\nstatic int windows_assign_endpoints(struct libusb_device_handle *dev_handle, int iface, int altsetting)\n{\n\tint i, r;\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tstruct libusb_config_descriptor *conf_desc;\n\tconst struct libusb_interface_descriptor *if_desc;\n\tstruct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);\n\n\tr = libusb_get_config_descriptor(dev_handle->dev, 0, &conf_desc);\n\tif (r != LIBUSB_SUCCESS) {\n\t\tusbi_warn(ctx, \"could not read config descriptor: error %d\", r);\n\t\treturn r;\n\t}\n\n\tif_desc = &conf_desc->interface[iface].altsetting[altsetting];\n\tsafe_free(priv->usb_interface[iface].endpoint);\n\n\tif (if_desc->bNumEndpoints == 0) {\n\t\tusbi_dbg(\"no endpoints found for interface %d\", iface);\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\tpriv->usb_interface[iface].endpoint = (uint8_t*) malloc(if_desc->bNumEndpoints);\n\tif (priv->usb_interface[iface].endpoint == NULL) {\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\tpriv->usb_interface[iface].nb_endpoints = if_desc->bNumEndpoints;\n\tfor (i=0; i<if_desc->bNumEndpoints; i++) {\n\t\tpriv->usb_interface[iface].endpoint[i] = if_desc->endpoint[i].bEndpointAddress;\n\t\tusbi_dbg(\"(re)assigned endpoint %02X to interface %d\", priv->usb_interface[iface].endpoint[i], iface);\n\t}\n\tlibusb_free_config_descriptor(conf_desc);\n\n\t// Extra init may be required to configure endpoints\n\treturn priv->apib->configure_endpoints(SUB_API_NOTSET, dev_handle, iface);\n}\n\n// Lookup for a match in the list of API driver names\n// return -1 if not found, driver match number otherwise\nstatic int get_sub_api(char* driver, int api){\n\tint i;\n\tconst char sep_str[2] = {LIST_SEPARATOR, 0};\n\tchar *tok, *tmp_str;\n\tsize_t len = safe_strlen(driver);\n\n\tif (len == 0) return SUB_API_NOTSET;\n\ttmp_str = (char*) calloc(len+1, 1);\n\tif (tmp_str == NULL) return SUB_API_NOTSET;\n\tmemcpy(tmp_str, driver, len+1);\n\ttok = strtok(tmp_str, sep_str);\n\twhile (tok != NULL) {\n\t\tfor (i=0; i<usb_api_backend[api].nb_driver_names; i++) {\n\t\t\tif (safe_stricmp(tok, usb_api_backend[api].driver_name_list[i]) == 0) {\n\t\t\t\tfree(tmp_str);\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\ttok = strtok(NULL, sep_str);\n\t}\n\tfree (tmp_str);\n\treturn SUB_API_NOTSET;\n}\n\n/*\n * auto-claiming and auto-release helper functions\n */\nstatic int auto_claim(struct libusb_transfer *transfer, int *interface_number, int api_type)\n{\n\tstruct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(\n\t\ttransfer->dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tint current_interface = *interface_number;\n\tint r = LIBUSB_SUCCESS;\n\n\tswitch(api_type) {\n\tcase USB_API_WINUSBX:\n\tcase USB_API_HID:\n\t\tbreak;\n\tdefault:\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\n\tusbi_mutex_lock(&autoclaim_lock);\n\tif (current_interface < 0)\t// No serviceable interface was found\n\t{\n\t\tfor (current_interface=0; current_interface<USB_MAXINTERFACES; current_interface++) {\n\t\t\t// Must claim an interface of the same API type\n\t\t\tif ( (priv->usb_interface[current_interface].apib->id == api_type)\n\t\t\t  && (libusb_claim_interface(transfer->dev_handle, current_interface) == LIBUSB_SUCCESS) ) {\n\t\t\t\tusbi_dbg(\"auto-claimed interface %d for control request\", current_interface);\n\t\t\t\tif (handle_priv->autoclaim_count[current_interface] != 0) {\n\t\t\t\t\tusbi_warn(ctx, \"program assertion failed - autoclaim_count was nonzero\");\n\t\t\t\t}\n\t\t\t\thandle_priv->autoclaim_count[current_interface]++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (current_interface == USB_MAXINTERFACES) {\n\t\t\tusbi_err(ctx, \"could not auto-claim any interface\");\n\t\t\tr = LIBUSB_ERROR_NOT_FOUND;\n\t\t}\n\t} else {\n\t\t// If we have a valid interface that was autoclaimed, we must increment\n\t\t// its autoclaim count so that we can prevent an early release.\n\t\tif (handle_priv->autoclaim_count[current_interface] != 0) {\n\t\t\thandle_priv->autoclaim_count[current_interface]++;\n\t\t}\n\t}\n\tusbi_mutex_unlock(&autoclaim_lock);\n\n\t*interface_number = current_interface;\n\treturn r;\n\n}\n\nstatic void auto_release(struct usbi_transfer *itransfer)\n{\n\tstruct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tlibusb_device_handle *dev_handle = transfer->dev_handle;\n\tstruct windows_device_handle_priv* handle_priv = _device_handle_priv(dev_handle);\n\tint r;\n\n\tusbi_mutex_lock(&autoclaim_lock);\n\tif (handle_priv->autoclaim_count[transfer_priv->interface_number] > 0) {\n\t\thandle_priv->autoclaim_count[transfer_priv->interface_number]--;\n\t\tif (handle_priv->autoclaim_count[transfer_priv->interface_number] == 0) {\n\t\t\tr = libusb_release_interface(dev_handle, transfer_priv->interface_number);\n\t\t\tif (r == LIBUSB_SUCCESS) {\n\t\t\t\tusbi_dbg(\"auto-released interface %d\", transfer_priv->interface_number);\n\t\t\t} else {\n\t\t\t\tusbi_dbg(\"failed to auto-release interface %d (%s)\",\n\t\t\t\t\ttransfer_priv->interface_number, libusb_error_name((enum libusb_error)r));\n\t\t\t}\n\t\t}\n\t}\n\tusbi_mutex_unlock(&autoclaim_lock);\n}\n\n/*\n * init: libusb backend init function\n *\n * This function enumerates the HCDs (Host Controller Drivers) and populates our private HCD list\n * In our implementation, we equate Windows' \"HCD\" to libusb's \"bus\". Note that bus is zero indexed.\n * HCDs are not expected to change after init (might not hold true for hot pluggable USB PCI card?)\n */\nstatic int windows_init(struct libusb_context *ctx)\n{\n\tint i, r = LIBUSB_ERROR_OTHER;\n\tOSVERSIONINFO os_version;\n\tHANDLE semaphore;\n\tchar sem_name[11+1+8]; // strlen(libusb_init)+'\\0'+(32-bit hex PID)\n\n\tsprintf(sem_name, \"libusb_init%08X\", (unsigned int)GetCurrentProcessId()&0xFFFFFFFF);\n\tsemaphore = CreateSemaphoreA(NULL, 1, 1, sem_name);\n\tif (semaphore == NULL) {\n\t\tusbi_err(ctx, \"could not create semaphore: %s\", windows_error_str(0));\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\t// A successful wait brings our semaphore count to 0 (unsignaled)\n\t// => any concurent wait stalls until the semaphore's release\n\tif (WaitForSingleObject(semaphore, INFINITE) != WAIT_OBJECT_0) {\n\t\tusbi_err(ctx, \"failure to access semaphore: %s\", windows_error_str(0));\n\t\tCloseHandle(semaphore);\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\t// NB: concurrent usage supposes that init calls are equally balanced with\n\t// exit calls. If init is called more than exit, we will not exit properly\n\tif ( ++concurrent_usage == 0 ) {\t// First init?\n\t\t// Detect OS version\n\t\tmemset(&os_version, 0, sizeof(OSVERSIONINFO));\n\t\tos_version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);\n\t\twindows_version = WINDOWS_UNSUPPORTED;\n\t\tif ((GetVersionEx(&os_version) != 0) && (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)) {\n\t\t\tif ((os_version.dwMajorVersion == 5) && (os_version.dwMinorVersion == 1)) {\n\t\t\t\twindows_version = WINDOWS_XP;\n\t\t\t} else if ((os_version.dwMajorVersion == 5) && (os_version.dwMinorVersion == 2)) {\n\t\t\t\twindows_version = WINDOWS_2003;\t// also includes XP 64\n\t\t\t} else if (os_version.dwMajorVersion >= 6) {\n\t\t\t\twindows_version = WINDOWS_VISTA_AND_LATER;\n\t\t\t}\n\t\t}\n\t\tif (windows_version == WINDOWS_UNSUPPORTED) {\n\t\t\tusbi_err(ctx, \"This version of Windows is NOT supported\");\n\t\t\tr = LIBUSB_ERROR_NOT_SUPPORTED;\n\t\t\tgoto init_exit;\n\t\t}\n\n\t\t// We need a lock for proper auto-release\n\t\tusbi_mutex_init(&autoclaim_lock, NULL);\n\n\t\t// Initialize pollable file descriptors\n\t\tinit_polling();\n\n\t\t// Load DLL imports\n\t\tif (init_dlls() != LIBUSB_SUCCESS) {\n\t\t\tusbi_err(ctx, \"could not resolve DLL functions\");\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\t}\n\n\t\t// Initialize the low level APIs (we don't care about errors at this stage)\n\t\tfor (i=0; i<USB_API_MAX; i++) {\n\t\t\tusb_api_backend[i].init(SUB_API_NOTSET, ctx);\n\t\t}\n\n\t\t// Because QueryPerformanceCounter might report different values when\n\t\t// running on different cores, we create a separate thread for the timer\n\t\t// calls, which we glue to the first core always to prevent timing discrepancies.\n\t\tr = LIBUSB_ERROR_NO_MEM;\n\t\tfor (i = 0; i < 2; i++) {\n\t\t\ttimer_request[i] = CreateEvent(NULL, TRUE, FALSE, NULL);\n\t\t\tif (timer_request[i] == NULL) {\n\t\t\t\tusbi_err(ctx, \"could not create timer request event %d - aborting\", i);\n\t\t\t\tgoto init_exit;\n\t\t\t}\n\t\t}\n\t\ttimer_response = CreateSemaphore(NULL, 0, MAX_TIMER_SEMAPHORES, NULL);\n\t\tif (timer_response == NULL) {\n\t\t\tusbi_err(ctx, \"could not create timer response semaphore - aborting\");\n\t\t\tgoto init_exit;\n\t\t}\n\t\ttimer_mutex = CreateMutex(NULL, FALSE, NULL);\n\t\tif (timer_mutex == NULL) {\n\t\t\tusbi_err(ctx, \"could not create timer mutex - aborting\");\n\t\t\tgoto init_exit;\n\t\t}\n\t\ttimer_thread = (HANDLE)_beginthreadex(NULL, 0, windows_clock_gettime_threaded, NULL, 0, NULL);\n\t\tif (timer_thread == NULL) {\n\t\t\tusbi_err(ctx, \"Unable to create timer thread - aborting\");\n\t\t\tgoto init_exit;\n\t\t}\n\t\tSetThreadAffinityMask(timer_thread, 0);\n\n\t\t// Wait for timer thread to init before continuing.\n\t\tif (WaitForSingleObject(timer_response, INFINITE) != WAIT_OBJECT_0) {\n\t\t\tusbi_err(ctx, \"Failed to wait for timer thread to become ready - aborting\");\n\t\t\tgoto init_exit;\n\t\t}\n\n\t\t// Create a hash table to store session ids. Second parameter is better if prime\n\t\thtab_create(ctx, HTAB_SIZE);\n\t}\n\t// At this stage, either we went through full init successfully, or didn't need to\n\tr = LIBUSB_SUCCESS;\n\ninit_exit: // Holds semaphore here.\n\tif (!concurrent_usage && r != LIBUSB_SUCCESS) { // First init failed?\n\t\tif (timer_thread) {\n\t\t\tSetEvent(timer_request[1]); // actually the signal to quit the thread.\n\t\t\tif (WAIT_OBJECT_0 != WaitForSingleObject(timer_thread, INFINITE)) {\n\t\t\t\tusbi_warn(ctx, \"could not wait for timer thread to quit\");\n\t\t\t\tTerminateThread(timer_thread, 1); // shouldn't happen, but we're destroying\n\t\t\t\t\t\t\t\t\t\t\t\t  // all objects it might have held anyway.\n\t\t\t}\n\t\t\tCloseHandle(timer_thread);\n\t\t\ttimer_thread = NULL;\n\t\t}\n\t\tfor (i = 0; i < 2; i++) {\n\t\t\tif (timer_request[i]) {\n\t\t\t\tCloseHandle(timer_request[i]);\n\t\t\t\ttimer_request[i] = NULL;\n\t\t\t}\n\t\t}\n\t\tif (timer_response) {\n\t\t\tCloseHandle(timer_response);\n\t\t\ttimer_response = NULL;\n\t\t}\n\t\tif (timer_mutex) {\n\t\t\tCloseHandle(timer_mutex);\n\t\t\ttimer_mutex = NULL;\n\t\t}\n\t\thtab_destroy();\n\t}\n\n\tif (r != LIBUSB_SUCCESS)\n\t\t--concurrent_usage; // Not expected to call libusb_exit if we failed.\n\n\tReleaseSemaphore(semaphore, 1, NULL);\t// increase count back to 1\n\tCloseHandle(semaphore);\n\treturn r;\n}\n\n/*\n * HCD (root) hubs need to have their device descriptor manually populated\n *\n * Note that, like Microsoft does in the device manager, we populate the\n * Vendor and Device ID for HCD hubs with the ones from the PCI HCD device.\n */\nstatic int force_hcd_device_descriptor(struct libusb_device *dev)\n{\n\tstruct windows_device_priv *parent_priv, *priv = _device_priv(dev);\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\tint vid, pid;\n\n\tdev->num_configurations = 1;\n\tpriv->dev_descriptor.bLength = sizeof(USB_DEVICE_DESCRIPTOR);\n\tpriv->dev_descriptor.bDescriptorType = USB_DEVICE_DESCRIPTOR_TYPE;\n\tpriv->dev_descriptor.bNumConfigurations = 1;\n\tpriv->active_config = 1;\n\n\tif (priv->parent_dev == NULL) {\n\t\tusbi_err(ctx, \"program assertion failed - HCD hub has no parent\");\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t}\n\tparent_priv = _device_priv(priv->parent_dev);\n\tif (sscanf(parent_priv->path, \"\\\\\\\\.\\\\PCI#VEN_%04x&DEV_%04x%*s\", &vid, &pid) == 2) {\n\t\tpriv->dev_descriptor.idVendor = (uint16_t)vid;\n\t\tpriv->dev_descriptor.idProduct = (uint16_t)pid;\n\t} else {\n\t\tusbi_warn(ctx, \"could not infer VID/PID of HCD hub from '%s'\", parent_priv->path);\n\t\tpriv->dev_descriptor.idVendor = 0x1d6b;\t\t// Linux Foundation root hub\n\t\tpriv->dev_descriptor.idProduct = 1;\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\n/*\n * fetch and cache all the config descriptors through I/O\n */\nstatic int cache_config_descriptors(struct libusb_device *dev, HANDLE hub_handle, char* device_id)\n{\n\tDWORD size, ret_size;\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\tstruct windows_device_priv *priv = _device_priv(dev);\n\tint r;\n\tuint8_t i;\n\n\tUSB_CONFIGURATION_DESCRIPTOR_SHORT cd_buf_short;    // dummy request\n\tPUSB_DESCRIPTOR_REQUEST cd_buf_actual = NULL;       // actual request\n\tPUSB_CONFIGURATION_DESCRIPTOR cd_data = NULL;\n\n\tif (dev->num_configurations == 0)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\tpriv->config_descriptor = (unsigned char**) calloc(dev->num_configurations, sizeof(unsigned char*));\n\tif (priv->config_descriptor == NULL)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\tfor (i=0; i<dev->num_configurations; i++)\n\t\tpriv->config_descriptor[i] = NULL;\n\n\tfor (i=0, r=LIBUSB_SUCCESS; ; i++)\n\t{\n\t\t// safe loop: release all dynamic resources\n\t\tsafe_free(cd_buf_actual);\n\n\t\t// safe loop: end of loop condition\n\t\tif ((i >= dev->num_configurations) || (r != LIBUSB_SUCCESS))\n\t\t\tbreak;\n\n\t\tsize = sizeof(USB_CONFIGURATION_DESCRIPTOR_SHORT);\n\t\tmemset(&cd_buf_short, 0, size);\n\n\t\tcd_buf_short.req.ConnectionIndex = (ULONG)priv->port;\n\t\tcd_buf_short.req.SetupPacket.bmRequest = LIBUSB_ENDPOINT_IN;\n\t\tcd_buf_short.req.SetupPacket.bRequest = USB_REQUEST_GET_DESCRIPTOR;\n\t\tcd_buf_short.req.SetupPacket.wValue = (USB_CONFIGURATION_DESCRIPTOR_TYPE << 8) | i;\n\t\tcd_buf_short.req.SetupPacket.wIndex = i;\n\t\tcd_buf_short.req.SetupPacket.wLength = (USHORT)(size - sizeof(USB_DESCRIPTOR_REQUEST));\n\n\t\t// Dummy call to get the required data size. Initial failures are reported as info rather\n\t\t// than error as they can occur for non-penalizing situations, such as with some hubs.\n\t\tif (!DeviceIoControl(hub_handle, IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, &cd_buf_short, size,\n\t\t\t&cd_buf_short, size, &ret_size, NULL)) {\n\t\t\tusbi_info(ctx, \"could not access configuration descriptor (dummy) for '%s': %s\", device_id, windows_error_str(0));\n\t\t\tLOOP_BREAK(LIBUSB_ERROR_IO);\n\t\t}\n\n\t\tif ((ret_size != size) || (cd_buf_short.data.wTotalLength < sizeof(USB_CONFIGURATION_DESCRIPTOR))) {\n\t\t\tusbi_info(ctx, \"unexpected configuration descriptor size (dummy) for '%s'.\", device_id);\n\t\t\tLOOP_BREAK(LIBUSB_ERROR_IO);\n\t\t}\n\n\t\tsize = sizeof(USB_DESCRIPTOR_REQUEST) + cd_buf_short.data.wTotalLength;\n\t\tif ((cd_buf_actual = (PUSB_DESCRIPTOR_REQUEST) calloc(1, size)) == NULL) {\n\t\t\tusbi_err(ctx, \"could not allocate configuration descriptor buffer for '%s'.\", device_id);\n\t\t\tLOOP_BREAK(LIBUSB_ERROR_NO_MEM);\n\t\t}\n\t\tmemset(cd_buf_actual, 0, size);\n\n\t\t// Actual call\n\t\tcd_buf_actual->ConnectionIndex = (ULONG)priv->port;\n\t\tcd_buf_actual->SetupPacket.bmRequest = LIBUSB_ENDPOINT_IN;\n\t\tcd_buf_actual->SetupPacket.bRequest = USB_REQUEST_GET_DESCRIPTOR;\n\t\tcd_buf_actual->SetupPacket.wValue = (USB_CONFIGURATION_DESCRIPTOR_TYPE << 8) | i;\n\t\tcd_buf_actual->SetupPacket.wIndex = i;\n\t\tcd_buf_actual->SetupPacket.wLength = (USHORT)(size - sizeof(USB_DESCRIPTOR_REQUEST));\n\n\t\tif (!DeviceIoControl(hub_handle, IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, cd_buf_actual, size,\n\t\t\tcd_buf_actual, size, &ret_size, NULL)) {\n\t\t\tusbi_err(ctx, \"could not access configuration descriptor (actual) for '%s': %s\", device_id, windows_error_str(0));\n\t\t\tLOOP_BREAK(LIBUSB_ERROR_IO);\n\t\t}\n\n\t\tcd_data = (PUSB_CONFIGURATION_DESCRIPTOR)((UCHAR*)cd_buf_actual+sizeof(USB_DESCRIPTOR_REQUEST));\n\n\t\tif ((size != ret_size) || (cd_data->wTotalLength != cd_buf_short.data.wTotalLength)) {\n\t\t\tusbi_err(ctx, \"unexpected configuration descriptor size (actual) for '%s'.\", device_id);\n\t\t\tLOOP_BREAK(LIBUSB_ERROR_IO);\n\t\t}\n\n\t\tif (cd_data->bDescriptorType != USB_CONFIGURATION_DESCRIPTOR_TYPE) {\n\t\t\tusbi_err(ctx, \"not a configuration descriptor for '%s'\", device_id);\n\t\t\tLOOP_BREAK(LIBUSB_ERROR_IO);\n\t\t}\n\n\t\tusbi_dbg(\"cached config descriptor %d (bConfigurationValue=%d, %d bytes)\",\n\t\t\ti, cd_data->bConfigurationValue, cd_data->wTotalLength);\n\n\t\t// Cache the descriptor\n\t\tpriv->config_descriptor[i] = (unsigned char*) malloc(cd_data->wTotalLength);\n\t\tif (priv->config_descriptor[i] == NULL)\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t\tmemcpy(priv->config_descriptor[i], cd_data, cd_data->wTotalLength);\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\n/*\n * Populate a libusb device structure\n */\nstatic int init_device(struct libusb_device* dev, struct libusb_device* parent_dev,\n\t\t\t\t\t   uint8_t port_number, char* device_id, DWORD devinst)\n{\n\tHANDLE handle;\n\tDWORD size;\n\tUSB_NODE_CONNECTION_INFORMATION_EX conn_info;\n\tstruct windows_device_priv *priv, *parent_priv;\n\tstruct libusb_context *ctx = DEVICE_CTX(dev);\n\tstruct libusb_device* tmp_dev;\n\tunsigned i;\n\n\tif ((dev == NULL) || (parent_dev == NULL)) {\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\tpriv = _device_priv(dev);\n\tparent_priv = _device_priv(parent_dev);\n\tif (parent_priv->apib->id != USB_API_HUB) {\n\t\tusbi_warn(ctx, \"parent for device '%s' is not a hub\", device_id);\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\t// It is possible for the parent hub not to have been initialized yet\n\t// If that's the case, lookup the ancestors to set the bus number\n\tif (parent_dev->bus_number == 0) {\n\t\tfor (i=2; ; i++) {\n\t\t\ttmp_dev = usbi_get_device_by_session_id(ctx, get_ancestor_session_id(devinst, i));\n\t\t\tif (tmp_dev == NULL) break;\n\t\t\tif (tmp_dev->bus_number != 0) {\n\t\t\t\tusbi_dbg(\"got bus number from ancestor #%d\", i);\n\t\t\t\tparent_dev->bus_number = tmp_dev->bus_number;\n\t\t\t\tlibusb_unref_device(tmp_dev);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlibusb_unref_device(tmp_dev);\n\t\t}\n\t}\n\tif (parent_dev->bus_number == 0) {\n\t\tusbi_err(ctx, \"program assertion failed: unable to find ancestor bus number for '%s'\", device_id);\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\tdev->bus_number = parent_dev->bus_number;\n\tpriv->port = port_number;\n\tdev->port_number = port_number;\n\tpriv->depth = parent_priv->depth + 1;\n\tpriv->parent_dev = parent_dev;\n\tdev->parent_dev = parent_dev;\n\n\t// If the device address is already set, we can stop here\n\tif (dev->device_address != 0) {\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\tmemset(&conn_info, 0, sizeof(conn_info));\n\tif (priv->depth != 0) {\t// Not a HCD hub\n\t\thandle = CreateFileA(parent_priv->path, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING,\n\t\t\tFILE_FLAG_OVERLAPPED, NULL);\n\t\tif (handle == INVALID_HANDLE_VALUE) {\n\t\t\tusbi_warn(ctx, \"could not open hub %s: %s\", parent_priv->path, windows_error_str(0));\n\t\t\treturn LIBUSB_ERROR_ACCESS;\n\t\t}\n\t\tsize = sizeof(conn_info);\n\t\tconn_info.ConnectionIndex = (ULONG)port_number;\n\t\tif (!DeviceIoControl(handle, IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX, &conn_info, size,\n\t\t\t&conn_info, size, &size, NULL)) {\n\t\t\tusbi_warn(ctx, \"could not get node connection information for device '%s': %s\",\n\t\t\t\tdevice_id, windows_error_str(0));\n\t\t\tsafe_closehandle(handle);\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t\t}\n\t\tif (conn_info.ConnectionStatus == NoDeviceConnected) {\n\t\t\tusbi_err(ctx, \"device '%s' is no longer connected!\", device_id);\n\t\t\tsafe_closehandle(handle);\n\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t\t}\n\t\tmemcpy(&priv->dev_descriptor, &(conn_info.DeviceDescriptor), sizeof(USB_DEVICE_DESCRIPTOR));\n\t\tdev->num_configurations = priv->dev_descriptor.bNumConfigurations;\n\t\tpriv->active_config = conn_info.CurrentConfigurationValue;\n\t\tusbi_dbg(\"found %d configurations (active conf: %d)\", dev->num_configurations, priv->active_config);\n\t\t// If we can't read the config descriptors, just set the number of confs to zero\n\t\tif (cache_config_descriptors(dev, handle, device_id) != LIBUSB_SUCCESS) {\n\t\t\tdev->num_configurations = 0;\n\t\t\tpriv->dev_descriptor.bNumConfigurations = 0;\n\t\t}\n\t\tsafe_closehandle(handle);\n\n\t\tif (conn_info.DeviceAddress > UINT8_MAX) {\n\t\t\tusbi_err(ctx, \"program assertion failed: device address overflow\");\n\t\t}\n\t\tdev->device_address = (uint8_t)conn_info.DeviceAddress + 1;\n\t\tif (dev->device_address == 1) {\n\t\t\tusbi_err(ctx, \"program assertion failed: device address collision with root hub\");\n\t\t}\n\t\tswitch (conn_info.Speed) {\n\t\tcase 0: dev->speed = LIBUSB_SPEED_LOW; break;\n\t\tcase 1: dev->speed = LIBUSB_SPEED_FULL; break;\n\t\tcase 2: dev->speed = LIBUSB_SPEED_HIGH; break;\n\t\tcase 3: dev->speed = LIBUSB_SPEED_SUPER; break;\n\t\tdefault:\n\t\t\tusbi_warn(ctx, \"Got unknown device speed %d\", conn_info.Speed);\n\t\t\tbreak;\n\t\t}\n\t} else {\n\t\tdev->device_address = 1;\t// root hubs are set to use device number 1\n\t\tforce_hcd_device_descriptor(dev);\n\t}\n\n\tusbi_sanitize_device(dev);\n\n\tusbi_dbg(\"(bus: %d, addr: %d, depth: %d, port: %d): '%s'\",\n\t\tdev->bus_number, dev->device_address, priv->depth, priv->port, device_id);\n\n\treturn LIBUSB_SUCCESS;\n}\n\n// Returns the api type, or 0 if not found/unsupported\nstatic void get_api_type(struct libusb_context *ctx, HDEVINFO *dev_info,\n\tSP_DEVINFO_DATA *dev_info_data, int *api, int *sub_api)\n{\n\t// Precedence for filter drivers vs driver is in the order of this array\n\tstruct driver_lookup lookup[3] = {\n\t\t{\"\\0\\0\", SPDRP_SERVICE, \"driver\"},\n\t\t{\"\\0\\0\", SPDRP_UPPERFILTERS, \"upper filter driver\"},\n\t\t{\"\\0\\0\", SPDRP_LOWERFILTERS, \"lower filter driver\"}\n\t};\n\tDWORD size, reg_type;\n\tunsigned k, l;\n\tint i, j;\n\n\t*api = USB_API_UNSUPPORTED;\n\t*sub_api = SUB_API_NOTSET;\n\t// Check the service & filter names to know the API we should use\n\tfor (k=0; k<3; k++) {\n\t\tif (pSetupDiGetDeviceRegistryPropertyA(*dev_info, dev_info_data, lookup[k].reg_prop,\n\t\t\t&reg_type, (BYTE*)lookup[k].list, MAX_KEY_LENGTH, &size)) {\n\t\t\t// Turn the REG_SZ SPDRP_SERVICE into REG_MULTI_SZ\n\t\t\tif (lookup[k].reg_prop == SPDRP_SERVICE) {\n\t\t\t\t// our buffers are MAX_KEY_LENGTH+1 so we can overflow if needed\n\t\t\t\tlookup[k].list[safe_strlen(lookup[k].list)+1] = 0;\n\t\t\t}\n\t\t\t// MULTI_SZ is a pain to work with. Turn it into something much more manageable\n\t\t\t// NB: none of the driver names we check against contain LIST_SEPARATOR,\n\t\t\t// (currently ';'), so even if an unsuported one does, it's not an issue\n\t\t\tfor (l=0; (lookup[k].list[l] != 0) || (lookup[k].list[l+1] != 0); l++) {\n\t\t\t\tif (lookup[k].list[l] == 0) {\n\t\t\t\t\tlookup[k].list[l] = LIST_SEPARATOR;\n\t\t\t\t}\n\t\t\t}\n\t\t\tusbi_dbg(\"%s(s): %s\", lookup[k].designation, lookup[k].list);\n\t\t} else {\n\t\t\tif (GetLastError() != ERROR_INVALID_DATA) {\n\t\t\t\tusbi_dbg(\"could not access %s: %s\", lookup[k].designation, windows_error_str(0));\n\t\t\t}\n\t\t\tlookup[k].list[0] = 0;\n\t\t}\n\t}\n\n\tfor (i=1; i<USB_API_MAX; i++) {\n\t\tfor (k=0; k<3; k++) {\n\t\t\tj = get_sub_api(lookup[k].list, i);\n\t\t\tif (j >= 0) {\n\t\t\t\tusbi_dbg(\"matched %s name against %s\",\n\t\t\t\t\tlookup[k].designation, (i!=USB_API_WINUSBX)?usb_api_backend[i].designation:sub_api_name[j]);\n\t\t\t\t*api = i;\n\t\t\t\t*sub_api = j;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic int set_composite_interface(struct libusb_context* ctx, struct libusb_device* dev,\n\t\t\t\t\t\t\tchar* dev_interface_path, char* device_id, int api, int sub_api)\n{\n\tunsigned i;\n\tstruct windows_device_priv *priv = _device_priv(dev);\n\tint interface_number;\n\n\tif (priv->apib->id != USB_API_COMPOSITE) {\n\t\tusbi_err(ctx, \"program assertion failed: '%s' is not composite\", device_id);\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t}\n\n\t// Because MI_## are not necessarily in sequential order (some composite\n\t// devices will have only MI_00 & MI_03 for instance), we retrieve the actual\n\t// interface number from the path's MI value\n\tinterface_number = 0;\n\tfor (i=0; device_id[i] != 0; ) {\n\t\tif ( (device_id[i++] == 'M') && (device_id[i++] == 'I')\n\t\t  && (device_id[i++] == '_') ) {\n\t\t\tinterface_number = (device_id[i++] - '0')*10;\n\t\t\tinterface_number += device_id[i] - '0';\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (device_id[i] == 0) {\n\t\tusbi_warn(ctx, \"failure to read interface number for %s. Using default value %d\",\n\t\t\tdevice_id, interface_number);\n\t}\n\n\tif (priv->usb_interface[interface_number].path != NULL) {\n\t\tif (api == USB_API_HID) {\n\t\t\t// HID devices can have multiple collections (COL##) for each MI_## interface\n\t\t\tusbi_dbg(\"interface[%d] already set - ignoring HID collection: %s\",\n\t\t\t\tinterface_number, device_id);\n\t\t\treturn LIBUSB_ERROR_ACCESS;\n\t\t}\n\t\t// In other cases, just use the latest data\n\t\tsafe_free(priv->usb_interface[interface_number].path);\n\t}\n\n\tusbi_dbg(\"interface[%d] = %s\", interface_number, dev_interface_path);\n\tpriv->usb_interface[interface_number].path = dev_interface_path;\n\tpriv->usb_interface[interface_number].apib = &usb_api_backend[api];\n\tpriv->usb_interface[interface_number].sub_api = sub_api;\n\tif ((api == USB_API_HID) && (priv->hid == NULL)) {\n\t\tpriv->hid = (struct hid_device_priv*) calloc(1, sizeof(struct hid_device_priv));\n\t\tif (priv->hid == NULL)\n\t\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int set_hid_interface(struct libusb_context* ctx, struct libusb_device* dev,\n\t\t\t\t\t\t\tchar* dev_interface_path)\n{\n\tint i;\n\tstruct windows_device_priv *priv = _device_priv(dev);\n\n\tif (priv->hid == NULL) {\n\t\tusbi_err(ctx, \"program assertion failed: parent is not HID\");\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t}\n\tif (priv->hid->nb_interfaces == USB_MAXINTERFACES) {\n\t\tusbi_err(ctx, \"program assertion failed: max USB interfaces reached for HID device\");\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t}\n\tfor (i=0; i<priv->hid->nb_interfaces; i++) {\n\t\tif (safe_strcmp(priv->usb_interface[i].path, dev_interface_path) == 0) {\n\t\t\tusbi_dbg(\"interface[%d] already set to %s\", i, dev_interface_path);\n\t\t\treturn LIBUSB_SUCCESS;\n\t\t}\n\t}\n\n\tpriv->usb_interface[priv->hid->nb_interfaces].path = dev_interface_path;\n\tpriv->usb_interface[priv->hid->nb_interfaces].apib = &usb_api_backend[USB_API_HID];\n\tusbi_dbg(\"interface[%d] = %s\", priv->hid->nb_interfaces, dev_interface_path);\n\tpriv->hid->nb_interfaces++;\n\treturn LIBUSB_SUCCESS;\n}\n\n/*\n * get_device_list: libusb backend device enumeration function\n */\nstatic int windows_get_device_list(struct libusb_context *ctx, struct discovered_devs **_discdevs)\n{\n\tstruct discovered_devs *discdevs;\n\tHDEVINFO dev_info = { 0 };\n\tconst char* usb_class[] = {\"USB\", \"NUSB3\", \"IUSB3\"};\n\tSP_DEVINFO_DATA dev_info_data = { 0 };\n\tSP_DEVICE_INTERFACE_DETAIL_DATA_A *dev_interface_details = NULL;\n\tGUID hid_guid;\n#define MAX_ENUM_GUIDS 64\n\tconst GUID* guid[MAX_ENUM_GUIDS];\n#define HCD_PASS 0\n#define HUB_PASS 1\n#define GEN_PASS 2\n#define DEV_PASS 3\n#define HID_PASS 4\n\tint r = LIBUSB_SUCCESS;\n\tint api, sub_api;\n\tsize_t class_index = 0;\n\tunsigned int nb_guids, pass, i, j, ancestor;\n\tchar path[MAX_PATH_LENGTH];\n\tchar strbuf[MAX_PATH_LENGTH];\n\tstruct libusb_device *dev, *parent_dev;\n\tstruct windows_device_priv *priv, *parent_priv;\n\tchar* dev_interface_path = NULL;\n\tchar* dev_id_path = NULL;\n\tunsigned long session_id;\n\tDWORD size, reg_type, port_nr, install_state;\n\tHKEY key;\n\tWCHAR guid_string_w[MAX_GUID_STRING_LENGTH];\n\tGUID* if_guid;\n\tLONG s;\n\t// Keep a list of newly allocated devs to unref\n\tlibusb_device** unref_list;\n\tunsigned int unref_size = 64;\n\tunsigned int unref_cur = 0;\n\n\t// PASS 1 : (re)enumerate HCDs (allows for HCD hotplug)\n\t// PASS 2 : (re)enumerate HUBS\n\t// PASS 3 : (re)enumerate generic USB devices (including driverless)\n\t//           and list additional USB device interface GUIDs to explore\n\t// PASS 4 : (re)enumerate master USB devices that have a device interface\n\t// PASS 5+: (re)enumerate device interfaced GUIDs (including HID) and\n\t//           set the device interfaces.\n\n\t// Init the GUID table\n\tguid[HCD_PASS] = &GUID_DEVINTERFACE_USB_HOST_CONTROLLER;\n\tguid[HUB_PASS] = &GUID_DEVINTERFACE_USB_HUB;\n\tguid[GEN_PASS] = NULL;\n\tguid[DEV_PASS] = &GUID_DEVINTERFACE_USB_DEVICE;\n\tHidD_GetHidGuid(&hid_guid);\n\tguid[HID_PASS] = &hid_guid;\n\tnb_guids = HID_PASS+1;\n\n\tunref_list = (libusb_device**) calloc(unref_size, sizeof(libusb_device*));\n\tif (unref_list == NULL) {\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\tfor (pass = 0; ((pass < nb_guids) && (r == LIBUSB_SUCCESS)); pass++) {\n//#define ENUM_DEBUG\n#ifdef ENUM_DEBUG\n\t\tconst char *passname[] = { \"HCD\", \"HUB\", \"GEN\", \"DEV\", \"HID\", \"EXT\" };\n\t\tusbi_dbg(\"\\n#### PROCESSING %ss %s\", passname[(pass<=HID_PASS)?pass:HID_PASS+1],\n\t\t\t(pass!=GEN_PASS)?guid_to_string(guid[pass]):\"\");\n#endif\n\t\tfor (i = 0; ; i++) {\n\t\t\t// safe loop: free up any (unprotected) dynamic resource\n\t\t\t// NB: this is always executed before breaking the loop\n\t\t\tsafe_free(dev_interface_details);\n\t\t\tsafe_free(dev_interface_path);\n\t\t\tsafe_free(dev_id_path);\n\t\t\tpriv = parent_priv = NULL;\n\t\t\tdev = parent_dev = NULL;\n\n\t\t\t// Safe loop: end of loop conditions\n\t\t\tif (r != LIBUSB_SUCCESS) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ((pass == HCD_PASS) && (i == UINT8_MAX)) {\n\t\t\t\tusbi_warn(ctx, \"program assertion failed - found more than %d buses, skipping the rest.\", UINT8_MAX);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (pass != GEN_PASS) {\n\t\t\t\t// Except for GEN, all passes deal with device interfaces\n\t\t\t\tdev_interface_details = get_interface_details(ctx, &dev_info, &dev_info_data, guid[pass], i);\n\t\t\t\tif (dev_interface_details == NULL) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tdev_interface_path = sanitize_path(dev_interface_details->DevicePath);\n\t\t\t\t\tif (dev_interface_path == NULL) {\n\t\t\t\t\t\tusbi_warn(ctx, \"could not sanitize device interface path for '%s'\", dev_interface_details->DevicePath);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Workaround for a Nec/Renesas USB 3.0 driver bug where root hubs are\n\t\t\t\t// being listed under the \"NUSB3\" PnP Symbolic Name rather than \"USB\".\n\t\t\t\t// The Intel USB 3.0 driver behaves similar, but uses \"IUSB3\"\n\t\t\t\tfor (; class_index < ARRAYSIZE(usb_class); class_index++) {\n\t\t\t\t\tif (get_devinfo_data(ctx, &dev_info, &dev_info_data, usb_class[class_index], i))\n\t\t\t\t\t\tbreak;\n\t\t\t\t\ti = 0;\n\t\t\t\t}\n\t\t\t\tif (class_index >= ARRAYSIZE(usb_class))\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Read the Device ID path. This is what we'll use as UID\n\t\t\t// Note that if the device is plugged in a different port or hub, the Device ID changes\n\t\t\tif (CM_Get_Device_IDA(dev_info_data.DevInst, path, sizeof(path), 0) != CR_SUCCESS) {\n\t\t\t\tusbi_warn(ctx, \"could not read the device id path for devinst %X, skipping\",\n\t\t\t\t\tdev_info_data.DevInst);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdev_id_path = sanitize_path(path);\n\t\t\tif (dev_id_path == NULL) {\n\t\t\t\tusbi_warn(ctx, \"could not sanitize device id path for devinst %X, skipping\",\n\t\t\t\t\tdev_info_data.DevInst);\n\t\t\t\tcontinue;\n\t\t\t}\n#ifdef ENUM_DEBUG\n\t\t\tusbi_dbg(\"PRO: %s\", dev_id_path);\n#endif\n\n\t\t\t// The SPDRP_ADDRESS for USB devices is the device port number on the hub\n\t\t\tport_nr = 0;\n\t\t\tif ((pass >= HUB_PASS) && (pass <= GEN_PASS)) {\n\t\t\t\tif ( (!pSetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_ADDRESS,\n\t\t\t\t\t&reg_type, (BYTE*)&port_nr, 4, &size))\n\t\t\t\t  || (size != 4) ) {\n\t\t\t\t\tusbi_warn(ctx, \"could not retrieve port number for device '%s', skipping: %s\",\n\t\t\t\t\t\tdev_id_path, windows_error_str(0));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set API to use or get additional data from generic pass\n\t\t\tapi = USB_API_UNSUPPORTED;\n\t\t\tsub_api = SUB_API_NOTSET;\n\t\t\tswitch (pass) {\n\t\t\tcase HCD_PASS:\n\t\t\t\tbreak;\n\t\t\tcase GEN_PASS:\n\t\t\t\t// We use the GEN pass to detect driverless devices...\n\t\t\t\tsize = sizeof(strbuf);\n\t\t\t\tif (!pSetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_DRIVER,\n\t\t\t\t\t&reg_type, (BYTE*)strbuf, size, &size)) {\n\t\t\t\t\t\tusbi_info(ctx, \"The following device has no driver: '%s'\", dev_id_path);\n\t\t\t\t\t\tusbi_info(ctx, \"libusb will not be able to access it.\");\n\t\t\t\t}\n\t\t\t\t// ...and to add the additional device interface GUIDs\n\t\t\t\tkey = pSetupDiOpenDevRegKey(dev_info, &dev_info_data, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_READ);\n\t\t\t\tif (key != INVALID_HANDLE_VALUE) {\n\t\t\t\t\tsize = sizeof(guid_string_w);\n\t\t\t\t\ts = pRegQueryValueExW(key, L\"DeviceInterfaceGUIDs\", NULL, &reg_type,\n\t\t\t\t\t\t(BYTE*)guid_string_w, &size);\n\t\t\t\t\tpRegCloseKey(key);\n\t\t\t\t\tif (s == ERROR_SUCCESS) {\n\t\t\t\t\t\tif (nb_guids >= MAX_ENUM_GUIDS) {\n\t\t\t\t\t\t\t// If this assert is ever reported, grow a GUID table dynamically\n\t\t\t\t\t\t\tusbi_err(ctx, \"program assertion failed: too many GUIDs\");\n\t\t\t\t\t\t\tLOOP_BREAK(LIBUSB_ERROR_OVERFLOW);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif_guid = (GUID*) calloc(1, sizeof(GUID));\n\t\t\t\t\t\tpCLSIDFromString(guid_string_w, if_guid);\n\t\t\t\t\t\tguid[nb_guids++] = if_guid;\n\t\t\t\t\t\tusbi_dbg(\"extra GUID: %s\", guid_to_string(if_guid));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase HID_PASS:\n\t\t\t\tapi = USB_API_HID;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// Get the API type (after checking that the driver installation is OK)\n\t\t\t\tif ( (!pSetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_INSTALL_STATE,\n\t\t\t\t\t&reg_type, (BYTE*)&install_state, 4, &size))\n\t\t\t\t  || (size != 4) ){\n\t\t\t\t\tusbi_warn(ctx, \"could not detect installation state of driver for '%s': %s\",\n\t\t\t\t\t\tdev_id_path, windows_error_str(0));\n\t\t\t\t} else if (install_state != 0) {\n\t\t\t\t\tusbi_warn(ctx, \"driver for device '%s' is reporting an issue (code: %d) - skipping\",\n\t\t\t\t\t\tdev_id_path, install_state);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tget_api_type(ctx, &dev_info, &dev_info_data, &api, &sub_api);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Find parent device (for the passes that need it)\n\t\t\tswitch (pass) {\n\t\t\tcase HCD_PASS:\n\t\t\tcase DEV_PASS:\n\t\t\tcase HUB_PASS:\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// Go through the ancestors until we see a face we recognize\n\t\t\t\tparent_dev = NULL;\n\t\t\t\tfor (ancestor = 1; parent_dev == NULL; ancestor++) {\n\t\t\t\t\tsession_id = get_ancestor_session_id(dev_info_data.DevInst, ancestor);\n\t\t\t\t\tif (session_id == 0) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tparent_dev = usbi_get_device_by_session_id(ctx, session_id);\n\t\t\t\t}\n\t\t\t\tif (parent_dev == NULL) {\n\t\t\t\t\tusbi_dbg(\"unlisted ancestor for '%s' (non USB HID, newly connected, etc.) - ignoring\", dev_id_path);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tparent_priv = _device_priv(parent_dev);\n\t\t\t\t// virtual USB devices are also listed during GEN - don't process these yet\n\t\t\t\tif ( (pass == GEN_PASS) && (parent_priv->apib->id != USB_API_HUB) ) {\n\t\t\t\t        libusb_unref_device(parent_dev);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Create new or match existing device, using the (hashed) device_id as session id\n\t\t\tif (pass <= DEV_PASS) {\t// For subsequent passes, we'll lookup the parent\n\t\t\t\t// These are the passes that create \"new\" devices\n\t\t\t\tsession_id = htab_hash(dev_id_path);\n\t\t\t\tdev = usbi_get_device_by_session_id(ctx, session_id);\n\t\t\t\tif (dev == NULL) {\n\t\t\t\t\tif (pass == DEV_PASS) {\n\t\t\t\t\t\t// This can occur if the OS only reports a newly plugged device after we started enum\n\t\t\t\t\t\tusbi_warn(ctx, \"'%s' was only detected in late pass (newly connected device?)\"\n\t\t\t\t\t\t\t\" - ignoring\", dev_id_path);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tusbi_dbg(\"allocating new device for session [%X]\", session_id);\n\t\t\t\t\tif ((dev = usbi_alloc_device(ctx, session_id)) == NULL) {\n\t\t\t\t\t\tLOOP_BREAK(LIBUSB_ERROR_NO_MEM);\n\t\t\t\t\t}\n\t\t\t\t\twindows_device_priv_init(dev);\n\t\t\t\t} else {\n\t\t\t\t\tusbi_dbg(\"found existing device for session [%X] (%d.%d)\",\n\t\t\t\t\t\tsession_id, dev->bus_number, dev->device_address);\n\t\t\t\t}\n                                // Keep track of devices that need unref\n                                unref_list[unref_cur++] = dev;\n                                if (unref_cur >= unref_size) {\n                                        unref_size += 64;\n                                        unref_list = usbi_reallocf(unref_list, unref_size*sizeof(libusb_device*));\n                                        if (unref_list == NULL) {\n                                                usbi_err(ctx, \"could not realloc list for unref - aborting.\");\n                                                LOOP_BREAK(LIBUSB_ERROR_NO_MEM);\n                                        }\n                                }\n\t\t\t\tpriv = _device_priv(dev);\n\t\t\t}\n\n\t\t\t// Setup device\n\t\t\tswitch (pass) {\n\t\t\tcase HCD_PASS:\n\t\t\t\tdev->bus_number = (uint8_t)(i + 1);\t// bus 0 is reserved for disconnected\n\t\t\t\tdev->device_address = 0;\n\t\t\t\tdev->num_configurations = 0;\n\t\t\t\tpriv->apib = &usb_api_backend[USB_API_HUB];\n\t\t\t\tpriv->sub_api = SUB_API_NOTSET;\n\t\t\t\tpriv->depth = UINT8_MAX;\t// Overflow to 0 for HCD Hubs\n\t\t\t\tpriv->path = dev_interface_path; dev_interface_path = NULL;\n\t\t\t\tbreak;\n\t\t\tcase HUB_PASS:\n\t\t\tcase DEV_PASS:\n\t\t\t\t// If the device has already been setup, don't do it again\n\t\t\t\tif (priv->path != NULL)\n\t\t\t\t\tbreak;\n\t\t\t\t// Take care of API initialization\n\t\t\t\tpriv->path = dev_interface_path; dev_interface_path = NULL;\n\t\t\t\tpriv->apib = &usb_api_backend[api];\n\t\t\t\tpriv->sub_api = sub_api;\n\t\t\t\tswitch(api) {\n\t\t\t\tcase USB_API_COMPOSITE:\n\t\t\t\tcase USB_API_HUB:\n\t\t\t\t\tbreak;\n\t\t\t\tcase USB_API_HID:\n\t\t\t\t\tpriv->hid = calloc(1, sizeof(struct hid_device_priv));\n\t\t\t\t\tif (priv->hid == NULL) {\n\t\t\t\t\t\tLOOP_BREAK(LIBUSB_ERROR_NO_MEM);\n\t\t\t\t\t}\n\t\t\t\t\tpriv->hid->nb_interfaces = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// For other devices, the first interface is the same as the device\n\t\t\t\t\tpriv->usb_interface[0].path = (char*) calloc(safe_strlen(priv->path)+1, 1);\n\t\t\t\t\tif (priv->usb_interface[0].path != NULL) {\n\t\t\t\t\t\tsafe_strcpy(priv->usb_interface[0].path, safe_strlen(priv->path)+1, priv->path);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tusbi_warn(ctx, \"could not duplicate interface path '%s'\", priv->path);\n\t\t\t\t\t}\n\t\t\t\t\t// The following is needed if we want API calls to work for both simple\n\t\t\t\t\t// and composite devices.\n\t\t\t\t\tfor(j=0; j<USB_MAXINTERFACES; j++) {\n\t\t\t\t\t\tpriv->usb_interface[j].apib = &usb_api_backend[api];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GEN_PASS:\n\t\t\t\tr = init_device(dev, parent_dev, (uint8_t)port_nr, dev_id_path, dev_info_data.DevInst);\n\t\t\t\tif (r == LIBUSB_SUCCESS) {\n\t\t\t\t\t// Append device to the list of discovered devices\n\t\t\t\t\tdiscdevs = discovered_devs_append(*_discdevs, dev);\n\t\t\t\t\tif (!discdevs) {\n\t\t\t\t\t\tLOOP_BREAK(LIBUSB_ERROR_NO_MEM);\n\t\t\t\t\t}\n\t\t\t\t\t*_discdevs = discdevs;\n\t\t\t\t} else if (r == LIBUSB_ERROR_NO_DEVICE) {\n\t\t\t\t\t// This can occur if the device was disconnected but Windows hasn't\n\t\t\t\t\t// refreshed its enumeration yet - in that case, we ignore the device\n\t\t\t\t\tr = LIBUSB_SUCCESS;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\t// HID_PASS and later\n\t\t\t\tif (parent_priv->apib->id == USB_API_HID) {\n\t\t\t\t\tusbi_dbg(\"setting HID interface for [%lX]:\", parent_dev->session_data);\n\t\t\t\t\tr = set_hid_interface(ctx, parent_dev, dev_interface_path);\n\t\t\t\t\tif (r != LIBUSB_SUCCESS) LOOP_BREAK(r);\n\t\t\t\t\tdev_interface_path = NULL;\n\t\t\t\t} else if (parent_priv->apib->id == USB_API_COMPOSITE) {\n\t\t\t\t\tusbi_dbg(\"setting composite interface for [%lX]:\", parent_dev->session_data);\n\t\t\t\t\tswitch (set_composite_interface(ctx, parent_dev, dev_interface_path, dev_id_path, api, sub_api)) {\n\t\t\t\t\tcase LIBUSB_SUCCESS:\n\t\t\t\t\t\tdev_interface_path = NULL;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase LIBUSB_ERROR_ACCESS:\n\t\t\t\t\t\t// interface has already been set => make sure dev_interface_path is freed then\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tLOOP_BREAK(r);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t        libusb_unref_device(parent_dev);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Free any additional GUIDs\n\tfor (pass = HID_PASS+1; pass < nb_guids; pass++) {\n\t\tsafe_free(guid[pass]);\n\t}\n\n\t// Unref newly allocated devs\n\tfor (i=0; i<unref_cur; i++) {\n\t\tsafe_unref_device(unref_list[i]);\n\t}\n\tsafe_free(unref_list);\n\n\treturn r;\n}\n\n/*\n * exit: libusb backend deinitialization function\n */\nstatic void windows_exit(void)\n{\n\tint i;\n\tHANDLE semaphore;\n\tchar sem_name[11+1+8]; // strlen(libusb_init)+'\\0'+(32-bit hex PID)\n\n\tsprintf(sem_name, \"libusb_init%08X\", (unsigned int)GetCurrentProcessId()&0xFFFFFFFF);\n\tsemaphore = CreateSemaphoreA(NULL, 1, 1, sem_name);\n\tif (semaphore == NULL) {\n\t\treturn;\n\t}\n\n\t// A successful wait brings our semaphore count to 0 (unsignaled)\n\t// => any concurent wait stalls until the semaphore release\n\tif (WaitForSingleObject(semaphore, INFINITE) != WAIT_OBJECT_0) {\n\t\tCloseHandle(semaphore);\n\t\treturn;\n\t}\n\n\t// Only works if exits and inits are balanced exactly\n\tif (--concurrent_usage < 0) {\t// Last exit\n\t\tfor (i=0; i<USB_API_MAX; i++) {\n\t\t\tusb_api_backend[i].exit(SUB_API_NOTSET);\n\t\t}\n\t\texit_polling();\n\n\t\tif (timer_thread) {\n\t\t\tSetEvent(timer_request[1]); // actually the signal to quit the thread.\n\t\t\tif (WAIT_OBJECT_0 != WaitForSingleObject(timer_thread, INFINITE)) {\n\t\t\t\tusbi_dbg(\"could not wait for timer thread to quit\");\n\t\t\t\tTerminateThread(timer_thread, 1);\n\t\t\t}\n\t\t\tCloseHandle(timer_thread);\n\t\t\ttimer_thread = NULL;\n\t\t}\n\t\tfor (i = 0; i < 2; i++) {\n\t\t\tif (timer_request[i]) {\n\t\t\t\tCloseHandle(timer_request[i]);\n\t\t\t\ttimer_request[i] = NULL;\n\t\t\t}\n\t\t}\n\t\tif (timer_response) {\n\t\t\tCloseHandle(timer_response);\n\t\t\ttimer_response = NULL;\n\t\t}\n\t\tif (timer_mutex) {\n\t\t\tCloseHandle(timer_mutex);\n\t\t\ttimer_mutex = NULL;\n\t\t}\n\t\thtab_destroy();\n\t}\n\n\tReleaseSemaphore(semaphore, 1, NULL);\t// increase count back to 1\n\tCloseHandle(semaphore);\n}\n\nstatic int windows_get_device_descriptor(struct libusb_device *dev, unsigned char *buffer, int *host_endian)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev);\n\n\tmemcpy(buffer, &(priv->dev_descriptor), DEVICE_DESC_LENGTH);\n\t*host_endian = 0;\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int windows_get_config_descriptor(struct libusb_device *dev, uint8_t config_index, unsigned char *buffer, size_t len, int *host_endian)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev);\n\tPUSB_CONFIGURATION_DESCRIPTOR config_header;\n\tsize_t size;\n\n\t// config index is zero based\n\tif (config_index >= dev->num_configurations)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\tif ((priv->config_descriptor == NULL) || (priv->config_descriptor[config_index] == NULL))\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\tconfig_header = (PUSB_CONFIGURATION_DESCRIPTOR)priv->config_descriptor[config_index];\n\n\tsize = min(config_header->wTotalLength, len);\n\tmemcpy(buffer, priv->config_descriptor[config_index], size);\n\t*host_endian = 0;\n\n\treturn (int)size;\n}\n\n/*\n * return the cached copy of the active config descriptor\n */\nstatic int windows_get_active_config_descriptor(struct libusb_device *dev, unsigned char *buffer, size_t len, int *host_endian)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev);\n\n\tif (priv->active_config == 0)\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\n\t// config index is zero based\n\treturn windows_get_config_descriptor(dev, (uint8_t)(priv->active_config-1), buffer, len, host_endian);\n}\n\nstatic int windows_open(struct libusb_device_handle *dev_handle)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tstruct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);\n\n\tif (priv->apib == NULL) {\n\t\tusbi_err(ctx, \"program assertion failed - device is not initialized\");\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t}\n\n\treturn priv->apib->open(SUB_API_NOTSET, dev_handle);\n}\n\nstatic void windows_close(struct libusb_device_handle *dev_handle)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\n\tpriv->apib->close(SUB_API_NOTSET, dev_handle);\n}\n\nstatic int windows_get_configuration(struct libusb_device_handle *dev_handle, int *config)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\n\tif (priv->active_config == 0) {\n\t\t*config = 0;\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\t*config = priv->active_config;\n\treturn LIBUSB_SUCCESS;\n}\n\n/*\n * from http://msdn.microsoft.com/en-us/library/ms793522.aspx: \"The port driver\n * does not currently expose a service that allows higher-level drivers to set\n * the configuration.\"\n */\nstatic int windows_set_configuration(struct libusb_device_handle *dev_handle, int config)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tint r = LIBUSB_SUCCESS;\n\n\tif (config >= USB_MAXCONFIG)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\tr = libusb_control_transfer(dev_handle, LIBUSB_ENDPOINT_OUT |\n\t\tLIBUSB_REQUEST_TYPE_STANDARD | LIBUSB_RECIPIENT_DEVICE,\n\t\tLIBUSB_REQUEST_SET_CONFIGURATION, (uint16_t)config,\n\t\t0, NULL, 0, 1000);\n\n\tif (r == LIBUSB_SUCCESS) {\n\t\tpriv->active_config = (uint8_t)config;\n\t}\n\treturn r;\n}\n\nstatic int windows_claim_interface(struct libusb_device_handle *dev_handle, int iface)\n{\n\tint r = LIBUSB_SUCCESS;\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\n\tif (iface >= USB_MAXINTERFACES)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\tsafe_free(priv->usb_interface[iface].endpoint);\n\tpriv->usb_interface[iface].nb_endpoints= 0;\n\n\tr = priv->apib->claim_interface(SUB_API_NOTSET, dev_handle, iface);\n\n\tif (r == LIBUSB_SUCCESS) {\n\t\tr = windows_assign_endpoints(dev_handle, iface, 0);\n\t}\n\n\treturn r;\n}\n\nstatic int windows_set_interface_altsetting(struct libusb_device_handle *dev_handle, int iface, int altsetting)\n{\n\tint r = LIBUSB_SUCCESS;\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\n\tsafe_free(priv->usb_interface[iface].endpoint);\n\tpriv->usb_interface[iface].nb_endpoints= 0;\n\n\tr = priv->apib->set_interface_altsetting(SUB_API_NOTSET, dev_handle, iface, altsetting);\n\n\tif (r == LIBUSB_SUCCESS) {\n\t\tr = windows_assign_endpoints(dev_handle, iface, altsetting);\n\t}\n\n\treturn r;\n}\n\nstatic int windows_release_interface(struct libusb_device_handle *dev_handle, int iface)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\n\treturn priv->apib->release_interface(SUB_API_NOTSET, dev_handle, iface);\n}\n\nstatic int windows_clear_halt(struct libusb_device_handle *dev_handle, unsigned char endpoint)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\treturn priv->apib->clear_halt(SUB_API_NOTSET, dev_handle, endpoint);\n}\n\nstatic int windows_reset_device(struct libusb_device_handle *dev_handle)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\treturn priv->apib->reset_device(SUB_API_NOTSET, dev_handle);\n}\n\n// The 3 functions below are unlikely to ever get supported on Windows\nstatic int windows_kernel_driver_active(struct libusb_device_handle *dev_handle, int iface)\n{\n\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n}\n\nstatic int windows_attach_kernel_driver(struct libusb_device_handle *dev_handle, int iface)\n{\n\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n}\n\nstatic int windows_detach_kernel_driver(struct libusb_device_handle *dev_handle, int iface)\n{\n\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n}\n\nstatic void windows_destroy_device(struct libusb_device *dev)\n{\n\twindows_device_priv_release(dev);\n}\n\nstatic void windows_clear_transfer_priv(struct usbi_transfer *itransfer)\n{\n\tstruct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);\n\n\tusbi_free_fd(&transfer_priv->pollable_fd);\n\tsafe_free(transfer_priv->hid_buffer);\n\t// When auto claim is in use, attempt to release the auto-claimed interface\n\tauto_release(itransfer);\n}\n\nstatic int submit_bulk_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);\n\tstruct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tint r;\n\n\tr = priv->apib->submit_bulk_transfer(SUB_API_NOTSET, itransfer);\n\tif (r != LIBUSB_SUCCESS) {\n\t\treturn r;\n\t}\n\n\tusbi_add_pollfd(ctx, transfer_priv->pollable_fd.fd,\n\t\t(short)(IS_XFERIN(transfer) ? POLLIN : POLLOUT));\n\n\titransfer->flags |= USBI_TRANSFER_UPDATED_FDS;\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int submit_iso_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);\n\tstruct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tint r;\n\n\tr = priv->apib->submit_iso_transfer(SUB_API_NOTSET, itransfer);\n\tif (r != LIBUSB_SUCCESS) {\n\t\treturn r;\n\t}\n\n\tusbi_add_pollfd(ctx, transfer_priv->pollable_fd.fd,\n\t\t(short)(IS_XFERIN(transfer) ? POLLIN : POLLOUT));\n\n\titransfer->flags |= USBI_TRANSFER_UPDATED_FDS;\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int submit_control_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);\n\tstruct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tint r;\n\n\tr = priv->apib->submit_control_transfer(SUB_API_NOTSET, itransfer);\n\tif (r != LIBUSB_SUCCESS) {\n\t\treturn r;\n\t}\n\n\tusbi_add_pollfd(ctx, transfer_priv->pollable_fd.fd, POLLIN);\n\n\titransfer->flags |= USBI_TRANSFER_UPDATED_FDS;\n\treturn LIBUSB_SUCCESS;\n\n}\n\nstatic int windows_submit_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n\tswitch (transfer->type) {\n\tcase LIBUSB_TRANSFER_TYPE_CONTROL:\n\t\treturn submit_control_transfer(itransfer);\n\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\t\tif (IS_XFEROUT(transfer) &&\n\t\t    transfer->flags & LIBUSB_TRANSFER_ADD_ZERO_PACKET)\n\t\t\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n\t\treturn submit_bulk_transfer(itransfer);\n\tcase LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n\t\treturn submit_iso_transfer(itransfer);\n\tdefault:\n\t\tusbi_err(TRANSFER_CTX(transfer), \"unknown endpoint type %d\", transfer->type);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n}\n\nstatic int windows_abort_control(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\n\treturn priv->apib->abort_control(SUB_API_NOTSET, itransfer);\n}\n\nstatic int windows_abort_transfers(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\n\treturn priv->apib->abort_transfers(SUB_API_NOTSET, itransfer);\n}\n\nstatic int windows_cancel_transfer(struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n\tswitch (transfer->type) {\n\tcase LIBUSB_TRANSFER_TYPE_CONTROL:\n\t\treturn windows_abort_control(itransfer);\n\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\tcase LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n\t\treturn windows_abort_transfers(itransfer);\n\tdefault:\n\t\tusbi_err(ITRANSFER_CTX(itransfer), \"unknown endpoint type %d\", transfer->type);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n}\n\nstatic void windows_transfer_callback(struct usbi_transfer *itransfer, uint32_t io_result, uint32_t io_size)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tint status, istatus;\n\n\tusbi_dbg(\"handling I/O completion with errcode %d, size %d\", io_result, io_size);\n\n\tswitch(io_result) {\n\tcase NO_ERROR:\n\t\tstatus = priv->apib->copy_transfer_data(SUB_API_NOTSET, itransfer, io_size);\n\t\tbreak;\n\tcase ERROR_GEN_FAILURE:\n\t\tusbi_dbg(\"detected endpoint stall\");\n\t\tstatus = LIBUSB_TRANSFER_STALL;\n\t\tbreak;\n\tcase ERROR_SEM_TIMEOUT:\n\t\tusbi_dbg(\"detected semaphore timeout\");\n\t\tstatus = LIBUSB_TRANSFER_TIMED_OUT;\n\t\tbreak;\n\tcase ERROR_OPERATION_ABORTED:\n\t\tistatus = priv->apib->copy_transfer_data(SUB_API_NOTSET, itransfer, io_size);\n\t\tif (istatus != LIBUSB_TRANSFER_COMPLETED) {\n\t\t\tusbi_dbg(\"Failed to copy partial data in aborted operation: %d\", istatus);\n\t\t}\n\t\tif (itransfer->flags & USBI_TRANSFER_TIMED_OUT) {\n\t\t\tusbi_dbg(\"detected timeout\");\n\t\t\tstatus = LIBUSB_TRANSFER_TIMED_OUT;\n\t\t} else {\n\t\t\tusbi_dbg(\"detected operation aborted\");\n\t\t\tstatus = LIBUSB_TRANSFER_CANCELLED;\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tusbi_err(ITRANSFER_CTX(itransfer), \"detected I/O error %d: %s\", io_result, windows_error_str(io_result));\n\t\tstatus = LIBUSB_TRANSFER_ERROR;\n\t\tbreak;\n\t}\n\twindows_clear_transfer_priv(itransfer);\t// Cancel polling\n\tusbi_handle_transfer_completion(itransfer, (enum libusb_transfer_status)status);\n}\n\nstatic void windows_handle_callback (struct usbi_transfer *itransfer, uint32_t io_result, uint32_t io_size)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\n\tswitch (transfer->type) {\n\tcase LIBUSB_TRANSFER_TYPE_CONTROL:\n\tcase LIBUSB_TRANSFER_TYPE_BULK:\n\tcase LIBUSB_TRANSFER_TYPE_INTERRUPT:\n\tcase LIBUSB_TRANSFER_TYPE_ISOCHRONOUS:\n\t\twindows_transfer_callback (itransfer, io_result, io_size);\n\t\tbreak;\n\tdefault:\n\t\tusbi_err(ITRANSFER_CTX(itransfer), \"unknown endpoint type %d\", transfer->type);\n\t}\n}\n\nstatic int windows_handle_events(struct libusb_context *ctx, struct pollfd *fds, POLL_NFDS_TYPE nfds, int num_ready)\n{\n\tstruct windows_transfer_priv* transfer_priv = NULL;\n\tPOLL_NFDS_TYPE i = 0;\n\tbool found = false;\n\tstruct usbi_transfer *transfer;\n\tDWORD io_size, io_result;\n\n\tusbi_mutex_lock(&ctx->open_devs_lock);\n\tfor (i = 0; i < nfds && num_ready > 0; i++) {\n\n\t\tusbi_dbg(\"checking fd %d with revents = %04x\", fds[i].fd, fds[i].revents);\n\n\t\tif (!fds[i].revents) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tnum_ready--;\n\n\t\t// Because a Windows OVERLAPPED is used for poll emulation,\n\t\t// a pollable fd is created and stored with each transfer\n\t\tusbi_mutex_lock(&ctx->flying_transfers_lock);\n\t\tlist_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) {\n\t\t\ttransfer_priv = usbi_transfer_get_os_priv(transfer);\n\t\t\tif (transfer_priv->pollable_fd.fd == fds[i].fd) {\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tusbi_mutex_unlock(&ctx->flying_transfers_lock);\n\n\t\tif (found) {\n\t\t\t// Handle async requests that completed synchronously first\n\t\t\tif (HasOverlappedIoCompletedSync(transfer_priv->pollable_fd.overlapped)) {\n\t\t\t\tio_result = NO_ERROR;\n\t\t\t\tio_size = (DWORD)transfer_priv->pollable_fd.overlapped->InternalHigh;\n\t\t\t// Regular async overlapped\n\t\t\t} else if (GetOverlappedResult(transfer_priv->pollable_fd.handle,\n\t\t\t\ttransfer_priv->pollable_fd.overlapped, &io_size, false)) {\n\t\t\t\tio_result = NO_ERROR;\n\t\t\t} else {\n\t\t\t\tio_result = GetLastError();\n\t\t\t}\n\t\t\tusbi_remove_pollfd(ctx, transfer_priv->pollable_fd.fd);\n\t\t\t// let handle_callback free the event using the transfer wfd\n\t\t\t// If you don't use the transfer wfd, you run a risk of trying to free a\n\t\t\t// newly allocated wfd that took the place of the one from the transfer.\n\t\t\twindows_handle_callback(transfer, io_result, io_size);\n\t\t} else {\n\t\t\tusbi_err(ctx, \"could not find a matching transfer for fd %x\", fds[i]);\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\t}\n\t}\n\n\tusbi_mutex_unlock(&ctx->open_devs_lock);\n\treturn LIBUSB_SUCCESS;\n}\n\n/*\n * Monotonic and real time functions\n */\nunsigned __stdcall windows_clock_gettime_threaded(void* param)\n{\n\tLARGE_INTEGER hires_counter, li_frequency;\n\tLONG nb_responses;\n\tint timer_index;\n\n\t// Init - find out if we have access to a monotonic (hires) timer\n\tif (!QueryPerformanceFrequency(&li_frequency)) {\n\t\tusbi_dbg(\"no hires timer available on this platform\");\n\t\thires_frequency = 0;\n\t\thires_ticks_to_ps = UINT64_C(0);\n\t} else {\n\t\thires_frequency = li_frequency.QuadPart;\n\t\t// The hires frequency can go as high as 4 GHz, so we'll use a conversion\n\t\t// to picoseconds to compute the tv_nsecs part in clock_gettime\n\t\thires_ticks_to_ps = UINT64_C(1000000000000) / hires_frequency;\n\t\tusbi_dbg(\"hires timer available (Frequency: %\"PRIu64\" Hz)\", hires_frequency);\n\t}\n\n\t// Signal windows_init() that we're ready to service requests\n\tif (ReleaseSemaphore(timer_response, 1, NULL) == 0) {\n\t\tusbi_dbg(\"unable to release timer semaphore: %s\", windows_error_str(0));\n\t}\n\n\t// Main loop - wait for requests\n\twhile (1) {\n\t\ttimer_index = WaitForMultipleObjects(2, timer_request, FALSE, INFINITE) - WAIT_OBJECT_0;\n\t\tif ( (timer_index != 0) && (timer_index != 1) ) {\n\t\t\tusbi_dbg(\"failure to wait on requests: %s\", windows_error_str(0));\n\t\t\tcontinue;\n\t\t}\n\t\tif (request_count[timer_index] == 0) {\n\t\t\t// Request already handled\n\t\t\tResetEvent(timer_request[timer_index]);\n\t\t\t// There's still a possiblity that a thread sends a request between the\n\t\t\t// time we test request_count[] == 0 and we reset the event, in which case\n\t\t\t// the request would be ignored. The simple solution to that is to test\n\t\t\t// request_count again and process requests if non zero.\n\t\t\tif (request_count[timer_index] == 0)\n\t\t\t\tcontinue;\n\t\t}\n\t\tswitch (timer_index) {\n\t\tcase 0:\n\t\t\tWaitForSingleObject(timer_mutex, INFINITE);\n\t\t\t// Requests to this thread are for hires always\n\t\t\tif (QueryPerformanceCounter(&hires_counter) != 0) {\n\t\t\t\ttimer_tp.tv_sec = (long)(hires_counter.QuadPart / hires_frequency);\n\t\t\t\ttimer_tp.tv_nsec = (long)(((hires_counter.QuadPart % hires_frequency)/1000) * hires_ticks_to_ps);\n\t\t\t} else {\n\t\t\t\t// Fallback to real-time if we can't get monotonic value\n\t\t\t\t// Note that real-time clock does not wait on the mutex or this thread.\n\t\t\t\twindows_clock_gettime(USBI_CLOCK_REALTIME, &timer_tp);\n\t\t\t}\n\t\t\tReleaseMutex(timer_mutex);\n\n\t\t\tnb_responses = InterlockedExchange((LONG*)&request_count[0], 0);\n\t\t\tif ( (nb_responses)\n\t\t\t  && (ReleaseSemaphore(timer_response, nb_responses, NULL) == 0) ) {\n\t\t\t\tusbi_dbg(\"unable to release timer semaphore: %s\", windows_error_str(0));\n\t\t\t}\n\t\t\tcontinue;\n\t\tcase 1: // time to quit\n\t\t\tusbi_dbg(\"timer thread quitting\");\n\t\t\treturn 0;\n\t\t}\n\t}\n}\n\nstatic int windows_clock_gettime(int clk_id, struct timespec *tp)\n{\n\tFILETIME filetime;\n\tULARGE_INTEGER rtime;\n\tDWORD r;\n\tswitch(clk_id) {\n\tcase USBI_CLOCK_MONOTONIC:\n\t\tif (hires_frequency != 0) {\n\t\t\twhile (1) {\n\t\t\t\tInterlockedIncrement((LONG*)&request_count[0]);\n\t\t\t\tSetEvent(timer_request[0]);\n\t\t\t\tr = WaitForSingleObject(timer_response, TIMER_REQUEST_RETRY_MS);\n\t\t\t\tswitch(r) {\n\t\t\t\tcase WAIT_OBJECT_0:\n\t\t\t\t\tWaitForSingleObject(timer_mutex, INFINITE);\n\t\t\t\t\t*tp = timer_tp;\n\t\t\t\t\tReleaseMutex(timer_mutex);\n\t\t\t\t\treturn LIBUSB_SUCCESS;\n\t\t\t\tcase WAIT_TIMEOUT:\n\t\t\t\t\tusbi_dbg(\"could not obtain a timer value within reasonable timeframe - too much load?\");\n\t\t\t\t\tbreak; // Retry until successful\n\t\t\t\tdefault:\n\t\t\t\t\tusbi_dbg(\"WaitForSingleObject failed: %s\", windows_error_str(0));\n\t\t\t\t\treturn LIBUSB_ERROR_OTHER;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Fall through and return real-time if monotonic was not detected @ timer init\n\tcase USBI_CLOCK_REALTIME:\n\t\t// We follow http://msdn.microsoft.com/en-us/library/ms724928%28VS.85%29.aspx\n\t\t// with a predef epoch_time to have an epoch that starts at 1970.01.01 00:00\n\t\t// Note however that our resolution is bounded by the Windows system time\n\t\t// functions and is at best of the order of 1 ms (or, usually, worse)\n\t\tGetSystemTimeAsFileTime(&filetime);\n\t\trtime.LowPart = filetime.dwLowDateTime;\n\t\trtime.HighPart = filetime.dwHighDateTime;\n\t\trtime.QuadPart -= epoch_time;\n\t\ttp->tv_sec = (long)(rtime.QuadPart / 10000000);\n\t\ttp->tv_nsec = (long)((rtime.QuadPart % 10000000)*100);\n\t\treturn LIBUSB_SUCCESS;\n\tdefault:\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n}\n\n\n// NB: MSVC6 does not support named initializers.\nconst struct usbi_os_backend windows_backend = {\n\t\"Windows\",\n\tUSBI_CAP_HAS_HID_ACCESS,\n\twindows_init,\n\twindows_exit,\n\n\twindows_get_device_list,\n\tNULL,\t\t\t\t/* hotplug_poll */\n\twindows_open,\n\twindows_close,\n\n\twindows_get_device_descriptor,\n\twindows_get_active_config_descriptor,\n\twindows_get_config_descriptor,\n\tNULL,\t\t\t\t/* get_config_descriptor_by_value() */\n\n\twindows_get_configuration,\n\twindows_set_configuration,\n\twindows_claim_interface,\n\twindows_release_interface,\n\n\twindows_set_interface_altsetting,\n\twindows_clear_halt,\n\twindows_reset_device,\n\n\twindows_kernel_driver_active,\n\twindows_detach_kernel_driver,\n\twindows_attach_kernel_driver,\n\n\twindows_destroy_device,\n\n\twindows_submit_transfer,\n\twindows_cancel_transfer,\n\twindows_clear_transfer_priv,\n\n\twindows_handle_events,\n\n\twindows_clock_gettime,\n#if defined(USBI_TIMERFD_AVAILABLE)\n\tNULL,\n#endif\n\tsizeof(struct windows_device_priv),\n\tsizeof(struct windows_device_handle_priv),\n\tsizeof(struct windows_transfer_priv),\n\t0,\n};\n\n\n/*\n * USB API backends\n */\nstatic int unsupported_init(int sub_api, struct libusb_context *ctx) {\n\treturn LIBUSB_SUCCESS;\n}\nstatic int unsupported_exit(int sub_api) {\n\treturn LIBUSB_SUCCESS;\n}\nstatic int unsupported_open(int sub_api, struct libusb_device_handle *dev_handle) {\n\tPRINT_UNSUPPORTED_API(open);\n}\nstatic void unsupported_close(int sub_api, struct libusb_device_handle *dev_handle) {\n\tusbi_dbg(\"unsupported API call for 'close'\");\n}\nstatic int unsupported_configure_endpoints(int sub_api, struct libusb_device_handle *dev_handle, int iface) {\n\tPRINT_UNSUPPORTED_API(configure_endpoints);\n}\nstatic int unsupported_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface) {\n\tPRINT_UNSUPPORTED_API(claim_interface);\n}\nstatic int unsupported_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting) {\n\tPRINT_UNSUPPORTED_API(set_interface_altsetting);\n}\nstatic int unsupported_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface) {\n\tPRINT_UNSUPPORTED_API(release_interface);\n}\nstatic int unsupported_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint) {\n\tPRINT_UNSUPPORTED_API(clear_halt);\n}\nstatic int unsupported_reset_device(int sub_api, struct libusb_device_handle *dev_handle) {\n\tPRINT_UNSUPPORTED_API(reset_device);\n}\nstatic int unsupported_submit_bulk_transfer(int sub_api, struct usbi_transfer *itransfer) {\n\tPRINT_UNSUPPORTED_API(submit_bulk_transfer);\n}\nstatic int unsupported_submit_iso_transfer(int sub_api, struct usbi_transfer *itransfer) {\n\tPRINT_UNSUPPORTED_API(submit_iso_transfer);\n}\nstatic int unsupported_submit_control_transfer(int sub_api, struct usbi_transfer *itransfer) {\n\tPRINT_UNSUPPORTED_API(submit_control_transfer);\n}\nstatic int unsupported_abort_control(int sub_api, struct usbi_transfer *itransfer) {\n\tPRINT_UNSUPPORTED_API(abort_control);\n}\nstatic int unsupported_abort_transfers(int sub_api, struct usbi_transfer *itransfer) {\n\tPRINT_UNSUPPORTED_API(abort_transfers);\n}\nstatic int unsupported_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size) {\n\tPRINT_UNSUPPORTED_API(copy_transfer_data);\n}\nstatic int common_configure_endpoints(int sub_api, struct libusb_device_handle *dev_handle, int iface) {\n\treturn LIBUSB_SUCCESS;\n}\n// These names must be uppercase\nconst char* hub_driver_names[] = {\"USBHUB\", \"USBHUB3\", \"USB3HUB\", \"NUSB3HUB\", \"RUSB3HUB\", \"FLXHCIH\", \"TIHUB3\", \"ETRONHUB3\", \"VIAHUB3\", \"ASMTHUB3\", \"IUSB3HUB\", \"VUSB3HUB\", \"AMDHUB30\"};\nconst char* composite_driver_names[] = {\"USBCCGP\"};\nconst char* winusbx_driver_names[] = WINUSBX_DRV_NAMES;\nconst char* hid_driver_names[] = {\"HIDUSB\", \"MOUHID\", \"KBDHID\"};\nconst struct windows_usb_api_backend usb_api_backend[USB_API_MAX] = {\n\t{\n\t\tUSB_API_UNSUPPORTED,\n\t\t\"Unsupported API\",\n\t\tNULL,\n\t\t0,\n\t\tunsupported_init,\n\t\tunsupported_exit,\n\t\tunsupported_open,\n\t\tunsupported_close,\n\t\tunsupported_configure_endpoints,\n\t\tunsupported_claim_interface,\n\t\tunsupported_set_interface_altsetting,\n\t\tunsupported_release_interface,\n\t\tunsupported_clear_halt,\n\t\tunsupported_reset_device,\n\t\tunsupported_submit_bulk_transfer,\n\t\tunsupported_submit_iso_transfer,\n\t\tunsupported_submit_control_transfer,\n\t\tunsupported_abort_control,\n\t\tunsupported_abort_transfers,\n\t\tunsupported_copy_transfer_data,\n\t}, {\n\t\tUSB_API_HUB,\n\t\t\"HUB API\",\n\t\thub_driver_names,\n\t\tARRAYSIZE(hub_driver_names),\n\t\tunsupported_init,\n\t\tunsupported_exit,\n\t\tunsupported_open,\n\t\tunsupported_close,\n\t\tunsupported_configure_endpoints,\n\t\tunsupported_claim_interface,\n\t\tunsupported_set_interface_altsetting,\n\t\tunsupported_release_interface,\n\t\tunsupported_clear_halt,\n\t\tunsupported_reset_device,\n\t\tunsupported_submit_bulk_transfer,\n\t\tunsupported_submit_iso_transfer,\n\t\tunsupported_submit_control_transfer,\n\t\tunsupported_abort_control,\n\t\tunsupported_abort_transfers,\n\t\tunsupported_copy_transfer_data,\n\t}, {\n\t\tUSB_API_COMPOSITE,\n\t\t\"Composite API\",\n\t\tcomposite_driver_names,\n\t\tARRAYSIZE(composite_driver_names),\n\t\tcomposite_init,\n\t\tcomposite_exit,\n\t\tcomposite_open,\n\t\tcomposite_close,\n\t\tcommon_configure_endpoints,\n\t\tcomposite_claim_interface,\n\t\tcomposite_set_interface_altsetting,\n\t\tcomposite_release_interface,\n\t\tcomposite_clear_halt,\n\t\tcomposite_reset_device,\n\t\tcomposite_submit_bulk_transfer,\n\t\tcomposite_submit_iso_transfer,\n\t\tcomposite_submit_control_transfer,\n\t\tcomposite_abort_control,\n\t\tcomposite_abort_transfers,\n\t\tcomposite_copy_transfer_data,\n\t}, {\n\t\tUSB_API_WINUSBX,\n\t\t\"WinUSB-like APIs\",\n\t\twinusbx_driver_names,\n\t\tARRAYSIZE(winusbx_driver_names),\n\t\twinusbx_init,\n\t\twinusbx_exit,\n\t\twinusbx_open,\n\t\twinusbx_close,\n\t\twinusbx_configure_endpoints,\n\t\twinusbx_claim_interface,\n\t\twinusbx_set_interface_altsetting,\n\t\twinusbx_release_interface,\n\t\twinusbx_clear_halt,\n\t\twinusbx_reset_device,\n\t\twinusbx_submit_bulk_transfer,\n\t\tunsupported_submit_iso_transfer,\n\t\twinusbx_submit_control_transfer,\n\t\twinusbx_abort_control,\n\t\twinusbx_abort_transfers,\n\t\twinusbx_copy_transfer_data,\n\t}, {\n\t\tUSB_API_HID,\n\t\t\"HID API\",\n\t\thid_driver_names,\n\t\tARRAYSIZE(hid_driver_names),\n\t\thid_init,\n\t\thid_exit,\n\t\thid_open,\n\t\thid_close,\n\t\tcommon_configure_endpoints,\n\t\thid_claim_interface,\n\t\thid_set_interface_altsetting,\n\t\thid_release_interface,\n\t\thid_clear_halt,\n\t\thid_reset_device,\n\t\thid_submit_bulk_transfer,\n\t\tunsupported_submit_iso_transfer,\n\t\thid_submit_control_transfer,\n\t\thid_abort_transfers,\n\t\thid_abort_transfers,\n\t\thid_copy_transfer_data,\n\t},\n};\n\n\n/*\n * WinUSB-like (WinUSB, libusb0/libusbK through libusbk DLL) API functions\n */\n#define WinUSBX_Set(fn) do { if (native_winusb) WinUSBX[i].fn = (WinUsb_##fn##_t) GetProcAddress(h, \"WinUsb_\" #fn); \\\n\telse pLibK_GetProcAddress((PVOID*)&WinUSBX[i].fn, i, KUSB_FNID_##fn); } while (0)\n\nstatic int winusbx_init(int sub_api, struct libusb_context *ctx)\n{\n\tHMODULE h = NULL;\n\tbool native_winusb = false;\n\tint i;\n\tKLIB_VERSION LibK_Version;\n\tLibK_GetProcAddress_t pLibK_GetProcAddress = NULL;\n\tLibK_GetVersion_t pLibK_GetVersion = NULL;\n\n\th = GetModuleHandleA(\"libusbK\");\n\tif (h == NULL) {\n\t\th = LoadLibraryA(\"libusbK\");\n\t}\n\tif (h == NULL) {\n\t\tusbi_info(ctx, \"libusbK DLL is not available, will use native WinUSB\");\n\t\th = GetModuleHandleA(\"WinUSB\");\n\t\tif (h == NULL) {\n\t\t\th = LoadLibraryA(\"WinUSB\");\n\t\t}\t\tif (h == NULL) {\n\t\t\tusbi_warn(ctx, \"WinUSB DLL is not available either,\\n\"\n\t\t\t\t\"you will not be able to access devices outside of enumeration\");\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\t}\n\t} else {\n\t\tusbi_dbg(\"using libusbK DLL for universal access\");\n\t\tpLibK_GetVersion = (LibK_GetVersion_t) GetProcAddress(h, \"LibK_GetVersion\");\n\t\tif (pLibK_GetVersion != NULL) {\n\t\t\tpLibK_GetVersion(&LibK_Version);\n\t\t\tusbi_dbg(\"libusbK version: %d.%d.%d.%d\", LibK_Version.Major, LibK_Version.Minor,\n\t\t\t\tLibK_Version.Micro, LibK_Version.Nano);\n\t\t}\n\t\tpLibK_GetProcAddress = (LibK_GetProcAddress_t) GetProcAddress(h, \"LibK_GetProcAddress\");\n\t\tif (pLibK_GetProcAddress == NULL) {\n\t\t\tusbi_err(ctx, \"LibK_GetProcAddress() not found in libusbK DLL\");\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\t}\n\t}\n\tnative_winusb = (pLibK_GetProcAddress == NULL);\n\tfor (i=SUB_API_LIBUSBK; i<SUB_API_MAX; i++) {\n\t\tWinUSBX_Set(AbortPipe);\n\t\tWinUSBX_Set(ControlTransfer);\n\t\tWinUSBX_Set(FlushPipe);\n\t\tWinUSBX_Set(Free);\n\t\tWinUSBX_Set(GetAssociatedInterface);\n\t\tWinUSBX_Set(GetCurrentAlternateSetting);\n\t\tWinUSBX_Set(GetDescriptor);\n\t\tWinUSBX_Set(GetOverlappedResult);\n\t\tWinUSBX_Set(GetPipePolicy);\n\t\tWinUSBX_Set(GetPowerPolicy);\n\t\tWinUSBX_Set(Initialize);\n\t\tWinUSBX_Set(QueryDeviceInformation);\n\t\tWinUSBX_Set(QueryInterfaceSettings);\n\t\tWinUSBX_Set(QueryPipe);\n\t\tWinUSBX_Set(ReadPipe);\n\t\tWinUSBX_Set(ResetPipe);\n\t\tWinUSBX_Set(SetCurrentAlternateSetting);\n\t\tWinUSBX_Set(SetPipePolicy);\n\t\tWinUSBX_Set(SetPowerPolicy);\n\t\tWinUSBX_Set(WritePipe);\n\t\tif (!native_winusb) {\n\t\t\tWinUSBX_Set(ResetDevice);\n\t\t}\n\t\tif (WinUSBX[i].Initialize != NULL) {\n\t\t\tWinUSBX[i].initialized = true;\n\t\t\tusbi_dbg(\"initalized sub API %s\", sub_api_name[i]);\n\t\t} else {\n\t\t\tusbi_warn(ctx, \"Failed to initalize sub API %s\", sub_api_name[i]);\n\t\t\tWinUSBX[i].initialized = false;\n\t\t}\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int winusbx_exit(int sub_api)\n{\n\treturn LIBUSB_SUCCESS;\n}\n\n// NB: open and close must ensure that they only handle interface of\n// the right API type, as these functions can be called wholesale from\n// composite_open(), with interfaces belonging to different APIs\nstatic int winusbx_open(int sub_api, struct libusb_device_handle *dev_handle)\n{\n\tstruct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\n\tHANDLE file_handle;\n\tint i;\n\n\tCHECK_WINUSBX_AVAILABLE(sub_api);\n\n\t// WinUSB requires a seperate handle for each interface\n\tfor (i = 0; i < USB_MAXINTERFACES; i++) {\n\t\tif ( (priv->usb_interface[i].path != NULL)\n\t\t  && (priv->usb_interface[i].apib->id == USB_API_WINUSBX) ) {\n\t\t\tfile_handle = CreateFileA(priv->usb_interface[i].path, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ,\n\t\t\t\tNULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL);\n\t\t\tif (file_handle == INVALID_HANDLE_VALUE) {\n\t\t\t\tusbi_err(ctx, \"could not open device %s (interface %d): %s\", priv->usb_interface[i].path, i, windows_error_str(0));\n\t\t\t\tswitch(GetLastError()) {\n\t\t\t\tcase ERROR_FILE_NOT_FOUND:\t// The device was disconnected\n\t\t\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t\t\t\tcase ERROR_ACCESS_DENIED:\n\t\t\t\t\treturn LIBUSB_ERROR_ACCESS;\n\t\t\t\tdefault:\n\t\t\t\t\treturn LIBUSB_ERROR_IO;\n\t\t\t\t}\n\t\t\t}\n\t\t\thandle_priv->interface_handle[i].dev_handle = file_handle;\n\t\t}\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic void winusbx_close(int sub_api, struct libusb_device_handle *dev_handle)\n{\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tHANDLE file_handle;\n\tint i;\n\n\tif (sub_api == SUB_API_NOTSET)\n\t\tsub_api = priv->sub_api;\n\tif (!WinUSBX[sub_api].initialized)\n\t\treturn;\n\n\tfor (i = 0; i < USB_MAXINTERFACES; i++) {\n\t\tif (priv->usb_interface[i].apib->id == USB_API_WINUSBX) {\n\t\t\tfile_handle = handle_priv->interface_handle[i].dev_handle;\n\t\t\tif ( (file_handle != 0) && (file_handle != INVALID_HANDLE_VALUE)) {\n\t\t\t\tCloseHandle(file_handle);\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic int winusbx_configure_endpoints(int sub_api, struct libusb_device_handle *dev_handle, int iface)\n{\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tHANDLE winusb_handle = handle_priv->interface_handle[iface].api_handle;\n\tUCHAR policy;\n\tULONG timeout = 0;\n\tuint8_t endpoint_address;\n\tint i;\n\n\tCHECK_WINUSBX_AVAILABLE(sub_api);\n\n\t// With handle and enpoints set (in parent), we can setup the default pipe properties\n\t// see http://download.microsoft.com/download/D/1/D/D1DD7745-426B-4CC3-A269-ABBBE427C0EF/DVC-T705_DDC08.pptx\n\tfor (i=-1; i<priv->usb_interface[iface].nb_endpoints; i++) {\n\t\tendpoint_address =(i==-1)?0:priv->usb_interface[iface].endpoint[i];\n\t\tif (!WinUSBX[sub_api].SetPipePolicy(winusb_handle, endpoint_address,\n\t\t\tPIPE_TRANSFER_TIMEOUT, sizeof(ULONG), &timeout)) {\n\t\t\tusbi_dbg(\"failed to set PIPE_TRANSFER_TIMEOUT for control endpoint %02X\", endpoint_address);\n\t\t}\n\t\tif ((i == -1) || (sub_api == SUB_API_LIBUSB0)) {\n\t\t\tcontinue;\t// Other policies don't apply to control endpoint or libusb0\n\t\t}\n\t\tpolicy = false;\n\t\tif (!WinUSBX[sub_api].SetPipePolicy(winusb_handle, endpoint_address,\n\t\t\tSHORT_PACKET_TERMINATE, sizeof(UCHAR), &policy)) {\n\t\t\tusbi_dbg(\"failed to disable SHORT_PACKET_TERMINATE for endpoint %02X\", endpoint_address);\n\t\t}\n\t\tif (!WinUSBX[sub_api].SetPipePolicy(winusb_handle, endpoint_address,\n\t\t\tIGNORE_SHORT_PACKETS, sizeof(UCHAR), &policy)) {\n\t\t\tusbi_dbg(\"failed to disable IGNORE_SHORT_PACKETS for endpoint %02X\", endpoint_address);\n\t\t}\n\t\tpolicy = true;\n\t\t/* ALLOW_PARTIAL_READS must be enabled due to likely libusbK bug. See:\n\t\t   https://sourceforge.net/mailarchive/message.php?msg_id=29736015 */\n\t\tif (!WinUSBX[sub_api].SetPipePolicy(winusb_handle, endpoint_address,\n\t\t\tALLOW_PARTIAL_READS, sizeof(UCHAR), &policy)) {\n\t\t\tusbi_dbg(\"failed to enable ALLOW_PARTIAL_READS for endpoint %02X\", endpoint_address);\n\t\t}\n\t\tif (!WinUSBX[sub_api].SetPipePolicy(winusb_handle, endpoint_address,\n\t\t\tAUTO_CLEAR_STALL, sizeof(UCHAR), &policy)) {\n\t\t\tusbi_dbg(\"failed to enable AUTO_CLEAR_STALL for endpoint %02X\", endpoint_address);\n\t\t}\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int winusbx_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)\n{\n\tstruct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tbool is_using_usbccgp = (priv->apib->id == USB_API_COMPOSITE);\n\tHANDLE file_handle, winusb_handle;\n\tDWORD err;\n\tint i;\n\tSP_DEVICE_INTERFACE_DETAIL_DATA_A *dev_interface_details = NULL;\n\tHDEVINFO dev_info = INVALID_HANDLE_VALUE;\n\tSP_DEVINFO_DATA dev_info_data;\n\tchar* dev_path_no_guid = NULL;\n\tchar filter_path[] = \"\\\\\\\\.\\\\libusb0-0000\";\n\tbool found_filter = false;\n\n\tCHECK_WINUSBX_AVAILABLE(sub_api);\n\n\t// If the device is composite, but using the default Windows composite parent driver (usbccgp)\n\t// or if it's the first WinUSB-like interface, we get a handle through Initialize().\n\tif ((is_using_usbccgp) || (iface == 0)) {\n\t\t// composite device (independent interfaces) or interface 0\n\t\tfile_handle = handle_priv->interface_handle[iface].dev_handle;\n\t\tif ((file_handle == 0) || (file_handle == INVALID_HANDLE_VALUE)) {\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\t}\n\n\t\tif (!WinUSBX[sub_api].Initialize(file_handle, &winusb_handle)) {\n\t\t\thandle_priv->interface_handle[iface].api_handle = INVALID_HANDLE_VALUE;\n\t\t\terr = GetLastError();\n\t\t\tswitch(err) {\n\t\t\tcase ERROR_BAD_COMMAND:\n\t\t\t\t// The device was disconnected\n\t\t\t\tusbi_err(ctx, \"could not access interface %d: %s\", iface, windows_error_str(0));\n\t\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t\t\tdefault:\n\t\t\t\t// it may be that we're using the libusb0 filter driver.\n\t\t\t\t// TODO: can we move this whole business into the K/0 DLL?\n\t\t\t\tfor (i = 0; ; i++) {\n\t\t\t\t\tsafe_free(dev_interface_details);\n\t\t\t\t\tsafe_free(dev_path_no_guid);\n\t\t\t\t\tdev_interface_details = get_interface_details_filter(ctx, &dev_info, &dev_info_data, &GUID_DEVINTERFACE_LIBUSB0_FILTER, i, filter_path);\n\t\t\t\t\tif ((found_filter) || (dev_interface_details == NULL)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// ignore GUID part\n\t\t\t\t\tdev_path_no_guid = sanitize_path(strtok(dev_interface_details->DevicePath, \"{\"));\n\t\t\t\t\tif (safe_strncmp(dev_path_no_guid, priv->usb_interface[iface].path, safe_strlen(dev_path_no_guid)) == 0) {\n\t\t\t\t\t\tfile_handle = CreateFileA(filter_path, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ,\n\t\t\t\t\t\t\tNULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL);\n\t\t\t\t\t\tif (file_handle == INVALID_HANDLE_VALUE) {\n\t\t\t\t\t\t\tusbi_err(ctx, \"could not open device %s: %s\", filter_path, windows_error_str(0));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tWinUSBX[sub_api].Free(winusb_handle);\n\t\t\t\t\t\t\tif (!WinUSBX[sub_api].Initialize(file_handle, &winusb_handle)) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfound_filter = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!found_filter) {\n\t\t\t\t\tusbi_err(ctx, \"could not access interface %d: %s\", iface, windows_error_str(err));\n\t\t\t\t\treturn LIBUSB_ERROR_ACCESS;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\thandle_priv->interface_handle[iface].api_handle = winusb_handle;\n\t} else {\n\t\t// For all other interfaces, use GetAssociatedInterface()\n\t\twinusb_handle = handle_priv->interface_handle[0].api_handle;\n\t\t// It is a requirement for multiple interface devices on Windows that, to you\n\t\t// must first claim the first interface before you claim the others\n\t\tif ((winusb_handle == 0) || (winusb_handle == INVALID_HANDLE_VALUE)) {\n\t\t\tfile_handle = handle_priv->interface_handle[0].dev_handle;\n\t\t\tif (WinUSBX[sub_api].Initialize(file_handle, &winusb_handle)) {\n\t\t\t\thandle_priv->interface_handle[0].api_handle = winusb_handle;\n\t\t\t\tusbi_warn(ctx, \"auto-claimed interface 0 (required to claim %d with WinUSB)\", iface);\n\t\t\t} else {\n\t\t\t\tusbi_warn(ctx, \"failed to auto-claim interface 0 (required to claim %d with WinUSB): %s\", iface, windows_error_str(0));\n\t\t\t\treturn LIBUSB_ERROR_ACCESS;\n\t\t\t}\n\t\t}\n\t\tif (!WinUSBX[sub_api].GetAssociatedInterface(winusb_handle, (UCHAR)(iface-1),\n\t\t\t&handle_priv->interface_handle[iface].api_handle)) {\n\t\t\thandle_priv->interface_handle[iface].api_handle = INVALID_HANDLE_VALUE;\n\t\t\tswitch(GetLastError()) {\n\t\t\tcase ERROR_NO_MORE_ITEMS:   // invalid iface\n\t\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\t\tcase ERROR_BAD_COMMAND:     // The device was disconnected\n\t\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t\t\tcase ERROR_ALREADY_EXISTS:  // already claimed\n\t\t\t\treturn LIBUSB_ERROR_BUSY;\n\t\t\tdefault:\n\t\t\t\tusbi_err(ctx, \"could not claim interface %d: %s\", iface, windows_error_str(0));\n\t\t\t\treturn LIBUSB_ERROR_ACCESS;\n\t\t\t}\n\t\t}\n\t}\n\tusbi_dbg(\"claimed interface %d\", iface);\n\thandle_priv->active_interface = iface;\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int winusbx_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)\n{\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tHANDLE winusb_handle;\n\n\tCHECK_WINUSBX_AVAILABLE(sub_api);\n\n\twinusb_handle = handle_priv->interface_handle[iface].api_handle;\n\tif ((winusb_handle == 0) || (winusb_handle == INVALID_HANDLE_VALUE)) {\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\tWinUSBX[sub_api].Free(winusb_handle);\n\thandle_priv->interface_handle[iface].api_handle = INVALID_HANDLE_VALUE;\n\n\treturn LIBUSB_SUCCESS;\n}\n\n/*\n * Return the first valid interface (of the same API type), for control transfers\n */\nstatic int get_valid_interface(struct libusb_device_handle *dev_handle, int api_id)\n{\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tint i;\n\n\tif ((api_id < USB_API_WINUSBX) || (api_id > USB_API_HID)) {\n\t\tusbi_dbg(\"unsupported API ID\");\n\t\treturn -1;\n\t}\n\n\tfor (i=0; i<USB_MAXINTERFACES; i++) {\n\t\tif ( (handle_priv->interface_handle[i].dev_handle != 0)\n\t\t  && (handle_priv->interface_handle[i].dev_handle != INVALID_HANDLE_VALUE)\n\t\t  && (handle_priv->interface_handle[i].api_handle != 0)\n\t\t  && (handle_priv->interface_handle[i].api_handle != INVALID_HANDLE_VALUE)\n\t\t  && (priv->usb_interface[i].apib->id == api_id) ) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/*\n * Lookup interface by endpoint address. -1 if not found\n */\nstatic int interface_by_endpoint(struct windows_device_priv *priv,\n\tstruct windows_device_handle_priv *handle_priv, uint8_t endpoint_address)\n{\n\tint i, j;\n\tfor (i=0; i<USB_MAXINTERFACES; i++) {\n\t\tif (handle_priv->interface_handle[i].api_handle == INVALID_HANDLE_VALUE)\n\t\t\tcontinue;\n\t\tif (handle_priv->interface_handle[i].api_handle == 0)\n\t\t\tcontinue;\n\t\tif (priv->usb_interface[i].endpoint == NULL)\n\t\t\tcontinue;\n\t\tfor (j=0; j<priv->usb_interface[i].nb_endpoints; j++) {\n\t\t\tif (priv->usb_interface[i].endpoint[j] == endpoint_address) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t}\n\treturn -1;\n}\n\nstatic int winusbx_submit_control_transfer(int sub_api, struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tstruct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(\n\t\ttransfer->dev_handle);\n\tWINUSB_SETUP_PACKET *setup = (WINUSB_SETUP_PACKET *) transfer->buffer;\n\tULONG size;\n\tHANDLE winusb_handle;\n\tint current_interface;\n\tstruct winfd wfd;\n\n\tCHECK_WINUSBX_AVAILABLE(sub_api);\n\n\ttransfer_priv->pollable_fd = INVALID_WINFD;\n\tsize = transfer->length - LIBUSB_CONTROL_SETUP_SIZE;\n\n\tif (size > MAX_CTRL_BUFFER_LENGTH)\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\tcurrent_interface = get_valid_interface(transfer->dev_handle, USB_API_WINUSBX);\n\tif (current_interface < 0) {\n\t\tif (auto_claim(transfer, &current_interface, USB_API_WINUSBX) != LIBUSB_SUCCESS) {\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\t}\n\t}\n\n\tusbi_dbg(\"will use interface %d\", current_interface);\n\twinusb_handle = handle_priv->interface_handle[current_interface].api_handle;\n\n\twfd = usbi_create_fd(winusb_handle, RW_READ, NULL, NULL);\n\t// Always use the handle returned from usbi_create_fd (wfd.handle)\n\tif (wfd.fd < 0) {\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\t// Sending of set configuration control requests from WinUSB creates issues\n\tif ( ((setup->request_type & (0x03 << 5)) == LIBUSB_REQUEST_TYPE_STANDARD)\n\t  && (setup->request == LIBUSB_REQUEST_SET_CONFIGURATION) ) {\n\t\tif (setup->value != priv->active_config) {\n\t\t\tusbi_warn(ctx, \"cannot set configuration other than the default one\");\n\t\t\tusbi_free_fd(&wfd);\n\t\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t\t}\n\t\twfd.overlapped->Internal = STATUS_COMPLETED_SYNCHRONOUSLY;\n\t\twfd.overlapped->InternalHigh = 0;\n\t} else {\n\t\tif (!WinUSBX[sub_api].ControlTransfer(wfd.handle, *setup, transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE, size, NULL, wfd.overlapped)) {\n\t\t\tif(GetLastError() != ERROR_IO_PENDING) {\n\t\t\t\tusbi_warn(ctx, \"ControlTransfer failed: %s\", windows_error_str(0));\n\t\t\t\tusbi_free_fd(&wfd);\n\t\t\t\treturn LIBUSB_ERROR_IO;\n\t\t\t}\n\t\t} else {\n\t\t\twfd.overlapped->Internal = STATUS_COMPLETED_SYNCHRONOUSLY;\n\t\t\twfd.overlapped->InternalHigh = (DWORD)size;\n\t\t}\n\t}\n\n\t// Use priv_transfer to store data needed for async polling\n\ttransfer_priv->pollable_fd = wfd;\n\ttransfer_priv->interface_number = (uint8_t)current_interface;\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int winusbx_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting)\n{\n\tstruct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tHANDLE winusb_handle;\n\n\tCHECK_WINUSBX_AVAILABLE(sub_api);\n\n\tif (altsetting > 255) {\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\n\twinusb_handle = handle_priv->interface_handle[iface].api_handle;\n\tif ((winusb_handle == 0) || (winusb_handle == INVALID_HANDLE_VALUE)) {\n\t\tusbi_err(ctx, \"interface must be claimed first\");\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\tif (!WinUSBX[sub_api].SetCurrentAlternateSetting(winusb_handle, (UCHAR)altsetting)) {\n\t\tusbi_err(ctx, \"SetCurrentAlternateSetting failed: %s\", windows_error_str(0));\n\t\treturn LIBUSB_ERROR_IO;\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int winusbx_submit_bulk_transfer(int sub_api, struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);\n\tstruct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tHANDLE winusb_handle;\n\tbool ret;\n\tint current_interface;\n\tstruct winfd wfd;\n\n\tCHECK_WINUSBX_AVAILABLE(sub_api);\n\n\ttransfer_priv->pollable_fd = INVALID_WINFD;\n\n\tcurrent_interface = interface_by_endpoint(priv, handle_priv, transfer->endpoint);\n\tif (current_interface < 0) {\n\t\tusbi_err(ctx, \"unable to match endpoint to an open interface - cancelling transfer\");\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\tusbi_dbg(\"matched endpoint %02X with interface %d\", transfer->endpoint, current_interface);\n\n\twinusb_handle = handle_priv->interface_handle[current_interface].api_handle;\n\n\twfd = usbi_create_fd(winusb_handle, IS_XFERIN(transfer) ? RW_READ : RW_WRITE, NULL, NULL);\n\t// Always use the handle returned from usbi_create_fd (wfd.handle)\n\tif (wfd.fd < 0) {\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\tif (IS_XFERIN(transfer)) {\n\t\tusbi_dbg(\"reading %d bytes\", transfer->length);\n\t\tret = WinUSBX[sub_api].ReadPipe(wfd.handle, transfer->endpoint, transfer->buffer, transfer->length, NULL, wfd.overlapped);\n\t} else {\n\t\tusbi_dbg(\"writing %d bytes\", transfer->length);\n\t\tret = WinUSBX[sub_api].WritePipe(wfd.handle, transfer->endpoint, transfer->buffer, transfer->length, NULL, wfd.overlapped);\n\t}\n\tif (!ret) {\n\t\tif(GetLastError() != ERROR_IO_PENDING) {\n\t\t\tusbi_err(ctx, \"ReadPipe/WritePipe failed: %s\", windows_error_str(0));\n\t\t\tusbi_free_fd(&wfd);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t}\n\t} else {\n\t\twfd.overlapped->Internal = STATUS_COMPLETED_SYNCHRONOUSLY;\n\t\twfd.overlapped->InternalHigh = (DWORD)transfer->length;\n\t}\n\n\ttransfer_priv->pollable_fd = wfd;\n\ttransfer_priv->interface_number = (uint8_t)current_interface;\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int winusbx_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint)\n{\n\tstruct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tHANDLE winusb_handle;\n\tint current_interface;\n\n\tCHECK_WINUSBX_AVAILABLE(sub_api);\n\n\tcurrent_interface = interface_by_endpoint(priv, handle_priv, endpoint);\n\tif (current_interface < 0) {\n\t\tusbi_err(ctx, \"unable to match endpoint to an open interface - cannot clear\");\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\tusbi_dbg(\"matched endpoint %02X with interface %d\", endpoint, current_interface);\n\twinusb_handle = handle_priv->interface_handle[current_interface].api_handle;\n\n\tif (!WinUSBX[sub_api].ResetPipe(winusb_handle, endpoint)) {\n\t\tusbi_err(ctx, \"ResetPipe failed: %s\", windows_error_str(0));\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\n/*\n * from http://www.winvistatips.com/winusb-bugchecks-t335323.html (confirmed\n * through testing as well):\n * \"You can not call WinUsb_AbortPipe on control pipe. You can possibly cancel\n * the control transfer using CancelIo\"\n */\nstatic int winusbx_abort_control(int sub_api, struct usbi_transfer *itransfer)\n{\n\t// Cancelling of the I/O is done in the parent\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int winusbx_abort_transfers(int sub_api, struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);\n\tstruct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tHANDLE winusb_handle;\n\tint current_interface;\n\n\tCHECK_WINUSBX_AVAILABLE(sub_api);\n\n\tcurrent_interface = transfer_priv->interface_number;\n\tif ((current_interface < 0) || (current_interface >= USB_MAXINTERFACES)) {\n\t\tusbi_err(ctx, \"program assertion failed: invalid interface_number\");\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\tusbi_dbg(\"will use interface %d\", current_interface);\n\n\twinusb_handle = handle_priv->interface_handle[current_interface].api_handle;\n\n\tif (!WinUSBX[sub_api].AbortPipe(winusb_handle, transfer->endpoint)) {\n\t\tusbi_err(ctx, \"AbortPipe failed: %s\", windows_error_str(0));\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\n/*\n * from the \"How to Use WinUSB to Communicate with a USB Device\" Microsoft white paper\n * (http://www.microsoft.com/whdc/connect/usb/winusb_howto.mspx):\n * \"WinUSB does not support host-initiated reset port and cycle port operations\" and\n * IOCTL_INTERNAL_USB_CYCLE_PORT is only available in kernel mode and the\n * IOCTL_USB_HUB_CYCLE_PORT ioctl was removed from Vista => the best we can do is\n * cycle the pipes (and even then, the control pipe can not be reset using WinUSB)\n */\n// TODO: (post hotplug): see if we can force eject the device and redetect it (reuse hotplug?)\nstatic int winusbx_reset_device(int sub_api, struct libusb_device_handle *dev_handle)\n{\n\tstruct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tstruct winfd wfd;\n\tHANDLE winusb_handle;\n\tint i, j;\n\n\tCHECK_WINUSBX_AVAILABLE(sub_api);\n\n\t// Reset any available pipe (except control)\n\tfor (i=0; i<USB_MAXINTERFACES; i++) {\n\t\twinusb_handle = handle_priv->interface_handle[i].api_handle;\n\t\tfor (wfd = handle_to_winfd(winusb_handle); wfd.fd > 0;)\n\t\t{\n\t\t\t// Cancel any pollable I/O\n\t\t\tusbi_remove_pollfd(ctx, wfd.fd);\n\t\t\tusbi_free_fd(&wfd);\n\t\t\twfd = handle_to_winfd(winusb_handle);\n\t\t}\n\n\t\tif ( (winusb_handle != 0) && (winusb_handle != INVALID_HANDLE_VALUE)) {\n\t\t\tfor (j=0; j<priv->usb_interface[i].nb_endpoints; j++) {\n\t\t\t\tusbi_dbg(\"resetting ep %02X\", priv->usb_interface[i].endpoint[j]);\n\t\t\t\tif (!WinUSBX[sub_api].AbortPipe(winusb_handle, priv->usb_interface[i].endpoint[j])) {\n\t\t\t\t\tusbi_err(ctx, \"AbortPipe (pipe address %02X) failed: %s\",\n\t\t\t\t\t\tpriv->usb_interface[i].endpoint[j], windows_error_str(0));\n\t\t\t\t}\n\t\t\t\t// FlushPipe seems to fail on OUT pipes\n\t\t\t\tif (IS_EPIN(priv->usb_interface[i].endpoint[j])\n\t\t\t\t  && (!WinUSBX[sub_api].FlushPipe(winusb_handle, priv->usb_interface[i].endpoint[j])) ) {\n\t\t\t\t\tusbi_err(ctx, \"FlushPipe (pipe address %02X) failed: %s\",\n\t\t\t\t\t\tpriv->usb_interface[i].endpoint[j], windows_error_str(0));\n\t\t\t\t}\n\t\t\t\tif (!WinUSBX[sub_api].ResetPipe(winusb_handle, priv->usb_interface[i].endpoint[j])) {\n\t\t\t\t\tusbi_err(ctx, \"ResetPipe (pipe address %02X) failed: %s\",\n\t\t\t\t\t\tpriv->usb_interface[i].endpoint[j], windows_error_str(0));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// libusbK & libusb0 have the ability to issue an actual device reset\n\tif (WinUSBX[sub_api].ResetDevice != NULL) {\n\t\twinusb_handle = handle_priv->interface_handle[0].api_handle;\n\t\tif ( (winusb_handle != 0) && (winusb_handle != INVALID_HANDLE_VALUE)) {\n\t\t\tWinUSBX[sub_api].ResetDevice(winusb_handle);\n\t\t}\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int winusbx_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size)\n{\n\titransfer->transferred += io_size;\n\treturn LIBUSB_TRANSFER_COMPLETED;\n}\n\n/*\n * Internal HID Support functions (from libusb-win32)\n * Note that functions that complete data transfer synchronously must return\n * LIBUSB_COMPLETED instead of LIBUSB_SUCCESS\n */\nstatic int _hid_get_hid_descriptor(struct hid_device_priv* dev, void *data, size_t *size);\nstatic int _hid_get_report_descriptor(struct hid_device_priv* dev, void *data, size_t *size);\n\nstatic int _hid_wcslen(WCHAR *str)\n{\n\tint i = 0;\n\twhile (str[i] && (str[i] != 0x409)) {\n\t\ti++;\n\t}\n\treturn i;\n}\n\nstatic int _hid_get_device_descriptor(struct hid_device_priv* dev, void *data, size_t *size)\n{\n\tstruct libusb_device_descriptor d;\n\n\td.bLength = LIBUSB_DT_DEVICE_SIZE;\n\td.bDescriptorType = LIBUSB_DT_DEVICE;\n\td.bcdUSB = 0x0200; /* 2.00 */\n\td.bDeviceClass = 0;\n\td.bDeviceSubClass = 0;\n\td.bDeviceProtocol = 0;\n\td.bMaxPacketSize0 = 64; /* fix this! */\n\td.idVendor = (uint16_t)dev->vid;\n\td.idProduct = (uint16_t)dev->pid;\n\td.bcdDevice = 0x0100;\n\td.iManufacturer = dev->string_index[0];\n\td.iProduct = dev->string_index[1];\n\td.iSerialNumber = dev->string_index[2];\n\td.bNumConfigurations = 1;\n\n\tif (*size > LIBUSB_DT_DEVICE_SIZE)\n\t\t*size = LIBUSB_DT_DEVICE_SIZE;\n\tmemcpy(data, &d, *size);\n\treturn LIBUSB_COMPLETED;\n}\n\nstatic int _hid_get_config_descriptor(struct hid_device_priv* dev, void *data, size_t *size)\n{\n\tchar num_endpoints = 0;\n\tsize_t config_total_len = 0;\n\tchar tmp[HID_MAX_CONFIG_DESC_SIZE];\n\tstruct libusb_config_descriptor *cd;\n\tstruct libusb_interface_descriptor *id;\n\tstruct libusb_hid_descriptor *hd;\n\tstruct libusb_endpoint_descriptor *ed;\n\tsize_t tmp_size;\n\n\tif (dev->input_report_size)\n\t\tnum_endpoints++;\n\tif (dev->output_report_size)\n\t\tnum_endpoints++;\n\n\tconfig_total_len = LIBUSB_DT_CONFIG_SIZE + LIBUSB_DT_INTERFACE_SIZE\n\t\t+ LIBUSB_DT_HID_SIZE + num_endpoints * LIBUSB_DT_ENDPOINT_SIZE;\n\n\n\tcd = (struct libusb_config_descriptor *)tmp;\n\tid = (struct libusb_interface_descriptor *)(tmp + LIBUSB_DT_CONFIG_SIZE);\n\thd = (struct libusb_hid_descriptor *)(tmp + LIBUSB_DT_CONFIG_SIZE\n\t\t+ LIBUSB_DT_INTERFACE_SIZE);\n\ted = (struct libusb_endpoint_descriptor *)(tmp + LIBUSB_DT_CONFIG_SIZE\n\t\t+ LIBUSB_DT_INTERFACE_SIZE\n\t\t+ LIBUSB_DT_HID_SIZE);\n\n\tcd->bLength = LIBUSB_DT_CONFIG_SIZE;\n\tcd->bDescriptorType = LIBUSB_DT_CONFIG;\n\tcd->wTotalLength = (uint16_t) config_total_len;\n\tcd->bNumInterfaces = 1;\n\tcd->bConfigurationValue = 1;\n\tcd->iConfiguration = 0;\n\tcd->bmAttributes = 1 << 7; /* bus powered */\n\tcd->MaxPower = 50;\n\n\tid->bLength = LIBUSB_DT_INTERFACE_SIZE;\n\tid->bDescriptorType = LIBUSB_DT_INTERFACE;\n\tid->bInterfaceNumber = 0;\n\tid->bAlternateSetting = 0;\n\tid->bNumEndpoints = num_endpoints;\n\tid->bInterfaceClass = 3;\n\tid->bInterfaceSubClass = 0;\n\tid->bInterfaceProtocol = 0;\n\tid->iInterface = 0;\n\n\ttmp_size = LIBUSB_DT_HID_SIZE;\n\t_hid_get_hid_descriptor(dev, hd, &tmp_size);\n\n\tif (dev->input_report_size) {\n\t\ted->bLength = LIBUSB_DT_ENDPOINT_SIZE;\n\t\ted->bDescriptorType = LIBUSB_DT_ENDPOINT;\n\t\ted->bEndpointAddress = HID_IN_EP;\n\t\ted->bmAttributes = 3;\n\t\ted->wMaxPacketSize = dev->input_report_size - 1;\n\t\ted->bInterval = 10;\n\t\ted = (struct libusb_endpoint_descriptor *)((char*)ed + LIBUSB_DT_ENDPOINT_SIZE);\n\t}\n\n\tif (dev->output_report_size) {\n\t\ted->bLength = LIBUSB_DT_ENDPOINT_SIZE;\n\t\ted->bDescriptorType = LIBUSB_DT_ENDPOINT;\n\t\ted->bEndpointAddress = HID_OUT_EP;\n\t\ted->bmAttributes = 3;\n\t\ted->wMaxPacketSize = dev->output_report_size - 1;\n\t\ted->bInterval = 10;\n\t}\n\n\tif (*size > config_total_len)\n\t\t*size = config_total_len;\n\tmemcpy(data, tmp, *size);\n\treturn LIBUSB_COMPLETED;\n}\n\nstatic int _hid_get_string_descriptor(struct hid_device_priv* dev, int _index,\n\t\t\t\t\t\t\t\t\t  void *data, size_t *size)\n{\n\tvoid *tmp = NULL;\n\tsize_t tmp_size = 0;\n\tint i;\n\n\t/* language ID, EN-US */\n\tchar string_langid[] = {\n\t\t0x09,\n\t\t0x04\n\t};\n\n\tif ((*size < 2) || (*size > 255)) {\n\t\treturn LIBUSB_ERROR_OVERFLOW;\n\t}\n\n\tif (_index == 0) {\n\t\ttmp = string_langid;\n\t\ttmp_size = sizeof(string_langid)+2;\n\t} else {\n\t\tfor (i=0; i<3; i++) {\n\t\t\tif (_index == (dev->string_index[i])) {\n\t\t\t\ttmp = dev->string[i];\n\t\t\t\ttmp_size = (_hid_wcslen(dev->string[i])+1) * sizeof(WCHAR);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (i == 3) {\t// not found\n\t\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t\t}\n\t}\n\n\tif(!tmp_size) {\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\n\tif (tmp_size < *size) {\n\t\t*size = tmp_size;\n\t}\n\t// 2 byte header\n\t((uint8_t*)data)[0] = (uint8_t)*size;\n\t((uint8_t*)data)[1] = LIBUSB_DT_STRING;\n\tmemcpy((uint8_t*)data+2, tmp, *size-2);\n\treturn LIBUSB_COMPLETED;\n}\n\nstatic int _hid_get_hid_descriptor(struct hid_device_priv* dev, void *data, size_t *size)\n{\n\tstruct libusb_hid_descriptor d;\n\tuint8_t tmp[MAX_HID_DESCRIPTOR_SIZE];\n\tsize_t report_len = MAX_HID_DESCRIPTOR_SIZE;\n\n\t_hid_get_report_descriptor(dev, tmp, &report_len);\n\n\td.bLength = LIBUSB_DT_HID_SIZE;\n\td.bDescriptorType = LIBUSB_DT_HID;\n\td.bcdHID = 0x0110; /* 1.10 */\n\td.bCountryCode = 0;\n\td.bNumDescriptors = 1;\n\td.bClassDescriptorType = LIBUSB_DT_REPORT;\n\td.wClassDescriptorLength = (uint16_t)report_len;\n\n\tif (*size > LIBUSB_DT_HID_SIZE)\n\t\t*size = LIBUSB_DT_HID_SIZE;\n\tmemcpy(data, &d, *size);\n\treturn LIBUSB_COMPLETED;\n}\n\nstatic int _hid_get_report_descriptor(struct hid_device_priv* dev, void *data, size_t *size)\n{\n\tuint8_t d[MAX_HID_DESCRIPTOR_SIZE];\n\tsize_t i = 0;\n\n\t/* usage page (0xFFA0 == vendor defined) */\n\td[i++] = 0x06; d[i++] = 0xA0; d[i++] = 0xFF;\n\t/* usage (vendor defined) */\n\td[i++] = 0x09; d[i++] = 0x01;\n\t/* start collection (application) */\n\td[i++] = 0xA1; d[i++] = 0x01;\n\t/* input report */\n\tif (dev->input_report_size) {\n\t\t/* usage (vendor defined) */\n\t\td[i++] = 0x09; d[i++] = 0x01;\n\t\t/* logical minimum (0) */\n\t\td[i++] = 0x15; d[i++] = 0x00;\n\t\t/* logical maximum (255) */\n\t\td[i++] = 0x25; d[i++] = 0xFF;\n\t\t/* report size (8 bits) */\n\t\td[i++] = 0x75; d[i++] = 0x08;\n\t\t/* report count */\n\t\td[i++] = 0x95; d[i++] = (uint8_t)dev->input_report_size - 1;\n\t\t/* input (data, variable, absolute) */\n\t\td[i++] = 0x81; d[i++] = 0x00;\n\t}\n\t/* output report */\n\tif (dev->output_report_size) {\n\t\t/* usage (vendor defined) */\n\t\td[i++] = 0x09; d[i++] = 0x02;\n\t\t/* logical minimum (0) */\n\t\td[i++] = 0x15; d[i++] = 0x00;\n\t\t/* logical maximum (255) */\n\t\td[i++] = 0x25; d[i++] = 0xFF;\n\t\t/* report size (8 bits) */\n\t\td[i++] = 0x75; d[i++] = 0x08;\n\t\t/* report count */\n\t\td[i++] = 0x95; d[i++] = (uint8_t)dev->output_report_size - 1;\n\t\t/* output (data, variable, absolute) */\n\t\td[i++] = 0x91; d[i++] = 0x00;\n\t}\n\t/* feature report */\n\tif (dev->feature_report_size) {\n\t\t/* usage (vendor defined) */\n\t\td[i++] = 0x09; d[i++] = 0x03;\n\t\t/* logical minimum (0) */\n\t\td[i++] = 0x15; d[i++] = 0x00;\n\t\t/* logical maximum (255) */\n\t\td[i++] = 0x25; d[i++] = 0xFF;\n\t\t/* report size (8 bits) */\n\t\td[i++] = 0x75; d[i++] = 0x08;\n\t\t/* report count */\n\t\td[i++] = 0x95; d[i++] = (uint8_t)dev->feature_report_size - 1;\n\t\t/* feature (data, variable, absolute) */\n\t\td[i++] = 0xb2; d[i++] = 0x02; d[i++] = 0x01;\n\t}\n\n\t/* end collection */\n\td[i++] = 0xC0;\n\n\tif (*size > i)\n\t\t*size = i;\n\tmemcpy(data, d, *size);\n\treturn LIBUSB_COMPLETED;\n}\n\nstatic int _hid_get_descriptor(struct hid_device_priv* dev, HANDLE hid_handle, int recipient,\n\t\t\t\t\t\t\t   int type, int _index, void *data, size_t *size)\n{\n\tswitch(type) {\n\tcase LIBUSB_DT_DEVICE:\n\t\tusbi_dbg(\"LIBUSB_DT_DEVICE\");\n\t\treturn _hid_get_device_descriptor(dev, data, size);\n\tcase LIBUSB_DT_CONFIG:\n\t\tusbi_dbg(\"LIBUSB_DT_CONFIG\");\n\t\tif (!_index)\n\t\t\treturn _hid_get_config_descriptor(dev, data, size);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\tcase LIBUSB_DT_STRING:\n\t\tusbi_dbg(\"LIBUSB_DT_STRING\");\n\t\treturn _hid_get_string_descriptor(dev, _index, data, size);\n\tcase LIBUSB_DT_HID:\n\t\tusbi_dbg(\"LIBUSB_DT_HID\");\n\t\tif (!_index)\n\t\t\treturn _hid_get_hid_descriptor(dev, data, size);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\tcase LIBUSB_DT_REPORT:\n\t\tusbi_dbg(\"LIBUSB_DT_REPORT\");\n\t\tif (!_index)\n\t\t\treturn _hid_get_report_descriptor(dev, data, size);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\tcase LIBUSB_DT_PHYSICAL:\n\t\tusbi_dbg(\"LIBUSB_DT_PHYSICAL\");\n\t\tif (HidD_GetPhysicalDescriptor(hid_handle, data, (ULONG)*size))\n\t\t\treturn LIBUSB_COMPLETED;\n\t\treturn LIBUSB_ERROR_OTHER;\n\t}\n\tusbi_dbg(\"unsupported\");\n\treturn LIBUSB_ERROR_INVALID_PARAM;\n}\n\nstatic int _hid_get_report(struct hid_device_priv* dev, HANDLE hid_handle, int id, void *data,\n\t\t\t\t\t\t   struct windows_transfer_priv *tp, size_t *size, OVERLAPPED* overlapped,\n\t\t\t\t\t\t   int report_type)\n{\n\tuint8_t *buf;\n\tDWORD ioctl_code, read_size, expected_size = (DWORD)*size;\n\tint r = LIBUSB_SUCCESS;\n\n\tif (tp->hid_buffer != NULL) {\n\t\tusbi_dbg(\"program assertion failed: hid_buffer is not NULL\");\n\t}\n\n\tif ((*size == 0) || (*size > MAX_HID_REPORT_SIZE)) {\n\t\tusbi_dbg(\"invalid size (%d)\", *size);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\n\tswitch (report_type) {\n\t\tcase HID_REPORT_TYPE_INPUT:\n\t\t\tioctl_code = IOCTL_HID_GET_INPUT_REPORT;\n\t\t\tbreak;\n\t\tcase HID_REPORT_TYPE_FEATURE:\n\t\t\tioctl_code = IOCTL_HID_GET_FEATURE;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tusbi_dbg(\"unknown HID report type %d\", report_type);\n\t\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\n\t// Add a trailing byte to detect overflows\n\tbuf = (uint8_t*)calloc(expected_size+1, 1);\n\tif (buf == NULL) {\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\tbuf[0] = (uint8_t)id;\t// Must be set always\n\tusbi_dbg(\"report ID: 0x%02X\", buf[0]);\n\n\ttp->hid_expected_size = expected_size;\n\tread_size = expected_size;\n\n\t// NB: The size returned by DeviceIoControl doesn't include report IDs when not in use (0)\n\tif (!DeviceIoControl(hid_handle, ioctl_code, buf, expected_size+1,\n\t\tbuf, expected_size+1, &read_size, overlapped)) {\n\t\tif (GetLastError() != ERROR_IO_PENDING) {\n\t\t\tusbi_dbg(\"Failed to Read HID Report: %s\", windows_error_str(0));\n\t\t\tsafe_free(buf);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t}\n\t\t// Asynchronous wait\n\t\ttp->hid_buffer = buf;\n\t\ttp->hid_dest = (uint8_t*)data; // copy dest, as not necessarily the start of the transfer buffer\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\t// Transfer completed synchronously => copy and discard extra buffer\n\tif (read_size == 0) {\n\t\tusbi_warn(NULL, \"program assertion failed - read completed synchronously, but no data was read\");\n\t\t*size = 0;\n\t} else {\n\t\tif (buf[0] != id) {\n\t\t\tusbi_warn(NULL, \"mismatched report ID (data is %02X, parameter is %02X)\", buf[0], id);\n\t\t}\n\t\tif ((size_t)read_size > expected_size) {\n\t\t\tr = LIBUSB_ERROR_OVERFLOW;\n\t\t\tusbi_dbg(\"OVERFLOW!\");\n\t\t} else {\n\t\t\tr = LIBUSB_COMPLETED;\n\t\t}\n\n\t\t*size = MIN((size_t)read_size, *size);\n\t\tif (id == 0) {\n\t\t\t// Discard report ID\n\t\t\tmemcpy(data, buf+1, *size);\n\t\t} else {\n\t\t\tmemcpy(data, buf, *size);\n\t\t}\n\t}\n\tsafe_free(buf);\n\treturn r;\n}\n\nstatic int _hid_set_report(struct hid_device_priv* dev, HANDLE hid_handle, int id, void *data,\n\t\t\t\t\t\t   struct windows_transfer_priv *tp, size_t *size, OVERLAPPED* overlapped,\n\t\t\t\t\t\t   int report_type)\n{\n\tuint8_t *buf = NULL;\n\tDWORD ioctl_code, write_size= (DWORD)*size;\n\n\tif (tp->hid_buffer != NULL) {\n\t\tusbi_dbg(\"program assertion failed: hid_buffer is not NULL\");\n\t}\n\n\tif ((*size == 0) || (*size > MAX_HID_REPORT_SIZE)) {\n\t\tusbi_dbg(\"invalid size (%d)\", *size);\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\n\tswitch (report_type) {\n\t\tcase HID_REPORT_TYPE_OUTPUT:\n\t\t\tioctl_code = IOCTL_HID_SET_OUTPUT_REPORT;\n\t\t\tbreak;\n\t\tcase HID_REPORT_TYPE_FEATURE:\n\t\t\tioctl_code = IOCTL_HID_SET_FEATURE;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tusbi_dbg(\"unknown HID report type %d\", report_type);\n\t\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\n\tusbi_dbg(\"report ID: 0x%02X\", id);\n\t// When report IDs are not used (i.e. when id == 0), we must add\n\t// a null report ID. Otherwise, we just use original data buffer\n\tif (id == 0) {\n\t\twrite_size++;\n\t}\n\tbuf = (uint8_t*) malloc(write_size);\n\tif (buf == NULL) {\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\tif (id == 0) {\n\t\tbuf[0] = 0;\n\t\tmemcpy(buf + 1, data, *size);\n\t} else {\n\t\t// This seems like a waste, but if we don't duplicate the\n\t\t// data, we'll get issues when freeing hid_buffer\n\t\tmemcpy(buf, data, *size);\n\t\tif (buf[0] != id) {\n\t\t\tusbi_warn(NULL, \"mismatched report ID (data is %02X, parameter is %02X)\", buf[0], id);\n\t\t}\n\t}\n\n\t// NB: The size returned by DeviceIoControl doesn't include report IDs when not in use (0)\n\tif (!DeviceIoControl(hid_handle, ioctl_code, buf, write_size,\n\t\tbuf, write_size, &write_size, overlapped)) {\n\t\tif (GetLastError() != ERROR_IO_PENDING) {\n\t\t\tusbi_dbg(\"Failed to Write HID Output Report: %s\", windows_error_str(0));\n\t\t\tsafe_free(buf);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t}\n\t\ttp->hid_buffer = buf;\n\t\ttp->hid_dest = NULL;\n\t\treturn LIBUSB_SUCCESS;\n\t}\n\n\t// Transfer completed synchronously\n\t*size = write_size;\n\tif (write_size == 0) {\n\t\tusbi_dbg(\"program assertion failed - write completed synchronously, but no data was written\");\n\t}\n\tsafe_free(buf);\n\treturn LIBUSB_COMPLETED;\n}\n\nstatic int _hid_class_request(struct hid_device_priv* dev, HANDLE hid_handle, int request_type,\n\t\t\t\t\t\t\t  int request, int value, int _index, void *data, struct windows_transfer_priv *tp,\n\t\t\t\t\t\t\t  size_t *size, OVERLAPPED* overlapped)\n{\n\tint report_type = (value >> 8) & 0xFF;\n\tint report_id = value & 0xFF;\n\n\tif ( (LIBUSB_REQ_RECIPIENT(request_type) != LIBUSB_RECIPIENT_INTERFACE)\n\t  && (LIBUSB_REQ_RECIPIENT(request_type) != LIBUSB_RECIPIENT_DEVICE) )\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\tif (LIBUSB_REQ_OUT(request_type) && request == HID_REQ_SET_REPORT)\n\t\treturn _hid_set_report(dev, hid_handle, report_id, data, tp, size, overlapped, report_type);\n\n\tif (LIBUSB_REQ_IN(request_type) && request == HID_REQ_GET_REPORT)\n\t\treturn _hid_get_report(dev, hid_handle, report_id, data, tp, size, overlapped, report_type);\n\n\treturn LIBUSB_ERROR_INVALID_PARAM;\n}\n\n\n/*\n * HID API functions\n */\nstatic int hid_init(int sub_api, struct libusb_context *ctx)\n{\n\tDLL_LOAD(hid.dll, HidD_GetAttributes, TRUE);\n\tDLL_LOAD(hid.dll, HidD_GetHidGuid, TRUE);\n\tDLL_LOAD(hid.dll, HidD_GetPreparsedData, TRUE);\n\tDLL_LOAD(hid.dll, HidD_FreePreparsedData, TRUE);\n\tDLL_LOAD(hid.dll, HidD_GetManufacturerString, TRUE);\n\tDLL_LOAD(hid.dll, HidD_GetProductString, TRUE);\n\tDLL_LOAD(hid.dll, HidD_GetSerialNumberString, TRUE);\n\tDLL_LOAD(hid.dll, HidP_GetCaps, TRUE);\n\tDLL_LOAD(hid.dll, HidD_SetNumInputBuffers, TRUE);\n\tDLL_LOAD(hid.dll, HidD_SetFeature, TRUE);\n\tDLL_LOAD(hid.dll, HidD_GetFeature, TRUE);\n\tDLL_LOAD(hid.dll, HidD_GetPhysicalDescriptor, TRUE);\n\tDLL_LOAD(hid.dll, HidD_GetInputReport, FALSE);\n\tDLL_LOAD(hid.dll, HidD_SetOutputReport, FALSE);\n\tDLL_LOAD(hid.dll, HidD_FlushQueue, TRUE);\n\tDLL_LOAD(hid.dll, HidP_GetValueCaps, TRUE);\n\n\tapi_hid_available = true;\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int hid_exit(int sub_api)\n{\n\treturn LIBUSB_SUCCESS;\n}\n\n// NB: open and close must ensure that they only handle interface of\n// the right API type, as these functions can be called wholesale from\n// composite_open(), with interfaces belonging to different APIs\nstatic int hid_open(int sub_api, struct libusb_device_handle *dev_handle)\n{\n\tstruct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\n\tHIDD_ATTRIBUTES hid_attributes;\n\tPHIDP_PREPARSED_DATA preparsed_data = NULL;\n\tHIDP_CAPS capabilities;\n\tHIDP_VALUE_CAPS *value_caps;\n\n\tHANDLE hid_handle = INVALID_HANDLE_VALUE;\n\tint i, j;\n\t// report IDs handling\n\tULONG size[3];\n\tconst char* type[3] = {\"input\", \"output\", \"feature\"};\n\tint nb_ids[2];\t// zero and nonzero report IDs\n\n\tCHECK_HID_AVAILABLE;\n\tif (priv->hid == NULL) {\n\t\tusbi_err(ctx, \"program assertion failed - private HID structure is unitialized\");\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\tfor (i = 0; i < USB_MAXINTERFACES; i++) {\n\t\tif ( (priv->usb_interface[i].path != NULL)\n\t\t  && (priv->usb_interface[i].apib->id == USB_API_HID) ) {\n\t\t\thid_handle = CreateFileA(priv->usb_interface[i].path, GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ,\n\t\t\t\tNULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL);\n\t\t\t/*\n\t\t\t * http://www.lvr.com/hidfaq.htm: Why do I receive \"Access denied\" when attempting to access my HID?\n\t\t\t * \"Windows 2000 and later have exclusive read/write access to HIDs that are configured as a system\n\t\t\t * keyboards or mice. An application can obtain a handle to a system keyboard or mouse by not\n\t\t\t * requesting READ or WRITE access with CreateFile. Applications can then use HidD_SetFeature and\n\t\t\t * HidD_GetFeature (if the device supports Feature reports).\"\n\t\t\t */\n\t\t\tif (hid_handle == INVALID_HANDLE_VALUE) {\n\t\t\t\tusbi_warn(ctx, \"could not open HID device in R/W mode (keyboard or mouse?) - trying without\");\n\t\t\t\thid_handle = CreateFileA(priv->usb_interface[i].path, 0, FILE_SHARE_WRITE | FILE_SHARE_READ,\n\t\t\t\t\tNULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL);\n\t\t\t\tif (hid_handle == INVALID_HANDLE_VALUE) {\n\t\t\t\t\tusbi_err(ctx, \"could not open device %s (interface %d): %s\", priv->path, i, windows_error_str(0));\n\t\t\t\t\tswitch(GetLastError()) {\n\t\t\t\t\tcase ERROR_FILE_NOT_FOUND:\t// The device was disconnected\n\t\t\t\t\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t\t\t\t\tcase ERROR_ACCESS_DENIED:\n\t\t\t\t\t\treturn LIBUSB_ERROR_ACCESS;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn LIBUSB_ERROR_IO;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpriv->usb_interface[i].restricted_functionality = true;\n\t\t\t}\n\t\t\thandle_priv->interface_handle[i].api_handle = hid_handle;\n\t\t}\n\t}\n\n\thid_attributes.Size = sizeof(hid_attributes);\n\tdo {\n\t\tif (!HidD_GetAttributes(hid_handle, &hid_attributes)) {\n\t\t\tusbi_err(ctx, \"could not gain access to HID top collection (HidD_GetAttributes)\");\n\t\t\tbreak;\n\t\t}\n\n\t\tpriv->hid->vid = hid_attributes.VendorID;\n\t\tpriv->hid->pid = hid_attributes.ProductID;\n\n\t\t// Set the maximum available input buffer size\n\t\tfor (i=32; HidD_SetNumInputBuffers(hid_handle, i); i*=2);\n\t\tusbi_dbg(\"set maximum input buffer size to %d\", i/2);\n\n\t\t// Get the maximum input and output report size\n\t\tif (!HidD_GetPreparsedData(hid_handle, &preparsed_data) || !preparsed_data) {\n\t\t\tusbi_err(ctx, \"could not read HID preparsed data (HidD_GetPreparsedData)\");\n\t\t\tbreak;\n\t\t}\n\t\tif (HidP_GetCaps(preparsed_data, &capabilities) != HIDP_STATUS_SUCCESS) {\n\t\t\tusbi_err(ctx, \"could not parse HID capabilities (HidP_GetCaps)\");\n\t\t\tbreak;\n\t\t}\n\n\t\t// Find out if interrupt will need report IDs\n\t\tsize[0] = capabilities.NumberInputValueCaps;\n\t\tsize[1] = capabilities.NumberOutputValueCaps;\n\t\tsize[2] = capabilities.NumberFeatureValueCaps;\n\t\tfor (j=HidP_Input; j<=HidP_Feature; j++) {\n\t\t\tusbi_dbg(\"%d HID %s report value(s) found\", size[j], type[j]);\n\t\t\tpriv->hid->uses_report_ids[j] = false;\n\t\t\tif (size[j] > 0) {\n\t\t\t\tvalue_caps = (HIDP_VALUE_CAPS*) calloc(size[j], sizeof(HIDP_VALUE_CAPS));\n\t\t\t\tif ( (value_caps != NULL)\n\t\t\t\t  && (HidP_GetValueCaps((HIDP_REPORT_TYPE)j, value_caps, &size[j], preparsed_data) == HIDP_STATUS_SUCCESS)\n\t\t\t\t  && (size[j] >= 1) ) {\n\t\t\t\t\tnb_ids[0] = 0;\n\t\t\t\t\tnb_ids[1] = 0;\n\t\t\t\t\tfor (i=0; i<(int)size[j]; i++) {\n\t\t\t\t\t\tusbi_dbg(\"  Report ID: 0x%02X\", value_caps[i].ReportID);\n\t\t\t\t\t\tif (value_caps[i].ReportID != 0) {\n\t\t\t\t\t\t\tnb_ids[1]++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnb_ids[0]++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (nb_ids[1] != 0) {\n\t\t\t\t\t\tif (nb_ids[0] != 0) {\n\t\t\t\t\t\t\tusbi_warn(ctx, \"program assertion failed: zero and nonzero report IDs used for %s\",\n\t\t\t\t\t\t\t\ttype[j]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpriv->hid->uses_report_ids[j] = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tusbi_warn(ctx, \"  could not process %s report IDs\", type[j]);\n\t\t\t\t}\n\t\t\t\tsafe_free(value_caps);\n\t\t\t}\n\t\t}\n\n\t\t// Set the report sizes\n\t\tpriv->hid->input_report_size = capabilities.InputReportByteLength;\n\t\tpriv->hid->output_report_size = capabilities.OutputReportByteLength;\n\t\tpriv->hid->feature_report_size = capabilities.FeatureReportByteLength;\n\n\t\t// Fetch string descriptors\n\t\tpriv->hid->string_index[0] = priv->dev_descriptor.iManufacturer;\n\t\tif (priv->hid->string_index[0] != 0) {\n\t\t\tHidD_GetManufacturerString(hid_handle, priv->hid->string[0],\n\t\t\t\tsizeof(priv->hid->string[0]));\n\t\t} else {\n\t\t\tpriv->hid->string[0][0] = 0;\n\t\t}\n\t\tpriv->hid->string_index[1] = priv->dev_descriptor.iProduct;\n\t\tif (priv->hid->string_index[1] != 0) {\n\t\t\tHidD_GetProductString(hid_handle, priv->hid->string[1],\n\t\t\t\tsizeof(priv->hid->string[1]));\n\t\t} else {\n\t\t\tpriv->hid->string[1][0] = 0;\n\t\t}\n\t\tpriv->hid->string_index[2] = priv->dev_descriptor.iSerialNumber;\n\t\tif (priv->hid->string_index[2] != 0) {\n\t\t\tHidD_GetSerialNumberString(hid_handle, priv->hid->string[2],\n\t\t\t\tsizeof(priv->hid->string[2]));\n\t\t} else {\n\t\t\tpriv->hid->string[2][0] = 0;\n\t\t}\n\t} while(0);\n\n\tif (preparsed_data) {\n\t\tHidD_FreePreparsedData(preparsed_data);\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic void hid_close(int sub_api, struct libusb_device_handle *dev_handle)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\tHANDLE file_handle;\n\tint i;\n\n\tif (!api_hid_available)\n\t\treturn;\n\n\tfor (i = 0; i < USB_MAXINTERFACES; i++) {\n\t\tif (priv->usb_interface[i].apib->id == USB_API_HID) {\n\t\t\tfile_handle = handle_priv->interface_handle[i].api_handle;\n\t\t\tif ( (file_handle != 0) && (file_handle != INVALID_HANDLE_VALUE)) {\n\t\t\t\tCloseHandle(file_handle);\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic int hid_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)\n{\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\n\tCHECK_HID_AVAILABLE;\n\n\t// NB: Disconnection detection is not possible in this function\n\tif (priv->usb_interface[iface].path == NULL) {\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\t// invalid iface\n\t}\n\n\t// We use dev_handle as a flag for interface claimed\n\tif (handle_priv->interface_handle[iface].dev_handle == INTERFACE_CLAIMED) {\n\t\treturn LIBUSB_ERROR_BUSY;\t// already claimed\n\t}\n\n\thandle_priv->interface_handle[iface].dev_handle = INTERFACE_CLAIMED;\n\n\tusbi_dbg(\"claimed interface %d\", iface);\n\thandle_priv->active_interface = iface;\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int hid_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)\n{\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\n\tCHECK_HID_AVAILABLE;\n\n\tif (priv->usb_interface[iface].path == NULL) {\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\t// invalid iface\n\t}\n\n\tif (handle_priv->interface_handle[iface].dev_handle != INTERFACE_CLAIMED) {\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\t// invalid iface\n\t}\n\n\thandle_priv->interface_handle[iface].dev_handle = INVALID_HANDLE_VALUE;\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int hid_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting)\n{\n\tstruct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);\n\n\tCHECK_HID_AVAILABLE;\n\n\tif (altsetting > 255) {\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\n\tif (altsetting != 0) {\n\t\tusbi_err(ctx, \"set interface altsetting not supported for altsetting >0\");\n\t\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int hid_submit_control_transfer(int sub_api, struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tstruct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);\n\tWINUSB_SETUP_PACKET *setup = (WINUSB_SETUP_PACKET *) transfer->buffer;\n\tHANDLE hid_handle;\n\tstruct winfd wfd;\n\tint current_interface, config;\n\tsize_t size;\n\tint r = LIBUSB_ERROR_INVALID_PARAM;\n\n\tCHECK_HID_AVAILABLE;\n\n\ttransfer_priv->pollable_fd = INVALID_WINFD;\n\tsafe_free(transfer_priv->hid_buffer);\n\ttransfer_priv->hid_dest = NULL;\n\tsize = transfer->length - LIBUSB_CONTROL_SETUP_SIZE;\n\n\tif (size > MAX_CTRL_BUFFER_LENGTH) {\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\t}\n\n\tcurrent_interface = get_valid_interface(transfer->dev_handle, USB_API_HID);\n\tif (current_interface < 0) {\n\t\tif (auto_claim(transfer, &current_interface, USB_API_HID) != LIBUSB_SUCCESS) {\n\t\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t\t}\n\t}\n\n\tusbi_dbg(\"will use interface %d\", current_interface);\n\thid_handle = handle_priv->interface_handle[current_interface].api_handle;\n\t// Always use the handle returned from usbi_create_fd (wfd.handle)\n\twfd = usbi_create_fd(hid_handle, RW_READ, NULL, NULL);\n\tif (wfd.fd < 0) {\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\tswitch(LIBUSB_REQ_TYPE(setup->request_type)) {\n\tcase LIBUSB_REQUEST_TYPE_STANDARD:\n\t\tswitch(setup->request) {\n\t\tcase LIBUSB_REQUEST_GET_DESCRIPTOR:\n\t\t\tr = _hid_get_descriptor(priv->hid, wfd.handle, LIBUSB_REQ_RECIPIENT(setup->request_type),\n\t\t\t\t(setup->value >> 8) & 0xFF, setup->value & 0xFF, transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE, &size);\n\t\t\tbreak;\n\t\tcase LIBUSB_REQUEST_GET_CONFIGURATION:\n\t\t\tr = windows_get_configuration(transfer->dev_handle, &config);\n\t\t\tif (r == LIBUSB_SUCCESS) {\n\t\t\t\tsize = 1;\n\t\t\t\t((uint8_t*)transfer->buffer)[LIBUSB_CONTROL_SETUP_SIZE] = (uint8_t)config;\n\t\t\t\tr = LIBUSB_COMPLETED;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase LIBUSB_REQUEST_SET_CONFIGURATION:\n\t\t\tif (setup->value == priv->active_config) {\n\t\t\t\tr = LIBUSB_COMPLETED;\n\t\t\t} else {\n\t\t\t\tusbi_warn(ctx, \"cannot set configuration other than the default one\");\n\t\t\t\tr = LIBUSB_ERROR_INVALID_PARAM;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase LIBUSB_REQUEST_GET_INTERFACE:\n\t\t\tsize = 1;\n\t\t\t((uint8_t*)transfer->buffer)[LIBUSB_CONTROL_SETUP_SIZE] = 0;\n\t\t\tr = LIBUSB_COMPLETED;\n\t\t\tbreak;\n\t\tcase LIBUSB_REQUEST_SET_INTERFACE:\n\t\t\tr = hid_set_interface_altsetting(0, transfer->dev_handle, setup->index, setup->value);\n\t\t\tif (r == LIBUSB_SUCCESS) {\n\t\t\t\tr = LIBUSB_COMPLETED;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tusbi_warn(ctx, \"unsupported HID control request\");\n\t\t\tr = LIBUSB_ERROR_INVALID_PARAM;\n\t\t\tbreak;\n\t\t}\n\t\tbreak;\n\tcase LIBUSB_REQUEST_TYPE_CLASS:\n\t\tr =_hid_class_request(priv->hid, wfd.handle, setup->request_type, setup->request, setup->value,\n\t\t\tsetup->index, transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE, transfer_priv,\n\t\t\t&size, wfd.overlapped);\n\t\tbreak;\n\tdefault:\n\t\tusbi_warn(ctx, \"unsupported HID control request\");\n\t\tr = LIBUSB_ERROR_INVALID_PARAM;\n\t\tbreak;\n\t}\n\n\tif (r == LIBUSB_COMPLETED) {\n\t\t// Force request to be completed synchronously. Transferred size has been set by previous call\n\t\twfd.overlapped->Internal = STATUS_COMPLETED_SYNCHRONOUSLY;\n\t\t// http://msdn.microsoft.com/en-us/library/ms684342%28VS.85%29.aspx\n\t\t// set InternalHigh to the number of bytes transferred\n\t\twfd.overlapped->InternalHigh = (DWORD)size;\n\t\tr = LIBUSB_SUCCESS;\n\t}\n\n\tif (r == LIBUSB_SUCCESS) {\n\t\t// Use priv_transfer to store data needed for async polling\n\t\ttransfer_priv->pollable_fd = wfd;\n\t\ttransfer_priv->interface_number = (uint8_t)current_interface;\n\t} else {\n\t\tusbi_free_fd(&wfd);\n\t}\n\n\treturn r;\n}\n\nstatic int hid_submit_bulk_transfer(int sub_api, struct usbi_transfer *itransfer) {\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);\n\tstruct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tstruct winfd wfd;\n\tHANDLE hid_handle;\n\tbool direction_in, ret;\n\tint current_interface, length;\n\tDWORD size;\n\tint r = LIBUSB_SUCCESS;\n\n\tCHECK_HID_AVAILABLE;\n\n\ttransfer_priv->pollable_fd = INVALID_WINFD;\n\ttransfer_priv->hid_dest = NULL;\n\tsafe_free(transfer_priv->hid_buffer);\n\n\tcurrent_interface = interface_by_endpoint(priv, handle_priv, transfer->endpoint);\n\tif (current_interface < 0) {\n\t\tusbi_err(ctx, \"unable to match endpoint to an open interface - cancelling transfer\");\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\tusbi_dbg(\"matched endpoint %02X with interface %d\", transfer->endpoint, current_interface);\n\n\thid_handle = handle_priv->interface_handle[current_interface].api_handle;\n\tdirection_in = transfer->endpoint & LIBUSB_ENDPOINT_IN;\n\n\twfd = usbi_create_fd(hid_handle, direction_in?RW_READ:RW_WRITE, NULL, NULL);\n\t// Always use the handle returned from usbi_create_fd (wfd.handle)\n\tif (wfd.fd < 0) {\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\t// If report IDs are not in use, an extra prefix byte must be added\n\tif ( ((direction_in) && (!priv->hid->uses_report_ids[0]))\n\t  || ((!direction_in) && (!priv->hid->uses_report_ids[1])) ) {\n\t\tlength = transfer->length+1;\n\t} else {\n\t\tlength = transfer->length;\n\t}\n\t// Add a trailing byte to detect overflows on input\n\ttransfer_priv->hid_buffer = (uint8_t*)calloc(length+1, 1);\n\tif (transfer_priv->hid_buffer == NULL) {\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\ttransfer_priv->hid_expected_size = length;\n\n\tif (direction_in) {\n\t\ttransfer_priv->hid_dest = transfer->buffer;\n\t\tusbi_dbg(\"reading %d bytes (report ID: 0x00)\", length);\n\t\tret = ReadFile(wfd.handle, transfer_priv->hid_buffer, length+1, &size, wfd.overlapped);\n\t} else {\n\t\tif (!priv->hid->uses_report_ids[1]) {\n\t\t\tmemcpy(transfer_priv->hid_buffer+1, transfer->buffer, transfer->length);\n\t\t} else {\n\t\t\t// We could actually do without the calloc and memcpy in this case\n\t\t\tmemcpy(transfer_priv->hid_buffer, transfer->buffer, transfer->length);\n\t\t}\n\t\tusbi_dbg(\"writing %d bytes (report ID: 0x%02X)\", length, transfer_priv->hid_buffer[0]);\n\t\tret = WriteFile(wfd.handle, transfer_priv->hid_buffer, length, &size, wfd.overlapped);\n\t}\n\tif (!ret) {\n\t\tif (GetLastError() != ERROR_IO_PENDING) {\n\t\t\tusbi_err(ctx, \"HID transfer failed: %s\", windows_error_str(0));\n\t\t\tusbi_free_fd(&wfd);\n\t\t\tsafe_free(transfer_priv->hid_buffer);\n\t\t\treturn LIBUSB_ERROR_IO;\n\t\t}\n\t} else {\n\t\t// Only write operations that completed synchronously need to free up\n\t\t// hid_buffer. For reads, copy_transfer_data() handles that process.\n\t\tif (!direction_in) {\n\t\t\tsafe_free(transfer_priv->hid_buffer);\n\t\t}\n\t\tif (size == 0) {\n\t\t\tusbi_err(ctx, \"program assertion failed - no data was transferred\");\n\t\t\tsize = 1;\n\t\t}\n\t\tif (size > (size_t)length) {\n\t\t\tusbi_err(ctx, \"OVERFLOW!\");\n\t\t\tr = LIBUSB_ERROR_OVERFLOW;\n\t\t}\n\t\twfd.overlapped->Internal = STATUS_COMPLETED_SYNCHRONOUSLY;\n\t\twfd.overlapped->InternalHigh = size;\n\t}\n\n\ttransfer_priv->pollable_fd = wfd;\n\ttransfer_priv->interface_number = (uint8_t)current_interface;\n\n\treturn r;\n}\n\nstatic int hid_abort_transfers(int sub_api, struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct windows_transfer_priv *transfer_priv = (struct windows_transfer_priv*)usbi_transfer_get_os_priv(itransfer);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);\n\tHANDLE hid_handle;\n\tint current_interface;\n\n\tCHECK_HID_AVAILABLE;\n\n\tcurrent_interface = transfer_priv->interface_number;\n\thid_handle = handle_priv->interface_handle[current_interface].api_handle;\n\tCancelIo(hid_handle);\n\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int hid_reset_device(int sub_api, struct libusb_device_handle *dev_handle)\n{\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\tHANDLE hid_handle;\n\tint current_interface;\n\n\tCHECK_HID_AVAILABLE;\n\n\t// Flushing the queues on all interfaces is the best we can achieve\n\tfor (current_interface = 0; current_interface < USB_MAXINTERFACES; current_interface++) {\n\t\thid_handle = handle_priv->interface_handle[current_interface].api_handle;\n\t\tif ((hid_handle != 0) && (hid_handle != INVALID_HANDLE_VALUE)) {\n\t\t\tHidD_FlushQueue(hid_handle);\n\t\t}\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int hid_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint)\n{\n\tstruct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tHANDLE hid_handle;\n\tint current_interface;\n\n\tCHECK_HID_AVAILABLE;\n\n\tcurrent_interface = interface_by_endpoint(priv, handle_priv, endpoint);\n\tif (current_interface < 0) {\n\t\tusbi_err(ctx, \"unable to match endpoint to an open interface - cannot clear\");\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\tusbi_dbg(\"matched endpoint %02X with interface %d\", endpoint, current_interface);\n\thid_handle = handle_priv->interface_handle[current_interface].api_handle;\n\n\t// No endpoint selection with Microsoft's implementation, so we try to flush the\n\t// whole interface. Should be OK for most case scenarios\n\tif (!HidD_FlushQueue(hid_handle)) {\n\t\tusbi_err(ctx, \"Flushing of HID queue failed: %s\", windows_error_str(0));\n\t\t// Device was probably disconnected\n\t\treturn LIBUSB_ERROR_NO_DEVICE;\n\t}\n\n\treturn LIBUSB_SUCCESS;\n}\n\n// This extra function is only needed for HID\nstatic int hid_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size) {\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);\n\tstruct windows_transfer_priv *transfer_priv = usbi_transfer_get_os_priv(itransfer);\n\tint r = LIBUSB_TRANSFER_COMPLETED;\n\tuint32_t corrected_size = io_size;\n\n\tif (transfer_priv->hid_buffer != NULL) {\n\t\t// If we have a valid hid_buffer, it means the transfer was async\n\t\tif (transfer_priv->hid_dest != NULL) {\t// Data readout\n\t\t\tif (corrected_size > 0) {\n\t\t\t\t// First, check for overflow\n\t\t\t\tif (corrected_size > transfer_priv->hid_expected_size) {\n\t\t\t\t\tusbi_err(ctx, \"OVERFLOW!\");\n\t\t\t\t\tcorrected_size = (uint32_t)transfer_priv->hid_expected_size;\n\t\t\t\t\tr = LIBUSB_TRANSFER_OVERFLOW;\n\t\t\t\t}\n\n\t\t\t\tif (transfer_priv->hid_buffer[0] == 0) {\n\t\t\t\t\t// Discard the 1 byte report ID prefix\n\t\t\t\t\tcorrected_size--;\n\t\t\t\t\tmemcpy(transfer_priv->hid_dest, transfer_priv->hid_buffer+1, corrected_size);\n\t\t\t\t} else {\n\t\t\t\t\tmemcpy(transfer_priv->hid_dest, transfer_priv->hid_buffer, corrected_size);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttransfer_priv->hid_dest = NULL;\n\t\t}\n\t\t// For write, we just need to free the hid buffer\n\t\tsafe_free(transfer_priv->hid_buffer);\n\t}\n\titransfer->transferred += corrected_size;\n\treturn r;\n}\n\n\n/*\n * Composite API functions\n */\nstatic int composite_init(int sub_api, struct libusb_context *ctx)\n{\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int composite_exit(int sub_api)\n{\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int composite_open(int sub_api, struct libusb_device_handle *dev_handle)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tint r = LIBUSB_ERROR_NOT_FOUND;\n\tuint8_t i;\n\t// SUB_API_MAX+1 as the SUB_API_MAX pos is used to indicate availability of HID\n\tbool available[SUB_API_MAX+1] = {0};\n\n\tfor (i=0; i<USB_MAXINTERFACES; i++) {\n\t\tswitch (priv->usb_interface[i].apib->id) {\n\t\tcase USB_API_WINUSBX:\n\t\t\tif (priv->usb_interface[i].sub_api != SUB_API_NOTSET)\n\t\t\t\tavailable[priv->usb_interface[i].sub_api] = true;\n\t\t\tbreak;\n\t\tcase USB_API_HID:\n\t\t\tavailable[SUB_API_MAX] = true;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tfor (i=0; i<SUB_API_MAX; i++) {\t// WinUSB-like drivers\n\t\tif (available[i]) {\n\t\t\tr = usb_api_backend[USB_API_WINUSBX].open(i, dev_handle);\n\t\t\tif (r != LIBUSB_SUCCESS) {\n\t\t\t\treturn r;\n\t\t\t}\n\t\t}\n\t}\n\tif (available[SUB_API_MAX]) {\t// HID driver\n\t\tr = hid_open(SUB_API_NOTSET, dev_handle);\n\t}\n\treturn r;\n}\n\nstatic void composite_close(int sub_api, struct libusb_device_handle *dev_handle)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tuint8_t i;\n\tbool available[SUB_API_MAX];\n\n\tfor (i = 0; i<SUB_API_MAX; i++) {\n\t\tavailable[i] = false;\n\t}\n\n\tfor (i=0; i<USB_MAXINTERFACES; i++) {\n\t\tif ( (priv->usb_interface[i].apib->id == USB_API_WINUSBX)\n\t\t  && (priv->usb_interface[i].sub_api != SUB_API_NOTSET) ) {\n\t\t\tavailable[priv->usb_interface[i].sub_api] = true;\n\t\t}\n\t}\n\n\tfor (i=0; i<SUB_API_MAX; i++) {\n\t\tif (available[i]) {\n\t\t\tusb_api_backend[USB_API_WINUSBX].close(i, dev_handle);\n\t\t}\n\t}\n}\n\nstatic int composite_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\treturn priv->usb_interface[iface].apib->\n\t\tclaim_interface(priv->usb_interface[iface].sub_api, dev_handle, iface);\n}\n\nstatic int composite_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\treturn priv->usb_interface[iface].apib->\n\t\tset_interface_altsetting(priv->usb_interface[iface].sub_api, dev_handle, iface, altsetting);\n}\n\nstatic int composite_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\treturn priv->usb_interface[iface].apib->\n\t\trelease_interface(priv->usb_interface[iface].sub_api, dev_handle, iface);\n}\n\nstatic int composite_submit_control_transfer(int sub_api, struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tint i, pass;\n\n\t// Interface shouldn't matter for control, but it does in practice, with Windows'\n\t// restrictions with regards to accessing HID keyboards and mice. Try a 2 pass approach\n\tfor (pass = 0; pass < 2; pass++) {\n\t\tfor (i=0; i<USB_MAXINTERFACES; i++) {\n\t\t\tif (priv->usb_interface[i].path != NULL) {\n\t\t\t\tif ((pass == 0) && (priv->usb_interface[i].restricted_functionality)) {\n\t\t\t\t\tusbi_dbg(\"trying to skip restricted interface #%d (HID keyboard or mouse?)\", i);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tusbi_dbg(\"using interface %d\", i);\n\t\t\t\treturn priv->usb_interface[i].apib->submit_control_transfer(priv->usb_interface[i].sub_api, itransfer);\n\t\t\t}\n\t\t}\n\t}\n\n\tusbi_err(ctx, \"no libusb supported interfaces to complete request\");\n\treturn LIBUSB_ERROR_NOT_FOUND;\n}\n\nstatic int composite_submit_bulk_transfer(int sub_api, struct usbi_transfer *itransfer) {\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tint current_interface;\n\n\tcurrent_interface = interface_by_endpoint(priv, handle_priv, transfer->endpoint);\n\tif (current_interface < 0) {\n\t\tusbi_err(ctx, \"unable to match endpoint to an open interface - cancelling transfer\");\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\treturn priv->usb_interface[current_interface].apib->\n\t\tsubmit_bulk_transfer(priv->usb_interface[current_interface].sub_api, itransfer);}\n\nstatic int composite_submit_iso_transfer(int sub_api, struct usbi_transfer *itransfer) {\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\tint current_interface;\n\n\tcurrent_interface = interface_by_endpoint(priv, handle_priv, transfer->endpoint);\n\tif (current_interface < 0) {\n\t\tusbi_err(ctx, \"unable to match endpoint to an open interface - cancelling transfer\");\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\treturn priv->usb_interface[current_interface].apib->\n\t\tsubmit_iso_transfer(priv->usb_interface[current_interface].sub_api, itransfer);}\n\nstatic int composite_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint)\n{\n\tstruct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);\n\tstruct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tint current_interface;\n\n\tcurrent_interface = interface_by_endpoint(priv, handle_priv, endpoint);\n\tif (current_interface < 0) {\n\t\tusbi_err(ctx, \"unable to match endpoint to an open interface - cannot clear\");\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\treturn priv->usb_interface[current_interface].apib->\n\t\tclear_halt(priv->usb_interface[current_interface].sub_api, dev_handle, endpoint);}\n\nstatic int composite_abort_control(int sub_api, struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct windows_transfer_priv *transfer_priv = usbi_transfer_get_os_priv(itransfer);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\n\treturn priv->usb_interface[transfer_priv->interface_number].apib->\n\t\tabort_control(priv->usb_interface[transfer_priv->interface_number].sub_api, itransfer);}\n\nstatic int composite_abort_transfers(int sub_api, struct usbi_transfer *itransfer)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct windows_transfer_priv *transfer_priv = usbi_transfer_get_os_priv(itransfer);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\n\treturn priv->usb_interface[transfer_priv->interface_number].apib->\n\t\tabort_transfers(priv->usb_interface[transfer_priv->interface_number].sub_api, itransfer);}\n\nstatic int composite_reset_device(int sub_api, struct libusb_device_handle *dev_handle)\n{\n\tstruct windows_device_priv *priv = _device_priv(dev_handle->dev);\n\tint r;\n\tuint8_t i; \n\tbool available[SUB_API_MAX];\n\tfor (i = 0; i<SUB_API_MAX; i++) {\n\t\tavailable[i] = false;\n\t}\n\tfor (i=0; i<USB_MAXINTERFACES; i++) {\n\t\tif ( (priv->usb_interface[i].apib->id == USB_API_WINUSBX)\n\t\t  && (priv->usb_interface[i].sub_api != SUB_API_NOTSET) ) {\n\t\t\tavailable[priv->usb_interface[i].sub_api] = true;\n\t\t}\n\t}\n\tfor (i=0; i<SUB_API_MAX; i++) {\n\t\tif (available[i]) {\n\t\t\tr = usb_api_backend[USB_API_WINUSBX].reset_device(i, dev_handle);\n\t\t\tif (r != LIBUSB_SUCCESS) {\n\t\t\t\treturn r;\n\t\t\t}\n\t\t}\n\t}\n\treturn LIBUSB_SUCCESS;\n}\n\nstatic int composite_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size)\n{\n\tstruct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);\n\tstruct windows_transfer_priv *transfer_priv = usbi_transfer_get_os_priv(itransfer);\n\tstruct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);\n\n\treturn priv->usb_interface[transfer_priv->interface_number].apib->\n\t\tcopy_transfer_data(priv->usb_interface[transfer_priv->interface_number].sub_api, itransfer, io_size);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/os/windows_usb.h",
    "content": "/*\n * Windows backend for libusb 1.0\n * Copyright © 2009-2012 Pete Batard <pete@akeo.ie>\n * With contributions from Michael Plante, Orin Eman et al.\n * Parts of this code adapted from libusb-win32-v1 by Stephan Meyer\n * Major code testing contribution by Xiaofan Chen\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#pragma once\n\n#include \"windows_common.h\"\n\n#if defined(_MSC_VER)\n// disable /W4 MSVC warnings that are benign\n#pragma warning(disable:4127) // conditional expression is constant\n#pragma warning(disable:4100) // unreferenced formal parameter\n#pragma warning(disable:4214) // bit field types other than int\n#pragma warning(disable:4201) // nameless struct/union\n#endif\n\n// Missing from MSVC6 setupapi.h\n#if !defined(SPDRP_ADDRESS)\n#define SPDRP_ADDRESS\t28\n#endif\n#if !defined(SPDRP_INSTALL_STATE)\n#define SPDRP_INSTALL_STATE\t34\n#endif\n\n// Missing from MinGW\n#if !defined(FACILITY_SETUPAPI)\n#define FACILITY_SETUPAPI\t15\n#endif\n\n#if defined(__CYGWIN__ )\n#define _stricmp stricmp\n// cygwin produces a warning unless these prototypes are defined\nextern int _snprintf(char *buffer, size_t count, const char *format, ...);\nextern char *_strdup(const char *strSource);\n// _beginthreadex is MSVCRT => unavailable for cygwin. Fallback to using CreateThread\n#define _beginthreadex(a, b, c, d, e, f) CreateThread(a, b, (LPTHREAD_START_ROUTINE)c, d, e, f)\n#endif\n\n#define MAX_CTRL_BUFFER_LENGTH      4096\n#define MAX_USB_DEVICES             256\n#define MAX_USB_STRING_LENGTH       128\n#define MAX_HID_REPORT_SIZE         1024\n#define MAX_HID_DESCRIPTOR_SIZE     256\n#define MAX_GUID_STRING_LENGTH      40\n#define MAX_PATH_LENGTH             128\n#define MAX_KEY_LENGTH              256\n#define LIST_SEPARATOR              ';'\n#define HTAB_SIZE                   1021\n\n// Handle code for HID interface that have been claimed (\"dibs\")\n#define INTERFACE_CLAIMED           ((HANDLE)(intptr_t)0xD1B5)\n// Additional return code for HID operations that completed synchronously\n#define LIBUSB_COMPLETED            (LIBUSB_SUCCESS + 1)\n\n// http://msdn.microsoft.com/en-us/library/ff545978.aspx\n// http://msdn.microsoft.com/en-us/library/ff545972.aspx\n// http://msdn.microsoft.com/en-us/library/ff545982.aspx\n#if !defined(GUID_DEVINTERFACE_USB_HOST_CONTROLLER)\nconst GUID GUID_DEVINTERFACE_USB_HOST_CONTROLLER = { 0x3ABF6F2D, 0x71C4, 0x462A, {0x8A, 0x92, 0x1E, 0x68, 0x61, 0xE6, 0xAF, 0x27} };\n#endif\n#if !defined(GUID_DEVINTERFACE_USB_DEVICE)\nconst GUID GUID_DEVINTERFACE_USB_DEVICE = { 0xA5DCBF10, 0x6530, 0x11D2, {0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED} };\n#endif\n#if !defined(GUID_DEVINTERFACE_USB_HUB)\nconst GUID GUID_DEVINTERFACE_USB_HUB = { 0xF18A0E88, 0xC30C, 0x11D0, {0x88, 0x15, 0x00, 0xA0, 0xC9, 0x06, 0xBE, 0xD8} };\n#endif\n#if !defined(GUID_DEVINTERFACE_LIBUSB0_FILTER)\nconst GUID GUID_DEVINTERFACE_LIBUSB0_FILTER = { 0xF9F3FF14, 0xAE21, 0x48A0, {0x8A, 0x25, 0x80, 0x11, 0xA7, 0xA9, 0x31, 0xD9} };\n#endif\n\n\n/*\n * Multiple USB API backend support\n */\n#define USB_API_UNSUPPORTED 0\n#define USB_API_HUB         1\n#define USB_API_COMPOSITE   2\n#define USB_API_WINUSBX     3\n#define USB_API_HID         4\n#define USB_API_MAX         5\n// The following is used to indicate if the HID or composite extra props have already been set.\n#define USB_API_SET         (1<<USB_API_MAX) \n\n// Sub-APIs for WinUSB-like driver APIs (WinUSB, libusbK, libusb-win32 through the libusbK DLL)\n// Must have the same values as the KUSB_DRVID enum from libusbk.h\n#define SUB_API_NOTSET      -1\n#define SUB_API_LIBUSBK     0\n#define SUB_API_LIBUSB0     1\n#define SUB_API_WINUSB      2\n#define SUB_API_MAX         3\n\n#define WINUSBX_DRV_NAMES   { \"libusbK\", \"libusb0\", \"WinUSB\"}\n\nstruct windows_usb_api_backend {\n\tconst uint8_t id;\n\tconst char* designation;\n\tconst char **driver_name_list; // Driver name, without .sys, e.g. \"usbccgp\"\n\tconst uint8_t nb_driver_names;\n\tint (*init)(int sub_api, struct libusb_context *ctx);\n\tint (*exit)(int sub_api);\n\tint (*open)(int sub_api, struct libusb_device_handle *dev_handle);\n\tvoid (*close)(int sub_api, struct libusb_device_handle *dev_handle);\n\tint (*configure_endpoints)(int sub_api, struct libusb_device_handle *dev_handle, int iface);\n\tint (*claim_interface)(int sub_api, struct libusb_device_handle *dev_handle, int iface);\n\tint (*set_interface_altsetting)(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting);\n\tint (*release_interface)(int sub_api, struct libusb_device_handle *dev_handle, int iface);\n\tint (*clear_halt)(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint);\n\tint (*reset_device)(int sub_api, struct libusb_device_handle *dev_handle);\n\tint (*submit_bulk_transfer)(int sub_api, struct usbi_transfer *itransfer);\n\tint (*submit_iso_transfer)(int sub_api, struct usbi_transfer *itransfer);\n\tint (*submit_control_transfer)(int sub_api, struct usbi_transfer *itransfer);\n\tint (*abort_control)(int sub_api, struct usbi_transfer *itransfer);\n\tint (*abort_transfers)(int sub_api, struct usbi_transfer *itransfer);\n\tint (*copy_transfer_data)(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size);\n};\n\nextern const struct windows_usb_api_backend usb_api_backend[USB_API_MAX];\n\n#define PRINT_UNSUPPORTED_API(fname)              \\\n\tusbi_dbg(\"unsupported API call for '\"         \\\n\t\t#fname \"' (unrecognized device driver)\"); \\\n\treturn LIBUSB_ERROR_NOT_SUPPORTED;\n\n/*\n * private structures definition\n * with inline pseudo constructors/destructors\n */\n\n// TODO (v2+): move hid desc to libusb.h?\nstruct libusb_hid_descriptor {\n\tuint8_t  bLength;\n\tuint8_t  bDescriptorType;\n\tuint16_t bcdHID;\n\tuint8_t  bCountryCode;\n\tuint8_t  bNumDescriptors;\n\tuint8_t  bClassDescriptorType;\n\tuint16_t wClassDescriptorLength;\n};\n#define LIBUSB_DT_HID_SIZE              9\n#define HID_MAX_CONFIG_DESC_SIZE (LIBUSB_DT_CONFIG_SIZE + LIBUSB_DT_INTERFACE_SIZE \\\n\t+ LIBUSB_DT_HID_SIZE + 2 * LIBUSB_DT_ENDPOINT_SIZE)\n#define HID_MAX_REPORT_SIZE             1024\n#define HID_IN_EP                       0x81\n#define HID_OUT_EP                      0x02\n#define LIBUSB_REQ_RECIPIENT(request_type) ((request_type) & 0x1F)\n#define LIBUSB_REQ_TYPE(request_type) ((request_type) & (0x03 << 5))\n#define LIBUSB_REQ_IN(request_type) ((request_type) & LIBUSB_ENDPOINT_IN)\n#define LIBUSB_REQ_OUT(request_type) (!LIBUSB_REQ_IN(request_type))\n\n// The following are used for HID reports IOCTLs\n#define HID_CTL_CODE(id) \\\n  CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_NEITHER, FILE_ANY_ACCESS)\n#define HID_BUFFER_CTL_CODE(id) \\\n  CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_BUFFERED, FILE_ANY_ACCESS)\n#define HID_IN_CTL_CODE(id) \\\n  CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_IN_DIRECT, FILE_ANY_ACCESS)\n#define HID_OUT_CTL_CODE(id) \\\n  CTL_CODE (FILE_DEVICE_KEYBOARD, (id), METHOD_OUT_DIRECT, FILE_ANY_ACCESS)\n\n#define IOCTL_HID_GET_FEATURE                 HID_OUT_CTL_CODE(100)\n#define IOCTL_HID_GET_INPUT_REPORT            HID_OUT_CTL_CODE(104)\n#define IOCTL_HID_SET_FEATURE                 HID_IN_CTL_CODE(100)\n#define IOCTL_HID_SET_OUTPUT_REPORT           HID_IN_CTL_CODE(101)\n\nenum libusb_hid_request_type {\n\tHID_REQ_GET_REPORT = 0x01,\n\tHID_REQ_GET_IDLE = 0x02,\n\tHID_REQ_GET_PROTOCOL = 0x03,\n\tHID_REQ_SET_REPORT = 0x09,\n\tHID_REQ_SET_IDLE = 0x0A,\n\tHID_REQ_SET_PROTOCOL = 0x0B\n};\n\nenum libusb_hid_report_type {\n\tHID_REPORT_TYPE_INPUT = 0x01,\n\tHID_REPORT_TYPE_OUTPUT = 0x02,\n\tHID_REPORT_TYPE_FEATURE = 0x03\n};\n\nstruct hid_device_priv {\n\tuint16_t vid;\n\tuint16_t pid;\n\tuint8_t config;\n\tuint8_t nb_interfaces;\n\tbool uses_report_ids[3];\t// input, ouptput, feature\n\tuint16_t input_report_size;\n\tuint16_t output_report_size;\n\tuint16_t feature_report_size;\n\tWCHAR string[3][MAX_USB_STRING_LENGTH];\n\tuint8_t string_index[3];\t// man, prod, ser\n};\n\ntypedef struct libusb_device_descriptor USB_DEVICE_DESCRIPTOR, *PUSB_DEVICE_DESCRIPTOR;\nstruct windows_device_priv {\n\tuint8_t depth;\t\t\t\t\t\t// distance to HCD\n\tuint8_t port;\t\t\t\t\t\t// port number on the hub\n\tuint8_t active_config;\n\tstruct libusb_device *parent_dev;\t// access to parent is required for usermode ops\n\tstruct windows_usb_api_backend const *apib;\n\tchar *path;\t\t\t\t\t\t\t// device interface path\n\tint sub_api;\t\t\t\t\t\t// for WinUSB-like APIs\n\tstruct {\n\t\tchar *path;\t\t\t\t\t\t// each interface needs a device interface path,\n\t\tstruct windows_usb_api_backend const *apib; // an API backend (multiple drivers support),\n\t\tint sub_api;\n\t\tint8_t nb_endpoints;\t\t\t// and a set of endpoint addresses (USB_MAXENDPOINTS)\n\t\tuint8_t *endpoint;\n\t\tbool restricted_functionality;\t// indicates if the interface functionality is restricted\n\t\t\t\t\t\t\t\t\t\t// by Windows (eg. HID keyboards or mice cannot do R/W)\n\t} usb_interface[USB_MAXINTERFACES];\n\tstruct hid_device_priv *hid;\n\tUSB_DEVICE_DESCRIPTOR dev_descriptor;\n\tunsigned char **config_descriptor;\t// list of pointers to the cached config descriptors\n};\n\nstatic inline struct windows_device_priv *_device_priv(struct libusb_device *dev) {\n\treturn (struct windows_device_priv *)dev->os_priv;\n}\n\nstatic inline void windows_device_priv_init(libusb_device* dev) {\n\tstruct windows_device_priv* p = _device_priv(dev);\n\tint i;\n\tp->depth = 0;\n\tp->port = 0;\n\tp->parent_dev = NULL;\n\tp->path = NULL;\n\tp->apib = &usb_api_backend[USB_API_UNSUPPORTED];\n\tp->sub_api = SUB_API_NOTSET;\n\tp->hid = NULL;\n\tp->active_config = 0;\n\tp->config_descriptor = NULL;\n\tmemset(&(p->dev_descriptor), 0, sizeof(USB_DEVICE_DESCRIPTOR));\n\tfor (i=0; i<USB_MAXINTERFACES; i++) {\n\t\tp->usb_interface[i].path = NULL;\n\t\tp->usb_interface[i].apib = &usb_api_backend[USB_API_UNSUPPORTED];\n\t\tp->usb_interface[i].sub_api = SUB_API_NOTSET;\n\t\tp->usb_interface[i].nb_endpoints = 0;\n\t\tp->usb_interface[i].endpoint = NULL;\n\t\tp->usb_interface[i].restricted_functionality = false;\n\t}\n}\n\nstatic inline void windows_device_priv_release(libusb_device* dev) {\n\tstruct windows_device_priv* p = _device_priv(dev);\n\tint i;\n\tsafe_free(p->path);\n\tif ((dev->num_configurations > 0) && (p->config_descriptor != NULL)) {\n\t\tfor (i=0; i < dev->num_configurations; i++)\n\t\t\tsafe_free(p->config_descriptor[i]);\n\t}\n\tsafe_free(p->config_descriptor);\n\tsafe_free(p->hid);\n\tfor (i=0; i<USB_MAXINTERFACES; i++) {\n\t\tsafe_free(p->usb_interface[i].path);\n\t\tsafe_free(p->usb_interface[i].endpoint);\n\t}\n}\n\nstruct interface_handle_t {\n\tHANDLE dev_handle; // WinUSB needs an extra handle for the file\n\tHANDLE api_handle; // used by the API to communicate with the device\n};\n\nstruct windows_device_handle_priv {\n\tint active_interface;\n\tstruct interface_handle_t interface_handle[USB_MAXINTERFACES];\n\tint autoclaim_count[USB_MAXINTERFACES]; // For auto-release\n};\n\nstatic inline struct windows_device_handle_priv *_device_handle_priv(\n\tstruct libusb_device_handle *handle)\n{\n\treturn (struct windows_device_handle_priv *) handle->os_priv;\n}\n\n// used for async polling functions\nstruct windows_transfer_priv {\n\tstruct winfd pollable_fd;\n\tuint8_t interface_number;\n\tuint8_t *hid_buffer; // 1 byte extended data buffer, required for HID\n\tuint8_t *hid_dest;   // transfer buffer destination, required for HID\n\tsize_t hid_expected_size;\n};\n\n// used to match a device driver (including filter drivers) against a supported API\nstruct driver_lookup {\n\tchar list[MAX_KEY_LENGTH+1];// REG_MULTI_SZ list of services (driver) names\n\tconst DWORD reg_prop;\t\t// SPDRP registry key to use to retreive list\n\tconst char* designation;\t// internal designation (for debug output)\n};\n\n/* OLE32 dependency */\nDLL_DECLARE_PREFIXED(WINAPI, HRESULT, p, CLSIDFromString, (LPCOLESTR, LPCLSID));\n\n/* SetupAPI dependencies */\nDLL_DECLARE_PREFIXED(WINAPI, HDEVINFO, p, SetupDiGetClassDevsA, (const GUID*, PCSTR, HWND, DWORD));\nDLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiEnumDeviceInfo, (HDEVINFO, DWORD, PSP_DEVINFO_DATA));\nDLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiEnumDeviceInterfaces, (HDEVINFO, PSP_DEVINFO_DATA,\n\t\t\tconst GUID*, DWORD, PSP_DEVICE_INTERFACE_DATA));\nDLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiGetDeviceInterfaceDetailA, (HDEVINFO, PSP_DEVICE_INTERFACE_DATA,\n\t\t\tPSP_DEVICE_INTERFACE_DETAIL_DATA_A, DWORD, PDWORD, PSP_DEVINFO_DATA));\nDLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiDestroyDeviceInfoList, (HDEVINFO));\nDLL_DECLARE_PREFIXED(WINAPI, HKEY, p, SetupDiOpenDevRegKey, (HDEVINFO, PSP_DEVINFO_DATA, DWORD, DWORD, DWORD, REGSAM));\nDLL_DECLARE_PREFIXED(WINAPI, BOOL, p, SetupDiGetDeviceRegistryPropertyA, (HDEVINFO,\n\t\t\tPSP_DEVINFO_DATA, DWORD, PDWORD, PBYTE, DWORD, PDWORD));\nDLL_DECLARE_PREFIXED(WINAPI, HKEY, p, SetupDiOpenDeviceInterfaceRegKey, (HDEVINFO, PSP_DEVICE_INTERFACE_DATA, DWORD, DWORD));\nDLL_DECLARE_PREFIXED(WINAPI, LONG, p, RegQueryValueExW, (HKEY, LPCWSTR, LPDWORD, LPDWORD, LPBYTE, LPDWORD));\nDLL_DECLARE_PREFIXED(WINAPI, LONG, p, RegCloseKey, (HKEY));\n\n/*\n * Windows DDK API definitions. Most of it copied from MinGW's includes\n */\ntypedef DWORD DEVNODE, DEVINST;\ntypedef DEVNODE *PDEVNODE, *PDEVINST;\ntypedef DWORD RETURN_TYPE;\ntypedef RETURN_TYPE CONFIGRET;\n\n#define CR_SUCCESS                              0x00000000\n#define CR_NO_SUCH_DEVNODE                      0x0000000D\n\n#define USB_DEVICE_DESCRIPTOR_TYPE              LIBUSB_DT_DEVICE\n#define USB_CONFIGURATION_DESCRIPTOR_TYPE       LIBUSB_DT_CONFIG\n#define USB_STRING_DESCRIPTOR_TYPE              LIBUSB_DT_STRING\n#define USB_INTERFACE_DESCRIPTOR_TYPE           LIBUSB_DT_INTERFACE\n#define USB_ENDPOINT_DESCRIPTOR_TYPE            LIBUSB_DT_ENDPOINT\n\n#define USB_REQUEST_GET_STATUS                  LIBUSB_REQUEST_GET_STATUS\n#define USB_REQUEST_CLEAR_FEATURE               LIBUSB_REQUEST_CLEAR_FEATURE\n#define USB_REQUEST_SET_FEATURE                 LIBUSB_REQUEST_SET_FEATURE\n#define USB_REQUEST_SET_ADDRESS                 LIBUSB_REQUEST_SET_ADDRESS\n#define USB_REQUEST_GET_DESCRIPTOR              LIBUSB_REQUEST_GET_DESCRIPTOR\n#define USB_REQUEST_SET_DESCRIPTOR              LIBUSB_REQUEST_SET_DESCRIPTOR\n#define USB_REQUEST_GET_CONFIGURATION           LIBUSB_REQUEST_GET_CONFIGURATION\n#define USB_REQUEST_SET_CONFIGURATION           LIBUSB_REQUEST_SET_CONFIGURATION\n#define USB_REQUEST_GET_INTERFACE               LIBUSB_REQUEST_GET_INTERFACE\n#define USB_REQUEST_SET_INTERFACE               LIBUSB_REQUEST_SET_INTERFACE\n#define USB_REQUEST_SYNC_FRAME                  LIBUSB_REQUEST_SYNCH_FRAME\n\n#define USB_GET_NODE_INFORMATION                258\n#define USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION 260\n#define USB_GET_NODE_CONNECTION_NAME            261\n#define USB_GET_HUB_CAPABILITIES                271\n#if !defined(USB_GET_NODE_CONNECTION_INFORMATION_EX)\n#define USB_GET_NODE_CONNECTION_INFORMATION_EX  274\n#endif\n#if !defined(USB_GET_HUB_CAPABILITIES_EX)\n#define USB_GET_HUB_CAPABILITIES_EX             276\n#endif\n\n#ifndef METHOD_BUFFERED\n#define METHOD_BUFFERED                         0\n#endif\n#ifndef FILE_ANY_ACCESS\n#define FILE_ANY_ACCESS                         0x00000000\n#endif\n#ifndef FILE_DEVICE_UNKNOWN\n#define FILE_DEVICE_UNKNOWN                     0x00000022\n#endif\n#ifndef FILE_DEVICE_USB\n#define FILE_DEVICE_USB                         FILE_DEVICE_UNKNOWN\n#endif\n\n#ifndef CTL_CODE\n#define CTL_CODE(DeviceType, Function, Method, Access)( \\\n  ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method))\n#endif\n\ntypedef enum USB_CONNECTION_STATUS {\n\tNoDeviceConnected,\n\tDeviceConnected,\n\tDeviceFailedEnumeration,\n\tDeviceGeneralFailure,\n\tDeviceCausedOvercurrent,\n\tDeviceNotEnoughPower,\n\tDeviceNotEnoughBandwidth,\n\tDeviceHubNestedTooDeeply,\n\tDeviceInLegacyHub\n} USB_CONNECTION_STATUS, *PUSB_CONNECTION_STATUS;\n\ntypedef enum USB_HUB_NODE {\n\tUsbHub,\n\tUsbMIParent\n} USB_HUB_NODE;\n\n/* Cfgmgr32.dll interface */\nDLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Parent, (PDEVINST, DEVINST, ULONG));\nDLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Child, (PDEVINST, DEVINST, ULONG));\nDLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Sibling, (PDEVINST, DEVINST, ULONG));\nDLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Device_IDA, (DEVINST, PCHAR, ULONG, ULONG));\n\n#define IOCTL_USB_GET_HUB_CAPABILITIES_EX \\\n  CTL_CODE( FILE_DEVICE_USB, USB_GET_HUB_CAPABILITIES_EX, METHOD_BUFFERED, FILE_ANY_ACCESS)\n\n#define IOCTL_USB_GET_HUB_CAPABILITIES \\\n  CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_CAPABILITIES, METHOD_BUFFERED, FILE_ANY_ACCESS)\n\n#define IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION \\\n  CTL_CODE(FILE_DEVICE_USB, USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, METHOD_BUFFERED, FILE_ANY_ACCESS)\n\n#define IOCTL_USB_GET_ROOT_HUB_NAME \\\n  CTL_CODE(FILE_DEVICE_USB, HCD_GET_ROOT_HUB_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS)\n\n#define IOCTL_USB_GET_NODE_INFORMATION \\\n  CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_INFORMATION, METHOD_BUFFERED, FILE_ANY_ACCESS)\n\n#define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX \\\n  CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION_EX, METHOD_BUFFERED, FILE_ANY_ACCESS)\n\n#define IOCTL_USB_GET_NODE_CONNECTION_ATTRIBUTES \\\n  CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_ATTRIBUTES, METHOD_BUFFERED, FILE_ANY_ACCESS)\n\n#define IOCTL_USB_GET_NODE_CONNECTION_NAME \\\n  CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS)\n\n// Most of the structures below need to be packed\n#pragma pack(push, 1)\n\ntypedef struct USB_INTERFACE_DESCRIPTOR {\n  UCHAR  bLength;\n  UCHAR  bDescriptorType;\n  UCHAR  bInterfaceNumber;\n  UCHAR  bAlternateSetting;\n  UCHAR  bNumEndpoints;\n  UCHAR  bInterfaceClass;\n  UCHAR  bInterfaceSubClass;\n  UCHAR  bInterfaceProtocol;\n  UCHAR  iInterface;\n} USB_INTERFACE_DESCRIPTOR, *PUSB_INTERFACE_DESCRIPTOR;\n\ntypedef struct USB_CONFIGURATION_DESCRIPTOR {\n  UCHAR  bLength;\n  UCHAR  bDescriptorType;\n  USHORT wTotalLength;\n  UCHAR  bNumInterfaces;\n  UCHAR  bConfigurationValue;\n  UCHAR  iConfiguration;\n  UCHAR  bmAttributes;\n  UCHAR  MaxPower;\n} USB_CONFIGURATION_DESCRIPTOR, *PUSB_CONFIGURATION_DESCRIPTOR;\n\ntypedef struct USB_CONFIGURATION_DESCRIPTOR_SHORT {\n\tstruct {\n\t\tULONG ConnectionIndex;\n\t\tstruct {\n\t\t\tUCHAR bmRequest;\n\t\t\tUCHAR bRequest;\n\t\t\tUSHORT wValue;\n\t\t\tUSHORT wIndex;\n\t\t\tUSHORT wLength;\n\t\t} SetupPacket;\n\t} req;\n\tUSB_CONFIGURATION_DESCRIPTOR data;\n} USB_CONFIGURATION_DESCRIPTOR_SHORT;\n\ntypedef struct USB_ENDPOINT_DESCRIPTOR {\n  UCHAR  bLength;\n  UCHAR  bDescriptorType;\n  UCHAR  bEndpointAddress;\n  UCHAR  bmAttributes;\n  USHORT  wMaxPacketSize;\n  UCHAR  bInterval;\n} USB_ENDPOINT_DESCRIPTOR, *PUSB_ENDPOINT_DESCRIPTOR;\n\ntypedef struct USB_DESCRIPTOR_REQUEST {\n\tULONG  ConnectionIndex;\n\tstruct {\n\t\tUCHAR  bmRequest;\n\t\tUCHAR  bRequest;\n\t\tUSHORT  wValue;\n\t\tUSHORT  wIndex;\n\t\tUSHORT  wLength;\n\t} SetupPacket;\n//\tUCHAR  Data[0];\n} USB_DESCRIPTOR_REQUEST, *PUSB_DESCRIPTOR_REQUEST;\n\ntypedef struct USB_HUB_DESCRIPTOR {\n\tUCHAR  bDescriptorLength;\n\tUCHAR  bDescriptorType;\n\tUCHAR  bNumberOfPorts;\n\tUSHORT  wHubCharacteristics;\n\tUCHAR  bPowerOnToPowerGood;\n\tUCHAR  bHubControlCurrent;\n\tUCHAR  bRemoveAndPowerMask[64];\n} USB_HUB_DESCRIPTOR, *PUSB_HUB_DESCRIPTOR;\n\ntypedef struct USB_ROOT_HUB_NAME {\n\tULONG  ActualLength;\n\tWCHAR  RootHubName[1];\n} USB_ROOT_HUB_NAME, *PUSB_ROOT_HUB_NAME;\n\ntypedef struct USB_ROOT_HUB_NAME_FIXED {\n\tULONG ActualLength;\n\tWCHAR RootHubName[MAX_PATH_LENGTH];\n} USB_ROOT_HUB_NAME_FIXED;\n\ntypedef struct USB_NODE_CONNECTION_NAME {\n\tULONG  ConnectionIndex;\n\tULONG  ActualLength;\n\tWCHAR  NodeName[1];\n} USB_NODE_CONNECTION_NAME, *PUSB_NODE_CONNECTION_NAME;\n\ntypedef struct USB_NODE_CONNECTION_NAME_FIXED {\n\tULONG ConnectionIndex;\n\tULONG ActualLength;\n\tWCHAR NodeName[MAX_PATH_LENGTH];\n} USB_NODE_CONNECTION_NAME_FIXED;\n\ntypedef struct USB_HUB_NAME_FIXED {\n\tunion {\n\t\tUSB_ROOT_HUB_NAME_FIXED root;\n\t\tUSB_NODE_CONNECTION_NAME_FIXED node;\n\t} u;\n} USB_HUB_NAME_FIXED;\n\ntypedef struct USB_HUB_INFORMATION {\n\tUSB_HUB_DESCRIPTOR  HubDescriptor;\n\tBOOLEAN  HubIsBusPowered;\n} USB_HUB_INFORMATION, *PUSB_HUB_INFORMATION;\n\ntypedef struct USB_MI_PARENT_INFORMATION {\n  ULONG  NumberOfInterfaces;\n} USB_MI_PARENT_INFORMATION, *PUSB_MI_PARENT_INFORMATION;\n\ntypedef struct USB_NODE_INFORMATION {\n\tUSB_HUB_NODE  NodeType;\n\tunion {\n\t\tUSB_HUB_INFORMATION  HubInformation;\n\t\tUSB_MI_PARENT_INFORMATION  MiParentInformation;\n\t} u;\n} USB_NODE_INFORMATION, *PUSB_NODE_INFORMATION;\n\ntypedef struct USB_PIPE_INFO {\n\tUSB_ENDPOINT_DESCRIPTOR  EndpointDescriptor;\n\tULONG  ScheduleOffset;\n} USB_PIPE_INFO, *PUSB_PIPE_INFO;\n\ntypedef struct USB_NODE_CONNECTION_INFORMATION_EX {\n\tULONG  ConnectionIndex;\n\tUSB_DEVICE_DESCRIPTOR  DeviceDescriptor;\n\tUCHAR  CurrentConfigurationValue;\n\tUCHAR  Speed;\n\tBOOLEAN  DeviceIsHub;\n\tUSHORT  DeviceAddress;\n\tULONG  NumberOfOpenPipes;\n\tUSB_CONNECTION_STATUS  ConnectionStatus;\n//\tUSB_PIPE_INFO  PipeList[0];\n} USB_NODE_CONNECTION_INFORMATION_EX, *PUSB_NODE_CONNECTION_INFORMATION_EX;\n\ntypedef struct USB_HUB_CAP_FLAGS {\n\tULONG HubIsHighSpeedCapable:1;\n\tULONG HubIsHighSpeed:1;\n\tULONG HubIsMultiTtCapable:1;\n\tULONG HubIsMultiTt:1;\n\tULONG HubIsRoot:1;\n\tULONG HubIsArmedWakeOnConnect:1;\n\tULONG ReservedMBZ:26;\n} USB_HUB_CAP_FLAGS, *PUSB_HUB_CAP_FLAGS;\n\ntypedef struct USB_HUB_CAPABILITIES {\n  ULONG  HubIs2xCapable : 1;\n} USB_HUB_CAPABILITIES, *PUSB_HUB_CAPABILITIES;\n\ntypedef struct USB_HUB_CAPABILITIES_EX {\n\tUSB_HUB_CAP_FLAGS CapabilityFlags;\n} USB_HUB_CAPABILITIES_EX, *PUSB_HUB_CAPABILITIES_EX;\n\n#pragma pack(pop)\n\n/* winusb.dll interface */\n\n#define SHORT_PACKET_TERMINATE  0x01\n#define AUTO_CLEAR_STALL        0x02\n#define PIPE_TRANSFER_TIMEOUT   0x03\n#define IGNORE_SHORT_PACKETS    0x04\n#define ALLOW_PARTIAL_READS     0x05\n#define AUTO_FLUSH              0x06\n#define RAW_IO                  0x07\n#define MAXIMUM_TRANSFER_SIZE   0x08\n#define AUTO_SUSPEND            0x81\n#define SUSPEND_DELAY           0x83\n#define DEVICE_SPEED            0x01\n#define LowSpeed                0x01\n#define FullSpeed               0x02\n#define HighSpeed               0x03\n\ntypedef enum USBD_PIPE_TYPE {\n\tUsbdPipeTypeControl,\n\tUsbdPipeTypeIsochronous,\n\tUsbdPipeTypeBulk,\n\tUsbdPipeTypeInterrupt\n} USBD_PIPE_TYPE;\n\ntypedef struct {\n  USBD_PIPE_TYPE PipeType;\n  UCHAR          PipeId;\n  USHORT         MaximumPacketSize;\n  UCHAR          Interval;\n} WINUSB_PIPE_INFORMATION, *PWINUSB_PIPE_INFORMATION;\n\n#pragma pack(1)\ntypedef struct {\n  UCHAR  request_type;\n  UCHAR  request;\n  USHORT value;\n  USHORT index;\n  USHORT length;\n} WINUSB_SETUP_PACKET, *PWINUSB_SETUP_PACKET;\n#pragma pack()\n\ntypedef void *WINUSB_INTERFACE_HANDLE, *PWINUSB_INTERFACE_HANDLE;\n\ntypedef BOOL (WINAPI *WinUsb_AbortPipe_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tUCHAR PipeID\n);\ntypedef BOOL (WINAPI *WinUsb_ControlTransfer_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tWINUSB_SETUP_PACKET SetupPacket,\n\tPUCHAR Buffer,\n\tULONG BufferLength,\n\tPULONG LengthTransferred,\n\tLPOVERLAPPED Overlapped\n);\ntypedef BOOL (WINAPI *WinUsb_FlushPipe_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tUCHAR PipeID\n);\ntypedef BOOL (WINAPI *WinUsb_Free_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle\n);\ntypedef BOOL (WINAPI *WinUsb_GetAssociatedInterface_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tUCHAR AssociatedInterfaceIndex,\n\tPWINUSB_INTERFACE_HANDLE AssociatedInterfaceHandle\n);\ntypedef BOOL (WINAPI *WinUsb_GetCurrentAlternateSetting_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tPUCHAR AlternateSetting\n);\ntypedef BOOL (WINAPI *WinUsb_GetDescriptor_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tUCHAR DescriptorType,\n\tUCHAR Index,\n\tUSHORT LanguageID,\n\tPUCHAR Buffer,\n\tULONG BufferLength,\n\tPULONG LengthTransferred\n);\ntypedef BOOL (WINAPI *WinUsb_GetOverlappedResult_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tLPOVERLAPPED lpOverlapped,\n\tLPDWORD lpNumberOfBytesTransferred,\n\tBOOL bWait\n);\ntypedef BOOL (WINAPI *WinUsb_GetPipePolicy_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tUCHAR PipeID,\n\tULONG PolicyType,\n\tPULONG ValueLength,\n\tPVOID Value\n);\ntypedef BOOL (WINAPI *WinUsb_GetPowerPolicy_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tULONG PolicyType,\n\tPULONG ValueLength,\n\tPVOID Value\n);\ntypedef BOOL (WINAPI *WinUsb_Initialize_t)(\n\tHANDLE DeviceHandle,\n\tPWINUSB_INTERFACE_HANDLE InterfaceHandle\n);\ntypedef BOOL (WINAPI *WinUsb_QueryDeviceInformation_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tULONG InformationType,\n\tPULONG BufferLength,\n\tPVOID Buffer\n);\ntypedef BOOL (WINAPI *WinUsb_QueryInterfaceSettings_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tUCHAR AlternateSettingNumber,\n\tPUSB_INTERFACE_DESCRIPTOR UsbAltInterfaceDescriptor\n);\ntypedef BOOL (WINAPI *WinUsb_QueryPipe_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tUCHAR AlternateInterfaceNumber,\n\tUCHAR PipeIndex,\n\tPWINUSB_PIPE_INFORMATION PipeInformation\n);\ntypedef BOOL (WINAPI *WinUsb_ReadPipe_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tUCHAR PipeID,\n\tPUCHAR Buffer,\n\tULONG BufferLength,\n\tPULONG LengthTransferred,\n\tLPOVERLAPPED Overlapped\n);\ntypedef BOOL (WINAPI *WinUsb_ResetPipe_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tUCHAR PipeID\n);\ntypedef BOOL (WINAPI *WinUsb_SetCurrentAlternateSetting_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tUCHAR AlternateSetting\n);\ntypedef BOOL (WINAPI *WinUsb_SetPipePolicy_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tUCHAR PipeID,\n\tULONG PolicyType,\n\tULONG ValueLength,\n\tPVOID Value\n);\ntypedef BOOL (WINAPI *WinUsb_SetPowerPolicy_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tULONG PolicyType,\n\tULONG ValueLength,\n\tPVOID Value\n);\ntypedef BOOL (WINAPI *WinUsb_WritePipe_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle,\n\tUCHAR PipeID,\n\tPUCHAR Buffer,\n\tULONG BufferLength,\n\tPULONG LengthTransferred,\n\tLPOVERLAPPED Overlapped\n);\ntypedef BOOL (WINAPI *WinUsb_ResetDevice_t)(\n\tWINUSB_INTERFACE_HANDLE InterfaceHandle\n);\n\n/* /!\\ These must match the ones from the official libusbk.h */\ntypedef enum _KUSB_FNID\n{\n\tKUSB_FNID_Init,\n\tKUSB_FNID_Free,\n\tKUSB_FNID_ClaimInterface,\n\tKUSB_FNID_ReleaseInterface,\n\tKUSB_FNID_SetAltInterface,\n\tKUSB_FNID_GetAltInterface,\n\tKUSB_FNID_GetDescriptor,\n\tKUSB_FNID_ControlTransfer,\n\tKUSB_FNID_SetPowerPolicy,\n\tKUSB_FNID_GetPowerPolicy,\n\tKUSB_FNID_SetConfiguration,\n\tKUSB_FNID_GetConfiguration,\n\tKUSB_FNID_ResetDevice,\n\tKUSB_FNID_Initialize,\n\tKUSB_FNID_SelectInterface,\n\tKUSB_FNID_GetAssociatedInterface,\n\tKUSB_FNID_Clone,\n\tKUSB_FNID_QueryInterfaceSettings,\n\tKUSB_FNID_QueryDeviceInformation,\n\tKUSB_FNID_SetCurrentAlternateSetting,\n\tKUSB_FNID_GetCurrentAlternateSetting,\n\tKUSB_FNID_QueryPipe,\n\tKUSB_FNID_SetPipePolicy,\n\tKUSB_FNID_GetPipePolicy,\n\tKUSB_FNID_ReadPipe,\n\tKUSB_FNID_WritePipe,\n\tKUSB_FNID_ResetPipe,\n\tKUSB_FNID_AbortPipe,\n\tKUSB_FNID_FlushPipe,\n\tKUSB_FNID_IsoReadPipe,\n\tKUSB_FNID_IsoWritePipe,\n\tKUSB_FNID_GetCurrentFrameNumber,\n\tKUSB_FNID_GetOverlappedResult,\n\tKUSB_FNID_GetProperty,\n\tKUSB_FNID_COUNT,\n} KUSB_FNID; \n\ntypedef struct _KLIB_VERSION {\n\tINT Major;\n\tINT Minor;\n\tINT Micro;\n\tINT Nano;\n} KLIB_VERSION;\ntypedef KLIB_VERSION* PKLIB_VERSION;\n\ntypedef BOOL (WINAPI *LibK_GetProcAddress_t)(\n\tPVOID* ProcAddress,\n\tULONG DriverID,\n\tULONG FunctionID\n);\n\ntypedef VOID (WINAPI *LibK_GetVersion_t)(\n\tPKLIB_VERSION Version\n);\n\nstruct winusb_interface {\n\tbool initialized;\n\tWinUsb_AbortPipe_t AbortPipe;\n\tWinUsb_ControlTransfer_t ControlTransfer;\n\tWinUsb_FlushPipe_t FlushPipe;\n\tWinUsb_Free_t Free;\n\tWinUsb_GetAssociatedInterface_t GetAssociatedInterface;\n\tWinUsb_GetCurrentAlternateSetting_t GetCurrentAlternateSetting;\n\tWinUsb_GetDescriptor_t GetDescriptor;\n\tWinUsb_GetOverlappedResult_t GetOverlappedResult;\n\tWinUsb_GetPipePolicy_t GetPipePolicy;\n\tWinUsb_GetPowerPolicy_t GetPowerPolicy;\n\tWinUsb_Initialize_t Initialize;\n\tWinUsb_QueryDeviceInformation_t QueryDeviceInformation;\n\tWinUsb_QueryInterfaceSettings_t QueryInterfaceSettings;\n\tWinUsb_QueryPipe_t QueryPipe;\n\tWinUsb_ReadPipe_t ReadPipe;\n\tWinUsb_ResetPipe_t ResetPipe;\n\tWinUsb_SetCurrentAlternateSetting_t SetCurrentAlternateSetting;\n\tWinUsb_SetPipePolicy_t SetPipePolicy;\n\tWinUsb_SetPowerPolicy_t SetPowerPolicy;\n\tWinUsb_WritePipe_t WritePipe;\n\tWinUsb_ResetDevice_t ResetDevice;\n};\n\n/* hid.dll interface */\n\n#define HIDP_STATUS_SUCCESS  0x110000\ntypedef void* PHIDP_PREPARSED_DATA;\n\n#pragma pack(1)\ntypedef struct {\n\tULONG Size;\n\tUSHORT VendorID;\n\tUSHORT ProductID;\n\tUSHORT VersionNumber;\n} HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES;\n#pragma pack()\n\ntypedef USHORT USAGE;\ntypedef struct {\n  USAGE Usage;\n  USAGE UsagePage;\n  USHORT InputReportByteLength;\n  USHORT OutputReportByteLength;\n  USHORT FeatureReportByteLength;\n  USHORT Reserved[17];\n  USHORT NumberLinkCollectionNodes;\n  USHORT NumberInputButtonCaps;\n  USHORT NumberInputValueCaps;\n  USHORT NumberInputDataIndices;\n  USHORT NumberOutputButtonCaps;\n  USHORT NumberOutputValueCaps;\n  USHORT NumberOutputDataIndices;\n  USHORT NumberFeatureButtonCaps;\n  USHORT NumberFeatureValueCaps;\n  USHORT NumberFeatureDataIndices;\n} HIDP_CAPS, *PHIDP_CAPS;\n\ntypedef enum _HIDP_REPORT_TYPE {\n  HidP_Input,\n  HidP_Output,\n  HidP_Feature\n} HIDP_REPORT_TYPE;\n\ntypedef struct _HIDP_VALUE_CAPS {\n  USAGE  UsagePage;\n  UCHAR  ReportID;\n  BOOLEAN  IsAlias;\n  USHORT  BitField;\n  USHORT  LinkCollection;\n  USAGE  LinkUsage;\n  USAGE  LinkUsagePage;\n  BOOLEAN  IsRange;\n  BOOLEAN  IsStringRange;\n  BOOLEAN  IsDesignatorRange;\n  BOOLEAN  IsAbsolute;\n  BOOLEAN  HasNull;\n  UCHAR  Reserved;\n  USHORT  BitSize;\n  USHORT  ReportCount;\n  USHORT  Reserved2[5];\n  ULONG  UnitsExp;\n  ULONG  Units;\n  LONG  LogicalMin, LogicalMax;\n  LONG  PhysicalMin, PhysicalMax;\n\tunion {\n\t  struct {\n\t\tUSAGE  UsageMin, UsageMax;\n\t\tUSHORT  StringMin, StringMax;\n\t\tUSHORT  DesignatorMin, DesignatorMax;\n\t\tUSHORT  DataIndexMin, DataIndexMax;\n\t  } Range;\n\t  struct {\n\t\tUSAGE  Usage, Reserved1;\n\t\tUSHORT  StringIndex, Reserved2;\n\t\tUSHORT  DesignatorIndex, Reserved3;\n\t\tUSHORT  DataIndex, Reserved4;\n\t  } NotRange;\n\t} u;\n} HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS;\n\nDLL_DECLARE(WINAPI, BOOL, HidD_GetAttributes, (HANDLE, PHIDD_ATTRIBUTES));\nDLL_DECLARE(WINAPI, VOID, HidD_GetHidGuid, (LPGUID));\nDLL_DECLARE(WINAPI, BOOL, HidD_GetPreparsedData, (HANDLE, PHIDP_PREPARSED_DATA *));\nDLL_DECLARE(WINAPI, BOOL, HidD_FreePreparsedData, (PHIDP_PREPARSED_DATA));\nDLL_DECLARE(WINAPI, BOOL, HidD_GetManufacturerString, (HANDLE, PVOID, ULONG));\nDLL_DECLARE(WINAPI, BOOL, HidD_GetProductString, (HANDLE, PVOID, ULONG));\nDLL_DECLARE(WINAPI, BOOL, HidD_GetSerialNumberString, (HANDLE, PVOID, ULONG));\nDLL_DECLARE(WINAPI, LONG, HidP_GetCaps, (PHIDP_PREPARSED_DATA, PHIDP_CAPS));\nDLL_DECLARE(WINAPI, BOOL, HidD_SetNumInputBuffers, (HANDLE, ULONG));\nDLL_DECLARE(WINAPI, BOOL, HidD_SetFeature, (HANDLE, PVOID, ULONG));\nDLL_DECLARE(WINAPI, BOOL, HidD_GetFeature, (HANDLE, PVOID, ULONG));\nDLL_DECLARE(WINAPI, BOOL, HidD_GetPhysicalDescriptor, (HANDLE, PVOID, ULONG));\nDLL_DECLARE(WINAPI, BOOL, HidD_GetInputReport, (HANDLE, PVOID, ULONG));\nDLL_DECLARE(WINAPI, BOOL, HidD_SetOutputReport, (HANDLE, PVOID, ULONG));\nDLL_DECLARE(WINAPI, BOOL, HidD_FlushQueue, (HANDLE));\nDLL_DECLARE(WINAPI, BOOL, HidP_GetValueCaps, (HIDP_REPORT_TYPE, PHIDP_VALUE_CAPS, PULONG, PHIDP_PREPARSED_DATA));\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/strerror.c",
    "content": "/*\n * libusb strerror code\n * Copyright © 2013 Hans de Goede <hdegoede@redhat.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n#include \"config.h\"\n\n#include <locale.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"libusb.h\"\n#include \"libusbi.h\"\n\n#if defined(_MSC_VER)\n#define strncasecmp _strnicmp\n#endif\n\nstatic size_t usbi_locale = 0;\n\n/** \\ingroup misc\n * How to add a new \\ref libusb_strerror() translation:\n * <ol>\n * <li> Download the latest \\c strerror.c from:<br>\n *      https://raw.github.com/libusb/libusb/master/libusb/sterror.c </li>\n * <li> Open the file in an UTF-8 capable editor </li>\n * <li> Add the 2 letter <a href=\"http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO 639-1</a>\n *      code for your locale at the end of \\c usbi_locale_supported[]<br>\n *    Eg. for Chinese, you would add \"zh\" so that:\n *    \\code... usbi_locale_supported[] = { \"en\", \"nl\", \"fr\" };\\endcode\n *    becomes:\n *    \\code... usbi_locale_supported[] = { \"en\", \"nl\", \"fr\", \"zh\" };\\endcode </li>\n * <li> Copy the <tt>{ / * English (en) * / ... }</tt> section and add it at the end of \\c usbi_localized_errors<br>\n *    Eg. for Chinese, the last section of \\c usbi_localized_errors could look like:\n *    \\code\n *     }, { / * Chinese (zh) * /\n *         \"Success\",\n *         ...\n *         \"Other error\",\n *     }\n * };\\endcode </li>\n * <li> Translate each of the English messages from the section you copied into your language </li>\n * <li> Save the file (in UTF-8 format) and send it to \\c libusb-devel\\@lists.sourceforge.net </li>\n * </ol>\n */\n\nstatic const char* usbi_locale_supported[] = { \"en\", \"nl\", \"fr\", \"ru\" };\nstatic const char* usbi_localized_errors[ARRAYSIZE(usbi_locale_supported)][LIBUSB_ERROR_COUNT] = {\n\t{ /* English (en) */\n\t\t\"Success\",\n\t\t\"Input/Output Error\",\n\t\t\"Invalid parameter\",\n\t\t\"Access denied (insufficient permissions)\",\n\t\t\"No such device (it may have been disconnected)\",\n\t\t\"Entity not found\",\n\t\t\"Resource busy\",\n\t\t\"Operation timed out\",\n\t\t\"Overflow\",\n\t\t\"Pipe error\",\n\t\t\"System call interrupted (perhaps due to signal)\",\n\t\t\"Insufficient memory\",\n\t\t\"Operation not supported or unimplemented on this platform\",\n\t\t\"Other error\",\n\t}, { /* Dutch (nl) */\n\t\t\"Gelukt\",\n\t\t\"Invoer-/uitvoerfout\",\n\t\t\"Ongeldig argument\",\n\t\t\"Toegang geweigerd (onvoldoende toegangsrechten)\",\n\t\t\"Apparaat bestaat niet (verbinding met apparaat verbroken?)\",\n\t\t\"Niet gevonden\",\n\t\t\"Apparaat of hulpbron is bezig\",\n\t\t\"Bewerking verlopen\",\n\t\t\"Waarde is te groot\",\n\t\t\"Gebroken pijp\",\n\t\t\"Onderbroken systeemaanroep\",\n\t\t\"Onvoldoende geheugen beschikbaar\",\n\t\t\"Bewerking wordt niet ondersteund\",\n\t\t\"Andere fout\",\n\t}, { /* French (fr) */\n\t\t\"Succès\",\n\t\t\"Erreur d'entrée/sortie\",\n\t\t\"Paramètre invalide\",\n\t\t\"Accès refusé (permissions insuffisantes)\",\n\t\t\"Périphérique introuvable (peut-être déconnecté)\",\n\t\t\"Elément introuvable\",\n\t\t\"Resource déjà occupée\",\n\t\t\"Operation expirée\",\n\t\t\"Débordement\",\n\t\t\"Erreur de pipe\",\n\t\t\"Appel système abandonné (peut-être à cause d’un signal)\",\n\t\t\"Mémoire insuffisante\",\n\t\t\"Opération non supportée or non implémentée sur cette plateforme\",\n\t\t\"Autre erreur\",\n\t}, { /* Russian (ru) */\n\t\t\"Успех\",\n\t\t\"Ошибка ввода/вывода\",\n\t\t\"Неверный параметр\",\n\t\t\"Доступ запрещён (не хватает прав)\",\n\t\t\"Устройство отсутствует (возможно, оно было отсоединено)\",\n\t\t\"Элемент не найден\",\n\t\t\"Ресурс занят\",\n\t\t\"Истекло время ожидания операции\",\n\t\t\"Переполнение\",\n\t\t\"Ошибка канала\",\n\t\t\"Системный вызов прерван (возможно, сигналом)\",\n\t\t\"Память исчерпана\",\n\t\t\"Операция не поддерживается данной платформой\",\n\t\t\"Неизвестная ошибка\"\n\t}\n};\n\n/** \\ingroup misc\n * Set the language, and only the language, not the encoding! used for\n * translatable libusb messages.\n *\n * This takes a locale string in the default setlocale format: lang[-region]\n * or lang[_country_region][.codeset]. Only the lang part of the string is\n * used, and only 2 letter ISO 639-1 codes are accepted for it, such as \"de\".\n * The optional region, country_region or codeset parts are ignored. This\n * means that functions which return translatable strings will NOT honor the\n * specified encoding. \n * All strings returned are encoded as UTF-8 strings.\n *\n * If libusb_setlocale() is not called, all messages will be in English.\n *\n * The following functions return translatable strings: libusb_strerror().\n * Note that the libusb log messages controlled through libusb_set_debug()\n * are not translated, they are always in English.\n *\n * For POSIX UTF-8 environments if you want libusb to follow the standard\n * locale settings, call libusb_setlocale(setlocale(LC_MESSAGES, NULL)),\n * after your app has done its locale setup.\n *\n * \\param locale locale-string in the form of lang[_country_region][.codeset]\n * or lang[-region], where lang is a 2 letter ISO 639-1 code\n * \\returns LIBUSB_SUCCESS on success\n * \\returns LIBUSB_ERROR_INVALID_PARAM if the locale doesn't meet the requirements\n * \\returns LIBUSB_ERROR_NOT_FOUND if the requested language is not supported\n * \\returns a LIBUSB_ERROR code on other errors\n */\n\nint API_EXPORTED libusb_setlocale(const char *locale)\n{\n\tsize_t i;\n\n\tif ( (locale == NULL) || (strlen(locale) < 2)\n\t  || ((strlen(locale) > 2) && (locale[2] != '-') && (locale[2] != '_') && (locale[2] != '.')) )\n\t\treturn LIBUSB_ERROR_INVALID_PARAM;\n\n\tfor (i=0; i<ARRAYSIZE(usbi_locale_supported); i++) {\n\t\tif (strncasecmp(usbi_locale_supported[i], locale, 2) == 0)\n\t\t\tbreak;\n\t}\n\tif (i >= ARRAYSIZE(usbi_locale_supported)) {\n\t\treturn LIBUSB_ERROR_NOT_FOUND;\n\t}\n\n\tusbi_locale = i;\n\n\treturn LIBUSB_SUCCESS;\n}\n\n/** \\ingroup misc\n * Returns a constant string with a short description of the given error code,\n * this description is intended for displaying to the end user and will be in\n * the language set by libusb_setlocale().\n *\n * The returned string is encoded in UTF-8.\n *\n * The messages always start with a capital letter and end without any dot.\n * The caller must not free() the returned string.\n *\n * \\param errcode the error code whose description is desired\n * \\returns a short description of the error code in UTF-8 encoding\n */\nDEFAULT_VISIBILITY const char* LIBUSB_CALL libusb_strerror(enum libusb_error errcode)\n{\n\tint errcode_index = -errcode;\n\n\tif ((errcode_index < 0) || (errcode_index >= LIBUSB_ERROR_COUNT)) {\n\t\t/* \"Other Error\", which should always be our last message, is returned */\n\t\terrcode_index = LIBUSB_ERROR_COUNT - 1;\n\t}\n\n\treturn usbi_localized_errors[usbi_locale][errcode_index];\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/sync.c",
    "content": "/*\n * Synchronous I/O functions for libusb\n * Copyright © 2007-2008 Daniel Drake <dsd@gentoo.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"config.h\"\n#include <errno.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"libusbi.h\"\n\n/**\n * @defgroup syncio Synchronous device I/O\n *\n * This page documents libusb's synchronous (blocking) API for USB device I/O.\n * This interface is easy to use but has some limitations. More advanced users\n * may wish to consider using the \\ref asyncio \"asynchronous I/O API\" instead.\n */\n\nstatic void LIBUSB_CALL sync_transfer_cb(struct libusb_transfer *transfer)\n{\n\tint *completed = transfer->user_data;\n\t*completed = 1;\n\tusbi_dbg(\"actual_length=%d\", transfer->actual_length);\n\t/* caller interprets result and frees transfer */\n}\n\nstatic void sync_transfer_wait_for_completion(struct libusb_transfer *transfer)\n{\n\tint r, *completed = transfer->user_data;\n\tstruct libusb_context *ctx = HANDLE_CTX(transfer->dev_handle);\n\n\twhile (!*completed) {\n\t\tr = libusb_handle_events_completed(ctx, completed);\n\t\tif (UNLIKELY(r < 0)) {\n\t\t\tif (r == LIBUSB_ERROR_INTERRUPTED)\n\t\t\t\tcontinue;\n\t\t\tusbi_err(ctx, \"libusb_handle_events failed: %s, cancelling transfer and retrying\",\n\t\t\t\t libusb_error_name(r));\n\t\t\tlibusb_cancel_transfer(transfer);\n\t\t\tcontinue;\n\t\t}\n\t}\n}\n\n/** \\ingroup syncio\n * Perform a USB control transfer.\n *\n * The direction of the transfer is inferred from the bmRequestType field of\n * the setup packet.\n *\n * The wValue, wIndex and wLength fields values should be given in host-endian\n * byte order.\n *\n * \\param dev_handle a handle for the device to communicate with\n * \\param bmRequestType the request type field for the setup packet\n * \\param bRequest the request field for the setup packet\n * \\param wValue the value field for the setup packet\n * \\param wIndex the index field for the setup packet\n * \\param data a suitably-sized data buffer for either input or output\n * (depending on direction bits within bmRequestType)\n * \\param wLength the length field for the setup packet. The data buffer should\n * be at least this size.\n * \\param timeout timeout (in millseconds) that this function should wait\n * before giving up due to no response being received. For an unlimited\n * timeout, use value 0.\n * \\returns on success, the number of bytes actually transferred\n * \\returns LIBUSB_ERROR_TIMEOUT if the transfer timed out\n * \\returns LIBUSB_ERROR_PIPE if the control request was not supported by the\n * device\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failures\n */\nint API_EXPORTED libusb_control_transfer(libusb_device_handle *dev_handle,\n\tuint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,\n\tunsigned char *data, uint16_t wLength, unsigned int timeout)\n{\n\tstruct libusb_transfer *transfer = libusb_alloc_transfer(0);\n\tunsigned char *buffer;\n\tint completed = 0;\n\tint r;\n\n\tif (UNLIKELY(!transfer))\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tbuffer = (unsigned char*) malloc(LIBUSB_CONTROL_SETUP_SIZE + wLength);\n\tif (UNLIKELY(!buffer)) {\n\t\tlibusb_free_transfer(transfer);\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\tlibusb_fill_control_setup(buffer, bmRequestType, bRequest, wValue, wIndex, wLength);\n\tif ((bmRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT)\n\t\tmemcpy(buffer + LIBUSB_CONTROL_SETUP_SIZE, data, wLength);\n\n\tlibusb_fill_control_transfer(transfer, dev_handle, buffer,\n\t\tsync_transfer_cb, &completed, timeout);\n\ttransfer->flags = LIBUSB_TRANSFER_FREE_BUFFER;\n\tr = libusb_submit_transfer(transfer);\n\tif (UNLIKELY(r < 0)) {\n\t\tlibusb_free_transfer(transfer);\n\t\treturn r;\n\t}\n\n\tsync_transfer_wait_for_completion(transfer);\n\n\tif ((bmRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN)\n\t\tmemcpy(data, libusb_control_transfer_get_data(transfer),\n\t\t\ttransfer->actual_length);\n\n\tswitch (transfer->status) {\n\tcase LIBUSB_TRANSFER_COMPLETED:\n\t\tr = transfer->actual_length;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_TIMED_OUT:\n\t\tr = LIBUSB_ERROR_TIMEOUT;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_STALL:\n\t\tr = LIBUSB_ERROR_PIPE;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_NO_DEVICE:\n\t\tr = LIBUSB_ERROR_NO_DEVICE;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_OVERFLOW:\n\t\tr = LIBUSB_ERROR_OVERFLOW;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_ERROR:\n\tcase LIBUSB_TRANSFER_CANCELLED:\n\t\tr = LIBUSB_ERROR_IO;\n\t\tbreak;\n\tdefault:\n\t\tusbi_warn(HANDLE_CTX(dev_handle),\n\t\t\t\"unrecognised status code %d\", transfer->status);\n\t\tr = LIBUSB_ERROR_OTHER;\n\t}\n\n\tlibusb_free_transfer(transfer);\n\treturn r;\n}\n\nstatic int do_sync_bulk_transfer(struct libusb_device_handle *dev_handle,\n\tunsigned char endpoint, unsigned char *buffer, int length,\n\tint *transferred, unsigned int timeout, unsigned char type)\n{\n\tstruct libusb_transfer *transfer = libusb_alloc_transfer(0);\n\tint completed = 0;\n\tint r;\n\n\tif (UNLIKELY(!transfer))\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tlibusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer, length,\n\t\tsync_transfer_cb, &completed, timeout);\n\ttransfer->type = type;\n\n\tr = libusb_submit_transfer(transfer);\n\tif (UNLIKELY(r < 0)) {\n\t\tlibusb_free_transfer(transfer);\n\t\treturn r;\n\t}\n\n\tsync_transfer_wait_for_completion(transfer);\n\n\t*transferred = transfer->actual_length;\n\tswitch (transfer->status) {\n\tcase LIBUSB_TRANSFER_COMPLETED:\n\t\tr = 0;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_TIMED_OUT:\n\t\tr = LIBUSB_ERROR_TIMEOUT;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_STALL:\n\t\tr = LIBUSB_ERROR_PIPE;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_OVERFLOW:\n\t\tr = LIBUSB_ERROR_OVERFLOW;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_NO_DEVICE:\n\t\tr = LIBUSB_ERROR_NO_DEVICE;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_ERROR:\n\tcase LIBUSB_TRANSFER_CANCELLED:\n\t\tr = LIBUSB_ERROR_IO;\n\t\tbreak;\n\tdefault:\n\t\tusbi_warn(HANDLE_CTX(dev_handle),\n\t\t\t\"unrecognised status code %d\", transfer->status);\n\t\tr = LIBUSB_ERROR_OTHER;\n\t}\n\n\tlibusb_free_transfer(transfer);\n\treturn r;\n}\n\n/** \\ingroup syncio\n * Perform a USB bulk transfer. The direction of the transfer is inferred from\n * the direction bits of the endpoint address.\n *\n * For bulk reads, the <tt>length</tt> field indicates the maximum length of\n * data you are expecting to receive. If less data arrives than expected,\n * this function will return that data, so be sure to check the\n * <tt>transferred</tt> output parameter.\n *\n * You should also check the <tt>transferred</tt> parameter for bulk writes.\n * Not all of the data may have been written.\n *\n * Also check <tt>transferred</tt> when dealing with a timeout error code.\n * libusb may have to split your transfer into a number of chunks to satisfy\n * underlying O/S requirements, meaning that the timeout may expire after\n * the first few chunks have completed. libusb is careful not to lose any data\n * that may have been transferred; do not assume that timeout conditions\n * indicate a complete lack of I/O.\n *\n * \\param dev_handle a handle for the device to communicate with\n * \\param endpoint the address of a valid endpoint to communicate with\n * \\param data a suitably-sized data buffer for either input or output\n * (depending on endpoint)\n * \\param length for bulk writes, the number of bytes from data to be sent. for\n * bulk reads, the maximum number of bytes to receive into the data buffer.\n * \\param transferred output location for the number of bytes actually\n * transferred.\n * \\param timeout timeout (in millseconds) that this function should wait\n * before giving up due to no response being received. For an unlimited\n * timeout, use value 0.\n *\n * \\returns 0 on success (and populates <tt>transferred</tt>)\n * \\returns LIBUSB_ERROR_TIMEOUT if the transfer timed out (and populates\n * <tt>transferred</tt>)\n * \\returns LIBUSB_ERROR_PIPE if the endpoint halted\n * \\returns LIBUSB_ERROR_OVERFLOW if the device offered more data, see\n * \\ref packetoverflow\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failures\n */\nint API_EXPORTED libusb_bulk_transfer(struct libusb_device_handle *dev_handle,\n\tunsigned char endpoint, unsigned char *data, int length, int *transferred,\n\tunsigned int timeout)\n{\n\treturn do_sync_bulk_transfer(dev_handle, endpoint, data, length,\n\t\ttransferred, timeout, LIBUSB_TRANSFER_TYPE_BULK);\n}\n\n/** \\ingroup syncio\n * Perform a USB interrupt transfer. The direction of the transfer is inferred\n * from the direction bits of the endpoint address.\n *\n * For interrupt reads, the <tt>length</tt> field indicates the maximum length\n * of data you are expecting to receive. If less data arrives than expected,\n * this function will return that data, so be sure to check the\n * <tt>transferred</tt> output parameter.\n *\n * You should also check the <tt>transferred</tt> parameter for interrupt\n * writes. Not all of the data may have been written.\n *\n * Also check <tt>transferred</tt> when dealing with a timeout error code.\n * libusb may have to split your transfer into a number of chunks to satisfy\n * underlying O/S requirements, meaning that the timeout may expire after\n * the first few chunks have completed. libusb is careful not to lose any data\n * that may have been transferred; do not assume that timeout conditions\n * indicate a complete lack of I/O.\n *\n * The default endpoint bInterval value is used as the polling interval.\n *\n * \\param dev_handle a handle for the device to communicate with\n * \\param endpoint the address of a valid endpoint to communicate with\n * \\param data a suitably-sized data buffer for either input or output\n * (depending on endpoint)\n * \\param length for bulk writes, the number of bytes from data to be sent. for\n * bulk reads, the maximum number of bytes to receive into the data buffer.\n * \\param transferred output location for the number of bytes actually\n * transferred.\n * \\param timeout timeout (in millseconds) that this function should wait\n * before giving up due to no response being received. For an unlimited\n * timeout, use value 0.\n *\n * \\returns 0 on success (and populates <tt>transferred</tt>)\n * \\returns LIBUSB_ERROR_TIMEOUT if the transfer timed out\n * \\returns LIBUSB_ERROR_PIPE if the endpoint halted\n * \\returns LIBUSB_ERROR_OVERFLOW if the device offered more data, see\n * \\ref packetoverflow\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other error\n */\nint API_EXPORTED libusb_interrupt_transfer(\n\tstruct libusb_device_handle *dev_handle, unsigned char endpoint,\n\tunsigned char *data, int length, int *transferred, unsigned int timeout)\n{\n\treturn do_sync_bulk_transfer(dev_handle, endpoint, data, length,\n\t\ttransferred, timeout, LIBUSB_TRANSFER_TYPE_INTERRUPT);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/sync_original.c",
    "content": "/*\n * Synchronous I/O functions for libusb\n * Copyright © 2007-2008 Daniel Drake <dsd@gentoo.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"config.h\"\n#include <errno.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"libusbi.h\"\n\n/**\n * @defgroup syncio Synchronous device I/O\n *\n * This page documents libusb's synchronous (blocking) API for USB device I/O.\n * This interface is easy to use but has some limitations. More advanced users\n * may wish to consider using the \\ref asyncio \"asynchronous I/O API\" instead.\n */\n\nstatic void LIBUSB_CALL sync_transfer_cb(struct libusb_transfer *transfer)\n{\n\tint *completed = transfer->user_data;\n\t*completed = 1;\n\tusbi_dbg(\"actual_length=%d\", transfer->actual_length);\n\t/* caller interprets result and frees transfer */\n}\n\nstatic void sync_transfer_wait_for_completion(struct libusb_transfer *transfer)\n{\n\tint r, *completed = transfer->user_data;\n\tstruct libusb_context *ctx = HANDLE_CTX(transfer->dev_handle);\n\n\twhile (!*completed) {\n\t\tr = libusb_handle_events_completed(ctx, completed);\n\t\tif (r < 0) {\n\t\t\tif (r == LIBUSB_ERROR_INTERRUPTED)\n\t\t\t\tcontinue;\n\t\t\tusbi_err(ctx, \"libusb_handle_events failed: %s, cancelling transfer and retrying\",\n\t\t\t\t libusb_error_name(r));\n\t\t\tlibusb_cancel_transfer(transfer);\n\t\t\tcontinue;\n\t\t}\n\t}\n}\n\n/** \\ingroup syncio\n * Perform a USB control transfer.\n *\n * The direction of the transfer is inferred from the bmRequestType field of\n * the setup packet.\n *\n * The wValue, wIndex and wLength fields values should be given in host-endian\n * byte order.\n *\n * \\param dev_handle a handle for the device to communicate with\n * \\param bmRequestType the request type field for the setup packet\n * \\param bRequest the request field for the setup packet\n * \\param wValue the value field for the setup packet\n * \\param wIndex the index field for the setup packet\n * \\param data a suitably-sized data buffer for either input or output\n * (depending on direction bits within bmRequestType)\n * \\param wLength the length field for the setup packet. The data buffer should\n * be at least this size.\n * \\param timeout timeout (in millseconds) that this function should wait\n * before giving up due to no response being received. For an unlimited\n * timeout, use value 0.\n * \\returns on success, the number of bytes actually transferred\n * \\returns LIBUSB_ERROR_TIMEOUT if the transfer timed out\n * \\returns LIBUSB_ERROR_PIPE if the control request was not supported by the\n * device\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failures\n */\nint API_EXPORTED libusb_control_transfer(libusb_device_handle *dev_handle,\n\tuint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,\n\tunsigned char *data, uint16_t wLength, unsigned int timeout)\n{\n\tstruct libusb_transfer *transfer = libusb_alloc_transfer(0);\n\tunsigned char *buffer;\n\tint completed = 0;\n\tint r;\n\n\tif (!transfer)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tbuffer = (unsigned char*) malloc(LIBUSB_CONTROL_SETUP_SIZE + wLength);\n\tif (!buffer) {\n\t\tlibusb_free_transfer(transfer);\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\t}\n\n\tlibusb_fill_control_setup(buffer, bmRequestType, bRequest, wValue, wIndex,\n\t\twLength);\n\tif ((bmRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT)\n\t\tmemcpy(buffer + LIBUSB_CONTROL_SETUP_SIZE, data, wLength);\n\n\tlibusb_fill_control_transfer(transfer, dev_handle, buffer,\n\t\tsync_transfer_cb, &completed, timeout);\n\ttransfer->flags = LIBUSB_TRANSFER_FREE_BUFFER;\n\tr = libusb_submit_transfer(transfer);\n\tif (r < 0) {\n\t\tlibusb_free_transfer(transfer);\n\t\treturn r;\n\t}\n\n\tsync_transfer_wait_for_completion(transfer);\n\n\tif ((bmRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN)\n\t\tmemcpy(data, libusb_control_transfer_get_data(transfer),\n\t\t\ttransfer->actual_length);\n\n\tswitch (transfer->status) {\n\tcase LIBUSB_TRANSFER_COMPLETED:\n\t\tr = transfer->actual_length;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_TIMED_OUT:\n\t\tr = LIBUSB_ERROR_TIMEOUT;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_STALL:\n\t\tr = LIBUSB_ERROR_PIPE;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_NO_DEVICE:\n\t\tr = LIBUSB_ERROR_NO_DEVICE;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_OVERFLOW:\n\t\tr = LIBUSB_ERROR_OVERFLOW;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_ERROR:\n\tcase LIBUSB_TRANSFER_CANCELLED:\n\t\tr = LIBUSB_ERROR_IO;\n\t\tbreak;\n\tdefault:\n\t\tusbi_warn(HANDLE_CTX(dev_handle),\n\t\t\t\"unrecognised status code %d\", transfer->status);\n\t\tr = LIBUSB_ERROR_OTHER;\n\t}\n\n\tlibusb_free_transfer(transfer);\n\treturn r;\n}\n\nstatic int do_sync_bulk_transfer(struct libusb_device_handle *dev_handle,\n\tunsigned char endpoint, unsigned char *buffer, int length,\n\tint *transferred, unsigned int timeout, unsigned char type)\n{\n\tstruct libusb_transfer *transfer = libusb_alloc_transfer(0);\n\tint completed = 0;\n\tint r;\n\n\tif (!transfer)\n\t\treturn LIBUSB_ERROR_NO_MEM;\n\n\tlibusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer, length,\n\t\tsync_transfer_cb, &completed, timeout);\n\ttransfer->type = type;\n\n\tr = libusb_submit_transfer(transfer);\n\tif (r < 0) {\n\t\tlibusb_free_transfer(transfer);\n\t\treturn r;\n\t}\n\n\tsync_transfer_wait_for_completion(transfer);\n\n\t*transferred = transfer->actual_length;\n\tswitch (transfer->status) {\n\tcase LIBUSB_TRANSFER_COMPLETED:\n\t\tr = 0;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_TIMED_OUT:\n\t\tr = LIBUSB_ERROR_TIMEOUT;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_STALL:\n\t\tr = LIBUSB_ERROR_PIPE;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_OVERFLOW:\n\t\tr = LIBUSB_ERROR_OVERFLOW;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_NO_DEVICE:\n\t\tr = LIBUSB_ERROR_NO_DEVICE;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_ERROR:\n\tcase LIBUSB_TRANSFER_CANCELLED:\n\t\tr = LIBUSB_ERROR_IO;\n\t\tbreak;\n\tdefault:\n\t\tusbi_warn(HANDLE_CTX(dev_handle),\n\t\t\t\"unrecognised status code %d\", transfer->status);\n\t\tr = LIBUSB_ERROR_OTHER;\n\t}\n\n\tlibusb_free_transfer(transfer);\n\treturn r;\n}\n\n/** \\ingroup syncio\n * Perform a USB bulk transfer. The direction of the transfer is inferred from\n * the direction bits of the endpoint address.\n *\n * For bulk reads, the <tt>length</tt> field indicates the maximum length of\n * data you are expecting to receive. If less data arrives than expected,\n * this function will return that data, so be sure to check the\n * <tt>transferred</tt> output parameter.\n *\n * You should also check the <tt>transferred</tt> parameter for bulk writes.\n * Not all of the data may have been written.\n *\n * Also check <tt>transferred</tt> when dealing with a timeout error code.\n * libusb may have to split your transfer into a number of chunks to satisfy\n * underlying O/S requirements, meaning that the timeout may expire after\n * the first few chunks have completed. libusb is careful not to lose any data\n * that may have been transferred; do not assume that timeout conditions\n * indicate a complete lack of I/O.\n *\n * \\param dev_handle a handle for the device to communicate with\n * \\param endpoint the address of a valid endpoint to communicate with\n * \\param data a suitably-sized data buffer for either input or output\n * (depending on endpoint)\n * \\param length for bulk writes, the number of bytes from data to be sent. for\n * bulk reads, the maximum number of bytes to receive into the data buffer.\n * \\param transferred output location for the number of bytes actually\n * transferred.\n * \\param timeout timeout (in millseconds) that this function should wait\n * before giving up due to no response being received. For an unlimited\n * timeout, use value 0.\n *\n * \\returns 0 on success (and populates <tt>transferred</tt>)\n * \\returns LIBUSB_ERROR_TIMEOUT if the transfer timed out (and populates\n * <tt>transferred</tt>)\n * \\returns LIBUSB_ERROR_PIPE if the endpoint halted\n * \\returns LIBUSB_ERROR_OVERFLOW if the device offered more data, see\n * \\ref packetoverflow\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other failures\n */\nint API_EXPORTED libusb_bulk_transfer(struct libusb_device_handle *dev_handle,\n\tunsigned char endpoint, unsigned char *data, int length, int *transferred,\n\tunsigned int timeout)\n{\n\treturn do_sync_bulk_transfer(dev_handle, endpoint, data, length,\n\t\ttransferred, timeout, LIBUSB_TRANSFER_TYPE_BULK);\n}\n\n/** \\ingroup syncio\n * Perform a USB interrupt transfer. The direction of the transfer is inferred\n * from the direction bits of the endpoint address.\n *\n * For interrupt reads, the <tt>length</tt> field indicates the maximum length\n * of data you are expecting to receive. If less data arrives than expected,\n * this function will return that data, so be sure to check the\n * <tt>transferred</tt> output parameter.\n *\n * You should also check the <tt>transferred</tt> parameter for interrupt\n * writes. Not all of the data may have been written.\n *\n * Also check <tt>transferred</tt> when dealing with a timeout error code.\n * libusb may have to split your transfer into a number of chunks to satisfy\n * underlying O/S requirements, meaning that the timeout may expire after\n * the first few chunks have completed. libusb is careful not to lose any data\n * that may have been transferred; do not assume that timeout conditions\n * indicate a complete lack of I/O.\n *\n * The default endpoint bInterval value is used as the polling interval.\n *\n * \\param dev_handle a handle for the device to communicate with\n * \\param endpoint the address of a valid endpoint to communicate with\n * \\param data a suitably-sized data buffer for either input or output\n * (depending on endpoint)\n * \\param length for bulk writes, the number of bytes from data to be sent. for\n * bulk reads, the maximum number of bytes to receive into the data buffer.\n * \\param transferred output location for the number of bytes actually\n * transferred.\n * \\param timeout timeout (in millseconds) that this function should wait\n * before giving up due to no response being received. For an unlimited\n * timeout, use value 0.\n *\n * \\returns 0 on success (and populates <tt>transferred</tt>)\n * \\returns LIBUSB_ERROR_TIMEOUT if the transfer timed out\n * \\returns LIBUSB_ERROR_PIPE if the endpoint halted\n * \\returns LIBUSB_ERROR_OVERFLOW if the device offered more data, see\n * \\ref packetoverflow\n * \\returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected\n * \\returns another LIBUSB_ERROR code on other error\n */\nint API_EXPORTED libusb_interrupt_transfer(\n\tstruct libusb_device_handle *dev_handle, unsigned char endpoint,\n\tunsigned char *data, int length, int *transferred, unsigned int timeout)\n{\n\treturn do_sync_bulk_transfer(dev_handle, endpoint, data, length,\n\t\ttransferred, timeout, LIBUSB_TRANSFER_TYPE_INTERRUPT);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/version.h",
    "content": "/* This file is parsed by m4 and windres and RC.EXE so please keep it simple. */\n#include \"version_nano.h\"\n#ifndef LIBUSB_MAJOR\n#define LIBUSB_MAJOR 1\n#endif\n#ifndef LIBUSB_MINOR\n#define LIBUSB_MINOR 0\n#endif\n#ifndef LIBUSB_MICRO\n#define LIBUSB_MICRO 19\n#endif\n#ifndef LIBUSB_NANO\n#define LIBUSB_NANO 0\n#endif\n/* LIBUSB_RC is the release candidate suffix. Should normally be empty. */\n#ifndef LIBUSB_RC\n#define LIBUSB_RC \"\"\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb/version_nano.h",
    "content": "#define LIBUSB_NANO 10903\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/libusb-1.0.pc.in",
    "content": "prefix=@prefix@\nexec_prefix=@exec_prefix@\nlibdir=@libdir@\nincludedir=@includedir@\n\nName: libusb-1.0\nDescription: C API for USB device access from Linux, Mac OS X, Windows and OpenBSD/NetBSD userspace\nVersion: @VERSION@\nLibs: -L${libdir} -lusb-1.0\nLibs.private: @LIBS@\nCflags: -I${includedir}/libusb-1.0\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/config.h",
    "content": "/* config.h.  Manual config for MSVC.  */\n\n#ifndef _MSC_VER\n#warn \"msvc/config.h shouldn't be included for your development environment.\"\n#error \"Please make sure the msvc/ directory is removed from your build path.\"\n#endif\n\n/* Disable: warning C4200: nonstandard extension used : zero-sized array in struct/union */\n#pragma warning(disable:4200)\n/* Disable: warning C6258: Using TerminateThread does not allow proper thread clean up */\n#pragma warning(disable: 6258)\n#if defined(_PREFAST_)\n/* Disable \"Banned API\" errors when using the MS's WDK OACR/Prefast */\n#pragma warning(disable:28719)\n/* Disable \"The function 'InitializeCriticalSection' must be called from within a try/except block\" */\n#pragma warning(disable:28125)\n#endif\n\n/* Default visibility */\n#define DEFAULT_VISIBILITY /**/\n\n/* Enable global message logging */\n#define ENABLE_LOGGING 1\n\n/* Uncomment to start with debug message logging enabled */\n// #define ENABLE_DEBUG_LOGGING 1\n\n/* Uncomment to enabling logging to system log */\n// #define USE_SYSTEM_LOGGING_FACILITY\n\n/* type of second poll() argument */\n#define POLL_NFDS_TYPE unsigned int\n\n/* Windows/WinCE backend */\n#if defined(_WIN32_WCE)\n#define OS_WINCE 1\n#define HAVE_MISSING_H\n#else\n#define OS_WINDOWS 1\n#define HAVE_SIGNAL_H 1\n#define HAVE_SYS_TYPES_H 1\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/ddk_build.cmd",
    "content": "@echo off\n::# default builds static library. \n::# you can pass the following arguments (case insensitive):\n::# - \"DLL\" to build a DLL instead of a static library\n::# - \"/MT\" to build a static library compatible with MSVC's /MT option (LIBCMT vs MSVCRT)\n\nif Test%BUILD_ALT_DIR%==Test goto usage\n\n::# process commandline parameters\nset TARGET=LIBRARY\nset STATIC_LIBC=\nset version=1.0\nset PWD=%~dp0\nset BUILD_CMD=build -bcwgZ -M2\n\nif \"%1\" == \"\" goto no_more_args\n::# /I for case insensitive\nif /I Test%1==TestDLL set TARGET=DYNLINK\nif /I Test%1==Test/MT set STATIC_LIBC=1\n:no_more_args\n\ncd ..\\libusb\\os\necho TARGETTYPE=%TARGET% > target\ncopy target+..\\..\\msvc\\libusb_sources sources >NUL 2>&1\ndel target\n@echo on\n%BUILD_CMD%\n@echo off\nif errorlevel 1 goto builderror\ncd ..\\..\n\nset cpudir=i386\nset destType=Win32\nif %_BUILDARCH%==x86 goto isI386\nset cpudir=amd64\nset destType=x64\n:isI386\n\nset srcPath=libusb\\os\\obj%BUILD_ALT_DIR%\\%cpudir%\n\nset dstPath=%destType%\\Debug\nif %DDKBUILDENV%==chk goto isDebug\nset dstPath=%destType%\\Release\n:isDebug\n\nif exist %destType% goto md2\nmkdir %destType%\n:md2\nif exist %dstPath% goto md3\nmkdir %dstPath%\n:md3\nif exist %dstPath%\\dll goto md4\nmkdir %dstPath%\\dll\n:md4\nif exist %dstPath%\\lib goto md5\nmd %dstPath%\\lib\n:md5\nif exist %dstPath%\\examples goto md6\nmd %dstPath%\\examples\n:md6\n@echo on\n\n@if /I NOT Test%1==TestDLL goto copylib\ncopy %srcPath%\\libusb-%version%.dll %dstPath%\\dll\ncopy %srcPath%\\libusb-%version%.pdb %dstPath%\\dll\n:copylib\ncopy %srcPath%\\libusb-%version%.lib %dstPath%\\lib\n\n@echo off\n\nif exist examples\\listdevs_ddkbuild goto md7\nmd examples\\listdevs_ddkbuild\n:md7\n\ncd examples\\listdevs_ddkbuild\ncopy ..\\..\\msvc\\listdevs_sources sources >NUL 2>&1\n@echo on\n%BUILD_CMD%\n@echo off\nif errorlevel 1 goto builderror\ncd ..\\..\n\nset srcPath=examples\\listdevs_ddkbuild\\obj%BUILD_ALT_DIR%\\%cpudir%\n@echo on\n\ncopy %srcPath%\\listdevs.exe %dstPath%\\examples\ncopy %srcPath%\\listdevs.pdb %dstPath%\\examples\n\n@echo off\n\nif exist examples\\xusb_ddkbuild goto md8\nmd examples\\xusb_ddkbuild\n:md8\n\ncd examples\\xusb_ddkbuild\ncopy ..\\..\\msvc\\xusb_sources sources >NUL 2>&1\n@echo on\n%BUILD_CMD%\n@echo off\nif errorlevel 1 goto builderror\ncd ..\\..\n\nset srcPath=examples\\xusb_ddkbuild\\obj%BUILD_ALT_DIR%\\%cpudir%\n@echo on\n\ncopy %srcPath%\\xusb.exe %dstPath%\\examples\ncopy %srcPath%\\xusb.pdb %dstPath%\\examples\n\n@echo off\n\nif exist examples\\getopt\\getopt_ddkbuild goto md9\nmd examples\\getopt\\getopt_ddkbuild\n:md9\n\ncd examples\\getopt\\getopt_ddkbuild\ncopy ..\\..\\..\\msvc\\getopt_sources sources >NUL 2>&1\n@echo on\n%BUILD_CMD%\n@echo off\nif errorlevel 1 goto builderror\ncd ..\\..\\..\n\nif exist examples\\fxload_ddkbuild goto md10\nmd examples\\fxload_ddkbuild\n:md10\n\ncd examples\\fxload_ddkbuild\ncopy ..\\..\\msvc\\fxload_sources sources >NUL 2>&1\n@echo on\n%BUILD_CMD%\n@echo off\nif errorlevel 1 goto builderror\ncd ..\\..\n\nset srcPath=examples\\fxload_ddkbuild\\obj%BUILD_ALT_DIR%\\%cpudir%\n@echo on\n\ncopy %srcPath%\\fxload.exe %dstPath%\\examples\ncopy %srcPath%\\fxload.pdb %dstPath%\\examples\n\n@echo off\n\nif exist examples\\hotplugtest_ddkbuild goto md11\nmd examples\\hotplugtest_ddkbuild\n:md11\n\ncd examples\\hotplugtest_ddkbuild\ncopy ..\\..\\msvc\\hotplugtest_sources sources >NUL 2>&1\n@echo on\n%BUILD_CMD%\n@echo off\nif errorlevel 1 goto builderror\ncd ..\\..\n\nset srcPath=examples\\hotplugtest_ddkbuild\\obj%BUILD_ALT_DIR%\\%cpudir%\n@echo on\n\ncopy %srcPath%\\hotplugtest.exe %dstPath%\\examples\ncopy %srcPath%\\hotplugtest.pdb %dstPath%\\examples\n\n@echo off\n\ncd msvc\ngoto done\n\n:usage\necho ddk_build must be run in a WDK build environment\npause\ngoto done\n\n:builderror\necho Build failed\n\n:done\ncd %PWD%\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/errno.h",
    "content": "/* \n * errno.h\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file is a part of the mingw-runtime package.\n * No warranty is given; refer to the file DISCLAIMER within the package.\n *\n * Error numbers and access to error reporting.\n *\n */\n\n#ifndef _ERRNO_H_\n#define\t_ERRNO_H_\n\n#include <crtdefs.h>\n\n/*\n * Error numbers.\n * TODO: Can't be sure of some of these assignments, I guessed from the\n * names given by strerror and the defines in the Cygnus errno.h. A lot\n * of the names from the Cygnus errno.h are not represented, and a few\n * of the descriptions returned by strerror do not obviously match\n * their error naming.\n */\n#define EPERM\t\t1\t/* Operation not permitted */\n#define\tENOFILE\t\t2\t/* No such file or directory */\n#define\tENOENT\t\t2\n#define\tESRCH\t\t3\t/* No such process */\n#define\tEINTR\t\t4\t/* Interrupted function call */\n#define\tEIO\t\t5\t/* Input/output error */\n#define\tENXIO\t\t6\t/* No such device or address */\n#define\tE2BIG\t\t7\t/* Arg list too long */\n#define\tENOEXEC\t\t8\t/* Exec format error */\n#define\tEBADF\t\t9\t/* Bad file descriptor */\n#define\tECHILD\t\t10\t/* No child processes */\n#define\tEAGAIN\t\t11\t/* Resource temporarily unavailable */\n#define\tENOMEM\t\t12\t/* Not enough space */\n#define\tEACCES\t\t13\t/* Permission denied */\n#define\tEFAULT\t\t14\t/* Bad address */\n/* 15 - Unknown Error */\n#define\tEBUSY\t\t16\t/* strerror reports \"Resource device\" */\n#define\tEEXIST\t\t17\t/* File exists */\n#define\tEXDEV\t\t18\t/* Improper link (cross-device link?) */\n#define\tENODEV\t\t19\t/* No such device */\n#define\tENOTDIR\t\t20\t/* Not a directory */\n#define\tEISDIR\t\t21\t/* Is a directory */\n#define\tEINVAL\t\t22\t/* Invalid argument */\n#define\tENFILE\t\t23\t/* Too many open files in system */\n#define\tEMFILE\t\t24\t/* Too many open files */\n#define\tENOTTY\t\t25\t/* Inappropriate I/O control operation */\n/* 26 - Unknown Error */\n#define\tEFBIG\t\t27\t/* File too large */\n#define\tENOSPC\t\t28\t/* No space left on device */\n#define\tESPIPE\t\t29\t/* Invalid seek (seek on a pipe?) */\n#define\tEROFS\t\t30\t/* Read-only file system */\n#define\tEMLINK\t\t31\t/* Too many links */\n#define\tEPIPE\t\t32\t/* Broken pipe */\n#define\tEDOM\t\t33\t/* Domain error (math functions) */\n#define\tERANGE\t\t34\t/* Result too large (possibly too small) */\n/* 35 - Unknown Error */\n#define\tEDEADLOCK\t36\t/* Resource deadlock avoided (non-Cyg) */\n#define\tEDEADLK\t\t36\n#if 0\n/* 37 - Unknown Error */\n#define\tENAMETOOLONG\t38\t/* Filename too long (91 in Cyg?) */\n#define\tENOLCK\t\t39\t/* No locks available (46 in Cyg?) */\n#define\tENOSYS\t\t40\t/* Function not implemented (88 in Cyg?) */\n#define\tENOTEMPTY\t41\t/* Directory not empty (90 in Cyg?) */\n#define\tEILSEQ\t\t42\t/* Illegal byte sequence */\n#endif\n\n/*\n * NOTE: ENAMETOOLONG and ENOTEMPTY conflict with definitions in the\n *       sockets.h header provided with windows32api-0.1.2.\n *       You should go and put an #if 0 ... #endif around the whole block\n *       of errors (look at the comment above them).\n */\n\n#ifndef\tRC_INVOKED\n\n#ifdef\t__cplusplus\nextern \"C\" {\n#endif\n\n/*\n * Definitions of errno. For _doserrno, sys_nerr and * sys_errlist, see\n * stdlib.h.\n */\n#if defined(_UWIN) || defined(_WIN32_WCE)\n#undef errno\nextern int errno;\n#else\n_CRTIMP int* __cdecl _errno(void);\n#define\terrno\t\t(*_errno())\n#endif\n\n#ifdef\t__cplusplus\n}\n#endif\n\n#endif\t/* Not RC_INVOKED */\n\n#endif\t/* Not _ERRNO_H_ */"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/fxload_2010.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>fxload</ProjectName>\n    <ProjectGuid>{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}</ProjectGuid>\n    <RootNamespace>examples</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\examples\\getopt;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;__GNU_LIBRARY__;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\examples\\getopt;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;__GNU_LIBRARY__;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\examples\\getopt;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;__GNU_LIBRARY__;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\examples\\getopt;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;__GNU_LIBRARY__;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\ezusb.c\" />\n    <ClCompile Include=\"..\\examples\\fxload.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\".\\libusb_static_2010.vcxproj\">\n      <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n    </ProjectReference>\n    <ProjectReference Include=\"getopt_2010.vcxproj\">\n      <Project>{ae83e1b4-ce06-47ee-b7a3-c3a1d7c2d71e}</Project>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\examples\\ezusb.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/fxload_2010.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{651ff73d-037b-4903-8dd3-56e9950be25c}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\fxload.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\examples\\ezusb.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\examples\\ezusb.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/fxload_2012.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>fxload</ProjectName>\n    <ProjectGuid>{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}</ProjectGuid>\n    <RootNamespace>examples</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\examples\\getopt;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;__GNU_LIBRARY__;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\examples\\getopt;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;__GNU_LIBRARY__;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\examples\\getopt;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;__GNU_LIBRARY__;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\examples\\getopt;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;__GNU_LIBRARY__;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\ezusb.c\" />\n    <ClCompile Include=\"..\\examples\\fxload.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\".\\libusb_static_2012.vcxproj\">\n      <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n    </ProjectReference>\n    <ProjectReference Include=\"getopt_2012.vcxproj\">\n      <Project>{ae83e1b4-ce06-47ee-b7a3-c3a1d7c2d71e}</Project>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\examples\\ezusb.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/fxload_2012.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{651ff73d-037b-4903-8dd3-56e9950be25c}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\fxload.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\examples\\ezusb.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\examples\\ezusb.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/fxload_2013.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>fxload</ProjectName>\n    <ProjectGuid>{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}</ProjectGuid>\n    <RootNamespace>examples</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\examples\\getopt;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;__GNU_LIBRARY__;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\examples\\getopt;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;__GNU_LIBRARY__;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\examples\\getopt;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;__GNU_LIBRARY__;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\examples\\getopt;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;__GNU_LIBRARY__;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\ezusb.c\" />\n    <ClCompile Include=\"..\\examples\\fxload.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\".\\libusb_static_2013.vcxproj\">\n      <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n    </ProjectReference>\n    <ProjectReference Include=\"getopt_2013.vcxproj\">\n      <Project>{ae83e1b4-ce06-47ee-b7a3-c3a1d7c2d71e}</Project>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\examples\\ezusb.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/fxload_sources",
    "content": "TARGETNAME=fxload\nTARGETTYPE=PROGRAM\n386_STDCALL=0\n\n_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP)\n\n!IFNDEF MSC_WARNING_LEVEL\nMSC_WARNING_LEVEL=/W3\n!ENDIF\n\n!IFDEF STATIC_LIBC\nUSE_LIBCMT=1\n!ELSE\nUSE_MSVCRT=1\n!ENDIF\n\nUMTYPE=console\nINCLUDES=..\\..\\msvc;..\\..\\libusb;..\\getopt;$(DDK_INC_PATH)\nC_DEFINES=$(C_DEFINES) /D__GNU_LIBRARY__\nUMLIBS=..\\..\\libusb\\os\\obj$(BUILD_ALT_DIR)\\*\\libusb-1.0.lib \\\n       ..\\getopt\\getopt_ddkbuild\\obj$(BUILD_ALT_DIR)\\*\\getopt.lib\nSOURCES=..\\ezusb.c \\\n        ..\\fxload.c\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/getopt_2005.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"9.00\"\n\tName=\"getopt\"\n\tProjectGUID=\"{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}\"\n\tRootNamespace=\"getopt\"\n\tTargetFrameworkVersion=\"196613\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"x64\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"$(SolutionDir)$(PlatformName)\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)$(PlatformName)\\$(ConfigurationName)\\lib\\getopt\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tIgnoreAllDefaultLibraries=\"true\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|x64\"\n\t\t\tOutputDirectory=\"$(SolutionDir)$(PlatformName)\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)$(PlatformName)\\$(ConfigurationName)\\lib\\getopt\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tIgnoreAllDefaultLibraries=\"true\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"$(SolutionDir)$(PlatformName)\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)$(PlatformName)\\$(ConfigurationName)\\lib\\getopt\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"1\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tPreprocessorDefinitions=\"HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tIgnoreAllDefaultLibraries=\"true\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|x64\"\n\t\t\tOutputDirectory=\"$(SolutionDir)$(PlatformName)\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)$(PlatformName)\\$(ConfigurationName)\\lib\\getopt\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"1\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tIgnoreAllDefaultLibraries=\"true\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx\"\n\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\examples\\getopt\\getopt.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\examples\\getopt\\getopt1.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc;xsd\"\n\t\t\tUniqueIdentifier=\"{93995380-89BD-4b04-88EB-625FBE52EBFB}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\examples\\getopt\\getopt.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/getopt_2010.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}</ProjectGuid>\n    <RootNamespace>getopt</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\getopt\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\getopt\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\getopt\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\getopt\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Lib>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Lib>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <Optimization>MaxSpeed</Optimization>\n      <PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Lib>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Lib>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\getopt\\getopt.c\" />\n    <ClCompile Include=\"..\\examples\\getopt\\getopt1.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\examples\\getopt\\getopt.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/getopt_2010.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\getopt\\getopt.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\examples\\getopt\\getopt1.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\examples\\getopt\\getopt.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/getopt_2012.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}</ProjectGuid>\n    <RootNamespace>getopt</RootNamespace>\n    <ProjectName>getopt</ProjectName>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\getopt\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\getopt\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\getopt\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\getopt\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Lib>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Lib>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <Optimization>MaxSpeed</Optimization>\n      <PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Lib>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Lib>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\getopt\\getopt.c\" />\n    <ClCompile Include=\"..\\examples\\getopt\\getopt1.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\examples\\getopt\\getopt.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/getopt_2012.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\getopt\\getopt.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\examples\\getopt\\getopt1.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\examples\\getopt\\getopt.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/getopt_2013.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}</ProjectGuid>\n    <RootNamespace>getopt</RootNamespace>\n    <ProjectName>getopt</ProjectName>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\getopt\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\getopt\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\getopt\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\getopt\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Lib>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Lib>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <Optimization>MaxSpeed</Optimization>\n      <PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Lib>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Lib>\n      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\getopt\\getopt.c\" />\n    <ClCompile Include=\"..\\examples\\getopt\\getopt1.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\examples\\getopt\\getopt.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/getopt_sources",
    "content": "TARGETTYPE=LIBRARY\nTARGETNAME=getopt\n386_STDCALL=0\n\n_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP)\n\n!IFNDEF MSC_WARNING_LEVEL\nMSC_WARNING_LEVEL=/W3\n!ENDIF\n\nUSE_MSVCRT=1\n\nINCLUDES=$(DDK_INC_PATH)\nC_DEFINES = $(C_DEFINES) /DDDKBUILD /DHAVE_STRING_H\n\nTARGETLIBS=$(SDK_LIB_PATH)\\kernel32.lib \\\n           $(SDK_LIB_PATH)\\user32.lib\n\nSOURCES=..\\getopt1.c \\\n        ..\\getopt.c\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/hotplugtest_2010.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>hotplugtest</ProjectName>\n    <ProjectGuid>{99D2AC64-DC66-4422-91CE-6715C403C9E5}</ProjectGuid>\n    <RootNamespace>examples</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\hotplugtest.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\".\\libusb_static_2010.vcxproj\">\n      <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/hotplugtest_2010.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\hotplugtest.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/hotplugtest_2012.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>hotplugtest</ProjectName>\n    <ProjectGuid>{99D2AC64-DC66-4422-91CE-6715C403C9E5}</ProjectGuid>\n    <RootNamespace>examples</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\hotplugtest.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\".\\libusb_static_2012.vcxproj\">\n      <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/hotplugtest_2012.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\hotplugtest.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/hotplugtest_2013.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>hotplugtest</ProjectName>\n    <ProjectGuid>{99D2AC64-DC66-4422-91CE-6715C403C9E5}</ProjectGuid>\n    <RootNamespace>examples</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\hotplugtest.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\".\\libusb_static_2013.vcxproj\">\n      <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/hotplugtest_sources",
    "content": "TARGETNAME=hotplugtest\nTARGETTYPE=PROGRAM\n386_STDCALL=0\n\n_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP)\n\n!IFNDEF MSC_WARNING_LEVEL\nMSC_WARNING_LEVEL=/W3\n!ENDIF\n\n!IFDEF STATIC_LIBC\nUSE_LIBCMT=1\n!ELSE\nUSE_MSVCRT=1\n!ENDIF\n\nUMTYPE=console\nINCLUDES=..\\..\\msvc;..\\..\\libusb;$(DDK_INC_PATH)\nUMLIBS=..\\..\\libusb\\os\\obj$(BUILD_ALT_DIR)\\*\\libusb-1.0.lib\nSOURCES=..\\hotplugtest.c\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/inttypes.h",
    "content": "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file was original part of the w64 mingw-runtime package.\n */\n\n/*\n *  THIS SOFTWARE IS NOT COPYRIGHTED\n *\n *  Modified for libusb/MSVC: Pete Batard <pbatard@gmail.com>\n *\n *  This source code is offered for use in the public domain. You may\n *  use, modify or distribute it freely.\n *\n *  This code is distributed in the hope that it will be useful but\n *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY\n *  DISCLAIMED. This includes but is not limited to warranties of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n *\n *  Date: 2010-04-02\n */\n\n#ifndef _MSC_VER\n#error This header should only be used with Microsoft compilers\n#endif\n\n/* 7.8 Format conversion of integer types <inttypes.h> */\n\n#ifndef _INTTYPES_H_\n#define _INTTYPES_H_\n\n#include <stdint.h>\n\n#ifdef\t__cplusplus\nextern\t\"C\"\t{\n#endif\n\ntypedef struct {\n\tintmax_t quot;\n\tintmax_t rem;\n\t} imaxdiv_t;\n\n\n/* 7.8.1 Macros for format specifiers\n *\n * MS runtime does not yet understand C9x standard \"ll\"\n * length specifier. It appears to treat \"ll\" as \"l\".\n * The non-standard I64 length specifier causes warning in GCC,\n * but understood by MS runtime functions.\n */\n\n/* fprintf macros for signed types */\n#define PRId8 \"d\"\n#define PRId16 \"d\"\n#define PRId32 \"d\"\n#define PRId64 \"I64d\"\n\n#define PRIdLEAST8 \"d\"\n#define PRIdLEAST16 \"d\"\n#define PRIdLEAST32 \"d\"\n#define PRIdLEAST64 \"I64d\"\n\n#define PRIdFAST8 \"d\"\n#define PRIdFAST16 \"d\"\n#define PRIdFAST32 \"d\"\n#define PRIdFAST64 \"I64d\"\n\n#define PRIdMAX \"I64d\"\n\n#define PRIi8 \"i\"\n#define PRIi16 \"i\"\n#define PRIi32 \"i\"\n#define PRIi64 \"I64i\"\n\n#define PRIiLEAST8 \"i\"\n#define PRIiLEAST16 \"i\"\n#define PRIiLEAST32 \"i\"\n#define PRIiLEAST64 \"I64i\"\n\n#define PRIiFAST8 \"i\"\n#define PRIiFAST16 \"i\"\n#define PRIiFAST32 \"i\"\n#define PRIiFAST64 \"I64i\"\n\n#define PRIiMAX \"I64i\"\n\n#define PRIo8 \"o\"\n#define PRIo16 \"o\"\n#define PRIo32 \"o\"\n#define PRIo64 \"I64o\"\n\n#define PRIoLEAST8 \"o\"\n#define PRIoLEAST16 \"o\"\n#define PRIoLEAST32 \"o\"\n#define PRIoLEAST64 \"I64o\"\n\n#define PRIoFAST8 \"o\"\n#define PRIoFAST16 \"o\"\n#define PRIoFAST32 \"o\"\n#define PRIoFAST64 \"I64o\"\n\n#define PRIoMAX \"I64o\"\n\n/* fprintf macros for unsigned types */\n#define PRIu8 \"u\"\n#define PRIu16 \"u\"\n#define PRIu32 \"u\"\n#define PRIu64 \"I64u\"\n\n\n#define PRIuLEAST8 \"u\"\n#define PRIuLEAST16 \"u\"\n#define PRIuLEAST32 \"u\"\n#define PRIuLEAST64 \"I64u\"\n\n#define PRIuFAST8 \"u\"\n#define PRIuFAST16 \"u\"\n#define PRIuFAST32 \"u\"\n#define PRIuFAST64 \"I64u\"\n\n#define PRIuMAX \"I64u\"\n\n#define PRIx8 \"x\"\n#define PRIx16 \"x\"\n#define PRIx32 \"x\"\n#define PRIx64 \"I64x\"\n\n#define PRIxLEAST8 \"x\"\n#define PRIxLEAST16 \"x\"\n#define PRIxLEAST32 \"x\"\n#define PRIxLEAST64 \"I64x\"\n\n#define PRIxFAST8 \"x\"\n#define PRIxFAST16 \"x\"\n#define PRIxFAST32 \"x\"\n#define PRIxFAST64 \"I64x\"\n\n#define PRIxMAX \"I64x\"\n\n#define PRIX8 \"X\"\n#define PRIX16 \"X\"\n#define PRIX32 \"X\"\n#define PRIX64 \"I64X\"\n\n#define PRIXLEAST8 \"X\"\n#define PRIXLEAST16 \"X\"\n#define PRIXLEAST32 \"X\"\n#define PRIXLEAST64 \"I64X\"\n\n#define PRIXFAST8 \"X\"\n#define PRIXFAST16 \"X\"\n#define PRIXFAST32 \"X\"\n#define PRIXFAST64 \"I64X\"\n\n#define PRIXMAX \"I64X\"\n\n/*\n *   fscanf macros for signed int types\n *   NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t\n *   (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have\n *   no length identifiers\n */\n\n#define SCNd16 \"hd\"\n#define SCNd32 \"d\"\n#define SCNd64 \"I64d\"\n\n#define SCNdLEAST16 \"hd\"\n#define SCNdLEAST32 \"d\"\n#define SCNdLEAST64 \"I64d\"\n\n#define SCNdFAST16 \"hd\"\n#define SCNdFAST32 \"d\"\n#define SCNdFAST64 \"I64d\"\n\n#define SCNdMAX \"I64d\"\n\n#define SCNi16 \"hi\"\n#define SCNi32 \"i\"\n#define SCNi64 \"I64i\"\n\n#define SCNiLEAST16 \"hi\"\n#define SCNiLEAST32 \"i\"\n#define SCNiLEAST64 \"I64i\"\n\n#define SCNiFAST16 \"hi\"\n#define SCNiFAST32 \"i\"\n#define SCNiFAST64 \"I64i\"\n\n#define SCNiMAX \"I64i\"\n\n#define SCNo16 \"ho\"\n#define SCNo32 \"o\"\n#define SCNo64 \"I64o\"\n\n#define SCNoLEAST16 \"ho\"\n#define SCNoLEAST32 \"o\"\n#define SCNoLEAST64 \"I64o\"\n\n#define SCNoFAST16 \"ho\"\n#define SCNoFAST32 \"o\"\n#define SCNoFAST64 \"I64o\"\n\n#define SCNoMAX \"I64o\"\n\n#define SCNx16 \"hx\"\n#define SCNx32 \"x\"\n#define SCNx64 \"I64x\"\n\n#define SCNxLEAST16 \"hx\"\n#define SCNxLEAST32 \"x\"\n#define SCNxLEAST64 \"I64x\"\n\n#define SCNxFAST16 \"hx\"\n#define SCNxFAST32 \"x\"\n#define SCNxFAST64 \"I64x\"\n\n#define SCNxMAX \"I64x\"\n\n/* fscanf macros for unsigned int types */\n\n#define SCNu16 \"hu\"\n#define SCNu32 \"u\"\n#define SCNu64 \"I64u\"\n\n#define SCNuLEAST16 \"hu\"\n#define SCNuLEAST32 \"u\"\n#define SCNuLEAST64 \"I64u\"\n\n#define SCNuFAST16 \"hu\"\n#define SCNuFAST32 \"u\"\n#define SCNuFAST64 \"I64u\"\n\n#define SCNuMAX \"I64u\"\n\n#ifdef _WIN64\n#define PRIdPTR \"I64d\"\n#define PRIiPTR \"I64i\"\n#define PRIoPTR \"I64o\"\n#define PRIuPTR \"I64u\"\n#define PRIxPTR \"I64x\"\n#define PRIXPTR \"I64X\"\n#define SCNdPTR \"I64d\"\n#define SCNiPTR \"I64i\"\n#define SCNoPTR \"I64o\"\n#define SCNxPTR \"I64x\"\n#define SCNuPTR \"I64u\"\n#else\n#define PRIdPTR \"d\"\n#define PRIiPTR \"i\"\n#define PRIoPTR \"o\"\n#define PRIuPTR \"u\"\n#define PRIxPTR \"x\"\n#define PRIXPTR \"X\"\n#define SCNdPTR \"d\"\n#define SCNiPTR \"i\"\n#define SCNoPTR \"o\"\n#define SCNxPTR \"x\"\n #define SCNuPTR \"u\"\n#endif\n\n#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L\n/*\n * no length modifier for char types prior to C9x\n * MS runtime  scanf appears to treat \"hh\" as \"h\"\n */\n\n/* signed char */\n#define SCNd8 \"hhd\"\n#define SCNdLEAST8 \"hhd\"\n#define SCNdFAST8 \"hhd\"\n\n#define SCNi8 \"hhi\"\n#define SCNiLEAST8 \"hhi\"\n#define SCNiFAST8 \"hhi\"\n\n#define SCNo8 \"hho\"\n#define SCNoLEAST8 \"hho\"\n#define SCNoFAST8 \"hho\"\n\n#define SCNx8 \"hhx\"\n#define SCNxLEAST8 \"hhx\"\n#define SCNxFAST8 \"hhx\"\n\n/* unsigned char */\n#define SCNu8 \"hhu\"\n#define SCNuLEAST8 \"hhu\"\n#define SCNuFAST8 \"hhu\"\n#endif /* __STDC_VERSION__ >= 199901 */\n\n\n#ifdef\t__cplusplus\n}\n#endif\n\n#endif /* ndef _INTTYPES_H */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb.dsw",
    "content": "Microsoft Developer Studio Workspace File, Format Version 6.00\n# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\n\n###############################################################################\n\nProject: \"libusb_dll\"=\".\\libusb_dll.dsp\" - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n}}}\n\n###############################################################################\n\nProject: \"libusb_static\"=\".\\libusb_static.dsp\" - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n}}}\n\n###############################################################################\n\nProject: \"listdevs\"=\".\\listdevs.dsp\" - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n    Begin Project Dependency\n    Project_Dep_Name libusb_static\n    End Project Dependency\n}}}\n\n###############################################################################\n\nProject: \"xusb\"=\".\\xusb.dsp\" - Package Owner=<4>\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<4>\n{{{\n    Begin Project Dependency\n    Project_Dep_Name libusb_static\n    End Project Dependency\n}}}\n\n###############################################################################\n\nGlobal:\n\nPackage=<5>\n{{{\n}}}\n\nPackage=<3>\n{{{\n}}}\n\n###############################################################################\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_2005.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 9.00\n# Visual Studio 2005\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libusb-1.0 (static)\", \"libusb_static_2005.vcproj\", \"{5AB6B770-1925-48D5-ABC2-930F3259C020}\"\n\tProjectSection(WebsiteProperties) = preProject\n\t\tDebug.AspNetCompiler.Debug = \"True\"\n\t\tRelease.AspNetCompiler.Debug = \"False\"\n\tEndProjectSection\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libusb-1.0 (dll)\", \"libusb_dll_2005.vcproj\", \"{8224C054-5968-4238-832C-167155E7ECC3}\"\n\tProjectSection(WebsiteProperties) = preProject\n\t\tDebug.AspNetCompiler.Debug = \"True\"\n\t\tRelease.AspNetCompiler.Debug = \"False\"\n\tEndProjectSection\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"listdevs\", \"listdevs_2005.vcproj\", \"{98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}\"\n\tProjectSection(WebsiteProperties) = preProject\n\t\tDebug.AspNetCompiler.Debug = \"True\"\n\t\tRelease.AspNetCompiler.Debug = \"False\"\n\tEndProjectSection\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{5AB6B770-1925-48D5-ABC2-930F3259C020} = {5AB6B770-1925-48D5-ABC2-930F3259C020}\n\tEndProjectSection\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"xusb\", \"xusb_2005.vcproj\", \"{08A6FA39-21B7-4A05-9252-2F9864A5E5A4}\"\n\tProjectSection(WebsiteProperties) = preProject\n\t\tDebug.AspNetCompiler.Debug = \"True\"\n\t\tRelease.AspNetCompiler.Debug = \"False\"\n\tEndProjectSection\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{5AB6B770-1925-48D5-ABC2-930F3259C020} = {5AB6B770-1925-48D5-ABC2-930F3259C020}\n\tEndProjectSection\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"stress\", \"stress_2005.vcproj\", \"{53942EFF-C810-458D-B3CB-EE5CE9F1E781}\"\n\tProjectSection(WebsiteProperties) = preProject\n\t\tDebug.AspNetCompiler.Debug = \"True\"\n\t\tRelease.AspNetCompiler.Debug = \"False\"\n\tEndProjectSection\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{5AB6B770-1925-48D5-ABC2-930F3259C020} = {5AB6B770-1925-48D5-ABC2-930F3259C020}\n\tEndProjectSection\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Win32 = Debug|Win32\n\t\tDebug|x64 = Debug|x64\n\t\tRelease|Win32 = Release|Win32\n\t\tRelease|x64 = Release|x64\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{5AB6B770-1925-48D5-ABC2-930F3259C020}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{5AB6B770-1925-48D5-ABC2-930F3259C020}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{5AB6B770-1925-48D5-ABC2-930F3259C020}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{5AB6B770-1925-48D5-ABC2-930F3259C020}.Debug|x64.Build.0 = Debug|x64\n\t\t{5AB6B770-1925-48D5-ABC2-930F3259C020}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{5AB6B770-1925-48D5-ABC2-930F3259C020}.Release|Win32.Build.0 = Release|Win32\n\t\t{5AB6B770-1925-48D5-ABC2-930F3259C020}.Release|x64.ActiveCfg = Release|x64\n\t\t{5AB6B770-1925-48D5-ABC2-930F3259C020}.Release|x64.Build.0 = Release|x64\n\t\t{8224C054-5968-4238-832C-167155E7ECC3}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{8224C054-5968-4238-832C-167155E7ECC3}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{8224C054-5968-4238-832C-167155E7ECC3}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{8224C054-5968-4238-832C-167155E7ECC3}.Debug|x64.Build.0 = Debug|x64\n\t\t{8224C054-5968-4238-832C-167155E7ECC3}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{8224C054-5968-4238-832C-167155E7ECC3}.Release|Win32.Build.0 = Release|Win32\n\t\t{8224C054-5968-4238-832C-167155E7ECC3}.Release|x64.ActiveCfg = Release|x64\n\t\t{8224C054-5968-4238-832C-167155E7ECC3}.Release|x64.Build.0 = Release|x64\n\t\t{98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Debug|x64.Build.0 = Debug|x64\n\t\t{98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Release|Win32.Build.0 = Release|Win32\n\t\t{98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Release|x64.ActiveCfg = Release|x64\n\t\t{98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}.Release|x64.Build.0 = Release|x64\n\t\t{08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Debug|x64.Build.0 = Debug|x64\n\t\t{08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Release|Win32.Build.0 = Release|Win32\n\t\t{08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Release|x64.ActiveCfg = Release|x64\n\t\t{08A6FA39-21B7-4A05-9252-2F9864A5E5A4}.Release|x64.Build.0 = Release|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.Build.0 = Debug|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.Build.0 = Release|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.ActiveCfg = Release|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.Build.0 = Release|x64\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_2010.sln",
    "content": "Microsoft Visual Studio Solution File, Format Version 11.00\n# Visual Studio 2010\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libusb-1.0 (static)\", \"libusb_static_2010.vcxproj\", \"{349EE8F9-7D25-4909-AAF5-FF3FADE72187}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libusb-1.0 (dll)\", \"libusb_dll_2010.vcxproj\", \"{349EE8FA-7D25-4909-AAF5-FF3FADE72187}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"listdevs\", \"listdevs_2010.vcxproj\", \"{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"xusb\", \"xusb_2010.vcxproj\", \"{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"fxload\", \"fxload_2010.vcxproj\", \"{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} = {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}\n\tEndProjectSection\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"getopt\", \"getopt_2010.vcxproj\", \"{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"stress\", \"stress_2010.vcxproj\", \"{53942EFF-C810-458D-B3CB-EE5CE9F1E781}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"hotplugtest\", \"hotplugtest_2010.vcxproj\", \"{99D2AC64-DC66-4422-91CE-6715C403C9E5}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Win32 = Debug|Win32\n\t\tDebug|x64 = Debug|x64\n\t\tRelease|Win32 = Release|Win32\n\t\tRelease|x64 = Release|x64\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.Build.0 = Debug|x64\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.Build.0 = Release|Win32\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|x64.ActiveCfg = Release|x64\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|x64.Build.0 = Release|x64\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|x64.ActiveCfg = Release|x64\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.Build.0 = Debug|x64\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.Build.0 = Release|Win32\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.ActiveCfg = Release|x64\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.Build.0 = Release|x64\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|x64.Build.0 = Debug|x64\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.Build.0 = Release|Win32\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.ActiveCfg = Release|x64\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.Build.0 = Release|x64\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|x64.Build.0 = Debug|x64\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|Win32.Build.0 = Release|Win32\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|x64.ActiveCfg = Release|x64\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|x64.Build.0 = Release|x64\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.Build.0 = Debug|x64\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.Build.0 = Release|Win32\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.ActiveCfg = Release|x64\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.Build.0 = Release|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.Build.0 = Debug|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.Build.0 = Release|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.ActiveCfg = Release|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.Build.0 = Release|x64\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|x64.Build.0 = Debug|x64\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|Win32.Build.0 = Release|Win32\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|x64.ActiveCfg = Release|x64\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|x64.Build.0 = Release|x64\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_2012.sln",
    "content": "Microsoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2012\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libusb-1.0 (static)\", \"libusb_static_2012.vcxproj\", \"{349EE8F9-7D25-4909-AAF5-FF3FADE72187}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libusb-1.0 (dll)\", \"libusb_dll_2012.vcxproj\", \"{349EE8FA-7D25-4909-AAF5-FF3FADE72187}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"listdevs\", \"listdevs_2012.vcxproj\", \"{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"xusb\", \"xusb_2012.vcxproj\", \"{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"fxload\", \"fxload_2012.vcxproj\", \"{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} = {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}\n\tEndProjectSection\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"getopt\", \"getopt_2012.vcxproj\", \"{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"stress\", \"stress_2012.vcxproj\", \"{53942EFF-C810-458D-B3CB-EE5CE9F1E781}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"hotplugtest\", \"hotplugtest_2012.vcxproj\", \"{99D2AC64-DC66-4422-91CE-6715C403C9E5}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Win32 = Debug|Win32\n\t\tDebug|x64 = Debug|x64\n\t\tRelease|Win32 = Release|Win32\n\t\tRelease|x64 = Release|x64\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.Build.0 = Debug|x64\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.Build.0 = Release|Win32\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|x64.ActiveCfg = Release|x64\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|x64.Build.0 = Release|x64\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|x64.ActiveCfg = Release|x64\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.Build.0 = Debug|x64\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.Build.0 = Release|Win32\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.ActiveCfg = Release|x64\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.Build.0 = Release|x64\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|x64.Build.0 = Debug|x64\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.Build.0 = Release|Win32\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.ActiveCfg = Release|x64\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.Build.0 = Release|x64\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|x64.Build.0 = Debug|x64\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|Win32.Build.0 = Release|Win32\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|x64.ActiveCfg = Release|x64\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|x64.Build.0 = Release|x64\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.Build.0 = Debug|x64\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.Build.0 = Release|Win32\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.ActiveCfg = Release|x64\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.Build.0 = Release|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.Build.0 = Debug|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.Build.0 = Release|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.ActiveCfg = Release|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.Build.0 = Release|x64\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|x64.Build.0 = Debug|x64\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|Win32.Build.0 = Release|Win32\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|x64.ActiveCfg = Release|x64\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|x64.Build.0 = Release|x64\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_2013.sln",
    "content": "Microsoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2013\nVisualStudioVersion = 12.0.21005.1\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libusb-1.0 (static)\", \"libusb_static_2013.vcxproj\", \"{349EE8F9-7D25-4909-AAF5-FF3FADE72187}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libusb-1.0 (dll)\", \"libusb_dll_2013.vcxproj\", \"{349EE8FA-7D25-4909-AAF5-FF3FADE72187}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"listdevs\", \"listdevs_2013.vcxproj\", \"{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"xusb\", \"xusb_2013.vcxproj\", \"{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"fxload\", \"fxload_2013.vcxproj\", \"{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} = {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}\n\tEndProjectSection\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"getopt\", \"getopt_2013.vcxproj\", \"{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"stress\", \"stress_2013.vcxproj\", \"{53942EFF-C810-458D-B3CB-EE5CE9F1E781}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"hotplugtest\", \"hotplugtest_2013.vcxproj\", \"{99D2AC64-DC66-4422-91CE-6715C403C9E5}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Win32 = Debug|Win32\n\t\tDebug|x64 = Debug|x64\n\t\tRelease|Win32 = Release|Win32\n\t\tRelease|x64 = Release|x64\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.Build.0 = Debug|x64\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.Build.0 = Release|Win32\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|x64.ActiveCfg = Release|x64\n\t\t{349EE8F9-7D25-4909-AAF5-FF3FADE72187}.Release|x64.Build.0 = Release|x64\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Debug|x64.Build.0 = Debug|x64\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|Win32.Build.0 = Release|Win32\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|x64.ActiveCfg = Release|x64\n\t\t{349EE8FA-7D25-4909-AAF5-FF3FADE72187}.Release|x64.Build.0 = Release|x64\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.Build.0 = Debug|x64\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.Build.0 = Release|Win32\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.ActiveCfg = Release|x64\n\t\t{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.Build.0 = Release|x64\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Debug|x64.Build.0 = Debug|x64\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|Win32.Build.0 = Release|Win32\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.ActiveCfg = Release|x64\n\t\t{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}.Release|x64.Build.0 = Release|x64\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Debug|x64.Build.0 = Debug|x64\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|Win32.Build.0 = Release|Win32\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|x64.ActiveCfg = Release|x64\n\t\t{9E166F7A-A793-9FB6-0A67-F0AED8AE8C88}.Release|x64.Build.0 = Release|x64\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.Build.0 = Debug|x64\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.Build.0 = Release|Win32\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.ActiveCfg = Release|x64\n\t\t{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.Build.0 = Release|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Debug|x64.Build.0 = Debug|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|Win32.Build.0 = Release|Win32\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.ActiveCfg = Release|x64\n\t\t{53942EFF-C810-458D-B3CB-EE5CE9F1E781}.Release|x64.Build.0 = Release|x64\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Debug|x64.Build.0 = Debug|x64\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|Win32.Build.0 = Release|Win32\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|x64.ActiveCfg = Release|x64\n\t\t{99D2AC64-DC66-4422-91CE-6715C403C9E5}.Release|x64.Build.0 = Release|x64\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_dll.dsp",
    "content": "# Microsoft Developer Studio Project File - Name=\"libusb_dll\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** DO NOT EDIT **\n\n# TARGTYPE \"Win32 (x86) Dynamic-Link Library\" 0x0102\n\nCFG=libusb_dll - Win32 Debug\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n!MESSAGE use the Export Makefile command and run\n!MESSAGE \n!MESSAGE NMAKE /f \"libusb_dll.mak\".\n!MESSAGE \n!MESSAGE You can specify a configuration when running NMAKE\n!MESSAGE by defining the macro CFG on the command line. For example:\n!MESSAGE \n!MESSAGE NMAKE /f \"libusb_dll.mak\" CFG=\"libusb_dll - Win32 Debug\"\n!MESSAGE \n!MESSAGE Possible choices for configuration are:\n!MESSAGE \n!MESSAGE \"libusb_dll - Win32 Release\" (based on \"Win32 (x86) Dynamic-Link Library\")\n!MESSAGE \"libusb_dll - Win32 Debug\" (based on \"Win32 (x86) Dynamic-Link Library\")\n!MESSAGE \n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nMTL=midl.exe\nRSC=rc.exe\n\n!IF  \"$(CFG)\" == \"libusb_dll - Win32 Release\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \"Release\"\n# PROP BASE Intermediate_Dir \"Release\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \"../Win32/Release/dll\"\n# PROP Intermediate_Dir \"../Win32/Release/dll\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /D \"_USRDLL\" /D \"LIBUSB_DLL_EXPORTS\" /YX /FD /c\n# ADD CPP /nologo /MD /W3 /GX /O2 /I \".\" /I \"../libusb\" /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /D \"_UNICODE\" /D \"UNICODE\" /U \"_MBCS\" /D \"_USRDLL\" /FR /FD /EHsc /c\n# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\n# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\n# ADD BASE RSC /l 0x409 /d \"NDEBUG\"\n# ADD RSC /l 0x409 /d \"NDEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLINK32=link.exe\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:\"Win32/Release/dll/libusb-1.0.dll\"\n\n!ELSEIF  \"$(CFG)\" == \"libusb_dll - Win32 Debug\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 1\n# PROP BASE Output_Dir \"Debug\"\n# PROP BASE Intermediate_Dir \"Debug\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 1\n# PROP Output_Dir \"../Win32/Debug/dll\"\n# PROP Intermediate_Dir \"../Win32/Debug/dll\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /D \"_USRDLL\" /D \"LIBUSB_DLL_EXPORTS\" /YX /FD /GZ /c\n# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I \".\" /I \"../libusb\" /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /D \"_UNICODE\" /D \"UNICODE\" /U \"_MBCS\" /D \"_USRDLL\" /FR /FD /EHsc /c\n# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\n# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\n# ADD BASE RSC /l 0x409 /d \"_DEBUG\"\n# ADD RSC /l 0x409 /d \"_DEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo /n\nLINK32=link.exe\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:\"Win32/Debug/dll/libusb-1.0.dll\"\n# SUBTRACT LINK32 /pdb:none /incremental:no\n\n!ENDIF \n\n# Begin Target\n\n# Name \"libusb_dll - Win32 Release\"\n# Name \"libusb_dll - Win32 Debug\"\n# Begin Group \"Source Files\"\n\n# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\n# Begin Source File\n\nSOURCE=..\\libusb\\core.c\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\darwin_usb.c\n# PROP Exclude_From_Build 1\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\descriptor.c\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\io.c\n# End Source File\n# Begin Source File\n\nSOURCE=\"..\\libusb\\libusb-1.0.rc\"\n# End Source File\n# Begin Source File\n\nSOURCE=\"..\\libusb\\libusb-1.0.def\"\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\linux_usbfs.c\n# PROP Exclude_From_Build 1\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\poll_windows.c\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\sync.c\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\threads_windows.c\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\windows_usb.c\n# End Source File\n# End Group\n# Begin Group \"Header Files\"\n\n# PROP Default_Filter \"h;hpp;hxx;hm;inl\"\n# Begin Source File\n\nSOURCE=.\\config.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\darwin_usb.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\libusb.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\libusbi.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\linux_usbfs.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\poll_posix.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\poll_windows.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\threads_posix.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\threads_windows.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\windows_usb.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\windows_common.h\n# End Source File\n# End Group\n# Begin Group \"Resource Files\"\n\n# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\"\n# End Group\n# End Target\n# End Project\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_dll_2005.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"libusb-1.0 (dll)\"\n\tProjectGUID=\"{8224C054-5968-4238-832C-167155E7ECC3}\"\n\tRootNamespace=\"libusbdll\"\n\tKeyword=\"Win32Proj\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"x64\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tModuleDefinitionFile=\"..\\libusb\\libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|x64\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tModuleDefinitionFile=\"..\\libusb\\libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tTargetMachine=\"17\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"1\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tModuleDefinitionFile=\"..\\libusb\\libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|x64\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"1\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tModuleDefinitionFile=\"..\\libusb\\libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"2\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"17\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx\"\n\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\core.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\descriptor.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\hotplug.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\io.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\poll_windows.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\strerror.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\sync.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\threads_windows.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\windows_usb.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc;xsd\"\n\t\t\tUniqueIdentifier=\"{93995380-89BD-4b04-88EB-625FBE52EBFB}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\config.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\hotplug.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\libusb.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\libusbi.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\poll_windows.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\threads_windows.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\windows_usb.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\windows_common.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Resource Files\"\n\t\t\tFilter=\"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav\"\n\t\t\tUniqueIdentifier=\"{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\libusb-1.0.def\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\libusb-1.0.rc\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_dll_2010.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>libusb-1.0 (dll)</ProjectName>\n    <ProjectGuid>{349EE8FA-7D25-4909-AAF5-FF3FADE72187}</ProjectGuid>\n    <RootNamespace>libusbdll</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\libusb-1.0\\</IntDir>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">libusb-1.0</TargetName>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <OutputFile>$(OutDir)libusb-1.0.dll</OutputFile>\n      <ModuleDefinitionFile>..\\libusb\\libusb-1.0.def</ModuleDefinitionFile>\n      <EmbedManagedResourceFile>libusb-1.0.rc;%(EmbedManagedResourceFile)</EmbedManagedResourceFile>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_WIN64;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <OutputFile>$(OutDir)libusb-1.0.dll</OutputFile>\n      <ModuleDefinitionFile>..\\libusb\\libusb-1.0.def</ModuleDefinitionFile>\n      <EmbedManagedResourceFile>libusb-1.0.rc;%(EmbedManagedResourceFile)</EmbedManagedResourceFile>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n    </ClCompile>\n    <Link>\n      <OutputFile>$(OutDir)libusb-1.0.dll</OutputFile>\n      <ModuleDefinitionFile>..\\libusb\\libusb-1.0.def</ModuleDefinitionFile>\n      <EmbedManagedResourceFile>libusb-1.0.rc;%(EmbedManagedResourceFile)</EmbedManagedResourceFile>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_WIN64;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n    </ClCompile>\n    <Link>\n      <OutputFile>$(OutDir)libusb-1.0.dll</OutputFile>\n      <ModuleDefinitionFile>..\\libusb\\libusb-1.0.def</ModuleDefinitionFile>\n      <EmbedManagedResourceFile>libusb-1.0.rc;%(EmbedManagedResourceFile)</EmbedManagedResourceFile>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\libusb\\core.c\" />\n    <ClCompile Include=\"..\\libusb\\descriptor.c\" />\n    <ClCompile Include=\"..\\libusb\\hotplug.c\" />\n    <ClCompile Include=\"..\\libusb\\io.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\poll_windows.c\" />\n    <ClCompile Include=\"..\\libusb\\strerror.c\" />\n    <ClCompile Include=\"..\\libusb\\sync.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\threads_windows.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\windows_usb.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\".\\config.h\" />\n    <ClInclude Include=\"..\\libusb\\hotplug.h\" />\n    <ClInclude Include=\"..\\libusb\\libusb.h\" />\n    <ClInclude Include=\"..\\libusb\\libusbi.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\poll_windows.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\threads_windows.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\windows_usb.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\windows_common.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\libusb\\libusb-1.0.def\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ResourceCompile Include=\"..\\libusb\\libusb-1.0.rc\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_dll_2010.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{d81e81ca-b13e-4a15-b54b-b12b41361e6b}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\libusb\\core.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\descriptor.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\hotplug.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\io.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\os\\poll_windows.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\strerror.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\sync.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\os\\threads_windows.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\os\\windows_usb.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\".\\config.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\hotplug.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\libusb.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\libusbi.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\os\\poll_windows.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\os\\threads_windows.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\os\\windows_usb.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\os\\windows_common.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\libusb\\libusb-1.0.def\">\n      <Filter>Resource Files</Filter>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <ResourceCompile Include=\"..\\libusb\\libusb-1.0.rc\">\n      <Filter>Resource Files</Filter>\n    </ResourceCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_dll_2012.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>libusb-1.0 (dll)</ProjectName>\n    <ProjectGuid>{349EE8FA-7D25-4909-AAF5-FF3FADE72187}</ProjectGuid>\n    <RootNamespace>libusbdll</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\libusb-1.0\\</IntDir>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">libusb-1.0</TargetName>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <OutputFile>$(OutDir)libusb-1.0.dll</OutputFile>\n      <ModuleDefinitionFile>..\\libusb\\libusb-1.0.def</ModuleDefinitionFile>\n      <EmbedManagedResourceFile>libusb-1.0.rc;%(EmbedManagedResourceFile)</EmbedManagedResourceFile>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_WIN64;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <OutputFile>$(OutDir)libusb-1.0.dll</OutputFile>\n      <ModuleDefinitionFile>..\\libusb\\libusb-1.0.def</ModuleDefinitionFile>\n      <EmbedManagedResourceFile>libusb-1.0.rc;%(EmbedManagedResourceFile)</EmbedManagedResourceFile>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n    </ClCompile>\n    <Link>\n      <OutputFile>$(OutDir)libusb-1.0.dll</OutputFile>\n      <ModuleDefinitionFile>..\\libusb\\libusb-1.0.def</ModuleDefinitionFile>\n      <EmbedManagedResourceFile>libusb-1.0.rc;%(EmbedManagedResourceFile)</EmbedManagedResourceFile>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_WIN64;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n    </ClCompile>\n    <Link>\n      <OutputFile>$(OutDir)libusb-1.0.dll</OutputFile>\n      <ModuleDefinitionFile>..\\libusb\\libusb-1.0.def</ModuleDefinitionFile>\n      <EmbedManagedResourceFile>libusb-1.0.rc;%(EmbedManagedResourceFile)</EmbedManagedResourceFile>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\libusb\\core.c\" />\n    <ClCompile Include=\"..\\libusb\\descriptor.c\" />\n    <ClCompile Include=\"..\\libusb\\hotplug.c\" />\n    <ClCompile Include=\"..\\libusb\\io.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\poll_windows.c\" />\n    <ClCompile Include=\"..\\libusb\\strerror.c\" />\n    <ClCompile Include=\"..\\libusb\\sync.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\threads_windows.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\windows_usb.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\libusb\\hotplug.h\" />\n    <ClInclude Include=\"..\\libusb\\version.h\" />\n    <ClInclude Include=\"..\\libusb\\version_nano.h\" />\n    <ClInclude Include=\".\\config.h\" />\n    <ClInclude Include=\"..\\libusb\\libusb.h\" />\n    <ClInclude Include=\"..\\libusb\\libusbi.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\poll_windows.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\threads_windows.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\windows_usb.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\libusb\\libusb-1.0.def\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ResourceCompile Include=\"..\\libusb\\libusb-1.0.rc\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_dll_2012.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{d81e81ca-b13e-4a15-b54b-b12b41361e6b}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\libusb\\core.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\descriptor.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\io.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\os\\poll_windows.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\strerror.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\sync.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\os\\threads_windows.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\os\\windows_usb.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\hotplug.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\".\\config.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\libusb.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\libusbi.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\os\\poll_windows.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\os\\threads_windows.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\os\\windows_usb.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\version.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\version_nano.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\hotplug.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\libusb\\libusb-1.0.def\">\n      <Filter>Resource Files</Filter>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <ResourceCompile Include=\"..\\libusb\\libusb-1.0.rc\">\n      <Filter>Resource Files</Filter>\n    </ResourceCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_dll_2013.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>libusb-1.0 (dll)</ProjectName>\n    <ProjectGuid>{349EE8FA-7D25-4909-AAF5-FF3FADE72187}</ProjectGuid>\n    <RootNamespace>libusbdll</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\dll\\libusb-1.0\\</IntDir>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">libusb-1.0</TargetName>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <OutputFile>$(OutDir)libusb-1.0.dll</OutputFile>\n      <ModuleDefinitionFile>..\\libusb\\libusb-1.0.def</ModuleDefinitionFile>\n      <EmbedManagedResourceFile>libusb-1.0.rc;%(EmbedManagedResourceFile)</EmbedManagedResourceFile>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_WIN64;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <OutputFile>$(OutDir)libusb-1.0.dll</OutputFile>\n      <ModuleDefinitionFile>..\\libusb\\libusb-1.0.def</ModuleDefinitionFile>\n      <EmbedManagedResourceFile>libusb-1.0.rc;%(EmbedManagedResourceFile)</EmbedManagedResourceFile>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n    </ClCompile>\n    <Link>\n      <OutputFile>$(OutDir)libusb-1.0.dll</OutputFile>\n      <ModuleDefinitionFile>..\\libusb\\libusb-1.0.def</ModuleDefinitionFile>\n      <EmbedManagedResourceFile>libusb-1.0.rc;%(EmbedManagedResourceFile)</EmbedManagedResourceFile>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_WIN64;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n    </ClCompile>\n    <Link>\n      <OutputFile>$(OutDir)libusb-1.0.dll</OutputFile>\n      <ModuleDefinitionFile>..\\libusb\\libusb-1.0.def</ModuleDefinitionFile>\n      <EmbedManagedResourceFile>libusb-1.0.rc;%(EmbedManagedResourceFile)</EmbedManagedResourceFile>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\libusb\\core.c\" />\n    <ClCompile Include=\"..\\libusb\\descriptor.c\" />\n    <ClCompile Include=\"..\\libusb\\hotplug.c\" />\n    <ClCompile Include=\"..\\libusb\\io.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\poll_windows.c\" />\n    <ClCompile Include=\"..\\libusb\\strerror.c\" />\n    <ClCompile Include=\"..\\libusb\\sync.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\threads_windows.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\windows_usb.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\libusb\\hotplug.h\" />\n    <ClInclude Include=\"..\\libusb\\version.h\" />\n    <ClInclude Include=\"..\\libusb\\version_nano.h\" />\n    <ClInclude Include=\".\\config.h\" />\n    <ClInclude Include=\"..\\libusb\\libusb.h\" />\n    <ClInclude Include=\"..\\libusb\\libusbi.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\poll_windows.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\threads_windows.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\windows_usb.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\libusb\\libusb-1.0.def\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ResourceCompile Include=\"..\\libusb\\libusb-1.0.rc\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_dll_wince.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"libusb-1.0 (dll)\"\n\tProjectGUID=\"{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}\"\n\tRootNamespace=\"libusb\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (ARMV4I)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSII)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSII_FP)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSIV)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSIV_FP)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (SH4)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (x86)\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (ARMV4I)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t\tForcedIncludeFiles=\"\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tModuleDefinitionFile=\"../libusb/libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"%CSIDL_PROGRAM_FILES%\\lsusb\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSII)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tModuleDefinitionFile=\"../libusb/libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSII_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tModuleDefinitionFile=\"../libusb/libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSIV)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tModuleDefinitionFile=\"../libusb/libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSIV_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tModuleDefinitionFile=\"../libusb/libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (SH4)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tModuleDefinitionFile=\"../libusb/libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (x86)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tIgnoreDefaultLibraryNames=\"oldnames.lib,libc.lib\"\n\t\t\t\tModuleDefinitionFile=\"../libusb/libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (ARMV4I)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tModuleDefinitionFile=\"../libusb/libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSII)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tModuleDefinitionFile=\"../libusb/libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSII_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tModuleDefinitionFile=\"../libusb/libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSIV)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tModuleDefinitionFile=\"../libusb/libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSIV_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tModuleDefinitionFile=\"../libusb/libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (SH4)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tModuleDefinitionFile=\"../libusb/libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (x86)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\dll\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\dll\\libusb-1.0\"\n\t\t\tConfigurationType=\"2\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.dll\"\n\t\t\t\tIgnoreDefaultLibraryNames=\"oldnames.lib,libc.lib\"\n\t\t\t\tModuleDefinitionFile=\"../libusb/libusb-1.0.def\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx\"\n\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\core.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\descriptor.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\hotplug.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\io.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"missing.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\poll_windows.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\strerror.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\sync.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\threads_windows.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\wince_usb.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc;xsd\"\n\t\t\tUniqueIdentifier=\"{93995380-89BD-4b04-88EB-625FBE52EBFB}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"config.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"errno.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\libusb.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\libusbi.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"missing.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\poll_windows.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\threads_windows.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\version.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\wince_usb.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\windows_common.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Resource Files\"\n\t\t\tFilter=\"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav\"\n\t\t\tUniqueIdentifier=\"{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\libusb-1.0.def\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\libusb-1.0.rc\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_sources",
    "content": "#TARGETTYPE is not defined, to allow selection between static lib or DLL with ddk_build\nTARGETNAME=libusb-1.0\nDLLDEF=..\\libusb-1.0.def\n\n!IFNDEF MSC_WARNING_LEVEL\nMSC_WARNING_LEVEL=/W3\n!ENDIF\n\n!IFDEF STATIC_LIBC\nUSE_LIBCMT=1\n!ELSE\nUSE_MSVCRT=1\n!ENDIF\n\nINCLUDES=..;..\\..\\msvc;$(DDK_INC_PATH)\nC_DEFINES= $(C_DEFINES) $(LIBUSB_DEFINES) /DDDKBUILD\n\n# http://jpassing.com/2009/10/21/ltcg-issues-with-the-win7amd64-environment-of-wdk-7600/\n# prevents the following error when using the 64 bit static lib with Visual Studio 2010:\n# \"fatal error C1001: An internal error has occurred in the compiler.\n# (compiler file 'f:\\dd\\vctools\\compiler\\utc\\src\\p2\\p2symtab.c', line 1823)\"\n# and the following with Visual Studio 2010:\n# \"fatal error C1047: The object or library file 'libusb-1.0.lib' was created with\n#  an older compiler than other objects; rebuild old objects and libraries\"\nUSER_C_FLAGS=/GL-\n\nTARGETLIBS=$(SDK_LIB_PATH)\\kernel32.lib\n\nSOURCES=..\\core.c \\\n\t..\\descriptor.c \\\n\t..\\io.c \\\n\t..\\strerror.c \\\n\t..\\sync.c \\\n\t..\\hotplug.c \\\n\tthreads_windows.c \\\n\tpoll_windows.c \\\n\twindows_usb.c \\\n\t..\\libusb-1.0.rc\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_static.dsp",
    "content": "# Microsoft Developer Studio Project File - Name=\"libusb_static\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** DO NOT EDIT **\n\n# TARGTYPE \"Win32 (x86) Static Library\" 0x0104\n\nCFG=libusb_static - Win32 Debug\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n!MESSAGE use the Export Makefile command and run\n!MESSAGE \n!MESSAGE NMAKE /f \"libusb_static.mak\".\n!MESSAGE \n!MESSAGE You can specify a configuration when running NMAKE\n!MESSAGE by defining the macro CFG on the command line. For example:\n!MESSAGE \n!MESSAGE NMAKE /f \"libusb_static.mak\" CFG=\"libusb_static - Win32 Debug\"\n!MESSAGE \n!MESSAGE Possible choices for configuration are:\n!MESSAGE \n!MESSAGE \"libusb_static - Win32 Release\" (based on \"Win32 (x86) Static Library\")\n!MESSAGE \"libusb_static - Win32 Debug\" (based on \"Win32 (x86) Static Library\")\n!MESSAGE \n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nRSC=rc.exe\n\n!IF  \"$(CFG)\" == \"libusb_static - Win32 Release\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \"Release\"\n# PROP BASE Intermediate_Dir \"Release\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \"../Win32/Release/lib\"\n# PROP Intermediate_Dir \"../Win32/Release/lib\"\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_LIB\" /YX /FD /c\n# ADD CPP /nologo /MD /W3 /GX /O2 /I \".\" /I \"../libusb\" /D \"WIN32\" /D \"NDEBUG\" /D \"_UNICODE\" /D \"UNICODE\" /U \"_MBCS\" /D \"_LIB\" /FR /FD /EHsc /c\n# ADD BASE RSC /l 0x409 /d \"NDEBUG\"\n# ADD RSC /l 0x409 /d \"NDEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLIB32=link.exe -lib\n# ADD BASE LIB32 /nologo\n# ADD LIB32 /nologo /out:\"../Win32/Release/lib/libusb-1.0.lib\"\n\n!ELSEIF  \"$(CFG)\" == \"libusb_static - Win32 Debug\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 1\n# PROP BASE Output_Dir \"Debug\"\n# PROP BASE Intermediate_Dir \"Debug\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 1\n# PROP Output_Dir \"../Win32/Debug/lib\"\n# PROP Intermediate_Dir \"../Win32/Debug/lib\"\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_LIB\" /YX /FD /GZ /c\n# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I \".\" /I \"../libusb\" /D \"WIN32\" /D \"_DEBUG\" /D \"_UNICODE\" /D \"UNICODE\" /U \"_MBCS\" /D \"_LIB\" /FR /FD /GZ /EHsc /c\n# ADD BASE RSC /l 0x409 /d \"_DEBUG\"\n# ADD RSC /l 0x409 /d \"_DEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo /n\nLIB32=link.exe -lib\n# ADD BASE LIB32 /nologo\n# ADD LIB32 /nologo /out:\"../Win32/Debug/lib/libusb-1.0.lib\"\n\n!ENDIF \n\n# Begin Target\n\n# Name \"libusb_static - Win32 Release\"\n# Name \"libusb_static - Win32 Debug\"\n# Begin Group \"Source Files\"\n\n# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\n# Begin Source File\n\nSOURCE=..\\libusb\\core.c\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\darwin_usb.c\n# PROP Exclude_From_Build 1\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\descriptor.c\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\io.c\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\linux_usbfs.c\n# PROP Exclude_From_Build 1\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\poll_windows.c\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\sync.c\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\threads_windows.c\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\windows_usb.c\n# End Source File\n# End Group\n# Begin Group \"Header Files\"\n\n# PROP Default_Filter \"h;hpp;hxx;hm;inl\"\n# Begin Source File\n\nSOURCE=.\\config.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\darwin_usb.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\libusb.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\libusbi.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\linux_usbfs.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\poll_posix.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\poll_windows.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\threads_posix.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\threads_windows.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\windows_usb.h\n# End Source File\n# Begin Source File\n\nSOURCE=..\\libusb\\os\\windows_common.h\n# End Source File\n# End Group\n# End Target\n# End Project\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_static_2005.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"libusb-1.0 (static)\"\n\tProjectGUID=\"{5AB6B770-1925-48D5-ABC2-930F3259C020}\"\n\tRootNamespace=\"libusb\"\n\tKeyword=\"Win32Proj\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"x64\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"1\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|x64\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|x64\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"1\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx\"\n\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\core.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\descriptor.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\hotplug.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\io.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\strerror.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\sync.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\threads_windows.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\poll_windows.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\windows_usb.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc;xsd\"\n\t\t\tUniqueIdentifier=\"{93995380-89BD-4b04-88EB-625FBE52EBFB}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\".\\config.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\hotplug.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\libusb.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\libusbi.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\threads_windows.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\poll_windows.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\windows_usb.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\windows_common.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_static_2010.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>libusb-1.0 (static)</ProjectName>\n    <ProjectGuid>{349EE8F9-7D25-4909-AAF5-FF3FADE72187}</ProjectGuid>\n    <RootNamespace>libusb</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\libusb-1.0\\</IntDir>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">libusb-1.0</TargetName>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)libusb-1.0.lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_WIN64;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)libusb-1.0.lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)libusb-1.0.lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_WIN64;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)libusb-1.0.lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\libusb\\core.c\" />\n    <ClCompile Include=\"..\\libusb\\descriptor.c\" />\n    <ClCompile Include=\"..\\libusb\\hotplug.c\" />\n    <ClCompile Include=\"..\\libusb\\io.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\poll_windows.c\" />\n    <ClCompile Include=\"..\\libusb\\strerror.c\" />\n    <ClCompile Include=\"..\\libusb\\sync.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\threads_windows.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\windows_usb.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\".\\config.h\" />\n    <ClInclude Include=\"..\\libusb\\hotplug.h\" />\n    <ClInclude Include=\"..\\libusb\\version.h\" />\n    <ClInclude Include=\"..\\libusb\\version_nano.h\" />\n    <ClInclude Include=\"..\\libusb\\libusb.h\" />\n    <ClInclude Include=\"..\\libusb\\libusbi.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\poll_windows.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\threads_windows.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\windows_usb.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\windows_common.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_static_2010.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\libusb\\core.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\descriptor.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\io.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\os\\poll_windows.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\strerror.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\sync.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\os\\threads_windows.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\os\\windows_usb.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\hotplug.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\".\\config.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\libusb.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\libusbi.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\os\\poll_windows.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\os\\threads_windows.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\os\\windows_usb.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\os\\windows_common.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\version_nano.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\version.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\hotplug.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_static_2012.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>libusb-1.0 (static)</ProjectName>\n    <ProjectGuid>{349EE8F9-7D25-4909-AAF5-FF3FADE72187}</ProjectGuid>\n    <RootNamespace>libusb</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\libusb-1.0\\</IntDir>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">libusb-1.0</TargetName>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)libusb-1.0.lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_WIN64;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)libusb-1.0.lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)libusb-1.0.lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_WIN64;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)libusb-1.0.lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\libusb\\core.c\" />\n    <ClCompile Include=\"..\\libusb\\descriptor.c\" />\n    <ClCompile Include=\"..\\libusb\\hotplug.c\" />\n    <ClCompile Include=\"..\\libusb\\io.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\poll_windows.c\" />\n    <ClCompile Include=\"..\\libusb\\strerror.c\" />\n    <ClCompile Include=\"..\\libusb\\sync.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\threads_windows.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\windows_usb.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\libusb\\hotplug.h\" />\n    <ClInclude Include=\"..\\libusb\\version.h\" />\n    <ClInclude Include=\"..\\libusb\\version_nano.h\" />\n    <ClInclude Include=\".\\config.h\" />\n    <ClInclude Include=\"..\\libusb\\libusb.h\" />\n    <ClInclude Include=\"..\\libusb\\libusbi.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\poll_windows.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\threads_windows.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\windows_usb.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\windows_common.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_static_2012.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\libusb\\core.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\descriptor.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\io.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\os\\poll_windows.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\strerror.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\sync.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\os\\threads_windows.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\os\\windows_usb.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\libusb\\hotplug.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\".\\config.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\libusb.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\libusbi.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\os\\poll_windows.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\os\\threads_windows.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\os\\windows_usb.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\os\\windows_common.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\version_nano.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\version.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\libusb\\hotplug.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_static_2013.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>libusb-1.0 (static)</ProjectName>\n    <ProjectGuid>{349EE8F9-7D25-4909-AAF5-FF3FADE72187}</ProjectGuid>\n    <RootNamespace>libusb</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\libusb-1.0\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\lib\\libusb-1.0\\</IntDir>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">libusb-1.0</TargetName>\n    <TargetName Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">libusb-1.0</TargetName>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)libusb-1.0.lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_WIN64;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)libusb-1.0.lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)libusb-1.0.lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_WIN32;_WIN64;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level4</WarningLevel>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)libusb-1.0.lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\libusb\\core.c\" />\n    <ClCompile Include=\"..\\libusb\\descriptor.c\" />\n    <ClCompile Include=\"..\\libusb\\hotplug.c\" />\n    <ClCompile Include=\"..\\libusb\\io.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\poll_windows.c\" />\n    <ClCompile Include=\"..\\libusb\\strerror.c\" />\n    <ClCompile Include=\"..\\libusb\\sync.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\threads_windows.c\" />\n    <ClCompile Include=\"..\\libusb\\os\\windows_usb.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\libusb\\hotplug.h\" />\n    <ClInclude Include=\"..\\libusb\\version.h\" />\n    <ClInclude Include=\"..\\libusb\\version_nano.h\" />\n    <ClInclude Include=\".\\config.h\" />\n    <ClInclude Include=\"..\\libusb\\libusb.h\" />\n    <ClInclude Include=\"..\\libusb\\libusbi.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\poll_windows.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\threads_windows.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\windows_usb.h\" />\n    <ClInclude Include=\"..\\libusb\\os\\windows_common.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_static_wince.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"libusb-1.0 (static)\"\n\tProjectGUID=\"{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}\"\n\tRootNamespace=\"libusb\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (ARMV4I)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSII)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSII_FP)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSIV)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSIV_FP)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (SH4)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (x86)\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (ARMV4I)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t\tForcedIncludeFiles=\"\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t\tAdditionalOptions=\"/subsystem:$(CESubsystem)\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"%CSIDL_PROGRAM_FILES%\\lsusb\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSII)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t\tAdditionalOptions=\"/subsystem:$(CESubsystem)\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSII_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t\tAdditionalOptions=\"/subsystem:$(CESubsystem)\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSIV)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t\tAdditionalOptions=\"/subsystem:$(CESubsystem)\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSIV_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t\tAdditionalOptions=\"/subsystem:$(CESubsystem)\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (SH4)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t\tAdditionalOptions=\"/subsystem:$(CESubsystem)\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (x86)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t\tAdditionalOptions=\"/subsystem:$(CESubsystem)\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (ARMV4I)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t\tAdditionalOptions=\"/subsystem:$(CESubsystem)\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSII)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t\tAdditionalOptions=\"/subsystem:$(CESubsystem)\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSII_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t\tAdditionalOptions=\"/subsystem:$(CESubsystem)\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSIV)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t\tAdditionalOptions=\"/subsystem:$(CESubsystem)\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSIV_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t\tAdditionalOptions=\"/subsystem:$(CESubsystem)\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (SH4)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t\tAdditionalOptions=\"/subsystem:$(CESubsystem)\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (x86)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\lib\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\lib\\libusb-1.0\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_USRDLL;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t\tPreprocessorDefinitions=\"WINCE;_WIN32_WCE\"\n\t\t\t\tAdditionalIncludeDirectories=\".\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t\tOutputFile=\"$(OutDir)\\libusb-1.0.lib\"\n\t\t\t\tAdditionalOptions=\"/subsystem:$(CESubsystem)\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx\"\n\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\core.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\descriptor.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\hotplug.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\io.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"missing.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\poll_windows.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\strerror.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\sync.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\threads_windows.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\wince_usb.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc;xsd\"\n\t\t\tUniqueIdentifier=\"{93995380-89BD-4b04-88EB-625FBE52EBFB}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"config.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"errno.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\libusb.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\libusbi.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"missing.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\poll_windows.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\threads_windows.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\version.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\wince_usb.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\os\\windows_common.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Resource Files\"\n\t\t\tFilter=\"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav\"\n\t\t\tUniqueIdentifier=\"{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\libusb-1.0.def\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\libusb\\libusb-1.0.rc\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/libusb_wince.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 9.00\n# Visual Studio 2005\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libusb-1.0 (dll)\", \"libusb_dll_wince.vcproj\", \"{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"listdevs\", \"listdevs_wince.vcproj\", \"{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"xusb\", \"xusb_wince.vcproj\", \"{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libusb-1.0 (static)\", \"libusb_static_wince.vcproj\", \"{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"stress\", \"stress_wince.vcproj\", \"{61476624-3354-48C8-9334-85AC0D624640}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|STANDARDSDK_500 (ARMV4I) = Debug|STANDARDSDK_500 (ARMV4I)\n\t\tDebug|STANDARDSDK_500 (MIPSII) = Debug|STANDARDSDK_500 (MIPSII)\n\t\tDebug|STANDARDSDK_500 (MIPSII_FP) = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\tDebug|STANDARDSDK_500 (MIPSIV) = Debug|STANDARDSDK_500 (MIPSIV)\n\t\tDebug|STANDARDSDK_500 (MIPSIV_FP) = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\tDebug|STANDARDSDK_500 (SH4) = Debug|STANDARDSDK_500 (SH4)\n\t\tDebug|STANDARDSDK_500 (x86) = Debug|STANDARDSDK_500 (x86)\n\t\tRelease|STANDARDSDK_500 (ARMV4I) = Release|STANDARDSDK_500 (ARMV4I)\n\t\tRelease|STANDARDSDK_500 (MIPSII) = Release|STANDARDSDK_500 (MIPSII)\n\t\tRelease|STANDARDSDK_500 (MIPSII_FP) = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\tRelease|STANDARDSDK_500 (MIPSIV) = Release|STANDARDSDK_500 (MIPSIV)\n\t\tRelease|STANDARDSDK_500 (MIPSIV_FP) = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\tRelease|STANDARDSDK_500 (SH4) = Release|STANDARDSDK_500 (SH4)\n\t\tRelease|STANDARDSDK_500 (x86) = Release|STANDARDSDK_500 (x86)\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (ARMV4I).ActiveCfg = Debug|STANDARDSDK_500 (ARMV4I)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (ARMV4I).Build.0 = Debug|STANDARDSDK_500 (ARMV4I)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (ARMV4I).Deploy.0 = Debug|STANDARDSDK_500 (ARMV4I)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSII).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSII).Build.0 = Debug|STANDARDSDK_500 (MIPSII)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSII).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSII_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSIV).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSIV).Build.0 = Debug|STANDARDSDK_500 (MIPSIV)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSIV).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (SH4).ActiveCfg = Debug|STANDARDSDK_500 (SH4)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (SH4).Build.0 = Debug|STANDARDSDK_500 (SH4)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (SH4).Deploy.0 = Debug|STANDARDSDK_500 (SH4)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (x86).ActiveCfg = Debug|STANDARDSDK_500 (x86)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (x86).Build.0 = Debug|STANDARDSDK_500 (x86)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Debug|STANDARDSDK_500 (x86).Deploy.0 = Debug|STANDARDSDK_500 (x86)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (ARMV4I).ActiveCfg = Release|STANDARDSDK_500 (ARMV4I)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (ARMV4I).Build.0 = Release|STANDARDSDK_500 (ARMV4I)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (ARMV4I).Deploy.0 = Release|STANDARDSDK_500 (ARMV4I)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSII).ActiveCfg = Release|STANDARDSDK_500 (MIPSII)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSII).Build.0 = Release|STANDARDSDK_500 (MIPSII)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSII).Deploy.0 = Release|STANDARDSDK_500 (MIPSII)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSII_FP).Build.0 = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSIV).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSIV).Build.0 = Release|STANDARDSDK_500 (MIPSIV)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSIV).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (SH4).ActiveCfg = Release|STANDARDSDK_500 (SH4)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (SH4).Build.0 = Release|STANDARDSDK_500 (SH4)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (SH4).Deploy.0 = Release|STANDARDSDK_500 (SH4)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (x86).ActiveCfg = Release|STANDARDSDK_500 (x86)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (x86).Build.0 = Release|STANDARDSDK_500 (x86)\n\t\t{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}.Release|STANDARDSDK_500 (x86).Deploy.0 = Release|STANDARDSDK_500 (x86)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (ARMV4I).ActiveCfg = Debug|STANDARDSDK_500 (ARMV4I)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (ARMV4I).Build.0 = Debug|STANDARDSDK_500 (ARMV4I)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (ARMV4I).Deploy.0 = Debug|STANDARDSDK_500 (ARMV4I)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSII).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSII).Build.0 = Debug|STANDARDSDK_500 (MIPSII)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSII).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSII_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSIV).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSIV).Build.0 = Debug|STANDARDSDK_500 (MIPSIV)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSIV).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (SH4).ActiveCfg = Debug|STANDARDSDK_500 (SH4)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (SH4).Build.0 = Debug|STANDARDSDK_500 (SH4)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (SH4).Deploy.0 = Debug|STANDARDSDK_500 (SH4)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (x86).ActiveCfg = Debug|STANDARDSDK_500 (x86)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (x86).Build.0 = Debug|STANDARDSDK_500 (x86)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Debug|STANDARDSDK_500 (x86).Deploy.0 = Debug|STANDARDSDK_500 (x86)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (ARMV4I).ActiveCfg = Release|STANDARDSDK_500 (ARMV4I)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (ARMV4I).Build.0 = Release|STANDARDSDK_500 (ARMV4I)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (ARMV4I).Deploy.0 = Release|STANDARDSDK_500 (ARMV4I)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSII).ActiveCfg = Release|STANDARDSDK_500 (MIPSII)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSII).Build.0 = Release|STANDARDSDK_500 (MIPSII)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSII).Deploy.0 = Release|STANDARDSDK_500 (MIPSII)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSII_FP).Build.0 = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSIV).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSIV).Build.0 = Release|STANDARDSDK_500 (MIPSIV)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSIV).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (SH4).ActiveCfg = Release|STANDARDSDK_500 (SH4)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (SH4).Build.0 = Release|STANDARDSDK_500 (SH4)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (SH4).Deploy.0 = Release|STANDARDSDK_500 (SH4)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (x86).ActiveCfg = Release|STANDARDSDK_500 (x86)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (x86).Build.0 = Release|STANDARDSDK_500 (x86)\n\t\t{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}.Release|STANDARDSDK_500 (x86).Deploy.0 = Release|STANDARDSDK_500 (x86)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (ARMV4I).ActiveCfg = Debug|STANDARDSDK_500 (ARMV4I)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (ARMV4I).Build.0 = Debug|STANDARDSDK_500 (ARMV4I)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (ARMV4I).Deploy.0 = Debug|STANDARDSDK_500 (ARMV4I)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSII).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSII).Build.0 = Debug|STANDARDSDK_500 (MIPSII)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSII).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSII_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSIV).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSIV).Build.0 = Debug|STANDARDSDK_500 (MIPSIV)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSIV).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (SH4).ActiveCfg = Debug|STANDARDSDK_500 (SH4)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (SH4).Build.0 = Debug|STANDARDSDK_500 (SH4)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (SH4).Deploy.0 = Debug|STANDARDSDK_500 (SH4)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (x86).ActiveCfg = Debug|STANDARDSDK_500 (x86)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (x86).Build.0 = Debug|STANDARDSDK_500 (x86)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Debug|STANDARDSDK_500 (x86).Deploy.0 = Debug|STANDARDSDK_500 (x86)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (ARMV4I).ActiveCfg = Release|STANDARDSDK_500 (ARMV4I)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (ARMV4I).Build.0 = Release|STANDARDSDK_500 (ARMV4I)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (ARMV4I).Deploy.0 = Release|STANDARDSDK_500 (ARMV4I)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSII).ActiveCfg = Release|STANDARDSDK_500 (MIPSII)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSII).Build.0 = Release|STANDARDSDK_500 (MIPSII)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSII).Deploy.0 = Release|STANDARDSDK_500 (MIPSII)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSII_FP).Build.0 = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSIV).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSIV).Build.0 = Release|STANDARDSDK_500 (MIPSIV)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSIV).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (SH4).ActiveCfg = Release|STANDARDSDK_500 (SH4)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (SH4).Build.0 = Release|STANDARDSDK_500 (SH4)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (SH4).Deploy.0 = Release|STANDARDSDK_500 (SH4)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (x86).ActiveCfg = Release|STANDARDSDK_500 (x86)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (x86).Build.0 = Release|STANDARDSDK_500 (x86)\n\t\t{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}.Release|STANDARDSDK_500 (x86).Deploy.0 = Release|STANDARDSDK_500 (x86)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (ARMV4I).ActiveCfg = Debug|STANDARDSDK_500 (ARMV4I)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (ARMV4I).Build.0 = Debug|STANDARDSDK_500 (ARMV4I)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (ARMV4I).Deploy.0 = Debug|STANDARDSDK_500 (ARMV4I)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSII).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSII).Build.0 = Debug|STANDARDSDK_500 (MIPSII)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSII).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSII_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSIV).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSIV).Build.0 = Debug|STANDARDSDK_500 (MIPSIV)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSIV).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (SH4).ActiveCfg = Debug|STANDARDSDK_500 (SH4)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (SH4).Build.0 = Debug|STANDARDSDK_500 (SH4)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (SH4).Deploy.0 = Debug|STANDARDSDK_500 (SH4)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (x86).ActiveCfg = Debug|STANDARDSDK_500 (x86)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (x86).Build.0 = Debug|STANDARDSDK_500 (x86)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Debug|STANDARDSDK_500 (x86).Deploy.0 = Debug|STANDARDSDK_500 (x86)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (ARMV4I).ActiveCfg = Release|STANDARDSDK_500 (ARMV4I)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (ARMV4I).Build.0 = Release|STANDARDSDK_500 (ARMV4I)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (ARMV4I).Deploy.0 = Release|STANDARDSDK_500 (ARMV4I)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSII).ActiveCfg = Release|STANDARDSDK_500 (MIPSII)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSII).Build.0 = Release|STANDARDSDK_500 (MIPSII)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSII).Deploy.0 = Release|STANDARDSDK_500 (MIPSII)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSII_FP).Build.0 = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSIV).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSIV).Build.0 = Release|STANDARDSDK_500 (MIPSIV)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSIV).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (SH4).ActiveCfg = Release|STANDARDSDK_500 (SH4)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (SH4).Build.0 = Release|STANDARDSDK_500 (SH4)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (SH4).Deploy.0 = Release|STANDARDSDK_500 (SH4)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (x86).ActiveCfg = Release|STANDARDSDK_500 (x86)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (x86).Build.0 = Release|STANDARDSDK_500 (x86)\n\t\t{CE67BEFB-37EA-4F5C-A60E-F2D0CC91B6AA}.Release|STANDARDSDK_500 (x86).Deploy.0 = Release|STANDARDSDK_500 (x86)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (ARMV4I).ActiveCfg = Debug|STANDARDSDK_500 (ARMV4I)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (ARMV4I).Build.0 = Debug|STANDARDSDK_500 (ARMV4I)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (ARMV4I).Deploy.0 = Debug|STANDARDSDK_500 (ARMV4I)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSII).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSII).Build.0 = Debug|STANDARDSDK_500 (MIPSII)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSII).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSII_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII_FP)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSIV).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSIV).Build.0 = Debug|STANDARDSDK_500 (MIPSIV)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSIV).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (SH4).ActiveCfg = Debug|STANDARDSDK_500 (SH4)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (SH4).Build.0 = Debug|STANDARDSDK_500 (SH4)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (SH4).Deploy.0 = Debug|STANDARDSDK_500 (SH4)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (x86).ActiveCfg = Debug|STANDARDSDK_500 (x86)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (x86).Build.0 = Debug|STANDARDSDK_500 (x86)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Debug|STANDARDSDK_500 (x86).Deploy.0 = Debug|STANDARDSDK_500 (x86)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (ARMV4I).ActiveCfg = Release|STANDARDSDK_500 (ARMV4I)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (ARMV4I).Build.0 = Release|STANDARDSDK_500 (ARMV4I)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (ARMV4I).Deploy.0 = Release|STANDARDSDK_500 (ARMV4I)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSII).ActiveCfg = Release|STANDARDSDK_500 (MIPSII)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSII).Build.0 = Release|STANDARDSDK_500 (MIPSII)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSII).Deploy.0 = Release|STANDARDSDK_500 (MIPSII)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSII_FP).Build.0 = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSII_FP)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSIV).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSIV).Build.0 = Release|STANDARDSDK_500 (MIPSIV)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSIV).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV_FP)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (SH4).ActiveCfg = Release|STANDARDSDK_500 (SH4)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (SH4).Build.0 = Release|STANDARDSDK_500 (SH4)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (SH4).Deploy.0 = Release|STANDARDSDK_500 (SH4)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (x86).ActiveCfg = Release|STANDARDSDK_500 (x86)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (x86).Build.0 = Release|STANDARDSDK_500 (x86)\n\t\t{61476624-3354-48C8-9334-85AC0D624640}.Release|STANDARDSDK_500 (x86).Deploy.0 = Release|STANDARDSDK_500 (x86)\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/listdevs.dsp",
    "content": "# Microsoft Developer Studio Project File - Name=\"listdevs\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** DO NOT EDIT **\n\n# TARGTYPE \"Win32 (x86) Console Application\" 0x0103\n\nCFG=listdevs - Win32 Debug\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n!MESSAGE use the Export Makefile command and run\n!MESSAGE \n!MESSAGE NMAKE /f \"listdevs.mak\".\n!MESSAGE \n!MESSAGE You can specify a configuration when running NMAKE\n!MESSAGE by defining the macro CFG on the command line. For example:\n!MESSAGE \n!MESSAGE NMAKE /f \"listdevs.mak\" CFG=\"listdevs - Win32 Debug\"\n!MESSAGE \n!MESSAGE Possible choices for configuration are:\n!MESSAGE \n!MESSAGE \"listdevs - Win32 Release\" (based on \"Win32 (x86) Console Application\")\n!MESSAGE \"listdevs - Win32 Debug\" (based on \"Win32 (x86) Console Application\")\n!MESSAGE \n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nRSC=rc.exe\n\n!IF  \"$(CFG)\" == \"listdevs - Win32 Release\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \"Release\"\n# PROP BASE Intermediate_Dir \"Release\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \"../Win32/Release/examples\"\n# PROP Intermediate_Dir \"../Win32/Release/examples/listdevs\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /YX /FD /c\n# ADD CPP /nologo /MD /W3 /GX /O2 /I \"../libusb\" /I \".\" /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_UNICODE\" /D \"UNICODE\" /U \"_MBCS\" /FR /FD /EHsc /c\n# ADD BASE RSC /l 0x409 /d \"NDEBUG\"\n# ADD RSC /l 0x409 /d \"NDEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLINK32=link.exe\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n\n!ELSEIF  \"$(CFG)\" == \"listdevs - Win32 Debug\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 1\n# PROP BASE Output_Dir \"Debug\"\n# PROP BASE Intermediate_Dir \"Debug\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 1\n# PROP Output_Dir \"../Win32/Debug/examples\"\n# PROP Intermediate_Dir \"../Win32/Debug/examples/listdevs\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /YX /FD /GZ /c\n# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I \"../libusb\" /I \".\" /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_UNICODE\" /D \"UNICODE\" /U \"_MBCS\" /FR /FD /GZ /EHsc /c\n# ADD BASE RSC /l 0x409 /d \"_DEBUG\"\n# ADD RSC /l 0x409 /d \"_DEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo /n \"../Win32/Debug/dll/core.sbr\" \"../Win32/Debug/dll/descriptor.sbr\" \"../Win32/Debug/dll/io.sbr\" \"../Win32/Debug/dll/sync.sbr\" \"../Win32/Debug/dll/poll_windows.sbr\" \"../Win32/Debug/dll/threads_windows.sbr\" \"../Win32/Debug/dll/windows_usb.sbr\"\nLINK32=link.exe\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386\n# SUBTRACT LINK32 /pdb:none\n\n!ENDIF \n\n# Begin Target\n\n# Name \"listdevs - Win32 Release\"\n# Name \"listdevs - Win32 Debug\"\n# Begin Group \"Source Files\"\n\n# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\n# Begin Source File\n\nSOURCE=..\\examples\\listdevs.c\n# End Source File\n# End Group\n# Begin Group \"Header Files\"\n\n# PROP Default_Filter \"h;hpp;hxx;hm;inl\"\n# End Group\n# Begin Group \"Resource Files\"\n\n# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\"\n# End Group\n# End Target\n# End Project\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/listdevs_2005.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"listdevs\"\n\tProjectGUID=\"{98CFD8FA-EE20-40D5-AF13-F8C4856D6CA5}\"\n\tRootNamespace=\"examples\"\n\tKeyword=\"Win32Proj\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"x64\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_CONSOLE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"1\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"1\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_CONSOLE\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"1\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|x64\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_CONSOLE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"1\"\n\t\t\t\tTargetMachine=\"17\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|x64\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"1\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_CONSOLE\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"1\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"17\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx\"\n\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\examples\\listdevs.c\"\n\t\t\t\t>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release|x64\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t</File>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/listdevs_2010.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>listdevs</ProjectName>\n    <ProjectGuid>{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}</ProjectGuid>\n    <RootNamespace>examples</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <ProgramDatabaseFile>$(TargetDir)$(ProjectName).pdb</ProgramDatabaseFile>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <ProgramDatabaseFile>$(TargetDir)$(ProjectName).pdb</ProgramDatabaseFile>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <AdditionalIncludeDirectories>..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <ProgramDatabaseFile>$(TargetDir)$(ProjectName).pdb</ProgramDatabaseFile>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <ProgramDatabaseFile>$(TargetDir)$(ProjectName).pdb</ProgramDatabaseFile>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\listdevs.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\".\\libusb_static_2010.vcxproj\">\n      <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/listdevs_2010.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\listdevs.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/listdevs_2012.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>listdevs</ProjectName>\n    <ProjectGuid>{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}</ProjectGuid>\n    <RootNamespace>examples</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <ProgramDatabaseFile>$(TargetDir)$(ProjectName).pdb</ProgramDatabaseFile>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <ProgramDatabaseFile>$(TargetDir)$(ProjectName).pdb</ProgramDatabaseFile>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <AdditionalIncludeDirectories>..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <ProgramDatabaseFile>$(TargetDir)$(ProjectName).pdb</ProgramDatabaseFile>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <ProgramDatabaseFile>$(TargetDir)$(ProjectName).pdb</ProgramDatabaseFile>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\listdevs.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\".\\libusb_static_2012.vcxproj\">\n      <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/listdevs_2012.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\listdevs.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/listdevs_2013.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>listdevs</ProjectName>\n    <ProjectGuid>{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}</ProjectGuid>\n    <RootNamespace>examples</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <ProgramDatabaseFile>$(TargetDir)$(ProjectName).pdb</ProgramDatabaseFile>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <ProgramDatabaseFile>$(TargetDir)$(ProjectName).pdb</ProgramDatabaseFile>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <AdditionalIncludeDirectories>..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <ProgramDatabaseFile>$(TargetDir)$(ProjectName).pdb</ProgramDatabaseFile>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <ProgramDatabaseFile>$(TargetDir)$(ProjectName).pdb</ProgramDatabaseFile>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\listdevs.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\".\\libusb_static_2013.vcxproj\">\n      <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/listdevs_sources",
    "content": "TARGETNAME=listdevs\nTARGETTYPE=PROGRAM\n386_STDCALL=0\n\n_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP)\n!IFNDEF MSC_WARNING_LEVEL\nMSC_WARNING_LEVEL=/W3\n!ENDIF\n\n!IFDEF STATIC_LIBC\nUSE_LIBCMT=1\n!ELSE\nUSE_MSVCRT=1\n!ENDIF\n\nUMTYPE=console\nINCLUDES=..\\..\\libusb;$(DDK_INC_PATH)\nUMLIBS=..\\..\\libusb\\os\\obj$(BUILD_ALT_DIR)\\*\\libusb-1.0.lib\nSOURCES=..\\listdevs.c\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/listdevs_wince.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"listdevs\"\n\tProjectGUID=\"{960C3BC3-26D6-49C7-ACE4-0AE65CC049E6}\"\n\tRootNamespace=\"listdevs\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (ARMV4I)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSII)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSII_FP)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSIV)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSIV_FP)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (SH4)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (x86)\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (ARMV4I)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"%CSIDL_PROGRAM_FILES%\\listdevs\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSII)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSII_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSIV)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSIV_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (SH4)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (x86)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tIgnoreDefaultLibraryNames=\"oldnames.lib,libc.lib\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (ARMV4I)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSII)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSII_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSIV)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSIV_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (SH4)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (x86)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tIgnoreDefaultLibraryNames=\"oldnames.lib,libc.lib\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t\t<ProjectReference\n\t\t\tReferencedProjectIdentifier=\"{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}\"\n\t\t\tRelativePathToProject=\".\\libusb-1.0.vcproj\"\n\t\t/>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx\"\n\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\examples\\listdevs.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc;xsd\"\n\t\t\tUniqueIdentifier=\"{93995380-89BD-4b04-88EB-625FBE52EBFB}\"\n\t\t\t>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Resource Files\"\n\t\t\tFilter=\"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav\"\n\t\t\tUniqueIdentifier=\"{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}\"\n\t\t\t>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/missing.c",
    "content": "/*\n * Source file for missing WinCE functionality\n * Copyright © 2012 RealVNC Ltd.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"missing.h\"\n\n#include <config.h>\n#include <libusbi.h>\n\n#include <windows.h>\n\n// The registry path to store environment variables\n#define ENVIRONMENT_REG_PATH _T(\"Software\\\\libusb\\\\environment\")\n\n/* Workaround getenv not being available on WinCE.\n * Instead look in HKLM\\Software\\libusb\\environment */\nchar *getenv(const char *name)\n{\n\tstatic char value[MAX_PATH];\n\tTCHAR wValue[MAX_PATH];\n\tWCHAR wName[MAX_PATH];\n\tDWORD dwType, dwData;\n\tHKEY hkey;\n\tLONG rc;\n\n\tif (!name)\n\t\treturn NULL;\n\n\tif (MultiByteToWideChar(CP_UTF8, 0, name, -1, wName, MAX_PATH) <= 0) {\n\t\tusbi_dbg(\"Failed to convert environment variable name to wide string\");\n\t\treturn NULL;\n\t}\n\twName[MAX_PATH - 1] = 0; // Be sure it's NUL terminated\n\n\trc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, ENVIRONMENT_REG_PATH, 0, KEY_QUERY_VALUE, &hkey);\n\tif (rc != ERROR_SUCCESS) {\n\t\tusbi_dbg(\"Failed to open registry key for getenv with error %d\", rc);\n\t\treturn NULL;\n\t}\n\n\t// Attempt to read the key\n\tdwData = sizeof(wValue);\n\trc = RegQueryValueEx(hkey, wName, NULL, &dwType,\n\t\t(LPBYTE)&wValue, &dwData);\n\tRegCloseKey(hkey);\n\tif (rc != ERROR_SUCCESS) {\n\t\tusbi_dbg(\"Failed to read registry key value for getenv with error %d\", rc);\n\t\treturn NULL;\n\t}\n\tif (dwType != REG_SZ) {\n\t\tusbi_dbg(\"Registry value was of type %d instead of REG_SZ\", dwType);\n\t\treturn NULL;\n\t}\n\n\t// Success in reading the key, convert from WCHAR to char\n\tif (WideCharToMultiByte(CP_UTF8, 0,\n\t\t\twValue, dwData / sizeof(*wValue),\n\t\t\tvalue, MAX_PATH,\n\t\t\tNULL, NULL) <= 0) {\n\t\tusbi_dbg(\"Failed to convert environment variable value to narrow string\");\n\t\treturn NULL;\n\t}\n\tvalue[MAX_PATH - 1] = 0; // Be sure it's NUL terminated\n\treturn value;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/missing.h",
    "content": "/*\n * Header file for missing WinCE functionality\n * Copyright © 2012-2013 RealVNC Ltd.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef MISSING_H\n#define MISSING_H\n\n/* Windows CE doesn't have SleepEx() - Fallback to Sleep() */\n#define SleepEx(m, a) Sleep(m)\n\n/* Windows CE doesn't have any APIs to query environment variables.\n *\n * This contains a registry based implementation of getenv.\n */\nchar *getenv(const char *name);\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/stdint.h",
    "content": "/**\n * This file has no copyright assigned and is placed in the Public Domain.\n * This file was originally part of the w64 mingw-runtime package.\n */\n\n/* ISO C9x  7.18  Integer types <stdint.h>\n * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)\n *\n *  THIS SOFTWARE IS NOT COPYRIGHTED\n *\n *  Contributor: Danny Smith <danny_r_smith_2001@yahoo.co.nz>\n *  Modified for libusb/MSVC: Pete Batard <pbatard@gmail.com>\n *\n *  This source code is offered for use in the public domain. You may\n *  use, modify or distribute it freely.\n *\n *  This code is distributed in the hope that it will be useful but\n *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY\n *  DISCLAIMED. This includes but is not limited to warranties of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n *\n *  Date: 2010-04-02\n */\n\n#ifndef _MSC_VER\n#error This header should only be used with Microsoft compilers\n#endif\n\n#ifndef _STDINT_H\n#define _STDINT_H\n\n#ifndef _INTPTR_T_DEFINED\n#define _INTPTR_T_DEFINED\n#ifndef __intptr_t_defined\n#define __intptr_t_defined\n#undef intptr_t\n#ifdef _WIN64\n  typedef __int64 intptr_t;\n#else\n  typedef int intptr_t;\n#endif /* _WIN64 */\n#endif /* __intptr_t_defined */\n#endif /* _INTPTR_T_DEFINED */\n\n#ifndef _UINTPTR_T_DEFINED\n#define _UINTPTR_T_DEFINED\n#ifndef __uintptr_t_defined\n#define __uintptr_t_defined\n#undef uintptr_t\n#ifdef _WIN64\n  typedef unsigned __int64 uintptr_t;\n#else\n  typedef unsigned int uintptr_t;\n#endif /* _WIN64 */\n#endif /* __uintptr_t_defined */\n#endif /* _UINTPTR_T_DEFINED */\n\n#ifndef _PTRDIFF_T_DEFINED\n#define _PTRDIFF_T_DEFINED\n#ifndef _PTRDIFF_T_\n#define _PTRDIFF_T_\n#undef ptrdiff_t\n#ifdef _WIN64\n  typedef __int64 ptrdiff_t;\n#else\n  typedef int ptrdiff_t;\n#endif /* _WIN64 */\n#endif /* _PTRDIFF_T_ */\n#endif /* _PTRDIFF_T_DEFINED */\n\n#ifndef _WCHAR_T_DEFINED\n#define _WCHAR_T_DEFINED\n#ifndef __cplusplus\n  typedef unsigned short wchar_t;\n#endif /* C++ */\n#endif /* _WCHAR_T_DEFINED */\n\n#ifndef _WCTYPE_T_DEFINED\n#define _WCTYPE_T_DEFINED\n#ifndef _WINT_T\n#define _WINT_T\n  typedef unsigned short wint_t;\n  typedef unsigned short wctype_t;\n#endif /* _WINT_T */\n#endif /* _WCTYPE_T_DEFINED */\n\n/* 7.18.1.1  Exact-width integer types */\ntypedef __int8 int8_t;\ntypedef unsigned __int8   uint8_t;\ntypedef __int16  int16_t;\ntypedef unsigned __int16  uint16_t;\ntypedef __int32  int32_t;\ntypedef unsigned __int32  uint32_t;\ntypedef __int64  int64_t;\ntypedef unsigned __int64   uint64_t;\n\n/* 7.18.1.2  Minimum-width integer types */\ntypedef signed char int_least8_t;\ntypedef unsigned char   uint_least8_t;\ntypedef short  int_least16_t;\ntypedef unsigned short  uint_least16_t;\ntypedef int  int_least32_t;\ntypedef unsigned   uint_least32_t;\ntypedef __int64  int_least64_t;\ntypedef unsigned __int64   uint_least64_t;\n\n/*  7.18.1.3  Fastest minimum-width integer types\n *  Not actually guaranteed to be fastest for all purposes\n *  Here we use the exact-width types for 8 and 16-bit ints.\n */\ntypedef __int8 int_fast8_t;\ntypedef unsigned __int8 uint_fast8_t;\ntypedef __int16  int_fast16_t;\ntypedef unsigned __int16  uint_fast16_t;\ntypedef __int32  int_fast32_t;\ntypedef unsigned  __int32  uint_fast32_t;\ntypedef __int64  int_fast64_t;\ntypedef unsigned __int64   uint_fast64_t;\n\n/* 7.18.1.5  Greatest-width integer types */\ntypedef __int64  intmax_t;\ntypedef unsigned __int64   uintmax_t;\n\n/* 7.18.2  Limits of specified-width integer types */\n\n/* 7.18.2.1  Limits of exact-width integer types */\n#define INT8_MIN (-128)\n#define INT16_MIN (-32768)\n#define INT32_MIN (-2147483647 - 1)\n#define INT64_MIN  (-9223372036854775807LL - 1)\n\n#define INT8_MAX 127\n#define INT16_MAX 32767\n#define INT32_MAX 2147483647\n#define INT64_MAX 9223372036854775807LL\n\n#define UINT8_MAX 255\n#define UINT16_MAX 65535\n#define UINT32_MAX 0xffffffffU  /* 4294967295U */\n#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */\n\n/* 7.18.2.2  Limits of minimum-width integer types */\n#define INT_LEAST8_MIN INT8_MIN\n#define INT_LEAST16_MIN INT16_MIN\n#define INT_LEAST32_MIN INT32_MIN\n#define INT_LEAST64_MIN INT64_MIN\n\n#define INT_LEAST8_MAX INT8_MAX\n#define INT_LEAST16_MAX INT16_MAX\n#define INT_LEAST32_MAX INT32_MAX\n#define INT_LEAST64_MAX INT64_MAX\n\n#define UINT_LEAST8_MAX UINT8_MAX\n#define UINT_LEAST16_MAX UINT16_MAX\n#define UINT_LEAST32_MAX UINT32_MAX\n#define UINT_LEAST64_MAX UINT64_MAX\n\n/* 7.18.2.3  Limits of fastest minimum-width integer types */\n#define INT_FAST8_MIN INT8_MIN\n#define INT_FAST16_MIN INT16_MIN\n#define INT_FAST32_MIN INT32_MIN\n#define INT_FAST64_MIN INT64_MIN\n\n#define INT_FAST8_MAX INT8_MAX\n#define INT_FAST16_MAX INT16_MAX\n#define INT_FAST32_MAX INT32_MAX\n#define INT_FAST64_MAX INT64_MAX\n\n#define UINT_FAST8_MAX UINT8_MAX\n#define UINT_FAST16_MAX UINT16_MAX\n#define UINT_FAST32_MAX UINT32_MAX\n#define UINT_FAST64_MAX UINT64_MAX\n\n/* 7.18.2.4  Limits of integer types capable of holding\n    object pointers */\n#ifdef _WIN64\n#define INTPTR_MIN INT64_MIN\n#define INTPTR_MAX INT64_MAX\n#define UINTPTR_MAX UINT64_MAX\n#else\n#define INTPTR_MIN INT32_MIN\n#define INTPTR_MAX INT32_MAX\n#define UINTPTR_MAX UINT32_MAX\n#endif\n\n/* 7.18.2.5  Limits of greatest-width integer types */\n#define INTMAX_MIN INT64_MIN\n#define INTMAX_MAX INT64_MAX\n#define UINTMAX_MAX UINT64_MAX\n\n/* 7.18.3  Limits of other integer types */\n#ifdef _WIN64\n#define PTRDIFF_MIN INT64_MIN\n#define PTRDIFF_MAX INT64_MAX\n#else\n#define PTRDIFF_MIN INT32_MIN\n#define PTRDIFF_MAX INT32_MAX\n#endif\n\n#define SIG_ATOMIC_MIN INT32_MIN\n#define SIG_ATOMIC_MAX INT32_MAX\n\n#ifndef SIZE_MAX\n#ifdef _WIN64\n#define SIZE_MAX UINT64_MAX\n#else\n#define SIZE_MAX UINT32_MAX\n#endif\n#endif\n\n#ifndef WCHAR_MIN  /* also in wchar.h */\n#define WCHAR_MIN 0U\n#define WCHAR_MAX 0xffffU\n#endif\n\n/*\n * wint_t is unsigned short for compatibility with MS runtime\n */\n#define WINT_MIN 0U\n#define WINT_MAX 0xffffU\n\n\n/* 7.18.4  Macros for integer constants */\n\n/* 7.18.4.1  Macros for minimum-width integer constants\n\n    Accoding to Douglas Gwyn <gwyn@arl.mil>:\n\t\"This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC\n\t9899:1999 as initially published, the expansion was required\n\tto be an integer constant of precisely matching type, which\n\tis impossible to accomplish for the shorter types on most\n\tplatforms, because C99 provides no standard way to designate\n\tan integer constant with width less than that of type int.\n\tTC1 changed this to require just an integer constant\n\t*expression* with *promoted* type.\"\n\n\tThe trick used here is from Clive D W Feather.\n*/\n\n#define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val))\n#define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val))\n#define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val))\n/*  The 'trick' doesn't work in C89 for long long because, without\n    suffix, (val) will be evaluated as int, not intmax_t */\n#define INT64_C(val) val##i64\n\n#define UINT8_C(val) (val)\n#define UINT16_C(val) (val)\n#define UINT32_C(val) (val##i32)\n#define UINT64_C(val) val##ui64\n\n/* 7.18.4.2  Macros for greatest-width integer constants */\n#define INTMAX_C(val) val##i64\n#define UINTMAX_C(val) val##ui64\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/stress_2005.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"stress\"\n\tProjectGUID=\"{53942EFF-C810-458D-B3CB-EE5CE9F1E781}\"\n\tRootNamespace=\"tests\"\n\tKeyword=\"Win32Proj\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"x64\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\tests\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_CONSOLE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"1\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|x64\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\tests\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_CONSOLE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"1\"\n\t\t\t\tTargetMachine=\"17\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\tests\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"1\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_CONSOLE\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"1\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|x64\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\tests\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"1\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_CONSOLE\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"1\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"17\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx\"\n\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\tests\\testlib.c\"\n\t\t\t\t>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release|x64\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\tests\\stress.c\"\n\t\t\t\t>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release|Win32\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t\t<FileConfiguration\n\t\t\t\t\tName=\"Release|x64\"\n\t\t\t\t\t>\n\t\t\t\t\t<Tool\n\t\t\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\t\t/>\n\t\t\t\t</FileConfiguration>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc;xsd\"\n\t\t\tUniqueIdentifier=\"{93995380-89BD-4b04-88EB-625FBE52EBFB}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\tests\\libusb_testlib.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/stress_2010.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>stress</ProjectName>\n    <ProjectGuid>{53942EFF-C810-458D-B3CB-EE5CE9F1E781}</ProjectGuid>\n    <RootNamespace>tests</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\$(ProjectName)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\tests\\stress.c\" />\n    <ClCompile Include=\"..\\tests\\testlib.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\".\\libusb_static_2010.vcxproj\">\n      <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\tests\\libusb_testlib.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/stress_2010.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{28b6220e-d087-4f48-bd69-ffe0ac5bcc7a}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\tests\\stress.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\tests\\testlib.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\tests\\libusb_testlib.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/stress_2012.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>stress</ProjectName>\n    <ProjectGuid>{53942EFF-C810-458D-B3CB-EE5CE9F1E781}</ProjectGuid>\n    <RootNamespace>tests</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\$(ProjectName)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\tests\\stress.c\" />\n    <ClCompile Include=\"..\\tests\\testlib.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\".\\libusb_static_2012.vcxproj\">\n      <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\tests\\libusb_testlib.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/stress_2012.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{28b6220e-d087-4f48-bd69-ffe0ac5bcc7a}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\tests\\stress.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\tests\\testlib.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\tests\\libusb_testlib.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/stress_2013.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>stress</ProjectName>\n    <ProjectGuid>{53942EFF-C810-458D-B3CB-EE5CE9F1E781}</ProjectGuid>\n    <RootNamespace>tests</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\tests\\$(ProjectName)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\tests\\stress.c\" />\n    <ClCompile Include=\"..\\tests\\testlib.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\".\\libusb_static_2013.vcxproj\">\n      <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\tests\\libusb_testlib.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/stress_wince.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"stress\"\n\tProjectGUID=\"{61476624-3354-48C8-9334-85AC0D624640}\"\n\tRootNamespace=\"stress\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (ARMV4I)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSII)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSII_FP)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSIV)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSIV_FP)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (SH4)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (x86)\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (ARMV4I)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\tests\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"%CSIDL_PROGRAM_FILES%\\stress\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSII)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\tests\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSII_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\tests\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSIV)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\tests\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSIV_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\tests\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (SH4)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\tests\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (x86)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\tests\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tIgnoreDefaultLibraryNames=\"oldnames.lib,libc.lib\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (ARMV4I)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\tests\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSII)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\tests\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSII_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\tests\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSIV)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\tests\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSIV_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\tests\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (SH4)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\tests\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (x86)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\tests\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\tests\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tIgnoreDefaultLibraryNames=\"oldnames.lib,libc.lib\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t\t<ProjectReference\n\t\t\tReferencedProjectIdentifier=\"{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}\"\n\t\t\tRelativePathToProject=\".\\libusb_dll.vcproj\"\n\t\t/>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx\"\n\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\tests\\stress.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\tests\\testlib.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc;xsd\"\n\t\t\tUniqueIdentifier=\"{93995380-89BD-4b04-88EB-625FBE52EBFB}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\tests\\libusb_testlib.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Resource Files\"\n\t\t\tFilter=\"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav\"\n\t\t\tUniqueIdentifier=\"{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}\"\n\t\t\t>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/xusb.dsp",
    "content": "# Microsoft Developer Studio Project File - Name=\"xusb\" - Package Owner=<4>\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\n# ** DO NOT EDIT **\n\n# TARGTYPE \"Win32 (x86) Console Application\" 0x0103\n\nCFG=xusb - Win32 Debug\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n!MESSAGE use the Export Makefile command and run\n!MESSAGE \n!MESSAGE NMAKE /f \"xusb.mak\".\n!MESSAGE \n!MESSAGE You can specify a configuration when running NMAKE\n!MESSAGE by defining the macro CFG on the command line. For example:\n!MESSAGE \n!MESSAGE NMAKE /f \"xusb.mak\" CFG=\"xusb - Win32 Debug\"\n!MESSAGE \n!MESSAGE Possible choices for configuration are:\n!MESSAGE \n!MESSAGE \"xusb - Win32 Release\" (based on \"Win32 (x86) Console Application\")\n!MESSAGE \"xusb - Win32 Debug\" (based on \"Win32 (x86) Console Application\")\n!MESSAGE \n\n# Begin Project\n# PROP AllowPerConfigDependencies 0\n# PROP Scc_ProjName \"\"\n# PROP Scc_LocalPath \"\"\nCPP=cl.exe\nRSC=rc.exe\n\n!IF  \"$(CFG)\" == \"xusb - Win32 Release\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 0\n# PROP BASE Output_Dir \"Release\"\n# PROP BASE Intermediate_Dir \"Release\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 0\n# PROP Output_Dir \"../Win32/Release/examples\"\n# PROP Intermediate_Dir \"../Win32/Release/examples/xusb\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /YX /FD /c\n# ADD CPP /nologo /MD /W3 /GX /O2 /I \".\" /I \"../libusb\" /I \".\" /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_UNICODE\" /D \"UNICODE\" /U \"_MBCS\" /FR /FD /EHsc /c\n# ADD BASE RSC /l 0x409 /d \"NDEBUG\"\n# ADD RSC /l 0x409 /d \"NDEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo\nLINK32=link.exe\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\n\n!ELSEIF  \"$(CFG)\" == \"xusb - Win32 Debug\"\n\n# PROP BASE Use_MFC 0\n# PROP BASE Use_Debug_Libraries 1\n# PROP BASE Output_Dir \"xusb___Win32_Debug\"\n# PROP BASE Intermediate_Dir \"xusb___Win32_Debug\"\n# PROP BASE Target_Dir \"\"\n# PROP Use_MFC 0\n# PROP Use_Debug_Libraries 1\n# PROP Output_Dir \"../Win32/Debug/examples\"\n# PROP Intermediate_Dir \"../Win32/Debug/examples/xusb\"\n# PROP Ignore_Export_Lib 0\n# PROP Target_Dir \"\"\n# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /YX /FD /GZ /c\n# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I \".\" /I \"../libusb\" /I \".\" /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_UNICODE\" /D \"UNICODE\" /U \"_MBCS\" /FR /FD /GZ /EHsc /c\n# ADD BASE RSC /l 0x409 /d \"_DEBUG\"\n# ADD RSC /l 0x409 /d \"_DEBUG\"\nBSC32=bscmake.exe\n# ADD BASE BSC32 /nologo\n# ADD BSC32 /nologo /n \"../Win32/Debug/dll/core.sbr\" \"../Win32/Debug/dll/descriptor.sbr\" \"../Win32/Debug/dll/io.sbr\" \"../Win32/Debug/dll/sync.sbr\" \"../Win32/Debug/dll/poll_windows.sbr\" \"../Win32/Debug/dll/threads_windows.sbr\" \"../Win32/Debug/dll/windows_usb.sbr\"\nLINK32=link.exe\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386\n\n!ENDIF \n\n# Begin Target\n\n# Name \"xusb - Win32 Release\"\n# Name \"xusb - Win32 Debug\"\n# Begin Group \"Source Files\"\n\n# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\n# Begin Source File\n\nSOURCE=..\\examples\\xusb.c\n# End Source File\n# End Group\n# Begin Group \"Header Files\"\n\n# PROP Default_Filter \"h;hpp;hxx;hm;inl\"\n# End Group\n# Begin Group \"Resource Files\"\n\n# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\"\n# End Group\n# End Target\n# End Project\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/xusb_2005.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"xusb\"\n\tProjectGUID=\"{08A6FA39-21B7-4A05-9252-2F9864A5E5A4}\"\n\tRootNamespace=\"examples\"\n\tKeyword=\"Win32Proj\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"x64\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"1\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"1\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"1\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|x64\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tLinkIncremental=\"2\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"1\"\n\t\t\t\tTargetMachine=\"17\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|x64\"\n\t\t\tOutputDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"..\\$(PlatformName)\\$(ConfigurationName)\\examples\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"1\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tAdditionalIncludeDirectories=\".;..\\libusb\"\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tUsePrecompiledHeader=\"0\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDetect64BitPortabilityProblems=\"false\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tLinkIncremental=\"1\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"1\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"17\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx\"\n\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\examples\\xusb.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/xusb_2010.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>xusb</ProjectName>\n    <ProjectGuid>{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}</ProjectGuid>\n    <RootNamespace>examples</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\xusb.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\".\\libusb_static_2010.vcxproj\">\n      <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/xusb_2010.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\xusb.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/xusb_2012.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>xusb</ProjectName>\n    <ProjectGuid>{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}</ProjectGuid>\n    <RootNamespace>examples</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\xusb.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\".\\libusb_static_2012.vcxproj\">\n      <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/xusb_2012.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\xusb.c\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/xusb_2013.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>xusb</ProjectName>\n    <ProjectGuid>{3F3138D0-7AB7-4268-9BF3-1A3EA5503A11}</ProjectGuid>\n    <RootNamespace>examples</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v120</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(SolutionDir)..\\$(Platform)\\$(Configuration)\\examples\\$(ProjectName)\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>true</MinimalRebuild>\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <BuildLog>\n      <Path>$(IntDir)$(ProjectName).htm</Path>\n    </BuildLog>\n    <Midl>\n      <TargetEnvironment>X64</TargetEnvironment>\n    </Midl>\n    <ClCompile>\n      <AdditionalIncludeDirectories>.;..\\libusb;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <WarningLevel>Level3</WarningLevel>\n    </ClCompile>\n    <Link>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <SubSystem>Console</SubSystem>\n      <TargetMachine>MachineX64</TargetMachine>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\examples\\xusb.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\".\\libusb_static_2013.vcxproj\">\n      <Project>{349ee8f9-7d25-4909-aaf5-ff3fade72187}</Project>\n      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/xusb_sources",
    "content": "TARGETNAME=xusb\nTARGETTYPE=PROGRAM\n386_STDCALL=0\n\n_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP)\n\n!IFNDEF MSC_WARNING_LEVEL\nMSC_WARNING_LEVEL=/W3\n!ENDIF\n\n!IFDEF STATIC_LIBC\nUSE_LIBCMT=1\n!ELSE\nUSE_MSVCRT=1\n!ENDIF\n\nUMTYPE=console\nINCLUDES=..\\..\\msvc;..\\..\\libusb;$(DDK_INC_PATH)\nUMLIBS=..\\..\\libusb\\os\\obj$(BUILD_ALT_DIR)\\*\\libusb-1.0.lib\nSOURCES=..\\xusb.c\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/msvc/xusb_wince.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"xusb\"\n\tProjectGUID=\"{93F53A7E-6DEF-469A-ABD4-A5AD02A0A511}\"\n\tRootNamespace=\"xusb\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (ARMV4I)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSII)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSII_FP)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSIV)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (MIPSIV_FP)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (SH4)\"\n\t\t/>\n\t\t<Platform\n\t\t\tName=\"STANDARDSDK_500 (x86)\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (ARMV4I)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"%CSIDL_PROGRAM_FILES%\\xusb\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSII)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSII_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSIV)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (MIPSIV_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (SH4)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Debug|STANDARDSDK_500 (x86)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"3\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tIgnoreDefaultLibraryNames=\"oldnames.lib,libc.lib\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (ARMV4I)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\ARMV4I\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSII)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSII_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSII_FP\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSIV)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (MIPSIV_FP)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\MIPSIV_FP\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (SH4)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\SH4\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|STANDARDSDK_500 (x86)\"\n\t\t\tOutputDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\examples\"\n\t\t\tIntermediateDirectory=\"$(SolutionDir)..\\x86\\$(ConfigurationName)\\examples\\$(TargetName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t\tTargetEnvironment=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tExecutionBucket=\"7\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\libusb;.\"\n\t\t\t\tPreprocessorDefinitions=\"NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tRuntimeLibrary=\"2\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tSubSystem=\"9\"\n\t\t\t\tIgnoreDefaultLibraryNames=\"oldnames.lib,libc.lib\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tEntryPointSymbol=\"mainACRTStartup\"\n\t\t\t\tTargetMachine=\"0\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCodeSignTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t\t<DeploymentTool\n\t\t\t\tForceDirty=\"-1\"\n\t\t\t\tRemoteDirectory=\"\"\n\t\t\t\tRegisterOutput=\"0\"\n\t\t\t\tAdditionalFiles=\"\"\n\t\t\t/>\n\t\t\t<DebuggerTool\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t\t<ProjectReference\n\t\t\tReferencedProjectIdentifier=\"{6A49B75F-FB1C-45C0-B7C3-A7698255E7E9}\"\n\t\t\tRelativePathToProject=\".\\libusb-1.0.vcproj\"\n\t\t/>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"Source Files\"\n\t\t\tFilter=\"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx\"\n\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\examples\\xusb.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Header Files\"\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc;xsd\"\n\t\t\tUniqueIdentifier=\"{93995380-89BD-4b04-88EB-625FBE52EBFB}\"\n\t\t\t>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"Resource Files\"\n\t\t\tFilter=\"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav\"\n\t\t\tUniqueIdentifier=\"{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}\"\n\t\t\t>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/tests/Makefile.am",
    "content": "AM_CPPFLAGS = -I$(top_srcdir)/libusb\nLDADD = ../libusb/libusb-1.0.la\n\nnoinst_PROGRAMS = stress\n\nstress_SOURCES = stress.c libusb_testlib.h testlib.c\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/tests/libusb_testlib.h",
    "content": "/*\n * libusb test library helper functions\n * Copyright © 2012 Toby Gray <toby.gray@realvnc.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#ifndef LIBUSB_TESTLIB_H\n#define LIBUSB_TESTLIB_H\n\n#include <stdio.h>\n\n#if !defined(bool)\n#define bool int\n#endif\n#if !defined(true)\n#define true (1 == 1)\n#endif\n#if !defined(false)\n#define false (!true)\n#endif\n\n/** Values returned from a test function to indicate test result */\ntypedef enum {\n\t/** Indicates that the test ran successfully. */\n\tTEST_STATUS_SUCCESS,\n\t/** Indicates that the test failed one or more test. */\n\tTEST_STATUS_FAILURE,\n\t/** Indicates that an unexpected error occurred. */\n\tTEST_STATUS_ERROR,\n\t/** Indicates that the test can't be run. For example this may be\n\t* due to no suitable device being connected to perform the tests.*/\n\tTEST_STATUS_SKIP\n} libusb_testlib_result;\n\n/**\n * Context for test library functions\n */\ntypedef struct {\n\tchar ** test_names;\n\tint test_count;\n\tbool list_tests;\n\tbool verbose;\n\tint old_stdout;\n\tint old_stderr;\n\tFILE* output_file;\n\tint null_fd;\n} libusb_testlib_ctx;\n\n/**\n * Logs some test information or state\n */\nvoid libusb_testlib_logf(libusb_testlib_ctx * ctx, \n                          const char* fmt, ...);\n\n/**\n * Function pointer for a libusb test function.\n *\n * Should return TEST_STATUS_SUCCESS on success or another TEST_STATUS value.\n */\ntypedef libusb_testlib_result\n(*libusb_testlib_test_function)(libusb_testlib_ctx * ctx);\n\n/**\n * Structure holding a test description.\n */\ntypedef struct {\n\t/** Human readable name of the test. */\n\tconst char * name;\n\t/** The test library will call this function to run the test. */\n\tlibusb_testlib_test_function function;\n} libusb_testlib_test;\n\n/**\n * Value to use at the end of a test array to indicate the last\n * element.\n */\n#define LIBUSB_NULL_TEST {NULL, NULL}\n\n/**\n * Runs the tests provided.\n *\n * Before running any tests argc and argv will be processed\n * to determine the mode of operation.\n *\n * \\param argc The argc from main\n * \\param argv The argv from main\n * \\param tests A NULL_TEST terminated array of tests\n * \\return 0 on success, non-zero on failure\n */\nint libusb_testlib_run_tests(int argc,\n                              char ** argv,\n                              const libusb_testlib_test * tests);\n\n#endif //LIBUSB_TESTLIB_H\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/tests/stress.c",
    "content": "/*\n * libusb stress test program to perform simple stress tests\n * Copyright © 2012 Toby Gray <toby.gray@realvnc.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include <stdio.h>\n#include <string.h>\n#include <memory.h>\n\n#include \"libusb.h\"\n#include \"libusb_testlib.h\"\n\n/** Test that creates and destroys a single concurrent context\n * 10000 times. */\nstatic libusb_testlib_result test_init_and_exit(libusb_testlib_ctx * tctx)\n{\n\tlibusb_context * ctx = NULL;\n\tint i;\n\tfor (i = 0; i < 10000; ++i) {\n\t\tint r = libusb_init(&ctx);\n\t\tif (r != LIBUSB_SUCCESS) {\n\t\t\tlibusb_testlib_logf(tctx,\n\t\t\t\t\"Failed to init libusb on iteration %d: %d\",\n\t\t\t\ti, r);\n\t\t\treturn TEST_STATUS_FAILURE;\n\t\t}\n\t\tlibusb_exit(ctx);\n\t\tctx = NULL;\n\t}\n\n\treturn TEST_STATUS_SUCCESS;\n}\n\n/** Tests that devices can be listed 1000 times. */\nstatic libusb_testlib_result test_get_device_list(libusb_testlib_ctx * tctx)\n{\n\tlibusb_context * ctx = NULL;\n\tint r, i;\n\tr = libusb_init(&ctx);\n\tif (r != LIBUSB_SUCCESS) {\n\t\tlibusb_testlib_logf(tctx, \"Failed to init libusb: %d\", r);\n\t\treturn TEST_STATUS_FAILURE;\n\t}\n\tfor (i = 0; i < 1000; ++i) {\n\t\tlibusb_device ** device_list;\n\t\tssize_t list_size = libusb_get_device_list(ctx, &device_list);\n\t\tif (list_size < 0 || device_list == NULL) {\n\t\t\tlibusb_testlib_logf(tctx,\n\t\t\t\t\"Failed to get device list on iteration %d: %d (%p)\",\n\t\t\t\ti, -list_size, device_list);\n\t\t\treturn TEST_STATUS_FAILURE;\n\t\t}\n\t\tlibusb_free_device_list(device_list, 1);\n\t}\n\tlibusb_exit(ctx);\n\treturn TEST_STATUS_SUCCESS;\n}\n\n/** Tests that 100 concurrent device lists can be open at a time. */\nstatic libusb_testlib_result test_many_device_lists(libusb_testlib_ctx * tctx)\n{\n#define LIST_COUNT 100\n\tlibusb_context * ctx = NULL;\n\tlibusb_device ** device_lists[LIST_COUNT];\n\tint r, i;\n\tmemset(device_lists, 0, sizeof(device_lists));\n\n\tr = libusb_init(&ctx);\n\tif (r != LIBUSB_SUCCESS) {\n\t\tlibusb_testlib_logf(tctx, \"Failed to init libusb: %d\", r);\n\t\treturn TEST_STATUS_FAILURE;\n\t}\n\n\t/* Create the 100 device lists. */\n\tfor (i = 0; i < LIST_COUNT; ++i) {\n\t\tssize_t list_size = libusb_get_device_list(ctx, &(device_lists[i]));\n\t\tif (list_size < 0 || device_lists[i] == NULL) {\n\t\t\tlibusb_testlib_logf(tctx,\n\t\t\t\t\"Failed to get device list on iteration %d: %d (%p)\",\n\t\t\t\ti, -list_size, device_lists[i]);\n\t\t\treturn TEST_STATUS_FAILURE;\n\t\t}\n\t}\n\n\t/* Destroy the 100 device lists. */\n\tfor (i = 0; i < LIST_COUNT; ++i) {\n\t\tif (device_lists[i]) {\n\t\t\tlibusb_free_device_list(device_lists[i], 1);\n\t\t\tdevice_lists[i] = NULL;\n\t\t}\n\t}\n\n\tlibusb_exit(ctx);\n\treturn TEST_STATUS_SUCCESS;\n#undef LIST_COUNT\n}\n\n/** Tests that the default context (used for various things including\n * logging) works correctly when the first context created in a\n * process is destroyed. */\nstatic libusb_testlib_result test_default_context_change(libusb_testlib_ctx * tctx)\n{\n\tlibusb_context * ctx = NULL;\n\tint r, i;\n\n\tfor (i = 0; i < 100; ++i) {\n\t\t/* First create a new context */\n\t\tr = libusb_init(&ctx);\n\t\tif (r != LIBUSB_SUCCESS) {\n\t\t\tlibusb_testlib_logf(tctx, \"Failed to init libusb: %d\", r);\n\t\t\treturn TEST_STATUS_FAILURE;\n\t\t}\n\n\t\t/* Enable debug output, to be sure to use the context */\n\t\tlibusb_set_debug(NULL, LIBUSB_LOG_LEVEL_DEBUG);\n\t\tlibusb_set_debug(ctx, LIBUSB_LOG_LEVEL_DEBUG);\n\n\t\t/* Now create a reference to the default context */\n\t\tr = libusb_init(NULL);\n\t\tif (r != LIBUSB_SUCCESS) {\n\t\t\tlibusb_testlib_logf(tctx, \"Failed to init libusb: %d\", r);\n\t\t\treturn TEST_STATUS_FAILURE;\n\t\t}\n\n\t\t/* Destroy the first context */\n\t\tlibusb_exit(ctx);\n\t\t/* Destroy the default context */\n\t\tlibusb_exit(NULL);\n\t}\n\n\treturn TEST_STATUS_SUCCESS;\n}\n\n/* Fill in the list of tests. */\nstatic const libusb_testlib_test tests[] = {\n\t{\"init_and_exit\", &test_init_and_exit},\n\t{\"get_device_list\", &test_get_device_list},\n\t{\"many_device_lists\", &test_many_device_lists},\n\t{\"default_context_change\", &test_default_context_change},\n\tLIBUSB_NULL_TEST\n};\n\nint main (int argc, char ** argv)\n{\n\treturn libusb_testlib_run_tests(argc, argv, tests);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libusb/tests/testlib.c",
    "content": "/*\n * libusb test library helper functions\n * Copyright © 2012 Toby Gray <toby.gray@realvnc.com>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n */\n\n#include \"libusb_testlib.h\"\n\n#include <stdio.h>\n#include <stdarg.h>\n#include <string.h>\n#include <errno.h>\n#if !defined(_WIN32_WCE)\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <fcntl.h>\n#endif\n\n#if defined(_WIN32_WCE)\n// No support for selective redirection of STDOUT on WinCE.\n#define DISABLE_STDOUT_REDIRECTION\n#define STDOUT_FILENO 1\n#elif defined(_WIN32)\n#include <io.h>\n#define dup _dup\n#define dup2 _dup2\n#define open _open\n#define close _close\n#define fdopen _fdopen\n#define NULL_PATH \"nul\"\n#define STDOUT_FILENO 1\n#define STDERR_FILENO 2\n#else\n#include <unistd.h>\n#define NULL_PATH \"/dev/null\"\n#endif\n#define INVALID_FD -1\n#define IGNORE_RETVAL(expr) do { (void)(expr); } while(0)\n\n/**\n * Converts a test result code into a human readable string.\n */\nstatic const char* test_result_to_str(libusb_testlib_result result)\n{\n\tswitch (result) {\n\tcase TEST_STATUS_SUCCESS:\n\t\treturn \"Success\";\n\tcase TEST_STATUS_FAILURE:\n\t\treturn \"Failure\";\n\tcase TEST_STATUS_ERROR:\n\t\treturn \"Error\";\n\tcase TEST_STATUS_SKIP:\n\t\treturn \"Skip\";\n\tdefault:\n\t\treturn \"Unknown\";\n\t}\n}\n\nstatic void print_usage(int argc, char ** argv)\n{\n\tprintf(\"Usage: %s [-l] [-v] [<test_name> ...]\\n\",\n\t\targc > 0 ? argv[0] : \"test_*\");\n\tprintf(\"   -l   List available tests\\n\");\n\tprintf(\"   -v   Don't redirect STDERR/STDOUT during tests\\n\");\n}\n\nstatic void cleanup_test_output(libusb_testlib_ctx * ctx)\n{\n#ifndef DISABLE_STDOUT_REDIRECTION\n\tif (!ctx->verbose) {\n\t\tif (ctx->old_stdout != INVALID_FD) {\n\t\t\tIGNORE_RETVAL(dup2(ctx->old_stdout, STDOUT_FILENO));\n\t\t\tctx->old_stdout = INVALID_FD;\n\t\t}\n\t\tif (ctx->old_stderr != INVALID_FD) {\n\t\t\tIGNORE_RETVAL(dup2(ctx->old_stderr, STDERR_FILENO));\n\t\t\tctx->old_stderr = INVALID_FD;\n\t\t}\n\t\tif (ctx->null_fd != INVALID_FD) {\n\t\t\tclose(ctx->null_fd);\n\t\t\tctx->null_fd = INVALID_FD;\n\t\t}\n\t\tif (ctx->output_file != stdout) {\n\t\t\tfclose(ctx->output_file);\n\t\t\tctx->output_file = stdout;\n\t\t}\n\t}\n#endif\n}\n\n/**\n * Setup test output handles\n * \\return zero on success, non-zero on failure\n */\nstatic int setup_test_output(libusb_testlib_ctx * ctx)\n{\n#ifndef DISABLE_STDOUT_REDIRECTION\n\t/* Stop output to stdout and stderr from being displayed if using non-verbose output */\n\tif (!ctx->verbose) {\n\t\t/* Keep a copy of STDOUT and STDERR */\n\t\tctx->old_stdout = dup(STDOUT_FILENO);\n\t\tif (ctx->old_stdout < 0) {\n\t\t\tctx->old_stdout = INVALID_FD;\n\t\t\tprintf(\"Failed to duplicate stdout handle: %d\\n\", errno);\n\t\t\treturn 1;\n\t\t}\n\t\tctx->old_stderr = dup(STDERR_FILENO);\n\t\tif (ctx->old_stderr < 0) {\n\t\t\tctx->old_stderr = INVALID_FD;\n\t\t\tcleanup_test_output(ctx);\n\t\t\tprintf(\"Failed to duplicate stderr handle: %d\\n\", errno);\n\t\t\treturn 1;\n\t\t}\n\t\t/* Redirect STDOUT_FILENO and STDERR_FILENO to /dev/null or \"nul\"*/\n\t\tctx->null_fd = open(NULL_PATH, O_WRONLY);\n\t\tif (ctx->null_fd < 0) {\n\t\t\tctx->null_fd = INVALID_FD;\n\t\t\tcleanup_test_output(ctx);\n\t\t\tprintf(\"Failed to open null handle: %d\\n\", errno);\n\t\t\treturn 1;\n\t\t}\n\t\tif ((dup2(ctx->null_fd, STDOUT_FILENO) < 0) ||\n\t\t\t(dup2(ctx->null_fd, STDERR_FILENO) < 0)) {\n\t\t\t\tcleanup_test_output(ctx);\n\t\t\t\treturn 1;\n\t\t}\n\t\tctx->output_file = fdopen(ctx->old_stdout, \"w\");\n\t\tif (!ctx->output_file) {\n\t\t\tctx->output_file = stdout;\n\t\t\tcleanup_test_output(ctx);\n\t\t\tprintf(\"Failed to open FILE for output handle: %d\\n\", errno);\n\t\t\treturn 1;\n\t\t}\n\t}\n#endif\n\treturn 0;\n}\n\nvoid libusb_testlib_logf(libusb_testlib_ctx * ctx,\n\tconst char* fmt, ...)\n{\n\tva_list va;\n\tva_start(va, fmt);\n\tvfprintf(ctx->output_file, fmt, va);\n\tva_end(va);\n\tfprintf(ctx->output_file, \"\\n\");\n\tfflush(ctx->output_file);\n}\n\nint libusb_testlib_run_tests(int argc,\n\tchar ** argv,\n\tconst libusb_testlib_test * tests)\n{\n\tint run_count = 0;\n\tint idx = 0;\n\tint pass_count = 0;\n\tint fail_count = 0;\n\tint error_count = 0;\n\tint skip_count = 0;\n\tint r, j;\n\tsize_t arglen;\n\tlibusb_testlib_result test_result;\n\tlibusb_testlib_ctx ctx;\n\n\t/* Setup default mode of operation */\n\tctx.test_names = NULL;\n\tctx.test_count = 0;\n\tctx.list_tests = false;\n\tctx.verbose = false;\n\tctx.old_stdout = INVALID_FD;\n\tctx.old_stderr = INVALID_FD;\n\tctx.output_file = stdout;\n\tctx.null_fd = INVALID_FD;\n\n\t/* Parse command line options */\n\tif (argc >= 2) {\n\t\tfor (j = 1; j < argc; j++) {\n\t\t\targlen = strlen(argv[j]);\n\t\t\tif ( ((argv[j][0] == '-') || (argv[j][0] == '/')) &&\n\t\t\t\targlen >=2 ) {\n\t\t\t\t\tswitch (argv[j][1]) {\n\t\t\t\t\tcase 'l':\n\t\t\t\t\t\tctx.list_tests = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'v':\n\t\t\t\t\t\tctx.verbose = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tprintf(\"Unknown option: '%s'\\n\", argv[j]);\n\t\t\t\t\t\tprint_usage(argc, argv);\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t/* End of command line options, remaining must be list of tests to run */\n\t\t\t\tctx.test_names = argv + j;\n\t\t\t\tctx.test_count = argc - j;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Validate command line options */\n\tif (ctx.test_names && ctx.list_tests) {\n\t\tprintf(\"List of tests requested but test list provided\\n\");\n\t\tprint_usage(argc, argv);\n\t\treturn 1;\n\t}\n\n\t/* Setup test log output */\n\tr = setup_test_output(&ctx);\n\tif (r != 0)\n\t\treturn r;  \n\n\t/* Act on any options not related to running tests */\n\tif (ctx.list_tests) {\n\t\twhile (tests[idx].function != NULL) {\n\t\t\tlibusb_testlib_logf(&ctx, tests[idx].name);\n\t\t\t++idx;\n\t\t}\n\t\tcleanup_test_output(&ctx);\n\t\treturn 0;\n\t}\n\n\t/* Run any requested tests */\n\twhile (tests[idx].function != NULL) {\n\t\tconst libusb_testlib_test * test = &tests[idx];\n\t\t++idx;\n\t\tif (ctx.test_count > 0) {\n\t\t\t/* Filtering tests to run, check if this is one of them */\n\t\t\tint i;\n\t\t\tfor (i = 0; i < ctx.test_count; ++i) {\n\t\t\t\tif (strcmp(ctx.test_names[i], test->name) == 0)\n\t\t\t\t\t/* Matches a requested test name */\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (i >= ctx.test_count) {\n\t\t\t\t/* Failed to find a test match, so do the next loop iteration */\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tlibusb_testlib_logf(&ctx,\n\t\t\t\"Starting test run: %s...\", test->name);\n\t\ttest_result = test->function(&ctx);\n\t\tlibusb_testlib_logf(&ctx,\n\t\t\t\"%s (%d)\",\n\t\t\ttest_result_to_str(test_result), test_result);\n\t\tswitch (test_result) {\n\t\tcase TEST_STATUS_SUCCESS: pass_count++; break;\n\t\tcase TEST_STATUS_FAILURE: fail_count++; break;\n\t\tcase TEST_STATUS_ERROR: error_count++; break;\n\t\tcase TEST_STATUS_SKIP: skip_count++; break;\n\t\t}\n\t\t++run_count;\n\t}\n\tlibusb_testlib_logf(&ctx, \"---\");\n\tlibusb_testlib_logf(&ctx, \"Ran %d tests\", run_count);\n\tlibusb_testlib_logf(&ctx, \"Passed %d tests\", pass_count);\n\tlibusb_testlib_logf(&ctx, \"Failed %d tests\", fail_count);\n\tlibusb_testlib_logf(&ctx, \"Error in %d tests\", error_count);\n\tlibusb_testlib_logf(&ctx, \"Skipped %d tests\", skip_count);\n\n\tcleanup_test_output(&ctx);\n\treturn pass_count != run_count;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 2.8)\nproject(libuvc)\n\nif (NOT CMAKE_BUILD_TYPE)\n  message(STATUS \"No build type selected, default to Release\")\n  set(CMAKE_BUILD_TYPE \"Release\" CACHE STRING \"\" FORCE)\nendif ()\n\nif (NOT CMAKE_BUILD_TARGET)\n  message(STATUS \"No target type selected, default to shared library\")\n  set(CMAKE_BUILD_TARGET \"Shared\" CACHE STRING \"\" FORCE)\nendif()\n\nset(libuvc_VERSION_MAJOR 0)\nset(libuvc_VERSION_MINOR 0)\nset(libuvc_VERSION_PATCH 4)\nset(libuvc_VERSION ${libuvc_VERSION_MAJOR}.${libuvc_VERSION_MINOR}.${libuvc_VERSION_PATCH})\n\nfind_library(LIBUSB_LIBRARY_NAMES usb-1.0\n\tPATHS /opt/local/lib)\n\nfind_path(LIBUSB_INCLUDE_DIR libusb-1.0/libusb.h\n\tPATHS /opt/local/include)\n\n# Try to find JPEG using a module or pkg-config. If that doesn't work, search for the header.\nfind_package(jpeg QUIET)\nif(NOT JPEG_FOUND)\n  find_path(JPEG_INCLUDE_DIR jpeglib.h)\n  if(JPEG_INCLUDE_DIR)\n    set(JPEG_FOUND ON)\n    set(JPEG_LIBRARIES -ljpeg)\n  endif()\nendif()\n\nSET(CMAKE_C_FLAGS_DEBUG \"-g -DUVC_DEBUGGING\")\n\nSET(INSTALL_CMAKE_DIR \"${CMAKE_INSTALL_PREFIX}/lib/cmake/libuvc\" CACHE PATH\n\t\"Installation directory for CMake files\")\n\nSET(SOURCES src/ctrl.c src/device.c src/diag.c\n           src/frame.c src/init.c src/stream.c\n           src/misc.c)\n\ninclude_directories(\n  ${libuvc_SOURCE_DIR}/include\n  ${libuvc_BINARY_DIR}/include\n  ${LIBUSB_INCLUDE_DIR}\n)\n\nif(JPEG_FOUND)\n  message(STATUS \"Building libuvc with JPEG support.\")\n  include_directories(${JPEG_INCLUDE_DIR})\n  SET(HAVE_JPEG TRUE)\n  SET(SOURCES ${SOURCES} src/frame-mjpeg.c)\nelse()\n  message(WARNING \"JPEG not found. libuvc will not support JPEG decoding.\")\nendif()\n\nif(${CMAKE_BUILD_TARGET} MATCHES \"Shared\")\n  add_library(uvc SHARED ${SOURCES})\nelseif(${CMAKE_BUILD_TARGET} MATCHES \"Static\")\n  add_library(uvc STATIC ${SOURCES})\nelse()\n  message( FATAL_ERROR \"Invalid build type ${CMAKE_BUILD_TARGET}\" )\nendif()\n\nconfigure_file(include/libuvc/libuvc_config.h.in\n  ${PROJECT_BINARY_DIR}/include/libuvc/libuvc_config.h @ONLY)\n\nset_target_properties(uvc PROPERTIES\n  PUBLIC_HEADER \"include/libuvc/libuvc.h;${libuvc_BINARY_DIR}/include/libuvc/libuvc_config.h\" )\n\nif(JPEG_FOUND)\n  target_link_libraries (uvc ${JPEG_LIBRARIES})\nendif(JPEG_FOUND)\n\ntarget_link_libraries(uvc ${LIBUSB_LIBRARY_NAMES})\n\n#add_executable(test src/test.c)\n#target_link_libraries(test uvc ${LIBUSB_LIBRARY_NAMES} opencv_highgui\n#  opencv_core)\n\ninstall(TARGETS uvc\n  EXPORT libuvcTargets\n  LIBRARY DESTINATION \"${CMAKE_INSTALL_PREFIX}/lib\"\n  ARCHIVE DESTINATION \"${CMAKE_INSTALL_PREFIX}/lib\"\n  PUBLIC_HEADER DESTINATION \"${CMAKE_INSTALL_PREFIX}/include/libuvc\"\n)\n\nexport(TARGETS uvc\n  FILE \"${PROJECT_BINARY_DIR}/libuvcTargets.cmake\")\nexport(PACKAGE libuvc)\n\nset(CONF_INCLUDE_DIR \"${CMAKE_INSTALL_PREFIX}/include\")\nset(CONF_LIBRARY \"${CMAKE_INSTALL_PREFIX}/lib/libuvc.so\")\n\nconfigure_file(libuvcConfig.cmake.in ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/libuvcConfig.cmake)\n\nconfigure_file(libuvcConfigVersion.cmake.in ${PROJECT_BINARY_DIR}/libuvcConfigVersion.cmake @ONLY)\n\ninstall(FILES\n  \"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/libuvcConfig.cmake\"\n  \"${PROJECT_BINARY_DIR}/libuvcConfigVersion.cmake\"\n  DESTINATION \"${INSTALL_CMAKE_DIR}\")\n\ninstall(EXPORT libuvcTargets\n  DESTINATION \"${INSTALL_CMAKE_DIR}\")\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/README.md",
    "content": "`libuvc` is a cross-platform library for USB video devices, built atop `libusb`.\nIt enables fine-grained control over USB video devices exporting the standard USB Video Class\n(UVC) interface, enabling developers to write drivers for previously unsupported devices,\nor just access UVC devices in a generic fashion.\n\n## Getting and Building libuvc\n\nPrerequisites: You will need `libusb` and [CMake](http://www.cmake.org/) installed.\n\nTo build, you can just run these shell commands:\n\n    git clone https://github.com/ktossell/libuvc\n    cd libuvc\n    mkdir build\n    cd build\n    cmake ..\n    make && sudo make install\n\nand you're set! If you want to change the build configuration, you can edit `CMakeCache.txt`\nin the build directory, or use a CMake GUI to make the desired changes.\n\n## Developing with libuvc\n\nThe documentation for `libuvc` can currently be found at https://int80k.com/libuvc/doc/.\n\nHappy hacking!\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/android/jni/Android.mk",
    "content": "#/*********************************************************************\n#* Software License Agreement (BSD License)\n#*\n#* Copyright (C)2014-2017 saki@serenegiant <t_saki@serenegiant.com>\n#*  All rights reserved.\n#*\n#*  Redistribution and use in source and binary forms, with or without\n#*  modification, are permitted provided that the following conditions\n#*  are met:\n#*\n#*   * Redistributions of source code must retain the above copyright\n#*     notice, this list of conditions and the following disclaimer.\n#*   * Redistributions in binary form must reproduce the above\n#*     copyright notice, this list of conditions and the following\n#*     disclaimer in the documentation and/or other materials provided\n#*     with the distribution.\n#*   * Neither the name of the author nor other contributors may be\n#*     used to endorse or promote products derived from this software\n#*     without specific prior written permission.\n#*\n#*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n#*  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n#*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n#*  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n#*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n#*  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n#*  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n#*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n#*  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n#*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n#*  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n#*  POSSIBILITY OF SUCH DAMAGE.\n#*********************************************************************/\n\n######################################################################\n# libuvc_static.a (static library with static link to libjpeg, libusb1.0)\n######################################################################\nLOCAL_PATH\t:= $(call my-dir)/../..\ninclude $(CLEAR_VARS)\n\nLOCAL_C_INCLUDES += \\\n\t$(LOCAL_PATH)/.. \\\n\t$(LOCAL_PATH)/include \\\n\t$(LOCAL_PATH)/include/libuvc\n\nLOCAL_EXPORT_C_INCLUDES := \\\n\t$(LOCAL_PATH)/ \\\n\t$(LOCAL_PATH)/include \\\n\t$(LOCAL_PATH)/include/libuvc\n\nLOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%)\nLOCAL_CFLAGS += -DANDROID_NDK\nLOCAL_CFLAGS += -DLOG_NDEBUG\nLOCAL_CFLAGS += -DUVC_DEBUGGING\n\nLOCAL_EXPORT_LDLIBS := -llog\n\nLOCAL_ARM_MODE := arm\n\n#LOCAL_STATIC_LIBRARIES += jpeg-turbo1500_static\nLOCAL_SHARED_LIBRARIES += jpeg-turbo1500\nLOCAL_SHARED_LIBRARIES += usb100\n\nLOCAL_SRC_FILES := \\\n\tsrc/ctrl.c \\\n\tsrc/device.c \\\n\tsrc/diag.c \\\n\tsrc/frame.c \\\n\tsrc/frame-mjpeg.c \\\n\tsrc/init.c \\\n\tsrc/stream.c\n\nLOCAL_MODULE := libuvc_static\ninclude $(BUILD_STATIC_LIBRARY)\n\n######################################################################\n# libuvc.so\n######################################################################\ninclude $(CLEAR_VARS)\nLOCAL_MODULE_TAGS := optional\nLOCAL_EXPORT_LDLIBS += -llog\n\nLOCAL_WHOLE_STATIC_LIBRARIES = libuvc_static\nLOCAL_DISABLE_FATAL_LINKER_WARNINGS := true\n\nLOCAL_MODULE := uvc\ninclude $(BUILD_SHARED_LIBRARY)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/cameras/isight_imac.txt",
    "content": "\nBus 001 Device 007: ID 05ac:8501 Apple, Inc. Built-in iSight [Micron]\nDevice Descriptor:\n  bLength                18\n  bDescriptorType         1\n  bcdUSB               2.00\n  bDeviceClass          239 Miscellaneous Device\n  bDeviceSubClass         2 ?\n  bDeviceProtocol         1 Interface Association\n  bMaxPacketSize0        64\n  idVendor           0x05ac Apple, Inc.\n  idProduct          0x8501 Built-in iSight [Micron]\n  bcdDevice            1.89\n  iManufacturer           1 Micron\n  iProduct                2 Built-in iSight\n  iSerial                 0 \n  bNumConfigurations      1\n  Configuration Descriptor:\n    bLength                 9\n    bDescriptorType         2\n    wTotalLength          267\n    bNumInterfaces          2\n    bConfigurationValue     1\n    iConfiguration          0 \n    bmAttributes         0x80\n      (Bus Powered)\n    MaxPower              100mA\n    Interface Association:\n      bLength                 8\n      bDescriptorType        11\n      bFirstInterface         0\n      bInterfaceCount         2\n      bFunctionClass         14 Video\n      bFunctionSubClass       3 Video Interface Collection\n      bFunctionProtocol       0 \n      iFunction               0 \n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        0\n      bAlternateSetting       0\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      1 Video Control\n      bInterfaceProtocol      0 \n      iInterface              0 \n      VideoControl Interface Descriptor:\n        bLength                13\n        bDescriptorType        36\n        bDescriptorSubtype      1 (HEADER)\n        bcdUVC               1.00\n        wTotalLength           49\n        dwClockFrequency       13.500000MHz\n        bInCollection           1\n        baInterfaceNr( 0)       1\n      VideoControl Interface Descriptor:\n        bLength                16\n        bDescriptorType        36\n        bDescriptorSubtype      2 (INPUT_TERMINAL)\n        bTerminalID             1\n        wTerminalType      0x0201 Camera Sensor\n        bAssocTerminal          0\n        iTerminal               0 \n        wObjectiveFocalLengthMin      0\n        wObjectiveFocalLengthMax      0\n        wOcularFocalLength            0\n        bControlSize                  1\n        bmControls           0x00000000\n      VideoControl Interface Descriptor:\n        bLength                11\n        bDescriptorType        36\n        bDescriptorSubtype      5 (PROCESSING_UNIT)\n      Warning: Descriptor too short\n        bUnitID                 2\n        bSourceID               1\n        wMaxMultiplier          0\n        bControlSize            2\n        bmControls     0x00000039\n          Brightness\n          Saturation\n          Sharpness\n          Gamma\n        iProcessing             0 \n        bmVideoStandards     0x 9\n          None\n          SECAM - 625/50\n      VideoControl Interface Descriptor:\n        bLength                 9\n        bDescriptorType        36\n        bDescriptorSubtype      3 (OUTPUT_TERMINAL)\n        bTerminalID             3\n        wTerminalType      0x0101 USB Streaming\n        bAssocTerminal          0\n        bSourceID               2\n        iTerminal               0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x81  EP 1 IN\n        bmAttributes            3\n          Transfer Type            Interrupt\n          Synch Type               None\n          Usage Type               Data\n        wMaxPacketSize     0x0008  1x 8 bytes\n        bInterval              10\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       0\n      bNumEndpoints           0\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      VideoStreaming Interface Descriptor:\n        bLength                            14\n        bDescriptorType                    36\n        bDescriptorSubtype                  1 (INPUT_HEADER)\n        bNumFormats                         1\n        wTotalLength                      155\n        bEndPointAddress                  130\n        bmInfo                              0\n        bTerminalLink                       3\n        bStillCaptureMethod                 0\n        bTriggerSupport                     0\n        bTriggerUsage                       0\n        bControlSize                        1\n        bmaControls( 0)                    27\n      VideoStreaming Interface Descriptor:\n        bLength                            27\n        bDescriptorType                    36\n        bDescriptorSubtype                  4 (FORMAT_UNCOMPRESSED)\n        bFormatIndex                        1\n        bNumFrameDescriptors                3\n        guidFormat                            {55595659-0000-1000-8000-00aa00389b71}\n        bBitsPerPixel                      16\n        bDefaultFrameIndex                  1\n        bAspectRatioX                       0\n        bAspectRatioY                       0\n        bmInterlaceFlags                 0x00\n          Interlaced stream or variable: No\n          Fields per frame: 1 fields\n          Field 1 first: No\n          Field pattern: Field 1 only\n          bCopyProtect                      0\n      VideoStreaming Interface Descriptor:\n        bLength                            38\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         1\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            640\n        wHeight                           480\n        dwMinBitRate                383976960\n        dwMaxBitRate                383976960\n        dwMaxVideoFrameBufferSize      614400\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  0\n        dwMinFrameInterval             333333\n        dwMaxFrameInterval             333333\n        dwFrameIntervalStep                 0\n      VideoStreaming Interface Descriptor:\n        bLength                            38\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         2\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            352\n        wHeight                           288\n        dwMinBitRate                383976960\n        dwMaxBitRate                383976960\n        dwMaxVideoFrameBufferSize      202752\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  0\n        dwMinFrameInterval             333333\n        dwMaxFrameInterval             333333\n        dwFrameIntervalStep                 0\n      VideoStreaming Interface Descriptor:\n        bLength                            38\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         3\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            320\n        wHeight                           240\n        dwMinBitRate                383976960\n        dwMaxBitRate                383976960\n        dwMaxVideoFrameBufferSize      153600\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  0\n        dwMinFrameInterval             333333\n        dwMaxFrameInterval             333333\n        dwFrameIntervalStep                 0\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       1\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x82  EP 2 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x1400  3x 1024 bytes\n        bInterval               1\nDevice Qualifier (for other device speed):\n  bLength                10\n  bDescriptorType         6\n  bcdUSB               2.00\n  bDeviceClass           14 Video\n  bDeviceSubClass         2 Video Streaming\n  bDeviceProtocol         0 \n  bMaxPacketSize0         8\n  bNumConfigurations      1\nDevice Status:     0x0000\n  (Bus Powered)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/cameras/isight_macbook.txt",
    "content": "\nBus 001 Device 010: ID 05ac:8501 Apple, Inc. Built-in iSight [Micron]\nDevice Descriptor:\n  bLength                18\n  bDescriptorType         1\n  bcdUSB               2.00\n  bDeviceClass          239 Miscellaneous Device\n  bDeviceSubClass         2 ?\n  bDeviceProtocol         1 Interface Association\n  bMaxPacketSize0        64\n  idVendor           0x05ac Apple, Inc.\n  idProduct          0x8501 Built-in iSight [Micron]\n  bcdDevice            1.89\n  iManufacturer           1 Micron\n  iProduct                2 Built-in iSight\n  iSerial                 0 \n  bNumConfigurations      1\n  Configuration Descriptor:\n    bLength                 9\n    bDescriptorType         2\n    wTotalLength          267\n    bNumInterfaces          2\n    bConfigurationValue     1\n    iConfiguration          0 \n    bmAttributes         0x80\n      (Bus Powered)\n    MaxPower              100mA\n    Interface Association:\n      bLength                 8\n      bDescriptorType        11\n      bFirstInterface         0\n      bInterfaceCount         2\n      bFunctionClass         14 Video\n      bFunctionSubClass       3 Video Interface Collection\n      bFunctionProtocol       0 \n      iFunction               0 \n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        0\n      bAlternateSetting       0\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      1 Video Control\n      bInterfaceProtocol      0 \n      iInterface              0 \n      VideoControl Interface Descriptor:\n        bLength                13\n        bDescriptorType        36\n        bDescriptorSubtype      1 (HEADER)\n        bcdUVC               1.00\n        wTotalLength           49\n        dwClockFrequency       13.500000MHz\n        bInCollection           1\n        baInterfaceNr( 0)       1\n      VideoControl Interface Descriptor:\n        bLength                16\n        bDescriptorType        36\n        bDescriptorSubtype      2 (INPUT_TERMINAL)\n        bTerminalID             1\n        wTerminalType      0x0201 Camera Sensor\n        bAssocTerminal          0\n        iTerminal               0 \n        wObjectiveFocalLengthMin      0\n        wObjectiveFocalLengthMax      0\n        wOcularFocalLength            0\n        bControlSize                  1\n        bmControls           0x00000000\n      VideoControl Interface Descriptor:\n        bLength                11\n        bDescriptorType        36\n        bDescriptorSubtype      5 (PROCESSING_UNIT)\n      Warning: Descriptor too short\n        bUnitID                 2\n        bSourceID               1\n        wMaxMultiplier          0\n        bControlSize            2\n        bmControls     0x00000039\n          Brightness\n          Saturation\n          Sharpness\n          Gamma\n        iProcessing             0 \n        bmVideoStandards     0x 9\n          None\n          SECAM - 625/50\n      VideoControl Interface Descriptor:\n        bLength                 9\n        bDescriptorType        36\n        bDescriptorSubtype      3 (OUTPUT_TERMINAL)\n        bTerminalID             3\n        wTerminalType      0x0101 USB Streaming\n        bAssocTerminal          0\n        bSourceID               2\n        iTerminal               0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x81  EP 1 IN\n        bmAttributes            3\n          Transfer Type            Interrupt\n          Synch Type               None\n          Usage Type               Data\n        wMaxPacketSize     0x0008  1x 8 bytes\n        bInterval              10\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       0\n      bNumEndpoints           0\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      VideoStreaming Interface Descriptor:\n        bLength                            14\n        bDescriptorType                    36\n        bDescriptorSubtype                  1 (INPUT_HEADER)\n        bNumFormats                         1\n        wTotalLength                      155\n        bEndPointAddress                  130\n        bmInfo                              0\n        bTerminalLink                       3\n        bStillCaptureMethod                 0\n        bTriggerSupport                     0\n        bTriggerUsage                       0\n        bControlSize                        1\n        bmaControls( 0)                    27\n      VideoStreaming Interface Descriptor:\n        bLength                            27\n        bDescriptorType                    36\n        bDescriptorSubtype                  4 (FORMAT_UNCOMPRESSED)\n        bFormatIndex                        1\n        bNumFrameDescriptors                3\n        guidFormat                            {55595659-0000-1000-8000-00aa00389b71}\n        bBitsPerPixel                      16\n        bDefaultFrameIndex                  1\n        bAspectRatioX                       0\n        bAspectRatioY                       0\n        bmInterlaceFlags                 0x00\n          Interlaced stream or variable: No\n          Fields per frame: 1 fields\n          Field 1 first: No\n          Field pattern: Field 1 only\n          bCopyProtect                      0\n      VideoStreaming Interface Descriptor:\n        bLength                            38\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         1\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            640\n        wHeight                           480\n        dwMinBitRate                383976960\n        dwMaxBitRate                383976960\n        dwMaxVideoFrameBufferSize      614400\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  0\n        dwMinFrameInterval             333333\n        dwMaxFrameInterval             333333\n        dwFrameIntervalStep                 0\n      VideoStreaming Interface Descriptor:\n        bLength                            38\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         2\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            352\n        wHeight                           288\n        dwMinBitRate                383976960\n        dwMaxBitRate                383976960\n        dwMaxVideoFrameBufferSize      202752\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  0\n        dwMinFrameInterval             333333\n        dwMaxFrameInterval             333333\n        dwFrameIntervalStep                 0\n      VideoStreaming Interface Descriptor:\n        bLength                            38\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         3\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            320\n        wHeight                           240\n        dwMinBitRate                383976960\n        dwMaxBitRate                383976960\n        dwMaxVideoFrameBufferSize      153600\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  0\n        dwMinFrameInterval             333333\n        dwMaxFrameInterval             333333\n        dwFrameIntervalStep                 0\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       1\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x82  EP 2 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x1400  3x 1024 bytes\n        bInterval               1\nDevice Qualifier (for other device speed):\n  bLength                10\n  bDescriptorType         6\n  bcdUSB               2.00\n  bDeviceClass           14 Video\n  bDeviceSubClass         2 Video Streaming\n  bDeviceProtocol         0 \n  bMaxPacketSize0         8\n  bNumConfigurations      1\nDevice Status:     0x0000\n  (Bus Powered)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/cameras/ms_lifecam_show.txt",
    "content": "\nBus 001 Device 010: ID 045e:0729 Microsoft Corp. \nDevice Descriptor:\n  bLength                18\n  bDescriptorType         1\n  bcdUSB               2.00\n  bDeviceClass          239 Miscellaneous Device\n  bDeviceSubClass         2 ?\n  bDeviceProtocol         1 Interface Association\n  bMaxPacketSize0        64\n  idVendor           0x045e Microsoft Corp.\n  idProduct          0x0729 \n  bcdDevice            1.00\n  iManufacturer           1 Microsoft\n  iProduct                2 Microsoft LifeCam Show(TM)\n  iSerial                 0 \n  bNumConfigurations      1\n  Configuration Descriptor:\n    bLength                 9\n    bDescriptorType         2\n    wTotalLength          961\n    bNumInterfaces          5\n    bConfigurationValue     1\n    iConfiguration          0 \n    bmAttributes         0x80\n      (Bus Powered)\n    MaxPower              320mA\n    Interface Association:\n      bLength                 8\n      bDescriptorType        11\n      bFirstInterface         0\n      bInterfaceCount         2\n      bFunctionClass         14 Video\n      bFunctionSubClass       3 Video Interface Collection\n      bFunctionProtocol       0 \n      iFunction               2 Microsoft LifeCam Show(TM)\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        0\n      bAlternateSetting       0\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      1 Video Control\n      bInterfaceProtocol      0 \n      iInterface              2 Microsoft LifeCam Show(TM)\n      VideoControl Interface Descriptor:\n        bLength                13\n        bDescriptorType        36\n        bDescriptorSubtype      1 (HEADER)\n        bcdUVC               1.00\n        wTotalLength           79\n        dwClockFrequency       24.000000MHz\n        bInCollection           1\n        baInterfaceNr( 0)       1\n      VideoControl Interface Descriptor:\n        bLength                18\n        bDescriptorType        36\n        bDescriptorSubtype      2 (INPUT_TERMINAL)\n        bTerminalID             1\n        wTerminalType      0x0201 Camera Sensor\n        bAssocTerminal          0\n        iTerminal               0 \n        wObjectiveFocalLengthMin      0\n        wObjectiveFocalLengthMax      0\n        wOcularFocalLength            0\n        bControlSize                  3\n        bmControls           0x00000a0a\n          Auto-Exposure Mode\n          Exposure Time (Absolute)\n          Zoom (Absolute)\n          PanTilt (Absolute)\n      VideoControl Interface Descriptor:\n        bLength                11\n        bDescriptorType        36\n        bDescriptorSubtype      5 (PROCESSING_UNIT)\n      Warning: Descriptor too short\n        bUnitID                 2\n        bSourceID               1\n        wMaxMultiplier          0\n        bControlSize            2\n        bmControls     0x0000073b\n          Brightness\n          Contrast\n          Saturation\n          Sharpness\n          Gamma\n          Backlight Compensation\n          Gain\n          Power Line Frequency\n        iProcessing             0 \n        bmVideoStandards     0x 9\n          None\n          SECAM - 625/50\n      VideoControl Interface Descriptor:\n        bLength                 9\n        bDescriptorType        36\n        bDescriptorSubtype      3 (OUTPUT_TERMINAL)\n        bTerminalID             3\n        wTerminalType      0x0101 USB Streaming\n        bAssocTerminal          0\n        bSourceID               2\n        iTerminal               0 \n      VideoControl Interface Descriptor:\n        bLength                28\n        bDescriptorType        36\n        bDescriptorSubtype      6 (EXTENSION_UNIT)\n        bUnitID                 4\n        guidExtensionCode         {5dc717a9-1941-da11-ae0e-000d56ac7b4c}\n        bNumControl             8\n        bNrPins                 1\n        baSourceID( 0)          1\n        bControlSize            3\n        bmControls( 0)       0xf9\n        bmControls( 1)       0x01\n        bmControls( 2)       0xc0\n        iExtension              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x81  EP 1 IN\n        bmAttributes            3\n          Transfer Type            Interrupt\n          Synch Type               None\n          Usage Type               Data\n        wMaxPacketSize     0x000a  1x 10 bytes\n        bInterval               5\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       0\n      bNumEndpoints           0\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      VideoStreaming Interface Descriptor:\n        bLength                            15\n        bDescriptorType                    36\n        bDescriptorSubtype                  1 (INPUT_HEADER)\n        bNumFormats                         2\n        wTotalLength                      587\n        bEndPointAddress                  130\n        bmInfo                              0\n        bTerminalLink                       3\n        bStillCaptureMethod                 2\n        bTriggerSupport                     1\n        bTriggerUsage                       1\n        bControlSize                        1\n        bmaControls( 0)                    27\n        bmaControls( 1)                    27\n      VideoStreaming Interface Descriptor:\n        bLength                            27\n        bDescriptorType                    36\n        bDescriptorSubtype                  4 (FORMAT_UNCOMPRESSED)\n        bFormatIndex                        1\n        bNumFrameDescriptors                6\n        guidFormat                            {59555932-0000-1000-8000-00aa00389b71}\n        bBitsPerPixel                      16\n        bDefaultFrameIndex                  1\n        bAspectRatioX                       0\n        bAspectRatioY                       0\n        bmInterlaceFlags                 0x00\n          Interlaced stream or variable: No\n          Fields per frame: 1 fields\n          Field 1 first: No\n          Field pattern: Field 1 only\n          bCopyProtect                      0\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         1\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            352\n        wHeight                           288\n        dwMinBitRate                196608000\n        dwMaxBitRate                196608000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval         666667\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)            666667\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         2\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            640\n        wHeight                           480\n        dwMinBitRate                196608000\n        dwMaxBitRate                196608000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval         666667\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)            666667\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         3\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            320\n        wHeight                           240\n        dwMinBitRate                196608000\n        dwMaxBitRate                196608000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval         666667\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)            666667\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         4\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            176\n        wHeight                           144\n        dwMinBitRate                196608000\n        dwMaxBitRate                196608000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval         666667\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)            666667\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         5\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            160\n        wHeight                           120\n        dwMinBitRate                196608000\n        dwMaxBitRate                196608000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval         666667\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)            666667\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         6\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            800\n        wHeight                           600\n        dwMinBitRate                196608000\n        dwMaxBitRate                196608000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval         666667\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)            666667\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  3 (STILL_IMAGE_FRAME)\n        bEndpointAddress                    0\n        bNumImageSizePatterns               6\n        wWidth( 0)                        352\n        wHeight( 0)                       288\n        wWidth( 1)                        640\n        wHeight( 1)                       480\n        wWidth( 2)                        320\n        wHeight( 2)                       240\n        wWidth( 3)                        176\n        wHeight( 3)                       144\n        wWidth( 4)                        160\n        wHeight( 4)                       120\n        wWidth( 5)                        800\n        wHeight( 5)                       600\n        bNumCompressionPatterns             6\n      VideoStreaming Interface Descriptor:\n        bLength                             6\n        bDescriptorType                    36\n        bDescriptorSubtype                 13 (COLORFORMAT)\n        bColorPrimaries                     0 (Unspecified)\n        bTransferCharacteristics            0 (Unspecified)\n        bMatrixCoefficients                 0 (Unspecified)\n      VideoStreaming Interface Descriptor:\n        bLength                            11\n        bDescriptorType                    36\n        bDescriptorSubtype                  6 (FORMAT_MJPEG)\n        bFormatIndex                        2\n        bNumFrameDescriptors                9\n        bFlags                              1\n          Fixed-size samples: Yes\n        bDefaultFrameIndex                  1\n        bAspectRatioX                       0\n        bAspectRatioY                       0\n        bmInterlaceFlags                 0x00\n          Interlaced stream or variable: No\n          Fields per frame: 1 fields\n          Field 1 first: No\n          Field pattern: Field 1 only\n          bCopyProtect                      0\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         1\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            352\n        wHeight                           288\n        dwMinBitRate                196608000\n        dwMaxBitRate                196608000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval         666667\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)            666667\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         2\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            640\n        wHeight                           480\n        dwMinBitRate                196608000\n        dwMaxBitRate                196608000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval         666667\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)            666667\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         3\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            320\n        wHeight                           240\n        dwMinBitRate                196608000\n        dwMaxBitRate                196608000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval         666667\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)            666667\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         4\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            176\n        wHeight                           144\n        dwMinBitRate                196608000\n        dwMaxBitRate                196608000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval         666667\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)            666667\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         5\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            160\n        wHeight                           120\n        dwMinBitRate                196608000\n        dwMaxBitRate                196608000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval         666667\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)            666667\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         6\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            800\n        wHeight                           600\n        dwMinBitRate                196608000\n        dwMaxBitRate                196608000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval         666667\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)            666667\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         7\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                           1024\n        wHeight                           768\n        dwMinBitRate                196608000\n        dwMaxBitRate                196608000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval        1333333\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)           1333333\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         8\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                           1280\n        wHeight                           960\n        dwMinBitRate                196608000\n        dwMaxBitRate                196608000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval        1333333\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)           1333333\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         9\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                           1600\n        wHeight                          1200\n        dwMinBitRate                196608000\n        dwMaxBitRate                196608000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval        1333333\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)           1333333\n      VideoStreaming Interface Descriptor:\n        bLength                            42\n        bDescriptorType                    36\n        bDescriptorSubtype                  3 (STILL_IMAGE_FRAME)\n        bEndpointAddress                    0\n        bNumImageSizePatterns               9\n        wWidth( 0)                        352\n        wHeight( 0)                       288\n        wWidth( 1)                        640\n        wHeight( 1)                       480\n        wWidth( 2)                        320\n        wHeight( 2)                       240\n        wWidth( 3)                        176\n        wHeight( 3)                       144\n        wWidth( 4)                        160\n        wHeight( 4)                       120\n        wWidth( 5)                        800\n        wHeight( 5)                       600\n        wWidth( 6)                       1024\n        wHeight( 6)                       768\n        wWidth( 7)                       1280\n        wHeight( 7)                       960\n        wWidth( 8)                       1600\n        wHeight( 8)                      1200\n        bNumCompressionPatterns             9\n      VideoStreaming Interface Descriptor:\n        bLength                             6\n        bDescriptorType                    36\n        bDescriptorSubtype                 13 (COLORFORMAT)\n        bColorPrimaries                     0 (Unspecified)\n        bTransferCharacteristics            0 (Unspecified)\n        bMatrixCoefficients                 0 (Unspecified)\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       1\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x82  EP 2 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x0080  1x 128 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       2\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x82  EP 2 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x0200  1x 512 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       3\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x82  EP 2 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x0400  1x 1024 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       4\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x82  EP 2 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x0b00  2x 768 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       5\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x82  EP 2 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x0c00  2x 1024 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       6\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x82  EP 2 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x1380  3x 896 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       7\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x82  EP 2 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x1400  3x 1024 bytes\n        bInterval               1\n    Interface Association:\n      bLength                 8\n      bDescriptorType        11\n      bFirstInterface         2\n      bInterfaceCount         2\n      bFunctionClass          1 Audio\n      bFunctionSubClass       2 Streaming\n      bFunctionProtocol       0 \n      iFunction               2 Microsoft LifeCam Show(TM)\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        2\n      bAlternateSetting       0\n      bNumEndpoints           0\n      bInterfaceClass         1 Audio\n      bInterfaceSubClass      1 Control Device\n      bInterfaceProtocol      0 \n      iInterface              2 Microsoft LifeCam Show(TM)\n      AudioControl Interface Descriptor:\n        bLength                 9\n        bDescriptorType        36\n        bDescriptorSubtype      1 (HEADER)\n        bcdADC               1.00\n        wTotalLength           39\n        bInCollection           1\n        baInterfaceNr( 0)       3\n      AudioControl Interface Descriptor:\n        bLength                12\n        bDescriptorType        36\n        bDescriptorSubtype      2 (INPUT_TERMINAL)\n        bTerminalID             1\n        wTerminalType      0x0201 Microphone\n        bAssocTerminal          0\n        bNrChannels             1\n        wChannelConfig     0x0000\n        iChannelNames           0 \n        iTerminal               0 \n      AudioControl Interface Descriptor:\n        bLength                 9\n        bDescriptorType        36\n        bDescriptorSubtype      6 (FEATURE_UNIT)\n        bUnitID                 2\n        bSourceID               1\n        bControlSize            1\n        bmaControls( 0)      0x00\n        bmaControls( 1)      0x03\n          Mute\n          Volume\n        iFeature                0 \n      AudioControl Interface Descriptor:\n        bLength                 9\n        bDescriptorType        36\n        bDescriptorSubtype      3 (OUTPUT_TERMINAL)\n        bTerminalID             3\n        wTerminalType      0x0101 USB Streaming\n        bAssocTerminal          1\n        bSourceID               2\n        iTerminal               0 \n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        3\n      bAlternateSetting       0\n      bNumEndpoints           0\n      bInterfaceClass         1 Audio\n      bInterfaceSubClass      2 Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        3\n      bAlternateSetting       1\n      bNumEndpoints           1\n      bInterfaceClass         1 Audio\n      bInterfaceSubClass      2 Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      AudioStreaming Interface Descriptor:\n        bLength                 7\n        bDescriptorType        36\n        bDescriptorSubtype      1 (AS_GENERAL)\n        bTerminalLink           3\n        bDelay                  1 frames\n        wFormatTag              1 PCM\n      AudioStreaming Interface Descriptor:\n        bLength                14\n        bDescriptorType        36\n        bDescriptorSubtype      2 (FORMAT_TYPE)\n        bFormatType             1 (FORMAT_TYPE_I)\n        bNrChannels             1\n        bSubframeSize           2\n        bBitResolution         16\n        bSamFreqType            2 Discrete\n        tSamFreq[ 0]        44100\n        tSamFreq[ 1]        48000\n      Endpoint Descriptor:\n        bLength                 9\n        bDescriptorType         5\n        bEndpointAddress     0x83  EP 3 IN\n        bmAttributes            1\n          Transfer Type            Isochronous\n          Synch Type               None\n          Usage Type               Data\n        wMaxPacketSize     0x0062  1x 98 bytes\n        bInterval               4\n        bRefresh                0\n        bSynchAddress           0\n        AudioControl Endpoint Descriptor:\n          bLength                 7\n          bDescriptorType        37\n          bDescriptorSubtype      1 (EP_GENERAL)\n          bmAttributes         0x01\n            Sampling Frequency\n          bLockDelayUnits         0 Undefined\n          wLockDelay              0 Undefined\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        4\n      bAlternateSetting       0\n      bNumEndpoints           1\n      bInterfaceClass         3 Human Interface Device\n      bInterfaceSubClass      1 Boot Interface Subclass\n      bInterfaceProtocol      1 Keyboard\n      iInterface              0 \n        HID Device Descriptor:\n          bLength                 9\n          bDescriptorType        33\n          bcdHID               1.10\n          bCountryCode            0 Not supported\n          bNumDescriptors         1\n          bDescriptorType        34 Report\n          wDescriptorLength      24\n         Report Descriptors: \n           ** UNAVAILABLE **\n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x85  EP 5 IN\n        bmAttributes            3\n          Transfer Type            Interrupt\n          Synch Type               None\n          Usage Type               Data\n        wMaxPacketSize     0x0001  1x 1 bytes\n        bInterval              10\nDevice Qualifier (for other device speed):\n  bLength                10\n  bDescriptorType         6\n  bcdUSB               2.00\n  bDeviceClass          239 Miscellaneous Device\n  bDeviceSubClass         2 ?\n  bDeviceProtocol         1 Interface Association\n  bMaxPacketSize0        64\n  bNumConfigurations      1\nDevice Status:     0x0000\n  (Bus Powered)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/cameras/quickcampro9000.txt",
    "content": "\nBus 001 Device 009: ID 046d:0809 Logitech, Inc. Webcam Pro 9000\nDevice Descriptor:\n  bLength                18\n  bDescriptorType         1\n  bcdUSB               2.00\n  bDeviceClass          239 Miscellaneous Device\n  bDeviceSubClass         2 ?\n  bDeviceProtocol         1 Interface Association\n  bMaxPacketSize0        64\n  idVendor           0x046d Logitech, Inc.\n  idProduct          0x0809 Webcam Pro 9000\n  bcdDevice            0.10\n  iManufacturer           0 \n  iProduct                0 \n  iSerial                 2 XXXXXXXX\n  bNumConfigurations      1\n  Configuration Descriptor:\n    bLength                 9\n    bDescriptorType         2\n    wTotalLength         2589\n    bNumInterfaces          4\n    bConfigurationValue     1\n    iConfiguration          0 \n    bmAttributes         0x80\n      (Bus Powered)\n    MaxPower              500mA\n    Interface Association:\n      bLength                 8\n      bDescriptorType        11\n      bFirstInterface         0\n      bInterfaceCount         2\n      bFunctionClass         14 Video\n      bFunctionSubClass       3 Video Interface Collection\n      bFunctionProtocol       0 \n      iFunction               0 \n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        0\n      bAlternateSetting       0\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      1 Video Control\n      bInterfaceProtocol      0 \n      iInterface              0 \n      VideoControl Interface Descriptor:\n        bLength                13\n        bDescriptorType        36\n        bDescriptorSubtype      1 (HEADER)\n        bcdUVC               1.00\n        wTotalLength          245\n        dwClockFrequency       48.000000MHz\n        bInCollection           1\n        baInterfaceNr( 0)       1\n      VideoControl Interface Descriptor:\n        bLength                18\n        bDescriptorType        36\n        bDescriptorSubtype      2 (INPUT_TERMINAL)\n        bTerminalID             1\n        wTerminalType      0x0201 Camera Sensor\n        bAssocTerminal          0\n        iTerminal               0 \n        wObjectiveFocalLengthMin      0\n        wObjectiveFocalLengthMax      0\n        wOcularFocalLength            0\n        bControlSize                  3\n        bmControls           0x0000080e\n          Auto-Exposure Mode\n          Auto-Exposure Priority\n          Exposure Time (Absolute)\n          PanTilt (Absolute)\n      VideoControl Interface Descriptor:\n        bLength                11\n        bDescriptorType        36\n        bDescriptorSubtype      5 (PROCESSING_UNIT)\n      Warning: Descriptor too short\n        bUnitID                 2\n        bSourceID               1\n        wMaxMultiplier      16384\n        bControlSize            2\n        bmControls     0x0000175b\n          Brightness\n          Contrast\n          Saturation\n          Sharpness\n          White Balance Temperature\n          Backlight Compensation\n          Gain\n          Power Line Frequency\n          White Balance Temperature, Auto\n        iProcessing             0 \n        bmVideoStandards     0x1b\n          None\n          NTSC - 525/60\n          SECAM - 625/50\n          NTSC - 625/50\n      VideoControl Interface Descriptor:\n        bLength                27\n        bDescriptorType        36\n        bDescriptorSubtype      6 (EXTENSION_UNIT)\n        bUnitID                 4\n        guidExtensionCode         {82066163-7050-ab49-b8cc-b3855e8d221e}\n        bNumControl            10\n        bNrPins                 1\n        baSourceID( 0)          2\n        bControlSize            2\n        bmControls( 0)       0xff\n        bmControls( 1)       0x03\n        iExtension              0 \n      VideoControl Interface Descriptor:\n        bLength                27\n        bDescriptorType        36\n        bDescriptorSubtype      6 (EXTENSION_UNIT)\n        bUnitID                13\n        guidExtensionCode         {82066163-7050-ab49-b8cc-b3855e8d221f}\n        bNumControl             7\n        bNrPins                 1\n        baSourceID( 0)          2\n        bControlSize            2\n        bmControls( 0)       0x6f\n        bmControls( 1)       0x01\n        iExtension              0 \n      VideoControl Interface Descriptor:\n        bLength                28\n        bDescriptorType        36\n        bDescriptorSubtype      6 (EXTENSION_UNIT)\n        bUnitID                 8\n        guidExtensionCode         {82066163-7050-ab49-b8cc-b3855e8d2251}\n        bNumControl             3\n        bNrPins                 1\n        baSourceID( 0)          4\n        bControlSize            3\n        bmControls( 0)       0x19\n        bmControls( 1)       0x00\n        bmControls( 2)       0x00\n        iExtension              0 \n      VideoControl Interface Descriptor:\n        bLength                28\n        bDescriptorType        36\n        bDescriptorSubtype      6 (EXTENSION_UNIT)\n        bUnitID                10\n        guidExtensionCode         {82066163-7050-ab49-b8cc-b3855e8d2252}\n        bNumControl            24\n        bNrPins                 1\n        baSourceID( 0)          4\n        bControlSize            3\n        bmControls( 0)       0xff\n        bmControls( 1)       0xff\n        bmControls( 2)       0xff\n        iExtension              0 \n      VideoControl Interface Descriptor:\n        bLength                28\n        bDescriptorType        36\n        bDescriptorSubtype      6 (EXTENSION_UNIT)\n        bUnitID                14\n        guidExtensionCode         {b7935ba4-15c7-0245-90f4-532a3b311365}\n        bNumControl             4\n        bNrPins                 1\n        baSourceID( 0)          1\n        bControlSize            3\n        bmControls( 0)       0x0f\n        bmControls( 1)       0x00\n        bmControls( 2)       0x00\n        iExtension              0 \n      VideoControl Interface Descriptor:\n        bLength                28\n        bDescriptorType        36\n        bDescriptorSubtype      6 (EXTENSION_UNIT)\n        bUnitID                 9\n        guidExtensionCode         {82066163-7050-ab49-b8cc-b3855e8d2256}\n        bNumControl             5\n        bNrPins                 1\n        baSourceID( 0)          4\n        bControlSize            3\n        bmControls( 0)       0x0c\n        bmControls( 1)       0x00\n        bmControls( 2)       0x00\n        iExtension              0 \n      VideoControl Interface Descriptor:\n        bLength                28\n        bDescriptorType        36\n        bDescriptorSubtype      6 (EXTENSION_UNIT)\n        bUnitID                12\n        guidExtensionCode         {82066163-7050-ab49-b8cc-b3855e8d2250}\n        bNumControl            17\n        bNrPins                 1\n        baSourceID( 0)          4\n        bControlSize            3\n        bmControls( 0)       0xfe\n        bmControls( 1)       0x7f\n        bmControls( 2)       0x70\n        iExtension              0 \n      VideoControl Interface Descriptor:\n        bLength                 9\n        bDescriptorType        36\n        bDescriptorSubtype      3 (OUTPUT_TERMINAL)\n        bTerminalID             5\n        wTerminalType      0x0101 USB Streaming\n        bAssocTerminal          0\n        bSourceID               4\n        iTerminal               0 \n      ** UNRECOGNIZED:  20 41 01 0b 82 06 61 63 70 50 ab 49 b8 cc b3 85 5e 8d 22 55 01 01 04 03 01 00 00 00 00 00 00 00\n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x87  EP 7 IN\n        bmAttributes            3\n          Transfer Type            Interrupt\n          Synch Type               None\n          Usage Type               Data\n        wMaxPacketSize     0x0010  1x 16 bytes\n        bInterval               8\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       0\n      bNumEndpoints           0\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      VideoStreaming Interface Descriptor:\n        bLength                            16\n        bDescriptorType                    36\n        bDescriptorSubtype                  1 (INPUT_HEADER)\n        bNumFormats                         3\n        wTotalLength                     1852\n        bEndPointAddress                  129\n        bmInfo                              0\n        bTerminalLink                       5\n        bStillCaptureMethod                 2\n        bTriggerSupport                     1\n        bTriggerUsage                       0\n        bControlSize                        1\n        bmaControls( 0)                    27\n        bmaControls( 1)                    27\n        bmaControls( 2)                    27\n      VideoStreaming Interface Descriptor:\n        bLength                            27\n        bDescriptorType                    36\n        bDescriptorSubtype                  4 (FORMAT_UNCOMPRESSED)\n        bFormatIndex                        1\n        bNumFrameDescriptors               18\n        guidFormat                            {59555932-0000-1000-8000-00aa00389b71}\n        bBitsPerPixel                      16\n        bDefaultFrameIndex                  1\n        bAspectRatioX                       0\n        bAspectRatioY                       0\n        bmInterlaceFlags                 0x00\n          Interlaced stream or variable: No\n          Fields per frame: 1 fields\n          Field 1 first: No\n          Field pattern: Field 1 only\n          bCopyProtect                      0\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         1\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            640\n        wHeight                           480\n        dwMinBitRate                 24576000\n        dwMaxBitRate                147456000\n        dwMaxVideoFrameBufferSize      614400\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         2\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            160\n        wHeight                           120\n        dwMinBitRate                  1536000\n        dwMaxBitRate                  9216000\n        dwMaxVideoFrameBufferSize       38400\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         3\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            176\n        wHeight                           144\n        dwMinBitRate                  2027520\n        dwMaxBitRate                 12165120\n        dwMaxVideoFrameBufferSize       50688\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         4\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            320\n        wHeight                           240\n        dwMinBitRate                  6144000\n        dwMaxBitRate                 36864000\n        dwMaxVideoFrameBufferSize      153600\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         5\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            352\n        wHeight                           288\n        dwMinBitRate                  8110080\n        dwMaxBitRate                 48660480\n        dwMaxVideoFrameBufferSize      202752\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         6\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            640\n        wHeight                           360\n        dwMinBitRate                 18432000\n        dwMaxBitRate                110592000\n        dwMaxVideoFrameBufferSize      460800\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         7\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            640\n        wHeight                           400\n        dwMinBitRate                 20480000\n        dwMaxBitRate                122880000\n        dwMaxVideoFrameBufferSize      512000\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            46\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         8\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            768\n        wHeight                           480\n        dwMinBitRate                 29491200\n        dwMaxBitRate                147456000\n        dwMaxVideoFrameBufferSize      737280\n        dwDefaultFrameInterval         400000\n        bFrameIntervalType                  5\n        dwFrameInterval( 0)            400000\n        dwFrameInterval( 1)            500000\n        dwFrameInterval( 2)            666666\n        dwFrameInterval( 3)           1000000\n        dwFrameInterval( 4)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            46\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                         9\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            800\n        wHeight                           456\n        dwMinBitRate                 29184000\n        dwMaxBitRate                145920000\n        dwMaxVideoFrameBufferSize      729600\n        dwDefaultFrameInterval         400000\n        bFrameIntervalType                  5\n        dwFrameInterval( 0)            400000\n        dwFrameInterval( 1)            500000\n        dwFrameInterval( 2)            666666\n        dwFrameInterval( 3)           1000000\n        dwFrameInterval( 4)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            46\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                        10\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            800\n        wHeight                           504\n        dwMinBitRate                 32256000\n        dwMaxBitRate                161280000\n        dwMaxVideoFrameBufferSize      806400\n        dwDefaultFrameInterval         400000\n        bFrameIntervalType                  5\n        dwFrameInterval( 0)            400000\n        dwFrameInterval( 1)            500000\n        dwFrameInterval( 2)            666666\n        dwFrameInterval( 3)           1000000\n        dwFrameInterval( 4)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            46\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                        11\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            800\n        wHeight                           600\n        dwMinBitRate                 38400000\n        dwMaxBitRate                192000000\n        dwMaxVideoFrameBufferSize      960000\n        dwDefaultFrameInterval         400000\n        bFrameIntervalType                  5\n        dwFrameInterval( 0)            400000\n        dwFrameInterval( 1)            500000\n        dwFrameInterval( 2)            666666\n        dwFrameInterval( 3)           1000000\n        dwFrameInterval( 4)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            46\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                        12\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            864\n        wHeight                           480\n        dwMinBitRate                 33177600\n        dwMaxBitRate                165888000\n        dwMaxVideoFrameBufferSize      829440\n        dwDefaultFrameInterval         400000\n        bFrameIntervalType                  5\n        dwFrameInterval( 0)            400000\n        dwFrameInterval( 1)            500000\n        dwFrameInterval( 2)            666666\n        dwFrameInterval( 3)           1000000\n        dwFrameInterval( 4)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            38\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                        13\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            960\n        wHeight                           720\n        dwMinBitRate                 55296000\n        dwMaxBitRate                165888000\n        dwMaxVideoFrameBufferSize     1382400\n        dwDefaultFrameInterval        1000000\n        bFrameIntervalType                  3\n        dwFrameInterval( 0)            666666\n        dwFrameInterval( 1)           1000000\n        dwFrameInterval( 2)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            34\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                        14\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                           1280\n        wHeight                           720\n        dwMinBitRate                 73728000\n        dwMaxBitRate                147456000\n        dwMaxVideoFrameBufferSize     1843200\n        dwDefaultFrameInterval        2000000\n        bFrameIntervalType                  2\n        dwFrameInterval( 0)           1333333\n        dwFrameInterval( 1)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            34\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                        15\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                           1280\n        wHeight                           800\n        dwMinBitRate                 81920000\n        dwMaxBitRate                163840000\n        dwMaxVideoFrameBufferSize     2048000\n        dwDefaultFrameInterval        2000000\n        bFrameIntervalType                  2\n        dwFrameInterval( 0)           1333333\n        dwFrameInterval( 1)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                        16\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                           1600\n        wHeight                           904\n        dwMinBitRate                115712000\n        dwMaxBitRate                115712000\n        dwMaxVideoFrameBufferSize     2892800\n        dwDefaultFrameInterval        2000000\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                        17\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                           1600\n        wHeight                          1000\n        dwMinBitRate                128000000\n        dwMaxBitRate                128000000\n        dwMaxVideoFrameBufferSize     3200000\n        dwDefaultFrameInterval        2000000\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            30\n        bDescriptorType                    36\n        bDescriptorSubtype                  5 (FRAME_UNCOMPRESSED)\n        bFrameIndex                        18\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                           1600\n        wHeight                          1200\n        dwMinBitRate                153600000\n        dwMaxBitRate                153600000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval        2000000\n        bFrameIntervalType                  1\n        dwFrameInterval( 0)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            79\n        bDescriptorType                    36\n        bDescriptorSubtype                  3 (STILL_IMAGE_FRAME)\n        bEndpointAddress                    0\n        bNumImageSizePatterns              18\n        wWidth( 0)                        640\n        wHeight( 0)                       480\n        wWidth( 1)                        160\n        wHeight( 1)                       120\n        wWidth( 2)                        176\n        wHeight( 2)                       144\n        wWidth( 3)                        320\n        wHeight( 3)                       240\n        wWidth( 4)                        352\n        wHeight( 4)                       288\n        wWidth( 5)                        640\n        wHeight( 5)                       360\n        wWidth( 6)                        640\n        wHeight( 6)                       400\n        wWidth( 7)                        768\n        wHeight( 7)                       480\n        wWidth( 8)                        800\n        wHeight( 8)                       456\n        wWidth( 9)                        800\n        wHeight( 9)                       504\n        wWidth(10)                        800\n        wHeight(10)                       600\n        wWidth(11)                        864\n        wHeight(11)                       480\n        wWidth(12)                        960\n        wHeight(12)                       720\n        wWidth(13)                       1280\n        wHeight(13)                       720\n        wWidth(14)                       1280\n        wHeight(14)                       800\n        wWidth(15)                       1600\n        wHeight(15)                       904\n        wWidth(16)                       1600\n        wHeight(16)                      1000\n        wWidth(17)                       1600\n        wHeight(17)                      1200\n        bNumCompressionPatterns            18\n        bCompression( 0)                    5\n      VideoStreaming Interface Descriptor:\n        bLength                             6\n        bDescriptorType                    36\n        bDescriptorSubtype                 13 (COLORFORMAT)\n        bColorPrimaries                     1 (BT.709,sRGB)\n        bTransferCharacteristics            1 (BT.709)\n        bMatrixCoefficients                 4 (SMPTE 170M (BT.601))\n      VideoStreaming Interface Descriptor:\n        bLength                            11\n        bDescriptorType                    36\n        bDescriptorSubtype                  6 (FORMAT_MJPEG)\n        bFormatIndex                        2\n        bNumFrameDescriptors               18\n        bFlags                              1\n          Fixed-size samples: Yes\n        bDefaultFrameIndex                  1\n        bAspectRatioX                       0\n        bAspectRatioY                       0\n        bmInterlaceFlags                 0x00\n          Interlaced stream or variable: No\n          Fields per frame: 1 fields\n          Field 1 first: No\n          Field pattern: Field 1 only\n          bCopyProtect                      0\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         1\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            640\n        wHeight                           480\n        dwMinBitRate                 24576000\n        dwMaxBitRate                147456000\n        dwMaxVideoFrameBufferSize      614400\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         2\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            160\n        wHeight                           120\n        dwMinBitRate                  1536000\n        dwMaxBitRate                  9216000\n        dwMaxVideoFrameBufferSize       38400\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         3\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            176\n        wHeight                           144\n        dwMinBitRate                  2027520\n        dwMaxBitRate                 12165120\n        dwMaxVideoFrameBufferSize       50688\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         4\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            320\n        wHeight                           240\n        dwMinBitRate                  6144000\n        dwMaxBitRate                 36864000\n        dwMaxVideoFrameBufferSize      153600\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         5\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            352\n        wHeight                           288\n        dwMinBitRate                  8110080\n        dwMaxBitRate                 48660480\n        dwMaxVideoFrameBufferSize      202752\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         6\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            640\n        wHeight                           360\n        dwMinBitRate                 18432000\n        dwMaxBitRate                110592000\n        dwMaxVideoFrameBufferSize      460800\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         7\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            640\n        wHeight                           400\n        dwMinBitRate                 20480000\n        dwMaxBitRate                122880000\n        dwMaxVideoFrameBufferSize      512000\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         8\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            768\n        wHeight                           480\n        dwMinBitRate                 29491200\n        dwMaxBitRate                176947200\n        dwMaxVideoFrameBufferSize      737280\n        dwDefaultFrameInterval         333333\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                         9\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            800\n        wHeight                           456\n        dwMinBitRate                 29184000\n        dwMaxBitRate                175104000\n        dwMaxVideoFrameBufferSize      729600\n        dwDefaultFrameInterval         666666\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                        10\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            800\n        wHeight                           504\n        dwMinBitRate                 32256000\n        dwMaxBitRate                193536000\n        dwMaxVideoFrameBufferSize      806400\n        dwDefaultFrameInterval         666666\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                        11\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            800\n        wHeight                           600\n        dwMinBitRate                 38400000\n        dwMaxBitRate                230400000\n        dwMaxVideoFrameBufferSize      960000\n        dwDefaultFrameInterval         666666\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                        12\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            864\n        wHeight                           480\n        dwMinBitRate                 33177600\n        dwMaxBitRate                199065600\n        dwMaxVideoFrameBufferSize      829440\n        dwDefaultFrameInterval         666666\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                        13\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                            960\n        wHeight                           720\n        dwMinBitRate                 55296000\n        dwMaxBitRate                331776000\n        dwMaxVideoFrameBufferSize     1382400\n        dwDefaultFrameInterval        1000000\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            50\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                        14\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                           1280\n        wHeight                           720\n        dwMinBitRate                 73728000\n        dwMaxBitRate                442368000\n        dwMaxVideoFrameBufferSize     1843200\n        dwDefaultFrameInterval        1000000\n        bFrameIntervalType                  6\n        dwFrameInterval( 0)            333333\n        dwFrameInterval( 1)            400000\n        dwFrameInterval( 2)            500000\n        dwFrameInterval( 3)            666666\n        dwFrameInterval( 4)           1000000\n        dwFrameInterval( 5)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            46\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                        15\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                           1280\n        wHeight                           800\n        dwMinBitRate                 81920000\n        dwMaxBitRate                409600000\n        dwMaxVideoFrameBufferSize     2048000\n        dwDefaultFrameInterval        1000000\n        bFrameIntervalType                  5\n        dwFrameInterval( 0)            400000\n        dwFrameInterval( 1)            500000\n        dwFrameInterval( 2)            666666\n        dwFrameInterval( 3)           1000000\n        dwFrameInterval( 4)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            34\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                        16\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                           1600\n        wHeight                           904\n        dwMinBitRate                115712000\n        dwMaxBitRate                231424000\n        dwMaxVideoFrameBufferSize     2892800\n        dwDefaultFrameInterval        1000000\n        bFrameIntervalType                  2\n        dwFrameInterval( 0)           1000000\n        dwFrameInterval( 1)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            34\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                        17\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                           1600\n        wHeight                          1000\n        dwMinBitRate                128000000\n        dwMaxBitRate                256000000\n        dwMaxVideoFrameBufferSize     3200000\n        dwDefaultFrameInterval        1000000\n        bFrameIntervalType                  2\n        dwFrameInterval( 0)           1000000\n        dwFrameInterval( 1)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            34\n        bDescriptorType                    36\n        bDescriptorSubtype                  7 (FRAME_MJPEG)\n        bFrameIndex                        18\n        bmCapabilities                   0x00\n          Still image unsupported\n        wWidth                           1600\n        wHeight                          1200\n        dwMinBitRate                153600000\n        dwMaxBitRate                307200000\n        dwMaxVideoFrameBufferSize     3840000\n        dwDefaultFrameInterval        2000000\n        bFrameIntervalType                  2\n        dwFrameInterval( 0)           1000000\n        dwFrameInterval( 1)           2000000\n      VideoStreaming Interface Descriptor:\n        bLength                            83\n        bDescriptorType                    36\n        bDescriptorSubtype                  3 (STILL_IMAGE_FRAME)\n        bEndpointAddress                    0\n        bNumImageSizePatterns              18\n        wWidth( 0)                        640\n        wHeight( 0)                       480\n        wWidth( 1)                        160\n        wHeight( 1)                       120\n        wWidth( 2)                        176\n        wHeight( 2)                       144\n        wWidth( 3)                        320\n        wHeight( 3)                       240\n        wWidth( 4)                        352\n        wHeight( 4)                       288\n        wWidth( 5)                        640\n        wHeight( 5)                       360\n        wWidth( 6)                        640\n        wHeight( 6)                       400\n        wWidth( 7)                        768\n        wHeight( 7)                       480\n        wWidth( 8)                        800\n        wHeight( 8)                       456\n        wWidth( 9)                        800\n        wHeight( 9)                       504\n        wWidth(10)                        800\n        wHeight(10)                       600\n        wWidth(11)                        864\n        wHeight(11)                       480\n        wWidth(12)                        960\n        wHeight(12)                       720\n        wWidth(13)                       1280\n        wHeight(13)                       720\n        wWidth(14)                       1280\n        wHeight(14)                       800\n        wWidth(15)                       1600\n        wHeight(15)                       904\n        wWidth(16)                       1600\n        wHeight(16)                      1000\n        wWidth(17)                       1600\n        wHeight(17)                      1200\n        bNumCompressionPatterns            18\n        bCompression( 0)                    5\n        bCompression( 1)                   10\n        bCompression( 2)                   15\n        bCompression( 3)                   20\n        bCompression( 4)                   25\n      VideoStreaming Interface Descriptor:\n        bLength                             6\n        bDescriptorType                    36\n        bDescriptorSubtype                 13 (COLORFORMAT)\n        bColorPrimaries                     1 (BT.709,sRGB)\n        bTransferCharacteristics            1 (BT.709)\n        bMatrixCoefficients                 4 (SMPTE 170M (BT.601))\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       1\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x81  EP 1 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x00c0  1x 192 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       2\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x81  EP 1 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x0180  1x 384 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       3\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x81  EP 1 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x0200  1x 512 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       4\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x81  EP 1 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x0280  1x 640 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       5\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x81  EP 1 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x0320  1x 800 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       6\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x81  EP 1 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x03b0  1x 944 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       7\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x81  EP 1 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x0a80  2x 640 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       8\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x81  EP 1 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x0b20  2x 800 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting       9\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x81  EP 1 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x0be0  2x 992 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting      10\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x81  EP 1 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x1380  3x 896 bytes\n        bInterval               1\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        1\n      bAlternateSetting      11\n      bNumEndpoints           1\n      bInterfaceClass        14 Video\n      bInterfaceSubClass      2 Video Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      Endpoint Descriptor:\n        bLength                 7\n        bDescriptorType         5\n        bEndpointAddress     0x81  EP 1 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x13fc  3x 1020 bytes\n        bInterval               1\n    Interface Association:\n      bLength                 8\n      bDescriptorType        11\n      bFirstInterface         2\n      bInterfaceCount         2\n      bFunctionClass          1 Audio\n      bFunctionSubClass       2 Streaming\n      bFunctionProtocol       0 \n      iFunction               0 \n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        2\n      bAlternateSetting       0\n      bNumEndpoints           0\n      bInterfaceClass         1 Audio\n      bInterfaceSubClass      1 Control Device\n      bInterfaceProtocol      0 \n      iInterface              0 \n      AudioControl Interface Descriptor:\n        bLength                 9\n        bDescriptorType        36\n        bDescriptorSubtype      1 (HEADER)\n        bcdADC               1.00\n        wTotalLength           38\n        bInCollection           1\n        baInterfaceNr( 0)       3\n      AudioControl Interface Descriptor:\n        bLength                12\n        bDescriptorType        36\n        bDescriptorSubtype      2 (INPUT_TERMINAL)\n        bTerminalID             1\n        wTerminalType      0x0201 Microphone\n        bAssocTerminal          0\n        bNrChannels             1\n        wChannelConfig     0x0000\n        iChannelNames           0 \n        iTerminal               0 \n      AudioControl Interface Descriptor:\n        bLength                 9\n        bDescriptorType        36\n        bDescriptorSubtype      3 (OUTPUT_TERMINAL)\n        bTerminalID             3\n        wTerminalType      0x0101 USB Streaming\n        bAssocTerminal          1\n        bSourceID               5\n        iTerminal               0 \n      AudioControl Interface Descriptor:\n        bLength                 9\n        bDescriptorType        36\n        bDescriptorSubtype      6 (FEATURE_UNIT)\n        bUnitID                 5\n        bSourceID               1\n        bControlSize            1\n        bmaControls( 0)      0x03\n          Mute\n          Volume\n        bmaControls( 1)      0x00\n        iFeature                0 \n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        3\n      bAlternateSetting       0\n      bNumEndpoints           0\n      bInterfaceClass         1 Audio\n      bInterfaceSubClass      2 Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        3\n      bAlternateSetting       1\n      bNumEndpoints           1\n      bInterfaceClass         1 Audio\n      bInterfaceSubClass      2 Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      AudioStreaming Interface Descriptor:\n        bLength                 7\n        bDescriptorType        36\n        bDescriptorSubtype      1 (AS_GENERAL)\n        bTerminalLink           3\n        bDelay                  1 frames\n        wFormatTag              1 PCM\n      AudioStreaming Interface Descriptor:\n        bLength                11\n        bDescriptorType        36\n        bDescriptorSubtype      2 (FORMAT_TYPE)\n        bFormatType             1 (FORMAT_TYPE_I)\n        bNrChannels             1\n        bSubframeSize           2\n        bBitResolution         16\n        bSamFreqType            1 Discrete\n        tSamFreq[ 0]        16000\n      Endpoint Descriptor:\n        bLength                 9\n        bDescriptorType         5\n        bEndpointAddress     0x86  EP 6 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x0044  1x 68 bytes\n        bInterval               4\n        bRefresh                0\n        bSynchAddress           0\n        AudioControl Endpoint Descriptor:\n          bLength                 7\n          bDescriptorType        37\n          bDescriptorSubtype      1 (EP_GENERAL)\n          bmAttributes         0x01\n            Sampling Frequency\n          bLockDelayUnits         0 Undefined\n          wLockDelay              0 Undefined\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        3\n      bAlternateSetting       2\n      bNumEndpoints           1\n      bInterfaceClass         1 Audio\n      bInterfaceSubClass      2 Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      AudioStreaming Interface Descriptor:\n        bLength                 7\n        bDescriptorType        36\n        bDescriptorSubtype      1 (AS_GENERAL)\n        bTerminalLink           3\n        bDelay                  1 frames\n        wFormatTag              1 PCM\n      AudioStreaming Interface Descriptor:\n        bLength                11\n        bDescriptorType        36\n        bDescriptorSubtype      2 (FORMAT_TYPE)\n        bFormatType             1 (FORMAT_TYPE_I)\n        bNrChannels             1\n        bSubframeSize           2\n        bBitResolution         16\n        bSamFreqType            1 Discrete\n        tSamFreq[ 0]        24000\n      Endpoint Descriptor:\n        bLength                 9\n        bDescriptorType         5\n        bEndpointAddress     0x86  EP 6 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x0064  1x 100 bytes\n        bInterval               4\n        bRefresh                0\n        bSynchAddress           0\n        AudioControl Endpoint Descriptor:\n          bLength                 7\n          bDescriptorType        37\n          bDescriptorSubtype      1 (EP_GENERAL)\n          bmAttributes         0x01\n            Sampling Frequency\n          bLockDelayUnits         0 Undefined\n          wLockDelay              0 Undefined\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        3\n      bAlternateSetting       3\n      bNumEndpoints           1\n      bInterfaceClass         1 Audio\n      bInterfaceSubClass      2 Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      AudioStreaming Interface Descriptor:\n        bLength                 7\n        bDescriptorType        36\n        bDescriptorSubtype      1 (AS_GENERAL)\n        bTerminalLink           3\n        bDelay                  1 frames\n        wFormatTag              1 PCM\n      AudioStreaming Interface Descriptor:\n        bLength                11\n        bDescriptorType        36\n        bDescriptorSubtype      2 (FORMAT_TYPE)\n        bFormatType             1 (FORMAT_TYPE_I)\n        bNrChannels             1\n        bSubframeSize           2\n        bBitResolution         16\n        bSamFreqType            1 Discrete\n        tSamFreq[ 0]        32000\n      Endpoint Descriptor:\n        bLength                 9\n        bDescriptorType         5\n        bEndpointAddress     0x86  EP 6 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x0084  1x 132 bytes\n        bInterval               4\n        bRefresh                0\n        bSynchAddress           0\n        AudioControl Endpoint Descriptor:\n          bLength                 7\n          bDescriptorType        37\n          bDescriptorSubtype      1 (EP_GENERAL)\n          bmAttributes         0x01\n            Sampling Frequency\n          bLockDelayUnits         0 Undefined\n          wLockDelay              0 Undefined\n    Interface Descriptor:\n      bLength                 9\n      bDescriptorType         4\n      bInterfaceNumber        3\n      bAlternateSetting       4\n      bNumEndpoints           1\n      bInterfaceClass         1 Audio\n      bInterfaceSubClass      2 Streaming\n      bInterfaceProtocol      0 \n      iInterface              0 \n      AudioStreaming Interface Descriptor:\n        bLength                 7\n        bDescriptorType        36\n        bDescriptorSubtype      1 (AS_GENERAL)\n        bTerminalLink           3\n        bDelay                  1 frames\n        wFormatTag              1 PCM\n      AudioStreaming Interface Descriptor:\n        bLength                11\n        bDescriptorType        36\n        bDescriptorSubtype      2 (FORMAT_TYPE)\n        bFormatType             1 (FORMAT_TYPE_I)\n        bNrChannels             1\n        bSubframeSize           2\n        bBitResolution         16\n        bSamFreqType            1 Discrete\n        tSamFreq[ 0]        48000\n      Endpoint Descriptor:\n        bLength                 9\n        bDescriptorType         5\n        bEndpointAddress     0x86  EP 6 IN\n        bmAttributes            5\n          Transfer Type            Isochronous\n          Synch Type               Asynchronous\n          Usage Type               Data\n        wMaxPacketSize     0x00c4  1x 196 bytes\n        bInterval               4\n        bRefresh                0\n        bSynchAddress           0\n        AudioControl Endpoint Descriptor:\n          bLength                 7\n          bDescriptorType        37\n          bDescriptorSubtype      1 (EP_GENERAL)\n          bmAttributes         0x01\n            Sampling Frequency\n          bLockDelayUnits         0 Undefined\n          wLockDelay              0 Undefined\nDevice Qualifier (for other device speed):\n  bLength                10\n  bDescriptorType         6\n  bcdUSB               2.00\n  bDeviceClass          239 Miscellaneous Device\n  bDeviceSubClass         2 ?\n  bDeviceProtocol         1 Interface Association\n  bMaxPacketSize0        64\n  bNumConfigurations      1\nDevice Status:     0x0000\n  (Bus Powered)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/cameras/quickcampro9000_builtin_ctrls.txt",
    "content": "Listing available controls for device video0:\n  Exposure, Auto Priority\n  Exposure (Absolute)\n  Exposure, Auto\n  Backlight Compensation\n  Sharpness\n  White Balance Temperature\n  Power Line Frequency\n  Gain\n  White Balance Temperature, Auto\n  Saturation\n  Contrast\n  Brightness\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/cameras/quickcampro9000_extra_ctrls.txt",
    "content": "Listing available controls for device video0:\n  Raw bits per pixel\n  Disable video processing\n  LED1 Frequency\n  LED1 Mode\n  Focus\n  Exposure, Auto Priority\n  Exposure (Absolute)\n  Exposure, Auto\n  Backlight Compensation\n  Sharpness\n  White Balance Temperature\n  Power Line Frequency\n  Gain\n  White Balance Temperature, Auto\n  Saturation\n  Contrast\n  Brightness\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/changelog.txt",
    "content": "Changes since 0.0.3:\n\n- Support devices with multiple streaming interfaces\n- Support for MJPEG streams\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/doxygen.conf",
    "content": "# Doxyfile 1.8.5\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) for a project.\n#\n# All text after a double hash (##) is considered a comment and is placed in\n# front of the TAG it is preceding.\n#\n# All text after a single hash (#) is considered a comment and will be ignored.\n# The format is:\n# TAG = value [value, ...]\n# For lists, items can also be appended using:\n# TAG += value [value, ...]\n# Values that contain spaces should be placed between quotes (\\\" \\\").\n\n#---------------------------------------------------------------------------\n# Project related configuration options\n#---------------------------------------------------------------------------\n\n# This tag specifies the encoding used for all characters in the config file\n# that follow. The default is UTF-8 which is also the encoding used for all text\n# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv\n# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv\n# for the list of possible encodings.\n# The default value is: UTF-8.\n\nDOXYFILE_ENCODING      = UTF-8\n\n# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by\n# double-quotes, unless you are using Doxywizard) that should identify the\n# project for which the documentation is generated. This name is used in the\n# title of most generated pages and in a few other places.\n# The default value is: My Project.\n\nPROJECT_NAME           = libuvc\n\n# The PROJECT_NUMBER tag can be used to enter a project or revision number. This\n# could be handy for archiving the generated documentation or if some version\n# control system is used.\n\nPROJECT_NUMBER         =\n\n# Using the PROJECT_BRIEF tag one can provide an optional one line description\n# for a project that appears at the top of each page and should give viewer a\n# quick idea about the purpose of the project. Keep the description short.\n\nPROJECT_BRIEF          =\n\n# With the PROJECT_LOGO tag one can specify an logo or icon that is included in\n# the documentation. The maximum height of the logo should not exceed 55 pixels\n# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo\n# to the output directory.\n\nPROJECT_LOGO           =\n\n# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path\n# into which the generated documentation will be written. If a relative path is\n# entered, it will be relative to the location where doxygen was started. If\n# left blank the current directory will be used.\n\nOUTPUT_DIRECTORY       =\n\n# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-\n# directories (in 2 levels) under the output directory of each output format and\n# will distribute the generated files over these directories. Enabling this\n# option can be useful when feeding doxygen a huge amount of source files, where\n# putting all generated files in the same directory would otherwise causes\n# performance problems for the file system.\n# The default value is: NO.\n\nCREATE_SUBDIRS         = NO\n\n# The OUTPUT_LANGUAGE tag is used to specify the language in which all\n# documentation generated by doxygen is written. Doxygen will use this\n# information to generate all constant output in the proper language.\n# Possible values are: Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-\n# Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Farsi,\n# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en,\n# Korean, Korean-en, Latvian, Norwegian, Macedonian, Persian, Polish,\n# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish,\n# Turkish, Ukrainian and Vietnamese.\n# The default value is: English.\n\nOUTPUT_LANGUAGE        = English\n\n# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member\n# descriptions after the members that are listed in the file and class\n# documentation (similar to Javadoc). Set to NO to disable this.\n# The default value is: YES.\n\nBRIEF_MEMBER_DESC      = YES\n\n# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief\n# description of a member or function before the detailed description\n#\n# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the\n# brief descriptions will be completely suppressed.\n# The default value is: YES.\n\nREPEAT_BRIEF           = YES\n\n# This tag implements a quasi-intelligent brief description abbreviator that is\n# used to form the text in various listings. Each string in this list, if found\n# as the leading text of the brief description, will be stripped from the text\n# and the result, after processing the whole list, is used as the annotated\n# text. Otherwise, the brief description is used as-is. If left blank, the\n# following values are used ($name is automatically replaced with the name of\n# the entity):The $name class, The $name widget, The $name file, is, provides,\n# specifies, contains, represents, a, an and the.\n\nABBREVIATE_BRIEF       =\n\n# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then\n# doxygen will generate a detailed section even if there is only a brief\n# description.\n# The default value is: NO.\n\nALWAYS_DETAILED_SEC    = NO\n\n# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all\n# inherited members of a class in the documentation of that class as if those\n# members were ordinary class members. Constructors, destructors and assignment\n# operators of the base classes will not be shown.\n# The default value is: NO.\n\nINLINE_INHERITED_MEMB  = NO\n\n# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path\n# before files name in the file list and in the header files. If set to NO the\n# shortest path that makes the file name unique will be used\n# The default value is: YES.\n\nFULL_PATH_NAMES        = NO\n\n# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.\n# Stripping is only done if one of the specified strings matches the left-hand\n# part of the path. The tag can be used to show relative paths in the file list.\n# If left blank the directory from which doxygen is run is used as the path to\n# strip.\n#\n# Note that you can specify absolute paths here, but also relative paths, which\n# will be relative from the directory where doxygen is started.\n# This tag requires that the tag FULL_PATH_NAMES is set to YES.\n\nSTRIP_FROM_PATH        =\n\n# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the\n# path mentioned in the documentation of a class, which tells the reader which\n# header file to include in order to use a class. If left blank only the name of\n# the header file containing the class definition is used. Otherwise one should\n# specify the list of include paths that are normally passed to the compiler\n# using the -I flag.\n\nSTRIP_FROM_INC_PATH    =\n\n# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but\n# less readable) file names. This can be useful is your file systems doesn't\n# support long names like on DOS, Mac, or CD-ROM.\n# The default value is: NO.\n\nSHORT_NAMES            = NO\n\n# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the\n# first line (until the first dot) of a Javadoc-style comment as the brief\n# description. If set to NO, the Javadoc-style will behave just like regular Qt-\n# style comments (thus requiring an explicit @brief command for a brief\n# description.)\n# The default value is: NO.\n\nJAVADOC_AUTOBRIEF      = YES\n\n# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first\n# line (until the first dot) of a Qt-style comment as the brief description. If\n# set to NO, the Qt-style will behave just like regular Qt-style comments (thus\n# requiring an explicit \\brief command for a brief description.)\n# The default value is: NO.\n\nQT_AUTOBRIEF           = NO\n\n# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a\n# multi-line C++ special comment block (i.e. a block of //! or /// comments) as\n# a brief description. This used to be the default behavior. The new default is\n# to treat a multi-line C++ comment block as a detailed description. Set this\n# tag to YES if you prefer the old behavior instead.\n#\n# Note that setting this tag to YES also means that rational rose comments are\n# not recognized any more.\n# The default value is: NO.\n\nMULTILINE_CPP_IS_BRIEF = NO\n\n# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the\n# documentation from any documented member that it re-implements.\n# The default value is: YES.\n\nINHERIT_DOCS           = YES\n\n# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a\n# new page for each member. If set to NO, the documentation of a member will be\n# part of the file/class/namespace that contains it.\n# The default value is: NO.\n\nSEPARATE_MEMBER_PAGES  = NO\n\n# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen\n# uses this value to replace tabs by spaces in code fragments.\n# Minimum value: 1, maximum value: 16, default value: 4.\n\nTAB_SIZE               = 4\n\n# This tag can be used to specify a number of aliases that act as commands in\n# the documentation. An alias has the form:\n# name=value\n# For example adding\n# \"sideeffect=@par Side Effects:\\n\"\n# will allow you to put the command \\sideeffect (or @sideeffect) in the\n# documentation, which will result in a user-defined paragraph with heading\n# \"Side Effects:\". You can put \\n's in the value part of an alias to insert\n# newlines.\n\nALIASES                =\n\n# This tag can be used to specify a number of word-keyword mappings (TCL only).\n# A mapping has the form \"name=value\". For example adding \"class=itcl::class\"\n# will allow you to use the command class in the itcl::class meaning.\n\nTCL_SUBST              =\n\n# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources\n# only. Doxygen will then generate output that is more tailored for C. For\n# instance, some of the names that are used will be different. The list of all\n# members will be omitted, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_FOR_C  = YES\n\n# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or\n# Python sources only. Doxygen will then generate output that is more tailored\n# for that language. For instance, namespaces will be presented as packages,\n# qualified scopes will look different, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_JAVA   = NO\n\n# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran\n# sources. Doxygen will then generate output that is tailored for Fortran.\n# The default value is: NO.\n\nOPTIMIZE_FOR_FORTRAN   = NO\n\n# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL\n# sources. Doxygen will then generate output that is tailored for VHDL.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_VHDL   = NO\n\n# Doxygen selects the parser to use depending on the extension of the files it\n# parses. With this tag you can assign which parser to use for a given\n# extension. Doxygen has a built-in mapping, but you can override or extend it\n# using this tag. The format is ext=language, where ext is a file extension, and\n# language is one of the parsers supported by doxygen: IDL, Java, Javascript,\n# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make\n# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C\n# (default is Fortran), use: inc=Fortran f=C.\n#\n# Note For files without extension you can use no_extension as a placeholder.\n#\n# Note that for custom extensions you also need to set FILE_PATTERNS otherwise\n# the files are not read by doxygen.\n\nEXTENSION_MAPPING      =\n\n# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments\n# according to the Markdown format, which allows for more readable\n# documentation. See http://daringfireball.net/projects/markdown/ for details.\n# The output of markdown processing is further processed by doxygen, so you can\n# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in\n# case of backward compatibilities issues.\n# The default value is: YES.\n\nMARKDOWN_SUPPORT       = YES\n\n# When enabled doxygen tries to link words that correspond to documented\n# classes, or namespaces to their corresponding documentation. Such a link can\n# be prevented in individual cases by by putting a % sign in front of the word\n# or globally by setting AUTOLINK_SUPPORT to NO.\n# The default value is: YES.\n\nAUTOLINK_SUPPORT       = YES\n\n# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want\n# to include (a tag file for) the STL sources as input, then you should set this\n# tag to YES in order to let doxygen match functions declarations and\n# definitions whose arguments contain STL classes (e.g. func(std::string);\n# versus func(std::string) {}). This also make the inheritance and collaboration\n# diagrams that involve STL classes more complete and accurate.\n# The default value is: NO.\n\nBUILTIN_STL_SUPPORT    = NO\n\n# If you use Microsoft's C++/CLI language, you should set this option to YES to\n# enable parsing support.\n# The default value is: NO.\n\nCPP_CLI_SUPPORT        = NO\n\n# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:\n# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen\n# will parse them like normal C++ but will assume all classes use public instead\n# of private inheritance when no explicit protection keyword is present.\n# The default value is: NO.\n\nSIP_SUPPORT            = NO\n\n# For Microsoft's IDL there are propget and propput attributes to indicate\n# getter and setter methods for a property. Setting this option to YES will make\n# doxygen to replace the get and set methods by a property in the documentation.\n# This will only work if the methods are indeed getting or setting a simple\n# type. If this is not the case, or you want to show the methods anyway, you\n# should set this option to NO.\n# The default value is: YES.\n\nIDL_PROPERTY_SUPPORT   = YES\n\n# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC\n# tag is set to YES, then doxygen will reuse the documentation of the first\n# member in the group (if any) for the other members of the group. By default\n# all members of a group must be documented explicitly.\n# The default value is: NO.\n\nDISTRIBUTE_GROUP_DOC   = NO\n\n# Set the SUBGROUPING tag to YES to allow class member groups of the same type\n# (for instance a group of public functions) to be put as a subgroup of that\n# type (e.g. under the Public Functions section). Set it to NO to prevent\n# subgrouping. Alternatively, this can be done per class using the\n# \\nosubgrouping command.\n# The default value is: YES.\n\nSUBGROUPING            = YES\n\n# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions\n# are shown inside the group in which they are included (e.g. using \\ingroup)\n# instead of on a separate page (for HTML and Man pages) or section (for LaTeX\n# and RTF).\n#\n# Note that this feature does not work in combination with\n# SEPARATE_MEMBER_PAGES.\n# The default value is: NO.\n\nINLINE_GROUPED_CLASSES = NO\n\n# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions\n# with only public data fields or simple typedef fields will be shown inline in\n# the documentation of the scope in which they are defined (i.e. file,\n# namespace, or group documentation), provided this scope is documented. If set\n# to NO, structs, classes, and unions are shown on a separate page (for HTML and\n# Man pages) or section (for LaTeX and RTF).\n# The default value is: NO.\n\nINLINE_SIMPLE_STRUCTS  = NO\n\n# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or\n# enum is documented as struct, union, or enum with the name of the typedef. So\n# typedef struct TypeS {} TypeT, will appear in the documentation as a struct\n# with name TypeT. When disabled the typedef will appear as a member of a file,\n# namespace, or class. And the struct will be named TypeS. This can typically be\n# useful for C code in case the coding convention dictates that all compound\n# types are typedef'ed and only the typedef is referenced, never the tag name.\n# The default value is: NO.\n\nTYPEDEF_HIDES_STRUCT   = NO\n\n# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This\n# cache is used to resolve symbols given their name and scope. Since this can be\n# an expensive process and often the same symbol appears multiple times in the\n# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small\n# doxygen will become slower. If the cache is too large, memory is wasted. The\n# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range\n# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536\n# symbols. At the end of a run doxygen will report the cache usage and suggest\n# the optimal cache size from a speed point of view.\n# Minimum value: 0, maximum value: 9, default value: 0.\n\nLOOKUP_CACHE_SIZE      = 0\n\n#---------------------------------------------------------------------------\n# Build related configuration options\n#---------------------------------------------------------------------------\n\n# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in\n# documentation are documented, even if no documentation was available. Private\n# class members and static file members will be hidden unless the\n# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.\n# Note: This will also disable the warnings about undocumented members that are\n# normally produced when WARNINGS is set to YES.\n# The default value is: NO.\n\nEXTRACT_ALL            = NO\n\n# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will\n# be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PRIVATE        = YES\n\n# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal\n# scope will be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PACKAGE        = NO\n\n# If the EXTRACT_STATIC tag is set to YES all static members of a file will be\n# included in the documentation.\n# The default value is: NO.\n\nEXTRACT_STATIC         = YES\n\n# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined\n# locally in source files will be included in the documentation. If set to NO\n# only classes defined in header files are included. Does not have any effect\n# for Java sources.\n# The default value is: YES.\n\nEXTRACT_LOCAL_CLASSES  = YES\n\n# This flag is only useful for Objective-C code. When set to YES local methods,\n# which are defined in the implementation section but not in the interface are\n# included in the documentation. If set to NO only methods in the interface are\n# included.\n# The default value is: NO.\n\nEXTRACT_LOCAL_METHODS  = NO\n\n# If this flag is set to YES, the members of anonymous namespaces will be\n# extracted and appear in the documentation as a namespace called\n# 'anonymous_namespace{file}', where file will be replaced with the base name of\n# the file that contains the anonymous namespace. By default anonymous namespace\n# are hidden.\n# The default value is: NO.\n\nEXTRACT_ANON_NSPACES   = NO\n\n# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all\n# undocumented members inside documented classes or files. If set to NO these\n# members will be included in the various overviews, but no documentation\n# section is generated. This option has no effect if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_MEMBERS     = YES\n\n# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all\n# undocumented classes that are normally visible in the class hierarchy. If set\n# to NO these classes will be included in the various overviews. This option has\n# no effect if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_CLASSES     = YES\n\n# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend\n# (class|struct|union) declarations. If set to NO these declarations will be\n# included in the documentation.\n# The default value is: NO.\n\nHIDE_FRIEND_COMPOUNDS  = NO\n\n# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any\n# documentation blocks found inside the body of a function. If set to NO these\n# blocks will be appended to the function's detailed documentation block.\n# The default value is: NO.\n\nHIDE_IN_BODY_DOCS      = YES\n\n# The INTERNAL_DOCS tag determines if documentation that is typed after a\n# \\internal command is included. If the tag is set to NO then the documentation\n# will be excluded. Set it to YES to include the internal documentation.\n# The default value is: NO.\n\nINTERNAL_DOCS          = NO\n\n# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file\n# names in lower-case letters. If set to YES upper-case letters are also\n# allowed. This is useful if you have classes or files whose names only differ\n# in case and if your file system supports case sensitive file names. Windows\n# and Mac users are advised to set this option to NO.\n# The default value is: system dependent.\n\nCASE_SENSE_NAMES       = YES\n\n# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with\n# their full class and namespace scopes in the documentation. If set to YES the\n# scope will be hidden.\n# The default value is: NO.\n\nHIDE_SCOPE_NAMES       = NO\n\n# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of\n# the files that are included by a file in the documentation of that file.\n# The default value is: YES.\n\nSHOW_INCLUDE_FILES     = YES\n\n# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include\n# files with double quotes in the documentation rather than with sharp brackets.\n# The default value is: NO.\n\nFORCE_LOCAL_INCLUDES   = NO\n\n# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the\n# documentation for inline members.\n# The default value is: YES.\n\nINLINE_INFO            = YES\n\n# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the\n# (detailed) documentation of file and class members alphabetically by member\n# name. If set to NO the members will appear in declaration order.\n# The default value is: YES.\n\nSORT_MEMBER_DOCS       = NO\n\n# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief\n# descriptions of file, namespace and class members alphabetically by member\n# name. If set to NO the members will appear in declaration order.\n# The default value is: NO.\n\nSORT_BRIEF_DOCS        = NO\n\n# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the\n# (brief and detailed) documentation of class members so that constructors and\n# destructors are listed first. If set to NO the constructors will appear in the\n# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.\n# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief\n# member documentation.\n# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting\n# detailed member documentation.\n# The default value is: NO.\n\nSORT_MEMBERS_CTORS_1ST = NO\n\n# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy\n# of group names into alphabetical order. If set to NO the group names will\n# appear in their defined order.\n# The default value is: NO.\n\nSORT_GROUP_NAMES       = NO\n\n# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by\n# fully-qualified names, including namespaces. If set to NO, the class list will\n# be sorted only by class name, not including the namespace part.\n# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.\n# Note: This option applies only to the class list, not to the alphabetical\n# list.\n# The default value is: NO.\n\nSORT_BY_SCOPE_NAME     = NO\n\n# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper\n# type resolution of all parameters of a function it will reject a match between\n# the prototype and the implementation of a member function even if there is\n# only one candidate or it is obvious which candidate to choose by doing a\n# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still\n# accept a match between prototype and implementation in such cases.\n# The default value is: NO.\n\nSTRICT_PROTO_MATCHING  = NO\n\n# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the\n# todo list. This list is created by putting \\todo commands in the\n# documentation.\n# The default value is: YES.\n\nGENERATE_TODOLIST      = NO\n\n# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the\n# test list. This list is created by putting \\test commands in the\n# documentation.\n# The default value is: YES.\n\nGENERATE_TESTLIST      = YES\n\n# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug\n# list. This list is created by putting \\bug commands in the documentation.\n# The default value is: YES.\n\nGENERATE_BUGLIST       = YES\n\n# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)\n# the deprecated list. This list is created by putting \\deprecated commands in\n# the documentation.\n# The default value is: YES.\n\nGENERATE_DEPRECATEDLIST= YES\n\n# The ENABLED_SECTIONS tag can be used to enable conditional documentation\n# sections, marked by \\if <section_label> ... \\endif and \\cond <section_label>\n# ... \\endcond blocks.\n\nENABLED_SECTIONS       =\n\n# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the\n# initial value of a variable or macro / define can have for it to appear in the\n# documentation. If the initializer consists of more lines than specified here\n# it will be hidden. Use a value of 0 to hide initializers completely. The\n# appearance of the value of individual variables and macros / defines can be\n# controlled using \\showinitializer or \\hideinitializer command in the\n# documentation regardless of this setting.\n# Minimum value: 0, maximum value: 10000, default value: 30.\n\nMAX_INITIALIZER_LINES  = 30\n\n# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at\n# the bottom of the documentation of classes and structs. If set to YES the list\n# will mention the files that were used to generate the documentation.\n# The default value is: YES.\n\nSHOW_USED_FILES        = YES\n\n# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This\n# will remove the Files entry from the Quick Index and from the Folder Tree View\n# (if specified).\n# The default value is: YES.\n\nSHOW_FILES             = YES\n\n# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces\n# page. This will remove the Namespaces entry from the Quick Index and from the\n# Folder Tree View (if specified).\n# The default value is: YES.\n\nSHOW_NAMESPACES        = YES\n\n# The FILE_VERSION_FILTER tag can be used to specify a program or script that\n# doxygen should invoke to get the current version for each file (typically from\n# the version control system). Doxygen will invoke the program by executing (via\n# popen()) the command command input-file, where command is the value of the\n# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided\n# by doxygen. Whatever the program writes to standard output is used as the file\n# version. For an example see the documentation.\n\nFILE_VERSION_FILTER    =\n\n# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed\n# by doxygen. The layout file controls the global structure of the generated\n# output files in an output format independent way. To create the layout file\n# that represents doxygen's defaults, run doxygen with the -l option. You can\n# optionally specify a file name after the option, if omitted DoxygenLayout.xml\n# will be used as the name of the layout file.\n#\n# Note that if you run doxygen from a directory containing a file called\n# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE\n# tag is left empty.\n\nLAYOUT_FILE            =\n\n# The CITE_BIB_FILES tag can be used to specify one or more bib files containing\n# the reference definitions. This must be a list of .bib files. The .bib\n# extension is automatically appended if omitted. This requires the bibtex tool\n# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.\n# For LaTeX the style of the bibliography can be controlled using\n# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the\n# search path. Do not use file names with spaces, bibtex cannot handle them. See\n# also \\cite for info how to create references.\n\nCITE_BIB_FILES         =\n\n#---------------------------------------------------------------------------\n# Configuration options related to warning and progress messages\n#---------------------------------------------------------------------------\n\n# The QUIET tag can be used to turn on/off the messages that are generated to\n# standard output by doxygen. If QUIET is set to YES this implies that the\n# messages are off.\n# The default value is: NO.\n\nQUIET                  = NO\n\n# The WARNINGS tag can be used to turn on/off the warning messages that are\n# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES\n# this implies that the warnings are on.\n#\n# Tip: Turn warnings on while writing the documentation.\n# The default value is: YES.\n\nWARNINGS               = YES\n\n# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate\n# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag\n# will automatically be disabled.\n# The default value is: YES.\n\nWARN_IF_UNDOCUMENTED   = YES\n\n# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for\n# potential errors in the documentation, such as not documenting some parameters\n# in a documented function, or documenting parameters that don't exist or using\n# markup commands wrongly.\n# The default value is: YES.\n\nWARN_IF_DOC_ERROR      = YES\n\n# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that\n# are documented, but have no documentation for their parameters or return\n# value. If set to NO doxygen will only warn about wrong or incomplete parameter\n# documentation, but not about the absence of documentation.\n# The default value is: NO.\n\nWARN_NO_PARAMDOC       = NO\n\n# The WARN_FORMAT tag determines the format of the warning messages that doxygen\n# can produce. The string should contain the $file, $line, and $text tags, which\n# will be replaced by the file and line number from which the warning originated\n# and the warning text. Optionally the format may contain $version, which will\n# be replaced by the version of the file (if it could be obtained via\n# FILE_VERSION_FILTER)\n# The default value is: $file:$line: $text.\n\nWARN_FORMAT            = \"$file:$line: $text\"\n\n# The WARN_LOGFILE tag can be used to specify a file to which warning and error\n# messages should be written. If left blank the output is written to standard\n# error (stderr).\n\nWARN_LOGFILE           =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the input files\n#---------------------------------------------------------------------------\n\n# The INPUT tag is used to specify the files and/or directories that contain\n# documented source files. You may enter file names like myfile.cpp or\n# directories like /usr/src/myproject. Separate the files or directories with\n# spaces.\n# Note: If this tag is empty the current directory is searched.\n\nINPUT                  = src \\\n                         include/libuvc\n\n# This tag can be used to specify the character encoding of the source files\n# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses\n# libiconv (or the iconv built into libc) for the transcoding. See the libiconv\n# documentation (see: http://www.gnu.org/software/libiconv) for the list of\n# possible encodings.\n# The default value is: UTF-8.\n\nINPUT_ENCODING         = UTF-8\n\n# If the value of the INPUT tag contains directories, you can use the\n# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and\n# *.h) to filter out the source-files in the directories. If left blank the\n# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,\n# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,\n# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,\n# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,\n# *.qsf, *.as and *.js.\n\nFILE_PATTERNS          =\n\n# The RECURSIVE tag can be used to specify whether or not subdirectories should\n# be searched for input files as well.\n# The default value is: NO.\n\nRECURSIVE              = NO\n\n# The EXCLUDE tag can be used to specify files and/or directories that should be\n# excluded from the INPUT source files. This way you can easily exclude a\n# subdirectory from a directory tree whose root is specified with the INPUT tag.\n#\n# Note that relative paths are relative to the directory from which doxygen is\n# run.\n\nEXCLUDE                = include/libuvc/libuvc_internal.h \\\n                         include/utlist.h\n\n# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or\n# directories that are symbolic links (a Unix file system feature) are excluded\n# from the input.\n# The default value is: NO.\n\nEXCLUDE_SYMLINKS       = NO\n\n# If the value of the INPUT tag contains directories, you can use the\n# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude\n# certain files from those directories.\n#\n# Note that the wildcards are matched against the file with absolute path, so to\n# exclude all test directories for example use the pattern */test/*\n\nEXCLUDE_PATTERNS       =\n\n# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names\n# (namespaces, classes, functions, etc.) that should be excluded from the\n# output. The symbol name can be a fully qualified name, a word, or if the\n# wildcard * is used, a substring. Examples: ANamespace, AClass,\n# AClass::ANamespace, ANamespace::*Test\n#\n# Note that the wildcards are matched against the file with absolute path, so to\n# exclude all test directories use the pattern */test/*\n\nEXCLUDE_SYMBOLS        =\n\n# The EXAMPLE_PATH tag can be used to specify one or more files or directories\n# that contain example code fragments that are included (see the \\include\n# command).\n\nEXAMPLE_PATH           = src\n\n# If the value of the EXAMPLE_PATH tag contains directories, you can use the\n# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and\n# *.h) to filter out the source-files in the directories. If left blank all\n# files are included.\n\nEXAMPLE_PATTERNS       =\n\n# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be\n# searched for input files to be used with the \\include or \\dontinclude commands\n# irrespective of the value of the RECURSIVE tag.\n# The default value is: NO.\n\nEXAMPLE_RECURSIVE      = NO\n\n# The IMAGE_PATH tag can be used to specify one or more files or directories\n# that contain images that are to be included in the documentation (see the\n# \\image command).\n\nIMAGE_PATH             =\n\n# The INPUT_FILTER tag can be used to specify a program that doxygen should\n# invoke to filter for each input file. Doxygen will invoke the filter program\n# by executing (via popen()) the command:\n#\n# <filter> <input-file>\n#\n# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the\n# name of an input file. Doxygen will then use the output that the filter\n# program writes to standard output. If FILTER_PATTERNS is specified, this tag\n# will be ignored.\n#\n# Note that the filter must not add or remove lines; it is applied before the\n# code is scanned, but not when the output code is generated. If lines are added\n# or removed, the anchors will not be placed correctly.\n\nINPUT_FILTER           =\n\n# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern\n# basis. Doxygen will compare the file name with each pattern and apply the\n# filter if there is a match. The filters are a list of the form: pattern=filter\n# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how\n# filters are used. If the FILTER_PATTERNS tag is empty or if none of the\n# patterns match the file name, INPUT_FILTER is applied.\n\nFILTER_PATTERNS        =\n\n# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using\n# INPUT_FILTER ) will also be used to filter the input files that are used for\n# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).\n# The default value is: NO.\n\nFILTER_SOURCE_FILES    = NO\n\n# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file\n# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and\n# it is also possible to disable source filtering for a specific pattern using\n# *.ext= (so without naming a filter).\n# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.\n\nFILTER_SOURCE_PATTERNS =\n\n# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that\n# is part of the input, its contents will be placed on the main page\n# (index.html). This can be useful if you have a project on for instance GitHub\n# and want to reuse the introduction page also for the doxygen output.\n\nUSE_MDFILE_AS_MAINPAGE =\n\n#---------------------------------------------------------------------------\n# Configuration options related to source browsing\n#---------------------------------------------------------------------------\n\n# If the SOURCE_BROWSER tag is set to YES then a list of source files will be\n# generated. Documented entities will be cross-referenced with these sources.\n#\n# Note: To get rid of all source code in the generated output, make sure that\n# also VERBATIM_HEADERS is set to NO.\n# The default value is: NO.\n\nSOURCE_BROWSER         = NO\n\n# Setting the INLINE_SOURCES tag to YES will include the body of functions,\n# classes and enums directly into the documentation.\n# The default value is: NO.\n\nINLINE_SOURCES         = NO\n\n# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any\n# special comment blocks from generated source code fragments. Normal C, C++ and\n# Fortran comments will always remain visible.\n# The default value is: YES.\n\nSTRIP_CODE_COMMENTS    = YES\n\n# If the REFERENCED_BY_RELATION tag is set to YES then for each documented\n# function all documented functions referencing it will be listed.\n# The default value is: NO.\n\nREFERENCED_BY_RELATION = NO\n\n# If the REFERENCES_RELATION tag is set to YES then for each documented function\n# all documented entities called/used by that function will be listed.\n# The default value is: NO.\n\nREFERENCES_RELATION    = NO\n\n# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set\n# to YES, then the hyperlinks from functions in REFERENCES_RELATION and\n# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will\n# link to the documentation.\n# The default value is: YES.\n\nREFERENCES_LINK_SOURCE = YES\n\n# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the\n# source code will show a tooltip with additional information such as prototype,\n# brief description and links to the definition and documentation. Since this\n# will make the HTML file larger and loading of large files a bit slower, you\n# can opt to disable this feature.\n# The default value is: YES.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nSOURCE_TOOLTIPS        = YES\n\n# If the USE_HTAGS tag is set to YES then the references to source code will\n# point to the HTML generated by the htags(1) tool instead of doxygen built-in\n# source browser. The htags tool is part of GNU's global source tagging system\n# (see http://www.gnu.org/software/global/global.html). You will need version\n# 4.8.6 or higher.\n#\n# To use it do the following:\n# - Install the latest version of global\n# - Enable SOURCE_BROWSER and USE_HTAGS in the config file\n# - Make sure the INPUT points to the root of the source tree\n# - Run doxygen as normal\n#\n# Doxygen will invoke htags (and that will in turn invoke gtags), so these\n# tools must be available from the command line (i.e. in the search path).\n#\n# The result: instead of the source browser generated by doxygen, the links to\n# source code will now point to the output of htags.\n# The default value is: NO.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nUSE_HTAGS              = NO\n\n# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a\n# verbatim copy of the header file for each class for which an include is\n# specified. Set to NO to disable this.\n# See also: Section \\class.\n# The default value is: YES.\n\nVERBATIM_HEADERS       = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to the alphabetical class index\n#---------------------------------------------------------------------------\n\n# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all\n# compounds will be generated. Enable this if the project contains a lot of\n# classes, structs, unions or interfaces.\n# The default value is: YES.\n\nALPHABETICAL_INDEX     = YES\n\n# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in\n# which the alphabetical index list will be split.\n# Minimum value: 1, maximum value: 20, default value: 5.\n# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\n\nCOLS_IN_ALPHA_INDEX    = 5\n\n# In case all classes in a project start with a common prefix, all classes will\n# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag\n# can be used to specify a prefix (or a list of prefixes) that should be ignored\n# while generating the index headers.\n# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\n\nIGNORE_PREFIX          =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the HTML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output\n# The default value is: YES.\n\nGENERATE_HTML          = YES\n\n# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_OUTPUT            = doc\n\n# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each\n# generated HTML page (for example: .htm, .php, .asp).\n# The default value is: .html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FILE_EXTENSION    = .html\n\n# The HTML_HEADER tag can be used to specify a user-defined HTML header file for\n# each generated HTML page. If the tag is left blank doxygen will generate a\n# standard header.\n#\n# To get valid HTML the header file that includes any scripts and style sheets\n# that doxygen needs, which is dependent on the configuration options used (e.g.\n# the setting GENERATE_TREEVIEW). It is highly recommended to start with a\n# default header using\n# doxygen -w html new_header.html new_footer.html new_stylesheet.css\n# YourConfigFile\n# and then modify the file new_header.html. See also section \"Doxygen usage\"\n# for information on how to generate the default header that doxygen normally\n# uses.\n# Note: The header is subject to change so you typically have to regenerate the\n# default header when upgrading to a newer version of doxygen. For a description\n# of the possible markers and block names see the documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_HEADER            =\n\n# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each\n# generated HTML page. If the tag is left blank doxygen will generate a standard\n# footer. See HTML_HEADER for more information on how to generate a default\n# footer and what special commands can be used inside the footer. See also\n# section \"Doxygen usage\" for information on how to generate the default footer\n# that doxygen normally uses.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FOOTER            =\n\n# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style\n# sheet that is used by each HTML page. It can be used to fine-tune the look of\n# the HTML output. If left blank doxygen will generate a default style sheet.\n# See also section \"Doxygen usage\" for information on how to generate the style\n# sheet that doxygen normally uses.\n# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as\n# it is more robust and this tag (HTML_STYLESHEET) will in the future become\n# obsolete.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_STYLESHEET        =\n\n# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-\n# defined cascading style sheet that is included after the standard style sheets\n# created by doxygen. Using this option one can overrule certain style aspects.\n# This is preferred over using HTML_STYLESHEET since it does not replace the\n# standard style sheet and is therefor more robust against future updates.\n# Doxygen will copy the style sheet file to the output directory. For an example\n# see the documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_STYLESHEET  =\n\n# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the HTML output directory. Note\n# that these files will be copied to the base HTML output directory. Use the\n# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these\n# files. In the HTML_STYLESHEET file, use the file name only. Also note that the\n# files will be copied as-is; there are no commands or markers available.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_FILES       =\n\n# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen\n# will adjust the colors in the stylesheet and background images according to\n# this color. Hue is specified as an angle on a colorwheel, see\n# http://en.wikipedia.org/wiki/Hue for more information. For instance the value\n# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300\n# purple, and 360 is red again.\n# Minimum value: 0, maximum value: 359, default value: 220.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_HUE    = 220\n\n# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors\n# in the HTML output. For a value of 0 the output will use grayscales only. A\n# value of 255 will produce the most vivid colors.\n# Minimum value: 0, maximum value: 255, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_SAT    = 100\n\n# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the\n# luminance component of the colors in the HTML output. Values below 100\n# gradually make the output lighter, whereas values above 100 make the output\n# darker. The value divided by 100 is the actual gamma applied, so 80 represents\n# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not\n# change the gamma.\n# Minimum value: 40, maximum value: 240, default value: 80.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_GAMMA  = 80\n\n# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML\n# page will contain the date and time when the page was generated. Setting this\n# to NO can help when comparing the output of multiple runs.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_TIMESTAMP         = YES\n\n# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML\n# documentation will contain sections that can be hidden and shown after the\n# page has loaded.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_DYNAMIC_SECTIONS  = YES\n\n# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries\n# shown in the various tree structured indices initially; the user can expand\n# and collapse entries dynamically later on. Doxygen will expand the tree to\n# such a level that at most the specified number of entries are visible (unless\n# a fully collapsed tree already exceeds this amount). So setting the number of\n# entries 1 will produce a full collapsed tree by default. 0 is a special value\n# representing an infinite number of entries and will result in a full expanded\n# tree by default.\n# Minimum value: 0, maximum value: 9999, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_INDEX_NUM_ENTRIES = 100\n\n# If the GENERATE_DOCSET tag is set to YES, additional index files will be\n# generated that can be used as input for Apple's Xcode 3 integrated development\n# environment (see: http://developer.apple.com/tools/xcode/), introduced with\n# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a\n# Makefile in the HTML output directory. Running make will produce the docset in\n# that directory and running make install will install the docset in\n# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at\n# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html\n# for more information.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_DOCSET        = NO\n\n# This tag determines the name of the docset feed. A documentation feed provides\n# an umbrella under which multiple documentation sets from a single provider\n# (such as a company or product suite) can be grouped.\n# The default value is: Doxygen generated docs.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_FEEDNAME        = \"Doxygen generated docs\"\n\n# This tag specifies a string that should uniquely identify the documentation\n# set bundle. This should be a reverse domain-name style string, e.g.\n# com.mycompany.MyDocSet. Doxygen will append .docset to the name.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_BUNDLE_ID       = org.doxygen.Project\n\n# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify\n# the documentation publisher. This should be a reverse domain-name style\n# string, e.g. com.mycompany.MyDocSet.documentation.\n# The default value is: org.doxygen.Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_ID    = org.doxygen.Publisher\n\n# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.\n# The default value is: Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_NAME  = Publisher\n\n# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three\n# additional HTML index files: index.hhp, index.hhc, and index.hhk. The\n# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop\n# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on\n# Windows.\n#\n# The HTML Help Workshop contains a compiler that can convert all HTML output\n# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML\n# files are now used as the Windows 98 help format, and will replace the old\n# Windows help format (.hlp) on all Windows platforms in the future. Compressed\n# HTML files also contain an index, a table of contents, and you can search for\n# words in the documentation. The HTML workshop also contains a viewer for\n# compressed HTML files.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_HTMLHELP      = NO\n\n# The CHM_FILE tag can be used to specify the file name of the resulting .chm\n# file. You can add a path in front of the file if the result should not be\n# written to the html output directory.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_FILE               =\n\n# The HHC_LOCATION tag can be used to specify the location (absolute path\n# including file name) of the HTML help compiler ( hhc.exe). If non-empty\n# doxygen will try to run the HTML help compiler on the generated index.hhp.\n# The file has to be specified with full path.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nHHC_LOCATION           =\n\n# The GENERATE_CHI flag controls if a separate .chi index file is generated (\n# YES) or that it should be included in the master .chm file ( NO).\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nGENERATE_CHI           = NO\n\n# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)\n# and project file content.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_INDEX_ENCODING     =\n\n# The BINARY_TOC flag controls whether a binary table of contents is generated (\n# YES) or a normal table of contents ( NO) in the .chm file.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nBINARY_TOC             = NO\n\n# The TOC_EXPAND flag can be set to YES to add extra items for group members to\n# the table of contents of the HTML help documentation and to the tree view.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nTOC_EXPAND             = NO\n\n# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and\n# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that\n# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help\n# (.qch) of the generated HTML documentation.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_QHP           = NO\n\n# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify\n# the file name of the resulting .qch file. The path specified is relative to\n# the HTML output folder.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQCH_FILE               =\n\n# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help\n# Project output. For more information please see Qt Help Project / Namespace\n# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_NAMESPACE          = org.doxygen.Project\n\n# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt\n# Help Project output. For more information please see Qt Help Project / Virtual\n# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-\n# folders).\n# The default value is: doc.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_VIRTUAL_FOLDER     = doc\n\n# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom\n# filter to add. For more information please see Qt Help Project / Custom\n# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-\n# filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_NAME   =\n\n# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the\n# custom filter to add. For more information please see Qt Help Project / Custom\n# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-\n# filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_ATTRS  =\n\n# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this\n# project's filter section matches. Qt Help Project / Filter Attributes (see:\n# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_SECT_FILTER_ATTRS  =\n\n# The QHG_LOCATION tag can be used to specify the location of Qt's\n# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the\n# generated .qhp file.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHG_LOCATION           =\n\n# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be\n# generated, together with the HTML files, they form an Eclipse help plugin. To\n# install this plugin and make it available under the help contents menu in\n# Eclipse, the contents of the directory containing the HTML and XML files needs\n# to be copied into the plugins directory of eclipse. The name of the directory\n# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.\n# After copying Eclipse needs to be restarted before the help appears.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_ECLIPSEHELP   = NO\n\n# A unique identifier for the Eclipse help plugin. When installing the plugin\n# the directory name containing the HTML and XML files should also have this\n# name. Each documentation set should have its own identifier.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.\n\nECLIPSE_DOC_ID         = org.doxygen.Project\n\n# If you want full control over the layout of the generated HTML pages it might\n# be necessary to disable the index and replace it with your own. The\n# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top\n# of each HTML page. A value of NO enables the index and the value YES disables\n# it. Since the tabs in the index contain the same information as the navigation\n# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nDISABLE_INDEX          = NO\n\n# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index\n# structure should be generated to display hierarchical information. If the tag\n# value is set to YES, a side panel will be generated containing a tree-like\n# index structure (just like the one that is generated for HTML Help). For this\n# to work a browser that supports JavaScript, DHTML, CSS and frames is required\n# (i.e. any modern browser). Windows users are probably better off using the\n# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can\n# further fine-tune the look of the index. As an example, the default style\n# sheet generated by doxygen has an example that shows how to put an image at\n# the root of the tree instead of the PROJECT_NAME. Since the tree basically has\n# the same information as the tab index, you could consider setting\n# DISABLE_INDEX to YES when enabling this option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_TREEVIEW      = NO\n\n# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that\n# doxygen will group on one line in the generated HTML documentation.\n#\n# Note that a value of 0 will completely suppress the enum values from appearing\n# in the overview section.\n# Minimum value: 0, maximum value: 20, default value: 4.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nENUM_VALUES_PER_LINE   = 4\n\n# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used\n# to set the initial width (in pixels) of the frame in which the tree is shown.\n# Minimum value: 0, maximum value: 1500, default value: 250.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nTREEVIEW_WIDTH         = 250\n\n# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to\n# external symbols imported via tag files in a separate window.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nEXT_LINKS_IN_WINDOW    = NO\n\n# Use this tag to change the font size of LaTeX formulas included as images in\n# the HTML documentation. When you change the font size after a successful\n# doxygen run you need to manually remove any form_*.png images from the HTML\n# output directory to force them to be regenerated.\n# Minimum value: 8, maximum value: 50, default value: 10.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFORMULA_FONTSIZE       = 10\n\n# Use the FORMULA_TRANPARENT tag to determine whether or not the images\n# generated for formulas are transparent PNGs. Transparent PNGs are not\n# supported properly for IE 6.0, but are supported on all modern browsers.\n#\n# Note that when changing this option you need to delete any form_*.png files in\n# the HTML output directory before the changes have effect.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFORMULA_TRANSPARENT    = YES\n\n# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see\n# http://www.mathjax.org) which uses client side Javascript for the rendering\n# instead of using prerendered bitmaps. Use this if you do not have LaTeX\n# installed or if you want to formulas look prettier in the HTML output. When\n# enabled you may also need to install MathJax separately and configure the path\n# to it using the MATHJAX_RELPATH option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nUSE_MATHJAX            = NO\n\n# When MathJax is enabled you can set the default output format to be used for\n# the MathJax output. See the MathJax site (see:\n# http://docs.mathjax.org/en/latest/output.html) for more details.\n# Possible values are: HTML-CSS (which is slower, but has the best\n# compatibility), NativeMML (i.e. MathML) and SVG.\n# The default value is: HTML-CSS.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_FORMAT         = HTML-CSS\n\n# When MathJax is enabled you need to specify the location relative to the HTML\n# output directory using the MATHJAX_RELPATH option. The destination directory\n# should contain the MathJax.js script. For instance, if the mathjax directory\n# is located at the same level as the HTML output directory, then\n# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax\n# Content Delivery Network so you can quickly see the result without installing\n# MathJax. However, it is strongly recommended to install a local copy of\n# MathJax from http://www.mathjax.org before deployment.\n# The default value is: http://cdn.mathjax.org/mathjax/latest.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest\n\n# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax\n# extension names that should be enabled during MathJax rendering. For example\n# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_EXTENSIONS     =\n\n# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces\n# of code that will be used on startup of the MathJax code. See the MathJax site\n# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an\n# example see the documentation.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_CODEFILE       =\n\n# When the SEARCHENGINE tag is enabled doxygen will generate a search box for\n# the HTML output. The underlying search engine uses javascript and DHTML and\n# should work on any modern browser. Note that when using HTML help\n# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)\n# there is already a search function so this one should typically be disabled.\n# For large projects the javascript based search engine can be slow, then\n# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to\n# search using the keyboard; to jump to the search box use <access key> + S\n# (what the <access key> is depends on the OS and browser, but it is typically\n# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down\n# key> to jump into the search results window, the results can be navigated\n# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel\n# the search. The filter options can be selected when the cursor is inside the\n# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>\n# to select a filter and <Enter> or <escape> to activate or cancel the filter\n# option.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nSEARCHENGINE           = NO\n\n# When the SERVER_BASED_SEARCH tag is enabled the search engine will be\n# implemented using a web server instead of a web client using Javascript. There\n# are two flavours of web server based searching depending on the\n# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for\n# searching and an index file used by the script. When EXTERNAL_SEARCH is\n# enabled the indexing and searching needs to be provided by external tools. See\n# the section \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSERVER_BASED_SEARCH    = NO\n\n# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP\n# script for searching. Instead the search results are written to an XML file\n# which needs to be processed by an external indexer. Doxygen will invoke an\n# external search engine pointed to by the SEARCHENGINE_URL option to obtain the\n# search results.\n#\n# Doxygen ships with an example indexer ( doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see: http://xapian.org/).\n#\n# See the section \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH        = NO\n\n# The SEARCHENGINE_URL should point to a search engine hosted by a web server\n# which will return the search results when EXTERNAL_SEARCH is enabled.\n#\n# Doxygen ships with an example indexer ( doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see: http://xapian.org/). See the section \"External Indexing and\n# Searching\" for details.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHENGINE_URL       =\n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed\n# search data is written to a file for indexing by an external tool. With the\n# SEARCHDATA_FILE tag the name of this file can be specified.\n# The default file is: searchdata.xml.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHDATA_FILE        = searchdata.xml\n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the\n# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is\n# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple\n# projects and redirect the results back to the right project.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH_ID     =\n\n# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen\n# projects other than the one defined by this configuration file, but that are\n# all added to the same external search index. Each project needs to have a\n# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of\n# to a relative location where the documentation can be found. The format is:\n# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTRA_SEARCH_MAPPINGS  =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the LaTeX output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.\n# The default value is: YES.\n\nGENERATE_LATEX         = NO\n\n# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: latex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_OUTPUT           = latex\n\n# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be\n# invoked.\n#\n# Note that when enabling USE_PDFLATEX this option is only used for generating\n# bitmaps for formulas in the HTML output, but not in the Makefile that is\n# written to the output directory.\n# The default file is: latex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_CMD_NAME         = latex\n\n# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate\n# index for LaTeX.\n# The default file is: makeindex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nMAKEINDEX_CMD_NAME     = makeindex\n\n# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nCOMPACT_LATEX          = NO\n\n# The PAPER_TYPE tag can be used to set the paper type that is used by the\n# printer.\n# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x\n# 14 inches) and executive (7.25 x 10.5 inches).\n# The default value is: a4.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPAPER_TYPE             = a4wide\n\n# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names\n# that should be included in the LaTeX output. To get the times font for\n# instance you can specify\n# EXTRA_PACKAGES=times\n# If left blank no extra packages will be included.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nEXTRA_PACKAGES         =\n\n# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the\n# generated LaTeX document. The header should contain everything until the first\n# chapter. If it is left blank doxygen will generate a standard header. See\n# section \"Doxygen usage\" for information on how to let doxygen write the\n# default header to a separate file.\n#\n# Note: Only use a user-defined header if you know what you are doing! The\n# following commands have a special meaning inside the header: $title,\n# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will\n# replace them by respectively the title of the page, the current date and time,\n# only the current date, the version number of doxygen, the project name (see\n# PROJECT_NAME), or the project number (see PROJECT_NUMBER).\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HEADER           =\n\n# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the\n# generated LaTeX document. The footer should contain everything after the last\n# chapter. If it is left blank doxygen will generate a standard footer.\n#\n# Note: Only use a user-defined footer if you know what you are doing!\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_FOOTER           =\n\n# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the LATEX_OUTPUT output\n# directory. Note that the files will be copied as-is; there are no commands or\n# markers available.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EXTRA_FILES      =\n\n# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is\n# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will\n# contain links (just like the HTML output) instead of page references. This\n# makes the output suitable for online browsing using a PDF viewer.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPDF_HYPERLINKS         = NO\n\n# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate\n# the PDF file directly from the LaTeX files. Set this option to YES to get a\n# higher quality PDF documentation.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nUSE_PDFLATEX           = NO\n\n# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode\n# command to the generated LaTeX files. This will instruct LaTeX to keep running\n# if errors occur, instead of asking the user for help. This option is also used\n# when generating formulas in HTML.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BATCHMODE        = NO\n\n# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the\n# index chapters (such as File Index, Compound Index, etc.) in the output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HIDE_INDICES     = NO\n\n# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source\n# code with syntax highlighting in the LaTeX output.\n#\n# Note that which sources are shown also depends on other settings such as\n# SOURCE_BROWSER.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_SOURCE_CODE      = NO\n\n# The LATEX_BIB_STYLE tag can be used to specify the style to use for the\n# bibliography, e.g. plainnat, or ieeetr. See\n# http://en.wikipedia.org/wiki/BibTeX and \\cite for more info.\n# The default value is: plain.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BIB_STYLE        = plain\n\n#---------------------------------------------------------------------------\n# Configuration options related to the RTF output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The\n# RTF output is optimized for Word 97 and may not look too pretty with other RTF\n# readers/editors.\n# The default value is: NO.\n\nGENERATE_RTF           = NO\n\n# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: rtf.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_OUTPUT             = rtf\n\n# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nCOMPACT_RTF            = NO\n\n# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will\n# contain hyperlink fields. The RTF file will contain links (just like the HTML\n# output) instead of page references. This makes the output suitable for online\n# browsing using Word or some other Word compatible readers that support those\n# fields.\n#\n# Note: WordPad (write) and others do not support links.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_HYPERLINKS         = NO\n\n# Load stylesheet definitions from file. Syntax is similar to doxygen's config\n# file, i.e. a series of assignments. You only have to provide replacements,\n# missing definitions are set to their default value.\n#\n# See also section \"Doxygen usage\" for information on how to generate the\n# default style sheet that doxygen normally uses.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_STYLESHEET_FILE    =\n\n# Set optional variables used in the generation of an RTF document. Syntax is\n# similar to doxygen's config file. A template extensions file can be generated\n# using doxygen -e rtf extensionFile.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_EXTENSIONS_FILE    =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the man page output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for\n# classes and files.\n# The default value is: NO.\n\nGENERATE_MAN           = NO\n\n# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it. A directory man3 will be created inside the directory specified by\n# MAN_OUTPUT.\n# The default directory is: man.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_OUTPUT             = man\n\n# The MAN_EXTENSION tag determines the extension that is added to the generated\n# man pages. In case the manual section does not start with a number, the number\n# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is\n# optional.\n# The default value is: .3.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_EXTENSION          = .3\n\n# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it\n# will generate one additional man file for each entity documented in the real\n# man page(s). These additional files only source the real man page, but without\n# them the man command would be unable to find the correct page.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_LINKS              = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the XML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that\n# captures the structure of the code including all documentation.\n# The default value is: NO.\n\nGENERATE_XML           = NO\n\n# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: xml.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_OUTPUT             = xml\n\n# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a\n# validating XML parser to check the syntax of the XML files.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_SCHEMA             =\n\n# The XML_DTD tag can be used to specify a XML DTD, which can be used by a\n# validating XML parser to check the syntax of the XML files.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_DTD                =\n\n# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program\n# listings (including syntax highlighting and cross-referencing information) to\n# the XML output. Note that enabling this will significantly increase the size\n# of the XML output.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_PROGRAMLISTING     = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to the DOCBOOK output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files\n# that can be used to generate PDF.\n# The default value is: NO.\n\nGENERATE_DOCBOOK       = NO\n\n# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.\n# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in\n# front of it.\n# The default directory is: docbook.\n# This tag requires that the tag GENERATE_DOCBOOK is set to YES.\n\nDOCBOOK_OUTPUT         = docbook\n\n#---------------------------------------------------------------------------\n# Configuration options for the AutoGen Definitions output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen\n# Definitions (see http://autogen.sf.net) file that captures the structure of\n# the code including all documentation. Note that this feature is still\n# experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_AUTOGEN_DEF   = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the Perl module output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module\n# file that captures the structure of the code including all documentation.\n#\n# Note that this feature is still experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_PERLMOD       = NO\n\n# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary\n# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI\n# output from the Perl module output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_LATEX          = NO\n\n# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely\n# formatted so it can be parsed by a human reader. This is useful if you want to\n# understand what is going on. On the other hand, if this tag is set to NO the\n# size of the Perl module output will be much smaller and Perl will parse it\n# just the same.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_PRETTY         = YES\n\n# The names of the make variables in the generated doxyrules.make file are\n# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful\n# so different doxyrules.make files included by the same Makefile don't\n# overwrite each other's variables.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_MAKEVAR_PREFIX =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the preprocessor\n#---------------------------------------------------------------------------\n\n# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all\n# C-preprocessor directives found in the sources and include files.\n# The default value is: YES.\n\nENABLE_PREPROCESSING   = YES\n\n# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names\n# in the source code. If set to NO only conditional compilation will be\n# performed. Macro expansion can be done in a controlled way by setting\n# EXPAND_ONLY_PREDEF to YES.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nMACRO_EXPANSION        = YES\n\n# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then\n# the macro expansion is limited to the macros specified with the PREDEFINED and\n# EXPAND_AS_DEFINED tags.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_ONLY_PREDEF     = YES\n\n# If the SEARCH_INCLUDES tag is set to YES the includes files in the\n# INCLUDE_PATH will be searched if a #include is found.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSEARCH_INCLUDES        = YES\n\n# The INCLUDE_PATH tag can be used to specify one or more directories that\n# contain include files that are not input files but should be processed by the\n# preprocessor.\n# This tag requires that the tag SEARCH_INCLUDES is set to YES.\n\nINCLUDE_PATH           =\n\n# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard\n# patterns (like *.h and *.hpp) to filter out the header-files in the\n# directories. If left blank, the patterns specified with FILE_PATTERNS will be\n# used.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nINCLUDE_FILE_PATTERNS  =\n\n# The PREDEFINED tag can be used to specify one or more macro names that are\n# defined before the preprocessor is started (similar to the -D option of e.g.\n# gcc). The argument of the tag is a list of macros of the form: name or\n# name=definition (no spaces). If the definition and the \"=\" are omitted, \"=1\"\n# is assumed. To prevent a macro definition from being undefined via #undef or\n# recursively expanded use the := operator instead of the = operator.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nPREDEFINED             = API_EXPORTED= \\\n                         LIBUSB_CALL= \\\n                         DEFAULT_VISIBILITY=\n\n# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this\n# tag can be used to specify a list of macro names that should be expanded. The\n# macro definition that is found in the sources will be used. Use the PREDEFINED\n# tag if you want to use a different macro definition that overrules the\n# definition found in the source code.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_AS_DEFINED      =\n\n# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will\n# remove all refrences to function-like macros that are alone on a line, have an\n# all uppercase name, and do not end with a semicolon. Such function macros are\n# typically used for boiler-plate code, and will confuse the parser if not\n# removed.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSKIP_FUNCTION_MACROS   = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to external references\n#---------------------------------------------------------------------------\n\n# The TAGFILES tag can be used to specify one or more tag files. For each tag\n# file the location of the external documentation should be added. The format of\n# a tag file without this location is as follows:\n# TAGFILES = file1 file2 ...\n# Adding location for the tag files is done as follows:\n# TAGFILES = file1=loc1 \"file2 = loc2\" ...\n# where loc1 and loc2 can be relative or absolute paths or URLs. See the\n# section \"Linking to external documentation\" for more information about the use\n# of tag files.\n# Note: Each tag file must have an unique name (where the name does NOT include\n# the path). If a tag file is not located in the directory in which doxygen is\n# run, you must also specify the path to the tagfile here.\n\nTAGFILES               =\n\n# When a file name is specified after GENERATE_TAGFILE, doxygen will create a\n# tag file that is based on the input files it reads. See section \"Linking to\n# external documentation\" for more information about the usage of tag files.\n\nGENERATE_TAGFILE       =\n\n# If the ALLEXTERNALS tag is set to YES all external class will be listed in the\n# class index. If set to NO only the inherited external classes will be listed.\n# The default value is: NO.\n\nALLEXTERNALS           = NO\n\n# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in\n# the modules index. If set to NO, only the current project's groups will be\n# listed.\n# The default value is: YES.\n\nEXTERNAL_GROUPS        = YES\n\n# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in\n# the related pages index. If set to NO, only the current project's pages will\n# be listed.\n# The default value is: YES.\n\nEXTERNAL_PAGES         = YES\n\n# The PERL_PATH should be the absolute path and name of the perl script\n# interpreter (i.e. the result of 'which perl').\n# The default file (with absolute path) is: /usr/bin/perl.\n\nPERL_PATH              = /usr/bin/perl\n\n#---------------------------------------------------------------------------\n# Configuration options related to the dot tool\n#---------------------------------------------------------------------------\n\n# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram\n# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to\n# NO turns the diagrams off. Note that this option also works with HAVE_DOT\n# disabled, but it is recommended to install and use dot, since it yields more\n# powerful graphs.\n# The default value is: YES.\n\nCLASS_DIAGRAMS         = YES\n\n# You can define message sequence charts within doxygen comments using the \\msc\n# command. Doxygen will then run the mscgen tool (see:\n# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the\n# documentation. The MSCGEN_PATH tag allows you to specify the directory where\n# the mscgen tool resides. If left empty the tool is assumed to be found in the\n# default search path.\n\nMSCGEN_PATH            =\n\n# If set to YES, the inheritance and collaboration graphs will hide inheritance\n# and usage relations if the target is undocumented or is not a class.\n# The default value is: YES.\n\nHIDE_UNDOC_RELATIONS   = YES\n\n# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is\n# available from the path. This tool is part of Graphviz (see:\n# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent\n# Bell Labs. The other options in this section have no effect if this option is\n# set to NO\n# The default value is: NO.\n\nHAVE_DOT               = NO\n\n# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed\n# to run in parallel. When set to 0 doxygen will base this on the number of\n# processors available in the system. You can set it explicitly to a value\n# larger than 0 to get control over the balance between CPU load and processing\n# speed.\n# Minimum value: 0, maximum value: 32, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_NUM_THREADS        = 0\n\n# When you want a differently looking font n the dot files that doxygen\n# generates you can specify the font name using DOT_FONTNAME. You need to make\n# sure dot is able to find the font, which can be done by putting it in a\n# standard location or by setting the DOTFONTPATH environment variable or by\n# setting DOT_FONTPATH to the directory containing the font.\n# The default value is: Helvetica.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTNAME           = FreeSans.ttf\n\n# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of\n# dot graphs.\n# Minimum value: 4, maximum value: 24, default value: 10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTSIZE           = 10\n\n# By default doxygen will tell dot to use the default font as specified with\n# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set\n# the path where dot can find it using this tag.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTPATH           =\n\n# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for\n# each documented class showing the direct and indirect inheritance relations.\n# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCLASS_GRAPH            = YES\n\n# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a\n# graph for each documented class showing the direct and indirect implementation\n# dependencies (inheritance, containment, and class references variables) of the\n# class with other documented classes.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCOLLABORATION_GRAPH    = YES\n\n# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for\n# groups, showing the direct groups dependencies.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGROUP_GRAPHS           = YES\n\n# If the UML_LOOK tag is set to YES doxygen will generate inheritance and\n# collaboration diagrams in a style similar to the OMG's Unified Modeling\n# Language.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nUML_LOOK               = NO\n\n# If the UML_LOOK tag is enabled, the fields and methods are shown inside the\n# class node. If there are many fields or methods and many nodes the graph may\n# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the\n# number of items for each type to make the size more manageable. Set this to 0\n# for no limit. Note that the threshold may be exceeded by 50% before the limit\n# is enforced. So when you set the threshold to 10, up to 15 fields may appear,\n# but if the number exceeds 15, the total amount of fields shown is limited to\n# 10.\n# Minimum value: 0, maximum value: 100, default value: 10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nUML_LIMIT_NUM_FIELDS   = 10\n\n# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and\n# collaboration graphs will show the relations between templates and their\n# instances.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nTEMPLATE_RELATIONS     = NO\n\n# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to\n# YES then doxygen will generate a graph for each documented file showing the\n# direct and indirect include dependencies of the file with other documented\n# files.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDE_GRAPH          = YES\n\n# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are\n# set to YES then doxygen will generate a graph for each documented file showing\n# the direct and indirect include dependencies of the file with other documented\n# files.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDED_BY_GRAPH      = YES\n\n# If the CALL_GRAPH tag is set to YES then doxygen will generate a call\n# dependency graph for every global function or class method.\n#\n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable call graphs for selected\n# functions only using the \\callgraph command.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALL_GRAPH             = NO\n\n# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller\n# dependency graph for every global function or class method.\n#\n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable caller graphs for selected\n# functions only using the \\callergraph command.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALLER_GRAPH           = NO\n\n# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical\n# hierarchy of all classes instead of a textual one.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGRAPHICAL_HIERARCHY    = YES\n\n# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the\n# dependencies a directory has on other directories in a graphical way. The\n# dependency relations are determined by the #include relations between the\n# files in the directories.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDIRECTORY_GRAPH        = YES\n\n# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images\n# generated by dot.\n# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order\n# to make the SVG files visible in IE 9+ (other browsers do not have this\n# requirement).\n# Possible values are: png, jpg, gif and svg.\n# The default value is: png.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_IMAGE_FORMAT       = png\n\n# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to\n# enable generation of interactive SVG images that allow zooming and panning.\n#\n# Note that this requires a modern browser other than Internet Explorer. Tested\n# and working are Firefox, Chrome, Safari, and Opera.\n# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make\n# the SVG files visible. Older versions of IE do not have SVG support.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINTERACTIVE_SVG        = NO\n\n# The DOT_PATH tag can be used to specify the path where the dot tool can be\n# found. If left blank, it is assumed the dot tool can be found in the path.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_PATH               =\n\n# The DOTFILE_DIRS tag can be used to specify one or more directories that\n# contain dot files that are included in the documentation (see the \\dotfile\n# command).\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOTFILE_DIRS           =\n\n# The MSCFILE_DIRS tag can be used to specify one or more directories that\n# contain msc files that are included in the documentation (see the \\mscfile\n# command).\n\nMSCFILE_DIRS           =\n\n# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes\n# that will be shown in the graph. If the number of nodes in a graph becomes\n# larger than this value, doxygen will truncate the graph, which is visualized\n# by representing a node as a red box. Note that doxygen if the number of direct\n# children of the root node in a graph is already larger than\n# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that\n# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n# Minimum value: 0, maximum value: 10000, default value: 50.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_GRAPH_MAX_NODES    = 50\n\n# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs\n# generated by dot. A depth value of 3 means that only nodes reachable from the\n# root by following a path via at most 3 edges will be shown. Nodes that lay\n# further from the root node will be omitted. Note that setting this option to 1\n# or 2 may greatly reduce the computation time needed for large code bases. Also\n# note that the size of a graph can be further restricted by\n# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n# Minimum value: 0, maximum value: 1000, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nMAX_DOT_GRAPH_DEPTH    = 0\n\n# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent\n# background. This is disabled by default, because dot on Windows does not seem\n# to support this out of the box.\n#\n# Warning: Depending on the platform used, enabling this option may lead to\n# badly anti-aliased labels on the edges of a graph (i.e. they become hard to\n# read).\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_TRANSPARENT        = NO\n\n# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output\n# files in one run (i.e. multiple -o and -T options on the command line). This\n# makes dot run faster, but since only newer versions of dot (>1.8.10) support\n# this, this feature is disabled by default.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_MULTI_TARGETS      = NO\n\n# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page\n# explaining the meaning of the various boxes and arrows in the dot generated\n# graphs.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGENERATE_LEGEND        = YES\n\n# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot\n# files that are used to generate the various graphs.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_CLEANUP            = YES\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/include/libuvc/libuvc.h",
    "content": "#ifndef LIBUVC_H\n#define LIBUVC_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include <stdio.h> // FILE\n#include <libusb/libusb.h>\n#include <libuvc/libuvc_config.h>\n\n/** UVC error types, based on libusb errors\n * @ingroup diag\n */\ntypedef enum uvc_error {\n\t/** Success (no error) */\n\tUVC_SUCCESS = 0,\n\t/** Input/output error */\n\tUVC_ERROR_IO = -1,\n\t/** Invalid parameter */\n\tUVC_ERROR_INVALID_PARAM = -2,\n\t/** Access denied */\n\tUVC_ERROR_ACCESS = -3,\n\t/** No such device */\n\tUVC_ERROR_NO_DEVICE = -4,\n\t/** Entity not found */\n\tUVC_ERROR_NOT_FOUND = -5,\n\t/** Resource busy */\n\tUVC_ERROR_BUSY = -6,\n\t/** Operation timed out */\n\tUVC_ERROR_TIMEOUT = -7,\n\t/** Overflow */\n\tUVC_ERROR_OVERFLOW = -8,\n\t/** Pipe error */\n\tUVC_ERROR_PIPE = -9,\n\t/** System call interrupted */\n\tUVC_ERROR_INTERRUPTED = -10,\n\t/** Insufficient memory */\n\tUVC_ERROR_NO_MEM = -11,\n\t/** Operation not supported */\n\tUVC_ERROR_NOT_SUPPORTED = -12,\n\t/** Device is not UVC-compliant */\n\tUVC_ERROR_INVALID_DEVICE = -50,\n\t/** Mode not supported */\n\tUVC_ERROR_INVALID_MODE = -51,\n\t/** Resource has a callback (can't use polling and async) */\n\tUVC_ERROR_CALLBACK_EXISTS = -52,\n\t/** Undefined error */\n\tUVC_ERROR_OTHER = -99\n} uvc_error_t;\n\n/**\n * Table 4-7 VC Request Error Code Control XXX add saki@serenegiant.com\n */\ntypedef enum uvc_vc_error_code_control {\n\tUVC_ERROR_CODECTRL_NO_ERROR = 0x00,\n\tUVC_ERROR_CODECTRL_NOT_READY = 0x01,\n\tUVC_ERROR_CODECTRL_WRONG_STATE = 0x02,\n\tUVC_ERROR_CODECTRL_POWER = 0x03,\n\tUVC_ERROR_CODECTRL_OUT_OF_RANGE = 0x04,\n\tUVC_ERROR_CODECTRL_INVALID_UINT = 0x05,\n\tUVC_ERROR_CODECTRL_INVALID_CONTROL = 0x06,\n\tUVC_ERROR_CODECTRL_INVALID_REQUEST = 0x07,\n\tUVC_ERROR_CODECTRL_INVALID_VALUE = 0x08,\n\tUVC_ERROR_CODECTRL_UNKNOWN = 0xff\n} uvc_vc_error_code_control_t;\n\n/**\n * VS Request Error Code Control XXX add saki@serenegiant.com\n */\ntypedef enum uvc_vs_error_code_control {\n\tUVC_VS_ERROR_CODECTRL_NO_ERROR = 0,\n\tUVC_VS_ERROR_CODECTRL_PROTECTED = 1,\n\tUVC_VS_ERROR_CODECTRL_IN_BUFEER_UNDERRUN = 2,\n\tUVC_VS_ERROR_CODECTRL_DATA_DISCONTINUITY = 3,\n\tUVC_VS_ERROR_CODECTRL_OUT_BUFEER_UNDERRUN = 4,\n\tUVC_VS_ERROR_CODECTRL_OUT_BUFEER_OVERRUN = 5,\n\tUVC_VS_ERROR_CODECTRL_FORMAT_CHANGE = 6,\n\tUVC_VS_ERROR_CODECTRL_STILL_CAPTURE_ERROR = 7,\n\tUVC_VS_ERROR_CODECTRL_UNKNOWN = 8,\n} uvc_vs_error_code_control_t;\n\n/** Color coding of stream, transport-independent\n * @ingroup streaming\n */\nenum uvc_frame_format {\n\tUVC_FRAME_FORMAT_UNKNOWN = 0,\n\t/** Any supported format */\n\tUVC_FRAME_FORMAT_ANY = 0,\n\tUVC_FRAME_FORMAT_UNCOMPRESSED,\n\tUVC_FRAME_FORMAT_COMPRESSED,\n\t/** YUYV/YUV2/YUV422: YUV encoding with one luminance value per pixel and\n\t * one UV (chrominance) pair for every two pixels.\n\t */\n\tUVC_FRAME_FORMAT_YUYV,\n\tUVC_FRAME_FORMAT_UYVY,\n\t/** 16-bits RGB */\n\tUVC_FRAME_FORMAT_RGB565,\t// RGB565\n\t/** 24-bit RGB */\n\tUVC_FRAME_FORMAT_RGB,\t\t// RGB888\n\tUVC_FRAME_FORMAT_BGR,\t\t// BGR888\n\t/* 32-bits RGB */\n\tUVC_FRAME_FORMAT_RGBX,\t\t// RGBX8888\n\t/** Motion-JPEG (or JPEG) encoded images */\n\tUVC_FRAME_FORMAT_MJPEG,\n\tUVC_FRAME_FORMAT_GRAY8,\n\tUVC_FRAME_FORMAT_BY8,\n\t/** Number of formats understood */\n\tUVC_FRAME_FORMAT_COUNT,\n};\n\n/* UVC_COLOR_FORMAT_* have been replaced with UVC_FRAME_FORMAT_*. Please use\n * UVC_FRAME_FORMAT_* instead of using these. */\n#define UVC_COLOR_FORMAT_UNKNOWN UVC_FRAME_FORMAT_UNKNOWN\n#define UVC_COLOR_FORMAT_UNCOMPRESSED UVC_FRAME_FORMAT_UNCOMPRESSED\n#define UVC_COLOR_FORMAT_COMPRESSED UVC_FRAME_FORMAT_COMPRESSED\n#define UVC_COLOR_FORMAT_YUYV UVC_FRAME_FORMAT_YUYV\n#define UVC_COLOR_FORMAT_UYVY UVC_FRAME_FORMAT_UYVY\n#define UVC_COLOR_FORMAT_RGB UVC_FRAME_FORMAT_RGB\n#define UVC_COLOR_FORMAT_BGR UVC_FRAME_FORMAT_BGR\n#define UVC_COLOR_FORMAT_RGB565 UVC_FRAME_FORMAT_RGB565\t// XXX\n#define UVC_COLOR_FORMAT_RGBX UVC_FRAME_FORMAT_RGBX\t\t// XXX\n#define UVC_COLOR_FORMAT_MJPEG UVC_FRAME_FORMAT_MJPEG\n#define UVC_COLOR_FORMAT_GRAY8 UVC_FRAME_FORMAT_GRAY8\n\n/** VideoStreaming interface descriptor subtype (A.6) */\nenum uvc_vs_desc_subtype {\n  UVC_VS_UNDEFINED = 0x00,\n  UVC_VS_INPUT_HEADER = 0x01,\n  UVC_VS_OUTPUT_HEADER = 0x02,\n  UVC_VS_STILL_IMAGE_FRAME = 0x03,\n  UVC_VS_FORMAT_UNCOMPRESSED = 0x04,\n  UVC_VS_FRAME_UNCOMPRESSED = 0x05,\n  UVC_VS_FORMAT_MJPEG = 0x06,\n  UVC_VS_FRAME_MJPEG = 0x07,\n  UVC_VS_FORMAT_MPEG2TS = 0x0a,\n  UVC_VS_FORMAT_DV = 0x0c,\n  UVC_VS_COLORFORMAT = 0x0d,\n  UVC_VS_FORMAT_FRAME_BASED = 0x10,\n  UVC_VS_FRAME_FRAME_BASED = 0x11,\n  UVC_VS_FORMAT_STREAM_BASED = 0x12\n};\n\nstruct uvc_format_desc;\nstruct uvc_frame_desc;\n\n/** Frame descriptor\n *\n * A \"frame\" is a configuration of a streaming format\n * for a particular image size at one of possibly several\n * available frame rates.\n */\ntypedef struct uvc_frame_desc {\n  struct uvc_format_desc *parent;\n  struct uvc_frame_desc *prev, *next;\n  /** Type of frame, such as JPEG frame or uncompressed frme */\n  enum uvc_vs_desc_subtype bDescriptorSubtype;\n  /** Index of the frame within the list of specs available for this format */\n  uint8_t bFrameIndex;\n  uint8_t bmCapabilities;\n  /** Image width */\n  uint16_t wWidth;\n  /** Image height */\n  uint16_t wHeight;\n  /** Bitrate of corresponding stream at minimal frame rate */\n  uint32_t dwMinBitRate;\n  /** Bitrate of corresponding stream at maximal frame rate */\n  uint32_t dwMaxBitRate;\n  /** Maximum number of bytes for a video frame */\n  uint32_t dwMaxVideoFrameBufferSize;\n  /** Default frame interval (in 100ns units) */\n  uint32_t dwDefaultFrameInterval;\n  /** Minimum frame interval for continuous mode (100ns units) */\n  uint32_t dwMinFrameInterval;\n  /** Maximum frame interval for continuous mode (100ns units) */\n  uint32_t dwMaxFrameInterval;\n  /** Granularity of frame interval range for continuous mode (100ns) */\n  uint32_t dwFrameIntervalStep;\n  /** Frame intervals */\n  uint8_t bFrameIntervalType;\n  /** number of bytes per line */\n  uint32_t dwBytesPerLine;\n  /** Available frame rates, zero-terminated (in 100ns units) */\n  uint32_t *intervals;\n} uvc_frame_desc_t;\n\n/** Format descriptor\n *\n * A \"format\" determines a stream's image type (e.g., raw YUYV or JPEG)\n * and includes many \"frame\" configurations.\n */\ntypedef struct uvc_format_desc {\n  struct uvc_streaming_interface *parent;\n  struct uvc_format_desc *prev, *next;\n  /** Type of image stream, such as JPEG or uncompressed. */\n  enum uvc_vs_desc_subtype bDescriptorSubtype;\n  /** Identifier of this format within the VS interface's format list */\n  uint8_t bFormatIndex;\n  uint8_t bNumFrameDescriptors;\n  /** Format specifier */\n  union {\n    uint8_t guidFormat[16];\n    uint8_t fourccFormat[4];\n  };\n  /** Format-specific data */\n  union {\n    /** BPP for uncompressed stream */\n    uint8_t bBitsPerPixel;\n    /** Flags for JPEG stream */\n    uint8_t bmFlags;\n  };\n  /** Default {uvc_frame_desc} to choose given this format */\n  uint8_t bDefaultFrameIndex;\n  uint8_t bAspectRatioX;\n  uint8_t bAspectRatioY;\n  uint8_t bmInterlaceFlags;\n  uint8_t bCopyProtect;\n  uint8_t bVariableSize;\n  /** Available frame specifications for this format */\n  struct uvc_frame_desc *frame_descs;\n} uvc_format_desc_t;\n\n/** UVC request code (A.8) */\nenum uvc_req_code {\n\tUVC_RC_UNDEFINED = 0x00,\n\tUVC_SET_CUR = 0x01,\t\t\t// bmRequestType=0x21\n\tUVC_GET_CUR = 0x81,\t\t\t// bmRequestType=0xa1\n\tUVC_GET_MIN = 0x82,\t\t\t// ↑\n\tUVC_GET_MAX = 0x83,\t\t\t// ↑\n\tUVC_GET_RES = 0x84,\t\t\t// ↑\n\tUVC_GET_LEN = 0x85,\t\t\t// ↑\n\tUVC_GET_INFO = 0x86,\t\t// ↑\n\tUVC_GET_DEF = 0x87\t\t\t// ↑\n};\n\nenum uvc_device_power_mode {\n\tUVC_VC_VIDEO_POWER_MODE_FULL = 0x000b,\n\tUVC_VC_VIDEO_POWER_MODE_DEVICE_DEPENDENT = 0x001b,\n};\n\n/** Camera terminal control selector (A.9.4) */\nenum uvc_ct_ctrl_selector {\n\tUVC_CT_CONTROL_UNDEFINED = 0x00,\n\tUVC_CT_SCANNING_MODE_CONTROL = 0x01,\n\tUVC_CT_AE_MODE_CONTROL = 0x02,\n\tUVC_CT_AE_PRIORITY_CONTROL = 0x03,\n\tUVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL = 0x04,\n\tUVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL = 0x05,\n\tUVC_CT_FOCUS_ABSOLUTE_CONTROL = 0x06,\n\tUVC_CT_FOCUS_RELATIVE_CONTROL = 0x07,\n\tUVC_CT_FOCUS_AUTO_CONTROL = 0x08,\n\tUVC_CT_IRIS_ABSOLUTE_CONTROL = 0x09,\n\tUVC_CT_IRIS_RELATIVE_CONTROL = 0x0a,\n\tUVC_CT_ZOOM_ABSOLUTE_CONTROL = 0x0b,\n\tUVC_CT_ZOOM_RELATIVE_CONTROL = 0x0c,\n\tUVC_CT_PANTILT_ABSOLUTE_CONTROL = 0x0d,\n\tUVC_CT_PANTILT_RELATIVE_CONTROL = 0x0e,\n\tUVC_CT_ROLL_ABSOLUTE_CONTROL = 0x0f,\n\tUVC_CT_ROLL_RELATIVE_CONTROL = 0x10,\n\tUVC_CT_PRIVACY_CONTROL = 0x11,\n\tUVC_CT_FOCUS_SIMPLE_CONTROL = 0x12,\n\tUVC_CT_DIGITAL_WINDOW_CONTROL = 0x13,\n\tUVC_CT_REGION_OF_INTEREST_CONTROL = 0x14\n};\n\n/** Processing unit control selector (A.9.5) */\nenum uvc_pu_ctrl_selector {\n\tUVC_PU_CONTROL_UNDEFINED = 0x00,\n\tUVC_PU_BACKLIGHT_COMPENSATION_CONTROL = 0x01,\n\tUVC_PU_BRIGHTNESS_CONTROL = 0x02,\n\tUVC_PU_CONTRAST_CONTROL = 0x03,\n\tUVC_PU_GAIN_CONTROL = 0x04,\n\tUVC_PU_POWER_LINE_FREQUENCY_CONTROL = 0x05,\n\tUVC_PU_HUE_CONTROL = 0x06,\n\tUVC_PU_SATURATION_CONTROL = 0x07,\n\tUVC_PU_SHARPNESS_CONTROL = 0x08,\n\tUVC_PU_GAMMA_CONTROL = 0x09,\n\tUVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL = 0x0a,\n\tUVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL = 0x0b,\n\tUVC_PU_WHITE_BALANCE_COMPONENT_CONTROL = 0x0c,\n\tUVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL = 0x0d,\n\tUVC_PU_DIGITAL_MULTIPLIER_CONTROL = 0x0e,\n\tUVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL = 0x0f,\n\tUVC_PU_HUE_AUTO_CONTROL = 0x10,\n\tUVC_PU_ANALOG_VIDEO_STANDARD_CONTROL = 0x11,\n\tUVC_PU_ANALOG_LOCK_STATUS_CONTROL = 0x12,\n\tUVC_PU_CONTRAST_AUTO_CONTROL = 0x13,\t\t// XXX\n};\n\n/** USB terminal type (B.1) */\nenum uvc_term_type {\n\tUVC_TT_VENDOR_SPECIFIC = 0x0100,\n\tUVC_TT_STREAMING = 0x0101\n};\n\n/** Input terminal type (B.2) */\nenum uvc_it_type {\n\tUVC_ITT_VENDOR_SPECIFIC = 0x0200,\n\tUVC_ITT_CAMERA = 0x0201,\n\tUVC_ITT_MEDIA_TRANSPORT_INPUT = 0x0202\n};\n\n/** Output terminal type (B.3) */\nenum uvc_ot_type {\n\tUVC_OTT_VENDOR_SPECIFIC = 0x0300,\n\tUVC_OTT_DISPLAY = 0x0301,\n\tUVC_OTT_MEDIA_TRANSPORT_OUTPUT = 0x0302\n};\n\n/** External terminal type (B.4) */\nenum uvc_et_type {\n\tUVC_EXTERNAL_VENDOR_SPECIFIC = 0x0400,\n\tUVC_COMPOSITE_CONNECTOR = 0x0401,\n\tUVC_SVIDEO_CONNECTOR = 0x0402,\n\tUVC_COMPONENT_CONNECTOR = 0x0403\n};\n\n/** Context, equivalent to libusb's contexts.\n *\n * May either own a libusb context or use one that's already made.\n *\n * Always create these with uvc_get_context.\n */\nstruct uvc_context;\ntypedef struct uvc_context uvc_context_t;\n\n/** UVC device.\n *\n * Get this from uvc_get_device_list() or uvc_find_device().\n */\nstruct uvc_device;\ntypedef struct uvc_device uvc_device_t;\n\n/** Handle on an open UVC device.\n *\n * Get one of these from uvc_open(). Once you uvc_close()\n * it, it's no longer valid.\n */\nstruct uvc_device_handle;\ntypedef struct uvc_device_handle uvc_device_handle_t;\n\n/** Handle on an open UVC stream.\n *\n * Get one of these from uvc_stream_open*().\n * Once you uvc_stream_close() it, it will no longer be valid.\n */\nstruct uvc_stream_handle;\ntypedef struct uvc_stream_handle uvc_stream_handle_t;\n\n/** Representation of the interface that brings data into the UVC device */\ntypedef struct uvc_input_terminal {\n\tstruct uvc_input_terminal *prev, *next;\n\t/** Index of the terminal within the device */\n\tuint8_t bTerminalID;\n\t/** Type of terminal (e.g., camera) */\n\tenum uvc_it_type wTerminalType;\n\tuint16_t wObjectiveFocalLengthMin;\n\tuint16_t wObjectiveFocalLengthMax;\n\tuint16_t wOcularFocalLength;\n\t/** Camera controls (meaning of bits given in {uvc_ct_ctrl_selector}) */\n\tuint64_t bmControls;\n\t/** request code(wIndex) */\n\tuint16_t request;\n} uvc_input_terminal_t;\n\ntypedef struct uvc_output_terminal {\n\tstruct uvc_output_terminal *prev, *next;\n\t/** @todo */\n\t/** Index of the terminal within the device */\n\tuint8_t bTerminalID;\n\t/** Type of terminal (e.g., camera) */\n\tenum uvc_ot_type wTerminalType;\n\tuint16_t bAssocTerminal;\n\tuint8_t bSourceID;\n\tuint8_t iTerminal;\n\t/** request code(wIndex) */\n\tuint16_t request;\n} uvc_output_terminal_t;\n\n/** Represents post-capture processing functions */\ntypedef struct uvc_processing_unit {\n\tstruct uvc_processing_unit *prev, *next;\n\t/** Index of the processing unit within the device */\n\tuint8_t bUnitID;\n\t/** Index of the terminal from which the device accepts images */\n\tuint8_t bSourceID;\n\t/** Processing controls (meaning of bits given in {uvc_pu_ctrl_selector}) */\n\tuint64_t bmControls;\n\t/** request code(wIndex) */\n\tuint16_t request;\n} uvc_processing_unit_t;\n\n/** Custom processing or camera-control functions */\ntypedef struct uvc_extension_unit {\n\tstruct uvc_extension_unit *prev, *next;\n\t/** Index of the extension unit within the device */\n\tuint8_t bUnitID;\n\t/** GUID identifying the extension unit */\n\tuint8_t guidExtensionCode[16];\n\t/** Bitmap of available controls (manufacturer-dependent) */\n\tuint64_t bmControls;\n\t/** request code(wIndex) */\n\tuint16_t request;\n} uvc_extension_unit_t;\n\nenum uvc_status_class {\n\tUVC_STATUS_CLASS_CONTROL = 0x10,\n\tUVC_STATUS_CLASS_CONTROL_CAMERA = 0x11,\n\tUVC_STATUS_CLASS_CONTROL_PROCESSING = 0x12,\n};\n\nenum uvc_status_attribute {\n\tUVC_STATUS_ATTRIBUTE_VALUE_CHANGE = 0x00,\n\tUVC_STATUS_ATTRIBUTE_INFO_CHANGE = 0x01,\n\tUVC_STATUS_ATTRIBUTE_FAILURE_CHANGE = 0x02,\n\tUVC_STATUS_ATTRIBUTE_UNKNOWN = 0xff\n};\n\n/** A callback function to accept status updates\n * @ingroup device\n */\ntypedef void (uvc_status_callback_t)(enum uvc_status_class status_class,\n\t\tint event, int selector, enum uvc_status_attribute status_attribute,\n\t\tvoid *data, size_t data_len, void *user_ptr);\n\n/** A callback function to accept button events\n * @ingroup device\n */\ntypedef void(uvc_button_callback_t)(int button,\n                                    int state,\n                                    void *user_ptr);\n\n/** Structure representing a UVC device descriptor.\n *\n * (This isn't a standard structure.)\n */\ntypedef struct uvc_device_descriptor {\n\t/** Vendor ID */\n\tuint16_t idVendor;\n\t/** Product ID */\n\tuint16_t idProduct;\n\t/** UVC compliance level, e.g. 0x0100 (1.0), 0x0110 */\n\tuint16_t bcdUVC;\n\t/** Serial number (null if unavailable) */\n\tconst char *serialNumber;\n\t/** Device-reported manufacturer name (or null) */\n\tconst char *manufacturer;\n\t/** Device-reporter product name (or null) */\n\tconst char *product;\n} uvc_device_descriptor_t;\n\n/** An image frame received from the UVC device\n * @ingroup streaming\n */\ntypedef struct uvc_frame {\n\t/** Image data for this frame */\n\tvoid *data;\n\t/** Size of image data buffer */\n\tsize_t data_bytes;\n\t/** XXX Size of actual received data to confirm whether the received bytes is same\n\t * as expected on user function when some microframes dropped */\n\tsize_t actual_bytes;\n\t/** Width of image in pixels */\n\tuint32_t width;\n\t/** Height of image in pixels */\n\tuint32_t height;\n\t/** Pixel data format */\n\tenum uvc_frame_format frame_format;\n\t/** Number of bytes per horizontal line (undefined for compressed format) */\n\tsize_t step;\n\t/** Frame number (may skip, but is strictly monotonically increasing) */\n\tuint32_t sequence;\n\t/** Estimate of system time when the device started capturing the image */\n\tstruct timeval capture_time;\n\t/** Handle on the device that produced the image.\n\t * @warning You must not call any uvc_* functions during a callback. */\n\tuvc_device_handle_t *source;\n\t/** Is the data buffer owned by the library?\n\t * If 1, the data buffer can be arbitrarily reallocated by frame conversion\n\t * functions.\n\t * If 0, the data buffer will not be reallocated or freed by the library.\n\t * Set this field to zero if you are supplying the buffer.\n\t */\n\tuint8_t library_owns_data;\n} uvc_frame_t;\n\n/** A callback function to handle incoming assembled UVC frames\n * @ingroup streaming\n */\ntypedef void(uvc_frame_callback_t)(struct uvc_frame *frame, void *user_ptr);\n\n/** Streaming mode, includes all information needed to select stream\n * @ingroup streaming\n */\ntypedef struct uvc_stream_ctrl {\n\tuint16_t bmHint;\n\tuint8_t bFormatIndex;\n\tuint8_t bFrameIndex;\n\tuint32_t dwFrameInterval;\n\tuint16_t wKeyFrameRate;\n\tuint16_t wPFrameRate;\n\tuint16_t wCompQuality;\n\tuint16_t wCompWindowSize;\n\tuint16_t wDelay;\n\tuint32_t dwMaxVideoFrameSize;\n\tuint32_t dwMaxPayloadTransferSize;\n\t/** XXX add UVC 1.1 parameters */\n\tuint32_t dwClockFrequency;\n\tuint8_t bmFramingInfo;\n\tuint8_t bPreferedVersion;\n\tuint8_t bMinVersion;\n\tuint8_t bMaxVersion;\n\t/** XXX add UVC 1.5 parameters */\n\tuint8_t bUsage;\n\tuint8_t bBitDepthLuma;\n\tuint8_t bmSettings;\n\tuint8_t bMaxNumberOfRefFramesPlus1;\n\tuint16_t bmRateControlModes;\n\tuint64_t bmLayoutPerStream;\n\t//\n\tuint8_t bInterfaceNumber;\n} uvc_stream_ctrl_t;\n\nuvc_error_t uvc_init(uvc_context_t **ctx, struct libusb_context *usb_ctx);\nuvc_error_t uvc_init2(uvc_context_t **ctx, struct libusb_context *usb_ctx, const char *usbfs);\nvoid uvc_exit(uvc_context_t *ctx);\n\nuvc_error_t uvc_get_device_list(uvc_context_t *ctx, uvc_device_t ***list);\nvoid uvc_free_device_list(uvc_device_t **list, uint8_t unref_devices);\n\nuvc_error_t uvc_get_device_descriptor(uvc_device_t *dev,\n\t\tuvc_device_descriptor_t **desc);\nvoid uvc_free_device_descriptor(uvc_device_descriptor_t *desc);\n\nuint8_t uvc_get_bus_number(uvc_device_t *dev);\nuint8_t uvc_get_device_address(uvc_device_t *dev);\n\nuvc_error_t uvc_find_device(uvc_context_t *ctx, uvc_device_t **dev, int vid,\n\t\tint pid, const char *sn);\n\nuvc_error_t uvc_find_device2(uvc_context_t *ctx, uvc_device_t **dev, int vid,\n\t\tint pid, const char *sn, int fd);\n// XXX\nuvc_error_t uvc_get_device_with_fd(uvc_context_t *ctx, uvc_device_t **device,\n\t\tint vid, int pid, const char *serial, int fd, int busnum, int devaddr);\n\nuvc_error_t uvc_open(uvc_device_t *dev, uvc_device_handle_t **devh);\nvoid uvc_close(uvc_device_handle_t *devh);\n// XXX\nuvc_error_t uvc_set_reset_altsetting(uvc_device_handle_t *devh, uint8_t reset_on_release_if);\n\nuvc_device_t *uvc_get_device(uvc_device_handle_t *devh);\nlibusb_device_handle *uvc_get_libusb_handle(uvc_device_handle_t *devh);\n\nvoid uvc_ref_device(uvc_device_t *dev);\nvoid uvc_unref_device(uvc_device_t *dev);\n\nvoid uvc_set_status_callback(uvc_device_handle_t *devh,\n\t\tuvc_status_callback_t cb, void *user_ptr);\n\nvoid uvc_set_button_callback(uvc_device_handle_t *devh,\n                             uvc_button_callback_t cb,\n                             void *user_ptr);\n\nconst uvc_input_terminal_t *uvc_get_input_terminals(uvc_device_handle_t *devh);\nconst uvc_output_terminal_t *uvc_get_output_terminals(uvc_device_handle_t *devh);\nconst uvc_processing_unit_t *uvc_get_processing_units(uvc_device_handle_t *devh);\nconst uvc_extension_unit_t *uvc_get_extension_units(uvc_device_handle_t *devh);\n\nuvc_error_t uvc_get_stream_ctrl_format_size(uvc_device_handle_t *devh,\n\t\tuvc_stream_ctrl_t *ctrl, enum uvc_frame_format format, int width,\n\t\tint height, int fps);\nuvc_error_t uvc_get_stream_ctrl_format_size_fps(uvc_device_handle_t *devh,\n\t\tuvc_stream_ctrl_t *ctrl, enum uvc_frame_format cf, int width,\n\t\tint height, int min_fps, int max_fps);\t// XXX added\n\nuvc_error_t uvc_probe_stream_ctrl(uvc_device_handle_t *devh,\n\t\tuvc_stream_ctrl_t *ctrl);\n\nuvc_error_t uvc_get_frame_desc(uvc_device_handle_t *devh,\n\t\tuvc_stream_ctrl_t *ctrl, uvc_frame_desc_t **desc);\n\nuvc_error_t uvc_start_streaming(uvc_device_handle_t *devh,\n\t\tuvc_stream_ctrl_t *ctrl, uvc_frame_callback_t *cb, void *user_ptr,\n\t\tuint8_t flags);\nuvc_error_t uvc_start_streaming_bandwidth(uvc_device_handle_t *devh,\n\t\tuvc_stream_ctrl_t *ctrl, uvc_frame_callback_t *cb, void *user_ptr,\n\t\tfloat bandwidth,\n\t\tuint8_t flags);\t// XXX added saki\n\nuvc_error_t uvc_start_iso_streaming(uvc_device_handle_t *devh,\n\t\tuvc_stream_ctrl_t *ctrl, uvc_frame_callback_t *cb, void *user_ptr);\n\nvoid uvc_stop_streaming(uvc_device_handle_t *devh);\n\nuvc_error_t uvc_stream_open_ctrl(uvc_device_handle_t *devh,\n\t\tuvc_stream_handle_t **strmh, uvc_stream_ctrl_t *ctrl);\nuvc_error_t uvc_stream_ctrl(uvc_stream_handle_t *strmh,\n\t\tuvc_stream_ctrl_t *ctrl);\nuvc_error_t uvc_stream_start(uvc_stream_handle_t *strmh,\n\t\tuvc_frame_callback_t *cb, void *user_ptr, uint8_t flags);\nuvc_error_t uvc_stream_start_bandwidth(uvc_stream_handle_t *strmh,\n\t\tuvc_frame_callback_t *cb, void *user_ptr, float bandwidth, uint8_t flags);\t// XXX added saki\nuvc_error_t uvc_stream_start_iso(uvc_stream_handle_t *strmh,\n\t\tuvc_frame_callback_t *cb, void *user_ptr);\nuvc_error_t uvc_stream_get_frame(uvc_stream_handle_t *strmh,\n\t\tuvc_frame_t **frame, int32_t timeout_us);\nuvc_error_t uvc_stream_stop(uvc_stream_handle_t *strmh);\nvoid uvc_stream_close(uvc_stream_handle_t *strmh);\n\n// Generic Controls\nint uvc_get_ctrl_len(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl);\nint uvc_get_ctrl(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl,\n\t\tvoid *data, int len, enum uvc_req_code req_code);\nint uvc_set_ctrl(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl,\n\t\tvoid *data, int len);\n\n// Camera Controls\nuvc_error_t uvc_vc_get_error_code(uvc_device_handle_t *devh,\n\t\tuvc_vc_error_code_control_t *error_code, enum uvc_req_code req_code);\t// XXX added saki\nuvc_error_t uvc_vs_get_error_code(uvc_device_handle_t *devh,\n\t\tuvc_vs_error_code_control_t *error_code, enum uvc_req_code req_code);\t// XXX added saki\nuvc_error_t uvc_get_power_mode(uvc_device_handle_t *devh,\n\t\tenum uvc_device_power_mode *mode, enum uvc_req_code req_code);\nuvc_error_t uvc_set_power_mode(uvc_device_handle_t *devh,\n\t\tenum uvc_device_power_mode mode);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_scanning_mode(uvc_device_handle_t *devh, uint8_t *mode,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_scanning_mode(uvc_device_handle_t *devh, uint8_t mode);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_ae_mode(uvc_device_handle_t *devh, uint8_t *mode,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_ae_mode(uvc_device_handle_t *devh, uint8_t mode);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_ae_priority(uvc_device_handle_t *devh, uint8_t *priority,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_ae_priority(uvc_device_handle_t *devh, uint8_t priority);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_exposure_abs(uvc_device_handle_t *devh, int *time,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_exposure_abs(uvc_device_handle_t *devh, int time);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_exposure_rel(uvc_device_handle_t *devh, int *step,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_exposure_rel(uvc_device_handle_t *devh, int step);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_focus_abs(uvc_device_handle_t *devh, short *focus,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_focus_abs(uvc_device_handle_t *devh, short focus);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_focus_rel(uvc_device_handle_t *devh, int8_t *focus, uint8_t *speed,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_focus_rel(uvc_device_handle_t *devh, int8_t focus, uint8_t speed);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_focus_simple_range(uvc_device_handle_t *devh, uint8_t* focus,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_focus_simple_range(uvc_device_handle_t *devh, uint8_t focus);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_focus_auto(uvc_device_handle_t *devh, uint8_t *autofocus,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_focus_auto(uvc_device_handle_t *devh, uint8_t autofocus);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_iris_abs(uvc_device_handle_t *devh, uint16_t *iris,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_iris_abs(uvc_device_handle_t *devh, uint16_t iris);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_iris_rel(uvc_device_handle_t *devh, uint8_t *iris,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_iris_rel(uvc_device_handle_t *devh, uint8_t iris);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_zoom_abs(uvc_device_handle_t *devh, uint16_t *zoom,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_zoom_abs(uvc_device_handle_t *devh, uint16_t zoom);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_zoom_rel(uvc_device_handle_t *devh, int8_t *zoom, uint8_t *isdigital, uint8_t *speed,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_zoom_rel(uvc_device_handle_t *devh, int8_t zoom, uint8_t isdigital, uint8_t speed);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_pantilt_abs(uvc_device_handle_t *devh, int32_t* pan, int32_t* tilt, enum uvc_req_code req_code);\nuvc_error_t uvc_set_pantilt_abs(uvc_device_handle_t *devh, int32_t pan, int32_t tilt);\nuvc_error_t uvc_get_pantilt_rel(uvc_device_handle_t *devh, int8_t* pan_rel, uint8_t* pan_speed, int8_t* tilt_rel, uint8_t* tilt_speed, enum uvc_req_code req_code);\nuvc_error_t uvc_set_pantilt_rel(uvc_device_handle_t *devh, int8_t pan_rel, uint8_t pan_speed, int8_t tilt_rel, uint8_t tilt_speed);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_roll_abs(uvc_device_handle_t *devh, int16_t* roll, enum uvc_req_code req_code);\nuvc_error_t uvc_set_roll_abs(uvc_device_handle_t *devh, int16_t roll);\nuvc_error_t uvc_get_roll_rel(uvc_device_handle_t *devh, int8_t* roll_rel, uint8_t* speed, enum uvc_req_code req_code);\nuvc_error_t uvc_set_roll_rel(uvc_device_handle_t *devh, int8_t roll_rel, uint8_t speed);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_privacy(uvc_device_handle_t *devh, uint8_t* privacy, enum uvc_req_code req_code);\nuvc_error_t uvc_set_privacy(uvc_device_handle_t *devh, uint8_t privacy);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_digital_window(uvc_device_handle_t *devh, uint16_t* window_top, uint16_t* window_left, uint16_t* window_bottom, uint16_t* window_right, uint16_t* num_steps, uint16_t* num_steps_units, enum uvc_req_code req_code);\nuvc_error_t uvc_set_digital_window(uvc_device_handle_t *devh, uint16_t window_top, uint16_t window_left, uint16_t window_bottom, uint16_t window_right, uint16_t num_steps, uint16_t num_steps_units);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_digital_roi(uvc_device_handle_t *devh, uint16_t* roi_top, uint16_t* roi_left, uint16_t* roi_bottom, uint16_t* roi_right, uint16_t* auto_controls, enum uvc_req_code req_code);\nuvc_error_t uvc_set_digital_roi(uvc_device_handle_t *devh, uint16_t roi_top, uint16_t roi_left, uint16_t roi_bottom, uint16_t roi_right, uint16_t auto_controls);\n\n//----------------------------------------------------------------------\n// Processing Unit Controls\nuvc_error_t uvc_get_backlight_compensation(uvc_device_handle_t *devh, int16_t *comp,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_backlight_compensation(uvc_device_handle_t *devh, int16_t comp);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_brightness(uvc_device_handle_t *devh, int16_t *brightness,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_brightness(uvc_device_handle_t *devh, int16_t brightness);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_contrast(uvc_device_handle_t *devh, uint16_t *contrast,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_contrast(uvc_device_handle_t *devh, uint16_t contrast);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_contrast_auto(uvc_device_handle_t *devh, uint8_t *autoContrast,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_contrast_auto(uvc_device_handle_t *devh, uint8_t autoContrast);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_gain(uvc_device_handle_t *devh, uint16_t *gain,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_gain(uvc_device_handle_t *devh, uint16_t gain);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_powerline_freqency(uvc_device_handle_t *devh, uint8_t *power_line_frequency,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_powerline_freqency(uvc_device_handle_t *devh, uint8_t power_line_frequency);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_hue(uvc_device_handle_t *devh, int16_t *hue,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_hue(uvc_device_handle_t *devh, int16_t hue);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_hue_auto(uvc_device_handle_t *devh, uint8_t *autoHue,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_hue_auto(uvc_device_handle_t *devh, uint8_t autoHue);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_saturation(uvc_device_handle_t *devh, uint16_t *saturation,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_saturation(uvc_device_handle_t *devh, uint16_t saturation);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_sharpness(uvc_device_handle_t *devh, uint16_t *sharpness,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_sharpness(uvc_device_handle_t *devh, uint16_t sharpness);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_gamma(uvc_device_handle_t *devh, uint16_t *gamma,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_gamma(uvc_device_handle_t *devh, uint16_t gamma);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_white_balance_temperature(uvc_device_handle_t *devh, uint16_t *wb_temperature,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_white_balance_temperature(uvc_device_handle_t *devh, uint16_t wb_temperature);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_white_balance_temperature_auto(uvc_device_handle_t *devh, uint8_t *autoWbTemp,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_white_balance_temperature_auto(uvc_device_handle_t *devh, uint8_t autoWbTemp);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_white_balance_component(uvc_device_handle_t *devh, uint32_t *wb_compo,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_white_balance_component(uvc_device_handle_t *devh, uint32_t wb_compo);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_white_balance_component_auto(uvc_device_handle_t *devh, uint8_t *autoWbCompo,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_white_balance_component_auto(uvc_device_handle_t *devh, uint8_t autoWbCompo);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_digital_multiplier(uvc_device_handle_t *devh, uint16_t *multiplier,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_digital_multiplier(uvc_device_handle_t *devh, uint16_t multiplier);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_digital_multiplier_limit(uvc_device_handle_t *devh, uint16_t *limit,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_digital_multiplier_limit(uvc_device_handle_t *devh, uint16_t limit);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_analog_video_standard(uvc_device_handle_t *devh, uint8_t *standard,\n\t\tenum uvc_req_code req_code);\nuvc_error_t uvc_set_analog_video_standard(uvc_device_handle_t *devh, uint8_t standard);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_analog_video_lockstate(uvc_device_handle_t *devh, uint8_t* state, enum uvc_req_code req_code);\nuvc_error_t uvc_set_analog_video_lockstate(uvc_device_handle_t *devh, uint8_t status);\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_input_select(uvc_device_handle_t *devh, uint8_t* selector, enum uvc_req_code req_code);\nuvc_error_t uvc_set_input_select(uvc_device_handle_t *devh, uint8_t selector);\n//----------------------------------------------------------------------\n\nvoid uvc_perror(uvc_error_t err, const char *msg);\nconst char* uvc_strerror(uvc_error_t err);\nvoid uvc_print_diag(uvc_device_handle_t *devh, FILE *stream);\nvoid uvc_print_stream_ctrl(uvc_stream_ctrl_t *ctrl, FILE *stream);\n\nuvc_frame_t *uvc_allocate_frame(size_t data_bytes);\nvoid uvc_free_frame(uvc_frame_t *frame);\n\nuvc_error_t uvc_duplicate_frame(uvc_frame_t *in, uvc_frame_t *out);\n//----------------------------------------------------------------------\nuvc_error_t uvc_yuyv2rgb(uvc_frame_t *in, uvc_frame_t *out);\nuvc_error_t uvc_uyvy2rgb(uvc_frame_t *in, uvc_frame_t *out);\nuvc_error_t uvc_any2rgb(uvc_frame_t *in, uvc_frame_t *out);\n//----------------------------------------------------------------------\nuvc_error_t uvc_yuyv2bgr(uvc_frame_t *in, uvc_frame_t *out);\nuvc_error_t uvc_uyvy2bgr(uvc_frame_t *in, uvc_frame_t *out);\nuvc_error_t uvc_any2bgr(uvc_frame_t *in, uvc_frame_t *out);\n\n#ifdef LIBUVC_HAS_JPEG\nuvc_error_t uvc_mjpeg2rgb(uvc_frame_t *in, uvc_frame_t *out);\nuvc_error_t uvc_mjpeg2bgr(uvc_frame_t *in, uvc_frame_t *out);\t\t// XXX\nuvc_error_t uvc_mjpeg2rgb565(uvc_frame_t *in, uvc_frame_t *out);\t// XXX\nuvc_error_t uvc_mjpeg2rgbx(uvc_frame_t *in, uvc_frame_t *out);\t\t// XXX\nuvc_error_t uvc_mjpeg2yuyv(uvc_frame_t *in, uvc_frame_t *out);\t\t// XXX\n#endif\n\nuvc_error_t uvc_yuyv2rgb565(uvc_frame_t *in, uvc_frame_t *out);\t\t// XXX\nuvc_error_t uvc_uyvy2rgb565(uvc_frame_t *in, uvc_frame_t *out);\t\t// XXX\nuvc_error_t uvc_rgb2rgb565(uvc_frame_t *in, uvc_frame_t *out);\t\t// XXX\nuvc_error_t uvc_any2rgb565(uvc_frame_t *in, uvc_frame_t *out);\t\t// XXX\n\nuvc_error_t uvc_yuyv2rgbx(uvc_frame_t *in, uvc_frame_t *out);\t\t// XXX\nuvc_error_t uvc_uyvy2rgbx(uvc_frame_t *in, uvc_frame_t *out);\t\t// XXX\nuvc_error_t uvc_rgb2rgbx(uvc_frame_t *in, uvc_frame_t *out);\t\t// XXX\nuvc_error_t uvc_any2rgbx(uvc_frame_t *in, uvc_frame_t *out);\t\t// XXX\n\nuvc_error_t uvc_yuyv2yuv420P(uvc_frame_t *in, uvc_frame_t *out);\t// XXX\nuvc_error_t uvc_yuyv2yuv420SP(uvc_frame_t *in, uvc_frame_t *out);\t// XXX\nuvc_error_t uvc_any2yuv420SP(uvc_frame_t *in, uvc_frame_t *out);\t// XXX\n\nuvc_error_t uvc_yuyv2iyuv420SP(uvc_frame_t *in, uvc_frame_t *out);\t// XXX\nuvc_error_t uvc_yuyv2iyuv420SP(uvc_frame_t *in, uvc_frame_t *out);\t// XXX\nuvc_error_t uvc_any2iyuv420SP(uvc_frame_t *in, uvc_frame_t *out);\t// XXX\n\nuvc_error_t uvc_any2yuyv(uvc_frame_t *in, uvc_frame_t *out);\t\t// XXX\n\nuvc_error_t uvc_ensure_frame_size(uvc_frame_t *frame, size_t need_bytes); // XXX\n\n//**********************************************************************\n// added for diagnostic\n// t_saki@serenegiant.com\nvoid uvc_print_format_desc_one(uvc_format_desc_t *format_descriptors, FILE *stream);\nvoid uvc_print_format_desc(uvc_format_desc_t *format_descriptors, FILE *stream);\nvoid uvc_print_device_desc(uvc_device_handle_t *devh, FILE *stream);\nvoid uvc_print_configuration_desc(uvc_device_handle_t *devh, FILE *stream);\nvoid uvc_print_interface_desc(\n\tconst struct libusb_interface *interface, const int num_interface,\n\tconst char *prefix, FILE *stream);\nvoid uvc_print_endpoint_desc(\n\tconst struct libusb_endpoint_descriptor *endpoint, const int num_endpoint,\n\tconst char *prefix, FILE *stream);\n\n#define uvc_print_format_descriptor_one uvc_print_format_desc_one\n#define uvc_print_format_descriptor uvc_print_format_desc\n#define uvc_print_device_descriptor uvc_print_device_desc\n#define uvc_print_configuration_descriptor uvc_print_configuration_desc\n#define uvc_print_interface_descriptor uvc_print_interface_desc\n#define uvc_print_endpoint_descriptor uvc_print_endpoint_desc;\n\n#ifdef __cplusplus\n}\n\n#endif\n\n#endif // !def(LIBUVC_H)\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/include/libuvc/libuvc_config.h",
    "content": "#ifndef LIBUVC_CONFIG_H\n#define LIBUVC_CONFIG_H\n\n#include \"utilbase.h\"\n\n#define LIBUVC_VERSION_MAJOR 0\n#define LIBUVC_VERSION_MINOR 0\n#define LIBUVC_VERSION_PATCH 4\n#define LIBUVC_VERSION_STR \"0.0.4\"\n#define LIBUVC_VERSION_INT \\\n  (0 << 16) |              \\\n  (0 << 8) |               \\\n  (4)\n\n/* #undef LIBUVC_HAS_JPEG */\n\n#endif // !def(LIBUVC_CONFIG_H)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/include/libuvc/libuvc_config.h.in",
    "content": "#ifndef LIBUVC_CONFIG_H\n#define LIBUVC_CONFIG_H\n\n#define LIBUVC_VERSION_MAJOR @libuvc_VERSION_MAJOR@\n#define LIBUVC_VERSION_MINOR @libuvc_VERSION_MINOR@\n#define LIBUVC_VERSION_PATCH @libuvc_VERSION_PATCH@\n#define LIBUVC_VERSION_STR \"@libuvc_VERSION@\"\n#define LIBUVC_VERSION_INT \\\n  (@libuvc_VERSION_MAJOR@ << 16) |              \\\n  (@libuvc_VERSION_MINOR@ << 8) |               \\\n  (@libuvc_VERSION_PATCH@)\n\n#cmakedefine LIBUVC_HAS_JPEG 1\n\n#endif // !def(LIBUVC_CONFIG_H)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/include/libuvc/libuvc_internal.h",
    "content": "/** @file libuvc_internal.h\n  * @brief Implementation-specific UVC constants and structures.\n  * @cond include_hidden\n  */\n#ifndef LIBUVC_INTERNAL_H\n#define LIBUVC_INTERNAL_H\n\n#include <assert.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <pthread.h>\n#include <signal.h>\n#include \"utilbase.h\"\n#include \"utlist.h\"\n\n//#define UVC_DEBUGGING\n\n#define MIN(a, b) ((a) < (b) ? (a) : (b))\n#define MAX(a, b) ((a) > (b) ? (a) : (b))\n\n/** Converts an unaligned 8-byte little-endian integer into an int64 */\n#define QW_TO_LONG(p) \\\n ((p)[0] | ((p)[1] << 8) | ((p)[2] << 16) | ((p)[3] << 24) \\\n  | ((uint64_t)(p)[4] << 32) | ((uint64_t)(p)[5] << 40) \\\n  | ((uint64_t)(p)[6] << 48) | ((uint64_t)(p)[7] << 56))\n/** Converts an unaligned four-byte little-endian integer into an int32 */\n#define DW_TO_INT(p) ((p)[0] | ((p)[1] << 8) | ((p)[2] << 16) | ((p)[3] << 24))\n/** Converts an unaligned four-byte little-endian integer into an signed int32 */\n/** Converts an unaligned two-byte little-endian integer into an int16 */\n#define SW_TO_SHORT(p) ((p)[0] | ((p)[1] << 8))\n/** Converts an unaligned two-byte little-endian integer into an int16 as a signed value */\n/** Converts an int16 into an unaligned two-byte little-endian integer */\n#define SHORT_TO_SW(s, p) \\\n  (p)[0] = (s); \\\n  (p)[1] = (s) >> 8;\n/** Converts an int32 into an unaligned four-byte little-endian integer */\n#define INT_TO_DW(i, p) \\\n  (p)[0] = (i); \\\n  (p)[1] = (i) >> 8; \\\n  (p)[2] = (i) >> 16; \\\n  (p)[3] = (i) >> 24;\n/** Converts an int64 into an unaligned 8-byte little-endian integer */\n#define LONG_TO_QW(i, p) \\\n  (p)[0] = (i); \\\n  (p)[1] = (i) >> 8; \\\n  (p)[2] = (i) >> 16; \\\n  (p)[3] = (i) >> 24; \\\n  (p)[4] = (i) >> 32; \\\n  (p)[5] = (i) >> 40; \\\n  (p)[6] = (i) >> 48; \\\n  (p)[7] = (i) >> 56;\n\n\n/** Selects the nth item in a doubly linked list. n=-1 selects the last item. */\n#define DL_NTH(head, out, n) \\\n  do { \\\n    int dl_nth_i = 0; \\\n    LDECLTYPE(head) dl_nth_p = (head); \\\n    if ((n) < 0) { \\\n      while (dl_nth_p && dl_nth_i > (n)) { \\\n        dl_nth_p = dl_nth_p->prev; \\\n        dl_nth_i--; \\\n      } \\\n    } else { \\\n      while (dl_nth_p && dl_nth_i < (n)) { \\\n        dl_nth_p = dl_nth_p->next; \\\n        dl_nth_i++; \\\n      } \\\n    } \\\n    (out) = dl_nth_p; \\\n  } while (0);\n\n#ifdef UVC_DEBUGGING\n#include <libgen.h>\n#ifdef __ANDROID__\t// add for android saki@sereneginat\n\t#define UVC_DEBUG(...) LOGD(__VA_ARGS__)\n\t#define UVC_ENTER() LOGD(\"[%s:%d] begin %s\", basename(__FILE__), __LINE__, __FUNCTION__)\n\t#define UVC_EXIT(code) LOGD(\"[%s:%d] end %s (%d)\", basename(__FILE__), __LINE__, __FUNCTION__, code)\n\t#define UVC_EXIT_VOID() LOGD(\"[%s:%d] end %s\", basename(__FILE__), __LINE__, __FUNCTION__)\n#else\n\t#define UVC_DEBUG(format, ...) fprintf(stderr, \"[%s:%d/%s] \" format \"\\n\", basename(__FILE__), __LINE__, __FUNCTION__, ##__VA_ARGS__)\n\t#define UVC_ENTER() fprintf(stderr, \"[%s:%d] begin %s\\n\", basename(__FILE__), __LINE__, __FUNCTION__)\n\t#define UVC_EXIT(code) fprintf(stderr, \"[%s:%d] end %s (%d)\\n\", basename(__FILE__), __LINE__, __FUNCTION__, code)\n\t#define UVC_EXIT_VOID() fprintf(stderr, \"[%s:%d] end %s\\n\", basename(__FILE__), __LINE__, __FUNCTION__)\n#endif\n#else\n\t#define UVC_DEBUG(...)\n\t#define UVC_ENTER()\n\t#define UVC_EXIT(code)\n\t#define UVC_EXIT_VOID()\n#endif\n\n/* http://stackoverflow.com/questions/19452971/array-size-macro-that-rejects-pointers */\n#define IS_INDEXABLE(arg) (sizeof(arg[0]))\n#define IS_ARRAY(arg) (IS_INDEXABLE(arg) && (((void *) &arg) == ((void *) arg)))\n#define ARRAYSIZE(arr) (sizeof(arr) / (IS_ARRAY(arr) ? sizeof(arr[0]) : 0))\n\n/** Video interface subclass code (A.2) */\nenum uvc_int_subclass_code {\n  UVC_SC_UNDEFINED = 0x00,\n  UVC_SC_VIDEOCONTROL = 0x01,\n  UVC_SC_VIDEOSTREAMING = 0x02,\n  UVC_SC_VIDEO_INTERFACE_COLLECTION = 0x03\n};\n\n/** Video interface protocol code (A.3) */\nenum uvc_int_proto_code {\n  UVC_PC_PROTOCOL_UNDEFINED = 0x00\n};\n\n/** VideoControl interface descriptor subtype (A.5) */\nenum uvc_vc_desc_subtype {\n  UVC_VC_DESCRIPTOR_UNDEFINED = 0x00,\n  UVC_VC_HEADER = 0x01,\n  UVC_VC_INPUT_TERMINAL = 0x02,\n  UVC_VC_OUTPUT_TERMINAL = 0x03,\n  UVC_VC_SELECTOR_UNIT = 0x04,\n  UVC_VC_PROCESSING_UNIT = 0x05,\n  UVC_VC_EXTENSION_UNIT = 0x06\n};\n\n/** UVC endpoint descriptor subtype (A.7) */\nenum uvc_ep_desc_subtype {\n  UVC_EP_UNDEFINED = 0x00,\n  UVC_EP_GENERAL = 0x01,\n  UVC_EP_ENDPOINT = 0x02,\n  UVC_EP_INTERRUPT = 0x03\n};\n\n/** VideoControl interface control selector (A.9.1) */\nenum uvc_vc_ctrl_selector {\n  UVC_VC_CONTROL_UNDEFINED = 0x00,\n  UVC_VC_VIDEO_POWER_MODE_CONTROL = 0x01,\n  UVC_VC_REQUEST_ERROR_CODE_CONTROL = 0x02\n};\n\n/** Terminal control selector (A.9.2) */\nenum uvc_term_ctrl_selector {\n  UVC_TE_CONTROL_UNDEFINED = 0x00\n};\n\n/** Selector unit control selector (A.9.3) */\nenum uvc_su_ctrl_selector {\n  UVC_SU_CONTROL_UNDEFINED = 0x00,\n  UVC_SU_INPUT_SELECT_CONTROL = 0x01\n};\n\n/** Extension unit control selector (A.9.6) */\nenum uvc_xu_ctrl_selector {\n  UVC_XU_CONTROL_UNDEFINED = 0x00\n};\n\n/** VideoStreaming interface control selector (A.9.7) */\nenum uvc_vs_ctrl_selector {\n  UVC_VS_CONTROL_UNDEFINED = 0x00,\n  UVC_VS_PROBE_CONTROL = 0x01,\n  UVC_VS_COMMIT_CONTROL = 0x02,\n  UVC_VS_STILL_PROBE_CONTROL = 0x03,\n  UVC_VS_STILL_COMMIT_CONTROL = 0x04,\n  UVC_VS_STILL_IMAGE_TRIGGER_CONTROL = 0x05,\n  UVC_VS_STREAM_ERROR_CODE_CONTROL = 0x06,\n  UVC_VS_GENERATE_KEY_FRAME_CONTROL = 0x07,\n  UVC_VS_UPDATE_FRAME_SEGMENT_CONTROL = 0x08,\n  UVC_VS_SYNC_DELAY_CONTROL = 0x09\n};\n\n/** Status packet type (2.4.2.2) */\nenum uvc_status_type {\n  UVC_STATUS_TYPE_CONTROL = 1,\n  UVC_STATUS_TYPE_STREAMING = 2\n};\n\n/** Payload header flags (2.4.3.3) */\n#define UVC_STREAM_EOH (1 << 7)\n#define UVC_STREAM_ERR (1 << 6)\n#define UVC_STREAM_STI (1 << 5)\n#define UVC_STREAM_RES (1 << 4)\n#define UVC_STREAM_SCR (1 << 3)\n#define UVC_STREAM_PTS (1 << 2)\n#define UVC_STREAM_EOF (1 << 1)\n#define UVC_STREAM_FID (1 << 0)\n\n/** Control capabilities (4.1.2) */\n#define UVC_CONTROL_CAP_GET (1 << 0)\n#define UVC_CONTROL_CAP_SET (1 << 1)\n#define UVC_CONTROL_CAP_DISABLED (1 << 2)\n#define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3)\n#define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4)\n\nstruct uvc_streaming_interface;\nstruct uvc_device_info;\n\n/** VideoStream interface */\ntypedef struct uvc_streaming_interface {\n  struct uvc_device_info *parent;\n  struct uvc_streaming_interface *prev, *next;\n  /** Interface number */\n  uint8_t bInterfaceNumber;\n  /** Video formats that this interface provides */\n  struct uvc_format_desc *format_descs;\n  /** USB endpoint to use when communicating with this interface */\n  uint8_t bEndpointAddress;\n  uint8_t bTerminalLink;\n  uint8_t bmInfo;\t// XXX\n  uint8_t bStillCaptureMethod;\t// XXX\n  uint8_t bTriggerSupport;\t// XXX\n  uint8_t bTriggerUsage;\t// XXX\n  uint64_t *bmaControls;\t// XXX\n} uvc_streaming_interface_t;\n\n/** VideoControl interface */\ntypedef struct uvc_control_interface {\n  struct uvc_device_info *parent;\n  struct uvc_input_terminal *input_term_descs;\n  struct uvc_output_terminal *output_term_descs;\n  struct uvc_processing_unit *processing_unit_descs;\n  struct uvc_extension_unit *extension_unit_descs;\n  uint16_t bcdUVC;\n  uint8_t bEndpointAddress;\n  /** Interface number */\n  uint8_t bInterfaceNumber;\n} uvc_control_interface_t;\n\nstruct uvc_stream_ctrl;\n\nstruct uvc_device {\n  struct uvc_context *ctx;\n  int ref;\n  libusb_device *usb_dev;\n};\n\ntypedef struct uvc_device_info {\n  /** Configuration descriptor for USB device */\n  struct libusb_config_descriptor *config;\n  /** VideoControl interface provided by device */\n  uvc_control_interface_t ctrl_if;\n  /** VideoStreaming interfaces on the device */\n  uvc_streaming_interface_t *stream_ifs;\n} uvc_device_info_t;\n\n/*\n  set a high number of transfer buffers. This uses a lot of ram, but\n  avoids problems with scheduling delays on slow boards causing missed\n  transfers. A better approach may be to make the transfer thread FIFO\n  scheduled (if we have root).\n  We could/should change this to allow reduce it to, say, 5 by default\n  and then allow the user to change the number of buffers as required.\n */\n#define LIBUVC_NUM_TRANSFER_BUFS 10\n\n#define LIBUVC_XFER_BUF_SIZE\t( 16 * 1024 * 1024 )\n\nstruct uvc_stream_handle {\n  struct uvc_device_handle *devh;\n  struct uvc_stream_handle *prev, *next;\n  struct uvc_streaming_interface *stream_if;\n\n  /** if true, stream is running (streaming video to host) */\n  uint8_t running;\n  /** Current control block */\n  struct uvc_stream_ctrl cur_ctrl;\n\n  /* listeners may only access hold*, and only when holding a \n   * lock on cb_mutex (probably signaled with cb_cond) */\n  uint8_t bfh_err, hold_bfh_err;\t// XXX added to keep UVC_STREAM_ERR\n  uint8_t fid;\n  uint32_t seq, hold_seq;\n  uint32_t pts, hold_pts;\n  uint32_t last_scr, hold_last_scr;\n  size_t got_bytes, hold_bytes;\n  size_t size_buf;\t// XXX add for boundary check\n  uint8_t *outbuf, *holdbuf;\n  pthread_mutex_t cb_mutex;\n  pthread_cond_t cb_cond;\n  pthread_t cb_thread;\n  uint32_t last_polled_seq;\n  uvc_frame_callback_t *user_cb;\n  void *user_ptr;\n  struct libusb_transfer *transfers[LIBUVC_NUM_TRANSFER_BUFS];\n  uint8_t *transfer_bufs[LIBUVC_NUM_TRANSFER_BUFS];\n  struct uvc_frame frame;\n  enum uvc_frame_format frame_format;\n};\n\n/** Handle on an open UVC device\n *\n * @todo move most of this into a uvc_device struct?\n */\nstruct uvc_device_handle {\n  struct uvc_device *dev;\n  struct uvc_device_handle *prev, *next;\n  /** Underlying USB device handle */\n  libusb_device_handle *usb_devh;\n  struct uvc_device_info *info;\n  struct libusb_transfer *status_xfer;\n  pthread_mutex_t status_mutex;\t// XXX saki\n  uint8_t status_buf[32];\n  /** Function to call when we receive status updates from the camera */\n  uvc_status_callback_t *status_cb;\n  void *status_user_ptr;\n  /** Function to call when we receive button events from the camera */\n  uvc_button_callback_t *button_cb;\n  void *button_user_ptr;\n\n  uvc_stream_handle_t *streams;\n  /** Whether the camera is an iSight that sends one header per frame */\n  uint8_t is_isight;\n  uint8_t reset_on_release_if;\t// XXX whether interface alt setting needs to reset to 0.\n};\n\n/** Context within which we communicate with devices */\nstruct uvc_context {\n  /** Underlying context for USB communication */\n  struct libusb_context *usb_ctx;\n  /** True if libuvc initialized the underlying USB context */\n  uint8_t own_usb_ctx;\n  /** List of open devices in this context */\n  uvc_device_handle_t *open_devices;\n  pthread_t handler_thread;\n  uint8_t kill_handler_thread;\n};\n\nuvc_error_t uvc_query_stream_ctrl(\n    uvc_device_handle_t *devh,\n    uvc_stream_ctrl_t *ctrl,\n    uint8_t probe,\n    enum uvc_req_code req);\n\nvoid uvc_start_handler_thread(uvc_context_t *ctx);\nuvc_error_t uvc_claim_if(uvc_device_handle_t *devh, int idx);\nuvc_error_t uvc_release_if(uvc_device_handle_t *devh, int idx);\n\n#endif // !def(LIBUVC_INTERNAL_H)\n/** @endcond */\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/include/libuvc/libuvc_internal_original.h",
    "content": "/** @file libuvc_internal.h\n  * @brief Implementation-specific UVC constants and structures.\n  * @cond include_hidden\n  */\n#ifndef LIBUVC_INTERNAL_H\n#define LIBUVC_INTERNAL_H\n\n#include <assert.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <pthread.h>\n#include <signal.h>\n#include \"utlist.h\"\n\n/** Converts an unaligned four-byte little-endian integer into an int32 */\n#define DW_TO_INT(p) ((p)[0] | ((p)[1] << 8) | ((p)[2] << 16) | ((p)[3] << 24))\n/** Converts an unaligned two-byte little-endian integer into an int16 */\n#define SW_TO_SHORT(p) ((p)[0] | ((p)[1] << 8))\n/** Converts an int16 into an unaligned two-byte little-endian integer */\n#define SHORT_TO_SW(s, p) \\\n  (p)[0] = (s); \\\n  (p)[1] = (s) >> 8;\n/** Converts an int32 into an unaligned four-byte little-endian integer */\n#define INT_TO_DW(i, p) \\\n  (p)[0] = (i); \\\n  (p)[1] = (i) >> 8; \\\n  (p)[2] = (i) >> 16; \\\n  (p)[3] = (i) >> 24;\n\n/** Selects the nth item in a doubly linked list. n=-1 selects the last item. */\n#define DL_NTH(head, out, n) \\\n  do { \\\n    int dl_nth_i = 0; \\\n    LDECLTYPE(head) dl_nth_p = (head); \\\n    if ((n) < 0) { \\\n      while (dl_nth_p && dl_nth_i > (n)) { \\\n        dl_nth_p = dl_nth_p->prev; \\\n        dl_nth_i--; \\\n      } \\\n    } else { \\\n      while (dl_nth_p && dl_nth_i < (n)) { \\\n        dl_nth_p = dl_nth_p->next; \\\n        dl_nth_i++; \\\n      } \\\n    } \\\n    (out) = dl_nth_p; \\\n  } while (0);\n\n#ifdef UVC_DEBUGGING\n#include <libgen.h>\n#define UVC_DEBUG(format, ...) fprintf(stderr, \"[%s:%d/%s] \" format \"\\n\", basename(__FILE__), __LINE__, __FUNCTION__, ##__VA_ARGS__)\n#define UVC_ENTER() fprintf(stderr, \"[%s:%d] begin %s\\n\", basename(__FILE__), __LINE__, __FUNCTION__)\n#define UVC_EXIT(code) fprintf(stderr, \"[%s:%d] end %s (%d)\\n\", basename(__FILE__), __LINE__, __FUNCTION__, code)\n#define UVC_EXIT_VOID() fprintf(stderr, \"[%s:%d] end %s\\n\", basename(__FILE__), __LINE__, __FUNCTION__)\n#else\n#define UVC_DEBUG(format, ...)\n#define UVC_ENTER()\n#define UVC_EXIT_VOID()\n#define UVC_EXIT(code)\n#endif\n\n/* http://stackoverflow.com/questions/19452971/array-size-macro-that-rejects-pointers */\n#define IS_INDEXABLE(arg) (sizeof(arg[0]))\n#define IS_ARRAY(arg) (IS_INDEXABLE(arg) && (((void *) &arg) == ((void *) arg)))\n#define ARRAYSIZE(arr) (sizeof(arr) / (IS_ARRAY(arr) ? sizeof(arr[0]) : 0))\n\n/** Video interface subclass code (A.2) */\nenum uvc_int_subclass_code {\n  UVC_SC_UNDEFINED = 0x00,\n  UVC_SC_VIDEOCONTROL = 0x01,\n  UVC_SC_VIDEOSTREAMING = 0x02,\n  UVC_SC_VIDEO_INTERFACE_COLLECTION = 0x03\n};\n\n/** Video interface protocol code (A.3) */\nenum uvc_int_proto_code {\n  UVC_PC_PROTOCOL_UNDEFINED = 0x00\n};\n\n/** VideoControl interface descriptor subtype (A.5) */\nenum uvc_vc_desc_subtype {\n  UVC_VC_DESCRIPTOR_UNDEFINED = 0x00,\n  UVC_VC_HEADER = 0x01,\n  UVC_VC_INPUT_TERMINAL = 0x02,\n  UVC_VC_OUTPUT_TERMINAL = 0x03,\n  UVC_VC_SELECTOR_UNIT = 0x04,\n  UVC_VC_PROCESSING_UNIT = 0x05,\n  UVC_VC_EXTENSION_UNIT = 0x06\n};\n\n/** VideoStreaming interface descriptor subtype (A.6) */\nenum uvc_vs_desc_subtype {\n  UVC_VS_UNDEFINED = 0x00,\n  UVC_VS_INPUT_HEADER = 0x01,\n  UVC_VS_OUTPUT_HEADER = 0x02,\n  UVC_VS_STILL_IMAGE_FRAME = 0x03,\n  UVC_VS_FORMAT_UNCOMPRESSED = 0x04,\n  UVC_VS_FRAME_UNCOMPRESSED = 0x05,\n  UVC_VS_FORMAT_MJPEG = 0x06,\n  UVC_VS_FRAME_MJPEG = 0x07,\n  UVC_VS_FORMAT_MPEG2TS = 0x0a,\n  UVC_VS_FORMAT_DV = 0x0c,\n  UVC_VS_COLORFORMAT = 0x0d,\n  UVC_VS_FORMAT_FRAME_BASED = 0x10,\n  UVC_VS_FRAME_FRAME_BASED = 0x11,\n  UVC_VS_FORMAT_STREAM_BASED = 0x12\n};\n\n/** UVC endpoint descriptor subtype (A.7) */\nenum uvc_ep_desc_subtype {\n  UVC_EP_UNDEFINED = 0x00,\n  UVC_EP_GENERAL = 0x01,\n  UVC_EP_ENDPOINT = 0x02,\n  UVC_EP_INTERRUPT = 0x03\n};\n\n/** VideoControl interface control selector (A.9.1) */\nenum uvc_vc_ctrl_selector {\n  UVC_VC_CONTROL_UNDEFINED = 0x00,\n  UVC_VC_VIDEO_POWER_MODE_CONTROL = 0x01,\n  UVC_VC_REQUEST_ERROR_CODE_CONTROL = 0x02\n};\n\n/** Terminal control selector (A.9.2) */\nenum uvc_term_ctrl_selector {\n  UVC_TE_CONTROL_UNDEFINED = 0x00\n};\n\n/** Selector unit control selector (A.9.3) */\nenum uvc_su_ctrl_selector {\n  UVC_SU_CONTROL_UNDEFINED = 0x00,\n  UVC_SU_INPUT_SELECT_CONTROL = 0x01\n};\n\n/** Extension unit control selector (A.9.6) */\nenum uvc_xu_ctrl_selector {\n  UVC_XU_CONTROL_UNDEFINED = 0x00\n};\n\n/** VideoStreaming interface control selector (A.9.7) */\nenum uvc_vs_ctrl_selector {\n  UVC_VS_CONTROL_UNDEFINED = 0x00,\n  UVC_VS_PROBE_CONTROL = 0x01,\n  UVC_VS_COMMIT_CONTROL = 0x02,\n  UVC_VS_STILL_PROBE_CONTROL = 0x03,\n  UVC_VS_STILL_COMMIT_CONTROL = 0x04,\n  UVC_VS_STILL_IMAGE_TRIGGER_CONTROL = 0x05,\n  UVC_VS_STREAM_ERROR_CODE_CONTROL = 0x06,\n  UVC_VS_GENERATE_KEY_FRAME_CONTROL = 0x07,\n  UVC_VS_UPDATE_FRAME_SEGMENT_CONTROL = 0x08,\n  UVC_VS_SYNC_DELAY_CONTROL = 0x09\n};\n\n/** Status packet type (2.4.2.2) */\nenum uvc_status_type {\n  UVC_STATUS_TYPE_CONTROL = 1,\n  UVC_STATUS_TYPE_STREAMING = 2\n};\n\n/** Payload header flags (2.4.3.3) */\n#define UVC_STREAM_EOH (1 << 7)\n#define UVC_STREAM_ERR (1 << 6)\n#define UVC_STREAM_STI (1 << 5)\n#define UVC_STREAM_RES (1 << 4)\n#define UVC_STREAM_SCR (1 << 3)\n#define UVC_STREAM_PTS (1 << 2)\n#define UVC_STREAM_EOF (1 << 1)\n#define UVC_STREAM_FID (1 << 0)\n\n/** Control capabilities (4.1.2) */\n#define UVC_CONTROL_CAP_GET (1 << 0)\n#define UVC_CONTROL_CAP_SET (1 << 1)\n#define UVC_CONTROL_CAP_DISABLED (1 << 2)\n#define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3)\n#define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4)\n\nstruct uvc_format_desc;\nstruct uvc_frame_desc;\nstruct uvc_streaming_interface;\nstruct uvc_device_info;\n\n/** Frame descriptor\n *\n * A \"frame\" is a configuration of a streaming format\n * for a particular image size at one of possibly several\n * available frame rates.\n */\ntypedef struct uvc_frame_desc {\n  struct uvc_format_desc *parent;\n  struct uvc_frame_desc *prev, *next;\n  /** Type of frame, such as JPEG frame or uncompressed frme */\n  enum uvc_vs_desc_subtype bDescriptorSubtype;\n  /** Index of the frame within the list of specs available for this format */\n  uint8_t bFrameIndex;\n  uint8_t bmCapabilities;\n  /** Image width */\n  uint16_t wWidth;\n  /** Image height */\n  uint16_t wHeight;\n  /** Bitrate of corresponding stream at minimal frame rate */\n  uint32_t dwMinBitRate;\n  /** Bitrate of corresponding stream at maximal frame rate */\n  uint32_t dwMaxBitRate;\n  /** Maximum number of bytes for a video frame */\n  uint32_t dwMaxVideoFrameBufferSize;\n  /** Default frame interval (in 100ns units) */\n  uint32_t dwDefaultFrameInterval;\n  /** Minimum frame interval for continuous mode (100ns units) */\n  uint32_t dwMinFrameInterval;\n  /** Maximum frame interval for continuous mode (100ns units) */\n  uint32_t dwMaxFrameInterval;\n  /** Granularity of frame interval range for continuous mode (100ns) */\n  uint32_t dwFrameIntervalStep;\n  /** Available frame rates, zero-terminated (in 100ns units) */\n  uint32_t *intervals;\n} uvc_frame_desc_t;\n\n/** Format descriptor\n *\n * A \"format\" determines a stream's image type (e.g., raw YUYV or JPEG)\n * and includes many \"frame\" configurations.\n */\ntypedef struct uvc_format_desc {\n  struct uvc_streaming_interface *parent;\n  struct uvc_format_desc *prev, *next;\n  /** Type of image stream, such as JPEG or uncompressed. */\n  enum uvc_vs_desc_subtype bDescriptorSubtype;\n  /** Identifier of this format within the VS interface's format list */\n  uint8_t bFormatIndex;\n  /** Format specifier */\n  union {\n    uint8_t guidFormat[16];\n    uint8_t fourccFormat[4];\n  };\n  /** Format-specific data */\n  union {\n    /** BPP for uncompressed stream */\n    uint8_t bBitsPerPixel;\n    /** Flags for JPEG stream */\n    uint8_t bmFlags;\n  };\n  /** Default {uvc_frame_desc} to choose given this format */\n  uint8_t bDefaultFrameIndex;\n  uint8_t bAspectRatioX;\n  uint8_t bAspectRatioY;\n  uint8_t bmInterlaceFlags;\n  uint8_t bCopyProtect;\n  /** Available frame specifications for this format */\n  struct uvc_frame_desc *frame_descs;\n} uvc_format_desc_t;\n\n\n/** VideoStream interface */\ntypedef struct uvc_streaming_interface {\n  struct uvc_device_info *parent;\n  struct uvc_streaming_interface *prev, *next;\n  /** Interface number */\n  uint8_t bInterfaceNumber;\n  /** Video formats that this interface provides */\n  struct uvc_format_desc *format_descs;\n  /** USB endpoint to use when communicating with this interface */\n  uint8_t bEndpointAddress;\n  uint8_t bTerminalLink;\n} uvc_streaming_interface_t;\n\n/** VideoControl interface */\ntypedef struct uvc_control_interface {\n  struct uvc_device_info *parent;\n  struct uvc_input_terminal *input_term_descs;\n  // struct uvc_output_terminal *output_term_descs;\n  struct uvc_processing_unit *processing_unit_descs;\n  struct uvc_extension_unit *extension_unit_descs;\n  uint16_t bcdUVC;\n  uint8_t bEndpointAddress;\n  /** Interface number */\n  uint8_t bInterfaceNumber;\n} uvc_control_interface_t;\n\nstruct uvc_stream_ctrl;\n\nstruct uvc_device {\n  struct uvc_context *ctx;\n  int ref;\n  libusb_device *usb_dev;\n};\n\ntypedef struct uvc_device_info {\n  /** Configuration descriptor for USB device */\n  struct libusb_config_descriptor *config;\n  /** VideoControl interface provided by device */\n  uvc_control_interface_t ctrl_if;\n  /** VideoStreaming interfaces on the device */\n  uvc_streaming_interface_t *stream_ifs;\n} uvc_device_info_t;\n\nstruct uvc_stream_handle {\n  struct uvc_device_handle *devh;\n  struct uvc_stream_handle *prev, *next;\n  struct uvc_streaming_interface *stream_if;\n\n  /** if true, stream is running (streaming video to host) */\n  uint8_t running;\n  /** Current control block */\n  struct uvc_stream_ctrl cur_ctrl;\n\n  /* listeners may only access hold*, and only when holding a \n   * lock on cb_mutex (probably signaled with cb_cond) */\n  uint8_t fid;\n  uint32_t seq, hold_seq;\n  uint32_t pts, hold_pts;\n  uint32_t last_scr, hold_last_scr;\n  size_t got_bytes, hold_bytes;\n  uint8_t *outbuf, *holdbuf;\n  pthread_mutex_t cb_mutex;\n  pthread_cond_t cb_cond;\n  pthread_t cb_thread;\n  uint32_t last_polled_seq;\n  uvc_frame_callback_t *user_cb;\n  void *user_ptr;\n  struct libusb_transfer *transfers[5];\n  uint8_t *transfer_bufs[5];\n  struct uvc_frame frame;\n  enum uvc_frame_format frame_format;\n};\n\n/** Handle on an open UVC device\n *\n * @todo move most of this into a uvc_device struct?\n */\nstruct uvc_device_handle {\n  struct uvc_device *dev;\n  struct uvc_device_handle *prev, *next;\n  /** Underlying USB device handle */\n  libusb_device_handle *usb_devh;\n  struct uvc_device_info *info;\n  struct libusb_transfer *status_xfer;\n  uint8_t status_buf[32];\n  /** Function to call when we receive status updates from the camera */\n  uvc_status_callback_t *status_cb;\n  void *status_user_ptr;\n\n  uvc_stream_handle_t *streams;\n  /** Whether the camera is an iSight that sends one header per frame */\n  uint8_t is_isight;\n};\n\n/** Context within which we communicate with devices */\nstruct uvc_context {\n  /** Underlying context for USB communication */\n  struct libusb_context *usb_ctx;\n  /** True iff libuvc initialized the underlying USB context */\n  uint8_t own_usb_ctx;\n  /** List of open devices in this context */\n  uvc_device_handle_t *open_devices;\n  pthread_t handler_thread;\n  uint8_t kill_handler_thread;\n};\n\nuvc_error_t uvc_query_stream_ctrl(\n    uvc_device_handle_t *devh,\n    uvc_stream_ctrl_t *ctrl,\n    uint8_t probe,\n    enum uvc_req_code req);\n\nvoid uvc_start_handler_thread(uvc_context_t *ctx);\nuvc_error_t uvc_claim_if(uvc_device_handle_t *devh, int idx);\nuvc_error_t uvc_release_if(uvc_device_handle_t *devh, int idx);\n\n#endif // !def(LIBUVC_INTERNAL_H)\n/** @endcond */\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/include/libuvc/libuvc_original.h",
    "content": "#ifndef LIBUVC_H\n#define LIBUVC_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include <stdio.h> // FILE\n#include <libusb-1.0/libusb.h>\n#include <libuvc/libuvc_config.h>\n\n/** UVC error types, based on libusb errors\n * @ingroup diag\n */\ntypedef enum uvc_error {\n  /** Success (no error) */\n  UVC_SUCCESS = 0,\n  /** Input/output error */\n  UVC_ERROR_IO = -1,\n  /** Invalid parameter */\n  UVC_ERROR_INVALID_PARAM = -2,\n  /** Access denied */\n  UVC_ERROR_ACCESS = -3,\n  /** No such device */\n  UVC_ERROR_NO_DEVICE = -4,\n  /** Entity not found */\n  UVC_ERROR_NOT_FOUND = -5,\n  /** Resource busy */\n  UVC_ERROR_BUSY = -6,\n  /** Operation timed out */\n  UVC_ERROR_TIMEOUT = -7,\n  /** Overflow */\n  UVC_ERROR_OVERFLOW = -8,\n  /** Pipe error */\n  UVC_ERROR_PIPE = -9,\n  /** System call interrupted */\n  UVC_ERROR_INTERRUPTED = -10,\n  /** Insufficient memory */\n  UVC_ERROR_NO_MEM = -11,\n  /** Operation not supported */\n  UVC_ERROR_NOT_SUPPORTED = -12,\n  /** Device is not UVC-compliant */\n  UVC_ERROR_INVALID_DEVICE = -50,\n  /** Mode not supported */\n  UVC_ERROR_INVALID_MODE = -51,\n  /** Resource has a callback (can't use polling and async) */\n  UVC_ERROR_CALLBACK_EXISTS = -52,\n  /** Undefined error */\n  UVC_ERROR_OTHER = -99\n} uvc_error_t;\n\n/** Color coding of stream, transport-independent\n * @ingroup streaming\n */\nenum uvc_frame_format {\n  UVC_FRAME_FORMAT_UNKNOWN = 0,\n  /** Any supported format */\n  UVC_FRAME_FORMAT_ANY = 0,\n  UVC_FRAME_FORMAT_UNCOMPRESSED,\n  UVC_FRAME_FORMAT_COMPRESSED,\n  /** YUYV/YUV2/YUV422: YUV encoding with one luminance value per pixel and\n   * one UV (chrominance) pair for every two pixels.\n   */\n  UVC_FRAME_FORMAT_YUYV,\n  UVC_FRAME_FORMAT_UYVY,\n  /** 24-bit RGB */\n  UVC_FRAME_FORMAT_RGB,\n  UVC_FRAME_FORMAT_BGR,\n  /** Motion-JPEG (or JPEG) encoded images */\n  UVC_FRAME_FORMAT_MJPEG,\n  UVC_FRAME_FORMAT_GRAY8,\n  /** Number of formats understood */\n  UVC_FRAME_FORMAT_COUNT,\n};\n\n/* UVC_COLOR_FORMAT_* have been replaced with UVC_FRAME_FORMAT_*. Please use\n * UVC_FRAME_FORMAT_* instead of using these. */\n#define UVC_COLOR_FORMAT_UNKNOWN UVC_FRAME_FORMAT_UNKNOWN\n#define UVC_COLOR_FORMAT_UNCOMPRESSED UVC_FRAME_FORMAT_UNCOMPRESSED\n#define UVC_COLOR_FORMAT_COMPRESSED UVC_FRAME_FORMAT_COMPRESSED\n#define UVC_COLOR_FORMAT_YUYV UVC_FRAME_FORMAT_YUYV\n#define UVC_COLOR_FORMAT_UYVY UVC_FRAME_FORMAT_UYVY\n#define UVC_COLOR_FORMAT_RGB UVC_FRAME_FORMAT_RGB\n#define UVC_COLOR_FORMAT_BGR UVC_FRAME_FORMAT_BGR\n#define UVC_COLOR_FORMAT_MJPEG UVC_FRAME_FORMAT_MJPEG\n#define UVC_COLOR_FORMAT_GRAY8 UVC_FRAME_FORMAT_GRAY8\n\n/** UVC request code (A.8) */\nenum uvc_req_code {\n  UVC_RC_UNDEFINED = 0x00,\n  UVC_SET_CUR = 0x01,\n  UVC_GET_CUR = 0x81,\n  UVC_GET_MIN = 0x82,\n  UVC_GET_MAX = 0x83,\n  UVC_GET_RES = 0x84,\n  UVC_GET_LEN = 0x85,\n  UVC_GET_INFO = 0x86,\n  UVC_GET_DEF = 0x87\n};\n\nenum uvc_device_power_mode {\n  UVC_VC_VIDEO_POWER_MODE_FULL = 0x000b,\n  UVC_VC_VIDEO_POWER_MODE_DEVICE_DEPENDENT = 0x001b,\n};\n\n/** Camera terminal control selector (A.9.4) */\nenum uvc_ct_ctrl_selector {\n  UVC_CT_CONTROL_UNDEFINED = 0x00,\n  UVC_CT_SCANNING_MODE_CONTROL = 0x01,\n  UVC_CT_AE_MODE_CONTROL = 0x02,\n  UVC_CT_AE_PRIORITY_CONTROL = 0x03,\n  UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL = 0x04,\n  UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL = 0x05,\n  UVC_CT_FOCUS_ABSOLUTE_CONTROL = 0x06,\n  UVC_CT_FOCUS_RELATIVE_CONTROL = 0x07,\n  UVC_CT_FOCUS_AUTO_CONTROL = 0x08,\n  UVC_CT_IRIS_ABSOLUTE_CONTROL = 0x09,\n  UVC_CT_IRIS_RELATIVE_CONTROL = 0x0a,\n  UVC_CT_ZOOM_ABSOLUTE_CONTROL = 0x0b,\n  UVC_CT_ZOOM_RELATIVE_CONTROL = 0x0c,\n  UVC_CT_PANTILT_ABSOLUTE_CONTROL = 0x0d,\n  UVC_CT_PANTILT_RELATIVE_CONTROL = 0x0e,\n  UVC_CT_ROLL_ABSOLUTE_CONTROL = 0x0f,\n  UVC_CT_ROLL_RELATIVE_CONTROL = 0x10,\n  UVC_CT_PRIVACY_CONTROL = 0x11\n};\n\n/** Processing unit control selector (A.9.5) */\nenum uvc_pu_ctrl_selector {\n  UVC_PU_CONTROL_UNDEFINED = 0x00,\n  UVC_PU_BACKLIGHT_COMPENSATION_CONTROL = 0x01,\n  UVC_PU_BRIGHTNESS_CONTROL = 0x02,\n  UVC_PU_CONTRAST_CONTROL = 0x03,\n  UVC_PU_GAIN_CONTROL = 0x04,\n  UVC_PU_POWER_LINE_FREQUENCY_CONTROL = 0x05,\n  UVC_PU_HUE_CONTROL = 0x06,\n  UVC_PU_SATURATION_CONTROL = 0x07,\n  UVC_PU_SHARPNESS_CONTROL = 0x08,\n  UVC_PU_GAMMA_CONTROL = 0x09,\n  UVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL = 0x0a,\n  UVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL = 0x0b,\n  UVC_PU_WHITE_BALANCE_COMPONENT_CONTROL = 0x0c,\n  UVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL = 0x0d,\n  UVC_PU_DIGITAL_MULTIPLIER_CONTROL = 0x0e,\n  UVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL = 0x0f,\n  UVC_PU_HUE_AUTO_CONTROL = 0x10,\n  UVC_PU_ANALOG_VIDEO_STANDARD_CONTROL = 0x11,\n  UVC_PU_ANALOG_LOCK_STATUS_CONTROL = 0x12\n};\n\n/** USB terminal type (B.1) */\nenum uvc_term_type {\n  UVC_TT_VENDOR_SPECIFIC = 0x0100,\n  UVC_TT_STREAMING = 0x0101\n};\n\n/** Input terminal type (B.2) */\nenum uvc_it_type {\n  UVC_ITT_VENDOR_SPECIFIC = 0x0200,\n  UVC_ITT_CAMERA = 0x0201,\n  UVC_ITT_MEDIA_TRANSPORT_INPUT = 0x0202\n};\n\n/** Output terminal type (B.3) */\nenum uvc_ot_type {\n  UVC_OTT_VENDOR_SPECIFIC = 0x0300,\n  UVC_OTT_DISPLAY = 0x0301,\n  UVC_OTT_MEDIA_TRANSPORT_OUTPUT = 0x0302\n};\n\n/** External terminal type (B.4) */\nenum uvc_et_type {\n  UVC_EXTERNAL_VENDOR_SPECIFIC = 0x0400,\n  UVC_COMPOSITE_CONNECTOR = 0x0401,\n  UVC_SVIDEO_CONNECTOR = 0x0402,\n  UVC_COMPONENT_CONNECTOR = 0x0403\n};\n\n/** Context, equivalent to libusb's contexts.\n *\n * May either own a libusb context or use one that's already made.\n *\n * Always create these with uvc_get_context.\n */\nstruct uvc_context;\ntypedef struct uvc_context uvc_context_t;\n\n/** UVC device.\n *\n * Get this from uvc_get_device_list() or uvc_find_device().\n */\nstruct uvc_device;\ntypedef struct uvc_device uvc_device_t;\n\n/** Handle on an open UVC device.\n *\n * Get one of these from uvc_open(). Once you uvc_close()\n * it, it's no longer valid.\n */\nstruct uvc_device_handle;\ntypedef struct uvc_device_handle uvc_device_handle_t;\n\n/** Handle on an open UVC stream.\n *\n * Get one of these from uvc_stream_open*().\n * Once you uvc_stream_close() it, it will no longer be valid.\n */\nstruct uvc_stream_handle;\ntypedef struct uvc_stream_handle uvc_stream_handle_t;\n\n/** Representation of the interface that brings data into the UVC device */\ntypedef struct uvc_input_terminal {\n  struct uvc_input_terminal *prev, *next;\n  /** Index of the terminal within the device */\n  uint8_t bTerminalID;\n  /** Type of terminal (e.g., camera) */\n  enum uvc_it_type wTerminalType;\n  uint16_t wObjectiveFocalLengthMin;\n  uint16_t wObjectiveFocalLengthMax;\n  uint16_t wOcularFocalLength;\n  /** Camera controls (meaning of bits given in {uvc_ct_ctrl_selector}) */\n  uint64_t bmControls;\n} uvc_input_terminal_t;\n\ntypedef struct uvc_output_terminal {\n  struct uvc_output_terminal *prev, *next;\n  /** @todo */\n} uvc_output_terminal_t;\n\n/** Represents post-capture processing functions */\ntypedef struct uvc_processing_unit {\n  struct uvc_processing_unit *prev, *next;\n  /** Index of the processing unit within the device */\n  uint8_t bUnitID;\n  /** Index of the terminal from which the device accepts images */\n  uint8_t bSourceID;\n  /** Processing controls (meaning of bits given in {uvc_pu_ctrl_selector}) */\n  uint64_t bmControls;\n} uvc_processing_unit_t;\n\n/** Custom processing or camera-control functions */\ntypedef struct uvc_extension_unit {\n  struct uvc_extension_unit *prev, *next;\n  /** Index of the extension unit within the device */\n  uint8_t bUnitID;\n  /** GUID identifying the extension unit */\n  uint8_t guidExtensionCode[16];\n  /** Bitmap of available controls (manufacturer-dependent) */\n  uint64_t bmControls;\n} uvc_extension_unit_t;\n\nenum uvc_status_class {\n  UVC_STATUS_CLASS_CONTROL = 0x10,\n  UVC_STATUS_CLASS_CONTROL_CAMERA = 0x11,\n  UVC_STATUS_CLASS_CONTROL_PROCESSING = 0x12,\n};\n\nenum uvc_status_attribute {\n  UVC_STATUS_ATTRIBUTE_VALUE_CHANGE = 0x00,\n  UVC_STATUS_ATTRIBUTE_INFO_CHANGE = 0x01,\n  UVC_STATUS_ATTRIBUTE_FAILURE_CHANGE = 0x02,\n  UVC_STATUS_ATTRIBUTE_UNKNOWN = 0xff\n};\n\n/** A callback function to accept status updates\n * @ingroup device\n */\ntypedef void(uvc_status_callback_t)(enum uvc_status_class status_class,\n                                    int event,\n                                    int selector,\n                                    enum uvc_status_attribute status_attribute,\n                                    void *data, size_t data_len,\n                                    void *user_ptr);\n\n/** Structure representing a UVC device descriptor.\n *\n * (This isn't a standard structure.)\n */\ntypedef struct uvc_device_descriptor {\n  /** Vendor ID */\n  uint16_t idVendor;\n  /** Product ID */\n  uint16_t idProduct;\n  /** UVC compliance level, e.g. 0x0100 (1.0), 0x0110 */\n  uint16_t bcdUVC;\n  /** Serial number (null if unavailable) */\n  const char *serialNumber;\n  /** Device-reported manufacturer name (or null) */\n  const char *manufacturer;\n  /** Device-reporter product name (or null) */\n  const char *product;\n} uvc_device_descriptor_t;\n\n/** An image frame received from the UVC device\n * @ingroup streaming\n */\ntypedef struct uvc_frame {\n  /** Image data for this frame */\n  void *data;\n  /** Size of image data buffer */\n  size_t data_bytes;\n  /** Width of image in pixels */\n  uint32_t width;\n  /** Height of image in pixels */\n  uint32_t height;\n  /** Pixel data format */\n  enum uvc_frame_format frame_format;\n  /** Number of bytes per horizontal line (undefined for compressed format) */\n  size_t step;\n  /** Frame number (may skip, but is strictly monotonically increasing) */\n  uint32_t sequence;\n  /** Estimate of system time when the device started capturing the image */\n  struct timeval capture_time;\n  /** Handle on the device that produced the image.\n   * @warning You must not call any uvc_* functions during a callback. */\n  uvc_device_handle_t *source;\n  /** Is the data buffer owned by the library?\n   * If 1, the data buffer can be arbitrarily reallocated by frame conversion\n   * functions.\n   * If 0, the data buffer will not be reallocated or freed by the library.\n   * Set this field to zero if you are supplying the buffer.\n   */\n  uint8_t library_owns_data;\n} uvc_frame_t;\n\n/** A callback function to handle incoming assembled UVC frames\n * @ingroup streaming\n */\ntypedef void(uvc_frame_callback_t)(struct uvc_frame *frame, void *user_ptr);\n\n/** Streaming mode, includes all information needed to select stream\n * @ingroup streaming\n */\ntypedef struct uvc_stream_ctrl {\n  uint16_t bmHint;\n  uint8_t bFormatIndex;\n  uint8_t bFrameIndex;\n  uint32_t dwFrameInterval;\n  uint16_t wKeyFrameRate;\n  uint16_t wPFrameRate;\n  uint16_t wCompQuality;\n  uint16_t wCompWindowSize;\n  uint16_t wDelay;\n  uint32_t dwMaxVideoFrameSize;\n  uint32_t dwMaxPayloadTransferSize;\n  /** @todo add UVC 1.1 parameters */\n  uint8_t bInterfaceNumber;\n} uvc_stream_ctrl_t;\n\nuvc_error_t uvc_init(uvc_context_t **ctx, struct libusb_context *usb_ctx);\nvoid uvc_exit(uvc_context_t *ctx);\n\nuvc_error_t uvc_get_device_list(\n    uvc_context_t *ctx,\n    uvc_device_t ***list);\nvoid uvc_free_device_list(uvc_device_t **list, uint8_t unref_devices);\n\nuvc_error_t uvc_get_device_descriptor(\n    uvc_device_t *dev,\n    uvc_device_descriptor_t **desc);\nvoid uvc_free_device_descriptor(\n    uvc_device_descriptor_t *desc);\n\nuint8_t uvc_get_bus_number(uvc_device_t *dev);\nuint8_t uvc_get_device_address(uvc_device_t *dev);\n\nuvc_error_t uvc_find_device(\n    uvc_context_t *ctx,\n    uvc_device_t **dev,\n    int vid, int pid, const char *sn);\n\nuvc_error_t uvc_open(\n    uvc_device_t *dev,\n    uvc_device_handle_t **devh);\nvoid uvc_close(uvc_device_handle_t *devh);\n\nuvc_device_t *uvc_get_device(uvc_device_handle_t *devh);\nlibusb_device_handle *uvc_get_libusb_handle(uvc_device_handle_t *devh);\n\nvoid uvc_ref_device(uvc_device_t *dev);\nvoid uvc_unref_device(uvc_device_t *dev);\n\nvoid uvc_set_status_callback(uvc_device_handle_t *devh,\n                             uvc_status_callback_t cb,\n                             void *user_ptr);\n\nconst uvc_input_terminal_t *uvc_get_input_terminals(uvc_device_handle_t *devh);\nconst uvc_output_terminal_t *uvc_get_output_terminals(uvc_device_handle_t *devh);\nconst uvc_processing_unit_t *uvc_get_processing_units(uvc_device_handle_t *devh);\nconst uvc_extension_unit_t *uvc_get_extension_units(uvc_device_handle_t *devh);\n\nuvc_error_t uvc_get_stream_ctrl_format_size(\n    uvc_device_handle_t *devh,\n    uvc_stream_ctrl_t *ctrl,\n    enum uvc_frame_format format,\n    int width, int height,\n    int fps\n    );\n\nuvc_error_t uvc_probe_stream_ctrl(\n    uvc_device_handle_t *devh,\n    uvc_stream_ctrl_t *ctrl);\n\nuvc_error_t uvc_start_streaming(\n    uvc_device_handle_t *devh,\n    uvc_stream_ctrl_t *ctrl,\n    uvc_frame_callback_t *cb,\n    void *user_ptr,\n    uint8_t isochronous);\n\nuvc_error_t uvc_start_iso_streaming(\n    uvc_device_handle_t *devh,\n    uvc_stream_ctrl_t *ctrl,\n    uvc_frame_callback_t *cb,\n    void *user_ptr);\n\nvoid uvc_stop_streaming(uvc_device_handle_t *devh);\n\nuvc_error_t uvc_stream_open_ctrl(uvc_device_handle_t *devh, uvc_stream_handle_t **strmh, uvc_stream_ctrl_t *ctrl);\nuvc_error_t uvc_stream_ctrl(uvc_stream_handle_t *strmh, uvc_stream_ctrl_t *ctrl);\nuvc_error_t uvc_stream_start(uvc_stream_handle_t *strmh,\n    uvc_frame_callback_t *cb,\n    void *user_ptr,\n    uint8_t isochronous);\nuvc_error_t uvc_stream_start_iso(uvc_stream_handle_t *strmh,\n    uvc_frame_callback_t *cb,\n    void *user_ptr);\nuvc_error_t uvc_stream_get_frame(\n    uvc_stream_handle_t *strmh,\n    uvc_frame_t **frame,\n    int32_t timeout_us\n);\nuvc_error_t uvc_stream_stop(uvc_stream_handle_t *strmh);\nvoid uvc_stream_close(uvc_stream_handle_t *strmh);\n\nuvc_error_t uvc_get_power_mode(uvc_device_handle_t *devh, enum uvc_device_power_mode *mode, enum uvc_req_code req_code);\nuvc_error_t uvc_set_power_mode(uvc_device_handle_t *devh, enum uvc_device_power_mode mode);\nuvc_error_t uvc_get_ae_mode(uvc_device_handle_t *devh, int *mode, enum uvc_req_code req_code);\nuvc_error_t uvc_set_ae_mode(uvc_device_handle_t *devh, int mode);\nuvc_error_t uvc_get_ae_priority(uvc_device_handle_t *devh, uint8_t *priority, enum uvc_req_code req_code);\nuvc_error_t uvc_set_ae_priority(uvc_device_handle_t *devh, uint8_t priority);\nuvc_error_t uvc_get_exposure_abs(uvc_device_handle_t *devh, int *time, enum uvc_req_code req_code);\nuvc_error_t uvc_set_exposure_abs(uvc_device_handle_t *devh, int time);\nuvc_error_t uvc_get_exposure_rel(uvc_device_handle_t *devh, int *step, enum uvc_req_code req_code);\nuvc_error_t uvc_set_exposure_rel(uvc_device_handle_t *devh, int step);\nuvc_error_t uvc_get_scanning_mode(uvc_device_handle_t *devh, int *step, enum uvc_req_code req_code);\nuvc_error_t uvc_set_scanning_mode(uvc_device_handle_t *devh, int mode);\nuvc_error_t uvc_get_focus_abs(uvc_device_handle_t *devh, short *focus, enum uvc_req_code req_code);\nuvc_error_t uvc_set_focus_abs(uvc_device_handle_t *devh, short focus);\nuvc_error_t uvc_get_pantilt_abs(uvc_device_handle_t *devh, int *pan, int *tilt, enum uvc_req_code req_code);\nuvc_error_t uvc_set_pantilt_abs(uvc_device_handle_t *devh, int pan, int tilt);\n\nint uvc_get_ctrl_len(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl);\nint uvc_get_ctrl(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl, void *data, int len, enum uvc_req_code req_code);\nint uvc_set_ctrl(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl, void *data, int len);\n\nvoid uvc_perror(uvc_error_t err, const char *msg);\nconst char* uvc_strerror(uvc_error_t err);\nvoid uvc_print_diag(uvc_device_handle_t *devh, FILE *stream);\nvoid uvc_print_stream_ctrl(uvc_stream_ctrl_t *ctrl, FILE *stream);\n\nuvc_frame_t *uvc_allocate_frame(size_t data_bytes);\nvoid uvc_free_frame(uvc_frame_t *frame);\n\nuvc_error_t uvc_duplicate_frame(uvc_frame_t *in, uvc_frame_t *out);\n\nuvc_error_t uvc_yuyv2rgb(uvc_frame_t *in, uvc_frame_t *out);\nuvc_error_t uvc_uyvy2rgb(uvc_frame_t *in, uvc_frame_t *out);\nuvc_error_t uvc_any2rgb(uvc_frame_t *in, uvc_frame_t *out);\n\nuvc_error_t uvc_yuyv2bgr(uvc_frame_t *in, uvc_frame_t *out);\nuvc_error_t uvc_uyvy2bgr(uvc_frame_t *in, uvc_frame_t *out);\nuvc_error_t uvc_any2bgr(uvc_frame_t *in, uvc_frame_t *out);\n\n#ifdef LIBUVC_HAS_JPEG\nuvc_error_t uvc_mjpeg2rgb(uvc_frame_t *in, uvc_frame_t *out);\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // !def(LIBUVC_H)\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/include/utlist.h",
    "content": "/*\nCopyright (c) 2007-2010, Troy D. Hanson   http://uthash.sourceforge.net\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER\nOR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef UTLIST_H\n#define UTLIST_H\n\n#define UTLIST_VERSION 1.9.1\n\n/* \n * This file contains macros to manipulate singly and doubly-linked lists.\n *\n * 1. LL_ macros:  singly-linked lists.\n * 2. DL_ macros:  doubly-linked lists.\n * 3. CDL_ macros: circular doubly-linked lists.\n *\n * To use singly-linked lists, your structure must have a \"next\" pointer.\n * To use doubly-linked lists, your structure must \"prev\" and \"next\" pointers.\n * Either way, the pointer to the head of the list must be initialized to NULL.\n * \n * ----------------.EXAMPLE -------------------------\n * struct item {\n *      int id;\n *      struct item *prev, *next;\n * }\n *\n * struct item *list = NULL:\n *\n * int main() {\n *      struct item *item;\n *      ... allocate and populate item ...\n *      DL_APPEND(list, item);\n * }\n * --------------------------------------------------\n *\n * For doubly-linked lists, the append and delete macros are O(1)\n * For singly-linked lists, append and delete are O(n) but prepend is O(1)\n * The sort macro is O(n log(n)) for all types of single/double/circular lists.\n */\n\n/* These macros use decltype or the earlier __typeof GNU extension.\n   As decltype is only available in newer compilers (VS2010 or gcc 4.3+\n   when compiling c++ code), this code uses whatever method is needed\n   or, for VS2008 where neither is available, uses casting workarounds. */\n#ifdef _MSC_VER            /* MS compiler */\n#if _MSC_VER >= 1600 && defined(__cplusplus)  /* VS2010 or newer in C++ mode */\n#define LDECLTYPE(x) decltype(x)\n#else                     /* VS2008 or older (or VS2010 in C mode) */\n#define NO_DECLTYPE\n#define LDECLTYPE(x) char*\n#endif\n#else                      /* GNU, Sun and other compilers */\n#define LDECLTYPE(x) __typeof(x)\n#endif\n\n/* for VS2008 we use some workarounds to get around the lack of decltype,\n * namely, we always reassign our tmp variable to the list head if we need\n * to dereference its prev/next pointers, and save/restore the real head.*/\n#ifdef NO_DECLTYPE\n#define _SV(elt,list) _tmp = (char*)(list); {char **_alias = (char**)&(list); *_alias = (elt); }\n#define _NEXT(elt,list) ((char*)((list)->next))\n#define _NEXTASGN(elt,list,to) { char **_alias = (char**)&((list)->next); *_alias=(char*)(to); }\n#define _PREV(elt,list) ((char*)((list)->prev))\n#define _PREVASGN(elt,list,to) { char **_alias = (char**)&((list)->prev); *_alias=(char*)(to); }\n#define _RS(list) { char **_alias = (char**)&(list); *_alias=_tmp; }\n#define _CASTASGN(a,b) { char **_alias = (char**)&(a); *_alias=(char*)(b); }\n#else \n#define _SV(elt,list)\n#define _NEXT(elt,list) ((elt)->next)\n#define _NEXTASGN(elt,list,to) ((elt)->next)=(to)\n#define _PREV(elt,list) ((elt)->prev)\n#define _PREVASGN(elt,list,to) ((elt)->prev)=(to)\n#define _RS(list)\n#define _CASTASGN(a,b) (a)=(b)\n#endif\n\n/******************************************************************************\n * The sort macro is an adaptation of Simon Tatham's O(n log(n)) mergesort    *\n * Unwieldy variable names used here to avoid shadowing passed-in variables.  *\n *****************************************************************************/\n#define LL_SORT(list, cmp)                                                                     \\\ndo {                                                                                           \\\n  LDECLTYPE(list) _ls_p;                                                                       \\\n  LDECLTYPE(list) _ls_q;                                                                       \\\n  LDECLTYPE(list) _ls_e;                                                                       \\\n  LDECLTYPE(list) _ls_tail;                                                                    \\\n  LDECLTYPE(list) _ls_oldhead;                                                                 \\\n  LDECLTYPE(list) _tmp;                                                                        \\\n  int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping;                       \\\n  if (list) {                                                                                  \\\n    _ls_insize = 1;                                                                            \\\n    _ls_looping = 1;                                                                           \\\n    while (_ls_looping) {                                                                      \\\n      _CASTASGN(_ls_p,list);                                                                   \\\n      _CASTASGN(_ls_oldhead,list);                                                             \\\n      list = NULL;                                                                             \\\n      _ls_tail = NULL;                                                                         \\\n      _ls_nmerges = 0;                                                                         \\\n      while (_ls_p) {                                                                          \\\n        _ls_nmerges++;                                                                         \\\n        _ls_q = _ls_p;                                                                         \\\n        _ls_psize = 0;                                                                         \\\n        for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) {                                         \\\n          _ls_psize++;                                                                         \\\n          _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list);                               \\\n          if (!_ls_q) break;                                                                   \\\n        }                                                                                      \\\n        _ls_qsize = _ls_insize;                                                                \\\n        while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) {                                    \\\n          if (_ls_psize == 0) {                                                                \\\n            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \\\n          } else if (_ls_qsize == 0 || !_ls_q) {                                               \\\n            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \\\n          } else if (cmp(_ls_p,_ls_q) <= 0) {                                                  \\\n            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \\\n          } else {                                                                             \\\n            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \\\n          }                                                                                    \\\n          if (_ls_tail) {                                                                      \\\n            _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e); _RS(list);                     \\\n          } else {                                                                             \\\n            _CASTASGN(list,_ls_e);                                                             \\\n          }                                                                                    \\\n          _ls_tail = _ls_e;                                                                    \\\n        }                                                                                      \\\n        _ls_p = _ls_q;                                                                         \\\n      }                                                                                        \\\n      _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL); _RS(list);                            \\\n      if (_ls_nmerges <= 1) {                                                                  \\\n        _ls_looping=0;                                                                         \\\n      }                                                                                        \\\n      _ls_insize *= 2;                                                                         \\\n    }                                                                                          \\\n  } else _tmp=NULL; /* quiet gcc unused variable warning */                                    \\\n} while (0)\n\n#define DL_SORT(list, cmp)                                                                     \\\ndo {                                                                                           \\\n  LDECLTYPE(list) _ls_p;                                                                       \\\n  LDECLTYPE(list) _ls_q;                                                                       \\\n  LDECLTYPE(list) _ls_e;                                                                       \\\n  LDECLTYPE(list) _ls_tail;                                                                    \\\n  LDECLTYPE(list) _ls_oldhead;                                                                 \\\n  LDECLTYPE(list) _tmp;                                                                        \\\n  int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping;                       \\\n  if (list) {                                                                                  \\\n    _ls_insize = 1;                                                                            \\\n    _ls_looping = 1;                                                                           \\\n    while (_ls_looping) {                                                                      \\\n      _CASTASGN(_ls_p,list);                                                                   \\\n      _CASTASGN(_ls_oldhead,list);                                                             \\\n      list = NULL;                                                                             \\\n      _ls_tail = NULL;                                                                         \\\n      _ls_nmerges = 0;                                                                         \\\n      while (_ls_p) {                                                                          \\\n        _ls_nmerges++;                                                                         \\\n        _ls_q = _ls_p;                                                                         \\\n        _ls_psize = 0;                                                                         \\\n        for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) {                                         \\\n          _ls_psize++;                                                                         \\\n          _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list);                               \\\n          if (!_ls_q) break;                                                                   \\\n        }                                                                                      \\\n        _ls_qsize = _ls_insize;                                                                \\\n        while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) {                                    \\\n          if (_ls_psize == 0) {                                                                \\\n            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \\\n          } else if (_ls_qsize == 0 || !_ls_q) {                                               \\\n            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \\\n          } else if (cmp(_ls_p,_ls_q) <= 0) {                                                  \\\n            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \\\n          } else {                                                                             \\\n            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \\\n          }                                                                                    \\\n          if (_ls_tail) {                                                                      \\\n            _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e); _RS(list);                     \\\n          } else {                                                                             \\\n            _CASTASGN(list,_ls_e);                                                             \\\n          }                                                                                    \\\n          _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail); _RS(list);                          \\\n          _ls_tail = _ls_e;                                                                    \\\n        }                                                                                      \\\n        _ls_p = _ls_q;                                                                         \\\n      }                                                                                        \\\n      _CASTASGN(list->prev, _ls_tail);                                                         \\\n      _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL); _RS(list);                            \\\n      if (_ls_nmerges <= 1) {                                                                  \\\n        _ls_looping=0;                                                                         \\\n      }                                                                                        \\\n      _ls_insize *= 2;                                                                         \\\n    }                                                                                          \\\n  } else _tmp=NULL; /* quiet gcc unused variable warning */                                    \\\n} while (0)\n\n#define CDL_SORT(list, cmp)                                                                    \\\ndo {                                                                                           \\\n  LDECLTYPE(list) _ls_p;                                                                       \\\n  LDECLTYPE(list) _ls_q;                                                                       \\\n  LDECLTYPE(list) _ls_e;                                                                       \\\n  LDECLTYPE(list) _ls_tail;                                                                    \\\n  LDECLTYPE(list) _ls_oldhead;                                                                 \\\n  LDECLTYPE(list) _tmp;                                                                        \\\n  LDECLTYPE(list) _tmp2;                                                                       \\\n  int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping;                       \\\n  if (list) {                                                                                  \\\n    _ls_insize = 1;                                                                            \\\n    _ls_looping = 1;                                                                           \\\n    while (_ls_looping) {                                                                      \\\n      _CASTASGN(_ls_p,list);                                                                   \\\n      _CASTASGN(_ls_oldhead,list);                                                             \\\n      list = NULL;                                                                             \\\n      _ls_tail = NULL;                                                                         \\\n      _ls_nmerges = 0;                                                                         \\\n      while (_ls_p) {                                                                          \\\n        _ls_nmerges++;                                                                         \\\n        _ls_q = _ls_p;                                                                         \\\n        _ls_psize = 0;                                                                         \\\n        for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) {                                         \\\n          _ls_psize++;                                                                         \\\n          _SV(_ls_q,list);                                                                     \\\n          if (_NEXT(_ls_q,list) == _ls_oldhead) {                                              \\\n            _ls_q = NULL;                                                                      \\\n          } else {                                                                             \\\n            _ls_q = _NEXT(_ls_q,list);                                                         \\\n          }                                                                                    \\\n          _RS(list);                                                                           \\\n          if (!_ls_q) break;                                                                   \\\n        }                                                                                      \\\n        _ls_qsize = _ls_insize;                                                                \\\n        while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) {                                    \\\n          if (_ls_psize == 0) {                                                                \\\n            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \\\n            if (_ls_q == _ls_oldhead) { _ls_q = NULL; }                                        \\\n          } else if (_ls_qsize == 0 || !_ls_q) {                                               \\\n            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \\\n            if (_ls_p == _ls_oldhead) { _ls_p = NULL; }                                        \\\n          } else if (cmp(_ls_p,_ls_q) <= 0) {                                                  \\\n            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \\\n            if (_ls_p == _ls_oldhead) { _ls_p = NULL; }                                        \\\n          } else {                                                                             \\\n            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \\\n            if (_ls_q == _ls_oldhead) { _ls_q = NULL; }                                        \\\n          }                                                                                    \\\n          if (_ls_tail) {                                                                      \\\n            _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e); _RS(list);                     \\\n          } else {                                                                             \\\n            _CASTASGN(list,_ls_e);                                                             \\\n          }                                                                                    \\\n          _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail); _RS(list);                          \\\n          _ls_tail = _ls_e;                                                                    \\\n        }                                                                                      \\\n        _ls_p = _ls_q;                                                                         \\\n      }                                                                                        \\\n      _CASTASGN(list->prev,_ls_tail);                                                          \\\n      _CASTASGN(_tmp2,list);                                                                   \\\n      _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_tmp2); _RS(list);                           \\\n      if (_ls_nmerges <= 1) {                                                                  \\\n        _ls_looping=0;                                                                         \\\n      }                                                                                        \\\n      _ls_insize *= 2;                                                                         \\\n    }                                                                                          \\\n  } else _tmp=NULL; /* quiet gcc unused variable warning */                                    \\\n} while (0)\n\n/******************************************************************************\n * singly linked list macros (non-circular)                                   *\n *****************************************************************************/\n#define LL_PREPEND(head,add)                                                                   \\\ndo {                                                                                           \\\n  (add)->next = head;                                                                          \\\n  head = add;                                                                                  \\\n} while (0)\n\n#define LL_APPEND(head,add)                                                                    \\\ndo {                                                                                           \\\n  LDECLTYPE(head) _tmp;                                                                        \\\n  (add)->next=NULL;                                                                            \\\n  if (head) {                                                                                  \\\n    _tmp = head;                                                                               \\\n    while (_tmp->next) { _tmp = _tmp->next; }                                                  \\\n    _tmp->next=(add);                                                                          \\\n  } else {                                                                                     \\\n    (head)=(add);                                                                              \\\n  }                                                                                            \\\n} while (0)\n\n#define LL_DELETE(head,del)                                                                    \\\ndo {                                                                                           \\\n  LDECLTYPE(head) _tmp;                                                                        \\\n  if ((head) == (del)) {                                                                       \\\n    (head)=(head)->next;                                                                       \\\n  } else {                                                                                     \\\n    _tmp = head;                                                                               \\\n    while (_tmp->next && (_tmp->next != (del))) {                                              \\\n      _tmp = _tmp->next;                                                                       \\\n    }                                                                                          \\\n    if (_tmp->next) {                                                                          \\\n      _tmp->next = ((del)->next);                                                              \\\n    }                                                                                          \\\n  }                                                                                            \\\n} while (0)\n\n/* Here are VS2008 replacements for LL_APPEND and LL_DELETE */\n#define LL_APPEND_VS2008(head,add)                                                             \\\ndo {                                                                                           \\\n  if (head) {                                                                                  \\\n    (add)->next = head;     /* use add->next as a temp variable */                             \\\n    while ((add)->next->next) { (add)->next = (add)->next->next; }                             \\\n    (add)->next->next=(add);                                                                   \\\n  } else {                                                                                     \\\n    (head)=(add);                                                                              \\\n  }                                                                                            \\\n  (add)->next=NULL;                                                                            \\\n} while (0)\n\n#define LL_DELETE_VS2008(head,del)                                                             \\\ndo {                                                                                           \\\n  if ((head) == (del)) {                                                                       \\\n    (head)=(head)->next;                                                                       \\\n  } else {                                                                                     \\\n    char *_tmp = (char*)(head);                                                                \\\n    while (head->next && (head->next != (del))) {                                              \\\n      head = head->next;                                                                       \\\n    }                                                                                          \\\n    if (head->next) {                                                                          \\\n      head->next = ((del)->next);                                                              \\\n    }                                                                                          \\\n    {                                                                                          \\\n      char **_head_alias = (char**)&(head);                                                    \\\n      *_head_alias = _tmp;                                                                     \\\n    }                                                                                          \\\n  }                                                                                            \\\n} while (0)\n#ifdef NO_DECLTYPE\n#undef LL_APPEND\n#define LL_APPEND LL_APPEND_VS2008\n#undef LL_DELETE\n#define LL_DELETE LL_DELETE_VS2008\n#endif\n/* end VS2008 replacements */\n\n#define LL_FOREACH(head,el)                                                                    \\\n    for(el=head;el;el=el->next)\n\n#define LL_FOREACH_SAFE(head,el,tmp)                                                           \\\n  for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp)\n\n#define LL_SEARCH_SCALAR(head,out,field,val)                                                   \\\ndo {                                                                                           \\\n    LL_FOREACH(head,out) {                                                                     \\\n      if ((out)->field == (val)) break;                                                        \\\n    }                                                                                          \\\n} while(0) \n\n#define LL_SEARCH(head,out,elt,cmp)                                                            \\\ndo {                                                                                           \\\n    LL_FOREACH(head,out) {                                                                     \\\n      if ((cmp(out,elt))==0) break;                                                            \\\n    }                                                                                          \\\n} while(0) \n\n/******************************************************************************\n * doubly linked list macros (non-circular)                                   *\n *****************************************************************************/\n#define DL_PREPEND(head,add)                                                                   \\\ndo {                                                                                           \\\n (add)->next = head;                                                                           \\\n if (head) {                                                                                   \\\n   (add)->prev = (head)->prev;                                                                 \\\n   (head)->prev = (add);                                                                       \\\n } else {                                                                                      \\\n   (add)->prev = (add);                                                                        \\\n }                                                                                             \\\n (head) = (add);                                                                               \\\n} while (0)\n\n#define DL_APPEND(head,add)                                                                    \\\ndo {                                                                                           \\\n  if (head) {                                                                                  \\\n      (add)->prev = (head)->prev;                                                              \\\n      (head)->prev->next = (add);                                                              \\\n      (head)->prev = (add);                                                                    \\\n      (add)->next = NULL;                                                                      \\\n  } else {                                                                                     \\\n      (head)=(add);                                                                            \\\n      (head)->prev = (head);                                                                   \\\n      (head)->next = NULL;                                                                     \\\n  }                                                                                            \\\n} while (0);\n\n#define DL_DELETE(head,del)                                                                    \\\ndo {                                                                                           \\\n  if ((del)->prev == (del)) {                                                                  \\\n      (head)=NULL;                                                                             \\\n  } else if ((del)==(head)) {                                                                  \\\n      (del)->next->prev = (del)->prev;                                                         \\\n      (head) = (del)->next;                                                                    \\\n  } else {                                                                                     \\\n      (del)->prev->next = (del)->next;                                                         \\\n      if ((del)->next) {                                                                       \\\n          (del)->next->prev = (del)->prev;                                                     \\\n      } else {                                                                                 \\\n          (head)->prev = (del)->prev;                                                          \\\n      }                                                                                        \\\n  }                                                                                            \\\n} while (0);\n\n\n#define DL_FOREACH(head,el)                                                                    \\\n    for(el=head;el;el=el->next)\n\n/* this version is safe for deleting the elements during iteration */\n#define DL_FOREACH_SAFE(head,el,tmp)                                                           \\\n  for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp)\n\n/* these are identical to their singly-linked list counterparts */\n#define DL_SEARCH_SCALAR LL_SEARCH_SCALAR\n#define DL_SEARCH LL_SEARCH\n\n/******************************************************************************\n * circular doubly linked list macros                                         *\n *****************************************************************************/\n#define CDL_PREPEND(head,add)                                                                  \\\ndo {                                                                                           \\\n if (head) {                                                                                   \\\n   (add)->prev = (head)->prev;                                                                 \\\n   (add)->next = (head);                                                                       \\\n   (head)->prev = (add);                                                                       \\\n   (add)->prev->next = (add);                                                                  \\\n } else {                                                                                      \\\n   (add)->prev = (add);                                                                        \\\n   (add)->next = (add);                                                                        \\\n }                                                                                             \\\n(head)=(add);                                                                                  \\\n} while (0)\n\n#define CDL_DELETE(head,del)                                                                   \\\ndo {                                                                                           \\\n  if ( ((head)==(del)) && ((head)->next == (head))) {                                          \\\n      (head) = 0L;                                                                             \\\n  } else {                                                                                     \\\n     (del)->next->prev = (del)->prev;                                                          \\\n     (del)->prev->next = (del)->next;                                                          \\\n     if ((del) == (head)) (head)=(del)->next;                                                  \\\n  }                                                                                            \\\n} while (0);\n\n#define CDL_FOREACH(head,el)                                                                   \\\n    for(el=head;el;el=(el->next==head ? 0L : el->next)) \n\n#define CDL_FOREACH_SAFE(head,el,tmp1,tmp2)                                                    \\\n  for((el)=(head), ((tmp1)=(head)?((head)->prev):NULL);                                        \\\n      (el) && ((tmp2)=(el)->next, 1);                                                          \\\n      ((el) = (((el)==(tmp1)) ? 0L : (tmp2))))\n\n#define CDL_SEARCH_SCALAR(head,out,field,val)                                                  \\\ndo {                                                                                           \\\n    CDL_FOREACH(head,out) {                                                                    \\\n      if ((out)->field == (val)) break;                                                        \\\n    }                                                                                          \\\n} while(0) \n\n#define CDL_SEARCH(head,out,elt,cmp)                                                           \\\ndo {                                                                                           \\\n    CDL_FOREACH(head,out) {                                                                    \\\n      if ((cmp(out,elt))==0) break;                                                            \\\n    }                                                                                          \\\n} while(0) \n\n#endif /* UTLIST_H */\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/libuvcConfig.cmake.in",
    "content": "# - Config file for the libuvc package\nset(libuvc_INCLUDE_DIRS \"@CONF_INCLUDE_DIR@\")\nset(libuvc_LIBRARIES \"@CONF_LIBRARY@\")\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/libuvcConfigVersion.cmake.in",
    "content": "set(PACKAGE_VERSION \"@libuvc_VERSION@\")\n\n# Check whether the requested PACKAGE_FIND_VERSION is compatible\nif(\"${PACKAGE_VERSION}\" VERSION_LESS \"${PACKAGE_FIND_VERSION}\")\n  set(PACKAGE_VERSION_COMPATIBLE FALSE)\nelse()\n  set(PACKAGE_VERSION_COMPATIBLE TRUE)\n  if (\"${PACKAGE_VERSION}\" VERSION_EQUAL \"${PACKAGE_FIND_VERSION}\")\n    set(PACKAGE_VERSION_EXACT TRUE)\n  endif()\nendif()\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/ctrl.c",
    "content": "/*********************************************************************\n * add some functions unsupported on original libuvc library\n * and fixed some issues\n * Copyright (C) 2014-2015 saki@serenegiant All rights reserved.\n *********************************************************************/\n/*********************************************************************\n * Software License Agreement (BSD License)\n *\n *  Copyright (C) 2010-2012 Ken Tossell\n *  All rights reserved.\n *\n *  Redistribution and use in source and binary forms, with or without\n *  modification, are permitted provided that the following conditions\n *  are met:\n *\n *   * Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n *   * Redistributions in binary form must reproduce the above\n *     copyright notice, this list of conditions and the following\n *     disclaimer in the documentation and/or other materials provided\n *     with the distribution.\n *   * Neither the name of the author nor other contributors may be\n *     used to endorse or promote products derived from this software\n *     without specific prior written permission.\n *\n *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n *  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n *  POSSIBILITY OF SUCH DAMAGE.\n *********************************************************************/\n/**\n * @defgroup ctrl Video capture and processing controls\n * @brief Functions for manipulating device settings and stream parameters\n *\n * The `uvc_get_*` and `uvc_set_*` functions are used to read and write the settings associated\n * with the device's input, processing and output units.\n */\n\n#include \"libuvc/libuvc.h\"\n#include \"libuvc/libuvc_internal.h\"\n\nstatic const int REQ_TYPE_SET = 0x21;\nstatic const int REQ_TYPE_GET = 0xa1;\n\n#define CTRL_TIMEOUT_MILLIS 0\n\n/***** GENERIC CONTROLS *****/\n/**\n * @brief Get the length of a control on a terminal or unit.\n * \n * @param devh UVC device handle\n * @param unit Unit or Terminal ID; obtain this from the uvc_extension_unit_t describing the extension unit\n * @param ctrl Vendor-specific control number to query\n * @return On success, the length of the control as reported by the device. Otherwise,\n *   a uvc_error_t error describing the error encountered.\n * @ingroup ctrl\n */\nint uvc_get_ctrl_len(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl) {\n\tunsigned char buf[2];\n\n\tint ret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, UVC_GET_LEN,\n\t\t\tctrl << 8,\n\t\t\tunit << 8,\t// FIXME this will work wrong, invalid wIndex value\n\t\t\tbuf, 2, CTRL_TIMEOUT_MILLIS);\n\n\tif (UNLIKELY(ret < 0))\n\t\treturn ret;\n\telse\n\t\treturn (unsigned short) SW_TO_SHORT(buf);\n}\n\n/**\n * @brief Perform a GET_* request from an extension unit.\n * \n * @param devh UVC device handle\n * @param unit Unit ID; obtain this from the uvc_extension_unit_t describing the extension unit\n * @param ctrl Control number to query\n * @param data Data buffer to be filled by the device\n * @param len Size of data buffer\n * @param req_code GET_* request to execute\n * @return On success, the number of bytes actually transferred. Otherwise,\n *   a uvc_error_t error describing the error encountered.\n * @ingroup ctrl\n */\nint uvc_get_ctrl(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl,\n\t\tvoid *data, int len, enum uvc_req_code req_code) {\n\treturn libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tctrl << 8,\n\t\t\tunit << 8,\t// FIXME this will work wrong, invalid wIndex value\n\t\t\tdata, len, CTRL_TIMEOUT_MILLIS);\n}\n\n/**\n * @brief Perform a SET_CUR request to a terminal or unit.\n * \n * @param devh UVC device handle\n * @param unit Unit or Terminal ID\n * @param ctrl Control number to set\n * @param data Data buffer to be sent to the device\n * @param len Size of data buffer\n * @return On success, the number of bytes actually transferred. Otherwise,\n *   a uvc_error_t error describing the error encountered.\n * @ingroup ctrl\n */\nint uvc_set_ctrl(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl,\n\t\tvoid *data, int len) {\n\treturn libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tctrl << 8,\n\t\t\tunit << 8,\t// FIXME this will work wrong, invalid wIndex value\n\t\t\tdata, len, CTRL_TIMEOUT_MILLIS);\n}\n\n/***** INTERFACE CONTROLS *****/\n/** VC Request Error Code Control (UVC 4.2.1.2) */ // XXX added saki\nuvc_error_t uvc_vc_get_error_code(uvc_device_handle_t *devh,\n\t\tuvc_vc_error_code_control_t *error_code, enum uvc_req_code req_code) {\n\tuint8_t error_char = 0;\n\tuvc_error_t ret = UVC_SUCCESS;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_VC_REQUEST_ERROR_CODE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.bInterfaceNumber,\t// XXX saki\n\t\t\t&error_char, sizeof(error_char), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == 1)) {\n\t\t*error_code = error_char;\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\n/** VS Request Error Code Control */ // XXX added saki\nuvc_error_t uvc_vs_get_error_code(uvc_device_handle_t *devh,\n\t\tuvc_vs_error_code_control_t *error_code, enum uvc_req_code req_code) {\n\tuint8_t error_char = 0;\n\tuvc_error_t ret = UVC_SUCCESS;\n\n#if 0 // This code may cause hang-up on some combinations of device and camera and temporary disabled.\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_VS_STREAM_ERROR_CODE_CONTROL << 8,\n\t\t\tdevh->info->stream_ifs->bInterfaceNumber,\t// XXX is this OK?\n\t\t\t&error_char, sizeof(error_char), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == 1)) {\n\t\t*error_code = error_char;\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n#else\n\treturn ret;\n#endif\n}\n\nuvc_error_t uvc_get_power_mode(uvc_device_handle_t *devh,\n\t\tenum uvc_device_power_mode *mode, enum uvc_req_code req_code) {\n\tuint8_t mode_char = 0;\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_VC_VIDEO_POWER_MODE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.bInterfaceNumber,\t// XXX saki\n\t\t\t&mode_char, sizeof(mode_char), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == 1)) {\n\t\t*mode = mode_char;\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_power_mode(uvc_device_handle_t *devh,\n\t\tenum uvc_device_power_mode mode) {\n\tuint8_t mode_char = mode;\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_VC_VIDEO_POWER_MODE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.bInterfaceNumber,\t// XXX saki\n\t\t\t&mode_char, sizeof(mode_char), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == 1))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\n/***** CAMERA TERMINAL CONTROLS *****/\nuvc_error_t uvc_get_ae_mode(uvc_device_handle_t *devh, uint8_t *mode,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_AE_MODE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*mode = data[0];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_ae_mode(uvc_device_handle_t *devh, uint8_t mode) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tdata[0] = mode;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_AE_MODE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_ae_priority(uvc_device_handle_t *devh, uint8_t *priority,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_AE_PRIORITY_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*priority = data[0];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_ae_priority(uvc_device_handle_t *devh, uint8_t priority) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tdata[0] = priority;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_AE_PRIORITY_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_exposure_abs(uvc_device_handle_t *devh, int *time,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[4];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*time = DW_TO_INT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_exposure_abs(uvc_device_handle_t *devh, int time) {\n\tuint8_t data[4];\n\tuvc_error_t ret;\n\n\tINT_TO_DW(time, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_exposure_rel(uvc_device_handle_t *devh, int *step,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*step = data[0];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_exposure_rel(uvc_device_handle_t *devh, int step) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tdata[0] = step;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_scanning_mode(uvc_device_handle_t *devh, uint8_t *mode,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_SCANNING_MODE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*mode = data[0];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_scanning_mode(uvc_device_handle_t *devh, uint8_t mode) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tdata[0] = mode;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_SCANNING_MODE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_focus_auto(uvc_device_handle_t *devh, uint8_t *autofocus,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_FOCUS_AUTO_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*autofocus = data[0];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_focus_auto(uvc_device_handle_t *devh, uint8_t autofocus) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tdata[0] = autofocus;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_FOCUS_AUTO_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_focus_abs(uvc_device_handle_t *devh, short *focus,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_FOCUS_ABSOLUTE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*focus = SW_TO_SHORT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_focus_abs(uvc_device_handle_t *devh, short focus) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(focus, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_FOCUS_ABSOLUTE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_focus_rel(uvc_device_handle_t *devh, int8_t *focus, uint8_t *speed,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_FOCUS_RELATIVE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*focus = data[0];\n\t\t*speed = data[1];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_focus_rel(uvc_device_handle_t *devh, int8_t focus, uint8_t speed) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tdata[0] = focus;\n\tdata[1] = speed;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_FOCUS_RELATIVE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_iris_abs(uvc_device_handle_t *devh, uint16_t *iris,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_FOCUS_ABSOLUTE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*iris = SW_TO_SHORT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_iris_abs(uvc_device_handle_t *devh, uint16_t iris) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(iris, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_FOCUS_ABSOLUTE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_iris_rel(uvc_device_handle_t *devh, uint8_t *iris,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_FOCUS_RELATIVE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*iris = data[0];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_iris_rel(uvc_device_handle_t *devh, uint8_t iris) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tdata[0] = iris;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_FOCUS_RELATIVE_CONTROL << 8,\n//\t\t\t1 << 8, /* = fixed ID(00) and wrong VideoControl interface descriptor subtype(UVC_VC_HEADER) on original libuvc */\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_zoom_abs(uvc_device_handle_t *devh, uint16_t *zoom,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_ZOOM_ABSOLUTE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*zoom = SW_TO_SHORT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_zoom_abs(uvc_device_handle_t *devh, uint16_t zoom) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(zoom, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_ZOOM_ABSOLUTE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_zoom_rel(uvc_device_handle_t *devh, int8_t *zoom, uint8_t *isdigital, uint8_t *speed,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[3];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_ZOOM_RELATIVE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*zoom = data[0];\n\t\t*isdigital = data[1];\n\t\t*speed = data[2];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_zoom_rel(uvc_device_handle_t *devh, int8_t zoom, uint8_t isdigital, uint8_t speed) {\n\tuint8_t data[3];\n\tuvc_error_t ret;\n\n\tdata[0] = zoom;\n\tdata[1] = isdigital;\n\tdata[2] = speed;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_ZOOM_RELATIVE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\n//----------------------------------------------------------------------\nuvc_error_t uvc_get_pantilt_abs(uvc_device_handle_t *devh, int32_t *pan, int32_t *tilt,\n\tenum uvc_req_code req_code) {\n\n\tuint8_t data[8];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_PANTILT_ABSOLUTE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*pan = DW_TO_INT(data);\n\t\t*tilt = DW_TO_INT(data + 4);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_pantilt_abs(uvc_device_handle_t *devh, int32_t pan, int32_t tilt) {\n\tuint8_t data[8];\n\tuvc_error_t ret;\n\n\tINT_TO_DW(pan, data);\n\tINT_TO_DW(tilt, data + 4);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_PANTILT_ABSOLUTE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_pantilt_rel(uvc_device_handle_t *devh,\n\tint8_t *pan_rel, uint8_t *pan_speed,\n\tint8_t* tilt_rel, uint8_t* tilt_speed,\n\tenum uvc_req_code req_code) {\n\n\tuint8_t data[4];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_PANTILT_RELATIVE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*pan_rel = data[0];\n\t\t*pan_speed = data[1];\n\t\t*tilt_rel = data[2];\n\t\t*tilt_speed = data[3];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_pantilt_rel(uvc_device_handle_t *devh,\n\tint8_t pan_rel, uint8_t pan_speed,\n\tint8_t tilt_rel, uint8_t tilt_speed) {\n\n\tuint8_t data[4];\n\tuvc_error_t ret;\n\n\tdata[0] = pan_rel;\n\tdata[1] = pan_speed;\n\tdata[2] = tilt_rel;\n\tdata[3] = tilt_speed;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_PANTILT_RELATIVE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_roll_abs(uvc_device_handle_t *devh, int16_t *roll,\n\tenum uvc_req_code req_code) {\n\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_ROLL_ABSOLUTE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*roll = SW_TO_SHORT(data + 0);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\nuvc_error_t uvc_set_roll_abs(uvc_device_handle_t *devh, int16_t roll) {\n\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(roll, data + 0);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_ROLL_ABSOLUTE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\n/** @ingroup ctrl\n * @brief Reads the ROLL_RELATIVE control.\n * @param devh UVC device handle\n * @param[out] roll_rel TODO\n * @param[out] speed TODO\n * @param req_code UVC_GET_* request to execute\n */\nuvc_error_t uvc_get_roll_rel(uvc_device_handle_t *devh, int8_t *roll_rel, uint8_t *speed,\n\tenum uvc_req_code req_code) {\n\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_ROLL_RELATIVE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*roll_rel = data[0];\n\t\t*speed = data[1];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\n\n/** @ingroup ctrl\n * @brief Sets the ROLL_RELATIVE control.\n * @param devh UVC device handle\n * @param roll_rel TODO\n * @param speed TODO\n */\nuvc_error_t uvc_set_roll_rel(uvc_device_handle_t *devh, int8_t roll_rel, uint8_t speed) {\n\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tdata[0] = roll_rel;\n\tdata[1] = speed;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_ROLL_RELATIVE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\n/** @ingroup ctrl\n * @brief Reads the PRIVACY control.\n * @param devh UVC device handle\n * @param[out] privacy TODO\n * @param req_code UVC_GET_* request to execute\n */\nuvc_error_t uvc_get_privacy(uvc_device_handle_t *devh, uint8_t *privacy,\n\tenum uvc_req_code req_code) {\n\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_PRIVACY_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*privacy = data[0];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\n\n/** @ingroup ctrl\n * @brief Sets the PRIVACY control.\n * @param devh UVC device handle\n * @param privacy TODO\n */\nuvc_error_t uvc_set_privacy(uvc_device_handle_t *devh, uint8_t privacy) {\n\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tdata[0] = privacy;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_PRIVACY_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\n/** @ingroup ctrl\n * @brief Reads the DIGITAL_WINDOW control.\n * @param devh UVC device handle\n * @param[out] window_top TODO\n * @param[out] window_left TODO\n * @param[out] window_bottom TODO\n * @param[out] window_right TODO\n * @param[out] num_steps TODO\n * @param[out] num_steps_units TODO\n * @param req_code UVC_GET_* request to execute\n */\nuvc_error_t uvc_get_digital_window(uvc_device_handle_t *devh,\n\tuint16_t *window_top, uint16_t *window_left,\n\tuint16_t *window_bottom, uint16_t *window_right,\n\tuint16_t *num_steps, uint16_t *num_steps_units,\n\tenum uvc_req_code req_code) {\n\n\tuint8_t data[12];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_DIGITAL_WINDOW_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*window_top = SW_TO_SHORT(data + 0);\n\t\t*window_left = SW_TO_SHORT(data + 2);\n\t\t*window_bottom = SW_TO_SHORT(data + 4);\n\t\t*window_right = SW_TO_SHORT(data + 6);\n\t\t*num_steps = SW_TO_SHORT(data + 8);\n\t\t*num_steps_units = SW_TO_SHORT(data + 10);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\n\n/** @ingroup ctrl\n * @brief Sets the DIGITAL_WINDOW control.\n * @param devh UVC device handle\n * @param window_top TODO\n * @param window_left TODO\n * @param window_bottom TODO\n * @param window_right TODO\n * @param num_steps TODO\n * @param num_steps_units TODO\n */\nuvc_error_t uvc_set_digital_window(uvc_device_handle_t *devh,\n\tuint16_t window_top, uint16_t window_left,\n\tuint16_t window_bottom, uint16_t window_right,\n\tuint16_t num_steps, uint16_t num_steps_units) {\n\n\tuint8_t data[12];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(window_top, data + 0);\n\tSHORT_TO_SW(window_left, data + 2);\n\tSHORT_TO_SW(window_bottom, data + 4);\n\tSHORT_TO_SW(window_right, data + 6);\n\tSHORT_TO_SW(num_steps, data + 8);\n\tSHORT_TO_SW(num_steps_units, data + 10);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_DIGITAL_WINDOW_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\n/** @ingroup ctrl\n * @brief Reads the REGION_OF_INTEREST control.\n * @param devh UVC device handle\n * @param[out] roi_top TODO\n * @param[out] roi_left TODO\n * @param[out] roi_bottom TODO\n * @param[out] roi_right TODO\n * @param[out] auto_controls TODO\n * @param req_code UVC_GET_* request to execute\n */\nuvc_error_t uvc_get_digital_roi(uvc_device_handle_t *devh,\n\tuint16_t *roi_top, uint16_t *roi_left,\n\tuint16_t* roi_bottom, uint16_t *roi_right, uint16_t *auto_controls,\n\tenum uvc_req_code req_code) {\n\n\tuint8_t data[10];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_CT_REGION_OF_INTEREST_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*roi_top = SW_TO_SHORT(data + 0);\n\t\t*roi_left = SW_TO_SHORT(data + 2);\n\t\t*roi_bottom = SW_TO_SHORT(data + 4);\n\t\t*roi_right = SW_TO_SHORT(data + 6);\n\t\t*auto_controls = SW_TO_SHORT(data + 8);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n}\n\n\n/** @ingroup ctrl\n * @brief Sets the REGION_OF_INTEREST control.\n * @param devh UVC device handle\n * @param roi_top TODO\n * @param roi_left TODO\n * @param roi_bottom TODO\n * @param roi_right TODO\n * @param auto_controls TODO\n */\nuvc_error_t uvc_set_digital_roi(uvc_device_handle_t *devh,\n\tuint16_t roi_top, uint16_t roi_left,\n\tuint16_t roi_bottom, uint16_t roi_right, uint16_t auto_controls) {\n\n\tuint8_t data[10];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(roi_top, data + 0);\n\tSHORT_TO_SW(roi_left, data + 2);\n\tSHORT_TO_SW(roi_bottom, data + 4);\n\tSHORT_TO_SW(roi_right, data + 6);\n\tSHORT_TO_SW(auto_controls, data + 8);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_CT_REGION_OF_INTEREST_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.input_term_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\n/***** SELECTOR UNIT CONTROLS *****/\n\n/** @todo input_select */\n\n/***** PROCESSING UNIT CONTROLS *****/\nuvc_error_t uvc_get_backlight_compensation(uvc_device_handle_t *devh, short *comp,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_BACKLIGHT_COMPENSATION_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*comp = SW_TO_SHORT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_backlight_compensation(uvc_device_handle_t *devh, short comp) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(comp, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_BACKLIGHT_COMPENSATION_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_brightness(uvc_device_handle_t *devh, short *brightness,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_BRIGHTNESS_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*brightness = SW_TO_SHORT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_brightness(uvc_device_handle_t *devh, short brightness) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(brightness, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_BRIGHTNESS_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_contrast(uvc_device_handle_t *devh, uint16_t *contrast,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_CONTRAST_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*contrast = SW_TO_SHORT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_contrast(uvc_device_handle_t *devh, uint16_t contrast) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(contrast, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_CONTRAST_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_contrast_auto(uvc_device_handle_t *devh, uint8_t *autoContrast,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_CONTRAST_AUTO_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*autoContrast = data[0];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_contrast_auto(uvc_device_handle_t *devh, uint8_t autoContrast) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tdata[0] = autoContrast ? 1 : 0;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_CONTRAST_AUTO_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_gain(uvc_device_handle_t *devh, uint16_t *gain,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_GAIN_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*gain = SW_TO_SHORT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_gain(uvc_device_handle_t *devh, uint16_t gain) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(gain, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_GAIN_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_powerline_freqency(uvc_device_handle_t *devh, uint8_t *freq,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_POWER_LINE_FREQUENCY_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*freq = data[0];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_powerline_freqency(uvc_device_handle_t *devh, uint8_t freq) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\t// XXX AUTO(0x03) is only available for UVC1.5.\n\tif ( ((freq & 0xff) == 0xff)\n\t\t|| (((freq & 0x03) == 0x03) && (devh->info->ctrl_if.bcdUVC < 0x0150)) ) {\n\n\t\tret = uvc_get_powerline_freqency(devh, &freq, UVC_GET_DEF);\n\t\tif (UNLIKELY(ret)) {\n\t\t\tLOGE(\"failed to uvc_get_powerline_freqency:err=%d\", ret);\n\t\t\treturn ret;\n\t\t}\n\t}\n\n\tdata[0] = freq & 0x03;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_POWER_LINE_FREQUENCY_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_hue(uvc_device_handle_t *devh, short *hue,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_HUE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*hue = SW_TO_SHORT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_hue(uvc_device_handle_t *devh, short hue) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(hue, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_HUE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_hue_auto(uvc_device_handle_t *devh, uint8_t *autoHue,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_HUE_AUTO_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*autoHue = data[0];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_hue_auto(uvc_device_handle_t *devh, uint8_t autoHue) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tdata[0] = autoHue ? 1 : 0;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_HUE_AUTO_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_saturation(uvc_device_handle_t *devh, uint16_t *saturation,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_SATURATION_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*saturation = SW_TO_SHORT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_saturation(uvc_device_handle_t *devh, uint16_t saturation) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(saturation, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_SATURATION_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_sharpness(uvc_device_handle_t *devh, uint16_t *sharpness,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_SHARPNESS_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*sharpness = SW_TO_SHORT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_sharpness(uvc_device_handle_t *devh, uint16_t sharpness) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(sharpness, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_SHARPNESS_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_gamma(uvc_device_handle_t *devh, uint16_t *gamma,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_GAMMA_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*gamma = SW_TO_SHORT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_gamma(uvc_device_handle_t *devh, uint16_t gamma) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(gamma, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_GAMMA_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_white_balance_temperature(uvc_device_handle_t *devh, uint16_t *wb_temperature,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*wb_temperature = SW_TO_SHORT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_white_balance_temperature(uvc_device_handle_t *devh, uint16_t wb_temperature) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(wb_temperature, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_white_balance_temperature_auto(uvc_device_handle_t *devh, uint8_t *autoWbTemp,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*autoWbTemp = data[0];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_white_balance_temperature_auto(uvc_device_handle_t *devh, uint8_t autoWbTemp) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tdata[0] = autoWbTemp ? 1 : 0;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_white_balance_component(uvc_device_handle_t *devh, uint32_t *wb_compo,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[4];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_WHITE_BALANCE_COMPONENT_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*wb_compo = DW_TO_INT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_white_balance_component(uvc_device_handle_t *devh, uint32_t wb_compo) {\n\tuint8_t data[4];\n\tuvc_error_t ret;\n\n\tINT_TO_DW(wb_compo, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_WHITE_BALANCE_COMPONENT_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_white_balance_component_auto(uvc_device_handle_t *devh, uint8_t *autoWbCompo,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*autoWbCompo = data[0];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_white_balance_component_auto(uvc_device_handle_t *devh, uint8_t autoWbCompo) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tdata[0] = autoWbCompo ? 1 : 0;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_digital_multiplier(uvc_device_handle_t *devh, uint16_t *multiplier,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_DIGITAL_MULTIPLIER_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*multiplier = SW_TO_SHORT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_digital_multiplier(uvc_device_handle_t *devh, uint16_t multiplier) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(multiplier, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_DIGITAL_MULTIPLIER_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_digital_multiplier_limit(uvc_device_handle_t *devh, uint16_t *limit,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*limit = SW_TO_SHORT(data);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_digital_multiplier_limit(uvc_device_handle_t *devh, uint16_t limit) {\n\tuint8_t data[2];\n\tuvc_error_t ret;\n\n\tSHORT_TO_SW(limit, data);\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_analog_video_standard(uvc_device_handle_t *devh, uint8_t *standard,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_ANALOG_VIDEO_STANDARD_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*standard = data[0];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_analog_video_standard(uvc_device_handle_t *devh, uint8_t standard) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tdata[0] = standard;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_ANALOG_VIDEO_STANDARD_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n\nuvc_error_t uvc_get_analog_video_lockstate(uvc_device_handle_t *devh, uint8_t *lock_state,\n\t\tenum uvc_req_code req_code) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_GET, req_code,\n\t\t\tUVC_PU_ANALOG_LOCK_STATUS_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data))) {\n\t\t*lock_state = data[0];\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\treturn ret;\n\t}\n\tRETURN(-1, uvc_error_t);\n}\n\nuvc_error_t uvc_set_analog_video_lockstate(uvc_device_handle_t *devh, uint8_t lock_state) {\n\tuint8_t data[1];\n\tuvc_error_t ret;\n\n\tdata[0] = lock_state;\n\n\tret = libusb_control_transfer(devh->usb_devh, REQ_TYPE_SET, UVC_SET_CUR,\n\t\t\tUVC_PU_ANALOG_LOCK_STATUS_CONTROL << 8,\n\t\t\tdevh->info->ctrl_if.processing_unit_descs->request,\n\t\t\tdata, sizeof(data), CTRL_TIMEOUT_MILLIS);\n\n\tif (LIKELY(ret == sizeof(data)))\n\t\treturn UVC_SUCCESS;\n\telse\n\t\treturn ret;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/ctrl_original.c",
    "content": "/*********************************************************************\n* Software License Agreement (BSD License)\n*\n*  Copyright (C) 2010-2012 Ken Tossell\n*  All rights reserved.\n*\n*  Redistribution and use in source and binary forms, with or without\n*  modification, are permitted provided that the following conditions\n*  are met:\n*\n*   * Redistributions of source code must retain the above copyright\n*     notice, this list of conditions and the following disclaimer.\n*   * Redistributions in binary form must reproduce the above\n*     copyright notice, this list of conditions and the following\n*     disclaimer in the documentation and/or other materials provided\n*     with the distribution.\n*   * Neither the name of the author nor other contributors may be\n*     used to endorse or promote products derived from this software\n*     without specific prior written permission.\n*\n*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n*  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n*  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n*  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n*  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n*  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n*  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n*  POSSIBILITY OF SUCH DAMAGE.\n*********************************************************************/\n/**\n * @defgroup ctrl Video capture and processing control\n */\n\n#include \"libuvc/libuvc.h\"\n#include \"libuvc/libuvc_internal.h\"\n\nstatic const int REQ_TYPE_SET = 0x21;\nstatic const int REQ_TYPE_GET = 0xa1;\n\nuvc_error_t uvc_get_power_mode(uvc_device_handle_t *devh, enum uvc_device_power_mode *mode, enum uvc_req_code req_code) {\n  uint8_t mode_char;\n  uvc_error_t ret;\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_GET, req_code,\n    UVC_VC_VIDEO_POWER_MODE_CONTROL << 8,\n    0,\n    &mode_char,\n    sizeof(mode_char),\n    0);\n\n  if (ret == 1) {\n    *mode = mode_char;\n    return UVC_SUCCESS;\n  } else {\n    return ret;\n  }\n}\n\nuvc_error_t uvc_set_power_mode(uvc_device_handle_t *devh, enum uvc_device_power_mode mode) {\n  uint8_t mode_char = mode;\n  uvc_error_t ret;\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_SET, UVC_SET_CUR,\n    UVC_VC_VIDEO_POWER_MODE_CONTROL << 8,\n    0,\n    &mode_char,\n    sizeof(mode_char),\n    0);\n\n  if (ret == 1)\n    return UVC_SUCCESS;\n  else\n    return ret;\n}\n\n/***** CAMERA TERMINAL CONTROLS *****/\n\nuvc_error_t uvc_get_ae_mode(uvc_device_handle_t *devh, int *mode, enum uvc_req_code req_code) {\n  uint8_t data[1];\n  uvc_error_t ret;\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_GET, req_code,\n    UVC_CT_AE_MODE_CONTROL << 8,\n    1 << 8,\n    data,\n    sizeof(data),\n    0);\n\n  if (ret == sizeof(data)) {\n    *mode = data[0];\n    return UVC_SUCCESS;\n  } else {\n    return ret;\n  }\n}\n\nuvc_error_t uvc_set_ae_mode(uvc_device_handle_t *devh, int mode) {\n  uint8_t data[1];\n  uvc_error_t ret;\n\n  data[0] = mode;\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_SET, UVC_SET_CUR,\n    UVC_CT_AE_MODE_CONTROL << 8,\n    1 << 8,\n    data,\n    sizeof(data),\n    0);\n\n  if (ret == sizeof(data))\n    return UVC_SUCCESS;\n  else\n    return ret;\n}\n\nuvc_error_t uvc_get_ae_priority(uvc_device_handle_t *devh, uint8_t *priority, enum uvc_req_code req_code) {\n  uint8_t data[1];\n  uvc_error_t ret;\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_GET, req_code,\n    UVC_CT_AE_PRIORITY_CONTROL << 8,\n    1 << 8,\n    data,\n    sizeof(data),\n    0);\n\n  if (ret == sizeof(data)) {\n    *priority = data[0];\n    return UVC_SUCCESS;\n  } else {\n    return ret;\n  }\n}\n\nuvc_error_t uvc_set_ae_priority(uvc_device_handle_t *devh, uint8_t priority) {\n  uint8_t data[1];\n  uvc_error_t ret;\n\n  data[0] = priority;\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_SET, UVC_SET_CUR,\n    UVC_CT_AE_PRIORITY_CONTROL << 8,\n    1 << 8,\n    data,\n    sizeof(data),\n    0);\n\n  if (ret == sizeof(data))\n    return UVC_SUCCESS;\n  else\n    return ret;\n}\n\nuvc_error_t uvc_get_exposure_abs(uvc_device_handle_t *devh, int *time, enum uvc_req_code req_code) {\n  uint8_t data[4];\n  uvc_error_t ret;\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_GET, req_code,\n    UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL << 8,\n    1 << 8,\n    data,\n    sizeof(data),\n    0);\n\n  if (ret == sizeof(data)) {\n    *time = DW_TO_INT(data);\n    return UVC_SUCCESS;\n  } else {\n    return ret;\n  }\n}\n\nuvc_error_t uvc_set_exposure_abs(uvc_device_handle_t *devh, int time) {\n  uint8_t data[4];\n  uvc_error_t ret;\n\n  INT_TO_DW(time, data);\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_SET, UVC_SET_CUR,\n    UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL << 8,\n    1 << 8,\n    data,\n    sizeof(data),\n    0);\n\n  if (ret == sizeof(data))\n    return UVC_SUCCESS;\n  else\n    return ret;\n}\n\nuvc_error_t uvc_get_exposure_rel(uvc_device_handle_t *devh, int *step, enum uvc_req_code req_code) {\n  uint8_t data[1];\n  uvc_error_t ret;\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_GET, req_code,\n    UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL << 8,\n    1 << 8,\n    data,\n    sizeof(data),\n    0);\n\n  if (ret == sizeof(data)) {\n    *step = data[0];\n    return UVC_SUCCESS;\n  } else {\n    return ret;\n  }\n}\n\nuvc_error_t uvc_set_exposure_rel(uvc_device_handle_t *devh, int step) {\n  uint8_t data[1];\n  uvc_error_t ret;\n\n  data[0] = step;\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_SET, UVC_SET_CUR,\n    UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL << 8,\n    1 << 8,\n    data,\n    sizeof(data),\n    0);\n\n  if (ret == sizeof(data))\n    return UVC_SUCCESS;\n  else\n    return ret;\n}\n\nuvc_error_t uvc_get_scanning_mode(uvc_device_handle_t *devh, int *step, enum uvc_req_code req_code) {\n  uint8_t data[1];\n  uvc_error_t ret;\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_GET, req_code,\n    UVC_CT_SCANNING_MODE_CONTROL << 8,\n    1 << 8,\n    data,\n    sizeof(data),\n    0);\n\n  if (ret == sizeof(data)) {\n    *step = data[0];\n    return UVC_SUCCESS;\n  } else {\n    return ret;\n  }\n}\n\nuvc_error_t uvc_set_scanning_mode(uvc_device_handle_t *devh, int mode) {\n  uint8_t data[1];\n  uvc_error_t ret;\n\n  data[0] = mode;\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_SET, UVC_SET_CUR,\n    UVC_CT_SCANNING_MODE_CONTROL << 8,\n    1 << 8,\n    data,\n    sizeof(data),\n    0);\n\n  if (ret == sizeof(data))\n    return UVC_SUCCESS;\n  else\n    return ret;\n}\n\nuvc_error_t uvc_get_focus_abs(uvc_device_handle_t *devh, short *focus, enum uvc_req_code req_code) {\n  uint8_t data[2];\n  uvc_error_t ret;\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_GET, req_code,\n    UVC_CT_FOCUS_ABSOLUTE_CONTROL << 8,\n    1 << 8,\n    data,\n    sizeof(data),\n    0);\n\n  if (ret == sizeof(data)) {\n    *focus = SW_TO_SHORT(data);\n    return UVC_SUCCESS;\n  } else {\n    return ret;\n  }\n}\n\nuvc_error_t uvc_set_focus_abs(uvc_device_handle_t *devh, short focus) {\n  uint8_t data[2];\n  uvc_error_t ret;\n\n  SHORT_TO_SW(focus, data);\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_SET, UVC_SET_CUR,\n    UVC_CT_FOCUS_ABSOLUTE_CONTROL << 8,\n    1 << 8,\n    data,\n    sizeof(data),\n    0);\n\n  if (ret == sizeof(data))\n    return UVC_SUCCESS;\n  else\n    return ret;\n}\n\n/** @todo focus_rel, focus_auto_control */\n/** @todo iris_abs_ctrl, iris_rel_ctrl */\n/** @todo zoom_abs, zoom_rel */\n\nuvc_error_t uvc_get_pantilt_abs(uvc_device_handle_t *devh, int *pan, int *tilt, enum uvc_req_code req_code) {\n  uint8_t data[8];\n  uvc_error_t ret;\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_GET, req_code,\n    UVC_CT_PANTILT_ABSOLUTE_CONTROL << 8,\n    1 << 8,\n    data,\n    sizeof(data),\n    0);\n\n  if (ret == sizeof(data)) {\n    *pan = DW_TO_INT(data);\n    *tilt = DW_TO_INT(data + 4);\n    return UVC_SUCCESS;\n  } else {\n    return ret;\n  }\n}\n\nuvc_error_t uvc_set_pantilt_abs(uvc_device_handle_t *devh, int pan, int tilt) {\n  uint8_t data[8];\n  uvc_error_t ret;\n\n  INT_TO_DW(pan, data);\n  INT_TO_DW(tilt, data + 4);\n\n  ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_SET, UVC_SET_CUR,\n    UVC_CT_PANTILT_ABSOLUTE_CONTROL << 8,\n    1 << 8,\n    data,\n    sizeof(data),\n    0);\n\n  if (ret == sizeof(data))\n    return UVC_SUCCESS;\n  else\n    return ret;\n}\n\n/** @todo pantilt_rel */\n\n/** @todo roll_abs, roll_rel */\n\n/** @todo privacy */\n\n/***** SELECTOR UNIT CONTROLS *****/\n\n/** @todo input_select */\n\n/***** PROCESSING UNIT CONTROLS *****/\n\n/***** GENERIC CONTROLS *****/\n/**\n * @brief Get the length of a control on a terminal or unit.\n * \n * @param devh UVC device handle\n * @param unit Unit or Terminal ID; obtain this from the uvc_extension_unit_t describing the extension unit\n * @param ctrl Vendor-specific control number to query\n * @return On success, the length of the control as reported by the device. Otherwise,\n *   a uvc_error_t error describing the error encountered.\n */\nint uvc_get_ctrl_len(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl) {\n  unsigned char buf[2];\n\n  int ret = libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_GET, UVC_GET_LEN,\n    ctrl << 8,\n    unit << 8,\n    buf,\n    2,\n    0 /* timeout */);\n\n  if (ret < 0)\n    return ret;\n  else\n    return (unsigned short)SW_TO_SHORT(buf);\n}\n\n/**\n * @brief Perform a GET_* request from an extension unit.\n * \n * @param devh UVC device handle\n * @param unit Unit ID; obtain this from the uvc_extension_unit_t describing the extension unit\n * @param ctrl Control number to query\n * @param data Data buffer to be filled by the device\n * @param len Size of data buffer\n * @param req_code GET_* request to execute\n * @return On success, the number of bytes actually transferred. Otherwise,\n *   a uvc_error_t error describing the error encountered.\n */\nint uvc_get_ctrl(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl, void *data, int len, enum uvc_req_code req_code) {\n  return libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_GET, req_code,\n    ctrl << 8,\n    unit << 8,\n    data,\n    len,\n    0 /* timeout */);\n}\n\n/**\n * @brief Perform a SET_CUR request to a terminal or unit.\n * \n * @param devh UVC device handle\n * @param unit Unit or Terminal ID\n * @param ctrl Control number to set\n * @param data Data buffer to be sent to the device\n * @param len Size of data buffer\n * @return On success, the number of bytes actually transferred. Otherwise,\n *   a uvc_error_t error describing the error encountered.\n */\nint uvc_set_ctrl(uvc_device_handle_t *devh, uint8_t unit, uint8_t ctrl, void *data, int len) {\n  return libusb_control_transfer(\n    devh->usb_devh,\n    REQ_TYPE_SET, UVC_SET_CUR,\n    ctrl << 8,\n    unit << 8,\n    data,\n    len,\n    0 /* timeout */);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/device.c",
    "content": "/*********************************************************************\n *********************************************************************/\n/*********************************************************************\n * add and modified some functions to support non-rooted Android devices\n * and modified some function for optimaization with gcc\n * Copyright (C) 2014-2016 saki@serenegiant All rights reserved.\n *********************************************************************/\n/*********************************************************************\n * Software License Agreement (BSD License)\n *\n *  Copyright (C) 2010-2012 Ken Tossell\n *  All rights reserved.\n *\n *  Redistribution and use in source and binary forms, with or without\n *  modification, are permitted provided that the following conditions\n *  are met:\n *\n *   * Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n *   * Redistributions in binary form must reproduce the above\n *     copyright notice, this list of conditions and the following\n *     disclaimer in the documentation and/or other materials provided\n *     with the distribution.\n *   * Neither the name of the author nor other contributors may be\n *     used to endorse or promote products derived from this software\n *     without specific prior written permission.\n *\n *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n *  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n *  POSSIBILITY OF SUCH DAMAGE.\n *********************************************************************/\n/**\n * @defgroup device Device handling and enumeration\n * @brief Support for finding, inspecting and opening UVC devices\n */\n\n#define LOCAL_DEBUG 0\n\n#define LOG_TAG \"libuvc/device\"\n#if 1\t// デバッグ情報を出さない時1\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// LOGV/LOGD/MARKを出力しない時\n\t\t#endif\n\t#undef USE_LOGALL\t\t\t// 指定したLOGxだけを出力\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n\t#undef NDEBUG\n\t#define GET_RAW_DESCRIPTOR\n#endif\n\n#include \"libuvc/libuvc.h\"\n#include \"libuvc/libuvc_internal.h\"\n\n#define UVC_DETACH_ATTACH 0\t// set this 1 attach/detach kernel driver by libuvc, set this 0 automatically attach/detach by libusb\n\nint uvc_already_open(uvc_context_t *ctx, struct libusb_device *usb_dev);\nvoid uvc_free_devh(uvc_device_handle_t *devh);\n\nuvc_error_t uvc_get_device_info(uvc_device_t *dev, uvc_device_info_t **info);\nvoid uvc_free_device_info(uvc_device_info_t *info);\n\nuvc_error_t uvc_scan_control(uvc_device_t *dev, uvc_device_info_t *info);\nuvc_error_t uvc_parse_vc(uvc_device_t *dev, uvc_device_info_t *info,\n\t\tconst unsigned char *block, size_t block_size);\nuvc_error_t uvc_parse_vc_extension_unit(uvc_device_t *dev,\n\t\tuvc_device_info_t *info, const unsigned char *block, size_t block_size);\nuvc_error_t uvc_parse_vc_header(uvc_device_t *dev, uvc_device_info_t *info,\n\t\tconst unsigned char *block, size_t block_size);\nuvc_error_t uvc_parse_vc_input_terminal(uvc_device_t *dev,\n\t\tuvc_device_info_t *info, const unsigned char *block, size_t block_size);\nuvc_error_t uvc_parse_vc_processing_unit(uvc_device_t *dev,\n\t\tuvc_device_info_t *info, const unsigned char *block, size_t block_size);\n\nuvc_error_t uvc_scan_streaming(uvc_device_t *dev, uvc_device_info_t *info,\n\t\tint interface_idx);\nuvc_error_t uvc_parse_vs(uvc_device_t *dev, uvc_device_info_t *info,\n\t\tuvc_streaming_interface_t *stream_if, const unsigned char *block,\n\t\tsize_t block_size);\nuvc_error_t uvc_parse_vs_format_uncompressed(\n\t\tuvc_streaming_interface_t *stream_if, const unsigned char *block,\n\t\tsize_t block_size);\nuvc_error_t uvc_parse_vs_format_mjpeg(uvc_streaming_interface_t *stream_if,\n\t\tconst unsigned char *block, size_t block_size);\nuvc_error_t uvc_parse_vs_frame_uncompressed(\n\t\tuvc_streaming_interface_t *stream_if, const unsigned char *block,\n\t\tsize_t block_size);\nuvc_error_t uvc_parse_vs_frame_format(uvc_streaming_interface_t *stream_if,\n\t    const unsigned char *block,\n\t    size_t block_size);\nuvc_error_t uvc_parse_vs_frame_frame(uvc_streaming_interface_t *stream_if,\n\t    const unsigned char *block,\n\t    size_t block_size);\nuvc_error_t uvc_parse_vs_input_header(uvc_streaming_interface_t *stream_if,\n\t\tconst unsigned char *block, size_t block_size);\n\nvoid _uvc_status_callback(struct libusb_transfer *transfer);\n\n/** @internal\n * @brief Test whether the specified USB device has been opened as a UVC device\n * @ingroup device\n *\n * @param ctx Context in which to search for the UVC device\n * @param usb_dev USB device to find\n * @return true if the device is open in this context\n */\nint uvc_already_open(uvc_context_t *ctx, struct libusb_device *usb_dev) {\n\tuvc_device_handle_t *devh;\n\n\tDL_FOREACH(ctx->open_devices, devh)\n\t{\n\t\tif (usb_dev == devh->dev->usb_dev)\n\t\t\treturn 1;\n\t}\n\n\treturn 0;\n}\n\n/** @brief Finds a camera identified by vendor, product and/or serial number\n * @ingroup device\n *\n * @param[in] ctx UVC context in which to search for the camera\n * @param[out] dev Reference to the camera, or NULL if not found\n * @param[in] vid Vendor ID number, optional\n * @param[in] pid Product ID number, optional\n * @param[in] sn Serial number or NULL\n * @return Error finding device or UVC_SUCCESS\n */\nuvc_error_t uvc_find_device(uvc_context_t *ctx, uvc_device_t **dev, int vid,\n\t\tint pid, const char *sn) {\n\tuvc_error_t ret = UVC_SUCCESS;\n\n\tuvc_device_t **list;\n\tuvc_device_t *test_dev;\n\tint dev_idx;\n\tint found_dev;\n\n\tUVC_ENTER();\n\n\tret = uvc_get_device_list(ctx, &list);\n\n\tif (UNLIKELY(ret != UVC_SUCCESS)) {\n\t\tUVC_EXIT(ret);\n\t\treturn ret;\n\t}\n\n\tdev_idx = 0;\n\tfound_dev = 0;\n\n\twhile (!found_dev && (test_dev = list[dev_idx++]) != NULL ) {\n\t\tuvc_device_descriptor_t *desc;\n\n\t\tif (uvc_get_device_descriptor(test_dev, &desc) != UVC_SUCCESS)\n\t\t\tcontinue;\n\n\t\tif ((!vid || desc->idVendor == vid) && (!pid || desc->idProduct == pid)\n\t\t\t\t&& (!sn || (desc->serialNumber && !strcmp(desc->serialNumber, sn))))\n\t\t\tfound_dev = 1;\n\n\t\tuvc_free_device_descriptor(desc);\n\t}\n\n\tif (found_dev)\n\t\tuvc_ref_device(test_dev);\n\n\tuvc_free_device_list(list, 1);\n\n\tif (found_dev) {\n\t\t*dev = test_dev;\n\t\tUVC_EXIT(UVC_SUCCESS);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\tUVC_EXIT(UVC_ERROR_NO_DEVICE);\n\t\treturn UVC_ERROR_NO_DEVICE;\n\t}\n}\n\n/**\n * XXX add for non-rooted Android devices\n * get uvc_device_t from specified vid/pid/serial\n * return UVC_ERROR_NO_DEVICE when device not found\n * return UVC_SUCCESS and set uvc_device_t when specific device found\n */\nuvc_error_t uvc_find_device2(uvc_context_t *ctx, uvc_device_t **device, int vid,\n\t\tint pid, const char *sn, int fd) {\n\n\tUVC_ENTER();\n\n\tLOGD(\"call libusb_find_device\");\n\tstruct libusb_device *usb_dev = libusb_find_device(ctx->usb_ctx, vid, pid, sn, fd);\n\n\tif (usb_dev) {\n\t\t*device = malloc(sizeof(uvc_device_t/* *device */));\n\t\t(*device)->ctx = ctx;\n\t\t(*device)->ref = 0;\n\t\t(*device)->usb_dev = usb_dev;\n\t\tlibusb_set_device_fd(usb_dev, fd);\t// assign fd to libusb_device for non-rooted Android devices\n\t\tuvc_ref_device(*device);\n\t\tUVC_EXIT(UVC_SUCCESS);\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\tLOGE(\"could not find specific device\");\n\t\t*device = NULL;\n\t}\n\tUVC_EXIT(UVC_ERROR_NO_DEVICE);\n\treturn UVC_ERROR_NO_DEVICE;\n}\n\n/**\n * XXX add for non-rooted Android device, >= Android7\n * generate fake libusb_device according to specific params\n * and set it to uvc_device_t to access UVC device on Android7 or later\n */\nuvc_error_t uvc_get_device_with_fd(uvc_context_t *ctx, uvc_device_t **device,\n\t\tint vid, int pid, const char *serial, int fd, int busnum, int devaddr) {\n\n\tENTER();\n\n\tLOGD(\"call libusb_get_device_with_fd\");\n\tstruct libusb_device *usb_dev = libusb_get_device_with_fd(ctx->usb_ctx, vid, pid, serial, fd, busnum, devaddr);\n\n\tif (LIKELY(usb_dev)) {\n\t\t*device = malloc(sizeof(uvc_device_t/* *device */));\n\t\t(*device)->ctx = ctx;\n\t\t(*device)->ref = 0;\n\t\t(*device)->usb_dev = usb_dev;\n//\t\tlibusb_set_device_fd(usb_dev, fd);\t// assign fd to libusb_device for non-rooted Android devices\n\t\tuvc_ref_device(*device);\n\t\tUVC_EXIT(UVC_SUCCESS);\n\t\tRETURN(UVC_SUCCESS, int);\n\t} else {\n\t\tLOGE(\"could not find specific device\");\n\t\t*device = NULL;\n\t\tRETURN(UVC_ERROR_NO_DEVICE, int);\n\t}\n\n}\n\n/** @brief Get the number of the bus to which the device is attached\n * @ingroup device\n */\nuint8_t uvc_get_bus_number(uvc_device_t *dev) {\n\treturn libusb_get_bus_number(dev->usb_dev);\n}\n\n/** @brief Get the number assigned to the device within its bus\n * @ingroup device\n */\nuint8_t uvc_get_device_address(uvc_device_t *dev) {\n\treturn libusb_get_device_address(dev->usb_dev);\n}\n\n/** @brief Open a UVC device\n * @ingroup device\n *\n * @param dev Device to open\n * @param[out] devh Handle on opened device\n * @return Error opening device or SUCCESS\n */\nuvc_error_t uvc_open(uvc_device_t *dev, uvc_device_handle_t **devh) {\n\tuvc_error_t ret;\n\tstruct libusb_device_handle *usb_devh;\n\tuvc_device_handle_t *internal_devh;\n\tstruct libusb_device_descriptor desc;\n\n\tUVC_ENTER();\n\n\tret = libusb_open(dev->usb_dev, &usb_devh);\n\tUVC_DEBUG(\"libusb_open() = %d\", ret);\n\n\tif (UNLIKELY(ret != UVC_SUCCESS)) {\n\t\tUVC_EXIT(ret);\n\t\treturn ret;\n\t}\n\n\tuvc_ref_device(dev);\n\n\tinternal_devh = calloc(1, sizeof(*internal_devh));\n\tinternal_devh->dev = dev;\n\tinternal_devh->usb_devh = usb_devh;\n\tinternal_devh->reset_on_release_if = 0;\t// XXX\n\tret = uvc_get_device_info(dev, &(internal_devh->info));\n\tpthread_mutex_init(&internal_devh->status_mutex, NULL);\t// XXX saki\n\n\tif (UNLIKELY(ret != UVC_SUCCESS))\n\t\tgoto fail2;\t// uvc_claim_if was not called yet and we don't need to call uvc_release_if\n#if !UVC_DETACH_ATTACH\n\t/* enable automatic attach/detach kernel driver on supported platforms in libusb */\n\tlibusb_set_auto_detach_kernel_driver(usb_devh, 1);\n#endif\n\tUVC_DEBUG(\"claiming control interface %d\",\n\t\t\tinternal_devh->info->ctrl_if.bInterfaceNumber);\n\tret = uvc_claim_if(internal_devh,\n\t\t\tinternal_devh->info->ctrl_if.bInterfaceNumber);\n\tif (UNLIKELY(ret != UVC_SUCCESS))\n\t\tgoto fail;\n\n\tlibusb_get_device_descriptor(dev->usb_dev, &desc);\n\tinternal_devh->is_isight = (desc.idVendor == 0x05ac && desc.idProduct == 0x8501);\n\n\tif (internal_devh->info->ctrl_if.bEndpointAddress) {\n\t\tUVC_DEBUG(\"status check transfer:bEndpointAddress=0x%02x\", internal_devh->info->ctrl_if.bEndpointAddress);\n\t\tinternal_devh->status_xfer = libusb_alloc_transfer(0);\n\t\tif (UNLIKELY(!internal_devh->status_xfer)) {\n\t\t\tret = UVC_ERROR_NO_MEM;\n\t\t\tgoto fail;\n\t\t}\n\n\t\tlibusb_fill_interrupt_transfer(internal_devh->status_xfer, usb_devh,\n\t\t\t\tinternal_devh->info->ctrl_if.bEndpointAddress,\n\t\t\t\tinternal_devh->status_buf, sizeof(internal_devh->status_buf),\n\t\t\t\t_uvc_status_callback, internal_devh, 0);\n\t\tret = libusb_submit_transfer(internal_devh->status_xfer);\n\t\tUVC_DEBUG(\"libusb_submit_transfer() = %d\", ret);\n\n\t\tif (UNLIKELY(ret)) {\n\t\t\tLOGE(\"device has a status interrupt endpoint, but unable to read from it\");\n\t\t\tgoto fail;\n\t\t}\n\t} else {\n\t\tLOGE(\"internal_devh->info->ctrl_if.bEndpointAddress is null\");\n\t}\n\n\tif (dev->ctx->own_usb_ctx && dev->ctx->open_devices == NULL) {\n\t\t/* Since this is our first device, we need to spawn the event handler thread */\n\t\tuvc_start_handler_thread(dev->ctx);\n\t}\n\n\tDL_APPEND(dev->ctx->open_devices, internal_devh);\n\t*devh = internal_devh;\n\n\tUVC_EXIT(ret);\n\n\treturn ret;\n\nfail:\n\tuvc_release_if(internal_devh, internal_devh->info->ctrl_if.bInterfaceNumber);\t// XXX crash, assume when uvc_get_device_info failed.\nfail2:\n#if !UVC_DETACH_ATTACH\n\t/* disable automatic attach/detach kernel driver on supported platforms in libusb */\n\tlibusb_set_auto_detach_kernel_driver(usb_devh, 0);\n#endif\n\tlibusb_close(usb_devh);\n\tuvc_unref_device(dev);\n\tuvc_free_devh(internal_devh);\n\n\tUVC_EXIT(ret);\n\n\treturn ret;\n}\n\n/**\n * @internal\n * @brief Parses the complete device descriptor for a device\n * @ingroup device\n * @note Free *info with uvc_free_device_info when you're done\n *\n * @param dev Device to parse descriptor for\n * @param info Where to store a pointer to the new info struct\n */\nuvc_error_t uvc_get_device_info(uvc_device_t *dev, uvc_device_info_t **info) {\n\tuvc_error_t ret;\n\tuvc_device_info_t *internal_info;\n\n\tUVC_ENTER();\n\n\tinternal_info = calloc(1, sizeof(*internal_info));\n\tif (!internal_info) {\n\t\tUVC_EXIT(UVC_ERROR_NO_MEM);\n\t\treturn UVC_ERROR_NO_MEM;\n\t}\n\tif (libusb_get_config_descriptor(dev->usb_dev, 0, &(internal_info->config)) != 0) {\n//\tif (libusb_get_active_config_descriptor(dev->usb_dev, &(internal_info->config)) != 0) {\n\t\t// XXX assume libusb_get_active_config_descriptor　is better\n\t\t// but some buggy device will return error when get active config.\n\t\t// so we will use libusb_get_config_descriptor...\n\t\tfree(internal_info);\n\t\tUVC_EXIT(UVC_ERROR_IO);\n\t\treturn UVC_ERROR_IO;\n\t}\n\n\tret = uvc_scan_control(dev, internal_info);\n\tif (UNLIKELY(ret)) {\n\t\tuvc_free_device_info(internal_info);\n\t\tUVC_EXIT(ret);\n\t\treturn ret;\n\t}\n\n\t*info = internal_info;\n\n\tUVC_EXIT(ret);\n\treturn ret;\n}\n\n/**\n * @internal\n * @brief Frees the device descriptor for a device\n * @ingroup device\n *\n * @param info Which device info block to free\n */\nvoid uvc_free_device_info(uvc_device_info_t *info) {\n\tuvc_input_terminal_t *input_term, *input_term_tmp;\n\tuvc_output_terminal_t *output_term, *output_term_tmp;\n\tuvc_processing_unit_t *proc_unit, *proc_unit_tmp;\n\tuvc_extension_unit_t *ext_unit, *ext_unit_tmp;\n\n\tuvc_streaming_interface_t *stream_if, *stream_if_tmp;\n\tuvc_format_desc_t *format, *format_tmp;\n\tuvc_frame_desc_t *frame, *frame_tmp;\n\n\tUVC_ENTER();\n\n\tDL_FOREACH_SAFE(info->ctrl_if.input_term_descs, input_term, input_term_tmp)\n\t{\n\t\tDL_DELETE(info->ctrl_if.input_term_descs, input_term);\n\t\tfree(input_term);\n\t}\n\n\tDL_FOREACH_SAFE(info->ctrl_if.output_term_descs, output_term, output_term_tmp)\n\t{\n\t\tDL_DELETE(info->ctrl_if.output_term_descs, output_term);\n\t\tfree(output_term);\n\t}\n\n\tDL_FOREACH_SAFE(info->ctrl_if.processing_unit_descs, proc_unit, proc_unit_tmp)\n\t{\n\t\tDL_DELETE(info->ctrl_if.processing_unit_descs, proc_unit);\n\t\tfree(proc_unit);\n\t}\n\n\tDL_FOREACH_SAFE(info->ctrl_if.extension_unit_descs, ext_unit, ext_unit_tmp)\n\t{\n\t\tDL_DELETE(info->ctrl_if.extension_unit_descs, ext_unit);\n\t\tfree(ext_unit);\n\t}\n\n\tDL_FOREACH_SAFE(info->stream_ifs, stream_if, stream_if_tmp)\n\t{\n\t\tDL_FOREACH_SAFE(stream_if->format_descs, format, format_tmp)\n\t\t{\n\t\t\tDL_FOREACH_SAFE(format->frame_descs, frame, frame_tmp)\n\t\t\t{\n\t\t\t\tif (frame->intervals)\n\t\t\t\t\tfree(frame->intervals);\n\n\t\t\t\tDL_DELETE(format->frame_descs, frame);\n\t\t\t\tfree(frame);\n\t\t\t}\n\n\t\t\tDL_DELETE(stream_if->format_descs, format);\n\t\t\tfree(format);\n\t\t}\n\n\t\tDL_DELETE(info->stream_ifs, stream_if);\n\t\tfree(stream_if->bmaControls);\t// XXX\n\t\tfree(stream_if);\n\t}\n\n\tif (info->config)\n\t\tlibusb_free_config_descriptor(info->config);\n\n\tfree(info);\n\n\tUVC_EXIT_VOID();\n}\n\n/**\n * @brief Get a descriptor that contains the general information about\n * a device\n * @ingroup device\n *\n * Free *desc with uvc_free_device_descriptor when you're done.\n *\n * @param dev Device to fetch information about\n * @param[out] desc Descriptor structure\n * @return Error if unable to fetch information, else SUCCESS\n */\nuvc_error_t uvc_get_device_descriptor(uvc_device_t *dev,\n\t\tuvc_device_descriptor_t **desc) {\n\n\tuvc_device_descriptor_t *desc_internal;\n\tstruct libusb_device_descriptor usb_desc;\n\tstruct libusb_device_handle *usb_devh;\n\tuvc_error_t ret;\n\n\tUVC_ENTER();\n\n\tret = libusb_get_device_descriptor(dev->usb_dev, &usb_desc);\n\n\tif (UNLIKELY(ret)) {\n\t\tUVC_EXIT(ret);\n\t\treturn ret;\n\t}\n\n\tdesc_internal = calloc(1, sizeof(*desc_internal));\n\tdesc_internal->idVendor = usb_desc.idVendor;\n\tdesc_internal->idProduct = usb_desc.idProduct;\n\n\tif (libusb_open(dev->usb_dev, &usb_devh) == 0) {\n\t\tunsigned char str_buf[255];\t// XXX 64 => 255\n\t\t// get serialNumber\n\t\tint str_bytes = libusb_get_string_descriptor_ascii(usb_devh,\n\t\t\tusb_desc.iSerialNumber, str_buf, sizeof(str_buf));\n\n\t\tif (str_bytes > 0)\n\t\t\tdesc_internal->serialNumber = strdup((const char*) str_buf);\n\n\t\t// get manufacturer\n\t\tstr_bytes = libusb_get_string_descriptor_ascii(usb_devh,\n\t\t\tusb_desc.iManufacturer, str_buf, sizeof(str_buf));\n\n\t\tif (str_bytes > 0)\n\t\t\tdesc_internal->manufacturer = strdup((const char*) str_buf);\n\n\t\t// get product name\n\t\tstr_bytes = libusb_get_string_descriptor_ascii(usb_devh,\n\t\t\tusb_desc.iProduct, str_buf, sizeof(str_buf));\n\n\t\tif (str_bytes > 0)\n\t\t\tdesc_internal->product = strdup((const char*) str_buf);\n\n\t\tlibusb_close(usb_devh);\n\t} else {\n\t\tUVC_DEBUG(\"can't open device %04x:%04x, not fetching serial\",\n\t\t\t\tusb_desc.idVendor, usb_desc.idProduct);\n\t}\n\n\t*desc = desc_internal;\n\n\tUVC_EXIT(ret);\n\treturn ret;\n}\n\n/**\n * @brief Frees a device descriptor created with uvc_get_device_descriptor\n * @ingroup device\n *\n * @param desc Descriptor to free\n */\nvoid uvc_free_device_descriptor(uvc_device_descriptor_t *desc) {\n\tUVC_ENTER();\n\n\tif (desc->serialNumber)\n\t\tfree((void*) desc->serialNumber);\n\n\tif (desc->manufacturer)\n\t\tfree((void*) desc->manufacturer);\n\n\tif (desc->product)\n\t\tfree((void*) desc->product);\n\n\tfree(desc);\n\n\tUVC_EXIT_VOID();\n}\n\n/**\n * @brief Get a list of the UVC devices attached to the system\n * @ingroup device\n *\n * @note Free the list with uvc_free_device_list when you're done.\n *\n * @param ctx UVC context in which to list devices\n * @param list List of uvc_device structures\n * @return Error if unable to list devices, else SUCCESS\n */\nuvc_error_t uvc_get_device_list(uvc_context_t *ctx, uvc_device_t ***list) {\n\tuvc_error_t ret;\n\tstruct libusb_device **usb_dev_list;\n\tstruct libusb_device *usb_dev;\n\tint num_usb_devices;\n\n\tuvc_device_t **list_internal;\n\tint num_uvc_devices;\n\n\t/* per device */\n\tint dev_idx;\n\tstruct libusb_device_handle *usb_devh;\n\tstruct libusb_config_descriptor *config;\n\tstruct libusb_device_descriptor desc;\n\tuint8_t got_interface;\n\n\t/* per interface */\n\tint interface_idx;\n\tconst struct libusb_interface *interface;\n\n\t/* per altsetting */\n\tint altsetting_idx;\n\tconst struct libusb_interface_descriptor *if_desc;\n\n\tUVC_ENTER();\n\n\tnum_usb_devices = libusb_get_device_list(ctx->usb_ctx, &usb_dev_list);\n\n\tif (UNLIKELY(num_usb_devices < 0)) {\n\t\tUVC_EXIT(UVC_ERROR_IO);\n\t\treturn UVC_ERROR_IO;\n\t}\n\n\tlist_internal = malloc(sizeof(*list_internal));\n\t*list_internal = NULL;\n\n\tnum_uvc_devices = 0;\n\tdev_idx = -1;\n\n\twhile ((usb_dev = usb_dev_list[++dev_idx]) != NULL ) {\n\t\tusb_devh = NULL;\n\t\tgot_interface = 0;\n\n\t\tif (libusb_get_config_descriptor(usb_dev, 0, &config) != 0)\n\t\t\tcontinue;\n\n\t\tif (libusb_get_device_descriptor (usb_dev, &desc) != LIBUSB_SUCCESS)\n\t\t\tcontinue;\n\n\t\t// Special case for Imaging Source cameras\n\t\tif ((0x199e == desc.idVendor) && (0x8101 == desc.idProduct)) {\n\t\t\tgot_interface = 1;\n\t\t} else {\n\t\t\tfor (interface_idx = 0;\n\t\t\t\t\t!got_interface && interface_idx < config->bNumInterfaces;\n\t\t\t\t\t++interface_idx) {\n\t\t\t\tinterface = &config->interface[interface_idx];\n\n\t\t\t\tfor (altsetting_idx = 0;\n\t\t\t\t\t\t!got_interface && altsetting_idx < interface->num_altsetting;\n\t\t\t\t\t\t++altsetting_idx) {\n\t\t\t\t\tif_desc = &interface->altsetting[altsetting_idx];\n\n\t\t\t\t\t/* Video, Streaming */\n\t\t\t\t\tif (if_desc->bInterfaceClass == 14\n\t\t\t\t\t\t\t&& if_desc->bInterfaceSubClass == 2) {\n\t\t\t\t\t\tgot_interface = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlibusb_free_config_descriptor(config);\n\n\t\tif (got_interface) {\n\t\t\tuvc_device_t *uvc_dev = malloc(sizeof(*uvc_dev));\n\t\t\tuvc_dev->ctx = ctx;\n\t\t\tuvc_dev->ref = 0;\n\t\t\tuvc_dev->usb_dev = usb_dev;\n\t\t\tuvc_ref_device(uvc_dev);\n\n\t\t\tnum_uvc_devices++;\n\t\t\tlist_internal = realloc(list_internal,\n\t\t\t\t\t(num_uvc_devices + 1) * sizeof(*list_internal));\n\n\t\t\tlist_internal[num_uvc_devices - 1] = uvc_dev;\n\t\t\tlist_internal[num_uvc_devices] = NULL;\n\n\t\t\tUVC_DEBUG(\"    UVC: %d\", dev_idx);\n\t\t} else {\n\t\t\tUVC_DEBUG(\"non-UVC: %d\", dev_idx);\n\t\t}\n\t}\n\n\tlibusb_free_device_list(usb_dev_list, 1);\n\n\t*list = list_internal;\n\n\tUVC_EXIT(UVC_SUCCESS);\n\treturn UVC_SUCCESS;\n}\n\n/**\n * @brief Frees a list of device structures created with uvc_get_device_list.\n * @ingroup device\n *\n * @param list Device list to free\n * @param unref_devices Decrement the reference counter for each device\n * in the list, and destroy any entries that end up with zero references\n */\nvoid uvc_free_device_list(uvc_device_t **list, uint8_t unref_devices) {\n\tuvc_device_t *dev;\n\tint dev_idx = 0;\n\n\tUVC_ENTER();\n\n\tif (unref_devices) {\n\t\twhile ((dev = list[dev_idx++]) != NULL ) {\n\t\t\tuvc_unref_device(dev);\n\t\t}\n\t}\n\n\tfree(list);\n\n\tUVC_EXIT_VOID();\n}\n\n/**\n * @brief Get the uvc_device_t corresponding to an open device\n * @ingroup device\n *\n * @note Unref the uvc_device_t when you're done with it\n *\n * @param devh Device handle to an open UVC device\n */\nuvc_device_t *uvc_get_device(uvc_device_handle_t *devh) {\n\tuvc_ref_device(devh->dev);\n\treturn devh->dev;\n}\n\n/**\n * @brief Get the underlying libusb device handle for an open device\n * @ingroup device\n *\n * This can be used to access other interfaces on the same device, e.g.\n * a webcam microphone.\n *\n * @note The libusb device handle is only valid while the UVC device is open;\n * it will be invalidated upon calling uvc_close.\n *\n * @param devh UVC device handle to an open device\n */\nlibusb_device_handle *uvc_get_libusb_handle(uvc_device_handle_t *devh) {\n\treturn devh->usb_devh;\n}\n\n/**\n * @brief Get input terminal descriptors for the open device.\n *\n * @note Do not modify the returned structure.\n * @note The returned structure is part of a linked list. Iterate through\n *       it by using the 'next' pointers.\n *\n * @param devh Device handle to an open UVC device\n */\nconst uvc_input_terminal_t *uvc_get_input_terminals(uvc_device_handle_t *devh) {\n\treturn devh->info->ctrl_if.input_term_descs;\n}\n\n/**\n * @brief Get output terminal descriptors for the open device.\n *\n * @note Do not modify the returned structure.\n * @note The returned structure is part of a linked list. Iterate through\n *       it by using the 'next' pointers.\n *\n * @param devh Device handle to an open UVC device\n */\nconst uvc_output_terminal_t *uvc_get_output_terminals(uvc_device_handle_t *devh) {\n\treturn devh->info->ctrl_if.output_term_descs ;\n}\n\n/**\n * @brief Get processing unit descriptors for the open device.\n *\n * @note Do not modify the returned structure.\n * @note The returned structure is part of a linked list. Iterate through\n *       it by using the 'next' pointers.\n *\n * @param devh Device handle to an open UVC device\n */\nconst uvc_processing_unit_t *uvc_get_processing_units(uvc_device_handle_t *devh) {\n\treturn devh->info->ctrl_if.processing_unit_descs;\n}\n\n/**\n * @brief Get extension unit descriptors for the open device.\n *\n * @note Do not modify the returned structure.\n * @note The returned structure is part of a linked list. Iterate through\n *       it by using the 'next' pointers.\n *\n * @param devh Device handle to an open UVC device\n */\nconst uvc_extension_unit_t *uvc_get_extension_units(uvc_device_handle_t *devh) {\n\treturn devh->info->ctrl_if.extension_unit_descs;\n}\n\n/**\n * @brief Increment the reference count for a device\n * @ingroup device\n *\n * @param dev Device to reference\n */\nvoid uvc_ref_device(uvc_device_t *dev) {\n\tUVC_ENTER();\n\n\tdev->ref++;\t// これ排他制御要るんちゃうかなぁ(｡･_･｡)\n//\tLOGI(\"ref=%d\", dev->ref);\n\tlibusb_ref_device(dev->usb_dev);\n\n\tUVC_EXIT_VOID();\n}\n\n/**\n * @brief Decrement the reference count for a device\n * @ingropu device\n * @note If the count reaches zero, the device will be discarded\n *\n * @param dev Device to unreference\n */\nvoid uvc_unref_device(uvc_device_t *dev) {\n\tUVC_ENTER();\n\n\tlibusb_unref_device(dev->usb_dev);\n\tdev->ref--;\t// これ排他制御要るんちゃうかなぁ(｡･_･｡)\n\n//\tLOGI(\"ref=%d\", dev->ref);\n\tif (dev->ref == 0) {\n\t\tfree(dev);\n\t\tdev = NULL;\n\t}\n\n\tUVC_EXIT_VOID();\n}\n\n/** @internal\n * Claim a UVC interface, detaching the kernel driver if necessary.\n * @ingroup device\n *\n * @param devh UVC device handle\n * @param idx UVC interface index\n */\nuvc_error_t uvc_claim_if(uvc_device_handle_t *devh, int idx) {\n\tint ret;\n\n\tUVC_ENTER();\n#if !UVC_DETACH_ATTACH\n\t// libusb automatically attach/detach kernel driver on supported platforms\n\tUVC_DEBUG(\"claiming interface %d\", idx);\n\tret = libusb_claim_interface(devh->usb_devh, idx);\n#else\n\t/* Tell libusb to detach any active kernel drivers. libusb will keep track of whether\n\t * it found a kernel driver for this interface. */\n\tret = libusb_detach_kernel_driver(devh->usb_devh, idx);\n\t\n\tif LIKELY(!ret || ret == LIBUSB_ERROR_NOT_FOUND || ret == LIBUSB_ERROR_NOT_SUPPORTED) {\n\t\tUVC_DEBUG(\"claiming interface %d\", idx);\n\t\tret = libusb_claim_interface(devh->usb_devh, idx);\n\t} else {\n\t    UVC_DEBUG(\"not claiming interface %d: unable to detach kernel driver (%s)\",\n\t\t\tidx, uvc_strerror(ret));\n\t}\n#endif\n\tUVC_EXIT(ret);\n\treturn ret;\n}\n\n/** @internal\n * Release a UVC interface.\n * @ingroup device\n *\n * @param devh UVC device handle\n * @param idx UVC interface index\n */\nuvc_error_t uvc_release_if(uvc_device_handle_t *devh, int idx) {\n\tint ret;\n\n\tUVC_ENTER();\n\tUVC_DEBUG(\"releasing interface %d\", idx);\n\t/* libusb_release_interface *should* reset the alternate setting to the first available,\n\t but sometimes (e.g. on Darwin) it doesn't. Thus, we do it explicitly here.\n\t This is needed to de-initialize certain cameras. */\n\t// XXX but resetting the alt setting here manytimes leads trouble\n\t// on GT-N7100(international Galaxy Note2 at lease with Android4.4.2)\n\t// so we add flag to avoid the issue\n\tif (devh->reset_on_release_if)\n\t\tlibusb_set_interface_alt_setting(devh->usb_devh, idx, 0);\n\n\tret = libusb_release_interface(devh->usb_devh, idx);\n\n#if !UVC_DETACH_ATTACH\n\t// libusb automatically attach/detach kernel driver on supported platforms\n\t// and nothing to do here\n#else\n\tif (UVC_SUCCESS == ret) {\n\t\t/* Reattach any kernel drivers that were disabled when we claimed this interface */\n\t\tret = libusb_attach_kernel_driver(devh->usb_devh, idx);\n\n\t\tif LIKELY(!ret) {\n\t\t\tUVC_DEBUG(\"reattached kernel driver to interface %d\", idx);\n\t\t} else if (ret == LIBUSB_ERROR_NOT_FOUND || ret == LIBUSB_ERROR_NOT_SUPPORTED) {\n\t\t\tret = UVC_SUCCESS;  /* NOT_FOUND and NOT_SUPPORTED are OK: nothing to do */\n\t\t} else {\n\t\t\tUVC_DEBUG(\"error reattaching kernel driver to interface %d: %s\",\n                idx, uvc_strerror(ret));\n\t\t}\n\t}\n#endif\n\tUVC_EXIT(ret);\n\treturn ret;\n}\n\n/** @internal\n * Find a device's VideoControl interface and process its descriptor\n * @ingroup device\n */\nuvc_error_t uvc_scan_control(uvc_device_t *dev, uvc_device_info_t *info) {\n\tconst struct libusb_interface_descriptor *if_desc;\n\tuvc_error_t parse_ret, ret;\n\tint interface_idx;\n\tconst unsigned char *buffer;\n\tsize_t buffer_left, block_size;\n\n\tUVC_ENTER();\n\n\tret = UVC_SUCCESS;\n\tif_desc = NULL;\n\n\tif (LIKELY(info && info->config)) {\t// XXX add to avoid crash\n\t\tMARK(\"bNumInterfaces=%d\", info->config->bNumInterfaces);\n\t\tfor (interface_idx = 0; interface_idx < info->config->bNumInterfaces; ++interface_idx) {\n\t\t\tif_desc = &info->config->interface[interface_idx].altsetting[0];\n\t\t\tMARK(\"interface_idx=%d:bInterfaceClass=%02x,bInterfaceSubClass=%02x\", interface_idx, if_desc->bInterfaceClass, if_desc->bInterfaceSubClass);\n\t\t\t// select first found Video control\n\t\t\tif (if_desc->bInterfaceClass == LIBUSB_CLASS_VIDEO/*14*/ && if_desc->bInterfaceSubClass == 1) // Video, Control\n\t\t\t\tbreak;\n\n\t\t\t// Another TIS camera hack.\n\t\t\tif (if_desc->bInterfaceClass == 255 && if_desc->bInterfaceSubClass == 1) {\n\t\t\t\tuvc_device_descriptor_t* dev_desc;\n\t\t\t\tint haveTISCamera = 0;\n\t\t\t\tuvc_get_device_descriptor (dev, &dev_desc);\n\t\t\t\tif (dev_desc->idVendor == 0x199e && dev_desc->idProduct == 0x8101) {\n\t\t\t\t\thaveTISCamera = 1;\n\t\t\t\t}\n\t\t\t\tuvc_free_device_descriptor (dev_desc);\n\t\t\t\tif (haveTISCamera) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif_desc = NULL;\n\t\t}\n\t}\n\n\tif (UNLIKELY(!if_desc)) {\n\t\tUVC_EXIT(UVC_ERROR_INVALID_DEVICE);\n\t\tLOGE(\"UVC_ERROR_INVALID_DEVICE\");\n\t\treturn UVC_ERROR_INVALID_DEVICE;\n\t}\n\n\tinfo->ctrl_if.bInterfaceNumber = interface_idx;\n\tif (if_desc->bNumEndpoints != 0) {\n\t\tinfo->ctrl_if.bEndpointAddress = if_desc->endpoint[0].bEndpointAddress;\n\t}\n\n\tbuffer = if_desc->extra;\n\tbuffer_left = if_desc->extra_length;\n\n\twhile (buffer_left >= 3) { // parseX needs to see buf[0,2] = length,type\n\t\tblock_size = buffer[0];\n\t\tparse_ret = uvc_parse_vc(dev, info, buffer, block_size);\n\n\t\tif (parse_ret != UVC_SUCCESS) {\n\t\t\tret = parse_ret;\n\t\t\tbreak;\n\t\t}\n\n\t\tbuffer_left -= block_size;\n\t\tbuffer += block_size;\n\t}\n\n\tUVC_EXIT(ret);\n\treturn ret;\n}\n\n/** @internal\n * @brief Parse a VideoControl header.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vc_header(uvc_device_t *dev, uvc_device_info_t *info,\n\t\tconst unsigned char *block, size_t block_size) {\n\tsize_t i;\n\tuvc_error_t scan_ret, ret = UVC_SUCCESS;\n\n\tUVC_ENTER();\n\n\t/*\n\t int uvc_version;\n\t uvc_version = (block[4] >> 4) * 1000 + (block[4] & 0x0f) * 100\n\t + (block[3] >> 4) * 10 + (block[3] & 0x0f);\n\t */\n\n\tinfo->ctrl_if.bcdUVC = SW_TO_SHORT(&block[3]);\n\n\tswitch (info->ctrl_if.bcdUVC) {\n\tcase 0x0100:\n\tcase 0x010a:\n\tcase 0x0110:\n\tcase 0x0150:\t// XXX add to support UVC 1.5\n\t\tbreak;\n\tdefault:\n\t\tUVC_EXIT(UVC_ERROR_NOT_SUPPORTED);\n\t\treturn UVC_ERROR_NOT_SUPPORTED;\n\t}\n\n\tfor (i = 12; i < block_size; ++i) {\n\t\tscan_ret = uvc_scan_streaming(dev, info, block[i]);\n\t\tif (scan_ret != UVC_SUCCESS) {\n\t\t\tret = scan_ret;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tUVC_EXIT(ret);\n\treturn ret;\n}\n\n/** @internal\n * @brief Parse a VideoControl input terminal.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vc_input_terminal(uvc_device_t *dev,\n\t\tuvc_device_info_t *info, const unsigned char *block, size_t block_size) {\n\tuvc_input_terminal_t *term;\n\tsize_t i;\n\n\tUVC_ENTER();\n\n\t/* only supporting camera-type input terminals */\n\tif (SW_TO_SHORT(&block[4]) != UVC_ITT_CAMERA) {\n\t\tUVC_EXIT(UVC_SUCCESS);\n\t\treturn UVC_SUCCESS;\n\t}\n\n\tterm = calloc(1, sizeof(*term));\n\n\tterm->bTerminalID = block[3];\n\tterm->wTerminalType = SW_TO_SHORT(&block[4]);\n\tterm->wObjectiveFocalLengthMin = SW_TO_SHORT(&block[8]);\n\tterm->wObjectiveFocalLengthMax = SW_TO_SHORT(&block[10]);\n\tterm->wOcularFocalLength = SW_TO_SHORT(&block[12]);\n\tterm->request = (term->bTerminalID << 8) | info->ctrl_if.bInterfaceNumber;\n\tterm->bmControls = 0;\t// XXX\n\tfor (i = 14 + block[14]; i >= 15; i--)\n\t\tterm->bmControls = block[i] + (term->bmControls << 8);\n\n\tDL_APPEND(info->ctrl_if.input_term_descs, term);\n\n\tUVC_EXIT(UVC_SUCCESS);\n\treturn UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Parse a output terminal.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vc_output_terminal(uvc_device_t *dev,\n\t\tuvc_device_info_t *info, const unsigned char *block, size_t block_size) {\n\tuvc_output_terminal_t *term;\n\tsize_t i;\n\n\tUVC_ENTER();\n\n\t/* only supporting display-type input terminals */\n\tif (SW_TO_SHORT(&block[4]) != UVC_OTT_DISPLAY) {\n\t\tUVC_EXIT(UVC_SUCCESS);\n\t\treturn UVC_SUCCESS;\n\t}\n\n\tterm = calloc(1, sizeof(*term));\n\n\tterm->bTerminalID = block[3];\n\tterm->wTerminalType = SW_TO_SHORT(&block[4]);\n\tterm->bAssocTerminal = block[6];\n\tterm->bSourceID = block[7];\n\tterm->iTerminal = block[8];\n\tterm->request = (term->bTerminalID << 8) | info->ctrl_if.bInterfaceNumber;\t// XXX\n\t// TODO depending on the wTerminalType\n\n\tDL_APPEND(info->ctrl_if.output_term_descs, term);\n\n\tUVC_EXIT(UVC_SUCCESS);\n\treturn UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Parse a VideoControl processing unit.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vc_processing_unit(uvc_device_t *dev,\n\t\tuvc_device_info_t *info, const unsigned char *block, size_t block_size) {\n\tuvc_processing_unit_t *unit;\n\tsize_t i;\n\n\tUVC_ENTER();\n\n\tunit = calloc(1, sizeof(*unit));\n\tunit->bUnitID = block[3];\n\tunit->bSourceID = block[4];\n\tunit->request = (unit->bUnitID << 8) | info->ctrl_if.bInterfaceNumber;\t// XXX\n\n\tunit->bmControls = 0;\t// XXX\n\tfor (i = 7 + block[7]; i >= 8; i--)\n\t\tunit->bmControls = block[i] + (unit->bmControls << 8);\n\n\tDL_APPEND(info->ctrl_if.processing_unit_descs, unit);\n\n\tUVC_EXIT(UVC_SUCCESS);\n\treturn UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Parse a VideoControl extension unit.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vc_extension_unit(uvc_device_t *dev,\n\t\tuvc_device_info_t *info, const unsigned char *block, size_t block_size) {\n\tuvc_extension_unit_t *unit = calloc(1, sizeof(*unit));\n\tconst uint8_t *start_of_controls;\n\tint size_of_controls, num_in_pins;\n\tint i;\n\n\tUVC_ENTER();\n\n\tunit->bUnitID = block[3];\n\tmemcpy(unit->guidExtensionCode, &block[4], 16);\n\n\tnum_in_pins = block[21];\n\tsize_of_controls = block[22 + num_in_pins];\n\tstart_of_controls = &block[23 + num_in_pins];\n\tunit->request = (unit->bUnitID << 8) | info->ctrl_if.bInterfaceNumber;\n\n\tunit->bmControls = 0;\t// XXX\n\tfor (i = size_of_controls - 1; i >= 0; i--)\n\t\tunit->bmControls = start_of_controls[i] + (unit->bmControls << 8);\n\n\tDL_APPEND(info->ctrl_if.extension_unit_descs, unit);\n\n\tUVC_EXIT(UVC_SUCCESS);\n\treturn UVC_SUCCESS;\n}\n\n/** @internal\n * Process a single VideoControl descriptor block\n * @ingroup device\n */\nuvc_error_t uvc_parse_vc(uvc_device_t *dev, uvc_device_info_t *info,\n\t\tconst unsigned char *block, size_t block_size) {\n\tint descriptor_subtype;\n\tuvc_error_t ret = UVC_SUCCESS;\n\n\tUVC_ENTER();\n\n\tif (block[1] != LIBUSB_DT_CS_INTERFACE/*36*/) { // not a CS_INTERFACE descriptor??\n\t\tUVC_EXIT(UVC_SUCCESS);\n\t\treturn UVC_SUCCESS; // UVC_ERROR_INVALID_DEVICE;\n\t}\n\n\tdescriptor_subtype = block[2];\n\n\tswitch (descriptor_subtype) {\n\tcase UVC_VC_HEADER:\n\t\tret = uvc_parse_vc_header(dev, info, block, block_size);\n\t\tbreak;\n\tcase UVC_VC_INPUT_TERMINAL:\n\t\tret = uvc_parse_vc_input_terminal(dev, info, block, block_size);\n\t\tbreak;\n\tcase UVC_VC_OUTPUT_TERMINAL:\n\t\tbreak;\n\tcase UVC_VC_SELECTOR_UNIT:\n\t\tbreak;\n\tcase UVC_VC_PROCESSING_UNIT:\n\t\tret = uvc_parse_vc_processing_unit(dev, info, block, block_size);\n\t\tbreak;\n\tcase UVC_VC_EXTENSION_UNIT:\n\t\tret = uvc_parse_vc_extension_unit(dev, info, block, block_size);\n\t\tbreak;\n\tdefault:\n\t\tLOGW(\"UVC_ERROR_INVALID_DEVICE:descriptor_subtype=0x%02x\", descriptor_subtype);\n\t\tret = UVC_ERROR_INVALID_DEVICE;\n\t}\n\n\tUVC_EXIT(ret);\n\treturn ret;\n}\n\n/** @internal\n * Process a VideoStreaming interface\n * @ingroup device\n */\nuvc_error_t uvc_scan_streaming(uvc_device_t *dev, uvc_device_info_t *info,\n\t\tint interface_idx) {\n\tconst struct libusb_interface_descriptor *if_desc;\n\tconst unsigned char *buffer;\n\tsize_t buffer_left, block_size;\n\tuvc_error_t ret, parse_ret;\n\tuvc_streaming_interface_t *stream_if;\n\n\tUVC_ENTER();\n\n\tret = UVC_SUCCESS;\n\n\tif_desc = &(info->config->interface[interface_idx].altsetting[0]);\n\tbuffer = if_desc->extra;\n\tbuffer_left = if_desc->extra_length;\n\t// XXX some device have it's format descriptions after the endpoint descriptor\n\tif (UNLIKELY(!buffer || !buffer_left)) {\n\t\tif (if_desc->bNumEndpoints && if_desc->endpoint) {\n\t\t\t// try to use extra data in endpoint[0]\n\t\t\tbuffer = if_desc->endpoint[0].extra;\n\t\t\tbuffer_left = if_desc->endpoint[0].extra_length;\n\t\t}\n\t}\n\tstream_if = calloc(1, sizeof(*stream_if));\n\tstream_if->parent = info;\n\tstream_if->bInterfaceNumber = if_desc->bInterfaceNumber;\n\tDL_APPEND(info->stream_ifs, stream_if);\n\n\tif (LIKELY(buffer_left >= 3)) {\n\t\twhile (buffer_left >= 3) {\n\t\t\tblock_size = buffer[0];\n//\t\t\tMARK(\"bDescriptorType=0x%02x\", buffer[1]);\n\t\t\tparse_ret = uvc_parse_vs(dev, info, stream_if, buffer, block_size);\n\n\t\t\tif (parse_ret != UVC_SUCCESS) {\n\t\t\t\tret = parse_ret;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tbuffer_left -= block_size;\n\t\t\tbuffer += block_size;\n\t\t}\n\t} else {\n\t\tLOGW(\"This VideoStreaming interface has no extra data\");\n\t}\n\n\tUVC_EXIT(ret);\n\treturn ret;\n}\n\n/** @internal\n * @brief Parse a VideoStreaming header block.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vs_input_header(uvc_streaming_interface_t *stream_if,\n\t\tconst unsigned char *block, size_t block_size) {\n\tUVC_ENTER();\n\n\tstream_if->bEndpointAddress = block[6] & 0x8f;\n\tstream_if->bTerminalLink = block[8];\n\tstream_if->bmInfo = block[7];\t// XXX\n\tstream_if->bStillCaptureMethod = block[9];\t// XXX\n\tstream_if->bTriggerSupport = block[10];\t// XXX\n\tstream_if->bTriggerUsage = block[11];\t// XXX\n\tstream_if->bmaControls = NULL;\n\tconst uint8_t n = block[12];\n\tif (LIKELY(n)) {\n\t\tconst uint8_t p = (block_size - 13) / n;\n\t\tif (LIKELY(p)) {\n\t\t\tuint64_t *bmaControls = (uint64_t *)calloc(p, sizeof(uint64_t));\n\t\t\tstream_if->bmaControls = bmaControls;\n\t\t\tconst uint8_t *bma;\n\t\t\tint pp, nn;\n\t\t\tfor (pp = 1; pp <= p; pp++) {\n\t\t\t\tbma = &block[12 + pp * n];\n\t\t\t\tfor (nn = n - 1; nn >= 0; --nn) {\n\t\t\t\t\t*bmaControls = *bma-- + (*bmaControls << 8);\n\t\t\t\t}\n\t\t\t\tbmaControls++;\n\t\t\t}\n\t\t}\n\t}\n\tUVC_EXIT(UVC_SUCCESS);\n\treturn UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Parse a VideoStreaming uncompressed format block.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vs_format_uncompressed(\n\t\tuvc_streaming_interface_t *stream_if, const unsigned char *block,\n\t\tsize_t block_size) {\n\tUVC_ENTER();\n\n\tuvc_format_desc_t *format = calloc(1, sizeof(*format));\n\n\tformat->parent = stream_if;\n\tformat->bDescriptorSubtype = block[2];\n\tformat->bFormatIndex = block[3];\n\t//format->bmCapabilities = block[4];\n\t//format->bmFlags = block[5];\n\tmemcpy(format->guidFormat, &block[5], 16);\n\tformat->bBitsPerPixel = block[21];\n\tformat->bDefaultFrameIndex = block[22];\n\tformat->bAspectRatioX = block[23];\n\tformat->bAspectRatioY = block[24];\n\tformat->bmInterlaceFlags = block[25];\n\tformat->bCopyProtect = block[26];\n\n\tDL_APPEND(stream_if->format_descs, format);\n\n\tUVC_EXIT(UVC_SUCCESS);\n\treturn UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Parse a VideoStreaming frame format block.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vs_frame_format(uvc_streaming_interface_t *stream_if,\n\tconst unsigned char *block, size_t block_size) {\n\tUVC_ENTER();\n\n\tuvc_format_desc_t *format = calloc(1, sizeof(*format));\n\n\tformat->parent = stream_if;\n\tformat->bDescriptorSubtype = block[2];\n\tformat->bFormatIndex = block[3];\n\tformat->bNumFrameDescriptors = block[4];\n\tmemcpy(format->guidFormat, &block[5], 16);\n\tformat->bBitsPerPixel = block[21];\n\tformat->bDefaultFrameIndex = block[22];\n\tformat->bAspectRatioX = block[23];\n\tformat->bAspectRatioY = block[24];\n\tformat->bmInterlaceFlags = block[25];\n\tformat->bCopyProtect = block[26];\n\tformat->bVariableSize = block[27];\n\n\tDL_APPEND(stream_if->format_descs, format);\n\n\tUVC_EXIT(UVC_SUCCESS);\n\treturn UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Parse a VideoStreaming MJPEG format block.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vs_format_mjpeg(uvc_streaming_interface_t *stream_if,\n\t\tconst unsigned char *block, size_t block_size) {\n\tUVC_ENTER();\n\n\tuvc_format_desc_t *format = calloc(1, sizeof(*format));\n\n\tformat->parent = stream_if;\n\tformat->bDescriptorSubtype = block[2];\n\tformat->bFormatIndex = block[3];\n\tmemcpy(format->fourccFormat, \"MJPG\", 4);\n\tformat->bmFlags = block[5];\n\tformat->bBitsPerPixel = 0;\n\tformat->bDefaultFrameIndex = block[6];\n\tformat->bAspectRatioX = block[7];\n\tformat->bAspectRatioY = block[8];\n\tformat->bmInterlaceFlags = block[9];\n\tformat->bCopyProtect = block[10];\n\n\tDL_APPEND(stream_if->format_descs, format);\n\n\tUVC_EXIT(UVC_SUCCESS);\n\treturn UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Parse a VideoStreaming uncompressed frame block.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vs_frame_frame(uvc_streaming_interface_t *stream_if,\n\t\t\t\t\t    const unsigned char *block,\n\t\t\t\t\t    size_t block_size) {\n  uvc_format_desc_t *format;\n  uvc_frame_desc_t *frame;\n\n  const unsigned char *p;\n  int i;\n\n  UVC_ENTER();\n\n  format = stream_if->format_descs->prev;\n  frame = calloc(1, sizeof(*frame));\n\n  frame->parent = format;\n\n  frame->bDescriptorSubtype = block[2];\n  frame->bFrameIndex = block[3];\n  frame->bmCapabilities = block[4];\n  frame->wWidth = block[5] + (block[6] << 8);\n  frame->wHeight = block[7] + (block[8] << 8);\n  frame->dwMinBitRate = DW_TO_INT(&block[9]);\n  frame->dwMaxBitRate = DW_TO_INT(&block[13]);\n  frame->dwDefaultFrameInterval = DW_TO_INT(&block[17]);\n  frame->bFrameIntervalType = block[21];\n  frame->dwBytesPerLine = DW_TO_INT(&block[22]);\n\n  if (block[21] == 0) {\n    frame->dwMinFrameInterval = DW_TO_INT(&block[26]);\n    frame->dwMaxFrameInterval = DW_TO_INT(&block[30]);\n    frame->dwFrameIntervalStep = DW_TO_INT(&block[34]);\n  } else {\n    frame->intervals = calloc(block[21] + 1, sizeof(frame->intervals[0]));\n    p = &block[26];\n\n    for (i = 0; i < block[21]; ++i) {\n      frame->intervals[i] = DW_TO_INT(p);\n      p += 4;\n    }\n    frame->intervals[block[21]] = 0;\n  }\n\n  DL_APPEND(format->frame_descs, frame);\n\n  UVC_EXIT(UVC_SUCCESS);\n  return UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Parse a VideoStreaming uncompressed frame block.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vs_frame_uncompressed(\n\t\tuvc_streaming_interface_t *stream_if, const unsigned char *block,\n\t\tsize_t block_size) {\n\tuvc_format_desc_t *format;\n\tuvc_frame_desc_t *frame;\n\tuint8_t frame_type;\n\tuint8_t n;\n\tuint32_t interval;\n\n\tconst unsigned char *p;\n\tint i;\n\n\tUVC_ENTER();\n\n\tformat = stream_if->format_descs->prev;\n\tframe = calloc(1, sizeof(*frame));\n\n\tframe->parent = format;\n\n\tframe_type = frame->bDescriptorSubtype = block[2];\n\tframe->bFrameIndex = block[3];\n\tframe->bmCapabilities = block[4];\n\tframe->wWidth = block[5] + (block[6] << 8);\n\tframe->wHeight = block[7] + (block[8] << 8);\n\tframe->dwMinBitRate = DW_TO_INT(&block[9]);\n\tframe->dwMaxBitRate = DW_TO_INT(&block[13]);\n\tframe->dwMaxVideoFrameBufferSize = DW_TO_INT(&block[17]);\n\tframe->dwDefaultFrameInterval = DW_TO_INT(&block[21]);\n\tn = frame->bFrameIntervalType = block[25];\n\n\tif (!n) {\n\t\tframe->dwMinFrameInterval = DW_TO_INT(&block[26]);\n\t\tframe->dwMaxFrameInterval = DW_TO_INT(&block[30]);\n\t\tframe->dwFrameIntervalStep = DW_TO_INT(&block[34]);\n\t} else {\n\t\tframe->intervals = calloc(n + 1, sizeof(frame->intervals[0]));\n\t\tp = &block[26];\n\n\t\tfor (i = 0; i < n; ++i) {\n\t\t\tinterval = DW_TO_INT(p);\n\t\t\tframe->intervals[i] = interval ? interval : 1;\n\t\t\tp += 4;\n\t\t}\n\t\tframe->intervals[n] = 0;\n\t\t\n\t\tframe->dwDefaultFrameInterval\n\t\t\t= MIN(frame->intervals[n-1],\n\t\t\t\tMAX(frame->intervals[0], frame->dwDefaultFrameInterval));\n\t}\n\t\n\tif (frame_type == UVC_VS_FRAME_UNCOMPRESSED) {\n\t\tframe->dwMaxVideoFrameBufferSize\n\t\t\t= format->bBitsPerPixel * frame->wWidth * frame->wHeight / 8;\n\t}\n\t\n\t\n\tDL_APPEND(format->frame_descs, frame);\n\n\tUVC_EXIT(UVC_SUCCESS);\n\treturn UVC_SUCCESS;\n}\n\n/** @internal\n * Process a single VideoStreaming descriptor block\n * @ingroup device\n */\nuvc_error_t uvc_parse_vs(uvc_device_t *dev, uvc_device_info_t *info,\n\t\tuvc_streaming_interface_t *stream_if, const unsigned char *block,\n\t\tsize_t block_size) {\n\tuvc_error_t ret;\n\tint descriptor_subtype;\n\n\tUVC_ENTER();\n\n\tret = UVC_SUCCESS;\n\tdescriptor_subtype = block[2];\n//\tMARK(\"descriptor_subtype=0x%02x\", descriptor_subtype);\n\tswitch (descriptor_subtype) {\n\tcase UVC_VS_INPUT_HEADER:\n\t\tret = uvc_parse_vs_input_header(stream_if, block, block_size);\n\t\tbreak;\n//\tcase UVC_VS_STILL_IMAGE_FRAME:\t// FIXME unsupported now\n//\t\tbreak;\n\tcase UVC_VS_FORMAT_UNCOMPRESSED:\n\t\tret = uvc_parse_vs_format_uncompressed(stream_if, block, block_size);\n\t\tbreak;\n\tcase UVC_VS_FORMAT_MJPEG:\n\t\tret = uvc_parse_vs_format_mjpeg(stream_if, block, block_size);\n\t\tbreak;\n\tcase UVC_VS_FRAME_UNCOMPRESSED:\n\tcase UVC_VS_FRAME_MJPEG:\n\t\tret = uvc_parse_vs_frame_uncompressed(stream_if, block, block_size);\n\t\tbreak;\n\tcase UVC_VS_FORMAT_FRAME_BASED:\n\t\tret = uvc_parse_vs_frame_format(stream_if, block, block_size );\n\t\tbreak;\n\tcase UVC_VS_FRAME_FRAME_BASED:\n\t\tret = uvc_parse_vs_frame_frame(stream_if, block, block_size );\n\t\tbreak;\n//\tcase UVC_VS_COLORFORMAT:\t// FIXME unsupported now\n//\t\tbreak;\n\tdefault:\n\t\t/** @todo handle JPEG and maybe still frames or even DV... */\n\t\tLOGV(\"unsupported descriptor_subtype(0x%02x)\", descriptor_subtype);\n\t\tbreak;\n\t}\n\n\tUVC_EXIT(ret);\n\treturn ret;\n}\n\n/** @internal\n * @brief Free memory associated with a UVC device\n * @pre Streaming must be stopped, and threads must have died\n */\nvoid uvc_free_devh(uvc_device_handle_t *devh) {\n\tUVC_ENTER();\n\n\tpthread_mutex_destroy(&devh->status_mutex);\t// XXX saki\n\tif (devh->info)\n\t\tuvc_free_device_info(devh->info);\n\n\tif (devh->status_xfer)\n\t\tlibusb_free_transfer(devh->status_xfer);\n\n\tfree(devh);\n\n\tUVC_EXIT_VOID();\n}\n\n/** @brief Close a device\n *\n * @ingroup device\n *\n * Ends any stream that's in progress.\n *\n * The device handle and frame structures will be invalidated.\n */\nvoid uvc_close(uvc_device_handle_t *devh) {\n\n\tUVC_ENTER();\n\n\tuvc_context_t *ctx = devh->dev->ctx;\n\n\tif (devh->streams)\n\t\tuvc_stop_streaming(devh);\n\n\tuvc_release_if(devh, devh->info->ctrl_if.bInterfaceNumber);\n\n#if !UVC_DETACH_ATTACH\n\t/* disable automatic attach/detach kernel driver on supported platforms in libusb */\n\tlibusb_set_auto_detach_kernel_driver(devh->usb_devh, 0);\n#endif\n\t/* If we are managing the libusb context and this is the last open device,\n\t * then we need to cancel the handler thread. When we call libusb_close,\n\t * it'll cause a return from the thread's libusb_handle_events call, after\n\t * which the handler thread will check the flag we set and then exit. */\n\tif (ctx->own_usb_ctx && ctx->open_devices == devh && devh->next == NULL) {\n\t\tctx->kill_handler_thread = 1;\n\t\tlibusb_close(devh->usb_devh);\n\t\tpthread_join(ctx->handler_thread, NULL);\n\t} else {\n\t\tlibusb_close(devh->usb_devh);\n\t}\n\n\tDL_DELETE(ctx->open_devices, devh);\n\n\tuvc_unref_device(devh->dev);\n\n\tuvc_free_devh(devh);\n\n\tUVC_EXIT_VOID();\n}\n\nuvc_error_t uvc_set_reset_altsetting(uvc_device_handle_t *devh, uint8_t reset_on_release_if) {\n\tif (UNLIKELY(!devh))\n\t\tRETURN(UVC_ERROR_INVALID_PARAM, uvc_error_t);\n\tdevh->reset_on_release_if = reset_on_release_if;\n\tRETURN(UVC_SUCCESS, uvc_error_t);\n}\n\n/** @internal\n * @brief Get number of open devices\n */\nsize_t uvc_num_devices(uvc_context_t *ctx) {\n\tsize_t count = 0;\n\n\tuvc_device_handle_t *devh;\n\n\tUVC_ENTER();\n\n\tDL_FOREACH(ctx->open_devices, devh)\n\t{\n\t\tcount++;\n\t}\n\n\tUVC_EXIT((int) count);\n\treturn count;\n}\n\nvoid uvc_process_control_status(uvc_device_handle_t *devh, unsigned char *data, int len) {\n\tenum uvc_status_class status_class;\n\tuint8_t originator = 0, selector = 0, event = 0;\n\tenum uvc_status_attribute attribute = UVC_STATUS_ATTRIBUTE_UNKNOWN;\n\tvoid *content = NULL;\n\tsize_t content_len = 0;\n\tint found_entity = 0;\n\tstruct uvc_input_terminal *input_terminal;\n\tstruct uvc_processing_unit *processing_unit;\n\n\tUVC_ENTER();\n\n\tif (len < 5) {\n\t\tUVC_DEBUG(\"Short read of VideoControl status update (%d bytes)\", len);\n\t\tUVC_EXIT_VOID();\n\t\treturn;\n\t}\n\n\toriginator = data[1];\n\tevent = data[2];\n\tselector = data[3];\n\n\tif (originator == 0) {\n\t\tUVC_DEBUG(\"Unhandled update from VC interface\");\n\t\tUVC_EXIT_VOID();\n\t\treturn;  /* @todo VideoControl virtual entity interface updates */\n\t}\n\n\tif (event != 0) {\n\t\tUVC_DEBUG(\"Unhandled VC event %d\", (int) event);\n\t\tUVC_EXIT_VOID();\n\t\treturn;\n\t}\n\n\t/* printf(\"bSelector: %d\\n\", selector); */\n\n\tDL_FOREACH(devh->info->ctrl_if.input_term_descs, input_terminal) {\n\t\tif (input_terminal->bTerminalID == originator) {\n\t\t\tstatus_class = UVC_STATUS_CLASS_CONTROL_CAMERA;\n\t\t\tfound_entity = 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!found_entity) {\n\t\tDL_FOREACH(devh->info->ctrl_if.processing_unit_descs, processing_unit) {\n\t\t\tif (processing_unit->bUnitID == originator) {\n\t\t\t\tstatus_class = UVC_STATUS_CLASS_CONTROL_PROCESSING;\n\t\t\t\tfound_entity = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!found_entity) {\n\t\tUVC_DEBUG(\"Got status update for unknown VideoControl entity %d\",\n\t\t\t\t  (int) originator);\n\t\tUVC_EXIT_VOID();\n\t\treturn;\n\t}\n\n\tattribute = data[4];\n\tcontent = data + 5;\n\tcontent_len = len - 5;\n\n\tUVC_DEBUG(\"Event: class=%d, event=%d, selector=%d, attribute=%d, content_len=%zd\",\n\t\t\t  status_class, event, selector, attribute, content_len);\n\n\tpthread_mutex_lock(&devh->status_mutex);\t// XXX saki\n\t{\n\tif(devh->status_cb) {\n\t\tUVC_DEBUG(\"Running user-supplied status callback\");\n\t\tdevh->status_cb(status_class,\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tselector,\n\t\t\t\t\t\tattribute,\n\t\t\t\t\t\tcontent, content_len,\n\t\t\t\t\t\tdevh->status_user_ptr);\n\t}\n\t}\n\tpthread_mutex_unlock(&devh->status_mutex);\t// XXX saki\n\n\tUVC_EXIT_VOID();\n}\n\nvoid uvc_process_streaming_status(uvc_device_handle_t *devh, unsigned char *data, int len) {\n\n\tUVC_ENTER();\n\n\tif (len < 3) {\n\t\tUVC_DEBUG(\"Invalid streaming status event received.\\n\");\n\t\tUVC_EXIT_VOID();\n\t\treturn;\n\t}\n\n\tif (data[2] == 0) {\n\t\tif (len < 4) {\n\t\t\tUVC_DEBUG(\"Short read of status update (%d bytes)\", len);\n\t\t\tUVC_EXIT_VOID();\n\t\t\treturn;\n\t\t}\n\t\tUVC_DEBUG(\"Button (intf %u) %s len %d\\n\", data[1], data[3] ? \"pressed\" : \"released\", len);\n\n\t\tpthread_mutex_lock(&devh->status_mutex);\t// XXX saki\n\t\t{\n\t\t\tif(devh->button_cb) {\n\t\t\t\tUVC_DEBUG(\"Running user-supplied button callback\");\n\t\t\t\tdevh->button_cb(data[1],\n\t\t\t\t\t\t\t\tdata[3],\n\t\t\t\t\t\t\t\tdevh->button_user_ptr);\n\t\t}\n\t\t}\n\t\tpthread_mutex_unlock(&devh->status_mutex);\t// XXX saki\n\t} else {\n\t\tUVC_DEBUG(\"Stream %u error event %02x %02x len %d.\\n\", data[1], data[2], data[3], len);\n\t}\n\n\tUVC_EXIT_VOID();\n}\n\nvoid uvc_process_status_xfer(uvc_device_handle_t *devh, struct libusb_transfer *transfer) {\n\n\tUVC_ENTER();\n\n\t/* printf(\"Got transfer of aLen = %d\\n\", transfer->actual_length); */\n\n\tif (transfer->actual_length > 0) {\n\t\tswitch (transfer->buffer[0] & 0x0f) {\n\t\t\tcase 1: /* VideoControl interface */\n\t\t\t\tuvc_process_control_status(devh, transfer->buffer, transfer->actual_length);\n\t\t\t\tbreak;\n\t\t\tcase 2:  /* VideoStreaming interface */\n\t\t\t\tuvc_process_streaming_status(devh, transfer->buffer, transfer->actual_length);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tUVC_EXIT_VOID();\n}\n\n/** @internal\n * @brief Process asynchronous status updates from the device.\n */\nvoid _uvc_status_callback(struct libusb_transfer *transfer) {\n\tUVC_ENTER();\n\n\tuvc_device_handle_t *devh = (uvc_device_handle_t *) transfer->user_data;\n\n\tswitch (transfer->status) {\n\tcase LIBUSB_TRANSFER_ERROR:\n\tcase LIBUSB_TRANSFER_CANCELLED:\n\tcase LIBUSB_TRANSFER_NO_DEVICE:\n\t\tUVC_DEBUG(\"not processing/resubmitting, status = %d\", transfer->status);\n\t\tUVC_EXIT_VOID();\n\t\treturn;\n\tcase LIBUSB_TRANSFER_COMPLETED:\n\t\tuvc_process_status_xfer(devh, transfer);\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_TIMED_OUT:\n\tcase LIBUSB_TRANSFER_STALL:\n\tcase LIBUSB_TRANSFER_OVERFLOW:\n\t\tUVC_DEBUG(\"retrying transfer, status = %d\", transfer->status);\n\t\tbreak;\n\t}\n\n\tuvc_error_t ret = libusb_submit_transfer(transfer);\n\tUVC_DEBUG(\"libusb_submit_transfer() = %d\", ret);\n\n\tUVC_EXIT_VOID();\n}\n\n/** @brief Set a callback function to receive status updates\n *\n * @ingroup device\n */\nvoid uvc_set_status_callback(uvc_device_handle_t *devh,\n\t\tuvc_status_callback_t cb, void *user_ptr) {\n\tUVC_ENTER();\n\n\tpthread_mutex_lock(&devh->status_mutex);\t// XXX saki\n\t{\n\t\tdevh->status_cb = cb;\n\t\tdevh->status_user_ptr = user_ptr;\n\t}\n\tpthread_mutex_unlock(&devh->status_mutex);\t// XXX saki\n\n\tUVC_EXIT_VOID();\n}\n\n/** @brief Set a callback function to receive button events\n *\n * @ingroup device\n */\nvoid uvc_set_button_callback(uvc_device_handle_t *devh,\n\t\tuvc_button_callback_t cb, void *user_ptr) {\n\tUVC_ENTER();\n\n\tpthread_mutex_lock(&devh->status_mutex);\t// XXX saki\n\t{\n\t\tdevh->button_cb = cb;\n\t\tdevh->button_user_ptr = user_ptr;\n\t}\n\tpthread_mutex_unlock(&devh->status_mutex);\t// XXX saki\n\n\tUVC_EXIT_VOID();\n}\n\n/**\n * @brief Get format descriptions for the open device.\n *\n * @note Do not modify the returned structure.\n *\n * @param devh Device handle to an open UVC device\n */\nconst uvc_format_desc_t *uvc_get_format_descs(uvc_device_handle_t *devh) {\n  return devh->info->stream_ifs->format_descs;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/device_original.c",
    "content": "/*********************************************************************\n* Software License Agreement (BSD License)\n*\n*  Copyright (C) 2010-2012 Ken Tossell\n*  All rights reserved.\n*\n*  Redistribution and use in source and binary forms, with or without\n*  modification, are permitted provided that the following conditions\n*  are met:\n*\n*   * Redistributions of source code must retain the above copyright\n*     notice, this list of conditions and the following disclaimer.\n*   * Redistributions in binary form must reproduce the above\n*     copyright notice, this list of conditions and the following\n*     disclaimer in the documentation and/or other materials provided\n*     with the distribution.\n*   * Neither the name of the author nor other contributors may be\n*     used to endorse or promote products derived from this software\n*     without specific prior written permission.\n*\n*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n*  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n*  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n*  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n*  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n*  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n*  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n*  POSSIBILITY OF SUCH DAMAGE.\n*********************************************************************/\n/**\n * @defgroup device Device handling and enumeration\n */\n\n#include \"libuvc/libuvc.h\"\n#include \"libuvc/libuvc_internal.h\"\n\nint uvc_already_open(uvc_context_t *ctx, struct libusb_device *usb_dev);\nvoid uvc_free_devh(uvc_device_handle_t *devh);\n\nuvc_error_t uvc_get_device_info(uvc_device_t *dev, uvc_device_info_t **info);\nvoid uvc_free_device_info(uvc_device_info_t *info);\n\nuvc_error_t uvc_scan_control(uvc_device_t *dev, uvc_device_info_t *info);\nuvc_error_t uvc_parse_vc(uvc_device_t *dev,\n\t\t\t uvc_device_info_t *info,\n\t\t\t const unsigned char *block, size_t block_size);\nuvc_error_t uvc_parse_vc_extension_unit(uvc_device_t *dev,\n\t\t\t\t\tuvc_device_info_t *info,\n\t\t\t\t\tconst unsigned char *block,\n\t\t\t\t\tsize_t block_size);\nuvc_error_t uvc_parse_vc_header(uvc_device_t *dev,\n\t\t\t\tuvc_device_info_t *info,\n\t\t\t\tconst unsigned char *block, size_t block_size);\nuvc_error_t uvc_parse_vc_input_terminal(uvc_device_t *dev,\n\t\t\t\t\tuvc_device_info_t *info,\n\t\t\t\t\tconst unsigned char *block,\n\t\t\t\t\tsize_t block_size);\nuvc_error_t uvc_parse_vc_processing_unit(uvc_device_t *dev,\n\t\t\t\t\t uvc_device_info_t *info,\n\t\t\t\t\t const unsigned char *block,\n\t\t\t\t\t size_t block_size);\n\nuvc_error_t uvc_scan_streaming(uvc_device_t *dev,\n\t\t\t       uvc_device_info_t *info,\n\t\t\t       int interface_idx);\nuvc_error_t uvc_parse_vs(uvc_device_t *dev,\n\t\t\t uvc_device_info_t *info,\n\t\t\t uvc_streaming_interface_t *stream_if,\n\t\t\t const unsigned char *block, size_t block_size);\nuvc_error_t uvc_parse_vs_format_uncompressed(uvc_streaming_interface_t *stream_if,\n\t\t\t\t\t     const unsigned char *block,\n\t\t\t\t\t     size_t block_size);\nuvc_error_t uvc_parse_vs_format_mjpeg(uvc_streaming_interface_t *stream_if,\n\t\t\t\t\t     const unsigned char *block,\n\t\t\t\t\t     size_t block_size);\nuvc_error_t uvc_parse_vs_frame_uncompressed(uvc_streaming_interface_t *stream_if,\n\t\t\t\t\t    const unsigned char *block,\n\t\t\t\t\t    size_t block_size);\nuvc_error_t uvc_parse_vs_input_header(uvc_streaming_interface_t *stream_if,\n\t\t\t\t      const unsigned char *block,\n\t\t\t\t      size_t block_size);\n\nvoid _uvc_status_callback(struct libusb_transfer *transfer);\n\n/** @internal\n * @brief Test whether the specified USB device has been opened as a UVC device\n * @ingroup device\n *\n * @param ctx Context in which to search for the UVC device\n * @param usb_dev USB device to find\n * @return true if the device is open in this context\n */\nint uvc_already_open(uvc_context_t *ctx, struct libusb_device *usb_dev) {\n  uvc_device_handle_t *devh;\n\n  DL_FOREACH(ctx->open_devices, devh) {\n    if (usb_dev == devh->dev->usb_dev)\n      return 1;\n  }\n\n  return 0;\n}\n\n/** @brief Finds a camera identified by vendor, product and/or serial number\n * @ingroup device\n *\n * @param[in] ctx UVC context in which to search for the camera\n * @param[out] dev Reference to the camera, or NULL if not found\n * @param[in] vid Vendor ID number, optional\n * @param[in] pid Product ID number, optional\n * @param[in] sn Serial number or NULL\n * @return Error finding device or UVC_SUCCESS\n */\nuvc_error_t uvc_find_device(\n    uvc_context_t *ctx, uvc_device_t **dev,\n    int vid, int pid, const char *sn) {\n  uvc_error_t ret = UVC_SUCCESS;\n\n  uvc_device_t **list;\n  uvc_device_t *test_dev;\n  int dev_idx;\n  int found_dev;\n\n  UVC_ENTER();\n\n  ret = uvc_get_device_list(ctx, &list);\n\n  if (ret != UVC_SUCCESS) {\n    UVC_EXIT(ret);\n    return ret;\n  }\n\n  dev_idx = 0;\n  found_dev = 0;\n\n  while (!found_dev && (test_dev = list[dev_idx++]) != NULL) {\n    uvc_device_descriptor_t *desc;\n\n    if (uvc_get_device_descriptor(test_dev, &desc) != UVC_SUCCESS)\n      continue;\n\n    if ((!vid || desc->idVendor == vid)\n        && (!pid || desc->idProduct == pid)\n        && (!sn || (desc->serialNumber && !strcmp(desc->serialNumber, sn))))\n      found_dev = 1;\n\n    uvc_free_device_descriptor(desc);\n  }\n\n  if (found_dev)\n    uvc_ref_device(test_dev);\n\n  uvc_free_device_list(list, 1);\n\n  if (found_dev) {\n    *dev = test_dev;\n    UVC_EXIT(UVC_SUCCESS);\n    return UVC_SUCCESS;\n  } else {\n    UVC_EXIT(UVC_ERROR_NO_DEVICE);\n    return UVC_ERROR_NO_DEVICE;\n  }\n}\n\n/** @brief Get the number of the bus to which the device is attached\n * @ingroup device\n */\nuint8_t uvc_get_bus_number(uvc_device_t *dev) {\n  return libusb_get_bus_number(dev->usb_dev);\n}\n\n/** @brief Get the number assigned to the device within its bus\n * @ingroup device\n */\nuint8_t uvc_get_device_address(uvc_device_t *dev) {\n  return libusb_get_device_address(dev->usb_dev);\n}\n\n/** @brief Open a UVC device\n * @ingroup device\n *\n * @param dev Device to open\n * @param[out] devh Handle on opened device\n * @return Error opening device or SUCCESS\n */\nuvc_error_t uvc_open(\n    uvc_device_t *dev,\n    uvc_device_handle_t **devh) {\n  uvc_error_t ret;\n  struct libusb_device_handle *usb_devh;\n  uvc_device_handle_t *internal_devh;\n  struct libusb_device_descriptor desc;\n\n  UVC_ENTER();\n\n  ret = libusb_open(dev->usb_dev, &usb_devh);\n  UVC_DEBUG(\"libusb_open() = %d\", ret);\n\n  if (ret != UVC_SUCCESS) {\n    UVC_EXIT(ret);\n    return ret;\n  }\n\n  uvc_ref_device(dev);\n\n  internal_devh = calloc(1, sizeof(*internal_devh));\n  internal_devh->dev = dev;\n  internal_devh->usb_devh = usb_devh;\n\n  ret = uvc_get_device_info(dev, &(internal_devh->info));\n\n  if (ret != UVC_SUCCESS)\n    goto fail;\n\n  /* Automatically attach/detach kernel driver on supported platforms */\n  libusb_set_auto_detach_kernel_driver(usb_devh, 1);\n\n  UVC_DEBUG(\"claiming control interface %d\", internal_devh->info->ctrl_if.bInterfaceNumber);\n  ret = uvc_claim_if(internal_devh, internal_devh->info->ctrl_if.bInterfaceNumber);\n  if (ret != UVC_SUCCESS)\n    goto fail;\n\n  libusb_get_device_descriptor(dev->usb_dev, &desc);\n  internal_devh->is_isight = (desc.idVendor == 0x05ac && desc.idProduct == 0x8501);\n\n  if (internal_devh->info->ctrl_if.bEndpointAddress) {\n    internal_devh->status_xfer = libusb_alloc_transfer(0);\n    if (!internal_devh->status_xfer) {\n      ret = UVC_ERROR_NO_MEM;\n      goto fail;\n    }\n\n    libusb_fill_interrupt_transfer(internal_devh->status_xfer,\n                                   usb_devh,\n                                   internal_devh->info->ctrl_if.bEndpointAddress,\n                                   internal_devh->status_buf,\n                                   sizeof(internal_devh->status_buf),\n                                   _uvc_status_callback,\n                                   internal_devh,\n                                   0);\n    ret = libusb_submit_transfer(internal_devh->status_xfer);\n    UVC_DEBUG(\"libusb_submit_transfer() = %d\", ret);\n\n    if (ret) {\n      fprintf(stderr,\n              \"uvc: device has a status interrupt endpoint, but unable to read from it\\n\");\n      goto fail;\n    }\n  }\n\n  if (dev->ctx->own_usb_ctx && dev->ctx->open_devices == NULL) {\n    /* Since this is our first device, we need to spawn the event handler thread */\n    uvc_start_handler_thread(dev->ctx);\n  }\n\n  DL_APPEND(dev->ctx->open_devices, internal_devh);\n  *devh = internal_devh;\n\n  UVC_EXIT(ret);\n\n  return ret;\n\n fail:\n  uvc_release_if(internal_devh, internal_devh->info->ctrl_if.bInterfaceNumber);\n  libusb_close(usb_devh);\n  uvc_unref_device(dev);\n  uvc_free_devh(internal_devh);\n\n  UVC_EXIT(ret);\n\n  return ret;\n}\n\n/**\n * @internal\n * @brief Parses the complete device descriptor for a device\n * @ingroup device\n * @note Free *info with uvc_free_device_info when you're done\n *\n * @param dev Device to parse descriptor for\n * @param info Where to store a pointer to the new info struct\n */\nuvc_error_t uvc_get_device_info(uvc_device_t *dev,\n\t\t\t\tuvc_device_info_t **info) {\n  uvc_error_t ret;\n  uvc_device_info_t *internal_info;\n\n  UVC_ENTER();\n\n  internal_info = calloc(1, sizeof(*internal_info));\n  if (!internal_info) {\n    UVC_EXIT(UVC_ERROR_NO_MEM);\n    return UVC_ERROR_NO_MEM;\n  }\n\n  if (libusb_get_config_descriptor(dev->usb_dev,\n\t\t\t\t   0,\n\t\t\t\t   &(internal_info->config)) != 0) {\n    free(internal_info);\n    UVC_EXIT(UVC_ERROR_IO);\n    return UVC_ERROR_IO;\n  }\n\n  ret = uvc_scan_control(dev, internal_info);\n  if (ret != UVC_SUCCESS) {\n    uvc_free_device_info(internal_info);\n    UVC_EXIT(ret);\n    return ret;\n  }\n\n  *info = internal_info;\n\n  UVC_EXIT(ret);\n  return ret;\n}\n\n/**\n * @internal\n * @brief Frees the device descriptor for a device\n * @ingroup device\n *\n * @param info Which device info block to free\n */\nvoid uvc_free_device_info(uvc_device_info_t *info) {\n  uvc_input_terminal_t *input_term, *input_term_tmp;\n  uvc_processing_unit_t *proc_unit, *proc_unit_tmp;\n  uvc_extension_unit_t *ext_unit, *ext_unit_tmp;\n\n  uvc_streaming_interface_t *stream_if, *stream_if_tmp;\n  uvc_format_desc_t *format, *format_tmp;\n  uvc_frame_desc_t *frame, *frame_tmp;\n\n  UVC_ENTER();\n\n  DL_FOREACH_SAFE(info->ctrl_if.input_term_descs, input_term, input_term_tmp) {\n    DL_DELETE(info->ctrl_if.input_term_descs, input_term);\n    free(input_term);\n  }\n\n  DL_FOREACH_SAFE(info->ctrl_if.processing_unit_descs, proc_unit, proc_unit_tmp) {\n    DL_DELETE(info->ctrl_if.processing_unit_descs, proc_unit);\n    free(proc_unit);\n  }\n\n  DL_FOREACH_SAFE(info->ctrl_if.extension_unit_descs, ext_unit, ext_unit_tmp) {\n    DL_DELETE(info->ctrl_if.extension_unit_descs, ext_unit);\n    free(ext_unit);\n  }\n\n  DL_FOREACH_SAFE(info->stream_ifs, stream_if, stream_if_tmp) {\n    DL_FOREACH_SAFE(stream_if->format_descs, format, format_tmp) {\n      DL_FOREACH_SAFE(format->frame_descs, frame, frame_tmp) {\n        if (frame->intervals)\n          free(frame->intervals);\n\n        DL_DELETE(format->frame_descs, frame);\n        free(frame);\n      }\n\n      DL_DELETE(stream_if->format_descs, format);\n      free(format);\n    }\n\n    DL_DELETE(info->stream_ifs, stream_if);\n    free(stream_if);\n  }\n\n  if (info->config)\n    libusb_free_config_descriptor(info->config);\n\n  free(info);\n\n  UVC_EXIT_VOID();\n}\n\n/**\n * @brief Get a descriptor that contains the general information about\n * a device\n * @ingroup device\n *\n * Free *desc with uvc_free_device_descriptor when you're done.\n *\n * @param dev Device to fetch information about\n * @param[out] desc Descriptor structure\n * @return Error if unable to fetch information, else SUCCESS\n */\nuvc_error_t uvc_get_device_descriptor(\n    uvc_device_t *dev,\n    uvc_device_descriptor_t **desc) {\n  uvc_device_descriptor_t *desc_internal;\n  struct libusb_device_descriptor usb_desc;\n  struct libusb_device_handle *usb_devh;\n  uvc_error_t ret;\n\n  UVC_ENTER();\n\n  ret = libusb_get_device_descriptor(dev->usb_dev, &usb_desc);\n\n  if (ret != UVC_SUCCESS) {\n    UVC_EXIT(ret);\n    return ret;\n  }\n\n  desc_internal = calloc(1, sizeof(*desc_internal));\n  desc_internal->idVendor = usb_desc.idVendor;\n  desc_internal->idProduct = usb_desc.idProduct;\n\n  if (libusb_open(dev->usb_dev, &usb_devh) == 0) {\n    unsigned char serial_buf[64];\n\n    int serial_bytes = libusb_get_string_descriptor_ascii(\n        usb_devh, usb_desc.iSerialNumber, serial_buf, sizeof(serial_buf));\n\n    if (serial_bytes > 0)\n      desc_internal->serialNumber = strdup((const char*) serial_buf);\n\n    /** @todo get manufacturer, product names */\n\n    libusb_close(usb_devh);\n  } else {\n    UVC_DEBUG(\"can't open device %04x:%04x, not fetching serial\",\n\t      usb_desc.idVendor, usb_desc.idProduct);\n  }\n\n  *desc = desc_internal;\n\n  UVC_EXIT(ret);\n  return ret;\n}\n\n/**\n * @brief Frees a device descriptor created with uvc_get_device_descriptor\n * @ingroup device\n *\n * @param desc Descriptor to free\n */\nvoid uvc_free_device_descriptor(\n    uvc_device_descriptor_t *desc) {\n  UVC_ENTER();\n\n  if (desc->serialNumber)\n    free((void*) desc->serialNumber);\n\n  if (desc->manufacturer)\n    free((void*) desc->manufacturer);\n\n  if (desc->product)\n    free((void*) desc->product);\n\n  free(desc);\n\n  UVC_EXIT_VOID();\n}\n\n/**\n * @brief Get a list of the UVC devices attached to the system\n * @ingroup device\n *\n * @note Free the list with uvc_free_device_list when you're done.\n *\n * @param ctx UVC context in which to list devices\n * @param list List of uvc_device structures\n * @return Error if unable to list devices, else SUCCESS\n */\nuvc_error_t uvc_get_device_list(\n    uvc_context_t *ctx,\n    uvc_device_t ***list) {\n  uvc_error_t ret;\n  struct libusb_device **usb_dev_list;\n  struct libusb_device *usb_dev;\n  int num_usb_devices;\n\n  uvc_device_t **list_internal;\n  int num_uvc_devices;\n\n  /* per device */\n  int dev_idx;\n  struct libusb_device_handle *usb_devh;\n  struct libusb_config_descriptor *config;\n  uint8_t got_interface;\n\n  /* per interface */\n  int interface_idx;\n  const struct libusb_interface *interface;\n\n  /* per altsetting */\n  int altsetting_idx;\n  const struct libusb_interface_descriptor *if_desc;\n\n  UVC_ENTER();\n\n  num_usb_devices = libusb_get_device_list(ctx->usb_ctx, &usb_dev_list);\n\n  if (num_usb_devices < 0) {\n    UVC_EXIT(UVC_ERROR_IO);\n    return UVC_ERROR_IO;\n  }\n\n  list_internal = malloc(sizeof(*list_internal));\n  *list_internal = NULL;\n\n  num_uvc_devices = 0;\n  dev_idx = -1;\n\n  while ((usb_dev = usb_dev_list[++dev_idx]) != NULL) {\n    usb_devh = NULL;\n    got_interface = 0;\n\n    if (libusb_get_config_descriptor(usb_dev, 0, &config) != 0)\n      continue;\n\n    for (interface_idx = 0;\n\t !got_interface && interface_idx < config->bNumInterfaces;\n\t ++interface_idx) {\n      interface = &config->interface[interface_idx];\n\n      for (altsetting_idx = 0;\n\t   !got_interface && altsetting_idx < interface->num_altsetting;\n\t   ++altsetting_idx) {\n\tif_desc = &interface->altsetting[altsetting_idx];\n\n\t/* Video, Streaming */\n\tif (if_desc->bInterfaceClass == 14 && if_desc->bInterfaceSubClass == 2) {\n\t  got_interface = 1;\n\t}\n      }\n    }\n\n    libusb_free_config_descriptor(config);\n\n    if (got_interface) {\n      uvc_device_t *uvc_dev = malloc(sizeof(*uvc_dev));\n      uvc_dev->ctx = ctx;\n      uvc_dev->ref = 0;\n      uvc_dev->usb_dev = usb_dev;\n      uvc_ref_device(uvc_dev);\n\n      num_uvc_devices++;\n      list_internal = realloc(list_internal, (num_uvc_devices + 1) * sizeof(*list_internal));\n\n      list_internal[num_uvc_devices - 1] = uvc_dev;\n      list_internal[num_uvc_devices] = NULL;\n\n      UVC_DEBUG(\"    UVC: %d\", dev_idx);\n    } else {\n      UVC_DEBUG(\"non-UVC: %d\", dev_idx);\n    }\n  }\n\n  libusb_free_device_list(usb_dev_list, 1);\n\n  *list = list_internal;\n\n  UVC_EXIT(UVC_SUCCESS);\n  return UVC_SUCCESS;\n}\n\n/**\n * @brief Frees a list of device structures created with uvc_get_device_list.\n * @ingroup device\n *\n * @param list Device list to free\n * @param unref_devices Decrement the reference counter for each device\n * in the list, and destroy any entries that end up with zero references\n */\nvoid uvc_free_device_list(uvc_device_t **list, uint8_t unref_devices) {\n  uvc_device_t *dev;\n  int dev_idx = 0;\n\n  UVC_ENTER();\n\n  if (unref_devices) {\n    while ((dev = list[dev_idx++]) != NULL) {\n      uvc_unref_device(dev);\n    }\n  }\n\n  free(list);\n\n  UVC_EXIT_VOID();\n}\n\n/**\n * @brief Get the uvc_device_t corresponding to an open device\n * @ingroup device\n *\n * @note Unref the uvc_device_t when you're done with it\n *\n * @param devh Device handle to an open UVC device\n */\nuvc_device_t *uvc_get_device(uvc_device_handle_t *devh) {\n  uvc_ref_device(devh->dev);\n  return devh->dev;\n}\n\n/**\n * @brief Get the underlying libusb device handle for an open device\n * @ingroup device\n *\n * This can be used to access other interfaces on the same device, e.g.\n * a webcam microphone.\n *\n * @note The libusb device handle is only valid while the UVC device is open;\n * it will be invalidated upon calling uvc_close.\n *\n * @param devh UVC device handle to an open device\n */\nlibusb_device_handle *uvc_get_libusb_handle(uvc_device_handle_t *devh) {\n  return devh->usb_devh;\n}\n\n/**\n * @brief Get input terminal descriptors for the open device.\n *\n * @note Do not modify the returned structure.\n * @note The returned structure is part of a linked list. Iterate through\n *       it by using the 'next' pointers.\n *\n * @param devh Device handle to an open UVC device\n */\nconst uvc_input_terminal_t *uvc_get_input_terminals(uvc_device_handle_t *devh) {\n  return devh->info->ctrl_if.input_term_descs;\n}\n\n/**\n * @brief Get output terminal descriptors for the open device.\n *\n * @note Do not modify the returned structure.\n * @note The returned structure is part of a linked list. Iterate through\n *       it by using the 'next' pointers.\n *\n * @param devh Device handle to an open UVC device\n */\nconst uvc_output_terminal_t *uvc_get_output_terminals(uvc_device_handle_t *devh) {\n  return NULL; /* @todo */\n}\n\n/**\n * @brief Get processing unit descriptors for the open device.\n *\n * @note Do not modify the returned structure.\n * @note The returned structure is part of a linked list. Iterate through\n *       it by using the 'next' pointers.\n *\n * @param devh Device handle to an open UVC device\n */\nconst uvc_processing_unit_t *uvc_get_processing_units(uvc_device_handle_t *devh) {\n  return devh->info->ctrl_if.processing_unit_descs;\n}\n\n/**\n * @brief Get extension unit descriptors for the open device.\n *\n * @note Do not modify the returned structure.\n * @note The returned structure is part of a linked list. Iterate through\n *       it by using the 'next' pointers.\n *\n * @param devh Device handle to an open UVC device\n */\nconst uvc_extension_unit_t *uvc_get_extension_units(uvc_device_handle_t *devh) {\n  return devh->info->ctrl_if.extension_unit_descs;\n}\n\n/**\n * @brief Increment the reference count for a device\n * @ingroup device\n *\n * @param dev Device to reference\n */\nvoid uvc_ref_device(uvc_device_t *dev) {\n  UVC_ENTER();\n\n  dev->ref++;\n  libusb_ref_device(dev->usb_dev);\n\n  UVC_EXIT_VOID();\n}\n\n/**\n * @brief Decrement the reference count for a device\n * @ingropu device\n * @note If the count reaches zero, the device will be discarded\n *\n * @param dev Device to unreference\n */\nvoid uvc_unref_device(uvc_device_t *dev) {\n  UVC_ENTER();\n\n  libusb_unref_device(dev->usb_dev);\n  dev->ref--;\n\n  if (dev->ref == 0)\n    free(dev);\n\n  UVC_EXIT_VOID();\n}\n\n/** @internal\n * Claim a UVC interface, detaching the kernel driver if necessary.\n * @ingroup device\n *\n * @param devh UVC device handle\n * @param idx UVC interface index\n */\nuvc_error_t uvc_claim_if(uvc_device_handle_t *devh, int idx) {\n  int ret;\n\n  UVC_ENTER();\n\n  UVC_DEBUG(\"claiming interface %d\", idx);\n  ret = libusb_claim_interface(devh->usb_devh, idx);\n\n  UVC_EXIT(ret);\n  return ret;\n}\n\n/** @internal\n * Release a UVC interface.\n * @ingroup device\n *\n * @param devh UVC device handle\n * @param idx UVC interface index\n */\nuvc_error_t uvc_release_if(uvc_device_handle_t *devh, int idx) {\n  int ret;\n\n  UVC_ENTER();\n  UVC_DEBUG(\"releasing interface %d\", idx);\n  /* libusb_release_interface *should* reset the alternate setting to the first available,\n     but sometimes (e.g. on Darwin) it doesn't. Thus, we do it explicitly here.\n     This is needed to de-initialize certain cameras. */\n  libusb_set_interface_alt_setting(devh->usb_devh, idx, 0);\n  ret = libusb_release_interface(devh->usb_devh, idx);\n\n  UVC_EXIT(ret);\n  return ret;\n}\n\n/** @internal\n * Find a device's VideoControl interface and process its descriptor\n * @ingroup device\n */\nuvc_error_t uvc_scan_control(uvc_device_t *dev, uvc_device_info_t *info) {\n  const struct libusb_interface_descriptor *if_desc;\n  uvc_error_t parse_ret, ret;\n  int interface_idx;\n  const unsigned char *buffer;\n  size_t buffer_left, block_size;\n\n  UVC_ENTER();\n\n  ret = UVC_SUCCESS;\n  if_desc = NULL;\n\n  for (interface_idx = 0; interface_idx < info->config->bNumInterfaces; ++interface_idx) {\n    if_desc = &info->config->interface[interface_idx].altsetting[0];\n\n    if (if_desc->bInterfaceClass == 14 && if_desc->bInterfaceSubClass == 1) // Video, Control\n      break;\n\n    if_desc = NULL;\n  }\n\n  if (if_desc == NULL) {\n    UVC_EXIT(UVC_ERROR_INVALID_DEVICE);\n    return UVC_ERROR_INVALID_DEVICE;\n  }\n\n  info->ctrl_if.bInterfaceNumber = interface_idx;\n  if (if_desc->bNumEndpoints != 0) {\n    info->ctrl_if.bEndpointAddress = if_desc->endpoint[0].bEndpointAddress;\n  }\n\n  buffer = if_desc->extra;\n  buffer_left = if_desc->extra_length;\n\n  while (buffer_left >= 3) { // parseX needs to see buf[0,2] = length,type\n    block_size = buffer[0];\n    parse_ret = uvc_parse_vc(dev, info, buffer, block_size);\n\n    if (parse_ret != UVC_SUCCESS) {\n      ret = parse_ret;\n      break;\n    }\n\n    buffer_left -= block_size;\n    buffer += block_size;\n  }\n\n  UVC_EXIT(ret);\n  return ret;\n}\n\n/** @internal\n * @brief Parse a VideoControl header.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vc_header(uvc_device_t *dev,\n\t\t\t\tuvc_device_info_t *info,\n\t\t\t\tconst unsigned char *block, size_t block_size) {\n  size_t i;\n  uvc_error_t scan_ret, ret = UVC_SUCCESS;\n\n  UVC_ENTER();\n\n  /*\n  int uvc_version;\n  uvc_version = (block[4] >> 4) * 1000 + (block[4] & 0x0f) * 100\n    + (block[3] >> 4) * 10 + (block[3] & 0x0f);\n  */\n\n  info->ctrl_if.bcdUVC = SW_TO_SHORT(&block[3]);\n\n  switch (info->ctrl_if.bcdUVC) {\n  case 0x0100:\n  case 0x010a:\n  case 0x0110:\n    break;\n  default:\n    UVC_EXIT(UVC_ERROR_NOT_SUPPORTED);\n    return UVC_ERROR_NOT_SUPPORTED;\n  }\n\n  for (i = 12; i < block_size; ++i) {\n    scan_ret = uvc_scan_streaming(dev, info, block[i]);\n    if (scan_ret != UVC_SUCCESS) {\n      ret = scan_ret;\n      break;\n    }\n  }\n\n  UVC_EXIT(ret);\n  return ret;\n}\n\n/** @internal\n * @brief Parse a VideoControl input terminal.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vc_input_terminal(uvc_device_t *dev,\n\t\t\t\t\tuvc_device_info_t *info,\n\t\t\t\t\tconst unsigned char *block, size_t block_size) {\n  uvc_input_terminal_t *term;\n  size_t i;\n\n  UVC_ENTER();\n\n  /* only supporting camera-type input terminals */\n  if (SW_TO_SHORT(&block[4]) != UVC_ITT_CAMERA) {\n    UVC_EXIT(UVC_SUCCESS);\n    return UVC_SUCCESS;\n  }\n\n  term = calloc(1, sizeof(*term));\n\n  term->bTerminalID = block[3];\n  term->wTerminalType = SW_TO_SHORT(&block[4]);\n  term->wObjectiveFocalLengthMin = SW_TO_SHORT(&block[8]);\n  term->wObjectiveFocalLengthMax = SW_TO_SHORT(&block[10]);\n  term->wOcularFocalLength = SW_TO_SHORT(&block[12]);\n\n  for (i = 14 + block[14]; i >= 15; --i)\n    term->bmControls = block[i] + (term->bmControls << 8);\n\n  DL_APPEND(info->ctrl_if.input_term_descs, term);\n\n  UVC_EXIT(UVC_SUCCESS);\n  return UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Parse a VideoControl processing unit.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vc_processing_unit(uvc_device_t *dev,\n\t\t\t\t\t uvc_device_info_t *info,\n\t\t\t\t\t const unsigned char *block, size_t block_size) {\n  uvc_processing_unit_t *unit;\n  size_t i;\n\n  UVC_ENTER();\n\n  unit = calloc(1, sizeof(*unit));\n  unit->bUnitID = block[3];\n  unit->bSourceID = block[4];\n  \n  for (i = 7 + block[7]; i >= 8; --i)\n    unit->bmControls = block[i] + (unit->bmControls << 8);\n  \n  DL_APPEND(info->ctrl_if.processing_unit_descs, unit);\n\n  UVC_EXIT(UVC_SUCCESS);\n  return UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Parse a VideoControl extension unit.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vc_extension_unit(uvc_device_t *dev,\n\t\t\t\t\tuvc_device_info_t *info,\n\t\t\t\t\tconst unsigned char *block, size_t block_size) {\n  uvc_extension_unit_t *unit = calloc(1, sizeof(*unit));\n  const uint8_t *start_of_controls;\n  int size_of_controls, num_in_pins;\n  int i;\n\n  UVC_ENTER();\n\n  unit->bUnitID = block[3];\n  memcpy(unit->guidExtensionCode, &block[4], 16);\n  \n  num_in_pins = block[21];\n  size_of_controls = block[22 + num_in_pins];\n  start_of_controls = &block[23 + num_in_pins];\n  \n  for (i = size_of_controls - 1; i >= 0; --i)\n    unit->bmControls = start_of_controls[i] + (unit->bmControls << 8);\n  \n  DL_APPEND(info->ctrl_if.extension_unit_descs, unit);\n\n  UVC_EXIT(UVC_SUCCESS);\n  return UVC_SUCCESS;\n}\n\n/** @internal\n * Process a single VideoControl descriptor block\n * @ingroup device\n */\nuvc_error_t uvc_parse_vc(\n    uvc_device_t *dev,\n    uvc_device_info_t *info,\n    const unsigned char *block, size_t block_size) {\n  int descriptor_subtype;\n  uvc_error_t ret = UVC_SUCCESS;\n\n  UVC_ENTER();\n\n  if (block[1] != 36) { // not a CS_INTERFACE descriptor??\n    UVC_EXIT(UVC_SUCCESS);\n    return UVC_SUCCESS; // UVC_ERROR_INVALID_DEVICE;\n  }\n\n  descriptor_subtype = block[2];\n\n  switch (descriptor_subtype) {\n  case UVC_VC_HEADER:\n    ret = uvc_parse_vc_header(dev, info, block, block_size);\n    break;\n  case UVC_VC_INPUT_TERMINAL:\n    ret = uvc_parse_vc_input_terminal(dev, info, block, block_size);\n    break;\n  case UVC_VC_OUTPUT_TERMINAL:\n    break;\n  case UVC_VC_SELECTOR_UNIT:\n    break;\n  case UVC_VC_PROCESSING_UNIT:\n    ret = uvc_parse_vc_processing_unit(dev, info, block, block_size);\n    break;\n  case UVC_VC_EXTENSION_UNIT:\n    ret = uvc_parse_vc_extension_unit(dev, info, block, block_size);\n    break;\n  default:\n    ret = UVC_ERROR_INVALID_DEVICE;\n  }\n\n  UVC_EXIT(ret);\n  return ret;\n}\n\n/** @internal\n * Process a VideoStreaming interface\n * @ingroup device\n */\nuvc_error_t uvc_scan_streaming(uvc_device_t *dev,\n\t\t\t       uvc_device_info_t *info,\n\t\t\t       int interface_idx) {\n  const struct libusb_interface_descriptor *if_desc;\n  const unsigned char *buffer;\n  size_t buffer_left, block_size;\n  uvc_error_t ret, parse_ret;\n  uvc_streaming_interface_t *stream_if;\n\n  UVC_ENTER();\n\n  ret = UVC_SUCCESS;\n\n  if_desc = &(info->config->interface[interface_idx].altsetting[0]);\n  buffer = if_desc->extra;\n  buffer_left = if_desc->extra_length;\n\n  stream_if = calloc(1, sizeof(*stream_if));\n  stream_if->parent = info;\n  stream_if->bInterfaceNumber = if_desc->bInterfaceNumber;\n  DL_APPEND(info->stream_ifs, stream_if);\n\n  while (buffer_left >= 3) {\n    block_size = buffer[0];\n    parse_ret = uvc_parse_vs(dev, info, stream_if, buffer, block_size);\n\n    if (parse_ret != UVC_SUCCESS) {\n      ret = parse_ret;\n      break;\n    }\n\n    buffer_left -= block_size;\n    buffer += block_size;\n  }\n\n  UVC_EXIT(ret);\n  return ret;\n}\n\n/** @internal\n * @brief Parse a VideoStreaming header block.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vs_input_header(uvc_streaming_interface_t *stream_if,\n\t\t\t\t      const unsigned char *block,\n\t\t\t\t      size_t block_size) {\n  UVC_ENTER();\n\n  stream_if->bEndpointAddress = block[6] & 0x8f;\n  stream_if->bTerminalLink = block[8];\n\n  UVC_EXIT(UVC_SUCCESS);\n  return UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Parse a VideoStreaming uncompressed format block.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vs_format_uncompressed(uvc_streaming_interface_t *stream_if,\n\t\t\t\t\t     const unsigned char *block,\n\t\t\t\t\t     size_t block_size) {\n  UVC_ENTER();\n\n  uvc_format_desc_t *format = calloc(1, sizeof(*format));\n\n  format->parent = stream_if;\n  format->bDescriptorSubtype = block[2];\n  format->bFormatIndex = block[3];\n  //format->bmCapabilities = block[4];\n  //format->bmFlags = block[5];\n  memcpy(format->guidFormat, &block[5], 16);\n  format->bBitsPerPixel = block[21];\n  format->bDefaultFrameIndex = block[22];\n  format->bAspectRatioX = block[23];\n  format->bAspectRatioY = block[24];\n  format->bmInterlaceFlags = block[25];\n  format->bCopyProtect = block[26];\n\n  DL_APPEND(stream_if->format_descs, format);\n\n  UVC_EXIT(UVC_SUCCESS);\n  return UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Parse a VideoStreaming MJPEG format block.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vs_format_mjpeg(uvc_streaming_interface_t *stream_if,\n\t\t\t\t\t     const unsigned char *block,\n\t\t\t\t\t     size_t block_size) {\n  UVC_ENTER();\n\n  uvc_format_desc_t *format = calloc(1, sizeof(*format));\n\n  format->parent = stream_if;\n  format->bDescriptorSubtype = block[2];\n  format->bFormatIndex = block[3];\n  memcpy(format->fourccFormat, \"MJPG\", 4);\n  format->bmFlags = block[5];\n  format->bBitsPerPixel = 0;\n  format->bDefaultFrameIndex = block[6];\n  format->bAspectRatioX = block[7];\n  format->bAspectRatioY = block[8];\n  format->bmInterlaceFlags = block[9];\n  format->bCopyProtect = block[10];\n\n  DL_APPEND(stream_if->format_descs, format);\n\n  UVC_EXIT(UVC_SUCCESS);\n  return UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Parse a VideoStreaming uncompressed frame block.\n * @ingroup device\n */\nuvc_error_t uvc_parse_vs_frame_uncompressed(uvc_streaming_interface_t *stream_if,\n\t\t\t\t\t    const unsigned char *block,\n\t\t\t\t\t    size_t block_size) {\n  uvc_format_desc_t *format;\n  uvc_frame_desc_t *frame;\n\n  const unsigned char *p;\n  int i;\n\n  UVC_ENTER();\n\n  format = stream_if->format_descs->prev;\n  frame = calloc(1, sizeof(*frame));\n\n  frame->parent = format;\n\n  frame->bDescriptorSubtype = block[2];\n  frame->bFrameIndex = block[3];\n  frame->bmCapabilities = block[4];\n  frame->wWidth = block[5] + (block[6] << 8);\n  frame->wHeight = block[7] + (block[8] << 8);\n  frame->dwMinBitRate = DW_TO_INT(&block[9]);\n  frame->dwMaxBitRate = DW_TO_INT(&block[13]);\n  frame->dwMaxVideoFrameBufferSize = DW_TO_INT(&block[17]);\n  frame->dwDefaultFrameInterval = DW_TO_INT(&block[21]);\n  // frame->bFrameIntervalType = block[25];\n\n  if (block[25] == 0) {\n    frame->dwMinFrameInterval = DW_TO_INT(&block[26]);\n    frame->dwMaxFrameInterval = DW_TO_INT(&block[30]);\n    frame->dwFrameIntervalStep = DW_TO_INT(&block[34]);\n  } else {\n    frame->intervals = calloc(block[25] + 1, sizeof(frame->intervals[0]));\n    p = &block[26];\n\n    for (i = 0; i < block[25]; ++i) {\n      frame->intervals[i] = DW_TO_INT(p);\n      p += 4;\n    }\n    frame->intervals[block[25]] = 0;\n  }\n\n  DL_APPEND(format->frame_descs, frame);\n\n  UVC_EXIT(UVC_SUCCESS);\n  return UVC_SUCCESS;\n}\n\n/** @internal\n * Process a single VideoStreaming descriptor block\n * @ingroup device\n */\nuvc_error_t uvc_parse_vs(\n    uvc_device_t *dev,\n    uvc_device_info_t *info,\n    uvc_streaming_interface_t *stream_if,\n    const unsigned char *block, size_t block_size) {\n  uvc_error_t ret;\n  int descriptor_subtype;\n\n  UVC_ENTER();\n\n  ret = UVC_SUCCESS;\n  descriptor_subtype = block[2];\n\n  switch (descriptor_subtype) {\n  case UVC_VS_INPUT_HEADER:\n    ret = uvc_parse_vs_input_header(stream_if, block, block_size);\n    break;\n  case UVC_VS_FORMAT_UNCOMPRESSED:\n    ret = uvc_parse_vs_format_uncompressed(stream_if, block, block_size);\n    break;\n  case UVC_VS_FORMAT_MJPEG:\n    ret = uvc_parse_vs_format_mjpeg(stream_if, block, block_size);\n    break;\n  case UVC_VS_FRAME_UNCOMPRESSED:\n  case UVC_VS_FRAME_MJPEG:\n    ret = uvc_parse_vs_frame_uncompressed(stream_if, block, block_size);\n    break;\n  default:\n    /** @todo handle JPEG and maybe still frames or even DV... */\n    break;\n  }\n\n  UVC_EXIT(ret);\n  return ret;\n}\n\n/** @internal\n * @brief Free memory associated with a UVC device\n * @pre Streaming must be stopped, and threads must have died\n */\nvoid uvc_free_devh(uvc_device_handle_t *devh) {\n  UVC_ENTER();\n\n  if (devh->info)\n    uvc_free_device_info(devh->info);\n\n  if (devh->status_xfer)\n    libusb_free_transfer(devh->status_xfer);\n\n  free(devh);\n\n  UVC_EXIT_VOID();\n}\n\n/** @brief Close a device\n *\n * @ingroup device\n *\n * Ends any stream that's in progress.\n *\n * The device handle and frame structures will be invalidated.\n */\nvoid uvc_close(uvc_device_handle_t *devh) {\n  UVC_ENTER();\n  uvc_context_t *ctx = devh->dev->ctx;\n\n  if (devh->streams)\n    uvc_stop_streaming(devh);\n\n  uvc_release_if(devh, devh->info->ctrl_if.bInterfaceNumber);\n\n  /* If we are managing the libusb context and this is the last open device,\n   * then we need to cancel the handler thread. When we call libusb_close,\n   * it'll cause a return from the thread's libusb_handle_events call, after\n   * which the handler thread will check the flag we set and then exit. */\n  if (ctx->own_usb_ctx && ctx->open_devices == devh && devh->next == NULL) {\n    ctx->kill_handler_thread = 1;\n    libusb_close(devh->usb_devh);\n    pthread_join(ctx->handler_thread, NULL);\n  } else {\n    libusb_close(devh->usb_devh);\n  }\n\n  DL_DELETE(ctx->open_devices, devh);\n\n  uvc_unref_device(devh->dev);\n\n  uvc_free_devh(devh);\n\n  UVC_EXIT_VOID();\n}\n\n/** @internal\n * @brief Get number of open devices\n */\nsize_t uvc_num_devices(uvc_context_t *ctx) {\n  size_t count = 0;\n\n  uvc_device_handle_t *devh;\n\n  UVC_ENTER();\n\n  DL_FOREACH(ctx->open_devices, devh) {\n    count++;\n  }\n\n  UVC_EXIT((int) count);\n  return count;\n}\n\nvoid uvc_process_status_xfer(uvc_device_handle_t *devh, struct libusb_transfer *transfer) {\n  enum uvc_status_class status_class;\n  uint8_t originator = 0, selector = 0, event = 0;\n  enum uvc_status_attribute attribute = UVC_STATUS_ATTRIBUTE_UNKNOWN;\n  void *data = NULL;\n  size_t data_len = 0;\n\n  UVC_ENTER();\n\n  /* printf(\"Got transfer of aLen = %d\\n\", transfer->actual_length); */\n\n  if (transfer->actual_length < 4) {\n    UVC_DEBUG(\"Short read of status update (%d bytes)\", transfer->actual_length);\n    UVC_EXIT_VOID();\n    return;\n  }\n\n  originator = transfer->buffer[1];\n\n  switch (transfer->buffer[0] & 0x0f) {\n  case 1: {  /* VideoControl interface */\n    int found_entity = 0;\n    struct uvc_input_terminal *input_terminal;\n    struct uvc_processing_unit *processing_unit;\n\n    if (transfer->actual_length < 5) {\n      UVC_DEBUG(\"Short read of VideoControl status update (%d bytes)\",\n\t\ttransfer->actual_length);\n      UVC_EXIT_VOID();\n      return;\n    }\n\n    event = transfer->buffer[2];\n    selector = transfer->buffer[3];\n\n    if (originator == 0) {\n      UVC_DEBUG(\"Unhandled update from VC interface\");\n      UVC_EXIT_VOID();\n      return;  /* @todo VideoControl virtual entity interface updates */\n    }\n\n    if (event != 0) {\n      UVC_DEBUG(\"Unhandled VC event %d\", (int) event);\n      UVC_EXIT_VOID();\n      return;\n    }\n\n    /* printf(\"bSelector: %d\\n\", selector); */\n\n    DL_FOREACH(devh->info->ctrl_if.input_term_descs, input_terminal) {\n      if (input_terminal->bTerminalID == originator) {\n        status_class = UVC_STATUS_CLASS_CONTROL_CAMERA;\n        found_entity = 1;\n        break;\n      }\n    }\n\n    if (!found_entity) {\n      DL_FOREACH(devh->info->ctrl_if.processing_unit_descs, processing_unit) {\n        if (processing_unit->bUnitID == originator) {\n          status_class = UVC_STATUS_CLASS_CONTROL_PROCESSING;\n          found_entity = 1;\n          break;\n        }\n      }\n    }\n\n    if (!found_entity) {\n      UVC_DEBUG(\"Got status update for unknown VideoControl entity %d\",\n\t\t(int) originator);\n      UVC_EXIT_VOID();\n      return;\n    }\n\n    attribute = transfer->buffer[4];\n    data = transfer->buffer + 5;\n    data_len = transfer->actual_length - 5;\n    break;\n  }\n  case 2:  /* VideoStreaming interface */\n    UVC_DEBUG(\"Unhandled update from VideoStreaming interface\");\n    UVC_EXIT_VOID();\n    return;  /* @todo VideoStreaming updates */\n  }\n\n  UVC_DEBUG(\"Event: class=%d, event=%d, selector=%d, attribute=%d, data_len=%zd\",\n    status_class, event, selector, attribute, data_len);\n\n  if(devh->status_cb) {\n    UVC_DEBUG(\"Running user-supplied status callback\");\n    devh->status_cb(status_class,\n                    event,\n                    selector,\n                    attribute,\n                    data, data_len,\n                    devh->status_user_ptr);\n  }\n\n  UVC_EXIT_VOID();\n}\n\n/** @internal\n * @brief Process asynchronous status updates from the device.\n */\nvoid _uvc_status_callback(struct libusb_transfer *transfer) {\n  UVC_ENTER();\n\n  uvc_device_handle_t *devh = (uvc_device_handle_t *) transfer->user_data;\n\n  switch (transfer->status) {\n  case LIBUSB_TRANSFER_ERROR:\n  case LIBUSB_TRANSFER_CANCELLED:\n  case LIBUSB_TRANSFER_NO_DEVICE:\n    UVC_DEBUG(\"not processing/resubmitting, status = %d\", transfer->status);\n    UVC_EXIT_VOID();\n    return;\n  case LIBUSB_TRANSFER_COMPLETED:\n    uvc_process_status_xfer(devh, transfer);\n    break;\n  case LIBUSB_TRANSFER_TIMED_OUT:\n  case LIBUSB_TRANSFER_STALL:\n  case LIBUSB_TRANSFER_OVERFLOW:\n    UVC_DEBUG(\"retrying transfer, status = %d\", transfer->status);\n    break;\n  }\n\n  uvc_error_t ret = libusb_submit_transfer(transfer);\n  UVC_DEBUG(\"libusb_submit_transfer() = %d\", ret);\n\n  UVC_EXIT_VOID();\n}\n\n/** @brief Set a callback function to receive status updates\n *\n * @ingroup device\n */\nvoid uvc_set_status_callback(uvc_device_handle_t *devh,\n                             uvc_status_callback_t cb,\n                             void *user_ptr) {\n  UVC_ENTER();\n\n  devh->status_cb = cb;\n  devh->status_user_ptr = user_ptr;\n\n  UVC_EXIT_VOID();\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/diag.c",
    "content": "/*********************************************************************\n *********************************************************************/\n/*********************************************************************\n * changed to using LogCat than stderr when compiling for Android\n * Copyright (C) 2014 saki@serenegiant All rights reserved.\n *********************************************************************/\n/*********************************************************************\n * Software License Agreement (BSD License)\n *\n *  Copyright (C) 2010-2012 Ken Tossell\n *  All rights reserved.\n *\n *  Redistribution and use in source and binary forms, with or without\n *  modification, are permitted provided that the following conditions\n *  are met:\n *\n *   * Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n *   * Redistributions in binary form must reproduce the above\n *     copyright notice, this list of conditions and the following\n *     disclaimer in the documentation and/or other materials provided\n *     with the distribution.\n *   * Neither the name of the author nor other contributors may be\n *     used to endorse or promote products derived from this software\n *     without specific prior written permission.\n *\n *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n *  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n *  POSSIBILITY OF SUCH DAMAGE.\n *********************************************************************/\n/**\n * @defgroup diag Diagnostics\n * @brief Interpretation of devices, error codes and negotiated stream parameters\n */\n\n#include \"libuvc/libuvc.h\"\n#include \"libuvc/libuvc_internal.h\"\n\n/** @internal */\ntypedef struct _uvc_error_msg {\n\tuvc_error_t err;\n\tconst char *msg;\n} _uvc_error_msg_t;\n\nstatic const _uvc_error_msg_t uvc_error_msgs[] = {\n\t{ UVC_SUCCESS, \"Success\" },\n\t{ UVC_ERROR_IO, \"I/O error\" },\n\t{ UVC_ERROR_INVALID_PARAM, \"Invalid parameter\" },\n\t{ UVC_ERROR_ACCESS, \"Access denied\" },\n\t{ UVC_ERROR_NO_DEVICE, \"No such device\" },\n\t{ UVC_ERROR_NOT_FOUND, \t\"Not found\" },\n\t{ UVC_ERROR_BUSY, \"Busy\" },\n\t{ UVC_ERROR_TIMEOUT, \"Timeout\" },\n\t{ UVC_ERROR_OVERFLOW, \"Overflow\" },\n\t{ UVC_ERROR_PIPE, \"Pipe\" },\n\t{ UVC_ERROR_INTERRUPTED, \"Interrupted\" },\n\t{ UVC_ERROR_NO_MEM, \"Out of memory\" },\n\t{ UVC_ERROR_NOT_SUPPORTED, \"Not supported\" },\n\t{ UVC_ERROR_INVALID_DEVICE, \"Invalid device\" },\n\t{ UVC_ERROR_INVALID_MODE, \"Invalid mode\" },\n\t{ UVC_ERROR_CALLBACK_EXISTS, \"Callback exists\" }\n};\n\n#ifdef __ANDROID__\n#define FPRINTF(stream, ...) MARK(__VA_ARGS__); usleep(1000);\n#define FPRINTF_ERR(stream, ...) LOGW(__VA_ARGS__)\n#else\n#define FPRINTF(stream, ...) fprintf(stream, __VA_ARGS__)\n#define FPRINTF_ERR(stream, ...) fprintf(stream, __VA_ARGS__)\n#endif\n/** @brief Print a message explaining an error in the UVC driver\n * @ingroup diag\n *\n * @param err UVC error code\n * @param msg Optional custom message, prepended to output\n */\nvoid uvc_perror(uvc_error_t err, const char *msg) {\n\tif (msg && *msg) {\n\t\tFPRINTF_ERR(stderr, \"%s:%s (%d)\\n\", msg, uvc_strerror(err), err);\n\t} else {\n\t\tFPRINTF_ERR(stderr, \"%s (%d)\\n\", uvc_strerror(err), err);\n\t}\n/*\n\t if (msg && *msg) {\n\t \t fputs(msg, stderr);\n\t \t fputs(\": \", stderr);\n\t }\n\n\t FPRINTF(stderr, \"%s (%d)\\n\", uvc_strerror(err), err);\n*/\n}\n\n/** @brief Return a string explaining an error in the UVC driver\n * @ingroup diag\n *\n * @param err UVC error code\n * @return error message\n */\nconst char* uvc_strerror(uvc_error_t err) {\n\tsize_t idx;\n\n\tfor (idx = 0; idx < sizeof(uvc_error_msgs) / sizeof(*uvc_error_msgs);\n\t\t\t++idx) {\n\t\tif (uvc_error_msgs[idx].err == err) {\n\t\t\treturn uvc_error_msgs[idx].msg;\n\t\t}\n\t}\n\n\treturn \"Unknown error\";\n}\n\n/** @brief Print the values in a stream control block\n * @ingroup diag\n *\n * @param devh UVC device\n * @param stream Output stream (stderr if NULL)\n */\nvoid uvc_print_stream_ctrl(uvc_stream_ctrl_t *ctrl, FILE *stream) {\n\tif (stream == NULL)\n\t\tstream = stderr;\n\n\tFPRINTF(stream, \"bmHint: %04x\\n\", ctrl->bmHint);\n\tFPRINTF(stream, \"bFormatIndex: %d\\n\", ctrl->bFormatIndex);\n\tFPRINTF(stream, \"bFrameIndex: %d\\n\", ctrl->bFrameIndex);\n\tFPRINTF(stream, \"dwFrameInterval: %u\\n\", ctrl->dwFrameInterval);\n\tFPRINTF(stream, \"wKeyFrameRate: %d\\n\", ctrl->wKeyFrameRate);\n\tFPRINTF(stream, \"wPFrameRate: %d\\n\", ctrl->wPFrameRate);\n\tFPRINTF(stream, \"wCompQuality: %d\\n\", ctrl->wCompQuality);\n\tFPRINTF(stream, \"wCompWindowSize: %d\\n\", ctrl->wCompWindowSize);\n\tFPRINTF(stream, \"wDelay: %d\\n\", ctrl->wDelay);\n\tFPRINTF(stream, \"dwMaxVideoFrameSize: %u\\n\", ctrl->dwMaxVideoFrameSize);\n\tFPRINTF(stream, \"dwMaxPayloadTransferSize: %u\\n\", ctrl->dwMaxPayloadTransferSize);\n\tFPRINTF(stream, \"bInterfaceNumber: %d\\n\", ctrl->bInterfaceNumber);\n//\n\t/** add UVC 1.1 parameters */\n\tFPRINTF(stream, \"dwClockFrequency: %d\\n\", ctrl->dwClockFrequency);\n\tFPRINTF(stream, \"bmFramingInfo: %d\\n\", ctrl->bmFramingInfo);\n\tFPRINTF(stream, \"bPreferedVersion: %d\\n\", ctrl->bPreferedVersion);\n\tFPRINTF(stream, \"bMinVersion: %d\\n\", ctrl->bMinVersion);\n\tFPRINTF(stream, \"bMaxVersion: %d\\n\", ctrl->bMaxVersion);\n\t/** add UVC 1.5 parameters */\n\tFPRINTF(stream, \"bUsage: %d\\n\", ctrl->bUsage);\n\tFPRINTF(stream, \"bBitDepthLuma: %d\\n\", ctrl->bBitDepthLuma);\n\tFPRINTF(stream, \"bmSettings: %d\\n\", ctrl->bmSettings);\n\tFPRINTF(stream, \"bMaxNumberOfRefFramesPlus1: %d\\n\", ctrl->bMaxNumberOfRefFramesPlus1);\n\tFPRINTF(stream, \"bmRateControlModes: %d\\n\", ctrl->bmRateControlModes);\n#if !defined(__LP64__)\n\tFPRINTF(stream, \"bmLayoutPerStream: %llx\\n\", ctrl->bmLayoutPerStream);\n#else\n\tFPRINTF(stream, \"bmLayoutPerStream: %lx\\n\", ctrl->bmLayoutPerStream);\n#endif\n}\n\nstatic const char *_uvc_name_for_desc_type(const uint8_t type) {\n\tswitch (type) {\n\tcase LIBUSB_DT_DEVICE:\t\t\t\t\t\t// 0x01,\n\t\treturn \"Device Descriptor(0x01)\";\n\tcase LIBUSB_DT_CONFIG:\t\t\t\t\t\t// 0x02,\n\t\treturn \"Config Descriptor(0x02)\";\n\tcase LIBUSB_DT_STRING:\t\t\t\t\t\t// 0x03,\n\t\treturn \"String Descriptor(0x03)\";\n\tcase LIBUSB_DT_INTERFACE:\t\t\t\t\t// 0x04,\n\t\treturn \"Interface Descriptor(0x04)\";\n\tcase LIBUSB_DT_ENDPOINT:\t\t\t\t\t// 0x05,\n\t\treturn \"Endpoint Descriptor(0x05)\";\n\tcase LIBUSB_DT_DEVICE_QUALIFIER:\t\t\t// 0x06,\t// deprecated on USB3.0\n\t\treturn \"Qualifier Descriptor(0x06)\";\n\tcase LIBUSB_DT_OTHER_SPEED_CONFIGURATION:\t// 0x07,\t// deprecated on USB3.0\n\t\treturn \"Other speed Config Descriptor(0x07)\";\n\tcase LIBUSB_DT_INTERFACE_POWER:\t\t\t\t// 0x08,\n\t\treturn \"Power interface Descriptor(0x08)\";\n\tcase LIBUSB_DT_OTG:\t\t\t\t\t\t\t// 0x09,\n\t\treturn \"OTG Interface Descriptor(0x09)\";\n\tcase LIBUSB_DT_DEBUG:\t\t\t\t\t\t// 0x0a,\n\t\treturn \"Debug Descriptor(0x0a)\";\n\tcase LIBUSB_DT_ASSOCIATION:\t\t\t\t\t// 0x0b,\n\t\treturn \"Association Descriptor(0x0b)\";\n\tcase LIBUSB_DT_BOS:\t\t\t\t\t\t\t// 0x0f,\n\t\treturn \"BOS Descriptor(0x0f)\";\n\tcase LIBUSB_DT_DEVICE_CAPABILITY:\t\t\t// 0x10,\n\t\treturn \"Device capability Descriptor(0x10)\";\n// Class specified descriptors\n\tcase LIBUSB_DT_HID:\t\t\t\t\t\t\t// 0x21,\n\t\treturn \"CS:HID Descriptor(0x21)\";\n\tcase LIBUSB_DT_HID_REPORT:\t\t\t\t\t// 0x22,\n\t\treturn \"CS:HID Report Descriptor(0x22)\";\n\tcase LIBUSB_DT_HID_PHYSICAL: \t\t\t\t// 0x23,\n\t\treturn \"CS:HID Pysical Descriptor(0x23)\";\n\tcase LIBUSB_DT_CS_INTERFACE:\t\t\t\t// 0x24,\n\t\treturn \"CS:Interface Descriptor(0x24)\";\n\tcase LIBUSB_DT_CS_ENDPOINT:\t\t\t\t\t// 0x25,\n\t\treturn \"CS:Endpoint Descriptor(0x25)\";\n\tcase LIBUSB_DT_HUB: \t\t\t\t\t\t// 0x29,\n\t\treturn \"CS:Hub Descriptor(0x29)\";\n\tcase LIBUSB_DT_SUPERSPEED_HUB: \t\t\t\t// 0x2a,\n\t\treturn \"CS:Superspeed Hub Descriptor(0x2a)\";\n\tcase LIBUSB_DT_SS_ENDPOINT_COMPANION: \t\t// 0x30\t\t// defined on USB 3.0\n\t\treturn \"CS:Superspeed Endpoint Companion Descriptor(0x30)\";\n\tdefault:\n\t\treturn \"Unknown descriptor\";\n\t}\n}\n\nstatic const char *_uvc_name_for_class(const uint8_t clazz) {\n\tswitch (clazz) {\n\tcase LIBUSB_CLASS_AUDIO:\t\t\t\t// 1,\t\t/** Audio class */\n\t\treturn \"Audio\";\n\tcase LIBUSB_CLASS_COMM:\t\t\t\t\t// 2,\t\t/** Communications class */\n\t\treturn \"Comm\";\n\tcase LIBUSB_CLASS_HID:\t\t\t\t\t// 3,\t\t/** Human Interface Device class */\n\t\treturn \"HID\";\n\tcase LIBUSB_CLASS_PHYSICAL:\t\t\t\t// 5,\t\t/** Physical */\n\t\treturn \"Physical\";\n\tcase LIBUSB_CLASS_IMAGE:\t\t\t\t// 6,\t\t/** Image class */\n\t\treturn \"Image\";\n\tcase LIBUSB_CLASS_PRINTER:\t\t\t\t// 7,\t\t/** Printer class */\n\t\treturn \"Printer\";\n\tcase LIBUSB_CLASS_MASS_STORAGE:\t\t\t// 8,\t\t/** Mass storage class */\n\t\treturn \"Mass storage\";\n\tcase LIBUSB_CLASS_HUB:\t\t\t\t\t// 9,\t\t/** Hub class */\n\t\treturn \"Hub\";\n\tcase LIBUSB_CLASS_DATA:\t\t\t\t\t// 0x0a,\t/** Data class */\n\t\treturn \"Data\";\n\tcase LIBUSB_CLASS_SMART_CARD:\t\t\t// 0x0b,\t/** Smart Card */\n\t\treturn \"Smart card\";\n\tcase LIBUSB_CLASS_CONTENT_SECURITY:\t\t// 0x0d,\t/** Content Security */\n\t\treturn \"Security\";\n\tcase LIBUSB_CLASS_VIDEO:\t\t\t\t// 0x0e,\t/** Video */\n\t\treturn \"Video\";\n\tcase LIBUSB_CLASS_PERSONAL_HEALTHCARE:\t// 0x0f,\t/** Personal Healthcare */\n\t\treturn \"Helthcare\";\n\tcase LIBUSB_CLASS_DIAGNOSTIC_DEVICE:\t// 0xdc,\t/** Diagnostic Device */\n\t\treturn \"Diag\";\n\tcase LIBUSB_CLASS_WIRELESS:\t\t\t\t// 0xe0,\t/** Wireless class */\n\t\treturn \"Wireless\";\n\tcase LIBUSB_CLASS_APPLICATION:\t\t\t// 0xfe,\t/** Application class */\n\t\treturn \"App\";\n\tcase LIBUSB_CLASS_VENDOR_SPEC:\t\t\t// 0xff\t\t/** Class is vendor-specific */\n\t\treturn \"Vender specific\";\n\tdefault:\n\t\treturn \"Unknown\";\n\t}\n}\n\nstatic const char *_uvc_name_for_subtype(const uint8_t subtype) {\n\tswitch (subtype) {\n\tcase UVC_VS_UNDEFINED:\t\t\t\t// 0x00,\n\t\treturn \"Undefined(0x00)\";\n\tcase UVC_VS_INPUT_HEADER:\t\t\t// 0x01,\n\t\treturn \"Header(Input,0x01)\";\n\tcase UVC_VS_OUTPUT_HEADER:\t\t\t// 0x02,\n\t\treturn \"Header(Output,0x02)\";\n\tcase UVC_VS_STILL_IMAGE_FRAME:\t\t// 0x03,\n\t\treturn \"Frame(StillImage,0x03)\";\n\tcase UVC_VS_FORMAT_UNCOMPRESSED:\t// 0x04,\n\t\treturn \"Format(Uncompressed,0x04)\";\n\tcase UVC_VS_FRAME_UNCOMPRESSED:\t\t// 0x05,\n\t\treturn \"Frame(Uncompressed,0x05)\";\n\tcase UVC_VS_FORMAT_MJPEG:\t\t\t// 0x06,\n\t\treturn \"Format(MJPEG,0x06)\";\n\tcase UVC_VS_FRAME_MJPEG:\t\t\t// 0x07,\n\t\treturn \"Frame(MJPEG,0x07)\";\n\tcase UVC_VS_FORMAT_MPEG2TS:\t\t\t// 0x0a,\n\t\treturn \"Format(MPEG2TS,0x0a)\";\n\tcase UVC_VS_FORMAT_DV:\t\t\t\t// 0x0c,\n\t\treturn \"Format(DV,0x0c)\";\n\tcase UVC_VS_COLORFORMAT:\t\t\t// 0x0d,\n\t\treturn \"ColorFormat(0x0d)\";\n\tcase UVC_VS_FORMAT_FRAME_BASED:\t\t// 0x10,\n\t\treturn \"Format(FRAME_BASED,0x10)\";\n\tcase UVC_VS_FRAME_FRAME_BASED:\t\t// 0x11,\n\t\treturn \"Frame(FRAME_BASED,0x10)\";\n\tcase UVC_VS_FORMAT_STREAM_BASED:\t// 0x12\n\t\treturn \"Format(STREAM_BASED,0x10)\";\n\tdefault:\n\t\treturn \"Unknown\";\n\t}\n}\n\n/** @brief Print camera capabilities and configuration.\n * @ingroup diag\n *\n * @param devh UVC device\n * @param stream Output stream (stderr if NULL)\n */\nvoid uvc_print_diag(uvc_device_handle_t *devh, FILE *stream) {\n\tUVC_ENTER();\n\n\tif (stream == NULL)\n\t\tstream = stderr;\n\n\tif (devh->info->ctrl_if.bcdUVC) {\n\t\tuvc_streaming_interface_t *stream_if;\n\t\tint stream_idx = 0;\n\n\t\tuvc_device_descriptor_t *desc;\n\t\tuvc_get_device_descriptor(devh->dev, &desc);\n\n\t\tFPRINTF(stream, \"DEVICE CONFIGURATION (%04x:%04x/%s) ---\\n\",\n\t\t\t\tdesc->idVendor, desc->idProduct,\n\t\t\t\tdesc->serialNumber ? desc->serialNumber : \"[none]\");\n\n\t\tuvc_free_device_descriptor(desc);\n\n\t\tFPRINTF(stream, \"Status: %s\\n\", devh->streams ? \"streaming\" : \"idle\");\n\n\t\tFPRINTF(stream, \"VideoControl:\\n\"\n\t\t\t\t\"\\tbcdUVC: 0x%04x\\n\", devh->info->ctrl_if.bcdUVC);\n\n\t\tDL_FOREACH(devh->info->stream_ifs, stream_if)\n\t\t{\n\t\t\tuvc_format_desc_t *fmt_desc;\n\n\t\t\t++stream_idx;\n\n\t\t\tFPRINTF(stream,\n\t\t\t\t\"VideoStreaming(%d):\\n\"\n\t\t\t\t\"\\tbEndpointAddress: %d\\n\\tFormats:\\n\",\n\t\t\t\tstream_idx, stream_if->bEndpointAddress);\n\t\t\tuvc_print_format_desc(stream_if->format_descs, stream);\n\t\t}\n\n\t\tFPRINTF(stream, \"END DEVICE CONFIGURATION\\n\");\n\t} else {\n\t\tFPRINTF(stream, \"uvc_print_diag: Device not configured!\\n\");\n\t}\n\tUVC_EXIT_VOID();\n}\n\nvoid uvc_print_format_desc_one(uvc_format_desc_t *format_desc, FILE *stream) {\n\n\tuvc_frame_desc_t *frame_desc;\n\tint i;\n\n\tswitch (format_desc->bDescriptorSubtype) {\n\tcase UVC_VS_FORMAT_UNCOMPRESSED:\n\tcase UVC_VS_FORMAT_MJPEG:\n\t\tFPRINTF(stream, \"\\t\\tFormatDescriptor(bFormatIndex=%d)\", format_desc->bFormatIndex);\n\t\tFPRINTF(stream, \"\\t\\t  bDescriptorSubtype: %s\",\n\t\t\t_uvc_name_for_subtype(format_desc->bDescriptorSubtype));\n\t\tFPRINTF(stream, \"\\t\\t  bits per pixel: %d\", format_desc->bBitsPerPixel);\n\t\tFPRINTF(stream,\n\t\t\t\t\"\\t\\t  GUID:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\",\n\t\t\t\tformat_desc->guidFormat[0], format_desc->guidFormat[1],\n\t\t\t\tformat_desc->guidFormat[2], format_desc->guidFormat[3],\n\t\t\t\tformat_desc->guidFormat[4], format_desc->guidFormat[5],\n\t\t\t\tformat_desc->guidFormat[6], format_desc->guidFormat[7],\n\t\t\t\tformat_desc->guidFormat[8], format_desc->guidFormat[9],\n\t\t\t\tformat_desc->guidFormat[10], format_desc->guidFormat[11],\n\t\t\t\tformat_desc->guidFormat[12], format_desc->guidFormat[13],\n\t\t\t\tformat_desc->guidFormat[14], format_desc->guidFormat[15]);\n\n\t\tFPRINTF(stream, \"\\t\\t  bDefaultFrameIndex: %d\", format_desc->bDefaultFrameIndex);\n\t\tFPRINTF(stream, \"\\t\\t  bAspectRatio(x,y): %dx%d\", format_desc->bAspectRatioX, format_desc->bAspectRatioY);\n\t\tFPRINTF(stream, \"\\t\\t  bmInterlaceFlags: 0x%02x\", format_desc->bmInterlaceFlags);\n\t\tFPRINTF(stream, \"\\t\\t  bCopyProtect: 0x%02x\", format_desc->bCopyProtect);\n\n\t\tDL_FOREACH(format_desc->frame_descs, frame_desc)\n\t\t{\n\t\t\tuint32_t *interval_ptr;\n\n\t\t\tFPRINTF(stream, \"\\t\\t\\tFrameDescriptor(bFrameIndex=%d)\", frame_desc->bFrameIndex);\n\t\t\tFPRINTF(stream, \"\\t\\t\\t  bDescriptorSubtype: %s\", _uvc_name_for_subtype(frame_desc->bDescriptorSubtype));\n\t\t\tFPRINTF(stream, \"\\t\\t\\t  bmCapabilities: 0x%02x\", frame_desc->bmCapabilities);\n\t\t\tFPRINTF(stream, \"\\t\\t\\t  size(w,h):(%d,%d)\", frame_desc->wWidth, frame_desc->wHeight);\n\t\t\tFPRINTF(stream, \"\\t\\t\\t  bit rate(min,max): (%d,%d)\", frame_desc->dwMinBitRate, frame_desc->dwMaxBitRate);\n\t\t\tFPRINTF(stream, \"\\t\\t\\t  dwMaxVideoFrameBufferSize: %d\", frame_desc->dwMaxVideoFrameBufferSize);\n\t\t\tFPRINTF(stream, \"\\t\\t\\t  dwDefaultFrameInterval: 1/%d\", 10000000 / frame_desc->dwDefaultFrameInterval);\n\t\t\tif (frame_desc->intervals) {\n\t\t\t\tfor (interval_ptr = frame_desc->intervals;\n\t\t\t\t\t\t*interval_ptr; ++interval_ptr) {\n\t\t\t\t\tFPRINTF(stream, \"\\t\\t\\t  interval[%d]: 1/%d\",\n\t\t\t\t\t\t\t(int ) (interval_ptr - frame_desc->intervals),\n\t\t\t\t\t\t\t10000000 / *interval_ptr);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tFPRINTF(stream, \"\\t\\t\\t  min interval[%d] = 1/%d\",\n\t\t\t\t\tframe_desc->dwMinFrameInterval,\n\t\t\t\t\t10000000 / frame_desc->dwMinFrameInterval);\n\t\t\t\tFPRINTF(stream, \"\\t\\t\\t  max interval[%d] = 1/%d\",\n\t\t\t\t\tframe_desc->dwMaxFrameInterval,\n\t\t\t\t\t10000000 / frame_desc->dwMaxFrameInterval);\n\t\t\t\tif (frame_desc->dwFrameIntervalStep)\n\t\t\t\t\tFPRINTF(stream, \"\\t\\t\\t  interval step[%d] = 1/%d\",\n\t\t\t\t\t\tframe_desc->dwFrameIntervalStep,\n\t\t\t\t\t\t10000000 / frame_desc->dwFrameIntervalStep);\n\t\t\t}\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tFPRINTF(stream, \"\\t-UnknownFormat:0x%2d\", format_desc->bDescriptorSubtype);\n\t}\n}\n\nvoid uvc_print_format_desc(uvc_format_desc_t *format_descriptors, FILE *stream) {\n\tENTER();\n\n\tif (stream == NULL)\n\t\tstream = stderr;\n\n\tuvc_format_desc_t *fmt_desc;\n\tMARK(\"FORMAT DESCRIPTOR\");\n\tDL_FOREACH(format_descriptors, fmt_desc)\n\t{\n\t\tuvc_print_format_desc_one(fmt_desc, stream);\n\t}\n\tMARK(\"END FORMAT DESCRIPTOR\");\n\n\tEXIT();\n}\n\nvoid uvc_print_device_desc(uvc_device_handle_t *devh, FILE *stream) {\n\tENTER();\n\n\tif (stream == NULL)\n\t\tstream = stderr;\n\n\tstruct libusb_device_descriptor usb_desc;\n\tuvc_error_t ret;\n\n\tret = libusb_get_device_descriptor(devh->dev->usb_dev, &usb_desc);\n\n\tif (UNLIKELY(ret != UVC_SUCCESS)) {\n\t\tLOGE(\"failed libusb_get_device_descriptor\");\n\t\tEXIT();\n\t}\n\n\tFPRINTF(stream, \"DEVICE DESCRIPTOR (%04x:%04x)\", usb_desc.idVendor, usb_desc.idProduct);\n\tFPRINTF(stream, \"\\t bLength:%d\", usb_desc.bLength);\n\tFPRINTF(stream, \"\\t bDescriptorType: %s\", _uvc_name_for_desc_type(usb_desc.bDescriptorType));\n\tFPRINTF(stream, \"\\t bcdUSB:0x%04x\", usb_desc.bcdUSB);\n\tFPRINTF(stream, \"\\t bDeviceClass: %s(0x%02x)\", _uvc_name_for_class(usb_desc.bDeviceClass), usb_desc.bDeviceClass);\n\tFPRINTF(stream, \"\\t bDeviceSubClass:0x%02x\", usb_desc.bDeviceSubClass);\n\tFPRINTF(stream, \"\\t bDeviceProtocol:0x%02x\", usb_desc.bDeviceProtocol);\n\tFPRINTF(stream, \"\\t bMaxPacketSize0:%d\", usb_desc.bMaxPacketSize0);\n\tFPRINTF(stream, \"\\t idVendor:0x%04x\", usb_desc.idVendor);\n\tFPRINTF(stream, \"\\t idProduct:0x%04x\", usb_desc.idProduct);\n\tFPRINTF(stream, \"\\t bcdDevice:0x%04x\", usb_desc.bcdDevice);\n\tFPRINTF(stream, \"\\t iManufacturer:%d\", usb_desc.iManufacturer);\n\tFPRINTF(stream, \"\\t iProduct:%d\", usb_desc.iProduct);\n\tFPRINTF(stream, \"\\t iSerialNumber:%d\", usb_desc.iSerialNumber);\n\tFPRINTF(stream, \"\\t bNumConfigurations:%d\", usb_desc.bNumConfigurations);\n\n\tEXIT();\n}\n\nvoid uvc_print_endpoint_desc(\n\tconst struct libusb_endpoint_descriptor *endpoint, const int num_endpoint,\n\tconst char *prefix, FILE *stream) {\n\n//\tENTER();\n\n\tif (stream == NULL)\n\t\tstream = stderr;\n\n\tint ep_ix;\n\tconst struct libusb_endpoint_descriptor *ep;\n\n\tfor (ep_ix = 0; ep_ix < num_endpoint; ep_ix++) {\n\t\tep = endpoint + ep_ix;\n\t\tFPRINTF(stream, \"%s endpoint(%d)\", prefix, ep_ix);\n\t\tif LIKELY(ep) {\n\t\t\tFPRINTF(stream, \"%s\\t bLength:%d\", prefix, ep->bLength);\n\t\t\tFPRINTF(stream, \"%s\\t bDescriptorType: %s\", prefix, _uvc_name_for_desc_type(ep->bDescriptorType));\n\t\t\tFPRINTF(stream, \"%s\\t bEndpointAddress:0x%02x\", prefix, ep->bEndpointAddress);\n\t\t\tFPRINTF(stream, \"%s\\t bmAttributes:0x%02x\", prefix, ep->bmAttributes);\n\t\t\tFPRINTF(stream, \"%s\\t wMaxPacketSize:%d\", prefix, ep->wMaxPacketSize);\n\t\t\tFPRINTF(stream, \"%s\\t bInterval:%d\", prefix, ep->bInterval);\n\t\t\tFPRINTF(stream, \"%s\\t bRefresh(audio):%d\", prefix, ep->bRefresh);\n\t\t\tFPRINTF(stream, \"%s\\t bSynchAddress(audio):%d\", prefix, ep->bSynchAddress);\n\t\t\tFPRINTF(stream, \"%s\\t extra_length:%d\", prefix, ep->extra_length);\n\t\t}\n\t}\n//\tEXIT();\n}\n\nvoid uvc_print_interface_desc(\n\tconst struct libusb_interface *interface, const int num_interface,\n\tconst char *prefix, FILE *stream) {\n\n//\tENTER();\n\n\tif (stream == NULL)\n\t\tstream = stderr;\n\n\tconst struct libusb_interface *usb_if;\n\tconst struct libusb_interface_descriptor *altsetting;\n\tint if_ix, alt_ix;\n\tchar pre[64];\n\tsprintf(pre, \"%s\\t\\t\", prefix);\n\tfor (if_ix = 0; if_ix < num_interface; if_ix++) {\n\t\tusb_if = interface + if_ix;\n\t\tif LIKELY(usb_if) {\n\t\t\tFPRINTF(stream, \"%s interface(%d)\", prefix, if_ix);\n\t\t\tfor (alt_ix = 0; alt_ix < usb_if->num_altsetting; alt_ix++) {\n\t\t\t\taltsetting = usb_if->altsetting + alt_ix;\n\t\t\t\tif LIKELY(altsetting) {\n\t\t\t\t\tFPRINTF(stream, \"%s\\t altsetting:%d\", prefix, alt_ix);\n\t\t\t\t\tFPRINTF(stream, \"%s\\t\\t bLength:%d\", prefix, altsetting->bLength);\n\t\t\t\t\tFPRINTF(stream, \"%s\\t\\t bDescriptorType: %s\", prefix, _uvc_name_for_desc_type(altsetting->bDescriptorType));\n\t\t\t\t\tFPRINTF(stream, \"%s\\t\\t bInterfaceNumber:%d\", prefix, altsetting->bInterfaceNumber);\n\t\t\t\t\tFPRINTF(stream, \"%s\\t\\t bAlternateSetting:%d\", prefix, altsetting->bAlternateSetting);\n\t\t\t\t\tFPRINTF(stream, \"%s\\t\\t bNumEndpoints:%d\", prefix, altsetting->bNumEndpoints);\n\t\t\t\t\tFPRINTF(stream, \"%s\\t\\t bInterfaceClass: %s(0x%02x)\", prefix, _uvc_name_for_class(altsetting->bInterfaceClass), altsetting->bInterfaceClass);\n\t\t\t\t\tFPRINTF(stream, \"%s\\t\\t bInterfaceSubClass:0x%02x\", prefix, altsetting->bInterfaceSubClass);\n\t\t\t\t\tFPRINTF(stream, \"%s\\t\\t bInterfaceProtocol:0x%02x\", prefix, altsetting->bInterfaceProtocol);\n\t\t\t\t\tFPRINTF(stream, \"%s\\t\\t iInterface:%d\", prefix, altsetting->iInterface);\n\t\t\t\t\tFPRINTF(stream, \"%s\\t\\t extra_length:%d\", prefix, altsetting->extra_length);\n\t\t\t\t\tif (altsetting->bNumEndpoints)\n\t\t\t\t\t\tuvc_print_endpoint_desc(altsetting->endpoint, altsetting->bNumEndpoints, pre, stream);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n//\tEXIT();\n}\n\nvoid uvc_print_configuration_desc(uvc_device_handle_t *devh, FILE *stream) {\n\tENTER();\n\n\tif (stream == NULL)\n\t\tstream = stderr;\n\n\tint ret;\n\tlibusb_device_handle *usb_devh = uvc_get_libusb_handle(devh);\n\tlibusb_device *usb_dev = devh->dev->usb_dev;\n\tstruct libusb_config_descriptor *config_desc;\n\tint config;\n\n\tFPRINTF(stream, \"CONFIGURATION DESCRIPTOR\");\n\tret = libusb_get_configuration(usb_devh, &config);\n\tif (!ret) {\n\t\tFPRINTF(stream, \"\\t current=%d\", config);\n\t\tif LIKELY(config >= 0) {\n\t\t\tret = libusb_get_active_config_descriptor(usb_dev, &config_desc);\n\t\t\tif LIKELY(!ret) {\n\t\t\t\tFPRINTF(stream, \"\\t\\t bLength:%d\", config_desc->bLength);\n\t\t\t\tFPRINTF(stream, \"\\t\\t bDescriptorType: %s\", _uvc_name_for_desc_type(config_desc->bDescriptorType));\n\t\t\t\tFPRINTF(stream, \"\\t\\t wTotalLength:%d\", config_desc->wTotalLength);\n\t\t\t\tFPRINTF(stream, \"\\t\\t bNumInterfaces:%d\", config_desc->bNumInterfaces);\n\t\t\t\tFPRINTF(stream, \"\\t\\t bConfigurationValue:%d\", config_desc->bConfigurationValue);\n\t\t\t\tFPRINTF(stream, \"\\t\\t iConfiguration:%d\", config_desc->iConfiguration);\n\t\t\t\tFPRINTF(stream, \"\\t\\t bmAttributes:0x%02x\", config_desc->bmAttributes);\n\t\t\t\tFPRINTF(stream, \"\\t\\t MaxPower:%d x2[mA]\", config_desc->MaxPower);\n\t\t\t\tFPRINTF(stream, \"\\t\\t extra_length:%d\", config_desc->extra_length);\n\t\t\t\tif (config_desc->wTotalLength && config_desc->bNumInterfaces)\n\t\t\t\t\tuvc_print_interface_desc(config_desc->interface, config_desc->bNumInterfaces, \"\\t\\t\", stream);\n\t\t\t\tlibusb_free_config_descriptor(config_desc);\n\t\t\t}\n\t\t}\n\t}\n\n\tEXIT();\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/diag_original.c",
    "content": "/*********************************************************************\n* Software License Agreement (BSD License)\n*\n*  Copyright (C) 2010-2012 Ken Tossell\n*  All rights reserved.\n*\n*  Redistribution and use in source and binary forms, with or without\n*  modification, are permitted provided that the following conditions\n*  are met:\n*\n*   * Redistributions of source code must retain the above copyright\n*     notice, this list of conditions and the following disclaimer.\n*   * Redistributions in binary form must reproduce the above\n*     copyright notice, this list of conditions and the following\n*     disclaimer in the documentation and/or other materials provided\n*     with the distribution.\n*   * Neither the name of the author nor other contributors may be\n*     used to endorse or promote products derived from this software\n*     without specific prior written permission.\n*\n*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n*  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n*  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n*  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n*  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n*  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n*  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n*  POSSIBILITY OF SUCH DAMAGE.\n*********************************************************************/\n/**\n * @defgroup diag Diagnostics\n */\n\n#include \"libuvc/libuvc.h\"\n#include \"libuvc/libuvc_internal.h\"\n\n/** @internal */\ntypedef struct _uvc_error_msg {\n  uvc_error_t err;\n  const char *msg;\n} _uvc_error_msg_t;\n\nstatic const _uvc_error_msg_t uvc_error_msgs[] = {\n  {UVC_SUCCESS, \"Success\"},\n  {UVC_ERROR_IO, \"I/O error\"},\n  {UVC_ERROR_INVALID_PARAM, \"Invalid parameter\"},\n  {UVC_ERROR_ACCESS, \"Access denied\"},\n  {UVC_ERROR_NO_DEVICE, \"No such device\"},\n  {UVC_ERROR_NOT_FOUND, \"Not found\"},\n  {UVC_ERROR_BUSY, \"Busy\"},\n  {UVC_ERROR_TIMEOUT, \"Timeout\"},\n  {UVC_ERROR_OVERFLOW, \"Overflow\"},\n  {UVC_ERROR_PIPE, \"Pipe\"},\n  {UVC_ERROR_INTERRUPTED, \"Interrupted\"},\n  {UVC_ERROR_NO_MEM, \"Out of memory\"},\n  {UVC_ERROR_NOT_SUPPORTED, \"Not supported\"},\n  {UVC_ERROR_INVALID_DEVICE, \"Invalid device\"},\n  {UVC_ERROR_INVALID_MODE, \"Invalid mode\"},\n  {UVC_ERROR_CALLBACK_EXISTS, \"Callback exists\"}\n};\n\n/** @brief Print a message explaining an error in the UVC driver\n * @ingroup diag\n *\n * @param err UVC error code\n * @param msg Optional custom message, prepended to output\n */\nvoid uvc_perror(uvc_error_t err, const char *msg) {\n  if (msg && *msg) {\n    fputs(msg, stderr);\n    fputs(\": \", stderr);\n  }\n\n  fprintf(stderr, \"%s (%d)\\n\", uvc_strerror(err), err);\n}\n\n/** @brief Return a string explaining an error in the UVC driver\n * @ingroup diag\n *\n * @param err UVC error code\n * @return error message\n */\nconst char* uvc_strerror(uvc_error_t err) {\n  size_t idx;\n\n  for (idx = 0; idx < sizeof(uvc_error_msgs) / sizeof(*uvc_error_msgs); ++idx) {\n    if (uvc_error_msgs[idx].err == err) {\n      return uvc_error_msgs[idx].msg;\n    }\n  }\n\n  return \"Unknown error\";\n}\n\n/** @brief Print the values in a stream control block\n * @ingroup diag\n *\n * @param devh UVC device\n * @param stream Output stream (stderr if NULL)\n */\nvoid uvc_print_stream_ctrl(uvc_stream_ctrl_t *ctrl, FILE *stream) {\n  if (stream == NULL)\n    stream = stderr;\n\n  fprintf(stream, \"bmHint: %04x\\n\", ctrl->bmHint);\n  fprintf(stream, \"bFormatIndex: %d\\n\", ctrl->bFormatIndex);\n  fprintf(stream, \"bFrameIndex: %d\\n\", ctrl->bFrameIndex);\n  fprintf(stream, \"dwFrameInterval: %u\\n\", ctrl->dwFrameInterval);\n  fprintf(stream, \"wKeyFrameRate: %d\\n\", ctrl->wKeyFrameRate);\n  fprintf(stream, \"wPFrameRate: %d\\n\", ctrl->wPFrameRate);\n  fprintf(stream, \"wCompQuality: %d\\n\", ctrl->wCompQuality);\n  fprintf(stream, \"wCompWindowSize: %d\\n\", ctrl->wCompWindowSize);\n  fprintf(stream, \"wDelay: %d\\n\", ctrl->wDelay);\n  fprintf(stream, \"dwMaxVideoFrameSize: %u\\n\", ctrl->dwMaxVideoFrameSize);\n  fprintf(stream, \"dwMaxPayloadTransferSize: %u\\n\", ctrl->dwMaxPayloadTransferSize);\n  fprintf(stream, \"bInterfaceNumber: %d\\n\", ctrl->bInterfaceNumber);\n}\n\nstatic const char *_uvc_name_for_format_subtype(uint8_t subtype) {\n  switch (subtype) {\n  case UVC_VS_FORMAT_UNCOMPRESSED:\n    return \"UncompressedFormat\";\n  case UVC_VS_FORMAT_MJPEG:\n    return \"MJPEGFormat\";\n  default:\n    return \"Unknown\";\n  }\n}\n\n/** @brief Print camera capabilities and configuration.\n * @ingroup diag\n *\n * @param devh UVC device\n * @param stream Output stream (stderr if NULL)\n */\nvoid uvc_print_diag(uvc_device_handle_t *devh, FILE *stream) {\n  if (stream == NULL)\n    stream = stderr;\n\n  if (devh->info->ctrl_if.bcdUVC) {\n    uvc_streaming_interface_t *stream_if;\n    int stream_idx = 0;\n\n    uvc_device_descriptor_t *desc;\n    uvc_get_device_descriptor(devh->dev, &desc);\n\n    fprintf(stream, \"DEVICE CONFIGURATION (%04x:%04x/%s) ---\\n\",\n        desc->idVendor, desc->idProduct,\n        desc->serialNumber ? desc->serialNumber : \"[none]\");\n\n    uvc_free_device_descriptor(desc);\n\n    fprintf(stream, \"Status: %s\\n\", devh->streams ? \"streaming\" : \"idle\");\n\n    fprintf(stream, \"VideoControl:\\n\"\n        \"\\tbcdUVC: 0x%04x\\n\",\n        devh->info->ctrl_if.bcdUVC);\n\n    DL_FOREACH(devh->info->stream_ifs, stream_if) {\n      uvc_format_desc_t *fmt_desc;\n\n      ++stream_idx;\n\n      fprintf(stream, \"VideoStreaming(%d):\\n\"\n          \"\\tbEndpointAddress: %d\\n\\tFormats:\\n\",\n          stream_idx, stream_if->bEndpointAddress);\n\n      DL_FOREACH(stream_if->format_descs, fmt_desc) {\n        uvc_frame_desc_t *frame_desc;\n        int i;\n\n        switch (fmt_desc->bDescriptorSubtype) {\n          case UVC_VS_FORMAT_UNCOMPRESSED:\n          case UVC_VS_FORMAT_MJPEG:\n            fprintf(stream,\n                \"\\t\\%s(%d)\\n\"\n                \"\\t\\t  bits per pixel: %d\\n\"\n                \"\\t\\t  GUID: \",\n                _uvc_name_for_format_subtype(fmt_desc->bDescriptorSubtype),\n                fmt_desc->bFormatIndex,\n                fmt_desc->bBitsPerPixel);\n\n            for (i = 0; i < 16; ++i)\n              fprintf(stream, \"%02x\", fmt_desc->guidFormat[i]);\n\n            fprintf(stream, \"\\n\");\n\n            fprintf(stream,\n                \"\\t\\t  default frame: %d\\n\"\n                \"\\t\\t  aspect ration: %dx%d\\n\"\n                \"\\t\\t  interlace flags: %02x\\n\"\n                \"\\t\\t  copy protect: %02x\\n\",\n                fmt_desc->bDefaultFrameIndex,\n                fmt_desc->bAspectRatioX,\n                fmt_desc->bAspectRatioY,\n                fmt_desc->bmInterlaceFlags,\n                fmt_desc->bCopyProtect);\n\n            DL_FOREACH(fmt_desc->frame_descs, frame_desc) {\n              uint32_t *interval_ptr;\n\n              fprintf(stream,\n                  \"\\t\\t\\tFrameDescriptor(%d)\\n\"\n                  \"\\t\\t\\t  capabilities: %02x\\n\"\n                  \"\\t\\t\\t  size: %dx%d\\n\"\n                  \"\\t\\t\\t  bit rate: %d-%d\\n\"\n                  \"\\t\\t\\t  max frame size: %d\\n\"\n                  \"\\t\\t\\t  default interval: 1/%d\\n\",\n                  frame_desc->bFrameIndex,\n                  frame_desc->bmCapabilities,\n                  frame_desc->wWidth,\n                  frame_desc->wHeight,\n                  frame_desc->dwMinBitRate,\n                  frame_desc->dwMaxBitRate,\n                  frame_desc->dwMaxVideoFrameBufferSize,\n                  10000000 / frame_desc->dwDefaultFrameInterval);\n              if (frame_desc->intervals) {\n                for (interval_ptr = frame_desc->intervals;\n                     *interval_ptr;\n                     ++interval_ptr) {\n                  fprintf(stream,\n                      \"\\t\\t\\t  interval[%d]: 1/%d\\n\",\n\t\t      (int) (interval_ptr - frame_desc->intervals),\n\t\t      10000000 / *interval_ptr);\n                }\n              } else {\n                fprintf(stream,\n                    \"\\t\\t\\t  min interval[%d] = 1/%d\\n\"\n                    \"\\t\\t\\t  max interval[%d] = 1/%d\\n\",\n                    frame_desc->dwMinFrameInterval,\n                    10000000 / frame_desc->dwMinFrameInterval,\n                    frame_desc->dwMaxFrameInterval,\n                    10000000 / frame_desc->dwMaxFrameInterval);\n                if (frame_desc->dwFrameIntervalStep)\n                  fprintf(stream,\n                      \"\\t\\t\\t  interval step[%d] = 1/%d\\n\",\n                      frame_desc->dwFrameIntervalStep,\n                      10000000 / frame_desc->dwFrameIntervalStep);\n              }\n            }\n            break;\n          default:\n            fprintf(stream, \"\\t-UnknownFormat\\n\");\n        }\n      }\n    }\n\n    fprintf(stream, \"END DEVICE CONFIGURATION\\n\");\n  } else {\n    fprintf(stream, \"uvc_print_diag: Device not configured!\\n\");\n  }\n}\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/example.c",
    "content": "#include \"libuvc/libuvc.h\"\n#include <stdio.h>\n\n/* This callback function runs once per frame. Use it to perform any\n * quick processing you need, or have it put the frame into your application's\n * input queue. If this function takes too long, you'll start losing frames. */\nvoid cb(uvc_frame_t *frame, void *ptr) {\n  uvc_frame_t *bgr;\n  uvc_error_t ret;\n\n  /* We'll convert the image from YUV/JPEG to BGR, so allocate space */\n  bgr = uvc_allocate_frame(frame->width * frame->height * 3);\n  if (!bgr) {\n    printf(\"unable to allocate bgr frame!\");\n    return;\n  }\n\n  /* Do the BGR conversion */\n  ret = uvc_any2bgr(frame, bgr);\n  if (ret) {\n    uvc_perror(ret, \"uvc_any2bgr\");\n    uvc_free_frame(bgr);\n    return;\n  }\n\n  /* Call a user function:\n   *\n   * my_type *my_obj = (*my_type) ptr;\n   * my_user_function(ptr, bgr);\n   * my_other_function(ptr, bgr->data, bgr->width, bgr->height);\n   */\n\n  /* Call a C++ method:\n   *\n   * my_type *my_obj = (*my_type) ptr;\n   * my_obj->my_func(bgr);\n   */\n\n  /* Use opencv.highgui to display the image:\n   * \n   * cvImg = cvCreateImageHeader(\n   *     cvSize(bgr->width, bgr->height),\n   *     IPL_DEPTH_8U,\n   *     3);\n   *\n   * cvSetData(cvImg, bgr->data, bgr->width * 3); \n   *\n   * cvNamedWindow(\"Test\", CV_WINDOW_AUTOSIZE);\n   * cvShowImage(\"Test\", cvImg);\n   * cvWaitKey(10);\n   *\n   * cvReleaseImageHeader(&cvImg);\n   */\n\n  uvc_free_frame(bgr);\n}\n\nint main(int argc, char **argv) {\n  uvc_context_t *ctx;\n  uvc_device_t *dev;\n  uvc_device_handle_t *devh;\n  uvc_stream_ctrl_t ctrl;\n  uvc_error_t res;\n\n  /* Initialize a UVC service context. Libuvc will set up its own libusb\n   * context. Replace NULL with a libusb_context pointer to run libuvc\n   * from an existing libusb context. */\n  res = uvc_init(&ctx, NULL);\n\n  if (res < 0) {\n    uvc_perror(res, \"uvc_init\");\n    return res;\n  }\n\n  puts(\"UVC initialized\");\n\n  /* Locates the first attached UVC device, stores in dev */\n  res = uvc_find_device(\n      ctx, &dev,\n      0, 0, NULL); /* filter devices: vendor_id, product_id, \"serial_num\" */\n\n  if (res < 0) {\n    uvc_perror(res, \"uvc_find_device\"); /* no devices found */\n  } else {\n    puts(\"Device found\");\n\n    /* Try to open the device: requires exclusive access */\n    res = uvc_open(dev, &devh);\n\n    if (res < 0) {\n      uvc_perror(res, \"uvc_open\"); /* unable to open device */\n    } else {\n      puts(\"Device opened\");\n\n      /* Print out a message containing all the information that libuvc\n       * knows about the device */\n      uvc_print_diag(devh, stderr);\n\n      /* Try to negotiate a 640x480 30 fps YUYV stream profile */\n      res = uvc_get_stream_ctrl_format_size(\n          devh, &ctrl, /* result stored in ctrl */\n          UVC_FRAME_FORMAT_YUYV, /* YUV 422, aka YUV 4:2:2. try _COMPRESSED */\n          640, 480, 30 /* width, height, fps */\n      );\n\n      /* Print out the result */\n      uvc_print_stream_ctrl(&ctrl, stderr);\n\n      if (res < 0) {\n        uvc_perror(res, \"get_mode\"); /* device doesn't provide a matching stream */\n      } else {\n        /* Start the video stream in isochronous mode. The library will\n         * call user function cb: cb(frame, (void*) 12345)\n         */\n        res = uvc_start_iso_streaming(devh, &ctrl, cb, 12345);\n\n        if (res < 0) {\n          uvc_perror(res, \"start_streaming\"); /* unable to start stream */\n        } else {\n          puts(\"Streaming...\");\n\n          uvc_set_ae_mode(devh, 1); /* e.g., turn on auto exposure */\n\n          sleep(10); /* stream for 10 seconds */\n\n          /* End the stream. Blocks until last callback is serviced */\n          uvc_stop_streaming(devh);\n          puts(\"Done streaming.\");\n        }\n      }\n\n      /* Release our handle on the device */\n      uvc_close(devh);\n      puts(\"Device closed\");\n    }\n\n    /* Release the device descriptor */\n    uvc_unref_device(dev);\n  }\n\n  /* Close the UVC context. This closes and cleans up any existing device handles,\n   * and it closes the libusb context if one was not provided. */\n  uvc_exit(ctx);\n  puts(\"UVC exited\");\n\n  return 0;\n}\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/frame-mjpeg.c",
    "content": "/*********************************************************************\n * add and modified some function to avoid crash\n * Copyright (C) 2014-2015 saki@serenegiant All rights reserved.\n *********************************************************************/\n/*********************************************************************\n * Software License Agreement (BSD License)\n *\n *  Copyright (C) 2014 Robert Xiao\n *  All rights reserved.\n *\n *  Redistribution and use in source and binary forms, with or without\n *  modification, are permitted provided that the following conditions\n *  are met:\n *\n *   * Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n *   * Redistributions in binary form must reproduce the above\n *     copyright notice, this list of conditions and the following\n *     disclaimer in the documentation and/or other materials provided\n *     with the distribution.\n *   * Neither the name of the author nor other contributors may be\n *     used to endorse or promote products derived from this software\n *     without specific prior written permission.\n *\n *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n *  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n *  POSSIBILITY OF SUCH DAMAGE.\n *********************************************************************/\n\n/**\n * @defgroup frame Frame processing\n */\n#include \"libuvc/libuvc.h\"\n#include \"libuvc/libuvc_internal.h\"\n#include <jpeglib.h>\n#include <setjmp.h>\n\nextern uvc_error_t uvc_ensure_frame_size(uvc_frame_t *frame, size_t need_bytes);\n\nstruct error_mgr {\n\tstruct jpeg_error_mgr super;\n\tjmp_buf jmp;\n};\n\nstatic void _error_exit(j_common_ptr dinfo) {\n\tstruct error_mgr *myerr = (struct error_mgr *) dinfo->err;\n#ifndef NDEBUG\n#if (defined(ANDROID) || defined(__ANDROID__))\n\tchar err_msg[1024];\n\t(*dinfo->err->format_message)(dinfo, err_msg);\n\terr_msg[1023] = 0;\n\tLOGW(\"err=%s\", err_msg);\n#else\n\t(*dinfo->err->output_message)(dinfo);\n#endif\n#endif\n\tlongjmp(myerr->jmp, 1);\n}\n\n/* ISO/IEC 10918-1:1993(E) K.3.3. Default Huffman tables used by MJPEG UVC devices\n which don't specify a Huffman table in the JPEG stream. */\nstatic const unsigned char dc_lumi_len[] = {\n\t0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };\nstatic const unsigned char dc_lumi_val[] = {\n\t0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };\n\nstatic const unsigned char dc_chromi_len[] = {\n\t0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };\nstatic const unsigned char dc_chromi_val[] = {\n\t0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };\n\nstatic const unsigned char ac_lumi_len[] = {\n\t0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };\nstatic const unsigned char ac_lumi_val[] = {\n\t0x01, 0x02, 0x03, 0x00, 0x04, 0x11,\t0x05, 0x12,\n\t0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,\n\t0x22, 0x71,\t0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,\n\t0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,\n\t0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,\n\t0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,\n\t0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,\n\t0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,\n\t0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,\n\t0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,\n\t0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,\n\t0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,\n\t0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,\n\t0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,\n\t0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,\n\t0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,\n\t0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,\n\t0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,\n\t0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,\n\t0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,\n\t0xf9, 0xfa\n};\nstatic const unsigned char ac_chromi_len[] = {\n\t0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };\nstatic const unsigned char ac_chromi_val[] = {\n\t0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,\n\t0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,\n\t0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,\n\t0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,\n\t0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,\n\t0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,\n\t0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,\n\t0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,\n\t0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,\n\t0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,\n\t0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,\n\t0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,\n\t0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,\n\t0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,\n\t0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,\n\t0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,\n\t0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,\n\t0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,\n\t0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,\n\t0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,\n\t0xf9, 0xfa\n};\n\n#define COPY_HUFF_TABLE(dinfo,tbl,name) do { \\\n\tif (dinfo->tbl == NULL) dinfo->tbl = jpeg_alloc_huff_table((j_common_ptr)dinfo); \\\n\t\tmemcpy(dinfo->tbl->bits, name##_len, sizeof(name##_len)); \\\n\t\tmemset(dinfo->tbl->huffval, 0, sizeof(dinfo->tbl->huffval)); \\\n\t\tmemcpy(dinfo->tbl->huffval, name##_val, sizeof(name##_val)); \\\n\t} while(0)\n\nstatic inline void insert_huff_tables(j_decompress_ptr dinfo) {\n\tCOPY_HUFF_TABLE(dinfo, dc_huff_tbl_ptrs[0], dc_lumi);\n\tCOPY_HUFF_TABLE(dinfo, dc_huff_tbl_ptrs[1], dc_chromi);\n\tCOPY_HUFF_TABLE(dinfo, ac_huff_tbl_ptrs[0], ac_lumi);\n\tCOPY_HUFF_TABLE(dinfo, ac_huff_tbl_ptrs[1], ac_chromi);\n}\n\n// XXX added to improve the performance of decoding\n// maximun reading lines for each call of jpeg_read_scanlines\n// when defined this macro, it's value should be common factor\n// of all available frame height.\n// (1, 2, 4, 5, 6, 8, 10, 12, 20, 40...for 720p&1080p)\n#define MAX_READLINE 8\n\n#ifndef MAX_READLINE\n#define MAX_READLINE 1\n#endif\n#if MAX_READLINE < 1\n#undef MAX_READLINE\n#define MAX_READLINE 1\n#endif\n\n/** @brief Convert an MJPEG frame to RGB\n * @ingroup frame\n *\n * @param in MJPEG frame\n * @param out RGB frame\n */\nuvc_error_t uvc_mjpeg2rgb(uvc_frame_t *in, uvc_frame_t *out) {\n\tstruct jpeg_decompress_struct dinfo;\n\tstruct error_mgr jerr;\n\tsize_t lines_read;\n\t// local copy\n\tuint8_t *data = out->data;\n\tconst int out_step = out->step;\n\n\tint num_scanlines, i;\n\tlines_read = 0;\n\tunsigned char *buffer[MAX_READLINE];\n\n\tout->actual_bytes = 0;\t// XXX\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_MJPEG))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (uvc_ensure_frame_size(out, in->width * in->height * 3) < 0)\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = UVC_FRAME_FORMAT_RGB;\n\tout->step = in->width * 3;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\n\tdinfo.err = jpeg_std_error(&jerr.super);\n\tjerr.super.error_exit = _error_exit;\n\n\tif (setjmp(jerr.jmp)) {\n\t\tgoto fail;\n\t}\n\n\tjpeg_create_decompress(&dinfo);\n\tjpeg_mem_src(&dinfo, in->data, in->actual_bytes/*in->data_bytes*/);\n\tjpeg_read_header(&dinfo, TRUE);\n\n\tif (dinfo.dc_huff_tbl_ptrs[0] == NULL) {\n\t\t/* This frame is missing the Huffman tables: fill in the standard ones */\n\t\tinsert_huff_tables(&dinfo);\n\t}\n\n\tdinfo.out_color_space = JCS_RGB;\n\tdinfo.dct_method = JDCT_IFAST;\n\n\tjpeg_start_decompress(&dinfo);\n\n\tif (LIKELY(dinfo.output_height == out->height)) {\n\t\tfor (; dinfo.output_scanline < dinfo.output_height ;) {\n\t\t\tbuffer[0] = data + (lines_read) * out_step;\n\t\t\tfor (i = 1; i < MAX_READLINE; i++)\n\t\t\t\tbuffer[i] = buffer[i-1] + out_step;\n\t\t\tnum_scanlines = jpeg_read_scanlines(&dinfo, buffer, MAX_READLINE);\n\t\t\tlines_read += num_scanlines;\n\t\t}\n\t\tout->actual_bytes = in->width * in->height * 3;\t// XXX\n\t}\n\tjpeg_finish_decompress(&dinfo);\n\tjpeg_destroy_decompress(&dinfo);\n\treturn lines_read == out->height ? UVC_SUCCESS : UVC_ERROR_OTHER;\t// XXX\n\nfail:\n\tjpeg_destroy_decompress(&dinfo);\n\treturn UVC_ERROR_OTHER+1;\n}\n\n/** @brief Convert an MJPEG frame to BGR\n * @ingroup frame\n *\n * @param in MJPEG frame\n * @param out BGR frame\n */\nuvc_error_t uvc_mjpeg2bgr(uvc_frame_t *in, uvc_frame_t *out) {\n\tstruct jpeg_decompress_struct dinfo;\n\tstruct error_mgr jerr;\n\tsize_t lines_read;\n\n\tint num_scanlines, i;\n\tlines_read = 0;\n\tunsigned char *buffer[MAX_READLINE];\n\n\tout->actual_bytes = 0;\t// XXX\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_MJPEG))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (uvc_ensure_frame_size(out, in->width * in->height * 3) < 0)\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = UVC_FRAME_FORMAT_BGR;\n\tout->step = in->width * 3;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\n\tdinfo.err = jpeg_std_error(&jerr.super);\n\tjerr.super.error_exit = _error_exit;\n\n\tif (setjmp(jerr.jmp)) {\n\t\tgoto fail;\n\t}\n\n\tjpeg_create_decompress(&dinfo);\n\tjpeg_mem_src(&dinfo, in->data, in->actual_bytes/*in->data_bytes*/);\n\tjpeg_read_header(&dinfo, TRUE);\n\n\tif (dinfo.dc_huff_tbl_ptrs[0] == NULL) {\n\t\t/* This frame is missing the Huffman tables: fill in the standard ones */\n\t\tinsert_huff_tables(&dinfo);\n\t}\n\n\tdinfo.out_color_space = JCS_EXT_BGR;\n\tdinfo.dct_method = JDCT_IFAST;\n\n\tjpeg_start_decompress(&dinfo);\n\n\t// local copy\n\tuint8_t *data = out->data;\n\tconst int out_step = out->step;\n\n\tif (LIKELY(dinfo.output_height == out->height)) {\n\t\tfor (; dinfo.output_scanline < dinfo.output_height ;) {\n\t\t\tbuffer[0] = data + (lines_read) * out_step;\n\t\t\tfor (i = 1; i < MAX_READLINE; i++)\n\t\t\t\tbuffer[i] = buffer[i-1] + out_step;\n\t\t\tnum_scanlines = jpeg_read_scanlines(&dinfo, buffer, MAX_READLINE);\n\t\t\tlines_read += num_scanlines;\n\t\t}\n\t\tout->actual_bytes = in->width * in->height * 3;\t// XXX\n\t}\n\tjpeg_finish_decompress(&dinfo);\n\tjpeg_destroy_decompress(&dinfo);\n\treturn lines_read == out->height ? UVC_SUCCESS : UVC_ERROR_OTHER;\t// XXX\n\nfail:\n\tjpeg_destroy_decompress(&dinfo);\n\treturn UVC_ERROR_OTHER+1;\n}\n\n/** @brief Convert an MJPEG frame to RGB565\n * @ingroup frame\n *\n * @param in MJPEG frame\n * @param out RGB frame\n */\nuvc_error_t uvc_mjpeg2rgb565(uvc_frame_t *in, uvc_frame_t *out) {\n\tstruct jpeg_decompress_struct dinfo;\n\tstruct error_mgr jerr;\n\tsize_t lines_read;\n\n\tint num_scanlines, i;\n\tlines_read = 0;\n\tunsigned char *buffer[MAX_READLINE];\n\n\tout->actual_bytes = 0;\t// XXX\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_MJPEG))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (uvc_ensure_frame_size(out, in->width * in->height * 2) < 0)\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = UVC_FRAME_FORMAT_RGB565;\n\tout->step = in->width * 2;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\n\tdinfo.err = jpeg_std_error(&jerr.super);\n\tjerr.super.error_exit = _error_exit;\n\n\tif (setjmp(jerr.jmp)) {\n\t\tgoto fail;\n\t}\n\n\tjpeg_create_decompress(&dinfo);\n\tjpeg_mem_src(&dinfo, in->data, in->actual_bytes/*in->data_bytes*/);\n\tjpeg_read_header(&dinfo, TRUE);\n\n\tif (dinfo.dc_huff_tbl_ptrs[0] == NULL) {\n\t\t/* This frame is missing the Huffman tables: fill in the standard ones */\n\t\tinsert_huff_tables(&dinfo);\n\t}\n\n\tdinfo.out_color_space = JCS_RGB565;\n\tdinfo.dct_method = JDCT_IFAST;\n\n\tjpeg_start_decompress(&dinfo);\n\n\t// local copy\n\tuint8_t *data = out->data;\n\tconst int out_step = out->step;\n\n\tif (LIKELY(dinfo.output_height == out->height)) {\n\t\tfor (; dinfo.output_scanline < dinfo.output_height ;) {\n\t\t\tbuffer[0] = data + (lines_read) * out_step;\n\t\t\tfor (i = 1; i < MAX_READLINE; i++)\n\t\t\t\tbuffer[i] = buffer[i-1] + out_step;\n\t\t\tnum_scanlines = jpeg_read_scanlines(&dinfo, buffer, MAX_READLINE);\n\t\t\tlines_read += num_scanlines;\n\t\t}\n\t\tout->actual_bytes = in->width * in->height * 2;\t// XXX\n\t}\n\tjpeg_finish_decompress(&dinfo);\n\tjpeg_destroy_decompress(&dinfo);\n\treturn lines_read == out->height ? UVC_SUCCESS : UVC_ERROR_OTHER;\t// XXX\n\nfail:\n\tjpeg_destroy_decompress(&dinfo);\n\treturn UVC_ERROR_OTHER+1;\n}\n\n/** @brief Convert an MJPEG frame to RGBX\n * @ingroup frame\n *\n * @param in MJPEG frame\n * @param out RGBX frame\n */\nuvc_error_t uvc_mjpeg2rgbx(uvc_frame_t *in, uvc_frame_t *out) {\n\tstruct jpeg_decompress_struct dinfo;\n\tstruct error_mgr jerr;\n\tsize_t lines_read;\n\t// local copy\n\tuint8_t *data = out->data;\n\tconst int out_step = out->step;\n\n\tint num_scanlines, i;\n\tlines_read = 0;\n\tunsigned char *buffer[MAX_READLINE];\n\n\tout->actual_bytes = 0;\t// XXX\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_MJPEG))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (uvc_ensure_frame_size(out, in->width * in->height * 4) < 0)\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = UVC_FRAME_FORMAT_RGBX;\t// XXX\n\tout->step = in->width * 4;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\n\tdinfo.err = jpeg_std_error(&jerr.super);\n\tjerr.super.error_exit = _error_exit;\n\n\tif (setjmp(jerr.jmp)) {\n\t\tgoto fail;\n\t}\n\n\tjpeg_create_decompress(&dinfo);\n\tjpeg_mem_src(&dinfo, in->data, in->actual_bytes/*in->data_bytes*/);\t// XXX\n\tjpeg_read_header(&dinfo, TRUE);\n\n\tif (dinfo.dc_huff_tbl_ptrs[0] == NULL) {\n\t\t/* This frame is missing the Huffman tables: fill in the standard ones */\n\t\tinsert_huff_tables(&dinfo);\n\t}\n\n\tdinfo.out_color_space = JCS_EXT_RGBA;\n\tdinfo.dct_method = JDCT_IFAST;\n\n\tjpeg_start_decompress(&dinfo);\n\n\tif (LIKELY(dinfo.output_height == out->height)) {\n\t\tfor (; dinfo.output_scanline < dinfo.output_height ;) {\n\t\t\tbuffer[0] = data + (lines_read) * out_step;\n\t\t\tfor (i = 1; i < MAX_READLINE; i++)\n\t\t\t\tbuffer[i] = buffer[i-1] + out_step;\n\t\t\tnum_scanlines = jpeg_read_scanlines(&dinfo, buffer, MAX_READLINE);\n\t\t\tlines_read += num_scanlines;\n\t\t}\n\t\tout->actual_bytes = in->width * in->height * 4;\t// XXX\n\t}\n\tjpeg_finish_decompress(&dinfo);\n\tjpeg_destroy_decompress(&dinfo);\n\treturn lines_read == out->height ? UVC_SUCCESS : UVC_ERROR_OTHER;\t// XXX\n\nfail:\n\tjpeg_destroy_decompress(&dinfo);\n\treturn UVC_ERROR_OTHER+1;\n}\n\nstatic inline unsigned char sat(int i) {\n\treturn (unsigned char) (i >= 255 ? 255 : (i < 0 ? 0 : i));\n}\n\n#define YCbCr_YUYV_2(YCbCr, yuyv) \\\n\t{ \\\n\t\t*(yuyv++) = *(YCbCr+0); \\\n\t\t*(yuyv++) = (*(YCbCr+1) + *(YCbCr+4)) >> 1; \\\n\t\t*(yuyv++) = *(YCbCr+3); \\\n\t\t*(yuyv++) = (*(YCbCr+2) + *(YCbCr+5)) >> 1; \\\n\t}\n\nuvc_error_t uvc_mjpeg2yuyv(uvc_frame_t *in, uvc_frame_t *out) {\n\n\tout->actual_bytes = 0;\t// XXX\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_MJPEG))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (uvc_ensure_frame_size(out, in->width * in->height * 2) < 0)\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tsize_t lines_read = 0;\n\tint i, j;\n\tint num_scanlines;\n\tregister uint8_t *yuyv, *ycbcr;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = UVC_FRAME_FORMAT_YUYV;\n\tout->step = in->width * 2;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\n\tstruct jpeg_decompress_struct dinfo;\n\tstruct error_mgr jerr;\n\tdinfo.err = jpeg_std_error(&jerr.super);\n\tjerr.super.error_exit = _error_exit;\n\n\tif (setjmp(jerr.jmp)) {\n\t\tgoto fail;\n\t}\n\n\tjpeg_create_decompress(&dinfo);\n\tjpeg_mem_src(&dinfo, in->data, in->actual_bytes/*in->data_bytes*/);\t// XXX\n\tjpeg_read_header(&dinfo, TRUE);\n\n\tif (dinfo.dc_huff_tbl_ptrs[0] == NULL) {\n\t\t/* This frame is missing the Huffman tables: fill in the standard ones */\n\t\tinsert_huff_tables(&dinfo);\n\t}\n\n\tdinfo.out_color_space = JCS_YCbCr;\n\tdinfo.dct_method = JDCT_IFAST;\n\n\t// start decompressor\n\tjpeg_start_decompress(&dinfo);\n\n\t// these dinfo.xxx valiables are only valid after jpeg_start_decompress\n\tconst int row_stride = dinfo.output_width * dinfo.output_components;\n\n\t// allocate buffer\n\tregister JSAMPARRAY buffer = (*dinfo.mem->alloc_sarray)\n\t\t((j_common_ptr) &dinfo, JPOOL_IMAGE, row_stride, MAX_READLINE);\n\n\t// local copy\n\tuint8_t *data = out->data;\n\tconst int out_step = out->step;\n\n\tif (LIKELY(dinfo.output_height == out->height)) {\n\t\tfor (; dinfo.output_scanline < dinfo.output_height ;) {\n\t\t\t// convert lines of mjpeg data to YCbCr\n\t\t\tnum_scanlines = jpeg_read_scanlines(&dinfo, buffer, MAX_READLINE);\n\t\t\t// convert YCbCr to yuyv(YUV422)\n\t\t\tfor (j = 0; j < num_scanlines; j++) {\n\t\t\t\tyuyv = data + (lines_read + j) * out_step;\n\t\t\t\tycbcr = buffer[j];\n\t\t\t\tfor (i = 0; i < row_stride; i += 24) {\t// step by YCbCr x 8 pixels = 3 x 8 bytes\n\t\t\t\t\tYCbCr_YUYV_2(ycbcr + i, yuyv);\n\t\t\t\t\tYCbCr_YUYV_2(ycbcr + i + 6, yuyv);\n\t\t\t\t\tYCbCr_YUYV_2(ycbcr + i + 12, yuyv);\n\t\t\t\t\tYCbCr_YUYV_2(ycbcr + i + 18, yuyv);\n\t\t\t\t}\n\t\t\t}\n\t\t\tlines_read += num_scanlines;\n\t\t}\n\t\tout->actual_bytes = in->width * in->height * 2;\t// XXX\n\t}\n\n\tjpeg_finish_decompress(&dinfo);\n\tjpeg_destroy_decompress(&dinfo);\n\treturn lines_read == out->height ? UVC_SUCCESS : UVC_ERROR_OTHER;\n\nfail:\n\tjpeg_destroy_decompress(&dinfo);\n\treturn lines_read == out->height ? UVC_SUCCESS : UVC_ERROR_OTHER+1;\n}\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/frame-mjpeg_original.c",
    "content": "/*********************************************************************\n* Software License Agreement (BSD License)\n*\n*  Copyright (C) 2014 Robert Xiao\n*  All rights reserved.\n*\n*  Redistribution and use in source and binary forms, with or without\n*  modification, are permitted provided that the following conditions\n*  are met:\n*\n*   * Redistributions of source code must retain the above copyright\n*     notice, this list of conditions and the following disclaimer.\n*   * Redistributions in binary form must reproduce the above\n*     copyright notice, this list of conditions and the following\n*     disclaimer in the documentation and/or other materials provided\n*     with the distribution.\n*   * Neither the name of the author nor other contributors may be\n*     used to endorse or promote products derived from this software\n*     without specific prior written permission.\n*\n*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n*  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n*  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n*  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n*  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n*  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n*  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n*  POSSIBILITY OF SUCH DAMAGE.\n*********************************************************************/\n\n/**\n * @defgroup frame Frame processing\n */\n#include \"libuvc/libuvc.h\"\n#include \"libuvc/libuvc_internal.h\"\n#include <jpeglib.h>\n#include <setjmp.h>\n\nextern uvc_error_t uvc_ensure_frame_size(uvc_frame_t *frame, size_t need_bytes);\n\nstruct error_mgr {\n  struct jpeg_error_mgr super;\n  jmp_buf jmp;\n};\n\nstatic void _error_exit(j_common_ptr dinfo) {\n  struct error_mgr *myerr = (struct error_mgr *)dinfo->err;\n  (*dinfo->err->output_message)(dinfo);\n  longjmp(myerr->jmp, 1);\n}\n\n/* ISO/IEC 10918-1:1993(E) K.3.3. Default Huffman tables used by MJPEG UVC devices\n   which don't specify a Huffman table in the JPEG stream. */\nstatic const unsigned char dc_lumi_len[] = \n  {0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0};\nstatic const unsigned char dc_lumi_val[] = \n  {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};\n\nstatic const unsigned char dc_chromi_len[] = \n  {0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0};\nstatic const unsigned char dc_chromi_val[] = \n  {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};\n\nstatic const unsigned char ac_lumi_len[] = \n  {0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d};\nstatic const unsigned char ac_lumi_val[] = \n  {0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21,\n   0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71,\n   0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, 0x23, 0x42, 0xb1,\n   0xc1, 0x15, 0x52, 0xd1, 0xf0, 0x24, 0x33, 0x62, 0x72,\n   0x82, 0x09, 0x0a, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x25,\n   0x26, 0x27, 0x28, 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37,\n   0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,\n   0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,\n   0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a,\n   0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x83,\n   0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93,\n   0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3,\n   0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3,\n   0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,\n   0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3,\n   0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,\n   0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1,\n   0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa};\nstatic const unsigned char ac_chromi_len[] = \n  {0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77};\nstatic const unsigned char ac_chromi_val[] = \n  {0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31,\n   0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22,\n   0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xa1, 0xb1, 0xc1,\n   0x09, 0x23, 0x33, 0x52, 0xf0, 0x15, 0x62, 0x72, 0xd1,\n   0x0a, 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17, 0x18,\n   0x19, 0x1a, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36,\n   0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47,\n   0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,\n   0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,\n   0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a,\n   0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a,\n   0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a,\n   0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa,\n   0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba,\n   0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca,\n   0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,\n   0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,\n   0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa};\n\n#define COPY_HUFF_TABLE(dinfo,tbl,name) do { \\\n  if(dinfo->tbl == NULL) dinfo->tbl = jpeg_alloc_huff_table((j_common_ptr)dinfo); \\\n  memcpy(dinfo->tbl->bits, name##_len, sizeof(name##_len)); \\\n  memset(dinfo->tbl->huffval, 0, sizeof(dinfo->tbl->huffval)); \\\n  memcpy(dinfo->tbl->huffval, name##_val, sizeof(name##_val)); \\\n} while(0)\n\nstatic void insert_huff_tables(j_decompress_ptr dinfo) {\n  COPY_HUFF_TABLE(dinfo, dc_huff_tbl_ptrs[0], dc_lumi);\n  COPY_HUFF_TABLE(dinfo, dc_huff_tbl_ptrs[1], dc_chromi);\n  COPY_HUFF_TABLE(dinfo, ac_huff_tbl_ptrs[0], ac_lumi);\n  COPY_HUFF_TABLE(dinfo, ac_huff_tbl_ptrs[1], ac_chromi);\n}\n\n/** @brief Convert an MJPEG frame to RGB\n * @ingroup frame\n *\n * @param in MJPEG frame\n * @param out RGB frame\n */\nuvc_error_t uvc_mjpeg2rgb(uvc_frame_t *in, uvc_frame_t *out) {\n  struct jpeg_decompress_struct dinfo;\n  struct error_mgr jerr;\n  size_t lines_read;\n\n  if (in->frame_format != UVC_FRAME_FORMAT_MJPEG)\n    return UVC_ERROR_INVALID_PARAM;\n\n  if (uvc_ensure_frame_size(out, in->width * in->height * 3) < 0)\n    return UVC_ERROR_NO_MEM;\n\n  out->width = in->width;\n  out->height = in->height;\n  out->frame_format = UVC_FRAME_FORMAT_RGB;\n  out->step = in->width * 3;\n  out->sequence = in->sequence;\n  out->capture_time = in->capture_time;\n  out->source = in->source;\n\n  dinfo.err = jpeg_std_error(&jerr.super);\n  jerr.super.error_exit = _error_exit;\n\n  if (setjmp(jerr.jmp)) {\n    goto fail;\n  }\n\n  jpeg_create_decompress(&dinfo);\n  jpeg_mem_src(&dinfo, in->data, in->data_bytes);\n  jpeg_read_header(&dinfo, TRUE);\n\n  if (dinfo.dc_huff_tbl_ptrs[0] == NULL) {\n    /* This frame is missing the Huffman tables: fill in the standard ones */\n    insert_huff_tables(&dinfo);\n  }\n\n  dinfo.out_color_space = JCS_RGB;\n  dinfo.dct_method = JDCT_IFAST;\n\n  jpeg_start_decompress(&dinfo);\n\n  lines_read = 0;\n  while (dinfo.output_scanline < dinfo.output_height) {\n    unsigned char *buffer[1] = { out->data + lines_read * out->step };\n    int num_scanlines;\n\n    num_scanlines = jpeg_read_scanlines(&dinfo, buffer, 1);\n    lines_read += num_scanlines;\n  }\n\n  jpeg_finish_decompress(&dinfo);\n  jpeg_destroy_decompress(&dinfo);\n  return 0;\n\nfail:\n  jpeg_destroy_decompress(&dinfo);\n  return UVC_ERROR_OTHER;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/frame.c",
    "content": "/*********************************************************************\n *********************************************************************/\n/*********************************************************************\n * added and modified some function for support and help for Android\n * Copyright (C) 2014 saki@serenegiant All rights reserved.\n * add:\n * \tadded some helper functions for supporting rgb565 and rgbx8888\n * modified:\n * \tmodified for optimization with gcc\n * \tmodified macros that convert pixel format to reduce cpu cycles\n * \tadded boundary check of pointer in the converting function to avoid crash\n *********************************************************************/\n\n/*********************************************************************\n * Software License Agreement (BSD License)\n *\n *  Copyright (C) 2010-2012 Ken Tossell\n *  All rights reserved.\n *\n *  Redistribution and use in source and binary forms, with or without\n *  modification, are permitted provided that the following conditions\n *  are met:\n *\n *   * Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n *   * Redistributions in binary form must reproduce the above\n *     copyright notice, this list of conditions and the following\n *     disclaimer in the documentation and/or other materials provided\n *     with the distribution.\n *   * Neither the name of the author nor other contributors may be\n *     used to endorse or promote products derived from this software\n *     without specific prior written permission.\n *\n *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n *  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n *  POSSIBILITY OF SUCH DAMAGE.\n *********************************************************************/\n/**\n * @defgroup frame Frame processing\n * @brief Tools for managing frame buffers and converting between image formats\n */\n#include \"libuvc/libuvc.h\"\n#include \"libuvc/libuvc_internal.h\"\n\n#define USE_STRIDE 1\n/** @internal */\nuvc_error_t uvc_ensure_frame_size(uvc_frame_t *frame, size_t need_bytes) {\n\tif LIKELY(frame->library_owns_data) {\n\t\tif UNLIKELY(!frame->data || frame->data_bytes != need_bytes) {\n\t\t\tframe->actual_bytes = frame->data_bytes = need_bytes;\t// XXX\n\t\t\tframe->data = realloc(frame->data, frame->data_bytes);\n\t\t}\n\t\tif (UNLIKELY(!frame->data || !need_bytes))\n\t\t\treturn UVC_ERROR_NO_MEM;\n\t\treturn UVC_SUCCESS;\n\t} else {\n\t\tif (UNLIKELY(!frame->data || frame->data_bytes < need_bytes))\n\t\t\treturn UVC_ERROR_NO_MEM;\n\t\treturn UVC_SUCCESS;\n\t}\n}\n\n/** @brief Allocate a frame structure\n * @ingroup frame\n *\n * @param data_bytes Number of bytes to allocate, or zero\n * @return New frame, or NULL on error\n */\nuvc_frame_t *uvc_allocate_frame(size_t data_bytes) {\n\tuvc_frame_t *frame = malloc(sizeof(*frame));\t// FIXME using buffer pool is better performance(5-30%) than directory use malloc everytime.\n\n\tif (UNLIKELY(!frame))\n\t\treturn NULL;\n\n#ifndef __ANDROID__\n\t// XXX in many case, it is not neccesary to clear because all fields are set before use\n\t// therefore we remove this to improve performace, but be care not to forget to set fields before use\n\tmemset(frame, 0, sizeof(*frame));\t// bzero(frame, sizeof(*frame)); // bzero is deprecated\n#endif\n//\tframe->library_owns_data = 1;\t// XXX moved to lower\n\n\tif (LIKELY(data_bytes > 0)) {\n\t\tframe->library_owns_data = 1;\n\t\tframe->actual_bytes = frame->data_bytes = data_bytes;\t// XXX\n\t\tframe->data = malloc(data_bytes);\n\n\t\tif (UNLIKELY(!frame->data)) {\n\t\t\tfree(frame);\n\t\t\treturn NULL ;\n\t\t}\n\t}\n\n\treturn frame;\n}\n\n/** @brief Free a frame structure\n * @ingroup frame\n *\n * @param frame Frame to destroy\n */\nvoid uvc_free_frame(uvc_frame_t *frame) {\n\tif ((frame->data_bytes > 0) && frame->library_owns_data)\n\t\tfree(frame->data);\n\n\tfree(frame);\n}\n\nstatic inline unsigned char sat(int i) {\n\treturn (unsigned char) (i >= 255 ? 255 : (i < 0 ? 0 : i));\n}\n\n/** @brief Duplicate a frame, preserving color format\n * @ingroup frame\n *\n * @param in Original frame\n * @param out Duplicate frame\n */\nuvc_error_t uvc_duplicate_frame(uvc_frame_t *in, uvc_frame_t *out) {\n\tif (UNLIKELY(uvc_ensure_frame_size(out, in->data_bytes) < 0))\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = in->frame_format;\n\tif (out->library_owns_data)\n\t\tout->step = in->step;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\tout->actual_bytes = in->actual_bytes;\t// XXX\n\n#if USE_STRIDE\t // XXX\n\tif (in->step && out->step) {\n\t\tconst int istep = in->step;\n\t\tconst int ostep = out->step;\n\t\tconst int hh = in->height < out->height ? in->height : out->height;\n\t\tconst int rowbytes = istep < ostep ? istep : ostep;\n\t\tregister void *ip = in->data;\n\t\tregister void *op = out->data;\n\t\tint h;\n\t\tfor (h = 0; h < hh; h += 4) {\n\t\t\tmemcpy(op, ip, rowbytes);\n\t\t\tip += istep; op += ostep;\n\t\t\tmemcpy(op, ip, rowbytes);\n\t\t\tip += istep; op += ostep;\n\t\t\tmemcpy(op, ip, rowbytes);\n\t\t\tip += istep; op += ostep;\n\t\t\tmemcpy(op, ip, rowbytes);\n\t\t\tip += istep; op += ostep;\n\t\t}\n\t} else {\n\t\t// compressed format? XXX if only one of the frame in / out has step, this may lead to crash...\n\t\tmemcpy(out->data, in->data, in->actual_bytes);\n\t}\n#else\n\tmemcpy(out->data, in->data, in->actual_bytes); // XXX\n#endif\n\treturn UVC_SUCCESS;\n}\n\n#define PIXEL_RGB565\t\t2\n#define PIXEL_UYVY\t\t\t2\n#define PIXEL_YUYV\t\t\t2\n#define PIXEL_RGB\t\t\t3\n#define PIXEL_BGR\t\t\t3\n#define PIXEL_RGBX\t\t\t4\n\n#define PIXEL2_RGB565\t\tPIXEL_RGB565 * 2\n#define PIXEL2_UYVY\t\t\tPIXEL_UYVY * 2\n#define PIXEL2_YUYV\t\t\tPIXEL_YUYV * 2\n#define PIXEL2_RGB\t\t\tPIXEL_RGB * 2\n#define PIXEL2_BGR\t\t\tPIXEL_BGR * 2\n#define PIXEL2_RGBX\t\t\tPIXEL_RGBX * 2\n\n#define PIXEL4_RGB565\t\tPIXEL_RGB565 * 4\n#define PIXEL4_UYVY\t\t\tPIXEL_UYVY * 4\n#define PIXEL4_YUYV\t\t\tPIXEL_YUYV * 4\n#define PIXEL4_RGB\t\t\tPIXEL_RGB * 4\n#define PIXEL4_BGR\t\t\tPIXEL_BGR * 4\n#define PIXEL4_RGBX\t\t\tPIXEL_RGBX * 4\n\n#define PIXEL8_RGB565\t\tPIXEL_RGB565 * 8\n#define PIXEL8_UYVY\t\t\tPIXEL_UYVY * 8\n#define PIXEL8_YUYV\t\t\tPIXEL_YUYV * 8\n#define PIXEL8_RGB\t\t\tPIXEL_RGB * 8\n#define PIXEL8_BGR\t\t\tPIXEL_BGR * 8\n#define PIXEL8_RGBX\t\t\tPIXEL_RGBX * 8\n\n#define PIXEL16_RGB565\t\tPIXEL_RGB565 * 16\n#define PIXEL16_UYVY\t\tPIXEL_UYVY * 16\n#define PIXEL16_YUYV\t\tPIXEL_YUYV * 16\n#define PIXEL16_RGB\t\t\tPIXEL_RGB * 16\n#define PIXEL16_BGR\t\t\tPIXEL_BGR * 16\n#define PIXEL16_RGBX\t\tPIXEL_RGBX * 16\n\n#define RGB2RGBX_2(prgb, prgbx, ax, bx) { \\\n\t\t(prgbx)[bx+0] = (prgb)[ax+0]; \\\n\t\t(prgbx)[bx+1] = (prgb)[ax+1]; \\\n\t\t(prgbx)[bx+2] = (prgb)[ax+2]; \\\n\t\t(prgbx)[bx+3] = 0xff; \\\n\t\t(prgbx)[bx+4] = (prgb)[ax+3]; \\\n\t\t(prgbx)[bx+5] = (prgb)[ax+4]; \\\n\t\t(prgbx)[bx+6] = (prgb)[ax+5]; \\\n\t\t(prgbx)[bx+7] = 0xff; \\\n\t}\n#define RGB2RGBX_16(prgb, prgbx, ax, bx) \\\n\tRGB2RGBX_8(prgb, prgbx, ax, bx) \\\n\tRGB2RGBX_8(prgb, prgbx, ax + PIXEL8_RGB, bx +PIXEL8_RGBX);\n#define RGB2RGBX_8(prgb, prgbx, ax, bx) \\\n\tRGB2RGBX_4(prgb, prgbx, ax, bx) \\\n\tRGB2RGBX_4(prgb, prgbx, ax + PIXEL4_RGB, bx + PIXEL4_RGBX);\n#define RGB2RGBX_4(prgb, prgbx, ax, bx) \\\n\tRGB2RGBX_2(prgb, prgbx, ax, bx) \\\n\tRGB2RGBX_2(prgb, prgbx, ax + PIXEL2_RGB, bx + PIXEL2_RGBX);\n\n/** @brief Convert a frame from RGB888 to RGBX8888\n * @ingroup frame\n * @param ini RGB888 frame\n * @param out RGBX8888 frame\n */\nuvc_error_t uvc_rgb2rgbx(uvc_frame_t *in, uvc_frame_t *out) {\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_RGB))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (UNLIKELY(uvc_ensure_frame_size(out, in->width * in->height * PIXEL_RGBX) < 0))\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = UVC_FRAME_FORMAT_RGBX;\n\tif (out->library_owns_data)\n\t\tout->step = in->width * PIXEL_RGBX;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\n\tuint8_t *prgb = in->data;\n\tconst uint8_t *prgb_end = prgb + in->data_bytes - PIXEL8_RGB;\n\tuint8_t *prgbx = out->data;\n\tconst uint8_t *prgbx_end = prgbx + out->data_bytes - PIXEL8_RGBX;\n\n\t// RGB888 to RGBX8888\n#if USE_STRIDE\n\tif (in->step && out->step && (in->step != out->step)) {\n\t\tconst int hh = in->height < out->height ? in->height : out->height;\n\t\tconst int ww = in->width < out->width ? in->width : out->width;\n\t\tint h, w;\n\t\tfor (h = 0; h < hh; h++) {\n\t\t\tw = 0;\n\t\t\tprgb = in->data + in->step * h;\n\t\t\tprgbx = out->data + out->step * h;\n\t\t\tfor (; (prgbx <= prgbx_end) && (prgb <= prgb_end) && (w < ww) ;) {\n\t\t\t\tRGB2RGBX_8(prgb, prgbx, 0, 0);\n\n\t\t\t\tprgb += PIXEL8_RGB;\n\t\t\t\tprgbx += PIXEL8_RGBX;\n\t\t\t\tw += 8;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// compressed format? XXX if only one of the frame in / out has step, this may lead to crash...\n\t\tfor (; (prgbx <= prgbx_end) && (prgb <= prgb_end) ;) {\n\t\t\tRGB2RGBX_8(prgb, prgbx, 0, 0);\n\n\t\t\tprgb += PIXEL8_RGB;\n\t\t\tprgbx += PIXEL8_RGBX;\n\t\t}\n\t}\n#else\n\tfor (; (prgbx <= prgbx_end) && (prgb <= prgb_end) ;) {\n\t\tRGB2RGBX_8(prgb, prgbx, 0, 0);\n\n\t\tprgb += PIXEL8_RGB;\n\t\tprgbx += PIXEL8_RGBX;\n\t}\n#endif\n\treturn UVC_SUCCESS;\n}\n\n// prgb565[0] = ((g << 3) & 0b11100000) | ((b >> 3) & 0b00011111);\t// low byte\n// prgb565[1] = ((r & 0b11111000) | ((g >> 5) & 0b00000111)); \t\t// high byte\n#define RGB2RGB565_2(prgb, prgb565, ax, bx) { \\\n\t\t(prgb565)[bx+0] = (((prgb)[ax+1] << 3) & 0b11100000) | (((prgb)[ax+2] >> 3) & 0b00011111); \\\n\t\t(prgb565)[bx+1] = (((prgb)[ax+0] & 0b11111000) | (((prgb)[ax+1] >> 5) & 0b00000111)); \\\n\t\t(prgb565)[bx+2] = (((prgb)[ax+4] << 3) & 0b11100000) | (((prgb)[ax+5] >> 3) & 0b00011111); \\\n\t\t(prgb565)[bx+3] = (((prgb)[ax+3] & 0b11111000) | (((prgb)[ax+4] >> 5) & 0b00000111)); \\\n    }\n#define RGB2RGB565_16(prgb, prgb565, ax, bx) \\\n\tRGB2RGB565_8(prgb, prgb565, ax, bx) \\\n\tRGB2RGB565_8(prgb, prgb565, ax + PIXEL8_RGB, bx + PIXEL8_RGB565);\n#define RGB2RGB565_8(prgb, prgb565, ax, bx) \\\n\tRGB2RGB565_4(prgb, prgb565, ax, bx) \\\n\tRGB2RGB565_4(prgb, prgb565, ax + PIXEL4_RGB, bx + PIXEL4_RGB565);\n#define RGB2RGB565_4(prgb, prgb565, ax, bx) \\\n\tRGB2RGB565_2(prgb, prgb565, ax, bx) \\\n\tRGB2RGB565_2(prgb, prgb565, ax + PIXEL2_RGB, bx + PIXEL2_RGB565);\n\n/** @brief Convert a frame from RGB888 to RGB565\n * @ingroup frame\n * @param ini RGB888 frame\n * @param out RGB565 frame\n */\nuvc_error_t uvc_rgb2rgb565(uvc_frame_t *in, uvc_frame_t *out) {\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_RGB))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (UNLIKELY(uvc_ensure_frame_size(out, in->width * in->height * PIXEL_RGB565) < 0))\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = UVC_FRAME_FORMAT_RGB565;\n\tif (out->library_owns_data)\n\t\tout->step = in->width * PIXEL_RGB565;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\n\tuint8_t *prgb = in->data;\n\tconst uint8_t *prgb_end = prgb + in->data_bytes - PIXEL8_RGB;\n\tuint8_t *prgb565 = out->data;\n\tconst uint8_t *prgb565_end = prgb565 + out->data_bytes - PIXEL8_RGB565;\n\n\t// RGB888 to RGB565\n#if USE_STRIDE\n\tif (in->step && out->step && (in->step != out->step)) {\n\t\tconst int hh = in->height < out->height ? in->height : out->height;\n\t\tconst int ww = in->width < out->width ? in->width : out->width;\n\t\tint h, w;\n\t\tfor (h = 0; h < hh; h++) {\n\t\t\tw = 0;\n\t\t\tprgb = in->data + in->step * h;\n\t\t\tprgb565 = out->data + out->step * h;\n\t\t\tfor (; (prgb565 <= prgb565_end) && (prgb <= prgb_end) && (w < ww) ;) {\n\t\t\t\tRGB2RGB565_8(prgb, prgb565, 0, 0);\n\n\t\t\t\tprgb += PIXEL8_RGB;\n\t\t\t\tprgb565 += PIXEL8_RGB565;\n\t\t\t\tw += 8;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// compressed format? XXX if only one of the frame in / out has step, this may lead to crash...\n\t\tfor (; (prgb565 <= prgb565_end) && (prgb <= prgb_end) ;) {\n\t\t\tRGB2RGB565_8(prgb, prgb565, 0, 0);\n\n\t\t\tprgb += PIXEL8_RGB;\n\t\t\tprgb565 += PIXEL8_RGB565;\n\t\t}\n\t}\n#else\n\tfor (; (prgb565 <= prgb565_end) && (prgb <= prgb_end) ;) {\n\t\tRGB2RGB565_8(prgb, prgb565, 0, 0);\n\n\t\tprgb += PIXEL8_RGB;\n\t\tprgb565 += PIXEL8_RGB565;\n\t}\n#endif\n\treturn UVC_SUCCESS;\n}\n/*\n #define YUYV2RGB_2(pyuv, prgb) { \\\n    float r = 1.402f * ((pyuv)[3]-128); \\\n    float g = -0.34414f * ((pyuv)[1]-128) - 0.71414f * ((pyuv)[3]-128); \\\n    float b = 1.772f * ((pyuv)[1]-128); \\\n    (prgb)[0] = sat(pyuv[0] + r); \\\n    (prgb)[1] = sat(pyuv[0] + g); \\\n    (prgb)[2] = sat(pyuv[0] + b); \\\n    (prgb)[3] = sat(pyuv[2] + r); \\\n    (prgb)[4] = sat(pyuv[2] + g); \\\n    (prgb)[5] = sat(pyuv[2] + b); \\\n    }\n*/\n\n#define IYUYV2RGB_2(pyuv, prgb, ax, bx) { \\\n\t\tconst int d1 = (pyuv)[ax+1]; \\\n\t\tconst int d3 = (pyuv)[ax+3]; \\\n\t\tconst int r = (22987 * (d3/*(pyuv)[ax+3]*/ - 128)) >> 14; \\\n\t\tconst int g = (-5636 * (d1/*(pyuv)[ax+1]*/ - 128) - 11698 * (d3/*(pyuv)[ax+3]*/ - 128)) >> 14; \\\n\t\tconst int b = (29049 * (d1/*(pyuv)[ax+1]*/ - 128)) >> 14; \\\n\t\tconst int y0 = (pyuv)[ax+0]; \\\n\t\t(prgb)[bx+0] = sat(y0 + r); \\\n\t\t(prgb)[bx+1] = sat(y0 + g); \\\n\t\t(prgb)[bx+2] = sat(y0 + b); \\\n\t\tconst int y2 = (pyuv)[ax+2]; \\\n\t\t(prgb)[bx+3] = sat(y2 + r); \\\n\t\t(prgb)[bx+4] = sat(y2 + g); \\\n\t\t(prgb)[bx+5] = sat(y2 + b); \\\n    }\n#define IYUYV2RGB_16(pyuv, prgb, ax, bx) \\\n\tIYUYV2RGB_8(pyuv, prgb, ax, bx) \\\n\tIYUYV2RGB_8(pyuv, prgb, ax + PIXEL8_YUYV, bx + PIXEL8_RGB)\n#define IYUYV2RGB_8(pyuv, prgb, ax, bx) \\\n\tIYUYV2RGB_4(pyuv, prgb, ax, bx) \\\n\tIYUYV2RGB_4(pyuv, prgb, ax + PIXEL4_YUYV, bx + PIXEL4_RGB)\n#define IYUYV2RGB_4(pyuv, prgb, ax, bx) \\\n\tIYUYV2RGB_2(pyuv, prgb, ax, bx) \\\n\tIYUYV2RGB_2(pyuv, prgb, ax + PIXEL2_YUYV, bx + PIXEL2_RGB)\n\n/** @brief Convert a frame from YUYV to RGB888\n * @ingroup frame\n *\n * @param in YUYV frame\n * @param out RGB888 frame\n */\nuvc_error_t uvc_yuyv2rgb(uvc_frame_t *in, uvc_frame_t *out) {\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_YUYV))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (UNLIKELY(uvc_ensure_frame_size(out, in->width * in->height * PIXEL_RGB) < 0))\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = UVC_FRAME_FORMAT_RGB;\n\tif (out->library_owns_data)\n\t\tout->step = in->width * PIXEL_RGB;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\n\tuint8_t *pyuv = in->data;\n\tconst uint8_t *pyuv_end = pyuv + in->data_bytes - PIXEL8_YUYV;\n\tuint8_t *prgb = out->data;\n\tconst uint8_t *prgb_end = prgb + out->data_bytes - PIXEL8_RGB;\n\n#if USE_STRIDE\n\tif (in->step && out->step && (in->step != out->step)) {\n\t\tconst int hh = in->height < out->height ? in->height : out->height;\n\t\tconst int ww = in->width < out->width ? in->width : out->width;\n\t\tint h, w;\n\t\tfor (h = 0; h < hh; h++) {\n\t\t\tw = 0;\n\t\t\tpyuv = in->data + in->step * h;\n\t\t\tprgb = out->data + out->step * h;\n\t\t\tfor (; (prgb <= prgb_end) && (pyuv <= pyuv_end) && (w < ww) ;) {\n\t\t\t\tIYUYV2RGB_8(pyuv, prgb, 0, 0);\n\n\t\t\t\tprgb += PIXEL8_RGB;\n\t\t\t\tpyuv += PIXEL8_YUYV;\n\t\t\t\tw += 8;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// compressed format? XXX if only one of the frame in / out has step, this may lead to crash...\n\t\tfor (; (prgb <= prgb_end) && (pyuv <= pyuv_end) ;) {\n\t\t\tIYUYV2RGB_8(pyuv, prgb, 0, 0);\n\n\t\t\tprgb += PIXEL8_RGB;\n\t\t\tpyuv += PIXEL8_YUYV;\n\t\t}\n\t}\n#else\n\t// YUYV => RGB888\n\tfor (; (prgb <= prgb_end) && (pyuv <= pyuv_end) ;) {\n\t\tIYUYV2RGB_8(pyuv, prgb, 0, 0);\n\n\t\tprgb += PIXEL8_RGB;\n\t\tpyuv += PIXEL8_YUYV;\n\t}\n#endif\n\treturn UVC_SUCCESS;\n}\n\n/** @brief Convert a frame from YUYV to RGB565\n * @ingroup frame\n * @param ini YUYV frame\n * @param out RGB565 frame\n */\nuvc_error_t uvc_yuyv2rgb565(uvc_frame_t *in, uvc_frame_t *out) {\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_YUYV))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (UNLIKELY(uvc_ensure_frame_size(out, in->width * in->height * PIXEL_RGB565) < 0))\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = UVC_FRAME_FORMAT_RGB565;\n\tif (out->library_owns_data)\n\t\tout->step = in->width * PIXEL_RGB565;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\n\tuint8_t *pyuv = in->data;\n\tconst uint8_t *pyuv_end = pyuv + in->data_bytes - PIXEL8_YUYV;\n\tuint8_t *prgb565 = out->data;\n\tconst uint8_t *prgb565_end = prgb565 + out->data_bytes - PIXEL8_RGB565;\n\n\tuint8_t tmp[PIXEL8_RGB];\t// for temporary rgb888 data(8pixel)\n\n#if USE_STRIDE\n\tif (in->step && out->step && (in->step != out->step)) {\n\t\tconst int hh = in->height < out->height ? in->height : out->height;\n\t\tconst int ww = in->width < out->width ? in->width : out->width;\n\t\tint h, w;\n\t\tfor (h = 0; h < hh; h++) {\n\t\t\tw = 0;\n\t\t\tpyuv = in->data + in->step * h;\n\t\t\tprgb565 = out->data + out->step * h;\n\t\t\tfor (; (prgb565 <= prgb565_end) && (pyuv <= pyuv_end) && (w < ww) ;) {\n\t\t\t\tIYUYV2RGB_8(pyuv, tmp, 0, 0);\n\t\t\t\tRGB2RGB565_8(tmp, prgb565, 0, 0);\n\n\t\t\t\tprgb565 += PIXEL8_YUYV;\n\t\t\t\tpyuv += PIXEL8_RGB565;\n\t\t\t\tw += 8;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// compressed format? XXX if only one of the frame in / out has step, this may lead to crash...\n\t\tfor (; (prgb565 <= prgb565_end) && (pyuv <= pyuv_end) ;) {\n\t\t\tIYUYV2RGB_8(pyuv, tmp, 0, 0);\n\t\t\tRGB2RGB565_8(tmp, prgb565, 0, 0);\n\n\t\t\tprgb565 += PIXEL8_YUYV;\n\t\t\tpyuv += PIXEL8_RGB565;\n\t\t}\n\t}\n#else\n\t// YUYV => RGB565\n\tfor (; (prgb565 <= prgb565_end) && (pyuv <= pyuv_end) ;) {\n\t\tIYUYV2RGB_8(pyuv, tmp, 0, 0);\n\t\tRGB2RGB565_8(tmp, prgb565, 0, 0);\n\n\t\tprgb565 += PIXEL8_YUYV;\n\t\tpyuv += PIXEL8_RGB565;\n\t}\n#endif\n\treturn UVC_SUCCESS;\n}\n\n#define IYUYV2RGBX_2(pyuv, prgbx, ax, bx) { \\\n\t\tconst int d1 = (pyuv)[ax+1]; \\\n\t\tconst int d3 = (pyuv)[ax+3]; \\\n\t\tconst int r = (22987 * (d3/*(pyuv)[ax+3]*/ - 128)) >> 14; \\\n\t\tconst int g = (-5636 * (d1/*(pyuv)[ax+1]*/ - 128) - 11698 * (d3/*(pyuv)[ax+3]*/ - 128)) >> 14; \\\n\t\tconst int b = (29049 * (d1/*(pyuv)[ax+1]*/ - 128)) >> 14; \\\n\t\tconst int y0 = (pyuv)[ax+0]; \\\n\t\t(prgbx)[bx+0] = sat(y0 + r); \\\n\t\t(prgbx)[bx+1] = sat(y0 + g); \\\n\t\t(prgbx)[bx+2] = sat(y0 + b); \\\n\t\t(prgbx)[bx+3] = 0xff; \\\n\t\tconst int y2 = (pyuv)[ax+2]; \\\n\t\t(prgbx)[bx+4] = sat(y2 + r); \\\n\t\t(prgbx)[bx+5] = sat(y2 + g); \\\n\t\t(prgbx)[bx+6] = sat(y2 + b); \\\n\t\t(prgbx)[bx+7] = 0xff; \\\n    }\n#define IYUYV2RGBX_16(pyuv, prgbx, ax, bx) \\\n\tIYUYV2RGBX_8(pyuv, prgbx, ax, bx) \\\n\tIYUYV2RGBX_8(pyuv, prgbx, ax + PIXEL8_YUYV, bx + PIXEL8_RGBX);\n#define IYUYV2RGBX_8(pyuv, prgbx, ax, bx) \\\n\tIYUYV2RGBX_4(pyuv, prgbx, ax, bx) \\\n\tIYUYV2RGBX_4(pyuv, prgbx, ax + PIXEL4_YUYV, bx + PIXEL4_RGBX);\n#define IYUYV2RGBX_4(pyuv, prgbx, ax, bx) \\\n\tIYUYV2RGBX_2(pyuv, prgbx, ax, bx) \\\n\tIYUYV2RGBX_2(pyuv, prgbx, ax + PIXEL2_YUYV, bx + PIXEL2_RGBX);\n\n/** @brief Convert a frame from YUYV to RGBX8888\n * @ingroup frame\n * @param ini YUYV frame\n * @param out RGBX8888 frame\n */\nuvc_error_t uvc_yuyv2rgbx(uvc_frame_t *in, uvc_frame_t *out) {\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_YUYV))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (UNLIKELY(uvc_ensure_frame_size(out, in->width * in->height * PIXEL_RGBX) < 0))\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = UVC_FRAME_FORMAT_RGBX;\n\tif (out->library_owns_data)\n\t\tout->step = in->width * PIXEL_RGBX;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\n\tuint8_t *pyuv = in->data;\n\tconst uint8_t *pyuv_end = pyuv + in->data_bytes - PIXEL8_YUYV;\n\tuint8_t *prgbx = out->data;\n\tconst uint8_t *prgbx_end = prgbx + out->data_bytes - PIXEL8_RGBX;\n\n\t// YUYV => RGBX8888\n#if USE_STRIDE\n\tif (in->step && out->step && (in->step != out->step)) {\n\t\tconst int hh = in->height < out->height ? in->height : out->height;\n\t\tconst int ww = in->width < out->width ? in->width : out->width;\n\t\tint h, w;\n\t\tfor (h = 0; h < hh; h++) {\n\t\t\tw = 0;\n\t\t\tpyuv = in->data + in->step * h;\n\t\t\tprgbx = out->data + out->step * h;\n\t\t\tfor (; (prgbx <= prgbx_end) && (pyuv <= pyuv_end) && (w < ww) ;) {\n\t\t\t\tIYUYV2RGBX_8(pyuv, prgbx, 0, 0);\n\n\t\t\t\tprgbx += PIXEL8_RGBX;\n\t\t\t\tpyuv += PIXEL8_YUYV;\n\t\t\t\tw += 8;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// compressed format? XXX if only one of the frame in / out has step, this may lead to crash...\n\t\tfor (; (prgbx <= prgbx_end) && (pyuv <= pyuv_end) ;) {\n\t\t\tIYUYV2RGBX_8(pyuv, prgbx, 0, 0);\n\n\t\t\tprgbx += PIXEL8_RGBX;\n\t\t\tpyuv += PIXEL8_YUYV;\n\t\t}\n\t}\n#else\n\tfor (; (prgbx <= prgbx_end) && (pyuv <= pyuv_end) ;) {\n\t\tIYUYV2RGBX_8(pyuv, prgbx, 0, 0);\n\n\t\tprgbx += PIXEL8_RGBX;\n\t\tpyuv += PIXEL8_YUYV;\n\t}\n#endif\n\treturn UVC_SUCCESS;\n}\n\n#define IYUYV2BGR_2(pyuv, pbgr, ax, bx) { \\\n\t\tconst int d1 = (pyuv)[1]; \\\n\t\tconst int d3 = (pyuv)[3]; \\\n\t    const int r = (22987 * (d3/*(pyuv)[3]*/ - 128)) >> 14; \\\n\t    const int g = (-5636 * (d1/*(pyuv)[1]*/ - 128) - 11698 * (d3/*(pyuv)[3]*/ - 128)) >> 14; \\\n\t    const int b = (29049 * (d1/*(pyuv)[1]*/ - 128)) >> 14; \\\n\t\tconst int y0 = (pyuv)[ax+0]; \\\n\t\t(pbgr)[bx+0] = sat(y0 + b); \\\n\t\t(pbgr)[bx+1] = sat(y0 + g); \\\n\t\t(pbgr)[bx+2] = sat(y0 + r); \\\n\t\tconst int y2 = (pyuv)[ax+2]; \\\n\t\t(pbgr)[bx+3] = sat(y2 + b); \\\n\t\t(pbgr)[bx+4] = sat(y2 + g); \\\n\t\t(pbgr)[bx+5] = sat(y2 + r); \\\n    }\n#define IYUYV2BGR_16(pyuv, pbgr, ax, bx) \\\n\tIYUYV2BGR_8(pyuv, pbgr, ax, bx) \\\n\tIYUYV2BGR_8(pyuv, pbgr, ax + PIXEL8_YUYV, bx + PIXEL8_BGR)\n#define IYUYV2BGR_8(pyuv, pbgr, ax, bx) \\\n\tIYUYV2BGR_4(pyuv, pbgr, ax, bx) \\\n\tIYUYV2BGR_4(pyuv, pbgr, ax + PIXEL4_YUYV, bx + PIXEL4_BGR)\n#define IYUYV2BGR_4(pyuv, pbgr, ax, bx) \\\n\tIYUYV2BGR_2(pyuv, pbgr, ax, bx) \\\n\tIYUYV2BGR_2(pyuv, pbgr, ax + PIXEL2_YUYV, bx + PIXEL2_BGR)\n\n/** @brief Convert a frame from YUYV to BGR888\n * @ingroup frame\n *\n * @param in YUYV frame\n * @param out BGR888 frame\n */\nuvc_error_t uvc_yuyv2bgr(uvc_frame_t *in, uvc_frame_t *out) {\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_YUYV))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (UNLIKELY(uvc_ensure_frame_size(out, in->width * in->height * PIXEL_BGR) < 0))\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = UVC_FRAME_FORMAT_BGR;\n\tif (out->library_owns_data)\n\t\tout->step = in->width * PIXEL_BGR;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\n\tuint8_t *pyuv = in->data;\n\tuint8_t *pyuv_end = pyuv + in->data_bytes - PIXEL8_YUYV;\n\tuint8_t *pbgr = out->data;\n\tuint8_t *pbgr_end = pbgr + out->data_bytes - PIXEL8_BGR;\n\n\t// YUYV => BGR888\n#if USE_STRIDE\n\tif (in->step && out->step && (in->step != out->step)) {\n\t\tconst int hh = in->height < out->height ? in->height : out->height;\n\t\tconst int ww = in->width < out->width ? in->width : out->width;\n\t\tint h, w;\n\t\tfor (h = 0; h < hh; h++) {\n\t\t\tw = 0;\n\t\t\tpyuv = in->data + in->step * h;\n\t\t\tpbgr = out->data + out->step * h;\n\t\t\tfor (; (pbgr <= pbgr_end) && (pyuv <= pyuv_end) && (w < ww) ;) {\n\t\t\t\tIYUYV2BGR_8(pyuv, pbgr, 0, 0);\n\n\t\t\t\tpbgr += PIXEL8_BGR;\n\t\t\t\tpyuv += PIXEL8_YUYV;\n\t\t\t\tw += 8;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// compressed format? XXX if only one of the frame in / out has step, this may lead to crash...\n\t\tfor (; (pbgr <= pbgr_end) && (pyuv <= pyuv_end) ;) {\n\t\t\tIYUYV2BGR_8(pyuv, pbgr, 0, 0);\n\n\t\t\tpbgr += PIXEL8_BGR;\n\t\t\tpyuv += PIXEL8_YUYV;\n\t\t}\n\t}\n#else\n\tfor (; (pbgr <= pbgr_end) && (pyuv <= pyuv_end) ;) {\n\t\tIYUYV2BGR_8(pyuv, pbgr, 0, 0);\n\n\t\tpbgr += PIXEL8_BGR;\n\t\tpyuv += PIXEL8_YUYV;\n\t}\n#endif\n\treturn UVC_SUCCESS;\n}\n\n#define IUYVY2RGB_2(pyuv, prgb, ax, bx) { \\\n\t\tconst int d0 = (pyuv)[ax+0]; \\\n\t\tconst int d2 = (pyuv)[ax+2]; \\\n\t    const int r = (22987 * (d2/*(pyuv)[ax+2]*/ - 128)) >> 14; \\\n\t    const int g = (-5636 * (d0/*(pyuv)[ax+0]*/ - 128) - 11698 * (d2/*(pyuv)[ax+2]*/ - 128)) >> 14; \\\n\t    const int b = (29049 * (d0/*(pyuv)[ax+0]*/ - 128)) >> 14; \\\n\t\tconst int y1 = (pyuv)[ax+1]; \\\n\t\t(prgb)[bx+0] = sat(y1 + r); \\\n\t\t(prgb)[bx+1] = sat(y1 + g); \\\n\t\t(prgb)[bx+2] = sat(y1 + b); \\\n\t\tconst int y3 = (pyuv)[ax+3]; \\\n\t\t(prgb)[bx+3] = sat(y3 + r); \\\n\t\t(prgb)[bx+4] = sat(y3 + g); \\\n\t\t(prgb)[bx+5] = sat(y3 + b); \\\n    }\n#define IUYVY2RGB_16(pyuv, prgb, ax, bx) \\\n\tIUYVY2RGB_8(pyuv, prgb, ax, bx) \\\n\tIUYVY2RGB_8(pyuv, prgb, ax + 16, bx + 24)\n#define IUYVY2RGB_8(pyuv, prgb, ax, bx) \\\n\tIUYVY2RGB_4(pyuv, prgb, ax, bx) \\\n\tIUYVY2RGB_4(pyuv, prgb, ax + 8, bx + 12)\n#define IUYVY2RGB_4(pyuv, prgb, ax, bx) \\\n\tIUYVY2RGB_2(pyuv, prgb, ax, bx) \\\n\tIUYVY2RGB_2(pyuv, prgb, ax + 4, bx + 6)\n\n/** @brief Convert a frame from UYVY to RGB888\n * @ingroup frame\n * @param ini UYVY frame\n * @param out RGB888 frame\n */\nuvc_error_t uvc_uyvy2rgb(uvc_frame_t *in, uvc_frame_t *out) {\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_UYVY))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (UNLIKELY(uvc_ensure_frame_size(out, in->width * in->height * PIXEL_RGB) < 0))\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = UVC_FRAME_FORMAT_RGB;\n\tif (out->library_owns_data)\n\t\tout->step = in->width * PIXEL_RGB;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\n\tuint8_t *pyuv = in->data;\n\tconst uint8_t *pyuv_end = pyuv + in->data_bytes - PIXEL8_UYVY;\n\tuint8_t *prgb = out->data;\n\tconst uint8_t *prgb_end = prgb + out->data_bytes - PIXEL8_RGB;\n\n\t// UYVY => RGB888\n#if USE_STRIDE\n\tif (in->step && out->step && (in->step != out->step)) {\n\t\tconst int hh = in->height < out->height ? in->height : out->height;\n\t\tconst int ww = in->width < out->width ? in->width : out->width;\n\t\tint h, w;\n\t\tfor (h = 0; h < hh; h++) {\n\t\t\tw = 0;\n\t\t\tpyuv = in->data + in->step * h;\n\t\t\tprgb = out->data + out->step * h;\n\t\t\tfor (; (prgb <= prgb_end) && (pyuv <= pyuv_end) && (w < ww) ;) {\n\t\t\t\tIUYVY2RGB_8(pyuv, prgb, 0, 0);\n\n\t\t\t\tprgb += PIXEL8_RGB;\n\t\t\t\tpyuv += PIXEL8_UYVY;\n\t\t\t\tw += 8;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// compressed format? XXX if only one of the frame in / out has step, this may lead to crash...\n\t\tfor (; (prgb <= prgb_end) && (pyuv <= pyuv_end) ;) {\n\t\t\tIUYVY2RGB_8(pyuv, prgb, 0, 0);\n\n\t\t\tprgb += PIXEL8_RGB;\n\t\t\tpyuv += PIXEL8_UYVY;\n\t\t}\n\t}\n#else\n\tfor (; ((prgb <= prgb_end) && (pyuv <= pyuv_end) ;) {\n\t\tIUYVY2RGB_8(pyuv, prgb, 0, 0);\n\n\t\tprgb += PIXEL8_RGB;\n\t\tpyuv += PIXEL8_UYVY;\n\t}\n#endif\n\treturn UVC_SUCCESS;\n}\n\n/** @brief Convert a frame from UYVY to RGB565\n * @ingroup frame\n * @param ini UYVY frame\n * @param out RGB565 frame\n */\nuvc_error_t uvc_uyvy2rgb565(uvc_frame_t *in, uvc_frame_t *out) {\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_UYVY))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (UNLIKELY(uvc_ensure_frame_size(out, in->width * in->height * PIXEL_RGB565) < 0))\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = UVC_FRAME_FORMAT_RGB565;\n\tif (out->library_owns_data)\n\t\tout->step = in->width * PIXEL_RGB565;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\n\tuint8_t *pyuv = in->data;\n\tconst uint8_t *pyuv_end = pyuv + in->data_bytes - PIXEL8_UYVY;\n\tuint8_t *prgb565 = out->data;\n\tconst uint8_t *prgb565_end = prgb565 + out->data_bytes - PIXEL8_RGB565;\n\n\tuint8_t tmp[PIXEL8_RGB];\t\t// for temporary rgb888 data(8pixel)\n\n\t// UYVY => RGB565\n#if USE_STRIDE\n\tif (in->step && out->step && (in->step != out->step)) {\n\t\tconst int hh = in->height < out->height ? in->height : out->height;\n\t\tconst int ww = in->width < out->width ? in->width : out->width;\n\t\tint h, w;\n\t\tfor (h = 0; h < hh; h++) {\n\t\t\tw = 0;\n\t\t\tpyuv = in->data + in->step * h;\n\t\t\tprgb565 = out->data + out->step * h;\n\t\t\tfor (; (prgb565 <= prgb565_end) && (pyuv <= pyuv_end) && (w < ww) ;) {\n\t\t\t\tIUYVY2RGB_8(pyuv, tmp, 0, 0);\n\t\t\t\tRGB2RGB565_8(tmp, prgb565, 0, 0);\n\n\t\t\t\tprgb565 += PIXEL8_RGB565;\n\t\t\t\tpyuv += PIXEL8_UYVY;\n\t\t\t\tw += 8;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// compressed format? XXX if only one of the frame in / out has step, this may lead to crash...\n\t\tfor (; (prgb565 <= prgb565_end) && (pyuv <= pyuv_end) ;) {\n\t\t\tIUYVY2RGB_8(pyuv, tmp, 0, 0);\n\t\t\tRGB2RGB565_8(tmp, prgb565, 0, 0);\n\n\t\t\tprgb565 += PIXEL8_RGB565;\n\t\t\tpyuv += PIXEL8_UYVY;\n\t\t}\n\t}\n#else\n\tfor (; (prgb565 <= prgb565_end) && (pyuv <= pyuv_end) ;) {\n\t\tIUYVY2RGB_8(pyuv, tmp, 0, 0);\n\t\tRGB2RGB565_8(tmp, prgb565, 0, 0);\n\n\t\tprgb565 += PIXEL8_RGB565;\n\t\tpyuv += PIXEL8_UYVY;\n\t}\n#endif\n\treturn UVC_SUCCESS;\n}\n\n#define IUYVY2RGBX_2(pyuv, prgbx, ax, bx) { \\\n\t\tconst int d0 = (pyuv)[ax+0]; \\\n\t\tconst int d2 = (pyuv)[ax+2]; \\\n\t    const int r = (22987 * (d2/*(pyuv)[ax+2]*/ - 128)) >> 14; \\\n\t    const int g = (-5636 * (d0/*(pyuv)[ax+0]*/ - 128) - 11698 * (d2/*(pyuv)[ax+2]*/ - 128)) >> 14; \\\n\t    const int b = (29049 * (d0/*(pyuv)[ax+0]*/ - 128)) >> 14; \\\n\t\tconst int y1 = (pyuv)[ax+1]; \\\n\t\t(prgbx)[bx+0] = sat(y1 + r); \\\n\t\t(prgbx)[bx+1] = sat(y1 + g); \\\n\t\t(prgbx)[bx+2] = sat(y1 + b); \\\n\t\t(prgbx)[bx+3] = 0xff; \\\n\t\tconst int y3 = (pyuv)[ax+3]; \\\n\t\t(prgbx)[bx+4] = sat(y3 + r); \\\n\t\t(prgbx)[bx+5] = sat(y3 + g); \\\n\t\t(prgbx)[bx+6] = sat(y3 + b); \\\n\t\t(prgbx)[bx+7] = 0xff; \\\n    }\n#define IUYVY2RGBX_16(pyuv, prgbx, ax, bx) \\\n\tIUYVY2RGBX_8(pyuv, prgbx, ax, bx) \\\n\tIUYVY2RGBX_8(pyuv, prgbx, ax + PIXEL8_UYVY, bx + PIXEL8_RGBX)\n#define IUYVY2RGBX_8(pyuv, prgbx, ax, bx) \\\n\tIUYVY2RGBX_4(pyuv, prgbx, ax, bx) \\\n\tIUYVY2RGBX_4(pyuv, prgbx, ax + PIXEL4_UYVY, bx + PIXEL4_RGBX)\n#define IUYVY2RGBX_4(pyuv, prgbx, ax, bx) \\\n\tIUYVY2RGBX_2(pyuv, prgbx, ax, bx) \\\n\tIUYVY2RGBX_2(pyuv, prgbx, ax + PIXEL2_UYVY, bx + PIXEL2_RGBX)\n\n/** @brief Convert a frame from UYVY to RGBX8888\n * @ingroup frame\n * @param ini UYVY frame\n * @param out RGBX8888 frame\n */\nuvc_error_t uvc_uyvy2rgbx(uvc_frame_t *in, uvc_frame_t *out) {\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_UYVY))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (UNLIKELY(uvc_ensure_frame_size(out, in->width * in->height * PIXEL_RGBX) < 0))\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = UVC_FRAME_FORMAT_RGBX;\n\tif (out->library_owns_data)\n\t\tout->step = in->width * PIXEL_RGBX;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\n\tuint8_t *pyuv = in->data;\n\tconst uint8_t *pyuv_end = pyuv + in->data_bytes - PIXEL8_UYVY;\n\tuint8_t *prgbx = out->data;\n\tconst uint8_t *prgbx_end = prgbx + out->data_bytes - PIXEL8_RGBX;\n\n\t// UYVY => RGBX8888\n#if USE_STRIDE\n\tif (in->step && out->step && (in->step != out->step)) {\n\t\tconst int hh = in->height < out->height ? in->height : out->height;\n\t\tconst int ww = in->width < out->width ? in->width : out->width;\n\t\tint h, w;\n\t\tfor (h = 0; h < hh; h++) {\n\t\t\tw = 0;\n\t\t\tpyuv = in->data + in->step * h;\n\t\t\tprgbx = out->data + out->step * h;\n\t\t\tfor (; (prgbx <= prgbx_end) && (pyuv <= pyuv_end) && (w < ww) ;) {\n\t\t\t\tIUYVY2RGBX_8(pyuv, prgbx, 0, 0);\n\n\t\t\t\tprgbx += PIXEL8_RGBX;\n\t\t\t\tpyuv += PIXEL8_UYVY;\n\t\t\t\tw += 8;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// compressed format? XXX if only one of the frame in / out has step, this may lead to crash...\n\t\tfor (; (prgbx <= prgbx_end) && (pyuv <= pyuv_end) ;) {\n\t\t\tIUYVY2RGBX_8(pyuv, prgbx, 0, 0);\n\n\t\t\tprgbx += PIXEL8_RGBX;\n\t\t\tpyuv += PIXEL8_UYVY;\n\t\t}\n\t}\n#else\n\tfor (; (prgbx <= prgbx_end) && (pyuv <= pyuv_end) ;) {\n\t\tIUYVY2RGBX_8(pyuv, prgbx, 0, 0);\n\n\t\tprgbx += PIXEL8_RGBX;\n\t\tpyuv += PIXEL8_UYVY;\n\t}\n#endif\n\treturn UVC_SUCCESS;\n}\n\n#define IUYVY2BGR_2(pyuv, pbgr, ax, bx) { \\\n\t\tconst int d0 = (pyuv)[ax+0]; \\\n\t\tconst int d2 = (pyuv)[ax+2]; \\\n\t    const int r = (22987 * (d2/*(pyuv)[ax+2]*/ - 128)) >> 14; \\\n\t    const int g = (-5636 * (d0/*(pyuv)[ax+0]*/ - 128) - 11698 * (d2/*(pyuv)[ax+2]*/ - 128)) >> 14; \\\n\t    const int b = (29049 * (d0/*(pyuv)[ax+0]*/ - 128)) >> 14; \\\n\t\tconst int y1 = (pyuv)[ax+1]; \\\n\t\t(pbgr)[bx+0] = sat(y1 + b); \\\n\t\t(pbgr)[bx+1] = sat(y1 + g); \\\n\t\t(pbgr)[bx+2] = sat(y1 + r); \\\n\t\tconst int y3 = (pyuv)[ax+3]; \\\n\t\t(pbgr)[bx+3] = sat(y3 + b); \\\n\t\t(pbgr)[bx+4] = sat(y3 + g); \\\n\t\t(pbgr)[bx+5] = sat(y3 + r); \\\n    }\n#define IUYVY2BGR_16(pyuv, pbgr, ax, bx) \\\n\tIUYVY2BGR_8(pyuv, pbgr, ax, bx) \\\n\tIUYVY2BGR_8(pyuv, pbgr, ax + PIXEL8_UYVY, bx + PIXEL8_BGR)\n#define IUYVY2BGR_8(pyuv, pbgr, ax, bx) \\\n\tIUYVY2BGR_4(pyuv, pbgr, ax, bx) \\\n\tIUYVY2BGR_4(pyuv, pbgr, ax + PIXEL4_UYVY, bx + PIXEL4_BGR)\n#define IUYVY2BGR_4(pyuv, pbgr, ax, bx) \\\n\tIUYVY2BGR_2(pyuv, pbgr, ax, bx) \\\n\tIUYVY2BGR_2(pyuv, pbgr, ax + PIXEL2_UYVY, bx + PIXEL2_BGR)\n\n/** @brief Convert a frame from UYVY to BGR888\n * @ingroup frame\n * @param ini UYVY frame\n * @param out BGR888 frame\n */\nuvc_error_t uvc_uyvy2bgr(uvc_frame_t *in, uvc_frame_t *out) {\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_UYVY))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (UNLIKELY(uvc_ensure_frame_size(out, in->width * in->height * PIXEL_BGR) < 0))\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tout->width = in->width;\n\tout->height = in->height;\n\tout->frame_format = UVC_FRAME_FORMAT_BGR;\n\tif (out->library_owns_data)\n\t\tout->step = in->width * PIXEL_BGR;\n\tout->sequence = in->sequence;\n\tout->capture_time = in->capture_time;\n\tout->source = in->source;\n\n\tuint8_t *pyuv = in->data;\n\tconst uint8_t *pyuv_end = pyuv + in->data_bytes - PIXEL8_UYVY;\n\tuint8_t *pbgr = out->data;\n\tconst uint8_t *pbgr_end = pbgr + out->data_bytes - PIXEL8_BGR;\n\n\t// UYVY => BGR888\n#if USE_STRIDE\n\tif (in->step && out->step && (in->step != out->step)) {\n\t\tconst int hh = in->height < out->height ? in->height : out->height;\n\t\tconst int ww = in->width < out->width ? in->width : out->width;\n\t\tint h, w;\n\t\tfor (h = 0; h < hh; h++) {\n\t\t\tw = 0;\n\t\t\tpyuv = in->data + in->step * h;\n\t\t\tpbgr = out->data + out->step * h;\n\t\t\tfor (; (pbgr <= pbgr_end) && (pyuv <= pyuv_end) && (w < ww) ;) {\n\t\t\t\tIUYVY2BGR_8(pyuv, pbgr, 0, 0);\n\n\t\t\t\tpbgr += PIXEL8_BGR;\n\t\t\t\tpyuv += PIXEL8_UYVY;\n\t\t\t\tw += 8;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// compressed format? XXX if only one of the frame in / out has step, this may lead to crash...\n\t\tfor (; (pbgr <= pbgr_end) && (pyuv <= pyuv_end) ;) {\n\t\t\tIUYVY2BGR_8(pyuv, pbgr, 0, 0);\n\n\t\t\tpbgr += PIXEL8_BGR;\n\t\t\tpyuv += PIXEL8_UYVY;\n\t\t}\n\t}\n#else\n\tfor (; (pbgr <= pbgr_end) && (pyuv <= pyuv_end) ;) {\n\t\tIUYVY2BGR_8(pyuv, pbgr, 0, 0);\n\n\t\tpbgr += PIXEL8_BGR;\n\t\tpyuv += PIXEL8_UYVY;\n\t}\n#endif\n\treturn UVC_SUCCESS;\n}\n\nint uvc_yuyv2yuv420P(uvc_frame_t *in, uvc_frame_t *out) {\n\n\tENTER();\n\t\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_YUYV))\n\t\tRETURN(UVC_ERROR_INVALID_PARAM, uvc_error_t);\n\n\tif (UNLIKELY(uvc_ensure_frame_size(out, (in->width * in->height * 3) / 2) < 0))\n\t\tRETURN(UVC_ERROR_NO_MEM, uvc_error_t);\n\n\tconst uint8_t *src = in->data;\n\tuint8_t *dest = out->data;\n\tconst int32_t width = in->width;\n\tconst int32_t height = in->height;\n\tconst int32_t src_width = in->step;\n\tconst int32_t src_height = in->height;\n\tconst int32_t dest_width = out->width = out->step = in->width;\n\tconst int32_t dest_height = out->height = in->height;\n\tconst uint32_t hh = src_height < dest_height ? src_height : dest_height;\n\tuint8_t *y = dest;\n\tuint8_t *v = dest + dest_width * dest_height;\n\tuint8_t *u = dest + dest_width * dest_height * 5 / 4;\n\tint h, w;\n\tfor (h = 0; h < hh; h++) {\n\t\tconst uint8_t *yuv = src + src_width * h;\n\t\tfor (w = 0; w < width; w += 4) {\n\t\t\t*(y++) = yuv[0];\t// y\n\t\t\t*(y++) = yuv[2];\t// y'\n\t\t\t*(y++) = yuv[4];\t// y''\n\t\t\t*(y++) = yuv[6];\t// y'''\n\t\t\tif ((h & 1) == 1) {\n\t\t\t\t*(u++) = yuv[3];\t// u\n\t\t\t\t*(u++) = yuv[7];\t// u\n\t\t\t} else {\n\t\t\t\t*(v++) = yuv[1];\t// v\n\t\t\t\t*(v++) = yuv[5];\t// v\n\t\t\t}\n\t\t\tyuv += 8;\t// (1pixel=2bytes)x4pixel=8bytes\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\n//--------------------------------------------------------------------------------\nint uvc_yuyv2iyuv420P(uvc_frame_t *in, uvc_frame_t *out) {\n\n\tENTER();\n\t\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_YUYV))\n\t\tRETURN(UVC_ERROR_INVALID_PARAM, uvc_error_t);\n\n\tif (UNLIKELY(uvc_ensure_frame_size(out, (in->width * in->height * 3) / 2) < 0))\n\t\tRETURN(UVC_ERROR_NO_MEM, uvc_error_t);\n\n\tconst uint8_t *src = in->data;\n\tuint8_t *dest = out->data;\n\tconst int32_t width = in->width;\n\tconst int32_t height = in->height;\n\tconst int32_t src_width = in->step;\n\tconst int32_t src_height = in->height;\n\tconst int32_t dest_width = out->width = out->step = in->width;\n\tconst int32_t dest_height = out->height = in->height;\n\tconst uint32_t hh = src_height < dest_height ? src_height : dest_height;\n\tuint8_t *y = dest;\n\tuint8_t *u = dest + dest_width * dest_height * 5 / 4;\n\tuint8_t *v = dest + dest_width * dest_height * 5 / 4;\n\tint h, w;\n\tfor (h = 0; h < hh; h++) {\n\t\tconst uint8_t *yuv = src + src_width * h;\n\t\tfor (w = 0; w < width; w += 4) {\n\t\t\t*(y++) = yuv[0];\t// y\n\t\t\t*(y++) = yuv[2];\t// y'\n\t\t\t*(y++) = yuv[4];\t// y''\n\t\t\t*(y++) = yuv[6];\t// y'''\n\t\t\tif ((h & 1) == 1) {\n\t\t\t\t*(u++) = yuv[3];\t// u\n\t\t\t\t*(u++) = yuv[7];\t// u\n\t\t\t} else {\n\t\t\t\t*(v++) = yuv[1];\t// v\n\t\t\t\t*(v++) = yuv[5];\t// v\n\t\t\t}\n\t\t\tyuv += 8;\t// (1pixel=2bytes)x4pixel=8bytes\n\t\t}\n\t}\n\tRETURN(0, int);\n}\n\nuvc_error_t uvc_yuyv2yuv420SP(uvc_frame_t *in, uvc_frame_t *out) {\n\tENTER();\n\t\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_YUYV))\n\t\tRETURN(UVC_ERROR_INVALID_PARAM, uvc_error_t);\n\n\tif (UNLIKELY(uvc_ensure_frame_size(out, (in->width * in->height * 3) / 2) < 0))\n\t\tRETURN(UVC_ERROR_NO_MEM, uvc_error_t);\n\n\tconst uint8_t *src = in->data;\n\tuint8_t *dest = out->data;\n\tconst int32_t width = in->width;\n\tconst int32_t height = in->height;\n\tconst int32_t src_width = in->step;\n\tconst int32_t src_height = in->height;\n\tconst int32_t dest_width = out->width = out->step = in->width;\n\tconst int32_t dest_height = out->height = in->height;\n\n\tconst uint32_t hh = src_height < dest_height ? src_height : dest_height;\n\tuint8_t *uv = dest + dest_width * dest_height;\n\tint h, w;\n\tfor (h = 0; h < hh - 1; h += 2) {\n\t\tuint8_t *y0 = dest + width * h;\n\t\tuint8_t *y1 = y0 + width;\n\t\tconst uint8_t *yuv = src + src_width * h;\n\t\tfor (w = 0; w < width; w += 4) {\n\t\t\t*(y0++) = yuv[0];\t// y\n\t\t\t*(y0++) = yuv[2];\t// y'\n\t\t\t*(y0++) = yuv[4];\t// y''\n\t\t\t*(y0++) = yuv[6];\t// y'''\n\t\t\t*(uv++) = yuv[1];\t// u\n\t\t\t*(uv++) = yuv[3];\t// v\n\t\t\t*(uv++) = yuv[5];\t// u\n\t\t\t*(uv++) = yuv[7];\t// v\n\t\t\t*(y1++) = yuv[src_width+0];\t// y on next low\n\t\t\t*(y1++) = yuv[src_width+2];\t// y' on next low\n\t\t\t*(y1++) = yuv[src_width+4];\t// y''  on next low\n\t\t\t*(y1++) = yuv[src_width+6];\t// y'''  on next low\n\t\t\tyuv += 8;\t// (1pixel=2bytes)x4pixels=8bytes\n\t\t}\n\t}\n\t\n\tRETURN(UVC_SUCCESS, uvc_error_t);\n}\n\nuvc_error_t uvc_yuyv2iyuv420SP(uvc_frame_t *in, uvc_frame_t *out) {\n\tENTER();\n\t\n\tif (UNLIKELY(in->frame_format != UVC_FRAME_FORMAT_YUYV))\n\t\tRETURN(UVC_ERROR_INVALID_PARAM, uvc_error_t);\n\n\tif (UNLIKELY(uvc_ensure_frame_size(out, (in->width * in->height * 3) / 2) < 0))\n\t\treturn UVC_ERROR_NO_MEM;\n\n\tconst uint8_t *src = in->data;\n\tuint8_t *dest =out->data;\n\tconst int32_t width = in->width;\n\tconst int32_t height = in->height;\n\tconst int32_t src_width = in->step;\n\tconst int32_t src_height = in->height;\n\tconst int32_t dest_width = out->width = out->step = in->width;\n\tconst int32_t dest_height = out->height = in->height;\n\n\tconst uint32_t hh = src_height < dest_height ? src_height : dest_height;\n\tuint8_t *uv = dest + dest_width * dest_height;\n\tint h, w;\n\tfor (h = 0; h < hh - 1; h += 2) {\n\t\tuint8_t *y0 = dest + width * h;\n\t\tuint8_t *y1 = y0 + width;\n\t\tconst uint8_t *yuv = src + src_width * h;\n\t\tfor (w = 0; w < width; w += 4) {\n\t\t\t*(y0++) = yuv[0];\t// y\n\t\t\t*(y0++) = yuv[2];\t// y'\n\t\t\t*(y0++) = yuv[4];\t// y''\n\t\t\t*(y0++) = yuv[6];\t// y'''\n\t\t\t*(uv++) = yuv[3];\t// v\n\t\t\t*(uv++) = yuv[1];\t// u\n\t\t\t*(uv++) = yuv[7];\t// v\n\t\t\t*(uv++) = yuv[5];\t// u\n\t\t\t*(y1++) = yuv[src_width+0];\t// y on next low\n\t\t\t*(y1++) = yuv[src_width+2];\t// y' on next low\n\t\t\t*(y1++) = yuv[src_width+4];\t// y''  on next low\n\t\t\t*(y1++) = yuv[src_width+6];\t// y'''  on next low\n\t\t\tyuv += 8;\t// (1pixel=2bytes)x4pixels=8bytes\n\t\t}\n\t}\n\t\n\tRETURN(UVC_SUCCESS, uvc_error_t);\n}\n\n/** @brief Convert a frame to RGB565\n * @ingroup frame\n *\n * @param in non-RGB565 frame\n * @param out RGB565 frame\n */\nuvc_error_t uvc_any2rgb565(uvc_frame_t *in, uvc_frame_t *out) {\n\n\tswitch (in->frame_format) {\n#ifdef LIBUVC_HAS_JPEG\n\tcase UVC_FRAME_FORMAT_MJPEG:\n\t\treturn uvc_mjpeg2rgb565(in, out);\n#endif\n\tcase UVC_FRAME_FORMAT_YUYV:\n\t\treturn uvc_yuyv2rgb565(in, out);\n\tcase UVC_FRAME_FORMAT_UYVY:\n\t\treturn uvc_uyvy2rgb565(in, out);\n\tcase UVC_FRAME_FORMAT_RGB565:\n\t\treturn uvc_duplicate_frame(in, out);\n\tcase UVC_FRAME_FORMAT_RGB:\n\t\treturn uvc_rgb2rgb565(in, out);\n\tdefault:\n\t\treturn UVC_ERROR_NOT_SUPPORTED;\n\t}\n}\n\n/** @brief Convert a frame to RGB888\n * @ingroup frame\n *\n * @param in non-RGB888 frame\n * @param out RGB888 frame\n */\nuvc_error_t uvc_any2rgb(uvc_frame_t *in, uvc_frame_t *out) {\n\n\tswitch (in->frame_format) {\n#ifdef LIBUVC_HAS_JPEG\n\tcase UVC_FRAME_FORMAT_MJPEG:\n\t\treturn uvc_mjpeg2rgb(in, out);\n#endif\n\tcase UVC_FRAME_FORMAT_YUYV:\n\t\treturn uvc_yuyv2rgb(in, out);\n\tcase UVC_FRAME_FORMAT_UYVY:\n\t\treturn uvc_uyvy2rgb(in, out);\n\tcase UVC_FRAME_FORMAT_RGB:\n\t\treturn uvc_duplicate_frame(in, out);\n\tdefault:\n\t\treturn UVC_ERROR_NOT_SUPPORTED;\n\t}\n}\n\n/** @brief Convert a frame to BGR888\n * @ingroup frame\n *\n * @param in non-BGR888 frame\n * @param out BGR888 frame\n */\nuvc_error_t uvc_any2bgr(uvc_frame_t *in, uvc_frame_t *out) {\n\n\tswitch (in->frame_format) {\n#ifdef LIBUVC_HAS_JPEG\n\tcase UVC_FRAME_FORMAT_MJPEG:\n\t\treturn uvc_mjpeg2bgr(in, out);\n#endif\n\tcase UVC_FRAME_FORMAT_YUYV:\n\t\treturn uvc_yuyv2bgr(in, out);\n\tcase UVC_FRAME_FORMAT_UYVY:\n\t\treturn uvc_uyvy2bgr(in, out);\n\tcase UVC_FRAME_FORMAT_BGR:\n\t\treturn uvc_duplicate_frame(in, out);\n\tdefault:\n\t\treturn UVC_ERROR_NOT_SUPPORTED;\n\t}\n}\n\n/** @brief Convert a frame to RGBX8888\n * @ingroup frame\n *\n * @param in non-rgbx frame\n * @param out rgbx frame\n */\nuvc_error_t uvc_any2rgbx(uvc_frame_t *in, uvc_frame_t *out) {\n\n\tswitch (in->frame_format) {\n#ifdef LIBUVC_HAS_JPEG\n\tcase UVC_FRAME_FORMAT_MJPEG:\n\t\treturn uvc_mjpeg2rgbx(in, out);\n#endif\n\tcase UVC_FRAME_FORMAT_YUYV:\n\t\treturn uvc_yuyv2rgbx(in, out);\n\tcase UVC_FRAME_FORMAT_UYVY:\n\t\treturn uvc_uyvy2rgbx(in, out);\n\tcase UVC_FRAME_FORMAT_RGBX:\n\t\treturn uvc_duplicate_frame(in, out);\n\tcase UVC_FRAME_FORMAT_RGB:\n\t\treturn uvc_rgb2rgbx(in, out);\n\tdefault:\n\t\treturn UVC_ERROR_NOT_SUPPORTED;\n\t}\n}\n\n/** @brief Convert a frame to yuyv\n * @ingroup frame\n *\n * @param in non-yuyv frame\n * @param out yuyv frame\n */\nuvc_error_t uvc_any2yuyv(uvc_frame_t *in, uvc_frame_t *out) {\n\n\tswitch (in->frame_format) {\n#ifdef LIBUVC_HAS_JPEG\n\tcase UVC_FRAME_FORMAT_MJPEG:\n\t\treturn uvc_mjpeg2yuyv(in, out);\n#endif\n\tcase UVC_FRAME_FORMAT_YUYV:\n\t\treturn uvc_duplicate_frame(in, out);\n\tdefault:\n\t\treturn UVC_ERROR_NOT_SUPPORTED;\n\t}\n}\n\n/** @brief Convert a frame to yuv420sp\n * @ingroup frame\n *\n * @param in non-yuv420sp frame\n * @param out yuv420sp frame\n */\nuvc_error_t uvc_any2yuv420SP(uvc_frame_t *in, uvc_frame_t *out) {\n\tuvc_error_t result = UVC_ERROR_NO_MEM;\n\tuvc_frame_t *yuv = uvc_allocate_frame((in->width * in->height * 3) / 2);\n\tif (yuv) {\n\t\tresult = uvc_any2yuyv(in, yuv);\n\t\tif (LIKELY(!result)) {\n\t\t\tresult = uvc_yuyv2yuv420SP(yuv, out);\n\t\t}\n\t\tuvc_free_frame(yuv);\n\t}\n\treturn result;\n}\n\n/** @brief Convert a frame to iyuv420sp(NV21)\n * @ingroup frame\n *\n * @param in non-iyuv420SP(NV21) frame\n * @param out iyuv420SP(NV21) frame\n */\nuvc_error_t uvc_any2iyuv420SP(uvc_frame_t *in, uvc_frame_t *out) {\n\tuvc_error_t result = UVC_ERROR_NO_MEM;\n\tuvc_frame_t *yuv = uvc_allocate_frame((in->width * in->height * 3) / 2);\n\tif (yuv) {\n\t\tresult = uvc_any2yuyv(in, yuv);\n\t\tif (LIKELY(!result)) {\n\t\t\tresult = uvc_yuyv2iyuv420SP(yuv, out);\n\t\t}\n\t\tuvc_free_frame(yuv);\n\t}\n\treturn result;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/frame_original.c",
    "content": "/*********************************************************************\n* Software License Agreement (BSD License)\n*\n*  Copyright (C) 2010-2012 Ken Tossell\n*  All rights reserved.\n*\n*  Redistribution and use in source and binary forms, with or without\n*  modification, are permitted provided that the following conditions\n*  are met:\n*\n*   * Redistributions of source code must retain the above copyright\n*     notice, this list of conditions and the following disclaimer.\n*   * Redistributions in binary form must reproduce the above\n*     copyright notice, this list of conditions and the following\n*     disclaimer in the documentation and/or other materials provided\n*     with the distribution.\n*   * Neither the name of the author nor other contributors may be\n*     used to endorse or promote products derived from this software\n*     without specific prior written permission.\n*\n*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n*  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n*  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n*  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n*  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n*  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n*  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n*  POSSIBILITY OF SUCH DAMAGE.\n*********************************************************************/\n/**\n * @defgroup frame Frame processing\n */\n#include \"libuvc/libuvc.h\"\n#include \"libuvc/libuvc_internal.h\"\n\n/** @internal */\nuvc_error_t uvc_ensure_frame_size(uvc_frame_t *frame, size_t need_bytes) {\n  if (frame->library_owns_data) {\n    if (!frame->data || frame->data_bytes != need_bytes) {\n      frame->data_bytes = need_bytes;\n      frame->data = realloc(frame->data, frame->data_bytes);\n    }\n    if (!frame->data)\n      return UVC_ERROR_NO_MEM;\n    return UVC_SUCCESS;\n  } else {\n    if (!frame->data || frame->data_bytes < need_bytes)\n      return UVC_ERROR_NO_MEM;\n    return UVC_SUCCESS;\n  }\n}\n\n/** @brief Allocate a frame structure\n * @ingroup frame\n *\n * @param data_bytes Number of bytes to allocate, or zero\n * @return New frame, or NULL on error\n */\nuvc_frame_t *uvc_allocate_frame(size_t data_bytes) {\n  uvc_frame_t *frame = malloc(sizeof(*frame));\n\n  if (!frame)\n    return NULL;\n\n  bzero(frame, sizeof(*frame));\n\n  frame->library_owns_data = 1;\n\n  if (data_bytes > 0) {\n    frame->data_bytes = data_bytes;\n    frame->data = malloc(data_bytes);\n\n    if (!frame->data) {\n      free(frame);\n      return NULL;\n    }\n  }\n\n  return frame;\n}\n\n/** @brief Free a frame structure\n * @ingroup frame\n *\n * @param frame Frame to destroy\n */\nvoid uvc_free_frame(uvc_frame_t *frame) {\n  if (frame->data_bytes > 0 && frame->library_owns_data)\n    free(frame->data);\n\n  free(frame);\n}\n\nstatic inline unsigned char sat(int i) {\n  return (unsigned char)( i >= 255 ? 255 : (i < 0 ? 0 : i));\n}\n\n/** @brief Duplicate a frame, preserving color format\n * @ingroup frame\n *\n * @param in Original frame\n * @param out Duplicate frame\n */\nuvc_error_t uvc_duplicate_frame(uvc_frame_t *in, uvc_frame_t *out) {\n  if (uvc_ensure_frame_size(out, in->data_bytes) < 0)\n    return UVC_ERROR_NO_MEM;\n\n  out->width = in->width;\n  out->height = in->height;\n  out->frame_format = in->frame_format;\n  out->step = in->step;\n  out->sequence = in->sequence;\n  out->capture_time = in->capture_time;\n  out->source = in->source;\n\n  memcpy(out->data, in->data, in->data_bytes);\n\n  return UVC_SUCCESS;\n}\n\n#define YUYV2RGB_2(pyuv, prgb) { \\\n    float r = 1.402f * ((pyuv)[3]-128); \\\n    float g = -0.34414f * ((pyuv)[1]-128) - 0.71414f * ((pyuv)[3]-128); \\\n    float b = 1.772f * ((pyuv)[1]-128); \\\n    (prgb)[0] = sat(pyuv[0] + r); \\\n    (prgb)[1] = sat(pyuv[0] + g); \\\n    (prgb)[2] = sat(pyuv[0] + b); \\\n    (prgb)[3] = sat(pyuv[2] + r); \\\n    (prgb)[4] = sat(pyuv[2] + g); \\\n    (prgb)[5] = sat(pyuv[2] + b); \\\n    }\n#define IYUYV2RGB_2(pyuv, prgb) { \\\n    int r = (22987 * ((pyuv)[3] - 128)) >> 14; \\\n    int g = (-5636 * ((pyuv)[1] - 128) - 11698 * ((pyuv)[3] - 128)) >> 14; \\\n    int b = (29049 * ((pyuv)[1] - 128)) >> 14; \\\n    (prgb)[0] = sat(*(pyuv) + r); \\\n    (prgb)[1] = sat(*(pyuv) + g); \\\n    (prgb)[2] = sat(*(pyuv) + b); \\\n    (prgb)[3] = sat((pyuv)[2] + r); \\\n    (prgb)[4] = sat((pyuv)[2] + g); \\\n    (prgb)[5] = sat((pyuv)[2] + b); \\\n    }\n#define IYUYV2RGB_16(pyuv, prgb) IYUYV2RGB_8(pyuv, prgb); IYUYV2RGB_8(pyuv + 16, prgb + 24);\n#define IYUYV2RGB_8(pyuv, prgb) IYUYV2RGB_4(pyuv, prgb); IYUYV2RGB_4(pyuv + 8, prgb + 12);\n#define IYUYV2RGB_4(pyuv, prgb) IYUYV2RGB_2(pyuv, prgb); IYUYV2RGB_2(pyuv + 4, prgb + 6);\n\n/** @brief Convert a frame from YUYV to RGB\n * @ingroup frame\n *\n * @param in YUYV frame\n * @param out RGB frame\n */\nuvc_error_t uvc_yuyv2rgb(uvc_frame_t *in, uvc_frame_t *out) {\n  if (in->frame_format != UVC_FRAME_FORMAT_YUYV)\n    return UVC_ERROR_INVALID_PARAM;\n\n  if (uvc_ensure_frame_size(out, in->width * in->height * 3) < 0)\n    return UVC_ERROR_NO_MEM;\n\n  out->width = in->width;\n  out->height = in->height;\n  out->frame_format = UVC_FRAME_FORMAT_RGB;\n  out->step = in->width * 3;\n  out->sequence = in->sequence;\n  out->capture_time = in->capture_time;\n  out->source = in->source;\n\n  uint8_t *pyuv = in->data;\n  uint8_t *prgb = out->data;\n  uint8_t *prgb_end = prgb + out->data_bytes;\n\n  while (prgb < prgb_end) {\n    IYUYV2RGB_8(pyuv, prgb);\n\n    prgb += 3 * 8;\n    pyuv += 2 * 8;\n  }\n\n  return UVC_SUCCESS;\n}\n\n#define IYUYV2BGR_2(pyuv, pbgr) { \\\n    int r = (22987 * ((pyuv)[3] - 128)) >> 14; \\\n    int g = (-5636 * ((pyuv)[1] - 128) - 11698 * ((pyuv)[3] - 128)) >> 14; \\\n    int b = (29049 * ((pyuv)[1] - 128)) >> 14; \\\n    (pbgr)[0] = sat(*(pyuv) + b); \\\n    (pbgr)[1] = sat(*(pyuv) + g); \\\n    (pbgr)[2] = sat(*(pyuv) + r); \\\n    (pbgr)[3] = sat((pyuv)[2] + b); \\\n    (pbgr)[4] = sat((pyuv)[2] + g); \\\n    (pbgr)[5] = sat((pyuv)[2] + r); \\\n    }\n#define IYUYV2BGR_16(pyuv, pbgr) IYUYV2BGR_8(pyuv, pbgr); IYUYV2BGR_8(pyuv + 16, pbgr + 24);\n#define IYUYV2BGR_8(pyuv, pbgr) IYUYV2BGR_4(pyuv, pbgr); IYUYV2BGR_4(pyuv + 8, pbgr + 12);\n#define IYUYV2BGR_4(pyuv, pbgr) IYUYV2BGR_2(pyuv, pbgr); IYUYV2BGR_2(pyuv + 4, pbgr + 6);\n\n/** @brief Convert a frame from YUYV to BGR\n * @ingroup frame\n *\n * @param in YUYV frame\n * @param out BGR frame\n */\nuvc_error_t uvc_yuyv2bgr(uvc_frame_t *in, uvc_frame_t *out) {\n  if (in->frame_format != UVC_FRAME_FORMAT_YUYV)\n    return UVC_ERROR_INVALID_PARAM;\n\n  if (uvc_ensure_frame_size(out, in->width * in->height * 3) < 0)\n    return UVC_ERROR_NO_MEM;\n\n  out->width = in->width;\n  out->height = in->height;\n  out->frame_format = UVC_FRAME_FORMAT_BGR;\n  out->step = in->width * 3;\n  out->sequence = in->sequence;\n  out->capture_time = in->capture_time;\n  out->source = in->source;\n\n  uint8_t *pyuv = in->data;\n  uint8_t *pbgr = out->data;\n  uint8_t *pbgr_end = pbgr + out->data_bytes;\n\n  while (pbgr < pbgr_end) {\n    IYUYV2BGR_8(pyuv, pbgr);\n\n    pbgr += 3 * 8;\n    pyuv += 2 * 8;\n  }\n\n  return UVC_SUCCESS;\n}\n\n#define IUYVY2RGB_2(pyuv, prgb) { \\\n    int r = (22987 * ((pyuv)[2] - 128)) >> 14; \\\n    int g = (-5636 * ((pyuv)[0] - 128) - 11698 * ((pyuv)[2] - 128)) >> 14; \\\n    int b = (29049 * ((pyuv)[0] - 128)) >> 14; \\\n    (prgb)[0] = sat((pyuv)[1] + r); \\\n    (prgb)[1] = sat((pyuv)[1] + g); \\\n    (prgb)[2] = sat((pyuv)[1] + b); \\\n    (prgb)[3] = sat((pyuv)[3] + r); \\\n    (prgb)[4] = sat((pyuv)[3] + g); \\\n    (prgb)[5] = sat((pyuv)[3] + b); \\\n    }\n#define IUYVY2RGB_16(pyuv, prgb) IUYVY2RGB_8(pyuv, prgb); IUYVY2RGB_8(pyuv + 16, prgb + 24);\n#define IUYVY2RGB_8(pyuv, prgb) IUYVY2RGB_4(pyuv, prgb); IUYVY2RGB_4(pyuv + 8, prgb + 12);\n#define IUYVY2RGB_4(pyuv, prgb) IUYVY2RGB_2(pyuv, prgb); IUYVY2RGB_2(pyuv + 4, prgb + 6);\n\n/** @brief Convert a frame from UYVY to RGB\n * @ingroup frame\n * @param ini UYVY frame\n * @param out RGB frame\n */\nuvc_error_t uvc_uyvy2rgb(uvc_frame_t *in, uvc_frame_t *out) {\n  if (in->frame_format != UVC_FRAME_FORMAT_UYVY)\n    return UVC_ERROR_INVALID_PARAM;\n\n  if (uvc_ensure_frame_size(out, in->width * in->height * 3) < 0)\n    return UVC_ERROR_NO_MEM;\n\n  out->width = in->width;\n  out->height = in->height;\n  out->frame_format = UVC_FRAME_FORMAT_RGB;\n  out->step = in->width *3;\n  out->sequence = in->sequence;\n  out->capture_time = in->capture_time;\n  out->source = in->source;\n\n  uint8_t *pyuv = in->data;\n  uint8_t *prgb = out->data;\n  uint8_t *prgb_end = prgb + out->data_bytes;\n\n  while (prgb < prgb_end) {\n    IUYVY2RGB_8(pyuv, prgb);\n\n    prgb += 3 * 8;\n    pyuv += 2 * 8;\n  }\n\n  return UVC_SUCCESS;\n}\n\n#define IUYVY2BGR_2(pyuv, pbgr) { \\\n    int r = (22987 * ((pyuv)[2] - 128)) >> 14; \\\n    int g = (-5636 * ((pyuv)[0] - 128) - 11698 * ((pyuv)[2] - 128)) >> 14; \\\n    int b = (29049 * ((pyuv)[0] - 128)) >> 14; \\\n    (pbgr)[0] = sat((pyuv)[1] + b); \\\n    (pbgr)[1] = sat((pyuv)[1] + g); \\\n    (pbgr)[2] = sat((pyuv)[1] + r); \\\n    (pbgr)[3] = sat((pyuv)[3] + b); \\\n    (pbgr)[4] = sat((pyuv)[3] + g); \\\n    (pbgr)[5] = sat((pyuv)[3] + r); \\\n    }\n#define IUYVY2BGR_16(pyuv, pbgr) IUYVY2BGR_8(pyuv, pbgr); IUYVY2BGR_8(pyuv + 16, pbgr + 24);\n#define IUYVY2BGR_8(pyuv, pbgr) IUYVY2BGR_4(pyuv, pbgr); IUYVY2BGR_4(pyuv + 8, pbgr + 12);\n#define IUYVY2BGR_4(pyuv, pbgr) IUYVY2BGR_2(pyuv, pbgr); IUYVY2BGR_2(pyuv + 4, pbgr + 6);\n\n/** @brief Convert a frame from UYVY to BGR\n * @ingroup frame\n * @param ini UYVY frame\n * @param out BGR frame\n */\nuvc_error_t uvc_uyvy2bgr(uvc_frame_t *in, uvc_frame_t *out) {\n  if (in->frame_format != UVC_FRAME_FORMAT_UYVY)\n    return UVC_ERROR_INVALID_PARAM;\n\n  if (uvc_ensure_frame_size(out, in->width * in->height * 3) < 0)\n    return UVC_ERROR_NO_MEM;\n\n  out->width = in->width;\n  out->height = in->height;\n  out->frame_format = UVC_FRAME_FORMAT_BGR;\n  out->step = in->width *3;\n  out->sequence = in->sequence;\n  out->capture_time = in->capture_time;\n  out->source = in->source;\n\n  uint8_t *pyuv = in->data;\n  uint8_t *pbgr = out->data;\n  uint8_t *pbgr_end = pbgr + out->data_bytes;\n\n  while (pbgr < pbgr_end) {\n    IUYVY2BGR_8(pyuv, pbgr);\n\n    pbgr += 3 * 8;\n    pyuv += 2 * 8;\n  }\n\n  return UVC_SUCCESS;\n}\n\n/** @brief Convert a frame to RGB\n * @ingroup frame\n *\n * @param in non-RGB frame\n * @param out RGB frame\n */\nuvc_error_t uvc_any2rgb(uvc_frame_t *in, uvc_frame_t *out) {\n  switch (in->frame_format) {\n    case UVC_FRAME_FORMAT_YUYV:\n      return uvc_yuyv2rgb(in, out);\n    case UVC_FRAME_FORMAT_UYVY:\n      return uvc_uyvy2rgb(in, out);\n    case UVC_FRAME_FORMAT_RGB:\n      return uvc_duplicate_frame(in, out);\n    default:\n      return UVC_ERROR_NOT_SUPPORTED;\n  }\n}\n\n/** @brief Convert a frame to BGR\n * @ingroup frame\n *\n * @param in non-BGR frame\n * @param out BGR frame\n */\nuvc_error_t uvc_any2bgr(uvc_frame_t *in, uvc_frame_t *out) {\n  switch (in->frame_format) {\n    case UVC_FRAME_FORMAT_YUYV:\n      return uvc_yuyv2bgr(in, out);\n    case UVC_FRAME_FORMAT_UYVY:\n      return uvc_uyvy2bgr(in, out);\n    case UVC_FRAME_FORMAT_BGR:\n      return uvc_duplicate_frame(in, out);\n    default:\n      return UVC_ERROR_NOT_SUPPORTED;\n  }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/init.c",
    "content": "/*********************************************************************\n * modified _uvc_handle_events to improve performance on Android\n * Copyright (C) 2014 saki@serenegiant All rights reserved.\n *********************************************************************/\n/*********************************************************************\n * Software License Agreement (BSD License)\n *\n *  Copyright (C) 2010-2012 Ken Tossell\n *  All rights reserved.\n *\n *  Redistribution and use in source and binary forms, with or without\n *  modification, are permitted provided that the following conditions\n *  are met:\n *\n *   * Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n *   * Redistributions in binary form must reproduce the above\n *     copyright notice, this list of conditions and the following\n *     disclaimer in the documentation and/or other materials provided\n *     with the distribution.\n *   * Neither the name of the author nor other contributors may be\n *     used to endorse or promote products derived from this software\n *     without specific prior written permission.\n *\n *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n *  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n *  POSSIBILITY OF SUCH DAMAGE.\n *********************************************************************/\n/**\n\\mainpage libuvc: a cross-platform library for USB video devices\n\n\\b libuvc is a library that supports enumeration, control and streaming\nfor USB Video Class (UVC) devices, such as consumer webcams.\n\n\\section features Features\n\\li UVC device \\ref device \"discovery and management\" API\n\\li \\ref streaming \"Video streaming\" (device to host) with asynchronous/callback and synchronous/polling modes\n\\li Read/write access to standard \\ref ctrl \"device settings\"\n\\li \\ref frame \"Conversion\" between various formats: RGB, YUV, JPEG, etc.\n\\li Tested on Mac and Linux, portable to Windows and some BSDs\n\n\\section roadmap Roadmap\n\\li Bulk-mode image capture\n\\li One-shot image capture\n\\li Improved support for standard settings\n\\li Support for \"extended\" (vendor-defined) settings\n\n\\section misc Misc.\n\\p The source code can be found at https://github.com/ktossell/libuvc. To build\nthe library, install <a href=\"http://libusb.org/\">libusb</a> 1.0+ and run:\n\n\\code\n$ git clone https://github.com/ktossell/libuvc.git\n$ cd libuvc\n$ mkdir build\n$ cd build\n$ cmake -DCMAKE_BUILD_TYPE=Release ..\n$ make && make install\n\\endcode\n\n\\section Example\nIn this example, libuvc is used to acquire images in a 30 fps, 640x480\nYUV stream from a UVC device such as a standard webcam.\n\n\\include example.c\n\n*/\n\n/**\n * @defgroup init Library initialization/deinitialization\n * @brief Setup routines used to construct UVC access contexts\n */\n#include \"libuvc/libuvc.h\"\n#include \"libuvc/libuvc_internal.h\"\n#if defined(__ANDROID__)\n#include <unistd.h>\n#include <sys/time.h>\n#include <sys/resource.h>\n#endif\t// defined(__ANDROID__)\n\n/** @internal\n * @brief Event handler thread\n * There's one of these per UVC context.\n * @todo We shouldn't run this if we don't own the USB context\n */\nvoid *_uvc_handle_events(void *arg) {\n\tuvc_context_t *ctx = (uvc_context_t *) arg;\n\n#if defined(__ANDROID__)\n\t// try to increase thread priority\n\tint prio = getpriority(PRIO_PROCESS, 0);\n\tnice(-18);\n\tif (UNLIKELY(getpriority(PRIO_PROCESS, 0) >= prio)) {\n\t\tLOGW(\"could not change thread priority\");\n\t}\n#endif\n\tfor (; !ctx->kill_handler_thread ;)\n\t\tlibusb_handle_events(ctx->usb_ctx);\n\treturn NULL;\n}\n\n/** @brief Initializes the UVC context\n * @ingroup init\n *\n * @note If you provide your own USB context, you must handle\n * libusb event processing using a function such as libusb_handle_events.\n *\n * @param[out] pctx The location where the context reference should be stored.\n * @param[in]  usb_ctx Optional USB context to use\n * @return Error opening context or UVC_SUCCESS\n */\nuvc_error_t uvc_init2(uvc_context_t **pctx, struct libusb_context *usb_ctx, const char *usbfs) {\n\tuvc_error_t ret = UVC_SUCCESS;\n\tuvc_context_t *ctx = calloc(1, sizeof(*ctx));\n\n\tif (usb_ctx == NULL) {\n\t\tif (usbfs && strlen(usbfs) > 0) {\n\t\t\tLOGD(\"call #libusb_init2\");\n\t\t\tret = libusb_init2(&ctx->usb_ctx, usbfs);\n\t\t} else {\n\t\t\tLOGD(\"call #libusb_init\");\n\t\t\tret = libusb_init(&ctx->usb_ctx);\n\t\t}\n\t\tctx->own_usb_ctx = 1;\n\t\tif (UNLIKELY(ret != UVC_SUCCESS)) {\n\t\t\tLOGW(\"failed:err=%d\", ret);\n\t\t\tfree(ctx);\n\t\t\tctx = NULL;\n\t\t}\n\t} else {\n\t\tctx->own_usb_ctx = 0;\n\t\tctx->usb_ctx = usb_ctx;\n\t}\n\n\tif (ctx != NULL)\n\t\t*pctx = ctx;\n\n\treturn ret;\n}\n\nuvc_error_t uvc_init(uvc_context_t **pctx, struct libusb_context *usb_ctx) {\n\treturn uvc_init2(pctx, usb_ctx, NULL);\n#if 0\n\tuvc_error_t ret = UVC_SUCCESS;\n\tuvc_context_t *ctx = calloc(1, sizeof(*ctx));\n\n\tif (usb_ctx == NULL) {\n\t\tret = libusb_init(&ctx->usb_ctx);\n\t\tctx->own_usb_ctx = 1;\n\t\tif (UNLIKELY(ret != UVC_SUCCESS)) {\n\t\t\tfree(ctx);\n\t\t\tctx = NULL;\n\t\t}\n\t} else {\n\t\tctx->own_usb_ctx = 0;\n\t\tctx->usb_ctx = usb_ctx;\n\t}\n\n\tif (ctx != NULL)\n\t\t*pctx = ctx;\n\n\treturn ret;\n#endif\n}\n\n/**\n * @brief Closes the UVC context, shutting down any active cameras.\n * @ingroup init\n *\n * @note This function invalides any existing references to the context's\n * cameras.\n *\n * If no USB context was provided to #uvc_init, the UVC-specific USB\n * context will be destroyed.\n *\n * @param ctx UVC context to shut down\n */\nvoid uvc_exit(uvc_context_t *ctx) {\n\tuvc_device_handle_t *devh;\n\n\tDL_FOREACH(ctx->open_devices, devh)\n\t{\n\t\tuvc_close(devh);\n\t}\n\n\tif (ctx->own_usb_ctx)\n\t\tlibusb_exit(ctx->usb_ctx);\n\n\tfree(ctx);\n}\n\n/**\n * @internal\n * @brief Spawns a handler thread for the context\n * @ingroup init\n *\n * This should be called at the end of a successful uvc_open if no devices\n * are already open (and being handled).\n */\nvoid uvc_start_handler_thread(uvc_context_t *ctx) {\n\tif (ctx->own_usb_ctx) {\n\t\tpthread_create(&ctx->handler_thread, NULL, _uvc_handle_events, (void*) ctx);\n\t}\n}\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/init_original.c",
    "content": "/*********************************************************************\n* Software License Agreement (BSD License)\n*\n*  Copyright (C) 2010-2012 Ken Tossell\n*  All rights reserved.\n*\n*  Redistribution and use in source and binary forms, with or without\n*  modification, are permitted provided that the following conditions\n*  are met:\n*\n*   * Redistributions of source code must retain the above copyright\n*     notice, this list of conditions and the following disclaimer.\n*   * Redistributions in binary form must reproduce the above\n*     copyright notice, this list of conditions and the following\n*     disclaimer in the documentation and/or other materials provided\n*     with the distribution.\n*   * Neither the name of the author nor other contributors may be\n*     used to endorse or promote products derived from this software\n*     without specific prior written permission.\n*\n*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n*  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n*  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n*  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n*  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n*  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n*  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n*  POSSIBILITY OF SUCH DAMAGE.\n*********************************************************************/\n/**\n\\mainpage libuvc: a cross-platform library for USB video devices\n\n\\b libuvc is a library that supports enumeration, control and streaming\nfor USB Video Class (UVC) devices, such as consumer webcams.\n\n\\section features Features\n\\li Asynchronous video streaming (device to host) in isochronous mode\n\\li Synchronous streaming API (but only isochronous streaming is available)\n\\li Read/write access to standard device settings\n\\li Conversion between various RGB and YUV formats\n\\li Tested on Mac and Linux, portable to Windows and some BSDs\n\n\\section roadmap Roadmap\n\\li Bulk-mode image capture\n\\li One-shot image capture\n\\li Improved support for standard settings\n\\li Support for \"extended\" (vendor-defined) settings\n\n\\section misc Misc.\n\\p The source code can be found at https://github.com/ktossell/libuvc. To build\nthe library, install <a href=\"http://libusb.org/\">libusb</a> 1.0+ and run:\n\n\\code\n$ git clone https://github.com/ktossell/libuvc.git\n$ cd libuvc\n$ mkdir build\n$ cd build\n$ cmake -DCMAKE_BUILD_TYPE=Release ..\n$ make && make install\n\\endcode\n\n\\section Example\nIn this example, libuvc is used to acquire images in a 30 fps, 640x480\nYUV stream from a UVC device such as a standard webcam.\n\n\\include example.c\n\n*/\n\n/**\n * @defgroup init Library initialization/deinitialization\n */\n#include \"libuvc/libuvc.h\"\n#include \"libuvc/libuvc_internal.h\"\n\n/** @internal\n * @brief Event handler thread\n * There's one of these per UVC context.\n * @todo We shouldn't run this if we don't own the USB context\n */\nvoid *_uvc_handle_events(void *arg) {\n  uvc_context_t *ctx = (uvc_context_t *) arg;\n\n  while (!ctx->kill_handler_thread)\n    libusb_handle_events(ctx->usb_ctx);\n  return NULL;\n}\n\n/** @brief Initializes the UVC context\n * @ingroup init\n *\n * @note If you provide your own USB context, you must handle\n * libusb event processing using a function such as libusb_handle_events.\n *\n * @param[out] pctx The location where the context reference should be stored.\n * @param[in]  usb_ctx Optional USB context to use\n * @return Error opening context or UVC_SUCCESS\n */\nuvc_error_t uvc_init(uvc_context_t **pctx, struct libusb_context *usb_ctx) {\n  uvc_error_t ret = UVC_SUCCESS;\n  uvc_context_t *ctx = calloc(1, sizeof(*ctx));\n\n  if (usb_ctx == NULL) {\n    ret = libusb_init(&ctx->usb_ctx);\n    ctx->own_usb_ctx = 1;\n    if (ret != UVC_SUCCESS) {\n      free(ctx);\n      ctx = NULL;\n    }\n  } else {\n    ctx->own_usb_ctx = 0;\n    ctx->usb_ctx = usb_ctx;\n  }\n\n  if (ctx != NULL)\n    *pctx = ctx;\n\n  return ret;\n}\n\n/**\n * @brief Closes the UVC context, shutting down any active cameras.\n * @ingroup init\n *\n * @note This function invalides any existing references to the context's\n * cameras.\n *\n * If no USB context was provided to #uvc_init, the UVC-specific USB\n * context will be destroyed.\n *\n * @param ctx UVC context to shut down\n */\nvoid uvc_exit(uvc_context_t *ctx) {\n  uvc_device_handle_t *devh;\n\n  DL_FOREACH(ctx->open_devices, devh) {\n    uvc_close(devh);\n  }\n\n  if (ctx->own_usb_ctx)\n    libusb_exit(ctx->usb_ctx);\n\n  free(ctx);\n}\n\n/**\n * @internal\n * @brief Spawns a handler thread for the context\n * @ingroup init\n *\n * This should be called at the end of a successful uvc_open if no devices\n * are already open (and being handled).\n */\nvoid uvc_start_handler_thread(uvc_context_t *ctx) {\n  if (ctx->own_usb_ctx)\n    pthread_create(&ctx->handler_thread, NULL, _uvc_handle_events, (void*) ctx);\n}\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/misc.c",
    "content": "/*********************************************************************\n* Software License Agreement (BSD License)\n*\n*  Copyright (C) 2010-2012 Ken Tossell\n*  All rights reserved.\n*\n*  Redistribution and use in source and binary forms, with or without\n*  modification, are permitted provided that the following conditions\n*  are met:\n*\n*   * Redistributions of source code must retain the above copyright\n*     notice, this list of conditions and the following disclaimer.\n*   * Redistributions in binary form must reproduce the above\n*     copyright notice, this list of conditions and the following\n*     disclaimer in the documentation and/or other materials provided\n*     with the distribution.\n*   * Neither the name of the author nor other contributors may be\n*     used to endorse or promote products derived from this software\n*     without specific prior written permission.\n*\n*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n*  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n*  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n*  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n*  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n*  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n*  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n*  POSSIBILITY OF SUCH DAMAGE.\n*********************************************************************/\n#include <string.h>\n#include <stdlib.h>\n\n#if __APPLE__\nchar *strndup(const char *s, size_t n) {\n  size_t src_n = 0;\n  const char *sp = s;\n  char *d;\n\n  while (*sp++)\n    src_n++;\n\n  if (src_n < n)\n    n = src_n;\n\n  d = malloc(n + 1);\n\n  memcpy(d, s, n);\n  \n  d[n] = '\\0';\n\n  return d;\n}\n#endif\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/stream.c",
    "content": "/*********************************************************************\n *********************************************************************/\n/*********************************************************************\n * modified some function to avoid crash, support Android\n * Copyright (C) 2014-2016 saki@serenegiant All rights reserved.\n *********************************************************************/\n/*********************************************************************\n * Software License Agreement (BSD License)\n *\n *  Copyright (C) 2010-2012 Ken Tossell\n *  All rights reserved.\n *\n *  Redistribution and use in source and binary forms, with or without\n *  modification, are permitted provided that the following conditions\n *  are met:\n *\n *   * Redistributions of source code must retain the above copyright\n *     notice, this list of conditions and the following disclaimer.\n *   * Redistributions in binary form must reproduce the above\n *     copyright notice, this list of conditions and the following\n *     disclaimer in the documentation and/or other materials provided\n *     with the distribution.\n *   * Neither the name of the author nor other contributors may be\n *     used to endorse or promote products derived from this software\n *     without specific prior written permission.\n *\n *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n *  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n *  POSSIBILITY OF SUCH DAMAGE.\n *********************************************************************/\n/**\n * @defgroup streaming Streaming control functions\n * @brief Tools for creating, managing and consuming video streams\n */\n\n#define LOCAL_DEBUG 0\n\n#define LOG_TAG \"libuvc/stream\"\n#if 1\t// デバッグ情報を出さない時1\n\t#ifndef LOG_NDEBUG\n\t\t#define\tLOG_NDEBUG\t\t// LOGV/LOGD/MARKを出力しない時\n\t\t#endif\n\t#undef USE_LOGALL\t\t\t// 指定したLOGxだけを出力\n#else\n\t#define USE_LOGALL\n\t#undef LOG_NDEBUG\n\t#undef NDEBUG\n\t#define GET_RAW_DESCRIPTOR\n#endif\n\n#include <assert.h>\t\t// XXX add assert for debugging\n\n#include \"libuvc/libuvc.h\"\n#include \"libuvc/libuvc_internal.h\"\n\nuvc_frame_desc_t *uvc_find_frame_desc_stream(uvc_stream_handle_t *strmh,\n\t\tuint16_t format_id, uint16_t frame_id);\nuvc_frame_desc_t *uvc_find_frame_desc(uvc_device_handle_t *devh,\n\t\tuint16_t format_id, uint16_t frame_id);\nstatic void *_uvc_user_caller(void *arg);\nstatic void _uvc_populate_frame(uvc_stream_handle_t *strmh);\n\nstruct format_table_entry {\n\tenum uvc_frame_format format;\n\tuint8_t abstract_fmt;\n\tuint8_t guid[16];\n\tint children_count;\n\tenum uvc_frame_format *children;\n};\n\nstruct format_table_entry *_get_format_entry(enum uvc_frame_format format) {\n#define ABS_FMT(_fmt, ...) \\\n    case _fmt: { \\\n    static enum uvc_frame_format _fmt##_children[] = __VA_ARGS__; \\\n    static struct format_table_entry _fmt##_entry = { \\\n      _fmt, 0, {}, ARRAYSIZE(_fmt##_children), _fmt##_children }; \\\n    return &_fmt##_entry; }\n\n#define FMT(_fmt, ...) \\\n    case _fmt: { \\\n    static struct format_table_entry _fmt##_entry = { \\\n      _fmt, 0, __VA_ARGS__, 0, NULL }; \\\n    return &_fmt##_entry; }\n\n\tswitch (format) {\n\t/* Define new formats here */\n\tABS_FMT(UVC_FRAME_FORMAT_ANY,\n\t\t{UVC_FRAME_FORMAT_UNCOMPRESSED, UVC_FRAME_FORMAT_COMPRESSED})\n\n\tABS_FMT(UVC_FRAME_FORMAT_UNCOMPRESSED,\n\t\t{UVC_FRAME_FORMAT_YUYV, UVC_FRAME_FORMAT_UYVY, UVC_FRAME_FORMAT_GRAY8})\n\tFMT(UVC_FRAME_FORMAT_YUYV,\n\t\t{'Y', 'U', 'Y', '2', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})\n\tFMT(UVC_FRAME_FORMAT_UYVY,\n\t\t{'U', 'Y', 'V', 'Y', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})\n\tFMT(UVC_FRAME_FORMAT_GRAY8,\n\t\t{'Y', '8', '0', '0', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})\n    FMT(UVC_FRAME_FORMAT_BY8,\n    \t{'B', 'Y', '8', ' ', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})\n\n\tABS_FMT(UVC_FRAME_FORMAT_COMPRESSED,\n\t\t{UVC_FRAME_FORMAT_MJPEG})\n\tFMT(UVC_FRAME_FORMAT_MJPEG,\n\t\t{'M', 'J', 'P', 'G'})\n\n\tdefault:\n\t\treturn NULL;\n\t}\n\n#undef ABS_FMT\n#undef FMT\n}\n\nstatic uint8_t _uvc_frame_format_matches_guid(enum uvc_frame_format fmt,\n\t\tuint8_t guid[16]) {\n\tstruct format_table_entry *format;\n\tint child_idx;\n\n\tformat = _get_format_entry(fmt);\n\tif (UNLIKELY(!format))\n\t\treturn 0;\n\n\tif (!format->abstract_fmt && !memcmp(guid, format->guid, 16))\n\t\treturn 1;\n\n\tfor (child_idx = 0; child_idx < format->children_count; child_idx++) {\n\t\tif (_uvc_frame_format_matches_guid(format->children[child_idx], guid))\n\t\t\treturn 1;\n\t}\n\n\treturn 0;\n}\n\nstatic enum uvc_frame_format uvc_frame_format_for_guid(uint8_t guid[16]) {\n\tstruct format_table_entry *format;\n\tenum uvc_frame_format fmt;\n\n\tfor (fmt = 0; fmt < UVC_FRAME_FORMAT_COUNT; ++fmt) {\n\t\tformat = _get_format_entry(fmt);\n\t\tif (!format || format->abstract_fmt)\n\t\t\tcontinue;\n\t\tif (!memcmp(format->guid, guid, 16))\n\t\t\treturn format->format;\n\t}\n\n\treturn UVC_FRAME_FORMAT_UNKNOWN;\n}\n\n/** @internal\n * Run a streaming control query\n * @param[in] devh UVC device\n * @param[in,out] ctrl Control block\n * @param[in] probe Whether this is a probe query or a commit query\n * @param[in] req Query type\n */\nuvc_error_t uvc_query_stream_ctrl(uvc_device_handle_t *devh,\n\t\tuvc_stream_ctrl_t *ctrl, uint8_t probe, enum uvc_req_code req) {\n\tuint8_t buf[48];\t// XXX support UVC 1.1 & 1.5\n\tsize_t len;\n\tuvc_error_t err;\n\n\tmemset(buf, 0, sizeof(buf));\t// bzero(buf, sizeof(buf));\t// bzero is deprecated\n\n\tconst uint16_t bcdUVC = devh->info->ctrl_if.bcdUVC;\n\tif (bcdUVC >= 0x0150)\n\t\tlen = 48;\n\telse if (bcdUVC >= 0x0110)\n\t\tlen = 34;\n\telse\n\t\tlen = 26;\n//\tLOGI(\"bcdUVC:%x,req:0x%02x,probe:%d\", bcdUVC, req, probe);\n\t/* prepare for a SET transfer */\n\tif (req == UVC_SET_CUR) {\n\t\tSHORT_TO_SW(ctrl->bmHint, buf);\n\t\tbuf[2] = ctrl->bFormatIndex;\n\t\tbuf[3] = ctrl->bFrameIndex;\n\t\tINT_TO_DW(ctrl->dwFrameInterval, buf + 4);\n\t\tSHORT_TO_SW(ctrl->wKeyFrameRate, buf + 8);\n\t\tSHORT_TO_SW(ctrl->wPFrameRate, buf + 10);\n\t\tSHORT_TO_SW(ctrl->wCompQuality, buf + 12);\n\t\tSHORT_TO_SW(ctrl->wCompWindowSize, buf + 14);\n\t\tSHORT_TO_SW(ctrl->wDelay, buf + 16);\n\t\tINT_TO_DW(ctrl->dwMaxVideoFrameSize, buf + 18);\n\t\tINT_TO_DW(ctrl->dwMaxPayloadTransferSize, buf + 22);\n\n\t\tif (len > 26) {\t// len == 34\n\t\t\t// XXX add to support UVC 1.1\n\t\t\tINT_TO_DW(ctrl->dwClockFrequency, buf + 26);\n\t\t\tbuf[30] = ctrl->bmFramingInfo;\n\t\t\tbuf[31] = ctrl->bPreferedVersion;\n\t\t\tbuf[32] = ctrl->bMinVersion;\n\t\t\tbuf[33] = ctrl->bMaxVersion;\n\t\t\tif (len == 48) {\n\t\t\t\t// XXX add to support UVC1.5\n\t\t\t\tbuf[34] = ctrl->bUsage;\n\t\t\t\tbuf[35] = ctrl->bBitDepthLuma;\n\t\t\t\tbuf[36] = ctrl->bmSettings;\n\t\t\t\tbuf[37] = ctrl->bMaxNumberOfRefFramesPlus1;\n\t\t\t\tSHORT_TO_SW(ctrl->bmRateControlModes, buf + 38);\n\t\t\t\tLONG_TO_QW(ctrl->bmLayoutPerStream, buf + 40);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* do the transfer */\n\terr = libusb_control_transfer(devh->usb_devh,\n\t\t\treq == UVC_SET_CUR ? 0x21 : 0xA1, req,\n\t\t\tprobe ? (UVC_VS_PROBE_CONTROL << 8) : (UVC_VS_COMMIT_CONTROL << 8),\n\t\t\tctrl->bInterfaceNumber, buf, len, 0);\n\n\tif (UNLIKELY(err <= 0)) {\n\t\t// when libusb_control_transfer returned error or transfer bytes was zero.\n\t\tif (!err) {\n\t\t\tUVC_DEBUG(\"libusb_control_transfer transfered zero length data\");\n\t\t\terr = UVC_ERROR_OTHER;\n\t\t}\n\t\treturn err;\n\t}\n\tif (err < len) {\n#if !defined(__LP64__)\n\t\tLOGE(\"transfered bytes is smaller than data bytes:%d expected %d\", err, len);\n#else\n\t\tLOGE(\"transfered bytes is smaller than data bytes:%d expected %ld\", err, len);\n#endif\n\t\treturn UVC_ERROR_OTHER;\n\t}\n\t/* now decode following a GET transfer */\n\tif (req != UVC_SET_CUR) {\n\t\tctrl->bmHint = SW_TO_SHORT(buf);\n\t\tctrl->bFormatIndex = buf[2];\n\t\tctrl->bFrameIndex = buf[3];\n\t\tctrl->dwFrameInterval = DW_TO_INT(buf + 4);\n\t\tctrl->wKeyFrameRate = SW_TO_SHORT(buf + 8);\n\t\tctrl->wPFrameRate = SW_TO_SHORT(buf + 10);\n\t\tctrl->wCompQuality = SW_TO_SHORT(buf + 12);\n\t\tctrl->wCompWindowSize = SW_TO_SHORT(buf + 14);\n\t\tctrl->wDelay = SW_TO_SHORT(buf + 16);\n\t\tctrl->dwMaxVideoFrameSize = DW_TO_INT(buf + 18);\n\t\tctrl->dwMaxPayloadTransferSize = DW_TO_INT(buf + 22);\n\n\t\tif (len > 26) {\t// len == 34\n\t\t\t// XXX add to support UVC 1.1\n\t\t\tctrl->dwClockFrequency = DW_TO_INT(buf + 26);\n\t\t\tctrl->bmFramingInfo = buf[30];\n\t\t\tctrl->bPreferedVersion = buf[31];\n\t\t\tctrl->bMinVersion = buf[32];\n\t\t\tctrl->bMaxVersion = buf[33];\n\t\t\tif (len >= 48) {\n\t\t\t\t// XXX add to support UVC1.5\n\t\t\t\tctrl->bUsage = buf[34];\n\t\t\t\tctrl->bBitDepthLuma = buf[35];\n\t\t\t\tctrl->bmSettings = buf[36];\n\t\t\t\tctrl->bMaxNumberOfRefFramesPlus1 = buf[37];\n\t\t\t\tctrl->bmRateControlModes = SW_TO_SHORT(buf + 38);\n\t\t\t\tctrl->bmLayoutPerStream = QW_TO_LONG(buf + 40);\n\t\t\t}\n\t\t}\n\n\t\t/* fix up block for cameras that fail to set dwMax */\n\t\tif (!ctrl->dwMaxVideoFrameSize) {\n\t\t\tLOGW(\"fix up block for cameras that fail to set dwMax\");\n\t\t\tuvc_frame_desc_t *frame_desc = uvc_find_frame_desc(devh,\n\t\t\t\t\tctrl->bFormatIndex, ctrl->bFrameIndex);\n\n\t\t\tif (frame_desc) {\n\t\t\t\tctrl->dwMaxVideoFrameSize = frame_desc->dwMaxVideoFrameBufferSize;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn UVC_SUCCESS;\n}\n\n/** @brief Reconfigure stream with a new stream format.\n * @ingroup streaming\n *\n * This may be executed whether or not the stream is running.\n *\n * @param[in] strmh Stream handle\n * @param[in] ctrl Control block, processed using {uvc_probe_stream_ctrl} or\n *             {uvc_get_stream_ctrl_format_size}\n */\nuvc_error_t uvc_stream_ctrl(uvc_stream_handle_t *strmh, uvc_stream_ctrl_t *ctrl) {\n\tuvc_error_t ret;\n\n\tif (UNLIKELY(strmh->stream_if->bInterfaceNumber != ctrl->bInterfaceNumber))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\t/* @todo Allow the stream to be modified without restarting the stream */\n\tif (UNLIKELY(strmh->running))\n\t\treturn UVC_ERROR_BUSY;\n\n\tret = uvc_query_stream_ctrl(strmh->devh, ctrl, 0, UVC_SET_CUR);\t// commit query\n\tif (UNLIKELY(ret != UVC_SUCCESS))\n\t\treturn ret;\n\n\tstrmh->cur_ctrl = *ctrl;\n\treturn UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Find the descriptor for a specific frame configuration\n * @param stream_if Stream interface\n * @param format_id Index of format class descriptor\n * @param frame_id Index of frame descriptor\n */\nstatic uvc_frame_desc_t *_uvc_find_frame_desc_stream_if(\n\t\tuvc_streaming_interface_t *stream_if, uint16_t format_id,\n\t\tuint16_t frame_id) {\n\n\tuvc_format_desc_t *format = NULL;\n\tuvc_frame_desc_t *frame = NULL;\n\n\tDL_FOREACH(stream_if->format_descs, format)\n\t{\n\t\tif (format->bFormatIndex == format_id) {\n\t\t\tDL_FOREACH(format->frame_descs, frame)\n\t\t\t{\n\t\t\t\tif (frame->bFrameIndex == frame_id)\n\t\t\t\t\treturn frame;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn NULL ;\n}\n\nuvc_error_t uvc_get_frame_desc(uvc_device_handle_t *devh,\n\t\tuvc_stream_ctrl_t *ctrl, uvc_frame_desc_t **desc) {\n\n\t*desc = uvc_find_frame_desc(devh, ctrl->bFormatIndex, ctrl->bFrameIndex);\n\treturn *desc ? UVC_SUCCESS : UVC_ERROR_INVALID_PARAM;\n}\n\nuvc_frame_desc_t *uvc_find_frame_desc_stream(uvc_stream_handle_t *strmh,\n\t\tuint16_t format_id, uint16_t frame_id) {\n\treturn _uvc_find_frame_desc_stream_if(strmh->stream_if, format_id, frame_id);\n}\n\n/** @internal\n * @brief Find the descriptor for a specific frame configuration\n * @param devh UVC device\n * @param format_id Index of format class descriptor\n * @param frame_id Index of frame descriptor\n */\nuvc_frame_desc_t *uvc_find_frame_desc(uvc_device_handle_t *devh,\n\t\tuint16_t format_id, uint16_t frame_id) {\n\n\tuvc_streaming_interface_t *stream_if;\n\tuvc_frame_desc_t *frame;\n\n\tDL_FOREACH(devh->info->stream_ifs, stream_if)\n\t{\n\t\tframe = _uvc_find_frame_desc_stream_if(stream_if, format_id, frame_id);\n\t\tif (frame)\n\t\t\treturn frame;\n\t}\n\n\treturn NULL;\n}\n\nstatic void _uvc_print_streaming_interface_one(uvc_streaming_interface_t *stream_if) {\n//\tstruct uvc_device_info *parent;\n//\tstruct uvc_streaming_interface *prev, *next;\n\tMARK(\"bInterfaceNumber:%d\", stream_if->bInterfaceNumber);\n\tuvc_print_format_desc_one(stream_if->format_descs, NULL);\n\tMARK(\"bEndpointAddress:%d\", stream_if->bEndpointAddress);\n\tMARK(\"bTerminalLink:%d\", stream_if->bTerminalLink);\n}\n\nstatic uvc_error_t _prepare_stream_ctrl(uvc_device_handle_t *devh, uvc_stream_ctrl_t *ctrl) {\n\t// XXX some camera may need to call uvc_query_stream_ctrl with UVC_GET_CUR/UVC_GET_MAX/UVC_GET_MIN\n\t// before negotiation otherwise stream stall. added by saki\n\tuvc_error_t result = uvc_query_stream_ctrl(devh, ctrl, 1, UVC_GET_CUR);\t// probe query\n\tif (LIKELY(!result)) {\n\t\tresult = uvc_query_stream_ctrl(devh, ctrl, 1, UVC_GET_MIN);\t\t\t// probe query\n\t\tif (LIKELY(!result)) {\n\t\t\tresult = uvc_query_stream_ctrl(devh, ctrl, 1, UVC_GET_MAX);\t\t// probe query\n\t\t\tif (UNLIKELY(result))\n\t\t\t\tLOGE(\"uvc_query_stream_ctrl:UVC_GET_MAX:err=%d\", result);\t// XXX 最大値の方を後で取得しないとだめ\n\t\t} else {\n\t\t\tLOGE(\"uvc_query_stream_ctrl:UVC_GET_MIN:err=%d\", result);\n\t\t}\n\t} else {\n\t\tLOGE(\"uvc_query_stream_ctrl:UVC_GET_CUR:err=%d\", result);\n\t}\n#if 0\n\tif (UNLIKELY(result)) {\n\t\tenum uvc_error_code_control error_code;\n\t\tuvc_get_error_code(devh, &error_code, UVC_GET_CUR);\n\t\tLOGE(\"uvc_query_stream_ctrl:ret=%d,err_code=%d\", result, error_code);\n\t\tuvc_print_format_desc(devh->info->stream_ifs->format_descs, NULL);\n\t}\n#endif\n\treturn result;\n}\n\nstatic uvc_error_t _uvc_get_stream_ctrl_format(uvc_device_handle_t *devh,\n\tuvc_streaming_interface_t *stream_if, uvc_stream_ctrl_t *ctrl, uvc_format_desc_t *format,\n\tconst int width, const int height,\n\tconst int min_fps, const int max_fps) {\n\n\tENTER();\n\n\tint i;\n\tuvc_frame_desc_t *frame;\n\n\tctrl->bInterfaceNumber = stream_if->bInterfaceNumber;\n\tuvc_error_t result = uvc_claim_if(devh, ctrl->bInterfaceNumber);\n\tif (UNLIKELY(result)) {\n\t\tLOGE(\"uvc_claim_if:err=%d\", result);\n\t\tgoto fail;\n\t}\n\tfor (i = 0; i < 2; i++) {\n\t\tresult = _prepare_stream_ctrl(devh, ctrl);\n\t}\n\tif (UNLIKELY(result)) {\n\t\tLOGE(\"_prepare_stream_ctrl:err=%d\", result);\n\t\tgoto fail;\n\t}\n#if 0\n\t// XXX add check ctrl values\n\tuint64_t bmaControl = stream_if->bmaControls[format->bFormatIndex - 1];\n\tif (bmaControl & 0x001) {\t// wKeyFrameRate\n\t\tif (UNLIKELY(!ctrl->wKeyFrameRate)) {\n\t\t\tLOGE(\"wKeyFrameRate should be set\");\n\t\t\tRETURN(UVC_ERROR_INVALID_MODE, uvc_error_t);\n\t\t}\n\t}\n\tif (bmaControl & 0x002) {\t// wPFrameRate\n\t\tif (UNLIKELY(!ctrl->wPFrameRate)) {\n\t\t\tLOGE(\"wPFrameRate should be set\");\n\t\t\tRETURN(UVC_ERROR_INVALID_MODE, uvc_error_t);\n\t\t}\n\t}\n\tif (bmaControl & 0x004) {\t// wCompQuality\n\t\tif (UNLIKELY(!ctrl->wCompQuality)) {\n\t\t\tLOGE(\"wCompQuality should be set\");\n\t\t\tRETURN(UVC_ERROR_INVALID_MODE, uvc_error_t);\n\t\t}\n\t}\n\tif (bmaControl & 0x008) {\t// wCompWindowSize\n\t\tif (UNLIKELY(!ctrl->wCompWindowSize)) {\n\t\t\tLOGE(\"wCompWindowSize should be set\");\n\t\t\tRETURN(UVC_ERROR_INVALID_MODE, uvc_error_t);\n\t\t}\n\t}\n#endif\n\tDL_FOREACH(format->frame_descs, frame)\n\t{\n\t\tif (frame->wWidth != width || frame->wHeight != height)\n\t\t\tcontinue;\n\n\t\tuint32_t *interval;\n\n\t\tif (frame->intervals) {\n\t\t\tfor (interval = frame->intervals; *interval; ++interval) {\n\t\t\t\tif (UNLIKELY(!(*interval))) continue;\n\t\t\t\tuint32_t it = 10000000 / *interval;\n\t\t\t\tLOGV(\"it:%d\", it);\n\t\t\t\tif ((it >= (uint32_t) min_fps) && (it <= (uint32_t) max_fps)) {\n\t\t\t\t\tctrl->bmHint = (1 << 0); /* don't negotiate interval */\n\t\t\t\t\tctrl->bFormatIndex = format->bFormatIndex;\n\t\t\t\t\tctrl->bFrameIndex = frame->bFrameIndex;\n\t\t\t\t\tctrl->dwFrameInterval = *interval;\n\n\t\t\t\t\tgoto found;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tint32_t fps;\n\t\t\tfor (fps = max_fps; fps >= min_fps; fps--) {\n\t\t\t\tif (UNLIKELY(!fps)) continue;\n\t\t\t\tuint32_t interval_100ns = 10000000 / fps;\n\t\t\t\tuint32_t interval_offset = interval_100ns - frame->dwMinFrameInterval;\n\t\t\t\tLOGV(\"fps:%d\", fps);\n\t\t\t\tif (interval_100ns >= frame->dwMinFrameInterval\n\t\t\t\t\t&& interval_100ns <= frame->dwMaxFrameInterval\n\t\t\t\t\t&& !(interval_offset\n\t\t\t\t\t\t&& (interval_offset % frame->dwFrameIntervalStep) ) ) {\n\t\t\t\t\tctrl->bmHint = (1 << 0); /* don't negotiate interval */\n\t\t\t\t\tctrl->bFormatIndex = format->bFormatIndex;\n\t\t\t\t\tctrl->bFrameIndex = frame->bFrameIndex;\n\t\t\t\t\tctrl->dwFrameInterval = interval_100ns;\n\n\t\t\t\t\tgoto found;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tresult = UVC_ERROR_INVALID_MODE;\nfail:\n\tuvc_release_if(devh, ctrl->bInterfaceNumber);\n\tRETURN(result, uvc_error_t);\n\nfound:\n\tRETURN(UVC_SUCCESS, uvc_error_t);\n}\n\n/** Get a negotiated streaming control block for some common parameters.\n * @ingroup streaming\n *\n * @param[in] devh Device handle\n * @param[in,out] ctrl Control block\n * @param[in] cf Type of streaming format\n * @param[in] width Desired frame width\n * @param[in] height Desired frame height\n * @param[in] fps Frame rate, frames per second\n */\nuvc_error_t uvc_get_stream_ctrl_format_size(uvc_device_handle_t *devh,\n\t\tuvc_stream_ctrl_t *ctrl, enum uvc_frame_format cf, int width, int height, int fps) {\n\n\treturn uvc_get_stream_ctrl_format_size_fps(devh, ctrl, cf, width, height, fps, fps);\n}\n\n/** Get a negotiated streaming control block for some common parameters.\n * @ingroup streaming\n *\n * @param[in] devh Device handle\n * @param[in,out] ctrl Control block\n * @param[in] cf Type of streaming format\n * @param[in] width Desired frame width\n * @param[in] height Desired frame height\n * @param[in] min_fps Frame rate, minimum frames per second, this value is included\n * @param[in] max_fps Frame rate, maximum frames per second, this value is included\n */\nuvc_error_t uvc_get_stream_ctrl_format_size_fps(uvc_device_handle_t *devh,\n\t\tuvc_stream_ctrl_t *ctrl, enum uvc_frame_format cf, int width,\n\t\tint height, int min_fps, int max_fps) {\n\n\tENTER();\n\n\tuvc_streaming_interface_t *stream_if;\n\tuvc_error_t result;\n\n\tmemset(ctrl, 0, sizeof(*ctrl));\t// XXX add\n\t/* find a matching frame descriptor and interval */\n\tuvc_format_desc_t *format;\n\tDL_FOREACH(devh->info->stream_ifs, stream_if)\n\t{\n\t\tDL_FOREACH(stream_if->format_descs, format)\n\t\t{\n\t\t\tif (!_uvc_frame_format_matches_guid(cf, format->guidFormat))\n\t\t\t\tcontinue;\n\n\t\t\tresult = _uvc_get_stream_ctrl_format(devh, stream_if, ctrl, format, width, height, min_fps, max_fps);\n\t\t\tif (!result) {\t// UVC_SUCCESS\n\t\t\t\tgoto found;\n\t\t\t}\n\t\t}\n\t}\n\n\tRETURN(UVC_ERROR_INVALID_MODE, uvc_error_t);\n\nfound:\n\tRETURN(uvc_probe_stream_ctrl(devh, ctrl), uvc_error_t);\n}\n\n/** @internal\n * Negotiate streaming parameters with the device\n *\n * @param[in] devh UVC device\n * @param[in,out] ctrl Control block\n */\nuvc_error_t uvc_probe_stream_ctrl(uvc_device_handle_t *devh,\n\t\tuvc_stream_ctrl_t *ctrl) {\n\tuvc_error_t err;\n\n\terr = uvc_claim_if(devh, ctrl->bInterfaceNumber);\n\tif (UNLIKELY(err)) {\n\t\tLOGE(\"uvc_claim_if:err=%d\", err);\n\t\treturn err;\n\t}\n\n\terr = uvc_query_stream_ctrl(devh, ctrl, 1, UVC_SET_CUR);\t// probe query\n\tif (UNLIKELY(err)) {\n\t\tLOGE(\"uvc_query_stream_ctrl(UVC_SET_CUR):err=%d\", err);\n\t\treturn err;\n\t}\n\n\terr = uvc_query_stream_ctrl(devh, ctrl, 1, UVC_GET_CUR);\t// probe query ここでエラーが返ってくる\n\tif (UNLIKELY(err)) {\n\t\tLOGE(\"uvc_query_stream_ctrl(UVC_GET_CUR):err=%d\", err);\n\t\treturn err;\n\t}\n\n\treturn UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Swap the working buffer with the presented buffer and notify consumers\n */\nstatic void _uvc_swap_buffers(uvc_stream_handle_t *strmh) {\n\tuint8_t *tmp_buf;\n\n\tpthread_mutex_lock(&strmh->cb_mutex);\n\t{\n\t\t/* swap the buffers */\n\t\ttmp_buf = strmh->holdbuf;\n\t\tstrmh->hold_bfh_err = strmh->bfh_err;\t// XXX\n\t\tstrmh->hold_bytes = strmh->got_bytes;\n\t\tstrmh->holdbuf = strmh->outbuf;\n\t\tstrmh->outbuf = tmp_buf;\n\t\tstrmh->hold_last_scr = strmh->last_scr;\n\t\tstrmh->hold_pts = strmh->pts;\n\t\tstrmh->hold_seq = strmh->seq;\n\n\t\tpthread_cond_broadcast(&strmh->cb_cond);\n\t}\n\tpthread_mutex_unlock(&strmh->cb_mutex);\n\n\tstrmh->seq++;\n\tstrmh->got_bytes = 0;\n\tstrmh->last_scr = 0;\n\tstrmh->pts = 0;\n\tstrmh->bfh_err = 0;\t// XXX\n}\n\nstatic void _uvc_delete_transfer(struct libusb_transfer *transfer) {\n\tENTER();\n\n//\tMARK(\"\");\n\tuvc_stream_handle_t *strmh = transfer->user_data;\n\tif (UNLIKELY(!strmh)) EXIT();\t\t// XXX\n\tint i;\n\n\tpthread_mutex_lock(&strmh->cb_mutex);\t// XXX crash while calling uvc_stop_streaming\n\t{\n\t\t// Mark transfer as deleted.\n\t\tfor (i = 0; i < LIBUVC_NUM_TRANSFER_BUFS; i++) {\n\t\t\tif (strmh->transfers[i] == transfer) {\n\t\t\t\tlibusb_cancel_transfer(strmh->transfers[i]);\t// XXX 20141112追加\n\t\t\t\tUVC_DEBUG(\"Freeing transfer %d (%p)\", i, transfer);\n\t\t\t\tfree(transfer->buffer);\n\t\t\t\tlibusb_free_transfer(transfer);\n\t\t\t\tstrmh->transfers[i] = NULL;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (UNLIKELY(i == LIBUVC_NUM_TRANSFER_BUFS)) {\n\t\t\tUVC_DEBUG(\"transfer %p not found; not freeing!\", transfer);\n\t\t}\n\n\t\tpthread_cond_broadcast(&strmh->cb_cond);\n\t}\n\tpthread_mutex_unlock(&strmh->cb_mutex);\n\tEXIT();\n}\n\n#define USE_EOF\n\n/** @internal\n * @brief Process a payload transfer\n * \n * Processes stream, places frames into buffer, signals listeners\n * (such as user callback thread and any polling thread) on new frame\n *\n * @param payload Contents of the payload transfer, either a packet (isochronous) or a full\n * transfer (bulk mode)\n * @param payload_len Length of the payload transfer\n */\nstatic void _uvc_process_payload(uvc_stream_handle_t *strmh, const uint8_t *payload, size_t const payload_len) {\n\tsize_t header_len;\n\tuint8_t header_info;\n\tsize_t data_len;\n\tstruct libusb_iso_packet_descriptor *pkt;\n\tuvc_vc_error_code_control_t vc_error_code;\n\tuvc_vs_error_code_control_t vs_error_code;\n\n\t// magic numbers for identifying header packets from some iSight cameras\n\tstatic const uint8_t isight_tag[] = {\n\t\t0x11, 0x22, 0x33, 0x44,\n\t\t0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xfa, 0xce\n\t};\n\n\t// ignore empty payload transfers\n\tif (UNLIKELY(!payload || !payload_len || !strmh->outbuf))\n\t\treturn;\n\n\t/* Certain iSight cameras have strange behavior: They send header\n\t * information in a packet with no image data, and then the following\n  \t * packets have only image data, with no more headers until the next frame.\n\t *\n\t * The iSight header: len(1), flags(1 or 2), 0x11223344(4),\n\t * 0xdeadbeefdeadface(8), ??(16)\n\t*/\n\n\tif (UNLIKELY(strmh->devh->is_isight &&\n\t\t((payload_len < 14) || memcmp(isight_tag, payload + 2, sizeof(isight_tag)) ) &&\n\t\t((payload_len < 15) || memcmp(isight_tag, payload + 3, sizeof(isight_tag)) ) )) {\n\t\t// The payload transfer doesn't have any iSight magic, so it's all image data\n\t\theader_len = 0;\n\t\tdata_len = payload_len;\n\t} else {\n\t\theader_len = payload[0];\n\n\t\tif (UNLIKELY(header_len > payload_len)) {\n\t\t\tstrmh->bfh_err |= UVC_STREAM_ERR;\n\t\t\tUVC_DEBUG(\"bogus packet: actual_len=%zd, header_len=%zd\\n\", payload_len, header_len);\n\t\t\treturn;\n\t\t}\n\n\t\tif (UNLIKELY(strmh->devh->is_isight))\n\t\t\tdata_len = 0;\n\t\telse\n\t\t\tdata_len = payload_len - header_len;\n\t}\n\n\tif (UNLIKELY(header_len < 2)) {\n\t\theader_info = 0;\n\t} else {\n\t\t//  @todo we should be checking the end-of-header bit\n\t\tsize_t variable_offset = 2;\n\n\t\theader_info = payload[1];\n\n\t\tif (UNLIKELY(header_info & UVC_STREAM_ERR)) {\n//\t\t\tstrmh->bfh_err |= UVC_STREAM_ERR;\n\t\t\tUVC_DEBUG(\"bad packet: error bit set\");\n\t\t\tlibusb_clear_halt(strmh->devh->usb_devh, strmh->stream_if->bEndpointAddress);\n//\t\t\tuvc_vc_get_error_code(strmh->devh, &vc_error_code, UVC_GET_CUR);\n\t\t\tuvc_vs_get_error_code(strmh->devh, &vs_error_code, UVC_GET_CUR);\n//\t\t\treturn;\n\t\t}\n\n\t\tif ((strmh->fid != (header_info & UVC_STREAM_FID)) && strmh->got_bytes) {\n\t\t\t/* The frame ID bit was flipped, but we have image data sitting\n\t\t\t\taround from prior transfers. This means the camera didn't send\n\t\t\t\tan EOF for the last transfer of the previous frame. */\n\t\t\t_uvc_swap_buffers(strmh);\n\t\t}\n\n\t\tstrmh->fid = header_info & UVC_STREAM_FID;\n\n\t\tif (header_info & UVC_STREAM_PTS) {\n\t\t\t// XXX saki some camera may send broken packet or failed to receive all data\n\t\t\tif (LIKELY(variable_offset + 4 <= header_len)) {\n\t\t\t\tstrmh->pts = DW_TO_INT(payload + variable_offset);\n\t\t\t\tvariable_offset += 4;\n\t\t\t} else {\n\t\t\t\tMARK(\"bogus packet: header info has UVC_STREAM_PTS, but no data\");\n\t\t\t\tstrmh->pts = 0;\n\t\t\t}\n\t\t}\n\n\t\tif (header_info & UVC_STREAM_SCR) {\n\t\t\t// @todo read the SOF token counter\n\t\t\t// XXX saki some camera may send broken packet or failed to receive all data\n\t\t\tif (LIKELY(variable_offset + 4 <= header_len)) {\n\t\t\t\tstrmh->last_scr = DW_TO_INT(payload + variable_offset);\n\t\t\t\tvariable_offset += 4;\n\t\t\t} else {\n\t\t\t\tMARK(\"bogus packet: header info has UVC_STREAM_SCR, but no data\");\n\t\t\t\tstrmh->last_scr = 0;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (LIKELY(data_len > 0)) {\n\t\tif (LIKELY(strmh->got_bytes + data_len < strmh->size_buf)) {\n\t\t\tmemcpy(strmh->outbuf + strmh->got_bytes, payload + header_len, data_len);\n\t\t\tstrmh->got_bytes += data_len;\n\t\t} else {\n\t\t\tstrmh->bfh_err |= UVC_STREAM_ERR;\n\t\t}\n\n\t\tif (header_info & UVC_STREAM_EOF/*(1 << 1)*/) {\n\t\t\t// The EOF bit is set, so publish the complete frame\n\t\t\t_uvc_swap_buffers(strmh);\n\t\t}\n\t}\n}\n\n#if 0\nstatic inline void _uvc_process_payload_iso(uvc_stream_handle_t *strmh, struct libusb_transfer *transfer) {\n\t/* This is an isochronous mode transfer, so each packet has a payload transfer */\n\tint packet_id;\n\tfor (packet_id = 0; packet_id < transfer->num_iso_packets; packet_id++) {\n\t\tstruct libusb_iso_packet_descriptor *pkt = transfer->iso_packet_desc + packet_id;\n\n\t\tif UNLIKELY(pkt->status) {\n//\t\t\tUVC_DEBUG(\"bad packet:status=%d,actual_length=%d\", pkt->status, pkt->actual_length);\n\t\t\tMARK(\"bad packet:status=%d,actual_length=%d\", pkt->status, pkt->actual_length);\n\t\t\tcontinue;\n\t\t}\n\t\tif UNLIKELY(!pkt->actual_length) {\n\t\t\tMARK(\"zero packet (transfer):\");\n\t\t\tcontinue;\n\t\t}\n\t\t// libusb_get_iso_packet_buffer_simple will return NULL\n\t\tuint8_t *pktbuf = libusb_get_iso_packet_buffer_simple(transfer, packet_id);\n\t\t_uvc_process_payload(strmh, pktbuf, pkt->actual_length);\n\t}\n}\n#else\nstatic inline void _uvc_process_payload_iso(uvc_stream_handle_t *strmh, struct libusb_transfer *transfer) {\n\t/* per packet */\n\tuint8_t *pktbuf;\n\tuint8_t check_header;\n\tsize_t header_len;\n\tuint8_t header_info;\n\tstruct libusb_iso_packet_descriptor *pkt;\n\n\t/* magic numbers for identifying header packets from some iSight cameras */\n\tstatic const uint8_t isight_tag[] = {\n\t\t0x11, 0x22, 0x33, 0x44, 0xde, 0xad,\n\t\t0xbe, 0xef, 0xde, 0xad, 0xfa, 0xce };\n\tint packet_id;\n\tuvc_vc_error_code_control_t vc_error_code;\n\tuvc_vs_error_code_control_t vs_error_code;\n\n\tfor (packet_id = 0; packet_id < transfer->num_iso_packets; ++packet_id) {\n\t\tcheck_header = 1;\n\n\t\tpkt = transfer->iso_packet_desc + packet_id;\n\n\t\tif (UNLIKELY(pkt->status != 0)) {\n\t\t\tMARK(\"bad packet:status=%d,actual_length=%d\", pkt->status, pkt->actual_length);\n\t\t\tstrmh->bfh_err |= UVC_STREAM_ERR;\n\t\t\tlibusb_clear_halt(strmh->devh->usb_devh, strmh->stream_if->bEndpointAddress);\n//\t\t\tuvc_vc_get_error_code(strmh->devh, &vc_error_code, UVC_GET_CUR);\n//\t\t\tuvc_vs_get_error_code(strmh->devh, &vs_error_code, UVC_GET_CUR);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (UNLIKELY(!pkt->actual_length)) {\t// why transfered byte is zero...\n//\t\t\tMARK(\"zero packet (transfer):\");\n//\t\t\tstrmh->bfh_err |= UVC_STREAM_ERR;\t// don't set this flag here\n\t\t\tcontinue;\n\t\t}\n\t\t// XXX accessing to pktbuf could lead to crash on the original implementation\n\t\t// because the substances of pktbuf will be deleted in uvc_stream_stop.\n\t\tpktbuf = libusb_get_iso_packet_buffer_simple(transfer, packet_id);\n\t\tif (LIKELY(pktbuf)) {\t// XXX add null check because libusb_get_iso_packet_buffer_simple could return null\n//\t\t\tassert(pktbuf < transfer->buffer + transfer->length - 1);\t// XXX\n#ifdef __ANDROID__\n\t\t\t// XXX optimaization because this flag never become true on Android devices\n\t\t\tif (UNLIKELY(strmh->devh->is_isight))\n#else\n\t\t\tif (strmh->devh->is_isight)\n#endif\n\t\t\t{\n\t\t\t\tif (pkt->actual_length < 30\n\t\t\t\t\t|| (memcmp(isight_tag, pktbuf + 2, sizeof(isight_tag))\n\t\t\t\t\t\t&& memcmp(isight_tag, pktbuf + 3, sizeof(isight_tag)))) {\n\t\t\t\t\tcheck_header = 0;\n\t\t\t\t\theader_len = 0;\n\t\t\t\t} else {\n\t\t\t\t\theader_len = pktbuf[0];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\theader_len = pktbuf[0];\t// Header length field of Stream Header\n\t\t\t}\n\n\t\t\tif (LIKELY(check_header)) {\n\t\t\t\theader_info = pktbuf[1];\n\t\t\t\tif (UNLIKELY(header_info & UVC_STREAM_ERR)) {\n//\t\t\t\t\tstrmh->bfh_err |= UVC_STREAM_ERR;\n\t\t\t\t\tMARK(\"bad packet:status=0x%2x\", header_info);\n\t\t\t\t\tlibusb_clear_halt(strmh->devh->usb_devh, strmh->stream_if->bEndpointAddress);\n//\t\t\t\t\tuvc_vc_get_error_code(strmh->devh, &vc_error_code, UVC_GET_CUR);\n\t\t\t\t\tuvc_vs_get_error_code(strmh->devh, &vs_error_code, UVC_GET_CUR);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n#ifdef USE_EOF\n\t\t\t\tif ((strmh->fid != (header_info & UVC_STREAM_FID)) && strmh->got_bytes) {\t// got_bytesを取ると殆ど画面更新されない\n\t\t\t\t/* The frame ID bit was flipped, but we have image data sitting\n\t             around from prior transfers. This means the camera didn't send\n    \t\t     an EOF for the last transfer of the previous frame or some frames losted. */\n\t\t\t\t\t_uvc_swap_buffers(strmh);\n\t\t\t\t}\n\t\t\t\tstrmh->fid = header_info & UVC_STREAM_FID;\n#else\n\t\t\t\tif (strmh->fid != (header_info & UVC_STREAM_FID)) {\t// when FID is toggled\n\t\t\t\t\t_uvc_swap_buffers(strmh);\n\t\t\t\t\tstrmh->fid = header_info & UVC_STREAM_FID;\n\t\t\t\t}\n#endif\n\t\t\t\tif (header_info & UVC_STREAM_PTS) {\n\t\t\t\t\t// XXX saki some camera may send broken packet or failed to receive all data\n\t\t\t\t\tif (LIKELY(header_len >= 6)) {\n\t\t\t\t\t\tstrmh->pts = DW_TO_INT(pktbuf + 2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tMARK(\"bogus packet: header info has UVC_STREAM_PTS, but no data\");\n\t\t\t\t\t\tstrmh->pts = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (header_info & UVC_STREAM_SCR) {\n\t\t\t\t\t// XXX saki some camera may send broken packet or failed to receive all data\n\t\t\t\t\tif (LIKELY(header_len >= 10)) {\n\t\t\t\t\t\tstrmh->last_scr = DW_TO_INT(pktbuf + 6);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tMARK(\"bogus packet: header info has UVC_STREAM_SCR, but no data\");\n\t\t\t\t\t\tstrmh->last_scr = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n#ifdef __ANDROID__\t// XXX optimaization because this flag never become true on Android devices\n\t\t\t\tif (UNLIKELY(strmh->devh->is_isight))\n\t\t\t\t\tcontinue; // don't look for data after an iSight header\n#else\n\t\t\t\tif (strmh->devh->is_isight) {\n\t\t\t\t\tMARK(\"is_isight\");\n\t\t\t\t\tcontinue; // don't look for data after an iSight header\n\t\t\t\t}\n#endif\n\t\t\t} // if LIKELY(check_header)\n\n\t\t\tif (UNLIKELY(pkt->actual_length < header_len)) {\n\t\t\t\t/* Bogus packet received */\n\t\t\t\tstrmh->bfh_err |= UVC_STREAM_ERR;\n\t\t\t\tMARK(\"bogus packet: actual_len=%d, header_len=%zd\", pkt->actual_length, header_len);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// XXX original implementation could lead to trouble because unsigned values\n\t\t\t// and there calculated value never become minus.\n\t\t\t// therefor changed to \"if (pkt->actual_length > header_len)\"\n\t\t\t// from \"if (pkt->actual_length - header_len > 0)\"\n\t\t\tif (LIKELY(pkt->actual_length > header_len)) {\n\t\t\t\tconst size_t odd_bytes = pkt->actual_length - header_len;\n\t\t\t\tassert(strmh->got_bytes + odd_bytes < strmh->size_buf);\n\t\t\t\tassert(strmh->outbuf);\n\t\t\t\tassert(pktbuf);\n\t\t\t\tmemcpy(strmh->outbuf + strmh->got_bytes, pktbuf + header_len, odd_bytes);\n\t\t\t\tstrmh->got_bytes += odd_bytes;\n\t\t\t}\n#ifdef USE_EOF\n\t\t\tif ((pktbuf[1] & UVC_STREAM_EOF) && strmh->got_bytes != 0) {\n\t\t\t\t/* The EOF bit is set, so publish the complete frame */\n\t\t\t\t_uvc_swap_buffers(strmh);\n\t\t\t}\n#endif\n\t\t} else {\t// if (LIKELY(pktbuf))\n\t\t\tstrmh->bfh_err |= UVC_STREAM_ERR;\n\t\t\tMARK(\"libusb_get_iso_packet_buffer_simple returned null\");\n\t\t\tcontinue;\n\t\t}\n\t}\t// for\n}\n#endif\n\n/** @internal\n * @brief Isochronous transfer callback\n * \n * Processes stream, places frames into buffer, signals listeners\n * (such as user callback thread and any polling thread) on new frame\n *\n * @param transfer Active transfer\n */\nstatic void _uvc_stream_callback(struct libusb_transfer *transfer) {\n\tif UNLIKELY(!transfer) return;\n\n\tuvc_stream_handle_t *strmh = transfer->user_data;\n\tif UNLIKELY(!strmh) return;\n\n\tint resubmit = 1;\n\n#ifndef NDEBUG\n\tstatic int cnt = 0;\n\tif UNLIKELY((++cnt % 1000) == 0)\n\t\tMARK(\"cnt=%d\", cnt);\n#endif\n\tswitch (transfer->status) {\n\tcase LIBUSB_TRANSFER_COMPLETED:\n\t\tif (!transfer->num_iso_packets) {\n\t\t\t/* This is a bulk mode transfer, so it just has one payload transfer */\n\t\t\t_uvc_process_payload(strmh, transfer->buffer, transfer->actual_length);\n\t\t} else {\n\t\t\t/* This is an isochronous mode transfer, so each packet has a payload transfer */\n\t\t\t_uvc_process_payload_iso(strmh, transfer);\n\t\t}\n\t    break;\n\tcase LIBUSB_TRANSFER_NO_DEVICE:\n\t\tstrmh->running = 0;\t// this needs for unexpected disconnect of cable otherwise hangup\n\t\t// pass through to following lines\n\tcase LIBUSB_TRANSFER_CANCELLED:\n\tcase LIBUSB_TRANSFER_ERROR:\n\t\tUVC_DEBUG(\"not retrying transfer, status = %d\", transfer->status);\n//\t\tMARK(\"not retrying transfer, status = %d\", transfer->status);\n//\t\t_uvc_delete_transfer(transfer);\n\t\tresubmit = 0;\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_TIMED_OUT:\n\tcase LIBUSB_TRANSFER_STALL:\n\tcase LIBUSB_TRANSFER_OVERFLOW:\n\t\tUVC_DEBUG(\"retrying transfer, status = %d\", transfer->status);\n//\t\tMARK(\"retrying transfer, status = %d\", transfer->status);\n\t\tbreak;\n\t}\n\n\tif (LIKELY(strmh->running && resubmit)) {\n\t\tlibusb_submit_transfer(transfer);\n\t} else {\n\t\t// XXX delete non-reusing transfer\n\t\t// real implementation of deleting transfer moves to _uvc_delete_transfer\n\t\t_uvc_delete_transfer(transfer);\n\t}\n}\n\n#if 0\n/** @internal\n * @brief Isochronous transfer callback\n * \n * Processes stream, places frames into buffer, signals listeners\n * (such as user callback thread and any polling thread) on new frame\n *\n * @param transfer Active transfer\n */\nstatic void _uvc_iso_callback(struct libusb_transfer *transfer) {\n\tuvc_stream_handle_t *strmh;\n\tint packet_id;\n\n\t/* per packet */\n\tuint8_t *pktbuf;\n\tuint8_t check_header;\n\tsize_t header_len;\t// XXX unsigned int header_len\n\tuint8_t header_info;\n\tstruct libusb_iso_packet_descriptor *pkt;\n\n\t/* magic numbers for identifying header packets from some iSight cameras */\n\tstatic const uint8_t isight_tag[] = {\n\t\t0x11, 0x22, 0x33, 0x44, 0xde, 0xad,\n\t\t0xbe, 0xef, 0xde, 0xad, 0xfa, 0xce };\n\n\tstrmh = transfer->user_data;\n#ifndef NDEBUG\n\tstatic int cnt = 0;\n\tif ((++cnt % 1000) == 0)\n\t\tMARK(\"cnt=%d\", cnt);\n#endif\n\tswitch (transfer->status) {\n\tcase LIBUSB_TRANSFER_COMPLETED:\n\t\tif (UNLIKELY(!transfer->num_iso_packets))\n\t\t\tMARK(\"num_iso_packets is zero\");\n\t\tfor (packet_id = 0; packet_id < transfer->num_iso_packets; ++packet_id) {\n\t\t\tcheck_header = 1;\n\n\t\t\tpkt = transfer->iso_packet_desc + packet_id;\n\n\t\t\tif (UNLIKELY(pkt->status != 0)) {\n\t\t\t\tMARK(\"bad packet:status=%d,actual_length=%d\", pkt->status, pkt->actual_length);\n\t\t\t\tstrmh->bfh_err |= UVC_STREAM_ERR;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (UNLIKELY(!pkt->actual_length)) {\t// why transfered byte is zero...\n//\t\t\t\tMARK(\"zero packet (transfer):\");\n//\t\t\t\tstrmh->bfh_err |= UVC_STREAM_ERR;\t// don't set this flag here\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// XXX accessing to pktbuf could lead to crash on the original implementation\n\t\t\t// because the substances of pktbuf will be deleted in uvc_stream_stop.\n\t\t\tpktbuf = libusb_get_iso_packet_buffer_simple(transfer, packet_id);\n\t\t\tif (LIKELY(pktbuf)) {\t// XXX add null check because libusb_get_iso_packet_buffer_simple could return null\n//\t\t\t\tassert(pktbuf < transfer->buffer + transfer->length - 1);\t// XXX\n#ifdef __ANDROID__\n\t\t\t\t// XXX optimaization because this flag never become true on Android devices\n\t\t\t\tif (UNLIKELY(strmh->devh->is_isight))\n#else\n\t\t\t\tif (strmh->devh->is_isight)\n#endif\n\t\t\t\t{\n\t\t\t\t\tif (pkt->actual_length < 30\n\t\t\t\t\t\t|| (memcmp(isight_tag, pktbuf + 2, sizeof(isight_tag))\n\t\t\t\t\t\t\t&& memcmp(isight_tag, pktbuf + 3, sizeof(isight_tag)))) {\n\t\t\t\t\t\tcheck_header = 0;\n\t\t\t\t\t\theader_len = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\theader_len = pktbuf[0];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\theader_len = pktbuf[0];\t// Header length field of Stream Header\n\t\t\t\t}\n\n\t\t\t\tif (LIKELY(check_header)) {\n\t\t\t\t\theader_info = pktbuf[1];\n\t\t\t\t\tif (UNLIKELY(header_info & UVC_STREAM_ERR)) {\n\t\t\t\t\t\tstrmh->bfh_err |= UVC_STREAM_ERR;\n\t\t\t\t\t\tMARK(\"bad packet\");\n//\t\t\t\t\t\tlibusb_clear_halt(strmh->devh->usb_devh, strmh->stream_if->bEndpointAddress);\n\t\t\t\t\t\tuvc_vc_get_error_code(strmh->devh, &vc_error_code, UVC_GET_CUR);\n\t\t\t\t\t\tuvc_vs_get_error_code(strmh->devh, &vs_error_code, UVC_GET_CUR);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n#ifdef USE_EOF\n\t\t\t\t\tif ((strmh->fid != (header_info & UVC_STREAM_FID)) && strmh->got_bytes) {\t// got_bytesを取ると殆ど画面更新されない\n\t\t\t\t\t/* The frame ID bit was flipped, but we have image data sitting\n\t\t             around from prior transfers. This means the camera didn't send\n        \t\t     an EOF for the last transfer of the previous frame or some frames losted. */\n\t\t\t\t\t\t_uvc_swap_buffers(strmh);\n\t\t\t\t\t}\n\t\t\t\t\tstrmh->fid = header_info & UVC_STREAM_FID;\n#else\n\t\t\t\t\tif (strmh->fid != (header_info & UVC_STREAM_FID)) {\t// when FID is toggled\n\t\t\t\t\t\t_uvc_swap_buffers(strmh);\n\t\t\t\t\t\tstrmh->fid = header_info & UVC_STREAM_FID;\n\t\t\t\t\t}\n#endif\n\t\t\t\t\tif (header_info & UVC_STREAM_PTS) {\n\t\t\t\t\t\t// XXX saki some camera may send broken packet or failed to receive all data\n\t\t\t\t\t\tif (LIKELY(header_len >= 6)) {\n\t\t\t\t\t\t\tstrmh->pts = DW_TO_INT(pktbuf + 2);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tMARK(\"bogus packet: header info has UVC_STREAM_PTS, but no data\");\n\t\t\t\t\t\t\tstrmh->pts = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (header_info & UVC_STREAM_SCR) {\n\t\t\t\t\t\t// XXX saki some camera may send broken packet or failed to receive all data\n\t\t\t\t\t\tif (LIKELY(header_len >= 10)) {\n\t\t\t\t\t\t\tstrmh->last_scr = DW_TO_INT(pktbuf + 6);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tMARK(\"bogus packet: header info has UVC_STREAM_SCR, but no data\");\n\t\t\t\t\t\t\tstrmh->last_scr = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n#ifdef __ANDROID__\t// XXX optimaization because this flag never become true on Android devices\n\t\t\t\t\tif (UNLIKELY(strmh->devh->is_isight))\n\t\t\t\t\t\tcontinue; // don't look for data after an iSight header\n#else\n\t\t\t\t\tif (strmh->devh->is_isight) {\n\t\t\t\t\t\tMARK(\"is_isight\");\n\t\t\t\t\t\tcontinue; // don't look for data after an iSight header\n\t\t\t\t\t}\n#endif\n\t\t\t\t} // if LIKELY(check_header)\n\n\t\t\t\tif (UNLIKELY(pkt->actual_length < header_len)) {\n\t\t\t\t\t/* Bogus packet received */\n\t\t\t\t\tstrmh->bfh_err |= UVC_STREAM_ERR;\n\t\t\t\t\tMARK(\"bogus packet: actual_len=%d, header_len=%zd\", pkt->actual_length, header_len);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// XXX original implementation could lead to trouble because unsigned values\n\t\t\t\t// and there calculated value never become minus.\n\t\t\t\t// therefor changed to \"if (pkt->actual_length > header_len)\"\n\t\t\t\t// from \"if (pkt->actual_length - header_len > 0)\"\n\t\t\t\tif (LIKELY(pkt->actual_length > header_len)) {\n\t\t\t\t\tconst size_t odd_bytes = pkt->actual_length - header_len;\n\t\t\t\t\tassert(strmh->got_bytes + odd_bytes < strmh->size_buf);\n\t\t\t\t\tassert(strmh->outbuf);\n\t\t\t\t\tassert(pktbuf);\n\t\t\t\t\tmemcpy(strmh->outbuf + strmh->got_bytes, pktbuf + header_len, odd_bytes);\n\t\t\t\t\tstrmh->got_bytes += odd_bytes;\n\t\t\t\t}\n#ifdef USE_EOF\n\t\t\t\tif ((pktbuf[1] & STREAM_HEADER_BFH_EOF) && strmh->got_bytes != 0) {\n\t\t\t\t\t/* The EOF bit is set, so publish the complete frame */\n\t\t\t\t\t_uvc_swap_buffers(strmh);\n\t\t\t\t}\n#endif\n\t\t\t} else {\t// if (LIKELY(pktbuf))\n\t\t\t\tstrmh->bfh_err |= UVC_STREAM_ERR;\n\t\t\t\tMARK(\"libusb_get_iso_packet_buffer_simple returned null\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\t// for\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_NO_DEVICE:\n\t\tstrmh->running = 0;\t// this needs for unexpected disconnect of cable otherwise hangup\n\tcase LIBUSB_TRANSFER_CANCELLED:\n\tcase LIBUSB_TRANSFER_ERROR:\n\t\tUVC_DEBUG(\"not retrying transfer, status = %d\", transfer->status);\n//\t\tMARK(\"not retrying transfer, status = %d\", transfer->status);\n\t\t_uvc_delete_transfer(transfer);\n\t\tbreak;\n\tcase LIBUSB_TRANSFER_TIMED_OUT:\n\tcase LIBUSB_TRANSFER_STALL:\n\tcase LIBUSB_TRANSFER_OVERFLOW:\n\t\tUVC_DEBUG(\"retrying transfer, status = %d\", transfer->status);\n//\t\tMARK(\"retrying transfer, status = %d\", transfer->status);\n\t\tbreak;\n\t}\n\n\tif (LIKELY(strmh->running)) {\n\t\tlibusb_submit_transfer(transfer);\n\t} else {\n\t\t// XXX delete non-reusing transfer\n\t\t// real implementation of deleting transfer moves to _uvc_delete_transfer\n\t\t_uvc_delete_transfer(transfer);\n\t}\n}\n#endif\n\n/** Begin streaming video from the camera into the callback function.\n * @ingroup streaming\n *\n * @param devh UVC device\n * @param ctrl Control block, processed using {uvc_probe_stream_ctrl} or\n *             {uvc_get_stream_ctrl_format_size}\n * @param cb   User callback function. See {uvc_frame_callback_t} for restrictions.\n * @param flags Stream setup flags, currently undefined. Set this to zero. The lower bit\n * is reserved for backward compatibility.\n */\nuvc_error_t uvc_start_streaming(uvc_device_handle_t *devh,\n\t\tuvc_stream_ctrl_t *ctrl, uvc_frame_callback_t *cb, void *user_ptr,\n\t\tuint8_t flags) {\n\treturn uvc_start_streaming_bandwidth(devh, ctrl, cb, user_ptr, 0, flags);\n}\n\n/** Begin streaming video from the camera into the callback function.\n * @ingroup streaming\n *\n * @param devh UVC device\n * @param ctrl Control block, processed using {uvc_probe_stream_ctrl} or\n *             {uvc_get_stream_ctrl_format_size}\n * @param cb   User callback function. See {uvc_frame_callback_t} for restrictions.\n * @param bandwidth_factor [0.0f, 1.0f]\n * @param flags Stream setup flags, currently undefined. Set this to zero. The lower bit\n * is reserved for backward compatibility.\n */\nuvc_error_t uvc_start_streaming_bandwidth(uvc_device_handle_t *devh,\n\t\tuvc_stream_ctrl_t *ctrl, uvc_frame_callback_t *cb, void *user_ptr,\n\t\tfloat bandwidth_factor,\n\t\tuint8_t flags) {\n\tuvc_error_t ret;\n\tuvc_stream_handle_t *strmh;\n\n\tret = uvc_stream_open_ctrl(devh, &strmh, ctrl);\n\tif (UNLIKELY(ret != UVC_SUCCESS))\n\t\treturn ret;\n\n\tret = uvc_stream_start_bandwidth(strmh, cb, user_ptr, bandwidth_factor, flags);\n\tif (UNLIKELY(ret != UVC_SUCCESS)) {\n\t\tuvc_stream_close(strmh);\n\t\treturn ret;\n\t}\n\n\treturn UVC_SUCCESS;\n}\n\n/** Begin streaming video from the camera into the callback function.\n * @ingroup streaming\n *\n * @deprecated The stream type (bulk vs. isochronous) will be determined by the\n * type of interface associated with the uvc_stream_ctrl_t parameter, regardless\n * of whether the caller requests isochronous streaming. Please switch to\n * uvc_start_streaming().\n *\n * @param devh UVC device\n * @param ctrl Control block, processed using {uvc_probe_stream_ctrl} or\n *             {uvc_get_stream_ctrl_format_size}\n * @param cb   User callback function. See {uvc_frame_callback_t} for restrictions.\n */\nuvc_error_t uvc_start_iso_streaming(uvc_device_handle_t *devh,\n\t\tuvc_stream_ctrl_t *ctrl, uvc_frame_callback_t *cb, void *user_ptr) {\n\treturn uvc_start_streaming_bandwidth(devh, ctrl, cb, user_ptr, 0.0f, 0);\n}\n\nstatic uvc_stream_handle_t *_uvc_get_stream_by_interface(\n\t\tuvc_device_handle_t *devh, int interface_idx) {\n\tuvc_stream_handle_t *strmh;\n\n\tDL_FOREACH(devh->streams, strmh)\n\t{\n\t\tif (strmh->stream_if->bInterfaceNumber == interface_idx)\n\t\t\treturn strmh;\n\t}\n\n\treturn NULL;\n}\n\nstatic uvc_streaming_interface_t *_uvc_get_stream_if(uvc_device_handle_t *devh,\n\t\tint interface_idx) {\n\tuvc_streaming_interface_t *stream_if;\n\n\tDL_FOREACH(devh->info->stream_ifs, stream_if)\n\t{\n\t\tif (stream_if->bInterfaceNumber == interface_idx)\n\t\t\treturn stream_if;\n\t}\n\n\treturn NULL;\n}\n\n/** Open a new video stream.\n * @ingroup streaming\n *\n * @param devh UVC device\n * @param ctrl Control block, processed using {uvc_probe_stream_ctrl} or\n *             {uvc_get_stream_ctrl_format_size}\n */\nuvc_error_t uvc_stream_open_ctrl(uvc_device_handle_t *devh,\n\t\tuvc_stream_handle_t **strmhp, uvc_stream_ctrl_t *ctrl) {\n\t/* Chosen frame and format descriptors */\n\tuvc_stream_handle_t *strmh = NULL;\n\tuvc_streaming_interface_t *stream_if;\n\tuvc_error_t ret;\n\n\tUVC_ENTER();\n\n\tif (UNLIKELY(_uvc_get_stream_by_interface(devh, ctrl->bInterfaceNumber) != NULL)) {\n\t\tret = UVC_ERROR_BUSY; /* Stream is already opened */\n\t\tgoto fail;\n\t}\n\n\tstream_if = _uvc_get_stream_if(devh, ctrl->bInterfaceNumber);\n\tif (UNLIKELY(!stream_if)) {\n\t\tret = UVC_ERROR_INVALID_PARAM;\n\t\tgoto fail;\n\t}\n\n\tstrmh = calloc(1, sizeof(*strmh));\n\tif (UNLIKELY(!strmh)) {\n\t\tret = UVC_ERROR_NO_MEM;\n\t\tgoto fail;\n\t}\n\tstrmh->devh = devh;\n\tstrmh->stream_if = stream_if;\n\tstrmh->frame.library_owns_data = 1;\n\n\tret = uvc_claim_if(strmh->devh, strmh->stream_if->bInterfaceNumber);\n\tif (UNLIKELY(ret != UVC_SUCCESS))\n\t\tgoto fail;\n\n\tret = uvc_stream_ctrl(strmh, ctrl);\n\tif (UNLIKELY(ret != UVC_SUCCESS))\n\t\tgoto fail;\n\n\t// Set up the streaming status and data space\n\tstrmh->running = 0;\n\t/** @todo take only what we need */\n\tstrmh->outbuf = malloc(LIBUVC_XFER_BUF_SIZE);\n\tstrmh->holdbuf = malloc(LIBUVC_XFER_BUF_SIZE);\n\tstrmh->size_buf = LIBUVC_XFER_BUF_SIZE;\t// xxx for boundary check\n\n\tpthread_mutex_init(&strmh->cb_mutex, NULL);\n\tpthread_cond_init(&strmh->cb_cond, NULL);\n\n\tDL_APPEND(devh->streams, strmh);\n\n\t*strmhp = strmh;\n\n\tUVC_EXIT(0);\n\treturn UVC_SUCCESS;\n\nfail:\n\tif (strmh)\n\t\tfree(strmh);\n\tUVC_EXIT(ret);\n\treturn ret;\n}\n\n/** Begin streaming video from the stream into the callback function.\n * @ingroup streaming\n *\n * @param strmh UVC stream\n * @param cb   User callback function. See {uvc_frame_callback_t} for restrictions.\n * @param flags Stream setup flags, currently undefined. Set this to zero. The lower bit\n * is reserved for backward compatibility.\n */\nuvc_error_t uvc_stream_start(uvc_stream_handle_t *strmh,\n\t\tuvc_frame_callback_t *cb, void *user_ptr, uint8_t flags) {\n\treturn uvc_stream_start_bandwidth(strmh, cb, user_ptr, 0, flags);\n}\n\n/** Begin streaming video from the stream into the callback function.\n * @ingroup streaming\n *\n * @param strmh UVC stream\n * @param cb   User callback function. See {uvc_frame_callback_t} for restrictions.\n * @param bandwidth_factor [0.0f, 1.0f]\n * @param flags Stream setup flags, currently undefined. Set this to zero. The lower bit\n * is reserved for backward compatibility.\n */\nuvc_error_t uvc_stream_start_bandwidth(uvc_stream_handle_t *strmh,\n\t\tuvc_frame_callback_t *cb, void *user_ptr, float bandwidth_factor, uint8_t flags) {\n\t/* USB interface we'll be using */\n\tconst struct libusb_interface *interface;\n\tint interface_id;\n\tchar isochronous;\n\tuvc_frame_desc_t *frame_desc;\n\tuvc_format_desc_t *format_desc;\n\tuvc_stream_ctrl_t *ctrl;\n\tuvc_error_t ret;\n\t/* Total amount of data per transfer */\n\tsize_t total_transfer_size;\n\tstruct libusb_transfer *transfer;\n\tint transfer_id;\n\n\tctrl = &strmh->cur_ctrl;\n\n\tUVC_ENTER();\n\n\tif (UNLIKELY(strmh->running)) {\n\t\tUVC_EXIT(UVC_ERROR_BUSY);\n\t\treturn UVC_ERROR_BUSY;\n\t}\n\n\tstrmh->running = 1;\n\tstrmh->seq = 0;\n\tstrmh->fid = 0;\n\tstrmh->pts = 0;\n\tstrmh->last_scr = 0;\n\tstrmh->bfh_err = 0;\t// XXX\n\n\tframe_desc = uvc_find_frame_desc_stream(strmh, ctrl->bFormatIndex, ctrl->bFrameIndex);\n\tif (UNLIKELY(!frame_desc)) {\n\t\tret = UVC_ERROR_INVALID_PARAM;\n\t\tLOGE(\"UVC_ERROR_INVALID_PARAM\");\n\t\tgoto fail;\n\t}\n\tformat_desc = frame_desc->parent;\n\n\tstrmh->frame_format = uvc_frame_format_for_guid(format_desc->guidFormat);\n\tif (UNLIKELY(strmh->frame_format == UVC_FRAME_FORMAT_UNKNOWN)) {\n\t\tret = UVC_ERROR_NOT_SUPPORTED;\n\t\tLOGE(\"unlnown frame format\");\n\t\tgoto fail;\n\t}\n\tconst uint32_t dwMaxVideoFrameSize = ctrl->dwMaxVideoFrameSize <= frame_desc->dwMaxVideoFrameBufferSize\n\t\t? ctrl->dwMaxVideoFrameSize : frame_desc->dwMaxVideoFrameBufferSize;\n\n\t// Get the interface that provides the chosen format and frame configuration\n\tinterface_id = strmh->stream_if->bInterfaceNumber;\n\tinterface = &strmh->devh->info->config->interface[interface_id];\n\n\t/* A VS interface uses isochronous transfers if it has multiple altsettings.\n\t * (UVC 1.5: 2.4.3. VideoStreaming Interface, on page 19) */\n\tisochronous = interface->num_altsetting > 1;\n\n\tif (isochronous) {\n\t\tMARK(\"isochronous transfer mode:num_altsetting=%d\", interface->num_altsetting);\n\t\t/* For isochronous streaming, we choose an appropriate altsetting for the endpoint\n\t\t * and set up several transfers */\n\t\tconst struct libusb_interface_descriptor *altsetting;\n\t\tconst struct libusb_endpoint_descriptor *endpoint;\n\t\t/* The greatest number of bytes that the device might provide, per packet, in this\n\t\t * configuration */\n\t\tsize_t config_bytes_per_packet;\n\t\t/* Number of packets per transfer */\n\t\tsize_t packets_per_transfer;\n\t\t/* Total amount of data per transfer */\n\t\tsize_t total_transfer_size;\n\t\t/* Size of packet transferable from the chosen endpoint */\n\t\tsize_t endpoint_bytes_per_packet;\n\t\t/* Index of the altsetting */\n\t\tint alt_idx, ep_idx;\n\n\t\tstruct libusb_transfer *transfer;\n\t\tint transfer_id;\n\t\t\n\t\tif ((bandwidth_factor > 0) && (bandwidth_factor < 1.0f)) {\n\t\t\tconfig_bytes_per_packet = (size_t)(strmh->cur_ctrl.dwMaxPayloadTransferSize * bandwidth_factor);\n\t\t\tif (!config_bytes_per_packet) {\n\t\t\t\tconfig_bytes_per_packet = strmh->cur_ctrl.dwMaxPayloadTransferSize;\n\t\t\t}\n\t\t} else {\n\t\t\tconfig_bytes_per_packet = strmh->cur_ctrl.dwMaxPayloadTransferSize;\n\t\t}\n//#if !defined(__LP64__)\n//\t\tLOGI(\"config_bytes_per_packet=%d\", config_bytes_per_packet);\n//#else\n//\t\tLOGI(\"config_bytes_per_packet=%ld\", config_bytes_per_packet);\n//#endif\n\t\tif (UNLIKELY(!config_bytes_per_packet)) {\t// XXX added to privent zero divided exception at the following code\n\t\t\tret = UVC_ERROR_IO;\n\t\t\tLOGE(\"config_bytes_per_packet is zero\");\n\t\t\tgoto fail;\n\t\t}\n\n\t\t/* Go through the altsettings and find one whose packets are at least\n\t\t * as big as our format's maximum per-packet usage. Assume that the\n\t\t * packet sizes are increasing. */\n\t\tconst int num_alt = interface->num_altsetting - 1;\n\t\tfor (alt_idx = 0; alt_idx <= num_alt ; alt_idx++) {\n\t\t\taltsetting = interface->altsetting + alt_idx;\n\t\t\tendpoint_bytes_per_packet = 0;\n\n\t\t\t/* Find the endpoint with the number specified in the VS header */\n\t\t\tfor (ep_idx = 0; ep_idx < altsetting->bNumEndpoints; ep_idx++) {\n\t\t\t\tendpoint = altsetting->endpoint + ep_idx;\n\t\t\t\tif (endpoint->bEndpointAddress == format_desc->parent->bEndpointAddress) {\n\t\t\t\t\tendpoint_bytes_per_packet = endpoint->wMaxPacketSize;\n\t\t\t\t\t// wMaxPacketSize: [unused:2 (multiplier-1):3 size:11]\n\t\t\t\t\t// bit10…0:\t\tmaximum packet size\n\t\t\t\t\t// bit12…11:\tthe number of additional transaction opportunities per microframe for high-speed\n\t\t\t\t\t//\t\t\t\t00 = None (1 transaction per microframe)\n\t\t\t\t\t//\t\t\t\t01 = 1 additional (2 per microframe)\n\t\t\t\t\t//\t\t\t\t10 = 2 additional (3 per microframe)\n\t\t\t\t\t//\t\t\t\t11 = Reserved\n\t\t\t\t\tendpoint_bytes_per_packet\n\t\t\t\t\t\t= (endpoint_bytes_per_packet & 0x07ff)\n\t\t\t\t\t\t\t* (((endpoint_bytes_per_packet >> 11) & 3) + 1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// XXX config_bytes_per_packet should not be zero otherwise zero divided exception occur\n\t\t\tif (LIKELY(endpoint_bytes_per_packet)) {\n\t\t\t\tif ( (endpoint_bytes_per_packet >= config_bytes_per_packet)\n\t\t\t\t\t|| (alt_idx == num_alt) ) {\t// XXX always match to last altsetting for buggy device\n\t\t\t\t\t/* Transfers will be at most one frame long: Divide the maximum frame size\n\t\t\t\t\t * by the size of the endpoint and round up */\n\t\t\t\t\tpackets_per_transfer = (dwMaxVideoFrameSize\n\t\t\t\t\t\t\t+ endpoint_bytes_per_packet - 1)\n\t\t\t\t\t\t\t/ endpoint_bytes_per_packet;\t\t// XXX cashed by zero divided exception occured\n\n\t\t\t\t\t/* But keep a reasonable limit: Otherwise we start dropping data */\n\t\t\t\t\tif (packets_per_transfer > 32)\n\t\t\t\t\t\tpackets_per_transfer = 32;\n\n\t\t\t\t\ttotal_transfer_size = packets_per_transfer * endpoint_bytes_per_packet;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (UNLIKELY(!endpoint_bytes_per_packet)) {\n\t\t\tLOGE(\"endpoint_bytes_per_packet is zero\");\n\t\t\tret = UVC_ERROR_INVALID_MODE;\n\t\t\tgoto fail;\n\t\t}\n\t\tif (UNLIKELY(!total_transfer_size)) {\n\t\t\tLOGE(\"total_transfer_size is zero\");\n\t\t\tret = UVC_ERROR_INVALID_MODE;\n\t\t\tgoto fail;\n\t\t}\n\n\t\t/* If we searched through all the altsettings and found nothing usable */\n/*\t\tif (UNLIKELY(alt_idx == interface->num_altsetting)) {\t// XXX never hit this condition\n\t\t\tUVC_DEBUG(\"libusb_set_interface_alt_setting failed\");\n\t\t\tret = UVC_ERROR_INVALID_MODE;\n\t\t\tgoto fail;\n\t\t} */\n\n\t\t/* Select the altsetting */\n\t\tMARK(\"Select the altsetting\");\n\t\tret = libusb_set_interface_alt_setting(strmh->devh->usb_devh,\n\t\t\t\taltsetting->bInterfaceNumber, altsetting->bAlternateSetting);\n\t\tif (UNLIKELY(ret != UVC_SUCCESS)) {\n\t\t\tUVC_DEBUG(\"libusb_set_interface_alt_setting failed\");\n\t\t\tgoto fail;\n\t\t}\n\n\t\t/* Set up the transfers */\n\t\tMARK(\"Set up the transfers\");\n\t\tfor (transfer_id = 0; transfer_id < LIBUVC_NUM_TRANSFER_BUFS; ++transfer_id) {\n\t\t\ttransfer = libusb_alloc_transfer(packets_per_transfer);\n\t\t\tstrmh->transfers[transfer_id] = transfer;\n\t\t\tstrmh->transfer_bufs[transfer_id] = malloc(total_transfer_size);\n\n\t\t\tlibusb_fill_iso_transfer(transfer, strmh->devh->usb_devh,\n\t\t\t\tformat_desc->parent->bEndpointAddress,\n\t\t\t\tstrmh->transfer_bufs[transfer_id], total_transfer_size,\n\t\t\t\tpackets_per_transfer, _uvc_stream_callback,\n\t\t\t\t(void*) strmh, 5000);\n\n\t\t\tlibusb_set_iso_packet_lengths(transfer, endpoint_bytes_per_packet);\n\t\t}\n\t} else {\n\t\tMARK(\"bulk transfer mode\");\n\t\t/** prepare for bulk transfer */\n\t\tfor (transfer_id = 0; transfer_id < LIBUVC_NUM_TRANSFER_BUFS; ++transfer_id) {\n\t\t\ttransfer = libusb_alloc_transfer(0);\n\t\t\tstrmh->transfers[transfer_id] = transfer;\n\t\t\tstrmh->transfer_bufs[transfer_id] = malloc(strmh->cur_ctrl.dwMaxPayloadTransferSize);\n\t\t\tlibusb_fill_bulk_transfer(transfer, strmh->devh->usb_devh,\n\t\t\t\tformat_desc->parent->bEndpointAddress,\n\t\t\t\tstrmh->transfer_bufs[transfer_id],\n\t\t\t\tstrmh->cur_ctrl.dwMaxPayloadTransferSize, _uvc_stream_callback,\n\t\t\t\t(void *)strmh, 5000);\n\t\t}\n\t}\n\n\tstrmh->user_cb = cb;\n\tstrmh->user_ptr = user_ptr;\n\n\t/* If the user wants it, set up a thread that calls the user's function\n\t * with the contents of each frame.\n\t */\n\tMARK(\"create callback thread\");\n\tif LIKELY(cb) {\n\t\tpthread_create(&strmh->cb_thread, NULL, _uvc_user_caller, (void*) strmh);\n\t}\n\tMARK(\"submit transfers\");\n\tfor (transfer_id = 0; transfer_id < LIBUVC_NUM_TRANSFER_BUFS; transfer_id++) {\n\t\tret = libusb_submit_transfer(strmh->transfers[transfer_id]);\n\t\tif (UNLIKELY(ret != UVC_SUCCESS)) {\n\t\t\tUVC_DEBUG(\"libusb_submit_transfer failed\");\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (UNLIKELY(ret != UVC_SUCCESS)) {\n\t\t/** @todo clean up transfers and memory */\n\t\tgoto fail;\n\t}\n\n\tUVC_EXIT(ret);\n\treturn ret;\nfail:\n\tLOGE(\"fail\");\n\tstrmh->running = 0;\n\tUVC_EXIT(ret);\n\treturn ret;\n}\n\n/** Begin streaming video from the stream into the callback function.\n * @ingroup streaming\n *\n * @deprecated The stream type (bulk vs. isochronous) will be determined by the\n * type of interface associated with the uvc_stream_ctrl_t parameter, regardless\n * of whether the caller requests isochronous streaming. Please switch to\n * uvc_stream_start().\n *\n * @param strmh UVC stream\n * @param cb   User callback function. See {uvc_frame_callback_t} for restrictions.\n */\nuvc_error_t uvc_stream_start_iso(uvc_stream_handle_t *strmh,\n\t\tuvc_frame_callback_t *cb, void *user_ptr) {\n\treturn uvc_stream_start(strmh, cb, user_ptr, 0);\n}\n\n/** @internal\n * @brief User callback runner thread\n * @note There should be at most one of these per currently streaming device\n * @param arg Device handle\n */\nstatic void *_uvc_user_caller(void *arg) {\n\tuvc_stream_handle_t *strmh = (uvc_stream_handle_t *) arg;\n\n\tuint32_t last_seq = 0;\n\n\tfor (; 1 ;) {\n\t\tpthread_mutex_lock(&strmh->cb_mutex);\n\t\t{\n\t\t\tfor (; strmh->running && (last_seq == strmh->hold_seq) ;) {\n\t\t\t\tpthread_cond_wait(&strmh->cb_cond, &strmh->cb_mutex);\n\t\t\t}\n\n\t\t\tif (UNLIKELY(!strmh->running)) {\n\t\t\t\tpthread_mutex_unlock(&strmh->cb_mutex);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlast_seq = strmh->hold_seq;\n\t\t\tif (LIKELY(!strmh->hold_bfh_err))\t// XXX\n\t\t\t\t_uvc_populate_frame(strmh);\n\t\t}\n\t\tpthread_mutex_unlock(&strmh->cb_mutex);\n\n\t\tif (LIKELY(!strmh->hold_bfh_err))\t// XXX\n\t\t\tstrmh->user_cb(&strmh->frame, strmh->user_ptr);\t// call user callback function\n\t}\n\n\treturn NULL; // return value ignored\n}\n\n/** @internal\n * @brief Populate the fields of a frame to be handed to user code\n * must be called with stream cb lock held!\n */\nvoid _uvc_populate_frame(uvc_stream_handle_t *strmh) {\n\tsize_t alloc_size = strmh->cur_ctrl.dwMaxVideoFrameSize;\n\tuvc_frame_t *frame = &strmh->frame;\n\tuvc_frame_desc_t *frame_desc;\n\n\t/** @todo this stuff that hits the main config cache should really happen\n\t * in start() so that only one thread hits these data. all of this stuff\n\t * is going to be reopen_on_change anyway\n\t */\n\n\tframe_desc = uvc_find_frame_desc(strmh->devh, strmh->cur_ctrl.bFormatIndex,\n\t\t\tstrmh->cur_ctrl.bFrameIndex);\n\n\tframe->frame_format = strmh->frame_format;\n\n\tframe->width = frame_desc->wWidth;\n\tframe->height = frame_desc->wHeight;\n\t// XXX set actual_bytes to zero when erro bits is on\n\tframe->actual_bytes = LIKELY(!strmh->hold_bfh_err) ? strmh->hold_bytes : 0;\n\n\tswitch (frame->frame_format) {\n\tcase UVC_FRAME_FORMAT_YUYV:\n\t\tframe->step = frame->width * 2;\n\t\tbreak;\n\tcase UVC_FRAME_FORMAT_MJPEG:\n\t\tframe->step = 0;\n\t\tbreak;\n\tdefault:\n\t\tframe->step = 0;\n\t\tbreak;\n\t}\n\n\t/* copy the image data from the hold buffer to the frame (unnecessary extra buf?) */\n\tif (UNLIKELY(frame->data_bytes < strmh->hold_bytes)) {\n\t\tframe->data = realloc(frame->data, strmh->hold_bytes);\t// TODO add error handling when failed realloc\n\t\tframe->data_bytes = strmh->hold_bytes;\n\t}\n\tmemcpy(frame->data, strmh->holdbuf, strmh->hold_bytes/*frame->data_bytes*/);\t// XXX\n\n\t/** @todo set the frame time */\n}\n\n/** Poll for a frame\n * @ingroup streaming\n *\n * @param devh UVC device\n * @param[out] frame Location to store pointer to captured frame (NULL on error)\n * @param timeout_us >0: Wait at most N microseconds; 0: Wait indefinitely; -1: return immediately\n */\nuvc_error_t uvc_stream_get_frame(uvc_stream_handle_t *strmh,\n\t\tuvc_frame_t **frame, int32_t timeout_us) {\n\ttime_t add_secs;\n\ttime_t add_nsecs;\n\tstruct timespec ts;\n\tstruct timeval tv;\n\n\tif (UNLIKELY(!strmh->running))\n\t\treturn UVC_ERROR_INVALID_PARAM;\n\n\tif (UNLIKELY(strmh->user_cb))\n\t\treturn UVC_ERROR_CALLBACK_EXISTS;\n\n\tpthread_mutex_lock(&strmh->cb_mutex);\n\t{\n\t\tif (strmh->last_polled_seq < strmh->hold_seq) {\n\t\t\t_uvc_populate_frame(strmh);\n\t\t\t*frame = &strmh->frame;\n\t\t\tstrmh->last_polled_seq = strmh->hold_seq;\n\t\t} else if (timeout_us != -1) {\n\t\t\tif (!timeout_us) {\n\t\t\t\tpthread_cond_wait(&strmh->cb_cond, &strmh->cb_mutex);\n\t\t\t} else {\n\t\t\t\tadd_secs = timeout_us / 1000000;\n\t\t\t\tadd_nsecs = (timeout_us % 1000000) * 1000;\n\t\t\t\tts.tv_sec = 0;\n\t\t\t\tts.tv_nsec = 0;\n\n#if _POSIX_TIMERS > 0\n\t\t\t\tclock_gettime(CLOCK_REALTIME, &ts);\n#else\n\t\t\t\tgettimeofday(&tv, NULL);\n\t\t\t\tts.tv_sec = tv.tv_sec;\n\t\t\t\tts.tv_nsec = tv.tv_usec * 1000;\n#endif\n\n\t\t\t\tts.tv_sec += add_secs;\n\t\t\t\tts.tv_nsec += add_nsecs;\n\n\t\t\t\tpthread_cond_timedwait(&strmh->cb_cond, &strmh->cb_mutex, &ts);\n\t\t\t}\n\n\t\t\tif (LIKELY(strmh->last_polled_seq < strmh->hold_seq)) {\n\t\t\t\t_uvc_populate_frame(strmh);\n\t\t\t\t*frame = &strmh->frame;\n\t\t\t\tstrmh->last_polled_seq = strmh->hold_seq;\n\t\t\t} else {\n\t\t\t\t*frame = NULL;\n\t\t\t}\n\t\t} else {\n\t\t\t*frame = NULL;\n\t\t}\n\t}\n\tpthread_mutex_unlock(&strmh->cb_mutex);\n\n\treturn UVC_SUCCESS;\n}\n\n/** @brief Stop streaming video\n * @ingroup streaming\n *\n * Closes all streams, ends threads and cancels pollers\n *\n * @param devh UVC device\n */\nvoid uvc_stop_streaming(uvc_device_handle_t *devh) {\n\tuvc_stream_handle_t *strmh, *strmh_tmp;\n\n\tUVC_ENTER();\n\tDL_FOREACH_SAFE(devh->streams, strmh, strmh_tmp)\n\t{\n\t\tuvc_stream_close(strmh);\n\t}\n\tUVC_EXIT_VOID();\n}\n\n/** @brief Stop stream.\n * @ingroup streaming\n *\n * Stops stream, ends threads and cancels pollers\n *\n * @param devh UVC device\n */\nuvc_error_t uvc_stream_stop(uvc_stream_handle_t *strmh) {\n\n\tint i;\n\tENTER();\n\n\tif (!strmh) RETURN(UVC_SUCCESS, uvc_error_t);\n\n\tif (UNLIKELY(!strmh->running)) {\n\t\tUVC_EXIT(UVC_ERROR_INVALID_PARAM);\n\t\tRETURN(UVC_ERROR_INVALID_PARAM, uvc_error_t);\n\t}\n\n\tstrmh->running = 0;\n\n\tpthread_mutex_lock(&strmh->cb_mutex);\n\t{\n\t\tfor (i = 0; i < LIBUVC_NUM_TRANSFER_BUFS; i++) {\n\t\t\tif (strmh->transfers[i]) {\n\t\t\t\tint res = libusb_cancel_transfer(strmh->transfers[i]);\n\t\t\t\tif ((res < 0) && (res != LIBUSB_ERROR_NOT_FOUND)) {\n\t\t\t\t\tUVC_DEBUG(\"libusb_cancel_transfer failed\");\n\t\t\t\t\t// XXX originally freed buffers and transfer here\n\t\t\t\t\t// but this could lead to crash in _uvc_callback\n\t\t\t\t\t// therefore we comment out these lines\n\t\t\t\t\t// and free these objects in _uvc_iso_callback when strmh->running is false\n/*\t\t\t\t\tfree(strmh->transfers[i]->buffer);\n\t\t\t\t\tlibusb_free_transfer(strmh->transfers[i]);\n\t\t\t\t\tstrmh->transfers[i] = NULL; */\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Wait for transfers to complete/cancel */\n\t\tfor (; 1 ;) {\n\t\t\tfor (i = 0; i < LIBUVC_NUM_TRANSFER_BUFS; i++) {\n\t\t\t\tif (strmh->transfers[i] != NULL)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (i == LIBUVC_NUM_TRANSFER_BUFS)\n\t\t\t\tbreak;\n\t\t\tpthread_cond_wait(&strmh->cb_cond, &strmh->cb_mutex);\n\t\t}\n\t\t// Kick the user thread awake\n\t\tpthread_cond_broadcast(&strmh->cb_cond);\n\t}\n\tpthread_mutex_unlock(&strmh->cb_mutex);\n\n\t/** @todo stop the actual stream, camera side? */\n\n\tif (strmh->user_cb) {\n\t\t/* wait for the thread to stop (triggered by LIBUSB_TRANSFER_CANCELLED transfer) */\n\t\tpthread_join(strmh->cb_thread, NULL);\n\t}\n\n\tRETURN(UVC_SUCCESS, uvc_error_t);\n}\n\n/** @brief Close stream.\n * @ingroup streaming\n *\n * Closes stream, frees handle and all streaming resources.\n *\n * @param strmh UVC stream handle\n */\nvoid uvc_stream_close(uvc_stream_handle_t *strmh) {\n\tUVC_ENTER();\n\n\tif (!strmh) { UVC_EXIT_VOID() };\n\n\tif (strmh->running)\n\t\tuvc_stream_stop(strmh);\n\n\tuvc_release_if(strmh->devh, strmh->stream_if->bInterfaceNumber);\n\n\tif (strmh->frame.data) {\n\t\tfree(strmh->frame.data);\n\t\tstrmh->frame.data = NULL;\n\t}\n\n\tif (strmh->outbuf) {\n\t\tfree(strmh->outbuf);\n\t\tstrmh->outbuf = NULL;\n\t}\n\tif (strmh->holdbuf) {\n\t\tfree(strmh->holdbuf);\n\t\tstrmh->holdbuf = NULL;\n\t}\n\n\tpthread_cond_destroy(&strmh->cb_cond);\n\tpthread_mutex_destroy(&strmh->cb_mutex);\n\n\tDL_DELETE(strmh->devh->streams, strmh);\n\tfree(strmh);\n\n\tUVC_EXIT_VOID();\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/stream_original.c",
    "content": "/*********************************************************************\n* Software License Agreement (BSD License)\n*\n*  Copyright (C) 2010-2012 Ken Tossell\n*  All rights reserved.\n*\n*  Redistribution and use in source and binary forms, with or without\n*  modification, are permitted provided that the following conditions\n*  are met:\n*\n*   * Redistributions of source code must retain the above copyright\n*     notice, this list of conditions and the following disclaimer.\n*   * Redistributions in binary form must reproduce the above\n*     copyright notice, this list of conditions and the following\n*     disclaimer in the documentation and/or other materials provided\n*     with the distribution.\n*   * Neither the name of the author nor other contributors may be\n*     used to endorse or promote products derived from this software\n*     without specific prior written permission.\n*\n*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n*  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n*  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n*  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n*  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n*  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n*  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n*  POSSIBILITY OF SUCH DAMAGE.\n*********************************************************************/\n/**\n * @defgroup streaming Streaming control functions\n */\n\n#include \"libuvc/libuvc.h\"\n#include \"libuvc/libuvc_internal.h\"\n\nuvc_frame_desc_t *uvc_find_frame_desc_stream(uvc_stream_handle_t *strmh,\n    uint16_t format_id, uint16_t frame_id);\nuvc_frame_desc_t *uvc_find_frame_desc(uvc_device_handle_t *devh,\n    uint16_t format_id, uint16_t frame_id);\nvoid *_uvc_user_caller(void *arg);\nvoid _uvc_populate_frame(uvc_stream_handle_t *strmh);\n\nstruct format_table_entry {\n  enum uvc_frame_format format;\n  uint8_t abstract_fmt;\n  uint8_t guid[16];\n  int children_count;\n  enum uvc_frame_format *children;\n};\n\nstruct format_table_entry *_get_format_entry(enum uvc_frame_format format) {\n  #define ABS_FMT(_fmt, ...) \\\n    case _fmt: { \\\n    static enum uvc_frame_format _fmt##_children[] = __VA_ARGS__; \\\n    static struct format_table_entry _fmt##_entry = { \\\n      _fmt, 0, {}, ARRAYSIZE(_fmt##_children), _fmt##_children }; \\\n    return &_fmt##_entry; }\n\n  #define FMT(_fmt, ...) \\\n    case _fmt: { \\\n    static struct format_table_entry _fmt##_entry = { \\\n      _fmt, 0, __VA_ARGS__, 0, NULL }; \\\n    return &_fmt##_entry; }\n\n  switch(format) {\n    /* Define new formats here */\n    ABS_FMT(UVC_FRAME_FORMAT_ANY,\n      {UVC_FRAME_FORMAT_UNCOMPRESSED, UVC_FRAME_FORMAT_COMPRESSED})\n\n    ABS_FMT(UVC_FRAME_FORMAT_UNCOMPRESSED,\n      {UVC_FRAME_FORMAT_YUYV, UVC_FRAME_FORMAT_UYVY, UVC_FRAME_FORMAT_GRAY8})\n    FMT(UVC_FRAME_FORMAT_YUYV,\n      {'Y',  'U',  'Y',  '2', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})\n    FMT(UVC_FRAME_FORMAT_UYVY,\n      {'U',  'Y',  'V',  'Y', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})\n    FMT(UVC_FRAME_FORMAT_GRAY8,\n      {'Y',  '8',  '0',  '0', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})\n\n    ABS_FMT(UVC_FRAME_FORMAT_COMPRESSED,\n      {UVC_FRAME_FORMAT_MJPEG})\n    FMT(UVC_FRAME_FORMAT_MJPEG,\n      {'M',  'J',  'P',  'G'})\n\n    default:\n      return NULL;\n  }\n\n  #undef ABS_FMT\n  #undef FMT\n}\n\nstatic uint8_t _uvc_frame_format_matches_guid(enum uvc_frame_format fmt, uint8_t guid[16]) {\n  struct format_table_entry *format;\n  int child_idx;\n\n  format = _get_format_entry(fmt);\n  if (!format)\n    return 0;\n\n  if (!format->abstract_fmt && !memcmp(guid, format->guid, 16))\n    return 1;\n\n  for (child_idx = 0; child_idx < format->children_count; child_idx++) {\n    if (_uvc_frame_format_matches_guid(format->children[child_idx], guid))\n      return 1;\n  }\n\n  return 0;\n}\n\nstatic enum uvc_frame_format uvc_frame_format_for_guid(uint8_t guid[16]) {\n  struct format_table_entry *format;\n  enum uvc_frame_format fmt;\n\n  for (fmt = 0; fmt < UVC_FRAME_FORMAT_COUNT; ++fmt) {\n    format = _get_format_entry(fmt);\n    if (!format || format->abstract_fmt)\n      continue;\n    if (!memcmp(format->guid, guid, 16))\n      return format->format;\n  }\n\n  return UVC_FRAME_FORMAT_UNKNOWN;\n}\n\n/** @internal\n * Run a streaming control query\n * @param[in] devh UVC device\n * @param[in,out] ctrl Control block\n * @param[in] probe Whether this is a probe query or a commit query\n * @param[in] req Query type\n */\nuvc_error_t uvc_query_stream_ctrl(\n    uvc_device_handle_t *devh,\n    uvc_stream_ctrl_t *ctrl,\n    uint8_t probe,\n    enum uvc_req_code req) {\n  uint8_t buf[34];\n  size_t len;\n  uvc_error_t err;\n\n  bzero(buf, sizeof(buf));\n\n  if (devh->info->ctrl_if.bcdUVC >= 0x0110)\n    len = 34;\n  else\n    len = 26;\n\n  /* prepare for a SET transfer */\n  if (req == UVC_SET_CUR) {\n    SHORT_TO_SW(ctrl->bmHint, buf);\n    buf[2] = ctrl->bFormatIndex;\n    buf[3] = ctrl->bFrameIndex;\n    INT_TO_DW(ctrl->dwFrameInterval, buf + 4);\n    SHORT_TO_SW(ctrl->wKeyFrameRate, buf + 8);\n    SHORT_TO_SW(ctrl->wPFrameRate, buf + 10);\n    SHORT_TO_SW(ctrl->wCompQuality, buf + 12);\n    SHORT_TO_SW(ctrl->wCompWindowSize, buf + 14);\n    SHORT_TO_SW(ctrl->wDelay, buf + 16);\n    INT_TO_DW(ctrl->dwMaxVideoFrameSize, buf + 18);\n    INT_TO_DW(ctrl->dwMaxPayloadTransferSize, buf + 22);\n\n    if (len == 34) {\n      /** @todo support UVC 1.1 */\n      return UVC_ERROR_NOT_SUPPORTED;\n    }\n  }\n\n  /* do the transfer */\n  err = libusb_control_transfer(\n      devh->usb_devh,\n      req == UVC_SET_CUR ? 0x21 : 0xA1,\n      req,\n      probe ? (UVC_VS_PROBE_CONTROL << 8) : (UVC_VS_COMMIT_CONTROL << 8),\n      ctrl->bInterfaceNumber,\n      buf, len, 0\n  );\n\n  if (err <= 0) {\n    return err;\n  }\n\n  /* now decode following a GET transfer */\n  if (req != UVC_SET_CUR) {\n    ctrl->bmHint = SW_TO_SHORT(buf);\n    ctrl->bFormatIndex = buf[2];\n    ctrl->bFrameIndex = buf[3];\n    ctrl->dwFrameInterval = DW_TO_INT(buf + 4);\n    ctrl->wKeyFrameRate = SW_TO_SHORT(buf + 8);\n    ctrl->wPFrameRate = SW_TO_SHORT(buf + 10);\n    ctrl->wCompQuality = SW_TO_SHORT(buf + 12);\n    ctrl->wCompWindowSize = SW_TO_SHORT(buf + 14);\n    ctrl->wDelay = SW_TO_SHORT(buf + 16);\n    ctrl->dwMaxVideoFrameSize = DW_TO_INT(buf + 18);\n    ctrl->dwMaxPayloadTransferSize = DW_TO_INT(buf + 22);\n\n    if (len == 34) {\n      /** @todo support UVC 1.1 */\n      return UVC_ERROR_NOT_SUPPORTED;\n    }\n\n    /* fix up block for cameras that fail to set dwMax* */\n    if (ctrl->dwMaxVideoFrameSize == 0) {\n      uvc_frame_desc_t *frame = uvc_find_frame_desc(devh, ctrl->bFormatIndex, ctrl->bFrameIndex);\n\n      if (frame) {\n        ctrl->dwMaxVideoFrameSize = frame->dwMaxVideoFrameBufferSize;\n      }\n    }\n  }\n\n  return UVC_SUCCESS;\n}\n\n/** @brief Reconfigure stream with a new stream format.\n * @ingroup streaming\n *\n * This may be executed whether or not the stream is running.\n *\n * @param[in] strmh Stream handle\n * @param[in] ctrl Control block, processed using {uvc_probe_stream_ctrl} or\n *             {uvc_get_stream_ctrl_format_size}\n */\nuvc_error_t uvc_stream_ctrl(uvc_stream_handle_t *strmh, uvc_stream_ctrl_t *ctrl) {\n  uvc_error_t ret;\n\n  if (strmh->stream_if->bInterfaceNumber != ctrl->bInterfaceNumber)\n    return UVC_ERROR_INVALID_PARAM;\n\n  /* @todo Allow the stream to be modified without restarting the stream */\n  if (strmh->running)\n    return UVC_ERROR_BUSY;\n\n  ret = uvc_query_stream_ctrl(strmh->devh, ctrl, 0, UVC_SET_CUR);\n  if (ret != UVC_SUCCESS)\n    return ret;\n\n  strmh->cur_ctrl = *ctrl;\n  return UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Find the descriptor for a specific frame configuration\n * @param stream_if Stream interface\n * @param format_id Index of format class descriptor\n * @param frame_id Index of frame descriptor\n */\nstatic uvc_frame_desc_t *_uvc_find_frame_desc_stream_if(uvc_streaming_interface_t *stream_if,\n    uint16_t format_id, uint16_t frame_id) {\n \n  uvc_format_desc_t *format = NULL;\n  uvc_frame_desc_t *frame = NULL;\n\n  DL_FOREACH(stream_if->format_descs, format) {\n    if (format->bFormatIndex == format_id) {\n      DL_FOREACH(format->frame_descs, frame) {\n        if (frame->bFrameIndex == frame_id)\n          return frame;\n      }\n    }\n  }\n\n  return NULL;\n}\n\nuvc_frame_desc_t *uvc_find_frame_desc_stream(uvc_stream_handle_t *strmh,\n    uint16_t format_id, uint16_t frame_id) {\n  return _uvc_find_frame_desc_stream_if(strmh->stream_if, format_id, frame_id);\n}\n\n/** @internal\n * @brief Find the descriptor for a specific frame configuration\n * @param devh UVC device\n * @param format_id Index of format class descriptor\n * @param frame_id Index of frame descriptor\n */\nuvc_frame_desc_t *uvc_find_frame_desc(uvc_device_handle_t *devh,\n    uint16_t format_id, uint16_t frame_id) {\n \n  uvc_streaming_interface_t *stream_if;\n  uvc_frame_desc_t *frame;\n\n  DL_FOREACH(devh->info->stream_ifs, stream_if) {\n    frame = _uvc_find_frame_desc_stream_if(stream_if, format_id, frame_id);\n    if (frame)\n      return frame;\n  }\n\n  return NULL;\n}\n\n/** Get a negotiated streaming control block for some common parameters.\n * @ingroup streaming\n *\n * @param[in] devh Device handle\n * @param[in,out] ctrl Control block\n * @param[in] format_class Type of streaming format\n * @param[in] width Desired frame width\n * @param[in] height Desired frame height\n * @param[in] fps Frame rate, frames per second\n */\nuvc_error_t uvc_get_stream_ctrl_format_size(\n    uvc_device_handle_t *devh,\n    uvc_stream_ctrl_t *ctrl,\n    enum uvc_frame_format cf,\n    int width, int height,\n    int fps) {\n  uvc_streaming_interface_t *stream_if;\n  enum uvc_vs_desc_subtype format_class;\n\n  /* get the max values */\n  uvc_query_stream_ctrl(\n      devh, ctrl, 1, UVC_GET_MAX\n  );\n\n  /* find a matching frame descriptor and interval */\n  DL_FOREACH(devh->info->stream_ifs, stream_if) {\n    uvc_format_desc_t *format;\n\n    DL_FOREACH(stream_if->format_descs, format) {\n      uvc_frame_desc_t *frame;\n\n      if (!_uvc_frame_format_matches_guid(cf, format->guidFormat))\n        continue;\n\n      DL_FOREACH(format->frame_descs, frame) {\n        if (frame->wWidth != width || frame->wHeight != height)\n          continue;\n\n        uint32_t *interval;\n\n        if (frame->intervals) {\n          for (interval = frame->intervals; *interval; ++interval) {\n            if (10000000 / *interval == (unsigned int) fps) {\n              ctrl->bmHint = (1 << 0); /* don't negotiate interval */\n              ctrl->bFormatIndex = format->bFormatIndex;\n              ctrl->bFrameIndex = frame->bFrameIndex;\n              ctrl->bInterfaceNumber = stream_if->bInterfaceNumber;\n              ctrl->dwFrameInterval = *interval;\n\n              goto found;\n            }\n          }\n        } else {\n          uint32_t interval_100ns = 10000000 / fps;\n          uint32_t interval_offset = interval_100ns - frame->dwMinFrameInterval;\n\n          if (interval_100ns >= frame->dwMinFrameInterval\n              && interval_100ns <= frame->dwMaxFrameInterval\n              && !(interval_offset\n                   && (interval_offset % frame->dwFrameIntervalStep))) {\n            ctrl->bmHint = (1 << 0);\n            ctrl->bFormatIndex = format->bFormatIndex;\n            ctrl->bFrameIndex = frame->bFrameIndex;\n            ctrl->bInterfaceNumber = stream_if->bInterfaceNumber;\n            ctrl->dwFrameInterval = interval_100ns;\n\n            goto found;\n          }\n        }\n      }\n    }\n  }\n\n  return UVC_ERROR_INVALID_MODE;\n\nfound:\n  return uvc_probe_stream_ctrl(devh, ctrl);\n}\n\n/** @internal\n * Negotiate streaming parameters with the device\n *\n * @param[in] devh UVC device\n * @param[in,out] ctrl Control block\n */\nuvc_error_t uvc_probe_stream_ctrl(\n    uvc_device_handle_t *devh,\n    uvc_stream_ctrl_t *ctrl) {\n \n  uvc_claim_if(devh, ctrl->bInterfaceNumber);\n\n  uvc_query_stream_ctrl(\n      devh, ctrl, 1, UVC_SET_CUR\n  );\n\n  uvc_query_stream_ctrl(\n      devh, ctrl, 1, UVC_GET_CUR\n  );\n\n  /** @todo make sure that worked */\n  return UVC_SUCCESS;\n}\n\n/** @internal\n * @brief Isochronous transfer callback\n * \n * Processes stream, places frames into buffer, signals listeners\n * (such as user callback thread and any polling thread) on new frame\n *\n * @param transfer Active transfer\n */ \nvoid _uvc_iso_callback(struct libusb_transfer *transfer) {\n  uvc_stream_handle_t *strmh;\n  int packet_id;\n\n  /* per packet */\n  uint8_t *pktbuf;\n  uint8_t check_header;\n  size_t header_len;\n  struct libusb_iso_packet_descriptor *pkt;\n  uint8_t *tmp_buf;\n\n  static uint8_t isight_tag[] = {\n    0x11, 0x22, 0x33, 0x44,\n    0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xfa, 0xce\n  };\n\n  strmh = transfer->user_data;\n\n  switch (transfer->status) {\n  case LIBUSB_TRANSFER_COMPLETED:\n    for (packet_id = 0; packet_id < transfer->num_iso_packets; ++packet_id) {\n      check_header = 1;\n\n      pkt = transfer->iso_packet_desc + packet_id;\n\n      if (pkt->status != 0) {\n        printf(\"bad packet (transfer): %d\\n\", pkt->status);\n        continue;\n      }\n\n      if (pkt->actual_length == 0) {\n        continue;\n      }\n\n      pktbuf = libusb_get_iso_packet_buffer_simple(transfer, packet_id);\n\n      if (strmh->devh->is_isight) {\n        if (pkt->actual_length < 30 ||\n            (memcmp(isight_tag, pktbuf + 2, sizeof(isight_tag))\n             && memcmp(isight_tag, pktbuf + 3, sizeof(isight_tag)))) {\n          check_header = 0;\n          header_len = 0;\n        } else {\n          header_len = pktbuf[0];\n        }\n      } else {\n        header_len = pktbuf[0];\n      }\n\n      if (check_header && pktbuf[1] & 0x40) {\n        printf(\"bad packet\\n\");\n        continue;\n      }\n\n      /** @todo support sending the frame on EOF instead of on flip(FID) */\n      if (check_header && strmh->fid != (pktbuf[1] & 1)) {\n        pthread_mutex_lock(&strmh->cb_mutex);\n\n        /* swap the buffers */\n        tmp_buf = strmh->holdbuf;\n        strmh->hold_bytes = strmh->got_bytes;\n        strmh->holdbuf = strmh->outbuf;\n        strmh->outbuf = tmp_buf;\n        strmh->hold_last_scr = strmh->last_scr;\n        strmh->hold_pts = strmh->pts;\n        strmh->hold_seq = strmh->seq;\n\n        pthread_cond_broadcast(&strmh->cb_cond);\n        pthread_mutex_unlock(&strmh->cb_mutex);\n\n        strmh->seq++;\n        strmh->got_bytes = 0;\n        strmh->last_scr = 0;\n        strmh->pts = 0;\n        strmh->fid = pktbuf[1] & 1;\n      }\n\n      if (check_header) {\n        if (pktbuf[1] & (1 << 2))\n          strmh->pts = DW_TO_INT(pktbuf + 2);\n\n        if (pktbuf[1] & (1 << 3))\n          strmh->last_scr = DW_TO_INT(pktbuf + 6);\n\n        if (strmh->devh->is_isight)\n          continue; // don't look for data after an iSight header\n      }\n\n      if (pkt->actual_length < header_len) {\n        /* Bogus packet received */\n        printf(\"bogus packet: actual_len=%d, header_len=%zd\\n\", pkt->actual_length, header_len);\n        continue;\n      }\n      if (pkt->actual_length - header_len > 0)\n        memcpy(strmh->outbuf + strmh->got_bytes, pktbuf + header_len, pkt->actual_length - header_len);\n\n      strmh->got_bytes += pkt->actual_length - header_len;\n    }\n    break;\n  case LIBUSB_TRANSFER_CANCELLED: \n  case LIBUSB_TRANSFER_ERROR:\n  case LIBUSB_TRANSFER_NO_DEVICE: {\n    int i;\n    UVC_DEBUG(\"not retrying transfer, status = %d\", transfer->status);\n    pthread_mutex_lock(&strmh->cb_mutex);\n\n    /* Mark transfer as deleted. */\n    for(i=0; i<ARRAYSIZE(strmh->transfers); i++) {\n      if(strmh->transfers[i] == transfer) {\n        UVC_DEBUG(\"Freeing transfer %d (%p)\", i, transfer);\n        free(transfer->buffer);\n        libusb_free_transfer(transfer);\n        strmh->transfers[i] = NULL;\n        break;\n      }\n    }\n    if(i == ARRAYSIZE(strmh->transfers)) {\n      UVC_DEBUG(\"transfer %p not found; not freeing!\", transfer);\n    }\n\n    pthread_cond_broadcast(&strmh->cb_cond);\n    pthread_mutex_unlock(&strmh->cb_mutex);\n\n    break;\n  }\n  case LIBUSB_TRANSFER_TIMED_OUT:\n  case LIBUSB_TRANSFER_STALL:\n  case LIBUSB_TRANSFER_OVERFLOW:\n    UVC_DEBUG(\"retrying transfer, status = %d\", transfer->status);\n    break;\n  }\n  \n  if (strmh->running)\n    libusb_submit_transfer(transfer);\n}\n\n/** Begin streaming video from the camera into the callback function.\n * @ingroup streaming\n *\n * @param devh UVC device\n * @param ctrl Control block, processed using {uvc_probe_stream_ctrl} or\n *             {uvc_get_stream_ctrl_format_size}\n * @param cb   User callback function. See {uvc_frame_callback_t} for restrictions.\n * @param isochronous Whether to use isochronous transfers rather than bulk ones\n */\nuvc_error_t uvc_start_streaming(\n    uvc_device_handle_t *devh,\n    uvc_stream_ctrl_t *ctrl,\n    uvc_frame_callback_t *cb,\n    void *user_ptr,\n    uint8_t isochronous\n) {\n  uvc_error_t ret;\n  uvc_stream_handle_t *strmh;\n\n  ret = uvc_stream_open_ctrl(devh, &strmh, ctrl);\n  if (ret != UVC_SUCCESS)\n    return ret;\n\n  ret = uvc_stream_start(strmh, cb, user_ptr, isochronous);\n  if (ret != UVC_SUCCESS) {\n    uvc_stream_close(strmh);\n    return ret;\n  }\n\n  return UVC_SUCCESS;\n}\n\n/** Begin streaming video from the camera into the callback function.\n * @ingroup streaming\n *\n * @param devh UVC device\n * @param ctrl Control block, processed using {uvc_probe_stream_ctrl} or\n *             {uvc_get_stream_ctrl_format_size}\n * @param cb   User callback function. See {uvc_frame_callback_t} for restrictions.\n */\nuvc_error_t uvc_start_iso_streaming(\n    uvc_device_handle_t *devh,\n    uvc_stream_ctrl_t *ctrl,\n    uvc_frame_callback_t *cb,\n    void *user_ptr\n) {\n  return uvc_start_streaming(devh, ctrl, cb, user_ptr, 1);\n}\n\nstatic uvc_stream_handle_t *_uvc_get_stream_by_interface(uvc_device_handle_t *devh, int interface_idx) {\n  uvc_stream_handle_t *strmh;\n\n  DL_FOREACH(devh->streams, strmh) {\n    if (strmh->stream_if->bInterfaceNumber == interface_idx)\n      return strmh;\n  }\n\n  return NULL;\n}\n\nstatic uvc_streaming_interface_t *_uvc_get_stream_if(uvc_device_handle_t *devh, int interface_idx) {\n  uvc_streaming_interface_t *stream_if;\n\n  DL_FOREACH(devh->info->stream_ifs, stream_if) {\n    if (stream_if->bInterfaceNumber == interface_idx)\n      return stream_if;\n  }\n  \n  return NULL;\n}\n\n/** Open a new video stream.\n * @ingroup streaming\n *\n * @param devh UVC device\n * @param ctrl Control block, processed using {uvc_probe_stream_ctrl} or\n *             {uvc_get_stream_ctrl_format_size}\n */\nuvc_error_t uvc_stream_open_ctrl(uvc_device_handle_t *devh, uvc_stream_handle_t **strmhp, uvc_stream_ctrl_t *ctrl) {\n  /* Chosen frame and format descriptors */\n  uvc_stream_handle_t *strmh = NULL;\n  uvc_streaming_interface_t *stream_if;\n  uvc_error_t ret;\n\n  UVC_ENTER();\n\n  if (_uvc_get_stream_by_interface(devh, ctrl->bInterfaceNumber) != NULL) {\n    ret = UVC_ERROR_BUSY; /* Stream is already opened */\n    goto fail;\n  }\n\n  stream_if = _uvc_get_stream_if(devh, ctrl->bInterfaceNumber);\n  if (!stream_if) {\n    ret = UVC_ERROR_INVALID_PARAM;\n    goto fail;\n  }\n\n  strmh = calloc(1, sizeof(*strmh));\n  if (!strmh) {\n    ret = UVC_ERROR_NO_MEM;\n    goto fail;\n  }\n  strmh->devh = devh;\n  strmh->stream_if = stream_if;\n  strmh->frame.library_owns_data = 1;\n\n  ret = uvc_claim_if(strmh->devh, strmh->stream_if->bInterfaceNumber);\n  if (ret != UVC_SUCCESS)\n    goto fail;\n\n  ret = uvc_stream_ctrl(strmh, ctrl);\n  if (ret != UVC_SUCCESS)\n    goto fail;\n\n  // Set up the streaming status and data space\n  strmh->running = 0;\n  strmh->outbuf = malloc(8 * 1024 * 1024); /** @todo take only what we need */\n  strmh->holdbuf = malloc(8 * 1024 * 1024);\n   \n  pthread_mutex_init(&strmh->cb_mutex, NULL);\n  pthread_cond_init(&strmh->cb_cond, NULL);\n\n  DL_APPEND(devh->streams, strmh);\n\n  *strmhp = strmh;\n\n  UVC_EXIT(0);\n  return UVC_SUCCESS;\n\nfail:\n  if(strmh)\n    free(strmh);\n  UVC_EXIT(ret);\n  return ret;\n}\n\n/** Begin streaming video from the stream into the callback function.\n * @ingroup streaming\n *\n * @param strmh UVC stream\n * @param cb   User callback function. See {uvc_frame_callback_t} for restrictions.\n * @param isochronous Whether to use isochronous transfers rather than bulk ones\n */\nuvc_error_t uvc_stream_start(\n    uvc_stream_handle_t *strmh,\n    uvc_frame_callback_t *cb,\n    void *user_ptr,\n    uint8_t isochronous\n) {\n  /* USB interface we'll be using */\n  const struct libusb_interface *interface;\n  int interface_id;\n  uvc_frame_desc_t *frame_desc;\n  uvc_format_desc_t *format_desc;\n  uvc_stream_ctrl_t *ctrl;\n  uvc_error_t ret;\n\n  ctrl = &strmh->cur_ctrl;\n\n  UVC_ENTER();\n\n  if (strmh->running) {\n    UVC_EXIT(UVC_ERROR_BUSY);\n    return UVC_ERROR_BUSY;\n  }\n\n  strmh->running = 1;\n  strmh->seq = 0;\n  strmh->fid = 0;\n  strmh->pts = 0;\n  strmh->last_scr = 0;\n\n  frame_desc = uvc_find_frame_desc_stream(strmh, ctrl->bFormatIndex, ctrl->bFrameIndex);\n  if (!frame_desc) {\n    ret = UVC_ERROR_INVALID_PARAM;\n    goto fail;\n  }\n  format_desc = frame_desc->parent;\n\n  strmh->frame_format = uvc_frame_format_for_guid(format_desc->guidFormat);\n  if (strmh->frame_format == UVC_FRAME_FORMAT_UNKNOWN) {\n    ret = UVC_ERROR_NOT_SUPPORTED;\n    goto fail;\n  }\n\n  // Get the interface that provides the chosen format and frame configuration\n  interface_id = strmh->stream_if->bInterfaceNumber;\n  interface = &strmh->devh->info->config->interface[interface_id];\n\n  if (isochronous) {\n    /* For isochronous streaming, we choose an appropriate altsetting for the endpoint\n     * and set up several transfers */\n    const struct libusb_interface_descriptor *altsetting;\n    const struct libusb_endpoint_descriptor *endpoint;\n    /* The greatest number of bytes that the device might provide, per packet, in this\n     * configuration */\n    size_t config_bytes_per_packet;\n    /* Number of packets per transfer */\n    size_t packets_per_transfer;\n    /* Total amount of data per transfer */\n    size_t total_transfer_size;\n    /* Size of packet transferable from the chosen endpoint */\n    size_t endpoint_bytes_per_packet;\n    /* Index of the altsetting */\n    int alt_idx, ep_idx;\n    \n    struct libusb_transfer *transfer;\n    int transfer_id;\n\n    /* If the interface doesn't support isochronous mode, give up */\n    if (interface->num_altsetting == 0) {\n      ret = UVC_ERROR_INVALID_DEVICE;\n      goto fail;\n    }\n\n    config_bytes_per_packet = strmh->cur_ctrl.dwMaxPayloadTransferSize;\n\n    /* Go through the altsettings and find one whose packets are at least\n     * as big as our format's maximum per-packet usage. Assume that the\n     * packet sizes are increasing. */\n    for (alt_idx = 0; alt_idx < interface->num_altsetting; alt_idx++) {\n      altsetting = interface->altsetting + alt_idx;\n      endpoint_bytes_per_packet = 0;\n\n      /* Find the endpoint with the number specified in the VS header */\n      for (ep_idx = 0; ep_idx < altsetting->bNumEndpoints; ep_idx++) {\n        endpoint = altsetting->endpoint + ep_idx;\n\n        if (endpoint->bEndpointAddress == format_desc->parent->bEndpointAddress) {\n          endpoint_bytes_per_packet = endpoint->wMaxPacketSize;\n          // wMaxPacketSize: [unused:2 (multiplier-1):3 size:11]\n          endpoint_bytes_per_packet = (endpoint_bytes_per_packet & 0x07ff) *\n                                      (((endpoint_bytes_per_packet >> 11) & 3) + 1);\n          break;\n        }\n      }\n\n      if (endpoint_bytes_per_packet >= config_bytes_per_packet) {\n        /* Transfers will be at most one frame long: Divide the maximum frame size\n         * by the size of the endpoint and round up */\n        packets_per_transfer = (ctrl->dwMaxVideoFrameSize +\n                                endpoint_bytes_per_packet - 1) / endpoint_bytes_per_packet;\n\n        /* But keep a reasonable limit: Otherwise we start dropping data */\n        if (packets_per_transfer > 32)\n          packets_per_transfer = 32;\n        \n        total_transfer_size = packets_per_transfer * endpoint_bytes_per_packet;\n        break;\n      }\n    }\n\n    /* If we searched through all the altsettings and found nothing usable */\n    if (alt_idx == interface->num_altsetting) {\n      ret = UVC_ERROR_INVALID_MODE;\n      goto fail;\n    }\n\n    /* Select the altsetting */\n    ret = libusb_set_interface_alt_setting(strmh->devh->usb_devh,\n                                           altsetting->bInterfaceNumber,\n                                           altsetting->bAlternateSetting);\n    if (ret != UVC_SUCCESS) {\n      UVC_DEBUG(\"libusb_set_interface_alt_setting failed\");\n      goto fail;\n    }\n\n    /* Set up the transfers */\n    for (transfer_id = 0; transfer_id < ARRAYSIZE(strmh->transfers); ++transfer_id) {\n      transfer = libusb_alloc_transfer(packets_per_transfer);\n      strmh->transfers[transfer_id] = transfer;      \n      strmh->transfer_bufs[transfer_id] = malloc(total_transfer_size);\n\n      libusb_fill_iso_transfer(\n        transfer, strmh->devh->usb_devh, format_desc->parent->bEndpointAddress,\n        strmh->transfer_bufs[transfer_id],\n        total_transfer_size, packets_per_transfer, _uvc_iso_callback, (void*) strmh, 5000);\n\n      libusb_set_iso_packet_lengths(transfer, endpoint_bytes_per_packet);\n    }\n  } else {\n    /** @todo prepare for bulk transfer */\n  }\n\n  strmh->user_cb = cb;\n  strmh->user_ptr = user_ptr;\n\n  /* If the user wants it, set up a thread that calls the user's function\n   * with the contents of each frame.\n   */\n  if (cb) {\n    pthread_create(&strmh->cb_thread, NULL, _uvc_user_caller, (void*) strmh);\n  }\n\n  if (isochronous) {\n    int transfer_id;\n\n    for (transfer_id = 0; transfer_id < ARRAYSIZE(strmh->transfers); transfer_id++) {\n      ret = libusb_submit_transfer(strmh->transfers[transfer_id]);\n      if (ret != UVC_SUCCESS) {\n        UVC_DEBUG(\"libusb_submit_transfer failed\");\n        break;\n      }\n    }\n  } else {\n    /** @todo submit bulk transfer */\n  }\n\n  if (ret != UVC_SUCCESS) {\n    /** @todo clean up transfers and memory */\n    goto fail;\n  }\n\n  UVC_EXIT(ret);\n  return ret;\nfail:\n  strmh->running = 0;\n  UVC_EXIT(ret);\n  return ret;\n}\n\n/** Begin streaming video from the stream into the callback function.\n * @ingroup streaming\n *\n * @param strmh UVC stream\n * @param cb   User callback function. See {uvc_frame_callback_t} for restrictions.\n * @param isochronous Whether to use isochronous transfers rather than bulk ones\n */\nuvc_error_t uvc_stream_start_iso(\n    uvc_stream_handle_t *strmh,\n    uvc_frame_callback_t *cb,\n    void *user_ptr\n) {\n  return uvc_stream_start(strmh, cb, user_ptr, 1);\n}\n\n/** @internal\n * @brief User callback runner thread\n * @note There should be at most one of these per currently streaming device\n * @param arg Device handle\n */\nvoid *_uvc_user_caller(void *arg) {\n  uvc_stream_handle_t *strmh = (uvc_stream_handle_t *) arg;\n\n  uint32_t last_seq = 0;\n\n  do {\n    pthread_mutex_lock(&strmh->cb_mutex);\n\n    while (strmh->running && last_seq == strmh->hold_seq) {\n      pthread_cond_wait(&strmh->cb_cond, &strmh->cb_mutex);\n    }\n\n    if (!strmh->running) {\n      pthread_mutex_unlock(&strmh->cb_mutex);\n      break;\n    }\n    \n    last_seq = strmh->hold_seq;\n    _uvc_populate_frame(strmh);\n    \n    pthread_mutex_unlock(&strmh->cb_mutex);\n    \n    strmh->user_cb(&strmh->frame, strmh->user_ptr);\n  } while(1);\n\n  return NULL; // return value ignored\n}\n\n/** @internal\n * @brief Populate the fields of a frame to be handed to user code\n * must be called with stream cb lock held!\n */\nvoid _uvc_populate_frame(uvc_stream_handle_t *strmh) {\n  size_t alloc_size = strmh->cur_ctrl.dwMaxVideoFrameSize;\n  uvc_frame_t *frame = &strmh->frame;\n  uvc_frame_desc_t *frame_desc;\n\n  /** @todo this stuff that hits the main config cache should really happen\n   * in start() so that only one thread hits these data. all of this stuff\n   * is going to be reopen_on_change anyway\n   */\n\n  frame_desc = uvc_find_frame_desc(strmh->devh, strmh->cur_ctrl.bFormatIndex,\n\t\t\t\t   strmh->cur_ctrl.bFrameIndex);\n\n  frame->frame_format = strmh->frame_format;\n  \n  frame->width = frame_desc->wWidth;\n  frame->height = frame_desc->wHeight;\n  \n  switch (frame->frame_format) {\n  case UVC_FRAME_FORMAT_YUYV:\n    frame->step = frame->width * 2;\n    break;\n  case UVC_FRAME_FORMAT_MJPEG:\n    frame->step = 0;\n    break;\n  default:\n    frame->step = 0;\n    break;\n  }\n  \n  /* copy the image data from the hold buffer to the frame (unnecessary extra buf?) */\n  if (frame->data_bytes < strmh->hold_bytes) {\n    frame->data = realloc(frame->data, strmh->hold_bytes);\n    frame->data_bytes = strmh->hold_bytes;\n  }\n  memcpy(frame->data, strmh->holdbuf, frame->data_bytes);\n  \n  /** @todo set the frame time */\n}\n\n/** Poll for a frame\n * @ingroup streaming\n *\n * @param devh UVC device\n * @param[out] frame Location to store pointer to captured frame (NULL on error)\n * @param timeout_us >0: Wait at most N microseconds; 0: Wait indefinitely; -1: return immediately\n */\nuvc_error_t uvc_stream_get_frame(uvc_stream_handle_t *strmh,\n\t\t\t  uvc_frame_t **frame,\n\t\t\t  int32_t timeout_us) {\n  time_t add_secs;\n  time_t add_nsecs;\n  struct timespec ts;\n  struct timeval tv;\n\n  if (!strmh->running)\n    return UVC_ERROR_INVALID_PARAM;\n\n  if (strmh->user_cb)\n    return UVC_ERROR_CALLBACK_EXISTS;\n\n  pthread_mutex_lock(&strmh->cb_mutex);\n\n  if (strmh->last_polled_seq < strmh->hold_seq) {\n    _uvc_populate_frame(strmh);\n    *frame = &strmh->frame;\n    strmh->last_polled_seq = strmh->hold_seq;\n  } else if (timeout_us != -1) {\n    if (timeout_us == 0) {\n      pthread_cond_wait(&strmh->cb_cond, &strmh->cb_mutex);\n    } else {\n      add_secs = timeout_us / 1000000;\n      add_nsecs = (timeout_us % 1000000) * 1000;\n      ts.tv_sec = 0;\n      ts.tv_nsec = 0;\n\n#if _POSIX_TIMERS > 0\n      clock_gettime(CLOCK_REALTIME, &ts);\n#else\n      gettimeofday(&tv, NULL);\n      ts.tv_sec = tv.tv_sec;\n      ts.tv_nsec = tv.tv_usec * 1000;\n#endif\n\n      ts.tv_sec += add_secs;\n      ts.tv_nsec += add_nsecs;\n\n      pthread_cond_timedwait(&strmh->cb_cond, &strmh->cb_mutex, &ts);\n    }\n    \n    if (strmh->last_polled_seq < strmh->hold_seq) {\n      _uvc_populate_frame(strmh);\n      *frame = &strmh->frame;\n      strmh->last_polled_seq = strmh->hold_seq;\n    } else {\n      *frame = NULL;\n    }\n  } else {\n    *frame = NULL;\n  }\n\n  pthread_mutex_unlock(&strmh->cb_mutex);\n\n  return UVC_SUCCESS;\n}\n\n/** @brief Stop streaming video\n * @ingroup streaming\n *\n * Closes all streams, ends threads and cancels pollers\n *\n * @param devh UVC device\n */\nvoid uvc_stop_streaming(uvc_device_handle_t *devh) {\n  uvc_stream_handle_t *strmh, *strmh_tmp;\n\n  DL_FOREACH_SAFE(devh->streams, strmh, strmh_tmp) {\n    uvc_stream_close(strmh);\n  }\n}\n\n/** @brief Stop stream.\n * @ingroup streaming\n *\n * Stops stream, ends threads and cancels pollers\n *\n * @param devh UVC device\n */\nuvc_error_t uvc_stream_stop(uvc_stream_handle_t *strmh) {\n  int i;\n\n  if (!strmh->running)\n    return UVC_ERROR_INVALID_PARAM;\n\n  strmh->running = 0;\n\n  pthread_mutex_lock(&strmh->cb_mutex);\n\n  for(i=0; i<ARRAYSIZE(strmh->transfers); i++) {\n    if(strmh->transfers[i] != NULL) {\n      int res = libusb_cancel_transfer(strmh->transfers[i]);\n      if(res < 0) {\n        free(strmh->transfers[i]->buffer);\n        libusb_free_transfer(strmh->transfers[i]);\n        strmh->transfers[i] = NULL;\n      }\n    }\n  }\n\n  /* Wait for transfers to complete/cancel */\n  do {\n    for(i=0; i<ARRAYSIZE(strmh->transfers); i++) {\n      if(strmh->transfers[i] != NULL)\n        break;\n    }\n    if(i == ARRAYSIZE(strmh->transfers))\n      break;\n    pthread_cond_wait(&strmh->cb_cond, &strmh->cb_mutex);\n  } while(1);\n  // Kick the user thread awake\n  pthread_cond_broadcast(&strmh->cb_cond);\n  pthread_mutex_unlock(&strmh->cb_mutex);\n\n  /** @todo stop the actual stream, camera side? */\n\n  if (strmh->user_cb) {\n    /* wait for the thread to stop (triggered by\n     * LIBUSB_TRANSFER_CANCELLED transfer) */\n    pthread_join(strmh->cb_thread, NULL);\n  }\n\n  return UVC_SUCCESS;\n}\n\n/** @brief Close stream.\n * @ingroup streaming\n *\n * Closes stream, frees handle and all streaming resources.\n *\n * @param strmh UVC stream handle\n */\nvoid uvc_stream_close(uvc_stream_handle_t *strmh) {\n  if (strmh->running)\n    uvc_stream_stop(strmh);\n\n  uvc_release_if(strmh->devh, strmh->stream_if->bInterfaceNumber);\n\n  if (strmh->frame.data)\n    free(strmh->frame.data);\n\n  free(strmh->outbuf);\n  free(strmh->holdbuf);\n\n  pthread_cond_destroy(&strmh->cb_cond);\n  pthread_mutex_destroy(&strmh->cb_mutex);\n\n  DL_DELETE(strmh->devh->streams, strmh);\n  free(strmh);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/libuvc/src/test.c",
    "content": "/*********************************************************************\n* Software License Agreement (BSD License)\n*\n*  Copyright (C) 2010-2012 Ken Tossell\n*  All rights reserved.\n*\n*  Redistribution and use in source and binary forms, with or without\n*  modification, are permitted provided that the following conditions\n*  are met:\n*\n*   * Redistributions of source code must retain the above copyright\n*     notice, this list of conditions and the following disclaimer.\n*   * Redistributions in binary form must reproduce the above\n*     copyright notice, this list of conditions and the following\n*     disclaimer in the documentation and/or other materials provided\n*     with the distribution.\n*   * Neither the name of the author nor other contributors may be\n*     used to endorse or promote products derived from this software\n*     without specific prior written permission.\n*\n*  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n*  \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n*  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n*  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n*  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n*  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n*  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n*  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n*  POSSIBILITY OF SUCH DAMAGE.\n*********************************************************************/\n#include <stdio.h>\n#include <opencv/highgui.h>\n\n#include \"libuvc/libuvc.h\"\n\nvoid cb(uvc_frame_t *frame, void *ptr) {\n  uvc_frame_t *bgr;\n  uvc_error_t ret;\n  IplImage* cvImg;\n\n  printf(\"callback! length = %u, ptr = %d\\n\", frame->data_bytes, (int) ptr);\n\n  bgr = uvc_allocate_frame(frame->width * frame->height * 3);\n  if (!bgr) {\n    printf(\"unable to allocate bgr frame!\");\n    return;\n  }\n\n  ret = uvc_any2bgr(frame, bgr);\n  if (ret) {\n    uvc_perror(ret, \"uvc_any2bgr\");\n    uvc_free_frame(bgr);\n    return;\n  }\n\n  cvImg = cvCreateImageHeader(\n      cvSize(bgr->width, bgr->height),\n      IPL_DEPTH_8U,\n      3);\n\n  cvSetData(cvImg, bgr->data, bgr->width * 3); \n\n  cvNamedWindow(\"Test\", CV_WINDOW_AUTOSIZE);\n  cvShowImage(\"Test\", cvImg);\n  cvWaitKey(10);\n\n  cvReleaseImageHeader(&cvImg);\n\n  uvc_free_frame(bgr);\n}\n\nint main(int argc, char **argv) {\n  uvc_context_t *ctx;\n  uvc_error_t res;\n  uvc_device_t *dev;\n  uvc_device_handle_t *devh;\n  uvc_stream_ctrl_t ctrl;\n\n  res = uvc_init(&ctx, NULL);\n\n  if (res < 0) {\n    uvc_perror(res, \"uvc_init\");\n    return res;\n  }\n\n  puts(\"UVC initialized\");\n\n  res = uvc_find_device(\n      ctx, &dev,\n      0, 0, NULL);\n\n  if (res < 0) {\n    uvc_perror(res, \"uvc_find_device\");\n  } else {\n    puts(\"Device found\");\n\n    res = uvc_open(dev, &devh);\n\n    if (res < 0) {\n      uvc_perror(res, \"uvc_open\");\n    } else {\n      puts(\"Device opened\");\n\n      uvc_print_diag(devh, stderr);\n\n      res = uvc_get_stream_ctrl_format_size(\n          devh, &ctrl, UVC_FRAME_FORMAT_YUYV, 640, 480, 30\n      );\n\n      uvc_print_stream_ctrl(&ctrl, stderr);\n\n      if (res < 0) {\n        uvc_perror(res, \"get_mode\");\n      } else {\n        res = uvc_start_iso_streaming(devh, &ctrl, cb, 12345);\n\n        if (res < 0) {\n          uvc_perror(res, \"start_streaming\");\n        } else {\n          puts(\"Streaming for 10 seconds...\");\n          uvc_error_t resAEMODE = uvc_set_ae_mode(devh, 1);\n          uvc_perror(resAEMODE, \"set_ae_mode\");\n          int i;\n          for (i = 1; i <= 10; i++) {\n            /* uvc_error_t resPT = uvc_set_pantilt_abs(devh, i * 20 * 3600, 0); */\n            /* uvc_perror(resPT, \"set_pt_abs\"); */\n            uvc_error_t resEXP = uvc_set_exposure_abs(devh, 20 + i * 5);\n            uvc_perror(resEXP, \"set_exp_abs\");\n            \n            sleep(1);\n          }\n          sleep(10);\n          uvc_stop_streaming(devh);\n\t  puts(\"Done streaming.\");\n        }\n      }\n\n      uvc_close(devh);\n      puts(\"Device closed\");\n    }\n\n    uvc_unref_device(dev);\n  }\n\n  uvc_exit(ctx);\n  puts(\"UVC exited\");\n\n  return 0;\n}\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/localdefines.h",
    "content": "/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n * File name: localdefines.h\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n*/\n\n#ifndef LOCALDEFINES_H_\n#define LOCALDEFINES_H_\n\n#include <jni.h>\n\n#ifndef LOG_TAG\n#define LOG_TAG \"libUVCCamera\"\n#endif\n\n#define LIBUVC_HAS_JPEG\n\n// write back array that got by getXXXArrayElements into original Java object and release its array\n#define\tARRAYELEMENTS_COPYBACK_AND_RELEASE 0\n// write back array that got by getXXXArrayElements into origianl Java object but do not release its array\n#define\tARRAYELEMENTS_COPYBACK_ONLY JNI_COMMIT\n// never write back array that got by getXXXArrayElements but release its array\n#define ARRAYELEMENTS_ABORT_AND_RELEASE JNI_ABORT\n\n#define THREAD_PRIORITY_DEFAULT\t\t\t0\n#define THREAD_PRIORITY_LOWEST\t\t\t19\n#define THREAD_PRIORITY_BACKGROUND\t\t10\n#define THREAD_PRIORITY_FOREGROUND\t\t-2\n#define THREAD_PRIORITY_DISPLAY\t\t\t-4\n#define THREAD_PRIORITY_URGENT_DISPLAY\t-8\n#define THREAD_PRIORITY_AUDIO\t\t\t-16\n#define THREAD_PRIORITY_URGENT_AUDIO\t-19\n\n#define USE_LOGALL\t// If you don't need to all LOG, comment out this line and select follows\n//#define USE_LOGV\n//#define USE_LOGD\n#define USE_LOGI\n#define USE_LOGW\n#define USE_LOGE\n#define USE_LOGF\n\n#ifdef NDEBUG\n#undef USE_LOGALL\n#endif\n\n#ifdef LOG_NDEBUG\n#undef USE_LOGALL\n#endif\n\n// Absolute class name of Java object\n// if you change the package name of UVCCamera library, you must fix these\n#define\t\tJTYPE_SYSTEM\t\t\t\t\"Ljava/lang/System;\"\n#define\t\tJTYPE_UVCCAMERA\t\t\t\t\"Lcom/serenegiant/usb/UVCCamera;\"\n//\ntypedef\t\tjlong\t\t\t\t\t\tID_TYPE;\n\n#endif /* LOCALDEFINES_H_ */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/.gitmodules",
    "content": "[submodule \"thirdparty/gtest\"]\n\tpath = thirdparty/gtest\n\turl = https://chromium.googlesource.com/external/googletest.git\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/.travis.yml",
    "content": "language: cpp\n\ncompiler:\n - clang\n - gcc\n\nenv:\n  matrix:\n    - CONF=debug   BITS=64\n    - CONF=release BITS=64\n    - CONF=debug   BITS=32\n    - CONF=release BITS=32\n  global:\n    - GITHUB_REPO='miloyip/rapidjson'\n    - DEFINES='-DRAPIDJSON_HAS_STDSTRING'\n    - secure: \"HrsaCb+N66EG1HR+LWH1u51SjaJyRwJEDzqJGYMB7LJ/bfqb9mWKF1fLvZGk46W5t7TVaXRDD5KHFx9DPWvKn4gRUVkwTHEy262ah5ORh8M6n/6VVVajeV/AYt2C0sswdkDBDO4Xq+xy5gdw3G8s1A4Inbm73pUh+6vx+7ltBbk=\"\n\nbefore_install:\n  - sudo add-apt-repository -y ppa:codegear/release\n  - sudo apt-get update -qq\n  - sudo apt-get install -qq premake4 valgrind\n  - if [ \"$BITS\" = 32 ]; then sudo apt-get install -qq g++-multilib libc6-dbg:i386; fi\n\ninstall: true\n\nbefore_script:\n  - pushd build && premake4 'gmake' && popd\n\nscript:\n  - make -C build/gmake -f test.make    config=${CONF}${BITS}\n  - make -C build/gmake -f example.make config=${CONF}${BITS}\n  - pushd bin\n  -  ./unittest_${CONF}_x${BITS}_gmake\n  - valgrind --leak-check=full --error-exitcode=1 ./unittest_${CONF}_x${BITS}_gmake\n  - if [ \"$CONF\" = \"release\" ]; then ./perftest_${CONF}_x${BITS}_gmake; fi\n  - popd\n  - ./build/travis-doxygen.sh;\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/diagram/insituparsing.dot",
    "content": "digraph {\n\tcompound=true\n\tfontname=\"Inconsolata, Consolas\"\n\tfontsize=10\n\tmargin=\"0,0\"\n\tranksep=0.2\n\tpenwidth=0.5\n\t\n\tnode [fontname=\"Inconsolata, Consolas\", fontsize=10, penwidth=0.5]\n\tedge [fontname=\"Inconsolata, Consolas\", fontsize=10, arrowhead=normal]\n\n\t{\n\t\tnode [shape=record, fontsize=\"8\", margin=\"0.04\", height=0.2, color=gray]\n\t\toldjson [label=\"\\{|\\\"|m|s|g|\\\"|:|\\\"|H|e|l|l|o|\\\\|n|W|o|r|l|d|!|\\\"|,|\\\"|\\\\|u|0|0|7|3|t|a|r|s|\\\"|:|1|0|\\}\", xlabel=\"Before Parsing\"]\n\t\t//newjson [label=\"\\{|\\\"|<a>m|s|g|\\\\0|:|\\\"|<b>H|e|l|l|o|\\\\n|W|o|r|l|d|!|\\\\0|\\\"|,|\\\"|<c>s|t|a|r|s|\\\\0|t|a|r|s|:|1|0|\\}\", xlabel=\"After Parsing\"]\n\t\tnewjson [shape=plaintext, label=<\n<table BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"2\"><tr>\n<td>{</td>\n<td>\"</td><td port=\"a\">m</td><td>s</td><td>g</td><td bgcolor=\"yellow\">\\\\0</td>\n<td>:</td>\n<td>\"</td><td port=\"b\">H</td><td>e</td><td>l</td><td>l</td><td>o</td><td bgcolor=\"yellow\">\\\\n</td><td bgcolor=\"yellow\">W</td><td bgcolor=\"yellow\">o</td><td bgcolor=\"yellow\">r</td><td bgcolor=\"yellow\">l</td><td bgcolor=\"yellow\">d</td><td bgcolor=\"yellow\">!</td><td bgcolor=\"yellow\">\\\\0</td><td>\"</td>\n<td>,</td>\n<td>\"</td><td port=\"c\" bgcolor=\"yellow\">s</td><td bgcolor=\"yellow\">t</td><td bgcolor=\"yellow\">a</td><td bgcolor=\"yellow\">r</td><td bgcolor=\"yellow\">s</td><td bgcolor=\"yellow\">\\\\0</td><td>t</td><td>a</td><td>r</td><td>s</td>\n<td>:</td>\n<td>1</td><td>0</td>\n<td>}</td>\n</tr></table>\n>, xlabel=\"After Parsing\"]\n\t}\n\n\tsubgraph cluster1 {\n\t\tmargin=\"10,10\"\n\t\tlabeljust=\"left\"\n\t\tlabel = \"Document by In situ Parsing\"\n\t\tstyle=filled\n\t\tfillcolor=gray95\n\t\tnode [shape=Mrecord, style=filled, colorscheme=spectral7]\n\t\t\n\t\troot [label=\"{object|}\", fillcolor=3]\n\n\t\t{\t\t\t\n\t\t\tmsg [label=\"{string|<a>}\", fillcolor=5]\n\t\t\thelloworld [label=\"{string|<a>}\", fillcolor=5]\n\t\t\tstars [label=\"{string|<a>}\", fillcolor=5]\n\t\t\tten [label=\"{number|10}\", fillcolor=6]\n\t\t}\n\t}\n\n\toldjson -> root [label=\" ParseInsitu()\" lhead=\"cluster1\"]\n\tedge [arrowhead=vee]\n\troot -> { msg; stars }\n\n\tedge [arrowhead=\"none\"]\n\tmsg  -> helloworld\n\tstars -> ten\n\n\t{\n\t\tedge [arrowhead=vee, arrowtail=dot, arrowsize=0.5, dir=both, tailclip=false]\n\t\tmsg:a:c -> newjson:a\n\t\thelloworld:a:c -> newjson:b\n\t\tstars:a:c -> newjson:c\n\t}\n\n\t//oldjson -> newjson [style=invis]\n}"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/diagram/iterative-parser-states-diagram.dot",
    "content": "digraph {\n    fontname=\"Inconsolata, Consolas\"\n    fontsize=10\n    margin=\"0,0\"\n    penwidth=0.0\n    \n    node [fontname=\"Inconsolata, Consolas\", fontsize=10, penwidth=0.5]\n    edge [fontname=\"Inconsolata, Consolas\", fontsize=10, penwidth=0.5]\n\n    node [shape = doublecircle]; Start; Finish;\n    node [shape = box; style = \"rounded, filled\"; fillcolor=white ];\n\n    Start -> ArrayInitial [label=\" [\"];\n    Start -> ObjectInitial [label=\" {\"];\n\n    subgraph clusterArray {\n        margin=\"10,10\"\n        style=filled\n        fillcolor=gray95\n        label = \"Array\"\n        \n        ArrayInitial; Element; ElementDelimiter; ArrayFinish;\n    }\n\n    subgraph clusterObject {\n        margin=\"10,10\"\n        style=filled\n        fillcolor=gray95\n        label = \"Object\"\n\n        ObjectInitial; MemberKey; KeyValueDelimiter; MemberValue; MemberDelimiter; ObjectFinish;\n    }\n\n    ArrayInitial -> ArrayInitial [label=\"[\"];\n    ArrayInitial -> ArrayFinish [label=\" ]\"];\n    ArrayInitial -> ObjectInitial [label=\"{\", constraint=false];\n    ArrayInitial -> Element [label=\"string\\nfalse\\ntrue\\nnull\\nnumber\"];\n\n    Element -> ArrayFinish [label=\"]\"];\n    Element -> ElementDelimiter [label=\",\"];\n\n    ElementDelimiter -> ArrayInitial [label=\" [\"];\n    ElementDelimiter -> ObjectInitial [label=\"{\"];\n    ElementDelimiter -> Element [label=\"string\\nfalse\\ntrue\\nnull\\nnumber\"];\n\n    ObjectInitial -> ObjectFinish [label=\" }\"];\n    ObjectInitial -> MemberKey [label=\" string \"];\n\n    MemberKey -> KeyValueDelimiter [label=\":\"];\n\n    KeyValueDelimiter -> ArrayInitial [label=\"[\"];\n    KeyValueDelimiter -> ObjectInitial [label=\" {\"];\n    KeyValueDelimiter -> MemberValue [label=\" string\\n false\\n true\\n null\\n number\"];\n\n    MemberValue -> ObjectFinish [label=\"}\"];\n    MemberValue -> MemberDelimiter [label=\",\"];\n\n    MemberDelimiter -> MemberKey [label=\" string \"];\n\n    ArrayFinish -> Finish;\n    ObjectFinish -> Finish;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/diagram/makefile",
    "content": "%.pdf: %.dot\n\tdot $< -Tpdf -o $@\n\n%.png: %.dot\n\tdot $< -Tpng -o $@\n\nDOTFILES = $(basename $(wildcard *.dot))\nall: $(addsuffix .png, $(DOTFILES)) $(addsuffix .pdf, $(DOTFILES))\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/diagram/move1.dot",
    "content": "digraph {\n\tcompound=true\n\tfontname=\"Inconsolata, Consolas\"\n\tfontsize=10\n\tmargin=\"0,0\"\n\tranksep=0.2\n\tpenwidth=0.5\n\n\tnode [fontname=\"Inconsolata, Consolas\", fontsize=10, penwidth=0.5]\n\tedge [fontname=\"Inconsolata, Consolas\", fontsize=10, arrowhead=normal]\n\n\tsubgraph cluster1 {\n\t\tmargin=\"10,10\"\n\t\tlabeljust=\"left\"\n\t\tlabel = \"Before\"\n\t\tstyle=filled\n\t\tfillcolor=gray95\n\n\t\tnode [shape=Mrecord, style=filled, colorscheme=spectral7]\n\n\t\t{\n\t\t\trank = same\n\t\t\tb1 [label=\"{b:number|456}\", fillcolor=6]\n\t\t\ta1 [label=\"{a:number|123}\", fillcolor=6]\n\t\t}\n\n\t\ta1 -> b1 [style=\"dashed\", label=\"Move\", dir=back]\n\t}\n\n\tsubgraph cluster2 {\n\t\tmargin=\"10,10\"\n\t\tlabeljust=\"left\"\n\t\tlabel = \"After\"\n\t\tstyle=filled\n\t\tfillcolor=gray95\n\n\t\tnode [shape=Mrecord, style=filled, colorscheme=spectral7]\n\n\t\t{\n\t\t\trank = same\n\t\t\tb2 [label=\"{b:null|}\", fillcolor=1]\n\t\t\ta2 [label=\"{a:number|456}\", fillcolor=6]\n\t\t}\n\t\ta2 -> b2 [style=invis, dir=back]\n\t}\n\tb1 -> b2 [style=invis]\n}"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/diagram/move2.dot",
    "content": "digraph {\n\tcompound=true\n\tfontname=\"Inconsolata, Consolas\"\n\tfontsize=10\n\tmargin=\"0,0\"\n\tranksep=0.2\n\tpenwidth=0.5\n\n\tnode [fontname=\"Inconsolata, Consolas\", fontsize=10, penwidth=0.5]\n\tedge [fontname=\"Inconsolata, Consolas\", fontsize=10, arrowhead=normal]\n\n\tsubgraph cluster1 {\n\t\tmargin=\"10,10\"\n\t\tlabeljust=\"left\"\n\t\tlabel = \"Before Copying (Hypothetic)\"\n\t\tstyle=filled\n\t\tfillcolor=gray95\n\n\t\tnode [shape=Mrecord, style=filled, colorscheme=spectral7]\n\n\t\tc1 [label=\"{contact:array|}\", fillcolor=4]\n\t\tc11 [label=\"{|}\"]\n\t\tc12 [label=\"{|}\"]\n\t\tc13 [shape=\"none\", label=\"...\", style=\"solid\"]\n\t\to1 [label=\"{o:object|}\", fillcolor=3]\n\t\tghost [label=\"{o:object|}\", style=invis]\n\n\t\tc1 -> o1 [style=\"dashed\", label=\"AddMember\", constraint=false]\n\n\t\tedge [arrowhead=vee]\n\t\tc1 -> { c11; c12; c13 }\n\t\to1 -> ghost [style=invis]\n\t}\n\n\tsubgraph cluster2 {\n\t\tmargin=\"10,10\"\n\t\tlabeljust=\"left\"\n\t\tlabel = \"After Copying (Hypothetic)\"\n\t\tstyle=filled\n\t\tfillcolor=gray95\n\n\t\tnode [shape=Mrecord, style=filled, colorscheme=spectral7]\n\n\t\tc2 [label=\"{contact:array|}\", fillcolor=4]\n\t\tc3 [label=\"{array|}\", fillcolor=4]\n\t\tc21 [label=\"{|}\"]\n\t\tc22 [label=\"{|}\"]\n\t\tc23 [shape=none, label=\"...\", style=\"solid\"]\n\t\to2 [label=\"{o:object|}\", fillcolor=3]\n\t\tcs [label=\"{string|\\\"contact\\\"}\", fillcolor=5]\n\t\tc31 [label=\"{|}\"]\n\t\tc32 [label=\"{|}\"]\n\t\tc33 [shape=\"none\", label=\"...\", style=\"solid\"]\n\n\t\tedge [arrowhead=vee]\n\t\tc2 -> { c21; c22; c23 }\n\t\to2 -> cs\n\t\tcs -> c3 [arrowhead=none]\n\t\tc3 -> { c31; c32; c33 }\n\t}\n\tghost -> o2 [style=invis]\n}"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/diagram/move3.dot",
    "content": "digraph {\n\tcompound=true\n\tfontname=\"Inconsolata, Consolas\"\n\tfontsize=10\n\tmargin=\"0,0\"\n\tranksep=0.2\n\tpenwidth=0.5\n\tforcelabels=true\n\n\tnode [fontname=\"Inconsolata, Consolas\", fontsize=10, penwidth=0.5]\n\tedge [fontname=\"Inconsolata, Consolas\", fontsize=10, arrowhead=normal]\n\n\tsubgraph cluster1 {\n\t\tmargin=\"10,10\"\n\t\tlabeljust=\"left\"\n\t\tlabel = \"Before Moving\"\n\t\tstyle=filled\n\t\tfillcolor=gray95\n\n\t\tnode [shape=Mrecord, style=filled, colorscheme=spectral7]\n\n\t\tc1 [label=\"{contact:array|}\", fillcolor=4]\n\t\tc11 [label=\"{|}\"]\n\t\tc12 [label=\"{|}\"]\n\t\tc13 [shape=none, label=\"...\", style=\"solid\"]\n\t\to1 [label=\"{o:object|}\", fillcolor=3]\n\t\tghost [label=\"{o:object|}\", style=invis]\n\n\t\tc1 -> o1 [style=\"dashed\", constraint=false, label=\"AddMember\"]\n\n\t\tedge [arrowhead=vee]\n\t\tc1 -> { c11; c12; c13 }\n\t\to1 -> ghost [style=invis]\n\t}\n\n\tsubgraph cluster2 {\n\t\tmargin=\"10,10\"\n\t\tlabeljust=\"left\"\n\t\tlabel = \"After Moving\"\n\t\tstyle=filled\n\t\tfillcolor=gray95\n\n\t\tnode [shape=Mrecord, style=filled, colorscheme=spectral7]\n\n\t\tc2 [label=\"{contact:null|}\", fillcolor=1]\n\t\tc3 [label=\"{array|}\", fillcolor=4]\n\t\tc21 [label=\"{|}\"]\n\t\tc22 [label=\"{|}\"]\n\t\tc23 [shape=\"none\", label=\"...\", style=\"solid\"]\n\t\to2 [label=\"{o:object|}\", fillcolor=3]\n\t\tcs [label=\"{string|\\\"contact\\\"}\", fillcolor=5]\n\t\tc2 -> o2 [style=\"dashed\", constraint=false, label=\"AddMember\", style=invis]\n\n\t\tedge [arrowhead=vee]\n\t\tc3 -> { c21; c22; c23 }\n\t\to2 -> cs\n\t\tcs -> c3 [arrowhead=none]\n\t}\n\tghost -> o2 [style=invis]\n}"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/diagram/normalparsing.dot",
    "content": "digraph {\n\tcompound=true\n\tfontname=\"Inconsolata, Consolas\"\n\tfontsize=10\n\tmargin=\"0,0\"\n\tranksep=0.2\n\tpenwidth=0.5\n\t\n\tnode [fontname=\"Inconsolata, Consolas\", fontsize=10, penwidth=0.5]\n\tedge [fontname=\"Inconsolata, Consolas\", fontsize=10, arrowhead=normal]\n\n\t{\n\t\tnode [shape=record, fontsize=\"8\", margin=\"0.04\", height=0.2, color=gray]\n\t\tnormaljson [label=\"\\{|\\\"|m|s|g|\\\"|:|\\\"|H|e|l|l|o|\\\\|n|W|o|r|l|d|!|\\\"|,|\\\"|\\\\|u|0|0|7|3|t|a|r|s\\\"|:|1|0|\\}\"]\n\n\t\t{\n\t\t\trank = same\n\t\t\tmsgstring  [label=\"m|s|g|\\\\0\"]\n\t\t\thelloworldstring  [label=\"H|e|l|l|o|\\\\n|W|o|r|l|d|!|\\\\0\"]\n\t\t\tstarsstring [label=\"s|t|a|r|s\\\\0\"]\n\t\t}\n\t}\n\n\tsubgraph cluster1 {\n\t\tmargin=\"10,10\"\n\t\tlabeljust=\"left\"\n\t\tlabel = \"Document by Normal Parsing\"\n\t\tstyle=filled\n\t\tfillcolor=gray95\n\t\tnode [shape=Mrecord, style=filled, colorscheme=spectral7]\n\t\t\n\t\troot [label=\"{object|}\", fillcolor=3]\n\n\t\t{\t\t\t\n\t\t\tmsg [label=\"{string|<a>}\", fillcolor=5]\n\t\t\thelloworld [label=\"{string|<a>}\", fillcolor=5]\n\t\t\tstars [label=\"{string|<a>}\", fillcolor=5]\n\t\t\tten [label=\"{number|10}\", fillcolor=6]\n\t\t}\n\t}\n\n\tnormaljson -> root [label=\" Parse()\" lhead=\"cluster1\"]\n\tedge [arrowhead=vee]\n\troot -> { msg; stars }\n\n\tedge [arrowhead=\"none\"]\n\tmsg  -> helloworld\n\tstars -> ten\n\n\tedge [arrowhead=vee, arrowtail=dot, arrowsize=0.5, dir=both, tailclip=false]\n\tmsg:a:c -> msgstring:w\n\thelloworld:a:c -> helloworldstring:w\n\tstars:a:c -> starsstring:w\n\n\tmsgstring -> helloworldstring -> starsstring [style=invis]\n}"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/diagram/simpledom.dot",
    "content": "digraph {\n\tcompound=true\n\tfontname=\"Inconsolata, Consolas\"\n\tfontsize=10\n\tmargin=\"0,0\"\n\tranksep=0.2\n\tpenwidth=0.5\n\t\n\tnode [fontname=\"Inconsolata, Consolas\", fontsize=10, penwidth=0.5]\n\tedge [fontname=\"Inconsolata, Consolas\", fontsize=10, arrowhead=normal]\n\n\t{\n\t\tnode [shape=record, fontsize=\"8\", margin=\"0.04\", height=0.2, color=gray]\n\t\tsrcjson [label=\"\\{|p|r|o|j|e|c|t|\\\"|:|\\\"|r|a|p|i|d|j|s|o|n|\\\"|,|\\\"|s|t|a|r|s|\\\"|:|1|0|\\}\"]\n\t\tdstjson [label=\"\\{|p|r|o|j|e|c|t|\\\"|:|\\\"|r|a|p|i|d|j|s|o|n|\\\"|,|\\\"|s|t|a|r|s|\\\"|:|1|1|\\}\"]\n\t}\n\n\t{\n\t\tnode [shape=\"box\", style=\"filled\", fillcolor=\"gray95\"]\n\t\tDocument2 [label=\"(Modified) Document\"]\n\t\tWriter\n\t}\n\n\tsubgraph cluster1 {\n\t\tmargin=\"10,10\"\n\t\tlabeljust=\"left\"\n\t\tlabel = \"Document\"\n\t\tstyle=filled\n\t\tfillcolor=gray95\n\t\tnode [shape=Mrecord, style=filled, colorscheme=spectral7]\n\t\t\n\t\troot [label=\"{object|}\", fillcolor=3]\n\n\t\t{\t\t\t\n\t\t\tproject [label=\"{string|\\\"project\\\"}\", fillcolor=5]\n\t\t\trapidjson [label=\"{string|\\\"rapidjson\\\"}\", fillcolor=5]\n\t\t\tstars [label=\"{string|\\\"stars\\\"}\", fillcolor=5]\n\t\t\tten [label=\"{number|10}\", fillcolor=6]\n\t\t}\n\n\t\tedge [arrowhead=vee]\n\t\troot -> { project; stars }\n\n\t\tedge [arrowhead=\"none\"]\n\t\tproject -> rapidjson\n\t\tstars -> ten\n\t}\n\n\tsrcjson -> root [label=\" Parse()\", lhead=\"cluster1\"]\n\n\tten -> Document2 [label=\" Increase \\\"stars\\\"\", ltail=\"cluster1\" ]\n\tDocument2  -> Writer [label=\" Traverse DOM by Accept()\"]\n\tWriter -> dstjson [label=\" Output to StringBuffer\"]\n}"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/diagram/tutorial.dot",
    "content": "digraph {\n\tcompound=true\n\tfontname=\"Inconsolata, Consolas\"\n\tfontsize=10\n\tmargin=\"0,0\"\n\tranksep=0.2\n\tpenwidth=0.5\n\t\n\tnode [fontname=\"Inconsolata, Consolas\", fontsize=10, penwidth=0.5]\n\tedge [fontname=\"Inconsolata, Consolas\", fontsize=10]\n\n\tsubgraph cluster1 {\n\t\tmargin=\"10,10\"\n\t\tlabeljust=\"left\"\n\t\tlabel = \"Document\"\n\t\tstyle=filled\n\t\tfillcolor=gray95\n\t\tnode [shape=Mrecord, style=filled, colorscheme=spectral7]\n\t\t\n\t\troot [label=\"{object|}\", fillcolor=3]\n\n\t\t{\t\t\t\n\t\t\thello [label=\"{string|\\\"hello\\\"}\", fillcolor=5]\n\t\t\tt [label=\"{string|\\\"t\\\"}\", fillcolor=5]\n\t\t\tf [label=\"{string|\\\"f\\\"}\", fillcolor=5]\n\t\t\tn [label=\"{string|\\\"n\\\"}\", fillcolor=5]\n\t\t\ti [label=\"{string|\\\"i\\\"}\", fillcolor=5]\n\t\t\tpi [label=\"{string|\\\"pi\\\"}\", fillcolor=5]\n\t\t\ta [label=\"{string|\\\"a\\\"}\", fillcolor=5]\n\n\t\t\tworld [label=\"{string|\\\"world\\\"}\", fillcolor=5]\n\t\t\ttrue [label=\"{true|}\", fillcolor=7]\n\t\t\tfalse [label=\"{false|}\", fillcolor=2]\n\t\t\tnull [label=\"{null|}\", fillcolor=1]\n\t\t\ti1 [label=\"{number|123}\", fillcolor=6]\n\t\t\tpi1 [label=\"{number|3.1416}\", fillcolor=6]\n\t\t\tarray [label=\"{array|size=4}\", fillcolor=4]\n\n\t\t\ta1 [label=\"{number|1}\", fillcolor=6]\n\t\t\ta2 [label=\"{number|2}\", fillcolor=6]\n\t\t\ta3 [label=\"{number|3}\", fillcolor=6]\n\t\t\ta4 [label=\"{number|4}\", fillcolor=6]\n\t\t}\n\n\t\tedge [arrowhead=vee]\n\t\troot -> { hello; t; f; n; i; pi; a }\t\t\n\t\tarray -> { a1; a2; a3; a4 }\n\n\t\tedge [arrowhead=none]\n\t\thello -> world\n\t\tt -> true\n\t\tf -> false\n\t\tn -> null\n\t\ti -> i1\n\t\tpi -> pi1\n\t\ta -> array\n\t}\n}"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/dom.md",
    "content": "# DOM\n\nDocument Object Model(DOM) is an in-memory representation of JSON for query and manipulation. The basic usage of DOM is described in [Tutorial](doc/tutorial.md). This section will describe some details and more advanced usages.\n\n[TOC]\n\n# Template {#Template}\n\nIn the tutorial,  `Value` and `Document` was used. Similarly to `std::string`, these are actually `typedef` of template classes:\n\n~~~~~~~~~~cpp\nnamespace rapidjson {\n\ntemplate <typename Encoding, typename Allocator = MemoryPoolAllocator<> >\nclass GenericValue {\n    // ...\n};\n\ntemplate <typename Encoding, typename Allocator = MemoryPoolAllocator<> >\nclass GenericDocument : public GenericValue<Encoding, Allocator> {\n    // ...\n};\n\ntypedef GenericValue<UTF8<> > Value;\ntypedef GenericDocument<UTF8<> > Document;\n\n} // namespace rapidjson\n~~~~~~~~~~\n\nUser can customize these template parameters.\n\n## Encoding {#Encoding}\n\nThe `Encoding` parameter specifies the encoding of JSON String value in memory. Possible options are `UTF8`, `UTF16`, `UTF32`. Note that, these 3 types are also template class. `UTF8<>` is `UTF8<char>`, which means using char to store the characters. You may refer to [Encoding](encoding.md) for details.\n\nSuppose a Windows application would query localization strings stored in JSON files. Unicode-enabled functions in Windows use UTF-16 (wide character) encoding. No matter what encoding was used in JSON files, we can store the strings in UTF-16 in memory.\n\n~~~~~~~~~~cpp\nusing namespace rapidjson;\n\ntypedef GenericDocument<UTF16<> > WDocument;\ntypedef GenericValue<UTF16<> > WValue;\n\nFILE* fp = fopen(\"localization.json\", \"rb\"); // non-Windows use \"r\"\n\nchar readBuffer[256];\nFileReadStream bis(fp, readBuffer, sizeof(readBuffer));\n\nAutoUTFInputStream<unsigned, FileReadStream> eis(bis);  // wraps bis into eis\n\nWDocument d;\nd.ParseStream<0, AutoUTF<unsigned> >(eis);\n\nconst WValue locale(L\"ja\"); // Japanese\n\nMessageBoxW(hWnd, d[locale].GetString(), L\"Test\", MB_OK);\n~~~~~~~~~~\n\n## Allocator {#Allocator}\n\nThe `Allocator` defines which allocator class is used when allocating/deallocating memory for `Document`/`Value`. `Document` owns, or references to an `Allocator` instance. On the other hand, `Value` does not do so, in order to reduce memory consumption.\n\nThe default allocator used in `GenericDocument` is `MemoryPoolAllocator`. This allocator actually allocate memory sequentially, and cannot deallocate one by one. This is very suitable when parsing a JSON to generate a DOM tree.\n\nAnother allocator is `CrtAllocator`, of which CRT is short for C RunTime library. This allocator simply calls the standard `malloc()`/`realloc()`/`free()`. When there is a lot of add and remove operations, this allocator may be preferred. But this allocator is far less efficient than `MemoryPoolAllocator`.\n\n# Parsing {#Parsing}\n\n`Document` provides several functions for parsing. In below, (1) is the fundamental function, while the others are helpers which call (1).\n\n~~~~~~~~~~cpp\nusing namespace rapidjson;\n\n// (1) Fundamental\ntemplate <unsigned parseFlags, typename SourceEncoding, typename InputStream>\nGenericDocument& GenericDocument::ParseStream(InputStream& is);\n\n// (2) Using the same Encoding for stream\ntemplate <unsigned parseFlags, typename InputStream>\nGenericDocument& GenericDocument::ParseStream(InputStream& is);\n\n// (3) Using default parse flags\ntemplate <typename InputStream>\nGenericDocument& GenericDocument::ParseStream(InputStream& is);\n\n// (4) In situ parsing\ntemplate <unsigned parseFlags, typename SourceEncoding>\nGenericDocument& GenericDocument::ParseInsitu(Ch* str);\n\n// (5) In situ parsing, using same Encoding for stream\ntemplate <unsigned parseFlags>\nGenericDocument& GenericDocument::ParseInsitu(Ch* str);\n\n// (6) In situ parsing, using default parse flags\nGenericDocument& GenericDocument::ParseInsitu(Ch* str);\n\n// (7) Normal parsing of a string\ntemplate <unsigned parseFlags, typename SourceEncoding>\nGenericDocument& GenericDocument::Parse(const Ch* str);\n\n// (8) Normal parsing of a string, using same Encoding for stream\ntemplate <unsigned parseFlags>\nGenericDocument& GenericDocument::Parse(const Ch* str);\n\n// (9) Normal parsing of a string, using default parse flags\nGenericDocument& GenericDocument::Parse(const Ch* str);\n~~~~~~~~~~\n\nThe examples of [tutorial](tutorial.md) uses (9) for normal parsing of string. The examples of [stream](stream.md) uses the first three. *In situ* parsing will be described soon.\n\nThe `parseFlags` are combination of the following bit-flags:\n\nParse flags                   | Meaning\n------------------------------|-----------------------------------\n`kParseDefaultFlags = 0`      | Default parse flags. \n`kParseInsituFlag`            | In-situ(destructive) parsing.\n`kParseValidateEncodingFlag`  | Validate encoding of JSON strings.\n\nBy using a non-type template parameter, instead of a function parameter, C++ compiler can generate code which is optimized for specified combinations, improving speed, and reducing code size (if only using a single specialization). The downside is the flags needed to be determined in compile-time.\n\nThe `SourceEncoding` parameter defines what encoding is in the stream. This can be differed to the `Encoding` of the `Document`. See [Transcoding and Validation](#TranscodingAndValidation) section for details.\n\nAnd the `InputStream` is type of input stream.\n\n## Parse Error {#ParseError}\n\nWhen the parse processing succeeded, the `Document` contains the parse results. When there is an error, the original DOM is *unchanged*. And the error state of parsing can be obtained by `bool HasParseError()`,  `ParseErrorCode GetParseError()` and `size_t GetParseOffet()`.\n\nParse Error Code                            | Description\n--------------------------------------------|---------------------------------------------------\n`kParseErrorNone`                           | No error.\n`kParseErrorDocumentEmpty`                  | The document is empty.\n`kParseErrorDocumentRootNotObjectOrArray`   | The document root must be either object or array.\n`kParseErrorDocumentRootNotSingular`        | The document root must not follow by other values.\n`kParseErrorValueInvalid`                   | Invalid value.\n`kParseErrorObjectMissName`                 | Missing a name for object member.\n`kParseErrorObjectMissColon`                | Missing a colon after a name of object member.\n`kParseErrorObjectMissCommaOrCurlyBracket`  | Missing a comma or `}` after an object member.\n`kParseErrorArrayMissCommaOrSquareBracket`  | Missing a comma or `]` after an array element.\n`kParseErrorStringUnicodeEscapeInvalidHex`  | Incorrect hex digit after `\\\\u` escape in string.\n`kParseErrorStringUnicodeSurrogateInvalid`  | The surrogate pair in string is invalid.\n`kParseErrorStringEscapeInvalid`            | Invalid escape character in string.\n`kParseErrorStringMissQuotationMark`        | Missing a closing quotation mark in string.\n`kParseErrorStringInvalidEncoding`          | Invalid encoding in string.\n`kParseErrorNumberTooBig`                   | Number too big to be stored in `double`.\n`kParseErrorNumberMissFraction`             | Miss fraction part in number.\n`kParseErrorNumberMissExponent`             | Miss exponent in number.\n\nThe offset of error is defined as the character number from beginning of stream. Currently RapidJSON does not keep track of line number.\n\nTo get an error message, RapidJSON provided a English messages in `rapidjson/error/en.h`. User can customize it for other locales, or use a custom localization system.\n\nHere shows an example of parse error handling.\n\n~~~~~~~~~~cpp\n// TODO: example\n~~~~~~~~~~\n\n## In Situ Parsing {#InSituParsing}\n\nFrom [Wikipedia](http://en.wikipedia.org/wiki/In_situ):\n\n> *In situ* ... is a Latin phrase that translates literally to \"on site\" or \"in position\". It means \"locally\", \"on site\", \"on the premises\" or \"in place\" to describe an event where it takes place, and is used in many different contexts.\n> ...\n> (In computer science) An algorithm is said to be an in situ algorithm, or in-place algorithm, if the extra amount of memory required to execute the algorithm is O(1), that is, does not exceed a constant no matter how large the input. For example, heapsort is an in situ sorting algorithm.\n\nIn normal parsing process, a large overhead is to decode JSON strings and copy them to other buffers. *In situ* parsing decodes those JSON string at the place where it is stored. It is possible in JSON because the decoded string is always shorter than the one in JSON. In this context, decoding a JSON string means to process the escapes, such as `\"\\n\"`, `\"\\u1234\"`, etc., and add a null terminator (`'\\0'`)at the end of string.\n\nThe following diagrams compare normal and *in situ* parsing. The JSON string values contain pointers to the decoded string.\n\n![normal parsing](diagram/normalparsing.png)\n\nIn normal parsing, the decoded string are copied to freshly allocated buffers. `\"\\\\n\"` (2 characters) is decoded as `\"\\n\"` (1 character). `\"\\\\u0073\"` (6 characters) is decoded as \"s\" (1 character).\n\n![instiu parsing](diagram/insituparsing.png)\n\n*In situ* parsing just modified the original JSON. Updated characters are highlighted in the diagram. If the JSON string does not contain escape character, such as `\"msg\"`, the parsing process merely replace the closing double quotation mark with a null character.\n\nSince *in situ* parsing modify the input, the parsing API needs `char*` instead of `const char*`.\n\n~~~~~~~~~~cpp\n// Read whole file into a buffer\nFILE* fp = fopen(\"test.json\", \"r\");\nfseek(fp, 0, SEEK_END);\nsize_t filesize = (size_t)ftell(fp);\nfseek(fp, 0, SEEK_SET);\nchar* buffer = (char*)malloc(filesize + 1);\nsize_t readLength = fread(buffer, 1, filesize, fp);\nbuffer[readLength] = '\\0';\nfclose(fp);\n\n// In situ parsing the buffer into d, buffer will also be modified\nDocument d;\nd.ParseInsitu(buffer);\n\n// Query/manipulate the DOM here...\n\nfree(buffer);\n// Note: At this point, d may have dangling pointers pointed to the deallocated buffer.\n~~~~~~~~~~\n\nThe JSON strings are marked as constant-string. But they may not be really \"constant\". The life cycle of it depends on the JSON buffer.\n\nIn situ parsing minimizes allocation overheads and memory copying. Generally this improves cache coherence, which is an important factor of performance in modern computer.\n\nThere are some limitations of *in situ* parsing:\n\n1. The whole JSON is in memory.\n2. The source encoding in stream and target encoding in document must be the same.\n3. The buffer need to be retained until the document is no longer used.\n4. If the DOM need to be used for long period after parsing, and there are few JSON strings in the DOM, retaining the buffer may be a memory waste.\n\n*In situ* parsing is mostly suitable for short-term JSON that only need to be processed once, and then be released from memory. In practice, these situation is very common, for example, deserializing JSON to C++ objects, processing web requests represented in JSON, etc.\n\n## Transcoding and Validation {#TranscodingAndValidation}\n\nRapidJSON supports conversion between Unicode formats (officially termed UCS Transformation Format) internally. During DOM parsing, the source encoding of the stream can be different from the encoding of the DOM. For example, the source stream contains a UTF-8 JSON, while the DOM is using UTF-16 encoding. There is an example code in [EncodedInputStream](doc/stream.md#EncodedInputStream).\n\nWhen writing a JSON from DOM to output stream, transcoding can also be used. An example is in [EncodedOutputStream](stream.md##EncodedOutputStream).\n\nDuring transcoding, the source string is decoded to into Unicode code points, and then the code points are encoded in the target format. During decoding, it will validate the byte sequence in the source string. If it is not a valid sequence, the parser will be stopped with `kParseErrorStringInvalidEncoding` error.\n\nWhen the source encoding of stream is the same as encoding of DOM, by default, the parser will *not* validate the sequence. User may use `kParseValidateEncodingFlag` to force validation.\n\n# Techniques {#Techniques}\n\nSome techniques about using DOM API is discussed here.\n\n## DOM as SAX Event Publisher\n\nIn RapidJSON, stringifying a DOM with `Writer` may be look a little bit weired.\n\n~~~~~~~~~~cpp\n// ...\nWriter<StringBuffer> writer(buffer);\nd.Accept(writer);\n~~~~~~~~~~\n\nActually, `Value::Accept()` is responsible for publishing SAX events about the value to the handler. With this design, `Value` and `Writer` are decoupled. `Value` can generate SAX events, and `Writer` can handle those events.\n\nUser may create customer handlers for transforming the DOM into other formats. For example, a handler which converts the DOM into XML.\n\n~~~~~~~~~~cpp\n// TODO: example\n~~~~~~~~~~\n\nFor more about SAX events and handler, please refer to [SAX](doc/sax.md).\n\n## User Buffer {#UserBuffer}\n\nSome applications may try to avoid memory allocations whenever possible.\n\n`MemoryPoolAllocator` can support this by letting user to provide a buffer. The buffer can be on the program stack, or a \"scratch buffer\" which is statically allocated (a static/global array) for storing temporary data.\n\n`MemoryPoolAllocator` will use the user buffer to satisfy allocations. When the user buffer is used up, it will allocate a chunk of memory from the base allocator (by default the `CrtAllocator`).\n\nHere is an example of using stack memory.\n\n~~~~~~~~~~cpp\nchar buffer[1024];\nMemoryPoolAllocator allocator(buffer, sizeof(buffer));\n\nDocument d(&allocator);\nd.Parse(json);\n~~~~~~~~~~\n\nIf the total size of allocation is less than 1024 during parsing, this code does not invoke any heap allocation (via `new` or `malloc()`) at all.\n\nUser can query the current memory consumption in bytes via `MemoryPoolAllocator::Size()`. And then user can determine a suitable size of user buffer.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/encoding.md",
    "content": "# Encoding\n\nAccording to [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf),\n\n> (in Introduction) JSON text is a sequence of Unicode code points.\n\nThe earlier [RFC4627](http://www.ietf.org/rfc/rfc4627.txt) stated that,\n\n> (in §3) JSON text SHALL be encoded in Unicode.  The default encoding is UTF-8.\n\n> (in §6) JSON may be represented using UTF-8, UTF-16, or UTF-32. When JSON is written in UTF-8, JSON is 8bit compatible.  When JSON is written in UTF-16 or UTF-32, the binary content-transfer-encoding must be used.\n\nRapidJSON supports various encodings. It can also validate the encodings of JSON, and transconding JSON among encodings. All these features are implemented internally, without the need for external libraries (e.g. [ICU](http://site.icu-project.org/)).\n\n[TOC]\n\n# Unicode {#Unicode}\nFrom [Unicode's official website](http://www.unicode.org/standard/WhatIsUnicode.html):\n> Unicode provides a unique number for every character, \n> no matter what the platform,\n> no matter what the program,\n> no matter what the language.\n\nThose unique numbers are called code points, which is in the range `0x0` to `0x10FFFF`.\n\n## Unicode Transformation Format {#UTF}\n\nThere are various encodings for storing Unicode code points. These are called Unicode Transformation Format (UTF). RapidJSON supports the most commonly used UTFs, including\n\n* UTF-8: 8-bit variable-width encoding. It maps a code point to 1–4 bytes.\n* UTF-16: 16-bit variable-width encoding. It maps a code point to 1–2 16-bit code units (i.e., 2–4 bytes).\n* UTF-32: 32-bit fixed-width encoding. It directly maps a code point to a single 32-bit code unit (i.e. 4 bytes).\n\nFor UTF-16 and UTF-32, the byte order (endianness) does matter. Within computer memory, they are often stored in the computer's endianness. However, when it is stored in file or transferred over network, we need to state the byte order of the byte sequence, either little-endian (LE) or big-endian (BE). \n\nRapidJSON provide these encodings via the structs in `rapidjson/encodings.h`:\n\n~~~~~~~~~~cpp\nnamespace rapidjson {\n\ntemplate<typename CharType = char>\nstruct UTF8;\n\ntemplate<typename CharType = wchar_t>\nstruct UTF16;\n\ntemplate<typename CharType = wchar_t>\nstruct UTF16LE;\n\ntemplate<typename CharType = wchar_t>\nstruct UTF16BE;\n\ntemplate<typename CharType = unsigned>\nstruct UTF32;\n\ntemplate<typename CharType = unsigned>\nstruct UTF32LE;\n\ntemplate<typename CharType = unsigned>\nstruct UTF32BE;\n\n} // namespace rapidjson\n~~~~~~~~~~\n\nFor processing text in memory, we normally use `UTF8`, `UTF16` or `UTF32`. For processing text via I/O, we may use `UTF8`, `UTF16LE`, `UTF16BE`, `UTF32LE` or `UTF32BE`.\n\nWhen using the DOM-style API, the `Encoding` template parameter in `GenericValue<Encoding>` and `GenericDocument<Encoding>` indicates the encoding to be used to represent JSON string in memory. So normally we will use `UTF8`, `UTF16` or `UTF32` for this template parameter. The choice depends on operating systems and other libraries that the application is using. For example, Windows API represents Unicode characters in UTF-16, while most Linux distributions and applications prefer UTF-8.\n\nExample of UTF-16 DOM declaration:\n\n~~~~~~~~~~cpp\ntypedef GenericDocument<UTF16<> > WDocument;\ntypedef GenericValue<UTF16<> > WValue;\n~~~~~~~~~~\n\nFor a detail example, please check the example in [DOM's Encoding](doc/stream.md#Encoding) section.\n\n## Character Type {#CharacterType}\n\nAs shown in the declaration, each encoding has a `CharType` template parameter. Actually, it may be a little bit confusing, but each `CharType` stores a code unit, not a character (code point). As mentioned in previous section, a code point may be encoded to 1–4 code units for UTF-8.\n\nFor `UTF16(LE|BE)`, `UTF32(LE|BE)`, the `CharType` must be integer type of at least 2 and 4 bytes  respectively.\n\nNote that C++11 introduces `char16_t` and `char32_t`, which can be used for `UTF16` and `UTF32` respectively.\n\n## AutoUTF {#AutoUTF}\n\nPrevious encodings are statically bound in compile-time. In other words, user must know exactly which encodings will be used in the memory or streams. However, sometimes we may need to read/write files of different encodings. The encoding needed to be decided in runtime.\n\n`AutoUTF` is an encoding designed for this purpose. It chooses which encoding to be used according to the input or output stream. Currently, it should be used with `EncodedInputStream` and `EncodedOutputStream`.\n\n## ASCII {#ASCII}\n\nAlthough the JSON standards did not mention about [ASCII](http://en.wikipedia.org/wiki/ASCII), sometimes we would like to write 7-bit ASCII JSON for applications that cannot handle UTF-8. Since any JSON can represent unicode characters in escaped sequence `\\uXXXX`, JSON can always be encoded in ASCII.\n\nHere is an example for writing a UTF-8 DOM into ASCII:\n\n~~~~~~~~~~cpp\nusing namespace rapidjson;\nDocument d; // UTF8<>\n// ...\nStringBuffer buffer;\nWriter<StringBuffer, Document::EncodingType, ASCII<> > writer(buffer);\nd.Accept(writer);\nstd::cout << buffer.GetString();\n~~~~~~~~~~\n\nASCII can be used in input stream. If the input stream contains bytes with values above 127, it will cause `kParseErrorStringInvalidEncoding` error.\n\nASCII *cannot* be used in memory (encoding of `Document` or target encoding of `Reader`), as it cannot represent Unicode code points.\n\n# Validation & Transcoding {#ValidationTranscoding}\n\nWhen RapidJSON parses a JSON, it can validate the input JSON, whether it is a valid sequence of a specified encoding. This option can be turned on by adding `kParseValidateEncodingFlag` in `parseFlags` template parameter.\n\nIf the input encoding and output encoding is different, `Reader` and `Writer` will automatically transcode (convert) the text. In this case, `kParseValidateEncodingFlag` is not necessary, as it must decode the input sequence. And if the sequence was unable to be decoded, it must be invalid.\n\n## Transcoder {#Transcoder}\n\nAlthough the encoding functions in RapidJSON are designed for JSON parsing/generation, user may abuse them for transcoding of non-JSON strings.\n\nHere is an example for transcoding a string from UTF-8 to UTF-16:\n\n~~~~~~~~~~cpp\n#include \"rapidjson/encodings.h\"\n\nusing namespace rapidjson;\n\nconst char* s = \"...\"; // UTF-8 string\nStringStream source(s);\nGenericStringBuffer<UTF16<> > target;\n\nbool hasError = false;\nwhile (source.Peak() != '\\0')\n    if (!Transcoder::Transcode<UTF8<>, UTF16<> >(source, target)) {\n        hasError = true;\n        break;\n    }\n\nif (!hasError) {\n    const wchar_t* t = target.GetString();\n    // ...\n}\n~~~~~~~~~~\n\nYou may also use `AutoUTF` and the associated streams for setting source/target encoding in runtime.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/faq.md",
    "content": "# FAQ\n\n## General\n\n1. What is RapidJSON?\n\n   RapidJSON is a C++ library for parsing and generating JSON. You may check all [features](features.md) of it.\n\n2. Why is it named so?\n\n   It is inspired by [RapidXML](http://rapidxml.sourceforge.net/), which is a fast XML DOM parser. RapidJSON borrowed some designs of RapidXML, including *in situ* parsing, header-only library, and more.\n\n3. Is it similar to RapidXML?\n4. Is it free?\n5. Is it small? What are its dependencies? \n6. How to install RapidJSON?\n7. Can it run on my platform?\n8. Does it support C++03? C++11?\n9. Does it really work in real applications?\n10. How it is tested?\n11. Is it well documented?\n12. Are there alternatives?\n\n## JSON\n\n1. What is JSON?\n2. What is application of JSON?\n2. Does RapidJSON conform to the JSON standard?\n3. Does RapidJSON support relaxed syntax?\n\n## DOM and SAX\n\n1. What is DOM style API?\n2. What is SAX style API?\n3. Should I choose DOM or SAX?\n4. What is *in situ* parsing?\n5. When will parsing generates an error?\n6. What error information is provided? \n7. Why not just using `double` to represent JSON number?\n\n## Document/Value (DOM)\n\n1. What is move semantics? Why?\n2. How to copy a value?\n3. Why do I need to provide the length of string?\n4. Why do I need to provide allocator in many DOM manipulation API?\n5. Does it convert between numerical types?\n\n## Reader/Writer (SAX)\n\n1. Why not just `printf` a JSON? Why need a `Writer`? \n2. Why can't I parse a JSON which is just a number?\n3. Can I pause the parsing process and resume it later?\n\n## Unicode\n\n1. Does it support UTF-8, UTF-16 and other format?\n2. Can it validate the encoding?\n3. What is surrogate pair? Does RapidJSON support it?\n4. Can it handle '\\u0000' (null character) in JSON string?\n5. Can I output '\\uxxxx' for all non-ASCII character?\n\n## Stream\n\n1. I have a big JSON file. Should I load the whole file to memory?\n2. Can I parse JSON while it is streamed from network?\n3. I don't know what format will the JSON be. How to handle them?\n4. What is BOM? How RapidJSON handle it?\n5. Why little/big endian is related?\n\n## Performance\n\n1. Is RapidJSON really fast?\n2. Why is it fast?\n3. What is SIMD? How it is applied in RapidJSON?\n4. Does it consume a lot of memory?\n5. What is the purpose of being high performance?\n\n## Gossip\n\n1. Who are the developers of RapidJSON?\n2. Why do you develop RapidJSON?\n3. Why there is a long empty period of development?\n4. Why did the repository move from Google Code to GitHub?\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/features.md",
    "content": "# Features\n\n## General\n\n* Cross-platform\n * Compilers: Visual Studio, gcc, clang, etc.\n * Architectures: x86, x64, ARM, etc.\n * Operating systems: Windows, Mac OS X, Linux, iOS, Android, etc.\n* Easy installation\n * Header files only library. Just copy the headers to your project.\n* Self-contained, minimal dependences\n * No STL, BOOST, etc.\n * Only included `<cstdio>`, `<cstdlib>`, `<cstring>`, `<inttypes.h>`, `<new>`, `<stdint.h>`. \n* Without C++ exception, RTTI\n* High performance\n * Use template and inline functions to reduce function call overheads.\n * Optional SSE2/SSE4.1 support.\n\n## Standard compliance\n\n* RapidJSON should be fully RFC4627/ECMA-404 compliance.\n* Support Unicode surrogate.\n* Support null character (`\"\\u0000\"`)\n * For example, `[\"Hello\\u0000World\"]` can be parsed and handled gracefully. There is API for getting/setting lengths of string.\n\n## Unicode\n\n* Support UTF-8, UTF-16, UTF-32 encodings, including little endian and big endian.\n * These encodings are used in input/output streams and in-memory representation.\n* Support automatic detection of encodings in input stream.\n* Support transcoding between encodings internally.\n * For example, you can read a UTF-8 file and let RapidJSON transcode the JSON strings into UTF-16 in the DOM.\n* Support encoding validation internally.\n * For example, you can read a UTF-8 file, and let RapidJSON check whether all JSON strings are valid UTF-8 byte sequence.\n* Support custom character types.\n * By default the character types are `char` for UTF8, `wchar_t` for UTF16, `uint32_t` for UTF32.\n* Support custom encodings.\n\n## API styles\n\n* SAX (Simple API for XML) style API\n * Similar to [SAX](http://en.wikipedia.org/wiki/Simple_API_for_XML), RapidJSON provides a event sequential access parser API (`rapidjson::GenericReader`). It also provides a generator API (`rapidjson::Writer`) which consumes the same set of events.\n* DOM (Document Object Model) style API\n * Similar to [DOM](http://en.wikipedia.org/wiki/Document_Object_Model) for HTML/XML, RapidJSON can parse JSON into a DOM representation (`rapidjson::GenericDocument`), for easy manipulation, and finally stringify back to JSON if needed.\n * The DOM style API (`rapidjson::GenericDocument`) is actually implemented with SAX style API (`rapidjson::GenericReader`). SAX is faster but sometimes DOM is easier. Users can pick their choices according to scenarios.\n\n## DOM (Document)\n\n* Support *in situ* parsing.\n * Parse JSON string values in-place at the source JSON, and then the DOM points to addresses of those strings.\n * Faster than convention parsing: no allocation for strings, no copy (if string does not contain escapes), cache-friendly.\n* Support 32-bit/64-bit signed/unsigned integer and `double` for JSON number type.\n * RapidJSON checks range of numerical values for conversions.\n\n## SAX (Reader)\n\n* Support comprehensive error code if parsing failed.\n* Support error message localization.\n\n## SAX (Writer)\n\n* Support `rapidjson::PrettyWriter` for adding newlines and indentations.\n* Support custom precision for floating point values.\n\n## Stream\n\n* Support `rapidjson::GenericStringBuffer` for storing the output JSON as string.\n* Support `rapidjson::FileReadStream` and `rapidjson::FileWriteStream` for input/output `FILE` object.\n* Support custom streams.\n\n## Memory\n\n* Minimize memory overheads for DOM.\n * Each JSON value occupies exactly 16/20 bytes for most 32/64-bit machines (excluding text string).\n* Support fast default allocator.\n * A stack-based allocator (allocate sequentially, prohibit to free individual allocations, suitable for parsing).\n * User can provide a pre-allocated buffer. (Possible to parse a number of JSONs without any CRT allocation)\n* Support standard CRT(C-runtime) allocator.\n* Support custom allocators.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/internals.md",
    "content": "# Internals\n\nThis section records some design and implementation details.\n\n[TOC]\n\n# Value {#Value}\n\n## Data Layout {#DataLayout}\n\n## Flags {#Flags}\n\n# Allocator {#Allocator}\n\n## MemoryPoolAllocator {#MemoryPoolAllocator}\n\n# Parsing Optimization {#ParsingOptimization}\n\n## Skip Whitespace with SIMD {#SkipwhitespaceWithSIMD}\n\n## Pow10() {#Pow10}\n\n## Local Stream Copy {#LocalStreamCopy}\n\n# Parser {#Parser}\n\n## Iterative Parser {#IterativeParser}\n\nThe iterative parser is a recursive descent LL(1) parser\nimplemented in a non-recursive manner.\n\n### Grammar {#IterativeParserGrammar}\n\nThe grammar used for this parser is based on strict JSON syntax:\n~~~~~~~~~~\nS -> array | object\narray -> [ values ]\nobject -> { members }\nvalues -> non-empty-values | ε\nnon-empty-values -> value addition-values\naddition-values -> ε | , non-empty-values\nmembers -> non-empty-members | ε\nnon-empty-members -> member addition-members\naddition-members -> ε | , non-empty-members\nmember -> STRING : value\nvalue -> STRING | NUMBER | NULL | BOOLEAN | object | array\n~~~~~~~~~~\n\nNote that left factoring is applied to non-terminals `values` and `members`\nto make the grammar be LL(1).\n\n### Parsing Table {#IterativeParserParsingTable}\n\nBased on the grammar, we can construct the FIRST and FOLLOW set.\n\nThe FIRST set of non-terminals is listed below:\n\n|    NON-TERMINAL   |               FIRST              |\n|:-----------------:|:--------------------------------:|\n|       array       |                 [                |\n|       object      |                 {                |\n|       values      | ε STRING NUMBER NULL BOOLEAN { [ |\n|  addition-values  |              ε COMMA             |\n|      members      |             ε STRING             |\n|  addition-members |              ε COMMA             |\n|       member      |              STRING              |\n|       value       |  STRING NUMBER NULL BOOLEAN { [  |\n|         S         |                [ {               |\n| non-empty-members |              STRING              |\n|  non-empty-values |  STRING NUMBER NULL BOOLEAN { [  |\n\nThe FOLLOW set is listed below:\n\n|    NON-TERMINAL   |  FOLLOW |\n|:-----------------:|:-------:|\n|         S         |    $    |\n|       array       | , $ } ] |\n|       object      | , $ } ] |\n|       values      |    ]    |\n|  non-empty-values |    ]    |\n|  addition-values  |    ]    |\n|      members      |    }    |\n| non-empty-members |    }    |\n|  addition-members |    }    |\n|       member      |   , }   |\n|       value       |  , } ]  |\n\nFinally the parsing table can be constructed from FIRST and FOLLOW set:\n\n|    NON-TERMINAL   |           [           |           {           |          ,          | : | ] | } |          STRING         |         NUMBER        |          NULL         |        BOOLEAN        |\n|:-----------------:|:---------------------:|:---------------------:|:-------------------:|:-:|:-:|:-:|:-----------------------:|:---------------------:|:---------------------:|:---------------------:|\n|         S         |         array         |         object        |                     |   |   |   |                         |                       |                       |                       |\n|       array       |       [ values ]      |                       |                     |   |   |   |                         |                       |                       |                       |\n|       object      |                       |      { members }      |                     |   |   |   |                         |                       |                       |                       |\n|       values      |    non-empty-values   |    non-empty-values   |                     |   | ε |   |     non-empty-values    |    non-empty-values   |    non-empty-values   |    non-empty-values   |\n|  non-empty-values | value addition-values | value addition-values |                     |   |   |   |  value addition-values  | value addition-values | value addition-values | value addition-values |\n|  addition-values  |                       |                       |  , non-empty-values |   | ε |   |                         |                       |                       |                       |\n|      members      |                       |                       |                     |   |   | ε |    non-empty-members    |                       |                       |                       |\n| non-empty-members |                       |                       |                     |   |   |   | member addition-members |                       |                       |                       |\n|  addition-members |                       |                       | , non-empty-members |   |   | ε |                         |                       |                       |                       |\n|       member      |                       |                       |                     |   |   |   |      STRING : value     |                       |                       |                       |\n|       value       |         array         |         object        |                     |   |   |   |          STRING         |         NUMBER        |          NULL         |        BOOLEAN        |\n\nThere is a great [tool](http://hackingoff.com/compilers/predict-first-follow-set) for above grammar analysis.\n\n### Implementation {#IterativeParserImplementation}\n\nBased on the parsing table, a direct(or conventional) implementation\nthat pushes the production body in reverse order\nwhile generating a production could work.\n\nIn RapidJSON, several modifications(or adaptations to current design) are made to a direct implementation.\n\nFirst, the parsing table is encoded in a state machine in RapidJSON.\nStates are constructed by the head and body of production.\nState transitions are constructed by production rules.\nBesides, extra states are added for productions involved with `array` and `object`.\nIn this way the generation of array values or object members would be a single state transition,\nrather than several pop/push operations in the direct implementation.\nThis also makes the estimation of stack size more easier.\n\nThe state diagram is shown as follows:\n\n![State Diagram](diagram/iterative-parser-states-diagram.png)\n\nSecond, the iterative parser also keeps track of array's value count and object's member count\nin its internal stack, which may be different from a conventional implementation.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/misc/DoxygenLayout.xml",
    "content": "<doxygenlayout version=\"1.0\">\n  <!-- Generated by doxygen 1.8.7 -->\n  <!-- Navigation index tabs for HTML output -->\n  <navindex>\n    <tab type=\"mainpage\" visible=\"yes\" title=\"\"/>\n    <tab type=\"pages\" visible=\"yes\" title=\"\" intro=\"\"/>\n    <tab type=\"modules\" visible=\"yes\" title=\"\" intro=\"\"/>\n    <tab type=\"namespaces\" visible=\"yes\" title=\"\">\n      <tab type=\"namespacelist\" visible=\"yes\" title=\"\" intro=\"\"/>\n      <tab type=\"namespacemembers\" visible=\"yes\" title=\"\" intro=\"\"/>\n    </tab>\n    <tab type=\"classes\" visible=\"yes\" title=\"\">\n      <tab type=\"classlist\" visible=\"yes\" title=\"\" intro=\"\"/>\n      <tab type=\"classindex\" visible=\"$ALPHABETICAL_INDEX\" title=\"\"/> \n      <tab type=\"hierarchy\" visible=\"yes\" title=\"\" intro=\"\"/>\n      <tab type=\"classmembers\" visible=\"yes\" title=\"\" intro=\"\"/>\n    </tab>\n    <tab type=\"files\" visible=\"yes\" title=\"\">\n      <tab type=\"filelist\" visible=\"yes\" title=\"\" intro=\"\"/>\n      <tab type=\"globals\" visible=\"yes\" title=\"\" intro=\"\"/>\n    </tab>\n    <tab type=\"examples\" visible=\"yes\" title=\"\" intro=\"\"/>  \n  </navindex>\n\n  <!-- Layout definition for a class page -->\n  <class>\n    <briefdescription visible=\"yes\"/>\n    <includes visible=\"$SHOW_INCLUDE_FILES\"/>\n    <inheritancegraph visible=\"$CLASS_GRAPH\"/>\n    <collaborationgraph visible=\"$COLLABORATION_GRAPH\"/>\n    <memberdecl>\n      <nestedclasses visible=\"yes\" title=\"\"/>\n      <publictypes title=\"\"/>\n      <services title=\"\"/>\n      <interfaces title=\"\"/>\n      <publicslots title=\"\"/>\n      <signals title=\"\"/>\n      <publicmethods title=\"\"/>\n      <publicstaticmethods title=\"\"/>\n      <publicattributes title=\"\"/>\n      <publicstaticattributes title=\"\"/>\n      <protectedtypes title=\"\"/>\n      <protectedslots title=\"\"/>\n      <protectedmethods title=\"\"/>\n      <protectedstaticmethods title=\"\"/>\n      <protectedattributes title=\"\"/>\n      <protectedstaticattributes title=\"\"/>\n      <packagetypes title=\"\"/>\n      <packagemethods title=\"\"/>\n      <packagestaticmethods title=\"\"/>\n      <packageattributes title=\"\"/>\n      <packagestaticattributes title=\"\"/>\n      <properties title=\"\"/>\n      <events title=\"\"/>\n      <privatetypes title=\"\"/>\n      <privateslots title=\"\"/>\n      <privatemethods title=\"\"/>\n      <privatestaticmethods title=\"\"/>\n      <privateattributes title=\"\"/>\n      <privatestaticattributes title=\"\"/>\n      <friends title=\"\"/>\n      <related title=\"\" subtitle=\"\"/>\n      <membergroups visible=\"yes\"/>\n    </memberdecl>\n    <detaileddescription title=\"\"/>\n    <memberdef>\n      <inlineclasses title=\"\"/>\n      <typedefs title=\"\"/>\n      <enums title=\"\"/>\n      <services title=\"\"/>\n      <interfaces title=\"\"/>\n      <constructors title=\"\"/>\n      <functions title=\"\"/>\n      <related title=\"\"/>\n      <variables title=\"\"/>\n      <properties title=\"\"/>\n      <events title=\"\"/>\n    </memberdef>\n    <allmemberslink visible=\"yes\"/>\n    <usedfiles visible=\"$SHOW_USED_FILES\"/>\n    <authorsection visible=\"yes\"/>\n  </class>\n\n  <!-- Layout definition for a namespace page -->\n  <namespace>\n    <briefdescription visible=\"yes\"/>\n    <memberdecl>\n      <nestednamespaces visible=\"yes\" title=\"\"/>\n      <constantgroups visible=\"yes\" title=\"\"/>\n      <classes visible=\"yes\" title=\"\"/>\n      <typedefs title=\"\"/>\n      <enums title=\"\"/>\n      <functions title=\"\"/>\n      <variables title=\"\"/>\n      <membergroups visible=\"yes\"/>\n    </memberdecl>\n    <detaileddescription title=\"\"/>\n    <memberdef>\n      <inlineclasses title=\"\"/>\n      <typedefs title=\"\"/>\n      <enums title=\"\"/>\n      <functions title=\"\"/>\n      <variables title=\"\"/>\n    </memberdef>\n    <authorsection visible=\"yes\"/>\n  </namespace>\n\n  <!-- Layout definition for a file page -->\n  <file>\n    <briefdescription visible=\"yes\"/>\n    <includes visible=\"$SHOW_INCLUDE_FILES\"/>\n    <includegraph visible=\"$INCLUDE_GRAPH\"/>\n    <includedbygraph visible=\"$INCLUDED_BY_GRAPH\"/>\n    <sourcelink visible=\"yes\"/>\n    <memberdecl>\n      <classes visible=\"yes\" title=\"\"/>\n      <namespaces visible=\"yes\" title=\"\"/>\n      <constantgroups visible=\"yes\" title=\"\"/>\n      <defines title=\"\"/>\n      <typedefs title=\"\"/>\n      <enums title=\"\"/>\n      <functions title=\"\"/>\n      <variables title=\"\"/>\n      <membergroups visible=\"yes\"/>\n    </memberdecl>\n    <detaileddescription title=\"\"/>\n    <memberdef>\n      <inlineclasses title=\"\"/>\n      <defines title=\"\"/>\n      <typedefs title=\"\"/>\n      <enums title=\"\"/>\n      <functions title=\"\"/>\n      <variables title=\"\"/>\n    </memberdef>\n    <authorsection/>\n  </file>\n\n  <!-- Layout definition for a group page -->\n  <group>\n    <briefdescription visible=\"yes\"/>\n    <groupgraph visible=\"$GROUP_GRAPHS\"/>\n    <memberdecl>\n      <nestedgroups visible=\"yes\" title=\"\"/>\n      <dirs visible=\"yes\" title=\"\"/>\n      <files visible=\"yes\" title=\"\"/>\n      <namespaces visible=\"yes\" title=\"\"/>\n      <classes visible=\"yes\" title=\"\"/>\n      <defines title=\"\"/>\n      <typedefs title=\"\"/>\n      <enums title=\"\"/>\n      <enumvalues title=\"\"/>\n      <functions title=\"\"/>\n      <variables title=\"\"/>\n      <signals title=\"\"/>\n      <publicslots title=\"\"/>\n      <protectedslots title=\"\"/>\n      <privateslots title=\"\"/>\n      <events title=\"\"/>\n      <properties title=\"\"/>\n      <friends title=\"\"/>\n      <membergroups visible=\"yes\"/>\n    </memberdecl>\n    <detaileddescription title=\"\"/>\n    <memberdef>\n      <pagedocs/>\n      <inlineclasses title=\"\"/>\n      <defines title=\"\"/>\n      <typedefs title=\"\"/>\n      <enums title=\"\"/>\n      <enumvalues title=\"\"/>\n      <functions title=\"\"/>\n      <variables title=\"\"/>\n      <signals title=\"\"/>\n      <publicslots title=\"\"/>\n      <protectedslots title=\"\"/>\n      <privateslots title=\"\"/>\n      <events title=\"\"/>\n      <properties title=\"\"/>\n      <friends title=\"\"/>\n    </memberdef>\n    <authorsection visible=\"yes\"/>\n  </group>\n\n  <!-- Layout definition for a directory page -->\n  <directory>\n    <briefdescription visible=\"yes\"/>\n    <directorygraph visible=\"yes\"/>\n    <memberdecl>\n      <dirs visible=\"yes\"/>\n      <files visible=\"yes\"/>\n    </memberdecl>\n    <detaileddescription title=\"\"/>\n  </directory>\n</doxygenlayout>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/misc/doxygenextra.css",
    "content": "body code {\n\tmargin: 0;\n\tborder: 1px solid #ddd;\n\tbackground-color: #f8f8f8;\n\tborder-radius: 3px;\n\tpadding: 0;\n}\n\na {\n\tcolor: #4183c4;\n}\n\na.el {\n\tfont-weight: normal;\n}\n\nbody, table, div, p, dl {\n\tcolor: #333333;\n\tfont-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';\n\tfont-size: 15px;\n\tfont-style: normal;\n\tfont-variant: normal;\n\tfont-weight: normal;\n\tline-height: 25.5px;\n}\n\nbody {\n\tbackground-color: #eee;\n}\n\ndiv.header {\n\tbackground-image: none;\n\tbackground-color: white;\n\tmargin: 0px;\n\tborder: 0px;\n}\n\ndiv.headertitle {\n\twidth: 858px;\n\tmargin: 30px;\n\tpadding: 0px;\n}\n\ndiv.toc {\n\tbackground-color: #f8f8f8;\n\tborder-color: #ddd;\n\tmargin-right: 10px;\n\tmargin-left: 20px;\n}\ndiv.toc h3 {\n\tcolor: #333333;\n\tfont-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';\n\tfont-size: 18px;\n\tfont-style: normal;\n\tfont-variant: normal;\n\tfont-weight: normal;\n}\ndiv.toc li {\n\tcolor: #333333;\n\tfont-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';\n\tfont-size: 12px;\n\tfont-style: normal;\n\tfont-variant: normal;\n\tfont-weight: normal;\n}\n\n.title {\n\tfont-size: 2.5em;\n\tline-height: 63.75px;\n\tborder-bottom: 1px solid #ddd;\n\tmargin-bottom: 15px;\n\tmargin-left: 0px;\n\tmargin-right: 0px;\n\tmargin-top: 0px;\n}\n\nbody h1 {\n\tfont-size: 2em;\n\tline-height: 1.7;\n\tborder-bottom: 1px solid #eee;\n\tmargin: 1em 0 15px;\n\tpadding: 0;\n\toverflow: hidden;\n}\n\nbody h2 {\n\tfont-size: 1.5em;\n\tline-height: 1.7;\n\tmargin: 1em 0 15px;\n\tpadding: 0;\n}\n\npre.fragment {\n\tfont-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\n\tfont-size: 13px;\n\tfont-style: normal;\n\tfont-variant: normal;\n\tfont-weight: normal;\n\tline-height: 19px;\n}\n\ntable.doxtable th {\n\tbackground-color: #f8f8f8;\n\tcolor: #333333;\n\tfont-size: 15px;\n}\n\ntable.doxtable td, table.doxtable th {\n\tborder: 1px solid #ddd;\n}\n\n#doc-content {\n\tbackground-color: #fff;\n\twidth: 918px;\n\theight: auto !important;\n}\n\ndiv.contents {\n\twidth: 858px;\n\tmargin: 30px;\n}\n\ndiv.line {\n\tfont-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\n\tfont-size: 13px;\n\tfont-style: normal;\n\tfont-variant: normal;\n\tfont-weight: normal;\n\tline-height: 19px;\t\n}\n\ntt, code, pre {\n\tfont-family: Consolas, \"Liberation Mono\", Menlo, Courier, monospace;\n\tfont-size: 12px;\n}\n\ndiv.fragment {\n\tbackground-color: #f8f8f8;\n\tborder: 1px solid #ddd;\n\tfont-size: 13px;\n\tline-height: 19px;\n\toverflow: auto;\n\tpadding: 6px 10px;\n\tborder-radius: 3px;\n}\n\n#topbanner {\n\tposition: fixed;\n\tmargin: 15px;\n\tz-index: 101;\n}\n\n#projectname\n{\n\tfont-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';\n\tfont-size: 38px;\n\tfont-weight: bold;\n\tline-height: 63.75px;\n\tmargin: 0px;\n\tpadding: 2px 0px;\n}\n    \n#projectbrief\n{\n\tfont-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';\n\tfont-size: 16px;\n\tline-height: 22.4px;\n\tmargin: 0px 0px 13px 0px;\n\tpadding: 2px;\n}\n\n/* side bar and search */\n\n#side-nav\n{\n\tpadding: 10px 0px 20px 20px;\n\tborder-top: 60px solid #2980b9;\n\tbackground-color: #343131;\n\twidth: 250px !important;\n\tposition: fixed\n}\n\n#nav-tree\n{\n\tbackground-color: transparent;\n\tbackground-image: none;\n\theight: 100% !important;\n}\n\n#nav-tree .label\n{\n\tfont-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';\n\tline-height: 25.5px;\t\n\tfont-size: 15px;\n}\n\n#nav-tree\n{\n\tcolor: #b3b3b3;\n}\n\n#nav-tree .selected {\n\tbackground-image: none;\n}\n\n#nav-tree a\n{\n\tcolor: #b3b3b3;\n}\n\n#github\n{\n\tposition: fixed;\n\tleft: auto;\n\tright: auto;\n\twidth: 250px;\n}\n\n#MSearchBox\n{\n\tmargin: 20px;\n\tleft: 40px;\n\tright: auto;\n\tposition: fixed;\n\twidth: 180px;\n}\n\n#MSearchField\n{\n\twidth: 121px;\n}\n\n#MSearchResultsWindow\n{\n\tleft: 45px !important;\n}\n\n#nav-sync\n{\n\tdisplay: none;\n}\n\n.ui-resizable .ui-resizable-handle\n{\n\twidth: 0px;\n}\n\n#nav-path\n{\n\tdisplay: none;\n}\n\n/* external link icon */\ndiv.contents a[href ^= \"http\"]:after {\n     content: \" \" url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=);\n}\n\n.githublogo {\n\tcontent: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NDkxMSwgMjAxMy8xMC8yOS0xMTo0NzoxNiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RERCMUIwOUY4NkNFMTFFM0FBNTJFRTMzNTJEMUJDNDYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RERCMUIwOUU4NkNFMTFFM0FBNTJFRTMzNTJEMUJDNDYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkU1MTc4QTJBOTlBMDExRTI5QTE1QkMxMDQ2QTg5MDREIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkU1MTc4QTJCOTlBMDExRTI5QTE1QkMxMDQ2QTg5MDREIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+jUqS1wAAApVJREFUeNq0l89rE1EQx3e3gVJoSPzZeNEWPKgHoa0HBak0iHiy/4C3WvDmoZ56qJ7txVsPQu8qlqqHIhRKJZceesmhioQEfxTEtsoSpdJg1u/ABJ7Pmc1m8zLwgWTmzcw3L+/te+tHUeQltONgCkyCi2AEDHLsJ6iBMlgHL8FeoqokoA2j4CloRMmtwTmj7erHBXPgCWhG6a3JNXKdCiDl1cidVbXZkJoXQRi5t5BrxwoY71FzU8S4JuAIqFkJ2+BFSlEh525b/hr3+k/AklDkNsf6wTT4yv46KIMNpsy+iMdMc47HNWxbsgVcUn7FmLAzzoFAWDsBx+wVP6bUpp5ewI+DOeUx0Wd9D8F70BTGNjkWtqnhmT1JQAHcUgZd8Lo3rQb1LAT8eJVUfgGvHQigGp+V2Z0iAUUl8QH47kAA1XioxIo+bRN8OG8F/oBjwv+Z1nJgX5jpdzQDw0LCjsPmrcW7I/iHScCAEDj03FtD8A0EyuChHgg4KTlJQF3wZ7WELppnBX+dBFSVpJsOBWi1qiRgSwnOgoyD5hmuJdkWCVhTgnTvW3AgYIFrSbZGh0UW/Io5Vp+DQoK7o80pztWMemZbgxeNwCNwDbw1fIfgGZjhU6xPaJgBV8BdsMw5cbZoHsenwYFxkZzl83xTSKTiviCAfCsJLysH3POfC8m8NegyGAGfLP/VmGmfSChgXroR0RSWjEFv2J/nG84cuKFMf4sTCZqXuJd4KaXFVjEG3+tw4eXbNK/YC9oXXs3O8NY8y99L4BXY5cvLY/Bb2VZ58EOJVcB18DHJq9lRsKr8inyKGVjlmh29mtHs3AHfuhCwy1vXT/Nu2GKQt+UHsGdctyX6eQyNvc+5sfX9Dl7Pe2J/BRgAl2CpwmrsHR0AAAAASUVORK5CYII=);\n}"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/misc/footer.html",
    "content": "<!-- HTML footer for doxygen 1.8.7-->\n<!-- start footer part -->\n<!--BEGIN GENERATE_TREEVIEW-->\n<div id=\"nav-path\" class=\"navpath\"><!-- id is needed for treeview function! -->\n  <ul>\n    $navpath\n  </ul>\n</div>\n<!--END GENERATE_TREEVIEW-->\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/misc/header.html",
    "content": "<!-- HTML header for doxygen 1.8.7-->\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen $doxygenversion\"/>\n<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->\n<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->\n<link href=\"$relpath^tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"$relpath^jquery.js\"></script>\n<script type=\"text/javascript\" src=\"$relpath^dynsections.js\"></script>\n$treeview\n$search\n$mathjax\n<link href=\"$relpath^$stylesheet\" rel=\"stylesheet\" type=\"text/css\" />\n$extrastylesheet\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"topbanner\"><a href=\"https://github.com/miloyip/rapidjson\" title=\"RapidJSON GitHub\"><i class=\"githublogo\"></i></a></div>\n$searchbox\n<!--END TITLEAREA-->\n<!-- end header part -->\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/performance.md",
    "content": "# Performance\n\nThe old performance article for RapidJSON 0.1 is provided [here](https://code.google.com/p/rapidjson/wiki/Performance).\n\nThis file will be updated with new version and better procedures.\n\nIn the meantime, you may also refer to the following third-party benchmarks.\n\n## Third-party benchmarks\n\n* [Basic benchmarks for miscellaneous C++ JSON parsers and generators](https://github.com/mloskot/json_benchmark) by Mateusz Loskot (Jun 2013)\n * [casablanca](https://casablanca.codeplex.com/)\n * [json_spirit](https://github.com/cierelabs/json_spirit)\n * [jsoncpp](http://jsoncpp.sourceforge.net/)\n * [libjson](http://sourceforge.net/projects/libjson/)\n * [rapidjson](https://github.com/miloyip/rapidjson/)\n * [QJsonDocument](http://qt-project.org/doc/qt-5.0/qtcore/qjsondocument.html)\n \n* [JSON Parser Benchmarking](http://chadaustin.me/2013/01/json-parser-benchmarking/) by Chad Austin (Jan 2013)\n * [sajson](https://github.com/chadaustin/sajson)\n * [rapidjson](https://github.com/miloyip/rapidjson/)\n * [vjson](https://code.google.com/p/vjson/)\n * [YAJL](http://lloyd.github.com/yajl/)\n * [Jansson](http://www.digip.org/jansson/)\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/sax.md",
    "content": "# SAX\n\nThe term \"SAX\" originated from [Simple API for XML](http://en.wikipedia.org/wiki/Simple_API_for_XML). We borrowed this term for JSON parsing and generation.\n\nIn RapidJSON, `Reader` (typedef of `GenericReader<...>`) is the SAX-style parser for JSON, and `Writer` (typedef of `GenericWriter<...>`) is the SAX-style generator for JSON.\n\n[TOC]\n\n# Reader {#Reader}\n\n`Reader` parses a JSON from a stream. While it reads characters from the stream, it analyze the characters according to the syntax of JSON, and publish events to a handler.\n\nFor example, here is a JSON.\n\n~~~~~~~~~~js\n{\n    \"hello\": \"world\",\n    \"t\": true ,\n    \"f\": false,\n    \"n\": null,\n    \"i\": 123,\n    \"pi\": 3.1416,\n    \"a\": [1, 2, 3, 4]\n}\n~~~~~~~~~~\n\nWhile a `Reader` parses this JSON, it publishes the following events to the handler sequentially:\n\n~~~~~~~~~~\nStartObject()\nKey(\"hello\", 5, true)\nString(\"world\", 5, true)\nKey(\"t\", 1, true)\nBool(true)\nKey(\"f\", 1, true)\nBool(false)\nKey(\"n\", 1, true)\nNull()\nKey(\"i\")\nUInt(123)\nKey(\"pi\")\nDouble(3.1416)\nKey(\"a\")\nStartArray()\nUint(1)\nUint(2)\nUint(3)\nUint(4)\nEndArray(4)\nEndObject(7)\n~~~~~~~~~~\n\nThese events can be easily matched with the JSON, except some event parameters need further explanation. Let's see the `simplereader` example which produces exactly the same output as above:\n\n~~~~~~~~~~cpp\n#include \"rapidjson/reader.h\"\n#include <iostream>\n\nusing namespace rapidjson;\nusing namespace std;\n\nstruct MyHandler {\n    bool Null() { cout << \"Null()\" << endl; return true; }\n    bool Bool(bool b) { cout << \"Bool(\" << boolalpha << b << \")\" << endl; return true; }\n    bool Int(int i) { cout << \"Int(\" << i << \")\" << endl; return true; }\n    bool Uint(unsigned u) { cout << \"Uint(\" << u << \")\" << endl; return true; }\n    bool Int64(int64_t i) { cout << \"Int64(\" << i << \")\" << endl; return true; }\n    bool Uint64(uint64_t u) { cout << \"Uint64(\" << u << \")\" << endl; return true; }\n    bool Double(double d) { cout << \"Double(\" << d << \")\" << endl; return true; }\n    bool String(const char* str, SizeType length, bool copy) { \n        cout << \"String(\" << str << \", \" << length << \", \" << boolalpha << copy << \")\" << endl;\n        return true;\n    }\n    bool StartObject() { cout << \"StartObject()\" << endl; return true; }\n    bool Key(const char* str, SizeType length, bool copy) { \n        cout << \"Key(\" << str << \", \" << length << \", \" << boolalpha << copy << \")\" << endl;\n        return true;\n    }\n    bool EndObject(SizeType memberCount) { cout << \"EndObject(\" << memberCount << \")\" << endl; return true; }\n    bool StartArray() { cout << \"StartArray()\" << endl; return true; }\n    bool EndArray(SizeType elementCount) { cout << \"EndArray(\" << elementCount << \")\" << endl; return true; }\n};\n\nvoid main() {\n    const char json[] = \" { \\\"hello\\\" : \\\"world\\\", \\\"t\\\" : true , \\\"f\\\" : false, \\\"n\\\": null, \\\"i\\\":123, \\\"pi\\\": 3.1416, \\\"a\\\":[1, 2, 3, 4] } \";\n\n    MyHandler handler;\n    Reader reader;\n    StringStream ss(json);\n    reader.Parse(ss, handler);\n}\n~~~~~~~~~~\n\nNote that, RapidJSON uses template to statically bind the `Reader` type and the handler type, instead of using class with virtual functions. This paradigm can improve the performance by inlining functions.\n\n## Handler {#Handler}\n\nAs the previous example showed, user needs to implement a handler, which consumes the events (function calls) from `Reader`. The handler must contain the following member functions.\n\n~~~~~~~~~~cpp\nclass Handler {\n    bool Null();\n    bool Bool(bool b);\n    bool Int(int i);\n    bool Uint(unsigned i);\n    bool Int64(int64_t i);\n    bool Uint64(uint64_t i);\n    bool Double(double d);\n    bool String(const Ch* str, SizeType length, bool copy);\n    bool StartObject();\n    bool Key(const Ch* str, SizeType length, bool copy);\n    bool EndObject(SizeType memberCount);\n    bool StartArray();\n    bool EndArray(SizeType elementCount);\n};\n~~~~~~~~~~\n\n`Null()` is called when the `Reader` encounters a JSON null value.\n\n`Bool(bool)` is called when the `Reader` encounters a JSON true or false value.\n\nWhen the `Reader` encounters a JSON number, it chooses a suitable C++ type mapping. And then it calls *one* function out of `Int(int)`, `Uint(unsigned)`, `Int64(int64_t)`, `Uint64(uint64_t)` and `Double(double)`.\n\n`String(const char* str, SizeType length, bool copy)` is called when the `Reader` encounters a string. The first parameter is pointer to the string. The second parameter is the length of the string (excluding the null terminator). Note that RapidJSON supports null character `'\\0'` inside a string. If such situation happens, `strlen(str) < length`. The last `copy` indicates whether the handler needs to make a copy of the string. For normal parsing, `copy = true`. Only when *insitu* parsing is used, `copy = false`. And beware that, the character type depends on the target encoding, which will be explained later.\n\nWhen the `Reader` encounters the beginning of an object, it calls `StartObject()`. An object in JSON is a set of name-value pairs. If the object contains members it first calls `Key()` for the name of member, and then calls functions depending on the type of the value. These calls of name-value pairs repeats until calling `EndObject(SizeType memberCount)`. Note that the `memberCount` parameter is just an aid for the handler, user may not need this parameter.\n\nArray is similar to object but simpler. At the beginning of an array, the `Reader` calls `BeginArary()`. If there is elements, it calls functions according to the types of element. Similarly, in the last call `EndArray(SizeType elementCount)`, the parameter `elementCount` is just an aid for the handler.\n\nEvery handler functions returns a `bool`. Normally it should returns `true`. If the handler encounters an error, it can return `false` to notify event publisher to stop further processing.\n\nFor example, when we parse a JSON with `Reader` and the handler detected that the JSON does not conform to the required schema, then the handler can return `false` and let the `Reader` stop further parsing. And the `Reader` will be in error state with error code `kParseErrorTermination`.\n\n## GenericReader {#GenericReader}\n\nAs mentioned before, `Reader` is a typedef of a template class `GenericReader`:\n\n~~~~~~~~~~cpp\nnamespace rapidjson {\n\ntemplate <typename SourceEncoding, typename TargetEncoding, typename Allocator = MemoryPoolAllocator<> >\nclass GenericReader {\n    // ...\n};\n\ntypedef GenericReader<UTF8<>, UTF8<> > Reader;\n\n} // namespace rapidjson\n~~~~~~~~~~\n\nThe `Reader` uses UTF-8 as both source and target encoding. The source encoding means the encoding in the JSON stream. The target encoding means the encoding of the `str` parameter in `String()` calls. For example, to parse a UTF-8 stream and outputs UTF-16 string events, you can define a reader by:\n\n~~~~~~~~~~cpp\nGenericReader<UTF8<>, UTF16<> > reader;\n~~~~~~~~~~\n\nNote that, the default character type of `UTF16` is `wchar_t`. So this `reader`needs to call `String(const wchar_t*, SizeType, bool)` of the handler.\n\nThe third template parameter `Allocator` is the allocator type for internal data structure (actually a stack).\n\n## Parsing {#Parsing}\n\nThe one and only one function of `Reader` is to parse JSON. \n\n~~~~~~~~~~cpp\ntemplate <unsigned parseFlags, typename InputStream, typename Handler>\nbool Parse(InputStream& is, Handler& handler);\n\n// with parseFlags = kDefaultParseFlags\ntemplate <typename InputStream, typename Handler>\nbool Parse(InputStream& is, Handler& handler);\n~~~~~~~~~~\n\nIf an error occurs during parsing, it will return `false`. User can also calls `bool HasParseEror()`, `ParseErrorCode GetParseErrorCode()` and `size_t GetErrorOffset()` to obtain the error states. Actually `Document` uses these `Reader` functions to obtain parse errors. Please refer to [DOM](doc/dom.md) for details about parse error.\n\n# Writer {#Writer}\n\n`Reader` converts (parses) JSON into events. `Writer` does exactly the opposite. It converts events into JSON. \n\n`Writer` is very easy to use. If your application only need to converts some data into JSON, it may be a good choice to use `Writer` directly, instead of building a `Document` and then stringifying it with a `Writer`.\n\nIn `simplewriter` example, we do exactly the reverse of `simplereader`.\n\n~~~~~~~~~~cpp\n#include \"rapidjson/writer.h\"\n#include \"rapidjson/stringbuffer.h\"\n#include <iostream>\n\nusing namespace rapidjson;\nusing namespace std;\n\nvoid main() {\n    StringBuffer s;\n    Writer<StringBuffer> writer(s);\n    \n    writer.StartObject();\n    writer.Key(\"hello\");\n    writer.String(\"world\");\n    writer.Key(\"t\");\n    writer.Bool(true);\n    writer.Key(\"f\");\n    writer.Bool(false);\n    writer.Key(\"n\");\n    writer.Null();\n    writer.Key(\"i\");\n    writer.Uint(123);\n    writer.Key(\"pi\");\n    writer.Double(3.1416);\n    writer.Key(\"a\");\n    writer.StartArray();\n    for (unsigned i = 0; i < 4; i++)\n        writer.Uint(i);\n    writer.EndArray();\n    writer.EndObject();\n\n    cout << s.GetString() << endl;\n}\n~~~~~~~~~~\n\n~~~~~~~~~~\n{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.1416,\"a\":[0,1,2,3]}\n~~~~~~~~~~\n\nThere are two `String()` and `Key()` overloads. One is the same as defined in handler concept with 3 parameters. It can handle string with null characters. Another one is the simpler version used in the above example.\n\nNote that, the example code does not pass any parameters in `EndArray()` and `EndObject()`. An `SizeType` can be passed but it will be simply ignored by `Writer`.\n\nYou may doubt that, why not just using `sprintf()` or `std::stringstream` to build a JSON?\n\nThere are various reasons:\n1. `Writer` must output a well-formed JSON. If there is incorrect event sequence (e.g. `Int()` just after `StartObject()`), it generates assertion fail in debug mode.\n2. `Writer::String()` can handle string escaping (e.g. converting code point `U+000A` to `\\n`) and Unicode transcoding.\n3. `Writer` handles number output consistently.\n4. `Writer` implements the event handler concept. It can be used to handle events from `Reader`, `Document` or other event publisher.\n5. `Writer` can be optimized for different platforms.\n\nAnyway, using `Writer` API is even simpler than generating a JSON by ad hoc methods.\n\n## Template {#WriterTemplate}\n\n`Writer` has a minor design difference to `Reader`. `Writer` is a template class, not a typedef. There is no `GenericWriter`. The following is the declaration.\n\n~~~~~~~~~~cpp\nnamespace rapidjson {\n\ntemplate<typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename Allocator = CrtAllocator<> >\nclass Writer {\npublic:\n    Writer(OutputStream& os, Allocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth)\n// ...\n};\n\n} // namespace rapidjson\n~~~~~~~~~~\n\nThe `OutputStream` template parameter is the type of output stream. It cannot be deduced and must be specified by user.\n\nThe `SourceEncoding` template parameter specifies the encoding to be used in `String(const Ch*, ...)`.\n\nThe `TargetEncoding` template parameter specifies the encoding in the output stream.\n\nThe last one, `Allocator` is the type of allocator, which is used for allocating internal data structure (a stack).\n\nBesides, the constructor of `Writer` has a `levelDepth` parameter. This parameter affects the initial memory allocated for storing information per hierarchy level.\n\n## PrettyWriter {#PrettyWriter}\n\nWhile the output of `Writer` is the most condensed JSON without white-spaces, suitable for network transfer or storage, it is not easily readable by human.\n\nTherefore, RapidJSON provides a `PrettyWriter`, which adds indentation and line feeds in the output.\n\nThe usage of `PrettyWriter` is exactly the same as `Writer`, expect that `PrettyWriter` provides a `SetIndent(Ch indentChar, unsigned indentCharCount)` function. The default is 4 spaces.\n\n## Completeness and Reset {#CompletenessReset}\n\nA `Writer` can only output a single JSON, which can be either an object or array at the root. Once the last matching `EndObject()` or `EndArray()` event is handled, the output JSON is well-formed and complete. User can detect this state by calling `Writer::IsComplete()`.\n\nWhen a JSON is complete, the `Writer` cannot accept any new events. Otherwise the output will be invalid (i.e. having more than one root). To reuse the `Writer` object, user can call `Writer::Reset(OutputStream& os)` to reset all internal states of the `Writer` with a new output stream.\n\n# Techniques {#Techniques}\n\n## Parsing JSON to Custom Data Structure {#CustomDataStructure}\n\n`Document`'s parsing capability is completely based on `Reader`. Actually `Document` is a handler which receives events from a reader to build a DOM during parsing.\n\nUser may uses `Reader` to build other data structures directly. This eliminates building of DOM, thus reducing memory and improving performance.\n\nIn the following `messagereader` example, `ParseMessages()` parses a JSON which should be an object with key-string pairs.\n\n~~~~~~~~~~cpp\n#include \"rapidjson/reader.h\"\n#include \"rapidjson/error/en.h\"\n#include <iostream>\n#include <string>\n#include <map>\n\nusing namespace std;\nusing namespace rapidjson;\n\ntypedef map<string, string> MessageMap;\n\nstruct MessageHandler : public BaseReaderHandler<> {\n    MessageHandler() : state_(kExpectObjectStart) {\n    }\n\n    bool StartObject() {\n        switch (state_) {\n        case kExpectObjectStart:\n            state_ = kExpectNameOrObjectEnd;\n            return true;\n        default:\n            return false;\n        }\n    }\n\n    bool String(const char* str, SizeType length, bool) {\n        switch (state_) {\n        case kExpectNameOrObjectEnd:\n            name_ = string(str, length);\n            state_ = kExpectValue;\n            return true;\n        case kExpectValue:\n            messages_.insert(MessageMap::value_type(name_, string(str, length)));\n            state_ = kExpectNameOrObjectEnd;\n            return true;\n        default:\n            return false;\n        }\n    }\n\n    bool EndObject(SizeType) { return state_ == kExpectNameOrObjectEnd; }\n\n    bool Default() { return false; } // All other events are invalid.\n\n    MessageMap messages_;\n    enum State {\n        kExpectObjectStart,\n        kExpectNameOrObjectEnd,\n        kExpectValue,\n    }state_;\n    std::string name_;\n};\n\nvoid ParseMessages(const char* json, MessageMap& messages) {\n    Reader reader;\n    MessageHandler handler;\n    StringStream ss(json);\n    if (reader.Parse(ss, handler))\n        messages.swap(handler.messages_);   // Only change it if success.\n    else {\n        ParseErrorCode e = reader.GetParseErrorCode();\n        size_t o = reader.GetErrorOffset();\n        cout << \"Error: \" << GetParseError_En(e) << endl;;\n        cout << \" at offset \" << o << \" near '\" << string(json).substr(o, 10) << \"...'\" << endl;\n    }\n}\n\nint main() {\n    MessageMap messages;\n\n    const char* json1 = \"{ \\\"greeting\\\" : \\\"Hello!\\\", \\\"farewell\\\" : \\\"bye-bye!\\\" }\";\n    cout << json1 << endl;\n    ParseMessages(json1, messages);\n\n    for (MessageMap::const_iterator itr = messages.begin(); itr != messages.end(); ++itr)\n        cout << itr->first << \": \" << itr->second << endl;\n\n    cout << endl << \"Parse a JSON with invalid schema.\" << endl;\n    const char* json2 = \"{ \\\"greeting\\\" : \\\"Hello!\\\", \\\"farewell\\\" : \\\"bye-bye!\\\", \\\"foo\\\" : {} }\";\n    cout << json2 << endl;\n    ParseMessages(json2, messages);\n\n    return 0;\n}\n~~~~~~~~~~\n\n~~~~~~~~~~\n{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\" }\nfarewell: bye-bye!\ngreeting: Hello!\n\nParse a JSON with invalid schema.\n{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\", \"foo\" : {} }\nError: Terminate parsing due to Handler error.\n at offset 59 near '} }...'\n~~~~~~~~~~\n\nThe first JSON (`json1`) was successfully parsed into `MessageMap`. Since `MessageMap` is a `std::map`, the printing order are sorted by the key. This order is different from the JSON's order.\n\nIn the second JSON (`json2`), `foo`'s value is an empty object. As it is an object, `MessageHandler::StartObject()` will be called. However, at that moment `state_ = kExpectValue`, so that function returns `false` and cause the parsing process be terminated. The error code is `kParseErrorTermination`.\n\n## Filtering of JSON {#Filtering}\n\nAs mentioned earlier, `Writer` can handle the events published by `Reader`. `condense` example simply set a `Writer` as handler of a `Reader`, so it can remove all white-spaces in JSON. `pretty` example uses the same relationship, but replacing `Writer` by `PrettyWriter`. So `pretty` can be used to reformat a JSON with indentation and line feed.\n\nActually, we can add intermediate layer(s) to filter the contents of JSON via these SAX-style API. For example, `capitalize` example capitalize all strings in a JSON.\n\n~~~~~~~~~~cpp\n#include \"rapidjson/reader.h\"\n#include \"rapidjson/writer.h\"\n#include \"rapidjson/filereadstream.h\"\n#include \"rapidjson/filewritestream.h\"\n#include \"rapidjson/error/en.h\"\n#include <vector>\n#include <cctype>\n\nusing namespace rapidjson;\n\ntemplate<typename OutputHandler>\nstruct CapitalizeFilter {\n    CapitalizeFilter(OutputHandler& out) : out_(out), buffer_() {\n    }\n\n    bool Null() { return out_.Null(); }\n    bool Bool(bool b) { return out_.Bool(b); }\n    bool Int(int i) { return out_.Int(i); }\n    bool Uint(unsigned u) { return out_.Uint(u); }\n    bool Int64(int64_t i) { return out_.Int64(i); }\n    bool Uint64(uint64_t u) { return out_.Uint64(u); }\n    bool Double(double d) { return out_.Double(d); }\n    bool String(const char* str, SizeType length, bool) { \n        buffer_.clear();\n        for (SizeType i = 0; i < length; i++)\n            buffer_.push_back(std::toupper(str[i]));\n        return out_.String(&buffer_.front(), length, true); // true = output handler need to copy the string\n    }\n    bool StartObject() { return out_.StartObject(); }\n    bool Key(const char* str, SizeType length, bool copy) { return String(str, length, copy); }\n    bool EndObject(SizeType memberCount) { return out_.EndObject(memberCount); }\n    bool StartArray() { return out_.StartArray(); }\n    bool EndArray(SizeType elementCount) { return out_.EndArray(elementCount); }\n\n    OutputHandler& out_;\n    std::vector<char> buffer_;\n};\n\nint main(int, char*[]) {\n    // Prepare JSON reader and input stream.\n    Reader reader;\n    char readBuffer[65536];\n    FileReadStream is(stdin, readBuffer, sizeof(readBuffer));\n\n    // Prepare JSON writer and output stream.\n    char writeBuffer[65536];\n    FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));\n    Writer<FileWriteStream> writer(os);\n\n    // JSON reader parse from the input stream and let writer generate the output.\n    CapitalizeFilter<Writer<FileWriteStream> > filter(writer);\n    if (!reader.Parse(is, filter)) {\n        fprintf(stderr, \"\\nError(%u): %s\\n\", (unsigned)reader.GetErrorOffset(), GetParseError_En(reader.GetParseErrorCode()));\n        return 1;\n    }\n\n    return 0;\n}\n~~~~~~~~~~\n\nNote that, it is incorrect to simply capitalize the JSON as a string. For example:\n~~~~~~~~~~\n[\"Hello\\nWorld\"]\n~~~~~~~~~~\n\nSimply capitalizing the whole JSON would contain incorrect escape character:\n~~~~~~~~~~\n[\"HELLO\\NWORLD\"]\n~~~~~~~~~~\n\nThe correct result by `capitalize`:\n~~~~~~~~~~\n[\"HELLO\\nWORLD\"]\n~~~~~~~~~~\n\nMore complicated filters can be developed. However, since SAX-style API can only provide information about a single event at a time, user may need to book-keeping the contextual information (e.g. the path from root value, storage of other related values). Some processing may be easier to be implemented in DOM than SAX.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/stream.md",
    "content": "# Stream\n\nIn RapidJSON, `rapidjson::Stream` is a concept for reading/writing JSON. Here we first show how to use streams provided. And then see how to create a custom stream.\n\n[TOC]\n\n# Memory Streams {#MemoryStreams}\n\nMemory streams store JSON in memory.\n\n## StringStream (Input) {#StringStream}\n\n`StringStream` is the most basic input stream. It represents a complete, read-only JSON stored in memory. It is defined in `rapidjson/rapidjson.h`.\n\n~~~~~~~~~~cpp\n#include \"rapidjson/document.h\" // will include \"rapidjson/rapidjson.h\"\n\nusing namespace rapidjson;\n\n// ...\nconst char json[] = \"[1, 2, 3, 4]\";\nStringStream s(json);\n\nDocument d;\nd.ParseStream(s);\n~~~~~~~~~~\n\nSince this is very common usage, `Document::Parse(const char*)` is provided to do exactly the same as above:\n\n~~~~~~~~~~cpp\n// ...\nconst char json[] = \"[1, 2, 3, 4]\";\nDocument d;\nd.Parse(json);\n~~~~~~~~~~\n\nNote that, `StringStream` is a typedef of `GenericStringStream<UTF8<> >`, user may use another encodings to represent the character set of the stream.\n\n## StringBuffer (Output) {#StringBuffer}\n\n`StringBuffer` is a simple output stream. It allocates a memory buffer for writing the whole JSON. Use `GetString()` to obtain the buffer.\n\n~~~~~~~~~~cpp\n#include \"rapidjson/stringbuffer.h\"\n\nStringBuffer buffer;\nWriter<StringBuffer> writer(buffer);\nd.Accept(writer);\n\nconst char* output = buffer.GetString();\n~~~~~~~~~~\n\nWhen the buffer is full, it will increases the capacity automatically. The default capacity is 256 characters (256 bytes for UTF8, 512 bytes for UTF16, etc.). User can provide an allocator and a initial capacity.\n\n~~~~~~~~~~cpp\nStringBuffer buffer1(0, 1024); // Use its allocator, initial size = 1024\nStringBuffer buffer2(allocator, 1024);\n~~~~~~~~~~\n\nBy default, `StringBuffer` will instantiate an internal allocator.\n\nSimilarly, `StringBuffer` is a typedef of `GenericStringBuffer<UTF8<> >`.\n\n# File Streams {#FileStreams}\n\nWhen parsing a JSON from file, you may read the whole JSON into memory and use ``StringStream`` above.\n\nHowever, if the JSON is big, or memory is limited, you can use `FileReadStream`. It only read a part of JSON from file into buffer, and then let the part be parsed. If it runs out of characters in the buffer, it will read the next part from file.\n\n## FileReadStream (Input) {#FileReadStream}\n\n`FileReadStream` reads the file via a `FILE` pointer. And user need to provide a buffer.\n\n~~~~~~~~~~cpp\n#include \"rapidjson/filereadstream.h\"\n#include <cstdio>\n\nusing namespace rapidjson;\n\nFILE* fp = fopen(\"big.json\", \"rb\"); // non-Windows use \"r\"\n\nchar readBuffer[65536];\nFileReadStream is(fp, readBuffer, sizeof(readBuffer));\n\nDocument d;\nd.ParseStream(is);\n\nfclose(fp);\n~~~~~~~~~~\n\nDifferent from string streams, `FileReadStream` is byte stream. It does not handle encodings. If the file is not UTF-8, the byte stream can be wrapped in a `EncodedInputStream`. It will be discussed very soon.\n\nApart from reading file, user can also use `FileReadStream` to read `stdin`.\n\n## FileWriteStream (Output) {#FileWriteStream}\n\n`FileWriteStream` is buffered output stream. Its usage is very similar to `FileReadStream`.\n\n~~~~~~~~~~cpp\n#include \"rapidjson/filewritestream.h\"\n#include <cstdio>\n\nusing namespace rapidjson;\n\nDocument d;\nd.Parse(json);\n// ...\n\nFILE* fp = fopen(\"output.json\", \"wb\"); // non-Windows use \"w\"\n\nchar writeBuffer[65536];\nFileWriteStream os(fp, writeBuffer, sizeof(writeBuffer));\n\nWriter<FileWriteStream> writer(os);\nd.Accept(writer);\n\nfclose(fp);\n~~~~~~~~~~\n\nIt can also directs the output to `stdout`.\n\n# Encoded Streams {#EncodedStreams}\n\nEncoded streams do not contain JSON itself, but they wrap byte streams to provide basic encoding/decoding function.\n\nAs mentioned above, UTF-8 byte streams can be read directly. However, UTF-16 and UTF-32 have endian issue. To handle endian correctly, it needs to convert bytes into characters (e.g. `wchar_t` for UTF-16) while reading, and characters into bytes while writing.\n\nBesides, it also need to handle [byte order mark (BOM)](http://en.wikipedia.org/wiki/Byte_order_mark). When reading from a byte stream, it is needed to detect or just consume the BOM if exists. When writing to a byte stream, it can optionally write BOM.\n\nIf the encoding of stream is known in compile-time, you may use `EncodedInputStream` and `EncodedOutputStream`. If the stream can be UTF-8, UTF-16LE, UTF-16BE, UTF-32LE, UTF-32BE JSON, and it is only known in runtime, you may use `AutoUTFInputStream` and `AutoUTFOutputStream`. These streams are defined in `rapidjson/encodedstream.h`.\n\nNote that, these encoded streams can be applied to streams other than file. For example, you may have a file in memory, or a custom byte stream, be wrapped in encoded streams.\n\n## EncodedInputStream {#EncodedInputStream}\n\n`EncodedInputStream` has two template parameters. The first one is a `Encoding` class, such as `UTF8`, `UTF16LE`, defined in `rapidjson/encodings.h`. The second one is the class of stream to be wrapped.\n\n~~~~~~~~~~cpp\n#include \"rapidjson/document.h\"\n#include \"rapidjson/filereadstream.h\"   // FileReadStream\n#include \"rapidjson/encodedstream.h\"    // EncodedInputStream\n#include <cstdio>\n\nusing namespace rapidjson;\n\nFILE* fp = fopen(\"utf16le.json\", \"rb\"); // non-Windows use \"r\"\n\nchar readBuffer[256];\nFileReadStream bis(fp, readBuffer, sizeof(readBuffer));\n\nEncodedInputStream<UTF16LE<>, FileReadStream> eis(bis);  // wraps bis into eis\n\nDocument d; // Document is GenericDocument<UTF8<> > \nd.ParseStream<0, UTF16LE<> >(eis);  // Parses UTF-16LE file into UTF-8 in memory\n\nfclose(fp);\n~~~~~~~~~~\n\n## EncodedOutputStream {#EncodedOutputStream}\n\n`EncodedOutputStream` is similar but it has a `bool putBOM` parameter in the constructor, controlling whether to write BOM into output byte stream.\n\n~~~~~~~~~~cpp\n#include \"rapidjson/filewritestream.h\"  // FileWriteStream\n#include \"rapidjson/encodedstream.h\"    // EncodedOutputStream\n#include <cstdio>\n\nDocument d;         // Document is GenericDocument<UTF8<> > \n// ...\n\nFILE* fp = fopen(\"output_utf32le.json\", \"wb\"); // non-Windows use \"w\"\n\nchar writeBuffer[256];\nFileWriteStream bos(fp, writeBuffer, sizeof(writeBuffer));\n\ntypedef EncodedOutputStream<UTF32LE<>, FileWriteStream> OutputStream;\nOutputStream eos(bos, true);   // Write BOM\n\nWriter<OutputStream, UTF32LE<>, UTF8<>> writer(eos);\nd.Accept(writer);   // This generates UTF32-LE file from UTF-8 in memory\n\nfclose(fp);\n~~~~~~~~~~\n\n## AutoUTFInputStream {#AutoUTFInputStream}\n\nSometimes an application may want to handle all supported JSON encoding. `AutoUTFInputStream` will detection encoding by BOM first. If BOM is unavailable, it will use  characteristics of valid JSON to make detection. If neither method success, it falls back to the UTF type provided in constructor.\n\nSince the characters (code units) may be 8-bit, 16-bit or 32-bit. `AutoUTFInputStream` requires a character type which can hold at least 32-bit. We may use `unsigned`, as in the template parameter:\n\n~~~~~~~~~~cpp\n#include \"rapidjson/document.h\"\n#include \"rapidjson/filereadstream.h\"   // FileReadStream\n#include \"rapidjson/encodedstream.h\"    // AutoUTFInputStream\n#include <cstdio>\n\nusing namespace rapidjson;\n\nFILE* fp = fopen(\"any.json\", \"rb\"); // non-Windows use \"r\"\n\nchar readBuffer[256];\nFileReadStream bis(fp, readBuffer, sizeof(readBuffer));\n\nAutoUTFInputStream<unsigned, FileReadStream> eis(bis);  // wraps bis into eis\n\nDocument d;         // Document is GenericDocument<UTF8<> > \nd.ParseStream<0, AutoUTF<unsigned> >(eis); // This parses any UTF file into UTF-8 in memory\n\nfclose(fp);\n~~~~~~~~~~\n\nWhen specifying the encoding of stream, uses `AutoUTF<CharType>` as in `ParseStream()` above.\n\nYou can obtain the type of UTF via `UTFType GetType()`. And check whether a BOM is found by `HasBOM()`\n\n## AutoUTFOutputStream {#AutoUTFOutputStream}\n\nSimilarly, to choose encoding for output during runtime, we can use `AutoUTFOutputStream`. This class is not automatic *per se*. You need to specify the UTF type and whether to write BOM in runtime.\n\n~~~~~~~~~~cpp\nusing namespace rapidjson;\n\nvoid WriteJSONFile(FILE* fp, UTFType type, bool putBOM, const Document& d) {\n    char writeBuffer[256];\n    FileWriteStream bos(fp, writeBuffer, sizeof(writeBuffer));\n\n    typedef AutoUTFOutputStream<unsigned, FileWriteStream> OutputStream;\n    OutputStream eos(bos, type, putBOM);\n    \n    Writer<OutputStream, UTF8<>, AutoUTF<> > writer;\n    d.Accept(writer);\n}\n~~~~~~~~~~\n\n`AutoUTFInputStream` and `AutoUTFOutputStream` is more convenient than `EncodedInputStream` and `EncodedOutputStream`. They just incur a little bit runtime overheads.\n\n# Custom Stream {#CustomStream}\n\nIn addition to memory/file streams, user can create their own stream classes which fits RapidJSON's API. For example, you may create network stream, stream from compressed file, etc.\n\nRapidJSON combines different types using templates. A class containing all required interface can be a stream. The Stream interface is defined in comments of `rapidjson/rapidjson.h`:\n\n~~~~~~~~~~cpp\nconcept Stream {\n    typename Ch;    //!< Character type of the stream.\n\n    //! Read the current character from stream without moving the read cursor.\n    Ch Peek() const;\n\n    //! Read the current character from stream and moving the read cursor to next character.\n    Ch Take();\n\n    //! Get the current read cursor.\n    //! \\return Number of characters read from start.\n    size_t Tell();\n\n    //! Begin writing operation at the current read pointer.\n    //! \\return The begin writer pointer.\n    Ch* PutBegin();\n\n    //! Write a character.\n    void Put(Ch c);\n\n    //! Flush the buffer.\n    void Flush();\n\n    //! End the writing operation.\n    //! \\param begin The begin write pointer returned by PutBegin().\n    //! \\return Number of characters written.\n    size_t PutEnd(Ch* begin);\n}\n~~~~~~~~~~\n\nFor input stream, they must implement `Peek()`, `Take()` and `Tell()`.\nFor output stream, they must implement `Put()` and `Flush()`. \nThere are two special interface, `PutBegin()` and `PutEnd()`, which are only for *in situ* parsing. Normal streams do not implement them. However, if the interface is not needed for a particular stream, it is still need to a dummy implementation, otherwise will generate compilation error.\n\n## Example: istream wrapper {#ExampleIStreamWrapper}\n\nThe following example is a wrapper of `std::istream`, which only implements 3 functions.\n\n~~~~~~~~~~cpp\nclass IStreamWrapper {\npublic:\n    typedef char Ch;\n\n    IStreamWrapper(std::istream& is) : is_(is) {\n    }\n\n    Ch Peek() const { // 1\n        int c = is_.peek();\n        return c == std::char_traits<char>::eof() ? '\\0' : (Ch)c;\n    }\n\n    Ch Take() { // 2\n        int c = is_.get();\n        return c == std::char_traits<char>::eof() ? '\\0' : (Ch)c;\n    }\n\n    size_t Tell() const { return (size_t)is_.tellg(); } // 3\n\n    Ch* PutBegin() { assert(false); return 0; }\n    void Put(Ch) { assert(false); }\n    void Flush() { assert(false); }\n    size_t PutEnd(Ch*) { assert(false); return 0; }\n\nprivate:\n    IStreamWrapper(const IStreamWrapper&);\n    IStreamWrapper& operator=(const IStreamWrapper&);\n\n    std::istream& is_;\n};\n~~~~~~~~~~\n\nUser can use it to wrap instances of `std::stringstream`, `std::ifstream`.\n\n~~~~~~~~~~cpp\nconst char* json = \"[1,2,3,4]\";\nstd::stringstream ss(json);\nIStreamWrapper is(ss);\n\nDocument d;\nd.Parse(is);\n~~~~~~~~~~\n\nNote that, this implementation may not be as efficient as RapidJSON's memory or file streams, due to internal overheads of the standard library.\n\n## Example: ostream wrapper {#ExampleOStreamWrapper}\n\nThe following example is a wrapper of `std::istream`, which only implements 2 functions.\n\n~~~~~~~~~~cpp\nclass OStreamWrapper {\npublic:\n    typedef char Ch;\n\n    OStreamWrapper(std::ostream& os) : os_(os) {\n    }\n\n    Ch Peek() const { assert(false); return '\\0'; }\n    Ch Take() { assert(false); return '\\0'; }\n    size_t Tell() const {  }\n\n    Ch* PutBegin() { assert(false); return 0; }\n    void Put(Ch c) { os_.put(c); }                  // 1\n    void Flush() { os_.flush(); }                   // 2\n    size_t PutEnd(Ch*) { assert(false); return 0; }\n\nprivate:\n    OStreamWrapper(const OStreamWrapper&);\n    OStreamWrapper& operator=(const OStreamWrapper&);\n\n    std::ostream& os_;\n};\n~~~~~~~~~~\n\nUser can use it to wrap instances of `std::stringstream`, `std::ofstream`.\n\n~~~~~~~~~~cpp\nDocument d;\n// ...\n\nstd::stringstream ss;\nOSStreamWrapper os(ss);\n\nWriter<OStreamWrapper> writer(os);\nd.Accept(writer);\n~~~~~~~~~~\n\nNote that, this implementation may not be as efficient as RapidJSON's memory or file streams, due to internal overheads of the standard library.\n\n# Summary {#Summary}\n\nThis section describes stream classes available in RapidJSON. Memory streams are simple. File stream can reduce the memory required during JSON parsing and generation, if the JSON is stored in file system. Encoded streams converts between byte streams and character streams. Finally, user may create custom streams using a simple interface.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/doc/tutorial.md",
    "content": "# Tutorial\n\nThis tutorial introduces the basics of the Document Object Model(DOM) API.\n\nAs shown in [Usage at a glance](readme.md), a JSON can be parsed into DOM, and then the DOM can be queried and modified easily, and finally be converted back to JSON.\n\n[TOC]\n\n# Value & Document {#ValueDocument}\n\nEach JSON value is stored in a type called `Value`. A `Document`, representing the DOM, contains the root of `Value`. All public types and functions of RapidJSON are defined in the `rapidjson` namespace.\n\n# Query Value {#QueryValue}\n\nIn this section, we will use excerpt of `example/tutorial/tutorial.cpp`.\n\nAssumes we have a JSON stored in a C string (`const char* json`):\n~~~~~~~~~~js\n{\n    \"hello\": \"world\",\n    \"t\": true ,\n    \"f\": false,\n    \"n\": null,\n    \"i\": 123,\n    \"pi\": 3.1416,\n    \"a\": [1, 2, 3, 4]\n}\n~~~~~~~~~~\n\nParse it into a `Document`\n~~~~~~~~~~cpp\n#include \"rapidjson/document.h\"\n\nusing namespace rapidjson;\n\n// ...\nDocument document;\ndocument.Parse(json);\n~~~~~~~~~~\n\nThe JSON is now parsed into `document` as a *DOM tree*:\n\n![DOM in the tutorial](diagram/tutorial.png)\n\nSince the update to RFC7159, the root of a conforming JSON document can be any JSON value.  In RFC4627, only objects or arrays were allowed as root values. In this case, the root is an object.\n~~~~~~~~~~cpp\nassert(document.IsObject());\n~~~~~~~~~~\n\nQuery whether a `\"hello\"` member exists in the root object. Since a `Value` can contain different types of value, we may need to verify its type and use suitable API to obtain the value. In this example, `\"hello\"` member associates with a JSON string.\n~~~~~~~~~~cpp\nassert(document.HasMember(\"hello\"));\nassert(document[\"hello\"].IsString());\nprintf(\"hello = %s\\n\", document[\"hello\"].GetString());\n~~~~~~~~~~\n\n~~~~~~~~~~\nworld\n~~~~~~~~~~\n\nJSON true/false values are represented as `bool`.\n~~~~~~~~~~cpp\nassert(document[\"t\"].IsBool());\nprintf(\"t = %s\\n\", document[\"t\"].GetBool() ? \"true\" : \"false\");\n~~~~~~~~~~\n\n~~~~~~~~~~\ntrue\n~~~~~~~~~~\n\nJSON null can be queryed by `IsNull()`.\n~~~~~~~~~~cpp\nprintf(\"n = %s\\n\", document[\"n\"].IsNull() ? \"null\" : \"?\");\n~~~~~~~~~~\n\n~~~~~~~~~~\nnull\n~~~~~~~~~~\n\nJSON number type represents all numeric values. However, C++ needs more specific type for manipulation.\n\n~~~~~~~~~~cpp\nassert(document[\"i\"].IsNumber());\n\n// In this case, IsUint()/IsInt64()/IsUInt64() also return true.\nassert(document[\"i\"].IsInt());          \nprintf(\"i = %d\\n\", document[\"i\"].GetInt());\n// Alternative (int)document[\"i\"]\n\nassert(document[\"pi\"].IsNumber());\nassert(document[\"pi\"].IsDouble());\nprintf(\"pi = %g\\n\", document[\"pi\"].GetDouble());\n~~~~~~~~~~\n\n~~~~~~~~~~\ni = 123\npi = 3.1416\n~~~~~~~~~~\n\nJSON array contains a number of elements.\n~~~~~~~~~~cpp\n// Using a reference for consecutive access is handy and faster.\nconst Value& a = document[\"a\"];\nassert(a.IsArray());\nfor (SizeType i = 0; i < a.Size(); i++) // Uses SizeType instead of size_t\n        printf(\"a[%d] = %d\\n\", i, a[i].GetInt());\n~~~~~~~~~~\n\n~~~~~~~~~~\na[0] = 1\na[1] = 2\na[2] = 3\na[3] = 4\n~~~~~~~~~~\n\nNote that, RapidJSON does not automatically convert values between JSON types. If a value is a string, it is invalid to call `GetInt()`, for example. In debug mode it will fail an assertion. In release mode, the behavior is undefined.\n\nIn the following, details about querying individual types are discussed.\n\n## Query Array {#QueryArray}\n\nBy default, `SizeType` is typedef of `unsigned`. In most systems, array is limited to store up to 2^32-1 elements.\n\nYou may access the elements in array by integer literal, for example, `a[1]`, `a[2]`. However, `a[0]` will generate a compiler error. It is because two overloaded operators `operator[](SizeType)` and `operator[](const char*)` is available, and C++ can treat `0` as a null pointer. Workarounds:\n* `a[SizeType(0)]`\n* `a[0u]`\n\nArray is similar to `std::vector`, instead of using indices, you may also use iterator to access all the elements.\n~~~~~~~~~~cpp\nfor (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr)\n    printf(\"%d \", itr->GetInt());\n~~~~~~~~~~\n\nAnd other familiar query functions:\n* `SizeType Capacity() const`\n* `bool Empty() const`\n\n## Query Object {#QueryObject}\n\nSimilar to array, we can iterate object members by iterator:\n\n~~~~~~~~~~cpp\nstatic const char* kTypeNames[] = \n    { \"Null\", \"False\", \"True\", \"Object\", \"Array\", \"String\", \"Number\" };\n\nfor (Value::ConstMemberIterator itr = document.MemberBegin();\n    itr != document.MemberEnd(); ++itr)\n{\n    printf(\"Type of member %s is %s\\n\",\n        itr->name.GetString(), kTypeNames[itr->value.GetType()]);\n}\n~~~~~~~~~~\n\n~~~~~~~~~~\nType of member hello is String\nType of member t is True\nType of member f is False\nType of member n is Null\nType of member i is Number\nType of member pi is Number\nType of member a is Array\n~~~~~~~~~~\n\nNote that, when `operator[](const char*)` cannot find the member, it will fail an assertion.\n\nIf we are unsure whether a member exists, we need to call `HasMember()` before calling `operator[](const char*)`. However, this incurs two lookup. A better way is to call `FindMember()`, which can check the existence of member and obtain its value at once:\n\n~~~~~~~~~~cpp\nValue::ConstMemberIterator itr = document.FindMember(\"hello\");\nif (itr != document.MemberEnd())\n    printf(\"%s %s\\n\", itr->value.GetString());\n~~~~~~~~~~\n\n## Querying Number {#QueryNumber}\n\nJSON provide a single numerical type called Number. Number can be integer or real numbers. RFC 4627 says the range of Number is specified by parser.\n\nAs C++ provides several integer and floating point number types, the DOM tries to handle these with widest possible range and good performance.\n\nWhen the DOM parses a Number, it stores it as either one of the following type:\n\nType       | Description\n-----------|---------------------------------------\n`unsigned` | 32-bit unsigned integer\n`int`      | 32-bit signed integer\n`uint64_t` | 64-bit unsigned integer\n`int64_t`  | 64-bit signed integer\n`double`   | 64-bit double precision floating point\n\nWhen querying a number, you can check whether the number can be obtained as target type:\n\nChecking          | Obtaining\n------------------|---------------------\n`bool IsNumber()` | N/A\n`bool IsUint()`   | `unsigned GetUint()`\n`bool IsInt()`    | `int GetInt()`\n`bool IsUint64()` | `uint64_t GetUint()`\n`bool IsInt64()`  | `int64_t GetInt64()`\n`bool IsDouble()` | `double GetDouble()`\n\nNote that, an integer value may be obtained in various ways without conversion. For example, A value `x` containing 123 will make `x.IsInt() == x.IsUint() == x.IsInt64() == x.IsUint64() == true`. But a value `y` containing -3000000000 will only makes `x.IsInt64() == true`.\n\nWhen obtaining the numeric values, `GetDouble()` will convert internal integer representation to a `double`. Note that, `int` and `uint` can be safely convert to `double`, but `int64_t` and `uint64_t` may lose precision (since mantissa of `double` is only 52-bits).\n\n## Query String {#QueryString}\n\nIn addition to `GetString()`, the `Value` class also contains `GetStringLength()`. Here explains why.\n\nAccording to RFC 4627, JSON strings can contain Unicode character `U+0000`, which must be escaped as `\"\\u0000\"`. The problem is that, C/C++ often uses null-terminated string, which treats ``\\0'` as the terminator symbol.\n\nTo conform RFC 4627, RapidJSON supports string containing `U+0000`. If you need to handle this, you can use `GetStringLength()` API to obtain the correct length of string.\n\nFor example, after parsing a the following JSON string to `Document d`.\n\n~~~~~~~~~~js\n{ \"s\" :  \"a\\u0000b\" }\n~~~~~~~~~~\nThe correct length of the value `\"a\\u0000b\"` is 3. But `strlen()` returns 1.\n\n`GetStringLength()` can also improve performance, as user may often need to call `strlen()` for allocating buffer.\n\nBesides, `std::string` also support a constructor:\n\n~~~~~~~~~~cpp\nstring(const char* s, size_t count);\n~~~~~~~~~~\n\nwhich accepts the length of string as parameter. This constructor supports storing null character within the string, and should also provide better performance.\n\n## Comparing values\n\nYou can use `==` and `!=` to compare values. Two values are equal if and only if they are have same type and contents. You can also compare values with primitive types. Here is an example.\n\n~~~~~~~~~~cpp\nif (document[\"hello\"] == document[\"n\"]) /*...*/;    // Compare values\nif (document[\"hello\"] == \"world\") /*...*/;          // Compare value with literal string\nif (document[\"i\"] != 123) /*...*/;                  // Compare with integers\nif (document[\"pi\"] != 3.14) /*...*/;                // Compare with double.\n~~~~~~~~~~\n\nArray and object must be `Value`s in order to be compared. They are equal if and only if their whole subtrees are equal.\n\nNote that, currently if an object contains duplicated named member, comparing equality with any object is always `false`.\n\n# Create/Modify Values {#CreateModifyValues}\n\nThere are several ways to create values. After a DOM tree is created and/or modified, it can be saved as JSON again using `Writer`.\n\n## Change Value Type {#ChangeValueType}\nWhen creating a Value or Document by default constructor, its type is Null. To change its type, call `SetXXX()` or assignment operator, for example:\n\n~~~~~~~~~~cpp\nDocument d; // Null\nd.SetObject();\n\nValue v;    // Null\nv.SetInt(10);\nv = 10;     // Shortcut, same as above\n~~~~~~~~~~\n\n### Overloaded Constructors\nThere are also overloaded constructors for several types:\n\n~~~~~~~~~~cpp\nValue b(true);    // calls Value(bool)\nValue i(-123);    // calls Value(int)\nValue u(123u);    // calls Value(unsigned)\nValue d(1.5);     // calls Value(double)\n~~~~~~~~~~\n\nTo create empty object or array, you may use `SetObject()`/`SetArray()` after default constructor, or using the `Value(Type)` in one shot:\n\n~~~~~~~~~~cpp\nValue o(kObjectType);\nValue a(kArrayType);\n~~~~~~~~~~\n\n## Move Semantics {#MoveSemantics}\n\nA very special decision during design of RapidJSON is that, assignment of value does not copy the source value to destination value. Instead, the value from source is moved to the destination. For example,\n\n~~~~~~~~~~cpp\nValue a(123);\nValue b(456);\nb = a;         // a becomes a Null value, b becomes number 123.\n~~~~~~~~~~\n\n![Assignment with move semantics.](diagram/move1.png)\n\nWhy? What is the advantage of this semantics?\n\nThe simple answer is performance. For fixed size JSON types (Number, True, False, Null), copying them is fast and easy. However, For variable size JSON types (String, Array, Object), copying them will incur a lot of overheads. And these overheads are often unnoticed. Especially when we need to create temporary object, copy it to another variable, and then destruct it.\n\nFor example, if normal *copy* semantics was used:\n\n~~~~~~~~~~cpp\nValue o(kObjectType);\n{\n    Value contacts(kArrayType);\n    // adding elements to contacts array.\n    // ...\n    o.AddMember(\"contacts\", contacts);  // deep clone contacts (may be with lots of allocations)\n    // destruct contacts.\n}\n~~~~~~~~~~\n\n![Copy semantics makes a lots of copy operations.](diagram/move2.png)\n\nThe object `o` needs to allocate a buffer of same size as contacts, makes a deep clone of it, and then finally contacts is destructed. This will incur a lot of unnecessary allocations/deallocations and memory copying.\n\nThere are solutions to prevent actual copying these data, such as reference counting and garbage collection(GC).\n\nTo make RapidJSON simple and fast, we chose to use *move* semantics for assignment. It is similar to `std::auto_ptr` which transfer ownership during assignment. Move is much faster and simpler, it just destructs the original value, `memcpy()` the source to destination, and finally sets the source as Null type.\n\nSo, with move semantics, the above example becomes:\n\n~~~~~~~~~~cpp\nValue o(kObjectType);\n{\n    Value contacts(kArrayType);\n    // adding elements to contacts array.\n    o.AddMember(\"contacts\", contacts);  // just memcpy() of contacts itself to the value of new member (16 bytes)\n    // contacts became Null here. Its destruction is trivial.\n}\n~~~~~~~~~~\n\n![Move semantics makes no copying.](diagram/move3.png)\n\nThis is called move assignment operator in C++11. As RapidJSON supports C++03, it adopts move semantics using assignment operator, and all other modifying function like `AddMember()`, `PushBack()`.\n\n### Move semantics and temporary values {#TemporaryValues}\n\nSometimes, it is convenient to construct a Value in place, before passing it to one of the \"moving\" functions, like `PushBack()` or `AddMember()`.  As temporary objects can't be converted to proper Value references, the convenience function `Move()` is available:\n\n~~~~~~~~~~cpp\nValue a(kArrayType);\nDocument::AllocatorType& allocator = document.GetAllocator();\n// a.PushBack(Value(42), allocator);       // will not compile\na.PushBack(Value().SetInt(42), allocator); // fluent API\na.PushBack(Value(42).Move(), allocator);   // same as above\n~~~~~~~~~~\n\n## Create String {#CreateString}\nRapidJSON provide two strategies for storing string.\n\n1. copy-string: allocates a buffer, and then copy the source data into it.\n2. const-string: simply store a pointer of string.\n\nCopy-string is always safe because it owns a copy of the data. Const-string can be used for storing string literal, and in-situ parsing which we will mentioned in Document section.\n\nTo make memory allocation customizable, RapidJSON requires user to pass an instance of allocator, whenever an operation may require allocation. This design is more flexible than STL's allocator type per class, as we can assign an allocator instance for each allocation.\n\nTherefore, when we assign a copy-string, we call this overloaded `SetString()` with allocator:\n\n~~~~~~~~~~cpp\nDocument document;\nValue author;\nchar buffer[10];\nint len = sprintf(buffer, \"%s %s\", \"Milo\", \"Yip\"); // dynamically created string.\nauthor.SetString(buffer, len, document.GetAllocator());\nmemset(buffer, 0, sizeof(buffer));\n// author.GetString() still contains \"Milo Yip\" after buffer is destroyed\n~~~~~~~~~~\n\nIn this example, we get the allocator from a `Document` instance. This is a common idiom when using RapidJSON. But you may use other instances of allocator.\n\nBesides, the above `SetString()` requires length. This can handle null characters within a string. There is another `SetString()` overloaded function without the length parameter. And it assumes the input is null-terminated and calls a `strlen()`-like function to obtain the length.\n\nFinally, for literal string or string with safe life-cycle can use const-string version of `SetString()`, which lacks allocator parameter.  For string literals (or constant character arrays), simply passing the literal as parameter is safe and efficient:\n\n~~~~~~~~~~cpp\nValue s;\ns.SetString(\"rapidjson\");    // can contain null character, length derived at compile time\ns = \"rapidjson\";             // shortcut, same as above\n~~~~~~~~~~\n\nFor plain string pointers, the RapidJSON requires to mark a string as safe before using it without copying.  This can be achieved by using the `StringRef` function:\n\n~~~~~~~~~cpp\nconst char * cstr = getenv(\"USER\");\nsize_t cstr_len = ...;                 // in case length is available\nValue s;\n// s.SetString(cstr);                  // will not compile\ns.SetString(StringRef(cstr));          // ok, assume safe lifetime, null-terminated\ns = StringRef(cstr);                   // shortcut, same as above\ns.SetString(StringRef(cstr,cstr_len)); // faster, can contain null character\ns = StringRef(cstr,cstr_len);          // shortcut, same as above\n\n~~~~~~~~~\n\n## Modify Array {#ModifyArray}\nValue with array type provides similar APIs as `std::vector`.\n\n* `Clear()`\n* `Reserve(SizeType, Allocator&)`\n* `Value& PushBack(Value&, Allocator&)`\n* `template <typename T> GenericValue& PushBack(T, Allocator&)`\n* `Value& PopBack()`\n* `ValueIterator Erase(ConstValueIterator pos)`\n* `ValueIterator Erase(ConstValueIterator first, ConstValueIterator last)`\n\nNote that, `Reserve(...)` and `PushBack(...)` may allocate memory for the array elements, therefore require an allocator.\n\nHere is an example of `PushBack()`:\n\n~~~~~~~~~~cpp\nValue a(kArrayType);\nDocument::AllocatorType& allocator = document.GetAllocator();\n\nfor (int i = 5; i <= 10; i++)\n    a.PushBack(i, allocator);   // allocator is needed for potential realloc().\n\n// Fluent interface\na.PushBack(\"Lua\", allocator).PushBack(\"Mio\", allocator);\n~~~~~~~~~~\n\nDiffers from STL, `PushBack()`/`PopBack()` returns the array reference itself. This is called _fluent interface_.\n\nIf you want to add a non-constant string or a string without sufficient lifetime (see [Create String](#CreateString)) to the array, you need to create a string Value by using the copy-string API.  To avoid the need for an intermediate variable, you can use a [temporary value](#TemporaryValues) in place:\n\n~~~~~~~~~~cpp\n// in-place Value parameter\ncontact.PushBack(Value(\"copy\", document.GetAllocator()).Move(), // copy string\n                 document.GetAllocator());\n\n// explicit parameters\nValue val(\"key\", document.GetAllocator()); // copy string\ncontact.PushBack(val, document.GetAllocator());\n~~~~~~~~~~\n\n## Modify Object {#ModifyObject}\nObject is a collection of key-value pairs. Each key must be a string value. The way to manipulating object is to add members:\n\n* `Value& AddMember(Value&, Value&, Allocator& allocator)`\n* `Value& AddMember(StringRefType, Value&, Allocator&)`\n* `template <typename T> Value& AddMember(StringRefType, T value, Allocator&)`\n\nHere is an example.\n\n~~~~~~~~~~cpp\nValue contact(kObject);\ncontact.AddMember(\"name\", \"Milo\", document.GetAllocator());\ncontact.AddMember(\"married\", true, document.GetAllocator());\n~~~~~~~~~~\n\nThe `StringRefType` used as name parameter assumes the same interface as the `SetString` function for string values.  These overloads are used to avoid the need for copying the `name` string, as constant key names are very common in JSON objects.\n\nIf you need to create a name from a non-constant string or a string without sufficient lifetime (see [Create String](#CreateString)), you need to create a string Value by using the copy-string API.  To avoid the need for an intermediate variable, you can use a [temporary value](#TemporaryValues) in place:\n\n~~~~~~~~~~cpp\n// in-place Value parameter\ncontact.AddMember(Value(\"copy\", document.GetAllocator()).Move(), // copy string\n                  Value().Move(),                                // null value\n                  document.GetAllocator());\n\n// explicit parameters\nValue key(\"key\", document.GetAllocator()); // copy name string\nValue val(42);                             // some value\ncontact.AddMember(key, val, document.GetAllocator());\n~~~~~~~~~~\n\nFor removing members, there are several choices: \n\n* `bool RemoveMember(const Ch* name)`: Remove a member by search its name (linear time complexity).\n* `bool RemoveMember(const Value& name)`: same as above but `name` is a Value.\n* `MemberIterator RemoveMember(MemberIterator)`: Remove a member by iterator (_constant_ time complexity).\n* `MemberIterator EraseMember(MemberIterator)`: similar to the above but it preserves order of members (linear time complexity).\n* `MemberIterator EraseMember(MemberIterator first, MemberIterator last)`: remove a range of members, preserves order (linear time complexity).\n\n`MemberIterator RemoveMember(MemberIterator)` uses a \"move-last\" trick to archive constant time complexity. Basically the member at iterator is destructed, and then the last element is moved to that position. So the order of the remaining members are changed.\n\n## Deep Copy Value {#DeepCopyValue}\nIf we really need to copy a DOM tree, we can use two APIs for deep copy: constructor with allocator, and `CopyFrom()`.\n\n~~~~~~~~~~cpp\nDocument d;\nDocument::AllocatorType& a = d.GetAllocator();\nValue v1(\"foo\");\n// Value v2(v1); // not allowed\n\nValue v2(v1, a);                      // make a copy\nassert(v1.IsString());                // v1 untouched\nd.SetArray().PushBack(v1, a).PushBack(v2, a);\nassert(v1.IsNull() && v2.IsNull());   // both moved to d\n\nv2.CopyFrom(d, a);                    // copy whole document to v2\nassert(d.IsArray() && d.Size() == 2); // d untouched\nv1.SetObject().AddMember(\"array\", v2, a);\nd.PushBack(v1, a);\n~~~~~~~~~~\n\n## Swap Values {#SwapValues}\n\n`Swap()` is also provided.\n\n~~~~~~~~~~cpp\nValue a(123);\nValue b(\"Hello\");\na.Swap(b);\nassert(a.IsString());\nassert(b.IsInt());\n~~~~~~~~~~\n\nSwapping two DOM trees is fast (constant time), despite the complexity of the trees.\n\n# What's next {#WhatsNext}\n\nThis tutorial shows the basics of DOM tree query and manipulation. There are several important concepts in RapidJSON:\n\n1. [Streams](doc/stream.md) are channels for reading/writing JSON, which can be a in-memory string, or file stream, etc. User can also create their streams.\n2. [Encoding](doc/encoding.md) defines which character set is used in streams and memory. RapidJSON also provide Unicode conversion/validation internally.\n3. [DOM](doc/dom.md)'s basics are already covered in this tutorial. Uncover more advanced features such as *in situ* parsing, other parsing options and advanced usages.\n4. [SAX](doc/sax.md) is the foundation of parsing/generating facility in RapidJSON. Learn how to use `Reader`/`Writer` to implement even faster applications. Also try `PrettyWriter` to format the JSON.\n5. [Performance](doc/performance.md) shows some in-house and third-party benchmarks.\n6. [Internals](doc/internals.md) describes some internal designs and techniques of RapidJSON.\n\nYou may also refer to the [FAQ](faq.md), API documentation, examples and unit tests.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/example/capitalize/capitalize.cpp",
    "content": "// JSON condenser exmaple\n\n// This example parses JSON from stdin with validation, \n// and re-output the JSON content to stdout with all string capitalized, and without whitespace.\n\n#include \"rapidjson/reader.h\"\n#include \"rapidjson/writer.h\"\n#include \"rapidjson/filereadstream.h\"\n#include \"rapidjson/filewritestream.h\"\n#include \"rapidjson/error/en.h\"\n#include <vector>\n#include <cctype>\n\nusing namespace rapidjson;\n\ntemplate<typename OutputHandler>\nstruct CapitalizeFilter {\n    CapitalizeFilter(OutputHandler& out) : out_(out), buffer_() {}\n\n    bool Null() { return out_.Null(); }\n    bool Bool(bool b) { return out_.Bool(b); }\n    bool Int(int i) { return out_.Int(i); }\n    bool Uint(unsigned u) { return out_.Uint(u); }\n    bool Int64(int64_t i) { return out_.Int64(i); }\n    bool Uint64(uint64_t u) { return out_.Uint64(u); }\n    bool Double(double d) { return out_.Double(d); }\n    bool String(const char* str, SizeType length, bool) { \n        buffer_.clear();\n        for (SizeType i = 0; i < length; i++)\n            buffer_.push_back(std::toupper(str[i]));\n        return out_.String(&buffer_.front(), length, true); // true = output handler need to copy the string\n    }\n    bool StartObject() { return out_.StartObject(); }\n    bool Key(const char* str, SizeType length, bool copy) { return String(str, length, copy); }\n    bool EndObject(SizeType memberCount) { return out_.EndObject(memberCount); }\n    bool StartArray() { return out_.StartArray(); }\n    bool EndArray(SizeType elementCount) { return out_.EndArray(elementCount); }\n\n    OutputHandler& out_;\n    std::vector<char> buffer_;\n\nprivate:\n    CapitalizeFilter(const CapitalizeFilter&);\n    CapitalizeFilter& operator=(const CapitalizeFilter&);\n};\n\nint main(int, char*[]) {\n    // Prepare JSON reader and input stream.\n    Reader reader;\n    char readBuffer[65536];\n    FileReadStream is(stdin, readBuffer, sizeof(readBuffer));\n\n    // Prepare JSON writer and output stream.\n    char writeBuffer[65536];\n    FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));\n    Writer<FileWriteStream> writer(os);\n\n    // JSON reader parse from the input stream and let writer generate the output.\n    CapitalizeFilter<Writer<FileWriteStream> > filter(writer);\n    if (!reader.Parse(is, filter)) {\n        fprintf(stderr, \"\\nError(%u): %s\\n\", (unsigned)reader.GetErrorOffset(), GetParseError_En(reader.GetParseErrorCode()));\n        return 1;\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/example/condense/condense.cpp",
    "content": "// JSON condenser exmaple\n\n// This example parses JSON text from stdin with validation, \n// and re-output the JSON content to stdout without whitespace.\n\n#include \"rapidjson/reader.h\"\n#include \"rapidjson/writer.h\"\n#include \"rapidjson/filereadstream.h\"\n#include \"rapidjson/filewritestream.h\"\n#include \"rapidjson/error/en.h\"\n\nusing namespace rapidjson;\n\nint main(int, char*[]) {\n    // Prepare JSON reader and input stream.\n    Reader reader;\n    char readBuffer[65536];\n    FileReadStream is(stdin, readBuffer, sizeof(readBuffer));\n\n    // Prepare JSON writer and output stream.\n    char writeBuffer[65536];\n    FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));\n    Writer<FileWriteStream> writer(os);\n\n    // JSON reader parse from the input stream and let writer generate the output.\n    if (!reader.Parse(is, writer)) {\n        fprintf(stderr, \"\\nError(%u): %s\\n\", (unsigned)reader.GetErrorOffset(), GetParseError_En(reader.GetParseErrorCode()));\n        return 1;\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/example/messagereader/messagereader.cpp",
    "content": "// Reading a message JSON with Reader (SAX-style API).\n// The JSON should be an object with key-string pairs.\n\n#include \"rapidjson/reader.h\"\n#include \"rapidjson/error/en.h\"\n#include <iostream>\n#include <string>\n#include <map>\n\nusing namespace std;\nusing namespace rapidjson;\n\ntypedef map<string, string> MessageMap;\n\n#if defined(__GNUC__)\nRAPIDJSON_DIAG_PUSH\nRAPIDJSON_DIAG_OFF(effc++)\n#endif\n\nstruct MessageHandler : public BaseReaderHandler<> {\n    MessageHandler() : messages_(), state_(kExpectObjectStart), name_() {}\n\n    bool StartObject() {\n        switch (state_) {\n        case kExpectObjectStart:\n            state_ = kExpectNameOrObjectEnd;\n            return true;\n        default:\n            return false;\n        }\n    }\n\n    bool String(const char* str, SizeType length, bool) {\n        switch (state_) {\n        case kExpectNameOrObjectEnd:\n            name_ = string(str, length);\n            state_ = kExpectValue;\n            return true;\n        case kExpectValue:\n            messages_.insert(MessageMap::value_type(name_, string(str, length)));\n            state_ = kExpectNameOrObjectEnd;\n            return true;\n        default:\n            return false;\n        }\n    }\n\n    bool EndObject(SizeType) { return state_ == kExpectNameOrObjectEnd; }\n\n    bool Default() { return false; } // All other events are invalid.\n\n    MessageMap messages_;\n    enum State {\n        kExpectObjectStart,\n        kExpectNameOrObjectEnd,\n        kExpectValue,\n    }state_;\n    std::string name_;\n};\n\n#if defined(__GNUC__)\nRAPIDJSON_DIAG_POP\n#endif\n\nvoid ParseMessages(const char* json, MessageMap& messages) {\n    Reader reader;\n    MessageHandler handler;\n    StringStream ss(json);\n    if (reader.Parse(ss, handler))\n        messages.swap(handler.messages_);   // Only change it if success.\n    else {\n        ParseErrorCode e = reader.GetParseErrorCode();\n        size_t o = reader.GetErrorOffset();\n        cout << \"Error: \" << GetParseError_En(e) << endl;;\n        cout << \" at offset \" << o << \" near '\" << string(json).substr(o, 10) << \"...'\" << endl;\n    }\n}\n\nint main() {\n    MessageMap messages;\n\n    const char* json1 = \"{ \\\"greeting\\\" : \\\"Hello!\\\", \\\"farewell\\\" : \\\"bye-bye!\\\" }\";\n    cout << json1 << endl;\n    ParseMessages(json1, messages);\n\n    for (MessageMap::const_iterator itr = messages.begin(); itr != messages.end(); ++itr)\n        cout << itr->first << \": \" << itr->second << endl;\n\n    cout << endl << \"Parse a JSON with invalid schema.\" << endl;\n    const char* json2 = \"{ \\\"greeting\\\" : \\\"Hello!\\\", \\\"farewell\\\" : \\\"bye-bye!\\\", \\\"foo\\\" : {} }\";\n    cout << json2 << endl;\n    ParseMessages(json2, messages);\n\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/example/pretty/pretty.cpp",
    "content": "// JSON pretty formatting example\n// This example can only handle UTF-8. For handling other encodings, see prettyauto example.\n\n#include \"rapidjson/reader.h\"\n#include \"rapidjson/prettywriter.h\"\n#include \"rapidjson/filereadstream.h\"\n#include \"rapidjson/filewritestream.h\"\n#include \"rapidjson/error/en.h\"\n\nusing namespace rapidjson;\n\nint main(int, char*[]) {\n    // Prepare reader and input stream.\n    Reader reader;\n    char readBuffer[65536];\n    FileReadStream is(stdin, readBuffer, sizeof(readBuffer));\n\n    // Prepare writer and output stream.\n    char writeBuffer[65536];\n    FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));\n    PrettyWriter<FileWriteStream> writer(os);\n\n    // JSON reader parse from the input stream and let writer generate the output.\n    if (!reader.Parse<kParseValidateEncodingFlag>(is, writer)) {\n        fprintf(stderr, \"\\nError(%u): %s\\n\", (unsigned)reader.GetErrorOffset(), GetParseError_En(reader.GetParseErrorCode()));\n        return 1;\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/example/prettyauto/prettyauto.cpp",
    "content": "// JSON pretty formatting example\n// This example can handle UTF-8/UTF-16LE/UTF-16BE/UTF-32LE/UTF-32BE.\n// The input firstly convert to UTF8, and then write to the original encoding with pretty formatting.\n\n#include \"rapidjson/reader.h\"\n#include \"rapidjson/prettywriter.h\"\n#include \"rapidjson/filereadstream.h\"\n#include \"rapidjson/filewritestream.h\"\n#include \"rapidjson/encodedstream.h\"    // NEW\n#include \"rapidjson/error/en.h\"\n#ifdef _WIN32\n#include <fcntl.h>\n#include <io.h>\n#endif\n\nusing namespace rapidjson;\n\nint main(int, char*[]) {\n#ifdef _WIN32\n    // Prevent Windows converting between CR+LF and LF\n    _setmode(_fileno(stdin), _O_BINARY);    // NEW\n    _setmode(_fileno(stdout), _O_BINARY);   // NEW\n#endif\n\n    // Prepare reader and input stream.\n    //Reader reader;\n    GenericReader<AutoUTF<unsigned>, UTF8<> > reader;       // CHANGED\n    char readBuffer[65536];\n    FileReadStream is(stdin, readBuffer, sizeof(readBuffer));\n    AutoUTFInputStream<unsigned, FileReadStream> eis(is);   // NEW\n\n    // Prepare writer and output stream.\n    char writeBuffer[65536];\n    FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));\n\n#if 1\n    // Use the same Encoding of the input. Also use BOM according to input.\n    typedef AutoUTFOutputStream<unsigned, FileWriteStream> OutputStream;    // NEW\n    OutputStream eos(os, eis.GetType(), eis.HasBOM());                      // NEW\n    PrettyWriter<OutputStream, UTF8<>, AutoUTF<unsigned> > writer(eos);     // CHANGED\n#else\n    // You may also use static bound encoding type, such as output to UTF-16LE with BOM\n    typedef EncodedOutputStream<UTF16LE<>,FileWriteStream> OutputStream;    // NEW\n    OutputStream eos(os, true);                                             // NEW\n    PrettyWriter<OutputStream, UTF8<>, UTF16LE<> > writer(eos);             // CHANGED\n#endif\n\n    // JSON reader parse from the input stream and let writer generate the output.\n    //if (!reader.Parse<kParseValidateEncodingFlag>(is, writer)) {\n    if (!reader.Parse<kParseValidateEncodingFlag>(eis, writer)) {   // CHANGED\n        fprintf(stderr, \"\\nError(%u): %s\\n\", (unsigned)reader.GetErrorOffset(), GetParseError_En(reader.GetParseErrorCode()));\n        return 1;\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/example/serialize/serialize.cpp",
    "content": "// Serialize example\n// This example shows writing JSON string with writer directly.\n\n#include \"rapidjson/prettywriter.h\" // for stringify JSON\n#include \"rapidjson/filestream.h\"   // wrapper of C stream for prettywriter as output\n#include <cstdio>\n#include <string>\n#include <vector>\n\nusing namespace rapidjson;\n\nclass Person {\npublic:\n    Person(const std::string& name, unsigned age) : name_(name), age_(age) {}\n    virtual ~Person();\n\nprotected:\n    template <typename Writer>\n    void Serialize(Writer& writer) const {\n        // This base class just write out name-value pairs, without wrapping within an object.\n        writer.String(\"name\");\n        writer.String(name_.c_str(), (SizeType)name_.length()); // Suppling length of string is faster.\n\n        writer.String(\"age\");\n        writer.Uint(age_);\n    }\n\nprivate:\n    std::string name_;\n    unsigned age_;\n};\n\nPerson::~Person() {\n}\n\nclass Education {\npublic:\n    Education(const std::string& school, double GPA) : school_(school), GPA_(GPA) {}\n\n    template <typename Writer>\n    void Serialize(Writer& writer) const {\n        writer.StartObject();\n        \n        writer.String(\"school\");\n        writer.String(school_.c_str(), (SizeType)school_.length());\n\n        writer.String(\"GPA\");\n        writer.Double(GPA_);\n\n        writer.EndObject();\n    }\n\nprivate:\n    std::string school_;\n    double GPA_;\n};\n\nclass Dependent : public Person {\npublic:\n    Dependent(const std::string& name, unsigned age, Education* education = 0) : Person(name, age), education_(education) {}\n    Dependent(const Dependent& rhs) : Person(rhs), education_(0) { education_ = (rhs.education_ == 0) ? 0 : new Education(*rhs.education_); }\n    virtual ~Dependent();\n\n    Dependent& operator=(const Dependent& rhs) {\n        if (this == &rhs)\n            return *this;\n        delete education_;\n        education_ = (rhs.education_ == 0) ? 0 : new Education(*rhs.education_);\n        return *this;\n    }\n\n    template <typename Writer>\n    void Serialize(Writer& writer) const {\n        writer.StartObject();\n\n        Person::Serialize(writer);\n\n        writer.String(\"education\");\n        if (education_)\n            education_->Serialize(writer);\n        else\n            writer.Null();\n\n        writer.EndObject();\n    }\n\nprivate:\n\n    Education *education_;\n};\n\nDependent::~Dependent() {\n    delete education_; \n}\n\nclass Employee : public Person {\npublic:\n    Employee(const std::string& name, unsigned age, bool married) : Person(name, age), dependents_(), married_(married) {}\n    virtual ~Employee();\n\n    void AddDependent(const Dependent& dependent) {\n        dependents_.push_back(dependent);\n    }\n\n    template <typename Writer>\n    void Serialize(Writer& writer) const {\n        writer.StartObject();\n\n        Person::Serialize(writer);\n\n        writer.String(\"married\");\n        writer.Bool(married_);\n\n        writer.String((\"dependents\"));\n        writer.StartArray();\n        for (std::vector<Dependent>::const_iterator dependentItr = dependents_.begin(); dependentItr != dependents_.end(); ++dependentItr)\n            dependentItr->Serialize(writer);\n        writer.EndArray();\n\n        writer.EndObject();\n    }\n\nprivate:\n    std::vector<Dependent> dependents_;\n    bool married_;\n};\n\nEmployee::~Employee() {\n}\n\nint main(int, char*[]) {\n    std::vector<Employee> employees;\n\n    employees.push_back(Employee(\"Milo YIP\", 34, true));\n    employees.back().AddDependent(Dependent(\"Lua YIP\", 3, new Education(\"Happy Kindergarten\", 3.5)));\n    employees.back().AddDependent(Dependent(\"Mio YIP\", 1));\n\n    employees.push_back(Employee(\"Percy TSE\", 30, false));\n\n    FileStream s(stdout);\n    PrettyWriter<FileStream> writer(s);     // Can also use Writer for condensed formatting\n\n    writer.StartArray();\n    for (std::vector<Employee>::const_iterator employeeItr = employees.begin(); employeeItr != employees.end(); ++employeeItr)\n        employeeItr->Serialize(writer);\n    writer.EndArray();\n\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/example/simpledom/simpledom.cpp",
    "content": "// JSON simple example\n// This example does not handle errors.\n\n#include \"rapidjson/document.h\"\n#include \"rapidjson/writer.h\"\n#include \"rapidjson/stringbuffer.h\"\n#include <iostream>\n\nusing namespace rapidjson;\n\nint main() {\n    // 1. Parse a JSON string into DOM.\n    const char* json = \"{\\\"project\\\":\\\"rapidjson\\\",\\\"stars\\\":10}\";\n    Document d;\n    d.Parse(json);\n\n    // 2. Modify it by DOM.\n    Value& s = d[\"stars\"];\n    s.SetInt(s.GetInt() + 1);\n\n    // 3. Stringify the DOM\n    StringBuffer buffer;\n    Writer<StringBuffer> writer(buffer);\n    d.Accept(writer);\n\n    // Output {\"project\":\"rapidjson\",\"stars\":11}\n    std::cout << buffer.GetString() << std::endl;\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/example/simplereader/simplereader.cpp",
    "content": "#include \"rapidjson/reader.h\"\n#include <iostream>\n\nusing namespace rapidjson;\nusing namespace std;\n\nstruct MyHandler {\n    bool Null() { cout << \"Null()\" << endl; return true; }\n    bool Bool(bool b) { cout << \"Bool(\" << boolalpha << b << \")\" << endl; return true; }\n    bool Int(int i) { cout << \"Int(\" << i << \")\" << endl; return true; }\n    bool Uint(unsigned u) { cout << \"Uint(\" << u << \")\" << endl; return true; }\n    bool Int64(int64_t i) { cout << \"Int64(\" << i << \")\" << endl; return true; }\n    bool Uint64(uint64_t u) { cout << \"Uint64(\" << u << \")\" << endl; return true; }\n    bool Double(double d) { cout << \"Double(\" << d << \")\" << endl; return true; }\n    bool String(const char* str, SizeType length, bool copy) { \n        cout << \"String(\" << str << \", \" << length << \", \" << boolalpha << copy << \")\" << endl;\n        return true;\n    }\n    bool StartObject() { cout << \"StartObject()\" << endl; return true; }\n    bool Key(const char* str, SizeType length, bool copy) {\n        cout << \"Key(\" << str << \", \" << length << \", \" << boolalpha << copy << \")\" << endl;\n        return true;\n    }\n    bool EndObject(SizeType memberCount) { cout << \"EndObject(\" << memberCount << \")\" << endl; return true; }\n    bool StartArray() { cout << \"StartArray()\" << endl; return true; }\n    bool EndArray(SizeType elementCount) { cout << \"EndArray(\" << elementCount << \")\" << endl; return true; }\n};\n\nint main() {\n    const char json[] = \" { \\\"hello\\\" : \\\"world\\\", \\\"t\\\" : true , \\\"f\\\" : false, \\\"n\\\": null, \\\"i\\\":123, \\\"pi\\\": 3.1416, \\\"a\\\":[1, 2, 3, 4] } \";\n\n    MyHandler handler;\n    Reader reader;\n    StringStream ss(json);\n    reader.Parse(ss, handler);\n\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/example/simplewriter/simplewriter.cpp",
    "content": "#include \"rapidjson/writer.h\"\n#include \"rapidjson/stringbuffer.h\"\n#include <iostream>\n\nusing namespace rapidjson;\nusing namespace std;\n\nint main() {\n    StringBuffer s;\n    Writer<StringBuffer> writer(s);\n    \n    writer.StartObject();\n    writer.String(\"hello\");\n    writer.String(\"world\");\n    writer.String(\"t\");\n    writer.Bool(true);\n    writer.String(\"f\");\n    writer.Bool(false);\n    writer.String(\"n\");\n    writer.Null();\n    writer.String(\"i\");\n    writer.Uint(123);\n    writer.String(\"pi\");\n    writer.Double(3.1416);\n    writer.String(\"a\");\n    writer.StartArray();\n    for (unsigned i = 0; i < 4; i++)\n        writer.Uint(i);\n    writer.EndArray();\n    writer.EndObject();\n\n    cout << s.GetString() << endl;\n\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/example/tutorial/tutorial.cpp",
    "content": "// Hello World example\n// This example shows basic usage of DOM-style API.\n\n#include \"rapidjson/document.h\"     // rapidjson's DOM-style API\n#include \"rapidjson/prettywriter.h\" // for stringify JSON\n#include \"rapidjson/filestream.h\"   // wrapper of C stream for prettywriter as output\n#include <cstdio>\n\nusing namespace rapidjson;\n\nint main(int, char*[]) {\n    ////////////////////////////////////////////////////////////////////////////\n    // 1. Parse a JSON text string to a document.\n\n    const char json[] = \" { \\\"hello\\\" : \\\"world\\\", \\\"t\\\" : true , \\\"f\\\" : false, \\\"n\\\": null, \\\"i\\\":123, \\\"pi\\\": 3.1416, \\\"a\\\":[1, 2, 3, 4] } \";\n    printf(\"Original JSON:\\n %s\\n\", json);\n\n    Document document;  // Default template parameter uses UTF8 and MemoryPoolAllocator.\n\n#if 0\n    // \"normal\" parsing, decode strings to new buffers. Can use other input stream via ParseStream().\n    if (document.Parse(json).HasParseError())\n        return 1;\n#else\n    // In-situ parsing, decode strings directly in the source string. Source must be string.\n    {\n        char buffer[sizeof(json)];\n        memcpy(buffer, json, sizeof(json));\n        if (document.ParseInsitu(buffer).HasParseError())\n            return 1;\n    }\n#endif\n\n    printf(\"\\nParsing to document succeeded.\\n\");\n\n    ////////////////////////////////////////////////////////////////////////////\n    // 2. Access values in document. \n\n    printf(\"\\nAccess values in document:\\n\");\n    assert(document.IsObject());    // Document is a JSON value represents the root of DOM. Root can be either an object or array.\n\n    assert(document.HasMember(\"hello\"));\n    assert(document[\"hello\"].IsString());\n    printf(\"hello = %s\\n\", document[\"hello\"].GetString());\n\n    // Since version 0.2, you can use single lookup to check the existing of member and its value:\n    Value::MemberIterator hello = document.FindMember(\"hello\");\n    assert(hello != document.MemberEnd());\n    assert(hello->value.IsString());\n    assert(strcmp(\"world\", hello->value.GetString()) == 0);\n    (void)hello;\n\n    assert(document[\"t\"].IsBool());     // JSON true/false are bool. Can also uses more specific function IsTrue().\n    printf(\"t = %s\\n\", document[\"t\"].GetBool() ? \"true\" : \"false\");\n\n    assert(document[\"f\"].IsBool());\n    printf(\"f = %s\\n\", document[\"f\"].GetBool() ? \"true\" : \"false\");\n\n    printf(\"n = %s\\n\", document[\"n\"].IsNull() ? \"null\" : \"?\");\n\n    assert(document[\"i\"].IsNumber());   // Number is a JSON type, but C++ needs more specific type.\n    assert(document[\"i\"].IsInt());      // In this case, IsUint()/IsInt64()/IsUInt64() also return true.\n    printf(\"i = %d\\n\", document[\"i\"].GetInt()); // Alternative (int)document[\"i\"]\n\n    assert(document[\"pi\"].IsNumber());\n    assert(document[\"pi\"].IsDouble());\n    printf(\"pi = %g\\n\", document[\"pi\"].GetDouble());\n\n    {\n        const Value& a = document[\"a\"]; // Using a reference for consecutive access is handy and faster.\n        assert(a.IsArray());\n        for (SizeType i = 0; i < a.Size(); i++) // rapidjson uses SizeType instead of size_t.\n            printf(\"a[%d] = %d\\n\", i, a[i].GetInt());\n        \n        // Note:\n        //int x = a[0].GetInt();                    // Error: operator[ is ambiguous, as 0 also mean a null pointer of const char* type.\n        int y = a[SizeType(0)].GetInt();            // Cast to SizeType will work.\n        int z = a[0u].GetInt();                     // This works too.\n        (void)y;\n        (void)z;\n\n        // Iterating array with iterators\n        printf(\"a = \");\n        for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr)\n            printf(\"%d \", itr->GetInt());\n        printf(\"\\n\");\n    }\n\n    // Iterating object members\n    static const char* kTypeNames[] = { \"Null\", \"False\", \"True\", \"Object\", \"Array\", \"String\", \"Number\" };\n    for (Value::ConstMemberIterator itr = document.MemberBegin(); itr != document.MemberEnd(); ++itr)\n        printf(\"Type of member %s is %s\\n\", itr->name.GetString(), kTypeNames[itr->value.GetType()]);\n\n    ////////////////////////////////////////////////////////////////////////////\n    // 3. Modify values in document.\n\n    // Change i to a bigger number\n    {\n        uint64_t f20 = 1;   // compute factorial of 20\n        for (uint64_t j = 1; j <= 20; j++)\n            f20 *= j;\n        document[\"i\"] = f20;    // Alternate form: document[\"i\"].SetUint64(f20)\n        assert(!document[\"i\"].IsInt()); // No longer can be cast as int or uint.\n    }\n\n    // Adding values to array.\n    {\n        Value& a = document[\"a\"];   // This time we uses non-const reference.\n        Document::AllocatorType& allocator = document.GetAllocator();\n        for (int i = 5; i <= 10; i++)\n            a.PushBack(i, allocator);   // May look a bit strange, allocator is needed for potentially realloc. We normally uses the document's.\n\n        // Fluent API\n        a.PushBack(\"Lua\", allocator).PushBack(\"Mio\", allocator);\n    }\n\n    // Making string values.\n\n    // This version of SetString() just store the pointer to the string.\n    // So it is for literal and string that exists within value's life-cycle.\n    {\n        document[\"hello\"] = \"rapidjson\";    // This will invoke strlen()\n        // Faster version:\n        // document[\"hello\"].SetString(\"rapidjson\", 9);\n    }\n\n    // This version of SetString() needs an allocator, which means it will allocate a new buffer and copy the the string into the buffer.\n    Value author;\n    {\n        char buffer[10];\n        int len = sprintf(buffer, \"%s %s\", \"Milo\", \"Yip\");  // synthetic example of dynamically created string.\n\n        author.SetString(buffer, static_cast<size_t>(len), document.GetAllocator());\n        // Shorter but slower version:\n        // document[\"hello\"].SetString(buffer, document.GetAllocator());\n\n        // Constructor version: \n        // Value author(buffer, len, document.GetAllocator());\n        // Value author(buffer, document.GetAllocator());\n        memset(buffer, 0, sizeof(buffer)); // For demonstration purpose.\n    }\n    // Variable 'buffer' is unusable now but 'author' has already made a copy.\n    document.AddMember(\"author\", author, document.GetAllocator());\n\n    assert(author.IsNull());        // Move semantic for assignment. After this variable is assigned as a member, the variable becomes null.\n\n    ////////////////////////////////////////////////////////////////////////////\n    // 4. Stringify JSON\n\n    printf(\"\\nModified JSON with reformatting:\\n\");\n    FileStream f(stdout);\n    PrettyWriter<FileStream> writer(f);\n    document.Accept(writer);    // Accept() traverses the DOM and generates Handler events.\n\n    return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/allocators.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_ALLOCATORS_H_\n#define RAPIDJSON_ALLOCATORS_H_\n\n#include \"rapidjson.h\"\n\nnamespace rapidjson {\n\n///////////////////////////////////////////////////////////////////////////////\n// Allocator\n\n/*! \\class rapidjson::Allocator\n    \\brief Concept for allocating, resizing and freeing memory block.\n    \n    Note that Malloc() and Realloc() are non-static but Free() is static.\n    \n    So if an allocator need to support Free(), it needs to put its pointer in \n    the header of memory block.\n\n\\code\nconcept Allocator {\n    static const bool kNeedFree;    //!< Whether this allocator needs to call Free().\n\n    // Allocate a memory block.\n    // \\param size of the memory block in bytes.\n    // \\returns pointer to the memory block.\n    void* Malloc(size_t size);\n\n    // Resize a memory block.\n    // \\param originalPtr The pointer to current memory block. Null pointer is permitted.\n    // \\param originalSize The current size in bytes. (Design issue: since some allocator may not book-keep this, explicitly pass to it can save memory.)\n    // \\param newSize the new size in bytes.\n    void* Realloc(void* originalPtr, size_t originalSize, size_t newSize);\n\n    // Free a memory block.\n    // \\param pointer to the memory block. Null pointer is permitted.\n    static void Free(void *ptr);\n};\n\\endcode\n*/\n\n///////////////////////////////////////////////////////////////////////////////\n// CrtAllocator\n\n//! C-runtime library allocator.\n/*! This class is just wrapper for standard C library memory routines.\n    \\note implements Allocator concept\n*/\nclass CrtAllocator {\npublic:\n    static const bool kNeedFree = true;\n    void* Malloc(size_t size) { return std::malloc(size); }\n    void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) { (void)originalSize; return std::realloc(originalPtr, newSize); }\n    static void Free(void *ptr) { std::free(ptr); }\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// MemoryPoolAllocator\n\n//! Default memory allocator used by the parser and DOM.\n/*! This allocator allocate memory blocks from pre-allocated memory chunks. \n\n    It does not free memory blocks. And Realloc() only allocate new memory.\n\n    The memory chunks are allocated by BaseAllocator, which is CrtAllocator by default.\n\n    User may also supply a buffer as the first chunk.\n\n    If the user-buffer is full then additional chunks are allocated by BaseAllocator.\n\n    The user-buffer is not deallocated by this allocator.\n\n    \\tparam BaseAllocator the allocator type for allocating memory chunks. Default is CrtAllocator.\n    \\note implements Allocator concept\n*/\ntemplate <typename BaseAllocator = CrtAllocator>\nclass MemoryPoolAllocator {\npublic:\n    static const bool kNeedFree = false;    //!< Tell users that no need to call Free() with this allocator. (concept Allocator)\n\n    //! Constructor with chunkSize.\n    /*! \\param chunkSize The size of memory chunk. The default is kDefaultChunkSize.\n        \\param baseAllocator The allocator for allocating memory chunks.\n    */\n    MemoryPoolAllocator(size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) : \n        chunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(0), baseAllocator_(baseAllocator), ownBaseAllocator_(0)\n    {\n        if (!baseAllocator_)\n            ownBaseAllocator_ = baseAllocator_ = new BaseAllocator();\n        AddChunk(chunk_capacity_);\n    }\n\n    //! Constructor with user-supplied buffer.\n    /*! The user buffer will be used firstly. When it is full, memory pool allocates new chunk with chunk size.\n\n        The user buffer will not be deallocated when this allocator is destructed.\n\n        \\param buffer User supplied buffer.\n        \\param size Size of the buffer in bytes. It must at least larger than sizeof(ChunkHeader).\n        \\param chunkSize The size of memory chunk. The default is kDefaultChunkSize.\n        \\param baseAllocator The allocator for allocating memory chunks.\n    */\n    MemoryPoolAllocator(void *buffer, size_t size, size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) :\n        chunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(buffer), baseAllocator_(baseAllocator), ownBaseAllocator_(0)\n    {\n        RAPIDJSON_ASSERT(buffer != 0);\n        RAPIDJSON_ASSERT(size > sizeof(ChunkHeader));\n        chunkHead_ = reinterpret_cast<ChunkHeader*>(buffer);\n        chunkHead_->capacity = size - sizeof(ChunkHeader);\n        chunkHead_->size = 0;\n        chunkHead_->next = 0;\n    }\n\n    //! Destructor.\n    /*! This deallocates all memory chunks, excluding the user-supplied buffer.\n    */\n    ~MemoryPoolAllocator() {\n        Clear();\n        delete ownBaseAllocator_;\n    }\n\n    //! Deallocates all memory chunks, excluding the user-supplied buffer.\n    void Clear() {\n        while(chunkHead_ != 0 && chunkHead_ != userBuffer_) {\n            ChunkHeader* next = chunkHead_->next;\n            baseAllocator_->Free(chunkHead_);\n            chunkHead_ = next;\n        }\n    }\n\n    //! Computes the total capacity of allocated memory chunks.\n    /*! \\return total capacity in bytes.\n    */\n    size_t Capacity() const {\n        size_t capacity = 0;\n        for (ChunkHeader* c = chunkHead_; c != 0; c = c->next)\n            capacity += c->capacity;\n        return capacity;\n    }\n\n    //! Computes the memory blocks allocated.\n    /*! \\return total used bytes.\n    */\n    size_t Size() const {\n        size_t size = 0;\n        for (ChunkHeader* c = chunkHead_; c != 0; c = c->next)\n            size += c->size;\n        return size;\n    }\n\n    //! Allocates a memory block. (concept Allocator)\n    void* Malloc(size_t size) {\n        size = RAPIDJSON_ALIGN(size);\n        if (chunkHead_ == 0 || chunkHead_->size + size > chunkHead_->capacity)\n            AddChunk(chunk_capacity_ > size ? chunk_capacity_ : size);\n\n        void *buffer = reinterpret_cast<char *>(chunkHead_ + 1) + chunkHead_->size;\n        chunkHead_->size += size;\n        return buffer;\n    }\n\n    //! Resizes a memory block (concept Allocator)\n    void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) {\n        if (originalPtr == 0)\n            return Malloc(newSize);\n\n        // Do not shrink if new size is smaller than original\n        if (originalSize >= newSize)\n            return originalPtr;\n\n        // Simply expand it if it is the last allocation and there is sufficient space\n        if (originalPtr == (char *)(chunkHead_ + 1) + chunkHead_->size - originalSize) {\n            size_t increment = static_cast<size_t>(newSize - originalSize);\n            increment = RAPIDJSON_ALIGN(increment);\n            if (chunkHead_->size + increment <= chunkHead_->capacity) {\n                chunkHead_->size += increment;\n                return originalPtr;\n            }\n        }\n\n        // Realloc process: allocate and copy memory, do not free original buffer.\n        void* newBuffer = Malloc(newSize);\n        RAPIDJSON_ASSERT(newBuffer != 0);   // Do not handle out-of-memory explicitly.\n        return std::memcpy(newBuffer, originalPtr, originalSize);\n    }\n\n    //! Frees a memory block (concept Allocator)\n    static void Free(void *ptr) { (void)ptr; } // Do nothing\n\nprivate:\n    //! Copy constructor is not permitted.\n    MemoryPoolAllocator(const MemoryPoolAllocator& rhs) /* = delete */;\n    //! Copy assignment operator is not permitted.\n    MemoryPoolAllocator& operator=(const MemoryPoolAllocator& rhs) /* = delete */;\n\n    //! Creates a new chunk.\n    /*! \\param capacity Capacity of the chunk in bytes.\n    */\n    void AddChunk(size_t capacity) {\n        ChunkHeader* chunk = reinterpret_cast<ChunkHeader*>(baseAllocator_->Malloc(sizeof(ChunkHeader) + capacity));\n        chunk->capacity = capacity;\n        chunk->size = 0;\n        chunk->next = chunkHead_;\n        chunkHead_ =  chunk;\n    }\n\n    static const int kDefaultChunkCapacity = 64 * 1024; //!< Default chunk capacity.\n\n    //! Chunk header for perpending to each chunk.\n    /*! Chunks are stored as a singly linked list.\n    */\n    struct ChunkHeader {\n        size_t capacity;    //!< Capacity of the chunk in bytes (excluding the header itself).\n        size_t size;        //!< Current size of allocated memory in bytes.\n        ChunkHeader *next;  //!< Next chunk in the linked list.\n    };\n\n    ChunkHeader *chunkHead_;    //!< Head of the chunk linked-list. Only the head chunk serves allocation.\n    size_t chunk_capacity_;     //!< The minimum capacity of chunk when they are allocated.\n    void *userBuffer_;          //!< User supplied buffer.\n    BaseAllocator* baseAllocator_;  //!< base allocator for allocating memory chunks.\n    BaseAllocator* ownBaseAllocator_;   //!< base allocator created by this object.\n};\n\n} // namespace rapidjson\n\n#endif // RAPIDJSON_ENCODINGS_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/document.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_DOCUMENT_H_\n#define RAPIDJSON_DOCUMENT_H_\n\n/*! \\file document.h */\n\n#include \"reader.h\"\n#include \"internal/meta.h\"\n#include \"internal/strfunc.h\"\n#include <new>      // placement new\n\n#ifdef _MSC_VER\nRAPIDJSON_DIAG_PUSH\nRAPIDJSON_DIAG_OFF(4127) // conditional expression is constant\n#elif defined(__GNUC__)\nRAPIDJSON_DIAG_PUSH\nRAPIDJSON_DIAG_OFF(effc++)\n#endif\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_HAS_STDSTRING\n\n#ifndef RAPIDJSON_HAS_STDSTRING\n#ifdef RAPIDJSON_DOXYGEN_RUNNING\n#define RAPIDJSON_HAS_STDSTRING 1 // force generation of documentation\n#else\n#define RAPIDJSON_HAS_STDSTRING 0 // no std::string support by default\n#endif\n/*! \\def RAPIDJSON_HAS_STDSTRING\n    \\ingroup RAPIDJSON_CONFIG\n    \\brief Enable RapidJSON support for \\c std::string\n\n    By defining this preprocessor symbol to \\c 1, several convenience functions for using\n    \\ref rapidjson::GenericValue with \\c std::string are enabled, especially\n    for construction and comparison.\n\n    \\hideinitializer\n*/\n#include <string>\n#endif // RAPIDJSON_HAS_STDSTRING\n\n#ifndef RAPIDJSON_NOMEMBERITERATORCLASS\n#include <iterator> // std::iterator, std::random_access_iterator_tag\n#endif\n\nnamespace rapidjson {\n\n// Forward declaration.\ntemplate <typename Encoding, typename Allocator>\nclass GenericValue;\n\n//! Name-value pair in a JSON object value.\n/*!\n    This class was internal to GenericValue. It used to be a inner struct.\n    But a compiler (IBM XL C/C++ for AIX) have reported to have problem with that so it moved as a namespace scope struct.\n    https://code.google.com/p/rapidjson/issues/detail?id=64\n*/\ntemplate <typename Encoding, typename Allocator> \nstruct GenericMember { \n    GenericValue<Encoding, Allocator> name;     //!< name of member (must be a string)\n    GenericValue<Encoding, Allocator> value;    //!< value of member.\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// GenericMemberIterator\n\n#ifndef RAPIDJSON_NOMEMBERITERATORCLASS\n\n//! (Constant) member iterator for a JSON object value\n/*!\n    \\tparam Const Is this a constant iterator?\n    \\tparam Encoding    Encoding of the value. (Even non-string values need to have the same encoding in a document)\n    \\tparam Allocator   Allocator type for allocating memory of object, array and string.\n\n    This class implements a Random Access Iterator for GenericMember elements\n    of a GenericValue, see ISO/IEC 14882:2003(E) C++ standard, 24.1 [lib.iterator.requirements].\n\n    \\note This iterator implementation is mainly intended to avoid implicit\n        conversions from iterator values to \\c NULL,\n        e.g. from GenericValue::FindMember.\n\n    \\note Define \\c RAPIDJSON_NOMEMBERITERATORCLASS to fall back to a\n        pointer-based implementation, if your platform doesn't provide\n        the C++ <iterator> header.\n\n    \\see GenericMember, GenericValue::MemberIterator, GenericValue::ConstMemberIterator\n */\ntemplate <bool Const, typename Encoding, typename Allocator>\nclass GenericMemberIterator\n    : public std::iterator<std::random_access_iterator_tag\n        , typename internal::MaybeAddConst<Const,GenericMember<Encoding,Allocator> >::Type> {\n\n    friend class GenericValue<Encoding,Allocator>;\n    template <bool, typename, typename> friend class GenericMemberIterator;\n\n    typedef GenericMember<Encoding,Allocator> PlainType;\n    typedef typename internal::MaybeAddConst<Const,PlainType>::Type ValueType;\n    typedef std::iterator<std::random_access_iterator_tag,ValueType> BaseType;\n\npublic:\n    //! Iterator type itself\n    typedef GenericMemberIterator Iterator;\n    //! Constant iterator type\n    typedef GenericMemberIterator<true,Encoding,Allocator>  ConstIterator;\n    //! Non-constant iterator type\n    typedef GenericMemberIterator<false,Encoding,Allocator> NonConstIterator;\n\n    //! Pointer to (const) GenericMember\n    typedef typename BaseType::pointer         Pointer;\n    //! Reference to (const) GenericMember\n    typedef typename BaseType::reference       Reference;\n    //! Signed integer type (e.g. \\c ptrdiff_t)\n    typedef typename BaseType::difference_type DifferenceType;\n\n    //! Default constructor (singular value)\n    /*! Creates an iterator pointing to no element.\n        \\note All operations, except for comparisons, are undefined on such values.\n     */\n    GenericMemberIterator() : ptr_() {}\n\n    //! Iterator conversions to more const\n    /*!\n        \\param it (Non-const) iterator to copy from\n\n        Allows the creation of an iterator from another GenericMemberIterator\n        that is \"less const\".  Especially, creating a non-constant iterator\n        from a constant iterator are disabled:\n        \\li const -> non-const (not ok)\n        \\li const -> const (ok)\n        \\li non-const -> const (ok)\n        \\li non-const -> non-const (ok)\n\n        \\note If the \\c Const template parameter is already \\c false, this\n            constructor effectively defines a regular copy-constructor.\n            Otherwise, the copy constructor is implicitly defined.\n    */\n    GenericMemberIterator(const NonConstIterator & it) : ptr_(it.ptr_) {}\n\n    //! @name stepping\n    //@{\n    Iterator& operator++(){ ++ptr_; return *this; }\n    Iterator& operator--(){ --ptr_; return *this; }\n    Iterator  operator++(int){ Iterator old(*this); ++ptr_; return old; }\n    Iterator  operator--(int){ Iterator old(*this); --ptr_; return old; }\n    //@}\n\n    //! @name increment/decrement\n    //@{\n    Iterator operator+(DifferenceType n) const { return Iterator(ptr_+n); }\n    Iterator operator-(DifferenceType n) const { return Iterator(ptr_-n); }\n\n    Iterator& operator+=(DifferenceType n) { ptr_+=n; return *this; }\n    Iterator& operator-=(DifferenceType n) { ptr_-=n; return *this; }\n    //@}\n\n    //! @name relations\n    //@{\n    bool operator==(ConstIterator that) const { return ptr_ == that.ptr_; }\n    bool operator!=(ConstIterator that) const { return ptr_ != that.ptr_; }\n    bool operator<=(ConstIterator that) const { return ptr_ <= that.ptr_; }\n    bool operator>=(ConstIterator that) const { return ptr_ >= that.ptr_; }\n    bool operator< (ConstIterator that) const { return ptr_ < that.ptr_; }\n    bool operator> (ConstIterator that) const { return ptr_ > that.ptr_; }\n    //@}\n\n    //! @name dereference\n    //@{\n    Reference operator*() const { return *ptr_; }\n    Pointer   operator->() const { return ptr_; }\n    Reference operator[](DifferenceType n) const { return ptr_[n]; }\n    //@}\n\n    //! Distance\n    DifferenceType operator-(ConstIterator that) const { return ptr_-that.ptr_; }\n\nprivate:\n    //! Internal constructor from plain pointer\n    explicit GenericMemberIterator(Pointer p) : ptr_(p) {}\n\n    Pointer ptr_; //!< raw pointer\n};\n\n#else // RAPIDJSON_NOMEMBERITERATORCLASS\n\n// class-based member iterator implementation disabled, use plain pointers\n\ntemplate <bool Const, typename Encoding, typename Allocator>\nstruct GenericMemberIterator;\n\n//! non-const GenericMemberIterator\ntemplate <typename Encoding, typename Allocator>\nstruct GenericMemberIterator<false,Encoding,Allocator> {\n    //! use plain pointer as iterator type\n    typedef GenericMember<Encoding,Allocator>* Iterator;\n};\n//! const GenericMemberIterator\ntemplate <typename Encoding, typename Allocator>\nstruct GenericMemberIterator<true,Encoding,Allocator> {\n    //! use plain const pointer as iterator type\n    typedef const GenericMember<Encoding,Allocator>* Iterator;\n};\n\n#endif // RAPIDJSON_NOMEMBERITERATORCLASS\n\n///////////////////////////////////////////////////////////////////////////////\n// GenericStringRef\n\n//! Reference to a constant string (not taking a copy)\n/*!\n    \\tparam CharType character type of the string\n\n    This helper class is used to automatically infer constant string\n    references for string literals, especially from \\c const \\b (!)\n    character arrays.\n\n    The main use is for creating JSON string values without copying the\n    source string via an \\ref Allocator.  This requires that the referenced\n    string pointers have a sufficient lifetime, which exceeds the lifetime\n    of the associated GenericValue.\n\n    \\b Example\n    \\code\n    Value v(\"foo\");   // ok, no need to copy & calculate length\n    const char foo[] = \"foo\";\n    v.SetString(foo); // ok\n\n    const char* bar = foo;\n    // Value x(bar); // not ok, can't rely on bar's lifetime\n    Value x(StringRef(bar)); // lifetime explicitly guaranteed by user\n    Value y(StringRef(bar, 3));  // ok, explicitly pass length\n    \\endcode\n\n    \\see StringRef, GenericValue::SetString\n*/\ntemplate<typename CharType>\nstruct GenericStringRef {\n    typedef CharType Ch; //!< character type of the string\n\n    //! Create string reference from \\c const character array\n    /*!\n        This constructor implicitly creates a constant string reference from\n        a \\c const character array.  It has better performance than\n        \\ref StringRef(const CharType*) by inferring the string \\ref length\n        from the array length, and also supports strings containing null\n        characters.\n\n        \\tparam N length of the string, automatically inferred\n\n        \\param str Constant character array, lifetime assumed to be longer\n            than the use of the string in e.g. a GenericValue\n\n        \\post \\ref s == str\n\n        \\note Constant complexity.\n        \\note There is a hidden, private overload to disallow references to\n            non-const character arrays to be created via this constructor.\n            By this, e.g. function-scope arrays used to be filled via\n            \\c snprintf are excluded from consideration.\n            In such cases, the referenced string should be \\b copied to the\n            GenericValue instead.\n     */\n    template<SizeType N>\n    GenericStringRef(const CharType (&str)[N]) RAPIDJSON_NOEXCEPT\n        : s(str), length(N-1) {}\n\n    //! Explicitly create string reference from \\c const character pointer\n    /*!\n        This constructor can be used to \\b explicitly  create a reference to\n        a constant string pointer.\n\n        \\see StringRef(const CharType*)\n\n        \\param str Constant character pointer, lifetime assumed to be longer\n            than the use of the string in e.g. a GenericValue\n\n        \\post \\ref s == str\n\n        \\note There is a hidden, private overload to disallow references to\n            non-const character arrays to be created via this constructor.\n            By this, e.g. function-scope arrays used to be filled via\n            \\c snprintf are excluded from consideration.\n            In such cases, the referenced string should be \\b copied to the\n            GenericValue instead.\n     */\n    explicit GenericStringRef(const CharType* str)\n        : s(str), length(internal::StrLen(str)){ RAPIDJSON_ASSERT(s != NULL); }\n\n    //! Create constant string reference from pointer and length\n    /*! \\param str constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue\n        \\param len length of the string, excluding the trailing NULL terminator\n\n        \\post \\ref s == str && \\ref length == len\n        \\note Constant complexity.\n     */\n    GenericStringRef(const CharType* str, SizeType len)\n        : s(str), length(len) { RAPIDJSON_ASSERT(s != NULL); }\n\n    //! implicit conversion to plain CharType pointer\n    operator const Ch *() const { return s; }\n\n    const Ch* const s; //!< plain CharType pointer\n    const SizeType length; //!< length of the string (excluding the trailing NULL terminator)\n\nprivate:\n    //! Disallow copy-assignment\n    GenericStringRef operator=(const GenericStringRef&);\n    //! Disallow construction from non-const array\n    template<SizeType N>\n    GenericStringRef(CharType (&str)[N]) /* = delete */;\n};\n\n//! Mark a character pointer as constant string\n/*! Mark a plain character pointer as a \"string literal\".  This function\n    can be used to avoid copying a character string to be referenced as a\n    value in a JSON GenericValue object, if the string's lifetime is known\n    to be valid long enough.\n    \\tparam CharType Character type of the string\n    \\param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue\n    \\return GenericStringRef string reference object\n    \\relatesalso GenericStringRef\n\n    \\see GenericValue::GenericValue(StringRefType), GenericValue::operator=(StringRefType), GenericValue::SetString(StringRefType), GenericValue::PushBack(StringRefType, Allocator&), GenericValue::AddMember\n*/\ntemplate<typename CharType>\ninline GenericStringRef<CharType> StringRef(const CharType* str) {\n    return GenericStringRef<CharType>(str, internal::StrLen(str));\n}\n\n//! Mark a character pointer as constant string\n/*! Mark a plain character pointer as a \"string literal\".  This function\n    can be used to avoid copying a character string to be referenced as a\n    value in a JSON GenericValue object, if the string's lifetime is known\n    to be valid long enough.\n\n    This version has better performance with supplied length, and also\n    supports string containing null characters.\n\n    \\tparam CharType character type of the string\n    \\param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue\n    \\param length The length of source string.\n    \\return GenericStringRef string reference object\n    \\relatesalso GenericStringRef\n*/\ntemplate<typename CharType>\ninline GenericStringRef<CharType> StringRef(const CharType* str, size_t length) {\n    return GenericStringRef<CharType>(str, SizeType(length));\n}\n\n#if RAPIDJSON_HAS_STDSTRING\n//! Mark a string object as constant string\n/*! Mark a string object (e.g. \\c std::string) as a \"string literal\".\n    This function can be used to avoid copying a string to be referenced as a\n    value in a JSON GenericValue object, if the string's lifetime is known\n    to be valid long enough.\n\n    \\tparam CharType character type of the string\n    \\param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue\n    \\return GenericStringRef string reference object\n    \\relatesalso GenericStringRef\n    \\note Requires the definition of the preprocessor symbol \\ref RAPIDJSON_HAS_STDSTRING.\n*/\ntemplate<typename CharType>\ninline GenericStringRef<CharType> StringRef(const std::basic_string<CharType>& str) {\n    return GenericStringRef<CharType>(str.data(), SizeType(str.size()));\n}\n#endif\n\n///////////////////////////////////////////////////////////////////////////////\n// GenericValue type traits\nnamespace internal {\n\ntemplate <typename T, typename Encoding = void, typename Allocator = void>\nstruct IsGenericValueImpl : FalseType {};\n\n// select candidates according to nested encoding and allocator types\ntemplate <typename T> struct IsGenericValueImpl<T, typename Void<typename T::EncodingType>::Type, typename Void<typename T::AllocatorType>::Type>\n    : IsBaseOf<GenericValue<typename T::EncodingType, typename T::AllocatorType>, T>::Type {};\n\n// helper to match arbitrary GenericValue instantiations, including derived classes\ntemplate <typename T> struct IsGenericValue : IsGenericValueImpl<T>::Type {};\n\n} // namespace internal\n\n///////////////////////////////////////////////////////////////////////////////\n// GenericValue\n\n//! Represents a JSON value. Use Value for UTF8 encoding and default allocator.\n/*!\n    A JSON value can be one of 7 types. This class is a variant type supporting\n    these types.\n\n    Use the Value if UTF8 and default allocator\n\n    \\tparam Encoding    Encoding of the value. (Even non-string values need to have the same encoding in a document)\n    \\tparam Allocator   Allocator type for allocating memory of object, array and string.\n*/\ntemplate <typename Encoding, typename Allocator = MemoryPoolAllocator<> > \nclass GenericValue {\npublic:\n    //! Name-value pair in an object.\n    typedef GenericMember<Encoding, Allocator> Member;\n    typedef Encoding EncodingType;                  //!< Encoding type from template parameter.\n    typedef Allocator AllocatorType;                //!< Allocator type from template parameter.\n    typedef typename Encoding::Ch Ch;               //!< Character type derived from Encoding.\n    typedef GenericStringRef<Ch> StringRefType;     //!< Reference to a constant string\n    typedef typename GenericMemberIterator<false,Encoding,Allocator>::Iterator MemberIterator;  //!< Member iterator for iterating in object.\n    typedef typename GenericMemberIterator<true,Encoding,Allocator>::Iterator ConstMemberIterator;  //!< Constant member iterator for iterating in object.\n    typedef GenericValue* ValueIterator;            //!< Value iterator for iterating in array.\n    typedef const GenericValue* ConstValueIterator; //!< Constant value iterator for iterating in array.\n\n    //!@name Constructors and destructor.\n    //@{\n\n    //! Default constructor creates a null value.\n    GenericValue() RAPIDJSON_NOEXCEPT : data_(), flags_(kNullFlag) {}\n\n#if RAPIDJSON_HAS_CXX11_RVALUE_REFS\n    //! Move constructor in C++11\n    GenericValue(GenericValue&& rhs) RAPIDJSON_NOEXCEPT : data_(rhs.data_), flags_(rhs.flags_) {\n        rhs.flags_ = kNullFlag; // give up contents\n    }\n#endif\n\nprivate:\n    //! Copy constructor is not permitted.\n    GenericValue(const GenericValue& rhs);\n\npublic:\n\n    //! Constructor with JSON value type.\n    /*! This creates a Value of specified type with default content.\n        \\param type Type of the value.\n        \\note Default content for number is zero.\n    */\n    GenericValue(Type type) RAPIDJSON_NOEXCEPT : data_(), flags_() {\n        static const unsigned defaultFlags[7] = {\n            kNullFlag, kFalseFlag, kTrueFlag, kObjectFlag, kArrayFlag, kConstStringFlag,\n            kNumberAnyFlag\n        };\n        RAPIDJSON_ASSERT(type <= kNumberType);\n        flags_ = defaultFlags[type];\n    }\n\n    //! Explicit copy constructor (with allocator)\n    /*! Creates a copy of a Value by using the given Allocator\n        \\tparam SourceAllocator allocator of \\c rhs\n        \\param rhs Value to copy from (read-only)\n        \\param allocator Allocator for allocating copied elements and buffers. Commonly use GenericDocument::GetAllocator().\n        \\see CopyFrom()\n    */\n    template< typename SourceAllocator >\n    GenericValue(const GenericValue<Encoding, SourceAllocator>& rhs, Allocator & allocator);\n\n    //! Constructor for boolean value.\n    /*! \\param b Boolean value\n        \\note This constructor is limited to \\em real boolean values and rejects\n            implicitly converted types like arbitrary pointers.  Use an explicit cast\n            to \\c bool, if you want to construct a boolean JSON value in such cases.\n     */\n#ifndef RAPIDJSON_DOXYGEN_RUNNING // hide SFINAE from Doxygen\n    template <typename T>\n    explicit GenericValue(T b, RAPIDJSON_ENABLEIF((internal::IsSame<T,bool>))) RAPIDJSON_NOEXCEPT\n#else\n    explicit GenericValue(bool b) RAPIDJSON_NOEXCEPT\n#endif\n        : data_(), flags_(b ? kTrueFlag : kFalseFlag) {\n            // safe-guard against failing SFINAE\n            RAPIDJSON_STATIC_ASSERT((internal::IsSame<bool,T>::Value));\n    }\n\n    //! Constructor for int value.\n    explicit GenericValue(int i) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberIntFlag) {\n        data_.n.i64 = i;\n        if (i >= 0)\n            flags_ |= kUintFlag | kUint64Flag;\n    }\n\n    //! Constructor for unsigned value.\n    explicit GenericValue(unsigned u) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberUintFlag) {\n        data_.n.u64 = u; \n        if (!(u & 0x80000000))\n            flags_ |= kIntFlag | kInt64Flag;\n    }\n\n    //! Constructor for int64_t value.\n    explicit GenericValue(int64_t i64) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberInt64Flag) {\n        data_.n.i64 = i64;\n        if (i64 >= 0) {\n            flags_ |= kNumberUint64Flag;\n            if (!(static_cast<uint64_t>(i64) & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000)))\n                flags_ |= kUintFlag;\n            if (!(static_cast<uint64_t>(i64) & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000)))\n                flags_ |= kIntFlag;\n        }\n        else if (i64 >= static_cast<int64_t>(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000)))\n            flags_ |= kIntFlag;\n    }\n\n    //! Constructor for uint64_t value.\n    explicit GenericValue(uint64_t u64) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberUint64Flag) {\n        data_.n.u64 = u64;\n        if (!(u64 & RAPIDJSON_UINT64_C2(0x80000000, 0x00000000)))\n            flags_ |= kInt64Flag;\n        if (!(u64 & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000)))\n            flags_ |= kUintFlag;\n        if (!(u64 & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000)))\n            flags_ |= kIntFlag;\n    }\n\n    //! Constructor for double value.\n    explicit GenericValue(double d) RAPIDJSON_NOEXCEPT : data_(), flags_(kNumberDoubleFlag) { data_.n.d = d; }\n\n    //! Constructor for constant string (i.e. do not make a copy of string)\n    GenericValue(const Ch* s, SizeType length) RAPIDJSON_NOEXCEPT : data_(), flags_() { SetStringRaw(StringRef(s, length)); }\n\n    //! Constructor for constant string (i.e. do not make a copy of string)\n    explicit GenericValue(StringRefType s) RAPIDJSON_NOEXCEPT : data_(), flags_() { SetStringRaw(s); }\n\n    //! Constructor for copy-string (i.e. do make a copy of string)\n    GenericValue(const Ch* s, SizeType length, Allocator& allocator) : data_(), flags_() { SetStringRaw(StringRef(s, length), allocator); }\n\n    //! Constructor for copy-string (i.e. do make a copy of string)\n    GenericValue(const Ch*s, Allocator& allocator) : data_(), flags_() { SetStringRaw(StringRef(s), allocator); }\n\n#if RAPIDJSON_HAS_STDSTRING\n    //! Constructor for copy-string from a string object (i.e. do make a copy of string)\n    /*! \\note Requires the definition of the preprocessor symbol \\ref RAPIDJSON_HAS_STDSTRING.\n     */\n    GenericValue(const std::basic_string<Ch>& s, Allocator& allocator) : data_(), flags_() { SetStringRaw(StringRef(s), allocator); }\n#endif\n\n    //! Destructor.\n    /*! Need to destruct elements of array, members of object, or copy-string.\n    */\n    ~GenericValue() {\n        if (Allocator::kNeedFree) { // Shortcut by Allocator's trait\n            switch(flags_) {\n            case kArrayFlag:\n                for (GenericValue* v = data_.a.elements; v != data_.a.elements + data_.a.size; ++v)\n                    v->~GenericValue();\n                Allocator::Free(data_.a.elements);\n                break;\n\n            case kObjectFlag:\n                for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m)\n                    m->~Member();\n                Allocator::Free(data_.o.members);\n                break;\n\n            case kCopyStringFlag:\n                Allocator::Free(const_cast<Ch*>(data_.s.str));\n                break;\n\n            default:\n                break;  // Do nothing for other types.\n            }\n        }\n    }\n\n    //@}\n\n    //!@name Assignment operators\n    //@{\n\n    //! Assignment with move semantics.\n    /*! \\param rhs Source of the assignment. It will become a null value after assignment.\n    */\n    GenericValue& operator=(GenericValue& rhs) RAPIDJSON_NOEXCEPT {\n        RAPIDJSON_ASSERT(this != &rhs);\n        this->~GenericValue();\n        RawAssign(rhs);\n        return *this;\n    }\n\n#if RAPIDJSON_HAS_CXX11_RVALUE_REFS\n    //! Move assignment in C++11\n    GenericValue& operator=(GenericValue&& rhs) RAPIDJSON_NOEXCEPT {\n        return *this = rhs.Move();\n    }\n#endif\n\n    //! Assignment of constant string reference (no copy)\n    /*! \\param str Constant string reference to be assigned\n        \\note This overload is needed to avoid clashes with the generic primitive type assignment overload below.\n        \\see GenericStringRef, operator=(T)\n    */\n    GenericValue& operator=(StringRefType str) RAPIDJSON_NOEXCEPT {\n        GenericValue s(str);\n        return *this = s;\n    }\n\n    //! Assignment with primitive types.\n    /*! \\tparam T Either \\ref Type, \\c int, \\c unsigned, \\c int64_t, \\c uint64_t\n        \\param value The value to be assigned.\n\n        \\note The source type \\c T explicitly disallows all pointer types,\n            especially (\\c const) \\ref Ch*.  This helps avoiding implicitly\n            referencing character strings with insufficient lifetime, use\n            \\ref SetString(const Ch*, Allocator&) (for copying) or\n            \\ref StringRef() (to explicitly mark the pointer as constant) instead.\n            All other pointer types would implicitly convert to \\c bool,\n            use \\ref SetBool() instead.\n    */\n    template <typename T>\n    RAPIDJSON_DISABLEIF_RETURN((internal::IsPointer<T>), (GenericValue&))\n    operator=(T value) {\n        GenericValue v(value);\n        return *this = v;\n    }\n\n    //! Deep-copy assignment from Value\n    /*! Assigns a \\b copy of the Value to the current Value object\n        \\tparam SourceAllocator Allocator type of \\c rhs\n        \\param rhs Value to copy from (read-only)\n        \\param allocator Allocator to use for copying\n     */\n    template <typename SourceAllocator>\n    GenericValue& CopyFrom(const GenericValue<Encoding, SourceAllocator>& rhs, Allocator& allocator) {\n        RAPIDJSON_ASSERT((void*)this != (void const*)&rhs);\n        this->~GenericValue();\n        new (this) GenericValue(rhs, allocator);\n        return *this;\n    }\n\n    //! Exchange the contents of this value with those of other.\n    /*!\n        \\param other Another value.\n        \\note Constant complexity.\n    */\n    GenericValue& Swap(GenericValue& other) RAPIDJSON_NOEXCEPT {\n        GenericValue temp;\n        temp.RawAssign(*this);\n        RawAssign(other);\n        other.RawAssign(temp);\n        return *this;\n    }\n\n    //! Prepare Value for move semantics\n    /*! \\return *this */\n    GenericValue& Move() RAPIDJSON_NOEXCEPT { return *this; }\n    //@}\n\n    //!@name Equal-to and not-equal-to operators\n    //@{\n    //! Equal-to operator\n    /*!\n        \\note If an object contains duplicated named member, comparing equality with any object is always \\c false.\n        \\note Linear time complexity (number of all values in the subtree and total lengths of all strings).\n    */\n    template <typename SourceAllocator>\n    bool operator==(const GenericValue<Encoding, SourceAllocator>& rhs) const {\n        typedef GenericValue<Encoding, SourceAllocator> RhsType;\n        if (GetType() != rhs.GetType())\n            return false;\n\n        switch (GetType()) {\n        case kObjectType: // Warning: O(n^2) inner-loop\n            if (data_.o.size != rhs.data_.o.size)\n                return false;           \n            for (ConstMemberIterator lhsMemberItr = MemberBegin(); lhsMemberItr != MemberEnd(); ++lhsMemberItr) {\n                typename RhsType::ConstMemberIterator rhsMemberItr = rhs.FindMember(lhsMemberItr->name);\n                if (rhsMemberItr == rhs.MemberEnd() || lhsMemberItr->value != rhsMemberItr->value)\n                    return false;\n            }\n            return true;\n            \n        case kArrayType:\n            if (data_.a.size != rhs.data_.a.size)\n                return false;\n            for (SizeType i = 0; i < data_.a.size; i++)\n                if ((*this)[i] != rhs[i])\n                    return false;\n            return true;\n\n        case kStringType:\n            return StringEqual(rhs);\n\n        case kNumberType:\n            if (IsDouble() || rhs.IsDouble())\n                return GetDouble() == rhs.GetDouble(); // May convert one operand from integer to double.\n            else\n                return data_.n.u64 == rhs.data_.n.u64;\n\n        default: // kTrueType, kFalseType, kNullType\n            return true;\n        }\n    }\n\n    //! Equal-to operator with const C-string pointer\n    bool operator==(const Ch* rhs) const { return *this == GenericValue(StringRef(rhs)); }\n\n#if RAPIDJSON_HAS_STDSTRING\n    //! Equal-to operator with string object\n    /*! \\note Requires the definition of the preprocessor symbol \\ref RAPIDJSON_HAS_STDSTRING.\n     */\n    bool operator==(const std::basic_string<Ch>& rhs) const { return *this == GenericValue(StringRef(rhs)); }\n#endif\n\n    //! Equal-to operator with primitive types\n    /*! \\tparam T Either \\ref Type, \\c int, \\c unsigned, \\c int64_t, \\c uint64_t, \\c double, \\c true, \\c false\n    */\n    template <typename T> RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>,internal::IsGenericValue<T> >), (bool)) operator==(const T& rhs) const { return *this == GenericValue(rhs); }\n\n    //! Not-equal-to operator\n    /*! \\return !(*this == rhs)\n     */\n    template <typename SourceAllocator>\n    bool operator!=(const GenericValue<Encoding, SourceAllocator>& rhs) const { return !(*this == rhs); }\n\n    //! Not-equal-to operator with const C-string pointer\n    bool operator!=(const Ch* rhs) const { return !(*this == rhs); }\n\n    //! Not-equal-to operator with arbitrary types\n    /*! \\return !(*this == rhs)\n     */\n    template <typename T> RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue<T>), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); }\n\n    //! Equal-to operator with arbitrary types (symmetric version)\n    /*! \\return (rhs == lhs)\n     */\n    template <typename T> friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue<T>), (bool)) operator==(const T& lhs, const GenericValue& rhs) { return rhs == lhs; }\n\n    //! Not-Equal-to operator with arbitrary types (symmetric version)\n    /*! \\return !(rhs == lhs)\n     */\n    template <typename T> friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue<T>), (bool)) operator!=(const T& lhs, const GenericValue& rhs) { return !(rhs == lhs); }\n    //@}\n\n    //!@name Type\n    //@{\n\n    Type GetType()  const { return static_cast<Type>(flags_ & kTypeMask); }\n    bool IsNull()   const { return flags_ == kNullFlag; }\n    bool IsFalse()  const { return flags_ == kFalseFlag; }\n    bool IsTrue()   const { return flags_ == kTrueFlag; }\n    bool IsBool()   const { return (flags_ & kBoolFlag) != 0; }\n    bool IsObject() const { return flags_ == kObjectFlag; }\n    bool IsArray()  const { return flags_ == kArrayFlag; }\n    bool IsNumber() const { return (flags_ & kNumberFlag) != 0; }\n    bool IsInt()    const { return (flags_ & kIntFlag) != 0; }\n    bool IsUint()   const { return (flags_ & kUintFlag) != 0; }\n    bool IsInt64()  const { return (flags_ & kInt64Flag) != 0; }\n    bool IsUint64() const { return (flags_ & kUint64Flag) != 0; }\n    bool IsDouble() const { return (flags_ & kDoubleFlag) != 0; }\n    bool IsString() const { return (flags_ & kStringFlag) != 0; }\n\n    //@}\n\n    //!@name Null\n    //@{\n\n    GenericValue& SetNull() { this->~GenericValue(); new (this) GenericValue(); return *this; }\n\n    //@}\n\n    //!@name Bool\n    //@{\n\n    bool GetBool() const { RAPIDJSON_ASSERT(IsBool()); return flags_ == kTrueFlag; }\n    //!< Set boolean value\n    /*! \\post IsBool() == true */\n    GenericValue& SetBool(bool b) { this->~GenericValue(); new (this) GenericValue(b); return *this; }\n\n    //@}\n\n    //!@name Object\n    //@{\n\n    //! Set this value as an empty object.\n    /*! \\post IsObject() == true */\n    GenericValue& SetObject() { this->~GenericValue(); new (this) GenericValue(kObjectType); return *this; }\n\n    //! Get the number of members in the object.\n    SizeType MemberCount() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size; }\n\n    //! Check whether the object is empty.\n    bool ObjectEmpty() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size == 0; }\n\n    //! Get the value associated with the name.\n    /*!\n        \\note In version 0.1x, if the member is not found, this function returns a null value. This makes issue 7.\n        Since 0.2, if the name is not correct, it will assert.\n        If user is unsure whether a member exists, user should use HasMember() first.\n        A better approach is to use FindMember().\n        \\note Linear time complexity.\n    */\n    GenericValue& operator[](const Ch* name) {\n        GenericValue n(StringRef(name));\n        return (*this)[n];\n    }\n    const GenericValue& operator[](const Ch* name) const { return const_cast<GenericValue&>(*this)[name]; }\n\n    // This version is faster because it does not need a StrLen(). \n    // It can also handle string with null character.\n    template <typename SourceAllocator>\n    GenericValue& operator[](const GenericValue<Encoding, SourceAllocator>& name) {\n        MemberIterator member = FindMember(name);\n        if (member != MemberEnd())\n            return member->value;\n        else {\n            RAPIDJSON_ASSERT(false);    // see above note\n            static GenericValue NullValue;\n            return NullValue;\n        }\n    }\n    template <typename SourceAllocator>\n    const GenericValue& operator[](const GenericValue<Encoding, SourceAllocator>& name) const { return const_cast<GenericValue&>(*this)[name]; }\n\n    //! Const member iterator\n    /*! \\pre IsObject() == true */\n    ConstMemberIterator MemberBegin() const { RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(data_.o.members); }\n    //! Const \\em past-the-end member iterator\n    /*! \\pre IsObject() == true */\n    ConstMemberIterator MemberEnd() const   { RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(data_.o.members + data_.o.size); }\n    //! Member iterator\n    /*! \\pre IsObject() == true */\n    MemberIterator MemberBegin()            { RAPIDJSON_ASSERT(IsObject()); return MemberIterator(data_.o.members); }\n    //! \\em Past-the-end member iterator\n    /*! \\pre IsObject() == true */\n    MemberIterator MemberEnd()              { RAPIDJSON_ASSERT(IsObject()); return MemberIterator(data_.o.members + data_.o.size); }\n\n    //! Check whether a member exists in the object.\n    /*!\n        \\param name Member name to be searched.\n        \\pre IsObject() == true\n        \\return Whether a member with that name exists.\n        \\note It is better to use FindMember() directly if you need the obtain the value as well.\n        \\note Linear time complexity.\n    */\n    bool HasMember(const Ch* name) const { return FindMember(name) != MemberEnd(); }\n\n    //! Check whether a member exists in the object with GenericValue name.\n    /*!\n        This version is faster because it does not need a StrLen(). It can also handle string with null character.\n        \\param name Member name to be searched.\n        \\pre IsObject() == true\n        \\return Whether a member with that name exists.\n        \\note It is better to use FindMember() directly if you need the obtain the value as well.\n        \\note Linear time complexity.\n    */\n    template <typename SourceAllocator>\n    bool HasMember(const GenericValue<Encoding, SourceAllocator>& name) const { return FindMember(name) != MemberEnd(); }\n\n    //! Find member by name.\n    /*!\n        \\param name Member name to be searched.\n        \\pre IsObject() == true\n        \\return Iterator to member, if it exists.\n            Otherwise returns \\ref MemberEnd().\n\n        \\note Earlier versions of Rapidjson returned a \\c NULL pointer, in case\n            the requested member doesn't exist. For consistency with e.g.\n            \\c std::map, this has been changed to MemberEnd() now.\n        \\note Linear time complexity.\n    */\n    MemberIterator FindMember(const Ch* name) {\n        GenericValue n(StringRef(name));\n        return FindMember(n);\n    }\n\n    ConstMemberIterator FindMember(const Ch* name) const { return const_cast<GenericValue&>(*this).FindMember(name); }\n\n    //! Find member by name.\n    /*!\n        This version is faster because it does not need a StrLen(). It can also handle string with null character.\n        \\param name Member name to be searched.\n        \\pre IsObject() == true\n        \\return Iterator to member, if it exists.\n            Otherwise returns \\ref MemberEnd().\n\n        \\note Earlier versions of Rapidjson returned a \\c NULL pointer, in case\n            the requested member doesn't exist. For consistency with e.g.\n            \\c std::map, this has been changed to MemberEnd() now.\n        \\note Linear time complexity.\n    */\n    template <typename SourceAllocator>\n    MemberIterator FindMember(const GenericValue<Encoding, SourceAllocator>& name) {\n        RAPIDJSON_ASSERT(IsObject());\n        RAPIDJSON_ASSERT(name.IsString());\n        MemberIterator member = MemberBegin();\n        for ( ; member != MemberEnd(); ++member)\n            if (name.StringEqual(member->name))\n                break;\n        return member;\n    }\n    template <typename SourceAllocator> ConstMemberIterator FindMember(const GenericValue<Encoding, SourceAllocator>& name) const { return const_cast<GenericValue&>(*this).FindMember(name); }\n\n    //! Add a member (name-value pair) to the object.\n    /*! \\param name A string value as name of member.\n        \\param value Value of any type.\n        \\param allocator    Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().\n        \\return The value itself for fluent API.\n        \\note The ownership of \\c name and \\c value will be transferred to this object on success.\n        \\pre  IsObject() && name.IsString()\n        \\post name.IsNull() && value.IsNull()\n        \\note Amortized Constant time complexity.\n    */\n    GenericValue& AddMember(GenericValue& name, GenericValue& value, Allocator& allocator) {\n        RAPIDJSON_ASSERT(IsObject());\n        RAPIDJSON_ASSERT(name.IsString());\n\n        Object& o = data_.o;\n        if (o.size >= o.capacity) {\n            if (o.capacity == 0) {\n                o.capacity = kDefaultObjectCapacity;\n                o.members = reinterpret_cast<Member*>(allocator.Malloc(o.capacity * sizeof(Member)));\n            }\n            else {\n                SizeType oldCapacity = o.capacity;\n                o.capacity += (oldCapacity + 1) / 2; // grow by factor 1.5\n                o.members = reinterpret_cast<Member*>(allocator.Realloc(o.members, oldCapacity * sizeof(Member), o.capacity * sizeof(Member)));\n            }\n        }\n        o.members[o.size].name.RawAssign(name);\n        o.members[o.size].value.RawAssign(value);\n        o.size++;\n        return *this;\n    }\n\n#if RAPIDJSON_HAS_CXX11_RVALUE_REFS\n    GenericValue& AddMember(GenericValue&& name, GenericValue&& value, Allocator& allocator) {\n        return AddMember(name, value, allocator);\n    }\n    GenericValue& AddMember(GenericValue&& name, GenericValue& value, Allocator& allocator) {\n        return AddMember(name, value, allocator);\n    }\n    GenericValue& AddMember(GenericValue& name, GenericValue&& value, Allocator& allocator) {\n        return AddMember(name, value, allocator);\n    }\n    GenericValue& AddMember(StringRefType name, GenericValue&& value, Allocator& allocator) {\n        GenericValue n(name);\n        return AddMember(n, value, allocator);\n    }\n#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS\n\n\n    //! Add a member (name-value pair) to the object.\n    /*! \\param name A constant string reference as name of member.\n        \\param value Value of any type.\n        \\param allocator    Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().\n        \\return The value itself for fluent API.\n        \\note The ownership of \\c value will be transferred to this object on success.\n        \\pre  IsObject()\n        \\post value.IsNull()\n        \\note Amortized Constant time complexity.\n    */\n    GenericValue& AddMember(StringRefType name, GenericValue& value, Allocator& allocator) {\n        GenericValue n(name);\n        return AddMember(n, value, allocator);\n    }\n\n    //! Add a constant string value as member (name-value pair) to the object.\n    /*! \\param name A constant string reference as name of member.\n        \\param value constant string reference as value of member.\n        \\param allocator    Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().\n        \\return The value itself for fluent API.\n        \\pre  IsObject()\n        \\note This overload is needed to avoid clashes with the generic primitive type AddMember(StringRefType,T,Allocator&) overload below.\n        \\note Amortized Constant time complexity.\n    */\n    GenericValue& AddMember(StringRefType name, StringRefType value, Allocator& allocator) {\n        GenericValue v(value);\n        return AddMember(name, v, allocator);\n    }\n\n    //! Add any primitive value as member (name-value pair) to the object.\n    /*! \\tparam T Either \\ref Type, \\c int, \\c unsigned, \\c int64_t, \\c uint64_t\n        \\param name A constant string reference as name of member.\n        \\param value Value of primitive type \\c T as value of member\n        \\param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator().\n        \\return The value itself for fluent API.\n        \\pre  IsObject()\n\n        \\note The source type \\c T explicitly disallows all pointer types,\n            especially (\\c const) \\ref Ch*.  This helps avoiding implicitly\n            referencing character strings with insufficient lifetime, use\n            \\ref AddMember(StringRefType, GenericValue&, Allocator&) or \\ref\n            AddMember(StringRefType, StringRefType, Allocator&).\n            All other pointer types would implicitly convert to \\c bool,\n            use an explicit cast instead, if needed.\n        \\note Amortized Constant time complexity.\n    */\n    template <typename T>\n    RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (GenericValue&))\n    AddMember(StringRefType name, T value, Allocator& allocator) {\n        GenericValue n(name);\n        GenericValue v(value);\n        return AddMember(n, v, allocator);\n    }\n\n    //! Remove all members in the object.\n    /*! This function do not deallocate memory in the object, i.e. the capacity is unchanged.\n        \\note Linear time complexity.\n    */\n    void RemoveAllMembers() {\n        RAPIDJSON_ASSERT(IsObject()); \n        for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m)\n            m->~Member();\n        data_.o.size = 0;\n    }\n\n    //! Remove a member in object by its name.\n    /*! \\param name Name of member to be removed.\n        \\return Whether the member existed.\n        \\note Removing member is implemented by moving the last member. So the ordering of members is changed.\n        \\note Linear time complexity.\n    */\n    bool RemoveMember(const Ch* name) {\n        GenericValue n(StringRef(name));\n        return RemoveMember(n);\n    }\n\n    template <typename SourceAllocator>\n    bool RemoveMember(const GenericValue<Encoding, SourceAllocator>& name) {\n        MemberIterator m = FindMember(name);\n        if (m != MemberEnd()) {\n            RemoveMember(m);\n            return true;\n        }\n        else\n            return false;\n    }\n\n    //! Remove a member in object by iterator.\n    /*! \\param m member iterator (obtained by FindMember() or MemberBegin()).\n        \\return the new iterator after removal.\n        \\note Removing member is implemented by moving the last member. So the ordering of members is changed.\n        \\note Use \\ref EraseMember(ConstMemberIterator) instead, if you need to rely on a stable member ordering.\n        \\note Constant time complexity.\n    */\n    MemberIterator RemoveMember(MemberIterator m) {\n        RAPIDJSON_ASSERT(IsObject());\n        RAPIDJSON_ASSERT(data_.o.size > 0);\n        RAPIDJSON_ASSERT(data_.o.members != 0);\n        RAPIDJSON_ASSERT(m >= MemberBegin() && m < MemberEnd());\n\n        MemberIterator last(data_.o.members + (data_.o.size - 1));\n        if (data_.o.size > 1 && m != last) {\n            // Move the last one to this place\n            *m = *last;\n        }\n        else {\n            // Only one left, just destroy\n            m->~Member();\n        }\n        --data_.o.size;\n        return m;\n    }\n\n    //! Remove a member from an object by iterator.\n    /*! \\param pos iterator to the member to remove\n        \\pre IsObject() == true && \\ref MemberBegin() <= \\c pos < \\ref MemberEnd()\n        \\return Iterator following the removed element.\n            If the iterator \\c pos refers to the last element, the \\ref MemberEnd() iterator is returned.\n        \\note Other than \\ref RemoveMember(MemberIterator), this function preserves the ordering of the members.\n        \\note Linear time complexity.\n    */\n    MemberIterator EraseMember(ConstMemberIterator pos) {\n        return EraseMember(pos, pos +1);\n    }\n\n    //! Remove members in the range [first, last) from an object.\n    /*! \\param first iterator to the first member to remove\n        \\param last  iterator following the last member to remove\n        \\pre IsObject() == true && \\ref MemberBegin() <= \\c first <= \\c last <= \\ref MemberEnd()\n        \\return Iterator following the last removed element.\n        \\note Other than \\ref RemoveMember(MemberIterator), this function preserves the ordering of the members.\n        \\note Linear time complexity.\n    */\n    MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) {\n        RAPIDJSON_ASSERT(IsObject());\n        RAPIDJSON_ASSERT(data_.o.size > 0);\n        RAPIDJSON_ASSERT(data_.o.members != 0);\n        RAPIDJSON_ASSERT(first >= MemberBegin());\n        RAPIDJSON_ASSERT(first <= last);\n        RAPIDJSON_ASSERT(last <= MemberEnd());\n\n        MemberIterator pos = MemberBegin() + (first - MemberBegin());\n        for (MemberIterator itr = pos; itr != last; ++itr)\n            itr->~Member();\n        std::memmove(&*pos, &*last, (MemberEnd() - last) * sizeof(Member));\n        data_.o.size -= (last - first);\n        return pos;\n    }\n\n    //@}\n\n    //!@name Array\n    //@{\n\n    //! Set this value as an empty array.\n    /*! \\post IsArray == true */\n    GenericValue& SetArray() {  this->~GenericValue(); new (this) GenericValue(kArrayType); return *this; }\n\n    //! Get the number of elements in array.\n    SizeType Size() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size; }\n\n    //! Get the capacity of array.\n    SizeType Capacity() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.capacity; }\n\n    //! Check whether the array is empty.\n    bool Empty() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size == 0; }\n\n    //! Remove all elements in the array.\n    /*! This function do not deallocate memory in the array, i.e. the capacity is unchanged.\n        \\note Linear time complexity.\n    */\n    void Clear() {\n        RAPIDJSON_ASSERT(IsArray()); \n        for (SizeType i = 0; i < data_.a.size; ++i)\n            data_.a.elements[i].~GenericValue();\n        data_.a.size = 0;\n    }\n\n    //! Get an element from array by index.\n    /*! \\param index Zero-based index of element.\n\\code\nValue a(kArrayType);\na.PushBack(123);\nint x = a[0].GetInt();              // Error: operator[ is ambiguous, as 0 also mean a null pointer of const char* type.\nint y = a[SizeType(0)].GetInt();    // Cast to SizeType will work.\nint z = a[0u].GetInt();             // This works too.\n\\endcode\n    */\n    GenericValue& operator[](SizeType index) {\n        RAPIDJSON_ASSERT(IsArray());\n        RAPIDJSON_ASSERT(index < data_.a.size);\n        return data_.a.elements[index];\n    }\n    const GenericValue& operator[](SizeType index) const { return const_cast<GenericValue&>(*this)[index]; }\n\n    //! Element iterator\n    /*! \\pre IsArray() == true */\n    ValueIterator Begin() { RAPIDJSON_ASSERT(IsArray()); return data_.a.elements; }\n    //! \\em Past-the-end element iterator\n    /*! \\pre IsArray() == true */\n    ValueIterator End() { RAPIDJSON_ASSERT(IsArray()); return data_.a.elements + data_.a.size; }\n    //! Constant element iterator\n    /*! \\pre IsArray() == true */\n    ConstValueIterator Begin() const { return const_cast<GenericValue&>(*this).Begin(); }\n    //! Constant \\em past-the-end element iterator\n    /*! \\pre IsArray() == true */\n    ConstValueIterator End() const { return const_cast<GenericValue&>(*this).End(); }\n\n    //! Request the array to have enough capacity to store elements.\n    /*! \\param newCapacity  The capacity that the array at least need to have.\n        \\param allocator    Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().\n        \\return The value itself for fluent API.\n        \\note Linear time complexity.\n    */\n    GenericValue& Reserve(SizeType newCapacity, Allocator &allocator) {\n        RAPIDJSON_ASSERT(IsArray());\n        if (newCapacity > data_.a.capacity) {\n            data_.a.elements = (GenericValue*)allocator.Realloc(data_.a.elements, data_.a.capacity * sizeof(GenericValue), newCapacity * sizeof(GenericValue));\n            data_.a.capacity = newCapacity;\n        }\n        return *this;\n    }\n\n    //! Append a GenericValue at the end of the array.\n    /*! \\param value        Value to be appended.\n        \\param allocator    Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().\n        \\pre IsArray() == true\n        \\post value.IsNull() == true\n        \\return The value itself for fluent API.\n        \\note The ownership of \\c value will be transferred to this array on success.\n        \\note If the number of elements to be appended is known, calls Reserve() once first may be more efficient.\n        \\note Amortized constant time complexity.\n    */\n    GenericValue& PushBack(GenericValue& value, Allocator& allocator) {\n        RAPIDJSON_ASSERT(IsArray());\n        if (data_.a.size >= data_.a.capacity)\n            Reserve(data_.a.capacity == 0 ? kDefaultArrayCapacity : (data_.a.capacity + (data_.a.capacity + 1) / 2), allocator);\n        data_.a.elements[data_.a.size++].RawAssign(value);\n        return *this;\n    }\n\n#if RAPIDJSON_HAS_CXX11_RVALUE_REFS\n    GenericValue& PushBack(GenericValue&& value, Allocator& allocator) {\n        return PushBack(value, allocator);\n    }\n#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS\n\n    //! Append a constant string reference at the end of the array.\n    /*! \\param value        Constant string reference to be appended.\n        \\param allocator    Allocator for reallocating memory. It must be the same one used previously. Commonly use GenericDocument::GetAllocator().\n        \\pre IsArray() == true\n        \\return The value itself for fluent API.\n        \\note If the number of elements to be appended is known, calls Reserve() once first may be more efficient.\n        \\note Amortized constant time complexity.\n        \\see GenericStringRef\n    */\n    GenericValue& PushBack(StringRefType value, Allocator& allocator) {\n        return (*this).template PushBack<StringRefType>(value, allocator);\n    }\n\n    //! Append a primitive value at the end of the array.\n    /*! \\tparam T Either \\ref Type, \\c int, \\c unsigned, \\c int64_t, \\c uint64_t\n        \\param value Value of primitive type T to be appended.\n        \\param allocator    Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().\n        \\pre IsArray() == true\n        \\return The value itself for fluent API.\n        \\note If the number of elements to be appended is known, calls Reserve() once first may be more efficient.\n\n        \\note The source type \\c T explicitly disallows all pointer types,\n            especially (\\c const) \\ref Ch*.  This helps avoiding implicitly\n            referencing character strings with insufficient lifetime, use\n            \\ref PushBack(GenericValue&, Allocator&) or \\ref\n            PushBack(StringRefType, Allocator&).\n            All other pointer types would implicitly convert to \\c bool,\n            use an explicit cast instead, if needed.\n        \\note Amortized constant time complexity.\n    */\n    template <typename T>\n    RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (GenericValue&))\n    PushBack(T value, Allocator& allocator) {\n        GenericValue v(value);\n        return PushBack(v, allocator);\n    }\n\n    //! Remove the last element in the array.\n    /*!\n        \\note Constant time complexity.\n    */\n    GenericValue& PopBack() {\n        RAPIDJSON_ASSERT(IsArray());\n        RAPIDJSON_ASSERT(!Empty());\n        data_.a.elements[--data_.a.size].~GenericValue();\n        return *this;\n    }\n\n    //! Remove an element of array by iterator.\n    /*!\n        \\param pos iterator to the element to remove\n        \\pre IsArray() == true && \\ref Begin() <= \\c pos < \\ref End()\n        \\return Iterator following the removed element. If the iterator pos refers to the last element, the End() iterator is returned.\n        \\note Linear time complexity.\n    */\n    ValueIterator Erase(ConstValueIterator pos) {\n        return Erase(pos, pos + 1);\n    }\n\n    //! Remove elements in the range [first, last) of the array.\n    /*!\n        \\param first iterator to the first element to remove\n        \\param last  iterator following the last element to remove\n        \\pre IsArray() == true && \\ref Begin() <= \\c first <= \\c last <= \\ref End()\n        \\return Iterator following the last removed element.\n        \\note Linear time complexity.\n    */\n    ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) {\n        RAPIDJSON_ASSERT(IsArray());\n        RAPIDJSON_ASSERT(data_.a.size > 0);\n        RAPIDJSON_ASSERT(data_.a.elements != 0);\n        RAPIDJSON_ASSERT(first >= Begin());\n        RAPIDJSON_ASSERT(first <= last);\n        RAPIDJSON_ASSERT(last <= End());\n        ValueIterator pos = Begin() + (first - Begin());\n        for (ValueIterator itr = pos; itr != last; ++itr)\n            itr->~GenericValue();       \n        std::memmove(pos, last, (End() - last) * sizeof(GenericValue));\n        data_.a.size -= (last - first);\n        return pos;\n    }\n\n    //@}\n\n    //!@name Number\n    //@{\n\n    int GetInt() const          { RAPIDJSON_ASSERT(flags_ & kIntFlag);   return data_.n.i.i;   }\n    unsigned GetUint() const    { RAPIDJSON_ASSERT(flags_ & kUintFlag);  return data_.n.u.u;   }\n    int64_t GetInt64() const    { RAPIDJSON_ASSERT(flags_ & kInt64Flag); return data_.n.i64; }\n    uint64_t GetUint64() const  { RAPIDJSON_ASSERT(flags_ & kUint64Flag); return data_.n.u64; }\n\n    double GetDouble() const {\n        RAPIDJSON_ASSERT(IsNumber());\n        if ((flags_ & kDoubleFlag) != 0)                return data_.n.d;   // exact type, no conversion.\n        if ((flags_ & kIntFlag) != 0)                   return data_.n.i.i; // int -> double\n        if ((flags_ & kUintFlag) != 0)                  return data_.n.u.u; // unsigned -> double\n        if ((flags_ & kInt64Flag) != 0)                 return (double)data_.n.i64; // int64_t -> double (may lose precision)\n        RAPIDJSON_ASSERT((flags_ & kUint64Flag) != 0);  return (double)data_.n.u64; // uint64_t -> double (may lose precision)\n    }\n\n    GenericValue& SetInt(int i)             { this->~GenericValue(); new (this) GenericValue(i);    return *this; }\n    GenericValue& SetUint(unsigned u)       { this->~GenericValue(); new (this) GenericValue(u);    return *this; }\n    GenericValue& SetInt64(int64_t i64)     { this->~GenericValue(); new (this) GenericValue(i64);  return *this; }\n    GenericValue& SetUint64(uint64_t u64)   { this->~GenericValue(); new (this) GenericValue(u64);  return *this; }\n    GenericValue& SetDouble(double d)       { this->~GenericValue(); new (this) GenericValue(d);    return *this; }\n\n    //@}\n\n    //!@name String\n    //@{\n\n    const Ch* GetString() const { RAPIDJSON_ASSERT(IsString()); return ((flags_ & kInlineStrFlag) ? data_.ss.str : data_.s.str); }\n\n    //! Get the length of string.\n    /*! Since rapidjson permits \"\\\\u0000\" in the json string, strlen(v.GetString()) may not equal to v.GetStringLength().\n    */\n    SizeType GetStringLength() const { RAPIDJSON_ASSERT(IsString()); return ((flags_ & kInlineStrFlag) ? (data_.ss.GetLength()) : data_.s.length); }\n\n    //! Set this value as a string without copying source string.\n    /*! This version has better performance with supplied length, and also support string containing null character.\n        \\param s source string pointer. \n        \\param length The length of source string, excluding the trailing null terminator.\n        \\return The value itself for fluent API.\n        \\post IsString() == true && GetString() == s && GetStringLength() == length\n        \\see SetString(StringRefType)\n    */\n    GenericValue& SetString(const Ch* s, SizeType length) { return SetString(StringRef(s, length)); }\n\n    //! Set this value as a string without copying source string.\n    /*! \\param s source string reference\n        \\return The value itself for fluent API.\n        \\post IsString() == true && GetString() == s && GetStringLength() == s.length\n    */\n    GenericValue& SetString(StringRefType s) { this->~GenericValue(); SetStringRaw(s); return *this; }\n\n    //! Set this value as a string by copying from source string.\n    /*! This version has better performance with supplied length, and also support string containing null character.\n        \\param s source string. \n        \\param length The length of source string, excluding the trailing null terminator.\n        \\param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator().\n        \\return The value itself for fluent API.\n        \\post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length\n    */\n    GenericValue& SetString(const Ch* s, SizeType length, Allocator& allocator) { this->~GenericValue(); SetStringRaw(StringRef(s, length), allocator); return *this; }\n\n    //! Set this value as a string by copying from source string.\n    /*! \\param s source string. \n        \\param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator().\n        \\return The value itself for fluent API.\n        \\post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length\n    */\n    GenericValue& SetString(const Ch* s, Allocator& allocator) { return SetString(s, internal::StrLen(s), allocator); }\n\n#if RAPIDJSON_HAS_STDSTRING\n    //! Set this value as a string by copying from source string.\n    /*! \\param s source string.\n        \\param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator().\n        \\return The value itself for fluent API.\n        \\post IsString() == true && GetString() != s.data() && strcmp(GetString(),s.data() == 0 && GetStringLength() == s.size()\n        \\note Requires the definition of the preprocessor symbol \\ref RAPIDJSON_HAS_STDSTRING.\n    */\n    GenericValue& SetString(const std::basic_string<Ch>& s, Allocator& allocator) { return SetString(s.data(), s.size(), allocator); }\n#endif\n\n    //@}\n\n    //! Generate events of this value to a Handler.\n    /*! This function adopts the GoF visitor pattern.\n        Typical usage is to output this JSON value as JSON text via Writer, which is a Handler.\n        It can also be used to deep clone this value via GenericDocument, which is also a Handler.\n        \\tparam Handler type of handler.\n        \\param handler An object implementing concept Handler.\n    */\n    template <typename Handler>\n    bool Accept(Handler& handler) const {\n        switch(GetType()) {\n        case kNullType:     return handler.Null();\n        case kFalseType:    return handler.Bool(false);\n        case kTrueType:     return handler.Bool(true);\n\n        case kObjectType:\n            if (!handler.StartObject())\n                return false;\n            for (ConstMemberIterator m = MemberBegin(); m != MemberEnd(); ++m) {\n                if (!handler.Key(m->name.GetString(), m->name.GetStringLength(), (m->name.flags_ & kCopyFlag) != 0))\n                    return false;\n                if (!m->value.Accept(handler))\n                    return false;\n            }\n            return handler.EndObject(data_.o.size);\n\n        case kArrayType:\n            if (!handler.StartArray())\n                return false;\n            for (GenericValue* v = data_.a.elements; v != data_.a.elements + data_.a.size; ++v)\n                if (!v->Accept(handler))\n                    return false;\n            return handler.EndArray(data_.a.size);\n    \n        case kStringType:\n            return handler.String(GetString(), GetStringLength(), (flags_ & kCopyFlag) != 0);\n    \n        case kNumberType:\n            if (IsInt())            return handler.Int(data_.n.i.i);\n            else if (IsUint())      return handler.Uint(data_.n.u.u);\n            else if (IsInt64())     return handler.Int64(data_.n.i64);\n            else if (IsUint64())    return handler.Uint64(data_.n.u64);\n            else                    return handler.Double(data_.n.d);\n    \n        default:\n            RAPIDJSON_ASSERT(false);\n        }\n        return false;\n    }\n\nprivate:\n    template <typename, typename> friend class GenericValue;\n    template <typename, typename, typename> friend class GenericDocument;\n\n    enum {\n        kBoolFlag = 0x100,\n        kNumberFlag = 0x200,\n        kIntFlag = 0x400,\n        kUintFlag = 0x800,\n        kInt64Flag = 0x1000,\n        kUint64Flag = 0x2000,\n        kDoubleFlag = 0x4000,\n        kStringFlag = 0x100000,\n        kCopyFlag = 0x200000,\n        kInlineStrFlag = 0x400000,\n\n        // Initial flags of different types.\n        kNullFlag = kNullType,\n        kTrueFlag = kTrueType | kBoolFlag,\n        kFalseFlag = kFalseType | kBoolFlag,\n        kNumberIntFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag,\n        kNumberUintFlag = kNumberType | kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag,\n        kNumberInt64Flag = kNumberType | kNumberFlag | kInt64Flag,\n        kNumberUint64Flag = kNumberType | kNumberFlag | kUint64Flag,\n        kNumberDoubleFlag = kNumberType | kNumberFlag | kDoubleFlag,\n        kNumberAnyFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag,\n        kConstStringFlag = kStringType | kStringFlag,\n        kCopyStringFlag = kStringType | kStringFlag | kCopyFlag,\n        kShortStringFlag = kStringType | kStringFlag | kCopyFlag | kInlineStrFlag,\n        kObjectFlag = kObjectType,\n        kArrayFlag = kArrayType,\n\n        kTypeMask = 0xFF    // bitwise-and with mask of 0xFF can be optimized by compiler\n    };\n\n    static const SizeType kDefaultArrayCapacity = 16;\n    static const SizeType kDefaultObjectCapacity = 16;\n\n    struct String {\n        const Ch* str;\n        SizeType length;\n        unsigned hashcode;  //!< reserved\n    };  // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode\n\n    // implementation detail: ShortString can represent zero-terminated strings up to MaxSize chars\n    // (excluding the terminating zero) and store a value to determine the length of the contained\n    // string in the last character str[LenPos] by storing \"MaxSize - length\" there. If the string\n    // to store has the maximal length of MaxSize then str[LenPos] will be 0 and therefore act as\n    // the string terminator as well. For getting the string length back from that value just use\n    // \"MaxSize - str[LenPos]\".\n    // This allows to store 11-chars strings in 32-bit mode and 15-chars strings in 64-bit mode\n    // inline (for `UTF8`-encoded strings).\n    struct ShortString {\n        enum { MaxChars = sizeof(String) / sizeof(Ch), MaxSize = MaxChars - 1, LenPos = MaxSize };\n        Ch str[MaxChars];\n\n        inline static bool Usable(SizeType len) { return            (MaxSize >= len); }\n        inline void     SetLength(SizeType len) { str[LenPos] = (Ch)(MaxSize -  len); }\n        inline SizeType GetLength() const       { return  (SizeType)(MaxSize -  str[LenPos]); }\n    };  // at most as many bytes as \"String\" above => 12 bytes in 32-bit mode, 16 bytes in 64-bit mode\n\n    // By using proper binary layout, retrieval of different integer types do not need conversions.\n    union Number {\n#if RAPIDJSON_ENDIAN == RAPIDJSON_LITTLEENDIAN\n        struct I {\n            int i;\n            char padding[4];\n        }i;\n        struct U {\n            unsigned u;\n            char padding2[4];\n        }u;\n#else\n        struct I {\n            char padding[4];\n            int i;\n        }i;\n        struct U {\n            char padding2[4];\n            unsigned u;\n        }u;\n#endif\n        int64_t i64;\n        uint64_t u64;\n        double d;\n    };  // 8 bytes\n\n    struct Object {\n        Member* members;\n        SizeType size;\n        SizeType capacity;\n    };  // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode\n\n    struct Array {\n        GenericValue* elements;\n        SizeType size;\n        SizeType capacity;\n    };  // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode\n\n    union Data {\n        String s;\n        ShortString ss;\n        Number n;\n        Object o;\n        Array a;\n    };  // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode\n\n    // Initialize this value as array with initial data, without calling destructor.\n    void SetArrayRaw(GenericValue* values, SizeType count, Allocator& allocator) {\n        flags_ = kArrayFlag;\n        data_.a.elements = (GenericValue*)allocator.Malloc(count * sizeof(GenericValue));\n        std::memcpy(data_.a.elements, values, count * sizeof(GenericValue));\n        data_.a.size = data_.a.capacity = count;\n    }\n\n    //! Initialize this value as object with initial data, without calling destructor.\n    void SetObjectRaw(Member* members, SizeType count, Allocator& allocator) {\n        flags_ = kObjectFlag;\n        data_.o.members = (Member*)allocator.Malloc(count * sizeof(Member));\n        std::memcpy(data_.o.members, members, count * sizeof(Member));\n        data_.o.size = data_.o.capacity = count;\n    }\n\n    //! Initialize this value as constant string, without calling destructor.\n    void SetStringRaw(StringRefType s) RAPIDJSON_NOEXCEPT {\n        flags_ = kConstStringFlag;\n        data_.s.str = s;\n        data_.s.length = s.length;\n    }\n\n    //! Initialize this value as copy string with initial data, without calling destructor.\n    void SetStringRaw(StringRefType s, Allocator& allocator) {\n        Ch* str = NULL;\n        if(ShortString::Usable(s.length)) {\n            flags_ = kShortStringFlag;\n            data_.ss.SetLength(s.length);\n            str = data_.ss.str;\n        } else {\n            flags_ = kCopyStringFlag;\n            data_.s.length = s.length;\n            str = (Ch *)allocator.Malloc((s.length + 1) * sizeof(Ch));\n            data_.s.str = str;\n        }\n        std::memcpy(str, s, s.length * sizeof(Ch));\n        str[s.length] = '\\0';\n    }\n\n    //! Assignment without calling destructor\n    void RawAssign(GenericValue& rhs) RAPIDJSON_NOEXCEPT {\n        data_ = rhs.data_;\n        flags_ = rhs.flags_;\n        rhs.flags_ = kNullFlag;\n    }\n\n    template <typename SourceAllocator>\n    bool StringEqual(const GenericValue<Encoding, SourceAllocator>& rhs) const {\n        RAPIDJSON_ASSERT(IsString());\n        RAPIDJSON_ASSERT(rhs.IsString());\n\n        const SizeType len1 = GetStringLength();\n        const SizeType len2 = rhs.GetStringLength();\n        if(len1 != len2) { return false; }\n\n        const Ch* const str1 = GetString();\n        const Ch* const str2 = rhs.GetString();\n        if(str1 == str2) { return true; } // fast path for constant string\n\n        return (std::memcmp(str1, str2, sizeof(Ch) * len1) == 0);\n    }\n\n    Data data_;\n    unsigned flags_;\n};\n\n//! GenericValue with UTF8 encoding\ntypedef GenericValue<UTF8<> > Value;\n\n///////////////////////////////////////////////////////////////////////////////\n// GenericDocument \n\n//! A document for parsing JSON text as DOM.\n/*!\n    \\note implements Handler concept\n    \\tparam Encoding Encoding for both parsing and string storage.\n    \\tparam Allocator Allocator for allocating memory for the DOM\n    \\tparam StackAllocator Allocator for allocating memory for stack during parsing.\n    \\warning Although GenericDocument inherits from GenericValue, the API does \\b not provide any virtual functions, especially no virtual destructor.  To avoid memory leaks, do not \\c delete a GenericDocument object via a pointer to a GenericValue.\n*/\ntemplate <typename Encoding, typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = CrtAllocator>\nclass GenericDocument : public GenericValue<Encoding, Allocator> {\npublic:\n    typedef typename Encoding::Ch Ch;                       //!< Character type derived from Encoding.\n    typedef GenericValue<Encoding, Allocator> ValueType;    //!< Value type of the document.\n    typedef Allocator AllocatorType;                        //!< Allocator type from template parameter.\n\n    //! Constructor\n    /*! \\param allocator        Optional allocator for allocating memory.\n        \\param stackCapacity    Optional initial capacity of stack in bytes.\n        \\param stackAllocator   Optional allocator for allocating memory for stack.\n    */\n    GenericDocument(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) : \n        allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_()\n    {\n        if (!allocator_)\n            ownAllocator_ = allocator_ = new Allocator();\n    }\n\n    ~GenericDocument() {\n        delete ownAllocator_;\n    }\n\n    //!@name Parse from stream\n    //!@{\n\n    //! Parse JSON text from an input stream (with Encoding conversion)\n    /*! \\tparam parseFlags Combination of \\ref ParseFlag.\n        \\tparam SourceEncoding Encoding of input stream\n        \\tparam InputStream Type of input stream, implementing Stream concept\n        \\param is Input stream to be parsed.\n        \\return The document itself for fluent API.\n    */\n    template <unsigned parseFlags, typename SourceEncoding, typename InputStream>\n    GenericDocument& ParseStream(InputStream& is) {\n        ValueType::SetNull(); // Remove existing root if exist\n        GenericReader<SourceEncoding, Encoding, Allocator> reader(&GetAllocator());\n        ClearStackOnExit scope(*this);\n        parseResult_ = reader.template Parse<parseFlags>(is, *this);\n        if (parseResult_) {\n            RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object\n            this->RawAssign(*stack_.template Pop<ValueType>(1));    // Add this-> to prevent issue 13.\n        }\n        return *this;\n    }\n\n    //! Parse JSON text from an input stream\n    /*! \\tparam parseFlags Combination of \\ref ParseFlag.\n        \\tparam InputStream Type of input stream, implementing Stream concept\n        \\param is Input stream to be parsed.\n        \\return The document itself for fluent API.\n    */\n    template <unsigned parseFlags, typename InputStream>\n    GenericDocument& ParseStream(InputStream& is) {\n        return ParseStream<parseFlags,Encoding,InputStream>(is);\n    }\n\n    //! Parse JSON text from an input stream (with \\ref kParseDefaultFlags)\n    /*! \\tparam InputStream Type of input stream, implementing Stream concept\n        \\param is Input stream to be parsed.\n        \\return The document itself for fluent API.\n    */\n    template <typename InputStream>\n    GenericDocument& ParseStream(InputStream& is) {\n        return ParseStream<kParseDefaultFlags, Encoding, InputStream>(is);\n    }\n    //!@}\n\n    //!@name Parse in-place from mutable string\n    //!@{\n\n    //! Parse JSON text from a mutable string (with Encoding conversion)\n    /*! \\tparam parseFlags Combination of \\ref ParseFlag.\n        \\tparam SourceEncoding Transcoding from input Encoding\n        \\param str Mutable zero-terminated string to be parsed.\n        \\return The document itself for fluent API.\n    */\n    template <unsigned parseFlags, typename SourceEncoding>\n    GenericDocument& ParseInsitu(Ch* str) {\n        GenericInsituStringStream<Encoding> s(str);\n        return ParseStream<parseFlags | kParseInsituFlag, SourceEncoding>(s);\n    }\n\n    //! Parse JSON text from a mutable string\n    /*! \\tparam parseFlags Combination of \\ref ParseFlag.\n        \\param str Mutable zero-terminated string to be parsed.\n        \\return The document itself for fluent API.\n    */\n    template <unsigned parseFlags>\n    GenericDocument& ParseInsitu(Ch* str) {\n        return ParseInsitu<parseFlags, Encoding>(str);\n    }\n\n    //! Parse JSON text from a mutable string (with \\ref kParseDefaultFlags)\n    /*! \\param str Mutable zero-terminated string to be parsed.\n        \\return The document itself for fluent API.\n    */\n    GenericDocument& ParseInsitu(Ch* str) {\n        return ParseInsitu<kParseDefaultFlags, Encoding>(str);\n    }\n    //!@}\n\n    //!@name Parse from read-only string\n    //!@{\n\n    //! Parse JSON text from a read-only string (with Encoding conversion)\n    /*! \\tparam parseFlags Combination of \\ref ParseFlag (must not contain \\ref kParseInsituFlag).\n        \\tparam SourceEncoding Transcoding from input Encoding\n        \\param str Read-only zero-terminated string to be parsed.\n    */\n    template <unsigned parseFlags, typename SourceEncoding>\n    GenericDocument& Parse(const Ch* str) {\n        RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag));\n        GenericStringStream<SourceEncoding> s(str);\n        return ParseStream<parseFlags, SourceEncoding>(s);\n    }\n\n    //! Parse JSON text from a read-only string\n    /*! \\tparam parseFlags Combination of \\ref ParseFlag (must not contain \\ref kParseInsituFlag).\n        \\param str Read-only zero-terminated string to be parsed.\n    */\n    template <unsigned parseFlags>\n    GenericDocument& Parse(const Ch* str) {\n        return Parse<parseFlags, Encoding>(str);\n    }\n\n    //! Parse JSON text from a read-only string (with \\ref kParseDefaultFlags)\n    /*! \\param str Read-only zero-terminated string to be parsed.\n    */\n    GenericDocument& Parse(const Ch* str) {\n        return Parse<kParseDefaultFlags>(str);\n    }\n    //!@}\n\n    //!@name Handling parse errors\n    //!@{\n\n    //! Whether a parse error has occured in the last parsing.\n    bool HasParseError() const { return parseResult_.IsError(); }\n\n    //! Get the \\ref ParseErrorCode of last parsing.\n    ParseErrorCode GetParseError() const { return parseResult_.Code(); }\n\n    //! Get the position of last parsing error in input, 0 otherwise.\n    size_t GetErrorOffset() const { return parseResult_.Offset(); }\n\n    //!@}\n\n    //! Get the allocator of this document.\n    Allocator& GetAllocator() { return *allocator_; }\n\n    //! Get the capacity of stack in bytes.\n    size_t GetStackCapacity() const { return stack_.GetCapacity(); }\n\nprivate:\n    // clear stack on any exit from ParseStream, e.g. due to exception\n    struct ClearStackOnExit {\n        explicit ClearStackOnExit(GenericDocument& d) : d_(d) {}\n        ~ClearStackOnExit() { d_.ClearStack(); }\n    private:\n        ClearStackOnExit(const ClearStackOnExit&);\n        ClearStackOnExit& operator=(const ClearStackOnExit&);\n        GenericDocument& d_;\n    };\n\n    // callers of the following private Handler functions\n    template <typename,typename,typename> friend class GenericReader; // for parsing\n    template <typename, typename> friend class GenericValue; // for deep copying\n\n    // Implementation of Handler\n    bool Null() { new (stack_.template Push<ValueType>()) ValueType(); return true; }\n    bool Bool(bool b) { new (stack_.template Push<ValueType>()) ValueType(b); return true; }\n    bool Int(int i) { new (stack_.template Push<ValueType>()) ValueType(i); return true; }\n    bool Uint(unsigned i) { new (stack_.template Push<ValueType>()) ValueType(i); return true; }\n    bool Int64(int64_t i) { new (stack_.template Push<ValueType>()) ValueType(i); return true; }\n    bool Uint64(uint64_t i) { new (stack_.template Push<ValueType>()) ValueType(i); return true; }\n    bool Double(double d) { new (stack_.template Push<ValueType>()) ValueType(d); return true; }\n\n    bool String(const Ch* str, SizeType length, bool copy) { \n        if (copy) \n            new (stack_.template Push<ValueType>()) ValueType(str, length, GetAllocator());\n        else\n            new (stack_.template Push<ValueType>()) ValueType(str, length);\n        return true;\n    }\n\n    bool StartObject() { new (stack_.template Push<ValueType>()) ValueType(kObjectType); return true; }\n    \n    bool Key(const Ch* str, SizeType length, bool copy) { return String(str, length, copy); }\n\n    bool EndObject(SizeType memberCount) {\n        typename ValueType::Member* members = stack_.template Pop<typename ValueType::Member>(memberCount);\n        stack_.template Top<ValueType>()->SetObjectRaw(members, (SizeType)memberCount, GetAllocator());\n        return true;\n    }\n\n    bool StartArray() { new (stack_.template Push<ValueType>()) ValueType(kArrayType); return true; }\n    \n    bool EndArray(SizeType elementCount) {\n        ValueType* elements = stack_.template Pop<ValueType>(elementCount);\n        stack_.template Top<ValueType>()->SetArrayRaw(elements, elementCount, GetAllocator());\n        return true;\n    }\n\nprivate:\n    //! Prohibit assignment\n    GenericDocument& operator=(const GenericDocument&);\n\n    void ClearStack() {\n        if (Allocator::kNeedFree)\n            while (stack_.GetSize() > 0)    // Here assumes all elements in stack array are GenericValue (Member is actually 2 GenericValue objects)\n                (stack_.template Pop<ValueType>(1))->~ValueType();\n        else\n            stack_.Clear();\n        stack_.ShrinkToFit();\n    }\n\n    static const size_t kDefaultStackCapacity = 1024;\n    Allocator* allocator_;\n    Allocator* ownAllocator_;\n    internal::Stack<StackAllocator> stack_;\n    ParseResult parseResult_;\n};\n\n//! GenericDocument with UTF8 encoding\ntypedef GenericDocument<UTF8<> > Document;\n\n// defined here due to the dependency on GenericDocument\ntemplate <typename Encoding, typename Allocator>\ntemplate <typename SourceAllocator>\ninline\nGenericValue<Encoding,Allocator>::GenericValue(const GenericValue<Encoding,SourceAllocator>& rhs, Allocator& allocator)\n{\n    GenericDocument<Encoding,Allocator> d(&allocator);\n    rhs.Accept(d);\n    RawAssign(*d.stack_.template Pop<GenericValue>(1));\n}\n\n} // namespace rapidjson\n\n#if defined(_MSC_VER) || defined(__GNUC__)\nRAPIDJSON_DIAG_POP\n#endif\n\n#endif // RAPIDJSON_DOCUMENT_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/encodedstream.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_ENCODEDSTREAM_H_\n#define RAPIDJSON_ENCODEDSTREAM_H_\n\n#include \"rapidjson.h\"\n\n#ifdef __GNUC__\nRAPIDJSON_DIAG_PUSH\nRAPIDJSON_DIAG_OFF(effc++)\n#endif\n\nnamespace rapidjson {\n\n//! Input byte stream wrapper with a statically bound encoding.\n/*!\n    \\tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE.\n    \\tparam InputByteStream Type of input byte stream. For example, FileReadStream.\n*/\ntemplate <typename Encoding, typename InputByteStream>\nclass EncodedInputStream {\n    RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);\npublic:\n    typedef typename Encoding::Ch Ch;\n\n    EncodedInputStream(InputByteStream& is) : is_(is) { \n        current_ = Encoding::TakeBOM(is_);\n    }\n\n    Ch Peek() const { return current_; }\n    Ch Take() { Ch c = current_; current_ = Encoding::Take(is_); return c; }\n    size_t Tell() const { return is_.Tell(); }\n\n    // Not implemented\n    void Put(Ch) { RAPIDJSON_ASSERT(false); }\n    void Flush() { RAPIDJSON_ASSERT(false); } \n    Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }\n    size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }\n\nprivate:\n    EncodedInputStream(const EncodedInputStream&);\n    EncodedInputStream& operator=(const EncodedInputStream&);\n\n    InputByteStream& is_;\n    Ch current_;\n};\n\n//! Output byte stream wrapper with statically bound encoding.\n/*!\n    \\tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE.\n    \\tparam InputByteStream Type of input byte stream. For example, FileWriteStream.\n*/\ntemplate <typename Encoding, typename OutputByteStream>\nclass EncodedOutputStream {\n    RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);\npublic:\n    typedef typename Encoding::Ch Ch;\n\n    EncodedOutputStream(OutputByteStream& os, bool putBOM = true) : os_(os) { \n        if (putBOM)\n            Encoding::PutBOM(os_);\n    }\n\n    void Put(Ch c) { Encoding::Put(os_, c);  }\n    void Flush() { os_.Flush(); }\n\n    // Not implemented\n    Ch Peek() const { RAPIDJSON_ASSERT(false); }\n    Ch Take() { RAPIDJSON_ASSERT(false);  }\n    size_t Tell() const { RAPIDJSON_ASSERT(false);  return 0; }\n    Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }\n    size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }\n\nprivate:\n    EncodedOutputStream(const EncodedOutputStream&);\n    EncodedOutputStream& operator=(const EncodedOutputStream&);\n\n    OutputByteStream& os_;\n};\n\n#define RAPIDJSON_ENCODINGS_FUNC(x) UTF8<Ch>::x, UTF16LE<Ch>::x, UTF16BE<Ch>::x, UTF32LE<Ch>::x, UTF32BE<Ch>::x\n\n//! Input stream wrapper with dynamically bound encoding and automatic encoding detection.\n/*!\n    \\tparam CharType Type of character for reading.\n    \\tparam InputByteStream type of input byte stream to be wrapped.\n*/\ntemplate <typename CharType, typename InputByteStream>\nclass AutoUTFInputStream {\n    RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);\npublic:\n    typedef CharType Ch;\n\n    //! Constructor.\n    /*!\n        \\param is input stream to be wrapped.\n        \\param type UTF encoding type if it is not detected from the stream.\n    */\n    AutoUTFInputStream(InputByteStream& is, UTFType type = kUTF8) : is_(&is), type_(type), hasBOM_(false) {\n        DetectType();\n        static const TakeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Take) };\n        takeFunc_ = f[type_];\n        current_ = takeFunc_(*is_);\n    }\n\n    UTFType GetType() const { return type_; }\n    bool HasBOM() const { return hasBOM_; }\n\n    Ch Peek() const { return current_; }\n    Ch Take() { Ch c = current_; current_ = takeFunc_(*is_); return c; }\n    size_t Tell() const { return is_->Tell(); }\n\n    // Not implemented\n    void Put(Ch) { RAPIDJSON_ASSERT(false); }\n    void Flush() { RAPIDJSON_ASSERT(false); } \n    Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }\n    size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }\n\nprivate:\n    AutoUTFInputStream(const AutoUTFInputStream&);\n    AutoUTFInputStream& operator=(const AutoUTFInputStream&);\n\n    // Detect encoding type with BOM or RFC 4627\n    void DetectType() {\n        // BOM (Byte Order Mark):\n        // 00 00 FE FF  UTF-32BE\n        // FF FE 00 00  UTF-32LE\n        // FE FF        UTF-16BE\n        // FF FE        UTF-16LE\n        // EF BB BF     UTF-8\n\n        const unsigned char* c = (const unsigned char *)is_->Peek4();\n        if (!c)\n            return;\n\n        unsigned bom = c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24);\n        hasBOM_ = false;\n        if (bom == 0xFFFE0000)                  { type_ = kUTF32BE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); }\n        else if (bom == 0x0000FEFF)             { type_ = kUTF32LE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); }\n        else if ((bom & 0xFFFF) == 0xFFFE)      { type_ = kUTF16BE; hasBOM_ = true; is_->Take(); is_->Take();                           }\n        else if ((bom & 0xFFFF) == 0xFEFF)      { type_ = kUTF16LE; hasBOM_ = true; is_->Take(); is_->Take();                           }\n        else if ((bom & 0xFFFFFF) == 0xBFBBEF)  { type_ = kUTF8;    hasBOM_ = true; is_->Take(); is_->Take(); is_->Take();              }\n\n        // RFC 4627: Section 3\n        // \"Since the first two characters of a JSON text will always be ASCII\n        // characters [RFC0020], it is possible to determine whether an octet\n        // stream is UTF-8, UTF-16 (BE or LE), or UTF-32 (BE or LE) by looking\n        // at the pattern of nulls in the first four octets.\"\n        // 00 00 00 xx  UTF-32BE\n        // 00 xx 00 xx  UTF-16BE\n        // xx 00 00 00  UTF-32LE\n        // xx 00 xx 00  UTF-16LE\n        // xx xx xx xx  UTF-8\n\n        if (!hasBOM_) {\n            unsigned pattern = (c[0] ? 1 : 0) | (c[1] ? 2 : 0) | (c[2] ? 4 : 0) | (c[3] ? 8 : 0);\n            switch (pattern) {\n            case 0x08: type_ = kUTF32BE; break;\n            case 0x0A: type_ = kUTF16BE; break;\n            case 0x01: type_ = kUTF32LE; break;\n            case 0x05: type_ = kUTF16LE; break;\n            case 0x0F: type_ = kUTF8;    break;\n            default: break; // Use type defined by user.\n            }\n        }\n\n        // Runtime check whether the size of character type is sufficient. It only perform checks with assertion.\n        switch (type_) {\n        case kUTF8:\n            // Do nothing\n            break;\n        case kUTF16LE:\n        case kUTF16BE:\n            RAPIDJSON_ASSERT(sizeof(Ch) >= 2);\n            break;\n        case kUTF32LE:\n        case kUTF32BE:\n            RAPIDJSON_ASSERT(sizeof(Ch) >= 4);\n            break;\n        default:\n            RAPIDJSON_ASSERT(false);    // Invalid type\n        }\n    }\n\n    typedef Ch (*TakeFunc)(InputByteStream& is);\n    InputByteStream* is_;\n    UTFType type_;\n    Ch current_;\n    TakeFunc takeFunc_;\n    bool hasBOM_;\n};\n\n//! Output stream wrapper with dynamically bound encoding and automatic encoding detection.\n/*!\n    \\tparam CharType Type of character for writing.\n    \\tparam InputByteStream type of output byte stream to be wrapped.\n*/\ntemplate <typename CharType, typename OutputByteStream>\nclass AutoUTFOutputStream {\n    RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);\npublic:\n    typedef CharType Ch;\n\n    //! Constructor.\n    /*!\n        \\param os output stream to be wrapped.\n        \\param type UTF encoding type.\n        \\param putBOM Whether to write BOM at the beginning of the stream.\n    */\n    AutoUTFOutputStream(OutputByteStream& os, UTFType type, bool putBOM) : os_(&os), type_(type) {\n        // RUntime check whether the size of character type is sufficient. It only perform checks with assertion.\n        switch (type_) {\n        case kUTF16LE:\n        case kUTF16BE:\n            RAPIDJSON_ASSERT(sizeof(Ch) >= 2);\n            break;\n        case kUTF32LE:\n        case kUTF32BE:\n            RAPIDJSON_ASSERT(sizeof(Ch) >= 4);\n            break;\n        case kUTF8:\n            // Do nothing\n            break;\n        default:\n            RAPIDJSON_ASSERT(false);    // Invalid UTFType\n        }\n\n        static const PutFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Put) };\n        putFunc_ = f[type_];\n\n        if (putBOM)\n            PutBOM();\n    }\n\n    UTFType GetType() const { return type_; }\n\n    void Put(Ch c) { putFunc_(*os_, c); }\n    void Flush() { os_->Flush(); } \n\n    // Not implemented\n    Ch Peek() const { RAPIDJSON_ASSERT(false); }\n    Ch Take() { RAPIDJSON_ASSERT(false); }\n    size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; }\n    Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }\n    size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }\n\nprivate:\n    AutoUTFOutputStream(const AutoUTFOutputStream&);\n    AutoUTFOutputStream& operator=(const AutoUTFOutputStream&);\n\n    void PutBOM() { \n        typedef void (*PutBOMFunc)(OutputByteStream&);\n        static const PutBOMFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(PutBOM) };\n        f[type_](*os_);\n    }\n\n    typedef void (*PutFunc)(OutputByteStream&, Ch);\n\n    OutputByteStream* os_;\n    UTFType type_;\n    PutFunc putFunc_;\n};\n\n#undef RAPIDJSON_ENCODINGS_FUNC\n\n} // namespace rapidjson\n\n#ifdef __GNUC__\nRAPIDJSON_DIAG_POP\n#endif\n\n#endif // RAPIDJSON_FILESTREAM_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/encodings.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_ENCODINGS_H_\n#define RAPIDJSON_ENCODINGS_H_\n\n#include \"rapidjson.h\"\n\n#ifdef _MSC_VER\nRAPIDJSON_DIAG_PUSH\nRAPIDJSON_DIAG_OFF(4244) // conversion from 'type1' to 'type2', possible loss of data\nRAPIDJSON_DIAG_OFF(4702)  // unreachable code\n#elif defined(__GNUC__)\nRAPIDJSON_DIAG_PUSH\nRAPIDJSON_DIAG_OFF(effc++)\n#endif\n\nnamespace rapidjson {\n\n///////////////////////////////////////////////////////////////////////////////\n// Encoding\n\n/*! \\class rapidjson::Encoding\n    \\brief Concept for encoding of Unicode characters.\n\n\\code\nconcept Encoding {\n    typename Ch;    //! Type of character. A \"character\" is actually a code unit in unicode's definition.\n\n    enum { supportUnicode = 1 }; // or 0 if not supporting unicode\n\n    //! \\brief Encode a Unicode codepoint to an output stream.\n    //! \\param os Output stream.\n    //! \\param codepoint An unicode codepoint, ranging from 0x0 to 0x10FFFF inclusively.\n    template<typename OutputStream>\n    static void Encode(OutputStream& os, unsigned codepoint);\n\n    //! \\brief Decode a Unicode codepoint from an input stream.\n    //! \\param is Input stream.\n    //! \\param codepoint Output of the unicode codepoint.\n    //! \\return true if a valid codepoint can be decoded from the stream.\n    template <typename InputStream>\n    static bool Decode(InputStream& is, unsigned* codepoint);\n\n    //! \\brief Validate one Unicode codepoint from an encoded stream.\n    //! \\param is Input stream to obtain codepoint.\n    //! \\param os Output for copying one codepoint.\n    //! \\return true if it is valid.\n    //! \\note This function just validating and copying the codepoint without actually decode it.\n    template <typename InputStream, typename OutputStream>\n    static bool Validate(InputStream& is, OutputStream& os);\n\n    // The following functions are deal with byte streams.\n\n    //! Take a character from input byte stream, skip BOM if exist.\n    template <typename InputByteStream>\n    static CharType TakeBOM(InputByteStream& is);\n\n    //! Take a character from input byte stream.\n    template <typename InputByteStream>\n    static Ch Take(InputByteStream& is);\n\n    //! Put BOM to output byte stream.\n    template <typename OutputByteStream>\n    static void PutBOM(OutputByteStream& os);\n\n    //! Put a character to output byte stream.\n    template <typename OutputByteStream>\n    static void Put(OutputByteStream& os, Ch c);\n};\n\\endcode\n*/\n\n///////////////////////////////////////////////////////////////////////////////\n// UTF8\n\n//! UTF-8 encoding.\n/*! http://en.wikipedia.org/wiki/UTF-8\n    http://tools.ietf.org/html/rfc3629\n    \\tparam CharType Code unit for storing 8-bit UTF-8 data. Default is char.\n    \\note implements Encoding concept\n*/\ntemplate<typename CharType = char>\nstruct UTF8 {\n    typedef CharType Ch;\n\n    enum { supportUnicode = 1 };\n\n    template<typename OutputStream>\n    static void Encode(OutputStream& os, unsigned codepoint) {\n        if (codepoint <= 0x7F) \n            os.Put(static_cast<Ch>(codepoint & 0xFF));\n        else if (codepoint <= 0x7FF) {\n            os.Put(static_cast<Ch>(0xC0 | ((codepoint >> 6) & 0xFF)));\n            os.Put(static_cast<Ch>(0x80 | ((codepoint & 0x3F))));\n        }\n        else if (codepoint <= 0xFFFF) {\n            os.Put(static_cast<Ch>(0xE0 | ((codepoint >> 12) & 0xFF)));\n            os.Put(static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F)));\n            os.Put(static_cast<Ch>(0x80 | (codepoint & 0x3F)));\n        }\n        else {\n            RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);\n            os.Put(static_cast<Ch>(0xF0 | ((codepoint >> 18) & 0xFF)));\n            os.Put(static_cast<Ch>(0x80 | ((codepoint >> 12) & 0x3F)));\n            os.Put(static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F)));\n            os.Put(static_cast<Ch>(0x80 | (codepoint & 0x3F)));\n        }\n    }\n\n    template <typename InputStream>\n    static bool Decode(InputStream& is, unsigned* codepoint) {\n#define COPY() c = is.Take(); *codepoint = (*codepoint << 6) | ((unsigned char)c & 0x3Fu)\n#define TRANS(mask) result &= ((GetRange((unsigned char)c) & mask) != 0)\n#define TAIL() COPY(); TRANS(0x70)\n        Ch c = is.Take();\n        if (!(c & 0x80)) {\n            *codepoint = (unsigned char)c;\n            return true;\n        }\n\n        unsigned char type = GetRange((unsigned char)c);\n        *codepoint = (0xFF >> type) & (unsigned char)c;\n        bool result = true;\n        switch (type) {\n        case 2: TAIL(); return result;\n        case 3: TAIL(); TAIL(); return result;\n        case 4: COPY(); TRANS(0x50); TAIL(); return result;\n        case 5: COPY(); TRANS(0x10); TAIL(); TAIL(); return result;\n        case 6: TAIL(); TAIL(); TAIL(); return result;\n        case 10: COPY(); TRANS(0x20); TAIL(); return result;\n        case 11: COPY(); TRANS(0x60); TAIL(); TAIL(); return result;\n        default: return false;\n        }\n#undef COPY\n#undef TRANS\n#undef TAIL\n    }\n\n    template <typename InputStream, typename OutputStream>\n    static bool Validate(InputStream& is, OutputStream& os) {\n#define COPY() os.Put(c = is.Take())\n#define TRANS(mask) result &= ((GetRange((unsigned char)c) & mask) != 0)\n#define TAIL() COPY(); TRANS(0x70)\n        Ch c;\n        COPY();\n        if (!(c & 0x80))\n            return true;\n\n        bool result = true;\n        switch (GetRange((unsigned char)c)) {\n        case 2: TAIL(); return result;\n        case 3: TAIL(); TAIL(); return result;\n        case 4: COPY(); TRANS(0x50); TAIL(); return result;\n        case 5: COPY(); TRANS(0x10); TAIL(); TAIL(); return result;\n        case 6: TAIL(); TAIL(); TAIL(); return result;\n        case 10: COPY(); TRANS(0x20); TAIL(); return result;\n        case 11: COPY(); TRANS(0x60); TAIL(); TAIL(); return result;\n        default: return false;\n        }\n#undef COPY\n#undef TRANS\n#undef TAIL\n    }\n\n    static unsigned char GetRange(unsigned char c) {\n        // Referring to DFA of http://bjoern.hoehrmann.de/utf-8/decoder/dfa/\n        // With new mapping 1 -> 0x10, 7 -> 0x20, 9 -> 0x40, such that AND operation can test multiple types.\n        static const unsigned char type[] = {\n            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,\n            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,\n            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,\n            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,\n            0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,\n            0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,\n            0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,\n            0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,\n            8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,\n            10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,\n        };\n        return type[c];\n    }\n\n    template <typename InputByteStream>\n    static CharType TakeBOM(InputByteStream& is) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);\n        Ch c = Take(is);\n        if ((unsigned char)c != 0xEFu) return c;\n        c = is.Take();\n        if ((unsigned char)c != 0xBBu) return c;\n        c = is.Take();\n        if ((unsigned char)c != 0xBFu) return c;\n        c = is.Take();\n        return c;\n    }\n\n    template <typename InputByteStream>\n    static Ch Take(InputByteStream& is) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);\n        return is.Take();\n    }\n\n    template <typename OutputByteStream>\n    static void PutBOM(OutputByteStream& os) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);\n        os.Put(0xEFu); os.Put(0xBBu); os.Put(0xBFu);\n    }\n\n    template <typename OutputByteStream>\n    static void Put(OutputByteStream& os, Ch c) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);\n        os.Put(static_cast<typename OutputByteStream::Ch>(c));\n    }\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// UTF16\n\n//! UTF-16 encoding.\n/*! http://en.wikipedia.org/wiki/UTF-16\n    http://tools.ietf.org/html/rfc2781\n    \\tparam CharType Type for storing 16-bit UTF-16 data. Default is wchar_t. C++11 may use char16_t instead.\n    \\note implements Encoding concept\n\n    \\note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness.\n    For streaming, use UTF16LE and UTF16BE, which handle endianness.\n*/\ntemplate<typename CharType = wchar_t>\nstruct UTF16 {\n    typedef CharType Ch;\n    RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 2);\n\n    enum { supportUnicode = 1 };\n\n    template<typename OutputStream>\n    static void Encode(OutputStream& os, unsigned codepoint) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2);\n        if (codepoint <= 0xFFFF) {\n            RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair \n            os.Put(static_cast<typename OutputStream::Ch>(codepoint));\n        }\n        else {\n            RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);\n            unsigned v = codepoint - 0x10000;\n            os.Put(static_cast<typename OutputStream::Ch>((v >> 10) | 0xD800));\n            os.Put((v & 0x3FF) | 0xDC00);\n        }\n    }\n\n    template <typename InputStream>\n    static bool Decode(InputStream& is, unsigned* codepoint) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2);\n        Ch c = is.Take();\n        if (c < 0xD800 || c > 0xDFFF) {\n            *codepoint = c;\n            return true;\n        }\n        else if (c <= 0xDBFF) {\n            *codepoint = (c & 0x3FF) << 10;\n            c = is.Take();\n            *codepoint |= (c & 0x3FF);\n            *codepoint += 0x10000;\n            return c >= 0xDC00 && c <= 0xDFFF;\n        }\n        return false;\n    }\n\n    template <typename InputStream, typename OutputStream>\n    static bool Validate(InputStream& is, OutputStream& os) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2);\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2);\n        Ch c;\n        os.Put(c = is.Take());\n        if (c < 0xD800 || c > 0xDFFF)\n            return true;\n        else if (c <= 0xDBFF) {\n            os.Put(c = is.Take());\n            return c >= 0xDC00 && c <= 0xDFFF;\n        }\n        return false;\n    }\n};\n\n//! UTF-16 little endian encoding.\ntemplate<typename CharType = wchar_t>\nstruct UTF16LE : UTF16<CharType> {\n    template <typename InputByteStream>\n    static CharType TakeBOM(InputByteStream& is) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);\n        CharType c = Take(is);\n        return (unsigned short)c == 0xFEFFu ? Take(is) : c;\n    }\n\n    template <typename InputByteStream>\n    static CharType Take(InputByteStream& is) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);\n        CharType c = (unsigned char)is.Take();\n        c |= (unsigned char)is.Take() << 8;\n        return c;\n    }\n\n    template <typename OutputByteStream>\n    static void PutBOM(OutputByteStream& os) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);\n        os.Put(0xFFu); os.Put(0xFEu);\n    }\n\n    template <typename OutputByteStream>\n    static void Put(OutputByteStream& os, CharType c) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);\n        os.Put(c & 0xFFu);\n        os.Put((c >> 8) & 0xFFu);\n    }\n};\n\n//! UTF-16 big endian encoding.\ntemplate<typename CharType = wchar_t>\nstruct UTF16BE : UTF16<CharType> {\n    template <typename InputByteStream>\n    static CharType TakeBOM(InputByteStream& is) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);\n        CharType c = Take(is);\n        return (unsigned short)c == 0xFEFFu ? Take(is) : c;\n    }\n\n    template <typename InputByteStream>\n    static CharType Take(InputByteStream& is) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);\n        CharType c = (unsigned char)is.Take() << 8;\n        c |= (unsigned char)is.Take();\n        return c;\n    }\n\n    template <typename OutputByteStream>\n    static void PutBOM(OutputByteStream& os) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);\n        os.Put(0xFEu); os.Put(0xFFu);\n    }\n\n    template <typename OutputByteStream>\n    static void Put(OutputByteStream& os, CharType c) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);\n        os.Put((c >> 8) & 0xFFu);\n        os.Put(c & 0xFFu);\n    }\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// UTF32\n\n//! UTF-32 encoding. \n/*! http://en.wikipedia.org/wiki/UTF-32\n    \\tparam CharType Type for storing 32-bit UTF-32 data. Default is unsigned. C++11 may use char32_t instead.\n    \\note implements Encoding concept\n\n    \\note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness.\n    For streaming, use UTF32LE and UTF32BE, which handle endianness.\n*/\ntemplate<typename CharType = unsigned>\nstruct UTF32 {\n    typedef CharType Ch;\n    RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 4);\n\n    enum { supportUnicode = 1 };\n\n    template<typename OutputStream>\n    static void Encode(OutputStream& os, unsigned codepoint) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4);\n        RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);\n        os.Put(codepoint);\n    }\n\n    template <typename InputStream>\n    static bool Decode(InputStream& is, unsigned* codepoint) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4);\n        Ch c = is.Take();\n        *codepoint = c;\n        return c <= 0x10FFFF;\n    }\n\n    template <typename InputStream, typename OutputStream>\n    static bool Validate(InputStream& is, OutputStream& os) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4);\n        Ch c;\n        os.Put(c = is.Take());\n        return c <= 0x10FFFF;\n    }\n};\n\n//! UTF-32 little endian enocoding.\ntemplate<typename CharType = unsigned>\nstruct UTF32LE : UTF32<CharType> {\n    template <typename InputByteStream>\n    static CharType TakeBOM(InputByteStream& is) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);\n        CharType c = Take(is);\n        return (unsigned)c == 0x0000FEFFu ? Take(is) : c;\n    }\n\n    template <typename InputByteStream>\n    static CharType Take(InputByteStream& is) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);\n        CharType c = (unsigned char)is.Take();\n        c |= (unsigned char)is.Take() << 8;\n        c |= (unsigned char)is.Take() << 16;\n        c |= (unsigned char)is.Take() << 24;\n        return c;\n    }\n\n    template <typename OutputByteStream>\n    static void PutBOM(OutputByteStream& os) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);\n        os.Put(0xFFu); os.Put(0xFEu); os.Put(0x00u); os.Put(0x00u);\n    }\n\n    template <typename OutputByteStream>\n    static void Put(OutputByteStream& os, CharType c) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);\n        os.Put(c & 0xFFu);\n        os.Put((c >> 8) & 0xFFu);\n        os.Put((c >> 16) & 0xFFu);\n        os.Put((c >> 24) & 0xFFu);\n    }\n};\n\n//! UTF-32 big endian encoding.\ntemplate<typename CharType = unsigned>\nstruct UTF32BE : UTF32<CharType> {\n    template <typename InputByteStream>\n    static CharType TakeBOM(InputByteStream& is) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);\n        CharType c = Take(is);\n        return (unsigned)c == 0x0000FEFFu ? Take(is) : c; \n    }\n\n    template <typename InputByteStream>\n    static CharType Take(InputByteStream& is) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);\n        CharType c = (unsigned char)is.Take() << 24;\n        c |= (unsigned char)is.Take() << 16;\n        c |= (unsigned char)is.Take() << 8;\n        c |= (unsigned char)is.Take();\n        return c;\n    }\n\n    template <typename OutputByteStream>\n    static void PutBOM(OutputByteStream& os) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);\n        os.Put(0x00u); os.Put(0x00u); os.Put(0xFEu); os.Put(0xFFu);\n    }\n\n    template <typename OutputByteStream>\n    static void Put(OutputByteStream& os, CharType c) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);\n        os.Put((c >> 24) & 0xFFu);\n        os.Put((c >> 16) & 0xFFu);\n        os.Put((c >> 8) & 0xFFu);\n        os.Put(c & 0xFFu);\n    }\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// ASCII\n\n//! ASCII encoding.\n/*! http://en.wikipedia.org/wiki/ASCII\n    \\tparam CharType Code unit for storing 7-bit ASCII data. Default is char.\n    \\note implements Encoding concept\n*/\ntemplate<typename CharType = char>\nstruct ASCII {\n    typedef CharType Ch;\n\n    enum { supportUnicode = 0 };\n\n    template<typename OutputStream>\n    static void Encode(OutputStream& os, unsigned codepoint) {\n        RAPIDJSON_ASSERT(codepoint <= 0x7F);\n        os.Put(static_cast<Ch>(codepoint & 0xFF));\n    }\n\n    template <typename InputStream>\n    static bool Decode(InputStream& is, unsigned* codepoint) {\n        unsigned char c = static_cast<unsigned char>(is.Take());\n        *codepoint = c;\n        return c <= 0X7F;\n    }\n\n    template <typename InputStream, typename OutputStream>\n    static bool Validate(InputStream& is, OutputStream& os) {\n        unsigned char c = is.Take();\n        os.Put(c);\n        return c <= 0x7F;\n    }\n\n    template <typename InputByteStream>\n    static CharType TakeBOM(InputByteStream& is) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);\n        Ch c = Take(is);\n        return c;\n    }\n\n    template <typename InputByteStream>\n    static Ch Take(InputByteStream& is) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);\n        return is.Take();\n    }\n\n    template <typename OutputByteStream>\n    static void PutBOM(OutputByteStream& os) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);\n        (void)os;\n    }\n\n    template <typename OutputByteStream>\n    static void Put(OutputByteStream& os, Ch c) {\n        RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);\n        os.Put(static_cast<typename OutputByteStream::Ch>(c));\n    }\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// AutoUTF\n\n//! Runtime-specified UTF encoding type of a stream.\nenum UTFType {\n    kUTF8 = 0,      //!< UTF-8.\n    kUTF16LE = 1,   //!< UTF-16 little endian.\n    kUTF16BE = 2,   //!< UTF-16 big endian.\n    kUTF32LE = 3,   //!< UTF-32 little endian.\n    kUTF32BE = 4    //!< UTF-32 big endian.\n};\n\n//! Dynamically select encoding according to stream's runtime-specified UTF encoding type.\n/*! \\note This class can be used with AutoUTFInputtStream and AutoUTFOutputStream, which provides GetType().\n*/\ntemplate<typename CharType>\nstruct AutoUTF {\n    typedef CharType Ch;\n\n    enum { supportUnicode = 1 };\n\n#define RAPIDJSON_ENCODINGS_FUNC(x) UTF8<Ch>::x, UTF16LE<Ch>::x, UTF16BE<Ch>::x, UTF32LE<Ch>::x, UTF32BE<Ch>::x\n\n    template<typename OutputStream>\n    RAPIDJSON_FORCEINLINE static void Encode(OutputStream& os, unsigned codepoint) {\n        typedef void (*EncodeFunc)(OutputStream&, unsigned);\n        static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Encode) };\n        (*f[os.GetType()])(os, codepoint);\n    }\n\n    template <typename InputStream>\n    RAPIDJSON_FORCEINLINE static bool Decode(InputStream& is, unsigned* codepoint) {\n        typedef bool (*DecodeFunc)(InputStream&, unsigned*);\n        static const DecodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Decode) };\n        return (*f[is.GetType()])(is, codepoint);\n    }\n\n    template <typename InputStream, typename OutputStream>\n    RAPIDJSON_FORCEINLINE static bool Validate(InputStream& is, OutputStream& os) {\n        typedef bool (*ValidateFunc)(InputStream&, OutputStream&);\n        static const ValidateFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Validate) };\n        return (*f[is.GetType()])(is, os);\n    }\n\n#undef RAPIDJSON_ENCODINGS_FUNC\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// Transcoder\n\n//! Encoding conversion.\ntemplate<typename SourceEncoding, typename TargetEncoding>\nstruct Transcoder {\n    //! Take one Unicode codepoint from source encoding, convert it to target encoding and put it to the output stream.\n    template<typename InputStream, typename OutputStream>\n    RAPIDJSON_FORCEINLINE static bool Transcode(InputStream& is, OutputStream& os) {\n        unsigned codepoint;\n        if (!SourceEncoding::Decode(is, &codepoint))\n            return false;\n        TargetEncoding::Encode(os, codepoint);\n        return true;\n    }\n\n    //! Validate one Unicode codepoint from an encoded stream.\n    template<typename InputStream, typename OutputStream>\n    RAPIDJSON_FORCEINLINE static bool Validate(InputStream& is, OutputStream& os) {\n        return Transcode(is, os);   // Since source/target encoding is different, must transcode.\n    }\n};\n\n//! Specialization of Transcoder with same source and target encoding.\ntemplate<typename Encoding>\nstruct Transcoder<Encoding, Encoding> {\n    template<typename InputStream, typename OutputStream>\n    RAPIDJSON_FORCEINLINE static bool Transcode(InputStream& is, OutputStream& os) {\n        os.Put(is.Take());  // Just copy one code unit. This semantic is different from primary template class.\n        return true;\n    }\n    \n    template<typename InputStream, typename OutputStream>\n    RAPIDJSON_FORCEINLINE static bool Validate(InputStream& is, OutputStream& os) {\n        return Encoding::Validate(is, os);  // source/target encoding are the same\n    }\n};\n\n} // namespace rapidjson\n\n#if defined(__GNUC__) || defined(_MSV_VER)\nRAPIDJSON_DIAG_POP\n#endif\n\n#endif // RAPIDJSON_ENCODINGS_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/error/en.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_ERROR_EN_H__\n#define RAPIDJSON_ERROR_EN_H__\n\n#include \"error.h\"\n\nnamespace rapidjson {\n\n//! Maps error code of parsing into error message.\n/*!\n    \\ingroup RAPIDJSON_ERRORS\n    \\param parseErrorCode Error code obtained in parsing.\n    \\return the error message.\n    \\note User can make a copy of this function for localization.\n        Using switch-case is safer for future modification of error codes.\n*/\ninline const RAPIDJSON_ERROR_CHARTYPE* GetParseError_En(ParseErrorCode parseErrorCode) {\n    switch (parseErrorCode) {\n        case kParseErrorNone:                           return RAPIDJSON_ERROR_STRING(\"No error.\");\n\n        case kParseErrorDocumentEmpty:                  return RAPIDJSON_ERROR_STRING(\"The document is empty.\");\n        case kParseErrorDocumentRootNotSingular:        return RAPIDJSON_ERROR_STRING(\"The document root must not follow by other values.\");\n    \n        case kParseErrorValueInvalid:                   return RAPIDJSON_ERROR_STRING(\"Invalid value.\");\n    \n        case kParseErrorObjectMissName:                 return RAPIDJSON_ERROR_STRING(\"Missing a name for object member.\");\n        case kParseErrorObjectMissColon:                return RAPIDJSON_ERROR_STRING(\"Missing a colon after a name of object member.\");\n        case kParseErrorObjectMissCommaOrCurlyBracket:  return RAPIDJSON_ERROR_STRING(\"Missing a comma or '}' after an object member.\");\n    \n        case kParseErrorArrayMissCommaOrSquareBracket:  return RAPIDJSON_ERROR_STRING(\"Missing a comma or ']' after an array element.\");\n\n        case kParseErrorStringUnicodeEscapeInvalidHex:  return RAPIDJSON_ERROR_STRING(\"Incorrect hex digit after \\\\u escape in string.\");\n        case kParseErrorStringUnicodeSurrogateInvalid:  return RAPIDJSON_ERROR_STRING(\"The surrogate pair in string is invalid.\");\n        case kParseErrorStringEscapeInvalid:            return RAPIDJSON_ERROR_STRING(\"Invalid escape character in string.\");\n        case kParseErrorStringMissQuotationMark:        return RAPIDJSON_ERROR_STRING(\"Missing a closing quotation mark in string.\");\n        case kParseErrorStringInvalidEncoding:          return RAPIDJSON_ERROR_STRING(\"Invalid encoding in string.\");\n\n        case kParseErrorNumberTooBig:                   return RAPIDJSON_ERROR_STRING(\"Number too big to be stored in double.\");\n        case kParseErrorNumberMissFraction:             return RAPIDJSON_ERROR_STRING(\"Miss fraction part in number.\");\n        case kParseErrorNumberMissExponent:             return RAPIDJSON_ERROR_STRING(\"Miss exponent in number.\");\n\n        case kParseErrorTermination:                    return RAPIDJSON_ERROR_STRING(\"Terminate parsing due to Handler error.\");\n        case kParseErrorUnspecificSyntaxError:          return RAPIDJSON_ERROR_STRING(\"Unspecific syntax error.\");\n\n        default:\n            return RAPIDJSON_ERROR_STRING(\"Unknown error.\");\n    }\n}\n\n} // namespace rapidjson\n\n#endif // RAPIDJSON_ERROR_EN_H__\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/error/error.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_ERROR_ERROR_H__\n#define RAPIDJSON_ERROR_ERROR_H__\n\n/*! \\file error.h */\n\n/*! \\defgroup RAPIDJSON_ERRORS RapidJSON error handling */\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_ERROR_CHARTYPE\n\n//! Character type of error messages.\n/*! \\ingroup RAPIDJSON_ERRORS\n    The default character type is \\c char.\n    On Windows, user can define this macro as \\c TCHAR for supporting both\n    unicode/non-unicode settings.\n*/\n#ifndef RAPIDJSON_ERROR_CHARTYPE\n#define RAPIDJSON_ERROR_CHARTYPE char\n#endif\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_ERROR_STRING\n\n//! Macro for converting string literial to \\ref RAPIDJSON_ERROR_CHARTYPE[].\n/*! \\ingroup RAPIDJSON_ERRORS\n    By default this conversion macro does nothing.\n    On Windows, user can define this macro as \\c _T(x) for supporting both\n    unicode/non-unicode settings.\n*/\n#ifndef RAPIDJSON_ERROR_STRING\n#define RAPIDJSON_ERROR_STRING(x) x\n#endif\n\nnamespace rapidjson {\n\n///////////////////////////////////////////////////////////////////////////////\n// ParseErrorCode\n\n//! Error code of parsing.\n/*! \\ingroup RAPIDJSON_ERRORS\n    \\see GenericReader::Parse, GenericReader::GetParseErrorCode\n*/\nenum ParseErrorCode {\n    kParseErrorNone = 0,                        //!< No error.\n\n    kParseErrorDocumentEmpty,                   //!< The document is empty.\n    kParseErrorDocumentRootNotSingular,         //!< The document root must not follow by other values.\n\n    kParseErrorValueInvalid,                    //!< Invalid value.\n\n    kParseErrorObjectMissName,                  //!< Missing a name for object member.\n    kParseErrorObjectMissColon,                 //!< Missing a colon after a name of object member.\n    kParseErrorObjectMissCommaOrCurlyBracket,   //!< Missing a comma or '}' after an object member.\n\n    kParseErrorArrayMissCommaOrSquareBracket,   //!< Missing a comma or ']' after an array element.\n\n    kParseErrorStringUnicodeEscapeInvalidHex,   //!< Incorrect hex digit after \\\\u escape in string.\n    kParseErrorStringUnicodeSurrogateInvalid,   //!< The surrogate pair in string is invalid.\n    kParseErrorStringEscapeInvalid,             //!< Invalid escape character in string.\n    kParseErrorStringMissQuotationMark,         //!< Missing a closing quotation mark in string.\n    kParseErrorStringInvalidEncoding,           //!< Invalid encoding in string.\n\n    kParseErrorNumberTooBig,                    //!< Number too big to be stored in double.\n    kParseErrorNumberMissFraction,              //!< Miss fraction part in number.\n    kParseErrorNumberMissExponent,              //!< Miss exponent in number.\n\n    kParseErrorTermination,                     //!< Parsing was terminated.\n    kParseErrorUnspecificSyntaxError,           //!< Unspecific syntax error.\n};\n\n//! Result of parsing (wraps ParseErrorCode)\n/*!\n    \\ingroup RAPIDJSON_ERRORS\n    \\code\n        Document doc;\n        ParseResult ok = doc.Parse(\"[42]\");\n        if (!ok) {\n            fprintf(stderr, \"JSON parse error: %s (%u)\",\n                    GetParseError_En(ok.Code()), ok.Offset());\n            exit(EXIT_FAILURE);\n        }\n    \\endcode\n    \\see GenericReader::Parse, GenericDocument::Parse\n*/\nstruct ParseResult {\n\n    //! Default constructor, no error.\n    ParseResult() : code_(kParseErrorNone), offset_(0) {}\n    //! Constructor to set an error.\n    ParseResult(ParseErrorCode code, size_t offset) : code_(code), offset_(offset) {}\n\n    //! Get the error code.\n    ParseErrorCode Code() const { return code_; }\n    //! Get the error offset, if \\ref IsError(), 0 otherwise.\n    size_t Offset() const { return offset_; }\n\n    //! Conversion to \\c bool, returns \\c true, iff !\\ref IsError().\n    operator bool() const { return !IsError(); }\n    //! Whether the result is an error.\n    bool IsError() const { return code_ != kParseErrorNone; }\n\n    bool operator==(const ParseResult& that) const { return code_ == that.code_; }\n    bool operator==(ParseErrorCode code) const { return code_ == code; }\n    friend bool operator==(ParseErrorCode code, const ParseResult & err) { return code == err.code_; }\n\n    //! Reset error code.\n    void Clear() { Set(kParseErrorNone); }\n    //! Update error code and offset.\n    void Set(ParseErrorCode code, size_t offset = 0) { code_ = code; offset_ = offset; }\n\nprivate:\n    ParseErrorCode code_;\n    size_t offset_;\n};\n\n//! Function pointer type of GetParseError().\n/*! \\ingroup RAPIDJSON_ERRORS\n\n    This is the prototype for \\c GetParseError_X(), where \\c X is a locale.\n    User can dynamically change locale in runtime, e.g.:\n\\code\n    GetParseErrorFunc GetParseError = GetParseError_En; // or whatever\n    const RAPIDJSON_ERROR_CHARTYPE* s = GetParseError(document.GetParseErrorCode());\n\\endcode\n*/\ntypedef const RAPIDJSON_ERROR_CHARTYPE* (*GetParseErrorFunc)(ParseErrorCode);\n\n} // namespace rapidjson\n\n#endif // RAPIDJSON_ERROR_ERROR_H__\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/filereadstream.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_FILEREADSTREAM_H_\n#define RAPIDJSON_FILEREADSTREAM_H_\n\n#include \"rapidjson.h\"\n#include <cstdio>\n\nnamespace rapidjson {\n\n//! File byte stream for input using fread().\n/*!\n    \\note implements Stream concept\n*/\nclass FileReadStream {\npublic:\n    typedef char Ch;    //!< Character type (byte).\n\n    //! Constructor.\n    /*!\n        \\param fp File pointer opened for read.\n        \\param buffer user-supplied buffer.\n        \\param bufferSize size of buffer in bytes. Must >=4 bytes.\n    */\n    FileReadStream(FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { \n        RAPIDJSON_ASSERT(fp_ != 0);\n        RAPIDJSON_ASSERT(bufferSize >= 4);\n        Read();\n    }\n\n    Ch Peek() const { return *current_; }\n    Ch Take() { Ch c = *current_; Read(); return c; }\n    size_t Tell() const { return count_ + static_cast<size_t>(current_ - buffer_); }\n\n    // Not implemented\n    void Put(Ch) { RAPIDJSON_ASSERT(false); }\n    void Flush() { RAPIDJSON_ASSERT(false); } \n    Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }\n    size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }\n\n    // For encoding detection only.\n    const Ch* Peek4() const {\n        return (current_ + 4 <= bufferLast_) ? current_ : 0;\n    }\n\nprivate:\n    void Read() {\n        if (current_ < bufferLast_)\n            ++current_;\n        else if (!eof_) {\n            count_ += readCount_;\n            readCount_ = fread(buffer_, 1, bufferSize_, fp_);\n            bufferLast_ = buffer_ + readCount_ - 1;\n            current_ = buffer_;\n\n            if (readCount_ < bufferSize_) {\n                buffer_[readCount_] = '\\0';\n                ++bufferLast_;\n                eof_ = true;\n            }\n        }\n    }\n\n    FILE* fp_;\n    Ch *buffer_;\n    size_t bufferSize_;\n    Ch *bufferLast_;\n    Ch *current_;\n    size_t readCount_;\n    size_t count_;  //!< Number of characters read\n    bool eof_;\n};\n\n} // namespace rapidjson\n\n#endif // RAPIDJSON_FILESTREAM_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/filestream.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_FILESTREAM_H_\n#define RAPIDJSON_FILESTREAM_H_\n\n#include \"rapidjson.h\"\n#include <cstdio>\n\nnamespace rapidjson {\n\n//! (Depreciated) Wrapper of C file stream for input or output.\n/*!\n    This simple wrapper does not check the validity of the stream.\n    \\note implements Stream concept\n    \\note deprecated: This was only for basic testing in version 0.1, it is found that the performance is very low by using fgetc(). Use FileReadStream instead.\n*/\nclass FileStream {\npublic:\n    typedef char Ch;    //!< Character type. Only support char.\n\n    FileStream(FILE* fp) : fp_(fp), current_('\\0'), count_(0) { Read(); }\n    char Peek() const { return current_; }\n    char Take() { char c = current_; Read(); return c; }\n    size_t Tell() const { return count_; }\n    void Put(char c) { fputc(c, fp_); }\n    void Flush() { fflush(fp_); }\n\n    // Not implemented\n    char* PutBegin() { return 0; }\n    size_t PutEnd(char*) { return 0; }\n\nprivate:\n    // Prohibit copy constructor & assignment operator.\n    FileStream(const FileStream&);\n    FileStream& operator=(const FileStream&);\n\n    void Read() {\n        RAPIDJSON_ASSERT(fp_ != 0);\n        int c = fgetc(fp_);\n        if (c != EOF) {\n            current_ = (char)c;\n            count_++;\n        }\n        else if (current_ != '\\0')\n            current_ = '\\0';\n    }\n\n    FILE* fp_;\n    char current_;\n    size_t count_;\n};\n\n} // namespace rapidjson\n\n#endif // RAPIDJSON_FILESTREAM_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/filewritestream.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_FILEWRITESTREAM_H_\n#define RAPIDJSON_FILEWRITESTREAM_H_\n\n#include \"rapidjson.h\"\n#include <cstdio>\n\nnamespace rapidjson {\n\n//! Wrapper of C file stream for input using fread().\n/*!\n    \\note implements Stream concept\n*/\nclass FileWriteStream {\npublic:\n    typedef char Ch;    //!< Character type. Only support char.\n\n    FileWriteStream(FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferEnd_(buffer + bufferSize), current_(buffer_) { \n        RAPIDJSON_ASSERT(fp_ != 0);\n    }\n\n    void Put(char c) { \n        if (current_ >= bufferEnd_)\n            Flush();\n\n        *current_++ = c;\n    }\n\n    void PutN(char c, size_t n) {\n        size_t avail = static_cast<size_t>(bufferEnd_ - current_);\n        while (n > avail) {\n            std::memset(current_, c, avail);\n            current_ += avail;\n            Flush();\n            n -= avail;\n            avail = static_cast<size_t>(bufferEnd_ - current_);\n        }\n\n        if (n > 0) {\n            std::memset(current_, c, n);\n            current_ += n;\n        }\n    }\n\n    void Flush() {\n        if (current_ != buffer_) {\n            fwrite(buffer_, 1, static_cast<size_t>(current_ - buffer_), fp_);\n            current_ = buffer_;\n        }\n    }\n\n    // Not implemented\n    char Peek() const { RAPIDJSON_ASSERT(false); return 0; }\n    char Take() { RAPIDJSON_ASSERT(false); return 0; }\n    size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; }\n    char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }\n    size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; }\n\nprivate:\n    // Prohibit copy constructor & assignment operator.\n    FileWriteStream(const FileWriteStream&);\n    FileWriteStream& operator=(const FileWriteStream&);\n\n    FILE* fp_;\n    char *buffer_;\n    char *bufferEnd_;\n    char *current_;\n};\n\n//! Implement specialized version of PutN() with memset() for better performance.\ntemplate<>\ninline void PutN(FileWriteStream& stream, char c, size_t n) {\n    stream.PutN(c, n);\n}\n\n} // namespace rapidjson\n\n#endif // RAPIDJSON_FILESTREAM_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/internal/dtoa.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n// This is a C++ header-only implementation of Grisu2 algorithm from the publication:\n// Loitsch, Florian. \"Printing floating-point numbers quickly and accurately with\n// integers.\" ACM Sigplan Notices 45.6 (2010): 233-243.\n\n#ifndef RAPIDJSON_DTOA_\n#define RAPIDJSON_DTOA_\n\n#if defined(_MSC_VER)\n#include <intrin.h>\n#if defined(_M_AMD64)\n#pragma intrinsic(_BitScanReverse64)\n#endif\n#endif\n\n#include \"itoa.h\" // GetDigitsLut()\n\nnamespace rapidjson {\nnamespace internal {\n\n#ifdef __GNUC__\nRAPIDJSON_DIAG_PUSH\nRAPIDJSON_DIAG_OFF(effc++)\n#endif\n\nstruct DiyFp {\n    DiyFp() {}\n\n    DiyFp(uint64_t f, int e) : f(f), e(e) {}\n\n    DiyFp(double d) {\n        union {\n            double d;\n            uint64_t u64;\n        } u = { d };\n\n        int biased_e = static_cast<int>((u.u64 & kDpExponentMask) >> kDpSignificandSize);\n        uint64_t significand = (u.u64 & kDpSignificandMask);\n        if (biased_e != 0) {\n            f = significand + kDpHiddenBit;\n            e = biased_e - kDpExponentBias;\n        } \n        else {\n            f = significand;\n            e = kDpMinExponent + 1;\n        }\n    }\n\n    DiyFp operator-(const DiyFp& rhs) const {\n        return DiyFp(f - rhs.f, e);\n    }\n\n    DiyFp operator*(const DiyFp& rhs) const {\n#if defined(_MSC_VER) && defined(_M_AMD64)\n        uint64_t h;\n        uint64_t l = _umul128(f, rhs.f, &h);\n        if (l & (uint64_t(1) << 63)) // rounding\n            h++;\n        return DiyFp(h, e + rhs.e + 64);\n#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__)\n        unsigned __int128 p = static_cast<unsigned __int128>(f) * static_cast<unsigned __int128>(rhs.f);\n        uint64_t h = static_cast<uint64_t>(p >> 64);\n        uint64_t l = static_cast<uint64_t>(p);\n        if (l & (uint64_t(1) << 63)) // rounding\n            h++;\n        return DiyFp(h, e + rhs.e + 64);\n#else\n        const uint64_t M32 = 0xFFFFFFFF;\n        const uint64_t a = f >> 32;\n        const uint64_t b = f & M32;\n        const uint64_t c = rhs.f >> 32;\n        const uint64_t d = rhs.f & M32;\n        const uint64_t ac = a * c;\n        const uint64_t bc = b * c;\n        const uint64_t ad = a * d;\n        const uint64_t bd = b * d;\n        uint64_t tmp = (bd >> 32) + (ad & M32) + (bc & M32);\n        tmp += 1U << 31;  /// mult_round\n        return DiyFp(ac + (ad >> 32) + (bc >> 32) + (tmp >> 32), e + rhs.e + 64);\n#endif\n    }\n\n    DiyFp Normalize() const {\n#if defined(_MSC_VER) && defined(_M_AMD64)\n        unsigned long index;\n        _BitScanReverse64(&index, f);\n        return DiyFp(f << (63 - index), e - (63 - index));\n#elif defined(__GNUC__)\n        int s = __builtin_clzll(f);\n        return DiyFp(f << s, e - s);\n#else\n        DiyFp res = *this;\n        while (!(res.f & kDpHiddenBit)) {\n            res.f <<= 1;\n            res.e--;\n        }\n        res.f <<= (kDiySignificandSize - kDpSignificandSize - 1);\n        res.e = res.e - (kDiySignificandSize - kDpSignificandSize - 1);\n        return res;\n#endif\n    }\n\n    DiyFp NormalizeBoundary() const {\n#if defined(_MSC_VER) && defined(_M_AMD64)\n        unsigned long index;\n        _BitScanReverse64(&index, f);\n        return DiyFp (f << (63 - index), e - (63 - index));\n#else\n        DiyFp res = *this;\n        while (!(res.f & (kDpHiddenBit << 1))) {\n            res.f <<= 1;\n            res.e--;\n        }\n        res.f <<= (kDiySignificandSize - kDpSignificandSize - 2);\n        res.e = res.e - (kDiySignificandSize - kDpSignificandSize - 2);\n        return res;\n#endif\n    }\n\n    void NormalizedBoundaries(DiyFp* minus, DiyFp* plus) const {\n        DiyFp pl = DiyFp((f << 1) + 1, e - 1).NormalizeBoundary();\n        DiyFp mi = (f == kDpHiddenBit) ? DiyFp((f << 2) - 1, e - 2) : DiyFp((f << 1) - 1, e - 1);\n        mi.f <<= mi.e - pl.e;\n        mi.e = pl.e;\n        *plus = pl;\n        *minus = mi;\n    }\n\n    static const int kDiySignificandSize = 64;\n    static const int kDpSignificandSize = 52;\n    static const int kDpExponentBias = 0x3FF + kDpSignificandSize;\n    static const int kDpMinExponent = -kDpExponentBias;\n    static const uint64_t kDpExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000);\n    static const uint64_t kDpSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF);\n    static const uint64_t kDpHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000);\n\n    uint64_t f;\n    int e;\n};\n\ninline DiyFp GetCachedPower(int e, int* K) {\n    // 10^-348, 10^-340, ..., 10^340\n    static const uint64_t kCachedPowers_F[] = {\n        RAPIDJSON_UINT64_C2(0xfa8fd5a0, 0x081c0288), RAPIDJSON_UINT64_C2(0xbaaee17f, 0xa23ebf76),\n        RAPIDJSON_UINT64_C2(0x8b16fb20, 0x3055ac76), RAPIDJSON_UINT64_C2(0xcf42894a, 0x5dce35ea),\n        RAPIDJSON_UINT64_C2(0x9a6bb0aa, 0x55653b2d), RAPIDJSON_UINT64_C2(0xe61acf03, 0x3d1a45df),\n        RAPIDJSON_UINT64_C2(0xab70fe17, 0xc79ac6ca), RAPIDJSON_UINT64_C2(0xff77b1fc, 0xbebcdc4f),\n        RAPIDJSON_UINT64_C2(0xbe5691ef, 0x416bd60c), RAPIDJSON_UINT64_C2(0x8dd01fad, 0x907ffc3c),\n        RAPIDJSON_UINT64_C2(0xd3515c28, 0x31559a83), RAPIDJSON_UINT64_C2(0x9d71ac8f, 0xada6c9b5),\n        RAPIDJSON_UINT64_C2(0xea9c2277, 0x23ee8bcb), RAPIDJSON_UINT64_C2(0xaecc4991, 0x4078536d),\n        RAPIDJSON_UINT64_C2(0x823c1279, 0x5db6ce57), RAPIDJSON_UINT64_C2(0xc2109436, 0x4dfb5637),\n        RAPIDJSON_UINT64_C2(0x9096ea6f, 0x3848984f), RAPIDJSON_UINT64_C2(0xd77485cb, 0x25823ac7),\n        RAPIDJSON_UINT64_C2(0xa086cfcd, 0x97bf97f4), RAPIDJSON_UINT64_C2(0xef340a98, 0x172aace5),\n        RAPIDJSON_UINT64_C2(0xb23867fb, 0x2a35b28e), RAPIDJSON_UINT64_C2(0x84c8d4df, 0xd2c63f3b),\n        RAPIDJSON_UINT64_C2(0xc5dd4427, 0x1ad3cdba), RAPIDJSON_UINT64_C2(0x936b9fce, 0xbb25c996),\n        RAPIDJSON_UINT64_C2(0xdbac6c24, 0x7d62a584), RAPIDJSON_UINT64_C2(0xa3ab6658, 0x0d5fdaf6),\n        RAPIDJSON_UINT64_C2(0xf3e2f893, 0xdec3f126), RAPIDJSON_UINT64_C2(0xb5b5ada8, 0xaaff80b8),\n        RAPIDJSON_UINT64_C2(0x87625f05, 0x6c7c4a8b), RAPIDJSON_UINT64_C2(0xc9bcff60, 0x34c13053),\n        RAPIDJSON_UINT64_C2(0x964e858c, 0x91ba2655), RAPIDJSON_UINT64_C2(0xdff97724, 0x70297ebd),\n        RAPIDJSON_UINT64_C2(0xa6dfbd9f, 0xb8e5b88f), RAPIDJSON_UINT64_C2(0xf8a95fcf, 0x88747d94),\n        RAPIDJSON_UINT64_C2(0xb9447093, 0x8fa89bcf), RAPIDJSON_UINT64_C2(0x8a08f0f8, 0xbf0f156b),\n        RAPIDJSON_UINT64_C2(0xcdb02555, 0x653131b6), RAPIDJSON_UINT64_C2(0x993fe2c6, 0xd07b7fac),\n        RAPIDJSON_UINT64_C2(0xe45c10c4, 0x2a2b3b06), RAPIDJSON_UINT64_C2(0xaa242499, 0x697392d3),\n        RAPIDJSON_UINT64_C2(0xfd87b5f2, 0x8300ca0e), RAPIDJSON_UINT64_C2(0xbce50864, 0x92111aeb),\n        RAPIDJSON_UINT64_C2(0x8cbccc09, 0x6f5088cc), RAPIDJSON_UINT64_C2(0xd1b71758, 0xe219652c),\n        RAPIDJSON_UINT64_C2(0x9c400000, 0x00000000), RAPIDJSON_UINT64_C2(0xe8d4a510, 0x00000000),\n        RAPIDJSON_UINT64_C2(0xad78ebc5, 0xac620000), RAPIDJSON_UINT64_C2(0x813f3978, 0xf8940984),\n        RAPIDJSON_UINT64_C2(0xc097ce7b, 0xc90715b3), RAPIDJSON_UINT64_C2(0x8f7e32ce, 0x7bea5c70),\n        RAPIDJSON_UINT64_C2(0xd5d238a4, 0xabe98068), RAPIDJSON_UINT64_C2(0x9f4f2726, 0x179a2245),\n        RAPIDJSON_UINT64_C2(0xed63a231, 0xd4c4fb27), RAPIDJSON_UINT64_C2(0xb0de6538, 0x8cc8ada8),\n        RAPIDJSON_UINT64_C2(0x83c7088e, 0x1aab65db), RAPIDJSON_UINT64_C2(0xc45d1df9, 0x42711d9a),\n        RAPIDJSON_UINT64_C2(0x924d692c, 0xa61be758), RAPIDJSON_UINT64_C2(0xda01ee64, 0x1a708dea),\n        RAPIDJSON_UINT64_C2(0xa26da399, 0x9aef774a), RAPIDJSON_UINT64_C2(0xf209787b, 0xb47d6b85),\n        RAPIDJSON_UINT64_C2(0xb454e4a1, 0x79dd1877), RAPIDJSON_UINT64_C2(0x865b8692, 0x5b9bc5c2),\n        RAPIDJSON_UINT64_C2(0xc83553c5, 0xc8965d3d), RAPIDJSON_UINT64_C2(0x952ab45c, 0xfa97a0b3),\n        RAPIDJSON_UINT64_C2(0xde469fbd, 0x99a05fe3), RAPIDJSON_UINT64_C2(0xa59bc234, 0xdb398c25),\n        RAPIDJSON_UINT64_C2(0xf6c69a72, 0xa3989f5c), RAPIDJSON_UINT64_C2(0xb7dcbf53, 0x54e9bece),\n        RAPIDJSON_UINT64_C2(0x88fcf317, 0xf22241e2), RAPIDJSON_UINT64_C2(0xcc20ce9b, 0xd35c78a5),\n        RAPIDJSON_UINT64_C2(0x98165af3, 0x7b2153df), RAPIDJSON_UINT64_C2(0xe2a0b5dc, 0x971f303a),\n        RAPIDJSON_UINT64_C2(0xa8d9d153, 0x5ce3b396), RAPIDJSON_UINT64_C2(0xfb9b7cd9, 0xa4a7443c),\n        RAPIDJSON_UINT64_C2(0xbb764c4c, 0xa7a44410), RAPIDJSON_UINT64_C2(0x8bab8eef, 0xb6409c1a),\n        RAPIDJSON_UINT64_C2(0xd01fef10, 0xa657842c), RAPIDJSON_UINT64_C2(0x9b10a4e5, 0xe9913129),\n        RAPIDJSON_UINT64_C2(0xe7109bfb, 0xa19c0c9d), RAPIDJSON_UINT64_C2(0xac2820d9, 0x623bf429),\n        RAPIDJSON_UINT64_C2(0x80444b5e, 0x7aa7cf85), RAPIDJSON_UINT64_C2(0xbf21e440, 0x03acdd2d),\n        RAPIDJSON_UINT64_C2(0x8e679c2f, 0x5e44ff8f), RAPIDJSON_UINT64_C2(0xd433179d, 0x9c8cb841),\n        RAPIDJSON_UINT64_C2(0x9e19db92, 0xb4e31ba9), RAPIDJSON_UINT64_C2(0xeb96bf6e, 0xbadf77d9),\n        RAPIDJSON_UINT64_C2(0xaf87023b, 0x9bf0ee6b)\n    };\n    static const int16_t kCachedPowers_E[] = {\n        -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007,  -980,\n         -954,  -927,  -901,  -874,  -847,  -821,  -794,  -768,  -741,  -715,\n         -688,  -661,  -635,  -608,  -582,  -555,  -529,  -502,  -475,  -449,\n         -422,  -396,  -369,  -343,  -316,  -289,  -263,  -236,  -210,  -183,\n         -157,  -130,  -103,   -77,   -50,   -24,     3,    30,    56,    83,\n          109,   136,   162,   189,   216,   242,   269,   295,   322,   348,\n          375,   402,   428,   455,   481,   508,   534,   561,   588,   614,\n          641,   667,   694,   720,   747,   774,   800,   827,   853,   880,\n          907,   933,   960,   986,  1013,  1039,  1066\n    };\n\n    //int k = static_cast<int>(ceil((-61 - e) * 0.30102999566398114)) + 374;\n    double dk = (-61 - e) * 0.30102999566398114 + 347;  // dk must be positive, so can do ceiling in positive\n    int k = static_cast<int>(dk);\n    if (k != dk)\n        k++;\n\n    unsigned index = static_cast<unsigned>((k >> 3) + 1);\n    *K = -(-348 + static_cast<int>(index << 3));    // decimal exponent no need lookup table\n\n    return DiyFp(kCachedPowers_F[index], kCachedPowers_E[index]);\n}\n\ninline void GrisuRound(char* buffer, int len, uint64_t delta, uint64_t rest, uint64_t ten_kappa, uint64_t wp_w) {\n    while (rest < wp_w && delta - rest >= ten_kappa &&\n           (rest + ten_kappa < wp_w ||  /// closer\n            wp_w - rest > rest + ten_kappa - wp_w)) {\n        buffer[len - 1]--;\n        rest += ten_kappa;\n    }\n}\n\ninline unsigned CountDecimalDigit32(uint32_t n) {\n    // Simple pure C++ implementation was faster than __builtin_clz version in this situation.\n    if (n < 10) return 1;\n    if (n < 100) return 2;\n    if (n < 1000) return 3;\n    if (n < 10000) return 4;\n    if (n < 100000) return 5;\n    if (n < 1000000) return 6;\n    if (n < 10000000) return 7;\n    if (n < 100000000) return 8;\n    if (n < 1000000000) return 9;\n    return 10;\n}\n\ninline void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int* len, int* K) {\n    static const uint32_t kPow10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 };\n    const DiyFp one(uint64_t(1) << -Mp.e, Mp.e);\n    const DiyFp wp_w = Mp - W;\n    uint32_t p1 = static_cast<uint32_t>(Mp.f >> -one.e);\n    uint64_t p2 = Mp.f & (one.f - 1);\n    int kappa = CountDecimalDigit32(p1);\n    *len = 0;\n\n    while (kappa > 0) {\n        uint32_t d;\n        switch (kappa) {\n            case 10: d = p1 / 1000000000; p1 %= 1000000000; break;\n            case  9: d = p1 /  100000000; p1 %=  100000000; break;\n            case  8: d = p1 /   10000000; p1 %=   10000000; break;\n            case  7: d = p1 /    1000000; p1 %=    1000000; break;\n            case  6: d = p1 /     100000; p1 %=     100000; break;\n            case  5: d = p1 /      10000; p1 %=      10000; break;\n            case  4: d = p1 /       1000; p1 %=       1000; break;\n            case  3: d = p1 /        100; p1 %=        100; break;\n            case  2: d = p1 /         10; p1 %=         10; break;\n            case  1: d = p1;              p1 =           0; break;\n            default: \n#if defined(_MSC_VER)\n                __assume(0);\n#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)\n                __builtin_unreachable();\n#else\n                d = 0;\n#endif\n        }\n        if (d || *len)\n            buffer[(*len)++] = static_cast<char>('0' + static_cast<char>(d));\n        kappa--;\n        uint64_t tmp = (static_cast<uint64_t>(p1) << -one.e) + p2;\n        if (tmp <= delta) {\n            *K += kappa;\n            GrisuRound(buffer, *len, delta, tmp, static_cast<uint64_t>(kPow10[kappa]) << -one.e, wp_w.f);\n            return;\n        }\n    }\n\n    // kappa = 0\n    for (;;) {\n        p2 *= 10;\n        delta *= 10;\n        char d = static_cast<char>(p2 >> -one.e);\n        if (d || *len)\n            buffer[(*len)++] = static_cast<char>('0' + d);\n        p2 &= one.f - 1;\n        kappa--;\n        if (p2 < delta) {\n            *K += kappa;\n            GrisuRound(buffer, *len, delta, p2, one.f, wp_w.f * kPow10[-kappa]);\n            return;\n        }\n    }\n}\n\ninline void Grisu2(double value, char* buffer, int* length, int* K) {\n    const DiyFp v(value);\n    DiyFp w_m, w_p;\n    v.NormalizedBoundaries(&w_m, &w_p);\n\n    const DiyFp c_mk = GetCachedPower(w_p.e, K);\n    const DiyFp W = v.Normalize() * c_mk;\n    DiyFp Wp = w_p * c_mk;\n    DiyFp Wm = w_m * c_mk;\n    Wm.f++;\n    Wp.f--;\n    DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K);\n}\n\ninline char* WriteExponent(int K, char* buffer) {\n    if (K < 0) {\n        *buffer++ = '-';\n        K = -K;\n    }\n\n    if (K >= 100) {\n        *buffer++ = static_cast<char>('0' + static_cast<char>(K / 100));\n        K %= 100;\n        const char* d = GetDigitsLut() + K * 2;\n        *buffer++ = d[0];\n        *buffer++ = d[1];\n    }\n    else if (K >= 10) {\n        const char* d = GetDigitsLut() + K * 2;\n        *buffer++ = d[0];\n        *buffer++ = d[1];\n    }\n    else\n        *buffer++ = static_cast<char>('0' + static_cast<char>(K));\n\n    return buffer;\n}\n\ninline char* Prettify(char* buffer, int length, int k) {\n    const int kk = length + k;  // 10^(kk-1) <= v < 10^kk\n\n    if (length <= kk && kk <= 21) {\n        // 1234e7 -> 12340000000\n        for (int i = length; i < kk; i++)\n            buffer[i] = '0';\n        buffer[kk] = '.';\n        buffer[kk + 1] = '0';\n        return &buffer[kk + 2];\n    }\n    else if (0 < kk && kk <= 21) {\n        // 1234e-2 -> 12.34\n        std::memmove(&buffer[kk + 1], &buffer[kk], length - kk);\n        buffer[kk] = '.';\n        return &buffer[length + 1];\n    }\n    else if (-6 < kk && kk <= 0) {\n        // 1234e-6 -> 0.001234\n        const int offset = 2 - kk;\n        std::memmove(&buffer[offset], &buffer[0], length);\n        buffer[0] = '0';\n        buffer[1] = '.';\n        for (int i = 2; i < offset; i++)\n            buffer[i] = '0';\n        return &buffer[length + offset];\n    }\n    else if (length == 1) {\n        // 1e30\n        buffer[1] = 'e';\n        return WriteExponent(kk - 1, &buffer[2]);\n    }\n    else {\n        // 1234e30 -> 1.234e33\n        std::memmove(&buffer[2], &buffer[1], length - 1);\n        buffer[1] = '.';\n        buffer[length + 1] = 'e';\n        return WriteExponent(kk - 1, &buffer[0 + length + 2]);\n    }\n}\n\ninline char* dtoa(double value, char* buffer) {\n    if (value == 0) {\n        buffer[0] = '0';\n        buffer[1] = '.';\n        buffer[2] = '0';\n        return &buffer[3];\n    }\n    else {\n        if (value < 0) {\n            *buffer++ = '-';\n            value = -value;\n        }\n        int length, K;\n        Grisu2(value, buffer, &length, &K);\n        return Prettify(buffer, length, K);\n    }\n}\n\n#ifdef __GNUC__\nRAPIDJSON_DIAG_POP\n#endif\n\n} // namespace internal\n} // namespace rapidjson\n\n#endif // RAPIDJSON_DTOA_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/internal/itoa.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_ITOA_\n#define RAPIDJSON_ITOA_\n\nnamespace rapidjson {\nnamespace internal {\n\ninline const char* GetDigitsLut() {\n    static const char cDigitsLut[200] = {\n        '0','0','0','1','0','2','0','3','0','4','0','5','0','6','0','7','0','8','0','9',\n        '1','0','1','1','1','2','1','3','1','4','1','5','1','6','1','7','1','8','1','9',\n        '2','0','2','1','2','2','2','3','2','4','2','5','2','6','2','7','2','8','2','9',\n        '3','0','3','1','3','2','3','3','3','4','3','5','3','6','3','7','3','8','3','9',\n        '4','0','4','1','4','2','4','3','4','4','4','5','4','6','4','7','4','8','4','9',\n        '5','0','5','1','5','2','5','3','5','4','5','5','5','6','5','7','5','8','5','9',\n        '6','0','6','1','6','2','6','3','6','4','6','5','6','6','6','7','6','8','6','9',\n        '7','0','7','1','7','2','7','3','7','4','7','5','7','6','7','7','7','8','7','9',\n        '8','0','8','1','8','2','8','3','8','4','8','5','8','6','8','7','8','8','8','9',\n        '9','0','9','1','9','2','9','3','9','4','9','5','9','6','9','7','9','8','9','9'\n    };\n    return cDigitsLut;\n}\n\ninline char* u32toa(uint32_t value, char* buffer) {\n    const char* cDigitsLut = GetDigitsLut();\n\n    if (value < 10000) {\n        const uint32_t d1 = (value / 100) << 1;\n        const uint32_t d2 = (value % 100) << 1;\n        \n        if (value >= 1000)\n            *buffer++ = cDigitsLut[d1];\n        if (value >= 100)\n            *buffer++ = cDigitsLut[d1 + 1];\n        if (value >= 10)\n            *buffer++ = cDigitsLut[d2];\n        *buffer++ = cDigitsLut[d2 + 1];\n    }\n    else if (value < 100000000) {\n        // value = bbbbcccc\n        const uint32_t b = value / 10000;\n        const uint32_t c = value % 10000;\n        \n        const uint32_t d1 = (b / 100) << 1;\n        const uint32_t d2 = (b % 100) << 1;\n        \n        const uint32_t d3 = (c / 100) << 1;\n        const uint32_t d4 = (c % 100) << 1;\n        \n        if (value >= 10000000)\n            *buffer++ = cDigitsLut[d1];\n        if (value >= 1000000)\n            *buffer++ = cDigitsLut[d1 + 1];\n        if (value >= 100000)\n            *buffer++ = cDigitsLut[d2];\n        *buffer++ = cDigitsLut[d2 + 1];\n        \n        *buffer++ = cDigitsLut[d3];\n        *buffer++ = cDigitsLut[d3 + 1];\n        *buffer++ = cDigitsLut[d4];\n        *buffer++ = cDigitsLut[d4 + 1];\n    }\n    else {\n        // value = aabbbbcccc in decimal\n        \n        const uint32_t a = value / 100000000; // 1 to 42\n        value %= 100000000;\n        \n        if (a >= 10) {\n            const unsigned i = a << 1;\n            *buffer++ = cDigitsLut[i];\n            *buffer++ = cDigitsLut[i + 1];\n        }\n        else\n            *buffer++ = static_cast<char>('0' + static_cast<char>(a));\n\n        const uint32_t b = value / 10000; // 0 to 9999\n        const uint32_t c = value % 10000; // 0 to 9999\n        \n        const uint32_t d1 = (b / 100) << 1;\n        const uint32_t d2 = (b % 100) << 1;\n        \n        const uint32_t d3 = (c / 100) << 1;\n        const uint32_t d4 = (c % 100) << 1;\n        \n        *buffer++ = cDigitsLut[d1];\n        *buffer++ = cDigitsLut[d1 + 1];\n        *buffer++ = cDigitsLut[d2];\n        *buffer++ = cDigitsLut[d2 + 1];\n        *buffer++ = cDigitsLut[d3];\n        *buffer++ = cDigitsLut[d3 + 1];\n        *buffer++ = cDigitsLut[d4];\n        *buffer++ = cDigitsLut[d4 + 1];\n    }\n    return buffer;\n}\n\ninline char* i32toa(int32_t value, char* buffer) {\n    if (value < 0) {\n        *buffer++ = '-';\n        value = -value;\n    }\n\n    return u32toa(static_cast<uint32_t>(value), buffer);\n}\n\ninline char* u64toa(uint64_t value, char* buffer) {\n    const char* cDigitsLut = GetDigitsLut();\n    const uint64_t  kTen8 = 100000000;\n    const uint64_t  kTen9 = kTen8 * 10;\n    const uint64_t kTen10 = kTen8 * 100;\n    const uint64_t kTen11 = kTen8 * 1000;\n    const uint64_t kTen12 = kTen8 * 10000;\n    const uint64_t kTen13 = kTen8 * 100000;\n    const uint64_t kTen14 = kTen8 * 1000000;\n    const uint64_t kTen15 = kTen8 * 10000000;\n    const uint64_t kTen16 = kTen8 * kTen8;\n    \n    if (value < kTen8) {\n        uint32_t v = static_cast<uint32_t>(value);\n        if (v < 10000) {\n            const uint32_t d1 = (v / 100) << 1;\n            const uint32_t d2 = (v % 100) << 1;\n            \n            if (v >= 1000)\n                *buffer++ = cDigitsLut[d1];\n            if (v >= 100)\n                *buffer++ = cDigitsLut[d1 + 1];\n            if (v >= 10)\n                *buffer++ = cDigitsLut[d2];\n            *buffer++ = cDigitsLut[d2 + 1];\n        }\n        else {\n            // value = bbbbcccc\n            const uint32_t b = v / 10000;\n            const uint32_t c = v % 10000;\n            \n            const uint32_t d1 = (b / 100) << 1;\n            const uint32_t d2 = (b % 100) << 1;\n            \n            const uint32_t d3 = (c / 100) << 1;\n            const uint32_t d4 = (c % 100) << 1;\n            \n            if (value >= 10000000)\n                *buffer++ = cDigitsLut[d1];\n            if (value >= 1000000)\n                *buffer++ = cDigitsLut[d1 + 1];\n            if (value >= 100000)\n                *buffer++ = cDigitsLut[d2];\n            *buffer++ = cDigitsLut[d2 + 1];\n            \n            *buffer++ = cDigitsLut[d3];\n            *buffer++ = cDigitsLut[d3 + 1];\n            *buffer++ = cDigitsLut[d4];\n            *buffer++ = cDigitsLut[d4 + 1];\n        }\n    }\n    else if (value < kTen16) {\n        const uint32_t v0 = static_cast<uint32_t>(value / kTen8);\n        const uint32_t v1 = static_cast<uint32_t>(value % kTen8);\n        \n        const uint32_t b0 = v0 / 10000;\n        const uint32_t c0 = v0 % 10000;\n        \n        const uint32_t d1 = (b0 / 100) << 1;\n        const uint32_t d2 = (b0 % 100) << 1;\n        \n        const uint32_t d3 = (c0 / 100) << 1;\n        const uint32_t d4 = (c0 % 100) << 1;\n\n        const uint32_t b1 = v1 / 10000;\n        const uint32_t c1 = v1 % 10000;\n        \n        const uint32_t d5 = (b1 / 100) << 1;\n        const uint32_t d6 = (b1 % 100) << 1;\n        \n        const uint32_t d7 = (c1 / 100) << 1;\n        const uint32_t d8 = (c1 % 100) << 1;\n\n        if (value >= kTen15)\n            *buffer++ = cDigitsLut[d1];\n        if (value >= kTen14)\n            *buffer++ = cDigitsLut[d1 + 1];\n        if (value >= kTen13)\n            *buffer++ = cDigitsLut[d2];\n        if (value >= kTen12)\n            *buffer++ = cDigitsLut[d2 + 1];\n        if (value >= kTen11)\n            *buffer++ = cDigitsLut[d3];\n        if (value >= kTen10)\n            *buffer++ = cDigitsLut[d3 + 1];\n        if (value >= kTen9)\n            *buffer++ = cDigitsLut[d4];\n        if (value >= kTen8)\n            *buffer++ = cDigitsLut[d4 + 1];\n        \n        *buffer++ = cDigitsLut[d5];\n        *buffer++ = cDigitsLut[d5 + 1];\n        *buffer++ = cDigitsLut[d6];\n        *buffer++ = cDigitsLut[d6 + 1];\n        *buffer++ = cDigitsLut[d7];\n        *buffer++ = cDigitsLut[d7 + 1];\n        *buffer++ = cDigitsLut[d8];\n        *buffer++ = cDigitsLut[d8 + 1];\n    }\n    else {\n        const uint32_t a = static_cast<uint32_t>(value / kTen16); // 1 to 1844\n        value %= kTen16;\n        \n        if (a < 10)\n            *buffer++ = static_cast<char>('0' + static_cast<char>(a));\n        else if (a < 100) {\n            const uint32_t i = a << 1;\n            *buffer++ = cDigitsLut[i];\n            *buffer++ = cDigitsLut[i + 1];\n        }\n        else if (a < 1000) {\n            *buffer++ = static_cast<char>('0' + static_cast<char>(a / 100));\n            \n            const uint32_t i = (a % 100) << 1;\n            *buffer++ = cDigitsLut[i];\n            *buffer++ = cDigitsLut[i + 1];\n        }\n        else {\n            const uint32_t i = (a / 100) << 1;\n            const uint32_t j = (a % 100) << 1;\n            *buffer++ = cDigitsLut[i];\n            *buffer++ = cDigitsLut[i + 1];\n            *buffer++ = cDigitsLut[j];\n            *buffer++ = cDigitsLut[j + 1];\n        }\n        \n        const uint32_t v0 = static_cast<uint32_t>(value / kTen8);\n        const uint32_t v1 = static_cast<uint32_t>(value % kTen8);\n        \n        const uint32_t b0 = v0 / 10000;\n        const uint32_t c0 = v0 % 10000;\n        \n        const uint32_t d1 = (b0 / 100) << 1;\n        const uint32_t d2 = (b0 % 100) << 1;\n        \n        const uint32_t d3 = (c0 / 100) << 1;\n        const uint32_t d4 = (c0 % 100) << 1;\n        \n        const uint32_t b1 = v1 / 10000;\n        const uint32_t c1 = v1 % 10000;\n        \n        const uint32_t d5 = (b1 / 100) << 1;\n        const uint32_t d6 = (b1 % 100) << 1;\n        \n        const uint32_t d7 = (c1 / 100) << 1;\n        const uint32_t d8 = (c1 % 100) << 1;\n        \n        *buffer++ = cDigitsLut[d1];\n        *buffer++ = cDigitsLut[d1 + 1];\n        *buffer++ = cDigitsLut[d2];\n        *buffer++ = cDigitsLut[d2 + 1];\n        *buffer++ = cDigitsLut[d3];\n        *buffer++ = cDigitsLut[d3 + 1];\n        *buffer++ = cDigitsLut[d4];\n        *buffer++ = cDigitsLut[d4 + 1];\n        *buffer++ = cDigitsLut[d5];\n        *buffer++ = cDigitsLut[d5 + 1];\n        *buffer++ = cDigitsLut[d6];\n        *buffer++ = cDigitsLut[d6 + 1];\n        *buffer++ = cDigitsLut[d7];\n        *buffer++ = cDigitsLut[d7 + 1];\n        *buffer++ = cDigitsLut[d8];\n        *buffer++ = cDigitsLut[d8 + 1];\n    }\n    \n    return buffer;\n}\n\ninline char* i64toa(int64_t value, char* buffer) {\n    if (value < 0) {\n        *buffer++ = '-';\n        value = -value;\n    }\n\n    return u64toa(static_cast<uint64_t>(value), buffer);\n}\n\n} // namespace internal\n} // namespace rapidjson\n\n#endif // RAPIDJSON_ITOA_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/internal/meta.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_INTERNAL_META_H_\n#define RAPIDJSON_INTERNAL_META_H_\n\n#ifndef RAPIDJSON_RAPIDJSON_H_\n#error <rapidjson.h> not yet included. Do not include this file directly.\n#endif\n\n#ifdef __GNUC__\nRAPIDJSON_DIAG_PUSH\nRAPIDJSON_DIAG_OFF(effc++)\n#endif\n#if defined(_MSC_VER)\nRAPIDJSON_DIAG_PUSH\nRAPIDJSON_DIAG_OFF(6334)\n#endif\n\n#if RAPIDJSON_HAS_CXX11_TYPETRAITS\n#include <type_traits>\n#endif\n\n//@cond RAPIDJSON_INTERNAL\nnamespace rapidjson {\nnamespace internal {\n\n// Helper to wrap/convert arbitrary types to void, useful for arbitrary type matching\ntemplate <typename T> struct Void { typedef void Type; };\n\n///////////////////////////////////////////////////////////////////////////////\n// BoolType, TrueType, FalseType\n//\ntemplate <bool Cond> struct BoolType {\n    static const bool Value = Cond;\n    typedef BoolType Type;\n};\ntypedef BoolType<true> TrueType;\ntypedef BoolType<false> FalseType;\n\n\n///////////////////////////////////////////////////////////////////////////////\n// SelectIf, BoolExpr, NotExpr, AndExpr, OrExpr\n//\n\ntemplate <bool C> struct SelectIfImpl { template <typename T1, typename T2> struct Apply { typedef T1 Type; }; };\ntemplate <> struct SelectIfImpl<false> { template <typename T1, typename T2> struct Apply { typedef T2 Type; }; };\ntemplate <bool C, typename T1, typename T2> struct SelectIfCond : SelectIfImpl<C>::template Apply<T1,T2> {};\ntemplate <typename C, typename T1, typename T2> struct SelectIf : SelectIfCond<C::Value, T1, T2> {};\n\ntemplate <bool Cond1, bool Cond2> struct AndExprCond : FalseType {};\ntemplate <> struct AndExprCond<true, true> : TrueType {};\ntemplate <bool Cond1, bool Cond2> struct OrExprCond : TrueType {};\ntemplate <> struct OrExprCond<false, false> : FalseType {};\n\ntemplate <typename C> struct BoolExpr : SelectIf<C,TrueType,FalseType>::Type {};\ntemplate <typename C> struct NotExpr  : SelectIf<C,FalseType,TrueType>::Type {};\ntemplate <typename C1, typename C2> struct AndExpr : AndExprCond<C1::Value, C2::Value>::Type {};\ntemplate <typename C1, typename C2> struct OrExpr  : OrExprCond<C1::Value, C2::Value>::Type {};\n\n\n///////////////////////////////////////////////////////////////////////////////\n// AddConst, MaybeAddConst, RemoveConst\ntemplate <typename T> struct AddConst { typedef const T Type; };\ntemplate <bool Constify, typename T> struct MaybeAddConst : SelectIfCond<Constify, const T, T> {};\ntemplate <typename T> struct RemoveConst { typedef T Type; };\ntemplate <typename T> struct RemoveConst<const T> { typedef T Type; };\n\n\n///////////////////////////////////////////////////////////////////////////////\n// IsSame, IsConst, IsMoreConst, IsPointer\n//\ntemplate <typename T, typename U> struct IsSame : FalseType {};\ntemplate <typename T> struct IsSame<T, T> : TrueType {};\n\ntemplate <typename T> struct IsConst : FalseType {};\ntemplate <typename T> struct IsConst<const T> : TrueType {};\n\ntemplate <typename CT, typename T>\nstruct IsMoreConst\n    : AndExpr<IsSame<typename RemoveConst<CT>::Type, typename RemoveConst<T>::Type>,\n              BoolType<IsConst<CT>::Value >= IsConst<T>::Value> >::Type {};\n\ntemplate <typename T> struct IsPointer : FalseType {};\ntemplate <typename T> struct IsPointer<T*> : TrueType {};\n\n///////////////////////////////////////////////////////////////////////////////\n// IsBaseOf\n//\n#if RAPIDJSON_HAS_CXX11_TYPETRAITS\n\ntemplate <typename B, typename D> struct IsBaseOf\n    : BoolType< ::std::is_base_of<B,D>::value> {};\n\n#else // simplified version adopted from Boost\n\ntemplate<typename B, typename D> struct IsBaseOfImpl {\n    RAPIDJSON_STATIC_ASSERT(sizeof(B) != 0);\n    RAPIDJSON_STATIC_ASSERT(sizeof(D) != 0);\n\n    typedef char (&Yes)[1];\n    typedef char (&No) [2];\n\n    template <typename T>\n    static Yes Check(const D*, T);\n    static No  Check(const B*, int);\n\n    struct Host {\n        operator const B*() const;\n        operator const D*();\n    };\n\n    enum { Value = (sizeof(Check(Host(), 0)) == sizeof(Yes)) };\n};\n\ntemplate <typename B, typename D> struct IsBaseOf\n    : OrExpr<IsSame<B, D>, BoolExpr<IsBaseOfImpl<B, D> > >::Type {};\n\n#endif // RAPIDJSON_HAS_CXX11_TYPETRAITS\n\n\n//////////////////////////////////////////////////////////////////////////\n// EnableIf / DisableIf\n//\ntemplate <bool Condition, typename T = void> struct EnableIfCond  { typedef T Type; };\ntemplate <typename T> struct EnableIfCond<false, T> { /* empty */ };\n\ntemplate <bool Condition, typename T = void> struct DisableIfCond { typedef T Type; };\ntemplate <typename T> struct DisableIfCond<true, T> { /* empty */ };\n\ntemplate <typename Condition, typename T = void>\nstruct EnableIf : EnableIfCond<Condition::Value, T> {};\n\ntemplate <typename Condition, typename T = void>\nstruct DisableIf : DisableIfCond<Condition::Value, T> {};\n\n// SFINAE helpers\nstruct SfinaeTag {};\ntemplate <typename T> struct RemoveSfinaeTag;\ntemplate <typename T> struct RemoveSfinaeTag<SfinaeTag&(*)(T)> { typedef T Type; };\n\n#define RAPIDJSON_REMOVEFPTR_(type) \\\n    typename ::rapidjson::internal::RemoveSfinaeTag \\\n        < ::rapidjson::internal::SfinaeTag&(*) type>::Type\n\n#define RAPIDJSON_ENABLEIF(cond) \\\n    typename ::rapidjson::internal::EnableIf \\\n        <RAPIDJSON_REMOVEFPTR_(cond)>::Type * = NULL\n\n#define RAPIDJSON_DISABLEIF(cond) \\\n    typename ::rapidjson::internal::DisableIf \\\n        <RAPIDJSON_REMOVEFPTR_(cond)>::Type * = NULL\n\n#define RAPIDJSON_ENABLEIF_RETURN(cond,returntype) \\\n    typename ::rapidjson::internal::EnableIf \\\n        <RAPIDJSON_REMOVEFPTR_(cond), \\\n         RAPIDJSON_REMOVEFPTR_(returntype)>::Type\n\n#define RAPIDJSON_DISABLEIF_RETURN(cond,returntype) \\\n    typename ::rapidjson::internal::DisableIf \\\n        <RAPIDJSON_REMOVEFPTR_(cond), \\\n         RAPIDJSON_REMOVEFPTR_(returntype)>::Type\n\n} // namespace internal\n} // namespace rapidjson\n//@endcond\n\n#if defined(__GNUC__) || defined(_MSC_VER)\nRAPIDJSON_DIAG_POP\n#endif\n\n#endif // RAPIDJSON_INTERNAL_META_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/internal/pow10.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_POW10_\n#define RAPIDJSON_POW10_\n\nnamespace rapidjson {\nnamespace internal {\n\n//! Computes integer powers of 10 in double (10.0^n).\n/*! This function uses lookup table for fast and accurate results.\n    \\param n non-negative exponent. Must <= 308.\n    \\return 10.0^n\n*/\ninline double Pow10(int n) {\n    static const double e[] = { // 1e-0...1e308: 309 * 8 bytes = 2472 bytes\n        1e+0,  \n        1e+1,  1e+2,  1e+3,  1e+4,  1e+5,  1e+6,  1e+7,  1e+8,  1e+9,  1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20, \n        1e+21, 1e+22, 1e+23, 1e+24, 1e+25, 1e+26, 1e+27, 1e+28, 1e+29, 1e+30, 1e+31, 1e+32, 1e+33, 1e+34, 1e+35, 1e+36, 1e+37, 1e+38, 1e+39, 1e+40,\n        1e+41, 1e+42, 1e+43, 1e+44, 1e+45, 1e+46, 1e+47, 1e+48, 1e+49, 1e+50, 1e+51, 1e+52, 1e+53, 1e+54, 1e+55, 1e+56, 1e+57, 1e+58, 1e+59, 1e+60,\n        1e+61, 1e+62, 1e+63, 1e+64, 1e+65, 1e+66, 1e+67, 1e+68, 1e+69, 1e+70, 1e+71, 1e+72, 1e+73, 1e+74, 1e+75, 1e+76, 1e+77, 1e+78, 1e+79, 1e+80,\n        1e+81, 1e+82, 1e+83, 1e+84, 1e+85, 1e+86, 1e+87, 1e+88, 1e+89, 1e+90, 1e+91, 1e+92, 1e+93, 1e+94, 1e+95, 1e+96, 1e+97, 1e+98, 1e+99, 1e+100,\n        1e+101,1e+102,1e+103,1e+104,1e+105,1e+106,1e+107,1e+108,1e+109,1e+110,1e+111,1e+112,1e+113,1e+114,1e+115,1e+116,1e+117,1e+118,1e+119,1e+120,\n        1e+121,1e+122,1e+123,1e+124,1e+125,1e+126,1e+127,1e+128,1e+129,1e+130,1e+131,1e+132,1e+133,1e+134,1e+135,1e+136,1e+137,1e+138,1e+139,1e+140,\n        1e+141,1e+142,1e+143,1e+144,1e+145,1e+146,1e+147,1e+148,1e+149,1e+150,1e+151,1e+152,1e+153,1e+154,1e+155,1e+156,1e+157,1e+158,1e+159,1e+160,\n        1e+161,1e+162,1e+163,1e+164,1e+165,1e+166,1e+167,1e+168,1e+169,1e+170,1e+171,1e+172,1e+173,1e+174,1e+175,1e+176,1e+177,1e+178,1e+179,1e+180,\n        1e+181,1e+182,1e+183,1e+184,1e+185,1e+186,1e+187,1e+188,1e+189,1e+190,1e+191,1e+192,1e+193,1e+194,1e+195,1e+196,1e+197,1e+198,1e+199,1e+200,\n        1e+201,1e+202,1e+203,1e+204,1e+205,1e+206,1e+207,1e+208,1e+209,1e+210,1e+211,1e+212,1e+213,1e+214,1e+215,1e+216,1e+217,1e+218,1e+219,1e+220,\n        1e+221,1e+222,1e+223,1e+224,1e+225,1e+226,1e+227,1e+228,1e+229,1e+230,1e+231,1e+232,1e+233,1e+234,1e+235,1e+236,1e+237,1e+238,1e+239,1e+240,\n        1e+241,1e+242,1e+243,1e+244,1e+245,1e+246,1e+247,1e+248,1e+249,1e+250,1e+251,1e+252,1e+253,1e+254,1e+255,1e+256,1e+257,1e+258,1e+259,1e+260,\n        1e+261,1e+262,1e+263,1e+264,1e+265,1e+266,1e+267,1e+268,1e+269,1e+270,1e+271,1e+272,1e+273,1e+274,1e+275,1e+276,1e+277,1e+278,1e+279,1e+280,\n        1e+281,1e+282,1e+283,1e+284,1e+285,1e+286,1e+287,1e+288,1e+289,1e+290,1e+291,1e+292,1e+293,1e+294,1e+295,1e+296,1e+297,1e+298,1e+299,1e+300,\n        1e+301,1e+302,1e+303,1e+304,1e+305,1e+306,1e+307,1e+308\n    };\n    RAPIDJSON_ASSERT(n >= 0 && n <= 308);\n    return e[n];\n}\n\n} // namespace internal\n} // namespace rapidjson\n\n#endif // RAPIDJSON_POW10_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/internal/stack.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_INTERNAL_STACK_H_\n#define RAPIDJSON_INTERNAL_STACK_H_\n\nnamespace rapidjson {\nnamespace internal {\n\n///////////////////////////////////////////////////////////////////////////////\n// Stack\n\n//! A type-unsafe stack for storing different types of data.\n/*! \\tparam Allocator Allocator for allocating stack memory.\n*/\ntemplate <typename Allocator>\nclass Stack {\npublic:\n    // Optimization note: Do not allocate memory for stack_ in constructor.\n    // Do it lazily when first Push() -> Expand() -> Resize().\n    Stack(Allocator* allocator, size_t stackCapacity) : allocator_(allocator), ownAllocator(0), stack_(0), stackTop_(0), stackEnd_(0), initialCapacity_(stackCapacity) {\n        RAPIDJSON_ASSERT(stackCapacity > 0);\n        if (!allocator_)\n            ownAllocator = allocator_ = new Allocator();\n    }\n\n    ~Stack() {\n        Allocator::Free(stack_);\n        delete ownAllocator; // Only delete if it is owned by the stack\n    }\n\n    void Clear() { stackTop_ = stack_; }\n\n    void ShrinkToFit() { \n        if (Empty()) {\n            // If the stack is empty, completely deallocate the memory.\n            Allocator::Free(stack_);\n            stack_ = 0;\n            stackTop_ = 0;\n            stackEnd_ = 0;\n        }\n        else\n            Resize(GetSize());\n    }\n\n    // Optimization note: try to minimize the size of this function for force inline.\n    // Expansion is run very infrequently, so it is moved to another (probably non-inline) function.\n    template<typename T>\n    RAPIDJSON_FORCEINLINE T* Push(size_t count = 1) {\n         // Expand the stack if needed\n        if (stackTop_ + sizeof(T) * count >= stackEnd_)\n            Expand<T>(count);\n\n        T* ret = reinterpret_cast<T*>(stackTop_);\n        stackTop_ += sizeof(T) * count;\n        return ret;\n    }\n\n    template<typename T>\n    T* Pop(size_t count) {\n        RAPIDJSON_ASSERT(GetSize() >= count * sizeof(T));\n        stackTop_ -= count * sizeof(T);\n        return reinterpret_cast<T*>(stackTop_);\n    }\n\n    template<typename T>\n    T* Top() { \n        RAPIDJSON_ASSERT(GetSize() >= sizeof(T));\n        return reinterpret_cast<T*>(stackTop_ - sizeof(T));\n    }\n\n    template<typename T>\n    T* Bottom() { return (T*)stack_; }\n\n    Allocator& GetAllocator() { return *allocator_; }\n    bool Empty() const { return stackTop_ == stack_; }\n    size_t GetSize() const { return static_cast<size_t>(stackTop_ - stack_); }\n    size_t GetCapacity() const { return static_cast<size_t>(stackEnd_ - stack_); }\n\nprivate:\n    template<typename T>\n    void Expand(size_t count) {\n        // Only expand the capacity if the current stack exists. Otherwise just create a stack with initial capacity.\n        size_t newCapacity;\n        if (stack_ == 0)\n            newCapacity = initialCapacity_;\n        else {\n            newCapacity = GetCapacity();\n            newCapacity += (newCapacity + 1) / 2;\n        }\n        size_t newSize = GetSize() + sizeof(T) * count;\n        if (newCapacity < newSize)\n            newCapacity = newSize;\n\n        Resize(newCapacity);\n    }\n\n    void Resize(size_t newCapacity) {\n        const size_t size = GetSize();  // Backup the current size\n        stack_ = (char*)allocator_->Realloc(stack_, GetCapacity(), newCapacity);\n        stackTop_ = stack_ + size;\n        stackEnd_ = stack_ + newCapacity;\n    }\n\n    // Prohibit copy constructor & assignment operator.\n    Stack(const Stack&);\n    Stack& operator=(const Stack&);\n\n    Allocator* allocator_;\n    Allocator* ownAllocator;\n    char *stack_;\n    char *stackTop_;\n    char *stackEnd_;\n    size_t initialCapacity_;\n};\n\n} // namespace internal\n} // namespace rapidjson\n\n#endif // RAPIDJSON_STACK_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/internal/strfunc.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_INTERNAL_STRFUNC_H_\n#define RAPIDJSON_INTERNAL_STRFUNC_H_\n\nnamespace rapidjson {\nnamespace internal {\n\n//! Custom strlen() which works on different character types.\n/*! \\tparam Ch Character type (e.g. char, wchar_t, short)\n    \\param s Null-terminated input string.\n    \\return Number of characters in the string. \n    \\note This has the same semantics as strlen(), the return value is not number of Unicode codepoints.\n*/\ntemplate <typename Ch>\ninline SizeType StrLen(const Ch* s) {\n    const Ch* p = s;\n    while (*p) ++p;\n    return SizeType(p - s);\n}\n\n} // namespace internal\n} // namespace rapidjson\n\n#endif // RAPIDJSON_INTERNAL_STRFUNC_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/memorybuffer.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_MEMORYBUFFER_H_\n#define RAPIDJSON_MEMORYBUFFER_H_\n\n#include \"rapidjson.h\"\n#include \"internal/stack.h\"\n\nnamespace rapidjson {\n\n//! Represents an in-memory output byte stream.\n/*!\n    This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream.\n\n    It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file.\n\n    Differences between MemoryBuffer and StringBuffer:\n    1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer. \n    2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator.\n\n    \\tparam Allocator type for allocating memory buffer.\n    \\note implements Stream concept\n*/\ntemplate <typename Allocator = CrtAllocator>\nstruct GenericMemoryBuffer {\n    typedef char Ch; // byte\n\n    GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {}\n\n    void Put(Ch c) { *stack_.template Push<Ch>() = c; }\n    void Flush() {}\n\n    void Clear() { stack_.Clear(); }\n    void ShrinkToFit() { stack_.ShrinkToFit(); }\n    Ch* Push(size_t count) { return stack_.template Push<Ch>(count); }\n    void Pop(size_t count) { stack_.template Pop<Ch>(count); }\n\n    const Ch* GetBuffer() const {\n        return stack_.template Bottom<Ch>();\n    }\n\n    size_t GetSize() const { return stack_.GetSize(); }\n\n    static const size_t kDefaultCapacity = 256;\n    mutable internal::Stack<Allocator> stack_;\n};\n\ntypedef GenericMemoryBuffer<> MemoryBuffer;\n\n//! Implement specialized version of PutN() with memset() for better performance.\ntemplate<>\ninline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) {\n    std::memset(memoryBuffer.stack_.Push<char>(n), c, n * sizeof(c));\n}\n\n} // namespace rapidjson\n\n#endif // RAPIDJSON_MEMORYBUFFER_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/memorystream.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_MEMORYSTREAM_H_\n#define RAPIDJSON_MEMORYSTREAM_H_\n\n#include \"rapidjson.h\"\n\nnamespace rapidjson {\n\n//! Represents an in-memory input byte stream.\n/*!\n    This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream.\n\n    It is similar to FileReadBuffer but the source is an in-memory buffer instead of a file.\n\n    Differences between MemoryStream and StringStream:\n    1. StringStream has encoding but MemoryStream is a byte stream.\n    2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source.\n    3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4().\n    \\note implements Stream concept\n*/\nstruct MemoryStream {\n    typedef char Ch; // byte\n\n    MemoryStream(const Ch *src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {}\n\n    Ch Peek() const { return *src_; }\n    Ch Take() { return (src_ == end_) ? '\\0' : *src_++; }\n    size_t Tell() const { return static_cast<size_t>(src_ - begin_); }\n\n    Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }\n    void Put(Ch) { RAPIDJSON_ASSERT(false); }\n    void Flush() { RAPIDJSON_ASSERT(false); }\n    size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }\n\n    // For encoding detection only.\n    const Ch* Peek4() const {\n        return Tell() + 4 <= size_ ? src_ : 0;\n    }\n\n    const Ch* src_;     //!< Current read position.\n    const Ch* begin_;   //!< Original head of the string.\n    const Ch* end_;     //!< End of stream.\n    size_t size_;       //!< Size of the stream.\n};\n\n} // namespace rapidjson\n\n#endif // RAPIDJSON_MEMORYBUFFER_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/msinttypes/inttypes.h",
    "content": "// ISO C9x  compliant inttypes.h for Microsoft Visual Studio\n// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 \n// \n//  Copyright (c) 2006-2013 Alexander Chemeris\n// \n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n// \n//   1. Redistributions of source code must retain the above copyright notice,\n//      this list of conditions and the following disclaimer.\n// \n//   2. Redistributions in binary form must reproduce the above copyright\n//      notice, this list of conditions and the following disclaimer in the\n//      documentation and/or other materials provided with the distribution.\n// \n//   3. Neither the name of the product nor the names of its contributors may\n//      be used to endorse or promote products derived from this software\n//      without specific prior written permission.\n// \n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\n// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n// \n///////////////////////////////////////////////////////////////////////////////\n\n#ifndef _MSC_VER // [\n#error \"Use this header only with Microsoft Visual C++ compilers!\"\n#endif // _MSC_VER ]\n\n#ifndef _MSC_INTTYPES_H_ // [\n#define _MSC_INTTYPES_H_\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#include \"stdint.h\"\n\n// 7.8 Format conversion of integer types\n\ntypedef struct {\n   intmax_t quot;\n   intmax_t rem;\n} imaxdiv_t;\n\n// 7.8.1 Macros for format specifiers\n\n#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [   See footnote 185 at page 198\n\n// The fprintf macros for signed integers are:\n#define PRId8       \"d\"\n#define PRIi8       \"i\"\n#define PRIdLEAST8  \"d\"\n#define PRIiLEAST8  \"i\"\n#define PRIdFAST8   \"d\"\n#define PRIiFAST8   \"i\"\n\n#define PRId16       \"hd\"\n#define PRIi16       \"hi\"\n#define PRIdLEAST16  \"hd\"\n#define PRIiLEAST16  \"hi\"\n#define PRIdFAST16   \"hd\"\n#define PRIiFAST16   \"hi\"\n\n#define PRId32       \"I32d\"\n#define PRIi32       \"I32i\"\n#define PRIdLEAST32  \"I32d\"\n#define PRIiLEAST32  \"I32i\"\n#define PRIdFAST32   \"I32d\"\n#define PRIiFAST32   \"I32i\"\n\n#define PRId64       \"I64d\"\n#define PRIi64       \"I64i\"\n#define PRIdLEAST64  \"I64d\"\n#define PRIiLEAST64  \"I64i\"\n#define PRIdFAST64   \"I64d\"\n#define PRIiFAST64   \"I64i\"\n\n#define PRIdMAX     \"I64d\"\n#define PRIiMAX     \"I64i\"\n\n#define PRIdPTR     \"Id\"\n#define PRIiPTR     \"Ii\"\n\n// The fprintf macros for unsigned integers are:\n#define PRIo8       \"o\"\n#define PRIu8       \"u\"\n#define PRIx8       \"x\"\n#define PRIX8       \"X\"\n#define PRIoLEAST8  \"o\"\n#define PRIuLEAST8  \"u\"\n#define PRIxLEAST8  \"x\"\n#define PRIXLEAST8  \"X\"\n#define PRIoFAST8   \"o\"\n#define PRIuFAST8   \"u\"\n#define PRIxFAST8   \"x\"\n#define PRIXFAST8   \"X\"\n\n#define PRIo16       \"ho\"\n#define PRIu16       \"hu\"\n#define PRIx16       \"hx\"\n#define PRIX16       \"hX\"\n#define PRIoLEAST16  \"ho\"\n#define PRIuLEAST16  \"hu\"\n#define PRIxLEAST16  \"hx\"\n#define PRIXLEAST16  \"hX\"\n#define PRIoFAST16   \"ho\"\n#define PRIuFAST16   \"hu\"\n#define PRIxFAST16   \"hx\"\n#define PRIXFAST16   \"hX\"\n\n#define PRIo32       \"I32o\"\n#define PRIu32       \"I32u\"\n#define PRIx32       \"I32x\"\n#define PRIX32       \"I32X\"\n#define PRIoLEAST32  \"I32o\"\n#define PRIuLEAST32  \"I32u\"\n#define PRIxLEAST32  \"I32x\"\n#define PRIXLEAST32  \"I32X\"\n#define PRIoFAST32   \"I32o\"\n#define PRIuFAST32   \"I32u\"\n#define PRIxFAST32   \"I32x\"\n#define PRIXFAST32   \"I32X\"\n\n#define PRIo64       \"I64o\"\n#define PRIu64       \"I64u\"\n#define PRIx64       \"I64x\"\n#define PRIX64       \"I64X\"\n#define PRIoLEAST64  \"I64o\"\n#define PRIuLEAST64  \"I64u\"\n#define PRIxLEAST64  \"I64x\"\n#define PRIXLEAST64  \"I64X\"\n#define PRIoFAST64   \"I64o\"\n#define PRIuFAST64   \"I64u\"\n#define PRIxFAST64   \"I64x\"\n#define PRIXFAST64   \"I64X\"\n\n#define PRIoMAX     \"I64o\"\n#define PRIuMAX     \"I64u\"\n#define PRIxMAX     \"I64x\"\n#define PRIXMAX     \"I64X\"\n\n#define PRIoPTR     \"Io\"\n#define PRIuPTR     \"Iu\"\n#define PRIxPTR     \"Ix\"\n#define PRIXPTR     \"IX\"\n\n// The fscanf macros for signed integers are:\n#define SCNd8       \"d\"\n#define SCNi8       \"i\"\n#define SCNdLEAST8  \"d\"\n#define SCNiLEAST8  \"i\"\n#define SCNdFAST8   \"d\"\n#define SCNiFAST8   \"i\"\n\n#define SCNd16       \"hd\"\n#define SCNi16       \"hi\"\n#define SCNdLEAST16  \"hd\"\n#define SCNiLEAST16  \"hi\"\n#define SCNdFAST16   \"hd\"\n#define SCNiFAST16   \"hi\"\n\n#define SCNd32       \"ld\"\n#define SCNi32       \"li\"\n#define SCNdLEAST32  \"ld\"\n#define SCNiLEAST32  \"li\"\n#define SCNdFAST32   \"ld\"\n#define SCNiFAST32   \"li\"\n\n#define SCNd64       \"I64d\"\n#define SCNi64       \"I64i\"\n#define SCNdLEAST64  \"I64d\"\n#define SCNiLEAST64  \"I64i\"\n#define SCNdFAST64   \"I64d\"\n#define SCNiFAST64   \"I64i\"\n\n#define SCNdMAX     \"I64d\"\n#define SCNiMAX     \"I64i\"\n\n#ifdef _WIN64 // [\n#  define SCNdPTR     \"I64d\"\n#  define SCNiPTR     \"I64i\"\n#else  // _WIN64 ][\n#  define SCNdPTR     \"ld\"\n#  define SCNiPTR     \"li\"\n#endif  // _WIN64 ]\n\n// The fscanf macros for unsigned integers are:\n#define SCNo8       \"o\"\n#define SCNu8       \"u\"\n#define SCNx8       \"x\"\n#define SCNX8       \"X\"\n#define SCNoLEAST8  \"o\"\n#define SCNuLEAST8  \"u\"\n#define SCNxLEAST8  \"x\"\n#define SCNXLEAST8  \"X\"\n#define SCNoFAST8   \"o\"\n#define SCNuFAST8   \"u\"\n#define SCNxFAST8   \"x\"\n#define SCNXFAST8   \"X\"\n\n#define SCNo16       \"ho\"\n#define SCNu16       \"hu\"\n#define SCNx16       \"hx\"\n#define SCNX16       \"hX\"\n#define SCNoLEAST16  \"ho\"\n#define SCNuLEAST16  \"hu\"\n#define SCNxLEAST16  \"hx\"\n#define SCNXLEAST16  \"hX\"\n#define SCNoFAST16   \"ho\"\n#define SCNuFAST16   \"hu\"\n#define SCNxFAST16   \"hx\"\n#define SCNXFAST16   \"hX\"\n\n#define SCNo32       \"lo\"\n#define SCNu32       \"lu\"\n#define SCNx32       \"lx\"\n#define SCNX32       \"lX\"\n#define SCNoLEAST32  \"lo\"\n#define SCNuLEAST32  \"lu\"\n#define SCNxLEAST32  \"lx\"\n#define SCNXLEAST32  \"lX\"\n#define SCNoFAST32   \"lo\"\n#define SCNuFAST32   \"lu\"\n#define SCNxFAST32   \"lx\"\n#define SCNXFAST32   \"lX\"\n\n#define SCNo64       \"I64o\"\n#define SCNu64       \"I64u\"\n#define SCNx64       \"I64x\"\n#define SCNX64       \"I64X\"\n#define SCNoLEAST64  \"I64o\"\n#define SCNuLEAST64  \"I64u\"\n#define SCNxLEAST64  \"I64x\"\n#define SCNXLEAST64  \"I64X\"\n#define SCNoFAST64   \"I64o\"\n#define SCNuFAST64   \"I64u\"\n#define SCNxFAST64   \"I64x\"\n#define SCNXFAST64   \"I64X\"\n\n#define SCNoMAX     \"I64o\"\n#define SCNuMAX     \"I64u\"\n#define SCNxMAX     \"I64x\"\n#define SCNXMAX     \"I64X\"\n\n#ifdef _WIN64 // [\n#  define SCNoPTR     \"I64o\"\n#  define SCNuPTR     \"I64u\"\n#  define SCNxPTR     \"I64x\"\n#  define SCNXPTR     \"I64X\"\n#else  // _WIN64 ][\n#  define SCNoPTR     \"lo\"\n#  define SCNuPTR     \"lu\"\n#  define SCNxPTR     \"lx\"\n#  define SCNXPTR     \"lX\"\n#endif  // _WIN64 ]\n\n#endif // __STDC_FORMAT_MACROS ]\n\n// 7.8.2 Functions for greatest-width integer types\n\n// 7.8.2.1 The imaxabs function\n#define imaxabs _abs64\n\n// 7.8.2.2 The imaxdiv function\n\n// This is modified version of div() function from Microsoft's div.c found\n// in %MSVC.NET%\\crt\\src\\div.c\n#ifdef STATIC_IMAXDIV // [\nstatic\n#else // STATIC_IMAXDIV ][\n_inline\n#endif // STATIC_IMAXDIV ]\nimaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)\n{\n   imaxdiv_t result;\n\n   result.quot = numer / denom;\n   result.rem = numer % denom;\n\n   if (numer < 0 && result.rem > 0) {\n      // did division wrong; must fix up\n      ++result.quot;\n      result.rem -= denom;\n   }\n\n   return result;\n}\n\n// 7.8.2.3 The strtoimax and strtoumax functions\n#define strtoimax _strtoi64\n#define strtoumax _strtoui64\n\n// 7.8.2.4 The wcstoimax and wcstoumax functions\n#define wcstoimax _wcstoi64\n#define wcstoumax _wcstoui64\n\n\n#endif // _MSC_INTTYPES_H_ ]\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/msinttypes/stdint.h",
    "content": "// ISO C9x  compliant stdint.h for Microsoft Visual Studio\n// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 \n// \n//  Copyright (c) 2006-2013 Alexander Chemeris\n// \n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n// \n//   1. Redistributions of source code must retain the above copyright notice,\n//      this list of conditions and the following disclaimer.\n// \n//   2. Redistributions in binary form must reproduce the above copyright\n//      notice, this list of conditions and the following disclaimer in the\n//      documentation and/or other materials provided with the distribution.\n// \n//   3. Neither the name of the product nor the names of its contributors may\n//      be used to endorse or promote products derived from this software\n//      without specific prior written permission.\n// \n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\n// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \n// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n// \n///////////////////////////////////////////////////////////////////////////////\n\n#ifndef _MSC_VER // [\n#error \"Use this header only with Microsoft Visual C++ compilers!\"\n#endif // _MSC_VER ]\n\n#ifndef _MSC_STDINT_H_ // [\n#define _MSC_STDINT_H_\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n// miloyip: Originally Visual Studio 2010 uses its own stdint.h. However it generates warning with INT64_C(), so change to use this file for vs2010.\n#if _MSC_VER >= 1600 // [\n#include <stdint.h>\n\n#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [   See footnote 224 at page 260\n\n#undef INT8_C\n#undef INT16_C\n#undef INT32_C\n#undef INT64_C\n#undef UINT8_C\n#undef UINT16_C\n#undef UINT32_C\n#undef UINT64_C\n\n// 7.18.4.1 Macros for minimum-width integer constants\n\n#define INT8_C(val)  val##i8\n#define INT16_C(val) val##i16\n#define INT32_C(val) val##i32\n#define INT64_C(val) val##i64\n\n#define UINT8_C(val)  val##ui8\n#define UINT16_C(val) val##ui16\n#define UINT32_C(val) val##ui32\n#define UINT64_C(val) val##ui64\n\n// 7.18.4.2 Macros for greatest-width integer constants\n// These #ifndef's are needed to prevent collisions with <boost/cstdint.hpp>.\n// Check out Issue 9 for the details.\n#ifndef INTMAX_C //   [\n#  define INTMAX_C   INT64_C\n#endif // INTMAX_C    ]\n#ifndef UINTMAX_C //  [\n#  define UINTMAX_C  UINT64_C\n#endif // UINTMAX_C   ]\n\n#endif // __STDC_CONSTANT_MACROS ]\n\n#else // ] _MSC_VER >= 1700 [\n\n#include <limits.h>\n\n// For Visual Studio 6 in C++ mode and for many Visual Studio versions when\n// compiling for ARM we should wrap <wchar.h> include with 'extern \"C++\" {}'\n// or compiler give many errors like this:\n//   error C2733: second C linkage of overloaded function 'wmemchr' not allowed\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#  include <wchar.h>\n#ifdef __cplusplus\n}\n#endif\n\n// Define _W64 macros to mark types changing their size, like intptr_t.\n#ifndef _W64\n#  if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300\n#     define _W64 __w64\n#  else\n#     define _W64\n#  endif\n#endif\n\n\n// 7.18.1 Integer types\n\n// 7.18.1.1 Exact-width integer types\n\n// Visual Studio 6 and Embedded Visual C++ 4 doesn't\n// realize that, e.g. char has the same size as __int8\n// so we give up on __intX for them.\n#if (_MSC_VER < 1300)\n   typedef signed char       int8_t;\n   typedef signed short      int16_t;\n   typedef signed int        int32_t;\n   typedef unsigned char     uint8_t;\n   typedef unsigned short    uint16_t;\n   typedef unsigned int      uint32_t;\n#else\n   typedef signed __int8     int8_t;\n   typedef signed __int16    int16_t;\n   typedef signed __int32    int32_t;\n   typedef unsigned __int8   uint8_t;\n   typedef unsigned __int16  uint16_t;\n   typedef unsigned __int32  uint32_t;\n#endif\ntypedef signed __int64       int64_t;\ntypedef unsigned __int64     uint64_t;\n\n\n// 7.18.1.2 Minimum-width integer types\ntypedef int8_t    int_least8_t;\ntypedef int16_t   int_least16_t;\ntypedef int32_t   int_least32_t;\ntypedef int64_t   int_least64_t;\ntypedef uint8_t   uint_least8_t;\ntypedef uint16_t  uint_least16_t;\ntypedef uint32_t  uint_least32_t;\ntypedef uint64_t  uint_least64_t;\n\n// 7.18.1.3 Fastest minimum-width integer types\ntypedef int8_t    int_fast8_t;\ntypedef int16_t   int_fast16_t;\ntypedef int32_t   int_fast32_t;\ntypedef int64_t   int_fast64_t;\ntypedef uint8_t   uint_fast8_t;\ntypedef uint16_t  uint_fast16_t;\ntypedef uint32_t  uint_fast32_t;\ntypedef uint64_t  uint_fast64_t;\n\n// 7.18.1.4 Integer types capable of holding object pointers\n#ifdef _WIN64 // [\n   typedef signed __int64    intptr_t;\n   typedef unsigned __int64  uintptr_t;\n#else // _WIN64 ][\n   typedef _W64 signed int   intptr_t;\n   typedef _W64 unsigned int uintptr_t;\n#endif // _WIN64 ]\n\n// 7.18.1.5 Greatest-width integer types\ntypedef int64_t   intmax_t;\ntypedef uint64_t  uintmax_t;\n\n\n// 7.18.2 Limits of specified-width integer types\n\n#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [   See footnote 220 at page 257 and footnote 221 at page 259\n\n// 7.18.2.1 Limits of exact-width integer types\n#define INT8_MIN     ((int8_t)_I8_MIN)\n#define INT8_MAX     _I8_MAX\n#define INT16_MIN    ((int16_t)_I16_MIN)\n#define INT16_MAX    _I16_MAX\n#define INT32_MIN    ((int32_t)_I32_MIN)\n#define INT32_MAX    _I32_MAX\n#define INT64_MIN    ((int64_t)_I64_MIN)\n#define INT64_MAX    _I64_MAX\n#define UINT8_MAX    _UI8_MAX\n#define UINT16_MAX   _UI16_MAX\n#define UINT32_MAX   _UI32_MAX\n#define UINT64_MAX   _UI64_MAX\n\n// 7.18.2.2 Limits of minimum-width integer types\n#define INT_LEAST8_MIN    INT8_MIN\n#define INT_LEAST8_MAX    INT8_MAX\n#define INT_LEAST16_MIN   INT16_MIN\n#define INT_LEAST16_MAX   INT16_MAX\n#define INT_LEAST32_MIN   INT32_MIN\n#define INT_LEAST32_MAX   INT32_MAX\n#define INT_LEAST64_MIN   INT64_MIN\n#define INT_LEAST64_MAX   INT64_MAX\n#define UINT_LEAST8_MAX   UINT8_MAX\n#define UINT_LEAST16_MAX  UINT16_MAX\n#define UINT_LEAST32_MAX  UINT32_MAX\n#define UINT_LEAST64_MAX  UINT64_MAX\n\n// 7.18.2.3 Limits of fastest minimum-width integer types\n#define INT_FAST8_MIN    INT8_MIN\n#define INT_FAST8_MAX    INT8_MAX\n#define INT_FAST16_MIN   INT16_MIN\n#define INT_FAST16_MAX   INT16_MAX\n#define INT_FAST32_MIN   INT32_MIN\n#define INT_FAST32_MAX   INT32_MAX\n#define INT_FAST64_MIN   INT64_MIN\n#define INT_FAST64_MAX   INT64_MAX\n#define UINT_FAST8_MAX   UINT8_MAX\n#define UINT_FAST16_MAX  UINT16_MAX\n#define UINT_FAST32_MAX  UINT32_MAX\n#define UINT_FAST64_MAX  UINT64_MAX\n\n// 7.18.2.4 Limits of integer types capable of holding object pointers\n#ifdef _WIN64 // [\n#  define INTPTR_MIN   INT64_MIN\n#  define INTPTR_MAX   INT64_MAX\n#  define UINTPTR_MAX  UINT64_MAX\n#else // _WIN64 ][\n#  define INTPTR_MIN   INT32_MIN\n#  define INTPTR_MAX   INT32_MAX\n#  define UINTPTR_MAX  UINT32_MAX\n#endif // _WIN64 ]\n\n// 7.18.2.5 Limits of greatest-width integer types\n#define INTMAX_MIN   INT64_MIN\n#define INTMAX_MAX   INT64_MAX\n#define UINTMAX_MAX  UINT64_MAX\n\n// 7.18.3 Limits of other integer types\n\n#ifdef _WIN64 // [\n#  define PTRDIFF_MIN  _I64_MIN\n#  define PTRDIFF_MAX  _I64_MAX\n#else  // _WIN64 ][\n#  define PTRDIFF_MIN  _I32_MIN\n#  define PTRDIFF_MAX  _I32_MAX\n#endif  // _WIN64 ]\n\n#define SIG_ATOMIC_MIN  INT_MIN\n#define SIG_ATOMIC_MAX  INT_MAX\n\n#ifndef SIZE_MAX // [\n#  ifdef _WIN64 // [\n#     define SIZE_MAX  _UI64_MAX\n#  else // _WIN64 ][\n#     define SIZE_MAX  _UI32_MAX\n#  endif // _WIN64 ]\n#endif // SIZE_MAX ]\n\n// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>\n#ifndef WCHAR_MIN // [\n#  define WCHAR_MIN  0\n#endif  // WCHAR_MIN ]\n#ifndef WCHAR_MAX // [\n#  define WCHAR_MAX  _UI16_MAX\n#endif  // WCHAR_MAX ]\n\n#define WINT_MIN  0\n#define WINT_MAX  _UI16_MAX\n\n#endif // __STDC_LIMIT_MACROS ]\n\n\n// 7.18.4 Limits of other integer types\n\n#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [   See footnote 224 at page 260\n\n// 7.18.4.1 Macros for minimum-width integer constants\n\n#define INT8_C(val)  val##i8\n#define INT16_C(val) val##i16\n#define INT32_C(val) val##i32\n#define INT64_C(val) val##i64\n\n#define UINT8_C(val)  val##ui8\n#define UINT16_C(val) val##ui16\n#define UINT32_C(val) val##ui32\n#define UINT64_C(val) val##ui64\n\n// 7.18.4.2 Macros for greatest-width integer constants\n// These #ifndef's are needed to prevent collisions with <boost/cstdint.hpp>.\n// Check out Issue 9 for the details.\n#ifndef INTMAX_C //   [\n#  define INTMAX_C   INT64_C\n#endif // INTMAX_C    ]\n#ifndef UINTMAX_C //  [\n#  define UINTMAX_C  UINT64_C\n#endif // UINTMAX_C   ]\n\n#endif // __STDC_CONSTANT_MACROS ]\n\n#endif // _MSC_VER >= 1600 ]\n\n#endif // _MSC_STDINT_H_ ]\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/prettywriter.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_PRETTYWRITER_H_\n#define RAPIDJSON_PRETTYWRITER_H_\n\n#include \"writer.h\"\n\n#ifdef __GNUC__\nRAPIDJSON_DIAG_PUSH\nRAPIDJSON_DIAG_OFF(effc++)\n#endif\n\nnamespace rapidjson {\n\n//! Writer with indentation and spacing.\n/*!\n    \\tparam OutputStream Type of ouptut os.\n    \\tparam SourceEncoding Encoding of source string.\n    \\tparam TargetEncoding Encoding of output stream.\n    \\tparam StackAllocator Type of allocator for allocating memory of stack.\n*/\ntemplate<typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator>\nclass PrettyWriter : public Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator> {\npublic:\n    typedef Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator> Base;\n    typedef typename Base::Ch Ch;\n\n    //! Constructor\n    /*! \\param os Output stream.\n        \\param allocator User supplied allocator. If it is null, it will create a private one.\n        \\param levelDepth Initial capacity of stack.\n    */\n    PrettyWriter(OutputStream& os, StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) : \n        Base(os, allocator, levelDepth), indentChar_(' '), indentCharCount_(4) {}\n\n    //! Set custom indentation.\n    /*! \\param indentChar       Character for indentation. Must be whitespace character (' ', '\\\\t', '\\\\n', '\\\\r').\n        \\param indentCharCount  Number of indent characters for each indentation level.\n        \\note The default indentation is 4 spaces.\n    */\n    PrettyWriter& SetIndent(Ch indentChar, unsigned indentCharCount) {\n        RAPIDJSON_ASSERT(indentChar == ' ' || indentChar == '\\t' || indentChar == '\\n' || indentChar == '\\r');\n        indentChar_ = indentChar;\n        indentCharCount_ = indentCharCount;\n        return *this;\n    }\n\n    /*! @name Implementation of Handler\n        \\see Handler\n    */\n    //@{\n\n    bool Null()                 { PrettyPrefix(kNullType);   return Base::WriteNull(); }\n    bool Bool(bool b)           { PrettyPrefix(b ? kTrueType : kFalseType); return Base::WriteBool(b); }\n    bool Int(int i)             { PrettyPrefix(kNumberType); return Base::WriteInt(i); }\n    bool Uint(unsigned u)       { PrettyPrefix(kNumberType); return Base::WriteUint(u); }\n    bool Int64(int64_t i64)     { PrettyPrefix(kNumberType); return Base::WriteInt64(i64); }\n    bool Uint64(uint64_t u64)   { PrettyPrefix(kNumberType); return Base::WriteUint64(u64);  }\n    bool Double(double d)       { PrettyPrefix(kNumberType); return Base::WriteDouble(d); }\n\n    bool String(const Ch* str, SizeType length, bool copy = false) {\n        (void)copy;\n        PrettyPrefix(kStringType);\n        return Base::WriteString(str, length);\n    }\n\n    bool StartObject() {\n        PrettyPrefix(kObjectType);\n        new (Base::level_stack_.template Push<typename Base::Level>()) typename Base::Level(false);\n        return Base::WriteStartObject();\n    }\n\n    bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); }\n\t\n    bool EndObject(SizeType memberCount = 0) {\n        (void)memberCount;\n        RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level));\n        RAPIDJSON_ASSERT(!Base::level_stack_.template Top<typename Base::Level>()->inArray);\n        bool empty = Base::level_stack_.template Pop<typename Base::Level>(1)->valueCount == 0;\n\n        if (!empty) {\n            Base::os_->Put('\\n');\n            WriteIndent();\n        }\n        if (!Base::WriteEndObject())\n            return false;\n        if (Base::level_stack_.Empty()) // end of json text\n            Base::os_->Flush();\n        return true;\n    }\n\n    bool StartArray() {\n        PrettyPrefix(kArrayType);\n        new (Base::level_stack_.template Push<typename Base::Level>()) typename Base::Level(true);\n        return Base::WriteStartArray();\n    }\n\n    bool EndArray(SizeType memberCount = 0) {\n        (void)memberCount;\n        RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level));\n        RAPIDJSON_ASSERT(Base::level_stack_.template Top<typename Base::Level>()->inArray);\n        bool empty = Base::level_stack_.template Pop<typename Base::Level>(1)->valueCount == 0;\n\n        if (!empty) {\n            Base::os_->Put('\\n');\n            WriteIndent();\n        }\n        if (!Base::WriteEndArray())\n            return false;\n        if (Base::level_stack_.Empty()) // end of json text\n            Base::os_->Flush();\n        return true;\n    }\n\n    //@}\n\n    /*! @name Convenience extensions */\n    //@{\n\n    //! Simpler but slower overload.\n    bool String(const Ch* str) { return String(str, internal::StrLen(str)); }\n    bool Key(const Ch* str) { return Key(str, internal::StrLen(str)); }\n\n    //@}\nprotected:\n    void PrettyPrefix(Type type) {\n        (void)type;\n        if (Base::level_stack_.GetSize() != 0) { // this value is not at root\n            typename Base::Level* level = Base::level_stack_.template Top<typename Base::Level>();\n\n            if (level->inArray) {\n                if (level->valueCount > 0) {\n                    Base::os_->Put(','); // add comma if it is not the first element in array\n                    Base::os_->Put('\\n');\n                }\n                else\n                    Base::os_->Put('\\n');\n                WriteIndent();\n            }\n            else {  // in object\n                if (level->valueCount > 0) {\n                    if (level->valueCount % 2 == 0) {\n                        Base::os_->Put(',');\n                        Base::os_->Put('\\n');\n                    }\n                    else {\n                        Base::os_->Put(':');\n                        Base::os_->Put(' ');\n                    }\n                }\n                else\n                    Base::os_->Put('\\n');\n\n                if (level->valueCount % 2 == 0)\n                    WriteIndent();\n            }\n            if (!level->inArray && level->valueCount % 2 == 0)\n                RAPIDJSON_ASSERT(type == kStringType);  // if it's in object, then even number should be a name\n            level->valueCount++;\n        }\n        else {\n            RAPIDJSON_ASSERT(!Base::hasRoot_);  // Should only has one and only one root.\n            Base::hasRoot_ = true;\n        }\n    }\n\n    void WriteIndent()  {\n        size_t count = (Base::level_stack_.GetSize() / sizeof(typename Base::Level)) * indentCharCount_;\n        PutN(*Base::os_, indentChar_, count);\n    }\n\n    Ch indentChar_;\n    unsigned indentCharCount_;\n\nprivate:\n    // Prohibit copy constructor & assignment operator.\n    PrettyWriter(const PrettyWriter&);\n    PrettyWriter& operator=(const PrettyWriter&);\n};\n\n} // namespace rapidjson\n\n#ifdef __GNUC__\nRAPIDJSON_DIAG_POP\n#endif\n\n#endif // RAPIDJSON_RAPIDJSON_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/rapidjson.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_RAPIDJSON_H_\n#define RAPIDJSON_RAPIDJSON_H_\n\n// Copyright (c) 2011 Milo Yip (miloyip@gmail.com)\n// Version 0.1\n\n/*!\\file rapidjson.h\n    \\brief common definitions and configuration\n\n    \\see RAPIDJSON_CONFIG\n */\n\n/*! \\defgroup RAPIDJSON_CONFIG RapidJSON configuration\n    \\brief Configuration macros for library features\n\n    Some RapidJSON features are configurable to adapt the library to a wide\n    variety of platforms, environments and usage scenarios.  Most of the\n    features can be configured in terms of overriden or predefined\n    preprocessor macros at compile-time.\n\n    Some additional customization is available in the \\ref RAPIDJSON_ERRORS APIs.\n\n    \\note These macros should be given on the compiler command-line\n          (where applicable)  to avoid inconsistent values when compiling\n          different translation units of a single application.\n */\n\n#include <cstdlib>  // malloc(), realloc(), free(), size_t\n#include <cstring>  // memset(), memcpy(), memmove(), memcmp()\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_NO_INT64DEFINE\n\n/*! \\def RAPIDJSON_NO_INT64DEFINE\n    \\ingroup RAPIDJSON_CONFIG\n    \\brief Use external 64-bit integer types.\n\n    RapidJSON requires the 64-bit integer types \\c int64_t and  \\c uint64_t types\n    to be available at global scope.\n\n    If users have their own definition, define RAPIDJSON_NO_INT64DEFINE to\n    prevent RapidJSON from defining its own types.\n*/\n#ifndef RAPIDJSON_NO_INT64DEFINE\n//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN\n#ifdef _MSC_VER\n#include \"msinttypes/stdint.h\"\n#include \"msinttypes/inttypes.h\"\n#else\n// Other compilers should have this.\n#include <stdint.h>\n#include <inttypes.h>\n#endif\n//!@endcond\n#ifdef RAPIDJSON_DOXYGEN_RUNNING\n#define RAPIDJSON_NO_INT64DEFINE\n#endif\n#endif // RAPIDJSON_NO_INT64TYPEDEF\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_FORCEINLINE\n\n#ifndef RAPIDJSON_FORCEINLINE\n//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN\n#ifdef _MSC_VER\n#define RAPIDJSON_FORCEINLINE __forceinline\n#elif defined(__GNUC__) && __GNUC__ >= 4\n#define RAPIDJSON_FORCEINLINE __attribute__((always_inline))\n#else\n#define RAPIDJSON_FORCEINLINE\n#endif\n//!@endcond\n#endif // RAPIDJSON_FORCEINLINE\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_ENDIAN\n#define RAPIDJSON_LITTLEENDIAN  0   //!< Little endian machine\n#define RAPIDJSON_BIGENDIAN     1   //!< Big endian machine\n\n//! Endianness of the machine.\n/*!\n    \\def RAPIDJSON_ENDIAN\n    \\ingroup RAPIDJSON_CONFIG\n\n    GCC 4.6 provided macro for detecting endianness of the target machine. But other\n    compilers may not have this. User can define RAPIDJSON_ENDIAN to either\n    \\ref RAPIDJSON_LITTLEENDIAN or \\ref RAPIDJSON_BIGENDIAN.\n\n    Default detection implemented with reference to\n    \\li https://gcc.gnu.org/onlinedocs/gcc-4.6.0/cpp/Common-Predefined-Macros.html\n    \\li http://www.boost.org/doc/libs/1_42_0/boost/detail/endian.hpp\n*/\n#ifndef RAPIDJSON_ENDIAN\n// Detect with GCC 4.6's macro\n#  ifdef __BYTE_ORDER__\n#    if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__\n#      define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN\n#    elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__\n#      define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN\n#    else\n#      error Unknown machine endianess detected. User needs to define RAPIDJSON_ENDIAN.\n#    endif // __BYTE_ORDER__\n// Detect with GLIBC's endian.h\n#  elif defined(__GLIBC__)\n#    include <endian.h>\n#    if (__BYTE_ORDER == __LITTLE_ENDIAN)\n#      define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN\n#    elif (__BYTE_ORDER == __BIG_ENDIAN)\n#      define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN\n#    else\n#      error Unknown machine endianess detected. User needs to define RAPIDJSON_ENDIAN.\n#   endif // __GLIBC__\n// Detect with _LITTLE_ENDIAN and _BIG_ENDIAN macro\n#  elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)\n#    define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN\n#  elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)\n#    define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN\n// Detect with architecture macros\n#  elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__)\n#    define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN\n#  elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__)\n#    define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN\n#  elif defined(RAPIDJSON_DOXYGEN_RUNNING)\n#    define RAPIDJSON_ENDIAN\n#  else\n#    error Unknown machine endianess detected. User needs to define RAPIDJSON_ENDIAN.   \n#  endif\n#endif // RAPIDJSON_ENDIAN\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_64BIT\n\n//! Whether using 64-bit architecture\n#ifndef RAPIDJSON_64BIT\n#if defined(__LP64__) || defined(_WIN64)\n#define RAPIDJSON_64BIT 1\n#else\n#define RAPIDJSON_64BIT 0\n#endif\n#endif // RAPIDJSON_64BIT\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_ALIGN\n\n//! Data alignment of the machine.\n/*! \\ingroup RAPIDJSON_CONFIG\n    \\param x pointer to align\n\n    Some machines require strict data alignment. Currently the default uses 4 bytes\n    alignment. User can customize by defining the RAPIDJSON_ALIGN function macro.,\n*/\n#ifndef RAPIDJSON_ALIGN\n#define RAPIDJSON_ALIGN(x) ((x + 3u) & ~3u)\n#endif\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_UINT64_C2\n\n//! Construct a 64-bit literal by a pair of 32-bit integer.\n/*!\n    64-bit literal with or without ULL suffix is prone to compiler warnings.\n    UINT64_C() is C macro which cause compilation problems.\n    Use this macro to define 64-bit constants by a pair of 32-bit integer.\n*/\n#ifndef RAPIDJSON_UINT64_C2\n#define RAPIDJSON_UINT64_C2(high32, low32) ((static_cast<uint64_t>(high32) << 32) | static_cast<uint64_t>(low32))\n#endif\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_SSE2/RAPIDJSON_SSE42/RAPIDJSON_SIMD\n\n/*! \\def RAPIDJSON_SIMD\n    \\ingroup RAPIDJSON_CONFIG\n    \\brief Enable SSE2/SSE4.2 optimization.\n\n    RapidJSON supports optimized implementations for some parsing operations\n    based on the SSE2 or SSE4.2 SIMD extensions on modern Intel-compatible\n    processors.\n\n    To enable these optimizations, two different symbols can be defined;\n    \\code\n    // Enable SSE2 optimization.\n    #define RAPIDJSON_SSE2\n\n    // Enable SSE4.2 optimization.\n    #define RAPIDJSON_SSE42\n    \\endcode\n\n    \\c RAPIDJSON_SSE42 takes precedence, if both are defined.\n\n    If any of these symbols is defined, RapidJSON defines the macro\n    \\c RAPIDJSON_SIMD to indicate the availability of the optimized code.\n*/\n#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42) \\\n    || defined(RAPIDJSON_DOXYGEN_RUNNING)\n#define RAPIDJSON_SIMD\n#endif\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_NO_SIZETYPEDEFINE\n\n#ifndef RAPIDJSON_NO_SIZETYPEDEFINE\n/*! \\def RAPIDJSON_NO_SIZETYPEDEFINE\n    \\ingroup RAPIDJSON_CONFIG\n    \\brief User-provided \\c SizeType definition.\n\n    In order to avoid using 32-bit size types for indexing strings and arrays,\n    define this preprocessor symbol and provide the type rapidjson::SizeType\n    before including RapidJSON:\n    \\code\n    #define RAPIDJSON_NO_SIZETYPEDEFINE\n    namespace rapidjson { typedef ::std::size_t SizeType; }\n    #include \"rapidjson/...\"\n    \\endcode\n\n    \\see rapidjson::SizeType\n*/\n#ifdef RAPIDJSON_DOXYGEN_RUNNING\n#define RAPIDJSON_NO_SIZETYPEDEFINE\n#endif\nnamespace rapidjson {\n//! Size type (for string lengths, array sizes, etc.)\n/*! RapidJSON uses 32-bit array/string indices even on 64-bit platforms,\n    instead of using \\c size_t. Users may override the SizeType by defining\n    \\ref RAPIDJSON_NO_SIZETYPEDEFINE.\n*/\ntypedef unsigned SizeType;\n} // namespace rapidjson\n#endif\n\n// always import std::size_t to rapidjson namespace\nnamespace rapidjson {\nusing std::size_t;\n} // namespace rapidjson\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_ASSERT\n\n//! Assertion.\n/*! \\ingroup RAPIDJSON_CONFIG\n    By default, rapidjson uses C \\c assert() for internal assertions.\n    User can override it by defining RAPIDJSON_ASSERT(x) macro.\n\n    \\note Parsing errors are handled and can be customized by the\n          \\ref RAPIDJSON_ERRORS APIs.\n*/\n#ifndef RAPIDJSON_ASSERT\n#include <cassert>\n#define RAPIDJSON_ASSERT(x) assert(x)\n#endif // RAPIDJSON_ASSERT\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_STATIC_ASSERT\n\n// Adopt from boost\n#ifndef RAPIDJSON_STATIC_ASSERT\n//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN\nnamespace rapidjson {\n\ntemplate <bool x> struct STATIC_ASSERTION_FAILURE;\ntemplate <> struct STATIC_ASSERTION_FAILURE<true> { enum { value = 1 }; };\ntemplate<int x> struct StaticAssertTest {};\n} // namespace rapidjson\n\n#define RAPIDJSON_JOIN(X, Y) RAPIDJSON_DO_JOIN(X, Y)\n#define RAPIDJSON_DO_JOIN(X, Y) RAPIDJSON_DO_JOIN2(X, Y)\n#define RAPIDJSON_DO_JOIN2(X, Y) X##Y\n\n#if defined(__GNUC__)\n#define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))\n#else\n#define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE \n#endif\n//!@endcond\n\n/*! \\def RAPIDJSON_STATIC_ASSERT\n    \\brief (Internal) macro to check for conditions at compile-time\n    \\param x compile-time condition\n    \\hideinitializer\n */\n#define RAPIDJSON_STATIC_ASSERT(x) typedef ::rapidjson::StaticAssertTest<\\\n    sizeof(::rapidjson::STATIC_ASSERTION_FAILURE<bool(x) >)>\\\n    RAPIDJSON_JOIN(StaticAssertTypedef, __LINE__) RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE\n#endif\n\n///////////////////////////////////////////////////////////////////////////////\n// Helpers\n\n//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN\n\n#define RAPIDJSON_MULTILINEMACRO_BEGIN do {  \n#define RAPIDJSON_MULTILINEMACRO_END \\\n} while((void)0, 0)\n\n// adopted from Boost\n#define RAPIDJSON_VERSION_CODE(x,y,z) \\\n  (((x)*100000) + ((y)*100) + (z))\n\n// token stringification\n#define RAPIDJSON_STRINGIFY(x) RAPIDJSON_DO_STRINGIFY(x)\n#define RAPIDJSON_DO_STRINGIFY(x) #x\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_DIAG_PUSH/POP, RAPIDJSON_DIAG_OFF\n\n#if defined(__GNUC__)\n#define RAPIDJSON_GNUC \\\n    RAPIDJSON_VERSION_CODE(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__)\n#endif\n\n#if defined(__clang__) || (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,2,0))\n\n#define RAPIDJSON_PRAGMA(x) _Pragma(RAPIDJSON_STRINGIFY(x))\n#define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(GCC diagnostic x)\n#define RAPIDJSON_DIAG_OFF(x) \\\n    RAPIDJSON_DIAG_PRAGMA(ignored RAPIDJSON_STRINGIFY(RAPIDJSON_JOIN(-W,x)))\n\n// push/pop support in Clang and GCC>=4.6\n#if defined(__clang__) || (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0))\n#define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push)\n#define RAPIDJSON_DIAG_POP  RAPIDJSON_DIAG_PRAGMA(pop)\n#else // GCC >= 4.2, < 4.6\n#define RAPIDJSON_DIAG_PUSH /* ignored */\n#define RAPIDJSON_DIAG_POP /* ignored */\n#endif\n\n#elif defined(_MSC_VER)\n\n// pragma (MSVC specific)\n#define RAPIDJSON_PRAGMA(x) __pragma(x)\n#define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(warning(x))\n\n#define RAPIDJSON_DIAG_OFF(x) RAPIDJSON_DIAG_PRAGMA(disable: x)\n#define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push)\n#define RAPIDJSON_DIAG_POP  RAPIDJSON_DIAG_PRAGMA(pop)\n\n#else\n\n#define RAPIDJSON_DIAG_OFF(x) /* ignored */\n#define RAPIDJSON_DIAG_PUSH   /* ignored */\n#define RAPIDJSON_DIAG_POP    /* ignored */\n\n#endif // RAPIDJSON_DIAG_*\n\n///////////////////////////////////////////////////////////////////////////////\n// C++11 features\n\n#ifndef RAPIDJSON_HAS_CXX11_RVALUE_REFS\n#if defined(__clang__)\n#define RAPIDJSON_HAS_CXX11_RVALUE_REFS __has_feature(cxx_rvalue_references)\n#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \\\n      (defined(_MSC_VER) && _MSC_VER >= 1600)\n\n#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1\n#else\n#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0\n#endif\n#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS\n\n#ifndef RAPIDJSON_HAS_CXX11_NOEXCEPT\n#if defined(__clang__)\n#define RAPIDJSON_HAS_CXX11_NOEXCEPT __has_feature(cxx_noexcept)\n#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__))\n//    (defined(_MSC_VER) && _MSC_VER >= ????) // not yet supported\n#define RAPIDJSON_HAS_CXX11_NOEXCEPT 1\n#else\n#define RAPIDJSON_HAS_CXX11_NOEXCEPT 0\n#endif\n#endif\n#if RAPIDJSON_HAS_CXX11_NOEXCEPT\n#define RAPIDJSON_NOEXCEPT noexcept\n#else\n#define RAPIDJSON_NOEXCEPT /* noexcept */\n#endif // RAPIDJSON_HAS_CXX11_NOEXCEPT\n\n// no automatic detection, yet\n#ifndef RAPIDJSON_HAS_CXX11_TYPETRAITS\n#define RAPIDJSON_HAS_CXX11_TYPETRAITS 0\n#endif\n\n//!@endcond\n\n///////////////////////////////////////////////////////////////////////////////\n// Allocators and Encodings\n\n#include \"allocators.h\"\n#include \"encodings.h\"\n\n//! main RapidJSON namespace\nnamespace rapidjson {\n\n///////////////////////////////////////////////////////////////////////////////\n//  Stream\n\n/*! \\class rapidjson::Stream\n    \\brief Concept for reading and writing characters.\n\n    For read-only stream, no need to implement PutBegin(), Put(), Flush() and PutEnd().\n\n    For write-only stream, only need to implement Put() and Flush().\n\n\\code\nconcept Stream {\n    typename Ch;    //!< Character type of the stream.\n\n    //! Read the current character from stream without moving the read cursor.\n    Ch Peek() const;\n\n    //! Read the current character from stream and moving the read cursor to next character.\n    Ch Take();\n\n    //! Get the current read cursor.\n    //! \\return Number of characters read from start.\n    size_t Tell();\n\n    //! Begin writing operation at the current read pointer.\n    //! \\return The begin writer pointer.\n    Ch* PutBegin();\n\n    //! Write a character.\n    void Put(Ch c);\n\n    //! Flush the buffer.\n    void Flush();\n\n    //! End the writing operation.\n    //! \\param begin The begin write pointer returned by PutBegin().\n    //! \\return Number of characters written.\n    size_t PutEnd(Ch* begin);\n}\n\\endcode\n*/\n\n//! Provides additional information for stream.\n/*!\n    By using traits pattern, this type provides a default configuration for stream.\n    For custom stream, this type can be specialized for other configuration.\n    See TEST(Reader, CustomStringStream) in readertest.cpp for example.\n*/\ntemplate<typename Stream>\nstruct StreamTraits {\n    //! Whether to make local copy of stream for optimization during parsing.\n    /*!\n        By default, for safety, streams do not use local copy optimization.\n        Stream that can be copied fast should specialize this, like StreamTraits<StringStream>.\n    */\n    enum { copyOptimization = 0 };\n};\n\n//! Put N copies of a character to a stream.\ntemplate<typename Stream, typename Ch>\ninline void PutN(Stream& stream, Ch c, size_t n) {\n    for (size_t i = 0; i < n; i++)\n        stream.Put(c);\n}\n\n///////////////////////////////////////////////////////////////////////////////\n// StringStream\n\n//! Read-only string stream.\n/*! \\note implements Stream concept\n*/\ntemplate <typename Encoding>\nstruct GenericStringStream {\n    typedef typename Encoding::Ch Ch;\n\n    GenericStringStream(const Ch *src) : src_(src), head_(src) {}\n\n    Ch Peek() const { return *src_; }\n    Ch Take() { return *src_++; }\n    size_t Tell() const { return static_cast<size_t>(src_ - head_); }\n\n    Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }\n    void Put(Ch) { RAPIDJSON_ASSERT(false); }\n    void Flush() { RAPIDJSON_ASSERT(false); }\n    size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }\n\n    const Ch* src_;     //!< Current read position.\n    const Ch* head_;    //!< Original head of the string.\n};\n\ntemplate <typename Encoding>\nstruct StreamTraits<GenericStringStream<Encoding> > {\n    enum { copyOptimization = 1 };\n};\n\n//! String stream with UTF8 encoding.\ntypedef GenericStringStream<UTF8<> > StringStream;\n\n///////////////////////////////////////////////////////////////////////////////\n// InsituStringStream\n\n//! A read-write string stream.\n/*! This string stream is particularly designed for in-situ parsing.\n    \\note implements Stream concept\n*/\ntemplate <typename Encoding>\nstruct GenericInsituStringStream {\n    typedef typename Encoding::Ch Ch;\n\n    GenericInsituStringStream(Ch *src) : src_(src), dst_(0), head_(src) {}\n\n    // Read\n    Ch Peek() { return *src_; }\n    Ch Take() { return *src_++; }\n    size_t Tell() { return static_cast<size_t>(src_ - head_); }\n\n    // Write\n    void Put(Ch c) { RAPIDJSON_ASSERT(dst_ != 0); *dst_++ = c; }\n\n    Ch* PutBegin() { return dst_ = src_; }\n    size_t PutEnd(Ch* begin) { return static_cast<size_t>(dst_ - begin); }\n    void Flush() {}\n\n    Ch* Push(size_t count) { Ch* begin = dst_; dst_ += count; return begin; }\n    void Pop(size_t count) { dst_ -= count; }\n\n    Ch* src_;\n    Ch* dst_;\n    Ch* head_;\n};\n\ntemplate <typename Encoding>\nstruct StreamTraits<GenericInsituStringStream<Encoding> > {\n    enum { copyOptimization = 1 };\n};\n\n//! Insitu string stream with UTF8 encoding.\ntypedef GenericInsituStringStream<UTF8<> > InsituStringStream;\n\n///////////////////////////////////////////////////////////////////////////////\n// Type\n\n//! Type of JSON value\nenum Type {\n    kNullType = 0,      //!< null\n    kFalseType = 1,     //!< false\n    kTrueType = 2,      //!< true\n    kObjectType = 3,    //!< object\n    kArrayType = 4,     //!< array \n    kStringType = 5,    //!< string\n    kNumberType = 6     //!< number\n};\n\n} // namespace rapidjson\n\n#endif // RAPIDJSON_RAPIDJSON_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/reader.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_READER_H_\n#define RAPIDJSON_READER_H_\n\n/*! \\file reader.h */\n\n#include \"rapidjson.h\"\n#include \"encodings.h\"\n#include \"internal/meta.h\"\n#include \"internal/pow10.h\"\n#include \"internal/stack.h\"\n\n#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER)\n#include <intrin.h>\n#pragma intrinsic(_BitScanForward)\n#endif\n#ifdef RAPIDJSON_SSE42\n#include <nmmintrin.h>\n#elif defined(RAPIDJSON_SSE2)\n#include <emmintrin.h>\n#endif\n\n#ifdef _MSC_VER\nRAPIDJSON_DIAG_PUSH\nRAPIDJSON_DIAG_OFF(4127)  // conditional expression is constant\nRAPIDJSON_DIAG_OFF(4702)  // unreachable code\n#endif\n\n//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN\n#define RAPIDJSON_NOTHING /* deliberately empty */\n#ifndef RAPIDJSON_PARSE_ERROR_EARLY_RETURN\n#define RAPIDJSON_PARSE_ERROR_EARLY_RETURN(value) \\\n    RAPIDJSON_MULTILINEMACRO_BEGIN \\\n    if (HasParseError()) { return value; } \\\n    RAPIDJSON_MULTILINEMACRO_END\n#endif\n#define RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID \\\n    RAPIDJSON_PARSE_ERROR_EARLY_RETURN(RAPIDJSON_NOTHING)\n//!@endcond\n\n/*! \\def RAPIDJSON_PARSE_ERROR_NORETURN\n    \\ingroup RAPIDJSON_ERRORS\n    \\brief Macro to indicate a parse error.\n    \\param parseErrorCode \\ref rapidjson::ParseErrorCode of the error\n    \\param offset  position of the error in JSON input (\\c size_t)\n\n    This macros can be used as a customization point for the internal\n    error handling mechanism of RapidJSON.\n\n    A common usage model is to throw an exception instead of requiring the\n    caller to explicitly check the \\ref rapidjson::GenericReader::Parse's\n    return value:\n\n    \\code\n    #define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode,offset) \\\n       throw ParseException(parseErrorCode, #parseErrorCode, offset)\n\n    #include <stdexcept>               // std::runtime_error\n    #include \"rapidjson/error/error.h\" // rapidjson::ParseResult\n\n    struct ParseException : std::runtime_error, rapidjson::ParseResult {\n      ParseException(rapidjson::ParseErrorCode code, const char* msg, size_t offset)\n        : std::runtime_error(msg), ParseResult(code, offset) {}\n    };\n\n    #include \"rapidjson/reader.h\"\n    \\endcode\n\n    \\see RAPIDJSON_PARSE_ERROR, rapidjson::GenericReader::Parse\n */\n#ifndef RAPIDJSON_PARSE_ERROR_NORETURN\n#define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset) \\\n    RAPIDJSON_MULTILINEMACRO_BEGIN \\\n    RAPIDJSON_ASSERT(!HasParseError()); /* Error can only be assigned once */ \\\n    SetParseError(parseErrorCode, offset); \\\n    RAPIDJSON_MULTILINEMACRO_END\n#endif\n\n/*! \\def RAPIDJSON_PARSE_ERROR\n    \\ingroup RAPIDJSON_ERRORS\n    \\brief (Internal) macro to indicate and handle a parse error.\n    \\param parseErrorCode \\ref rapidjson::ParseErrorCode of the error\n    \\param offset  position of the error in JSON input (\\c size_t)\n\n    Invokes RAPIDJSON_PARSE_ERROR_NORETURN and stops the parsing.\n\n    \\see RAPIDJSON_PARSE_ERROR_NORETURN\n    \\hideinitializer\n */\n#ifndef RAPIDJSON_PARSE_ERROR\n#define RAPIDJSON_PARSE_ERROR(parseErrorCode, offset) \\\n    RAPIDJSON_MULTILINEMACRO_BEGIN \\\n    RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset); \\\n    RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; \\\n    RAPIDJSON_MULTILINEMACRO_END\n#endif\n\n#include \"error/error.h\" // ParseErrorCode, ParseResult\n\nnamespace rapidjson {\n\n///////////////////////////////////////////////////////////////////////////////\n// ParseFlag\n\n//! Combination of parseFlags\n/*! \\see Reader::Parse, Document::Parse, Document::ParseInsitu, Document::ParseStream\n */\nenum ParseFlag {\n    kParseDefaultFlags = 0,         //!< Default parse flags. Non-destructive parsing. Text strings are decoded into allocated buffer.\n    kParseInsituFlag = 1,           //!< In-situ(destructive) parsing.\n    kParseValidateEncodingFlag = 2, //!< Validate encoding of JSON strings.\n    kParseIterativeFlag = 4,        //!< Iterative(constant complexity in terms of function call stack size) parsing.\n    kParseStopWhenDoneFlag = 8      //!< After parsing a complete JSON root from stream, stop further processing the rest of stream. When this flag is used, parser will not generate kParseErrorDocumentRootNotSingular error.\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// Handler\n\n/*! \\class rapidjson::Handler\n    \\brief Concept for receiving events from GenericReader upon parsing.\n    The functions return true if no error occurs. If they return false, \n    the event publisher should terminate the process.\n\\code\nconcept Handler {\n    typename Ch;\n\n    bool Null();\n    bool Bool(bool b);\n    bool Int(int i);\n    bool Uint(unsigned i);\n    bool Int64(int64_t i);\n    bool Uint64(uint64_t i);\n    bool Double(double d);\n    bool String(const Ch* str, SizeType length, bool copy);\n    bool StartObject();\n    bool Key(const Ch* str, SizeType length, bool copy);\n    bool EndObject(SizeType memberCount);\n    bool StartArray();\n    bool EndArray(SizeType elementCount);\n};\n\\endcode\n*/\n///////////////////////////////////////////////////////////////////////////////\n// BaseReaderHandler\n\n//! Default implementation of Handler.\n/*! This can be used as base class of any reader handler.\n    \\note implements Handler concept\n*/\ntemplate<typename Encoding = UTF8<>, typename Derived = void>\nstruct BaseReaderHandler {\n    typedef typename Encoding::Ch Ch;\n\n    typedef typename internal::SelectIf<internal::IsSame<Derived, void>, BaseReaderHandler, Derived>::Type Override;\n\n    bool Default() { return true; }\n    bool Null() { return static_cast<Override&>(*this).Default(); }\n    bool Bool(bool) { return static_cast<Override&>(*this).Default(); }\n    bool Int(int) { return static_cast<Override&>(*this).Default(); }\n    bool Uint(unsigned) { return static_cast<Override&>(*this).Default(); }\n    bool Int64(int64_t) { return static_cast<Override&>(*this).Default(); }\n    bool Uint64(uint64_t) { return static_cast<Override&>(*this).Default(); }\n    bool Double(double) { return static_cast<Override&>(*this).Default(); }\n    bool String(const Ch*, SizeType, bool) { return static_cast<Override&>(*this).Default(); }\n    bool StartObject() { return static_cast<Override&>(*this).Default(); }\n    bool Key(const Ch* str, SizeType len, bool copy) { return static_cast<Override&>(*this).String(str, len, copy); }\n    bool EndObject(SizeType) { return static_cast<Override&>(*this).Default(); }\n    bool StartArray() { return static_cast<Override&>(*this).Default(); }\n    bool EndArray(SizeType) { return static_cast<Override&>(*this).Default(); }\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// StreamLocalCopy\n\nnamespace internal {\n\ntemplate<typename Stream, int = StreamTraits<Stream>::copyOptimization>\nclass StreamLocalCopy;\n\n//! Do copy optimization.\ntemplate<typename Stream>\nclass StreamLocalCopy<Stream, 1> {\npublic:\n    StreamLocalCopy(Stream& original) : s(original), original_(original) {}\n    ~StreamLocalCopy() { original_ = s; }\n\n    Stream s;\n\nprivate:\n    StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */;\n\n    Stream& original_;\n};\n\n//! Keep reference.\ntemplate<typename Stream>\nclass StreamLocalCopy<Stream, 0> {\npublic:\n    StreamLocalCopy(Stream& original) : s(original) {}\n\n    Stream& s;\n\nprivate:\n    StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */;\n};\n\n} // namespace internal\n\n///////////////////////////////////////////////////////////////////////////////\n// SkipWhitespace\n\n//! Skip the JSON white spaces in a stream.\n/*! \\param is A input stream for skipping white spaces.\n    \\note This function has SSE2/SSE4.2 specialization.\n*/\ntemplate<typename InputStream>\nvoid SkipWhitespace(InputStream& is) {\n    internal::StreamLocalCopy<InputStream> copy(is);\n    InputStream& s(copy.s);\n\n    while (s.Peek() == ' ' || s.Peek() == '\\n' || s.Peek() == '\\r' || s.Peek() == '\\t')\n        s.Take();\n}\n\n#ifdef RAPIDJSON_SSE42\n//! Skip whitespace with SSE 4.2 pcmpistrm instruction, testing 16 8-byte characters at once.\ninline const char *SkipWhitespace_SIMD(const char* p) {\n\t// Fast return for single non-whitespace\n\tif (*p == ' ' || *p == '\\n' || *p == '\\r' || *p == '\\t')\n\t\t++p;\n\telse\n\t\treturn p;\n\n\t// 16-byte align to the next boundary\n\tconst char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & ~15);\n\twhile (p != nextAligned)\n\t\tif (*p == ' ' || *p == '\\n' || *p == '\\r' || *p == '\\t')\n\t\t\t++p;\n\t\telse\n\t\t\treturn p;\n\n    // The rest of string using SIMD\n\tstatic const char whitespace[16] = \" \\n\\r\\t\";\n\tconst __m128i w = _mm_loadu_si128((const __m128i *)&whitespace[0]);\n\n    for (;; p += 16) {\n        const __m128i s = _mm_load_si128((const __m128i *)p);\n        const unsigned r = _mm_cvtsi128_si32(_mm_cmpistrm(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_BIT_MASK | _SIDD_NEGATIVE_POLARITY));\n        if (r != 0) {   // some of characters is non-whitespace\n#ifdef _MSC_VER         // Find the index of first non-whitespace\n            unsigned long offset;\n            _BitScanForward(&offset, r);\n            return p + offset;\n#else\n            return p + __builtin_ffs(r) - 1;\n#endif\n        }\n    }\n}\n\n#elif defined(RAPIDJSON_SSE2)\n\n//! Skip whitespace with SSE2 instructions, testing 16 8-byte characters at once.\ninline const char *SkipWhitespace_SIMD(const char* p) {\n\t// Fast return for single non-whitespace\n\tif (*p == ' ' || *p == '\\n' || *p == '\\r' || *p == '\\t')\n\t\t++p;\n\telse\n\t\treturn p;\n\n    // 16-byte align to the next boundary\n\tconst char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & ~15);\n\twhile (p != nextAligned)\n\t\tif (*p == ' ' || *p == '\\n' || *p == '\\r' || *p == '\\t')\n\t\t\t++p;\n\t\telse\n\t\t\treturn p;\n\n    // The rest of string\n\tstatic const char whitespaces[4][17] = {\n\t\t\"                \",\n\t\t\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\n\t\t\"\\r\\r\\r\\r\\r\\r\\r\\r\\r\\r\\r\\r\\r\\r\\r\\r\",\n\t\t\"\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\"};\n\n\t\tconst __m128i w0 = _mm_loadu_si128((const __m128i *)&whitespaces[0][0]);\n\t\tconst __m128i w1 = _mm_loadu_si128((const __m128i *)&whitespaces[1][0]);\n\t\tconst __m128i w2 = _mm_loadu_si128((const __m128i *)&whitespaces[2][0]);\n\t\tconst __m128i w3 = _mm_loadu_si128((const __m128i *)&whitespaces[3][0]);\n\n    for (;; p += 16) {\n        const __m128i s = _mm_load_si128((const __m128i *)p);\n        __m128i x = _mm_cmpeq_epi8(s, w0);\n        x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1));\n        x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2));\n        x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3));\n        unsigned short r = (unsigned short)~_mm_movemask_epi8(x);\n        if (r != 0) {   // some of characters may be non-whitespace\n#ifdef _MSC_VER         // Find the index of first non-whitespace\n            unsigned long offset;\n            _BitScanForward(&offset, r);\n            return p + offset;\n#else\n            return p + __builtin_ffs(r) - 1;\n#endif\n        }\n    }\n}\n\n#endif // RAPIDJSON_SSE2\n\n#ifdef RAPIDJSON_SIMD\n//! Template function specialization for InsituStringStream\ntemplate<> inline void SkipWhitespace(InsituStringStream& is) { \n    is.src_ = const_cast<char*>(SkipWhitespace_SIMD(is.src_));\n}\n\n//! Template function specialization for StringStream\ntemplate<> inline void SkipWhitespace(StringStream& is) {\n    is.src_ = SkipWhitespace_SIMD(is.src_);\n}\n#endif // RAPIDJSON_SIMD\n\n///////////////////////////////////////////////////////////////////////////////\n// GenericReader\n\n//! SAX-style JSON parser. Use \\ref Reader for UTF8 encoding and default allocator.\n/*! GenericReader parses JSON text from a stream, and send events synchronously to an \n    object implementing Handler concept.\n\n    It needs to allocate a stack for storing a single decoded string during \n    non-destructive parsing.\n\n    For in-situ parsing, the decoded string is directly written to the source \n    text string, no temporary buffer is required.\n\n    A GenericReader object can be reused for parsing multiple JSON text.\n    \n    \\tparam SourceEncoding Encoding of the input stream.\n    \\tparam TargetEncoding Encoding of the parse output.\n    \\tparam StackAllocator Allocator type for stack.\n*/\ntemplate <typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>\nclass GenericReader {\npublic:\n    typedef typename SourceEncoding::Ch Ch; //!< SourceEncoding character type\n\n    //! Constructor.\n    /*! \\param allocator Optional allocator for allocating stack memory. (Only use for non-destructive parsing)\n        \\param stackCapacity stack capacity in bytes for storing a single decoded string.  (Only use for non-destructive parsing)\n    */\n    GenericReader(StackAllocator* stackAllocator = 0, size_t stackCapacity = kDefaultStackCapacity) : stack_(stackAllocator, stackCapacity), parseResult_() {}\n\n    //! Parse JSON text.\n    /*! \\tparam parseFlags Combination of \\ref ParseFlag.\n        \\tparam InputStream Type of input stream, implementing Stream concept.\n        \\tparam Handler Type of handler, implementing Handler concept.\n        \\param is Input stream to be parsed.\n        \\param handler The handler to receive events.\n        \\return Whether the parsing is successful.\n    */\n    template <unsigned parseFlags, typename InputStream, typename Handler>\n    ParseResult Parse(InputStream& is, Handler& handler) {\n        if (parseFlags & kParseIterativeFlag)\n            return IterativeParse<parseFlags>(is, handler);\n\n        parseResult_.Clear();\n\n        ClearStackOnExit scope(*this);\n\n        SkipWhitespace(is);\n\n        if (is.Peek() == '\\0') {\n            RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentEmpty, is.Tell());\n            RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);\n        }\n        else {\n            ParseValue<parseFlags>(is, handler);\n            RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);\n\n            if (!(parseFlags & kParseStopWhenDoneFlag)) {\n                SkipWhitespace(is);\n\n                if (is.Peek() != '\\0') {\n                    RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentRootNotSingular, is.Tell());\n                    RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);\n                }\n            }\n        }\n\n        return parseResult_;\n    }\n\n    //! Parse JSON text (with \\ref kParseDefaultFlags)\n    /*! \\tparam InputStream Type of input stream, implementing Stream concept\n        \\tparam Handler Type of handler, implementing Handler concept.\n        \\param is Input stream to be parsed.\n        \\param handler The handler to receive events.\n        \\return Whether the parsing is successful.\n    */\n    template <typename InputStream, typename Handler>\n    ParseResult Parse(InputStream& is, Handler& handler) {\n        return Parse<kParseDefaultFlags>(is, handler);\n    }\n\n    //! Whether a parse error has occured in the last parsing.\n    bool HasParseError() const { return parseResult_.IsError(); }\n    \n    //! Get the \\ref ParseErrorCode of last parsing.\n    ParseErrorCode GetParseErrorCode() const { return parseResult_.Code(); }\n\n    //! Get the position of last parsing error in input, 0 otherwise.\n    size_t GetErrorOffset() const { return parseResult_.Offset(); }\n\nprotected:\n    void SetParseError(ParseErrorCode code, size_t offset) { parseResult_.Set(code, offset); }\n\nprivate:\n    // Prohibit copy constructor & assignment operator.\n    GenericReader(const GenericReader&);\n    GenericReader& operator=(const GenericReader&);\n\n    void ClearStack() { stack_.Clear(); }\n\n    // clear stack on any exit from ParseStream, e.g. due to exception\n    struct ClearStackOnExit {\n        explicit ClearStackOnExit(GenericReader& r) : r_(r) {}\n        ~ClearStackOnExit() { r_.ClearStack(); }\n    private:\n        GenericReader& r_;\n        ClearStackOnExit(const ClearStackOnExit&);\n        ClearStackOnExit& operator=(const ClearStackOnExit&);\n    };\n\n    // Parse object: { string : value, ... }\n    template<unsigned parseFlags, typename InputStream, typename Handler>\n    void ParseObject(InputStream& is, Handler& handler) {\n        RAPIDJSON_ASSERT(is.Peek() == '{');\n        is.Take();  // Skip '{'\n        \n        if (!handler.StartObject())\n            RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());\n\n        SkipWhitespace(is);\n\n        if (is.Peek() == '}') {\n            is.Take();\n            if (!handler.EndObject(0))  // empty object\n                RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());\n            return;\n        }\n\n        for (SizeType memberCount = 0;;) {\n            if (is.Peek() != '\"')\n                RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell());\n\n            ParseString<parseFlags>(is, handler, true);\n            RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;\n\n            SkipWhitespace(is);\n\n            if (is.Take() != ':')\n                RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell());\n\n            SkipWhitespace(is);\n\n            ParseValue<parseFlags>(is, handler);\n            RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;\n\n            SkipWhitespace(is);\n\n            ++memberCount;\n\n            switch (is.Take()) {\n                case ',': SkipWhitespace(is); break;\n                case '}': \n                    if (!handler.EndObject(memberCount))\n                        RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());\n                    else\n                        return;\n                default:  RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell());\n            }\n        }\n    }\n\n    // Parse array: [ value, ... ]\n    template<unsigned parseFlags, typename InputStream, typename Handler>\n    void ParseArray(InputStream& is, Handler& handler) {\n        RAPIDJSON_ASSERT(is.Peek() == '[');\n        is.Take();  // Skip '['\n        \n        if (!handler.StartArray())\n            RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());\n        \n        SkipWhitespace(is);\n\n        if (is.Peek() == ']') {\n            is.Take();\n            if (!handler.EndArray(0)) // empty array\n                RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());\n            return;\n        }\n\n        for (SizeType elementCount = 0;;) {\n            ParseValue<parseFlags>(is, handler);\n            RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;\n\n            ++elementCount;\n            SkipWhitespace(is);\n\n            switch (is.Take()) {\n                case ',': SkipWhitespace(is); break;\n                case ']': \n                    if (!handler.EndArray(elementCount))\n                        RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());\n                    else\n                        return;\n                default:  RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell());\n            }\n        }\n    }\n\n    template<unsigned parseFlags, typename InputStream, typename Handler>\n    void ParseNull(InputStream& is, Handler& handler) {\n        RAPIDJSON_ASSERT(is.Peek() == 'n');\n        is.Take();\n\n        if (is.Take() == 'u' && is.Take() == 'l' && is.Take() == 'l') {\n            if (!handler.Null())\n                RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());\n        }\n        else\n            RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell() - 1);\n    }\n\n    template<unsigned parseFlags, typename InputStream, typename Handler>\n    void ParseTrue(InputStream& is, Handler& handler) {\n        RAPIDJSON_ASSERT(is.Peek() == 't');\n        is.Take();\n\n        if (is.Take() == 'r' && is.Take() == 'u' && is.Take() == 'e') {\n            if (!handler.Bool(true))\n                RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());\n        }\n        else\n            RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell() - 1);\n    }\n\n    template<unsigned parseFlags, typename InputStream, typename Handler>\n    void ParseFalse(InputStream& is, Handler& handler) {\n        RAPIDJSON_ASSERT(is.Peek() == 'f');\n        is.Take();\n\n        if (is.Take() == 'a' && is.Take() == 'l' && is.Take() == 's' && is.Take() == 'e') {\n            if (!handler.Bool(false))\n                RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());\n        }\n        else\n            RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell() - 1);\n    }\n\n    // Helper function to parse four hexidecimal digits in \\uXXXX in ParseString().\n    template<typename InputStream>\n    unsigned ParseHex4(InputStream& is) {\n        unsigned codepoint = 0;\n        for (int i = 0; i < 4; i++) {\n            Ch c = is.Take();\n            codepoint <<= 4;\n            codepoint += static_cast<unsigned>(c);\n            if (c >= '0' && c <= '9')\n                codepoint -= '0';\n            else if (c >= 'A' && c <= 'F')\n                codepoint -= 'A' - 10;\n            else if (c >= 'a' && c <= 'f')\n                codepoint -= 'a' - 10;\n            else {\n                RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorStringUnicodeEscapeInvalidHex, is.Tell() - 1);\n                RAPIDJSON_PARSE_ERROR_EARLY_RETURN(0);\n            }\n        }\n        return codepoint;\n    }\n\n    class StackStream {\n    public:\n        typedef typename TargetEncoding::Ch Ch;\n\n        StackStream(internal::Stack<StackAllocator>& stack) : stack_(stack), length_(0) {}\n        RAPIDJSON_FORCEINLINE void Put(Ch c) {\n            *stack_.template Push<Ch>() = c;\n            ++length_;\n        }\n        internal::Stack<StackAllocator>& stack_;\n        SizeType length_;\n\n    private:\n        StackStream(const StackStream&);\n        StackStream& operator=(const StackStream&);\n    };\n\n    // Parse string and generate String event. Different code paths for kParseInsituFlag.\n    template<unsigned parseFlags, typename InputStream, typename Handler>\n    void ParseString(InputStream& is, Handler& handler, bool isKey = false) {\n        internal::StreamLocalCopy<InputStream> copy(is);\n        InputStream& s(copy.s);\n\n        bool success = false;\n        if (parseFlags & kParseInsituFlag) {\n            typename InputStream::Ch *head = s.PutBegin();\n            ParseStringToStream<parseFlags, SourceEncoding, SourceEncoding>(s, s);\n            RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;\n            size_t length = s.PutEnd(head) - 1;\n            RAPIDJSON_ASSERT(length <= 0xFFFFFFFF);\n            const typename TargetEncoding::Ch* const str = (typename TargetEncoding::Ch*)head;\n            success = (isKey ? handler.Key(str, SizeType(length), false) : handler.String(str, SizeType(length), false));\n        }\n        else {\n            StackStream stackStream(stack_);\n            ParseStringToStream<parseFlags, SourceEncoding, TargetEncoding>(s, stackStream);\n            RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;\n            const typename TargetEncoding::Ch* const str = stack_.template Pop<typename TargetEncoding::Ch>(stackStream.length_);\n            success = (isKey ? handler.Key(str, stackStream.length_ - 1, true) : handler.String(str, stackStream.length_ - 1, true));\n        }\n        if (!success)\n            RAPIDJSON_PARSE_ERROR(kParseErrorTermination, s.Tell());\n    }\n\n    // Parse string to an output is\n    // This function handles the prefix/suffix double quotes, escaping, and optional encoding validation.\n    template<unsigned parseFlags, typename SEncoding, typename TEncoding, typename InputStream, typename OutputStream>\n    RAPIDJSON_FORCEINLINE void ParseStringToStream(InputStream& is, OutputStream& os) {\n//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN\n#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n        static const char escape[256] = {\n            Z16, Z16, 0, 0,'\\\"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'/', \n            Z16, Z16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\\\', 0, 0, 0, \n            0, 0,'\\b', 0, 0, 0,'\\f', 0, 0, 0, 0, 0, 0, 0,'\\n', 0, \n            0, 0,'\\r', 0,'\\t', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \n            Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16\n        };\n#undef Z16\n//!@endcond\n\n        RAPIDJSON_ASSERT(is.Peek() == '\\\"');\n        is.Take();  // Skip '\\\"'\n\n        for (;;) {\n            Ch c = is.Peek();\n            if (c == '\\\\') {    // Escape\n                is.Take();\n                Ch e = is.Take();\n                if ((sizeof(Ch) == 1 || unsigned(e) < 256) && escape[(unsigned char)e]) {\n                    os.Put(escape[(unsigned char)e]);\n                }\n                else if (e == 'u') {    // Unicode\n                    unsigned codepoint = ParseHex4(is);\n                    if (codepoint >= 0xD800 && codepoint <= 0xDBFF) {\n                        // Handle UTF-16 surrogate pair\n                        if (is.Take() != '\\\\' || is.Take() != 'u')\n                            RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, is.Tell() - 2);\n                        unsigned codepoint2 = ParseHex4(is);\n                        if (codepoint2 < 0xDC00 || codepoint2 > 0xDFFF)\n                            RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, is.Tell() - 2);\n                        codepoint = (((codepoint - 0xD800) << 10) | (codepoint2 - 0xDC00)) + 0x10000;\n                    }\n                    TEncoding::Encode(os, codepoint);\n                }\n                else\n                    RAPIDJSON_PARSE_ERROR(kParseErrorStringEscapeInvalid, is.Tell() - 1);\n            }\n            else if (c == '\"') {    // Closing double quote\n                is.Take();\n                os.Put('\\0');   // null-terminate the string\n                return;\n            }\n            else if (c == '\\0')\n                RAPIDJSON_PARSE_ERROR(kParseErrorStringMissQuotationMark, is.Tell() - 1);\n            else if ((unsigned)c < 0x20) // RFC 4627: unescaped = %x20-21 / %x23-5B / %x5D-10FFFF\n                RAPIDJSON_PARSE_ERROR(kParseErrorStringEscapeInvalid, is.Tell() - 1);\n            else {\n                if (parseFlags & kParseValidateEncodingFlag ? \n                    !Transcoder<SEncoding, TEncoding>::Validate(is, os) : \n                    !Transcoder<SEncoding, TEncoding>::Transcode(is, os))\n                    RAPIDJSON_PARSE_ERROR(kParseErrorStringInvalidEncoding, is.Tell());\n            }\n        }\n    }\n\n    inline double StrtodFastPath(double significand, int exp) {\n        // Fast path only works on limited range of values.\n        // But for simplicity and performance, currently only implement this.\n        // see http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/\n        if (exp < -308)\n            return 0.0;\n        else if (exp >= 0)\n            return significand * internal::Pow10(exp);\n        else\n            return significand / internal::Pow10(-exp);\n    }\n\n    template<unsigned parseFlags, typename InputStream, typename Handler>\n    void ParseNumber(InputStream& is, Handler& handler) {\n        internal::StreamLocalCopy<InputStream> copy(is);\n        InputStream& s(copy.s);\n\n        // Parse minus\n        bool minus = false;\n        if (s.Peek() == '-') {\n            minus = true;\n            s.Take();\n        }\n\n        // Parse int: zero / ( digit1-9 *DIGIT )\n        unsigned i = 0;\n        uint64_t i64 = 0;\n        bool use64bit = false;\n        if (s.Peek() == '0') {\n            i = 0;\n            s.Take();\n        }\n        else if (s.Peek() >= '1' && s.Peek() <= '9') {\n            i = static_cast<unsigned>(s.Take() - '0');\n\n            if (minus)\n                while (s.Peek() >= '0' && s.Peek() <= '9') {\n                    if (i >= 214748364) { // 2^31 = 2147483648\n                        if (i != 214748364 || s.Peek() > '8') {\n                            i64 = i;\n                            use64bit = true;\n                            break;\n                        }\n                    }\n                    i = i * 10 + static_cast<unsigned>(s.Take() - '0');\n                }\n            else\n                while (s.Peek() >= '0' && s.Peek() <= '9') {\n                    if (i >= 429496729) { // 2^32 - 1 = 4294967295\n                        if (i != 429496729 || s.Peek() > '5') {\n                            i64 = i;\n                            use64bit = true;\n                            break;\n                        }\n                    }\n                    i = i * 10 + static_cast<unsigned>(s.Take() - '0');\n                }\n        }\n        else\n            RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell());\n\n        // Parse 64bit int\n        double d = 0.0;\n        bool useDouble = false;\n        if (use64bit) {\n            if (minus) \n                while (s.Peek() >= '0' && s.Peek() <= '9') {                    \n                     if (i64 >= RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC)) // 2^63 = 9223372036854775808\n                        if (i64 != RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC) || s.Peek() > '8') {\n                            d = (double)i64;\n                            useDouble = true;\n                            break;\n                        }\n                    i64 = i64 * 10 + static_cast<unsigned>(s.Take() - '0');\n                }\n            else\n                while (s.Peek() >= '0' && s.Peek() <= '9') {                    \n                    if (i64 >= RAPIDJSON_UINT64_C2(0x19999999, 0x99999999)) // 2^64 - 1 = 18446744073709551615\n                        if (i64 != RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || s.Peek() > '5') {\n                            d = (double)i64;\n                            useDouble = true;\n                            break;\n                        }\n                    i64 = i64 * 10 + static_cast<unsigned>(s.Take() - '0');\n                }\n        }\n\n        // Force double for big integer\n        if (useDouble) {\n            while (s.Peek() >= '0' && s.Peek() <= '9') {\n                if (d >= 1.7976931348623157e307) // DBL_MAX / 10.0\n                    RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, s.Tell());\n                d = d * 10 + (s.Take() - '0');\n            }\n        }\n\n        // Parse frac = decimal-point 1*DIGIT\n        int expFrac = 0;\n        if (s.Peek() == '.') {\n            s.Take();\n\n#if RAPIDJSON_64BIT\n            // Use i64 to store significand in 64-bit architecture\n            if (!useDouble) {\n                if (!use64bit)\n                    i64 = i;\n        \n                while (s.Peek() >= '0' && s.Peek() <= '9') {\n                    if (i64 >= RAPIDJSON_UINT64_C2(0x19999999, 0x99999999))\n                        break;\n                    else {\n                        i64 = i64 * 10 + static_cast<unsigned>(s.Take() - '0');\n                        --expFrac;\n                    }\n                }\n\n                d = (double)i64;\n            }\n#else\n            // Use double to store significand in 32-bit architecture\n            if (!useDouble)\n                d = use64bit ? (double)i64 : (double)i;\n#endif\n            useDouble = true;\n\n            while (s.Peek() >= '0' && s.Peek() <= '9') {\n                d = d * 10 + (s.Take() - '0');\n                --expFrac;\n            }\n\n            if (expFrac == 0)\n                RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissFraction, s.Tell());\n        }\n\n        // Parse exp = e [ minus / plus ] 1*DIGIT\n        int exp = 0;\n        if (s.Peek() == 'e' || s.Peek() == 'E') {\n            if (!useDouble) {\n                d = use64bit ? (double)i64 : (double)i;\n                useDouble = true;\n            }\n            s.Take();\n\n            bool expMinus = false;\n            if (s.Peek() == '+')\n                s.Take();\n            else if (s.Peek() == '-') {\n                s.Take();\n                expMinus = true;\n            }\n\n            if (s.Peek() >= '0' && s.Peek() <= '9') {\n                exp = s.Take() - '0';\n                while (s.Peek() >= '0' && s.Peek() <= '9') {\n                    exp = exp * 10 + (s.Take() - '0');\n                    if (exp > 308 && !expMinus) // exp > 308 should be rare, so it should be checked first.\n                        RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, s.Tell());\n                }\n            }\n            else\n                RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissExponent, s.Tell());\n\n            if (expMinus)\n                exp = -exp;\n        }\n\n        // Finish parsing, call event according to the type of number.\n        bool cont = true;\n        if (useDouble) {\n            int expSum = exp + expFrac;\n            if (expSum < -308) {\n                // Prevent expSum < -308, making Pow10(expSum) = 0\n                d = StrtodFastPath(d, exp);\n                d = StrtodFastPath(d, expFrac);\n            }\n            else\n                d = StrtodFastPath(d, expSum);\n\n            cont = handler.Double(minus ? -d : d);\n        }\n        else {\n            if (use64bit) {\n                if (minus)\n                    cont = handler.Int64(-(int64_t)i64);\n                else\n                    cont = handler.Uint64(i64);\n            }\n            else {\n                if (minus)\n                    cont = handler.Int(-(int)i);\n                else\n                    cont = handler.Uint(i);\n            }\n        }\n        if (!cont)\n            RAPIDJSON_PARSE_ERROR(kParseErrorTermination, s.Tell());\n    }\n\n    // Parse any JSON value\n    template<unsigned parseFlags, typename InputStream, typename Handler>\n    void ParseValue(InputStream& is, Handler& handler) {\n        switch (is.Peek()) {\n            case 'n': ParseNull  <parseFlags>(is, handler); break;\n            case 't': ParseTrue  <parseFlags>(is, handler); break;\n            case 'f': ParseFalse <parseFlags>(is, handler); break;\n            case '\"': ParseString<parseFlags>(is, handler); break;\n            case '{': ParseObject<parseFlags>(is, handler); break;\n            case '[': ParseArray <parseFlags>(is, handler); break;\n            default : ParseNumber<parseFlags>(is, handler);\n        }\n    }\n\n    // Iterative Parsing\n\n    // States\n    enum IterativeParsingState {\n        IterativeParsingStartState = 0,\n        IterativeParsingFinishState,\n        IterativeParsingErrorState,\n\n        // Object states\n        IterativeParsingObjectInitialState,\n        IterativeParsingMemberKeyState,\n        IterativeParsingKeyValueDelimiterState,\n        IterativeParsingMemberValueState,\n        IterativeParsingMemberDelimiterState,\n        IterativeParsingObjectFinishState,\n\n        // Array states\n        IterativeParsingArrayInitialState,\n        IterativeParsingElementState,\n        IterativeParsingElementDelimiterState,\n        IterativeParsingArrayFinishState,\n\n        // Single value state\n        IterativeParsingValueState,\n\n        cIterativeParsingStateCount\n    };\n\n    // Tokens\n    enum Token {\n        LeftBracketToken = 0,\n        RightBracketToken,\n\n        LeftCurlyBracketToken,\n        RightCurlyBracketToken,\n\n        CommaToken,\n        ColonToken,\n\n        StringToken,\n        FalseToken,\n        TrueToken,\n        NullToken,\n        NumberToken,\n\n        kTokenCount\n    };\n\n    RAPIDJSON_FORCEINLINE Token Tokenize(Ch c) {\n\n//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN\n#define N NumberToken\n#define N16 N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N\n        // Maps from ASCII to Token\n        static const unsigned char tokenMap[256] = {\n            N16, // 00~0F\n            N16, // 10~1F\n            N, N, StringToken, N, N, N, N, N, N, N, N, N, CommaToken, N, N, N, // 20~2F\n            N, N, N, N, N, N, N, N, N, N, ColonToken, N, N, N, N, N, // 30~3F\n            N16, // 40~4F\n            N, N, N, N, N, N, N, N, N, N, N, LeftBracketToken, N, RightBracketToken, N, N, // 50~5F\n            N, N, N, N, N, N, FalseToken, N, N, N, N, N, N, N, NullToken, N, // 60~6F\n            N, N, N, N, TrueToken, N, N, N, N, N, N, LeftCurlyBracketToken, N, RightCurlyBracketToken, N, N, // 70~7F\n            N16, N16, N16, N16, N16, N16, N16, N16 // 80~FF\n        };\n#undef N\n#undef N16\n//!@endcond\n        \n        if (sizeof(Ch) == 1 || unsigned(c) < 256)\n            return (Token)tokenMap[(unsigned char)c];\n        else\n            return NumberToken;\n    }\n\n    RAPIDJSON_FORCEINLINE IterativeParsingState Predict(IterativeParsingState state, Token token) {\n        // current state x one lookahead token -> new state\n        static const char G[cIterativeParsingStateCount][kTokenCount] = {\n            // Start\n            {\n                IterativeParsingArrayInitialState,  // Left bracket\n                IterativeParsingErrorState,         // Right bracket\n                IterativeParsingObjectInitialState, // Left curly bracket\n                IterativeParsingErrorState,         // Right curly bracket\n                IterativeParsingErrorState,         // Comma\n                IterativeParsingErrorState,         // Colon\n                IterativeParsingValueState,         // String\n                IterativeParsingValueState,         // False\n                IterativeParsingValueState,         // True\n                IterativeParsingValueState,         // Null\n                IterativeParsingValueState          // Number\n            },\n            // Finish(sink state)\n            {\n                IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,\n                IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,\n                IterativeParsingErrorState\n            },\n            // Error(sink state)\n            {\n                IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,\n                IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,\n                IterativeParsingErrorState\n            },\n            // ObjectInitial\n            {\n                IterativeParsingErrorState,         // Left bracket\n                IterativeParsingErrorState,         // Right bracket\n                IterativeParsingErrorState,         // Left curly bracket\n                IterativeParsingObjectFinishState,  // Right curly bracket\n                IterativeParsingErrorState,         // Comma\n                IterativeParsingErrorState,         // Colon\n                IterativeParsingMemberKeyState,     // String\n                IterativeParsingErrorState,         // False\n                IterativeParsingErrorState,         // True\n                IterativeParsingErrorState,         // Null\n                IterativeParsingErrorState          // Number\n            },\n            // MemberKey\n            {\n                IterativeParsingErrorState,             // Left bracket\n                IterativeParsingErrorState,             // Right bracket\n                IterativeParsingErrorState,             // Left curly bracket\n                IterativeParsingErrorState,             // Right curly bracket\n                IterativeParsingErrorState,             // Comma\n                IterativeParsingKeyValueDelimiterState, // Colon\n                IterativeParsingErrorState,             // String\n                IterativeParsingErrorState,             // False\n                IterativeParsingErrorState,             // True\n                IterativeParsingErrorState,             // Null\n                IterativeParsingErrorState              // Number\n            },\n            // KeyValueDelimiter\n            {\n                IterativeParsingArrayInitialState,      // Left bracket(push MemberValue state)\n                IterativeParsingErrorState,             // Right bracket\n                IterativeParsingObjectInitialState,     // Left curly bracket(push MemberValue state)\n                IterativeParsingErrorState,             // Right curly bracket\n                IterativeParsingErrorState,             // Comma\n                IterativeParsingErrorState,             // Colon\n                IterativeParsingMemberValueState,       // String\n                IterativeParsingMemberValueState,       // False\n                IterativeParsingMemberValueState,       // True\n                IterativeParsingMemberValueState,       // Null\n                IterativeParsingMemberValueState        // Number\n            },\n            // MemberValue\n            {\n                IterativeParsingErrorState,             // Left bracket\n                IterativeParsingErrorState,             // Right bracket\n                IterativeParsingErrorState,             // Left curly bracket\n                IterativeParsingObjectFinishState,      // Right curly bracket\n                IterativeParsingMemberDelimiterState,   // Comma\n                IterativeParsingErrorState,             // Colon\n                IterativeParsingErrorState,             // String\n                IterativeParsingErrorState,             // False\n                IterativeParsingErrorState,             // True\n                IterativeParsingErrorState,             // Null\n                IterativeParsingErrorState              // Number\n            },\n            // MemberDelimiter\n            {\n                IterativeParsingErrorState,         // Left bracket\n                IterativeParsingErrorState,         // Right bracket\n                IterativeParsingErrorState,         // Left curly bracket\n                IterativeParsingErrorState,         // Right curly bracket\n                IterativeParsingErrorState,         // Comma\n                IterativeParsingErrorState,         // Colon\n                IterativeParsingMemberKeyState,     // String\n                IterativeParsingErrorState,         // False\n                IterativeParsingErrorState,         // True\n                IterativeParsingErrorState,         // Null\n                IterativeParsingErrorState          // Number\n            },\n            // ObjectFinish(sink state)\n            {\n                IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,\n                IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,\n                IterativeParsingErrorState\n            },\n            // ArrayInitial\n            {\n                IterativeParsingArrayInitialState,      // Left bracket(push Element state)\n                IterativeParsingArrayFinishState,       // Right bracket\n                IterativeParsingObjectInitialState,     // Left curly bracket(push Element state)\n                IterativeParsingErrorState,             // Right curly bracket\n                IterativeParsingErrorState,             // Comma\n                IterativeParsingErrorState,             // Colon\n                IterativeParsingElementState,           // String\n                IterativeParsingElementState,           // False\n                IterativeParsingElementState,           // True\n                IterativeParsingElementState,           // Null\n                IterativeParsingElementState            // Number\n            },\n            // Element\n            {\n                IterativeParsingErrorState,             // Left bracket\n                IterativeParsingArrayFinishState,       // Right bracket\n                IterativeParsingErrorState,             // Left curly bracket\n                IterativeParsingErrorState,             // Right curly bracket\n                IterativeParsingElementDelimiterState,  // Comma\n                IterativeParsingErrorState,             // Colon\n                IterativeParsingErrorState,             // String\n                IterativeParsingErrorState,             // False\n                IterativeParsingErrorState,             // True\n                IterativeParsingErrorState,             // Null\n                IterativeParsingErrorState              // Number\n            },\n            // ElementDelimiter\n            {\n                IterativeParsingArrayInitialState,      // Left bracket(push Element state)\n                IterativeParsingErrorState,             // Right bracket\n                IterativeParsingObjectInitialState,     // Left curly bracket(push Element state)\n                IterativeParsingErrorState,             // Right curly bracket\n                IterativeParsingErrorState,             // Comma\n                IterativeParsingErrorState,             // Colon\n                IterativeParsingElementState,           // String\n                IterativeParsingElementState,           // False\n                IterativeParsingElementState,           // True\n                IterativeParsingElementState,           // Null\n                IterativeParsingElementState            // Number\n            },\n            // ArrayFinish(sink state)\n            {\n                IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,\n                IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,\n                IterativeParsingErrorState\n            },\n            // Single Value (sink state)\n            {\n                IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,\n                IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,\n                IterativeParsingErrorState\n            }\n        }; // End of G\n\n        return (IterativeParsingState)G[state][token];\n    }\n\n    // Make an advance in the token stream and state based on the candidate destination state which was returned by Transit().\n    // May return a new state on state pop.\n    template <unsigned parseFlags, typename InputStream, typename Handler>\n    RAPIDJSON_FORCEINLINE IterativeParsingState Transit(IterativeParsingState src, Token token, IterativeParsingState dst, InputStream& is, Handler& handler) {\n        switch (dst) {\n        case IterativeParsingStartState:\n            RAPIDJSON_ASSERT(false);\n            return IterativeParsingErrorState;\n\n        case IterativeParsingFinishState:\n            return dst;\n\n        case IterativeParsingErrorState:\n            return dst;\n\n        case IterativeParsingObjectInitialState:\n        case IterativeParsingArrayInitialState:\n        {\n            // Push the state(Element or MemeberValue) if we are nested in another array or value of member.\n            // In this way we can get the correct state on ObjectFinish or ArrayFinish by frame pop.\n            IterativeParsingState n = src;\n            if (src == IterativeParsingArrayInitialState || src == IterativeParsingElementDelimiterState)\n                n = IterativeParsingElementState;\n            else if (src == IterativeParsingKeyValueDelimiterState)\n                n = IterativeParsingMemberValueState;\n            // Push current state.\n            *stack_.template Push<SizeType>(1) = n;\n            // Initialize and push the member/element count.\n            *stack_.template Push<SizeType>(1) = 0;\n            // Call handler\n            bool hr = (dst == IterativeParsingObjectInitialState) ? handler.StartObject() : handler.StartArray();\n            // On handler short circuits the parsing.\n            if (!hr) {\n                RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell());\n                return IterativeParsingErrorState;\n            }\n            else {\n                is.Take();\n                return dst;\n            }\n        }\n\n        case IterativeParsingMemberKeyState:\n            ParseString<parseFlags>(is, handler, true);\n            if (HasParseError())\n                return IterativeParsingErrorState;\n            else\n                return dst;\n\n        case IterativeParsingKeyValueDelimiterState:\n            if (token == ColonToken) {\n                is.Take();\n                return dst;\n            }\n            else\n                return IterativeParsingErrorState;\n\n        case IterativeParsingMemberValueState:\n            // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state.\n            ParseValue<parseFlags>(is, handler);\n            if (HasParseError()) {\n                return IterativeParsingErrorState;\n            }\n            return dst;\n\n        case IterativeParsingElementState:\n            // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state.\n            ParseValue<parseFlags>(is, handler);\n            if (HasParseError()) {\n                return IterativeParsingErrorState;\n            }\n            return dst;\n\n        case IterativeParsingMemberDelimiterState:\n        case IterativeParsingElementDelimiterState:\n            is.Take();\n            // Update member/element count.\n            *stack_.template Top<SizeType>() = *stack_.template Top<SizeType>() + 1;\n            return dst;\n\n        case IterativeParsingObjectFinishState:\n        {\n            // Get member count.\n            SizeType c = *stack_.template Pop<SizeType>(1);\n            // If the object is not empty, count the last member.\n            if (src == IterativeParsingMemberValueState)\n                ++c;\n            // Restore the state.\n            IterativeParsingState n = static_cast<IterativeParsingState>(*stack_.template Pop<SizeType>(1));\n            // Transit to Finish state if this is the topmost scope.\n            if (n == IterativeParsingStartState)\n                n = IterativeParsingFinishState;\n            // Call handler\n            bool hr = handler.EndObject(c);\n            // On handler short circuits the parsing.\n            if (!hr) {\n                RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell());\n                return IterativeParsingErrorState;\n            }\n            else {\n                is.Take();\n                return n;\n            }\n        }\n\n        case IterativeParsingArrayFinishState:\n        {\n            // Get element count.\n            SizeType c = *stack_.template Pop<SizeType>(1);\n            // If the array is not empty, count the last element.\n            if (src == IterativeParsingElementState)\n                ++c;\n            // Restore the state.\n            IterativeParsingState n = static_cast<IterativeParsingState>(*stack_.template Pop<SizeType>(1));\n            // Transit to Finish state if this is the topmost scope.\n            if (n == IterativeParsingStartState)\n                n = IterativeParsingFinishState;\n            // Call handler\n            bool hr = handler.EndArray(c);\n            // On handler short circuits the parsing.\n            if (!hr) {\n                RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell());\n                return IterativeParsingErrorState;\n            }\n            else {\n                is.Take();\n                return n;\n            }\n        }\n\n        case IterativeParsingValueState:\n            // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state.\n            ParseValue<parseFlags>(is, handler);\n            if (HasParseError()) {\n                return IterativeParsingErrorState;\n            }\n            return IterativeParsingFinishState;\n\n        default:\n            RAPIDJSON_ASSERT(false);\n            return IterativeParsingErrorState;\n        }\n    }\n\n    template <typename InputStream>\n    void HandleError(IterativeParsingState src, InputStream& is) {\n        if (HasParseError()) {\n            // Error flag has been set.\n            return;\n        }\n        \n        switch (src) {\n        case IterativeParsingStartState:            RAPIDJSON_PARSE_ERROR(kParseErrorDocumentEmpty, is.Tell());\n        case IterativeParsingFinishState:           RAPIDJSON_PARSE_ERROR(kParseErrorDocumentRootNotSingular, is.Tell());\n        case IterativeParsingObjectInitialState:\n        case IterativeParsingMemberDelimiterState:  RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell());\n        case IterativeParsingMemberKeyState:        RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell());\n        case IterativeParsingMemberValueState:      RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell());\n        case IterativeParsingElementState:          RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell());\n        default:                                    RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell());\n        }       \n    }\n\n    template <unsigned parseFlags, typename InputStream, typename Handler>\n    ParseResult IterativeParse(InputStream& is, Handler& handler) {\n        parseResult_.Clear();\n        ClearStackOnExit scope(*this);\n        IterativeParsingState state = IterativeParsingStartState;\n\n        SkipWhitespace(is);\n        while (is.Peek() != '\\0') {\n            Token t = Tokenize(is.Peek());\n            IterativeParsingState n = Predict(state, t);\n            IterativeParsingState d = Transit<parseFlags>(state, t, n, is, handler);\n\n            if (d == IterativeParsingErrorState) {\n                HandleError(state, is);\n                break;\n            }\n\n            state = d;\n\n            // Do not further consume streams if a root JSON has been parsed.\n            if ((parseFlags & kParseStopWhenDoneFlag) && state == IterativeParsingFinishState)\n                break;\n\n            SkipWhitespace(is);\n        }\n\n        // Handle the end of file.\n        if (state != IterativeParsingFinishState)\n            HandleError(state, is);\n\n        return parseResult_;\n    }\n\n    static const size_t kDefaultStackCapacity = 256;    //!< Default stack capacity in bytes for storing a single decoded string.\n    internal::Stack<StackAllocator> stack_;  //!< A stack for storing decoded string temporarily during non-destructive parsing.\n    ParseResult parseResult_;\n}; // class GenericReader\n\n//! Reader with UTF8 encoding and default allocator.\ntypedef GenericReader<UTF8<>, UTF8<> > Reader;\n\n} // namespace rapidjson\n\n#ifdef _MSC_VER\nRAPIDJSON_DIAG_POP\n#endif\n\n#endif // RAPIDJSON_READER_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/stringbuffer.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_STRINGBUFFER_H_\n#define RAPIDJSON_STRINGBUFFER_H_\n\n#include \"rapidjson.h\"\n#include \"internal/stack.h\"\n\nnamespace rapidjson {\n\n//! Represents an in-memory output stream.\n/*!\n    \\tparam Encoding Encoding of the stream.\n    \\tparam Allocator type for allocating memory buffer.\n    \\note implements Stream concept\n*/\ntemplate <typename Encoding, typename Allocator = CrtAllocator>\nstruct GenericStringBuffer {\n    typedef typename Encoding::Ch Ch;\n\n    GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {}\n\n    void Put(Ch c) { *stack_.template Push<Ch>() = c; }\n    void Flush() {}\n\n    void Clear() { stack_.Clear(); }\n    void ShrinkToFit() {\n        // Push and pop a null terminator. This is safe.\n        *stack_.template Push<Ch>() = '\\0';\n        stack_.ShrinkToFit();\n        stack_.template Pop<Ch>(1);\n    }\n    Ch* Push(size_t count) { return stack_.template Push<Ch>(count); }\n    void Pop(size_t count) { stack_.template Pop<Ch>(count); }\n\n    const Ch* GetString() const {\n        // Push and pop a null terminator. This is safe.\n        *stack_.template Push<Ch>() = '\\0';\n        stack_.template Pop<Ch>(1);\n\n        return stack_.template Bottom<Ch>();\n    }\n\n    size_t GetSize() const { return stack_.GetSize(); }\n\n    static const size_t kDefaultCapacity = 256;\n    mutable internal::Stack<Allocator> stack_;\n};\n\n//! String buffer with UTF8 encoding\ntypedef GenericStringBuffer<UTF8<> > StringBuffer;\n\n//! Implement specialized version of PutN() with memset() for better performance.\ntemplate<>\ninline void PutN(GenericStringBuffer<UTF8<> >& stream, char c, size_t n) {\n    std::memset(stream.stack_.Push<char>(n), c, n * sizeof(c));\n}\n\n} // namespace rapidjson\n\n#endif // RAPIDJSON_STRINGBUFFER_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/include/rapidjson/writer.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef RAPIDJSON_WRITER_H_\n#define RAPIDJSON_WRITER_H_\n\n#include \"rapidjson.h\"\n#include \"internal/stack.h\"\n#include \"internal/strfunc.h\"\n#include \"internal/dtoa.h\"\n#include \"internal/itoa.h\"\n#include \"stringbuffer.h\"\n#include <new>      // placement new\n\n#ifdef _MSC_VER\nRAPIDJSON_DIAG_PUSH\nRAPIDJSON_DIAG_OFF(4127) // conditional expression is constant\n#endif\n\nnamespace rapidjson {\n\n//! JSON writer\n/*! Writer implements the concept Handler.\n    It generates JSON text by events to an output os.\n\n    User may programmatically calls the functions of a writer to generate JSON text.\n\n    On the other side, a writer can also be passed to objects that generates events, \n\n    for example Reader::Parse() and Document::Accept().\n\n    \\tparam OutputStream Type of output stream.\n    \\tparam SourceEncoding Encoding of source string.\n    \\tparam TargetEncoding Encoding of output stream.\n    \\tparam StackAllocator Type of allocator for allocating memory of stack.\n    \\note implements Handler concept\n*/\ntemplate<typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator>\nclass Writer {\npublic:\n    typedef typename SourceEncoding::Ch Ch;\n\n    //! Constructor\n    /*! \\param os Output stream.\n        \\param allocator User supplied allocator. If it is null, it will create a private one.\n        \\param levelDepth Initial capacity of stack.\n    */\n    Writer(OutputStream& os, StackAllocator* stackAllocator = 0, size_t levelDepth = kDefaultLevelDepth) : \n        os_(&os), level_stack_(stackAllocator, levelDepth * sizeof(Level)), hasRoot_(false) {}\n\n    Writer(StackAllocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth) :\n        os_(0), level_stack_(allocator, levelDepth * sizeof(Level)), hasRoot_(false) {}\n\n    //! Reset the writer with a new stream.\n    /*!\n        This function reset the writer with a new stream and default settings,\n        in order to make a Writer object reusable for output multiple JSONs.\n\n        \\param os New output stream.\n        \\code\n        Writer<OutputStream> writer(os1);\n        writer.StartObject();\n        // ...\n        writer.EndObject();\n\n        writer.Reset(os2);\n        writer.StartObject();\n        // ...\n        writer.EndObject();\n        \\endcode\n    */\n    void Reset(OutputStream& os) {\n        os_ = &os;\n        hasRoot_ = false;\n        level_stack_.Clear();\n    }\n\n    //! Checks whether the output is a complete JSON.\n    /*!\n        A complete JSON has a complete root object or array.\n    */\n    bool IsComplete() const {\n        return hasRoot_ && level_stack_.Empty();\n    }\n\n    /*!@name Implementation of Handler\n        \\see Handler\n    */\n    //@{\n\n    bool Null()                 { Prefix(kNullType);   return WriteNull(); }\n    bool Bool(bool b)           { Prefix(b ? kTrueType : kFalseType); return WriteBool(b); }\n    bool Int(int i)             { Prefix(kNumberType); return WriteInt(i); }\n    bool Uint(unsigned u)       { Prefix(kNumberType); return WriteUint(u); }\n    bool Int64(int64_t i64)     { Prefix(kNumberType); return WriteInt64(i64); }\n    bool Uint64(uint64_t u64)   { Prefix(kNumberType); return WriteUint64(u64); }\n\n    //! Writes the given \\c double value to the stream\n    /*!\n        \\param d The value to be written.\n        \\return Whether it is succeed.\n    */\n    bool Double(double d)       { Prefix(kNumberType); return WriteDouble(d); }\n\n    bool String(const Ch* str, SizeType length, bool copy = false) {\n        (void)copy;\n        Prefix(kStringType);\n        return WriteString(str, length);\n    }\n\n    bool StartObject() {\n        Prefix(kObjectType);\n        new (level_stack_.template Push<Level>()) Level(false);\n        return WriteStartObject();\n    }\n\n    bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); }\n\t\n    bool EndObject(SizeType memberCount = 0) {\n        (void)memberCount;\n        RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level));\n        RAPIDJSON_ASSERT(!level_stack_.template Top<Level>()->inArray);\n        level_stack_.template Pop<Level>(1);\n        bool ret = WriteEndObject();\n        if (level_stack_.Empty())   // end of json text\n            os_->Flush();\n        return ret;\n    }\n\n    bool StartArray() {\n        Prefix(kArrayType);\n        new (level_stack_.template Push<Level>()) Level(true);\n        return WriteStartArray();\n    }\n\n    bool EndArray(SizeType elementCount = 0) {\n        (void)elementCount;\n        RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level));\n        RAPIDJSON_ASSERT(level_stack_.template Top<Level>()->inArray);\n        level_stack_.template Pop<Level>(1);\n        bool ret = WriteEndArray();\n        if (level_stack_.Empty())   // end of json text\n            os_->Flush();\n        return ret;\n    }\n    //@}\n\n    /*! @name Convenience extensions */\n    //@{\n\n    //! Simpler but slower overload.\n    bool String(const Ch* str) { return String(str, internal::StrLen(str)); }\n    bool Key(const Ch* str) { return Key(str, internal::StrLen(str)); }\n\n    //@}\n\nprotected:\n    //! Information for each nested level\n    struct Level {\n        Level(bool inArray_) : valueCount(0), inArray(inArray_) {}\n        size_t valueCount;  //!< number of values in this level\n        bool inArray;       //!< true if in array, otherwise in object\n    };\n\n    static const size_t kDefaultLevelDepth = 32;\n\n    bool WriteNull()  {\n        os_->Put('n'); os_->Put('u'); os_->Put('l'); os_->Put('l'); return true;\n    }\n\n    bool WriteBool(bool b)  {\n        if (b) {\n            os_->Put('t'); os_->Put('r'); os_->Put('u'); os_->Put('e');\n        }\n        else {\n            os_->Put('f'); os_->Put('a'); os_->Put('l'); os_->Put('s'); os_->Put('e');\n        }\n        return true;\n    }\n\n    bool WriteInt(int i) {\n        char buffer[11];\n        const char* end = internal::i32toa(i, buffer);\n        for (const char* p = buffer; p != end; ++p)\n            os_->Put(*p);\n        return true;\n    }\n\n    bool WriteUint(unsigned u) {\n        char buffer[10];\n        const char* end = internal::u32toa(u, buffer);\n        for (const char* p = buffer; p != end; ++p)\n            os_->Put(*p);\n        return true;\n    }\n\n    bool WriteInt64(int64_t i64) {\n        char buffer[21];\n        const char* end = internal::i64toa(i64, buffer);\n        for (const char* p = buffer; p != end; ++p)\n            os_->Put(*p);\n        return true;\n    }\n\n    bool WriteUint64(uint64_t u64) {\n        char buffer[20];\n        char* end = internal::u64toa(u64, buffer);\n        for (char* p = buffer; p != end; ++p)\n            os_->Put(*p);\n        return true;\n    }\n\n    bool WriteDouble(double d) {\n        char buffer[25];\n        char* end = internal::dtoa(d, buffer);\n        for (char* p = buffer; p != end; ++p)\n            os_->Put(*p);\n        return true;\n    }\n\n    bool WriteString(const Ch* str, SizeType length)  {\n        static const char hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };\n        static const char escape[256] = {\n#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n            //0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F\n            'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'b', 't', 'n', 'u', 'f', 'r', 'u', 'u', // 00\n            'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', // 10\n              0,   0, '\"',   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, // 20\n            Z16, Z16,                                                                       // 30~4F\n              0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,'\\\\',   0,   0,   0, // 50\n            Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16                                // 60~FF\n#undef Z16\n        };\n\n        os_->Put('\\\"');\n        GenericStringStream<SourceEncoding> is(str);\n        while (is.Tell() < length) {\n            const Ch c = is.Peek();\n            if (!TargetEncoding::supportUnicode && (unsigned)c >= 0x80) {\n                // Unicode escaping\n                unsigned codepoint;\n                if (!SourceEncoding::Decode(is, &codepoint))\n                    return false;\n                os_->Put('\\\\');\n                os_->Put('u');\n                if (codepoint <= 0xD7FF || (codepoint >= 0xE000 && codepoint <= 0xFFFF)) {\n                    os_->Put(hexDigits[(codepoint >> 12) & 15]);\n                    os_->Put(hexDigits[(codepoint >>  8) & 15]);\n                    os_->Put(hexDigits[(codepoint >>  4) & 15]);\n                    os_->Put(hexDigits[(codepoint      ) & 15]);\n                }\n                else if (codepoint >= 0x010000 && codepoint <= 0x10FFFF)    {\n                    // Surrogate pair\n                    unsigned s = codepoint - 0x010000;\n                    unsigned lead = (s >> 10) + 0xD800;\n                    unsigned trail = (s & 0x3FF) + 0xDC00;\n                    os_->Put(hexDigits[(lead >> 12) & 15]);\n                    os_->Put(hexDigits[(lead >>  8) & 15]);\n                    os_->Put(hexDigits[(lead >>  4) & 15]);\n                    os_->Put(hexDigits[(lead      ) & 15]);\n                    os_->Put('\\\\');\n                    os_->Put('u');\n                    os_->Put(hexDigits[(trail >> 12) & 15]);\n                    os_->Put(hexDigits[(trail >>  8) & 15]);\n                    os_->Put(hexDigits[(trail >>  4) & 15]);\n                    os_->Put(hexDigits[(trail      ) & 15]);                    \n                }\n                else\n                    return false;   // invalid code point\n            }\n            else if ((sizeof(Ch) == 1 || (unsigned)c < 256) && escape[(unsigned char)c])  {\n                is.Take();\n                os_->Put('\\\\');\n                os_->Put(escape[(unsigned char)c]);\n                if (escape[(unsigned char)c] == 'u') {\n                    os_->Put('0');\n                    os_->Put('0');\n                    os_->Put(hexDigits[(unsigned char)c >> 4]);\n                    os_->Put(hexDigits[(unsigned char)c & 0xF]);\n                }\n            }\n            else\n                Transcoder<SourceEncoding, TargetEncoding>::Transcode(is, *os_);\n        }\n        os_->Put('\\\"');\n        return true;\n    }\n\n    bool WriteStartObject() { os_->Put('{'); return true; }\n    bool WriteEndObject()   { os_->Put('}'); return true; }\n    bool WriteStartArray()  { os_->Put('['); return true; }\n    bool WriteEndArray()    { os_->Put(']'); return true; }\n\n    void Prefix(Type type) {\n        (void)type;\n        if (level_stack_.GetSize() != 0) { // this value is not at root\n            Level* level = level_stack_.template Top<Level>();\n            if (level->valueCount > 0) {\n                if (level->inArray) \n                    os_->Put(','); // add comma if it is not the first element in array\n                else  // in object\n                    os_->Put((level->valueCount % 2 == 0) ? ',' : ':');\n            }\n            if (!level->inArray && level->valueCount % 2 == 0)\n                RAPIDJSON_ASSERT(type == kStringType);  // if it's in object, then even number should be a name\n            level->valueCount++;\n        }\n        else {\n            RAPIDJSON_ASSERT(!hasRoot_);    // Should only has one and only one root.\n            hasRoot_ = true;\n        }\n    }\n\n    OutputStream* os_;\n    internal::Stack<StackAllocator> level_stack_;\n    bool hasRoot_;\n\nprivate:\n    // Prohibit copy constructor & assignment operator.\n    Writer(const Writer&);\n    Writer& operator=(const Writer&);\n};\n\n// Full specialization for StringStream to prevent memory copying\n\ntemplate<>\ninline bool Writer<StringBuffer>::WriteInt(int i) {\n    char *buffer = os_->Push(11);\n    const char* end = internal::i32toa(i, buffer);\n    os_->Pop(11 - (end - buffer));\n    return true;\n}\n\ntemplate<>\ninline bool Writer<StringBuffer>::WriteUint(unsigned u) {\n    char *buffer = os_->Push(10);\n    const char* end = internal::u32toa(u, buffer);\n    os_->Pop(10 - (end - buffer));\n    return true;\n}\n\ntemplate<>\ninline bool Writer<StringBuffer>::WriteInt64(int64_t i64) {\n    char *buffer = os_->Push(21);\n    const char* end = internal::i64toa(i64, buffer);\n    os_->Pop(21 - (end - buffer));\n    return true;\n}\n\ntemplate<>\ninline bool Writer<StringBuffer>::WriteUint64(uint64_t u) {\n    char *buffer = os_->Push(20);\n    const char* end = internal::u64toa(u, buffer);\n    os_->Pop(20 - (end - buffer));\n    return true;\n}\n\ntemplate<>\ninline bool Writer<StringBuffer>::WriteDouble(double d) {\n    char *buffer = os_->Push(25);\n    char* end = internal::dtoa(d, buffer);\n    os_->Pop(25 - (end - buffer));\n    return true;\n}\n\n} // namespace rapidjson\n\n#ifdef _MSC_VER\nRAPIDJSON_DIAG_POP\n#endif\n\n#endif // RAPIDJSON_RAPIDJSON_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/license.txt",
    "content": "Copyright (C) 2011 Milo Yip\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE."
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/readme.md",
    "content": "![](doc/logo/rapidjson.png)\n\nCopyright (c) 2011-2014 Milo Yip (miloyip@gmail.com)\n\n[RapidJSON GitHub](https://github.com/miloyip/rapidjson/)\n\n[RapidJSON Documentation](http://miloyip.github.io/rapidjson/)\n\n## Introduction\n\nRapidJSON is a JSON parser and generator for C++. It was inspired by [RapidXml](http://rapidxml.sourceforge.net/).\n\n* RapidJSON is small but complete. It supports both SAX and DOM style API. The SAX parser is only a half thousand lines of code.\n\n* RapidJSON is fast. Its performance can be comparable to `strlen()`. It also optionally supports SSE2/SSE4.1 for acceleration.\n\n* RapidJSON is self-contained. It does not depend on external libraries such as BOOST. It even does not depend on STL.\n\n* RapidJSON is memory friendly. Each JSON value occupies exactly 16/20 bytes for most 32/64-bit machines (excluding text string). By default it uses a fast memory allocator, and the parser allocates memory compactly during parsing.\n\n* RapidJSON is Unicode friendly. It supports UTF-8, UTF-16, UTF-32 (LE & BE), and their detection, validation and transcoding internally. For example, you can read a UTF-8 file and let RapidJSON transcode the JSON strings into UTF-16 in the DOM. It also supports surrogates and \"\\u0000\" (null character).\n\nMore features can be read [here](doc/features.md).\n\nJSON(JavaScript Object Notation) is a light-weight data exchange format. RapidJSON should be in fully compliance with RFC7159/ECMA-404. More information about JSON can be obtained at\n* [Introducing JSON](http://json.org/)\n* [RFC7159: The JavaScript Object Notation (JSON) Data Interchange Format](http://www.ietf.org/rfc/rfc7159.txt)\n* [Standard ECMA-404: The JSON Data Interchange Format](http://www.ecma-international.org/publications/standards/Ecma-404.htm)\n\n## Compatibility\n\nRapidJSON is cross-platform. Some platform/compiler combinations which have been tested are shown as follows.\n* Visual C++ 2008/2010/2013 on Windows (32/64-bit)\n* GNU C++ 3.8.x on Cygwin\n* Clang 3.4 on Mac OS X (32/64-bit) and iOS\n* Clang 3.4 on Android NDK\n\nUsers can build and run the unit tests on their platform/compiler.\n\n## Installation\n\nRapidJSON is a header-only C++ library. Just copy the `include/rapidjson` folder to system or project's include path.\n\nTo build the tests and examples:\n\n1. Execute `git submodule update --init` to get the files of thirdparty submodules (google test).\n2. Obtain [premake4](http://industriousone.com/premake/download).\n3. Copy premake4 executable to `rapidjson/build` (or system path).\n4. Change directory to `rapidjson/build/`, run `premake.bat` on Windows, `premake.sh` on Linux or other platforms.\n5. On Windows, build the solution at `rapidjson/build/vs2008/` or `/vs2010/`.\n6. On other platforms, run GNU `make` at `rapidjson/build/gmake/` (e.g., `make -f test.make config=release32`; `make -f example.make config=debug32`).\n7. On success, the executables are generated at `rapidjson/bin`.\n\nTo build the [Doxygen](http://doxygen.org) documentation:\n\n1. Obtain and install [Doxygen](http://doxygen.org/download.html).\n2. In the top-level directory, run `doxygen build/Doxyfile`.\n3. Browse the generated documentation in `doc/html`.\n\n## Usage at a glance\n\nThis simple example parses a JSON string into a document (DOM), make a simple modification of the DOM, and finally stringify the DOM to a JSON string.\n\n~~~~~~~~~~cpp\n// rapidjson/example/simpledom/simpledom.cpp`\n#include \"rapidjson/document.h\"\n#include \"rapidjson/writer.h\"\n#include \"rapidjson/stringbuffer.h\"\n#include <iostream>\n\nusing namespace rapidjson;\n\nint main() {\n    // 1. Parse a JSON string into DOM.\n    const char* json = \"{\\\"project\\\":\\\"rapidjson\\\",\\\"stars\\\":10}\";\n    Document d;\n    d.Parse(json);\n\n    // 2. Modify it by DOM.\n    Value& s = d[\"stars\"];\n    s.SetInt(s.GetInt() + 1);\n\n    // 3. Stringify the DOM\n    StringBuffer buffer;\n    Writer<StringBuffer> writer(buffer);\n    d.Accept(writer);\n\n    // Output {\"project\":\"rapidjson\",\"stars\":11}\n    std::cout << buffer.GetString() << std::endl;\n    return 0;\n}\n~~~~~~~~~~\n\nNote that this example did not handle potential errors.\n\nThe following diagram shows the process.\n\n![simpledom](doc/diagram/simpledom.png)\n\nMore [examples](example/) are available.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/perftest/jsoncpptest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"perftest.h\"\n\n#if TEST_JSONCPP\n\n#include \"jsoncpp/src/lib_json/json_reader.cpp\"\n#include \"jsoncpp/src/lib_json/json_value.cpp\"\n#include \"jsoncpp/src/lib_json/json_writer.cpp\"\n\nusing namespace Json;\n\nclass JsonCpp : public PerfTest {\npublic:\n    virtual void SetUp() {\n        PerfTest::SetUp();\n        Reader reader;\n        ASSERT_TRUE(reader.parse(json_, root_));\n    }\n\nprotected:\n    Value root_;\n};\n\nTEST_F(JsonCpp, ReaderParse) {\n    for (int i = 0; i < kTrialCount; i++) {\n        Value root;\n        Reader reader;\n        ASSERT_TRUE(reader.parse(json_, root));\n    }\n}\n\nTEST_F(JsonCpp, FastWriter) {\n    for (int i = 0; i < kTrialCount; i++) {\n        FastWriter writer;\n        std::string str = writer.write(root_);\n        //if (i == 0)\n        //  std::cout << str.length() << std::endl;\n    }\n}\n\nTEST_F(JsonCpp, StyledWriter) {\n    for (int i = 0; i < kTrialCount; i++) {\n        StyledWriter writer;\n        std::string str = writer.write(root_);\n        //if (i == 0)\n        //  std::cout << str.length() << std::endl;\n    }\n}\n\nTEST_F(JsonCpp, Whitespace) {\n    for (int i = 0; i < kTrialCount; i++) {\n        Value root;\n        Reader reader;\n        ASSERT_TRUE(reader.parse(whitespace_, root));\n    }\n}\n\n#endif // TEST_JSONCPP\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/perftest/misctest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"perftest.h\"\n\n#if TEST_MISC\n\n#define __STDC_FORMAT_MACROS\n#include \"rapidjson/stringbuffer.h\"\n\n#define protected public\n#include \"rapidjson/writer.h\"\n#undef private\n\nclass Misc : public PerfTest {\n};\n\n// Copyright (c) 2008-2010 Bjoern Hoehrmann <bjoern@hoehrmann.de>\n// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.\n\n#define UTF8_ACCEPT 0\n#define UTF8_REJECT 12\n\nstatic const unsigned char utf8d[] = {\n    // The first part of the table maps bytes to character classes that\n    // to reduce the size of the transition table and create bitmasks.\n    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,\n    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,\n    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,\n    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,\n    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,  9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,\n    7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,  7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n    8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,\n    10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,\n\n    // The second part is a transition table that maps a combination\n    // of a state of the automaton and a character class to a state.\n    0,12,24,36,60,96,84,12,12,12,48,72, 12,12,12,12,12,12,12,12,12,12,12,12,\n    12, 0,12,12,12,12,12, 0,12, 0,12,12, 12,24,12,12,12,12,12,24,12,24,12,12,\n    12,12,12,12,12,12,12,24,12,12,12,12, 12,24,12,12,12,12,12,12,12,24,12,12,\n    12,12,12,12,12,12,12,36,12,36,12,12, 12,36,12,12,12,12,12,36,12,36,12,12,\n    12,36,12,12,12,12,12,12,12,12,12,12, \n};\n\nstatic unsigned inline decode(unsigned* state, unsigned* codep, unsigned byte) {\n    unsigned type = utf8d[byte];\n\n    *codep = (*state != UTF8_ACCEPT) ?\n        (byte & 0x3fu) | (*codep << 6) :\n    (0xff >> type) & (byte);\n\n    *state = utf8d[256 + *state + type];\n    return *state;\n}\n\nstatic bool IsUTF8(unsigned char* s) {\n    unsigned codepoint, state = 0;\n\n    while (*s)\n        decode(&state, &codepoint, *s++);\n\n    return state == UTF8_ACCEPT;\n}\n\nTEST_F(Misc, Hoehrmann_IsUTF8) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        EXPECT_TRUE(IsUTF8((unsigned char*)json_));\n    }\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// CountDecimalDigit: Count number of decimal places\n\ninline unsigned CountDecimalDigit_naive(unsigned n) {\n    unsigned count = 1;\n    while (n >= 10) {\n        n /= 10;\n        count++;\n    }\n    return count;\n}\n\ninline unsigned CountDecimalDigit_enroll4(unsigned n) {\n    unsigned count = 1;\n    while (n >= 10000) {\n        n /= 10000u;\n        count += 4;\n    }\n    if (n < 10) return count;\n    if (n < 100) return count + 1;\n    if (n < 1000) return count + 2;\n    return count + 3;\n}\n\ninline unsigned CountDecimalDigit64_enroll4(uint64_t n) {\n    unsigned count = 1;\n    while (n >= 10000) {\n        n /= 10000u;\n        count += 4;\n    }\n    if (n < 10) return count;\n    if (n < 100) return count + 1;\n    if (n < 1000) return count + 2;\n    return count + 3;\n}\n\ninline unsigned CountDecimalDigit_fast(unsigned n) {\n    static const uint32_t powers_of_10[] = {\n        0,\n        10,\n        100,\n        1000,\n        10000,\n        100000,\n        1000000,\n        10000000,\n        100000000,\n        1000000000\n    };\n\n#if defined(_M_IX86) || defined(_M_X64)\n    unsigned long i = 0;\n    _BitScanReverse(&i, n | 1);\n    uint32_t t = (i + 1) * 1233 >> 12;\n#elif defined(__GNUC__)\n    uint32_t t = (32 - __builtin_clz(n | 1)) * 1233 >> 12;\n#else\n#error\n#endif\n    return t - (n < powers_of_10[t]) + 1;\n}\n\ninline unsigned CountDecimalDigit64_fast(uint64_t n) {\n    static const uint64_t powers_of_10[] = {\n        0,\n        10,\n        100,\n        1000,\n        10000,\n        100000,\n        1000000,\n        10000000,\n        100000000,\n        1000000000,\n        10000000000,\n        100000000000,\n        1000000000000,\n        10000000000000,\n        100000000000000,\n        1000000000000000,\n        10000000000000000,\n        100000000000000000,\n        1000000000000000000,\n        10000000000000000000U\n    };\n\n#if defined(_M_IX86)\n    uint64_t m = n | 1;\n    unsigned long i = 0;\n    if (_BitScanReverse(&i, m >> 32))\n        i += 32;\n    else\n        _BitScanReverse(&i, m & 0xFFFFFFFF);\n    uint32_t t = (i + 1) * 1233 >> 12;\n#elif defined(_M_X64)\n    unsigned long i = 0;\n    _BitScanReverse64(&i, n | 1);\n    uint32_t t = (i + 1) * 1233 >> 12;\n#elif defined(__GNUC__)\n    uint32_t t = (64 - __builtin_clzll(n | 1)) * 1233 >> 12;\n#else\n#error\n#endif\n\n    return t - (n < powers_of_10[t]) + 1;\n}\n\n#if 0\n// Exhaustive, very slow\nTEST_F(Misc, CountDecimalDigit_Verify) {\n    unsigned i = 0;\n    do {\n        if (i % (65536 * 256) == 0)\n            printf(\"%u\\n\", i);\n        ASSERT_EQ(CountDecimalDigit_enroll4(i), CountDecimalDigit_fast(i));\n        i++;\n    } while (i != 0);\n}\n\nstatic const unsigned kDigits10Trial = 1000000000u;\nTEST_F(Misc, CountDecimalDigit_naive) {\n    unsigned sum = 0;\n    for (unsigned i = 0; i < kDigits10Trial; i++)\n        sum += CountDecimalDigit_naive(i);\n    printf(\"%u\\n\", sum);\n}\n\nTEST_F(Misc, CountDecimalDigit_enroll4) {\n    unsigned sum = 0;\n    for (unsigned i = 0; i < kDigits10Trial; i++)\n        sum += CountDecimalDigit_enroll4(i);\n    printf(\"%u\\n\", sum);\n}\n\nTEST_F(Misc, CountDecimalDigit_fast) {\n    unsigned sum = 0;\n    for (unsigned i = 0; i < kDigits10Trial; i++)\n        sum += CountDecimalDigit_fast(i);\n    printf(\"%u\\n\", sum);\n}\n#endif\n\nTEST_F(Misc, CountDecimalDigit64_VerifyFast) {\n    uint64_t i = 1, j;\n    do {\n        //printf(\"%\" PRIu64 \"\\n\", i);\n        ASSERT_EQ(CountDecimalDigit64_enroll4(i), CountDecimalDigit64_fast(i));\n        j = i;\n        i *= 3;\n    } while (j < i);\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// integer-to-string conversion\n\n// https://gist.github.com/anonymous/7179097\nstatic const int randval[] ={\n     936116,  369532,  453755,  -72860,  209713,  268347,  435278, -360266, -416287, -182064,\n    -644712,  944969,  640463, -366588,  471577,  -69401, -744294, -505829,  923883,  831785,\n    -601136, -636767, -437054,  591718,  100758,  231907, -719038,  973540, -605220,  506659,\n    -871653,  462533,  764843, -919138,  404305, -630931, -288711, -751454, -173726, -718208,\n     432689, -281157,  360737,  659827,   19174, -376450,  769984, -858198,  439127,  734703,\n    -683426,       7,  386135,  186997, -643900, -744422, -604708, -629545,   42313, -933592,\n    -635566,  182308,  439024, -367219,  -73924, -516649,  421935, -470515,  413507,  -78952,\n    -427917, -561158,  737176,   94538,  572322,  405217,  709266, -357278, -908099, -425447,\n     601119,  750712, -862285, -177869,  900102,  384877,  157859, -641680,  503738, -702558,\n     278225,  463290,  268378, -212840,  580090,  347346, -473985, -950968, -114547, -839893,\n    -738032, -789424,  409540,  493495,  432099,  119755,  905004, -174834,  338266,  234298,\n      74641, -965136, -754593,  685273,  466924,  920560,  385062,  796402,  -67229,  994864,\n     376974,  299869, -647540, -128724,  469890, -163167, -547803, -743363,  486463, -621028,\n     612288,   27459, -514224,  126342,  -66612,  803409, -777155, -336453, -284002,  472451,\n     342390, -163630,  908356, -456147, -825607,  268092, -974715,  287227,  227890, -524101,\n     616370, -782456,  922098, -624001, -813690,  171605, -192962,  796151,  707183,  -95696,\n     -23163, -721260,  508892,  430715,  791331,  482048, -996102,  863274,  275406,   -8279,\n    -556239, -902076,  268647, -818565,  260069, -798232, -172924, -566311, -806503, -885992,\n     813969,  -78468,  956632,  304288,  494867, -508784,  381751,  151264,  762953,   76352,\n     594902,  375424,  271700, -743062,  390176,  924237,  772574,  676610,  435752, -153847,\n       3959, -971937, -294181, -538049, -344620, -170136,   19120, -703157,  868152, -657961,\n    -818631,  219015, -872729, -940001, -956570,  880727, -345910,  942913, -942271, -788115,\n     225294,  701108, -517736, -416071,  281940,  488730,  942698,  711494,  838382, -892302,\n    -533028,  103052,  528823,  901515,  949577,  159364,  718227, -241814, -733661, -462928,\n    -495829,  165170,  513580, -629188, -509571, -459083,  198437,   77198, -644612,  811276,\n    -422298, -860842,  -52584,  920369,  686424, -530667, -243476,   49763,  345866, -411960,\n    -114863,  470810, -302860,  683007, -509080,       2, -174981, -772163,  -48697,  447770,\n    -268246,  213268,  269215,   78810, -236340, -639140, -864323,  505113, -986569, -325215,\n     541859,  163070, -819998, -645161, -583336,  573414,  696417, -132375,       3, -294501,\n     320435,  682591,  840008,  351740,  426951,  609354,  898154, -943254,  227321, -859793,\n    -727993,   44137, -497965, -782239,   14955, -746080, -243366,    9837, -233083,  606507,\n    -995864, -615287, -994307,  602715,  770771, -315040,  610860,  446102, -307120,  710728,\n    -590392, -230474, -762625, -637525,  134963, -202700, -766902, -985541,  218163,  682009,\n     926051,  525156,  -61195,  403211, -810098,  245539, -431733,  179998, -806533,  745943,\n     447597,  131973, -187130,  826019,  286107, -937230, -577419,   20254,  681802, -340500,\n     323080,  266283, -667617,  309656,  416386,  611863,  759991, -534257,  523112, -634892,\n    -169913, -204905, -909867, -882185, -944908,  741811, -717675,  967007, -317396,  407230,\n    -412805,  792905,  994873,  744793, -456797,  713493,  355232,  116900, -945199,  880539,\n     342505, -580824, -262273,  982968, -349497, -735488,  311767, -455191,  570918,  389734,\n    -958386,   10262,  -99267,  155481,  304210,  204724,  704367, -144893, -233664, -671441,\n     896849,  408613,  762236,  322697,  981321,  688476,   13663, -970704, -379507,  896412,\n     977084,  348869,  875948,  341348,  318710,  512081,    6163,  669044,  833295,  811883,\n     708756, -802534, -536057,  608413, -389625, -694603,  541106, -110037,  720322, -540581,\n     645420,   32980,   62442,  510157, -981870,  -87093, -325960, -500494, -718291,  -67889,\n     991501,  374804,  769026, -978869,  294747,  714623,  413327, -199164,  671368,  804789,\n    -362507,  798196, -170790, -568895, -869379,   62020, -316693, -837793,  644994,  -39341,\n    -417504, -243068, -957756,   99072,  622234, -739992,  225668,    8863, -505910,   82483,\n    -559244,  241572,    1315,  -36175,  -54990,  376813,     -11,  162647, -688204, -486163,\n     -54934, -197470,  744223, -762707,  732540,  996618,  351561, -445933, -898491,  486531,\n     456151,   15276,  290186, -817110,  -52995,  313046, -452533,  -96267,   94470, -500176,\n    -818026, -398071, -810548, -143325, -819741,    1338, -897676, -101577, -855445,   37309,\n     285742,  953804, -777927, -926962, -811217, -936744, -952245, -802300, -490188, -964953,\n    -552279,  329142, -570048, -505756,  682898, -381089,  -14352,  175138,  152390, -582268,\n    -485137,  717035,  805329,  239572, -730409,  209643, -184403, -385864,  675086,  819648,\n     629058, -527109, -488666, -171981,  532788,  552441,  174666,  984921,  766514,  758787,\n     716309,  338801, -978004, -412163,  876079, -734212,  789557, -160491, -522719,   56644,\n       -991, -286038,  -53983,  663740,  809812,  919889, -717502, -137704,  220511,  184396,\n    -825740, -588447,  430870,  124309,  135956,  558662, -307087, -788055, -451328,  812260,\n     931601,  324347, -482989, -117858, -278861,  189068, -172774,  929057,  293787,  198161,\n    -342386,  -47173,  906555, -759955,  -12779,  777604,  -97869,  899320,  927486,  -25284,\n    -848550,  259450, -485856,  -17820,      88,  171400,  235492, -326783, -340793,  886886,\n     112428, -246280,    5979,  648444, -114982,  991013,  -56489,   -9497,  419706,  632820,\n    -341664,  393926, -848977,  -22538,  257307,  773731, -905319,  491153,  734883, -868212,\n    -951053,  644458, -580758,  764735,  584316,  297077,   28852, -397710, -953669,  201772,\n     879050, -198237, -588468,  448102, -116837,  770007, -231812,  642906, -582166, -885828,\n          9,  305082, -996577,  303559,   75008, -772956, -447960,  599825, -295552,  870739,\n    -386278, -950300,  485359, -457081,  629461, -850276,  550496, -451755, -620841,  -11766,\n    -950137,  832337,   28711, -273398, -507197,   91921, -271360, -705991, -753220, -388968,\n     967945,  340434, -320883, -662793, -554617, -574568,  477946,   -6148, -129519,  689217,\n     920020, -656315, -974523, -212525,   80921, -612532,  645096,  545655,  655713, -591631,\n    -307385, -816688, -618823, -113713,  526430,  673063,  735916, -809095, -850417,  639004,\n     432281, -388185,  270708,  860146,  -39902, -786157, -258180, -246169, -966720, -264957,\n     548072, -306010,  -57367, -635665,  933824,   70553, -989936, -488741,   72411, -452509,\n     529831,  956277,  449019, -577850, -360986, -803418,   48833,  296073,  203430,  609591,\n     715483,  470964,  658106, -718254,  -96424,  790163,  334739,  181070, -373578,       5,\n    -435088,  329841,  330939, -256602,  394355,  912412,  231910,  927278, -661933,  788539,\n    -769664, -893274,  -96856,  298205,  901043, -608122, -527430,  183618, -553963,  -35246,\n    -393924,  948832, -483198,  594501,   35460, -407007,   93494, -336881, -634072,  984205,\n    -812161,  944664,  -31062,  753872,  823933,  -69566,   50445,  290147,   85134,   34706,\n     551902,  405202, -991246,  -84642,  154341,  316432, -695101, -651588,   -5030,  137564,\n    -294665,  332541,  528307,  -90572, -344923,  523766, -758498, -968047,  339028,  494578,\n     593129, -725773,   31834, -718406, -208638,  159665,   -2043,  673344, -442767,   75816,\n     755442,  769257, -158730, -410272,  691688,  589550, -878398, -184121,  460679,  346312,\n     294163, -544602,  653308,  254167, -276979,   52073, -892684,  887653,  -41222,  983065,\n     -68258, -408799,  -99069, -674069, -863635,  -32890,  622757, -743862,   40872,   -4837,\n    -967228,  522370, -903951, -818669,  524459,  514702,  925801,   20007, -299229,  579348,\n     626021,  430089,  348139, -562692, -607728, -130606, -928451, -424793, -458647, -448892,\n    -312230,  143337,  109746,  880042, -339658, -785614,  938995,  540916,  118429,  661351,\n    -402967,  404729,  -40918, -976535,  743230,  713110,  440182, -381314, -499252,   74613,\n     193652,  912717,  491323,  583633,  324691,  459397,  281253,  195540,   -2764, -888651,\n     892449,  132663, -478373, -430002, -314551,  527826,  247165,  557966,  554778,  481531,\n    -946634,  431685, -769059, -348371,  174046,  184597, -354867,  584422,  227390, -850397,\n    -542924, -849093, -737769,  325359,  736314,  269101,  767940,  674809,   81413, -447458,\n     445076,  189072,  906218,  502688, -718476, -863827, -731381,  100660,  623249,  710008,\n     572060,  922203,  685740,   55096,  263394, -243695, -353910, -516788,  388471,  455165,\n     844103, -643772,  363976,  268875, -899450,  104470,  104029, -238874, -274659,  732969,\n    -676443,  953291, -916289, -861849, -242344,  958083, -479593, -970395,  799831,  277841,\n    -243236, -283462, -201510,  166263, -259105, -575706,  878926,  891064,  895297,  655262,\n     -34807, -809833,  -89281,  342585,  554920,       1,  902141, -333425,  139703,  852318,\n    -618438,  329498, -932596, -692836, -513372,  733656, -523411,   85779,  500478, -682697,\n    -502836,  138776,  156341, -420037, -557964, -556378,  710993,  -50383, -877159,  916334,\n     132996,  583516, -603392, -111615,  -12288, -780214,  476780,  123327,  137607,  519956,\n     745837,   17358, -158581,  -53490\n};\nstatic const size_t randvalCount = sizeof(randval) / sizeof(randval[0]);\nstatic const size_t kItoaTrialCount = 10000;\n\nstatic const char digits[201] =\n\"0001020304050607080910111213141516171819\"\n\"2021222324252627282930313233343536373839\"\n\"4041424344454647484950515253545556575859\"\n\"6061626364656667686970717273747576777879\"\n\"8081828384858687888990919293949596979899\";\n\n// Prevent code being optimized out\n//#define OUTPUT_LENGTH(length) printf(\"\", length)\n#define OUTPUT_LENGTH(length) printf(\"%u\\n\", (unsigned)length)\n\ntemplate<typename OutputStream>\nclass Writer1 {\npublic:\n    Writer1() : os_() {}\n    Writer1(OutputStream& os) : os_(&os) {}\n\n    void Reset(OutputStream& os) {\n        os_ = &os;\n    }\n\n    bool WriteInt(int i) {\n        if (i < 0) {\n            os_->Put('-');\n            i = -i;\n        }\n        return WriteUint((unsigned)i);\n    }\n\n    bool WriteUint(unsigned u) {\n        char buffer[10];\n        char *p = buffer;\n        do {\n            *p++ = char(u % 10) + '0';\n            u /= 10;\n        } while (u > 0);\n\n        do {\n            --p;\n            os_->Put(*p);\n        } while (p != buffer);\n        return true;\n    }\n\n    bool WriteInt64(int64_t i64) {\n        if (i64 < 0) {\n            os_->Put('-');\n            i64 = -i64;\n        }\n        WriteUint64((uint64_t)i64);\n        return true;\n    }\n\n    bool WriteUint64(uint64_t u64) {\n        char buffer[20];\n        char *p = buffer;\n        do {\n            *p++ = char(u64 % 10) + '0';\n            u64 /= 10;\n        } while (u64 > 0);\n\n        do {\n            --p;\n            os_->Put(*p);\n        } while (p != buffer);\n        return true;\n    }\n\nprivate:\n    OutputStream* os_;\n};\n\ntemplate<>\nbool Writer1<rapidjson::StringBuffer>::WriteUint(unsigned u) {\n    char buffer[10];\n    char* p = buffer;\n    do {\n        *p++ = char(u % 10) + '0';\n        u /= 10;\n    } while (u > 0);\n\n    char* d = os_->Push(p - buffer);\n    do {\n        --p;\n        *d++ = *p;\n    } while (p != buffer);\n    return true;\n}\n\n// Using digits LUT to reduce divsion/modulo\ntemplate<typename OutputStream>\nclass Writer2 {\npublic:\n    Writer2() : os_() {}\n    Writer2(OutputStream& os) : os_(&os) {}\n\n    void Reset(OutputStream& os) {\n        os_ = &os;\n    }\n\n    bool WriteInt(int i) {\n        if (i < 0) {\n            os_->Put('-');\n            i = -i;\n        }\n        return WriteUint((unsigned)i);\n    }\n\n    bool WriteUint(unsigned u) {\n        char buffer[10];\n        char* p = buffer;\n        while (u >= 100) {\n            const unsigned i = (u % 100) << 1;\n            u /= 100;\n            *p++ = digits[i + 1];\n            *p++ = digits[i];\n        }\n        if (u < 10)\n            *p++ = char(u) + '0';\n        else {\n            const unsigned i = u << 1;\n            *p++ = digits[i + 1];\n            *p++ = digits[i];\n        }\n\n        do {\n            --p;\n            os_->Put(*p);\n        } while (p != buffer);\n        return true;\n    }\n\n    bool WriteInt64(int64_t i64) {\n        if (i64 < 0) {\n            os_->Put('-');\n            i64 = -i64;\n        }\n        WriteUint64((uint64_t)i64);\n        return true;\n    }\n\n    bool WriteUint64(uint64_t u64) {\n        char buffer[20];\n        char* p = buffer;\n        while (u64 >= 100) {\n            const unsigned i = static_cast<unsigned>(u64 % 100) << 1;\n            u64 /= 100;\n            *p++ = digits[i + 1];\n            *p++ = digits[i];\n        }\n        if (u64 < 10)\n            *p++ = char(u64) + '0';\n        else {\n            const unsigned i = static_cast<unsigned>(u64) << 1;\n            *p++ = digits[i + 1];\n            *p++ = digits[i];\n        }\n\n        do {\n            --p;\n            os_->Put(*p);\n        } while (p != buffer);\n        return true;\n    }\n\nprivate:\n    OutputStream* os_;\n};\n\n// First pass to count digits\ntemplate<typename OutputStream>\nclass Writer3 {\npublic:\n    Writer3() : os_() {}\n    Writer3(OutputStream& os) : os_(&os) {}\n\n    void Reset(OutputStream& os) {\n        os_ = &os;\n    }\n\n    bool WriteInt(int i) {\n        if (i < 0) {\n            os_->Put('-');\n            i = -i;\n        }\n        return WriteUint((unsigned)i);\n    }\n\n    bool WriteUint(unsigned u) {\n        char buffer[10];\n        char *p = buffer;\n        do {\n            *p++ = char(u % 10) + '0';\n            u /= 10;\n        } while (u > 0);\n\n        do {\n            --p;\n            os_->Put(*p);\n        } while (p != buffer);\n        return true;\n    }\n\n    bool WriteInt64(int64_t i64) {\n        if (i64 < 0) {\n            os_->Put('-');\n            i64 = -i64;\n        }\n        WriteUint64((uint64_t)i64);\n        return true;\n    }\n\n    bool WriteUint64(uint64_t u64) {\n        char buffer[20];\n        char *p = buffer;\n        do {\n            *p++ = char(u64 % 10) + '0';\n            u64 /= 10;\n        } while (u64 > 0);\n\n        do {\n            --p;\n            os_->Put(*p);\n        } while (p != buffer);\n        return true;\n    }\n\nprivate:\n    void WriteUintReverse(char* d, unsigned u) {\n        do {\n            *--d = char(u % 10) + '0';\n            u /= 10;\n        } while (u > 0);\n    }\n\n    void WriteUint64Reverse(char* d, uint64_t u) {\n        do {\n            *--d = char(u % 10) + '0';\n            u /= 10;\n        } while (u > 0);\n    }\n\n    OutputStream* os_;\n};\n\ntemplate<>\ninline bool Writer3<rapidjson::StringBuffer>::WriteUint(unsigned u) {\n    unsigned digit = CountDecimalDigit_fast(u);\n    WriteUintReverse(os_->Push(digit) + digit, u);\n    return true;\n}\n\ntemplate<>\ninline bool Writer3<rapidjson::InsituStringStream>::WriteUint(unsigned u) {\n    unsigned digit = CountDecimalDigit_fast(u);\n    WriteUintReverse(os_->Push(digit) + digit, u);\n    return true;\n}\n\ntemplate<>\ninline bool Writer3<rapidjson::StringBuffer>::WriteUint64(uint64_t u) {\n    unsigned digit = CountDecimalDigit64_fast(u);\n    WriteUint64Reverse(os_->Push(digit) + digit, u);\n    return true;\n}\n\ntemplate<>\ninline bool Writer3<rapidjson::InsituStringStream>::WriteUint64(uint64_t u) {\n    unsigned digit = CountDecimalDigit64_fast(u);\n    WriteUint64Reverse(os_->Push(digit) + digit, u);\n    return true;\n}\n\n// Using digits LUT to reduce divsion/modulo, two passes\ntemplate<typename OutputStream>\nclass Writer4 {\npublic:\n    Writer4() : os_() {}\n    Writer4(OutputStream& os) : os_(&os) {}\n\n    void Reset(OutputStream& os) {\n        os_ = &os;\n    }\n\n    bool WriteInt(int i) {\n        if (i < 0) {\n            os_->Put('-');\n            i = -i;\n        }\n        return WriteUint((unsigned)i);\n    }\n\n    bool WriteUint(unsigned u) {\n        char buffer[10];\n        char* p = buffer;\n        while (u >= 100) {\n            const unsigned i = (u % 100) << 1;\n            u /= 100;\n            *p++ = digits[i + 1];\n            *p++ = digits[i];\n        }\n        if (u < 10)\n            *p++ = char(u) + '0';\n        else {\n            const unsigned i = u << 1;\n            *p++ = digits[i + 1];\n            *p++ = digits[i];\n        }\n\n        do {\n            --p;\n            os_->Put(*p);\n        } while (p != buffer);\n        return true;\n    }\n\n    bool WriteInt64(int64_t i64) {\n        if (i64 < 0) {\n            os_->Put('-');\n            i64 = -i64;\n        }\n        WriteUint64((uint64_t)i64);\n        return true;\n    }\n\n    bool WriteUint64(uint64_t u64) {\n        char buffer[20];\n        char* p = buffer;\n        while (u64 >= 100) {\n            const unsigned i = static_cast<unsigned>(u64 % 100) << 1;\n            u64 /= 100;\n            *p++ = digits[i + 1];\n            *p++ = digits[i];\n        }\n        if (u64 < 10)\n            *p++ = char(u64) + '0';\n        else {\n            const unsigned i = static_cast<unsigned>(u64) << 1;\n            *p++ = digits[i + 1];\n            *p++ = digits[i];\n        }\n\n        do {\n            --p;\n            os_->Put(*p);\n        } while (p != buffer);\n        return true;\n    }\n\nprivate:\n    void WriteUintReverse(char* d, unsigned u) {\n        while (u >= 100) {\n            const unsigned i = (u % 100) << 1;\n            u /= 100;\n            *--d = digits[i + 1];\n            *--d = digits[i];\n        }\n        if (u < 10) {\n            *--d = char(u) + '0';\n        }\n        else {\n            const unsigned i = u << 1;\n            *--d = digits[i + 1];\n            *--d = digits[i];\n        }\n    }\n\n    void WriteUint64Reverse(char* d, uint64_t u) {\n        while (u >= 100) {\n            const unsigned i = (u % 100) << 1;\n            u /= 100;\n            *--d = digits[i + 1];\n            *--d = digits[i];\n        }\n        if (u < 10) {\n            *--d = char(u) + '0';\n        }\n        else {\n            const unsigned i = u << 1;\n            *--d = digits[i + 1];\n            *--d = digits[i];\n        }\n    }\n\n    OutputStream* os_;\n};\n\ntemplate<>\ninline bool Writer4<rapidjson::StringBuffer>::WriteUint(unsigned u) {\n    unsigned digit = CountDecimalDigit_fast(u);\n    WriteUintReverse(os_->Push(digit) + digit, u);\n    return true;\n}\n\ntemplate<>\ninline bool Writer4<rapidjson::InsituStringStream>::WriteUint(unsigned u) {\n    unsigned digit = CountDecimalDigit_fast(u);\n    WriteUintReverse(os_->Push(digit) + digit, u);\n    return true;\n}\n\ntemplate<>\ninline bool Writer4<rapidjson::StringBuffer>::WriteUint64(uint64_t u) {\n    unsigned digit = CountDecimalDigit64_fast(u);\n    WriteUint64Reverse(os_->Push(digit) + digit, u);\n    return true;\n}\n\ntemplate<>\ninline bool Writer4<rapidjson::InsituStringStream>::WriteUint64(uint64_t u) {\n    unsigned digit = CountDecimalDigit64_fast(u);\n    WriteUint64Reverse(os_->Push(digit) + digit, u);\n    return true;\n}\n\ntemplate <typename Writer>\nvoid itoa_Writer_StringBufferVerify() {\n    rapidjson::StringBuffer sb;\n    Writer writer(sb);\n    for (int j = 0; j < randvalCount; j++) {\n        char buffer[32];\n        sprintf(buffer, \"%d\", randval[j]);\n        writer.WriteInt(randval[j]);\n        ASSERT_STREQ(buffer, sb.GetString());\n        sb.Clear();\n    }\n}\n\ntemplate <typename Writer>\nvoid itoa_Writer_InsituStringStreamVerify() {\n    Writer writer;\n    for (int j = 0; j < randvalCount; j++) {\n        char buffer[32];\n        sprintf(buffer, \"%d\", randval[j]);\n        char buffer2[32];\n        rapidjson::InsituStringStream ss(buffer2);\n        writer.Reset(ss);\n        char* begin = ss.PutBegin();\n        writer.WriteInt(randval[j]);\n        ss.Put('\\0');\n        ss.PutEnd(begin);\n        ASSERT_STREQ(buffer, buffer2);\n    }\n}\n\ntemplate <typename Writer>\nvoid itoa_Writer_StringBuffer() {\n    size_t length = 0;\n\n    rapidjson::StringBuffer sb;\n    Writer writer(sb);\n\n    for (size_t i = 0; i < kItoaTrialCount; i++) {\n        for (size_t j = 0; j < randvalCount; j++) {\n            writer.WriteInt(randval[j]);\n            length += sb.GetSize();\n            sb.Clear();\n        }\n    }\n    OUTPUT_LENGTH(length);\n}\n\ntemplate <typename Writer>\nvoid itoa_Writer_InsituStringStream() {\n    size_t length = 0;\n\n    char buffer[32];\n    Writer writer;\n    for (size_t i = 0; i < kItoaTrialCount; i++) {\n        for (size_t j = 0; j < randvalCount; j++) {\n            rapidjson::InsituStringStream ss(buffer);\n            writer.Reset(ss);\n            char* begin = ss.PutBegin();\n            writer.WriteInt(randval[j]);\n            length += ss.PutEnd(begin);\n        }\n    }\n    OUTPUT_LENGTH(length);\n};\n\ntemplate <typename Writer>\nvoid itoa64_Writer_StringBufferVerify() {\n    rapidjson::StringBuffer sb;\n    Writer writer(sb);\n    for (size_t j = 0; j < randvalCount; j++) {\n        char buffer[32];\n        int64_t x = randval[j] * randval[j];\n        sprintf(buffer, \"%\" PRIi64, x);\n        writer.WriteInt64(x);\n        ASSERT_STREQ(buffer, sb.GetString());\n        sb.Clear();\n    }\n}\n\ntemplate <typename Writer>\nvoid itoa64_Writer_InsituStringStreamVerify() {\n    Writer writer;\n    for (size_t j = 0; j < randvalCount; j++) {\n        char buffer[32];\n        int64_t x = randval[j] * randval[j];\n        sprintf(buffer, \"%\" PRIi64, x);\n        char buffer2[32];\n        rapidjson::InsituStringStream ss(buffer2);\n        writer.Reset(ss);\n        char* begin = ss.PutBegin();\n        writer.WriteInt64(x);\n        ss.Put('\\0');\n        ss.PutEnd(begin);\n        ASSERT_STREQ(buffer, buffer2);\n    }\n}\n\ntemplate <typename Writer>\nvoid itoa64_Writer_StringBuffer() {\n    size_t length = 0;\n\n    rapidjson::StringBuffer sb;\n    Writer writer(sb);\n\n    for (size_t i = 0; i < kItoaTrialCount; i++) {\n        for (size_t j = 0; j < randvalCount; j++) {\n            writer.WriteInt64(randval[j] * randval[j]);\n            length += sb.GetSize();\n            sb.Clear();\n        }\n    }\n    OUTPUT_LENGTH(length);\n}\n\ntemplate <typename Writer>\nvoid itoa64_Writer_InsituStringStream() {\n    size_t length = 0;\n\n    char buffer[32];\n    Writer writer;\n    for (size_t i = 0; i < kItoaTrialCount; i++) {\n        for (size_t j = 0; j < randvalCount; j++) {\n            rapidjson::InsituStringStream ss(buffer);\n            writer.Reset(ss);\n            char* begin = ss.PutBegin();\n            writer.WriteInt64(randval[j] * randval[j]);\n            length += ss.PutEnd(begin);\n        }\n    }\n    OUTPUT_LENGTH(length);\n};\n\n// Full specialization for InsituStringStream to prevent memory copying \n// (normally we will not use InsituStringStream for writing, just for testing)\n\nnamespace rapidjson {\n\ntemplate<>\nbool rapidjson::Writer<InsituStringStream>::WriteInt(int i) {\n    char *buffer = os_->Push(11);\n    const char* end = internal::i32toa(i, buffer);\n    os_->Pop(11 - (end - buffer));\n    return true;\n}\n\ntemplate<>\nbool Writer<InsituStringStream>::WriteUint(unsigned u) {\n    char *buffer = os_->Push(10);\n    const char* end = internal::u32toa(u, buffer);\n    os_->Pop(10 - (end - buffer));\n    return true;\n}\n\ntemplate<>\nbool Writer<InsituStringStream>::WriteInt64(int64_t i64) {\n    char *buffer = os_->Push(21);\n    const char* end = internal::i64toa(i64, buffer);\n    os_->Pop(21 - (end - buffer));\n    return true;\n}\n\ntemplate<>\nbool Writer<InsituStringStream>::WriteUint64(uint64_t u) {\n    char *buffer = os_->Push(20);\n    const char* end = internal::u64toa(u, buffer);\n    os_->Pop(20 - (end - buffer));\n    return true;\n}\n\n} // namespace rapidjson\n\nTEST_F(Misc, itoa_Writer_StringBufferVerify) { itoa_Writer_StringBufferVerify<rapidjson::Writer<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa_Writer1_StringBufferVerify) { itoa_Writer_StringBufferVerify<Writer1<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa_Writer2_StringBufferVerify) { itoa_Writer_StringBufferVerify<Writer2<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa_Writer3_StringBufferVerify) { itoa_Writer_StringBufferVerify<Writer3<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa_Writer4_StringBufferVerify) { itoa_Writer_StringBufferVerify<Writer4<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa_Writer_InsituStringStreamVerify) { itoa_Writer_InsituStringStreamVerify<rapidjson::Writer<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa_Writer1_InsituStringStreamVerify) { itoa_Writer_InsituStringStreamVerify<Writer1<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa_Writer2_InsituStringStreamVerify) { itoa_Writer_InsituStringStreamVerify<Writer2<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa_Writer3_InsituStringStreamVerify) { itoa_Writer_InsituStringStreamVerify<Writer3<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa_Writer4_InsituStringStreamVerify) { itoa_Writer_InsituStringStreamVerify<Writer4<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa_Writer_StringBuffer) { itoa_Writer_StringBuffer<rapidjson::Writer<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa_Writer1_StringBuffer) { itoa_Writer_StringBuffer<Writer1<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa_Writer2_StringBuffer) { itoa_Writer_StringBuffer<Writer2<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa_Writer3_StringBuffer) { itoa_Writer_StringBuffer<Writer3<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa_Writer4_StringBuffer) { itoa_Writer_StringBuffer<Writer4<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa_Writer_InsituStringStream) { itoa_Writer_InsituStringStream<rapidjson::Writer<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa_Writer1_InsituStringStream) { itoa_Writer_InsituStringStream<Writer1<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa_Writer2_InsituStringStream) { itoa_Writer_InsituStringStream<Writer2<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa_Writer3_InsituStringStream) { itoa_Writer_InsituStringStream<Writer3<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa_Writer4_InsituStringStream) { itoa_Writer_InsituStringStream<Writer4<rapidjson::InsituStringStream> >(); }\n\nTEST_F(Misc, itoa64_Writer_StringBufferVerify) { itoa64_Writer_StringBufferVerify<rapidjson::Writer<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa64_Writer1_StringBufferVerify) { itoa64_Writer_StringBufferVerify<Writer1<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa64_Writer2_StringBufferVerify) { itoa64_Writer_StringBufferVerify<Writer2<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa64_Writer3_StringBufferVerify) { itoa64_Writer_StringBufferVerify<Writer3<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa64_Writer4_StringBufferVerify) { itoa64_Writer_StringBufferVerify<Writer4<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa64_Writer_InsituStringStreamVerify) { itoa64_Writer_InsituStringStreamVerify<rapidjson::Writer<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa64_Writer1_InsituStringStreamVerify) { itoa64_Writer_InsituStringStreamVerify<Writer1<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa64_Writer2_InsituStringStreamVerify) { itoa64_Writer_InsituStringStreamVerify<Writer2<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa64_Writer3_InsituStringStreamVerify) { itoa64_Writer_InsituStringStreamVerify<Writer3<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa64_Writer4_InsituStringStreamVerify) { itoa64_Writer_InsituStringStreamVerify<Writer4<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa64_Writer_StringBuffer) { itoa64_Writer_StringBuffer<rapidjson::Writer<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa64_Writer1_StringBuffer) { itoa64_Writer_StringBuffer<Writer1<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa64_Writer2_StringBuffer) { itoa64_Writer_StringBuffer<Writer2<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa64_Writer3_StringBuffer) { itoa64_Writer_StringBuffer<Writer3<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa64_Writer4_StringBuffer) { itoa64_Writer_StringBuffer<Writer4<rapidjson::StringBuffer> >(); }\nTEST_F(Misc, itoa64_Writer_InsituStringStream) { itoa64_Writer_InsituStringStream<rapidjson::Writer<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa64_Writer1_InsituStringStream) { itoa64_Writer_InsituStringStream<Writer1<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa64_Writer2_InsituStringStream) { itoa64_Writer_InsituStringStream<Writer2<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa64_Writer3_InsituStringStream) { itoa64_Writer_InsituStringStream<Writer3<rapidjson::InsituStringStream> >(); }\nTEST_F(Misc, itoa64_Writer4_InsituStringStream) { itoa64_Writer_InsituStringStream<Writer4<rapidjson::InsituStringStream> >(); }\n\n#endif // TEST_MISC\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/perftest/perftest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"perftest.h\"\n\nint main(int argc, char **argv) {\n#if _MSC_VER\n    _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );\n    //void *testWhetherMemoryLeakDetectionWorks = malloc(1);\n#endif\n    ::testing::InitGoogleTest(&argc, argv);\n    return RUN_ALL_TESTS();\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/perftest/perftest.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef PERFTEST_H_\n#define PERFTEST_H_\n\n#define TEST_RAPIDJSON  1\n#define TEST_JSONCPP    0\n#define TEST_YAJL       0\n#define TEST_ULTRAJSON  0\n#define TEST_PLATFORM   0\n#define TEST_MISC       0\n\n#define TEST_VERSION_CODE(x,y,z) \\\n  (((x)*100000) + ((y)*100) + (z))\n\n// Only gcc >4.3 supports SSE4.2\n#if TEST_RAPIDJSON && !(defined(__GNUC__) && TEST_VERSION_CODE(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__) < TEST_VERSION_CODE(4,3,0))\n//#define RAPIDJSON_SSE2\n#define RAPIDJSON_SSE42\n#endif\n\n#if TEST_YAJL\n#include \"yajl/yajl_common.h\"\n#undef YAJL_MAX_DEPTH\n#define YAJL_MAX_DEPTH 1024\n#endif\n\n////////////////////////////////////////////////////////////////////////////////\n// Google Test\n\n#ifdef __cplusplus\n\n// gtest indirectly included inttypes.h, without __STDC_CONSTANT_MACROS.\n#ifndef __STDC_CONSTANT_MACROS\n#  define __STDC_CONSTANT_MACROS 1 // required by C++ standard\n#endif\n\n#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))\n#if defined(__clang__) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))\n#pragma GCC diagnostic push\n#endif\n#pragma GCC diagnostic ignored \"-Weffc++\"\n#endif\n\n#include \"gtest/gtest.h\"\n\n#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))\n#pragma GCC diagnostic pop\n#endif\n\n#ifdef _MSC_VER\n#define _CRTDBG_MAP_ALLOC\n#include <crtdbg.h>\n#pragma warning(disable : 4996) // 'function': was declared deprecated\n#endif\n\n//! Base class for all performance tests\nclass PerfTest : public ::testing::Test {\npublic:\n    PerfTest() : filename_(), json_(), length_(), whitespace_(), whitespace_length_() {}\n\n    virtual void SetUp() {\n        FILE *fp = fopen(filename_ = \"data/sample.json\", \"rb\");\n        if (!fp) \n            fp = fopen(filename_ = \"../../bin/data/sample.json\", \"rb\");\n        ASSERT_TRUE(fp != 0);\n\n        fseek(fp, 0, SEEK_END);\n        length_ = (size_t)ftell(fp);\n        fseek(fp, 0, SEEK_SET);\n        json_ = (char*)malloc(length_ + 1);\n        ASSERT_EQ(length_, fread(json_, 1, length_, fp));\n        json_[length_] = '\\0';\n        fclose(fp);\n\n        // whitespace test\n        whitespace_length_ = 1024 * 1024;\n        whitespace_ = (char *)malloc(whitespace_length_  + 4);\n        char *p = whitespace_;\n        for (size_t i = 0; i < whitespace_length_; i += 4) {\n            *p++ = ' ';\n            *p++ = '\\n';\n            *p++ = '\\r';\n            *p++ = '\\t';\n        }\n        *p++ = '[';\n        *p++ = '0';\n        *p++ = ']';\n        *p++ = '\\0';\n    }\n\n    virtual void TearDown() {\n        free(json_);\n        free(whitespace_);\n        json_ = 0;\n        whitespace_ = 0;\n    }\n\nprivate:\n    PerfTest(const PerfTest&);\n    PerfTest& operator=(const PerfTest&);\n\nprotected:\n    const char* filename_;\n    char *json_;\n    size_t length_;\n    char *whitespace_;\n    size_t whitespace_length_;\n\n    static const size_t kTrialCount = 1000;\n};\n\n#endif // __cplusplus\n\n#endif // PERFTEST_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/perftest/platformtest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"perftest.h\"\n\n// This file is for giving the performance characteristics of the platform (compiler/OS/CPU).\n\n#if TEST_PLATFORM\n\n#include <cmath>\n#include <fcntl.h>\n\n// Windows\n#ifdef _WIN32\n#include <windows.h>\n#endif\n\n// UNIX\n#if defined(unix) || defined(__unix__) || defined(__unix)\n#include <unistd.h>\n#ifdef _POSIX_MAPPED_FILES\n#include <sys/mman.h>\n#endif\n#endif\n\nclass Platform : public PerfTest {\npublic:\n    virtual void SetUp() {\n        PerfTest::SetUp();\n\n        // temp buffer for testing\n        temp_ = (char *)malloc(length_ + 1);\n        memcpy(temp_, json_, length_);\n        checkSum_ = CheckSum();\n    }\n\n    char CheckSum() {\n        char c = 0;\n        for (size_t i = 0; i < length_; ++i)\n            c += temp_[i];\n        return c;\n    }\n\n    virtual void TearDown() {\n        PerfTest::TearDown();\n        free(temp_);\n    }\n\nprotected:\n    char *temp_;\n    char checkSum_;\n};\n\nTEST_F(Platform, CheckSum) {\n    for (int i = 0; i < kTrialCount; i++)\n        EXPECT_EQ(checkSum_, CheckSum());\n}\n\nTEST_F(Platform, strlen) {\n    for (int i = 0; i < kTrialCount; i++) {\n        size_t l = strlen(json_);\n        EXPECT_EQ(length_, l);\n    }\n}\n\nTEST_F(Platform, memcmp) {\n    for (int i = 0; i < kTrialCount; i++) {\n        EXPECT_EQ(0, memcmp(temp_, json_, length_));\n    }\n}\n\nTEST_F(Platform, pow) {\n    double sum = 0;\n    for (int i = 0; i < kTrialCount * kTrialCount; i++)\n        sum += pow(10.0, i & 255);\n    EXPECT_GT(sum, 0.0);\n}\n\nTEST_F(Platform, Whitespace_strlen) {\n    for (int i = 0; i < kTrialCount; i++) {\n        size_t l = strlen(whitespace_);\n        EXPECT_GT(l, whitespace_length_);\n    }       \n}\n\nTEST_F(Platform, Whitespace_strspn) {\n    for (int i = 0; i < kTrialCount; i++) {\n        size_t l = strspn(whitespace_, \" \\n\\r\\t\");\n        EXPECT_EQ(whitespace_length_, l);\n    }       \n}\n\nTEST_F(Platform, fread) {\n    for (int i = 0; i < kTrialCount; i++) {\n        FILE *fp = fopen(filename_, \"rb\");\n        ASSERT_EQ(length_, fread(temp_, 1, length_, fp));\n        EXPECT_EQ(checkSum_, CheckSum());\n        fclose(fp);\n    }\n}\n\n#ifdef _MSC_VER\nTEST_F(Platform, read) {\n    for (int i = 0; i < kTrialCount; i++) {\n        int fd = _open(filename_, _O_BINARY | _O_RDONLY);\n        ASSERT_NE(-1, fd);\n        ASSERT_EQ(length_, _read(fd, temp_, length_));\n        EXPECT_EQ(checkSum_, CheckSum());\n        _close(fd);\n    }\n}\n#else\nTEST_F(Platform, read) {\n    for (int i = 0; i < kTrialCount; i++) {\n        int fd = open(filename_, O_RDONLY);\n        ASSERT_NE(-1, fd);\n        ASSERT_EQ(length_, read(fd, temp_, length_));\n        EXPECT_EQ(checkSum_, CheckSum());\n        close(fd);\n    }\n}\n#endif\n\n#ifdef _WIN32\nTEST_F(Platform, MapViewOfFile) {\n    for (int i = 0; i < kTrialCount; i++) {\n        HANDLE file = CreateFile(filename_, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);\n        ASSERT_NE(INVALID_HANDLE_VALUE, file);\n        HANDLE mapObject = CreateFileMapping(file, NULL, PAGE_READONLY, 0, length_, NULL);\n        ASSERT_NE(INVALID_HANDLE_VALUE, mapObject);\n        void *p = MapViewOfFile(mapObject, FILE_MAP_READ, 0, 0, length_);\n        ASSERT_TRUE(p != NULL);\n        EXPECT_EQ(checkSum_, CheckSum());\n        ASSERT_TRUE(UnmapViewOfFile(p) == TRUE);\n        ASSERT_TRUE(CloseHandle(mapObject) == TRUE);\n        ASSERT_TRUE(CloseHandle(file) == TRUE);\n    }\n}\n#endif\n\n#ifdef _POSIX_MAPPED_FILES\nTEST_F(Platform, mmap) {\n    for (int i = 0; i < kTrialCount; i++) {\n        int fd = open(filename_, O_RDONLY);\n        ASSERT_NE(-1, fd);\n        void *p = mmap(NULL, length_, PROT_READ, MAP_PRIVATE, fd, 0);\n        ASSERT_TRUE(p != NULL);\n        EXPECT_EQ(checkSum_, CheckSum());\n        munmap(p, length_);\n        close(fd);\n    }\n}\n#endif\n\n#endif // TEST_PLATFORM\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/perftest/rapidjsontest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"perftest.h\"\n\n#if TEST_RAPIDJSON\n\n#include \"rapidjson/rapidjson.h\"\n#include \"rapidjson/document.h\"\n#include \"rapidjson/prettywriter.h\"\n#include \"rapidjson/stringbuffer.h\"\n#include \"rapidjson/filestream.h\"\n#include \"rapidjson/filereadstream.h\"\n\n#ifdef RAPIDJSON_SSE2\n#define SIMD_SUFFIX(name) name##_SSE2\n#elif defined(RAPIDJSON_SSE42)\n#define SIMD_SUFFIX(name) name##_SSE42\n#else\n#define SIMD_SUFFIX(name) name\n#endif\n\nusing namespace rapidjson;\n\nclass RapidJson : public PerfTest {\npublic:\n    RapidJson() : temp_(), doc_() {}\n\n    virtual void SetUp() {\n        PerfTest::SetUp();\n\n        // temp buffer for insitu parsing.\n        temp_ = (char *)malloc(length_ + 1);\n\n        // Parse as a document\n        EXPECT_FALSE(doc_.Parse(json_).IsNull());\n    }\n\n    virtual void TearDown() {\n        PerfTest::TearDown();\n        free(temp_);\n    }\n\nprivate:\n    RapidJson(const RapidJson&);\n    RapidJson& operator=(const RapidJson&);\n\nprotected:\n    char *temp_;\n    Document doc_;\n};\n\nTEST_F(RapidJson, SIMD_SUFFIX(ReaderParseInsitu_DummyHandler)) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        memcpy(temp_, json_, length_ + 1);\n        InsituStringStream s(temp_);\n        BaseReaderHandler<> h;\n        Reader reader;\n        EXPECT_TRUE(reader.Parse<kParseInsituFlag>(s, h));\n    }\n}\n\nTEST_F(RapidJson, SIMD_SUFFIX(ReaderParseInsitu_DummyHandler_ValidateEncoding)) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        memcpy(temp_, json_, length_ + 1);\n        InsituStringStream s(temp_);\n        BaseReaderHandler<> h;\n        Reader reader;\n        EXPECT_TRUE(reader.Parse<kParseInsituFlag | kParseValidateEncodingFlag>(s, h));\n    }\n}\n\nTEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler)) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        StringStream s(json_);\n        BaseReaderHandler<> h;\n        Reader reader;\n        EXPECT_TRUE(reader.Parse(s, h));\n    }\n}\n\nTEST_F(RapidJson, SIMD_SUFFIX(ReaderParseIterative_DummyHandler)) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        StringStream s(json_);\n        BaseReaderHandler<> h;\n        Reader reader;\n        EXPECT_TRUE(reader.Parse<kParseIterativeFlag>(s, h));\n    }\n}\n\nTEST_F(RapidJson, SIMD_SUFFIX(ReaderParseIterativeInsitu_DummyHandler)) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        memcpy(temp_, json_, length_ + 1);\n        InsituStringStream s(temp_);\n        BaseReaderHandler<> h;\n        Reader reader;\n        EXPECT_TRUE(reader.Parse<kParseIterativeFlag|kParseInsituFlag>(s, h));\n    }\n}\n\nTEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_ValidateEncoding)) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        StringStream s(json_);\n        BaseReaderHandler<> h;\n        Reader reader;\n        EXPECT_TRUE(reader.Parse<kParseValidateEncodingFlag>(s, h));\n    }\n}\n\nTEST_F(RapidJson, SIMD_SUFFIX(DocumentParseInsitu_MemoryPoolAllocator)) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        memcpy(temp_, json_, length_ + 1);\n        Document doc;\n        doc.ParseInsitu(temp_);\n        ASSERT_TRUE(doc.IsObject());\n    }\n}\n\nTEST_F(RapidJson, SIMD_SUFFIX(DocumentParseIterativeInsitu_MemoryPoolAllocator)) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        memcpy(temp_, json_, length_ + 1);\n        Document doc;\n        doc.ParseInsitu<kParseIterativeFlag>(temp_);\n        ASSERT_TRUE(doc.IsObject());\n    }\n}\n\nTEST_F(RapidJson, SIMD_SUFFIX(DocumentParse_MemoryPoolAllocator)) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        Document doc;\n        doc.Parse(json_);\n        ASSERT_TRUE(doc.IsObject());\n    }\n}\n\nTEST_F(RapidJson, SIMD_SUFFIX(DocumentParseIterative_MemoryPoolAllocator)) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        Document doc;\n        doc.Parse<kParseIterativeFlag>(json_);\n        ASSERT_TRUE(doc.IsObject());\n    }\n}\n\nTEST_F(RapidJson, SIMD_SUFFIX(DocumentParse_CrtAllocator)) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        memcpy(temp_, json_, length_ + 1);\n        GenericDocument<UTF8<>, CrtAllocator> doc;\n        doc.Parse(temp_);\n        ASSERT_TRUE(doc.IsObject());\n    }\n}\n\ntemplate<typename T>\nsize_t Traverse(const T& value) {\n    size_t count = 1;\n    switch(value.GetType()) {\n        case kObjectType:\n            for (typename T::ConstMemberIterator itr = value.MemberBegin(); itr != value.MemberEnd(); ++itr) {\n                count++;    // name\n                count += Traverse(itr->value);\n            }\n            break;\n\n        case kArrayType:\n            for (typename T::ConstValueIterator itr = value.Begin(); itr != value.End(); ++itr)\n                count += Traverse(*itr);\n            break;\n\n        default:\n            // Do nothing.\n            break;\n    }\n    return count;\n}\n\nTEST_F(RapidJson, DocumentTraverse) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        size_t count = Traverse(doc_);\n        EXPECT_EQ(4339u, count);\n        //if (i == 0)\n        //  std::cout << count << std::endl;\n    }\n}\n\n#ifdef __GNUC__\nRAPIDJSON_DIAG_PUSH\nRAPIDJSON_DIAG_OFF(effc++)\n#endif\n\nstruct ValueCounter : public BaseReaderHandler<> {\n    ValueCounter() : count_(1) {}   // root\n\n    bool EndObject(SizeType memberCount) { count_ += memberCount * 2; return true; }\n    bool EndArray(SizeType elementCount) { count_ += elementCount; return true; }\n\n    SizeType count_;\n};\n\n#ifdef __GNUC__\nRAPIDJSON_DIAG_POP\n#endif\n\nTEST_F(RapidJson, DocumentAccept) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        ValueCounter counter;\n        doc_.Accept(counter);\n        EXPECT_EQ(4339u, counter.count_);\n    }\n}\n\nstruct NullStream {\n    NullStream() /*: length_(0)*/ {}\n    void Put(char) { /*++length_;*/ }\n    void Flush() {}\n    //size_t length_;\n};\n\nTEST_F(RapidJson, Writer_NullStream) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        NullStream s;\n        Writer<NullStream> writer(s);\n        doc_.Accept(writer);\n        //if (i == 0)\n        //  std::cout << s.length_ << std::endl;\n    }\n}\n\nTEST_F(RapidJson, Writer_StringBuffer) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        StringBuffer s(0, 1024 * 1024);\n        Writer<StringBuffer> writer(s);\n        doc_.Accept(writer);\n        const char* str = s.GetString();\n        (void)str;\n        //if (i == 0)\n        //  std::cout << strlen(str) << std::endl;\n    }\n}\n\nTEST_F(RapidJson, PrettyWriter_StringBuffer) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        StringBuffer s(0, 2048 * 1024);\n        PrettyWriter<StringBuffer> writer(s);\n        writer.SetIndent(' ', 1);\n        doc_.Accept(writer);\n        const char* str = s.GetString();\n        (void)str;\n        //if (i == 0)\n        //  std::cout << strlen(str) << std::endl;\n    }\n}\n\nTEST_F(RapidJson, internal_Pow10) {\n    double sum = 0;\n    for (size_t i = 0; i < kTrialCount * kTrialCount; i++)\n        sum += internal::Pow10(int(i & 255));\n    EXPECT_GT(sum, 0.0);\n}\n\nTEST_F(RapidJson, SIMD_SUFFIX(Whitespace)) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        Document doc;\n        ASSERT_TRUE(doc.Parse(whitespace_).IsArray());\n    }       \n}\n\nTEST_F(RapidJson, UTF8_Validate) {\n    NullStream os;\n\n    for (size_t i = 0; i < kTrialCount; i++) {\n        StringStream is(json_);\n        bool result = true;\n        while (is.Peek() != '\\0')\n            result &= UTF8<>::Validate(is, os);\n        EXPECT_TRUE(result);\n    }\n}\n\n// Depreciated.\n//TEST_F(RapidJson, FileStream_Read) {\n//  for (size_t i = 0; i < kTrialCount; i++) {\n//      FILE *fp = fopen(filename_, \"rb\");\n//      FileStream s(fp);\n//      while (s.Take() != '\\0')\n//          ;\n//      fclose(fp);\n//  }\n//}\n\nTEST_F(RapidJson, FileReadStream) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        FILE *fp = fopen(filename_, \"rb\");\n        char buffer[65536];\n        FileReadStream s(fp, buffer, sizeof(buffer));\n        while (s.Take() != '\\0')\n            ;\n        fclose(fp);\n    }\n}\n\nTEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_FileReadStream)) {\n    for (size_t i = 0; i < kTrialCount; i++) {\n        FILE *fp = fopen(filename_, \"rb\");\n        char buffer[65536];\n        FileReadStream s(fp, buffer, sizeof(buffer));\n        BaseReaderHandler<> h;\n        Reader reader;\n        reader.Parse(s, h);\n        fclose(fp);\n    }\n}\n\n#endif // TEST_RAPIDJSON\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/perftest/ultrajsontest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"perftest.h\"\n\n#if TEST_ULTRAJSON\n\n#include \"ultrajson/ultrajsondec.c\"\n#include \"ultrajson/ultrajsonenc.c\"\n\nclass UltraJson : public PerfTest {\n};\n\nstatic char dummy = 0;\n\nstatic void Object_objectAddKey(JSOBJ obj, JSOBJ name, JSOBJ value) {}\nstatic void Object_arrayAddItem(JSOBJ obj, JSOBJ value) {}\n\nstatic JSOBJ Object_newString(wchar_t *start, wchar_t *end) { return &dummy; }\nstatic JSOBJ Object_newTrue(void)                           { return &dummy; }\nstatic JSOBJ Object_newFalse(void)                          { return &dummy; }\nstatic JSOBJ Object_newNull(void)                           { return &dummy; }\nstatic JSOBJ Object_newObject(void)                         { return &dummy; }\nstatic JSOBJ Object_newArray(void)                          { return &dummy; }\nstatic JSOBJ Object_newInteger(JSINT32 value)               { return &dummy; }\nstatic JSOBJ Object_newLong(JSINT64 value)                  { return &dummy; }\nstatic JSOBJ Object_newDouble(double value)                 { return &dummy; }\n\nstatic void Object_releaseObject(JSOBJ obj) {}\n\nstatic JSONObjectDecoder decoder = {\n    Object_newString,\n    Object_objectAddKey,\n    Object_arrayAddItem,\n    Object_newTrue,\n    Object_newFalse,\n    Object_newNull,\n    Object_newObject,\n    Object_newArray,\n    Object_newInteger,\n    Object_newLong,\n    Object_newDouble,\n    Object_releaseObject,\n    malloc,\n    free,\n    realloc\n};\n\nTEST_F(UltraJson, Decode) {\n    for (int i = 0; i < kTrialCount; i++) {\n        decoder.errorStr = NULL;\n        decoder.errorOffset = NULL;\n        void *ret = JSON_DecodeObject(&decoder, json_, length_);\n        ASSERT_TRUE(ret != 0);\n    }\n}\n\nTEST_F(UltraJson, Whitespace) {\n    for (int i = 0; i < kTrialCount; i++) {\n        decoder.errorStr = NULL;\n        decoder.errorOffset = NULL;\n        void *ret = JSON_DecodeObject(&decoder, whitespace_, whitespace_length_);\n        ASSERT_TRUE(ret != 0);\n    }\n}\n\n#endif // TEST_ULTRAJSON\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/perftest/yajl_all.c",
    "content": "#include \"perftest.h\"\n\n#if TEST_YAJL\n\n#ifdef _MSC_VER\n#include <float.h>\n#define isinf !_finite\n#define isnan _isnan\n#define snprintf _snprintf\n#endif\n\n#include \"yajl/src/yajl.c\"\n#include \"yajl/src/yajl_alloc.c\"\n#include \"yajl/src/yajl_buf.c\"\n#include \"yajl/src/yajl_encode.c\"\n#include \"yajl/src/yajl_gen.c\"\n#include \"yajl/src/yajl_lex.c\"\n#include \"yajl/src/yajl_parser.c\"\n#include \"yajl/src/yajl_tree.c\"\n#include \"yajl/src/yajl_version.c\"\n\n#endif // TEST_YAJL\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/perftest/yajltest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"perftest.h\"\n\n#if TEST_YAJL\n\nextern \"C\" {\n#include \"yajl/yajl_gen.h\"\n#include \"yajl/yajl_parse.h\"\n#include \"yajl/yajl_tree.h\"\n};\n\nclass Yajl : public PerfTest {\npublic:\n    virtual void SetUp() {\n        PerfTest::SetUp();\n        root_ = yajl_tree_parse(json_, NULL, 0);\n        ASSERT_TRUE(root_ != NULL);\n    }\n\n    virtual void TearDown() {\n        PerfTest::TearDown();\n        yajl_tree_free(root_);\n    }\n\nprotected:\n    yajl_val root_;\n};\n\nstatic int null_null(void *) { return 1; }\nstatic int null_boolean(void *, int) { return 1; }\nstatic int null_integer(void *, long long) { return 1; }\nstatic int null_double(void *, double) { return 1; }\nstatic int null_string(void *, const unsigned char*, size_t) { return 1; }\nstatic int null_start_map(void *) { return 1; }\nstatic int null_map_key(void *, const unsigned char*, size_t) { return 1; }\nstatic int null_end_map(void *) { return 1; }\nstatic int null_start_array(void*) { return 1; }\nstatic int null_end_array(void *) { return 1; }\n\nstatic yajl_callbacks nullcallbacks = {\n    null_null,\n    null_boolean,\n    null_integer,\n    null_double,\n    NULL,           // yajl_number(). Here we want to test full-parsing performance.\n    null_string,\n    null_start_map,\n    null_map_key,\n    null_end_map,\n    null_start_array,\n    null_end_array\n};\n\nTEST_F(Yajl, yajl_parse_nullcallbacks) {\n    for (int i = 0; i < kTrialCount; i++) {\n        yajl_handle hand = yajl_alloc(&nullcallbacks, NULL, NULL);\n        yajl_status stat = yajl_parse(hand, (unsigned char*)json_, length_);\n        //ASSERT_EQ(yajl_status_ok, stat);\n        if (stat != yajl_status_ok) {\n            unsigned char * str = yajl_get_error(hand, 1, (unsigned char*)json_, length_);\n            fprintf(stderr, \"%s\", (const char *) str);\n        }\n        stat = yajl_complete_parse(hand);\n        ASSERT_EQ(yajl_status_ok, stat);\n        yajl_free(hand);\n    }   \n}\n\nTEST_F(Yajl, yajl_tree_parse) {\n    for (int i = 0; i < kTrialCount; i++) {\n        yajl_val root = yajl_tree_parse(json_, NULL, 0);\n        ASSERT_TRUE(root != NULL);\n        yajl_tree_free(root);\n    }\n}\n\nyajl_gen_status GenVal(yajl_gen g, yajl_val v) {\n    yajl_gen_status status;\n    switch (v->type) {\n    case yajl_t_string: return yajl_gen_string(g, (unsigned char*)v->u.string, strlen(v->u.string));\n\n    case yajl_t_number: \n        {\n            char buffer[100];\n            char *num = buffer;\n            size_t len;\n            //if (YAJL_IS_INTEGER(v)) // buggy\n            if (v->u.number.flags & YAJL_NUMBER_INT_VALID)\n#if _MSC_VER\n                len = sprintf(num, \"%I64d\", YAJL_GET_INTEGER(v));\n#else\n                len = sprintf(num, \"%lld\", YAJL_GET_INTEGER(v));\n#endif\n            //else if (YAJL_IS_DOUBLE(v))   // buggy\n            else if (v->u.number.flags & YAJL_NUMBER_DOUBLE_VALID)\n                len = sprintf(num, \"%g\", YAJL_GET_DOUBLE(v));\n            else {\n                num = YAJL_GET_NUMBER(v);\n                len = strlen(buffer);\n            }\n            return yajl_gen_number(g, num, len);\n        }\n\n    case yajl_t_object:\n        status = yajl_gen_map_open(g);\n        if (status != yajl_gen_status_ok)\n            return status;\n        \n        for (size_t i = 0; i < v->u.object.len; i++) {\n            status = yajl_gen_string(g, (unsigned char *)v->u.object.keys[i], strlen(v->u.object.keys[i]));\n            if (status != yajl_gen_status_ok)\n                return status;\n            status = GenVal(g, v->u.object.values[i]);\n            if (status != yajl_gen_status_ok)\n                return status;\n        }\n        return yajl_gen_map_close(g);\n\n    case yajl_t_array:\n        status = yajl_gen_array_open(g);\n        if (status != yajl_gen_status_ok)\n            return status;\n        \n        for (size_t i = 0; i < v->u.array.len; i++) {\n            status = GenVal(g, v->u.array.values[i]);\n            if (status != yajl_gen_status_ok)\n                return status;\n        }\n\n        return yajl_gen_array_close(g);\n\n    case yajl_t_true: return yajl_gen_bool(g, 1);\n    case yajl_t_false: return yajl_gen_bool(g, 0);\n    case yajl_t_null: return yajl_gen_null(g);\n    }\n    return yajl_gen_in_error_state;\n}\n\nTEST_F(Yajl, yajl_gen) {\n    for (int i = 0; i < kTrialCount; i++) {\n        yajl_gen g = yajl_gen_alloc(NULL);\n\n        yajl_gen_status status = GenVal(g, root_);\n        if (status != yajl_gen_status_ok) {\n            std::cout << \"gen error: \" << status << std::endl;\n            FAIL();\n        }\n\n        const unsigned char * buf;\n        size_t len;\n        status = yajl_gen_get_buf(g, &buf, &len);\n        ASSERT_EQ(yajl_gen_status_ok, status);\n        //if (i == 0)\n        //  std::cout << len << std::endl;\n        yajl_gen_free(g);\n    }   \n}\n\nTEST_F(Yajl, yajl_gen_beautify) {\n    for (int i = 0; i < kTrialCount; i++) {\n        yajl_gen g = yajl_gen_alloc(NULL);\n        yajl_gen_config(g, yajl_gen_beautify, 1);\n        yajl_gen_config(g, yajl_gen_indent_string, \" \");\n\n        yajl_gen_status status = GenVal(g, root_);\n        if (status != yajl_gen_status_ok) {\n            std::cout << \"gen error: \" << status << std::endl;\n            FAIL();\n        }\n\n        const unsigned char * buf;\n        size_t len;\n        status = yajl_gen_get_buf(g, &buf, &len);\n        ASSERT_EQ(yajl_gen_status_ok, status);\n        //if (i == 0)\n        //  std::cout << len << std::endl;\n        yajl_gen_free(g);\n    }   \n}\n\nTEST_F(Yajl, Whitespace) {\n    for (int i = 0; i < kTrialCount; i++) {\n        yajl_val root = yajl_tree_parse(whitespace_, NULL, 0);\n        ASSERT_TRUE(root != NULL);\n        yajl_tree_free(root);\n    }\n}\n\n#endif // TEST_YAJL\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/unittest/documenttest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"unittest.h\"\n#include \"rapidjson/document.h\"\n#include \"rapidjson/writer.h\"\n#include \"rapidjson/filereadstream.h\"\n#include \"rapidjson/encodedstream.h\"\n#include \"rapidjson/stringbuffer.h\"\n#include <sstream>\n\nusing namespace rapidjson;\n\ntemplate <typename Allocator, typename StackAllocator>\nvoid ParseTest() {\n    typedef GenericDocument<UTF8<>, Allocator, StackAllocator> DocumentType;\n    typedef typename DocumentType::ValueType ValueType;\n    DocumentType doc;\n\n    doc.Parse(\" { \\\"hello\\\" : \\\"world\\\", \\\"t\\\" : true , \\\"f\\\" : false, \\\"n\\\": null, \\\"i\\\":123, \\\"pi\\\": 3.1416, \\\"a\\\":[1, 2, 3, 4] } \");\n\n    EXPECT_TRUE(doc.IsObject());\n\n    EXPECT_TRUE(doc.HasMember(\"hello\"));\n    const ValueType& hello = doc[\"hello\"];\n    EXPECT_TRUE(hello.IsString());\n    EXPECT_STREQ(\"world\", hello.GetString());\n\n    EXPECT_TRUE(doc.HasMember(\"t\"));\n    const ValueType& t = doc[\"t\"];\n    EXPECT_TRUE(t.IsTrue());\n\n    EXPECT_TRUE(doc.HasMember(\"f\"));\n    const ValueType& f = doc[\"f\"];\n    EXPECT_TRUE(f.IsFalse());\n\n    EXPECT_TRUE(doc.HasMember(\"n\"));\n    const ValueType& n = doc[\"n\"];\n    EXPECT_TRUE(n.IsNull());\n\n    EXPECT_TRUE(doc.HasMember(\"i\"));\n    const ValueType& i = doc[\"i\"];\n    EXPECT_TRUE(i.IsNumber());\n    EXPECT_EQ(123, i.GetInt());\n\n    EXPECT_TRUE(doc.HasMember(\"pi\"));\n    const ValueType& pi = doc[\"pi\"];\n    EXPECT_TRUE(pi.IsNumber());\n    EXPECT_EQ(3.1416, pi.GetDouble());\n\n    EXPECT_TRUE(doc.HasMember(\"a\"));\n    const ValueType& a = doc[\"a\"];\n    EXPECT_TRUE(a.IsArray());\n    EXPECT_EQ(4u, a.Size());\n    for (SizeType i = 0; i < 4; i++)\n        EXPECT_EQ(i + 1, a[i].GetUint());\n}\n\nTEST(Document, Parse) {\n    ParseTest<MemoryPoolAllocator<>, CrtAllocator>();\n    ParseTest<MemoryPoolAllocator<>, MemoryPoolAllocator<> >();\n    ParseTest<CrtAllocator, MemoryPoolAllocator<> >();\n    ParseTest<CrtAllocator, CrtAllocator>();\n}\n\nstatic FILE* OpenEncodedFile(const char* filename) {\n    char buffer[1024];\n    sprintf(buffer, \"encodings/%s\", filename);\n    FILE *fp = fopen(buffer, \"rb\");\n    if (!fp) {\n        sprintf(buffer, \"../../bin/encodings/%s\", filename);\n        fp = fopen(buffer, \"rb\");\n    }\n    return fp;\n}\n\nTEST(Document, ParseStream_EncodedInputStream) {\n    // UTF8 -> UTF16\n    FILE* fp = OpenEncodedFile(\"utf8.json\");\n    char buffer[256];\n    FileReadStream bis(fp, buffer, sizeof(buffer));\n    EncodedInputStream<UTF8<>, FileReadStream> eis(bis);\n\n    GenericDocument<UTF16<> > d;\n    d.ParseStream<0, UTF8<> >(eis);\n    EXPECT_FALSE(d.HasParseError());\n\n    fclose(fp);\n\n    wchar_t expected[] = L\"I can eat glass and it doesn't hurt me.\";\n    GenericValue<UTF16<> >& v = d[L\"en\"];\n    EXPECT_TRUE(v.IsString());\n    EXPECT_EQ(sizeof(expected) / sizeof(wchar_t) - 1, v.GetStringLength());\n    EXPECT_EQ(0, StrCmp(expected, v.GetString()));\n\n    // UTF16 -> UTF8 in memory\n    StringBuffer bos;\n    typedef EncodedOutputStream<UTF8<>, StringBuffer> OutputStream;\n    OutputStream eos(bos, false);   // Not writing BOM\n    Writer<OutputStream, UTF16<>, UTF8<> > writer(eos);\n    d.Accept(writer);\n\n    {\n        // Condense the original file and compare.\n        FILE *fp = OpenEncodedFile(\"utf8.json\");\n        FileReadStream is(fp, buffer, sizeof(buffer));\n        Reader reader;\n        StringBuffer bos2;\n        Writer<StringBuffer> writer(bos2);\n        reader.Parse(is, writer);\n\n        EXPECT_EQ(bos.GetSize(), bos2.GetSize());\n        EXPECT_EQ(0, memcmp(bos.GetString(), bos2.GetString(), bos2.GetSize()));\n    }\n}\n\nTEST(Document, ParseStream_AutoUTFInputStream) {\n    // Any -> UTF8\n    FILE* fp = OpenEncodedFile(\"utf32be.json\");\n    char buffer[256];\n    FileReadStream bis(fp, buffer, sizeof(buffer));\n    AutoUTFInputStream<unsigned, FileReadStream> eis(bis);\n\n    Document d;\n    d.ParseStream<0, AutoUTF<unsigned> >(eis);\n    EXPECT_FALSE(d.HasParseError());\n\n    fclose(fp);\n\n    char expected[] = \"I can eat glass and it doesn't hurt me.\";\n    Value& v = d[\"en\"];\n    EXPECT_TRUE(v.IsString());\n    EXPECT_EQ(sizeof(expected) - 1, v.GetStringLength());\n    EXPECT_EQ(0, StrCmp(expected, v.GetString()));\n\n    // UTF8 -> UTF8 in memory\n    StringBuffer bos;\n    Writer<StringBuffer> writer(bos);\n    d.Accept(writer);\n\n    {\n        // Condense the original file and compare.\n        FILE *fp = OpenEncodedFile(\"utf8.json\");\n        FileReadStream is(fp, buffer, sizeof(buffer));\n        Reader reader;\n        StringBuffer bos2;\n        Writer<StringBuffer> writer(bos2);\n        reader.Parse(is, writer);\n\n        EXPECT_EQ(bos.GetSize(), bos2.GetSize());\n        EXPECT_EQ(0, memcmp(bos.GetString(), bos2.GetString(), bos2.GetSize()));\n    }\n}\n\nTEST(Document, Swap) {\n    Document d1;\n    Document::AllocatorType& a = d1.GetAllocator();\n\n    d1.SetArray().PushBack(1, a).PushBack(2, a);\n\n    Value o;\n    o.SetObject().AddMember(\"a\", 1, a);\n\n    // Swap between Document and Value\n    d1.Swap(o);\n    EXPECT_TRUE(d1.IsObject());\n    EXPECT_TRUE(o.IsArray());\n\n    // Swap between Document and Document\n    Document d2;\n    d2.SetArray().PushBack(3, a);\n    d1.Swap(d2);\n    EXPECT_TRUE(d1.IsArray());\n    EXPECT_TRUE(d2.IsObject());\n}\n\n// This should be slow due to assignment in inner-loop.\nstruct OutputStringStream : public std::ostringstream {\n    typedef char Ch;\n\n    void Put(char c) {\n        put(c);\n    }\n    void Flush() {}\n};\n\nTEST(Document, AcceptWriter) {\n    Document doc;\n    doc.Parse(\" { \\\"hello\\\" : \\\"world\\\", \\\"t\\\" : true , \\\"f\\\" : false, \\\"n\\\": null, \\\"i\\\":123, \\\"pi\\\": 3.1416, \\\"a\\\":[1, 2, 3, 4] } \");\n\n    OutputStringStream os;\n    Writer<OutputStringStream> writer(os);\n    doc.Accept(writer);\n\n    EXPECT_EQ(\"{\\\"hello\\\":\\\"world\\\",\\\"t\\\":true,\\\"f\\\":false,\\\"n\\\":null,\\\"i\\\":123,\\\"pi\\\":3.1416,\\\"a\\\":[1,2,3,4]}\", os.str());\n}\n\n// Issue 44:    SetStringRaw doesn't work with wchar_t\nTEST(Document, UTF16_Document) {\n    GenericDocument< UTF16<> > json;\n    json.Parse<kParseValidateEncodingFlag>(L\"[{\\\"created_at\\\":\\\"Wed Oct 30 17:13:20 +0000 2012\\\"}]\");\n\n    ASSERT_TRUE(json.IsArray());\n    GenericValue< UTF16<> >& v = json[0u];\n    ASSERT_TRUE(v.IsObject());\n\n    GenericValue< UTF16<> >& s = v[L\"created_at\"];\n    ASSERT_TRUE(s.IsString());\n\n    EXPECT_EQ(0, wcscmp(L\"Wed Oct 30 17:13:20 +0000 2012\", s.GetString()));\n}\n\n// Issue 22: Memory corruption via operator=\n// Fixed by making unimplemented assignment operator private.\n//TEST(Document, Assignment) {\n//  Document d1;\n//  Document d2;\n//  d1 = d2;\n//}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/unittest/encodedstreamtest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"unittest.h\"\n#include \"rapidjson/filereadstream.h\"\n#include \"rapidjson/filewritestream.h\"\n#include \"rapidjson/encodedstream.h\"\n#include \"rapidjson/stringbuffer.h\"\n#include \"rapidjson/memorystream.h\"\n#include \"rapidjson/memorybuffer.h\"\n\nusing namespace rapidjson;\n\nclass EncodedStreamTest : public ::testing::Test {\npublic:\n    EncodedStreamTest() : json_(), length_() {}\n\n    virtual void SetUp() {\n        json_ = ReadFile(\"utf8.json\", true, &length_);\n    }\n\n    virtual void TearDown() {\n        free(json_);\n        json_ = 0;\n    }\n\nprivate:\n    EncodedStreamTest(const EncodedStreamTest&);\n    EncodedStreamTest& operator=(const EncodedStreamTest&);\n    \nprotected:\n    static FILE* Open(const char* filename) {\n        char buffer[1024];\n        sprintf(buffer, \"encodings/%s\", filename);\n        FILE *fp = fopen(buffer, \"rb\");\n        if (!fp) {\n            sprintf(buffer, \"../../bin/encodings/%s\", filename);\n            fp = fopen(buffer, \"rb\");\n        }\n        return fp;\n    }\n\n    static char *ReadFile(const char* filename, bool appendPath, size_t* outLength) {\n        FILE *fp = appendPath ? Open(filename) : fopen(filename, \"rb\");\n\n        if (!fp) {\n            *outLength = 0;\n            return 0;\n        }\n\n        fseek(fp, 0, SEEK_END);\n        *outLength = (size_t)ftell(fp);\n        fseek(fp, 0, SEEK_SET);\n        char* buffer = (char*)malloc(*outLength + 1);\n        size_t readLength = fread(buffer, 1, *outLength, fp);\n        buffer[readLength] = '\\0';\n        fclose(fp);\n        return buffer;\n    }\n\n    template <typename FileEncoding, typename MemoryEncoding>\n    void TestEncodedInputStream(const char* filename) {\n        // Test FileReadStream\n        {\n            char buffer[16];\n            FILE *fp = Open(filename);\n            ASSERT_TRUE(fp != 0);\n            FileReadStream fs(fp, buffer, sizeof(buffer));\n            EncodedInputStream<FileEncoding, FileReadStream> eis(fs);\n            StringStream s(json_);\n\n            while (eis.Peek() != '\\0') {\n                unsigned expected, actual;\n                EXPECT_TRUE(UTF8<>::Decode(s, &expected));\n                EXPECT_TRUE(MemoryEncoding::Decode(eis, &actual));\n                EXPECT_EQ(expected, actual);\n            }\n            EXPECT_EQ('\\0', s.Peek());\n            fclose(fp);\n        }\n\n        // Test MemoryStream\n        {\n            size_t size;\n            char* data = ReadFile(filename, true, &size);\n            MemoryStream ms(data, size);\n            EncodedInputStream<FileEncoding, MemoryStream> eis(ms);\n            StringStream s(json_);\n\n            while (eis.Peek() != '\\0') {\n                unsigned expected, actual;\n                EXPECT_TRUE(UTF8<>::Decode(s, &expected));\n                EXPECT_TRUE(MemoryEncoding::Decode(eis, &actual));\n                EXPECT_EQ(expected, actual);\n            }\n            EXPECT_EQ('\\0', s.Peek());\n            free(data);\n        }\n    }\n\n    void TestAutoUTFInputStream(const char *filename) {\n        // Test FileReadStream\n        {\n            char buffer[16];\n            FILE *fp = Open(filename);\n            ASSERT_TRUE(fp != 0);\n            FileReadStream fs(fp, buffer, sizeof(buffer));\n            AutoUTFInputStream<unsigned, FileReadStream> eis(fs);\n            StringStream s(json_);\n            while (eis.Peek() != '\\0') {\n                unsigned expected, actual;\n                EXPECT_TRUE(UTF8<>::Decode(s, &expected));\n                EXPECT_TRUE(AutoUTF<unsigned>::Decode(eis, &actual));\n                EXPECT_EQ(expected, actual);\n            }\n            EXPECT_EQ('\\0', s.Peek());\n            fclose(fp);\n        }\n\n        // Test MemoryStream\n        {\n            size_t size;\n            char* data = ReadFile(filename, true, &size);\n            MemoryStream ms(data, size);\n            AutoUTFInputStream<unsigned, MemoryStream> eis(ms);\n            StringStream s(json_);\n\n            while (eis.Peek() != '\\0') {\n                unsigned expected, actual;\n                EXPECT_TRUE(UTF8<>::Decode(s, &expected));\n                EXPECT_TRUE(AutoUTF<unsigned>::Decode(eis, &actual));\n                EXPECT_EQ(expected, actual);\n            }\n            EXPECT_EQ('\\0', s.Peek());\n            free(data);\n        }\n    }\n\n    template <typename FileEncoding, typename MemoryEncoding>\n    void TestEncodedOutputStream(const char* expectedFilename, bool putBOM) {\n        // Test FileWriteStream\n        {\n            char filename[L_tmpnam];\n            FILE* fp = TempFile(filename);\n            char buffer[16];\n            FileWriteStream os(fp, buffer, sizeof(buffer));\n            EncodedOutputStream<FileEncoding, FileWriteStream> eos(os, putBOM);\n            StringStream s(json_);\n            while (s.Peek() != '\\0') {\n                bool success = Transcoder<UTF8<>, MemoryEncoding>::Transcode(s, eos);\n                EXPECT_TRUE(success);\n            }\n            eos.Flush();\n            fclose(fp);\n            EXPECT_TRUE(CompareFile(filename, expectedFilename));\n            remove(filename);\n        }\n\n        // Test MemoryBuffer\n        {\n            MemoryBuffer mb;\n            EncodedOutputStream<FileEncoding, MemoryBuffer> eos(mb, putBOM);\n            StringStream s(json_);\n            while (s.Peek() != '\\0') {\n                bool success = Transcoder<UTF8<>, MemoryEncoding>::Transcode(s, eos);\n                EXPECT_TRUE(success);\n            }\n            eos.Flush();\n            EXPECT_TRUE(CompareBufferFile(mb.GetBuffer(), mb.GetSize(), expectedFilename));\n        }\n    }\n\n    void TestAutoUTFOutputStream(UTFType type, bool putBOM, const char *expectedFilename) {\n        // Test FileWriteStream\n        {\n            char filename[L_tmpnam];\n            FILE* fp = TempFile(filename);\n\n            char buffer[16];\n            FileWriteStream os(fp, buffer, sizeof(buffer));\n            AutoUTFOutputStream<unsigned, FileWriteStream> eos(os, type, putBOM);\n            StringStream s(json_);\n            while (s.Peek() != '\\0') {\n                bool success = Transcoder<UTF8<>, AutoUTF<unsigned> >::Transcode(s, eos);\n                EXPECT_TRUE(success);\n            }\n            eos.Flush();\n            fclose(fp);\n            EXPECT_TRUE(CompareFile(filename, expectedFilename));\n            remove(filename);\n        }\n\n        // Test MemoryBuffer\n        {\n            MemoryBuffer mb;\n            AutoUTFOutputStream<unsigned, MemoryBuffer> eos(mb, type, putBOM);\n            StringStream s(json_);\n            while (s.Peek() != '\\0') {\n                bool success = Transcoder<UTF8<>, AutoUTF<unsigned> >::Transcode(s, eos);\n                EXPECT_TRUE(success);\n            }\n            eos.Flush();\n            EXPECT_TRUE(CompareBufferFile(mb.GetBuffer(), mb.GetSize(), expectedFilename));\n        }\n    }\n\n    bool CompareFile(const char* filename, const char* expectedFilename) {\n        size_t actualLength, expectedLength;\n        char* actualBuffer = ReadFile(filename, false, &actualLength);\n        char* expectedBuffer = ReadFile(expectedFilename, true, &expectedLength);\n        bool ret = (expectedLength == actualLength) && memcmp(expectedBuffer, actualBuffer, actualLength) == 0;\n        free(actualBuffer);\n        free(expectedBuffer);\n        return ret;\n    }\n\n    bool CompareBufferFile(const char* actualBuffer, size_t actualLength, const char* expectedFilename) {\n        size_t expectedLength;\n        char* expectedBuffer = ReadFile(expectedFilename, true, &expectedLength);\n        bool ret = (expectedLength == actualLength) && memcmp(expectedBuffer, actualBuffer, actualLength) == 0;\n        free(expectedBuffer);\n        return ret;\n    }\n\n    char *json_;\n    size_t length_;\n};\n\nTEST_F(EncodedStreamTest, EncodedInputStream) {\n    TestEncodedInputStream<UTF8<>,    UTF8<>  >(\"utf8.json\");\n    TestEncodedInputStream<UTF8<>,    UTF8<>  >(\"utf8bom.json\");\n    TestEncodedInputStream<UTF16LE<>, UTF16<> >(\"utf16le.json\");\n    TestEncodedInputStream<UTF16LE<>, UTF16<> >(\"utf16lebom.json\");\n    TestEncodedInputStream<UTF16BE<>, UTF16<> >(\"utf16be.json\");\n    TestEncodedInputStream<UTF16BE<>, UTF16<> >(\"utf16bebom.json\");\n    TestEncodedInputStream<UTF32LE<>, UTF32<> >(\"utf32le.json\");\n    TestEncodedInputStream<UTF32LE<>, UTF32<> >(\"utf32lebom.json\");\n    TestEncodedInputStream<UTF32BE<>, UTF32<> >(\"utf32be.json\");\n    TestEncodedInputStream<UTF32BE<>, UTF32<> >(\"utf32bebom.json\");\n}\n\nTEST_F(EncodedStreamTest, AutoUTFInputStream) {\n    TestAutoUTFInputStream(\"utf8.json\");\n    TestAutoUTFInputStream(\"utf8bom.json\");\n    TestAutoUTFInputStream(\"utf16le.json\");\n    TestAutoUTFInputStream(\"utf16lebom.json\");\n    TestAutoUTFInputStream(\"utf16be.json\");\n    TestAutoUTFInputStream(\"utf16bebom.json\");\n    TestAutoUTFInputStream(\"utf32le.json\");\n    TestAutoUTFInputStream(\"utf32lebom.json\");\n    TestAutoUTFInputStream(\"utf32be.json\");\n    TestAutoUTFInputStream(\"utf32bebom.json\");\n}\n\nTEST_F(EncodedStreamTest, EncodedOutputStream) {\n    TestEncodedOutputStream<UTF8<>,     UTF8<>  >(\"utf8.json\",      false);\n    TestEncodedOutputStream<UTF8<>,     UTF8<>  >(\"utf8bom.json\",   true);\n    TestEncodedOutputStream<UTF16LE<>,  UTF16<> >(\"utf16le.json\",   false);\n    TestEncodedOutputStream<UTF16LE<>,  UTF16<> >(\"utf16lebom.json\",true);\n    TestEncodedOutputStream<UTF16BE<>,  UTF16<> >(\"utf16be.json\",   false);\n    TestEncodedOutputStream<UTF16BE<>,  UTF16<> >(\"utf16bebom.json\",true);\n    TestEncodedOutputStream<UTF32LE<>,  UTF32<> >(\"utf32le.json\",   false);\n    TestEncodedOutputStream<UTF32LE<>,  UTF32<> >(\"utf32lebom.json\",true);\n    TestEncodedOutputStream<UTF32BE<>,  UTF32<> >(\"utf32be.json\",   false);\n    TestEncodedOutputStream<UTF32BE<>,  UTF32<> >(\"utf32bebom.json\",true);\n}\n\nTEST_F(EncodedStreamTest, AutoUTFOutputStream) {\n    TestAutoUTFOutputStream(kUTF8,      false,  \"utf8.json\");\n    TestAutoUTFOutputStream(kUTF8,      true,   \"utf8bom.json\");\n    TestAutoUTFOutputStream(kUTF16LE,   false,  \"utf16le.json\");\n    TestAutoUTFOutputStream(kUTF16LE,   true,   \"utf16lebom.json\");\n    TestAutoUTFOutputStream(kUTF16BE,   false,  \"utf16be.json\");\n    TestAutoUTFOutputStream(kUTF16BE,   true,   \"utf16bebom.json\");\n    TestAutoUTFOutputStream(kUTF32LE,   false,  \"utf32le.json\");\n    TestAutoUTFOutputStream(kUTF32LE,   true,   \"utf32lebom.json\");\n    TestAutoUTFOutputStream(kUTF32BE,   false,  \"utf32be.json\");\n    TestAutoUTFOutputStream(kUTF32BE,   true,   \"utf32bebom.json\");\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/unittest/encodingstest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"unittest.h\"\n#include \"rapidjson/filereadstream.h\"\n#include \"rapidjson/filewritestream.h\"\n#include \"rapidjson/encodedstream.h\"\n#include \"rapidjson/stringbuffer.h\"\n\nusing namespace rapidjson;\n\n// Verification of encoders/decoders with Hoehrmann's UTF8 decoder\n\n// http://www.unicode.org/Public/UNIDATA/Blocks.txt\nstatic const unsigned kCodepointRanges[] = {\n    0x0000,     0x007F,     // Basic Latin\n    0x0080,     0x00FF,     // Latin-1 Supplement\n    0x0100,     0x017F,     // Latin Extended-A\n    0x0180,     0x024F,     // Latin Extended-B\n    0x0250,     0x02AF,     // IPA Extensions\n    0x02B0,     0x02FF,     // Spacing Modifier Letters\n    0x0300,     0x036F,     // Combining Diacritical Marks\n    0x0370,     0x03FF,     // Greek and Coptic\n    0x0400,     0x04FF,     // Cyrillic\n    0x0500,     0x052F,     // Cyrillic Supplement\n    0x0530,     0x058F,     // Armenian\n    0x0590,     0x05FF,     // Hebrew\n    0x0600,     0x06FF,     // Arabic\n    0x0700,     0x074F,     // Syriac\n    0x0750,     0x077F,     // Arabic Supplement\n    0x0780,     0x07BF,     // Thaana\n    0x07C0,     0x07FF,     // NKo\n    0x0800,     0x083F,     // Samaritan\n    0x0840,     0x085F,     // Mandaic\n    0x0900,     0x097F,     // Devanagari\n    0x0980,     0x09FF,     // Bengali\n    0x0A00,     0x0A7F,     // Gurmukhi\n    0x0A80,     0x0AFF,     // Gujarati\n    0x0B00,     0x0B7F,     // Oriya\n    0x0B80,     0x0BFF,     // Tamil\n    0x0C00,     0x0C7F,     // Telugu\n    0x0C80,     0x0CFF,     // Kannada\n    0x0D00,     0x0D7F,     // Malayalam\n    0x0D80,     0x0DFF,     // Sinhala\n    0x0E00,     0x0E7F,     // Thai\n    0x0E80,     0x0EFF,     // Lao\n    0x0F00,     0x0FFF,     // Tibetan\n    0x1000,     0x109F,     // Myanmar\n    0x10A0,     0x10FF,     // Georgian\n    0x1100,     0x11FF,     // Hangul Jamo\n    0x1200,     0x137F,     // Ethiopic\n    0x1380,     0x139F,     // Ethiopic Supplement\n    0x13A0,     0x13FF,     // Cherokee\n    0x1400,     0x167F,     // Unified Canadian Aboriginal Syllabics\n    0x1680,     0x169F,     // Ogham\n    0x16A0,     0x16FF,     // Runic\n    0x1700,     0x171F,     // Tagalog\n    0x1720,     0x173F,     // Hanunoo\n    0x1740,     0x175F,     // Buhid\n    0x1760,     0x177F,     // Tagbanwa\n    0x1780,     0x17FF,     // Khmer\n    0x1800,     0x18AF,     // Mongolian\n    0x18B0,     0x18FF,     // Unified Canadian Aboriginal Syllabics Extended\n    0x1900,     0x194F,     // Limbu\n    0x1950,     0x197F,     // Tai Le\n    0x1980,     0x19DF,     // New Tai Lue\n    0x19E0,     0x19FF,     // Khmer Symbols\n    0x1A00,     0x1A1F,     // Buginese\n    0x1A20,     0x1AAF,     // Tai Tham\n    0x1B00,     0x1B7F,     // Balinese\n    0x1B80,     0x1BBF,     // Sundanese\n    0x1BC0,     0x1BFF,     // Batak\n    0x1C00,     0x1C4F,     // Lepcha\n    0x1C50,     0x1C7F,     // Ol Chiki\n    0x1CD0,     0x1CFF,     // Vedic Extensions\n    0x1D00,     0x1D7F,     // Phonetic Extensions\n    0x1D80,     0x1DBF,     // Phonetic Extensions Supplement\n    0x1DC0,     0x1DFF,     // Combining Diacritical Marks Supplement\n    0x1E00,     0x1EFF,     // Latin Extended Additional\n    0x1F00,     0x1FFF,     // Greek Extended\n    0x2000,     0x206F,     // General Punctuation\n    0x2070,     0x209F,     // Superscripts and Subscripts\n    0x20A0,     0x20CF,     // Currency Symbols\n    0x20D0,     0x20FF,     // Combining Diacritical Marks for Symbols\n    0x2100,     0x214F,     // Letterlike Symbols\n    0x2150,     0x218F,     // Number Forms\n    0x2190,     0x21FF,     // Arrows\n    0x2200,     0x22FF,     // Mathematical Operators\n    0x2300,     0x23FF,     // Miscellaneous Technical\n    0x2400,     0x243F,     // Control Pictures\n    0x2440,     0x245F,     // Optical Character Recognition\n    0x2460,     0x24FF,     // Enclosed Alphanumerics\n    0x2500,     0x257F,     // Box Drawing\n    0x2580,     0x259F,     // Block Elements\n    0x25A0,     0x25FF,     // Geometric Shapes\n    0x2600,     0x26FF,     // Miscellaneous Symbols\n    0x2700,     0x27BF,     // Dingbats\n    0x27C0,     0x27EF,     // Miscellaneous Mathematical Symbols-A\n    0x27F0,     0x27FF,     // Supplemental Arrows-A\n    0x2800,     0x28FF,     // Braille Patterns\n    0x2900,     0x297F,     // Supplemental Arrows-B\n    0x2980,     0x29FF,     // Miscellaneous Mathematical Symbols-B\n    0x2A00,     0x2AFF,     // Supplemental Mathematical Operators\n    0x2B00,     0x2BFF,     // Miscellaneous Symbols and Arrows\n    0x2C00,     0x2C5F,     // Glagolitic\n    0x2C60,     0x2C7F,     // Latin Extended-C\n    0x2C80,     0x2CFF,     // Coptic\n    0x2D00,     0x2D2F,     // Georgian Supplement\n    0x2D30,     0x2D7F,     // Tifinagh\n    0x2D80,     0x2DDF,     // Ethiopic Extended\n    0x2DE0,     0x2DFF,     // Cyrillic Extended-A\n    0x2E00,     0x2E7F,     // Supplemental Punctuation\n    0x2E80,     0x2EFF,     // CJK Radicals Supplement\n    0x2F00,     0x2FDF,     // Kangxi Radicals\n    0x2FF0,     0x2FFF,     // Ideographic Description Characters\n    0x3000,     0x303F,     // CJK Symbols and Punctuation\n    0x3040,     0x309F,     // Hiragana\n    0x30A0,     0x30FF,     // Katakana\n    0x3100,     0x312F,     // Bopomofo\n    0x3130,     0x318F,     // Hangul Compatibility Jamo\n    0x3190,     0x319F,     // Kanbun\n    0x31A0,     0x31BF,     // Bopomofo Extended\n    0x31C0,     0x31EF,     // CJK Strokes\n    0x31F0,     0x31FF,     // Katakana Phonetic Extensions\n    0x3200,     0x32FF,     // Enclosed CJK Letters and Months\n    0x3300,     0x33FF,     // CJK Compatibility\n    0x3400,     0x4DBF,     // CJK Unified Ideographs Extension A\n    0x4DC0,     0x4DFF,     // Yijing Hexagram Symbols\n    0x4E00,     0x9FFF,     // CJK Unified Ideographs\n    0xA000,     0xA48F,     // Yi Syllables\n    0xA490,     0xA4CF,     // Yi Radicals\n    0xA4D0,     0xA4FF,     // Lisu\n    0xA500,     0xA63F,     // Vai\n    0xA640,     0xA69F,     // Cyrillic Extended-B\n    0xA6A0,     0xA6FF,     // Bamum\n    0xA700,     0xA71F,     // Modifier Tone Letters\n    0xA720,     0xA7FF,     // Latin Extended-D\n    0xA800,     0xA82F,     // Syloti Nagri\n    0xA830,     0xA83F,     // Common Indic Number Forms\n    0xA840,     0xA87F,     // Phags-pa\n    0xA880,     0xA8DF,     // Saurashtra\n    0xA8E0,     0xA8FF,     // Devanagari Extended\n    0xA900,     0xA92F,     // Kayah Li\n    0xA930,     0xA95F,     // Rejang\n    0xA960,     0xA97F,     // Hangul Jamo Extended-A\n    0xA980,     0xA9DF,     // Javanese\n    0xAA00,     0xAA5F,     // Cham\n    0xAA60,     0xAA7F,     // Myanmar Extended-A\n    0xAA80,     0xAADF,     // Tai Viet\n    0xAB00,     0xAB2F,     // Ethiopic Extended-A\n    0xABC0,     0xABFF,     // Meetei Mayek\n    0xAC00,     0xD7AF,     // Hangul Syllables\n    0xD7B0,     0xD7FF,     // Hangul Jamo Extended-B\n    //0xD800,       0xDB7F,     // High Surrogates\n    //0xDB80,       0xDBFF,     // High Private Use Surrogates\n    //0xDC00,       0xDFFF,     // Low Surrogates\n    0xE000,     0xF8FF,     // Private Use Area\n    0xF900,     0xFAFF,     // CJK Compatibility Ideographs\n    0xFB00,     0xFB4F,     // Alphabetic Presentation Forms\n    0xFB50,     0xFDFF,     // Arabic Presentation Forms-A\n    0xFE00,     0xFE0F,     // Variation Selectors\n    0xFE10,     0xFE1F,     // Vertical Forms\n    0xFE20,     0xFE2F,     // Combining Half Marks\n    0xFE30,     0xFE4F,     // CJK Compatibility Forms\n    0xFE50,     0xFE6F,     // Small Form Variants\n    0xFE70,     0xFEFF,     // Arabic Presentation Forms-B\n    0xFF00,     0xFFEF,     // Halfwidth and Fullwidth Forms\n    0xFFF0,     0xFFFF,     // Specials\n    0x10000,    0x1007F,    // Linear B Syllabary\n    0x10080,    0x100FF,    // Linear B Ideograms\n    0x10100,    0x1013F,    // Aegean Numbers\n    0x10140,    0x1018F,    // Ancient Greek Numbers\n    0x10190,    0x101CF,    // Ancient Symbols\n    0x101D0,    0x101FF,    // Phaistos Disc\n    0x10280,    0x1029F,    // Lycian\n    0x102A0,    0x102DF,    // Carian\n    0x10300,    0x1032F,    // Old Italic\n    0x10330,    0x1034F,    // Gothic\n    0x10380,    0x1039F,    // Ugaritic\n    0x103A0,    0x103DF,    // Old Persian\n    0x10400,    0x1044F,    // Deseret\n    0x10450,    0x1047F,    // Shavian\n    0x10480,    0x104AF,    // Osmanya\n    0x10800,    0x1083F,    // Cypriot Syllabary\n    0x10840,    0x1085F,    // Imperial Aramaic\n    0x10900,    0x1091F,    // Phoenician\n    0x10920,    0x1093F,    // Lydian\n    0x10A00,    0x10A5F,    // Kharoshthi\n    0x10A60,    0x10A7F,    // Old South Arabian\n    0x10B00,    0x10B3F,    // Avestan\n    0x10B40,    0x10B5F,    // Inscriptional Parthian\n    0x10B60,    0x10B7F,    // Inscriptional Pahlavi\n    0x10C00,    0x10C4F,    // Old Turkic\n    0x10E60,    0x10E7F,    // Rumi Numeral Symbols\n    0x11000,    0x1107F,    // Brahmi\n    0x11080,    0x110CF,    // Kaithi\n    0x12000,    0x123FF,    // Cuneiform\n    0x12400,    0x1247F,    // Cuneiform Numbers and Punctuation\n    0x13000,    0x1342F,    // Egyptian Hieroglyphs\n    0x16800,    0x16A3F,    // Bamum Supplement\n    0x1B000,    0x1B0FF,    // Kana Supplement\n    0x1D000,    0x1D0FF,    // Byzantine Musical Symbols\n    0x1D100,    0x1D1FF,    // Musical Symbols\n    0x1D200,    0x1D24F,    // Ancient Greek Musical Notation\n    0x1D300,    0x1D35F,    // Tai Xuan Jing Symbols\n    0x1D360,    0x1D37F,    // Counting Rod Numerals\n    0x1D400,    0x1D7FF,    // Mathematical Alphanumeric Symbols\n    0x1F000,    0x1F02F,    // Mahjong Tiles\n    0x1F030,    0x1F09F,    // Domino Tiles\n    0x1F0A0,    0x1F0FF,    // Playing Cards\n    0x1F100,    0x1F1FF,    // Enclosed Alphanumeric Supplement\n    0x1F200,    0x1F2FF,    // Enclosed Ideographic Supplement\n    0x1F300,    0x1F5FF,    // Miscellaneous Symbols And Pictographs\n    0x1F600,    0x1F64F,    // Emoticons\n    0x1F680,    0x1F6FF,    // Transport And Map Symbols\n    0x1F700,    0x1F77F,    // Alchemical Symbols\n    0x20000,    0x2A6DF,    // CJK Unified Ideographs Extension B\n    0x2A700,    0x2B73F,    // CJK Unified Ideographs Extension C\n    0x2B740,    0x2B81F,    // CJK Unified Ideographs Extension D\n    0x2F800,    0x2FA1F,    // CJK Compatibility Ideographs Supplement\n    0xE0000,    0xE007F,    // Tags\n    0xE0100,    0xE01EF,    // Variation Selectors Supplement\n    0xF0000,    0xFFFFF,    // Supplementary Private Use Area-A\n    0x100000,   0x10FFFF,   // Supplementary Private Use Area-B\n    0xFFFFFFFF\n};\n\n// Copyright (c) 2008-2010 Bjoern Hoehrmann <bjoern@hoehrmann.de>\n// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.\n\n#define UTF8_ACCEPT 0u\n#define UTF8_REJECT 12u\n\nstatic const unsigned char utf8d[] = {\n    // The first part of the table maps bytes to character classes that\n    // to reduce the size of the transition table and create bitmasks.\n    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,\n    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,\n    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,\n    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,\n    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,  9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,\n    7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,  7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n    8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,\n    10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,\n\n    // The second part is a transition table that maps a combination\n    // of a state of the automaton and a character class to a state.\n    0,12,24,36,60,96,84,12,12,12,48,72, 12,12,12,12,12,12,12,12,12,12,12,12,\n    12, 0,12,12,12,12,12, 0,12, 0,12,12, 12,24,12,12,12,12,12,24,12,24,12,12,\n    12,12,12,12,12,12,12,24,12,12,12,12, 12,24,12,12,12,12,12,12,12,24,12,12,\n    12,12,12,12,12,12,12,36,12,36,12,12, 12,36,12,12,12,12,12,36,12,36,12,12,\n    12,36,12,12,12,12,12,12,12,12,12,12, \n};\n\nstatic unsigned inline decode(unsigned* state, unsigned* codep, unsigned byte) {\n    unsigned type = utf8d[byte];\n\n    *codep = (*state != UTF8_ACCEPT) ?\n        (byte & 0x3fu) | (*codep << 6) :\n    (0xff >> type) & (byte);\n\n    *state = utf8d[256 + *state + type];\n    return *state;\n}\n\n//static bool IsUTF8(unsigned char* s) {\n//  unsigned codepoint, state = 0;\n//\n//  while (*s)\n//      decode(&state, &codepoint, *s++);\n//\n//  return state == UTF8_ACCEPT;\n//}\n\nTEST(EncodingsTest, UTF8) {\n    StringBuffer os, os2;\n    for (const unsigned* range = kCodepointRanges; *range != 0xFFFFFFFF; range += 2) {\n        for (unsigned codepoint = range[0]; codepoint <= range[1]; ++codepoint) {\n            os.Clear();\n            UTF8<>::Encode(os, codepoint);\n            const char* encodedStr = os.GetString();\n\n            // Decode with Hoehrmann\n            {\n                unsigned decodedCodepoint = 0;\n                unsigned state = 0;\n\n                unsigned decodedCount = 0;\n                for (const char* s = encodedStr; *s; ++s)\n                    if (!decode(&state, &decodedCodepoint, (unsigned char)*s)) {\n                        EXPECT_EQ(codepoint, decodedCodepoint);\n                        decodedCount++;\n                    }\n\n                if (*encodedStr)                // This decoder cannot handle U+0000\n                    EXPECT_EQ(1u, decodedCount);    // Should only contain one code point\n\n                EXPECT_EQ(UTF8_ACCEPT, state);\n                if (UTF8_ACCEPT != state)\n                    std::cout << std::hex << codepoint << \" \" << decodedCodepoint << std::endl;\n            }\n\n            // Decode\n            {\n                StringStream is(encodedStr);\n                unsigned decodedCodepoint;\n                bool result = UTF8<>::Decode(is, &decodedCodepoint);\n                EXPECT_TRUE(result);\n                EXPECT_EQ(codepoint, decodedCodepoint);\n                if (!result || codepoint != decodedCodepoint)\n                    std::cout << std::hex << codepoint << \" \" << decodedCodepoint << std::endl;\n            }\n\n            // Validate\n            {\n                StringStream is(encodedStr);\n                os2.Clear();\n                bool result = UTF8<>::Validate(is, os2);\n                EXPECT_TRUE(result);\n                EXPECT_EQ(0, StrCmp(encodedStr, os2.GetString()));\n            }\n        }\n    }\n}\n\nTEST(EncodingsTest, UTF16) {\n    GenericStringBuffer<UTF16<> > os, os2;\n    GenericStringBuffer<UTF8<> > utf8os;\n    for (const unsigned* range = kCodepointRanges; *range != 0xFFFFFFFF; range += 2) {\n        for (unsigned codepoint = range[0]; codepoint <= range[1]; ++codepoint) {\n            os.Clear();\n            UTF16<>::Encode(os, codepoint);\n            const UTF16<>::Ch* encodedStr = os.GetString();\n\n            // Encode with Hoehrmann's code\n            if (codepoint != 0) // cannot handle U+0000\n            {\n                // encode with UTF8<> first\n                utf8os.Clear();\n                UTF8<>::Encode(utf8os, codepoint);\n\n                // transcode from UTF8 to UTF16 with Hoehrmann's code\n                unsigned decodedCodepoint = 0;\n                unsigned state = 0;\n                UTF16<>::Ch buffer[3], *p = &buffer[0];\n                for (const char* s = utf8os.GetString(); *s; ++s) {\n                    if (!decode(&state, &decodedCodepoint, (unsigned char)*s))\n                        break;\n                }\n\n                if (codepoint <= 0xFFFF)\n                    *p++ = static_cast<UTF16<>::Ch>(decodedCodepoint);\n                else {\n                    // Encode code points above U+FFFF as surrogate pair.\n                    *p++ = static_cast<UTF16<>::Ch>(0xD7C0 + (decodedCodepoint >> 10));\n                    *p++ = static_cast<UTF16<>::Ch>(0xDC00 + (decodedCodepoint & 0x3FF));\n                }\n                *p++ = '\\0';\n\n                EXPECT_EQ(0, StrCmp(buffer, encodedStr));\n            }\n\n            // Decode\n            {\n                GenericStringStream<UTF16<> > is(encodedStr);\n                unsigned decodedCodepoint;\n                bool result = UTF16<>::Decode(is, &decodedCodepoint);\n                EXPECT_TRUE(result);\n                EXPECT_EQ(codepoint, decodedCodepoint);         \n                if (!result || codepoint != decodedCodepoint)\n                    std::cout << std::hex << codepoint << \" \" << decodedCodepoint << std::endl;\n            }\n\n            // Validate\n            {\n                GenericStringStream<UTF16<> > is(encodedStr);\n                os2.Clear();\n                bool result = UTF16<>::Validate(is, os2);\n                EXPECT_TRUE(result);\n                EXPECT_EQ(0, StrCmp(encodedStr, os2.GetString()));\n            }\n        }\n    }\n}\n\nTEST(EncodingsTest, UTF32) {\n    GenericStringBuffer<UTF32<> > os, os2;\n    for (const unsigned* range = kCodepointRanges; *range != 0xFFFFFFFF; range += 2) {\n        for (unsigned codepoint = range[0]; codepoint <= range[1]; ++codepoint) {\n            os.Clear();\n            UTF32<>::Encode(os, codepoint);\n            const UTF32<>::Ch* encodedStr = os.GetString();\n\n            // Decode\n            {\n                GenericStringStream<UTF32<> > is(encodedStr);\n                unsigned decodedCodepoint;\n                bool result = UTF32<>::Decode(is, &decodedCodepoint);\n                EXPECT_TRUE(result);\n                EXPECT_EQ(codepoint, decodedCodepoint);         \n                if (!result || codepoint != decodedCodepoint)\n                    std::cout << std::hex << codepoint << \" \" << decodedCodepoint << std::endl;\n            }\n\n            // Validate\n            {\n                GenericStringStream<UTF32<> > is(encodedStr);\n                os2.Clear();\n                bool result = UTF32<>::Validate(is, os2);\n                EXPECT_TRUE(result);\n                EXPECT_EQ(0, StrCmp(encodedStr, os2.GetString()));\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/unittest/filestreamtest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"unittest.h\"\n#include \"rapidjson/filestream.h\"\n#include \"rapidjson/filereadstream.h\"\n#include \"rapidjson/filewritestream.h\"\n#include \"rapidjson/encodedstream.h\"\n\nusing namespace rapidjson;\n\nclass FileStreamTest : public ::testing::Test {\npublic:\n    FileStreamTest() : filename_(), json_(), length_() {}\n\n    virtual void SetUp() {\n        FILE *fp = fopen(filename_ = \"data/sample.json\", \"rb\");\n        if (!fp) \n            fp = fopen(filename_ = \"../../bin/data/sample.json\", \"rb\");\n        ASSERT_TRUE(fp != 0);\n\n        fseek(fp, 0, SEEK_END);\n        length_ = (size_t)ftell(fp);\n        fseek(fp, 0, SEEK_SET);\n        json_ = (char*)malloc(length_ + 1);\n        size_t readLength = fread(json_, 1, length_, fp);\n        json_[readLength] = '\\0';\n        fclose(fp);\n    }\n\n    virtual void TearDown() {\n        free(json_);\n        json_ = 0;\n    }\n\nprivate:\n    FileStreamTest(const FileStreamTest&);\n    FileStreamTest& operator=(const FileStreamTest&);\n    \nprotected:\n    const char* filename_;\n    char *json_;\n    size_t length_;\n};\n\n// Depreciated\n//TEST_F(FileStreamTest, FileStream_Read) {\n//  FILE *fp = fopen(filename_, \"rb\");\n//  ASSERT_TRUE(fp != 0);\n//  FileStream s(fp);\n//\n//  for (size_t i = 0; i < length_; i++) {\n//      EXPECT_EQ(json_[i], s.Peek());\n//      EXPECT_EQ(json_[i], s.Peek());  // 2nd time should be the same\n//      EXPECT_EQ(json_[i], s.Take());\n//  }\n//\n//  EXPECT_EQ(length_, s.Tell());\n//  EXPECT_EQ('\\0', s.Peek());\n//\n//  fclose(fp);\n//}\n\nTEST_F(FileStreamTest, FileReadStream) {\n    FILE *fp = fopen(filename_, \"rb\");\n    ASSERT_TRUE(fp != 0);\n    char buffer[65536];\n    FileReadStream s(fp, buffer, sizeof(buffer));\n\n    for (size_t i = 0; i < length_; i++) {\n        EXPECT_EQ(json_[i], s.Peek());\n        EXPECT_EQ(json_[i], s.Peek());  // 2nd time should be the same\n        EXPECT_EQ(json_[i], s.Take());\n    }\n\n    EXPECT_EQ(length_, s.Tell());\n    EXPECT_EQ('\\0', s.Peek());\n\n    fclose(fp);\n}\n\nTEST_F(FileStreamTest, FileWriteStream) {\n    char filename[L_tmpnam];\n    FILE* fp = TempFile(filename);\n\n    char buffer[65536];\n    FileWriteStream os(fp, buffer, sizeof(buffer));\n    for (size_t i = 0; i < length_; i++)\n        os.Put(json_[i]);\n    os.Flush();\n    fclose(fp);\n\n    // Read it back to verify\n    fp = fopen(filename, \"rb\");\n    FileReadStream is(fp, buffer, sizeof(buffer));\n\n    for (size_t i = 0; i < length_; i++)\n        EXPECT_EQ(json_[i], is.Take());\n\n    EXPECT_EQ(length_, is.Tell());\n    fclose(fp);\n\n    //std::cout << filename << std::endl;\n    remove(filename);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/unittest/jsoncheckertest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"unittest.h\"\n\n#include \"rapidjson/document.h\"\n\nusing namespace rapidjson;\n\nstatic char* ReadFile(const char* filename, size_t& length) {\n    FILE *fp = fopen(filename, \"rb\");\n    if (!fp)\n        fp = fopen(filename, \"rb\");\n    if (!fp)\n        return 0;\n\n    fseek(fp, 0, SEEK_END);\n    length = (size_t)ftell(fp);\n    fseek(fp, 0, SEEK_SET);\n    char* json = (char*)malloc(length + 1);\n    size_t readLength = fread(json, 1, length, fp);\n    json[readLength] = '\\0';\n    fclose(fp);\n    return json;\n}\n\nTEST(JsonChecker, Reader) {\n    char filename[256];\n\n    // jsonchecker/failXX.json\n    for (int i = 1; i <= 33; i++) {\n        if (i == 1) // fail1.json is valid in rapidjson, which has no limitation on type of root element (RFC 7159).\n            continue;\n        if (i == 18)    // fail18.json is valid in rapidjson, which has no limitation on depth of nesting.\n            continue;\n\n        sprintf(filename, \"jsonchecker/fail%d.json\", i);\n        size_t length;\n        char* json = ReadFile(filename, length);\n        if (!json) {\n            sprintf(filename, \"../../bin/jsonchecker/fail%d.json\", i);\n            json = ReadFile(filename, length);\n            if (!json) {\n                printf(\"jsonchecker file %s not found\", filename);\n                ADD_FAILURE();\n                continue;\n            }\n        }\n\n        GenericDocument<UTF8<>, CrtAllocator> document; // Use Crt allocator to check exception-safety (no memory leak)\n        document.Parse((const char*)json);\n        EXPECT_TRUE(document.HasParseError());\n\n        document.Parse<kParseIterativeFlag>((const char*)json);\n        EXPECT_TRUE(document.HasParseError());\n\n        free(json);\n    }\n\n    // passX.json\n    for (int i = 1; i <= 3; i++) {\n        sprintf(filename, \"jsonchecker/pass%d.json\", i);\n        size_t length;\n        char* json = ReadFile(filename, length);\n        if (!json) {\n            sprintf(filename, \"../../bin/jsonchecker/pass%d.json\", i);\n            json = ReadFile(filename, length);\n            if (!json) {\n                printf(\"jsonchecker file %s not found\", filename);\n                continue;\n            }\n        }\n\n        GenericDocument<UTF8<>, CrtAllocator> document; // Use Crt allocator to check exception-safety (no memory leak)\n        document.Parse((const char*)json);\n        EXPECT_FALSE(document.HasParseError());\n\n        document.Parse<kParseIterativeFlag>((const char*)json);\n        EXPECT_FALSE(document.HasParseError());\n\n        free(json);\n    }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/unittest/readertest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"unittest.h\"\n\n#include \"rapidjson/reader.h\"\n\nusing namespace rapidjson;\n\n#ifdef __GNUC__\nRAPIDJSON_DIAG_PUSH\nRAPIDJSON_DIAG_OFF(effc++)\n#endif\n\ntemplate<bool expect>\nstruct ParseBoolHandler : BaseReaderHandler<UTF8<>, ParseBoolHandler<expect> > {\n    ParseBoolHandler() : step_(0) {}\n    bool Default() { ADD_FAILURE(); return false; }\n    // gcc 4.8.x generates warning in EXPECT_EQ(bool, bool) on this gtest version.\n    // Workaround with EXPECT_TRUE().\n    bool Bool(bool b) { /*EXPECT_EQ(expect, b); */EXPECT_TRUE(expect == b);  ++step_; return true; }\n\n    unsigned step_;\n};\n\nTEST(Reader, ParseTrue) {\n    StringStream s(\"true\");\n    ParseBoolHandler<true> h;\n    Reader reader;\n    reader.Parse(s, h);\n    EXPECT_EQ(1u, h.step_);\n}\n\nTEST(Reader, ParseFalse) {\n    StringStream s(\"false\");\n    ParseBoolHandler<false> h;\n    Reader reader;\n    reader.Parse(s, h);\n    EXPECT_EQ(1u, h.step_);\n}\n\nstruct ParseIntHandler : BaseReaderHandler<UTF8<>, ParseIntHandler> {\n    ParseIntHandler() : step_(0), actual_() {}\n    bool Default() { ADD_FAILURE(); return false; }\n    bool Int(int i) { actual_ = i; step_++; return true; }\n\n    unsigned step_;\n    int actual_;\n};\n\nstruct ParseUintHandler : BaseReaderHandler<UTF8<>, ParseUintHandler> {\n    ParseUintHandler() : step_(0), actual_() {}\n    bool Default() { ADD_FAILURE(); return false; }\n    bool Uint(unsigned i) { actual_ = i; step_++; return true; }\n\n    unsigned step_;\n    unsigned actual_;\n};\n\nstruct ParseInt64Handler : BaseReaderHandler<UTF8<>, ParseInt64Handler> {\n    ParseInt64Handler() : step_(0), actual_() {}\n    bool Default() { ADD_FAILURE(); return false; }\n    bool Int64(int64_t i) { actual_ = i; step_++; return true; }\n\n    unsigned step_;\n    int64_t actual_;\n};\n\nstruct ParseUint64Handler : BaseReaderHandler<UTF8<>, ParseUint64Handler> {\n    ParseUint64Handler() : step_(0), actual_() {}\n    bool Default() { ADD_FAILURE(); return false; }\n    bool Uint64(uint64_t i) { actual_ = i; step_++; return true; }\n\n    unsigned step_;\n    uint64_t actual_;\n};\n\nstruct ParseDoubleHandler : BaseReaderHandler<UTF8<>, ParseDoubleHandler> {\n    ParseDoubleHandler() : step_(0), actual_() {}\n    bool Default() { ADD_FAILURE(); return false; }\n    bool Double(double d) { actual_ = d; step_++; return true; }\n\n    unsigned step_;\n    double actual_;\n};\n\nTEST(Reader, ParseNumberHandler) {\n#define TEST_NUMBER(Handler, str, x) \\\n    { \\\n        StringStream s(str); \\\n        Handler h; \\\n        Reader reader; \\\n        reader.Parse(s, h); \\\n        EXPECT_EQ(1u, h.step_); \\\n        EXPECT_EQ(double(x), h.actual_); \\\n    }\n\n#define TEST_DOUBLE(str, x) \\\n    { \\\n        StringStream s(str); \\\n        ParseDoubleHandler h; \\\n        Reader reader; \\\n        reader.Parse(s, h); \\\n        EXPECT_EQ(1u, h.step_); \\\n        EXPECT_DOUBLE_EQ(x, h.actual_); \\\n    }\n\n    TEST_NUMBER(ParseUintHandler, \"0\", 0);\n    TEST_NUMBER(ParseUintHandler, \"123\", 123);\n    TEST_NUMBER(ParseUintHandler, \"2147483648\", 2147483648u);       // 2^31 - 1 (cannot be stored in int)\n    TEST_NUMBER(ParseUintHandler, \"4294967295\", 4294967295u);\n\n    TEST_NUMBER(ParseIntHandler, \"-123\", -123);\n    TEST_NUMBER(ParseIntHandler, \"-2147483648\", -2147483648LL);     // -2^31 (min of int)\n\n    TEST_NUMBER(ParseUint64Handler, \"4294967296\", 4294967296ULL);   // 2^32 (max of unsigned + 1, force to use uint64_t)\n    TEST_NUMBER(ParseUint64Handler, \"18446744073709551615\", 18446744073709551615ULL);   // 2^64 - 1 (max of uint64_t)\n\n    TEST_NUMBER(ParseInt64Handler, \"-2147483649\", -2147483649LL);   // -2^31 -1 (min of int - 1, force to use int64_t)\n    TEST_NUMBER(ParseInt64Handler, \"-9223372036854775808\", (-9223372036854775807LL - 1));       // -2^63 (min of int64_t)\n\n    TEST_DOUBLE(\"0.0\", 0.0);\n    TEST_DOUBLE(\"1.0\", 1.0);\n    TEST_DOUBLE(\"-1.0\", -1.0);\n    TEST_DOUBLE(\"1.5\", 1.5);\n    TEST_DOUBLE(\"-1.5\", -1.5);\n    TEST_DOUBLE(\"3.1416\", 3.1416);\n    TEST_DOUBLE(\"1E10\", 1E10);\n    TEST_DOUBLE(\"1e10\", 1e10);\n    TEST_DOUBLE(\"1E+10\", 1E+10);\n    TEST_DOUBLE(\"1E-10\", 1E-10);\n    TEST_DOUBLE(\"-1E10\", -1E10);\n    TEST_DOUBLE(\"-1e10\", -1e10);\n    TEST_DOUBLE(\"-1E+10\", -1E+10);\n    TEST_DOUBLE(\"-1E-10\", -1E-10);\n    TEST_DOUBLE(\"1.234E+10\", 1.234E+10);\n    TEST_DOUBLE(\"1.234E-10\", 1.234E-10);\n    TEST_DOUBLE(\"1.79769e+308\", 1.79769e+308);\n    TEST_DOUBLE(\"2.22507e-308\", 2.22507e-308);\n    TEST_DOUBLE(\"-1.79769e+308\", -1.79769e+308);\n    TEST_DOUBLE(\"-2.22507e-308\", -2.22507e-308);\n    TEST_DOUBLE(\"4.9406564584124654e-324\", 4.9406564584124654e-324); // minimum denormal\n    TEST_DOUBLE(\"1e-10000\", 0.0);                                   // must underflow\n    TEST_DOUBLE(\"18446744073709551616\", 18446744073709551616.0);    // 2^64 (max of uint64_t + 1, force to use double)\n    TEST_DOUBLE(\"-9223372036854775809\", -9223372036854775809.0);    // -2^63 - 1(min of int64_t + 1, force to use double)\n\n    {\n        char n1e308[310];   // '1' followed by 308 '0'\n        n1e308[0] = '1';\n        for (int i = 1; i < 309; i++)\n            n1e308[i] = '0';\n        n1e308[309] = '\\0';\n        TEST_DOUBLE(n1e308, 1E308);\n    }\n#undef TEST_NUMBER\n#undef TEST_DOUBLE\n}\n\nTEST(Reader, ParseNumber_Error) {\n#define TEST_NUMBER_ERROR(errorCode, str) \\\n    { \\\n        char buffer[1001]; \\\n        sprintf(buffer, \"%s\", str); \\\n        InsituStringStream s(buffer); \\\n        BaseReaderHandler<> h; \\\n        Reader reader; \\\n        EXPECT_FALSE(reader.Parse(s, h)); \\\n        EXPECT_EQ(errorCode, reader.GetParseErrorCode());\\\n    }\n\n    // Number too big to be stored in double.\n    {\n        char n1e309[311];   // '1' followed by 309 '0'\n        n1e309[0] = '1';\n        for (int i = 1; i < 310; i++)\n            n1e309[i] = '0';\n        n1e309[310] = '\\0';\n        TEST_NUMBER_ERROR(kParseErrorNumberTooBig, n1e309);\n    }\n    TEST_NUMBER_ERROR(kParseErrorNumberTooBig, \"1e309\");\n\n    // Miss fraction part in number.\n    TEST_NUMBER_ERROR(kParseErrorNumberMissFraction, \"1.\");\n    TEST_NUMBER_ERROR(kParseErrorNumberMissFraction, \"1.a\");\n\n    // Miss exponent in number.\n    TEST_NUMBER_ERROR(kParseErrorNumberMissExponent, \"1e\");\n    TEST_NUMBER_ERROR(kParseErrorNumberMissExponent, \"1e_\");\n\n#undef TEST_NUMBER_ERROR\n}\n\ntemplate <typename Encoding>\nstruct ParseStringHandler : BaseReaderHandler<Encoding, ParseStringHandler<Encoding> > {\n    ParseStringHandler() : str_(0), length_(0), copy_() {}\n    ~ParseStringHandler() { EXPECT_TRUE(str_ != 0); if (copy_) free(const_cast<typename Encoding::Ch*>(str_)); }\n    \n    ParseStringHandler(const ParseStringHandler&);\n    ParseStringHandler& operator=(const ParseStringHandler&);\n\n    bool Default() { ADD_FAILURE(); return false; }\n    bool String(const typename Encoding::Ch* str, size_t length, bool copy) { \n        EXPECT_EQ(0, str_);\n        if (copy) {\n            str_ = (typename Encoding::Ch*)malloc((length + 1) * sizeof(typename Encoding::Ch));\n            memcpy(const_cast<typename Encoding::Ch*>(str_), str, (length + 1) * sizeof(typename Encoding::Ch));\n        }\n        else\n            str_ = str;\n        length_ = length; \n        copy_ = copy;\n        return true;\n    }\n\n    const typename Encoding::Ch* str_;\n    size_t length_;\n    bool copy_;\n};\n\nTEST(Reader, ParseString) {\n#define TEST_STRING(Encoding, e, x) \\\n    { \\\n        Encoding::Ch* buffer = StrDup(x); \\\n        GenericInsituStringStream<Encoding> is(buffer); \\\n        ParseStringHandler<Encoding> h; \\\n        GenericReader<Encoding, Encoding> reader; \\\n        reader.Parse<kParseInsituFlag | kParseValidateEncodingFlag>(is, h); \\\n        EXPECT_EQ(0, StrCmp<Encoding::Ch>(e, h.str_)); \\\n        EXPECT_EQ(StrLen(e), h.length_); \\\n        free(buffer); \\\n        GenericStringStream<Encoding> s(x); \\\n        ParseStringHandler<Encoding> h2; \\\n        GenericReader<Encoding, Encoding> reader2; \\\n        reader2.Parse(s, h2); \\\n        EXPECT_EQ(0, StrCmp<Encoding::Ch>(e, h2.str_)); \\\n        EXPECT_EQ(StrLen(e), h2.length_); \\\n    }\n\n    // String constant L\"\\xXX\" can only specify character code in bytes, which is not endianness-neutral. \n    // And old compiler does not support u\"\" and U\"\" string literal. So here specify string literal by array of Ch.\n    // In addition, GCC 4.8 generates -Wnarrowing warnings when character code >= 128 are assigned to signed integer types.\n    // Therefore, utype is added for declaring unsigned array, and then cast it to Encoding::Ch.\n#define ARRAY(...) { __VA_ARGS__ }\n#define TEST_STRINGARRAY(Encoding, utype, array, x) \\\n    { \\\n        static const utype ue[] = array; \\\n        static const Encoding::Ch* e = reinterpret_cast<const Encoding::Ch *>(&ue[0]); \\\n        TEST_STRING(Encoding, e, x); \\\n    }\n\n#define TEST_STRINGARRAY2(Encoding, utype, earray, xarray) \\\n    { \\\n        static const utype ue[] = earray; \\\n        static const utype xe[] = xarray; \\\n        static const Encoding::Ch* e = reinterpret_cast<const Encoding::Ch *>(&ue[0]); \\\n        static const Encoding::Ch* x = reinterpret_cast<const Encoding::Ch *>(&xe[0]); \\\n        TEST_STRING(Encoding, e, x); \\\n    }\n\n    TEST_STRING(UTF8<>, \"\", \"\\\"\\\"\");\n    TEST_STRING(UTF8<>, \"Hello\", \"\\\"Hello\\\"\");\n    TEST_STRING(UTF8<>, \"Hello\\nWorld\", \"\\\"Hello\\\\nWorld\\\"\");\n    TEST_STRING(UTF8<>, \"\\\"\\\\/\\b\\f\\n\\r\\t\", \"\\\"\\\\\\\"\\\\\\\\/\\\\b\\\\f\\\\n\\\\r\\\\t\\\"\");\n    TEST_STRING(UTF8<>, \"\\x24\", \"\\\"\\\\u0024\\\"\");         // Dollar sign U+0024\n    TEST_STRING(UTF8<>, \"\\xC2\\xA2\", \"\\\"\\\\u00A2\\\"\");     // Cents sign U+00A2\n    TEST_STRING(UTF8<>, \"\\xE2\\x82\\xAC\", \"\\\"\\\\u20AC\\\"\"); // Euro sign U+20AC\n    TEST_STRING(UTF8<>, \"\\xF0\\x9D\\x84\\x9E\", \"\\\"\\\\uD834\\\\uDD1E\\\"\");  // G clef sign U+1D11E\n\n    // UTF16\n    TEST_STRING(UTF16<>, L\"\", L\"\\\"\\\"\");\n    TEST_STRING(UTF16<>, L\"Hello\", L\"\\\"Hello\\\"\");\n    TEST_STRING(UTF16<>, L\"Hello\\nWorld\", L\"\\\"Hello\\\\nWorld\\\"\");\n    TEST_STRING(UTF16<>, L\"\\\"\\\\/\\b\\f\\n\\r\\t\", L\"\\\"\\\\\\\"\\\\\\\\/\\\\b\\\\f\\\\n\\\\r\\\\t\\\"\");\n    TEST_STRINGARRAY(UTF16<>, wchar_t, ARRAY(0x0024, 0x0000), L\"\\\"\\\\u0024\\\"\");\n    TEST_STRINGARRAY(UTF16<>, wchar_t, ARRAY(0x00A2, 0x0000), L\"\\\"\\\\u00A2\\\"\");  // Cents sign U+00A2\n    TEST_STRINGARRAY(UTF16<>, wchar_t, ARRAY(0x20AC, 0x0000), L\"\\\"\\\\u20AC\\\"\");  // Euro sign U+20AC\n    TEST_STRINGARRAY(UTF16<>, wchar_t, ARRAY(0xD834, 0xDD1E, 0x0000), L\"\\\"\\\\uD834\\\\uDD1E\\\"\");   // G clef sign U+1D11E\n\n    // UTF32\n    TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY('\\0'), ARRAY('\\\"', '\\\"', '\\0'));\n    TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY('H', 'e', 'l', 'l', 'o', '\\0'), ARRAY('\\\"', 'H', 'e', 'l', 'l', 'o', '\\\"', '\\0'));\n    TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY('H', 'e', 'l', 'l', 'o', '\\n', 'W', 'o', 'r', 'l', 'd', '\\0'), ARRAY('\\\"', 'H', 'e', 'l', 'l', 'o', '\\\\', 'n', 'W', 'o', 'r', 'l', 'd', '\\\"', '\\0'));\n    TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY('\\\"', '\\\\', '/', '\\b', '\\f', '\\n', '\\r', '\\t', '\\0'), ARRAY('\\\"', '\\\\', '\\\"', '\\\\', '\\\\', '/', '\\\\', 'b', '\\\\', 'f', '\\\\', 'n', '\\\\', 'r', '\\\\', 't', '\\\"', '\\0'));\n    TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY(0x00024, 0x0000), ARRAY('\\\"', '\\\\', 'u', '0', '0', '2', '4', '\\\"', '\\0'));\n    TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY(0x000A2, 0x0000), ARRAY('\\\"', '\\\\', 'u', '0', '0', 'A', '2', '\\\"', '\\0'));   // Cents sign U+00A2\n    TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY(0x020AC, 0x0000), ARRAY('\\\"', '\\\\', 'u', '2', '0', 'A', 'C', '\\\"', '\\0'));   // Euro sign U+20AC\n    TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY(0x1D11E, 0x0000), ARRAY('\\\"', '\\\\', 'u', 'D', '8', '3', '4', '\\\\', 'u', 'D', 'D', '1', 'E', '\\\"', '\\0'));    // G clef sign U+1D11E\n\n#undef TEST_STRINGARRAY\n#undef ARRAY\n#undef TEST_STRING\n\n    // Support of null character in string\n    {\n        StringStream s(\"\\\"Hello\\\\u0000World\\\"\");\n        const char e[] = \"Hello\\0World\";\n        ParseStringHandler<UTF8<> > h;\n        Reader reader;\n        reader.Parse(s, h);\n        EXPECT_EQ(0, memcmp(e, h.str_, h.length_ + 1));\n        EXPECT_EQ(11u, h.length_);\n    }\n}\n\nTEST(Reader, ParseString_Transcoding) {\n    const char* x = \"\\\"Hello\\\"\";\n    const wchar_t* e = L\"Hello\";\n    GenericStringStream<UTF8<> > is(x);\n    GenericReader<UTF8<>, UTF16<> > reader;\n    ParseStringHandler<UTF16<> > h;\n    reader.Parse(is, h);\n    EXPECT_EQ(0, StrCmp<UTF16<>::Ch>(e, h.str_));\n    EXPECT_EQ(StrLen(e), h.length_);\n}\n\nTEST(Reader, ParseString_NonDestructive) {\n    StringStream s(\"\\\"Hello\\\\nWorld\\\"\");\n    ParseStringHandler<UTF8<> > h;\n    Reader reader;\n    reader.Parse(s, h);\n    EXPECT_EQ(0, StrCmp(\"Hello\\nWorld\", h.str_));\n    EXPECT_EQ(11u, h.length_);\n}\n\nParseErrorCode TestString(const char* str) {\n    StringStream s(str);\n    BaseReaderHandler<> h;\n    Reader reader;\n    reader.Parse<kParseValidateEncodingFlag>(s, h);\n    return reader.GetParseErrorCode();\n}\n\nTEST(Reader, ParseString_Error) {\n#define TEST_STRING_ERROR(errorCode, str)\\\n        EXPECT_EQ(errorCode, TestString(str))\n\n#define ARRAY(...) { __VA_ARGS__ }\n#define TEST_STRINGENCODING_ERROR(Encoding, utype, array) \\\n    { \\\n        static const utype ue[] = array; \\\n        static const Encoding::Ch* e = reinterpret_cast<const Encoding::Ch *>(&ue[0]); \\\n        EXPECT_EQ(kParseErrorStringInvalidEncoding, TestString(e));\\\n    }\n\n    // Invalid escape character in string.\n    TEST_STRING_ERROR(kParseErrorStringEscapeInvalid, \"[\\\"\\\\a\\\"]\");\n\n    // Incorrect hex digit after \\\\u escape in string.\n    TEST_STRING_ERROR(kParseErrorStringUnicodeEscapeInvalidHex, \"[\\\"\\\\uABCG\\\"]\");\n\n    // The surrogate pair in string is invalid.\n    TEST_STRING_ERROR(kParseErrorStringUnicodeSurrogateInvalid, \"[\\\"\\\\uD800X\\\"]\");\n    TEST_STRING_ERROR(kParseErrorStringUnicodeSurrogateInvalid, \"[\\\"\\\\uD800\\\\uFFFF\\\"]\");\n\n    // Missing a closing quotation mark in string.\n    TEST_STRING_ERROR(kParseErrorStringMissQuotationMark, \"[\\\"Test]\");\n\n    // http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt\n\n    // 3  Malformed sequences \n\n    // 3.1 Unexpected continuation bytes\n    {\n         char e[] = { '[', '\\\"', 0, '\\\"', ']', '\\0' };\n         for (unsigned char c = 0x80u; c <= 0xBFu; c++) {\n            e[2] = c;\n            ParseErrorCode error = TestString(e);\n            EXPECT_EQ(kParseErrorStringInvalidEncoding, error);\n            if (error != kParseErrorStringInvalidEncoding)\n                std::cout << (unsigned)(unsigned char)c << std::endl;\n         }\n    }\n\n    // 3.2 Lonely start characters, 3.5 Impossible bytes\n    {\n        char e[] = { '[', '\\\"', 0, ' ', '\\\"', ']', '\\0' };\n        for (unsigned c = 0xC0u; c <= 0xFFu; c++) {\n            e[2] = (char)c;\n            TEST_STRING_ERROR(kParseErrorStringInvalidEncoding, e);\n        }\n    }\n\n    // 4  Overlong sequences \n\n    // 4.1  Examples of an overlong ASCII character\n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xC0u, 0xAFu, '\\\"', ']', '\\0'));\n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xE0u, 0x80u, 0xAFu, '\\\"', ']', '\\0'));\n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xF0u, 0x80u, 0x80u, 0xAFu, '\\\"', ']', '\\0'));\n\n    // 4.2  Maximum overlong sequences \n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xC1u, 0xBFu, '\\\"', ']', '\\0'));\n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xE0u, 0x9Fu, 0xBFu, '\\\"', ']', '\\0'));\n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xF0u, 0x8Fu, 0xBFu, 0xBFu, '\\\"', ']', '\\0'));\n\n    // 4.3  Overlong representation of the NUL character \n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xC0u, 0x80u, '\\\"', ']', '\\0'));\n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xE0u, 0x80u, 0x80u, '\\\"', ']', '\\0'));\n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xF0u, 0x80u, 0x80u, 0x80u, '\\\"', ']', '\\0'));\n\n    // 5  Illegal code positions\n\n    // 5.1 Single UTF-16 surrogates\n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xEDu, 0xA0u, 0x80u, '\\\"', ']', '\\0'));\n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xEDu, 0xADu, 0xBFu, '\\\"', ']', '\\0'));\n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xEDu, 0xAEu, 0x80u, '\\\"', ']', '\\0'));\n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xEDu, 0xAFu, 0xBFu, '\\\"', ']', '\\0'));\n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xEDu, 0xB0u, 0x80u, '\\\"', ']', '\\0'));\n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xEDu, 0xBEu, 0x80u, '\\\"', ']', '\\0'));\n    TEST_STRINGENCODING_ERROR(UTF8<>, unsigned char, ARRAY('[', '\\\"', 0xEDu, 0xBFu, 0xBFu, '\\\"', ']', '\\0'));\n\n#undef ARRAY\n#undef TEST_STRINGARRAY_ERROR\n}\n\ntemplate <unsigned count>\nstruct ParseArrayHandler : BaseReaderHandler<UTF8<>, ParseArrayHandler<count> > {\n    ParseArrayHandler() : step_(0) {}\n\n    bool Default() { ADD_FAILURE(); return false; }\n    bool Uint(unsigned i) { EXPECT_EQ(step_, i); step_++; return true; }\n    bool StartArray() { EXPECT_EQ(0u, step_); step_++; return true; }\n    bool EndArray(SizeType) { step_++; return true; }\n\n    unsigned step_;\n};\n\nTEST(Reader, ParseEmptyArray) {\n    char *json = StrDup(\"[ ] \");\n    InsituStringStream s(json);\n    ParseArrayHandler<0> h;\n    Reader reader;\n    reader.Parse(s, h);\n    EXPECT_EQ(2u, h.step_);\n    free(json);\n}\n\nTEST(Reader, ParseArray) {\n    char *json = StrDup(\"[1, 2, 3, 4]\");\n    InsituStringStream s(json);\n    ParseArrayHandler<4> h;\n    Reader reader;\n    reader.Parse(s, h);\n    EXPECT_EQ(6u, h.step_);\n    free(json);\n}\n\nTEST(Reader, ParseArray_Error) {\n#define TEST_ARRAY_ERROR(errorCode, str) \\\n    { \\\n        char buffer[1001]; \\\n        strncpy(buffer, str, 1000); \\\n        InsituStringStream s(buffer); \\\n        BaseReaderHandler<> h; \\\n        GenericReader<UTF8<>, UTF8<>, CrtAllocator> reader; \\\n        EXPECT_FALSE(reader.Parse(s, h)); \\\n        EXPECT_EQ(errorCode, reader.GetParseErrorCode());\\\n    }\n\n    // Missing a comma or ']' after an array element.\n    TEST_ARRAY_ERROR(kParseErrorArrayMissCommaOrSquareBracket, \"[1\");\n    TEST_ARRAY_ERROR(kParseErrorArrayMissCommaOrSquareBracket, \"[1}\");\n    TEST_ARRAY_ERROR(kParseErrorArrayMissCommaOrSquareBracket, \"[1 2]\");\n\n#undef TEST_ARRAY_ERROR\n}\n\nstruct ParseObjectHandler : BaseReaderHandler<UTF8<>, ParseObjectHandler> {\n    ParseObjectHandler() : step_(0) {}\n\n    bool Default() { ADD_FAILURE(); return false; }\n    bool Null() { EXPECT_EQ(8u, step_); step_++; return true; }\n    bool Bool(bool b) { \n        switch(step_) {\n            case 4: EXPECT_TRUE(b); step_++; return true;\n            case 6: EXPECT_FALSE(b); step_++; return true;\n            default: ADD_FAILURE(); return false;\n        }\n    }\n    bool Int(int i) { \n        switch(step_) {\n            case 10: EXPECT_EQ(123, i); step_++; return true;\n            case 15: EXPECT_EQ(1, i); step_++; return true;\n            case 16: EXPECT_EQ(2, i); step_++; return true;\n            case 17: EXPECT_EQ(3, i); step_++; return true;\n            default: ADD_FAILURE(); return false;\n        }\n    }\n    bool Uint(unsigned i) { return Int(i); }\n    bool Double(double d) { EXPECT_EQ(12u, step_); EXPECT_EQ(3.1416, d); step_++; return true; }\n    bool String(const char* str, size_t, bool) { \n        switch(step_) {\n            case 1: EXPECT_STREQ(\"hello\", str); step_++; return true;\n            case 2: EXPECT_STREQ(\"world\", str); step_++; return true;\n            case 3: EXPECT_STREQ(\"t\", str); step_++; return true;\n            case 5: EXPECT_STREQ(\"f\", str); step_++; return true;\n            case 7: EXPECT_STREQ(\"n\", str); step_++; return true;\n            case 9: EXPECT_STREQ(\"i\", str); step_++; return true;\n            case 11: EXPECT_STREQ(\"pi\", str); step_++; return true;\n            case 13: EXPECT_STREQ(\"a\", str); step_++; return true;\n            default: ADD_FAILURE(); return false;\n        }\n    }\n    bool StartObject() { EXPECT_EQ(0u, step_); step_++; return true; }\n    bool EndObject(SizeType memberCount) { EXPECT_EQ(19u, step_); EXPECT_EQ(7u, memberCount); step_++; return true; }\n    bool StartArray() { EXPECT_EQ(14u, step_); step_++; return true; }\n    bool EndArray(SizeType elementCount) { EXPECT_EQ(18u, step_); EXPECT_EQ(3u, elementCount); step_++; return true; }\n\n    unsigned step_;\n};\n\nTEST(Reader, ParseObject) {\n    const char* json = \"{ \\\"hello\\\" : \\\"world\\\", \\\"t\\\" : true , \\\"f\\\" : false, \\\"n\\\": null, \\\"i\\\":123, \\\"pi\\\": 3.1416, \\\"a\\\":[1, 2, 3] } \";\n\n    // Insitu\n    {\n        char* json2 = StrDup(json);\n        InsituStringStream s(json2);\n        ParseObjectHandler h;\n        Reader reader;\n        reader.Parse<kParseInsituFlag>(s, h);\n        EXPECT_EQ(20u, h.step_);\n        free(json2);\n    }\n\n    // Normal\n    {\n        StringStream s(json);\n        ParseObjectHandler h;\n        Reader reader;\n        reader.Parse(s, h);\n        EXPECT_EQ(20u, h.step_);\n    }\n}\n\nstruct ParseEmptyObjectHandler : BaseReaderHandler<UTF8<>, ParseEmptyObjectHandler> {\n    ParseEmptyObjectHandler() : step_(0) {}\n\n    bool Default() { ADD_FAILURE(); return false; }\n    bool StartObject() { EXPECT_EQ(0u, step_); step_++; return true; }\n    bool EndObject(SizeType) { EXPECT_EQ(1u, step_); step_++; return true; }\n\n    unsigned step_;\n};\n\nTEST(Reader, Parse_EmptyObject) {\n    StringStream s(\"{ } \");\n    ParseEmptyObjectHandler h;\n    Reader reader;\n    reader.Parse(s, h);\n    EXPECT_EQ(2u, h.step_);\n}\n\nstruct ParseMultipleRootHandler : BaseReaderHandler<UTF8<>, ParseMultipleRootHandler> {\n    ParseMultipleRootHandler() : step_(0) {}\n\n    bool Default() { ADD_FAILURE(); return false; }\n    bool StartObject() { EXPECT_EQ(0u, step_); step_++; return true; }\n    bool EndObject(SizeType) { EXPECT_EQ(1u, step_); step_++; return true; }\n    bool StartArray() { EXPECT_EQ(2u, step_); step_++; return true; }\n    bool EndArray(SizeType) { EXPECT_EQ(3u, step_); step_++; return true; }\n\n    unsigned step_;\n};\n\ntemplate <unsigned parseFlags>\nvoid TestMultipleRoot() {\n    StringStream s(\"{}[] a\");\n    ParseMultipleRootHandler h;\n    Reader reader;\n    EXPECT_TRUE(reader.Parse<parseFlags>(s, h));\n    EXPECT_EQ(2u, h.step_);\n    EXPECT_TRUE(reader.Parse<parseFlags>(s, h));\n    EXPECT_EQ(4u, h.step_);\n    EXPECT_EQ(' ', s.Take());\n    EXPECT_EQ('a', s.Take());\n}\n\nTEST(Reader, Parse_MultipleRoot) {\n    TestMultipleRoot<kParseStopWhenDoneFlag>();\n}\n\nTEST(Reader, ParseIterative_MultipleRoot) {\n    TestMultipleRoot<kParseIterativeFlag | kParseStopWhenDoneFlag>();\n}\n\ntemplate <unsigned parseFlags>\nvoid TestInsituMultipleRoot() {\n    char* buffer = strdup(\"{}[] a\");\n    InsituStringStream s(buffer);\n    ParseMultipleRootHandler h;\n    Reader reader;\n    EXPECT_TRUE(reader.Parse<kParseInsituFlag | parseFlags>(s, h));\n    EXPECT_EQ(2u, h.step_);\n    EXPECT_TRUE(reader.Parse<kParseInsituFlag | parseFlags>(s, h));\n    EXPECT_EQ(4u, h.step_);\n    EXPECT_EQ(' ', s.Take());\n    EXPECT_EQ('a', s.Take());\n    free(buffer);\n}\n\nTEST(Reader, ParseInsitu_MultipleRoot) {\n    TestInsituMultipleRoot<kParseStopWhenDoneFlag>();\n}\n\nTEST(Reader, ParseInsituIterative_MultipleRoot) {\n    TestInsituMultipleRoot<kParseIterativeFlag | kParseStopWhenDoneFlag>();\n}\n\n#define TEST_ERROR(errorCode, str) \\\n    { \\\n        char buffer[1001]; \\\n        strncpy(buffer, str, 1000); \\\n        InsituStringStream s(buffer); \\\n        BaseReaderHandler<> h; \\\n        Reader reader; \\\n        EXPECT_FALSE(reader.Parse(s, h)); \\\n        EXPECT_EQ(errorCode, reader.GetParseErrorCode());\\\n    }\n\nTEST(Reader, ParseDocument_Error) {\n    // The document is empty.\n    TEST_ERROR(kParseErrorDocumentEmpty, \"\");\n    TEST_ERROR(kParseErrorDocumentEmpty, \" \");\n    TEST_ERROR(kParseErrorDocumentEmpty, \" \\n\");\n\n    // The document root must not follow by other values.\n    TEST_ERROR(kParseErrorDocumentRootNotSingular, \"[] 0\");\n    TEST_ERROR(kParseErrorDocumentRootNotSingular, \"{} 0\");\n    TEST_ERROR(kParseErrorDocumentRootNotSingular, \"null []\");\n    TEST_ERROR(kParseErrorDocumentRootNotSingular, \"0 {}\");\n}\n\nTEST(Reader, ParseValue_Error) {\n    // Invalid value.\n    TEST_ERROR(kParseErrorValueInvalid, \"nulL\");\n    TEST_ERROR(kParseErrorValueInvalid, \"truE\");\n    TEST_ERROR(kParseErrorValueInvalid, \"falsE\");\n    TEST_ERROR(kParseErrorValueInvalid, \"a]\");\n    TEST_ERROR(kParseErrorValueInvalid, \".1\");\n}\n\nTEST(Reader, ParseObject_Error) {\n    // Missing a name for object member.\n    TEST_ERROR(kParseErrorObjectMissName, \"{1}\");\n    TEST_ERROR(kParseErrorObjectMissName, \"{:1}\");\n    TEST_ERROR(kParseErrorObjectMissName, \"{null:1}\");\n    TEST_ERROR(kParseErrorObjectMissName, \"{true:1}\");\n    TEST_ERROR(kParseErrorObjectMissName, \"{false:1}\");\n    TEST_ERROR(kParseErrorObjectMissName, \"{1:1}\");\n    TEST_ERROR(kParseErrorObjectMissName, \"{[]:1}\");\n    TEST_ERROR(kParseErrorObjectMissName, \"{{}:1}\");\n    TEST_ERROR(kParseErrorObjectMissName, \"{xyz:1}\");\n\n    // Missing a colon after a name of object member.\n    TEST_ERROR(kParseErrorObjectMissColon, \"{\\\"a\\\" 1}\");\n    TEST_ERROR(kParseErrorObjectMissColon, \"{\\\"a\\\",1}\");\n\n    // Must be a comma or '}' after an object member\n    TEST_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, \"{\\\"a\\\":1]\");\n}\n\n#undef TEST_ERROR\n\nTEST(Reader, SkipWhitespace) {\n    StringStream ss(\" A \\t\\tB\\n \\n\\nC\\r\\r \\rD \\t\\n\\r E\");\n    const char* expected = \"ABCDE\";\n    for (size_t i = 0; i < 5; i++) {\n        SkipWhitespace(ss);\n        EXPECT_EQ(expected[i], ss.Take());\n    }\n}\n\n// Test implementing a stream without copy stream optimization.\n// Clone from GenericStringStream except that copy constructor is disabled.\ntemplate <typename Encoding>\nclass CustomStringStream {\npublic:\n    typedef typename Encoding::Ch Ch;\n\n    CustomStringStream(const Ch *src) : src_(src), head_(src) {}\n\n    Ch Peek() const { return *src_; }\n    Ch Take() { return *src_++; }\n    size_t Tell() const { return static_cast<size_t>(src_ - head_); }\n\n    Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }\n    void Put(Ch) { RAPIDJSON_ASSERT(false); }\n    void Flush() { RAPIDJSON_ASSERT(false); }\n    size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }\n\nprivate:\n    // Prohibit copy constructor & assignment operator.\n    CustomStringStream(const CustomStringStream&);\n    CustomStringStream& operator=(const CustomStringStream&);\n\n    const Ch* src_;     //!< Current read position.\n    const Ch* head_;    //!< Original head of the string.\n};\n\n// If the following code is compiled, it should generate compilation error as predicted.\n// Because CustomStringStream<> is not copyable via making copy constructor private.\n#if 0\nnamespace rapidjson {\n\ntemplate <typename Encoding>\nstruct StreamTraits<CustomStringStream<Encoding> > {\n    enum { copyOptimization = 1 };\n};\n\n} // namespace rapidjson\n#endif \n\nTEST(Reader, CustomStringStream) {\n    const char* json = \"{ \\\"hello\\\" : \\\"world\\\", \\\"t\\\" : true , \\\"f\\\" : false, \\\"n\\\": null, \\\"i\\\":123, \\\"pi\\\": 3.1416, \\\"a\\\":[1, 2, 3] } \";\n    CustomStringStream<UTF8<char> > s(json);\n    ParseObjectHandler h;\n    Reader reader;\n    reader.Parse(s, h);\n    EXPECT_EQ(20u, h.step_);\n}\n\n#include <sstream>\n\nclass IStreamWrapper {\npublic:\n    typedef char Ch;\n\n    IStreamWrapper(std::istream& is) : is_(is) {}\n\n    Ch Peek() const {\n        int c = is_.peek();\n        return c == std::char_traits<char>::eof() ? '\\0' : (Ch)c;\n    }\n\n    Ch Take() { \n        int c = is_.get();\n        return c == std::char_traits<char>::eof() ? '\\0' : (Ch)c;\n    }\n\n    size_t Tell() const { return (size_t)is_.tellg(); }\n\n    Ch* PutBegin() { assert(false); return 0; }\n    void Put(Ch) { assert(false); }\n    void Flush() { assert(false); }\n    size_t PutEnd(Ch*) { assert(false); return 0; }\n\nprivate:\n    IStreamWrapper(const IStreamWrapper&);\n    IStreamWrapper& operator=(const IStreamWrapper&);\n\n    std::istream& is_;\n};\n\nTEST(Reader, Parse_IStreamWrapper_StringStream) {\n    const char* json = \"[1,2,3,4]\";\n\n    std::stringstream ss(json);\n    IStreamWrapper is(ss);\n\n    Reader reader;\n    ParseArrayHandler<4> h;\n    reader.Parse(is, h);\n    EXPECT_FALSE(reader.HasParseError());   \n}\n\n// Test iterative parsing.\n\n#define TESTERRORHANDLING(text, errorCode, offset)\\\n{\\\n    StringStream json(text); \\\n    BaseReaderHandler<> handler; \\\n    Reader reader; \\\n    reader.Parse<kParseIterativeFlag>(json, handler); \\\n    EXPECT_TRUE(reader.HasParseError()); \\\n    EXPECT_EQ(errorCode, reader.GetParseErrorCode()); \\\n    EXPECT_EQ(offset, reader.GetErrorOffset()); \\\n}\n\nTEST(Reader, IterativeParsing_ErrorHandling) {\n    TESTERRORHANDLING(\"{\\\"a\\\": a}\", kParseErrorValueInvalid, 6u);\n\n    TESTERRORHANDLING(\"\", kParseErrorDocumentEmpty, 0u);\n    TESTERRORHANDLING(\"{}{}\", kParseErrorDocumentRootNotSingular, 2u);\n\n    TESTERRORHANDLING(\"{1}\", kParseErrorObjectMissName, 1u);\n    TESTERRORHANDLING(\"{\\\"a\\\", 1}\", kParseErrorObjectMissColon, 4u);\n    TESTERRORHANDLING(\"{\\\"a\\\"}\", kParseErrorObjectMissColon, 4u);\n    TESTERRORHANDLING(\"{\\\"a\\\": 1\", kParseErrorObjectMissCommaOrCurlyBracket, 7u);\n    TESTERRORHANDLING(\"[1 2 3]\", kParseErrorArrayMissCommaOrSquareBracket, 3u);\n}\n\ntemplate<typename Encoding = UTF8<> >\nstruct IterativeParsingReaderHandler {\n    typedef typename Encoding::Ch Ch;\n\n    const static int LOG_NULL = -1;\n    const static int LOG_BOOL = -2;\n    const static int LOG_INT = -3;\n    const static int LOG_UINT = -4;\n    const static int LOG_INT64 = -5;\n    const static int LOG_UINT64 = -6;\n    const static int LOG_DOUBLE = -7;\n    const static int LOG_STRING = -8;\n    const static int LOG_STARTOBJECT = -9;\n    const static int LOG_KEY = -10;\n    const static int LOG_ENDOBJECT = -11;\n    const static int LOG_STARTARRAY = -12;\n    const static int LOG_ENDARRAY = -13;\n\n    const static size_t LogCapacity = 256;\n    int Logs[LogCapacity];\n    size_t LogCount;\n\n    IterativeParsingReaderHandler() : LogCount(0) {\n    }\n\n    bool Null() { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_NULL; return true; }\n\n    bool Bool(bool) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_BOOL; return true; }\n\n    bool Int(int) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_INT; return true; }\n\n    bool Uint(unsigned) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_INT; return true; }\n\n    bool Int64(int64_t) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_INT64; return true; }\n\n    bool Uint64(uint64_t) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_UINT64; return true; }\n\n    bool Double(double) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_DOUBLE; return true; }\n\n    bool String(const Ch*, SizeType, bool) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STRING; return true; }\n\n    bool StartObject() { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STARTOBJECT; return true; }\n\n    bool Key (const Ch*, SizeType, bool) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_KEY; return true; }\n\t\n    bool EndObject(SizeType c) {\n        RAPIDJSON_ASSERT(LogCount < LogCapacity);\n        Logs[LogCount++] = LOG_ENDOBJECT;\n        Logs[LogCount++] = (int)c;\n        return true;\n    }\n\n    bool StartArray() { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STARTARRAY; return true; }\n\n    bool EndArray(SizeType c) {\n        RAPIDJSON_ASSERT(LogCount < LogCapacity);\n        Logs[LogCount++] = LOG_ENDARRAY;\n        Logs[LogCount++] = (int)c;\n        return true;\n    }\n};\n\nTEST(Reader, IterativeParsing_General) {\n    {\n        StringStream is(\"[1, {\\\"k\\\": [1, 2]}, null, false, true, \\\"string\\\", 1.2]\");\n        Reader reader;\n        IterativeParsingReaderHandler<> handler;\n\n        ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);\n\n        EXPECT_FALSE(r.IsError());\n        EXPECT_FALSE(reader.HasParseError());\n\n        int e[] = {\n            handler.LOG_STARTARRAY,\n            handler.LOG_INT,\n            handler.LOG_STARTOBJECT,\n            handler.LOG_KEY,\n            handler.LOG_STARTARRAY,\n            handler.LOG_INT,\n            handler.LOG_INT,\n            handler.LOG_ENDARRAY, 2,\n            handler.LOG_ENDOBJECT, 1,\n            handler.LOG_NULL,\n            handler.LOG_BOOL,\n            handler.LOG_BOOL,\n            handler.LOG_STRING,\n            handler.LOG_DOUBLE,\n            handler.LOG_ENDARRAY, 7\n        };\n\n        EXPECT_EQ(sizeof(e) / sizeof(int), handler.LogCount);\n\n        for (size_t i = 0; i < handler.LogCount; ++i) {\n            EXPECT_EQ(e[i], handler.Logs[i]) << \"i = \" << i;\n        }\n    }\n}\n\nTEST(Reader, IterativeParsing_Count) {\n    {\n        StringStream is(\"[{}, {\\\"k\\\": 1}, [1], []]\");\n        Reader reader;\n        IterativeParsingReaderHandler<> handler;\n\n        ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);\n\n        EXPECT_FALSE(r.IsError());\n        EXPECT_FALSE(reader.HasParseError());\n\n        int e[] = {\n            handler.LOG_STARTARRAY,\n            handler.LOG_STARTOBJECT,\n            handler.LOG_ENDOBJECT, 0,\n            handler.LOG_STARTOBJECT,\n            handler.LOG_KEY,\n            handler.LOG_INT,\n            handler.LOG_ENDOBJECT, 1,\n            handler.LOG_STARTARRAY,\n            handler.LOG_INT,\n            handler.LOG_ENDARRAY, 1,\n            handler.LOG_STARTARRAY,\n            handler.LOG_ENDARRAY, 0,\n            handler.LOG_ENDARRAY, 4\n        };\n\n        EXPECT_EQ(sizeof(e) / sizeof(int), handler.LogCount);\n\n        for (size_t i = 0; i < handler.LogCount; ++i) {\n            EXPECT_EQ(e[i], handler.Logs[i]) << \"i = \" << i;\n        }\n    }\n}\n\n// Test iterative parsing on kParseErrorTermination.\nstruct HandlerTerminateAtStartObject : public IterativeParsingReaderHandler<> {\n    bool StartObject() { return false; }\n};\n\nstruct HandlerTerminateAtStartArray : public IterativeParsingReaderHandler<> {\n    bool StartArray() { return false; }\n};\n\nstruct HandlerTerminateAtEndObject : public IterativeParsingReaderHandler<> {\n    bool EndObject(SizeType) { return false; }\n};\n\nstruct HandlerTerminateAtEndArray : public IterativeParsingReaderHandler<> {\n    bool EndArray(SizeType) { return false; }\n};\n\nTEST(Reader, IterativeParsing_ShortCircuit) {\n    {\n        HandlerTerminateAtStartObject handler;\n        Reader reader;\n        StringStream is(\"[1, {}]\");\n\n        ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);\n\n        EXPECT_TRUE(reader.HasParseError());\n        EXPECT_EQ(kParseErrorTermination, r.Code());\n        EXPECT_EQ(4u, r.Offset());\n    }\n\n    {\n        HandlerTerminateAtStartArray handler;\n        Reader reader;\n        StringStream is(\"{\\\"a\\\": []}\");\n\n        ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);\n\n        EXPECT_TRUE(reader.HasParseError());\n        EXPECT_EQ(kParseErrorTermination, r.Code());\n        EXPECT_EQ(6u, r.Offset());\n    }\n\n    {\n        HandlerTerminateAtEndObject handler;\n        Reader reader;\n        StringStream is(\"[1, {}]\");\n\n        ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);\n\n        EXPECT_TRUE(reader.HasParseError());\n        EXPECT_EQ(kParseErrorTermination, r.Code());\n        EXPECT_EQ(5u, r.Offset());\n    }\n\n    {\n        HandlerTerminateAtEndArray handler;\n        Reader reader;\n        StringStream is(\"{\\\"a\\\": []}\");\n\n        ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);\n\n        EXPECT_TRUE(reader.HasParseError());\n        EXPECT_EQ(kParseErrorTermination, r.Code());\n        EXPECT_EQ(7u, r.Offset());\n    }\n}\n\n#ifdef __GNUC__\nRAPIDJSON_DIAG_POP\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/unittest/unittest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"unittest.h\"\n\nint main(int argc, char **argv) {\n#if _MSC_VER\n    _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );\n    //void *testWhetherMemoryLeakDetectionWorks = malloc(1);\n#endif\n    ::testing::InitGoogleTest(&argc, argv);\n    return RUN_ALL_TESTS();\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/unittest/unittest.h",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef UNITTEST_H_\n#define UNITTEST_H_\n\n\n// gtest indirectly included inttypes.h, without __STDC_CONSTANT_MACROS.\n#ifndef __STDC_CONSTANT_MACROS\n#  define __STDC_CONSTANT_MACROS 1 // required by C++ standard\n#endif\n\n#ifdef _MSC_VER\n#define _CRTDBG_MAP_ALLOC\n#include <crtdbg.h>\n#pragma warning(disable : 4996) // 'function': was declared deprecated\n#endif\n\n#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))\n#if defined(__clang__) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))\n#pragma GCC diagnostic push\n#endif\n#pragma GCC diagnostic ignored \"-Weffc++\"\n#endif\n\n#include \"gtest/gtest.h\"\n\n#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))\n#pragma GCC diagnostic pop\n#endif\n\ntemplate <typename Ch>\ninline unsigned StrLen(const Ch* s) {\n    const Ch* p = s;\n    while (*p) p++;\n    return unsigned(p - s);\n}\n\ntemplate<typename Ch>\ninline int StrCmp(const Ch* s1, const Ch* s2) {\n    while(*s1 && (*s1 == *s2)) { s1++; s2++; }\n    return (unsigned)*s1 < (unsigned)*s2 ? -1 : (unsigned)*s1 > (unsigned)*s2;\n}\n\ntemplate <typename Ch>\ninline Ch* StrDup(const Ch* str) {\n    size_t bufferSize = sizeof(Ch) * (StrLen(str) + 1);\n    Ch* buffer = (Ch*)malloc(bufferSize);\n    memcpy(buffer, str, bufferSize);\n    return buffer;\n}\n\ninline FILE* TempFile(char *filename) {\n#if _MSC_VER\n    filename = tmpnam(filename);\n\n    // For Visual Studio, tmpnam() adds a backslash in front. Remove it.\n    if (filename[0] == '\\\\')\n        for (int i = 0; filename[i] != '\\0'; i++)\n            filename[i] = filename[i + 1];\n        \n    return fopen(filename, \"wb\");\n#else\n    strcpy(filename, \"/tmp/fileXXXXXX\");\n    int fd = mkstemp(filename);\n    return fdopen(fd, \"w\");\n#endif\n}\n\n// Use exception for catching assert\n#if _MSC_VER\n#pragma warning(disable : 4127)\n#endif\n\nclass AssertException : public std::logic_error {\npublic:\n    AssertException(const char* w) : std::logic_error(w) {}\n};\n\n#define RAPIDJSON_ASSERT(x) if (!(x)) throw AssertException(RAPIDJSON_STRINGIFY(x))\n\n#endif // UNITTEST_H_\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/unittest/valuetest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"unittest.h\"\n#include \"rapidjson/document.h\"\n#include <algorithm>\n\nusing namespace rapidjson;\n\nTEST(Value, DefaultConstructor) {\n    Value x;\n    EXPECT_EQ(kNullType, x.GetType());\n    EXPECT_TRUE(x.IsNull());\n\n    //std::cout << \"sizeof(Value): \" << sizeof(x) << std::endl;\n}\n\n// Should not pass compilation\n//TEST(Value, copy_constructor) {\n//  Value x(1234);\n//  Value y = x;\n//}\n\n#if RAPIDJSON_HAS_CXX11_RVALUE_REFS\nTEST(Value, MoveConstructor) {\n    typedef GenericValue<UTF8<>, CrtAllocator> Value;\n    Value::AllocatorType allocator;\n\n    Value x((Value(kArrayType)));\n    x.Reserve(4u, allocator);\n    x.PushBack(1, allocator).PushBack(2, allocator).PushBack(3, allocator).PushBack(4, allocator);\n    EXPECT_TRUE(x.IsArray());\n    EXPECT_EQ(4u, x.Size());\n\n    // Value y(x); // should not compile\n    Value y(std::move(x));\n    EXPECT_TRUE(x.IsNull());\n    EXPECT_TRUE(y.IsArray());\n    EXPECT_EQ(4u, y.Size());\n\n    // Value z = y; // should not compile\n    Value z = std::move(y);\n    EXPECT_TRUE(y.IsNull());\n    EXPECT_TRUE(z.IsArray());\n    EXPECT_EQ(4u, z.Size());\n}\n#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS\n\nTEST(Value, AssignmentOperator) {\n    Value x(1234);\n    Value y;\n    y = x;\n    EXPECT_TRUE(x.IsNull());    // move semantic\n    EXPECT_EQ(1234, y.GetInt());\n\n    y = 5678;\n    EXPECT_TRUE(y.IsInt());\n    EXPECT_EQ(5678, y.GetInt());\n\n    x = \"Hello\";\n    EXPECT_TRUE(x.IsString());\n    EXPECT_STREQ(x.GetString(),\"Hello\");\n\n    y = StringRef(x.GetString(),x.GetStringLength());\n    EXPECT_TRUE(y.IsString());\n    EXPECT_EQ(y.GetString(),x.GetString());\n    EXPECT_EQ(y.GetStringLength(),x.GetStringLength());\n\n    static char mstr[] = \"mutable\";\n    // y = mstr; // should not compile\n    y = StringRef(mstr);\n    EXPECT_TRUE(y.IsString());\n    EXPECT_EQ(y.GetString(),mstr);\n\n#if RAPIDJSON_HAS_CXX11_RVALUE_REFS\n    // C++11 move assignment\n    x = Value(\"World\");\n    EXPECT_TRUE(x.IsString());\n    EXPECT_STREQ(\"World\", x.GetString());\n\n    x = std::move(y);\n    EXPECT_TRUE(y.IsNull());\n    EXPECT_TRUE(x.IsString());\n    EXPECT_EQ(x.GetString(), mstr);\n\n    y = std::move(Value().SetInt(1234));\n    EXPECT_TRUE(y.IsInt());\n    EXPECT_EQ(1234, y);\n#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS\n}\n\ntemplate <typename A, typename B> \nvoid TestEqual(const A& a, const B& b) {\n    EXPECT_TRUE (a == b);\n    EXPECT_FALSE(a != b);\n    EXPECT_TRUE (b == a);\n    EXPECT_FALSE(b != a);\n}\n\ntemplate <typename A, typename B> \nvoid TestUnequal(const A& a, const B& b) {\n    EXPECT_FALSE(a == b);\n    EXPECT_TRUE (a != b);\n    EXPECT_FALSE(b == a);\n    EXPECT_TRUE (b != a);\n}\n\nTEST(Value, EqualtoOperator) {\n    Value::AllocatorType allocator;\n    Value x(kObjectType);\n    x.AddMember(\"hello\", \"world\", allocator)\n        .AddMember(\"t\", Value(true).Move(), allocator)\n        .AddMember(\"f\", Value(false).Move(), allocator)\n        .AddMember(\"n\", Value(kNullType).Move(), allocator)\n        .AddMember(\"i\", 123, allocator)\n        .AddMember(\"pi\", 3.14, allocator)\n        .AddMember(\"a\", Value(kArrayType).Move().PushBack(1, allocator).PushBack(2, allocator).PushBack(3, allocator), allocator);\n\n    // Test templated operator==() and operator!=()\n    TestEqual(x[\"hello\"], \"world\");\n    const char* cc = \"world\";\n    TestEqual(x[\"hello\"], cc);\n    char* c = strdup(\"world\");\n    TestEqual(x[\"hello\"], c);\n    free(c);\n\n    TestEqual(x[\"t\"], true);\n    TestEqual(x[\"f\"], false);\n    TestEqual(x[\"i\"], 123);\n    TestEqual(x[\"pi\"], 3.14);\n\n    // Test operator==() (including different allocators)\n    CrtAllocator crtAllocator;\n    GenericValue<UTF8<>, CrtAllocator> y;\n    GenericDocument<UTF8<>, CrtAllocator> z(&crtAllocator);\n    y.CopyFrom(x, crtAllocator);\n    z.CopyFrom(y, z.GetAllocator());\n    TestEqual(x, y);\n    TestEqual(y, z);\n    TestEqual(z, x);\n\n    // Swapping member order should be fine.\n    EXPECT_TRUE(y.RemoveMember(\"t\"));\n    TestUnequal(x, y);\n    TestUnequal(z, y);\n    EXPECT_TRUE(z.RemoveMember(\"t\"));\n    TestUnequal(x, z);\n    TestEqual(y, z);\n    y.AddMember(\"t\", true, crtAllocator);\n    z.AddMember(\"t\", true, z.GetAllocator());\n    TestEqual(x, y);\n    TestEqual(y, z);\n    TestEqual(z, x);\n\n    // Issue #129: compare Uint64\n    x.SetUint64(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFF0));\n    y.SetUint64(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF));\n    TestUnequal(x, y);\n}\n\ntemplate <typename Value>\nvoid TestCopyFrom() {\n    typename Value::AllocatorType a;\n    Value v1(1234);\n    Value v2(v1, a); // deep copy constructor\n    EXPECT_TRUE(v1.GetType() == v2.GetType());\n    EXPECT_EQ(v1.GetInt(), v2.GetInt());\n\n    v1.SetString(\"foo\");\n    v2.CopyFrom(v1, a);\n    EXPECT_TRUE(v1.GetType() == v2.GetType());\n    EXPECT_STREQ(v1.GetString(), v2.GetString());\n    EXPECT_EQ(v1.GetString(), v2.GetString()); // string NOT copied\n\n    v1.SetArray().PushBack(1234, a);\n    v2.CopyFrom(v1, a);\n    EXPECT_TRUE(v2.IsArray());\n    EXPECT_EQ(v1.Size(), v2.Size());\n\n    v1.PushBack(Value().SetString(\"foo\", a), a); // push string copy\n    EXPECT_TRUE(v1.Size() != v2.Size());\n    v2.CopyFrom(v1, a);\n    EXPECT_TRUE(v1.Size() == v2.Size());\n    EXPECT_STREQ(v1[1].GetString(), v2[1].GetString());\n    EXPECT_NE(v1[1].GetString(), v2[1].GetString()); // string got copied\n}\n\nTEST(Value, CopyFrom) {\n    TestCopyFrom<Value>();\n    TestCopyFrom<GenericValue<UTF8<>, CrtAllocator> >();\n}\n\nTEST(Value, Swap) {\n    Value v1(1234);\n    Value v2(kObjectType);\n\n    EXPECT_EQ(&v1, &v1.Swap(v2));\n    EXPECT_TRUE(v1.IsObject());\n    EXPECT_TRUE(v2.IsInt());\n    EXPECT_EQ(1234, v2.GetInt());\n}\n\nTEST(Value, Null) {\n    // Default constructor\n    Value x;\n    EXPECT_EQ(kNullType, x.GetType());\n    EXPECT_TRUE(x.IsNull());\n\n    EXPECT_FALSE(x.IsTrue());\n    EXPECT_FALSE(x.IsFalse());\n    EXPECT_FALSE(x.IsNumber());\n    EXPECT_FALSE(x.IsString());\n    EXPECT_FALSE(x.IsObject());\n    EXPECT_FALSE(x.IsArray());\n\n    // Constructor with type\n    Value y(kNullType);\n    EXPECT_TRUE(y.IsNull());\n\n    // SetNull();\n    Value z(true);\n    z.SetNull();\n    EXPECT_TRUE(z.IsNull());\n}\n\nTEST(Value, True) {\n    // Constructor with bool\n    Value x(true);\n    EXPECT_EQ(kTrueType, x.GetType());\n    EXPECT_TRUE(x.GetBool());\n    EXPECT_TRUE(x.IsBool());\n    EXPECT_TRUE(x.IsTrue());\n\n    EXPECT_FALSE(x.IsNull());\n    EXPECT_FALSE(x.IsFalse());\n    EXPECT_FALSE(x.IsNumber());\n    EXPECT_FALSE(x.IsString());\n    EXPECT_FALSE(x.IsObject());\n    EXPECT_FALSE(x.IsArray());\n\n    // Constructor with type\n    Value y(kTrueType);\n    EXPECT_TRUE(y.IsTrue());\n\n    // SetBool()\n    Value z;\n    z.SetBool(true);\n    EXPECT_TRUE(z.IsTrue());\n}\n\nTEST(Value, False) {\n    // Constructor with bool\n    Value x(false);\n    EXPECT_EQ(kFalseType, x.GetType());\n    EXPECT_TRUE(x.IsBool());\n    EXPECT_TRUE(x.IsFalse());\n\n    EXPECT_FALSE(x.IsNull());\n    EXPECT_FALSE(x.IsTrue());\n    EXPECT_FALSE(x.GetBool());\n    //EXPECT_FALSE((bool)x);\n    EXPECT_FALSE(x.IsNumber());\n    EXPECT_FALSE(x.IsString());\n    EXPECT_FALSE(x.IsObject());\n    EXPECT_FALSE(x.IsArray());\n\n    // Constructor with type\n    Value y(kFalseType);\n    EXPECT_TRUE(y.IsFalse());\n\n    // SetBool()\n    Value z;\n    z.SetBool(false);\n    EXPECT_TRUE(z.IsFalse());\n}\n\nTEST(Value, Int) {\n    // Constructor with int\n    Value x(1234);\n    EXPECT_EQ(kNumberType, x.GetType());\n    EXPECT_EQ(1234, x.GetInt());\n    EXPECT_EQ(1234u, x.GetUint());\n    EXPECT_EQ(1234, x.GetInt64());\n    EXPECT_EQ(1234u, x.GetUint64());\n    EXPECT_EQ(1234, x.GetDouble());\n    //EXPECT_EQ(1234, (int)x);\n    //EXPECT_EQ(1234, (unsigned)x);\n    //EXPECT_EQ(1234, (int64_t)x);\n    //EXPECT_EQ(1234, (uint64_t)x);\n    //EXPECT_EQ(1234, (double)x);\n    EXPECT_TRUE(x.IsNumber());\n    EXPECT_TRUE(x.IsInt());\n    EXPECT_TRUE(x.IsUint());\n    EXPECT_TRUE(x.IsInt64());\n    EXPECT_TRUE(x.IsUint64());\n\n    EXPECT_FALSE(x.IsDouble());\n    EXPECT_FALSE(x.IsNull());\n    EXPECT_FALSE(x.IsBool());\n    EXPECT_FALSE(x.IsFalse());\n    EXPECT_FALSE(x.IsTrue());\n    EXPECT_FALSE(x.IsString());\n    EXPECT_FALSE(x.IsObject());\n    EXPECT_FALSE(x.IsArray());\n\n    Value nx(-1234);\n    EXPECT_EQ(-1234, nx.GetInt());\n    EXPECT_EQ(-1234, nx.GetInt64());\n    EXPECT_TRUE(nx.IsInt());\n    EXPECT_TRUE(nx.IsInt64());\n    EXPECT_FALSE(nx.IsUint());\n    EXPECT_FALSE(nx.IsUint64());\n\n    // Constructor with type\n    Value y(kNumberType);\n    EXPECT_TRUE(y.IsNumber());\n    EXPECT_TRUE(y.IsInt());\n    EXPECT_EQ(0, y.GetInt());\n\n    // SetInt()\n    Value z;\n    z.SetInt(1234);\n    EXPECT_EQ(1234, z.GetInt());\n\n    // operator=(int)\n    z = 5678;\n    EXPECT_EQ(5678, z.GetInt());\n}\n\nTEST(Value, Uint) {\n    // Constructor with int\n    Value x(1234u);\n    EXPECT_EQ(kNumberType, x.GetType());\n    EXPECT_EQ(1234, x.GetInt());\n    EXPECT_EQ(1234u, x.GetUint());\n    EXPECT_EQ(1234, x.GetInt64());\n    EXPECT_EQ(1234u, x.GetUint64());\n    EXPECT_TRUE(x.IsNumber());\n    EXPECT_TRUE(x.IsInt());\n    EXPECT_TRUE(x.IsUint());\n    EXPECT_TRUE(x.IsInt64());\n    EXPECT_TRUE(x.IsUint64());\n    EXPECT_EQ(1234.0, x.GetDouble());   // Number can always be cast as double but !IsDouble().\n\n    EXPECT_FALSE(x.IsDouble());\n    EXPECT_FALSE(x.IsNull());\n    EXPECT_FALSE(x.IsBool());\n    EXPECT_FALSE(x.IsFalse());\n    EXPECT_FALSE(x.IsTrue());\n    EXPECT_FALSE(x.IsString());\n    EXPECT_FALSE(x.IsObject());\n    EXPECT_FALSE(x.IsArray());\n\n    // SetUint()\n    Value z;\n    z.SetUint(1234);\n    EXPECT_EQ(1234u, z.GetUint());\n\n    // operator=(unsigned)\n    z = 5678u;\n    EXPECT_EQ(5678u, z.GetUint());\n\n    z = 2147483648u;    // 2^31, cannot cast as int\n    EXPECT_EQ(2147483648u, z.GetUint());\n    EXPECT_FALSE(z.IsInt());\n    EXPECT_TRUE(z.IsInt64());   // Issue 41: Incorrect parsing of unsigned int number types\n}\n\nTEST(Value, Int64) {\n    // Constructor with int\n    Value x(int64_t(1234LL));\n    EXPECT_EQ(kNumberType, x.GetType());\n    EXPECT_EQ(1234, x.GetInt());\n    EXPECT_EQ(1234u, x.GetUint());\n    EXPECT_EQ(1234, x.GetInt64());\n    EXPECT_EQ(1234u, x.GetUint64());\n    EXPECT_TRUE(x.IsNumber());\n    EXPECT_TRUE(x.IsInt());\n    EXPECT_TRUE(x.IsUint());\n    EXPECT_TRUE(x.IsInt64());\n    EXPECT_TRUE(x.IsUint64());\n\n    EXPECT_FALSE(x.IsDouble());\n    EXPECT_FALSE(x.IsNull());\n    EXPECT_FALSE(x.IsBool());\n    EXPECT_FALSE(x.IsFalse());\n    EXPECT_FALSE(x.IsTrue());\n    EXPECT_FALSE(x.IsString());\n    EXPECT_FALSE(x.IsObject());\n    EXPECT_FALSE(x.IsArray());\n\n    Value nx(int64_t(-1234LL));\n    EXPECT_EQ(-1234, nx.GetInt());\n    EXPECT_EQ(-1234, nx.GetInt64());\n    EXPECT_TRUE(nx.IsInt());\n    EXPECT_TRUE(nx.IsInt64());\n    EXPECT_FALSE(nx.IsUint());\n    EXPECT_FALSE(nx.IsUint64());\n\n    // SetInt64()\n    Value z;\n    z.SetInt64(1234);\n    EXPECT_EQ(1234, z.GetInt64());\n\n    z.SetInt64(2147483648LL);   // 2^31, cannot cast as int\n    EXPECT_FALSE(z.IsInt());\n    EXPECT_TRUE(z.IsUint());\n\n    z.SetInt64(4294967296LL);   // 2^32, cannot cast as uint\n    EXPECT_FALSE(z.IsInt());\n    EXPECT_FALSE(z.IsUint());\n}\n\nTEST(Value, Uint64) {\n    // Constructor with int\n    Value x(uint64_t(1234LL));\n    EXPECT_EQ(kNumberType, x.GetType());\n    EXPECT_EQ(1234, x.GetInt());\n    EXPECT_EQ(1234u, x.GetUint());\n    EXPECT_EQ(1234, x.GetInt64());\n    EXPECT_EQ(1234u, x.GetUint64());\n    EXPECT_TRUE(x.IsNumber());\n    EXPECT_TRUE(x.IsInt());\n    EXPECT_TRUE(x.IsUint());\n    EXPECT_TRUE(x.IsInt64());\n    EXPECT_TRUE(x.IsUint64());\n\n    EXPECT_FALSE(x.IsDouble());\n    EXPECT_FALSE(x.IsNull());\n    EXPECT_FALSE(x.IsBool());\n    EXPECT_FALSE(x.IsFalse());\n    EXPECT_FALSE(x.IsTrue());\n    EXPECT_FALSE(x.IsString());\n    EXPECT_FALSE(x.IsObject());\n    EXPECT_FALSE(x.IsArray());\n\n    // SetUint64()\n    Value z;\n    z.SetUint64(1234);\n    EXPECT_EQ(1234u, z.GetUint64());\n\n    z.SetUint64(2147483648LL);  // 2^31, cannot cast as int\n    EXPECT_FALSE(z.IsInt());\n    EXPECT_TRUE(z.IsUint());\n    EXPECT_TRUE(z.IsInt64());\n\n    z.SetUint64(4294967296LL);  // 2^32, cannot cast as uint\n    EXPECT_FALSE(z.IsInt());\n    EXPECT_FALSE(z.IsUint());\n    EXPECT_TRUE(z.IsInt64());\n\n    z.SetUint64(9223372036854775808uLL);    // 2^63 cannot cast as int64\n    EXPECT_FALSE(z.IsInt64());\n\n    // Issue 48\n    EXPECT_EQ(9223372036854775808uLL, z.GetUint64());\n}\n\nTEST(Value, Double) {\n    // Constructor with double\n    Value x(12.34);\n    EXPECT_EQ(kNumberType, x.GetType());\n    EXPECT_EQ(12.34, x.GetDouble());\n    EXPECT_TRUE(x.IsNumber());\n    EXPECT_TRUE(x.IsDouble());\n\n    EXPECT_FALSE(x.IsInt());\n    EXPECT_FALSE(x.IsNull());\n    EXPECT_FALSE(x.IsBool());\n    EXPECT_FALSE(x.IsFalse());\n    EXPECT_FALSE(x.IsTrue());\n    EXPECT_FALSE(x.IsString());\n    EXPECT_FALSE(x.IsObject());\n    EXPECT_FALSE(x.IsArray());\n\n    // SetDouble()\n    Value z;\n    z.SetDouble(12.34);\n    EXPECT_EQ(12.34, z.GetDouble());\n\n    z = 56.78;\n    EXPECT_EQ(56.78, z.GetDouble());\n}\n\nTEST(Value, String) {\n    // Construction with const string\n    Value x(\"Hello\", 5); // literal\n    EXPECT_EQ(kStringType, x.GetType());\n    EXPECT_TRUE(x.IsString());\n    EXPECT_STREQ(\"Hello\", x.GetString());\n    EXPECT_EQ(5u, x.GetStringLength());\n\n    EXPECT_FALSE(x.IsNumber());\n    EXPECT_FALSE(x.IsNull());\n    EXPECT_FALSE(x.IsBool());\n    EXPECT_FALSE(x.IsFalse());\n    EXPECT_FALSE(x.IsTrue());\n    EXPECT_FALSE(x.IsObject());\n    EXPECT_FALSE(x.IsArray());\n\n    static const char cstr[] = \"World\"; // const array\n    Value(cstr).Swap(x);\n    EXPECT_TRUE(x.IsString());\n    EXPECT_EQ(x.GetString(), cstr);\n    EXPECT_EQ(x.GetStringLength(), sizeof(cstr)-1);\n\n    static char mstr[] = \"Howdy\"; // non-const array\n    // Value(mstr).Swap(x); // should not compile\n    Value(StringRef(mstr)).Swap(x);\n    EXPECT_TRUE(x.IsString());\n    EXPECT_EQ(x.GetString(), mstr);\n    EXPECT_EQ(x.GetStringLength(), sizeof(mstr)-1);\n    strncpy(mstr,\"Hello\", sizeof(mstr));\n    EXPECT_STREQ(x.GetString(), \"Hello\");\n\n    const char* pstr = cstr;\n    //Value(pstr).Swap(x); // should not compile\n    Value(StringRef(pstr)).Swap(x);\n    EXPECT_TRUE(x.IsString());\n    EXPECT_EQ(x.GetString(), cstr);\n    EXPECT_EQ(x.GetStringLength(), sizeof(cstr)-1);\n\n    char* mpstr = mstr;\n    Value(StringRef(mpstr,sizeof(mstr)-1)).Swap(x);\n    EXPECT_TRUE(x.IsString());\n    EXPECT_EQ(x.GetString(), mstr);\n    EXPECT_EQ(x.GetStringLength(), 5u);\n    EXPECT_STREQ(x.GetString(), \"Hello\");\n\n    // Constructor with copy string\n    MemoryPoolAllocator<> allocator;\n    Value c(x.GetString(), x.GetStringLength(), allocator);\n    EXPECT_NE(x.GetString(), c.GetString());\n    EXPECT_EQ(x.GetStringLength(), c.GetStringLength());\n    EXPECT_STREQ(x.GetString(), c.GetString());\n    //x.SetString(\"World\");\n    x.SetString(\"World\", 5);\n    EXPECT_STREQ(\"Hello\", c.GetString());\n    EXPECT_EQ(5u, c.GetStringLength());\n\n    // Constructor with type\n    Value y(kStringType);\n    EXPECT_TRUE(y.IsString());\n    EXPECT_EQ(0, y.GetString());\n    EXPECT_EQ(0u, y.GetStringLength());\n\n    // SetConsttring()\n    Value z;\n    z.SetString(\"Hello\");\n    EXPECT_TRUE(x.IsString());\n    z.SetString(\"Hello\", 5);\n    EXPECT_STREQ(\"Hello\", z.GetString());\n    EXPECT_STREQ(\"Hello\", z.GetString());\n    EXPECT_EQ(5u, z.GetStringLength());\n\n    z.SetString(\"Hello\");\n    EXPECT_TRUE(z.IsString());\n    EXPECT_STREQ(\"Hello\", z.GetString());\n\n    //z.SetString(mstr); // should not compile\n    //z.SetString(pstr); // should not compile\n    z.SetString(StringRef(mstr));\n    EXPECT_TRUE(z.IsString());\n    EXPECT_STREQ(z.GetString(), mstr);\n\n    z.SetString(cstr);\n    EXPECT_TRUE(z.IsString());\n    EXPECT_EQ(cstr, z.GetString());\n\n    z = cstr;\n    EXPECT_TRUE(z.IsString());\n    EXPECT_EQ(cstr, z.GetString());\n\n    // SetString()\n    char s[] = \"World\";\n    Value w;\n    w.SetString(s, (SizeType)strlen(s), allocator);\n    s[0] = '\\0';\n    EXPECT_STREQ(\"World\", w.GetString());\n    EXPECT_EQ(5u, w.GetStringLength());\n\n#if RAPIDJSON_HAS_STDSTRING\n    {\n        std::string str = \"Hello World\";\n        str[5] = '\\0';\n        EXPECT_STREQ(str.data(),\"Hello\"); // embedded '\\0'\n        EXPECT_EQ(str.size(), 11u);\n\n        // no copy\n        Value vs0(StringRef(str));\n        EXPECT_TRUE(vs0.IsString());\n        EXPECT_EQ(vs0.GetString(), str.data());\n        EXPECT_EQ(vs0.GetStringLength(), str.size());\n        TestEqual(vs0, str);\n\n        // do copy\n        Value vs1(str, allocator);\n        EXPECT_TRUE(vs1.IsString());\n        EXPECT_NE(vs1.GetString(), str.data());\n        EXPECT_NE(vs1.GetString(), str); // not equal due to embedded '\\0'\n        EXPECT_EQ(vs1.GetStringLength(), str.size());\n        TestEqual(vs1, str);\n\n        // SetString\n        str = \"World\";\n        vs0.SetNull().SetString(str, allocator);\n        EXPECT_TRUE(vs0.IsString());\n        EXPECT_STREQ(vs0.GetString(), str.c_str());\n        EXPECT_EQ(vs0.GetStringLength(), str.size());\n        TestEqual(str, vs0);\n        TestUnequal(str, vs1);\n\n        // vs1 = str; // should not compile\n        vs1 = StringRef(str);\n        TestEqual(str, vs1);\n        TestEqual(vs0, vs1);\n    }\n#endif // RAPIDJSON_HAS_STDSTRING\n}\n\nTEST(Value, Array) {\n    Value x(kArrayType);\n    const Value& y = x;\n    Value::AllocatorType allocator;\n\n    EXPECT_EQ(kArrayType, x.GetType());\n    EXPECT_TRUE(x.IsArray());\n    EXPECT_TRUE(x.Empty());\n    EXPECT_EQ(0u, x.Size());\n    EXPECT_TRUE(y.IsArray());\n    EXPECT_TRUE(y.Empty());\n    EXPECT_EQ(0u, y.Size());\n\n    EXPECT_FALSE(x.IsNull());\n    EXPECT_FALSE(x.IsBool());\n    EXPECT_FALSE(x.IsFalse());\n    EXPECT_FALSE(x.IsTrue());\n    EXPECT_FALSE(x.IsString());\n    EXPECT_FALSE(x.IsObject());\n\n    // PushBack()\n    Value v;\n    x.PushBack(v, allocator);\n    v.SetBool(true);\n    x.PushBack(v, allocator);\n    v.SetBool(false);\n    x.PushBack(v, allocator);\n    v.SetInt(123);\n    x.PushBack(v, allocator);\n    //x.PushBack((const char*)\"foo\", allocator); // should not compile\n    x.PushBack(\"foo\", allocator);\n\n    EXPECT_FALSE(x.Empty());\n    EXPECT_EQ(5u, x.Size());\n    EXPECT_FALSE(y.Empty());\n    EXPECT_EQ(5u, y.Size());\n    EXPECT_TRUE(x[SizeType(0)].IsNull());\n    EXPECT_TRUE(x[1u].IsTrue());\n    EXPECT_TRUE(x[2u].IsFalse());\n    EXPECT_TRUE(x[3u].IsInt());\n    EXPECT_EQ(123, x[3u].GetInt());\n    EXPECT_TRUE(y[SizeType(0)].IsNull());\n    EXPECT_TRUE(y[1u].IsTrue());\n    EXPECT_TRUE(y[2u].IsFalse());\n    EXPECT_TRUE(y[3u].IsInt());\n    EXPECT_EQ(123, y[3u].GetInt());\n    EXPECT_TRUE(y[4u].IsString());\n    EXPECT_STREQ(\"foo\", y[4u].GetString());\n\n#if RAPIDJSON_HAS_CXX11_RVALUE_REFS\n    // PushBack(GenericValue&&, Allocator&);\n    {\n        Value y(kArrayType);\n        y.PushBack(Value(true), allocator);\n        y.PushBack(std::move(Value(kArrayType).PushBack(Value(1), allocator).PushBack(\"foo\", allocator)), allocator);\n        EXPECT_EQ(2u, y.Size());\n        EXPECT_TRUE(y[0u].IsTrue());\n        EXPECT_TRUE(y[1u].IsArray());\n        EXPECT_EQ(2u, y[1u].Size());\n        EXPECT_TRUE(y[1u][0u].IsInt());\n        EXPECT_TRUE(y[1u][1u].IsString());\n    }\n#endif\n\n    // iterator\n    Value::ValueIterator itr = x.Begin();\n    EXPECT_TRUE(itr != x.End());\n    EXPECT_TRUE(itr->IsNull());\n    ++itr;\n    EXPECT_TRUE(itr != x.End());\n    EXPECT_TRUE(itr->IsTrue());\n    ++itr;\n    EXPECT_TRUE(itr != x.End());\n    EXPECT_TRUE(itr->IsFalse());\n    ++itr;\n    EXPECT_TRUE(itr != x.End());\n    EXPECT_TRUE(itr->IsInt());\n    EXPECT_EQ(123, itr->GetInt());\n    ++itr;\n    EXPECT_TRUE(itr != x.End());\n    EXPECT_TRUE(itr->IsString());\n    EXPECT_STREQ(\"foo\", itr->GetString());\n\n    // const iterator\n    Value::ConstValueIterator citr = y.Begin();\n    EXPECT_TRUE(citr != y.End());\n    EXPECT_TRUE(citr->IsNull());\n    ++citr;\n    EXPECT_TRUE(citr != y.End());\n    EXPECT_TRUE(citr->IsTrue());\n    ++citr;\n    EXPECT_TRUE(citr != y.End());\n    EXPECT_TRUE(citr->IsFalse());\n    ++citr;\n    EXPECT_TRUE(citr != y.End());\n    EXPECT_TRUE(citr->IsInt());\n    EXPECT_EQ(123, citr->GetInt());\n    ++citr;\n    EXPECT_TRUE(citr != y.End());\n    EXPECT_TRUE(citr->IsString());\n    EXPECT_STREQ(\"foo\", citr->GetString());\n\n    // PopBack()\n    x.PopBack();\n    EXPECT_EQ(4u, x.Size());\n    EXPECT_TRUE(y[SizeType(0)].IsNull());\n    EXPECT_TRUE(y[1u].IsTrue());\n    EXPECT_TRUE(y[2u].IsFalse());\n    EXPECT_TRUE(y[3u].IsInt());\n\n    // Clear()\n    x.Clear();\n    EXPECT_TRUE(x.Empty());\n    EXPECT_EQ(0u, x.Size());\n    EXPECT_TRUE(y.Empty());\n    EXPECT_EQ(0u, y.Size());\n\n    // Erase(ValueIterator)\n\n    // Use array of array to ensure removed elements' destructor is called.\n    // [[0],[1],[2],...]\n    for (int i = 0; i < 10; i++)\n        x.PushBack(Value(kArrayType).PushBack(i, allocator).Move(), allocator);\n\n    // Erase the first\n    itr = x.Erase(x.Begin());\n    EXPECT_EQ(x.Begin(), itr);\n    EXPECT_EQ(9u, x.Size());\n    for (int i = 0; i < 9; i++)\n        EXPECT_EQ(i + 1, x[i][0u].GetInt());\n\n    // Ease the last\n    itr = x.Erase(x.End() - 1);\n    EXPECT_EQ(x.End(), itr);\n    EXPECT_EQ(8u, x.Size());\n    for (int i = 0; i < 8; i++)\n        EXPECT_EQ(i + 1, x[i][0u].GetInt());\n\n    // Erase the middle\n    itr = x.Erase(x.Begin() + 4);\n    EXPECT_EQ(x.Begin() + 4, itr);\n    EXPECT_EQ(7u, x.Size());\n    for (int i = 0; i < 4; i++)\n        EXPECT_EQ(i + 1, x[i][0u].GetInt());\n    for (int i = 4; i < 7; i++)\n        EXPECT_EQ(i + 2, x[i][0u].GetInt());\n\n    // Erase(ValueIterator, ValueIterator)\n    // Exhaustive test with all 0 <= first < n, first <= last <= n cases\n    const unsigned n = 10;\n    for (unsigned first = 0; first < n; first++) {\n        for (unsigned last = first; last <= n; last++) {\n            x.Clear();\n            for (unsigned i = 0; i < n; i++)\n                x.PushBack(Value(kArrayType).PushBack(i, allocator).Move(), allocator);\n            \n            itr = x.Erase(x.Begin() + first, x.Begin() + last);\n            if (last == n)\n                EXPECT_EQ(x.End(), itr);\n            else\n                EXPECT_EQ(x.Begin() + first, itr);\n\n            size_t removeCount = last - first;\n            EXPECT_EQ(n - removeCount, x.Size());\n            for (unsigned i = 0; i < first; i++)\n                EXPECT_EQ(i, x[i][0u].GetUint());\n            for (unsigned i = first; i < n - removeCount; i++)\n                EXPECT_EQ(i + removeCount, x[i][0u].GetUint());\n        }\n    }\n\n    // Working in gcc without C++11, but VS2013 cannot compile. To be diagnosed.\n    // http://en.wikipedia.org/wiki/Erase-remove_idiom\n    x.Clear();\n    for (int i = 0; i < 10; i++)\n        if (i % 2 == 0)\n            x.PushBack(i, allocator);\n        else\n            x.PushBack(Value(kNullType).Move(), allocator);\n\n    const Value null(kNullType);\n    x.Erase(std::remove(x.Begin(), x.End(), null), x.End());\n    EXPECT_EQ(5u, x.Size());\n    for (int i = 0; i < 5; i++)\n        EXPECT_EQ(i * 2, x[i]);\n\n    // SetArray()\n    Value z;\n    z.SetArray();\n    EXPECT_TRUE(z.IsArray());\n    EXPECT_TRUE(z.Empty());\n}\n\nTEST(Value, Object) {\n    Value x(kObjectType);\n    const Value& y = x; // const version\n    Value::AllocatorType allocator;\n\n    EXPECT_EQ(kObjectType, x.GetType());\n    EXPECT_TRUE(x.IsObject());\n    EXPECT_TRUE(x.ObjectEmpty());\n    EXPECT_EQ(0u, x.MemberCount());\n    EXPECT_EQ(kObjectType, y.GetType());\n    EXPECT_TRUE(y.IsObject());\n    EXPECT_TRUE(y.ObjectEmpty());\n    EXPECT_EQ(0u, y.MemberCount());\n\n    // AddMember()\n    x.AddMember(\"A\", \"Apple\", allocator);\n    EXPECT_FALSE(x.ObjectEmpty());\n    EXPECT_EQ(1u, x.MemberCount());\n\n    Value value(\"Banana\", 6);\n    x.AddMember(\"B\", \"Banana\", allocator);\n    EXPECT_EQ(2u, x.MemberCount());\n\n    // AddMember<T>(StringRefType, T, Allocator)\n    {\n        Value o(kObjectType);\n        o.AddMember(\"true\", true, allocator);\n        o.AddMember(\"false\", false, allocator);\n        o.AddMember(\"int\", -1, allocator);\n        o.AddMember(\"uint\", 1u, allocator);\n        o.AddMember(\"int64\", INT64_C(-4294967296), allocator);\n        o.AddMember(\"uint64\", UINT64_C(4294967296), allocator);\n        o.AddMember(\"double\", 3.14, allocator);\n        o.AddMember(\"string\", \"Jelly\", allocator);\n\n        EXPECT_TRUE(o[\"true\"].GetBool());\n        EXPECT_FALSE(o[\"false\"].GetBool());\n        EXPECT_EQ(-1, o[\"int\"].GetInt());\n        EXPECT_EQ(1u, o[\"uint\"].GetUint());\n        EXPECT_EQ(INT64_C(-4294967296), o[\"int64\"].GetInt64());\n        EXPECT_EQ(UINT64_C(4294967296), o[\"uint64\"].GetUint64());\n        EXPECT_STREQ(\"Jelly\",o[\"string\"].GetString());\n        EXPECT_EQ(8u, o.MemberCount());\n    }\n\n#if RAPIDJSON_HAS_CXX11_RVALUE_REFS\n    // AddMember(GenericValue&&, ...) variants\n    {\n        Value o(kObjectType);\n        o.AddMember(Value(\"true\"), Value(true), allocator);\n        o.AddMember(Value(\"false\"), Value(false).Move(), allocator);    // value is lvalue ref\n        o.AddMember(Value(\"int\").Move(), Value(-1), allocator);         // name is lvalue ref\n        o.AddMember(\"uint\", std::move(Value().SetUint(1u)), allocator); // name is literal, value is rvalue\n        EXPECT_TRUE(o[\"true\"].GetBool());\n        EXPECT_FALSE(o[\"false\"].GetBool());\n        EXPECT_EQ(-1, o[\"int\"].GetInt());\n        EXPECT_EQ(1u, o[\"uint\"].GetUint());\n        EXPECT_EQ(4u, o.MemberCount());\n    }\n#endif\n\n    // Tests a member with null character\n    Value name;\n    const Value C0D(\"C\\0D\", 3);\n    name.SetString(C0D.GetString(), 3);\n    value.SetString(\"CherryD\", 7);\n    x.AddMember(name, value, allocator);\n\n    // HasMember()\n    EXPECT_TRUE(x.HasMember(\"A\"));\n    EXPECT_TRUE(x.HasMember(\"B\"));\n    EXPECT_TRUE(y.HasMember(\"A\"));\n    EXPECT_TRUE(y.HasMember(\"B\"));\n\n    name.SetString(\"C\\0D\");\n    EXPECT_TRUE(x.HasMember(name));\n    EXPECT_TRUE(y.HasMember(name));\n\n    GenericValue<UTF8<>, CrtAllocator> othername(\"A\");\n    EXPECT_TRUE(x.HasMember(othername));\n    EXPECT_TRUE(y.HasMember(othername));\n    othername.SetString(\"C\\0D\");\n    EXPECT_TRUE(x.HasMember(othername));\n    EXPECT_TRUE(y.HasMember(othername));\n\n    // operator[]\n    EXPECT_STREQ(\"Apple\", x[\"A\"].GetString());\n    EXPECT_STREQ(\"Banana\", x[\"B\"].GetString());\n    EXPECT_STREQ(\"CherryD\", x[C0D].GetString());\n    EXPECT_STREQ(\"CherryD\", x[othername].GetString());\n\n    // const operator[]\n    EXPECT_STREQ(\"Apple\", y[\"A\"].GetString());\n    EXPECT_STREQ(\"Banana\", y[\"B\"].GetString());\n    EXPECT_STREQ(\"CherryD\", y[C0D].GetString());\n\n    // member iterator\n    Value::MemberIterator itr = x.MemberBegin(); \n    EXPECT_TRUE(itr != x.MemberEnd());\n    EXPECT_STREQ(\"A\", itr->name.GetString());\n    EXPECT_STREQ(\"Apple\", itr->value.GetString());\n    ++itr;\n    EXPECT_TRUE(itr != x.MemberEnd());\n    EXPECT_STREQ(\"B\", itr->name.GetString());\n    EXPECT_STREQ(\"Banana\", itr->value.GetString());\n    ++itr;\n    EXPECT_TRUE(itr != x.MemberEnd());\n    EXPECT_TRUE(memcmp(itr->name.GetString(), \"C\\0D\", 4) == 0);\n    EXPECT_STREQ(\"CherryD\", itr->value.GetString());\n    ++itr;\n    EXPECT_FALSE(itr != x.MemberEnd());\n\n    // const member iterator\n    Value::ConstMemberIterator citr = y.MemberBegin(); \n    EXPECT_TRUE(citr != y.MemberEnd());\n    EXPECT_STREQ(\"A\", citr->name.GetString());\n    EXPECT_STREQ(\"Apple\", citr->value.GetString());\n    ++citr;\n    EXPECT_TRUE(citr != y.MemberEnd());\n    EXPECT_STREQ(\"B\", citr->name.GetString());\n    EXPECT_STREQ(\"Banana\", citr->value.GetString());\n    ++citr;\n    EXPECT_TRUE(citr != y.MemberEnd());\n    EXPECT_TRUE(memcmp(citr->name.GetString(), \"C\\0D\", 4) == 0);\n    EXPECT_STREQ(\"CherryD\", citr->value.GetString());\n    ++citr;\n    EXPECT_FALSE(citr != y.MemberEnd());\n\n    // member iterator conversions/relations\n    itr  = x.MemberBegin();\n    citr = x.MemberBegin(); // const conversion\n    TestEqual(itr, citr);\n    EXPECT_TRUE(itr < x.MemberEnd());\n    EXPECT_FALSE(itr > y.MemberEnd());\n    EXPECT_TRUE(citr < x.MemberEnd());\n    EXPECT_FALSE(citr > y.MemberEnd());\n    ++citr;\n    TestUnequal(itr, citr);\n    EXPECT_FALSE(itr < itr);\n    EXPECT_TRUE(itr < citr);\n    EXPECT_FALSE(itr > itr);\n    EXPECT_TRUE(citr > itr);\n    EXPECT_EQ(1, citr - x.MemberBegin());\n    EXPECT_EQ(0, itr - y.MemberBegin());\n    itr += citr - x.MemberBegin();\n    EXPECT_EQ(1, itr - y.MemberBegin());\n    TestEqual(citr, itr);\n    EXPECT_TRUE(itr <= citr);\n    EXPECT_TRUE(citr <= itr);\n    itr++;\n    EXPECT_TRUE(itr >= citr);\n    EXPECT_FALSE(citr >= itr);\n\n    // RemoveMember()\n    x.RemoveMember(\"A\");\n    EXPECT_FALSE(x.HasMember(\"A\"));\n\n    x.RemoveMember(\"B\");\n    EXPECT_FALSE(x.HasMember(\"B\"));\n\n    x.RemoveMember(othername);\n    EXPECT_FALSE(x.HasMember(name));\n\n    EXPECT_TRUE(x.MemberBegin() == x.MemberEnd());\n\n    // EraseMember(ConstMemberIterator)\n\n    // Use array members to ensure removed elements' destructor is called.\n    // { \"a\": [0], \"b\": [1],[2],...]\n    const char keys[][2] = { \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\" };\n    for (int i = 0; i < 10; i++)\n        x.AddMember(keys[i], Value(kArrayType).PushBack(i, allocator), allocator);\n\n    // MemberCount, iterator difference\n    EXPECT_EQ(x.MemberCount(), SizeType(x.MemberEnd() - x.MemberBegin()));\n\n    // Erase the first\n    itr = x.EraseMember(x.MemberBegin());\n    EXPECT_FALSE(x.HasMember(keys[0]));\n    EXPECT_EQ(x.MemberBegin(), itr);\n    EXPECT_EQ(9u, x.MemberCount());\n    for (; itr != x.MemberEnd(); ++itr) {\n        int i = (itr - x.MemberBegin()) + 1;\n        EXPECT_STREQ(itr->name.GetString(), keys[i]);\n        EXPECT_EQ(i, itr->value[0u].GetInt());\n    }\n\n    // Erase the last\n    itr = x.EraseMember(x.MemberEnd() - 1);\n    EXPECT_FALSE(x.HasMember(keys[9]));\n    EXPECT_EQ(x.MemberEnd(), itr);\n    EXPECT_EQ(8u, x.MemberCount());\n    for (; itr != x.MemberEnd(); ++itr) {\n        int i = (itr - x.MemberBegin()) + 1;\n        EXPECT_STREQ(itr->name.GetString(), keys[i]);\n        EXPECT_EQ(i, itr->value[0u].GetInt());\n    }\n\n    // Erase the middle\n    itr = x.EraseMember(x.MemberBegin() + 4);\n    EXPECT_FALSE(x.HasMember(keys[5]));\n    EXPECT_EQ(x.MemberBegin() + 4, itr);\n    EXPECT_EQ(7u, x.MemberCount());\n    for (; itr != x.MemberEnd(); ++itr) {\n        int i = (itr - x.MemberBegin());\n        i += (i<4) ? 1 : 2;\n        EXPECT_STREQ(itr->name.GetString(), keys[i]);\n        EXPECT_EQ(i, itr->value[0u].GetInt());\n    }\n\n    // EraseMember(ConstMemberIterator, ConstMemberIterator)\n    // Exhaustive test with all 0 <= first < n, first <= last <= n cases\n    const unsigned n = 10;\n    for (unsigned first = 0; first < n; first++) {\n        for (unsigned last = first; last <= n; last++) {\n            Value(kObjectType).Swap(x);\n            for (unsigned i = 0; i < n; i++)\n                x.AddMember(keys[i], Value(kArrayType).PushBack(i, allocator), allocator);\n\n            itr = x.EraseMember(x.MemberBegin() + first, x.MemberBegin() + last);\n            if (last == n)\n                EXPECT_EQ(x.MemberEnd(), itr);\n            else\n                EXPECT_EQ(x.MemberBegin() + first, itr);\n\n            size_t removeCount = last - first;\n            EXPECT_EQ(n - removeCount, x.MemberCount());\n            for (unsigned i = 0; i < first; i++)\n                EXPECT_EQ(i, x[keys[i]][0u].GetUint());\n            for (unsigned i = first; i < n - removeCount; i++)\n                EXPECT_EQ(i + removeCount, x[keys[i+removeCount]][0u].GetUint());\n        }\n    }\n\n    // RemoveAllMembers()\n    x.RemoveAllMembers();\n    EXPECT_TRUE(x.ObjectEmpty());\n    EXPECT_EQ(0u, x.MemberCount());\n\n    // SetObject()\n    Value z;\n    z.SetObject();\n    EXPECT_TRUE(z.IsObject());\n}\n\nTEST(Value, BigNestedArray) {\n    MemoryPoolAllocator<> allocator;\n    Value x(kArrayType);\n    static const SizeType  n = 200;\n\n    for (SizeType i = 0; i < n; i++) {\n        Value y(kArrayType);\n        for (SizeType  j = 0; j < n; j++) {\n            Value number((int)(i * n + j));\n            y.PushBack(number, allocator);\n        }\n        x.PushBack(y, allocator);\n    }\n\n    for (SizeType i = 0; i < n; i++)\n        for (SizeType j = 0; j < n; j++) {\n            EXPECT_TRUE(x[i][j].IsInt());\n            EXPECT_EQ((int)(i * n + j), x[i][j].GetInt());\n        }\n}\n\nTEST(Value, BigNestedObject) {\n    MemoryPoolAllocator<> allocator;\n    Value x(kObjectType);\n    static const SizeType n = 200;\n\n    for (SizeType i = 0; i < n; i++) {\n        char name1[10];\n        sprintf(name1, \"%d\", i);\n\n        // Value name(name1); // should not compile\n        Value name(name1, (SizeType)strlen(name1), allocator);\n        Value object(kObjectType);\n\n        for (SizeType j = 0; j < n; j++) {\n            char name2[10];\n            sprintf(name2, \"%d\", j);\n\n            Value name(name2, (SizeType)strlen(name2), allocator);\n            Value number((int)(i * n + j));\n            object.AddMember(name, number, allocator);\n        }\n\n        // x.AddMember(name1, object, allocator); // should not compile\n        x.AddMember(name, object, allocator);\n    }\n\n    for (SizeType i = 0; i < n; i++) {\n        char name1[10];\n        sprintf(name1, \"%d\", i);\n        \n        for (SizeType j = 0; j < n; j++) {\n            char name2[10];\n            sprintf(name2, \"%d\", j);\n            x[name1];\n            EXPECT_EQ((int)(i * n + j), x[name1][name2].GetInt());\n        }\n    }\n}\n\n// Issue 18: Error removing last element of object\n// http://code.google.com/p/rapidjson/issues/detail?id=18\nTEST(Value, RemoveLastElement) {\n    rapidjson::Document doc;\n    rapidjson::Document::AllocatorType& allocator = doc.GetAllocator();\n    rapidjson::Value objVal(rapidjson::kObjectType);        \n    objVal.AddMember(\"var1\", 123, allocator);       \n    objVal.AddMember(\"var2\", \"444\", allocator);\n    objVal.AddMember(\"var3\", 555, allocator);\n    EXPECT_TRUE(objVal.HasMember(\"var3\"));\n    objVal.RemoveMember(\"var3\");    // Assertion here in r61\n    EXPECT_FALSE(objVal.HasMember(\"var3\"));\n}\n\n// Issue 38:    Segmentation fault with CrtAllocator\nTEST(Document, CrtAllocator) {\n    typedef GenericValue<UTF8<>, CrtAllocator> V;\n\n    V::AllocatorType allocator;\n    V o(kObjectType);\n    o.AddMember(\"x\", 1, allocator); // Should not call destructor on uninitialized name/value of newly allocated members.\n\n    V a(kArrayType);\n    a.PushBack(1, allocator);   // Should not call destructor on uninitialized Value of newly allocated elements.\n}\n\nstatic void TestShortStringOptimization(const char* str) {\n    const rapidjson::SizeType len = (rapidjson::SizeType)strlen(str);\n\t\n    rapidjson::Document doc;\n    rapidjson::Value val;\n    val.SetString(str, len, doc.GetAllocator());\n\t\n\tEXPECT_EQ(val.GetStringLength(), len);\n\tEXPECT_STREQ(val.GetString(), str);\n}\n\nTEST(Value, AllocateShortString) {\n\tTestShortStringOptimization(\"\");                 // edge case: empty string\n\tTestShortStringOptimization(\"12345678\");         // regular case for short strings: 8 chars\n\tTestShortStringOptimization(\"12345678901\");      // edge case: 11 chars in 32-bit mode (=> short string)\n\tTestShortStringOptimization(\"123456789012\");     // edge case: 12 chars in 32-bit mode (=> regular string)\n\tTestShortStringOptimization(\"123456789012345\");  // edge case: 15 chars in 64-bit mode (=> short string)\n\tTestShortStringOptimization(\"1234567890123456\"); // edge case: 16 chars in 64-bit mode (=> regular string)\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/test/unittest/writertest.cpp",
    "content": "// Copyright (C) 2011 Milo Yip\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"unittest.h\"\n\n#include \"rapidjson/document.h\"\n#include \"rapidjson/reader.h\"\n#include \"rapidjson/writer.h\"\n#include \"rapidjson/stringbuffer.h\"\n\nusing namespace rapidjson;\n\nTEST(Writer, Compact) {\n    StringStream s(\"{ \\\"hello\\\" : \\\"world\\\", \\\"t\\\" : true , \\\"f\\\" : false, \\\"n\\\": null, \\\"i\\\":123, \\\"pi\\\": 3.1416, \\\"a\\\":[1, 2, 3] } \");\n    StringBuffer buffer;\n    Writer<StringBuffer> writer(buffer);\n    buffer.ShrinkToFit();\n    Reader reader;\n    reader.Parse<0>(s, writer);\n    EXPECT_STREQ(\"{\\\"hello\\\":\\\"world\\\",\\\"t\\\":true,\\\"f\\\":false,\\\"n\\\":null,\\\"i\\\":123,\\\"pi\\\":3.1416,\\\"a\\\":[1,2,3]}\", buffer.GetString());\n    EXPECT_EQ(77u, buffer.GetSize());\n    EXPECT_TRUE(writer.IsComplete());\n}\n\n// json -> parse -> writer -> json\n#define TEST_ROUNDTRIP(json) \\\n    { \\\n        StringStream s(json); \\\n        StringBuffer buffer; \\\n        Writer<StringBuffer> writer(buffer); \\\n        Reader reader; \\\n        reader.Parse<0>(s, writer); \\\n        EXPECT_STREQ(json, buffer.GetString()); \\\n        EXPECT_TRUE(writer.IsComplete()); \\\n    }\n\nTEST(Writer, Root) {\n    TEST_ROUNDTRIP(\"null\");\n    TEST_ROUNDTRIP(\"true\");\n    TEST_ROUNDTRIP(\"false\");\n    TEST_ROUNDTRIP(\"0\");\n    TEST_ROUNDTRIP(\"\\\"foo\\\"\");\n    TEST_ROUNDTRIP(\"[]\");\n    TEST_ROUNDTRIP(\"{}\");\n}\n\nTEST(Writer, Int) {\n    TEST_ROUNDTRIP(\"[-1]\");\n    TEST_ROUNDTRIP(\"[-123]\");\n    TEST_ROUNDTRIP(\"[-2147483648]\");\n}\n\nTEST(Writer, UInt) {\n    TEST_ROUNDTRIP(\"[0]\");\n    TEST_ROUNDTRIP(\"[1]\");\n    TEST_ROUNDTRIP(\"[123]\");\n    TEST_ROUNDTRIP(\"[2147483647]\");\n    TEST_ROUNDTRIP(\"[4294967295]\");\n}\n\nTEST(Writer, Int64) {\n    TEST_ROUNDTRIP(\"[-1234567890123456789]\");\n    TEST_ROUNDTRIP(\"[-9223372036854775808]\");\n}\n\nTEST(Writer, Uint64) {\n    TEST_ROUNDTRIP(\"[1234567890123456789]\");\n    TEST_ROUNDTRIP(\"[9223372036854775807]\");\n}\n\nTEST(Writer, String) {\n    TEST_ROUNDTRIP(\"[\\\"Hello\\\"]\");\n    TEST_ROUNDTRIP(\"[\\\"Hello\\\\u0000World\\\"]\");\n    TEST_ROUNDTRIP(\"[\\\"\\\\\\\"\\\\\\\\/\\\\b\\\\f\\\\n\\\\r\\\\t\\\"]\");\n}\n\nTEST(Writer, Double) {\n    TEST_ROUNDTRIP(\"[1.2345,1.2345678,0.123456789012,1234567.8]\");\n\n}\n\nTEST(Writer, Transcode) {\n    const char json[] = \"{\\\"hello\\\":\\\"world\\\",\\\"t\\\":true,\\\"f\\\":false,\\\"n\\\":null,\\\"i\\\":123,\\\"pi\\\":3.1416,\\\"a\\\":[1,2,3],\\\"dollar\\\":\\\"\\x24\\\",\\\"cents\\\":\\\"\\xC2\\xA2\\\",\\\"euro\\\":\\\"\\xE2\\x82\\xAC\\\",\\\"gclef\\\":\\\"\\xF0\\x9D\\x84\\x9E\\\"}\";\n\n    // UTF8 -> UTF16 -> UTF8\n    {\n        StringStream s(json);\n        StringBuffer buffer;\n        Writer<StringBuffer, UTF16<>, UTF8<> > writer(buffer);\n        GenericReader<UTF8<>, UTF16<> > reader;\n        reader.Parse(s, writer);\n        EXPECT_STREQ(json, buffer.GetString());\n    }\n\n    // UTF8 -> UTF8 -> ASCII -> UTF8 -> UTF8\n    {\n        StringStream s(json);\n        StringBuffer buffer;\n        Writer<StringBuffer, UTF8<>, ASCII<> > writer(buffer);\n        Reader reader;\n        reader.Parse(s, writer);\n\n        StringBuffer buffer2;\n        Writer<StringBuffer> writer2(buffer2);\n        GenericReader<ASCII<>, UTF8<> > reader2;\n        StringStream s2(buffer.GetString());\n        reader2.Parse(s2, writer2);\n\n        EXPECT_STREQ(json, buffer2.GetString());\n    }\n}\n\n#include <sstream>\n\nclass OStreamWrapper {\npublic:\n    typedef char Ch;\n\n    OStreamWrapper(std::ostream& os) : os_(os) {}\n\n    Ch Peek() const { assert(false); return '\\0'; }\n    Ch Take() { assert(false); return '\\0'; }\n    size_t Tell() const { return 0; }\n\n    Ch* PutBegin() { assert(false); return 0; }\n    void Put(Ch c) { os_.put(c); }\n    void Flush() { os_.flush(); }\n    size_t PutEnd(Ch*) { assert(false); return 0; }\n\nprivate:\n    OStreamWrapper(const OStreamWrapper&);\n    OStreamWrapper& operator=(const OStreamWrapper&);\n\n    std::ostream& os_;\n};\n\nTEST(Writer, OStreamWrapper) {\n    StringStream s(\"{ \\\"hello\\\" : \\\"world\\\", \\\"t\\\" : true , \\\"f\\\" : false, \\\"n\\\": null, \\\"i\\\":123, \\\"pi\\\": 3.1416, \\\"a\\\":[1, 2, 3] } \");\n    \n    std::stringstream ss;\n    OStreamWrapper os(ss);\n    \n    Writer<OStreamWrapper> writer(os);\n\n    Reader reader;\n    reader.Parse<0>(s, writer);\n    \n    std::string actual = ss.str();\n    EXPECT_STREQ(\"{\\\"hello\\\":\\\"world\\\",\\\"t\\\":true,\\\"f\\\":false,\\\"n\\\":null,\\\"i\\\":123,\\\"pi\\\":3.1416,\\\"a\\\":[1,2,3]}\", actual.c_str());\n}\n\nTEST(Writer, AssertRootMayBeAnyValue) {\n#define T(x)\\\n    {\\\n        StringBuffer buffer;\\\n        Writer<StringBuffer> writer(buffer);\\\n        EXPECT_TRUE(x);\\\n    }\n    T(writer.Bool(false));\n    T(writer.Bool(true));\n    T(writer.Null());\n    T(writer.Int(0));\n    T(writer.Uint(0));\n    T(writer.Int64(0));\n    T(writer.Uint64(0));\n    T(writer.Double(0));\n    T(writer.String(\"foo\"));\n#undef T\n}\n\nTEST(Writer, AssertIncorrectObjectLevel) {\n    StringBuffer buffer;\n    Writer<StringBuffer> writer(buffer);\n    writer.StartObject();\n    writer.EndObject();\n    ASSERT_THROW(writer.EndObject(), AssertException);\n}\n\nTEST(Writer, AssertIncorrectArrayLevel) {\n    StringBuffer buffer;\n    Writer<StringBuffer> writer(buffer);\n    writer.StartArray();\n    writer.EndArray();\n    ASSERT_THROW(writer.EndArray(), AssertException);\n}\n\nTEST(Writer, AssertIncorrectEndObject) {\n    StringBuffer buffer;\n    Writer<StringBuffer> writer(buffer);\n    writer.StartObject();\n    ASSERT_THROW(writer.EndArray(), AssertException);\n}\n\nTEST(Writer, AssertIncorrectEndArray) {\n    StringBuffer buffer;\n    Writer<StringBuffer> writer(buffer);\n    writer.StartObject();\n    ASSERT_THROW(writer.EndArray(), AssertException);\n}\n\nTEST(Writer, AssertObjectKeyNotString) {\n#define T(x)\\\n    {\\\n        StringBuffer buffer;\\\n        Writer<StringBuffer> writer(buffer);\\\n        writer.StartObject();\\\n        ASSERT_THROW(x, AssertException); \\\n    }\n    T(writer.Bool(false));\n    T(writer.Bool(true));\n    T(writer.Null());\n    T(writer.Int(0));\n    T(writer.Uint(0));\n    T(writer.Int64(0));\n    T(writer.Uint64(0));\n    T(writer.Double(0));\n    T(writer.StartObject());\n    T(writer.StartArray());\n#undef T\n}\n\nTEST(Writer, AssertMultipleRoot) {\n    StringBuffer buffer;\n    Writer<StringBuffer> writer(buffer);\n\n    writer.StartObject();\n    writer.EndObject();\n    ASSERT_THROW(writer.StartObject(), AssertException);\n\n    writer.Reset(buffer);\n    writer.Null();\n    ASSERT_THROW(writer.Int(0), AssertException);\n\n    writer.Reset(buffer);\n    writer.String(\"foo\");\n    ASSERT_THROW(writer.StartArray(), AssertException);\n\n    writer.Reset(buffer);\n    writer.StartArray();\n    writer.EndArray();\n    ASSERT_THROW(writer.Double(3.14), AssertException);\n}\n\nTEST(Writer, RootObjectIsComplete) {\n    StringBuffer buffer;\n    Writer<StringBuffer> writer(buffer);\n    EXPECT_FALSE(writer.IsComplete());\n    writer.StartObject();\n    EXPECT_FALSE(writer.IsComplete());\n    writer.String(\"foo\");\n    EXPECT_FALSE(writer.IsComplete());\n    writer.Int(1);\n    EXPECT_FALSE(writer.IsComplete());\n    writer.EndObject();\n    EXPECT_TRUE(writer.IsComplete());\n}\n\nTEST(Writer, RootArrayIsComplete) {\n    StringBuffer buffer;\n    Writer<StringBuffer> writer(buffer);\n    EXPECT_FALSE(writer.IsComplete());\n    writer.StartArray();\n    EXPECT_FALSE(writer.IsComplete());\n    writer.String(\"foo\");\n    EXPECT_FALSE(writer.IsComplete());\n    writer.Int(1);\n    EXPECT_FALSE(writer.IsComplete());\n    writer.EndArray();\n    EXPECT_TRUE(writer.IsComplete());\n}\n\nTEST(Writer, RootValueIsComplete) {\n#define T(x)\\\n    {\\\n        StringBuffer buffer;\\\n        Writer<StringBuffer> writer(buffer);\\\n        EXPECT_FALSE(writer.IsComplete()); \\\n        x; \\\n        EXPECT_TRUE(writer.IsComplete()); \\\n    }\n    T(writer.Null());\n    T(writer.Bool(true));\n    T(writer.Bool(false));\n    T(writer.Int(0));\n    T(writer.Uint(0));\n    T(writer.Int64(0));\n    T(writer.Uint64(0));\n    T(writer.Double(0));\n    T(writer.String(\"\"));\n#undef T\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/AUTHORS",
    "content": "Baptiste Lepilleur <blep@users.sourceforge.net>\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/LICENSE",
    "content": "The json-cpp library and this documentation are in Public Domain.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/README.txt",
    "content": "* Introduction:\n  =============\n\nJSON (JavaScript Object Notation) is a lightweight data-interchange format. \nIt can represent integer, real number, string, an ordered sequence of \nvalue, and a collection of name/value pairs.\n\nJsonCpp is a simple API to manipulate JSON value, handle serialization \nand unserialization to string.\n\nIt can also preserve existing comment in unserialization/serialization steps,\nmaking it a convenient format to store user input files.\n\nUnserialization parsing is user friendly and provides precise error reports.\n\n\n* Building/Testing:\n  =================\n\nJsonCpp uses Scons (http://www.scons.org) as a build system. Scons requires\npython to be installed (http://www.python.org).\n\nYou download scons-local distribution from the following url:\nhttp://sourceforge.net/project/showfiles.php?group_id=30337&package_id=67375\n\nUnzip it in the directory where you found this README file. scons.py Should be \nat the same level as README.\n\npython scons.py platform=PLTFRM [TARGET]\nwhere PLTFRM may be one of:\n\tsuncc Sun C++ (Solaris)\n\tvacpp Visual Age C++ (AIX)\n\tmingw \n\tmsvc6 Microsoft Visual Studio 6 service pack 5-6\n\tmsvc70 Microsoft Visual Studio 2002\n\tmsvc71 Microsoft Visual Studio 2003\n\tmsvc80 Microsoft Visual Studio 2005\n\tlinux-gcc Gnu C++ (linux, also reported to work for Mac OS X)\n\t\nadding platform is fairly simple. You need to change the Sconstruct file \nto do so.\n\t\nand TARGET may be:\n\tcheck: build library and run unit tests.\n\n    \n* Running the test manually:\n  ==========================\n\ncd test\n# This will run the Reader/Writer tests\npython runjsontests.py \"path to jsontest.exe\"\n\n# This will run the Reader/Writer tests, using JSONChecker test suite\n# (http://www.json.org/JSON_checker/).\n# Notes: not all tests pass: JsonCpp is too lenient (for example,\n# it allows an integer to start with '0'). The goal is to improve\n# strict mode parsing to get all tests to pass.\npython runjsontests.py --with-json-checker \"path to jsontest.exe\"\n\n# This will run the unit tests (mostly Value)\npython rununittests.py \"path to test_lib_json.exe\"\n\nYou can run the tests using valgrind:\npython rununittests.py --valgrind \"path to test_lib_json.exe\"\n\n\n* Building the documentation:\n  ===========================\n\nRun the python script doxybuild.py from the top directory:\n\npython doxybuild.py --open --with-dot\n\nSee doxybuild.py --help for options. \n\n\n* Adding a reader/writer test:\n  ============================\n\nTo add a test, you need to create two files in test/data:\n- a TESTNAME.json file, that contains the input document in JSON format.\n- a TESTNAME.expected file, that contains a flatened representation of \n  the input document.\n  \nTESTNAME.expected file format:\n- each line represents a JSON element of the element tree represented \n  by the input document.\n- each line has two parts: the path to access the element separated from\n  the element value by '='. Array and object values are always empty \n  (e.g. represented by either [] or {}).\n- element path: '.' represented the root element, and is used to separate \n  object members. [N] is used to specify the value of an array element\n  at index N.\nSee test_complex_01.json and test_complex_01.expected to better understand\nelement path.\n\n\n* Understanding reader/writer test output:\n  ========================================\n\nWhen a test is run, output files are generated aside the input test files. \nBelow is a short description of the content of each file:\n\n- test_complex_01.json: input JSON document\n- test_complex_01.expected: flattened JSON element tree used to check if \n    parsing was corrected.\n\n- test_complex_01.actual: flattened JSON element tree produced by \n    jsontest.exe from reading test_complex_01.json\n- test_complex_01.rewrite: JSON document written by jsontest.exe using the\n    Json::Value parsed from test_complex_01.json and serialized using\n    Json::StyledWritter.\n- test_complex_01.actual-rewrite: flattened JSON element tree produced by \n    jsontest.exe from reading test_complex_01.rewrite.\ntest_complex_01.process-output: jsontest.exe output, typically useful to\n    understand parsing error.\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/include/json/autolink.h",
    "content": "#ifndef JSON_AUTOLINK_H_INCLUDED\n# define JSON_AUTOLINK_H_INCLUDED\n\n# include \"config.h\"\n\n# ifdef JSON_IN_CPPTL\n#  include <cpptl/cpptl_autolink.h>\n# endif\n\n# if !defined(JSON_NO_AUTOLINK)  &&  !defined(JSON_DLL_BUILD)  &&  !defined(JSON_IN_CPPTL)\n#  define CPPTL_AUTOLINK_NAME \"json\"\n#  undef CPPTL_AUTOLINK_DLL\n#  ifdef JSON_DLL\n#   define CPPTL_AUTOLINK_DLL\n#  endif\n#  include \"autolink.h\"\n# endif\n\n#endif // JSON_AUTOLINK_H_INCLUDED\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/include/json/config.h",
    "content": "#ifndef JSON_CONFIG_H_INCLUDED\n# define JSON_CONFIG_H_INCLUDED\n\n/// If defined, indicates that json library is embedded in CppTL library.\n//# define JSON_IN_CPPTL 1\n\n/// If defined, indicates that json may leverage CppTL library\n//#  define JSON_USE_CPPTL 1\n/// If defined, indicates that cpptl vector based map should be used instead of std::map\n/// as Value container.\n//#  define JSON_USE_CPPTL_SMALLMAP 1\n/// If defined, indicates that Json specific container should be used\n/// (hash table & simple deque container with customizable allocator).\n/// THIS FEATURE IS STILL EXPERIMENTAL!\n//#  define JSON_VALUE_USE_INTERNAL_MAP 1\n/// Force usage of standard new/malloc based allocator instead of memory pool based allocator.\n/// The memory pools allocator used optimization (initializing Value and ValueInternalLink\n/// as if it was a POD) that may cause some validation tool to report errors.\n/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined.\n//#  define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1\n\n/// If defined, indicates that Json use exception to report invalid type manipulation\n/// instead of C assert macro.\n# define JSON_USE_EXCEPTION 1\n\n# ifdef JSON_IN_CPPTL\n#  include <cpptl/config.h>\n#  ifndef JSON_USE_CPPTL\n#   define JSON_USE_CPPTL 1\n#  endif\n# endif\n\n# ifdef JSON_IN_CPPTL\n#  define JSON_API CPPTL_API\n# elif defined(JSON_DLL_BUILD)\n#  define JSON_API __declspec(dllexport)\n# elif defined(JSON_DLL)\n#  define JSON_API __declspec(dllimport)\n# else\n#  define JSON_API\n# endif\n\n#endif // JSON_CONFIG_H_INCLUDED\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/include/json/features.h",
    "content": "#ifndef CPPTL_JSON_FEATURES_H_INCLUDED\n# define CPPTL_JSON_FEATURES_H_INCLUDED\n\n# include \"forwards.h\"\n\nnamespace Json {\n\n   /** \\brief Configuration passed to reader and writer.\n    * This configuration object can be used to force the Reader or Writer\n    * to behave in a standard conforming way.\n    */\n   class JSON_API Features\n   {\n   public:\n      /** \\brief A configuration that allows all features and assumes all strings are UTF-8.\n       * - C & C++ comments are allowed\n       * - Root object can be any JSON value\n       * - Assumes Value strings are encoded in UTF-8\n       */\n      static Features all();\n\n      /** \\brief A configuration that is strictly compatible with the JSON specification.\n       * - Comments are forbidden.\n       * - Root object must be either an array or an object value.\n       * - Assumes Value strings are encoded in UTF-8\n       */\n      static Features strictMode();\n\n      /** \\brief Initialize the configuration like JsonConfig::allFeatures;\n       */\n      Features();\n\n      /// \\c true if comments are allowed. Default: \\c true.\n      bool allowComments_;\n\n      /// \\c true if root must be either an array or an object value. Default: \\c false.\n      bool strictRoot_;\n   };\n\n} // namespace Json\n\n#endif // CPPTL_JSON_FEATURES_H_INCLUDED\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/include/json/forwards.h",
    "content": "#ifndef JSON_FORWARDS_H_INCLUDED\n# define JSON_FORWARDS_H_INCLUDED\n\n# include \"config.h\"\n\nnamespace Json {\n\n   // writer.h\n   class FastWriter;\n   class StyledWriter;\n\n   // reader.h\n   class Reader;\n\n   // features.h\n   class Features;\n\n   // value.h\n   typedef int Int;\n   typedef unsigned int UInt;\n   class StaticString;\n   class Path;\n   class PathArgument;\n   class Value;\n   class ValueIteratorBase;\n   class ValueIterator;\n   class ValueConstIterator;\n#ifdef JSON_VALUE_USE_INTERNAL_MAP\n   class ValueAllocator;\n   class ValueMapAllocator;\n   class ValueInternalLink;\n   class ValueInternalArray;\n   class ValueInternalMap;\n#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP\n\n} // namespace Json\n\n\n#endif // JSON_FORWARDS_H_INCLUDED\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/include/json/json.h",
    "content": "#ifndef JSON_JSON_H_INCLUDED\n# define JSON_JSON_H_INCLUDED\n\n# include \"autolink.h\"\n# include \"value.h\"\n# include \"reader.h\"\n# include \"writer.h\"\n# include \"features.h\"\n\n#endif // JSON_JSON_H_INCLUDED\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/include/json/reader.h",
    "content": "#ifndef CPPTL_JSON_READER_H_INCLUDED\n# define CPPTL_JSON_READER_H_INCLUDED\n\n# include \"features.h\"\n# include \"value.h\"\n# include <deque>\n# include <stack>\n# include <string>\n# include <iostream>\n\nnamespace Json {\n\n   /** \\brief Unserialize a <a HREF=\"http://www.json.org\">JSON</a> document into a Value.\n    *\n    */\n   class JSON_API Reader\n   {\n   public:\n      typedef char Char;\n      typedef const Char *Location;\n\n      /** \\brief Constructs a Reader allowing all features\n       * for parsing.\n       */\n      Reader();\n\n      /** \\brief Constructs a Reader allowing the specified feature set\n       * for parsing.\n       */\n      Reader( const Features &features );\n\n      /** \\brief Read a Value from a <a HREF=\"http://www.json.org\">JSON</a> document.\n       * \\param document UTF-8 encoded string containing the document to read.\n       * \\param root [out] Contains the root value of the document if it was\n       *             successfully parsed.\n       * \\param collectComments \\c true to collect comment and allow writing them back during\n       *                        serialization, \\c false to discard comments.\n       *                        This parameter is ignored if Features::allowComments_\n       *                        is \\c false.\n       * \\return \\c true if the document was successfully parsed, \\c false if an error occurred.\n       */\n      bool parse( const std::string &document, \n                  Value &root,\n                  bool collectComments = true );\n\n      /** \\brief Read a Value from a <a HREF=\"http://www.json.org\">JSON</a> document.\n       * \\param document UTF-8 encoded string containing the document to read.\n       * \\param root [out] Contains the root value of the document if it was\n       *             successfully parsed.\n       * \\param collectComments \\c true to collect comment and allow writing them back during\n       *                        serialization, \\c false to discard comments.\n       *                        This parameter is ignored if Features::allowComments_\n       *                        is \\c false.\n       * \\return \\c true if the document was successfully parsed, \\c false if an error occurred.\n       */\n      bool parse( const char *beginDoc, const char *endDoc, \n                  Value &root,\n                  bool collectComments = true );\n\n      /// \\brief Parse from input stream.\n      /// \\see Json::operator>>(std::istream&, Json::Value&).\n      bool parse( std::istream &is,\n                  Value &root,\n                  bool collectComments = true );\n\n      /** \\brief Returns a user friendly string that list errors in the parsed document.\n       * \\return Formatted error message with the list of errors with their location in \n       *         the parsed document. An empty string is returned if no error occurred\n       *         during parsing.\n       */\n      std::string getFormatedErrorMessages() const;\n\n   private:\n      enum TokenType\n      {\n         tokenEndOfStream = 0,\n         tokenObjectBegin,\n         tokenObjectEnd,\n         tokenArrayBegin,\n         tokenArrayEnd,\n         tokenString,\n         tokenNumber,\n         tokenTrue,\n         tokenFalse,\n         tokenNull,\n         tokenArraySeparator,\n         tokenMemberSeparator,\n         tokenComment,\n         tokenError\n      };\n\n      class Token\n      {\n      public:\n         TokenType type_;\n         Location start_;\n         Location end_;\n      };\n\n      class ErrorInfo\n      {\n      public:\n         Token token_;\n         std::string message_;\n         Location extra_;\n      };\n\n      typedef std::deque<ErrorInfo> Errors;\n\n      bool expectToken( TokenType type, Token &token, const char *message );\n      bool readToken( Token &token );\n      void skipSpaces();\n      bool match( Location pattern, \n                  int patternLength );\n      bool readComment();\n      bool readCStyleComment();\n      bool readCppStyleComment();\n      bool readString();\n      void readNumber();\n      bool readValue();\n      bool readObject( Token &token );\n      bool readArray( Token &token );\n      bool decodeNumber( Token &token );\n      bool decodeString( Token &token );\n      bool decodeString( Token &token, std::string &decoded );\n      bool decodeDouble( Token &token );\n      bool decodeUnicodeCodePoint( Token &token, \n                                   Location &current, \n                                   Location end, \n                                   unsigned int &unicode );\n      bool decodeUnicodeEscapeSequence( Token &token, \n                                        Location &current, \n                                        Location end, \n                                        unsigned int &unicode );\n      bool addError( const std::string &message, \n                     Token &token,\n                     Location extra = 0 );\n      bool recoverFromError( TokenType skipUntilToken );\n      bool addErrorAndRecover( const std::string &message, \n                               Token &token,\n                               TokenType skipUntilToken );\n      void skipUntilSpace();\n      Value &currentValue();\n      Char getNextChar();\n      void getLocationLineAndColumn( Location location,\n                                     int &line,\n                                     int &column ) const;\n      std::string getLocationLineAndColumn( Location location ) const;\n      void addComment( Location begin, \n                       Location end, \n                       CommentPlacement placement );\n      void skipCommentTokens( Token &token );\n   \n      typedef std::stack<Value *> Nodes;\n      Nodes nodes_;\n      Errors errors_;\n      std::string document_;\n      Location begin_;\n      Location end_;\n      Location current_;\n      Location lastValueEnd_;\n      Value *lastValue_;\n      std::string commentsBefore_;\n      Features features_;\n      bool collectComments_;\n   };\n\n   /** \\brief Read from 'sin' into 'root'.\n\n    Always keep comments from the input JSON.\n\n    This can be used to read a file into a particular sub-object.\n    For example:\n    \\code\n    Json::Value root;\n    cin >> root[\"dir\"][\"file\"];\n    cout << root;\n    \\endcode\n    Result:\n    \\verbatim\n    {\n\t\"dir\": {\n\t    \"file\": {\n\t\t// The input stream JSON would be nested here.\n\t    }\n\t}\n    }\n    \\endverbatim\n    \\throw std::exception on parse error.\n    \\see Json::operator<<()\n   */\n   std::istream& operator>>( std::istream&, Value& );\n\n} // namespace Json\n\n#endif // CPPTL_JSON_READER_H_INCLUDED\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/include/json/value.h",
    "content": "#ifndef CPPTL_JSON_H_INCLUDED\n# define CPPTL_JSON_H_INCLUDED\n\n# include \"forwards.h\"\n# include <string>\n# include <vector>\n\n# ifndef JSON_USE_CPPTL_SMALLMAP\n#  include <map>\n# else\n#  include <cpptl/smallmap.h>\n# endif\n# ifdef JSON_USE_CPPTL\n#  include <cpptl/forwards.h>\n# endif\n\n/** \\brief JSON (JavaScript Object Notation).\n */\nnamespace Json {\n\n   /** \\brief Type of the value held by a Value object.\n    */\n   enum ValueType\n   {\n      nullValue = 0, ///< 'null' value\n      intValue,      ///< signed integer value\n      uintValue,     ///< unsigned integer value\n      realValue,     ///< double value\n      stringValue,   ///< UTF-8 string value\n      booleanValue,  ///< bool value\n      arrayValue,    ///< array value (ordered list)\n      objectValue    ///< object value (collection of name/value pairs).\n   };\n\n   enum CommentPlacement\n   {\n      commentBefore = 0,        ///< a comment placed on the line before a value\n      commentAfterOnSameLine,   ///< a comment just after a value on the same line\n      commentAfter,             ///< a comment on the line after a value (only make sense for root value)\n      numberOfCommentPlacement\n   };\n\n//# ifdef JSON_USE_CPPTL\n//   typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;\n//   typedef CppTL::AnyEnumerator<const Value &> EnumValues;\n//# endif\n\n   /** \\brief Lightweight wrapper to tag static string.\n    *\n    * Value constructor and objectValue member assignement takes advantage of the\n    * StaticString and avoid the cost of string duplication when storing the\n    * string or the member name.\n    *\n    * Example of usage:\n    * \\code\n    * Json::Value aValue( StaticString(\"some text\") );\n    * Json::Value object;\n    * static const StaticString code(\"code\");\n    * object[code] = 1234;\n    * \\endcode\n    */\n   class JSON_API StaticString\n   {\n   public:\n      explicit StaticString( const char *czstring )\n         : str_( czstring )\n      {\n      }\n\n      operator const char *() const\n      {\n         return str_;\n      }\n\n      const char *c_str() const\n      {\n         return str_;\n      }\n\n   private:\n      const char *str_;\n   };\n\n   /** \\brief Represents a <a HREF=\"http://www.json.org\">JSON</a> value.\n    *\n    * This class is a discriminated union wrapper that can represents a:\n    * - signed integer [range: Value::minInt - Value::maxInt]\n    * - unsigned integer (range: 0 - Value::maxUInt)\n    * - double\n    * - UTF-8 string\n    * - boolean\n    * - 'null'\n    * - an ordered list of Value\n    * - collection of name/value pairs (javascript object)\n    *\n    * The type of the held value is represented by a #ValueType and \n    * can be obtained using type().\n    *\n    * values of an #objectValue or #arrayValue can be accessed using operator[]() methods. \n    * Non const methods will automatically create the a #nullValue element \n    * if it does not exist. \n    * The sequence of an #arrayValue will be automatically resize and initialized \n    * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue.\n    *\n    * The get() methods can be used to obtanis default value in the case the required element\n    * does not exist.\n    *\n    * It is possible to iterate over the list of a #objectValue values using \n    * the getMemberNames() method.\n    */\n   class JSON_API Value \n   {\n      friend class ValueIteratorBase;\n# ifdef JSON_VALUE_USE_INTERNAL_MAP\n      friend class ValueInternalLink;\n      friend class ValueInternalMap;\n# endif\n   public:\n      typedef std::vector<std::string> Members;\n      typedef ValueIterator iterator;\n      typedef ValueConstIterator const_iterator;\n      typedef Json::UInt UInt;\n      typedef Json::Int Int;\n      typedef UInt ArrayIndex;\n\n      static const Value null;\n      static const Int minInt;\n      static const Int maxInt;\n      static const UInt maxUInt;\n\n   private:\n#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION\n# ifndef JSON_VALUE_USE_INTERNAL_MAP\n      class CZString \n      {\n      public:\n         enum DuplicationPolicy \n         {\n            noDuplication = 0,\n            duplicate,\n            duplicateOnCopy\n         };\n         CZString( int index );\n         CZString( const char *cstr, DuplicationPolicy allocate );\n         CZString( const CZString &other );\n         ~CZString();\n         CZString &operator =( const CZString &other );\n         bool operator<( const CZString &other ) const;\n         bool operator==( const CZString &other ) const;\n         int index() const;\n         const char *c_str() const;\n         bool isStaticString() const;\n      private:\n         void swap( CZString &other );\n         const char *cstr_;\n         int index_;\n      };\n\n   public:\n#  ifndef JSON_USE_CPPTL_SMALLMAP\n      typedef std::map<CZString, Value> ObjectValues;\n#  else\n      typedef CppTL::SmallMap<CZString, Value> ObjectValues;\n#  endif // ifndef JSON_USE_CPPTL_SMALLMAP\n# endif // ifndef JSON_VALUE_USE_INTERNAL_MAP\n#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION\n\n   public:\n      /** \\brief Create a default Value of the given type.\n\n        This is a very useful constructor.\n        To create an empty array, pass arrayValue.\n        To create an empty object, pass objectValue.\n        Another Value can then be set to this one by assignment.\n\tThis is useful since clear() and resize() will not alter types.\n\n        Examples:\n\t\\code\n\tJson::Value null_value; // null\n\tJson::Value arr_value(Json::arrayValue); // []\n\tJson::Value obj_value(Json::objectValue); // {}\n\t\\endcode\n      */\n      Value( ValueType type = nullValue );\n      Value( Int value );\n      Value( UInt value );\n      Value( double value );\n      Value( const char *value );\n      Value( const char *beginValue, const char *endValue );\n      /** \\brief Constructs a value from a static string.\n\n       * Like other value string constructor but do not duplicate the string for\n       * internal storage. The given string must remain alive after the call to this\n       * constructor.\n       * Example of usage:\n       * \\code\n       * Json::Value aValue( StaticString(\"some text\") );\n       * \\endcode\n       */\n      Value( const StaticString &value );\n      Value( const std::string &value );\n# ifdef JSON_USE_CPPTL\n      Value( const CppTL::ConstString &value );\n# endif\n      Value( bool value );\n      Value( const Value &other );\n      ~Value();\n\n      Value &operator=( const Value &other );\n      /// Swap values.\n      /// \\note Currently, comments are intentionally not swapped, for\n      /// both logic and efficiency.\n      void swap( Value &other );\n\n      ValueType type() const;\n\n      bool operator <( const Value &other ) const;\n      bool operator <=( const Value &other ) const;\n      bool operator >=( const Value &other ) const;\n      bool operator >( const Value &other ) const;\n\n      bool operator ==( const Value &other ) const;\n      bool operator !=( const Value &other ) const;\n\n      int compare( const Value &other );\n\n      const char *asCString() const;\n      std::string asString() const;\n# ifdef JSON_USE_CPPTL\n      CppTL::ConstString asConstString() const;\n# endif\n      Int asInt() const;\n      UInt asUInt() const;\n      double asDouble() const;\n      bool asBool() const;\n\n      bool isNull() const;\n      bool isBool() const;\n      bool isInt() const;\n      bool isUInt() const;\n      bool isIntegral() const;\n      bool isDouble() const;\n      bool isNumeric() const;\n      bool isString() const;\n      bool isArray() const;\n      bool isObject() const;\n\n      bool isConvertibleTo( ValueType other ) const;\n\n      /// Number of values in array or object\n      UInt size() const;\n\n      /// \\brief Return true if empty array, empty object, or null;\n      /// otherwise, false.\n      bool empty() const;\n\n      /// Return isNull()\n      bool operator!() const;\n\n      /// Remove all object members and array elements.\n      /// \\pre type() is arrayValue, objectValue, or nullValue\n      /// \\post type() is unchanged\n      void clear();\n\n      /// Resize the array to size elements. \n      /// New elements are initialized to null.\n      /// May only be called on nullValue or arrayValue.\n      /// \\pre type() is arrayValue or nullValue\n      /// \\post type() is arrayValue\n      void resize( UInt size );\n\n      /// Access an array element (zero based index ).\n      /// If the array contains less than index element, then null value are inserted\n      /// in the array so that its size is index+1.\n      /// (You may need to say 'value[0u]' to get your compiler to distinguish\n      ///  this from the operator[] which takes a string.)\n      Value &operator[]( UInt index );\n      /// Access an array element (zero based index )\n      /// (You may need to say 'value[0u]' to get your compiler to distinguish\n      ///  this from the operator[] which takes a string.)\n      const Value &operator[]( UInt index ) const;\n      /// If the array contains at least index+1 elements, returns the element value, \n      /// otherwise returns defaultValue.\n      Value get( UInt index, \n                 const Value &defaultValue ) const;\n      /// Return true if index < size().\n      bool isValidIndex( UInt index ) const;\n      /// \\brief Append value to array at the end.\n      ///\n      /// Equivalent to jsonvalue[jsonvalue.size()] = value;\n      Value &append( const Value &value );\n\n      /// Access an object value by name, create a null member if it does not exist.\n      Value &operator[]( const char *key );\n      /// Access an object value by name, returns null if there is no member with that name.\n      const Value &operator[]( const char *key ) const;\n      /// Access an object value by name, create a null member if it does not exist.\n      Value &operator[]( const std::string &key );\n      /// Access an object value by name, returns null if there is no member with that name.\n      const Value &operator[]( const std::string &key ) const;\n      /** \\brief Access an object value by name, create a null member if it does not exist.\n\n       * If the object as no entry for that name, then the member name used to store\n       * the new entry is not duplicated.\n       * Example of use:\n       * \\code\n       * Json::Value object;\n       * static const StaticString code(\"code\");\n       * object[code] = 1234;\n       * \\endcode\n       */\n      Value &operator[]( const StaticString &key );\n# ifdef JSON_USE_CPPTL\n      /// Access an object value by name, create a null member if it does not exist.\n      Value &operator[]( const CppTL::ConstString &key );\n      /// Access an object value by name, returns null if there is no member with that name.\n      const Value &operator[]( const CppTL::ConstString &key ) const;\n# endif\n      /// Return the member named key if it exist, defaultValue otherwise.\n      Value get( const char *key, \n                 const Value &defaultValue ) const;\n      /// Return the member named key if it exist, defaultValue otherwise.\n      Value get( const std::string &key,\n                 const Value &defaultValue ) const;\n# ifdef JSON_USE_CPPTL\n      /// Return the member named key if it exist, defaultValue otherwise.\n      Value get( const CppTL::ConstString &key,\n                 const Value &defaultValue ) const;\n# endif\n      /// \\brief Remove and return the named member.  \n      ///\n      /// Do nothing if it did not exist.\n      /// \\return the removed Value, or null.\n      /// \\pre type() is objectValue or nullValue\n      /// \\post type() is unchanged\n      Value removeMember( const char* key );\n      /// Same as removeMember(const char*)\n      Value removeMember( const std::string &key );\n\n      /// Return true if the object has a member named key.\n      bool isMember( const char *key ) const;\n      /// Return true if the object has a member named key.\n      bool isMember( const std::string &key ) const;\n# ifdef JSON_USE_CPPTL\n      /// Return true if the object has a member named key.\n      bool isMember( const CppTL::ConstString &key ) const;\n# endif\n\n      /// \\brief Return a list of the member names.\n      ///\n      /// If null, return an empty list.\n      /// \\pre type() is objectValue or nullValue\n      /// \\post if type() was nullValue, it remains nullValue\n      Members getMemberNames() const;\n\n//# ifdef JSON_USE_CPPTL\n//      EnumMemberNames enumMemberNames() const;\n//      EnumValues enumValues() const;\n//# endif\n\n      /// Comments must be //... or /* ... */\n      void setComment( const char *comment,\n                       CommentPlacement placement );\n      /// Comments must be //... or /* ... */\n      void setComment( const std::string &comment,\n                       CommentPlacement placement );\n      bool hasComment( CommentPlacement placement ) const;\n      /// Include delimiters and embedded newlines.\n      std::string getComment( CommentPlacement placement ) const;\n\n      std::string toStyledString() const;\n\n      const_iterator begin() const;\n      const_iterator end() const;\n\n      iterator begin();\n      iterator end();\n\n   private:\n      Value &resolveReference( const char *key, \n                               bool isStatic );\n\n# ifdef JSON_VALUE_USE_INTERNAL_MAP\n      inline bool isItemAvailable() const\n      {\n         return itemIsUsed_ == 0;\n      }\n\n      inline void setItemUsed( bool isUsed = true )\n      {\n         itemIsUsed_ = isUsed ? 1 : 0;\n      }\n\n      inline bool isMemberNameStatic() const\n      {\n         return memberNameIsStatic_ == 0;\n      }\n\n      inline void setMemberNameIsStatic( bool isStatic )\n      {\n         memberNameIsStatic_ = isStatic ? 1 : 0;\n      }\n# endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP\n\n   private:\n      struct CommentInfo\n      {\n         CommentInfo();\n         ~CommentInfo();\n\n         void setComment( const char *text );\n\n         char *comment_;\n      };\n\n      //struct MemberNamesTransform\n      //{\n      //   typedef const char *result_type;\n      //   const char *operator()( const CZString &name ) const\n      //   {\n      //      return name.c_str();\n      //   }\n      //};\n\n      union ValueHolder\n      {\n         Int int_;\n         UInt uint_;\n         double real_;\n         bool bool_;\n         char *string_;\n# ifdef JSON_VALUE_USE_INTERNAL_MAP\n         ValueInternalArray *array_;\n         ValueInternalMap *map_;\n#else\n         ObjectValues *map_;\n# endif\n      } value_;\n      ValueType type_ : 8;\n      int allocated_ : 1;     // Notes: if declared as bool, bitfield is useless.\n# ifdef JSON_VALUE_USE_INTERNAL_MAP\n      unsigned int itemIsUsed_ : 1;      // used by the ValueInternalMap container.\n      int memberNameIsStatic_ : 1;       // used by the ValueInternalMap container.\n# endif\n      CommentInfo *comments_;\n   };\n\n\n   /** \\brief Experimental and untested: represents an element of the \"path\" to access a node.\n    */\n   class PathArgument\n   {\n   public:\n      friend class Path;\n\n      PathArgument();\n      PathArgument( UInt index );\n      PathArgument( const char *key );\n      PathArgument( const std::string &key );\n\n   private:\n      enum Kind\n      {\n         kindNone = 0,\n         kindIndex,\n         kindKey\n      };\n      std::string key_;\n      UInt index_;\n      Kind kind_;\n   };\n\n   /** \\brief Experimental and untested: represents a \"path\" to access a node.\n    *\n    * Syntax:\n    * - \".\" => root node\n    * - \".[n]\" => elements at index 'n' of root node (an array value)\n    * - \".name\" => member named 'name' of root node (an object value)\n    * - \".name1.name2.name3\"\n    * - \".[0][1][2].name1[3]\"\n    * - \".%\" => member name is provided as parameter\n    * - \".[%]\" => index is provied as parameter\n    */\n   class Path\n   {\n   public:\n      Path( const std::string &path,\n            const PathArgument &a1 = PathArgument(),\n            const PathArgument &a2 = PathArgument(),\n            const PathArgument &a3 = PathArgument(),\n            const PathArgument &a4 = PathArgument(),\n            const PathArgument &a5 = PathArgument() );\n\n      const Value &resolve( const Value &root ) const;\n      Value resolve( const Value &root, \n                     const Value &defaultValue ) const;\n      /// Creates the \"path\" to access the specified node and returns a reference on the node.\n      Value &make( Value &root ) const;\n\n   private:\n      typedef std::vector<const PathArgument *> InArgs;\n      typedef std::vector<PathArgument> Args;\n\n      void makePath( const std::string &path,\n                     const InArgs &in );\n      void addPathInArg( const std::string &path, \n                         const InArgs &in, \n                         InArgs::const_iterator &itInArg, \n                         PathArgument::Kind kind );\n      void invalidPath( const std::string &path, \n                        int location );\n\n      Args args_;\n   };\n\n   /** \\brief Experimental do not use: Allocator to customize member name and string value memory management done by Value.\n    *\n    * - makeMemberName() and releaseMemberName() are called to respectively duplicate and\n    *   free an Json::objectValue member name.\n    * - duplicateStringValue() and releaseStringValue() are called similarly to\n    *   duplicate and free a Json::stringValue value.\n    */\n   class ValueAllocator\n   {\n   public:\n      enum { unknown = (unsigned)-1 };\n\n      virtual ~ValueAllocator();\n\n      virtual char *makeMemberName( const char *memberName ) = 0;\n      virtual void releaseMemberName( char *memberName ) = 0;\n      virtual char *duplicateStringValue( const char *value, \n                                          unsigned int length = unknown ) = 0;\n      virtual void releaseStringValue( char *value ) = 0;\n   };\n\n#ifdef JSON_VALUE_USE_INTERNAL_MAP\n   /** \\brief Allocator to customize Value internal map.\n    * Below is an example of a simple implementation (default implementation actually\n    * use memory pool for speed).\n    * \\code\n      class DefaultValueMapAllocator : public ValueMapAllocator\n      {\n      public: // overridden from ValueMapAllocator\n         virtual ValueInternalMap *newMap()\n         {\n            return new ValueInternalMap();\n         }\n\n         virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other )\n         {\n            return new ValueInternalMap( other );\n         }\n\n         virtual void destructMap( ValueInternalMap *map )\n         {\n            delete map;\n         }\n\n         virtual ValueInternalLink *allocateMapBuckets( unsigned int size )\n         {\n            return new ValueInternalLink[size];\n         }\n\n         virtual void releaseMapBuckets( ValueInternalLink *links )\n         {\n            delete [] links;\n         }\n\n         virtual ValueInternalLink *allocateMapLink()\n         {\n            return new ValueInternalLink();\n         }\n\n         virtual void releaseMapLink( ValueInternalLink *link )\n         {\n            delete link;\n         }\n      };\n    * \\endcode\n    */ \n   class JSON_API ValueMapAllocator\n   {\n   public:\n      virtual ~ValueMapAllocator();\n      virtual ValueInternalMap *newMap() = 0;\n      virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) = 0;\n      virtual void destructMap( ValueInternalMap *map ) = 0;\n      virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) = 0;\n      virtual void releaseMapBuckets( ValueInternalLink *links ) = 0;\n      virtual ValueInternalLink *allocateMapLink() = 0;\n      virtual void releaseMapLink( ValueInternalLink *link ) = 0;\n   };\n\n   /** \\brief ValueInternalMap hash-map bucket chain link (for internal use only).\n    * \\internal previous_ & next_ allows for bidirectional traversal.\n    */\n   class JSON_API ValueInternalLink\n   {\n   public:\n      enum { itemPerLink = 6 };  // sizeof(ValueInternalLink) = 128 on 32 bits architecture.\n      enum InternalFlags { \n         flagAvailable = 0,\n         flagUsed = 1\n      };\n\n      ValueInternalLink();\n\n      ~ValueInternalLink();\n\n      Value items_[itemPerLink];\n      char *keys_[itemPerLink];\n      ValueInternalLink *previous_;\n      ValueInternalLink *next_;\n   };\n\n\n   /** \\brief A linked page based hash-table implementation used internally by Value.\n    * \\internal ValueInternalMap is a tradional bucket based hash-table, with a linked\n    * list in each bucket to handle collision. There is an addional twist in that\n    * each node of the collision linked list is a page containing a fixed amount of\n    * value. This provides a better compromise between memory usage and speed.\n    * \n    * Each bucket is made up of a chained list of ValueInternalLink. The last\n    * link of a given bucket can be found in the 'previous_' field of the following bucket.\n    * The last link of the last bucket is stored in tailLink_ as it has no following bucket.\n    * Only the last link of a bucket may contains 'available' item. The last link always\n    * contains at least one element unless is it the bucket one very first link.\n    */\n   class JSON_API ValueInternalMap\n   {\n      friend class ValueIteratorBase;\n      friend class Value;\n   public:\n      typedef unsigned int HashKey;\n      typedef unsigned int BucketIndex;\n\n# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION\n      struct IteratorState\n      {\n         IteratorState() \n            : map_(0)\n            , link_(0)\n            , itemIndex_(0)\n            , bucketIndex_(0) \n         {\n         }\n         ValueInternalMap *map_;\n         ValueInternalLink *link_;\n         BucketIndex itemIndex_;\n         BucketIndex bucketIndex_;\n      };\n# endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION\n\n      ValueInternalMap();\n      ValueInternalMap( const ValueInternalMap &other );\n      ValueInternalMap &operator =( const ValueInternalMap &other );\n      ~ValueInternalMap();\n\n      void swap( ValueInternalMap &other );\n\n      BucketIndex size() const;\n\n      void clear();\n\n      bool reserveDelta( BucketIndex growth );\n\n      bool reserve( BucketIndex newItemCount );\n\n      const Value *find( const char *key ) const;\n\n      Value *find( const char *key );\n\n      Value &resolveReference( const char *key, \n                               bool isStatic );\n\n      void remove( const char *key );\n\n      void doActualRemove( ValueInternalLink *link, \n                           BucketIndex index,\n                           BucketIndex bucketIndex );\n\n      ValueInternalLink *&getLastLinkInBucket( BucketIndex bucketIndex );\n\n      Value &setNewItem( const char *key, \n                         bool isStatic, \n                         ValueInternalLink *link, \n                         BucketIndex index );\n\n      Value &unsafeAdd( const char *key, \n                        bool isStatic, \n                        HashKey hashedKey );\n\n      HashKey hash( const char *key ) const;\n\n      int compare( const ValueInternalMap &other ) const;\n\n   private:\n      void makeBeginIterator( IteratorState &it ) const;\n      void makeEndIterator( IteratorState &it ) const;\n      static bool equals( const IteratorState &x, const IteratorState &other );\n      static void increment( IteratorState &iterator );\n      static void incrementBucket( IteratorState &iterator );\n      static void decrement( IteratorState &iterator );\n      static const char *key( const IteratorState &iterator );\n      static const char *key( const IteratorState &iterator, bool &isStatic );\n      static Value &value( const IteratorState &iterator );\n      static int distance( const IteratorState &x, const IteratorState &y );\n\n   private:\n      ValueInternalLink *buckets_;\n      ValueInternalLink *tailLink_;\n      BucketIndex bucketsSize_;\n      BucketIndex itemCount_;\n   };\n\n   /** \\brief A simplified deque implementation used internally by Value.\n   * \\internal\n   * It is based on a list of fixed \"page\", each page contains a fixed number of items.\n   * Instead of using a linked-list, a array of pointer is used for fast item look-up.\n   * Look-up for an element is as follow:\n   * - compute page index: pageIndex = itemIndex / itemsPerPage\n   * - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage]\n   *\n   * Insertion is amortized constant time (only the array containing the index of pointers\n   * need to be reallocated when items are appended).\n   */\n   class JSON_API ValueInternalArray\n   {\n      friend class Value;\n      friend class ValueIteratorBase;\n   public:\n      enum { itemsPerPage = 8 };    // should be a power of 2 for fast divide and modulo.\n      typedef Value::ArrayIndex ArrayIndex;\n      typedef unsigned int PageIndex;\n\n# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION\n      struct IteratorState // Must be a POD\n      {\n         IteratorState() \n            : array_(0)\n            , currentPageIndex_(0)\n            , currentItemIndex_(0) \n         {\n         }\n         ValueInternalArray *array_;\n         Value **currentPageIndex_;\n         unsigned int currentItemIndex_;\n      };\n# endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION\n\n      ValueInternalArray();\n      ValueInternalArray( const ValueInternalArray &other );\n      ValueInternalArray &operator =( const ValueInternalArray &other );\n      ~ValueInternalArray();\n      void swap( ValueInternalArray &other );\n\n      void clear();\n      void resize( ArrayIndex newSize );\n\n      Value &resolveReference( ArrayIndex index );\n\n      Value *find( ArrayIndex index ) const;\n\n      ArrayIndex size() const;\n\n      int compare( const ValueInternalArray &other ) const;\n\n   private:\n      static bool equals( const IteratorState &x, const IteratorState &other );\n      static void increment( IteratorState &iterator );\n      static void decrement( IteratorState &iterator );\n      static Value &dereference( const IteratorState &iterator );\n      static Value &unsafeDereference( const IteratorState &iterator );\n      static int distance( const IteratorState &x, const IteratorState &y );\n      static ArrayIndex indexOf( const IteratorState &iterator );\n      void makeBeginIterator( IteratorState &it ) const;\n      void makeEndIterator( IteratorState &it ) const;\n      void makeIterator( IteratorState &it, ArrayIndex index ) const;\n\n      void makeIndexValid( ArrayIndex index );\n\n      Value **pages_;\n      ArrayIndex size_;\n      PageIndex pageCount_;\n   };\n\n   /** \\brief Experimental: do not use. Allocator to customize Value internal array.\n    * Below is an example of a simple implementation (actual implementation use\n    * memory pool).\n      \\code\nclass DefaultValueArrayAllocator : public ValueArrayAllocator\n{\npublic: // overridden from ValueArrayAllocator\n   virtual ~DefaultValueArrayAllocator()\n   {\n   }\n\n   virtual ValueInternalArray *newArray()\n   {\n      return new ValueInternalArray();\n   }\n\n   virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other )\n   {\n      return new ValueInternalArray( other );\n   }\n\n   virtual void destruct( ValueInternalArray *array )\n   {\n      delete array;\n   }\n\n   virtual void reallocateArrayPageIndex( Value **&indexes, \n                                          ValueInternalArray::PageIndex &indexCount,\n                                          ValueInternalArray::PageIndex minNewIndexCount )\n   {\n      ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1;\n      if ( minNewIndexCount > newIndexCount )\n         newIndexCount = minNewIndexCount;\n      void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount );\n      if ( !newIndexes )\n         throw std::bad_alloc();\n      indexCount = newIndexCount;\n      indexes = static_cast<Value **>( newIndexes );\n   }\n   virtual void releaseArrayPageIndex( Value **indexes, \n                                       ValueInternalArray::PageIndex indexCount )\n   {\n      if ( indexes )\n         free( indexes );\n   }\n\n   virtual Value *allocateArrayPage()\n   {\n      return static_cast<Value *>( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) );\n   }\n\n   virtual void releaseArrayPage( Value *value )\n   {\n      if ( value )\n         free( value );\n   }\n};\n      \\endcode\n    */ \n   class JSON_API ValueArrayAllocator\n   {\n   public:\n      virtual ~ValueArrayAllocator();\n      virtual ValueInternalArray *newArray() = 0;\n      virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) = 0;\n      virtual void destructArray( ValueInternalArray *array ) = 0;\n      /** \\brief Reallocate array page index.\n       * Reallocates an array of pointer on each page.\n       * \\param indexes [input] pointer on the current index. May be \\c NULL.\n       *                [output] pointer on the new index of at least \n       *                         \\a minNewIndexCount pages. \n       * \\param indexCount [input] current number of pages in the index.\n       *                   [output] number of page the reallocated index can handle.\n       *                            \\b MUST be >= \\a minNewIndexCount.\n       * \\param minNewIndexCount Minimum number of page the new index must be able to\n       *                         handle.\n       */\n      virtual void reallocateArrayPageIndex( Value **&indexes, \n                                             ValueInternalArray::PageIndex &indexCount,\n                                             ValueInternalArray::PageIndex minNewIndexCount ) = 0;\n      virtual void releaseArrayPageIndex( Value **indexes, \n                                          ValueInternalArray::PageIndex indexCount ) = 0;\n      virtual Value *allocateArrayPage() = 0;\n      virtual void releaseArrayPage( Value *value ) = 0;\n   };\n#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP\n\n\n   /** \\brief base class for Value iterators.\n    *\n    */\n   class ValueIteratorBase\n   {\n   public:\n      typedef unsigned int size_t;\n      typedef int difference_type;\n      typedef ValueIteratorBase SelfType;\n\n      ValueIteratorBase();\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n      explicit ValueIteratorBase( const Value::ObjectValues::iterator &current );\n#else\n      ValueIteratorBase( const ValueInternalArray::IteratorState &state );\n      ValueIteratorBase( const ValueInternalMap::IteratorState &state );\n#endif\n\n      bool operator ==( const SelfType &other ) const\n      {\n         return isEqual( other );\n      }\n\n      bool operator !=( const SelfType &other ) const\n      {\n         return !isEqual( other );\n      }\n\n      difference_type operator -( const SelfType &other ) const\n      {\n         return computeDistance( other );\n      }\n\n      /// Return either the index or the member name of the referenced value as a Value.\n      Value key() const;\n\n      /// Return the index of the referenced Value. -1 if it is not an arrayValue.\n      UInt index() const;\n\n      /// Return the member name of the referenced Value. \"\" if it is not an objectValue.\n      const char *memberName() const;\n\n   protected:\n      Value &deref() const;\n\n      void increment();\n\n      void decrement();\n\n      difference_type computeDistance( const SelfType &other ) const;\n\n      bool isEqual( const SelfType &other ) const;\n\n      void copy( const SelfType &other );\n\n   private:\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n      Value::ObjectValues::iterator current_;\n      // Indicates that iterator is for a null value.\n      bool isNull_;\n#else\n      union\n      {\n         ValueInternalArray::IteratorState array_;\n         ValueInternalMap::IteratorState map_;\n      } iterator_;\n      bool isArray_;\n#endif\n   };\n\n   /** \\brief const iterator for object and array value.\n    *\n    */\n   class ValueConstIterator : public ValueIteratorBase\n   {\n      friend class Value;\n   public:\n      typedef unsigned int size_t;\n      typedef int difference_type;\n      typedef const Value &reference;\n      typedef const Value *pointer;\n      typedef ValueConstIterator SelfType;\n\n      ValueConstIterator();\n   private:\n      /*! \\internal Use by Value to create an iterator.\n       */\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n      explicit ValueConstIterator( const Value::ObjectValues::iterator &current );\n#else\n      ValueConstIterator( const ValueInternalArray::IteratorState &state );\n      ValueConstIterator( const ValueInternalMap::IteratorState &state );\n#endif\n   public:\n      SelfType &operator =( const ValueIteratorBase &other );\n\n      SelfType operator++( int )\n      {\n         SelfType temp( *this );\n         ++*this;\n         return temp;\n      }\n\n      SelfType operator--( int )\n      {\n         SelfType temp( *this );\n         --*this;\n         return temp;\n      }\n\n      SelfType &operator--()\n      {\n         decrement();\n         return *this;\n      }\n\n      SelfType &operator++()\n      {\n         increment();\n         return *this;\n      }\n\n      reference operator *() const\n      {\n         return deref();\n      }\n   };\n\n\n   /** \\brief Iterator for object and array value.\n    */\n   class ValueIterator : public ValueIteratorBase\n   {\n      friend class Value;\n   public:\n      typedef unsigned int size_t;\n      typedef int difference_type;\n      typedef Value &reference;\n      typedef Value *pointer;\n      typedef ValueIterator SelfType;\n\n      ValueIterator();\n      ValueIterator( const ValueConstIterator &other );\n      ValueIterator( const ValueIterator &other );\n   private:\n      /*! \\internal Use by Value to create an iterator.\n       */\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n      explicit ValueIterator( const Value::ObjectValues::iterator &current );\n#else\n      ValueIterator( const ValueInternalArray::IteratorState &state );\n      ValueIterator( const ValueInternalMap::IteratorState &state );\n#endif\n   public:\n\n      SelfType &operator =( const SelfType &other );\n\n      SelfType operator++( int )\n      {\n         SelfType temp( *this );\n         ++*this;\n         return temp;\n      }\n\n      SelfType operator--( int )\n      {\n         SelfType temp( *this );\n         --*this;\n         return temp;\n      }\n\n      SelfType &operator--()\n      {\n         decrement();\n         return *this;\n      }\n\n      SelfType &operator++()\n      {\n         increment();\n         return *this;\n      }\n\n      reference operator *() const\n      {\n         return deref();\n      }\n   };\n\n\n} // namespace Json\n\n\n#endif // CPPTL_JSON_H_INCLUDED\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/include/json/writer.h",
    "content": "#ifndef JSON_WRITER_H_INCLUDED\n# define JSON_WRITER_H_INCLUDED\n\n# include \"value.h\"\n# include <vector>\n# include <string>\n# include <iostream>\n\nnamespace Json {\n\n   class Value;\n\n   /** \\brief Abstract class for writers.\n    */\n   class JSON_API Writer\n   {\n   public:\n      virtual ~Writer();\n\n      virtual std::string write( const Value &root ) = 0;\n   };\n\n   /** \\brief Outputs a Value in <a HREF=\"http://www.json.org\">JSON</a> format without formatting (not human friendly).\n    *\n    * The JSON document is written in a single line. It is not intended for 'human' consumption,\n    * but may be usefull to support feature such as RPC where bandwith is limited.\n    * \\sa Reader, Value\n    */\n   class JSON_API FastWriter : public Writer\n   {\n   public:\n      FastWriter();\n      virtual ~FastWriter(){}\n\n      void enableYAMLCompatibility();\n\n   public: // overridden from Writer\n      virtual std::string write( const Value &root );\n\n   private:\n      void writeValue( const Value &value );\n\n      std::string document_;\n      bool yamlCompatiblityEnabled_;\n   };\n\n   /** \\brief Writes a Value in <a HREF=\"http://www.json.org\">JSON</a> format in a human friendly way.\n    *\n    * The rules for line break and indent are as follow:\n    * - Object value:\n    *     - if empty then print {} without indent and line break\n    *     - if not empty the print '{', line break & indent, print one value per line\n    *       and then unindent and line break and print '}'.\n    * - Array value:\n    *     - if empty then print [] without indent and line break\n    *     - if the array contains no object value, empty array or some other value types,\n    *       and all the values fit on one lines, then print the array on a single line.\n    *     - otherwise, it the values do not fit on one line, or the array contains\n    *       object or non empty array, then print one value per line.\n    *\n    * If the Value have comments then they are outputed according to their #CommentPlacement.\n    *\n    * \\sa Reader, Value, Value::setComment()\n    */\n   class JSON_API StyledWriter: public Writer\n   {\n   public:\n      StyledWriter();\n      virtual ~StyledWriter(){}\n\n   public: // overridden from Writer\n      /** \\brief Serialize a Value in <a HREF=\"http://www.json.org\">JSON</a> format.\n       * \\param root Value to serialize.\n       * \\return String containing the JSON document that represents the root value.\n       */\n      virtual std::string write( const Value &root );\n\n   private:\n      void writeValue( const Value &value );\n      void writeArrayValue( const Value &value );\n      bool isMultineArray( const Value &value );\n      void pushValue( const std::string &value );\n      void writeIndent();\n      void writeWithIndent( const std::string &value );\n      void indent();\n      void unindent();\n      void writeCommentBeforeValue( const Value &root );\n      void writeCommentAfterValueOnSameLine( const Value &root );\n      bool hasCommentForValue( const Value &value );\n      static std::string normalizeEOL( const std::string &text );\n\n      typedef std::vector<std::string> ChildValues;\n\n      ChildValues childValues_;\n      std::string document_;\n      std::string indentString_;\n      int rightMargin_;\n      int indentSize_;\n      bool addChildValues_;\n   };\n\n   /** \\brief Writes a Value in <a HREF=\"http://www.json.org\">JSON</a> format in a human friendly way,\n        to a stream rather than to a string.\n    *\n    * The rules for line break and indent are as follow:\n    * - Object value:\n    *     - if empty then print {} without indent and line break\n    *     - if not empty the print '{', line break & indent, print one value per line\n    *       and then unindent and line break and print '}'.\n    * - Array value:\n    *     - if empty then print [] without indent and line break\n    *     - if the array contains no object value, empty array or some other value types,\n    *       and all the values fit on one lines, then print the array on a single line.\n    *     - otherwise, it the values do not fit on one line, or the array contains\n    *       object or non empty array, then print one value per line.\n    *\n    * If the Value have comments then they are outputed according to their #CommentPlacement.\n    *\n    * \\param indentation Each level will be indented by this amount extra.\n    * \\sa Reader, Value, Value::setComment()\n    */\n   class JSON_API StyledStreamWriter\n   {\n   public:\n      StyledStreamWriter( std::string indentation=\"\\t\" );\n      ~StyledStreamWriter(){}\n\n   public:\n      /** \\brief Serialize a Value in <a HREF=\"http://www.json.org\">JSON</a> format.\n       * \\param out Stream to write to. (Can be ostringstream, e.g.)\n       * \\param root Value to serialize.\n       * \\note There is no point in deriving from Writer, since write() should not return a value.\n       */\n      void write( std::ostream &out, const Value &root );\n\n   private:\n      void writeValue( const Value &value );\n      void writeArrayValue( const Value &value );\n      bool isMultineArray( const Value &value );\n      void pushValue( const std::string &value );\n      void writeIndent();\n      void writeWithIndent( const std::string &value );\n      void indent();\n      void unindent();\n      void writeCommentBeforeValue( const Value &root );\n      void writeCommentAfterValueOnSameLine( const Value &root );\n      bool hasCommentForValue( const Value &value );\n      static std::string normalizeEOL( const std::string &text );\n\n      typedef std::vector<std::string> ChildValues;\n\n      ChildValues childValues_;\n      std::ostream* document_;\n      std::string indentString_;\n      int rightMargin_;\n      std::string indentation_;\n      bool addChildValues_;\n   };\n\n   std::string JSON_API valueToString( Int value );\n   std::string JSON_API valueToString( UInt value );\n   std::string JSON_API valueToString( double value );\n   std::string JSON_API valueToString( bool value );\n   std::string JSON_API valueToQuotedString( const char *value );\n\n   /// \\brief Output using the StyledStreamWriter.\n   /// \\see Json::operator>>()\n   std::ostream& operator<<( std::ostream&, const Value &root );\n\n} // namespace Json\n\n\n\n#endif // JSON_WRITER_H_INCLUDED\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/src/jsontestrunner/main.cpp",
    "content": "#include <json/json.h>\n#include <algorithm> // sort\n#include <stdio.h>\n\n#if defined(_MSC_VER)  &&  _MSC_VER >= 1310\n# pragma warning( disable: 4996 )     // disable fopen deprecation warning\n#endif\n\nstatic std::string\nreadInputTestFile( const char *path )\n{\n   FILE *file = fopen( path, \"rb\" );\n   if ( !file )\n      return std::string(\"\");\n   fseek( file, 0, SEEK_END );\n   long size = ftell( file );\n   fseek( file, 0, SEEK_SET );\n   std::string text;\n   char *buffer = new char[size+1];\n   buffer[size] = 0;\n   if ( fread( buffer, 1, size, file ) == (unsigned long)size )\n      text = buffer;\n   fclose( file );\n   delete[] buffer;\n   return text;\n}\n\n\nstatic void\nprintValueTree( FILE *fout, Json::Value &value, const std::string &path = \".\" )\n{\n   switch ( value.type() )\n   {\n   case Json::nullValue:\n      fprintf( fout, \"%s=null\\n\", path.c_str() );\n      break;\n   case Json::intValue:\n      fprintf( fout, \"%s=%d\\n\", path.c_str(), value.asInt() );\n      break;\n   case Json::uintValue:\n      fprintf( fout, \"%s=%u\\n\", path.c_str(), value.asUInt() );\n      break;\n   case Json::realValue:\n      fprintf( fout, \"%s=%.16g\\n\", path.c_str(), value.asDouble() );\n      break;\n   case Json::stringValue:\n      fprintf( fout, \"%s=\\\"%s\\\"\\n\", path.c_str(), value.asString().c_str() );\n      break;\n   case Json::booleanValue:\n      fprintf( fout, \"%s=%s\\n\", path.c_str(), value.asBool() ? \"true\" : \"false\" );\n      break;\n   case Json::arrayValue:\n      {\n         fprintf( fout, \"%s=[]\\n\", path.c_str() );\n         int size = value.size();\n         for ( int index =0; index < size; ++index )\n         {\n            static char buffer[16];\n            sprintf( buffer, \"[%d]\", index );\n            printValueTree( fout, value[index], path + buffer );\n         }\n      }\n      break;\n   case Json::objectValue:\n      {\n         fprintf( fout, \"%s={}\\n\", path.c_str() );\n         Json::Value::Members members( value.getMemberNames() );\n         std::sort( members.begin(), members.end() );\n         std::string suffix = *(path.end()-1) == '.' ? \"\" : \".\";\n         for ( Json::Value::Members::iterator it = members.begin(); \n               it != members.end(); \n               ++it )\n         {\n            const std::string &name = *it;\n            printValueTree( fout, value[name], path + suffix + name );\n         }\n      }\n      break;\n   default:\n      break;\n   }\n}\n\n\nstatic int\nparseAndSaveValueTree( const std::string &input, \n                       const std::string &actual,\n                       const std::string &kind,\n                       Json::Value &root,\n                       const Json::Features &features,\n                       bool parseOnly )\n{\n   Json::Reader reader( features );\n   bool parsingSuccessful = reader.parse( input, root );\n   if ( !parsingSuccessful )\n   {\n      printf( \"Failed to parse %s file: \\n%s\\n\", \n              kind.c_str(),\n              reader.getFormatedErrorMessages().c_str() );\n      return 1;\n   }\n\n   if ( !parseOnly )\n   {\n      FILE *factual = fopen( actual.c_str(), \"wt\" );\n      if ( !factual )\n      {\n         printf( \"Failed to create %s actual file.\\n\", kind.c_str() );\n         return 2;\n      }\n      printValueTree( factual, root );\n      fclose( factual );\n   }\n   return 0;\n}\n\n\nstatic int\nrewriteValueTree( const std::string &rewritePath, \n                  const Json::Value &root, \n                  std::string &rewrite )\n{\n   //Json::FastWriter writer;\n   //writer.enableYAMLCompatibility();\n   Json::StyledWriter writer;\n   rewrite = writer.write( root );\n   FILE *fout = fopen( rewritePath.c_str(), \"wt\" );\n   if ( !fout )\n   {\n      printf( \"Failed to create rewrite file: %s\\n\", rewritePath.c_str() );\n      return 2;\n   }\n   fprintf( fout, \"%s\\n\", rewrite.c_str() );\n   fclose( fout );\n   return 0;\n}\n\n\nstatic std::string\nremoveSuffix( const std::string &path, \n              const std::string &extension )\n{\n   if ( extension.length() >= path.length() )\n      return std::string(\"\");\n   std::string suffix = path.substr( path.length() - extension.length() );\n   if ( suffix != extension )\n      return std::string(\"\");\n   return path.substr( 0, path.length() - extension.length() );\n}\n\nstatic int \nprintUsage( const char *argv[] )\n{\n   printf( \"Usage: %s [--strict] input-json-file\", argv[0] );\n   return 3;\n}\n\n\nint\nparseCommandLine( int argc, const char *argv[], \n                  Json::Features &features, std::string &path,\n                  bool &parseOnly )\n{\n   parseOnly = false;\n   if ( argc < 2 )\n   {\n      return printUsage( argv );\n   }\n\n   int index = 1;\n   if ( std::string(argv[1]) == \"--json-checker\" )\n   {\n      features = Json::Features::strictMode();\n      parseOnly = true;\n      ++index;\n   }\n\n   if ( index == argc  ||  index + 1 < argc )\n   {\n      return printUsage( argv );\n   }\n\n   path = argv[index];\n   return 0;\n}\n\n\nint main( int argc, const char *argv[] )\n{\n   std::string path;\n   Json::Features features;\n   bool parseOnly;\n   int exitCode = parseCommandLine( argc, argv, features, path, parseOnly );\n   if ( exitCode != 0 )\n   {\n      return exitCode;\n   }\n\n   std::string input = readInputTestFile( path.c_str() );\n   if ( input.empty() )\n   {\n      printf( \"Failed to read input or empty input: %s\\n\", path.c_str() );\n      return 3;\n   }\n\n   std::string basePath = removeSuffix( argv[1], \".json\" );\n   if ( !parseOnly  &&  basePath.empty() )\n   {\n      printf( \"Bad input path. Path does not end with '.expected':\\n%s\\n\", path.c_str() );\n      return 3;\n   }\n\n   std::string actualPath = basePath + \".actual\";\n   std::string rewritePath = basePath + \".rewrite\";\n   std::string rewriteActualPath = basePath + \".actual-rewrite\";\n\n   Json::Value root;\n   exitCode = parseAndSaveValueTree( input, actualPath, \"input\", root, features, parseOnly );\n   if ( exitCode == 0  &&  !parseOnly )\n   {\n      std::string rewrite;\n      exitCode = rewriteValueTree( rewritePath, root, rewrite );\n      if ( exitCode == 0 )\n      {\n         Json::Value rewriteRoot;\n         exitCode = parseAndSaveValueTree( rewrite, rewriteActualPath, \n            \"rewrite\", rewriteRoot, features, parseOnly );\n      }\n   }\n\n   return exitCode;\n}\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/src/jsontestrunner/sconscript",
    "content": "Import( 'env_testing buildJSONTests' )\n\nbuildJSONTests( env_testing, Split( \"\"\"\n    main.cpp\n     \"\"\" ),\n    'jsontestrunner' )\n\n# For 'check' to work, 'libs' must be built first.\nenv_testing.Depends('jsontestrunner', '#libs')\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/src/lib_json/json_batchallocator.h",
    "content": "#ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED\n# define JSONCPP_BATCHALLOCATOR_H_INCLUDED\n\n# include <stdlib.h>\n# include <assert.h>\n\n# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION\n\nnamespace Json {\n\n/* Fast memory allocator.\n *\n * This memory allocator allocates memory for a batch of object (specified by\n * the page size, the number of object in each page).\n *\n * It does not allow the destruction of a single object. All the allocated objects\n * can be destroyed at once. The memory can be either released or reused for future\n * allocation.\n * \n * The in-place new operator must be used to construct the object using the pointer\n * returned by allocate.\n */\ntemplate<typename AllocatedType\n        ,const unsigned int objectPerAllocation>\nclass BatchAllocator\n{\npublic:\n   typedef AllocatedType Type;\n\n   BatchAllocator( unsigned int objectsPerPage = 255 )\n      : freeHead_( 0 )\n      , objectsPerPage_( objectsPerPage )\n   {\n//      printf( \"Size: %d => %s\\n\", sizeof(AllocatedType), typeid(AllocatedType).name() );\n      assert( sizeof(AllocatedType) * objectPerAllocation >= sizeof(AllocatedType *) ); // We must be able to store a slist in the object free space.\n      assert( objectsPerPage >= 16 );\n      batches_ = allocateBatch( 0 );   // allocated a dummy page\n      currentBatch_ = batches_;\n   }\n\n   ~BatchAllocator()\n   {\n      for ( BatchInfo *batch = batches_; batch;  )\n      {\n         BatchInfo *nextBatch = batch->next_;\n         free( batch );\n         batch = nextBatch;\n      }\n   }\n\n   /// allocate space for an array of objectPerAllocation object.\n   /// @warning it is the responsability of the caller to call objects constructors.\n   AllocatedType *allocate()\n   {\n      if ( freeHead_ ) // returns node from free list.\n      {\n         AllocatedType *object = freeHead_;\n         freeHead_ = *(AllocatedType **)object;\n         return object;\n      }\n      if ( currentBatch_->used_ == currentBatch_->end_ )\n      {\n         currentBatch_ = currentBatch_->next_;\n         while ( currentBatch_  &&  currentBatch_->used_ == currentBatch_->end_ )\n            currentBatch_ = currentBatch_->next_;\n\n         if ( !currentBatch_  ) // no free batch found, allocate a new one\n         { \n            currentBatch_ = allocateBatch( objectsPerPage_ );\n            currentBatch_->next_ = batches_; // insert at the head of the list\n            batches_ = currentBatch_;\n         }\n      }\n      AllocatedType *allocated = currentBatch_->used_;\n      currentBatch_->used_ += objectPerAllocation;\n      return allocated;\n   }\n\n   /// Release the object.\n   /// @warning it is the responsability of the caller to actually destruct the object.\n   void release( AllocatedType *object )\n   {\n      assert( object != 0 );\n      *(AllocatedType **)object = freeHead_;\n      freeHead_ = object;\n   }\n\nprivate:\n   struct BatchInfo\n   {\n      BatchInfo *next_;\n      AllocatedType *used_;\n      AllocatedType *end_;\n      AllocatedType buffer_[objectPerAllocation];\n   };\n\n   // disabled copy constructor and assignement operator.\n   BatchAllocator( const BatchAllocator & );\n   void operator =( const BatchAllocator &);\n\n   static BatchInfo *allocateBatch( unsigned int objectsPerPage )\n   {\n      const unsigned int mallocSize = sizeof(BatchInfo) - sizeof(AllocatedType)* objectPerAllocation\n                                + sizeof(AllocatedType) * objectPerAllocation * objectsPerPage;\n      BatchInfo *batch = static_cast<BatchInfo*>( malloc( mallocSize ) );\n      batch->next_ = 0;\n      batch->used_ = batch->buffer_;\n      batch->end_ = batch->buffer_ + objectsPerPage;\n      return batch;\n   }\n\n   BatchInfo *batches_;\n   BatchInfo *currentBatch_;\n   /// Head of a single linked list within the allocated space of freeed object\n   AllocatedType *freeHead_;\n   unsigned int objectsPerPage_;\n};\n\n\n} // namespace Json\n\n# endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION\n\n#endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/src/lib_json/json_internalarray.inl",
    "content": "// included by json_value.cpp\n// everything is within Json namespace\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// class ValueInternalArray\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n\nValueArrayAllocator::~ValueArrayAllocator()\n{\n}\n\n// //////////////////////////////////////////////////////////////////\n// class DefaultValueArrayAllocator\n// //////////////////////////////////////////////////////////////////\n#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR\nclass DefaultValueArrayAllocator : public ValueArrayAllocator\n{\npublic: // overridden from ValueArrayAllocator\n   virtual ~DefaultValueArrayAllocator()\n   {\n   }\n\n   virtual ValueInternalArray *newArray()\n   {\n      return new ValueInternalArray();\n   }\n\n   virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other )\n   {\n      return new ValueInternalArray( other );\n   }\n\n   virtual void destructArray( ValueInternalArray *array )\n   {\n      delete array;\n   }\n\n   virtual void reallocateArrayPageIndex( Value **&indexes, \n                                          ValueInternalArray::PageIndex &indexCount,\n                                          ValueInternalArray::PageIndex minNewIndexCount )\n   {\n      ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1;\n      if ( minNewIndexCount > newIndexCount )\n         newIndexCount = minNewIndexCount;\n      void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount );\n      if ( !newIndexes )\n         throw std::bad_alloc();\n      indexCount = newIndexCount;\n      indexes = static_cast<Value **>( newIndexes );\n   }\n   virtual void releaseArrayPageIndex( Value **indexes, \n                                       ValueInternalArray::PageIndex indexCount )\n   {\n      if ( indexes )\n         free( indexes );\n   }\n\n   virtual Value *allocateArrayPage()\n   {\n      return static_cast<Value *>( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) );\n   }\n\n   virtual void releaseArrayPage( Value *value )\n   {\n      if ( value )\n         free( value );\n   }\n};\n\n#else // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR\n/// @todo make this thread-safe (lock when accessign batch allocator)\nclass DefaultValueArrayAllocator : public ValueArrayAllocator\n{\npublic: // overridden from ValueArrayAllocator\n   virtual ~DefaultValueArrayAllocator()\n   {\n   }\n\n   virtual ValueInternalArray *newArray()\n   {\n      ValueInternalArray *array = arraysAllocator_.allocate();\n      new (array) ValueInternalArray(); // placement new\n      return array;\n   }\n\n   virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other )\n   {\n      ValueInternalArray *array = arraysAllocator_.allocate();\n      new (array) ValueInternalArray( other ); // placement new\n      return array;\n   }\n\n   virtual void destructArray( ValueInternalArray *array )\n   {\n      if ( array )\n      {\n         array->~ValueInternalArray();\n         arraysAllocator_.release( array );\n      }\n   }\n\n   virtual void reallocateArrayPageIndex( Value **&indexes, \n                                          ValueInternalArray::PageIndex &indexCount,\n                                          ValueInternalArray::PageIndex minNewIndexCount )\n   {\n      ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1;\n      if ( minNewIndexCount > newIndexCount )\n         newIndexCount = minNewIndexCount;\n      void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount );\n      if ( !newIndexes )\n         throw std::bad_alloc();\n      indexCount = newIndexCount;\n      indexes = static_cast<Value **>( newIndexes );\n   }\n   virtual void releaseArrayPageIndex( Value **indexes, \n                                       ValueInternalArray::PageIndex indexCount )\n   {\n      if ( indexes )\n         free( indexes );\n   }\n\n   virtual Value *allocateArrayPage()\n   {\n      return static_cast<Value *>( pagesAllocator_.allocate() );\n   }\n\n   virtual void releaseArrayPage( Value *value )\n   {\n      if ( value )\n         pagesAllocator_.release( value );\n   }\nprivate:\n   BatchAllocator<ValueInternalArray,1> arraysAllocator_;\n   BatchAllocator<Value,ValueInternalArray::itemsPerPage> pagesAllocator_;\n};\n#endif // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR\n\nstatic ValueArrayAllocator *&arrayAllocator()\n{\n   static DefaultValueArrayAllocator defaultAllocator;\n   static ValueArrayAllocator *arrayAllocator = &defaultAllocator;\n   return arrayAllocator;\n}\n\nstatic struct DummyArrayAllocatorInitializer {\n   DummyArrayAllocatorInitializer() \n   {\n      arrayAllocator();      // ensure arrayAllocator() statics are initialized before main().\n   }\n} dummyArrayAllocatorInitializer;\n\n// //////////////////////////////////////////////////////////////////\n// class ValueInternalArray\n// //////////////////////////////////////////////////////////////////\nbool \nValueInternalArray::equals( const IteratorState &x, \n                            const IteratorState &other )\n{\n   return x.array_ == other.array_  \n          &&  x.currentItemIndex_ == other.currentItemIndex_  \n          &&  x.currentPageIndex_ == other.currentPageIndex_;\n}\n\n\nvoid \nValueInternalArray::increment( IteratorState &it )\n{\n   JSON_ASSERT_MESSAGE( it.array_  &&\n      (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_\n      != it.array_->size_,\n      \"ValueInternalArray::increment(): moving iterator beyond end\" );\n   ++(it.currentItemIndex_);\n   if ( it.currentItemIndex_ == itemsPerPage )\n   {\n      it.currentItemIndex_ = 0;\n      ++(it.currentPageIndex_);\n   }\n}\n\n\nvoid \nValueInternalArray::decrement( IteratorState &it )\n{\n   JSON_ASSERT_MESSAGE( it.array_  &&  it.currentPageIndex_ == it.array_->pages_ \n                        &&  it.currentItemIndex_ == 0,\n      \"ValueInternalArray::decrement(): moving iterator beyond end\" );\n   if ( it.currentItemIndex_ == 0 )\n   {\n      it.currentItemIndex_ = itemsPerPage-1;\n      --(it.currentPageIndex_);\n   }\n   else\n   {\n      --(it.currentItemIndex_);\n   }\n}\n\n\nValue &\nValueInternalArray::unsafeDereference( const IteratorState &it )\n{\n   return (*(it.currentPageIndex_))[it.currentItemIndex_];\n}\n\n\nValue &\nValueInternalArray::dereference( const IteratorState &it )\n{\n   JSON_ASSERT_MESSAGE( it.array_  &&\n      (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_\n      < it.array_->size_,\n      \"ValueInternalArray::dereference(): dereferencing invalid iterator\" );\n   return unsafeDereference( it );\n}\n\nvoid \nValueInternalArray::makeBeginIterator( IteratorState &it ) const\n{\n   it.array_ = const_cast<ValueInternalArray *>( this );\n   it.currentItemIndex_ = 0;\n   it.currentPageIndex_ = pages_;\n}\n\n\nvoid \nValueInternalArray::makeIterator( IteratorState &it, ArrayIndex index ) const\n{\n   it.array_ = const_cast<ValueInternalArray *>( this );\n   it.currentItemIndex_ = index % itemsPerPage;\n   it.currentPageIndex_ = pages_ + index / itemsPerPage;\n}\n\n\nvoid \nValueInternalArray::makeEndIterator( IteratorState &it ) const\n{\n   makeIterator( it, size_ );\n}\n\n\nValueInternalArray::ValueInternalArray()\n   : pages_( 0 )\n   , size_( 0 )\n   , pageCount_( 0 )\n{\n}\n\n\nValueInternalArray::ValueInternalArray( const ValueInternalArray &other )\n   : pages_( 0 )\n   , pageCount_( 0 )\n   , size_( other.size_ )\n{\n   PageIndex minNewPages = other.size_ / itemsPerPage;\n   arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages );\n   JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, \n                        \"ValueInternalArray::reserve(): bad reallocation\" );\n   IteratorState itOther;\n   other.makeBeginIterator( itOther );\n   Value *value;\n   for ( ArrayIndex index = 0; index < size_; ++index, increment(itOther) )\n   {\n      if ( index % itemsPerPage == 0 )\n      {\n         PageIndex pageIndex = index / itemsPerPage;\n         value = arrayAllocator()->allocateArrayPage();\n         pages_[pageIndex] = value;\n      }\n      new (value) Value( dereference( itOther ) );\n   }\n}\n\n\nValueInternalArray &\nValueInternalArray::operator =( const ValueInternalArray &other )\n{\n   ValueInternalArray temp( other );\n   swap( temp );\n   return *this;\n}\n\n\nValueInternalArray::~ValueInternalArray()\n{\n   // destroy all constructed items\n   IteratorState it;\n   IteratorState itEnd;\n   makeBeginIterator( it);\n   makeEndIterator( itEnd );\n   for ( ; !equals(it,itEnd); increment(it) )\n   {\n      Value *value = &dereference(it);\n      value->~Value();\n   }\n   // release all pages\n   PageIndex lastPageIndex = size_ / itemsPerPage;\n   for ( PageIndex pageIndex = 0; pageIndex < lastPageIndex; ++pageIndex )\n      arrayAllocator()->releaseArrayPage( pages_[pageIndex] );\n   // release pages index\n   arrayAllocator()->releaseArrayPageIndex( pages_, pageCount_ );\n}\n\n\nvoid \nValueInternalArray::swap( ValueInternalArray &other )\n{\n   Value **tempPages = pages_;\n   pages_ = other.pages_;\n   other.pages_ = tempPages;\n   ArrayIndex tempSize = size_;\n   size_ = other.size_;\n   other.size_ = tempSize;\n   PageIndex tempPageCount = pageCount_;\n   pageCount_ = other.pageCount_;\n   other.pageCount_ = tempPageCount;\n}\n\nvoid \nValueInternalArray::clear()\n{\n   ValueInternalArray dummy;\n   swap( dummy );\n}\n\n\nvoid \nValueInternalArray::resize( ArrayIndex newSize )\n{\n   if ( newSize == 0 )\n      clear();\n   else if ( newSize < size_ )\n   {\n      IteratorState it;\n      IteratorState itEnd;\n      makeIterator( it, newSize );\n      makeIterator( itEnd, size_ );\n      for ( ; !equals(it,itEnd); increment(it) )\n      {\n         Value *value = &dereference(it);\n         value->~Value();\n      }\n      PageIndex pageIndex = (newSize + itemsPerPage - 1) / itemsPerPage;\n      PageIndex lastPageIndex = size_ / itemsPerPage;\n      for ( ; pageIndex < lastPageIndex; ++pageIndex )\n         arrayAllocator()->releaseArrayPage( pages_[pageIndex] );\n      size_ = newSize;\n   }\n   else if ( newSize > size_ )\n      resolveReference( newSize );\n}\n\n\nvoid \nValueInternalArray::makeIndexValid( ArrayIndex index )\n{\n   // Need to enlarge page index ?\n   if ( index >= pageCount_ * itemsPerPage )\n   {\n      PageIndex minNewPages = (index + 1) / itemsPerPage;\n      arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages );\n      JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, \"ValueInternalArray::reserve(): bad reallocation\" );\n   }\n\n   // Need to allocate new pages ?\n   ArrayIndex nextPageIndex = \n      (size_ % itemsPerPage) != 0 ? size_ - (size_%itemsPerPage) + itemsPerPage\n                                  : size_;\n   if ( nextPageIndex <= index )\n   {\n      PageIndex pageIndex = nextPageIndex / itemsPerPage;\n      PageIndex pageToAllocate = (index - nextPageIndex) / itemsPerPage + 1;\n      for ( ; pageToAllocate-- > 0; ++pageIndex )\n         pages_[pageIndex] = arrayAllocator()->allocateArrayPage();\n   }\n\n   // Initialize all new entries\n   IteratorState it;\n   IteratorState itEnd;\n   makeIterator( it, size_ );\n   size_ = index + 1;\n   makeIterator( itEnd, size_ );\n   for ( ; !equals(it,itEnd); increment(it) )\n   {\n      Value *value = &dereference(it);\n      new (value) Value(); // Construct a default value using placement new\n   }\n}\n\nValue &\nValueInternalArray::resolveReference( ArrayIndex index )\n{\n   if ( index >= size_ )\n      makeIndexValid( index );\n   return pages_[index/itemsPerPage][index%itemsPerPage];\n}\n\nValue *\nValueInternalArray::find( ArrayIndex index ) const\n{\n   if ( index >= size_ )\n      return 0;\n   return &(pages_[index/itemsPerPage][index%itemsPerPage]);\n}\n\nValueInternalArray::ArrayIndex \nValueInternalArray::size() const\n{\n   return size_;\n}\n\nint \nValueInternalArray::distance( const IteratorState &x, const IteratorState &y )\n{\n   return indexOf(y) - indexOf(x);\n}\n\n\nValueInternalArray::ArrayIndex \nValueInternalArray::indexOf( const IteratorState &iterator )\n{\n   if ( !iterator.array_ )\n      return ArrayIndex(-1);\n   return ArrayIndex(\n      (iterator.currentPageIndex_ - iterator.array_->pages_) * itemsPerPage \n      + iterator.currentItemIndex_ );\n}\n\n\nint \nValueInternalArray::compare( const ValueInternalArray &other ) const\n{\n   int sizeDiff( size_ - other.size_ );\n   if ( sizeDiff != 0 )\n      return sizeDiff;\n   \n   for ( ArrayIndex index =0; index < size_; ++index )\n   {\n      int diff = pages_[index/itemsPerPage][index%itemsPerPage].compare( \n         other.pages_[index/itemsPerPage][index%itemsPerPage] );\n      if ( diff != 0 )\n         return diff;\n   }\n   return 0;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/src/lib_json/json_internalmap.inl",
    "content": "// included by json_value.cpp\n// everything is within Json namespace\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// class ValueInternalMap\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n\n/** \\internal MUST be safely initialized using memset( this, 0, sizeof(ValueInternalLink) );\n   * This optimization is used by the fast allocator.\n   */\nValueInternalLink::ValueInternalLink()\n   : previous_( 0 )\n   , next_( 0 )\n{\n}\n\nValueInternalLink::~ValueInternalLink()\n{ \n   for ( int index =0; index < itemPerLink; ++index )\n   {\n      if ( !items_[index].isItemAvailable() )\n      {\n         if ( !items_[index].isMemberNameStatic() )\n            free( keys_[index] );\n      }\n      else\n         break;\n   }\n}\n\n\n\nValueMapAllocator::~ValueMapAllocator()\n{\n}\n\n#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR\nclass DefaultValueMapAllocator : public ValueMapAllocator\n{\npublic: // overridden from ValueMapAllocator\n   virtual ValueInternalMap *newMap()\n   {\n      return new ValueInternalMap();\n   }\n\n   virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other )\n   {\n      return new ValueInternalMap( other );\n   }\n\n   virtual void destructMap( ValueInternalMap *map )\n   {\n      delete map;\n   }\n\n   virtual ValueInternalLink *allocateMapBuckets( unsigned int size )\n   {\n      return new ValueInternalLink[size];\n   }\n\n   virtual void releaseMapBuckets( ValueInternalLink *links )\n   {\n      delete [] links;\n   }\n\n   virtual ValueInternalLink *allocateMapLink()\n   {\n      return new ValueInternalLink();\n   }\n\n   virtual void releaseMapLink( ValueInternalLink *link )\n   {\n      delete link;\n   }\n};\n#else\n/// @todo make this thread-safe (lock when accessign batch allocator)\nclass DefaultValueMapAllocator : public ValueMapAllocator\n{\npublic: // overridden from ValueMapAllocator\n   virtual ValueInternalMap *newMap()\n   {\n      ValueInternalMap *map = mapsAllocator_.allocate();\n      new (map) ValueInternalMap(); // placement new\n      return map;\n   }\n\n   virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other )\n   {\n      ValueInternalMap *map = mapsAllocator_.allocate();\n      new (map) ValueInternalMap( other ); // placement new\n      return map;\n   }\n\n   virtual void destructMap( ValueInternalMap *map )\n   {\n      if ( map )\n      {\n         map->~ValueInternalMap();\n         mapsAllocator_.release( map );\n      }\n   }\n\n   virtual ValueInternalLink *allocateMapBuckets( unsigned int size )\n   {\n      return new ValueInternalLink[size];\n   }\n\n   virtual void releaseMapBuckets( ValueInternalLink *links )\n   {\n      delete [] links;\n   }\n\n   virtual ValueInternalLink *allocateMapLink()\n   {\n      ValueInternalLink *link = linksAllocator_.allocate();\n      memset( link, 0, sizeof(ValueInternalLink) );\n      return link;\n   }\n\n   virtual void releaseMapLink( ValueInternalLink *link )\n   {\n      link->~ValueInternalLink();\n      linksAllocator_.release( link );\n   }\nprivate:\n   BatchAllocator<ValueInternalMap,1> mapsAllocator_;\n   BatchAllocator<ValueInternalLink,1> linksAllocator_;\n};\n#endif\n\nstatic ValueMapAllocator *&mapAllocator()\n{\n   static DefaultValueMapAllocator defaultAllocator;\n   static ValueMapAllocator *mapAllocator = &defaultAllocator;\n   return mapAllocator;\n}\n\nstatic struct DummyMapAllocatorInitializer {\n   DummyMapAllocatorInitializer() \n   {\n      mapAllocator();      // ensure mapAllocator() statics are initialized before main().\n   }\n} dummyMapAllocatorInitializer;\n\n\n\n// h(K) = value * K >> w ; with w = 32 & K prime w.r.t. 2^32.\n\n/*\nuse linked list hash map. \nbuckets array is a container.\nlinked list element contains 6 key/values. (memory = (16+4) * 6 + 4 = 124)\nvalue have extra state: valid, available, deleted\n*/\n\n\nValueInternalMap::ValueInternalMap()\n   : buckets_( 0 )\n   , tailLink_( 0 )\n   , bucketsSize_( 0 )\n   , itemCount_( 0 )\n{\n}\n\n\nValueInternalMap::ValueInternalMap( const ValueInternalMap &other )\n   : buckets_( 0 )\n   , tailLink_( 0 )\n   , bucketsSize_( 0 )\n   , itemCount_( 0 )\n{\n   reserve( other.itemCount_ );\n   IteratorState it;\n   IteratorState itEnd;\n   other.makeBeginIterator( it );\n   other.makeEndIterator( itEnd );\n   for ( ; !equals(it,itEnd); increment(it) )\n   {\n      bool isStatic;\n      const char *memberName = key( it, isStatic );\n      const Value &aValue = value( it );\n      resolveReference(memberName, isStatic) = aValue;\n   }\n}\n\n\nValueInternalMap &\nValueInternalMap::operator =( const ValueInternalMap &other )\n{\n   ValueInternalMap dummy( other );\n   swap( dummy );\n   return *this;\n}\n\n\nValueInternalMap::~ValueInternalMap()\n{\n   if ( buckets_ )\n   {\n      for ( BucketIndex bucketIndex =0; bucketIndex < bucketsSize_; ++bucketIndex )\n      {\n         ValueInternalLink *link = buckets_[bucketIndex].next_;\n         while ( link )\n         {\n            ValueInternalLink *linkToRelease = link;\n            link = link->next_;\n            mapAllocator()->releaseMapLink( linkToRelease );\n         }\n      }\n      mapAllocator()->releaseMapBuckets( buckets_ );\n   }\n}\n\n\nvoid \nValueInternalMap::swap( ValueInternalMap &other )\n{\n   ValueInternalLink *tempBuckets = buckets_;\n   buckets_ = other.buckets_;\n   other.buckets_ = tempBuckets;\n   ValueInternalLink *tempTailLink = tailLink_;\n   tailLink_ = other.tailLink_;\n   other.tailLink_ = tempTailLink;\n   BucketIndex tempBucketsSize = bucketsSize_;\n   bucketsSize_ = other.bucketsSize_;\n   other.bucketsSize_ = tempBucketsSize;\n   BucketIndex tempItemCount = itemCount_;\n   itemCount_ = other.itemCount_;\n   other.itemCount_ = tempItemCount;\n}\n\n\nvoid \nValueInternalMap::clear()\n{\n   ValueInternalMap dummy;\n   swap( dummy );\n}\n\n\nValueInternalMap::BucketIndex \nValueInternalMap::size() const\n{\n   return itemCount_;\n}\n\nbool \nValueInternalMap::reserveDelta( BucketIndex growth )\n{\n   return reserve( itemCount_ + growth );\n}\n\nbool \nValueInternalMap::reserve( BucketIndex newItemCount )\n{\n   if ( !buckets_  &&  newItemCount > 0 )\n   {\n      buckets_ = mapAllocator()->allocateMapBuckets( 1 );\n      bucketsSize_ = 1;\n      tailLink_ = &buckets_[0];\n   }\n//   BucketIndex idealBucketCount = (newItemCount + ValueInternalLink::itemPerLink) / ValueInternalLink::itemPerLink;\n   return true;\n}\n\n\nconst Value *\nValueInternalMap::find( const char *key ) const\n{\n   if ( !bucketsSize_ )\n      return 0;\n   HashKey hashedKey = hash( key );\n   BucketIndex bucketIndex = hashedKey % bucketsSize_;\n   for ( const ValueInternalLink *current = &buckets_[bucketIndex]; \n         current != 0; \n         current = current->next_ )\n   {\n      for ( BucketIndex index=0; index < ValueInternalLink::itemPerLink; ++index )\n      {\n         if ( current->items_[index].isItemAvailable() )\n            return 0;\n         if ( strcmp( key, current->keys_[index] ) == 0 )\n            return &current->items_[index];\n      }\n   }\n   return 0;\n}\n\n\nValue *\nValueInternalMap::find( const char *key )\n{\n   const ValueInternalMap *constThis = this;\n   return const_cast<Value *>( constThis->find( key ) );\n}\n\n\nValue &\nValueInternalMap::resolveReference( const char *key,\n                                    bool isStatic )\n{\n   HashKey hashedKey = hash( key );\n   if ( bucketsSize_ )\n   {\n      BucketIndex bucketIndex = hashedKey % bucketsSize_;\n      ValueInternalLink **previous = 0;\n      BucketIndex index;\n      for ( ValueInternalLink *current = &buckets_[bucketIndex]; \n            current != 0; \n            previous = &current->next_, current = current->next_ )\n      {\n         for ( index=0; index < ValueInternalLink::itemPerLink; ++index )\n         {\n            if ( current->items_[index].isItemAvailable() )\n               return setNewItem( key, isStatic, current, index );\n            if ( strcmp( key, current->keys_[index] ) == 0 )\n               return current->items_[index];\n         }\n      }\n   }\n\n   reserveDelta( 1 );\n   return unsafeAdd( key, isStatic, hashedKey );\n}\n\n\nvoid \nValueInternalMap::remove( const char *key )\n{\n   HashKey hashedKey = hash( key );\n   if ( !bucketsSize_ )\n      return;\n   BucketIndex bucketIndex = hashedKey % bucketsSize_;\n   for ( ValueInternalLink *link = &buckets_[bucketIndex]; \n         link != 0; \n         link = link->next_ )\n   {\n      BucketIndex index;\n      for ( index =0; index < ValueInternalLink::itemPerLink; ++index )\n      {\n         if ( link->items_[index].isItemAvailable() )\n            return;\n         if ( strcmp( key, link->keys_[index] ) == 0 )\n         {\n            doActualRemove( link, index, bucketIndex );\n            return;\n         }\n      }\n   }\n}\n\nvoid \nValueInternalMap::doActualRemove( ValueInternalLink *link, \n                                  BucketIndex index,\n                                  BucketIndex bucketIndex )\n{\n   // find last item of the bucket and swap it with the 'removed' one.\n   // set removed items flags to 'available'.\n   // if last page only contains 'available' items, then desallocate it (it's empty)\n   ValueInternalLink *&lastLink = getLastLinkInBucket( index );\n   BucketIndex lastItemIndex = 1; // a link can never be empty, so start at 1\n   for ( ;   \n         lastItemIndex < ValueInternalLink::itemPerLink; \n         ++lastItemIndex ) // may be optimized with dicotomic search\n   {\n      if ( lastLink->items_[lastItemIndex].isItemAvailable() )\n         break;\n   }\n   \n   BucketIndex lastUsedIndex = lastItemIndex - 1;\n   Value *valueToDelete = &link->items_[index];\n   Value *valueToPreserve = &lastLink->items_[lastUsedIndex];\n   if ( valueToDelete != valueToPreserve )\n      valueToDelete->swap( *valueToPreserve );\n   if ( lastUsedIndex == 0 )  // page is now empty\n   {  // remove it from bucket linked list and delete it.\n      ValueInternalLink *linkPreviousToLast = lastLink->previous_;\n      if ( linkPreviousToLast != 0 )   // can not deleted bucket link.\n      {\n         mapAllocator()->releaseMapLink( lastLink );\n         linkPreviousToLast->next_ = 0;\n         lastLink = linkPreviousToLast;\n      }\n   }\n   else\n   {\n      Value dummy;\n      valueToPreserve->swap( dummy ); // restore deleted to default Value.\n      valueToPreserve->setItemUsed( false );\n   }\n   --itemCount_;\n}\n\n\nValueInternalLink *&\nValueInternalMap::getLastLinkInBucket( BucketIndex bucketIndex )\n{\n   if ( bucketIndex == bucketsSize_ - 1 )\n      return tailLink_;\n   ValueInternalLink *&previous = buckets_[bucketIndex+1].previous_;\n   if ( !previous )\n      previous = &buckets_[bucketIndex];\n   return previous;\n}\n\n\nValue &\nValueInternalMap::setNewItem( const char *key, \n                              bool isStatic,\n                              ValueInternalLink *link, \n                              BucketIndex index )\n{\n   char *duplicatedKey = valueAllocator()->makeMemberName( key );\n   ++itemCount_;\n   link->keys_[index] = duplicatedKey;\n   link->items_[index].setItemUsed();\n   link->items_[index].setMemberNameIsStatic( isStatic );\n   return link->items_[index]; // items already default constructed.\n}\n\n\nValue &\nValueInternalMap::unsafeAdd( const char *key, \n                             bool isStatic, \n                             HashKey hashedKey )\n{\n   JSON_ASSERT_MESSAGE( bucketsSize_ > 0, \"ValueInternalMap::unsafeAdd(): internal logic error.\" );\n   BucketIndex bucketIndex = hashedKey % bucketsSize_;\n   ValueInternalLink *&previousLink = getLastLinkInBucket( bucketIndex );\n   ValueInternalLink *link = previousLink;\n   BucketIndex index;\n   for ( index =0; index < ValueInternalLink::itemPerLink; ++index )\n   {\n      if ( link->items_[index].isItemAvailable() )\n         break;\n   }\n   if ( index == ValueInternalLink::itemPerLink ) // need to add a new page\n   {\n      ValueInternalLink *newLink = mapAllocator()->allocateMapLink();\n      index = 0;\n      link->next_ = newLink;\n      previousLink = newLink;\n      link = newLink;\n   }\n   return setNewItem( key, isStatic, link, index );\n}\n\n\nValueInternalMap::HashKey \nValueInternalMap::hash( const char *key ) const\n{\n   HashKey hash = 0;\n   while ( *key )\n      hash += *key++ * 37;\n   return hash;\n}\n\n\nint \nValueInternalMap::compare( const ValueInternalMap &other ) const\n{\n   int sizeDiff( itemCount_ - other.itemCount_ );\n   if ( sizeDiff != 0 )\n      return sizeDiff;\n   // Strict order guaranty is required. Compare all keys FIRST, then compare values.\n   IteratorState it;\n   IteratorState itEnd;\n   makeBeginIterator( it );\n   makeEndIterator( itEnd );\n   for ( ; !equals(it,itEnd); increment(it) )\n   {\n      if ( !other.find( key( it ) ) )\n         return 1;\n   }\n\n   // All keys are equals, let's compare values\n   makeBeginIterator( it );\n   for ( ; !equals(it,itEnd); increment(it) )\n   {\n      const Value *otherValue = other.find( key( it ) );\n      int valueDiff = value(it).compare( *otherValue );\n      if ( valueDiff != 0 )\n         return valueDiff;\n   }\n   return 0;\n}\n\n\nvoid \nValueInternalMap::makeBeginIterator( IteratorState &it ) const\n{\n   it.map_ = const_cast<ValueInternalMap *>( this );\n   it.bucketIndex_ = 0;\n   it.itemIndex_ = 0;\n   it.link_ = buckets_;\n}\n\n\nvoid \nValueInternalMap::makeEndIterator( IteratorState &it ) const\n{\n   it.map_ = const_cast<ValueInternalMap *>( this );\n   it.bucketIndex_ = bucketsSize_;\n   it.itemIndex_ = 0;\n   it.link_ = 0;\n}\n\n\nbool \nValueInternalMap::equals( const IteratorState &x, const IteratorState &other )\n{\n   return x.map_ == other.map_  \n          &&  x.bucketIndex_ == other.bucketIndex_  \n          &&  x.link_ == other.link_\n          &&  x.itemIndex_ == other.itemIndex_;\n}\n\n\nvoid \nValueInternalMap::incrementBucket( IteratorState &iterator )\n{\n   ++iterator.bucketIndex_;\n   JSON_ASSERT_MESSAGE( iterator.bucketIndex_ <= iterator.map_->bucketsSize_,\n      \"ValueInternalMap::increment(): attempting to iterate beyond end.\" );\n   if ( iterator.bucketIndex_ == iterator.map_->bucketsSize_ )\n      iterator.link_ = 0;\n   else\n      iterator.link_ = &(iterator.map_->buckets_[iterator.bucketIndex_]);\n   iterator.itemIndex_ = 0;\n}\n\n\nvoid \nValueInternalMap::increment( IteratorState &iterator )\n{\n   JSON_ASSERT_MESSAGE( iterator.map_, \"Attempting to iterator using invalid iterator.\" );\n   ++iterator.itemIndex_;\n   if ( iterator.itemIndex_ == ValueInternalLink::itemPerLink )\n   {\n      JSON_ASSERT_MESSAGE( iterator.link_ != 0,\n         \"ValueInternalMap::increment(): attempting to iterate beyond end.\" );\n      iterator.link_ = iterator.link_->next_;\n      if ( iterator.link_ == 0 )\n         incrementBucket( iterator );\n   }\n   else if ( iterator.link_->items_[iterator.itemIndex_].isItemAvailable() )\n   {\n      incrementBucket( iterator );\n   }\n}\n\n\nvoid \nValueInternalMap::decrement( IteratorState &iterator )\n{\n   if ( iterator.itemIndex_ == 0 )\n   {\n      JSON_ASSERT_MESSAGE( iterator.map_, \"Attempting to iterate using invalid iterator.\" );\n      if ( iterator.link_ == &iterator.map_->buckets_[iterator.bucketIndex_] )\n      {\n         JSON_ASSERT_MESSAGE( iterator.bucketIndex_ > 0, \"Attempting to iterate beyond beginning.\" );\n         --(iterator.bucketIndex_);\n      }\n      iterator.link_ = iterator.link_->previous_;\n      iterator.itemIndex_ = ValueInternalLink::itemPerLink - 1;\n   }\n}\n\n\nconst char *\nValueInternalMap::key( const IteratorState &iterator )\n{\n   JSON_ASSERT_MESSAGE( iterator.link_, \"Attempting to iterate using invalid iterator.\" );\n   return iterator.link_->keys_[iterator.itemIndex_];\n}\n\nconst char *\nValueInternalMap::key( const IteratorState &iterator, bool &isStatic )\n{\n   JSON_ASSERT_MESSAGE( iterator.link_, \"Attempting to iterate using invalid iterator.\" );\n   isStatic = iterator.link_->items_[iterator.itemIndex_].isMemberNameStatic();\n   return iterator.link_->keys_[iterator.itemIndex_];\n}\n\n\nValue &\nValueInternalMap::value( const IteratorState &iterator )\n{\n   JSON_ASSERT_MESSAGE( iterator.link_, \"Attempting to iterate using invalid iterator.\" );\n   return iterator.link_->items_[iterator.itemIndex_];\n}\n\n\nint \nValueInternalMap::distance( const IteratorState &x, const IteratorState &y )\n{\n   int offset = 0;\n   IteratorState it = x;\n   while ( !equals( it, y ) )\n      increment( it );\n   return offset;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/src/lib_json/json_reader.cpp",
    "content": "#include <json/reader.h>\n#include <json/value.h>\n#include <utility>\n#include <cstdio>\n#include <cassert>\n#include <cstring>\n#include <iostream>\n#include <stdexcept>\n\n#if _MSC_VER >= 1400 // VC++ 8.0\n#pragma warning( disable : 4996 )   // disable warning about strdup being deprecated.\n#endif\n\nnamespace Json {\n\n// Implementation of class Features\n// ////////////////////////////////\n\nFeatures::Features()\n   : allowComments_( true )\n   , strictRoot_( false )\n{\n}\n\n\nFeatures \nFeatures::all()\n{\n   return Features();\n}\n\n\nFeatures \nFeatures::strictMode()\n{\n   Features features;\n   features.allowComments_ = false;\n   features.strictRoot_ = true;\n   return features;\n}\n\n// Implementation of class Reader\n// ////////////////////////////////\n\n\nstatic inline bool \nin( Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4 )\n{\n   return c == c1  ||  c == c2  ||  c == c3  ||  c == c4;\n}\n\nstatic inline bool \nin( Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4, Reader::Char c5 )\n{\n   return c == c1  ||  c == c2  ||  c == c3  ||  c == c4  ||  c == c5;\n}\n\n\nstatic bool \ncontainsNewLine( Reader::Location begin, \n                 Reader::Location end )\n{\n   for ( ;begin < end; ++begin )\n      if ( *begin == '\\n'  ||  *begin == '\\r' )\n         return true;\n   return false;\n}\n\nstatic std::string codePointToUTF8(unsigned int cp)\n{\n   std::string result;\n   \n   // based on description from http://en.wikipedia.org/wiki/UTF-8\n\n   if (cp <= 0x7f) \n   {\n      result.resize(1);\n      result[0] = static_cast<char>(cp);\n   } \n   else if (cp <= 0x7FF) \n   {\n      result.resize(2);\n      result[1] = static_cast<char>(0x80 | (0x3f & cp));\n      result[0] = static_cast<char>(0xC0 | (0x1f & (cp >> 6)));\n   } \n   else if (cp <= 0xFFFF) \n   {\n      result.resize(3);\n      result[2] = static_cast<char>(0x80 | (0x3f & cp));\n      result[1] = 0x80 | static_cast<char>((0x3f & (cp >> 6)));\n      result[0] = 0xE0 | static_cast<char>((0xf & (cp >> 12)));\n   }\n   else if (cp <= 0x10FFFF) \n   {\n      result.resize(4);\n      result[3] = static_cast<char>(0x80 | (0x3f & cp));\n      result[2] = static_cast<char>(0x80 | (0x3f & (cp >> 6)));\n      result[1] = static_cast<char>(0x80 | (0x3f & (cp >> 12)));\n      result[0] = static_cast<char>(0xF0 | (0x7 & (cp >> 18)));\n   }\n\n   return result;\n}\n\n\n// Class Reader\n// //////////////////////////////////////////////////////////////////\n\nReader::Reader()\n   : features_( Features::all() )\n{\n}\n\n\nReader::Reader( const Features &features )\n   : features_( features )\n{\n}\n\n\nbool\nReader::parse( const std::string &document, \n               Value &root,\n               bool collectComments )\n{\n   document_ = document;\n   const char *begin = document_.c_str();\n   const char *end = begin + document_.length();\n   return parse( begin, end, root, collectComments );\n}\n\n\nbool\nReader::parse( std::istream& sin,\n               Value &root,\n               bool collectComments )\n{\n   //std::istream_iterator<char> begin(sin);\n   //std::istream_iterator<char> end;\n   // Those would allow streamed input from a file, if parse() were a\n   // template function.\n\n   // Since std::string is reference-counted, this at least does not\n   // create an extra copy.\n   std::string doc;\n   std::getline(sin, doc, (char)EOF);\n   return parse( doc, root, collectComments );\n}\n\nbool \nReader::parse( const char *beginDoc, const char *endDoc, \n               Value &root,\n               bool collectComments )\n{\n   if ( !features_.allowComments_ )\n   {\n      collectComments = false;\n   }\n\n   begin_ = beginDoc;\n   end_ = endDoc;\n   collectComments_ = collectComments;\n   current_ = begin_;\n   lastValueEnd_ = 0;\n   lastValue_ = 0;\n   commentsBefore_ = \"\";\n   errors_.clear();\n   while ( !nodes_.empty() )\n      nodes_.pop();\n   nodes_.push( &root );\n   \n   bool successful = readValue();\n   Token token;\n   skipCommentTokens( token );\n   if ( collectComments_  &&  !commentsBefore_.empty() )\n      root.setComment( commentsBefore_, commentAfter );\n   if ( features_.strictRoot_ )\n   {\n      if ( !root.isArray()  &&  !root.isObject() )\n      {\n         // Set error location to start of doc, ideally should be first token found in doc\n         token.type_ = tokenError;\n         token.start_ = beginDoc;\n         token.end_ = endDoc;\n         addError( \"A valid JSON document must be either an array or an object value.\",\n                   token );\n         return false;\n      }\n   }\n   return successful;\n}\n\n\nbool\nReader::readValue()\n{\n   Token token;\n   skipCommentTokens( token );\n   bool successful = true;\n\n   if ( collectComments_  &&  !commentsBefore_.empty() )\n   {\n      currentValue().setComment( commentsBefore_, commentBefore );\n      commentsBefore_ = \"\";\n   }\n\n\n   switch ( token.type_ )\n   {\n   case tokenObjectBegin:\n      successful = readObject( token );\n      break;\n   case tokenArrayBegin:\n      successful = readArray( token );\n      break;\n   case tokenNumber:\n      successful = decodeNumber( token );\n      break;\n   case tokenString:\n      successful = decodeString( token );\n      break;\n   case tokenTrue:\n      currentValue() = true;\n      break;\n   case tokenFalse:\n      currentValue() = false;\n      break;\n   case tokenNull:\n      currentValue() = Value();\n      break;\n   default:\n      return addError( \"Syntax error: value, object or array expected.\", token );\n   }\n\n   if ( collectComments_ )\n   {\n      lastValueEnd_ = current_;\n      lastValue_ = &currentValue();\n   }\n\n   return successful;\n}\n\n\nvoid \nReader::skipCommentTokens( Token &token )\n{\n   if ( features_.allowComments_ )\n   {\n      do\n      {\n         readToken( token );\n      }\n      while ( token.type_ == tokenComment );\n   }\n   else\n   {\n      readToken( token );\n   }\n}\n\n\nbool \nReader::expectToken( TokenType type, Token &token, const char *message )\n{\n   readToken( token );\n   if ( token.type_ != type )\n      return addError( message, token );\n   return true;\n}\n\n\nbool \nReader::readToken( Token &token )\n{\n   skipSpaces();\n   token.start_ = current_;\n   Char c = getNextChar();\n   bool ok = true;\n   switch ( c )\n   {\n   case '{':\n      token.type_ = tokenObjectBegin;\n      break;\n   case '}':\n      token.type_ = tokenObjectEnd;\n      break;\n   case '[':\n      token.type_ = tokenArrayBegin;\n      break;\n   case ']':\n      token.type_ = tokenArrayEnd;\n      break;\n   case '\"':\n      token.type_ = tokenString;\n      ok = readString();\n      break;\n   case '/':\n      token.type_ = tokenComment;\n      ok = readComment();\n      break;\n   case '0':\n   case '1':\n   case '2':\n   case '3':\n   case '4':\n   case '5':\n   case '6':\n   case '7':\n   case '8':\n   case '9':\n   case '-':\n      token.type_ = tokenNumber;\n      readNumber();\n      break;\n   case 't':\n      token.type_ = tokenTrue;\n      ok = match( \"rue\", 3 );\n      break;\n   case 'f':\n      token.type_ = tokenFalse;\n      ok = match( \"alse\", 4 );\n      break;\n   case 'n':\n      token.type_ = tokenNull;\n      ok = match( \"ull\", 3 );\n      break;\n   case ',':\n      token.type_ = tokenArraySeparator;\n      break;\n   case ':':\n      token.type_ = tokenMemberSeparator;\n      break;\n   case 0:\n      token.type_ = tokenEndOfStream;\n      break;\n   default:\n      ok = false;\n      break;\n   }\n   if ( !ok )\n      token.type_ = tokenError;\n   token.end_ = current_;\n   return true;\n}\n\n\nvoid \nReader::skipSpaces()\n{\n   while ( current_ != end_ )\n   {\n      Char c = *current_;\n      if ( c == ' '  ||  c == '\\t'  ||  c == '\\r'  ||  c == '\\n' )\n         ++current_;\n      else\n         break;\n   }\n}\n\n\nbool \nReader::match( Location pattern, \n               int patternLength )\n{\n   if ( end_ - current_ < patternLength )\n      return false;\n   int index = patternLength;\n   while ( index-- )\n      if ( current_[index] != pattern[index] )\n         return false;\n   current_ += patternLength;\n   return true;\n}\n\n\nbool\nReader::readComment()\n{\n   Location commentBegin = current_ - 1;\n   Char c = getNextChar();\n   bool successful = false;\n   if ( c == '*' )\n      successful = readCStyleComment();\n   else if ( c == '/' )\n      successful = readCppStyleComment();\n   if ( !successful )\n      return false;\n\n   if ( collectComments_ )\n   {\n      CommentPlacement placement = commentBefore;\n      if ( lastValueEnd_  &&  !containsNewLine( lastValueEnd_, commentBegin ) )\n      {\n         if ( c != '*'  ||  !containsNewLine( commentBegin, current_ ) )\n            placement = commentAfterOnSameLine;\n      }\n\n      addComment( commentBegin, current_, placement );\n   }\n   return true;\n}\n\n\nvoid \nReader::addComment( Location begin, \n                    Location end, \n                    CommentPlacement placement )\n{\n   assert( collectComments_ );\n   if ( placement == commentAfterOnSameLine )\n   {\n      assert( lastValue_ != 0 );\n      lastValue_->setComment( std::string( begin, end ), placement );\n   }\n   else\n   {\n      if ( !commentsBefore_.empty() )\n         commentsBefore_ += \"\\n\";\n      commentsBefore_ += std::string( begin, end );\n   }\n}\n\n\nbool \nReader::readCStyleComment()\n{\n   while ( current_ != end_ )\n   {\n      Char c = getNextChar();\n      if ( c == '*'  &&  *current_ == '/' )\n         break;\n   }\n   return getNextChar() == '/';\n}\n\n\nbool \nReader::readCppStyleComment()\n{\n   while ( current_ != end_ )\n   {\n      Char c = getNextChar();\n      if (  c == '\\r'  ||  c == '\\n' )\n         break;\n   }\n   return true;\n}\n\n\nvoid \nReader::readNumber()\n{\n   while ( current_ != end_ )\n   {\n      if ( !(*current_ >= '0'  &&  *current_ <= '9')  &&\n           !in( *current_, '.', 'e', 'E', '+', '-' ) )\n         break;\n      ++current_;\n   }\n}\n\nbool\nReader::readString()\n{\n   Char c = 0;\n   while ( current_ != end_ )\n   {\n      c = getNextChar();\n      if ( c == '\\\\' )\n         getNextChar();\n      else if ( c == '\"' )\n         break;\n   }\n   return c == '\"';\n}\n\n\nbool \nReader::readObject( Token &tokenStart )\n{\n   Token tokenName;\n   std::string name;\n   currentValue() = Value( objectValue );\n   while ( readToken( tokenName ) )\n   {\n      bool initialTokenOk = true;\n      while ( tokenName.type_ == tokenComment  &&  initialTokenOk )\n         initialTokenOk = readToken( tokenName );\n      if  ( !initialTokenOk )\n         break;\n      if ( tokenName.type_ == tokenObjectEnd  &&  name.empty() )  // empty object\n         return true;\n      if ( tokenName.type_ != tokenString )\n         break;\n      \n      name = \"\";\n      if ( !decodeString( tokenName, name ) )\n         return recoverFromError( tokenObjectEnd );\n\n      Token colon;\n      if ( !readToken( colon ) ||  colon.type_ != tokenMemberSeparator )\n      {\n         return addErrorAndRecover( \"Missing ':' after object member name\", \n                                    colon, \n                                    tokenObjectEnd );\n      }\n      Value &value = currentValue()[ name ];\n      nodes_.push( &value );\n      bool ok = readValue();\n      nodes_.pop();\n      if ( !ok ) // error already set\n         return recoverFromError( tokenObjectEnd );\n\n      Token comma;\n      if ( !readToken( comma )\n            ||  ( comma.type_ != tokenObjectEnd  &&  \n                  comma.type_ != tokenArraySeparator &&\n\t\t  comma.type_ != tokenComment ) )\n      {\n         return addErrorAndRecover( \"Missing ',' or '}' in object declaration\", \n                                    comma, \n                                    tokenObjectEnd );\n      }\n      bool finalizeTokenOk = true;\n      while ( comma.type_ == tokenComment &&\n              finalizeTokenOk )\n         finalizeTokenOk = readToken( comma );\n      if ( comma.type_ == tokenObjectEnd )\n         return true;\n   }\n   return addErrorAndRecover( \"Missing '}' or object member name\", \n                              tokenName, \n                              tokenObjectEnd );\n}\n\n\nbool \nReader::readArray( Token &tokenStart )\n{\n   currentValue() = Value( arrayValue );\n   skipSpaces();\n   if ( *current_ == ']' ) // empty array\n   {\n      Token endArray;\n      readToken( endArray );\n      return true;\n   }\n   int index = 0;\n   while ( true )\n   {\n      Value &value = currentValue()[ index++ ];\n      nodes_.push( &value );\n      bool ok = readValue();\n      nodes_.pop();\n      if ( !ok ) // error already set\n         return recoverFromError( tokenArrayEnd );\n\n      Token token;\n      // Accept Comment after last item in the array.\n      ok = readToken( token );\n      while ( token.type_ == tokenComment  &&  ok )\n      {\n         ok = readToken( token );\n      }\n      bool badTokenType = ( token.type_ == tokenArraySeparator  &&  \n                            token.type_ == tokenArrayEnd );\n      if ( !ok  ||  badTokenType )\n      {\n         return addErrorAndRecover( \"Missing ',' or ']' in array declaration\", \n                                    token, \n                                    tokenArrayEnd );\n      }\n      if ( token.type_ == tokenArrayEnd )\n         break;\n   }\n   return true;\n}\n\n\nbool \nReader::decodeNumber( Token &token )\n{\n   bool isDouble = false;\n   for ( Location inspect = token.start_; inspect != token.end_; ++inspect )\n   {\n      isDouble = isDouble  \n                 ||  in( *inspect, '.', 'e', 'E', '+' )  \n                 ||  ( *inspect == '-'  &&  inspect != token.start_ );\n   }\n   if ( isDouble )\n      return decodeDouble( token );\n   Location current = token.start_;\n   bool isNegative = *current == '-';\n   if ( isNegative )\n      ++current;\n   Value::UInt threshold = (isNegative ? Value::UInt(-Value::minInt) \n                                       : Value::maxUInt) / 10;\n   Value::UInt value = 0;\n   while ( current < token.end_ )\n   {\n      Char c = *current++;\n      if ( c < '0'  ||  c > '9' )\n         return addError( \"'\" + std::string( token.start_, token.end_ ) + \"' is not a number.\", token );\n      if ( value >= threshold )\n         return decodeDouble( token );\n      value = value * 10 + Value::UInt(c - '0');\n   }\n   if ( isNegative )\n      currentValue() = -Value::Int( value );\n   else if ( value <= Value::UInt(Value::maxInt) )\n      currentValue() = Value::Int( value );\n   else\n      currentValue() = value;\n   return true;\n}\n\n\nbool \nReader::decodeDouble( Token &token )\n{\n   double value = 0;\n   const int bufferSize = 32;\n   int count;\n   int length = int(token.end_ - token.start_);\n   if ( length <= bufferSize )\n   {\n      Char buffer[bufferSize];\n      memcpy( buffer, token.start_, length );\n      buffer[length] = 0;\n      count = sscanf( buffer, \"%lf\", &value );\n   }\n   else\n   {\n      std::string buffer( token.start_, token.end_ );\n      count = sscanf( buffer.c_str(), \"%lf\", &value );\n   }\n\n   if ( count != 1 )\n      return addError( \"'\" + std::string( token.start_, token.end_ ) + \"' is not a number.\", token );\n   currentValue() = value;\n   return true;\n}\n\n\nbool \nReader::decodeString( Token &token )\n{\n   std::string decoded;\n   if ( !decodeString( token, decoded ) )\n      return false;\n   currentValue() = decoded;\n   return true;\n}\n\n\nbool \nReader::decodeString( Token &token, std::string &decoded )\n{\n   decoded.reserve( token.end_ - token.start_ - 2 );\n   Location current = token.start_ + 1; // skip '\"'\n   Location end = token.end_ - 1;      // do not include '\"'\n   while ( current != end )\n   {\n      Char c = *current++;\n      if ( c == '\"' )\n         break;\n      else if ( c == '\\\\' )\n      {\n         if ( current == end )\n            return addError( \"Empty escape sequence in string\", token, current );\n         Char escape = *current++;\n         switch ( escape )\n         {\n         case '\"': decoded += '\"'; break;\n         case '/': decoded += '/'; break;\n         case '\\\\': decoded += '\\\\'; break;\n         case 'b': decoded += '\\b'; break;\n         case 'f': decoded += '\\f'; break;\n         case 'n': decoded += '\\n'; break;\n         case 'r': decoded += '\\r'; break;\n         case 't': decoded += '\\t'; break;\n         case 'u':\n            {\n               unsigned int unicode;\n               if ( !decodeUnicodeCodePoint( token, current, end, unicode ) )\n                  return false;\n               decoded += codePointToUTF8(unicode);\n            }\n            break;\n         default:\n            return addError( \"Bad escape sequence in string\", token, current );\n         }\n      }\n      else\n      {\n         decoded += c;\n      }\n   }\n   return true;\n}\n\nbool\nReader::decodeUnicodeCodePoint( Token &token, \n                                     Location &current, \n                                     Location end, \n                                     unsigned int &unicode )\n{\n\n   if ( !decodeUnicodeEscapeSequence( token, current, end, unicode ) )\n      return false;\n   if (unicode >= 0xD800 && unicode <= 0xDBFF)\n   {\n      // surrogate pairs\n      if (end - current < 6)\n         return addError( \"additional six characters expected to parse unicode surrogate pair.\", token, current );\n      unsigned int surrogatePair;\n      if (*(current++) == '\\\\' && *(current++)== 'u')\n      {\n         if (decodeUnicodeEscapeSequence( token, current, end, surrogatePair ))\n         {\n            unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF);\n         } \n         else\n            return false;\n      } \n      else\n         return addError( \"expecting another \\\\u token to begin the second half of a unicode surrogate pair\", token, current );\n   }\n   return true;\n}\n\nbool \nReader::decodeUnicodeEscapeSequence( Token &token, \n                                     Location &current, \n                                     Location end, \n                                     unsigned int &unicode )\n{\n   if ( end - current < 4 )\n      return addError( \"Bad unicode escape sequence in string: four digits expected.\", token, current );\n   unicode = 0;\n   for ( int index =0; index < 4; ++index )\n   {\n      Char c = *current++;\n      unicode *= 16;\n      if ( c >= '0'  &&  c <= '9' )\n         unicode += c - '0';\n      else if ( c >= 'a'  &&  c <= 'f' )\n         unicode += c - 'a' + 10;\n      else if ( c >= 'A'  &&  c <= 'F' )\n         unicode += c - 'A' + 10;\n      else\n         return addError( \"Bad unicode escape sequence in string: hexadecimal digit expected.\", token, current );\n   }\n   return true;\n}\n\n\nbool \nReader::addError( const std::string &message, \n                  Token &token,\n                  Location extra )\n{\n   ErrorInfo info;\n   info.token_ = token;\n   info.message_ = message;\n   info.extra_ = extra;\n   errors_.push_back( info );\n   return false;\n}\n\n\nbool \nReader::recoverFromError( TokenType skipUntilToken )\n{\n   int errorCount = int(errors_.size());\n   Token skip;\n   while ( true )\n   {\n      if ( !readToken(skip) )\n         errors_.resize( errorCount ); // discard errors caused by recovery\n      if ( skip.type_ == skipUntilToken  ||  skip.type_ == tokenEndOfStream )\n         break;\n   }\n   errors_.resize( errorCount );\n   return false;\n}\n\n\nbool \nReader::addErrorAndRecover( const std::string &message, \n                            Token &token,\n                            TokenType skipUntilToken )\n{\n   addError( message, token );\n   return recoverFromError( skipUntilToken );\n}\n\n\nValue &\nReader::currentValue()\n{\n   return *(nodes_.top());\n}\n\n\nReader::Char \nReader::getNextChar()\n{\n   if ( current_ == end_ )\n      return 0;\n   return *current_++;\n}\n\n\nvoid \nReader::getLocationLineAndColumn( Location location,\n                                  int &line,\n                                  int &column ) const\n{\n   Location current = begin_;\n   Location lastLineStart = current;\n   line = 0;\n   while ( current < location  &&  current != end_ )\n   {\n      Char c = *current++;\n      if ( c == '\\r' )\n      {\n         if ( *current == '\\n' )\n            ++current;\n         lastLineStart = current;\n         ++line;\n      }\n      else if ( c == '\\n' )\n      {\n         lastLineStart = current;\n         ++line;\n      }\n   }\n   // column & line start at 1\n   column = int(location - lastLineStart) + 1;\n   ++line;\n}\n\n\nstd::string\nReader::getLocationLineAndColumn( Location location ) const\n{\n   int line, column;\n   getLocationLineAndColumn( location, line, column );\n   char buffer[18+16+16+1];\n   sprintf( buffer, \"Line %d, Column %d\", line, column );\n   return buffer;\n}\n\n\nstd::string \nReader::getFormatedErrorMessages() const\n{\n   std::string formattedMessage;\n   for ( Errors::const_iterator itError = errors_.begin();\n         itError != errors_.end();\n         ++itError )\n   {\n      const ErrorInfo &error = *itError;\n      formattedMessage += \"* \" + getLocationLineAndColumn( error.token_.start_ ) + \"\\n\";\n      formattedMessage += \"  \" + error.message_ + \"\\n\";\n      if ( error.extra_ )\n         formattedMessage += \"See \" + getLocationLineAndColumn( error.extra_ ) + \" for detail.\\n\";\n   }\n   return formattedMessage;\n}\n\n\nstd::istream& operator>>( std::istream &sin, Value &root )\n{\n    Json::Reader reader;\n    bool ok = reader.parse(sin, root, true);\n    //JSON_ASSERT( ok );\n    if (!ok) throw std::runtime_error(reader.getFormatedErrorMessages());\n    return sin;\n}\n\n\n} // namespace Json\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/src/lib_json/json_value.cpp",
    "content": "#include <iostream>\n#include <json/value.h>\n#include <json/writer.h>\n#include <utility>\n#include <stdexcept>\n#include <cstring>\n#include <cassert>\n#ifdef JSON_USE_CPPTL\n# include <cpptl/conststring.h>\n#endif\n#include <cstddef>    // size_t\n#ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR\n# include \"json_batchallocator.h\"\n#endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR\n\n#define JSON_ASSERT_UNREACHABLE assert( false )\n#define JSON_ASSERT( condition ) assert( condition );  // @todo <= change this into an exception throw\n#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message );\n\nnamespace Json {\n\nconst Value Value::null;\nconst Int Value::minInt = Int( ~(UInt(-1)/2) );\nconst Int Value::maxInt = Int( UInt(-1)/2 );\nconst UInt Value::maxUInt = UInt(-1);\n\n// A \"safe\" implementation of strdup. Allow null pointer to be passed. \n// Also avoid warning on msvc80.\n//\n//inline char *safeStringDup( const char *czstring )\n//{\n//   if ( czstring )\n//   {\n//      const size_t length = (unsigned int)( strlen(czstring) + 1 );\n//      char *newString = static_cast<char *>( malloc( length ) );\n//      memcpy( newString, czstring, length );\n//      return newString;\n//   }\n//   return 0;\n//}\n//\n//inline char *safeStringDup( const std::string &str )\n//{\n//   if ( !str.empty() )\n//   {\n//      const size_t length = str.length();\n//      char *newString = static_cast<char *>( malloc( length + 1 ) );\n//      memcpy( newString, str.c_str(), length );\n//      newString[length] = 0;\n//      return newString;\n//   }\n//   return 0;\n//}\n\nValueAllocator::~ValueAllocator()\n{\n}\n\nclass DefaultValueAllocator : public ValueAllocator\n{\npublic:\n   virtual ~DefaultValueAllocator()\n   {\n   }\n\n   virtual char *makeMemberName( const char *memberName )\n   {\n      return duplicateStringValue( memberName );\n   }\n\n   virtual void releaseMemberName( char *memberName )\n   {\n      releaseStringValue( memberName );\n   }\n\n   virtual char *duplicateStringValue( const char *value, \n                                       unsigned int length = unknown )\n   {\n      //@todo invesgate this old optimization\n      //if ( !value  ||  value[0] == 0 )\n      //   return 0;\n\n      if ( length == unknown )\n         length = (unsigned int)strlen(value);\n      char *newString = static_cast<char *>( malloc( length + 1 ) );\n      memcpy( newString, value, length );\n      newString[length] = 0;\n      return newString;\n   }\n\n   virtual void releaseStringValue( char *value )\n   {\n      if ( value )\n         free( value );\n   }\n};\n\nstatic ValueAllocator *&valueAllocator()\n{\n   static DefaultValueAllocator defaultAllocator;\n   static ValueAllocator *valueAllocator = &defaultAllocator;\n   return valueAllocator;\n}\n\nstatic struct DummyValueAllocatorInitializer {\n   DummyValueAllocatorInitializer() \n   {\n      valueAllocator();      // ensure valueAllocator() statics are initialized before main().\n   }\n} dummyValueAllocatorInitializer;\n\n\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// ValueInternals...\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n#ifdef JSON_VALUE_USE_INTERNAL_MAP\n# include \"json_internalarray.inl\"\n# include \"json_internalmap.inl\"\n#endif // JSON_VALUE_USE_INTERNAL_MAP\n\n# include \"json_valueiterator.inl\"\n\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// class Value::CommentInfo\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n\n\nValue::CommentInfo::CommentInfo()\n   : comment_( 0 )\n{\n}\n\nValue::CommentInfo::~CommentInfo()\n{\n   if ( comment_ )\n      valueAllocator()->releaseStringValue( comment_ );\n}\n\n\nvoid \nValue::CommentInfo::setComment( const char *text )\n{\n   if ( comment_ )\n      valueAllocator()->releaseStringValue( comment_ );\n   JSON_ASSERT( text );\n   JSON_ASSERT_MESSAGE( text[0]=='\\0' || text[0]=='/', \"Comments must start with /\");\n   // It seems that /**/ style comments are acceptable as well.\n   comment_ = valueAllocator()->duplicateStringValue( text );\n}\n\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// class Value::CZString\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n# ifndef JSON_VALUE_USE_INTERNAL_MAP\n\n// Notes: index_ indicates if the string was allocated when\n// a string is stored.\n\nValue::CZString::CZString( int index )\n   : cstr_( 0 )\n   , index_( index )\n{\n}\n\nValue::CZString::CZString( const char *cstr, DuplicationPolicy allocate )\n   : cstr_( allocate == duplicate ? valueAllocator()->makeMemberName(cstr) \n                                  : cstr )\n   , index_( allocate )\n{\n}\n\nValue::CZString::CZString( const CZString &other )\n: cstr_( other.index_ != noDuplication &&  other.cstr_ != 0\n                ?  valueAllocator()->makeMemberName( other.cstr_ )\n                : other.cstr_ )\n   , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate)\n                         : other.index_ )\n{\n}\n\nValue::CZString::~CZString()\n{\n   if ( cstr_  &&  index_ == duplicate )\n      valueAllocator()->releaseMemberName( const_cast<char *>( cstr_ ) );\n}\n\nvoid \nValue::CZString::swap( CZString &other )\n{\n   std::swap( cstr_, other.cstr_ );\n   std::swap( index_, other.index_ );\n}\n\nValue::CZString &\nValue::CZString::operator =( const CZString &other )\n{\n   CZString temp( other );\n   swap( temp );\n   return *this;\n}\n\nbool \nValue::CZString::operator<( const CZString &other ) const \n{\n   if ( cstr_ )\n      return strcmp( cstr_, other.cstr_ ) < 0;\n   return index_ < other.index_;\n}\n\nbool \nValue::CZString::operator==( const CZString &other ) const \n{\n   if ( cstr_ )\n      return strcmp( cstr_, other.cstr_ ) == 0;\n   return index_ == other.index_;\n}\n\n\nint \nValue::CZString::index() const\n{\n   return index_;\n}\n\n\nconst char *\nValue::CZString::c_str() const\n{\n   return cstr_;\n}\n\nbool \nValue::CZString::isStaticString() const\n{\n   return index_ == noDuplication;\n}\n\n#endif // ifndef JSON_VALUE_USE_INTERNAL_MAP\n\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// class Value::Value\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n\n/*! \\internal Default constructor initialization must be equivalent to:\n * memset( this, 0, sizeof(Value) )\n * This optimization is used in ValueInternalMap fast allocator.\n */\nValue::Value( ValueType type )\n   : type_( type )\n   , allocated_( 0 )\n   , comments_( 0 )\n# ifdef JSON_VALUE_USE_INTERNAL_MAP\n   , itemIsUsed_( 0 )\n#endif\n{\n   switch ( type )\n   {\n   case nullValue:\n      break;\n   case intValue:\n   case uintValue:\n      value_.int_ = 0;\n      break;\n   case realValue:\n      value_.real_ = 0.0;\n      break;\n   case stringValue:\n      value_.string_ = 0;\n      break;\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   case arrayValue:\n   case objectValue:\n      value_.map_ = new ObjectValues();\n      break;\n#else\n   case arrayValue:\n      value_.array_ = arrayAllocator()->newArray();\n      break;\n   case objectValue:\n      value_.map_ = mapAllocator()->newMap();\n      break;\n#endif\n   case booleanValue:\n      value_.bool_ = false;\n      break;\n   default:\n      JSON_ASSERT_UNREACHABLE;\n   }\n}\n\n\nValue::Value( Int value )\n   : type_( intValue )\n   , comments_( 0 )\n# ifdef JSON_VALUE_USE_INTERNAL_MAP\n   , itemIsUsed_( 0 )\n#endif\n{\n   value_.int_ = value;\n}\n\n\nValue::Value( UInt value )\n   : type_( uintValue )\n   , comments_( 0 )\n# ifdef JSON_VALUE_USE_INTERNAL_MAP\n   , itemIsUsed_( 0 )\n#endif\n{\n   value_.uint_ = value;\n}\n\nValue::Value( double value )\n   : type_( realValue )\n   , comments_( 0 )\n# ifdef JSON_VALUE_USE_INTERNAL_MAP\n   , itemIsUsed_( 0 )\n#endif\n{\n   value_.real_ = value;\n}\n\nValue::Value( const char *value )\n   : type_( stringValue )\n   , allocated_( true )\n   , comments_( 0 )\n# ifdef JSON_VALUE_USE_INTERNAL_MAP\n   , itemIsUsed_( 0 )\n#endif\n{\n   value_.string_ = valueAllocator()->duplicateStringValue( value );\n}\n\n\nValue::Value( const char *beginValue, \n              const char *endValue )\n   : type_( stringValue )\n   , allocated_( true )\n   , comments_( 0 )\n# ifdef JSON_VALUE_USE_INTERNAL_MAP\n   , itemIsUsed_( 0 )\n#endif\n{\n   value_.string_ = valueAllocator()->duplicateStringValue( beginValue, \n                                                            UInt(endValue - beginValue) );\n}\n\n\nValue::Value( const std::string &value )\n   : type_( stringValue )\n   , allocated_( true )\n   , comments_( 0 )\n# ifdef JSON_VALUE_USE_INTERNAL_MAP\n   , itemIsUsed_( 0 )\n#endif\n{\n   value_.string_ = valueAllocator()->duplicateStringValue( value.c_str(), \n                                                            (unsigned int)value.length() );\n\n}\n\nValue::Value( const StaticString &value )\n   : type_( stringValue )\n   , allocated_( false )\n   , comments_( 0 )\n# ifdef JSON_VALUE_USE_INTERNAL_MAP\n   , itemIsUsed_( 0 )\n#endif\n{\n   value_.string_ = const_cast<char *>( value.c_str() );\n}\n\n\n# ifdef JSON_USE_CPPTL\nValue::Value( const CppTL::ConstString &value )\n   : type_( stringValue )\n   , allocated_( true )\n   , comments_( 0 )\n# ifdef JSON_VALUE_USE_INTERNAL_MAP\n   , itemIsUsed_( 0 )\n#endif\n{\n   value_.string_ = valueAllocator()->duplicateStringValue( value, value.length() );\n}\n# endif\n\nValue::Value( bool value )\n   : type_( booleanValue )\n   , comments_( 0 )\n# ifdef JSON_VALUE_USE_INTERNAL_MAP\n   , itemIsUsed_( 0 )\n#endif\n{\n   value_.bool_ = value;\n}\n\n\nValue::Value( const Value &other )\n   : type_( other.type_ )\n   , comments_( 0 )\n# ifdef JSON_VALUE_USE_INTERNAL_MAP\n   , itemIsUsed_( 0 )\n#endif\n{\n   switch ( type_ )\n   {\n   case nullValue:\n   case intValue:\n   case uintValue:\n   case realValue:\n   case booleanValue:\n      value_ = other.value_;\n      break;\n   case stringValue:\n      if ( other.value_.string_ )\n      {\n         value_.string_ = valueAllocator()->duplicateStringValue( other.value_.string_ );\n         allocated_ = true;\n      }\n      else\n         value_.string_ = 0;\n      break;\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   case arrayValue:\n   case objectValue:\n      value_.map_ = new ObjectValues( *other.value_.map_ );\n      break;\n#else\n   case arrayValue:\n      value_.array_ = arrayAllocator()->newArrayCopy( *other.value_.array_ );\n      break;\n   case objectValue:\n      value_.map_ = mapAllocator()->newMapCopy( *other.value_.map_ );\n      break;\n#endif\n   default:\n      JSON_ASSERT_UNREACHABLE;\n   }\n   if ( other.comments_ )\n   {\n      comments_ = new CommentInfo[numberOfCommentPlacement];\n      for ( int comment =0; comment < numberOfCommentPlacement; ++comment )\n      {\n         const CommentInfo &otherComment = other.comments_[comment];\n         if ( otherComment.comment_ )\n            comments_[comment].setComment( otherComment.comment_ );\n      }\n   }\n}\n\n\nValue::~Value()\n{\n   switch ( type_ )\n   {\n   case nullValue:\n   case intValue:\n   case uintValue:\n   case realValue:\n   case booleanValue:\n      break;\n   case stringValue:\n      if ( allocated_ )\n         valueAllocator()->releaseStringValue( value_.string_ );\n      break;\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   case arrayValue:\n   case objectValue:\n      delete value_.map_;\n      break;\n#else\n   case arrayValue:\n      arrayAllocator()->destructArray( value_.array_ );\n      break;\n   case objectValue:\n      mapAllocator()->destructMap( value_.map_ );\n      break;\n#endif\n   default:\n      JSON_ASSERT_UNREACHABLE;\n   }\n\n   if ( comments_ )\n      delete[] comments_;\n}\n\nValue &\nValue::operator=( const Value &other )\n{\n   Value temp( other );\n   swap( temp );\n   return *this;\n}\n\nvoid \nValue::swap( Value &other )\n{\n   ValueType temp = type_;\n   type_ = other.type_;\n   other.type_ = temp;\n   std::swap( value_, other.value_ );\n   int temp2 = allocated_;\n   allocated_ = other.allocated_;\n   other.allocated_ = temp2;\n}\n\nValueType \nValue::type() const\n{\n   return type_;\n}\n\n\nint \nValue::compare( const Value &other )\n{\n   /*\n   int typeDelta = other.type_ - type_;\n   switch ( type_ )\n   {\n   case nullValue:\n\n      return other.type_ == type_;\n   case intValue:\n      if ( other.type_.isNumeric()\n   case uintValue:\n   case realValue:\n   case booleanValue:\n      break;\n   case stringValue,\n      break;\n   case arrayValue:\n      delete value_.array_;\n      break;\n   case objectValue:\n      delete value_.map_;\n   default:\n      JSON_ASSERT_UNREACHABLE;\n   }\n   */\n   return 0;  // unreachable\n}\n\nbool \nValue::operator <( const Value &other ) const\n{\n   int typeDelta = type_ - other.type_;\n   if ( typeDelta )\n      return typeDelta < 0 ? true : false;\n   switch ( type_ )\n   {\n   case nullValue:\n      return false;\n   case intValue:\n      return value_.int_ < other.value_.int_;\n   case uintValue:\n      return value_.uint_ < other.value_.uint_;\n   case realValue:\n      return value_.real_ < other.value_.real_;\n   case booleanValue:\n      return value_.bool_ < other.value_.bool_;\n   case stringValue:\n      return ( value_.string_ == 0  &&  other.value_.string_ )\n             || ( other.value_.string_  \n                  &&  value_.string_  \n                  && strcmp( value_.string_, other.value_.string_ ) < 0 );\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   case arrayValue:\n   case objectValue:\n      {\n         int delta = int( value_.map_->size() - other.value_.map_->size() );\n         if ( delta )\n            return delta < 0;\n         return (*value_.map_) < (*other.value_.map_);\n      }\n#else\n   case arrayValue:\n      return value_.array_->compare( *(other.value_.array_) ) < 0;\n   case objectValue:\n      return value_.map_->compare( *(other.value_.map_) ) < 0;\n#endif\n   default:\n      JSON_ASSERT_UNREACHABLE;\n   }\n   return 0;  // unreachable\n}\n\nbool \nValue::operator <=( const Value &other ) const\n{\n   return !(other > *this);\n}\n\nbool \nValue::operator >=( const Value &other ) const\n{\n   return !(*this < other);\n}\n\nbool \nValue::operator >( const Value &other ) const\n{\n   return other < *this;\n}\n\nbool \nValue::operator ==( const Value &other ) const\n{\n   //if ( type_ != other.type_ )\n   // GCC 2.95.3 says:\n   // attempt to take address of bit-field structure member `Json::Value::type_'\n   // Beats me, but a temp solves the problem.\n   int temp = other.type_;\n   if ( type_ != temp )\n      return false;\n   switch ( type_ )\n   {\n   case nullValue:\n      return true;\n   case intValue:\n      return value_.int_ == other.value_.int_;\n   case uintValue:\n      return value_.uint_ == other.value_.uint_;\n   case realValue:\n      return value_.real_ == other.value_.real_;\n   case booleanValue:\n      return value_.bool_ == other.value_.bool_;\n   case stringValue:\n      return ( value_.string_ == other.value_.string_ )\n             || ( other.value_.string_  \n                  &&  value_.string_  \n                  && strcmp( value_.string_, other.value_.string_ ) == 0 );\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   case arrayValue:\n   case objectValue:\n      return value_.map_->size() == other.value_.map_->size()\n             && (*value_.map_) == (*other.value_.map_);\n#else\n   case arrayValue:\n      return value_.array_->compare( *(other.value_.array_) ) == 0;\n   case objectValue:\n      return value_.map_->compare( *(other.value_.map_) ) == 0;\n#endif\n   default:\n      JSON_ASSERT_UNREACHABLE;\n   }\n   return 0;  // unreachable\n}\n\nbool \nValue::operator !=( const Value &other ) const\n{\n   return !( *this == other );\n}\n\nconst char *\nValue::asCString() const\n{\n   JSON_ASSERT( type_ == stringValue );\n   return value_.string_;\n}\n\n\nstd::string \nValue::asString() const\n{\n   switch ( type_ )\n   {\n   case nullValue:\n      return \"\";\n   case stringValue:\n      return value_.string_ ? value_.string_ : \"\";\n   case booleanValue:\n      return value_.bool_ ? \"true\" : \"false\";\n   case intValue:\n   case uintValue:\n   case realValue:\n   case arrayValue:\n   case objectValue:\n      JSON_ASSERT_MESSAGE( false, \"Type is not convertible to string\" );\n   default:\n      JSON_ASSERT_UNREACHABLE;\n   }\n   return \"\"; // unreachable\n}\n\n# ifdef JSON_USE_CPPTL\nCppTL::ConstString \nValue::asConstString() const\n{\n   return CppTL::ConstString( asString().c_str() );\n}\n# endif\n\nValue::Int \nValue::asInt() const\n{\n   switch ( type_ )\n   {\n   case nullValue:\n      return 0;\n   case intValue:\n      return value_.int_;\n   case uintValue:\n      JSON_ASSERT_MESSAGE( value_.uint_ < (unsigned)maxInt, \"integer out of signed integer range\" );\n      return value_.uint_;\n   case realValue:\n      JSON_ASSERT_MESSAGE( value_.real_ >= minInt  &&  value_.real_ <= maxInt, \"Real out of signed integer range\" );\n      return Int( value_.real_ );\n   case booleanValue:\n      return value_.bool_ ? 1 : 0;\n   case stringValue:\n   case arrayValue:\n   case objectValue:\n      JSON_ASSERT_MESSAGE( false, \"Type is not convertible to int\" );\n   default:\n      JSON_ASSERT_UNREACHABLE;\n   }\n   return 0; // unreachable;\n}\n\nValue::UInt \nValue::asUInt() const\n{\n   switch ( type_ )\n   {\n   case nullValue:\n      return 0;\n   case intValue:\n      JSON_ASSERT_MESSAGE( value_.int_ >= 0, \"Negative integer can not be converted to unsigned integer\" );\n      return value_.int_;\n   case uintValue:\n      return value_.uint_;\n   case realValue:\n      JSON_ASSERT_MESSAGE( value_.real_ >= 0  &&  value_.real_ <= maxUInt,  \"Real out of unsigned integer range\" );\n      return UInt( value_.real_ );\n   case booleanValue:\n      return value_.bool_ ? 1 : 0;\n   case stringValue:\n   case arrayValue:\n   case objectValue:\n      JSON_ASSERT_MESSAGE( false, \"Type is not convertible to uint\" );\n   default:\n      JSON_ASSERT_UNREACHABLE;\n   }\n   return 0; // unreachable;\n}\n\ndouble \nValue::asDouble() const\n{\n   switch ( type_ )\n   {\n   case nullValue:\n      return 0.0;\n   case intValue:\n      return value_.int_;\n   case uintValue:\n      return value_.uint_;\n   case realValue:\n      return value_.real_;\n   case booleanValue:\n      return value_.bool_ ? 1.0 : 0.0;\n   case stringValue:\n   case arrayValue:\n   case objectValue:\n      JSON_ASSERT_MESSAGE( false, \"Type is not convertible to double\" );\n   default:\n      JSON_ASSERT_UNREACHABLE;\n   }\n   return 0; // unreachable;\n}\n\nbool \nValue::asBool() const\n{\n   switch ( type_ )\n   {\n   case nullValue:\n      return false;\n   case intValue:\n   case uintValue:\n      return value_.int_ != 0;\n   case realValue:\n      return value_.real_ != 0.0;\n   case booleanValue:\n      return value_.bool_;\n   case stringValue:\n      return value_.string_  &&  value_.string_[0] != 0;\n   case arrayValue:\n   case objectValue:\n      return value_.map_->size() != 0;\n   default:\n      JSON_ASSERT_UNREACHABLE;\n   }\n   return false; // unreachable;\n}\n\n\nbool \nValue::isConvertibleTo( ValueType other ) const\n{\n   switch ( type_ )\n   {\n   case nullValue:\n      return true;\n   case intValue:\n      return ( other == nullValue  &&  value_.int_ == 0 )\n             || other == intValue\n             || ( other == uintValue  && value_.int_ >= 0 )\n             || other == realValue\n             || other == stringValue\n             || other == booleanValue;\n   case uintValue:\n      return ( other == nullValue  &&  value_.uint_ == 0 )\n             || ( other == intValue  && value_.uint_ <= (unsigned)maxInt )\n             || other == uintValue\n             || other == realValue\n             || other == stringValue\n             || other == booleanValue;\n   case realValue:\n      return ( other == nullValue  &&  value_.real_ == 0.0 )\n             || ( other == intValue  &&  value_.real_ >= minInt  &&  value_.real_ <= maxInt )\n             || ( other == uintValue  &&  value_.real_ >= 0  &&  value_.real_ <= maxUInt )\n             || other == realValue\n             || other == stringValue\n             || other == booleanValue;\n   case booleanValue:\n      return ( other == nullValue  &&  value_.bool_ == false )\n             || other == intValue\n             || other == uintValue\n             || other == realValue\n             || other == stringValue\n             || other == booleanValue;\n   case stringValue:\n      return other == stringValue\n             || ( other == nullValue  &&  (!value_.string_  ||  value_.string_[0] == 0) );\n   case arrayValue:\n      return other == arrayValue\n             ||  ( other == nullValue  &&  value_.map_->size() == 0 );\n   case objectValue:\n      return other == objectValue\n             ||  ( other == nullValue  &&  value_.map_->size() == 0 );\n   default:\n      JSON_ASSERT_UNREACHABLE;\n   }\n   return false; // unreachable;\n}\n\n\n/// Number of values in array or object\nValue::UInt \nValue::size() const\n{\n   switch ( type_ )\n   {\n   case nullValue:\n   case intValue:\n   case uintValue:\n   case realValue:\n   case booleanValue:\n   case stringValue:\n      return 0;\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   case arrayValue:  // size of the array is highest index + 1\n      if ( !value_.map_->empty() )\n      {\n         ObjectValues::const_iterator itLast = value_.map_->end();\n         --itLast;\n         return (*itLast).first.index()+1;\n      }\n      return 0;\n   case objectValue:\n      return Int( value_.map_->size() );\n#else\n   case arrayValue:\n      return Int( value_.array_->size() );\n   case objectValue:\n      return Int( value_.map_->size() );\n#endif\n   default:\n      JSON_ASSERT_UNREACHABLE;\n   }\n   return 0; // unreachable;\n}\n\n\nbool \nValue::empty() const\n{\n   if ( isNull() || isArray() || isObject() )\n      return size() == 0u;\n   else\n      return false;\n}\n\n\nbool\nValue::operator!() const\n{\n   return isNull();\n}\n\n\nvoid \nValue::clear()\n{\n   JSON_ASSERT( type_ == nullValue  ||  type_ == arrayValue  || type_ == objectValue );\n\n   switch ( type_ )\n   {\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   case arrayValue:\n   case objectValue:\n      value_.map_->clear();\n      break;\n#else\n   case arrayValue:\n      value_.array_->clear();\n      break;\n   case objectValue:\n      value_.map_->clear();\n      break;\n#endif\n   default:\n      break;\n   }\n}\n\nvoid \nValue::resize( UInt newSize )\n{\n   JSON_ASSERT( type_ == nullValue  ||  type_ == arrayValue );\n   if ( type_ == nullValue )\n      *this = Value( arrayValue );\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   UInt oldSize = size();\n   if ( newSize == 0 )\n      clear();\n   else if ( newSize > oldSize )\n      (*this)[ newSize - 1 ];\n   else\n   {\n      for ( UInt index = newSize; index < oldSize; ++index )\n         value_.map_->erase( index );\n      assert( size() == newSize );\n   }\n#else\n   value_.array_->resize( newSize );\n#endif\n}\n\n\nValue &\nValue::operator[]( UInt index )\n{\n   JSON_ASSERT( type_ == nullValue  ||  type_ == arrayValue );\n   if ( type_ == nullValue )\n      *this = Value( arrayValue );\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   CZString key( index );\n   ObjectValues::iterator it = value_.map_->lower_bound( key );\n   if ( it != value_.map_->end()  &&  (*it).first == key )\n      return (*it).second;\n\n   ObjectValues::value_type defaultValue( key, null );\n   it = value_.map_->insert( it, defaultValue );\n   return (*it).second;\n#else\n   return value_.array_->resolveReference( index );\n#endif\n}\n\n\nconst Value &\nValue::operator[]( UInt index ) const\n{\n   JSON_ASSERT( type_ == nullValue  ||  type_ == arrayValue );\n   if ( type_ == nullValue )\n      return null;\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   CZString key( index );\n   ObjectValues::const_iterator it = value_.map_->find( key );\n   if ( it == value_.map_->end() )\n      return null;\n   return (*it).second;\n#else\n   Value *value = value_.array_->find( index );\n   return value ? *value : null;\n#endif\n}\n\n\nValue &\nValue::operator[]( const char *key )\n{\n   return resolveReference( key, false );\n}\n\n\nValue &\nValue::resolveReference( const char *key, \n                         bool isStatic )\n{\n   JSON_ASSERT( type_ == nullValue  ||  type_ == objectValue );\n   if ( type_ == nullValue )\n      *this = Value( objectValue );\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   CZString actualKey( key, isStatic ? CZString::noDuplication \n                                     : CZString::duplicateOnCopy );\n   ObjectValues::iterator it = value_.map_->lower_bound( actualKey );\n   if ( it != value_.map_->end()  &&  (*it).first == actualKey )\n      return (*it).second;\n\n   ObjectValues::value_type defaultValue( actualKey, null );\n   it = value_.map_->insert( it, defaultValue );\n   Value &value = (*it).second;\n   return value;\n#else\n   return value_.map_->resolveReference( key, isStatic );\n#endif\n}\n\n\nValue \nValue::get( UInt index, \n            const Value &defaultValue ) const\n{\n   const Value *value = &((*this)[index]);\n   return value == &null ? defaultValue : *value;\n}\n\n\nbool \nValue::isValidIndex( UInt index ) const\n{\n   return index < size();\n}\n\n\n\nconst Value &\nValue::operator[]( const char *key ) const\n{\n   JSON_ASSERT( type_ == nullValue  ||  type_ == objectValue );\n   if ( type_ == nullValue )\n      return null;\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   CZString actualKey( key, CZString::noDuplication );\n   ObjectValues::const_iterator it = value_.map_->find( actualKey );\n   if ( it == value_.map_->end() )\n      return null;\n   return (*it).second;\n#else\n   const Value *value = value_.map_->find( key );\n   return value ? *value : null;\n#endif\n}\n\n\nValue &\nValue::operator[]( const std::string &key )\n{\n   return (*this)[ key.c_str() ];\n}\n\n\nconst Value &\nValue::operator[]( const std::string &key ) const\n{\n   return (*this)[ key.c_str() ];\n}\n\nValue &\nValue::operator[]( const StaticString &key )\n{\n   return resolveReference( key, true );\n}\n\n\n# ifdef JSON_USE_CPPTL\nValue &\nValue::operator[]( const CppTL::ConstString &key )\n{\n   return (*this)[ key.c_str() ];\n}\n\n\nconst Value &\nValue::operator[]( const CppTL::ConstString &key ) const\n{\n   return (*this)[ key.c_str() ];\n}\n# endif\n\n\nValue &\nValue::append( const Value &value )\n{\n   return (*this)[size()] = value;\n}\n\n\nValue \nValue::get( const char *key, \n            const Value &defaultValue ) const\n{\n   const Value *value = &((*this)[key]);\n   return value == &null ? defaultValue : *value;\n}\n\n\nValue \nValue::get( const std::string &key,\n            const Value &defaultValue ) const\n{\n   return get( key.c_str(), defaultValue );\n}\n\nValue\nValue::removeMember( const char* key )\n{\n   JSON_ASSERT( type_ == nullValue  ||  type_ == objectValue );\n   if ( type_ == nullValue )\n      return null;\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   CZString actualKey( key, CZString::noDuplication );\n   ObjectValues::iterator it = value_.map_->find( actualKey );\n   if ( it == value_.map_->end() )\n      return null;\n   Value old(it->second);\n   value_.map_->erase(it);\n   return old;\n#else\n   Value *value = value_.map_->find( key );\n   if (value){\n      Value old(*value);\n      value_.map_.remove( key );\n      return old;\n   } else {\n      return null;\n   }\n#endif\n}\n\nValue\nValue::removeMember( const std::string &key )\n{\n   return removeMember( key.c_str() );\n}\n\n# ifdef JSON_USE_CPPTL\nValue \nValue::get( const CppTL::ConstString &key,\n            const Value &defaultValue ) const\n{\n   return get( key.c_str(), defaultValue );\n}\n# endif\n\nbool \nValue::isMember( const char *key ) const\n{\n   const Value *value = &((*this)[key]);\n   return value != &null;\n}\n\n\nbool \nValue::isMember( const std::string &key ) const\n{\n   return isMember( key.c_str() );\n}\n\n\n# ifdef JSON_USE_CPPTL\nbool \nValue::isMember( const CppTL::ConstString &key ) const\n{\n   return isMember( key.c_str() );\n}\n#endif\n\nValue::Members \nValue::getMemberNames() const\n{\n   JSON_ASSERT( type_ == nullValue  ||  type_ == objectValue );\n   if ( type_ == nullValue )\n       return Value::Members();\n   Members members;\n   members.reserve( value_.map_->size() );\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   ObjectValues::const_iterator it = value_.map_->begin();\n   ObjectValues::const_iterator itEnd = value_.map_->end();\n   for ( ; it != itEnd; ++it )\n      members.push_back( std::string( (*it).first.c_str() ) );\n#else\n   ValueInternalMap::IteratorState it;\n   ValueInternalMap::IteratorState itEnd;\n   value_.map_->makeBeginIterator( it );\n   value_.map_->makeEndIterator( itEnd );\n   for ( ; !ValueInternalMap::equals( it, itEnd ); ValueInternalMap::increment(it) )\n      members.push_back( std::string( ValueInternalMap::key( it ) ) );\n#endif\n   return members;\n}\n//\n//# ifdef JSON_USE_CPPTL\n//EnumMemberNames\n//Value::enumMemberNames() const\n//{\n//   if ( type_ == objectValue )\n//   {\n//      return CppTL::Enum::any(  CppTL::Enum::transform(\n//         CppTL::Enum::keys( *(value_.map_), CppTL::Type<const CZString &>() ),\n//         MemberNamesTransform() ) );\n//   }\n//   return EnumMemberNames();\n//}\n//\n//\n//EnumValues \n//Value::enumValues() const\n//{\n//   if ( type_ == objectValue  ||  type_ == arrayValue )\n//      return CppTL::Enum::anyValues( *(value_.map_), \n//                                     CppTL::Type<const Value &>() );\n//   return EnumValues();\n//}\n//\n//# endif\n\n\nbool\nValue::isNull() const\n{\n   return type_ == nullValue;\n}\n\n\nbool \nValue::isBool() const\n{\n   return type_ == booleanValue;\n}\n\n\nbool \nValue::isInt() const\n{\n   return type_ == intValue;\n}\n\n\nbool \nValue::isUInt() const\n{\n   return type_ == uintValue;\n}\n\n\nbool \nValue::isIntegral() const\n{\n   return type_ == intValue  \n          ||  type_ == uintValue  \n          ||  type_ == booleanValue;\n}\n\n\nbool \nValue::isDouble() const\n{\n   return type_ == realValue;\n}\n\n\nbool \nValue::isNumeric() const\n{\n   return isIntegral() || isDouble();\n}\n\n\nbool \nValue::isString() const\n{\n   return type_ == stringValue;\n}\n\n\nbool \nValue::isArray() const\n{\n   return type_ == nullValue  ||  type_ == arrayValue;\n}\n\n\nbool \nValue::isObject() const\n{\n   return type_ == nullValue  ||  type_ == objectValue;\n}\n\n\nvoid \nValue::setComment( const char *comment,\n                   CommentPlacement placement )\n{\n   if ( !comments_ )\n      comments_ = new CommentInfo[numberOfCommentPlacement];\n   comments_[placement].setComment( comment );\n}\n\n\nvoid \nValue::setComment( const std::string &comment,\n                   CommentPlacement placement )\n{\n   setComment( comment.c_str(), placement );\n}\n\n\nbool \nValue::hasComment( CommentPlacement placement ) const\n{\n   return comments_ != 0  &&  comments_[placement].comment_ != 0;\n}\n\nstd::string \nValue::getComment( CommentPlacement placement ) const\n{\n   if ( hasComment(placement) )\n      return comments_[placement].comment_;\n   return \"\";\n}\n\n\nstd::string \nValue::toStyledString() const\n{\n   StyledWriter writer;\n   return writer.write( *this );\n}\n\n\nValue::const_iterator \nValue::begin() const\n{\n   switch ( type_ )\n   {\n#ifdef JSON_VALUE_USE_INTERNAL_MAP\n   case arrayValue:\n      if ( value_.array_ )\n      {\n         ValueInternalArray::IteratorState it;\n         value_.array_->makeBeginIterator( it );\n         return const_iterator( it );\n      }\n      break;\n   case objectValue:\n      if ( value_.map_ )\n      {\n         ValueInternalMap::IteratorState it;\n         value_.map_->makeBeginIterator( it );\n         return const_iterator( it );\n      }\n      break;\n#else\n   case arrayValue:\n   case objectValue:\n      if ( value_.map_ )\n         return const_iterator( value_.map_->begin() );\n      break;\n#endif\n   default:\n      break;\n   }\n   return const_iterator();\n}\n\nValue::const_iterator \nValue::end() const\n{\n   switch ( type_ )\n   {\n#ifdef JSON_VALUE_USE_INTERNAL_MAP\n   case arrayValue:\n      if ( value_.array_ )\n      {\n         ValueInternalArray::IteratorState it;\n         value_.array_->makeEndIterator( it );\n         return const_iterator( it );\n      }\n      break;\n   case objectValue:\n      if ( value_.map_ )\n      {\n         ValueInternalMap::IteratorState it;\n         value_.map_->makeEndIterator( it );\n         return const_iterator( it );\n      }\n      break;\n#else\n   case arrayValue:\n   case objectValue:\n      if ( value_.map_ )\n         return const_iterator( value_.map_->end() );\n      break;\n#endif\n   default:\n      break;\n   }\n   return const_iterator();\n}\n\n\nValue::iterator \nValue::begin()\n{\n   switch ( type_ )\n   {\n#ifdef JSON_VALUE_USE_INTERNAL_MAP\n   case arrayValue:\n      if ( value_.array_ )\n      {\n         ValueInternalArray::IteratorState it;\n         value_.array_->makeBeginIterator( it );\n         return iterator( it );\n      }\n      break;\n   case objectValue:\n      if ( value_.map_ )\n      {\n         ValueInternalMap::IteratorState it;\n         value_.map_->makeBeginIterator( it );\n         return iterator( it );\n      }\n      break;\n#else\n   case arrayValue:\n   case objectValue:\n      if ( value_.map_ )\n         return iterator( value_.map_->begin() );\n      break;\n#endif\n   default:\n      break;\n   }\n   return iterator();\n}\n\nValue::iterator \nValue::end()\n{\n   switch ( type_ )\n   {\n#ifdef JSON_VALUE_USE_INTERNAL_MAP\n   case arrayValue:\n      if ( value_.array_ )\n      {\n         ValueInternalArray::IteratorState it;\n         value_.array_->makeEndIterator( it );\n         return iterator( it );\n      }\n      break;\n   case objectValue:\n      if ( value_.map_ )\n      {\n         ValueInternalMap::IteratorState it;\n         value_.map_->makeEndIterator( it );\n         return iterator( it );\n      }\n      break;\n#else\n   case arrayValue:\n   case objectValue:\n      if ( value_.map_ )\n         return iterator( value_.map_->end() );\n      break;\n#endif\n   default:\n      break;\n   }\n   return iterator();\n}\n\n\n// class PathArgument\n// //////////////////////////////////////////////////////////////////\n\nPathArgument::PathArgument()\n   : kind_( kindNone )\n{\n}\n\n\nPathArgument::PathArgument( Value::UInt index )\n   : index_( index )\n   , kind_( kindIndex )\n{\n}\n\n\nPathArgument::PathArgument( const char *key )\n   : key_( key )\n   , kind_( kindKey )\n{\n}\n\n\nPathArgument::PathArgument( const std::string &key )\n   : key_( key.c_str() )\n   , kind_( kindKey )\n{\n}\n\n// class Path\n// //////////////////////////////////////////////////////////////////\n\nPath::Path( const std::string &path,\n            const PathArgument &a1,\n            const PathArgument &a2,\n            const PathArgument &a3,\n            const PathArgument &a4,\n            const PathArgument &a5 )\n{\n   InArgs in;\n   in.push_back( &a1 );\n   in.push_back( &a2 );\n   in.push_back( &a3 );\n   in.push_back( &a4 );\n   in.push_back( &a5 );\n   makePath( path, in );\n}\n\n\nvoid \nPath::makePath( const std::string &path,\n                const InArgs &in )\n{\n   const char *current = path.c_str();\n   const char *end = current + path.length();\n   InArgs::const_iterator itInArg = in.begin();\n   while ( current != end )\n   {\n      if ( *current == '[' )\n      {\n         ++current;\n         if ( *current == '%' )\n            addPathInArg( path, in, itInArg, PathArgument::kindIndex );\n         else\n         {\n            Value::UInt index = 0;\n            for ( ; current != end && *current >= '0'  &&  *current <= '9'; ++current )\n               index = index * 10 + Value::UInt(*current - '0');\n            args_.push_back( index );\n         }\n         if ( current == end  ||  *current++ != ']' )\n            invalidPath( path, int(current - path.c_str()) );\n      }\n      else if ( *current == '%' )\n      {\n         addPathInArg( path, in, itInArg, PathArgument::kindKey );\n         ++current;\n      }\n      else if ( *current == '.' )\n      {\n         ++current;\n      }\n      else\n      {\n         const char *beginName = current;\n         while ( current != end  &&  !strchr( \"[.\", *current ) )\n            ++current;\n         args_.push_back( std::string( beginName, current ) );\n      }\n   }\n}\n\n\nvoid \nPath::addPathInArg( const std::string &path, \n                    const InArgs &in, \n                    InArgs::const_iterator &itInArg, \n                    PathArgument::Kind kind )\n{\n   if ( itInArg == in.end() )\n   {\n      // Error: missing argument %d\n   }\n   else if ( (*itInArg)->kind_ != kind )\n   {\n      // Error: bad argument type\n   }\n   else\n   {\n      args_.push_back( **itInArg );\n   }\n}\n\n\nvoid \nPath::invalidPath( const std::string &path, \n                   int location )\n{\n   // Error: invalid path.\n}\n\n\nconst Value &\nPath::resolve( const Value &root ) const\n{\n   const Value *node = &root;\n   for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it )\n   {\n      const PathArgument &arg = *it;\n      if ( arg.kind_ == PathArgument::kindIndex )\n      {\n         if ( !node->isArray()  ||  node->isValidIndex( arg.index_ ) )\n         {\n            // Error: unable to resolve path (array value expected at position...\n         }\n         node = &((*node)[arg.index_]);\n      }\n      else if ( arg.kind_ == PathArgument::kindKey )\n      {\n         if ( !node->isObject() )\n         {\n            // Error: unable to resolve path (object value expected at position...)\n         }\n         node = &((*node)[arg.key_]);\n         if ( node == &Value::null )\n         {\n            // Error: unable to resolve path (object has no member named '' at position...)\n         }\n      }\n   }\n   return *node;\n}\n\n\nValue \nPath::resolve( const Value &root, \n               const Value &defaultValue ) const\n{\n   const Value *node = &root;\n   for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it )\n   {\n      const PathArgument &arg = *it;\n      if ( arg.kind_ == PathArgument::kindIndex )\n      {\n         if ( !node->isArray()  ||  node->isValidIndex( arg.index_ ) )\n            return defaultValue;\n         node = &((*node)[arg.index_]);\n      }\n      else if ( arg.kind_ == PathArgument::kindKey )\n      {\n         if ( !node->isObject() )\n            return defaultValue;\n         node = &((*node)[arg.key_]);\n         if ( node == &Value::null )\n            return defaultValue;\n      }\n   }\n   return *node;\n}\n\n\nValue &\nPath::make( Value &root ) const\n{\n   Value *node = &root;\n   for ( Args::const_iterator it = args_.begin(); it != args_.end(); ++it )\n   {\n      const PathArgument &arg = *it;\n      if ( arg.kind_ == PathArgument::kindIndex )\n      {\n         if ( !node->isArray() )\n         {\n            // Error: node is not an array at position ...\n         }\n         node = &((*node)[arg.index_]);\n      }\n      else if ( arg.kind_ == PathArgument::kindKey )\n      {\n         if ( !node->isObject() )\n         {\n            // Error: node is not an object at position...\n         }\n         node = &((*node)[arg.key_]);\n      }\n   }\n   return *node;\n}\n\n\n} // namespace Json\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/src/lib_json/json_valueiterator.inl",
    "content": "// included by json_value.cpp\n// everything is within Json namespace\n\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// class ValueIteratorBase\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n\nValueIteratorBase::ValueIteratorBase()\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   : current_()\n   , isNull_( true )\n{\n}\n#else\n   : isArray_( true )\n   , isNull_( true )\n{\n   iterator_.array_ = ValueInternalArray::IteratorState();\n}\n#endif\n\n\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\nValueIteratorBase::ValueIteratorBase( const Value::ObjectValues::iterator &current )\n   : current_( current )\n   , isNull_( false )\n{\n}\n#else\nValueIteratorBase::ValueIteratorBase( const ValueInternalArray::IteratorState &state )\n   : isArray_( true )\n{\n   iterator_.array_ = state;\n}\n\n\nValueIteratorBase::ValueIteratorBase( const ValueInternalMap::IteratorState &state )\n   : isArray_( false )\n{\n   iterator_.map_ = state;\n}\n#endif\n\nValue &\nValueIteratorBase::deref() const\n{\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   return current_->second;\n#else\n   if ( isArray_ )\n      return ValueInternalArray::dereference( iterator_.array_ );\n   return ValueInternalMap::value( iterator_.map_ );\n#endif\n}\n\n\nvoid \nValueIteratorBase::increment()\n{\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   ++current_;\n#else\n   if ( isArray_ )\n      ValueInternalArray::increment( iterator_.array_ );\n   ValueInternalMap::increment( iterator_.map_ );\n#endif\n}\n\n\nvoid \nValueIteratorBase::decrement()\n{\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   --current_;\n#else\n   if ( isArray_ )\n      ValueInternalArray::decrement( iterator_.array_ );\n   ValueInternalMap::decrement( iterator_.map_ );\n#endif\n}\n\n\nValueIteratorBase::difference_type \nValueIteratorBase::computeDistance( const SelfType &other ) const\n{\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n# ifdef JSON_USE_CPPTL_SMALLMAP\n   return current_ - other.current_;\n# else\n   // Iterator for null value are initialized using the default\n   // constructor, which initialize current_ to the default\n   // std::map::iterator. As begin() and end() are two instance \n   // of the default std::map::iterator, they can not be compared.\n   // To allow this, we handle this comparison specifically.\n   if ( isNull_  &&  other.isNull_ )\n   {\n      return 0;\n   }\n\n\n   // Usage of std::distance is not portable (does not compile with Sun Studio 12 RogueWave STL,\n   // which is the one used by default).\n   // Using a portable hand-made version for non random iterator instead:\n   //   return difference_type( std::distance( current_, other.current_ ) );\n   difference_type myDistance = 0;\n   for ( Value::ObjectValues::iterator it = current_; it != other.current_; ++it )\n   {\n      ++myDistance;\n   }\n   return myDistance;\n# endif\n#else\n   if ( isArray_ )\n      return ValueInternalArray::distance( iterator_.array_, other.iterator_.array_ );\n   return ValueInternalMap::distance( iterator_.map_, other.iterator_.map_ );\n#endif\n}\n\n\nbool \nValueIteratorBase::isEqual( const SelfType &other ) const\n{\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   if ( isNull_ )\n   {\n      return other.isNull_;\n   }\n   return current_ == other.current_;\n#else\n   if ( isArray_ )\n      return ValueInternalArray::equals( iterator_.array_, other.iterator_.array_ );\n   return ValueInternalMap::equals( iterator_.map_, other.iterator_.map_ );\n#endif\n}\n\n\nvoid \nValueIteratorBase::copy( const SelfType &other )\n{\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   current_ = other.current_;\n#else\n   if ( isArray_ )\n      iterator_.array_ = other.iterator_.array_;\n   iterator_.map_ = other.iterator_.map_;\n#endif\n}\n\n\nValue \nValueIteratorBase::key() const\n{\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   const Value::CZString czstring = (*current_).first;\n   if ( czstring.c_str() )\n   {\n      if ( czstring.isStaticString() )\n         return Value( StaticString( czstring.c_str() ) );\n      return Value( czstring.c_str() );\n   }\n   return Value( czstring.index() );\n#else\n   if ( isArray_ )\n      return Value( ValueInternalArray::indexOf( iterator_.array_ ) );\n   bool isStatic;\n   const char *memberName = ValueInternalMap::key( iterator_.map_, isStatic );\n   if ( isStatic )\n      return Value( StaticString( memberName ) );\n   return Value( memberName );\n#endif\n}\n\n\nUInt \nValueIteratorBase::index() const\n{\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   const Value::CZString czstring = (*current_).first;\n   if ( !czstring.c_str() )\n      return czstring.index();\n   return Value::UInt( -1 );\n#else\n   if ( isArray_ )\n      return Value::UInt( ValueInternalArray::indexOf( iterator_.array_ ) );\n   return Value::UInt( -1 );\n#endif\n}\n\n\nconst char *\nValueIteratorBase::memberName() const\n{\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\n   const char *name = (*current_).first.c_str();\n   return name ? name : \"\";\n#else\n   if ( !isArray_ )\n      return ValueInternalMap::key( iterator_.map_ );\n   return \"\";\n#endif\n}\n\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// class ValueConstIterator\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n\nValueConstIterator::ValueConstIterator()\n{\n}\n\n\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\nValueConstIterator::ValueConstIterator( const Value::ObjectValues::iterator &current )\n   : ValueIteratorBase( current )\n{\n}\n#else\nValueConstIterator::ValueConstIterator( const ValueInternalArray::IteratorState &state )\n   : ValueIteratorBase( state )\n{\n}\n\nValueConstIterator::ValueConstIterator( const ValueInternalMap::IteratorState &state )\n   : ValueIteratorBase( state )\n{\n}\n#endif\n\nValueConstIterator &\nValueConstIterator::operator =( const ValueIteratorBase &other )\n{\n   copy( other );\n   return *this;\n}\n\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// class ValueIterator\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n\nValueIterator::ValueIterator()\n{\n}\n\n\n#ifndef JSON_VALUE_USE_INTERNAL_MAP\nValueIterator::ValueIterator( const Value::ObjectValues::iterator &current )\n   : ValueIteratorBase( current )\n{\n}\n#else\nValueIterator::ValueIterator( const ValueInternalArray::IteratorState &state )\n   : ValueIteratorBase( state )\n{\n}\n\nValueIterator::ValueIterator( const ValueInternalMap::IteratorState &state )\n   : ValueIteratorBase( state )\n{\n}\n#endif\n\nValueIterator::ValueIterator( const ValueConstIterator &other )\n   : ValueIteratorBase( other )\n{\n}\n\nValueIterator::ValueIterator( const ValueIterator &other )\n   : ValueIteratorBase( other )\n{\n}\n\nValueIterator &\nValueIterator::operator =( const SelfType &other )\n{\n   copy( other );\n   return *this;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/src/lib_json/json_writer.cpp",
    "content": "#include <json/writer.h>\n#include <utility>\n#include <assert.h>\n#include <stdio.h>\n#include <string.h>\n#include <iostream>\n#include <sstream>\n#include <iomanip>\n\n#if _MSC_VER >= 1400 // VC++ 8.0\n#pragma warning( disable : 4996 )   // disable warning about strdup being deprecated.\n#endif\n\nnamespace Json {\n\nstatic bool isControlCharacter(char ch)\n{\n   return ch > 0 && ch <= 0x1F;\n}\n\nstatic bool containsControlCharacter( const char* str )\n{\n   while ( *str ) \n   {\n      if ( isControlCharacter( *(str++) ) )\n         return true;\n   }\n   return false;\n}\nstatic void uintToString( unsigned int value, \n                          char *&current )\n{\n   *--current = 0;\n   do\n   {\n      *--current = (value % 10) + '0';\n      value /= 10;\n   }\n   while ( value != 0 );\n}\n\nstd::string valueToString( Int value )\n{\n   char buffer[32];\n   char *current = buffer + sizeof(buffer);\n   bool isNegative = value < 0;\n   if ( isNegative )\n      value = -value;\n   uintToString( UInt(value), current );\n   if ( isNegative )\n      *--current = '-';\n   assert( current >= buffer );\n   return current;\n}\n\n\nstd::string valueToString( UInt value )\n{\n   char buffer[32];\n   char *current = buffer + sizeof(buffer);\n   uintToString( value, current );\n   assert( current >= buffer );\n   return current;\n}\n\nstd::string valueToString( double value )\n{\n   char buffer[32];\n#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with visual studio 2005 to avoid warning. \n   sprintf_s(buffer, sizeof(buffer), \"%#.16g\", value); \n#else\t\n   sprintf(buffer, \"%#.16g\", value); \n#endif\n   char* ch = buffer + strlen(buffer) - 1;\n   if (*ch != '0') return buffer; // nothing to truncate, so save time\n   while(ch > buffer && *ch == '0'){\n     --ch;\n   }\n   char* last_nonzero = ch;\n   while(ch >= buffer){\n     switch(*ch){\n     case '0':\n     case '1':\n     case '2':\n     case '3':\n     case '4':\n     case '5':\n     case '6':\n     case '7':\n     case '8':\n     case '9':\n       --ch;\n       continue;\n     case '.':\n       // Truncate zeroes to save bytes in output, but keep one.\n       *(last_nonzero+2) = '\\0';\n       return buffer;\n     default:\n       return buffer;\n     }\n   }\n   return buffer;\n}\n\n\nstd::string valueToString( bool value )\n{\n   return value ? \"true\" : \"false\";\n}\n\nstd::string valueToQuotedString( const char *value )\n{\n   // Not sure how to handle unicode...\n   if (strpbrk(value, \"\\\"\\\\\\b\\f\\n\\r\\t\") == NULL && !containsControlCharacter( value ))\n      return std::string(\"\\\"\") + value + \"\\\"\";\n   // We have to walk value and escape any special characters.\n   // Appending to std::string is not efficient, but this should be rare.\n   // (Note: forward slashes are *not* rare, but I am not escaping them.)\n   unsigned maxsize = strlen(value)*2 + 3; // allescaped+quotes+NULL\n   std::string result;\n   result.reserve(maxsize); // to avoid lots of mallocs\n   result += \"\\\"\";\n   for (const char* c=value; *c != 0; ++c)\n   {\n      switch(*c)\n      {\n         case '\\\"':\n            result += \"\\\\\\\"\";\n            break;\n         case '\\\\':\n            result += \"\\\\\\\\\";\n            break;\n         case '\\b':\n            result += \"\\\\b\";\n            break;\n         case '\\f':\n            result += \"\\\\f\";\n            break;\n         case '\\n':\n            result += \"\\\\n\";\n            break;\n         case '\\r':\n            result += \"\\\\r\";\n            break;\n         case '\\t':\n            result += \"\\\\t\";\n            break;\n         //case '/':\n            // Even though \\/ is considered a legal escape in JSON, a bare\n            // slash is also legal, so I see no reason to escape it.\n            // (I hope I am not misunderstanding something.\n            // blep notes: actually escaping \\/ may be useful in javascript to avoid </ \n            // sequence.\n            // Should add a flag to allow this compatibility mode and prevent this \n            // sequence from occurring.\n         default:\n            if ( isControlCharacter( *c ) )\n            {\n               std::ostringstream oss;\n               oss << \"\\\\u\" << std::hex << std::uppercase << std::setfill('0') << std::setw(4) << static_cast<int>(*c);\n               result += oss.str();\n            }\n            else\n            {\n               result += *c;\n            }\n            break;\n      }\n   }\n   result += \"\\\"\";\n   return result;\n}\n\n// Class Writer\n// //////////////////////////////////////////////////////////////////\nWriter::~Writer()\n{\n}\n\n\n// Class FastWriter\n// //////////////////////////////////////////////////////////////////\n\nFastWriter::FastWriter()\n   : yamlCompatiblityEnabled_( false )\n{\n}\n\n\nvoid \nFastWriter::enableYAMLCompatibility()\n{\n   yamlCompatiblityEnabled_ = true;\n}\n\n\nstd::string \nFastWriter::write( const Value &root )\n{\n   document_ = \"\";\n   writeValue( root );\n   document_ += \"\\n\";\n   return document_;\n}\n\n\nvoid \nFastWriter::writeValue( const Value &value )\n{\n   switch ( value.type() )\n   {\n   case nullValue:\n      document_ += \"null\";\n      break;\n   case intValue:\n      document_ += valueToString( value.asInt() );\n      break;\n   case uintValue:\n      document_ += valueToString( value.asUInt() );\n      break;\n   case realValue:\n      document_ += valueToString( value.asDouble() );\n      break;\n   case stringValue:\n      document_ += valueToQuotedString( value.asCString() );\n      break;\n   case booleanValue:\n      document_ += valueToString( value.asBool() );\n      break;\n   case arrayValue:\n      {\n         document_ += \"[\";\n         int size = value.size();\n         for ( int index =0; index < size; ++index )\n         {\n            if ( index > 0 )\n               document_ += \",\";\n            writeValue( value[index] );\n         }\n         document_ += \"]\";\n      }\n      break;\n   case objectValue:\n      {\n         Value::Members members( value.getMemberNames() );\n         document_ += \"{\";\n         for ( Value::Members::iterator it = members.begin(); \n               it != members.end(); \n               ++it )\n         {\n            const std::string &name = *it;\n            if ( it != members.begin() )\n               document_ += \",\";\n            document_ += valueToQuotedString( name.c_str() );\n            document_ += yamlCompatiblityEnabled_ ? \": \" \n                                                  : \":\";\n            writeValue( value[name] );\n         }\n         document_ += \"}\";\n      }\n      break;\n   }\n}\n\n\n// Class StyledWriter\n// //////////////////////////////////////////////////////////////////\n\nStyledWriter::StyledWriter()\n   : rightMargin_( 74 )\n   , indentSize_( 3 )\n{\n}\n\n\nstd::string \nStyledWriter::write( const Value &root )\n{\n   document_ = \"\";\n   addChildValues_ = false;\n   indentString_ = \"\";\n   writeCommentBeforeValue( root );\n   writeValue( root );\n   writeCommentAfterValueOnSameLine( root );\n   document_ += \"\\n\";\n   return document_;\n}\n\n\nvoid \nStyledWriter::writeValue( const Value &value )\n{\n   switch ( value.type() )\n   {\n   case nullValue:\n      pushValue( \"null\" );\n      break;\n   case intValue:\n      pushValue( valueToString( value.asInt() ) );\n      break;\n   case uintValue:\n      pushValue( valueToString( value.asUInt() ) );\n      break;\n   case realValue:\n      pushValue( valueToString( value.asDouble() ) );\n      break;\n   case stringValue:\n      pushValue( valueToQuotedString( value.asCString() ) );\n      break;\n   case booleanValue:\n      pushValue( valueToString( value.asBool() ) );\n      break;\n   case arrayValue:\n      writeArrayValue( value);\n      break;\n   case objectValue:\n      {\n         Value::Members members( value.getMemberNames() );\n         if ( members.empty() )\n            pushValue( \"{}\" );\n         else\n         {\n            writeWithIndent( \"{\" );\n            indent();\n            Value::Members::iterator it = members.begin();\n            while ( true )\n            {\n               const std::string &name = *it;\n               const Value &childValue = value[name];\n               writeCommentBeforeValue( childValue );\n               writeWithIndent( valueToQuotedString( name.c_str() ) );\n               document_ += \" : \";\n               writeValue( childValue );\n               if ( ++it == members.end() )\n               {\n                  writeCommentAfterValueOnSameLine( childValue );\n                  break;\n               }\n               document_ += \",\";\n               writeCommentAfterValueOnSameLine( childValue );\n            }\n            unindent();\n            writeWithIndent( \"}\" );\n         }\n      }\n      break;\n   }\n}\n\n\nvoid \nStyledWriter::writeArrayValue( const Value &value )\n{\n   unsigned size = value.size();\n   if ( size == 0 )\n      pushValue( \"[]\" );\n   else\n   {\n      bool isArrayMultiLine = isMultineArray( value );\n      if ( isArrayMultiLine )\n      {\n         writeWithIndent( \"[\" );\n         indent();\n         bool hasChildValue = !childValues_.empty();\n         unsigned index =0;\n         while ( true )\n         {\n            const Value &childValue = value[index];\n            writeCommentBeforeValue( childValue );\n            if ( hasChildValue )\n               writeWithIndent( childValues_[index] );\n            else\n            {\n               writeIndent();\n               writeValue( childValue );\n            }\n            if ( ++index == size )\n            {\n               writeCommentAfterValueOnSameLine( childValue );\n               break;\n            }\n            document_ += \",\";\n            writeCommentAfterValueOnSameLine( childValue );\n         }\n         unindent();\n         writeWithIndent( \"]\" );\n      }\n      else // output on a single line\n      {\n         assert( childValues_.size() == size );\n         document_ += \"[ \";\n         for ( unsigned index =0; index < size; ++index )\n         {\n            if ( index > 0 )\n               document_ += \", \";\n            document_ += childValues_[index];\n         }\n         document_ += \" ]\";\n      }\n   }\n}\n\n\nbool \nStyledWriter::isMultineArray( const Value &value )\n{\n   int size = value.size();\n   bool isMultiLine = size*3 >= rightMargin_ ;\n   childValues_.clear();\n   for ( int index =0; index < size  &&  !isMultiLine; ++index )\n   {\n      const Value &childValue = value[index];\n      isMultiLine = isMultiLine  ||\n                     ( (childValue.isArray()  ||  childValue.isObject())  &&  \n                        childValue.size() > 0 );\n   }\n   if ( !isMultiLine ) // check if line length > max line length\n   {\n      childValues_.reserve( size );\n      addChildValues_ = true;\n      int lineLength = 4 + (size-1)*2; // '[ ' + ', '*n + ' ]'\n      for ( int index =0; index < size  &&  !isMultiLine; ++index )\n      {\n         writeValue( value[index] );\n         lineLength += int( childValues_[index].length() );\n         isMultiLine = isMultiLine  &&  hasCommentForValue( value[index] );\n      }\n      addChildValues_ = false;\n      isMultiLine = isMultiLine  ||  lineLength >= rightMargin_;\n   }\n   return isMultiLine;\n}\n\n\nvoid \nStyledWriter::pushValue( const std::string &value )\n{\n   if ( addChildValues_ )\n      childValues_.push_back( value );\n   else\n      document_ += value;\n}\n\n\nvoid \nStyledWriter::writeIndent()\n{\n   if ( !document_.empty() )\n   {\n      char last = document_[document_.length()-1];\n      if ( last == ' ' )     // already indented\n         return;\n      if ( last != '\\n' )    // Comments may add new-line\n         document_ += '\\n';\n   }\n   document_ += indentString_;\n}\n\n\nvoid \nStyledWriter::writeWithIndent( const std::string &value )\n{\n   writeIndent();\n   document_ += value;\n}\n\n\nvoid \nStyledWriter::indent()\n{\n   indentString_ += std::string( indentSize_, ' ' );\n}\n\n\nvoid \nStyledWriter::unindent()\n{\n   assert( int(indentString_.size()) >= indentSize_ );\n   indentString_.resize( indentString_.size() - indentSize_ );\n}\n\n\nvoid \nStyledWriter::writeCommentBeforeValue( const Value &root )\n{\n   if ( !root.hasComment( commentBefore ) )\n      return;\n   document_ += normalizeEOL( root.getComment( commentBefore ) );\n   document_ += \"\\n\";\n}\n\n\nvoid \nStyledWriter::writeCommentAfterValueOnSameLine( const Value &root )\n{\n   if ( root.hasComment( commentAfterOnSameLine ) )\n      document_ += \" \" + normalizeEOL( root.getComment( commentAfterOnSameLine ) );\n\n   if ( root.hasComment( commentAfter ) )\n   {\n      document_ += \"\\n\";\n      document_ += normalizeEOL( root.getComment( commentAfter ) );\n      document_ += \"\\n\";\n   }\n}\n\n\nbool \nStyledWriter::hasCommentForValue( const Value &value )\n{\n   return value.hasComment( commentBefore )\n          ||  value.hasComment( commentAfterOnSameLine )\n          ||  value.hasComment( commentAfter );\n}\n\n\nstd::string \nStyledWriter::normalizeEOL( const std::string &text )\n{\n   std::string normalized;\n   normalized.reserve( text.length() );\n   const char *begin = text.c_str();\n   const char *end = begin + text.length();\n   const char *current = begin;\n   while ( current != end )\n   {\n      char c = *current++;\n      if ( c == '\\r' ) // mac or dos EOL\n      {\n         if ( *current == '\\n' ) // convert dos EOL\n            ++current;\n         normalized += '\\n';\n      }\n      else // handle unix EOL & other char\n         normalized += c;\n   }\n   return normalized;\n}\n\n\n// Class StyledStreamWriter\n// //////////////////////////////////////////////////////////////////\n\nStyledStreamWriter::StyledStreamWriter( std::string indentation )\n   : document_(NULL)\n   , rightMargin_( 74 )\n   , indentation_( indentation )\n{\n}\n\n\nvoid\nStyledStreamWriter::write( std::ostream &out, const Value &root )\n{\n   document_ = &out;\n   addChildValues_ = false;\n   indentString_ = \"\";\n   writeCommentBeforeValue( root );\n   writeValue( root );\n   writeCommentAfterValueOnSameLine( root );\n   *document_ << \"\\n\";\n   document_ = NULL; // Forget the stream, for safety.\n}\n\n\nvoid \nStyledStreamWriter::writeValue( const Value &value )\n{\n   switch ( value.type() )\n   {\n   case nullValue:\n      pushValue( \"null\" );\n      break;\n   case intValue:\n      pushValue( valueToString( value.asInt() ) );\n      break;\n   case uintValue:\n      pushValue( valueToString( value.asUInt() ) );\n      break;\n   case realValue:\n      pushValue( valueToString( value.asDouble() ) );\n      break;\n   case stringValue:\n      pushValue( valueToQuotedString( value.asCString() ) );\n      break;\n   case booleanValue:\n      pushValue( valueToString( value.asBool() ) );\n      break;\n   case arrayValue:\n      writeArrayValue( value);\n      break;\n   case objectValue:\n      {\n         Value::Members members( value.getMemberNames() );\n         if ( members.empty() )\n            pushValue( \"{}\" );\n         else\n         {\n            writeWithIndent( \"{\" );\n            indent();\n            Value::Members::iterator it = members.begin();\n            while ( true )\n            {\n               const std::string &name = *it;\n               const Value &childValue = value[name];\n               writeCommentBeforeValue( childValue );\n               writeWithIndent( valueToQuotedString( name.c_str() ) );\n               *document_ << \" : \";\n               writeValue( childValue );\n               if ( ++it == members.end() )\n               {\n                  writeCommentAfterValueOnSameLine( childValue );\n                  break;\n               }\n               *document_ << \",\";\n               writeCommentAfterValueOnSameLine( childValue );\n            }\n            unindent();\n            writeWithIndent( \"}\" );\n         }\n      }\n      break;\n   }\n}\n\n\nvoid \nStyledStreamWriter::writeArrayValue( const Value &value )\n{\n   unsigned size = value.size();\n   if ( size == 0 )\n      pushValue( \"[]\" );\n   else\n   {\n      bool isArrayMultiLine = isMultineArray( value );\n      if ( isArrayMultiLine )\n      {\n         writeWithIndent( \"[\" );\n         indent();\n         bool hasChildValue = !childValues_.empty();\n         unsigned index =0;\n         while ( true )\n         {\n            const Value &childValue = value[index];\n            writeCommentBeforeValue( childValue );\n            if ( hasChildValue )\n               writeWithIndent( childValues_[index] );\n            else\n            {\n\t       writeIndent();\n               writeValue( childValue );\n            }\n            if ( ++index == size )\n            {\n               writeCommentAfterValueOnSameLine( childValue );\n               break;\n            }\n            *document_ << \",\";\n            writeCommentAfterValueOnSameLine( childValue );\n         }\n         unindent();\n         writeWithIndent( \"]\" );\n      }\n      else // output on a single line\n      {\n         assert( childValues_.size() == size );\n         *document_ << \"[ \";\n         for ( unsigned index =0; index < size; ++index )\n         {\n            if ( index > 0 )\n               *document_ << \", \";\n            *document_ << childValues_[index];\n         }\n         *document_ << \" ]\";\n      }\n   }\n}\n\n\nbool \nStyledStreamWriter::isMultineArray( const Value &value )\n{\n   int size = value.size();\n   bool isMultiLine = size*3 >= rightMargin_ ;\n   childValues_.clear();\n   for ( int index =0; index < size  &&  !isMultiLine; ++index )\n   {\n      const Value &childValue = value[index];\n      isMultiLine = isMultiLine  ||\n                     ( (childValue.isArray()  ||  childValue.isObject())  &&  \n                        childValue.size() > 0 );\n   }\n   if ( !isMultiLine ) // check if line length > max line length\n   {\n      childValues_.reserve( size );\n      addChildValues_ = true;\n      int lineLength = 4 + (size-1)*2; // '[ ' + ', '*n + ' ]'\n      for ( int index =0; index < size  &&  !isMultiLine; ++index )\n      {\n         writeValue( value[index] );\n         lineLength += int( childValues_[index].length() );\n         isMultiLine = isMultiLine  &&  hasCommentForValue( value[index] );\n      }\n      addChildValues_ = false;\n      isMultiLine = isMultiLine  ||  lineLength >= rightMargin_;\n   }\n   return isMultiLine;\n}\n\n\nvoid \nStyledStreamWriter::pushValue( const std::string &value )\n{\n   if ( addChildValues_ )\n      childValues_.push_back( value );\n   else\n      *document_ << value;\n}\n\n\nvoid \nStyledStreamWriter::writeIndent()\n{\n  /*\n    Some comments in this method would have been nice. ;-)\n\n   if ( !document_.empty() )\n   {\n      char last = document_[document_.length()-1];\n      if ( last == ' ' )     // already indented\n         return;\n      if ( last != '\\n' )    // Comments may add new-line\n         *document_ << '\\n';\n   }\n  */\n   *document_ << '\\n' << indentString_;\n}\n\n\nvoid \nStyledStreamWriter::writeWithIndent( const std::string &value )\n{\n   writeIndent();\n   *document_ << value;\n}\n\n\nvoid \nStyledStreamWriter::indent()\n{\n   indentString_ += indentation_;\n}\n\n\nvoid \nStyledStreamWriter::unindent()\n{\n   assert( indentString_.size() >= indentation_.size() );\n   indentString_.resize( indentString_.size() - indentation_.size() );\n}\n\n\nvoid \nStyledStreamWriter::writeCommentBeforeValue( const Value &root )\n{\n   if ( !root.hasComment( commentBefore ) )\n      return;\n   *document_ << normalizeEOL( root.getComment( commentBefore ) );\n   *document_ << \"\\n\";\n}\n\n\nvoid \nStyledStreamWriter::writeCommentAfterValueOnSameLine( const Value &root )\n{\n   if ( root.hasComment( commentAfterOnSameLine ) )\n      *document_ << \" \" + normalizeEOL( root.getComment( commentAfterOnSameLine ) );\n\n   if ( root.hasComment( commentAfter ) )\n   {\n      *document_ << \"\\n\";\n      *document_ << normalizeEOL( root.getComment( commentAfter ) );\n      *document_ << \"\\n\";\n   }\n}\n\n\nbool \nStyledStreamWriter::hasCommentForValue( const Value &value )\n{\n   return value.hasComment( commentBefore )\n          ||  value.hasComment( commentAfterOnSameLine )\n          ||  value.hasComment( commentAfter );\n}\n\n\nstd::string \nStyledStreamWriter::normalizeEOL( const std::string &text )\n{\n   std::string normalized;\n   normalized.reserve( text.length() );\n   const char *begin = text.c_str();\n   const char *end = begin + text.length();\n   const char *current = begin;\n   while ( current != end )\n   {\n      char c = *current++;\n      if ( c == '\\r' ) // mac or dos EOL\n      {\n         if ( *current == '\\n' ) // convert dos EOL\n            ++current;\n         normalized += '\\n';\n      }\n      else // handle unix EOL & other char\n         normalized += c;\n   }\n   return normalized;\n}\n\n\nstd::ostream& operator<<( std::ostream &sout, const Value &root )\n{\n   Json::StyledStreamWriter writer;\n   writer.write(sout, root);\n   return sout;\n}\n\n\n} // namespace Json\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/src/lib_json/sconscript",
    "content": "Import( 'env buildLibrary' )\n\nbuildLibrary( env, Split( \"\"\"\n    json_reader.cpp \n    json_value.cpp \n    json_writer.cpp\n     \"\"\" ),\n    'json' )\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/src/test_lib_json/jsontest.cpp",
    "content": "#define _CRT_SECURE_NO_WARNINGS 1 // Prevents deprecation warning with MSVC\n#include \"jsontest.h\"\n#include <stdio.h>\n#include <string>\n\n#if defined(_MSC_VER)\n// Used to install a report hook that prevent dialog on assertion and error.\n# include <crtdbg.h>\n#endif // if defined(_MSC_VER)\n\n#if defined(_WIN32)\n// Used to prevent dialog on memory fault.\n// Limits headers included by Windows.h\n# define WIN32_LEAN_AND_MEAN\n# define NOSERVICE\n# define NOMCX\n# define NOIME\n# define NOSOUND\n# define NOCOMM\n# define NORPC\n# define NOGDI\n# define NOUSER\n# define NODRIVERS\n# define NOLOGERROR\n# define NOPROFILER\n# define NOMEMMGR\n# define NOLFILEIO\n# define NOOPENFILE\n# define NORESOURCE\n# define NOATOM\n# define NOLANGUAGE\n# define NOLSTRING\n# define NODBCS\n# define NOKEYBOARDINFO\n# define NOGDICAPMASKS\n# define NOCOLOR\n# define NOGDIOBJ\n# define NODRAWTEXT\n# define NOTEXTMETRIC\n# define NOSCALABLEFONT\n# define NOBITMAP\n# define NORASTEROPS\n# define NOMETAFILE\n# define NOSYSMETRICS\n# define NOSYSTEMPARAMSINFO\n# define NOMSG\n# define NOWINSTYLES\n# define NOWINOFFSETS\n# define NOSHOWWINDOW\n# define NODEFERWINDOWPOS\n# define NOVIRTUALKEYCODES\n# define NOKEYSTATES\n# define NOWH\n# define NOMENUS\n# define NOSCROLL\n# define NOCLIPBOARD\n# define NOICONS\n# define NOMB\n# define NOSYSCOMMANDS\n# define NOMDI\n# define NOCTLMGR\n# define NOWINMESSAGES\n# include <windows.h>\n#endif // if defined(_WIN32)\n\nnamespace JsonTest {\n\n\n// class TestResult\n// //////////////////////////////////////////////////////////////////\n\nTestResult::TestResult()\n   : predicateId_( 1 )\n   , lastUsedPredicateId_( 0 )\n   , messageTarget_( 0 )\n{\n   // The root predicate has id 0\n   rootPredicateNode_.id_ = 0;\n   rootPredicateNode_.next_ = 0;\n   predicateStackTail_ = &rootPredicateNode_;\n}\n\n\nvoid \nTestResult::setTestName( const std::string &name )\n{\n   name_ = name;\n}\n\nTestResult &\nTestResult::addFailure( const char *file, unsigned int line,\n                        const char *expr )\n{\n   /// Walks the PredicateContext stack adding them to failures_ if not already added.\n   unsigned int nestingLevel = 0;\n   PredicateContext *lastNode = rootPredicateNode_.next_;\n   for ( ; lastNode != 0; lastNode = lastNode->next_ )\n   {\n      if ( lastNode->id_ > lastUsedPredicateId_ ) // new PredicateContext\n      {\n         lastUsedPredicateId_ = lastNode->id_;\n         addFailureInfo( lastNode->file_, lastNode->line_, lastNode->expr_,\n                         nestingLevel );\n         // Link the PredicateContext to the failure for message target when \n         // popping the PredicateContext.\n         lastNode->failure_ = &( failures_.back() );\n      }\n      ++nestingLevel;\n   }\n\n   // Adds the failed assertion\n   addFailureInfo( file, line, expr, nestingLevel );\n   messageTarget_ = &( failures_.back() );\n   return *this;\n}\n\n\nvoid \nTestResult::addFailureInfo( const char *file, unsigned int line,\n                            const char *expr, unsigned int nestingLevel )\n{\n   Failure failure;\n   failure.file_ = file;\n   failure.line_ = line;\n   if ( expr )\n   {\n      failure.expr_ = expr;\n   }\n   failure.nestingLevel_ = nestingLevel;\n   failures_.push_back( failure );\n}\n\n\nTestResult &\nTestResult::popPredicateContext()\n{\n   PredicateContext *lastNode = &rootPredicateNode_;\n   while ( lastNode->next_ != 0  &&  lastNode->next_->next_ != 0 )\n   {\n      lastNode = lastNode->next_;\n   }\n   // Set message target to popped failure\n   PredicateContext *tail = lastNode->next_;\n   if ( tail != 0  &&  tail->failure_ != 0 )\n   {\n      messageTarget_ = tail->failure_;\n   }\n   // Remove tail from list\n   predicateStackTail_ = lastNode;\n   lastNode->next_ = 0;\n   return *this;\n}\n\n\nbool \nTestResult::failed() const\n{\n   return !failures_.empty();\n}\n\n\nunsigned int \nTestResult::getAssertionNestingLevel() const\n{\n   unsigned int level = 0;\n   const PredicateContext *lastNode = &rootPredicateNode_;\n   while ( lastNode->next_ != 0 )\n   {\n      lastNode = lastNode->next_;\n      ++level;\n   }\n   return level;\n}\n\n\nvoid \nTestResult::printFailure( bool printTestName ) const\n{\n   if ( failures_.empty() )\n   {\n      return;\n   }\n\n   if ( printTestName )\n   {\n      printf( \"* Detail of %s test failure:\\n\", name_.c_str() );\n   }\n\n   // Print in reverse to display the callstack in the right order\n   Failures::const_iterator itEnd = failures_.end();\n   for ( Failures::const_iterator it = failures_.begin(); it != itEnd; ++it )\n   {\n      const Failure &failure = *it;\n      std::string indent( failure.nestingLevel_ * 2, ' ' );\n      if ( failure.file_ )\n      {\n         printf( \"%s%s(%d): \", indent.c_str(), failure.file_, failure.line_ );\n      }\n      if ( !failure.expr_.empty() )\n      {\n         printf( \"%s\\n\", failure.expr_.c_str() );\n      }\n      else if ( failure.file_ )\n      {\n         printf( \"\\n\" );\n      }\n      if ( !failure.message_.empty() )\n      {\n         std::string reindented = indentText( failure.message_, indent + \"  \" );\n         printf( \"%s\\n\", reindented.c_str() );\n      }\n   }\n}\n\n\nstd::string \nTestResult::indentText( const std::string &text, \n                        const std::string &indent )\n{\n   std::string reindented;\n   std::string::size_type lastIndex = 0;\n   while ( lastIndex < text.size() )\n   {\n      std::string::size_type nextIndex = text.find( '\\n', lastIndex );\n      if ( nextIndex == std::string::npos )\n      {\n         nextIndex = text.size() - 1;\n      }\n      reindented += indent;\n      reindented += text.substr( lastIndex, nextIndex - lastIndex + 1 );\n      lastIndex = nextIndex + 1;\n   }\n   return reindented;\n}\n\n\nTestResult &\nTestResult::addToLastFailure( const std::string &message )\n{\n   if ( messageTarget_ != 0 )\n   {\n      messageTarget_->message_ += message;\n   }\n   return *this;\n}\n\n\nTestResult &\nTestResult::operator << ( bool value )\n{\n   return addToLastFailure( value ? \"true\" : \"false\" );\n}\n\n\nTestResult &\nTestResult::operator << ( int value )\n{\n   char buffer[32];\n   sprintf( buffer, \"%d\", value );\n   return addToLastFailure( buffer );\n}\n\n\nTestResult &\nTestResult::operator << ( unsigned int value )\n{\n   char buffer[32];\n   sprintf( buffer, \"%u\", value );\n   return addToLastFailure( buffer );\n}\n\n\nTestResult &\nTestResult::operator << ( double value )\n{\n   char buffer[32];\n   sprintf( buffer, \"%16g\", value );\n   return addToLastFailure( buffer );\n}\n\n\nTestResult &\nTestResult::operator << ( const char *value )\n{\n   return addToLastFailure( value ? value \n                                  : \"<NULL>\" );\n}\n\n\nTestResult &\nTestResult::operator << ( const std::string &value )\n{\n   return addToLastFailure( value );\n}\n\n\n\n// class TestCase\n// //////////////////////////////////////////////////////////////////\n\nTestCase::TestCase()\n   : result_( 0 )\n{\n}\n\n\nTestCase::~TestCase()\n{\n}\n\n\nvoid \nTestCase::run( TestResult &result )\n{\n   result_ = &result;\n   runTestCase();\n}\n\n\n\n// class Runner\n// //////////////////////////////////////////////////////////////////\n\nRunner::Runner()\n{\n}\n\n\nRunner &\nRunner::add( TestCaseFactory factory )\n{\n   tests_.push_back( factory );\n   return *this;\n}\n\n\nunsigned int \nRunner::testCount() const\n{\n   return static_cast<unsigned int>( tests_.size() );\n}\n\n\nstd::string \nRunner::testNameAt( unsigned int index ) const\n{\n   TestCase *test = tests_[index]();\n   std::string name = test->testName();\n   delete test;\n   return name;\n}\n\n\nvoid \nRunner::runTestAt( unsigned int index, TestResult &result ) const\n{\n   TestCase *test = tests_[index]();\n   result.setTestName( test->testName() );\n   printf( \"Testing %s: \", test->testName() );\n   fflush( stdout );\n#if JSON_USE_EXCEPTION\n   try \n   {\n#endif // if JSON_USE_EXCEPTION\n      test->run( result );\n#if JSON_USE_EXCEPTION\n   } \n   catch ( const std::exception &e ) \n   {\n      result.addFailure( __FILE__, __LINE__, \n         \"Unexpected exception caugth:\" ) << e.what();\n   }\n#endif // if JSON_USE_EXCEPTION\n   delete test;\n   const char *status = result.failed() ? \"FAILED\" \n                                        : \"OK\";\n   printf( \"%s\\n\", status );\n   fflush( stdout );\n}\n\n\nbool \nRunner::runAllTest( bool printSummary ) const\n{\n   unsigned int count = testCount();\n   std::deque<TestResult> failures;\n   for ( unsigned int index = 0; index < count; ++index )\n   {\n      TestResult result;\n      runTestAt( index, result );\n      if ( result.failed() )\n      {\n         failures.push_back( result );\n      }\n   }\n\n   if ( failures.empty() )\n   {\n      if ( printSummary )\n      {\n         printf( \"All %d tests passed\\n\", count );\n      }\n      return true;\n   }\n   else\n   {\n      for ( unsigned int index = 0; index < failures.size(); ++index )\n      {\n         TestResult &result = failures[index];\n         result.printFailure( count > 1 );\n      }\n\n      if ( printSummary )\n      {\n         unsigned int failedCount = static_cast<unsigned int>( failures.size() );\n         unsigned int passedCount = count - failedCount;\n         printf( \"%d/%d tests passed (%d failure(s))\\n\", passedCount, count, failedCount );\n      }\n      return false;\n   }\n}\n\n\nbool \nRunner::testIndex( const std::string &testName, \n                   unsigned int &indexOut ) const\n{\n   unsigned int count = testCount();\n   for ( unsigned int index = 0; index < count; ++index )\n   {\n      if ( testNameAt(index) == testName )\n      {\n         indexOut = index;\n         return true;\n      }\n   }\n   return false;\n}\n\n\nvoid \nRunner::listTests() const\n{\n   unsigned int count = testCount();\n   for ( unsigned int index = 0; index < count; ++index )\n   {\n      printf( \"%s\\n\", testNameAt( index ).c_str() );\n   }\n}\n\n\nint \nRunner::runCommandLine( int argc, const char *argv[] ) const\n{\n   typedef std::deque<std::string> TestNames;\n   Runner subrunner;\n   for ( int index = 1; index < argc; ++index )\n   {\n      std::string opt = argv[index];\n      if ( opt == \"--list-tests\" )\n      {\n         listTests();\n         return 0;\n      }\n      else if ( opt == \"--test-auto\" )\n      {\n         preventDialogOnCrash();\n      }\n      else if ( opt == \"--test\" )\n      {\n         ++index;\n         if ( index < argc )\n         {\n            unsigned int testNameIndex;\n            if ( testIndex( argv[index], testNameIndex ) )\n            {\n               subrunner.add( tests_[testNameIndex] );\n            }\n            else\n            {\n               fprintf( stderr, \"Test '%s' does not exist!\\n\", argv[index] );\n               return 2;\n            }\n         }\n         else\n         {\n            printUsage( argv[0] );\n            return 2;\n         }\n      }\n      else\n      {\n         printUsage( argv[0] );\n         return 2;\n      }\n   }\n   bool succeeded;\n   if ( subrunner.testCount() > 0 )\n   {\n      succeeded = subrunner.runAllTest( subrunner.testCount() > 1 );\n   }\n   else\n   {\n      succeeded = runAllTest( true );\n   }\n   return succeeded ? 0 \n                    : 1;\n}\n\n\n#if defined(_MSC_VER)\n// Hook MSVCRT assertions to prevent dialog from appearing\nstatic int \nmsvcrtSilentReportHook( int reportType, char *message, int *returnValue )\n{\n   // The default CRT handling of error and assertion is to display\n   // an error dialog to the user.\n   // Instead, when an error or an assertion occurs, we force the \n   // application to terminate using abort() after display\n   // the message on stderr. \n   if ( reportType == _CRT_ERROR  ||  \n        reportType == _CRT_ASSERT )\n   {\n      // calling abort() cause the ReportHook to be called\n      // The following is used to detect this case and let's the\n      // error handler fallback on its default behaviour (\n      // display a warning message)\n      static volatile bool isAborting = false;\n      if ( isAborting ) \n      {\n         return TRUE;\n      }\n      isAborting = true;\n\n      fprintf( stderr, \"CRT Error/Assert:\\n%s\\n\", message );\n      fflush( stderr );\n      abort();\n   }\n   // Let's other reportType (_CRT_WARNING) be handled as they would by default\n   return FALSE;\n}\n#endif // if defined(_MSC_VER)\n\n\nvoid \nRunner::preventDialogOnCrash()\n{\n#if defined(_MSC_VER)\n   // Install a hook to prevent MSVCRT error and assertion from\n   // popping a dialog.\n   _CrtSetReportHook( &msvcrtSilentReportHook );\n#endif // if defined(_MSC_VER)\n\n   // @todo investiguate this handler (for buffer overflow)\n   // _set_security_error_handler\n\n#if defined(_WIN32)\n   // Prevents the system from popping a dialog for debugging if the\n   // application fails due to invalid memory access.\n   SetErrorMode( SEM_FAILCRITICALERRORS \n                 | SEM_NOGPFAULTERRORBOX \n                 | SEM_NOOPENFILEERRORBOX );\n#endif // if defined(_WIN32)\n}\n\nvoid \nRunner::printUsage( const char *appName )\n{\n   printf( \n      \"Usage: %s [options]\\n\"\n      \"\\n\"\n      \"If --test is not specified, then all the test cases be run.\\n\"\n      \"\\n\"\n      \"Valid options:\\n\"\n      \"--list-tests: print the name of all test cases on the standard\\n\"\n      \"              output and exit.\\n\"\n      \"--test TESTNAME: executes the test case with the specified name.\\n\"\n      \"                 May be repeated.\\n\"\n      \"--test-auto: prevent dialog prompting for debugging on crash.\\n\"\n      , appName );\n}\n\n\n\n// Assertion functions\n// //////////////////////////////////////////////////////////////////\n\nTestResult &\ncheckStringEqual( TestResult &result, \n                  const std::string &expected, const std::string &actual,\n                  const char *file, unsigned int line, const char *expr )\n{\n   if ( expected != actual )\n   {\n      result.addFailure( file, line, expr );\n      result << \"Expected: '\" << expected << \"'\\n\";\n      result << \"Actual  : '\" << actual << \"'\";\n   }\n   return result;\n}\n\n\n} // namespace JsonTest\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/src/test_lib_json/jsontest.h",
    "content": "#ifndef JSONTEST_H_INCLUDED\n# define JSONTEST_H_INCLUDED\n\n# include <json/config.h>\n# include <stdio.h>\n# include <deque>\n# include <string>\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// Mini Unit Testing framework\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n\n\n\n/** \\brief Unit testing framework.\n * \\warning: all assertions are non-aborting, test case execution will continue\n *           even if an assertion namespace.\n *           This constraint is for portability: the framework needs to compile\n *           on Visual Studio 6 and must not require exception usage.\n */\nnamespace JsonTest {\n\n\n   class Failure\n   {\n   public:\n      const char *file_;\n      unsigned int line_;\n      std::string expr_;\n      std::string message_;\n      unsigned int nestingLevel_;\n   };\n\n\n   /// Context used to create the assertion callstack on failure.\n   /// Must be a POD to allow inline initialisation without stepping \n   /// into the debugger.\n   struct PredicateContext\n   {\n      typedef unsigned int Id;\n      Id id_;\n      const char *file_;\n      unsigned int line_;\n      const char *expr_;\n      PredicateContext *next_;\n      /// Related Failure, set when the PredicateContext is converted\n      /// into a Failure.\n      Failure *failure_;\n   };\n\n   class TestResult\n   {\n   public:\n      TestResult();\n\n      /// \\internal Implementation detail for assertion macros\n      /// Not encapsulated to prevent step into when debugging failed assertions\n      /// Incremented by one on assertion predicate entry, decreased by one\n      /// by addPredicateContext().\n      PredicateContext::Id predicateId_;\n\n      /// \\internal Implementation detail for predicate macros\n      PredicateContext *predicateStackTail_;\n\n      void setTestName( const std::string &name );\n\n      /// Adds an assertion failure.\n      TestResult &addFailure( const char *file, unsigned int line,\n                              const char *expr = 0 );\n\n      /// Removes the last PredicateContext added to the predicate stack\n      /// chained list.\n      /// Next messages will be targed at the PredicateContext that was removed.\n      TestResult &popPredicateContext();\n\n      bool failed() const;\n\n      void printFailure( bool printTestName ) const;\n\n      TestResult &operator << ( bool value );\n      TestResult &operator << ( int value );\n      TestResult &operator << ( unsigned int value );\n      TestResult &operator << ( double value );\n      TestResult &operator << ( const char *value );\n      TestResult &operator << ( const std::string &value );\n\n   private:\n      TestResult &addToLastFailure( const std::string &message );\n      unsigned int getAssertionNestingLevel() const;\n      /// Adds a failure or a predicate context\n      void addFailureInfo( const char *file, unsigned int line,\n                           const char *expr, unsigned int nestingLevel  );\n      static std::string indentText( const std::string &text, \n                                     const std::string &indent );\n\n      typedef std::deque<Failure> Failures;\n      Failures failures_;\n      std::string name_;\n      PredicateContext rootPredicateNode_;\n      PredicateContext::Id lastUsedPredicateId_;\n      /// Failure which is the target of the messages added using operator <<\n      Failure *messageTarget_;\n   };\n\n\n   class TestCase\n   {\n   public:\n      TestCase();\n\n      virtual ~TestCase();\n\n      void run( TestResult &result );\n\n      virtual const char *testName() const = 0;\n\n   protected:\n      TestResult *result_;\n\n   private:\n      virtual void runTestCase() = 0;\n   };\n\n   /// Function pointer type for TestCase factory\n   typedef TestCase *(*TestCaseFactory)();\n\n   class Runner\n   {\n   public:\n      Runner();\n\n      /// Adds a test to the suite\n      Runner &add( TestCaseFactory factory );\n\n      /// Runs test as specified on the command-line\n      /// If no command-line arguments are provided, run all tests.\n      /// If --list-tests is provided, then print the list of all test cases\n      /// If --test <testname> is provided, then run test testname.\n      int runCommandLine( int argc, const char *argv[] ) const;\n\n      /// Runs all the test cases\n      bool runAllTest( bool printSummary ) const;\n\n      /// Returns the number of test case in the suite\n      unsigned int testCount() const;\n\n      /// Returns the name of the test case at the specified index\n      std::string testNameAt( unsigned int index ) const;\n\n      /// Runs the test case at the specified index using the specified TestResult\n      void runTestAt( unsigned int index, TestResult &result ) const;\n\n      static void printUsage( const char *appName );\n\n   private: // prevents copy construction and assignment\n      Runner( const Runner &other );\n      Runner &operator =( const Runner &other );\n\n   private:\n      void listTests() const;\n      bool testIndex( const std::string &testName, unsigned int &index ) const;\n      static void preventDialogOnCrash();\n\n   private:\n      typedef std::deque<TestCaseFactory> Factories;\n      Factories tests_;\n   };\n\n   template<typename T>\n   TestResult &\n   checkEqual( TestResult &result, const T &expected, const T &actual, \n               const char *file, unsigned int line, const char *expr )\n   {\n      if ( expected != actual )\n      {\n         result.addFailure( file, line, expr );\n         result << \"Expected: \" << expected << \"\\n\";\n         result << \"Actual  : \" << actual;\n      }\n      return result;\n   }\n\n   TestResult &\n   checkStringEqual( TestResult &result, \n                     const std::string &expected, const std::string &actual,\n                     const char *file, unsigned int line, const char *expr );\n\n} // namespace JsonTest\n\n\n/// \\brief Asserts that the given expression is true.\n/// JSONTEST_ASSERT( x == y ) << \"x=\" << x << \", y=\" << y;\n/// JSONTEST_ASSERT( x == y );\n#define JSONTEST_ASSERT( expr )                                               \\\n   if ( condition )                                                           \\\n   {                                                                          \\\n   }                                                                          \\\n   else                                                                       \\\n      result_->addFailure( __FILE__, __LINE__, #expr )\n\n/// \\brief Asserts that the given predicate is true.\n/// The predicate may do other assertions and be a member function of the fixture.\n#define JSONTEST_ASSERT_PRED( expr )                                    \\\n   {                                                                    \\\n      JsonTest::PredicateContext _minitest_Context = {                  \\\n         result_->predicateId_, __FILE__, __LINE__, #expr };            \\\n      result_->predicateStackTail_->next_ = &_minitest_Context;         \\\n      result_->predicateId_ += 1;                                       \\\n      result_->predicateStackTail_ = &_minitest_Context;                \\\n      (expr);                                                           \\\n      result_->popPredicateContext();                                   \\\n   }                                                                    \\\n   *result_\n\n/// \\brief Asserts that two values are equals.\n#define JSONTEST_ASSERT_EQUAL( expected, actual )          \\\n   JsonTest::checkEqual( *result_, expected, actual,       \\\n                         __FILE__, __LINE__,               \\\n                         #expected \" == \" #actual )\n\n/// \\brief Asserts that two values are equals.\n#define JSONTEST_ASSERT_STRING_EQUAL( expected, actual ) \\\n   JsonTest::checkStringEqual( *result_,                 \\\n      std::string(expected), std::string(actual),        \\\n      #expected \" == \" #actual )\n\n/// \\brief Begin a fixture test case.\n#define JSONTEST_FIXTURE( FixtureType, name )                  \\\n   class Test##FixtureType##name : public FixtureType          \\\n   {                                                           \\\n   public:                                                     \\\n      static JsonTest::TestCase *factory()                     \\\n      {                                                        \\\n         return new Test##FixtureType##name();                 \\\n      }                                                        \\\n   public: /* overidden from TestCase */                       \\\n      virtual const char *testName() const                     \\\n      {                                                        \\\n         return #FixtureType \"/\" #name;                        \\\n      }                                                        \\\n      virtual void runTestCase();                              \\\n   };                                                          \\\n                                                               \\\n   void Test##FixtureType##name::runTestCase()\n\n#define JSONTEST_FIXTURE_FACTORY( FixtureType, name ) \\\n   &Test##FixtureType##name::factory\n\n#define JSONTEST_REGISTER_FIXTURE( runner, FixtureType, name ) \\\n   (runner).add( JSONTEST_FIXTURE_FACTORY( FixtureType, name ) )\n\n#endif // ifndef JSONTEST_H_INCLUDED\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/src/test_lib_json/main.cpp",
    "content": "#include <json/json.h>\n#include \"jsontest.h\"\n\n\n// TODO:\n// - boolean value returns that they are integral. Should not be.\n// - unsigned integer in integer range are not considered to be valid integer. Should check range.\n\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// Json Library test cases\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n\n\nstruct ValueTest : JsonTest::TestCase\n{\n   Json::Value null_;\n   Json::Value emptyArray_;\n   Json::Value emptyObject_;\n   Json::Value integer_;\n   Json::Value unsignedInteger_;\n   Json::Value smallUnsignedInteger_;\n   Json::Value real_;\n   Json::Value array1_;\n   Json::Value object1_;\n   Json::Value emptyString_;\n   Json::Value string1_;\n   Json::Value string_;\n   Json::Value true_;\n   Json::Value false_;\n\n   ValueTest()\n      : emptyArray_( Json::arrayValue )\n      , emptyObject_( Json::objectValue )\n      , integer_( 123456789 )\n      , smallUnsignedInteger_( Json::Value::UInt( Json::Value::maxInt ) )\n      , unsignedInteger_( 34567890u )\n      , real_( 1234.56789 )\n      , emptyString_( \"\" )\n      , string1_( \"a\" )\n      , string_( \"sometext with space\" )\n      , true_( true )\n      , false_( false )\n   {\n      array1_.append( 1234 );\n      object1_[\"id\"] = 1234;\n   }\n\n   struct IsCheck\n   {\n      /// Initialize all checks to \\c false by default.\n      IsCheck();\n\n      bool isObject_;\n      bool isArray_;\n      bool isBool_;\n      bool isDouble_;\n      bool isInt_;\n      bool isUInt_;\n      bool isIntegral_;\n      bool isNumeric_;\n      bool isString_;\n      bool isNull_;\n   };\n\n   void checkConstMemberCount( const Json::Value &value, unsigned int expectedCount );\n\n   void checkMemberCount( Json::Value &value, unsigned int expectedCount );\n\n   void checkIs( const Json::Value &value, const IsCheck &check );\n};\n\n\nJSONTEST_FIXTURE( ValueTest, size )\n{\n   JSONTEST_ASSERT_PRED( checkMemberCount(emptyArray_, 0) );\n   JSONTEST_ASSERT_PRED( checkMemberCount(emptyObject_, 0) );\n   JSONTEST_ASSERT_PRED( checkMemberCount(array1_, 1) );\n   JSONTEST_ASSERT_PRED( checkMemberCount(object1_, 1) );\n   JSONTEST_ASSERT_PRED( checkMemberCount(null_, 0) );\n   JSONTEST_ASSERT_PRED( checkMemberCount(integer_, 0) );\n   JSONTEST_ASSERT_PRED( checkMemberCount(real_, 0) );\n   JSONTEST_ASSERT_PRED( checkMemberCount(emptyString_, 0) );\n   JSONTEST_ASSERT_PRED( checkMemberCount(string_, 0) );\n   JSONTEST_ASSERT_PRED( checkMemberCount(true_, 0) );\n}\n\n\nJSONTEST_FIXTURE( ValueTest, isObject )\n{\n   IsCheck checks;\n   checks.isObject_ = true;\n   JSONTEST_ASSERT_PRED( checkIs( emptyObject_, checks ) );\n   JSONTEST_ASSERT_PRED( checkIs( object1_, checks ) );\n}\n\n\nJSONTEST_FIXTURE( ValueTest, isArray )\n{\n   IsCheck checks;\n   checks.isArray_ = true;\n   JSONTEST_ASSERT_PRED( checkIs( emptyArray_, checks ) );\n   JSONTEST_ASSERT_PRED( checkIs( array1_, checks ) );\n}\n\n\nJSONTEST_FIXTURE( ValueTest, isNull )\n{\n   IsCheck checks;\n   checks.isNull_ = true;\n   checks.isObject_ = true;\n   checks.isArray_ = true;\n   JSONTEST_ASSERT_PRED( checkIs( null_, checks ) );\n}\n\n\nJSONTEST_FIXTURE( ValueTest, isString )\n{\n   IsCheck checks;\n   checks.isString_ = true;\n   JSONTEST_ASSERT_PRED( checkIs( emptyString_, checks ) );\n   JSONTEST_ASSERT_PRED( checkIs( string_, checks ) );\n   JSONTEST_ASSERT_PRED( checkIs( string1_, checks ) );\n}\n\n\nJSONTEST_FIXTURE( ValueTest, isBool )\n{\n   IsCheck checks;\n   checks.isBool_ = true;\n   checks.isIntegral_ = true;\n   checks.isNumeric_ = true;\n   JSONTEST_ASSERT_PRED( checkIs( false_, checks ) );\n   JSONTEST_ASSERT_PRED( checkIs( true_, checks ) );\n}\n\n\nJSONTEST_FIXTURE( ValueTest, isDouble )\n{\n   IsCheck checks;\n   checks.isDouble_ = true;\n   checks.isNumeric_ = true;\n   JSONTEST_ASSERT_PRED( checkIs( real_, checks ) );\n}\n\n\nJSONTEST_FIXTURE( ValueTest, isInt )\n{\n   IsCheck checks;\n   checks.isInt_ = true;\n   checks.isNumeric_ = true;\n   checks.isIntegral_ = true;\n   JSONTEST_ASSERT_PRED( checkIs( integer_, checks ) );\n}\n\n\nJSONTEST_FIXTURE( ValueTest, isUInt )\n{\n   IsCheck checks;\n   checks.isUInt_ = true;\n   checks.isNumeric_ = true;\n   checks.isIntegral_ = true;\n   JSONTEST_ASSERT_PRED( checkIs( unsignedInteger_, checks ) );\n   JSONTEST_ASSERT_PRED( checkIs( smallUnsignedInteger_, checks ) );\n}\n\n\nvoid\nValueTest::checkConstMemberCount( const Json::Value &value, unsigned int expectedCount )\n{\n   unsigned int count = 0;\n   Json::Value::const_iterator itEnd = value.end();\n   for ( Json::Value::const_iterator it = value.begin(); it != itEnd; ++it )\n   {\n      ++count;\n   }\n   JSONTEST_ASSERT_EQUAL( expectedCount, count ) << \"Json::Value::const_iterator\";\n}\n\nvoid\nValueTest::checkMemberCount( Json::Value &value, unsigned int expectedCount )\n{\n   JSONTEST_ASSERT_EQUAL( expectedCount, value.size() );\n\n   unsigned int count = 0;\n   Json::Value::iterator itEnd = value.end();\n   for ( Json::Value::iterator it = value.begin(); it != itEnd; ++it )\n   {\n      ++count;\n   }\n   JSONTEST_ASSERT_EQUAL( expectedCount, count ) << \"Json::Value::iterator\";\n\n   JSONTEST_ASSERT_PRED( checkConstMemberCount(value, expectedCount) );\n}\n\n\nValueTest::IsCheck::IsCheck()\n   : isObject_( false )\n   , isArray_( false )\n   , isBool_( false )\n   , isDouble_( false )\n   , isInt_( false )\n   , isUInt_( false )\n   , isIntegral_( false )\n   , isNumeric_( false )\n   , isString_( false )\n   , isNull_( false )\n{\n}\n\n\nvoid \nValueTest::checkIs( const Json::Value &value, const IsCheck &check )\n{\n   JSONTEST_ASSERT_EQUAL( check.isObject_, value.isObject() );\n   JSONTEST_ASSERT_EQUAL( check.isArray_, value.isArray() );\n   JSONTEST_ASSERT_EQUAL( check.isBool_, value.isBool() );\n   JSONTEST_ASSERT_EQUAL( check.isDouble_, value.isDouble() );\n   JSONTEST_ASSERT_EQUAL( check.isInt_, value.isInt() );\n   JSONTEST_ASSERT_EQUAL( check.isUInt_, value.isUInt() );\n   JSONTEST_ASSERT_EQUAL( check.isIntegral_, value.isIntegral() );\n   JSONTEST_ASSERT_EQUAL( check.isNumeric_, value.isNumeric() );\n   JSONTEST_ASSERT_EQUAL( check.isString_, value.isString() );\n   JSONTEST_ASSERT_EQUAL( check.isNull_, value.isNull() );\n}\n\n\n\nint main( int argc, const char *argv[] )\n{\n   JsonTest::Runner runner;\n   JSONTEST_REGISTER_FIXTURE( runner, ValueTest, size );\n   JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isObject );\n   JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isArray );\n   JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isBool );\n   JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isInt );\n   JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isUInt );\n   JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isDouble );\n   JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isString );\n   JSONTEST_REGISTER_FIXTURE( runner, ValueTest, isNull );\n   return runner.runCommandLine( argc, argv );\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/src/test_lib_json/sconscript",
    "content": "Import( 'env_testing buildUnitTests' )\n\nbuildUnitTests( env_testing, Split( \"\"\"\n    main.cpp\n    jsontest.cpp\n     \"\"\" ),\n    'test_lib_json' )\n\n# For 'check' to work, 'libs' must be built first.\nenv_testing.Depends('test_lib_json', '#libs')\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/jsoncpp/version",
    "content": "0.5.0"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/ultrajson/README",
    "content": "UltraJSON is a fast and extendable JSON encoder and decoder written in pure C\n\nPython bindings are available as the module ujson (through easy_install / pypi):\nhttp://pypi.python.org/pypi/ujson/\n\n\nInstallation instructions:\n\n1. Build and install ujson Python extension (requires root)\nGo to <root>/python\nType: python setup.py build install  \n\n2. Run tests (as needed)\nType: python tests.py\n\nSame instructions applies for Windows except that step 1) isn't necessary since\na prebuilt static library is included.\n\nPreliminary benchmarks:\n\n64-bit benchmarks Linux\nPython 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)\nOS Version: Ubuntu 10.10\nSystem Type: x64-based PC\nProcessor: Intel(R) Core(TM) i5-2300 CPU @ 2.80GHz\nTotal Physical Memory: 4096 MB\n\nArray with 256 utf-8 strings:\nujson encode      : 2714.66499 calls/sec\nsimplejson encode : 1542.63718 calls/sec\ncjson encode      : 132.23604 calls/sec\n\nujson decode      : 2079.17287 calls/sec\ncjson decode      : 992.21602 calls/sec\nsimplejson decode : 278.92061 calls/sec\n\nMedium complex object:\nujson encode      : 17849.80356 calls/sec\nsimplejson encode : 3524.32372 calls/sec\ncjson encode      : 2967.34656 calls/sec\n\nujson decode      : 11685.87610 calls/sec\ncjson decode      : 8206.67906 calls/sec\nsimplejson decode : 6549.99750 calls/sec\n\nArray with 256 strings:\nujson encode      : 38543.50303 calls/sec\nsimplejson encode : 19436.45772 calls/sec\ncjson encode      : 12392.55614 calls/sec\n\nujson decode      : 27207.33157 calls/sec\ncjson decode      : 30237.60827 calls/sec\nsimplejson decode : 25271.93073 calls/sec\n\nArray with 256 doubles:\nujson encode      : 6027.45931 calls/sec\nsimplejson encode : 2915.54871 calls/sec\ncjson encode      : 3546.88804 calls/sec\n\nujson decode      : 28045.13375 calls/sec\ncjson decode      : 15066.73209 calls/sec\nsimplejson decode : 15604.98222 calls/sec\n\nArray with 256 True values:\nujson encode      : 187342.39634 calls/sec\nsimplejson encode : 48972.93887 calls/sec\ncjson encode      : 67274.93082 calls/sec\n\nujson decode      : 158103.79663 calls/sec\ncjson decode      : 83237.88990 calls/sec\nsimplejson decode : 115645.98241 calls/sec\n\nArray with 256 dict{string, int} pairs:\nujson encode      : 25301.85690 calls/sec\nsimplejson encode : 5734.29472 calls/sec\ncjson encode      : 4447.73411 calls/sec\n\nujson decode      : 16290.72288 calls/sec\ncjson decode      : 12528.56060 calls/sec\nsimplejson decode : 10394.23358 calls/sec\n\nDict with 256 arrays with 256 dict{string, int} pairs:\nujson encode      : 87.40865 calls/sec\nsimplejson encode : 17.07889 calls/sec\ncjson encode      : 17.25164 calls/sec\n\nujson decode      : 45.94026 calls/sec\ncjson decode      : 34.60225 calls/sec\nsimplejson decode : 26.92238 calls/sec\n\n32-bit benchmarks Windows\nPython 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)]\nOS Version: 6.1.7601 Service Pack 1 Build 7601\nSystem Type: x64-based PC\nProcessor: Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz 2.83 GHz\nTotal Physical Memory: 8191 MB\n\nArray with 256 utf-8 strings:\nujson encode      : 1191.98175 calls/sec\nsimplejson encode : 1013.98279 calls/sec\ncjson encode      : 1040.66063 calls/sec\n\nujson decode      : 1215.66875 calls/sec\ncjson decode      : 493.30484 calls/sec\nsimplejson decode : 269.85512 calls/sec\n\nMedium complex object:\nujson encode      : 10307.63723 calls/sec\nsimplejson encode : 2534.94769 calls/sec\ncjson encode      : 2047.95118 calls/sec\n\nujson decode      : 7274.10026 calls/sec\ncjson decode      : 3575.39307 calls/sec\nsimplejson decode : 3565.51252 calls/sec\n\nArray with 256 strings:\nujson encode      : 21348.25210 calls/sec\nsimplejson encode : 15736.74638 calls/sec\ncjson encode      : 6371.26334 calls/sec\n\nujson decode      : 26050.25316 calls/sec\ncjson decode      : 16468.88215 calls/sec\nsimplejson decode : 21115.75770 calls/sec\n\nArray with 256 doubles:\nujson encode      : 26975.49110 calls/sec\nsimplejson encode : 2046.29746 calls/sec\ncjson encode      : 2133.56594 calls/sec\n\nujson decode      : 28430.33722 calls/sec\ncjson decode      : 4114.36400 calls/sec\nsimplejson decode : 4419.08507 calls/sec\n\nArray with 256 True values:\nujson encode      : 89846.12897 calls/sec\nsimplejson encode : 34288.36862 calls/sec\ncjson encode      : 47168.35849 calls/sec\n\nujson decode      : 99423.47549 calls/sec\ncjson decode      : 58795.91460 calls/sec\nsimplejson decode : 76296.14699 calls/sec\n\nArray with 256 dict{string, int} pairs:\nujson encode      : 14776.41614 calls/sec\nsimplejson encode : 3876.86634 calls/sec\ncjson encode      : 3050.65343 calls/sec\n\nujson decode      : 12934.39432 calls/sec\ncjson decode      : 7993.04345 calls/sec\nsimplejson decode : 7152.09475 calls/sec\n\nHere is the benchmark run from a 32bit CentOS 5.6 (Python 2.4) machine:\n\nArray with 256 utf-8 strings:\nujson encode : 1453.30891 calls/sec\nsimplejson encode : 658.31181 calls/sec\ncjson encode : 62.18416 calls/sec\n\nujson decode : 1016.58767 calls/sec\ncjson decode : 455.28550 calls/sec\nsimplejson decode : 124.20439 calls/sec\n\nMedium complex object:\nujson encode : 6010.21634 calls/sec\nsimplejson encode : 1418.77823 calls/sec\ncjson encode : 1252.92530 calls/sec\n\nujson decode : 4637.52630 calls/sec\ncjson decode : 3444.13604 calls/sec\nsimplejson decode : 2166.18641 calls/sec\n\nArray with 256 strings:\nujson encode : 12252.28889 calls/sec\nsimplejson encode : 9351.67532 calls/sec\ncjson encode : 7786.13697 calls/sec\n\nujson decode : 10951.17394 calls/sec\ncjson decode : 15971.02425 calls/sec\nsimplejson decode : 6796.77480 calls/sec\n\nArray with 256 doubles:\nujson encode : 16300.61218 calls/sec\nsimplejson encode : 1613.39428 calls/sec\ncjson encode : 2035.58937 calls/sec\n\nujson decode : 17301.00746 calls/sec\ncjson decode : 5785.33627 calls/sec\nsimplejson decode : 6199.49364 calls/sec\n\nArray with 256 True values:\nujson encode : 72618.15350 calls/sec\nsimplejson encode : 18707.57593 calls/sec\ncjson encode : 24150.26201 calls/sec\n\nujson decode : 53650.94162 calls/sec\ncjson decode : 48069.53050 calls/sec\nsimplejson decode : 47098.40293 calls/sec\n\nArray with 256 dict{string, int} pairs:\nujson encode : 8811.85922 calls/sec\nsimplejson encode : 2756.91262 calls/sec\ncjson encode : 1758.26962 calls/sec\n\nujson decode : 6490.36358 calls/sec\ncjson decode : 6330.77263 calls/sec\nsimplejson decode : 4161.97048 calls/sec\n\nDict with 256 arrays with 256 dict{string, int} pairs:\nujson encode : 31.08834 calls/sec\nsimplejson encode : 10.41434 calls/sec\ncjson encode : 6.93790 calls/sec\n\nujson decode : 19.81373 calls/sec\ncjson decode : 20.31727 calls/sec\nsimplejson decode : 15.05690 calls/sec\n\n\nSee (python/benchmark.py) for further information.\n\nNOTE: These benchmarks are preliminary! \n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/ultrajson/ultrajson.h",
    "content": "/*\nCopyright (c) 2011, Jonas Tarnstrom and ESN Social Software AB\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n1. Redistributions of source code must retain the above copyright\n   notice, this list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright\n   notice, this list of conditions and the following disclaimer in the\n   documentation and/or other materials provided with the distribution.\n3. All advertising materials mentioning features or use of this software\n   must display the following acknowledgement:\n   This product includes software developed by ESN Social Software AB (www.esn.me).\n4. Neither the name of the ESN Social Software AB nor the\n   names of its contributors may be used to endorse or promote products\n   derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY ESN SOCIAL SOFTWARE AB ''AS IS'' AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL ESN SOCIAL SOFTWARE AB BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nPortions of code from:\nMODP_ASCII - Ascii transformations (upper/lower, etc)\nhttp://code.google.com/p/stringencoders/\nCopyright (c) 2007  Nick Galbreath -- nickg [at] modp [dot] com. All rights reserved.\n\n*/\n\n/*\nUltra fast JSON encoder and decoder\nDeveloped by Jonas Tarnstrom (jonas@esn.me).\n\nEncoder notes:\n------------------\n\n:: Cyclic references ::\nCyclic referenced objects are not detected. \nSet JSONObjectEncoder.recursionMax to suitable value or make sure input object \ntree doesn't have cyclic references.\n\n*/\n\n#ifndef __ULTRAJSON_H__\n#define __ULTRAJSON_H__\n\n#include <stdio.h>\n#include <wchar.h>\n\n//#define JSON_DECODE_NUMERIC_AS_DOUBLE\n\n// Don't output any extra whitespaces when encoding\n#define JSON_NO_EXTRA_WHITESPACE\n\n// Max decimals to encode double floating point numbers with\n#ifndef JSON_DOUBLE_MAX_DECIMALS\n#define JSON_DOUBLE_MAX_DECIMALS 9\n#endif\n\n// Max recursion depth, default for encoder\n#ifndef JSON_MAX_RECURSION_DEPTH\n#define JSON_MAX_RECURSION_DEPTH 256\n#endif\n\n/*\nDictates and limits how much stack space for buffers UltraJSON will use before resorting to provided heap functions */\n#ifndef JSON_MAX_STACK_BUFFER_SIZE\n#define JSON_MAX_STACK_BUFFER_SIZE 131072\n#endif\n\n#ifdef _WIN32\n\ntypedef __int64 JSINT64;\ntypedef unsigned __int64 JSUINT64;\n\ntypedef unsigned __int32 uint32_t;\ntypedef __int32 JSINT32;\ntypedef uint32_t JSUINT32;\ntypedef unsigned __int8 JSUINT8;\ntypedef unsigned __int16 JSUTF16;\ntypedef unsigned __int32 JSUTF32;\ntypedef __int64 JSLONG;\n\n#define EXPORTFUNCTION __declspec(dllexport)\n\n#define FASTCALL_MSVC __fastcall\n#define FASTCALL_ATTR \n#define INLINE_PREFIX __inline\n\n#else\n\n#include <sys/types.h>\ntypedef int64_t JSINT64;\ntypedef u_int64_t JSUINT64;\n\ntypedef int32_t JSINT32;\ntypedef u_int32_t JSUINT32;\n\n#define FASTCALL_MSVC \n#define FASTCALL_ATTR __attribute__((fastcall))\n#define INLINE_PREFIX inline\n\ntypedef u_int32_t uint32_t;\n\ntypedef u_int8_t JSUINT8;\ntypedef u_int16_t JSUTF16;\ntypedef u_int32_t JSUTF32;\n\ntypedef int64_t JSLONG;\n\n#define EXPORTFUNCTION\n#endif\n\n#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__\n#define __LITTLE_ENDIAN__\n#else\n\n#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__\n#define __BIG_ENDIAN__\n#endif\n\n#endif\n\n#if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)\n#error \"Endianess not supported\"\n#endif\n\nenum JSTYPES\n{\n\tJT_NULL,\t\t// NULL\n\tJT_TRUE,\t\t//boolean true\n\tJT_FALSE,\t\t//boolean false\n\tJT_INT,\t\t\t//(JSINT32 (signed 32-bit))\n\tJT_LONG,\t\t//(JSINT64 (signed 64-bit))\n\tJT_DOUBLE,\t//(double)\n\tJT_UTF8,\t\t//(char 8-bit)\n\tJT_ARRAY,\t\t// Array structure\n\tJT_OBJECT,\t// Key/Value structure \n\tJT_INVALID,\t// Internal, do not return nor expect\n};\n\ntypedef void * JSOBJ;\ntypedef void * JSITER;\n\ntypedef struct __JSONTypeContext\n{\n\tint type;\n\tvoid *prv[32];\n} JSONTypeContext;\n\n/*\nFunction pointer declarations, suitable for implementing UltraJSON */\ntypedef void (*JSPFN_ITERBEGIN)(JSOBJ obj, JSONTypeContext *tc);\ntypedef int (*JSPFN_ITERNEXT)(JSOBJ obj, JSONTypeContext *tc);\ntypedef void (*JSPFN_ITEREND)(JSOBJ obj, JSONTypeContext *tc);\ntypedef JSOBJ (*JSPFN_ITERGETVALUE)(JSOBJ obj, JSONTypeContext *tc);\ntypedef char *(*JSPFN_ITERGETNAME)(JSOBJ obj, JSONTypeContext *tc, size_t *outLen);\ntypedef\tvoid *(*JSPFN_MALLOC)(size_t size);\ntypedef void (*JSPFN_FREE)(void *pptr);\ntypedef void *(*JSPFN_REALLOC)(void *base, size_t size);\n\ntypedef struct __JSONObjectEncoder\n{\n\tvoid (*beginTypeContext)(JSOBJ obj, JSONTypeContext *tc);\n\tvoid (*endTypeContext)(JSOBJ obj, JSONTypeContext *tc);\n\tconst char *(*getStringValue)(JSOBJ obj, JSONTypeContext *tc, size_t *_outLen);\n\tJSINT64 (*getLongValue)(JSOBJ obj, JSONTypeContext *tc);\n\tJSINT32 (*getIntValue)(JSOBJ obj, JSONTypeContext *tc);\n\tdouble (*getDoubleValue)(JSOBJ obj, JSONTypeContext *tc);\n\n\t/*\n\tBegin iteration of an iteratable object (JS_ARRAY or JS_OBJECT) \n\tImplementor should setup iteration state in ti->prv \n\t*/\n\tJSPFN_ITERBEGIN iterBegin;\n\n\t/*\n\tRetrieve next object in an iteration. Should return 0 to indicate iteration has reached end or 1 if there are more items.\n\tImplementor is responsible for keeping state of the iteration. Use ti->prv fields for this\n\t*/\n\tJSPFN_ITERNEXT iterNext;\n\n\t/*\n\tEnds the iteration of an iteratable object.\n\tAny iteration state stored in ti->prv can be freed here\n\t*/\n\tJSPFN_ITEREND iterEnd;\n\n\t/*\n\tReturns a reference to the value object of an iterator\n\tThe is responsible for the life-cycle of the returned string. Use iterNext/iterEnd and ti->prv to keep track of current object\n\t*/\n\tJSPFN_ITERGETVALUE iterGetValue;\n\t\n\t/*\n\tReturn name of iterator. \n\tThe is responsible for the life-cycle of the returned string. Use iterNext/iterEnd and ti->prv to keep track of current object\n\t*/\n\tJSPFN_ITERGETNAME iterGetName;\n\t\n\t/*\n\tRelease a value as indicated by setting ti->release = 1 in the previous getValue call.\n\tThe ti->prv array should contain the necessary context to release the value\n\t*/\n\tvoid (*releaseObject)(JSOBJ obj);\n\n\t/* Library functions \n\tSet to NULL to use STDLIB malloc,realloc,free */\n\tJSPFN_MALLOC malloc;\n\tJSPFN_REALLOC realloc;\n\tJSPFN_FREE free;\n\n\t/*\n\tConfiguration for max recursion, set to 0 to use default (see JSON_MAX_RECURSION_DEPTH)*/\n\tint recursionMax;\n\n\t/*\n\tConfiguration for max decimals of double floating poiunt numbers to encode (0-9) */\n\tint doublePrecision;\n\n\t/*\n\tIf true output will be ASCII with all characters above 127 encoded as \\uXXXX. If false output will be UTF-8 or what ever charset strings are brought as */\n\tint forceASCII;\n\n\n\t/*\n\tSet to an error message if error occured */\n\tconst char *errorMsg;\n\tJSOBJ errorObj;\n\n\t/* Buffer stuff */\n\tchar *start;\n\tchar *offset;\n\tchar *end;\n\tint heap;\n\tint level;\n\n} JSONObjectEncoder;\n\n\n/*\nEncode an object structure into JSON.\n\nArguments:\nobj - An anonymous type representing the object\nenc - Function definitions for querying JSOBJ type\nbuffer - Preallocated buffer to store result in. If NULL function allocates own buffer\ncbBuffer - Length of buffer (ignored if buffer is NULL)\n\nReturns:\nEncoded JSON object as a null terminated char string. \n\nNOTE:\nIf the supplied buffer wasn't enough to hold the result the function will allocate a new buffer. \nLife cycle of the provided buffer must still be handled by caller. \n\nIf the return value doesn't equal the specified buffer caller must release the memory using\nJSONObjectEncoder.free or free() as specified when calling this function.\n*/\nEXPORTFUNCTION char *JSON_EncodeObject(JSOBJ obj, JSONObjectEncoder *enc, char *buffer, size_t cbBuffer);\n\n\n\ntypedef struct __JSONObjectDecoder\n{\n\tJSOBJ (*newString)(wchar_t *start, wchar_t *end);\n\tvoid (*objectAddKey)(JSOBJ obj, JSOBJ name, JSOBJ value);\n\tvoid (*arrayAddItem)(JSOBJ obj, JSOBJ value);\n\tJSOBJ (*newTrue)(void);\n\tJSOBJ (*newFalse)(void);\n\tJSOBJ (*newNull)(void);\n\tJSOBJ (*newObject)(void);\n\tJSOBJ (*newArray)(void);\n\tJSOBJ (*newInt)(JSINT32 value);\n\tJSOBJ (*newLong)(JSINT64 value);\n\tJSOBJ (*newDouble)(double value);\n\tvoid (*releaseObject)(JSOBJ obj);\n\tJSPFN_MALLOC malloc;\n\tJSPFN_FREE free;\n\tJSPFN_REALLOC realloc;\n\n\tchar *errorStr;\n\tchar *errorOffset;\n\n\n\n} JSONObjectDecoder;\n\nEXPORTFUNCTION JSOBJ JSON_DecodeObject(JSONObjectDecoder *dec, const char *buffer, size_t cbBuffer);\n\n#endif"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/ultrajson/ultrajsondec.c",
    "content": "/*\nCopyright (c) 2011, Jonas Tarnstrom and ESN Social Software AB\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n1. Redistributions of source code must retain the above copyright\n   notice, this list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright\n   notice, this list of conditions and the following disclaimer in the\n   documentation and/or other materials provided with the distribution.\n3. All advertising materials mentioning features or use of this software\n   must display the following acknowledgement:\n   This product includes software developed by ESN Social Software AB (www.esn.me).\n4. Neither the name of the ESN Social Software AB nor the\n   names of its contributors may be used to endorse or promote products\n   derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY ESN SOCIAL SOFTWARE AB ''AS IS'' AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL ESN SOCIAL SOFTWARE AB BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nPortions of code from:\nMODP_ASCII - Ascii transformations (upper/lower, etc)\nhttp://code.google.com/p/stringencoders/\nCopyright (c) 2007  Nick Galbreath -- nickg [at] modp [dot] com. All rights reserved.\n\n*/\n\n#include \"ultrajson.h\"\n#include <math.h>\n#include <assert.h>\n#include <string.h>\n#include <limits.h>\n#include <wchar.h>\n\nstruct DecoderState\n{\n\tchar *start;\n\tchar *end;\n\twchar_t *escStart;\n\twchar_t *escEnd;\n\tint escHeap;\n\tint lastType;\n\tJSONObjectDecoder *dec;\n};\n\nJSOBJ FASTCALL_MSVC decode_any( struct DecoderState *ds) FASTCALL_ATTR;\ntypedef JSOBJ (*PFN_DECODER)( struct DecoderState *ds);\n#define RETURN_JSOBJ_NULLCHECK(_expr) return(_expr);\n\ndouble createDouble(double intNeg, double intValue, double frcValue, int frcDecimalCount)\n{\n\tstatic const double g_pow10[] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};\n\n\treturn (intValue + (frcValue / g_pow10[frcDecimalCount])) * intNeg;\n}\n\nstatic JSOBJ SetError( struct DecoderState *ds, int offset, const char *message)\n{\n\tds->dec->errorOffset = ds->start + offset;\n\tds->dec->errorStr = (char *) message;\n\treturn NULL;\n}\n\n\nFASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_numeric ( struct DecoderState *ds)\n{\n#ifdef JSON_DECODE_NUMERIC_AS_DOUBLE\n\tdouble intNeg = 1;\n\tdouble intValue;\n#else\n\tint intNeg = 1;\n\tJSLONG intValue;\n#endif\n\n\tdouble expNeg;\n\tint chr;\n\tint decimalCount = 0;\n\tdouble frcValue = 0.0;\n\tdouble expValue;\n\n\tif (*(ds->start) == '-')\n\t{\n\t\tds->start ++;\n\t\tintNeg = -1;\n\t}\n\n\t// Scan integer part\n\tintValue = 0;\n\n\twhile (1)\n\t{\n\t\tchr = (int) (unsigned char) *(ds->start);\n\n\t\tswitch (chr)\n\t\t{\n\t\tcase '0':\n\t\tcase '1':\n\t\tcase '2':\n\t\tcase '3':\n\t\tcase '4':\n\t\tcase '5':\n\t\tcase '6':\n\t\tcase '7':\n\t\tcase '8':\n\t\tcase '9':\n\t\t\t//FIXME: Check for arithemtic overflow here\n\t\t\t//PERF: Don't do 64-bit arithmetic here unless we know we have to\n#ifdef JSON_DECODE_NUMERIC_AS_DOUBLE\n\t\t\tintValue = intValue * 10.0 + (double) (chr - 48);\n#else\n\t\t\tintValue = intValue * 10LL + (JSLONG) (chr - 48);\n#endif\n\t\t\tds->start ++;\n\t\t\tbreak;\n\n\t\tcase '.':\n\t\t\tds->start ++;\n\t\t\tgoto DECODE_FRACTION;\n\t\t\tbreak;\n\n\t\tcase 'e':\n\t\tcase 'E':\n\t\t\tds->start ++;\n\t\t\tgoto DECODE_EXPONENT;\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tgoto BREAK_INT_LOOP;\n\t\t\tbreak;\n\t\t}\n\t}\n\nBREAK_INT_LOOP:\n\n\tds->lastType = JT_INT;\n\n\t//If input string is LONGLONG_MIN here the value is already negative so we should not flip it\n\n#ifdef JSON_DECODE_NUMERIC_AS_DOUBLE\n#else\n\tif (intValue < 0)\n\t{\n\t\tintNeg = 1;\n\t}\n#endif\n\n\t//dbg1 = (intValue * intNeg);\n\t//dbg2 = (JSLONG) dbg1;\n\n#ifdef JSON_DECODE_NUMERIC_AS_DOUBLE\n\tif (intValue > (double) INT_MAX || intValue < (double) INT_MIN)\n#else\n\tif ( (intValue >> 32))\n#endif\n\t{\t\n\t\tRETURN_JSOBJ_NULLCHECK(ds->dec->newLong( (JSINT64) (intValue * (JSINT64) intNeg)));\n\t}\n\telse\n\t{\n\t\tRETURN_JSOBJ_NULLCHECK(ds->dec->newInt( (JSINT32) (intValue * intNeg)));\n\t}\n\n\n\nDECODE_FRACTION:\n\n\t// Scan fraction part\n\tfrcValue = 0.0;\n\twhile (1)\n\t{\n\t\tchr = (int) (unsigned char) *(ds->start);\n\n\t\tswitch (chr)\n\t\t{\n\t\tcase '0':\n\t\tcase '1':\n\t\tcase '2':\n\t\tcase '3':\n\t\tcase '4':\n\t\tcase '5':\n\t\tcase '6':\n\t\tcase '7':\n\t\tcase '8':\n\t\tcase '9':\n\t\t\tif (decimalCount < JSON_DOUBLE_MAX_DECIMALS)\n\t\t\t{\n\t\t\t\tfrcValue = frcValue * 10.0 + (double) (chr - 48);\n\t\t\t\tdecimalCount ++;\n\t\t\t}\n\t\t\tds->start ++;\n\t\t\tbreak;\n\n\t\tcase 'e':\n\t\tcase 'E':\n\t\t\tds->start ++;\n\t\t\tgoto DECODE_EXPONENT;\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tgoto BREAK_FRC_LOOP;\n\t\t}\n\t}\n\nBREAK_FRC_LOOP:\n\n\tif (intValue < 0)\n\t{\n\t\tintNeg = 1;\n\t}\n\n\t//FIXME: Check for arithemtic overflow here\n\tds->lastType = JT_DOUBLE;\n\tRETURN_JSOBJ_NULLCHECK(ds->dec->newDouble (createDouble( (double) intNeg, (double) intValue, frcValue, decimalCount)));\n\nDECODE_EXPONENT:\n\texpNeg = 1.0;\n\n\tif (*(ds->start) == '-')\n\t{\n\t\texpNeg = -1.0;\n\t\tds->start ++;\n\t}\n\telse\n\tif (*(ds->start) == '+')\n\t{\n\t\texpNeg = +1.0;\n\t\tds->start ++;\n\t}\n\n\texpValue = 0.0;\n\n\twhile (1)\n\t{\n\t\tchr = (int) (unsigned char) *(ds->start);\n\n\t\tswitch (chr)\n\t\t{\n\t\tcase '0':\n\t\tcase '1':\n\t\tcase '2':\n\t\tcase '3':\n\t\tcase '4':\n\t\tcase '5':\n\t\tcase '6':\n\t\tcase '7':\n\t\tcase '8':\n\t\tcase '9':\n\t\t\texpValue = expValue * 10.0 + (double) (chr - 48);\n\t\t\tds->start ++;\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tgoto BREAK_EXP_LOOP;\n\n\t\t}\n\t}\n\nBREAK_EXP_LOOP:\n\n#ifdef JSON_DECODE_NUMERIC_AS_DOUBLE\n#else\n\tif (intValue < 0)\n\t{\n\t\tintNeg = 1;\n\t}\n#endif\n\t\n\t//FIXME: Check for arithemtic overflow here\n\tds->lastType = JT_DOUBLE;\n\tRETURN_JSOBJ_NULLCHECK(ds->dec->newDouble (createDouble( (double) intNeg, (double) intValue , frcValue, decimalCount) * pow(10.0, expValue * expNeg)));\n}\n\nFASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_true ( struct DecoderState *ds) \n{\n\tds->start ++;\n\n\tif (*(ds->start++) != 'r')\n\t\tgoto SETERROR;\n\tif (*(ds->start++) != 'u')\n\t\tgoto SETERROR;\n\tif (*(ds->start++) != 'e')\n\t\tgoto SETERROR;\n\n\tds->lastType = JT_TRUE;\n\tRETURN_JSOBJ_NULLCHECK(ds->dec->newTrue());\n\nSETERROR:\n\treturn SetError(ds, -1, \"Unexpected character found when decoding 'true'\");\n}\n\nFASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_false ( struct DecoderState *ds) \n{\n\tds->start ++;\n\n\tif (*(ds->start++) != 'a')\n\t\tgoto SETERROR;\n\tif (*(ds->start++) != 'l')\n\t\tgoto SETERROR;\n\tif (*(ds->start++) != 's')\n\t\tgoto SETERROR;\n\tif (*(ds->start++) != 'e')\n\t\tgoto SETERROR;\n\n\tds->lastType = JT_FALSE;\n\tRETURN_JSOBJ_NULLCHECK(ds->dec->newFalse());\n\nSETERROR:\n\treturn SetError(ds, -1, \"Unexpected character found when decoding 'false'\");\n\n}\n\n\nFASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_null ( struct DecoderState *ds) \n{\n\tds->start ++;\n\n\tif (*(ds->start++) != 'u')\n\t\tgoto SETERROR;\n\tif (*(ds->start++) != 'l')\n\t\tgoto SETERROR;\n\tif (*(ds->start++) != 'l')\n\t\tgoto SETERROR;\n\n\tds->lastType = JT_NULL;\n\tRETURN_JSOBJ_NULLCHECK(ds->dec->newNull());\n\nSETERROR:\n\treturn SetError(ds, -1, \"Unexpected character found when decoding 'null'\");\n}\n\nFASTCALL_ATTR void FASTCALL_MSVC SkipWhitespace(struct DecoderState *ds) \n{\n\twhile (1)\n\t{\n\t\tswitch (*ds->start)\n\t\t{\n\t\tcase ' ':\n\t\tcase '\\t':\n\t\tcase '\\r':\n\t\tcase '\\n':\n\t\t\tds->start ++;\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\treturn;\n\t\t}\n\t}\n}\n\n\nenum DECODESTRINGSTATE\n{\n\tDS_ISNULL = 0x32,\n\tDS_ISQUOTE,\n\tDS_ISESCAPE,\n\tDS_UTFLENERROR,\n\n};\n\nstatic const JSUINT8 g_decoderLookup[256] = \n{\n/* 0x00 */ DS_ISNULL, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \n/* 0x10 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n/* 0x20 */ 1, 1, DS_ISQUOTE, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \n/* 0x30 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n/* 0x40 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \n/* 0x50 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, DS_ISESCAPE, 1, 1, 1,\n/* 0x60 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \n/* 0x70 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n/* 0x80 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \n/* 0x90 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n/* 0xa0 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \n/* 0xb0 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n/* 0xc0 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \n/* 0xd0 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n/* 0xe0 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, \n/* 0xf0 */ 4, 4, 4, 4, 4, 4, 4, 4, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, \n};\n\n\nFASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_string ( struct DecoderState *ds)\n{\n\tJSUTF16 sur[2] = { 0 };\n\tint iSur = 0;\n\tint index;\n\twchar_t *escOffset;\n\tsize_t escLen = (ds->escEnd - ds->escStart);\n\tJSUINT8 *inputOffset;\n\tJSUINT8 oct;\n\tJSUTF32 ucs;\n\tds->lastType = JT_INVALID;\n\tds->start ++;\n\n\tif ( (ds->end - ds->start) > escLen)\n\t{\n\t\tsize_t newSize = (ds->end - ds->start);\n\n\t\tif (ds->escHeap)\n\t\t{\n\t\t\tds->escStart = (wchar_t *) ds->dec->realloc (ds->escStart, newSize * sizeof(wchar_t));\n\t\t}\n\t\telse\n\t\t{\n\t\t\twchar_t *oldStart = ds->escStart;\n\t\t\tds->escHeap = 1;\n\t\t\tds->escStart = (wchar_t *) ds->dec->malloc (newSize * sizeof(wchar_t));\n\t\t\tmemcpy (ds->escStart, oldStart, escLen * sizeof(wchar_t));\n\t\t}\n\n\t\tds->escEnd = ds->escStart + newSize;\n\t}\n\n\tescOffset = ds->escStart;\n\n\t//inputOffset = ds->start;\n\tinputOffset = (JSUINT8*)ds->start;\t// miloyip\n\n\twhile(1)\n\t{\n\t\tswitch (g_decoderLookup[(JSUINT8)(*inputOffset)])\n\t\t{\n\t\tcase DS_ISNULL:\n\t\t\treturn SetError(ds, -1, \"Unmatched ''\\\"' when when decoding 'string'\");\n\n\t\tcase DS_ISQUOTE:\n\t\t\tds->lastType = JT_UTF8;\n\t\t\tinputOffset ++;\n\t\t\tds->start += ( (char *) inputOffset - (ds->start));\n\t\t\tRETURN_JSOBJ_NULLCHECK(ds->dec->newString(ds->escStart, escOffset));\n\n\t\tcase DS_UTFLENERROR:\n\t\t\treturn SetError (ds, -1, \"Invalid UTF-8 sequence length when decoding 'string'\");\n\n\t\tcase DS_ISESCAPE:\n\t\t\tinputOffset ++;\n\t\t\tswitch (*inputOffset)\n\t\t\t{\n\t\t\tcase '\\\\': *(escOffset++) = L'\\\\'; inputOffset++; continue;\n\t\t\tcase '\\\"': *(escOffset++) = L'\\\"'; inputOffset++; continue;\n\t\t\tcase '/':  *(escOffset++) = L'/';  inputOffset++; continue;\n\t\t\tcase 'b':  *(escOffset++) = L'\\b'; inputOffset++; continue;\n\t\t\tcase 'f':  *(escOffset++) = L'\\f'; inputOffset++; continue;\n\t\t\tcase 'n':  *(escOffset++) = L'\\n'; inputOffset++; continue;\n\t\t\tcase 'r':  *(escOffset++) = L'\\r'; inputOffset++; continue;\n\t\t\tcase 't':  *(escOffset++) = L'\\t'; inputOffset++; continue;\n\n\t\t\tcase 'u':\n\t\t\t\t{\n\t\t\t\t\tint index;\n\t\t\t\t\tinputOffset ++;\n\n\t\t\t\t\tfor (index = 0; index < 4; index ++)\n\t\t\t\t\t{\n\t\t\t\t\t\tswitch (*inputOffset)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tcase '\\0':\treturn SetError (ds, -1, \"Unterminated unicode escape sequence when decoding 'string'\");\n\t\t\t\t\t\tdefault:\t\treturn SetError (ds, -1, \"Unexpected character in unicode escape sequence when decoding 'string'\");\n\n\t\t\t\t\t\tcase '0':\n\t\t\t\t\t\tcase '1':\n\t\t\t\t\t\tcase '2':\n\t\t\t\t\t\tcase '3':\n\t\t\t\t\t\tcase '4':\n\t\t\t\t\t\tcase '5':\n\t\t\t\t\t\tcase '6':\n\t\t\t\t\t\tcase '7':\n\t\t\t\t\t\tcase '8':\n\t\t\t\t\t\tcase '9':\n\t\t\t\t\t\t\tsur[iSur] = (sur[iSur] << 4) + (JSUTF16) (*inputOffset - '0');\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'a':\n\t\t\t\t\t\tcase 'b':\n\t\t\t\t\t\tcase 'c':\n\t\t\t\t\t\tcase 'd':\n\t\t\t\t\t\tcase 'e':\n\t\t\t\t\t\tcase 'f':\n\t\t\t\t\t\t\tsur[iSur] = (sur[iSur] << 4) + 10 + (JSUTF16) (*inputOffset - 'a');\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'A':\n\t\t\t\t\t\tcase 'B':\n\t\t\t\t\t\tcase 'C':\n\t\t\t\t\t\tcase 'D':\n\t\t\t\t\t\tcase 'E':\n\t\t\t\t\t\tcase 'F':\n\t\t\t\t\t\t\tsur[iSur] = (sur[iSur] << 4) + 10 + (JSUTF16) (*inputOffset - 'A');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tinputOffset ++;\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif (iSur == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif((sur[iSur] & 0xfc00) == 0xd800)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// First of a surrogate pair, continue parsing\n\t\t\t\t\t\t\tiSur ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} \n\t\t\t\t\t\t(*escOffset++) = (wchar_t) sur[iSur];\n\t\t\t\t\t\tiSur = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// Decode pair\n\t\t\t\t\t\tif ((sur[1] & 0xfc00) != 0xdc00)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn SetError (ds, -1, \"Unpaired high surrogate when decoding 'string'\");\n\t\t\t\t\t\t}\n\n#if WCHAR_MAX == 0xffff\n\t\t\t\t\t\t(*escOffset++) = (wchar_t) sur[0];\n\t\t\t\t\t\t(*escOffset++) = (wchar_t) sur[1];\n#else\n\t\t\t\t\t\t(*escOffset++) = (wchar_t) 0x10000 + (((sur[0] - 0xd800) << 10) | (sur[1] - 0xdc00));\n#endif\n\t\t\t\t\t\tiSur = 0;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\tcase '\\0': return SetError(ds, -1, \"Unterminated escape sequence when decoding 'string'\");\n\t\t\tdefault: return SetError(ds, -1, \"Unrecognized escape sequence when decoding 'string'\");\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 1:\n\t\t\t*(escOffset++) = (wchar_t) (*inputOffset++); \n\t\t\tbreak;\n\n\t\tcase 2:\n\t\t{\n\t\t\tucs = (*inputOffset++) & 0x1f;\n\t\t\tucs <<= 6;\n\t\t\tif (((*inputOffset) & 0x80) != 0x80)\n\t\t\t{\n\t\t\t\treturn SetError(ds, -1, \"Invalid octet in UTF-8 sequence when decoding 'string'\");\n\t\t\t}\n\t\t\tucs |= (*inputOffset++) & 0x3f;\n\t\t\tif (ucs < 0x80)\treturn SetError (ds, -1, \"Overlong 2 byte UTF-8 sequence detected when decoding 'string'\");\n\t\t\t*(escOffset++) = (wchar_t) ucs;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 3:\n\t\t{\n\t\t\tJSUTF32 ucs = 0;\n\t\t\tucs |= (*inputOffset++) & 0x0f;\n\n\t\t\tfor (index = 0; index < 2; index ++)\n\t\t\t{\n\t\t\t\tucs <<= 6;\n\t\t\t\toct = (*inputOffset++);\n\n\t\t\t\tif ((oct & 0x80) != 0x80)\n\t\t\t\t{\n\t\t\t\t\treturn SetError(ds, -1, \"Invalid octet in UTF-8 sequence when decoding 'string'\");\n\t\t\t\t}\n\n\t\t\t\tucs |= oct & 0x3f;\n\t\t\t}\n\n\t\t\tif (ucs < 0x800) return SetError (ds, -1, \"Overlong 3 byte UTF-8 sequence detected when encoding string\");\n\t\t\t*(escOffset++) = (wchar_t) ucs;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 4:\n\t\t{\n\t\t\tJSUTF32 ucs = 0;\n\t\t\tucs |= (*inputOffset++) & 0x07;\n\n\t\t\tfor (index = 0; index < 3; index ++)\n\t\t\t{\n\t\t\t\tucs <<= 6;\n\t\t\t\toct = (*inputOffset++);\n\n\t\t\t\tif ((oct & 0x80) != 0x80)\n\t\t\t\t{\n\t\t\t\t\treturn SetError(ds, -1, \"Invalid octet in UTF-8 sequence when decoding 'string'\");\n\t\t\t\t}\n\n\t\t\t\tucs |= oct & 0x3f;\n\t\t\t}\n\n\t\t\tif (ucs < 0x10000) return SetError (ds, -1, \"Overlong 4 byte UTF-8 sequence detected when decoding 'string'\");\n\n\t\t\t#if WCHAR_MAX == 0xffff\n\t\t\tif (ucs >= 0x10000)\n\t\t\t{\n\t\t\t\tucs -= 0x10000;\n\t\t\t\t*(escOffset++) = (ucs >> 10) + 0xd800;\n\t\t\t\t*(escOffset++) = (ucs & 0x3ff) + 0xdc00;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t*(escOffset++) = (wchar_t) ucs;\n\t\t\t}\n\t\t\t#else\n\t\t\t*(escOffset++) = (wchar_t) ucs;\n\t\t\t#endif\n\t\t\tbreak;\n\t\t}\n\t\t}\n\t}\n}\n\nFASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_array( struct DecoderState *ds)\n{\n\tJSOBJ itemValue;\n\tJSOBJ newObj = ds->dec->newArray();\n\n\tds->lastType = JT_INVALID;\n\tds->start ++;\n\n\twhile (1)//(*ds->start) != '\\0')\n\t{\n\t\tSkipWhitespace(ds);\n\n\t\tif ((*ds->start) == ']')\n\t\t{\n\t\t\t*ds->start ++;\n\t\t\treturn newObj;\n\t\t}\n\n\t\titemValue = decode_any(ds);\n\n\t\tif (itemValue == NULL)\n\t\t{\n\t\t\tds->dec->releaseObject(newObj);\n\t\t\treturn NULL;\n\t\t}\n\n\t\tds->dec->arrayAddItem (newObj, itemValue);\n\n\t\tSkipWhitespace(ds);\n\n\t\tswitch (*(ds->start++))\n\t\t{\n\t\t\tcase ']':\n\t\t\t\treturn newObj;\n\n\t\t\tcase ',':\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tds->dec->releaseObject(newObj);\n\t\t\t\treturn SetError(ds, -1, \"Unexpected character in found when decoding array value\");\n\t\t}\n\t}\n\n\tds->dec->releaseObject(newObj);\n\treturn SetError(ds, -1, \"Unmatched ']' when decoding 'array'\");\n}\n\n\n\nFASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_object( struct DecoderState *ds)\n{\n\tJSOBJ itemName;\n\tJSOBJ itemValue;\n\tJSOBJ newObj = ds->dec->newObject();\n\n\tds->start ++;\n\n\twhile (1)\n\t{\n\t\tSkipWhitespace(ds);\n\n\t\tif ((*ds->start) == '}')\n\t\t{\n\t\t\tds->start ++;\n\t\t\treturn newObj;\n\t\t}\n\n\t\tds->lastType = JT_INVALID;\n\t\titemName = decode_any(ds);\n\n\t\tif (itemName == NULL)\n\t\t{\n\t\t\tds->dec->releaseObject(newObj);\n\t\t\treturn NULL;\n\t\t}\n\n\t\tif (ds->lastType != JT_UTF8)\n\t\t{\n\t\t\tds->dec->releaseObject(newObj);\n\t\t\tds->dec->releaseObject(itemName);\n\t\t\treturn SetError(ds, -1, \"Key name of object must be 'string' when decoding 'object'\");\n\t\t}\n\n\t\tSkipWhitespace(ds);\n\n\t\tif (*(ds->start++) != ':')\n\t\t{\n\t\t\tds->dec->releaseObject(newObj);\n\t\t\tds->dec->releaseObject(itemName);\n\t\t\treturn SetError(ds, -1, \"No ':' found when decoding object value\");\n\t\t}\n\n\t\tSkipWhitespace(ds);\n\n\t\titemValue = decode_any(ds);\n\n\t\tif (itemValue == NULL)\n\t\t{\n\t\t\tds->dec->releaseObject(newObj);\n\t\t\tds->dec->releaseObject(itemName);\n\t\t\treturn NULL;\n\t\t}\n\n\t\tds->dec->objectAddKey (newObj, itemName, itemValue);\n\n\t\tSkipWhitespace(ds);\n\n\t\tswitch (*(ds->start++))\n\t\t{\n\t\t\tcase '}':\n\t\t\t\treturn newObj;\n\n\t\t\tcase ',':\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tds->dec->releaseObject(newObj);\n\t\t\t\treturn SetError(ds, -1, \"Unexpected character in found when decoding object value\");\n\t\t}\n\t}\n\n\tds->dec->releaseObject(newObj);\n\treturn SetError(ds, -1, \"Unmatched '}' when decoding object\");\n}\n\nFASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_any(struct DecoderState *ds)\n{\n\twhile (1)\n\t{\n\t\tswitch (*ds->start)\n\t\t{\n\t\t\tcase '\\\"': \n\t\t\t\treturn decode_string (ds);\n\t\t\tcase '0': \n\t\t\tcase '1':\n\t\t\tcase '2': \n\t\t\tcase '3': \n\t\t\tcase '4': \n\t\t\tcase '5':\n\t\t\tcase '6': \n\t\t\tcase '7': \n\t\t\tcase '8': \n\t\t\tcase '9': \n\t\t\tcase '-': \n\t\t\t\treturn decode_numeric (ds);\n\n\t\t\tcase '[':\treturn decode_array (ds);\n\t\t\tcase '{': return decode_object (ds);\n\t\t\tcase 't': return decode_true (ds);\n\t\t\tcase 'f': return decode_false (ds);\n\t\t\tcase 'n': return decode_null (ds);\n\n\t\t\tcase ' ':\n\t\t\tcase '\\t':\n\t\t\tcase '\\r':\n\t\t\tcase '\\n':\n\t\t\t\t// White space\n\t\t\t\tds->start ++;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\treturn SetError(ds, -1, \"Expected object or value\");\n\t\t}\n\t}\n}\n\n\nJSOBJ JSON_DecodeObject(JSONObjectDecoder *dec, const char *buffer, size_t cbBuffer)\n{\n\n\t/*\n\tFIXME: Base the size of escBuffer of that of cbBuffer so that the unicode escaping doesn't run into the wall each time */\n\tstruct DecoderState ds;\n\twchar_t escBuffer[(JSON_MAX_STACK_BUFFER_SIZE / sizeof(wchar_t))];\n\tJSOBJ ret;\n\t\n\tds.start = (char *) buffer;\n\tds.end = ds.start + cbBuffer;\n\n\tds.escStart = escBuffer;\n\tds.escEnd = ds.escStart + (JSON_MAX_STACK_BUFFER_SIZE / sizeof(wchar_t));\n\tds.escHeap = 0;\n\tds.dec = dec;\n\tds.dec->errorStr = NULL;\n\tds.dec->errorOffset = NULL;\n\n\tds.dec = dec;\n\n\tret = decode_any (&ds);\n\t\n\tif (ds.escHeap)\n\t{\n\t\tdec->free(ds.escStart);\n\t}\n\treturn ret;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/ultrajson/ultrajsonenc.c",
    "content": "/*\nCopyright (c) 2011, Jonas Tarnstrom and ESN Social Software AB\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n1. Redistributions of source code must retain the above copyright\n   notice, this list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright\n   notice, this list of conditions and the following disclaimer in the\n   documentation and/or other materials provided with the distribution.\n3. All advertising materials mentioning features or use of this software\n   must display the following acknowledgement:\n   This product includes software developed by ESN Social Software AB (www.esn.me).\n4. Neither the name of the ESN Social Software AB nor the\n   names of its contributors may be used to endorse or promote products\n   derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY ESN SOCIAL SOFTWARE AB ''AS IS'' AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL ESN SOCIAL SOFTWARE AB BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nPortions of code from:\nMODP_ASCII - Ascii transformations (upper/lower, etc)\nhttp://code.google.com/p/stringencoders/\nCopyright (c) 2007  Nick Galbreath -- nickg [at] modp [dot] com. All rights reserved.\n\n*/\n\n#include \"ultrajson.h\"\n#include <stdio.h>\n#include <assert.h>\n#include <string.h>\n#include <stdlib.h>\n#include <math.h>\n\n#include <float.h>\n\n#ifndef TRUE\n#define TRUE 1\n#endif\n#ifndef FALSE\n#define FALSE 0\n#endif\n\nstatic const double g_pow10[] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};\nstatic const char g_hexChars[] = \"0123456789abcdef\";\nstatic const char g_escapeChars[] = \"0123456789\\\\b\\\\t\\\\n\\\\f\\\\r\\\\\\\"\\\\\\\\\\\\/\";\n\n\n/*\nFIXME: While this is fine dandy and working it's a magic value mess which probably only the author understands.\nNeeds a cleanup and more documentation */\n\n/*\nTable for pure ascii output escaping all characters above 127 to \\uXXXX */\nstatic const JSUINT8 g_asciiOutputTable[256] = \n{\n/* 0x00 */ 0, 30, 30, 30, 30, 30, 30, 30, 10, 12, 14, 30, 16, 18, 30, 30, \n/* 0x10 */ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,\n/* 0x20 */ 1, 1, 20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1/*24*/, \n/* 0x30 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n/* 0x40 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \n/* 0x50 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 22, 1, 1, 1,\n/* 0x60 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \n/* 0x70 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n/* 0x80 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \n/* 0x90 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n/* 0xa0 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \n/* 0xb0 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n/* 0xc0 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \n/* 0xd0 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n/* 0xe0 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, \n/* 0xf0 */ 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1\n};\n\n\nstatic void SetError (JSOBJ obj, JSONObjectEncoder *enc, const char *message)\n{\n\tenc->errorMsg = message;\n\tenc->errorObj = obj;\n}\n\n/*\nFIXME: Keep track of how big these get across several encoder calls and try to make an estimate\nThat way we won't run our head into the wall each call */\nvoid Buffer_Realloc (JSONObjectEncoder *enc, size_t cbNeeded)\n{\n\tsize_t curSize = enc->end - enc->start;\n\tsize_t newSize = curSize * 2;\n\tsize_t offset = enc->offset - enc->start;\n\n\twhile (newSize < curSize + cbNeeded)\n\t{\n\t\tnewSize *= 2;\n\t}\n\n\tif (enc->heap)\n\t{\n\t\tenc->start = (char *) enc->realloc (enc->start, newSize);\n\t}\n\telse\n\t{\n\t\tchar *oldStart = enc->start;\n\t\tenc->heap = 1;\n\t\tenc->start = (char *) enc->malloc (newSize);\n\t\tmemcpy (enc->start, oldStart, offset);\n\t}\n\tenc->offset = enc->start + offset;\n\tenc->end = enc->start + newSize;\n}\n\nFASTCALL_ATTR INLINE_PREFIX void FASTCALL_MSVC Buffer_AppendShortHexUnchecked (char *outputOffset, unsigned short value)\n{\n\t*(outputOffset++) = g_hexChars[(value & 0xf000) >> 12];\n\t*(outputOffset++) = g_hexChars[(value & 0x0f00) >> 8];\n\t*(outputOffset++) = g_hexChars[(value & 0x00f0) >> 4];\n\t*(outputOffset++) = g_hexChars[(value & 0x000f) >> 0];\n}\n\nint Buffer_EscapeStringUnvalidated (JSOBJ obj, JSONObjectEncoder *enc, const char *io, const char *end)\n{\n\tchar *of = (char *) enc->offset;\n\n\twhile (1)\n\t{\n\t\tswitch (*io)\n\t\t{\n\t\tcase 0x00:\n\t\t\tenc->offset += (of - enc->offset); \n\t\t\treturn TRUE;\n\n\t\tcase '\\\"': (*of++) = '\\\\'; (*of++) = '\\\"'; break;\n\t\tcase '\\\\': (*of++) = '\\\\'; (*of++) = '\\\\'; break;\n\t\t//case '/':  (*of++) = '\\\\'; (*of++) = '/'; break;\n\t\tcase '\\b': (*of++) = '\\\\'; (*of++) = 'b'; break;\n\t\tcase '\\f': (*of++) = '\\\\'; (*of++) = 'f'; break;\n\t\tcase '\\n': (*of++) = '\\\\'; (*of++) = 'n'; break;\n\t\tcase '\\r': (*of++) = '\\\\'; (*of++) = 'r'; break;\n\t\tcase '\\t': (*of++) = '\\\\'; (*of++) = 't'; break;\n\n\t\tcase 0x01:\n\t\tcase 0x02:\n\t\tcase 0x03:\n\t\tcase 0x04:\n\t\tcase 0x05:\n\t\tcase 0x06:\n\t\tcase 0x07:\n\t\tcase 0x0b:\n\t\tcase 0x0e:\n\t\tcase 0x0f:\n\t\tcase 0x10:\n\t\tcase 0x11:\n\t\tcase 0x12:\n\t\tcase 0x13:\n\t\tcase 0x14:\n\t\tcase 0x15:\n\t\tcase 0x16:\n\t\tcase 0x17:\n\t\tcase 0x18:\n\t\tcase 0x19:\n\t\tcase 0x1a:\n\t\tcase 0x1b:\n\t\tcase 0x1c:\n\t\tcase 0x1d:\n\t\tcase 0x1e:\n\t\tcase 0x1f:\n\t\t\t*(of++) = '\\\\';\n\t\t\t*(of++) = 'u';\n\t\t\t*(of++) = '0';\n\t\t\t*(of++) = '0';\n\t\t\t*(of++) = g_hexChars[ (unsigned char) (((*io) & 0xf0) >> 4)];\n\t\t\t*(of++) = g_hexChars[ (unsigned char) ((*io) & 0x0f)];\n\t\t\tbreak;\n\n\t\tdefault: (*of++) = (*io); break;\n\t\t}\n\n\t\t*io++;\n\t}\n\n\treturn FALSE;\n}\n\n\n/*\nFIXME:\nThis code only works with Little and Big Endian\n\nFIXME: The JSON spec says escape \"/\" but non of the others do and we don't \nwant to be left alone doing it so we don't :)\n\n*/\nint Buffer_EscapeStringValidated (JSOBJ obj, JSONObjectEncoder *enc, const char *io, const char *end)\n{\n\tJSUTF32 ucs;\n\tchar *of = (char *) enc->offset;\n\n\twhile (1)\n\t{\n\n\t\t//JSUINT8 chr = (unsigned char) *io;\n\t\tJSUINT8 utflen = g_asciiOutputTable[(unsigned char) *io];\n\n\t\tswitch (utflen)\n\t\t{\n\t\t\tcase 0: \n\t\t\t{\n\t\t\t\tenc->offset += (of - enc->offset); \n\t\t\t\treturn TRUE;\n\t\t\t}\n\n\t\t\tcase 1:\n\t\t\t{\n\t\t\t\t*(of++)= (*io++); \n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tcase 2:\n\t\t\t{\n\t\t\t\tJSUTF32 in;\n\n\t\t\t\tif (io + 1 > end)\n\t\t\t\t{\n\t\t\t\t\tenc->offset += (of - enc->offset);\n\t\t\t\t\tSetError (obj, enc, \"Unterminated UTF-8 sequence when encoding string\");\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\tin = *((JSUTF16 *) io);\n\n#ifdef __LITTLE_ENDIAN__\n\t\t\t\tucs = ((in & 0x1f) << 6) | ((in >> 8) & 0x3f);\n#else\n\t\t\t\tucs = ((in & 0x1f00) >> 2) | (in & 0x3f);\n#endif\n\n\t\t\t\tif (ucs < 0x80)\n\t\t\t\t{\n\t\t\t\t\tenc->offset += (of - enc->offset);\n\t\t\t\t\tSetError (obj, enc, \"Overlong 2 byte UTF-8 sequence detected when encoding string\");\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\tio += 2;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 3:\n\t\t\t{\n\t\t\t\tJSUTF32 in;\n\n\t\t\t\tif (io + 2 > end)\n\t\t\t\t{\n\t\t\t\t\tenc->offset += (of - enc->offset);\n\t\t\t\t\tSetError (obj, enc, \"Unterminated UTF-8 sequence when encoding string\");\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n#ifdef __LITTLE_ENDIAN__\n\t\t\t\tin = *((JSUTF16 *) io);\n\t\t\t\tin |= *((JSUINT8 *) io + 2) << 16;\n\t\t\t\tucs = ((in & 0x0f) << 12) | ((in & 0x3f00) >> 2) | ((in & 0x3f0000) >> 16);\n#else\n\t\t\t\tin = *((JSUTF16 *) io) << 8;\n\t\t\t\tin |= *((JSUINT8 *) io + 2);\n\t\t\t\tucs = ((in & 0x0f0000) >> 4) | ((in & 0x3f00) >> 2) | (in & 0x3f);\n#endif\n\n\n\t\t\t\tif (ucs < 0x800)\n\t\t\t\t{\n\t\t\t\t\tenc->offset += (of - enc->offset);\n\t\t\t\t\tSetError (obj, enc, \"Overlong 3 byte UTF-8 sequence detected when encoding string\");\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\tio += 3;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 4:\n\t\t\t{\n\t\t\t\tJSUTF32 in;\n\t\t\t\t\n\t\t\t\tif (io + 3 > end)\n\t\t\t\t{\n\t\t\t\t\tenc->offset += (of - enc->offset);\n\t\t\t\t\tSetError (obj, enc, \"Unterminated UTF-8 sequence when encoding string\");\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n#ifdef __LITTLE_ENDIAN__\n\t\t\t\tin = *((JSUTF32 *) io);\n\t\t\t\tucs = ((in & 0x07) << 18) | ((in & 0x3f00) << 4) | ((in & 0x3f0000) >> 10) | ((in & 0x3f000000) >> 24);\n#else\n\t\t\t\tin = *((JSUTF32 *) io);\n\t\t\t\tucs = ((in & 0x07000000) >> 6) | ((in & 0x3f0000) >> 4) | ((in & 0x3f00) >> 2) | (in & 0x3f);\n#endif\n\t\t\t\tif (ucs < 0x10000)\n\t\t\t\t{\n\t\t\t\t\tenc->offset += (of - enc->offset);\n\t\t\t\t\tSetError (obj, enc, \"Overlong 4 byte UTF-8 sequence detected when encoding string\");\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\tio += 4;\n\t\t\t\tbreak;\n\t\t\t}\n\n\n\t\t\tcase 5:\n\t\t\tcase 6:\n\t\t\t\tenc->offset += (of - enc->offset);\n\t\t\t\tSetError (obj, enc, \"Unsupported UTF-8 sequence length when encoding string\");\n\t\t\t\treturn FALSE;\n\n\t\t\tcase 30:\n\t\t\t\t// \\uXXXX encode\n\t\t\t\t*(of++) = '\\\\';\n\t\t\t\t*(of++) = 'u';\n\t\t\t\t*(of++) = '0';\n\t\t\t\t*(of++) = '0';\n\t\t\t\t*(of++) = g_hexChars[ (unsigned char) (((*io) & 0xf0) >> 4)];\n\t\t\t\t*(of++) = g_hexChars[ (unsigned char) ((*io) & 0x0f)];\n\t\t\t\tio ++;\n\t\t\t\tcontinue;\n\n\t\t\tcase 10:\n\t\t\tcase 12:\n\t\t\tcase 14:\n\t\t\tcase 16:\n\t\t\tcase 18:\n\t\t\tcase 20:\n\t\t\tcase 22:\n\t\t\t//case 24: (enable for / escaping)\n\t\t\t\t*(of++) = *( (char *) (g_escapeChars + utflen + 0));\n\t\t\t\t*(of++) = *( (char *) (g_escapeChars + utflen + 1));\n\t\t\t\tio ++;\n\t\t\t\tcontinue;\n\t\t}\n\n\t\t/*\n\t\tIf the character is a UTF8 sequence of length > 1 we end up here */\n\t\tif (ucs >= 0x10000)\n\t\t{\n\t\t\tucs -= 0x10000;\n\t\t\t*(of++) = '\\\\';\n\t\t\t*(of++) = 'u';\n\t\t\tBuffer_AppendShortHexUnchecked(of, (ucs >> 10) + 0xd800);\n\t\t\tof += 4;\n\n\t\t\t*(of++) = '\\\\';\n\t\t\t*(of++) = 'u';\n\t\t\tBuffer_AppendShortHexUnchecked(of, (ucs & 0x3ff) + 0xdc00);\n\t\t\tof += 4;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t*(of++) = '\\\\';\n\t\t\t*(of++) = 'u';\n\t\t\tBuffer_AppendShortHexUnchecked(of, ucs);\n\t\t\tof += 4;\n\t\t}\n\t}\n\n\treturn FALSE;\n}\n\n#define Buffer_Reserve(__enc, __len) \\\n\tif ((__enc)->offset + (__len) > (__enc)->end)\t\\\n\t{\t\\\n\t\tBuffer_Realloc((__enc), (__len));\\\n\t}\t\\\n\n\n#define Buffer_AppendCharUnchecked(__enc, __chr) \\\n\t\t\t\t*((__enc)->offset++) = __chr; \\\n\nFASTCALL_ATTR INLINE_PREFIX void FASTCALL_MSVC strreverse(char* begin, char* end)\n{\n\tchar aux;\n\twhile (end > begin)\n\taux = *end, *end-- = *begin, *begin++ = aux;\n}\n\nvoid Buffer_AppendIntUnchecked(JSONObjectEncoder *enc, JSINT32 value)\n{\n\tchar* wstr;\n\tJSUINT32 uvalue = (value < 0) ? -value : value;\n\n\twstr = enc->offset;\n\t// Conversion. Number is reversed.\n\t\n\tdo *wstr++ = (char)(48 + (uvalue % 10)); while(uvalue /= 10);\n\tif (value < 0) *wstr++ = '-';\n\n\t// Reverse string\n\tstrreverse(enc->offset,wstr - 1);\n\tenc->offset += (wstr - (enc->offset));\n}\n\nvoid Buffer_AppendLongUnchecked(JSONObjectEncoder *enc, JSINT64 value)\n{\n\tchar* wstr;\n\tJSUINT64 uvalue = (value < 0) ? -value : value;\n\n\twstr = enc->offset;\n\t// Conversion. Number is reversed.\n\t\n\tdo *wstr++ = (char)(48 + (uvalue % 10ULL)); while(uvalue /= 10ULL);\n\tif (value < 0) *wstr++ = '-';\n\n\t// Reverse string\n\tstrreverse(enc->offset,wstr - 1);\n\tenc->offset += (wstr - (enc->offset));\n}\n\nint Buffer_AppendDoubleUnchecked(JSOBJ obj, JSONObjectEncoder *enc, double value)\n{\n\t/* if input is larger than thres_max, revert to exponential */\n\tconst double thres_max = (double)(0x7FFFFFFF);\n\tint count;\n\tdouble diff = 0.0;\n\tchar* str = enc->offset;\n\tchar* wstr = str;\n\tint whole;\n\tdouble tmp;\n\tuint32_t frac;\n\tint neg;\n\tdouble pow10;\n\n\tif (value == HUGE_VAL || value == -HUGE_VAL)\n\t{\n\t\tSetError (obj, enc, \"Invalid Inf value when encoding double\");\n\t\treturn FALSE;\n\t}\n\tif (! (value == value)) \n\t{\n\t\tSetError (obj, enc, \"Invalid Nan value when encoding double\");\n\t\treturn FALSE;\n\t}\n\n\n\t/* we'll work in positive values and deal with the\n\tnegative sign issue later */\n\tneg = 0;\n\tif (value < 0) \n\t{\n\t\tneg = 1;\n\t\tvalue = -value;\n\t}\n\n\tpow10 = g_pow10[enc->doublePrecision];\n\n\twhole = (int) value;\n\ttmp = (value - whole) * pow10;\n\tfrac = (uint32_t)(tmp);\n\tdiff = tmp - frac;\n\n\tif (diff > 0.5) \n\t{\n\t\t++frac;\n\t\t/* handle rollover, e.g.  case 0.99 with prec 1 is 1.0  */\n\t\tif (frac >= pow10) \n\t\t{\n\t\t\tfrac = 0;\n\t\t\t++whole;\n\t\t}\n\t} \n\telse \n\tif (diff == 0.5 && ((frac == 0) || (frac & 1))) \n\t{\n\t\t/* if halfway, round up if odd, OR\n\t\tif last digit is 0.  That last part is strange */\n\t\t++frac;\n\t}\n\n\t/* for very large numbers switch back to native sprintf for exponentials.\n\tanyone want to write code to replace this? */\n\t/*\n\tnormal printf behavior is to print EVERY whole number digit\n\twhich can be 100s of characters overflowing your buffers == bad\n\t*/\n\tif (value > thres_max) \n\t{\n\t\tenc->offset += sprintf(str, \"%e\", neg ? -value : value);\n\t\treturn TRUE;\n\t}\n\n\tif (enc->doublePrecision == 0) \n\t{\n\t\tdiff = value - whole;\n\n\t\tif (diff > 0.5) \n\t\t{\n\t\t/* greater than 0.5, round up, e.g. 1.6 -> 2 */\n\t\t++whole;\n\t\t}\n\t\telse \n\t\tif (diff == 0.5 && (whole & 1)) \n\t\t{\n\t\t\t/* exactly 0.5 and ODD, then round up */\n\t\t\t/* 1.5 -> 2, but 2.5 -> 2 */\n\t\t\t++whole;\n\t\t}\n\n\t\t\t//vvvvvvvvvvvvvvvvvvv  Diff from modp_dto2\n\t} \n\telse \n\tif (frac) \n\t{ \n\t\tcount = enc->doublePrecision;\n\t\t// now do fractional part, as an unsigned number\n\t\t// we know it is not 0 but we can have leading zeros, these\n\t\t// should be removed\n\t\twhile (!(frac % 10))\n\t\t{\n\t\t--count;\n\t\tfrac /= 10;\n\t\t}\n\t\t//^^^^^^^^^^^^^^^^^^^  Diff from modp_dto2\n\n\t\t// now do fractional part, as an unsigned number\n\t\tdo \n\t\t{\n\t\t\t--count;\n\t\t\t*wstr++ = (char)(48 + (frac % 10));\n\t\t} while (frac /= 10);\n\t\t// add extra 0s\n\t\twhile (count-- > 0)\n\t\t{\n\t\t\t*wstr++ = '0';\n\t\t}\n\t\t// add decimal\n\t\t*wstr++ = '.';\n\t}\n\telse\n\t{\n\t\t*wstr++ = '0';\n\t\t*wstr++ = '.';\n\t}\n\n\t// do whole part\n\t// Take care of sign\n\t// Conversion. Number is reversed.\n\tdo *wstr++ = (char)(48 + (whole % 10)); while (whole /= 10);\n\t\n\tif (neg) \n\t{\n\t\t*wstr++ = '-';\n\t}\n\tstrreverse(str, wstr-1);\n\tenc->offset += (wstr - (enc->offset));\n\n\treturn TRUE;\n}\n\n\n\n\n\n\n/*\nFIXME:\nHandle integration functions returning NULL here */\n\n/*\nFIXME:\nPerhaps implement recursion detection */\n\nvoid encode(JSOBJ obj, JSONObjectEncoder *enc, const char *name, size_t cbName)\n{\n\tJSONTypeContext tc;\n\tsize_t szlen;\n\n\tif (enc->level > enc->recursionMax)\n\t{\n\t\tSetError (obj, enc, \"Maximum recursion level reached\");\n\t\treturn;\n\t}\n\n\t/*\n\tThis reservation must hold \n\n\tlength of _name as encoded worst case +\n\tmaxLength of double to string OR maxLength of JSLONG to string\n\n\tSince input is assumed to be UTF-8 the worst character length is:\n\n\t4 bytes (of UTF-8) => \"\\uXXXX\\uXXXX\" (12 bytes)\n\t*/\n\n\tBuffer_Reserve(enc, 256 + (((cbName / 4) + 1) * 12));\n\n\tif (name)\n\t{\n\t\tBuffer_AppendCharUnchecked(enc, '\\\"');\n\n\t\tif (enc->forceASCII)\n\t\t{\n\t\t\tif (!Buffer_EscapeStringValidated(obj, enc, name, name + cbName))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!Buffer_EscapeStringUnvalidated(obj, enc, name, name + cbName))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\t\tBuffer_AppendCharUnchecked(enc, '\\\"');\n\n\t\tBuffer_AppendCharUnchecked (enc, ':');\n#ifndef JSON_NO_EXTRA_WHITESPACE\n\t\tBuffer_AppendCharUnchecked (enc, ' ');\n#endif\n\t}\n\n\tenc->beginTypeContext(obj, &tc);\n\n\tswitch (tc.type)\n\t{\n\t\tcase JT_INVALID:\n\t\t\treturn;\n\n\t\tcase JT_ARRAY:\n\t\t{\n\t\t\tint count = 0;\n\t\t\tJSOBJ iterObj;\n\t\t\tenc->iterBegin(obj, &tc);\n\n\t\t\tBuffer_AppendCharUnchecked (enc, '[');\n\n\t\t\twhile (enc->iterNext(obj, &tc))\n\t\t\t{\n\t\t\t\tif (count > 0)\n\t\t\t\t{\n\t\t\t\t\tBuffer_AppendCharUnchecked (enc, ',');\n#ifndef JSON_NO_EXTRA_WHITESPACE\n\t\t\t\t\tBuffer_AppendCharUnchecked (buffer, ' ');\n#endif\n\t\t\t\t}\n\n\t\t\t\titerObj = enc->iterGetValue(obj, &tc);\n\n\t\t\t\tenc->level ++;\n\t\t\t\tencode (iterObj, enc, NULL, 0);\t\t\t\n\t\t\t\tcount ++;\n\t\t\t}\n\n\t\t\tenc->iterEnd(obj, &tc);\n\t\t\tBuffer_AppendCharUnchecked (enc, ']');\n\t\t\tbreak;\n\t\t}\n\n\t\tcase JT_OBJECT:\n\t\t{\n\t\t\tint count = 0;\n\t\t\tJSOBJ iterObj;\n\t\t\tchar *objName;\n\n\t\t\tenc->iterBegin(obj, &tc);\n\n\t\t\tBuffer_AppendCharUnchecked (enc, '{');\n\n\t\t\twhile (enc->iterNext(obj, &tc))\n\t\t\t{\n\t\t\t\tif (count > 0)\n\t\t\t\t{\n\t\t\t\t\tBuffer_AppendCharUnchecked (enc, ',');\n#ifndef JSON_NO_EXTRA_WHITESPACE\n\t\t\t\t\tBuffer_AppendCharUnchecked (enc, ' ');\n#endif\n\t\t\t\t}\n\n\t\t\t\titerObj = enc->iterGetValue(obj, &tc);\n\t\t\t\tobjName = enc->iterGetName(obj, &tc, &szlen);\n\n\t\t\t\tenc->level ++;\n\t\t\t\tencode (iterObj, enc, objName, szlen);\t\t\t\n\t\t\t\tcount ++;\n\t\t\t}\n\n\t\t\tenc->iterEnd(obj, &tc);\n\t\t\tBuffer_AppendCharUnchecked (enc, '}');\n\t\t\tbreak;\n\t\t}\n\n\t\tcase JT_LONG:\n\t\t{\n\t\t\tBuffer_AppendLongUnchecked (enc, enc->getLongValue(obj, &tc));\n\t\t\tbreak;\n\t\t}\n\n\t\tcase JT_INT:\n\t\t{\n\t\t\tBuffer_AppendIntUnchecked (enc, enc->getIntValue(obj, &tc));\n\t\t\tbreak;\n\t\t}\n\n\t\tcase JT_TRUE:\n\t\t{\n\t\t\tBuffer_AppendCharUnchecked (enc, 't');\n\t\t\tBuffer_AppendCharUnchecked (enc, 'r');\n\t\t\tBuffer_AppendCharUnchecked (enc, 'u');\n\t\t\tBuffer_AppendCharUnchecked (enc, 'e');\n\t\t\tbreak;\n\t\t}\n\n\t\tcase JT_FALSE:\n\t\t{\n\t\t\tBuffer_AppendCharUnchecked (enc, 'f');\n\t\t\tBuffer_AppendCharUnchecked (enc, 'a');\n\t\t\tBuffer_AppendCharUnchecked (enc, 'l');\n\t\t\tBuffer_AppendCharUnchecked (enc, 's');\n\t\t\tBuffer_AppendCharUnchecked (enc, 'e');\n\t\t\tbreak;\n\t\t}\n\n\n\t\tcase JT_NULL: \n\t\t{\n\t\t\tBuffer_AppendCharUnchecked (enc, 'n');\n\t\t\tBuffer_AppendCharUnchecked (enc, 'u');\n\t\t\tBuffer_AppendCharUnchecked (enc, 'l');\n\t\t\tBuffer_AppendCharUnchecked (enc, 'l');\n\t\t\tbreak;\n\t\t}\n\n\t\tcase JT_DOUBLE:\n\t\t{\n\t\t\tif (!Buffer_AppendDoubleUnchecked (obj, enc, enc->getDoubleValue(obj, &tc)))\n\t\t\t{\n\t\t\t\tenc->endTypeContext(obj, &tc);\n\t\t\t\tenc->level --;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase JT_UTF8:\n\t\t{\n\t\t\tconst char *value = enc->getStringValue(obj, &tc, &szlen);\n\t\t\tBuffer_Reserve(enc, ((szlen / 4) + 1) * 12);\n\t\t\tBuffer_AppendCharUnchecked (enc, '\\\"');\n\n\n\t\t\tif (enc->forceASCII)\n\t\t\t{\n\t\t\t\tif (!Buffer_EscapeStringValidated(obj, enc, value, value + szlen))\n\t\t\t\t{\n\t\t\t\t\tenc->endTypeContext(obj, &tc);\n\t\t\t\t\tenc->level --;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (!Buffer_EscapeStringUnvalidated(obj, enc, value, value + szlen))\n\t\t\t\t{\n\t\t\t\t\tenc->endTypeContext(obj, &tc);\n\t\t\t\t\tenc->level --;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tBuffer_AppendCharUnchecked (enc, '\\\"');\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tenc->endTypeContext(obj, &tc);\n\tenc->level --;\n\n}\n\nchar *JSON_EncodeObject(JSOBJ obj, JSONObjectEncoder *enc, char *_buffer, size_t _cbBuffer)\n{\n\tenc->malloc = enc->malloc ? enc->malloc : malloc;\n\tenc->free =  enc->free ? enc->free : free;\n\tenc->realloc = enc->realloc ? enc->realloc : realloc;\n\tenc->errorMsg = NULL;\n\tenc->errorObj = NULL;\n\tenc->level = 0;\n\n\tif (enc->recursionMax < 1)\n\t{\n\t\tenc->recursionMax = JSON_MAX_RECURSION_DEPTH;\n\t}\n\n\tif (enc->doublePrecision < 0 ||\n\t\t\tenc->doublePrecision > JSON_DOUBLE_MAX_DECIMALS)\n\t{\n\t\tenc->doublePrecision = JSON_DOUBLE_MAX_DECIMALS;\n\t}\n\n\tif (_buffer == NULL)\n\t{\n\t\t_cbBuffer = 32768;\n\t\tenc->start = (char *) enc->malloc (_cbBuffer);\n\t\tenc->heap = 1;\n\t}\n\telse\n\t{\n\t\tenc->start = _buffer;\n\t\tenc->heap = 0;\n\t}\n\n\tenc->end = enc->start + _cbBuffer;\n\tenc->offset = enc->start;\n\n\n\tencode (obj, enc, NULL, 0);\n\t\n\tBuffer_Reserve(enc, 1);\n\tBuffer_AppendCharUnchecked(enc, '\\0');\n\n\treturn enc->start;\n}"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/COPYING",
    "content": "Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE."
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/ChangeLog",
    "content": "2.0.1\n     * lth generator flag to allow client to specify they want\n\tescaped solidi '/'.  issue #28\n     * lth crash fix when yajl_parse() is never called. issue #27\n\n2.0.0\n     * lth YAJL is now ISC licensed: http://en.wikipedia.org/wiki/ISC_license\n     * lth 20-35% (osx and linux respectively) parsing performance\n\timprovement attained by tweaking string scanning (idea: @michaelrhanson).\n     * Florian Forster & lth - yajl_tree interface introduced as a higher level\n\tinterface to the parser (eats JSON, poops a memory representation)\n     * lth require a C99 compiler\n     * lth integers are now represented with long long (64bit+) on all platforms.\n     * lth size_t now used throughout to represent buffer lengths, so you can\n\tsafely manage buffers greater than 4GB.\n     * gno semantic improvements to yajl's API regarding partial value parsing and\n\ttrailing garbage\n     * lth new configuration mechanism for yajl, see yajl_config() and\n\tyajl_gen_config()\n     * gno more allocation checking in more places\n     * gno remove usage of strtol, replace with custom implementation that cares\n\tnot about your locale.\n     * lth yajl_parse_complete renamed to yajl_complete_parse.\n     * lth add a switch to validate utf8 strings as they are generated.\n     * lth tests are a lot quieter in their output.\n     * lth addition of a little in tree performance benchmark, `perftest` in\n\tperf/perftest.c\n\n1.0.12\n     * Conrad Irwin - Parse null bytes correctly\n     * Mirek Rusin - fix LLVM warnings\n     * gno - Don't generate numbers for keys. closes #13\n     * lth - various win32 fixes, including build documentation improvements\n     * John Stamp - Don't export private symbols.\n     * John Stamp - Install yajl_version.h, not the template.\n     * John Stamp - Don't use -fPIC for static lib.  Cmake will automatically add it for the shared.\n     * lth 0 fix paths embedded in dylib upon installation on osx.  closes #11\n\n1.0.11\n     * lth remove -Wno-missing-field-initializers for greater gcc compat (3.4.6)\n\n1.0.10\n     * Brian Maher - yajl is now buildable without a c++ compiler present\n     * Brian Maher - fix header installation on OSX with cmake 2.8.0 installed\n     * lth & vitali - allow builder to specify alternate lib directory\n\tfor installation (i.e. lib64) \n     * Vitali Lovich - yajl version number now programatically accessible\n     * lth - prevent cmake from embedding rpaths in binaries.  Static linking\n\tmakes this unneccesary.\n\n1.0.9\n     * lth - fix inverted logic causing yajl_gen_double() to always fail on\n\twin32 (thanks to Fredrik Kihlander for the report) \n\n1.0.8\n     * Randall E. Barker - move dllexport defnitions so dlls with proper\n\texports can again be generated on windows \n     * lth - add yajl_get_bytes_consumed() which allows the client to\n\tdetermine the offset as an error, as well as determine how\n\tmany bytes of an input buffer were consumed.\n     * lth - fixes to keep \"error offset\" up to date (like when the\n\tclient callback returns 0)\n     * Brian Maher - allow client to specify a printing function in\n       generation\n\n1.0.7\n     * lth fix win32 build (isinf and isnan)\n\n1.0.6\n     * lth fix several compiler warnings\n     * lth fix generation of invalid json from yajl_gen_double\n\t(NaN is not JSON)\n     * jstamp support for combining short options in tools\n     * jstamp exit properly on errors from tools\n     * octo test success no longer depends on integer size\n     * max fix configure --prefix\n\n1.0.5\n     * lth several performance improvements related to function\n\tinlinin'\n\n1.0.4\n     * lth fix broken utf8 validation for three & four byte represenations.\n\tthanks to http://github.com/brianmario and\n\thttp://github.com/technoweenie\n\n1.0.3\n     * lth fix syntax error in cplusplus extern \"C\" statements for wider\n\tcompiler support\n\n1.0.2\n     * lth update doxygen documentation with new sample code, passing NULL\n\tfor allocation functions added in 1.0.0\n\n1.0.1\n     * lth resolve crash in json_reformatter due to incorrectly ordered\n\tparameters.\n\n1.0.0\n     * lth add 'make install' rules, thaks to Andrei Soroker for the\n\tcontribution.\n     * lth client may override allocation routines at generator or parser\n\tallocation time\n     * tjw add yajl_parse_complete routine to allow client to explicitly\n\tspecify end-of-input, solving the \"lonely number\" case, where\n\tjson text consists only of an element with no explicit syntactic\n\tend.\n     * tjw many new test cases\t\n     * tjw cleanup of code for symmetry and ease of reading\n     * lth integration of patches from Robert Varga which cleanup\n\tcompilation warnings on 64 bit linux\n\n0.4.0\n     * lth buffer overflow bug in yajl_gen_double s/%lf/%g/ - thanks to\n\tEric Bergstrome\n     * lth yajl_number callback to allow passthrough of arbitrary precision\n\tnumbers to client.  Thanks to Hatem Nassrat.\n     * lth yajl_integer now deals in long, instead of long long.  This\n\tcombined with yajl_number improves compiler compatibility while\n\tmaintaining precision.\n     * lth better ./configure && make experience (still requires cmake and\n\truby)\n     * lth fix handling of special characters hex 0F and 1F in yajl_encode\n\t(thanks to Robert Geiger)\n     * lth allow leading zeros in exponents (thanks to Hatem Nassrat)\n\n0.3.0\n     * lth doxygen documentation (html & man) generated as part of the\n\tbuild\n     * lth many documentation updates.\n     * lth fix to work with older versions of cmake (don't use LOOSE_LOOP\n\tconstructs)\n     * lth work around different behavior of freebsd 4 scanf.  initialize\n\tparameter to scanf to zero.\n     * lth all tests run 32x with ranging buffer sizes to stress stream\n        parsing\n     * lth yajl_test accepts -b option to allow read buffer size to be\n        set\n     * lth option to validate UTF8 added to parser (argument in\n        yajl_parser_cfg)\n     * lth fix buffer overrun when chunk ends inside \\u escaped text\n     * lth support client cancelation\n\n0.2.2\n     * lth on windows build debug with C7 symbols and no pdb files.\n\n0.2.1\n     * fix yajl_reformat and yajl_verify to work on arbitrarily sized\n        inputs.\n     * fix win32 build break, clean up all errors and warnings.\n     * fix optimized build flags.\n\n0.2.0\n     * optionally support comments in input text\n\n0.1.0\n     * Initial release\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/README",
    "content": "**********************************************************************\n        This is YAJL 2, for the legacy version of YAJL.  see\n              https://github.com/lloyd/yajl/tree/1.x\n**********************************************************************\n\nWelcome to Yet Another JSON Library (YAJL)\n\n## Why does the world need another C library for parsing JSON?  \n\nGood question.  In a review of current C JSON parsing libraries I was \nunable to find one that satisfies my requirements.  Those are, \n0. written in C\n1. portable\n2. robust -- as close to \"crash proof\" as possible\n3. data representation independent\n4. fast\n5. generates verbose, useful error messages including context of where\n   the error occurs in the input text.\n6. can parse JSON data off a stream, incrementally\n7. simple to use\n8. tiny\n\nNumbers 3, 5, 6, and 7 where particularly hard to find, and were what \ncaused me to ultimately create YAJL.  This document is a tour of some\nof the more important aspects of YAJL.\n\n## YAJL is Free.\n\nPermissive licensing means you can use it in open source and\ncommercial products alike without any fees.  My request beyond the\nlicensing is that if you find bugs drop me a email, or better yet,\nfork and fix.\n\nPorting YAJL should be trivial, the implementation is ANSI C.  If you\nport to new systems I'd love to hear of it and integrate your patches.\n\n## YAJL is data representation independent.\n\nBYODR!  Many JSON libraries impose a structure based data representation\non you.  This is a benefit in some cases and a drawback in others.\nYAJL uses callbacks to remain agnostic of the in-memory representation.\nSo if you wish to build up an in-memory representation, you may do so\nusing YAJL, but you must bring the code that defines and populates the\nin memory structure.\n\nThis also means that YAJL can be used by other (higher level) JSON\nlibraries if so desired.\n\n## YAJL supports stream parsing\n\nThis means you do not need to hold the whole JSON representation in\ntextual form in memory.  This makes YAJL ideal for filtering projects,\nwhere you're converting YAJL from one form to another (i.e. XML).  The\nincluded JSON pretty printer is an example of such a filter program.\n\n## YAJL is fast\n\nMinimal memory copying is performed.  YAJL, when possible, returns\npointers into the client provided text (i.e. for strings that have no\nembedded escape chars, hopefully the common case).  I've put a lot of\neffort into profiling and tuning performance, but I have ignored a\ncouple possible performance improvements to keep the interface clean,\nsmall, and flexible.  My hope is that YAJL will perform comparably to\nthe fastest JSON parser out there.\n\nYAJL should impose both minimal CPU and memory requirements on your\napplication.\n\n## YAJL is tiny.\n\nFat free.  No whip.\n\nenjoy,\nLloyd - July, 2007 \n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/TODO",
    "content": "* add a test for 0x1F bug\n* numeric overflow in integers and double\n* line and char offsets in the lexer and in error messages\n* testing:\n  a. the permuter\n  b. some performance comparison against json_checker.\n* investigate pull instead of push parsing\n* Handle memory allocation failures gracefully\n* cygwin/msys support on win32\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/include/yajl/yajl_common.h",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#ifndef __YAJL_COMMON_H__\n#define __YAJL_COMMON_H__\n\n#include <stddef.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif    \n\n#define YAJL_MAX_DEPTH 128\n\n/* msft dll export gunk.  To build a DLL on windows, you\n * must define WIN32, YAJL_SHARED, and YAJL_BUILD.  To use a shared\n * DLL, you must define YAJL_SHARED and WIN32 */\n#if defined(WIN32) && defined(YAJL_SHARED)\n#  ifdef YAJL_BUILD\n#    define YAJL_API __declspec(dllexport)\n#  else\n#    define YAJL_API __declspec(dllimport)\n#  endif\n#else\n#  if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303\n#    define YAJL_API __attribute__ ((visibility(\"default\")))\n#  else\n#    define YAJL_API\n#  endif\n#endif \n\n/** pointer to a malloc function, supporting client overriding memory\n *  allocation routines */\ntypedef void * (*yajl_malloc_func)(void *ctx, size_t sz);\n\n/** pointer to a free function, supporting client overriding memory\n *  allocation routines */\ntypedef void (*yajl_free_func)(void *ctx, void * ptr);\n\n/** pointer to a realloc function which can resize an allocation. */\ntypedef void * (*yajl_realloc_func)(void *ctx, void * ptr, size_t sz);\n\n/** A structure which can be passed to yajl_*_alloc routines to allow the\n *  client to specify memory allocation functions to be used. */\ntypedef struct\n{\n    /** pointer to a function that can allocate uninitialized memory */\n    yajl_malloc_func malloc;\n    /** pointer to a function that can resize memory allocations */\n    yajl_realloc_func realloc;\n    /** pointer to a function that can free memory allocated using\n     *  reallocFunction or mallocFunction */\n    yajl_free_func free;\n    /** a context pointer that will be passed to above allocation routines */\n    void * ctx;\n} yajl_alloc_funcs;\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/include/yajl/yajl_gen.h",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * \\file yajl_gen.h\n * Interface to YAJL's JSON generation facilities.\n */\n\n#include <yajl/yajl_common.h>\n\n#ifndef __YAJL_GEN_H__\n#define __YAJL_GEN_H__\n\n#include <stddef.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n    /** generator status codes */\n    typedef enum {\n        /** no error */\n        yajl_gen_status_ok = 0,\n        /** at a point where a map key is generated, a function other than\n         *  yajl_gen_string was called */\n        yajl_gen_keys_must_be_strings,\n        /** YAJL's maximum generation depth was exceeded.  see\n         *  YAJL_MAX_DEPTH */\n        yajl_max_depth_exceeded,\n        /** A generator function (yajl_gen_XXX) was called while in an error\n         *  state */\n        yajl_gen_in_error_state,\n        /** A complete JSON document has been generated */\n        yajl_gen_generation_complete,                \n        /** yajl_gen_double was passed an invalid floating point value\n         *  (infinity or NaN). */\n        yajl_gen_invalid_number,\n        /** A print callback was passed in, so there is no internal\n         * buffer to get from */\n        yajl_gen_no_buf,\n        /** returned from yajl_gen_string() when the yajl_gen_validate_utf8\n         *  option is enabled and an invalid was passed by client code.\n         */\n        yajl_gen_invalid_string\n    } yajl_gen_status;\n\n    /** an opaque handle to a generator */\n    typedef struct yajl_gen_t * yajl_gen;\n\n    /** a callback used for \"printing\" the results. */\n    typedef void (*yajl_print_t)(void * ctx,\n                                 const char * str,\n                                 size_t len);\n\n    /** configuration parameters for the parser, these may be passed to\n     *  yajl_gen_config() along with option specific argument(s).  In general,\n     *  all configuration parameters default to *off*. */\n    typedef enum {\n        /** generate indented (beautiful) output */\n        yajl_gen_beautify = 0x01,\n        /**\n         * Set an indent string which is used when yajl_gen_beautify\n         * is enabled.  Maybe something like \\\\t or some number of\n         * spaces.  The default is four spaces ' '.\n         */\n        yajl_gen_indent_string = 0x02,\n        /**\n         * Set a function and context argument that should be used to\n         * output generated json.  the function should conform to the\n         * yajl_print_t prototype while the context argument is a\n         * void * of your choosing.\n         *\n         * example:\n         *   yajl_gen_config(g, yajl_gen_print_callback, myFunc, myVoidPtr);\n         */\n        yajl_gen_print_callback = 0x04,\n        /**\n         * Normally the generator does not validate that strings you\n         * pass to it via yajl_gen_string() are valid UTF8.  Enabling\n         * this option will cause it to do so.\n         */\n        yajl_gen_validate_utf8 = 0x08,\n        /**\n         * the forward solidus (slash or '/' in human) is not required to be\n         * escaped in json text.  By default, YAJL will not escape it in the\n         * iterest of saving bytes.  Setting this flag will cause YAJL to\n         * always escape '/' in generated JSON strings.\n         */\n        yajl_gen_escape_solidus = 0x10\n    } yajl_gen_option;\n\n    /** allow the modification of generator options subsequent to handle\n     *  allocation (via yajl_alloc)\n     *  \\returns zero in case of errors, non-zero otherwise\n     */\n    YAJL_API int yajl_gen_config(yajl_gen g, yajl_gen_option opt, ...);\n\n    /** allocate a generator handle\n     *  \\param allocFuncs an optional pointer to a structure which allows\n     *                    the client to overide the memory allocation\n     *                    used by yajl.  May be NULL, in which case\n     *                    malloc/free/realloc will be used.\n     *\n     *  \\returns an allocated handle on success, NULL on failure (bad params)\n     */\n    YAJL_API yajl_gen yajl_gen_alloc(const yajl_alloc_funcs * allocFuncs);\n\n    /** free a generator handle */\n    YAJL_API void yajl_gen_free(yajl_gen handle);\n\n    YAJL_API yajl_gen_status yajl_gen_integer(yajl_gen hand, long long int number);\n    /** generate a floating point number.  number may not be infinity or\n     *  NaN, as these have no representation in JSON.  In these cases the\n     *  generator will return 'yajl_gen_invalid_number' */\n    YAJL_API yajl_gen_status yajl_gen_double(yajl_gen hand, double number);\n    YAJL_API yajl_gen_status yajl_gen_number(yajl_gen hand,\n                                             const char * num,\n                                             size_t len);\n    YAJL_API yajl_gen_status yajl_gen_string(yajl_gen hand,\n                                             const unsigned char * str,\n                                             size_t len);\n    YAJL_API yajl_gen_status yajl_gen_null(yajl_gen hand);\n    YAJL_API yajl_gen_status yajl_gen_bool(yajl_gen hand, int boolean);\n    YAJL_API yajl_gen_status yajl_gen_map_open(yajl_gen hand);\n    YAJL_API yajl_gen_status yajl_gen_map_close(yajl_gen hand);\n    YAJL_API yajl_gen_status yajl_gen_array_open(yajl_gen hand);\n    YAJL_API yajl_gen_status yajl_gen_array_close(yajl_gen hand);\n\n    /** access the null terminated generator buffer.  If incrementally\n     *  outputing JSON, one should call yajl_gen_clear to clear the\n     *  buffer.  This allows stream generation. */\n    YAJL_API yajl_gen_status yajl_gen_get_buf(yajl_gen hand,\n                                              const unsigned char ** buf,\n                                              size_t * len);\n\n    /** clear yajl's output buffer, but maintain all internal generation\n     *  state.  This function will not \"reset\" the generator state, and is\n     *  intended to enable incremental JSON outputing. */\n    YAJL_API void yajl_gen_clear(yajl_gen hand);\n\n#ifdef __cplusplus\n}\n#endif    \n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/include/yajl/yajl_parse.h",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * \\file yajl_parse.h\n * Interface to YAJL's JSON stream parsing facilities.\n */\n\n#include <yajl/yajl_common.h>\n\n#ifndef __YAJL_PARSE_H__\n#define __YAJL_PARSE_H__\n\n#include <stddef.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n    /** error codes returned from this interface */\n    typedef enum {\n        /** no error was encountered */\n        yajl_status_ok,\n        /** a client callback returned zero, stopping the parse */\n        yajl_status_client_canceled,\n        /** An error occured during the parse.  Call yajl_get_error for\n         *  more information about the encountered error */\n        yajl_status_error\n    } yajl_status;\n\n    /** attain a human readable, english, string for an error */\n    YAJL_API const char * yajl_status_to_string(yajl_status code);\n\n    /** an opaque handle to a parser */\n    typedef struct yajl_handle_t * yajl_handle;\n\n    /** yajl is an event driven parser.  this means as json elements are\n     *  parsed, you are called back to do something with the data.  The\n     *  functions in this table indicate the various events for which\n     *  you will be called back.  Each callback accepts a \"context\"\n     *  pointer, this is a void * that is passed into the yajl_parse\n     *  function which the client code may use to pass around context.\n     *\n     *  All callbacks return an integer.  If non-zero, the parse will\n     *  continue.  If zero, the parse will be canceled and\n     *  yajl_status_client_canceled will be returned from the parse.\n     *\n     *  \\attention {\n     *    A note about the handling of numbers:\n     *\n     *    yajl will only convert numbers that can be represented in a\n     *    double or a 64 bit (long long) int.  All other numbers will\n     *    be passed to the client in string form using the yajl_number\n     *    callback.  Furthermore, if yajl_number is not NULL, it will\n     *    always be used to return numbers, that is yajl_integer and\n     *    yajl_double will be ignored.  If yajl_number is NULL but one\n     *    of yajl_integer or yajl_double are defined, parsing of a\n     *    number larger than is representable in a double or 64 bit\n     *    integer will result in a parse error.\n     *  }\n     */\n    typedef struct {\n        int (* yajl_null)(void * ctx);\n        int (* yajl_boolean)(void * ctx, int boolVal);\n        int (* yajl_integer)(void * ctx, long long integerVal);\n        int (* yajl_double)(void * ctx, double doubleVal);\n        /** A callback which passes the string representation of the number\n         *  back to the client.  Will be used for all numbers when present */\n        int (* yajl_number)(void * ctx, const char * numberVal,\n                            size_t numberLen);\n\n        /** strings are returned as pointers into the JSON text when,\n         * possible, as a result, they are _not_ null padded */\n        int (* yajl_string)(void * ctx, const unsigned char * stringVal,\n                            size_t stringLen);\n\n        int (* yajl_start_map)(void * ctx);\n        int (* yajl_map_key)(void * ctx, const unsigned char * key,\n                             size_t stringLen);\n        int (* yajl_end_map)(void * ctx);\n\n        int (* yajl_start_array)(void * ctx);\n        int (* yajl_end_array)(void * ctx);\n    } yajl_callbacks;\n\n    /** allocate a parser handle\n     *  \\param callbacks  a yajl callbacks structure specifying the\n     *                    functions to call when different JSON entities\n     *                    are encountered in the input text.  May be NULL,\n     *                    which is only useful for validation.\n     *  \\param afs        memory allocation functions, may be NULL for to use\n     *                    C runtime library routines (malloc and friends) \n     *  \\param ctx        a context pointer that will be passed to callbacks.\n     */\n    YAJL_API yajl_handle yajl_alloc(const yajl_callbacks * callbacks,\n                                    yajl_alloc_funcs * afs,\n                                    void * ctx);\n\n\n    /** configuration parameters for the parser, these may be passed to\n     *  yajl_config() along with option specific argument(s).  In general,\n     *  all configuration parameters default to *off*. */\n    typedef enum {\n        /** Ignore javascript style comments present in\n         *  JSON input.  Non-standard, but rather fun\n         *  arguments: toggled off with integer zero, on otherwise.\n         *\n         *  example:\n         *    yajl_config(h, yajl_allow_comments, 1); // turn comment support on\n         */\n        yajl_allow_comments = 0x01,\n        /**\n         * When set the parser will verify that all strings in JSON input are\n         * valid UTF8 and will emit a parse error if this is not so.  When set,\n         * this option makes parsing slightly more expensive (~7% depending\n         * on processor and compiler in use)\n         *\n         * example:\n         *   yajl_config(h, yajl_dont_validate_strings, 1); // disable utf8 checking\n         */\n        yajl_dont_validate_strings     = 0x02,\n        /**\n         * By default, upon calls to yajl_complete_parse(), yajl will\n         * ensure the entire input text was consumed and will raise an error\n         * otherwise.  Enabling this flag will cause yajl to disable this\n         * check.  This can be useful when parsing json out of a that contains more\n         * than a single JSON document.\n         */\n        yajl_allow_trailing_garbage = 0x04,\n        /**\n         * Allow multiple values to be parsed by a single handle.  The\n         * entire text must be valid JSON, and values can be seperated\n         * by any kind of whitespace.  This flag will change the\n         * behavior of the parser, and cause it continue parsing after\n         * a value is parsed, rather than transitioning into a\n         * complete state.  This option can be useful when parsing multiple\n         * values from an input stream.\n         */\n        yajl_allow_multiple_values = 0x08,\n        /**\n         * When yajl_complete_parse() is called the parser will\n         * check that the top level value was completely consumed.  I.E.,\n         * if called whilst in the middle of parsing a value\n         * yajl will enter an error state (premature EOF).  Setting this\n         * flag suppresses that check and the corresponding error.\n         */\n        yajl_allow_partial_values = 0x10\n    } yajl_option;\n\n    /** allow the modification of parser options subsequent to handle\n     *  allocation (via yajl_alloc)\n     *  \\returns zero in case of errors, non-zero otherwise\n     */\n    YAJL_API int yajl_config(yajl_handle h, yajl_option opt, ...);\n\n    /** free a parser handle */\n    YAJL_API void yajl_free(yajl_handle handle);\n\n    /** Parse some json!\n     *  \\param hand - a handle to the json parser allocated with yajl_alloc\n     *  \\param jsonText - a pointer to the UTF8 json text to be parsed\n     *  \\param jsonTextLength - the length, in bytes, of input text\n     */\n    YAJL_API yajl_status yajl_parse(yajl_handle hand,\n                                    const unsigned char * jsonText,\n                                    size_t jsonTextLength);\n\n    /** Parse any remaining buffered json.\n     *  Since yajl is a stream-based parser, without an explicit end of\n     *  input, yajl sometimes can't decide if content at the end of the\n     *  stream is valid or not.  For example, if \"1\" has been fed in,\n     *  yajl can't know whether another digit is next or some character\n     *  that would terminate the integer token.\n     *\n     *  \\param hand - a handle to the json parser allocated with yajl_alloc\n     */\n    YAJL_API yajl_status yajl_complete_parse(yajl_handle hand);\n\n    /** get an error string describing the state of the\n     *  parse.\n     *\n     *  If verbose is non-zero, the message will include the JSON\n     *  text where the error occured, along with an arrow pointing to\n     *  the specific char.\n     *\n     *  \\returns A dynamically allocated string will be returned which should\n     *  be freed with yajl_free_error\n     */\n    YAJL_API unsigned char * yajl_get_error(yajl_handle hand, int verbose,\n                                            const unsigned char * jsonText,\n                                            size_t jsonTextLength);\n\n    /**\n     * get the amount of data consumed from the last chunk passed to YAJL.\n     *\n     * In the case of a successful parse this can help you understand if\n     * the entire buffer was consumed (which will allow you to handle\n     * \"junk at end of input\").\n     *\n     * In the event an error is encountered during parsing, this function\n     * affords the client a way to get the offset into the most recent\n     * chunk where the error occured.  0 will be returned if no error\n     * was encountered.\n     */\n    YAJL_API size_t yajl_get_bytes_consumed(yajl_handle hand);\n\n    /** free an error returned from yajl_get_error */\n    YAJL_API void yajl_free_error(yajl_handle hand, unsigned char * str);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/include/yajl/yajl_tree.h",
    "content": "/*\n * Copyright (c) 2010-2011  Florian Forster  <ff at octo.it>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * \\file yajl_tree.h\n *\n * Parses JSON data and returns the data in tree form.\n *\n * \\author Florian Forster\n * \\date August 2010\n *\n * This interface makes quick parsing and extraction of\n * smallish JSON docs trivial:\n *\n * \\include example/parse_config.c\n */\n\n#ifndef YAJL_TREE_H\n#define YAJL_TREE_H 1\n\n#include <yajl/yajl_common.h>\n\n/** possible data types that a yajl_val_s can hold */\ntypedef enum {\n    yajl_t_string = 1,\n    yajl_t_number = 2,\n    yajl_t_object = 3,\n    yajl_t_array = 4,\n    yajl_t_true = 5,\n    yajl_t_false = 6,\n    yajl_t_null = 7,\n    /** The any type isn't valid for yajl_val_s.type, but can be\n     *  used as an argument to routines like yajl_tree_get().\n     */\n    yajl_t_any = 8\n} yajl_type;\n\n#define YAJL_NUMBER_INT_VALID    0x01\n#define YAJL_NUMBER_DOUBLE_VALID 0x02\n\n/** A pointer to a node in the parse tree */\ntypedef struct yajl_val_s * yajl_val;\n\n/**\n * A JSON value representation capable of holding one of the seven\n * types above. For \"string\", \"number\", \"object\", and \"array\"\n * additional data is available in the union.  The \"YAJL_IS_*\"\n * and \"YAJL_GET_*\" macros below allow type checking and convenient\n * value extraction.\n */\nstruct yajl_val_s\n{\n    /** Type of the value contained. Use the \"YAJL_IS_*\" macors to check for a\n     * specific type. */\n    yajl_type type;\n    /** Type-specific data. You may use the \"YAJL_GET_*\" macros to access these\n     * members. */\n    union\n    {\n        char * string;\n        struct {\n            long long i; /*< integer value, if representable. */\n            double  d;   /*< double value, if representable. */\n            /** Signals whether the \\em i and \\em d members are\n             * valid. See \\c YAJL_NUMBER_INT_VALID and\n             * \\c YAJL_NUMBER_DOUBLE_VALID. */\n            char   *r;   /*< unparsed number in string form. */\n            unsigned int flags;\n        } number;\n        struct {\n            const char **keys; /*< Array of keys */\n            yajl_val *values; /*< Array of values. */\n            size_t len; /*< Number of key-value-pairs. */\n        } object;\n        struct {\n            yajl_val *values; /*< Array of elements. */\n            size_t len; /*< Number of elements. */\n        } array;\n    } u;\n};\n\n/**\n * Parse a string.\n *\n * Parses an null-terminated string containing JSON data and returns a pointer\n * to the top-level value (root of the parse tree).\n *\n * \\param input              Pointer to a null-terminated utf8 string containing\n *                           JSON data.\n * \\param error_buffer       Pointer to a buffer in which an error message will\n *                           be stored if \\em yajl_tree_parse fails, or\n *                           \\c NULL. The buffer will be initialized before\n *                           parsing, so its content will be destroyed even if\n *                           \\em yajl_tree_parse succeeds.\n * \\param error_buffer_size  Size of the memory area pointed to by\n *                           \\em error_buffer_size. If \\em error_buffer_size is\n *                           \\c NULL, this argument is ignored.\n *\n * \\returns Pointer to the top-level value or \\c NULL on error. The memory\n * pointed to must be freed using \\em yajl_tree_free. In case of an error, a\n * null terminated message describing the error in more detail is stored in\n * \\em error_buffer if it is not \\c NULL.\n */\nYAJL_API yajl_val yajl_tree_parse (const char *input,\n                                   char *error_buffer, size_t error_buffer_size);\n\n/**\n * Free a parse tree returned by \"yajl_tree_parse\".\n *\n * \\param v Pointer to a JSON value returned by \"yajl_tree_parse\". Passing NULL\n * is valid and results in a no-op.\n */\nYAJL_API void yajl_tree_free (yajl_val v);\n\n/**\n * Access a nested value inside a tree.\n *\n * \\param parent the node under which you'd like to extract values.\n * \\param path A null terminated array of strings, each the name of an object key\n * \\param type the yajl_type of the object you seek, or yajl_t_any if any will do.\n *\n * \\returns a pointer to the found value, or NULL if we came up empty.\n * \n * Future Ideas:  it'd be nice to move path to a string and implement support for\n * a teeny tiny micro language here, so you can extract array elements, do things\n * like .first and .last, even .length.  Inspiration from JSONPath and css selectors?\n * No it wouldn't be fast, but that's not what this API is about.\n */\nYAJL_API yajl_val yajl_tree_get(yajl_val parent, const char ** path, yajl_type type);\n\n/* Various convenience macros to check the type of a `yajl_val` */\n#define YAJL_IS_STRING(v) (((v) != NULL) && ((v)->type == yajl_t_string))\n#define YAJL_IS_NUMBER(v) (((v) != NULL) && ((v)->type == yajl_t_number))\n#define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.flags & YAJL_NUMBER_INT_VALID))\n#define YAJL_IS_DOUBLE(v) (YAJL_IS_NUMBER(v) && ((v)->u.flags & YAJL_NUMBER_DOUBLE_VALID))\n#define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))\n#define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))\n#define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))\n#define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))\n#define YAJL_IS_NULL(v)   (((v) != NULL) && ((v)->type == yajl_t_null  ))\n\n/** Given a yajl_val_string return a ptr to the bare string it contains,\n *  or NULL if the value is not a string. */\n#define YAJL_GET_STRING(v) (YAJL_IS_STRING(v) ? (v)->u.string : NULL)\n\n/** Get the string representation of a number.  You should check type first,\n *  perhaps using YAJL_IS_NUMBER */\n#define YAJL_GET_NUMBER(v) ((v)->u.number.r)\n\n/** Get the double representation of a number.  You should check type first,\n *  perhaps using YAJL_IS_DOUBLE */\n#define YAJL_GET_DOUBLE(v) ((v)->u.number.d)\n\n/** Get the 64bit (long long) integer representation of a number.  You should\n *  check type first, perhaps using YAJL_IS_INTEGER */\n#define YAJL_GET_INTEGER(v) ((v)->u.number.i)\n\n/** Get a pointer to a yajl_val_object or NULL if the value is not an object. */\n#define YAJL_GET_OBJECT(v) (YAJL_IS_OBJECT(v) ? &(v)->u.object : NULL)\n\n/** Get a pointer to a yajl_val_array or NULL if the value is not an object. */\n#define YAJL_GET_ARRAY(v)  (YAJL_IS_ARRAY(v)  ? &(v)->u.array  : NULL)\n\n#endif /* YAJL_TREE_H */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/include/yajl/yajl_version.h",
    "content": "#ifndef YAJL_VERSION_H_\n#define YAJL_VERSION_H_\n\n#include <yajl/yajl_common.h>\n\n#define YAJL_MAJOR 2\n#define YAJL_MINOR 0\n#define YAJL_MICRO 1\n\n#define YAJL_VERSION ((YAJL_MAJOR * 10000) + (YAJL_MINOR * 100) + YAJL_MICRO)\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nextern int YAJL_API yajl_version(void);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* YAJL_VERSION_H_ */\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/CMakeLists.txt",
    "content": "# Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n#\n# Permission to use, copy, modify, and/or distribute this software for any\n# purpose with or without fee is hereby granted, provided that the above\n# copyright notice and this permission notice appear in all copies.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\nSET (SRCS yajl.c yajl_lex.c yajl_parser.c yajl_buf.c\n          yajl_encode.c yajl_gen.c yajl_alloc.c\n          yajl_tree.c yajl_version.c\n)\nSET (HDRS yajl_parser.h yajl_lex.h yajl_buf.h yajl_encode.h yajl_alloc.h)\nSET (PUB_HDRS api/yajl_parse.h api/yajl_gen.h api/yajl_common.h api/yajl_tree.h)\n\n# useful when fixing lexer bugs.\n#ADD_DEFINITIONS(-DYAJL_LEXER_DEBUG)\n\n# Ensure defined when building YAJL (as opposed to using it from\n# another project).  Used to ensure correct function export when\n# building win32 DLL.\nADD_DEFINITIONS(-DYAJL_BUILD)\n\n# set up some paths\nSET (libDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/lib)\nSET (incDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/include/yajl)\n\n# set the output path for libraries\nSET(LIBRARY_OUTPUT_PATH ${libDir})\n\nADD_LIBRARY(yajl_s STATIC ${SRCS} ${HDRS} ${PUB_HDRS})\n\nADD_LIBRARY(yajl SHARED ${SRCS} ${HDRS} ${PUB_HDRS})\n\n#### setup shared library version number\nSET_TARGET_PROPERTIES(yajl PROPERTIES\n                      DEFINE_SYMBOL YAJL_SHARED\n                      SOVERSION ${YAJL_MAJOR}\n                      VERSION ${YAJL_MAJOR}.${YAJL_MINOR}.${YAJL_MICRO})\n\n#### ensure a .dylib has correct absolute installation paths upon installation\nIF(APPLE)\n  MESSAGE(\"INSTALL_NAME_DIR: ${CMAKE_INSTALL_PREFIX}/lib\")\n  SET_TARGET_PROPERTIES(yajl PROPERTIES\n                        INSTALL_NAME_DIR \"${CMAKE_INSTALL_PREFIX}/lib\")\nENDIF(APPLE)\n\n#### build up an sdk as a post build step\n\n# create some directories\nFILE(MAKE_DIRECTORY ${libDir})\nFILE(MAKE_DIRECTORY ${incDir})\n\n# generate build-time source\nCONFIGURE_FILE(api/yajl_version.h.cmake ${incDir}/yajl_version.h)\n\n# copy public headers to output directory\nFOREACH (header ${PUB_HDRS})\n  SET (header ${CMAKE_CURRENT_SOURCE_DIR}/${header})\n\n  EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E copy_if_different ${header} ${incDir})\n\n  ADD_CUSTOM_COMMAND(TARGET yajl_s POST_BUILD\n      COMMAND ${CMAKE_COMMAND} -E copy_if_different ${header} ${incDir})\nENDFOREACH (header ${PUB_HDRS})\n\nINCLUDE_DIRECTORIES(${incDir}/..)\n\nIF(NOT WIN32)\n  # at build time you may specify the cmake variable LIB_SUFFIX to handle\n  # 64-bit systems which use 'lib64'\n  INSTALL(TARGETS yajl LIBRARY DESTINATION lib${LIB_SUFFIX})\n  INSTALL(TARGETS yajl_s ARCHIVE DESTINATION lib${LIB_SUFFIX})\n  INSTALL(FILES ${PUB_HDRS} DESTINATION include/yajl)\n  INSTALL(FILES ${incDir}/yajl_version.h DESTINATION include/yajl)\nENDIF()\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/YAJL.dxy",
    "content": "# Doxyfile 1.5.2\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) for a project\n#\n# All text after a hash (#) is considered a comment and will be ignored\n# The format is:\n#       TAG = value [value, ...]\n# For lists items can also be appended using:\n#       TAG += value [value, ...]\n# Values that contain spaces should be placed between quotes (\" \")\n\n#---------------------------------------------------------------------------\n# Project related configuration options\n#---------------------------------------------------------------------------\n\n# This tag specifies the encoding used for all characters in the config file that \n# follow. The default is UTF-8 which is also the encoding used for all text before \n# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into \n# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of \n# possible encodings.\n\nDOXYFILE_ENCODING      = UTF-8\n\n# The PROJECT_NAME tag is a single word (or a sequence of words surrounded \n# by quotes) that should identify the project.\n\nPROJECT_NAME           = YAJL\n\n# The PROJECT_NUMBER tag can be used to enter a project or revision number. \n# This could be handy for archiving the generated documentation or \n# if some version control system is used.\n\nPROJECT_NUMBER         = @YAJL_VERSION@\n\n# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) \n# base path where the generated documentation will be put. \n# If a relative path is entered, it will be relative to the location \n# where doxygen was started. If left blank the current directory will be used.\n\nOUTPUT_DIRECTORY       = yajl-@YAJL_VERSION@/share\n\n# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create \n# 4096 sub-directories (in 2 levels) under the output directory of each output \n# format and will distribute the generated files over these directories. \n# Enabling this option can be useful when feeding doxygen a huge amount of \n# source files, where putting all generated files in the same directory would \n# otherwise cause performance problems for the file system.\n\nCREATE_SUBDIRS         = NO\n\n# The OUTPUT_LANGUAGE tag is used to specify the language in which all \n# documentation generated by doxygen is written. Doxygen will use this \n# information to generate all constant output in the proper language. \n# The default language is English, other supported languages are: \n# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, \n# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, \n# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, \n# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, \n# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.\n\nOUTPUT_LANGUAGE        = English\n\n# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will \n# include brief member descriptions after the members that are listed in \n# the file and class documentation (similar to JavaDoc). \n# Set to NO to disable this.\n\nBRIEF_MEMBER_DESC      = YES\n\n# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend \n# the brief description of a member or function before the detailed description. \n# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the \n# brief descriptions will be completely suppressed.\n\nREPEAT_BRIEF           = YES\n\n# This tag implements a quasi-intelligent brief description abbreviator \n# that is used to form the text in various listings. Each string \n# in this list, if found as the leading text of the brief description, will be \n# stripped from the text and the result after processing the whole list, is \n# used as the annotated text. Otherwise, the brief description is used as-is. \n# If left blank, the following values are used (\"$name\" is automatically \n# replaced with the name of the entity): \"The $name class\" \"The $name widget\" \n# \"The $name file\" \"is\" \"provides\" \"specifies\" \"contains\" \n# \"represents\" \"a\" \"an\" \"the\"\n\nABBREVIATE_BRIEF       = \n\n# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then \n# Doxygen will generate a detailed section even if there is only a brief \n# description.\n\nALWAYS_DETAILED_SEC    = NO\n\n# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all \n# inherited members of a class in the documentation of that class as if those \n# members were ordinary class members. Constructors, destructors and assignment \n# operators of the base classes will not be shown.\n\nINLINE_INHERITED_MEMB  = NO\n\n# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full \n# path before files name in the file list and in the header files. If set \n# to NO the shortest path that makes the file name unique will be used.\n\nFULL_PATH_NAMES        = NO\n\n# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag \n# can be used to strip a user-defined part of the path. Stripping is \n# only done if one of the specified strings matches the left-hand part of \n# the path. The tag can be used to show relative paths in the file list. \n# If left blank the directory from which doxygen is run is used as the \n# path to strip.\n\nSTRIP_FROM_PATH        = \n\n# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of \n# the path mentioned in the documentation of a class, which tells \n# the reader which header file to include in order to use a class. \n# If left blank only the name of the header file containing the class \n# definition is used. Otherwise one should specify the include paths that \n# are normally passed to the compiler using the -I flag.\n\nSTRIP_FROM_INC_PATH    = \n\n# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter \n# (but less readable) file names. This can be useful is your file systems \n# doesn't support long names like on DOS, Mac, or CD-ROM.\n\nSHORT_NAMES            = NO\n\n# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen \n# will interpret the first line (until the first dot) of a JavaDoc-style \n# comment as the brief description. If set to NO, the JavaDoc \n# comments will behave just like the Qt-style comments (thus requiring an \n# explicit @brief command for a brief description.\n\nJAVADOC_AUTOBRIEF      = NO\n\n# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen \n# treat a multi-line C++ special comment block (i.e. a block of //! or /// \n# comments) as a brief description. This used to be the default behaviour. \n# The new default is to treat a multi-line C++ comment block as a detailed \n# description. Set this tag to YES if you prefer the old behaviour instead.\n\nMULTILINE_CPP_IS_BRIEF = NO\n\n# If the DETAILS_AT_TOP tag is set to YES then Doxygen \n# will output the detailed description near the top, like JavaDoc.\n# If set to NO, the detailed description appears after the member \n# documentation.\n\n# DETAILS_AT_TOP         = YES\n\n# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented \n# member inherits the documentation from any documented member that it \n# re-implements.\n\nINHERIT_DOCS           = YES\n\n# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce \n# a new page for each member. If set to NO, the documentation of a member will \n# be part of the file/class/namespace that contains it.\n\nSEPARATE_MEMBER_PAGES  = NO\n\n# The TAB_SIZE tag can be used to set the number of spaces in a tab. \n# Doxygen uses this value to replace tabs by spaces in code fragments.\n\nTAB_SIZE               = 4\n\n# This tag can be used to specify a number of aliases that acts \n# as commands in the documentation. An alias has the form \"name=value\". \n# For example adding \"sideeffect=\\par Side Effects:\\n\" will allow you to \n# put the command \\sideeffect (or @sideeffect) in the documentation, which \n# will result in a user-defined paragraph with heading \"Side Effects:\". \n# You can put \\n's in the value part of an alias to insert newlines.\n\nALIASES                = \n\n# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C \n# sources only. Doxygen will then generate output that is more tailored for C. \n# For instance, some of the names that are used will be different. The list \n# of all members will be omitted, etc.\n\nOPTIMIZE_OUTPUT_FOR_C  = YES\n\n# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java \n# sources only. Doxygen will then generate output that is more tailored for Java. \n# For instance, namespaces will be presented as packages, qualified scopes \n# will look different, etc.\n\nOPTIMIZE_OUTPUT_JAVA   = NO\n\n# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to \n# include (a tag file for) the STL sources as input, then you should \n# set this tag to YES in order to let doxygen match functions declarations and \n# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. \n# func(std::string) {}). This also make the inheritance and collaboration \n# diagrams that involve STL classes more complete and accurate.\n\nBUILTIN_STL_SUPPORT    = NO\n\n# If you use Microsoft's C++/CLI language, you should set this option to YES to\n# enable parsing support.\n\nCPP_CLI_SUPPORT        = NO\n\n# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC \n# tag is set to YES, then doxygen will reuse the documentation of the first \n# member in the group (if any) for the other members of the group. By default \n# all members of a group must be documented explicitly.\n\nDISTRIBUTE_GROUP_DOC   = NO\n\n# Set the SUBGROUPING tag to YES (the default) to allow class member groups of \n# the same type (for instance a group of public functions) to be put as a \n# subgroup of that type (e.g. under the Public Functions section). Set it to \n# NO to prevent subgrouping. Alternatively, this can be done per class using \n# the \\nosubgrouping command.\n\nSUBGROUPING            = NO\n\n#---------------------------------------------------------------------------\n# Build related configuration options\n#---------------------------------------------------------------------------\n\n# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in \n# documentation are documented, even if no documentation was available. \n# Private class members and static file members will be hidden unless \n# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES\n\nEXTRACT_ALL            = YES\n\n# If the EXTRACT_PRIVATE tag is set to YES all private members of a class \n# will be included in the documentation.\n\nEXTRACT_PRIVATE        = YES\n\n# If the EXTRACT_STATIC tag is set to YES all static members of a file \n# will be included in the documentation.\n\nEXTRACT_STATIC         = YES\n\n# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) \n# defined locally in source files will be included in the documentation. \n# If set to NO only classes defined in header files are included.\n\nEXTRACT_LOCAL_CLASSES  = YES\n\n# This flag is only useful for Objective-C code. When set to YES local \n# methods, which are defined in the implementation section but not in \n# the interface are included in the documentation. \n# If set to NO (the default) only methods in the interface are included.\n\nEXTRACT_LOCAL_METHODS  = YES\n\n# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all \n# undocumented members of documented classes, files or namespaces. \n# If set to NO (the default) these members will be included in the \n# various overviews, but no documentation section is generated. \n# This option has no effect if EXTRACT_ALL is enabled.\n\nHIDE_UNDOC_MEMBERS     = NO\n\n# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all \n# undocumented classes that are normally visible in the class hierarchy. \n# If set to NO (the default) these classes will be included in the various \n# overviews. This option has no effect if EXTRACT_ALL is enabled.\n\nHIDE_UNDOC_CLASSES     = NO\n\n# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all \n# friend (class|struct|union) declarations. \n# If set to NO (the default) these declarations will be included in the \n# documentation.\n\nHIDE_FRIEND_COMPOUNDS  = NO\n\n# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any \n# documentation blocks found inside the body of a function. \n# If set to NO (the default) these blocks will be appended to the \n# function's detailed documentation block.\n\nHIDE_IN_BODY_DOCS      = NO\n\n# The INTERNAL_DOCS tag determines if documentation \n# that is typed after a \\internal command is included. If the tag is set \n# to NO (the default) then the documentation will be excluded. \n# Set it to YES to include the internal documentation.\n\nINTERNAL_DOCS          = NO\n\n# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate \n# file names in lower-case letters. If set to YES upper-case letters are also \n# allowed. This is useful if you have classes or files whose names only differ \n# in case and if your file system supports case sensitive file names. Windows \n# and Mac users are advised to set this option to NO.\n\nCASE_SENSE_NAMES       = NO\n\n# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen \n# will show members with their full class and namespace scopes in the \n# documentation. If set to YES the scope will be hidden.\n\nHIDE_SCOPE_NAMES       = NO\n\n# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen \n# will put a list of the files that are included by a file in the documentation \n# of that file.\n\nSHOW_INCLUDE_FILES     = YES\n\n# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] \n# is inserted in the documentation for inline members.\n\nINLINE_INFO            = YES\n\n# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen \n# will sort the (detailed) documentation of file and class members \n# alphabetically by member name. If set to NO the members will appear in \n# declaration order.\n\nSORT_MEMBER_DOCS       = YES\n\n# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the \n# brief documentation of file, namespace and class members alphabetically \n# by member name. If set to NO (the default) the members will appear in \n# declaration order.\n\nSORT_BRIEF_DOCS        = NO\n\n# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be \n# sorted by fully-qualified names, including namespaces. If set to \n# NO (the default), the class list will be sorted only by class name, \n# not including the namespace part. \n# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.\n# Note: This option applies only to the class list, not to the \n# alphabetical list.\n\nSORT_BY_SCOPE_NAME     = NO\n\n# The GENERATE_TODOLIST tag can be used to enable (YES) or \n# disable (NO) the todo list. This list is created by putting \\todo \n# commands in the documentation.\n\nGENERATE_TODOLIST      = YES\n\n# The GENERATE_TESTLIST tag can be used to enable (YES) or \n# disable (NO) the test list. This list is created by putting \\test \n# commands in the documentation.\n\nGENERATE_TESTLIST      = YES\n\n# The GENERATE_BUGLIST tag can be used to enable (YES) or \n# disable (NO) the bug list. This list is created by putting \\bug \n# commands in the documentation.\n\nGENERATE_BUGLIST       = YES\n\n# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or \n# disable (NO) the deprecated list. This list is created by putting \n# \\deprecated commands in the documentation.\n\nGENERATE_DEPRECATEDLIST= YES\n\n# The ENABLED_SECTIONS tag can be used to enable conditional \n# documentation sections, marked by \\if sectionname ... \\endif.\n\nENABLED_SECTIONS       = \n\n# The MAX_INITIALIZER_LINES tag determines the maximum number of lines \n# the initial value of a variable or define consists of for it to appear in \n# the documentation. If the initializer consists of more lines than specified \n# here it will be hidden. Use a value of 0 to hide initializers completely. \n# The appearance of the initializer of individual variables and defines in the \n# documentation can be controlled using \\showinitializer or \\hideinitializer \n# command in the documentation regardless of this setting.\n\nMAX_INITIALIZER_LINES  = 30\n\n# Set the SHOW_USED_FILES tag to NO to disable the list of files generated \n# at the bottom of the documentation of classes and structs. If set to YES the \n# list will mention the files that were used to generate the documentation.\n\nSHOW_USED_FILES        = YES\n\n# If the sources in your project are distributed over multiple directories \n# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy \n# in the documentation. The default is NO.\n\nSHOW_DIRECTORIES       = NO\n\n# The FILE_VERSION_FILTER tag can be used to specify a program or script that \n# doxygen should invoke to get the current version for each file (typically from the \n# version control system). Doxygen will invoke the program by executing (via \n# popen()) the command <command> <input-file>, where <command> is the value of \n# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file \n# provided by doxygen. Whatever the program writes to standard output \n# is used as the file version. See the manual for examples.\n\nFILE_VERSION_FILTER    = \n\n#---------------------------------------------------------------------------\n# configuration options related to warning and progress messages\n#---------------------------------------------------------------------------\n\n# The QUIET tag can be used to turn on/off the messages that are generated \n# by doxygen. Possible values are YES and NO. If left blank NO is used.\n\nQUIET                  = YES\n\n# The WARNINGS tag can be used to turn on/off the warning messages that are \n# generated by doxygen. Possible values are YES and NO. If left blank \n# NO is used.\n\nWARNINGS               = YES\n\n# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings \n# for undocumented members. If EXTRACT_ALL is set to YES then this flag will \n# automatically be disabled.\n\nWARN_IF_UNDOCUMENTED   = YES\n\n# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for \n# potential errors in the documentation, such as not documenting some \n# parameters in a documented function, or documenting parameters that \n# don't exist or using markup commands wrongly.\n\nWARN_IF_DOC_ERROR      = YES\n\n# This WARN_NO_PARAMDOC option can be abled to get warnings for \n# functions that are documented, but have no documentation for their parameters \n# or return value. If set to NO (the default) doxygen will only warn about \n# wrong or incomplete parameter documentation, but not about the absence of \n# documentation.\n\nWARN_NO_PARAMDOC       = NO\n\n# The WARN_FORMAT tag determines the format of the warning messages that \n# doxygen can produce. The string should contain the $file, $line, and $text \n# tags, which will be replaced by the file and line number from which the \n# warning originated and the warning text. Optionally the format may contain \n# $version, which will be replaced by the version of the file (if it could \n# be obtained via FILE_VERSION_FILTER)\n\nWARN_FORMAT            = \"$file:$line: $text\"\n\n# The WARN_LOGFILE tag can be used to specify a file to which warning \n\n# and error messages should be written. If left blank the output is written \n# to stderr.\n\nWARN_LOGFILE           = \n\n#---------------------------------------------------------------------------\n# configuration options related to the input files\n#---------------------------------------------------------------------------\n\n# The INPUT tag can be used to specify the files and/or directories that contain \n# documented source files. You may enter file names like \"myfile.cpp\" or \n# directories like \"/usr/src/myproject\". Separate the files or directories \n# with spaces.\n\nINPUT                  =  ../src/yajl ../src/api\n\n# This tag can be used to specify the character encoding of the source files that \n# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default \n# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. \n# See http://www.gnu.org/software/libiconv for the list of possible encodings.\n\nINPUT_ENCODING         = UTF-8\n\n# If the value of the INPUT tag contains directories, you can use the \n# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp \n# and *.h) to filter out the source-files in the directories. If left \n# blank the following patterns are tested: \n# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx \n# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py\n\nFILE_PATTERNS          = *.h\n\n# The RECURSIVE tag can be used to turn specify whether or not subdirectories \n# should be searched for input files as well. Possible values are YES and NO. \n# If left blank NO is used.\n\nRECURSIVE              = NO\n\n# The EXCLUDE tag can be used to specify files and/or directories that should \n# excluded from the INPUT source files. This way you can easily exclude a \n# subdirectory from a directory tree whose root is specified with the INPUT tag.\n\nEXCLUDE                = \n\n# The EXCLUDE_SYMLINKS tag can be used select whether or not files or \n# directories that are symbolic links (a Unix filesystem feature) are excluded \n# from the input.\n\nEXCLUDE_SYMLINKS       = NO\n\n# If the value of the INPUT tag contains directories, you can use the \n# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude \n# certain files from those directories. Note that the wildcards are matched \n# against the file with absolute path, so to exclude all test directories \n# for example use the pattern */test/*\n\nEXCLUDE_PATTERNS       = \n\n# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names \n# (namespaces, classes, functions, etc.) that should be excluded from the output. \n# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, \n# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test\n\nEXCLUDE_SYMBOLS        = \n\n# The EXAMPLE_PATH tag can be used to specify one or more files or \n# directories that contain example code fragments that are included (see \n# the \\include command).\n\nEXAMPLE_PATH           = ..\n\n# If the value of the EXAMPLE_PATH tag contains directories, you can use the \n# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp \n# and *.h) to filter out the source-files in the directories. If left \n# blank all files are included.\n\nEXAMPLE_PATTERNS       = \n\n# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be \n# searched for input files to be used with the \\include or \\dontinclude \n# commands irrespective of the value of the RECURSIVE tag. \n# Possible values are YES and NO. If left blank NO is used.\n\nEXAMPLE_RECURSIVE      = NO\n\n# The IMAGE_PATH tag can be used to specify one or more files or \n# directories that contain image that are included in the documentation (see \n# the \\image command).\n\nIMAGE_PATH             = \n\n# The INPUT_FILTER tag can be used to specify a program that doxygen should \n# invoke to filter for each input file. Doxygen will invoke the filter program \n# by executing (via popen()) the command <filter> <input-file>, where <filter> \n# is the value of the INPUT_FILTER tag, and <input-file> is the name of an \n# input file. Doxygen will then use the output that the filter program writes \n# to standard output.  If FILTER_PATTERNS is specified, this tag will be \n# ignored.\n\nINPUT_FILTER           = \n\n# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern \n# basis.  Doxygen will compare the file name with each pattern and apply the \n# filter if there is a match.  The filters are a list of the form: \n# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further \n# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER \n# is applied to all files.\n\nFILTER_PATTERNS        = \n\n# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using \n# INPUT_FILTER) will be used to filter the input files when producing source \n# files to browse (i.e. when SOURCE_BROWSER is set to YES).\n\nFILTER_SOURCE_FILES    = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to source browsing\n#---------------------------------------------------------------------------\n\n# If the SOURCE_BROWSER tag is set to YES then a list of source files will \n# be generated. Documented entities will be cross-referenced with these sources. \n# Note: To get rid of all source code in the generated output, make sure also \n# VERBATIM_HEADERS is set to NO.\n\nSOURCE_BROWSER         = NO\n\n# Setting the INLINE_SOURCES tag to YES will include the body \n# of functions and classes directly in the documentation.\n\nINLINE_SOURCES         = NO\n\n# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct \n# doxygen to hide any special comment blocks from generated source code \n# fragments. Normal C and C++ comments will always remain visible.\n\nSTRIP_CODE_COMMENTS    = YES\n\n# If the REFERENCED_BY_RELATION tag is set to YES (the default) \n# then for each documented function all documented \n# functions referencing it will be listed.\n\nREFERENCED_BY_RELATION = YES\n\n# If the REFERENCES_RELATION tag is set to YES (the default) \n# then for each documented function all documented entities \n# called/used by that function will be listed.\n\nREFERENCES_RELATION    = YES\n\n# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)\n# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from\n# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will\n# link to the source code.  Otherwise they will link to the documentstion.\n\nREFERENCES_LINK_SOURCE = YES\n\n# If the USE_HTAGS tag is set to YES then the references to source code \n# will point to the HTML generated by the htags(1) tool instead of doxygen \n# built-in source browser. The htags tool is part of GNU's global source \n# tagging system (see http://www.gnu.org/software/global/global.html). You \n# will need version 4.8.6 or higher.\n\nUSE_HTAGS              = NO\n\n# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen \n# will generate a verbatim copy of the header file for each class for \n# which an include is specified. Set to NO to disable this.\n\nVERBATIM_HEADERS       = YES\n\n#---------------------------------------------------------------------------\n# configuration options related to the alphabetical class index\n#---------------------------------------------------------------------------\n\n# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index \n# of all compounds will be generated. Enable this if the project \n# contains a lot of classes, structs, unions or interfaces.\n\nALPHABETICAL_INDEX     = NO\n\n# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then \n# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns \n# in which this list will be split (can be a number in the range [1..20])\n\nCOLS_IN_ALPHA_INDEX    = 5\n\n# In case all classes in a project start with a common prefix, all \n# classes will be put under the same header in the alphabetical index. \n# The IGNORE_PREFIX tag can be used to specify one or more prefixes that \n# should be ignored while generating the index headers.\n\nIGNORE_PREFIX          = \n\n#---------------------------------------------------------------------------\n# configuration options related to the HTML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_HTML tag is set to YES (the default) Doxygen will \n# generate HTML output.\n\nGENERATE_HTML          = YES\n\n# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `html' will be used as the default path.\n\nHTML_OUTPUT            = doc/yajl-@YAJL_VERSION@\n\n# The HTML_FILE_EXTENSION tag can be used to specify the file extension for \n# each generated HTML page (for example: .htm,.php,.asp). If it is left blank \n# doxygen will generate files with .html extension.\n\nHTML_FILE_EXTENSION    = .html\n\n# The HTML_HEADER tag can be used to specify a personal HTML header for \n# each generated HTML page. If it is left blank doxygen will generate a \n# standard header.\n\nHTML_HEADER            = \n\n# The HTML_FOOTER tag can be used to specify a personal HTML footer for \n# each generated HTML page. If it is left blank doxygen will generate a \n# standard footer.\n\nHTML_FOOTER            = \n\n# The HTML_STYLESHEET tag can be used to specify a user-defined cascading \n# style sheet that is used by each HTML page. It can be used to \n# fine-tune the look of the HTML output. If the tag is left blank doxygen \n# will generate a default style sheet. Note that doxygen will try to copy \n# the style sheet file to the HTML output directory, so don't put your own \n# stylesheet in the HTML output directory as well, or it will be erased!\n\nHTML_STYLESHEET        = \n\n# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, \n# files or namespaces will be aligned in HTML using tables. If set to \n# NO a bullet list will be used.\n\nHTML_ALIGN_MEMBERS     = YES\n\n# If the GENERATE_HTMLHELP tag is set to YES, additional index files \n# will be generated that can be used as input for tools like the \n# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) \n# of the generated HTML documentation.\n\nGENERATE_HTMLHELP      = NO\n\n# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can \n# be used to specify the file name of the resulting .chm file. You \n# can add a path in front of the file if the result should not be \n# written to the html output directory.\n\nCHM_FILE               = \n\n# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can \n# be used to specify the location (absolute path including file name) of \n# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run \n# the HTML help compiler on the generated index.hhp.\n\nHHC_LOCATION           = \n\n# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag \n# controls if a separate .chi index file is generated (YES) or that \n# it should be included in the master .chm file (NO).\n\nGENERATE_CHI           = NO\n\n# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag \n# controls whether a binary table of contents is generated (YES) or a \n# normal table of contents (NO) in the .chm file.\n\nBINARY_TOC             = NO\n\n# The TOC_EXPAND flag can be set to YES to add extra items for group members \n# to the contents of the HTML help documentation and to the tree view.\n\nTOC_EXPAND             = NO\n\n# The DISABLE_INDEX tag can be used to turn on/off the condensed index at \n# top of each HTML page. The value NO (the default) enables the index and \n# the value YES disables it.\n\nDISABLE_INDEX          = NO\n\n# This tag can be used to set the number of enum values (range [1..20]) \n# that doxygen will group on one line in the generated HTML documentation.\n\nENUM_VALUES_PER_LINE   = 4\n\n# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be\n# generated containing a tree-like index structure (just like the one that \n# is generated for HTML Help). For this to work a browser that supports \n# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, \n# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are \n# probably better off using the HTML help feature.\n\nGENERATE_TREEVIEW      = NO\n\n# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be \n# used to set the initial width (in pixels) of the frame in which the tree \n# is shown.\n\nTREEVIEW_WIDTH         = 250\n\n#---------------------------------------------------------------------------\n# configuration options related to the LaTeX output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will \n# generate Latex output.\n\nGENERATE_LATEX         = NO\n\n# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `latex' will be used as the default path.\n\nLATEX_OUTPUT           = latex\n\n# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be \n# invoked. If left blank `latex' will be used as the default command name.\n\nLATEX_CMD_NAME         = latex\n\n# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to \n# generate index for LaTeX. If left blank `makeindex' will be used as the \n# default command name.\n\nMAKEINDEX_CMD_NAME     = makeindex\n\n# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact \n# LaTeX documents. This may be useful for small projects and may help to \n# save some trees in general.\n\nCOMPACT_LATEX          = NO\n\n# The PAPER_TYPE tag can be used to set the paper type that is used \n# by the printer. Possible values are: a4, a4wide, letter, legal and \n# executive. If left blank a4wide will be used.\n\nPAPER_TYPE             = a4wide\n\n# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX \n# packages that should be included in the LaTeX output.\n\nEXTRA_PACKAGES         = \n\n# The LATEX_HEADER tag can be used to specify a personal LaTeX header for \n# the generated latex document. The header should contain everything until \n# the first chapter. If it is left blank doxygen will generate a \n# standard header. Notice: only use this tag if you know what you are doing!\n\nLATEX_HEADER           = \n\n# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated \n# is prepared for conversion to pdf (using ps2pdf). The pdf file will \n# contain links (just like the HTML output) instead of page references \n# This makes the output suitable for online browsing using a pdf viewer.\n\nPDF_HYPERLINKS         = NO\n\n# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of \n# plain latex in the generated Makefile. Set this option to YES to get a \n# higher quality PDF documentation.\n\nUSE_PDFLATEX           = NO\n\n# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\\\batchmode. \n# command to the generated LaTeX files. This will instruct LaTeX to keep \n# running if errors occur, instead of asking the user for help. \n# This option is also used when generating formulas in HTML.\n\nLATEX_BATCHMODE        = NO\n\n# If LATEX_HIDE_INDICES is set to YES then doxygen will not \n# include the index chapters (such as File Index, Compound Index, etc.) \n# in the output.\n\nLATEX_HIDE_INDICES     = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to the RTF output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output \n# The RTF output is optimized for Word 97 and may not look very pretty with \n# other RTF readers or editors.\n\nGENERATE_RTF           = NO\n\n# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `rtf' will be used as the default path.\n\nRTF_OUTPUT             = rtf\n\n# If the COMPACT_RTF tag is set to YES Doxygen generates more compact \n# RTF documents. This may be useful for small projects and may help to \n# save some trees in general.\n\nCOMPACT_RTF            = NO\n\n# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated \n# will contain hyperlink fields. The RTF file will \n# contain links (just like the HTML output) instead of page references. \n# This makes the output suitable for online browsing using WORD or other \n# programs which support those fields. \n# Note: wordpad (write) and others do not support links.\n\nRTF_HYPERLINKS         = NO\n\n# Load stylesheet definitions from file. Syntax is similar to doxygen's \n# config file, i.e. a series of assignments. You only have to provide \n# replacements, missing definitions are set to their default value.\n\nRTF_STYLESHEET_FILE    = \n\n# Set optional variables used in the generation of an rtf document. \n# Syntax is similar to doxygen's config file.\n\nRTF_EXTENSIONS_FILE    = \n\n#---------------------------------------------------------------------------\n# configuration options related to the man page output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_MAN tag is set to YES (the default) Doxygen will \n# generate man pages\n\nGENERATE_MAN           = YES\n\n# The MAN_OUTPUT tag is used to specify where the man pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `man' will be used as the default path.\n\nMAN_OUTPUT             = man\n\n# The MAN_EXTENSION tag determines the extension that is added to \n# the generated man pages (default is the subroutine's section .3)\n\nMAN_EXTENSION          = .3\n\n# If the MAN_LINKS tag is set to YES and Doxygen generates man output, \n# then it will generate one additional man file for each entity \n# documented in the real man page(s). These additional files \n# only source the real man page, but without them the man command \n# would be unable to find the correct page. The default is NO.\n\nMAN_LINKS              = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to the XML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_XML tag is set to YES Doxygen will \n# generate an XML file that captures the structure of \n# the code including all documentation.\n\nGENERATE_XML           = NO\n\n# The XML_OUTPUT tag is used to specify where the XML pages will be put. \n# If a relative path is entered the value of OUTPUT_DIRECTORY will be \n# put in front of it. If left blank `xml' will be used as the default path.\n\nXML_OUTPUT             = xml\n\n# The XML_SCHEMA tag can be used to specify an XML schema, \n# which can be used by a validating XML parser to check the \n# syntax of the XML files.\n\nXML_SCHEMA             = \n\n# The XML_DTD tag can be used to specify an XML DTD, \n# which can be used by a validating XML parser to check the \n# syntax of the XML files.\n\nXML_DTD                = \n\n# If the XML_PROGRAMLISTING tag is set to YES Doxygen will \n# dump the program listings (including syntax highlighting \n# and cross-referencing information) to the XML output. Note that \n# enabling this will significantly increase the size of the XML output.\n\nXML_PROGRAMLISTING     = YES\n\n#---------------------------------------------------------------------------\n# configuration options for the AutoGen Definitions output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will \n# generate an AutoGen Definitions (see autogen.sf.net) file \n# that captures the structure of the code including all \n# documentation. Note that this feature is still experimental \n# and incomplete at the moment.\n\nGENERATE_AUTOGEN_DEF   = NO\n\n#---------------------------------------------------------------------------\n# configuration options related to the Perl module output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_PERLMOD tag is set to YES Doxygen will \n# generate a Perl module file that captures the structure of \n# the code including all documentation. Note that this \n# feature is still experimental and incomplete at the \n# moment.\n\nGENERATE_PERLMOD       = NO\n\n# If the PERLMOD_LATEX tag is set to YES Doxygen will generate \n# the necessary Makefile rules, Perl scripts and LaTeX code to be able \n# to generate PDF and DVI output from the Perl module output.\n\nPERLMOD_LATEX          = NO\n\n# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be \n# nicely formatted so it can be parsed by a human reader.  This is useful \n# if you want to understand what is going on.  On the other hand, if this \n# tag is set to NO the size of the Perl module output will be much smaller \n# and Perl will parse it just the same.\n\nPERLMOD_PRETTY         = YES\n\n# The names of the make variables in the generated doxyrules.make file \n# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. \n# This is useful so different doxyrules.make files included by the same \n# Makefile don't overwrite each other's variables.\n\nPERLMOD_MAKEVAR_PREFIX = \n\n#---------------------------------------------------------------------------\n# Configuration options related to the preprocessor   \n#---------------------------------------------------------------------------\n\n# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will \n# evaluate all C-preprocessor directives found in the sources and include \n# files.\n\nENABLE_PREPROCESSING   = YES\n\n# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro \n# names in the source code. If set to NO (the default) only conditional \n# compilation will be performed. Macro expansion can be done in a controlled \n# way by setting EXPAND_ONLY_PREDEF to YES.\n\nMACRO_EXPANSION        = YES\n\n# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES \n# then the macro expansion is limited to the macros specified with the \n# PREDEFINED and EXPAND_AS_DEFINED tags.\n\nEXPAND_ONLY_PREDEF     = NO\n\n# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files \n# in the INCLUDE_PATH (see below) will be search if a #include is found.\n\nSEARCH_INCLUDES        = YES\n\n# The INCLUDE_PATH tag can be used to specify one or more directories that \n# contain include files that are not input files but should be processed by \n# the preprocessor.\n\nINCLUDE_PATH           = \n\n# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard \n# patterns (like *.h and *.hpp) to filter out the header-files in the \n# directories. If left blank, the patterns specified with FILE_PATTERNS will \n# be used.\n\nINCLUDE_FILE_PATTERNS  = \n\n# The PREDEFINED tag can be used to specify one or more macro names that \n# are defined before the preprocessor is started (similar to the -D option of \n# gcc). The argument of the tag is a list of macros of the form: name \n# or name=definition (no spaces). If the definition and the = are \n# omitted =1 is assumed. To prevent a macro definition from being \n# undefined via #undef or recursively expanded use the := operator \n# instead of the = operator.\n\nPREDEFINED             = \n\n# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then \n# this tag can be used to specify a list of macro names that should be expanded. \n# The macro definition that is found in the sources will be used. \n# Use the PREDEFINED tag if you want to use a different macro definition.\n\nEXPAND_AS_DEFINED      = \n\n# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then \n# doxygen's preprocessor will remove all function-like macros that are alone \n# on a line, have an all uppercase name, and do not end with a semicolon. Such \n# function macros are typically used for boiler-plate code, and will confuse \n# the parser if not removed.\n\nSKIP_FUNCTION_MACROS   = YES\n\n#---------------------------------------------------------------------------\n# Configuration::additions related to external references   \n#---------------------------------------------------------------------------\n\n# The TAGFILES option can be used to specify one or more tagfiles. \n# Optionally an initial location of the external documentation \n# can be added for each tagfile. The format of a tag file without \n# this location is as follows: \n#   TAGFILES = file1 file2 ... \n# Adding location for the tag files is done as follows: \n#   TAGFILES = file1=loc1 \"file2 = loc2\" ... \n# where \"loc1\" and \"loc2\" can be relative or absolute paths or \n# URLs. If a location is present for each tag, the installdox tool \n# does not have to be run to correct the links.\n# Note that each tag file must have a unique name\n# (where the name does NOT include the path)\n# If a tag file is not located in the directory in which doxygen \n# is run, you must also specify the path to the tagfile here.\n\nTAGFILES               = \n\n# When a file name is specified after GENERATE_TAGFILE, doxygen will create \n# a tag file that is based on the input files it reads.\n\nGENERATE_TAGFILE       = \n\n# If the ALLEXTERNALS tag is set to YES all external classes will be listed \n# in the class index. If set to NO only the inherited external classes \n# will be listed.\n\nALLEXTERNALS           = NO\n\n# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed \n# in the modules index. If set to NO, only the current project's groups will \n# be listed.\n\nEXTERNAL_GROUPS        = YES\n\n# The PERL_PATH should be the absolute path and name of the perl script \n# interpreter (i.e. the result of `which perl').\n\nPERL_PATH              = /usr/bin/perl\n\n#---------------------------------------------------------------------------\n# Configuration options related to the dot tool   \n#---------------------------------------------------------------------------\n\n# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will \n# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base \n# or super classes. Setting the tag to NO turns the diagrams off. Note that \n# this option is superseded by the HAVE_DOT option below. This is only a \n# fallback. It is recommended to install and use dot, since it yields more \n# powerful graphs.\n\nCLASS_DIAGRAMS         = YES\n\n# You can define message sequence charts within doxygen comments using the \\msc \n# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to \n# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to \n# specify the directory where the mscgen tool resides. If left empty the tool is assumed to \n# be found in the default search path.\n\nMSCGEN_PATH            = \n\n# If set to YES, the inheritance and collaboration graphs will hide \n# inheritance and usage relations if the target is undocumented \n# or is not a class.\n\nHIDE_UNDOC_RELATIONS   = YES\n\n# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is \n# available from the path. This tool is part of Graphviz, a graph visualization \n# toolkit from AT&T and Lucent Bell Labs. The other options in this section \n# have no effect if this option is set to NO (the default)\n\nHAVE_DOT               = NO\n\n# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for each documented class showing the direct and \n# indirect inheritance relations. Setting this tag to YES will force the \n# the CLASS_DIAGRAMS tag to NO.\n\nCLASS_GRAPH            = YES\n\n# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for each documented class showing the direct and \n# indirect implementation dependencies (inheritance, containment, and \n# class references variables) of the class with other documented classes.\n\nCOLLABORATION_GRAPH    = YES\n\n# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen \n# will generate a graph for groups, showing the direct groups dependencies\n\nGROUP_GRAPHS           = YES\n\n# If the UML_LOOK tag is set to YES doxygen will generate inheritance and \n# collaboration diagrams in a style similar to the OMG's Unified Modeling \n# Language.\n\nUML_LOOK               = NO\n\n# If set to YES, the inheritance and collaboration graphs will show the \n# relations between templates and their instances.\n\nTEMPLATE_RELATIONS     = NO\n\n# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT \n# tags are set to YES then doxygen will generate a graph for each documented \n# file showing the direct and indirect include dependencies of the file with \n# other documented files.\n\nINCLUDE_GRAPH          = YES\n\n# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and \n# HAVE_DOT tags are set to YES then doxygen will generate a graph for each \n# documented header file showing the documented files that directly or \n# indirectly include this file.\n\nINCLUDED_BY_GRAPH      = YES\n\n# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will \n# generate a call dependency graph for every global function or class method. \n# Note that enabling this option will significantly increase the time of a run. \n# So in most cases it will be better to enable call graphs for selected \n# functions only using the \\callgraph command.\n\nCALL_GRAPH             = NO\n\n# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will \n# generate a caller dependency graph for every global function or class method. \n# Note that enabling this option will significantly increase the time of a run. \n# So in most cases it will be better to enable caller graphs for selected \n# functions only using the \\callergraph command.\n\nCALLER_GRAPH           = NO\n\n# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen \n# will graphical hierarchy of all classes instead of a textual one.\n\nGRAPHICAL_HIERARCHY    = YES\n\n# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES \n# then doxygen will show the dependencies a directory has on other directories \n# in a graphical way. The dependency relations are determined by the #include\n# relations between the files in the directories.\n\nDIRECTORY_GRAPH        = YES\n\n# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images \n# generated by dot. Possible values are png, jpg, or gif\n# If left blank png will be used.\n\nDOT_IMAGE_FORMAT       = png\n\n# The tag DOT_PATH can be used to specify the path where the dot tool can be \n# found. If left blank, it is assumed the dot tool can be found in the path.\n\nDOT_PATH               = \n\n# The DOTFILE_DIRS tag can be used to specify one or more directories that \n# contain dot files that are included in the documentation (see the \n# \\dotfile command).\n\nDOTFILE_DIRS           = \n\n# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of \n# nodes that will be shown in the graph. If the number of nodes in a graph \n# becomes larger than this value, doxygen will truncate the graph, which is \n# visualized by representing a node as a red box. Note that doxygen will always \n# show the root nodes and its direct children regardless of this setting.\n\nDOT_GRAPH_MAX_NODES    = 50\n\n# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent \n# background. This is disabled by default, which results in a white background. \n# Warning: Depending on the platform used, enabling this option may lead to \n# badly anti-aliased labels on the edges of a graph (i.e. they become hard to \n# read).\n\nDOT_TRANSPARENT        = NO\n\n# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output \n# files in one run (i.e. multiple -o and -T options on the command line). This \n# makes dot run faster, but since only newer versions of dot (>1.8.10) \n# support this, this feature is disabled by default.\n\nDOT_MULTI_TARGETS      = NO\n\n# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will \n# generate a legend page explaining the meaning of the various boxes and \n# arrows in the dot generated graphs.\n\nGENERATE_LEGEND        = YES\n\n# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will \n# remove the intermediate dot files that are used to generate \n# the various graphs.\n\nDOT_CLEANUP            = YES\n\n#---------------------------------------------------------------------------\n# Configuration::additions related to the search engine   \n#---------------------------------------------------------------------------\n\n# The SEARCHENGINE tag specifies whether or not a search engine should be \n# used. If set to NO the values of all tags below this one will be ignored.\n\nSEARCHENGINE           = NO\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/api/yajl_common.h",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#ifndef __YAJL_COMMON_H__\n#define __YAJL_COMMON_H__\n\n#include <stddef.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif    \n\n#define YAJL_MAX_DEPTH 128\n\n/* msft dll export gunk.  To build a DLL on windows, you\n * must define WIN32, YAJL_SHARED, and YAJL_BUILD.  To use a shared\n * DLL, you must define YAJL_SHARED and WIN32 */\n#if defined(WIN32) && defined(YAJL_SHARED)\n#  ifdef YAJL_BUILD\n#    define YAJL_API __declspec(dllexport)\n#  else\n#    define YAJL_API __declspec(dllimport)\n#  endif\n#else\n#  if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303\n#    define YAJL_API __attribute__ ((visibility(\"default\")))\n#  else\n#    define YAJL_API\n#  endif\n#endif \n\n/** pointer to a malloc function, supporting client overriding memory\n *  allocation routines */\ntypedef void * (*yajl_malloc_func)(void *ctx, size_t sz);\n\n/** pointer to a free function, supporting client overriding memory\n *  allocation routines */\ntypedef void (*yajl_free_func)(void *ctx, void * ptr);\n\n/** pointer to a realloc function which can resize an allocation. */\ntypedef void * (*yajl_realloc_func)(void *ctx, void * ptr, size_t sz);\n\n/** A structure which can be passed to yajl_*_alloc routines to allow the\n *  client to specify memory allocation functions to be used. */\ntypedef struct\n{\n    /** pointer to a function that can allocate uninitialized memory */\n    yajl_malloc_func malloc;\n    /** pointer to a function that can resize memory allocations */\n    yajl_realloc_func realloc;\n    /** pointer to a function that can free memory allocated using\n     *  reallocFunction or mallocFunction */\n    yajl_free_func free;\n    /** a context pointer that will be passed to above allocation routines */\n    void * ctx;\n} yajl_alloc_funcs;\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/api/yajl_gen.h",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * \\file yajl_gen.h\n * Interface to YAJL's JSON generation facilities.\n */\n\n#include <yajl/yajl_common.h>\n\n#ifndef __YAJL_GEN_H__\n#define __YAJL_GEN_H__\n\n#include <stddef.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n    /** generator status codes */\n    typedef enum {\n        /** no error */\n        yajl_gen_status_ok = 0,\n        /** at a point where a map key is generated, a function other than\n         *  yajl_gen_string was called */\n        yajl_gen_keys_must_be_strings,\n        /** YAJL's maximum generation depth was exceeded.  see\n         *  YAJL_MAX_DEPTH */\n        yajl_max_depth_exceeded,\n        /** A generator function (yajl_gen_XXX) was called while in an error\n         *  state */\n        yajl_gen_in_error_state,\n        /** A complete JSON document has been generated */\n        yajl_gen_generation_complete,                \n        /** yajl_gen_double was passed an invalid floating point value\n         *  (infinity or NaN). */\n        yajl_gen_invalid_number,\n        /** A print callback was passed in, so there is no internal\n         * buffer to get from */\n        yajl_gen_no_buf,\n        /** returned from yajl_gen_string() when the yajl_gen_validate_utf8\n         *  option is enabled and an invalid was passed by client code.\n         */\n        yajl_gen_invalid_string\n    } yajl_gen_status;\n\n    /** an opaque handle to a generator */\n    typedef struct yajl_gen_t * yajl_gen;\n\n    /** a callback used for \"printing\" the results. */\n    typedef void (*yajl_print_t)(void * ctx,\n                                 const char * str,\n                                 size_t len);\n\n    /** configuration parameters for the parser, these may be passed to\n     *  yajl_gen_config() along with option specific argument(s).  In general,\n     *  all configuration parameters default to *off*. */\n    typedef enum {\n        /** generate indented (beautiful) output */\n        yajl_gen_beautify = 0x01,\n        /**\n         * Set an indent string which is used when yajl_gen_beautify\n         * is enabled.  Maybe something like \\\\t or some number of\n         * spaces.  The default is four spaces ' '.\n         */\n        yajl_gen_indent_string = 0x02,\n        /**\n         * Set a function and context argument that should be used to\n         * output generated json.  the function should conform to the\n         * yajl_print_t prototype while the context argument is a\n         * void * of your choosing.\n         *\n         * example:\n         *   yajl_gen_config(g, yajl_gen_print_callback, myFunc, myVoidPtr);\n         */\n        yajl_gen_print_callback = 0x04,\n        /**\n         * Normally the generator does not validate that strings you\n         * pass to it via yajl_gen_string() are valid UTF8.  Enabling\n         * this option will cause it to do so.\n         */\n        yajl_gen_validate_utf8 = 0x08,\n        /**\n         * the forward solidus (slash or '/' in human) is not required to be\n         * escaped in json text.  By default, YAJL will not escape it in the\n         * iterest of saving bytes.  Setting this flag will cause YAJL to\n         * always escape '/' in generated JSON strings.\n         */\n        yajl_gen_escape_solidus = 0x10\n    } yajl_gen_option;\n\n    /** allow the modification of generator options subsequent to handle\n     *  allocation (via yajl_alloc)\n     *  \\returns zero in case of errors, non-zero otherwise\n     */\n    YAJL_API int yajl_gen_config(yajl_gen g, yajl_gen_option opt, ...);\n\n    /** allocate a generator handle\n     *  \\param allocFuncs an optional pointer to a structure which allows\n     *                    the client to overide the memory allocation\n     *                    used by yajl.  May be NULL, in which case\n     *                    malloc/free/realloc will be used.\n     *\n     *  \\returns an allocated handle on success, NULL on failure (bad params)\n     */\n    YAJL_API yajl_gen yajl_gen_alloc(const yajl_alloc_funcs * allocFuncs);\n\n    /** free a generator handle */\n    YAJL_API void yajl_gen_free(yajl_gen handle);\n\n    YAJL_API yajl_gen_status yajl_gen_integer(yajl_gen hand, long long int number);\n    /** generate a floating point number.  number may not be infinity or\n     *  NaN, as these have no representation in JSON.  In these cases the\n     *  generator will return 'yajl_gen_invalid_number' */\n    YAJL_API yajl_gen_status yajl_gen_double(yajl_gen hand, double number);\n    YAJL_API yajl_gen_status yajl_gen_number(yajl_gen hand,\n                                             const char * num,\n                                             size_t len);\n    YAJL_API yajl_gen_status yajl_gen_string(yajl_gen hand,\n                                             const unsigned char * str,\n                                             size_t len);\n    YAJL_API yajl_gen_status yajl_gen_null(yajl_gen hand);\n    YAJL_API yajl_gen_status yajl_gen_bool(yajl_gen hand, int boolean);\n    YAJL_API yajl_gen_status yajl_gen_map_open(yajl_gen hand);\n    YAJL_API yajl_gen_status yajl_gen_map_close(yajl_gen hand);\n    YAJL_API yajl_gen_status yajl_gen_array_open(yajl_gen hand);\n    YAJL_API yajl_gen_status yajl_gen_array_close(yajl_gen hand);\n\n    /** access the null terminated generator buffer.  If incrementally\n     *  outputing JSON, one should call yajl_gen_clear to clear the\n     *  buffer.  This allows stream generation. */\n    YAJL_API yajl_gen_status yajl_gen_get_buf(yajl_gen hand,\n                                              const unsigned char ** buf,\n                                              size_t * len);\n\n    /** clear yajl's output buffer, but maintain all internal generation\n     *  state.  This function will not \"reset\" the generator state, and is\n     *  intended to enable incremental JSON outputing. */\n    YAJL_API void yajl_gen_clear(yajl_gen hand);\n\n#ifdef __cplusplus\n}\n#endif    \n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/api/yajl_parse.h",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * \\file yajl_parse.h\n * Interface to YAJL's JSON stream parsing facilities.\n */\n\n#include <yajl/yajl_common.h>\n\n#ifndef __YAJL_PARSE_H__\n#define __YAJL_PARSE_H__\n\n#include <stddef.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n    /** error codes returned from this interface */\n    typedef enum {\n        /** no error was encountered */\n        yajl_status_ok,\n        /** a client callback returned zero, stopping the parse */\n        yajl_status_client_canceled,\n        /** An error occured during the parse.  Call yajl_get_error for\n         *  more information about the encountered error */\n        yajl_status_error\n    } yajl_status;\n\n    /** attain a human readable, english, string for an error */\n    YAJL_API const char * yajl_status_to_string(yajl_status code);\n\n    /** an opaque handle to a parser */\n    typedef struct yajl_handle_t * yajl_handle;\n\n    /** yajl is an event driven parser.  this means as json elements are\n     *  parsed, you are called back to do something with the data.  The\n     *  functions in this table indicate the various events for which\n     *  you will be called back.  Each callback accepts a \"context\"\n     *  pointer, this is a void * that is passed into the yajl_parse\n     *  function which the client code may use to pass around context.\n     *\n     *  All callbacks return an integer.  If non-zero, the parse will\n     *  continue.  If zero, the parse will be canceled and\n     *  yajl_status_client_canceled will be returned from the parse.\n     *\n     *  \\attention {\n     *    A note about the handling of numbers:\n     *\n     *    yajl will only convert numbers that can be represented in a\n     *    double or a 64 bit (long long) int.  All other numbers will\n     *    be passed to the client in string form using the yajl_number\n     *    callback.  Furthermore, if yajl_number is not NULL, it will\n     *    always be used to return numbers, that is yajl_integer and\n     *    yajl_double will be ignored.  If yajl_number is NULL but one\n     *    of yajl_integer or yajl_double are defined, parsing of a\n     *    number larger than is representable in a double or 64 bit\n     *    integer will result in a parse error.\n     *  }\n     */\n    typedef struct {\n        int (* yajl_null)(void * ctx);\n        int (* yajl_boolean)(void * ctx, int boolVal);\n        int (* yajl_integer)(void * ctx, long long integerVal);\n        int (* yajl_double)(void * ctx, double doubleVal);\n        /** A callback which passes the string representation of the number\n         *  back to the client.  Will be used for all numbers when present */\n        int (* yajl_number)(void * ctx, const char * numberVal,\n                            size_t numberLen);\n\n        /** strings are returned as pointers into the JSON text when,\n         * possible, as a result, they are _not_ null padded */\n        int (* yajl_string)(void * ctx, const unsigned char * stringVal,\n                            size_t stringLen);\n\n        int (* yajl_start_map)(void * ctx);\n        int (* yajl_map_key)(void * ctx, const unsigned char * key,\n                             size_t stringLen);\n        int (* yajl_end_map)(void * ctx);\n\n        int (* yajl_start_array)(void * ctx);\n        int (* yajl_end_array)(void * ctx);\n    } yajl_callbacks;\n\n    /** allocate a parser handle\n     *  \\param callbacks  a yajl callbacks structure specifying the\n     *                    functions to call when different JSON entities\n     *                    are encountered in the input text.  May be NULL,\n     *                    which is only useful for validation.\n     *  \\param afs        memory allocation functions, may be NULL for to use\n     *                    C runtime library routines (malloc and friends) \n     *  \\param ctx        a context pointer that will be passed to callbacks.\n     */\n    YAJL_API yajl_handle yajl_alloc(const yajl_callbacks * callbacks,\n                                    yajl_alloc_funcs * afs,\n                                    void * ctx);\n\n\n    /** configuration parameters for the parser, these may be passed to\n     *  yajl_config() along with option specific argument(s).  In general,\n     *  all configuration parameters default to *off*. */\n    typedef enum {\n        /** Ignore javascript style comments present in\n         *  JSON input.  Non-standard, but rather fun\n         *  arguments: toggled off with integer zero, on otherwise.\n         *\n         *  example:\n         *    yajl_config(h, yajl_allow_comments, 1); // turn comment support on\n         */\n        yajl_allow_comments = 0x01,\n        /**\n         * When set the parser will verify that all strings in JSON input are\n         * valid UTF8 and will emit a parse error if this is not so.  When set,\n         * this option makes parsing slightly more expensive (~7% depending\n         * on processor and compiler in use)\n         *\n         * example:\n         *   yajl_config(h, yajl_dont_validate_strings, 1); // disable utf8 checking\n         */\n        yajl_dont_validate_strings     = 0x02,\n        /**\n         * By default, upon calls to yajl_complete_parse(), yajl will\n         * ensure the entire input text was consumed and will raise an error\n         * otherwise.  Enabling this flag will cause yajl to disable this\n         * check.  This can be useful when parsing json out of a that contains more\n         * than a single JSON document.\n         */\n        yajl_allow_trailing_garbage = 0x04,\n        /**\n         * Allow multiple values to be parsed by a single handle.  The\n         * entire text must be valid JSON, and values can be seperated\n         * by any kind of whitespace.  This flag will change the\n         * behavior of the parser, and cause it continue parsing after\n         * a value is parsed, rather than transitioning into a\n         * complete state.  This option can be useful when parsing multiple\n         * values from an input stream.\n         */\n        yajl_allow_multiple_values = 0x08,\n        /**\n         * When yajl_complete_parse() is called the parser will\n         * check that the top level value was completely consumed.  I.E.,\n         * if called whilst in the middle of parsing a value\n         * yajl will enter an error state (premature EOF).  Setting this\n         * flag suppresses that check and the corresponding error.\n         */\n        yajl_allow_partial_values = 0x10\n    } yajl_option;\n\n    /** allow the modification of parser options subsequent to handle\n     *  allocation (via yajl_alloc)\n     *  \\returns zero in case of errors, non-zero otherwise\n     */\n    YAJL_API int yajl_config(yajl_handle h, yajl_option opt, ...);\n\n    /** free a parser handle */\n    YAJL_API void yajl_free(yajl_handle handle);\n\n    /** Parse some json!\n     *  \\param hand - a handle to the json parser allocated with yajl_alloc\n     *  \\param jsonText - a pointer to the UTF8 json text to be parsed\n     *  \\param jsonTextLength - the length, in bytes, of input text\n     */\n    YAJL_API yajl_status yajl_parse(yajl_handle hand,\n                                    const unsigned char * jsonText,\n                                    size_t jsonTextLength);\n\n    /** Parse any remaining buffered json.\n     *  Since yajl is a stream-based parser, without an explicit end of\n     *  input, yajl sometimes can't decide if content at the end of the\n     *  stream is valid or not.  For example, if \"1\" has been fed in,\n     *  yajl can't know whether another digit is next or some character\n     *  that would terminate the integer token.\n     *\n     *  \\param hand - a handle to the json parser allocated with yajl_alloc\n     */\n    YAJL_API yajl_status yajl_complete_parse(yajl_handle hand);\n\n    /** get an error string describing the state of the\n     *  parse.\n     *\n     *  If verbose is non-zero, the message will include the JSON\n     *  text where the error occured, along with an arrow pointing to\n     *  the specific char.\n     *\n     *  \\returns A dynamically allocated string will be returned which should\n     *  be freed with yajl_free_error\n     */\n    YAJL_API unsigned char * yajl_get_error(yajl_handle hand, int verbose,\n                                            const unsigned char * jsonText,\n                                            size_t jsonTextLength);\n\n    /**\n     * get the amount of data consumed from the last chunk passed to YAJL.\n     *\n     * In the case of a successful parse this can help you understand if\n     * the entire buffer was consumed (which will allow you to handle\n     * \"junk at end of input\").\n     *\n     * In the event an error is encountered during parsing, this function\n     * affords the client a way to get the offset into the most recent\n     * chunk where the error occured.  0 will be returned if no error\n     * was encountered.\n     */\n    YAJL_API size_t yajl_get_bytes_consumed(yajl_handle hand);\n\n    /** free an error returned from yajl_get_error */\n    YAJL_API void yajl_free_error(yajl_handle hand, unsigned char * str);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/api/yajl_tree.h",
    "content": "/*\n * Copyright (c) 2010-2011  Florian Forster  <ff at octo.it>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * \\file yajl_tree.h\n *\n * Parses JSON data and returns the data in tree form.\n *\n * \\author Florian Forster\n * \\date August 2010\n *\n * This interface makes quick parsing and extraction of\n * smallish JSON docs trivial:\n *\n * \\include example/parse_config.c\n */\n\n#ifndef YAJL_TREE_H\n#define YAJL_TREE_H 1\n\n#include <yajl/yajl_common.h>\n\n/** possible data types that a yajl_val_s can hold */\ntypedef enum {\n    yajl_t_string = 1,\n    yajl_t_number = 2,\n    yajl_t_object = 3,\n    yajl_t_array = 4,\n    yajl_t_true = 5,\n    yajl_t_false = 6,\n    yajl_t_null = 7,\n    /** The any type isn't valid for yajl_val_s.type, but can be\n     *  used as an argument to routines like yajl_tree_get().\n     */\n    yajl_t_any = 8\n} yajl_type;\n\n#define YAJL_NUMBER_INT_VALID    0x01\n#define YAJL_NUMBER_DOUBLE_VALID 0x02\n\n/** A pointer to a node in the parse tree */\ntypedef struct yajl_val_s * yajl_val;\n\n/**\n * A JSON value representation capable of holding one of the seven\n * types above. For \"string\", \"number\", \"object\", and \"array\"\n * additional data is available in the union.  The \"YAJL_IS_*\"\n * and \"YAJL_GET_*\" macros below allow type checking and convenient\n * value extraction.\n */\nstruct yajl_val_s\n{\n    /** Type of the value contained. Use the \"YAJL_IS_*\" macors to check for a\n     * specific type. */\n    yajl_type type;\n    /** Type-specific data. You may use the \"YAJL_GET_*\" macros to access these\n     * members. */\n    union\n    {\n        char * string;\n        struct {\n            long long i; /*< integer value, if representable. */\n            double  d;   /*< double value, if representable. */\n            /** Signals whether the \\em i and \\em d members are\n             * valid. See \\c YAJL_NUMBER_INT_VALID and\n             * \\c YAJL_NUMBER_DOUBLE_VALID. */\n            char   *r;   /*< unparsed number in string form. */\n            unsigned int flags;\n        } number;\n        struct {\n            const char **keys; /*< Array of keys */\n            yajl_val *values; /*< Array of values. */\n            size_t len; /*< Number of key-value-pairs. */\n        } object;\n        struct {\n            yajl_val *values; /*< Array of elements. */\n            size_t len; /*< Number of elements. */\n        } array;\n    } u;\n};\n\n/**\n * Parse a string.\n *\n * Parses an null-terminated string containing JSON data and returns a pointer\n * to the top-level value (root of the parse tree).\n *\n * \\param input              Pointer to a null-terminated utf8 string containing\n *                           JSON data.\n * \\param error_buffer       Pointer to a buffer in which an error message will\n *                           be stored if \\em yajl_tree_parse fails, or\n *                           \\c NULL. The buffer will be initialized before\n *                           parsing, so its content will be destroyed even if\n *                           \\em yajl_tree_parse succeeds.\n * \\param error_buffer_size  Size of the memory area pointed to by\n *                           \\em error_buffer_size. If \\em error_buffer_size is\n *                           \\c NULL, this argument is ignored.\n *\n * \\returns Pointer to the top-level value or \\c NULL on error. The memory\n * pointed to must be freed using \\em yajl_tree_free. In case of an error, a\n * null terminated message describing the error in more detail is stored in\n * \\em error_buffer if it is not \\c NULL.\n */\nYAJL_API yajl_val yajl_tree_parse (const char *input,\n                                   char *error_buffer, size_t error_buffer_size);\n\n/**\n * Free a parse tree returned by \"yajl_tree_parse\".\n *\n * \\param v Pointer to a JSON value returned by \"yajl_tree_parse\". Passing NULL\n * is valid and results in a no-op.\n */\nYAJL_API void yajl_tree_free (yajl_val v);\n\n/**\n * Access a nested value inside a tree.\n *\n * \\param parent the node under which you'd like to extract values.\n * \\param path A null terminated array of strings, each the name of an object key\n * \\param type the yajl_type of the object you seek, or yajl_t_any if any will do.\n *\n * \\returns a pointer to the found value, or NULL if we came up empty.\n * \n * Future Ideas:  it'd be nice to move path to a string and implement support for\n * a teeny tiny micro language here, so you can extract array elements, do things\n * like .first and .last, even .length.  Inspiration from JSONPath and css selectors?\n * No it wouldn't be fast, but that's not what this API is about.\n */\nYAJL_API yajl_val yajl_tree_get(yajl_val parent, const char ** path, yajl_type type);\n\n/* Various convenience macros to check the type of a `yajl_val` */\n#define YAJL_IS_STRING(v) (((v) != NULL) && ((v)->type == yajl_t_string))\n#define YAJL_IS_NUMBER(v) (((v) != NULL) && ((v)->type == yajl_t_number))\n#define YAJL_IS_INTEGER(v) (YAJL_IS_NUMBER(v) && ((v)->u.flags & YAJL_NUMBER_INT_VALID))\n#define YAJL_IS_DOUBLE(v) (YAJL_IS_NUMBER(v) && ((v)->u.flags & YAJL_NUMBER_DOUBLE_VALID))\n#define YAJL_IS_OBJECT(v) (((v) != NULL) && ((v)->type == yajl_t_object))\n#define YAJL_IS_ARRAY(v)  (((v) != NULL) && ((v)->type == yajl_t_array ))\n#define YAJL_IS_TRUE(v)   (((v) != NULL) && ((v)->type == yajl_t_true  ))\n#define YAJL_IS_FALSE(v)  (((v) != NULL) && ((v)->type == yajl_t_false ))\n#define YAJL_IS_NULL(v)   (((v) != NULL) && ((v)->type == yajl_t_null  ))\n\n/** Given a yajl_val_string return a ptr to the bare string it contains,\n *  or NULL if the value is not a string. */\n#define YAJL_GET_STRING(v) (YAJL_IS_STRING(v) ? (v)->u.string : NULL)\n\n/** Get the string representation of a number.  You should check type first,\n *  perhaps using YAJL_IS_NUMBER */\n#define YAJL_GET_NUMBER(v) ((v)->u.number.r)\n\n/** Get the double representation of a number.  You should check type first,\n *  perhaps using YAJL_IS_DOUBLE */\n#define YAJL_GET_DOUBLE(v) ((v)->u.number.d)\n\n/** Get the 64bit (long long) integer representation of a number.  You should\n *  check type first, perhaps using YAJL_IS_INTEGER */\n#define YAJL_GET_INTEGER(v) ((v)->u.number.i)\n\n/** Get a pointer to a yajl_val_object or NULL if the value is not an object. */\n#define YAJL_GET_OBJECT(v) (YAJL_IS_OBJECT(v) ? &(v)->u.object : NULL)\n\n/** Get a pointer to a yajl_val_array or NULL if the value is not an object. */\n#define YAJL_GET_ARRAY(v)  (YAJL_IS_ARRAY(v)  ? &(v)->u.array  : NULL)\n\n#endif /* YAJL_TREE_H */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/api/yajl_version.h.cmake",
    "content": "#ifndef YAJL_VERSION_H_\n#define YAJL_VERSION_H_\n\n#include <yajl/yajl_common.h>\n\n#define YAJL_MAJOR ${YAJL_MAJOR}\n#define YAJL_MINOR ${YAJL_MINOR}\n#define YAJL_MICRO ${YAJL_MICRO}\n\n#define YAJL_VERSION ((YAJL_MAJOR * 10000) + (YAJL_MINOR * 100) + YAJL_MICRO)\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nextern int YAJL_API yajl_version(void);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* YAJL_VERSION_H_ */\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl",
    "content": "/**\n\\example reformatter/json_reformat.c\n\\example example/parse_config.c\n*/\n\n/*!\n    \\mainpage Yet Another JSON Library (YAJL)\n    \\author Lloyd Hilaiel\n    \\date 2007-2011\n\nYet Another JSON Library (YAJL) is a small event-driven (SAX-style)\nJSON parser written in ANSI C, and a small validating JSON\ngenerator. YAJL is released under the permissive ISC license.\n\n\\section features Features\n\n   -# Stream (incremental) parsing and generation of JSON\n   -# ANSI C\n   -# Human readable error messages with context\n   -# tiny\n   -# event driven\n   -# support for generating \"beautified\" JSON \n   -# includes \nIt also includes a small simplified tree interface for \nsimplified parsing and extraction of data from smallish JSON documents.\n\n\\section usage Usage\n\nSee <a href=\"reformatter_2json_reformat_8c-example.html\">json_reformat.c</a> for a complete example of stream based parsing\nand generation of JSON.  See <a href=\"example_2parse_config_8c-example.html\">parse_config.c</a> for an example of the\nsimplified tree interface.\n\n*/\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl.c",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#include \"api/yajl_parse.h\"\n#include \"yajl_lex.h\"\n#include \"yajl_parser.h\"\n#include \"yajl_alloc.h\"\n\n#include <stdlib.h>\n#include <string.h>\n#include <stdarg.h>\n#include <assert.h>\n\nconst char *\nyajl_status_to_string(yajl_status stat)\n{\n    const char * statStr = \"unknown\";\n    switch (stat) {\n        case yajl_status_ok:\n            statStr = \"ok, no error\";\n            break;\n        case yajl_status_client_canceled:\n            statStr = \"client canceled parse\";\n            break;\n        case yajl_status_error:\n            statStr = \"parse error\";\n            break;\n    }\n    return statStr;\n}\n\nyajl_handle\nyajl_alloc(const yajl_callbacks * callbacks,\n           yajl_alloc_funcs * afs,\n           void * ctx)\n{\n    yajl_handle hand = NULL;\n    yajl_alloc_funcs afsBuffer;\n\n    /* first order of business is to set up memory allocation routines */\n    if (afs != NULL) {\n        if (afs->malloc == NULL || afs->realloc == NULL || afs->free == NULL)\n        {\n            return NULL;\n        }\n    } else {\n        yajl_set_default_alloc_funcs(&afsBuffer);\n        afs = &afsBuffer;\n    }\n\n    hand = (yajl_handle) YA_MALLOC(afs, sizeof(struct yajl_handle_t));\n\n    /* copy in pointers to allocation routines */\n    memcpy((void *) &(hand->alloc), (void *) afs, sizeof(yajl_alloc_funcs));\n\n    hand->callbacks = callbacks;\n    hand->ctx = ctx;\n    hand->lexer = NULL; \n    hand->bytesConsumed = 0;\n    hand->decodeBuf = yajl_buf_alloc(&(hand->alloc));\n    hand->flags\t    = 0;\n    yajl_bs_init(hand->stateStack, &(hand->alloc));\n    yajl_bs_push(hand->stateStack, yajl_state_start);\n\n    return hand;\n}\n\nint\nyajl_config(yajl_handle h, yajl_option opt, ...)\n{\n    int rv = 1;\n    va_list ap;\n    va_start(ap, opt);\n\n    switch(opt) {\n        case yajl_allow_comments:\n        case yajl_dont_validate_strings:\n        case yajl_allow_trailing_garbage:\n        case yajl_allow_multiple_values:\n        case yajl_allow_partial_values:\n            if (va_arg(ap, int)) h->flags |= opt;\n            else h->flags &= ~opt;\n            break;\n        default:\n            rv = 0;\n    }\n    va_end(ap);\n\n    return rv;\n}\n\nvoid\nyajl_free(yajl_handle handle)\n{\n    yajl_bs_free(handle->stateStack);\n    yajl_buf_free(handle->decodeBuf);\n    if (handle->lexer) {\n        yajl_lex_free(handle->lexer);\n        handle->lexer = NULL;\n    }\n    YA_FREE(&(handle->alloc), handle);\n}\n\nyajl_status\nyajl_parse(yajl_handle hand, const unsigned char * jsonText,\n           size_t jsonTextLen)\n{\n    yajl_status status;\n\n    /* lazy allocation of the lexer */\n    if (hand->lexer == NULL) {\n        hand->lexer = yajl_lex_alloc(&(hand->alloc),\n                                     hand->flags & yajl_allow_comments,\n                                     !(hand->flags & yajl_dont_validate_strings));\n    }\n\n    status = yajl_do_parse(hand, jsonText, jsonTextLen);\n    return status;\n}\n\n\nyajl_status\nyajl_complete_parse(yajl_handle hand)\n{\n    /* The lexer is lazy allocated in the first call to parse.  if parse is\n     * never called, then no data was provided to parse at all.  This is a\n     * \"premature EOF\" error unless yajl_allow_partial_values is specified.\n     * allocating the lexer now is the simplest possible way to handle this\n     * case while preserving all the other semantics of the parser\n     * (multiple values, partial values, etc). */\n    if (hand->lexer == NULL) {\n        hand->lexer = yajl_lex_alloc(&(hand->alloc),\n                                     hand->flags & yajl_allow_comments,\n                                     !(hand->flags & yajl_dont_validate_strings));\n    }\n\n    return yajl_do_finish(hand);\n}\n\nunsigned char *\nyajl_get_error(yajl_handle hand, int verbose,\n               const unsigned char * jsonText, size_t jsonTextLen)\n{\n    return yajl_render_error_string(hand, jsonText, jsonTextLen, verbose);\n}\n\nsize_t\nyajl_get_bytes_consumed(yajl_handle hand)\n{\n    if (!hand) return 0;\n    else return hand->bytesConsumed;\n}\n\n\nvoid\nyajl_free_error(yajl_handle hand, unsigned char * str)\n{\n    /* use memory allocation functions if set */\n    YA_FREE(&(hand->alloc), str);\n}\n\n/* XXX: add utility routines to parse from file */\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl_alloc.c",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * \\file yajl_alloc.h\n * default memory allocation routines for yajl which use malloc/realloc and\n * free\n */\n\n#include \"yajl_alloc.h\"\n#include <stdlib.h>\n\nstatic void * yajl_internal_malloc(void *ctx, size_t sz)\n{\n    return malloc(sz);\n}\n\nstatic void * yajl_internal_realloc(void *ctx, void * previous,\n                                    size_t sz)\n{\n    return realloc(previous, sz);\n}\n\nstatic void yajl_internal_free(void *ctx, void * ptr)\n{\n    free(ptr);\n}\n\nvoid yajl_set_default_alloc_funcs(yajl_alloc_funcs * yaf)\n{\n    yaf->malloc = yajl_internal_malloc;\n    yaf->free = yajl_internal_free;\n    yaf->realloc = yajl_internal_realloc;\n    yaf->ctx = NULL;\n}\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl_alloc.h",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/**\n * \\file yajl_alloc.h\n * default memory allocation routines for yajl which use malloc/realloc and\n * free\n */\n\n#ifndef __YAJL_ALLOC_H__\n#define __YAJL_ALLOC_H__\n\n#include \"api/yajl_common.h\"\n\n#define YA_MALLOC(afs, sz) (afs)->malloc((afs)->ctx, (sz))\n#define YA_FREE(afs, ptr) (afs)->free((afs)->ctx, (ptr))\n#define YA_REALLOC(afs, ptr, sz) (afs)->realloc((afs)->ctx, (ptr), (sz))\n\nvoid yajl_set_default_alloc_funcs(yajl_alloc_funcs * yaf);\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl_buf.c",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#include \"yajl_buf.h\"\n\n#include <assert.h>\n#include <stdlib.h>\n#include <string.h>\n\n#define YAJL_BUF_INIT_SIZE 2048\n\nstruct yajl_buf_t {\n    size_t len;\n    size_t used;\n    unsigned char * data;\n    yajl_alloc_funcs * alloc;\n};\n\nstatic\nvoid yajl_buf_ensure_available(yajl_buf buf, size_t want)\n{\n    size_t need;\n    \n    assert(buf != NULL);\n\n    /* first call */\n    if (buf->data == NULL) {\n        buf->len = YAJL_BUF_INIT_SIZE;\n        buf->data = (unsigned char *) YA_MALLOC(buf->alloc, buf->len);\n        buf->data[0] = 0;\n    }\n\n    need = buf->len;\n\n    while (want >= (need - buf->used)) need <<= 1;\n\n    if (need != buf->len) {\n        buf->data = (unsigned char *) YA_REALLOC(buf->alloc, buf->data, need);\n        buf->len = need;\n    }\n}\n\nyajl_buf yajl_buf_alloc(yajl_alloc_funcs * alloc)\n{\n    yajl_buf b = YA_MALLOC(alloc, sizeof(struct yajl_buf_t));\n    memset((void *) b, 0, sizeof(struct yajl_buf_t));\n    b->alloc = alloc;\n    return b;\n}\n\nvoid yajl_buf_free(yajl_buf buf)\n{\n    assert(buf != NULL);\n    if (buf->data) YA_FREE(buf->alloc, buf->data);\n    YA_FREE(buf->alloc, buf);\n}\n\nvoid yajl_buf_append(yajl_buf buf, const void * data, size_t len)\n{\n    yajl_buf_ensure_available(buf, len);\n    if (len > 0) {\n        assert(data != NULL);\n        memcpy(buf->data + buf->used, data, len);\n        buf->used += len;\n        buf->data[buf->used] = 0;\n    }\n}\n\nvoid yajl_buf_clear(yajl_buf buf)\n{\n    buf->used = 0;\n    if (buf->data) buf->data[buf->used] = 0;\n}\n\nconst unsigned char * yajl_buf_data(yajl_buf buf)\n{\n    return buf->data;\n}\n\nsize_t yajl_buf_len(yajl_buf buf)\n{\n    return buf->used;\n}\n\nvoid\nyajl_buf_truncate(yajl_buf buf, size_t len)\n{\n    assert(len <= buf->used);\n    buf->used = len;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl_buf.h",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#ifndef __YAJL_BUF_H__\n#define __YAJL_BUF_H__\n\n#include \"api/yajl_common.h\"\n#include \"yajl_alloc.h\"\n\n/*\n * Implementation/performance notes.  If this were moved to a header\n * only implementation using #define's where possible we might be \n * able to sqeeze a little performance out of the guy by killing function\n * call overhead.  YMMV.\n */\n\n/**\n * yajl_buf is a buffer with exponential growth.  the buffer ensures that\n * you are always null padded.\n */\ntypedef struct yajl_buf_t * yajl_buf;\n\n/* allocate a new buffer */\nyajl_buf yajl_buf_alloc(yajl_alloc_funcs * alloc);\n\n/* free the buffer */\nvoid yajl_buf_free(yajl_buf buf);\n\n/* append a number of bytes to the buffer */\nvoid yajl_buf_append(yajl_buf buf, const void * data, size_t len);\n\n/* empty the buffer */\nvoid yajl_buf_clear(yajl_buf buf);\n\n/* get a pointer to the beginning of the buffer */\nconst unsigned char * yajl_buf_data(yajl_buf buf);\n\n/* get the length of the buffer */\nsize_t yajl_buf_len(yajl_buf buf);\n\n/* truncate the buffer */\nvoid yajl_buf_truncate(yajl_buf buf, size_t len);\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl_bytestack.h",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/*\n * A header only implementation of a simple stack of bytes, used in YAJL\n * to maintain parse state.\n */\n\n#ifndef __YAJL_BYTESTACK_H__\n#define __YAJL_BYTESTACK_H__\n\n#include \"api/yajl_common.h\"\n\n#define YAJL_BS_INC 128\n\ntypedef struct yajl_bytestack_t\n{\n    unsigned char * stack;\n    size_t size;\n    size_t used;\n    yajl_alloc_funcs * yaf;\n} yajl_bytestack;\n\n/* initialize a bytestack */\n#define yajl_bs_init(obs, _yaf) {               \\\n        (obs).stack = NULL;                     \\\n        (obs).size = 0;                         \\\n        (obs).used = 0;                         \\\n        (obs).yaf = (_yaf);                     \\\n    }                                           \\\n\n\n/* initialize a bytestack */\n#define yajl_bs_free(obs)                 \\\n    if ((obs).stack) (obs).yaf->free((obs).yaf->ctx, (obs).stack);\n\n#define yajl_bs_current(obs)               \\\n    (assert((obs).used > 0), (obs).stack[(obs).used - 1])\n\n#define yajl_bs_push(obs, byte) {                       \\\n    if (((obs).size - (obs).used) == 0) {               \\\n        (obs).size += YAJL_BS_INC;                      \\\n        (obs).stack = (obs).yaf->realloc((obs).yaf->ctx,\\\n                                         (void *) (obs).stack, (obs).size);\\\n    }                                                   \\\n    (obs).stack[((obs).used)++] = (byte);               \\\n}\n\n/* removes the top item of the stack, returns nothing */\n#define yajl_bs_pop(obs) { ((obs).used)--; }\n\n#define yajl_bs_set(obs, byte)                          \\\n    (obs).stack[((obs).used) - 1] = (byte);\n\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl_encode.c",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#include \"yajl_encode.h\"\n\n#include <assert.h>\n#include <stdlib.h>\n#include <string.h>\n#include <stdio.h>\n\nstatic void CharToHex(unsigned char c, char * hexBuf)\n{\n    const char * hexchar = \"0123456789ABCDEF\";\n    hexBuf[0] = hexchar[c >> 4];\n    hexBuf[1] = hexchar[c & 0x0F];\n}\n\nvoid\nyajl_string_encode(const yajl_print_t print,\n                   void * ctx,\n                   const unsigned char * str,\n                   size_t len,\n                   int escape_solidus)\n{\n    size_t beg = 0;\n    size_t end = 0;\n    char hexBuf[7];\n    hexBuf[0] = '\\\\'; hexBuf[1] = 'u'; hexBuf[2] = '0'; hexBuf[3] = '0';\n    hexBuf[6] = 0;\n\n    while (end < len) {\n        const char * escaped = NULL;\n        switch (str[end]) {\n            case '\\r': escaped = \"\\\\r\"; break;\n            case '\\n': escaped = \"\\\\n\"; break;\n            case '\\\\': escaped = \"\\\\\\\\\"; break;\n            /* it is not required to escape a solidus in JSON:\n             * read sec. 2.5: http://www.ietf.org/rfc/rfc4627.txt\n             * specifically, this production from the grammar:\n             *   unescaped = %x20-21 / %x23-5B / %x5D-10FFFF\n             */\n            case '/': if (escape_solidus) escaped = \"\\\\/\"; break;\n            case '\"': escaped = \"\\\\\\\"\"; break;\n            case '\\f': escaped = \"\\\\f\"; break;\n            case '\\b': escaped = \"\\\\b\"; break;\n            case '\\t': escaped = \"\\\\t\"; break;\n            default:\n                if ((unsigned char) str[end] < 32) {\n                    CharToHex(str[end], hexBuf + 4);\n                    escaped = hexBuf;\n                }\n                break;\n        }\n        if (escaped != NULL) {\n            print(ctx, (const char *) (str + beg), end - beg);\n            print(ctx, escaped, (unsigned int)strlen(escaped));\n            beg = ++end;\n        } else {\n            ++end;\n        }\n    }\n    print(ctx, (const char *) (str + beg), end - beg);\n}\n\nstatic void hexToDigit(unsigned int * val, const unsigned char * hex)\n{\n    unsigned int i;\n    for (i=0;i<4;i++) {\n        unsigned char c = hex[i];\n        if (c >= 'A') c = (c & ~0x20) - 7;\n        c -= '0';\n        assert(!(c & 0xF0));\n        *val = (*val << 4) | c;\n    }\n}\n\nstatic void Utf32toUtf8(unsigned int codepoint, char * utf8Buf) \n{\n    if (codepoint < 0x80) {\n        utf8Buf[0] = (char) codepoint;\n        utf8Buf[1] = 0;\n    } else if (codepoint < 0x0800) {\n        utf8Buf[0] = (char) ((codepoint >> 6) | 0xC0);\n        utf8Buf[1] = (char) ((codepoint & 0x3F) | 0x80);\n        utf8Buf[2] = 0;\n    } else if (codepoint < 0x10000) {\n        utf8Buf[0] = (char) ((codepoint >> 12) | 0xE0);\n        utf8Buf[1] = (char) (((codepoint >> 6) & 0x3F) | 0x80);\n        utf8Buf[2] = (char) ((codepoint & 0x3F) | 0x80);\n        utf8Buf[3] = 0;\n    } else if (codepoint < 0x200000) {\n        utf8Buf[0] =(char)((codepoint >> 18) | 0xF0);\n        utf8Buf[1] =(char)(((codepoint >> 12) & 0x3F) | 0x80);\n        utf8Buf[2] =(char)(((codepoint >> 6) & 0x3F) | 0x80);\n        utf8Buf[3] =(char)((codepoint & 0x3F) | 0x80);\n        utf8Buf[4] = 0;\n    } else {\n        utf8Buf[0] = '?';\n        utf8Buf[1] = 0;\n    }\n}\n\nvoid yajl_string_decode(yajl_buf buf, const unsigned char * str,\n                        size_t len)\n{\n    size_t beg = 0;\n    size_t end = 0;    \n\n    while (end < len) {\n        if (str[end] == '\\\\') {\n            char utf8Buf[5];\n            const char * unescaped = \"?\";\n            yajl_buf_append(buf, str + beg, end - beg);\n            switch (str[++end]) {\n                case 'r': unescaped = \"\\r\"; break;\n                case 'n': unescaped = \"\\n\"; break;\n                case '\\\\': unescaped = \"\\\\\"; break;\n                case '/': unescaped = \"/\"; break;\n                case '\"': unescaped = \"\\\"\"; break;\n                case 'f': unescaped = \"\\f\"; break;\n                case 'b': unescaped = \"\\b\"; break;\n                case 't': unescaped = \"\\t\"; break;\n                case 'u': {\n                    unsigned int codepoint = 0;\n                    hexToDigit(&codepoint, str + ++end);\n                    end+=3;\n                    /* check if this is a surrogate */\n                    if ((codepoint & 0xFC00) == 0xD800) {\n                        end++;\n                        if (str[end] == '\\\\' && str[end + 1] == 'u') {\n                            unsigned int surrogate = 0;\n                            hexToDigit(&surrogate, str + end + 2);\n                            codepoint =\n                                (((codepoint & 0x3F) << 10) | \n                                 ((((codepoint >> 6) & 0xF) + 1) << 16) | \n                                 (surrogate & 0x3FF));\n                            end += 5;\n                        } else {\n                            unescaped = \"?\";\n                            break;\n                        }\n                    }\n                    \n                    Utf32toUtf8(codepoint, utf8Buf);\n                    unescaped = utf8Buf;\n\n                    if (codepoint == 0) {\n                        yajl_buf_append(buf, unescaped, 1);\n                        beg = ++end;\n                        continue;\n                    }\n\n                    break;\n                }\n                default:\n                    assert(\"this should never happen\" == NULL);\n            }\n            yajl_buf_append(buf, unescaped, (unsigned int)strlen(unescaped));\n            beg = ++end;\n        } else {\n            end++;\n        }\n    }\n    yajl_buf_append(buf, str + beg, end - beg);\n}\n\n#define ADV_PTR s++; if (!(len--)) return 0;\n\nint yajl_string_validate_utf8(const unsigned char * s, size_t len)\n{\n    if (!len) return 1;\n    if (!s) return 0;\n    \n    while (len--) {\n        /* single byte */\n        if (*s <= 0x7f) {\n            /* noop */\n        }\n        /* two byte */ \n        else if ((*s >> 5) == 0x6) {\n            ADV_PTR;\n            if (!((*s >> 6) == 0x2)) return 0;\n        }\n        /* three byte */\n        else if ((*s >> 4) == 0x0e) {\n            ADV_PTR;\n            if (!((*s >> 6) == 0x2)) return 0;\n            ADV_PTR;\n            if (!((*s >> 6) == 0x2)) return 0;\n        }\n        /* four byte */        \n        else if ((*s >> 3) == 0x1e) {\n            ADV_PTR;\n            if (!((*s >> 6) == 0x2)) return 0;\n            ADV_PTR;\n            if (!((*s >> 6) == 0x2)) return 0;\n            ADV_PTR;\n            if (!((*s >> 6) == 0x2)) return 0;\n        } else {\n            return 0;\n        }\n        \n        s++;\n    }\n    \n    return 1;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl_encode.h",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#ifndef __YAJL_ENCODE_H__\n#define __YAJL_ENCODE_H__\n\n#include \"yajl_buf.h\"\n#include \"api/yajl_gen.h\"\n\nvoid yajl_string_encode(const yajl_print_t printer,\n                        void * ctx,\n                        const unsigned char * str,\n                        size_t length,\n                        int escape_solidus);\n\nvoid yajl_string_decode(yajl_buf buf, const unsigned char * str,\n                        size_t length);\n\nint yajl_string_validate_utf8(const unsigned char * s, size_t len);\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl_gen.c",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#include \"api/yajl_gen.h\"\n#include \"yajl_buf.h\"\n#include \"yajl_encode.h\"\n\n#include <stdlib.h>\n#include <string.h>\n#include <stdio.h>\n#include <math.h>\n#include <stdarg.h>\n\ntypedef enum {\n    yajl_gen_start,\n    yajl_gen_map_start,\n    yajl_gen_map_key,\n    yajl_gen_map_val,\n    yajl_gen_array_start,\n    yajl_gen_in_array,\n    yajl_gen_complete,\n    yajl_gen_error\n} yajl_gen_state;\n\nstruct yajl_gen_t\n{\n    unsigned int flags;\n    unsigned int depth;\n    const char * indentString;\n    yajl_gen_state state[YAJL_MAX_DEPTH];\n    yajl_print_t print;\n    void * ctx; /* yajl_buf */\n    /* memory allocation routines */\n    yajl_alloc_funcs alloc;\n};\n\nint\nyajl_gen_config(yajl_gen g, yajl_gen_option opt, ...)\n{\n    int rv = 1;\n    va_list ap;\n    va_start(ap, opt);\n\n    switch(opt) {\n        case yajl_gen_beautify:\n        case yajl_gen_validate_utf8:\n            if (va_arg(ap, int)) g->flags |= opt;\n            else g->flags &= ~opt;\n            break;\n        case yajl_gen_indent_string: {\n            const char *indent = va_arg(ap, const char *);\n            g->indentString = indent;\n            for (; *indent; indent++) {\n                if (*indent != '\\n'\n                    && *indent != '\\v'\n                    && *indent != '\\f'\n                    && *indent != '\\t'\n                    && *indent != '\\r'\n                    && *indent != ' ')\n                {\n                    g->indentString = NULL;\n                    rv = 0;\n                }\n            }\n            break;\n        }\n        case yajl_gen_print_callback:\n            yajl_buf_free(g->ctx);\n            g->print = va_arg(ap, const yajl_print_t);\n            g->ctx = va_arg(ap, void *);\n            break;\n        default:\n            rv = 0;\n    }\n\n    va_end(ap);\n\n    return rv;\n}\n\n\n\nyajl_gen\nyajl_gen_alloc(const yajl_alloc_funcs * afs)\n{\n    yajl_gen g = NULL;\n    yajl_alloc_funcs afsBuffer;\n\n    /* first order of business is to set up memory allocation routines */\n    if (afs != NULL) {\n        if (afs->malloc == NULL || afs->realloc == NULL || afs->free == NULL)\n        {\n            return NULL;\n        }\n    } else {\n        yajl_set_default_alloc_funcs(&afsBuffer);\n        afs = &afsBuffer;\n    }\n\n    g = (yajl_gen) YA_MALLOC(afs, sizeof(struct yajl_gen_t));\n    if (!g) return NULL;\n\n    memset((void *) g, 0, sizeof(struct yajl_gen_t));\n    /* copy in pointers to allocation routines */\n    memcpy((void *) &(g->alloc), (void *) afs, sizeof(yajl_alloc_funcs));\n\n    g->print = (yajl_print_t)&yajl_buf_append;\n    g->ctx = yajl_buf_alloc(&(g->alloc));\n    g->indentString = \"    \";\n\n    return g;\n}\n\nvoid\nyajl_gen_free(yajl_gen g)\n{\n    if (g->print == (yajl_print_t)&yajl_buf_append) yajl_buf_free((yajl_buf)g->ctx);\n    YA_FREE(&(g->alloc), g);\n}\n\n#define INSERT_SEP \\\n    if (g->state[g->depth] == yajl_gen_map_key ||               \\\n        g->state[g->depth] == yajl_gen_in_array) {              \\\n        g->print(g->ctx, \",\", 1);                               \\\n        if ((g->flags & yajl_gen_beautify)) g->print(g->ctx, \"\\n\", 1);               \\\n    } else if (g->state[g->depth] == yajl_gen_map_val) {        \\\n        g->print(g->ctx, \":\", 1);                               \\\n        if ((g->flags & yajl_gen_beautify)) g->print(g->ctx, \" \", 1);                \\\n   } \n\n#define INSERT_WHITESPACE                                               \\\n    if ((g->flags & yajl_gen_beautify)) {                                                    \\\n        if (g->state[g->depth] != yajl_gen_map_val) {                   \\\n            unsigned int _i;                                            \\\n            for (_i=0;_i<g->depth;_i++)                                 \\\n                g->print(g->ctx,                                        \\\n                         g->indentString,                               \\\n                         (unsigned int)strlen(g->indentString));        \\\n        }                                                               \\\n    }\n\n#define ENSURE_NOT_KEY \\\n    if (g->state[g->depth] == yajl_gen_map_key ||       \\\n        g->state[g->depth] == yajl_gen_map_start)  {    \\\n        return yajl_gen_keys_must_be_strings;           \\\n    }                                                   \\\n\n/* check that we're not complete, or in error state.  in a valid state\n * to be generating */\n#define ENSURE_VALID_STATE \\\n    if (g->state[g->depth] == yajl_gen_error) {   \\\n        return yajl_gen_in_error_state;\\\n    } else if (g->state[g->depth] == yajl_gen_complete) {   \\\n        return yajl_gen_generation_complete;                \\\n    }\n\n#define INCREMENT_DEPTH \\\n    if (++(g->depth) >= YAJL_MAX_DEPTH) return yajl_max_depth_exceeded;\n\n#define DECREMENT_DEPTH \\\n  if (--(g->depth) >= YAJL_MAX_DEPTH) return yajl_gen_error;\n\n#define APPENDED_ATOM \\\n    switch (g->state[g->depth]) {                   \\\n        case yajl_gen_start:                        \\\n            g->state[g->depth] = yajl_gen_complete; \\\n            break;                                  \\\n        case yajl_gen_map_start:                    \\\n        case yajl_gen_map_key:                      \\\n            g->state[g->depth] = yajl_gen_map_val;  \\\n            break;                                  \\\n        case yajl_gen_array_start:                  \\\n            g->state[g->depth] = yajl_gen_in_array; \\\n            break;                                  \\\n        case yajl_gen_map_val:                      \\\n            g->state[g->depth] = yajl_gen_map_key;  \\\n            break;                                  \\\n        default:                                    \\\n            break;                                  \\\n    }                                               \\\n\n#define FINAL_NEWLINE                                        \\\n    if ((g->flags & yajl_gen_beautify) && g->state[g->depth] == yajl_gen_complete) \\\n        g->print(g->ctx, \"\\n\", 1);\n\nyajl_gen_status\nyajl_gen_integer(yajl_gen g, long long int number)\n{\n    char i[32];\n    ENSURE_VALID_STATE; ENSURE_NOT_KEY; INSERT_SEP; INSERT_WHITESPACE;\n    sprintf(i, \"%lld\", number);\n    g->print(g->ctx, i, (unsigned int)strlen(i));\n    APPENDED_ATOM;\n    FINAL_NEWLINE;\n    return yajl_gen_status_ok;\n}\n\n#ifdef WIN32\n#include <float.h>\n#define isnan _isnan\n#define isinf !_finite\n#endif\n\nyajl_gen_status\nyajl_gen_double(yajl_gen g, double number)\n{\n    char i[32];\n    ENSURE_VALID_STATE; ENSURE_NOT_KEY; \n    if (isnan(number) || isinf(number)) return yajl_gen_invalid_number;\n    INSERT_SEP; INSERT_WHITESPACE;\n    sprintf(i, \"%.20g\", number);\n    g->print(g->ctx, i, (unsigned int)strlen(i));\n    APPENDED_ATOM;\n    FINAL_NEWLINE;\n    return yajl_gen_status_ok;\n}\n\nyajl_gen_status\nyajl_gen_number(yajl_gen g, const char * s, size_t l)\n{\n    ENSURE_VALID_STATE; ENSURE_NOT_KEY; INSERT_SEP; INSERT_WHITESPACE;\n    g->print(g->ctx, s, l);\n    APPENDED_ATOM;\n    FINAL_NEWLINE;\n    return yajl_gen_status_ok;\n}\n\nyajl_gen_status\nyajl_gen_string(yajl_gen g, const unsigned char * str,\n                size_t len)\n{\n    // if validation is enabled, check that the string is valid utf8\n    // XXX: This checking could be done a little faster, in the same pass as\n    // the string encoding\n    if (g->flags & yajl_gen_validate_utf8) {\n        if (!yajl_string_validate_utf8(str, len)) {\n            return yajl_gen_invalid_string;\n        }\n    }\n    ENSURE_VALID_STATE; INSERT_SEP; INSERT_WHITESPACE;\n    g->print(g->ctx, \"\\\"\", 1);\n    yajl_string_encode(g->print, g->ctx, str, len, g->flags & yajl_gen_escape_solidus);\n    g->print(g->ctx, \"\\\"\", 1);\n    APPENDED_ATOM;\n    FINAL_NEWLINE;\n    return yajl_gen_status_ok;\n}\n\nyajl_gen_status\nyajl_gen_null(yajl_gen g)\n{\n    ENSURE_VALID_STATE; ENSURE_NOT_KEY; INSERT_SEP; INSERT_WHITESPACE;\n    g->print(g->ctx, \"null\", strlen(\"null\"));\n    APPENDED_ATOM;\n    FINAL_NEWLINE;\n    return yajl_gen_status_ok;\n}\n\nyajl_gen_status\nyajl_gen_bool(yajl_gen g, int boolean)\n{\n    const char * val = boolean ? \"true\" : \"false\";\n\n\tENSURE_VALID_STATE; ENSURE_NOT_KEY; INSERT_SEP; INSERT_WHITESPACE;\n    g->print(g->ctx, val, (unsigned int)strlen(val));\n    APPENDED_ATOM;\n    FINAL_NEWLINE;\n    return yajl_gen_status_ok;\n}\n\nyajl_gen_status\nyajl_gen_map_open(yajl_gen g)\n{\n    ENSURE_VALID_STATE; ENSURE_NOT_KEY; INSERT_SEP; INSERT_WHITESPACE;\n    INCREMENT_DEPTH; \n    \n    g->state[g->depth] = yajl_gen_map_start;\n    g->print(g->ctx, \"{\", 1);\n    if ((g->flags & yajl_gen_beautify)) g->print(g->ctx, \"\\n\", 1);\n    FINAL_NEWLINE;\n    return yajl_gen_status_ok;\n}\n\nyajl_gen_status\nyajl_gen_map_close(yajl_gen g)\n{\n    ENSURE_VALID_STATE; \n    DECREMENT_DEPTH;\n    \n    if ((g->flags & yajl_gen_beautify)) g->print(g->ctx, \"\\n\", 1);\n    APPENDED_ATOM;\n    INSERT_WHITESPACE;\n    g->print(g->ctx, \"}\", 1);\n    FINAL_NEWLINE;\n    return yajl_gen_status_ok;\n}\n\nyajl_gen_status\nyajl_gen_array_open(yajl_gen g)\n{\n    ENSURE_VALID_STATE; ENSURE_NOT_KEY; INSERT_SEP; INSERT_WHITESPACE;\n    INCREMENT_DEPTH; \n    g->state[g->depth] = yajl_gen_array_start;\n    g->print(g->ctx, \"[\", 1);\n    if ((g->flags & yajl_gen_beautify)) g->print(g->ctx, \"\\n\", 1);\n    FINAL_NEWLINE;\n    return yajl_gen_status_ok;\n}\n\nyajl_gen_status\nyajl_gen_array_close(yajl_gen g)\n{\n    ENSURE_VALID_STATE;\n    DECREMENT_DEPTH;\n    if ((g->flags & yajl_gen_beautify)) g->print(g->ctx, \"\\n\", 1);\n    APPENDED_ATOM;\n    INSERT_WHITESPACE;\n    g->print(g->ctx, \"]\", 1);\n    FINAL_NEWLINE;\n    return yajl_gen_status_ok;\n}\n\nyajl_gen_status\nyajl_gen_get_buf(yajl_gen g, const unsigned char ** buf,\n                 size_t * len)\n{\n    if (g->print != (yajl_print_t)&yajl_buf_append) return yajl_gen_no_buf;\n    *buf = yajl_buf_data((yajl_buf)g->ctx);\n    *len = yajl_buf_len((yajl_buf)g->ctx);\n    return yajl_gen_status_ok;\n}\n\nvoid\nyajl_gen_clear(yajl_gen g)\n{\n    if (g->print == (yajl_print_t)&yajl_buf_append) yajl_buf_clear((yajl_buf)g->ctx);\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl_lex.c",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#include \"yajl_lex.h\"\n#include \"yajl_buf.h\"\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <assert.h>\n#include <string.h>\n\n#ifdef YAJL_LEXER_DEBUG\nstatic const char *\ntokToStr(yajl_tok tok) \n{\n    switch (tok) {\n        case yajl_tok_bool: return \"bool\";\n        case yajl_tok_colon: return \"colon\";\n        case yajl_tok_comma: return \"comma\";\n        case yajl_tok_eof: return \"eof\";\n        case yajl_tok_error: return \"error\";\n        case yajl_tok_left_brace: return \"brace\";\n        case yajl_tok_left_bracket: return \"bracket\";\n        case yajl_tok_null: return \"null\";\n        case yajl_tok_integer: return \"integer\";\n        case yajl_tok_double: return \"double\";\n        case yajl_tok_right_brace: return \"brace\";\n        case yajl_tok_right_bracket: return \"bracket\";\n        case yajl_tok_string: return \"string\";\n        case yajl_tok_string_with_escapes: return \"string_with_escapes\";\n    }\n    return \"unknown\";\n}\n#endif\n\n/* Impact of the stream parsing feature on the lexer:\n *\n * YAJL support stream parsing.  That is, the ability to parse the first\n * bits of a chunk of JSON before the last bits are available (still on\n * the network or disk).  This makes the lexer more complex.  The\n * responsibility of the lexer is to handle transparently the case where\n * a chunk boundary falls in the middle of a token.  This is\n * accomplished is via a buffer and a character reading abstraction. \n *\n * Overview of implementation\n *\n * When we lex to end of input string before end of token is hit, we\n * copy all of the input text composing the token into our lexBuf.\n * \n * Every time we read a character, we do so through the readChar function.\n * readChar's responsibility is to handle pulling all chars from the buffer\n * before pulling chars from input text\n */\n\nstruct yajl_lexer_t {\n    /* the overal line and char offset into the data */\n    size_t lineOff;\n    size_t charOff;\n\n    /* error */\n    yajl_lex_error error;\n\n    /* a input buffer to handle the case where a token is spread over\n     * multiple chunks */ \n    yajl_buf buf;\n\n    /* in the case where we have data in the lexBuf, bufOff holds\n     * the current offset into the lexBuf. */\n    size_t bufOff;\n\n    /* are we using the lex buf? */\n    unsigned int bufInUse;\n\n    /* shall we allow comments? */\n    unsigned int allowComments;\n\n    /* shall we validate utf8 inside strings? */\n    unsigned int validateUTF8;\n\n    yajl_alloc_funcs * alloc;\n};\n\n#define readChar(lxr, txt, off)                      \\\n    (((lxr)->bufInUse && yajl_buf_len((lxr)->buf) && lxr->bufOff < yajl_buf_len((lxr)->buf)) ? \\\n     (*((const unsigned char *) yajl_buf_data((lxr)->buf) + ((lxr)->bufOff)++)) : \\\n     ((txt)[(*(off))++]))\n\n#define unreadChar(lxr, off) ((*(off) > 0) ? (*(off))-- : ((lxr)->bufOff--))\n\nyajl_lexer\nyajl_lex_alloc(yajl_alloc_funcs * alloc,\n               unsigned int allowComments, unsigned int validateUTF8)\n{\n    yajl_lexer lxr = (yajl_lexer) YA_MALLOC(alloc, sizeof(struct yajl_lexer_t));\n    memset((void *) lxr, 0, sizeof(struct yajl_lexer_t));\n    lxr->buf = yajl_buf_alloc(alloc);\n    lxr->allowComments = allowComments;\n    lxr->validateUTF8 = validateUTF8;\n    lxr->alloc = alloc;\n    return lxr;\n}\n\nvoid\nyajl_lex_free(yajl_lexer lxr)\n{\n    yajl_buf_free(lxr->buf);\n    YA_FREE(lxr->alloc, lxr);\n    return;\n}\n\n/* a lookup table which lets us quickly determine three things:\n * VEC - valid escaped control char\n * note.  the solidus '/' may be escaped or not.\n * IJC - invalid json char\n * VHC - valid hex char\n * NFP - needs further processing (from a string scanning perspective)\n * NUC - needs utf8 checking when enabled (from a string scanning perspective)\n */\n#define VEC 0x01\n#define IJC 0x02\n#define VHC 0x04\n#define NFP 0x08\n#define NUC 0x10\n\nstatic const char charLookupTable[256] =\n{\n/*00*/ IJC    , IJC    , IJC    , IJC    , IJC    , IJC    , IJC    , IJC    ,\n/*08*/ IJC    , IJC    , IJC    , IJC    , IJC    , IJC    , IJC    , IJC    ,\n/*10*/ IJC    , IJC    , IJC    , IJC    , IJC    , IJC    , IJC    , IJC    ,\n/*18*/ IJC    , IJC    , IJC    , IJC    , IJC    , IJC    , IJC    , IJC    ,\n\n/*20*/ 0      , 0      , NFP|VEC|IJC, 0      , 0      , 0      , 0      , 0      ,\n/*28*/ 0      , 0      , 0      , 0      , 0      , 0      , 0      , VEC    ,\n/*30*/ VHC    , VHC    , VHC    , VHC    , VHC    , VHC    , VHC    , VHC    ,\n/*38*/ VHC    , VHC    , 0      , 0      , 0      , 0      , 0      , 0      ,\n\n/*40*/ 0      , VHC    , VHC    , VHC    , VHC    , VHC    , VHC    , 0      ,\n/*48*/ 0      , 0      , 0      , 0      , 0      , 0      , 0      , 0      ,\n/*50*/ 0      , 0      , 0      , 0      , 0      , 0      , 0      , 0      ,\n/*58*/ 0      , 0      , 0      , 0      , NFP|VEC|IJC, 0      , 0      , 0      ,\n\n/*60*/ 0      , VHC    , VEC|VHC, VHC    , VHC    , VHC    , VEC|VHC, 0      ,\n/*68*/ 0      , 0      , 0      , 0      , 0      , 0      , VEC    , 0      ,\n/*70*/ 0      , 0      , VEC    , 0      , VEC    , 0      , 0      , 0      ,\n/*78*/ 0      , 0      , 0      , 0      , 0      , 0      , 0      , 0      ,\n\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    ,\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    ,\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    ,\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    ,\n\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    ,\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    ,\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    ,\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    ,\n\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    ,\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    ,\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    ,\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    ,\n\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    ,\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    ,\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    ,\n       NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC    , NUC\n};\n\n/** process a variable length utf8 encoded codepoint.\n *\n *  returns:\n *    yajl_tok_string - if valid utf8 char was parsed and offset was\n *                      advanced\n *    yajl_tok_eof - if end of input was hit before validation could\n *                   complete\n *    yajl_tok_error - if invalid utf8 was encountered\n * \n *  NOTE: on error the offset will point to the first char of the\n *  invalid utf8 */\n#define UTF8_CHECK_EOF if (*offset >= jsonTextLen) { return yajl_tok_eof; }\n\nstatic yajl_tok\nyajl_lex_utf8_char(yajl_lexer lexer, const unsigned char * jsonText,\n                   size_t jsonTextLen, size_t * offset,\n                   unsigned char curChar)\n{\n    if (curChar <= 0x7f) {\n        /* single byte */\n        return yajl_tok_string;\n    } else if ((curChar >> 5) == 0x6) {\n        /* two byte */ \n        UTF8_CHECK_EOF;\n        curChar = readChar(lexer, jsonText, offset);\n        if ((curChar >> 6) == 0x2) return yajl_tok_string;\n    } else if ((curChar >> 4) == 0x0e) {\n        /* three byte */\n        UTF8_CHECK_EOF;\n        curChar = readChar(lexer, jsonText, offset);\n        if ((curChar >> 6) == 0x2) {\n            UTF8_CHECK_EOF;\n            curChar = readChar(lexer, jsonText, offset);\n            if ((curChar >> 6) == 0x2) return yajl_tok_string;\n        }\n    } else if ((curChar >> 3) == 0x1e) {\n        /* four byte */\n        UTF8_CHECK_EOF;\n        curChar = readChar(lexer, jsonText, offset);\n        if ((curChar >> 6) == 0x2) {\n            UTF8_CHECK_EOF;\n            curChar = readChar(lexer, jsonText, offset);\n            if ((curChar >> 6) == 0x2) {\n                UTF8_CHECK_EOF;\n                curChar = readChar(lexer, jsonText, offset);\n                if ((curChar >> 6) == 0x2) return yajl_tok_string;\n            }\n        }\n    } \n\n    return yajl_tok_error;\n}\n\n/* lex a string.  input is the lexer, pointer to beginning of\n * json text, and start of string (offset).\n * a token is returned which has the following meanings:\n * yajl_tok_string: lex of string was successful.  offset points to\n *                  terminating '\"'.\n * yajl_tok_eof: end of text was encountered before we could complete\n *               the lex.\n * yajl_tok_error: embedded in the string were unallowable chars.  offset\n *               points to the offending char\n */\n#define STR_CHECK_EOF \\\nif (*offset >= jsonTextLen) { \\\n   tok = yajl_tok_eof; \\\n   goto finish_string_lex; \\\n}\n\n/** scan a string for interesting characters that might need further\n *  review.  return the number of chars that are uninteresting and can\n *  be skipped.\n * (lth) hi world, any thoughts on how to make this routine faster? */\nstatic size_t\nyajl_string_scan(const unsigned char * buf, size_t len, int utf8check)\n{\n    unsigned char mask = IJC|NFP|(utf8check ? NUC : 0);\n    size_t skip = 0;\n    while (skip < len && !(charLookupTable[*buf] & mask))\n    {\n        skip++;\n        buf++;\n    }\n    return skip;\n}\n\nstatic yajl_tok\nyajl_lex_string(yajl_lexer lexer, const unsigned char * jsonText,\n                size_t jsonTextLen, size_t * offset)\n{\n    yajl_tok tok = yajl_tok_error;\n    int hasEscapes = 0;\n\n    for (;;) {\n        unsigned char curChar;\n\n        /* now jump into a faster scanning routine to skip as much\n         * of the buffers as possible */\n        {\n            const unsigned char * p;\n            size_t len;\n            \n            if ((lexer->bufInUse && yajl_buf_len(lexer->buf) &&\n                 lexer->bufOff < yajl_buf_len(lexer->buf)))\n            {\n                p = ((const unsigned char *) yajl_buf_data(lexer->buf) +\n                     (lexer->bufOff));\n                len = yajl_buf_len(lexer->buf) - lexer->bufOff;\n                lexer->bufOff += yajl_string_scan(p, len, lexer->validateUTF8);\n            }                \n            else if (*offset < jsonTextLen) \n            {\n                p = jsonText + *offset;\n                len = jsonTextLen - *offset;\n                *offset += yajl_string_scan(p, len, lexer->validateUTF8);\n            }\n        }\n\n        STR_CHECK_EOF;\n\n        curChar = readChar(lexer, jsonText, offset);\n\n        /* quote terminates */\n        if (curChar == '\"') {\n            tok = yajl_tok_string;\n            break;\n        }\n        /* backslash escapes a set of control chars, */\n        else if (curChar == '\\\\') {\n            hasEscapes = 1;\n            STR_CHECK_EOF;\n\n            /* special case \\u */\n            curChar = readChar(lexer, jsonText, offset);\n            if (curChar == 'u') {\n                unsigned int i = 0;\n\n                for (i=0;i<4;i++) {\n                    STR_CHECK_EOF;                \n                    curChar = readChar(lexer, jsonText, offset);                \n                    if (!(charLookupTable[curChar] & VHC)) {\n                        /* back up to offending char */\n                        unreadChar(lexer, offset);\n                        lexer->error = yajl_lex_string_invalid_hex_char;\n                        goto finish_string_lex;\n                    }\n                }\n            } else if (!(charLookupTable[curChar] & VEC)) {\n                /* back up to offending char */\n                unreadChar(lexer, offset);\n                lexer->error = yajl_lex_string_invalid_escaped_char;\n                goto finish_string_lex;                \n            } \n        }\n        /* when not validating UTF8 it's a simple table lookup to determine\n         * if the present character is invalid */\n        else if(charLookupTable[curChar] & IJC) {\n            /* back up to offending char */\n            unreadChar(lexer, offset);\n            lexer->error = yajl_lex_string_invalid_json_char;\n            goto finish_string_lex;                \n        }\n        /* when in validate UTF8 mode we need to do some extra work */\n        else if (lexer->validateUTF8) {\n            yajl_tok t = yajl_lex_utf8_char(lexer, jsonText, jsonTextLen,\n                                            offset, curChar);\n            \n            if (t == yajl_tok_eof) {\n                tok = yajl_tok_eof;\n                goto finish_string_lex;\n            } else if (t == yajl_tok_error) {\n                lexer->error = yajl_lex_string_invalid_utf8;\n                goto finish_string_lex;\n            } \n        }\n        /* accept it, and move on */ \n    }\n  finish_string_lex:\n    /* tell our buddy, the parser, wether he needs to process this string\n     * again */\n    if (hasEscapes && tok == yajl_tok_string) {\n        tok = yajl_tok_string_with_escapes;\n    } \n\n    return tok;\n}\n\n#define RETURN_IF_EOF if (*offset >= jsonTextLen) return yajl_tok_eof;\n\nstatic yajl_tok\nyajl_lex_number(yajl_lexer lexer, const unsigned char * jsonText,\n                size_t jsonTextLen, size_t * offset)\n{\n    /** XXX: numbers are the only entities in json that we must lex\n     *       _beyond_ in order to know that they are complete.  There\n     *       is an ambiguous case for integers at EOF. */\n\n    unsigned char c;\n\n    yajl_tok tok = yajl_tok_integer;\n\n    RETURN_IF_EOF;    \n    c = readChar(lexer, jsonText, offset);\n\n    /* optional leading minus */\n    if (c == '-') {\n        RETURN_IF_EOF;    \n        c = readChar(lexer, jsonText, offset); \n    }\n\n    /* a single zero, or a series of integers */\n    if (c == '0') {\n        RETURN_IF_EOF;    \n        c = readChar(lexer, jsonText, offset); \n    } else if (c >= '1' && c <= '9') {\n        do {\n            RETURN_IF_EOF;    \n            c = readChar(lexer, jsonText, offset); \n        } while (c >= '0' && c <= '9');\n    } else {\n        unreadChar(lexer, offset);\n        lexer->error = yajl_lex_missing_integer_after_minus;\n        return yajl_tok_error;\n    }\n\n    /* optional fraction (indicates this is floating point) */\n    if (c == '.') {\n        int numRd = 0;\n        \n        RETURN_IF_EOF;\n        c = readChar(lexer, jsonText, offset); \n\n        while (c >= '0' && c <= '9') {\n            numRd++;\n            RETURN_IF_EOF;\n            c = readChar(lexer, jsonText, offset); \n        } \n\n        if (!numRd) {\n            unreadChar(lexer, offset);\n            lexer->error = yajl_lex_missing_integer_after_decimal;\n            return yajl_tok_error;\n        }\n        tok = yajl_tok_double;\n    }\n\n    /* optional exponent (indicates this is floating point) */\n    if (c == 'e' || c == 'E') {\n        RETURN_IF_EOF;\n        c = readChar(lexer, jsonText, offset); \n\n        /* optional sign */\n        if (c == '+' || c == '-') {\n            RETURN_IF_EOF;\n            c = readChar(lexer, jsonText, offset); \n        }\n\n        if (c >= '0' && c <= '9') {\n            do {\n                RETURN_IF_EOF;\n                c = readChar(lexer, jsonText, offset); \n            } while (c >= '0' && c <= '9');\n        } else {\n            unreadChar(lexer, offset);\n            lexer->error = yajl_lex_missing_integer_after_exponent;\n            return yajl_tok_error;\n        }\n        tok = yajl_tok_double;\n    }\n    \n    /* we always go \"one too far\" */\n    unreadChar(lexer, offset);\n    \n    return tok;\n}\n\nstatic yajl_tok\nyajl_lex_comment(yajl_lexer lexer, const unsigned char * jsonText,\n                 size_t jsonTextLen, size_t * offset)\n{\n    unsigned char c;\n\n    yajl_tok tok = yajl_tok_comment;\n\n    RETURN_IF_EOF;    \n    c = readChar(lexer, jsonText, offset);\n\n    /* either slash or star expected */\n    if (c == '/') {\n        /* now we throw away until end of line */\n        do {\n            RETURN_IF_EOF;    \n            c = readChar(lexer, jsonText, offset); \n        } while (c != '\\n');\n    } else if (c == '*') {\n        /* now we throw away until end of comment */        \n        for (;;) {\n            RETURN_IF_EOF;    \n            c = readChar(lexer, jsonText, offset); \n            if (c == '*') {\n                RETURN_IF_EOF;    \n                c = readChar(lexer, jsonText, offset);                 \n                if (c == '/') {\n                    break;\n                } else {\n                    unreadChar(lexer, offset);\n                }\n            }\n        }\n    } else {\n        lexer->error = yajl_lex_invalid_char;\n        tok = yajl_tok_error;\n    }\n    \n    return tok;\n}\n\nyajl_tok\nyajl_lex_lex(yajl_lexer lexer, const unsigned char * jsonText,\n             size_t jsonTextLen, size_t * offset,\n             const unsigned char ** outBuf, size_t * outLen)\n{\n    yajl_tok tok = yajl_tok_error;\n    unsigned char c;\n    size_t startOffset = *offset;\n\n    *outBuf = NULL;\n    *outLen = 0;\n\n    for (;;) {\n        assert(*offset <= jsonTextLen);\n\n        if (*offset >= jsonTextLen) {\n            tok = yajl_tok_eof;\n            goto lexed;\n        }\n\n        c = readChar(lexer, jsonText, offset);\n\n        switch (c) {\n            case '{':\n                tok = yajl_tok_left_bracket;\n                goto lexed;\n            case '}':\n                tok = yajl_tok_right_bracket;\n                goto lexed;\n            case '[':\n                tok = yajl_tok_left_brace;\n                goto lexed;\n            case ']':\n                tok = yajl_tok_right_brace;\n                goto lexed;\n            case ',':\n                tok = yajl_tok_comma;\n                goto lexed;\n            case ':':\n                tok = yajl_tok_colon;\n                goto lexed;\n            case '\\t': case '\\n': case '\\v': case '\\f': case '\\r': case ' ':\n                startOffset++;\n                break;\n            case 't': {\n                const char * want = \"rue\";\n                do {\n                    if (*offset >= jsonTextLen) {\n                        tok = yajl_tok_eof;\n                        goto lexed;\n                    }\n                    c = readChar(lexer, jsonText, offset);\n                    if (c != *want) {\n                        unreadChar(lexer, offset);\n                        lexer->error = yajl_lex_invalid_string;\n                        tok = yajl_tok_error;\n                        goto lexed;\n                    }\n                } while (*(++want));\n                tok = yajl_tok_bool;\n                goto lexed;\n            }\n            case 'f': {\n                const char * want = \"alse\";\n                do {\n                    if (*offset >= jsonTextLen) {\n                        tok = yajl_tok_eof;\n                        goto lexed;\n                    }\n                    c = readChar(lexer, jsonText, offset);\n                    if (c != *want) {\n                        unreadChar(lexer, offset);\n                        lexer->error = yajl_lex_invalid_string;\n                        tok = yajl_tok_error;\n                        goto lexed;\n                    }\n                } while (*(++want));\n                tok = yajl_tok_bool;\n                goto lexed;\n            }\n            case 'n': {\n                const char * want = \"ull\";\n                do {\n                    if (*offset >= jsonTextLen) {\n                        tok = yajl_tok_eof;\n                        goto lexed;\n                    }\n                    c = readChar(lexer, jsonText, offset);\n                    if (c != *want) {\n                        unreadChar(lexer, offset);\n                        lexer->error = yajl_lex_invalid_string;\n                        tok = yajl_tok_error;\n                        goto lexed;\n                    }\n                } while (*(++want));\n                tok = yajl_tok_null;\n                goto lexed;\n            }\n            case '\"': {\n                tok = yajl_lex_string(lexer, (const unsigned char *) jsonText,\n                                      jsonTextLen, offset);\n                goto lexed;\n            }\n            case '-':\n            case '0': case '1': case '2': case '3': case '4': \n            case '5': case '6': case '7': case '8': case '9': {\n                /* integer parsing wants to start from the beginning */\n                unreadChar(lexer, offset);\n                tok = yajl_lex_number(lexer, (const unsigned char *) jsonText,\n                                      jsonTextLen, offset);\n                goto lexed;\n            }\n            case '/':\n                /* hey, look, a probable comment!  If comments are disabled\n                 * it's an error. */\n                if (!lexer->allowComments) {\n                    unreadChar(lexer, offset);\n                    lexer->error = yajl_lex_unallowed_comment;\n                    tok = yajl_tok_error;\n                    goto lexed;\n                }\n                /* if comments are enabled, then we should try to lex\n                 * the thing.  possible outcomes are\n                 * - successful lex (tok_comment, which means continue),\n                 * - malformed comment opening (slash not followed by\n                 *   '*' or '/') (tok_error)\n                 * - eof hit. (tok_eof) */\n                tok = yajl_lex_comment(lexer, (const unsigned char *) jsonText,\n                                       jsonTextLen, offset);\n                if (tok == yajl_tok_comment) {\n                    /* \"error\" is silly, but that's the initial\n                     * state of tok.  guilty until proven innocent. */  \n                    tok = yajl_tok_error;\n                    yajl_buf_clear(lexer->buf);\n                    lexer->bufInUse = 0;\n                    startOffset = *offset; \n                    break;\n                }\n                /* hit error or eof, bail */\n                goto lexed;\n            default:\n                lexer->error = yajl_lex_invalid_char;\n                tok = yajl_tok_error;\n                goto lexed;\n        }\n    }\n\n\n  lexed:\n    /* need to append to buffer if the buffer is in use or\n     * if it's an EOF token */\n    if (tok == yajl_tok_eof || lexer->bufInUse) {\n        if (!lexer->bufInUse) yajl_buf_clear(lexer->buf);\n        lexer->bufInUse = 1;\n        yajl_buf_append(lexer->buf, jsonText + startOffset, *offset - startOffset);\n        lexer->bufOff = 0;\n        \n        if (tok != yajl_tok_eof) {\n            *outBuf = yajl_buf_data(lexer->buf);\n            *outLen = yajl_buf_len(lexer->buf);\n            lexer->bufInUse = 0;\n        }\n    } else if (tok != yajl_tok_error) {\n        *outBuf = jsonText + startOffset;\n        *outLen = *offset - startOffset;\n    }\n\n    /* special case for strings. skip the quotes. */\n    if (tok == yajl_tok_string || tok == yajl_tok_string_with_escapes)\n    {\n        assert(*outLen >= 2);\n        (*outBuf)++;\n        *outLen -= 2; \n    }\n\n\n#ifdef YAJL_LEXER_DEBUG\n    if (tok == yajl_tok_error) {\n        printf(\"lexical error: %s\\n\",\n               yajl_lex_error_to_string(yajl_lex_get_error(lexer)));\n    } else if (tok == yajl_tok_eof) {\n        printf(\"EOF hit\\n\");\n    } else {\n        printf(\"lexed %s: '\", tokToStr(tok));\n        fwrite(*outBuf, 1, *outLen, stdout);\n        printf(\"'\\n\");\n    }\n#endif\n\n    return tok;\n}\n\nconst char *\nyajl_lex_error_to_string(yajl_lex_error error)\n{\n    switch (error) {\n        case yajl_lex_e_ok:\n            return \"ok, no error\";\n        case yajl_lex_string_invalid_utf8:\n            return \"invalid bytes in UTF8 string.\";\n        case yajl_lex_string_invalid_escaped_char:\n            return \"inside a string, '\\\\' occurs before a character \"\n                   \"which it may not.\";\n        case yajl_lex_string_invalid_json_char:            \n            return \"invalid character inside string.\";\n        case yajl_lex_string_invalid_hex_char:\n            return \"invalid (non-hex) character occurs after '\\\\u' inside \"\n                   \"string.\";\n        case yajl_lex_invalid_char:\n            return \"invalid char in json text.\";\n        case yajl_lex_invalid_string:\n            return \"invalid string in json text.\";\n        case yajl_lex_missing_integer_after_exponent:\n            return \"malformed number, a digit is required after the exponent.\";\n        case yajl_lex_missing_integer_after_decimal:\n            return \"malformed number, a digit is required after the \"\n                   \"decimal point.\";\n        case yajl_lex_missing_integer_after_minus:\n            return \"malformed number, a digit is required after the \"\n                   \"minus sign.\";\n        case yajl_lex_unallowed_comment:\n            return \"probable comment found in input text, comments are \"\n                   \"not enabled.\";\n    }\n    return \"unknown error code\";\n}\n\n\n/** allows access to more specific information about the lexical\n *  error when yajl_lex_lex returns yajl_tok_error. */\nyajl_lex_error\nyajl_lex_get_error(yajl_lexer lexer)\n{\n    if (lexer == NULL) return (yajl_lex_error) -1;\n    return lexer->error;\n}\n\nsize_t yajl_lex_current_line(yajl_lexer lexer)\n{\n    return lexer->lineOff;\n}\n\nsize_t yajl_lex_current_char(yajl_lexer lexer)\n{\n    return lexer->charOff;\n}\n\nyajl_tok yajl_lex_peek(yajl_lexer lexer, const unsigned char * jsonText,\n                       size_t jsonTextLen, size_t offset)\n{\n    const unsigned char * outBuf;\n    size_t outLen;\n    size_t bufLen = yajl_buf_len(lexer->buf);\n    size_t bufOff = lexer->bufOff;\n    unsigned int bufInUse = lexer->bufInUse;\n    yajl_tok tok;\n    \n    tok = yajl_lex_lex(lexer, jsonText, jsonTextLen, &offset,\n                       &outBuf, &outLen);\n\n    lexer->bufOff = bufOff;\n    lexer->bufInUse = bufInUse;\n    yajl_buf_truncate(lexer->buf, bufLen);\n    \n    return tok;\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl_lex.h",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#ifndef __YAJL_LEX_H__\n#define __YAJL_LEX_H__\n\n#include \"api/yajl_common.h\"\n\ntypedef enum {\n    yajl_tok_bool,         \n    yajl_tok_colon,\n    yajl_tok_comma,     \n    yajl_tok_eof,\n    yajl_tok_error,\n    yajl_tok_left_brace,     \n    yajl_tok_left_bracket,\n    yajl_tok_null,         \n    yajl_tok_right_brace,     \n    yajl_tok_right_bracket,\n\n    /* we differentiate between integers and doubles to allow the\n     * parser to interpret the number without re-scanning */\n    yajl_tok_integer, \n    yajl_tok_double, \n\n    /* we differentiate between strings which require further processing,\n     * and strings that do not */\n    yajl_tok_string,\n    yajl_tok_string_with_escapes,\n\n    /* comment tokens are not currently returned to the parser, ever */\n    yajl_tok_comment\n} yajl_tok;\n\ntypedef struct yajl_lexer_t * yajl_lexer;\n\nyajl_lexer yajl_lex_alloc(yajl_alloc_funcs * alloc,\n                          unsigned int allowComments,\n                          unsigned int validateUTF8);\n\nvoid yajl_lex_free(yajl_lexer lexer);\n\n/**\n * run/continue a lex. \"offset\" is an input/output parameter.\n * It should be initialized to zero for a\n * new chunk of target text, and upon subsetquent calls with the same\n * target text should passed with the value of the previous invocation.\n *\n * the client may be interested in the value of offset when an error is\n * returned from the lexer.  This allows the client to render useful\nn * error messages.\n *\n * When you pass the next chunk of data, context should be reinitialized\n * to zero.\n * \n * Finally, the output buffer is usually just a pointer into the jsonText,\n * however in cases where the entity being lexed spans multiple chunks,\n * the lexer will buffer the entity and the data returned will be\n * a pointer into that buffer.\n *\n * This behavior is abstracted from client code except for the performance\n * implications which require that the client choose a reasonable chunk\n * size to get adequate performance.\n */\nyajl_tok yajl_lex_lex(yajl_lexer lexer, const unsigned char * jsonText,\n                      size_t jsonTextLen, size_t * offset,\n                      const unsigned char ** outBuf, size_t * outLen);\n\n/** have a peek at the next token, but don't move the lexer forward */\nyajl_tok yajl_lex_peek(yajl_lexer lexer, const unsigned char * jsonText,\n                       size_t jsonTextLen, size_t offset);\n\n\ntypedef enum {\n    yajl_lex_e_ok = 0,\n    yajl_lex_string_invalid_utf8,\n    yajl_lex_string_invalid_escaped_char,\n    yajl_lex_string_invalid_json_char,\n    yajl_lex_string_invalid_hex_char,\n    yajl_lex_invalid_char,\n    yajl_lex_invalid_string,\n    yajl_lex_missing_integer_after_decimal,\n    yajl_lex_missing_integer_after_exponent,\n    yajl_lex_missing_integer_after_minus,\n    yajl_lex_unallowed_comment\n} yajl_lex_error;\n\nconst char * yajl_lex_error_to_string(yajl_lex_error error);\n\n/** allows access to more specific information about the lexical\n *  error when yajl_lex_lex returns yajl_tok_error. */\nyajl_lex_error yajl_lex_get_error(yajl_lexer lexer);\n\n/** get the current offset into the most recently lexed json string. */\nsize_t yajl_lex_current_offset(yajl_lexer lexer);\n\n/** get the number of lines lexed by this lexer instance */\nsize_t yajl_lex_current_line(yajl_lexer lexer);\n\n/** get the number of chars lexed by this lexer instance since the last\n *  \\n or \\r */\nsize_t yajl_lex_current_char(yajl_lexer lexer);\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl_parser.c",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#include \"api/yajl_parse.h\"\n#include \"yajl_lex.h\"\n#include \"yajl_parser.h\"\n#include \"yajl_encode.h\"\n#include \"yajl_bytestack.h\"\n\n#include <stdlib.h>\n#include <limits.h>\n#include <errno.h>\n#include <stdio.h>\n#include <string.h>\n#include <ctype.h>\n#include <assert.h>\n#include <math.h>\n\n#define MAX_VALUE_TO_MULTIPLY ((LLONG_MAX / 10) + (LLONG_MAX % 10))\n\n /* same semantics as strtol */\nlong long\nyajl_parse_integer(const unsigned char *number, unsigned int length)\n{\n    long long ret  = 0;\n    long sign = 1;\n    const unsigned char *pos = number;\n    if (*pos == '-') { pos++; sign = -1; }\n    if (*pos == '+') { pos++; }\n\n    while (pos < number + length) {\n        if ( ret > MAX_VALUE_TO_MULTIPLY ) {\n            errno = ERANGE;\n            return sign == 1 ? LLONG_MAX : LLONG_MIN;\n        }\n        ret *= 10;\n        if (LLONG_MAX - ret < (*pos - '0')) {\n            errno = ERANGE;\n            return sign == 1 ? LLONG_MAX : LLONG_MIN;\n        }\n        ret += (*pos++ - '0');\n    }\n\n    return sign * ret;\n}\n\nunsigned char *\nyajl_render_error_string(yajl_handle hand, const unsigned char * jsonText,\n                         size_t jsonTextLen, int verbose)\n{\n    size_t offset = hand->bytesConsumed;\n    unsigned char * str;\n    const char * errorType = NULL;\n    const char * errorText = NULL;\n    char text[72];\n    const char * arrow = \"                     (right here) ------^\\n\";\n\n    if (yajl_bs_current(hand->stateStack) == yajl_state_parse_error) {\n        errorType = \"parse\";\n        errorText = hand->parseError;\n    } else if (yajl_bs_current(hand->stateStack) == yajl_state_lexical_error) {\n        errorType = \"lexical\";\n        errorText = yajl_lex_error_to_string(yajl_lex_get_error(hand->lexer));\n    } else {\n        errorType = \"unknown\";\n    }\n\n    {\n        size_t memneeded = 0;\n        memneeded += strlen(errorType);\n        memneeded += strlen(\" error\");\n        if (errorText != NULL) {\n            memneeded += strlen(\": \");\n            memneeded += strlen(errorText);\n        }\n        str = (unsigned char *) YA_MALLOC(&(hand->alloc), memneeded + 2);\n        if (!str) return NULL;\n        str[0] = 0;\n        strcat((char *) str, errorType);\n        strcat((char *) str, \" error\");\n        if (errorText != NULL) {\n            strcat((char *) str, \": \");\n            strcat((char *) str, errorText);\n        }\n        strcat((char *) str, \"\\n\");\n    }\n\n    /* now we append as many spaces as needed to make sure the error\n     * falls at char 41, if verbose was specified */\n    if (verbose) {\n        size_t start, end, i;\n        size_t spacesNeeded;\n\n        spacesNeeded = (offset < 30 ? 40 - offset : 10);\n        start = (offset >= 30 ? offset - 30 : 0);\n        end = (offset + 30 > jsonTextLen ? jsonTextLen : offset + 30);\n\n        for (i=0;i<spacesNeeded;i++) text[i] = ' ';\n\n        for (;start < end;start++, i++) {\n            if (jsonText[start] != '\\n' && jsonText[start] != '\\r')\n            {\n                text[i] = jsonText[start];\n            }\n            else\n            {\n                text[i] = ' ';\n            }\n        }\n        assert(i <= 71);\n        text[i++] = '\\n';\n        text[i] = 0;\n        {\n            char * newStr = (char *)\n                YA_MALLOC(&(hand->alloc), (unsigned int)(strlen((char *) str) +\n                                                         strlen((char *) text) +\n                                                         strlen(arrow) + 1));\n            if (newStr) {\n                newStr[0] = 0;\n                strcat((char *) newStr, (char *) str);\n                strcat((char *) newStr, text);\n                strcat((char *) newStr, arrow);\n            }\n            YA_FREE(&(hand->alloc), str);\n            str = (unsigned char *) newStr;\n        }\n    }\n    return str;\n}\n\n/* check for client cancelation */\n#define _CC_CHK(x)                                                \\\n    if (!(x)) {                                                   \\\n        yajl_bs_set(hand->stateStack, yajl_state_parse_error);    \\\n        hand->parseError =                                        \\\n            \"client cancelled parse via callback return value\";   \\\n        return yajl_status_client_canceled;                       \\\n    }\n\n\nyajl_status\nyajl_do_finish(yajl_handle hand)\n{\n    yajl_status stat;\n    stat = yajl_do_parse(hand,(const unsigned char *) \" \",1);\n\n    if (stat != yajl_status_ok) return stat;\n\n    switch(yajl_bs_current(hand->stateStack))\n    {\n        case yajl_state_parse_error:\n        case yajl_state_lexical_error:\n            return yajl_status_error;\n        case yajl_state_got_value:\n        case yajl_state_parse_complete:\n            return yajl_status_ok;\n        default:\n            if (!(hand->flags & yajl_allow_partial_values))\n            {\n                yajl_bs_set(hand->stateStack, yajl_state_parse_error);\n                hand->parseError = \"premature EOF\";\n                return yajl_status_error;\n            }\n            return yajl_status_ok;\n    }\n}\n\nyajl_status\nyajl_do_parse(yajl_handle hand, const unsigned char * jsonText,\n              size_t jsonTextLen)\n{\n    yajl_tok tok;\n    const unsigned char * buf;\n    size_t bufLen;\n    size_t * offset = &(hand->bytesConsumed);\n\n    *offset = 0;\n\n  around_again:\n    switch (yajl_bs_current(hand->stateStack)) {\n        case yajl_state_parse_complete:\n            if (hand->flags & yajl_allow_multiple_values) {\n                yajl_bs_set(hand->stateStack, yajl_state_got_value);\n                goto around_again;\n            }\n            if (!(hand->flags & yajl_allow_trailing_garbage)) {\n                if (*offset != jsonTextLen) {\n                    tok = yajl_lex_lex(hand->lexer, jsonText, jsonTextLen,\n                                       offset, &buf, &bufLen);\n                    if (tok != yajl_tok_eof) {\n                        yajl_bs_set(hand->stateStack, yajl_state_parse_error);\n                        hand->parseError = \"trailing garbage\";\n                    }\n                    goto around_again;\n                }\n            }\n            return yajl_status_ok;\n        case yajl_state_lexical_error:\n        case yajl_state_parse_error:\n            return yajl_status_error;\n        case yajl_state_start:\n        case yajl_state_got_value:\n        case yajl_state_map_need_val:\n        case yajl_state_array_need_val:\n        case yajl_state_array_start:  {\n            /* for arrays and maps, we advance the state for this\n             * depth, then push the state of the next depth.\n             * If an error occurs during the parsing of the nesting\n             * enitity, the state at this level will not matter.\n             * a state that needs pushing will be anything other\n             * than state_start */\n\n            yajl_state stateToPush = yajl_state_start;\n\n            tok = yajl_lex_lex(hand->lexer, jsonText, jsonTextLen,\n                               offset, &buf, &bufLen);\n\n            switch (tok) {\n                case yajl_tok_eof:\n                    return yajl_status_ok;\n                case yajl_tok_error:\n                    yajl_bs_set(hand->stateStack, yajl_state_lexical_error);\n                    goto around_again;\n                case yajl_tok_string:\n                    if (hand->callbacks && hand->callbacks->yajl_string) {\n                        _CC_CHK(hand->callbacks->yajl_string(hand->ctx,\n                                                             buf, bufLen));\n                    }\n                    break;\n                case yajl_tok_string_with_escapes:\n                    if (hand->callbacks && hand->callbacks->yajl_string) {\n                        yajl_buf_clear(hand->decodeBuf);\n                        yajl_string_decode(hand->decodeBuf, buf, bufLen);\n                        _CC_CHK(hand->callbacks->yajl_string(\n                                    hand->ctx, yajl_buf_data(hand->decodeBuf),\n                                    yajl_buf_len(hand->decodeBuf)));\n                    }\n                    break;\n                case yajl_tok_bool:\n                    if (hand->callbacks && hand->callbacks->yajl_boolean) {\n                        _CC_CHK(hand->callbacks->yajl_boolean(hand->ctx,\n                                                              *buf == 't'));\n                    }\n                    break;\n                case yajl_tok_null:\n                    if (hand->callbacks && hand->callbacks->yajl_null) {\n                        _CC_CHK(hand->callbacks->yajl_null(hand->ctx));\n                    }\n                    break;\n                case yajl_tok_left_bracket:\n                    if (hand->callbacks && hand->callbacks->yajl_start_map) {\n                        _CC_CHK(hand->callbacks->yajl_start_map(hand->ctx));\n                    }\n                    stateToPush = yajl_state_map_start;\n                    break;\n                case yajl_tok_left_brace:\n                    if (hand->callbacks && hand->callbacks->yajl_start_array) {\n                        _CC_CHK(hand->callbacks->yajl_start_array(hand->ctx));\n                    }\n                    stateToPush = yajl_state_array_start;\n                    break;\n                case yajl_tok_integer:\n                    if (hand->callbacks) {\n                        if (hand->callbacks->yajl_number) {\n                            _CC_CHK(hand->callbacks->yajl_number(\n                                        hand->ctx,(const char *) buf, bufLen));\n                        } else if (hand->callbacks->yajl_integer) {\n                            long long int i = 0;\n                            i = yajl_parse_integer(buf, bufLen);\n                            if ((i == LLONG_MIN || i == LLONG_MAX) &&\n                                errno == ERANGE)\n                            {\n                                yajl_bs_set(hand->stateStack,\n                                            yajl_state_parse_error);\n                                hand->parseError = \"integer overflow\" ;\n                                /* try to restore error offset */\n                                if (*offset >= bufLen) *offset -= bufLen;\n                                else *offset = 0;\n                                goto around_again;\n                            }\n                            _CC_CHK(hand->callbacks->yajl_integer(hand->ctx,\n                                                                  i));\n                        }\n                    }\n                    break;\n                case yajl_tok_double:\n                    if (hand->callbacks) {\n                        if (hand->callbacks->yajl_number) {\n                            _CC_CHK(hand->callbacks->yajl_number(\n                                        hand->ctx, (const char *) buf, bufLen));\n                        } else if (hand->callbacks->yajl_double) {\n                            double d = 0.0;\n                            yajl_buf_clear(hand->decodeBuf);\n                            yajl_buf_append(hand->decodeBuf, buf, bufLen);\n                            buf = yajl_buf_data(hand->decodeBuf);\n                            d = strtod((char *) buf, NULL);\n                            if ((d == HUGE_VAL || d == -HUGE_VAL) &&\n                                errno == ERANGE)\n                            {\n                                yajl_bs_set(hand->stateStack,\n                                            yajl_state_parse_error);\n                                hand->parseError = \"numeric (floating point) \"\n                                    \"overflow\";\n                                /* try to restore error offset */\n                                if (*offset >= bufLen) *offset -= bufLen;\n                                else *offset = 0;\n                                goto around_again;\n                            }\n                            _CC_CHK(hand->callbacks->yajl_double(hand->ctx,\n                                                                 d));\n                        }\n                    }\n                    break;\n                case yajl_tok_right_brace: {\n                    if (yajl_bs_current(hand->stateStack) ==\n                        yajl_state_array_start)\n                    {\n                        if (hand->callbacks &&\n                            hand->callbacks->yajl_end_array)\n                        {\n                            _CC_CHK(hand->callbacks->yajl_end_array(hand->ctx));\n                        }\n                        yajl_bs_pop(hand->stateStack);\n                        goto around_again;\n                    }\n                    /* intentional fall-through */\n                }\n                case yajl_tok_colon:\n                case yajl_tok_comma:\n                case yajl_tok_right_bracket:\n                    yajl_bs_set(hand->stateStack, yajl_state_parse_error);\n                    hand->parseError =\n                        \"unallowed token at this point in JSON text\";\n                    goto around_again;\n                default:\n                    yajl_bs_set(hand->stateStack, yajl_state_parse_error);\n                    hand->parseError = \"invalid token, internal error\";\n                    goto around_again;\n            }\n            /* got a value.  transition depends on the state we're in. */\n            {\n                yajl_state s = yajl_bs_current(hand->stateStack);\n                if (s == yajl_state_start || s == yajl_state_got_value) {\n                    yajl_bs_set(hand->stateStack, yajl_state_parse_complete);\n                } else if (s == yajl_state_map_need_val) {\n                    yajl_bs_set(hand->stateStack, yajl_state_map_got_val);\n                } else {\n                    yajl_bs_set(hand->stateStack, yajl_state_array_got_val);\n                }\n            }\n            if (stateToPush != yajl_state_start) {\n                yajl_bs_push(hand->stateStack, stateToPush);\n            }\n\n            goto around_again;\n        }\n        case yajl_state_map_start:\n        case yajl_state_map_need_key: {\n            /* only difference between these two states is that in\n             * start '}' is valid, whereas in need_key, we've parsed\n             * a comma, and a string key _must_ follow */\n            tok = yajl_lex_lex(hand->lexer, jsonText, jsonTextLen,\n                               offset, &buf, &bufLen);\n            switch (tok) {\n                case yajl_tok_eof:\n                    return yajl_status_ok;\n                case yajl_tok_error:\n                    yajl_bs_set(hand->stateStack, yajl_state_lexical_error);\n                    goto around_again;\n                case yajl_tok_string_with_escapes:\n                    if (hand->callbacks && hand->callbacks->yajl_map_key) {\n                        yajl_buf_clear(hand->decodeBuf);\n                        yajl_string_decode(hand->decodeBuf, buf, bufLen);\n                        buf = yajl_buf_data(hand->decodeBuf);\n                        bufLen = yajl_buf_len(hand->decodeBuf);\n                    }\n                    /* intentional fall-through */\n                case yajl_tok_string:\n                    if (hand->callbacks && hand->callbacks->yajl_map_key) {\n                        _CC_CHK(hand->callbacks->yajl_map_key(hand->ctx, buf,\n                                                              bufLen));\n                    }\n                    yajl_bs_set(hand->stateStack, yajl_state_map_sep);\n                    goto around_again;\n                case yajl_tok_right_bracket:\n                    if (yajl_bs_current(hand->stateStack) ==\n                        yajl_state_map_start)\n                    {\n                        if (hand->callbacks && hand->callbacks->yajl_end_map) {\n                            _CC_CHK(hand->callbacks->yajl_end_map(hand->ctx));\n                        }\n                        yajl_bs_pop(hand->stateStack);\n                        goto around_again;\n                    }\n                default:\n                    yajl_bs_set(hand->stateStack, yajl_state_parse_error);\n                    hand->parseError =\n                        \"invalid object key (must be a string)\"; \n                    goto around_again;\n            }\n        }\n        case yajl_state_map_sep: {\n            tok = yajl_lex_lex(hand->lexer, jsonText, jsonTextLen,\n                               offset, &buf, &bufLen);\n            switch (tok) {\n                case yajl_tok_colon:\n                    yajl_bs_set(hand->stateStack, yajl_state_map_need_val);\n                    goto around_again;\n                case yajl_tok_eof:\n                    return yajl_status_ok;\n                case yajl_tok_error:\n                    yajl_bs_set(hand->stateStack, yajl_state_lexical_error);\n                    goto around_again;\n                default:\n                    yajl_bs_set(hand->stateStack, yajl_state_parse_error);\n                    hand->parseError = \"object key and value must \"\n                        \"be separated by a colon (':')\";\n                    goto around_again;\n            }\n        }\n        case yajl_state_map_got_val: {\n            tok = yajl_lex_lex(hand->lexer, jsonText, jsonTextLen,\n                               offset, &buf, &bufLen);\n            switch (tok) {\n                case yajl_tok_right_bracket:\n                    if (hand->callbacks && hand->callbacks->yajl_end_map) {\n                        _CC_CHK(hand->callbacks->yajl_end_map(hand->ctx));\n                    }\n                    yajl_bs_pop(hand->stateStack);\n                    goto around_again;\n                case yajl_tok_comma:\n                    yajl_bs_set(hand->stateStack, yajl_state_map_need_key);\n                    goto around_again;\n                case yajl_tok_eof:\n                    return yajl_status_ok;\n                case yajl_tok_error:\n                    yajl_bs_set(hand->stateStack, yajl_state_lexical_error);\n                    goto around_again;\n                default:\n                    yajl_bs_set(hand->stateStack, yajl_state_parse_error);\n                    hand->parseError = \"after key and value, inside map, \"\n                                       \"I expect ',' or '}'\";\n                    /* try to restore error offset */\n                    if (*offset >= bufLen) *offset -= bufLen;\n                    else *offset = 0;\n                    goto around_again;\n            }\n        }\n        case yajl_state_array_got_val: {\n            tok = yajl_lex_lex(hand->lexer, jsonText, jsonTextLen,\n                               offset, &buf, &bufLen);\n            switch (tok) {\n                case yajl_tok_right_brace:\n                    if (hand->callbacks && hand->callbacks->yajl_end_array) {\n                        _CC_CHK(hand->callbacks->yajl_end_array(hand->ctx));\n                    }\n                    yajl_bs_pop(hand->stateStack);\n                    goto around_again;\n                case yajl_tok_comma:\n                    yajl_bs_set(hand->stateStack, yajl_state_array_need_val);\n                    goto around_again;\n                case yajl_tok_eof:\n                    return yajl_status_ok;\n                case yajl_tok_error:\n                    yajl_bs_set(hand->stateStack, yajl_state_lexical_error);\n                    goto around_again;\n                default:\n                    yajl_bs_set(hand->stateStack, yajl_state_parse_error);\n                    hand->parseError =\n                        \"after array element, I expect ',' or ']'\";\n                    goto around_again;\n            }\n        }\n    }\n\n    abort();\n    return yajl_status_error;\n}\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl_parser.h",
    "content": "/*\n * Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#ifndef __YAJL_PARSER_H__\n#define __YAJL_PARSER_H__\n\n#include \"api/yajl_parse.h\"\n#include \"yajl_bytestack.h\"\n#include \"yajl_buf.h\"\n#include \"yajl_lex.h\"\n\n\ntypedef enum {\n    yajl_state_start = 0,\n    yajl_state_parse_complete,\n    yajl_state_parse_error,\n    yajl_state_lexical_error,\n    yajl_state_map_start,\n    yajl_state_map_sep,\n    yajl_state_map_need_val,\n    yajl_state_map_got_val,\n    yajl_state_map_need_key,\n    yajl_state_array_start,\n    yajl_state_array_got_val,\n    yajl_state_array_need_val,\n    yajl_state_got_value,\n} yajl_state;\n\nstruct yajl_handle_t {\n    const yajl_callbacks * callbacks;\n    void * ctx;\n    yajl_lexer lexer;\n    const char * parseError;\n    /* the number of bytes consumed from the last client buffer,\n     * in the case of an error this will be an error offset, in the\n     * case of an error this can be used as the error offset */\n    size_t bytesConsumed;\n    /* temporary storage for decoded strings */\n    yajl_buf decodeBuf;\n    /* a stack of states.  access with yajl_state_XXX routines */\n    yajl_bytestack stateStack;\n    /* memory allocation routines */\n    yajl_alloc_funcs alloc;\n    /* bitfield */\n    unsigned int flags;\n};\n\nyajl_status\nyajl_do_parse(yajl_handle handle, const unsigned char * jsonText,\n              size_t jsonTextLen);\n\nyajl_status\nyajl_do_finish(yajl_handle handle);\n\nunsigned char *\nyajl_render_error_string(yajl_handle hand, const unsigned char * jsonText,\n                         size_t jsonTextLen, int verbose);\n\n/* A little built in integer parsing routine with the same semantics as strtol\n * that's unaffected by LOCALE. */\nlong long\nyajl_parse_integer(const unsigned char *number, unsigned int length);\n\n\n#endif\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl_tree.c",
    "content": "/*\n * Copyright (c) 2010-2011  Florian Forster  <ff at octo.it>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <errno.h>\n#include <assert.h>\n\n#include \"api/yajl_tree.h\"\n#include \"api/yajl_parse.h\"\n\n#include \"yajl_parser.h\"\n\n#ifdef WIN32\n#define snprintf sprintf_s\n#endif\n\n#define STATUS_CONTINUE 1\n#define STATUS_ABORT    0\n\nstruct stack_elem_s;\ntypedef struct stack_elem_s stack_elem_t;\nstruct stack_elem_s\n{\n    char * key;\n    yajl_val value;\n    stack_elem_t *next;\n};\n\nstruct context_s\n{\n    stack_elem_t *stack;\n    yajl_val root;\n    char *errbuf;\n    size_t errbuf_size;\n};\ntypedef struct context_s context_t;\n\n#define RETURN_ERROR(ctx,retval,...) {                                  \\\n        if ((ctx)->errbuf != NULL)                                      \\\n            snprintf ((ctx)->errbuf, (ctx)->errbuf_size, __VA_ARGS__);  \\\n        return (retval);                                                \\\n    }\n\nstatic yajl_val value_alloc (yajl_type type)\n{\n    yajl_val v;\n\n    v = malloc (sizeof (*v));\n    if (v == NULL) return (NULL);\n    memset (v, 0, sizeof (*v));\n    v->type = type;\n\n    return (v);\n}\n\nstatic void yajl_object_free (yajl_val v)\n{\n    size_t i;\n\n    if (!YAJL_IS_OBJECT(v)) return;\n\n    for (i = 0; i < v->u.object.len; i++)\n    {\n        free((char *) v->u.object.keys[i]);\n        v->u.object.keys[i] = NULL;\n        yajl_tree_free (v->u.object.values[i]);\n        v->u.object.values[i] = NULL;\n    }\n\n    free((void*) v->u.object.keys);\n    free(v->u.object.values);\n    free(v);\n}\n\nstatic void yajl_array_free (yajl_val v)\n{\n    size_t i;\n\n    if (!YAJL_IS_ARRAY(v)) return;\n\n    for (i = 0; i < v->u.array.len; i++)\n    {\n        yajl_tree_free (v->u.array.values[i]);\n        v->u.array.values[i] = NULL;\n    }\n\n    free(v->u.array.values);\n    free(v);\n}\n\n/*\n * Parsing nested objects and arrays is implemented using a stack. When a new\n * object or array starts (a curly or a square opening bracket is read), an\n * appropriate value is pushed on the stack. When the end of the object is\n * reached (an appropriate closing bracket has been read), the value is popped\n * off the stack and added to the enclosing object using \"context_add_value\".\n */\nstatic int context_push(context_t *ctx, yajl_val v)\n{\n    stack_elem_t *stack;\n\n    stack = malloc (sizeof (*stack));\n    if (stack == NULL)\n        RETURN_ERROR (ctx, ENOMEM, \"Out of memory\");\n    memset (stack, 0, sizeof (*stack));\n\n    assert ((ctx->stack == NULL)\n            || YAJL_IS_OBJECT (v)\n            || YAJL_IS_ARRAY (v));\n\n    stack->value = v;\n    stack->next = ctx->stack;\n    ctx->stack = stack;\n\n    return (0);\n}\n\nstatic yajl_val context_pop(context_t *ctx)\n{\n    stack_elem_t *stack;\n    yajl_val v;\n\n    if (ctx->stack == NULL)\n        RETURN_ERROR (ctx, NULL, \"context_pop: \"\n                      \"Bottom of stack reached prematurely\");\n\n    stack = ctx->stack;\n    ctx->stack = stack->next;\n\n    v = stack->value;\n\n    free (stack);\n\n    return (v);\n}\n\nstatic int object_add_keyval(context_t *ctx,\n                             yajl_val obj, char *key, yajl_val value)\n{\n    const char **tmpk;\n    yajl_val *tmpv;\n\n    /* We're checking for NULL in \"context_add_value\" or its callers. */\n    assert (ctx != NULL);\n    assert (obj != NULL);\n    assert (key != NULL);\n    assert (value != NULL);\n\n    /* We're assuring that \"obj\" is an object in \"context_add_value\". */\n    assert(YAJL_IS_OBJECT(obj));\n\n    tmpk = realloc((void *) obj->u.object.keys, sizeof(*(obj->u.object.keys)) * (obj->u.object.len + 1));\n    if (tmpk == NULL)\n        RETURN_ERROR(ctx, ENOMEM, \"Out of memory\");\n    obj->u.object.keys = tmpk;\n\n    tmpv = realloc(obj->u.object.values, sizeof (*obj->u.object.values) * (obj->u.object.len + 1));\n    if (tmpv == NULL)\n        RETURN_ERROR(ctx, ENOMEM, \"Out of memory\");\n    obj->u.object.values = tmpv;\n\n    obj->u.object.keys[obj->u.object.len] = key;\n    obj->u.object.values[obj->u.object.len] = value;\n    obj->u.object.len++;\n\n    return (0);\n}\n\nstatic int array_add_value (context_t *ctx,\n                            yajl_val array, yajl_val value)\n{\n    yajl_val *tmp;\n\n    /* We're checking for NULL pointers in \"context_add_value\" or its\n     * callers. */\n    assert (ctx != NULL);\n    assert (array != NULL);\n    assert (value != NULL);\n\n    /* \"context_add_value\" will only call us with array values. */\n    assert(YAJL_IS_ARRAY(array));\n    \n    tmp = realloc(array->u.array.values,\n                  sizeof(*(array->u.array.values)) * (array->u.array.len + 1));\n    if (tmp == NULL)\n        RETURN_ERROR(ctx, ENOMEM, \"Out of memory\");\n    array->u.array.values = tmp;\n    array->u.array.values[array->u.array.len] = value;\n    array->u.array.len++;\n\n    return 0;\n}\n\n/*\n * Add a value to the value on top of the stack or the \"root\" member in the\n * context if the end of the parsing process is reached.\n */\nstatic int context_add_value (context_t *ctx, yajl_val v)\n{\n    /* We're checking for NULL values in all the calling functions. */\n    assert (ctx != NULL);\n    assert (v != NULL);\n\n    /*\n     * There are three valid states in which this function may be called:\n     *   - There is no value on the stack => This is the only value. This is the\n     *     last step done when parsing a document. We assign the value to the\n     *     \"root\" member and return.\n     *   - The value on the stack is an object. In this case store the key on the\n     *     stack or, if the key has already been read, add key and value to the\n     *     object.\n     *   - The value on the stack is an array. In this case simply add the value\n     *     and return.\n     */\n    if (ctx->stack == NULL)\n    {\n        assert (ctx->root == NULL);\n        ctx->root = v;\n        return (0);\n    }\n    else if (YAJL_IS_OBJECT (ctx->stack->value))\n    {\n        if (ctx->stack->key == NULL)\n        {\n            if (!YAJL_IS_STRING (v))\n                RETURN_ERROR (ctx, EINVAL, \"context_add_value: \"\n                              \"Object key is not a string (%#04x)\",\n                              v->type);\n\n            ctx->stack->key = v->u.string;\n            v->u.string = NULL;\n            free(v);\n            return (0);\n        }\n        else /* if (ctx->key != NULL) */\n        {\n            char * key;\n\n            key = ctx->stack->key;\n            ctx->stack->key = NULL;\n            return (object_add_keyval (ctx, ctx->stack->value, key, v));\n        }\n    }\n    else if (YAJL_IS_ARRAY (ctx->stack->value))\n    {\n        return (array_add_value (ctx, ctx->stack->value, v));\n    }\n    else\n    {\n        RETURN_ERROR (ctx, EINVAL, \"context_add_value: Cannot add value to \"\n                      \"a value of type %#04x (not a composite type)\",\n                      ctx->stack->value->type);\n    }\n}\n\nstatic int handle_string (void *ctx,\n                          const unsigned char *string, size_t string_length)\n{\n    yajl_val v;\n\n    v = value_alloc (yajl_t_string);\n    if (v == NULL)\n        RETURN_ERROR ((context_t *) ctx, STATUS_ABORT, \"Out of memory\");\n\n    v->u.string = malloc (string_length + 1);\n    if (v->u.string == NULL)\n    {\n        free (v);\n        RETURN_ERROR ((context_t *) ctx, STATUS_ABORT, \"Out of memory\");\n    }\n    memcpy(v->u.string, string, string_length);\n    v->u.string[string_length] = 0;\n\n    return ((context_add_value (ctx, v) == 0) ? STATUS_CONTINUE : STATUS_ABORT);\n}\n\nstatic int handle_number (void *ctx, const char *string, size_t string_length)\n{\n    yajl_val v;\n    char *endptr;\n\n    v = value_alloc(yajl_t_number);\n    if (v == NULL)\n        RETURN_ERROR((context_t *) ctx, STATUS_ABORT, \"Out of memory\");\n\n    v->u.number.r = malloc(string_length + 1);\n    if (v->u.number.r == NULL)\n    {\n        free(v);\n        RETURN_ERROR((context_t *) ctx, STATUS_ABORT, \"Out of memory\");\n    }\n    memcpy(v->u.number.r, string, string_length);\n    v->u.number.r[string_length] = 0;\n\n    v->u.number.flags = 0;\n\n    endptr = NULL;\n    errno = 0;\n    v->u.number.i = yajl_parse_integer((const unsigned char *) v->u.number.r,\n                                       strlen(v->u.number.r));\n    if ((errno == 0) && (endptr != NULL) && (*endptr == 0))\n        v->u.number.flags |= YAJL_NUMBER_INT_VALID;\n\n    endptr = NULL;\n    errno = 0;\n    v->u.number.d = strtod(v->u.number.r, &endptr);\n    if ((errno == 0) && (endptr != NULL) && (*endptr == 0))\n        v->u.number.flags |= YAJL_NUMBER_DOUBLE_VALID;\n\n    return ((context_add_value(ctx, v) == 0) ? STATUS_CONTINUE : STATUS_ABORT);\n}\n\nstatic int handle_start_map (void *ctx)\n{\n    yajl_val v;\n\n    v = value_alloc(yajl_t_object);\n    if (v == NULL)\n        RETURN_ERROR ((context_t *) ctx, STATUS_ABORT, \"Out of memory\");\n\n    v->u.object.keys = NULL;\n    v->u.object.values = NULL;\n    v->u.object.len = 0;\n\n    return ((context_push (ctx, v) == 0) ? STATUS_CONTINUE : STATUS_ABORT);\n}\n\nstatic int handle_end_map (void *ctx)\n{\n    yajl_val v;\n\n    v = context_pop (ctx);\n    if (v == NULL)\n        return (STATUS_ABORT);\n\n    return ((context_add_value (ctx, v) == 0) ? STATUS_CONTINUE : STATUS_ABORT);\n}\n\nstatic int handle_start_array (void *ctx)\n{\n    yajl_val v;\n\n    v = value_alloc(yajl_t_array);\n    if (v == NULL)\n        RETURN_ERROR ((context_t *) ctx, STATUS_ABORT, \"Out of memory\");\n\n    v->u.array.values = NULL;\n    v->u.array.len = 0;\n\n    return ((context_push (ctx, v) == 0) ? STATUS_CONTINUE : STATUS_ABORT);\n}\n\nstatic int handle_end_array (void *ctx)\n{\n    yajl_val v;\n\n    v = context_pop (ctx);\n    if (v == NULL)\n        return (STATUS_ABORT);\n\n    return ((context_add_value (ctx, v) == 0) ? STATUS_CONTINUE : STATUS_ABORT);\n}\n\nstatic int handle_boolean (void *ctx, int boolean_value)\n{\n    yajl_val v;\n\n    v = value_alloc (boolean_value ? yajl_t_true : yajl_t_false);\n    if (v == NULL)\n        RETURN_ERROR ((context_t *) ctx, STATUS_ABORT, \"Out of memory\");\n\n    return ((context_add_value (ctx, v) == 0) ? STATUS_CONTINUE : STATUS_ABORT);\n}\n\nstatic int handle_null (void *ctx)\n{\n    yajl_val v;\n\n    v = value_alloc (yajl_t_null);\n    if (v == NULL)\n        RETURN_ERROR ((context_t *) ctx, STATUS_ABORT, \"Out of memory\");\n\n    return ((context_add_value (ctx, v) == 0) ? STATUS_CONTINUE : STATUS_ABORT);\n}\n\n/*\n * Public functions\n */\nyajl_val yajl_tree_parse (const char *input,\n                          char *error_buffer, size_t error_buffer_size)\n{\n    static const yajl_callbacks callbacks =\n        {\n            /* null        = */ handle_null,\n            /* boolean     = */ handle_boolean,\n            /* integer     = */ NULL,\n            /* double      = */ NULL,\n            /* number      = */ handle_number,\n            /* string      = */ handle_string,\n            /* start map   = */ handle_start_map,\n            /* map key     = */ handle_string,\n            /* end map     = */ handle_end_map,\n            /* start array = */ handle_start_array,\n            /* end array   = */ handle_end_array\n        };\n\n    yajl_handle handle;\n    yajl_status status;\n\tcontext_t ctx = { NULL, NULL, NULL, 0 };\n\n\tctx.errbuf = error_buffer;\n\tctx.errbuf_size = error_buffer_size;\n\n    if (error_buffer != NULL)\n        memset (error_buffer, 0, error_buffer_size);\n\n    handle = yajl_alloc (&callbacks, NULL, &ctx);\n    yajl_config(handle, yajl_allow_comments, 1);\n\n    status = yajl_parse(handle,\n                        (unsigned char *) input,\n                        strlen (input));\n    status = yajl_complete_parse (handle);\n    if (status != yajl_status_ok) {\n        if (error_buffer != NULL && error_buffer_size > 0) {\n            snprintf(\n                error_buffer, error_buffer_size, \"%s\",\n                (char *) yajl_get_error(handle, 1,\n                                        (const unsigned char *) input,\n                                        strlen(input)));\n        }\n        yajl_free (handle);\n        return NULL;\n    }\n\n    yajl_free (handle);\n    return (ctx.root);\n}\n\nyajl_val yajl_tree_get(yajl_val n, const char ** path, yajl_type type)\n{\n    if (!path) return NULL;\n    while (n && *path) {\n        unsigned int i;\n\n        if (n->type != yajl_t_object) return NULL;\n        for (i = 0; i < n->u.object.len; i++) {\n            if (!strcmp(*path, n->u.object.keys[i])) {\n                n = n->u.object.values[i];\n                break;\n            }\n        }\n        if (i == n->u.object.len) return NULL;\n        path++;\n    }\n    if (n && type != yajl_t_any && type != n->type) n = NULL;\n    return n;\n}\n\nvoid yajl_tree_free (yajl_val v)\n{\n    if (v == NULL) return;\n\n    if (YAJL_IS_STRING(v))\n    {\n        free(v->u.string);\n        free(v);\n    }\n    else if (YAJL_IS_NUMBER(v))\n    {\n        free(v->u.number.r);\n        free(v);\n    }\n    else if (YAJL_GET_OBJECT(v))\n    {\n        yajl_object_free(v);\n    }\n    else if (YAJL_GET_ARRAY(v))\n    {\n        yajl_array_free(v);\n    }\n    else /* if (yajl_t_true or yajl_t_false or yajl_t_null) */\n    {\n        free(v);\n    }\n}\n"
  },
  {
    "path": "libuvccamera/src/main/jni/rapidjson/thirdparty/yajl/src/yajl_version.c",
    "content": "#include <yajl/yajl_version.h>\n\nint yajl_version(void)\n{\n\treturn YAJL_VERSION;\n}\n\n"
  },
  {
    "path": "libuvccamera/src/main/jni/utilbase.h",
    "content": "/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n * File name: utilbase.h\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n *\n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb, jin/libuvc, jni/rapidjson folder may have a different license, see the respective files.\n*/\n\n#ifndef UTILBASE_H_\n#define UTILBASE_H_\n\n#include <jni.h>\n#ifdef __ANDROID__\n#include <android/log.h>\n#endif\n#include <unistd.h>\n#include <libgen.h>\n#include \"localdefines.h\"\n\n#define\t\tSAFE_FREE(p)\t\t\t\t{ if (p) { free((p)); (p) = NULL; } }\n#define\t\tSAFE_DELETE(p)\t\t\t\t{ if (p) { delete (p); (p) = NULL; } }\n#define\t\tSAFE_DELETE_ARRAY(p)\t\t{ if (p) { delete [](p); (p) = NULL; } }\n#define\t\tNUM_ARRAY_ELEMENTS(p)\t\t((int) sizeof(p) / sizeof(p[0]))\n\n#if defined(__GNUC__)\n// the macro for branch prediction optimaization for gcc(-O2/-O3 required)\n#define\t\tCONDITION(cond)\t\t\t\t((__builtin_expect((cond)!=0, 0)))\n#define\t\tLIKELY(x)\t\t\t\t\t((__builtin_expect(!!(x), 1)))\t// x is likely true\n#define\t\tUNLIKELY(x)\t\t\t\t\t((__builtin_expect(!!(x), 0)))\t// x is likely false\n#else\n#define\t\tCONDITION(cond)\t\t\t\t((cond))\n#define\t\tLIKELY(x)\t\t\t\t\t((x))\n#define\t\tUNLIKELY(x)\t\t\t\t\t((x))\n#endif\n\n// XXX assertはNDEBUGが定義されていたら引数を含めて丸ごと削除されてしまうので\n// 関数実行を直接assertの引数にするとその関数はNDEBUGの時に実行されなくなるので注意\n#include <assert.h>\n#define CHECK(CONDITION) { bool RES = (CONDITION); assert(RES); }\n#define CHECK_EQ(X, Y) { bool RES = (X == Y); assert(RES); }\n#define CHECK_NE(X, Y) { bool RES = (X != Y); assert(RES); }\n#define CHECK_GE(X, Y) { bool RES = (X >= Y); assert(RES); }\n#define CHECK_GT(X, Y) { bool RES = (X > Y); assert(RES); }\n#define CHECK_LE(X, Y) { bool RES = (X <= Y); assert(RES); }\n#define CHECK_LT(X, Y) { bool RES = (X < Y); assert(RES); }\n\n#if defined(USE_LOGALL) && defined(__ANDROID__) && !defined(LOG_NDEBUG)\n\t#define LOGV(FMT, ...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, \"[%d*%s:%d:%s]:\" FMT,\t\\\n\t\t\t\t\t\t\tgettid(), basename(__FILE__), __LINE__, __FUNCTION__, ## __VA_ARGS__)\n\t#define LOGD(FMT, ...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, \"[%d*%s:%d:%s]:\" FMT,\t\\\n\t\t\t\t\t\t\tgettid(), basename(__FILE__), __LINE__, __FUNCTION__, ## __VA_ARGS__)\n\t#define LOGI(FMT, ...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, \"[%d*%s:%d:%s]:\" FMT,\t\\\n\t\t\t\t\t\t\tgettid(), basename(__FILE__), __LINE__, __FUNCTION__, ## __VA_ARGS__)\n\t#define LOGW(FMT, ...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, \"[%d*%s:%d:%s]:\" FMT,\t\\\n\t\t\t\t\t\t\tgettid(), basename(__FILE__), __LINE__, __FUNCTION__, ## __VA_ARGS__)\n\t#define LOGE(FMT, ...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, \"[%d*%s:%d:%s]:\" FMT,\t\\\n\t\t\t\t\t\t\tgettid(), basename(__FILE__), __LINE__, __FUNCTION__, ## __VA_ARGS__)\n\t#define LOGF(FMT, ...) __android_log_print(ANDROID_LOG_FATAL, LOG_TAG, \"[%d*%s:%d:%s]:\" FMT,\t\\\n\t\t\t\t\t\t\tgettid(), basename(__FILE__), __LINE__, __FUNCTION__, ## __VA_ARGS__)\n\t#define LOGV_IF(cond, ...) \\\n\t\t( (CONDITION(cond)) \\\n\t\t\t? LOGV(__VA_ARGS__) \\\n\t\t\t: (0) )\n\t#define LOGD_IF(cond, ...) \\\n\t\t( (CONDITION(cond)) \\\n\t\t\t? LOGD(__VA_ARGS__) \\\n\t\t\t: (0) )\n\t#define LOGI_IF(cond, ...) \\\n\t\t( (CONDITION(cond)) \\\n\t\t\t? LOGI(__VA_ARGS__) \\\n\t\t\t: (0) )\n\t#define LOGW_IF(cond, ...) \\\n\t\t( (CONDITION(cond)) \\\n\t\t\t? LOGW(__VA_ARGS__) \\\n\t\t\t: (0) )\n\t#define LOGE_IF(cond, ...) \\\n\t\t( (CONDITION(cond)) \\\n\t\t\t? LOGE(__VA_ARGS__) \\\n\t\t\t: (0) )\n\t#define LOGF_IF(cond, ...) \\\n\t\t( (CONDITION(cond)) \\\n\t\t\t? LOGF(__VA_ARGS__) \\\n\t\t\t: (0) )\n#else\n\t#if defined(USE_LOGV) && defined(__ANDROID__) && !defined(LOG_NDEBUG)\n\t\t#define LOGV(FMT, ...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, \"[%d*%s:%d:%s]:\" FMT,\t\\\n         \t \t \t \t \t \t gettid(), basename(__FILE__), __LINE__, __FUNCTION__, ## __VA_ARGS__)\n\t\t#define LOGV_IF(cond, ...) \\\n\t\t\t( (CONDITION(cond)) \\\n\t\t\t? LOGV(__VA_ARGS__) \\\n\t\t\t: (0) )\n\t\t#else\n\t\t#define LOGV(...)\n\t\t#define LOGV_IF(cond, ...)\n\t#endif\n\t#if defined(USE_LOGD) && defined(__ANDROID__) && !defined(LOG_NDEBUG)\n\t\t#define LOGD(FMT, ...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, \"[%d*%s:%d:%s]:\" FMT,\t\\\n         \t \t \t \t \t \t gettid(), basename(__FILE__), __LINE__, __FUNCTION__, ## __VA_ARGS__)\n\t\t#define LOGD_IF(cond, ...) \\\n\t\t\t( (CONDITION(cond)) \\\n\t\t\t? LOGD(__VA_ARGS__) \\\n\t\t\t: (0) )\n\t#else\n\t\t#define LOGD(...)\n\t\t#define LOGD_IF(cond, ...)\n\t#endif\n\t#if defined(USE_LOGI) && defined(__ANDROID__)\n\t\t#define LOGI(FMT, ...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, \"[%d*%s:%d:%s]:\" FMT,\t\\\n         \t \t \t \t \t \t gettid(), basename(__FILE__), __LINE__, __FUNCTION__, ## __VA_ARGS__)\n\t\t#define LOGI_IF(cond, ...) \\\n\t\t\t( (CONDITION(cond)) \\\n\t\t\t? LOGI(__VA_ARGS__) \\\n\t\t\t: (0) )\n\t#else\n\t\t#define LOGI(...)\n\t\t#define LOGI_IF(cond, ...)\n\t#endif\n\t#if defined(USE_LOGW) && defined(__ANDROID__)\n\t\t#define LOGW(FMT, ...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, \"[%d*%s:%d:%s]:\" FMT,\t\\\n         \t \t \t \t \t \t gettid(), basename(__FILE__), __LINE__, __FUNCTION__, ## __VA_ARGS__)\n\t\t#define LOGW_IF(cond, ...) \\\n\t\t\t( (CONDITION(cond)) \\\n\t\t\t? LOGW(__VA_ARGS__) \\\n\t\t\t: (0) )\n\t#else\n\t\t#define LOGW(...)\n\t\t#define LOGW_IF(cond, ...)\n\t#endif\n\t#if defined(USE_LOGE) && defined(__ANDROID__)\n\t\t#define LOGE(FMT, ...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, \"[%d*%s:%d:%s]:\" FMT,\t\\\n         \t \t \t \t \t \t gettid(), basename(__FILE__), __LINE__, __FUNCTION__, ## __VA_ARGS__)\n\t\t#define LOGE_IF(cond, ...) \\\n\t\t\t( (CONDITION(cond)) \\\n\t\t\t? LOGE(__VA_ARGS__) \\\n\t\t\t: (0) )\n\t#else\n\t\t#define LOGE(...)\n\t\t#define LOGE_IF(cond, ...)\n\t#endif\n\t#if defined(USE_LOGF) && defined(__ANDROID__)\n\t\t#define LOGF(FMT, ...) __android_log_print(ANDROID_LOG_FATAL, LOG_TAG, \"[%d*%s:%d:%s]:\" FMT,\t\\\n         \t \t \t \t \t \t gettid(), basename(__FILE__), __LINE__, __FUNCTION__, ## __VA_ARGS__)\n\t\t#define LOGF_IF(cond, ...) \\\n\t\t\t( (CONDITION(cond)) \\\n\t\t\t? LOGF(__VA_ARGS__) \\\n\t\t\t: (0) )\n\t#else\n\t\t#define LOGF(...)\n\t\t#define LOGF_IF(cond, ...)\n\t#endif\n#endif\n\n#ifndef\t\tLOG_ALWAYS_FATAL_IF\n#define\t\tLOG_ALWAYS_FATAL_IF(cond, ...) \\\n\t\t\t\t( (CONDITION(cond)) \\\n\t\t\t\t? ((void)__android_log_assert(#cond, LOG_TAG, ## __VA_ARGS__)) \\\n\t\t\t\t: (void)0 )\n#endif\n\n#ifndef\t\tLOG_ALWAYS_FATAL\n#define\t\tLOG_ALWAYS_FATAL(...) \\\n\t\t\t\t( ((void)__android_log_assert(NULL, LOG_TAG, ## __VA_ARGS__)) )\n#endif\n\n#ifndef\t\tLOG_ASSERT\n#define\t\tLOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__)\n#endif\n\n#ifdef LOG_NDEBUG\n\n#ifndef\t\tLOG_FATAL_IF\n#define\t\tLOG_FATAL_IF(cond, ...) ((void)0)\n#endif\n#ifndef\t\tLOG_FATAL\n#define\t\tLOG_FATAL(...) ((void)0)\n#endif\n\n#else\n\n#ifndef\t\tLOG_FATAL_IF\n#define\t\tLOG_FATAL_IF(cond, ...) LOG_ALWAYS_FATAL_IF(cond, ## __VA_ARGS__)\n#endif\n#ifndef\t\tLOG_FATAL\n#define\t\tLOG_FATAL(...) LOG_ALWAYS_FATAL(__VA_ARGS__)\n#endif\n\n#endif\n\n#define\t\tENTER()\t\t\t\tLOGD(\"begin\")\n#define\t\tRETURN(code,type)\t{type RESULT = code; LOGD(\"end (%d)\", (int)RESULT); return RESULT;}\n#define\t\tRET(code)\t\t\t{LOGD(\"end\"); return code;}\n#define\t\tEXIT()\t\t\t\t{LOGD(\"end\"); return;}\n#define\t\tPRE_EXIT()\t\t\tLOGD(\"end\")\n\n#if defined(__ANDROID__) && (defined(USE_LOGALL) || defined(USE_LOGI)) && !defined(LOG_NDEBUG)\n#define MARK(FMT, ...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, \"[%s:%d:%s]:\" FMT,\t\\\n\t\t\t\t\t\tbasename(__FILE__), __LINE__, __FUNCTION__, ## __VA_ARGS__)\n#else\n#define\t\tMARK(...)\n#endif\n\n#define LITERAL_TO_STRING_INTERNAL(x)    #x\n#define LITERAL_TO_STRING(x) LITERAL_TO_STRING_INTERNAL(x)\n\n#define TRESPASS() \\\n\t\tLOG_ALWAYS_FATAL(                                       \\\n\t\t\t__FILE__ \":\" LITERAL_TO_STRING(__LINE__)            \\\n\t\t\t\" Should not be here.\");\n\nvoid setVM(JavaVM *);\nJavaVM *getVM();\nJNIEnv *getEnv();\n\n#endif /* UTILBASE_H_ */\n"
  },
  {
    "path": "libuvccamera/src/main/res/layout/dialog_camera.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/LinearLayout1\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\"\n    android:paddingBottom=\"@dimen/vertical_margin\"\n    android:paddingLeft=\"@dimen/horizontal_margin\"\n    android:paddingRight=\"@dimen/horizontal_margin\"\n    android:paddingTop=\"@dimen/vertical_margin\"\n    tools:context=\"com.serenegiant.usb.CameraDialog\" >\n\n    <TextView\n        android:id=\"@+id/textView1\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/camera\" />\n\n    <Spinner\n        android:id=\"@+id/spinner1\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\" />\n\n    <TextView\n        android:id=\"@id/android:empty\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/no_device\" />\n\n</LinearLayout>"
  },
  {
    "path": "libuvccamera/src/main/res/layout/listitem_device.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<CheckedTextView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/name_text\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n\tandroid:minHeight=\"@dimen/list_height_min\"\n    android:textSize=\"@dimen/list_font_size\" >\n\n</CheckedTextView>"
  },
  {
    "path": "libuvccamera/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n\t<dimen name=\"horizontal_margin\">16dp</dimen>\n\t<dimen name=\"vertical_margin\">16dp</dimen>\n\t<dimen name=\"button_size\">48dp</dimen>\n    <dimen name=\"list_font_size\">18sp</dimen>\n    <dimen name=\"list_height_min\">32dp</dimen>\n</resources>\n"
  },
  {
    "path": "libuvccamera/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"select\">Select USB Web Camera</string>\n    <string name=\"camera\">Camera</string>\n    <string name=\"refresh\">Refresh</string>\n    <string name=\"no_device\">No USB camera found</string>\n</resources>\n"
  },
  {
    "path": "libuvccamera/src/main/res/values-ja/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"select\">USB Webカメラを選択してください</string>\n    <string name=\"camera\">カメラ</string>\n    <string name=\"refresh\">更新</string>\n    <string name=\"no_device\">USBカメラが見つかりません</string>\n</resources>\n"
  },
  {
    "path": "libuvccamera/src/main/res/xml/device_filter.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<usb>\n\t<usb-device class=\"239\" subclass=\"2\" />\t<!-- all device of UVC -->\n</usb>\n"
  },
  {
    "path": "settings.gradle",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\ninclude ':libuvccamera'\ninclude ':usbCameraCommon'\ninclude ':usbCameraTest'\ninclude ':usbCameraTest0'\ninclude ':usbCameraTest2'\ninclude ':usbCameraTest3'\ninclude ':usbCameraTest4'\ninclude ':usbCameraTest5'\ninclude ':usbCameraTest6'\ninclude ':usbCameraTest7'\ninclude ':usbCameraTest8'\n"
  },
  {
    "path": "usbCameraCommon/build.gradle",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\napply plugin: 'com.android.library'\n\nandroid {\n    compileSdkVersion versionCompiler\n   \tbuildToolsVersion versionBuildTool\n\n   \tcompileOptions {\n   \t\tsourceCompatibility javaSourceCompatibility\n   \t\ttargetCompatibility javaTargetCompatibility\n   \t}\n\n    defaultConfig {\n        minSdkVersion 18\n        targetSdkVersion versionTarget\n\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n\tapi fileTree(dir: 'libs', include: ['*.jar'])\n\n\timplementation \"com.android.support:support-v4:${supportLibVersion}\"\n\timplementation \"com.android.support:support-annotations:${supportLibVersion}\"\n\n\timplementation(\"com.serenegiant:common:${commonLibVersion}\") {\n   \t\texclude module: 'support-v4'\n   \t}\n\timplementation project(':libuvccamera')\n}\n"
  },
  {
    "path": "usbCameraCommon/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /Users/saki/android-sdks/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "usbCameraCommon/src/main/AndroidManifest.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<manifest package=\"com.serenegiant.usbcameracommon\"/>\n"
  },
  {
    "path": "usbCameraCommon/src/main/java/com/serenegiant/encoder/IAudioEncoder.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.encoder;\n\npublic interface IAudioEncoder {\n}\n"
  },
  {
    "path": "usbCameraCommon/src/main/java/com/serenegiant/encoder/IVideoEncoder.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.encoder;\n\npublic interface IVideoEncoder {\n\tpublic boolean frameAvailableSoon();\n}\n"
  },
  {
    "path": "usbCameraCommon/src/main/java/com/serenegiant/encoder/MediaAudioEncoder.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.encoder;\n\nimport java.io.IOException;\nimport java.nio.ByteBuffer;\nimport java.nio.ByteOrder;\n\nimport android.media.AudioFormat;\nimport android.media.AudioRecord;\nimport android.media.MediaCodec;\nimport android.media.MediaCodecInfo;\nimport android.media.MediaCodecList;\nimport android.media.MediaFormat;\nimport android.media.MediaRecorder;\nimport android.util.Log;\n\npublic class MediaAudioEncoder extends MediaEncoder implements IAudioEncoder {\n\tprivate static final boolean DEBUG = true;\t// TODO set false on release\n\tprivate static final String TAG = \"MediaAudioEncoder\";\n\n\tprivate static final String MIME_TYPE = \"audio/mp4a-latm\";\n    private static final int SAMPLE_RATE = 44100;\t// 44.1[KHz] is only setting guaranteed to be available on all devices.\n    private static final int BIT_RATE = 64000;\n\tpublic static final int SAMPLES_PER_FRAME = 1024;\t// AAC, bytes/frame/channel\n\tpublic static final int FRAMES_PER_BUFFER = 25; \t// AAC, frame/buffer/sec\n\n    private AudioThread mAudioThread = null;\n\n\tpublic MediaAudioEncoder(final MediaMuxerWrapper muxer, final MediaEncoderListener listener) {\n\t\tsuper(muxer, listener);\n\t}\n\n\t@Override\n\tprotected void prepare() throws IOException {\n\t\tif (DEBUG) Log.v(TAG, \"prepare:\");\n        mTrackIndex = -1;\n        mMuxerStarted = mIsEOS = false;\n        // prepare MediaCodec for AAC encoding of audio data from inernal mic.\n        final MediaCodecInfo audioCodecInfo = selectAudioCodec(MIME_TYPE);\n        if (audioCodecInfo == null) {\n            Log.e(TAG, \"Unable to find an appropriate codec for \" + MIME_TYPE);\n            return;\n        }\n\t\tif (DEBUG) Log.i(TAG, \"selected codec: \" + audioCodecInfo.getName());\n\n        final MediaFormat audioFormat = MediaFormat.createAudioFormat(MIME_TYPE, SAMPLE_RATE, 1);\n\t\taudioFormat.setInteger(MediaFormat.KEY_AAC_PROFILE, MediaCodecInfo.CodecProfileLevel.AACObjectLC);\n\t\taudioFormat.setInteger(MediaFormat.KEY_CHANNEL_MASK, AudioFormat.CHANNEL_IN_MONO);\n\t\taudioFormat.setInteger(MediaFormat.KEY_BIT_RATE, BIT_RATE);\n\t\taudioFormat.setInteger(MediaFormat.KEY_CHANNEL_COUNT, 1);\n//\t\taudioFormat.setLong(MediaFormat.KEY_MAX_INPUT_SIZE, inputFile.length());\n//      audioFormat.setLong(MediaFormat.KEY_DURATION, (long)durationInMs );\n\t\tif (DEBUG) Log.i(TAG, \"format: \" + audioFormat);\n        mMediaCodec = MediaCodec.createEncoderByType(MIME_TYPE);\n        mMediaCodec.configure(audioFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);\n        mMediaCodec.start();\n        if (DEBUG) Log.i(TAG, \"prepare finishing\");\n        if (mListener != null) {\n        \ttry {\n        \t\tmListener.onPrepared(this);\n        \t} catch (final Exception e) {\n        \t\tLog.e(TAG, \"prepare:\", e);\n        \t}\n        }\n\t}\n\n    @Override\n\tprotected void startRecording() {\n\t\tsuper.startRecording();\n\t\t// create and execute audio capturing thread using internal mic\n\t\tif (mAudioThread == null) {\n\t        mAudioThread = new AudioThread();\n\t\t\tmAudioThread.start();\n\t\t}\n\t}\n\n\t@Override\n    protected void release() {\n\t\tmAudioThread = null;\n\t\tsuper.release();\n    }\n\n\tprivate static final int[] AUDIO_SOURCES = new int[] {\n\t\tMediaRecorder.AudioSource.DEFAULT,\n\t\tMediaRecorder.AudioSource.MIC,\n\t\tMediaRecorder.AudioSource.CAMCORDER,\n\t};\n\n\t/**\n\t * Thread to capture audio data from internal mic as uncompressed 16bit PCM data\n\t * and write them to the MediaCodec encoder\n\t */\n    private class AudioThread extends Thread {\n    \t@Override\n    \tpublic void run() {\n\t\t\tandroid.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_AUDIO); // THREAD_PRIORITY_URGENT_AUDIO\n\t\t\tint cnt = 0;\n\t\t\tfinal int min_buffer_size = AudioRecord.getMinBufferSize(\n\t\t\t\tSAMPLE_RATE, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT);\n\t\t\tint buffer_size = SAMPLES_PER_FRAME * FRAMES_PER_BUFFER;\n\t\t\tif (buffer_size < min_buffer_size)\n\t\t\t\tbuffer_size = ((min_buffer_size / SAMPLES_PER_FRAME) + 1) * SAMPLES_PER_FRAME * 2;\n\t\t\tfinal ByteBuffer buf = ByteBuffer.allocateDirect(SAMPLES_PER_FRAME).order(ByteOrder.nativeOrder());\n\t\t\tAudioRecord audioRecord = null;\n\t\t\tfor (final int src: AUDIO_SOURCES) {\n\t\t\t\ttry {\n\t\t\t\t\taudioRecord = new AudioRecord(src,\n\t\t\t\t\t\tSAMPLE_RATE, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, buffer_size);\n\t\t\t\t\tif (audioRecord != null) {\n\t\t\t\t\t\tif (audioRecord.getState() != AudioRecord.STATE_INITIALIZED) {\n\t\t\t\t\t\t\taudioRecord.release();\n\t\t\t\t\t\t\taudioRecord = null;\n         \t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\taudioRecord = null;\n\t\t\t\t}\n\t\t\t\tif (audioRecord != null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (audioRecord != null) {\n\t\t\t\ttry {\n\t\t\t\t\tif (mIsCapturing) {\n\t\t\t\t\t\tif (DEBUG) Log.v(TAG, \"AudioThread:start audio recording\");\n\t\t\t\t\t\tint readBytes;\n\t\t\t\t\t\taudioRecord.startRecording();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tfor ( ; mIsCapturing && !mRequestStop && !mIsEOS ; ) {\n\t\t\t\t\t\t\t\t// read audio data from internal mic\n\t\t\t\t\t\t\t\tbuf.clear();\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\treadBytes = audioRecord.read(buf, SAMPLES_PER_FRAME);\n\t\t\t\t\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (readBytes > 0) {\n\t\t\t\t\t\t\t\t\t// set audio data to encoder\n\t\t\t\t\t\t\t\t\tbuf.position(readBytes);\n\t\t\t\t\t\t\t\t\tbuf.flip();\n\t\t\t\t\t\t\t\t\tencode(buf, readBytes, getPTSUs());\n\t\t\t\t\t\t\t\t\tframeAvailableSoon();\n\t\t\t\t\t\t\t\t\tcnt++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (cnt > 0) {\n\t\t\t\t\t\t\t\tframeAvailableSoon();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\taudioRecord.stop();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tLog.e(TAG, \"AudioThread#run\", e);\n\t\t\t\t} finally {\n\t\t\t\t\taudioRecord.release();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (cnt == 0) {\n\t\t\t\tfor (int i = 0; mIsCapturing && (i < 5); i++) {\n\t\t\t\t\tbuf.position(SAMPLES_PER_FRAME);\n\t\t\t\t\tbuf.flip();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tencode(buf, SAMPLES_PER_FRAME, getPTSUs());\n\t\t\t\t\t\tframeAvailableSoon();\n\t\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tsynchronized(this) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\twait(50);\n\t\t\t\t\t\t} catch (final InterruptedException e) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (DEBUG) Log.v(TAG, \"AudioThread:finished\");\n    \t}\n    }\n\n    /**\n     * select the first codec that match a specific MIME type\n     * @param mimeType\n     * @return\n     */\n    private static final MediaCodecInfo selectAudioCodec(final String mimeType) {\n    \tif (DEBUG) Log.v(TAG, \"selectAudioCodec:\");\n\n    \tMediaCodecInfo result = null;\n    \t// get the list of available codecs\n        final int numCodecs = MediaCodecList.getCodecCount();\nLOOP:\tfor (int i = 0; i < numCodecs; i++) {\n        \tfinal MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);\n            if (!codecInfo.isEncoder()) {\t// skipp decoder\n                continue;\n            }\n            final String[] types = codecInfo.getSupportedTypes();\n            for (int j = 0; j < types.length; j++) {\n            \tif (DEBUG) Log.i(TAG, \"supportedType:\" + codecInfo.getName() + \",MIME=\" + types[j]);\n                if (types[j].equalsIgnoreCase(mimeType)) {\n                \tif (result == null) {\n                \t\tresult = codecInfo;\n               \t\t\tbreak LOOP;\n                \t}\n                }\n            }\n        }\n   \t\treturn result;\n    }\n\n}\n"
  },
  {
    "path": "usbCameraCommon/src/main/java/com/serenegiant/encoder/MediaEncoder.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.encoder;\n\nimport java.io.IOException;\nimport java.lang.ref.WeakReference;\nimport java.nio.ByteBuffer;\n\nimport android.media.MediaCodec;\nimport android.media.MediaFormat;\nimport android.util.Log;\n\npublic abstract class MediaEncoder implements Runnable {\n\tprivate static final boolean DEBUG = true;\t// TODO set false on release\n\tprivate static final String TAG = \"MediaEncoder\";\n\n\tprotected static final int TIMEOUT_USEC = 10000;\t// 10[msec]\n\tprotected static final int MSG_FRAME_AVAILABLE = 1;\n\tprotected static final int MSG_STOP_RECORDING = 9;\n\n\tpublic interface MediaEncoderListener {\n\t\tpublic void onPrepared(MediaEncoder encoder);\n\t\tpublic void onStopped(MediaEncoder encoder);\n\t}\n\n\tprotected final Object mSync = new Object();\n\t/**\n\t * Flag that indicate this encoder is capturing now.\n\t */\n    protected volatile boolean mIsCapturing;\n\t/**\n\t * Flag that indicate the frame data will be available soon.\n\t */\n\tprivate int mRequestDrain;\n    /**\n     * Flag to request stop capturing\n     */\n    protected volatile boolean mRequestStop;\n    /**\n     * Flag that indicate encoder received EOS(End Of Stream)\n     */\n    protected boolean mIsEOS;\n    /**\n     * Flag the indicate the muxer is running\n     */\n    protected boolean mMuxerStarted;\n    /**\n     * Track Number\n     */\n    protected int mTrackIndex;\n    /**\n     * MediaCodec instance for encoding\n     */\n    protected MediaCodec mMediaCodec;\t\t\t\t// API >= 16(Android4.1.2)\n    /**\n     * Weak refarence of MediaMuxerWarapper instance\n     */\n    protected final WeakReference<MediaMuxerWrapper> mWeakMuxer;\n    /**\n     * BufferInfo instance for dequeuing\n     */\n    private MediaCodec.BufferInfo mBufferInfo;\t\t// API >= 16(Android4.1.2)\n\n    protected final MediaEncoderListener mListener;\n\n    public MediaEncoder(final MediaMuxerWrapper muxer, final MediaEncoderListener listener) {\n    \tif (listener == null) throw new NullPointerException(\"MediaEncoderListener is null\");\n    \tif (muxer == null) throw new NullPointerException(\"MediaMuxerWrapper is null\");\n\t\tmWeakMuxer = new WeakReference<MediaMuxerWrapper>(muxer);\n\t\tmuxer.addEncoder(this);\n\t\tmListener = listener;\n        synchronized (mSync) {\n            // create BufferInfo here for effectiveness(to reduce GC)\n            mBufferInfo = new MediaCodec.BufferInfo();\n            // wait for starting thread\n            new Thread(this, getClass().getSimpleName()).start();\n            try {\n            \tmSync.wait();\n            } catch (final InterruptedException e) {\n            }\n        }\n\t}\n\n    public String getOutputPath() {\n    \tfinal MediaMuxerWrapper muxer = mWeakMuxer.get();\n    \treturn muxer != null ? muxer.getOutputPath() : null;\n    }\n\n    /**\n     * the method to indicate frame data is soon available or already available\n     * @return return true if encoder is ready to encod.\n     */\n    public boolean frameAvailableSoon() {\n//    \tif (DEBUG) Log.v(TAG, \"frameAvailableSoon\");\n        synchronized (mSync) {\n            if (!mIsCapturing || mRequestStop) {\n                return false;\n            }\n            mRequestDrain++;\n            mSync.notifyAll();\n        }\n        return true;\n    }\n\n    /**\n     * encoding loop on private thread\n     */\n\t@Override\n\tpublic void run() {\n//\t\tandroid.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);\n        synchronized (mSync) {\n            mRequestStop = false;\n    \t\tmRequestDrain = 0;\n            mSync.notify();\n        }\n        final boolean isRunning = true;\n        boolean localRequestStop;\n        boolean localRequestDrain;\n        while (isRunning) {\n        \tsynchronized (mSync) {\n        \t\tlocalRequestStop = mRequestStop;\n        \t\tlocalRequestDrain = (mRequestDrain > 0);\n        \t\tif (localRequestDrain)\n        \t\t\tmRequestDrain--;\n        \t}\n\t        if (localRequestStop) {\n\t           \tdrain();\n\t           \t// request stop recording\n\t           \tsignalEndOfInputStream();\n\t           \t// process output data again for EOS signale\n\t           \tdrain();\n\t           \t// release all related objects\n\t           \trelease();\n\t           \tbreak;\n\t        }\n\t        if (localRequestDrain) {\n\t        \tdrain();\n\t        } else {\n\t        \tsynchronized (mSync) {\n\t\t        \ttry {\n\t\t\t\t\t\tmSync.wait();\n\t\t\t\t\t} catch (final InterruptedException e) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t        \t}\n        \t}\n        } // end of while\n\t\tif (DEBUG) Log.d(TAG, \"Encoder thread exiting\");\n        synchronized (mSync) {\n        \tmRequestStop = true;\n            mIsCapturing = false;\n        }\n\t}\n\n\t/*\n    * prepareing method for each sub class\n    * this method should be implemented in sub class, so set this as abstract method\n    * @throws IOException\n    */\n   /*package*/ abstract void prepare() throws IOException;\n\n\t/*package*/ void startRecording() {\n   \tif (DEBUG) Log.v(TAG, \"startRecording\");\n\t\tsynchronized (mSync) {\n\t\t\tmIsCapturing = true;\n\t\t\tmRequestStop = false;\n\t\t\tmSync.notifyAll();\n\t\t}\n\t}\n\n   /**\n    * the method to request stop encoding\n    */\n\t/*package*/ void stopRecording() {\n\t\tif (DEBUG) Log.v(TAG, \"stopRecording\");\n\t\tsynchronized (mSync) {\n\t\t\tif (!mIsCapturing || mRequestStop) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmRequestStop = true;\t// for rejecting newer frame\n\t\t\tmSync.notifyAll();\n\t        // We can not know when the encoding and writing finish.\n\t        // so we return immediately after request to avoid delay of caller thread\n\t\t}\n\t}\n\n//********************************************************************************\n//********************************************************************************\n    /**\n     * Release all releated objects\n     */\n    protected void release() {\n\t\tif (DEBUG) Log.d(TAG, \"release:\");\n\t\ttry {\n\t\t\tmListener.onStopped(this);\n\t\t} catch (final Exception e) {\n\t\t\tLog.e(TAG, \"failed onStopped\", e);\n\t\t}\n\t\tmIsCapturing = false;\n        if (mMediaCodec != null) {\n\t\t\ttry {\n\t            mMediaCodec.stop();\n\t            mMediaCodec.release();\n\t            mMediaCodec = null;\n\t\t\t} catch (final Exception e) {\n\t\t\t\tLog.e(TAG, \"failed releasing MediaCodec\", e);\n\t\t\t}\n        }\n        if (mMuxerStarted) {\n       \t\tfinal MediaMuxerWrapper muxer = mWeakMuxer.get();\n       \t\tif (muxer != null) {\n       \t\t\ttry {\n           \t\t\tmuxer.stop();\n    \t\t\t} catch (final Exception e) {\n    \t\t\t\tLog.e(TAG, \"failed stopping muxer\", e);\n    \t\t\t}\n       \t\t}\n        }\n        mBufferInfo = null;\n    }\n\n    protected void signalEndOfInputStream() {\n\t\tif (DEBUG) Log.d(TAG, \"sending EOS to encoder\");\n        // signalEndOfInputStream is only avairable for video encoding with surface\n        // and equivalent sending a empty buffer with BUFFER_FLAG_END_OF_STREAM flag.\n//\t\tmMediaCodec.signalEndOfInputStream();\t// API >= 18\n        encode((byte[])null, 0, getPTSUs());\n\t}\n\n    /**\n     * Method to set byte array to the MediaCodec encoder\n     * @param buffer\n     * @param length　length of byte array, zero means EOS.\n     * @param presentationTimeUs\n     */\n    @SuppressWarnings(\"deprecation\")\n\tprotected void encode(final byte[] buffer, final int length, final long presentationTimeUs) {\n//    \tif (DEBUG) Log.v(TAG, \"encode:buffer=\" + buffer);\n    \tif (!mIsCapturing) return;\n    \tint ix = 0, sz;\n        final ByteBuffer[] inputBuffers = mMediaCodec.getInputBuffers();\n        while (mIsCapturing && ix < length) {\n\t        final int inputBufferIndex = mMediaCodec.dequeueInputBuffer(TIMEOUT_USEC);\n\t        if (inputBufferIndex >= 0) {\n\t            final ByteBuffer inputBuffer = inputBuffers[inputBufferIndex];\n\t            inputBuffer.clear();\n\t            sz = inputBuffer.remaining();\n\t            sz = (ix + sz < length) ? sz : length - ix;\n\t            if (sz > 0 && (buffer != null)) {\n\t            \tinputBuffer.put(buffer, ix, sz);\n\t            }\n\t            ix += sz;\n//\t            if (DEBUG) Log.v(TAG, \"encode:queueInputBuffer\");\n\t            if (length <= 0) {\n\t            \t// send EOS\n\t            \tmIsEOS = true;\n\t            \tif (DEBUG) Log.i(TAG, \"send BUFFER_FLAG_END_OF_STREAM\");\n\t            \tmMediaCodec.queueInputBuffer(inputBufferIndex, 0, 0,\n\t            \t\tpresentationTimeUs, MediaCodec.BUFFER_FLAG_END_OF_STREAM);\n\t\t            break;\n\t            } else {\n\t            \tmMediaCodec.queueInputBuffer(inputBufferIndex, 0, sz,\n\t            \t\tpresentationTimeUs, 0);\n\t            }\n\t        } else if (inputBufferIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {\n\t        \t// wait for MediaCodec encoder is ready to encode\n\t        \t// nothing to do here because MediaCodec#dequeueInputBuffer(TIMEOUT_USEC)\n\t        \t// will wait for maximum TIMEOUT_USEC(10msec) on each call\n\t        }\n        }\n    }\n\n    /**\n     * Method to set ByteBuffer to the MediaCodec encoder\n     * @param buffer null means EOS\n     * @param presentationTimeUs\n     */\n    @SuppressWarnings(\"deprecation\")\n\tprotected void encode(final ByteBuffer buffer, final int length, final long presentationTimeUs) {\n//    \tif (DEBUG) Log.v(TAG, \"encode:buffer=\" + buffer);\n    \tif (!mIsCapturing) return;\n    \tint ix = 0, sz;\n        final ByteBuffer[] inputBuffers = mMediaCodec.getInputBuffers();\n        while (mIsCapturing && ix < length) {\n\t        final int inputBufferIndex = mMediaCodec.dequeueInputBuffer(TIMEOUT_USEC);\n\t        if (inputBufferIndex >= 0) {\n\t            final ByteBuffer inputBuffer = inputBuffers[inputBufferIndex];\n\t            inputBuffer.clear();\n\t            sz = inputBuffer.remaining();\n\t            sz = (ix + sz < length) ? sz : length - ix;\n\t            if (sz > 0 && (buffer != null)) {\n\t\t\t\t\tbuffer.position(ix + sz);\n\t\t\t\t\tbuffer.flip();\n\t            \tinputBuffer.put(buffer);\n\t            }\n\t            ix += sz;\n//\t            if (DEBUG) Log.v(TAG, \"encode:queueInputBuffer\");\n\t            if (length <= 0) {\n\t            \t// send EOS\n\t            \tmIsEOS = true;\n\t            \tif (DEBUG) Log.i(TAG, \"send BUFFER_FLAG_END_OF_STREAM\");\n\t            \tmMediaCodec.queueInputBuffer(inputBufferIndex, 0, 0,\n\t            \t\tpresentationTimeUs, MediaCodec.BUFFER_FLAG_END_OF_STREAM);\n\t\t            break;\n\t            } else {\n\t            \tmMediaCodec.queueInputBuffer(inputBufferIndex, 0, sz,\n\t            \t\tpresentationTimeUs, 0);\n\t            }\n\t        } else if (inputBufferIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {\n\t        \t// wait for MediaCodec encoder is ready to encode\n\t        \t// nothing to do here because MediaCodec#dequeueInputBuffer(TIMEOUT_USEC)\n\t        \t// will wait for maximum TIMEOUT_USEC(10msec) on each call\n\t        }\n        }\n    }\n\n    /**\n     * drain encoded data and write them to muxer\n     */\n    @SuppressWarnings(\"deprecation\")\n\tprotected void drain() {\n    \tif (mMediaCodec == null) return;\n        ByteBuffer[] encoderOutputBuffers = mMediaCodec.getOutputBuffers();\n        int encoderStatus, count = 0;\n        final MediaMuxerWrapper muxer = mWeakMuxer.get();\n        if (muxer == null) {\n//        \tthrow new NullPointerException(\"muxer is unexpectedly null\");\n        \tLog.w(TAG, \"muxer is unexpectedly null\");\n        \treturn;\n        }\nLOOP:\twhile (mIsCapturing) {\n\t\t\t// get encoded data with maximum timeout duration of TIMEOUT_USEC(=10[msec])\n            encoderStatus = mMediaCodec.dequeueOutputBuffer(mBufferInfo, TIMEOUT_USEC);\n            if (encoderStatus == MediaCodec.INFO_TRY_AGAIN_LATER) {\n                // wait 5 counts(=TIMEOUT_USEC x 5 = 50msec) until data/EOS come\n                if (!mIsEOS) {\n                \tif (++count > 5)\n                \t\tbreak LOOP;\t\t// out of while\n                }\n            } else if (encoderStatus == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {\n            \tif (DEBUG) Log.v(TAG, \"INFO_OUTPUT_BUFFERS_CHANGED\");\n                // this shoud not come when encoding\n                encoderOutputBuffers = mMediaCodec.getOutputBuffers();\n            } else if (encoderStatus == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {\n            \tif (DEBUG) Log.v(TAG, \"INFO_OUTPUT_FORMAT_CHANGED\");\n            \t// this status indicate the output format of codec is changed\n                // this should come only once before actual encoded data\n            \t// but this status never come on Android4.3 or less\n            \t// and in that case, you should treat when MediaCodec.BUFFER_FLAG_CODEC_CONFIG come.\n                if (mMuxerStarted) {\t// second time request is error\n                    throw new RuntimeException(\"format changed twice\");\n                }\n\t\t\t\t// get output format from codec and pass them to muxer\n\t\t\t\t// getOutputFormat should be called after INFO_OUTPUT_FORMAT_CHANGED otherwise crash.\n                final MediaFormat format = mMediaCodec.getOutputFormat(); // API >= 16\n               \tmTrackIndex = muxer.addTrack(format);\n               \tmMuxerStarted = true;\n               \tif (!muxer.start()) {\n               \t\t// we should wait until muxer is ready\n               \t\tsynchronized (muxer) {\n\t               \t\twhile (!muxer.isStarted())\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmuxer.wait(100);\n\t\t\t\t\t\t} catch (final InterruptedException e) {\n\t\t\t\t\t\t\tbreak LOOP;\n\t\t\t\t\t\t}\n               \t\t}\n               \t}\n            } else if (encoderStatus < 0) {\n            \t// unexpected status\n            \tif (DEBUG) Log.w(TAG, \"drain:unexpected result from encoder#dequeueOutputBuffer: \" + encoderStatus);\n            } else {\n                final ByteBuffer encodedData = encoderOutputBuffers[encoderStatus];\n                if (encodedData == null) {\n                \t// this never should come...may be a MediaCodec internal error\n                    throw new RuntimeException(\"encoderOutputBuffer \" + encoderStatus + \" was null\");\n                }\n                if ((mBufferInfo.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) != 0) {\n                \t// You shoud set output format to muxer here when you target Android4.3 or less\n                \t// but MediaCodec#getOutputFormat can not call here(because INFO_OUTPUT_FORMAT_CHANGED don't come yet)\n                \t// therefor we should expand and prepare output format from buffer data.\n                \t// This sample is for API>=18(>=Android 4.3), just ignore this flag here\n\t\t\t\t\tif (DEBUG) Log.d(TAG, \"drain:BUFFER_FLAG_CODEC_CONFIG\");\n\t\t\t\t\tmBufferInfo.size = 0;\n                }\n\n                if (mBufferInfo.size != 0) {\n                \t// encoded data is ready, clear waiting counter\n            \t\tcount = 0;\n                    if (!mMuxerStarted) {\n                    \t// muxer is not ready...this will prrograming failure.\n                        throw new RuntimeException(\"drain:muxer hasn't started\");\n                    }\n                    // write encoded data to muxer(need to adjust presentationTimeUs.\n                   \tmBufferInfo.presentationTimeUs = getPTSUs();\n                   \tmuxer.writeSampleData(mTrackIndex, encodedData, mBufferInfo);\n\t\t\t\t\tprevOutputPTSUs = mBufferInfo.presentationTimeUs;\n                }\n                // return buffer to encoder\n                mMediaCodec.releaseOutputBuffer(encoderStatus, false);\n                if ((mBufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {\n                \t// when EOS come.\n               \t\tmMuxerStarted = mIsCapturing = false;\n                    break;      // out of while\n                }\n            }\n        }\n    }\n\n    /**\n     * previous presentationTimeUs for writing\n     */\n\tprivate long prevOutputPTSUs = 0;\n\t/**\n\t * get next encoding presentationTimeUs\n\t * @return\n\t */\n    protected long getPTSUs() {\n\t\tlong result = System.nanoTime() / 1000L;\n\t\t// presentationTimeUs should be monotonic\n\t\t// otherwise muxer fail to write\n\t\tif (result < prevOutputPTSUs)\n\t\t\tresult = (prevOutputPTSUs - result) + result;\n\t\treturn result;\n    }\n\n}\n"
  },
  {
    "path": "usbCameraCommon/src/main/java/com/serenegiant/encoder/MediaMuxerWrapper.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.encoder;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.nio.ByteBuffer;\nimport java.text.SimpleDateFormat;\nimport java.util.GregorianCalendar;\nimport java.util.Locale;\n\nimport android.media.MediaCodec;\nimport android.media.MediaFormat;\nimport android.media.MediaMuxer;\nimport android.os.Environment;\nimport android.text.TextUtils;\nimport android.util.Log;\n\npublic class MediaMuxerWrapper {\n\tprivate static final boolean DEBUG = true;\t// TODO set false on release\n\tprivate static final String TAG = \"MediaMuxerWrapper\";\n\n\tprivate static final String DIR_NAME = \"USBCameraTest\";\n    private static final SimpleDateFormat mDateTimeFormat = new SimpleDateFormat(\"yyyy-MM-dd-HH-mm-ss\", Locale.US);\n\n\tprivate String mOutputPath;\n\tprivate final MediaMuxer mMediaMuxer;\t// API >= 18\n\tprivate int mEncoderCount, mStatredCount;\n\tprivate boolean mIsStarted;\n\tprivate MediaEncoder mVideoEncoder, mAudioEncoder;\n\n\t/**\n\t * Constructor\n\t * @param ext extension of output file\n\t * @throws IOException\n\t */\n\tpublic MediaMuxerWrapper(String ext) throws IOException {\n\t\tif (TextUtils.isEmpty(ext)) ext = \".mp4\";\n\t\ttry {\n\t\t\tmOutputPath = getCaptureFile(Environment.DIRECTORY_MOVIES, ext).toString();\n\t\t} catch (final NullPointerException e) {\n\t\t\tthrow new RuntimeException(\"This app has no permission of writing external storage\");\n\t\t}\n\t\tmMediaMuxer = new MediaMuxer(mOutputPath, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);\n\t\tmEncoderCount = mStatredCount = 0;\n\t\tmIsStarted = false;\n\t}\n\n\tpublic String getOutputPath() {\n\t\treturn mOutputPath;\n\t}\n\n\tpublic void prepare() throws IOException {\n\t\tif (mVideoEncoder != null)\n\t\t\tmVideoEncoder.prepare();\n\t\tif (mAudioEncoder != null)\n\t\t\tmAudioEncoder.prepare();\n\t}\n\n\tpublic void startRecording() {\n\t\tif (mVideoEncoder != null)\n\t\t\tmVideoEncoder.startRecording();\n\t\tif (mAudioEncoder != null)\n\t\t\tmAudioEncoder.startRecording();\n\t}\n\n\tpublic void stopRecording() {\n\t\tif (mVideoEncoder != null)\n\t\t\tmVideoEncoder.stopRecording();\n\t\tmVideoEncoder = null;\n\t\tif (mAudioEncoder != null)\n\t\t\tmAudioEncoder.stopRecording();\n\t\tmAudioEncoder = null;\n\t}\n\n\tpublic synchronized boolean isStarted() {\n\t\treturn mIsStarted;\n\t}\n\n//**********************************************************************\n//**********************************************************************\n\t/**\n\t * assign encoder to this calss. this is called from encoder.\n\t * @param encoder instance of MediaVideoEncoder or MediaAudioEncoder\n\t */\n\t/*package*/ void addEncoder(final MediaEncoder encoder) {\n\t\tif (encoder instanceof MediaVideoEncoder) {\n\t\t\tif (mVideoEncoder != null)\n\t\t\t\tthrow new IllegalArgumentException(\"Video encoder already added.\");\n\t\t\tmVideoEncoder = encoder;\n\t\t} else if (encoder instanceof MediaSurfaceEncoder) {\n\t\t\t\tif (mVideoEncoder != null)\n\t\t\t\t\tthrow new IllegalArgumentException(\"Video encoder already added.\");\n\t\t\t\tmVideoEncoder = encoder;\n\t\t} else if (encoder instanceof MediaVideoBufferEncoder) {\n\t\t\tif (mVideoEncoder != null)\n\t\t\t\tthrow new IllegalArgumentException(\"Video encoder already added.\");\n\t\t\tmVideoEncoder = encoder;\n\t\t} else if (encoder instanceof MediaAudioEncoder) {\n\t\t\tif (mAudioEncoder != null)\n\t\t\t\tthrow new IllegalArgumentException(\"Video encoder already added.\");\n\t\t\tmAudioEncoder = encoder;\n\t\t} else\n\t\t\tthrow new IllegalArgumentException(\"unsupported encoder\");\n\t\tmEncoderCount = (mVideoEncoder != null ? 1 : 0) + (mAudioEncoder != null ? 1 : 0);\n\t}\n\n\t/**\n\t * request start recording from encoder\n\t * @return true when muxer is ready to write\n\t */\n\t/*package*/ synchronized boolean start() {\n\t\tif (DEBUG) Log.v(TAG,  \"start:\");\n\t\tmStatredCount++;\n\t\tif ((mEncoderCount > 0) && (mStatredCount == mEncoderCount)) {\n\t\t\tmMediaMuxer.start();\n\t\t\tmIsStarted = true;\n\t\t\tnotifyAll();\n\t\t\tif (DEBUG) Log.v(TAG,  \"MediaMuxer started:\");\n\t\t}\n\t\treturn mIsStarted;\n\t}\n\n\t/**\n\t * request stop recording from encoder when encoder received EOS\n\t*/\n\t/*package*/ synchronized void stop() {\n\t\tif (DEBUG) Log.v(TAG,  \"stop:mStatredCount=\" + mStatredCount);\n\t\tmStatredCount--;\n\t\tif ((mEncoderCount > 0) && (mStatredCount <= 0)) {\n\t\t\ttry {\n\t\t\t\tmMediaMuxer.stop();\n\t\t\t} catch (final Exception e) {\n\t\t\t\tLog.w(TAG, e);\n\t\t\t}\n\t\t\tmIsStarted = false;\n\t\t\tif (DEBUG) Log.v(TAG,  \"MediaMuxer stopped:\");\n\t\t}\n\t}\n\n\t/**\n\t * assign encoder to muxer\n\t * @param format\n\t * @return minus value indicate error\n\t */\n\t/*package*/ synchronized int addTrack(final MediaFormat format) {\n\t\tif (mIsStarted)\n\t\t\tthrow new IllegalStateException(\"muxer already started\");\n\t\tfinal int trackIx = mMediaMuxer.addTrack(format);\n\t\tif (DEBUG) Log.i(TAG, \"addTrack:trackNum=\" + mEncoderCount + \",trackIx=\" + trackIx + \",format=\" + format);\n\t\treturn trackIx;\n\t}\n\n\t/**\n\t * write encoded data to muxer\n\t * @param trackIndex\n\t * @param byteBuf\n\t * @param bufferInfo\n\t */\n\t/*package*/ synchronized void writeSampleData(final int trackIndex, final ByteBuffer byteBuf, final MediaCodec.BufferInfo bufferInfo) {\n\t\tif (mStatredCount > 0)\n\t\t\tmMediaMuxer.writeSampleData(trackIndex, byteBuf, bufferInfo);\n\t}\n\n//**********************************************************************\n//**********************************************************************\n    /**\n     * generate output file\n     * @param type Environment.DIRECTORY_MOVIES / Environment.DIRECTORY_DCIM etc.\n     * @param ext .mp4(.m4a for audio) or .png\n     * @return return null when this app has no writing permission to external storage.\n     */\n    public static final File getCaptureFile(final String type, final String ext) {\n\t\tfinal File dir = new File(Environment.getExternalStoragePublicDirectory(type), DIR_NAME);\n\t\tLog.d(TAG, \"path=\" + dir.toString());\n\t\tdir.mkdirs();\n        if (dir.canWrite()) {\n        \treturn new File(dir, getDateTimeString() + ext);\n        }\n    \treturn null;\n    }\n\n    /**\n     * get current date and time as String\n     * @return\n     */\n    private static final String getDateTimeString() {\n    \tfinal GregorianCalendar now = new GregorianCalendar();\n    \treturn mDateTimeFormat.format(now.getTime());\n    }\n\n}\n"
  },
  {
    "path": "usbCameraCommon/src/main/java/com/serenegiant/encoder/MediaSurfaceEncoder.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.encoder;\n\nimport java.io.IOException;\n\nimport android.media.MediaCodec;\nimport android.media.MediaCodecInfo;\nimport android.media.MediaCodecList;\nimport android.media.MediaFormat;\nimport android.util.Log;\nimport android.view.Surface;\n\npublic class MediaSurfaceEncoder extends MediaEncoder implements IVideoEncoder {\n\tprivate static final boolean DEBUG = true;\t// TODO set false on release\n\tprivate static final String TAG = \"MediaSurfaceEncoder\";\n\n\tprivate static final String MIME_TYPE = \"video/avc\";\n\t// parameters for recording\n\tprivate final int mWidth, mHeight;\n    private static final int FRAME_RATE = 15;\n    private static final float BPP = 0.50f;\n\n    private Surface mSurface;\n\n\tpublic MediaSurfaceEncoder(final MediaMuxerWrapper muxer, final int width, final int height, final MediaEncoderListener listener) {\n\t\tsuper(muxer, listener);\n\t\tif (DEBUG) Log.i(TAG, \"MediaVideoEncoder: \");\n\t\tmWidth = width;\n\t\tmHeight = height;\n\t}\n\n\t/**\n\t* Returns the encoder's input surface.\n\t*/\n\tpublic Surface getInputSurface() {\n\t\treturn mSurface;\n\t}\n\n\t@Override\n\tprotected void prepare() throws IOException {\n\t\tif (DEBUG) Log.i(TAG, \"prepare: \");\n        mTrackIndex = -1;\n        mMuxerStarted = mIsEOS = false;\n\n        final MediaCodecInfo videoCodecInfo = selectVideoCodec(MIME_TYPE);\n        if (videoCodecInfo == null) {\n            Log.e(TAG, \"Unable to find an appropriate codec for \" + MIME_TYPE);\n            return;\n        }\n\t\tif (DEBUG) Log.i(TAG, \"selected codec: \" + videoCodecInfo.getName());\n\n        final MediaFormat format = MediaFormat.createVideoFormat(MIME_TYPE, mWidth, mHeight);\n        format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);\t// API >= 18\n        format.setInteger(MediaFormat.KEY_BIT_RATE, calcBitRate());\n        format.setInteger(MediaFormat.KEY_FRAME_RATE, FRAME_RATE);\n        format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 10);\n\t\tif (DEBUG) Log.i(TAG, \"format: \" + format);\n\n        mMediaCodec = MediaCodec.createEncoderByType(MIME_TYPE);\n        mMediaCodec.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);\n        // get Surface for encoder input\n        // this method only can call between #configure and #start\n        mSurface = mMediaCodec.createInputSurface();\t// API >= 18\n        mMediaCodec.start();\n        if (DEBUG) Log.i(TAG, \"prepare finishing\");\n        if (mListener != null) {\n        \ttry {\n        \t\tmListener.onPrepared(this);\n        \t} catch (final Exception e) {\n        \t\tLog.e(TAG, \"prepare:\", e);\n        \t}\n        }\n\t}\n\n\t@Override\n    protected void release() {\n\t\tif (DEBUG) Log.i(TAG, \"release:\");\n\t\tif (mSurface != null) {\n\t\t\tmSurface.release();\n\t\t\tmSurface = null;\n\t\t}\n\t\tsuper.release();\n\t}\n\n\tprivate int calcBitRate() {\n\t\tfinal int bitrate = (int)(BPP * FRAME_RATE * mWidth * mHeight);\n\t\tLog.i(TAG, String.format(\"bitrate=%5.2f[Mbps]\", bitrate / 1024f / 1024f));\n\t\treturn bitrate;\n\t}\n\n    /**\n     * select the first codec that match a specific MIME type\n     * @param mimeType\n     * @return null if no codec matched\n     */\n    protected static final MediaCodecInfo selectVideoCodec(final String mimeType) {\n    \tif (DEBUG) Log.v(TAG, \"selectVideoCodec:\");\n\n    \t// get the list of available codecs\n        final int numCodecs = MediaCodecList.getCodecCount();\n        for (int i = 0; i < numCodecs; i++) {\n        \tfinal MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);\n\n            if (!codecInfo.isEncoder()) {\t// skipp decoder\n                continue;\n            }\n            // select first codec that match a specific MIME type and color format\n            final String[] types = codecInfo.getSupportedTypes();\n            for (int j = 0; j < types.length; j++) {\n                if (types[j].equalsIgnoreCase(mimeType)) {\n                \tif (DEBUG) Log.i(TAG, \"codec:\" + codecInfo.getName() + \",MIME=\" + types[j]);\n            \t\tfinal int format = selectColorFormat(codecInfo, mimeType);\n                \tif (format > 0) {\n                \t\treturn codecInfo;\n                \t}\n                }\n            }\n        }\n        return null;\n    }\n\n    /**\n     * select color format available on specific codec and we can use.\n     * @return 0 if no colorFormat is matched\n     */\n    protected static final int selectColorFormat(final MediaCodecInfo codecInfo, final String mimeType) {\n\t\tif (DEBUG) Log.i(TAG, \"selectColorFormat: \");\n    \tint result = 0;\n    \tfinal MediaCodecInfo.CodecCapabilities caps;\n    \ttry {\n    \t\tThread.currentThread().setPriority(Thread.MAX_PRIORITY);\n    \t\tcaps = codecInfo.getCapabilitiesForType(mimeType);\n    \t} finally {\n    \t\tThread.currentThread().setPriority(Thread.NORM_PRIORITY);\n    \t}\n        int colorFormat;\n        for (int i = 0; i < caps.colorFormats.length; i++) {\n        \tcolorFormat = caps.colorFormats[i];\n            if (isRecognizedVideoFormat(colorFormat)) {\n            \tif (result == 0)\n            \t\tresult = colorFormat;\n                break;\n            }\n        }\n        if (result == 0)\n        \tLog.e(TAG, \"couldn't find a good color format for \" + codecInfo.getName() + \" / \" + mimeType);\n        return result;\n    }\n\n\t/**\n\t * color formats that we can use in this class\n\t */\n    protected static int[] recognizedFormats;\n\tstatic {\n\t\trecognizedFormats = new int[] {\n//        \tMediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar,\n//        \tMediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar,\n//        \tMediaCodecInfo.CodecCapabilities.COLOR_QCOM_FormatYUV420SemiPlanar,\n        \tMediaCodecInfo.CodecCapabilities.COLOR_FormatSurface,\n\t\t};\n\t}\n\n    private static final boolean isRecognizedVideoFormat(final int colorFormat) {\n\t\tif (DEBUG) Log.i(TAG, \"isRecognizedVideoFormat:colorFormat=\" + colorFormat);\n    \tfinal int n = recognizedFormats != null ? recognizedFormats.length : 0;\n    \tfor (int i = 0; i < n; i++) {\n    \t\tif (recognizedFormats[i] == colorFormat) {\n    \t\t\treturn true;\n    \t\t}\n    \t}\n    \treturn false;\n    }\n\n}\n"
  },
  {
    "path": "usbCameraCommon/src/main/java/com/serenegiant/encoder/MediaVideoBufferEncoder.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.encoder;\n\nimport java.io.IOException;\nimport java.nio.ByteBuffer;\n\nimport android.annotation.TargetApi;\nimport android.media.MediaCodec;\nimport android.media.MediaCodecInfo;\nimport android.media.MediaCodecList;\nimport android.media.MediaFormat;\nimport android.util.Log;\n\n/**\n * This class receives video images as ByteBuffer(strongly recommend direct ByteBuffer) as NV21(YUV420SP)\n * and encode them to h.264.\n * If you use this directly with IFrameCallback, you should know UVCCamera and it backend native libraries\n * never execute color space conversion. This means that color tone of resulted movie will be different\n * from that you expected/can see on screen.\n */\npublic class MediaVideoBufferEncoder extends MediaEncoder implements IVideoEncoder {\n\tprivate static final boolean DEBUG = true;\t// TODO set false on release\n\tprivate static final String TAG = \"MediaVideoBufferEncoder\";\n\n\tprivate static final String MIME_TYPE = \"video/avc\";\n\t// parameters for recording\n    private static final int FRAME_RATE = 15;\n    private static final float BPP = 0.50f;\n\n\tprivate final int mWidth, mHeight;\n    protected int mColorFormat;\n\n\tpublic MediaVideoBufferEncoder(final MediaMuxerWrapper muxer, final int width, final int height, final MediaEncoderListener listener) {\n\t\tsuper(muxer, listener);\n\t\tif (DEBUG) Log.i(TAG, \"MediaVideoEncoder: \");\n\t\tmWidth = width;\n\t\tmHeight = height;\n\t}\n\n\tpublic void encode(final ByteBuffer buffer) {\n//    \tif (DEBUG) Log.v(TAG, \"encode:buffer=\" + buffer);\n\t\tsynchronized (mSync) {\n\t\t\tif (!mIsCapturing || mRequestStop) return;\n\t\t}\n\t\tencode(buffer, buffer.capacity(), getPTSUs());\n    }\n\n\t@Override\n\tprotected void prepare() throws IOException {\n\t\tif (DEBUG) Log.i(TAG, \"prepare: \");\n        mTrackIndex = -1;\n        mMuxerStarted = mIsEOS = false;\n\n        final MediaCodecInfo videoCodecInfo = selectVideoCodec(MIME_TYPE);\n        if (videoCodecInfo == null) {\n            Log.e(TAG, \"Unable to find an appropriate codec for \" + MIME_TYPE);\n            return;\n        }\n\t\tif (DEBUG) Log.i(TAG, \"selected codec: \" + videoCodecInfo.getName());\n\n        final MediaFormat format = MediaFormat.createVideoFormat(MIME_TYPE, mWidth, mHeight);\n        format.setInteger(MediaFormat.KEY_COLOR_FORMAT, mColorFormat);\n        format.setInteger(MediaFormat.KEY_BIT_RATE, calcBitRate());\n        format.setInteger(MediaFormat.KEY_FRAME_RATE, FRAME_RATE);\n        format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 10);\n\t\tif (DEBUG) Log.i(TAG, \"format: \" + format);\n\n        mMediaCodec = MediaCodec.createEncoderByType(MIME_TYPE);\n        mMediaCodec.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);\n        mMediaCodec.start();\n        if (DEBUG) Log.i(TAG, \"prepare finishing\");\n        if (mListener != null) {\n        \ttry {\n        \t\tmListener.onPrepared(this);\n        \t} catch (final Exception e) {\n        \t\tLog.e(TAG, \"prepare:\", e);\n        \t}\n        }\n\t}\n\n\tprivate int calcBitRate() {\n\t\tfinal int bitrate = (int)(BPP * FRAME_RATE * mWidth * mHeight);\n\t\tLog.i(TAG, String.format(\"bitrate=%5.2f[Mbps]\", bitrate / 1024f / 1024f));\n\t\treturn bitrate;\n\t}\n\n    /**\n     * select the first codec that match a specific MIME type\n     * @param mimeType\n     * @return null if no codec matched\n     */\n    @SuppressWarnings(\"deprecation\")\n\tprotected final MediaCodecInfo selectVideoCodec(final String mimeType) {\n    \tif (DEBUG) Log.v(TAG, \"selectVideoCodec:\");\n\n    \t// get the list of available codecs\n        final int numCodecs = MediaCodecList.getCodecCount();\n        for (int i = 0; i < numCodecs; i++) {\n        \tfinal MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);\n\n            if (!codecInfo.isEncoder()) {\t// skipp decoder\n                continue;\n            }\n            // select first codec that match a specific MIME type and color format\n            final String[] types = codecInfo.getSupportedTypes();\n            for (int j = 0; j < types.length; j++) {\n                if (types[j].equalsIgnoreCase(mimeType)) {\n                \tif (DEBUG) Log.i(TAG, \"codec:\" + codecInfo.getName() + \",MIME=\" + types[j]);\n            \t\tfinal int format = selectColorFormat(codecInfo, mimeType);\n                \tif (format > 0) {\n                \t\tmColorFormat = format;\n                \t\treturn codecInfo;\n                \t}\n                }\n            }\n        }\n        return null;\n    }\n\n    /**\n     * select color format available on specific codec and we can use.\n     * @return 0 if no colorFormat is matched\n     */\n    protected static final int selectColorFormat(final MediaCodecInfo codecInfo, final String mimeType) {\n\t\tif (DEBUG) Log.i(TAG, \"selectColorFormat: \");\n    \tint result = 0;\n    \tfinal MediaCodecInfo.CodecCapabilities caps;\n    \ttry {\n    \t\tThread.currentThread().setPriority(Thread.MAX_PRIORITY);\n    \t\tcaps = codecInfo.getCapabilitiesForType(mimeType);\n    \t} finally {\n    \t\tThread.currentThread().setPriority(Thread.NORM_PRIORITY);\n    \t}\n        int colorFormat;\n        for (int i = 0; i < caps.colorFormats.length; i++) {\n        \tcolorFormat = caps.colorFormats[i];\n            if (isRecognizedViewoFormat(colorFormat)) {\n            \tif (result == 0)\n            \t\tresult = colorFormat;\n                break;\n            }\n        }\n        if (result == 0)\n        \tLog.e(TAG, \"couldn't find a good color format for \" + codecInfo.getName() + \" / \" + mimeType);\n        return result;\n    }\n\n\t/**\n\t * color formats that we can use in this class\n\t */\n    protected static int[] recognizedFormats;\n\tstatic {\n\t\trecognizedFormats = new int[] {\n//        \tMediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar,\n        \tMediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar,\n        \tMediaCodecInfo.CodecCapabilities.COLOR_QCOM_FormatYUV420SemiPlanar,\n//        \tMediaCodecInfo.CodecCapabilities.COLOR_FormatSurface,\n\t\t};\n\t}\n\n    private static final boolean isRecognizedViewoFormat(final int colorFormat) {\n\t\tif (DEBUG) Log.i(TAG, \"isRecognizedViewoFormat:colorFormat=\" + colorFormat);\n    \tfinal int n = recognizedFormats != null ? recognizedFormats.length : 0;\n    \tfor (int i = 0; i < n; i++) {\n    \t\tif (recognizedFormats[i] == colorFormat) {\n    \t\t\treturn true;\n    \t\t}\n    \t}\n    \treturn false;\n    }\n\n}\n"
  },
  {
    "path": "usbCameraCommon/src/main/java/com/serenegiant/encoder/MediaVideoEncoder.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.encoder;\n\nimport java.io.IOException;\n\nimport android.media.MediaCodec;\nimport android.media.MediaCodecInfo;\nimport android.media.MediaCodecList;\nimport android.media.MediaFormat;\nimport android.util.Log;\nimport android.view.Surface;\n\nimport com.serenegiant.glutils.EGLBase;\nimport com.serenegiant.glutils.RenderHandler;\n\n/**\n * Encode texture images as H.264 video\n * using MediaCodec.\n * This class render texture images into recording surface\n * camera from MediaCodec encoder using Open GL|ES\n */\npublic class MediaVideoEncoder extends MediaEncoder implements IVideoEncoder {\n\tprivate static final boolean DEBUG = true;\t// TODO set false on release\n\tprivate static final String TAG = \"MediaVideoEncoder\";\n\n\tprivate static final String MIME_TYPE = \"video/avc\";\n\t// parameters for recording\n\tprivate final int mWidth, mHeight;\n    private static final int FRAME_RATE = 15;\n    private static final float BPP = 0.50f;\n\n    private RenderHandler mRenderHandler;\n    private Surface mSurface;\n\n\tpublic MediaVideoEncoder(final MediaMuxerWrapper muxer, final int width, final int height, final MediaEncoderListener listener) {\n\t\tsuper(muxer, listener);\n\t\tif (DEBUG) Log.i(TAG, \"MediaVideoEncoder: \");\n\t\tmRenderHandler = RenderHandler.createHandler(TAG);\n\t\tmWidth = width;\n\t\tmHeight = height;\n\t}\n\n\tpublic boolean frameAvailableSoon(final float[] tex_matrix) {\n\t\tboolean result;\n\t\tif (result = super.frameAvailableSoon())\n\t\t\tmRenderHandler.draw(tex_matrix);\n\t\treturn result;\n\t}\n\n\t/**\n\t * This method does not work correctly on this class,\n\t * use #frameAvailableSoon(final float[]) instead\n\t * @return\n\t */\n\t@Override\n\tpublic boolean frameAvailableSoon() {\n\t\tboolean result;\n\t\tif (result = super.frameAvailableSoon())\n\t\t\tmRenderHandler.draw(null);\n\t\treturn result;\n\t}\n\n\t@Override\n\tprotected void prepare() throws IOException {\n\t\tif (DEBUG) Log.i(TAG, \"prepare: \");\n        mTrackIndex = -1;\n        mMuxerStarted = mIsEOS = false;\n\n        final MediaCodecInfo videoCodecInfo = selectVideoCodec(MIME_TYPE);\n        if (videoCodecInfo == null) {\n            Log.e(TAG, \"Unable to find an appropriate codec for \" + MIME_TYPE);\n            return;\n        }\n\t\tif (DEBUG) Log.i(TAG, \"selected codec: \" + videoCodecInfo.getName());\n\n        final MediaFormat format = MediaFormat.createVideoFormat(MIME_TYPE, mWidth, mHeight);\n        format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);\t// API >= 18\n        format.setInteger(MediaFormat.KEY_BIT_RATE, calcBitRate());\n        format.setInteger(MediaFormat.KEY_FRAME_RATE, FRAME_RATE);\n        format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 10);\n\t\tif (DEBUG) Log.i(TAG, \"format: \" + format);\n\n        mMediaCodec = MediaCodec.createEncoderByType(MIME_TYPE);\n        mMediaCodec.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);\n        // get Surface for encoder input\n        // this method only can call between #configure and #start\n        mSurface = mMediaCodec.createInputSurface();\t// API >= 18\n        mMediaCodec.start();\n        if (DEBUG) Log.i(TAG, \"prepare finishing\");\n        if (mListener != null) {\n        \ttry {\n        \t\tmListener.onPrepared(this);\n        \t} catch (final Exception e) {\n        \t\tLog.e(TAG, \"prepare:\", e);\n        \t}\n        }\n\t}\n\n\tpublic void setEglContext(final EGLBase.IContext sharedContext, final int tex_id) {\n\t\tmRenderHandler.setEglContext(sharedContext, tex_id, mSurface, true);\n\t}\n\n\t@Override\n    protected void release() {\n\t\tif (DEBUG) Log.i(TAG, \"release:\");\n\t\tif (mSurface != null) {\n\t\t\tmSurface.release();\n\t\t\tmSurface = null;\n\t\t}\n\t\tif (mRenderHandler != null) {\n\t\t\tmRenderHandler.release();\n\t\t\tmRenderHandler = null;\n\t\t}\n\t\tsuper.release();\n\t}\n\n\tprivate int calcBitRate() {\n\t\tfinal int bitrate = (int)(BPP * FRAME_RATE * mWidth * mHeight);\n\t\tLog.i(TAG, String.format(\"bitrate=%5.2f[Mbps]\", bitrate / 1024f / 1024f));\n\t\treturn bitrate;\n\t}\n\n    /**\n     * select the first codec that match a specific MIME type\n     * @param mimeType\n     * @return null if no codec matched\n     */\n    protected static final MediaCodecInfo selectVideoCodec(final String mimeType) {\n    \tif (DEBUG) Log.v(TAG, \"selectVideoCodec:\");\n\n    \t// get the list of available codecs\n        final int numCodecs = MediaCodecList.getCodecCount();\n        for (int i = 0; i < numCodecs; i++) {\n        \tfinal MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);\n\n            if (!codecInfo.isEncoder()) {\t// skipp decoder\n                continue;\n            }\n            // select first codec that match a specific MIME type and color format\n            final String[] types = codecInfo.getSupportedTypes();\n            for (int j = 0; j < types.length; j++) {\n                if (types[j].equalsIgnoreCase(mimeType)) {\n                \tif (DEBUG) Log.i(TAG, \"codec:\" + codecInfo.getName() + \",MIME=\" + types[j]);\n            \t\tfinal int format = selectColorFormat(codecInfo, mimeType);\n                \tif (format > 0) {\n                \t\treturn codecInfo;\n                \t}\n                }\n            }\n        }\n        return null;\n    }\n\n    /**\n     * select color format available on specific codec and we can use.\n     * @return 0 if no colorFormat is matched\n     */\n    protected static final int selectColorFormat(final MediaCodecInfo codecInfo, final String mimeType) {\n\t\tif (DEBUG) Log.i(TAG, \"selectColorFormat: \");\n    \tint result = 0;\n    \tfinal MediaCodecInfo.CodecCapabilities caps;\n    \ttry {\n    \t\tThread.currentThread().setPriority(Thread.MAX_PRIORITY);\n    \t\tcaps = codecInfo.getCapabilitiesForType(mimeType);\n    \t} finally {\n    \t\tThread.currentThread().setPriority(Thread.NORM_PRIORITY);\n    \t}\n        int colorFormat;\n        for (int i = 0; i < caps.colorFormats.length; i++) {\n        \tcolorFormat = caps.colorFormats[i];\n            if (isRecognizedVideoFormat(colorFormat)) {\n            \tif (result == 0)\n            \t\tresult = colorFormat;\n                break;\n            }\n        }\n        if (result == 0)\n        \tLog.e(TAG, \"couldn't find a good color format for \" + codecInfo.getName() + \" / \" + mimeType);\n        return result;\n    }\n\n\t/**\n\t * color formats that we can use in this class\n\t */\n    protected static int[] recognizedFormats;\n\tstatic {\n\t\trecognizedFormats = new int[] {\n//        \tMediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar,\n//        \tMediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar,\n//        \tMediaCodecInfo.CodecCapabilities.COLOR_QCOM_FormatYUV420SemiPlanar,\n        \tMediaCodecInfo.CodecCapabilities.COLOR_FormatSurface,\n\t\t};\n\t}\n\n    private static final boolean isRecognizedVideoFormat(final int colorFormat) {\n\t\tif (DEBUG) Log.i(TAG, \"isRecognizedVideoFormat:colorFormat=\" + colorFormat);\n    \tfinal int n = recognizedFormats != null ? recognizedFormats.length : 0;\n    \tfor (int i = 0; i < n; i++) {\n    \t\tif (recognizedFormats[i] == colorFormat) {\n    \t\t\treturn true;\n    \t\t}\n    \t}\n    \treturn false;\n    }\n\n}\n"
  },
  {
    "path": "usbCameraCommon/src/main/java/com/serenegiant/usbcameracommon/AbstractUVCCameraHandler.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usbcameracommon;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.SurfaceTexture;\nimport android.hardware.usb.UsbDevice;\nimport android.media.AudioManager;\nimport android.media.MediaScannerConnection;\nimport android.media.SoundPool;\nimport android.os.Environment;\nimport android.os.Handler;\nimport android.os.Looper;\nimport android.os.Message;\nimport android.text.TextUtils;\nimport android.util.Log;\nimport android.view.Surface;\nimport android.view.SurfaceHolder;\n\nimport com.serenegiant.encoder.MediaAudioEncoder;\nimport com.serenegiant.encoder.MediaEncoder;\nimport com.serenegiant.encoder.MediaMuxerWrapper;\nimport com.serenegiant.encoder.MediaSurfaceEncoder;\nimport com.serenegiant.encoder.MediaVideoBufferEncoder;\nimport com.serenegiant.encoder.MediaVideoEncoder;\nimport com.serenegiant.usb.IFrameCallback;\nimport com.serenegiant.usb.USBMonitor;\nimport com.serenegiant.usb.UVCCamera;\nimport com.serenegiant.widget.CameraViewInterface;\n\nimport java.io.BufferedOutputStream;\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.lang.ref.WeakReference;\nimport java.lang.reflect.Constructor;\nimport java.lang.reflect.Field;\nimport java.lang.reflect.InvocationTargetException;\nimport java.nio.ByteBuffer;\nimport java.nio.ByteOrder;\nimport java.util.Set;\nimport java.util.concurrent.CopyOnWriteArraySet;\n\nabstract class AbstractUVCCameraHandler extends Handler {\n\tprivate static final boolean DEBUG = true;\t// TODO set false on release\n\tprivate static final String TAG = \"AbsUVCCameraHandler\";\n\n\tpublic interface CameraCallback {\n\t\tpublic void onOpen();\n\t\tpublic void onClose();\n\t\tpublic void onStartPreview();\n\t\tpublic void onStopPreview();\n\t\tpublic void onStartRecording();\n\t\tpublic void onStopRecording();\n\t\tpublic void onError(final Exception e);\n\t}\n\n\tprivate static final int MSG_OPEN = 0;\n\tprivate static final int MSG_CLOSE = 1;\n\tprivate static final int MSG_PREVIEW_START = 2;\n\tprivate static final int MSG_PREVIEW_STOP = 3;\n\tprivate static final int MSG_CAPTURE_STILL = 4;\n\tprivate static final int MSG_CAPTURE_START = 5;\n\tprivate static final int MSG_CAPTURE_STOP = 6;\n\tprivate static final int MSG_MEDIA_UPDATE = 7;\n\tprivate static final int MSG_RELEASE = 9;\n\n\tprivate final WeakReference<AbstractUVCCameraHandler.CameraThread> mWeakThread;\n\tprivate volatile boolean mReleased;\n\n\tprotected AbstractUVCCameraHandler(final CameraThread thread) {\n\t\tmWeakThread = new WeakReference<CameraThread>(thread);\n\t}\n\n\tpublic int getWidth() {\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\treturn thread != null ? thread.getWidth() : 0;\n\t}\n\n\tpublic int getHeight() {\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\treturn thread != null ? thread.getHeight() : 0;\n\t}\n\n\tpublic boolean isOpened() {\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\treturn thread != null && thread.isCameraOpened();\n\t}\n\n\tpublic boolean isPreviewing() {\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\treturn thread != null && thread.isPreviewing();\n\t}\n\n\tpublic boolean isRecording() {\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\treturn thread != null && thread.isRecording();\n\t}\n\n\tpublic boolean isEqual(final UsbDevice device) {\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\treturn (thread != null) && thread.isEqual(device);\n\t}\n\n\tprotected boolean isCameraThread() {\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\treturn thread != null && (thread.getId() == Thread.currentThread().getId());\n\t}\n\n\tprotected boolean isReleased() {\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\treturn mReleased || (thread == null);\n\t}\n\n\tprotected void checkReleased() {\n\t\tif (isReleased()) {\n\t\t\tthrow new IllegalStateException(\"already released\");\n\t\t}\n\t}\n\n\tpublic void open(final USBMonitor.UsbControlBlock ctrlBlock) {\n\t\tcheckReleased();\n\t\tsendMessage(obtainMessage(MSG_OPEN, ctrlBlock));\n\t}\n\n\tpublic void close() {\n\t\tif (DEBUG) Log.v(TAG, \"close:\");\n\t\tif (isOpened()) {\n\t\t\tstopPreview();\n\t\t\tsendEmptyMessage(MSG_CLOSE);\n\t\t}\n\t\tif (DEBUG) Log.v(TAG, \"close:finished\");\n\t}\n\n\tpublic void resize(final int width, final int height) {\n\t\tcheckReleased();\n\t\tthrow new UnsupportedOperationException(\"does not support now\");\n\t}\n\n\tprotected void startPreview(final Object surface) {\n\t\tcheckReleased();\n\t\tif (!((surface instanceof SurfaceHolder) || (surface instanceof Surface) || (surface instanceof SurfaceTexture))) {\n\t\t\tthrow new IllegalArgumentException(\"surface should be one of SurfaceHolder, Surface or SurfaceTexture\");\n\t\t}\n\t\tsendMessage(obtainMessage(MSG_PREVIEW_START, surface));\n\t}\n\n\tpublic void stopPreview() {\n\t\tif (DEBUG) Log.v(TAG, \"stopPreview:\");\n\t\tremoveMessages(MSG_PREVIEW_START);\n\t\tstopRecording();\n\t\tif (isPreviewing()) {\n\t\t\tfinal CameraThread thread = mWeakThread.get();\n\t\t\tif (thread == null) return;\n\t\t\tsynchronized (thread.mSync) {\n\t\t\t\tsendEmptyMessage(MSG_PREVIEW_STOP);\n\t\t\t\tif (!isCameraThread()) {\n\t\t\t\t\t// wait for actually preview stopped to avoid releasing Surface/SurfaceTexture\n\t\t\t\t\t// while preview is still running.\n\t\t\t\t\t// therefore this method will take a time to execute\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthread.mSync.wait();\n\t\t\t\t\t} catch (final InterruptedException e) {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (DEBUG) Log.v(TAG, \"stopPreview:finished\");\n\t}\n\n\tprotected void captureStill() {\n\t\tcheckReleased();\n\t\tsendEmptyMessage(MSG_CAPTURE_STILL);\n\t}\n\n\tprotected void captureStill(final String path) {\n\t\tcheckReleased();\n\t\tsendMessage(obtainMessage(MSG_CAPTURE_STILL, path));\n\t}\n\n\tpublic void startRecording() {\n\t\tcheckReleased();\n\t\tsendEmptyMessage(MSG_CAPTURE_START);\n\t}\n\n\tpublic void stopRecording() {\n\t\tsendEmptyMessage(MSG_CAPTURE_STOP);\n\t}\n\n\tpublic void release() {\n\t\tmReleased = true;\n\t\tclose();\n\t\tsendEmptyMessage(MSG_RELEASE);\n\t}\n\n\tpublic void addCallback(final CameraCallback callback) {\n\t\tcheckReleased();\n\t\tif (!mReleased && (callback != null)) {\n\t\t\tfinal CameraThread thread = mWeakThread.get();\n\t\t\tif (thread != null) {\n\t\t\t\tthread.mCallbacks.add(callback);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic void removeCallback(final CameraCallback callback) {\n\t\tif (callback != null) {\n\t\t\tfinal CameraThread thread = mWeakThread.get();\n\t\t\tif (thread != null) {\n\t\t\t\tthread.mCallbacks.remove(callback);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected void updateMedia(final String path) {\n\t\tsendMessage(obtainMessage(MSG_MEDIA_UPDATE, path));\n\t}\n\n\tpublic boolean checkSupportFlag(final long flag) {\n\t\tcheckReleased();\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\treturn thread != null && thread.mUVCCamera != null && thread.mUVCCamera.checkSupportFlag(flag);\n\t}\n\n\tpublic int getValue(final int flag) {\n\t\tcheckReleased();\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\tfinal UVCCamera camera = thread != null ? thread.mUVCCamera : null;\n\t\tif (camera != null) {\n\t\t\tif (flag == UVCCamera.PU_BRIGHTNESS) {\n\t\t\t\treturn camera.getBrightness();\n\t\t\t} else if (flag == UVCCamera.PU_CONTRAST) {\n\t\t\t\treturn camera.getContrast();\n\t\t\t}\n\t\t}\n\t\tthrow new IllegalStateException();\n\t}\n\n\tpublic int setValue(final int flag, final int value) {\n\t\tcheckReleased();\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\tfinal UVCCamera camera = thread != null ? thread.mUVCCamera : null;\n\t\tif (camera != null) {\n\t\t\tif (flag == UVCCamera.PU_BRIGHTNESS) {\n\t\t\t\tcamera.setBrightness(value);\n\t\t\t\treturn camera.getBrightness();\n\t\t\t} else if (flag == UVCCamera.PU_CONTRAST) {\n\t\t\t\tcamera.setContrast(value);\n\t\t\t\treturn camera.getContrast();\n\t\t\t}\n\t\t}\n\t\tthrow new IllegalStateException();\n\t}\n\n\tpublic int resetValue(final int flag) {\n\t\tcheckReleased();\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\tfinal UVCCamera camera = thread != null ? thread.mUVCCamera : null;\n\t\tif (camera != null) {\n\t\t\tif (flag == UVCCamera.PU_BRIGHTNESS) {\n\t\t\t\tcamera.resetBrightness();\n\t\t\t\treturn camera.getBrightness();\n\t\t\t} else if (flag == UVCCamera.PU_CONTRAST) {\n\t\t\t\tcamera.resetContrast();\n\t\t\t\treturn camera.getContrast();\n\t\t\t}\n\t\t}\n\t\tthrow new IllegalStateException();\n\t}\n\n\t@Override\n\tpublic void handleMessage(final Message msg) {\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\tif (thread == null) return;\n\t\tswitch (msg.what) {\n\t\tcase MSG_OPEN:\n\t\t\tthread.handleOpen((USBMonitor.UsbControlBlock)msg.obj);\n\t\t\tbreak;\n\t\tcase MSG_CLOSE:\n\t\t\tthread.handleClose();\n\t\t\tbreak;\n\t\tcase MSG_PREVIEW_START:\n\t\t\tthread.handleStartPreview(msg.obj);\n\t\t\tbreak;\n\t\tcase MSG_PREVIEW_STOP:\n\t\t\tthread.handleStopPreview();\n\t\t\tbreak;\n\t\tcase MSG_CAPTURE_STILL:\n\t\t\tthread.handleCaptureStill((String)msg.obj);\n\t\t\tbreak;\n\t\tcase MSG_CAPTURE_START:\n\t\t\tthread.handleStartRecording();\n\t\t\tbreak;\n\t\tcase MSG_CAPTURE_STOP:\n\t\t\tthread.handleStopRecording();\n\t\t\tbreak;\n\t\tcase MSG_MEDIA_UPDATE:\n\t\t\tthread.handleUpdateMedia((String)msg.obj);\n\t\t\tbreak;\n\t\tcase MSG_RELEASE:\n\t\t\tthread.handleRelease();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new RuntimeException(\"unsupported message:what=\" + msg.what);\n\t\t}\n\t}\n\n\tstatic final class CameraThread extends Thread {\n\t\tprivate static final String TAG_THREAD = \"CameraThread\";\n\t\tprivate final Object mSync = new Object();\n\t\tprivate final Class<? extends AbstractUVCCameraHandler> mHandlerClass;\n\t\tprivate final WeakReference<Activity> mWeakParent;\n\t\tprivate final WeakReference<CameraViewInterface> mWeakCameraView;\n\t\tprivate final int mEncoderType;\n\t\tprivate final Set<CameraCallback> mCallbacks = new CopyOnWriteArraySet<CameraCallback>();\n\t\tprivate int mWidth, mHeight, mPreviewMode;\n\t\tprivate float mBandwidthFactor;\n\t\tprivate boolean mIsPreviewing;\n\t\tprivate boolean mIsRecording;\n\t\t/**\n\t\t * shutter sound\n\t\t */\n\t\tprivate SoundPool mSoundPool;\n\t\tprivate int mSoundId;\n\t\tprivate AbstractUVCCameraHandler mHandler;\n\t\t/**\n\t\t * for accessing UVC camera\n\t\t */\n\t\tprivate UVCCamera mUVCCamera;\n\t\t/**\n\t\t * muxer for audio/video recording\n\t\t */\n\t\tprivate MediaMuxerWrapper mMuxer;\n\t\tprivate MediaVideoBufferEncoder mVideoEncoder;\n\n\t\t/**\n\t\t *\n\t\t * @param clazz Class extends AbstractUVCCameraHandler\n\t\t * @param parent parent Activity\n\t\t * @param cameraView for still capturing\n\t\t * @param encoderType 0: use MediaSurfaceEncoder, 1: use MediaVideoEncoder, 2: use MediaVideoBufferEncoder\n\t\t * @param width\n\t\t * @param height\n\t\t * @param format either FRAME_FORMAT_YUYV(0) or FRAME_FORMAT_MJPEG(1)\n\t\t * @param bandwidthFactor\n\t\t */\n\t\tCameraThread(final Class<? extends AbstractUVCCameraHandler> clazz,\n\t\t\tfinal Activity parent, final CameraViewInterface cameraView,\n\t\t\tfinal int encoderType, final int width, final int height, final int format,\n\t\t\tfinal float bandwidthFactor) {\n\n\t\t\tsuper(\"CameraThread\");\n\t\t\tmHandlerClass = clazz;\n\t\t\tmEncoderType = encoderType;\n\t\t\tmWidth = width;\n\t\t\tmHeight = height;\n\t\t\tmPreviewMode = format;\n\t\t\tmBandwidthFactor = bandwidthFactor;\n\t\t\tmWeakParent = new WeakReference<Activity>(parent);\n\t\t\tmWeakCameraView = new WeakReference<CameraViewInterface>(cameraView);\n\t\t\tloadShutterSound(parent);\n\t\t}\n\n\t\t@Override\n\t\tprotected void finalize() throws Throwable {\n\t\t\tLog.i(TAG, \"CameraThread#finalize\");\n\t\t\tsuper.finalize();\n\t\t}\n\n\t\tpublic AbstractUVCCameraHandler getHandler() {\n\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"getHandler:\");\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (mHandler == null)\n\t\t\t\ttry {\n\t\t\t\t\tmSync.wait();\n\t\t\t\t} catch (final InterruptedException e) {\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn mHandler;\n\t\t}\n\n\t\tpublic int getWidth() {\n\t\t\tsynchronized (mSync) {\n\t\t\t\treturn mWidth;\n\t\t\t}\n\t\t}\n\n\t\tpublic int getHeight() {\n\t\t\tsynchronized (mSync) {\n\t\t\t\treturn mHeight;\n\t\t\t}\n\t\t}\n\n\t\tpublic boolean isCameraOpened() {\n\t\t\tsynchronized (mSync) {\n\t\t\t\treturn mUVCCamera != null;\n\t\t\t}\n\t\t}\n\n\t\tpublic boolean isPreviewing() {\n\t\t\tsynchronized (mSync) {\n\t\t\t\treturn mUVCCamera != null && mIsPreviewing;\n\t\t\t}\n\t\t}\n\n\t\tpublic boolean isRecording() {\n\t\t\tsynchronized (mSync) {\n\t\t\t\treturn (mUVCCamera != null) && (mMuxer != null);\n\t\t\t}\n\t\t}\n\n\t\tpublic boolean isEqual(final UsbDevice device) {\n\t\t\treturn (mUVCCamera != null) && (mUVCCamera.getDevice() != null) && mUVCCamera.getDevice().equals(device);\n\t\t}\n\n\t\tpublic void handleOpen(final USBMonitor.UsbControlBlock ctrlBlock) {\n\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleOpen:\");\n\t\t\thandleClose();\n\t\t\ttry {\n\t\t\t\tfinal UVCCamera camera = new UVCCamera();\n\t\t\t\tcamera.open(ctrlBlock);\n\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\tmUVCCamera = camera;\n\t\t\t\t}\n\t\t\t\tcallOnOpen();\n\t\t\t} catch (final Exception e) {\n\t\t\t\tcallOnError(e);\n\t\t\t}\n\t\t\tif (DEBUG) Log.i(TAG, \"supportedSize:\" + (mUVCCamera != null ? mUVCCamera.getSupportedSize() : null));\n\t\t}\n\n\t\tpublic void handleClose() {\n\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleClose:\");\n\t\t\thandleStopRecording();\n\t\t\tfinal UVCCamera camera;\n\t\t\tsynchronized (mSync) {\n\t\t\t\tcamera = mUVCCamera;\n\t\t\t\tmUVCCamera = null;\n\t\t\t}\n\t\t\tif (camera != null) {\n\t\t\t\tcamera.stopPreview();\n\t\t\t\tcamera.destroy();\n\t\t\t\tcallOnClose();\n\t\t\t}\n\t\t}\n\n\t\tpublic void handleStartPreview(final Object surface) {\n\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleStartPreview:\");\n\t\t\tif ((mUVCCamera == null) || mIsPreviewing) return;\n\t\t\ttry {\n\t\t\t\tmUVCCamera.setPreviewSize(mWidth, mHeight, 1, 31, mPreviewMode, mBandwidthFactor);\n\t\t\t} catch (final IllegalArgumentException e) {\n\t\t\t\ttry {\n\t\t\t\t\t// fallback to YUV mode\n\t\t\t\t\tmUVCCamera.setPreviewSize(mWidth, mHeight, 1, 31, UVCCamera.DEFAULT_PREVIEW_MODE, mBandwidthFactor);\n\t\t\t\t} catch (final IllegalArgumentException e1) {\n\t\t\t\t\tcallOnError(e1);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (surface instanceof SurfaceHolder) {\n\t\t\t\tmUVCCamera.setPreviewDisplay((SurfaceHolder)surface);\n\t\t\t} if (surface instanceof Surface) {\n\t\t\t\tmUVCCamera.setPreviewDisplay((Surface)surface);\n\t\t\t} else {\n\t\t\t\tmUVCCamera.setPreviewTexture((SurfaceTexture)surface);\n\t\t\t}\n\t\t\tmUVCCamera.startPreview();\n\t\t\tmUVCCamera.updateCameraParams();\n\t\t\tsynchronized (mSync) {\n\t\t\t\tmIsPreviewing = true;\n\t\t\t}\n\t\t\tcallOnStartPreview();\n\t\t}\n\n\t\tpublic void handleStopPreview() {\n\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleStopPreview:\");\n\t\t\tif (mIsPreviewing) {\n\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\tmUVCCamera.stopPreview();\n\t\t\t\t}\n\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\tmIsPreviewing = false;\n\t\t\t\t\tmSync.notifyAll();\n\t\t\t\t}\n\t\t\t\tcallOnStopPreview();\n\t\t\t}\n\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleStopPreview:finished\");\n\t\t}\n\n\t\tpublic void handleCaptureStill(final String path) {\n\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleCaptureStill:\");\n\t\t\tfinal Activity parent = mWeakParent.get();\n\t\t\tif (parent == null) return;\n\t\t\tmSoundPool.play(mSoundId, 0.2f, 0.2f, 0, 0, 1.0f);\t// play shutter sound\n\t\t\ttry {\n\t\t\t\tfinal Bitmap bitmap = mWeakCameraView.get().captureStillImage();\n\t\t\t\t// get buffered output stream for saving a captured still image as a file on external storage.\n\t\t\t\t// the file name is came from current time.\n\t\t\t\t// You should use extension name as same as CompressFormat when calling Bitmap#compress.\n\t\t\t\tfinal File outputFile = TextUtils.isEmpty(path)\n\t\t\t\t\t? MediaMuxerWrapper.getCaptureFile(Environment.DIRECTORY_DCIM, \".png\")\n\t\t\t\t\t: new File(path);\n\t\t\t\tfinal BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(outputFile));\n\t\t\t\ttry {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tbitmap.compress(Bitmap.CompressFormat.PNG, 100, os);\n\t\t\t\t\t\tos.flush();\n\t\t\t\t\t\tmHandler.sendMessage(mHandler.obtainMessage(MSG_MEDIA_UPDATE, outputFile.getPath()));\n\t\t\t\t\t} catch (final IOException e) {\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tos.close();\n\t\t\t\t}\n\t\t\t} catch (final Exception e) {\n\t\t\t\tcallOnError(e);\n\t\t\t}\n\t\t}\n\n\t\tpublic void handleStartRecording() {\n\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleStartRecording:\");\n\t\t\ttry {\n\t\t\t\tif ((mUVCCamera == null) || (mMuxer != null)) return;\n\t\t\t\tfinal MediaMuxerWrapper muxer = new MediaMuxerWrapper(\".mp4\");\t// if you record audio only, \".m4a\" is also OK.\n\t\t\t\tMediaVideoBufferEncoder videoEncoder = null;\n\t\t\t\tswitch (mEncoderType) {\n\t\t\t\tcase 1:\t// for video capturing using MediaVideoEncoder\n\t\t\t\t\tnew MediaVideoEncoder(muxer, getWidth(), getHeight(), mMediaEncoderListener);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\t// for video capturing using MediaVideoBufferEncoder\n\t\t\t\t\tvideoEncoder = new MediaVideoBufferEncoder(muxer, getWidth(), getHeight(), mMediaEncoderListener);\n\t\t\t\t\tbreak;\n\t\t\t\t// case 0:\t// for video capturing using MediaSurfaceEncoder\n\t\t\t\tdefault:\n\t\t\t\t\tnew MediaSurfaceEncoder(muxer, getWidth(), getHeight(), mMediaEncoderListener);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (true) {\n\t\t\t\t\t// for audio capturing\n\t\t\t\t\tnew MediaAudioEncoder(muxer, mMediaEncoderListener);\n\t\t\t\t}\n\t\t\t\tmuxer.prepare();\n\t\t\t\tmuxer.startRecording();\n\t\t\t\tif (videoEncoder != null) {\n\t\t\t\t\tmUVCCamera.setFrameCallback(mIFrameCallback, UVCCamera.PIXEL_FORMAT_NV21);\n\t\t\t\t}\n\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\tmMuxer = muxer;\n\t\t\t\t\tmVideoEncoder = videoEncoder;\n\t\t\t\t}\n\t\t\t\tcallOnStartRecording();\n\t\t\t} catch (final IOException e) {\n\t\t\t\tcallOnError(e);\n\t\t\t\tLog.e(TAG, \"startCapture:\", e);\n\t\t\t}\n\t\t}\n\n\t\tpublic void handleStopRecording() {\n\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleStopRecording:mMuxer=\" + mMuxer);\n\t\t\tfinal MediaMuxerWrapper muxer;\n\t\t\tsynchronized (mSync) {\n\t\t\t\tmuxer = mMuxer;\n\t\t\t\tmMuxer = null;\n\t\t\t\tmVideoEncoder = null;\n\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\tmUVCCamera.stopCapture();\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tmWeakCameraView.get().setVideoEncoder(null);\n\t\t\t} catch (final Exception e) {\n\t\t\t\t// ignore\n\t\t\t}\n\t\t\tif (muxer != null) {\n\t\t\t\tmuxer.stopRecording();\n\t\t\t\tmUVCCamera.setFrameCallback(null, 0);\n\t\t\t\t// you should not wait here\n\t\t\t\tcallOnStopRecording();\n\t\t\t}\n\t\t}\n\n\t\tprivate final IFrameCallback mIFrameCallback = new IFrameCallback() {\n\t\t\t@Override\n\t\t\tpublic void onFrame(final ByteBuffer frame) {\n\t\t\t\tfinal MediaVideoBufferEncoder videoEncoder;\n\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\tvideoEncoder = mVideoEncoder;\n\t\t\t\t}\n\t\t\t\tif (videoEncoder != null) {\n\t\t\t\t\tvideoEncoder.frameAvailableSoon();\n\t\t\t\t\tvideoEncoder.encode(frame);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tpublic void handleUpdateMedia(final String path) {\n\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleUpdateMedia:path=\" + path);\n\t\t\tfinal Activity parent = mWeakParent.get();\n\t\t\tfinal boolean released = (mHandler == null) || mHandler.mReleased;\n\t\t\tif (parent != null && parent.getApplicationContext() != null) {\n\t\t\t\ttry {\n\t\t\t\t\tif (DEBUG) Log.i(TAG, \"MediaScannerConnection#scanFile\");\n\t\t\t\t\tMediaScannerConnection.scanFile(parent.getApplicationContext(), new String[]{ path }, null, null);\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tLog.e(TAG, \"handleUpdateMedia:\", e);\n\t\t\t\t}\n\t\t\t\tif (released || parent.isDestroyed())\n\t\t\t\t\thandleRelease();\n\t\t\t} else {\n\t\t\t\tLog.w(TAG, \"MainActivity already destroyed\");\n\t\t\t\t// give up to add this movie to MediaStore now.\n\t\t\t\t// Seeing this movie on Gallery app etc. will take a lot of time.\n\t\t\t\thandleRelease();\n\t\t\t}\n\t\t}\n\n\t\tpublic void handleRelease() {\n\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleRelease:mIsRecording=\" + mIsRecording);\n\t\t\thandleClose();\n\t\t\tmCallbacks.clear();\n\t\t\tif (!mIsRecording) {\n\t\t\t\tmHandler.mReleased = true;\n\t\t\t\tLooper.myLooper().quit();\n\t\t\t}\n\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleRelease:finished\");\n\t\t}\n\n\t\tprivate final MediaEncoder.MediaEncoderListener mMediaEncoderListener = new MediaEncoder.MediaEncoderListener() {\n\t\t\t@Override\n\t\t\tpublic void onPrepared(final MediaEncoder encoder) {\n\t\t\t\tif (DEBUG) Log.v(TAG, \"onPrepared:encoder=\" + encoder);\n\t\t\t\tmIsRecording = true;\n\t\t\t\tif (encoder instanceof MediaVideoEncoder)\n\t\t\t\ttry {\n\t\t\t\t\tmWeakCameraView.get().setVideoEncoder((MediaVideoEncoder)encoder);\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tLog.e(TAG, \"onPrepared:\", e);\n\t\t\t\t}\n\t\t\t\tif (encoder instanceof MediaSurfaceEncoder)\n\t\t\t\ttry {\n\t\t\t\t\tmWeakCameraView.get().setVideoEncoder((MediaSurfaceEncoder)encoder);\n\t\t\t\t\tmUVCCamera.startCapture(((MediaSurfaceEncoder)encoder).getInputSurface());\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tLog.e(TAG, \"onPrepared:\", e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onStopped(final MediaEncoder encoder) {\n\t\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"onStopped:encoder=\" + encoder);\n\t\t\t\tif ((encoder instanceof MediaVideoEncoder)\n\t\t\t\t\t|| (encoder instanceof MediaSurfaceEncoder))\n\t\t\t\ttry {\n\t\t\t\t\tmIsRecording = false;\n\t\t\t\t\tfinal Activity parent = mWeakParent.get();\n\t\t\t\t\tmWeakCameraView.get().setVideoEncoder(null);\n\t\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\t\t\tmUVCCamera.stopCapture();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfinal String path = encoder.getOutputPath();\n\t\t\t\t\tif (!TextUtils.isEmpty(path)) {\n\t\t\t\t\t\tmHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_MEDIA_UPDATE, path), 1000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfinal boolean released = (mHandler == null) || mHandler.mReleased;\n\t\t\t\t\t\tif (released || parent == null || parent.isDestroyed()) {\n\t\t\t\t\t\t\thandleRelease();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tLog.e(TAG, \"onPrepared:\", e);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * prepare and load shutter sound for still image capturing\n\t\t */\n\t\t@SuppressWarnings(\"deprecation\")\n\t\tprivate void loadShutterSound(final Context context) {\n\t    \t// get system stream type using reflection\n\t        int streamType;\n\t        try {\n\t            final Class<?> audioSystemClass = Class.forName(\"android.media.AudioSystem\");\n\t            final Field sseField = audioSystemClass.getDeclaredField(\"STREAM_SYSTEM_ENFORCED\");\n\t            streamType = sseField.getInt(null);\n\t        } catch (final Exception e) {\n\t        \tstreamType = AudioManager.STREAM_SYSTEM;\t// set appropriate according to your app policy\n\t        }\n\t        if (mSoundPool != null) {\n\t        \ttry {\n\t        \t\tmSoundPool.release();\n\t        \t} catch (final Exception e) {\n\t        \t}\n\t        \tmSoundPool = null;\n\t        }\n\t        // load shutter sound from resource\n\t\t    mSoundPool = new SoundPool(2, streamType, 0);\n\t\t    mSoundId = mSoundPool.load(context, R.raw.camera_click, 1);\n\t\t}\n\n\t\t@Override\n\t\tpublic void run() {\n\t\t\tLooper.prepare();\n\t\t\tAbstractUVCCameraHandler handler = null;\n\t\t\ttry {\n\t\t\t\tfinal Constructor<? extends AbstractUVCCameraHandler> constructor = mHandlerClass.getDeclaredConstructor(CameraThread.class);\n\t\t\t\thandler = constructor.newInstance(this);\n\t\t\t} catch (final NoSuchMethodException e) {\n\t\t\t\tLog.w(TAG, e);\n\t\t\t} catch (final IllegalAccessException e) {\n\t\t\t\tLog.w(TAG, e);\n\t\t\t} catch (final InstantiationException e) {\n\t\t\t\tLog.w(TAG, e);\n\t\t\t} catch (final InvocationTargetException e) {\n\t\t\t\tLog.w(TAG, e);\n\t\t\t}\n\t\t\tif (handler != null) {\n\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\tmHandler = handler;\n\t\t\t\t\tmSync.notifyAll();\n\t\t\t\t}\n\t\t\t\tLooper.loop();\n\t\t\t\tif (mSoundPool != null) {\n\t\t\t\t\tmSoundPool.release();\n\t\t\t\t\tmSoundPool = null;\n\t\t\t\t}\n\t\t\t\tif (mHandler != null) {\n\t\t\t\t\tmHandler.mReleased = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmCallbacks.clear();\n\t\t\tsynchronized (mSync) {\n\t\t\t\tmHandler = null;\n\t\t\t\tmSync.notifyAll();\n\t\t\t}\n\t\t}\n\n\t\tprivate void callOnOpen() {\n\t\t\tfor (final CameraCallback callback: mCallbacks) {\n\t\t\t\ttry {\n\t\t\t\t\tcallback.onOpen();\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tmCallbacks.remove(callback);\n\t\t\t\t\tLog.w(TAG, e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void callOnClose() {\n\t\t\tfor (final CameraCallback callback: mCallbacks) {\n\t\t\t\ttry {\n\t\t\t\t\tcallback.onClose();\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tmCallbacks.remove(callback);\n\t\t\t\t\tLog.w(TAG, e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void callOnStartPreview() {\n\t\t\tfor (final CameraCallback callback: mCallbacks) {\n\t\t\t\ttry {\n\t\t\t\t\tcallback.onStartPreview();\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tmCallbacks.remove(callback);\n\t\t\t\t\tLog.w(TAG, e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void callOnStopPreview() {\n\t\t\tfor (final CameraCallback callback: mCallbacks) {\n\t\t\t\ttry {\n\t\t\t\t\tcallback.onStopPreview();\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tmCallbacks.remove(callback);\n\t\t\t\t\tLog.w(TAG, e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void callOnStartRecording() {\n\t\t\tfor (final CameraCallback callback: mCallbacks) {\n\t\t\t\ttry {\n\t\t\t\t\tcallback.onStartRecording();\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tmCallbacks.remove(callback);\n\t\t\t\t\tLog.w(TAG, e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void callOnStopRecording() {\n\t\t\tfor (final CameraCallback callback: mCallbacks) {\n\t\t\t\ttry {\n\t\t\t\t\tcallback.onStopRecording();\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tmCallbacks.remove(callback);\n\t\t\t\t\tLog.w(TAG, e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void callOnError(final Exception e) {\n\t\t\tfor (final CameraCallback callback: mCallbacks) {\n\t\t\t\ttry {\n\t\t\t\t\tcallback.onError(e);\n\t\t\t\t} catch (final Exception e1) {\n\t\t\t\t\tmCallbacks.remove(callback);\n\t\t\t\t\tLog.w(TAG, e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "usbCameraCommon/src/main/java/com/serenegiant/usbcameracommon/UVCCameraHandler.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usbcameracommon;\n\nimport android.app.Activity;\n\nimport com.serenegiant.usb.UVCCamera;\nimport com.serenegiant.widget.CameraViewInterface;\n\npublic class UVCCameraHandler extends AbstractUVCCameraHandler {\n\n\t/**\n\t * create UVCCameraHandler, use MediaVideoEncoder, try MJPEG, default bandwidth\n\t * @param parent\n\t * @param cameraView\n\t * @param width\n\t * @param height\n\t * @return\n\t */\n\tpublic static final UVCCameraHandler createHandler(\n\t\t\tfinal Activity parent, final CameraViewInterface cameraView,\n\t\t\tfinal int width, final int height) {\n\n\t\treturn createHandler(parent, cameraView, 1, width, height, UVCCamera.FRAME_FORMAT_MJPEG, UVCCamera.DEFAULT_BANDWIDTH);\n\t}\n\n\t/**\n\t * create UVCCameraHandler, use MediaVideoEncoder, try MJPEG\n\t * @param parent\n\t * @param cameraView\n\t * @param width\n\t * @param height\n\t * @param bandwidthFactor\n\t * @return\n\t */\n\tpublic static final UVCCameraHandler createHandler(\n\t\t\tfinal Activity parent, final CameraViewInterface cameraView,\n\t\t\tfinal int width, final int height, final float bandwidthFactor) {\n\n\t\treturn createHandler(parent, cameraView, 1, width, height, UVCCamera.FRAME_FORMAT_MJPEG, bandwidthFactor);\n\t}\n\n\t/**\n\t * create UVCCameraHandler, try MJPEG, default bandwidth\n\t * @param parent\n\t * @param cameraView\n\t * @param encoderType 0: use MediaSurfaceEncoder, 1: use MediaVideoEncoder, 2: use MediaVideoBufferEncoder\n\t * @param width\n\t * @param height\n\t * @return\n\t */\n\tpublic static final UVCCameraHandler createHandler(\n\t\t\tfinal Activity parent, final CameraViewInterface cameraView,\n\t\t\tfinal int encoderType, final int width, final int height) {\n\n\t\treturn createHandler(parent, cameraView, encoderType, width, height, UVCCamera.FRAME_FORMAT_MJPEG, UVCCamera.DEFAULT_BANDWIDTH);\n\t}\n\n\t/**\n\t * create UVCCameraHandler, default bandwidth\n\t * @param parent\n\t * @param cameraView\n\t * @param encoderType 0: use MediaSurfaceEncoder, 1: use MediaVideoEncoder, 2: use MediaVideoBufferEncoder\n\t * @param width\n\t * @param height\n\t * @param format either UVCCamera.FRAME_FORMAT_YUYV(0) or UVCCamera.FRAME_FORMAT_MJPEG(1)\n\t * @return\n\t */\n\tpublic static final UVCCameraHandler createHandler(\n\t\t\tfinal Activity parent, final CameraViewInterface cameraView,\n\t\t\tfinal int encoderType, final int width, final int height, final int format) {\n\n\t\treturn createHandler(parent, cameraView, encoderType, width, height, format, UVCCamera.DEFAULT_BANDWIDTH);\n\t}\n\n\t/**\n\t * create UVCCameraHandler\n\t * @param parent\n\t * @param cameraView\n\t * @param encoderType 0: use MediaSurfaceEncoder, 1: use MediaVideoEncoder, 2: use MediaVideoBufferEncoder\n\t * @param width\n\t * @param height\n\t * @param format either UVCCamera.FRAME_FORMAT_YUYV(0) or UVCCamera.FRAME_FORMAT_MJPEG(1)\n\t * @param bandwidthFactor\n\t * @return\n\t */\n\tpublic static final UVCCameraHandler createHandler(\n\t\t\tfinal Activity parent, final CameraViewInterface cameraView,\n\t\t\tfinal int encoderType, final int width, final int height, final int format, final float bandwidthFactor) {\n\n\t\tfinal CameraThread thread = new CameraThread(UVCCameraHandler.class, parent, cameraView, encoderType, width, height, format, bandwidthFactor);\n\t\tthread.start();\n\t\treturn (UVCCameraHandler)thread.getHandler();\n\t}\n\n\tprotected UVCCameraHandler(final CameraThread thread) {\n\t\tsuper(thread);\n\t}\n\n\t@Override\n\tpublic void startPreview(final Object surface) {\n\t\tsuper.startPreview(surface);\n\t}\n\n\t@Override\n\tpublic void captureStill() {\n\t\tsuper.captureStill();\n\t}\n\n\t@Override\n\tpublic void captureStill(final String path) {\n\t\tsuper.captureStill(path);\n\t}\n}\n"
  },
  {
    "path": "usbCameraCommon/src/main/java/com/serenegiant/usbcameracommon/UVCCameraHandlerMultiSurface.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usbcameracommon;\n\nimport android.app.Activity;\nimport android.view.Surface;\n\nimport com.serenegiant.glutils.RendererHolder;\nimport com.serenegiant.usb.UVCCamera;\nimport com.serenegiant.widget.CameraViewInterface;\n\npublic class UVCCameraHandlerMultiSurface extends AbstractUVCCameraHandler {\n\t/**\n\t * create UVCCameraHandlerMultiSurface, use MediaVideoEncoder, try MJPEG, default bandwidth\n\t * @param parent\n\t * @param cameraView\n\t * @param width\n\t * @param height\n\t * @return\n\t */\n\tpublic static final UVCCameraHandlerMultiSurface createHandler(\n\t\t\tfinal Activity parent, final CameraViewInterface cameraView,\n\t\t\tfinal int width, final int height) {\n\n\t\treturn createHandler(parent, cameraView, 1, width, height, UVCCamera.FRAME_FORMAT_MJPEG, UVCCamera.DEFAULT_BANDWIDTH);\n\t}\n\n\t/**\n\t * create UVCCameraHandlerMultiSurface, use MediaVideoEncoder, try MJPEG\n\t * @param parent\n\t * @param cameraView\n\t * @param width\n\t * @param height\n\t * @param bandwidthFactor\n\t * @return\n\t */\n\tpublic static final UVCCameraHandlerMultiSurface createHandler(\n\t\t\tfinal Activity parent, final CameraViewInterface cameraView,\n\t\t\tfinal int width, final int height, final float bandwidthFactor) {\n\n\t\treturn createHandler(parent, cameraView, 1, width, height, UVCCamera.FRAME_FORMAT_MJPEG, bandwidthFactor);\n\t}\n\n\t/**\n\t * create UVCCameraHandlerMultiSurface, try MJPEG, default bandwidth\n\t * @param parent\n\t * @param cameraView\n\t * @param encoderType\n\t * @param width\n\t * @param height\n\t * @return\n\t */\n\tpublic static final UVCCameraHandlerMultiSurface createHandler(\n\t\t\tfinal Activity parent, final CameraViewInterface cameraView,\n\t\t\tfinal int encoderType, final int width, final int height) {\n\n\t\treturn createHandler(parent, cameraView, encoderType, width, height, UVCCamera.FRAME_FORMAT_MJPEG, UVCCamera.DEFAULT_BANDWIDTH);\n\t}\n\n\t/**\n\t * create UVCCameraHandlerMultiSurface, default bandwidth\n\t * @param parent\n\t * @param cameraView\n\t * @param encoderType\n\t * @param width\n\t * @param height\n\t * @param format\n\t * @return\n\t */\n\tpublic static final UVCCameraHandlerMultiSurface createHandler(\n\t\t\tfinal Activity parent, final CameraViewInterface cameraView,\n\t\t\tfinal int encoderType, final int width, final int height, final int format) {\n\n\t\treturn createHandler(parent, cameraView, encoderType, width, height, format, UVCCamera.DEFAULT_BANDWIDTH);\n\t}\n\n\t/**\n\t * create UVCCameraHandlerMultiSurface\n\t * @param parent\n\t * @param cameraView\n\t * @param encoderType 0: use MediaSurfaceEncoder, 1: use MediaVideoEncoder, 2: use MediaVideoBufferEncoder\n\t * @param width\n\t * @param height\n\t * @param format either UVCCamera.FRAME_FORMAT_YUYV(0) or UVCCamera.FRAME_FORMAT_MJPEG(1)\n\t * @param bandwidthFactor\n\t * @return\n\t */\n\tpublic static final UVCCameraHandlerMultiSurface createHandler(\n\t\t\tfinal Activity parent, final CameraViewInterface cameraView,\n\t\t\tfinal int encoderType, final int width, final int height, final int format, final float bandwidthFactor) {\n\n\t\tfinal CameraThread thread = new CameraThread(UVCCameraHandlerMultiSurface.class, parent, cameraView, encoderType, width, height, format, bandwidthFactor);\n\t\tthread.start();\n\t\treturn (UVCCameraHandlerMultiSurface)thread.getHandler();\n\t}\n\n\tprivate RendererHolder mRendererHolder;\n\tprotected UVCCameraHandlerMultiSurface(final CameraThread thread) {\n\t\tsuper(thread);\n\t\tmRendererHolder = new RendererHolder(thread.getWidth(), thread.getHeight(), null);\n\t}\n\n\tpublic synchronized void release() {\n\t\tif (mRendererHolder != null) {\n\t\t\tmRendererHolder.release();\n\t\t\tmRendererHolder = null;\n\t\t}\n\t\tsuper.release();\n\t}\n\n\tpublic synchronized void resize(final int width, final int height) {\n\t\tsuper.resize(width, height);\n\t\tif (mRendererHolder != null) {\n\t\t\tmRendererHolder.resize(width, height);\n\t\t}\n\t}\n\n\tpublic synchronized void startPreview() {\n\t\tcheckReleased();\n\t\tif (mRendererHolder != null) {\n\t\t\tsuper.startPreview(mRendererHolder.getSurface());\n\t\t} else {\n\t\t\tthrow new IllegalStateException();\n\t\t}\n\t}\n\n\tpublic synchronized void addSurface(final int surfaceId, final Surface surface, final boolean isRecordable) {\n\t\tcheckReleased();\n\t\tmRendererHolder.addSurface(surfaceId, surface, isRecordable);\n\t}\n\n\tpublic synchronized void removeSurface(final int surfaceId) {\n\t\tif (mRendererHolder != null) {\n\t\t\tmRendererHolder.removeSurface(surfaceId);\n\t\t}\n\t}\n\n\t@Override\n\tpublic void captureStill() {\n\t\tcheckReleased();\n\t\tsuper.captureStill();\n\t}\n\n\t@Override\n\tpublic void captureStill(final String path) {\n\t\tcheckReleased();\n\t\tpost(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tsynchronized (UVCCameraHandlerMultiSurface.this) {\n\t\t\t\t\tif (mRendererHolder != null) {\n\t\t\t\t\t\tmRendererHolder.captureStill(path);\n\t\t\t\t\t\tupdateMedia(path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}\n"
  },
  {
    "path": "usbCameraCommon/src/main/java/com/serenegiant/widget/AspectRatioTextureView.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.widget;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.view.TextureView;\n\n/**\n * change the view size with keeping the specified aspect ratio.\n * if you set this view with in a FrameLayout and set property \"android:layout_gravity=\"center\",\n * you can show this view in the center of screen and keep the aspect ratio of content\n * XXX it is better that can set the aspect ratio as xml property\n */\npublic class AspectRatioTextureView extends TextureView\t// API >= 14\n\timplements IAspectRatioView {\n\n\tprivate static final boolean DEBUG = true;\t// TODO set false on release\n\tprivate static final String TAG = \"AbstractCameraView\";\n\n    private double mRequestedAspect = -1.0;\n\tprivate CameraViewInterface.Callback mCallback;\n\n\tpublic AspectRatioTextureView(final Context context) {\n\t\tthis(context, null, 0);\n\t}\n\n\tpublic AspectRatioTextureView(final Context context, final AttributeSet attrs) {\n\t\tthis(context, attrs, 0);\n\t}\n\n\tpublic AspectRatioTextureView(final Context context, final AttributeSet attrs, final int defStyle) {\n\t\tsuper(context, attrs, defStyle);\n\t}\n\n\t@Override\n    public void setAspectRatio(final double aspectRatio) {\n        if (aspectRatio < 0) {\n            throw new IllegalArgumentException();\n        }\n        if (mRequestedAspect != aspectRatio) {\n            mRequestedAspect = aspectRatio;\n            requestLayout();\n        }\n    }\n\n\t@Override\n    public void setAspectRatio(final int width, final int height) {\n\t\tsetAspectRatio(width / (double)height);\n    }\n\n\t@Override\n\tpublic double getAspectRatio() {\n\t\treturn mRequestedAspect;\n\t}\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n\n\t\tif (mRequestedAspect > 0) {\n\t\t\tint initialWidth = MeasureSpec.getSize(widthMeasureSpec);\n\t\t\tint initialHeight = MeasureSpec.getSize(heightMeasureSpec);\n\n\t\t\tfinal int horizPadding = getPaddingLeft() + getPaddingRight();\n\t\t\tfinal int vertPadding = getPaddingTop() + getPaddingBottom();\n\t\t\tinitialWidth -= horizPadding;\n\t\t\tinitialHeight -= vertPadding;\n\n\t\t\tfinal double viewAspectRatio = (double)initialWidth / initialHeight;\n\t\t\tfinal double aspectDiff = mRequestedAspect / viewAspectRatio - 1;\n\n\t\t\tif (Math.abs(aspectDiff) > 0.01) {\n\t\t\t\tif (aspectDiff > 0) {\n\t\t\t\t\t// width priority decision\n\t\t\t\t\tinitialHeight = (int) (initialWidth / mRequestedAspect);\n\t\t\t\t} else {\n\t\t\t\t\t// height priority decision\n\t\t\t\t\tinitialWidth = (int) (initialHeight * mRequestedAspect);\n\t\t\t\t}\n\t\t\t\tinitialWidth += horizPadding;\n\t\t\t\tinitialHeight += vertPadding;\n\t\t\t\twidthMeasureSpec = MeasureSpec.makeMeasureSpec(initialWidth, MeasureSpec.EXACTLY);\n\t\t\t\theightMeasureSpec = MeasureSpec.makeMeasureSpec(initialHeight, MeasureSpec.EXACTLY);\n\t\t\t}\n\t\t}\n\n        super.onMeasure(widthMeasureSpec, heightMeasureSpec);\n    }\n\n}\n"
  },
  {
    "path": "usbCameraCommon/src/main/java/com/serenegiant/widget/CameraViewInterface.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.widget;\n\nimport android.graphics.Bitmap;\nimport android.graphics.SurfaceTexture;\nimport android.view.Surface;\n\nimport com.serenegiant.encoder.IVideoEncoder;\n\npublic interface CameraViewInterface extends IAspectRatioView {\n\tpublic interface Callback {\n\t\tpublic void onSurfaceCreated(CameraViewInterface view, Surface surface);\n\t\tpublic void onSurfaceChanged(CameraViewInterface view, Surface surface, int width, int height);\n\t\tpublic void onSurfaceDestroy(CameraViewInterface view, Surface surface);\n\t}\n\tpublic void onPause();\n\tpublic void onResume();\n\tpublic void setCallback(Callback callback);\n\tpublic SurfaceTexture getSurfaceTexture();\n\tpublic Surface getSurface();\n\tpublic boolean hasSurface();\n\tpublic void setVideoEncoder(final IVideoEncoder encoder);\n\tpublic Bitmap captureStillImage();\n}\n"
  },
  {
    "path": "usbCameraCommon/src/main/java/com/serenegiant/widget/UVCCameraTextureView.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.widget;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.SurfaceTexture;\nimport android.os.Handler;\nimport android.os.Looper;\nimport android.os.Message;\nimport android.util.AttributeSet;\nimport android.util.Log;\nimport android.view.Surface;\nimport android.view.TextureView;\n\nimport com.serenegiant.encoder.IVideoEncoder;\nimport com.serenegiant.encoder.MediaEncoder;\nimport com.serenegiant.encoder.MediaVideoEncoder;\nimport com.serenegiant.glutils.EGLBase;\nimport com.serenegiant.glutils.GLDrawer2D;\nimport com.serenegiant.glutils.es1.GLHelper;\nimport com.serenegiant.utils.FpsCounter;\n\n/**\n * change the view size with keeping the specified aspect ratio.\n * if you set this view with in a FrameLayout and set property \"android:layout_gravity=\"center\",\n * you can show this view in the center of screen and keep the aspect ratio of content\n * XXX it is better that can set the aspect ratio as xml property\n */\npublic class UVCCameraTextureView extends AspectRatioTextureView    // API >= 14\n\timplements TextureView.SurfaceTextureListener, CameraViewInterface {\n\n\tprivate static final boolean DEBUG = true;\t// TODO set false on release\n\tprivate static final String TAG = \"UVCCameraTextureView\";\n\n    private boolean mHasSurface;\n\tprivate RenderHandler mRenderHandler;\n    private final Object mCaptureSync = new Object();\n    private Bitmap mTempBitmap;\n    private boolean mReqesutCaptureStillImage;\n\tprivate Callback mCallback;\n\t/** for calculation of frame rate */\n\tprivate final FpsCounter mFpsCounter = new FpsCounter();\n\n\tpublic UVCCameraTextureView(final Context context) {\n\t\tthis(context, null, 0);\n\t}\n\n\tpublic UVCCameraTextureView(final Context context, final AttributeSet attrs) {\n\t\tthis(context, attrs, 0);\n\t}\n\n\tpublic UVCCameraTextureView(final Context context, final AttributeSet attrs, final int defStyle) {\n\t\tsuper(context, attrs, defStyle);\n\t\tsetSurfaceTextureListener(this);\n\t}\n\n\t@Override\n\tpublic void onResume() {\n\t\tif (DEBUG) Log.v(TAG, \"onResume:\");\n\t\tif (mHasSurface) {\n\t\t\tmRenderHandler = RenderHandler.createHandler(mFpsCounter, super.getSurfaceTexture(), getWidth(), getHeight());\n\t\t}\n\t}\n\n\t@Override\n\tpublic void onPause() {\n\t\tif (DEBUG) Log.v(TAG, \"onPause:\");\n\t\tif (mRenderHandler != null) {\n\t\t\tmRenderHandler.release();\n\t\t\tmRenderHandler = null;\n\t\t}\n\t\tif (mTempBitmap != null) {\n\t\t\tmTempBitmap.recycle();\n\t\t\tmTempBitmap = null;\n\t\t}\n\t}\n\n\t@Override\n\tpublic void onSurfaceTextureAvailable(final SurfaceTexture surface, final int width, final int height) {\n\t\tif (DEBUG) Log.v(TAG, \"onSurfaceTextureAvailable:\" + surface);\n\t\tif (mRenderHandler == null) {\n\t\t\tmRenderHandler = RenderHandler.createHandler(mFpsCounter, surface, width, height);\n\t\t} else {\n\t\t\tmRenderHandler.resize(width, height);\n\t\t}\n\t\tmHasSurface = true;\n\t\tif (mCallback != null) {\n\t\t\tmCallback.onSurfaceCreated(this, getSurface());\n\t\t}\n\t}\n\n\t@Override\n\tpublic void onSurfaceTextureSizeChanged(final SurfaceTexture surface, final int width, final int height) {\n\t\tif (DEBUG) Log.v(TAG, \"onSurfaceTextureSizeChanged:\" + surface);\n\t\tif (mRenderHandler != null) {\n\t\t\tmRenderHandler.resize(width, height);\n\t\t}\n\t\tif (mCallback != null) {\n\t\t\tmCallback.onSurfaceChanged(this, getSurface(), width, height);\n\t\t}\n\t}\n\n\t@Override\n\tpublic boolean onSurfaceTextureDestroyed(final SurfaceTexture surface) {\n\t\tif (DEBUG) Log.v(TAG, \"onSurfaceTextureDestroyed:\" + surface);\n\t\tif (mRenderHandler != null) {\n\t\t\tmRenderHandler.release();\n\t\t\tmRenderHandler = null;\n\t\t}\n\t\tmHasSurface = false;\n\t\tif (mCallback != null) {\n\t\t\tmCallback.onSurfaceDestroy(this, getSurface());\n\t\t}\n\t\tif (mPreviewSurface != null) {\n\t\t\tmPreviewSurface.release();\n\t\t\tmPreviewSurface = null;\n\t\t}\n\t\treturn true;\n\t}\n\n\t@Override\n\tpublic void onSurfaceTextureUpdated(final SurfaceTexture surface) {\n\t\tsynchronized (mCaptureSync) {\n\t\t\tif (mReqesutCaptureStillImage) {\n\t\t\t\tmReqesutCaptureStillImage = false;\n\t\t\t\tif (mTempBitmap == null)\n\t\t\t\t\tmTempBitmap = getBitmap();\n\t\t\t\telse\n\t\t\t\t\tgetBitmap(mTempBitmap);\n\t\t\t\tmCaptureSync.notifyAll();\n\t\t\t}\n\t\t}\n\t}\n\n\t@Override\n\tpublic boolean hasSurface() {\n\t\treturn mHasSurface;\n\t}\n\n\t/**\n\t * capture preview image as a bitmap\n\t * this method blocks current thread until bitmap is ready\n\t * if you call this method at almost same time from different thread,\n\t * the returned bitmap will be changed while you are processing the bitmap\n\t * (because we return same instance of bitmap on each call for memory saving)\n\t * if you need to call this method from multiple thread,\n\t * you should change this method(copy and return)\n\t */\n\t@Override\n\tpublic Bitmap captureStillImage() {\n\t\tsynchronized (mCaptureSync) {\n\t\t\tmReqesutCaptureStillImage = true;\n\t\t\ttry {\n\t\t\t\tmCaptureSync.wait();\n\t\t\t} catch (final InterruptedException e) {\n\t\t\t}\n\t\t\treturn mTempBitmap;\n\t\t}\n\t}\n\n\t@Override\n\tpublic SurfaceTexture getSurfaceTexture() {\n\t\treturn mRenderHandler != null ? mRenderHandler.getPreviewTexture() : null;\n\t}\n\n\tprivate Surface mPreviewSurface;\n\t@Override\n\tpublic Surface getSurface() {\n\t\tif (DEBUG) Log.v(TAG, \"getSurface:hasSurface=\" + mHasSurface);\n\t\tif (mPreviewSurface == null) {\n\t\t\tfinal SurfaceTexture st = getSurfaceTexture();\n\t\t\tif (st != null) {\n\t\t\t\tmPreviewSurface = new Surface(st);\n\t\t\t}\n\t\t}\n\t\treturn mPreviewSurface;\n\t}\n\n\t@Override\n\tpublic void setVideoEncoder(final IVideoEncoder encoder) {\n\t\tif (mRenderHandler != null)\n\t\t\tmRenderHandler.setVideoEncoder(encoder);\n\t}\n\n\t@Override\n\tpublic void setCallback(final Callback callback) {\n\t\tmCallback = callback;\n\t}\n\n\tpublic void resetFps() {\n\t\tmFpsCounter.reset();\n\t}\n\t\n\t/** update frame rate of image processing */\n\tpublic void updateFps() {\n\t\tmFpsCounter.update();\n\t}\n\n\t/**\n\t * get current frame rate of image processing\n\t * @return\n\t */\n\tpublic float getFps() {\n\t\treturn mFpsCounter.getFps();\n\t}\n\n\t/**\n\t * get total frame rate from start\n\t * @return\n\t */\n\tpublic float getTotalFps() {\n\t\treturn mFpsCounter.getTotalFps();\n\t}\n\n\t/**\n\t * render camera frames on this view on a private thread\n\t * @author saki\n\t *\n\t */\n\tprivate static final class RenderHandler extends Handler\n\t\timplements SurfaceTexture.OnFrameAvailableListener  {\n\n\t\tprivate static final int MSG_REQUEST_RENDER = 1;\n\t\tprivate static final int MSG_SET_ENCODER = 2;\n\t\tprivate static final int MSG_CREATE_SURFACE = 3;\n\t\tprivate static final int MSG_RESIZE = 4;\n\t\tprivate static final int MSG_TERMINATE = 9;\n\n\t\tprivate RenderThread mThread;\n\t\tprivate boolean mIsActive = true;\n\t\tprivate final FpsCounter mFpsCounter;\n\n\t\tpublic static final RenderHandler createHandler(final FpsCounter counter,\n\t\t\tfinal SurfaceTexture surface, final int width, final int height) {\n\t\t\t\n\t\t\tfinal RenderThread thread = new RenderThread(counter, surface, width, height);\n\t\t\tthread.start();\n\t\t\treturn thread.getHandler();\n\t\t}\n\n\t\tprivate RenderHandler(final FpsCounter counter, final RenderThread thread) {\n\t\t\tmThread = thread;\n\t\t\tmFpsCounter = counter;\n\t\t}\n\n\t\tpublic final void setVideoEncoder(final IVideoEncoder encoder) {\n\t\t\tif (DEBUG) Log.v(TAG, \"setVideoEncoder:\");\n\t\t\tif (mIsActive)\n\t\t\t\tsendMessage(obtainMessage(MSG_SET_ENCODER, encoder));\n\t\t}\n\n\t\tpublic final SurfaceTexture getPreviewTexture() {\n\t\t\tif (DEBUG) Log.v(TAG, \"getPreviewTexture:\");\n\t\t\tif (mIsActive) {\n\t\t\t\tsynchronized (mThread.mSync) {\n\t\t\t\t\tsendEmptyMessage(MSG_CREATE_SURFACE);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmThread.mSync.wait();\n\t\t\t\t\t} catch (final InterruptedException e) {\n\t\t\t\t\t}\n\t\t\t\t\treturn mThread.mPreviewSurface;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tpublic void resize(final int width, final int height) {\n\t\t\tif (DEBUG) Log.v(TAG, \"resize:\");\n\t\t\tif (mIsActive) {\n\t\t\t\tsynchronized (mThread.mSync) {\n\t\t\t\t\tsendMessage(obtainMessage(MSG_RESIZE, width, height));\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmThread.mSync.wait();\n\t\t\t\t\t} catch (final InterruptedException e) {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic final void release() {\n\t\t\tif (DEBUG) Log.v(TAG, \"release:\");\n\t\t\tif (mIsActive) {\n\t\t\t\tmIsActive = false;\n\t\t\t\tremoveMessages(MSG_REQUEST_RENDER);\n\t\t\t\tremoveMessages(MSG_SET_ENCODER);\n\t\t\t\tsendEmptyMessage(MSG_TERMINATE);\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic final void onFrameAvailable(final SurfaceTexture surfaceTexture) {\n\t\t\tif (mIsActive) {\n\t\t\t\tmFpsCounter.count();\n\t\t\t\tsendEmptyMessage(MSG_REQUEST_RENDER);\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic final void handleMessage(final Message msg) {\n\t\t\tif (mThread == null) return;\n\t\t\tswitch (msg.what) {\n\t\t\tcase MSG_REQUEST_RENDER:\n\t\t\t\tmThread.onDrawFrame();\n\t\t\t\tbreak;\n\t\t\tcase MSG_SET_ENCODER:\n\t\t\t\tmThread.setEncoder((MediaEncoder)msg.obj);\n\t\t\t\tbreak;\n\t\t\tcase MSG_CREATE_SURFACE:\n\t\t\t\tmThread.updatePreviewSurface();\n\t\t\t\tbreak;\n\t\t\tcase MSG_RESIZE:\n\t\t\t\tmThread.resize(msg.arg1, msg.arg2);\n\t\t\t\tbreak;\n\t\t\tcase MSG_TERMINATE:\n\t\t\t\tLooper.myLooper().quit();\n\t\t\t\tmThread = null;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tsuper.handleMessage(msg);\n\t\t\t}\n\t\t}\n\n\t\tprivate static final class RenderThread extends Thread {\n\t    \tprivate final Object mSync = new Object();\n\t    \tprivate final SurfaceTexture mSurface;\n\t    \tprivate RenderHandler mHandler;\n\t    \tprivate EGLBase mEgl;\n\t    \t/** IEglSurface instance related to this TextureView */\n\t    \tprivate EGLBase.IEglSurface mEglSurface;\n\t    \tprivate GLDrawer2D mDrawer;\n\t    \tprivate int mTexId = -1;\n\t    \t/** SurfaceTexture instance to receive video images */\n\t    \tprivate SurfaceTexture mPreviewSurface;\n\t\t\tprivate final float[] mStMatrix = new float[16];\n\t\t\tprivate MediaEncoder mEncoder;\n\t\t\tprivate int mViewWidth, mViewHeight;\n\t\t\tprivate final FpsCounter mFpsCounter;\n\n\t\t\t/**\n\t\t\t * constructor\n\t\t\t * @param surface: drawing surface came from TexureView\n\t\t\t */\n\t    \tpublic RenderThread(final FpsCounter fpsCounter, final SurfaceTexture surface, final int width, final int height) {\n\t\t\t\tmFpsCounter = fpsCounter;\n\t    \t\tmSurface = surface;\n\t\t\t\tmViewWidth = width;\n\t\t\t\tmViewHeight = height;\n\t    \t\tsetName(\"RenderThread\");\n\t\t\t}\n\n\t\t\tpublic final RenderHandler getHandler() {\n\t\t\t\tif (DEBUG) Log.v(TAG, \"RenderThread#getHandler:\");\n\t            synchronized (mSync) {\n\t                // create rendering thread\n\t            \tif (mHandler == null)\n\t            \ttry {\n\t            \t\tmSync.wait();\n\t            \t} catch (final InterruptedException e) {\n\t                }\n\t            }\n\t            return mHandler;\n\t\t\t}\n\n\t\t\tpublic void resize(final int width, final int height) {\n\t\t\t\tif (((width > 0) && (width != mViewWidth)) || ((height > 0) && (height != mViewHeight))) {\n\t\t\t\t\tmViewWidth = width;\n\t\t\t\t\tmViewHeight = height;\n\t\t\t\t\tupdatePreviewSurface();\n\t\t\t\t} else {\n\t\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\t\tmSync.notifyAll();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic final void updatePreviewSurface() {\n\t            if (DEBUG) Log.i(TAG, \"RenderThread#updatePreviewSurface:\");\n\t            synchronized (mSync) {\n\t            \tif (mPreviewSurface != null) {\n\t            \t\tif (DEBUG) Log.d(TAG, \"updatePreviewSurface:release mPreviewSurface\");\n\t            \t\tmPreviewSurface.setOnFrameAvailableListener(null);\n\t            \t\tmPreviewSurface.release();\n\t            \t\tmPreviewSurface = null;\n\t            \t}\n\t\t\t\t\tmEglSurface.makeCurrent();\n\t\t            if (mTexId >= 0) {\n\t\t\t\t\t\tmDrawer.deleteTex(mTexId);\n\t\t            }\n\t\t    \t\t// create texture and SurfaceTexture for input from camera\n\t\t            mTexId = mDrawer.initTex();\n\t\t            if (DEBUG) Log.v(TAG, \"updatePreviewSurface:tex_id=\" + mTexId);\n\t\t            mPreviewSurface = new SurfaceTexture(mTexId);\n\t\t\t\t\tmPreviewSurface.setDefaultBufferSize(mViewWidth, mViewHeight);\n\t\t            mPreviewSurface.setOnFrameAvailableListener(mHandler);\n\t\t            // notify to caller thread that previewSurface is ready\n\t\t\t\t\tmSync.notifyAll();\n\t            }\n\t\t\t}\n\n\t\t\tpublic final void setEncoder(final MediaEncoder encoder) {\n\t\t\t\tif (DEBUG) Log.v(TAG, \"RenderThread#setEncoder:encoder=\" + encoder);\n\t\t\t\tif (encoder != null && (encoder instanceof MediaVideoEncoder)) {\n\t\t\t\t\t((MediaVideoEncoder)encoder).setEglContext(mEglSurface.getContext(), mTexId);\n\t\t\t\t}\n\t\t\t\tmEncoder = encoder;\n\t\t\t}\n\n/*\n * Now you can get frame data as ByteBuffer(as YUV/RGB565/RGBX/NV21 pixel format) using IFrameCallback interface\n * with UVCCamera#setFrameCallback instead of using following code samples.\n */\n/*\t\t\t// for part1\n \t\t\tprivate static final int BUF_NUM = 1;\n\t\t\tprivate static final int BUF_STRIDE = 640 * 480;\n\t\t\tprivate static final int BUF_SIZE = BUF_STRIDE * BUF_NUM;\n\t\t\tint cnt = 0;\n\t\t\tint offset = 0;\n\t\t\tfinal int pixels[] = new int[BUF_SIZE];\n\t\t\tfinal IntBuffer buffer = IntBuffer.wrap(pixels); */\n/*\t\t\t// for part2\n\t\t\tprivate ByteBuffer buf = ByteBuffer.allocateDirect(640 * 480 * 4);\n */\n\t\t\t/**\n\t\t\t * draw a frame (and request to draw for video capturing if it is necessary)\n\t\t\t */\n\t\t\tpublic final void onDrawFrame() {\n\t\t\t\tmEglSurface.makeCurrent();\n\t\t\t\t// update texture(came from camera)\n\t\t\t\tmPreviewSurface.updateTexImage();\n\t\t\t\t// get texture matrix\n\t\t\t\tmPreviewSurface.getTransformMatrix(mStMatrix);\n\t\t\t\t// notify video encoder if it exist\n\t\t\t\tif (mEncoder != null) {\n\t\t\t\t\t// notify to capturing thread that the camera frame is available.\n\t\t\t\t\tif (mEncoder instanceof MediaVideoEncoder)\n\t\t\t\t\t\t((MediaVideoEncoder)mEncoder).frameAvailableSoon(mStMatrix);\n\t\t\t\t\telse\n\t\t\t\t\t\tmEncoder.frameAvailableSoon();\n\t\t\t\t}\n\t\t\t\t// draw to preview screen\n\t\t\t\tmDrawer.draw(mTexId, mStMatrix, 0);\n\t\t\t\tmEglSurface.swap();\n/*\t\t\t\t// sample code to read pixels into Buffer and save as a Bitmap (part1)\n\t\t\t\tbuffer.position(offset);\n\t\t\t\tGLES20.glReadPixels(0, 0, 640, 480, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, buffer);\n\t\t\t\tif (++cnt == 100) { // save as a Bitmap, only once on this sample code\n\t\t\t\t\t// if you save every frame as a Bitmap, app will crash by Out of Memory exception...\n\t\t\t\t\tLog.i(TAG, \"Capture image using glReadPixels:offset=\" + offset);\n\t\t\t\t\tfinal Bitmap bitmap = createBitmap(pixels,offset,  640, 480);\n\t\t\t\t\tfinal File outputFile = MediaMuxerWrapper.getCaptureFile(Environment.DIRECTORY_DCIM, \".png\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfinal BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(outputFile));\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tbitmap.compress(CompressFormat.PNG, 100, os);\n\t\t\t\t\t\t\t\tos.flush();\n\t\t\t\t\t\t\t\tbitmap.recycle();\n\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tos.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toffset = (offset + BUF_STRIDE) % BUF_SIZE;\n*/\n/*\t\t\t\t// sample code to read pixels into Buffer and save as a Bitmap (part2)\n\t\t        buf.order(ByteOrder.LITTLE_ENDIAN);\t// it is enough to call this only once.\n\t\t        GLES20.glReadPixels(0, 0, 640, 480, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, buf);\n\t\t        buf.rewind();\n\t\t\t\tif (++cnt == 100) {\t// save as a Bitmap, only once on this sample code\n\t\t\t\t\t// if you save every frame as a Bitmap, app will crash by Out of Memory exception...\n\t\t\t\t\tfinal File outputFile = MediaMuxerWrapper.getCaptureFile(Environment.DIRECTORY_DCIM, \".png\");\n\t\t\t        BufferedOutputStream os = null;\n\t\t\t\t\ttry {\n\t\t\t\t        try {\n\t\t\t\t            os = new BufferedOutputStream(new FileOutputStream(outputFile));\n\t\t\t\t            Bitmap bmp = Bitmap.createBitmap(640, 480, Bitmap.Config.ARGB_8888);\n\t\t\t\t            bmp.copyPixelsFromBuffer(buf);\n\t\t\t\t            bmp.compress(Bitmap.CompressFormat.PNG, 90, os);\n\t\t\t\t            bmp.recycle();\n\t\t\t\t        } finally {\n\t\t\t\t            if (os != null) os.close();\n\t\t\t\t        }\n\t\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t}\n\t\t\t\t}\n*/\n\t\t\t}\n\n/*\t\t\t// sample code to read pixels into IntBuffer and save as a Bitmap (part1)\n\t\t\tprivate static Bitmap createBitmap(final int[] pixels, final int offset, final int width, final int height) {\n\t\t\t\tfinal Paint paint = new Paint(Paint.FILTER_BITMAP_FLAG);\n\t\t\t\tpaint.setColorFilter(new ColorMatrixColorFilter(new ColorMatrix(new float[] {\n\t\t\t\t\t\t0, 0, 1, 0, 0,\n\t\t\t\t\t\t0, 1, 0, 0, 0,\n\t\t\t\t\t\t1, 0, 0, 0, 0,\n\t\t\t\t\t\t0, 0, 0, 1, 0\n\t\t\t\t\t})));\n\n\t\t\t\tfinal Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);\n\t\t\t\tfinal Canvas canvas = new Canvas(bitmap);\n\n\t\t\t\tfinal Matrix matrix = new Matrix();\n\t\t\t\tmatrix.postScale(1.0f, -1.0f);\n\t\t\t\tmatrix.postTranslate(0, height);\n\t\t\t\tcanvas.concat(matrix);\n\n\t\t\t\tcanvas.drawBitmap(pixels, offset, width, 0, 0, width, height, false, paint);\n\n\t\t\t\treturn bitmap;\n\t\t\t} */\n\n\t\t\t@Override\n\t\t\tpublic final void run() {\n\t\t\t\tLog.d(TAG, getName() + \" started\");\n\t            init();\n\t            Looper.prepare();\n\t            synchronized (mSync) {\n\t            \tmHandler = new RenderHandler(mFpsCounter, this);\n\t                mSync.notify();\n\t            }\n\n\t            Looper.loop();\n\n\t            Log.d(TAG, getName() + \" finishing\");\n\t            release();\n\t            synchronized (mSync) {\n\t                mHandler = null;\n\t                mSync.notify();\n\t            }\n\t\t\t}\n\n\t\t\tprivate final void init() {\n\t\t\t\tif (DEBUG) Log.v(TAG, \"RenderThread#init:\");\n\t\t\t\t// create EGLContext for this thread\n\t            mEgl = EGLBase.createFrom(null, false, false);\n\t    \t\tmEglSurface = mEgl.createFromSurface(mSurface);\n\t    \t\tmEglSurface.makeCurrent();\n\t    \t\t// create drawing object\n\t    \t\tmDrawer = new GLDrawer2D(true);\n\t\t\t}\n\n\t    \tprivate final void release() {\n\t\t\t\tif (DEBUG) Log.v(TAG, \"RenderThread#release:\");\n\t    \t\tif (mDrawer != null) {\n\t    \t\t\tmDrawer.release();\n\t    \t\t\tmDrawer = null;\n\t    \t\t}\n\t    \t\tif (mPreviewSurface != null) {\n\t    \t\t\tmPreviewSurface.release();\n\t    \t\t\tmPreviewSurface = null;\n\t    \t\t}\n\t            if (mTexId >= 0) {\n\t            \tGLHelper.deleteTex(mTexId);\n\t            \tmTexId = -1;\n\t            }\n\t    \t\tif (mEglSurface != null) {\n\t    \t\t\tmEglSurface.release();\n\t    \t\t\tmEglSurface = null;\n\t    \t\t}\n\t    \t\tif (mEgl != null) {\n\t    \t\t\tmEgl.release();\n\t    \t\t\tmEgl = null;\n\t    \t\t}\n\t    \t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "usbCameraCommon/src/main/res/values/strings.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\t<string name=\"app_name\">encoder</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest/build.gradle",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\napply plugin: 'com.android.application'\n\nandroid {\n\tcompileSdkVersion versionCompiler\n\tbuildToolsVersion versionBuildTool\n\n\tcompileOptions {\n\t\tsourceCompatibility javaSourceCompatibility\n\t\ttargetCompatibility javaTargetCompatibility\n\t}\n\n    defaultConfig {\n        applicationId \"com.serenegiant.usbcameratest\"\n        minSdkVersion 14\n\t\ttargetSdkVersion versionTarget\n\t\tversionCode 8\n\t\tversionName \"3.00\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'\n        }\n    }\n}\n\ndependencies {\n\tapi fileTree(dir: 'libs', include: ['*.jar'])\n\n\timplementation \"com.android.support:support-v4:${supportLibVersion}\"\n\timplementation \"com.android.support:support-annotations:${supportLibVersion}\"\n\n\timplementation(\"com.serenegiant:common:${commonLibVersion}\") {\n\t\texclude module: 'support-v4'\n\t}\n\timplementation project(':libuvccamera')\n}\n"
  },
  {
    "path": "usbCameraTest/lint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<lint>\n</lint>"
  },
  {
    "path": "usbCameraTest/proguard-project.txt",
    "content": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in that file.\n#\n# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in ${sdk.dir}/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the ProGuard\n# include property in project.properties.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n-keepclassmembers public class com.serenegiant.usb.UVCCamera {\n\tpublic *;\n\tprotected *;\n\tprivate *;\n}\n"
  },
  {
    "path": "usbCameraTest/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.serenegiant.usbcameratest\" >\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.serenegiant.usbcameratest.MainActivity\"\n            android:label=\"@string/app_name\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "usbCameraTest/src/main/java/com/serenegiant/usbcameratest/MainActivity.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usbcameratest;\n\nimport android.graphics.SurfaceTexture;\nimport android.hardware.usb.UsbDevice;\nimport android.os.Bundle;\nimport android.view.Surface;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.widget.ImageButton;\nimport android.widget.Toast;\n\nimport com.serenegiant.common.BaseActivity;\nimport com.serenegiant.usb.CameraDialog;\nimport com.serenegiant.usb.IButtonCallback;\nimport com.serenegiant.usb.IStatusCallback;\nimport com.serenegiant.usb.USBMonitor;\nimport com.serenegiant.usb.USBMonitor.OnDeviceConnectListener;\nimport com.serenegiant.usb.USBMonitor.UsbControlBlock;\nimport com.serenegiant.usb.UVCCamera;\nimport com.serenegiant.widget.SimpleUVCCameraTextureView;\n\nimport java.nio.ByteBuffer;\n\npublic final class MainActivity extends BaseActivity implements CameraDialog.CameraDialogParent {\n\n\tprivate final Object mSync = new Object();\n    // for accessing USB and USB camera\n    private USBMonitor mUSBMonitor;\n\tprivate UVCCamera mUVCCamera;\n\tprivate SimpleUVCCameraTextureView mUVCCameraView;\n\t// for open&start / stop&close camera preview\n\tprivate ImageButton mCameraButton;\n\tprivate Surface mPreviewSurface;\n\n\t@Override\n\tprotected void onCreate(final Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_main);\n\t\tmCameraButton = (ImageButton)findViewById(R.id.camera_button);\n\t\tmCameraButton.setOnClickListener(mOnClickListener);\n\n\t\tmUVCCameraView = (SimpleUVCCameraTextureView)findViewById(R.id.UVCCameraTextureView1);\n\t\tmUVCCameraView.setAspectRatio(UVCCamera.DEFAULT_PREVIEW_WIDTH / (float)UVCCamera.DEFAULT_PREVIEW_HEIGHT);\n\n\t\tmUSBMonitor = new USBMonitor(this, mOnDeviceConnectListener);\n\n\t}\n\n\t@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tmUSBMonitor.register();\n\t\tsynchronized (mSync) {\n\t\t\tif (mUVCCamera != null) {\n\t\t\t\tmUVCCamera.startPreview();\n\t\t\t}\n\t\t}\n\t}\n\n\t@Override\n\tprotected void onStop() {\n\t\tsynchronized (mSync) {\n\t\t\tif (mUVCCamera != null) {\n\t\t\t\tmUVCCamera.stopPreview();\n\t\t\t}\n\t\t\tif (mUSBMonitor != null) {\n\t\t\t\tmUSBMonitor.unregister();\n\t\t\t}\n\t\t}\n\t\tsuper.onStop();\n\t}\n\n\t@Override\n\tprotected void onDestroy() {\n\t\tsynchronized (mSync) {\n\t\t\treleaseCamera();\n\t\t\tif (mToast != null) {\n\t\t\t\tmToast.cancel();\n\t\t\t\tmToast = null;\n\t\t\t}\n\t\t\tif (mUSBMonitor != null) {\n\t\t\t\tmUSBMonitor.destroy();\n\t\t\t\tmUSBMonitor = null;\n\t\t\t}\n\t\t}\n\t\tmUVCCameraView = null;\n\t\tmCameraButton = null;\n\t\tsuper.onDestroy();\n\t}\n\n\tprivate final OnClickListener mOnClickListener = new OnClickListener() {\n\t\t@Override\n\t\tpublic void onClick(final View view) {\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (mUVCCamera == null) {\n\t\t\t\t\tCameraDialog.showDialog(MainActivity.this);\n\t\t\t\t} else {\n\t\t\t\t\treleaseCamera();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate Toast mToast;\n\n\tprivate final OnDeviceConnectListener mOnDeviceConnectListener = new OnDeviceConnectListener() {\n\t\t@Override\n\t\tpublic void onAttach(final UsbDevice device) {\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_ATTACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onConnect(final UsbDevice device, final UsbControlBlock ctrlBlock, final boolean createNew) {\n\t\t\treleaseCamera();\n\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tfinal UVCCamera camera = new UVCCamera();\n\t\t\t\t\tcamera.open(ctrlBlock);\n\t\t\t\t\tcamera.setStatusCallback(new IStatusCallback() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onStatus(final int statusClass, final int event, final int selector,\n\t\t\t\t\t\t\t\t\t\t\t final int statusAttribute, final ByteBuffer data) {\n\t\t\t\t\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\tfinal Toast toast = Toast.makeText(MainActivity.this, \"onStatus(statusClass=\" + statusClass\n\t\t\t\t\t\t\t\t\t\t\t+ \"; \" +\n\t\t\t\t\t\t\t\t\t\t\t\"event=\" + event + \"; \" +\n\t\t\t\t\t\t\t\t\t\t\t\"selector=\" + selector + \"; \" +\n\t\t\t\t\t\t\t\t\t\t\t\"statusAttribute=\" + statusAttribute + \"; \" +\n\t\t\t\t\t\t\t\t\t\t\t\"data=...)\", Toast.LENGTH_SHORT);\n\t\t\t\t\t\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\t\t\t\t\t\tif (mToast != null) {\n\t\t\t\t\t\t\t\t\t\t\tmToast.cancel();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\ttoast.show();\n\t\t\t\t\t\t\t\t\t\tmToast = toast;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tcamera.setButtonCallback(new IButtonCallback() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onButton(final int button, final int state) {\n\t\t\t\t\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\tfinal Toast toast = Toast.makeText(MainActivity.this, \"onButton(button=\" + button + \"; \" +\n\t\t\t\t\t\t\t\t\t\t\t\"state=\" + state + \")\", Toast.LENGTH_SHORT);\n\t\t\t\t\t\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\t\t\t\t\t\tif (mToast != null) {\n\t\t\t\t\t\t\t\t\t\t\tmToast.cancel();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tmToast = toast;\n\t\t\t\t\t\t\t\t\t\ttoast.show();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n//\t\t\t\t\tcamera.setPreviewTexture(camera.getSurfaceTexture());\n\t\t\t\t\tif (mPreviewSurface != null) {\n\t\t\t\t\t\tmPreviewSurface.release();\n\t\t\t\t\t\tmPreviewSurface = null;\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcamera.setPreviewSize(UVCCamera.DEFAULT_PREVIEW_WIDTH, UVCCamera.DEFAULT_PREVIEW_HEIGHT, UVCCamera.FRAME_FORMAT_MJPEG);\n\t\t\t\t\t} catch (final IllegalArgumentException e) {\n\t\t\t\t\t\t// fallback to YUV mode\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcamera.setPreviewSize(UVCCamera.DEFAULT_PREVIEW_WIDTH, UVCCamera.DEFAULT_PREVIEW_HEIGHT, UVCCamera.DEFAULT_PREVIEW_MODE);\n\t\t\t\t\t\t} catch (final IllegalArgumentException e1) {\n\t\t\t\t\t\t\tcamera.destroy();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfinal SurfaceTexture st = mUVCCameraView.getSurfaceTexture();\n\t\t\t\t\tif (st != null) {\n\t\t\t\t\t\tmPreviewSurface = new Surface(st);\n\t\t\t\t\t\tcamera.setPreviewDisplay(mPreviewSurface);\n//\t\t\t\t\t\tcamera.setFrameCallback(mIFrameCallback, UVCCamera.PIXEL_FORMAT_RGB565/*UVCCamera.PIXEL_FORMAT_NV21*/);\n\t\t\t\t\t\tcamera.startPreview();\n\t\t\t\t\t}\n\t\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\t\tmUVCCamera = camera;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDisconnect(final UsbDevice device, final UsbControlBlock ctrlBlock) {\n\t\t\t// XXX you should check whether the coming device equal to camera device that currently using\n\t\t\treleaseCamera();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDettach(final UsbDevice device) {\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_DETACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onCancel(final UsbDevice device) {\n\t\t}\n\t};\n\n\tprivate synchronized void releaseCamera() {\n\t\tsynchronized (mSync) {\n\t\t\tif (mUVCCamera != null) {\n\t\t\t\ttry {\n\t\t\t\t\tmUVCCamera.setStatusCallback(null);\n\t\t\t\t\tmUVCCamera.setButtonCallback(null);\n\t\t\t\t\tmUVCCamera.close();\n\t\t\t\t\tmUVCCamera.destroy();\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\t//\n\t\t\t\t}\n\t\t\t\tmUVCCamera = null;\n\t\t\t}\n\t\t\tif (mPreviewSurface != null) {\n\t\t\t\tmPreviewSurface.release();\n\t\t\t\tmPreviewSurface = null;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * to access from CameraDialog\n\t * @return\n\t */\n\t@Override\n\tpublic USBMonitor getUSBMonitor() {\n\t\treturn mUSBMonitor;\n\t}\n\n\t@Override\n\tpublic void onDialogResult(boolean canceled) {\n\t\tif (canceled) {\n\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\t// FIXME\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t}\n\t}\n\n\t// if you need frame data as byte array on Java side, you can use this callback method with UVCCamera#setFrameCallback\n\t// if you need to create Bitmap in IFrameCallback, please refer following snippet.\n/*\tfinal Bitmap bitmap = Bitmap.createBitmap(UVCCamera.DEFAULT_PREVIEW_WIDTH, UVCCamera.DEFAULT_PREVIEW_HEIGHT, Bitmap.Config.RGB_565);\n\tprivate final IFrameCallback mIFrameCallback = new IFrameCallback() {\n\t\t@Override\n\t\tpublic void onFrame(final ByteBuffer frame) {\n\t\t\tframe.clear();\n\t\t\tsynchronized (bitmap) {\n\t\t\t\tbitmap.copyPixelsFromBuffer(frame);\n\t\t\t}\n\t\t\tmImageView.post(mUpdateImageTask);\n\t\t}\n\t};\n\t\n\tprivate final Runnable mUpdateImageTask = new Runnable() {\n\t\t@Override\n\t\tpublic void run() {\n\t\t\tsynchronized (bitmap) {\n\t\t\t\tmImageView.setImageBitmap(bitmap);\n\t\t\t}\n\t\t}\n\t}; */\n}\n"
  },
  {
    "path": "usbCameraTest/src/main/java/com/serenegiant/widget/AspectRatioViewInterface.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.widget;\n\npublic interface AspectRatioViewInterface {\n    public void setAspectRatio(double aspectRatio);\n    public void onPause();\n    public void onResume();\n}\n"
  },
  {
    "path": "usbCameraTest/src/main/java/com/serenegiant/widget/SimpleUVCCameraTextureView.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.widget;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.view.TextureView;\n\n/**\n * change the view size with keeping the specified aspect ratio.\n * if you set this view with in a FrameLayout and set property \"android:layout_gravity=\"center\",\n * you can show this view in the center of screen and keep the aspect ratio of content\n * XXX it is better that can set the aspect raton a a xml property\n */\npublic class SimpleUVCCameraTextureView extends TextureView\t// API >= 14\n\timplements AspectRatioViewInterface {\n\n    private double mRequestedAspect = -1.0;\n\n\tpublic SimpleUVCCameraTextureView(final Context context) {\n\t\tthis(context, null, 0);\n\t}\n\n\tpublic SimpleUVCCameraTextureView(final Context context, final AttributeSet attrs) {\n\t\tthis(context, attrs, 0);\n\t}\n\n\tpublic SimpleUVCCameraTextureView(final Context context, final AttributeSet attrs, final int defStyle) {\n\t\tsuper(context, attrs, defStyle);\n\t}\n\n\t@Override\n\tpublic void onResume() {\n\t}\n\n\t@Override\n\tpublic void onPause() {\n\t}\n\n\t@Override\n    public void setAspectRatio(final double aspectRatio) {\n        if (aspectRatio < 0) {\n            throw new IllegalArgumentException();\n        }\n        if (mRequestedAspect != aspectRatio) {\n            mRequestedAspect = aspectRatio;\n            requestLayout();\n        }\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n\n\t\tif (mRequestedAspect > 0) {\n\t\t\tint initialWidth = MeasureSpec.getSize(widthMeasureSpec);\n\t\t\tint initialHeight = MeasureSpec.getSize(heightMeasureSpec);\n\n\t\t\tfinal int horizPadding = getPaddingLeft() + getPaddingRight();\n\t\t\tfinal int vertPadding = getPaddingTop() + getPaddingBottom();\n\t\t\tinitialWidth -= horizPadding;\n\t\t\tinitialHeight -= vertPadding;\n\n\t\t\tfinal double viewAspectRatio = (double)initialWidth / initialHeight;\n\t\t\tfinal double aspectDiff = mRequestedAspect / viewAspectRatio - 1;\n\n\t\t\tif (Math.abs(aspectDiff) > 0.01) {\n\t\t\t\tif (aspectDiff > 0) {\n\t\t\t\t\t// width priority decision\n\t\t\t\t\tinitialHeight = (int) (initialWidth / mRequestedAspect);\n\t\t\t\t} else {\n\t\t\t\t\t// height priority decison\n\t\t\t\t\tinitialWidth = (int) (initialHeight * mRequestedAspect);\n\t\t\t\t}\n\t\t\t\tinitialWidth += horizPadding;\n\t\t\t\tinitialHeight += vertPadding;\n\t\t\t\twidthMeasureSpec = MeasureSpec.makeMeasureSpec(initialWidth, MeasureSpec.EXACTLY);\n\t\t\t\theightMeasureSpec = MeasureSpec.makeMeasureSpec(initialHeight, MeasureSpec.EXACTLY);\n\t\t\t}\n\t\t}\n\n        super.onMeasure(widthMeasureSpec, heightMeasureSpec);\n    }\n\n}\n"
  },
  {
    "path": "usbCameraTest/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/container\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\"com.serenegiant.usbcameratest.MainActivity\"\n    tools:ignore=\"MergeRootFrame\" >\n\n    <com.serenegiant.widget.SimpleUVCCameraTextureView\n        android:id=\"@+id/UVCCameraTextureView1\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:layout_gravity=\"center\"\n        android:background=\"#ff000000\" />\n\n    <ImageButton\n        android:id=\"@+id/camera_button\"\n        android:layout_width=\"@dimen/button_size\"\n        android:layout_height=\"@dimen/button_size\"\n        android:contentDescription=\"@string/camera\"\n        android:scaleType=\"centerCrop\"\n        android:src=\"@android:drawable/ic_menu_camera\" />\n\n</FrameLayout>\n"
  },
  {
    "path": "usbCameraTest/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n\t<!-- Default screen margins, per the Android Design guidelines. -->\n\t<dimen name=\"activity_horizontal_margin\">16dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">16dp</dimen>\n\t<dimen name=\"button_size\">48dp</dimen>\n</resources>\n"
  },
  {
    "path": "usbCameraTest/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBCameraTest</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme, dependent on API level. This theme is replaced\n        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Light\">\n        <!--\n            Theme customizations available in newer API levels can go in\n            res/values-vXX/styles.xml, while customizations related to\n            backward-compatibility can go here.\n        -->\n    </style>\n\n    <!-- Application theme. -->\n    <style name=\"AppTheme\" parent=\"AppBaseTheme\">\n        <!-- All customizations that are NOT specific to a particular API-level can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest/src/main/res/values-ja/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBカメラテスト</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest/src/main/res/values-v11/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 11+. This theme completely replaces\n        AppBaseTheme from res/values/styles.xml on API 11+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light\">\n        <!-- API 11 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest/src/main/res/values-v14/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 14+. This theme completely replaces\n        AppBaseTheme from BOTH res/values/styles.xml and\n        res/values-v11/styles.xml on API 14+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light.DarkActionBar\">\n        <!-- API 14 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest/src/main/res/values-w820dp/dimens.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n         Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively).\n    -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">64dp</dimen>\n\t<dimen name=\"button_size\">48dp</dimen>\n\t<dimen name=\"list_font_size\">24sp</dimen>\n    \n</resources>\n"
  },
  {
    "path": "usbCameraTest/src/main/res/xml/device_filter.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<usb>\n\t<usb-device class=\"239\" subclass=\"2\" />\t<!-- all device of UVC -->\n\t<usb-device vendor-id=\"0x1b80\" />\n</usb>\n"
  },
  {
    "path": "usbCameraTest0/build.gradle",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\napply plugin: 'com.android.application'\n\nandroid {\n\tcompileSdkVersion versionCompiler\n\tbuildToolsVersion versionBuildTool\n\n\tcompileOptions {\n\t\tsourceCompatibility javaSourceCompatibility\n\t\ttargetCompatibility javaTargetCompatibility\n\t}\n\n    defaultConfig {\n        applicationId \"com.serenegiant.usbcameratest0\"\n        minSdkVersion 14\n\t\ttargetSdkVersion versionTarget\n\t\tversionCode 8\n\t\tversionName \"3.00\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'\n        }\n    }\n}\n\ndependencies {\n\tapi fileTree(dir: 'libs', include: ['*.jar'])\n\n\timplementation \"com.android.support:support-v4:${supportLibVersion}\"\n\timplementation \"com.android.support:support-annotations:${supportLibVersion}\"\n\n\timplementation(\"com.serenegiant:common:${commonLibVersion}\") {\n\t\texclude module: 'support-v4'\n\t}\n\timplementation project(':libuvccamera')\n}\n"
  },
  {
    "path": "usbCameraTest0/lint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<lint>\n</lint>"
  },
  {
    "path": "usbCameraTest0/proguard-project.txt",
    "content": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in that file.\n#\n# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in ${sdk.dir}/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the ProGuard\n# include property in project.properties.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n-keepclassmembers public class com.serenegiant.usb.UVCCamera {\n\tpublic *;\n\tprotected *;\n\tprivate *;\n}\n"
  },
  {
    "path": "usbCameraTest0/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.serenegiant.usbcameratest0\" >\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.serenegiant.usbcameratest0.MainActivity\"\n            android:label=\"@string/app_name\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "usbCameraTest0/src/main/java/com/serenegiant/usbcameratest0/MainActivity.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usbcameratest0;\n\nimport android.hardware.usb.UsbDevice;\nimport android.os.Bundle;\nimport android.util.Log;\nimport android.view.Surface;\nimport android.view.SurfaceHolder;\nimport android.view.SurfaceView;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.widget.ImageButton;\nimport android.widget.Toast;\n\nimport com.serenegiant.common.BaseActivity;\nimport com.serenegiant.usb.CameraDialog;\nimport com.serenegiant.usb.USBMonitor;\nimport com.serenegiant.usb.USBMonitor.OnDeviceConnectListener;\nimport com.serenegiant.usb.USBMonitor.UsbControlBlock;\nimport com.serenegiant.usb.UVCCamera;\n\npublic class MainActivity extends BaseActivity implements CameraDialog.CameraDialogParent {\n\tprivate static final boolean DEBUG = true;\t// TODO set false when production\n\tprivate static final String TAG = \"MainActivity\";\n\n    private final Object mSync = new Object();\n    // for accessing USB and USB camera\n    private USBMonitor mUSBMonitor;\n\tprivate UVCCamera mUVCCamera;\n\tprivate SurfaceView mUVCCameraView;\n\t// for open&start / stop&close camera preview\n\tprivate ImageButton mCameraButton;\n\tprivate Surface mPreviewSurface;\n\tprivate boolean isActive, isPreview;\n\n\t@Override\n\tprotected void onCreate(final Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_main);\n\t\tmCameraButton = (ImageButton)findViewById(R.id.camera_button);\n\t\tmCameraButton.setOnClickListener(mOnClickListener);\n\n\t\tmUVCCameraView = (SurfaceView)findViewById(R.id.camera_surface_view);\n\t\tmUVCCameraView.getHolder().addCallback(mSurfaceViewCallback);\n\n\t\tmUSBMonitor = new USBMonitor(this, mOnDeviceConnectListener);\n\t}\n\n\t@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tif (DEBUG) Log.v(TAG, \"onStart:\");\n\t\tsynchronized (mSync) {\n\t\t\tif (mUSBMonitor != null) {\n\t\t\t\tmUSBMonitor.register();\n\t\t\t}\n\t\t}\n\t}\n\n\t@Override\n\tprotected void onStop() {\n\t\tif (DEBUG) Log.v(TAG, \"onStop:\");\n\t\tsynchronized (mSync) {\n\t\t\tif (mUSBMonitor != null) {\n\t\t\t\tmUSBMonitor.unregister();\n\t\t\t}\n\t\t}\n\t\tsuper.onStop();\n\t}\n\n\t@Override\n\tprotected void onDestroy() {\n\t\tif (DEBUG) Log.v(TAG, \"onDestroy:\");\n\t\tsynchronized (mSync) {\n\t\t\tisActive = isPreview = false;\n\t\t\tif (mUVCCamera != null) {\n\t\t\t\tmUVCCamera.destroy();\n\t\t\t\tmUVCCamera = null;\n\t\t\t}\n\t\t\tif (mUSBMonitor != null) {\n\t\t\t\tmUSBMonitor.destroy();\n\t\t\t\tmUSBMonitor = null;\n\t\t\t}\n\t\t}\n\t\tmUVCCameraView = null;\n\t\tmCameraButton = null;\n\t\tsuper.onDestroy();\n\t}\n\n\tprivate final OnClickListener mOnClickListener = new OnClickListener() {\n\t\t@Override\n\t\tpublic void onClick(final View view) {\n\t\t\tif (mUVCCamera == null) {\n\t\t\t\t// XXX calling CameraDialog.showDialog is necessary at only first time(only when app has no permission).\n\t\t\t\tCameraDialog.showDialog(MainActivity.this);\n\t\t\t} else {\n\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\tmUVCCamera.destroy();\n\t\t\t\t\tmUVCCamera = null;\n\t\t\t\t\tisActive = isPreview = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate final OnDeviceConnectListener mOnDeviceConnectListener = new OnDeviceConnectListener() {\n\t\t@Override\n\t\tpublic void onAttach(final UsbDevice device) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onAttach:\");\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_ATTACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onConnect(final UsbDevice device, final UsbControlBlock ctrlBlock, final boolean createNew) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onConnect:\");\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\tmUVCCamera.destroy();\n\t\t\t\t}\n\t\t\t\tisActive = isPreview = false;\n\t\t\t}\n\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\t\tfinal UVCCamera camera = new UVCCamera();\n\t\t\t\t\t\tcamera.open(ctrlBlock);\n\t\t\t\t\t\tif (DEBUG) Log.i(TAG, \"supportedSize:\" + camera.getSupportedSize());\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcamera.setPreviewSize(UVCCamera.DEFAULT_PREVIEW_WIDTH, UVCCamera.DEFAULT_PREVIEW_HEIGHT, UVCCamera.FRAME_FORMAT_MJPEG);\n\t\t\t\t\t\t} catch (final IllegalArgumentException e) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t// fallback to YUV mode\n\t\t\t\t\t\t\t\tcamera.setPreviewSize(UVCCamera.DEFAULT_PREVIEW_WIDTH, UVCCamera.DEFAULT_PREVIEW_HEIGHT, UVCCamera.DEFAULT_PREVIEW_MODE);\n\t\t\t\t\t\t\t} catch (final IllegalArgumentException e1) {\n\t\t\t\t\t\t\t\tcamera.destroy();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmPreviewSurface = mUVCCameraView.getHolder().getSurface();\n\t\t\t\t\t\tif (mPreviewSurface != null) {\n\t\t\t\t\t\t\tisActive = true;\n\t\t\t\t\t\t\tcamera.setPreviewDisplay(mPreviewSurface);\n\t\t\t\t\t\t\tcamera.startPreview();\n\t\t\t\t\t\t\tisPreview = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\t\t\tmUVCCamera = camera;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDisconnect(final UsbDevice device, final UsbControlBlock ctrlBlock) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onDisconnect:\");\n\t\t\t// XXX you should check whether the comming device equal to camera device that currently using\n\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\t\t\tmUVCCamera.close();\n\t\t\t\t\t\t\tif (mPreviewSurface != null) {\n\t\t\t\t\t\t\t\tmPreviewSurface.release();\n\t\t\t\t\t\t\t\tmPreviewSurface = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisActive = isPreview = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDettach(final UsbDevice device) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onDettach:\");\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_DETACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onCancel(final UsbDevice device) {\n\t\t}\n\t};\n\n\t/**\n\t * to access from CameraDialog\n\t * @return\n\t */\n\t@Override\n\tpublic USBMonitor getUSBMonitor() {\n\t\treturn mUSBMonitor;\n\t}\n\n\t@Override\n\tpublic void onDialogResult(boolean canceled) {\n\t\tif (canceled) {\n\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\t// FIXME\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t}\n\t}\n\n\tprivate final SurfaceHolder.Callback mSurfaceViewCallback = new SurfaceHolder.Callback() {\n\t\t@Override\n\t\tpublic void surfaceCreated(final SurfaceHolder holder) {\n\t\t\tif (DEBUG) Log.v(TAG, \"surfaceCreated:\");\n\t\t}\n\n\t\t@Override\n\t\tpublic void surfaceChanged(final SurfaceHolder holder, final int format, final int width, final int height) {\n\t\t\tif ((width == 0) || (height == 0)) return;\n\t\t\tif (DEBUG) Log.v(TAG, \"surfaceChanged:\");\n\t\t\tmPreviewSurface = holder.getSurface();\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (isActive && !isPreview && (mUVCCamera != null)) {\n\t\t\t\t\tmUVCCamera.setPreviewDisplay(mPreviewSurface);\n\t\t\t\t\tmUVCCamera.startPreview();\n\t\t\t\t\tisPreview = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void surfaceDestroyed(final SurfaceHolder holder) {\n\t\t\tif (DEBUG) Log.v(TAG, \"surfaceDestroyed:\");\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\tmUVCCamera.stopPreview();\n\t\t\t\t}\n\t\t\t\tisPreview = false;\n\t\t\t}\n\t\t\tmPreviewSurface = null;\n\t\t}\n\t};\n}\n"
  },
  {
    "path": "usbCameraTest0/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/container\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\"com.serenegiant.usbcameratest0.MainActivity\"\n    tools:ignore=\"MergeRootFrame\" >\n\n    <SurfaceView\n        android:id=\"@+id/camera_surface_view\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\" />\n\n    <ImageButton\n        android:id=\"@+id/camera_button\"\n        android:layout_width=\"@dimen/button_size\"\n        android:layout_height=\"@dimen/button_size\"\n        android:contentDescription=\"@string/camera\"\n        android:scaleType=\"centerCrop\"\n        android:src=\"@android:drawable/ic_menu_camera\" />\n\n</FrameLayout>\n"
  },
  {
    "path": "usbCameraTest0/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n\t<!-- Default screen margins, per the Android Design guidelines. -->\n\t<dimen name=\"activity_horizontal_margin\">16dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">16dp</dimen>\n\t<dimen name=\"button_size\">48dp</dimen>\n</resources>\n"
  },
  {
    "path": "usbCameraTest0/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBCameraTest0</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest0/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme, dependent on API level. This theme is replaced\n        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Light\">\n        <!--\n            Theme customizations available in newer API levels can go in\n            res/values-vXX/styles.xml, while customizations related to\n            backward-compatibility can go here.\n        -->\n    </style>\n\n    <!-- Application theme. -->\n    <style name=\"AppTheme\" parent=\"AppBaseTheme\">\n        <!-- All customizations that are NOT specific to a particular API-level can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest0/src/main/res/values-ja/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBカメラテスト0</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest0/src/main/res/values-v11/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 11+. This theme completely replaces\n        AppBaseTheme from res/values/styles.xml on API 11+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light\">\n        <!-- API 11 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest0/src/main/res/values-v14/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 14+. This theme completely replaces\n        AppBaseTheme from BOTH res/values/styles.xml and\n        res/values-v11/styles.xml on API 14+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light.DarkActionBar\">\n        <!-- API 14 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest0/src/main/res/values-w820dp/dimens.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n         Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively).\n    -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">64dp</dimen>\n\t<dimen name=\"button_size\">48dp</dimen>\n\t<dimen name=\"list_font_size\">24sp</dimen>\n    \n</resources>\n"
  },
  {
    "path": "usbCameraTest0/src/main/res/xml/device_filter.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<usb>\n\t<usb-device class=\"239\" subclass=\"2\" />\t<!-- all device of UVC -->\n</usb>\n"
  },
  {
    "path": "usbCameraTest2/build.gradle",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\napply plugin: 'com.android.application'\n\nandroid {\n\tcompileSdkVersion versionCompiler\n\tbuildToolsVersion versionBuildTool\n\n\tcompileOptions {\n\t\tsourceCompatibility javaSourceCompatibility\n\t\ttargetCompatibility javaTargetCompatibility\n\t}\n\n    defaultConfig {\n        applicationId \"com.serenegiant.usbcameratest2\"\n        minSdkVersion 18\n\t\ttargetSdkVersion versionTarget\n\t\tversionCode 8\n\t\tversionName \"3.00\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'\n        }\n    }\n}\n\ndependencies {\n\tapi fileTree(dir: 'libs', include: ['*.jar'])\n\n\timplementation \"com.android.support:support-v4:${supportLibVersion}\"\n\timplementation \"com.android.support:support-annotations:${supportLibVersion}\"\n\n\timplementation(\"com.serenegiant:common:${commonLibVersion}\") {\n\t\texclude module: 'support-v4'\n\t}\n\timplementation project(':libuvccamera')\n}\n"
  },
  {
    "path": "usbCameraTest2/lint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<lint>\n</lint>"
  },
  {
    "path": "usbCameraTest2/proguard-project.txt",
    "content": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in that file.\n#\n# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in ${sdk.dir}/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the ProGuard\n# include property in project.properties.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n-keepclassmembers public class com.serenegiant.usb.UVCCamera {\n\tpublic *;\n\tprotected *;\n\tprivate *;\n}\n"
  },
  {
    "path": "usbCameraTest2/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.serenegiant.usbcameratest2\" >\n\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.serenegiant.usbcameratest2.MainActivity\"\n            android:label=\"@string/app_name\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "usbCameraTest2/src/main/java/com/serenegiant/usbcameratest2/MainActivity.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usbcameratest2;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.text.SimpleDateFormat;\nimport java.util.GregorianCalendar;\nimport java.util.Locale;\n\nimport android.graphics.SurfaceTexture;\nimport android.hardware.usb.UsbDevice;\nimport android.os.Bundle;\nimport android.os.Environment;\nimport android.text.TextUtils;\nimport android.util.Log;\nimport android.view.Surface;\nimport android.view.TextureView.SurfaceTextureListener;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.view.Window;\nimport android.widget.CompoundButton;\nimport android.widget.CompoundButton.OnCheckedChangeListener;\nimport android.widget.ImageButton;\nimport android.widget.Toast;\nimport android.widget.ToggleButton;\n\nimport com.serenegiant.common.BaseActivity;\nimport com.serenegiant.usb.CameraDialog;\nimport com.serenegiant.usb.USBMonitor;\nimport com.serenegiant.usb.USBMonitor.OnDeviceConnectListener;\nimport com.serenegiant.usb.USBMonitor.UsbControlBlock;\nimport com.serenegiant.usb.UVCCamera;\nimport com.serenegiant.video.Encoder;\nimport com.serenegiant.video.Encoder.EncodeListener;\nimport com.serenegiant.video.SurfaceEncoder;\nimport com.serenegiant.widget.SimpleUVCCameraTextureView;\n\npublic final class MainActivity extends BaseActivity implements CameraDialog.CameraDialogParent {\n\tprivate static final boolean DEBUG = true;\t// set false when releasing\n\tprivate static final String TAG = \"MainActivity\";\n\n    private static final int CAPTURE_STOP = 0;\n    private static final int CAPTURE_PREPARE = 1;\n    private static final int CAPTURE_RUNNING = 2;\n\n\tprivate final Object mSync = new Object();\n    // for accessing USB and USB camera\n    private USBMonitor mUSBMonitor;\n\tprivate UVCCamera mUVCCamera;\n\tprivate SimpleUVCCameraTextureView mUVCCameraView;\n\t// for open&start / stop&close camera preview\n\tprivate ToggleButton mCameraButton;\n\t// for start & stop movie capture\n\tprivate ImageButton mCaptureButton;\n\n\tprivate int mCaptureState = 0;\n\tprivate Surface mPreviewSurface;\n\n\t@Override\n\tprotected void onCreate(final Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\trequestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\tsetContentView(R.layout.activity_main);\n\n\t\tmCameraButton = (ToggleButton)findViewById(R.id.camera_button);\n\t\tmCameraButton.setOnCheckedChangeListener(mOnCheckedChangeListener);\n\n\t\tmCaptureButton = (ImageButton)findViewById(R.id.capture_button);\n\t\tmCaptureButton.setOnClickListener(mOnClickListener);\n\n\t\tmUVCCameraView = (SimpleUVCCameraTextureView)findViewById(R.id.UVCCameraTextureView1);\n\t\tmUVCCameraView.setAspectRatio(UVCCamera.DEFAULT_PREVIEW_WIDTH / (float)UVCCamera.DEFAULT_PREVIEW_HEIGHT);\n\t\tmUVCCameraView.setSurfaceTextureListener(mSurfaceTextureListener);\n\n\t\tmUSBMonitor = new USBMonitor(this, mOnDeviceConnectListener);\n\t}\n\n\t@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tsynchronized (mSync) {\n\t\t\tif (mUSBMonitor != null) {\n\t\t\t\tmUSBMonitor.register();\n\t\t\t}\n\t\t\tif (mUVCCamera != null)\n\t\t\t\tmUVCCamera.startPreview();\n\t\t}\n\t\tsetCameraButton(false);\n\t\tupdateItems();\n\t}\n\n\t@Override\n\tprotected void onStop() {\n\t\tsynchronized (mSync) {\n\t\t\tif (mUVCCamera != null) {\n\t\t\t\tstopCapture();\n\t\t\t\tmUVCCamera.stopPreview();\n\t\t\t}\n\t\t\tmUSBMonitor.unregister();\n\t\t}\n\t\tsetCameraButton(false);\n\t\tsuper.onStop();\n\t}\n\n\t@Override\n\tpublic void onDestroy() {\n\t\tsynchronized (mSync) {\n\t\t\tif (mUVCCamera != null) {\n\t\t\t\tmUVCCamera.destroy();\n\t\t\t\tmUVCCamera = null;\n\t\t\t}\n\t\t\tif (mUSBMonitor != null) {\n\t\t\t\tmUSBMonitor.destroy();\n\t\t\t\tmUSBMonitor = null;\n\t\t\t}\n\t\t}\n\t\tmCameraButton = null;\n\t\tmCaptureButton = null;\n\t\tmUVCCameraView = null;\n\t\tsuper.onDestroy();\n\t}\n\n\tprivate final OnCheckedChangeListener mOnCheckedChangeListener = new OnCheckedChangeListener() {\n\t\t@Override\n\t\tpublic void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) {\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (isChecked && mUVCCamera == null) {\n\t\t\t\t\tCameraDialog.showDialog(MainActivity.this);\n\t\t\t\t} else if (mUVCCamera != null) {\n\t\t\t\t\tmUVCCamera.destroy();\n\t\t\t\t\tmUVCCamera = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tupdateItems();\n\t\t}\n\t};\n\n\tprivate final OnClickListener mOnClickListener = new OnClickListener() {\n\t\t@Override\n\t\tpublic void onClick(final View v) {\n\t\t\tif (checkPermissionWriteExternalStorage()) {\n\t\t\t\tif (mCaptureState == CAPTURE_STOP) {\n\t\t\t\t\tstartCapture();\n\t\t\t\t} else {\n\t\t\t\t\tstopCapture();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate final OnDeviceConnectListener mOnDeviceConnectListener = new OnDeviceConnectListener() {\n\t\t@Override\n\t\tpublic void onAttach(final UsbDevice device) {\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_ATTACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onConnect(final UsbDevice device, final UsbControlBlock ctrlBlock, final boolean createNew) {\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\tmUVCCamera.destroy();\n\t\t\t\t\tmUVCCamera = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tfinal UVCCamera camera = new UVCCamera();\n\t\t\t\t\tcamera.open(ctrlBlock);\n\t\t\t\t\tif (DEBUG) Log.i(TAG, \"supportedSize:\" + camera.getSupportedSize());\n\t\t\t\t\tif (mPreviewSurface != null) {\n\t\t\t\t\t\tmPreviewSurface.release();\n\t\t\t\t\t\tmPreviewSurface = null;\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcamera.setPreviewSize(UVCCamera.DEFAULT_PREVIEW_WIDTH, UVCCamera.DEFAULT_PREVIEW_HEIGHT, UVCCamera.FRAME_FORMAT_MJPEG);\n\t\t\t\t\t} catch (final IllegalArgumentException e) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// fallback to YUV mode\n\t\t\t\t\t\t\tcamera.setPreviewSize(UVCCamera.DEFAULT_PREVIEW_WIDTH, UVCCamera.DEFAULT_PREVIEW_HEIGHT, UVCCamera.DEFAULT_PREVIEW_MODE);\n\t\t\t\t\t\t} catch (final IllegalArgumentException e1) {\n\t\t\t\t\t\t\tcamera.destroy();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfinal SurfaceTexture st = mUVCCameraView.getSurfaceTexture();\n\t\t\t\t\tif (st != null) {\n\t\t\t\t\t\tmPreviewSurface = new Surface(st);\n\t\t\t\t\t\tcamera.setPreviewDisplay(mPreviewSurface);\n\t\t\t\t\t\tcamera.startPreview();\n\t\t\t\t\t}\n\t\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\t\tmUVCCamera = camera;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDisconnect(final UsbDevice device, final UsbControlBlock ctrlBlock) {\n\t\t\t// XXX you should check whether the comming device equal to camera device that currently using\n\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\t\t\tmUVCCamera.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (mPreviewSurface != null) {\n\t\t\t\t\t\tmPreviewSurface.release();\n\t\t\t\t\t\tmPreviewSurface = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t\tsetCameraButton(false);\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDettach(final UsbDevice device) {\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_DETACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onCancel(final UsbDevice device) {\n\t\t\tsetCameraButton(false);\n\t\t}\n\t};\n\n\t/**\n\t * to access from CameraDialog\n\t * @return\n\t */\n\t@Override\n\tpublic USBMonitor getUSBMonitor() {\n\t\treturn mUSBMonitor;\n\t}\n\n\t@Override\n\tpublic void onDialogResult(boolean canceled) {\n\t\tif (canceled) {\n\t\t\tsetCameraButton(false);\n\t\t}\n\t}\n\n\tprivate void setCameraButton(final boolean isOn) {\n\t\trunOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tif (mCameraButton != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmCameraButton.setOnCheckedChangeListener(null);\n\t\t\t\t\t\tmCameraButton.setChecked(isOn);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tmCameraButton.setOnCheckedChangeListener(mOnCheckedChangeListener);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!isOn && (mCaptureButton != null)) {\n\t\t\t\t\tmCaptureButton.setVisibility(View.INVISIBLE);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t}\n\n//**********************************************************************\n\tprivate final SurfaceTextureListener mSurfaceTextureListener = new SurfaceTextureListener() {\n\n\t\t@Override\n\t\tpublic void onSurfaceTextureAvailable(final SurfaceTexture surface, final int width, final int height) {\n\t\t}\n\n\t\t@Override\n\t\tpublic void onSurfaceTextureSizeChanged(final SurfaceTexture surface, final int width, final int height) {\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean onSurfaceTextureDestroyed(final SurfaceTexture surface) {\n\t\t\tif (mPreviewSurface != null) {\n\t\t\t\tmPreviewSurface.release();\n\t\t\t\tmPreviewSurface = null;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t@Override\n\t\tpublic void onSurfaceTextureUpdated(final SurfaceTexture surface) {\n\t\t\tif (mEncoder != null && mCaptureState == CAPTURE_RUNNING) {\n\t\t\t\tmEncoder.frameAvailable();\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate Encoder mEncoder;\n\t/**\n\t * start capturing\n\t */\n\tprivate final void startCapture() {\n\t\tif (DEBUG) Log.v(TAG, \"startCapture:\");\n\t\tif (mEncoder == null && (mCaptureState == CAPTURE_STOP)) {\n\t\t\tmCaptureState = CAPTURE_PREPARE;\n\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tfinal String path = getCaptureFile(Environment.DIRECTORY_MOVIES, \".mp4\");\n\t\t\t\t\tif (!TextUtils.isEmpty(path)) {\n\t\t\t\t\t\tmEncoder = new SurfaceEncoder(path);\n\t\t\t\t\t\tmEncoder.setEncodeListener(mEncodeListener);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmEncoder.prepare();\n\t\t\t\t\t\t\tmEncoder.startRecording();\n\t\t\t\t\t\t} catch (final IOException e) {\n\t\t\t\t\t\t\tmCaptureState = CAPTURE_STOP;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tthrow new RuntimeException(\"Failed to start capture.\");\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t\tupdateItems();\n\t\t}\n\t}\n\n\t/**\n\t * stop capture if capturing\n\t */\n\tprivate final void stopCapture() {\n\t\tif (DEBUG) Log.v(TAG, \"stopCapture:\");\n\t\tqueueEvent(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\t\tmUVCCamera.stopCapture();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (mEncoder != null) {\n\t\t\t\t\tmEncoder.stopRecording();\n\t\t\t\t\tmEncoder = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t}\n\n    /**\n     * callbackds from Encoder\n     */\n    private final EncodeListener mEncodeListener = new EncodeListener() {\n\t\t@Override\n\t\tpublic void onPreapared(final Encoder encoder) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onPreapared:\");\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\tmUVCCamera.startCapture(((SurfaceEncoder)encoder).getInputSurface());\n\t\t\t\t}\n\t\t\t}\n\t\t\tmCaptureState = CAPTURE_RUNNING;\n\t\t}\n\n\t\t@Override\n\t\tpublic void onRelease(final Encoder encoder) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onRelease:\");\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\tmUVCCamera.stopCapture();\n\t\t\t\t}\n\t\t\t}\n\t\t\tmCaptureState = CAPTURE_STOP;\n\t\t\tupdateItems();\n\t\t}\n    };\n\n    private void updateItems() {\n    \tthis.runOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tmCaptureButton.setVisibility(mCameraButton.isChecked() ? View.VISIBLE : View.INVISIBLE);\n\t\t    \tmCaptureButton.setColorFilter(mCaptureState == CAPTURE_STOP ? 0 : 0xffff0000);\n\t\t\t}\n    \t});\n    }\n\n    /**\n     * create file path for saving movie / still image file\n     * @param type Environment.DIRECTORY_MOVIES / Environment.DIRECTORY_DCIM\n     * @param ext .mp4 / .png\n     * @return return null if can not write to storage\n     */\n    private static final String getCaptureFile(final String type, final String ext) {\n\t\tfinal File dir = new File(Environment.getExternalStoragePublicDirectory(type), \"USBCameraTest\");\n\t\tdir.mkdirs();\t// create directories if they do not exist\n        if (dir.canWrite()) {\n        \treturn (new File(dir, getDateTimeString() + ext)).toString();\n        }\n    \treturn null;\n    }\n\n    private static final SimpleDateFormat sDateTimeFormat = new SimpleDateFormat(\"yyyy-MM-dd-HH-mm-ss\", Locale.US);\n    private static final String getDateTimeString() {\n    \tfinal GregorianCalendar now = new GregorianCalendar();\n    \treturn sDateTimeFormat.format(now.getTime());\n    }\n\n}\n"
  },
  {
    "path": "usbCameraTest2/src/main/java/com/serenegiant/video/Encoder.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.video;\n\nimport java.io.IOException;\nimport java.nio.ByteBuffer;\n\nimport android.media.MediaCodec;\nimport android.media.MediaCodecInfo;\nimport android.media.MediaCodecList;\nimport android.media.MediaFormat;\nimport android.media.MediaMuxer;\nimport android.util.Log;\n\npublic abstract class Encoder implements Runnable {\n\tprivate static final boolean DEBUG = true;\t// TODO set false on release\n\tprivate static final String TAG = \"Encoder\";\n\n\tprotected static final int TIMEOUT_USEC = 10000;\t// 10[msec]\n\n\tprotected final Object mSync = new Object();\n\t/**\n\t * Flag that indicate this encoder is capturing now.\n\t */\n    protected volatile boolean mIsCapturing;\n\t/**\n\t * Flag that indicate the frame data will be available soon.\n\t */\n\tprivate int mRequestDrain;\n    /**\n     * Flag to request stop capturing\n     */\n    protected volatile boolean mRequestStop;\n    /**\n     * Flag that indicate encoder received EOS(End Of Stream)\n     */\n    protected boolean mIsEOS;\n    /**\n     * Flag the indicate the muxer is running\n     */\n    protected boolean mMuxerStarted;\n    /**\n     * Track Number\n     */\n    protected int mTrackIndex;\n    /**\n     * MediaCodec instance for encoding\n     */\n    protected MediaCodec mMediaCodec;\t\t\t\t// API >= 16(Android4.1.2)\n    protected EncodeListener mEncodeListener;\n    protected MediaCodec.BufferInfo mBufferInfo;\t// API >= 16(Android4.1.2)\n\tprotected String mOutputPath;\n\n\tprotected MediaMuxer mMuxer;\t\t\t\t\t// API >= 18\n\n    public interface EncodeListener {\n    \t/**\n    \t * callback after finishing initialization of encoder\n    \t * @param encoder\n    \t */\n    \tpublic void onPreapared(Encoder encoder);\n    \t/**\n    \t * callback before releasing encoder\n    \t * @param encoder\n    \t */\n    \tpublic void onRelease(Encoder encoder);\n    }\n\n//********************************************************************************\n    public Encoder() {\n    \t// create and start encoder thread\n        synchronized (mSync) {\n            new Thread(this, getClass().getSimpleName()).start();\n            try {\n                // wait for starting thread\n            \tmSync.wait();\n            } catch (final InterruptedException e) {\n            }\n        }\n    }\n\n//********************************************************************************\n    public boolean isCapturing() {\n    \treturn mIsCapturing;\n    }\n\n\tpublic void startRecording() {\n   \tif (DEBUG) Log.v(TAG, \"startRecording\");\n\t\tsynchronized (mSync) {\n\t\t\tmIsCapturing = true;\n\t\t\tmRequestStop = false;\n\t\t\tmSync.notifyAll();\n\t\t}\n\t}\n\n   /**\n    * the method to request stop encoding\n    */\n\tpublic void stopRecording() {\n\t\tif (DEBUG) Log.v(TAG, \"stopRecording\");\n\t\tmRequestStop = true;\n\t\tsynchronized (mSync) {\n\t\t\tif (!mIsCapturing) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmSync.notifyAll();\n\t        // We can not know when the encoding and writing finish.\n\t        // so we return immediately after request to avoid delay of caller thread\n\t\t}\n\t}\n\n    public void setOutputFile(final String filePath) {\n\t\tmOutputPath = filePath;\n\t}\n\n\tpublic abstract void prepare()  throws IOException;\n\n\tpublic void setEncodeListener(final EncodeListener listener) {\n\t\tmEncodeListener = listener;\n\t}\n\n    /**\n     * notify to frame data will arrive soon or already arrived.\n     * (request to process frame data)\n     */\n    public boolean frameAvailable() {\n//    \tif (DEBUG) Log.v(TAG, \"frameAvailable:\");\n        synchronized (mSync) {\n            if (!mIsCapturing || mRequestStop) {\n                return false;\n            }\n            mRequestDrain++;\n            mSync.notifyAll();\n        }\n        return true;\n    }\n\n    /**\n     * encoding loop on private thread\n     */\n\t@Override\n\tpublic void run() {\n\t\tif (DEBUG) Log.d(TAG, \"Encoder thread starting\");\n//\t\tandroid.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);\n        synchronized (mSync) {\n            mRequestStop = false;\n    \t\tmRequestDrain = 0;\n            mSync.notify();\n        }\n        final boolean isRunning = true;\n        boolean localRequestStop;\n        boolean localRequestDrain;\n        while (isRunning) {\n        \tsynchronized (mSync) {\n        \t\tlocalRequestStop = mRequestStop;\n        \t\tlocalRequestDrain = (mRequestDrain > 0);\n        \t\tif (localRequestDrain)\n        \t\t\tmRequestDrain--;\n        \t}\n\t        if (localRequestStop) {\n\t           \tdrain();\n\t           \t// request stop recording\n\t           \tsignalEndOfInputStream();\n\t           \t// process output data again for EOS signale\n\t           \tdrain();\n\t           \t// release all related objects\n\t           \trelease();\n\t           \tbreak;\n\t        }\n\t        if (localRequestDrain) {\n\t        \tdrain();\n\t        } else {\n\t        \tsynchronized (mSync) {\n\t\t        \ttry {\n\t\t\t\t\t\tmSync.wait();\n\t\t\t\t\t} catch (final InterruptedException e) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t        \t}\n        \t}\n        } // end of while\n\t\tif (DEBUG) Log.d(TAG, \"Encoder thread exiting\");\n        synchronized (mSync) {\n        \tmRequestStop = true;\n            mIsCapturing = false;\n        }\n\t}\n\n//********************************************************************************\n\n    /**\n     * Release all releated objects\n     */\n    protected void release() {\n\t\tif (DEBUG) Log.d(TAG, \"release:\");\n\t\ttry {\n\t\t\tmEncodeListener.onRelease(this);\n\t\t} catch (final Exception e) {\n\t\t\tLog.e(TAG, \"failed onStopped\", e);\n\t\t}\n\t\tmIsCapturing = false;\n        if (mMediaCodec != null) {\n\t\t\ttry {\n\t            mMediaCodec.stop();\n\t            mMediaCodec.release();\n\t            mMediaCodec = null;\n\t\t\t} catch (final Exception e) {\n\t\t\t\tLog.e(TAG, \"failed releasing MediaCodec\", e);\n\t\t\t}\n        }\n        if (mMuxerStarted) {\n       \t\tif (mMuxer != null) {\n       \t\t\ttry {\n       \t\t\t\tmMuxer.stop();\n    \t\t\t} catch (final Exception e) {\n    \t\t\t\tLog.e(TAG, \"failed stopping muxer\", e);\n    \t\t\t}\n       \t\t}\n        }\n        mBufferInfo = null;\n    }\n\n    protected void signalEndOfInputStream() {\n\t\tif (DEBUG) Log.d(TAG, \"sending EOS to encoder\");\n        // signalEndOfInputStream is only avairable for video encoding with surface\n        // and equivalent sending a empty buffer with BUFFER_FLAG_END_OF_STREAM flag.\n//\t\tmMediaCodec.signalEndOfInputStream();\t// API >= 18\n        encode(null, 0, getPTSUs());\n\t}\n\n    /**\n     * Method to set byte array to the MediaCodec encoder\n     * @param buffer\n     * @param length　length of byte array, zero means EOS.\n     * @param presentationTimeUs\n     */\n    protected void encode(final byte[] buffer, final int length, final long presentationTimeUs) {\n    \tif (!mIsCapturing) return;\n    \tint ix = 0, sz;\n        final ByteBuffer[] inputBuffers = mMediaCodec.getInputBuffers();\n        while (mIsCapturing && ix < length) {\n\t        final int inputBufferIndex = mMediaCodec.dequeueInputBuffer(TIMEOUT_USEC);\n\t        if (inputBufferIndex >= 0) {\n\t            final ByteBuffer inputBuffer = inputBuffers[inputBufferIndex];\n\t            inputBuffer.clear();\n\t            sz = inputBuffer.remaining();\n\t            sz = (ix + sz < length) ? sz : length - ix;\n\t            if (sz > 0 && (buffer != null)) {\n\t            \tinputBuffer.put(buffer, ix, sz);\n\t            }\n\t            ix += sz;\n//\t            if (DEBUG) Log.v(TAG, \"encode:queueInputBuffer\");\n\t            if (length <= 0) {\n\t            \t// send EOS\n\t            \tmIsEOS = true;\n\t            \tif (DEBUG) Log.i(TAG, \"send BUFFER_FLAG_END_OF_STREAM\");\n\t            \tmMediaCodec.queueInputBuffer(inputBufferIndex, 0, 0,\n\t            \t\tpresentationTimeUs, MediaCodec.BUFFER_FLAG_END_OF_STREAM);\n\t\t            break;\n\t            } else {\n\t            \tmMediaCodec.queueInputBuffer(inputBufferIndex, 0, sz,\n\t            \t\tpresentationTimeUs, 0);\n\t            }\n\t        } else if (inputBufferIndex == MediaCodec.INFO_TRY_AGAIN_LATER) {\n\t        \t// wait for MediaCodec encoder is ready to encode\n\t        \t// nothing to do here because MediaCodec#dequeueInputBuffer(TIMEOUT_USEC)\n\t        \t// will wait for maximum TIMEOUT_USEC(10msec) on each call\n\t        }\n        }\n    }\n\n    /**\n     * drain encoded data and write them to muxer\n     */\n    protected void drain() {\n    \tif (mMediaCodec == null) return;\n        ByteBuffer[] encoderOutputBuffers = mMediaCodec.getOutputBuffers();\n        int encoderStatus, count = 0;\n        if (mMuxer == null) {\n//        \tthrow new NullPointerException(\"muxer is unexpectedly null\");\n        \tLog.w(TAG, \"muxer is unexpectedly null\");\n        \treturn;\n        }\nLOOP:\twhile (mIsCapturing) {\n\t\t\t// get encoded data with maximum timeout duration of TIMEOUT_USEC(=10[msec])\n            encoderStatus = mMediaCodec.dequeueOutputBuffer(mBufferInfo, TIMEOUT_USEC);\n            if (encoderStatus == MediaCodec.INFO_TRY_AGAIN_LATER) {\n                // wait 5 counts(=TIMEOUT_USEC x 5 = 50msec) until data/EOS come\n                if (!mIsEOS) {\n                \tif (++count > 5)\n                \t\tbreak LOOP;\t\t// out of while\n                }\n            } else if (encoderStatus == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {\n            \tif (DEBUG) Log.v(TAG, \"INFO_OUTPUT_BUFFERS_CHANGED\");\n                // this shoud not come when encoding\n                encoderOutputBuffers = mMediaCodec.getOutputBuffers();\n            } else if (encoderStatus == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {\n            \tif (DEBUG) Log.v(TAG, \"INFO_OUTPUT_FORMAT_CHANGED\");\n            \t// this status indicate the output format of codec is changed\n                // this should come only once before actual encoded data\n            \t// but this status never come on Android4.3 or less\n            \t// and in that case, you should treat when MediaCodec.BUFFER_FLAG_CODEC_CONFIG come.\n                if (mMuxerStarted) {\t// second time request is error\n                    throw new RuntimeException(\"format changed twice\");\n                }\n\t\t\t\t// get output format from codec and pass them to muxer\n\t\t\t\t// getOutputFormat should be called after INFO_OUTPUT_FORMAT_CHANGED otherwise crash.\n                final MediaFormat format = mMediaCodec.getOutputFormat(); // API >= 16\n               \tmTrackIndex = mMuxer.addTrack(format);\n               \tmMuxerStarted = true;\n               \tmMuxer.start();\n            } else if (encoderStatus < 0) {\n            \t// unexpected status\n            \tif (DEBUG) Log.w(TAG, \"drain:unexpected result from encoder#dequeueOutputBuffer: \" + encoderStatus);\n            } else {\n                final ByteBuffer encodedData = encoderOutputBuffers[encoderStatus];\n                if (encodedData == null) {\n                \t// this never should come...may be a MediaCodec internal error\n                    throw new RuntimeException(\"encoderOutputBuffer \" + encoderStatus + \" was null\");\n                }\n                if ((mBufferInfo.flags & MediaCodec.BUFFER_FLAG_CODEC_CONFIG) != 0) {\n                \t// You shoud set output format to muxer here when you target Android4.3 or less\n                \t// but MediaCodec#getOutputFormat can not call here(because INFO_OUTPUT_FORMAT_CHANGED don't come yet)\n                \t// therefor we should expand and prepare output format from buffer data.\n                \t// This sample is for API>=18(>=Android 4.3), just ignore this flag here\n\t\t\t\t\tif (DEBUG) Log.d(TAG, \"drain:BUFFER_FLAG_CODEC_CONFIG\");\n\t\t\t\t\tmBufferInfo.size = 0;\n                }\n\n                if (mBufferInfo.size != 0) {\n                \t// encoded data is ready, clear waiting counter\n            \t\tcount = 0;\n                    if (!mMuxerStarted) {\n                    \t// muxer is not ready...this will prrograming failure.\n                        throw new RuntimeException(\"drain:muxer hasn't started\");\n                    }\n                    // write encoded data to muxer(need to adjust presentationTimeUs.\n                   \tmBufferInfo.presentationTimeUs = getPTSUs();\n                   \tmMuxer.writeSampleData(mTrackIndex, encodedData, mBufferInfo);\n\t\t\t\t\tprevOutputPTSUs = mBufferInfo.presentationTimeUs;\n                }\n                // return buffer to encoder\n                mMediaCodec.releaseOutputBuffer(encoderStatus, false);\n                if ((mBufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) {\n                \t// when EOS come.\n               \t\tmMuxerStarted = mIsCapturing = false;\n                    break;      // out of while\n                }\n            }\n        }\n    }\n\n    /**\n     * previous presentationTimeUs for writing\n     */\n\tprivate long prevOutputPTSUs = 0;\n\t/**\n\t * get next encoding presentationTimeUs\n\t * @return\n\t */\n    protected long getPTSUs() {\n\t\tlong result = System.nanoTime() / 1000L;\n\t\t// presentationTimeUs should be monotonic\n\t\t// otherwise muxer fail to write\n\t\tif (result < prevOutputPTSUs)\n\t\t\tresult = (prevOutputPTSUs - result) + result;\n\t\treturn result;\n    }\n\n    /**\n     * select primary codec for encoding from the available list which MIME is specific type\n     * return null if nothing is available\n     * @param mimeType\n     */\n    public static final MediaCodecInfo selectCodec(final String mimeType) {\n    \tMediaCodecInfo result = null;\n\n    \t// get avcodec list\n        final int numCodecs = MediaCodecList.getCodecCount();\nLOOP:\tfor (int i = 0; i < numCodecs; i++) {\n        \tfinal MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);\n\n            if (!codecInfo.isEncoder()) {\t// skip decoder\n                continue;\n            }\n\n            // select encoder that MIME is equal to the specific type\n            final String[] types = codecInfo.getSupportedTypes();\n            for (int j = 0; j < types.length; j++) {\n                if (types[j].equalsIgnoreCase(mimeType)) {\n               \t\tresult = codecInfo;\n               \t\tbreak LOOP;\n                }\n            }\n        }\n        return result;\n    }\n\n}\n"
  },
  {
    "path": "usbCameraTest2/src/main/java/com/serenegiant/video/SurfaceEncoder.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.video;\n\nimport java.io.IOException;\n\nimport android.media.MediaCodec;\nimport android.media.MediaCodecInfo;\nimport android.media.MediaFormat;\nimport android.media.MediaMuxer;\nimport android.util.Log;\nimport android.view.Surface;\n\npublic class SurfaceEncoder extends Encoder {\n\tprivate static final boolean DEBUG = true;\t// set false when releasing\n\tprivate static final String TAG = \"SurfaceEncoder\";\n\n\tprivate static final String MIME_TYPE = \"video/avc\";\n\tprivate static final int IFRAME_INTERVAL = 10;\n\tprivate static final int FRAME_WIDTH = 640;\n\tprivate static final int FRAME_HEIGHT = 480;\n\tprivate static final int CAPTURE_FPS = 15;\n\tprivate static final int BIT_RATE = 1000000;\n\n\tprotected Surface mInputSurface;\n\n\tpublic SurfaceEncoder(final String filePath) {\n\t\tsuper();\n\t\tsetOutputFile(filePath);\n\t}\n\n\t/**\n\t* Returns the encoder's input surface.\n\t*/\n\tpublic Surface getInputSurface() {\n\t\treturn mInputSurface;\n\t}\n\n\t@Override\n\tpublic void prepare() throws IOException {\n\t\tif (DEBUG) Log.i(TAG, \"prepare:\");\n\t\tmTrackIndex = -1;\n\t\tmMuxerStarted = false;\n\t\tmIsCapturing = true;\n\t\tmIsEOS = false;\n\n\t\tfinal MediaCodecInfo codecInfo = selectCodec(MIME_TYPE);\n\t\tif (codecInfo == null) {\n\t\t\tLog.e(TAG, \"Unable to find an appropriate codec for \" + MIME_TYPE);\n\t\t\treturn;\n\t\t}\n\t\tif (DEBUG) Log.i(TAG, \"selected codec: \" + codecInfo.getName());\n\n\t\tmBufferInfo = new MediaCodec.BufferInfo();\n\t\tfinal MediaFormat format = MediaFormat.createVideoFormat(MIME_TYPE, FRAME_WIDTH, FRAME_HEIGHT);\n\n\t\t// set configulation, invalid configulation crash app\n\t\tformat.setInteger(MediaFormat.KEY_COLOR_FORMAT,\n\t\t\tMediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);\t// API >= 18\n\t\tformat.setInteger(MediaFormat.KEY_BIT_RATE, BIT_RATE);\n\t\tformat.setInteger(MediaFormat.KEY_FRAME_RATE, CAPTURE_FPS);\n\t\tformat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, IFRAME_INTERVAL);\n\t\tif (DEBUG) Log.i(TAG, \"format: \" + format);\n\n\t\t// create a MediaCodec encoder with specific configuration\n\t\tmMediaCodec = MediaCodec.createEncoderByType(MIME_TYPE);\n\t\tmMediaCodec.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);\n\t\t// get Surface for input to encoder\n\t\tmInputSurface = mMediaCodec.createInputSurface();\t// API >= 18\n\t\tmMediaCodec.start();\n\n\t\t// create MediaMuxer. You should never call #start here\n\t\tif (DEBUG) Log.i(TAG, \"output will go to \" + mOutputPath);\n\t\tmMuxer = new MediaMuxer(mOutputPath, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4);\n\n\t\tif (mEncodeListener != null) {\n\t\t\ttry {\n\t\t\t\tmEncodeListener.onPreapared(this);\n\t\t\t} catch (final Exception e) {\n\t\t\t\tLog.w(TAG, e);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Releases encoder resources.\n\t*/\n\t@Override\n\tprotected void release() {\n\t\tif (DEBUG) Log.i(TAG, \"release:\");\n\t\tsuper.release();\n\t\tif (mInputSurface != null) {\n\t\t\tmInputSurface.release();\n\t\t\tmInputSurface = null;\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "usbCameraTest2/src/main/java/com/serenegiant/widget/AspectRatioViewInterface.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.widget;\n\npublic interface AspectRatioViewInterface {\n    public void setAspectRatio(double aspectRatio);\n    public void onPause();\n    public void onResume();\n}\n"
  },
  {
    "path": "usbCameraTest2/src/main/java/com/serenegiant/widget/SimpleUVCCameraTextureView.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.widget;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.view.TextureView;\n\n/**\n * change the view size with keeping the specified aspect ratio.\n * if you set this view with in a FrameLayout and set property \"android:layout_gravity=\"center\",\n * you can show this view in the center of screen and keep the aspect ratio of content\n * XXX it is better that can set the aspect ratio as a xml property\n */\npublic class SimpleUVCCameraTextureView extends TextureView\t// API >= 14\n\timplements AspectRatioViewInterface {\n\n    private double mRequestedAspect = -1.0;\n\n\tpublic SimpleUVCCameraTextureView(final Context context) {\n\t\tthis(context, null, 0);\n\t}\n\n\tpublic SimpleUVCCameraTextureView(final Context context, final AttributeSet attrs) {\n\t\tthis(context, attrs, 0);\n\t}\n\n\tpublic SimpleUVCCameraTextureView(final Context context, final AttributeSet attrs, final int defStyle) {\n\t\tsuper(context, attrs, defStyle);\n\t}\n\n\t@Override\n\tpublic void onResume() {\n\t}\n\n\t@Override\n\tpublic void onPause() {\n\t}\n\n\t@Override\n    public void setAspectRatio(final double aspectRatio) {\n        if (aspectRatio < 0) {\n            throw new IllegalArgumentException();\n        }\n        if (mRequestedAspect != aspectRatio) {\n            mRequestedAspect = aspectRatio;\n            requestLayout();\n        }\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n\n\t\tif (mRequestedAspect > 0) {\n\t\t\tint initialWidth = MeasureSpec.getSize(widthMeasureSpec);\n\t\t\tint initialHeight = MeasureSpec.getSize(heightMeasureSpec);\n\n\t\t\tfinal int horizPadding = getPaddingLeft() + getPaddingRight();\n\t\t\tfinal int vertPadding = getPaddingTop() + getPaddingBottom();\n\t\t\tinitialWidth -= horizPadding;\n\t\t\tinitialHeight -= vertPadding;\n\n\t\t\tfinal double viewAspectRatio = (double)initialWidth / initialHeight;\n\t\t\tfinal double aspectDiff = mRequestedAspect / viewAspectRatio - 1;\n\n\t\t\tif (Math.abs(aspectDiff) > 0.01) {\n\t\t\t\tif (aspectDiff > 0) {\n\t\t\t\t\t// width priority decision\n\t\t\t\t\tinitialHeight = (int) (initialWidth / mRequestedAspect);\n\t\t\t\t} else {\n\t\t\t\t\t// height priority decison\n\t\t\t\t\tinitialWidth = (int) (initialHeight * mRequestedAspect);\n\t\t\t\t}\n\t\t\t\tinitialWidth += horizPadding;\n\t\t\t\tinitialHeight += vertPadding;\n\t\t\t\twidthMeasureSpec = MeasureSpec.makeMeasureSpec(initialWidth, MeasureSpec.EXACTLY);\n\t\t\t\theightMeasureSpec = MeasureSpec.makeMeasureSpec(initialHeight, MeasureSpec.EXACTLY);\n\t\t\t}\n\t\t}\n\n        super.onMeasure(widthMeasureSpec, heightMeasureSpec);\n    }\n\n}\n"
  },
  {
    "path": "usbCameraTest2/src/main/res/drawable/border.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\" >\n \n    <stroke\n        android:width=\"3px\"\n        android:color=\"#ff808080\" />\n    <solid\n        android:color=\"@null\" />\n    <padding\n        android:bottom=\"2px\"\n        android:left=\"2px\"\n        android:right=\"2px\"\n        android:top=\"2px\" />\n    <corners\n        android:radius=\"2px\" />\n</shape>"
  },
  {
    "path": "usbCameraTest2/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/container\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"#ff000000\"\n    tools:context=\"com.serenegiant.usbcameratest.MainActivity\"\n    tools:ignore=\"MergeRootFrame\" >\n\n    <com.serenegiant.widget.SimpleUVCCameraTextureView\n        android:id=\"@+id/UVCCameraTextureView1\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:layout_centerInParent=\"true\"\n        android:layout_gravity=\"center\"\n        android:background=\"#ff000000\" />\n\n    <ImageView\n        android:id=\"@+id/imageView1\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignTop=\"@+id/UVCCameraTextureView1\"\n        android:layout_alignBottom=\"@+id/UVCCameraTextureView1\"\n        android:layout_alignLeft=\"@+id/UVCCameraTextureView1\"\n        android:layout_alignRight=\"@+id/UVCCameraTextureView1\"\n        android:src=\"@drawable/border\" />\n    \n    <ImageButton\n        android:id=\"@+id/capture_button\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignBottom=\"@id/UVCCameraTextureView1\"\n        android:layout_centerHorizontal=\"true\"\n        android:adjustViewBounds=\"false\"\n        android:background=\"@null\"\n        android:padding=\"3dp\"\n        android:scaleType=\"fitXY\"\n        android:src=\"@android:drawable/ic_menu_camera\" />\n\n    <ToggleButton\n        android:id=\"@+id/camera_button\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignTop=\"@id/UVCCameraTextureView1\"\n        android:layout_alignLeft=\"@id/UVCCameraTextureView1\"\n        android:text=\"ToggleButton\" />\n\n</RelativeLayout>\n"
  },
  {
    "path": "usbCameraTest2/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n\n\t<!-- Default screen margins, per the Android Design guidelines. -->\n\t<dimen name=\"activity_horizontal_margin\">16dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">16dp</dimen>\n\t<dimen name=\"button_size\">48dp</dimen>\n</resources>\n"
  },
  {
    "path": "usbCameraTest2/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBCameraTest2</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest2/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme, dependent on API level. This theme is replaced\n        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Light\">\n        <!--\n            Theme customizations available in newer API levels can go in\n            res/values-vXX/styles.xml, while customizations related to\n            backward-compatibility can go here.\n        -->\n    </style>\n\n    <!-- Application theme. -->\n    <style name=\"AppTheme\" parent=\"AppBaseTheme\">\n        <!-- All customizations that are NOT specific to a particular API-level can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest2/src/main/res/values-ja/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBカメラテスト2</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest2/src/main/res/values-v11/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 11+. This theme completely replaces\n        AppBaseTheme from res/values/styles.xml on API 11+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light\">\n        <!-- API 11 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest2/src/main/res/values-v14/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 14+. This theme completely replaces\n        AppBaseTheme from BOTH res/values/styles.xml and\n        res/values-v11/styles.xml on API 14+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light.DarkActionBar\">\n        <!-- API 14 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest2/src/main/res/values-w820dp/dimens.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n         Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively).\n    -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">64dp</dimen>\n\t<dimen name=\"button_size\">48dp</dimen>\n\t<dimen name=\"list_font_size\">24sp</dimen>\n    \n</resources>\n"
  },
  {
    "path": "usbCameraTest2/src/main/res/xml/device_filter.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<usb>\n\t<usb-device class=\"239\" subclass=\"2\" />\t<!-- all device of UVC -->\n</usb>\n"
  },
  {
    "path": "usbCameraTest3/build.gradle",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\napply plugin: 'com.android.application'\n\nandroid {\n\tcompileSdkVersion versionCompiler\n\tbuildToolsVersion versionBuildTool\n\n\tcompileOptions {\n\t\tsourceCompatibility javaSourceCompatibility\n\t\ttargetCompatibility javaTargetCompatibility\n\t}\n\n    defaultConfig {\n        applicationId \"com.serenegiant.usbcameratest3\"\n        minSdkVersion 18\n\t\ttargetSdkVersion versionTarget\n\t\tversionCode 8\n\t\tversionName \"3.00\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'\n        }\n    }\n}\n\ndependencies {\n\tapi fileTree(dir: 'libs', include: ['*.jar'])\n\n\timplementation \"com.android.support:support-v4:${supportLibVersion}\"\n\timplementation \"com.android.support:support-annotations:${supportLibVersion}\"\n\n\timplementation(\"com.serenegiant:common:${commonLibVersion}\") {\n\t\texclude module: 'support-v4'\n\t}\n\timplementation project(':libuvccamera')\n\timplementation project(':usbCameraCommon')\n}\n"
  },
  {
    "path": "usbCameraTest3/lint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<lint>\n</lint>"
  },
  {
    "path": "usbCameraTest3/proguard-project.txt",
    "content": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in that file.\n#\n# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in ${sdk.dir}/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the ProGuard\n# include property in project.properties.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n-keepclassmembers public class com.serenegiant.usb.UVCCamera {\n\tpublic *;\n\tprotected *;\n\tprivate *;\n}\n"
  },
  {
    "path": "usbCameraTest3/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.serenegiant.usbcameratest3\" >\n\n    <uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n\n    <uses-feature android:glEsVersion=\"0x00020000\" android:required=\"true\" />\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.serenegiant.usbcameratest3.MainActivity\"\n            android:screenOrientation=\"sensorLandscape\"\n            android:label=\"@string/app_name\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "usbCameraTest3/src/main/java/com/serenegiant/usbcameratest3/MainActivity.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usbcameratest3;\n\nimport android.graphics.SurfaceTexture;\nimport android.hardware.usb.UsbDevice;\nimport android.os.Bundle;\nimport android.util.Log;\nimport android.view.Surface;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.view.View.OnLongClickListener;\nimport android.widget.CompoundButton;\nimport android.widget.ImageButton;\nimport android.widget.Toast;\nimport android.widget.ToggleButton;\n\nimport com.serenegiant.common.BaseActivity;\n\nimport com.serenegiant.usb.CameraDialog;\nimport com.serenegiant.usbcameracommon.UVCCameraHandler;\nimport com.serenegiant.usb.USBMonitor;\nimport com.serenegiant.usb.USBMonitor.OnDeviceConnectListener;\nimport com.serenegiant.usb.USBMonitor.UsbControlBlock;\nimport com.serenegiant.usb.UVCCamera;\nimport com.serenegiant.widget.CameraViewInterface;\n\npublic final class MainActivity extends BaseActivity implements CameraDialog.CameraDialogParent {\n\tprivate static final boolean DEBUG = true;\t// TODO set false on release\n\tprivate static final String TAG = \"MainActivity\";\n\n\t/**\n\t * set true if you want to record movie using MediaSurfaceEncoder\n\t * (writing frame data into Surface camera from MediaCodec\n\t *  by almost same way as USBCameratest2)\n\t * set false if you want to record movie using MediaVideoEncoder\n\t */\n    private static final boolean USE_SURFACE_ENCODER = false;\n\n    /**\n     * preview resolution(width)\n     * if your camera does not support specific resolution and mode,\n     * {@link UVCCamera#setPreviewSize(int, int, int)} throw exception\n     */\n    private static final int PREVIEW_WIDTH = 640;\n    /**\n     * preview resolution(height)\n     * if your camera does not support specific resolution and mode,\n     * {@link UVCCamera#setPreviewSize(int, int, int)} throw exception\n     */\n    private static final int PREVIEW_HEIGHT = 480;\n    /**\n     * preview mode\n     * if your camera does not support specific resolution and mode,\n     * {@link UVCCamera#setPreviewSize(int, int, int)} throw exception\n     * 0:YUYV, other:MJPEG\n     */\n    private static final int PREVIEW_MODE = 1;\n\n\t/**\n\t * for accessing USB\n\t */\n\tprivate USBMonitor mUSBMonitor;\n\t/**\n\t * Handler to execute camera related methods sequentially on private thread\n\t */\n\tprivate UVCCameraHandler mCameraHandler;\n\t/**\n\t * for camera preview display\n\t */\n\tprivate CameraViewInterface mUVCCameraView;\n\t/**\n\t * for open&start / stop&close camera preview\n\t */\n\tprivate ToggleButton mCameraButton;\n\t/**\n\t * button for start/stop recording\n\t */\n\tprivate ImageButton mCaptureButton;\n\n\t@Override\n\tprotected void onCreate(final Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tif (DEBUG) Log.v(TAG, \"onCreate:\");\n\t\tif (USE_SURFACE_ENCODER)\n\t\t\tsetContentView(R.layout.activity_main2);\n\t\telse\n\t\t\tsetContentView(R.layout.activity_main);\n\t\tmCameraButton = (ToggleButton)findViewById(R.id.camera_button);\n\t\tmCameraButton.setOnCheckedChangeListener(mOnCheckedChangeListener);\n\t\tmCaptureButton = (ImageButton)findViewById(R.id.capture_button);\n\t\tmCaptureButton.setOnClickListener(mOnClickListener);\n\t\tmCaptureButton.setVisibility(View.INVISIBLE);\n\t\tfinal View view = findViewById(R.id.camera_view);\n\t\tview.setOnLongClickListener(mOnLongClickListener);\n\t\tmUVCCameraView = (CameraViewInterface)view;\n\t\tmUVCCameraView.setAspectRatio(PREVIEW_WIDTH / (float)PREVIEW_HEIGHT);\n\n\t\tmUSBMonitor = new USBMonitor(this, mOnDeviceConnectListener);\n\t\tmCameraHandler = UVCCameraHandler.createHandler(this, mUVCCameraView,\n\t\t\tUSE_SURFACE_ENCODER ? 0 : 1, PREVIEW_WIDTH, PREVIEW_HEIGHT, PREVIEW_MODE);\n\t}\n\n\t@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tif (DEBUG) Log.v(TAG, \"onStart:\");\n\t\tmUSBMonitor.register();\n\t\tif (mUVCCameraView != null)\n\t\t\tmUVCCameraView.onResume();\n\t}\n\n\t@Override\n\tprotected void onStop() {\n\t\tif (DEBUG) Log.v(TAG, \"onStop:\");\n\t\tmCameraHandler.close();\n\t\tif (mUVCCameraView != null)\n\t\t\tmUVCCameraView.onPause();\n\t\tsetCameraButton(false);\n\t\tsuper.onStop();\n\t}\n\n\t@Override\n\tpublic void onDestroy() {\n\t\tif (DEBUG) Log.v(TAG, \"onDestroy:\");\n        if (mCameraHandler != null) {\n\t        mCameraHandler.release();\n\t        mCameraHandler = null;\n        }\n        if (mUSBMonitor != null) {\n\t        mUSBMonitor.destroy();\n\t        mUSBMonitor = null;\n        }\n        mUVCCameraView = null;\n        mCameraButton = null;\n        mCaptureButton = null;\n\t\tsuper.onDestroy();\n\t}\n\n\t/**\n\t * event handler when click camera / capture button\n\t */\n\tprivate final OnClickListener mOnClickListener = new OnClickListener() {\n\t\t@Override\n\t\tpublic void onClick(final View view) {\n\t\t\tswitch (view.getId()) {\n\t\t\tcase R.id.capture_button:\n\t\t\t\tif (mCameraHandler.isOpened()) {\n\t\t\t\t\tif (checkPermissionWriteExternalStorage() && checkPermissionAudio()) {\n\t\t\t\t\t\tif (!mCameraHandler.isRecording()) {\n\t\t\t\t\t\t\tmCaptureButton.setColorFilter(0xffff0000);\t// turn red\n\t\t\t\t\t\t\tmCameraHandler.startRecording();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmCaptureButton.setColorFilter(0);\t// return to default color\n\t\t\t\t\t\t\tmCameraHandler.stopRecording();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate final CompoundButton.OnCheckedChangeListener mOnCheckedChangeListener\n\t\t= new CompoundButton.OnCheckedChangeListener() {\n\t\t@Override\n\t\tpublic void onCheckedChanged(final CompoundButton compoundButton, final boolean isChecked) {\n\t\t\tswitch (compoundButton.getId()) {\n\t\t\tcase R.id.camera_button:\n\t\t\t\tif (isChecked && !mCameraHandler.isOpened()) {\n\t\t\t\t\tCameraDialog.showDialog(MainActivity.this);\n\t\t\t\t} else {\n\t\t\t\t\tmCameraHandler.close();\n\t\t\t\t\tsetCameraButton(false);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * capture still image when you long click on preview image(not on buttons)\n\t */\n\tprivate final OnLongClickListener mOnLongClickListener = new OnLongClickListener() {\n\t\t@Override\n\t\tpublic boolean onLongClick(final View view) {\n\t\t\tswitch (view.getId()) {\n\t\t\tcase R.id.camera_view:\n\t\t\t\tif (mCameraHandler.isOpened()) {\n\t\t\t\t\tif (checkPermissionWriteExternalStorage()) {\n\t\t\t\t\t\tmCameraHandler.captureStill();\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tprivate void setCameraButton(final boolean isOn) {\n\t\trunOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tif (mCameraButton != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmCameraButton.setOnCheckedChangeListener(null);\n\t\t\t\t\t\tmCameraButton.setChecked(isOn);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tmCameraButton.setOnCheckedChangeListener(mOnCheckedChangeListener);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!isOn && (mCaptureButton != null)) {\n\t\t\t\t\tmCaptureButton.setVisibility(View.INVISIBLE);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t}\n\n\tprivate void startPreview() {\n\t\tfinal SurfaceTexture st = mUVCCameraView.getSurfaceTexture();\n\t\tmCameraHandler.startPreview(new Surface(st));\n\t\trunOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tmCaptureButton.setVisibility(View.VISIBLE);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate final OnDeviceConnectListener mOnDeviceConnectListener = new OnDeviceConnectListener() {\n\t\t@Override\n\t\tpublic void onAttach(final UsbDevice device) {\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_ATTACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onConnect(final UsbDevice device, final UsbControlBlock ctrlBlock, final boolean createNew) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onConnect:\");\n\t\t\tmCameraHandler.open(ctrlBlock);\n\t\t\tstartPreview();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDisconnect(final UsbDevice device, final UsbControlBlock ctrlBlock) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onDisconnect:\");\n\t\t\tif (mCameraHandler != null) {\n\t\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tmCameraHandler.close();\n\t\t\t\t\t}\n\t\t\t\t}, 0);\n\t\t\t\tsetCameraButton(false);\n\t\t\t}\n\t\t}\n\t\t@Override\n\t\tpublic void onDettach(final UsbDevice device) {\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_DETACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onCancel(final UsbDevice device) {\n\t\t\tsetCameraButton(false);\n\t\t}\n\t};\n\n\t/**\n\t * to access from CameraDialog\n\t * @return\n\t */\n\t@Override\n\tpublic USBMonitor getUSBMonitor() {\n\t\treturn mUSBMonitor;\n\t}\n\n\t@Override\n\tpublic void onDialogResult(boolean canceled) {\n\t\tif (DEBUG) Log.v(TAG, \"onDialogResult:canceled=\" + canceled);\n\t\tif (canceled) {\n\t\t\tsetCameraButton(false);\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "usbCameraTest3/src/main/java/com/serenegiant/widget/UVCCameraTextureView2.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.widget;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.SurfaceTexture;\nimport android.util.AttributeSet;\nimport android.view.Surface;\nimport android.view.TextureView;\n\nimport com.serenegiant.encoder.IVideoEncoder;\nimport com.serenegiant.encoder.MediaEncoder;\n\n/**\n * change the view size with keeping the specified aspect ratio.\n * if you set this view with in a FrameLayout and set property \"android:layout_gravity=\"center\",\n * you can show this view in the center of screen and keep the aspect ratio of content\n * XXX it is better that can set the aspect raton a a xml property\n */\npublic class UVCCameraTextureView2 extends TextureView\t// API >= 14\n\timplements CameraViewInterface, TextureView.SurfaceTextureListener {\n\n//\tprivate static final boolean DEBUG = true;\t// TODO set false on release\n//\tprivate static final String TAG = \"UVCCameraTextureView2\";\n\n\tprivate double mRequestedAspect = -1.0;\n\tprivate boolean mHasSurface;\n\tprivate IVideoEncoder mEncoder;\n\n\tpublic UVCCameraTextureView2(final Context context) {\n\t\tthis(context, null, 0);\n\t}\n\n\tpublic UVCCameraTextureView2(final Context context, final AttributeSet attrs) {\n\t\tthis(context, attrs, 0);\n\t}\n\n\tpublic UVCCameraTextureView2(final Context context, final AttributeSet attrs, final int defStyle) {\n\t\tsuper(context, attrs, defStyle);\n\t\tsetSurfaceTextureListener(this);\n\t}\n\n\t@Override\n\tpublic void onResume() {\n\t}\n\n\t@Override\n\tpublic void onPause() {\n\t}\n\n\t@Override\n    public void setAspectRatio(final double aspectRatio) {\n        if (aspectRatio < 0) {\n            throw new IllegalArgumentException();\n        }\n        if (mRequestedAspect != aspectRatio) {\n            mRequestedAspect = aspectRatio;\n            requestLayout();\n        }\n    }\n\n\t@Override\n    public void setAspectRatio(final int width, final int height) {\n\t\tsetAspectRatio(width / (double)height);\n    }\n\n\t@Override\n\tpublic double getAspectRatio() {\n\t\treturn mRequestedAspect;\n\t}\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n\n\t\tif (mRequestedAspect > 0) {\n\t\t\tint initialWidth = MeasureSpec.getSize(widthMeasureSpec);\n\t\t\tint initialHeight = MeasureSpec.getSize(heightMeasureSpec);\n\n\t\t\tfinal int horizPadding = getPaddingLeft() + getPaddingRight();\n\t\t\tfinal int vertPadding = getPaddingTop() + getPaddingBottom();\n\t\t\tinitialWidth -= horizPadding;\n\t\t\tinitialHeight -= vertPadding;\n\n\t\t\tfinal double viewAspectRatio = (double)initialWidth / initialHeight;\n\t\t\tfinal double aspectDiff = mRequestedAspect / viewAspectRatio - 1;\n\n\t\t\tif (Math.abs(aspectDiff) > 0.01) {\n\t\t\t\tif (aspectDiff > 0) {\n\t\t\t\t\t// width priority decision\n\t\t\t\t\tinitialHeight = (int) (initialWidth / mRequestedAspect);\n\t\t\t\t} else {\n\t\t\t\t\t// height priority decison\n\t\t\t\t\tinitialWidth = (int) (initialHeight * mRequestedAspect);\n\t\t\t\t}\n\t\t\t\tinitialWidth += horizPadding;\n\t\t\t\tinitialHeight += vertPadding;\n\t\t\t\twidthMeasureSpec = MeasureSpec.makeMeasureSpec(initialWidth, MeasureSpec.EXACTLY);\n\t\t\t\theightMeasureSpec = MeasureSpec.makeMeasureSpec(initialHeight, MeasureSpec.EXACTLY);\n\t\t\t}\n\t\t}\n\n        super.onMeasure(widthMeasureSpec, heightMeasureSpec);\n    }\n\n\t@Override\n\tpublic void onSurfaceTextureAvailable(final SurfaceTexture surface, final int width, final int height) {\n\t\tmHasSurface = true;\n\t}\n\n\t@Override\n\tpublic void onSurfaceTextureSizeChanged(final SurfaceTexture surface, final int width, final int height) {\n\t}\n\n\t@Override\n\tpublic boolean onSurfaceTextureDestroyed(final SurfaceTexture surface) {\n\t\tmHasSurface = false;\n\t\treturn true;\n\t}\n\n\t@Override\n\tpublic void onSurfaceTextureUpdated(final SurfaceTexture surface) {\n\t\tif (mEncoder != null)\n\t\t\tmEncoder.frameAvailableSoon();\n\t}\n\n\t@Override\n\tpublic void setCallback(final Callback callback) {\n\t\tthrow new UnsupportedOperationException();\n\t}\n\n\t@Override\n\tpublic Surface getSurface() {\n\t\tthrow new UnsupportedOperationException();\n\t}\n\n\t@Override\n\tpublic boolean hasSurface() {\n\t\treturn mHasSurface;\n\t}\n\n\t@Override\n\tpublic void setVideoEncoder(final IVideoEncoder encoder) {\n\t\tmEncoder = encoder;\n\t}\n\n\t@Override\n\tpublic Bitmap captureStillImage() {\n\t\treturn null;\n\t}\n\n}\n"
  },
  {
    "path": "usbCameraTest3/src/main/res/drawable/border.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\"\n    android:useLevel=\"false\" >\n\n    <stroke\n        android:width=\"3px\"\n        android:color=\"@color/GRAY\" />\n\n    <!-- <solid android:color=\"@color/TRANSPARENT\" />　 -->\n    <solid android:color=\"@null\" />\n\n    <padding\n        android:bottom=\"2px\"\n        android:left=\"2px\"\n        android:right=\"2px\"\n        android:top=\"2px\" />\n\n    <corners android:radius=\"2px\" />\n\n</shape>"
  },
  {
    "path": "usbCameraTest3/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/RelativeLayout1\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n\tandroid:background=\"#ff000000\"\n\ttools:context=\"com.serenegiant.usbcameratest3.MainActivity\"\n    tools:ignore=\"MergeRootFrame\" >\n\n    <com.serenegiant.widget.UVCCameraTextureView\n        android:id=\"@+id/camera_view\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_centerVertical=\"true\" />\n\n\t<ImageView\n        android:id=\"@+id/frame_image\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignTop=\"@+id/camera_view\"\n        android:layout_alignBottom=\"@+id/camera_view\"\n        android:layout_alignLeft=\"@+id/camera_view\"\n        android:layout_alignRight=\"@+id/camera_view\"\n        android:src=\"@drawable/border\" />\n\n    <ToggleButton\n        android:id=\"@+id/camera_button\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignLeft=\"@id/camera_view\"\n        android:layout_alignTop=\"@id/camera_view\"\n        android:text=\"ToggleButton\" />\n\n    <ImageButton\n        android:id=\"@+id/capture_button\"\n        android:layout_width=\"@dimen/button_size\"\n        android:layout_height=\"@dimen/button_size\"\n        android:layout_alignBottom=\"@id/camera_view\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_marginBottom=\"6dp\"\n        android:background=\"@null\"\n        android:scaleType=\"centerCrop\"\n        android:src=\"@android:drawable/ic_menu_camera\" />\n\n</RelativeLayout>"
  },
  {
    "path": "usbCameraTest3/src/main/res/layout/activity_main2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/RelativeLayout1\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n\tandroid:background=\"#ff000000\"\n\ttools:context=\"com.serenegiant.usbcameratest3.MainActivity\"\n    tools:ignore=\"MergeRootFrame\" >\n\n    <com.serenegiant.widget.UVCCameraTextureView2\n        android:id=\"@+id/camera_view\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_centerVertical=\"true\" />\n\n\t<ImageView\n        android:id=\"@+id/frame_image\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignTop=\"@+id/camera_view\"\n        android:layout_alignBottom=\"@+id/camera_view\"\n        android:layout_alignLeft=\"@+id/camera_view\"\n        android:layout_alignRight=\"@+id/camera_view\"\n        android:src=\"@drawable/border\" />\n\n    <ToggleButton\n        android:id=\"@+id/camera_button\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignLeft=\"@id/camera_view\"\n        android:layout_alignTop=\"@id/camera_view\"\n        android:text=\"ToggleButton\" />\n\n    <ImageButton\n        android:id=\"@+id/capture_button\"\n        android:layout_width=\"@dimen/button_size\"\n        android:layout_height=\"@dimen/button_size\"\n        android:layout_alignBottom=\"@id/camera_view\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_marginBottom=\"6dp\"\n        android:background=\"@null\"\n        android:scaleType=\"centerCrop\"\n        android:src=\"@android:drawable/ic_menu_camera\" />\n\n</RelativeLayout>"
  },
  {
    "path": "usbCameraTest3/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n\n    <!-- Web colors -->\n    <color name=\"CLEAR\">#00000000</color>\n    <color name=\"HALF_CLEAR_WHITE\">#7fffffff</color>\n    <color name=\"QUATER_CLEAR_WHITE\">#3fffffff</color>\n    <color name=\"TRANSPARENT\">#00000000</color>\n    <color name=\"BLACK\">#ff000000</color>\n    <color name=\"ALICEBLUE\">#fff0f8ff</color>\n    <color name=\"DARKCYAN\">#ff008b8b</color>\n    <color name=\"LIGHTYELLOW\">#ffffffe0</color>\n    <color name=\"CORAL\">#ffff7f50</color>\n    <color name=\"DIMGRAY\">#ff696969</color>\n    <color name=\"LAVENDER\">#ffe6e6fa</color>\n    <color name=\"TEAL\">#ff008080</color>\n    <color name=\"LIGHTGOLDENRODYELLOW\">#fffafad2</color>\n    <color name=\"TOMATO\">#ffff6347</color>\n    <color name=\"GRAY\">#ff808080</color>\n    <color name=\"LIGHTSTEELBLUE\">#ffb0c4de</color>\n    <color name=\"DARKSLATEGRAY\">#ff2f4f4f</color>\n    <color name=\"LEMONCHIFFON\">#fffffacd</color>\n    <color name=\"ORANGERED\">#ffff4500</color>\n    <color name=\"DARKGRAY\">#ffa9a9a9</color>\n    <color name=\"LIGHTSLATEGRAY\">#ff778899</color>\n    <color name=\"DARKGREEN\">#ff006400</color>\n    <color name=\"WHEAT\">#fff5deb3</color>\n    <color name=\"RED\">#ffff0000</color>\n    <color name=\"SILVER\">#ffc0c0c0</color>\n    <color name=\"SLATEGRAY\">#ff708090</color>\n    <color name=\"GREEN\">#ff008000</color>\n    <color name=\"BURLYWOOD\">#ffdeb887</color>\n    <color name=\"CRIMSON\">#ffdc143c</color>\n    <color name=\"LIGHTGRAY\">#ffd3d3d3</color>\n    <color name=\"STEELBLUE\">#ff4682b4</color>\n    <color name=\"FORESTGREEN\">#ff228b22</color>\n    <color name=\"TAN\">#ffd2b48c</color>\n    <color name=\"MEDIUMVIOLETRED\">#ffc71585</color>\n    <color name=\"GAINSBORO\">#ffdcdcdc</color>\n    <color name=\"ROYALBLUE\">#ff4169e1</color>\n    <color name=\"SEAGREEN\">#ff2e8b57</color>\n    <color name=\"KHAKI\">#fff0e68c</color>\n    <color name=\"DEEPPINK\">#ffff1493</color>\n    <color name=\"WHITESMOKE\">#fff5f5f5</color>\n    <color name=\"MIDNIGHTBLUE\">#ff191970</color>\n    <color name=\"MEDIUMSEAGREEN\">#ff3cb371</color>\n    <color name=\"YELLOW\">#ffffff00</color>\n    <color name=\"HOTPINK\">#ffff69b4</color>\n    <color name=\"WHITE\">#ffffffff</color>\n    <color name=\"NAVY\">#ff000080</color>\n    <color name=\"MEDIUMAQUAMARINE\">#ff66cdaa</color>\n    <color name=\"GOLD\">#ffffd700</color>\n    <color name=\"PALEVIOLETRED\">#ffdb7093</color>\n    <color name=\"SNOW\">#fffffafa</color>\n    <color name=\"DARKBLUE\">#ff00008b</color>\n    <color name=\"DARKSEAGREEN\">#ff8fbc8f</color>\n    <color name=\"ORANGE\">#ffffa500</color>\n    <color name=\"PINK\">#ffffc0cb</color>\n    <color name=\"GHOSTWHITE\">#fff8f8ff</color>\n    <color name=\"MEDIUMBLUE\">#ff0000cd</color>\n    <color name=\"AQUAMARINE\">#ff7fffd4</color>\n    <color name=\"SANDYBROWN\">#fff4a460</color>\n    <color name=\"LIGHTPINK\">#ffffb6c1</color>\n    <color name=\"FLORALWHITE\">#fffffaf0</color>\n    <color name=\"BLUE\">#ff0000ff</color>\n    <color name=\"PALEGREEN\">#ff98fb98</color>\n    <color name=\"DARKORANGE\">#ffff8c00</color>\n    <color name=\"THISTLE\">#ffd8bfd8</color>\n    <color name=\"LINEN\">#fffaf0e6</color>\n    <color name=\"DODGERBLUE\">#ff1e90ff</color>\n    <color name=\"LIGHTGREEN\">#ff90ee90</color>\n    <color name=\"GOLDENROD\">#ffdaa520</color>\n    <color name=\"MAGENTA\">#ffff00ff</color>\n    <color name=\"ANTIQUEWHITE\">#fffaebd7</color>\n    <color name=\"CORNFLOWERBLUE\">#ff6495ed</color>\n    <color name=\"SPRINGGREEN\">#ff00ff7f</color>\n    <color name=\"PERU\">#ffcd853f</color>\n    <color name=\"FUCHSIA\">#ffff00ff</color>\n    <color name=\"PAPAYAWHIP\">#ffffefd5</color>\n    <color name=\"DEEPSKYBLUE\">#ff00bfff</color>\n    <color name=\"MEDIUMSPRINGGREEN\">#ff00fa9a</color>\n    <color name=\"DARKGOLDENROD\">#ffb8860b</color>\n    <color name=\"VIOLET\">#ffee82ee</color>\n    <color name=\"BLANCHEDALMOND\">#ffffebcd</color>\n    <color name=\"LIGHTSKYBLUE\">#ff87cefa</color>\n    <color name=\"LAWNGREEN\">#ff7cfc00</color>\n    <color name=\"CHOCOLATE\">#ffd2691e</color>\n    <color name=\"PLUM\">#ffdda0dd</color>\n    <color name=\"BISQUE\">#ffffe4c4</color>\n    <color name=\"SKYBLUE\">#ff87ceeb</color>\n    <color name=\"CHARTREUSE\">#ff7fff00</color>\n    <color name=\"SIENNA\">#ffa0522d</color>\n    <color name=\"ORCHID\">#ffda70d6</color>\n    <color name=\"MOCCASIN\">#ffffe4b5</color>\n    <color name=\"LIGHTBLUE\">#ffadd8e6</color>\n    <color name=\"GREENYELLOW\">#ffadff2f</color>\n    <color name=\"SADDLEBROWN\">#ff8b4513</color>\n    <color name=\"MEDIUMORCHID\">#ffba55d3</color>\n    <color name=\"NAVAJOWHITE\">#ffffdead</color>\n    <color name=\"POWDERBLUE\">#ffb0e0e6</color>\n    <color name=\"LIME\">#ff00ff00</color>\n    <color name=\"MAROON\">#ff800000</color>\n    <color name=\"DARKORCHID\">#ff9932cc</color>\n    <color name=\"PEACHPUFF\">#ffffdab9</color>\n    <color name=\"PALETURQUOISE\">#ffafeeee</color>\n    <color name=\"LIMEGREEN\">#ff32cd32</color>\n    <color name=\"DARKRED\">#ff8b0000</color>\n    <color name=\"DARKVIOLET\">#ff9400d3</color>\n    <color name=\"MISTYROSE\">#ffffe4e1</color>\n    <color name=\"LIGHTCYAN\">#ffe0ffff</color>\n    <color name=\"YELLOWGREEN\">#ff9acd32</color>\n    <color name=\"BROWN\">#ffa52a2a</color>\n    <color name=\"DARKMAGENTA\">#ff8b008b</color>\n    <color name=\"LAVENDERBLUSH\">#fffff0f5</color>\n    <color name=\"CYAN\">#ff00ffff</color>\n    <color name=\"DARKOLIVEGREEN\">#ff556b2f</color>\n    <color name=\"FIREBRICK\">#ffb22222</color>\n    <color name=\"PURPLE\">#ff800080</color>\n    <color name=\"SEASHELL\">#fffff5ee</color>\n    <color name=\"AQUA\">#ff00ffff</color>\n    <color name=\"OLIVEDRAB\">#ff6b8e23</color>\n    <color name=\"INDIANRED\">#ffcd5c5c</color>\n    <color name=\"INDIGO\">#ff4b0082</color>\n    <color name=\"OLDLACE\">#fffdf5e6</color>\n    <color name=\"TURQUOISE\">#ff40e0d0</color>\n    <color name=\"OLIVE\">#ff808000</color>\n    <color name=\"ROSYBROWN\">#ffbc8f8f</color>\n    <color name=\"DARKSLATEBLUE\">#ff483d8b</color>\n    <color name=\"IVORY\">#fffffff0</color>\n    <color name=\"MEDIUMTURQUOISE\">#ff48d1cc</color>\n    <color name=\"DARKKHAKI\">#ffbdb76b</color>\n    <color name=\"DARKSALMON\">#ffe9967a</color>\n    <color name=\"BLUEVIOLET\">#ff8a2be2</color>\n    <color name=\"HONEYDEW\">#fff0fff0</color>\n    <color name=\"DARKTURQUOISE\">#ff00ced1</color>\n    <color name=\"PALEGOLDENROD\">#ffeee8aa</color>\n    <color name=\"LIGHTCORAL\">#fff08080</color>\n    <color name=\"MEDIUMPURPLE\">#ff9370db</color>\n    <color name=\"MINTCREAM\">#fff5fffa</color>\n    <color name=\"LIGHTSEAGREEN\">#ff20b2aa</color>\n    <color name=\"CORNSILK\">#fffff8dc</color>\n    <color name=\"SALMON\">#fffa8072</color>\n    <color name=\"SLATEBLUE\">#ff6a5acd</color>\n    <color name=\"AZURE\">#fff0ffff</color>\n    <color name=\"CADETBLUE\">#ff5f9ea0</color>\n    <color name=\"BEIGE\">#fff5f5dc</color>\n    <color name=\"LIGHTSALMON\">#ffffa07a</color>\n    <color name=\"MEDIUMSLATEBLUE\">#ff7b68ee</color>\n\n</resources>"
  },
  {
    "path": "usbCameraTest3/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n\n\t<!-- Default screen margins, per the Android Design guidelines. -->\n\t<dimen name=\"activity_horizontal_margin\">16dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">16dp</dimen>\n\t<dimen name=\"button_size\">48dp</dimen>\n</resources>\n"
  },
  {
    "path": "usbCameraTest3/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBCameraTest3</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest3/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme, dependent on API level. This theme is replaced\n        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Light\">\n        <!--\n            Theme customizations available in newer API levels can go in\n            res/values-vXX/styles.xml, while customizations related to\n            backward-compatibility can go here.\n        -->\n    </style>\n\n    <!-- Application theme. -->\n    <style name=\"AppTheme\" parent=\"AppBaseTheme\">\n        <!-- All customizations that are NOT specific to a particular API-level can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest3/src/main/res/values-ja/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBカメラテスト3</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest3/src/main/res/values-v11/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 11+. This theme completely replaces\n        AppBaseTheme from res/values/styles.xml on API 11+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light\">\n        <!-- API 11 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest3/src/main/res/values-v14/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 14+. This theme completely replaces\n        AppBaseTheme from BOTH res/values/styles.xml and\n        res/values-v11/styles.xml on API 14+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light.DarkActionBar\">\n        <!-- API 14 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest3/src/main/res/values-w820dp/dimens.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n         Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively).\n    -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">64dp</dimen>\n\t<dimen name=\"button_size\">48dp</dimen>\n\t<dimen name=\"list_font_size\">24sp</dimen>\n    \n</resources>\n"
  },
  {
    "path": "usbCameraTest3/src/main/res/xml/device_filter.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<usb>\n\t<usb-device class=\"239\" subclass=\"2\" />\t<!-- all device of UVC -->\n</usb>\n"
  },
  {
    "path": "usbCameraTest4/build.gradle",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\napply plugin: 'com.android.application'\n\nandroid {\n\tcompileSdkVersion versionCompiler\n\tbuildToolsVersion versionBuildTool\n\n\tcompileOptions {\n\t\tsourceCompatibility javaSourceCompatibility\n\t\ttargetCompatibility javaTargetCompatibility\n\t}\n\n    defaultConfig {\n        applicationId \"com.serenegiant.usbcameratest4\"\n        minSdkVersion 18\n\t\ttargetSdkVersion versionTarget\n\t\tversionCode 9\n\t\tversionName \"3.00\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'\n        }\n    }\n}\n\ndependencies {\n\tapi fileTree(dir: 'libs', include: ['*.jar'])\n\n\timplementation \"com.android.support:support-v4:${supportLibVersion}\"\n\timplementation \"com.android.support:support-annotations:${supportLibVersion}\"\n\n\timplementation(\"com.serenegiant:common:${commonLibVersion}\") {\n\t\texclude module: 'support-v4'\n\t}\n\timplementation project(':libuvccamera')\n\timplementation project(':usbCameraCommon')\n}\n"
  },
  {
    "path": "usbCameraTest4/proguard-project.txt",
    "content": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in that file.\n#\n# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in ${sdk.dir}/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the ProGuard\n# include property in project.properties.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n-keepclassmembers public class com.serenegiant.usb.UVCCamera {\n\tpublic *;\n\tprotected *;\n\tprivate *;\n}\n"
  },
  {
    "path": "usbCameraTest4/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.serenegiant.usbcameratest4\" >\n\n    <uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n\n    <uses-feature android:glEsVersion=\"0x00020000\" android:required=\"true\" />\n\n\t<!--        android:screenOrientation=\"landscape\" -->\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\".MainActivity\"\n            android:label=\"@string/app_name\"\n            android:launchMode=\"singleTask\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n\t\t\t<intent-filter>\n\t\t\t\t<action android:name=\"android.hardware.usb.action.USB_DEVICE_ATTACHED\" />\n\t\t\t</intent-filter>\n\t\t\t<intent-filter>\n\t\t\t\t<action android:name=\"android.hardware.usb.action.USB_DEVICE_DETACHED\" />\n\t\t\t</intent-filter>\n\t\t\t<meta-data\n\t\t\t\tandroid:name=\"android.hardware.usb.action.USB_DEVICE_ATTACHED\"\n\t\t\t\tandroid:resource=\"@xml/device_filter\" />\n            </activity>\n        <service\n            android:name=\"com.serenegiant.service.UVCService\"\n\t\t\tandroid:process=\":uvcservice\" >\n            <intent-filter>\n                <action android:name=\"com.serenegiant.service.IUVCService\" />\n                <action android:name=\"com.serenegiant.service.IUVCSlaveService\" />\n\t\t\t</intent-filter>\n\t\t</service>\n\t</application>\n\n</manifest>"
  },
  {
    "path": "usbCameraTest4/src/main/aidl/android/hardware/usb/UsbDevice.aidl",
    "content": "package android.hardware.usb;\n\nparcelable UsbDevice;"
  },
  {
    "path": "usbCameraTest4/src/main/aidl/android/view/Surface.aidl",
    "content": "package android.view;\n\nparcelable Surface;"
  },
  {
    "path": "usbCameraTest4/src/main/aidl/com/serenegiant/service/IUVCService.aidl",
    "content": "package com.serenegiant.service;\n/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n * \n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n * \n * File name: IUVCService.aidl\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n * \n *     http://www.apache.org/licenses/LICENSE-2.0\n * \n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n * \n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb and jin/libuvc folder may have a different license, see the respective files.\n*/\n\nimport com.serenegiant.service.IUVCServiceCallback;\nimport android.hardware.usb.UsbDevice;\nimport android.view.Surface;\n\n/**\n\t<select\t\t\t\t\t\tselect UVC camera\n\t\t<connect\t\t\t\topen device and start streaming\n\t\tdisconnect>\t\t\t\tstop streaming and close device\n\trelease>\t\t\t\t\trelease camera\n*/\ninterface IUVCService {\n\tint select(in UsbDevice device, IUVCServiceCallback callback);\n\tvoid release(int serviceId);\n\tboolean isSelected(int serviceId);\n\tvoid releaseAll();\n\tvoid resize(int serviceId, int width, int height);\n\tvoid connect(int serviceId);\n\tvoid disconnect(int serviceId);\n\tboolean isConnected(int serviceId);\n\tvoid addSurface(int serviceId, int id_surface, in Surface surface, boolean isRecordable);\n\tvoid removeSurface(int serviceId, int id_surface);\n\tboolean isRecording(int serviceId);\n\tvoid startRecording(int serviceId);\n\tvoid stopRecording(int serviceId);\n\tvoid captureStillImage(int serviceId, String path);\n}"
  },
  {
    "path": "usbCameraTest4/src/main/aidl/com/serenegiant/service/IUVCServiceCallback.aidl",
    "content": "package com.serenegiant.service;\n/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n * \n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n * \n * File name: IUVCServiceCallback.aidl\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n * \n *     http://www.apache.org/licenses/LICENSE-2.0\n * \n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n * \n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb and jin/libuvc folder may have a different license, see the respective files.\n*/\n\ninterface IUVCServiceCallback {\n\toneway void onConnected();\n\toneway void onDisConnected();\n}"
  },
  {
    "path": "usbCameraTest4/src/main/aidl/com/serenegiant/service/IUVCServiceOnFrameAvailable.aidl",
    "content": "package com.serenegiant.service;\n/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n * \n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n * \n * File name: IUVCServiceOnFrameAvailable.aidl\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n * \n *     http://www.apache.org/licenses/LICENSE-2.0\n * \n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n * \n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb and jin/libuvc folder may have a different license, see the respective files.\n*/\n\ninterface IUVCServiceOnFrameAvailable {\n\toneway void onFrameAvailable();\n}"
  },
  {
    "path": "usbCameraTest4/src/main/aidl/com/serenegiant/service/IUVCSlaveService.aidl",
    "content": "package com.serenegiant.service;\n/*\n * UVCCamera\n * library and sample to access to UVC web camera on non-rooted Android device\n * \n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n * \n * File name: IUVCSlaveService.aidl\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n *  You may obtain a copy of the License at\n * \n *     http://www.apache.org/licenses/LICENSE-2.0\n * \n *  Unless required by applicable law or agreed to in writing, software\n *  distributed under the License is distributed on an \"AS IS\" BASIS,\n *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *  See the License for the specific language governing permissions and\n *  limitations under the License.\n * \n * All files in the folder are under this Apache License, Version 2.0.\n * Files in the jni/libjpeg, jni/libusb and jin/libuvc folder may have a different license, see the respective files.\n*/\n\nimport com.serenegiant.service.IUVCServiceOnFrameAvailable;\nimport android.view.Surface;\n\ninterface IUVCSlaveService {\n\tboolean isSelected(int serviceID);\n\tboolean isConnected(int serviceID);\n\tvoid addSurface(int serviceID, int id_surface, in Surface surface, boolean isRecordable, IUVCServiceOnFrameAvailable callback);\n\tvoid removeSurface(int serviceID, int id_surface);\n}"
  },
  {
    "path": "usbCameraTest4/src/main/java/com/serenegiant/service/CameraServer.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.service;\n\nimport java.io.IOException;\nimport java.lang.ref.WeakReference;\nimport java.lang.reflect.Field;\n\nimport android.content.Context;\nimport android.media.AudioManager;\nimport android.media.MediaScannerConnection;\nimport android.media.SoundPool;\nimport android.os.Handler;\nimport android.os.IBinder;\nimport android.os.Looper;\nimport android.os.Message;\nimport android.os.RemoteCallbackList;\nimport android.os.RemoteException;\nimport android.text.TextUtils;\nimport android.util.Log;\nimport android.view.Surface;\n\nimport com.serenegiant.encoder.MediaAudioEncoder;\nimport com.serenegiant.encoder.MediaEncoder;\nimport com.serenegiant.encoder.MediaMuxerWrapper;\nimport com.serenegiant.encoder.MediaSurfaceEncoder;\nimport com.serenegiant.glutils.RenderHolderCallback;\nimport com.serenegiant.glutils.RendererHolder;\nimport com.serenegiant.usb.USBMonitor.UsbControlBlock;\nimport com.serenegiant.usb.Size;\nimport com.serenegiant.usb.UVCCamera;\nimport com.serenegiant.usbcameratest4.R;\n\npublic final class CameraServer extends Handler {\n\tprivate static final boolean DEBUG = true;\n\tprivate static final String TAG = \"CameraServer\";\n\n\tprivate static final int DEFAULT_WIDTH = 640;\n\tprivate static final int DEFAULT_HEIGHT = 480;\n\t\n\tprivate int mFrameWidth = DEFAULT_WIDTH, mFrameHeight = DEFAULT_HEIGHT;\n\t\n    private static class CallbackCookie {\n\t\tboolean isConnected;\n\t}\n\n    private final RemoteCallbackList<IUVCServiceCallback> mCallbacks\n\t\t= new RemoteCallbackList<IUVCServiceCallback>();\n    private int mRegisteredCallbackCount;\n\n\tprivate RendererHolder mRendererHolder;\n\tprivate final WeakReference<CameraThread> mWeakThread;\n\n\tpublic static CameraServer createServer(final Context context, final UsbControlBlock ctrlBlock, final int vid, final int pid) {\n\t\tif (DEBUG) Log.d(TAG, \"createServer:\");\n\t\tfinal CameraThread thread = new CameraThread(context, ctrlBlock);\n\t\tthread.start();\n\t\treturn thread.getHandler();\n\t}\n\n\tprivate CameraServer(final CameraThread thread) {\n\t\tif (DEBUG) Log.d(TAG, \"Constructor:\");\n\t\tmWeakThread = new WeakReference<CameraThread>(thread);\n\t\tmRegisteredCallbackCount = 0;\n\t\tmRendererHolder = new RendererHolder(mFrameWidth, mFrameHeight, mRenderHolderCallback);\n\t}\n\n\t@Override\n\tprotected void finalize() throws Throwable {\n\t\tif (DEBUG) Log.i(TAG, \"finalize:\");\n\t\trelease();\n\t\tsuper.finalize();\n\t}\n\n\tpublic void registerCallback(final IUVCServiceCallback callback) {\n\t\tif (DEBUG) Log.d(TAG, \"registerCallback:\");\n\t\tmCallbacks.register(callback, new CallbackCookie());\n\t\tmRegisteredCallbackCount++;\n\t}\n\n\tpublic boolean unregisterCallback(final IUVCServiceCallback callback) {\n\t\tif (DEBUG) Log.d(TAG, \"unregisterCallback:\");\n\t\tmCallbacks.unregister(callback);\n\t\tmRegisteredCallbackCount--;\n\t\tif (mRegisteredCallbackCount < 0) mRegisteredCallbackCount = 0;\n\t\treturn mRegisteredCallbackCount == 0;\n\t}\n\n\tpublic void release() {\n\t\tif (DEBUG) Log.d(TAG, \"release:\");\n\t\tdisconnect();\n\t\tmCallbacks.kill();\n\t\tif (mRendererHolder != null) {\n\t\t\tmRendererHolder.release();\n\t\t\tmRendererHolder = null;\n\t\t}\n\t}\n\n//********************************************************************************\n//********************************************************************************\n\tpublic void resize(final int width, final int height) {\n\t\tif (DEBUG) Log.d(TAG, String.format(\"resize(%d,%d)\", width, height));\n\t\tif (!isRecording()) {\n\t\t\tmFrameWidth = width;\n\t\t\tmFrameHeight = height;\n\t\t\tif (mRendererHolder != null) {\n\t\t\t\tmRendererHolder.resize(width, height);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tpublic void connect() {\n\t\tif (DEBUG) Log.d(TAG, \"connect:\");\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\tif (!thread.isCameraOpened()) {\n\t\t\tsendMessage(obtainMessage(MSG_OPEN));\n\t\t\tsendMessage(obtainMessage(MSG_PREVIEW_START, mFrameWidth, mFrameHeight, mRendererHolder.getSurface()));\n\t\t} else {\n\t\t\tif (DEBUG) Log.d(TAG, \"already connected, just call callback\");\n\t\t\tprocessOnCameraStart();\n\t\t}\n\t}\n\n\tpublic void connectSlave() {\n\t\tif (DEBUG) Log.d(TAG, \"connectSlave:\");\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\tif (thread.isCameraOpened()) {\n\t\t\tprocessOnCameraStart();\n\t\t}\n\t}\n\n\tpublic void disconnect() {\n\t\tif (DEBUG) Log.d(TAG, \"disconnect:\");\n\t\tstopRecording();\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\tif (thread == null) return;\n\t\tsynchronized (thread.mSync) {\n\t\t\tsendEmptyMessage(MSG_PREVIEW_STOP);\n\t\t\tsendEmptyMessage(MSG_CLOSE);\n\t\t\t// wait for actually preview stopped to avoid releasing Surface/SurfaceTexture\n\t\t\t// while preview is still running.\n\t\t\t// therefore this method will take a time to execute\n\t\t\ttry {\n\t\t\t\tthread.mSync.wait();\n\t\t\t} catch (final InterruptedException e) {\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic boolean isConnected() {\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\treturn (thread != null) && thread.isCameraOpened();\n\t}\n\n\tpublic boolean isRecording() {\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\treturn (thread != null) && thread.isRecording();\n\t}\n\n\tpublic void addSurface(final int id, final Surface surface, final boolean isRecordable, final IUVCServiceOnFrameAvailable onFrameAvailableListener) {\n\t\tif (DEBUG) Log.d(TAG, \"addSurface:id=\" + id +\",surface=\" + surface);\n\t\tif (mRendererHolder != null)\n\t\t\tmRendererHolder.addSurface(id, surface, isRecordable);\n\t}\n\n\tpublic void removeSurface(final int id) {\n\t\tif (DEBUG) Log.d(TAG, \"removeSurface:id=\" + id);\n\t\tif (mRendererHolder != null)\n\t\t\tmRendererHolder.removeSurface(id);\n\t}\n\n\tpublic void startRecording() {\n\t\tif (!isRecording())\n\t\t\tsendEmptyMessage(MSG_CAPTURE_START);\n\t}\n\n\tpublic void stopRecording() {\n\t\tif (isRecording())\n\t\t\tsendEmptyMessage(MSG_CAPTURE_STOP);\n\t}\n\n\tpublic void captureStill(final String path) {\n\t\tif (mRendererHolder != null) {\n\t\t\tmRendererHolder.captureStill(path);\n\t\t\tsendMessage(obtainMessage(MSG_CAPTURE_STILL, path));\n\t\t}\n\t}\n\n//********************************************************************************\n\tprivate void processOnCameraStart() {\n\t\tif (DEBUG) Log.d(TAG, \"processOnCameraStart:\");\n\t\ttry {\n\t\t\tfinal int n = mCallbacks.beginBroadcast();\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tif (!((CallbackCookie)mCallbacks.getBroadcastCookie(i)).isConnected)\n\t\t\t\ttry {\n\t\t\t\t\tmCallbacks.getBroadcastItem(i).onConnected();\n\t\t\t\t\t((CallbackCookie)mCallbacks.getBroadcastCookie(i)).isConnected = true;\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tLog.e(TAG, \"failed to call IOverlayCallback#onFrameAvailable\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tmCallbacks.finishBroadcast();\n\t\t} catch (final Exception e) {\n\t\t\tLog.w(TAG, e);\n\t\t}\n\t}\n\n\tprivate void processOnCameraStop() {\n\t\tif (DEBUG) Log.d(TAG, \"processOnCameraStop:\");\n\t\tfinal int n = mCallbacks.beginBroadcast();\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tif (((CallbackCookie)mCallbacks.getBroadcastCookie(i)).isConnected)\n\t\t\ttry {\n\t\t\t\tmCallbacks.getBroadcastItem(i).onDisConnected();\n\t\t\t\t((CallbackCookie)mCallbacks.getBroadcastCookie(i)).isConnected = false;\n\t\t\t} catch (final Exception e) {\n\t\t\t\tLog.e(TAG, \"failed to call IOverlayCallback#onDisConnected\");\n\t\t\t}\n\t\t}\n\t\tmCallbacks.finishBroadcast();\n\t}\n\n//**********************************************************************\n\tprivate static final int MSG_OPEN = 0;\n\tprivate static final int MSG_CLOSE = 1;\n\tprivate static final int MSG_PREVIEW_START = 2;\n\tprivate static final int MSG_PREVIEW_STOP = 3;\n\tprivate static final int MSG_CAPTURE_STILL = 4;\n\tprivate static final int MSG_CAPTURE_START = 5;\n\tprivate static final int MSG_CAPTURE_STOP = 6;\n\tprivate static final int MSG_MEDIA_UPDATE = 7;\n\tprivate static final int MSG_RELEASE = 9;\n\n\t@Override\n\tpublic void handleMessage(final Message msg) {\n\t\tfinal CameraThread thread = mWeakThread.get();\n\t\tif (thread == null) return;\n\t\tswitch (msg.what) {\n\t\tcase MSG_OPEN:\n\t\t\tthread.handleOpen();\n\t\t\tbreak;\n\t\tcase MSG_CLOSE:\n\t\t\tthread.handleClose();\n\t\t\tbreak;\n\t\tcase MSG_PREVIEW_START:\n\t\t\tthread.handleStartPreview(msg.arg1, msg.arg2, (Surface)msg.obj);\n\t\t\tbreak;\n\t\tcase MSG_PREVIEW_STOP:\n\t\t\tthread.handleStopPreview();\n\t\t\tbreak;\n\t\tcase MSG_CAPTURE_STILL:\n\t\t\tthread.handleCaptureStill((String)msg.obj);\n\t\t\tbreak;\n\t\tcase MSG_CAPTURE_START:\n\t\t\tthread.handleStartRecording();\n\t\t\tbreak;\n\t\tcase MSG_CAPTURE_STOP:\n\t\t\tthread.handleStopRecording();\n\t\t\tbreak;\n\t\tcase MSG_MEDIA_UPDATE:\n\t\t\tthread.handleUpdateMedia((String)msg.obj);\n\t\t\tbreak;\n\t\tcase MSG_RELEASE:\n\t\t\tthread.handleRelease();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new RuntimeException(\"unsupported message:what=\" + msg.what);\n\t\t}\n\t}\n\n\tprivate final RenderHolderCallback mRenderHolderCallback\n\t\t= new RenderHolderCallback() {\n\t\t@Override\n\t\tpublic void onCreate(final Surface surface) {\n\t\t}\n\n\t\t@Override\n\t\tpublic void onFrameAvailable() {\n\t\t\tfinal CameraThread thread = mWeakThread.get();\n\t\t\tif ((thread != null) && (thread.mVideoEncoder != null)) {\n\t\t\t\ttry {\n\t\t\t\t\tthread.mVideoEncoder.frameAvailableSoon();\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\t//\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDestroy() {\n\t\t}\n\t};\n\n\tprivate static final class CameraThread extends Thread {\n\t\tprivate static final String TAG_THREAD = \"CameraThread\";\n\t\tprivate final Object mSync = new Object();\n\t\tprivate boolean mIsRecording;\n\t    private final WeakReference<Context> mWeakContext;\n\t\tprivate int mEncoderSurfaceId;\n\t\tprivate int mFrameWidth, mFrameHeight;\n\t\t/**\n\t\t * shutter sound\n\t\t */\n\t\tprivate SoundPool mSoundPool;\n\t\tprivate int mSoundId;\n\t\tprivate CameraServer mHandler;\n\t\tprivate UsbControlBlock mCtrlBlock;\n\t\t/**\n\t\t * for accessing UVC camera\n\t\t */\n\t\tprivate volatile UVCCamera mUVCCamera;\n\t\t/**\n\t\t * muxer for audio/video recording\n\t\t */\n\t\tprivate MediaMuxerWrapper mMuxer;\n\t\tprivate MediaSurfaceEncoder mVideoEncoder;\n\n\t\tprivate CameraThread(final Context context, final UsbControlBlock ctrlBlock) {\n\t\t\tsuper(\"CameraThread\");\n\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"Constructor:\");\n\t\t\tmWeakContext = new WeakReference<Context>(context);\n\t\t\tmCtrlBlock = ctrlBlock;\n\t\t\tloadShutterSound(context);\n\t\t}\n\n\t\t@Override\n\t\tprotected void finalize() throws Throwable {\n\t\t\tLog.i(TAG_THREAD, \"CameraThread#finalize\");\n\t\t\tsuper.finalize();\n\t\t}\n\n\t\tpublic CameraServer getHandler() {\n\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"getHandler:\");\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (mHandler == null)\n\t\t\t\ttry {\n\t\t\t\t\tmSync.wait();\n\t\t\t\t} catch (final InterruptedException e) {\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn mHandler;\n\t\t}\n\n\t\tpublic boolean isCameraOpened() {\n\t\t\treturn mUVCCamera != null;\n\t\t}\n\n\t\tpublic boolean isRecording() {\n\t\t\treturn (mUVCCamera != null) && (mMuxer != null);\n\t\t}\n\n\t\tpublic void handleOpen() {\n\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"handleOpen:\");\n\t\t\thandleClose();\n\t\t\tsynchronized (mSync) {\n\t\t\t\tmUVCCamera = new UVCCamera();\n\t\t\t\tmUVCCamera.open(mCtrlBlock);\n\t\t\t\tif (DEBUG) Log.i(TAG, \"supportedSize:\" + mUVCCamera.getSupportedSize());\n\t\t\t}\n\t\t\tmHandler.processOnCameraStart();\n\t\t}\n\n\t\tpublic void handleClose() {\n\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"handleClose:\");\n\t\t\thandleStopRecording();\n\t\t\tboolean closed = false;\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\tmUVCCamera.stopPreview();\n\t\t\t\t\tmUVCCamera.destroy();\n\t\t\t\t\tmUVCCamera = null;\n\t\t\t\t\tclosed = true;\n\t\t\t\t}\n\t\t\t\tmSync.notifyAll();\n\t\t\t}\n\t\t\tif (closed)\n\t\t\t\tmHandler.processOnCameraStop();\n\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"handleClose:finished\");\n\t\t}\n\n\t\tpublic void handleStartPreview(final int width, final int height, final Surface surface) {\n\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"handleStartPreview:\");\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (mUVCCamera == null) return;\n\t\t\t\ttry {\n\t\t\t\t\tmUVCCamera.setPreviewSize(width, height, UVCCamera.FRAME_FORMAT_MJPEG);\n\t\t\t\t} catch (final IllegalArgumentException e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// fallback to YUV mode\n\t\t\t\t\t\tmUVCCamera.setPreviewSize(width, height, UVCCamera.DEFAULT_PREVIEW_MODE);\n\t\t\t\t\t} catch (final IllegalArgumentException e1) {\n\t\t\t\t\t\tmUVCCamera.destroy();\n\t\t\t\t\t\tmUVCCamera = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (mUVCCamera == null) return;\n//\t\t\t\tmUVCCamera.setFrameCallback(mIFrameCallback, UVCCamera.PIXEL_FORMAT_YUV);\n\t\t\t\tmFrameWidth = width;\n\t\t\t\tmFrameHeight = height;\n\t\t\t\tmUVCCamera.setPreviewDisplay(surface);\n\t\t\t\tmUVCCamera.startPreview();\n\t\t\t}\n\t\t}\n\n\t\tpublic void handleStopPreview() {\n\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"handleStopPreview:\");\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\tmUVCCamera.stopPreview();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void handleResize(final int width, final int height, final Surface surface) {\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\tfinal Size sz = mUVCCamera.getPreviewSize();\n\t\t\t\t\tif ((sz != null) && ((width != sz.width) || (height != sz.height))) {\n\t\t\t\t\t\tmUVCCamera.stopPreview();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmUVCCamera.setPreviewSize(width, height);\n\t\t\t\t\t\t} catch (final IllegalArgumentException e) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tmUVCCamera.setPreviewSize(sz.width, sz.height);\n\t\t\t\t\t\t\t} catch (final IllegalArgumentException e1) {\n\t\t\t\t\t\t\t\t// unexpectedly #setPreviewSize failed\n\t\t\t\t\t\t\t\tmUVCCamera.destroy();\n\t\t\t\t\t\t\t\tmUVCCamera = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (mUVCCamera == null) return;\n\t\t\t\t\t\tmFrameWidth = width;\n\t\t\t\t\t\tmFrameHeight = height;\n\t\t\t\t\t\tmUVCCamera.setPreviewDisplay(surface);\n\t\t\t\t\t\tmUVCCamera.startPreview();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void handleCaptureStill(final String path) {\n\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"handleCaptureStill:\");\n\n\t\t\tmSoundPool.play(mSoundId, 0.2f, 0.2f, 0, 0, 1.0f);\t// play shutter sound\n\t\t}\n\n\t\tpublic void handleStartRecording() {\n\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"handleStartRecording:\");\n\t\t\ttry {\n\t\t\t\tif ((mUVCCamera == null) || (mMuxer != null)) return;\n\t\t\t\tmMuxer = new MediaMuxerWrapper(\".mp4\");\t// if you record audio only, \".m4a\" is also OK.\n//\t\t\t\tnew MediaSurfaceEncoder(mFrameWidth, mFrameHeight, mMuxer, mMediaEncoderListener);\n\t\t\t\tnew MediaSurfaceEncoder(mMuxer, mFrameWidth, mFrameHeight, mMediaEncoderListener);\n\t\t\t\tif (true) {\n\t\t\t\t\t// for audio capturing\n\t\t\t\t\tnew MediaAudioEncoder(mMuxer, mMediaEncoderListener);\n\t\t\t\t}\n\t\t\t\tmMuxer.prepare();\n\t\t\t\tmMuxer.startRecording();\n\t\t\t} catch (final IOException e) {\n\t\t\t\tLog.e(TAG, \"startCapture:\", e);\n\t\t\t}\n\t\t}\n\n\t\tpublic void handleStopRecording() {\n\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"handleStopRecording:mMuxer=\" + mMuxer);\n\t\t\tif (mMuxer != null) {\n\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\t\tmUVCCamera.stopCapture();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmMuxer.stopRecording();\n\t\t\t\tmMuxer = null;\n\t\t\t\t// you should not wait here\n\t\t\t}\n\t\t}\n\n\t\tpublic void handleUpdateMedia(final String path) {\n\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"handleUpdateMedia:path=\" + path);\n\t\t\tfinal Context context = mWeakContext.get();\n\t\t\tif (context != null) {\n\t\t\t\ttry {\n\t\t\t\t\tif (DEBUG) Log.i(TAG, \"MediaScannerConnection#scanFile\");\n\t\t\t\t\tMediaScannerConnection.scanFile(context, new String[]{ path }, null, null);\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tLog.e(TAG, \"handleUpdateMedia:\", e);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tLog.w(TAG, \"MainActivity already destroyed\");\n\t\t\t\t// give up to add this movice to MediaStore now.\n\t\t\t\t// Seeing this movie on Gallery app etc. will take a lot of time.\n\t\t\t\thandleRelease();\n\t\t\t}\n\t\t}\n\n\t\tpublic void handleRelease() {\n\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"handleRelease:\");\n\t\t\thandleClose();\n\t\t\tif (mCtrlBlock != null) {\n\t\t\t\tmCtrlBlock.close();\n\t\t\t\tmCtrlBlock = null;\n\t\t\t}\n\t\t\tif (!mIsRecording)\n\t\t\t\tLooper.myLooper().quit();\n\t\t}\n\n/*\t\t// if you need frame data as ByteBuffer on Java side, you can use this callback method with UVCCamera#setFrameCallback\n\t\tprivate final IFrameCallback mIFrameCallback = new IFrameCallback() {\n\t\t\t@Override\n\t\t\tpublic void onFrame(final ByteBuffer frame) {\n\t\t\t}\n\t\t}; */\n\n\t\tprivate final IUVCServiceOnFrameAvailable mOnFrameAvailable = new IUVCServiceOnFrameAvailable() {\n\t\t\t@Override\n\t\t\tpublic IBinder asBinder() {\n\t\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"asBinder:\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void onFrameAvailable() throws RemoteException {\n//\t\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"onFrameAvailable:\");\n\t\t\t\tif (mVideoEncoder != null)\n\t\t\t\t\tmVideoEncoder.frameAvailableSoon();\n\t\t\t}\n\t\t};\n\n\t\tprivate final MediaEncoder.MediaEncoderListener mMediaEncoderListener = new MediaEncoder.MediaEncoderListener() {\n\t\t\t@Override\n\t\t\tpublic void onPrepared(final MediaEncoder encoder) {\n\t\t\t\tif (DEBUG) Log.d(TAG, \"onPrepared:encoder=\" + encoder);\n\t\t\t\tmIsRecording = true;\n\t\t\t\tif (encoder instanceof MediaSurfaceEncoder)\n\t\t\t\ttry {\n\t\t\t\t\tmVideoEncoder = (MediaSurfaceEncoder)encoder;\n\t\t\t\t\tfinal Surface encoderSurface = mVideoEncoder.getInputSurface();\n\t\t\t\t\tmEncoderSurfaceId = encoderSurface.hashCode();\n\t\t\t\t\tmHandler.mRendererHolder.addSurface(mEncoderSurfaceId, encoderSurface, true);\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tLog.e(TAG, \"onPrepared:\", e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onStopped(final MediaEncoder encoder) {\n\t\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"onStopped:encoder=\" + encoder);\n\t\t\t\tif ((encoder instanceof MediaSurfaceEncoder))\n\t\t\t\ttry {\n\t\t\t\t\tmIsRecording = false;\n\t\t\t\t\tif (mEncoderSurfaceId > 0) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmHandler.mRendererHolder.removeSurface(mEncoderSurfaceId);\n\t\t\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\t\t\tLog.w(TAG, e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmEncoderSurfaceId = -1;\n\t\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\t\tif (mUVCCamera != null) {\n\t\t\t\t\t\t\tmUVCCamera.stopCapture();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmVideoEncoder = null;\n\t\t\t\t\tfinal String path = encoder.getOutputPath();\n\t\t\t\t\tif (!TextUtils.isEmpty(path)) {\n\t\t\t\t\t\tmHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_MEDIA_UPDATE, path), 1000);\n\t\t\t\t\t}\n\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\tLog.e(TAG, \"onPrepared:\", e);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * prepare and load shutter sound for still image capturing\n\t\t */\n\t\t@SuppressWarnings(\"deprecation\")\n\t\tprivate void loadShutterSound(final Context context) {\n\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"loadShutterSound:\");\n\t    \t// get system stream type using refrection\n\t        int streamType;\n\t        try {\n\t            final Class<?> audioSystemClass = Class.forName(\"android.media.AudioSystem\");\n\t            final Field sseField = audioSystemClass.getDeclaredField(\"STREAM_SYSTEM_ENFORCED\");\n\t            streamType = sseField.getInt(null);\n\t        } catch (final Exception e) {\n\t        \tstreamType = AudioManager.STREAM_SYSTEM;\t// set appropriate according to your app policy\n\t        }\n\t        if (mSoundPool != null) {\n\t        \ttry {\n\t        \t\tmSoundPool.release();\n\t        \t} catch (final Exception e) {\n\t        \t}\n\t        \tmSoundPool = null;\n\t        }\n\t        // load sutter sound from resource\n\t\t    mSoundPool = new SoundPool(2, streamType, 0);\n\t\t    mSoundId = mSoundPool.load(context, R.raw.camera_click, 1);\n\t\t}\n\n\t\t@Override\n\t\tpublic void run() {\n\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"run:\");\n\t\t\tLooper.prepare();\n\t\t\tsynchronized (mSync) {\n\t\t\t\tmHandler = new CameraServer(this);\n\t\t\t\tmSync.notifyAll();\n\t\t\t}\n\t\t\tLooper.loop();\n\t\t\tsynchronized (mSync) {\n\t\t\t\tmHandler = null;\n\t\t\t\tmSoundPool.release();\n\t\t\t\tmSoundPool = null;\n\t\t\t\tmSync.notifyAll();\n\t\t\t}\n\t\t\tif (DEBUG) Log.d(TAG_THREAD, \"run:finished\");\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "usbCameraTest4/src/main/java/com/serenegiant/service/UVCService.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.service;\n\nimport android.app.Notification;\nimport android.app.NotificationManager;\nimport android.app.PendingIntent;\nimport android.content.Intent;\nimport android.hardware.usb.UsbDevice;\nimport android.os.IBinder;\nimport android.os.RemoteException;\nimport android.util.Log;\nimport android.util.SparseArray;\nimport android.view.Surface;\n\nimport com.serenegiant.common.BaseService;\nimport com.serenegiant.usb.USBMonitor;\nimport com.serenegiant.usb.USBMonitor.OnDeviceConnectListener;\nimport com.serenegiant.usb.USBMonitor.UsbControlBlock;\nimport com.serenegiant.usbcameratest4.MainActivity;\nimport com.serenegiant.usbcameratest4.R;\n\npublic class UVCService extends BaseService {\n\tprivate static final boolean DEBUG = true;\n\tprivate static final String TAG = \"UVCService\";\n\n\tprivate static final int NOTIFICATION = R.string.app_name;\n\n\tprivate USBMonitor mUSBMonitor;\n\tprivate NotificationManager mNotificationManager;\n\n\tpublic UVCService() {\n\t\tif (DEBUG) Log.d(TAG, \"Constructor:\");\n\t}\n\n\t@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tif (DEBUG) Log.d(TAG, \"onCreate:\");\n\t\tif (mUSBMonitor == null) {\n\t\t\tmUSBMonitor = new USBMonitor(getApplicationContext(), mOnDeviceConnectListener);\n\t\t\tmUSBMonitor.register();\n\t\t}\n\t\tmNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);\n\t\tshowNotification(getString(R.string.app_name));\n\t}\n\n\t@Override\n\tpublic void onDestroy() {\n\t\tif (DEBUG) Log.d(TAG, \"onDestroy:\");\n\t\tif (mUSBMonitor != null) {\n\t\t\tmUSBMonitor.unregister();\n\t\t\tmUSBMonitor = null;\n\t\t}\n\t\tstopForeground(true/*removeNotification*/);\n\t\tif (mNotificationManager != null) {\n\t\t\tmNotificationManager.cancel(NOTIFICATION);\n\t\t\tmNotificationManager = null;\n\t\t}\n\t\tsuper.onDestroy();\n\t}\n\n\t@Override\n\tpublic IBinder onBind(final Intent intent) {\n\t\tif (DEBUG) Log.d(TAG, \"onBind:\" + intent);\n\t\tfinal String action = intent != null ? intent.getAction() : null;\n\t\tif (IUVCService.class.getName().equals(action)) {\n\t\t\tLog.i(TAG, \"return mBasicBinder\");\n\t\t\treturn mBasicBinder;\n\t\t}\n\t\tif (IUVCSlaveService.class.getName().equals(action)) {\n\t\t\tLog.i(TAG, \"return mSlaveBinder\");\n\t\t\treturn mSlaveBinder;\n\t\t}\n\t\treturn null;\n\t}\n\n\t@Override\n\tpublic void onRebind(final Intent intent) {\n\t\tif (DEBUG) Log.d(TAG, \"onRebind:\" + intent);\n\t}\n\n\t@Override\n\tpublic boolean onUnbind(final Intent intent) {\n\t\tif (DEBUG) Log.d(TAG, \"onUnbind:\" + intent);\n\t\tif (checkReleaseService()) {\n\t\t\tstopSelf();\n\t\t}\n\t\tif (DEBUG) Log.d(TAG, \"onUnbind:finished\");\n\t\treturn true;\n\t}\n\n//********************************************************************************\n\t/**\n\t * helper method to show/change message on notification area\n\t * and set this service as foreground service to keep alive as possible as this can.\n\t * @param text\n\t */\n\tprivate void showNotification(final CharSequence text) {\n\t\tif (DEBUG) Log.v(TAG, \"showNotification:\" + text);\n        // Set the info for the views that show in the notification panel.\n        final Notification notification = new Notification.Builder(this)\n\t\t\t.setSmallIcon(R.drawable.ic_launcher)  // the status icon\n\t\t\t.setTicker(text)  // the status text\n\t\t\t.setWhen(System.currentTimeMillis())  // the time stamp\n\t\t\t.setContentTitle(getText(R.string.app_name))  // the label of the entry\n\t\t\t.setContentText(text)  // the contents of the entry\n\t\t\t.setContentIntent(PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), 0))  // The intent to send when the entry is clicked\n\t\t\t.build();\n\n\t\tstartForeground(NOTIFICATION, notification);\n        // Send the notification.\n\t\tmNotificationManager.notify(NOTIFICATION, notification);\n    }\n\n\tprivate final OnDeviceConnectListener mOnDeviceConnectListener = new OnDeviceConnectListener() {\n\t\t@Override\n\t\tpublic void onAttach(final UsbDevice device) {\n\t\t\tif (DEBUG) Log.d(TAG, \"OnDeviceConnectListener#onAttach:\");\n\t\t}\n\n\t\t@Override\n\t\tpublic void onConnect(final UsbDevice device, final UsbControlBlock ctrlBlock, final boolean createNew) {\n\t\t\tif (DEBUG) Log.d(TAG, \"OnDeviceConnectListener#onConnect:\");\n\n\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tfinal int key = device.hashCode();\n\t\t\t\t\tCameraServer service;\n\t\t\t\t\tsynchronized (sServiceSync) {\n\t\t\t\t\t\tservice = sCameraServers.get(key);\n\t\t\t\t\t\tif (service == null) {\n\t\t\t\t\t\t\tservice = CameraServer.createServer(UVCService.this, ctrlBlock, device.getVendorId(), device.getProductId());\n\t\t\t\t\t\t\tsCameraServers.append(key, service);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tLog.w(TAG, \"service already exist before connection\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsServiceSync.notifyAll();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDisconnect(final UsbDevice device, final UsbControlBlock ctrlBlock) {\n\t\t\tif (DEBUG) Log.d(TAG, \"OnDeviceConnectListener#onDisconnect:\");\n\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tremoveService(device);\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDettach(final UsbDevice device) {\n\t\t\tif (DEBUG) Log.d(TAG, \"OnDeviceConnectListener#onDettach:\");\n\t\t}\n\n\t\t@Override\n\t\tpublic void onCancel(final UsbDevice device) {\n\t\t\tif (DEBUG) Log.d(TAG, \"OnDeviceConnectListener#onCancel:\");\n\t\t\tsynchronized (sServiceSync) {\n\t\t\t\tsServiceSync.notifyAll();\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate void removeService(final UsbDevice device) {\n\t\tfinal int key = device.hashCode();\n\t\tsynchronized (sServiceSync) {\n\t\t\tfinal CameraServer service = sCameraServers.get(key);\n\t\t\tif (service != null)\n\t\t\t\tservice.release();\n\t\t\tsCameraServers.remove(key);\n\t\t\tsServiceSync.notifyAll();\n\t\t}\n\t\tif (checkReleaseService()) {\n\t\t\tstopSelf();\n\t\t}\n\t}\n//********************************************************************************\n\tprivate static final Object sServiceSync = new Object();\n\tprivate static final SparseArray<CameraServer> sCameraServers = new SparseArray<CameraServer>();\n\n\t/**\n\t * get CameraService that has specific ID<br>\n\t * if zero is provided as ID, just return top of CameraServer instance(non-blocking method) if exists or null.<br>\n\t * if non-zero ID is provided, return specific CameraService if exist. block if not exists.<br>\n\t * return null if not exist matched specific ID<br>\n\t * @param serviceId\n\t * @return\n\t */\n\tprivate static CameraServer getCameraServer(final int serviceId) {\n\t\tsynchronized (sServiceSync) {\n\t\t\tCameraServer server = null;\n\t\t\tif ((serviceId == 0) && (sCameraServers.size() > 0)) {\n\t\t\t\tserver = sCameraServers.valueAt(0);\n\t\t\t} else {\n\t\t\t\tserver = sCameraServers.get(serviceId);\n\t\t\t\tif (server == null)\n\t\t\t\t\ttry {\n\t\t\t\t\t\tLog.i(TAG, \"waiting for service is ready\");\n\t\t\t\t\t\tsServiceSync.wait();\n\t\t\t\t\t} catch (final InterruptedException e) {\n\t\t\t\t\t}\n\t\t\t\t\tserver = sCameraServers.get(serviceId);\n\t\t\t}\n\t\t\treturn server;\n\t\t}\n\t}\n\n\t/**\n\t * @return true if there are no camera connection\n\t */\n\tprivate static boolean checkReleaseService() {\n\t\tCameraServer server = null;\n\t\tsynchronized (sServiceSync) {\n\t\t\tfinal int n = sCameraServers.size();\n\t\t\tif (DEBUG) Log.d(TAG, \"checkReleaseService:number of service=\" + n);\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tserver = sCameraServers.valueAt(i);\n\t\t\t\tLog.i(TAG, \"checkReleaseService:server=\" + server + \",isConnected=\" + (server != null && server.isConnected()));\n\t\t\t\tif (server != null && !server.isConnected()) {\n\t\t\t\t\tsCameraServers.removeAt(i);\n\t\t\t\t\tserver.release();\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn sCameraServers.size() == 0;\n\t\t}\n\t}\n\n//********************************************************************************\n\tprivate final IUVCService.Stub mBasicBinder = new IUVCService.Stub() {\n\t\tprivate IUVCServiceCallback mCallback;\n\n\t\t@Override\n\t\tpublic int select(final UsbDevice device, final IUVCServiceCallback callback) throws RemoteException {\n\t\t\tif (DEBUG) Log.d(TAG, \"mBasicBinder#select:device=\" + (device !=null ? device.getDeviceName() : null));\n\t\t\tmCallback = callback;\n\t\t\tfinal int serviceId = device.hashCode();\n\t\t\tCameraServer server = null;\n\t\t\tsynchronized (sServiceSync) {\n\t\t\t\tserver = sCameraServers.get(serviceId);\n\t\t\t\tif (server == null) {\n\t\t\t\t\tLog.i(TAG, \"request permission\");\n\t\t\t\t\tmUSBMonitor.requestPermission(device);\n\t\t\t\t\tLog.i(TAG, \"wait for getting permission\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsServiceSync.wait();\n\t\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\t\tLog.e(TAG, \"connect:\", e);\n\t\t\t\t\t}\n\t\t\t\t\tLog.i(TAG, \"check service again\");\n\t\t\t\t\tserver = sCameraServers.get(serviceId);\n\t\t\t\t\tif (server == null) {\n\t\t\t\t\t\tthrow new RuntimeException(\"failed to open USB device(has no permission)\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (server != null) {\n\t\t\t\tLog.i(TAG, \"success to get service:serviceId=\" + serviceId);\n\t\t\t\tserver.registerCallback(callback);\n\t\t\t}\n\t\t\treturn serviceId;\n\t\t}\n\n\t\t@Override\n\t\tpublic void release(final int serviceId) throws RemoteException {\n\t\t\tif (DEBUG) Log.d(TAG, \"mBasicBinder#release:\");\n\t\t\tsynchronized (sServiceSync) {\n\t\t\t\tfinal CameraServer server = sCameraServers.get(serviceId);\n\t\t\t\tif (server != null) {\n\t\t\t\t\tif (server.unregisterCallback(mCallback)) {\n\t\t\t\t\t\tif (!server.isConnected()) {\n\t\t\t\t\t\t\tsCameraServers.remove(serviceId);\n\t\t\t\t\t\t\tif (server != null) {\n\t\t\t\t\t\t\t\tserver.release();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfinal CameraServer srv = sCameraServers.get(serviceId);\n\t\t\t\t\t\t\tLog.w(TAG, \"srv=\" + srv);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tmCallback = null;\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean isSelected(final int serviceId) throws RemoteException {\n\t\t\treturn getCameraServer(serviceId) != null;\n\t\t}\n\n\t\t@Override\n\t\tpublic void releaseAll() throws RemoteException {\n\t\t\tif (DEBUG) Log.d(TAG, \"mBasicBinder#releaseAll:\");\n\t\t\tCameraServer server;\n\t\t\tsynchronized (sServiceSync) {\n\t\t\t\tfinal int n = sCameraServers.size();\n\t\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\t\tserver = sCameraServers.valueAt(i);\n\t\t\t\t\tsCameraServers.removeAt(i);\n\t\t\t\t\tif (server != null) {\n\t\t\t\t\t\tserver.release();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void resize(final int serviceId, final int width, final int height) {\n\t\t\tif (DEBUG) Log.d(TAG, \"mBasicBinder#resize:\");\n\t\t\tfinal CameraServer server = getCameraServer(serviceId);\n\t\t\tif (server == null) {\n\t\t\t\tthrow new IllegalArgumentException(\"invalid serviceId\");\n\t\t\t}\n\t\t\tserver.resize(width, height);\n\t\t}\n\n\t\t@Override\n\t\tpublic void connect(final int serviceId) throws RemoteException {\n\t\t\tif (DEBUG) Log.d(TAG, \"mBasicBinder#connect:\");\n\t\t\tfinal CameraServer server = getCameraServer(serviceId);\n\t\t\tif (server == null) {\n\t\t\t\tthrow new IllegalArgumentException(\"invalid serviceId\");\n\t\t\t}\n\t\t\tserver.connect();\n\t\t}\n\n\t\t@Override\n\t\tpublic void disconnect(final int serviceId) throws RemoteException {\n\t\t\tif (DEBUG) Log.d(TAG, \"mBasicBinder#disconnect:\");\n\t\t\tfinal CameraServer server = getCameraServer(serviceId);\n\t\t\tif (server == null) {\n\t\t\t\tthrow new IllegalArgumentException(\"invalid serviceId\");\n\t\t\t}\n\t\t\tserver.disconnect();\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean isConnected(final int serviceId) throws RemoteException {\n\t\t\tfinal CameraServer server = getCameraServer(serviceId);\n\t\t\treturn (server != null) && server.isConnected();\n\t\t}\n\n\t\t@Override\n\t\tpublic void addSurface(final int serviceId, final int id_surface, final Surface surface, final boolean isRecordable) throws RemoteException {\n\t\t\tif (DEBUG) Log.d(TAG, \"mBasicBinder#addSurface:id=\" + id_surface + \",surface=\" + surface);\n\t\t\tfinal CameraServer server = getCameraServer(serviceId);\n\t\t\tif (server != null)\n\t\t\t\tserver.addSurface(id_surface, surface, isRecordable, null);\n\t\t}\n\n\t\t@Override\n\t\tpublic void removeSurface(final int serviceId, final int id_surface) throws RemoteException {\n\t\t\tif (DEBUG) Log.d(TAG, \"mBasicBinder#removeSurface:id=\" + id_surface);\n\t\t\tfinal CameraServer server = getCameraServer(serviceId);\n\t\t\tif (server != null)\n\t\t\t\tserver.removeSurface(id_surface);\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean isRecording(final int serviceId) throws RemoteException {\n\t\t\tfinal CameraServer server = getCameraServer(serviceId);\n\t\t\treturn server != null && server.isRecording();\n\t\t}\n\n\t\t@Override\n\t\tpublic void startRecording(final int serviceId) throws RemoteException {\n\t\t\tif (DEBUG) Log.d(TAG, \"mBasicBinder#startRecording:\");\n\t\t\tfinal CameraServer server = getCameraServer(serviceId);\n\t\t\tif ((server != null) && !server.isRecording()) {\n\t\t\t\tserver.startRecording();\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void stopRecording(final int serviceId) throws RemoteException {\n\t\t\tif (DEBUG) Log.d(TAG, \"mBasicBinder#stopRecording:\");\n\t\t\tfinal CameraServer server = getCameraServer(serviceId);\n\t\t\tif ((server != null) && server.isRecording()) {\n\t\t\t\tserver.stopRecording();\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void captureStillImage(final int serviceId, final String path) throws RemoteException {\n\t\t\tif (DEBUG) Log.d(TAG, \"mBasicBinder#captureStillImage:\" + path);\n\t\t\tfinal CameraServer server = getCameraServer(serviceId);\n\t\t\tif (server != null) {\n\t\t\t\tserver.captureStill(path);\n\t\t\t}\n\t\t}\n\n    };\n\n//********************************************************************************\n\tprivate final IUVCSlaveService.Stub mSlaveBinder = new IUVCSlaveService.Stub() {\n\t\t@Override\n\t\tpublic boolean isSelected(final int serviceID) throws RemoteException {\n\t\t\treturn getCameraServer(serviceID) != null;\n\t\t}\n\n\t\t@Override\n\t\tpublic boolean isConnected(final int serviceID) throws RemoteException {\n\t\t\tfinal CameraServer server = getCameraServer(serviceID);\n\t\t\treturn server != null && server.isConnected();\n\t\t}\n\n\t\t@Override\n\t\tpublic void addSurface(final int serviceID, final int id_surface, final Surface surface, final boolean isRecordable, final IUVCServiceOnFrameAvailable callback) throws RemoteException {\n\t\t\tif (DEBUG) Log.d(TAG, \"mSlaveBinder#addSurface:id=\" + id_surface + \",surface=\" + surface);\n\t\t\tfinal CameraServer server = getCameraServer(serviceID);\n\t\t\tif (server != null) {\n\t\t\t\tserver.addSurface(id_surface, surface, isRecordable, callback);\n\t\t\t} else {\n\t\t\t\tLog.e(TAG, \"failed to get CameraServer:serviceID=\" + serviceID);\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void removeSurface(final int serviceID, final int id_surface) throws RemoteException {\n\t\t\tif (DEBUG) Log.d(TAG, \"mSlaveBinder#removeSurface:id=\" + id_surface);\n\t\t\tfinal CameraServer server = getCameraServer(serviceID);\n\t\t\tif (server != null) {\n\t\t\t\tserver.removeSurface(id_surface);\n\t\t\t} else {\n\t\t\t\tLog.e(TAG, \"failed to get CameraServer:serviceID=\" + serviceID);\n\t\t\t}\n\t\t}\n\t};\n\n}\n"
  },
  {
    "path": "usbCameraTest4/src/main/java/com/serenegiant/serviceclient/CameraClient.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.serviceclient;\n\nimport java.lang.ref.WeakReference;\n\nimport android.content.ComponentName;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.ServiceConnection;\nimport android.hardware.usb.UsbDevice;\nimport android.os.Handler;\nimport android.os.IBinder;\nimport android.os.Looper;\nimport android.os.Message;\nimport android.os.RemoteException;\nimport android.util.Log;\nimport android.view.Surface;\n\nimport com.serenegiant.service.IUVCService;\nimport com.serenegiant.service.IUVCServiceCallback;\n\npublic class CameraClient implements ICameraClient {\n\tprivate static final boolean DEBUG = true;\n\tprivate static final String TAG = \"CameraClient\";\n\n\tprotected final WeakReference<Context> mWeakContext;\n\tprotected final WeakReference<CameraHandler> mWeakHandler;\n\tprotected UsbDevice mUsbDevice;\n\n\tprotected final Object mServiceSync = new Object();\n\tprotected IUVCService mService;\n\tprotected ICameraClientCallback mListener;\n\n\tpublic CameraClient(final Context context, final ICameraClientCallback listener) {\n\t\tif (DEBUG) Log.v(TAG, \"Constructor:\");\n\t\tmWeakContext = new WeakReference<Context>(context);\n\t\tmListener = listener;\n\t\tmWeakHandler = new WeakReference<CameraHandler>(CameraHandler.createHandler(this));\n\t\tdoBindService();\n\t}\n\n\t@Override\n\tprotected void finalize() throws Throwable {\n\t\tif (DEBUG) Log.v(TAG, \"finalize\");\n\t\tdoUnBindService();\n\t\tsuper.finalize();\n\t}\n\n\t@Override\n\tpublic void select(final UsbDevice device) {\n\t\tif (DEBUG) Log.v(TAG, \"select:device=\" + (device != null ? device.getDeviceName() : null));\n\t\tmUsbDevice = device;\n\t\tfinal CameraHandler handler = mWeakHandler.get();\n\t\thandler.sendMessage(handler.obtainMessage(MSG_SELECT, device));\n\t}\n\n\t@Override\n\tpublic void release() {\n\t\tif (DEBUG) Log.v(TAG, \"release:\" + this);\n\t\tmUsbDevice = null;\n\t\tmWeakHandler.get().sendEmptyMessage(MSG_RELEASE);\n\t}\n\n\t@Override\n\tpublic UsbDevice getDevice() {\n\t\treturn mUsbDevice;\n\t}\n\n\t@Override\n\tpublic void resize(final int width, final int height) {\n\t\tif (DEBUG) Log.v(TAG, String.format(\"resize(%d,%d)\", width, height));\n\t\tfinal CameraHandler handler = mWeakHandler.get();\n\t\thandler.sendMessage(handler.obtainMessage(MSG_RESIZE, width, height));\n\t}\n\t\n\t@Override\n\tpublic void connect() {\n\t\tif (DEBUG) Log.v(TAG, \"connect:\");\n\t\tmWeakHandler.get().sendEmptyMessage(MSG_CONNECT);\n\t}\n\n\t@Override\n\tpublic void disconnect() {\n\t\tif (DEBUG) Log.v(TAG, \"disconnect:\" + this);\n\t\tmWeakHandler.get().sendEmptyMessage(MSG_DISCONNECT);\n\t}\n\n\t@Override\n\tpublic void addSurface(final Surface surface, final boolean isRecordable) {\n\t\tif (DEBUG) Log.v(TAG, \"addSurface:surface=\" + surface + \",hash=\" + surface.hashCode());\n\t\tfinal CameraHandler handler = mWeakHandler.get();\n\t\thandler.sendMessage(handler.obtainMessage(MSG_ADD_SURFACE, isRecordable ? 1 : 0, 0, surface));\n\t}\n\n\t@Override\n\tpublic void removeSurface(final Surface surface) {\n\t\tif (DEBUG) Log.v(TAG, \"removeSurface:surface=\" + surface + \",hash=\" + surface.hashCode());\n\t\tfinal CameraHandler handler = mWeakHandler.get();\n\t\thandler.sendMessage(handler.obtainMessage(MSG_REMOVE_SURFACE, surface));\n\t}\n\n\t@Override\n\tpublic boolean isRecording() {\n\t\tfinal CameraHandler handler = mWeakHandler.get();\n\t\treturn (handler != null) && handler.isRecording();\n\t}\n\n\t@Override\n\tpublic void startRecording() {\n\t\tfinal CameraHandler handler = mWeakHandler.get();\n\t\tif ((handler != null) && !handler.isRecording()) {\n\t\t\thandler.sendEmptyMessage(MSG_START_RECORDING);\n\t\t}\n\t}\n\n\t@Override\n\tpublic void stopRecording() {\n\t\tfinal CameraHandler handler = mWeakHandler.get();\n\t\tif ((handler != null) && handler.isRecording()) {\n\t\t\thandler.sendEmptyMessage(MSG_STOP_RECORDING);\n\t\t}\n\t}\n\n\t@Override\n\tpublic void captureStill(final String path) {\n\t\tfinal CameraHandler handler = mWeakHandler.get();\n\t\tif (handler != null) {\n\t\t\thandler.sendMessage(handler.obtainMessage(MSG_CAPTURE_STILL, path));\n\t\t}\n\t}\n\n\tprotected boolean doBindService() {\n\t\tif (DEBUG) Log.v(TAG, \"doBindService:\");\n\t\tsynchronized (mServiceSync) {\n\t\t\tif (mService == null) {\n\t\t\t\tfinal Context context = mWeakContext.get();\n\t\t\t\tif (context != null) {\n\t\t\t\t\tfinal Intent intent = new Intent(IUVCService.class.getName());\n\t\t\t\t\tintent.setPackage(\"com.serenegiant.usbcameratest4\");\n\t\t\t\t\tcontext.bindService(intent,\n\t\t\t\t\t\tmServiceConnection, Context.BIND_AUTO_CREATE);\n\t\t\t\t} else\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected void doUnBindService() {\n\t\tif (DEBUG) Log.v(TAG, \"doUnBindService:\");\n\t\tsynchronized (mServiceSync) {\n\t\t\tif (mService != null) {\n\t\t\t\tfinal Context context = mWeakContext.get();\n\t\t\t\tif (context != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcontext.unbindService(mServiceConnection);\n\t\t\t\t\t} catch (final Exception e) {\n\t\t\t\t\t\t// ignore\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmService = null;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate final ServiceConnection mServiceConnection = new ServiceConnection() {\n\t\t@Override\n\t\tpublic void onServiceConnected(final ComponentName name, final IBinder service) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onServiceConnected:name=\" + name);\n\t\t\tsynchronized (mServiceSync) {\n\t\t\t\tmService = IUVCService.Stub.asInterface(service);\n\t\t\t\tmServiceSync.notifyAll();\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void onServiceDisconnected(final ComponentName name) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onServiceDisconnected:name=\" + name);\n\t\t\tsynchronized (mServiceSync) {\n\t\t\t\tmService = null;\n\t\t\t\tmServiceSync.notifyAll();\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * get reference to instance of IUVCService\n\t * you should not call this from UI thread, this method block until the service is available\n\t * @return\n\t */\n\tprivate IUVCService getService() {\n\t\tsynchronized (mServiceSync) {\n\t\t\tif (mService == null) {\n\t\t\t\ttry {\n\t\t\t\t\tmServiceSync.wait();\n\t\t\t\t} catch (final InterruptedException e) {\n\t\t\t\t\tif (DEBUG) Log.e(TAG, \"getService:\", e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn mService;\n\t}\n\n\tprivate static final int MSG_SELECT = 0;\n\tprivate static final int MSG_CONNECT = 1;\n\tprivate static final int MSG_DISCONNECT = 2;\n\tprivate static final int MSG_ADD_SURFACE = 3;\n\tprivate static final int MSG_REMOVE_SURFACE = 4;\n\tprivate static final int MSG_START_RECORDING = 6;\n\tprivate static final int MSG_STOP_RECORDING = 7;\n\tprivate static final int MSG_CAPTURE_STILL = 8;\n\tprivate static final int MSG_RESIZE = 9;\n\tprivate static final int MSG_RELEASE = 99;\n\n\tprivate static final class CameraHandler extends Handler {\n\n\t\tpublic static CameraHandler createHandler(final CameraClient parent) {\n\t\t\tfinal CameraTask runnable = new CameraTask(parent);\n\t\t\tnew Thread(runnable).start();\n\t\t\treturn runnable.getHandler();\n\t\t}\n\n\t\tprivate CameraTask mCameraTask;\n\t\tprivate CameraHandler(final CameraTask cameraTask) {\n\t\t\tmCameraTask = cameraTask;\n\t\t}\n\n\t\tpublic boolean isRecording() {\n\t\t\tfinal IUVCService service = mCameraTask.mParent.getService();\n\t\t\tif (service != null)\n\t\t\ttry {\n\t\t\t\treturn service.isRecording(mCameraTask.mServiceId);\n\t\t\t} catch (final RemoteException e) {\n\t\t\t\tif (DEBUG) Log.e(TAG, \"isRecording:\", e);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t@Override\n\t\tpublic void handleMessage(final Message msg) {\n\t\t\tswitch (msg.what) {\n\t\t\tcase MSG_SELECT:\n\t\t\t\tmCameraTask.handleSelect((UsbDevice)msg.obj);\n\t\t\t\tbreak;\n\t\t\tcase MSG_CONNECT:\n\t\t\t\tmCameraTask.handleConnect();\n\t\t\t\tbreak;\n\t\t\tcase MSG_DISCONNECT:\n\t\t\t\tmCameraTask.handleDisconnect();\n\t\t\t\tbreak;\n\t\t\tcase MSG_ADD_SURFACE:\n\t\t\t\tmCameraTask.handleAddSurface((Surface)msg.obj, msg.arg1 != 0);\n\t\t\t\tbreak;\n\t\t\tcase MSG_REMOVE_SURFACE:\n\t\t\t\tmCameraTask.handleRemoveSurface((Surface)msg.obj);\n\t\t\t\tbreak;\n\t\t\tcase MSG_START_RECORDING:\n\t\t\t\tmCameraTask.handleStartRecording();\n\t\t\t\tbreak;\n\t\t\tcase MSG_STOP_RECORDING:\n\t\t\t\tmCameraTask.handleStopRecording();\n\t\t\t\tbreak;\n\t\t\tcase MSG_CAPTURE_STILL:\n\t\t\t\tmCameraTask.handleCaptureStill((String)msg.obj);\n\t\t\t\tbreak;\n\t\t\tcase MSG_RESIZE:\n\t\t\t\tmCameraTask.handleResize(msg.arg1, msg.arg2);\n\t\t\t\tbreak;\n\t\t\tcase MSG_RELEASE:\n\t\t\t\tmCameraTask.handleRelease();\n\t\t\t\tmCameraTask = null;\n\t\t\t\tLooper.myLooper().quit();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new RuntimeException(\"unknown message:what=\" + msg.what);\n\t\t\t}\n\t\t}\n\n\t\tprivate static final class CameraTask extends IUVCServiceCallback.Stub implements Runnable {\n\t\t\tprivate static final String TAG_CAMERA = \"CameraClientThread\";\n\t\t\tprivate final Object mSync = new Object();\n\t\t\tprivate CameraClient mParent;\n\t\t\tprivate CameraHandler mHandler;\n\t\t\tprivate boolean mIsConnected;\n\t\t\tprivate int mServiceId;\n\n\t\t\tprivate CameraTask(final CameraClient parent) {\n\t\t\t\tmParent = parent;\n\t\t\t}\n\n\t\t\tpublic CameraHandler getHandler() {\n\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\tif (mHandler == null)\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmSync.wait();\n\t\t\t\t\t} catch (final InterruptedException e) {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn mHandler;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tif (DEBUG) Log.v(TAG_CAMERA, \"run:\");\n\t\t\t\tLooper.prepare();\n\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\tmHandler = new CameraHandler(this);\n\t\t\t\t\tmSync.notifyAll();\n\t\t\t\t}\n\t\t\t\tLooper.loop();\n\t\t\t\tif (DEBUG) Log.v(TAG_CAMERA, \"run:finishing\");\n\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\tmHandler = null;\n\t\t\t\t\tmParent = null;\n\t\t\t\t\tmSync.notifyAll();\n\t\t\t\t}\n\t\t\t}\n\n//================================================================================\n// callbacks from service\n\t\t\t@Override\n\t\t\tpublic void onConnected() throws RemoteException {\n\n\t\t\t\tif (DEBUG) Log.v(TAG_CAMERA, \"onConnected:\");\n\t\t\t\tmIsConnected = true;\n\t\t\t\tif (mParent != null) {\n\t\t\t\t\tif (mParent.mListener != null) {\n\t\t\t\t\t\tmParent.mListener.onConnect();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onDisConnected() throws RemoteException {\n\t\t\t\tif (DEBUG) Log.v(TAG_CAMERA, \"onDisConnected:\");\n\t\t\t\tmIsConnected = false;\n\t\t\t\tif (mParent != null) {\n\t\t\t\t\tif (mParent.mListener != null) {\n\t\t\t\t\t\tmParent.mListener.onDisconnect();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n//================================================================================\n\t\t\tpublic void handleSelect(final UsbDevice device) {\n\t\t\t\tif (DEBUG) Log.v(TAG_CAMERA, \"handleSelect:\");\n\t\t\t\tfinal IUVCService service = mParent.getService();\n\t\t\t\tif (service != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmServiceId = service.select(device, this);\n\t\t\t\t\t} catch (final RemoteException e) {\n\t\t\t\t\t\tif (DEBUG) Log.e(TAG_CAMERA, \"select:\", e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void handleRelease() {\n\t\t\t\tif (DEBUG) Log.v(TAG_CAMERA, \"handleRelease:\");\n\t\t\t\tmIsConnected = false;\n\t\t\t\tmParent.doUnBindService();\n\t\t\t}\n\n\t\t\tpublic void handleConnect() {\n\t\t\t\tif (DEBUG) Log.v(TAG_CAMERA, \"handleConnect:\");\n\t\t\t\tfinal IUVCService service = mParent.getService();\n\t\t\t\tif (service != null)\n\t\t\t\ttry {\n\t\t\t\t\tif (!mIsConnected/*!service.isConnected(mServiceId)*/) {\n\t\t\t\t\t\tservice.connect(mServiceId);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tonConnected();\n\t\t\t\t\t}\n\t\t\t\t} catch (final RemoteException e) {\n\t\t\t\t\tif (DEBUG) Log.e(TAG_CAMERA, \"handleConnect:\", e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void handleDisconnect() {\n\t\t\t\tif (DEBUG) Log.v(TAG_CAMERA, \"handleDisconnect:\");\n\t\t\t\tfinal IUVCService service = mParent.getService();\n\t\t\t\tif (service != null)\n\t\t\t\ttry {\n\t\t\t\t\tif (service.isConnected(mServiceId)) {\n\t\t\t\t\t\tservice.disconnect(mServiceId);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tonDisConnected();\n\t\t\t\t\t}\n\t\t\t\t} catch (final RemoteException e) {\n\t\t\t\t\tif (DEBUG) Log.e(TAG_CAMERA, \"handleDisconnect:\", e);\n\t\t\t\t}\n\t\t\t\tmIsConnected = false;\n\t\t\t}\n\n\t\t\tpublic void handleAddSurface(final Surface surface, final boolean isRecordable) {\n\t\t\t\tif (DEBUG) Log.v(TAG_CAMERA, \"handleAddSurface:surface=\" + surface + \",hash=\" + surface.hashCode());\n\t\t\t\tfinal IUVCService service = mParent.getService();\n\t\t\t\tif (service != null)\n\t\t\t\ttry {\n\t\t\t\t\tservice.addSurface(mServiceId, surface.hashCode(), surface, isRecordable);\n\t\t\t\t} catch (final RemoteException e) {\n\t\t\t\t\tif (DEBUG) Log.e(TAG_CAMERA, \"handleAddSurface:\", e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void handleRemoveSurface(final Surface surface) {\n\t\t\t\tif (DEBUG) Log.v(TAG_CAMERA, \"handleRemoveSurface:surface=\" + surface + \",hash=\" + surface.hashCode());\n\t\t\t\tfinal IUVCService service = mParent.getService();\n\t\t\t\tif (service != null)\n\t\t\t\ttry {\n\t\t\t\t\tservice.removeSurface(mServiceId, surface.hashCode());\n\t\t\t\t} catch (final RemoteException e) {\n\t\t\t\t\tif (DEBUG) Log.e(TAG_CAMERA, \"handleRemoveSurface:\", e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void handleStartRecording() {\n\t\t\t\tif (DEBUG) Log.v(TAG, \"handleStartRecording:\");\n\t\t\t\tfinal IUVCService service = mParent.getService();\n\t\t\t\tif (service != null)\n\t\t\t\ttry {\n\t\t\t\t\tif (!service.isRecording(mServiceId)) {\n\t\t\t\t\t\tservice.startRecording(mServiceId);\n\t\t\t\t\t}\n\t\t\t\t} catch (final RemoteException e) {\n\t\t\t\t\tif (DEBUG) Log.e(TAG_CAMERA, \"handleStartRecording:\", e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void handleStopRecording() {\n\t\t\t\tif (DEBUG) Log.v(TAG, \"handleStopRecording:\");\n\t\t\t\tfinal IUVCService service = mParent.getService();\n\t\t\t\tif (service != null)\n\t\t\t\ttry {\n\t\t\t\t\tif (service.isRecording(mServiceId)) {\n\t\t\t\t\t\tservice.stopRecording(mServiceId);\n\t\t\t\t\t}\n\t\t\t\t} catch (final RemoteException e) {\n\t\t\t\t\tif (DEBUG) Log.e(TAG_CAMERA, \"handleStopRecording:\", e);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void handleCaptureStill(final String path) {\n\t\t\t\tif (DEBUG) Log.v(TAG, \"handleCaptureStill:\" + path);\n\t\t\t\tfinal IUVCService service = mParent.getService();\n\t\t\t\tif (service != null)\n\t\t\t\ttry {\n\t\t\t\t\tservice.captureStillImage(mServiceId, path);\n\t\t\t\t} catch (final RemoteException e) {\n\t\t\t\t\tif (DEBUG) Log.e(TAG_CAMERA, \"handleCaptureStill:\", e);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tpublic void handleResize(final int width, final int height) {\n\t\t\t\tif (DEBUG) Log.v(TAG, String.format(\"handleResize(%d,%d)\", width, height));\n\t\t\t\tfinal IUVCService service = mParent.getService();\n\t\t\t\tif (service != null)\n\t\t\t\ttry {\n\t\t\t\t\tservice.resize(mServiceId, width, height);\n\t\t\t\t} catch (final RemoteException e) {\n\t\t\t\t\tif (DEBUG) Log.e(TAG_CAMERA, \"handleResize:\", e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n}\n"
  },
  {
    "path": "usbCameraTest4/src/main/java/com/serenegiant/serviceclient/ICameraClient.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.serviceclient;\n\nimport android.hardware.usb.UsbDevice;\nimport android.view.Surface;\n\npublic interface ICameraClient {\n\tpublic void select(UsbDevice device);\n\tpublic void release();\n\tpublic UsbDevice getDevice();\n\tpublic void resize(int width, int height);\n\tpublic void connect();\n\tpublic void disconnect();\n\tpublic void addSurface(Surface surface, boolean isRecordable);\n\tpublic void removeSurface(Surface surface);\n\tpublic void startRecording();\n\tpublic void stopRecording();\n\tpublic boolean isRecording();\n\tpublic void captureStill(String path);\n}"
  },
  {
    "path": "usbCameraTest4/src/main/java/com/serenegiant/serviceclient/ICameraClientCallback.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.serviceclient;\n\npublic interface ICameraClientCallback {\n\tpublic void onConnect();\n\tpublic void onDisconnect();\n}\n"
  },
  {
    "path": "usbCameraTest4/src/main/java/com/serenegiant/usbcameratest4/CameraFragment.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usbcameratest4;\n\nimport java.util.List;\n\nimport android.app.Activity;\nimport android.app.Fragment;\nimport android.content.Intent;\nimport android.hardware.usb.UsbDevice;\nimport android.os.Bundle;\nimport android.os.Environment;\nimport android.util.Log;\nimport android.view.LayoutInflater;\nimport android.view.SurfaceView;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.view.ViewGroup;\nimport android.widget.CompoundButton;\nimport android.widget.CompoundButton.OnCheckedChangeListener;\nimport android.widget.ImageButton;\nimport android.widget.ToggleButton;\n\nimport com.serenegiant.common.BaseFragment;\nimport com.serenegiant.encoder.MediaMuxerWrapper;\nimport com.serenegiant.service.UVCService;\nimport com.serenegiant.serviceclient.CameraClient;\nimport com.serenegiant.serviceclient.ICameraClient;\nimport com.serenegiant.serviceclient.ICameraClientCallback;\n\nimport com.serenegiant.usb.CameraDialog;\nimport com.serenegiant.usb.DeviceFilter;\nimport com.serenegiant.usb.USBMonitor;\nimport com.serenegiant.usb.USBMonitor.OnDeviceConnectListener;\nimport com.serenegiant.usb.USBMonitor.UsbControlBlock;\nimport com.serenegiant.widget.CameraViewInterface;\n\npublic class CameraFragment extends BaseFragment {\n\n\tprivate static final boolean DEBUG = true;\n\tprivate static final String TAG = \"CameraFragment\";\n\n\tprivate static final int DEFAULT_WIDTH = 640;\n\tprivate static final int DEFAULT_HEIGHT = 480;\n\n\tprivate USBMonitor mUSBMonitor;\n\tprivate ICameraClient mCameraClient;\n\n\tprivate ToggleButton mPreviewButton;\n\tprivate ImageButton mRecordButton;\n\tprivate ImageButton mStillCaptureButton;\n\tprivate CameraViewInterface mCameraView;\n\tprivate SurfaceView mCameraViewSub;\n\tprivate boolean isSubView;\n\n\tpublic CameraFragment() {\n\t\tif (DEBUG) Log.v(TAG, \"Constructor:\");\n//\t\tsetRetainInstance(true);\n\t}\n\n\t@SuppressWarnings(\"deprecation\")\n\t@Override\n\tpublic void onAttach(final Activity activity) {\n\t\tsuper.onAttach(activity);\n\t\tif (DEBUG) Log.v(TAG, \"onAttach:\");\n\t}\n\n\t@Override\n\tpublic void onCreate(final Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tif (DEBUG) Log.v(TAG, \"onCreate:\");\n\t\tif (mUSBMonitor == null) {\n\t\t\tmUSBMonitor = new USBMonitor(getActivity().getApplicationContext(), mOnDeviceConnectListener);\n\t\t\tfinal List<DeviceFilter> filters = DeviceFilter.getDeviceFilters(getActivity(), R.xml.device_filter);\n\t\t\tmUSBMonitor.setDeviceFilter(filters);\n\t\t}\n\t}\n\n\t@Override\n\tpublic View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {\n\t\tif (DEBUG) Log.v(TAG, \"onCreateView:\");\n\t\tfinal View rootView = inflater.inflate(R.layout.fragment_main, container, false);\n\t\tView view = rootView.findViewById(R.id.start_button);\n\t\tview.setOnClickListener(mOnClickListener);\n\t\tview =rootView.findViewById(R.id.stop_button);\n\t\tview.setOnClickListener(mOnClickListener);\n\t\tmPreviewButton = (ToggleButton)rootView.findViewById(R.id.preview_button);\n\t\tsetPreviewButton(false);\n\t\tmPreviewButton.setEnabled(false);\n\t\tmRecordButton = (ImageButton)rootView.findViewById(R.id.record_button);\n\t\tmRecordButton.setOnClickListener(mOnClickListener);\n\t\tmRecordButton.setEnabled(false);\n\t\tmStillCaptureButton = (ImageButton)rootView.findViewById(R.id.still_button);\n\t\tmStillCaptureButton.setOnClickListener(mOnClickListener);\n\t\tmStillCaptureButton.setEnabled(false);\n\t\tmCameraView = (CameraViewInterface)rootView.findViewById(R.id.camera_view);\n\t\tmCameraView.setAspectRatio(DEFAULT_WIDTH / (float)DEFAULT_HEIGHT);\n\t\tmCameraViewSub = (SurfaceView)rootView.findViewById(R.id.camera_view_sub);\n\t\tmCameraViewSub.setOnClickListener(mOnClickListener);\n\t\treturn rootView;\n\t}\n\n\t@Override\n\tpublic void onResume() {\n\t\tsuper.onResume();\n\t\tif (DEBUG) Log.v(TAG, \"onResume:\");\n\t\tmUSBMonitor.register();\n\t}\n\n\t@Override\n\tpublic void onPause() {\n\t\tif (DEBUG) Log.v(TAG, \"onPause:\");\n\t\tif (mCameraClient != null) {\n\t\t\tmCameraClient.removeSurface(mCameraView.getSurface());\n\t\t\tmCameraClient.removeSurface(mCameraViewSub.getHolder().getSurface());\n\t\t\tisSubView = false;\n\t\t}\n\t\tmUSBMonitor.unregister();\n\t\tenableButtons(false);\n\t\tsuper.onPause();\n\t}\n\n\t@Override\n\tpublic void onDestroyView() {\n\t\tif (DEBUG) Log.v(TAG, \"onDestroyView:\");\n\t\tsuper.onDestroyView();\n\t}\n\n\t@Override\n\tpublic void onDestroy() {\n\t\tif (DEBUG) Log.v(TAG, \"onDestroy:\");\n\t\tif (mCameraClient != null) {\n\t\t\tmCameraClient.release();\n\t\t\tmCameraClient = null;\n\t\t}\n\t\tsuper.onDestroy();\n\t}\n\n\t@Override\n\tpublic void onDetach() {\n\t\tif (DEBUG) Log.v(TAG, \"onDetach:\");\n\t\tsuper.onDetach();\n\t}\n\n\tpublic USBMonitor getUSBMonitor() {\n\t\treturn mUSBMonitor;\n\t}\n\n\tprivate final OnDeviceConnectListener mOnDeviceConnectListener = new OnDeviceConnectListener() {\n\t\t@Override\n\t\tpublic void onAttach(final UsbDevice device) {\n\t\t\tif (DEBUG) Log.v(TAG, \"OnDeviceConnectListener#onAttach:\");\n\t\t\tif (!updateCameraDialog() && (mCameraView.hasSurface())) {\n\t\t\t\ttryOpenUVCCamera(true);\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void onConnect(final UsbDevice device, final UsbControlBlock ctrlBlock, final boolean createNew) {\n\t\t\tif (DEBUG) Log.v(TAG, \"OnDeviceConnectListener#onConnect:\");\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDisconnect(final UsbDevice device, final UsbControlBlock ctrlBlock) {\n\t\t\tif (DEBUG) Log.v(TAG, \"OnDeviceConnectListener#onDisconnect:\");\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDettach(final UsbDevice device) {\n\t\t\tif (DEBUG) Log.v(TAG, \"OnDeviceConnectListener#onDettach:\");\n\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tif (mCameraClient != null) {\n\t\t\t\t\t\tmCameraClient.disconnect();\n\t\t\t\t\t\tmCameraClient.release();\n\t\t\t\t\t\tmCameraClient = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t\tenableButtons(false);\n\t\t\tupdateCameraDialog();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onCancel(final UsbDevice device) {\n\t\t\tif (DEBUG) Log.v(TAG, \"OnDeviceConnectListener#onCancel:\");\n\t\t\tenableButtons(false);\n\t\t}\n\t};\n\n\tprivate boolean updateCameraDialog() {\n\t\tfinal Fragment fragment = getFragmentManager().findFragmentByTag(\"CameraDialog\");\n\t\tif (fragment instanceof CameraDialog) {\n\t\t\t((CameraDialog)fragment).updateDevices();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate void tryOpenUVCCamera(final boolean requestPermission) {\n\t\tif (DEBUG) Log.v(TAG, \"tryOpenUVCCamera:\");\n\t\topenUVCCamera(0);\n\t}\n\n\tprivate void openUVCCamera(final int index) {\n\t\tif (DEBUG) Log.v(TAG, \"openUVCCamera:index=\" + index);\n\t\tif (!mUSBMonitor.isRegistered()) return;\n\t\tfinal List<UsbDevice> list = mUSBMonitor.getDeviceList();\n\t\tif (list.size() > index) {\n\t\t\tenableButtons(false);\n\t\t\tif (mCameraClient == null)\n\t\t\t\tmCameraClient = new CameraClient(getActivity(), mCameraListener);\n\t\t\tmCameraClient.select(list.get(index));\n\t\t\tmCameraClient.resize(DEFAULT_WIDTH, DEFAULT_HEIGHT);\n\t\t\tmCameraClient.connect();\n\t\t}\n\t}\n\n\tprivate final ICameraClientCallback mCameraListener = new ICameraClientCallback() {\n\t\t@Override\n\t\tpublic void onConnect() {\n\t\t\tif (DEBUG) Log.v(TAG, \"onConnect:\");\n\t\t\tmCameraClient.addSurface(mCameraView.getSurface(), false);\n\t\t\tmCameraClient.addSurface(mCameraViewSub.getHolder().getSurface(), false);\n\t\t\tisSubView = true;\n\t\t\tenableButtons(true);\n\t\t\tsetPreviewButton(true);\n\t\t\t// start UVCService\n\t\t\tfinal Intent intent = new Intent(getActivity(), UVCService.class);\n\t\t\tgetActivity().startService(intent);\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDisconnect() {\n\t\t\tif (DEBUG) Log.v(TAG, \"onDisconnect:\");\n\t\t\tsetPreviewButton(false);\n\t\t\tenableButtons(false);\n\t\t}\n\n\t};\n\n\tprivate final OnClickListener mOnClickListener = new OnClickListener() {\n\t\t@Override\n\t\tpublic void onClick(final View v) {\n\t\t\tswitch (v.getId()) {\n\t\t\tcase R.id.start_button:\n\t\t\t\tif (DEBUG) Log.v(TAG, \"onClick:start\");\n\t\t\t\t// start service\n\t\t\t\tfinal List<UsbDevice> list = mUSBMonitor.getDeviceList();\n\t\t\t\tif (list.size() > 0) {\n\t\t\t\t\tif (mCameraClient == null)\n\t\t\t\t\t\tmCameraClient = new CameraClient(getActivity(), mCameraListener);\n\t\t\t\t\tmCameraClient.select(list.get(0));\n\t\t\t\t\tmCameraClient.resize(DEFAULT_WIDTH, DEFAULT_HEIGHT);\n\t\t\t\t\tmCameraClient.connect();\n\t\t\t\t\tsetPreviewButton(false);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase R.id.stop_button:\n\t\t\t\tif (DEBUG) Log.v(TAG, \"onClick:stop\");\n\t\t\t\t// stop service\n\t\t\t\tif (mCameraClient != null) {\n\t\t\t\t\tmCameraClient.disconnect();\n\t\t\t\t\tmCameraClient.release();\n\t\t\t\t\tmCameraClient = null;\n\t\t\t\t}\n\t\t\t\tenableButtons(false);\n\t\t\t\tbreak;\n\t\t\tcase R.id.camera_view_sub:\n\t\t\t\tif (DEBUG) Log.v(TAG, \"onClick:sub view\");\n\t\t\t\tif (isSubView) {\n\t\t\t\t\tmCameraClient.removeSurface(mCameraViewSub.getHolder().getSurface());\n\t\t\t\t} else {\n\t\t\t\t\tmCameraClient.addSurface(mCameraViewSub.getHolder().getSurface(), false);\n\t\t\t\t}\n\t\t\t\tisSubView = !isSubView;\n\t\t\t\tbreak;\n\t\t\tcase R.id.record_button:\n\t\t\t\tif (DEBUG) Log.v(TAG, \"onClick:record\");\n\t\t\t\tif (checkPermissionWriteExternalStorage() && checkPermissionAudio()) {\n\t\t\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tif (mCameraClient.isRecording()) {\n\t\t\t\t\t\t\t\tmCameraClient.stopRecording();\n\t\t\t\t\t\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\tmRecordButton.setColorFilter(0);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}, 0);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmCameraClient.startRecording();\n\t\t\t\t\t\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\tmRecordButton.setColorFilter(0x7fff0000);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 0);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase R.id.still_button:\n\t\t\t\tif (DEBUG) Log.v(TAG, \"onClick:still capture\");\n\t\t\t\tif (mCameraClient != null && checkPermissionWriteExternalStorage()) {\n\t\t\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tmCameraClient.captureStill(MediaMuxerWrapper.getCaptureFile(Environment.DIRECTORY_DCIM, \".jpg\").toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 0);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate final OnCheckedChangeListener mOnCheckedChangeListener = new OnCheckedChangeListener() {\n\t\t@Override\n\t\tpublic void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onCheckedChanged:\" + isChecked);\n\t\t\tif (isChecked) {\n\t\t\t\tmCameraClient.addSurface(mCameraView.getSurface(), false);\n//\t\t\t\tmCameraClient.addSurface(mCameraViewSub.getHolder().getSurface(), false);\n\t\t\t} else {\n\t\t\t\tmCameraClient.removeSurface(mCameraView.getSurface());\n//\t\t\t\tmCameraClient.removeSurface(mCameraViewSub.getHolder().getSurface());\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate void setPreviewButton(final boolean onoff) {\n\t\tgetActivity().runOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tmPreviewButton.setOnCheckedChangeListener(null);\n\t\t\t\ttry {\n\t\t\t\t\tmPreviewButton.setChecked(onoff);\n\t\t\t\t} finally {\n\t\t\t\t\tmPreviewButton.setOnCheckedChangeListener(mOnCheckedChangeListener);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate final void enableButtons(final boolean enable) {\n\t\tsetPreviewButton(false);\n\t\tgetActivity().runOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tmPreviewButton.setEnabled(enable);\n\t\t\t\tmRecordButton.setEnabled(enable);\n\t\t\t\tmStillCaptureButton.setEnabled(enable);\n\t\t\t\tif (enable && mCameraClient.isRecording())\n\t\t\t\t\tmRecordButton.setColorFilter(0x7fff0000);\n\t\t\t\telse\n\t\t\t\t\tmRecordButton.setColorFilter(0);\n\t\t\t}\n\t\t});\n\t}\n}\n"
  },
  {
    "path": "usbCameraTest4/src/main/java/com/serenegiant/usbcameratest4/MainActivity.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usbcameratest4;\n\nimport android.app.Fragment;\nimport android.content.pm.ActivityInfo;\nimport android.os.Bundle;\nimport android.util.Log;\nimport android.view.Window;\n\nimport com.serenegiant.common.BaseActivity;\n\npublic class MainActivity extends BaseActivity {\n\tprivate static final boolean DEBUG = false;\n\tprivate static final String TAG = \"MainActivity\";\n\n\t@Override\n\tprotected void onCreate(final Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\trequestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\tsetContentView(R.layout.activity_main);\n\t\tif (savedInstanceState == null) {\n\t\t\tif (DEBUG) Log.i(TAG, \"onCreate:new\");\n\t\t\tfinal Fragment fragment = new CameraFragment();\n\t\t\tgetFragmentManager().beginTransaction()\n\t\t\t\t\t.add(R.id.container, fragment).commit();\n\t\t}\n\t}\n\n\t@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tif (DEBUG) Log.v(TAG, \"onResume:\");\n//\t\tupdateScreenRotation();\n\t}\n\n\t@Override\n\tprotected void onPause() {\n\t\tif (DEBUG) Log.v(TAG, \"onPause:isFinishing=\" + isFinishing());\n\t\tsuper.onPause();\n\t}\n\n\t@Override\n\tprotected void onDestroy() {\n\t\tif (DEBUG) Log.v(TAG, \"onDestroy:\");\n\t\tsuper.onDestroy();\n\t}\n\n\tprotected final void updateScreenRotation() {\n        final int screenRotation = 2;\n        switch (screenRotation) {\n        case 1:\n        \tsetRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);\n        \tbreak;\n        case 2:\n        \tsetRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);\n        \tbreak;\n        default:\n        \tsetRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);\n        \tbreak;\n        }\n\t}\n\n}\n"
  },
  {
    "path": "usbCameraTest4/src/main/res/drawable/border.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\"\n    android:useLevel=\"false\" >\n\n    <stroke\n        android:width=\"3px\"\n        android:color=\"@color/GRAY\" />\n\n    <!-- <solid android:color=\"@color/TRANSPARENT\" />　 -->\n    <solid android:color=\"@null\" />\n\n    <padding\n        android:bottom=\"2px\"\n        android:left=\"2px\"\n        android:right=\"2px\"\n        android:top=\"2px\" />\n\n    <corners android:radius=\"2px\" />\n\n</shape>"
  },
  {
    "path": "usbCameraTest4/src/main/res/layout/activity_main.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"#000000\"\n    tools:context=\"com.serenegiant.usbwebcamerapro.MainActivity\"\n    tools:ignore=\"MergeRootFrame\" >\n\n    <FrameLayout\n        android:id=\"@+id/container\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\" >\n    </FrameLayout>\n\n    <FrameLayout\n        android:id=\"@+id/ad_parent\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"top|center_horizontal\"\n        android:layout_marginTop=\"@dimen/half_padding\"\n        android:gravity=\"top\" >\n    </FrameLayout>\n\n</FrameLayout>"
  },
  {
    "path": "usbCameraTest4/src/main/res/layout/fragment_main.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/RelativeLayout1\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:layout_margin=\"0dp\"\n    android:paddingBottom=\"@dimen/vertical_margin\"\n    android:paddingLeft=\"@dimen/horizontal_margin\"\n    android:paddingRight=\"@dimen/horizontal_margin\"\n    android:paddingTop=\"@dimen/vertical_margin\"\n    tools:context=\"com.serenegiant.serviceviewtest.MainActivity\" >\n\n\n\t<com.serenegiant.widget.UVCCameraTextureView\n        android:id=\"@+id/camera_view\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:layout_centerInParent=\"true\"\n        android:layout_weight=\"1\" />\n\n\t<ImageView\n        android:id=\"@+id/frame_image\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignTop=\"@+id/camera_view\"\n        android:layout_alignBottom=\"@+id/camera_view\"\n        android:layout_alignLeft=\"@+id/camera_view\"\n        android:layout_alignRight=\"@+id/camera_view\"\n        android:src=\"@drawable/border\" />\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignBottom=\"@id/camera_view\"\n        android:gravity=\"bottom|center_horizontal\" >\n\n        <Button\n            android:id=\"@+id/start_button\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"Start service\" />\n\n        <Button\n            android:id=\"@+id/stop_button\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"Stop service\" />\n    </LinearLayout>\n\n    <ToggleButton\n        android:id=\"@+id/preview_button\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignLeft=\"@+id/camera_view\"\n        android:layout_gravity=\"center_horizontal\"\n        android:text=\"ToggleButton\" />\n\n    <SurfaceView\n        android:id=\"@+id/camera_view_sub\"\n        android:layout_margin=\"5dp\"\n        android:layout_width=\"100dp\"\n        android:layout_height=\"100dp\"\n        android:layout_alignRight=\"@+id/camera_view\"\n        android:layout_alignTop=\"@+id/camera_view\" />\n\n    <ImageButton\n        android:id=\"@+id/record_button\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignLeft=\"@+id/camera_view\"\n        android:layout_below=\"@id/preview_button\"\n        android:layout_marginLeft=\"@dimen/horizontal_margin\"\n        android:layout_marginTop=\"@dimen/vertical_margin\"\n        android:background=\"@null\"\n        android:src=\"@drawable/ic_switch_video\" />\n\n    <ImageButton\n        android:id=\"@+id/still_button\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignLeft=\"@+id/camera_view\"\n        android:layout_below=\"@id/record_button\"\n        android:layout_marginLeft=\"@dimen/horizontal_margin\"\n        android:layout_marginTop=\"@dimen/vertical_margin\"\n        android:background=\"@null\"\n        android:src=\"@drawable/ic_switch_camera\" />\n</RelativeLayout>"
  },
  {
    "path": "usbCameraTest4/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n\n    <!-- Web colors -->\n    <color name=\"CLEAR\">#00000000</color>\n    <color name=\"HALF_CLEAR_WHITE\">#7fffffff</color>\n    <color name=\"QUATER_CLEAR_WHITE\">#3fffffff</color>\n    <color name=\"TRANSPARENT\">#00000000</color>\n    <color name=\"BLACK\">#ff000000</color>\n    <color name=\"ALICEBLUE\">#fff0f8ff</color>\n    <color name=\"DARKCYAN\">#ff008b8b</color>\n    <color name=\"LIGHTYELLOW\">#ffffffe0</color>\n    <color name=\"CORAL\">#ffff7f50</color>\n    <color name=\"DIMGRAY\">#ff696969</color>\n    <color name=\"LAVENDER\">#ffe6e6fa</color>\n    <color name=\"TEAL\">#ff008080</color>\n    <color name=\"LIGHTGOLDENRODYELLOW\">#fffafad2</color>\n    <color name=\"TOMATO\">#ffff6347</color>\n    <color name=\"GRAY\">#ff808080</color>\n    <color name=\"LIGHTSTEELBLUE\">#ffb0c4de</color>\n    <color name=\"DARKSLATEGRAY\">#ff2f4f4f</color>\n    <color name=\"LEMONCHIFFON\">#fffffacd</color>\n    <color name=\"ORANGERED\">#ffff4500</color>\n    <color name=\"DARKGRAY\">#ffa9a9a9</color>\n    <color name=\"LIGHTSLATEGRAY\">#ff778899</color>\n    <color name=\"DARKGREEN\">#ff006400</color>\n    <color name=\"WHEAT\">#fff5deb3</color>\n    <color name=\"RED\">#ffff0000</color>\n    <color name=\"SILVER\">#ffc0c0c0</color>\n    <color name=\"SLATEGRAY\">#ff708090</color>\n    <color name=\"GREEN\">#ff008000</color>\n    <color name=\"BURLYWOOD\">#ffdeb887</color>\n    <color name=\"CRIMSON\">#ffdc143c</color>\n    <color name=\"LIGHTGRAY\">#ffd3d3d3</color>\n    <color name=\"STEELBLUE\">#ff4682b4</color>\n    <color name=\"FORESTGREEN\">#ff228b22</color>\n    <color name=\"TAN\">#ffd2b48c</color>\n    <color name=\"MEDIUMVIOLETRED\">#ffc71585</color>\n    <color name=\"GAINSBORO\">#ffdcdcdc</color>\n    <color name=\"ROYALBLUE\">#ff4169e1</color>\n    <color name=\"SEAGREEN\">#ff2e8b57</color>\n    <color name=\"KHAKI\">#fff0e68c</color>\n    <color name=\"DEEPPINK\">#ffff1493</color>\n    <color name=\"WHITESMOKE\">#fff5f5f5</color>\n    <color name=\"MIDNIGHTBLUE\">#ff191970</color>\n    <color name=\"MEDIUMSEAGREEN\">#ff3cb371</color>\n    <color name=\"YELLOW\">#ffffff00</color>\n    <color name=\"HOTPINK\">#ffff69b4</color>\n    <color name=\"WHITE\">#ffffffff</color>\n    <color name=\"NAVY\">#ff000080</color>\n    <color name=\"MEDIUMAQUAMARINE\">#ff66cdaa</color>\n    <color name=\"GOLD\">#ffffd700</color>\n    <color name=\"PALEVIOLETRED\">#ffdb7093</color>\n    <color name=\"SNOW\">#fffffafa</color>\n    <color name=\"DARKBLUE\">#ff00008b</color>\n    <color name=\"DARKSEAGREEN\">#ff8fbc8f</color>\n    <color name=\"ORANGE\">#ffffa500</color>\n    <color name=\"PINK\">#ffffc0cb</color>\n    <color name=\"GHOSTWHITE\">#fff8f8ff</color>\n    <color name=\"MEDIUMBLUE\">#ff0000cd</color>\n    <color name=\"AQUAMARINE\">#ff7fffd4</color>\n    <color name=\"SANDYBROWN\">#fff4a460</color>\n    <color name=\"LIGHTPINK\">#ffffb6c1</color>\n    <color name=\"FLORALWHITE\">#fffffaf0</color>\n    <color name=\"BLUE\">#ff0000ff</color>\n    <color name=\"PALEGREEN\">#ff98fb98</color>\n    <color name=\"DARKORANGE\">#ffff8c00</color>\n    <color name=\"THISTLE\">#ffd8bfd8</color>\n    <color name=\"LINEN\">#fffaf0e6</color>\n    <color name=\"DODGERBLUE\">#ff1e90ff</color>\n    <color name=\"LIGHTGREEN\">#ff90ee90</color>\n    <color name=\"GOLDENROD\">#ffdaa520</color>\n    <color name=\"MAGENTA\">#ffff00ff</color>\n    <color name=\"ANTIQUEWHITE\">#fffaebd7</color>\n    <color name=\"CORNFLOWERBLUE\">#ff6495ed</color>\n    <color name=\"SPRINGGREEN\">#ff00ff7f</color>\n    <color name=\"PERU\">#ffcd853f</color>\n    <color name=\"FUCHSIA\">#ffff00ff</color>\n    <color name=\"PAPAYAWHIP\">#ffffefd5</color>\n    <color name=\"DEEPSKYBLUE\">#ff00bfff</color>\n    <color name=\"MEDIUMSPRINGGREEN\">#ff00fa9a</color>\n    <color name=\"DARKGOLDENROD\">#ffb8860b</color>\n    <color name=\"VIOLET\">#ffee82ee</color>\n    <color name=\"BLANCHEDALMOND\">#ffffebcd</color>\n    <color name=\"LIGHTSKYBLUE\">#ff87cefa</color>\n    <color name=\"LAWNGREEN\">#ff7cfc00</color>\n    <color name=\"CHOCOLATE\">#ffd2691e</color>\n    <color name=\"PLUM\">#ffdda0dd</color>\n    <color name=\"BISQUE\">#ffffe4c4</color>\n    <color name=\"SKYBLUE\">#ff87ceeb</color>\n    <color name=\"CHARTREUSE\">#ff7fff00</color>\n    <color name=\"SIENNA\">#ffa0522d</color>\n    <color name=\"ORCHID\">#ffda70d6</color>\n    <color name=\"MOCCASIN\">#ffffe4b5</color>\n    <color name=\"LIGHTBLUE\">#ffadd8e6</color>\n    <color name=\"GREENYELLOW\">#ffadff2f</color>\n    <color name=\"SADDLEBROWN\">#ff8b4513</color>\n    <color name=\"MEDIUMORCHID\">#ffba55d3</color>\n    <color name=\"NAVAJOWHITE\">#ffffdead</color>\n    <color name=\"POWDERBLUE\">#ffb0e0e6</color>\n    <color name=\"LIME\">#ff00ff00</color>\n    <color name=\"MAROON\">#ff800000</color>\n    <color name=\"DARKORCHID\">#ff9932cc</color>\n    <color name=\"PEACHPUFF\">#ffffdab9</color>\n    <color name=\"PALETURQUOISE\">#ffafeeee</color>\n    <color name=\"LIMEGREEN\">#ff32cd32</color>\n    <color name=\"DARKRED\">#ff8b0000</color>\n    <color name=\"DARKVIOLET\">#ff9400d3</color>\n    <color name=\"MISTYROSE\">#ffffe4e1</color>\n    <color name=\"LIGHTCYAN\">#ffe0ffff</color>\n    <color name=\"YELLOWGREEN\">#ff9acd32</color>\n    <color name=\"BROWN\">#ffa52a2a</color>\n    <color name=\"DARKMAGENTA\">#ff8b008b</color>\n    <color name=\"LAVENDERBLUSH\">#fffff0f5</color>\n    <color name=\"CYAN\">#ff00ffff</color>\n    <color name=\"DARKOLIVEGREEN\">#ff556b2f</color>\n    <color name=\"FIREBRICK\">#ffb22222</color>\n    <color name=\"PURPLE\">#ff800080</color>\n    <color name=\"SEASHELL\">#fffff5ee</color>\n    <color name=\"AQUA\">#ff00ffff</color>\n    <color name=\"OLIVEDRAB\">#ff6b8e23</color>\n    <color name=\"INDIANRED\">#ffcd5c5c</color>\n    <color name=\"INDIGO\">#ff4b0082</color>\n    <color name=\"OLDLACE\">#fffdf5e6</color>\n    <color name=\"TURQUOISE\">#ff40e0d0</color>\n    <color name=\"OLIVE\">#ff808000</color>\n    <color name=\"ROSYBROWN\">#ffbc8f8f</color>\n    <color name=\"DARKSLATEBLUE\">#ff483d8b</color>\n    <color name=\"IVORY\">#fffffff0</color>\n    <color name=\"MEDIUMTURQUOISE\">#ff48d1cc</color>\n    <color name=\"DARKKHAKI\">#ffbdb76b</color>\n    <color name=\"DARKSALMON\">#ffe9967a</color>\n    <color name=\"BLUEVIOLET\">#ff8a2be2</color>\n    <color name=\"HONEYDEW\">#fff0fff0</color>\n    <color name=\"DARKTURQUOISE\">#ff00ced1</color>\n    <color name=\"PALEGOLDENROD\">#ffeee8aa</color>\n    <color name=\"LIGHTCORAL\">#fff08080</color>\n    <color name=\"MEDIUMPURPLE\">#ff9370db</color>\n    <color name=\"MINTCREAM\">#fff5fffa</color>\n    <color name=\"LIGHTSEAGREEN\">#ff20b2aa</color>\n    <color name=\"CORNSILK\">#fffff8dc</color>\n    <color name=\"SALMON\">#fffa8072</color>\n    <color name=\"SLATEBLUE\">#ff6a5acd</color>\n    <color name=\"AZURE\">#fff0ffff</color>\n    <color name=\"CADETBLUE\">#ff5f9ea0</color>\n    <color name=\"BEIGE\">#fff5f5dc</color>\n    <color name=\"LIGHTSALMON\">#ffffa07a</color>\n    <color name=\"MEDIUMSLATEBLUE\">#ff7b68ee</color>\n\n</resources>"
  },
  {
    "path": "usbCameraTest4/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n\n\t<!-- Default screen margins, per the Android Design guidelines. -->\n\t<dimen name=\"activity_horizontal_margin\">16dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">16dp</dimen>\n\n    <dimen name=\"horizontal_margin\">4dp</dimen>\n    <dimen name=\"vertical_margin\">4dp</dimen>\n    <dimen name=\"horizontal_margin_half\">2dp</dimen>\n    <dimen name=\"vertical_margin_half\">2dp</dimen>\n    <dimen name=\"standard_padding\">8dp</dimen>\n    <dimen name=\"half_padding\">4dp</dimen>\n    \n    <dimen name=\"button_size\">24dp</dimen>\n    <dimen name=\"button_size_small\">16dp</dimen>\n    <dimen name=\"button_size_large\">32dp</dimen>\n    <dimen name=\"value_button_size\">32dp</dimen>\n</resources>\n"
  },
  {
    "path": "usbCameraTest4/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBCameraTest4</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest4/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme, dependent on API level. This theme is replaced\n        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Light\">\n        <!--\n            Theme customizations available in newer API levels can go in\n            res/values-vXX/styles.xml, while customizations related to\n            backward-compatibility can go here.\n        -->\n    </style>\n\n    <!-- Application theme. -->\n    <style name=\"AppTheme\" parent=\"AppBaseTheme\">\n        <!-- All customizations that are NOT specific to a particular API-level can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest4/src/main/res/values-ja/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBカメラテスト4</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest4/src/main/res/values-v11/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 11+. This theme completely replaces\n        AppBaseTheme from res/values/styles.xml on API 11+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light\">\n        <!-- API 11 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest4/src/main/res/values-v14/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 14+. This theme completely replaces\n        AppBaseTheme from BOTH res/values/styles.xml and\n        res/values-v11/styles.xml on API 14+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light.DarkActionBar\">\n        <!-- API 14 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest4/src/main/res/values-w820dp/dimens.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n         Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively).\n    -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest4/src/main/res/xml/device_filter.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<usb>\n\t<usb-device class=\"239\" subclass=\"2\" />\t<!-- all device of UVC -->\n</usb>\n"
  },
  {
    "path": "usbCameraTest5/build.gradle",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\napply plugin: 'com.android.application'\n\nandroid {\n\tcompileSdkVersion versionCompiler\n\tbuildToolsVersion versionBuildTool\n\n\tcompileOptions {\n\t\tsourceCompatibility javaSourceCompatibility\n\t\ttargetCompatibility javaTargetCompatibility\n\t}\n\n    defaultConfig {\n        applicationId \"com.serenegiant.usbcameratest5\"\n        minSdkVersion 18\n\t\ttargetSdkVersion versionTarget\n\t\tversionCode 8\n\t\tversionName \"3.00\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'\n        }\n    }\n}\n\ndependencies {\n\tapi fileTree(dir: 'libs', include: ['*.jar'])\n\n\timplementation \"com.android.support:support-v4:${supportLibVersion}\"\n\timplementation \"com.android.support:support-annotations:${supportLibVersion}\"\n\n\timplementation(\"com.serenegiant:common:${commonLibVersion}\") {\n\t\texclude module: 'support-v4'\n\t}\n\timplementation project(':libuvccamera')\n\timplementation project(':usbCameraCommon')\n}\n"
  },
  {
    "path": "usbCameraTest5/lint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<lint>\n</lint>"
  },
  {
    "path": "usbCameraTest5/proguard-project.txt",
    "content": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in that file.\n#\n# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in ${sdk.dir}/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the ProGuard\n# include property in project.properties.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n-keepclassmembers public class com.serenegiant.usb.UVCCamera {\n\tpublic *;\n\tprotected *;\n\tprivate *;\n}\n"
  },
  {
    "path": "usbCameraTest5/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.serenegiant.usbcameratest5\" >\n\n    <uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n\n    <uses-feature android:glEsVersion=\"0x00020000\" android:required=\"true\" />\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.serenegiant.usbcameratest5.MainActivity\"\n            android:label=\"@string/app_name\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "usbCameraTest5/src/main/java/com/serenegiant/usbcameratest5/MainActivity.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usbcameratest5;\n\nimport android.graphics.SurfaceTexture;\nimport android.hardware.usb.UsbDevice;\nimport android.os.Bundle;\nimport android.util.Log;\nimport android.view.Surface;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.view.View.OnLongClickListener;\nimport android.widget.CompoundButton;\nimport android.widget.ImageButton;\nimport android.widget.Toast;\nimport android.widget.ToggleButton;\n\nimport com.serenegiant.common.BaseActivity;\n\nimport com.serenegiant.usb.CameraDialog;\nimport com.serenegiant.usb.USBMonitor;\nimport com.serenegiant.usb.USBMonitor.OnDeviceConnectListener;\nimport com.serenegiant.usb.USBMonitor.UsbControlBlock;\nimport com.serenegiant.usb.UVCCamera;\nimport com.serenegiant.usbcameracommon.UVCCameraHandler;\nimport com.serenegiant.widget.CameraViewInterface;\n\npublic final class MainActivity extends BaseActivity implements CameraDialog.CameraDialogParent {\n\tprivate static final boolean DEBUG = true;\t// TODO set false on release\n\tprivate static final String TAG = \"MainActivity\";\n\n    /**\n     * preview resolution(width)\n     * if your camera does not support specific resolution and mode,\n     * {@link UVCCamera#setPreviewSize(int, int, int)} throw exception\n     */\n    private static final int PREVIEW_WIDTH = 640;\n    /**\n     * preview resolution(height)\n     * if your camera does not support specific resolution and mode,\n     * {@link UVCCamera#setPreviewSize(int, int, int)} throw exception\n     */\n    private static final int PREVIEW_HEIGHT = 480;\n    /**\n     * preview mode\n     * if your camera does not support specific resolution and mode,\n     * {@link UVCCamera#setPreviewSize(int, int, int)} throw exception\n     * 0:YUYV, other:MJPEG\n     */\n    private static final int PREVIEW_MODE = UVCCamera.FRAME_FORMAT_MJPEG;\n\n\t/**\n\t * for accessing USB\n\t */\n\tprivate USBMonitor mUSBMonitor;\n\t/**\n\t * Handler to execute camera releated methods sequentially on private thread\n\t */\n\tprivate UVCCameraHandler mCameraHandler;\n\t/**\n\t * for camera preview display\n\t */\n\tprivate CameraViewInterface mUVCCameraView;\n\t/**\n\t * for open&start / stop&close camera preview\n\t */\n\tprivate ToggleButton mCameraButton;\n\t/**\n\t * button for start/stop recording\n\t */\n\tprivate ImageButton mCaptureButton;\n\n\t@Override\n\tprotected void onCreate(final Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tif (DEBUG) Log.v(TAG, \"onCreate:\");\n\t\tsetContentView(R.layout.activity_main);\n\t\tmCameraButton = (ToggleButton)findViewById(R.id.camera_button);\n\t\tmCameraButton.setOnCheckedChangeListener(mOnCheckedChangeListener);\n\t\tmCaptureButton = (ImageButton)findViewById(R.id.capture_button);\n\t\tmCaptureButton.setOnClickListener(mOnClickListener);\n\t\tmCaptureButton.setVisibility(View.INVISIBLE);\n\t\tfinal View view = findViewById(R.id.camera_view);\n\t\tview.setOnLongClickListener(mOnLongClickListener);\n\t\tmUVCCameraView = (CameraViewInterface)view;\n\t\tmUVCCameraView.setAspectRatio(PREVIEW_WIDTH / (float)PREVIEW_HEIGHT);\n\n\t\tmUSBMonitor = new USBMonitor(this, mOnDeviceConnectListener);\n\t\tmCameraHandler = UVCCameraHandler.createHandler(this, mUVCCameraView,\n\t\t\t2, PREVIEW_WIDTH, PREVIEW_HEIGHT, PREVIEW_MODE);\n\t}\n\n\t@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tif (DEBUG) Log.v(TAG, \"onStart:\");\n\t\tmUSBMonitor.register();\n\t\tif (mUVCCameraView != null)\n\t\t\tmUVCCameraView.onResume();\n\t}\n\n\t@Override\n\tprotected void onStop() {\n\t\tif (DEBUG) Log.v(TAG, \"onStop:\");\n\t\tqueueEvent(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tmCameraHandler.close();\n\t\t\t}\n\t\t}, 0);\n\t\tif (mUVCCameraView != null)\n\t\t\tmUVCCameraView.onPause();\n\t\tsetCameraButton(false);\n\t\tmCaptureButton.setVisibility(View.INVISIBLE);\n\t\tmUSBMonitor.unregister();\n\t\tsuper.onStop();\n\t}\n\n\t@Override\n\tpublic void onDestroy() {\n\t\tif (DEBUG) Log.v(TAG, \"onDestroy:\");\n\t\tif (mCameraHandler != null) {\n\t\t\tmCameraHandler.release();\n\t\t\tmCameraHandler = null;\n\t\t}\n\t\tif (mUSBMonitor != null) {\n\t\t\tmUSBMonitor.destroy();\n\t\t\tmUSBMonitor = null;\n\t\t}\n\t\tmUVCCameraView = null;\n\t\tmCameraButton = null;\n\t\tmCaptureButton = null;\n\t\tsuper.onDestroy();\n\t}\n\n\tprotected void checkPermissionResult(final int requestCode, final String permission, final boolean result) {\n\t\tsuper.checkPermissionResult(requestCode, permission, result);\n\t\tif (!result && (permission != null)) {\n\t\t\tsetCameraButton(false);\n\t\t}\n\t}\n\n\t/**\n\t * event handler when click camera / capture button\n\t */\n\tprivate final OnClickListener mOnClickListener = new OnClickListener() {\n\t\t@Override\n\t\tpublic void onClick(final View view) {\n\t\t\tswitch (view.getId()) {\n\t\t\tcase R.id.capture_button:\n\t\t\t\tif (mCameraHandler.isOpened()) {\n\t\t\t\t\tif (checkPermissionWriteExternalStorage() && checkPermissionAudio()) {\n\t\t\t\t\t\tif (!mCameraHandler.isRecording()) {\n\t\t\t\t\t\t\tmCaptureButton.setColorFilter(0xffff0000);\t// turn red\n\t\t\t\t\t\t\tmCameraHandler.startRecording();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmCaptureButton.setColorFilter(0);\t// return to default color\n\t\t\t\t\t\t\tmCameraHandler.stopRecording();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate final CompoundButton.OnCheckedChangeListener mOnCheckedChangeListener\n\t\t= new CompoundButton.OnCheckedChangeListener() {\n\t\t@Override\n\t\tpublic void onCheckedChanged(final CompoundButton compoundButton, final boolean isChecked) {\n\t\t\tswitch (compoundButton.getId()) {\n\t\t\tcase R.id.camera_button:\n\t\t\t\tif (isChecked && !mCameraHandler.isOpened()) {\n\t\t\t\t\tCameraDialog.showDialog(MainActivity.this);\n\t\t\t\t} else {\n\t\t\t\t\tmCameraHandler.close();\n\t\t\t\t\tmCaptureButton.setVisibility(View.INVISIBLE);\n\t\t\t\t\tsetCameraButton(false);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * capture still image when you long click on preview image(not on buttons)\n\t */\n\tprivate final OnLongClickListener mOnLongClickListener = new OnLongClickListener() {\n\t\t@Override\n\t\tpublic boolean onLongClick(final View view) {\n\t\t\tswitch (view.getId()) {\n\t\t\tcase R.id.camera_view:\n\t\t\t\tif (mCameraHandler.isOpened()) {\n\t\t\t\t\tif (checkPermissionWriteExternalStorage()) {\n\t\t\t\t\t\tmCameraHandler.captureStill();\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tprivate void setCameraButton(final boolean isOn) {\n\t\trunOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tif (mCameraButton != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmCameraButton.setOnCheckedChangeListener(null);\n\t\t\t\t\t\tmCameraButton.setChecked(isOn);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tmCameraButton.setOnCheckedChangeListener(mOnCheckedChangeListener);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!isOn && (mCaptureButton != null)) {\n\t\t\t\t\tmCaptureButton.setVisibility(View.INVISIBLE);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t}\n\n\tprivate Surface mSurface;\n\tprivate void startPreview() {\n\t\tfinal SurfaceTexture st = mUVCCameraView.getSurfaceTexture();\n\t\tif (mSurface != null) {\n\t\t\tmSurface.release();\n\t\t}\n\t\tmSurface = new Surface(st);\n\t\tmCameraHandler.startPreview(mSurface);\n\t\trunOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tmCaptureButton.setVisibility(View.VISIBLE);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate final OnDeviceConnectListener mOnDeviceConnectListener = new OnDeviceConnectListener() {\n\t\t@Override\n\t\tpublic void onAttach(final UsbDevice device) {\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_ATTACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onConnect(final UsbDevice device, final UsbControlBlock ctrlBlock, final boolean createNew) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onConnect:\");\n\t\t\tmCameraHandler.open(ctrlBlock);\n\t\t\tstartPreview();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDisconnect(final UsbDevice device, final UsbControlBlock ctrlBlock) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onDisconnect:\");\n\t\t\tif (mCameraHandler != null) {\n\t\t\t\tmCameraHandler.close();\n\t\t\t\tsetCameraButton(false);\n\t\t\t}\n\t\t}\n\t\t@Override\n\t\tpublic void onDettach(final UsbDevice device) {\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_DETACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onCancel(final UsbDevice device) {\n\t\t}\n\t};\n\n\t/**\n\t * to access from CameraDialog\n\t * @return\n\t */\n\t@Override\n\tpublic USBMonitor getUSBMonitor() {\n\t\treturn mUSBMonitor;\n\t}\n\n\t@Override\n\tpublic void onDialogResult(boolean canceled) {\n\t\tif (canceled) {\n\t\t\tsetCameraButton(false);\n\t\t}\n\t}\n\n//\t/**\n//\t * Handler class to execute camera releated methods sequentially on private thread\n//\t */\n//\tprivate static final class AbstractUVCCameraHandler extends Handler {\n//\t\tprivate static final int MSG_OPEN = 0;\n//\t\tprivate static final int MSG_CLOSE = 1;\n//\t\tprivate static final int MSG_PREVIEW_START = 2;\n//\t\tprivate static final int MSG_PREVIEW_STOP = 3;\n//\t\tprivate static final int MSG_CAPTURE_STILL = 4;\n//\t\tprivate static final int MSG_CAPTURE_START = 5;\n//\t\tprivate static final int MSG_CAPTURE_STOP = 6;\n//\t\tprivate static final int MSG_MEDIA_UPDATE = 7;\n//\t\tprivate static final int MSG_RELEASE = 9;\n//\n//\t\tprivate final WeakReference<CameraThread> mWeakThread;\n//\n//\t\tpublic static final AbstractUVCCameraHandler createHandler(final MainActivity parent, final CameraViewInterface cameraView) {\n//\t\t\tfinal CameraThread thread = new CameraThread(parent, cameraView);\n//\t\t\tthread.start();\n//\t\t\treturn thread.getHandler();\n//\t\t}\n//\n//\t\tprivate AbstractUVCCameraHandler(final CameraThread thread) {\n//\t\t\tmWeakThread = new WeakReference<CameraThread>(thread);\n//\t\t}\n//\n//\t\tpublic boolean isOpened() {\n//\t\t\tfinal CameraThread thread = mWeakThread.get();\n//\t\t\treturn thread != null && thread.isOpened();\n//\t\t}\n//\n//\t\tpublic boolean isRecording() {\n//\t\t\tfinal CameraThread thread = mWeakThread.get();\n//\t\t\treturn thread != null && thread.isRecording();\n//\t\t}\n//\n//\t\tpublic void open(final UsbControlBlock ctrlBlock) {\n//\t\t\tsendMessage(obtainMessage(MSG_OPEN, ctrlBlock));\n//\t\t}\n//\n//\t\tpublic void close() {\n//\t\t\tstopPreview();\n//\t\t\tsendEmptyMessage(MSG_CLOSE);\n//\t\t}\n//\n//\t\tpublic void startPreview(final Surface sureface) {\n//\t\t\tif (sureface != null)\n//\t\t\t\tsendMessage(obtainMessage(MSG_PREVIEW_START, sureface));\n//\t\t}\n//\n//\t\tpublic void stopPreview() {\n//\t\t\tstopRecording();\n//\t\t\tfinal CameraThread thread = mWeakThread.get();\n//\t\t\tif (thread == null) return;\n//\t\t\tsynchronized (thread.mSync) {\n//\t\t\t\tsendEmptyMessage(MSG_PREVIEW_STOP);\n//\t\t\t\t// wait for actually preview stopped to avoid releasing Surface/SurfaceTexture\n//\t\t\t\t// while preview is still running.\n//\t\t\t\t// therefore this method will take a time to execute\n//\t\t\t\ttry {\n//\t\t\t\t\tthread.mSync.wait();\n//\t\t\t\t} catch (final InterruptedException e) {\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n//\n//\t\tpublic void captureStill() {\n//\t\t\tsendEmptyMessage(MSG_CAPTURE_STILL);\n//\t\t}\n//\n//\t\tpublic void startRecording() {\n//\t\t\tsendEmptyMessage(MSG_CAPTURE_START);\n//\t\t}\n//\n//\t\tpublic void stopRecording() {\n//\t\t\tsendEmptyMessage(MSG_CAPTURE_STOP);\n//\t\t}\n//\n//\t\t@Override\n//\t\tpublic void handleMessage(final Message msg) {\n//\t\t\tfinal CameraThread thread = mWeakThread.get();\n//\t\t\tif (thread == null) return;\n//\t\t\tswitch (msg.what) {\n//\t\t\tcase MSG_OPEN:\n//\t\t\t\tthread.handleOpen((UsbControlBlock)msg.obj);\n//\t\t\t\tbreak;\n//\t\t\tcase MSG_CLOSE:\n//\t\t\t\tthread.handleClose();\n//\t\t\t\tbreak;\n//\t\t\tcase MSG_PREVIEW_START:\n//\t\t\t\tthread.handleStartPreview((Surface)msg.obj);\n//\t\t\t\tbreak;\n//\t\t\tcase MSG_PREVIEW_STOP:\n//\t\t\t\tthread.handleStopPreview();\n//\t\t\t\tbreak;\n//\t\t\tcase MSG_CAPTURE_STILL:\n//\t\t\t\tthread.handleCaptureStill();\n//\t\t\t\tbreak;\n//\t\t\tcase MSG_CAPTURE_START:\n//\t\t\t\tthread.handleStartRecording();\n//\t\t\t\tbreak;\n//\t\t\tcase MSG_CAPTURE_STOP:\n//\t\t\t\tthread.handleStopRecording();\n//\t\t\t\tbreak;\n//\t\t\tcase MSG_MEDIA_UPDATE:\n//\t\t\t\tthread.handleUpdateMedia((String)msg.obj);\n//\t\t\t\tbreak;\n//\t\t\tcase MSG_RELEASE:\n//\t\t\t\tthread.handleRelease();\n//\t\t\t\tbreak;\n//\t\t\tdefault:\n//\t\t\t\tthrow new RuntimeException(\"unsupported message:what=\" + msg.what);\n//\t\t\t}\n//\t\t}\n//\n//\n//\t\tprivate static final class CameraThread extends Thread {\n//\t\t\tprivate static final String TAG_THREAD = \"CameraThread\";\n//\t\t\tprivate final Object mSync = new Object();\n//\t\t\tprivate final WeakReference<MainActivity> mWeakParent;\n//\t\t\tprivate final WeakReference<CameraViewInterface> mWeakCameraView;\n//\t\t\tprivate boolean mIsRecording;\n//\t\t\t/**\n//\t\t\t * shutter sound\n//\t\t\t */\n//\t\t\tprivate SoundPool mSoundPool;\n//\t\t\tprivate int mSoundId;\n//\t\t\tprivate AbstractUVCCameraHandler mHandler;\n//\t\t\t/**\n//\t\t\t * for accessing UVC camera\n//\t\t\t */\n//\t\t\tprivate UVCCamera mUVCCamera;\n//\t\t\t/**\n//\t\t\t * muxer for audio/video recording\n//\t\t\t */\n//\t\t\tprivate MediaMuxerWrapper mMuxer;\n//\t\t\t/**\n//\t\t\t * for video recording\n//\t\t\t */\n//\t\t\tprivate MediaVideoBufferEncoder mVideoEncoder;\n//\n//\t\t\tprivate CameraThread(final MainActivity parent, final CameraViewInterface cameraView) {\n//\t\t\t\tsuper(\"CameraThread\");\n//\t\t\t\tmWeakParent = new WeakReference<MainActivity>(parent);\n//\t\t\t\tmWeakCameraView = new WeakReference<CameraViewInterface>(cameraView);\n//\t\t\t\tloadShutterSound(parent);\n//\t\t\t}\n//\n//\t\t\t@Override\n//\t\t\tprotected void finalize() throws Throwable {\n//\t\t\t\tLog.i(TAG, \"CameraThread#finalize\");\n//\t\t\t\tsuper.finalize();\n//\t\t\t}\n//\n//\t\t\tpublic AbstractUVCCameraHandler getHandler() {\n//\t\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"getHandler:\");\n//\t\t\t\tsynchronized (mSync) {\n//\t\t\t\t\tif (mHandler == null)\n//\t\t\t\t\ttry {\n//\t\t\t\t\t\tmSync.wait();\n//\t\t\t\t\t} catch (final InterruptedException e) {\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\treturn mHandler;\n//\t\t\t}\n//\n//\t\t\tpublic boolean isOpened() {\n//\t\t\t\treturn mUVCCamera != null;\n//\t\t\t}\n//\n//\t\t\tpublic boolean isRecording() {\n//\t\t\t\treturn (mUVCCamera != null) && (mMuxer != null);\n//\t\t\t}\n//\n//\t\t\tpublic void handleOpen(final UsbControlBlock ctrlBlock) {\n//\t\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleOpen:\");\n//\t\t\t\thandleClose();\n//\t\t\t\tmUVCCamera = new UVCCamera();\n//\t\t\t\tmUVCCamera.open(ctrlBlock);\n//\t\t\t\tif (DEBUG) Log.i(TAG, \"supportedSize:\" + mUVCCamera.getSupportedSize());\n//\t\t\t}\n//\n//\t\t\tpublic void handleClose() {\n//\t\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleClose:\");\n//\t\t\t\thandleStopRecording();\n//\t\t\t\tif (mUVCCamera != null) {\n//\t\t\t\t\tmUVCCamera.stopPreview();\n//\t\t\t\t\tmUVCCamera.destroy();\n//\t\t\t\t\tmUVCCamera = null;\n//\t\t\t\t}\n//\t\t\t}\n//\n//\t\t\tpublic void handleStartPreview(final Surface surface) {\n//\t\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleStartPreview:\");\n//\t\t\t\tif (mUVCCamera == null) return;\n//\t\t\t\ttry {\n//\t\t\t\t\tmUVCCamera.setPreviewSize(PREVIEW_WIDTH, PREVIEW_HEIGHT, PREVIEW_MODE);\n//\t\t\t\t} catch (final IllegalArgumentException e) {\n//\t\t\t\t\ttry {\n//\t\t\t\t\t\t// fallback to YUV mode\n//\t\t\t\t\t\tmUVCCamera.setPreviewSize(PREVIEW_WIDTH, PREVIEW_HEIGHT, UVCCamera.DEFAULT_PREVIEW_MODE);\n//\t\t\t\t\t} catch (final IllegalArgumentException e1) {\n//\t\t\t\t\t\thandleClose();\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\tif (mUVCCamera != null) {\n//\t\t\t\t\tmUVCCamera.setPreviewDisplay(surface);\n//\t\t\t\t\tmUVCCamera.startPreview();\n//\t\t\t\t}\n//\t\t\t}\n//\n//\t\t\tpublic void handleStopPreview() {\n//\t\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleStopPreview:\");\n//\t\t\t\tif (mUVCCamera != null) {\n//\t\t\t\t\tmUVCCamera.stopPreview();\n//\t\t\t\t}\n//\t\t\t\tsynchronized (mSync) {\n//\t\t\t\t\tmSync.notifyAll();\n//\t\t\t\t}\n//\t\t\t}\n//\n//\t\t\tpublic void handleCaptureStill() {\n//\t\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleCaptureStill:\");\n//\t\t\t\tfinal MainActivity parent = mWeakParent.get();\n//\t\t\t\tif (parent == null) return;\n//\t\t\t\tmSoundPool.play(mSoundId, 0.2f, 0.2f, 0, 0, 1.0f);\t// play shutter sound\n//\t\t\t\tfinal Bitmap bitmap = mWeakCameraView.get().captureStillImage();\n//\t\t\t\ttry {\n//\t\t\t\t\t// get buffered output stream for saving a captured still image as a file on external storage.\n//\t\t\t\t\t// the file name is came from current time.\n//\t\t\t\t\t// You should use extension name as same as CompressFormat when calling Bitmap#compress.\n//\t\t\t\t\tfinal File outputFile = MediaMuxerWrapper.getCaptureFile(Environment.DIRECTORY_DCIM, \".png\");\n//\t\t\t\t\tfinal BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(outputFile));\n//\t\t\t\t\ttry {\n//\t\t\t\t\t\ttry {\n//\t\t\t\t\t\t\tbitmap.compress(CompressFormat.PNG, 100, os);\n//\t\t\t\t\t\t\tos.flush();\n//\t\t\t\t\t\t\tmHandler.sendMessage(mHandler.obtainMessage(MSG_MEDIA_UPDATE, outputFile.getPath()));\n//\t\t\t\t\t\t} catch (final IOException e) {\n//\t\t\t\t\t\t}\n//\t\t\t\t\t} finally {\n//\t\t\t\t\t\tos.close();\n//\t\t\t\t\t}\n//\t\t\t\t} catch (final FileNotFoundException e) {\n//\t\t\t\t} catch (final IOException e) {\n//\t\t\t\t}\n//\t\t\t}\n//\n//\t\t\tpublic void handleStartRecording() {\n//\t\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleStartRecording:\");\n//\t\t\t\ttry {\n//\t\t\t\t\tif ((mUVCCamera == null) || (mMuxer != null)) return;\n//\t\t\t\t\tmMuxer = new MediaMuxerWrapper(\".mp4\");\t// if you record audio only, \".m4a\" is also OK.\n//\t\t\t\t\t// for video capturing using MediaVideoEncoder\n//\t\t\t\t\tmVideoEncoder = new MediaVideoBufferEncoder(mMuxer, mMediaEncoderListener);\n//\t\t\t\t\tif (true) {\n//\t\t\t\t\t\t// for audio capturing\n//\t\t\t\t\t\tnew MediaAudioEncoder(mMuxer, mMediaEncoderListener);\n//\t\t\t\t\t}\n//\t\t\t\t\tmMuxer.prepare();\n//\t\t\t\t\tmMuxer.startRecording();\n//\t\t\t\t\tmUVCCamera.setFrameCallback(mIFrameCallback, UVCCamera.PIXEL_FORMAT_NV21);\n//\t\t\t\t} catch (final IOException e) {\n//\t\t\t\t\tLog.e(TAG, \"startCapture:\", e);\n//\t\t\t\t}\n//\t\t\t}\n//\n//\t\t\tpublic void handleStopRecording() {\n//\t\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleStopRecording:mMuxer=\" + mMuxer);\n//\t\t\t\tmVideoEncoder = null;\n//\t\t\t\tif (mMuxer != null) {\n//\t\t\t\t\tmMuxer.stopRecording();\n//\t\t\t\t\tmMuxer = null;\n//\t\t\t\t\t// you should not wait here\n//\t\t\t\t}\n//\t\t\t\tif (mUVCCamera != null)\n//\t\t\t\t\tmUVCCamera.setFrameCallback(null, 0);\n//\t\t\t}\n//\n//\t\t\tpublic void handleUpdateMedia(final String path) {\n//\t\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleUpdateMedia:path=\" + path);\n//\t\t\t\tfinal MainActivity parent = mWeakParent.get();\n//\t\t\t\tif (parent != null && parent.getApplicationContext() != null) {\n//\t\t\t\t\ttry {\n//\t\t\t\t\t\tif (DEBUG) Log.i(TAG, \"MediaScannerConnection#scanFile\");\n//\t\t\t\t\t\tMediaScannerConnection.scanFile(parent.getApplicationContext(), new String[]{ path }, null, null);\n//\t\t\t\t\t} catch (final Exception e) {\n//\t\t\t\t\t\tLog.e(TAG, \"handleUpdateMedia:\", e);\n//\t\t\t\t\t}\n//\t\t\t\t\tif (parent.isDestroyed())\n//\t\t\t\t\t\thandleRelease();\n//\t\t\t\t} else {\n//\t\t\t\t\tLog.w(TAG, \"MainActivity already destroyed\");\n//\t\t\t\t\t// give up to add this movice to MediaStore now.\n//\t\t\t\t\t// Seeing this movie on Gallery app etc. will take a lot of time.\n//\t\t\t\t\thandleRelease();\n//\t\t\t\t}\n//\t\t\t}\n//\n//\t\t\tpublic void handleRelease() {\n//\t\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"handleRelease:\");\n// \t\t\t\thandleClose();\n//\t\t\t\tif (!mIsRecording)\n//\t\t\t\t\tLooper.myLooper().quit();\n//\t\t\t}\n//\n//\t\t\tprivate final IFrameCallback mIFrameCallback = new IFrameCallback() {\n//\t\t\t\t@Override\n//\t\t\t\tpublic void onFrame(final ByteBuffer frame) {\n//\t\t\t\t\tif (mVideoEncoder != null) {\n//\t\t\t\t\t\tmVideoEncoder.frameAvailableSoon();\n//\t\t\t\t\t\tmVideoEncoder.encode(frame);\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t};\n//\n//\t\t\tprivate final MediaEncoder.MediaEncoderListener mMediaEncoderListener = new MediaEncoder.MediaEncoderListener() {\n//\t\t\t\t@Override\n//\t\t\t\tpublic void onPrepared(final MediaEncoder encoder) {\n//\t\t\t\t\tif (DEBUG) Log.v(TAG, \"onPrepared:encoder=\" + encoder);\n//\t\t\t\t\tmIsRecording = true;\n//\t\t\t\t}\n//\n//\t\t\t\t@Override\n//\t\t\t\tpublic void onStopped(final MediaEncoder encoder) {\n//\t\t\t\t\tif (DEBUG) Log.v(TAG_THREAD, \"onStopped:encoder=\" + encoder);\n//\t\t\t\t\tif (encoder instanceof MediaVideoEncoder)\n//\t\t\t\t\ttry {\n//\t\t\t\t\t\tmIsRecording = false;\n//\t\t\t\t\t\tfinal MainActivity parent = mWeakParent.get();\n//\t\t\t\t\t\tfinal String path = encoder.getOutputPath();\n//\t\t\t\t\t\tif (!TextUtils.isEmpty(path)) {\n//\t\t\t\t\t\t\tmHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_MEDIA_UPDATE, path), 1000);\n//\t\t\t\t\t\t} else {\n//\t\t\t\t\t\t\tif (parent == null || parent.isDestroyed()) {\n//\t\t\t\t\t\t\t\thandleRelease();\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t} catch (final Exception e) {\n//\t\t\t\t\t\tLog.e(TAG, \"onPrepared:\", e);\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t};\n//\n//\t\t\t/**\n//\t\t\t * prepare and load shutter sound for still image capturing\n//\t\t\t */\n//\t\t\t@SuppressWarnings(\"deprecation\")\n//\t\t\tprivate void loadShutterSound(final Context context) {\n//\t\t    \t// get system stream type using refrection\n//\t\t        int streamType;\n//\t\t        try {\n//\t\t            final Class<?> audioSystemClass = Class.forName(\"android.media.AudioSystem\");\n//\t\t            final Field sseField = audioSystemClass.getDeclaredField(\"STREAM_SYSTEM_ENFORCED\");\n//\t\t            streamType = sseField.getInt(null);\n//\t\t        } catch (final Exception e) {\n//\t\t        \tstreamType = AudioManager.STREAM_SYSTEM;\t// set appropriate according to your app policy\n//\t\t        }\n//\t\t        if (mSoundPool != null) {\n//\t\t        \ttry {\n//\t\t        \t\tmSoundPool.release();\n//\t\t        \t} catch (final Exception e) {\n//\t\t        \t}\n//\t\t        \tmSoundPool = null;\n//\t\t        }\n//\t\t        // load sutter sound from resource\n//\t\t\t    mSoundPool = new SoundPool(2, streamType, 0);\n//\t\t\t    mSoundId = mSoundPool.load(context, R.raw.camera_click, 1);\n//\t\t\t}\n//\n//\t\t\t@Override\n//\t\t\tpublic void run() {\n//\t\t\t\tLooper.prepare();\n//\t\t\t\tsynchronized (mSync) {\n//\t\t\t\t\tmHandler = new AbstractUVCCameraHandler(this);\n//\t\t\t\t\tmSync.notifyAll();\n//\t\t\t\t}\n//\t\t\t\tLooper.loop();\n//\t\t\t\tsynchronized (mSync) {\n//\t\t\t\t\tmHandler = null;\n//\t\t\t\t\tmSoundPool.release();\n//\t\t\t\t\tmSoundPool = null;\n//\t\t\t\t\tmSync.notifyAll();\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n//\t}\n}\n"
  },
  {
    "path": "usbCameraTest5/src/main/res/drawable/border.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\"\n    android:useLevel=\"false\" >\n\n    <stroke\n        android:width=\"3px\"\n        android:color=\"@color/GRAY\" />\n\n    <!-- <solid android:color=\"@color/TRANSPARENT\" />　 -->\n    <solid android:color=\"@null\" />\n\n    <padding\n        android:bottom=\"2px\"\n        android:left=\"2px\"\n        android:right=\"2px\"\n        android:top=\"2px\" />\n\n    <corners android:radius=\"2px\" />\n\n</shape>"
  },
  {
    "path": "usbCameraTest5/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/RelativeLayout1\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n\tandroid:background=\"#ff000000\"\n\ttools:context=\"com.serenegiant.usbcameratest5.MainActivity\"\n    tools:ignore=\"MergeRootFrame\" >\n\n    <com.serenegiant.widget.UVCCameraTextureView\n        android:id=\"@+id/camera_view\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_centerVertical=\"true\" />\n\n\t<ImageView\n        android:id=\"@+id/frame_image\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignTop=\"@+id/camera_view\"\n        android:layout_alignBottom=\"@+id/camera_view\"\n        android:layout_alignLeft=\"@+id/camera_view\"\n        android:layout_alignRight=\"@+id/camera_view\"\n        android:src=\"@drawable/border\" />\n\n    <ToggleButton\n        android:id=\"@+id/camera_button\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignLeft=\"@id/camera_view\"\n        android:layout_alignTop=\"@id/camera_view\"\n        android:text=\"ToggleButton\" />\n\n    <ImageButton\n        android:id=\"@+id/capture_button\"\n        android:layout_width=\"@dimen/button_size\"\n        android:layout_height=\"@dimen/button_size\"\n        android:layout_alignBottom=\"@id/camera_view\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_marginBottom=\"6dp\"\n        android:background=\"@null\"\n        android:scaleType=\"centerCrop\"\n        android:src=\"@android:drawable/ic_menu_camera\" />\n\n</RelativeLayout>"
  },
  {
    "path": "usbCameraTest5/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n\n    <!-- Web colors -->\n    <color name=\"CLEAR\">#00000000</color>\n    <color name=\"HALF_CLEAR_WHITE\">#7fffffff</color>\n    <color name=\"QUATER_CLEAR_WHITE\">#3fffffff</color>\n    <color name=\"TRANSPARENT\">#00000000</color>\n    <color name=\"BLACK\">#ff000000</color>\n    <color name=\"ALICEBLUE\">#fff0f8ff</color>\n    <color name=\"DARKCYAN\">#ff008b8b</color>\n    <color name=\"LIGHTYELLOW\">#ffffffe0</color>\n    <color name=\"CORAL\">#ffff7f50</color>\n    <color name=\"DIMGRAY\">#ff696969</color>\n    <color name=\"LAVENDER\">#ffe6e6fa</color>\n    <color name=\"TEAL\">#ff008080</color>\n    <color name=\"LIGHTGOLDENRODYELLOW\">#fffafad2</color>\n    <color name=\"TOMATO\">#ffff6347</color>\n    <color name=\"GRAY\">#ff808080</color>\n    <color name=\"LIGHTSTEELBLUE\">#ffb0c4de</color>\n    <color name=\"DARKSLATEGRAY\">#ff2f4f4f</color>\n    <color name=\"LEMONCHIFFON\">#fffffacd</color>\n    <color name=\"ORANGERED\">#ffff4500</color>\n    <color name=\"DARKGRAY\">#ffa9a9a9</color>\n    <color name=\"LIGHTSLATEGRAY\">#ff778899</color>\n    <color name=\"DARKGREEN\">#ff006400</color>\n    <color name=\"WHEAT\">#fff5deb3</color>\n    <color name=\"RED\">#ffff0000</color>\n    <color name=\"SILVER\">#ffc0c0c0</color>\n    <color name=\"SLATEGRAY\">#ff708090</color>\n    <color name=\"GREEN\">#ff008000</color>\n    <color name=\"BURLYWOOD\">#ffdeb887</color>\n    <color name=\"CRIMSON\">#ffdc143c</color>\n    <color name=\"LIGHTGRAY\">#ffd3d3d3</color>\n    <color name=\"STEELBLUE\">#ff4682b4</color>\n    <color name=\"FORESTGREEN\">#ff228b22</color>\n    <color name=\"TAN\">#ffd2b48c</color>\n    <color name=\"MEDIUMVIOLETRED\">#ffc71585</color>\n    <color name=\"GAINSBORO\">#ffdcdcdc</color>\n    <color name=\"ROYALBLUE\">#ff4169e1</color>\n    <color name=\"SEAGREEN\">#ff2e8b57</color>\n    <color name=\"KHAKI\">#fff0e68c</color>\n    <color name=\"DEEPPINK\">#ffff1493</color>\n    <color name=\"WHITESMOKE\">#fff5f5f5</color>\n    <color name=\"MIDNIGHTBLUE\">#ff191970</color>\n    <color name=\"MEDIUMSEAGREEN\">#ff3cb371</color>\n    <color name=\"YELLOW\">#ffffff00</color>\n    <color name=\"HOTPINK\">#ffff69b4</color>\n    <color name=\"WHITE\">#ffffffff</color>\n    <color name=\"NAVY\">#ff000080</color>\n    <color name=\"MEDIUMAQUAMARINE\">#ff66cdaa</color>\n    <color name=\"GOLD\">#ffffd700</color>\n    <color name=\"PALEVIOLETRED\">#ffdb7093</color>\n    <color name=\"SNOW\">#fffffafa</color>\n    <color name=\"DARKBLUE\">#ff00008b</color>\n    <color name=\"DARKSEAGREEN\">#ff8fbc8f</color>\n    <color name=\"ORANGE\">#ffffa500</color>\n    <color name=\"PINK\">#ffffc0cb</color>\n    <color name=\"GHOSTWHITE\">#fff8f8ff</color>\n    <color name=\"MEDIUMBLUE\">#ff0000cd</color>\n    <color name=\"AQUAMARINE\">#ff7fffd4</color>\n    <color name=\"SANDYBROWN\">#fff4a460</color>\n    <color name=\"LIGHTPINK\">#ffffb6c1</color>\n    <color name=\"FLORALWHITE\">#fffffaf0</color>\n    <color name=\"BLUE\">#ff0000ff</color>\n    <color name=\"PALEGREEN\">#ff98fb98</color>\n    <color name=\"DARKORANGE\">#ffff8c00</color>\n    <color name=\"THISTLE\">#ffd8bfd8</color>\n    <color name=\"LINEN\">#fffaf0e6</color>\n    <color name=\"DODGERBLUE\">#ff1e90ff</color>\n    <color name=\"LIGHTGREEN\">#ff90ee90</color>\n    <color name=\"GOLDENROD\">#ffdaa520</color>\n    <color name=\"MAGENTA\">#ffff00ff</color>\n    <color name=\"ANTIQUEWHITE\">#fffaebd7</color>\n    <color name=\"CORNFLOWERBLUE\">#ff6495ed</color>\n    <color name=\"SPRINGGREEN\">#ff00ff7f</color>\n    <color name=\"PERU\">#ffcd853f</color>\n    <color name=\"FUCHSIA\">#ffff00ff</color>\n    <color name=\"PAPAYAWHIP\">#ffffefd5</color>\n    <color name=\"DEEPSKYBLUE\">#ff00bfff</color>\n    <color name=\"MEDIUMSPRINGGREEN\">#ff00fa9a</color>\n    <color name=\"DARKGOLDENROD\">#ffb8860b</color>\n    <color name=\"VIOLET\">#ffee82ee</color>\n    <color name=\"BLANCHEDALMOND\">#ffffebcd</color>\n    <color name=\"LIGHTSKYBLUE\">#ff87cefa</color>\n    <color name=\"LAWNGREEN\">#ff7cfc00</color>\n    <color name=\"CHOCOLATE\">#ffd2691e</color>\n    <color name=\"PLUM\">#ffdda0dd</color>\n    <color name=\"BISQUE\">#ffffe4c4</color>\n    <color name=\"SKYBLUE\">#ff87ceeb</color>\n    <color name=\"CHARTREUSE\">#ff7fff00</color>\n    <color name=\"SIENNA\">#ffa0522d</color>\n    <color name=\"ORCHID\">#ffda70d6</color>\n    <color name=\"MOCCASIN\">#ffffe4b5</color>\n    <color name=\"LIGHTBLUE\">#ffadd8e6</color>\n    <color name=\"GREENYELLOW\">#ffadff2f</color>\n    <color name=\"SADDLEBROWN\">#ff8b4513</color>\n    <color name=\"MEDIUMORCHID\">#ffba55d3</color>\n    <color name=\"NAVAJOWHITE\">#ffffdead</color>\n    <color name=\"POWDERBLUE\">#ffb0e0e6</color>\n    <color name=\"LIME\">#ff00ff00</color>\n    <color name=\"MAROON\">#ff800000</color>\n    <color name=\"DARKORCHID\">#ff9932cc</color>\n    <color name=\"PEACHPUFF\">#ffffdab9</color>\n    <color name=\"PALETURQUOISE\">#ffafeeee</color>\n    <color name=\"LIMEGREEN\">#ff32cd32</color>\n    <color name=\"DARKRED\">#ff8b0000</color>\n    <color name=\"DARKVIOLET\">#ff9400d3</color>\n    <color name=\"MISTYROSE\">#ffffe4e1</color>\n    <color name=\"LIGHTCYAN\">#ffe0ffff</color>\n    <color name=\"YELLOWGREEN\">#ff9acd32</color>\n    <color name=\"BROWN\">#ffa52a2a</color>\n    <color name=\"DARKMAGENTA\">#ff8b008b</color>\n    <color name=\"LAVENDERBLUSH\">#fffff0f5</color>\n    <color name=\"CYAN\">#ff00ffff</color>\n    <color name=\"DARKOLIVEGREEN\">#ff556b2f</color>\n    <color name=\"FIREBRICK\">#ffb22222</color>\n    <color name=\"PURPLE\">#ff800080</color>\n    <color name=\"SEASHELL\">#fffff5ee</color>\n    <color name=\"AQUA\">#ff00ffff</color>\n    <color name=\"OLIVEDRAB\">#ff6b8e23</color>\n    <color name=\"INDIANRED\">#ffcd5c5c</color>\n    <color name=\"INDIGO\">#ff4b0082</color>\n    <color name=\"OLDLACE\">#fffdf5e6</color>\n    <color name=\"TURQUOISE\">#ff40e0d0</color>\n    <color name=\"OLIVE\">#ff808000</color>\n    <color name=\"ROSYBROWN\">#ffbc8f8f</color>\n    <color name=\"DARKSLATEBLUE\">#ff483d8b</color>\n    <color name=\"IVORY\">#fffffff0</color>\n    <color name=\"MEDIUMTURQUOISE\">#ff48d1cc</color>\n    <color name=\"DARKKHAKI\">#ffbdb76b</color>\n    <color name=\"DARKSALMON\">#ffe9967a</color>\n    <color name=\"BLUEVIOLET\">#ff8a2be2</color>\n    <color name=\"HONEYDEW\">#fff0fff0</color>\n    <color name=\"DARKTURQUOISE\">#ff00ced1</color>\n    <color name=\"PALEGOLDENROD\">#ffeee8aa</color>\n    <color name=\"LIGHTCORAL\">#fff08080</color>\n    <color name=\"MEDIUMPURPLE\">#ff9370db</color>\n    <color name=\"MINTCREAM\">#fff5fffa</color>\n    <color name=\"LIGHTSEAGREEN\">#ff20b2aa</color>\n    <color name=\"CORNSILK\">#fffff8dc</color>\n    <color name=\"SALMON\">#fffa8072</color>\n    <color name=\"SLATEBLUE\">#ff6a5acd</color>\n    <color name=\"AZURE\">#fff0ffff</color>\n    <color name=\"CADETBLUE\">#ff5f9ea0</color>\n    <color name=\"BEIGE\">#fff5f5dc</color>\n    <color name=\"LIGHTSALMON\">#ffffa07a</color>\n    <color name=\"MEDIUMSLATEBLUE\">#ff7b68ee</color>\n\n</resources>"
  },
  {
    "path": "usbCameraTest5/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n\n\t<!-- Default screen margins, per the Android Design guidelines. -->\n\t<dimen name=\"activity_horizontal_margin\">16dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">16dp</dimen>\n\t<dimen name=\"button_size\">48dp</dimen>\n</resources>\n"
  },
  {
    "path": "usbCameraTest5/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBCameraTest5</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest5/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme, dependent on API level. This theme is replaced\n        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Light\">\n        <!--\n            Theme customizations available in newer API levels can go in\n            res/values-vXX/styles.xml, while customizations related to\n            backward-compatibility can go here.\n        -->\n    </style>\n\n    <!-- Application theme. -->\n    <style name=\"AppTheme\" parent=\"AppBaseTheme\">\n        <!-- All customizations that are NOT specific to a particular API-level can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest5/src/main/res/values-ja/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBカメラテスト5</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest5/src/main/res/values-v11/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 11+. This theme completely replaces\n        AppBaseTheme from res/values/styles.xml on API 11+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light\">\n        <!-- API 11 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest5/src/main/res/values-v14/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 14+. This theme completely replaces\n        AppBaseTheme from BOTH res/values/styles.xml and\n        res/values-v11/styles.xml on API 14+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light.DarkActionBar\">\n        <!-- API 14 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest5/src/main/res/values-w820dp/dimens.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n         Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively).\n    -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">64dp</dimen>\n\t<dimen name=\"button_size\">48dp</dimen>\n\t<dimen name=\"list_font_size\">24sp</dimen>\n    \n</resources>\n"
  },
  {
    "path": "usbCameraTest5/src/main/res/xml/device_filter.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<usb>\n\t<usb-device class=\"239\" subclass=\"2\" />\t<!-- all device of UVC -->\n</usb>\n"
  },
  {
    "path": "usbCameraTest6/build.gradle",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\napply plugin: 'com.android.application'\n\nandroid {\n\tcompileSdkVersion versionCompiler\n\tbuildToolsVersion versionBuildTool\n\n\tcompileOptions {\n\t\tsourceCompatibility javaSourceCompatibility\n\t\ttargetCompatibility javaTargetCompatibility\n\t}\n\n    defaultConfig {\n        applicationId \"com.serenegiant.usbcameratest6\"\n        minSdkVersion 18\n\t\ttargetSdkVersion versionTarget\n\t\tversionCode 8\n\t\tversionName \"3.00\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'\n        }\n    }\n}\n\ndependencies {\n\tapi fileTree(dir: 'libs', include: ['*.jar'])\n\n\timplementation \"com.android.support:support-v4:${supportLibVersion}\"\n\timplementation \"com.android.support:support-annotations:${supportLibVersion}\"\n\n\timplementation(\"com.serenegiant:common:${commonLibVersion}\") {\n\t\texclude module: 'support-v4'\n\t}\n\timplementation project(':libuvccamera')\n\timplementation project(':usbCameraCommon')\n}\n"
  },
  {
    "path": "usbCameraTest6/lint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<lint>\n</lint>"
  },
  {
    "path": "usbCameraTest6/proguard-project.txt",
    "content": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in that file.\n#\n# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in ${sdk.dir}/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the ProGuard\n# include property in project.properties.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n-keepclassmembers public class com.serenegiant.usb.UVCCamera {\n\tpublic *;\n\tprotected *;\n\tprivate *;\n}\n"
  },
  {
    "path": "usbCameraTest6/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.serenegiant.usbcameratest6\" >\n\n    <uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n\n    <uses-feature android:glEsVersion=\"0x00020000\" android:required=\"true\" />\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.serenegiant.usbcameratest6.MainActivity\"\n            android:label=\"@string/app_name\"\n            android:screenOrientation=\"sensorLandscape\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "usbCameraTest6/src/main/java/com/serenegiant/usbcameratest6/MainActivity.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usbcameratest6;\n\nimport java.io.File;\n\nimport android.graphics.SurfaceTexture;\nimport android.hardware.usb.UsbDevice;\nimport android.os.Bundle;\nimport android.os.Environment;\nimport android.util.Log;\nimport android.view.Surface;\nimport android.view.TextureView;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.view.View.OnLongClickListener;\nimport android.widget.CompoundButton;\nimport android.widget.ImageButton;\nimport android.widget.Toast;\nimport android.widget.ToggleButton;\n\nimport com.serenegiant.common.BaseActivity;\nimport com.serenegiant.encoder.MediaMuxerWrapper;\n\nimport com.serenegiant.usb.CameraDialog;\nimport com.serenegiant.usb.USBMonitor;\nimport com.serenegiant.usb.USBMonitor.OnDeviceConnectListener;\nimport com.serenegiant.usb.USBMonitor.UsbControlBlock;\nimport com.serenegiant.usb.UVCCamera;\nimport com.serenegiant.usbcameracommon.UVCCameraHandlerMultiSurface;\nimport com.serenegiant.widget.CameraViewInterface;\nimport com.serenegiant.widget.UVCCameraTextureView;\n\npublic final class MainActivity extends BaseActivity implements CameraDialog.CameraDialogParent {\n\tprivate static final boolean DEBUG = true;\t// TODO set false on release\n\tprivate static final String TAG = \"MainActivity\";\n\n\tprivate final Object mSync = new Object();\n\t/**\n\t * for accessing USB\n\t */\n\tprivate USBMonitor mUSBMonitor;\n\t/**\n\t * Handler to execute camera releated methods sequentially on private thread\n\t */\n\tprivate UVCCameraHandlerMultiSurface mCameraHandler;\n\t/**\n\t * for camera preview display\n\t */\n\tprivate CameraViewInterface mUVCCameraViewL;\n\tprivate CameraViewInterface mUVCCameraViewR;\n\t/**\n\t * for open&start / stop&close camera preview\n\t */\n\tprivate ToggleButton mCameraButton;\n\t/**\n\t * button for start/stop recording\n\t */\n\tprivate ImageButton mCaptureButton;\n\n\t@Override\n\tprotected void onCreate(final Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tif (DEBUG) Log.v(TAG, \"onCreate:\");\n\t\tsetContentView(R.layout.activity_main);\n\t\tmCameraButton = (ToggleButton)findViewById(R.id.camera_button);\n\t\tmCameraButton.setOnCheckedChangeListener(mOnCheckedChangeListener);\n\t\tmCaptureButton = (ImageButton)findViewById(R.id.capture_button);\n\t\tmCaptureButton.setOnClickListener(mOnClickListener);\n\t\tmCaptureButton.setVisibility(View.INVISIBLE);\n\n\t\tmUVCCameraViewL = (CameraViewInterface)findViewById(R.id.camera_view_L);\n\t\tmUVCCameraViewL.setAspectRatio(UVCCamera.DEFAULT_PREVIEW_WIDTH / (float)UVCCamera.DEFAULT_PREVIEW_HEIGHT);\n\t\tmUVCCameraViewL.setCallback(mCallback);\n\t\t((View)mUVCCameraViewL).setOnLongClickListener(mOnLongClickListener);\n\n\t\tmUVCCameraViewR = (CameraViewInterface)findViewById(R.id.camera_view_R);\n\t\tmUVCCameraViewR.setAspectRatio(UVCCamera.DEFAULT_PREVIEW_WIDTH / (float)UVCCamera.DEFAULT_PREVIEW_HEIGHT);\n\t\tmUVCCameraViewR.setCallback(mCallback);\n\t\t((View)mUVCCameraViewL).setOnLongClickListener(mOnLongClickListener);\n\n\t\tsynchronized (mSync) {\n\t\t\tmUSBMonitor = new USBMonitor(this, mOnDeviceConnectListener);\n\t\t\tmCameraHandler = UVCCameraHandlerMultiSurface.createHandler(this, mUVCCameraViewL, 1,\n\t\t\t\tUVCCamera.DEFAULT_PREVIEW_WIDTH, UVCCamera.DEFAULT_PREVIEW_HEIGHT);\n\t\t}\n\t}\n\n\t@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tif (DEBUG) Log.v(TAG, \"onStart:\");\n\t\tsynchronized (mSync) {\n\t\t\tmUSBMonitor.register();\n\t\t}\n\t\tif (mUVCCameraViewL != null) {\n\t\t\tmUVCCameraViewL.onResume();\n\t\t}\n\t\tif (mUVCCameraViewR != null) {\n\t\t\tmUVCCameraViewR.onResume();\n\t\t}\n\t}\n\n\t@Override\n\tprotected void onStop() {\n\t\tif (DEBUG) Log.v(TAG, \"onStop:\");\n\t\tsynchronized (mSync) {\n//\t\t\tmCameraHandler.stopRecording();\n//\t\t\tmCameraHandler.stopPreview();\n    \t\tmCameraHandler.close();\t// #close include #stopRecording and #stopPreview\n\t\t\tmUSBMonitor.unregister();\n\t\t}\n\t\tif (mUVCCameraViewL != null) {\n\t\t\tmUVCCameraViewL.onPause();\n\t\t}\n\t\tif (mUVCCameraViewR != null) {\n\t\t\tmUVCCameraViewR.onPause();\n\t\t}\n\t\tsetCameraButton(false);\n\t\tsuper.onStop();\n\t}\n\n\t@Override\n\tpublic void onDestroy() {\n\t\tif (DEBUG) Log.v(TAG, \"onDestroy:\");\n\t\tsynchronized (mSync) {\n\t\t\tif (mCameraHandler != null) {\n\t\t\t\tmCameraHandler.release();\n\t\t\t\tmCameraHandler = null;\n\t\t\t}\n\t\t\tif (mUSBMonitor != null) {\n\t\t\t\tmUSBMonitor.destroy();\n\t\t\t\tmUSBMonitor = null;\n\t\t\t}\n\t\t}\n        mUVCCameraViewL = null;\n        mUVCCameraViewR = null;\n        mCameraButton = null;\n        mCaptureButton = null;\n\t\tsuper.onDestroy();\n\t}\n\n\t/**\n\t * event handler when click camera / capture button\n\t */\n\tprivate final OnClickListener mOnClickListener = new OnClickListener() {\n\t\t@Override\n\t\tpublic void onClick(final View view) {\n\t\t\tswitch (view.getId()) {\n\t\t\tcase R.id.capture_button:\n\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\tif ((mCameraHandler != null) && mCameraHandler.isOpened()) {\n\t\t\t\t\t\tif (checkPermissionWriteExternalStorage() && checkPermissionAudio()) {\n\t\t\t\t\t\t\tif (!mCameraHandler.isRecording()) {\n\t\t\t\t\t\t\t\tmCaptureButton.setColorFilter(0xffff0000);\t// turn red\n\t\t\t\t\t\t\t\tmCameraHandler.startRecording();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmCaptureButton.setColorFilter(0);\t// return to default color\n\t\t\t\t\t\t\t\tmCameraHandler.stopRecording();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate final CompoundButton.OnCheckedChangeListener mOnCheckedChangeListener\n\t\t= new CompoundButton.OnCheckedChangeListener() {\n\t\t@Override\n\t\tpublic void onCheckedChanged(final CompoundButton compoundButton, final boolean isChecked) {\n\t\t\tswitch (compoundButton.getId()) {\n\t\t\tcase R.id.camera_button:\n\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\tif (isChecked && (mCameraHandler != null) && !mCameraHandler.isOpened()) {\n\t\t\t\t\t\tCameraDialog.showDialog(MainActivity.this);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmCameraHandler.close();\n\t\t\t\t\t\tsetCameraButton(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * capture still image when you long click on preview image(not on buttons)\n\t */\n\tprivate final OnLongClickListener mOnLongClickListener = new OnLongClickListener() {\n\t\t@Override\n\t\tpublic boolean onLongClick(final View view) {\n\t\t\tswitch (view.getId()) {\n\t\t\tcase R.id.camera_view_L:\n\t\t\tcase R.id.camera_view_R:\n\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\tif ((mCameraHandler != null) && mCameraHandler.isOpened()) {\n\t\t\t\t\t\tif (checkPermissionWriteExternalStorage()) {\n\t\t\t\t\t\t\tfinal File outputFile = MediaMuxerWrapper.getCaptureFile(Environment.DIRECTORY_DCIM, \".png\");\n\t\t\t\t\t\t\tmCameraHandler.captureStill(outputFile.toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tprivate void setCameraButton(final boolean isOn) {\n\t\trunOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tif (mCameraButton != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmCameraButton.setOnCheckedChangeListener(null);\n\t\t\t\t\t\tmCameraButton.setChecked(isOn);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tmCameraButton.setOnCheckedChangeListener(mOnCheckedChangeListener);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!isOn && (mCaptureButton != null)) {\n\t\t\t\t\tmCaptureButton.setVisibility(View.INVISIBLE);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t}\n\n\tprivate void startPreview() {\n\t\tsynchronized (mSync) {\n\t\t\tif (mCameraHandler != null) {\n\t\t\t\tmCameraHandler.startPreview();\n\t\t\t}\n\t\t}\n\t\trunOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tmCaptureButton.setVisibility(View.VISIBLE);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate final OnDeviceConnectListener mOnDeviceConnectListener = new OnDeviceConnectListener() {\n\t\t@Override\n\t\tpublic void onAttach(final UsbDevice device) {\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_ATTACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onConnect(final UsbDevice device, final UsbControlBlock ctrlBlock, final boolean createNew) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onConnect:\");\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (mCameraHandler != null) {\n\t\t\t\t\tmCameraHandler.open(ctrlBlock);\n\t\t\t\t\tstartPreview();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDisconnect(final UsbDevice device, final UsbControlBlock ctrlBlock) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onDisconnect:\");\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (mCameraHandler != null) {\n\t\t\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tsynchronized (mSync) {\n\t\t\t\t\t\t\t\tif (mCameraHandler != null) {\n\t\t\t\t\t\t\t\t\tmCameraHandler.close();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetCameraButton(false);\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDettach(final UsbDevice device) {\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_DETACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onCancel(final UsbDevice device) {\n\t\t\tsetCameraButton(false);\n\t\t}\n\t};\n\n\t/**\n\t * to access from CameraDialog\n\t * @return\n\t */\n\t@Override\n\tpublic USBMonitor getUSBMonitor() {\n\t\tsynchronized (mSync) {\n\t\t\treturn mUSBMonitor;\n\t\t}\n\t}\n\n\t@Override\n\tpublic void onDialogResult(boolean canceled) {\n\t\tif (canceled) {\n\t\t\tsetCameraButton(false);\n\t\t}\n\t}\n\n\tprivate final CameraViewInterface.Callback\n\t\tmCallback = new CameraViewInterface.Callback() {\n\t\t@Override\n\t\tpublic void onSurfaceCreated(final CameraViewInterface view, final Surface surface) {\n\t\t\tmCameraHandler.addSurface(surface.hashCode(), surface, false);\n\t\t}\n\n\t\t@Override\n\t\tpublic void onSurfaceChanged(final CameraViewInterface view, final Surface surface, final int width, final int height) {\n\n\t\t}\n\n\t\t@Override\n\t\tpublic void onSurfaceDestroy(final CameraViewInterface view, final Surface surface) {\n\t\t\tsynchronized (mSync) {\n\t\t\t\tif (mCameraHandler != null) {\n\t\t\t\t\tmCameraHandler.removeSurface(surface.hashCode());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n}\n"
  },
  {
    "path": "usbCameraTest6/src/main/res/drawable/border.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\"\n    android:useLevel=\"false\" >\n\n    <stroke\n        android:width=\"3px\"\n        android:color=\"@color/GRAY\" />\n\n    <!-- <solid android:color=\"@color/TRANSPARENT\" />　 -->\n    <solid android:color=\"@null\" />\n\n    <padding\n        android:bottom=\"2px\"\n        android:left=\"2px\"\n        android:right=\"2px\"\n        android:top=\"2px\" />\n\n    <corners android:radius=\"2px\" />\n\n</shape>"
  },
  {
    "path": "usbCameraTest6/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/RelativeLayout1\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"#ff000000\"\n    tools:context=\"com.serenegiant.usbcameratest3.MainActivity\"\n    tools:ignore=\"MergeRootFrame\" >\n\n    <LinearLayout\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:baselineAligned=\"false\"\n        android:layout_centerInParent=\"true\" >\n\n        <RelativeLayout\n\t        android:id=\"@+id/camera_layout_L\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"match_parent\"\n            android:layout_weight=\"1\" >\n\n            <com.serenegiant.widget.UVCCameraTextureView\n                android:id=\"@+id/camera_view_L\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"match_parent\"\n                android:layout_centerHorizontal=\"true\"\n                android:layout_centerVertical=\"true\" />\n\n            <ImageView\n                android:id=\"@+id/frame_image_L\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignBottom=\"@+id/camera_view_L\"\n                android:layout_alignLeft=\"@+id/camera_view_L\"\n                android:layout_alignRight=\"@+id/camera_view_L\"\n                android:layout_alignTop=\"@+id/camera_view_L\"\n                android:src=\"@drawable/border\" />\n        </RelativeLayout>\n\n        <RelativeLayout\n\t        android:id=\"@+id/camera_layout_R\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"match_parent\"\n            android:layout_weight=\"1\" >\n\n            <com.serenegiant.widget.UVCCameraTextureView\n                android:id=\"@+id/camera_view_R\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"match_parent\"\n                android:layout_centerHorizontal=\"true\"\n                android:layout_centerVertical=\"true\" />\n\n            <ImageView\n                android:id=\"@+id/frame_image_R\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignBottom=\"@+id/camera_view_R\"\n                android:layout_alignLeft=\"@+id/camera_view_R\"\n                android:layout_alignRight=\"@+id/camera_view_R\"\n                android:layout_alignTop=\"@+id/camera_view_R\"\n                android:src=\"@drawable/border\" />\n        </RelativeLayout>\n    </LinearLayout>\n\n    <ToggleButton\n        android:id=\"@+id/camera_button\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignParentLeft=\"true\"\n        android:layout_alignParentTop=\"true\"\n        android:text=\"ToggleButton\" />\n\n    <ImageButton\n        android:id=\"@+id/capture_button\"\n        android:layout_width=\"@dimen/button_size\"\n        android:layout_height=\"@dimen/button_size\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_marginBottom=\"6dp\"\n        android:background=\"@null\"\n        android:scaleType=\"centerCrop\"\n        android:src=\"@android:drawable/ic_menu_camera\" />\n\n</RelativeLayout>"
  },
  {
    "path": "usbCameraTest6/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n\n    <!-- Web colors -->\n    <color name=\"CLEAR\">#00000000</color>\n    <color name=\"HALF_CLEAR_WHITE\">#7fffffff</color>\n    <color name=\"QUATER_CLEAR_WHITE\">#3fffffff</color>\n    <color name=\"TRANSPARENT\">#00000000</color>\n    <color name=\"BLACK\">#ff000000</color>\n    <color name=\"ALICEBLUE\">#fff0f8ff</color>\n    <color name=\"DARKCYAN\">#ff008b8b</color>\n    <color name=\"LIGHTYELLOW\">#ffffffe0</color>\n    <color name=\"CORAL\">#ffff7f50</color>\n    <color name=\"DIMGRAY\">#ff696969</color>\n    <color name=\"LAVENDER\">#ffe6e6fa</color>\n    <color name=\"TEAL\">#ff008080</color>\n    <color name=\"LIGHTGOLDENRODYELLOW\">#fffafad2</color>\n    <color name=\"TOMATO\">#ffff6347</color>\n    <color name=\"GRAY\">#ff808080</color>\n    <color name=\"LIGHTSTEELBLUE\">#ffb0c4de</color>\n    <color name=\"DARKSLATEGRAY\">#ff2f4f4f</color>\n    <color name=\"LEMONCHIFFON\">#fffffacd</color>\n    <color name=\"ORANGERED\">#ffff4500</color>\n    <color name=\"DARKGRAY\">#ffa9a9a9</color>\n    <color name=\"LIGHTSLATEGRAY\">#ff778899</color>\n    <color name=\"DARKGREEN\">#ff006400</color>\n    <color name=\"WHEAT\">#fff5deb3</color>\n    <color name=\"RED\">#ffff0000</color>\n    <color name=\"SILVER\">#ffc0c0c0</color>\n    <color name=\"SLATEGRAY\">#ff708090</color>\n    <color name=\"GREEN\">#ff008000</color>\n    <color name=\"BURLYWOOD\">#ffdeb887</color>\n    <color name=\"CRIMSON\">#ffdc143c</color>\n    <color name=\"LIGHTGRAY\">#ffd3d3d3</color>\n    <color name=\"STEELBLUE\">#ff4682b4</color>\n    <color name=\"FORESTGREEN\">#ff228b22</color>\n    <color name=\"TAN\">#ffd2b48c</color>\n    <color name=\"MEDIUMVIOLETRED\">#ffc71585</color>\n    <color name=\"GAINSBORO\">#ffdcdcdc</color>\n    <color name=\"ROYALBLUE\">#ff4169e1</color>\n    <color name=\"SEAGREEN\">#ff2e8b57</color>\n    <color name=\"KHAKI\">#fff0e68c</color>\n    <color name=\"DEEPPINK\">#ffff1493</color>\n    <color name=\"WHITESMOKE\">#fff5f5f5</color>\n    <color name=\"MIDNIGHTBLUE\">#ff191970</color>\n    <color name=\"MEDIUMSEAGREEN\">#ff3cb371</color>\n    <color name=\"YELLOW\">#ffffff00</color>\n    <color name=\"HOTPINK\">#ffff69b4</color>\n    <color name=\"WHITE\">#ffffffff</color>\n    <color name=\"NAVY\">#ff000080</color>\n    <color name=\"MEDIUMAQUAMARINE\">#ff66cdaa</color>\n    <color name=\"GOLD\">#ffffd700</color>\n    <color name=\"PALEVIOLETRED\">#ffdb7093</color>\n    <color name=\"SNOW\">#fffffafa</color>\n    <color name=\"DARKBLUE\">#ff00008b</color>\n    <color name=\"DARKSEAGREEN\">#ff8fbc8f</color>\n    <color name=\"ORANGE\">#ffffa500</color>\n    <color name=\"PINK\">#ffffc0cb</color>\n    <color name=\"GHOSTWHITE\">#fff8f8ff</color>\n    <color name=\"MEDIUMBLUE\">#ff0000cd</color>\n    <color name=\"AQUAMARINE\">#ff7fffd4</color>\n    <color name=\"SANDYBROWN\">#fff4a460</color>\n    <color name=\"LIGHTPINK\">#ffffb6c1</color>\n    <color name=\"FLORALWHITE\">#fffffaf0</color>\n    <color name=\"BLUE\">#ff0000ff</color>\n    <color name=\"PALEGREEN\">#ff98fb98</color>\n    <color name=\"DARKORANGE\">#ffff8c00</color>\n    <color name=\"THISTLE\">#ffd8bfd8</color>\n    <color name=\"LINEN\">#fffaf0e6</color>\n    <color name=\"DODGERBLUE\">#ff1e90ff</color>\n    <color name=\"LIGHTGREEN\">#ff90ee90</color>\n    <color name=\"GOLDENROD\">#ffdaa520</color>\n    <color name=\"MAGENTA\">#ffff00ff</color>\n    <color name=\"ANTIQUEWHITE\">#fffaebd7</color>\n    <color name=\"CORNFLOWERBLUE\">#ff6495ed</color>\n    <color name=\"SPRINGGREEN\">#ff00ff7f</color>\n    <color name=\"PERU\">#ffcd853f</color>\n    <color name=\"FUCHSIA\">#ffff00ff</color>\n    <color name=\"PAPAYAWHIP\">#ffffefd5</color>\n    <color name=\"DEEPSKYBLUE\">#ff00bfff</color>\n    <color name=\"MEDIUMSPRINGGREEN\">#ff00fa9a</color>\n    <color name=\"DARKGOLDENROD\">#ffb8860b</color>\n    <color name=\"VIOLET\">#ffee82ee</color>\n    <color name=\"BLANCHEDALMOND\">#ffffebcd</color>\n    <color name=\"LIGHTSKYBLUE\">#ff87cefa</color>\n    <color name=\"LAWNGREEN\">#ff7cfc00</color>\n    <color name=\"CHOCOLATE\">#ffd2691e</color>\n    <color name=\"PLUM\">#ffdda0dd</color>\n    <color name=\"BISQUE\">#ffffe4c4</color>\n    <color name=\"SKYBLUE\">#ff87ceeb</color>\n    <color name=\"CHARTREUSE\">#ff7fff00</color>\n    <color name=\"SIENNA\">#ffa0522d</color>\n    <color name=\"ORCHID\">#ffda70d6</color>\n    <color name=\"MOCCASIN\">#ffffe4b5</color>\n    <color name=\"LIGHTBLUE\">#ffadd8e6</color>\n    <color name=\"GREENYELLOW\">#ffadff2f</color>\n    <color name=\"SADDLEBROWN\">#ff8b4513</color>\n    <color name=\"MEDIUMORCHID\">#ffba55d3</color>\n    <color name=\"NAVAJOWHITE\">#ffffdead</color>\n    <color name=\"POWDERBLUE\">#ffb0e0e6</color>\n    <color name=\"LIME\">#ff00ff00</color>\n    <color name=\"MAROON\">#ff800000</color>\n    <color name=\"DARKORCHID\">#ff9932cc</color>\n    <color name=\"PEACHPUFF\">#ffffdab9</color>\n    <color name=\"PALETURQUOISE\">#ffafeeee</color>\n    <color name=\"LIMEGREEN\">#ff32cd32</color>\n    <color name=\"DARKRED\">#ff8b0000</color>\n    <color name=\"DARKVIOLET\">#ff9400d3</color>\n    <color name=\"MISTYROSE\">#ffffe4e1</color>\n    <color name=\"LIGHTCYAN\">#ffe0ffff</color>\n    <color name=\"YELLOWGREEN\">#ff9acd32</color>\n    <color name=\"BROWN\">#ffa52a2a</color>\n    <color name=\"DARKMAGENTA\">#ff8b008b</color>\n    <color name=\"LAVENDERBLUSH\">#fffff0f5</color>\n    <color name=\"CYAN\">#ff00ffff</color>\n    <color name=\"DARKOLIVEGREEN\">#ff556b2f</color>\n    <color name=\"FIREBRICK\">#ffb22222</color>\n    <color name=\"PURPLE\">#ff800080</color>\n    <color name=\"SEASHELL\">#fffff5ee</color>\n    <color name=\"AQUA\">#ff00ffff</color>\n    <color name=\"OLIVEDRAB\">#ff6b8e23</color>\n    <color name=\"INDIANRED\">#ffcd5c5c</color>\n    <color name=\"INDIGO\">#ff4b0082</color>\n    <color name=\"OLDLACE\">#fffdf5e6</color>\n    <color name=\"TURQUOISE\">#ff40e0d0</color>\n    <color name=\"OLIVE\">#ff808000</color>\n    <color name=\"ROSYBROWN\">#ffbc8f8f</color>\n    <color name=\"DARKSLATEBLUE\">#ff483d8b</color>\n    <color name=\"IVORY\">#fffffff0</color>\n    <color name=\"MEDIUMTURQUOISE\">#ff48d1cc</color>\n    <color name=\"DARKKHAKI\">#ffbdb76b</color>\n    <color name=\"DARKSALMON\">#ffe9967a</color>\n    <color name=\"BLUEVIOLET\">#ff8a2be2</color>\n    <color name=\"HONEYDEW\">#fff0fff0</color>\n    <color name=\"DARKTURQUOISE\">#ff00ced1</color>\n    <color name=\"PALEGOLDENROD\">#ffeee8aa</color>\n    <color name=\"LIGHTCORAL\">#fff08080</color>\n    <color name=\"MEDIUMPURPLE\">#ff9370db</color>\n    <color name=\"MINTCREAM\">#fff5fffa</color>\n    <color name=\"LIGHTSEAGREEN\">#ff20b2aa</color>\n    <color name=\"CORNSILK\">#fffff8dc</color>\n    <color name=\"SALMON\">#fffa8072</color>\n    <color name=\"SLATEBLUE\">#ff6a5acd</color>\n    <color name=\"AZURE\">#fff0ffff</color>\n    <color name=\"CADETBLUE\">#ff5f9ea0</color>\n    <color name=\"BEIGE\">#fff5f5dc</color>\n    <color name=\"LIGHTSALMON\">#ffffa07a</color>\n    <color name=\"MEDIUMSLATEBLUE\">#ff7b68ee</color>\n\n</resources>"
  },
  {
    "path": "usbCameraTest6/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n\n\t<!-- Default screen margins, per the Android Design guidelines. -->\n\t<dimen name=\"activity_horizontal_margin\">16dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">16dp</dimen>\n\t<dimen name=\"button_size\">48dp</dimen>\n</resources>\n"
  },
  {
    "path": "usbCameraTest6/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBCameraTest6(Dual screen demo)</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest6/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme, dependent on API level. This theme is replaced\n        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Light\">\n        <!--\n            Theme customizations available in newer API levels can go in\n            res/values-vXX/styles.xml, while customizations related to\n            backward-compatibility can go here.\n        -->\n    </style>\n\n    <!-- Application theme. -->\n    <style name=\"AppTheme\" parent=\"AppBaseTheme\">\n        <!-- All customizations that are NOT specific to a particular API-level can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest6/src/main/res/values-ja/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBカメラテスト6(デュアルスクリーンデモ)</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest6/src/main/res/values-v11/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 11+. This theme completely replaces\n        AppBaseTheme from res/values/styles.xml on API 11+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light\">\n        <!-- API 11 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest6/src/main/res/values-v14/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 14+. This theme completely replaces\n        AppBaseTheme from BOTH res/values/styles.xml and\n        res/values-v11/styles.xml on API 14+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light.DarkActionBar\">\n        <!-- API 14 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest6/src/main/res/values-w820dp/dimens.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n         Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively).\n    -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">64dp</dimen>\n\t<dimen name=\"button_size\">48dp</dimen>\n\t<dimen name=\"list_font_size\">24sp</dimen>\n    \n</resources>\n"
  },
  {
    "path": "usbCameraTest6/src/main/res/xml/device_filter.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<usb>\n\t<usb-device class=\"239\" subclass=\"2\" />\t<!-- all device of UVC -->\n</usb>\n"
  },
  {
    "path": "usbCameraTest7/build.gradle",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\napply plugin: 'com.android.application'\n\nandroid {\n\tcompileSdkVersion versionCompiler\n\tbuildToolsVersion versionBuildTool\n\n\tcompileOptions {\n\t\tsourceCompatibility javaSourceCompatibility\n\t\ttargetCompatibility javaTargetCompatibility\n\t}\n\t\n    defaultConfig {\n        applicationId \"com.serenegiant.usbcameratest7\"\n        minSdkVersion 18\n\t\ttargetSdkVersion versionTarget\n\t\tversionCode 9\n\t\tversionName \"3.00\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'\n        }\n    }\n    compileOptions {\n    }\n}\n\ndependencies {\n\tapi fileTree(dir: 'libs', include: ['*.jar'])\n\n\timplementation \"com.android.support:support-v4:${supportLibVersion}\"\n\timplementation \"com.android.support:support-annotations:${supportLibVersion}\"\n\n\timplementation(\"com.serenegiant:common:${commonLibVersion}\") {\n\t\texclude module: 'support-v4'\n\t}\n\timplementation project(':libuvccamera')\n\timplementation project(':usbCameraCommon')\n}\n"
  },
  {
    "path": "usbCameraTest7/lint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<lint>\n</lint>"
  },
  {
    "path": "usbCameraTest7/proguard-project.txt",
    "content": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in that file.\n#\n# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in ${sdk.dir}/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the ProGuard\n# include property in project.properties.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n-keepclassmembers public class com.serenegiant.usb.UVCCamera {\n\tpublic *;\n\tprotected *;\n\tprivate *;\n}\n"
  },
  {
    "path": "usbCameraTest7/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.serenegiant.usbcameratest7\" >\n\n\t<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>\n\t<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n\n\t<uses-feature android:glEsVersion=\"0x00020000\" android:required=\"true\" />\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.serenegiant.usbcameratest7.MainActivity\"\n            android:label=\"@string/app_name\"\n            android:screenOrientation=\"sensorLandscape\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "usbCameraTest7/src/main/java/com/serenegiant/usbcameratest7/MainActivity.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usbcameratest7;\n\nimport android.graphics.SurfaceTexture;\nimport android.hardware.usb.UsbDevice;\nimport android.os.Bundle;\nimport android.util.Log;\nimport android.view.Surface;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.widget.ImageButton;\nimport android.widget.Toast;\n\nimport com.serenegiant.common.BaseActivity;\nimport com.serenegiant.usb.CameraDialog;\nimport com.serenegiant.usb.USBMonitor;\nimport com.serenegiant.usb.USBMonitor.OnDeviceConnectListener;\nimport com.serenegiant.usb.USBMonitor.UsbControlBlock;\nimport com.serenegiant.usb.UVCCamera;\nimport com.serenegiant.usbcameracommon.UVCCameraHandler;\nimport com.serenegiant.widget.CameraViewInterface;\nimport com.serenegiant.widget.UVCCameraTextureView;\n\n/**\n * Show side by side view from two camera.\n * You cane record video images from both camera, but secondarily started recording can not record\n * audio because of limitation of Android AudioRecord(only one instance of AudioRecord is available\n * on the device) now.\n */\npublic final class MainActivity extends BaseActivity implements CameraDialog.CameraDialogParent {\n\tprivate static final boolean DEBUG = false;\t// FIXME set false when production\n\tprivate static final String TAG = \"MainActivity\";\n\n\tprivate static final float[] BANDWIDTH_FACTORS = { 0.5f, 0.5f };\n\n    // for accessing USB and USB camera\n    private USBMonitor mUSBMonitor;\n\n\tprivate UVCCameraHandler mHandlerR;\n\tprivate CameraViewInterface mUVCCameraViewR;\n\tprivate ImageButton mCaptureButtonR;\n\tprivate Surface mRightPreviewSurface;\n\n\tprivate UVCCameraHandler mHandlerL;\n\tprivate CameraViewInterface mUVCCameraViewL;\n\tprivate ImageButton mCaptureButtonL;\n\tprivate Surface mLeftPreviewSurface;\n\n\n\t@Override\n\tprotected void onCreate(final Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_main);\n\n\t\tfindViewById(R.id.RelativeLayout1).setOnClickListener(mOnClickListener);\n\t\tmUVCCameraViewL = (CameraViewInterface)findViewById(R.id.camera_view_L);\n\t\tmUVCCameraViewL.setAspectRatio(UVCCamera.DEFAULT_PREVIEW_WIDTH / (float)UVCCamera.DEFAULT_PREVIEW_HEIGHT);\n\t\t((UVCCameraTextureView)mUVCCameraViewL).setOnClickListener(mOnClickListener);\n\t\tmCaptureButtonL = (ImageButton)findViewById(R.id.capture_button_L);\n\t\tmCaptureButtonL.setOnClickListener(mOnClickListener);\n\t\tmCaptureButtonL.setVisibility(View.INVISIBLE);\n\t\tmHandlerL = UVCCameraHandler.createHandler(this, mUVCCameraViewL, UVCCamera.DEFAULT_PREVIEW_WIDTH, UVCCamera.DEFAULT_PREVIEW_HEIGHT, BANDWIDTH_FACTORS[0]);\n\n\t\tmUVCCameraViewR = (CameraViewInterface)findViewById(R.id.camera_view_R);\n\t\tmUVCCameraViewR.setAspectRatio(UVCCamera.DEFAULT_PREVIEW_WIDTH / (float)UVCCamera.DEFAULT_PREVIEW_HEIGHT);\n\t\t((UVCCameraTextureView)mUVCCameraViewR).setOnClickListener(mOnClickListener);\n\t\tmCaptureButtonR = (ImageButton)findViewById(R.id.capture_button_R);\n\t\tmCaptureButtonR.setOnClickListener(mOnClickListener);\n\t\tmCaptureButtonR.setVisibility(View.INVISIBLE);\n\t\tmHandlerR = UVCCameraHandler.createHandler(this, mUVCCameraViewR, UVCCamera.DEFAULT_PREVIEW_WIDTH, UVCCamera.DEFAULT_PREVIEW_HEIGHT, BANDWIDTH_FACTORS[1]);\n\n\t\tmUSBMonitor = new USBMonitor(this, mOnDeviceConnectListener);\n\t}\n\n\t@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tmUSBMonitor.register();\n\t\tif (mUVCCameraViewR != null)\n\t\t\tmUVCCameraViewR.onResume();\n\t\tif (mUVCCameraViewL != null)\n\t\t\tmUVCCameraViewL.onResume();\n\t}\n\n\t@Override\n\tprotected void onStop() {\n\t\tmHandlerR.close();\n\t\tif (mUVCCameraViewR != null)\n\t\t\tmUVCCameraViewR.onPause();\n\t\tmHandlerL.close();\n\t\tmCaptureButtonR.setVisibility(View.INVISIBLE);\n\t\tif (mUVCCameraViewL != null)\n\t\t\tmUVCCameraViewL.onPause();\n\t\tmCaptureButtonL.setVisibility(View.INVISIBLE);\n\t\tmUSBMonitor.unregister();\n\t\tsuper.onStop();\n\t}\n\n\t@Override\n\tprotected void onDestroy() {\n\t\tif (mHandlerR != null) {\n\t\t\tmHandlerR = null;\n  \t\t}\n\t\tif (mHandlerL != null) {\n\t\t\tmHandlerL = null;\n  \t\t}\n\t\tif (mUSBMonitor != null) {\n\t\t\tmUSBMonitor.destroy();\n\t\t\tmUSBMonitor = null;\n\t\t}\n\t\tmUVCCameraViewR = null;\n\t\tmCaptureButtonR = null;\n\t\tmUVCCameraViewL = null;\n\t\tmCaptureButtonL = null;\n\t\tsuper.onDestroy();\n\t}\n\n\tprivate final OnClickListener mOnClickListener = new OnClickListener() {\n\t\t@Override\n\t\tpublic void onClick(final View view) {\n\t\t\tswitch (view.getId()) {\n\t\t\tcase R.id.camera_view_L:\n\t\t\t\tif (mHandlerL != null) {\n\t\t\t\t\tif (!mHandlerL.isOpened()) {\n\t\t\t\t\t\tCameraDialog.showDialog(MainActivity.this);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmHandlerL.close();\n\t\t\t\t\t\tsetCameraButton();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase R.id.capture_button_L:\n\t\t\t\tif (mHandlerL != null) {\n\t\t\t\t\tif (mHandlerL.isOpened()) {\n\t\t\t\t\t\tif (checkPermissionWriteExternalStorage() && checkPermissionAudio()) {\n\t\t\t\t\t\t\tif (!mHandlerL.isRecording()) {\n\t\t\t\t\t\t\t\tmCaptureButtonL.setColorFilter(0xffff0000);\t// turn red\n\t\t\t\t\t\t\t\tmHandlerL.startRecording();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmCaptureButtonL.setColorFilter(0);\t// return to default color\n\t\t\t\t\t\t\t\tmHandlerL.stopRecording();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase R.id.camera_view_R:\n\t\t\t\tif (mHandlerR != null) {\n\t\t\t\t\tif (!mHandlerR.isOpened()) {\n\t\t\t\t\t\tCameraDialog.showDialog(MainActivity.this);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmHandlerR.close();\n\t\t\t\t\t\tsetCameraButton();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase R.id.capture_button_R:\n\t\t\t\tif (mHandlerR != null) {\n\t\t\t\t\tif (mHandlerR.isOpened()) {\n\t\t\t\t\t\tif (checkPermissionWriteExternalStorage() && checkPermissionAudio()) {\n\t\t\t\t\t\t\tif (!mHandlerR.isRecording()) {\n\t\t\t\t\t\t\t\tmCaptureButtonR.setColorFilter(0xffff0000);\t// turn red\n\t\t\t\t\t\t\t\tmHandlerR.startRecording();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmCaptureButtonR.setColorFilter(0);\t// return to default color\n\t\t\t\t\t\t\t\tmHandlerR.stopRecording();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate final OnDeviceConnectListener mOnDeviceConnectListener = new OnDeviceConnectListener() {\n\t\t@Override\n\t\tpublic void onAttach(final UsbDevice device) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onAttach:\" + device);\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_ATTACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onConnect(final UsbDevice device, final UsbControlBlock ctrlBlock, final boolean createNew) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onConnect:\" + device);\n\t\t\tif (!mHandlerL.isOpened()) {\n\t\t\t\tmHandlerL.open(ctrlBlock);\n\t\t\t\tfinal SurfaceTexture st = mUVCCameraViewL.getSurfaceTexture();\n\t\t\t\tmHandlerL.startPreview(new Surface(st));\n\t\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tmCaptureButtonL.setVisibility(View.VISIBLE);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (!mHandlerR.isOpened()) {\n\t\t\t\tmHandlerR.open(ctrlBlock);\n\t\t\t\tfinal SurfaceTexture st = mUVCCameraViewR.getSurfaceTexture();\n\t\t\t\tmHandlerR.startPreview(new Surface(st));\n\t\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tmCaptureButtonR.setVisibility(View.VISIBLE);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDisconnect(final UsbDevice device, final UsbControlBlock ctrlBlock) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onDisconnect:\" + device);\n\t\t\tif ((mHandlerL != null) && !mHandlerL.isEqual(device)) {\n\t\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tmHandlerL.close();\n\t\t\t\t\t\tif (mLeftPreviewSurface != null) {\n\t\t\t\t\t\t\tmLeftPreviewSurface.release();\n\t\t\t\t\t\t\tmLeftPreviewSurface = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetCameraButton();\n\t\t\t\t\t}\n\t\t\t\t}, 0);\n\t\t\t} else if ((mHandlerR != null) && !mHandlerR.isEqual(device)) {\n\t\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tmHandlerR.close();\n\t\t\t\t\t\tif (mRightPreviewSurface != null) {\n\t\t\t\t\t\t\tmRightPreviewSurface.release();\n\t\t\t\t\t\t\tmRightPreviewSurface = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetCameraButton();\n\t\t\t\t\t}\n\t\t\t\t}, 0);\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDettach(final UsbDevice device) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onDettach:\" + device);\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_DETACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onCancel(final UsbDevice device) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onCancel:\");\n\t\t}\n\t};\n\n\t/**\n\t * to access from CameraDialog\n\t * @return\n\t */\n\t@Override\n\tpublic USBMonitor getUSBMonitor() {\n\t\treturn mUSBMonitor;\n\t}\n\n\t@Override\n\tpublic void onDialogResult(boolean canceled) {\n\t\tif (canceled) {\n\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tsetCameraButton();\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t}\n\t}\n\n\tprivate void setCameraButton() {\n\t\trunOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tif ((mHandlerL != null) && !mHandlerL.isOpened() && (mCaptureButtonL != null)) {\n\t\t\t\t\tmCaptureButtonL.setVisibility(View.INVISIBLE);\n\t\t\t\t}\n\t\t\t\tif ((mHandlerR != null) && !mHandlerR.isOpened() && (mCaptureButtonR != null)) {\n\t\t\t\t\tmCaptureButtonR.setVisibility(View.INVISIBLE);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t}\n}\n"
  },
  {
    "path": "usbCameraTest7/src/main/res/drawable/border.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\"\n    android:useLevel=\"false\" >\n\n    <stroke\n        android:width=\"3px\"\n        android:color=\"@color/GRAY\" />\n\n    <!-- <solid android:color=\"@color/TRANSPARENT\" />　 -->\n    <solid android:color=\"@null\" />\n\n    <padding\n        android:bottom=\"2px\"\n        android:left=\"2px\"\n        android:right=\"2px\"\n        android:top=\"2px\" />\n\n    <corners android:radius=\"2px\" />\n\n</shape>"
  },
  {
    "path": "usbCameraTest7/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/RelativeLayout1\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"#ff000000\"\n    tools:context=\"com.serenegiant.usbcameratest3.MainActivity\"\n    tools:ignore=\"MergeRootFrame\" >\n\n    <TextView\n        android:id=\"@+id/textView1\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"Touch screen to select camera\"\n        android:textColor=\"#FFFF0000\" />\n\n    <LinearLayout\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@id/textView1\"\n        android:layout_centerInParent=\"true\"\n        android:baselineAligned=\"false\" >\n\n        <RelativeLayout\n\t        android:id=\"@+id/camera_layout_L\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"match_parent\"\n            android:layout_weight=\"1\" >\n\n            <com.serenegiant.widget.UVCCameraTextureView\n                android:id=\"@+id/camera_view_L\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"match_parent\"\n                android:layout_centerHorizontal=\"true\"\n                android:layout_centerVertical=\"true\" />\n\n            <ImageView\n                android:id=\"@+id/frame_image_L\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignBottom=\"@+id/camera_view_L\"\n                android:layout_alignLeft=\"@+id/camera_view_L\"\n                android:layout_alignRight=\"@+id/camera_view_L\"\n                android:layout_alignTop=\"@+id/camera_view_L\"\n                android:src=\"@drawable/border\" />\n\t\t\t<ImageButton\n\t\t\t\tandroid:id=\"@+id/capture_button_L\"\n\t\t\t\tandroid:layout_width=\"@dimen/button_size\"\n\t\t\t\tandroid:layout_height=\"@dimen/button_size\"\n\t\t\t\tandroid:layout_alignBottom=\"@id/camera_view_L\"\n\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\tandroid:layout_marginBottom=\"6dp\"\n\t\t\t\tandroid:background=\"@null\"\n\t\t\t\tandroid:scaleType=\"centerCrop\"\n\t\t\t\tandroid:src=\"@android:drawable/ic_menu_camera\" />\n        </RelativeLayout>\n\n        <RelativeLayout\n\t        android:id=\"@+id/camera_layout_R\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"match_parent\"\n            android:layout_weight=\"1\" >\n\n            <com.serenegiant.widget.UVCCameraTextureView\n                android:id=\"@+id/camera_view_R\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"match_parent\"\n                android:layout_centerHorizontal=\"true\"\n                android:layout_centerVertical=\"true\" />\n\n            <ImageView\n                android:id=\"@+id/frame_image_R\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignBottom=\"@+id/camera_view_R\"\n                android:layout_alignLeft=\"@+id/camera_view_R\"\n                android:layout_alignRight=\"@+id/camera_view_R\"\n                android:layout_alignTop=\"@+id/camera_view_R\"\n                android:src=\"@drawable/border\" />\n\t\t\t<ImageButton\n\t\t\t\tandroid:id=\"@+id/capture_button_R\"\n\t\t\t\tandroid:layout_width=\"@dimen/button_size\"\n\t\t\t\tandroid:layout_height=\"@dimen/button_size\"\n\t\t\t\tandroid:layout_alignBottom=\"@id/camera_view_R\"\n\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\tandroid:layout_marginBottom=\"6dp\"\n\t\t\t\tandroid:background=\"@null\"\n\t\t\t\tandroid:scaleType=\"centerCrop\"\n\t\t\t\tandroid:src=\"@android:drawable/ic_menu_camera\" />\n        </RelativeLayout>\n    </LinearLayout>\n\n</RelativeLayout>"
  },
  {
    "path": "usbCameraTest7/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n\n    <!-- Web colors -->\n    <color name=\"CLEAR\">#00000000</color>\n    <color name=\"HALF_CLEAR_WHITE\">#7fffffff</color>\n    <color name=\"QUATER_CLEAR_WHITE\">#3fffffff</color>\n    <color name=\"TRANSPARENT\">#00000000</color>\n    <color name=\"BLACK\">#ff000000</color>\n    <color name=\"ALICEBLUE\">#fff0f8ff</color>\n    <color name=\"DARKCYAN\">#ff008b8b</color>\n    <color name=\"LIGHTYELLOW\">#ffffffe0</color>\n    <color name=\"CORAL\">#ffff7f50</color>\n    <color name=\"DIMGRAY\">#ff696969</color>\n    <color name=\"LAVENDER\">#ffe6e6fa</color>\n    <color name=\"TEAL\">#ff008080</color>\n    <color name=\"LIGHTGOLDENRODYELLOW\">#fffafad2</color>\n    <color name=\"TOMATO\">#ffff6347</color>\n    <color name=\"GRAY\">#ff808080</color>\n    <color name=\"LIGHTSTEELBLUE\">#ffb0c4de</color>\n    <color name=\"DARKSLATEGRAY\">#ff2f4f4f</color>\n    <color name=\"LEMONCHIFFON\">#fffffacd</color>\n    <color name=\"ORANGERED\">#ffff4500</color>\n    <color name=\"DARKGRAY\">#ffa9a9a9</color>\n    <color name=\"LIGHTSLATEGRAY\">#ff778899</color>\n    <color name=\"DARKGREEN\">#ff006400</color>\n    <color name=\"WHEAT\">#fff5deb3</color>\n    <color name=\"RED\">#ffff0000</color>\n    <color name=\"SILVER\">#ffc0c0c0</color>\n    <color name=\"SLATEGRAY\">#ff708090</color>\n    <color name=\"GREEN\">#ff008000</color>\n    <color name=\"BURLYWOOD\">#ffdeb887</color>\n    <color name=\"CRIMSON\">#ffdc143c</color>\n    <color name=\"LIGHTGRAY\">#ffd3d3d3</color>\n    <color name=\"STEELBLUE\">#ff4682b4</color>\n    <color name=\"FORESTGREEN\">#ff228b22</color>\n    <color name=\"TAN\">#ffd2b48c</color>\n    <color name=\"MEDIUMVIOLETRED\">#ffc71585</color>\n    <color name=\"GAINSBORO\">#ffdcdcdc</color>\n    <color name=\"ROYALBLUE\">#ff4169e1</color>\n    <color name=\"SEAGREEN\">#ff2e8b57</color>\n    <color name=\"KHAKI\">#fff0e68c</color>\n    <color name=\"DEEPPINK\">#ffff1493</color>\n    <color name=\"WHITESMOKE\">#fff5f5f5</color>\n    <color name=\"MIDNIGHTBLUE\">#ff191970</color>\n    <color name=\"MEDIUMSEAGREEN\">#ff3cb371</color>\n    <color name=\"YELLOW\">#ffffff00</color>\n    <color name=\"HOTPINK\">#ffff69b4</color>\n    <color name=\"WHITE\">#ffffffff</color>\n    <color name=\"NAVY\">#ff000080</color>\n    <color name=\"MEDIUMAQUAMARINE\">#ff66cdaa</color>\n    <color name=\"GOLD\">#ffffd700</color>\n    <color name=\"PALEVIOLETRED\">#ffdb7093</color>\n    <color name=\"SNOW\">#fffffafa</color>\n    <color name=\"DARKBLUE\">#ff00008b</color>\n    <color name=\"DARKSEAGREEN\">#ff8fbc8f</color>\n    <color name=\"ORANGE\">#ffffa500</color>\n    <color name=\"PINK\">#ffffc0cb</color>\n    <color name=\"GHOSTWHITE\">#fff8f8ff</color>\n    <color name=\"MEDIUMBLUE\">#ff0000cd</color>\n    <color name=\"AQUAMARINE\">#ff7fffd4</color>\n    <color name=\"SANDYBROWN\">#fff4a460</color>\n    <color name=\"LIGHTPINK\">#ffffb6c1</color>\n    <color name=\"FLORALWHITE\">#fffffaf0</color>\n    <color name=\"BLUE\">#ff0000ff</color>\n    <color name=\"PALEGREEN\">#ff98fb98</color>\n    <color name=\"DARKORANGE\">#ffff8c00</color>\n    <color name=\"THISTLE\">#ffd8bfd8</color>\n    <color name=\"LINEN\">#fffaf0e6</color>\n    <color name=\"DODGERBLUE\">#ff1e90ff</color>\n    <color name=\"LIGHTGREEN\">#ff90ee90</color>\n    <color name=\"GOLDENROD\">#ffdaa520</color>\n    <color name=\"MAGENTA\">#ffff00ff</color>\n    <color name=\"ANTIQUEWHITE\">#fffaebd7</color>\n    <color name=\"CORNFLOWERBLUE\">#ff6495ed</color>\n    <color name=\"SPRINGGREEN\">#ff00ff7f</color>\n    <color name=\"PERU\">#ffcd853f</color>\n    <color name=\"FUCHSIA\">#ffff00ff</color>\n    <color name=\"PAPAYAWHIP\">#ffffefd5</color>\n    <color name=\"DEEPSKYBLUE\">#ff00bfff</color>\n    <color name=\"MEDIUMSPRINGGREEN\">#ff00fa9a</color>\n    <color name=\"DARKGOLDENROD\">#ffb8860b</color>\n    <color name=\"VIOLET\">#ffee82ee</color>\n    <color name=\"BLANCHEDALMOND\">#ffffebcd</color>\n    <color name=\"LIGHTSKYBLUE\">#ff87cefa</color>\n    <color name=\"LAWNGREEN\">#ff7cfc00</color>\n    <color name=\"CHOCOLATE\">#ffd2691e</color>\n    <color name=\"PLUM\">#ffdda0dd</color>\n    <color name=\"BISQUE\">#ffffe4c4</color>\n    <color name=\"SKYBLUE\">#ff87ceeb</color>\n    <color name=\"CHARTREUSE\">#ff7fff00</color>\n    <color name=\"SIENNA\">#ffa0522d</color>\n    <color name=\"ORCHID\">#ffda70d6</color>\n    <color name=\"MOCCASIN\">#ffffe4b5</color>\n    <color name=\"LIGHTBLUE\">#ffadd8e6</color>\n    <color name=\"GREENYELLOW\">#ffadff2f</color>\n    <color name=\"SADDLEBROWN\">#ff8b4513</color>\n    <color name=\"MEDIUMORCHID\">#ffba55d3</color>\n    <color name=\"NAVAJOWHITE\">#ffffdead</color>\n    <color name=\"POWDERBLUE\">#ffb0e0e6</color>\n    <color name=\"LIME\">#ff00ff00</color>\n    <color name=\"MAROON\">#ff800000</color>\n    <color name=\"DARKORCHID\">#ff9932cc</color>\n    <color name=\"PEACHPUFF\">#ffffdab9</color>\n    <color name=\"PALETURQUOISE\">#ffafeeee</color>\n    <color name=\"LIMEGREEN\">#ff32cd32</color>\n    <color name=\"DARKRED\">#ff8b0000</color>\n    <color name=\"DARKVIOLET\">#ff9400d3</color>\n    <color name=\"MISTYROSE\">#ffffe4e1</color>\n    <color name=\"LIGHTCYAN\">#ffe0ffff</color>\n    <color name=\"YELLOWGREEN\">#ff9acd32</color>\n    <color name=\"BROWN\">#ffa52a2a</color>\n    <color name=\"DARKMAGENTA\">#ff8b008b</color>\n    <color name=\"LAVENDERBLUSH\">#fffff0f5</color>\n    <color name=\"CYAN\">#ff00ffff</color>\n    <color name=\"DARKOLIVEGREEN\">#ff556b2f</color>\n    <color name=\"FIREBRICK\">#ffb22222</color>\n    <color name=\"PURPLE\">#ff800080</color>\n    <color name=\"SEASHELL\">#fffff5ee</color>\n    <color name=\"AQUA\">#ff00ffff</color>\n    <color name=\"OLIVEDRAB\">#ff6b8e23</color>\n    <color name=\"INDIANRED\">#ffcd5c5c</color>\n    <color name=\"INDIGO\">#ff4b0082</color>\n    <color name=\"OLDLACE\">#fffdf5e6</color>\n    <color name=\"TURQUOISE\">#ff40e0d0</color>\n    <color name=\"OLIVE\">#ff808000</color>\n    <color name=\"ROSYBROWN\">#ffbc8f8f</color>\n    <color name=\"DARKSLATEBLUE\">#ff483d8b</color>\n    <color name=\"IVORY\">#fffffff0</color>\n    <color name=\"MEDIUMTURQUOISE\">#ff48d1cc</color>\n    <color name=\"DARKKHAKI\">#ffbdb76b</color>\n    <color name=\"DARKSALMON\">#ffe9967a</color>\n    <color name=\"BLUEVIOLET\">#ff8a2be2</color>\n    <color name=\"HONEYDEW\">#fff0fff0</color>\n    <color name=\"DARKTURQUOISE\">#ff00ced1</color>\n    <color name=\"PALEGOLDENROD\">#ffeee8aa</color>\n    <color name=\"LIGHTCORAL\">#fff08080</color>\n    <color name=\"MEDIUMPURPLE\">#ff9370db</color>\n    <color name=\"MINTCREAM\">#fff5fffa</color>\n    <color name=\"LIGHTSEAGREEN\">#ff20b2aa</color>\n    <color name=\"CORNSILK\">#fffff8dc</color>\n    <color name=\"SALMON\">#fffa8072</color>\n    <color name=\"SLATEBLUE\">#ff6a5acd</color>\n    <color name=\"AZURE\">#fff0ffff</color>\n    <color name=\"CADETBLUE\">#ff5f9ea0</color>\n    <color name=\"BEIGE\">#fff5f5dc</color>\n    <color name=\"LIGHTSALMON\">#ffffa07a</color>\n    <color name=\"MEDIUMSLATEBLUE\">#ff7b68ee</color>\n\n</resources>"
  },
  {
    "path": "usbCameraTest7/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n\n\t<!-- Default screen margins, per the Android Design guidelines. -->\n\t<dimen name=\"activity_horizontal_margin\">16dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">16dp</dimen>\n\t<dimen name=\"button_size\">48dp</dimen>\n</resources>\n"
  },
  {
    "path": "usbCameraTest7/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBCameraTest7(dual camera)</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest7/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme, dependent on API level. This theme is replaced\n        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Light\">\n        <!--\n            Theme customizations available in newer API levels can go in\n            res/values-vXX/styles.xml, while customizations related to\n            backward-compatibility can go here.\n        -->\n    </style>\n\n    <!-- Application theme. -->\n    <style name=\"AppTheme\" parent=\"AppBaseTheme\">\n        <!-- All customizations that are NOT specific to a particular API-level can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest7/src/main/res/values-ja/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<resources>\n    <string name=\"app_name\">USBカメラテスト7(デュアルカメラ)</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest7/src/main/res/values-v11/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 11+. This theme completely replaces\n        AppBaseTheme from res/values/styles.xml on API 11+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light\">\n        <!-- API 11 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest7/src/main/res/values-v14/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n        Base application theme for API 14+. This theme completely replaces\n        AppBaseTheme from BOTH res/values/styles.xml and\n        res/values-v11/styles.xml on API 14+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light.DarkActionBar\">\n        <!-- API 14 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest7/src/main/res/values-w820dp/dimens.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n    <!--\n         Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively).\n    -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">64dp</dimen>\n\t<dimen name=\"button_size\">48dp</dimen>\n\t<dimen name=\"list_font_size\">24sp</dimen>\n    \n</resources>\n"
  },
  {
    "path": "usbCameraTest7/src/main/res/xml/device_filter.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<usb>\n\t<usb-device class=\"239\" subclass=\"2\" />\t<!-- all device of UVC -->\n</usb>\n"
  },
  {
    "path": "usbCameraTest8/build.gradle",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\napply plugin: 'com.android.application'\n\nandroid {\n\tcompileSdkVersion versionCompiler\n\tbuildToolsVersion versionBuildTool\n\n\tcompileOptions {\n\t\tsourceCompatibility javaSourceCompatibility\n\t\ttargetCompatibility javaTargetCompatibility\n\t}\n\n\tdefaultConfig {\n\t\tapplicationId \"com.serenegiant.usbcameratest8\"\n\t\tminSdkVersion 18\n\t\ttargetSdkVersion versionTarget\n\t\tversionCode 1\n\t\tversionName \"1.0\"\n\n\t\ttestInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n\n\t}\n\tbuildTypes {\n\t\trelease {\n\t\t\tminifyEnabled false\n\t\t\tproguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n\t\t}\n\t}\n}\n\ndependencies {\n\tapi fileTree(dir: 'libs', include: ['*.jar'])\n\n\timplementation \"com.android.support:support-v4:${supportLibVersion}\"\n\timplementation \"com.android.support:support-annotations:${supportLibVersion}\"\n\n\tandroidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {\n\t\texclude group: 'com.android.support', module: 'support-annotations'\n\t})\n\ttestImplementation 'junit:junit:4.12'\n\n\timplementation(\"com.serenegiant:common:${commonLibVersion}\") {\n\t\texclude module: 'support-v4'\n\t}\n\timplementation project(':libuvccamera')\n\timplementation project(':usbCameraCommon')\n}\n"
  },
  {
    "path": "usbCameraTest8/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /Users/saki/android-sdks/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "usbCameraTest8/src/androidTest/java/com/serenegiant/usbcameratest8/ExampleInstrumentedTest.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usbcameratest8;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static org.junit.Assert.*;\n\n/**\n * Instrumentation test, which will execute on an Android device.\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\n@RunWith(AndroidJUnit4.class)\npublic class ExampleInstrumentedTest {\n\t@Test\n\tpublic void useAppContext() throws Exception {\n\t\t// Context of the app under test.\n\t\tContext appContext = InstrumentationRegistry.getTargetContext();\n\n\t\tassertEquals(\"com.serenegiant.usbcameratest8\", appContext.getPackageName());\n\t}\n}\n"
  },
  {
    "path": "usbCameraTest8/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\t\t  package=\"com.serenegiant.usbcameratest8\">\n\n\t<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>\n\t<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n\n\t<uses-feature android:glEsVersion=\"0x00020000\" android:required=\"true\" />\n\n\t<application\n\t\tandroid:allowBackup=\"true\"\n\t\tandroid:icon=\"@mipmap/ic_launcher\"\n\t\tandroid:label=\"@string/app_name\"\n\t\tandroid:supportsRtl=\"true\"\n\t\tandroid:theme=\"@style/AppTheme\">\n\t\t<activity\n\t\t\tandroid:name=\".MainActivity\"\n\t\t\tandroid:screenOrientation=\"sensorLandscape\"\n\t\t\tandroid:label=\"@string/app_name\">\n\t\t\t<intent-filter>\n\t\t\t\t<action android:name=\"android.intent.action.MAIN\"/>\n\n\t\t\t\t<category android:name=\"android.intent.category.LAUNCHER\"/>\n\t\t\t</intent-filter>\n\t\t</activity>\n\t</application>\n\n</manifest>"
  },
  {
    "path": "usbCameraTest8/src/main/java/com/serenegiant/usbcameratest8/MainActivity.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usbcameratest8;\n\nimport android.animation.Animator;\nimport android.graphics.SurfaceTexture;\nimport android.hardware.usb.UsbDevice;\nimport android.os.Bundle;\nimport android.support.annotation.NonNull;\nimport android.util.Log;\nimport android.view.Surface;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.view.View.OnLongClickListener;\nimport android.widget.CompoundButton;\nimport android.widget.ImageButton;\nimport android.widget.SeekBar;\nimport android.widget.Toast;\nimport android.widget.ToggleButton;\n\nimport com.serenegiant.common.BaseActivity;\n\nimport com.serenegiant.usb.CameraDialog;\nimport com.serenegiant.usbcameracommon.UVCCameraHandler;\nimport com.serenegiant.usb.USBMonitor;\nimport com.serenegiant.usb.USBMonitor.OnDeviceConnectListener;\nimport com.serenegiant.usb.USBMonitor.UsbControlBlock;\nimport com.serenegiant.usb.UVCCamera;\nimport com.serenegiant.utils.ViewAnimationHelper;\nimport com.serenegiant.widget.CameraViewInterface;\n\npublic final class MainActivity extends BaseActivity implements CameraDialog.CameraDialogParent {\n\tprivate static final boolean DEBUG = true;\t// TODO set false on release\n\tprivate static final String TAG = \"MainActivity\";\n\n\t/**\n\t * set true if you want to record movie using MediaSurfaceEncoder\n\t * (writing frame data into Surface camera from MediaCodec\n\t *  by almost same way as USBCameratest2)\n\t * set false if you want to record movie using MediaVideoEncoder\n\t */\n    private static final boolean USE_SURFACE_ENCODER = false;\n\n    /**\n     * preview resolution(width)\n     * if your camera does not support specific resolution and mode,\n     * {@link UVCCamera#setPreviewSize(int, int, int)} throw exception\n     */\n    private static final int PREVIEW_WIDTH = 640;\n    /**\n     * preview resolution(height)\n     * if your camera does not support specific resolution and mode,\n     * {@link UVCCamera#setPreviewSize(int, int, int)} throw exception\n     */\n    private static final int PREVIEW_HEIGHT = 480;\n    /**\n     * preview mode\n     * if your camera does not support specific resolution and mode,\n     * {@link UVCCamera#setPreviewSize(int, int, int)} throw exception\n     * 0:YUYV, other:MJPEG\n     */\n    private static final int PREVIEW_MODE = 1;\n\n\tprotected static final int SETTINGS_HIDE_DELAY_MS = 2500;\n\n\t/**\n\t * for accessing USB\n\t */\n\tprivate USBMonitor mUSBMonitor;\n\t/**\n\t * Handler to execute camera related methods sequentially on private thread\n\t */\n\tprivate UVCCameraHandler mCameraHandler;\n\t/**\n\t * for camera preview display\n\t */\n\tprivate CameraViewInterface mUVCCameraView;\n\t/**\n\t * for open&start / stop&close camera preview\n\t */\n\tprivate ToggleButton mCameraButton;\n\t/**\n\t * button for start/stop recording\n\t */\n\tprivate ImageButton mCaptureButton;\n\n\tprivate View mBrightnessButton, mContrastButton;\n\tprivate View mResetButton;\n\tprivate View mToolsLayout, mValueLayout;\n\tprivate SeekBar mSettingSeekbar;\n\n\t@Override\n\tprotected void onCreate(final Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tif (DEBUG) Log.v(TAG, \"onCreate:\");\n\t\tsetContentView(R.layout.activity_main);\n\t\tmCameraButton = (ToggleButton)findViewById(R.id.camera_button);\n\t\tmCameraButton.setOnCheckedChangeListener(mOnCheckedChangeListener);\n\t\tmCaptureButton = (ImageButton)findViewById(R.id.capture_button);\n\t\tmCaptureButton.setOnClickListener(mOnClickListener);\n\t\tmCaptureButton.setVisibility(View.INVISIBLE);\n\t\tfinal View view = findViewById(R.id.camera_view);\n\t\tview.setOnLongClickListener(mOnLongClickListener);\n\t\tmUVCCameraView = (CameraViewInterface)view;\n\t\tmUVCCameraView.setAspectRatio(PREVIEW_WIDTH / (float)PREVIEW_HEIGHT);\n\n\t\tmBrightnessButton = findViewById(R.id.brightness_button);\n\t\tmBrightnessButton.setOnClickListener(mOnClickListener);\n\t\tmContrastButton = findViewById(R.id.contrast_button);\n\t\tmContrastButton.setOnClickListener(mOnClickListener);\n\t\tmResetButton = findViewById(R.id.reset_button);\n\t\tmResetButton.setOnClickListener(mOnClickListener);\n\t\tmSettingSeekbar = (SeekBar)findViewById(R.id.setting_seekbar);\n\t\tmSettingSeekbar.setOnSeekBarChangeListener(mOnSeekBarChangeListener);\n\n\t\tmToolsLayout = findViewById(R.id.tools_layout);\n\t\tmToolsLayout.setVisibility(View.INVISIBLE);\n\t\tmValueLayout = findViewById(R.id.value_layout);\n\t\tmValueLayout.setVisibility(View.INVISIBLE);\n\n\t\tmUSBMonitor = new USBMonitor(this, mOnDeviceConnectListener);\n\t\tmCameraHandler = UVCCameraHandler.createHandler(this, mUVCCameraView,\n\t\t\tUSE_SURFACE_ENCODER ? 0 : 1, PREVIEW_WIDTH, PREVIEW_HEIGHT, PREVIEW_MODE);\n\t}\n\n\t@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tif (DEBUG) Log.v(TAG, \"onStart:\");\n\t\tmUSBMonitor.register();\n\t\tif (mUVCCameraView != null)\n\t\t\tmUVCCameraView.onResume();\n\t}\n\n\t@Override\n\tprotected void onStop() {\n\t\tif (DEBUG) Log.v(TAG, \"onStop:\");\n\t\tmCameraHandler.close();\n\t\tif (mUVCCameraView != null)\n\t\t\tmUVCCameraView.onPause();\n\t\tsetCameraButton(false);\n\t\tsuper.onStop();\n\t}\n\n\t@Override\n\tpublic void onDestroy() {\n\t\tif (DEBUG) Log.v(TAG, \"onDestroy:\");\n        if (mCameraHandler != null) {\n\t        mCameraHandler.release();\n\t        mCameraHandler = null;\n        }\n        if (mUSBMonitor != null) {\n\t        mUSBMonitor.destroy();\n\t        mUSBMonitor = null;\n        }\n        mUVCCameraView = null;\n        mCameraButton = null;\n        mCaptureButton = null;\n\t\tsuper.onDestroy();\n\t}\n\n\t/**\n\t * event handler when click camera / capture button\n\t */\n\tprivate final OnClickListener mOnClickListener = new OnClickListener() {\n\t\t@Override\n\t\tpublic void onClick(final View view) {\n\t\t\tswitch (view.getId()) {\n\t\t\tcase R.id.capture_button:\n\t\t\t\tif (mCameraHandler.isOpened()) {\n\t\t\t\t\tif (checkPermissionWriteExternalStorage() && checkPermissionAudio()) {\n\t\t\t\t\t\tif (!mCameraHandler.isRecording()) {\n\t\t\t\t\t\t\tmCaptureButton.setColorFilter(0xffff0000);\t// turn red\n\t\t\t\t\t\t\tmCameraHandler.startRecording();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmCaptureButton.setColorFilter(0);\t// return to default color\n\t\t\t\t\t\t\tmCameraHandler.stopRecording();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase R.id.brightness_button:\n\t\t\t\tshowSettings(UVCCamera.PU_BRIGHTNESS);\n\t\t\t\tbreak;\n\t\t\tcase R.id.contrast_button:\n\t\t\t\tshowSettings(UVCCamera.PU_CONTRAST);\n\t\t\t\tbreak;\n\t\t\tcase R.id.reset_button:\n\t\t\t\tresetSettings();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate final CompoundButton.OnCheckedChangeListener mOnCheckedChangeListener\n\t\t= new CompoundButton.OnCheckedChangeListener() {\n\t\t@Override\n\t\tpublic void onCheckedChanged(final CompoundButton compoundButton, final boolean isChecked) {\n\t\t\tswitch (compoundButton.getId()) {\n\t\t\tcase R.id.camera_button:\n\t\t\t\tif (isChecked && !mCameraHandler.isOpened()) {\n\t\t\t\t\tCameraDialog.showDialog(MainActivity.this);\n\t\t\t\t} else {\n\t\t\t\t\tmCameraHandler.close();\n\t\t\t\t\tsetCameraButton(false);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * capture still image when you long click on preview image(not on buttons)\n\t */\n\tprivate final OnLongClickListener mOnLongClickListener = new OnLongClickListener() {\n\t\t@Override\n\t\tpublic boolean onLongClick(final View view) {\n\t\t\tswitch (view.getId()) {\n\t\t\tcase R.id.camera_view:\n\t\t\t\tif (mCameraHandler.isOpened()) {\n\t\t\t\t\tif (checkPermissionWriteExternalStorage()) {\n\t\t\t\t\t\tmCameraHandler.captureStill();\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tprivate void setCameraButton(final boolean isOn) {\n\t\trunOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tif (mCameraButton != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmCameraButton.setOnCheckedChangeListener(null);\n\t\t\t\t\t\tmCameraButton.setChecked(isOn);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tmCameraButton.setOnCheckedChangeListener(mOnCheckedChangeListener);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!isOn && (mCaptureButton != null)) {\n\t\t\t\t\tmCaptureButton.setVisibility(View.INVISIBLE);\n\t\t\t\t}\n\t\t\t}\n\t\t}, 0);\n\t\tupdateItems();\n\t}\n\n\tprivate void startPreview() {\n\t\tfinal SurfaceTexture st = mUVCCameraView.getSurfaceTexture();\n\t\tmCameraHandler.startPreview(new Surface(st));\n\t\trunOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tmCaptureButton.setVisibility(View.VISIBLE);\n\t\t\t}\n\t\t});\n\t\tupdateItems();\n\t}\n\n\tprivate final OnDeviceConnectListener mOnDeviceConnectListener = new OnDeviceConnectListener() {\n\t\t@Override\n\t\tpublic void onAttach(final UsbDevice device) {\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_ATTACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onConnect(final UsbDevice device, final UsbControlBlock ctrlBlock, final boolean createNew) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onConnect:\");\n\t\t\tmCameraHandler.open(ctrlBlock);\n\t\t\tstartPreview();\n\t\t\tupdateItems();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onDisconnect(final UsbDevice device, final UsbControlBlock ctrlBlock) {\n\t\t\tif (DEBUG) Log.v(TAG, \"onDisconnect:\");\n\t\t\tif (mCameraHandler != null) {\n\t\t\t\tqueueEvent(new Runnable() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tmCameraHandler.close();\n\t\t\t\t\t}\n\t\t\t\t}, 0);\n\t\t\t\tsetCameraButton(false);\n\t\t\t\tupdateItems();\n\t\t\t}\n\t\t}\n\t\t@Override\n\t\tpublic void onDettach(final UsbDevice device) {\n\t\t\tToast.makeText(MainActivity.this, \"USB_DEVICE_DETACHED\", Toast.LENGTH_SHORT).show();\n\t\t}\n\n\t\t@Override\n\t\tpublic void onCancel(final UsbDevice device) {\n\t\t\tsetCameraButton(false);\n\t\t}\n\t};\n\n\t/**\n\t * to access from CameraDialog\n\t * @return\n\t */\n\t@Override\n\tpublic USBMonitor getUSBMonitor() {\n\t\treturn mUSBMonitor;\n\t}\n\n\t@Override\n\tpublic void onDialogResult(boolean canceled) {\n\t\tif (DEBUG) Log.v(TAG, \"onDialogResult:canceled=\" + canceled);\n\t\tif (canceled) {\n\t\t\tsetCameraButton(false);\n\t\t}\n\t}\n\n//================================================================================\n\tprivate boolean isActive() {\n\t\treturn mCameraHandler != null && mCameraHandler.isOpened();\n\t}\n\n\tprivate boolean checkSupportFlag(final int flag) {\n\t\treturn mCameraHandler != null && mCameraHandler.checkSupportFlag(flag);\n\t}\n\n\tprivate int getValue(final int flag) {\n\t\treturn mCameraHandler != null ? mCameraHandler.getValue(flag) : 0;\n\t}\n\n\tprivate int setValue(final int flag, final int value) {\n\t\treturn mCameraHandler != null ? mCameraHandler.setValue(flag, value) : 0;\n\t}\n\n\tprivate int resetValue(final int flag) {\n\t\treturn mCameraHandler != null ? mCameraHandler.resetValue(flag) : 0;\n\t}\n\n\tprivate void updateItems() {\n\t\trunOnUiThread(mUpdateItemsOnUITask, 100);\n\t}\n\n\tprivate final Runnable mUpdateItemsOnUITask = new Runnable() {\n\t\t@Override\n\t\tpublic void run() {\n\t\t\tif (isFinishing()) return;\n\t\t\tfinal int visible_active = isActive() ? View.VISIBLE : View.INVISIBLE;\n\t\t\tmToolsLayout.setVisibility(visible_active);\n\t\t\tmBrightnessButton.setVisibility(\n\t\t    \tcheckSupportFlag(UVCCamera.PU_BRIGHTNESS)\n\t\t    \t? visible_active : View.INVISIBLE);\n\t\t\tmContrastButton.setVisibility(\n\t\t    \tcheckSupportFlag(UVCCamera.PU_CONTRAST)\n\t\t    \t? visible_active : View.INVISIBLE);\n\t\t}\n\t};\n\n\tprivate int mSettingMode = -1;\n\t/**\n\t * 設定画面を表示\n\t * @param mode\n\t */\n\tprivate final void showSettings(final int mode) {\n\t\tif (DEBUG) Log.v(TAG, String.format(\"showSettings:%08x\", mode));\n\t\thideSetting(false);\n\t\tif (isActive()) {\n\t\t\tswitch (mode) {\n\t\t\tcase UVCCamera.PU_BRIGHTNESS:\n\t\t\tcase UVCCamera.PU_CONTRAST:\n\t\t\t\tmSettingMode = mode;\n\t\t\t\tmSettingSeekbar.setProgress(getValue(mode));\n\t\t\t\tViewAnimationHelper.fadeIn(mValueLayout, -1, 0, mViewAnimationListener);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void resetSettings() {\n\t\tif (isActive()) {\n\t\t\tswitch (mSettingMode) {\n\t\t\tcase UVCCamera.PU_BRIGHTNESS:\n\t\t\tcase UVCCamera.PU_CONTRAST:\n\t\t\t\tmSettingSeekbar.setProgress(resetValue(mSettingMode));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tmSettingMode = -1;\n\t\tViewAnimationHelper.fadeOut(mValueLayout, -1, 0, mViewAnimationListener);\n\t}\n\n\t/**\n\t * 設定画面を非表示にする\n\t * @param fadeOut trueならばフェードアウトさせる, falseなら即座に非表示にする\n\t */\n\tprotected final void hideSetting(final boolean fadeOut) {\n\t\tremoveFromUiThread(mSettingHideTask);\n\t\tif (fadeOut) {\n\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tViewAnimationHelper.fadeOut(mValueLayout, -1, 0, mViewAnimationListener);\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tmValueLayout.setVisibility(View.GONE);\n\t\t\t} catch (final Exception e) {\n\t\t\t\t// ignore\n\t\t\t}\n\t\t\tmSettingMode = -1;\n\t\t}\n\t}\n\n\tprotected final Runnable mSettingHideTask = new Runnable() {\n\t\t@Override\n\t\tpublic void run() {\n\t\t\thideSetting(true);\n\t\t}\n\t};\n\n\t/**\n\t * 設定値変更用のシークバーのコールバックリスナー\n\t */\n\tprivate final SeekBar.OnSeekBarChangeListener mOnSeekBarChangeListener = new SeekBar.OnSeekBarChangeListener() {\n\t\t@Override\n\t\tpublic void onProgressChanged(final SeekBar seekBar, final int progress, final boolean fromUser) {\n\t\t\t// 設定が変更された時はシークバーの非表示までの時間を延長する\n\t\t\tif (fromUser) {\n\t\t\t\trunOnUiThread(mSettingHideTask, SETTINGS_HIDE_DELAY_MS);\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void onStartTrackingTouch(final SeekBar seekBar) {\n\t\t}\n\n\t\t@Override\n\t\tpublic void onStopTrackingTouch(final SeekBar seekBar) {\n\t\t\t// シークバーにタッチして値を変更した時はonProgressChangedへ\n\t\t\t// 行かないみたいなのでここでも非表示までの時間を延長する\n\t\t\trunOnUiThread(mSettingHideTask, SETTINGS_HIDE_DELAY_MS);\n\t\t\tif (isActive() && checkSupportFlag(mSettingMode)) {\n\t\t\t\tswitch (mSettingMode) {\n\t\t\t\tcase UVCCamera.PU_BRIGHTNESS:\n\t\t\t\tcase UVCCamera.PU_CONTRAST:\n\t\t\t\t\tsetValue(mSettingMode, seekBar.getProgress());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\t// if (active)\n\t\t}\n\t};\n\n\tprivate final ViewAnimationHelper.ViewAnimationListener\n\t\tmViewAnimationListener = new ViewAnimationHelper.ViewAnimationListener() {\n\t\t@Override\n\t\tpublic void onAnimationStart(@NonNull final Animator animator, @NonNull final View target, final int animationType) {\n//\t\t\tif (DEBUG) Log.v(TAG, \"onAnimationStart:\");\n\t\t}\n\n\t\t@Override\n\t\tpublic void onAnimationEnd(@NonNull final Animator animator, @NonNull final View target, final int animationType) {\n\t\t\tfinal int id = target.getId();\n\t\t\tswitch (animationType) {\n\t\t\tcase ViewAnimationHelper.ANIMATION_FADE_IN:\n\t\t\tcase ViewAnimationHelper.ANIMATION_FADE_OUT:\n\t\t\t{\n\t\t\t\tfinal boolean fadeIn = animationType == ViewAnimationHelper.ANIMATION_FADE_IN;\n\t\t\t\tif (id == R.id.value_layout) {\n\t\t\t\t\tif (fadeIn) {\n\t\t\t\t\t\trunOnUiThread(mSettingHideTask, SETTINGS_HIDE_DELAY_MS);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmValueLayout.setVisibility(View.GONE);\n\t\t\t\t\t\tmSettingMode = -1;\n\t\t\t\t\t}\n\t\t\t\t} else if (!fadeIn) {\n//\t\t\t\t\ttarget.setVisibility(View.GONE);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void onAnimationCancel(@NonNull final Animator animator, @NonNull final View target, final int animationType) {\n//\t\t\tif (DEBUG) Log.v(TAG, \"onAnimationStart:\");\n\t\t}\n\t};\n\n}\n"
  },
  {
    "path": "usbCameraTest8/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n<RelativeLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\txmlns:tools=\"http://schemas.android.com/tools\"\n\tandroid:id=\"@+id/RelativeLayout1\"\n\tandroid:layout_width=\"match_parent\"\n\tandroid:layout_height=\"match_parent\"\n\tandroid:background=\"#ff000000\"\n\ttools:context=\"com.serenegiant.usbcameratest8.MainActivity\"\n\ttools:ignore=\"MergeRootFrame\">\n\n\t<com.serenegiant.widget.UVCCameraTextureView\n\t\tandroid:id=\"@+id/camera_view\"\n\t\tandroid:layout_width=\"match_parent\"\n\t\tandroid:layout_height=\"match_parent\"\n\t\tandroid:layout_centerHorizontal=\"true\"\n\t\tandroid:layout_centerVertical=\"true\"/>\n\n\t<ImageView\n\t\tandroid:id=\"@+id/frame_image\"\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignBottom=\"@+id/camera_view\"\n\t\tandroid:layout_alignLeft=\"@+id/camera_view\"\n\t\tandroid:layout_alignRight=\"@+id/camera_view\"\n\t\tandroid:layout_alignTop=\"@+id/camera_view\"\n\t\tandroid:src=\"@drawable/border\"/>\n\n\t<ToggleButton\n\t\tandroid:id=\"@+id/camera_button\"\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignBottom=\"@id/camera_view\"\n\t\tandroid:layout_alignLeft=\"@id/camera_view\"\n\t\tandroid:text=\"ToggleButton\"/>\n\n\t<ImageButton\n\t\tandroid:id=\"@+id/capture_button\"\n\t\tandroid:layout_width=\"@dimen/button_size\"\n\t\tandroid:layout_height=\"@dimen/button_size\"\n\t\tandroid:layout_alignBottom=\"@id/camera_view\"\n\t\tandroid:layout_centerHorizontal=\"true\"\n\t\tandroid:layout_marginBottom=\"6dp\"\n\t\tandroid:background=\"@null\"\n\t\tandroid:scaleType=\"centerCrop\"\n\t\tandroid:src=\"@android:drawable/ic_menu_camera\"/>\n\n\t<RelativeLayout\n\t\tandroid:id=\"@+id/tools_layout\"\n\t\tandroid:layout_width=\"match_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignLeft=\"@id/camera_view\"\n\t\tandroid:layout_alignRight=\"@id/camera_view\"\n\t\tandroid:layout_alignTop=\"@id/camera_view\">\n\n\t\t<Button\n\t\t\tandroid:id=\"@+id/brightness_button\"\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_alignParentLeft=\"true\"\n\t\t\tandroid:layout_centerVertical=\"true\"\n\t\t\tandroid:layout_marginLeft=\"@dimen/horizontal_margin_half\"\n\t\t\tandroid:layout_marginTop=\"@dimen/vertical_margin\"\n\t\t\tandroid:text=\"brightness\"/>\n\n\t\t<Button\n\t\t\tandroid:id=\"@+id/contrast_button\"\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_centerVertical=\"true\"\n\t\t\tandroid:layout_marginLeft=\"@dimen/horizontal_margin_half\"\n\t\t\tandroid:layout_marginTop=\"@dimen/vertical_margin\"\n\t\t\tandroid:layout_toRightOf=\"@+id/brightness_button\"\n\t\t\tandroid:text=\"contrast\"/>\n\n\t</RelativeLayout>\n\n\t<RelativeLayout\n\t\tandroid:id=\"@+id/value_layout\"\n\t\tandroid:layout_width=\"match_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:layout_centerInParent=\"true\"\n\t\tandroid:layout_alignLeft=\"@id/camera_view\"\n\t\tandroid:layout_alignRight=\"@id/camera_view\"\n\t\tandroid:background=\"#22ffffff\"\n\t\tandroid:visibility=\"invisible\">\n\n\t\t<ImageButton\n\t\t\tandroid:id=\"@+id/reset_button\"\n\t\t\tandroid:layout_width=\"@dimen/sz_icon_camera_ctrl\"\n\t\t\tandroid:layout_height=\"@dimen/sz_icon_camera_ctrl\"\n\t\t\tandroid:background=\"@null\"\n\t\t\tandroid:scaleType=\"fitXY\"\n\t\t\tandroid:src=\"@mipmap/ic_launcher\"/>\n\n\t\t<SeekBar\n\t\t\tandroid:id=\"@+id/setting_seekbar\"\n\t\t\tandroid:layout_width=\"match_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_centerInParent=\"true\"\n\t\t\tandroid:layout_toRightOf=\"@+id/reset_button\"\n\t\t\tandroid:max=\"100\"\n\t\t\tandroid:progress=\"50\"/>\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "usbCameraTest8/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\t<color name=\"colorPrimary\">#3F51B5</color>\n\t<color name=\"colorPrimaryDark\">#303F9F</color>\n\t<color name=\"colorAccent\">#FF4081</color>\n</resources>\n"
  },
  {
    "path": "usbCameraTest8/src/main/res/values/dimens.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\t<!-- Default screen margins, per the Android Design guidelines. -->\n\t<dimen name=\"activity_horizontal_margin\">16dp</dimen>\n\t<dimen name=\"activity_vertical_margin\">16dp</dimen>\n\n\t<dimen name=\"horizontal_margin\">8dp</dimen>\n\t<dimen name=\"vertical_margin\">8dp</dimen>\n\t<dimen name=\"horizontal_margin_half\">4dp</dimen>\n\t<dimen name=\"vertical_margin_half\">4dp</dimen>\n\t<dimen name=\"horizontal_margin2\">16dp</dimen>\n\t<dimen name=\"vertical_margin2\">16dp</dimen>\n\t<dimen name=\"sz_icon_camera_ctrl\">44dp</dimen>\n</resources>\n"
  },
  {
    "path": "usbCameraTest8/src/main/res/values/strings.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\t<string name=\"app_name\">usbCameraTest8</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest8/src/main/res/values/styles.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\n\t<!-- Base application theme. -->\n\t<style name=\"AppTheme\" parent=\"android:Theme.Holo.Light.DarkActionBar\">\n\t\t<!-- Customize your theme here. -->\n\t</style>\n\n</resources>\n"
  },
  {
    "path": "usbCameraTest8/src/main/res/values-ja/strings.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\t<string name=\"app_name\">USBカメラテスト8(カメラコントロール)</string>\n</resources>\n"
  },
  {
    "path": "usbCameraTest8/src/main/res/values-w820dp/dimens.xml",
    "content": "<!--\n  ~  UVCCamera\n  ~  library and sample to access to UVC web camera on non-rooted Android device\n  ~\n  ~ Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n  ~\n  ~  Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~  you may not use this file except in compliance with the License.\n  ~   You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~   Unless required by applicable law or agreed to in writing, software\n  ~   distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~   See the License for the specific language governing permissions and\n  ~   limitations under the License.\n  ~\n  ~  All files in the folder are under this Apache License, Version 2.0.\n  ~  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n  ~  may have a different license, see the respective files.\n  -->\n\n<resources>\n\t<!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n\t<dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "usbCameraTest8/src/test/java/com/serenegiant/usbcameratest8/ExampleUnitTest.java",
    "content": "/*\n *  UVCCamera\n *  library and sample to access to UVC web camera on non-rooted Android device\n *\n * Copyright (c) 2014-2017 saki t_saki@serenegiant.com\n *\n *  Licensed under the Apache License, Version 2.0 (the \"License\");\n *  you may not use this file except in compliance with the License.\n *   You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n *   Unless required by applicable law or agreed to in writing, software\n *   distributed under the License is distributed on an \"AS IS\" BASIS,\n *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *   See the License for the specific language governing permissions and\n *   limitations under the License.\n *\n *  All files in the folder are under this Apache License, Version 2.0.\n *  Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder\n *  may have a different license, see the respective files.\n */\n\npackage com.serenegiant.usbcameratest8;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\npublic class ExampleUnitTest {\n\t@Test\n\tpublic void addition_isCorrect() throws Exception {\n\t\tassertEquals(4, 2 + 2);\n\t}\n}"
  }
]